@robinmalfait/event-source 0.0.13 → 0.0.14

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.cjs CHANGED
@@ -1,436 +1,36 @@
1
- "use strict";var Uf=Object.create;var An=Object.defineProperty;var Vf=Object.getOwnPropertyDescriptor;var Jf=Object.getOwnPropertyNames;var Kf=Object.getPrototypeOf,Xf=Object.prototype.hasOwnProperty;var ea=(e,t)=>()=>(e&&(t=e(e=0)),t);var Qt=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),ta=(e,t)=>{for(var n in t)An(e,n,{get:t[n],enumerable:!0})},na=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of Jf(t))!Xf.call(e,o)&&o!==n&&An(e,o,{get:()=>t[o],enumerable:!(r=Vf(t,o))||r.enumerable});return e};var ra=(e,t,n)=>(n=e!=null?Uf(Kf(e)):{},na(t||!e||!e.__esModule?An(n,"default",{value:e,enumerable:!0}):n,e)),Hf=e=>na(An({},"__esModule",{value:!0}),e);function wn(e,t,n){let r=t-n;r=r<0?-r<<1|1:r<<1;do{let o=r&31;r>>>=5,r>0&&(o|=32),e.write(Su[o])}while(r>0);return t}function Eu(e){let t=new hs,n=0,r=0,o=0,i=0;for(let s=0;s<e.length;s++){let a=e[s];if(s>0&&t.write(59),a.length===0)continue;let c=0;for(let l=0;l<a.length;l++){let u=a[l];l>0&&t.write(44),c=wn(t,u[0],c),u.length!==1&&(n=wn(t,u[1],n),r=wn(t,u[2],r),o=wn(t,u[3],o),u.length!==4&&(i=wn(t,u[4],i)))}}return t.flush()}var bu,Su,gg,wu,vu,hs,Tu=ea(()=>{"use strict";bu="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Su=new Uint8Array(64),gg=new Uint8Array(128);for(let e=0;e<bu.length;e++){let t=bu.charCodeAt(e);Su[e]=t,gg[t]=e}wu=1024*16,vu=typeof TextDecoder<"u"?new TextDecoder:typeof Buffer<"u"?{decode(e){return Buffer.from(e.buffer,e.byteOffset,e.byteLength).toString()}}:{decode(e){let t="";for(let n=0;n<e.length;n++)t+=String.fromCharCode(e[n]);return t}},hs=class{constructor(){this.pos=0,this.out="",this.buffer=new Uint8Array(wu)}write(t){let{buffer:n}=this;n[this.pos++]=t,this.pos===wu&&(this.out+=vu.decode(n),this.pos=0)}flush(){let{buffer:t,out:n,pos:r}=this;return r>0?n+vu.decode(t.subarray(0,r)):n}}});var Ou={};ta(Ou,{Bundle:()=>ds,SourceMap:()=>Sn,default:()=>En});function yg(){return typeof globalThis<"u"&&typeof globalThis.btoa=="function"?e=>globalThis.btoa(unescape(encodeURIComponent(e))):typeof Buffer=="function"?e=>Buffer.from(e,"utf-8").toString("base64"):()=>{throw new Error("Unsupported environment: `window.btoa` or `Buffer` should be supported.")}}function wg(e){let t=e.split(`
2
- `),n=t.filter(i=>/^\t+/.test(i)),r=t.filter(i=>/^ {2,}/.test(i));if(n.length===0&&r.length===0)return null;if(n.length>=r.length)return" ";let o=r.reduce((i,s)=>{let a=/^ +/.exec(s)[0].length;return Math.min(a,i)},1/0);return new Array(o+1).join(" ")}function _u(e,t){let n=e.split(/[/\\]/),r=t.split(/[/\\]/);for(n.pop();n[0]===r[0];)n.shift(),r.shift();if(n.length){let o=n.length;for(;o--;)n[o]=".."}return n.concat(r).join("/")}function Cu(e){return vg.call(e)==="[object Object]"}function ps(e){let t=e.split(`
3
- `),n=[];for(let r=0,o=0;r<t.length;r++)n.push(o),o+=t[r].length+1;return function(o){let i=0,s=n.length;for(;i<s;){let l=i+s>>1;o<n[l]?s=l:i=l+1}let a=i-1,c=o-n[a];return{line:a,column:c}}}var zr,Wr,bg,Sn,vg,Sg,Ur,vn,Jt,En,xu,ds,Iu=ea(()=>{"use strict";Tu();zr=class e{constructor(t){this.bits=t instanceof e?t.bits.slice():[]}add(t){this.bits[t>>5]|=1<<(t&31)}has(t){return!!(this.bits[t>>5]&1<<(t&31))}},Wr=class e{constructor(t,n,r){this.start=t,this.end=n,this.original=r,this.intro="",this.outro="",this.content=r,this.storeName=!1,this.edited=!1,this.previous=null,this.next=null}appendLeft(t){this.outro+=t}appendRight(t){this.intro=this.intro+t}clone(){let t=new e(this.start,this.end,this.original);return t.intro=this.intro,t.outro=this.outro,t.content=this.content,t.storeName=this.storeName,t.edited=this.edited,t}contains(t){return this.start<t&&t<this.end}eachNext(t){let n=this;for(;n;)t(n),n=n.next}eachPrevious(t){let n=this;for(;n;)t(n),n=n.previous}edit(t,n,r){return this.content=t,r||(this.intro="",this.outro=""),this.storeName=n,this.edited=!0,this}prependLeft(t){this.outro=t+this.outro}prependRight(t){this.intro=t+this.intro}reset(){this.intro="",this.outro="",this.edited&&(this.content=this.original,this.storeName=!1,this.edited=!1)}split(t){let n=t-this.start,r=this.original.slice(0,n),o=this.original.slice(n);this.original=r;let i=new e(t,this.end,o);return i.outro=this.outro,this.outro="",this.end=t,this.edited?(i.edit("",!1),this.content=""):this.content=r,i.next=this.next,i.next&&(i.next.previous=i),i.previous=this,this.next=i,i}toString(){return this.intro+this.content+this.outro}trimEnd(t){if(this.outro=this.outro.replace(t,""),this.outro.length)return!0;let n=this.content.replace(t,"");if(n.length)return n!==this.content&&(this.split(this.start+n.length).edit("",void 0,!0),this.edited&&this.edit(n,this.storeName,!0)),!0;if(this.edit("",void 0,!0),this.intro=this.intro.replace(t,""),this.intro.length)return!0}trimStart(t){if(this.intro=this.intro.replace(t,""),this.intro.length)return!0;let n=this.content.replace(t,"");if(n.length){if(n!==this.content){let r=this.split(this.end-n.length);this.edited&&r.edit(n,this.storeName,!0),this.edit("",void 0,!0)}return!0}else if(this.edit("",void 0,!0),this.outro=this.outro.replace(t,""),this.outro.length)return!0}};bg=yg(),Sn=class{constructor(t){this.version=3,this.file=t.file,this.sources=t.sources,this.sourcesContent=t.sourcesContent,this.names=t.names,this.mappings=Eu(t.mappings),typeof t.x_google_ignoreList<"u"&&(this.x_google_ignoreList=t.x_google_ignoreList),typeof t.debugId<"u"&&(this.debugId=t.debugId)}toString(){return JSON.stringify(this)}toUrl(){return"data:application/json;charset=utf-8;base64,"+bg(this.toString())}};vg=Object.prototype.toString;Sg=/\w/,Ur=class{constructor(t){this.hires=t,this.generatedCodeLine=0,this.generatedCodeColumn=0,this.raw=[],this.rawSegments=this.raw[this.generatedCodeLine]=[],this.pending=null}addEdit(t,n,r,o){if(n.length){let i=n.length-1,s=n.indexOf(`
4
- `,0),a=-1;for(;s>=0&&i>s;){let l=[this.generatedCodeColumn,t,r.line,r.column];o>=0&&l.push(o),this.rawSegments.push(l),this.generatedCodeLine+=1,this.raw[this.generatedCodeLine]=this.rawSegments=[],this.generatedCodeColumn=0,a=s,s=n.indexOf(`
5
- `,s+1)}let c=[this.generatedCodeColumn,t,r.line,r.column];o>=0&&c.push(o),this.rawSegments.push(c),this.advance(n.slice(a+1))}else this.pending&&(this.rawSegments.push(this.pending),this.advance(n));this.pending=null}addUneditedChunk(t,n,r,o,i){let s=n.start,a=!0,c=!1;for(;s<n.end;){if(r[s]===`
6
- `)o.line+=1,o.column=0,this.generatedCodeLine+=1,this.raw[this.generatedCodeLine]=this.rawSegments=[],this.generatedCodeColumn=0,a=!0,c=!1;else{if(this.hires||a||i.has(s)){let l=[this.generatedCodeColumn,t,o.line,o.column];this.hires==="boundary"?Sg.test(r[s])?c||(this.rawSegments.push(l),c=!0):(this.rawSegments.push(l),c=!1):this.rawSegments.push(l)}o.column+=1,this.generatedCodeColumn+=1,a=!1}s+=1}this.pending=null}advance(t){if(!t)return;let n=t.split(`
7
- `);if(n.length>1){for(let r=0;r<n.length-1;r++)this.generatedCodeLine++,this.raw[this.generatedCodeLine]=this.rawSegments=[];this.generatedCodeColumn=0}this.generatedCodeColumn+=n[n.length-1].length}},vn=`
8
- `,Jt={insertLeft:!1,insertRight:!1,storeName:!1},En=class e{constructor(t,n={}){let r=new Wr(0,t.length,t);Object.defineProperties(this,{original:{writable:!0,value:t},outro:{writable:!0,value:""},intro:{writable:!0,value:""},firstChunk:{writable:!0,value:r},lastChunk:{writable:!0,value:r},lastSearchedChunk:{writable:!0,value:r},byStart:{writable:!0,value:{}},byEnd:{writable:!0,value:{}},filename:{writable:!0,value:n.filename},indentExclusionRanges:{writable:!0,value:n.indentExclusionRanges},sourcemapLocations:{writable:!0,value:new zr},storedNames:{writable:!0,value:{}},indentStr:{writable:!0,value:void 0},ignoreList:{writable:!0,value:n.ignoreList},offset:{writable:!0,value:n.offset||0}}),this.byStart[0]=r,this.byEnd[t.length]=r}addSourcemapLocation(t){this.sourcemapLocations.add(t)}append(t){if(typeof t!="string")throw new TypeError("outro content must be a string");return this.outro+=t,this}appendLeft(t,n){if(t=t+this.offset,typeof n!="string")throw new TypeError("inserted content must be a string");this._split(t);let r=this.byEnd[t];return r?r.appendLeft(n):this.intro+=n,this}appendRight(t,n){if(t=t+this.offset,typeof n!="string")throw new TypeError("inserted content must be a string");this._split(t);let r=this.byStart[t];return r?r.appendRight(n):this.outro+=n,this}clone(){let t=new e(this.original,{filename:this.filename,offset:this.offset}),n=this.firstChunk,r=t.firstChunk=t.lastSearchedChunk=n.clone();for(;n;){t.byStart[r.start]=r,t.byEnd[r.end]=r;let o=n.next,i=o&&o.clone();i&&(r.next=i,i.previous=r,r=i),n=o}return t.lastChunk=r,this.indentExclusionRanges&&(t.indentExclusionRanges=this.indentExclusionRanges.slice()),t.sourcemapLocations=new zr(this.sourcemapLocations),t.intro=this.intro,t.outro=this.outro,t}generateDecodedMap(t){t=t||{};let n=0,r=Object.keys(this.storedNames),o=new Ur(t.hires),i=ps(this.original);return this.intro&&o.advance(this.intro),this.firstChunk.eachNext(s=>{let a=i(s.start);s.intro.length&&o.advance(s.intro),s.edited?o.addEdit(n,s.content,a,s.storeName?r.indexOf(s.original):-1):o.addUneditedChunk(n,s,this.original,a,this.sourcemapLocations),s.outro.length&&o.advance(s.outro)}),{file:t.file?t.file.split(/[/\\]/).pop():void 0,sources:[t.source?_u(t.file||"",t.source):t.file||""],sourcesContent:t.includeContent?[this.original]:void 0,names:r,mappings:o.raw,x_google_ignoreList:this.ignoreList?[n]:void 0}}generateMap(t){return new Sn(this.generateDecodedMap(t))}_ensureindentStr(){this.indentStr===void 0&&(this.indentStr=wg(this.original))}_getRawIndentString(){return this._ensureindentStr(),this.indentStr}getIndentString(){return this._ensureindentStr(),this.indentStr===null?" ":this.indentStr}indent(t,n){let r=/^[^\r\n]/gm;if(Cu(t)&&(n=t,t=void 0),t===void 0&&(this._ensureindentStr(),t=this.indentStr||" "),t==="")return this;n=n||{};let o={};n.exclude&&(typeof n.exclude[0]=="number"?[n.exclude]:n.exclude).forEach(u=>{for(let f=u[0];f<u[1];f+=1)o[f]=!0});let i=n.indentStart!==!1,s=l=>i?`${t}${l}`:(i=!0,l);this.intro=this.intro.replace(r,s);let a=0,c=this.firstChunk;for(;c;){let l=c.end;if(c.edited)o[a]||(c.content=c.content.replace(r,s),c.content.length&&(i=c.content[c.content.length-1]===`
9
- `));else for(a=c.start;a<l;){if(!o[a]){let u=this.original[a];u===`
10
- `?i=!0:u!=="\r"&&i&&(i=!1,a===c.start||(this._splitChunk(c,a),c=c.next),c.prependRight(t))}a+=1}a=c.end,c=c.next}return this.outro=this.outro.replace(r,s),this}insert(){throw new Error("magicString.insert(...) is deprecated. Use prependRight(...) or appendLeft(...)")}insertLeft(t,n){return Jt.insertLeft||(console.warn("magicString.insertLeft(...) is deprecated. Use magicString.appendLeft(...) instead"),Jt.insertLeft=!0),this.appendLeft(t,n)}insertRight(t,n){return Jt.insertRight||(console.warn("magicString.insertRight(...) is deprecated. Use magicString.prependRight(...) instead"),Jt.insertRight=!0),this.prependRight(t,n)}move(t,n,r){if(t=t+this.offset,n=n+this.offset,r=r+this.offset,r>=t&&r<=n)throw new Error("Cannot move a selection inside itself");this._split(t),this._split(n),this._split(r);let o=this.byStart[t],i=this.byEnd[n],s=o.previous,a=i.next,c=this.byStart[r];if(!c&&i===this.lastChunk)return this;let l=c?c.previous:this.lastChunk;return s&&(s.next=a),a&&(a.previous=s),l&&(l.next=o),c&&(c.previous=i),o.previous||(this.firstChunk=i.next),i.next||(this.lastChunk=o.previous,this.lastChunk.next=null),o.previous=l,i.next=c||null,l||(this.firstChunk=o),c||(this.lastChunk=i),this}overwrite(t,n,r,o){return o=o||{},this.update(t,n,r,{...o,overwrite:!o.contentOnly})}update(t,n,r,o){if(t=t+this.offset,n=n+this.offset,typeof r!="string")throw new TypeError("replacement content must be a string");if(this.original.length!==0){for(;t<0;)t+=this.original.length;for(;n<0;)n+=this.original.length}if(n>this.original.length)throw new Error("end is out of bounds");if(t===n)throw new Error("Cannot overwrite a zero-length range \u2013 use appendLeft or prependRight instead");this._split(t),this._split(n),o===!0&&(Jt.storeName||(console.warn("The final argument to magicString.overwrite(...) should be an options object. See https://github.com/rich-harris/magic-string"),Jt.storeName=!0),o={storeName:!0});let i=o!==void 0?o.storeName:!1,s=o!==void 0?o.overwrite:!1;if(i){let l=this.original.slice(t,n);Object.defineProperty(this.storedNames,l,{writable:!0,value:!0,enumerable:!0})}let a=this.byStart[t],c=this.byEnd[n];if(a){let l=a;for(;l!==c;){if(l.next!==this.byStart[l.end])throw new Error("Cannot overwrite across a split point");l=l.next,l.edit("",!1)}a.edit(r,i,!s)}else{let l=new Wr(t,n,"").edit(r,i);c.next=l,l.previous=c}return this}prepend(t){if(typeof t!="string")throw new TypeError("outro content must be a string");return this.intro=t+this.intro,this}prependLeft(t,n){if(t=t+this.offset,typeof n!="string")throw new TypeError("inserted content must be a string");this._split(t);let r=this.byEnd[t];return r?r.prependLeft(n):this.intro=n+this.intro,this}prependRight(t,n){if(t=t+this.offset,typeof n!="string")throw new TypeError("inserted content must be a string");this._split(t);let r=this.byStart[t];return r?r.prependRight(n):this.outro=n+this.outro,this}remove(t,n){if(t=t+this.offset,n=n+this.offset,this.original.length!==0){for(;t<0;)t+=this.original.length;for(;n<0;)n+=this.original.length}if(t===n)return this;if(t<0||n>this.original.length)throw new Error("Character is out of bounds");if(t>n)throw new Error("end must be greater than start");this._split(t),this._split(n);let r=this.byStart[t];for(;r;)r.intro="",r.outro="",r.edit(""),r=n>r.end?this.byStart[r.end]:null;return this}reset(t,n){if(t=t+this.offset,n=n+this.offset,this.original.length!==0){for(;t<0;)t+=this.original.length;for(;n<0;)n+=this.original.length}if(t===n)return this;if(t<0||n>this.original.length)throw new Error("Character is out of bounds");if(t>n)throw new Error("end must be greater than start");this._split(t),this._split(n);let r=this.byStart[t];for(;r;)r.reset(),r=n>r.end?this.byStart[r.end]:null;return this}lastChar(){if(this.outro.length)return this.outro[this.outro.length-1];let t=this.lastChunk;do{if(t.outro.length)return t.outro[t.outro.length-1];if(t.content.length)return t.content[t.content.length-1];if(t.intro.length)return t.intro[t.intro.length-1]}while(t=t.previous);return this.intro.length?this.intro[this.intro.length-1]:""}lastLine(){let t=this.outro.lastIndexOf(vn);if(t!==-1)return this.outro.substr(t+1);let n=this.outro,r=this.lastChunk;do{if(r.outro.length>0){if(t=r.outro.lastIndexOf(vn),t!==-1)return r.outro.substr(t+1)+n;n=r.outro+n}if(r.content.length>0){if(t=r.content.lastIndexOf(vn),t!==-1)return r.content.substr(t+1)+n;n=r.content+n}if(r.intro.length>0){if(t=r.intro.lastIndexOf(vn),t!==-1)return r.intro.substr(t+1)+n;n=r.intro+n}}while(r=r.previous);return t=this.intro.lastIndexOf(vn),t!==-1?this.intro.substr(t+1)+n:this.intro+n}slice(t=0,n=this.original.length-this.offset){if(t=t+this.offset,n=n+this.offset,this.original.length!==0){for(;t<0;)t+=this.original.length;for(;n<0;)n+=this.original.length}let r="",o=this.firstChunk;for(;o&&(o.start>t||o.end<=t);){if(o.start<n&&o.end>=n)return r;o=o.next}if(o&&o.edited&&o.start!==t)throw new Error(`Cannot use replaced character ${t} as slice start anchor.`);let i=o;for(;o;){o.intro&&(i!==o||o.start===t)&&(r+=o.intro);let s=o.start<n&&o.end>=n;if(s&&o.edited&&o.end!==n)throw new Error(`Cannot use replaced character ${n} as slice end anchor.`);let a=i===o?t-o.start:0,c=s?o.content.length+n-o.end:o.content.length;if(r+=o.content.slice(a,c),o.outro&&(!s||o.end===n)&&(r+=o.outro),s)break;o=o.next}return r}snip(t,n){let r=this.clone();return r.remove(0,t),r.remove(n,r.original.length),r}_split(t){if(this.byStart[t]||this.byEnd[t])return;let n=this.lastSearchedChunk,r=t>n.end;for(;n;){if(n.contains(t))return this._splitChunk(n,t);n=r?this.byStart[n.end]:this.byEnd[n.start]}}_splitChunk(t,n){if(t.edited&&t.content.length){let o=ps(this.original)(n);throw new Error(`Cannot split a chunk that has already been edited (${o.line}:${o.column} \u2013 "${t.original}")`)}let r=t.split(n);return this.byEnd[n]=t,this.byStart[n]=r,this.byEnd[r.end]=r,t===this.lastChunk&&(this.lastChunk=r),this.lastSearchedChunk=t,!0}toString(){let t=this.intro,n=this.firstChunk;for(;n;)t+=n.toString(),n=n.next;return t+this.outro}isEmpty(){let t=this.firstChunk;do if(t.intro.length&&t.intro.trim()||t.content.length&&t.content.trim()||t.outro.length&&t.outro.trim())return!1;while(t=t.next);return!0}length(){let t=this.firstChunk,n=0;do n+=t.intro.length+t.content.length+t.outro.length;while(t=t.next);return n}trimLines(){return this.trim("[\\r\\n]")}trim(t){return this.trimStart(t).trimEnd(t)}trimEndAborted(t){let n=new RegExp((t||"\\s")+"+$");if(this.outro=this.outro.replace(n,""),this.outro.length)return!0;let r=this.lastChunk;do{let o=r.end,i=r.trimEnd(n);if(r.end!==o&&(this.lastChunk===r&&(this.lastChunk=r.next),this.byEnd[r.end]=r,this.byStart[r.next.start]=r.next,this.byEnd[r.next.end]=r.next),i)return!0;r=r.previous}while(r);return!1}trimEnd(t){return this.trimEndAborted(t),this}trimStartAborted(t){let n=new RegExp("^"+(t||"\\s")+"+");if(this.intro=this.intro.replace(n,""),this.intro.length)return!0;let r=this.firstChunk;do{let o=r.end,i=r.trimStart(n);if(r.end!==o&&(r===this.lastChunk&&(this.lastChunk=r.next),this.byEnd[r.end]=r,this.byStart[r.next.start]=r.next,this.byEnd[r.next.end]=r.next),i)return!0;r=r.next}while(r);return!1}trimStart(t){return this.trimStartAborted(t),this}hasChanged(){return this.original!==this.toString()}_replaceRegexp(t,n){function r(i,s){return typeof n=="string"?n.replace(/\$(\$|&|\d+)/g,(a,c)=>c==="$"?"$":c==="&"?i[0]:+c<i.length?i[+c]:`$${c}`):n(...i,i.index,s,i.groups)}function o(i,s){let a,c=[];for(;a=i.exec(s);)c.push(a);return c}if(t.global)o(t,this.original).forEach(s=>{if(s.index!=null){let a=r(s,this.original);a!==s[0]&&this.overwrite(s.index,s.index+s[0].length,a)}});else{let i=this.original.match(t);if(i&&i.index!=null){let s=r(i,this.original);s!==i[0]&&this.overwrite(i.index,i.index+i[0].length,s)}}return this}_replaceString(t,n){let{original:r}=this,o=r.indexOf(t);return o!==-1&&this.overwrite(o,o+t.length,n),this}replace(t,n){return typeof t=="string"?this._replaceString(t,n):this._replaceRegexp(t,n)}_replaceAllString(t,n){let{original:r}=this,o=t.length;for(let i=r.indexOf(t);i!==-1;i=r.indexOf(t,i+o))r.slice(i,i+o)!==n&&this.overwrite(i,i+o,n);return this}replaceAll(t,n){if(typeof t=="string")return this._replaceAllString(t,n);if(!t.global)throw new TypeError("MagicString.prototype.replaceAll called with a non-global RegExp argument");return this._replaceRegexp(t,n)}},xu=Object.prototype.hasOwnProperty,ds=class e{constructor(t={}){this.intro=t.intro||"",this.separator=t.separator!==void 0?t.separator:`
11
- `,this.sources=[],this.uniqueSources=[],this.uniqueSourceIndexByFilename={}}addSource(t){if(t instanceof En)return this.addSource({content:t,filename:t.filename,separator:this.separator});if(!Cu(t)||!t.content)throw new Error("bundle.addSource() takes an object with a `content` property, which should be an instance of MagicString, and an optional `filename`");if(["filename","ignoreList","indentExclusionRanges","separator"].forEach(n=>{xu.call(t,n)||(t[n]=t.content[n])}),t.separator===void 0&&(t.separator=this.separator),t.filename)if(!xu.call(this.uniqueSourceIndexByFilename,t.filename))this.uniqueSourceIndexByFilename[t.filename]=this.uniqueSources.length,this.uniqueSources.push({filename:t.filename,content:t.content.original});else{let n=this.uniqueSources[this.uniqueSourceIndexByFilename[t.filename]];if(t.content.original!==n.content)throw new Error(`Illegal source: same filename (${t.filename}), different contents`)}return this.sources.push(t),this}append(t,n){return this.addSource({content:new En(t),separator:n&&n.separator||""}),this}clone(){let t=new e({intro:this.intro,separator:this.separator});return this.sources.forEach(n=>{t.addSource({filename:n.filename,content:n.content.clone(),separator:n.separator})}),t}generateDecodedMap(t={}){let n=[],r;this.sources.forEach(i=>{Object.keys(i.content.storedNames).forEach(s=>{~n.indexOf(s)||n.push(s)})});let o=new Ur(t.hires);return this.intro&&o.advance(this.intro),this.sources.forEach((i,s)=>{s>0&&o.advance(this.separator);let a=i.filename?this.uniqueSourceIndexByFilename[i.filename]:-1,c=i.content,l=ps(c.original);c.intro&&o.advance(c.intro),c.firstChunk.eachNext(u=>{let f=l(u.start);u.intro.length&&o.advance(u.intro),i.filename?u.edited?o.addEdit(a,u.content,f,u.storeName?n.indexOf(u.original):-1):o.addUneditedChunk(a,u,c.original,f,c.sourcemapLocations):o.advance(u.content),u.outro.length&&o.advance(u.outro)}),c.outro&&o.advance(c.outro),i.ignoreList&&a!==-1&&(r===void 0&&(r=[]),r.push(a))}),{file:t.file?t.file.split(/[/\\]/).pop():void 0,sources:this.uniqueSources.map(i=>t.file?_u(t.file,i.filename):i.filename),sourcesContent:this.uniqueSources.map(i=>t.includeContent?i.content:null),names:n,mappings:o.raw,x_google_ignoreList:r}}generateMap(t){return new Sn(this.generateDecodedMap(t))}getIndentString(){let t={};return this.sources.forEach(n=>{let r=n.content._getRawIndentString();r!==null&&(t[r]||(t[r]=0),t[r]+=1)}),Object.keys(t).sort((n,r)=>t[n]-t[r])[0]||" "}indent(t){if(arguments.length||(t=this.getIndentString()),t==="")return this;let n=!this.intro||this.intro.slice(-1)===`
12
- `;return this.sources.forEach((r,o)=>{let i=r.separator!==void 0?r.separator:this.separator,s=n||o>0&&/\r?\n$/.test(i);r.content.indent(t,{exclude:r.indentExclusionRanges,indentStart:s}),n=r.content.lastChar()===`
13
- `}),this.intro&&(this.intro=t+this.intro.replace(/^[^\n]/gm,(r,o)=>o>0?t+r:r)),this}prepend(t){return this.intro=t+this.intro,this}toString(){let t=this.sources.map((n,r)=>{let o=n.separator!==void 0?n.separator:this.separator;return(r>0?o:"")+n.content.toString()}).join("");return this.intro+t}isEmpty(){return!(this.intro.length&&this.intro.trim()||this.sources.some(t=>!t.content.isEmpty()))}length(){return this.sources.reduce((t,n)=>t+n.content.length(),this.intro.length)}trimLines(){return this.trim("[\\r\\n]")}trim(t){return this.trimStart(t).trimEnd(t)}trimStart(t){let n=new RegExp("^"+(t||"\\s")+"+");if(this.intro=this.intro.replace(n,""),!this.intro){let r,o=0;do if(r=this.sources[o++],!r)break;while(!r.content.trimStartAborted(t))}return this}trimEnd(t){let n=new RegExp((t||"\\s")+"+$"),r,o=this.sources.length-1;do if(r=this.sources[o--],!r){this.intro=this.intro.replace(n,"");break}while(!r.content.trimEndAborted(t));return this}}});var Nf=Qt(Pf=>{"use strict";Object.defineProperty(Pf,"__esModule",{value:!0})});var jf=Qt(Mf=>{"use strict";Object.defineProperty(Mf,"__esModule",{value:!0});var zS=Symbol("inverted"),WS=Symbol("expectNull"),US=Symbol("expectUndefined"),VS=Symbol("expectNumber"),JS=Symbol("expectString"),KS=Symbol("expectBoolean"),XS=Symbol("expectVoid"),HS=Symbol("expectFunction"),GS=Symbol("expectObject"),YS=Symbol("expectArray"),ZS=Symbol("expectSymbol"),QS=Symbol("expectAny"),e0=Symbol("expectUnknown"),t0=Symbol("expectNever"),n0=Symbol("expectNullable"),r0=Symbol("expectBigInt")});var Ff=Qt(Rf=>{"use strict";Object.defineProperty(Rf,"__esModule",{value:!0})});var Df=Qt(Lf=>{"use strict";Object.defineProperty(Lf,"__esModule",{value:!0});var s0=Symbol("secret"),a0=Symbol("mismatch"),c0=Symbol("avalue")});var qf=Qt(he=>{"use strict";var Pb=he&&he.__createBinding||(Object.create?function(e,t,n,r){r===void 0&&(r=n);var o=Object.getOwnPropertyDescriptor(t,n);(!o||("get"in o?!t.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,o)}:function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]}),Qr=he&&he.__exportStar||function(e,t){for(var n in e)n!=="default"&&!Object.prototype.hasOwnProperty.call(t,n)&&Pb(t,e,n)};Object.defineProperty(he,"__esModule",{value:!0});he.expectTypeOf=void 0;Qr(Nf(),he);Qr(jf(),he);Qr(Ff(),he);Qr(Df(),he);var me=()=>!0,Nb=e=>{let t=["parameters","returns","resolves","not","items","constructorParameters","thisParameter","instance","guards","asserts","branded"],n={toBeAny:me,toBeUnknown:me,toBeNever:me,toBeFunction:me,toBeObject:me,toBeArray:me,toBeString:me,toBeNumber:me,toBeBoolean:me,toBeVoid:me,toBeSymbol:me,toBeNull:me,toBeUndefined:me,toBeNullable:me,toBeBigInt:me,toMatchTypeOf:me,toEqualTypeOf:me,toBeConstructibleWith:me,toBeCallableWith:he.expectTypeOf,extract:he.expectTypeOf,exclude:he.expectTypeOf,pick:he.expectTypeOf,omit:he.expectTypeOf,toHaveProperty:he.expectTypeOf,parameter:he.expectTypeOf};return t.forEach(o=>Object.defineProperty(n,o,{get:()=>(0,he.expectTypeOf)({})})),n};he.expectTypeOf=Nb});var Rb={};ta(Rb,{Aggregate:()=>ao,Command:()=>Yf,Event:()=>Zf,EventSource:()=>kt,Projector:()=>en,abort:()=>De,createEventMapper:()=>sa,createTestEventStore:()=>jb,objectToYaml:()=>$n});module.exports=Hf(Rb);function io(e,t){let n=Object.assign(new Error(e),t);return n.stack,Error.captureStackTrace&&Error.captureStackTrace(n,io),n}function De(e,t){let n=io(e,t);throw Error.captureStackTrace&&Error.captureStackTrace(n,De),n}function so(e){Object.freeze(e);for(let t of Object.getOwnPropertyNames(e))e.hasOwnProperty(t)&&e[t]!==null&&(typeof e[t]=="object"||typeof e[t]=="function")&&!Object.isFrozen(e[t])&&so(e[t]);return e}var Gf={NODE_ENV:process.env.NODE_ENV},ao=class{#e=0;#t=[];replayEvents(t=[]){for(let n of t)this.applyAnEvent(n);return this}applyAnEvent(t){Gf.NODE_ENV==="test"&&so(t);let n=this.apply[t.eventName];n==null&&(t.eventName.match(/^[$A-Z_][0-9A-Z_$]*$/i)?De(`Aggregate "${this.constructor.name}" has no method:
1
+ "use strict";var _=Object.create;var h=Object.defineProperty;var D=Object.getOwnPropertyDescriptor;var J=Object.getOwnPropertyNames;var Q=Object.getPrototypeOf,R=Object.prototype.hasOwnProperty;var F=(r,e)=>{for(var t in e)h(r,t,{get:e[t],enumerable:!0})},z=(r,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of J(e))!R.call(r,o)&&o!==t&&h(r,o,{get:()=>e[o],enumerable:!(n=D(e,o))||n.enumerable});return r};var V=(r,e,t)=>(t=r!=null?_(Q(r)):{},z(e||!r||!r.__esModule?h(t,"default",{value:r,enumerable:!0}):t,r)),Y=r=>z(h({},"__esModule",{value:!0}),r);var G={};F(G,{Aggregate:()=>S,Command:()=>W,Event:()=>Z,EventSource:()=>y,Projector:()=>m,abort:()=>c,createEventMapper:()=>k,createTestEventStore:()=>B,objectToYaml:()=>f});module.exports=Y(G);function j(r,e){let t=Object.assign(new Error(r),e);return t.stack,Error.captureStackTrace&&Error.captureStackTrace(t,j),t}function c(r,e){let t=j(r,e);throw Error.captureStackTrace&&Error.captureStackTrace(t,c),t}function A(r){Object.freeze(r);for(let e of Object.getOwnPropertyNames(r))r.hasOwnProperty(e)&&r[e]!==null&&(typeof r[e]=="object"||typeof r[e]=="function")&&!Object.isFrozen(r[e])&&A(r[e]);return r}var U={NODE_ENV:process.env.NODE_ENV},S=class{#e=0;#t=[];replayEvents(e=[]){for(let t of e)this.applyAnEvent(t);return this}applyAnEvent(e){U.NODE_ENV==="test"&&A(e);let t=this.apply[e.eventName];t==null&&(e.eventName.match(/^[$A-Z_][0-9A-Z_$]*$/i)?c(`Aggregate "${this.constructor.name}" has no method:
14
2
 
15
3
  apply = {
16
- ${t.eventName}(event) {
4
+ ${e.eventName}(event) {
17
5
  // Code goes here...
18
6
  }
19
7
  // ...
20
- }`):De(`Aggregate "${this.constructor.name}" has no method:
8
+ }`):c(`Aggregate "${this.constructor.name}" has no method:
21
9
 
22
10
  apply = {
23
- ['${t.eventName}'](event) {
11
+ ['${e.eventName}'](event) {
24
12
  // Code goes here...
25
13
  }
26
14
  // ...
27
- }`));try{n(t)}catch(r){r instanceof Error&&console.error(`An error occurred inside your "%s" function:
28
- `,t.eventName,r.stack?.split(`
15
+ }`));try{t(e)}catch(n){n instanceof Error&&console.error(`An error occurred inside your "%s" function:
16
+ `,e.eventName,n.stack?.split(`
29
17
  `).map(o=>` ${o}`).join(`
30
- `))}finally{this.#e++}return this}recordThat(t){let n={...t,version:this.#e};return this.applyAnEvent(n),this.#t.push(n),this}releaseEvents(){return this.#t.splice(0)}};function Yf(e,t=null){return{type:e,payload:t}}var oa=require("crypto");function Zf(e,t,n=null,r=null){return{aggregateId:t,eventId:(0,oa.randomUUID)(),eventName:e,payload:n,metadata:r,recordedAt:new Date,version:-1}}var ia=ra(require("yamlify-object"),1),Qf={indent:" ",colors:{date:lt,error:lt,symbol:lt,string:lt,number:lt,boolean:lt,null:lt,undefined:lt}};function lt(e){return e}function $n(e){return e instanceof Error?$n({...e}):(0,ia.default)(e,Qf).split(`
18
+ `))}finally{this.#e++}return this}recordThat(e){let t={...e,version:this.#e};return this.applyAnEvent(t),this.#t.push(t),this}releaseEvents(){return this.#t.splice(0)}};function W(r,e=null){return{type:r,payload:e}}var L=require("crypto");function Z(r,e,t=null,n=null){return{aggregateId:e,eventId:(0,L.randomUUID)(),eventName:r,payload:t,metadata:n,recordedAt:new Date,version:-1}}var O=V(require("yamlify-object"),1),q={indent:" ",colors:{date:v,error:v,symbol:v,string:v,number:v,boolean:v,null:v,undefined:v}};function v(r){return r}function f(r){return r instanceof Error?f({...r}):(0,O.default)(r,q).split(`
31
19
  `).slice(1).join(`
32
- `)}var kn=new WeakMap;function Pn(e,t){if(kn.has(e)){let n=kn.get(e);for(let r in t)n[r]=t[r]}else kn.set(e,t)}function Nn(e){return kn.get(e)}var Mn=class{constructor(){Pn(this,{jobs:[],state:0})}get length(){return Nn(this).jobs.length}async start(){let{state:t,jobs:n}=Nn(this);if(!(t===1||n.length<=0)){for(Pn(this,{state:1});n.length>0;){let r=n.shift();await Promise.resolve().then(r.handle).then(r.resolve,r.reject)}Pn(this,{state:0})}}push(t){return new Promise((n,r)=>{let{jobs:o}=Nn(this);o.push({handle:t,resolve:n,reject:r}),setImmediate(()=>this.start())})}};var en=class{apply;initializer(){}#e=new Mn;async init(t){this.initializer&&await this.#e.push(()=>this.initializer?.());let n=await t.loadEvents();await Promise.all(n.map(r=>this.applyEvent(r)))}async applyEvent(t){await this.#e.push(()=>this.apply?.[t.eventName]?.(t)),await this.#e.push(()=>this.project(t))}project(t){}},kt=class e{constructor(t,n,r,o){this.store=t;this.commandHandlers=n;this.projectors=r;this.eventHandlers=o}static builder(t){return new co(t)}static new(t,n,r,o){return new e(t,n,r,o)}async resetProjections(){await Promise.all(this.projectors.map(t=>t.init(this)))}async dispatch(t){return this.commandHandlers.has(t.type)||De(`There is no command handler for the "${t.type}" command`),await this.commandHandlers.get(t.type)(t,this),t}async loadEvents(){return this.store.loadEvents()}async load(t,n){let r=await this.store.load(n);return r.length<=0&&De(`Aggregate(${t.constructor.name}) with ID(${n}) does not exist.`,{aggregate:t.constructor.name,aggregateId:n}),t.replayEvents(r)}async persist(t){let n=t.releaseEvents();await this.store.persist(n);for(let r of n)await Promise.all(this.projectors.map(async o=>{try{await o.applyEvent(r)}catch(i){throw i instanceof Error&&console.error(`An error occurred in one of your projections: ${o.name}, given an event`,i.stack?.split(`
33
- `).map(s=>` ${s}`).join(`
34
- `)),i}})),await Promise.all(this.eventHandlers.map(async o=>{try{await o(r,this)}catch(i){throw i instanceof Error&&console.error(`An error occurred in one of your event handlers: ${o.name}, given an event`,i.stack?.split(`
35
- `).map(s=>` ${s}`).join(`
36
- `)),i}}))}async loadPersist(t,n,r){return await this.load(t,n),await r(t),this.persist(t)}},co=class{constructor(t){this.store=t}commandHandlers=new Map;projectors=[];eventHandlers=[];build(){return kt.new(this.store,this.commandHandlers,this.projectors,this.eventHandlers)}addCommandHandler(t,n){return this.commandHandlers.has(t)&&De(`A command handler for the "${t}" command already exists`),this.commandHandlers.set(t,n),this}addProjector(t){return this.projectors.push(t),this}addEventHandler(t){return this.eventHandlers.push(t),this}};function sa(e){return(t,n)=>e[t.eventName]?.(t,n)}var eh={reset:[0,0],bold:[1,22,"\x1B[22m\x1B[1m"],dim:[2,22,"\x1B[22m\x1B[2m"],italic:[3,23],underline:[4,24],inverse:[7,27],hidden:[8,28],strikethrough:[9,29],black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],gray:[90,39],bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],blackBright:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39],bgBlackBright:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]},th=Object.entries(eh);function lo(e){return String(e)}lo.open="";lo.close="";function aa(e=!1){let t=typeof process<"u"?process:void 0,n=t?.env||{},r=t?.argv||[];return!("NO_COLOR"in n||r.includes("--no-color"))&&("FORCE_COLOR"in n||r.includes("--color")||t?.platform==="win32"||e&&n.TERM!=="dumb"||"CI"in n)||typeof window<"u"&&!!window.chrome}function ca(e=!1){let t=aa(e),n=(s,a,c,l)=>{let u="",f=0;do u+=s.substring(f,l)+c,f=l+a.length,l=s.indexOf(a,f);while(~l);return u+s.substring(f)},r=(s,a,c=s)=>{let l=u=>{let f=String(u),m=f.indexOf(a,s.length);return~m?s+n(f,a,c,m)+a:s+f+a};return l.open=s,l.close=a,l},o={isColorSupported:t},i=s=>`\x1B[${s}m`;for(let[s,a]of th)o[s]=t?r(i(a[0]),i(a[1]),a[2]):lo;return o}var la=require("tty"),re=ca((0,la.isatty)(1));function nh(e,t){let n=Object.keys(e),r=t===null?n:n.sort(t);if(Object.getOwnPropertySymbols)for(let o of Object.getOwnPropertySymbols(e))Object.getOwnPropertyDescriptor(e,o).enumerable&&r.push(o);return r}function Dn(e,t,n,r,o,i,s=": "){let a="",c=0,l=e.next();if(!l.done){a+=t.spacingOuter;let u=n+t.indent;for(;!l.done;){if(a+=u,c++===t.maxWidth){a+="\u2026";break}let f=i(l.value[0],t,u,r,o),m=i(l.value[1],t,u,r,o);a+=f+s+m,l=e.next(),l.done?t.min||(a+=","):a+=`,${t.spacingInner}`}a+=t.spacingOuter+n}return a}function po(e,t,n,r,o,i){let s="",a=0,c=e.next();if(!c.done){s+=t.spacingOuter;let l=n+t.indent;for(;!c.done;){if(s+=l,a++===t.maxWidth){s+="\u2026";break}s+=i(c.value,t,l,r,o),c=e.next(),c.done?t.min||(s+=","):s+=`,${t.spacingInner}`}s+=t.spacingOuter+n}return s}function Fn(e,t,n,r,o,i){let s="";e=e instanceof ArrayBuffer?new DataView(e):e;let a=l=>l instanceof DataView,c=a(e)?e.byteLength:e.length;if(c>0){s+=t.spacingOuter;let l=n+t.indent;for(let u=0;u<c;u++){if(s+=l,u===t.maxWidth){s+="\u2026";break}(a(e)||u in e)&&(s+=i(a(e)?e.getInt8(u):e[u],t,l,r,o)),u<c-1?s+=`,${t.spacingInner}`:t.min||(s+=",")}s+=t.spacingOuter+n}return s}function mo(e,t,n,r,o,i){let s="",a=nh(e,t.compareKeys);if(a.length>0){s+=t.spacingOuter;let c=n+t.indent;for(let l=0;l<a.length;l++){let u=a[l],f=i(u,t,c,r,o),m=i(e[u],t,c,r,o);s+=`${c+f}: ${m}`,l<a.length-1?s+=`,${t.spacingInner}`:t.min||(s+=",")}s+=t.spacingOuter+n}return s}var rh=typeof Symbol=="function"&&Symbol.for?Symbol.for("jest.asymmetricMatcher"):1267621,jn=" ",oh=(e,t,n,r,o,i)=>{let s=e.toString();if(s==="ArrayContaining"||s==="ArrayNotContaining")return++r>t.maxDepth?`[${s}]`:`${s+jn}[${Fn(e.sample,t,n,r,o,i)}]`;if(s==="ObjectContaining"||s==="ObjectNotContaining")return++r>t.maxDepth?`[${s}]`:`${s+jn}{${mo(e.sample,t,n,r,o,i)}}`;if(s==="StringMatching"||s==="StringNotMatching"||s==="StringContaining"||s==="StringNotContaining")return s+jn+i(e.sample,t,n,r,o);if(typeof e.toAsymmetricMatcher!="function")throw new TypeError(`Asymmetric matcher ${e.constructor.name} does not implement toAsymmetricMatcher()`);return e.toAsymmetricMatcher()},ih=e=>e&&e.$$typeof===rh,sh={serialize:oh,test:ih},ah=" ",Sa=new Set(["DOMStringMap","NamedNodeMap"]),ch=/^(?:HTML\w*Collection|NodeList)$/;function lh(e){return Sa.has(e)||ch.test(e)}var uh=e=>e&&e.constructor&&!!e.constructor.name&&lh(e.constructor.name);function fh(e){return e.constructor.name==="NamedNodeMap"}var hh=(e,t,n,r,o,i)=>{let s=e.constructor.name;return++r>t.maxDepth?`[${s}]`:(t.min?"":s+ah)+(Sa.has(s)?`{${mo(fh(e)?[...e].reduce((a,c)=>(a[c.name]=c.value,a),{}):{...e},t,n,r,o,i)}}`:`[${Fn([...e],t,n,r,o,i)}]`)},ph={serialize:hh,test:uh};function Ea(e){return e.replaceAll("<","&lt;").replaceAll(">","&gt;")}function go(e,t,n,r,o,i,s){let a=r+n.indent,c=n.colors;return e.map(l=>{let u=t[l],f=s(u,n,a,o,i);return typeof u!="string"&&(f.includes(`
37
- `)&&(f=n.spacingOuter+a+f+n.spacingOuter+r),f=`{${f}}`),`${n.spacingInner+r+c.prop.open+l+c.prop.close}=${c.value.open}${f}${c.value.close}`}).join("")}function yo(e,t,n,r,o,i){return e.map(s=>t.spacingOuter+n+(typeof s=="string"?Ta(s,t):i(s,t,n,r,o))).join("")}function Ta(e,t){let n=t.colors.content;return n.open+Ea(e)+n.close}function dh(e,t){let n=t.colors.comment;return`${n.open}<!--${Ea(e)}-->${n.close}`}function bo(e,t,n,r,o){let i=r.colors.tag;return`${i.open}<${e}${t&&i.close+t+r.spacingOuter+o+i.open}${n?`>${i.close}${n}${r.spacingOuter}${o}${i.open}</${e}`:`${t&&!r.min?"":" "}/`}>${i.close}`}function wo(e,t){let n=t.colors.tag;return`${n.open}<${e}${n.close} \u2026${n.open} />${n.close}`}var mh=1,xa=3,_a=8,Ca=11,gh=/^(?:(?:HTML|SVG)\w*)?Element$/;function yh(e){try{return typeof e.hasAttribute=="function"&&e.hasAttribute("is")}catch{return!1}}function bh(e){let t=e.constructor.name,{nodeType:n,tagName:r}=e,o=typeof r=="string"&&r.includes("-")||yh(e);return n===mh&&(gh.test(t)||o)||n===xa&&t==="Text"||n===_a&&t==="Comment"||n===Ca&&t==="DocumentFragment"}var wh=e=>{var t;return((t=e?.constructor)==null?void 0:t.name)&&bh(e)};function vh(e){return e.nodeType===xa}function Sh(e){return e.nodeType===_a}function uo(e){return e.nodeType===Ca}var Eh=(e,t,n,r,o,i)=>{if(vh(e))return Ta(e.data,t);if(Sh(e))return dh(e.data,t);let s=uo(e)?"DocumentFragment":e.tagName.toLowerCase();return++r>t.maxDepth?wo(s,t):bo(s,go(uo(e)?[]:Array.from(e.attributes,a=>a.name).sort(),uo(e)?{}:[...e.attributes].reduce((a,c)=>(a[c.name]=c.value,a),{}),t,n+t.indent,r,o,i),yo(Array.prototype.slice.call(e.childNodes||e.children),t,n+t.indent,r,o,i),t,n)},Th={serialize:Eh,test:wh},xh="@@__IMMUTABLE_ITERABLE__@@",_h="@@__IMMUTABLE_LIST__@@",Ch="@@__IMMUTABLE_KEYED__@@",Oh="@@__IMMUTABLE_MAP__@@",ua="@@__IMMUTABLE_ORDERED__@@",Ih="@@__IMMUTABLE_RECORD__@@",Ah="@@__IMMUTABLE_SEQ__@@",$h="@@__IMMUTABLE_SET__@@",kh="@@__IMMUTABLE_STACK__@@",Pt=e=>`Immutable.${e}`,qn=e=>`[${e}]`,tn=" ",fa="\u2026";function Ph(e,t,n,r,o,i,s){return++r>t.maxDepth?qn(Pt(s)):`${Pt(s)+tn}{${Dn(e.entries(),t,n,r,o,i)}}`}function Nh(e){let t=0;return{next(){if(t<e._keys.length){let n=e._keys[t++];return{done:!1,value:[n,e.get(n)]}}return{done:!0,value:void 0}}}}function Mh(e,t,n,r,o,i){let s=Pt(e._name||"Record");return++r>t.maxDepth?qn(s):`${s+tn}{${Dn(Nh(e),t,n,r,o,i)}}`}function jh(e,t,n,r,o,i){let s=Pt("Seq");return++r>t.maxDepth?qn(s):e[Ch]?`${s+tn}{${e._iter||e._object?Dn(e.entries(),t,n,r,o,i):fa}}`:`${s+tn}[${e._iter||e._array||e._collection||e._iterable?po(e.values(),t,n,r,o,i):fa}]`}function fo(e,t,n,r,o,i,s){return++r>t.maxDepth?qn(Pt(s)):`${Pt(s)+tn}[${po(e.values(),t,n,r,o,i)}]`}var Rh=(e,t,n,r,o,i)=>e[Oh]?Ph(e,t,n,r,o,i,e[ua]?"OrderedMap":"Map"):e[_h]?fo(e,t,n,r,o,i,"List"):e[$h]?fo(e,t,n,r,o,i,e[ua]?"OrderedSet":"Set"):e[kh]?fo(e,t,n,r,o,i,"Stack"):e[Ah]?jh(e,t,n,r,o,i):Mh(e,t,n,r,o,i),Fh=e=>e&&(e[xh]===!0||e[Ih]===!0),Lh={serialize:Rh,test:Fh},Rn={exports:{}},Q={};var ha;function Dh(){if(ha)return Q;ha=1;var e=Symbol.for("react.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),i=Symbol.for("react.provider"),s=Symbol.for("react.context"),a=Symbol.for("react.server_context"),c=Symbol.for("react.forward_ref"),l=Symbol.for("react.suspense"),u=Symbol.for("react.suspense_list"),f=Symbol.for("react.memo"),m=Symbol.for("react.lazy"),h=Symbol.for("react.offscreen"),g;g=Symbol.for("react.module.reference");function y(w){if(typeof w=="object"&&w!==null){var E=w.$$typeof;switch(E){case e:switch(w=w.type,w){case n:case o:case r:case l:case u:return w;default:switch(w=w&&w.$$typeof,w){case a:case s:case c:case m:case f:case i:return w;default:return E}}case t:return E}}}return Q.ContextConsumer=s,Q.ContextProvider=i,Q.Element=e,Q.ForwardRef=c,Q.Fragment=n,Q.Lazy=m,Q.Memo=f,Q.Portal=t,Q.Profiler=o,Q.StrictMode=r,Q.Suspense=l,Q.SuspenseList=u,Q.isAsyncMode=function(){return!1},Q.isConcurrentMode=function(){return!1},Q.isContextConsumer=function(w){return y(w)===s},Q.isContextProvider=function(w){return y(w)===i},Q.isElement=function(w){return typeof w=="object"&&w!==null&&w.$$typeof===e},Q.isForwardRef=function(w){return y(w)===c},Q.isFragment=function(w){return y(w)===n},Q.isLazy=function(w){return y(w)===m},Q.isMemo=function(w){return y(w)===f},Q.isPortal=function(w){return y(w)===t},Q.isProfiler=function(w){return y(w)===o},Q.isStrictMode=function(w){return y(w)===r},Q.isSuspense=function(w){return y(w)===l},Q.isSuspenseList=function(w){return y(w)===u},Q.isValidElementType=function(w){return typeof w=="string"||typeof w=="function"||w===n||w===o||w===r||w===l||w===u||w===h||typeof w=="object"&&w!==null&&(w.$$typeof===m||w.$$typeof===f||w.$$typeof===i||w.$$typeof===s||w.$$typeof===c||w.$$typeof===g||w.getModuleId!==void 0)},Q.typeOf=y,Q}var ee={};var pa;function qh(){return pa||(pa=1,process.env.NODE_ENV!=="production"&&function(){var e=Symbol.for("react.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),i=Symbol.for("react.provider"),s=Symbol.for("react.context"),a=Symbol.for("react.server_context"),c=Symbol.for("react.forward_ref"),l=Symbol.for("react.suspense"),u=Symbol.for("react.suspense_list"),f=Symbol.for("react.memo"),m=Symbol.for("react.lazy"),h=Symbol.for("react.offscreen"),g=!1,y=!1,w=!1,E=!1,_=!1,O;O=Symbol.for("react.module.reference");function A(D){return!!(typeof D=="string"||typeof D=="function"||D===n||D===o||_||D===r||D===l||D===u||E||D===h||g||y||w||typeof D=="object"&&D!==null&&(D.$$typeof===m||D.$$typeof===f||D.$$typeof===i||D.$$typeof===s||D.$$typeof===c||D.$$typeof===O||D.getModuleId!==void 0))}function $(D){if(typeof D=="object"&&D!==null){var Yt=D.$$typeof;switch(Yt){case e:var Xe=D.type;switch(Xe){case n:case o:case r:case l:case u:return Xe;default:var On=Xe&&Xe.$$typeof;switch(On){case a:case s:case c:case m:case f:case i:return On;default:return Yt}}case t:return Yt}}}var R=s,N=i,I=e,k=c,V=n,C=m,W=f,ne=t,q=o,z=r,j=l,G=u,L=!1,ue=!1;function ge(D){return L||(L=!0,console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 18+.")),!1}function ke(D){return ue||(ue=!0,console.warn("The ReactIs.isConcurrentMode() alias has been deprecated, and will be removed in React 18+.")),!1}function _e(D){return $(D)===s}function Ce(D){return $(D)===i}function Le(D){return typeof D=="object"&&D!==null&&D.$$typeof===e}function ce(D){return $(D)===c}function se(D){return $(D)===n}function Ie(D){return $(D)===m}function Ke(D){return $(D)===f}function Pe(D){return $(D)===t}function st(D){return $(D)===o}function at(D){return $(D)===r}function yt(D){return $(D)===l}function eo(D){return $(D)===u}ee.ContextConsumer=R,ee.ContextProvider=N,ee.Element=I,ee.ForwardRef=k,ee.Fragment=V,ee.Lazy=C,ee.Memo=W,ee.Portal=ne,ee.Profiler=q,ee.StrictMode=z,ee.Suspense=j,ee.SuspenseList=G,ee.isAsyncMode=ge,ee.isConcurrentMode=ke,ee.isContextConsumer=_e,ee.isContextProvider=Ce,ee.isElement=Le,ee.isForwardRef=ce,ee.isFragment=se,ee.isLazy=Ie,ee.isMemo=Ke,ee.isPortal=Pe,ee.isProfiler=st,ee.isStrictMode=at,ee.isSuspense=yt,ee.isSuspenseList=eo,ee.isValidElementType=A,ee.typeOf=$}()),ee}var da;function Bh(){return da||(da=1,process.env.NODE_ENV==="production"?Rn.exports=Dh():Rn.exports=qh()),Rn.exports}var bt=Bh();function Oa(e,t=[]){if(Array.isArray(e))for(let n of e)Oa(n,t);else e!=null&&e!==!1&&e!==""&&t.push(e);return t}function ma(e){let t=e.type;if(typeof t=="string")return t;if(typeof t=="function")return t.displayName||t.name||"Unknown";if(bt.isFragment(e))return"React.Fragment";if(bt.isSuspense(e))return"React.Suspense";if(typeof t=="object"&&t!==null){if(bt.isContextProvider(e))return"Context.Provider";if(bt.isContextConsumer(e))return"Context.Consumer";if(bt.isForwardRef(e)){if(t.displayName)return t.displayName;let n=t.render.displayName||t.render.name||"";return n===""?"ForwardRef":`ForwardRef(${n})`}if(bt.isMemo(e)){let n=t.displayName||t.type.displayName||t.type.name||"";return n===""?"Memo":`Memo(${n})`}}return"UNDEFINED"}function zh(e){let{props:t}=e;return Object.keys(t).filter(n=>n!=="children"&&t[n]!==void 0).sort()}var Wh=(e,t,n,r,o,i)=>++r>t.maxDepth?wo(ma(e),t):bo(ma(e),go(zh(e),e.props,t,n+t.indent,r,o,i),yo(Oa(e.props.children),t,n+t.indent,r,o,i),t,n),Uh=e=>e!=null&&bt.isElement(e),Vh={serialize:Wh,test:Uh},Jh=typeof Symbol=="function"&&Symbol.for?Symbol.for("react.test.json"):245830487;function Kh(e){let{props:t}=e;return t?Object.keys(t).filter(n=>t[n]!==void 0).sort():[]}var Xh=(e,t,n,r,o,i)=>++r>t.maxDepth?wo(e.type,t):bo(e.type,e.props?go(Kh(e),e.props,t,n+t.indent,r,o,i):"",e.children?yo(e.children,t,n+t.indent,r,o,i):"",t,n),Hh=e=>e&&e.$$typeof===Jh,Gh={serialize:Xh,test:Hh},Ia=Object.prototype.toString,Yh=Date.prototype.toISOString,Zh=Error.prototype.toString,ga=RegExp.prototype.toString;function ho(e){return typeof e.constructor=="function"&&e.constructor.name||"Object"}function Qh(e){return typeof window<"u"&&e===window}var ep=/^Symbol\((.*)\)(.*)$/,tp=/\n/g,Ln=class extends Error{constructor(t,n){super(t),this.stack=n,this.name=this.constructor.name}};function np(e){return e==="[object Array]"||e==="[object ArrayBuffer]"||e==="[object DataView]"||e==="[object Float32Array]"||e==="[object Float64Array]"||e==="[object Int8Array]"||e==="[object Int16Array]"||e==="[object Int32Array]"||e==="[object Uint8Array]"||e==="[object Uint8ClampedArray]"||e==="[object Uint16Array]"||e==="[object Uint32Array]"}function rp(e){return Object.is(e,-0)?"-0":String(e)}function op(e){return`${e}n`}function ya(e,t){return t?`[Function ${e.name||"anonymous"}]`:"[Function]"}function ba(e){return String(e).replace(ep,"Symbol($1)")}function wa(e){return`[${Zh.call(e)}]`}function Aa(e,t,n,r){if(e===!0||e===!1)return`${e}`;if(e===void 0)return"undefined";if(e===null)return"null";let o=typeof e;if(o==="number")return rp(e);if(o==="bigint")return op(e);if(o==="string")return r?`"${e.replaceAll(/"|\\/g,"\\$&")}"`:`"${e}"`;if(o==="function")return ya(e,t);if(o==="symbol")return ba(e);let i=Ia.call(e);return i==="[object WeakMap]"?"WeakMap {}":i==="[object WeakSet]"?"WeakSet {}":i==="[object Function]"||i==="[object GeneratorFunction]"?ya(e,t):i==="[object Symbol]"?ba(e):i==="[object Date]"?Number.isNaN(+e)?"Date { NaN }":Yh.call(e):i==="[object Error]"?wa(e):i==="[object RegExp]"?n?ga.call(e).replaceAll(/[$()*+.?[\\\]^{|}]/g,"\\$&"):ga.call(e):e instanceof Error?wa(e):null}function $a(e,t,n,r,o,i){if(o.includes(e))return"[Circular]";o=[...o],o.push(e);let s=++r>t.maxDepth,a=t.min;if(t.callToJSON&&!s&&e.toJSON&&typeof e.toJSON=="function"&&!i)return ut(e.toJSON(),t,n,r,o,!0);let c=Ia.call(e);return c==="[object Arguments]"?s?"[Arguments]":`${a?"":"Arguments "}[${Fn(e,t,n,r,o,ut)}]`:np(c)?s?`[${e.constructor.name}]`:`${a||!t.printBasicPrototype&&e.constructor.name==="Array"?"":`${e.constructor.name} `}[${Fn(e,t,n,r,o,ut)}]`:c==="[object Map]"?s?"[Map]":`Map {${Dn(e.entries(),t,n,r,o,ut," => ")}}`:c==="[object Set]"?s?"[Set]":`Set {${po(e.values(),t,n,r,o,ut)}}`:s||Qh(e)?`[${ho(e)}]`:`${a||!t.printBasicPrototype&&ho(e)==="Object"?"":`${ho(e)} `}{${mo(e,t,n,r,o,ut)}}`}function ip(e){return e.serialize!=null}function ka(e,t,n,r,o,i){let s;try{s=ip(e)?e.serialize(t,n,r,o,i,ut):e.print(t,a=>ut(a,n,r,o,i),a=>{let c=r+n.indent;return c+a.replaceAll(tp,`
38
- ${c}`)},{edgeSpacing:n.spacingOuter,min:n.min,spacing:n.spacingInner},n.colors)}catch(a){throw new Ln(a.message,a.stack)}if(typeof s!="string")throw new TypeError(`pretty-format: Plugin must return type "string" but instead returned "${typeof s}".`);return s}function Pa(e,t){for(let n of e)try{if(n.test(t))return n}catch(r){throw new Ln(r.message,r.stack)}return null}function ut(e,t,n,r,o,i){let s=Pa(t.plugins,e);if(s!==null)return ka(s,e,t,n,r,o);let a=Aa(e,t.printFunctionName,t.escapeRegex,t.escapeString);return a!==null?a:$a(e,t,n,r,o,i)}var vo={comment:"gray",content:"reset",prop:"yellow",tag:"cyan",value:"green"},Na=Object.keys(vo),qe={callToJSON:!0,compareKeys:void 0,escapeRegex:!1,escapeString:!0,highlight:!1,indent:2,maxDepth:Number.POSITIVE_INFINITY,maxWidth:Number.POSITIVE_INFINITY,min:!1,plugins:[],printBasicPrototype:!0,printFunctionName:!0,theme:vo};function sp(e){for(let t of Object.keys(e))if(!Object.prototype.hasOwnProperty.call(qe,t))throw new Error(`pretty-format: Unknown option "${t}".`);if(e.min&&e.indent!==void 0&&e.indent!==0)throw new Error('pretty-format: Options "min" and "indent" cannot be used together.')}function ap(){return Na.reduce((e,t)=>{let n=vo[t],r=n&&re[n];if(r&&typeof r.close=="string"&&typeof r.open=="string")e[t]=r;else throw new Error(`pretty-format: Option "theme" has a key "${t}" whose value "${n}" is undefined in ansi-styles.`);return e},Object.create(null))}function cp(){return Na.reduce((e,t)=>(e[t]={close:"",open:""},e),Object.create(null))}function Ma(e){return e?.printFunctionName??qe.printFunctionName}function ja(e){return e?.escapeRegex??qe.escapeRegex}function Ra(e){return e?.escapeString??qe.escapeString}function va(e){return{callToJSON:e?.callToJSON??qe.callToJSON,colors:e?.highlight?ap():cp(),compareKeys:typeof e?.compareKeys=="function"||e?.compareKeys===null?e.compareKeys:qe.compareKeys,escapeRegex:ja(e),escapeString:Ra(e),indent:e?.min?"":lp(e?.indent??qe.indent),maxDepth:e?.maxDepth??qe.maxDepth,maxWidth:e?.maxWidth??qe.maxWidth,min:e?.min??qe.min,plugins:e?.plugins??qe.plugins,printBasicPrototype:e?.printBasicPrototype??!0,printFunctionName:Ma(e),spacingInner:e?.min?" ":`
39
- `,spacingOuter:e?.min?"":`
40
- `}}function lp(e){return Array.from({length:e+1}).join(" ")}function Ae(e,t){if(t&&(sp(t),t.plugins)){let r=Pa(t.plugins,e);if(r!==null)return ka(r,e,va(t),"",0,[])}let n=Aa(e,Ma(t),ja(t),Ra(t));return n!==null?n:$a(e,va(t),"",0,[])}var Nt={AsymmetricMatcher:sh,DOMCollection:ph,DOMElement:Th,Immutable:Lh,ReactElement:Vh,ReactTestComponent:Gh};var Fa={bold:["1","22"],dim:["2","22"],italic:["3","23"],underline:["4","24"],inverse:["7","27"],hidden:["8","28"],strike:["9","29"],black:["30","39"],red:["31","39"],green:["32","39"],yellow:["33","39"],blue:["34","39"],magenta:["35","39"],cyan:["36","39"],white:["37","39"],brightblack:["30;1","39"],brightred:["31;1","39"],brightgreen:["32;1","39"],brightyellow:["33;1","39"],brightblue:["34;1","39"],brightmagenta:["35;1","39"],brightcyan:["36;1","39"],brightwhite:["37;1","39"],grey:["90","39"]},up={special:"cyan",number:"yellow",bigint:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",symbol:"green",date:"magenta",regexp:"red"},et="\u2026";function fp(e,t){let n=Fa[up[t]]||Fa[t]||"";return n?`\x1B[${n[0]}m${String(e)}\x1B[${n[1]}m`:String(e)}function La({showHidden:e=!1,depth:t=2,colors:n=!1,customInspect:r=!0,showProxy:o=!1,maxArrayLength:i=1/0,breakLength:s=1/0,seen:a=[],truncate:c=1/0,stylize:l=String}={},u){let f={showHidden:!!e,depth:Number(t),colors:!!n,customInspect:!!r,showProxy:!!o,maxArrayLength:Number(i),breakLength:Number(s),truncate:Number(c),seen:a,inspect:u,stylize:l};return f.colors&&(f.stylize=fp),f}function hp(e){return e>="\uD800"&&e<="\uDBFF"}function Ee(e,t,n=et){e=String(e);let r=n.length,o=e.length;if(r>t&&o>r)return n;if(o>t&&o>r){let i=t-r;return i>0&&hp(e[i-1])&&(i=i-1),`${e.slice(0,i)}${n}`}return e}function pe(e,t,n,r=", "){n=n||t.inspect;let o=e.length;if(o===0)return"";let i=t.truncate,s="",a="",c="";for(let l=0;l<o;l+=1){let u=l+1===e.length,f=l+2===e.length;c=`${et}(${e.length-l})`;let m=e[l];t.truncate=i-s.length-(u?0:r.length);let h=a||n(m,t)+(u?"":r),g=s.length+h.length,y=g+c.length;if(u&&g>i&&s.length+c.length<=i||!u&&!f&&y>i||(a=u?"":n(e[l+1],t)+(f?"":r),!u&&f&&y>i&&g+a.length>i))break;if(s+=h,!u&&!f&&g+a.length>=i){c=`${et}(${e.length-l-1})`;break}c=""}return`${s}${c}`}function pp(e){return e.match(/^[a-zA-Z_][a-zA-Z_0-9]*$/)?e:JSON.stringify(e).replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'")}function tt([e,t],n){return n.truncate-=2,typeof e=="string"?e=pp(e):typeof e!="number"&&(e=`[${n.inspect(e,n)}]`),n.truncate-=e.length,t=n.inspect(t,n),`${e}: ${t}`}function So(e,t){let n=Object.keys(e).slice(e.length);if(!e.length&&!n.length)return"[]";t.truncate-=4;let r=pe(e,t);t.truncate-=r.length;let o="";return n.length&&(o=pe(n.map(i=>[i,e[i]]),t,tt)),`[ ${r}${o?`, ${o}`:""} ]`}var dp=e=>typeof Buffer=="function"&&e instanceof Buffer?"Buffer":e[Symbol.toStringTag]?e[Symbol.toStringTag]:e.constructor.name;function Be(e,t){let n=dp(e);t.truncate-=n.length+4;let r=Object.keys(e).slice(e.length);if(!e.length&&!r.length)return`${n}[]`;let o="";for(let s=0;s<e.length;s++){let a=`${t.stylize(Ee(e[s],t.truncate),"number")}${s===e.length-1?"":", "}`;if(t.truncate-=a.length,e[s]!==e.length&&t.truncate<=3){o+=`${et}(${e.length-e[s]+1})`;break}o+=a}let i="";return r.length&&(i=pe(r.map(s=>[s,e[s]]),t,tt)),`${n}[ ${o}${i?`, ${i}`:""} ]`}function Eo(e,t){let n=e.toJSON();if(n===null)return"Invalid Date";let r=n.split("T"),o=r[0];return t.stylize(`${o}T${Ee(r[1],t.truncate-o.length-1)}`,"date")}function Bn(e,t){let n=e[Symbol.toStringTag]||"Function",r=e.name;return r?t.stylize(`[${n} ${Ee(r,t.truncate-11)}]`,"special"):t.stylize(`[${n}]`,"special")}function mp([e,t],n){return n.truncate-=4,e=n.inspect(e,n),n.truncate-=e.length,t=n.inspect(t,n),`${e} => ${t}`}function gp(e){let t=[];return e.forEach((n,r)=>{t.push([r,n])}),t}function To(e,t){return e.size-1<=0?"Map{}":(t.truncate-=7,`Map{ ${pe(gp(e),t,mp)} }`)}var yp=Number.isNaN||(e=>e!==e);function zn(e,t){return yp(e)?t.stylize("NaN","number"):e===1/0?t.stylize("Infinity","number"):e===-1/0?t.stylize("-Infinity","number"):e===0?t.stylize(1/e===1/0?"+0":"-0","number"):t.stylize(Ee(String(e),t.truncate),"number")}function Wn(e,t){let n=Ee(e.toString(),t.truncate-1);return n!==et&&(n+="n"),t.stylize(n,"bigint")}function xo(e,t){let n=e.toString().split("/")[2],r=t.truncate-(2+n.length),o=e.source;return t.stylize(`/${Ee(o,r)}/${n}`,"regexp")}function bp(e){let t=[];return e.forEach(n=>{t.push(n)}),t}function _o(e,t){return e.size===0?"Set{}":(t.truncate-=7,`Set{ ${pe(bp(e),t)} }`)}var Da=new RegExp("['\\u0000-\\u001f\\u007f-\\u009f\\u00ad\\u0600-\\u0604\\u070f\\u17b4\\u17b5\\u200c-\\u200f\\u2028-\\u202f\\u2060-\\u206f\\ufeff\\ufff0-\\uffff]","g"),wp={"\b":"\\b"," ":"\\t","\n":"\\n","\f":"\\f","\r":"\\r","'":"\\'","\\":"\\\\"},vp=16,Sp=4;function Ep(e){return wp[e]||`\\u${`0000${e.charCodeAt(0).toString(vp)}`.slice(-Sp)}`}function Un(e,t){return Da.test(e)&&(e=e.replace(Da,Ep)),t.stylize(`'${Ee(e,t.truncate-2)}'`,"string")}function Vn(e){return"description"in Symbol.prototype?e.description?`Symbol(${e.description})`:"Symbol()":e.toString()}var qa=()=>"Promise{\u2026}";try{let{getPromiseDetails:e,kPending:t,kRejected:n}=process.binding("util");Array.isArray(e(Promise.resolve()))&&(qa=(r,o)=>{let[i,s]=e(r);return i===t?"Promise{<pending>}":`Promise${i===n?"!":""}{${o.inspect(s,o)}}`})}catch{}var Ba=qa;function wt(e,t){let n=Object.getOwnPropertyNames(e),r=Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(e):[];if(n.length===0&&r.length===0)return"{}";if(t.truncate-=4,t.seen=t.seen||[],t.seen.includes(e))return"[Circular]";t.seen.push(e);let o=pe(n.map(a=>[a,e[a]]),t,tt),i=pe(r.map(a=>[a,e[a]]),t,tt);t.seen.pop();let s="";return o&&i&&(s=", "),`{ ${o}${s}${i} }`}var Co=typeof Symbol<"u"&&Symbol.toStringTag?Symbol.toStringTag:!1;function Oo(e,t){let n="";return Co&&Co in e&&(n=e[Co]),n=n||e.constructor.name,(!n||n==="_class")&&(n="<Anonymous Class>"),t.truncate-=n.length,`${n}${wt(e,t)}`}function Io(e,t){return e.length===0?"Arguments[]":(t.truncate-=13,`Arguments[ ${pe(e,t)} ]`)}var Tp=["stack","line","column","name","message","fileName","lineNumber","columnNumber","number","description","cause"];function Ao(e,t){let n=Object.getOwnPropertyNames(e).filter(s=>Tp.indexOf(s)===-1),r=e.name;t.truncate-=r.length;let o="";if(typeof e.message=="string"?o=Ee(e.message,t.truncate):n.unshift("message"),o=o?`: ${o}`:"",t.truncate-=o.length+5,t.seen=t.seen||[],t.seen.includes(e))return"[Circular]";t.seen.push(e);let i=pe(n.map(s=>[s,e[s]]),t,tt);return`${r}${o}${i?` { ${i} }`:""}`}function xp([e,t],n){return n.truncate-=3,t?`${n.stylize(String(e),"yellow")}=${n.stylize(`"${t}"`,"string")}`:`${n.stylize(String(e),"yellow")}`}function Jn(e,t){return pe(e,t,Kn,`
41
- `)}function Kn(e,t){let n=e.getAttributeNames(),r=e.tagName.toLowerCase(),o=t.stylize(`<${r}`,"special"),i=t.stylize(">","special"),s=t.stylize(`</${r}>`,"special");t.truncate-=r.length*2+5;let a="";n.length>0&&(a+=" ",a+=pe(n.map(u=>[u,e.getAttribute(u)]),t,xp," ")),t.truncate-=a.length;let c=t.truncate,l=Jn(e.children,t);return l&&l.length>c&&(l=`${et}(${e.children.length})`),`${o}${a}${i}${l}${s}`}var _p=typeof Symbol=="function"&&typeof Symbol.for=="function",$o=_p?Symbol.for("chai/inspect"):"@@chai/inspect",Mt=!1;try{let e=require("util");Mt=e.inspect?e.inspect.custom:!1}catch{Mt=!1}var za=new WeakMap,Wa={},Ua={undefined:(e,t)=>t.stylize("undefined","undefined"),null:(e,t)=>t.stylize("null","null"),boolean:(e,t)=>t.stylize(String(e),"boolean"),Boolean:(e,t)=>t.stylize(String(e),"boolean"),number:zn,Number:zn,bigint:Wn,BigInt:Wn,string:Un,String:Un,function:Bn,Function:Bn,symbol:Vn,Symbol:Vn,Array:So,Date:Eo,Map:To,Set:_o,RegExp:xo,Promise:Ba,WeakSet:(e,t)=>t.stylize("WeakSet{\u2026}","special"),WeakMap:(e,t)=>t.stylize("WeakMap{\u2026}","special"),Arguments:Io,Int8Array:Be,Uint8Array:Be,Uint8ClampedArray:Be,Int16Array:Be,Uint16Array:Be,Int32Array:Be,Uint32Array:Be,Float32Array:Be,Float64Array:Be,Generator:()=>"",DataView:()=>"",ArrayBuffer:()=>"",Error:Ao,HTMLCollection:Jn,NodeList:Jn},Cp=(e,t,n)=>$o in e&&typeof e[$o]=="function"?e[$o](t):Mt&&Mt in e&&typeof e[Mt]=="function"?e[Mt](t.depth,t):"inspect"in e&&typeof e.inspect=="function"?e.inspect(t.depth,t):"constructor"in e&&za.has(e.constructor)?za.get(e.constructor)(e,t):Wa[n]?Wa[n](e,t):"",Op=Object.prototype.toString;function Xn(e,t={}){let n=La(t,Xn),{customInspect:r}=n,o=e===null?"null":typeof e;if(o==="object"&&(o=Op.call(e).slice(8,-1)),o in Ua)return Ua[o](e,n);if(r&&e){let s=Cp(e,n,o);if(s)return typeof s=="string"?s:Xn(s,n)}let i=e?Object.getPrototypeOf(e):!1;return i===Object.prototype||i===null?wt(e,n):e&&typeof HTMLElement=="function"&&e instanceof HTMLElement?Kn(e,n):"constructor"in e?e.constructor!==Object?Oo(e,n):wt(e,n):e===Object(e)?wt(e,n):n.stylize(String(e),o)}var{AsymmetricMatcher:Ap,DOMCollection:$p,DOMElement:kp,Immutable:Pp,ReactElement:Np,ReactTestComponent:Mp}=Nt,Va=[Mp,Np,kp,$p,Pp,Ap];function Te(e,t=10,{maxLength:n,...r}={}){let o=n??1e4,i;try{i=Ae(e,{maxDepth:t,escapeString:!1,plugins:Va,...r})}catch{i=Ae(e,{callToJSON:!1,maxDepth:t,escapeString:!1,plugins:Va,...r})}return i.length>=o&&t>1?Te(e,Math.floor(t/2)):i}var jp=/%[sdjifoOc%]/g;function nn(...e){if(typeof e[0]!="string"){let i=[];for(let s=0;s<e.length;s++)i.push(vt(e[s],{depth:0,colors:!1}));return i.join(" ")}let t=e.length,n=1,r=e[0],o=String(r).replace(jp,i=>{if(i==="%%")return"%";if(n>=t)return i;switch(i){case"%s":{let s=e[n++];return typeof s=="bigint"?`${s.toString()}n`:typeof s=="number"&&s===0&&1/s<0?"-0":typeof s=="object"&&s!==null?vt(s,{depth:0,colors:!1}):String(s)}case"%d":{let s=e[n++];return typeof s=="bigint"?`${s.toString()}n`:Number(s).toString()}case"%i":{let s=e[n++];return typeof s=="bigint"?`${s.toString()}n`:Number.parseInt(String(s)).toString()}case"%f":return Number.parseFloat(String(e[n++])).toString();case"%o":return vt(e[n++],{showHidden:!0,showProxy:!0});case"%O":return vt(e[n++]);case"%c":return n++,"";case"%j":try{return JSON.stringify(e[n++])}catch(s){let a=s.message;if(a.includes("circular structure")||a.includes("cyclic structures")||a.includes("cyclic object"))return"[Circular]";throw s}default:return i}});for(let i=e[n];n<t;i=e[++n])i===null||typeof i!="object"?o+=` ${i}`:o+=` ${vt(i)}`;return o}function vt(e,t={}){return t.truncate===0&&(t.truncate=Number.POSITIVE_INFINITY),Xn(e,t)}function ko(e,t={}){typeof t.truncate>"u"&&(t.truncate=40);let n=vt(e,t),r=Object.prototype.toString.call(e);if(t.truncate&&n.length>=t.truncate)if(r==="[object Function]"){let o=e;return o.name?`[Function: ${o.name}]`:"[Function]"}else{if(r==="[object Array]")return`[ Array(${e.length}) ]`;if(r==="[object Object]"){let o=Object.keys(e);return`{ Object (${o.length>2?`${o.splice(0,2).join(", ")}, ...`:o.join(", ")}) }`}else return n}return n}function Ja(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function Po(e){let{message:t="$$stack trace error",stackTraceLimit:n=1}=e||{},r=Error.stackTraceLimit,o=Error.prepareStackTrace;Error.stackTraceLimit=n,Error.prepareStackTrace=a=>a.stack;let s=new Error(t).stack||"";return Error.prepareStackTrace=o,Error.stackTraceLimit=r,s}function ye(e,t,n){let r=typeof e;if(!n.includes(r))throw new TypeError(`${t} value must be ${n.join(" or ")}, received "${r}"`)}function No(e){return e==null&&(e=[]),Array.isArray(e)?e:[e]}function nt(e){return e!=null&&typeof e=="object"&&!Array.isArray(e)}function Rp(e){return e===Object.prototype||e===Function.prototype||e===RegExp.prototype}function St(e){return Object.prototype.toString.apply(e).slice(8,-1)}function Fp(e,t){let n=typeof t=="function"?t:r=>t.add(r);Object.getOwnPropertyNames(e).forEach(n),Object.getOwnPropertySymbols(e).forEach(n)}function Gn(e){let t=new Set;return Rp(e)?[]:(Fp(e,t),Array.from(t))}var Ka={forceWritable:!1};function Yn(e,t=Ka){return Hn(e,new WeakMap,t)}function Hn(e,t,n=Ka){let r,o;if(t.has(e))return t.get(e);if(Array.isArray(e)){for(o=Array.from({length:r=e.length}),t.set(e,o);r--;)o[r]=Hn(e[r],t,n);return o}if(Object.prototype.toString.call(e)==="[object Object]"){o=Object.create(Object.getPrototypeOf(e)),t.set(e,o);let i=Gn(e);for(let s of i){let a=Object.getOwnPropertyDescriptor(e,s);if(!a)continue;let c=Hn(e[s],t,n);n.forceWritable?Object.defineProperty(o,s,{enumerable:a.enumerable,configurable:!0,writable:!0,value:c}):"get"in a?Object.defineProperty(o,s,{...a,get(){return c}}):Object.defineProperty(o,s,{...a,value:c})}return o}return e}function Mo(e,t,n=void 0){let r=t.replace(/\[(\d+)\]/g,".$1").split("."),o=e;for(let i of r)if(o=new Object(o)[i],o===void 0)return n;return o}function Zn(){let e=null,t=null,n=new Promise((r,o)=>{e=r,t=o});return n.resolve=e,n.reject=t,n}function jo(e){if(!Number.isNaN(e))return!1;let t=new Float64Array(1);return t[0]=e,new Uint32Array(t.buffer)[1]>>>31===1}var Ro,Xa;function Lp(){if(Xa)return Ro;Xa=1;var e,t,n,r,o,i,s,a,c,l,u,f,m,h,g,y,w,E,_;return m=/\/(?![*\/])(?:\[(?:(?![\]\\]).|\\.)*\]|(?![\/\\]).|\\.)*(\/[$_\u200C\u200D\p{ID_Continue}]*|\\)?/yu,f=/--|\+\+|=>|\.{3}|\??\.(?!\d)|(?:&&|\|\||\?\?|[+\-%&|^]|\*{1,2}|<{1,2}|>{1,3}|!=?|={1,2}|\/(?![\/*]))=?|[?~,:;[\](){}]/y,e=/(\x23?)(?=[$_\p{ID_Start}\\])(?:[$_\u200C\u200D\p{ID_Continue}]|\\u[\da-fA-F]{4}|\\u\{[\da-fA-F]+\})+/yu,g=/(['"])(?:(?!\1)[^\\\n\r]|\\(?:\r\n|[^]))*(\1)?/y,u=/(?:0[xX][\da-fA-F](?:_?[\da-fA-F])*|0[oO][0-7](?:_?[0-7])*|0[bB][01](?:_?[01])*)n?|0n|[1-9](?:_?\d)*n|(?:(?:0(?!\d)|0\d*[89]\d*|[1-9](?:_?\d)*)(?:\.(?:\d(?:_?\d)*)?)?|\.\d(?:_?\d)*)(?:[eE][+-]?\d(?:_?\d)*)?|0[0-7]+/y,y=/[`}](?:[^`\\$]|\\[^]|\$(?!\{))*(`|\$\{)?/y,_=/[\t\v\f\ufeff\p{Zs}]+/yu,a=/\r?\n|[\r\u2028\u2029]/y,c=/\/\*(?:[^*]|\*(?!\/))*(\*\/)?/y,h=/\/\/.*/y,n=/[<>.:={}]|\/(?![\/*])/y,t=/[$_\p{ID_Start}][$_\u200C\u200D\p{ID_Continue}-]*/yu,r=/(['"])(?:(?!\1)[^])*(\1)?/y,o=/[^<>{}]+/y,E=/^(?:[\/+-]|\.{3}|\?(?:InterpolationIn(?:JSX|Template)|NoLineTerminatorHere|NonExpressionParenEnd|UnaryIncDec))?$|[{}([,;<>=*%&|^!~?:]$/,w=/^(?:=>|[;\]){}]|else|\?(?:NoLineTerminatorHere|NonExpressionParenEnd))?$/,i=/^(?:await|case|default|delete|do|else|instanceof|new|return|throw|typeof|void|yield)$/,s=/^(?:return|throw|yield)$/,l=RegExp(a.source),Ro=function*(O,{jsx:A=!1}={}){var $,R,N,I,k,V,C,W,ne,q,z,j,G,L;for({length:V}=O,I=0,k="",L=[{tag:"JS"}],$=[],z=0,j=!1;I<V;){switch(W=L[L.length-1],W.tag){case"JS":case"JSNonExpressionParen":case"InterpolationInTemplate":case"InterpolationInJSX":if(O[I]==="/"&&(E.test(k)||i.test(k))&&(m.lastIndex=I,C=m.exec(O))){I=m.lastIndex,k=C[0],j=!0,yield{type:"RegularExpressionLiteral",value:C[0],closed:C[1]!==void 0&&C[1]!=="\\"};continue}if(f.lastIndex=I,C=f.exec(O)){switch(G=C[0],ne=f.lastIndex,q=G,G){case"(":k==="?NonExpressionParenKeyword"&&L.push({tag:"JSNonExpressionParen",nesting:z}),z++,j=!1;break;case")":z--,j=!0,W.tag==="JSNonExpressionParen"&&z===W.nesting&&(L.pop(),q="?NonExpressionParenEnd",j=!1);break;case"{":f.lastIndex=0,N=!w.test(k)&&(E.test(k)||i.test(k)),$.push(N),j=!1;break;case"}":switch(W.tag){case"InterpolationInTemplate":if($.length===W.nesting){y.lastIndex=I,C=y.exec(O),I=y.lastIndex,k=C[0],C[1]==="${"?(k="?InterpolationInTemplate",j=!1,yield{type:"TemplateMiddle",value:C[0]}):(L.pop(),j=!0,yield{type:"TemplateTail",value:C[0],closed:C[1]==="`"});continue}break;case"InterpolationInJSX":if($.length===W.nesting){L.pop(),I+=1,k="}",yield{type:"JSXPunctuator",value:"}"};continue}}j=$.pop(),q=j?"?ExpressionBraceEnd":"}";break;case"]":j=!0;break;case"++":case"--":q=j?"?PostfixIncDec":"?UnaryIncDec";break;case"<":if(A&&(E.test(k)||i.test(k))){L.push({tag:"JSXTag"}),I+=1,k="<",yield{type:"JSXPunctuator",value:G};continue}j=!1;break;default:j=!1}I=ne,k=q,yield{type:"Punctuator",value:G};continue}if(e.lastIndex=I,C=e.exec(O)){switch(I=e.lastIndex,q=C[0],C[0]){case"for":case"if":case"while":case"with":k!=="."&&k!=="?."&&(q="?NonExpressionParenKeyword")}k=q,j=!i.test(C[0]),yield{type:C[1]==="#"?"PrivateIdentifier":"IdentifierName",value:C[0]};continue}if(g.lastIndex=I,C=g.exec(O)){I=g.lastIndex,k=C[0],j=!0,yield{type:"StringLiteral",value:C[0],closed:C[2]!==void 0};continue}if(u.lastIndex=I,C=u.exec(O)){I=u.lastIndex,k=C[0],j=!0,yield{type:"NumericLiteral",value:C[0]};continue}if(y.lastIndex=I,C=y.exec(O)){I=y.lastIndex,k=C[0],C[1]==="${"?(k="?InterpolationInTemplate",L.push({tag:"InterpolationInTemplate",nesting:$.length}),j=!1,yield{type:"TemplateHead",value:C[0]}):(j=!0,yield{type:"NoSubstitutionTemplate",value:C[0],closed:C[1]==="`"});continue}break;case"JSXTag":case"JSXTagEnd":if(n.lastIndex=I,C=n.exec(O)){switch(I=n.lastIndex,q=C[0],C[0]){case"<":L.push({tag:"JSXTag"});break;case">":L.pop(),k==="/"||W.tag==="JSXTagEnd"?(q="?JSX",j=!0):L.push({tag:"JSXChildren"});break;case"{":L.push({tag:"InterpolationInJSX",nesting:$.length}),q="?InterpolationInJSX",j=!1;break;case"/":k==="<"&&(L.pop(),L[L.length-1].tag==="JSXChildren"&&L.pop(),L.push({tag:"JSXTagEnd"}))}k=q,yield{type:"JSXPunctuator",value:C[0]};continue}if(t.lastIndex=I,C=t.exec(O)){I=t.lastIndex,k=C[0],yield{type:"JSXIdentifier",value:C[0]};continue}if(r.lastIndex=I,C=r.exec(O)){I=r.lastIndex,k=C[0],yield{type:"JSXString",value:C[0],closed:C[2]!==void 0};continue}break;case"JSXChildren":if(o.lastIndex=I,C=o.exec(O)){I=o.lastIndex,k=C[0],yield{type:"JSXText",value:C[0]};continue}switch(O[I]){case"<":L.push({tag:"JSXTag"}),I++,k="<",yield{type:"JSXPunctuator",value:"<"};continue;case"{":L.push({tag:"InterpolationInJSX",nesting:$.length}),I++,k="?InterpolationInJSX",j=!1,yield{type:"JSXPunctuator",value:"{"};continue}}if(_.lastIndex=I,C=_.exec(O)){I=_.lastIndex,yield{type:"WhiteSpace",value:C[0]};continue}if(a.lastIndex=I,C=a.exec(O)){I=a.lastIndex,j=!1,s.test(k)&&(k="?NoLineTerminatorHere"),yield{type:"LineTerminatorSequence",value:C[0]};continue}if(c.lastIndex=I,C=c.exec(O)){I=c.lastIndex,l.test(C[0])&&(j=!1,s.test(k)&&(k="?NoLineTerminatorHere")),yield{type:"MultiLineComment",value:C[0],closed:C[1]!==void 0};continue}if(h.lastIndex=I,C=h.exec(O)){I=h.lastIndex,j=!1,yield{type:"SingleLineComment",value:C[0]};continue}R=String.fromCodePoint(O.codePointAt(I)),I+=R.length,k=R,j=!1,yield{type:W.tag.startsWith("JSX")?"JSXInvalid":"Invalid",value:R}}},Ro}var gv=Lp();var Ga={keyword:["break","case","catch","continue","debugger","default","do","else","finally","for","function","if","return","switch","throw","try","var","const","while","with","new","this","super","class","extends","export","import","null","true","false","in","instanceof","typeof","void","delete"],strict:["implements","interface","let","package","private","protected","public","static","yield"]},yv=new Set(Ga.keyword),bv=new Set(Ga.strict);var Ha=Symbol("vitest:SAFE_TIMERS");function ft(){let{setTimeout:e,setInterval:t,clearInterval:n,clearTimeout:r,setImmediate:o,clearImmediate:i}=globalThis[Ha]||globalThis,{nextTick:s}=globalThis[Ha]||globalThis.process||{nextTick:a=>a()};return{nextTick:s,setTimeout:e,setInterval:t,clearInterval:n,clearTimeout:r,setImmediate:o,clearImmediate:i}}var xe=-1,be=1,ae=0,ie=class{0;1;constructor(t,n){this[0]=t,this[1]=n}},Dp=function(e,t){if(!e||!t||e.charAt(0)!==t.charAt(0))return 0;let n=0,r=Math.min(e.length,t.length),o=r,i=0;for(;n<o;)e.substring(i,o)===t.substring(i,o)?(n=o,i=n):r=o,o=Math.floor((r-n)/2+n);return o},hc=function(e,t){if(!e||!t||e.charAt(e.length-1)!==t.charAt(t.length-1))return 0;let n=0,r=Math.min(e.length,t.length),o=r,i=0;for(;n<o;)e.substring(e.length-o,e.length-i)===t.substring(t.length-o,t.length-i)?(n=o,i=n):r=o,o=Math.floor((r-n)/2+n);return o},Ya=function(e,t){let n=e.length,r=t.length;if(n===0||r===0)return 0;n>r?e=e.substring(n-r):n<r&&(t=t.substring(0,n));let o=Math.min(n,r);if(e===t)return o;let i=0,s=1;for(;;){let a=e.substring(o-s),c=t.indexOf(a);if(c===-1)return i;s+=c,(c===0||e.substring(o-s)===t.substring(0,s))&&(i=s,s++)}},qp=function(e){let t=!1,n=[],r=0,o=null,i=0,s=0,a=0,c=0,l=0;for(;i<e.length;)e[i][0]===ae?(n[r++]=i,s=c,a=l,c=0,l=0,o=e[i][1]):(e[i][0]===be?c+=e[i][1].length:l+=e[i][1].length,o&&o.length<=Math.max(s,a)&&o.length<=Math.max(c,l)&&(e.splice(n[r-1],0,new ie(xe,o)),e[n[r-1]+1][0]=be,r--,r--,i=r>0?n[r-1]:-1,s=0,a=0,c=0,l=0,o=null,t=!0)),i++;for(t&&pc(e),Wp(e),i=1;i<e.length;){if(e[i-1][0]===xe&&e[i][0]===be){let u=e[i-1][1],f=e[i][1],m=Ya(u,f),h=Ya(f,u);m>=h?(m>=u.length/2||m>=f.length/2)&&(e.splice(i,0,new ie(ae,f.substring(0,m))),e[i-1][1]=u.substring(0,u.length-m),e[i+1][1]=f.substring(m),i++):(h>=u.length/2||h>=f.length/2)&&(e.splice(i,0,new ie(ae,u.substring(0,h))),e[i-1][0]=be,e[i-1][1]=f.substring(0,f.length-h),e[i+1][0]=xe,e[i+1][1]=u.substring(h),i++),i++}i++}},Za=/[^a-z0-9]/i,Qa=/\s/,ec=/[\r\n]/,Bp=/\n\r?\n$/,zp=/^\r?\n\r?\n/;function Wp(e){let t=1;for(;t<e.length-1;){if(e[t-1][0]===ae&&e[t+1][0]===ae){let n=e[t-1][1],r=e[t][1],o=e[t+1][1],i=hc(n,r);if(i){let u=r.substring(r.length-i);n=n.substring(0,n.length-i),r=u+r.substring(0,r.length-i),o=u+o}let s=n,a=r,c=o,l=Qn(n,r)+Qn(r,o);for(;r.charAt(0)===o.charAt(0);){n+=r.charAt(0),r=r.substring(1)+o.charAt(0),o=o.substring(1);let u=Qn(n,r)+Qn(r,o);u>=l&&(l=u,s=n,a=r,c=o)}e[t-1][1]!==s&&(s?e[t-1][1]=s:(e.splice(t-1,1),t--),e[t][1]=a,c?e[t+1][1]=c:(e.splice(t+1,1),t--))}t++}}function pc(e){e.push(new ie(ae,""));let t=0,n=0,r=0,o="",i="",s;for(;t<e.length;)switch(e[t][0]){case be:r++,i+=e[t][1],t++;break;case xe:n++,o+=e[t][1],t++;break;case ae:n+r>1?(n!==0&&r!==0&&(s=Dp(i,o),s!==0&&(t-n-r>0&&e[t-n-r-1][0]===ae?e[t-n-r-1][1]+=i.substring(0,s):(e.splice(0,0,new ie(ae,i.substring(0,s))),t++),i=i.substring(s),o=o.substring(s)),s=hc(i,o),s!==0&&(e[t][1]=i.substring(i.length-s)+e[t][1],i=i.substring(0,i.length-s),o=o.substring(0,o.length-s))),t-=n+r,e.splice(t,n+r),o.length&&(e.splice(t,0,new ie(xe,o)),t++),i.length&&(e.splice(t,0,new ie(be,i)),t++),t++):t!==0&&e[t-1][0]===ae?(e[t-1][1]+=e[t][1],e.splice(t,1)):t++,r=0,n=0,o="",i="";break}e[e.length-1][1]===""&&e.pop();let a=!1;for(t=1;t<e.length-1;)e[t-1][0]===ae&&e[t+1][0]===ae&&(e[t][1].substring(e[t][1].length-e[t-1][1].length)===e[t-1][1]?(e[t][1]=e[t-1][1]+e[t][1].substring(0,e[t][1].length-e[t-1][1].length),e[t+1][1]=e[t-1][1]+e[t+1][1],e.splice(t-1,1),a=!0):e[t][1].substring(0,e[t+1][1].length)===e[t+1][1]&&(e[t-1][1]+=e[t+1][1],e[t][1]=e[t][1].substring(e[t+1][1].length)+e[t+1][1],e.splice(t+1,1),a=!0)),t++;a&&pc(e)}function Qn(e,t){if(!e||!t)return 6;let n=e.charAt(e.length-1),r=t.charAt(0),o=n.match(Za),i=r.match(Za),s=o&&n.match(Qa),a=i&&r.match(Qa),c=s&&n.match(ec),l=a&&r.match(ec),u=c&&e.match(Bp),f=l&&t.match(zp);return u||f?5:c||l?4:o&&!s&&a?3:s||a?2:o||i?1:0}var dc="Compared values have no visual difference.",Up="Compared values serialize to the same structure.\nPrinting internal object structure without calling `toJSON` instead.",er={},tc;function Vp(){if(tc)return er;tc=1,Object.defineProperty(er,"__esModule",{value:!0}),er.default=m;let e="diff-sequences",t=0,n=(h,g,y,w,E)=>{let _=0;for(;h<g&&y<w&&E(h,y);)h+=1,y+=1,_+=1;return _},r=(h,g,y,w,E)=>{let _=0;for(;h<=g&&y<=w&&E(g,w);)g-=1,w-=1,_+=1;return _},o=(h,g,y,w,E,_,O)=>{let A=0,$=-h,R=_[A],N=R;_[A]+=n(R+1,g,w+R-$+1,y,E);let I=h<O?h:O;for(A+=1,$+=2;A<=I;A+=1,$+=2){if(A!==h&&N<_[A])R=_[A];else if(R=N+1,g<=R)return A-1;N=_[A],_[A]=R+n(R+1,g,w+R-$+1,y,E)}return O},i=(h,g,y,w,E,_,O)=>{let A=0,$=h,R=_[A],N=R;_[A]-=r(g,R-1,y,w+R-$-1,E);let I=h<O?h:O;for(A+=1,$-=2;A<=I;A+=1,$-=2){if(A!==h&&_[A]<N)R=_[A];else if(R=N-1,R<g)return A-1;N=_[A],_[A]=R-r(g,R-1,y,w+R-$-1,E)}return O},s=(h,g,y,w,E,_,O,A,$,R,N)=>{let I=w-g,k=y-g,C=E-w-k,W=-C-(h-1),ne=-C+(h-1),q=t,z=h<A?h:A;for(let j=0,G=-h;j<=z;j+=1,G+=2){let L=j===0||j!==h&&q<O[j],ue=L?O[j]:q,ge=L?ue:ue+1,ke=I+ge-G,_e=n(ge+1,y,ke+1,E,_),Ce=ge+_e;if(q=O[j],O[j]=Ce,W<=G&&G<=ne){let Le=(h-1-(G+C))/2;if(Le<=R&&$[Le]-1<=Ce){let ce=I+ue-(L?G+1:G-1),se=r(g,ue,w,ce,_),Ie=ue-se,Ke=ce-se,Pe=Ie+1,st=Ke+1;N.nChangePreceding=h-1,h-1===Pe+st-g-w?(N.aEndPreceding=g,N.bEndPreceding=w):(N.aEndPreceding=Pe,N.bEndPreceding=st),N.nCommonPreceding=se,se!==0&&(N.aCommonPreceding=Pe,N.bCommonPreceding=st),N.nCommonFollowing=_e,_e!==0&&(N.aCommonFollowing=ge+1,N.bCommonFollowing=ke+1);let at=Ce+1,yt=ke+_e+1;return N.nChangeFollowing=h-1,h-1===y+E-at-yt?(N.aStartFollowing=y,N.bStartFollowing=E):(N.aStartFollowing=at,N.bStartFollowing=yt),!0}}}return!1},a=(h,g,y,w,E,_,O,A,$,R,N)=>{let I=E-y,k=y-g,C=E-w-k,W=C-h,ne=C+h,q=t,z=h<R?h:R;for(let j=0,G=h;j<=z;j+=1,G-=2){let L=j===0||j!==h&&$[j]<q,ue=L?$[j]:q,ge=L?ue:ue-1,ke=I+ge-G,_e=r(g,ge-1,w,ke-1,_),Ce=ge-_e;if(q=$[j],$[j]=Ce,W<=G&&G<=ne){let Le=(h+(G-C))/2;if(Le<=A&&Ce-1<=O[Le]){let ce=ke-_e;if(N.nChangePreceding=h,h===Ce+ce-g-w?(N.aEndPreceding=g,N.bEndPreceding=w):(N.aEndPreceding=Ce,N.bEndPreceding=ce),N.nCommonPreceding=_e,_e!==0&&(N.aCommonPreceding=Ce,N.bCommonPreceding=ce),N.nChangeFollowing=h-1,h===1)N.nCommonFollowing=0,N.aStartFollowing=y,N.bStartFollowing=E;else{let se=I+ue-(L?G-1:G+1),Ie=n(ue,y,se,E,_);N.nCommonFollowing=Ie,Ie!==0&&(N.aCommonFollowing=ue,N.bCommonFollowing=se);let Ke=ue+Ie,Pe=se+Ie;h-1===y+E-Ke-Pe?(N.aStartFollowing=y,N.bStartFollowing=E):(N.aStartFollowing=Ke,N.bStartFollowing=Pe)}return!0}}}return!1},c=(h,g,y,w,E,_,O,A,$)=>{let R=w-g,N=E-y,I=y-g,k=E-w,V=k-I,C=I,W=I;if(O[0]=g-1,A[0]=y,V%2===0){let ne=(h||V)/2,q=(I+k)/2;for(let z=1;z<=q;z+=1)if(C=o(z,y,E,R,_,O,C),z<ne)W=i(z,g,w,N,_,A,W);else if(a(z,g,y,w,E,_,O,C,A,W,$))return}else{let ne=((h||V)+1)/2,q=(I+k+1)/2,z=1;for(C=o(z,y,E,R,_,O,C),z+=1;z<=q;z+=1)if(W=i(z-1,g,w,N,_,A,W),z<ne)C=o(z,y,E,R,_,O,C);else if(s(z,g,y,w,E,_,O,C,A,W,$))return}throw new Error(`${e}: no overlap aStart=${g} aEnd=${y} bStart=${w} bEnd=${E}`)},l=(h,g,y,w,E,_,O,A,$,R)=>{if(E-w<y-g){if(_=!_,_&&O.length===1){let{foundSubsequence:Ce,isCommon:Le}=O[0];O[1]={foundSubsequence:(ce,se,Ie)=>{Ce(ce,Ie,se)},isCommon:(ce,se)=>Le(se,ce)}}let ke=g,_e=y;g=w,y=E,w=ke,E=_e}let{foundSubsequence:N,isCommon:I}=O[_?1:0];c(h,g,y,w,E,I,A,$,R);let{nChangePreceding:k,aEndPreceding:V,bEndPreceding:C,nCommonPreceding:W,aCommonPreceding:ne,bCommonPreceding:q,nCommonFollowing:z,aCommonFollowing:j,bCommonFollowing:G,nChangeFollowing:L,aStartFollowing:ue,bStartFollowing:ge}=R;g<V&&w<C&&l(k,g,V,w,C,_,O,A,$,R),W!==0&&N(W,ne,q),z!==0&&N(z,j,G),ue<y&&ge<E&&l(L,ue,y,ge,E,_,O,A,$,R)},u=(h,g)=>{if(typeof g!="number")throw new TypeError(`${e}: ${h} typeof ${typeof g} is not a number`);if(!Number.isSafeInteger(g))throw new RangeError(`${e}: ${h} value ${g} is not a safe integer`);if(g<0)throw new RangeError(`${e}: ${h} value ${g} is a negative integer`)},f=(h,g)=>{let y=typeof g;if(y!=="function")throw new TypeError(`${e}: ${h} typeof ${y} is not a function`)};function m(h,g,y,w){u("aLength",h),u("bLength",g),f("isCommon",y),f("foundSubsequence",w);let E=n(0,h,0,g,y);if(E!==0&&w(E,0,0),h!==E||g!==E){let _=E,O=E,A=r(_,h-1,O,g-1,y),$=h-A,R=g-A,N=E+A;h!==N&&g!==N&&l(0,_,$,O,R,!1,[{foundSubsequence:w,isCommon:y}],[t],[t],{aCommonFollowing:t,aCommonPreceding:t,aEndPreceding:t,aStartFollowing:t,bCommonFollowing:t,bCommonPreceding:t,bEndPreceding:t,bStartFollowing:t,nChangeFollowing:t,nChangePreceding:t,nCommonFollowing:t,nCommonPreceding:t}),A!==0&&w(A,$,R)}}return er}var Jp=Vp(),mc=Ja(Jp);function Kp(e,t){return e.replace(/\s+$/,n=>t(n))}function Wo(e,t,n,r,o,i){return e.length!==0?n(`${r} ${Kp(e,o)}`):r!==" "?n(r):t&&i.length!==0?n(`${r} ${i}`):""}function gc(e,t,{aColor:n,aIndicator:r,changeLineTrailingSpaceColor:o,emptyFirstOrLastLinePlaceholder:i}){return Wo(e,t,n,r,o,i)}function yc(e,t,{bColor:n,bIndicator:r,changeLineTrailingSpaceColor:o,emptyFirstOrLastLinePlaceholder:i}){return Wo(e,t,n,r,o,i)}function bc(e,t,{commonColor:n,commonIndicator:r,commonLineTrailingSpaceColor:o,emptyFirstOrLastLinePlaceholder:i}){return Wo(e,t,n,r,o,i)}function nc(e,t,n,r,{patchColor:o}){return o(`@@ -${e+1},${t-e} +${n+1},${r-n} @@`)}function Xp(e,t){let n=e.length,r=t.contextLines,o=r+r,i=n,s=!1,a=0,c=0;for(;c!==n;){let A=c;for(;c!==n&&e[c][0]===ae;)c+=1;if(A!==c)if(A===0)c>r&&(i-=c-r,s=!0);else if(c===n){let $=c-A;$>r&&(i-=$-r,s=!0)}else{let $=c-A;$>o&&(i-=$-o,a+=1)}for(;c!==n&&e[c][0]!==ae;)c+=1}let l=a!==0||s;a!==0?i+=a+1:s&&(i+=1);let u=i-1,f=[],m=0;l&&f.push("");let h=0,g=0,y=0,w=0,E=A=>{let $=f.length;f.push(bc(A,$===0||$===u,t)),y+=1,w+=1},_=A=>{let $=f.length;f.push(gc(A,$===0||$===u,t)),y+=1},O=A=>{let $=f.length;f.push(yc(A,$===0||$===u,t)),w+=1};for(c=0;c!==n;){let A=c;for(;c!==n&&e[c][0]===ae;)c+=1;if(A!==c)if(A===0){c>r&&(A=c-r,h=A,g=A,y=h,w=g);for(let $=A;$!==c;$+=1)E(e[$][1])}else if(c===n){let $=c-A>r?A+r:c;for(let R=A;R!==$;R+=1)E(e[R][1])}else{let $=c-A;if($>o){let R=A+r;for(let I=A;I!==R;I+=1)E(e[I][1]);f[m]=nc(h,y,g,w,t),m=f.length,f.push("");let N=$-o;h=y+N,g=w+N,y=h,w=g;for(let I=c-r;I!==c;I+=1)E(e[I][1])}else for(let R=A;R!==c;R+=1)E(e[R][1])}for(;c!==n&&e[c][0]===xe;)_(e[c][1]),c+=1;for(;c!==n&&e[c][0]===be;)O(e[c][1]),c+=1}return l&&(f[m]=nc(h,y,g,w,t)),f.join(`
42
- `)}function Hp(e,t){return e.map((n,r,o)=>{let i=n[1],s=r===0||r===o.length-1;switch(n[0]){case xe:return gc(i,s,t);case be:return yc(i,s,t);default:return bc(i,s,t)}}).join(`
43
- `)}var Fo=e=>e,wc=5,Gp=0;function Yp(){return{aAnnotation:"Expected",aColor:re.green,aIndicator:"-",bAnnotation:"Received",bColor:re.red,bIndicator:"+",changeColor:re.inverse,changeLineTrailingSpaceColor:Fo,commonColor:re.dim,commonIndicator:" ",commonLineTrailingSpaceColor:Fo,compareKeys:void 0,contextLines:wc,emptyFirstOrLastLinePlaceholder:"",expand:!0,includeChangeCounts:!1,omitAnnotationLines:!1,patchColor:re.yellow,truncateThreshold:Gp,truncateAnnotation:"... Diff result is truncated",truncateAnnotationColor:Fo}}function Zp(e){return e&&typeof e=="function"?e:void 0}function Qp(e){return typeof e=="number"&&Number.isSafeInteger(e)&&e>=0?e:wc}function Et(e={}){return{...Yp(),...e,compareKeys:Zp(e.compareKeys),contextLines:Qp(e.contextLines)}}function jt(e){return e.length===1&&e[0].length===0}function ed(e){let t=0,n=0;return e.forEach(r=>{switch(r[0]){case xe:t+=1;break;case be:n+=1;break}}),{a:t,b:n}}function td({aAnnotation:e,aColor:t,aIndicator:n,bAnnotation:r,bColor:o,bIndicator:i,includeChangeCounts:s,omitAnnotationLines:a},c){if(a)return"";let l="",u="";if(s){let h=String(c.a),g=String(c.b),y=r.length-e.length,w=" ".repeat(Math.max(0,y)),E=" ".repeat(Math.max(0,-y)),_=g.length-h.length,O=" ".repeat(Math.max(0,_)),A=" ".repeat(Math.max(0,-_));l=`${w} ${n} ${O}${h}`,u=`${E} ${i} ${A}${g}`}let f=`${n} ${e}${l}`,m=`${i} ${r}${u}`;return`${t(f)}
44
- ${o(m)}
20
+ `)}var T=new WeakMap;function g(r,e){if(T.has(r)){let t=T.get(r);for(let n in e)t[n]=e[n]}else T.set(r,e)}function x(r){return T.get(r)}var b=class{constructor(){g(this,{jobs:[],state:0})}get length(){return x(this).jobs.length}async start(){let{state:e,jobs:t}=x(this);if(!(e===1||t.length<=0)){for(g(this,{state:1});t.length>0;){let n=t.shift();await Promise.resolve().then(n.handle).then(n.resolve,n.reject)}g(this,{state:0})}}push(e){return new Promise((t,n)=>{let{jobs:o}=x(this);o.push({handle:e,resolve:t,reject:n}),setImmediate(()=>this.start())})}};var m=class{apply;initializer(){}#e=new b;async init(e){this.initializer&&await this.#e.push(()=>this.initializer?.());let t=await e.loadEvents();await Promise.all(t.map(n=>this.applyEvent(n)))}async applyEvent(e){await this.#e.push(()=>this.apply?.[e.eventName]?.(e)),await this.#e.push(()=>this.project(e))}project(e){}},y=class r{constructor(e,t,n,o){this.store=e;this.commandHandlers=t;this.projectors=n;this.eventHandlers=o}static builder(e){return new $(e)}static new(e,t,n,o){return new r(e,t,n,o)}async resetProjections(){await Promise.all(this.projectors.map(e=>e.init(this)))}async dispatch(e){return this.commandHandlers.has(e.type)||c(`There is no command handler for the "${e.type}" command`),await this.commandHandlers.get(e.type)(e,this),e}async loadEvents(){return this.store.loadEvents()}async load(e,t){let n=await this.store.load(t);return n.length<=0&&c(`Aggregate(${e.constructor.name}) with ID(${t}) does not exist.`,{aggregate:e.constructor.name,aggregateId:t}),e.replayEvents(n)}async persist(e){let t=e.releaseEvents();await this.store.persist(t);for(let n of t)await Promise.all(this.projectors.map(async o=>{try{await o.applyEvent(n)}catch(s){throw s instanceof Error&&console.error(`An error occurred in one of your projections: ${o.name}, given an event`,s.stack?.split(`
21
+ `).map(E=>` ${E}`).join(`
22
+ `)),s}})),await Promise.all(this.eventHandlers.map(async o=>{try{await o(n,this)}catch(s){throw s instanceof Error&&console.error(`An error occurred in one of your event handlers: ${o.name}, given an event`,s.stack?.split(`
23
+ `).map(E=>` ${E}`).join(`
24
+ `)),s}}))}async loadPersist(e,t,n){return await this.load(e,t),await n(e),this.persist(e)}},$=class{constructor(e){this.store=e}commandHandlers=new Map;projectors=[];eventHandlers=[];build(){return y.new(this.store,this.commandHandlers,this.projectors,this.eventHandlers)}addCommandHandler(e,t){return this.commandHandlers.has(e)&&c(`A command handler for the "${e}" command already exists`),this.commandHandlers.set(e,t),this}addProjector(e){return this.projectors.push(e),this}addEventHandler(e){return this.eventHandlers.push(e),this}};function k(r){return(e,t)=>r[e.eventName]?.(e,t)}var N=Symbol("__placeholder__");function I(r,e){try{return r()}catch(t){throw Error.captureStackTrace&&t instanceof Error&&Error.captureStackTrace(t,e),t}}var H=class extends m{constructor(t=[],n=[]){super();this.db=t;this.producedEvents=n}apply={};name="test-recording-projector";initializer(){this.db.splice(0)}project(t){this.producedEvents.push(t)}};function B(r,e=[]){let t=new H,n=y.builder({load(a){return t.db.filter(i=>i.aggregateId===a)},loadEvents(){return t.db},persist(a){t.db.push(...a)}});for(let a of e)n.addProjector(a);n.addProjector(t);for(let[a,i]of Object.entries(r))n.addCommandHandler(a,i);let o=n.build(),s,E=!1,w={___:N,async given(a=[]){t.db.push(...a)},async when(a){try{return await o.dispatch(typeof a=="function"?a():a)}catch(i){return i instanceof Error&&(s=i),i}},async then(a){if(E=!0,a instanceof Error){let u=a;I(()=>{if(s?.message!==u?.message)throw new Error(`Expected error message to be:
45
25
 
46
- `}function Uo(e,t,n){return td(n,ed(e))+(n.expand?Hp(e,n):Xp(e,n))+(t?n.truncateAnnotationColor(`
47
- ${n.truncateAnnotation}`):"")}function nr(e,t,n){let r=Et(n),[o,i]=vc(jt(e)?[]:e,jt(t)?[]:t,r);return Uo(o,i,r)}function nd(e,t,n,r,o){if(jt(e)&&jt(n)&&(e=[],n=[]),jt(t)&&jt(r)&&(t=[],r=[]),e.length!==n.length||t.length!==r.length)return nr(e,t,o);let[i,s]=vc(n,r,o),a=0,c=0;return i.forEach(l=>{switch(l[0]){case xe:l[1]=e[a],a+=1;break;case be:l[1]=t[c],c+=1;break;default:l[1]=t[c],a+=1,c+=1}}),Uo(i,s,Et(o))}function vc(e,t,n){let r=n?.truncateThreshold??!1,o=Math.max(Math.floor(n?.truncateThreshold??0),0),i=r?Math.min(e.length,o):e.length,s=r?Math.min(t.length,o):t.length,a=i!==e.length||s!==t.length,c=(h,g)=>e[h]===t[g],l=[],u=0,f=0;for(mc(i,s,c,(h,g,y)=>{for(;u!==g;u+=1)l.push(new ie(xe,e[u]));for(;f!==y;f+=1)l.push(new ie(be,t[f]));for(;h!==0;h-=1,u+=1,f+=1)l.push(new ie(ae,t[f]))});u!==i;u+=1)l.push(new ie(xe,e[u]));for(;f!==s;f+=1)l.push(new ie(be,t[f]));return[l,a]}function rc(e){if(e===void 0)return"undefined";if(e===null)return"null";if(Array.isArray(e))return"array";if(typeof e=="boolean")return"boolean";if(typeof e=="function")return"function";if(typeof e=="number")return"number";if(typeof e=="string")return"string";if(typeof e=="bigint")return"bigint";if(typeof e=="object"){if(e!=null){if(e.constructor===RegExp)return"regexp";if(e.constructor===Map)return"map";if(e.constructor===Set)return"set";if(e.constructor===Date)return"date"}return"object"}else if(typeof e=="symbol")return"symbol";throw new Error(`value of unknown type: ${e}`)}function oc(e){return e.includes(`\r
48
- `)?`\r
49
- `:`
50
- `}function rd(e,t,n){let r=n?.truncateThreshold??!1,o=Math.max(Math.floor(n?.truncateThreshold??0),0),i=e.length,s=t.length;if(r){let h=e.includes(`
51
- `),g=t.includes(`
52
- `),y=oc(e),w=oc(t),E=h?`${e.split(y,o).join(y)}
53
- `:e,_=g?`${t.split(w,o).join(w)}
54
- `:t;i=E.length,s=_.length}let a=i!==e.length||s!==t.length,c=(h,g)=>e[h]===t[g],l=0,u=0,f=[];return mc(i,s,c,(h,g,y)=>{l!==g&&f.push(new ie(xe,e.slice(l,g))),u!==y&&f.push(new ie(be,t.slice(u,y))),l=g+h,u=y+h,f.push(new ie(ae,t.slice(y,u)))}),l!==i&&f.push(new ie(xe,e.slice(l))),u!==s&&f.push(new ie(be,t.slice(u))),[f,a]}function od(e,t,n){return t.reduce((r,o)=>r+(o[0]===ae?o[1]:o[0]===e&&o[1].length!==0?n(o[1]):""),"")}var tr=class{op;line;lines;changeColor;constructor(t,n){this.op=t,this.line=[],this.lines=[],this.changeColor=n}pushSubstring(t){this.pushDiff(new ie(this.op,t))}pushLine(){this.lines.push(this.line.length!==1?new ie(this.op,od(this.op,this.line,this.changeColor)):this.line[0][0]===this.op?this.line[0]:new ie(this.op,this.line[0][1])),this.line.length=0}isLineEmpty(){return this.line.length===0}pushDiff(t){this.line.push(t)}align(t){let n=t[1];if(n.includes(`
55
- `)){let r=n.split(`
56
- `),o=r.length-1;r.forEach((i,s)=>{s<o?(this.pushSubstring(i),this.pushLine()):i.length!==0&&this.pushSubstring(i)})}else this.pushDiff(t)}moveLinesTo(t){this.isLineEmpty()||this.pushLine(),t.push(...this.lines),this.lines.length=0}},Do=class{deleteBuffer;insertBuffer;lines;constructor(t,n){this.deleteBuffer=t,this.insertBuffer=n,this.lines=[]}pushDiffCommonLine(t){this.lines.push(t)}pushDiffChangeLines(t){let n=t[1].length===0;(!n||this.deleteBuffer.isLineEmpty())&&this.deleteBuffer.pushDiff(t),(!n||this.insertBuffer.isLineEmpty())&&this.insertBuffer.pushDiff(t)}flushChangeLines(){this.deleteBuffer.moveLinesTo(this.lines),this.insertBuffer.moveLinesTo(this.lines)}align(t){let n=t[0],r=t[1];if(r.includes(`
57
- `)){let o=r.split(`
58
- `),i=o.length-1;o.forEach((s,a)=>{if(a===0){let c=new ie(n,s);this.deleteBuffer.isLineEmpty()&&this.insertBuffer.isLineEmpty()?(this.flushChangeLines(),this.pushDiffCommonLine(c)):(this.pushDiffChangeLines(c),this.flushChangeLines())}else a<i?this.pushDiffCommonLine(new ie(n,s)):s.length!==0&&this.pushDiffChangeLines(new ie(n,s))})}else this.pushDiffChangeLines(t)}getLines(){return this.flushChangeLines(),this.lines}};function id(e,t){let n=new tr(xe,t),r=new tr(be,t),o=new Do(n,r);return e.forEach(i=>{switch(i[0]){case xe:n.align(i);break;case be:r.align(i);break;default:o.align(i)}}),o.getLines()}function sd(e,t){if(t){let n=e.length-1;return e.some((r,o)=>r[0]===ae&&(o!==n||r[1]!==`
59
- `))}return e.some(n=>n[0]===ae)}function ad(e,t,n){if(e!==t&&e.length!==0&&t.length!==0){let r=e.includes(`
60
- `)||t.includes(`
61
- `),[o,i]=Sc(r?`${e}
62
- `:e,r?`${t}
63
- `:t,!0,n);if(sd(o,r)){let s=Et(n),a=id(o,s.changeColor);return Uo(a,i,s)}}return nr(e.split(`
64
- `),t.split(`
65
- `),n)}function Sc(e,t,n,r){let[o,i]=rd(e,t,r);return n&&qp(o),[o,i]}function qo(e,t){let{commonColor:n}=Et(t);return n(e)}var{AsymmetricMatcher:cd,DOMCollection:ld,DOMElement:ud,Immutable:fd,ReactElement:hd,ReactTestComponent:pd}=Nt,Ec=[pd,hd,ud,ld,fd,cd],Bo={plugins:Ec},Tc={callToJSON:!1,maxDepth:10,plugins:Ec};function Tt(e,t,n){if(Object.is(e,t))return"";let r=rc(e),o=r,i=!1;if(r==="object"&&typeof e.asymmetricMatch=="function"){if(e.$$typeof!==Symbol.for("jest.asymmetricMatcher")||typeof e.getExpectedType!="function")return;o=e.getExpectedType(),i=o==="string"}if(o!==rc(t)){let{aAnnotation:s,aColor:a,aIndicator:c,bAnnotation:l,bColor:u,bIndicator:f}=Et(n),m=zo(Tc,n),h=Ae(e,m),g=Ae(t,m),y=`${a(`${c} ${s}:`)}
66
- ${h}`,w=`${u(`${f} ${l}:`)}
67
- ${g}`;return`${y}
26
+ ${u.message}
68
27
 
69
- ${w}`}if(!i)switch(r){case"string":return nr(e.split(`
70
- `),t.split(`
71
- `),n);case"boolean":case"number":return dd(e,t,n);case"map":return Lo(ic(e),ic(t),n);case"set":return Lo(sc(e),sc(t),n);default:return Lo(e,t,n)}}function dd(e,t,n){let r=Ae(e,Bo),o=Ae(t,Bo);return r===o?"":nr(r.split(`
72
- `),o.split(`
73
- `),n)}function ic(e){return new Map(Array.from(e.entries()).sort())}function sc(e){return new Set(Array.from(e.values()).sort())}function Lo(e,t,n){let r,o=!1;try{let s=zo(Bo,n);r=ac(e,t,s,n)}catch{o=!0}let i=qo(dc,n);if(r===void 0||r===i){let s=zo(Tc,n);r=ac(e,t,s,n),r!==i&&!o&&(r=`${qo(Up,n)}
28
+ But got:
74
29
 
75
- ${r}`)}return r}function zo(e,t){let{compareKeys:n}=Et(t);return{...e,compareKeys:n}}function ac(e,t,n,r){let o={...n,indent:0},i=Ae(e,o),s=Ae(t,o);if(i===s)return qo(dc,r);{let a=Ae(e,n),c=Ae(t,n);return nd(a.split(`
76
- `),c.split(`
77
- `),i.split(`
78
- `),s.split(`
79
- `),r)}}var cc=2e4;function lc(e){return St(e)==="Object"&&typeof e.asymmetricMatch=="function"}function uc(e,t){let n=St(e),r=St(t);return n===r&&(n==="Object"||n==="Array")}function rr(e,t,n){let{aAnnotation:r,bAnnotation:o}=Et(n);if(typeof e=="string"&&typeof t=="string"&&e.length>0&&t.length>0&&e.length<=cc&&t.length<=cc&&e!==t){if(e.includes(`
80
- `)||t.includes(`
81
- `))return ad(t,e,n);let[u]=Sc(t,e,!0),f=u.some(y=>y[0]===ae),m=md(r,o),h=m(r)+bd(fc(u,xe,f)),g=m(o)+yd(fc(u,be,f));return`${h}
82
- ${g}`}let i=Yn(e,{forceWritable:!0}),s=Yn(t,{forceWritable:!0}),{replacedExpected:a,replacedActual:c}=xc(i,s);return Tt(a,c,n)}function xc(e,t,n=new WeakSet,r=new WeakSet){return uc(e,t)?n.has(e)||r.has(t)?{replacedActual:e,replacedExpected:t}:(n.add(e),r.add(t),Gn(t).forEach(o=>{let i=t[o],s=e[o];if(lc(i))i.asymmetricMatch(s)&&(e[o]=i);else if(lc(s))s.asymmetricMatch(i)&&(t[o]=s);else if(uc(s,i)){let a=xc(s,i,n,r);e[o]=a.replacedActual,t[o]=a.replacedExpected}}),{replacedActual:e,replacedExpected:t}):{replacedActual:e,replacedExpected:t}}function md(...e){let t=e.reduce((n,r)=>r.length>n?r.length:n,0);return n=>`${n}: ${" ".repeat(t-n.length)}`}var gd="\xB7";function _c(e){return e.replace(/\s+$/gm,t=>gd.repeat(t.length))}function yd(e){return re.red(_c(Te(e)))}function bd(e){return re.green(_c(Te(e)))}function fc(e,t,n){return e.reduce((r,o)=>r+(o[0]===ae?o[1]:o[0]===t?n?re.inverse(o[1]):o[1]:""),"")}function or(e,t){if(!e)throw new Error(t)}function Rt(e,t){return typeof t===e}function wd(e){return e instanceof Promise}function Vo(e,t,n){Object.defineProperty(e,t,n)}function Ft(e,t,n){Object.defineProperty(e,t,{value:n})}var rn=Symbol.for("tinyspy:spy"),vd=new Set,Sd=e=>{e.called=!1,e.callCount=0,e.calls=[],e.results=[],e.resolves=[],e.next=[]},Ed=e=>(Vo(e,rn,{value:{reset:()=>Sd(e[rn])}}),e[rn]),ir=e=>e[rn]||Ed(e);function Td(e){or(Rt("function",e)||Rt("undefined",e),"cannot spy on a non-function value");let t=function(...r){let o=ir(t);o.called=!0,o.callCount++,o.calls.push(r);let i=o.next.shift();if(i){o.results.push(i);let[u,f]=i;if(u==="ok")return f;throw f}let s,a="ok",c=o.results.length;if(o.impl)try{new.target?s=Reflect.construct(o.impl,r,new.target):s=o.impl.apply(this,r),a="ok"}catch(u){throw s=u,a="error",o.results.push([a,u]),u}let l=[a,s];return wd(s)&&s.then(u=>o.resolves[c]=["ok",u],u=>o.resolves[c]=["error",u]),o.results.push(l),s};Ft(t,"_isMockFunction",!0),Ft(t,"length",e?e.length:0),Ft(t,"name",e&&e.name||"spy");let n=ir(t);return n.reset(),n.impl=e,t}var Cc=(e,t)=>Object.getOwnPropertyDescriptor(e,t),Oc=(e,t)=>{t!=null&&typeof t=="function"&&t.prototype!=null&&Object.setPrototypeOf(e.prototype,t.prototype)};function Jo(e,t,n){or(!Rt("undefined",e),"spyOn could not find an object to spy upon"),or(Rt("object",e)||Rt("function",e),"cannot spyOn on a primitive value");let[r,o]=(()=>{if(!Rt("object",t))return[t,"value"];if("getter"in t&&"setter"in t)throw new Error("cannot spy on both getter and setter");if("getter"in t)return[t.getter,"get"];if("setter"in t)return[t.setter,"set"];throw new Error("specify getter or setter to spy on")})(),i=Cc(e,r),s=Object.getPrototypeOf(e),a=s&&Cc(s,r),c=i||a;or(c||r in e,`${String(r)} does not exist`);let l=!1;o==="value"&&c&&!c.value&&c.get&&(o="get",l=!0,n=c.get());let u;c?u=c[o]:o!=="value"?u=()=>e[r]:u=e[r];let f=y=>{let{value:w,...E}=c||{configurable:!0,writable:!0};o!=="value"&&delete E.writable,E[o]=y,Vo(e,r,E)},m=()=>c?Vo(e,r,c):f(u);n||(n=u);let h=Td(n);o==="value"&&Oc(h,u);let g=h[rn];return Ft(g,"restore",m),Ft(g,"getOriginal",()=>l?u():u),Ft(g,"willCall",y=>(g.impl=y,h)),f(l?()=>(Oc(h,n),h):h),vd.add(h),h}var on=new Set;function sr(e){return typeof e=="function"&&"_isMockFunction"in e&&e._isMockFunction}function Ic(e,t,n){let o=n?{[{get:"getter",set:"setter"}[n]]:t}:t,i=Jo(e,o);return Ac(i)}var _d=0;function Ac(e){let t=e,n,r=[],o=[],i=[],s=ir(e),a={get calls(){return s.calls},get contexts(){return o},get instances(){return r},get invocationCallOrder(){return i},get results(){return s.results.map(([h,g])=>({type:h==="error"?"throw":"return",value:g}))},get settledResults(){return s.resolves.map(([h,g])=>({type:h==="error"?"rejected":"fulfilled",value:g}))},get lastCall(){return s.calls[s.calls.length-1]}},c=[],l=!1;function u(...h){return r.push(this),o.push(this),i.push(++_d),(l?n:c.shift()||n||s.getOriginal()||(()=>{})).apply(this,h)}let f=t.name;t.getMockName=()=>f||"vi.fn()",t.mockName=h=>(f=h,t),t.mockClear=()=>(s.reset(),r=[],o=[],i=[],t),t.mockReset=()=>(t.mockClear(),n=()=>{},c=[],t),t.mockRestore=()=>(t.mockReset(),s.restore(),n=void 0,t),t.getMockImplementation=()=>n,t.mockImplementation=h=>(n=h,s.willCall(u),t),t.mockImplementationOnce=h=>(c.push(h),t);function m(h,g){let y=n;n=h,s.willCall(u),l=!0;let w=()=>{n=y,l=!1},E=g();return E instanceof Promise?E.then(()=>(w(),t)):(w(),t)}return t.withImplementation=m,t.mockReturnThis=()=>t.mockImplementation(function(){return this}),t.mockReturnValue=h=>t.mockImplementation(()=>h),t.mockReturnValueOnce=h=>t.mockImplementationOnce(()=>h),t.mockResolvedValue=h=>t.mockImplementation(()=>Promise.resolve(h)),t.mockResolvedValueOnce=h=>t.mockImplementationOnce(()=>Promise.resolve(h)),t.mockRejectedValue=h=>t.mockImplementation(()=>Promise.reject(h)),t.mockRejectedValueOnce=h=>t.mockImplementationOnce(()=>Promise.reject(h)),Object.defineProperty(t,"mock",{get:()=>a}),s.willCall(u),on.add(t),t}function $c(e){let t=Ac(Jo({spy:e||function(){}},"spy"));return e&&t.mockImplementation(e),t}var Cd="@@__IMMUTABLE_RECORD__@@",Od="@@__IMMUTABLE_ITERABLE__@@";function Id(e){return e&&(e[Od]||e[Cd])}var Ad=Object.getPrototypeOf({});function kc(e){return e instanceof Error?`<unserializable>: ${e.message}`:typeof e=="string"?`<unserializable>: ${e}`:"<unserializable>"}function Lt(e,t=new WeakMap){if(!e||typeof e=="string")return e;if(typeof e=="function")return`Function<${e.name||"anonymous"}>`;if(typeof e=="symbol")return e.toString();if(typeof e!="object")return e;if(Id(e))return Lt(e.toJSON(),t);if(e instanceof Promise||e.constructor&&e.constructor.prototype==="AsyncFunction")return"Promise";if(typeof Element<"u"&&e instanceof Element)return e.tagName;if(typeof e.asymmetricMatch=="function")return`${e.toString()} ${nn(e.sample)}`;if(typeof e.toJSON=="function")return Lt(e.toJSON(),t);if(t.has(e))return t.get(e);if(Array.isArray(e)){let n=new Array(e.length);return t.set(e,n),e.forEach((r,o)=>{try{n[o]=Lt(r,t)}catch(i){n[o]=kc(i)}}),n}else{let n=Object.create(null);t.set(e,n);let r=e;for(;r&&r!==Ad;)Object.getOwnPropertyNames(r).forEach(o=>{if(!(o in n))try{n[o]=Lt(e[o],t)}catch(i){delete n[o],n[o]=kc(i)}}),r=Object.getPrototypeOf(r);return n}}function $d(e){return e.replace(/__(vite_ssr_import|vi_import)_\d+__\./g,"")}function Ko(e,t,n=new WeakSet){if(!e||typeof e!="object")return{message:String(e)};let r=e;r.stack&&(r.stackStr=String(r.stack)),r.name&&(r.nameStr=String(r.name)),(r.showDiff||r.showDiff===void 0&&r.expected!==void 0&&r.actual!==void 0)&&(r.diff=rr(r.actual,r.expected,{...t,...r.diffOptions})),typeof r.expected!="string"&&(r.expected=Te(r.expected,10)),typeof r.actual!="string"&&(r.actual=Te(r.actual,10));try{typeof r.message=="string"&&(r.message=$d(r.message))}catch{}try{!n.has(r)&&typeof r.cause=="object"&&(n.add(r),r.cause=Ko(r.cause,t,n))}catch{}try{return Lt(r)}catch(o){return Lt(new Error(`Failed to fully serialize error: ${o?.message}
83
- Inner error message: ${r?.message}`))}}var Bc=Object.defineProperty,kd=Object.getOwnPropertyNames,x=(e,t)=>Bc(e,"name",{value:t,configurable:!0}),Pd=(e,t)=>function(){return t||(0,e[kd(e)[0]])((t={exports:{}}).exports,t),t.exports},ui=(e,t)=>{for(var n in t)Bc(e,n,{get:t[n],enumerable:!0})},Nd=Pd({"(disabled):util"(){}}),we={};ui(we,{addChainableMethod:()=>Ei,addLengthGuard:()=>un,addMethod:()=>wi,addProperty:()=>bi,checkError:()=>je,compareByInspect:()=>ur,eql:()=>ml,expectTypes:()=>Hc,flag:()=>U,getActual:()=>dr,getMessage:()=>pi,getName:()=>gr,getOperator:()=>Ci,getOwnEnumerableProperties:()=>_i,getOwnEnumerablePropertySymbols:()=>xi,getPathInfo:()=>yi,hasProperty:()=>mr,inspect:()=>Y,isNaN:()=>fr,isNumeric:()=>de,isProxyEnabled:()=>ln,isRegExp:()=>hr,objDisplay:()=>xt,overwriteChainableMethod:()=>Ti,overwriteMethod:()=>Si,overwriteProperty:()=>vi,proxify:()=>zt,test:()=>fi,transferFlags:()=>ze,type:()=>te});var je={};ui(je,{compatibleConstructor:()=>Uc,compatibleInstance:()=>Wc,compatibleMessage:()=>Vc,getConstructorName:()=>Jc,getMessage:()=>Kc});function pr(e){return e instanceof Error||Object.prototype.toString.call(e)==="[object Error]"}x(pr,"isErrorInstance");function zc(e){return Object.prototype.toString.call(e)==="[object RegExp]"}x(zc,"isRegExp");function Wc(e,t){return pr(t)&&e===t}x(Wc,"compatibleInstance");function Uc(e,t){return pr(t)?e.constructor===t.constructor||e instanceof t.constructor:(typeof t=="object"||typeof t=="function")&&t.prototype?e.constructor===t||e instanceof t:!1}x(Uc,"compatibleConstructor");function Vc(e,t){let n=typeof e=="string"?e:e.message;return zc(t)?t.test(n):typeof t=="string"?n.indexOf(t)!==-1:!1}x(Vc,"compatibleMessage");function Jc(e){let t=e;return pr(e)?t=e.constructor.name:typeof e=="function"&&(t=e.name,t===""&&(t=new e().name||t)),t}x(Jc,"getConstructorName");function Kc(e){let t="";return e&&e.message?t=e.message:typeof e=="string"&&(t=e),t}x(Kc,"getMessage");function U(e,t,n){var r=e.__flags||(e.__flags=Object.create(null));if(arguments.length===3)r[t]=n;else return r[t]}x(U,"flag");function fi(e,t){var n=U(e,"negate"),r=t[0];return n?!r:r}x(fi,"test");function te(e){if(typeof e>"u")return"undefined";if(e===null)return"null";let t=e[Symbol.toStringTag];return typeof t=="string"?t:Object.prototype.toString.call(e).slice(8,-1)}x(te,"type");var Md="captureStackTrace"in Error,Z=class Xc extends Error{static{x(this,"AssertionError")}message;get name(){return"AssertionError"}get ok(){return!1}constructor(t="Unspecified AssertionError",n,r){super(t),this.message=t,Md&&Error.captureStackTrace(this,r||Xc);for(let o in n)o in this||(this[o]=n[o])}toJSON(t){return{...this,name:this.name,message:this.message,ok:!1,stack:t!==!1?this.stack:void 0}}};function Hc(e,t){var n=U(e,"message"),r=U(e,"ssfi");n=n?n+": ":"",e=U(e,"object"),t=t.map(function(s){return s.toLowerCase()}),t.sort();var o=t.map(function(s,a){var c=~["a","e","i","o","u"].indexOf(s.charAt(0))?"an":"a",l=t.length>1&&a===t.length-1?"or ":"";return l+c+" "+s}).join(", "),i=te(e).toLowerCase();if(!t.some(function(s){return i===s}))throw new Z(n+"object tested must be "+o+", but "+i+" given",void 0,r)}x(Hc,"expectTypes");function dr(e,t){return t.length>4?t[4]:e._obj}x(dr,"getActual");var Pc={bold:["1","22"],dim:["2","22"],italic:["3","23"],underline:["4","24"],inverse:["7","27"],hidden:["8","28"],strike:["9","29"],black:["30","39"],red:["31","39"],green:["32","39"],yellow:["33","39"],blue:["34","39"],magenta:["35","39"],cyan:["36","39"],white:["37","39"],brightblack:["30;1","39"],brightred:["31;1","39"],brightgreen:["32;1","39"],brightyellow:["33;1","39"],brightblue:["34;1","39"],brightmagenta:["35;1","39"],brightcyan:["36;1","39"],brightwhite:["37;1","39"],grey:["90","39"]},jd={special:"cyan",number:"yellow",bigint:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",symbol:"green",date:"magenta",regexp:"red"},qt="\u2026";function Gc(e,t){let n=Pc[jd[t]]||Pc[t]||"";return n?`\x1B[${n[0]}m${String(e)}\x1B[${n[1]}m`:String(e)}x(Gc,"colorise");function Yc({showHidden:e=!1,depth:t=2,colors:n=!1,customInspect:r=!0,showProxy:o=!1,maxArrayLength:i=1/0,breakLength:s=1/0,seen:a=[],truncate:c=1/0,stylize:l=String}={},u){let f={showHidden:!!e,depth:Number(t),colors:!!n,customInspect:!!r,showProxy:!!o,maxArrayLength:Number(i),breakLength:Number(s),truncate:Number(c),seen:a,inspect:u,stylize:l};return f.colors&&(f.stylize=Gc),f}x(Yc,"normaliseOptions");function Zc(e){return e>="\uD800"&&e<="\uDBFF"}x(Zc,"isHighSurrogate");function rt(e,t,n=qt){e=String(e);let r=n.length,o=e.length;if(r>t&&o>r)return n;if(o>t&&o>r){let i=t-r;return i>0&&Zc(e[i-1])&&(i=i-1),`${e.slice(0,i)}${n}`}return e}x(rt,"truncate");function Re(e,t,n,r=", "){n=n||t.inspect;let o=e.length;if(o===0)return"";let i=t.truncate,s="",a="",c="";for(let l=0;l<o;l+=1){let u=l+1===e.length,f=l+2===e.length;c=`${qt}(${e.length-l})`;let m=e[l];t.truncate=i-s.length-(u?0:r.length);let h=a||n(m,t)+(u?"":r),g=s.length+h.length,y=g+c.length;if(u&&g>i&&s.length+c.length<=i||!u&&!f&&y>i||(a=u?"":n(e[l+1],t)+(f?"":r),!u&&f&&y>i&&g+a.length>i))break;if(s+=h,!u&&!f&&g+a.length>=i){c=`${qt}(${e.length-l-1})`;break}c=""}return`${s}${c}`}x(Re,"inspectList");function Qc(e){return e.match(/^[a-zA-Z_][a-zA-Z_0-9]*$/)?e:JSON.stringify(e).replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'")}x(Qc,"quoteComplexKey");function Bt([e,t],n){return n.truncate-=2,typeof e=="string"?e=Qc(e):typeof e!="number"&&(e=`[${n.inspect(e,n)}]`),n.truncate-=e.length,t=n.inspect(t,n),`${e}: ${t}`}x(Bt,"inspectProperty");function el(e,t){let n=Object.keys(e).slice(e.length);if(!e.length&&!n.length)return"[]";t.truncate-=4;let r=Re(e,t);t.truncate-=r.length;let o="";return n.length&&(o=Re(n.map(i=>[i,e[i]]),t,Bt)),`[ ${r}${o?`, ${o}`:""} ]`}x(el,"inspectArray");var Rd=x(e=>typeof Buffer=="function"&&e instanceof Buffer?"Buffer":e[Symbol.toStringTag]?e[Symbol.toStringTag]:e.constructor.name,"getArrayName");function Ye(e,t){let n=Rd(e);t.truncate-=n.length+4;let r=Object.keys(e).slice(e.length);if(!e.length&&!r.length)return`${n}[]`;let o="";for(let s=0;s<e.length;s++){let a=`${t.stylize(rt(e[s],t.truncate),"number")}${s===e.length-1?"":", "}`;if(t.truncate-=a.length,e[s]!==e.length&&t.truncate<=3){o+=`${qt}(${e.length-e[s]+1})`;break}o+=a}let i="";return r.length&&(i=Re(r.map(s=>[s,e[s]]),t,Bt)),`${n}[ ${o}${i?`, ${i}`:""} ]`}x(Ye,"inspectTypedArray");function tl(e,t){let n=e.toJSON();if(n===null)return"Invalid Date";let r=n.split("T"),o=r[0];return t.stylize(`${o}T${rt(r[1],t.truncate-o.length-1)}`,"date")}x(tl,"inspectDate");function Go(e,t){let n=e[Symbol.toStringTag]||"Function",r=e.name;return r?t.stylize(`[${n} ${rt(r,t.truncate-11)}]`,"special"):t.stylize(`[${n}]`,"special")}x(Go,"inspectFunction");function nl([e,t],n){return n.truncate-=4,e=n.inspect(e,n),n.truncate-=e.length,t=n.inspect(t,n),`${e} => ${t}`}x(nl,"inspectMapEntry");function rl(e){let t=[];return e.forEach((n,r)=>{t.push([r,n])}),t}x(rl,"mapToEntries");function ol(e,t){return e.size-1<=0?"Map{}":(t.truncate-=7,`Map{ ${Re(rl(e),t,nl)} }`)}x(ol,"inspectMap");var Fd=Number.isNaN||(e=>e!==e);function Yo(e,t){return Fd(e)?t.stylize("NaN","number"):e===1/0?t.stylize("Infinity","number"):e===-1/0?t.stylize("-Infinity","number"):e===0?t.stylize(1/e===1/0?"+0":"-0","number"):t.stylize(rt(String(e),t.truncate),"number")}x(Yo,"inspectNumber");function Zo(e,t){let n=rt(e.toString(),t.truncate-1);return n!==qt&&(n+="n"),t.stylize(n,"bigint")}x(Zo,"inspectBigInt");function il(e,t){let n=e.toString().split("/")[2],r=t.truncate-(2+n.length),o=e.source;return t.stylize(`/${rt(o,r)}/${n}`,"regexp")}x(il,"inspectRegExp");function sl(e){let t=[];return e.forEach(n=>{t.push(n)}),t}x(sl,"arrayFromSet");function al(e,t){return e.size===0?"Set{}":(t.truncate-=7,`Set{ ${Re(sl(e),t)} }`)}x(al,"inspectSet");var Nc=new RegExp("['\\u0000-\\u001f\\u007f-\\u009f\\u00ad\\u0600-\\u0604\\u070f\\u17b4\\u17b5\\u200c-\\u200f\\u2028-\\u202f\\u2060-\\u206f\\ufeff\\ufff0-\\uffff]","g"),Ld={"\b":"\\b"," ":"\\t","\n":"\\n","\f":"\\f","\r":"\\r","'":"\\'","\\":"\\\\"},Dd=16,qd=4;function cl(e){return Ld[e]||`\\u${`0000${e.charCodeAt(0).toString(Dd)}`.slice(-qd)}`}x(cl,"escape");function Qo(e,t){return Nc.test(e)&&(e=e.replace(Nc,cl)),t.stylize(`'${rt(e,t.truncate-2)}'`,"string")}x(Qo,"inspectString");function ei(e){return"description"in Symbol.prototype?e.description?`Symbol(${e.description})`:"Symbol()":e.toString()}x(ei,"inspectSymbol");var ll=x(()=>"Promise{\u2026}","getPromiseValue");try{let{getPromiseDetails:e,kPending:t,kRejected:n}=process.binding("util");Array.isArray(e(Promise.resolve()))&&(ll=x((r,o)=>{let[i,s]=e(r);return i===t?"Promise{<pending>}":`Promise${i===n?"!":""}{${o.inspect(s,o)}}`},"getPromiseValue"))}catch{}var Bd=ll;function an(e,t){let n=Object.getOwnPropertyNames(e),r=Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(e):[];if(n.length===0&&r.length===0)return"{}";if(t.truncate-=4,t.seen=t.seen||[],t.seen.includes(e))return"[Circular]";t.seen.push(e);let o=Re(n.map(a=>[a,e[a]]),t,Bt),i=Re(r.map(a=>[a,e[a]]),t,Bt);t.seen.pop();let s="";return o&&i&&(s=", "),`{ ${o}${s}${i} }`}x(an,"inspectObject");var Xo=typeof Symbol<"u"&&Symbol.toStringTag?Symbol.toStringTag:!1;function ul(e,t){let n="";return Xo&&Xo in e&&(n=e[Xo]),n=n||e.constructor.name,(!n||n==="_class")&&(n="<Anonymous Class>"),t.truncate-=n.length,`${n}${an(e,t)}`}x(ul,"inspectClass");function fl(e,t){return e.length===0?"Arguments[]":(t.truncate-=13,`Arguments[ ${Re(e,t)} ]`)}x(fl,"inspectArguments");var zd=["stack","line","column","name","message","fileName","lineNumber","columnNumber","number","description","cause"];function hl(e,t){let n=Object.getOwnPropertyNames(e).filter(s=>zd.indexOf(s)===-1),r=e.name;t.truncate-=r.length;let o="";if(typeof e.message=="string"?o=rt(e.message,t.truncate):n.unshift("message"),o=o?`: ${o}`:"",t.truncate-=o.length+5,t.seen=t.seen||[],t.seen.includes(e))return"[Circular]";t.seen.push(e);let i=Re(n.map(s=>[s,e[s]]),t,Bt);return`${r}${o}${i?` { ${i} }`:""}`}x(hl,"inspectObject");function pl([e,t],n){return n.truncate-=3,t?`${n.stylize(String(e),"yellow")}=${n.stylize(`"${t}"`,"string")}`:`${n.stylize(String(e),"yellow")}`}x(pl,"inspectAttribute");function ar(e,t){return Re(e,t,hi,`
84
- `)}x(ar,"inspectHTMLCollection");function hi(e,t){let n=e.getAttributeNames(),r=e.tagName.toLowerCase(),o=t.stylize(`<${r}`,"special"),i=t.stylize(">","special"),s=t.stylize(`</${r}>`,"special");t.truncate-=r.length*2+5;let a="";n.length>0&&(a+=" ",a+=Re(n.map(u=>[u,e.getAttribute(u)]),t,pl," ")),t.truncate-=a.length;let c=t.truncate,l=ar(e.children,t);return l&&l.length>c&&(l=`${qt}(${e.children.length})`),`${o}${a}${i}${l}${s}`}x(hi,"inspectHTML");var Wd=typeof Symbol=="function"&&typeof Symbol.for=="function",Ho=Wd?Symbol.for("chai/inspect"):"@@chai/inspect",Dt=!1;try{let e=Nd();Dt=e.inspect?e.inspect.custom:!1}catch{Dt=!1}var Mc=new WeakMap,jc={},Rc={undefined:(e,t)=>t.stylize("undefined","undefined"),null:(e,t)=>t.stylize("null","null"),boolean:(e,t)=>t.stylize(String(e),"boolean"),Boolean:(e,t)=>t.stylize(String(e),"boolean"),number:Yo,Number:Yo,bigint:Zo,BigInt:Zo,string:Qo,String:Qo,function:Go,Function:Go,symbol:ei,Symbol:ei,Array:el,Date:tl,Map:ol,Set:al,RegExp:il,Promise:Bd,WeakSet:(e,t)=>t.stylize("WeakSet{\u2026}","special"),WeakMap:(e,t)=>t.stylize("WeakMap{\u2026}","special"),Arguments:fl,Int8Array:Ye,Uint8Array:Ye,Uint8ClampedArray:Ye,Int16Array:Ye,Uint16Array:Ye,Int32Array:Ye,Uint32Array:Ye,Float32Array:Ye,Float64Array:Ye,Generator:()=>"",DataView:()=>"",ArrayBuffer:()=>"",Error:hl,HTMLCollection:ar,NodeList:ar},Ud=x((e,t,n)=>Ho in e&&typeof e[Ho]=="function"?e[Ho](t):Dt&&Dt in e&&typeof e[Dt]=="function"?e[Dt](t.depth,t):"inspect"in e&&typeof e.inspect=="function"?e.inspect(t.depth,t):"constructor"in e&&Mc.has(e.constructor)?Mc.get(e.constructor)(e,t):jc[n]?jc[n](e,t):"","inspectCustom"),Vd=Object.prototype.toString;function cr(e,t={}){let n=Yc(t,cr),{customInspect:r}=n,o=e===null?"null":typeof e;if(o==="object"&&(o=Vd.call(e).slice(8,-1)),o in Rc)return Rc[o](e,n);if(r&&e){let s=Ud(e,n,o);if(s)return typeof s=="string"?s:cr(s,n)}let i=e?Object.getPrototypeOf(e):!1;return i===Object.prototype||i===null?an(e,n):e&&typeof HTMLElement=="function"&&e instanceof HTMLElement?hi(e,n):"constructor"in e?e.constructor!==Object?ul(e,n):an(e,n):e===Object(e)?an(e,n):n.stylize(String(e),o)}x(cr,"inspect");var $e={includeStack:!1,showDiff:!0,truncateThreshold:40,useProxy:!0,proxyExcludedKeys:["then","catch","inspect","toJSON"],deepEqual:null};function Y(e,t,n,r){var o={colors:r,depth:typeof n>"u"?2:n,showHidden:t,truncate:$e.truncateThreshold?$e.truncateThreshold:1/0};return cr(e,o)}x(Y,"inspect");function xt(e){var t=Y(e),n=Object.prototype.toString.call(e);if($e.truncateThreshold&&t.length>=$e.truncateThreshold){if(n==="[object Function]")return!e.name||e.name===""?"[Function]":"[Function: "+e.name+"]";if(n==="[object Array]")return"[ Array("+e.length+") ]";if(n==="[object Object]"){var r=Object.keys(e),o=r.length>2?r.splice(0,2).join(", ")+", ...":r.join(", ");return"{ Object ("+o+") }"}else return t}else return t}x(xt,"objDisplay");function pi(e,t){var n=U(e,"negate"),r=U(e,"object"),o=t[3],i=dr(e,t),s=n?t[2]:t[1],a=U(e,"message");return typeof s=="function"&&(s=s()),s=s||"",s=s.replace(/#\{this\}/g,function(){return xt(r)}).replace(/#\{act\}/g,function(){return xt(i)}).replace(/#\{exp\}/g,function(){return xt(o)}),a?a+": "+s:s}x(pi,"getMessage");function ze(e,t,n){var r=e.__flags||(e.__flags=Object.create(null));t.__flags||(t.__flags=Object.create(null)),n=arguments.length===3?n:!0;for(var o in r)(n||o!=="object"&&o!=="ssfi"&&o!=="lockSsfi"&&o!="message")&&(t.__flags[o]=r[o])}x(ze,"transferFlags");function ti(e){if(typeof e>"u")return"undefined";if(e===null)return"null";let t=e[Symbol.toStringTag];return typeof t=="string"?t:Object.prototype.toString.call(e).slice(8,-1)}x(ti,"type");function di(){this._key="chai/deep-eql__"+Math.random()+Date.now()}x(di,"FakeMap");di.prototype={get:x(function(t){return t[this._key]},"get"),set:x(function(t,n){Object.isExtensible(t)&&Object.defineProperty(t,this._key,{value:n,configurable:!0})},"set")};var dl=typeof WeakMap=="function"?WeakMap:di;function ni(e,t,n){if(!n||_t(e)||_t(t))return null;var r=n.get(e);if(r){var o=r.get(t);if(typeof o=="boolean")return o}return null}x(ni,"memoizeCompare");function sn(e,t,n,r){if(!(!n||_t(e)||_t(t))){var o=n.get(e);o?o.set(t,r):(o=new dl,o.set(t,r),n.set(e,o))}}x(sn,"memoizeSet");var ml=cn;function cn(e,t,n){if(n&&n.comparator)return ri(e,t,n);var r=mi(e,t);return r!==null?r:ri(e,t,n)}x(cn,"deepEqual");function mi(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t?!0:_t(e)||_t(t)?!1:null}x(mi,"simpleEqual");function ri(e,t,n){n=n||{},n.memoize=n.memoize===!1?!1:n.memoize||new dl;var r=n&&n.comparator,o=ni(e,t,n.memoize);if(o!==null)return o;var i=ni(t,e,n.memoize);if(i!==null)return i;if(r){var s=r(e,t);if(s===!1||s===!0)return sn(e,t,n.memoize,s),s;var a=mi(e,t);if(a!==null)return a}var c=ti(e);if(c!==ti(t))return sn(e,t,n.memoize,!1),!1;sn(e,t,n.memoize,!0);var l=gl(e,t,c,n);return sn(e,t,n.memoize,l),l}x(ri,"extensiveDeepEqual");function gl(e,t,n,r){switch(n){case"String":case"Number":case"Boolean":case"Date":return cn(e.valueOf(),t.valueOf());case"Promise":case"Symbol":case"function":case"WeakMap":case"WeakSet":return e===t;case"Error":return gi(e,t,["name","message","code"],r);case"Arguments":case"Int8Array":case"Uint8Array":case"Uint8ClampedArray":case"Int16Array":case"Uint16Array":case"Int32Array":case"Uint32Array":case"Float32Array":case"Float64Array":case"Array":return ht(e,t,r);case"RegExp":return yl(e,t);case"Generator":return bl(e,t,r);case"DataView":return ht(new Uint8Array(e.buffer),new Uint8Array(t.buffer),r);case"ArrayBuffer":return ht(new Uint8Array(e),new Uint8Array(t),r);case"Set":return oi(e,t,r);case"Map":return oi(e,t,r);case"Temporal.PlainDate":case"Temporal.PlainTime":case"Temporal.PlainDateTime":case"Temporal.Instant":case"Temporal.ZonedDateTime":case"Temporal.PlainYearMonth":case"Temporal.PlainMonthDay":return e.equals(t);case"Temporal.Duration":return e.total("nanoseconds")===t.total("nanoseconds");case"Temporal.TimeZone":case"Temporal.Calendar":return e.toString()===t.toString();default:return vl(e,t,r)}}x(gl,"extensiveDeepEqualByType");function yl(e,t){return e.toString()===t.toString()}x(yl,"regexpEqual");function oi(e,t,n){try{if(e.size!==t.size)return!1;if(e.size===0)return!0}catch{return!1}var r=[],o=[];return e.forEach(x(function(s,a){r.push([s,a])},"gatherEntries")),t.forEach(x(function(s,a){o.push([s,a])},"gatherEntries")),ht(r.sort(),o.sort(),n)}x(oi,"entriesEqual");function ht(e,t,n){var r=e.length;if(r!==t.length)return!1;if(r===0)return!0;for(var o=-1;++o<r;)if(cn(e[o],t[o],n)===!1)return!1;return!0}x(ht,"iterableEqual");function bl(e,t,n){return ht(lr(e),lr(t),n)}x(bl,"generatorEqual");function wl(e){return typeof Symbol<"u"&&typeof e=="object"&&typeof Symbol.iterator<"u"&&typeof e[Symbol.iterator]=="function"}x(wl,"hasIteratorFunction");function ii(e){if(wl(e))try{return lr(e[Symbol.iterator]())}catch{return[]}return[]}x(ii,"getIteratorEntries");function lr(e){for(var t=e.next(),n=[t.value];t.done===!1;)t=e.next(),n.push(t.value);return n}x(lr,"getGeneratorEntries");function si(e){var t=[];for(var n in e)t.push(n);return t}x(si,"getEnumerableKeys");function ai(e){for(var t=[],n=Object.getOwnPropertySymbols(e),r=0;r<n.length;r+=1){var o=n[r];Object.getOwnPropertyDescriptor(e,o).enumerable&&t.push(o)}return t}x(ai,"getEnumerableSymbols");function gi(e,t,n,r){var o=n.length;if(o===0)return!0;for(var i=0;i<o;i+=1)if(cn(e[n[i]],t[n[i]],r)===!1)return!1;return!0}x(gi,"keysEqual");function vl(e,t,n){var r=si(e),o=si(t),i=ai(e),s=ai(t);if(r=r.concat(i),o=o.concat(s),r.length&&r.length===o.length)return ht(ci(r).sort(),ci(o).sort())===!1?!1:gi(e,t,r,n);var a=ii(e),c=ii(t);return a.length&&a.length===c.length?(a.sort(),c.sort(),ht(a,c,n)):r.length===0&&a.length===0&&o.length===0&&c.length===0}x(vl,"objectEqual");function _t(e){return e===null||typeof e!="object"}x(_t,"isPrimitive");function ci(e){return e.map(x(function(n){return typeof n=="symbol"?n.toString():n},"mapSymbol"))}x(ci,"mapSymbols");function mr(e,t){return typeof e>"u"||e===null?!1:t in Object(e)}x(mr,"hasProperty");function Sl(e){return e.replace(/([^\\])\[/g,"$1.[").match(/(\\\.|[^.]+?)+/g).map(r=>{if(r==="constructor"||r==="__proto__"||r==="prototype")return{};let i=/^\[(\d+)\]$/.exec(r),s=null;return i?s={i:parseFloat(i[1])}:s={p:r.replace(/\\([.[\]])/g,"$1")},s})}x(Sl,"parsePath");function li(e,t,n){let r=e,o=null;n=typeof n>"u"?t.length:n;for(let i=0;i<n;i++){let s=t[i];r&&(typeof s.p>"u"?r=r[s.i]:r=r[s.p],i===n-1&&(o=r))}return o}x(li,"internalGetPathValue");function yi(e,t){let n=Sl(t),r=n[n.length-1],o={parent:n.length>1?li(e,n,n.length-1):e,name:r.p||r.i,value:li(e,n)};return o.exists=mr(o.parent,o.name),o}x(yi,"getPathInfo");function d(e,t,n,r){return U(this,"ssfi",n||d),U(this,"lockSsfi",r),U(this,"object",e),U(this,"message",t),U(this,"eql",$e.deepEqual||ml),zt(this)}x(d,"Assertion");Object.defineProperty(d,"includeStack",{get:function(){return console.warn("Assertion.includeStack is deprecated, use chai.config.includeStack instead."),$e.includeStack},set:function(e){console.warn("Assertion.includeStack is deprecated, use chai.config.includeStack instead."),$e.includeStack=e}});Object.defineProperty(d,"showDiff",{get:function(){return console.warn("Assertion.showDiff is deprecated, use chai.config.showDiff instead."),$e.showDiff},set:function(e){console.warn("Assertion.showDiff is deprecated, use chai.config.showDiff instead."),$e.showDiff=e}});d.addProperty=function(e,t){bi(this.prototype,e,t)};d.addMethod=function(e,t){wi(this.prototype,e,t)};d.addChainableMethod=function(e,t,n){Ei(this.prototype,e,t,n)};d.overwriteProperty=function(e,t){vi(this.prototype,e,t)};d.overwriteMethod=function(e,t){Si(this.prototype,e,t)};d.overwriteChainableMethod=function(e,t,n){Ti(this.prototype,e,t,n)};d.prototype.assert=function(e,t,n,r,o,i){var s=fi(this,arguments);if(i!==!1&&(i=!0),r===void 0&&o===void 0&&(i=!1),$e.showDiff!==!0&&(i=!1),!s){t=pi(this,arguments);var a=dr(this,arguments),c={actual:a,expected:r,showDiff:i},l=Ci(this,arguments);throw l&&(c.operator=l),new Z(t,c,$e.includeStack?this.assert:U(this,"ssfi"))}};Object.defineProperty(d.prototype,"_obj",{get:function(){return U(this,"object")},set:function(e){U(this,"object",e)}});function ln(){return $e.useProxy&&typeof Proxy<"u"&&typeof Reflect<"u"}x(ln,"isProxyEnabled");function bi(e,t,n){n=n===void 0?function(){}:n,Object.defineProperty(e,t,{get:x(function r(){!ln()&&!U(this,"lockSsfi")&&U(this,"ssfi",r);var o=n.call(this);if(o!==void 0)return o;var i=new d;return ze(this,i),i},"propertyGetter"),configurable:!0})}x(bi,"addProperty");var Jd=Object.getOwnPropertyDescriptor(function(){},"length");function un(e,t,n){return Jd.configurable&&Object.defineProperty(e,"length",{get:function(){throw Error(n?"Invalid Chai property: "+t+'.length. Due to a compatibility issue, "length" cannot directly follow "'+t+'". Use "'+t+'.lengthOf" instead.':"Invalid Chai property: "+t+'.length. See docs for proper usage of "'+t+'".')}}),e}x(un,"addLengthGuard");function El(e){var t=Object.getOwnPropertyNames(e);function n(o){t.indexOf(o)===-1&&t.push(o)}x(n,"addProperty");for(var r=Object.getPrototypeOf(e);r!==null;)Object.getOwnPropertyNames(r).forEach(n),r=Object.getPrototypeOf(r);return t}x(El,"getProperties");var Fc=["__flags","__methods","_obj","assert"];function zt(e,t){return ln()?new Proxy(e,{get:x(function n(r,o){if(typeof o=="string"&&$e.proxyExcludedKeys.indexOf(o)===-1&&!Reflect.has(r,o)){if(t)throw Error("Invalid Chai property: "+t+"."+o+'. See docs for proper usage of "'+t+'".');var i=null,s=4;throw El(r).forEach(function(a){if(!Object.prototype.hasOwnProperty(a)&&Fc.indexOf(a)===-1){var c=Tl(o,a,s);c<s&&(i=a,s=c)}}),Error(i!==null?"Invalid Chai property: "+o+'. Did you mean "'+i+'"?':"Invalid Chai property: "+o)}return Fc.indexOf(o)===-1&&!U(r,"lockSsfi")&&U(r,"ssfi",n),Reflect.get(r,o)},"proxyGetter")}):e}x(zt,"proxify");function Tl(e,t,n){if(Math.abs(e.length-t.length)>=n)return n;for(var r=[],o=0;o<=e.length;o++)r[o]=Array(t.length+1).fill(0),r[o][0]=o;for(var i=0;i<t.length;i++)r[0][i]=i;for(var o=1;o<=e.length;o++)for(var s=e.charCodeAt(o-1),i=1;i<=t.length;i++){if(Math.abs(o-i)>=n){r[o][i]=n;continue}r[o][i]=Math.min(r[o-1][i]+1,r[o][i-1]+1,r[o-1][i-1]+(s===t.charCodeAt(i-1)?0:1))}return r[e.length][t.length]}x(Tl,"stringDistanceCapped");function wi(e,t,n){var r=x(function(){U(this,"lockSsfi")||U(this,"ssfi",r);var o=n.apply(this,arguments);if(o!==void 0)return o;var i=new d;return ze(this,i),i},"methodWrapper");un(r,t,!1),e[t]=zt(r,t)}x(wi,"addMethod");function vi(e,t,n){var r=Object.getOwnPropertyDescriptor(e,t),o=x(function(){},"_super");r&&typeof r.get=="function"&&(o=r.get),Object.defineProperty(e,t,{get:x(function i(){!ln()&&!U(this,"lockSsfi")&&U(this,"ssfi",i);var s=U(this,"lockSsfi");U(this,"lockSsfi",!0);var a=n(o).call(this);if(U(this,"lockSsfi",s),a!==void 0)return a;var c=new d;return ze(this,c),c},"overwritingPropertyGetter"),configurable:!0})}x(vi,"overwriteProperty");function Si(e,t,n){var r=e[t],o=x(function(){throw new Error(t+" is not a function")},"_super");r&&typeof r=="function"&&(o=r);var i=x(function(){U(this,"lockSsfi")||U(this,"ssfi",i);var s=U(this,"lockSsfi");U(this,"lockSsfi",!0);var a=n(o).apply(this,arguments);if(U(this,"lockSsfi",s),a!==void 0)return a;var c=new d;return ze(this,c),c},"overwritingMethodWrapper");un(i,t,!1),e[t]=zt(i,t)}x(Si,"overwriteMethod");var Kd=typeof Object.setPrototypeOf=="function",Lc=x(function(){},"testFn"),Xd=Object.getOwnPropertyNames(Lc).filter(function(e){var t=Object.getOwnPropertyDescriptor(Lc,e);return typeof t!="object"?!0:!t.configurable}),Hd=Function.prototype.call,Gd=Function.prototype.apply;function Ei(e,t,n,r){typeof r!="function"&&(r=x(function(){},"chainingBehavior"));var o={method:n,chainingBehavior:r};e.__methods||(e.__methods={}),e.__methods[t]=o,Object.defineProperty(e,t,{get:x(function(){o.chainingBehavior.call(this);var s=x(function(){U(this,"lockSsfi")||U(this,"ssfi",s);var l=o.method.apply(this,arguments);if(l!==void 0)return l;var u=new d;return ze(this,u),u},"chainableMethodWrapper");if(un(s,t,!0),Kd){var a=Object.create(this);a.call=Hd,a.apply=Gd,Object.setPrototypeOf(s,a)}else{var c=Object.getOwnPropertyNames(e);c.forEach(function(l){if(Xd.indexOf(l)===-1){var u=Object.getOwnPropertyDescriptor(e,l);Object.defineProperty(s,l,u)}})}return ze(this,s),zt(s)},"chainableMethodGetter"),configurable:!0})}x(Ei,"addChainableMethod");function Ti(e,t,n,r){var o=e.__methods[t],i=o.chainingBehavior;o.chainingBehavior=x(function(){var c=r(i).call(this);if(c!==void 0)return c;var l=new d;return ze(this,l),l},"overwritingChainableMethodGetter");var s=o.method;o.method=x(function(){var c=n(s).apply(this,arguments);if(c!==void 0)return c;var l=new d;return ze(this,l),l},"overwritingChainableMethodWrapper")}x(Ti,"overwriteChainableMethod");function ur(e,t){return Y(e)<Y(t)?-1:1}x(ur,"compareByInspect");function xi(e){return typeof Object.getOwnPropertySymbols!="function"?[]:Object.getOwnPropertySymbols(e).filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})}x(xi,"getOwnEnumerablePropertySymbols");function _i(e){return Object.keys(e).concat(xi(e))}x(_i,"getOwnEnumerableProperties");function xl(e){return e!==e}x(xl,"_isNaN");var fr=Number.isNaN||xl;function _l(e){var t=te(e),n=["Array","Object","Function"];return n.indexOf(t)!==-1}x(_l,"isObjectType");function Ci(e,t){var n=U(e,"operator"),r=U(e,"negate"),o=t[3],i=r?t[2]:t[1];if(n)return n;if(typeof i=="function"&&(i=i()),i=i||"",!!i&&!/\shave\s/.test(i)){var s=_l(o);return/\snot\s/.test(i)?s?"notDeepStrictEqual":"notStrictEqual":s?"deepStrictEqual":"strictEqual"}}x(Ci,"getOperator");function gr(e){return e.name}x(gr,"getName");function hr(e){return Object.prototype.toString.call(e)==="[object RegExp]"}x(hr,"isRegExp");function de(e){return["Number","BigInt"].includes(te(e))}x(de,"isNumeric");var{flag:v}=we;["to","be","been","is","and","has","have","with","that","which","at","of","same","but","does","still","also"].forEach(function(e){d.addProperty(e)});d.addProperty("not",function(){v(this,"negate",!0)});d.addProperty("deep",function(){v(this,"deep",!0)});d.addProperty("nested",function(){v(this,"nested",!0)});d.addProperty("own",function(){v(this,"own",!0)});d.addProperty("ordered",function(){v(this,"ordered",!0)});d.addProperty("any",function(){v(this,"any",!0),v(this,"all",!1)});d.addProperty("all",function(){v(this,"all",!0),v(this,"any",!1)});var Dc={function:["function","asyncfunction","generatorfunction","asyncgeneratorfunction"],asyncfunction:["asyncfunction","asyncgeneratorfunction"],generatorfunction:["generatorfunction","asyncgeneratorfunction"],asyncgeneratorfunction:["asyncgeneratorfunction"]};function Oi(e,t){t&&v(this,"message",t),e=e.toLowerCase();var n=v(this,"object"),r=~["a","e","i","o","u"].indexOf(e.charAt(0))?"an ":"a ";let o=te(n).toLowerCase();Dc.function.includes(e)?this.assert(Dc[e].includes(o),"expected #{this} to be "+r+e,"expected #{this} not to be "+r+e):this.assert(e===o,"expected #{this} to be "+r+e,"expected #{this} not to be "+r+e)}x(Oi,"an");d.addChainableMethod("an",Oi);d.addChainableMethod("a",Oi);function Cl(e,t){return fr(e)&&fr(t)||e===t}x(Cl,"SameValueZero");function fn(){v(this,"contains",!0)}x(fn,"includeChainingBehavior");function hn(e,t){t&&v(this,"message",t);var n=v(this,"object"),r=te(n).toLowerCase(),o=v(this,"message"),i=v(this,"negate"),s=v(this,"ssfi"),a=v(this,"deep"),c=a?"deep ":"",l=a?v(this,"eql"):Cl;o=o?o+": ":"";var u=!1;switch(r){case"string":u=n.indexOf(e)!==-1;break;case"weakset":if(a)throw new Z(o+"unable to use .deep.include with WeakSet",void 0,s);u=n.has(e);break;case"map":n.forEach(function(g){u=u||l(g,e)});break;case"set":a?n.forEach(function(g){u=u||l(g,e)}):u=n.has(e);break;case"array":a?u=n.some(function(g){return l(g,e)}):u=n.indexOf(e)!==-1;break;default:if(e!==Object(e))throw new Z(o+"the given combination of arguments ("+r+" and "+te(e).toLowerCase()+") is invalid for this assertion. You can use an array, a map, an object, a set, a string, or a weakset instead of a "+te(e).toLowerCase(),void 0,s);var f=Object.keys(e),m=null,h=0;if(f.forEach(function(g){var y=new d(n);if(ze(this,y,!0),v(y,"lockSsfi",!0),!i||f.length===1){y.property(g,e[g]);return}try{y.property(g,e[g])}catch(w){if(!je.compatibleConstructor(w,Z))throw w;m===null&&(m=w),h++}},this),i&&f.length>1&&h===f.length)throw m;return}this.assert(u,"expected #{this} to "+c+"include "+Y(e),"expected #{this} to not "+c+"include "+Y(e))}x(hn,"include");d.addChainableMethod("include",hn,fn);d.addChainableMethod("contain",hn,fn);d.addChainableMethod("contains",hn,fn);d.addChainableMethod("includes",hn,fn);d.addProperty("ok",function(){this.assert(v(this,"object"),"expected #{this} to be truthy","expected #{this} to be falsy")});d.addProperty("true",function(){this.assert(v(this,"object")===!0,"expected #{this} to be true","expected #{this} to be false",!v(this,"negate"))});d.addProperty("numeric",function(){let e=v(this,"object");this.assert(["Number","BigInt"].includes(te(e)),"expected #{this} to be numeric","expected #{this} to not be numeric",!v(this,"negate"))});d.addProperty("callable",function(){let e=v(this,"object"),t=v(this,"ssfi"),n=v(this,"message"),r=n?`${n}: `:"",o=v(this,"negate"),i=o?`${r}expected ${Y(e)} not to be a callable function`:`${r}expected ${Y(e)} to be a callable function`,s=["Function","AsyncFunction","GeneratorFunction","AsyncGeneratorFunction"].includes(te(e));if(s&&o||!s&&!o)throw new Z(i,void 0,t)});d.addProperty("false",function(){this.assert(v(this,"object")===!1,"expected #{this} to be false","expected #{this} to be true",!!v(this,"negate"))});d.addProperty("null",function(){this.assert(v(this,"object")===null,"expected #{this} to be null","expected #{this} not to be null")});d.addProperty("undefined",function(){this.assert(v(this,"object")===void 0,"expected #{this} to be undefined","expected #{this} not to be undefined")});d.addProperty("NaN",function(){this.assert(fr(v(this,"object")),"expected #{this} to be NaN","expected #{this} not to be NaN")});function Ii(){var e=v(this,"object");this.assert(e!=null,"expected #{this} to exist","expected #{this} to not exist")}x(Ii,"assertExist");d.addProperty("exist",Ii);d.addProperty("exists",Ii);d.addProperty("empty",function(){var e=v(this,"object"),t=v(this,"ssfi"),n=v(this,"message"),r;switch(n=n?n+": ":"",te(e).toLowerCase()){case"array":case"string":r=e.length;break;case"map":case"set":r=e.size;break;case"weakmap":case"weakset":throw new Z(n+".empty was passed a weak collection",void 0,t);case"function":var o=n+".empty was passed a function "+gr(e);throw new Z(o.trim(),void 0,t);default:if(e!==Object(e))throw new Z(n+".empty was passed non-string primitive "+Y(e),void 0,t);r=Object.keys(e).length}this.assert(r===0,"expected #{this} to be empty","expected #{this} not to be empty")});function Ai(){var e=v(this,"object"),t=te(e);this.assert(t==="Arguments","expected #{this} to be arguments but got "+t,"expected #{this} to not be arguments")}x(Ai,"checkArguments");d.addProperty("arguments",Ai);d.addProperty("Arguments",Ai);function yr(e,t){t&&v(this,"message",t);var n=v(this,"object");if(v(this,"deep")){var r=v(this,"lockSsfi");v(this,"lockSsfi",!0),this.eql(e),v(this,"lockSsfi",r)}else this.assert(e===n,"expected #{this} to equal #{exp}","expected #{this} to not equal #{exp}",e,this._obj,!0)}x(yr,"assertEqual");d.addMethod("equal",yr);d.addMethod("equals",yr);d.addMethod("eq",yr);function $i(e,t){t&&v(this,"message",t);var n=v(this,"eql");this.assert(n(e,v(this,"object")),"expected #{this} to deeply equal #{exp}","expected #{this} to not deeply equal #{exp}",e,this._obj,!0)}x($i,"assertEql");d.addMethod("eql",$i);d.addMethod("eqls",$i);function br(e,t){t&&v(this,"message",t);var n=v(this,"object"),r=v(this,"doLength"),o=v(this,"message"),i=o?o+": ":"",s=v(this,"ssfi"),a=te(n).toLowerCase(),c=te(e).toLowerCase();if(r&&a!=="map"&&a!=="set"&&new d(n,o,s,!0).to.have.property("length"),!r&&a==="date"&&c!=="date")throw new Z(i+"the argument to above must be a date",void 0,s);if(!de(e)&&(r||de(n)))throw new Z(i+"the argument to above must be a number",void 0,s);if(!r&&a!=="date"&&!de(n)){var l=a==="string"?"'"+n+"'":n;throw new Z(i+"expected "+l+" to be a number or a date",void 0,s)}if(r){var u="length",f;a==="map"||a==="set"?(u="size",f=n.size):f=n.length,this.assert(f>e,"expected #{this} to have a "+u+" above #{exp} but got #{act}","expected #{this} to not have a "+u+" above #{exp}",e,f)}else this.assert(n>e,"expected #{this} to be above #{exp}","expected #{this} to be at most #{exp}",e)}x(br,"assertAbove");d.addMethod("above",br);d.addMethod("gt",br);d.addMethod("greaterThan",br);function wr(e,t){t&&v(this,"message",t);var n=v(this,"object"),r=v(this,"doLength"),o=v(this,"message"),i=o?o+": ":"",s=v(this,"ssfi"),a=te(n).toLowerCase(),c=te(e).toLowerCase(),l,u=!0;if(r&&a!=="map"&&a!=="set"&&new d(n,o,s,!0).to.have.property("length"),!r&&a==="date"&&c!=="date")l=i+"the argument to least must be a date";else if(!de(e)&&(r||de(n)))l=i+"the argument to least must be a number";else if(!r&&a!=="date"&&!de(n)){var f=a==="string"?"'"+n+"'":n;l=i+"expected "+f+" to be a number or a date"}else u=!1;if(u)throw new Z(l,void 0,s);if(r){var m="length",h;a==="map"||a==="set"?(m="size",h=n.size):h=n.length,this.assert(h>=e,"expected #{this} to have a "+m+" at least #{exp} but got #{act}","expected #{this} to have a "+m+" below #{exp}",e,h)}else this.assert(n>=e,"expected #{this} to be at least #{exp}","expected #{this} to be below #{exp}",e)}x(wr,"assertLeast");d.addMethod("least",wr);d.addMethod("gte",wr);d.addMethod("greaterThanOrEqual",wr);function vr(e,t){t&&v(this,"message",t);var n=v(this,"object"),r=v(this,"doLength"),o=v(this,"message"),i=o?o+": ":"",s=v(this,"ssfi"),a=te(n).toLowerCase(),c=te(e).toLowerCase(),l,u=!0;if(r&&a!=="map"&&a!=="set"&&new d(n,o,s,!0).to.have.property("length"),!r&&a==="date"&&c!=="date")l=i+"the argument to below must be a date";else if(!de(e)&&(r||de(n)))l=i+"the argument to below must be a number";else if(!r&&a!=="date"&&!de(n)){var f=a==="string"?"'"+n+"'":n;l=i+"expected "+f+" to be a number or a date"}else u=!1;if(u)throw new Z(l,void 0,s);if(r){var m="length",h;a==="map"||a==="set"?(m="size",h=n.size):h=n.length,this.assert(h<e,"expected #{this} to have a "+m+" below #{exp} but got #{act}","expected #{this} to not have a "+m+" below #{exp}",e,h)}else this.assert(n<e,"expected #{this} to be below #{exp}","expected #{this} to be at least #{exp}",e)}x(vr,"assertBelow");d.addMethod("below",vr);d.addMethod("lt",vr);d.addMethod("lessThan",vr);function Sr(e,t){t&&v(this,"message",t);var n=v(this,"object"),r=v(this,"doLength"),o=v(this,"message"),i=o?o+": ":"",s=v(this,"ssfi"),a=te(n).toLowerCase(),c=te(e).toLowerCase(),l,u=!0;if(r&&a!=="map"&&a!=="set"&&new d(n,o,s,!0).to.have.property("length"),!r&&a==="date"&&c!=="date")l=i+"the argument to most must be a date";else if(!de(e)&&(r||de(n)))l=i+"the argument to most must be a number";else if(!r&&a!=="date"&&!de(n)){var f=a==="string"?"'"+n+"'":n;l=i+"expected "+f+" to be a number or a date"}else u=!1;if(u)throw new Z(l,void 0,s);if(r){var m="length",h;a==="map"||a==="set"?(m="size",h=n.size):h=n.length,this.assert(h<=e,"expected #{this} to have a "+m+" at most #{exp} but got #{act}","expected #{this} to have a "+m+" above #{exp}",e,h)}else this.assert(n<=e,"expected #{this} to be at most #{exp}","expected #{this} to be above #{exp}",e)}x(Sr,"assertMost");d.addMethod("most",Sr);d.addMethod("lte",Sr);d.addMethod("lessThanOrEqual",Sr);d.addMethod("within",function(e,t,n){n&&v(this,"message",n);var r=v(this,"object"),o=v(this,"doLength"),i=v(this,"message"),s=i?i+": ":"",a=v(this,"ssfi"),c=te(r).toLowerCase(),l=te(e).toLowerCase(),u=te(t).toLowerCase(),f,m=!0,h=l==="date"&&u==="date"?e.toISOString()+".."+t.toISOString():e+".."+t;if(o&&c!=="map"&&c!=="set"&&new d(r,i,a,!0).to.have.property("length"),!o&&c==="date"&&(l!=="date"||u!=="date"))f=s+"the arguments to within must be dates";else if((!de(e)||!de(t))&&(o||de(r)))f=s+"the arguments to within must be numbers";else if(!o&&c!=="date"&&!de(r)){var g=c==="string"?"'"+r+"'":r;f=s+"expected "+g+" to be a number or a date"}else m=!1;if(m)throw new Z(f,void 0,a);if(o){var y="length",w;c==="map"||c==="set"?(y="size",w=r.size):w=r.length,this.assert(w>=e&&w<=t,"expected #{this} to have a "+y+" within "+h,"expected #{this} to not have a "+y+" within "+h)}else this.assert(r>=e&&r<=t,"expected #{this} to be within "+h,"expected #{this} to not be within "+h)});function ki(e,t){t&&v(this,"message",t);var n=v(this,"object"),r=v(this,"ssfi"),o=v(this,"message");try{var i=n instanceof e}catch(a){throw a instanceof TypeError?(o=o?o+": ":"",new Z(o+"The instanceof assertion needs a constructor but "+te(e)+" was given.",void 0,r)):a}var s=gr(e);s==null&&(s="an unnamed constructor"),this.assert(i,"expected #{this} to be an instance of "+s,"expected #{this} to not be an instance of "+s)}x(ki,"assertInstanceOf");d.addMethod("instanceof",ki);d.addMethod("instanceOf",ki);function Pi(e,t,n){n&&v(this,"message",n);var r=v(this,"nested"),o=v(this,"own"),i=v(this,"message"),s=v(this,"object"),a=v(this,"ssfi"),c=typeof e;if(i=i?i+": ":"",r){if(c!=="string")throw new Z(i+"the argument to property must be a string when using nested syntax",void 0,a)}else if(c!=="string"&&c!=="number"&&c!=="symbol")throw new Z(i+"the argument to property must be a string, number, or symbol",void 0,a);if(r&&o)throw new Z(i+'The "nested" and "own" flags cannot be combined.',void 0,a);if(s==null)throw new Z(i+"Target cannot be null or undefined.",void 0,a);var l=v(this,"deep"),u=v(this,"negate"),f=r?yi(s,e):null,m=r?f.value:s[e],h=l?v(this,"eql"):(w,E)=>w===E,g="";l&&(g+="deep "),o&&(g+="own "),r&&(g+="nested "),g+="property ";var y;o?y=Object.prototype.hasOwnProperty.call(s,e):r?y=f.exists:y=mr(s,e),(!u||arguments.length===1)&&this.assert(y,"expected #{this} to have "+g+Y(e),"expected #{this} to not have "+g+Y(e)),arguments.length>1&&this.assert(y&&h(t,m),"expected #{this} to have "+g+Y(e)+" of #{exp}, but got #{act}","expected #{this} to not have "+g+Y(e)+" of #{act}",t,m),v(this,"object",m)}x(Pi,"assertProperty");d.addMethod("property",Pi);function Ni(e,t,n){v(this,"own",!0),Pi.apply(this,arguments)}x(Ni,"assertOwnProperty");d.addMethod("ownProperty",Ni);d.addMethod("haveOwnProperty",Ni);function Mi(e,t,n){typeof t=="string"&&(n=t,t=null),n&&v(this,"message",n);var r=v(this,"object"),o=Object.getOwnPropertyDescriptor(Object(r),e),i=v(this,"eql");o&&t?this.assert(i(t,o),"expected the own property descriptor for "+Y(e)+" on #{this} to match "+Y(t)+", got "+Y(o),"expected the own property descriptor for "+Y(e)+" on #{this} to not match "+Y(t),t,o,!0):this.assert(o,"expected #{this} to have an own property descriptor for "+Y(e),"expected #{this} to not have an own property descriptor for "+Y(e)),v(this,"object",o)}x(Mi,"assertOwnPropertyDescriptor");d.addMethod("ownPropertyDescriptor",Mi);d.addMethod("haveOwnPropertyDescriptor",Mi);function ji(){v(this,"doLength",!0)}x(ji,"assertLengthChain");function Ri(e,t){t&&v(this,"message",t);var n=v(this,"object"),r=te(n).toLowerCase(),o=v(this,"message"),i=v(this,"ssfi"),s="length",a;switch(r){case"map":case"set":s="size",a=n.size;break;default:new d(n,o,i,!0).to.have.property("length"),a=n.length}this.assert(a==e,"expected #{this} to have a "+s+" of #{exp} but got #{act}","expected #{this} to not have a "+s+" of #{act}",e,a)}x(Ri,"assertLength");d.addChainableMethod("length",Ri,ji);d.addChainableMethod("lengthOf",Ri,ji);function Fi(e,t){t&&v(this,"message",t);var n=v(this,"object");this.assert(e.exec(n),"expected #{this} to match "+e,"expected #{this} not to match "+e)}x(Fi,"assertMatch");d.addMethod("match",Fi);d.addMethod("matches",Fi);d.addMethod("string",function(e,t){t&&v(this,"message",t);var n=v(this,"object"),r=v(this,"message"),o=v(this,"ssfi");new d(n,r,o,!0).is.a("string"),this.assert(~n.indexOf(e),"expected #{this} to contain "+Y(e),"expected #{this} to not contain "+Y(e))});function Li(e){var t=v(this,"object"),n=te(t),r=te(e),o=v(this,"ssfi"),i=v(this,"deep"),s,a="",c,l=!0,u=v(this,"message");u=u?u+": ":"";var f=u+"when testing keys against an object or an array you must give a single Array|Object|String argument or multiple String arguments";if(n==="Map"||n==="Set")a=i?"deeply ":"",c=[],t.forEach(function(_,O){c.push(O)}),r!=="Array"&&(e=Array.prototype.slice.call(arguments));else{switch(c=_i(t),r){case"Array":if(arguments.length>1)throw new Z(f,void 0,o);break;case"Object":if(arguments.length>1)throw new Z(f,void 0,o);e=Object.keys(e);break;default:e=Array.prototype.slice.call(arguments)}e=e.map(function(_){return typeof _=="symbol"?_:String(_)})}if(!e.length)throw new Z(u+"keys required",void 0,o);var m=e.length,h=v(this,"any"),g=v(this,"all"),y=e,w=i?v(this,"eql"):(_,O)=>_===O;if(!h&&!g&&(g=!0),h&&(l=y.some(function(_){return c.some(function(O){return w(_,O)})})),g&&(l=y.every(function(_){return c.some(function(O){return w(_,O)})}),v(this,"contains")||(l=l&&e.length==c.length)),m>1){e=e.map(function(_){return Y(_)});var E=e.pop();g&&(s=e.join(", ")+", and "+E),h&&(s=e.join(", ")+", or "+E)}else s=Y(e[0]);s=(m>1?"keys ":"key ")+s,s=(v(this,"contains")?"contain ":"have ")+s,this.assert(l,"expected #{this} to "+a+s,"expected #{this} to not "+a+s,y.slice(0).sort(ur),c.sort(ur),!0)}x(Li,"assertKeys");d.addMethod("keys",Li);d.addMethod("key",Li);function Er(e,t,n){n&&v(this,"message",n);var r=v(this,"object"),o=v(this,"ssfi"),i=v(this,"message"),s=v(this,"negate")||!1;new d(r,i,o,!0).is.a("function"),(hr(e)||typeof e=="string")&&(t=e,e=null);let a,c=!1;try{r()}catch(_){c=!0,a=_}var l=e===void 0&&t===void 0,u=!!(e&&t),f=!1,m=!1;if(l||!l&&!s){var h="an error";e instanceof Error?h="#{exp}":e&&(h=je.getConstructorName(e));let _=a;if(a instanceof Error)_=a.toString();else if(typeof a=="string")_=a;else if(a&&(typeof a=="object"||typeof a=="function"))try{_=je.getConstructorName(a)}catch{}this.assert(c,"expected #{this} to throw "+h,"expected #{this} to not throw an error but #{act} was thrown",e&&e.toString(),_)}if(e&&a){if(e instanceof Error){var g=je.compatibleInstance(a,e);g===s&&(u&&s?f=!0:this.assert(s,"expected #{this} to throw #{exp} but #{act} was thrown","expected #{this} to not throw #{exp}"+(a&&!s?" but #{act} was thrown":""),e.toString(),a.toString()))}var y=je.compatibleConstructor(a,e);y===s&&(u&&s?f=!0:this.assert(s,"expected #{this} to throw #{exp} but #{act} was thrown","expected #{this} to not throw #{exp}"+(a?" but #{act} was thrown":""),e instanceof Error?e.toString():e&&je.getConstructorName(e),a instanceof Error?a.toString():a&&je.getConstructorName(a)))}if(a&&t!==void 0&&t!==null){var w="including";hr(t)&&(w="matching");var E=je.compatibleMessage(a,t);E===s&&(u&&s?m=!0:this.assert(s,"expected #{this} to throw error "+w+" #{exp} but got #{act}","expected #{this} to throw error not "+w+" #{exp}",t,je.getMessage(a)))}f&&m&&this.assert(s,"expected #{this} to throw #{exp} but #{act} was thrown","expected #{this} to not throw #{exp}"+(a?" but #{act} was thrown":""),e instanceof Error?e.toString():e&&je.getConstructorName(e),a instanceof Error?a.toString():a&&je.getConstructorName(a)),v(this,"object",a)}x(Er,"assertThrows");d.addMethod("throw",Er);d.addMethod("throws",Er);d.addMethod("Throw",Er);function Di(e,t){t&&v(this,"message",t);var n=v(this,"object"),r=v(this,"itself"),o=typeof n=="function"&&!r?n.prototype[e]:n[e];this.assert(typeof o=="function","expected #{this} to respond to "+Y(e),"expected #{this} to not respond to "+Y(e))}x(Di,"respondTo");d.addMethod("respondTo",Di);d.addMethod("respondsTo",Di);d.addProperty("itself",function(){v(this,"itself",!0)});function qi(e,t){t&&v(this,"message",t);var n=v(this,"object"),r=e(n);this.assert(r,"expected #{this} to satisfy "+xt(e),"expected #{this} to not satisfy"+xt(e),!v(this,"negate"),r)}x(qi,"satisfy");d.addMethod("satisfy",qi);d.addMethod("satisfies",qi);function Bi(e,t,n){n&&v(this,"message",n);var r=v(this,"object"),o=v(this,"message"),i=v(this,"ssfi");new d(r,o,i,!0).is.numeric;let s="A `delta` value is required for `closeTo`";if(t==null)throw new Z(o?`${o}: ${s}`:s,void 0,i);if(new d(t,o,i,!0).is.numeric,s="A `expected` value is required for `closeTo`",e==null)throw new Z(o?`${o}: ${s}`:s,void 0,i);new d(e,o,i,!0).is.numeric;let a=x(c=>c<0n?-c:c,"abs");this.assert(a(r-e)<=t,"expected #{this} to be close to "+e+" +/- "+t,"expected #{this} not to be close to "+e+" +/- "+t)}x(Bi,"closeTo");d.addMethod("closeTo",Bi);d.addMethod("approximately",Bi);function Ol(e,t,n,r,o){let i=Array.from(t),s=Array.from(e);if(!r){if(s.length!==i.length)return!1;i=i.slice()}return s.every(function(a,c){if(o)return n?n(a,i[c]):a===i[c];if(!n){var l=i.indexOf(a);return l===-1?!1:(r||i.splice(l,1),!0)}return i.some(function(u,f){return n(a,u)?(r||i.splice(f,1),!0):!1})})}x(Ol,"isSubsetOf");d.addMethod("members",function(e,t){t&&v(this,"message",t);var n=v(this,"object"),r=v(this,"message"),o=v(this,"ssfi");new d(n,r,o,!0).to.be.iterable,new d(e,r,o,!0).to.be.iterable;var i=v(this,"contains"),s=v(this,"ordered"),a,c,l;i?(a=s?"an ordered superset":"a superset",c="expected #{this} to be "+a+" of #{exp}",l="expected #{this} to not be "+a+" of #{exp}"):(a=s?"ordered members":"members",c="expected #{this} to have the same "+a+" as #{exp}",l="expected #{this} to not have the same "+a+" as #{exp}");var u=v(this,"deep")?v(this,"eql"):void 0;this.assert(Ol(e,n,u,i,s),c,l,e,n,!0)});d.addProperty("iterable",function(e){e&&v(this,"message",e);var t=v(this,"object");this.assert(t!=null&&t[Symbol.iterator],"expected #{this} to be an iterable","expected #{this} to not be an iterable",t)});function Il(e,t){t&&v(this,"message",t);var n=v(this,"object"),r=v(this,"message"),o=v(this,"ssfi"),i=v(this,"contains"),s=v(this,"deep"),a=v(this,"eql");new d(e,r,o,!0).to.be.an("array"),i?this.assert(e.some(function(c){return n.indexOf(c)>-1}),"expected #{this} to contain one of #{exp}","expected #{this} to not contain one of #{exp}",e,n):s?this.assert(e.some(function(c){return a(n,c)}),"expected #{this} to deeply equal one of #{exp}","expected #{this} to deeply equal one of #{exp}",e,n):this.assert(e.indexOf(n)>-1,"expected #{this} to be one of #{exp}","expected #{this} to not be one of #{exp}",e,n)}x(Il,"oneOf");d.addMethod("oneOf",Il);function zi(e,t,n){n&&v(this,"message",n);var r=v(this,"object"),o=v(this,"message"),i=v(this,"ssfi");new d(r,o,i,!0).is.a("function");var s;t?(new d(e,o,i,!0).to.have.property(t),s=e[t]):(new d(e,o,i,!0).is.a("function"),s=e()),r();var a=t==null?e():e[t],c=t==null?s:"."+t;v(this,"deltaMsgObj",c),v(this,"initialDeltaValue",s),v(this,"finalDeltaValue",a),v(this,"deltaBehavior","change"),v(this,"realDelta",a!==s),this.assert(s!==a,"expected "+c+" to change","expected "+c+" to not change")}x(zi,"assertChanges");d.addMethod("change",zi);d.addMethod("changes",zi);function Wi(e,t,n){n&&v(this,"message",n);var r=v(this,"object"),o=v(this,"message"),i=v(this,"ssfi");new d(r,o,i,!0).is.a("function");var s;t?(new d(e,o,i,!0).to.have.property(t),s=e[t]):(new d(e,o,i,!0).is.a("function"),s=e()),new d(s,o,i,!0).is.a("number"),r();var a=t==null?e():e[t],c=t==null?s:"."+t;v(this,"deltaMsgObj",c),v(this,"initialDeltaValue",s),v(this,"finalDeltaValue",a),v(this,"deltaBehavior","increase"),v(this,"realDelta",a-s),this.assert(a-s>0,"expected "+c+" to increase","expected "+c+" to not increase")}x(Wi,"assertIncreases");d.addMethod("increase",Wi);d.addMethod("increases",Wi);function Ui(e,t,n){n&&v(this,"message",n);var r=v(this,"object"),o=v(this,"message"),i=v(this,"ssfi");new d(r,o,i,!0).is.a("function");var s;t?(new d(e,o,i,!0).to.have.property(t),s=e[t]):(new d(e,o,i,!0).is.a("function"),s=e()),new d(s,o,i,!0).is.a("number"),r();var a=t==null?e():e[t],c=t==null?s:"."+t;v(this,"deltaMsgObj",c),v(this,"initialDeltaValue",s),v(this,"finalDeltaValue",a),v(this,"deltaBehavior","decrease"),v(this,"realDelta",s-a),this.assert(a-s<0,"expected "+c+" to decrease","expected "+c+" to not decrease")}x(Ui,"assertDecreases");d.addMethod("decrease",Ui);d.addMethod("decreases",Ui);function Al(e,t){t&&v(this,"message",t);var n=v(this,"deltaMsgObj"),r=v(this,"initialDeltaValue"),o=v(this,"finalDeltaValue"),i=v(this,"deltaBehavior"),s=v(this,"realDelta"),a;i==="change"?a=Math.abs(o-r)===Math.abs(e):a=s===Math.abs(e),this.assert(a,"expected "+n+" to "+i+" by "+e,"expected "+n+" to not "+i+" by "+e)}x(Al,"assertDelta");d.addMethod("by",Al);d.addProperty("extensible",function(){var e=v(this,"object"),t=e===Object(e)&&Object.isExtensible(e);this.assert(t,"expected #{this} to be extensible","expected #{this} to not be extensible")});d.addProperty("sealed",function(){var e=v(this,"object"),t=e===Object(e)?Object.isSealed(e):!0;this.assert(t,"expected #{this} to be sealed","expected #{this} to not be sealed")});d.addProperty("frozen",function(){var e=v(this,"object"),t=e===Object(e)?Object.isFrozen(e):!0;this.assert(t,"expected #{this} to be frozen","expected #{this} to not be frozen")});d.addProperty("finite",function(e){var t=v(this,"object");this.assert(typeof t=="number"&&isFinite(t),"expected #{this} to be a finite number","expected #{this} to not be a finite number")});function pt(e,t){return new d(e,t)}x(pt,"expect");pt.fail=function(e,t,n,r){throw arguments.length<2&&(n=e,e=void 0),n=n||"expect.fail()",new Z(n,{actual:e,expected:t,operator:r},pt.fail)};var $l={};ui($l,{Should:()=>Yd,should:()=>kl});function Vi(){function e(){return this instanceof String||this instanceof Number||this instanceof Boolean||typeof Symbol=="function"&&this instanceof Symbol||typeof BigInt=="function"&&this instanceof BigInt?new d(this.valueOf(),null,e):new d(this,null,e)}x(e,"shouldGetter");function t(r){Object.defineProperty(this,"should",{value:r,enumerable:!0,configurable:!0,writable:!0})}x(t,"shouldSetter"),Object.defineProperty(Object.prototype,"should",{set:t,get:e,configurable:!0});var n={};return n.fail=function(r,o,i,s){throw arguments.length<2&&(i=r,r=void 0),i=i||"should.fail()",new Z(i,{actual:r,expected:o,operator:s},n.fail)},n.equal=function(r,o,i){new d(r,i).to.equal(o)},n.Throw=function(r,o,i,s){new d(r,s).to.Throw(o,i)},n.exist=function(r,o){new d(r,o).to.exist},n.not={},n.not.equal=function(r,o,i){new d(r,i).to.not.equal(o)},n.not.Throw=function(r,o,i,s){new d(r,s).to.not.Throw(o,i)},n.not.exist=function(r,o){new d(r,o).to.not.exist},n.throw=n.Throw,n.not.throw=n.not.Throw,n}x(Vi,"loadShould");var kl=Vi,Yd=Vi;function p(e,t){var n=new d(null,null,p,!0);n.assert(e,t,"[ negation message unavailable ]")}x(p,"assert");p.fail=function(e,t,n,r){throw arguments.length<2&&(n=e,e=void 0),n=n||"assert.fail()",new Z(n,{actual:e,expected:t,operator:r},p.fail)};p.isOk=function(e,t){new d(e,t,p.isOk,!0).is.ok};p.isNotOk=function(e,t){new d(e,t,p.isNotOk,!0).is.not.ok};p.equal=function(e,t,n){var r=new d(e,n,p.equal,!0);r.assert(t==U(r,"object"),"expected #{this} to equal #{exp}","expected #{this} to not equal #{act}",t,e,!0)};p.notEqual=function(e,t,n){var r=new d(e,n,p.notEqual,!0);r.assert(t!=U(r,"object"),"expected #{this} to not equal #{exp}","expected #{this} to equal #{act}",t,e,!0)};p.strictEqual=function(e,t,n){new d(e,n,p.strictEqual,!0).to.equal(t)};p.notStrictEqual=function(e,t,n){new d(e,n,p.notStrictEqual,!0).to.not.equal(t)};p.deepEqual=p.deepStrictEqual=function(e,t,n){new d(e,n,p.deepEqual,!0).to.eql(t)};p.notDeepEqual=function(e,t,n){new d(e,n,p.notDeepEqual,!0).to.not.eql(t)};p.isAbove=function(e,t,n){new d(e,n,p.isAbove,!0).to.be.above(t)};p.isAtLeast=function(e,t,n){new d(e,n,p.isAtLeast,!0).to.be.least(t)};p.isBelow=function(e,t,n){new d(e,n,p.isBelow,!0).to.be.below(t)};p.isAtMost=function(e,t,n){new d(e,n,p.isAtMost,!0).to.be.most(t)};p.isTrue=function(e,t){new d(e,t,p.isTrue,!0).is.true};p.isNotTrue=function(e,t){new d(e,t,p.isNotTrue,!0).to.not.equal(!0)};p.isFalse=function(e,t){new d(e,t,p.isFalse,!0).is.false};p.isNotFalse=function(e,t){new d(e,t,p.isNotFalse,!0).to.not.equal(!1)};p.isNull=function(e,t){new d(e,t,p.isNull,!0).to.equal(null)};p.isNotNull=function(e,t){new d(e,t,p.isNotNull,!0).to.not.equal(null)};p.isNaN=function(e,t){new d(e,t,p.isNaN,!0).to.be.NaN};p.isNotNaN=function(e,t){new d(e,t,p.isNotNaN,!0).not.to.be.NaN};p.exists=function(e,t){new d(e,t,p.exists,!0).to.exist};p.notExists=function(e,t){new d(e,t,p.notExists,!0).to.not.exist};p.isUndefined=function(e,t){new d(e,t,p.isUndefined,!0).to.equal(void 0)};p.isDefined=function(e,t){new d(e,t,p.isDefined,!0).to.not.equal(void 0)};p.isCallable=function(e,t){new d(e,t,p.isCallable,!0).is.callable};p.isNotCallable=function(e,t){new d(e,t,p.isNotCallable,!0).is.not.callable};p.isObject=function(e,t){new d(e,t,p.isObject,!0).to.be.a("object")};p.isNotObject=function(e,t){new d(e,t,p.isNotObject,!0).to.not.be.a("object")};p.isArray=function(e,t){new d(e,t,p.isArray,!0).to.be.an("array")};p.isNotArray=function(e,t){new d(e,t,p.isNotArray,!0).to.not.be.an("array")};p.isString=function(e,t){new d(e,t,p.isString,!0).to.be.a("string")};p.isNotString=function(e,t){new d(e,t,p.isNotString,!0).to.not.be.a("string")};p.isNumber=function(e,t){new d(e,t,p.isNumber,!0).to.be.a("number")};p.isNotNumber=function(e,t){new d(e,t,p.isNotNumber,!0).to.not.be.a("number")};p.isNumeric=function(e,t){new d(e,t,p.isNumeric,!0).is.numeric};p.isNotNumeric=function(e,t){new d(e,t,p.isNotNumeric,!0).is.not.numeric};p.isFinite=function(e,t){new d(e,t,p.isFinite,!0).to.be.finite};p.isBoolean=function(e,t){new d(e,t,p.isBoolean,!0).to.be.a("boolean")};p.isNotBoolean=function(e,t){new d(e,t,p.isNotBoolean,!0).to.not.be.a("boolean")};p.typeOf=function(e,t,n){new d(e,n,p.typeOf,!0).to.be.a(t)};p.notTypeOf=function(e,t,n){new d(e,n,p.notTypeOf,!0).to.not.be.a(t)};p.instanceOf=function(e,t,n){new d(e,n,p.instanceOf,!0).to.be.instanceOf(t)};p.notInstanceOf=function(e,t,n){new d(e,n,p.notInstanceOf,!0).to.not.be.instanceOf(t)};p.include=function(e,t,n){new d(e,n,p.include,!0).include(t)};p.notInclude=function(e,t,n){new d(e,n,p.notInclude,!0).not.include(t)};p.deepInclude=function(e,t,n){new d(e,n,p.deepInclude,!0).deep.include(t)};p.notDeepInclude=function(e,t,n){new d(e,n,p.notDeepInclude,!0).not.deep.include(t)};p.nestedInclude=function(e,t,n){new d(e,n,p.nestedInclude,!0).nested.include(t)};p.notNestedInclude=function(e,t,n){new d(e,n,p.notNestedInclude,!0).not.nested.include(t)};p.deepNestedInclude=function(e,t,n){new d(e,n,p.deepNestedInclude,!0).deep.nested.include(t)};p.notDeepNestedInclude=function(e,t,n){new d(e,n,p.notDeepNestedInclude,!0).not.deep.nested.include(t)};p.ownInclude=function(e,t,n){new d(e,n,p.ownInclude,!0).own.include(t)};p.notOwnInclude=function(e,t,n){new d(e,n,p.notOwnInclude,!0).not.own.include(t)};p.deepOwnInclude=function(e,t,n){new d(e,n,p.deepOwnInclude,!0).deep.own.include(t)};p.notDeepOwnInclude=function(e,t,n){new d(e,n,p.notDeepOwnInclude,!0).not.deep.own.include(t)};p.match=function(e,t,n){new d(e,n,p.match,!0).to.match(t)};p.notMatch=function(e,t,n){new d(e,n,p.notMatch,!0).to.not.match(t)};p.property=function(e,t,n){new d(e,n,p.property,!0).to.have.property(t)};p.notProperty=function(e,t,n){new d(e,n,p.notProperty,!0).to.not.have.property(t)};p.propertyVal=function(e,t,n,r){new d(e,r,p.propertyVal,!0).to.have.property(t,n)};p.notPropertyVal=function(e,t,n,r){new d(e,r,p.notPropertyVal,!0).to.not.have.property(t,n)};p.deepPropertyVal=function(e,t,n,r){new d(e,r,p.deepPropertyVal,!0).to.have.deep.property(t,n)};p.notDeepPropertyVal=function(e,t,n,r){new d(e,r,p.notDeepPropertyVal,!0).to.not.have.deep.property(t,n)};p.ownProperty=function(e,t,n){new d(e,n,p.ownProperty,!0).to.have.own.property(t)};p.notOwnProperty=function(e,t,n){new d(e,n,p.notOwnProperty,!0).to.not.have.own.property(t)};p.ownPropertyVal=function(e,t,n,r){new d(e,r,p.ownPropertyVal,!0).to.have.own.property(t,n)};p.notOwnPropertyVal=function(e,t,n,r){new d(e,r,p.notOwnPropertyVal,!0).to.not.have.own.property(t,n)};p.deepOwnPropertyVal=function(e,t,n,r){new d(e,r,p.deepOwnPropertyVal,!0).to.have.deep.own.property(t,n)};p.notDeepOwnPropertyVal=function(e,t,n,r){new d(e,r,p.notDeepOwnPropertyVal,!0).to.not.have.deep.own.property(t,n)};p.nestedProperty=function(e,t,n){new d(e,n,p.nestedProperty,!0).to.have.nested.property(t)};p.notNestedProperty=function(e,t,n){new d(e,n,p.notNestedProperty,!0).to.not.have.nested.property(t)};p.nestedPropertyVal=function(e,t,n,r){new d(e,r,p.nestedPropertyVal,!0).to.have.nested.property(t,n)};p.notNestedPropertyVal=function(e,t,n,r){new d(e,r,p.notNestedPropertyVal,!0).to.not.have.nested.property(t,n)};p.deepNestedPropertyVal=function(e,t,n,r){new d(e,r,p.deepNestedPropertyVal,!0).to.have.deep.nested.property(t,n)};p.notDeepNestedPropertyVal=function(e,t,n,r){new d(e,r,p.notDeepNestedPropertyVal,!0).to.not.have.deep.nested.property(t,n)};p.lengthOf=function(e,t,n){new d(e,n,p.lengthOf,!0).to.have.lengthOf(t)};p.hasAnyKeys=function(e,t,n){new d(e,n,p.hasAnyKeys,!0).to.have.any.keys(t)};p.hasAllKeys=function(e,t,n){new d(e,n,p.hasAllKeys,!0).to.have.all.keys(t)};p.containsAllKeys=function(e,t,n){new d(e,n,p.containsAllKeys,!0).to.contain.all.keys(t)};p.doesNotHaveAnyKeys=function(e,t,n){new d(e,n,p.doesNotHaveAnyKeys,!0).to.not.have.any.keys(t)};p.doesNotHaveAllKeys=function(e,t,n){new d(e,n,p.doesNotHaveAllKeys,!0).to.not.have.all.keys(t)};p.hasAnyDeepKeys=function(e,t,n){new d(e,n,p.hasAnyDeepKeys,!0).to.have.any.deep.keys(t)};p.hasAllDeepKeys=function(e,t,n){new d(e,n,p.hasAllDeepKeys,!0).to.have.all.deep.keys(t)};p.containsAllDeepKeys=function(e,t,n){new d(e,n,p.containsAllDeepKeys,!0).to.contain.all.deep.keys(t)};p.doesNotHaveAnyDeepKeys=function(e,t,n){new d(e,n,p.doesNotHaveAnyDeepKeys,!0).to.not.have.any.deep.keys(t)};p.doesNotHaveAllDeepKeys=function(e,t,n){new d(e,n,p.doesNotHaveAllDeepKeys,!0).to.not.have.all.deep.keys(t)};p.throws=function(e,t,n,r){(typeof t=="string"||t instanceof RegExp)&&(n=t,t=null);var o=new d(e,r,p.throws,!0).to.throw(t,n);return U(o,"object")};p.doesNotThrow=function(e,t,n,r){(typeof t=="string"||t instanceof RegExp)&&(n=t,t=null),new d(e,r,p.doesNotThrow,!0).to.not.throw(t,n)};p.operator=function(e,t,n,r){var o;switch(t){case"==":o=e==n;break;case"===":o=e===n;break;case">":o=e>n;break;case">=":o=e>=n;break;case"<":o=e<n;break;case"<=":o=e<=n;break;case"!=":o=e!=n;break;case"!==":o=e!==n;break;default:throw r=r&&r+": ",new Z(r+'Invalid operator "'+t+'"',void 0,p.operator)}var i=new d(o,r,p.operator,!0);i.assert(U(i,"object")===!0,"expected "+Y(e)+" to be "+t+" "+Y(n),"expected "+Y(e)+" to not be "+t+" "+Y(n))};p.closeTo=function(e,t,n,r){new d(e,r,p.closeTo,!0).to.be.closeTo(t,n)};p.approximately=function(e,t,n,r){new d(e,r,p.approximately,!0).to.be.approximately(t,n)};p.sameMembers=function(e,t,n){new d(e,n,p.sameMembers,!0).to.have.same.members(t)};p.notSameMembers=function(e,t,n){new d(e,n,p.notSameMembers,!0).to.not.have.same.members(t)};p.sameDeepMembers=function(e,t,n){new d(e,n,p.sameDeepMembers,!0).to.have.same.deep.members(t)};p.notSameDeepMembers=function(e,t,n){new d(e,n,p.notSameDeepMembers,!0).to.not.have.same.deep.members(t)};p.sameOrderedMembers=function(e,t,n){new d(e,n,p.sameOrderedMembers,!0).to.have.same.ordered.members(t)};p.notSameOrderedMembers=function(e,t,n){new d(e,n,p.notSameOrderedMembers,!0).to.not.have.same.ordered.members(t)};p.sameDeepOrderedMembers=function(e,t,n){new d(e,n,p.sameDeepOrderedMembers,!0).to.have.same.deep.ordered.members(t)};p.notSameDeepOrderedMembers=function(e,t,n){new d(e,n,p.notSameDeepOrderedMembers,!0).to.not.have.same.deep.ordered.members(t)};p.includeMembers=function(e,t,n){new d(e,n,p.includeMembers,!0).to.include.members(t)};p.notIncludeMembers=function(e,t,n){new d(e,n,p.notIncludeMembers,!0).to.not.include.members(t)};p.includeDeepMembers=function(e,t,n){new d(e,n,p.includeDeepMembers,!0).to.include.deep.members(t)};p.notIncludeDeepMembers=function(e,t,n){new d(e,n,p.notIncludeDeepMembers,!0).to.not.include.deep.members(t)};p.includeOrderedMembers=function(e,t,n){new d(e,n,p.includeOrderedMembers,!0).to.include.ordered.members(t)};p.notIncludeOrderedMembers=function(e,t,n){new d(e,n,p.notIncludeOrderedMembers,!0).to.not.include.ordered.members(t)};p.includeDeepOrderedMembers=function(e,t,n){new d(e,n,p.includeDeepOrderedMembers,!0).to.include.deep.ordered.members(t)};p.notIncludeDeepOrderedMembers=function(e,t,n){new d(e,n,p.notIncludeDeepOrderedMembers,!0).to.not.include.deep.ordered.members(t)};p.oneOf=function(e,t,n){new d(e,n,p.oneOf,!0).to.be.oneOf(t)};p.isIterable=function(e,t){if(e==null||!e[Symbol.iterator])throw t=t?`${t} expected ${Y(e)} to be an iterable`:`expected ${Y(e)} to be an iterable`,new Z(t,void 0,p.isIterable)};p.changes=function(e,t,n,r){arguments.length===3&&typeof t=="function"&&(r=n,n=null),new d(e,r,p.changes,!0).to.change(t,n)};p.changesBy=function(e,t,n,r,o){if(arguments.length===4&&typeof t=="function"){var i=r;r=n,o=i}else arguments.length===3&&(r=n,n=null);new d(e,o,p.changesBy,!0).to.change(t,n).by(r)};p.doesNotChange=function(e,t,n,r){return arguments.length===3&&typeof t=="function"&&(r=n,n=null),new d(e,r,p.doesNotChange,!0).to.not.change(t,n)};p.changesButNotBy=function(e,t,n,r,o){if(arguments.length===4&&typeof t=="function"){var i=r;r=n,o=i}else arguments.length===3&&(r=n,n=null);new d(e,o,p.changesButNotBy,!0).to.change(t,n).but.not.by(r)};p.increases=function(e,t,n,r){return arguments.length===3&&typeof t=="function"&&(r=n,n=null),new d(e,r,p.increases,!0).to.increase(t,n)};p.increasesBy=function(e,t,n,r,o){if(arguments.length===4&&typeof t=="function"){var i=r;r=n,o=i}else arguments.length===3&&(r=n,n=null);new d(e,o,p.increasesBy,!0).to.increase(t,n).by(r)};p.doesNotIncrease=function(e,t,n,r){return arguments.length===3&&typeof t=="function"&&(r=n,n=null),new d(e,r,p.doesNotIncrease,!0).to.not.increase(t,n)};p.increasesButNotBy=function(e,t,n,r,o){if(arguments.length===4&&typeof t=="function"){var i=r;r=n,o=i}else arguments.length===3&&(r=n,n=null);new d(e,o,p.increasesButNotBy,!0).to.increase(t,n).but.not.by(r)};p.decreases=function(e,t,n,r){return arguments.length===3&&typeof t=="function"&&(r=n,n=null),new d(e,r,p.decreases,!0).to.decrease(t,n)};p.decreasesBy=function(e,t,n,r,o){if(arguments.length===4&&typeof t=="function"){var i=r;r=n,o=i}else arguments.length===3&&(r=n,n=null);new d(e,o,p.decreasesBy,!0).to.decrease(t,n).by(r)};p.doesNotDecrease=function(e,t,n,r){return arguments.length===3&&typeof t=="function"&&(r=n,n=null),new d(e,r,p.doesNotDecrease,!0).to.not.decrease(t,n)};p.doesNotDecreaseBy=function(e,t,n,r,o){if(arguments.length===4&&typeof t=="function"){var i=r;r=n,o=i}else arguments.length===3&&(r=n,n=null);return new d(e,o,p.doesNotDecreaseBy,!0).to.not.decrease(t,n).by(r)};p.decreasesButNotBy=function(e,t,n,r,o){if(arguments.length===4&&typeof t=="function"){var i=r;r=n,o=i}else arguments.length===3&&(r=n,n=null);new d(e,o,p.decreasesButNotBy,!0).to.decrease(t,n).but.not.by(r)};p.ifError=function(e){if(e)throw e};p.isExtensible=function(e,t){new d(e,t,p.isExtensible,!0).to.be.extensible};p.isNotExtensible=function(e,t){new d(e,t,p.isNotExtensible,!0).to.not.be.extensible};p.isSealed=function(e,t){new d(e,t,p.isSealed,!0).to.be.sealed};p.isNotSealed=function(e,t){new d(e,t,p.isNotSealed,!0).to.not.be.sealed};p.isFrozen=function(e,t){new d(e,t,p.isFrozen,!0).to.be.frozen};p.isNotFrozen=function(e,t){new d(e,t,p.isNotFrozen,!0).to.not.be.frozen};p.isEmpty=function(e,t){new d(e,t,p.isEmpty,!0).to.be.empty};p.isNotEmpty=function(e,t){new d(e,t,p.isNotEmpty,!0).to.not.be.empty};x(function e(t,n){return p[n]=p[t],e},"alias")("isOk","ok")("isNotOk","notOk")("throws","throw")("throws","Throw")("isExtensible","extensible")("isNotExtensible","notExtensible")("isSealed","sealed")("isNotSealed","notSealed")("isFrozen","frozen")("isNotFrozen","notFrozen")("isEmpty","empty")("isNotEmpty","notEmpty")("isCallable","isFunction")("isNotCallable","isNotFunction");var qc=[];function ot(e){let t={AssertionError:Z,util:we,config:$e,expect:pt,assert:p,Assertion:d,...$l};return~qc.indexOf(e)||(e(t,we),qc.push(e)),t}x(ot,"use");var Tr=Symbol.for("matchers-object"),dn=Symbol.for("$$jest-matchers-object"),mn=Symbol.for("expect-global"),kr=Symbol.for("asymmetric-matchers-object"),xr=re.green,Gi=re.red,Zd=re.inverse,Qd=re.bold,dt=re.dim;function em(e,t="received",n="expected",r={}){let{comment:o="",isDirectExpectCall:i=!1,isNot:s=!1,promise:a="",secondArgument:c="",expectedColor:l=xr,receivedColor:u=Gi,secondArgumentColor:f=xr}=r,m="",h="expect";return!i&&t!==""&&(m+=dt(`${h}(`)+u(t),h=")"),a!==""&&(m+=dt(`${h}.`)+a,h=""),s&&(m+=`${dt(`${h}.`)}not`,h=""),e.includes(".")?h+=e:(m+=dt(`${h}.`)+e,h=""),n===""?h+="()":(m+=dt(`${h}(`)+l(n),c&&(m+=dt(", ")+f(c)),h=")"),o!==""&&(h+=` // ${o}`),h!==""&&(m+=dt(h)),m}var tm="\xB7";function zl(e){return e.replace(/\s+$/gm,t=>tm.repeat(t.length))}function nm(e){return Gi(zl(Te(e)))}function rm(e){return xr(zl(Te(e)))}function Wl(){return{EXPECTED_COLOR:xr,RECEIVED_COLOR:Gi,INVERTED_COLOR:Zd,BOLD_WEIGHT:Qd,DIM_COLOR:dt,diff:Tt,matcherHint:em,printReceived:nm,printExpected:rm,printDiffOrStringify:rr}}function Ul(e){if(!Array.isArray(e))throw new TypeError(`expect.customEqualityTesters: Must be set to an array of Testers. Was given "${St(e)}"`);globalThis[dn].customEqualityTesters.push(...e)}function Yi(){return globalThis[dn].customEqualityTesters}function H(e,t,n,r){return n=n||[],Vl(e,t,[],[],n,r?Jl:im)}var qv=Function.prototype.toString;function Nl(e){return!!e&&typeof e=="object"&&"asymmetricMatch"in e&&We("Function",e.asymmetricMatch)}function om(e,t){let n=Nl(e),r=Nl(t);if(!(n&&r)){if(n)return e.asymmetricMatch(t);if(r)return t.asymmetricMatch(e)}}function Vl(e,t,n,r,o,i){let s=!0,a=om(e,t);if(a!==void 0)return a;let c={equals:H};for(let g=0;g<o.length;g++){let y=o[g].call(c,e,t,o);if(y!==void 0)return y}if(e instanceof Error&&t instanceof Error)return e.message===t.message;if(typeof URL=="function"&&e instanceof URL&&t instanceof URL)return e.href===t.href;if(Object.is(e,t))return!0;if(e===null||t===null)return e===t;let l=Object.prototype.toString.call(e);if(l!==Object.prototype.toString.call(t))return!1;switch(l){case"[object Boolean]":case"[object String]":case"[object Number]":return typeof e!=typeof t?!1:typeof e!="object"&&typeof t!="object"?Object.is(e,t):Object.is(e.valueOf(),t.valueOf());case"[object Date]":{let g=+e,y=+t;return g===y||Number.isNaN(g)&&Number.isNaN(y)}case"[object RegExp]":return e.source===t.source&&e.flags===t.flags}if(typeof e!="object"||typeof t!="object")return!1;if(jl(e)&&jl(t))return e.isEqualNode(t);let u=n.length;for(;u--;){if(n[u]===e)return r[u]===t;if(r[u]===t)return!1}if(n.push(e),r.push(t),l==="[object Array]"&&e.length!==t.length)return!1;let f=Ml(e,i),m,h=f.length;if(Ml(t,i).length!==h)return!1;for(;h--;)if(m=f[h],s=i(t,m)&&Vl(e[m],t[m],n,r,o,i),!s)return!1;return n.pop(),r.pop(),s}function Ml(e,t){let n=[];for(let r in e)t(e,r)&&n.push(r);return n.concat(Object.getOwnPropertySymbols(e).filter(r=>Object.getOwnPropertyDescriptor(e,r).enumerable))}function im(e,t){return Jl(e,t)&&e[t]!==void 0}function Jl(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function We(e,t){return Object.prototype.toString.apply(t)===`[object ${e}]`}function jl(e){return e!==null&&typeof e=="object"&&"nodeType"in e&&typeof e.nodeType=="number"&&"nodeName"in e&&typeof e.nodeName=="string"&&"isEqualNode"in e&&typeof e.isEqualNode=="function"}var Kl="@@__IMMUTABLE_KEYED__@@",Xl="@@__IMMUTABLE_SET__@@",sm="@@__IMMUTABLE_LIST__@@",Pr="@@__IMMUTABLE_ORDERED__@@",am="@@__IMMUTABLE_RECORD__@@";function cm(e){return!!(e&&e[Kl]&&!e[Pr])}function lm(e){return!!(e&&e[Xl]&&!e[Pr])}function Nr(e){return e!=null&&typeof e=="object"&&!Array.isArray(e)}function um(e){return!!(e&&Nr(e)&&e[sm])}function fm(e){return!!(e&&Nr(e)&&e[Kl]&&e[Pr])}function hm(e){return!!(e&&Nr(e)&&e[Xl]&&e[Pr])}function pm(e){return!!(e&&Nr(e)&&e[am])}var Hl=Symbol.iterator;function Rl(e){return!!(e!=null&&e[Hl])}function Oe(e,t,n=[],r=[],o=[]){if(typeof e!="object"||typeof t!="object"||Array.isArray(e)||Array.isArray(t)||!Rl(e)||!Rl(t))return;if(e.constructor!==t.constructor)return!1;let i=r.length;for(;i--;)if(r[i]===e)return o[i]===t;r.push(e),o.push(t);let s=[...n.filter(l=>l!==Oe),a];function a(l,u){return Oe(l,u,[...n],[...r],[...o])}if(e.size!==void 0){if(e.size!==t.size)return!1;if(We("Set",e)||lm(e)){let l=!0;for(let u of e)if(!t.has(u)){let f=!1;for(let m of t)H(u,m,s)===!0&&(f=!0);if(f===!1){l=!1;break}}return r.pop(),o.pop(),l}else if(We("Map",e)||cm(e)){let l=!0;for(let u of e)if(!t.has(u[0])||!H(u[1],t.get(u[0]),s)){let f=!1;for(let m of t){let h=H(u[0],m[0],s),g=!1;h===!0&&(g=H(u[1],m[1],s)),g===!0&&(f=!0)}if(f===!1){l=!1;break}}return r.pop(),o.pop(),l}}let c=t[Hl]();for(let l of e){let u=c.next();if(u.done||!H(l,u.value,s))return!1}if(!c.next().done)return!1;if(!um(e)&&!fm(e)&&!hm(e)&&!pm(e)){let l=Object.entries(e),u=Object.entries(t);if(!H(l,u))return!1}return r.pop(),o.pop(),!0}function Zi(e,t){return!e||typeof e!="object"||e===Object.prototype?!1:Object.prototype.hasOwnProperty.call(e,t)||Zi(Object.getPrototypeOf(e),t)}function dm(e){return nt(e)&&!(e instanceof Error)&&!Array.isArray(e)&&!(e instanceof Date)}function Ct(e,t,n=[]){let r=n.filter(i=>i!==Ct),o=(i=new WeakMap)=>(s,a)=>{if(dm(a))return Object.keys(a).every(c=>{if(a[c]!=null&&typeof a[c]=="object"){if(i.has(a[c]))return H(s[c],a[c],r);i.set(a[c],!0)}let l=s!=null&&Zi(s,c)&&H(s[c],a[c],[...r,o(i)]);return i.delete(a[c]),l})};return o()(e,t)}function Fl(e,t){if(!(e==null||t==null||e.constructor===t.constructor))return!1}function Ll(e,t){let n=e,r=t;if(!(e instanceof DataView&&t instanceof DataView)){if(!(e instanceof ArrayBuffer)||!(t instanceof ArrayBuffer))return;try{n=new DataView(e),r=new DataView(t)}catch{return}}if(n.byteLength!==r.byteLength)return!1;for(let o=0;o<n.byteLength;o++)if(n.getUint8(o)!==r.getUint8(o))return!1;return!0}function Ki(e,t,n=[]){if(!Array.isArray(e)||!Array.isArray(t))return;let r=Object.keys(e),o=Object.keys(t),i=n.filter(s=>s!==Ki);return H(e,t,i,!0)&&H(r,o)}function mm(e,t="#{this}",n="#{exp}"){let r=`expected ${t} to be ${n} // Object.is equality`;return["toStrictEqual","toEqual"].includes(e)?`${r}
85
-
86
- If it should pass with deep equality, replace "toBe" with "${e}"
87
-
88
- Expected: ${t}
89
- Received: serializes to the same string
90
- `:r}function gm(e,t){return`${t} ${e}${t===1?"":"s"}`}function Ji(e){return[...Object.keys(e),...Object.getOwnPropertySymbols(e).filter(t=>{var n;return(n=Object.getOwnPropertyDescriptor(e,t))==null?void 0:n.enumerable})]}function ym(e,t,n){let r=0,o=(i=new WeakMap)=>(s,a)=>{if(Array.isArray(s)){if(Array.isArray(a)&&a.length===s.length)return a.map((c,l)=>o(i)(s[l],c))}else{if(s instanceof Date)return s;if(nt(s)&&nt(a)){if(H(s,a,[...n,Oe,Ct]))return a;let c={};i.set(s,c),typeof s.constructor=="function"&&typeof s.constructor.name=="string"&&Object.defineProperty(c,"constructor",{enumerable:!1,value:s.constructor});for(let l of Ji(s))Zi(a,l)?c[l]=i.has(s[l])?i.get(s[l]):o(i)(s[l],a[l]):i.has(s[l])||(r+=1,nt(s[l])&&(r+=Ji(s[l]).length),o(i)(s[l],a[l]));if(Ji(c).length>0)return c}}return s};return{subset:o()(e,t),stripped:r}}if(!Object.prototype.hasOwnProperty.call(globalThis,Tr)){let e=new WeakMap,t=Object.create(null),n=[],r=Object.create(null);Object.defineProperty(globalThis,Tr,{get:()=>e}),Object.defineProperty(globalThis,dn,{configurable:!0,get:()=>({state:e.get(globalThis[mn]),matchers:t,customEqualityTesters:n})}),Object.defineProperty(globalThis,kr,{get:()=>r})}function Wt(e){return globalThis[Tr].get(e)}function Mr(e,t){let n=globalThis[Tr],r=n.get(t)||{},o=Object.defineProperties(r,{...Object.getOwnPropertyDescriptors(r),...Object.getOwnPropertyDescriptors(e)});n.set(t,o)}var Ze=class{constructor(t,n=!1){this.sample=t,this.inverse=n}$$typeof=Symbol.for("jest.asymmetricMatcher");getMatcherContext(t){return{...Wt(t||globalThis[mn]),equals:H,isNot:this.inverse,customTesters:Yi(),utils:{...Wl(),diff:Tt,stringify:Te,iterableEquality:Oe,subsetEquality:Ct}}}[Symbol.for("chai/inspect")](t){let n=Te(this,t.depth,{min:!0});return n.length<=t.truncate?n:`${this.toString()}{\u2026}`}},_r=class extends Ze{constructor(t,n=!1){if(!We("String",t))throw new Error("Expected is not a string");super(t,n)}asymmetricMatch(t){let n=We("String",t)&&t.includes(this.sample);return this.inverse?!n:n}toString(){return`String${this.inverse?"Not":""}Containing`}getExpectedType(){return"string"}},Xi=class extends Ze{asymmetricMatch(t){return t!=null}toString(){return"Anything"}toAsymmetricMatcher(){return"Anything"}},Cr=class extends Ze{constructor(t,n=!1){super(t,n)}getPrototype(t){return Object.getPrototypeOf?Object.getPrototypeOf(t):t.constructor.prototype===t?null:t.constructor.prototype}hasProperty(t,n){return t?Object.prototype.hasOwnProperty.call(t,n)?!0:this.hasProperty(this.getPrototype(t),n):!1}asymmetricMatch(t){if(typeof this.sample!="object")throw new TypeError(`You must provide an object to ${this.toString()}, not '${typeof this.sample}'.`);let n=!0,r=this.getMatcherContext();for(let o in this.sample)if(!this.hasProperty(t,o)||!H(this.sample[o],t[o],r.customTesters)){n=!1;break}return this.inverse?!n:n}toString(){return`Object${this.inverse?"Not":""}Containing`}getExpectedType(){return"object"}},Or=class extends Ze{constructor(t,n=!1){super(t,n)}asymmetricMatch(t){if(!Array.isArray(this.sample))throw new TypeError(`You must provide an array to ${this.toString()}, not '${typeof this.sample}'.`);let n=this.getMatcherContext(),r=this.sample.length===0||Array.isArray(t)&&this.sample.every(o=>t.some(i=>H(o,i,n.customTesters)));return this.inverse?!r:r}toString(){return`Array${this.inverse?"Not":""}Containing`}getExpectedType(){return"array"}},Hi=class extends Ze{constructor(t){if(typeof t>"u")throw new TypeError("any() expects to be passed a constructor function. Please pass one or use anything() to match any object.");super(t)}fnNameFor(t){if(t.name)return t.name;let r=Function.prototype.toString.call(t).match(/^(?:async)?\s*function\s*(?:\*\s*)?([\w$]+)\s*\(/);return r?r[1]:"<anonymous>"}asymmetricMatch(t){return this.sample===String?typeof t=="string"||t instanceof String:this.sample===Number?typeof t=="number"||t instanceof Number:this.sample===Function?typeof t=="function"||t instanceof Function:this.sample===Boolean?typeof t=="boolean"||t instanceof Boolean:this.sample===BigInt?typeof t=="bigint"||t instanceof BigInt:this.sample===Symbol?typeof t=="symbol"||t instanceof Symbol:this.sample===Object?typeof t=="object":t instanceof this.sample}toString(){return"Any"}getExpectedType(){return this.sample===String?"string":this.sample===Number?"number":this.sample===Function?"function":this.sample===Object?"object":this.sample===Boolean?"boolean":this.fnNameFor(this.sample)}toAsymmetricMatcher(){return`Any<${this.fnNameFor(this.sample)}>`}},Ir=class extends Ze{constructor(t,n=!1){if(!We("String",t)&&!We("RegExp",t))throw new Error("Expected is not a String or a RegExp");super(new RegExp(t),n)}asymmetricMatch(t){let n=We("String",t)&&this.sample.test(t);return this.inverse?!n:n}toString(){return`String${this.inverse?"Not":""}Matching`}getExpectedType(){return"string"}},Ar=class extends Ze{precision;constructor(t,n=2,r=!1){if(!We("Number",t))throw new Error("Expected is not a Number");if(!We("Number",n))throw new Error("Precision is not a Number");super(t),this.inverse=r,this.precision=n}asymmetricMatch(t){if(!We("Number",t))return!1;let n=!1;return t===Number.POSITIVE_INFINITY&&this.sample===Number.POSITIVE_INFINITY||t===Number.NEGATIVE_INFINITY&&this.sample===Number.NEGATIVE_INFINITY?n=!0:n=Math.abs(this.sample-t)<10**-this.precision/2,this.inverse?!n:n}toString(){return`Number${this.inverse?"Not":""}CloseTo`}getExpectedType(){return"number"}toAsymmetricMatcher(){return[this.toString(),this.sample,`(${gm("digit",this.precision)})`].join(" ")}},Gl=(e,t)=>{t.addMethod(e.expect,"anything",()=>new Xi),t.addMethod(e.expect,"any",n=>new Hi(n)),t.addMethod(e.expect,"stringContaining",n=>new _r(n)),t.addMethod(e.expect,"objectContaining",n=>new Cr(n)),t.addMethod(e.expect,"arrayContaining",n=>new Or(n)),t.addMethod(e.expect,"stringMatching",n=>new Ir(n)),t.addMethod(e.expect,"closeTo",(n,r)=>new Ar(n,r)),e.expect.not={stringContaining:n=>new _r(n,!0),objectContaining:n=>new Cr(n,!0),arrayContaining:n=>new Or(n,!0),stringMatching:n=>new Ir(n,!0),closeTo:(n,r)=>new Ar(n,r,!0)}};function Dl(e,t,n){let r=e.flag(t,"negate")?"not.":"",o=`${e.flag(t,"_name")}(${n?"expected":""})`,i=e.flag(t,"promise");return`expect(actual)${i?`.${i}`:""}.${r}${o}`}function ql(e,t,n,r){let o=e;if(o&&t instanceof Promise){t=t.finally(()=>{if(!o.promises)return;let s=o.promises.indexOf(t);s!==-1&&o.promises.splice(s,1)}),o.promises||(o.promises=[]),o.promises.push(t);let i=!1;return o.onFinished??(o.onFinished=[]),o.onFinished.push(()=>{var s;if(!i){let c=(((s=globalThis.__vitest_worker__)==null?void 0:s.onFilterStackTrace)||(l=>l||""))(r.stack);console.warn([`Promise returned by \`${n}\` was not awaited. `,"Vitest currently auto-awaits hanging assertions at the end of the test, but this will cause the test to fail in Vitest 3. ",`Please remember to await the assertion.
91
- `,c].join(""))}}),{then(s,a){return i=!0,t.then(s,a)},catch(s){return t.catch(s)},finally(s){return t.finally(s)},[Symbol.toStringTag]:"Promise"}}return t}function Yl(e,t,n){return function(...r){var o;if(t!=="withTest"&&e.flag(this,"_name",t),!e.flag(this,"soft"))return n.apply(this,r);let i=e.flag(this,"vitest-test");if(!i)throw new Error("expect.soft() can only be used inside a test");try{return n.apply(this,r)}catch(s){i.result||(i.result={state:"fail"}),i.result.state="fail",(o=i.result).errors||(o.errors=[]),i.result.errors.push(Ko(s))}}}var Zl=(e,t)=>{let{AssertionError:n}=e,r=Yi();function o(a,c){let l=u=>{let f=Yl(t,u,c);t.addMethod(e.Assertion.prototype,u,f),t.addMethod(globalThis[dn].matchers,u,f)};Array.isArray(a)?a.forEach(u=>l(u)):l(a)}["throw","throws","Throw"].forEach(a=>{t.overwriteMethod(e.Assertion.prototype,a,c=>function(...l){let u=t.flag(this,"promise"),f=t.flag(this,"object"),m=t.flag(this,"negate");if(u==="rejects")t.flag(this,"object",()=>{throw f});else if(u==="resolves"&&typeof f!="function"){if(m)return;{let h=t.flag(this,"message")||"expected promise to throw an error, but it didn't",g={showDiff:!1};throw new n(h,g,t.flag(this,"ssfi"))}}c.apply(this,l)})}),o("withTest",function(a){return t.flag(this,"vitest-test",a),this}),o("toEqual",function(a){let c=t.flag(this,"object"),l=H(c,a,[...r,Oe]);return this.assert(l,"expected #{this} to deeply equal #{exp}","expected #{this} to not deeply equal #{exp}",a,c)}),o("toStrictEqual",function(a){let c=t.flag(this,"object"),l=H(c,a,[...r,Oe,Fl,Ki,Ll],!0);return this.assert(l,"expected #{this} to strictly equal #{exp}","expected #{this} to not strictly equal #{exp}",a,c)}),o("toBe",function(a){let c=this._obj,l=Object.is(c,a),u="";return l||(H(c,a,[...r,Oe,Fl,Ki,Ll],!0)?u="toStrictEqual":H(c,a,[...r,Oe])&&(u="toEqual")),this.assert(l,mm(u),"expected #{this} not to be #{exp} // Object.is equality",a,c)}),o("toMatchObject",function(a){let c=this._obj,l=H(c,a,[...r,Oe,Ct]),u=t.flag(this,"negate"),{subset:f,stripped:m}=ym(c,a,r);if(l&&u||!l&&!u){let h=t.getMessage(this,[l,"expected #{this} to match object #{exp}","expected #{this} to not match object #{exp}",a,f,!1]),g=m===0?h:`${h}
92
- (${m} matching ${m===1?"property":"properties"} omitted from actual)`;throw new n(g,{showDiff:!0,expected:a,actual:f})}}),o("toMatch",function(a){let c=this._obj;if(typeof c!="string")throw new TypeError(`.toMatch() expects to receive a string, but got ${typeof c}`);return this.assert(typeof a=="string"?c.includes(a):c.match(a),"expected #{this} to match #{exp}","expected #{this} not to match #{exp}",a,c)}),o("toContain",function(a){let c=this._obj;if(typeof Node<"u"&&c instanceof Node){if(!(a instanceof Node))throw new TypeError(`toContain() expected a DOM node as the argument, but got ${typeof a}`);return this.assert(c.contains(a),"expected #{this} to contain element #{exp}","expected #{this} not to contain element #{exp}",a,c)}if(typeof DOMTokenList<"u"&&c instanceof DOMTokenList){ye(a,"class name",["string"]);let u=t.flag(this,"negate")?c.value.replace(a,"").trim():`${c.value} ${a}`;return this.assert(c.contains(a),`expected "${c.value}" to contain "${a}"`,`expected "${c.value}" not to contain "${a}"`,u,c.value)}return typeof c=="string"&&typeof a=="string"?this.assert(c.includes(a),"expected #{this} to contain #{exp}","expected #{this} not to contain #{exp}",a,c):(c!=null&&typeof c!="string"&&t.flag(this,"object",Array.from(c)),this.contain(a))}),o("toContainEqual",function(a){let c=t.flag(this,"object"),l=Array.from(c).findIndex(u=>H(u,a,r));this.assert(l!==-1,"expected #{this} to deep equally contain #{exp}","expected #{this} to not deep equally contain #{exp}",a)}),o("toBeTruthy",function(){let a=t.flag(this,"object");this.assert(!!a,"expected #{this} to be truthy","expected #{this} to not be truthy",!0,a)}),o("toBeFalsy",function(){let a=t.flag(this,"object");this.assert(!a,"expected #{this} to be falsy","expected #{this} to not be falsy",!1,a)}),o("toBeGreaterThan",function(a){let c=this._obj;return ye(c,"actual",["number","bigint"]),ye(a,"expected",["number","bigint"]),this.assert(c>a,`expected ${c} to be greater than ${a}`,`expected ${c} to be not greater than ${a}`,a,c,!1)}),o("toBeGreaterThanOrEqual",function(a){let c=this._obj;return ye(c,"actual",["number","bigint"]),ye(a,"expected",["number","bigint"]),this.assert(c>=a,`expected ${c} to be greater than or equal to ${a}`,`expected ${c} to be not greater than or equal to ${a}`,a,c,!1)}),o("toBeLessThan",function(a){let c=this._obj;return ye(c,"actual",["number","bigint"]),ye(a,"expected",["number","bigint"]),this.assert(c<a,`expected ${c} to be less than ${a}`,`expected ${c} to be not less than ${a}`,a,c,!1)}),o("toBeLessThanOrEqual",function(a){let c=this._obj;return ye(c,"actual",["number","bigint"]),ye(a,"expected",["number","bigint"]),this.assert(c<=a,`expected ${c} to be less than or equal to ${a}`,`expected ${c} to be not less than or equal to ${a}`,a,c,!1)}),o("toBeNaN",function(){let a=t.flag(this,"object");this.assert(Number.isNaN(a),"expected #{this} to be NaN","expected #{this} not to be NaN",Number.NaN,a)}),o("toBeUndefined",function(){let a=t.flag(this,"object");this.assert(a===void 0,"expected #{this} to be undefined","expected #{this} not to be undefined",void 0,a)}),o("toBeNull",function(){let a=t.flag(this,"object");this.assert(a===null,"expected #{this} to be null","expected #{this} not to be null",null,a)}),o("toBeDefined",function(){let a=t.flag(this,"object");this.assert(typeof a<"u","expected #{this} to be defined","expected #{this} to be undefined",a)}),o("toBeTypeOf",function(a){let c=typeof this._obj,l=a===c;return this.assert(l,"expected #{this} to be type of #{exp}","expected #{this} not to be type of #{exp}",a,c)}),o("toBeInstanceOf",function(a){return this.instanceOf(a)}),o("toHaveLength",function(a){return this.have.length(a)}),o("toHaveProperty",function(...a){Array.isArray(a[0])&&(a[0]=a[0].map(w=>String(w).replace(/([.[\]])/g,"\\$1")).join("."));let c=this._obj,[l,u]=a,f=()=>Object.prototype.hasOwnProperty.call(c,l)?{value:c[l],exists:!0}:t.getPathInfo(c,l),{value:m,exists:h}=f(),g=h&&(a.length===1||H(u,m,r)),y=a.length===1?"":` with value ${t.objDisplay(u)}`;return this.assert(g,`expected #{this} to have property "${l}"${y}`,`expected #{this} to not have property "${l}"${y}`,u,h?m:void 0)}),o("toBeCloseTo",function(a,c=2){let l=this._obj,u=!1,f=0,m=0;return a===Number.POSITIVE_INFINITY&&l===Number.POSITIVE_INFINITY||a===Number.NEGATIVE_INFINITY&&l===Number.NEGATIVE_INFINITY?u=!0:(f=10**-c/2,m=Math.abs(l-a),u=m<f),this.assert(u,`expected #{this} to be close to #{exp}, received difference is ${m}, but expected ${f}`,`expected #{this} to not be close to #{exp}, received difference is ${m}, but expected ${f}`,a,l,!1)});function i(a){if(!sr(a._obj))throw new TypeError(`${t.inspect(a._obj)} is not a spy or a call to a spy!`)}function s(a){return i(a),a._obj}o(["toHaveBeenCalledTimes","toBeCalledTimes"],function(a){let c=s(this),l=c.getMockName(),u=c.mock.calls.length;return this.assert(u===a,`expected "${l}" to be called #{exp} times, but got ${u} times`,`expected "${l}" to not be called #{exp} times`,a,u,!1)}),o("toHaveBeenCalledOnce",function(){let a=s(this),c=a.getMockName(),l=a.mock.calls.length;return this.assert(l===1,`expected "${c}" to be called once, but got ${l} times`,`expected "${c}" to not be called once`,1,l,!1)}),o(["toHaveBeenCalled","toBeCalled"],function(){let a=s(this),c=a.getMockName(),l=a.mock.calls.length,u=l>0,f=t.flag(this,"negate"),m=t.getMessage(this,[u,`expected "${c}" to be called at least once`,`expected "${c}" to not be called at all, but actually been called ${l} times`,!0,u]);if(u&&f&&(m=Bl(a,m)),u&&f||!u&&!f)throw new n(m)}),o(["toHaveBeenCalledWith","toBeCalledWith"],function(...a){let c=s(this),l=c.getMockName(),u=c.mock.calls.some(h=>H(h,a,[...r,Oe])),f=t.flag(this,"negate"),m=t.getMessage(this,[u,`expected "${l}" to be called with arguments: #{exp}`,`expected "${l}" to not be called with arguments: #{exp}`,a]);if(u&&f||!u&&!f)throw new n(Bl(c,m,a))}),o(["toHaveBeenNthCalledWith","nthCalledWith"],function(a,...c){let l=s(this),u=l.getMockName(),f=l.mock.calls[a-1],m=l.mock.calls.length,h=a<=m;this.assert(H(f,c,[...r,Oe]),`expected ${pn(a)} "${u}" call to have been called with #{exp}${h?"":`, but called only ${m} times`}`,`expected ${pn(a)} "${u}" call to not have been called with #{exp}`,c,f,h)}),o(["toHaveBeenLastCalledWith","lastCalledWith"],function(...a){let c=s(this),l=c.getMockName(),u=c.mock.calls[c.mock.calls.length-1];this.assert(H(u,a,[...r,Oe]),`expected last "${l}" call to have been called with #{exp}`,`expected last "${l}" call to not have been called with #{exp}`,a,u)}),o(["toThrow","toThrowError"],function(a){if(typeof a=="string"||typeof a>"u"||a instanceof RegExp)return this.throws(a===""?/^$/:a);let c=this._obj,l=t.flag(this,"promise"),u=t.flag(this,"negate"),f=null;if(l==="rejects")f=c;else if(l==="resolves"&&typeof c!="function"){if(u)return;{let m=t.flag(this,"message")||"expected promise to throw an error, but it didn't",h={showDiff:!1};throw new n(m,h,t.flag(this,"ssfi"))}}else{let m=!1;try{c()}catch(h){m=!0,f=h}if(!m&&!u){let h=t.flag(this,"message")||"expected function to throw an error, but it didn't",g={showDiff:!1};throw new n(h,g,t.flag(this,"ssfi"))}}if(typeof a=="function"){let m=a.name||a.prototype.constructor.name;return this.assert(f&&f instanceof a,`expected error to be instance of ${m}`,`expected error not to be instance of ${m}`,a,f)}if(a instanceof Error)return this.assert(f&&a.message===f.message,`expected error to have message: ${a.message}`,`expected error not to have message: ${a.message}`,a.message,f&&f.message);if(typeof a=="object"&&"asymmetricMatch"in a&&typeof a.asymmetricMatch=="function"){let m=a;return this.assert(f&&m.asymmetricMatch(f),"expected error to match asymmetric matcher","expected error not to match asymmetric matcher",m,f)}throw new Error(`"toThrow" expects string, RegExp, function, Error instance or asymmetric matcher, got "${typeof a}"`)}),[{name:"toHaveResolved",condition:a=>a.mock.settledResults.length>0&&a.mock.settledResults.some(({type:c})=>c==="fulfilled"),action:"resolved"},{name:["toHaveReturned","toReturn"],condition:a=>a.mock.calls.length>0&&a.mock.results.some(({type:c})=>c!=="throw"),action:"called"}].forEach(({name:a,condition:c,action:l})=>{o(a,function(){let u=s(this),f=u.getMockName(),m=c(u);this.assert(m,`expected "${f}" to be successfully ${l} at least once`,`expected "${f}" to not be successfully ${l}`,m,!m,!1)})}),[{name:"toHaveResolvedTimes",condition:(a,c)=>a.mock.settledResults.reduce((l,{type:u})=>u==="fulfilled"?++l:l,0)===c,action:"resolved"},{name:["toHaveReturnedTimes","toReturnTimes"],condition:(a,c)=>a.mock.results.reduce((l,{type:u})=>u==="throw"?l:++l,0)===c,action:"called"}].forEach(({name:a,condition:c,action:l})=>{o(a,function(u){let f=s(this),m=f.getMockName(),h=c(f,u);this.assert(h,`expected "${m}" to be successfully ${l} ${u} times`,`expected "${m}" to not be successfully ${l} ${u} times`,`expected resolved times: ${u}`,`received resolved times: ${h}`,!1)})}),[{name:"toHaveResolvedWith",condition:(a,c)=>a.mock.settledResults.some(({type:l,value:u})=>l==="fulfilled"&&H(c,u)),action:"resolve"},{name:["toHaveReturnedWith","toReturnWith"],condition:(a,c)=>a.mock.results.some(({type:l,value:u})=>l==="return"&&H(c,u)),action:"return"}].forEach(({name:a,condition:c,action:l})=>{o(a,function(u){let f=s(this),m=c(f,u),h=t.flag(this,"negate");if(m&&h||!m&&!h){let g=f.getMockName(),y=t.getMessage(this,[m,`expected "${g}" to ${l} with: #{exp} at least once`,`expected "${g}" to not ${l} with: #{exp}`,u]),w=l==="return"?f.mock.results:f.mock.settledResults;throw new n(bm(f,w,y,u))}})}),[{name:"toHaveLastResolvedWith",condition:(a,c)=>{let l=a.mock.settledResults[a.mock.settledResults.length-1];return l&&l.type==="fulfilled"&&H(l.value,c)},action:"resolve"},{name:["toHaveLastReturnedWith","lastReturnedWith"],condition:(a,c)=>{let l=a.mock.results[a.mock.results.length-1];return l&&l.type==="return"&&H(l.value,c)},action:"return"}].forEach(({name:a,condition:c,action:l})=>{o(a,function(u){let f=s(this),m=l==="return"?f.mock.results:f.mock.settledResults,h=m[m.length-1],g=f.getMockName();this.assert(c(f,u),`expected last "${g}" call to ${l} #{exp}`,`expected last "${g}" call to not ${l} #{exp}`,u,h?.value)})}),[{name:"toHaveNthResolvedWith",condition:(a,c,l)=>{let u=a.mock.settledResults[c-1];return u&&u.type==="fulfilled"&&H(u.value,l)},action:"resolve"},{name:["toHaveNthReturnedWith","nthReturnedWith"],condition:(a,c,l)=>{let u=a.mock.results[c-1];return u&&u.type==="return"&&H(u.value,l)},action:"return"}].forEach(({name:a,condition:c,action:l})=>{o(a,function(u,f){let m=s(this),h=m.getMockName(),y=(l==="return"?m.mock.results:m.mock.settledResults)[u-1],w=`${pn(u)} call`;this.assert(c(m,u,f),`expected ${w} "${h}" call to ${l} #{exp}`,`expected ${w} "${h}" call to not ${l} #{exp}`,f,y?.value)})}),o("toSatisfy",function(a,c){return this.be.satisfy(a,c)}),o("withContext",function(a){for(let c in a)t.flag(this,c,a[c]);return this}),t.addProperty(e.Assertion.prototype,"resolves",function(){let c=new Error("resolves");t.flag(this,"promise","resolves"),t.flag(this,"error",c);let l=t.flag(this,"vitest-test"),u=t.flag(this,"object");if(t.flag(this,"poll"))throw new SyntaxError("expect.poll() is not supported in combination with .resolves");if(typeof u?.then!="function")throw new TypeError(`You must provide a Promise to expect() when using .resolves, not '${typeof u}'.`);let f=new Proxy(this,{get:(m,h,g)=>{let y=Reflect.get(m,h,g);return typeof y!="function"?y instanceof e.Assertion?f:y:(...w)=>{t.flag(this,"_name",h);let E=u.then(_=>(t.flag(this,"object",_),y.call(this,...w)),_=>{let O=new n(`promise rejected "${t.inspect(_)}" instead of resolving`,{showDiff:!1});throw O.cause=_,O.stack=c.stack.replace(c.message,O.message),O});return ql(l,E,Dl(t,this,!!w.length),c)}}});return f}),t.addProperty(e.Assertion.prototype,"rejects",function(){let c=new Error("rejects");t.flag(this,"promise","rejects"),t.flag(this,"error",c);let l=t.flag(this,"vitest-test"),u=t.flag(this,"object"),f=typeof u=="function"?u():u;if(t.flag(this,"poll"))throw new SyntaxError("expect.poll() is not supported in combination with .rejects");if(typeof f?.then!="function")throw new TypeError(`You must provide a Promise to expect() when using .rejects, not '${typeof f}'.`);let m=new Proxy(this,{get:(h,g,y)=>{let w=Reflect.get(h,g,y);return typeof w!="function"?w instanceof e.Assertion?m:w:(...E)=>{t.flag(this,"_name",g);let _=f.then(O=>{let A=new n(`promise resolved "${t.inspect(O)}" instead of rejecting`,{showDiff:!0,expected:new Error("rejected promise"),actual:O});throw A.stack=c.stack.replace(c.message,A.message),A},O=>(t.flag(this,"object",O),w.call(this,...E)));return ql(l,_,Dl(t,this,!!E.length),c)}}});return m})};function pn(e){let t=e%10,n=e%100;return t===1&&n!==11?`${e}st`:t===2&&n!==12?`${e}nd`:t===3&&n!==13?`${e}rd`:`${e}th`}function Bl(e,t,n){return e.mock.calls&&(t+=re.gray(`
93
-
94
- Received:
95
-
96
- ${e.mock.calls.map((r,o)=>{let i=re.bold(` ${pn(o+1)} ${e.getMockName()} call:
97
-
98
- `);return n?i+=Tt(n,r,{omitAnnotationLines:!0}):i+=Te(r).split(`
99
- `).map(s=>` ${s}`).join(`
100
- `),i+=`
101
- `,i}).join(`
102
- `)}`)),t+=re.gray(`
103
-
104
- Number of calls: ${re.bold(e.mock.calls.length)}
105
- `),t}function bm(e,t,n,r){return n+=re.gray(`
106
-
107
- Received:
108
-
109
- ${t.map((o,i)=>{let s=re.bold(` ${pn(i+1)} ${e.getMockName()} call return:
110
-
111
- `);return r?s+=Tt(r,o.value,{omitAnnotationLines:!0}):s+=Te(o).split(`
112
- `).map(a=>` ${a}`).join(`
113
- `),s+=`
114
- `,s}).join(`
115
- `)}`),n+=re.gray(`
116
-
117
- Number of calls: ${re.bold(e.mock.calls.length)}
118
- `),n}function wm(e,t){let n=e._obj,r=we.flag(e,"negate"),o=we.flag(e,"promise")||"",i={...Wl(),diff:Tt,stringify:Te,iterableEquality:Oe,subsetEquality:Ct};return{state:{...Wt(t),customTesters:Yi(),isNot:r,utils:i,promise:o,equals:H,suppressedErrors:[],soft:we.flag(e,"soft"),poll:we.flag(e,"poll")},isNot:r,obj:n}}var $r=class extends Error{constructor(t,n,r){super(t),this.actual=n,this.expected=r}};function vm(e,t,n){return(r,o)=>{Object.entries(n).forEach(([i,s])=>{function a(...f){let{state:m,isNot:h,obj:g}=wm(this,t),y=s.call(m,g,...f);if(y&&typeof y=="object"&&y instanceof Promise)return y.then(({pass:A,message:$,actual:R,expected:N})=>{if(A&&h||!A&&!h)throw new $r($(),R,N)});let{pass:w,message:E,actual:_,expected:O}=y;if(w&&h||!w&&!h)throw new $r(E(),_,O)}let c=Yl(o,i,a);o.addMethod(globalThis[dn].matchers,i,c),o.addMethod(e.Assertion.prototype,i,c);class l extends Ze{constructor(m=!1,...h){super(h,m)}asymmetricMatch(m){let{pass:h}=s.call(this.getMatcherContext(t),m,...this.sample);return this.inverse?!h:h}toString(){return`${this.inverse?"not.":""}${i}`}getExpectedType(){return"any"}toAsymmetricMatcher(){return`${this.toString()}<${this.sample.map(String).join(", ")}>`}}let u=(...f)=>new l(!1,...f);Object.defineProperty(t,i,{configurable:!0,enumerable:!0,value:u,writable:!0}),Object.defineProperty(t.not,i,{configurable:!0,enumerable:!0,value:(...f)=>new l(!0,...f),writable:!0}),Object.defineProperty(globalThis[kr],i,{configurable:!0,enumerable:!0,value:u,writable:!0})})}}var Ql=(e,t)=>{t.addMethod(e.expect,"extend",(n,r)=>{ot(vm(e,n,r))})};var eu="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Sm=new Uint8Array(64),Em=new Uint8Array(128);for(let e=0;e<eu.length;e++){let t=eu.charCodeAt(e);Sm[e]=t,Em[t]=e}var tu;(function(e){e[e.Empty=1]="Empty",e[e.Hash=2]="Hash",e[e.Query=3]="Query",e[e.RelativePath=4]="RelativePath",e[e.AbsolutePath=5]="AbsolutePath",e[e.SchemeRelative=6]="SchemeRelative",e[e.Absolute=7]="Absolute"})(tu||(tu={}));var Tm=/^[A-Za-z]:\//;function xm(e=""){return e&&e.replace(/\\/g,"/").replace(Tm,t=>t.toUpperCase())}var _m=/^[/\\](?![/\\])|^[/\\]{2}(?!\.)|^[A-Za-z]:[/\\]/;function Cm(){return typeof process<"u"&&typeof process.cwd=="function"?process.cwd().replace(/\\/g,"/"):"/"}var Om=function(...e){e=e.map(r=>xm(r));let t="",n=!1;for(let r=e.length-1;r>=-1&&!n;r--){let o=r>=0?e[r]:Cm();!o||o.length===0||(t=`${o}/${t}`,n=nu(o))}return t=Im(t,!n),n&&!nu(t)?`/${t}`:t.length>0?t:"."};function Im(e,t){let n="",r=0,o=-1,i=0,s=null;for(let a=0;a<=e.length;++a){if(a<e.length)s=e[a];else{if(s==="/")break;s="/"}if(s==="/"){if(!(o===a-1||i===1))if(i===2){if(n.length<2||r!==2||n[n.length-1]!=="."||n[n.length-2]!=="."){if(n.length>2){let c=n.lastIndexOf("/");c===-1?(n="",r=0):(n=n.slice(0,c),r=n.length-1-n.lastIndexOf("/")),o=a,i=0;continue}else if(n.length>0){n="",r=0,o=a,i=0;continue}}t&&(n+=n.length>0?"/..":"..",r=2)}else n.length>0?n+=`/${e.slice(o+1,a)}`:n=e.slice(o+1,a),r=a-o-1;o=a,i=0}else s==="."&&i!==-1?++i:i=-1}return n}var nu=function(e){return _m.test(e)},ru=/^\s*at .*(?:\S:\d+|\(native\))/m,Am=/^(?:eval@)?(?:\[native code\])?$/;function ou(e){if(!e.includes(":"))return[e];let n=/(.+?)(?::(\d+))?(?::(\d+))?$/.exec(e.replace(/^\(|\)$/g,""));if(!n)return[e];let r=n[1];if(r.startsWith("async ")&&(r=r.slice(6)),(r.startsWith("http:")||r.startsWith("https:"))&&(r=new URL(r).pathname),r.startsWith("/@fs/")){let o=/^\/@fs\/[a-zA-Z]:\//.test(r);r=r.slice(o?5:4)}return[r,n[2]||void 0,n[3]||void 0]}function $m(e){let t=e.trim();if(Am.test(t)||(t.includes(" > eval")&&(t=t.replace(/ line (\d+)(?: > eval line \d+)* > eval:\d+:\d+/g,":$1")),!t.includes("@")&&!t.includes(":")))return null;let n=/((.*".+"[^@]*)?[^@]*)(@)/,r=t.match(n),o=r&&r[1]?r[1]:void 0,[i,s,a]=ou(t.replace(n,""));return!i||!s||!a?null:{file:i,method:o||"",line:Number.parseInt(s),column:Number.parseInt(a)}}function jr(e){let t=e.trim();return ru.test(t)?km(t):$m(t)}function km(e){let t=e.trim();if(!ru.test(t))return null;t.includes("(eval ")&&(t=t.replace(/eval code/g,"eval").replace(/(\(eval at [^()]*)|(,.*$)/g,""));let n=t.replace(/^\s+/,"").replace(/\(eval code/g,"(").replace(/^.*?\s+/,""),r=n.match(/ (\(.+\)$)/);n=r?n.replace(r[0],""):n;let[o,i,s]=ou(r?r[1]:n),a=r&&n||"",c=o&&["eval","<anonymous>"].includes(o)?void 0:o;return!c||!i||!s?null:(a.startsWith("async ")&&(a=a.slice(6)),c.startsWith("file://")&&(c=c.slice(7)),c=Om(c),a&&(a=a.replace(/__vite_ssr_import_\d+__\./g,"")),{method:a,file:c,line:Number.parseInt(i),column:Number.parseInt(s)})}var Pm=/^[A-Za-z]:\//;function Nm(e=""){return e&&e.replace(/\\/g,"/").replace(Pm,t=>t.toUpperCase())}var Mm=/^[/\\](?![/\\])|^[/\\]{2}(?!\.)|^[A-Za-z]:[/\\]/;function jm(){return typeof process<"u"&&typeof process.cwd=="function"?process.cwd().replace(/\\/g,"/"):"/"}var es=function(...e){e=e.map(r=>Nm(r));let t="",n=!1;for(let r=e.length-1;r>=-1&&!n;r--){let o=r>=0?e[r]:jm();!o||o.length===0||(t=`${o}/${t}`,n=Qi(o))}return t=iu(t,!n),n&&!Qi(t)?`/${t}`:t.length>0?t:"."};function iu(e,t){let n="",r=0,o=-1,i=0,s=null;for(let a=0;a<=e.length;++a){if(a<e.length)s=e[a];else{if(s==="/")break;s="/"}if(s==="/"){if(!(o===a-1||i===1))if(i===2){if(n.length<2||r!==2||n[n.length-1]!=="."||n[n.length-2]!=="."){if(n.length>2){let c=n.lastIndexOf("/");c===-1?(n="",r=0):(n=n.slice(0,c),r=n.length-1-n.lastIndexOf("/")),o=a,i=0;continue}else if(n.length>0){n="",r=0,o=a,i=0;continue}}t&&(n+=n.length>0?"/..":"..",r=2)}else n.length>0?n+=`/${e.slice(o+1,a)}`:n=e.slice(o+1,a),r=a-o-1;o=a,i=0}else s==="."&&i!==-1?++i:i=-1}return n}var Qi=function(e){return Mm.test(e)};function Rr(e,t){function n(o){let i=function(...s){return t.apply(o,s)};Object.assign(i,t),i.withContext=()=>i.bind(o),i.setContext=(s,a)=>{o[s]=a},i.mergeContext=s=>{Object.assign(o,s)};for(let s of e)Object.defineProperty(i,s,{get(){return n({...o,[s]:!0})}});return i}let r=n({});return r.fn=t,r}function Fr(e){let t=[e.name],n=e;for(;n?.suite;)n=n.suite,n?.name&&t.unshift(n.name);return n!==e.file&&t.unshift(e.file.name),t}function ts(e,t=" > "){return Fr(e).slice(1).join(t)}var os=class extends Error{constructor(t,n){super(t),this.message=t,this.taskId=n.id}code="VITEST_PENDING";taskId},Ut={tasks:[],currentSuite:null};function Um(e){var t;(t=Ut.currentSuite)==null||t.tasks.push(e)}async function Vm(e,t){let n=Ut.currentSuite;Ut.currentSuite=e,await t(),Ut.currentSuite=n}function bn(e,t,n=!1){if(t<=0||t===Number.POSITIVE_INFINITY)return e;let{setTimeout:r,clearTimeout:o}=ft();return function(...s){return Promise.race([e(...s),new Promise((a,c)=>{var l;let u=r(()=>{o(u),c(new Error(Km(n,t)))},t);(l=u.unref)==null||l.call(u)})])}}function Jm(e,t){var n;let r=function(){throw new Error("done() callback is deprecated, use promise instead")};return r.task=e,r.skip=()=>{throw e.pending=!0,new os("test is skipped; abort execution",e)},r.onTestFailed=o=>{e.onFailed||(e.onFailed=[]),e.onFailed.push(o)},r.onTestFinished=o=>{e.onFinished||(e.onFinished=[]),e.onFinished.push(o)},((n=t.extendTaskContext)==null?void 0:n.call(t,r))||r}function Km(e,t){return`${e?"Hook":"Test"} timed out in ${t}ms.
119
- If this is a long-running ${e?"hook":"test"}, pass a timeout value as the last argument or configure it globally with "${e?"hookTimeout":"testTimeout"}".`}var Xm=new WeakMap,cu=new WeakMap,lu=new WeakMap;function Hm(e,t){Xm.set(e,t)}function Gm(e,t){cu.set(e,t)}function Ym(e){return cu.get(e)}function Zm(e,t){lu.set(e,t)}function Qm(e){return lu.get(e)}function eg(e,t={}){let n=["auto"],r=Object.entries(e).map(([o,i])=>{let s={value:i};return Array.isArray(i)&&i.length>=2&&nt(i[1])&&Object.keys(i[1]).some(a=>n.includes(a))&&(Object.assign(s,i[1]),s.value=i[0]),s.prop=o,s.isFn=typeof s.value=="function",s});return Array.isArray(t.fixtures)?t.fixtures=t.fixtures.concat(r):t.fixtures=r,r.forEach(o=>{if(o.isFn){let i=fu(o.value);i.length&&(o.deps=t.fixtures.filter(({prop:s})=>s!==o.prop&&i.includes(s)))}}),t}var ns=new Map,rs=new Map;function ss(e,t){return n=>{let r=n||t;if(!r)return e({});let o=Ym(r);if(!o?.length)return e(r);let i=fu(e),s=o.some(({auto:m})=>m);if(!i.length&&!s)return e(r);ns.get(r)||ns.set(r,new Map);let a=ns.get(r);rs.has(r)||rs.set(r,[]);let c=rs.get(r),l=o.filter(({prop:m,auto:h})=>h||i.includes(m)),u=uu(l);if(!u.length)return e(r);async function f(){for(let m of u){if(a.has(m))continue;let h=m.isFn?await tg(m.value,r,c):m.value;r[m.prop]=h,a.set(m,h),c.unshift(()=>{a.delete(m)})}}return f().then(()=>e(r))}}async function tg(e,t,n){let r=Zn(),o=!1,i=e(t,async s=>{o=!0,r.resolve(s);let a=Zn();n.push(async()=>{a.resolve(),await i}),await a}).catch(s=>{if(!o){r.reject(s);return}throw s});return r}function uu(e,t=new Set,n=[]){return e.forEach(r=>{if(!n.includes(r)){if(!r.isFn||!r.deps){n.push(r);return}if(t.has(r))throw new Error(`Circular fixture dependency detected: ${r.prop} <- ${[...t].reverse().map(o=>o.prop).join(" <- ")}`);t.add(r),uu(r.deps,t,n),n.push(r),t.clear()}}),n}function fu(e){let t=e.toString();/__async\(this, (?:null|arguments|\[[_0-9, ]*\]), function\*/.test(t)&&(t=t.split("__async(this,")[1]);let n=t.match(/[^(]*\(([^)]*)/);if(!n)return[];let r=su(n[1]);if(!r.length)return[];let o=r[0];if("__VITEST_FIXTURE_INDEX__"in e&&(o=r[e.__VITEST_FIXTURE_INDEX__],!o))return[];if(!(o.startsWith("{")&&o.endsWith("}")))throw new Error(`The first argument inside a fixture must use object destructuring pattern, e.g. ({ test } => {}). Instead, received "${o}".`);let i=o.slice(1,-1).replace(/\s/g,""),s=su(i).map(c=>c.replace(/:.*|=.*/g,"")),a=s.at(-1);if(a&&a.startsWith("..."))throw new Error(`Rest parameters are not supported in fixtures, received "${a}".`);return s}function su(e){let t=[],n=[],r=0;for(let i=0;i<e.length;i++)if(e[i]==="{"||e[i]==="[")n.push(e[i]==="{"?"}":"]");else if(e[i]===n[n.length-1])n.pop();else if(!n.length&&e[i]===","){let s=e.substring(r,i).trim();s&&t.push(s),r=i+1}let o=e.substring(r).trim();return o&&t.push(o),t}var ng;function Lr(){return ng}var gn=ug(),rg=as(function(e,t,n){if(Lr())throw new Error('Calling the test function inside another test function is not allowed. Please put it inside "describe" or "suite" so it can be properly collected.');Dr().test.fn.call(this,Ot(e),t,n)});var Ue,hu,og;function pu(e,t){if(!e)throw new Error(`Vitest failed to find ${t}. This is a bug in Vitest. Please, open an issue with reproduction.`)}function ig(){return og}function sg(){return pu(Ue,"the runner"),Ue}function Dr(){let e=Ut.currentSuite||hu;return pu(e,"the current suite"),e}function ag(){return{beforeAll:[],afterAll:[],beforeEach:[],afterEach:[]}}function yn(e,t){let n={},r=()=>{};if(typeof t=="object"){if(typeof e=="object")throw new TypeError("Cannot use two objects as arguments. Please provide options and a function callback in that order.");n=t}else typeof t=="number"?n={timeout:t}:typeof e=="object"&&(n=e);if(typeof e=="function"){if(typeof t=="function")throw new TypeError("Cannot use two functions as arguments. Please use the second argument for options.");r=e}else typeof t=="function"&&(r=t);return{options:n,handler:r}}function cg(e,t=()=>{},n,r,o,i){let s=[],a=[],c;h(!0);let l=function(w="",E={}){let _={id:"",name:w,suite:void 0,each:E.each,fails:E.fails,context:void 0,type:"custom",file:void 0,retry:E.retry??Ue.config.retry,repeats:E.repeats,mode:E.only?"only":E.skip?"skip":E.todo?"todo":"run",meta:E.meta??Object.create(null)},O=E.handler;(E.concurrent||!E.sequential&&Ue.config.sequence.concurrent)&&(_.concurrent=!0),r&&(_.shuffle=!0);let A=Jm(_,Ue);if(Object.defineProperty(_,"context",{value:A,enumerable:!1}),Gm(A,E.fixtures),O&&Hm(_,bn(lg(ss(O,A),_),E?.timeout??Ue.config.testTimeout)),Ue.config.includeTaskLocation){let $=Error.stackTraceLimit;Error.stackTraceLimit=15;let R=new Error("stacktrace").stack;Error.stackTraceLimit=$;let N=au(R,_.each??!1);N&&(_.location=N)}return s.push(_),_},u=as(function(w,E,_){let{options:O,handler:A}=yn(E,_);typeof i=="object"&&(O=Object.assign({},i,O)),O.concurrent=this.concurrent||!this.sequential&&O?.concurrent,O.sequential=this.sequential||!this.concurrent&&O?.sequential;let $=l(Ot(w),{...this,...O,handler:A});$.type="test"}),f={type:"collector",name:e,mode:n,options:i,test:u,tasks:s,collect:y,task:l,clear:g,on:m};function m(w,...E){Qm(c)[w].push(...E)}function h(w){if(typeof i=="number"&&(i={timeout:i}),c={id:"",type:"suite",name:e,mode:n,each:o,file:void 0,shuffle:r,tasks:[],meta:Object.create(null),concurrent:i?.concurrent},Ue&&w&&Ue.config.includeTaskLocation){let E=Error.stackTraceLimit;Error.stackTraceLimit=15;let _=new Error("stacktrace").stack;Error.stackTraceLimit=E;let O=au(_,c.each??!1);O&&(c.location=O)}Zm(c,ag())}function g(){s.length=0,a.length=0,h(!1)}async function y(w){if(!w)throw new TypeError("File is required to collect tasks.");a.length=0,t&&await Vm(f,()=>t(u));let E=[];for(let _ of[...a,...s])E.push(_.type==="collector"?await _.collect(w):_);return c.file=w,c.tasks=E,E.forEach(_=>{_.suite=c,_.file=w}),c}return Um(f),f}function lg(e,t){return async(...n)=>{if(await e(...n),t.promises){let o=(await Promise.allSettled(t.promises)).map(i=>i.status==="rejected"?i.reason:void 0).filter(Boolean);if(o.length)throw o}}}function ug(){function e(t,n,r={}){let o=this.only?"only":this.skip?"skip":this.todo?"todo":"run",i=Ut.currentSuite||hu,{options:s,handler:a}=yn(n,r),c=s.concurrent||this.concurrent||s.sequential===!1,l=s.sequential||this.sequential||s.concurrent===!1;i?.options&&(s={...i.options,...s});let u=c||s.concurrent&&!l,f=l||s.sequential&&!c;return s.concurrent=u&&!f,s.sequential=f&&!u,cg(Ot(t),a,o,this.shuffle,this.each,s)}return e.each=function(t,...n){let r=this.withContext();return this.setContext("each",!0),Array.isArray(t)&&n.length&&(t=is(t,n)),(o,i,s)=>{let a=Ot(o),c=t.every(Array.isArray),{options:l,handler:u}=yn(i,s),f=typeof i=="function";t.forEach((m,h)=>{let g=Array.isArray(m)?m:[m];f?c?r(it(a,g,h),()=>u(...g),l):r(it(a,g,h),()=>u(m),l):c?r(it(a,g,h),l,()=>u(...g)):r(it(a,g,h),l,()=>u(m))}),this.setContext("each",void 0)}},e.skipIf=t=>t?gn.skip:gn,e.runIf=t=>t?gn:gn.skip,Rr(["concurrent","sequential","shuffle","skip","only","todo"],e)}function fg(e,t){let n=e;n.each=function(o,...i){let s=this.withContext();return this.setContext("each",!0),Array.isArray(o)&&i.length&&(o=is(o,i)),(a,c,l)=>{let u=Ot(a),f=o.every(Array.isArray),{options:m,handler:h}=yn(c,l),g=typeof c=="function";o.forEach((y,w)=>{let E=Array.isArray(y)?y:[y];g?f?s(it(u,E,w),()=>h(...E),m):s(it(u,E,w),()=>h(y),m):f?s(it(u,E,w),m,()=>h(...E)):s(it(u,E,w),m,()=>h(y))}),this.setContext("each",void 0)}},n.for=function(o,...i){let s=this.withContext();return Array.isArray(o)&&i.length&&(o=is(o,i)),(a,c,l)=>{let u=Ot(a),{options:f,handler:m}=yn(c,l);o.forEach((h,g)=>{let y=w=>m(h,w);y.__VITEST_FIXTURE_INDEX__=1,y.toString=()=>m.toString(),s(it(u,No(h),g),f,y)})}},n.skipIf=function(o){return o?this.skip:this},n.runIf=function(o){return o?this:this.skip},n.extend=function(o){let i=eg(o,t);return as(function(a,c,l){Dr().test.fn.call(this,Ot(a),c,l)},i)};let r=Rr(["concurrent","sequential","skip","only","todo","fails"],n);return t&&r.mergeContext(t),r}function as(e,t){return fg(e,t)}function Ot(e){return typeof e=="string"?e:e instanceof Function?e.name||"<anonymous>":String(e)}function it(e,t,n){e.includes("%#")&&(e=e.replace(/%%/g,"__vitest_escaped_%__").replace(/%#/g,`${n}`).replace(/__vitest_escaped_%__/g,"%%"));let r=e.split("%").length-1;e.includes("%f")&&(e.match(/%f/g)||[]).forEach((s,a)=>{if(jo(t[a])||Object.is(t[a],-0)){let c=0;e=e.replace(/%f/g,l=>(c++,c===a+1?"-%f":l))}});let o=nn(e,...t.slice(0,r));return nt(t[0])&&(o=o.replace(/\$([$\w.]+)/g,(i,s)=>{var a,c;return ko(Mo(t[0],s),{truncate:(c=(a=Ue?.config)==null?void 0:a.chaiConfig)==null?void 0:c.truncateThreshold})})),o}function is(e,t){let n=e.join("").trim().replace(/ /g,"").split(`
120
- `).map(o=>o.split("|"))[0],r=[];for(let o=0;o<Math.floor(t.length/n.length);o++){let i={};for(let s=0;s<n.length;s++)i[n[s]]=t[o*n.length+s];r.push(i)}return r}function au(e,t){let n=e.split(`
121
- `).slice(1);for(let r of n){let o=jr(r);if(o&&o.file===ig())return{line:o.line,column:t?o.column+1:o.column}}}function qr(){return sg().config.hookTimeout}function cs(e,t){return ye(e,'"beforeEach" callback',["function"]),Dr().on("beforeEach",bn(ss(e),t??qr(),!0))}function ls(e,t){return ye(e,'"afterEach" callback',["function"]),Dr().on("afterEach",bn(ss(e),t??qr(),!0))}var hg=du("onTestFailed",(e,t,n)=>{e.onFailed||(e.onFailed=[]),e.onFailed.push(bn(t,n??qr(),!0))}),pg=du("onTestFinished",(e,t,n)=>{e.onFinished||(e.onFinished=[]),e.onFinished.push(bn(t,n??qr(),!0))});function du(e,t){return(n,r)=>{ye(n,`"${e}" callback`,["function"]);let o=Lr();if(!o)throw new Error(`Hook ${e}() can only be called inside a test`);return t(o,n,r)}}var lS=globalThis.performance?globalThis.performance.now.bind(globalThis.performance):Date.now;var uS=globalThis.performance?globalThis.performance.now.bind(globalThis.performance):Date.now,fS=Date.now;var dg="__vitest_worker__";function Vt(){let e=globalThis[dg];if(!e){let t=`Vitest failed to access its internal state.
122
-
123
- One of the following is possible:
124
- - "vitest" is imported directly without running "vitest" command
125
- - "vitest" is imported inside "globalSetup" (to fix this, use "setupFiles" instead, because "globalSetup" runs in a different context)
126
- - Otherwise, it might be a Vitest bug. Please report it to https://github.com/vitest-dev/vitest/issues
127
- `;throw new Error(t)}return e}function mu(){return Vt()?.environment.name}function us(){return typeof process<"u"&&!!process.send}function gu(e,t=!1){let n=[/\/vitest\/dist\//,/\/vite-node\/dist\//,/vitest-virtual-\w+\/dist/,/@vitest\/dist/,...t?[]:[/^mock:/]];e.forEach((r,o)=>{n.some(i=>i.test(o))||e.invalidateModule(r)})}function mg(){let{setTimeout:e}=ft();return new Promise(t=>e(t,0))}async function fs(){await mg();let e=Vt(),t=[],n=0;for(let r of e.moduleCache.values())r.promise&&!r.evaluated&&t.push(r.promise),r.resolving&&n++;!t.length&&!n||(await Promise.allSettled(t),await fs())}var Br=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function yu(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Eg=44,Au="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Tg=new Uint8Array(64),Vu=new Uint8Array(128);for(let e=0;e<Au.length;e++){let t=Au.charCodeAt(e);Tg[e]=t,Vu[t]=e}function Tn(e,t){let n=0,r=0,o=0;do{let s=e.next();o=Vu[s],n|=(o&31)<<r,r+=5}while(o&32);let i=n&1;return n>>>=1,i&&(n=-2147483648|-n),t+n}function $u(e,t){return e.pos>=t?!1:e.peek()!==Eg}var ys=class{constructor(t){this.pos=0,this.buffer=t}next(){return this.buffer.charCodeAt(this.pos++)}peek(){return this.buffer.charCodeAt(this.pos)}indexOf(t){let{buffer:n,pos:r}=this,o=n.indexOf(t,r);return o===-1?n.length:o}};function xg(e){let{length:t}=e,n=new ys(e),r=[],o=0,i=0,s=0,a=0,c=0;do{let l=n.indexOf(";"),u=[],f=!0,m=0;for(o=0;n.pos<l;){let h;o=Tn(n,o),o<m&&(f=!1),m=o,$u(n,l)?(i=Tn(n,i),s=Tn(n,s),a=Tn(n,a),$u(n,l)?(c=Tn(n,c),h=[o,i,s,a,c]):h=[o,i,s,a]):h=[o],u.push(h),n.pos++}f||_g(u),r.push(u),n.pos=l+1}while(n.pos<=t);return r}function _g(e){e.sort(Cg)}function Cg(e,t){return e[0]-t[0]}var Og=/^[\w+.-]+:\/\//,Ig=/^([\w+.-]+:)\/\/([^@/#?]*@)?([^:/#?]*)(:\d+)?(\/[^#?]*)?(\?[^#]*)?(#.*)?/,Ag=/^file:(?:\/\/((?![a-z]:)[^/#?]*)?)?(\/?[^#?]*)(\?[^#]*)?(#.*)?/i,le;(function(e){e[e.Empty=1]="Empty",e[e.Hash=2]="Hash",e[e.Query=3]="Query",e[e.RelativePath=4]="RelativePath",e[e.AbsolutePath=5]="AbsolutePath",e[e.SchemeRelative=6]="SchemeRelative",e[e.Absolute=7]="Absolute"})(le||(le={}));function $g(e){return Og.test(e)}function kg(e){return e.startsWith("//")}function Ju(e){return e.startsWith("/")}function Pg(e){return e.startsWith("file:")}function ku(e){return/^[.?#]/.test(e)}function Vr(e){let t=Ig.exec(e);return Ku(t[1],t[2]||"",t[3],t[4]||"",t[5]||"/",t[6]||"",t[7]||"")}function Ng(e){let t=Ag.exec(e),n=t[2];return Ku("file:","",t[1]||"","",Ju(n)?n:"/"+n,t[3]||"",t[4]||"")}function Ku(e,t,n,r,o,i,s){return{scheme:e,user:t,host:n,port:r,path:o,query:i,hash:s,type:le.Absolute}}function Pu(e){if(kg(e)){let n=Vr("http:"+e);return n.scheme="",n.type=le.SchemeRelative,n}if(Ju(e)){let n=Vr("http://foo.com"+e);return n.scheme="",n.host="",n.type=le.AbsolutePath,n}if(Pg(e))return Ng(e);if($g(e))return Vr(e);let t=Vr("http://foo.com/"+e);return t.scheme="",t.host="",t.type=e?e.startsWith("?")?le.Query:e.startsWith("#")?le.Hash:le.RelativePath:le.Empty,t}function Mg(e){if(e.endsWith("/.."))return e;let t=e.lastIndexOf("/");return e.slice(0,t+1)}function jg(e,t){Xu(t,t.type),e.path==="/"?e.path=t.path:e.path=Mg(t.path)+e.path}function Xu(e,t){let n=t<=le.RelativePath,r=e.path.split("/"),o=1,i=0,s=!1;for(let c=1;c<r.length;c++){let l=r[c];if(!l){s=!0;continue}if(s=!1,l!=="."){if(l===".."){i?(s=!0,i--,o--):n&&(r[o++]=l);continue}r[o++]=l,i++}}let a="";for(let c=1;c<o;c++)a+="/"+r[c];(!a||s&&!a.endsWith("/.."))&&(a+="/"),e.path=a}function Rg(e,t){if(!e&&!t)return"";let n=Pu(e),r=n.type;if(t&&r!==le.Absolute){let i=Pu(t),s=i.type;switch(r){case le.Empty:n.hash=i.hash;case le.Hash:n.query=i.query;case le.Query:case le.RelativePath:jg(n,i);case le.AbsolutePath:n.user=i.user,n.host=i.host,n.port=i.port;case le.SchemeRelative:n.scheme=i.scheme}s>r&&(r=s)}Xu(n,r);let o=n.query+n.hash;switch(r){case le.Hash:case le.Query:return o;case le.RelativePath:{let i=n.path.slice(1);return i?ku(t||e)&&!ku(i)?"./"+i+o:i+o:o||"."}case le.AbsolutePath:return n.path+o;default:return n.scheme+"//"+n.user+n.host+n.port+n.path+o}}function Nu(e,t){return t&&!t.endsWith("/")&&(t+="/"),Rg(e,t)}function Fg(e){if(!e)return"";let t=e.lastIndexOf("/");return e.slice(0,t+1)}var mt=0,Lg=1,Dg=2,qg=3,Bg=4;function zg(e,t){let n=Mu(e,0);if(n===e.length)return e;t||(e=e.slice());for(let r=n;r<e.length;r=Mu(e,r+1))e[r]=Ug(e[r],t);return e}function Mu(e,t){for(let n=t;n<e.length;n++)if(!Wg(e[n]))return n;return e.length}function Wg(e){for(let t=1;t<e.length;t++)if(e[t][mt]<e[t-1][mt])return!1;return!0}function Ug(e,t){return t||(e=e.slice()),e.sort(Vg)}function Vg(e,t){return e[mt]-t[mt]}var Xr=!1;function Jg(e,t,n,r){for(;n<=r;){let o=n+(r-n>>1),i=e[o][mt]-t;if(i===0)return Xr=!0,o;i<0?n=o+1:r=o-1}return Xr=!1,n-1}function Kg(e,t,n){for(let r=n+1;r<e.length&&e[r][mt]===t;n=r++);return n}function Xg(e,t,n){for(let r=n-1;r>=0&&e[r][mt]===t;n=r--);return n}function Hg(){return{lastKey:-1,lastNeedle:-1,lastIndex:-1}}function Gg(e,t,n,r){let{lastKey:o,lastNeedle:i,lastIndex:s}=n,a=0,c=e.length-1;if(r===o){if(t===i)return Xr=s!==-1&&e[s][mt]===t,s;t>=i?a=s===-1?0:s:c=s}return n.lastKey=r,n.lastNeedle=t,n.lastIndex=Jg(e,t,a,c)}var Yg="`line` must be greater than 0 (lines start at line 1)",Zg="`column` must be greater than or equal to 0 (columns start at column 0)",ju=-1,Qg=1,bs=class{constructor(t,n){let r=typeof t=="string";if(!r&&t._decodedMemo)return t;let o=r?JSON.parse(t):t,{version:i,file:s,names:a,sourceRoot:c,sources:l,sourcesContent:u}=o;this.version=i,this.file=s,this.names=a||[],this.sourceRoot=c,this.sources=l,this.sourcesContent=u,this.ignoreList=o.ignoreList||o.x_google_ignoreList||void 0;let f=Nu(c||"",Fg(n));this.resolvedSources=l.map(h=>Nu(h||"",f));let{mappings:m}=o;typeof m=="string"?(this._encoded=m,this._decoded=void 0):(this._encoded=void 0,this._decoded=zg(m,r)),this._decodedMemo=Hg(),this._bySources=void 0,this._bySourceMemos=void 0}};function ey(e){var t;return(t=e)._decoded||(t._decoded=xg(e._encoded))}function ty(e,t){let{line:n,column:r,bias:o}=t;if(n--,n<0)throw new Error(Yg);if(r<0)throw new Error(Zg);let i=ey(e);if(n>=i.length)return Jr(null,null,null,null);let s=i[n],a=ny(s,e._decodedMemo,n,r,o||Qg);if(a===-1)return Jr(null,null,null,null);let c=s[a];if(c.length===1)return Jr(null,null,null,null);let{names:l,resolvedSources:u}=e;return Jr(u[c[Lg]],c[Dg]+1,c[qg],c.length===5?l[c[Bg]]:null)}function Jr(e,t,n,r){return{source:e,line:t,column:n,name:r}}function ny(e,t,n,r,o){let i=Gg(e,r,t,n);return Xr?i=(o===ju?Kg:Xg)(e,r,i):o===ju&&i++,i===-1||i===e.length?-1:i}function Hu(e){return e!=null}function ry(e){return e===null||typeof e!="function"&&typeof e!="object"}function Kr(e){return e!=null&&typeof e=="object"&&!Array.isArray(e)}function oy(e){let t=-1,n=null,r=0,o=0,i=null;for(;t<=e.length;){i=e[t],t++;let s=e[t];if((s==='"'||s==="'"||s==="`")&&i!=="\\"&&(n===s?n=null:n||(n=s)),n||(s==="("&&r++,s===")"&&o++),r&&o&&r===o)return t}return null}var Gu=/^\s*at .*(?:\S:\d+|\(native\))/m,iy=/^(?:eval@)?(?:\[native code\])?$/,sy=["node:internal",/\/packages\/\w+\/dist\//,/\/@vitest\/\w+\/dist\//,"/vitest/dist/","/vitest/src/","/vite-node/dist/","/vite-node/src/","/node_modules/chai/","/node_modules/tinypool/","/node_modules/tinyspy/","/deps/chunk-","/deps/@vitest","/deps/loupe","/deps/chai",/node:\w+/,/__vitest_test__/,/__vitest_browser__/,/\/deps\/vitest_/];function Yu(e){if(!e.includes(":"))return[e];let n=/(.+?)(?::(\d+))?(?::(\d+))?$/.exec(e.replace(/^\(|\)$/g,""));if(!n)return[e];let r=n[1];if(r.startsWith("async ")&&(r=r.slice(6)),(r.startsWith("http:")||r.startsWith("https:"))&&(r=new URL(r).pathname),r.startsWith("/@fs/")){let o=/^\/@fs\/[a-zA-Z]:\//.test(r);r=r.slice(o?5:4)}return[r,n[2]||void 0,n[3]||void 0]}function ay(e){let t=e.trim();if(iy.test(t)||(t.includes(" > eval")&&(t=t.replace(/ line (\d+)(?: > eval line \d+)* > eval:\d+:\d+/g,":$1")),!t.includes("@")&&!t.includes(":")))return null;let n=/((.*".+"[^@]*)?[^@]*)(@)/,r=t.match(n),o=r&&r[1]?r[1]:void 0,[i,s,a]=Yu(t.replace(n,""));return!i||!s||!a?null:{file:i,method:o||"",line:Number.parseInt(s),column:Number.parseInt(a)}}function cy(e){let t=e.trim();if(!Gu.test(t))return null;t.includes("(eval ")&&(t=t.replace(/eval code/g,"eval").replace(/(\(eval at [^()]*)|(,.*$)/g,""));let n=t.replace(/^\s+/,"").replace(/\(eval code/g,"(").replace(/^.*?\s+/,""),r=n.match(/ (\(.+\)$)/);n=r?n.replace(r[0],""):n;let[o,i,s]=Yu(r?r[1]:n),a=r&&n||"",c=o&&["eval","<anonymous>"].includes(o)?void 0:o;return!c||!i||!s?null:(a.startsWith("async ")&&(a=a.slice(6)),c.startsWith("file://")&&(c=c.slice(7)),c=es(c),a&&(a=a.replace(/__vite_ssr_import_\d+__\./g,"")),{method:a,file:c,line:Number.parseInt(i),column:Number.parseInt(s)})}function ly(e,t={}){let{ignoreStackEntries:n=sy}=t,r=Gu.test(e)?fy(e):uy(e);return n.length&&(r=r.filter(o=>!n.some(i=>o.file.match(i)))),r.map(o=>{var i;t.getFileName&&(o.file=t.getFileName(o.file));let s=(i=t.getSourceMap)==null?void 0:i.call(t,o.file);if(!s||typeof s!="object"||!s.version)return o;let a=new bs(s),{line:c,column:l}=ty(a,o);return c!=null&&l!=null?{...o,line:c,column:l}:o})}function uy(e){return e.split(`
128
- `).map(t=>ay(t)).filter(Hu)}function fy(e){return e.split(`
129
- `).map(t=>cy(t)).filter(Hu)}function hy(e,t={}){if(!e||ry(e))return[];if(e.stacks)return e.stacks;let n=e.stack||e.stackStr||"",r=ly(n,t);return t.frameFilter&&(r=r.filter(o=>t.frameFilter(e,o)!==!1)),e.stacks=r,r}var py=()=>"Promise{\u2026}";try{let{getPromiseDetails:e,kPending:t,kRejected:n}=process.binding("util");Array.isArray(e(Promise.resolve()))&&(py=(r,o)=>{let[i,s]=e(r);return i===t?"Promise{<pending>}":`Promise${i===n?"!":""}{${o.inspect(s,o)}}`})}catch{}var Ru=!1;try{let e=require("util");Ru=e.inspect?e.inspect.custom:!1}catch{Ru=!1}function dy(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var ms,Fu;function my(){if(Fu)return ms;Fu=1;var e,t,n,r,o,i,s,a,c,l,u,f,m,h,g,y,w,E,_;return m=/\/(?![*\/])(?:\[(?:(?![\]\\]).|\\.)*\]|(?![\/\\]).|\\.)*(\/[$_\u200C\u200D\p{ID_Continue}]*|\\)?/yu,f=/--|\+\+|=>|\.{3}|\??\.(?!\d)|(?:&&|\|\||\?\?|[+\-%&|^]|\*{1,2}|<{1,2}|>{1,3}|!=?|={1,2}|\/(?![\/*]))=?|[?~,:;[\](){}]/y,e=/(\x23?)(?=[$_\p{ID_Start}\\])(?:[$_\u200C\u200D\p{ID_Continue}]|\\u[\da-fA-F]{4}|\\u\{[\da-fA-F]+\})+/yu,g=/(['"])(?:(?!\1)[^\\\n\r]|\\(?:\r\n|[^]))*(\1)?/y,u=/(?:0[xX][\da-fA-F](?:_?[\da-fA-F])*|0[oO][0-7](?:_?[0-7])*|0[bB][01](?:_?[01])*)n?|0n|[1-9](?:_?\d)*n|(?:(?:0(?!\d)|0\d*[89]\d*|[1-9](?:_?\d)*)(?:\.(?:\d(?:_?\d)*)?)?|\.\d(?:_?\d)*)(?:[eE][+-]?\d(?:_?\d)*)?|0[0-7]+/y,y=/[`}](?:[^`\\$]|\\[^]|\$(?!\{))*(`|\$\{)?/y,_=/[\t\v\f\ufeff\p{Zs}]+/yu,a=/\r?\n|[\r\u2028\u2029]/y,c=/\/\*(?:[^*]|\*(?!\/))*(\*\/)?/y,h=/\/\/.*/y,n=/[<>.:={}]|\/(?![\/*])/y,t=/[$_\p{ID_Start}][$_\u200C\u200D\p{ID_Continue}-]*/yu,r=/(['"])(?:(?!\1)[^])*(\1)?/y,o=/[^<>{}]+/y,E=/^(?:[\/+-]|\.{3}|\?(?:InterpolationIn(?:JSX|Template)|NoLineTerminatorHere|NonExpressionParenEnd|UnaryIncDec))?$|[{}([,;<>=*%&|^!~?:]$/,w=/^(?:=>|[;\]){}]|else|\?(?:NoLineTerminatorHere|NonExpressionParenEnd))?$/,i=/^(?:await|case|default|delete|do|else|instanceof|new|return|throw|typeof|void|yield)$/,s=/^(?:return|throw|yield)$/,l=RegExp(a.source),ms=function*(O,{jsx:A=!1}={}){var $,R,N,I,k,V,C,W,ne,q,z,j,G,L;for({length:V}=O,I=0,k="",L=[{tag:"JS"}],$=[],z=0,j=!1;I<V;){switch(W=L[L.length-1],W.tag){case"JS":case"JSNonExpressionParen":case"InterpolationInTemplate":case"InterpolationInJSX":if(O[I]==="/"&&(E.test(k)||i.test(k))&&(m.lastIndex=I,C=m.exec(O))){I=m.lastIndex,k=C[0],j=!0,yield{type:"RegularExpressionLiteral",value:C[0],closed:C[1]!==void 0&&C[1]!=="\\"};continue}if(f.lastIndex=I,C=f.exec(O)){switch(G=C[0],ne=f.lastIndex,q=G,G){case"(":k==="?NonExpressionParenKeyword"&&L.push({tag:"JSNonExpressionParen",nesting:z}),z++,j=!1;break;case")":z--,j=!0,W.tag==="JSNonExpressionParen"&&z===W.nesting&&(L.pop(),q="?NonExpressionParenEnd",j=!1);break;case"{":f.lastIndex=0,N=!w.test(k)&&(E.test(k)||i.test(k)),$.push(N),j=!1;break;case"}":switch(W.tag){case"InterpolationInTemplate":if($.length===W.nesting){y.lastIndex=I,C=y.exec(O),I=y.lastIndex,k=C[0],C[1]==="${"?(k="?InterpolationInTemplate",j=!1,yield{type:"TemplateMiddle",value:C[0]}):(L.pop(),j=!0,yield{type:"TemplateTail",value:C[0],closed:C[1]==="`"});continue}break;case"InterpolationInJSX":if($.length===W.nesting){L.pop(),I+=1,k="}",yield{type:"JSXPunctuator",value:"}"};continue}}j=$.pop(),q=j?"?ExpressionBraceEnd":"}";break;case"]":j=!0;break;case"++":case"--":q=j?"?PostfixIncDec":"?UnaryIncDec";break;case"<":if(A&&(E.test(k)||i.test(k))){L.push({tag:"JSXTag"}),I+=1,k="<",yield{type:"JSXPunctuator",value:G};continue}j=!1;break;default:j=!1}I=ne,k=q,yield{type:"Punctuator",value:G};continue}if(e.lastIndex=I,C=e.exec(O)){switch(I=e.lastIndex,q=C[0],C[0]){case"for":case"if":case"while":case"with":k!=="."&&k!=="?."&&(q="?NonExpressionParenKeyword")}k=q,j=!i.test(C[0]),yield{type:C[1]==="#"?"PrivateIdentifier":"IdentifierName",value:C[0]};continue}if(g.lastIndex=I,C=g.exec(O)){I=g.lastIndex,k=C[0],j=!0,yield{type:"StringLiteral",value:C[0],closed:C[2]!==void 0};continue}if(u.lastIndex=I,C=u.exec(O)){I=u.lastIndex,k=C[0],j=!0,yield{type:"NumericLiteral",value:C[0]};continue}if(y.lastIndex=I,C=y.exec(O)){I=y.lastIndex,k=C[0],C[1]==="${"?(k="?InterpolationInTemplate",L.push({tag:"InterpolationInTemplate",nesting:$.length}),j=!1,yield{type:"TemplateHead",value:C[0]}):(j=!0,yield{type:"NoSubstitutionTemplate",value:C[0],closed:C[1]==="`"});continue}break;case"JSXTag":case"JSXTagEnd":if(n.lastIndex=I,C=n.exec(O)){switch(I=n.lastIndex,q=C[0],C[0]){case"<":L.push({tag:"JSXTag"});break;case">":L.pop(),k==="/"||W.tag==="JSXTagEnd"?(q="?JSX",j=!0):L.push({tag:"JSXChildren"});break;case"{":L.push({tag:"InterpolationInJSX",nesting:$.length}),q="?InterpolationInJSX",j=!1;break;case"/":k==="<"&&(L.pop(),L[L.length-1].tag==="JSXChildren"&&L.pop(),L.push({tag:"JSXTagEnd"}))}k=q,yield{type:"JSXPunctuator",value:C[0]};continue}if(t.lastIndex=I,C=t.exec(O)){I=t.lastIndex,k=C[0],yield{type:"JSXIdentifier",value:C[0]};continue}if(r.lastIndex=I,C=r.exec(O)){I=r.lastIndex,k=C[0],yield{type:"JSXString",value:C[0],closed:C[2]!==void 0};continue}break;case"JSXChildren":if(o.lastIndex=I,C=o.exec(O)){I=o.lastIndex,k=C[0],yield{type:"JSXText",value:C[0]};continue}switch(O[I]){case"<":L.push({tag:"JSXTag"}),I++,k="<",yield{type:"JSXPunctuator",value:"<"};continue;case"{":L.push({tag:"InterpolationInJSX",nesting:$.length}),I++,k="?InterpolationInJSX",j=!1,yield{type:"JSXPunctuator",value:"{"};continue}}if(_.lastIndex=I,C=_.exec(O)){I=_.lastIndex,yield{type:"WhiteSpace",value:C[0]};continue}if(a.lastIndex=I,C=a.exec(O)){I=a.lastIndex,j=!1,s.test(k)&&(k="?NoLineTerminatorHere"),yield{type:"LineTerminatorSequence",value:C[0]};continue}if(c.lastIndex=I,C=c.exec(O)){I=c.lastIndex,l.test(C[0])&&(j=!1,s.test(k)&&(k="?NoLineTerminatorHere")),yield{type:"MultiLineComment",value:C[0],closed:C[1]!==void 0};continue}if(h.lastIndex=I,C=h.exec(O)){I=h.lastIndex,j=!1,yield{type:"SingleLineComment",value:C[0]};continue}R=String.fromCodePoint(O.codePointAt(I)),I+=R.length,k=R,j=!1,yield{type:W.tag.startsWith("JSX")?"JSXInvalid":"Invalid",value:R}}},ms}my();var Zu={keyword:["break","case","catch","continue","debugger","default","do","else","finally","for","function","if","return","switch","throw","try","var","const","while","with","new","this","super","class","extends","export","import","null","true","false","in","instanceof","typeof","void","delete"],strict:["implements","interface","let","package","private","protected","public","static","yield"]};new Set(Zu.keyword);new Set(Zu.strict);var gy={reset:[0,0],bold:[1,22,"\x1B[22m\x1B[1m"],dim:[2,22,"\x1B[22m\x1B[2m"],italic:[3,23],underline:[4,24],inverse:[7,27],hidden:[8,28],strikethrough:[9,29],black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],gray:[90,39],bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],blackBright:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39],bgBlackBright:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]},yy=Object.entries(gy);function Es(e){return String(e)}Es.open="";Es.close="";function by(e=!1){let t=typeof process<"u"?process:void 0,n=t?.env||{},r=t?.argv||[];return!("NO_COLOR"in n||r.includes("--no-color"))&&("FORCE_COLOR"in n||r.includes("--color")||t?.platform==="win32"||e&&n.TERM!=="dumb"||"CI"in n)||typeof window<"u"&&!!window.chrome}function wy(e=!1){let t=by(e),n=(s,a,c,l)=>{let u="",f=0;do u+=s.substring(f,l)+c,f=l+a.length,l=s.indexOf(a,f);while(~l);return u+s.substring(f)},r=(s,a,c=s)=>{let l=u=>{let f=String(u),m=f.indexOf(a,s.length);return~m?s+n(f,a,c,m)+a:s+f+a};return l.open=s,l.close=a,l},o={isColorSupported:t},i=s=>`\x1B[${s}m`;for(let[s,a]of yy)o[s]=t?r(i(a[0]),i(a[1]),a[2]):Es;return o}wy(!1);var Ts=/\r?\n/;function vy(e,t,n){let r=e.split(Ts),o=/\r\n/.test(e)?2:1,i=0;if(t>r.length)return e.length;for(let s=0;s<t-1;s++)i+=r[s].length+o;return i+n}function Sy(e,t){if(t>e.length)throw new Error(`offset is longer than source length! offset ${t} > length ${e.length}`);let n=e.split(Ts),r=/\r\n/.test(e)?2:1,o=0,i=0;for(;i<n.length;i++){let s=n[i].length+r;if(o+s>=t)break;o+=s}return i+1}async function Ey(e,t){let n=(await Promise.resolve().then(()=>(Iu(),Ou))).default,r=new Set(t.map(o=>o.file));await Promise.all(Array.from(r).map(async o=>{let i=t.filter(l=>l.file===o),s=await e.readSnapshotFile(o),a=new n(s);for(let l of i){let u=vy(s,l.line,l.column);Iy(s,a,u,l.snapshot)}let c=a.toString();c!==s&&await e.saveSnapshotFile(o,c)}))}var Ty=/(?:toMatchInlineSnapshot|toThrowErrorMatchingInlineSnapshot)\s*\(\s*(?:\/\*[\s\S]*\*\/\s*|\/\/.*(?:[\n\r\u2028\u2029]\s*|[\t\v\f \xA0\u1680\u2000-\u200A\u202F\u205F\u3000\uFEFF]))*\{/;function xy(e,t,n,r){let o=e.slice(n),i=Ty.exec(o);if(!i)return!1;o=o.slice(i.index);let s=oy(o);if(s===null)return!1;s+=n+i.index;let a=n+i.index+i[0].length,c=_y(e,a),l=`, ${Qu(r,e,n)}`;return c===s?t.appendLeft(s,l):t.overwrite(c,s,l),!0}function _y(e,t){let n=1,r=0;for(;n!==r&&t<e.length;){let o=e[t++];o==="{"?n++:o==="}"&&r++}return t}function Qu(e,t,n){let r=Sy(t,n),i=t.split(Ts)[r-1].match(/^\s*/)[0]||"",s=i.includes(" ")?`${i} `:`${i} `,a=e.trim().replace(/\\/g,"\\\\").split(/\n/g),c=a.length<=1,l="`";return c?`${l}${a.join(`
130
- `).replace(/`/g,"\\`").replace(/\$\{/g,"\\${")}${l}`:`${l}
131
- ${a.map(u=>u?s+u:"").join(`
132
- `).replace(/`/g,"\\`").replace(/\$\{/g,"\\${")}
133
- ${i}${l}`}var Lu="toMatchInlineSnapshot",Du="toThrowErrorMatchingInlineSnapshot";function Cy(e,t){let n=t-Lu.length;if(e.slice(n,t)===Lu)return{code:e.slice(n),index:n};let r=t-Du.length;return e.slice(t-r,t)===Du?{code:e.slice(t-r),index:t-r}:{code:e.slice(t),index:t}}var Oy=/(?:toMatchInlineSnapshot|toThrowErrorMatchingInlineSnapshot)\s*\(\s*(?:\/\*[\s\S]*\*\/\s*|\/\/.*(?:[\n\r\u2028\u2029]\s*|[\t\v\f \xA0\u1680\u2000-\u200A\u202F\u205F\u3000\uFEFF]))*[\w$]*(['"`)])/;function Iy(e,t,n,r){let{code:o,index:i}=Cy(e,n),s=Oy.exec(o),a=/toMatchInlineSnapshot|toThrowErrorMatchingInlineSnapshot/.exec(o);if(!s||s.index!==a?.index)return xy(e,t,i,r);let c=s[1],l=i+s.index+s[0].length,u=Qu(r,e,i);if(c===")")return t.appendRight(l-1,u),!0;let m=new RegExp(`(?:^|[^\\\\])${c}`).exec(e.slice(l));if(!m)return!1;let h=l+m.index+m[0].length;return t.overwrite(l-1,h,u),!0}var Ay=/^([^\S\n]*)\S/m;function xs(e){let t=e.match(Ay);if(!t||!t[1])return e;let n=t[1],r=e.split(/\n/g);if(r.length<=2||r[0].trim()!==""||r[r.length-1].trim()!=="")return e;for(let o=1;o<r.length-1;o++)if(r[o]!==""){if(r[o].indexOf(n)!==0)return e;r[o]=r[o].substring(n.length)}return r[r.length-1]="",e=r.join(`
134
- `),e}async function $y(e,t){await Promise.all(t.map(async n=>{n.readonly||await e.saveSnapshotFile(n.file,n.snapshot)}))}var gs={exports:{}},qu;function ky(){if(qu)return gs.exports;qu=1;var e=function(t,n){var r,o,i=1,s=0,a=0,c=String.alphabet;function l(u,f,m){if(m){for(r=f;m=l(u,r),m<76&&m>65;)++r;return+u.slice(f-1,r)}return m=c&&c.indexOf(u.charAt(f)),m>-1?m+76:(m=u.charCodeAt(f)||0,m<45||m>127?m:m<46?65:m<48?m-1:m<58?m+18:m<65?m-11:m<91?m+11:m<97?m-37:m<123?m+5:m-63)}if((t+="")!=(n+="")){for(;i;)if(o=l(t,s++),i=l(n,a++),o<76&&i<76&&o>66&&i>66&&(o=l(t,s,s),i=l(n,a,s=r),a=r),o!=i)return o<i?-1:1}return 0};try{gs.exports=e}catch{String.naturalCompare=e}return gs.exports}var Py=ky(),Ny=dy(Py),My=(e,t,n,r,o,i)=>{let s=e.getMockName(),a=s==="vi.fn()"?"":` ${s}`,c="";if(e.mock.calls.length!==0){let l=n+t.indent;c=` {${t.spacingOuter}${l}"calls": ${i(e.mock.calls,t,l,r,o)}${t.min?", ":","}${t.spacingOuter}${l}"results": ${i(e.mock.results,t,l,r,o)}${t.min?"":","}${t.spacingOuter}${n}}`}return`[MockFunction${a}]${c}`},jy=e=>e&&!!e._isMockFunction,Ry={serialize:My,test:jy},{DOMCollection:Fy,DOMElement:Ly,Immutable:Dy,ReactElement:qy,ReactTestComponent:By,AsymmetricMatcher:zy}=Nt,ws=[By,qy,Ly,Fy,Dy,zy,Ry];function ef(e){ws=[e].concat(ws)}function Wy(){return ws}function Uy(e,t){return`${e} ${t}`}function Vy(e){if(!/ \d+$/.test(e))throw new Error("Snapshot keys must end with a number.");return e.replace(/ \d+$/,"")}function Jy(e,t){let n=t.updateSnapshot,r=Object.create(null),o="",i=!1;if(e!=null)try{o=e,new Function("exports",o)(r)}catch{}return(n==="all"||n==="new")&&o&&(i=!0),{data:r,dirty:i}}function Ky(e){return e.includes(`
135
- `)?`
136
- ${e}
137
- `:e}function Bu(e){return e.length>2&&e.startsWith(`
138
- `)&&e.endsWith(`
139
- `)?e.slice(1,-1):e}var Xy=!0,Hy=!1;function Gy(e,t=2,n={}){return _s(Ae(e,{escapeRegex:Xy,indent:t,plugins:Wy(),printFunctionName:Hy,...n}))}function Yy(e){return e.replace(/`|\\|\$\{/g,"\\$&")}function zu(e){return`\`${Yy(e)}\``}function _s(e){return e.replace(/\r\n|\r/g,`
140
- `)}async function Zy(e,t,n){let r=Object.keys(t).sort(Ny).map(a=>`exports[${zu(a)}] = ${zu(_s(t[a]))};`),o=`${e.getHeader()}
141
-
142
- ${r.join(`
143
-
144
- `)}
145
- `,i=await e.readSnapshotFile(n);i!=null&&i===o||await e.saveSnapshotFile(n,o)}function Wu(e){function t(){var o,i;let s=/^( +)\}\s+$/m.exec(e||""),a=(o=s?.[1])==null?void 0:o.length;if(a)return a;let c=/^\n( +)"/.exec(e||"");return((i=c?.[1])==null?void 0:i.length)||0}let n=t(),r=e?.trim();return n&&(r=r?.replace(new RegExp(`^${" ".repeat(n)}`,"gm"),"").replace(/ +\}$/,"}")),r}function vs(e=[],t=[]){let n=Array.from(e);return t.forEach((r,o)=>{let i=n[o];Array.isArray(e[o])?n[o]=vs(e[o],r):Kr(i)?n[o]=Cs(e[o],r):n[o]=r}),n}function Cs(e,t){if(Kr(e)&&Kr(t)){let n={...e};return Object.keys(t).forEach(r=>{Kr(t[r])&&!t[r].$$typeof?r in e?n[r]=Cs(e[r],t[r]):Object.assign(n,{[r]:t[r]}):Array.isArray(t[r])?n[r]=vs(e[r],t[r]):Object.assign(n,{[r]:t[r]})}),n}else if(Array.isArray(e)&&Array.isArray(t))return vs(e,t);return e}var Ss=class e{constructor(t,n,r,o){this.testFilePath=t,this.snapshotPath=n;let{data:i,dirty:s}=Jy(r,o);this._fileExists=r!=null,this._initialData=i,this._snapshotData=i,this._dirty=s,this._inlineSnapshots=[],this._inlineSnapshotStacks=[],this._rawSnapshots=[],this._uncheckedKeys=new Set(Object.keys(this._snapshotData)),this._counters=new Map,this.expand=o.expand||!1,this.added=0,this.matched=0,this.unmatched=0,this._updateSnapshot=o.updateSnapshot,this.updated=0,this._snapshotFormat={printBasicPrototype:!1,escapeString:!1,...o.snapshotFormat},this._environment=o.snapshotEnvironment}_counters;_dirty;_updateSnapshot;_snapshotData;_initialData;_inlineSnapshots;_inlineSnapshotStacks;_rawSnapshots;_uncheckedKeys;_snapshotFormat;_environment;_fileExists;added;expand;matched;unmatched;updated;static async create(t,n){let r=await n.snapshotEnvironment.resolvePath(t),o=await n.snapshotEnvironment.readSnapshotFile(r);return new e(t,r,o,n)}get environment(){return this._environment}markSnapshotsAsCheckedForTest(t){this._uncheckedKeys.forEach(n=>{Vy(n)===t&&this._uncheckedKeys.delete(n)})}_inferInlineSnapshotStack(t){let n=t.findIndex(o=>o.method.match(/__VITEST_(RESOLVES|REJECTS)__/));if(n!==-1)return t[n+3];let r=t.findIndex(o=>o.method.includes("__INLINE_SNAPSHOT__"));return r!==-1?t[r+2]:null}_addSnapshot(t,n,r){this._dirty=!0,r.stack?this._inlineSnapshots.push({snapshot:n,...r.stack}):r.rawSnapshot?this._rawSnapshots.push({...r.rawSnapshot,snapshot:n}):this._snapshotData[t]=n}clear(){this._snapshotData=this._initialData,this._counters=new Map,this.added=0,this.matched=0,this.unmatched=0,this.updated=0,this._dirty=!1}async save(){let t=Object.keys(this._snapshotData).length,n=this._inlineSnapshots.length,r=this._rawSnapshots.length,o=!t&&!n&&!r,i={deleted:!1,saved:!1};return(this._dirty||this._uncheckedKeys.size)&&!o?(t&&(await Zy(this._environment,this._snapshotData,this.snapshotPath),this._fileExists=!0),n&&await Ey(this._environment,this._inlineSnapshots),r&&await $y(this._environment,this._rawSnapshots),i.saved=!0):!t&&this._fileExists&&(this._updateSnapshot==="all"&&(await this._environment.removeSnapshotFile(this.snapshotPath),this._fileExists=!1),i.deleted=!0),i}getUncheckedCount(){return this._uncheckedKeys.size||0}getUncheckedKeys(){return Array.from(this._uncheckedKeys)}removeUncheckedKeys(){this._updateSnapshot==="all"&&this._uncheckedKeys.size&&(this._dirty=!0,this._uncheckedKeys.forEach(t=>delete this._snapshotData[t]),this._uncheckedKeys.clear())}match({testName:t,received:n,key:r,inlineSnapshot:o,isInline:i,error:s,rawSnapshot:a}){var c,l;this._counters.set(t,(this._counters.get(t)||0)+1);let u=Number(this._counters.get(t));r||(r=Uy(t,u)),i&&this._snapshotData[r]!==void 0||this._uncheckedKeys.delete(r);let f=a&&typeof n=="string"?n:Gy(n,void 0,this._snapshotFormat);a||(f=Ky(f)),a&&a.content&&a.content.match(/\r\n/)&&!f.match(/\r\n/)&&(a.content=_s(a.content));let m=i?o:a?a.content:this._snapshotData[r],h=Wu(m),g=h===Wu(f),y=m!==void 0,w=i||this._fileExists||a&&a.content!=null;g&&!i&&!a&&(this._snapshotData[r]=f);let E;if(i){let _=hy(s||new Error("snapshot"),{ignoreStackEntries:[]}),O=this._inferInlineSnapshotStack(_);if(!O)throw new Error(`@vitest/snapshot: Couldn't infer stack frame for inline snapshot.
146
- ${JSON.stringify(_)}`);if(E=((l=(c=this.environment).processStackTrace)==null?void 0:l.call(c,O))||O,E.column--,this._inlineSnapshotStacks.some(A=>A.file===E.file&&A.line===E.line&&A.column===E.column))throw this._inlineSnapshots=this._inlineSnapshots.filter(A=>!(A.file===E.file&&A.line===E.line&&A.column===E.column)),new Error("toMatchInlineSnapshot cannot be called multiple times at the same location.");this._inlineSnapshotStacks.push(E)}return y&&this._updateSnapshot==="all"||(!y||!w)&&(this._updateSnapshot==="new"||this._updateSnapshot==="all")?(this._updateSnapshot==="all"?g?this.matched++:(y?this.updated++:this.added++,this._addSnapshot(r,f,{stack:E,rawSnapshot:a})):(this._addSnapshot(r,f,{stack:E,rawSnapshot:a}),this.added++),{actual:"",count:u,expected:"",key:r,pass:!0}):g?(this.matched++,{actual:"",count:u,expected:"",key:r,pass:!0}):(this.unmatched++,{actual:Bu(f),count:u,expected:h!==void 0?Bu(h):void 0,key:r,pass:!1})}async pack(){let t={filepath:this.testFilePath,added:0,fileDeleted:!1,matched:0,unchecked:0,uncheckedKeys:[],unmatched:0,updated:0},n=this.getUncheckedCount(),r=this.getUncheckedKeys();n&&this.removeUncheckedKeys();let o=await this.save();return t.fileDeleted=o.deleted,t.added=this.added,t.matched=this.matched,t.unmatched=this.unmatched,t.updated=this.updated,t.unchecked=o.deleted?0:n,t.uncheckedKeys=Array.from(r),t}};function Uu(e,t,n,r){let o=new Error(e);return Object.defineProperty(o,"actual",{value:n,enumerable:!0,configurable:!0,writable:!0}),Object.defineProperty(o,"expected",{value:r,enumerable:!0,configurable:!0,writable:!0}),Object.defineProperty(o,"diffOptions",{value:{expand:t}}),o}var Hr=class{constructor(t={}){this.options=t}filepath;name;snapshotState;snapshotStateMap=new Map;async startCurrentRun(t,n,r){var o;this.filepath=t,this.name=n,((o=this.snapshotState)==null?void 0:o.testFilePath)!==t&&(await this.finishCurrentRun(),this.getSnapshotState(t)||this.snapshotStateMap.set(t,await Ss.create(t,r)),this.snapshotState=this.getSnapshotState(t))}getSnapshotState(t){return this.snapshotStateMap.get(t)}clearTest(){this.filepath=void 0,this.name=void 0}skipTestSnapshots(t){var n;(n=this.snapshotState)==null||n.markSnapshotsAsCheckedForTest(t)}assert(t){var n,r,o,i;let{filepath:s=this.filepath,name:a=this.name,message:c,isInline:l=!1,properties:u,inlineSnapshot:f,error:m,errorMessage:h,rawSnapshot:g}=t,{received:y}=t;if(!s)throw new Error("Snapshot cannot be used outside of test");if(typeof u=="object"){if(typeof y!="object"||!y)throw new Error("Received value must be an object when the matcher has properties");try{if(((r=(n=this.options).isEqual)==null?void 0:r.call(n,y,u))??!1)y=Cs(y,u);else throw Uu("Snapshot properties mismatched",(o=this.snapshotState)==null?void 0:o.expand,y,u)}catch(R){throw R.message=h||"Snapshot mismatched",R}}let w=[a,...c?[c]:[]].join(" > "),E=this.getSnapshotState(s),{actual:_,expected:O,key:A,pass:$}=E.match({testName:w,received:y,isInline:l,error:m,inlineSnapshot:f,rawSnapshot:g});if(!$)throw Uu(`Snapshot \`${A||"unknown"}\` mismatched`,(i=this.snapshotState)==null?void 0:i.expand,_?.trim(),O?.trim())}async assertRaw(t){if(!t.rawSnapshot)throw new Error("Raw snapshot is required");let{filepath:n=this.filepath,rawSnapshot:r}=t;if(r.content==null){if(!n)throw new Error("Snapshot cannot be used outside of test");let o=this.getSnapshotState(n);t.filepath||(t.filepath=n),r.file=await o.environment.resolveRawPath(n,r.file),r.content=await o.environment.readSnapshotFile(r.file)??void 0}return this.assert(t)}async finishCurrentRun(){if(!this.snapshotState)return null;let t=await this.snapshotState.pack();return this.snapshotState=void 0,t}clear(){this.snapshotStateMap.clear()}};var Fe=Date,Os=null,gt=class e extends Fe{constructor(t,n,r,o,i,s,a){super();let c;switch(arguments.length){case 0:Os!==null?c=new Fe(Os.valueOf()):c=new Fe;break;case 1:c=new Fe(t);break;default:r=typeof r>"u"?1:r,o=o||0,i=i||0,s=s||0,a=a||0,c=new Fe(t,n,r,o,i,s,a);break}return Object.setPrototypeOf(c,e.prototype),c}};gt.UTC=Fe.UTC;gt.now=function(){return new gt().valueOf()};gt.parse=function(e){return Fe.parse(e)};gt.toString=function(){return Fe.toString()};function tf(e){let t=new Fe(e.valueOf());if(Number.isNaN(t.getTime()))throw new TypeError(`mockdate: The time set is an invalid date: ${e}`);globalThis.Date=gt,Os=t.valueOf()}function nf(){globalThis.Date=Fe}var Qy=["matchSnapshot","toMatchSnapshot","toMatchInlineSnapshot","toThrowErrorMatchingSnapshot","toThrowErrorMatchingInlineSnapshot","throws","Throw","throw","toThrow","toThrowError"];function eb(e){return function(n,r={}){let i=Vt().config.expect?.poll??{},{interval:s=i.interval??50,timeout:a=i.timeout??1e3,message:c}=r,l=e(null,c).withContext({poll:!0});n=n.bind(l);let u=we.flag(l,"vitest-test");if(!u)throw new Error("expect.poll() must be called inside a test");let f=new Proxy(l,{get(m,h,g){let y=Reflect.get(m,h,g);if(typeof y!="function")return y instanceof d?f:y;if(h==="assert")return y;if(typeof h=="string"&&Qy.includes(h))throw new SyntaxError(`expect.poll() is not supported in combination with .${h}(). Use vi.waitFor() if your assertion condition is unstable.`);return function(...w){let E=new Error("STACK_TRACE_ERROR"),_=()=>new Promise(($,R)=>{let N,I,{setTimeout:k,clearTimeout:V}=ft(),C=k(()=>{V(N),R(rf(new Error(`Matcher did not succeed in ${a}ms`,{cause:I}),E))},a),W=async()=>{try{we.flag(l,"_name",h);let ne=await n();we.flag(l,"object",ne),$(await y.call(l,...w)),V(N),V(C)}catch(ne){I=ne,N=k(W,s)}};W()}),O=!1;u.onFinished??=[],u.onFinished.push(()=>{if(!O){let $=we.flag(l,"negate")?"not.":"",N=`expect.${we.flag(l,"_poll.element")?"element(locator)":"poll(assertion)"}.${$}${String(h)}()`,I=new Error(`${N} was not awaited. This assertion is asynchronous and must be awaited; otherwise, it is not executed to avoid unhandled rejections:
147
-
148
- await ${N}
149
- `);throw rf(I,E)}});let A;return{then($,R){return O=!0,(A||=_()).then($,R)},catch($){return(A||=_()).catch($)},finally($){return(A||=_()).finally($)},[Symbol.toStringTag]:"Promise"}}}});return f}}function rf(e,t){return t.stack!==void 0&&(e.stack=t.stack.replace(t.message,e.message)),e}function tb(e){throw new Error('Could not dynamically require "'+e+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var Gr={exports:{}},nb=Gr.exports,of;function rb(){return of||(of=1,function(e,t){(function(){(function(n){return typeof tb=="function"?e.exports=n:chai.use(n)})(function(n,r){var o=n.Assertion,i=o.prototype;o.addMethod("containSubset",function(a){var c=r.flag(this,"object"),l=n.config.showDiff;i.assert.call(this,s(a,c),"expected #{act} to contain subset #{exp}","expected #{act} to not contain subset #{exp}",a,c,l)}),n.assert.containSubset=function(a,c,l){new n.Assertion(a,l).to.be.containSubset(c)};function s(a,c){if(a===c)return!0;if(typeof c!=typeof a)return!1;if(typeof a!="object"||a===null)return a===c;if(a&&!c)return!1;if(Array.isArray(a)){if(typeof c.length!="number")return!1;var l=Array.prototype.slice.call(c);return a.every(function(u){return l.some(function(f){return s(u,f)})})}return a instanceof Date?c instanceof Date?a.getTime()===c.getTime():!1:Object.keys(a).every(function(u){var f=a[u],m=c[u];return typeof f=="object"&&f!==null&&m!==null?s(f,m):typeof f=="function"?f(m):m===f})}})}).call(nb)}(Gr)),Gr.exports}var ob=rb(),ib=yu(ob);function sb(e,t,n){let r=e.flag(t,"negate")?"not.":"",o=`${e.flag(t,"_name")}(expected)`,i=e.flag(t,"promise");return`expect(actual)${i?`.${i}`:""}.${r}${o}`}function ab(e,t,n,r){let o=e;if(o&&t instanceof Promise){t=t.finally(()=>{if(!o.promises)return;let s=o.promises.indexOf(t);s!==-1&&o.promises.splice(s,1)}),o.promises||(o.promises=[]),o.promises.push(t);let i=!1;return o.onFinished??=[],o.onFinished.push(()=>{if(!i){let a=(globalThis.__vitest_worker__?.onFilterStackTrace||(c=>c||""))(r.stack);console.warn([`Promise returned by \`${n}\` was not awaited. `,"Vitest currently auto-awaits hanging assertions at the end of the test, but this will cause the test to fail in Vitest 3. ",`Please remember to await the assertion.
150
- `,a].join(""))}}),{then(s,a){return i=!0,t.then(s,a)},catch(s){return t.catch(s)},finally(s){return t.finally(s)},[Symbol.toStringTag]:"Promise"}}return t}var Is;function xn(){return Is||(Is=new Hr({isEqual:(e,t)=>H(e,t,[Oe,Ct])})),Is}function sf(e,t){if(typeof e!="function"){if(!t)throw new Error(`expected must be a function, received ${typeof e}`);return e}try{e()}catch(n){return n}throw new Error("snapshot function didn't throw")}function _n(e){return e?{filepath:e.file.filepath,name:Fr(e).slice(1).join(" > ")}:{}}var cb=(e,t)=>{for(let n of["matchSnapshot","toMatchSnapshot"])t.addMethod(e.Assertion.prototype,n,function(r,o){if(t.flag(this,"_name",n),t.flag(this,"negate"))throw new Error(`${n} cannot be used with "not"`);let s=t.flag(this,"object"),a=t.flag(this,"vitest-test");typeof r=="string"&&typeof o>"u"&&(o=r,r=void 0);let c=t.flag(this,"message");xn().assert({received:s,message:o,isInline:!1,properties:r,errorMessage:c,..._n(a)})});t.addMethod(e.Assertion.prototype,"toMatchFileSnapshot",function(n,r){if(t.flag(this,"_name","toMatchFileSnapshot"),t.flag(this,"negate"))throw new Error('toMatchFileSnapshot cannot be used with "not"');let i=new Error("resolves"),s=t.flag(this,"object"),a=t.flag(this,"vitest-test"),c=t.flag(this,"message"),l=xn().assertRaw({received:s,message:r,isInline:!1,rawSnapshot:{file:n},errorMessage:c,..._n(a)});return ab(a,l,sb(t,this),i)}),t.addMethod(e.Assertion.prototype,"toMatchInlineSnapshot",function(r,o,i){if(t.flag(this,"_name","toMatchInlineSnapshot"),t.flag(this,"negate"))throw new Error('toMatchInlineSnapshot cannot be used with "not"');let a=t.flag(this,"vitest-test");if(a&&(a.each||a.suite?.each))throw new Error("InlineSnapshot cannot be used inside of test.each or describe.each");let l=t.flag(this,"object"),u=t.flag(this,"error");typeof r=="string"&&(i=o,o=r,r=void 0),o&&(o=xs(o));let f=t.flag(this,"message");xn().assert({received:l,message:i,isInline:!0,properties:r,inlineSnapshot:o,error:u,errorMessage:f,..._n(a)})}),t.addMethod(e.Assertion.prototype,"toThrowErrorMatchingSnapshot",function(n){if(t.flag(this,"_name","toThrowErrorMatchingSnapshot"),t.flag(this,"negate"))throw new Error('toThrowErrorMatchingSnapshot cannot be used with "not"');let o=t.flag(this,"object"),i=t.flag(this,"vitest-test"),s=t.flag(this,"promise"),a=t.flag(this,"message");xn().assert({received:sf(o,s),message:n,errorMessage:a,..._n(i)})}),t.addMethod(e.Assertion.prototype,"toThrowErrorMatchingInlineSnapshot",function(r,o){if(t.flag(this,"negate"))throw new Error('toThrowErrorMatchingInlineSnapshot cannot be used with "not"');let s=t.flag(this,"vitest-test");if(s&&(s.each||s.suite?.each))throw new Error("InlineSnapshot cannot be used inside of test.each or describe.each");let c=t.flag(this,"object"),l=t.flag(this,"error"),u=t.flag(this,"promise"),f=t.flag(this,"message");r&&(r=xs(r)),xn().assert({received:sf(c,u),message:o,inlineSnapshot:r,isInline:!0,error:l,errorMessage:f,..._n(s)})}),t.addMethod(e.expect,"addSnapshotSerializer",ef)};ot(Ql);ot(Zl);ot(ib);ot(cb);ot(Gl);function If(e){let t=(i,s)=>{let{assertionCalls:a}=Wt(t);Mr({assertionCalls:a+1},t);let c=pt(i,s),l=e||Lr();return l?c.withTest(l):c};Object.assign(t,pt),Object.assign(t,globalThis[kr]),t.getState=()=>Wt(t),t.setState=i=>Mr(i,t);let n=Wt(globalThis[mn])||{};Mr({...n,assertionCalls:0,isExpectingAssertions:!1,isExpectingAssertionsError:null,expectedAssertionsNumber:null,expectedAssertionsNumberErrorGen:null,environment:mu(),get testPath(){return Vt().filepath},currentTestName:e?ts(e):n.currentTestName},t),t.extend=i=>pt.extend(t,i),t.addEqualityTesters=i=>Ul(i),t.soft=(...i)=>t(...i).withContext({soft:!0}),t.poll=eb(t),t.unreachable=i=>{p.fail(`expected${i?` "${i}" `:" "}not to be reached`)};function r(i){let s=()=>new Error(`expected number of assertions to be ${i}, but got ${t.getState().assertionCalls}`);Error.captureStackTrace&&Error.captureStackTrace(s(),r),t.setState({expectedAssertionsNumber:i,expectedAssertionsNumberErrorGen:s})}function o(){let i=new Error("expected any number of assertion, but got none");Error.captureStackTrace&&Error.captureStackTrace(i,o),t.setState({isExpectingAssertions:!0,isExpectingAssertionsError:i})}return we.addMethod(t,"assertions",r),we.addMethod(t,"hasAssertions",o),t}var Je=If();Object.defineProperty(globalThis,mn,{value:Je,writable:!0,configurable:!0});var Kt={},As,af;function lb(){if(af)return As;af=1;var e;return typeof Br<"u"?e=Br:typeof window<"u"?e=window:e=self,As=e,As}var $s,cf;function ub(){if(cf)return $s;cf=1;let e;try{({}).__proto__,e=!1}catch{e=!0}return $s=e,$s}var ks,lf;function Ht(){if(lf)return ks;lf=1;var e=Function.call,t=ub(),n=["size","caller","callee","arguments"];return t&&n.push("__proto__"),ks=function(o){return Object.getOwnPropertyNames(o).reduce(function(i,s){return n.includes(s)||typeof o[s]!="function"||(i[s]=e.bind(o[s])),i},Object.create(null))},ks}var Ps,uf;function Zr(){if(uf)return Ps;uf=1;var e=Ht();return Ps=e(Array.prototype),Ps}var Ns,ff;function fb(){if(ff)return Ns;ff=1;var e=Zr().every;function t(o,i){return o[i.id]===void 0&&(o[i.id]=0),o[i.id]<i.callCount}function n(o,i,s,a){var c=!0;return s!==a.length-1&&(c=i.calledBefore(a[s+1])),t(o,i)&&c?(o[i.id]+=1,!0):!1}function r(o){var i={},s=arguments.length>1?arguments:o;return e(s,n.bind(null,i))}return Ns=r,Ns}var Ms,hf;function Af(){return hf||(hf=1,Ms=function(t){if(!t)return"";try{return t.displayName||t.name||(String(t).match(/function ([^\s(]+)/)||[])[1]}catch{return""}}),Ms}var js,pf;function hb(){if(pf)return js;pf=1;var e=Af();function t(n){return n.constructor&&n.constructor.name||typeof n.constructor=="function"&&e(n.constructor)||null}return js=t,js}var Rs={},df;function pb(){return df||(df=1,function(e){e.wrap=function(t,n){var r=function(){return e.printWarning(n),t.apply(this,arguments)};return t.prototype&&(r.prototype=t.prototype),r},e.defaultMsg=function(t,n){return`${t}.${n} is deprecated and will be removed from the public API in a future version of ${t}.`},e.printWarning=function(t){typeof process=="object"&&process.emitWarning?process.emitWarning(t):console.info?console.info(t):console.log(t)}}(Rs)),Rs}var Fs,mf;function db(){return mf||(mf=1,Fs=function(t,n){var r=!0;try{t.forEach(function(){if(!n.apply(this,arguments))throw new Error})}catch{r=!1}return r}),Fs}var Ls,gf;function mb(){if(gf)return Ls;gf=1;var e=Zr().sort,t=Zr().slice;function n(o,i){var s=o.getCall(0),a=i.getCall(0),c=s&&s.callId||-1,l=a&&a.callId||-1;return c<l?-1:1}function r(o){return e(t(o),n)}return Ls=r,Ls}var Ds,yf;function gb(){if(yf)return Ds;yf=1;var e=Ht();return Ds=e(Function.prototype),Ds}var qs,bf;function yb(){if(bf)return qs;bf=1;var e=Ht();return qs=e(Map.prototype),qs}var Bs,wf;function bb(){if(wf)return Bs;wf=1;var e=Ht();return Bs=e(Object.prototype),Bs}var zs,vf;function wb(){if(vf)return zs;vf=1;var e=Ht();return zs=e(Set.prototype),zs}var Ws,Sf;function vb(){if(Sf)return Ws;Sf=1;var e=Ht();return Ws=e(String.prototype),Ws}var Us,Ef;function Sb(){return Ef||(Ef=1,Us={array:Zr(),function:gb(),map:yb(),object:bb(),set:wb(),string:vb()}),Us}var Yr={exports:{}},Eb=Yr.exports,Tf;function Tb(){return Tf||(Tf=1,function(e,t){(function(n,r){e.exports=r()})(Eb,function(){var n=typeof Promise=="function",r=typeof self=="object"?self:Br,o=typeof Symbol<"u",i=typeof Map<"u",s=typeof Set<"u",a=typeof WeakMap<"u",c=typeof WeakSet<"u",l=typeof DataView<"u",u=o&&typeof Symbol.iterator<"u",f=o&&typeof Symbol.toStringTag<"u",m=s&&typeof Set.prototype.entries=="function",h=i&&typeof Map.prototype.entries=="function",g=m&&Object.getPrototypeOf(new Set().entries()),y=h&&Object.getPrototypeOf(new Map().entries()),w=u&&typeof Array.prototype[Symbol.iterator]=="function",E=w&&Object.getPrototypeOf([][Symbol.iterator]()),_=u&&typeof String.prototype[Symbol.iterator]=="function",O=_&&Object.getPrototypeOf(""[Symbol.iterator]()),A=8,$=-1;function R(N){var I=typeof N;if(I!=="object")return I;if(N===null)return"null";if(N===r)return"global";if(Array.isArray(N)&&(f===!1||!(Symbol.toStringTag in N)))return"Array";if(typeof window=="object"&&window!==null){if(typeof window.location=="object"&&N===window.location)return"Location";if(typeof window.document=="object"&&N===window.document)return"Document";if(typeof window.navigator=="object"){if(typeof window.navigator.mimeTypes=="object"&&N===window.navigator.mimeTypes)return"MimeTypeArray";if(typeof window.navigator.plugins=="object"&&N===window.navigator.plugins)return"PluginArray"}if((typeof window.HTMLElement=="function"||typeof window.HTMLElement=="object")&&N instanceof window.HTMLElement){if(N.tagName==="BLOCKQUOTE")return"HTMLQuoteElement";if(N.tagName==="TD")return"HTMLTableDataCellElement";if(N.tagName==="TH")return"HTMLTableHeaderCellElement"}}var k=f&&N[Symbol.toStringTag];if(typeof k=="string")return k;var V=Object.getPrototypeOf(N);return V===RegExp.prototype?"RegExp":V===Date.prototype?"Date":n&&V===Promise.prototype?"Promise":s&&V===Set.prototype?"Set":i&&V===Map.prototype?"Map":c&&V===WeakSet.prototype?"WeakSet":a&&V===WeakMap.prototype?"WeakMap":l&&V===DataView.prototype?"DataView":i&&V===y?"Map Iterator":s&&V===g?"Set Iterator":w&&V===E?"Array Iterator":_&&V===O?"String Iterator":V===null?"Object":Object.prototype.toString.call(N).slice(A,$)}return R})}(Yr)),Yr.exports}var Vs,xf;function xb(){if(xf)return Vs;xf=1;var e=Tb();return Vs=function(n){return e(n).toLowerCase()},Vs}var Js,_f;function _b(){if(_f)return Js;_f=1;function e(t){return t&&t.toString?t.toString():String(t)}return Js=e,Js}var Ks,Cf;function Cb(){return Cf||(Cf=1,Ks={global:lb(),calledInOrder:fb(),className:hb(),deprecated:pb(),every:db(),functionName:Af(),orderByFirstCall:mb(),prototypes:Sb(),typeOf:xb(),valueToString:_b()}),Ks}var Of;function Ob(){if(Of)return Kt;Of=1;let e=Cb().global,t;if(typeof __vitest_required__<"u")try{t=__vitest_required__.timers}catch{}function n(o){let i=Math.pow(2,31)-1,s=1e12,a=function(){},c=function(){return[]},l=o.setTimeout(a,0),u=typeof l=="object",f=o.process&&typeof o.process.hrtime=="function",m=f&&typeof o.process.hrtime.bigint=="function",h=o.process&&typeof o.process.nextTick=="function",g=o.process&&o.__vitest_required__&&o.__vitest_required__.util.promisify,y=o.performance&&typeof o.performance.now=="function",w=o.Performance&&(typeof o.Performance).match(/^(function|object)$/),E=o.performance&&o.performance.constructor&&o.performance.constructor.prototype,_=o.hasOwnProperty("queueMicrotask"),O=o.requestAnimationFrame&&typeof o.requestAnimationFrame=="function",A=o.cancelAnimationFrame&&typeof o.cancelAnimationFrame=="function",$=o.requestIdleCallback&&typeof o.requestIdleCallback=="function",R=o.cancelIdleCallback&&typeof o.cancelIdleCallback=="function",N=o.setImmediate&&typeof o.setImmediate=="function",I=o.Intl&&typeof o.Intl=="object";o.clearTimeout(l);let k=o.Date,V=o.Intl,C=s;function W(S){return Number.isFinite?Number.isFinite(S):isFinite(S)}let ne=!1;function q(S,T){S.loopLimit&&T===S.loopLimit-1&&(ne=!0)}function z(){ne=!1}function j(S){if(!S)return 0;let T=S.split(":"),P=T.length,M=P,b=0,X;if(P>3||!/^(\d\d:){0,2}\d\d?$/.test(S))throw new Error("tick only understands numbers, 'm:s' and 'h:m:s'. Each part must be two digits");for(;M--;){if(X=parseInt(T[M],10),X>=60)throw new Error(`Invalid time ${S}`);b+=X*Math.pow(60,P-M-1)}return b*1e3}function G(S){let P=S*1e6%1e6,M=P<0?P+1e6:P;return Math.floor(M)}function L(S){if(!S)return 0;if(typeof S.getTime=="function")return S.getTime();if(typeof S=="number")return S;throw new TypeError("now should be milliseconds since UNIX epoch")}function ue(S,T,P){return P&&P.callAt>=S&&P.callAt<=T}function ge(S,T){let P=new Error(`Aborting after running ${S.loopLimit} timers, assuming an infinite loop!`);if(!T.error)return P;let M=/target\.*[<|(|[].*?[>|\]|)]\s*/,b=new RegExp(String(Object.keys(S).join("|")));u&&(b=new RegExp(`\\s+at (Object\\.)?(?:${Object.keys(S).join("|")})\\s+`));let X=-1;T.error.stack.split(`
151
- `).some(function(fe,He){return fe.match(M)?(X=He,!0):fe.match(b)?(X=He,!1):X>=0});let ve=`${P}
152
- ${T.type||"Microtask"} - ${T.func.name||"anonymous"}
153
- ${T.error.stack.split(`
154
- `).slice(X+1).join(`
155
- `)}`;try{Object.defineProperty(P,"stack",{value:ve})}catch{}return P}function ke(S,T){let P;for(P in T)T.hasOwnProperty(P)&&(S[P]=T[P]);return T.now?S.now=function(){return S.clock.now}:delete S.now,T.toSource?S.toSource=function(){return T.toSource()}:delete S.toSource,S.toString=function(){return T.toString()},S.prototype=T.prototype,S.parse=T.parse,S.UTC=T.UTC,S.prototype.toUTCString=T.prototype.toUTCString,S.isFake=!0,S}function _e(){function S(T,P,M,b,X,ve,fe){if(!(this instanceof S))return new k(S.clock.now).toString();switch(arguments.length){case 0:return new k(S.clock.now);case 1:return new k(T);case 2:return new k(T,P);case 3:return new k(T,P,M);case 4:return new k(T,P,M,b);case 5:return new k(T,P,M,b,X);case 6:return new k(T,P,M,b,X,ve);default:return new k(T,P,M,b,X,ve,fe)}}return ke(S,k)}function Ce(){let S={...V};return S.DateTimeFormat=function(...T){let P=new V.DateTimeFormat(...T),M={};return["formatRange","formatRangeToParts","resolvedOptions"].forEach(b=>{M[b]=P[b].bind(P)}),["format","formatToParts"].forEach(b=>{M[b]=function(X){return P[b](X||S.clock.now)}}),M},S.DateTimeFormat.prototype=Object.create(V.DateTimeFormat.prototype),S.DateTimeFormat.supportedLocalesOf=V.DateTimeFormat.supportedLocalesOf,S}function Le(S,T){S.jobs||(S.jobs=[]),S.jobs.push(T)}function ce(S){if(S.jobs){for(let T=0;T<S.jobs.length;T++){let P=S.jobs[T];if(P.func.apply(null,P.args),q(S,T),S.loopLimit&&T>S.loopLimit)throw ge(S,P)}z(),S.jobs=[]}}function se(S,T){if(T.func===void 0)throw new Error("Callback must be provided to timer calls");if(u&&typeof T.func!="function")throw new TypeError(`[ERR_INVALID_CALLBACK]: Callback must be a function. Received ${T.func} of type ${typeof T.func}`);if(ne&&(T.error=new Error),T.type=T.immediate?"Immediate":"Timeout",T.hasOwnProperty("delay")&&(typeof T.delay!="number"&&(T.delay=parseInt(T.delay,10)),W(T.delay)||(T.delay=0),T.delay=T.delay>i?1:T.delay,T.delay=Math.max(0,T.delay)),T.hasOwnProperty("interval")&&(T.type="Interval",T.interval=T.interval>i?1:T.interval),T.hasOwnProperty("animation")&&(T.type="AnimationFrame",T.animation=!0),T.hasOwnProperty("idleCallback")&&(T.type="IdleCallback",T.idleCallback=!0),S.timers||(S.timers={}),T.id=C++,T.createdAt=S.now,T.callAt=S.now+(parseInt(T.delay)||(S.duringTick?1:0)),S.timers[T.id]=T,u){let P={refed:!0,ref:function(){return this.refed=!0,P},unref:function(){return this.refed=!1,P},hasRef:function(){return this.refed},refresh:function(){return T.callAt=S.now+(parseInt(T.delay)||(S.duringTick?1:0)),S.timers[T.id]=T,P},[Symbol.toPrimitive]:function(){return T.id}};return P}return T.id}function Ie(S,T){if(S.callAt<T.callAt)return-1;if(S.callAt>T.callAt)return 1;if(S.immediate&&!T.immediate)return-1;if(!S.immediate&&T.immediate)return 1;if(S.createdAt<T.createdAt)return-1;if(S.createdAt>T.createdAt)return 1;if(S.id<T.id)return-1;if(S.id>T.id)return 1}function Ke(S,T,P){let M=S.timers,b=null,X,ve;for(X in M)M.hasOwnProperty(X)&&(ve=ue(T,P,M[X]),ve&&(!b||Ie(b,M[X])===1)&&(b=M[X]));return b}function Pe(S){let T=S.timers,P=null,M;for(M in T)T.hasOwnProperty(M)&&(!P||Ie(P,T[M])===1)&&(P=T[M]);return P}function st(S){let T=S.timers,P=null,M;for(M in T)T.hasOwnProperty(M)&&(!P||Ie(P,T[M])===-1)&&(P=T[M]);return P}function at(S,T){if(typeof T.interval=="number"?S.timers[T.id].callAt+=T.interval:delete S.timers[T.id],typeof T.func=="function")T.func.apply(null,T.args);else{let P=eval;(function(){P(T.func)})()}}function yt(S){return S==="IdleCallback"||S==="AnimationFrame"?`cancel${S}`:`clear${S}`}function eo(S){return S==="IdleCallback"||S==="AnimationFrame"?`request${S}`:`set${S}`}function D(){let S=0;return function(T){!S++&&console.warn(T)}}let Yt=D();function Xe(S,T,P){if(!T)return;S.timers||(S.timers={});let M=Number(T);if(Number.isNaN(M)||M<s){let b=yt(P);if(S.shouldClearNativeTimers===!0){let X=S[`_${b}`];return typeof X=="function"?X(T):void 0}Yt(`FakeTimers: ${b} was invoked to clear a native timer instead of one created by this library.
156
- To automatically clean-up native timers, use \`shouldClearNativeTimers\`.`)}if(S.timers.hasOwnProperty(M)){let b=S.timers[M];if(b.type===P||b.type==="Timeout"&&P==="Interval"||b.type==="Interval"&&P==="Timeout")delete S.timers[M];else{let X=yt(P),ve=eo(b.type);throw new Error(`Cannot clear timer: timer created with ${ve}() but cleared with ${X}()`)}}}function On(S,T){let P,M,b,X="_hrtime",ve="_nextTick";for(M=0,b=S.methods.length;M<b;M++){if(P=S.methods[M],P==="hrtime"&&o.process)o.process.hrtime=S[X];else if(P==="nextTick"&&o.process)o.process.nextTick=S[ve];else if(P==="performance"){let fe=Object.getOwnPropertyDescriptor(S,`_${P}`);fe&&fe.get&&!fe.set?Object.defineProperty(o,P,fe):fe.configurable&&(o[P]=S[`_${P}`])}else if(o[P]&&o[P].hadOwnProperty)o[P]=S[`_${P}`];else try{delete o[P]}catch{}if(S.timersModuleMethods!==void 0)for(let fe=0;fe<S.timersModuleMethods.length;fe++){let He=S.timersModuleMethods[fe];t[He.methodName]=He.original}}return T.shouldAdvanceTime===!0&&o.clearInterval(S.attachedInterval),S.methods=[],S.timers?Object.keys(S.timers).map(function(He){return S.timers[He]}):[]}function to(S,T,P){if(P[T].hadOwnProperty=Object.prototype.hasOwnProperty.call(S,T),P[`_${T}`]=S[T],T==="Date"){let M=ke(P[T],S[T]);S[T]=M}else if(T==="Intl")S[T]=P[T];else if(T==="performance"){let M=Object.getOwnPropertyDescriptor(S,T);if(M&&M.get&&!M.set){Object.defineProperty(P,`_${T}`,M);let b=Object.getOwnPropertyDescriptor(P,T);Object.defineProperty(S,T,b)}else S[T]=P[T]}else S[T]=function(){return P[T].apply(P,arguments)},Object.defineProperties(S[T],Object.getOwnPropertyDescriptors(P[T]));S[T].clock=P}function zf(S,T){S.tick(T)}let Ne={setTimeout:o.setTimeout,clearTimeout:o.clearTimeout,setInterval:o.setInterval,clearInterval:o.clearInterval,Date:o.Date};N&&(Ne.setImmediate=o.setImmediate,Ne.clearImmediate=o.clearImmediate),f&&(Ne.hrtime=o.process.hrtime),h&&(Ne.nextTick=o.process.nextTick),y&&(Ne.performance=o.performance),O&&(Ne.requestAnimationFrame=o.requestAnimationFrame),_&&(Ne.queueMicrotask=!0),A&&(Ne.cancelAnimationFrame=o.cancelAnimationFrame),$&&(Ne.requestIdleCallback=o.requestIdleCallback),R&&(Ne.cancelIdleCallback=o.cancelIdleCallback),I&&(Ne.Intl=o.Intl);let It=o.setImmediate||o.setTimeout;function Ys(S,T){S=Math.floor(L(S)),T=T||1e3;let P=0,M=[0,0];if(k===void 0)throw new Error("The global scope doesn't have a `Date` object (see https://github.com/sinonjs/sinon/issues/1852#issuecomment-419622780)");let b={now:S,Date:_e(),loopLimit:T};b.Date.clock=b;function X(){return 16-(b.now-S)%16}function ve(B){let F=b.now-M[0]-S,J=Math.floor(F/1e3),K=(F-J*1e3)*1e6+P-M[1];if(Array.isArray(B)){if(B[1]>1e9)throw new TypeError("Number of nanoseconds can't exceed a billion");let oe=B[0],Se=K-B[1],At=J-oe;return Se<0&&(Se+=1e9,At-=1),[At,Se]}return[J,K]}function fe(){let B=ve();return B[0]*1e3+B[1]/1e6}m&&(ve.bigint=function(){let B=ve();return BigInt(B[0])*BigInt(1e9)+BigInt(B[1])}),I&&(b.Intl=Ce(),b.Intl.clock=b),b.requestIdleCallback=function(F,J){let K=0;b.countTimers()>0&&(K=50);let oe=se(b,{func:F,args:Array.prototype.slice.call(arguments,2),delay:typeof J>"u"?K:Math.min(J,K),idleCallback:!0});return Number(oe)},b.cancelIdleCallback=function(F){return Xe(b,F,"IdleCallback")},b.setTimeout=function(F,J){return se(b,{func:F,args:Array.prototype.slice.call(arguments,2),delay:J})},typeof o.Promise<"u"&&g&&(b.setTimeout[g.custom]=function(F,J){return new o.Promise(function(oe){se(b,{func:oe,args:[J],delay:F})})}),b.clearTimeout=function(F){return Xe(b,F,"Timeout")},b.nextTick=function(F){return Le(b,{func:F,args:Array.prototype.slice.call(arguments,1),error:ne?new Error:null})},b.queueMicrotask=function(F){return b.nextTick(F)},b.setInterval=function(F,J){return J=parseInt(J,10),se(b,{func:F,args:Array.prototype.slice.call(arguments,2),delay:J,interval:J})},b.clearInterval=function(F){return Xe(b,F,"Interval")},N&&(b.setImmediate=function(F){return se(b,{func:F,args:Array.prototype.slice.call(arguments,1),immediate:!0})},typeof o.Promise<"u"&&g&&(b.setImmediate[g.custom]=function(F){return new o.Promise(function(K){se(b,{func:K,args:[F],immediate:!0})})}),b.clearImmediate=function(F){return Xe(b,F,"Immediate")}),b.countTimers=function(){return Object.keys(b.timers||{}).length+(b.jobs||[]).length},b.requestAnimationFrame=function(F){let J=se(b,{func:F,delay:X(),get args(){return[fe()]},animation:!0});return Number(J)},b.cancelAnimationFrame=function(F){return Xe(b,F,"AnimationFrame")},b.runMicrotasks=function(){ce(b)};function He(B,F,J,K){let oe=typeof B=="number"?B:j(B),Se=Math.floor(oe),At=G(oe),In=P+At,Ge=b.now+Se;if(oe<0)throw new TypeError("Negative ticks are not supported");In>=1e6&&(Ge+=1,In-=1e6),P=In;let ct=b.now,no=b.now,Qe,$t,Me,Zs,ro,oo;b.duringTick=!0,Me=b.now,ce(b),Me!==b.now&&(ct+=b.now-Me,Ge+=b.now-Me);function Qs(){for(Qe=Ke(b,ct,Ge);Qe&&ct<=Ge;){if(b.timers[Qe.id]){ct=Qe.callAt,b.now=Qe.callAt,Me=b.now;try{ce(b),at(b,Qe)}catch(Zt){$t=$t||Zt}if(F){It(Zs);return}ro()}oo()}if(Me=b.now,ce(b),Me!==b.now&&(ct+=b.now-Me,Ge+=b.now-Me),b.duringTick=!1,Qe=Ke(b,ct,Ge),Qe)try{b.tick(Ge-b.now)}catch(Zt){$t=$t||Zt}else b.now=Ge,P=In;if($t)throw $t;if(F)J(b.now);else return b.now}return Zs=F&&function(){try{ro(),oo(),Qs()}catch(Zt){K(Zt)}},ro=function(){Me!==b.now&&(ct+=b.now-Me,Ge+=b.now-Me,no+=b.now-Me)},oo=function(){Qe=Ke(b,no,Ge),no=ct},Qs()}return b.tick=function(F){return He(F,!1)},typeof o.Promise<"u"&&(b.tickAsync=function(F){return new o.Promise(function(J,K){It(function(){try{He(F,!0,J,K)}catch(oe){K(oe)}})})}),b.next=function(){ce(b);let F=Pe(b);if(!F)return b.now;b.duringTick=!0;try{return b.now=F.callAt,at(b,F),ce(b),b.now}finally{b.duringTick=!1}},typeof o.Promise<"u"&&(b.nextAsync=function(){return new o.Promise(function(F,J){It(function(){try{let K=Pe(b);if(!K){F(b.now);return}let oe;b.duringTick=!0,b.now=K.callAt;try{at(b,K)}catch(Se){oe=Se}b.duringTick=!1,It(function(){oe?J(oe):F(b.now)})}catch(K){J(K)}})})}),b.runAll=function(){let F,J;for(ce(b),J=0;J<b.loopLimit;J++){if(!b.timers||(F=Object.keys(b.timers).length,F===0))return z(),b.now;b.next(),q(b,J)}let K=Pe(b);throw ge(b,K)},b.runToFrame=function(){return b.tick(X())},typeof o.Promise<"u"&&(b.runAllAsync=function(){return new o.Promise(function(F,J){let K=0;function oe(){It(function(){try{let Se;if(K<b.loopLimit){if(!b.timers){z(),F(b.now);return}if(Se=Object.keys(b.timers).length,Se===0){z(),F(b.now);return}b.next(),K++,oe(),q(b,K);return}let At=Pe(b);J(ge(b,At))}catch(Se){J(Se)}})}oe()})}),b.runToLast=function(){let F=st(b);return F?b.tick(F.callAt-b.now):(ce(b),b.now)},typeof o.Promise<"u"&&(b.runToLastAsync=function(){return new o.Promise(function(F,J){It(function(){try{let K=st(b);K||F(b.now),F(b.tickAsync(K.callAt-b.now))}catch(K){J(K)}})})}),b.reset=function(){P=0,b.timers={},b.jobs=[],b.now=S},b.setSystemTime=function(F){let J=L(F),K=J-b.now,oe,Se;M[0]=M[0]+K,M[1]=M[1]+P,b.now=J,P=0;for(oe in b.timers)b.timers.hasOwnProperty(oe)&&(Se=b.timers[oe],Se.createdAt+=K,Se.callAt+=K)},b.jump=function(F){let J=typeof F=="number"?F:j(F),K=Math.floor(J);for(let oe of Object.values(b.timers))b.now+K>oe.callAt&&(oe.callAt=b.now+K);b.tick(K)},y&&(b.performance=Object.create(null),b.performance.now=fe),f&&(b.hrtime=ve),b}function Wf(S){if(arguments.length>1||S instanceof Date||Array.isArray(S)||typeof S=="number")throw new TypeError(`FakeTimers.install called with ${String(S)} install requires an object parameter`);if(o.Date.isFake===!0)throw new TypeError("Can't install fake timers twice on the same global object.");if(S=typeof S<"u"?S:{},S.shouldAdvanceTime=S.shouldAdvanceTime||!1,S.advanceTimeDelta=S.advanceTimeDelta||20,S.shouldClearNativeTimers=S.shouldClearNativeTimers||!1,S.target)throw new TypeError("config.target is no longer supported. Use `withGlobal(target)` instead.");let T,P,M=Ys(S.now,S.loopLimit);if(M.shouldClearNativeTimers=S.shouldClearNativeTimers,M.uninstall=function(){return On(M,S)},M.methods=S.toFake||[],M.methods.length===0&&(M.methods=Object.keys(Ne).filter(function(b){return b!=="nextTick"&&b!=="queueMicrotask"})),S.shouldAdvanceTime===!0){let b=zf.bind(null,M,S.advanceTimeDelta),X=o.setInterval(b,S.advanceTimeDelta);M.attachedInterval=X}if(M.methods.includes("performance")){let b=(()=>{if(E)return o.performance.constructor.prototype;if(w)return o.Performance.prototype})();if(b)Object.getOwnPropertyNames(b).forEach(function(X){X!=="now"&&(M.performance[X]=X.indexOf("getEntries")===0?c:a)});else if((S.toFake||[]).includes("performance"))throw new ReferenceError("non-existent performance object cannot be faked")}for(o===e&&t&&(M.timersModuleMethods=[]),T=0,P=M.methods.length;T<P;T++){let b=M.methods[T];if(b==="hrtime"?o.process&&typeof o.process.hrtime=="function"&&to(o.process,b,M):b==="nextTick"?o.process&&typeof o.process.nextTick=="function"&&to(o.process,b,M):to(o,b,M),M.timersModuleMethods!==void 0&&t[b]){let X=t[b];M.timersModuleMethods.push({methodName:b,original:X}),t[b]=o[b]}}return M}return{timers:Ne,createClock:Ys,install:Wf,withGlobal:n}}let r=n(e);return Kt.timers=r.timers,Kt.createClock=r.createClock,Kt.install=r.install,Kt.withGlobal=n,Kt}var Ib=Ob(),Xs=class{_global;_clock;_fakingTime;_fakingDate;_fakeTimers;_userConfig;_now=Fe.now;constructor({global:t,config:n}){this._userConfig=n,this._fakingDate=!1,this._fakingTime=!1,this._fakeTimers=Ib.withGlobal(t),this._global=t}clearAllTimers(){this._fakingTime&&this._clock.reset()}dispose(){this.useRealTimers()}runAllTimers(){this._checkFakeTimers()&&this._clock.runAll()}async runAllTimersAsync(){this._checkFakeTimers()&&await this._clock.runAllAsync()}runOnlyPendingTimers(){this._checkFakeTimers()&&this._clock.runToLast()}async runOnlyPendingTimersAsync(){this._checkFakeTimers()&&await this._clock.runToLastAsync()}advanceTimersToNextTimer(t=1){if(this._checkFakeTimers())for(let n=t;n>0&&(this._clock.next(),this._clock.tick(0),this._clock.countTimers()!==0);n--);}async advanceTimersToNextTimerAsync(t=1){if(this._checkFakeTimers())for(let n=t;n>0&&(await this._clock.nextAsync(),this._clock.tick(0),this._clock.countTimers()!==0);n--);}advanceTimersByTime(t){this._checkFakeTimers()&&this._clock.tick(t)}async advanceTimersByTimeAsync(t){this._checkFakeTimers()&&await this._clock.tickAsync(t)}advanceTimersToNextFrame(){this._checkFakeTimers()&&this._clock.runToFrame()}runAllTicks(){this._checkFakeTimers()&&this._clock.runMicrotasks()}useRealTimers(){this._fakingDate&&(nf(),this._fakingDate=!1),this._fakingTime&&(this._clock.uninstall(),this._fakingTime=!1)}useFakeTimers(){if(this._fakingDate)throw new Error('"setSystemTime" was called already and date was mocked. Reset timers using `vi.useRealTimers()` if you want to use fake timers again.');if(!this._fakingTime){let t=Object.keys(this._fakeTimers.timers).filter(r=>r!=="nextTick");if(this._userConfig?.toFake?.includes("nextTick")&&us())throw new Error("process.nextTick cannot be mocked inside child_process");let n=(this._userConfig?.toFake||t).filter(r=>{switch(r){case"setImmediate":case"clearImmediate":return r in this._global&&this._global[r];default:return!0}});this._clock=this._fakeTimers.install({now:Date.now(),...this._userConfig,toFake:n}),this._fakingTime=!0}}reset(){if(this._checkFakeTimers()){let{now:t}=this._clock;this._clock.reset(),this._clock.setSystemTime(t)}}setSystemTime(t){this._fakingTime?this._clock.setSystemTime(t):(tf(t??this.getRealSystemTime()),this._fakingDate=!0)}getRealSystemTime(){return this._now()}getTimerCount(){return this._checkFakeTimers()?this._clock.countTimers():0}configure(t){this._userConfig=t}isFakeTimers(){return this._fakingTime}_checkFakeTimers(){if(!this._fakingTime)throw new Error('Timers are not mocked. Try calling "vi.useFakeTimers()" first.');return this._fakingTime}};function $f(e,t){return t.stack!==void 0&&(e.stack=t.stack.replace(t.message,e.message)),e}function Ab(e,t={}){let{setTimeout:n,setInterval:r,clearTimeout:o,clearInterval:i}=ft(),{interval:s=50,timeout:a=1e3}=typeof t=="number"?{timeout:t}:t,c=new Error("STACK_TRACE_ERROR");return new Promise((l,u)=>{let f,m="idle",h,g,y=_=>{h&&o(h),g&&i(g),l(_)},w=()=>{g&&i(g);let _=f;_||(_=$f(new Error("Timed out in waitFor!"),c)),u(_)},E=()=>{if(Cn.isFakeTimers()&&Cn.advanceTimersByTime(s),m!=="pending")try{let _=e();if(_!==null&&typeof _=="object"&&typeof _.then=="function"){let O=_;m="pending",O.then(A=>{m="resolved",y(A)},A=>{m="rejected",f=A})}else return y(_),!0}catch(_){f=_}};E()!==!0&&(h=n(w,a),g=r(E,s))})}function $b(e,t={}){let{setTimeout:n,setInterval:r,clearTimeout:o,clearInterval:i}=ft(),{interval:s=50,timeout:a=1e3}=typeof t=="number"?{timeout:t}:t,c=new Error("STACK_TRACE_ERROR");return new Promise((l,u)=>{let f="idle",m,h,g=E=>{h&&i(h),E||(E=$f(new Error("Timed out in waitUntil!"),c)),u(E)},y=E=>{if(E)return m&&o(m),h&&i(h),l(E),!0},w=()=>{if(Cn.isFakeTimers()&&Cn.advanceTimersByTime(s),f!=="pending")try{let E=e();if(E!==null&&typeof E=="object"&&typeof E.then=="function"){let _=E;f="pending",_.then(O=>{f="resolved",y(O)},O=>{f="rejected",g(O)})}else return y(E)}catch(E){g(E)}};w()!==!0&&(m=n(g,a),h=r(w,s))})}function kb(){let e=null,t=null,n=Vt(),r,o=()=>r||=new Xs({global:globalThis,config:n.config.fakeTimers}),i=new Map,s=new Map,a=["PROD","DEV","SSR"],c={useFakeTimers(l){if(us()&&(l?.toFake?.includes("nextTick")||n.config?.fakeTimers?.toFake?.includes("nextTick")))throw new Error('vi.useFakeTimers({ toFake: ["nextTick"] }) is not supported in node:child_process. Use --pool=threads if mocking nextTick is required.');return l?o().configure({...n.config.fakeTimers,...l}):o().configure(n.config.fakeTimers),o().useFakeTimers(),c},isFakeTimers(){return o().isFakeTimers()},useRealTimers(){return o().useRealTimers(),e=null,c},runOnlyPendingTimers(){return o().runOnlyPendingTimers(),c},async runOnlyPendingTimersAsync(){return await o().runOnlyPendingTimersAsync(),c},runAllTimers(){return o().runAllTimers(),c},async runAllTimersAsync(){return await o().runAllTimersAsync(),c},runAllTicks(){return o().runAllTicks(),c},advanceTimersByTime(l){return o().advanceTimersByTime(l),c},async advanceTimersByTimeAsync(l){return await o().advanceTimersByTimeAsync(l),c},advanceTimersToNextTimer(){return o().advanceTimersToNextTimer(),c},async advanceTimersToNextTimerAsync(){return await o().advanceTimersToNextTimerAsync(),c},advanceTimersToNextFrame(){return o().advanceTimersToNextFrame(),c},getTimerCount(){return o().getTimerCount()},setSystemTime(l){let u=l instanceof Date?l:new Date(l);return e=u,o().setSystemTime(u),c},getMockedSystemTime(){return e},getRealSystemTime(){return o().getRealSystemTime()},clearAllTimers(){return o().clearAllTimers(),c},spyOn:Ic,fn:$c,waitFor:Ab,waitUntil:$b,hoisted(l){return ye(l,'"vi.hoisted" factory',["function"]),l()},mock(l,u){if(typeof l!="string")throw new TypeError(`vi.mock() expects a string path, but received a ${typeof l}`);let f=Xt("mock");Ve().queueMock(l,f,typeof u=="function"?()=>u(()=>Ve().importActual(l,f,Ve().getMockContext().callstack)):u)},unmock(l){if(typeof l!="string")throw new TypeError(`vi.unmock() expects a string path, but received a ${typeof l}`);Ve().queueUnmock(l,Xt("unmock"))},doMock(l,u){if(typeof l!="string")throw new TypeError(`vi.doMock() expects a string path, but received a ${typeof l}`);let f=Xt("doMock");Ve().queueMock(l,f,typeof u=="function"?()=>u(()=>Ve().importActual(l,f,Ve().getMockContext().callstack)):u)},doUnmock(l){if(typeof l!="string")throw new TypeError(`vi.doUnmock() expects a string path, but received a ${typeof l}`);Ve().queueUnmock(l,Xt("doUnmock"))},async importActual(l){return Ve().importActual(l,Xt("importActual"),Ve().getMockContext().callstack)},async importMock(l){return Ve().importMock(l,Xt("importMock"))},mocked(l,u={}){return l},isMockFunction(l){return sr(l)},clearAllMocks(){return on.forEach(l=>l.mockClear()),c},resetAllMocks(){return on.forEach(l=>l.mockReset()),c},restoreAllMocks(){return on.forEach(l=>l.mockRestore()),c},stubGlobal(l,u){return i.has(l)||i.set(l,Object.getOwnPropertyDescriptor(globalThis,l)),Object.defineProperty(globalThis,l,{value:u,writable:!0,configurable:!0,enumerable:!0}),c},stubEnv(l,u){return s.has(l)||s.set(l,process.env[l]),a.includes(l)?process.env[l]=u?"1":"":u===void 0?delete process.env[l]:process.env[l]=String(u),c},unstubAllGlobals(){return i.forEach((l,u)=>{l?Object.defineProperty(globalThis,u,l):Reflect.deleteProperty(globalThis,u)}),i.clear(),c},unstubAllEnvs(){return s.forEach((l,u)=>{l===void 0?delete process.env[u]:process.env[u]=l}),s.clear(),c},resetModules(){return gu(n.moduleCache),c},async dynamicImportSettled(){return fs()},setConfig(l){t||(t={...n.config}),Object.assign(n.config,l)},resetConfig(){t&&Object.assign(n.config,t)}};return c}var kf=kb(),Cn=kf;function Ve(){return typeof __vitest_mocker__<"u"?__vitest_mocker__:new Proxy({},{get(e,t){throw new Error(`Vitest mocker was not initialized in this environment. vi.${String(t)}() is forbidden.`)}})}function Xt(e){let n=Po({stackTraceLimit:5}).split(`
157
- `),r=n.findIndex(i=>i.includes(` at Object.${e}`)||i.includes(`${e}@`));return jr(n[r+1])?.file||""}var Mb=ra(qf(),1);var Hs=Symbol("__placeholder__"),Gt={usedTestEventStoreInTest:!1,calledThenHandler:!1};process.env.NODE_ENV==="test"&&(cs(()=>{Gt.usedTestEventStoreInTest=!1,Gt.calledThenHandler=!1}),ls(()=>{Gt.usedTestEventStoreInTest&&!Gt.calledThenHandler&&De("It seems like you used `createTestEventStore()`\nwithout using the `await then([expected, events, go, here, ...])`")}));function Bf(e,t){try{return e()}catch(n){throw Error.captureStackTrace&&n instanceof Error&&Error.captureStackTrace(n,t),n}}var Gs=class extends en{constructor(n=[],r=[]){super();this.db=n;this.producedEvents=r}apply={};name="test-recording-projector";initializer(){this.db.splice(0)}project(n){this.producedEvents.push(n)}};function jb(e,t=[]){Gt.usedTestEventStoreInTest=!0;let n=new Gs,r=kt.builder({load(a){return n.db.filter(c=>c.aggregateId===a)},loadEvents(){return n.db},persist(a){n.db.push(...a)}});for(let a of t)r.addProjector(a);r.addProjector(n);for(let[a,c]of Object.entries(e))r.addCommandHandler(a,c);let o=r.build(),i,s={___:Hs,async given(a=[]){n.db.push(...a)},async when(a){try{return await o.dispatch(typeof a=="function"?a():a)}catch(c){return c instanceof Error&&(i=c),c}},async then(a){if(Gt.calledThenHandler=!0,a instanceof Error){let l=a;Bf(()=>Je(i).toEqual(l),s.then);return}let c=a;if(i)throw Object.keys(i).length>0&&(i.message=["With properties:",`
158
- ${$n(i)}
30
+ ${s?.message}`)},w.then);return}let i=a;if(s)throw Object.keys(s).length>0&&(s.message=["With properties:",`
31
+ ${f(s)}
159
32
 
160
33
  ---
161
34
 
162
35
  `].join(`
163
- `)),i;Bf(()=>{Je(c).toHaveLength(n.producedEvents.length);for(let[l,u]of c.entries()){let{aggregateId:f,eventName:m,payload:h}=n.producedEvents[l];if(u.aggregateId===Hs)throw new Error("Expected an `aggregateId`, but got `___` instead.");Je(u.aggregateId).toEqual(f),Je(u.eventName).toEqual(m),(u.payload===null||u.payload===void 0)&&Je(u.payload).toEqual(h);for(let g in u.payload){let y=u.payload[g];y===Hs?(Je(h).toHaveProperty(g),Je(h[g]).toBeDefined()):Je(h[g]).toEqual(y)}}},s.then)}};return s}0&&(module.exports={Aggregate,Command,Event,EventSource,Projector,abort,createEventMapper,createTestEventStore,objectToYaml});
164
- /*! Bundled license information:
165
-
166
- @vitest/pretty-format/dist/index.js:
167
- (**
168
- * @license React
169
- * react-is.production.min.js
170
- *
171
- * Copyright (c) Facebook, Inc. and its affiliates.
172
- *
173
- * This source code is licensed under the MIT license found in the
174
- * LICENSE file in the root directory of this source tree.
175
- *)
176
- (**
177
- * @license React
178
- * react-is.development.js
179
- *
180
- * Copyright (c) Facebook, Inc. and its affiliates.
181
- *
182
- * This source code is licensed under the MIT license found in the
183
- * LICENSE file in the root directory of this source tree.
184
- *)
185
-
186
- chai/chai.js:
187
- (*!
188
- * Chai - flag utility
189
- * Copyright(c) 2012-2014 Jake Luer <jake@alogicalparadox.com>
190
- * MIT Licensed
191
- *)
192
- (*!
193
- * Chai - test utility
194
- * Copyright(c) 2012-2014 Jake Luer <jake@alogicalparadox.com>
195
- * MIT Licensed
196
- *)
197
- (*!
198
- * Chai - expectTypes utility
199
- * Copyright(c) 2012-2014 Jake Luer <jake@alogicalparadox.com>
200
- * MIT Licensed
201
- *)
202
- (*!
203
- * Chai - getActual utility
204
- * Copyright(c) 2012-2014 Jake Luer <jake@alogicalparadox.com>
205
- * MIT Licensed
206
- *)
207
- (*!
208
- * Chai - message composition utility
209
- * Copyright(c) 2012-2014 Jake Luer <jake@alogicalparadox.com>
210
- * MIT Licensed
211
- *)
212
- (*!
213
- * Chai - transferFlags utility
214
- * Copyright(c) 2012-2014 Jake Luer <jake@alogicalparadox.com>
215
- * MIT Licensed
216
- *)
217
- (*!
218
- * chai
219
- * http://chaijs.com
220
- * Copyright(c) 2011-2014 Jake Luer <jake@alogicalparadox.com>
221
- * MIT Licensed
222
- *)
223
- (*!
224
- * Chai - isProxyEnabled helper
225
- * Copyright(c) 2012-2014 Jake Luer <jake@alogicalparadox.com>
226
- * MIT Licensed
227
- *)
228
- (*!
229
- * Chai - addProperty utility
230
- * Copyright(c) 2012-2014 Jake Luer <jake@alogicalparadox.com>
231
- * MIT Licensed
232
- *)
233
- (*!
234
- * Chai - addLengthGuard utility
235
- * Copyright(c) 2012-2014 Jake Luer <jake@alogicalparadox.com>
236
- * MIT Licensed
237
- *)
238
- (*!
239
- * Chai - getProperties utility
240
- * Copyright(c) 2012-2014 Jake Luer <jake@alogicalparadox.com>
241
- * MIT Licensed
242
- *)
243
- (*!
244
- * Chai - proxify utility
245
- * Copyright(c) 2012-2014 Jake Luer <jake@alogicalparadox.com>
246
- * MIT Licensed
247
- *)
248
- (*!
249
- * Chai - addMethod utility
250
- * Copyright(c) 2012-2014 Jake Luer <jake@alogicalparadox.com>
251
- * MIT Licensed
252
- *)
253
- (*!
254
- * Chai - overwriteProperty utility
255
- * Copyright(c) 2012-2014 Jake Luer <jake@alogicalparadox.com>
256
- * MIT Licensed
257
- *)
258
- (*!
259
- * Chai - overwriteMethod utility
260
- * Copyright(c) 2012-2014 Jake Luer <jake@alogicalparadox.com>
261
- * MIT Licensed
262
- *)
263
- (*!
264
- * Chai - addChainingMethod utility
265
- * Copyright(c) 2012-2014 Jake Luer <jake@alogicalparadox.com>
266
- * MIT Licensed
267
- *)
268
- (*!
269
- * Chai - overwriteChainableMethod utility
270
- * Copyright(c) 2012-2014 Jake Luer <jake@alogicalparadox.com>
271
- * MIT Licensed
272
- *)
273
- (*!
274
- * Chai - compareByInspect utility
275
- * Copyright(c) 2011-2016 Jake Luer <jake@alogicalparadox.com>
276
- * MIT Licensed
277
- *)
278
- (*!
279
- * Chai - getOwnEnumerablePropertySymbols utility
280
- * Copyright(c) 2011-2016 Jake Luer <jake@alogicalparadox.com>
281
- * MIT Licensed
282
- *)
283
- (*!
284
- * Chai - getOwnEnumerableProperties utility
285
- * Copyright(c) 2011-2016 Jake Luer <jake@alogicalparadox.com>
286
- * MIT Licensed
287
- *)
288
- (*!
289
- * Chai - isNaN utility
290
- * Copyright(c) 2012-2015 Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
291
- * MIT Licensed
292
- *)
293
- (*!
294
- * chai
295
- * Copyright(c) 2011 Jake Luer <jake@alogicalparadox.com>
296
- * MIT Licensed
297
- *)
298
- (*!
299
- * chai
300
- * Copyright(c) 2011-2014 Jake Luer <jake@alogicalparadox.com>
301
- * MIT Licensed
302
- *)
303
- (*! Bundled license information:
304
-
305
- deep-eql/index.js:
306
- (*!
307
- * deep-eql
308
- * Copyright(c) 2013 Jake Luer <jake@alogicalparadox.com>
309
- * MIT Licensed
310
- *)
311
- (*!
312
- * Check to see if the MemoizeMap has recorded a result of the two operands
313
- *
314
- * @param {Mixed} leftHandOperand
315
- * @param {Mixed} rightHandOperand
316
- * @param {MemoizeMap} memoizeMap
317
- * @returns {Boolean|null} result
318
- *)
319
- (*!
320
- * Set the result of the equality into the MemoizeMap
321
- *
322
- * @param {Mixed} leftHandOperand
323
- * @param {Mixed} rightHandOperand
324
- * @param {MemoizeMap} memoizeMap
325
- * @param {Boolean} result
326
- *)
327
- (*!
328
- * Primary Export
329
- *)
330
- (*!
331
- * The main logic of the `deepEqual` function.
332
- *
333
- * @param {Mixed} leftHandOperand
334
- * @param {Mixed} rightHandOperand
335
- * @param {Object} [options] (optional) Additional options
336
- * @param {Array} [options.comparator] (optional) Override default algorithm, determining custom equality.
337
- * @param {Array} [options.memoize] (optional) Provide a custom memoization object which will cache the results of
338
- complex objects for a speed boost. By passing `false` you can disable memoization, but this will cause circular
339
- references to blow the stack.
340
- * @return {Boolean} equal match
341
- *)
342
- (*!
343
- * Compare two Regular Expressions for equality.
344
- *
345
- * @param {RegExp} leftHandOperand
346
- * @param {RegExp} rightHandOperand
347
- * @return {Boolean} result
348
- *)
349
- (*!
350
- * Compare two Sets/Maps for equality. Faster than other equality functions.
351
- *
352
- * @param {Set} leftHandOperand
353
- * @param {Set} rightHandOperand
354
- * @param {Object} [options] (Optional)
355
- * @return {Boolean} result
356
- *)
357
- (*!
358
- * Simple equality for flat iterable objects such as Arrays, TypedArrays or Node.js buffers.
359
- *
360
- * @param {Iterable} leftHandOperand
361
- * @param {Iterable} rightHandOperand
362
- * @param {Object} [options] (Optional)
363
- * @return {Boolean} result
364
- *)
365
- (*!
366
- * Simple equality for generator objects such as those returned by generator functions.
367
- *
368
- * @param {Iterable} leftHandOperand
369
- * @param {Iterable} rightHandOperand
370
- * @param {Object} [options] (Optional)
371
- * @return {Boolean} result
372
- *)
373
- (*!
374
- * Determine if the given object has an @@iterator function.
375
- *
376
- * @param {Object} target
377
- * @return {Boolean} `true` if the object has an @@iterator function.
378
- *)
379
- (*!
380
- * Gets all iterator entries from the given Object. If the Object has no @@iterator function, returns an empty array.
381
- * This will consume the iterator - which could have side effects depending on the @@iterator implementation.
382
- *
383
- * @param {Object} target
384
- * @returns {Array} an array of entries from the @@iterator function
385
- *)
386
- (*!
387
- * Gets all entries from a Generator. This will consume the generator - which could have side effects.
388
- *
389
- * @param {Generator} target
390
- * @returns {Array} an array of entries from the Generator.
391
- *)
392
- (*!
393
- * Gets all own and inherited enumerable keys from a target.
394
- *
395
- * @param {Object} target
396
- * @returns {Array} an array of own and inherited enumerable keys from the target.
397
- *)
398
- (*!
399
- * Determines if two objects have matching values, given a set of keys. Defers to deepEqual for the equality check of
400
- * each key. If any value of the given key is not equal, the function will return false (early).
401
- *
402
- * @param {Mixed} leftHandOperand
403
- * @param {Mixed} rightHandOperand
404
- * @param {Array} keys An array of keys to compare the values of leftHandOperand and rightHandOperand against
405
- * @param {Object} [options] (Optional)
406
- * @return {Boolean} result
407
- *)
408
- (*!
409
- * Recursively check the equality of two Objects. Once basic sameness has been established it will defer to `deepEqual`
410
- * for each enumerable key in the object.
411
- *
412
- * @param {Mixed} leftHandOperand
413
- * @param {Mixed} rightHandOperand
414
- * @param {Object} [options] (Optional)
415
- * @return {Boolean} result
416
- *)
417
- (*!
418
- * Returns true if the argument is a primitive.
419
- *
420
- * This intentionally returns true for all objects that can be compared by reference,
421
- * including functions and symbols.
422
- *
423
- * @param {Mixed} value
424
- * @return {Boolean} result
425
- *)
426
- *)
427
-
428
- @vitest/snapshot/dist/index.js:
429
- (*
430
- * @version 1.4.0
431
- * @date 2015-10-26
432
- * @stability 3 - Stable
433
- * @author Lauri Rooden (https://github.com/litejs/natural-compare-lite)
434
- * @license MIT License
435
- *)
436
- */
36
+ `)),s;I(()=>{if(i.length!==t.producedEvents.length)throw new Error(`Expected ${i.length} events, but got ${t.producedEvents.length} events.`);for(let[u,p]of i.entries()){let{aggregateId:C,eventName:M,payload:d}=t.producedEvents[u];if(p.aggregateId===N)throw new Error("Expected an `aggregateId`, but got `___` instead.");if(p.aggregateId!==C)throw new Error(`Expected aggregateId to be ${p.aggregateId}, but got ${C}.`);if(p.eventName!==M)throw new Error(`Expected eventName to be ${p.eventName}, but got ${M}.`);if((p.payload===null||p.payload===void 0)&&JSON.stringify(p.payload)!==JSON.stringify(d))throw new Error(`Expected payload to be ${JSON.stringify(p.payload)}, but got ${JSON.stringify(d)}.`);for(let l in p.payload){let P=p.payload[l];if(P===N){if(!(l in d))throw new Error(`Expected payload to have property ${l}, but it does not.`);if(d[l]===null||d[l]===void 0)throw new Error(`Expected payload to have property ${l}, but it is ${d[l]}.`)}else if(d[l]!==P)throw new Error(`Expected payload.${l} to be ${P}, but got ${d[l]}.`)}}},w.then)}};return w}0&&(module.exports={Aggregate,Command,Event,EventSource,Projector,abort,createEventMapper,createTestEventStore,objectToYaml});