UNPKG

chromatic

Version:

Automate visual testing across browsers. Gather UI feedback. Versioned documentation.

38 lines • 72.4 kB
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="ed0a0bb0-5d78-563b-aba1-124c8b9f94a1")}catch(e){}}();
const e=require(`./chunk-gGpyby2o.cjs`),t=require(`./constants-BRMIuAJd.cjs`),n=require(`./icons-BshdA1Sq.cjs`),r=require(`./from-CP9Ar8Xf.cjs`),i=require(`./execa-CoW7oosm.cjs`);let a=require(`fs`),o=require(`path`);o=e.a(o);let s=require(`os`),c=require(`url`),l=require(`util`),u=require(`child_process`),d=require(`node:util`),f=require(`node:readline`),p=require(`node:http`);p=e.a(p,1);let m=require(`node:https`);m=e.a(m,1);let h=require(`node:stream`);h=e.a(h,1);let g=require(`node:zlib`);g=e.a(g,1);let _=require(`node:net`),v=require(`assert`);v=e.a(v,1);let y=require(`node:url`),b=require(`dns`);b=e.a(b);let x=require(`node:buffer`),S=require(`https`),C=require(`net`);C=e.a(C,1);let w=require(`tls`);w=e.a(w,1);let ee=require(`http`);ee=e.a(ee,1);let te=require(`fs/promises`);var ne=e.t(((e,t)=>{function n(e,t){typeof t==`boolean`&&(t={forever:t}),this._originalTimeouts=JSON.parse(JSON.stringify(e)),this._timeouts=e,this._options=t||{},this._maxRetryTime=t&&t.maxRetryTime||1/0,this._fn=null,this._errors=[],this._attempts=1,this._operationTimeout=null,this._operationTimeoutCb=null,this._timeout=null,this._operationStart=null,this._timer=null,this._options.forever&&(this._cachedTimeouts=this._timeouts.slice(0))}t.exports=n,n.prototype.reset=function(){this._attempts=1,this._timeouts=this._originalTimeouts.slice(0)},n.prototype.stop=function(){this._timeout&&clearTimeout(this._timeout),this._timer&&clearTimeout(this._timer),this._timeouts=[],this._cachedTimeouts=null},n.prototype.retry=function(e){if(this._timeout&&clearTimeout(this._timeout),!e)return!1;var t=new Date().getTime();if(e&&t-this._operationStart>=this._maxRetryTime)return this._errors.push(e),this._errors.unshift(Error(`RetryOperation timeout occurred`)),!1;this._errors.push(e);var n=this._timeouts.shift();if(n===void 0)if(this._cachedTimeouts)this._errors.splice(0,this._errors.length-1),n=this._cachedTimeouts.slice(-1);else return!1;var r=this;return this._timer=setTimeout(function(){r._attempts++,r._operationTimeoutCb&&(r._timeout=setTimeout(function(){r._operationTimeoutCb(r._attempts)},r._operationTimeout),r._options.unref&&r._timeout.unref()),r._fn(r._attempts)},n),this._options.unref&&this._timer.unref(),!0},n.prototype.attempt=function(e,t){this._fn=e,t&&(t.timeout&&(this._operationTimeout=t.timeout),t.cb&&(this._operationTimeoutCb=t.cb));var n=this;this._operationTimeoutCb&&(this._timeout=setTimeout(function(){n._operationTimeoutCb()},n._operationTimeout)),this._operationStart=new Date().getTime(),this._fn(this._attempts)},n.prototype.try=function(e){console.log(`Using RetryOperation.try() is deprecated`),this.attempt(e)},n.prototype.start=function(e){console.log(`Using RetryOperation.start() is deprecated`),this.attempt(e)},n.prototype.start=n.prototype.try,n.prototype.errors=function(){return this._errors},n.prototype.attempts=function(){return this._attempts},n.prototype.mainError=function(){if(this._errors.length===0)return null;for(var e={},t=null,n=0,r=0;r<this._errors.length;r++){var i=this._errors[r],a=i.message,o=(e[a]||0)+1;e[a]=o,o>=n&&(t=i,n=o)}return t}})),re=e.t((e=>{var t=ne();e.operation=function(n){return new t(e.timeouts(n),{forever:n&&(n.forever||n.retries===1/0),unref:n&&n.unref,maxRetryTime:n&&n.maxRetryTime})},e.timeouts=function(e){if(e instanceof Array)return[].concat(e);var t={retries:10,factor:2,minTimeout:1*1e3,maxTimeout:1/0,randomize:!1};for(var n in e)t[n]=e[n];if(t.minTimeout>t.maxTimeout)throw Error(`minTimeout is greater than maxTimeout`);for(var r=[],i=0;i<t.retries;i++)r.push(this.createTimeout(i,t));return e&&e.forever&&!r.length&&r.push(this.createTimeout(i,t)),r.sort(function(e,t){return e-t}),r},e.createTimeout=function(e,t){var n=t.randomize?Math.random()+1:1,r=Math.round(n*Math.max(t.minTimeout,1)*t.factor**+e);return r=Math.min(r,t.maxTimeout),r},e.wrap=function(t,n,r){if(n instanceof Array&&(r=n,n=null),!r)for(var i in r=[],t)typeof t[i]==`function`&&r.push(i);for(var a=0;a<r.length;a++){var o=r[a],s=t[o];t[o]=function(r){var i=e.operation(n),a=Array.prototype.slice.call(arguments,1),o=a.pop();a.push(function(e){i.retry(e)||(e&&(arguments[0]=i.mainError()),o.apply(this,arguments))}),i.attempt(function(){r.apply(t,a)})}.bind(t,s),t[o].options=n}}})),ie=e.t(((e,t)=>{t.exports=re()})),ae=e.t(((e,t)=>{var n=ie();function r(e,t){function r(r,i){var a=t||{},o;`randomize`in a||(a.randomize=!0),o=n.operation(a);function s(e){i(e||Error(`Aborted`))}function c(e,t){if(e.bail){s(e);return}o.retry(e)?a.onRetry&&a.onRetry(e,t):i(o.mainError())}function l(t){var n;try{n=e(s,t)}catch(e){c(e,t);return}Promise.resolve(n).then(r).catch(function(e){c(e,t)})}o.attempt(l)}return new Promise(r)}t.exports=r})),oe=e.a(ae());function se(e){if(!/^data:/i.test(e))throw TypeError('`uri` does not appear to be a Data URI (must begin with "data:")');e=e.replace(/\r?\n/g,``);let t=e.indexOf(`,`);if(t===-1||t<=4)throw TypeError(`malformed data: URI`);let n=e.substring(5,t).split(`;`),r=``,i=!1,a=n[0]||`text/plain`,o=a;for(let e=1;e<n.length;e++)n[e]===`base64`?i=!0:n[e]&&(o+=`;${n[e]}`,n[e].indexOf(`charset=`)===0&&(r=n[e].substring(8)));!n[0]&&!r.length&&(o+=`;charset=US-ASCII`,r=`US-ASCII`);let s=i?`base64`:`ascii`,c=unescape(e.substring(t+1)),l=Buffer.from(c,s);return l.type=a,l.typeFull=o,l.charset=r,l}var T=class extends Error{constructor(e,t){super(e),Error.captureStackTrace(this,this.constructor),this.type=t}get name(){return this.constructor.name}get[Symbol.toStringTag](){return this.constructor.name}},E=class extends T{constructor(e,t,n){super(e,t),n&&(this.code=this.errno=n.code,this.erroredSysCall=n.syscall)}};const D=Symbol.toStringTag,ce=e=>typeof e==`object`&&typeof e.append==`function`&&typeof e.delete==`function`&&typeof e.get==`function`&&typeof e.getAll==`function`&&typeof e.has==`function`&&typeof e.set==`function`&&typeof e.sort==`function`&&e[D]===`URLSearchParams`,O=e=>e&&typeof e==`object`&&typeof e.arrayBuffer==`function`&&typeof e.type==`string`&&typeof e.stream==`function`&&typeof e.constructor==`function`&&/^(Blob|File)$/.test(e[D]),le=e=>typeof e==`object`&&(e[D]===`AbortSignal`||e[D]===`EventTarget`),ue=(e,t)=>{let n=new URL(t).hostname,r=new URL(e).hostname;return n===r||n.endsWith(`.${r}`)},de=(e,t)=>new URL(t).protocol===new URL(e).protocol,fe=(0,d.promisify)(h.default.pipeline),k=Symbol(`Body internals`);var A=class{constructor(e,{size:t=0}={}){let n=null;e===null?e=null:ce(e)?e=x.Buffer.from(e.toString()):O(e)||x.Buffer.isBuffer(e)||(d.types.isAnyArrayBuffer(e)?e=x.Buffer.from(e):ArrayBuffer.isView(e)?e=x.Buffer.from(e.buffer,e.byteOffset,e.byteLength):e instanceof h.default||(e instanceof r.t?(e=r.n(e),n=e.type.split(`=`)[1]):e=x.Buffer.from(String(e))));let i=e;x.Buffer.isBuffer(e)?i=h.default.Readable.from(e):O(e)&&(i=h.default.Readable.from(e.stream())),this[k]={body:e,stream:i,boundary:n,disturbed:!1,error:null},this.size=t,e instanceof h.default&&e.on(`error`,e=>{let t=e instanceof T?e:new E(`Invalid response body while trying to fetch ${this.url}: ${e.message}`,`system`,e);this[k].error=t})}get body(){return this[k].stream}get bodyUsed(){return this[k].disturbed}async arrayBuffer(){let{buffer:e,byteOffset:t,byteLength:n}=await pe(this);return e.slice(t,t+n)}async formData(){let e=this.headers.get(`content-type`);if(e.startsWith(`application/x-www-form-urlencoded`)){let e=new r.t,t=new URLSearchParams(await this.text());for(let[n,r]of t)e.append(n,r);return e}let{toFormData:t}=await Promise.resolve().then(()=>require(`./multipart-parser-MGyXRYvO.cjs`));return t(this.body,e)}async blob(){let e=this.headers&&this.headers.get(`content-type`)||this[k].body&&this[k].body.type||``;return new r.i([await this.arrayBuffer()],{type:e})}async json(){let e=await this.text();return JSON.parse(e)}async text(){let e=await pe(this);return new TextDecoder().decode(e)}buffer(){return pe(this)}};A.prototype.buffer=(0,d.deprecate)(A.prototype.buffer,`Please use 'response.arrayBuffer()' instead of 'response.buffer()'`,`node-fetch#buffer`),Object.defineProperties(A.prototype,{body:{enumerable:!0},bodyUsed:{enumerable:!0},arrayBuffer:{enumerable:!0},blob:{enumerable:!0},json:{enumerable:!0},text:{enumerable:!0},data:{get:(0,d.deprecate)(()=>{},`data doesn't exist, use json(), text(), arrayBuffer(), or body instead`,`https://github.com/node-fetch/node-fetch/issues/1000 (response)`)}});async function pe(e){if(e[k].disturbed)throw TypeError(`body used already for: ${e.url}`);if(e[k].disturbed=!0,e[k].error)throw e[k].error;let{body:t}=e;if(t===null||!(t instanceof h.default))return x.Buffer.alloc(0);let n=[],r=0;try{for await(let i of t){if(e.size>0&&r+i.length>e.size){let n=new E(`content size at ${e.url} over limit: ${e.size}`,`max-size`);throw t.destroy(n),n}r+=i.length,n.push(i)}}catch(t){throw t instanceof T?t:new E(`Invalid response body while trying to fetch ${e.url}: ${t.message}`,`system`,t)}if(t.readableEnded===!0||t._readableState.ended===!0)try{return n.every(e=>typeof e==`string`)?x.Buffer.from(n.join(``)):x.Buffer.concat(n,r)}catch(t){throw new E(`Could not create Buffer from response body for ${e.url}: ${t.message}`,`system`,t)}else throw new E(`Premature close of server response while trying to fetch ${e.url}`)}const me=(e,t)=>{let n,r,{body:i}=e[k];if(e.bodyUsed)throw Error(`cannot clone body after it is used`);return i instanceof h.default&&typeof i.getBoundary!=`function`&&(n=new h.PassThrough({highWaterMark:t}),r=new h.PassThrough({highWaterMark:t}),i.pipe(n),i.pipe(r),e[k].stream=n,i=r),i},he=(0,d.deprecate)(e=>e.getBoundary(),`form-data doesn't follow the spec and requires special treatment. Use alternative package`,`https://github.com/node-fetch/node-fetch/issues/1167`),ge=(e,t)=>e===null?null:typeof e==`string`?`text/plain;charset=UTF-8`:ce(e)?`application/x-www-form-urlencoded;charset=UTF-8`:O(e)?e.type||null:x.Buffer.isBuffer(e)||d.types.isAnyArrayBuffer(e)||ArrayBuffer.isView(e)?null:e instanceof r.t?`multipart/form-data; boundary=${t[k].boundary}`:e&&typeof e.getBoundary==`function`?`multipart/form-data;boundary=${he(e)}`:e instanceof h.default?null:`text/plain;charset=UTF-8`,_e=e=>{let{body:t}=e[k];return t===null?0:O(t)?t.size:x.Buffer.isBuffer(t)?t.length:t&&typeof t.getLengthSync==`function`&&t.hasKnownLength&&t.hasKnownLength()?t.getLengthSync():null},ve=async(e,{body:t})=>{t===null?e.end():await fe(t,e)},ye=typeof p.default.validateHeaderName==`function`?p.default.validateHeaderName:e=>{if(!/^[\^`\-\w!#$%&'*+.|~]+$/.test(e)){let t=TypeError(`Header name must be a valid HTTP token [${e}]`);throw Object.defineProperty(t,`code`,{value:`ERR_INVALID_HTTP_TOKEN`}),t}},be=typeof p.default.validateHeaderValue==`function`?p.default.validateHeaderValue:(e,t)=>{if(/[^\t\u0020-\u007E\u0080-\u00FF]/.test(t)){let t=TypeError(`Invalid character in header content ["${e}"]`);throw Object.defineProperty(t,`code`,{value:`ERR_INVALID_CHAR`}),t}};var j=class e extends URLSearchParams{constructor(t){let n=[];if(t instanceof e){let e=t.raw();for(let[t,r]of Object.entries(e))n.push(...r.map(e=>[t,e]))}else if(t!=null)if(typeof t==`object`&&!d.types.isBoxedPrimitive(t)){let e=t[Symbol.iterator];if(e==null)n.push(...Object.entries(t));else{if(typeof e!=`function`)throw TypeError(`Header pairs must be iterable`);n=[...t].map(e=>{if(typeof e!=`object`||d.types.isBoxedPrimitive(e))throw TypeError(`Each header pair must be an iterable object`);return[...e]}).map(e=>{if(e.length!==2)throw TypeError(`Each header pair must be a name/value tuple`);return[...e]})}}else throw TypeError(`Failed to construct 'Headers': The provided value is not of type '(sequence<sequence<ByteString>> or record<ByteString, ByteString>)`);return n=n.length>0?n.map(([e,t])=>(ye(e),be(e,String(t)),[String(e).toLowerCase(),String(t)])):void 0,super(n),new Proxy(this,{get(e,t,n){switch(t){case`append`:case`set`:return(n,r)=>(ye(n),be(n,String(r)),URLSearchParams.prototype[t].call(e,String(n).toLowerCase(),String(r)));case`delete`:case`has`:case`getAll`:return n=>(ye(n),URLSearchParams.prototype[t].call(e,String(n).toLowerCase()));case`keys`:return()=>(e.sort(),new Set(URLSearchParams.prototype.keys.call(e)).keys());default:return Reflect.get(e,t,n)}}})}get[Symbol.toStringTag](){return this.constructor.name}toString(){return Object.prototype.toString.call(this)}get(e){let t=this.getAll(e);if(t.length===0)return null;let n=t.join(`, `);return/^content-encoding$/i.test(e)&&(n=n.toLowerCase()),n}forEach(e,t=void 0){for(let n of this.keys())Reflect.apply(e,t,[this.get(n),n,this])}*values(){for(let e of this.keys())yield this.get(e)}*entries(){for(let e of this.keys())yield[e,this.get(e)]}[Symbol.iterator](){return this.entries()}raw(){return[...this.keys()].reduce((e,t)=>(e[t]=this.getAll(t),e),{})}[Symbol.for(`nodejs.util.inspect.custom`)](){return[...this.keys()].reduce((e,t)=>{let n=this.getAll(t);return t===`host`?e[t]=n[0]:e[t]=n.length>1?n:n[0],e},{})}};Object.defineProperties(j.prototype,[`get`,`entries`,`forEach`,`values`].reduce((e,t)=>(e[t]={enumerable:!0},e),{}));function xe(e=[]){return new j(e.reduce((e,t,n,r)=>(n%2==0&&e.push(r.slice(n,n+2)),e),[]).filter(([e,t])=>{try{return ye(e),be(e,String(t)),!0}catch{return!1}}))}const Se=new Set([301,302,303,307,308]),Ce=e=>Se.has(e),M=Symbol(`Response internals`);var N=class e extends A{constructor(e=null,t={}){super(e,t);let n=t.status==null?200:t.status,r=new j(t.headers);if(e!==null&&!r.has(`Content-Type`)){let t=ge(e,this);t&&r.append(`Content-Type`,t)}this[M]={type:`default`,url:t.url,status:n,statusText:t.statusText||``,headers:r,counter:t.counter,highWaterMark:t.highWaterMark}}get type(){return this[M].type}get url(){return this[M].url||``}get status(){return this[M].status}get ok(){return this[M].status>=200&&this[M].status<300}get redirected(){return this[M].counter>0}get statusText(){return this[M].statusText}get headers(){return this[M].headers}get highWaterMark(){return this[M].highWaterMark}clone(){return new e(me(this,this.highWaterMark),{type:this.type,url:this.url,status:this.status,statusText:this.statusText,headers:this.headers,ok:this.ok,redirected:this.redirected,size:this.size,highWaterMark:this.highWaterMark})}static redirect(t,n=302){if(!Ce(n))throw RangeError(`Failed to execute "redirect" on "response": Invalid status code`);return new e(null,{headers:{location:new URL(t).toString()},status:n})}static error(){let t=new e(null,{status:0,statusText:``});return t[M].type=`error`,t}get[Symbol.toStringTag](){return`Response`}};Object.defineProperties(N.prototype,{type:{enumerable:!0},url:{enumerable:!0},status:{enumerable:!0},ok:{enumerable:!0},redirected:{enumerable:!0},statusText:{enumerable:!0},headers:{enumerable:!0},clone:{enumerable:!0}});const we=e=>{if(e.search)return e.search;let t=e.href.length-1,n=e.hash||(e.href[t]===`#`?`#`:``);return e.href[t-n.length]===`?`?`?`:``};function Te(e,t=!1){return e==null||(e=new URL(e),/^(about|blob|data):$/.test(e.protocol))?`no-referrer`:(e.username=``,e.password=``,e.hash=``,t&&(e.pathname=``,e.search=``),e)}const Ee=new Set([``,`no-referrer`,`no-referrer-when-downgrade`,`same-origin`,`origin`,`strict-origin`,`origin-when-cross-origin`,`strict-origin-when-cross-origin`,`unsafe-url`]);function De(e){if(!Ee.has(e))throw TypeError(`Invalid referrerPolicy: ${e}`);return e}function Oe(e){if(/^(http|ws)s:$/.test(e.protocol))return!0;let t=e.host.replace(/(^\[)|(]$)/g,``),n=(0,_.isIP)(t);return n===4&&/^127\./.test(t)||n===6&&/^(((0+:){7})|(::(0+:){0,6}))0*1$/.test(t)?!0:e.host===`localhost`||e.host.endsWith(`.localhost`)?!1:e.protocol===`file:`}function P(e){return/^about:(blank|srcdoc)$/.test(e)||e.protocol===`data:`||/^(blob|filesystem):$/.test(e.protocol)?!0:Oe(e)}function ke(e,{referrerURLCallback:t,referrerOriginCallback:n}={}){if(e.referrer===`no-referrer`||e.referrerPolicy===``)return null;let r=e.referrerPolicy;if(e.referrer===`about:client`)return`no-referrer`;let i=e.referrer,a=Te(i),o=Te(i,!0);a.toString().length>4096&&(a=o),t&&(a=t(a)),n&&(o=n(o));let s=new URL(e.url);switch(r){case`no-referrer`:return`no-referrer`;case`origin`:return o;case`unsafe-url`:return a;case`strict-origin`:return P(a)&&!P(s)?`no-referrer`:o.toString();case`strict-origin-when-cross-origin`:return a.origin===s.origin?a:P(a)&&!P(s)?`no-referrer`:o;case`same-origin`:return a.origin===s.origin?a:`no-referrer`;case`origin-when-cross-origin`:return a.origin===s.origin?a:o;case`no-referrer-when-downgrade`:return P(a)&&!P(s)?`no-referrer`:a;default:throw TypeError(`Invalid referrerPolicy: ${r}`)}}function Ae(e){let t=(e.get(`referrer-policy`)||``).split(/[,\s]+/),n=``;for(let e of t)e&&Ee.has(e)&&(n=e);return n}const F=Symbol(`Request internals`),I=e=>typeof e==`object`&&typeof e[F]==`object`,je=(0,d.deprecate)(()=>{},`.data is not a valid RequestInit property, use .body instead`,`https://github.com/node-fetch/node-fetch/issues/1000 (request)`);var Me=class e extends A{constructor(e,t={}){let n;if(I(e)?n=new URL(e.url):(n=new URL(e),e={}),n.username!==``||n.password!==``)throw TypeError(`${n} is an url with embedded credentials.`);let r=t.method||e.method||`GET`;if(/^(delete|get|head|options|post|put)$/i.test(r)&&(r=r.toUpperCase()),!I(t)&&`data`in t&&je(),(t.body!=null||I(e)&&e.body!==null)&&(r===`GET`||r===`HEAD`))throw TypeError(`Request with GET/HEAD method cannot have body`);let i=t.body?t.body:I(e)&&e.body!==null?me(e):null;super(i,{size:t.size||e.size||0});let a=new j(t.headers||e.headers||{});if(i!==null&&!a.has(`Content-Type`)){let e=ge(i,this);e&&a.set(`Content-Type`,e)}let o=I(e)?e.signal:null;if(`signal`in t&&(o=t.signal),o!=null&&!le(o))throw TypeError(`Expected signal to be an instanceof AbortSignal or EventTarget`);let s=t.referrer==null?e.referrer:t.referrer;if(s===``)s=`no-referrer`;else if(s){let e=new URL(s);s=/^about:(\/\/)?client$/.test(e)?`client`:e}else s=void 0;this[F]={method:r,redirect:t.redirect||e.redirect||`follow`,headers:a,parsedURL:n,signal:o,referrer:s},this.follow=t.follow===void 0?e.follow===void 0?20:e.follow:t.follow,this.compress=t.compress===void 0?e.compress===void 0?!0:e.compress:t.compress,this.counter=t.counter||e.counter||0,this.agent=t.agent||e.agent,this.highWaterMark=t.highWaterMark||e.highWaterMark||16384,this.insecureHTTPParser=t.insecureHTTPParser||e.insecureHTTPParser||!1,this.referrerPolicy=t.referrerPolicy||e.referrerPolicy||``}get method(){return this[F].method}get url(){return(0,y.format)(this[F].parsedURL)}get headers(){return this[F].headers}get redirect(){return this[F].redirect}get signal(){return this[F].signal}get referrer(){if(this[F].referrer===`no-referrer`)return``;if(this[F].referrer===`client`)return`about:client`;if(this[F].referrer)return this[F].referrer.toString()}get referrerPolicy(){return this[F].referrerPolicy}set referrerPolicy(e){this[F].referrerPolicy=De(e)}clone(){return new e(this)}get[Symbol.toStringTag](){return`Request`}};Object.defineProperties(Me.prototype,{method:{enumerable:!0},url:{enumerable:!0},headers:{enumerable:!0},redirect:{enumerable:!0},clone:{enumerable:!0},signal:{enumerable:!0},referrer:{enumerable:!0},referrerPolicy:{enumerable:!0}});const Ne=e=>{let{parsedURL:t}=e[F],n=new j(e[F].headers);n.has(`Accept`)||n.set(`Accept`,`*/*`);let r=null;if(e.body===null&&/^(post|put)$/i.test(e.method)&&(r=`0`),e.body!==null){let t=_e(e);typeof t==`number`&&!Number.isNaN(t)&&(r=String(t))}r&&n.set(`Content-Length`,r),e.referrerPolicy===``&&(e.referrerPolicy=`strict-origin-when-cross-origin`),e.referrer&&e.referrer!==`no-referrer`?e[F].referrer=ke(e):e[F].referrer=`no-referrer`,e[F].referrer instanceof URL&&n.set(`Referer`,e.referrer),n.has(`User-Agent`)||n.set(`User-Agent`,`node-fetch`),e.compress&&!n.has(`Accept-Encoding`)&&n.set(`Accept-Encoding`,`gzip, deflate, br`);let{agent:i}=e;typeof i==`function`&&(i=i(t)),!n.has(`Connection`)&&!i&&n.set(`Connection`,`close`);let a=we(t);return{parsedURL:t,options:{path:t.pathname+a,method:e.method,headers:n[Symbol.for(`nodejs.util.inspect.custom`)](),insecureHTTPParser:e.insecureHTTPParser,agent:i}}};var Pe=class extends T{constructor(e,t=`aborted`){super(e,t)}};const Fe=new Set([`data:`,`http:`,`https:`]);async function Ie(e,t){return new Promise((n,r)=>{let i=new Me(e,t),{parsedURL:a,options:o}=Ne(i);if(!Fe.has(a.protocol))throw TypeError(`node-fetch cannot load ${e}. URL scheme "${a.protocol.replace(/:$/,``)}" is not supported.`);if(a.protocol===`data:`){let e=se(i.url);n(new N(e,{headers:{"Content-Type":e.typeFull}}));return}let s=(a.protocol===`https:`?m.default:p.default).request,{signal:c}=i,l=null,u=()=>{let e=new Pe(`The operation was aborted.`);r(e),i.body&&i.body instanceof h.default.Readable&&i.body.destroy(e),!(!l||!l.body)&&l.body.emit(`error`,e)};if(c&&c.aborted){u();return}let d=()=>{u(),_()},f=s(a.toString(),o);c&&c.addEventListener(`abort`,d);let _=()=>{f.abort(),c&&c.removeEventListener(`abort`,d)};f.on(`error`,e=>{r(new E(`request to ${i.url} failed, reason: ${e.message}`,`system`,e)),_()}),Le(f,e=>{l&&l.body&&l.body.destroy(e)}),process.version<`v14`&&f.on(`socket`,e=>{let t;e.prependListener(`end`,()=>{t=e._eventsCount}),e.prependListener(`close`,n=>{if(l&&t<e._eventsCount&&!n){let e=Error(`Premature close`);e.code=`ERR_STREAM_PREMATURE_CLOSE`,l.body.emit(`error`,e)}})}),f.on(`response`,e=>{f.setTimeout(0);let a=xe(e.rawHeaders);if(Ce(e.statusCode)){let o=a.get(`Location`),s=null;try{s=o===null?null:new URL(o,i.url)}catch{if(i.redirect!==`manual`){r(new E(`uri requested responds with an invalid redirect URL: ${o}`,`invalid-redirect`)),_();return}}switch(i.redirect){case`error`:r(new E(`uri requested responds with a redirect, redirect mode is set to error: ${i.url}`,`no-redirect`)),_();return;case`manual`:break;case`follow`:{if(s===null)break;if(i.counter>=i.follow){r(new E(`maximum redirect reached at: ${i.url}`,`max-redirect`)),_();return}let o={headers:new j(i.headers),follow:i.follow,counter:i.counter+1,agent:i.agent,compress:i.compress,method:i.method,body:me(i),signal:i.signal,size:i.size,referrer:i.referrer,referrerPolicy:i.referrerPolicy};if(!ue(i.url,s)||!de(i.url,s))for(let e of[`authorization`,`www-authenticate`,`cookie`,`cookie2`])o.headers.delete(e);if(e.statusCode!==303&&i.body&&t.body instanceof h.default.Readable){r(new E(`Cannot follow redirect with body being a readable stream`,`unsupported-redirect`)),_();return}(e.statusCode===303||(e.statusCode===301||e.statusCode===302)&&i.method===`POST`)&&(o.method=`GET`,o.body=void 0,o.headers.delete(`content-length`));let c=Ae(a);c&&(o.referrerPolicy=c),n(Ie(new Me(s,o))),_();return}default:return r(TypeError(`Redirect option '${i.redirect}' is not a valid value of RequestRedirect`))}}c&&e.once(`end`,()=>{c.removeEventListener(`abort`,d)});let o=(0,h.pipeline)(e,new h.PassThrough,e=>{e&&r(e)});process.version<`v12.10`&&e.on(`aborted`,d);let s={url:i.url,status:e.statusCode,statusText:e.statusMessage,headers:a,size:i.size,counter:i.counter,highWaterMark:i.highWaterMark},u=a.get(`Content-Encoding`);if(!i.compress||i.method===`HEAD`||u===null||e.statusCode===204||e.statusCode===304){l=new N(o,s),n(l);return}let p={flush:g.default.Z_SYNC_FLUSH,finishFlush:g.default.Z_SYNC_FLUSH};if(u===`gzip`||u===`x-gzip`){o=(0,h.pipeline)(o,g.default.createGunzip(p),e=>{e&&r(e)}),l=new N(o,s),n(l);return}if(u===`deflate`||u===`x-deflate`){let t=(0,h.pipeline)(e,new h.PassThrough,e=>{e&&r(e)});t.once(`data`,e=>{o=(e[0]&15)==8?(0,h.pipeline)(o,g.default.createInflate(),e=>{e&&r(e)}):(0,h.pipeline)(o,g.default.createInflateRaw(),e=>{e&&r(e)}),l=new N(o,s),n(l)}),t.once(`end`,()=>{l||(l=new N(o,s),n(l))});return}if(u===`br`){o=(0,h.pipeline)(o,g.default.createBrotliDecompress(),e=>{e&&r(e)}),l=new N(o,s),n(l);return}l=new N(o,s),n(l)}),ve(f,i).catch(r)})}function Le(e,t){let n=x.Buffer.from(`0\r
\r
`),r=!1,i=!1,a;e.on(`response`,e=>{let{headers:t}=e;r=t[`transfer-encoding`]===`chunked`&&!t[`content-length`]}),e.on(`socket`,o=>{let s=()=>{if(r&&!i){let e=Error(`Premature close`);e.code=`ERR_STREAM_PREMATURE_CLOSE`,t(e)}},c=e=>{i=x.Buffer.compare(e.slice(-5),n)===0,!i&&a&&(i=x.Buffer.compare(a.slice(-3),n.slice(0,3))===0&&x.Buffer.compare(e.slice(-2),n.slice(3))===0),a=e};o.prependListener(`close`,s),o.on(`data`,c),e.on(`close`,()=>{o.removeListener(`close`,s),o.removeListener(`data`,c)})})}var Re=class extends S.Agent{constructor(e={}){super({...e,lookup(e,t,n){b.default.resolve(e,(e,t)=>n(e,t?.[0],4))}})}};const ze=()=>new Re;var Be=e.a(t.n(),1);const L=Symbol(`AgentBaseInternalState`);var Ve=class extends ee.Agent{constructor(e){super(e),this[L]={}}isSecureEndpoint(e){if(e){if(typeof e.secureEndpoint==`boolean`)return e.secureEndpoint;if(typeof e.protocol==`string`)return e.protocol===`https:`}let{stack:t}=Error();return typeof t==`string`?t.split(`
`).some(e=>e.indexOf(`(https.js:`)!==-1||e.indexOf(`node:https:`)!==-1):!1}incrementSockets(e){if(this.maxSockets===1/0&&this.maxTotalSockets===1/0)return null;this.sockets[e]||(this.sockets[e]=[]);let t=new C.Socket({writable:!1});return this.sockets[e].push(t),this.totalSocketCount++,t}decrementSockets(e,t){if(!this.sockets[e]||t===null)return;let n=this.sockets[e],r=n.indexOf(t);r!==-1&&(n.splice(r,1),this.totalSocketCount--,n.length===0&&delete this.sockets[e])}getName(e){return this.isSecureEndpoint(e)?S.Agent.prototype.getName.call(this,e):super.getName(e)}createSocket(e,t,n){let r={...t,secureEndpoint:this.isSecureEndpoint(t)},i=this.getName(r),a=this.incrementSockets(i);Promise.resolve().then(()=>this.connect(e,r)).then(o=>{if(this.decrementSockets(i,a),typeof o.addRequest==`function`)try{return o.addRequest(e,r)}catch(e){return n(e)}this[L].currentSocket=o,super.createSocket(e,t,n)},e=>{this.decrementSockets(i,a),n(e)})}createConnection(){let e=this[L].currentSocket;if(this[L].currentSocket=void 0,!e)throw Error("No socket was returned in the `connect()` function");return e}get defaultPort(){return this[L].defaultPort??(this.protocol===`https:`?443:80)}set defaultPort(e){this[L]&&(this[L].defaultPort=e)}get protocol(){return this[L].protocol??(this.isSecureEndpoint()?`https:`:`http:`)}set protocol(e){this[L]&&(this[L].protocol=e)}};const R=(0,Be.default)(`https-proxy-agent:parse-proxy-response`);function He(e){return new Promise((t,n)=>{let r=0,i=[];function a(){let t=e.read();t?l(t):e.once(`readable`,a)}function o(){e.removeListener(`end`,s),e.removeListener(`error`,c),e.removeListener(`readable`,a)}function s(){o(),R(`onend`),n(Error(`Proxy connection ended before receiving CONNECT response`))}function c(e){o(),R(`onerror %o`,e),n(e)}function l(s){i.push(s),r+=s.length;let c=Buffer.concat(i,r),l=c.indexOf(`\r
\r
`);if(l===-1){R(`have not received end of HTTP headers yet...`),a();return}let u=c.slice(0,l).toString(`ascii`).split(`\r
`),d=u.shift();if(!d)return e.destroy(),n(Error(`No header received from proxy CONNECT response`));let f=d.split(` `),p=+f[1],m=f.slice(2).join(` `),h={};for(let t of u){if(!t)continue;let r=t.indexOf(`:`);if(r===-1)return e.destroy(),n(Error(`Invalid header from proxy CONNECT response: "${t}"`));let i=t.slice(0,r).toLowerCase(),a=t.slice(r+1).trimStart(),o=h[i];typeof o==`string`?h[i]=[o,a]:Array.isArray(o)?o.push(a):h[i]=a}R(`got proxy server response: %o %o`,d,h),o(),t({connect:{statusCode:p,statusText:m,headers:h},buffered:c})}e.on(`error`,c),e.on(`end`,s),a()})}function Ue(){return async({response:e,scheme:t})=>{if(t.toLowerCase()!==`negotiate`)throw Error(`Expected Negotiate scheme but got "${t}"`);let n;try{n=await import(`kerberos`)}catch{throw Error(`The "kerberos" package is required for Negotiate proxy authentication. Install it with: npm install kerberos`)}let r=e.headers[`proxy-authenticate`]||``,i=Array.isArray(r)?r[0]:r,a=typeof i==`string`&&i.includes(` `)?i.split(` `).slice(1).join(` `):void 0,o=await(await n.initializeClient(`HTTP@proxy`,{mechOID:n.GSS_MECH_OID_SPNEGO})).step(a||``);if(!o)throw Error(`Kerberos client.step() returned no token`);return{headers:{"Proxy-Authorization":`Negotiate ${o}`}}}}const z=(0,Be.default)(`https-proxy-agent`),B=e=>e.servername===void 0&&e.host&&!C.isIP(e.host)?{...e,servername:e.host}:e;var We=class extends Ve{constructor(e,t){super(t),this.options={path:void 0},this.proxy=typeof e==`string`?new c.URL(e):e,this.proxyHeaders=t?.headers??{},z(`Creating new HttpsProxyAgent instance: %o`,this.proxy.href),t?.negotiate?this.onProxyAuth=Ue():t?.onProxyAuth&&(this.onProxyAuth=t.onProxyAuth);let n=(this.proxy.hostname||this.proxy.host).replace(/^\[|\]$/g,``),r=this.proxy.port?parseInt(this.proxy.port,10):this.proxy.protocol===`https:`?443:80;this.connectOpts={ALPNProtocols:[`http/1.1`],...t?Ke(t,`headers`,`onProxyAuth`,`negotiate`):null,host:n,port:r}}async connect(e,t){let{proxy:n}=this;if(!t.host)throw TypeError(`No "host" provided`);let r;n.protocol===`https:`?(z("Creating `tls.Socket`: %o",this.connectOpts),r=w.connect(B(this.connectOpts))):(z("Creating `net.Socket`: %o",this.connectOpts),r=C.connect(this.connectOpts));let i=typeof this.proxyHeaders==`function`?this.proxyHeaders():{...this.proxyHeaders},a=C.isIPv6(t.host)?`[${t.host}]`:t.host,o=`CONNECT ${a}:${t.port} HTTP/1.1\r\n`;if(n.username||n.password){let e=`${decodeURIComponent(n.username)}:${decodeURIComponent(n.password)}`;i[`Proxy-Authorization`]=`Basic ${Buffer.from(e).toString(`base64`)}`}i.Host=`${a}:${t.port}`,i[`Proxy-Connection`]||=this.keepAlive?`Keep-Alive`:`close`;for(let e of Object.keys(i))o+=`${e}: ${i[e]}\r\n`;let s=He(r);r.write(`${o}\r\n`);let{connect:c,buffered:l}=await s;if(e.emit(`proxyConnect`,c),this.emit(`proxyConnect`,c,e),e.emit(`proxy`,{proxy:this.proxy.href,socket:r}),c.statusCode===200)return e.once(`socket`,Ge),t.secureEndpoint?(z(`Upgrading socket connection to TLS`),w.connect({...Ke(B(t),`host`,`path`,`port`),socket:r})):r;if(c.statusCode===407&&this.onProxyAuth){z(`Got 407 response, invoking onProxyAuth callback`),r.destroy();let n=c.headers[`proxy-authenticate`]||``,i=Array.isArray(n)?n[0].split(/\s/)[0]:n.split(/\s/)[0],a=await this.onProxyAuth({response:c,scheme:i});return this._connectWithAuth(e,t,a.headers)}r.destroy();let u=new C.Socket({writable:!1});return u.readable=!0,e.once(`socket`,e=>{z(`Replaying proxy buffer for failed request`),(0,v.default)(e.listenerCount(`data`)>0),e.push(l),e.push(null)}),u}async _connectWithAuth(e,t,n){let{proxy:r}=this,i;i=r.protocol===`https:`?w.connect(B(this.connectOpts)):C.connect(this.connectOpts);let a=typeof this.proxyHeaders==`function`?this.proxyHeaders():{...this.proxyHeaders},o=C.isIPv6(t.host)?`[${t.host}]`:t.host,s=`CONNECT ${o}:${t.port} HTTP/1.1\r\n`;if(r.username||r.password){let e=`${decodeURIComponent(r.username)}:${decodeURIComponent(r.password)}`;a[`Proxy-Authorization`]=`Basic ${Buffer.from(e).toString(`base64`)}`}Object.assign(a,n),a.Host=`${o}:${t.port}`,a[`Proxy-Connection`]||=this.keepAlive?`Keep-Alive`:`close`;for(let e of Object.keys(a))s+=`${e}: ${a[e]}\r\n`;let c=He(i);i.write(`${s}\r\n`);let{connect:l}=await c;if(e.emit(`proxyConnect`,l),this.emit(`proxyConnect`,l,e),l.statusCode===200)return e.once(`socket`,Ge),t.secureEndpoint?(z(`Upgrading socket connection to TLS`),w.connect({...Ke(B(t),`host`,`path`,`port`),socket:i})):i;throw i.destroy(),Error(`Proxy authentication failed with status ${l.statusCode} after retry`)}};We.protocols=[`http`,`https`];function Ge(e){setImmediate(()=>{e.resume()})}function Ke(e,...t){let n={},r;for(r in e)t.includes(r)||(n[r]=e[r]);return n}var qe=e.t(((e,t)=>{t.exports=function(e,t){if(t=t.split(`:`)[0],e=+e,!e)return!1;switch(t){case`http`:case`ws`:return e!==80;case`https`:case`wss`:return e!==443;case`ftp`:return e!==21;case`gopher`:return e!==70;case`file`:return!1}return e!==0}})),Je=e.t((e=>{var t=Object.prototype.hasOwnProperty,n;function r(e){try{return decodeURIComponent(e.replace(/\+/g,` `))}catch{return null}}function i(e){try{return encodeURIComponent(e)}catch{return null}}function a(e){for(var t=/([^=?#&]+)=?([^&]*)/g,n={},i;i=t.exec(e);){var a=r(i[1]),o=r(i[2]);a===null||o===null||a in n||(n[a]=o)}return n}function o(e,r){r||=``;var a=[],o,s;for(s in typeof r!=`string`&&(r=`?`),e)if(t.call(e,s)){if(o=e[s],!o&&(o===null||o===n||isNaN(o))&&(o=``),s=i(s),o=i(o),s===null||o===null)continue;a.push(s+`=`+o)}return a.length?r+a.join(`&`):``}e.stringify=o,e.parse=a})),Ye=e.t(((e,t)=>{var n=qe(),r=Je(),i=/^[\x00-\x20\u00a0\u1680\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff]+/,a=/[\n\r\t]/g,o=/^[A-Za-z][A-Za-z0-9+-.]*:\/\//,s=/:\d+$/,c=/^([a-z][a-z0-9.+-]*:)?(\/\/)?([\\/]+)?([\S\s]*)/i,l=/^[a-zA-Z]:/;function u(e){return(e||``).toString().replace(i,``)}var d=[[`#`,`hash`],[`?`,`query`],function(e,t){return m(t.protocol)?e.replace(/\\/g,`/`):e},[`/`,`pathname`],[`@`,`auth`,1],[NaN,`host`,void 0,1,1],[/:(\d*)$/,`port`,void 0,1],[NaN,`hostname`,void 0,1,1]],f={hash:1,query:1};function p(e){var t=(typeof window<`u`?window:typeof global<`u`?global:typeof self<`u`?self:{}).location||{};e||=t;var n={},r=typeof e,i;if(e.protocol===`blob:`)n=new _(unescape(e.pathname),{});else if(r===`string`)for(i in n=new _(e,{}),f)delete n[i];else if(r===`object`){for(i in e)i in f||(n[i]=e[i]);n.slashes===void 0&&(n.slashes=o.test(e.href))}return n}function m(e){return e===`file:`||e===`ftp:`||e===`http:`||e===`https:`||e===`ws:`||e===`wss:`}function h(e,t){e=u(e),e=e.replace(a,``),t||={};var n=c.exec(e),r=n[1]?n[1].toLowerCase():``,i=!!n[2],o=!!n[3],s=0,l;return i?o?(l=n[2]+n[3]+n[4],s=n[2].length+n[3].length):(l=n[2]+n[4],s=n[2].length):o?(l=n[3]+n[4],s=n[3].length):l=n[4],r===`file:`?s>=2&&(l=l.slice(2)):m(r)?l=n[4]:r?i&&(l=l.slice(2)):s>=2&&m(t.protocol)&&(l=n[4]),{protocol:r,slashes:i||m(r),slashesCount:s,rest:l}}function g(e,t){if(e===``)return t;for(var n=(t||`/`).split(`/`).slice(0,-1).concat(e.split(`/`)),r=n.length,i=n[r-1],a=!1,o=0;r--;)n[r]===`.`?n.splice(r,1):n[r]===`..`?(n.splice(r,1),o++):o&&(r===0&&(a=!0),n.splice(r,1),o--);return a&&n.unshift(``),(i===`.`||i===`..`)&&n.push(``),n.join(`/`)}function _(e,t,i){if(e=u(e),e=e.replace(a,``),!(this instanceof _))return new _(e,t,i);var o,s,c,f,v,y,b=d.slice(),x=typeof t,S=this,C=0;for(x!==`object`&&x!==`string`&&(i=t,t=null),i&&typeof i!=`function`&&(i=r.parse),t=p(t),s=h(e||``,t),o=!s.protocol&&!s.slashes,S.slashes=s.slashes||o&&t.slashes,S.protocol=s.protocol||t.protocol||``,e=s.rest,(s.protocol===`file:`&&(s.slashesCount!==2||l.test(e))||!s.slashes&&(s.protocol||s.slashesCount<2||!m(S.protocol)))&&(b[3]=[/(.*)/,`pathname`]);C<b.length;C++){if(f=b[C],typeof f==`function`){e=f(e,S);continue}c=f[0],y=f[1],c===c?typeof c==`string`?(v=c===`@`?e.lastIndexOf(c):e.indexOf(c),~v&&(typeof f[2]==`number`?(S[y]=e.slice(0,v),e=e.slice(v+f[2])):(S[y]=e.slice(v),e=e.slice(0,v)))):(v=c.exec(e))&&(S[y]=v[1],e=e.slice(0,v.index)):S[y]=e,S[y]=S[y]||o&&f[3]&&t[y]||``,f[4]&&(S[y]=S[y].toLowerCase())}i&&(S.query=i(S.query)),o&&t.slashes&&S.pathname.charAt(0)!==`/`&&(S.pathname!==``||t.pathname!==``)&&(S.pathname=g(S.pathname,t.pathname)),S.pathname.charAt(0)!==`/`&&m(S.protocol)&&(S.pathname=`/`+S.pathname),n(S.port,S.protocol)||(S.host=S.hostname,S.port=``),S.username=S.password=``,S.auth&&=(v=S.auth.indexOf(`:`),~v?(S.username=S.auth.slice(0,v),S.username=encodeURIComponent(decodeURIComponent(S.username)),S.password=S.auth.slice(v+1),S.password=encodeURIComponent(decodeURIComponent(S.password))):S.username=encodeURIComponent(decodeURIComponent(S.auth)),S.password?S.username+`:`+S.password:S.username),S.origin=S.protocol!==`file:`&&m(S.protocol)&&S.host?S.protocol+`//`+S.host:`null`,S.href=S.toString()}function v(e,t,i){var a=this;switch(e){case`query`:typeof t==`string`&&t.length&&(t=(i||r.parse)(t)),a[e]=t;break;case`port`:a[e]=t,n(t,a.protocol)?t&&(a.host=a.hostname+`:`+t):(a.host=a.hostname,a[e]=``);break;case`hostname`:a[e]=t,a.port&&(t+=`:`+a.port),a.host=t;break;case`host`:a[e]=t,s.test(t)?(t=t.split(`:`),a.port=t.pop(),a.hostname=t.join(`:`)):(a.hostname=t,a.port=``);break;case`protocol`:a.protocol=t.toLowerCase(),a.slashes=!i;break;case`pathname`:case`hash`:if(t){var o=e===`pathname`?`/`:`#`;a[e]=t.charAt(0)===o?t:o+t}else a[e]=t;break;case`username`:case`password`:a[e]=encodeURIComponent(t);break;case`auth`:var c=t.indexOf(`:`);~c?(a.username=t.slice(0,c),a.username=encodeURIComponent(decodeURIComponent(a.username)),a.password=t.slice(c+1),a.password=encodeURIComponent(decodeURIComponent(a.password))):a.username=encodeURIComponent(decodeURIComponent(t))}for(var l=0;l<d.length;l++){var u=d[l];u[4]&&(a[u[1]]=a[u[1]].toLowerCase())}return a.auth=a.password?a.username+`:`+a.password:a.username,a.origin=a.protocol!==`file:`&&m(a.protocol)&&a.host?a.protocol+`//`+a.host:`null`,a.href=a.toString(),a}function y(e){(!e||typeof e!=`function`)&&(e=r.stringify);var t,n=this,i=n.host,a=n.protocol;a&&a.charAt(a.length-1)!==`:`&&(a+=`:`);var o=a+(n.protocol&&n.slashes||m(n.protocol)?`//`:``);return n.username?(o+=n.username,n.password&&(o+=`:`+n.password),o+=`@`):n.password?(o+=`:`+n.password,o+=`@`):n.protocol!==`file:`&&m(n.protocol)&&!i&&n.pathname!==`/`&&(o+=`@`),(i[i.length-1]===`:`||s.test(n.hostname)&&!n.port)&&(i+=`:`),o+=i+n.pathname,t=typeof n.query==`object`?e(n.query):n.query,t&&(o+=t.charAt(0)===`?`?t:`?`+t),n.hash&&(o+=n.hash),o}_.prototype={set:v,toString:y},_.extractProtocol=h,_.location=p,_.trimLeft=u,_.qs=r,t.exports=_})),Xe=e.t(((e,t)=>{t.exports=function(){try{return global.URL?global.URL:require(`url`).URL}catch{return Ye()}}()})),Ze=e.t(((e,t)=>{function n(e,t){this.text=e||=``,this.hasWild=~e.indexOf(`*`),this.separator=t,this.parts=e.split(t)}n.prototype.match=function(e){var t=!0,n=this.parts,r,i=n.length,a;if(typeof e==`string`||e instanceof String)if(!this.hasWild&&this.text!=e)t=!1;else{for(a=(e||``).split(this.separator),r=0;t&&r<i;r++)if(n[r]===`*`)continue;else t=r<a.length?n[r]===a[r]:!1;t&&=a}else if(typeof e.splice==`function`)for(t=[],r=e.length;r--;)this.match(e[r])&&(t[t.length]=e[r]);else if(typeof e==`object`)for(var o in t={},e)this.match(o)&&(t[o]=e[o]);return t},t.exports=function(e,t,r){var i=new n(e,r||/[\/\.]/);return t===void 0?i:i.match(t)}})),Qe=e.t(((e,t)=>{var n=void 0;function r(){var e=(process.env.NO_PROXY||``).split(`,`).map(function(e){return e.trim().toLowerCase().replace(/\.$/,`.*`).replace(/^\./,`*.`)}).reduce(function(e,t){return e.push(t),/^\*\./.test(t)&&e.push(t.substr(2)),e},[]).filter(function(e){return e});n=e.length?e:[]}t.exports=function(){return n===void 0&&r(),n}})),$e=e.t(((e,t)=>{var n=Ze(),r=Qe();t.exports=function(e){var t=String(e||``).toLowerCase();return!!r().filter(function(e){return n(e,t)}).length}})),et=e.t(((e,t)=>{var n=Xe(),r=$e();t.exports=function(e){return r(new n(e).host)}})),tt=e.a(et());const nt={},rt=({env:e,log:t},n,r)=>{let i=e.HTTPS_PROXY||e.HTTP_PROXY;if(!i||(0,tt.default)(n))return;t.debug({url:n,proxy:i,options:r},`Using proxy agent`);let a=new c.URL(n).host;return nt[a]||(nt[a]=new We(i,r)),nt[a]};var it=class e extends Error{constructor(t,n,...r){super(...r),Error.captureStackTrace&&Error.captureStackTrace(this,e),this.response=t,this.message=n||`HTTPClient failed to fetch ${t.url}, got ${t.status}/${t.statusText}`}},at=class{constructor({env:e,log:t},{headers:n={},retries:r=0}={}){if(!t)throw Error(`Missing required option in HTTPClient: log`);this.env=e,this.log=t,this.headers=n,this.retries=r}async fetch(e,t={},n={}){let r=t.agent||rt({env:this.env,log:this.log},e,n.proxy);this.env.CHROMATIC_DNS_SERVERS.length>0&&(this.log.debug(`Using custom DNS servers: ${this.env.CHROMATIC_DNS_SERVERS.join(`, `)}`),b.default.setServers(this.env.CHROMATIC_DNS_SERVERS),r=ze());let i=n.retries===void 0?this.retries:n.retries;return(0,oe.default)(async()=>{let i={...this.headers,...t.headers},a=await Ie(e,{...t,agent:r,headers:i});if(!a.ok){let e=new it(a);if(!n.noLogErrorBody){let t=await a.text();this.log.debug(e.message),this.log.debug(t)}throw e}return a},{retries:i,onRetry:(t,n)=>{this.log.debug({url:e,err:t},`Fetch failed; retrying ${n}/${i}`),(t.message.includes(`ENOTFOUND`)||[t.code,t.cause?.code].includes(`ENOTFOUND`))&&(r?this.env.CHROMATIC_DNS_FAILOVER_SERVERS.length>0&&(this.log.warn(`Fetch failed due to DNS lookup; switching to failover DNS servers`),b.default.setServers(this.env.CHROMATIC_DNS_FAILOVER_SERVERS)):(this.log.warn(`Fetch failed due to DNS lookup; switching to custom DNS resolver`),r=ze()))}})}async fetchBuffer(e,t){return(await this.fetch(e,t)).buffer()}},ot=n.a(),V=e.a(n.o()),st=e=>V.default.cyan(e),ct=class{value;next;constructor(e){this.value=e}},lt=class{#e;#t;#n;constructor(){this.clear()}enqueue(e){let t=new ct(e);this.#e?(this.#t.next=t,this.#t=t):(this.#e=t,this.#t=t),this.#n++}dequeue(){let e=this.#e;if(e)return this.#e=this.#e.next,this.#n--,this.#e||(this.#t=void 0),e.value}peek(){if(this.#e)return this.#e.value}clear(){this.#e=void 0,this.#t=void 0,this.#n=0}get size(){return this.#n}*[Symbol.iterator](){let e=this.#e;for(;e;)yield e.value,e=e.next}*drain(){for(;this.#e;)yield this.dequeue()}};function ut(e){let t=!1;if(typeof e==`object`&&({concurrency:e,rejectOnClear:t=!1}=e),dt(e),typeof t!=`boolean`)throw TypeError("Expected `rejectOnClear` to be a boolean");let n=new lt,r=0,i=()=>{r<e&&n.size>0&&(r++,n.dequeue().run())},a=()=>{r--,i()},o=async(e,t,n)=>{let r=(async()=>e(...n))();t(r);try{await r}catch{}a()},s=(t,a,s,c)=>{let l={reject:s};new Promise(e=>{l.run=e,n.enqueue(l)}).then(o.bind(void 0,t,a,c)),r<e&&i()},c=(e,...t)=>new Promise((n,r)=>{s(e,n,r,t)});return Object.defineProperties(c,{activeCount:{get:()=>r},pendingCount:{get:()=>n.size},clearQueue:{value(){if(!t){n.clear();return}let e=AbortSignal.abort().reason;for(;n.size>0;)n.dequeue().reject(e)}},concurrency:{get:()=>e,set(t){dt(t),e=t,queueMicrotask(()=>{for(;r<e&&n.size>0;)i()})}},map:{async value(e,t){let n=[];try{Array.from(e,(e,r)=>{let i=c(t,e,r);return n.push(i),i})}catch(e){for(let e of n)e.catch(()=>{});throw e}return Promise.all(n)}}}),c}function dt(e){if(!((Number.isInteger(e)||e===1/0)&&e>0))throw TypeError("Expected `concurrency` to be a number from 1 and up")}var ft=class extends Error{constructor(e,t){super(`Lock file too large to parse`),this.lockfilePath=e,this.lockfileSizeBytes=t,this.name=`LockFileSizeExceededError`}},pt=class extends Error{constructor(e){super(`No lockfile found for ${e}`),this.manifestPath=e,this.name=`LockFileMissingError`}},mt=class extends Error{constructor(e,t){super(`Failed to parse dependency graph`,t),this.lockfilePath=e,this.name=`LockFileParseFailedError`}},ht=class extends Error{constructor(e,{fileMissing:t=!1,...n}={}){super(`Failed to check out baseline file: ${e}`,n),this.pathspec=e,this.name=`BaselineCheckoutFailedError`,this.fileMissing=t}},gt=class extends Error{constructor(e,t){super(`Baseline commit not resolvable locally: ${e}`,t),this.commit=e,this.name=`AncestorMissingError`}},_t=class extends Error{constructor(e,t){super(`Baseline build had uncommitted changes: ${e}`,t),this.commit=e,this.name=`BaselineDirtyError`}},vt=class extends Error{constructor(e){super(`Replacement build lookup failed`,e),this.name=`ReplacementFailedError`}},yt=class extends Error{constructor(e){super(`Network error`,e),this.name=`NetworkError`}},bt=class extends Error{constructor(e,t){super(`Git command failed: ${e}`,t),this.command=e,this.name=`GitCommandError`}};const xt=new Set([`ENOTFOUND`,`ECONNREFUSED`,`ECONNRESET`,`ETIMEDOUT`,`EAI_AGAIN`]);function St(e){if(!e||typeof e!=`object`)return!1;if(e instanceof it||`name`in e&&e.name===`FetchError`)return!0;let t=Ct(e);return typeof t==`string`&&xt.has(t)}function Ct(e){if(!(!e||typeof e!=`object`)){if(`code`in e&&typeof e.code==`string`)return e.code;if(`cause`in e)return Ct(e.cause)}}const wt=(0,l.promisify)(u.exec);async function Tt(e,t=`SIGKILL`){if(process.platform===`win32`)await wt(`taskkill /pid ${e} /T /F`);else{let n=[];n=process.platform===`darwin`?await Dt(e):Et(e);for(let e of n)process.kill(e,t)}}function Et(e){try{let t=(0,a.readFileSync)(`/proc/${e}/task/${e}/children`,`utf8`).split(` `).filter(Boolean).map(Number);return[t,...t.map(e=>Et(e))].flat()}catch{return[]}}async function Dt(e){try{let{stdout:t}=await wt(`pgrep -P `+e),n=t.split(`
`).filter(Boolean).map(Number);for(let e of n)n.push(...await Dt(e));return n}catch{return[]}}function H(e,t={}){let{timeout:n,...r}=t,[a,...o]=i.n(e),s=i.t(a,o,r);if(s.kill=()=>{if(!s.pid)return!1;let e=s.pid;return Tt(e).catch(()=>{}).finally(()=>{try{process.kill(e,`SIGKILL`)}catch{}}),!0},n===void 0)return s;let c,l=new Promise((e,t)=>{c=setTimeout(()=>{s.kill(),t(Error(`Command timed out after ${n}ms`))},n)}),u=Promise.race([s,l]).finally(()=>{clearTimeout(c)});return Object.assign(u,s)}var Ot=({command:e})=>(0,ot.dedent)(V.default`
    ${n.t} {bold Unable to execute command}: ${e}
    Chromatic requires your Git repository to have at least one commit.
  `),kt=({command:e})=>(0,ot.dedent)(V.default`
    ${n.t} {bold Unable to execute command}: ${e}
    Chromatic only works from inside a Git repository.

    You can initialize a new Git repository with \`git init\`.

    You will also need a single commit in order to run a build. To do that:

    - Add a file (or multiple files) with \`git add <FILE_PATH(S)>\`
    - Commit the file(s) with \`git commit --message="<MESSAGE>"\`

    Once you've done so, please run this build again.

    For more information on Git, feel free to check out the Pro Git book: ${st(`https://git-scm.com/book/en/v2`)}
  `),At=({command:e})=>(0,ot.dedent)(V.default`
    ${n.t} {bold Unable to execute command}: ${e}
    Chromatic only works with Git installed.
  `);const U={env:{LANG:`C`,LC_ALL:`C`},all:!0,shell:!0};function W(e){return e?.gitTimeout??20*1e3}async function G({log:e,options:t},n,{logResult:r=!0,...i}={}){try{e.debug(`execGitCommand: ${n}`);let{all:a,stdout:o}=await H(n,{timeout:W(t),...U,...i}),s=a??o;if(s===void 0)throw Error(`Unexpected missing git command output for command: '${n}'`);let c=s.toString();return r&&e.debug(`execGitCommand result: '${c}'`),c}catch(t){throw Nt(e,n,t)}}async function*jt({log:e,options:t},n,r){e.debug(`execGitCommandEntries: ${n}`);let i=H(n,{timeout:W(t),...U,buffer:!1,all:!1,...r});if(!i.stdout)throw Error(`Unexpected missing stdout`);let a=!0,o=()=>{a=!1};i.then(o,o);try{i.stdout.setEncoding(`utf8`);let e=``;for await(let t of i.stdout){let n=(e+t).split(`\0`);e=n.pop()??``,yield*n}e&&(yield e),await i}catch(t){throw Nt(e,n,t)}finally{a&&i.kill()}}async function K({log:e,options:t},n,r){e.debug(`execGitCommandOneLine: ${n}`);let i=H(n,{timeout:W(t),...U,buffer:!1,...r});return Promise.race([(async()=>{throw await i,Error(`Unexpected missing git command output for command: '${n}'`)})(),new Promise((e,t)=>{if(!i.stdout)return t(Error(`Unexpected missing stdout`));let n=(0,f.createInterface)(i.stdout);n.once(`line`,t=>{n.close(),i.kill(),e(t)})})])}async function Mt({log:e,options:t},n,r){e.debug(`execGitCommandCountLines: ${n}`);let i=H(n,{timeout:W(t),...U,buffer:!1,...r});if(!i.stdout)throw Error(`Unexpected missing stdout`);let a=0;return(0,f.createInterface)(i.stdout).on(`line`,()=>{a+=1}),await i,a}function Nt(e,t,n){let{message:r}=n;return e.debug(`execGitCommand error: ${r}`),r.includes(`not a git repository`)?Error(kt({command:t})):r.includes(`git not found`)?Error(At({command:t})):r.includes(`does not have any commits yet`)?Error(Ot({command:t})):n}async function Pt(e,t,n){return(await G(e,`git ls-tree --full-tree ${t} -- "${n}"`,{all:!1})).trim()!==``}async function Ft(e,t,n){let r=new Set,i=n;for(;!r.has(i);){r.add(i);let a=await G(e,`git ls-tree --full-tree ${t} -- "${i}"`,{all:!1});if(!a.trim()&&i===n)return;if(!a.startsWith(`120000`))return i;let s=await G(e,`git show "${t}:${i}"`);i=o.default.posix.join(o.default.posix.dirname(i),s.trim())}throw Error(`Symbolic link cycle: ${t}:${n}`)}const q=/\r\n|\r|\n/;async function It(e){return(await G(e,`git --version`)).replace(`git version `,``).replace(/\s*\(.*\)/,``)}async function Lt(e){return G(e,`git config user.email`)}async function Rt(e){let t=(await G(e,`git config --get remote.origin.url`))?.toLowerCase()||``,[,n]=t.match(/([^/:]+\/[^/]+?)(\.git)?$/)||[];return/(dev\.azure\.com|visualstudio\.com)/.test(t)?Bt(zt(t)??n):n}function zt(e){if(!e.includes(`/_git/`))return;let t;try{t=new URL(e)}catch{return}let n=t.pathname.split(`/`).filter(Boolean),r=n.indexOf(`_git`),i=n[r+1]?.replace(/\.git$/,``);if(i)return`${r>+(t.hostname===`dev.azure.com`||n[0]===`defaultcollection`)?n[r-1]:i}/${i}`}function Bt(e){try{return decodeURIComponent(e)}catch{return e}}async function Vt(e,t=``){let n=await G(e,`git --no-pager log -n 1 --format="%H ## %ct ## %ae ## %an" ${t}`),r=RegExp(`^[a-f0-9]+ ## `),[i,a,o,s]=n.split(`
`).find(e=>r.test(e))?.split(` ## `)||[];return{commit:i,committedAt:Number(a)*1e3,committerEmail:o,committerName:s}}async function Ht(e){try{return await G(e,`git branch --show-current`)||`HEAD`}catch{try{return(await G(e,`git symbolic-ref HEAD`)).replace(/^refs\/heads\//,``)}catch{return(await G(e,`git rev-parse --abbrev-ref HEAD`)).replace(/^heads\//,``)}}}async function Ut(e){let t={all:!1},[n,r,i]=await Promise.all([G(e,`git diff --name-only --no-relative --diff-filter=d --cached`,t),G(e,`git diff --name-only --no-relative --diff-filter=d`,t),G(e,`git ls-files --others --exclude-standard --full-name`,t)]),a=[n,r,i].flatMap(e=>e.split(q)).filter(Boolean).join(`
`);if(!a)return``;let o=(await G(e,`git hash-object --stdin`,{input:await G(e,`git hash-object --stdin-paths`,{input:a})})).trim();return o===`e69de29bb2d1d6434b8b29ae775ad8c2e48c5391`?``:o}async function Wt(e){let t=await G(e,`git --no-pager log -n 1 --skip=1 --format="%H"`),n=RegExp(`^[a-f0-9]+$`);return t.split(`
`).some(e=>n.test(e))}async function Gt(e,t){try{return await G(e,`git cat-file -e "${t}^{commit}"`),!0}catch{return!1}}async function Kt(e,t){let n=new Set;for(let r of t)await Gt(e,r)&&n.add(r);return n}async function qt(e,t){if(t.length===0)return new Set;let n;try{n=await G(e,`git cat-file --batch-check`,{input:t.map(e=>`${e}^{commit}`).join(`
`),all:!1})}catch(n){return e.log.debug(`git cat-file --batch-check failed, checking one at a time: ${n}`),Kt(e,t)}let r=n.split(q);return r.length===t.length?new Set(t.filter((e,t)=>r[t]?.split(` `)[1]===`commit`)):(e.log.debug(`git cat-file --batch-check returned ${r.length} lines for ${t.length} commits, checking one at a time`),Kt(e,t))}async function Jt(e,t,n=``){let r=`git --no-pager diff --name-only --no-relative ${t} ${n}`;try{return(await G(e,r)).split(q).filter(Boolean)}catch(e){throw/bad object/.test(e.message)?new gt(t,{cause:e}):new bt(r,{cause:e})}}const Yt={A:`added`,D:`deleted`,M:`modified`,R:`renamed`,T:`typeChanged`};async function Xt(e,t,n=``,r=``){return(await G(e,`git --no-pager diff --name-status --no-relative --find-renames=20% ${t} ${n}${r?` -- "${r}"`:``}`)).split(q).filter(Boolean).map(e=>{let[t,...n]=e.split(`	`),r=Yt[t[0]]??`unknown`;return r===`renamed`?{status:r,fromPath:n[0],path:n.at(-1)}:{status:r,path:n[0]}})}async function Zt(e){let{log:t}=e;try{await G(e,`git remote update`)}catch(e){return t.warn(e),!0}let n;try{if(n=await G(e,`git rev-parse HEAD`),!n)throw Error(`Failed to retrieve last local commit hash`)}catch(e){return t.warn(e),!0}let r;try{if(r=await G(e,`git rev-parse "@{upstream}"`),!r)throw Error(`Failed to retrieve last remote commit hash`)}catch(e){return t.warn(e),!0}return n===r}async function Qt(e){return await G(e,`git status --porcelain`)===``}async function $t(e){return(await G(e,`git status`)).split(/(\r\n|\r|\n){2}/)[0].split(q).filter(e=>!e.startsWith(`On branch`)).join(s.EOL).trim()}async function en(e,t,n){let r=(await G(e,`git merge-base --all ${t} ${n}`)).split(q).filter(e=>e&&!e.startsWith(`warning: `));if(r.length!==0)return r.length===1?r[0]:r[(await Promise.all(r.map(async t=>(await G(e,`git name-rev --name-only --no-relative --exclude="tags/*" ${t}`)).replace(/~\d+$/,``)))).indexOf(n)]||r[0]}async function tn(e,t){return G(e,`git checkout ${t}`)}const nn=ut(10);async function rn(e,t,n,r){let i=`${t}:${n}`;await nn(async()=>{let a=o.default.join(r,n);await(0,te.mkdir)(o.default.dirname(a),{recursive:!0}),e.log.debug(`Checking out file ${i} at ${a}`);let s=!1;try{let r=await Ft(e,t,n);s=r===void 0,await G(e,`git show "${t}:${r??n}" > "${a}"`)}catch(e){throw new ht(i,{cause:e,fileMissing:s})}})}async function an(e){return G(e,`git checkout -`)}async function on(e){return G(e,`git reset --hard`)}async function sn(e){return G(e,`git rev-parse --show-toplevel`)}async function cn(e){let t=await sn(e),n=!1;for await(let r of dn(e,t)){n=!0;break}if(!n)throw Error(`git lists no tracked files, so it cannot tell which files are untracked; is the git index missing?`);let r=await G(e,`git ls-files --others --directory -z --full-name -- :/`,{all:!1,logResult:!1}),i=new Set(r.split(`\0`).filter(Boolean).map(e=>o.default.join(t,e)));return{has:e=>{if(i.has(e))return!0;let n=o.default.dirname(e);for(;n.startsWith(t+o.default.sep);){if(i.has(n+o.default.sep))return!0;n=o.default.dirname(n)}return!1}}}async function ln(e,t,...n){return(await G(e,`git ls-files --full-name -z ${n.map(e=>`${t}/${e}`).map(e=>`"${e}"`).join(` `)}`)).split(`\0`).filter(Boolean)}function un(e){if(!/[./]/u.test(e)||/[^\w./*?-]/u.test(e))return``;let t=e.replace(/^\.\//u,``).split(`/`);if(t.some(e=>!e||e===`.`||e===`..`))return``;let n=t.findIndex(e=>/[*?]/u.test(e));return n===-1?t.join(`/`):t.slice(0,n).join(`/`)}function dn(e,t,n=[]){let r=new Set(n.filter(Boolean).map(e=>un(e))),i=[...r].join(` `);return i&&!r.has(``)&&i.length<=4096?jt(e,`git ls-files --full-name -z -- ${i}`,{cwd:t,shell:!1}):jt(e,`git ls-files --full-name -z`,{cwd:t})}function J(e){return Math.min(e.options?.gitTimeout??5e3,t.t)}async function fn(e){try{let t=await K(e,`git log --reverse --format=%cd --date=iso`,{timeout:J(e)});return new Date(t)}catch{return}}async function pn(e){try{let t=await K(e,`git log --follow --reverse --format=%cd --date=iso -- ${e.options?.storybookConfigDir??`.storybook`}`,{timeout:J(e)});return new Date(t)}catch{return}}async function mn(e){try{return await Mt(e,`git shortlog -sn --all --since="6 months ago"`,{timeout:J(e)})}catch{return}}async function hn(e,t,n){try{return await Mt(e,`git ls-files -- ${t.flatMap(e=>[e,[e[0].toUpperCase(),...e.slice(1)].join(``)]).flatMap(e=>n.map(t=>`"*${e}*.${t}"`)).join(` `)}`,{timeout:J(e)})}catch{return}}async function gn(e){return(await K(e,`git rev-parse --is-shallow-repository`)).trim()===`true`?`shallow`:`full`}async function _n(e){let t=await K(e,`git rev-parse --git-path shallow`);if(!/\.git[/\\]shallow$/.test(t.trim()))throw Error(`Unexpected shallow file path: ${t}`);return(await(0,te.readFile)(t.trim(),`utf8`).catch(()=>``)).split(q).filter(Boolean)}const vn=/\(#\d+\)/;async function yn(e,t){if(t.length===0)return[];let n;try{n=await G(e,`git log --no-walk=unsorted --stdin --format=%H%x00%P%x00%s%x00`,{input:t.join(`
`)})}catch(t){return e.log.debug(`Failed to retrieve visited commit details, skipping: ${t}`),[]}if(!n.trim())return[];let r=n.split(`\0`),i=[];for(let e=0;e+2<r.length;e+=3){let t=r[e].trim(),n=r[e+1].trim(),a=r[e+2].trim();t&&i.push({commit:t,parentCommits:n?n.split(` `):[],isProbableSquashMerge:vn.test(a)})}return i}async function bn(e){let t=await K(e,`git config remote.origin.partialclonefilter`).catch(()=>``);return t.trim()===`blob:none`?`blobless`:t.trim()===`tree:0`?`treeless`:`full`}var xn=e.r({__addDisposableResource:()=>qn,__assign:()=>Q,__asyncDelegator:()=>zn,__asyncGenerator:()=>Rn,__asyncValues:()=>Bn,__await:()=>X,__awaiter:()=>jn,__classPrivateFieldGet:()=>Wn,__classPrivateFieldIn:()=>Kn,__classPrivateFieldSet:()=>Gn,__createBinding:()=>$,__decorate:()=>wn,__disposeResources:()=>Jn,__esDecorate:()=>En,__exportStar:()=>Nn,__extends:()=>Sn,__generator:()=>Mn,__importDefault:()=>Un,__importStar:()=>Hn,__makeTemplateObject:()=>Vn,__metadata:()=>An,__param:()=>Tn,__propKey:()=>On,__read:()=>Pn,__rest:()=>Cn,__rewriteRelativeImportExtension:()=>Yn,__runInitializers:()=>Dn,__setFunctionName:()=>kn,__spread:()=>Fn,__spreadArray:()=>Ln,__spreadArrays:()=>In,__values:()=>Y,default:()=>$n});function Sn(e,t){if(typeof t!=`function`&&t!==null)throw TypeError(`Class extends value `+String(t)+` is not a constructor or null`);Z(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}function Cn(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function wn(e,t,n,r){var i=arguments.length,a=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,o;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a}function Tn(e,t){return function(n,r){t(n,r,e)}}function En(e,t,n,r,i,a){function o(e){if(e!==void 0&&typeof e!=`function`)throw TypeError(`Function expected`);return e}for(var s=r.kind,c=s===`getter`?`get`:s===`setter`?`set`:`value`,l=!t&&e?r.static?e:e.prototype:null,u=t||(l?Object.getOwnPropertyDescriptor(l,r.name):{}),d,f=!1,p=n.length-1;p>=0;p--){var m={};for(var h in r)m[h]=h===`access`?{}:r[h];for(var h in r.access)m.access[h]=r.access[h];m.addInitializer=function(e){if(f)throw TypeError(`Cannot add initializers after decoration has completed`);a.push(o(e||null))};var g=(0,n[p])(s===`accessor`?{get:u.get,set:u.set}:u[c],m);if(s===`accessor`){if(g===void 0)continue;if(typeof g!=`object`||!g)throw TypeError(`Object expected`);(d=o(g.get))&&(u.get=d),(d=o(g.set))&&(u.set=d),(d=o(g.init))&&i.unshift(d)}else (d=o(g))&&(s===`field`?i.unshift(d):u[c]=d)}l&&Object.defineProperty(l,r.name,u),f=!0}function Dn(e,t,n){for(var r=arguments.length>2,i=0;i<t.length;i++)n=r?t[i].call(e,n):t[i].call(e);return r?n:void 0}function On(e){return typeof e==`symbol`?e:`${e}`}function kn(e,t,n){return typeof t==`symbol`&&(t=t.description?`[${t.description}]`:``),Object.defineProperty(e,`name`,{configurable:!0,value:n?`${n} ${t}`:t})}function An(e,t){if(typeof Reflect==`object`&&typeof Reflect.metadata==`function`)return Reflect.metadata(e,t)}function jn(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})}function Mn(e,t){var n={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},r,i,a,o=Object.create((typeof Iterator==`function`?Iterator:Object).prototype);return o.next=s(0),o.throw=s(1),o.return=s(2),typeof Symbol==`function`&&(o[Symbol.iterator]=function(){return this}),o;function s(e){return function(t){return c([e,t])}}function c(s){if(r)throw TypeError(`Generator is already executing.`);for(;o&&(o=0,s[0]&&(n=0)),n;)try{if(r=1,i&&(a=s[0]&2?i.return:s[0]?i.throw||((a=i.return)&&a.call(i),0):i.next)&&!(a=a.call(i,s[1])).done)return a;switch(i=0,a&&(s=[s[0]&2,a.value]),s[0]){case 0:case 1:a=s;break;case 4:return n.label++,{value:s[1],done:!1};case 5:n.label++,i=s[1],s=[0];continue;case 7:s=n.ops.pop(),n.trys.pop();continue;default:if((a=n.trys,!(a=a.length>0&&a[a.length-1]))&&(s[0]===6||s[0]===2)){n=0;continue}if(s[0]===3&&(!a||s[1]>a[0]&&s[1]<a[3])){n.label=s[1];break}if(s[0]===6&&n.label<a[1]){n.label=a[1],a=s;break}if(a&&n.label<a[2]){n.label=a[2],n.ops.push(s);break}a[2]&&n.ops.pop(),n.trys.pop();continue}s=t.call(e,n)}catch(e){s=[6,e],i=0}finally{r=a=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}}function Nn(e,t){for(var n in e)n!==`default`&&!Object.prototype.hasOwnProperty.call(t,n)&&$(t,e,n)}function Y(e){var t=typeof Symbol==`function`&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length==`number`)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw TypeError(t?`Object is not iterable.`:`Symbol.iterator is not defined.`)}function Pn(e,t){var n=typeof Symbol==`function`&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),i,a=[],o;try{for(;(t===void 0||t-- >0)&&!(i=r.next()).done;)a.push(i.value)}catch(e){o={error:e}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return a}function Fn(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(Pn(arguments[t]));return e}function In(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;for(var r=Array(e),i=0,t=0;t<n;t++)for(var a=arguments[t],o=0,s=a.length;o<s;o++,i++)r[i]=a[o];return r}function Ln(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,a;r<i;r++)(a||!(r in t))&&(a||=Array.prototype.slice.call(t,0,r),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))}function X(e){return this instanceof X?(this.v=e,this):new X(e)}function Rn(e,t,n){if(!Symbol.asyncIterator)throw TypeError(`Symbol.asyncIterator is not defined.`);var r=n.apply(e,t||[]),i,a=[];return i=Object.create((typeof AsyncIterator==`function`?AsyncIterator:Object).prototype),s(`next`),s(`throw`),s(`return`,o),i[Symbol.asyncIterator]=function(){return this},i;function o(e){return function(t){return Promise.resolve(t).then(e,d)}}function s(e,t){r[e]&&(i[e]=function(t){return new Promise(function(n,r){a.push([e,t,n,r])>1||c(e,t)})},t&&(i[e]=t(i[e])))}function c(e,t){try{l(r[e](t))}catch(e){f(a[0][3],e)}}function l(e){e.value instanceof X?Promise.resolve(e.value.v).then(u,d):f(a[0][2],e)}function u(e){c(`next`,e)}function d(e){c(`throw`,e)}function f(e,t){e(t),a.shift(),a.length&&c(a[0][0],a[0][1])}}function zn(e){var t,n;return t={},r(`next`),r(`throw`,function(e){throw e}),r(`return`),t[Symbol.iterator]=function(){return this},t;function r(r,i){t[r]=e[r]?function(t){return(n=!n)?{value:X(e[r](t)),done:!1}:i?i(t):t}:i}}function Bn(e){if(!Symbol.asyncIterator)throw TypeError(`Symbol.asyncIterator is not defined.`);var t=e[Symbol.asyncIterator],n;return t?t.call(e):(e=typeof Y==`function`?Y(e):e[Symbol.iterator](),n={},r(`next`),r(`throw`),r(`return`),n[Symbol.asyncIterator]=function(){return this},n);function r(t){n[t]=e[t]&&function(n){return new Promise(function(r,a){n=e[t](n),i(r,a,n.done,n.value)})}}function i(e,t,n,r){Promise.resolve(r).then(function(t){e({value:t,done:n})},t)}}function Vn(e,t){return Object.defineProperty?Object.defineProperty(e,`raw`,{value:t}):e.raw=t,e}function Hn(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n=Zn(e),r=0;r<n.length;r++)n[r]!==`default`&&$(t,e,n[r]);return Xn(t,e),t}function Un(e){return e&&e.__esModule?e:{default:e}}function Wn(e,t,n,r){if(n===`a`&&!r)throw TypeError(`Private accessor was defined without a getter`);if(typeof t==`function`?e!==t||!r:!t.has(e))throw TypeError(`Cannot read private member from an object whose class did not declare it`);return n===`m`?r:n===`a`?r.call(e):r?r.value:t.get(e)}function Gn(e,t,n,r,i){if(r===`m`)throw TypeError(`Private method is not writable`);if(r===`a`&&!i)throw TypeError(`Private accessor was defined without a setter`);if(typeof t==`function`?e!==t||!i:!t.has(e))throw TypeError(`Cannot write private member to an object whose class did not declare it`);return r===`a`?i.call(e,n):i?i.value=n:t.set(e,n),n}function Kn(e,t){if(t===null||typeof t!=`object`&&typeof t!=`function`)throw TypeError(`Cannot use 'in' operator on non-object`);return typeof e==`function`?t===e:e.has(t)}function qn(e,t,n){if(t!=null){if(typeof t!=`object`&&typeof t!=`function`)throw TypeError(`Object expected.`);var r,i;if(n){if(!Symbol.asyncDispose)throw TypeError(`Symbol.asyncDispose is not defined.`);r=t[Symbol.asyncDispose]}if(r===void 0){if(!Symbol.dispose)throw TypeError(`Symbol.dispose is not defined.`);r=t[Symbol.dispose],n&&(i=r)}if(typeof r!=`function`)throw TypeError(`Object not disposable.`);i&&(r=function(){try{i.call(this)}catch(e){return Promise.reject(e)}}),e.stack.push({value:t,dispose:r,async:n})}else n&&e.stack.push({async:!0});return t}function Jn(e){function t(t){e.error=e.hasError?new Qn(t,e.error,`An error was suppressed during disposal.`):t,e.hasError=!0}var n,r=0;function i(){for(;n=e.stack.pop();)try{if(!n.async&&r===1)return r=0,e.stack.push(n),Promise.resolve().then(i);if(n.dispose){var a=n.dispose.call(n.value);if(n.async)return r|=2,Promise.resolve(a).then(i,function(e){return t(e),i()})}else r|=1}catch(e){t(e)}if(r===1)return e.hasError?Promise.reject(e.error):Promise.resolve();if(e.hasError)throw e.error}return i()}function Yn(e,t){return typeof e==`string`&&/^\.\.?\//.test(e)?e.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i,function(e,n,r,i,a){return n?t?`.jsx`:`.js`:r&&(!i||!a)?e:r+i+`.`+a.toLowerCase()+`js`}):e}var Z,Q,$,Xn,Zn,Qn,$n,er=e.n((()=>{Z=function(e,t){return Z=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},Z(e,t)},Q=function(){return Q=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n],t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},Q.apply(this,arguments)},$=Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||(`get`in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]}),Xn=Object.create?(function(e,t){Object.defineProperty(e,`default`,{enumerable:!0,value:t})}):function(e,t){e.default=t},Zn=function(e){return Zn=Object.getOwnPropertyNames||function(e){var t=[];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[t.length]=n);return t},Zn(e)},Qn=typeof SuppressedError==`function`?SuppressedError:function(e,t,n){var r=Error(n);return r.name=`SuppressedError`,r.error=e,r.suppressed=t,r},$n={__extends:Sn,__assign:Q,__rest:Cn,__decorate:wn,__param:Tn,__esDecorate:En,__runInitializers:Dn,__propKey:On,__setFunctionName:kn,__metadata:An,__awaiter:jn,__generator:Mn,__createBinding:$,__exportStar:Nn,__values:Y,__read:Pn,__spread:Fn,__spreadArrays:In,__spreadArray:Ln,__await:X,__asyncGenerator:Rn,__asyncDelegator:zn,__asyncValues:Bn,__makeTemplateObject:Vn,__importStar:Hn,__importDefault:Un,__classPrivateFieldGet:Wn,__classPrivateFieldSet:Gn,__classPrivateFieldIn:Kn,__addDisposableResource:qn,__disposeResources:Jn,__rewriteRelativeImportExtension:Yn}}));const tr=e=>e.split(o.default.sep).filter(Boolean).join(o.default.posix.sep);function nr({storybookBaseDir:e,gitRootPath:t}){return e?o.default.resolve(t??process.cwd(),e):process.cwd()}function rr(e,t){return tr(o.default.relative(e,t))}const ir=e=>{let[,t]=e.match(/\/node_modules\/(@[\w-]+\/[\w-]+)\//)||[];if(t)return t;let[,n]=e.match(/\/node_modules\/([\w-]+)\//)||[];return n};function ar(e,t,n=t){return!e||e.startsWith(`/virtual:`)?e:tr(o.default.isAbsolute(e)?o.default.relative(t,e):o.default.join(o.default.relative(t,n),e))}function or(e,t,n){let r=/\s+(sync|lazy)\s+/g,i=/(\?.*)/g,a=ar(/^\0\.\.?\//.test(e)?e.slice(1):e,t,n);return i.test(a)&&!r.test(a)?a.replaceAll(i,``):a}const sr=e=>e.storybook?.projectRoot??process.cwd();function cr(e){let t=[e.nameForCondition??e.name,...(e.modules??[]).map(e=>e.nameForCondition??e.name)];return[...new Set(t.filter(Boolean).map(e=>dr(e)))]}const lr=/(?:^|[\\/])node_modules(?:[\\/]|$)/;function ur(e){return lr.test(e)}function dr(e){return e.replace(/ \+ \d+ modules?$/,``)}Object.defineProperty(exports,`$`,{enumerable:!0,get:function(){return yt}}),Object.defineProperty(exports,`A`,{enumerable:!0,get:function(){return _n}}),Object.defineProperty(exports,`B`,{enumerable:!0,get:function(){return Qt}}),Object.defineProperty(exports,`C`,{enumerable:!0,get:function(){return gn}}),Object.defineProperty(exports,`D`,{enumerable:!0,get:function(){return mn}}),Object.defineProperty(exports,`E`,{enumerable:!0,get:function(){return hn}}),Object.defineProperty(exports,`F`,{enumerable:!0,get:function(){return $t}}),Object.defineProperty(exports,`G`,{enumerable:!0,get:function(){return H}}),Object.defineProperty(exports,`H`,{enumerable:!0,get:function(){return dn}}),Object.defineProperty(exports,`I`,{enumerable:!0,get:function(){return Lt}}),Object.defineProperty(exports,`J`,{enumerable:!0,get:function(){return _t}}),Object.defineProperty(exports,`K`,{enumerable:!0,get:function(){return gt}}),Object.defineProperty(exports,`L`,{enumerable:!0,get:function(){return It}}),Object.defineProperty(exports,`M`,{enumerable:!0,get:function(){return pn}}),Object.defineProperty(exports,`N`,{enumerable:!0,get:function(){return Ut}}),Object.defineProperty(exports,`O`,{enumerable:!0,get:function(){return fn}}),Object.defineProperty(exports,`P`,{enumerable:!0,get:function(){return cn}}),Object.defineProperty(exports,`Q`,{enumerable:!0,get:function(){return ft}}),Object.defineProperty(exports,`R`,{enumerable:!0,get:function(){return yn}}),Object.defineProperty(exports,`S`,{enumerable:!0,get:function(){return Xt}}),Object.defineProperty(exports,`T`,{enumerable:!0,get:function(){return Vt}}),Object.defineProperty(exports,`U`,{enumerable:!0,get:function(){return Pt}}),Object.defineProperty(exports,`V`,{enumerable:!0,get:function(){return Zt}}),Object.defineProperty(exports,`W`,{enumerable:!0,get:function(){return G}}),Object.defineProperty(exports,`X`,{enumerable:!0,get:function(){return pt}}),Object.defineProperty(exports,`Y`,{enumerable:!0,get:function(){return bt}}),Object.defineProperty(exports,`Z`,{enumerable:!0,get:function(){return mt}}),Object.defineProperty(exports,`_`,{enumerable:!0,get:function(){return on}}),Object.defineProperty(exports,`a`,{enumerable:!0,get:function(){return or}}),Object.defineProperty(exports,`at`,{enumerable:!0,get:function(){return ae}}),Object.defineProperty(exports,`b`,{enumerable:!0,get:function(){return Ht}}),Object.defineProperty(exports,`c`,{enumerable:!0,get:function(){return rr}}),Object.defineProperty(exports,`d`,{enumerable:!0,get:function(){return xn}}),Object.defineProperty(exports,`et`,{enumerable:!0,get:function(){return vt}}),Object.defineProperty(exports,`f`,{enumerable:!0,get:function(){return tn}}),Object.defineProperty(exports,`g`,{enumerable:!0,get:function(){return qt}}),Object.defineProperty(exports,`h`,{enumerable:!0,get:function(){return Gt}}),Object.defineProperty(exports,`i`,{enumerable:!0,get:function(){return cr}}),Object.defineProperty(exports,`it`,{enumerable:!0,get:function(){return at}}),Object.defineProperty(exports,`j`,{enumerable:!0,get:function(){return Rt}}),Object.defineProperty(exports,`k`,{enumerable:!0,get:function(){return sn}}),Object.defineProperty(exports,`l`,{enumerable:!0,get:function(){return tr}}),Object.defineProperty(exports,`m`,{enumerable:!0,get:function(){return an}}),Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return sr}}),Object.defineProperty(exports,`nt`,{enumerable:!0,get:function(){return ut}}),Object.defineProperty(exports,`o`,{enumerable:!0,get:function(){return dr}}),Object.defineProperty(exports,`p`,{enumerable:!0,get:function(){return rn}}),Object.defineProperty(exports,`q`,{enumerable:!0,get:function(){return ht}}),Object.defineProperty(exports,`r`,{enumerable:!0,get:function(){return ur}}),Object.defineProperty(exports,`rt`,{enumerable:!0,get:function(){return st}}),Object.defineProperty(exports,`s`,{enumerable:!0,get:function(){return nr}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return ir}}),Object.defineProperty(exports,`tt`,{enumerable:!0,get:function(){return St}}),Object.defineProperty(exports,`u`,{enumerable:!0,get:function(){return er}}),Object.defineProperty(exports,`v`,{enumerable:!0,get:function(){return ln}}),Object.defineProperty(exports,`w`,{enumerable:!0,get:function(){return bn}}),Object.defineProperty(exports,`x`,{enumerable:!0,get:function(){return Jt}}),Object.defineProperty(exports,`y`,{enumerable:!0,get:function(){return en}}),Object.defineProperty(exports,`z`,{enumerable:!0,get:function(){return Wt}});
//# sourceMappingURL=statsPaths-DxOPEGB1.cjs.map
//# debugId=ed0a0bb0-5d78-563b-aba1-124c8b9f94a1