@interfere/react 12.0.1 → 12.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (44) hide show
  1. package/dist/{api-wpS4xoMY.d.mts → api-DEVCOKkJ.d.mts} +4 -0
  2. package/dist/dist-ByNfzdQp.mjs +17 -0
  3. package/dist/error-boundary.d.mts +1 -1
  4. package/dist/{index-D-HGWlgi.d.mts → index-BVwotsYa.d.mts} +1 -1
  5. package/dist/internal/capture-boundary.d.mts +1 -1
  6. package/dist/internal/capture.d.mts +1 -1
  7. package/dist/internal/consent.d.mts +2 -8
  8. package/dist/internal/consent.mjs +1 -1
  9. package/dist/internal/kernel-registry.d.mts +1 -1
  10. package/dist/internal/kernel.d.mts +1 -1
  11. package/dist/internal/kernel.mjs +1 -1
  12. package/dist/internal/otel/exporter.mjs +1 -1
  13. package/dist/internal/otel/index.d.mts +2 -2
  14. package/dist/internal/otel/provider.d.mts +1 -1
  15. package/dist/internal/otel/provider.mjs +1 -1
  16. package/dist/internal/plugin-runtime.d.mts +1 -1
  17. package/dist/internal/plugin-runtime.mjs +1 -1
  18. package/dist/internal/react-context.d.mts +1 -1
  19. package/dist/internal/sw-queue.mjs +1 -1
  20. package/dist/internal/version.mjs +1 -1
  21. package/dist/internal/wrapper-singleton.d.mts +3 -3
  22. package/dist/internal/wrapper-singleton.mjs +1 -1
  23. package/dist/plugins/device.d.mts +1 -1
  24. package/dist/plugins/errors.d.mts +1 -1
  25. package/dist/plugins/lib/loader.d.mts +1 -1
  26. package/dist/plugins/lib/types.d.mts +1 -1
  27. package/dist/plugins/logs.d.mts +1 -1
  28. package/dist/plugins/logs.mjs +1 -1
  29. package/dist/plugins/page-events.d.mts +1 -1
  30. package/dist/plugins/rage-clicks.d.mts +1 -1
  31. package/dist/plugins/replay/delivery.d.mts +1 -1
  32. package/dist/plugins/replay/index.d.mts +1 -1
  33. package/dist/{provider-DRuvRafW.d.mts → provider-B2L5znqI.d.mts} +24 -16
  34. package/dist/{provider-CF0h4Mah.d.mts → provider-Df5aXrYa.d.mts} +4 -2
  35. package/dist/provider.d.mts +1 -1
  36. package/dist/react-error-handler.d.mts +1 -1
  37. package/dist/tracking/api.d.mts +1 -1
  38. package/dist/tracking/api.mjs +1 -1
  39. package/dist/tracking/registration.fixture.d.mts +3112 -0
  40. package/dist/tracking/registration.fixture.mjs +133 -0
  41. package/dist/tracking/session-retry.d.mts +10 -0
  42. package/dist/tracking/session-retry.mjs +1 -0
  43. package/dist/{version-XRSM9Pwm.mjs → version-CmerIGVk.mjs} +1 -1
  44. package/package.json +5 -5
@@ -0,0 +1,133 @@
1
+ import{DeviceManager}from"./device.mjs";import{GeoDetector}from"./geo.mjs";import{SessionTracker}from"./api.mjs";var __commonJSMin=(cb,mod)=>()=>(mod||(cb((mod={exports:{}}).exports,mod),cb=null),mod.exports),b$1={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]};function i$1(e){return String(e)}i$1.open=``,i$1.close=``;function B(){let e=typeof process<`u`?process:void 0,r=e?.env||{},a=r.FORCE_TTY!==`false`,l=e?.argv||[];return!(`NO_COLOR`in r||l.includes(`--no-color`))&&(`FORCE_COLOR`in r||l.includes(`--color`)||e?.platform===`win32`||a&&r.TERM!==`dumb`||`CI`in r)||typeof window<`u`&&!!window.chrome}function C({force:e}={}){let r=e||B(),a=(t,o,u,n)=>{let g=``,s=0;do g+=t.substring(s,n)+u,s=n+o.length,n=t.indexOf(o,s);while(~n);return g+t.substring(s)},l=(t,o,u=t)=>{let n=g=>{let s=String(g),h=s.indexOf(o,t.length);return~h?t+a(s,o,u,h)+o:t+s+o};return n.open=t,n.close=o,n},c={isColorSupported:r},f=t=>`\x1B[${t}m`;for(let t in b$1){let o=b$1[t];c[t]=r?l(f(o[0]),f(o[1]),o[2]):i$1}return c}var y$1=C();function _mergeNamespaces$1(n,m){return m.forEach(function(e){e&&typeof e!=`string`&&!Array.isArray(e)&&Object.keys(e).forEach(function(k){if(k!=="default"&&!(k in n)){var d=Object.getOwnPropertyDescriptor(e,k);Object.defineProperty(n,k,d.get?d:{enumerable:!0,get:function(){return e[k]}})}})}),Object.freeze(n)}function getKeysOfEnumerableProperties(object,compareKeys){let rawKeys=Object.keys(object),keys=compareKeys===null?rawKeys:rawKeys.sort(compareKeys);if(Object.getOwnPropertySymbols)for(let symbol of Object.getOwnPropertySymbols(object))Object.getOwnPropertyDescriptor(object,symbol).enumerable&&keys.push(symbol);return keys}function printIteratorEntries(iterator,config,indentation,depth,refs,printer,separator=`: `,length){let result=``,width=0,current=iterator.next();if(!current.done){result+=config.spacingOuter;let indentationNext=indentation+config.indent;for(;!current.done;){if(result+=indentationNext,width++===config.maxWidth){result+=typeof length==`number`?`…(${length-width+1})`:`…`;break}let name=printer(current.value[0],config,indentationNext,depth,refs),value=printer(current.value[1],config,indentationNext,depth,refs);result+=name+separator+value,current=iterator.next(),current.done?config.min||(result+=`,`):result+=`,${config.spacingInner}`}result+=config.spacingOuter+indentation}return result}function printIteratorValues(iterator,config,indentation,depth,refs,printer,length){let result=``,width=0,current=iterator.next();if(!current.done){result+=config.spacingOuter;let indentationNext=indentation+config.indent;for(;!current.done;){if(result+=indentationNext,width++===config.maxWidth){result+=typeof length==`number`?`…(${length-width+1})`:`…`;break}result+=printer(current.value,config,indentationNext,depth,refs),current=iterator.next(),current.done?config.min||(result+=`,`):result+=`,${config.spacingInner}`}result+=config.spacingOuter+indentation}return result}function printListItems(list,config,indentation,depth,refs,printer){let result=``;list=list instanceof ArrayBuffer?new DataView(list):list;let isDataView=l=>l instanceof DataView,length=isDataView(list)?list.byteLength:list.length;if(length>0){result+=config.spacingOuter;let indentationNext=indentation+config.indent;for(let i=0;i<length;i++){if(result+=indentationNext,i===config.maxWidth){result+=`…(${length-i})`;break}(isDataView(list)||i in list)&&(result+=printer(isDataView(list)?list.getInt8(i):list[i],config,indentationNext,depth,refs)),i<length-1?result+=`,${config.spacingInner}`:config.min||(result+=`,`)}result+=config.spacingOuter+indentation}return result}function printObjectProperties(val,config,indentation,depth,refs,printer,compareKeysOverride=config.compareKeys){let result=``,keys=getKeysOfEnumerableProperties(val,compareKeysOverride);if(keys.length>0){result+=config.spacingOuter;let indentationNext=indentation+config.indent;for(let i=0;i<keys.length;i++){if(result+=indentationNext,i===config.maxWidth){result+=`…(${keys.length-i})`;break}let key=keys[i],name=!config.quoteKeys&&isUnquotableKey(key)?key:printer(key,config,indentationNext,depth,refs),value=printer(val[key],config,indentationNext,depth,refs);result+=`${name}: ${value}`,i<keys.length-1?result+=`,${config.spacingInner}`:config.min||(result+=`,`)}result+=config.spacingOuter+indentation}return result}const keyStrRegExp=/^[a-z_]\w*$/i;function isUnquotableKey(key){return typeof key==`string`&&key!==`__proto__`&&keyStrRegExp.test(key)}const asymmetricMatcher=typeof Symbol==`function`&&Symbol.for?Symbol.for(`jest.asymmetricMatcher`):1267621,plugin$5={serialize:(val,config,indentation,depth,refs,printer)=>{let stringedValue=val.toString();if(stringedValue===`ArrayContaining`||stringedValue===`ArrayNotContaining`)return++depth>config.maxDepth?`[${stringedValue}]`:`${stringedValue+` `}[${printListItems(val.sample,config,indentation,depth,refs,printer)}]`;if(stringedValue===`ObjectContaining`||stringedValue===`ObjectNotContaining`)return++depth>config.maxDepth?`[${stringedValue}]`:`${stringedValue+` `}{${printObjectProperties(val.sample,config,indentation,depth,refs,printer)}}`;if(stringedValue===`StringMatching`||stringedValue===`StringNotMatching`||stringedValue===`StringContaining`||stringedValue===`StringNotContaining`)return stringedValue+` `+printer(val.sample,config,indentation,depth,refs);if(typeof val.toAsymmetricMatcher!=`function`)throw TypeError(`Asymmetric matcher ${val.constructor.name} does not implement toAsymmetricMatcher()`);return val.toAsymmetricMatcher()},test:val=>val&&val.$$typeof===asymmetricMatcher},OBJECT_NAMES=new Set([`DOMStringMap`,`NamedNodeMap`]),ARRAY_REGEXP=/^(?:HTML\w*Collection|NodeList)$/;function testName(name){return OBJECT_NAMES.has(name)||ARRAY_REGEXP.test(name)}const test$4=val=>val&&val.constructor&&!!val.constructor.name&&testName(val.constructor.name);function isNamedNodeMap(collection){return collection.constructor.name===`NamedNodeMap`}const plugin$4={serialize:(collection,config,indentation,depth,refs,printer)=>{let name=collection.constructor.name;return++depth>config.maxDepth?`[${name}]`:(config.min?``:name+` `)+(OBJECT_NAMES.has(name)?`{${printObjectProperties(isNamedNodeMap(collection)?[...collection].reduce((props,attribute)=>(props[attribute.name]=attribute.value,props),{}):{...collection},config,indentation,depth,refs,printer)}}`:`[${printListItems([...collection],config,indentation,depth,refs,printer)}]`)},test:test$4};function escapeHTML(str){return str.replaceAll(`<`,`&lt;`).replaceAll(`>`,`&gt;`)}function printProps(keys,props,config,indentation,depth,refs,printer){let indentationNext=indentation+config.indent,colors=config.colors;return keys.map(key=>{let value=props[key];if(typeof value==`string`&&value[0]===`_`&&value.startsWith(`__vitest_`)&&/__vitest_\d+__/.test(value))return``;let printed=printer(value,config,indentationNext,depth,refs);return typeof value!=`string`&&(printed.includes(`
2
+ `)&&(printed=config.spacingOuter+indentationNext+printed+config.spacingOuter+indentation),printed=`{${printed}}`),`${config.spacingInner+indentation+colors.prop.open+key+colors.prop.close}=${colors.value.open}${printed}${colors.value.close}`}).join(``)}function printChildren(children,config,indentation,depth,refs,printer){return children.map(child=>config.spacingOuter+indentation+(typeof child==`string`?printText(child,config):printer(child,config,indentation,depth,refs))).join(``)}function printShadowRoot(children,config,indentation,depth,refs,printer){return config.printShadowRoot===!1?``:[`${config.spacingOuter+indentation}#shadow-root`,printChildren(children,config,indentation+config.indent,depth,refs,printer)].join(``)}function printText(text,config){let contentColor=config.colors.content;return contentColor.open+escapeHTML(text)+contentColor.close}function printComment(comment,config){let commentColor=config.colors.comment;return`${commentColor.open}<!--${escapeHTML(comment)}-->${commentColor.close}`}function printElement(type,printedProps,printedChildren,config,indentation){let tagColor=config.colors.tag;return`${tagColor.open}<${type}${printedProps&&tagColor.close+printedProps+config.spacingOuter+indentation+tagColor.open}${printedChildren?`>${tagColor.close}${printedChildren}${config.spacingOuter}${indentation}${tagColor.open}</${type}`:`${printedProps&&!config.min?``:` `}/`}>${tagColor.close}`}function printElementAsLeaf(type,config){let tagColor=config.colors.tag;return`${tagColor.open}<${type}${tagColor.close} …${tagColor.open} />${tagColor.close}`}const ELEMENT_REGEXP=/^(?:(?:HTML|SVG)\w*)?Element$/;function testHasAttribute(val){try{return typeof val.hasAttribute==`function`&&val.hasAttribute(`is`)}catch{return!1}}function testNode(val){let constructorName=val.constructor.name,{nodeType,tagName}=val,isCustomElement=typeof tagName==`string`&&tagName.includes(`-`)||testHasAttribute(val);return nodeType===1&&(ELEMENT_REGEXP.test(constructorName)||isCustomElement)||nodeType===3&&constructorName===`Text`||nodeType===8&&constructorName===`Comment`||nodeType===11&&constructorName===`DocumentFragment`}const test$3=val=>val?.constructor?.name&&testNode(val);function nodeIsText(node){return node.nodeType===3}function nodeIsComment(node){return node.nodeType===8}function nodeIsFragment(node){return node.nodeType===11}function filterChildren(children,filterNode){let filtered=children.filter(node=>node.nodeType!==3||(node.data||``).trim().length>0);return filterNode&&(filtered=filtered.filter(filterNode)),filtered}function serializeDOM(node,config,indentation,depth,refs,printer,filterNode){if(nodeIsText(node))return printText(node.data,config);if(nodeIsComment(node))return printComment(node.data,config);let type=nodeIsFragment(node)?`DocumentFragment`:node.tagName.toLowerCase();if(++depth>config.maxDepth)return printElementAsLeaf(type,config);let children=Array.prototype.slice.call(node.childNodes||node.children),shadowChildren=nodeIsFragment(node)||!node.shadowRoot?[]:Array.prototype.slice.call(node.shadowRoot.children),resolvedChildren=filterNode?filterChildren(children,filterNode):children,resolvedShadowChildren=filterNode?filterChildren(shadowChildren,filterNode):shadowChildren;return printElement(type,printProps(nodeIsFragment(node)?[]:Array.from(node.attributes,attr=>attr.name).sort(),nodeIsFragment(node)?{}:[...node.attributes].reduce((props,attribute)=>(props[attribute.name]=attribute.value,props),{}),config,indentation+config.indent,depth,refs,printer),(resolvedShadowChildren.length>0?printShadowRoot(resolvedShadowChildren,config,indentation+config.indent,depth,refs,printer):``)+printChildren(resolvedChildren,config,indentation+config.indent,depth,refs,printer),config,indentation)}const serialize$3=(node,config,indentation,depth,refs,printer)=>serializeDOM(node,config,indentation,depth,refs,printer);function createDOMElementFilter(filterNode){return{test:test$3,serialize:(node,config,indentation,depth,refs,printer)=>serializeDOM(node,config,indentation,depth,refs,printer,filterNode)}}const plugin$3={serialize:serialize$3,test:test$3},IS_ORDERED_SENTINEL$1=`@@__IMMUTABLE_ORDERED__@@`,getImmutableName=name=>`Immutable.${name}`,printAsLeaf=name=>`[${name}]`;function printImmutableEntries(val,config,indentation,depth,refs,printer,type){return++depth>config.maxDepth?printAsLeaf(getImmutableName(type)):`${getImmutableName(type)+` `}{${printIteratorEntries(val.entries(),config,indentation,depth,refs,printer)}}`}function getRecordEntries(val){let i=0;return{next(){if(i<val._keys.length){let key=val._keys[i++];return{done:!1,value:[key,val.get(key)]}}return{done:!0,value:void 0}}}}function printImmutableRecord(val,config,indentation,depth,refs,printer){let name=getImmutableName(val._name||`Record`);return++depth>config.maxDepth?printAsLeaf(name):`${name+` `}{${printIteratorEntries(getRecordEntries(val),config,indentation,depth,refs,printer)}}`}function printImmutableSeq(val,config,indentation,depth,refs,printer){let name=getImmutableName(`Seq`);return++depth>config.maxDepth?printAsLeaf(name):val[`@@__IMMUTABLE_KEYED__@@`]?`${name+` `}{${val._iter||val._object?printIteratorEntries(val.entries(),config,indentation,depth,refs,printer):`…`}}`:`${name+` `}[${val._iter||val._array||val._collection||val._iterable?printIteratorValues(val.values(),config,indentation,depth,refs,printer):`…`}]`}function printImmutableValues(val,config,indentation,depth,refs,printer,type){return++depth>config.maxDepth?printAsLeaf(getImmutableName(type)):`${getImmutableName(type)+` `}[${printIteratorValues(val.values(),config,indentation,depth,refs,printer)}]`}const plugin$2={serialize:(val,config,indentation,depth,refs,printer)=>val[`@@__IMMUTABLE_MAP__@@`]?printImmutableEntries(val,config,indentation,depth,refs,printer,val[IS_ORDERED_SENTINEL$1]?`OrderedMap`:`Map`):val[`@@__IMMUTABLE_LIST__@@`]?printImmutableValues(val,config,indentation,depth,refs,printer,`List`):val[`@@__IMMUTABLE_SET__@@`]?printImmutableValues(val,config,indentation,depth,refs,printer,val[IS_ORDERED_SENTINEL$1]?`OrderedSet`:`Set`):val[`@@__IMMUTABLE_STACK__@@`]?printImmutableValues(val,config,indentation,depth,refs,printer,`Stack`):val[`@@__IMMUTABLE_SEQ__@@`]?printImmutableSeq(val,config,indentation,depth,refs,printer):printImmutableRecord(val,config,indentation,depth,refs,printer),test:val=>val&&(val[`@@__IMMUTABLE_ITERABLE__@@`]===!0||val[`@@__IMMUTABLE_RECORD__@@`]===!0)};function getDefaultExportFromCjs$1(x){return x&&x.__esModule&&Object.prototype.hasOwnProperty.call(x,`default`)?x.default:x}var reactIs$1={exports:{}},reactIs_production={},hasRequiredReactIs_production
3
+ /**
4
+ * @license React
5
+ * react-is.production.js
6
+ *
7
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
8
+ *
9
+ * This source code is licensed under the MIT license found in the
10
+ * LICENSE file in the root directory of this source tree.
11
+ */
12
+ ;function requireReactIs_production(){if(hasRequiredReactIs_production)return reactIs_production;hasRequiredReactIs_production=1;var REACT_ELEMENT_TYPE=Symbol.for(`react.transitional.element`),REACT_PORTAL_TYPE=Symbol.for(`react.portal`),REACT_FRAGMENT_TYPE=Symbol.for(`react.fragment`),REACT_STRICT_MODE_TYPE=Symbol.for(`react.strict_mode`),REACT_PROFILER_TYPE=Symbol.for(`react.profiler`),REACT_CONSUMER_TYPE=Symbol.for(`react.consumer`),REACT_CONTEXT_TYPE=Symbol.for(`react.context`),REACT_FORWARD_REF_TYPE=Symbol.for(`react.forward_ref`),REACT_SUSPENSE_TYPE=Symbol.for(`react.suspense`),REACT_SUSPENSE_LIST_TYPE=Symbol.for(`react.suspense_list`),REACT_MEMO_TYPE=Symbol.for(`react.memo`),REACT_LAZY_TYPE=Symbol.for(`react.lazy`),REACT_VIEW_TRANSITION_TYPE=Symbol.for(`react.view_transition`),REACT_CLIENT_REFERENCE=Symbol.for(`react.client.reference`);function typeOf(object){if(typeof object==`object`&&object){var $$typeof=object.$$typeof;switch($$typeof){case REACT_ELEMENT_TYPE:switch(object=object.type,object){case REACT_FRAGMENT_TYPE:case REACT_PROFILER_TYPE:case REACT_STRICT_MODE_TYPE:case REACT_SUSPENSE_TYPE:case REACT_SUSPENSE_LIST_TYPE:case REACT_VIEW_TRANSITION_TYPE:return object;default:switch(object&&=object.$$typeof,object){case REACT_CONTEXT_TYPE:case REACT_FORWARD_REF_TYPE:case REACT_LAZY_TYPE:case REACT_MEMO_TYPE:return object;case REACT_CONSUMER_TYPE:return object;default:return $$typeof}}case REACT_PORTAL_TYPE:return $$typeof}}}return reactIs_production.ContextConsumer=REACT_CONSUMER_TYPE,reactIs_production.ContextProvider=REACT_CONTEXT_TYPE,reactIs_production.Element=REACT_ELEMENT_TYPE,reactIs_production.ForwardRef=REACT_FORWARD_REF_TYPE,reactIs_production.Fragment=REACT_FRAGMENT_TYPE,reactIs_production.Lazy=REACT_LAZY_TYPE,reactIs_production.Memo=REACT_MEMO_TYPE,reactIs_production.Portal=REACT_PORTAL_TYPE,reactIs_production.Profiler=REACT_PROFILER_TYPE,reactIs_production.StrictMode=REACT_STRICT_MODE_TYPE,reactIs_production.Suspense=REACT_SUSPENSE_TYPE,reactIs_production.SuspenseList=REACT_SUSPENSE_LIST_TYPE,reactIs_production.isContextConsumer=function(object){return typeOf(object)===REACT_CONSUMER_TYPE},reactIs_production.isContextProvider=function(object){return typeOf(object)===REACT_CONTEXT_TYPE},reactIs_production.isElement=function(object){return typeof object==`object`&&!!object&&object.$$typeof===REACT_ELEMENT_TYPE},reactIs_production.isForwardRef=function(object){return typeOf(object)===REACT_FORWARD_REF_TYPE},reactIs_production.isFragment=function(object){return typeOf(object)===REACT_FRAGMENT_TYPE},reactIs_production.isLazy=function(object){return typeOf(object)===REACT_LAZY_TYPE},reactIs_production.isMemo=function(object){return typeOf(object)===REACT_MEMO_TYPE},reactIs_production.isPortal=function(object){return typeOf(object)===REACT_PORTAL_TYPE},reactIs_production.isProfiler=function(object){return typeOf(object)===REACT_PROFILER_TYPE},reactIs_production.isStrictMode=function(object){return typeOf(object)===REACT_STRICT_MODE_TYPE},reactIs_production.isSuspense=function(object){return typeOf(object)===REACT_SUSPENSE_TYPE},reactIs_production.isSuspenseList=function(object){return typeOf(object)===REACT_SUSPENSE_LIST_TYPE},reactIs_production.isValidElementType=function(type){return!!(typeof type==`string`||typeof type==`function`||type===REACT_FRAGMENT_TYPE||type===REACT_PROFILER_TYPE||type===REACT_STRICT_MODE_TYPE||type===REACT_SUSPENSE_TYPE||type===REACT_SUSPENSE_LIST_TYPE||typeof type==`object`&&type&&(type.$$typeof===REACT_LAZY_TYPE||type.$$typeof===REACT_MEMO_TYPE||type.$$typeof===REACT_CONTEXT_TYPE||type.$$typeof===REACT_CONSUMER_TYPE||type.$$typeof===REACT_FORWARD_REF_TYPE||type.$$typeof===REACT_CLIENT_REFERENCE||type.getModuleId!==void 0))},reactIs_production.typeOf=typeOf,reactIs_production}var hasRequiredReactIs$1;function requireReactIs$1(){return hasRequiredReactIs$1?reactIs$1.exports:(hasRequiredReactIs$1=1,reactIs$1.exports=requireReactIs_production(),reactIs$1.exports)}var reactIsExports$1=requireReactIs$1(),ReactIs19=_mergeNamespaces$1({__proto__:null,default:getDefaultExportFromCjs$1(reactIsExports$1)},[reactIsExports$1]),reactIs={exports:{}},reactIs_production_min={},hasRequiredReactIs_production_min
13
+ /**
14
+ * @license React
15
+ * react-is.production.min.js
16
+ *
17
+ * Copyright (c) Facebook, Inc. and its affiliates.
18
+ *
19
+ * This source code is licensed under the MIT license found in the
20
+ * LICENSE file in the root directory of this source tree.
21
+ */
22
+ ;function requireReactIs_production_min(){if(hasRequiredReactIs_production_min)return reactIs_production_min;hasRequiredReactIs_production_min=1;var b=Symbol.for(`react.element`),c=Symbol.for(`react.portal`),d=Symbol.for(`react.fragment`),e=Symbol.for(`react.strict_mode`),f=Symbol.for(`react.profiler`),g=Symbol.for(`react.provider`),h=Symbol.for(`react.context`),k=Symbol.for(`react.server_context`),l=Symbol.for(`react.forward_ref`),m=Symbol.for(`react.suspense`),n=Symbol.for(`react.suspense_list`),p=Symbol.for(`react.memo`),q=Symbol.for(`react.lazy`),t=Symbol.for(`react.offscreen`),u=Symbol.for(`react.module.reference`);function v(a){if(typeof a==`object`&&a){var r=a.$$typeof;switch(r){case b:switch(a=a.type,a){case d:case f:case e:case m:case n:return a;default:switch(a&&=a.$$typeof,a){case k:case h:case l:case q:case p:case g:return a;default:return r}}case c:return r}}}return reactIs_production_min.ContextConsumer=h,reactIs_production_min.ContextProvider=g,reactIs_production_min.Element=b,reactIs_production_min.ForwardRef=l,reactIs_production_min.Fragment=d,reactIs_production_min.Lazy=q,reactIs_production_min.Memo=p,reactIs_production_min.Portal=c,reactIs_production_min.Profiler=f,reactIs_production_min.StrictMode=e,reactIs_production_min.Suspense=m,reactIs_production_min.SuspenseList=n,reactIs_production_min.isAsyncMode=function(){return!1},reactIs_production_min.isConcurrentMode=function(){return!1},reactIs_production_min.isContextConsumer=function(a){return v(a)===h},reactIs_production_min.isContextProvider=function(a){return v(a)===g},reactIs_production_min.isElement=function(a){return typeof a==`object`&&!!a&&a.$$typeof===b},reactIs_production_min.isForwardRef=function(a){return v(a)===l},reactIs_production_min.isFragment=function(a){return v(a)===d},reactIs_production_min.isLazy=function(a){return v(a)===q},reactIs_production_min.isMemo=function(a){return v(a)===p},reactIs_production_min.isPortal=function(a){return v(a)===c},reactIs_production_min.isProfiler=function(a){return v(a)===f},reactIs_production_min.isStrictMode=function(a){return v(a)===e},reactIs_production_min.isSuspense=function(a){return v(a)===m},reactIs_production_min.isSuspenseList=function(a){return v(a)===n},reactIs_production_min.isValidElementType=function(a){return!!(typeof a==`string`||typeof a==`function`||a===d||a===f||a===e||a===m||a===n||a===t||typeof a==`object`&&a&&(a.$$typeof===q||a.$$typeof===p||a.$$typeof===g||a.$$typeof===h||a.$$typeof===l||a.$$typeof===u||a.getModuleId!==void 0))},reactIs_production_min.typeOf=v,reactIs_production_min}var hasRequiredReactIs;function requireReactIs(){return hasRequiredReactIs?reactIs.exports:(hasRequiredReactIs=1,reactIs.exports=requireReactIs_production_min(),reactIs.exports)}var reactIsExports=requireReactIs(),ReactIs18=_mergeNamespaces$1({__proto__:null,default:getDefaultExportFromCjs$1(reactIsExports)},[reactIsExports]);const ReactIs=Object.fromEntries([`isAsyncMode`,`isConcurrentMode`,`isContextConsumer`,`isContextProvider`,`isElement`,`isForwardRef`,`isFragment`,`isLazy`,`isMemo`,`isPortal`,`isProfiler`,`isStrictMode`,`isSuspense`,`isSuspenseList`,`isValidElementType`].map(m=>[m,v=>ReactIs18[m](v)||ReactIs19[m](v)]));function getChildren(arg,children=[]){if(Array.isArray(arg))for(let item of arg)getChildren(item,children);else arg!=null&&arg!==!1&&arg!==``&&children.push(arg);return children}function getType$2(element){let type=element.type;if(typeof type==`string`)return type;if(typeof type==`function`)return type.displayName||type.name||`Unknown`;if(ReactIs.isFragment(element))return`React.Fragment`;if(ReactIs.isSuspense(element))return`React.Suspense`;if(typeof type==`object`&&type){if(ReactIs.isContextProvider(element))return`Context.Provider`;if(ReactIs.isContextConsumer(element))return`Context.Consumer`;if(ReactIs.isForwardRef(element)){if(type.displayName)return type.displayName;let functionName=type.render.displayName||type.render.name||``;return functionName===``?`ForwardRef`:`ForwardRef(${functionName})`}if(ReactIs.isMemo(element)){let functionName=type.displayName||type.type.displayName||type.type.name||``;return functionName===``?`Memo`:`Memo(${functionName})`}}return`UNDEFINED`}function getPropKeys$1(element){let{props}=element;return Object.keys(props).filter(key=>key!==`children`&&props[key]!==void 0).sort()}const plugin$1={serialize:(element,config,indentation,depth,refs,printer)=>++depth>config.maxDepth?printElementAsLeaf(getType$2(element),config):printElement(getType$2(element),printProps(getPropKeys$1(element),element.props,config,indentation+config.indent,depth,refs,printer),printChildren(getChildren(element.props.children),config,indentation+config.indent,depth,refs,printer),config,indentation),test:val=>val!=null&&ReactIs.isElement(val)},testSymbol=typeof Symbol==`function`&&Symbol.for?Symbol.for(`react.test.json`):245830487;function getPropKeys(object){let{props}=object;return props?Object.keys(props).filter(key=>props[key]!==void 0).sort():[]}const plugin$6={serialize:(object,config,indentation,depth,refs,printer)=>++depth>config.maxDepth?printElementAsLeaf(object.type,config):printElement(object.type,object.props?printProps(getPropKeys(object),object.props,config,indentation+config.indent,depth,refs,printer):``,object.children?printChildren(object.children,config,indentation+config.indent,depth,refs,printer):``,config,indentation),test:val=>val&&val.$$typeof===testSymbol},toString$1=Object.prototype.toString,toISOString=Date.prototype.toISOString,errorToString=Error.prototype.toString,regExpToString=RegExp.prototype.toString;function getConstructorName$1(val){return typeof val.constructor==`function`&&val.constructor.name||`Object`}function isWindow(val){return typeof window<`u`&&val===window}const SYMBOL_REGEXP=/^Symbol\((.*)\)(.*)$/,NEWLINE_REGEXP=/\n/g;var PrettyFormatPluginError=class extends Error{constructor(message,stack){super(message),this.stack=stack,this.name=this.constructor.name}};function isToStringedArrayType(toStringed){return toStringed===`[object Array]`||toStringed===`[object ArrayBuffer]`||toStringed===`[object DataView]`||toStringed===`[object Float32Array]`||toStringed===`[object Float64Array]`||toStringed===`[object Int8Array]`||toStringed===`[object Int16Array]`||toStringed===`[object Int32Array]`||toStringed===`[object Uint8Array]`||toStringed===`[object Uint8ClampedArray]`||toStringed===`[object Uint16Array]`||toStringed===`[object Uint32Array]`}function printNumber(val){return Object.is(val,-0)?`-0`:String(val)}function printBigInt(val){return String(`${val}n`)}function printFunction(val,printFunctionName){return printFunctionName?`[Function ${val.name||`anonymous`}]`:`[Function]`}function printSymbol(val){return String(val).replace(SYMBOL_REGEXP,`Symbol($1)`)}function printError(val){return`[${errorToString.call(val)}]`}function printBasicValue(val,printFunctionName,escapeRegex,escapeString,singleQuote){if(val===!0||val===!1)return`${val}`;if(val===void 0)return`undefined`;if(val===null)return`null`;let typeOf=typeof val;if(typeOf===`number`)return printNumber(val);if(typeOf===`bigint`)return printBigInt(val);if(typeOf===`string`){let q=singleQuote?`'`:`"`;if(escapeString){let escapePattern=singleQuote?/['\\]/g:/["\\]/g;return`${q}${val.replaceAll(escapePattern,`\\$&`)}${q}`}return`${q}${val}${q}`}if(typeOf===`function`)return printFunction(val,printFunctionName);if(typeOf===`symbol`)return printSymbol(val);let toStringed=toString$1.call(val);return toStringed===`[object WeakMap]`?`WeakMap {}`:toStringed===`[object WeakSet]`?`WeakSet {}`:toStringed===`[object Function]`||toStringed===`[object GeneratorFunction]`?printFunction(val,printFunctionName):toStringed===`[object Symbol]`?printSymbol(val):toStringed===`[object Date]`?Number.isNaN(+val)?`Date { NaN }`:toISOString.call(val):toStringed===`[object Error]`?printError(val):toStringed===`[object RegExp]`?escapeRegex?regExpToString.call(val).replaceAll(/[$()*+.?[\\\]^{|}]/g,`\\$&`):regExpToString.call(val):val instanceof Error?printError(val):null}function printComplexValue(val,config,indentation,depth,refs,hasCalledToJSON){if(refs.includes(val))return`[Circular]`;refs=[...refs],refs.push(val);let hitMaxDepth=++depth>config.maxDepth,min=config.min;if(config.callToJSON&&!hitMaxDepth&&val.toJSON&&typeof val.toJSON==`function`&&!hasCalledToJSON)return printer(val.toJSON(),config,indentation,depth,refs,!0);let toStringed=toString$1.call(val);return toStringed===`[object Arguments]`?hitMaxDepth?`[Arguments]`:`${min?``:`Arguments `}[${printListItems(val,config,indentation,depth,refs,printer)}]`:isToStringedArrayType(toStringed)?hitMaxDepth?`[${val.constructor.name}]`:`${!config.printBasicPrototype&&val.constructor.name===`Array`?``:`${val.constructor.name} `}[${printListItems(val,config,indentation,depth,refs,printer)}]`:toStringed===`[object Map]`?hitMaxDepth?`[Map]`:`Map {${printIteratorEntries(val.entries(),config,indentation,depth,refs,printer,` => `,val.size)}}`:toStringed===`[object Set]`?hitMaxDepth?`[Set]`:`Set {${printIteratorValues(val.values(),config,indentation,depth,refs,printer,val.size)}}`:hitMaxDepth||isWindow(val)?`[${getConstructorName$1(val)}]`:`${!config.printBasicPrototype&&getConstructorName$1(val)===`Object`?``:`${getConstructorName$1(val)} `}{${printObjectProperties(val,config,indentation,depth,refs,printer)}}`}const ErrorPlugin={test:val=>val&&val instanceof Error,serialize(val,config,indentation,depth,refs,printer){if(refs.includes(val))return`[Circular]`;refs=[...refs,val];let hitMaxDepth=++depth>config.maxDepth,{message,cause,...rest}=val,entries={message,...cause===void 0?{}:{cause},...val instanceof AggregateError?{errors:val.errors}:{},...rest},name=val.name===`Error`?getConstructorName$1(val):val.name;return hitMaxDepth?`[${name}]`:`${name} {${printObjectProperties(entries,config,indentation,depth,refs,printer,null)}}`}};function isNewPlugin(plugin){return plugin.serialize!=null}function printPlugin(plugin,val,config,indentation,depth,refs){let printed;try{printed=isNewPlugin(plugin)?plugin.serialize(val,config,indentation,depth,refs,printer):plugin.print(val,valChild=>printer(valChild,config,indentation,depth,refs),str=>{let indentationNext=indentation+config.indent;return indentationNext+str.replaceAll(NEWLINE_REGEXP,`\n${indentationNext}`)},{edgeSpacing:config.spacingOuter,min:config.min,spacing:config.spacingInner},config.colors)}catch(error){throw new PrettyFormatPluginError(error.message,error.stack)}if(typeof printed!=`string`)throw TypeError(`pretty-format: Plugin must return type "string" but instead returned "${typeof printed}".`);return printed}function findPlugin(plugins,val){for(let plugin of plugins)try{if(plugin.test(val))return plugin}catch(error){throw new PrettyFormatPluginError(error.message,error.stack)}return null}function printer(val,config,indentation,depth,refs,hasCalledToJSON){let result,plugin=findPlugin(config.plugins,val);if(plugin!==null)result=printPlugin(plugin,val,config,indentation,depth,refs);else{let basicResult=printBasicValue(val,config.printFunctionName,config.escapeRegex,config.escapeString,config.singleQuote);result=basicResult===null?printComplexValue(val,config,indentation,depth,refs,hasCalledToJSON):basicResult}return config._outputLengthPerDepth[depth]??=0,config._outputLengthPerDepth[depth]+=result.length,config._outputLengthPerDepth[depth]>config.maxOutputLength&&(config.maxDepth=0),result}const DEFAULT_THEME={comment:`gray`,content:`reset`,prop:`yellow`,tag:`cyan`,value:`green`},DEFAULT_THEME_KEYS=Object.keys(DEFAULT_THEME),DEFAULT_OPTIONS={callToJSON:!0,compareKeys:void 0,escapeRegex:!1,escapeString:!0,highlight:!1,indent:2,maxDepth:1/0,maxOutputLength:1e6,maxWidth:1/0,min:!1,plugins:[],printBasicPrototype:!0,printFunctionName:!0,printShadowRoot:!0,theme:DEFAULT_THEME,singleQuote:!1,quoteKeys:!0,spacingInner:`
23
+ `,spacingOuter:`
24
+ `};function validateOptions$1(options){for(let key of Object.keys(options))if(!Object.hasOwn(DEFAULT_OPTIONS,key))throw Error(`pretty-format: Unknown option "${key}".`);if(options.min&&options.indent!==void 0&&options.indent!==0)throw Error(`pretty-format: Options "min" and "indent" cannot be used together.`)}function getColorsHighlight(){return DEFAULT_THEME_KEYS.reduce((colors,key)=>{let value=DEFAULT_THEME[key],color=value&&y$1[value];if(color&&typeof color.close==`string`&&typeof color.open==`string`)colors[key]=color;else throw Error(`pretty-format: Option "theme" has a key "${key}" whose value "${value}" is undefined in ansi-styles.`);return colors},Object.create(null))}function getColorsEmpty(){return DEFAULT_THEME_KEYS.reduce((colors,key)=>(colors[key]={close:``,open:``},colors),Object.create(null))}function getPrintFunctionName(options){return options?.printFunctionName??DEFAULT_OPTIONS.printFunctionName}function getEscapeRegex(options){return options?.escapeRegex??DEFAULT_OPTIONS.escapeRegex}function getEscapeString(options){return options?.escapeString??DEFAULT_OPTIONS.escapeString}function getConfig(options){return{callToJSON:options?.callToJSON??DEFAULT_OPTIONS.callToJSON,colors:options?.highlight?getColorsHighlight():getColorsEmpty(),compareKeys:typeof options?.compareKeys==`function`||options?.compareKeys===null?options.compareKeys:DEFAULT_OPTIONS.compareKeys,escapeRegex:getEscapeRegex(options),escapeString:getEscapeString(options),indent:options?.min?``:createIndent(options?.indent??DEFAULT_OPTIONS.indent),maxDepth:options?.maxDepth??DEFAULT_OPTIONS.maxDepth,maxWidth:options?.maxWidth??DEFAULT_OPTIONS.maxWidth,min:options?.min??DEFAULT_OPTIONS.min,plugins:options?.plugins??DEFAULT_OPTIONS.plugins,printBasicPrototype:options?.printBasicPrototype??!options?.min,printFunctionName:getPrintFunctionName(options),printShadowRoot:options?.printShadowRoot??!0,spacingInner:options?.spacingInner??(options?.min?` `:`
25
+ `),spacingOuter:options?.spacingOuter??(options?.min?``:`
26
+ `),singleQuote:options?.singleQuote??DEFAULT_OPTIONS.singleQuote,quoteKeys:options?.quoteKeys??DEFAULT_OPTIONS.quoteKeys,maxOutputLength:options?.maxOutputLength??DEFAULT_OPTIONS.maxOutputLength,_outputLengthPerDepth:[]}}function createIndent(indent){return Array.from({length:indent+1}).join(` `)}function format$1(val,options){options&&validateOptions$1(options);let config=getConfig(options),plugin=findPlugin(config.plugins,val);if(plugin!==null)return printPlugin(plugin,val,config,``,0,[]);let basicResult=printBasicValue(val,config.printFunctionName,config.escapeRegex,config.escapeString,config.singleQuote);return basicResult===null?printComplexValue(val,config,``,0,[]):basicResult}const plugins={AsymmetricMatcher:plugin$5,DOMCollection:plugin$4,DOMElement:plugin$3,Immutable:plugin$2,ReactElement:plugin$1,ReactTestComponent:plugin$6,Error:ErrorPlugin},{AsymmetricMatcher:AsymmetricMatcher$3,DOMCollection:DOMCollection$2,DOMElement:DOMElement$2,Immutable:Immutable$2,ReactElement:ReactElement$2,ReactTestComponent:ReactTestComponent$2}=plugins,PLUGINS$2=[ReactTestComponent$2,ReactElement$2,DOMElement$2,DOMCollection$2,Immutable$2,AsymmetricMatcher$3];function stringify(object,maxDepth=10,{maxLength,filterNode,...options}={}){let MAX_LENGTH=maxLength??1e4,result,filterFn=typeof filterNode==`string`?createNodeFilterFromSelector(filterNode):filterNode,plugins=filterFn?[ReactTestComponent$2,ReactElement$2,createDOMElementFilter(filterFn),DOMCollection$2,Immutable$2,AsymmetricMatcher$3]:PLUGINS$2;try{result=format$1(object,{maxDepth,escapeString:!1,plugins,...options})}catch{result=format$1(object,{callToJSON:!1,maxDepth,escapeString:!1,plugins,...options})}return result.length>=MAX_LENGTH&&maxDepth>1?stringify(object,Math.floor(Math.min(maxDepth,2**53-1)/2),{maxLength,filterNode,...options}):result}function createNodeFilterFromSelector(selector){return node=>{if(node.nodeType===8)return!1;if(node.nodeType===1&&node.matches)try{return!node.matches(selector)}catch{return!0}return!0}}const formatRegExp=/%[sdjifoOc%]/g;function format(args,options={}){let formatArg=item=>inspect$1(item,options);if(typeof args[0]!=`string`){let objects=[];for(let i=0;i<args.length;i++)objects.push(formatArg(args[i]));return objects.join(` `)}let len=args.length,i=1,template=args[0],str=String(template).replace(formatRegExp,x=>{if(x===`%%`)return`%`;if(i>=len)return x;switch(x){case`%s`:{let value=args[i++];return typeof value==`bigint`?`${value.toString()}n`:typeof value==`number`&&value===0&&1/value<0?`-0`:typeof value==`object`&&value?typeof value.toString==`function`&&value.toString!==Object.prototype.toString?value.toString():formatArg(value):String(value)}case`%d`:{let value=args[i++];return typeof value==`bigint`?`${value.toString()}n`:typeof value==`symbol`?`NaN`:Number(value).toString()}case`%i`:{let value=args[i++];return typeof value==`bigint`?`${value.toString()}n`:Number.parseInt(String(value)).toString()}case`%f`:return Number.parseFloat(String(args[i++])).toString();case`%o`:case`%O`:return formatArg(args[i++]);case`%c`:return i++,``;case`%j`:try{return JSON.stringify(args[i++])}catch(err){let m=err.message;if(m.includes(`circular structure`)||m.includes(`cyclic structures`)||m.includes(`cyclic object`))return`[Circular]`;throw err}default:return x}});for(let x=args[i];i<len;x=args[++i])str+=typeof x!=`object`||!x?` ${typeof x==`symbol`?x.toString():x}`:` ${formatArg(x)}`;return str}function inspect$1(obj,options){let{truncate,multiline,...stringifyOptions}=options??{},prettyFormatOptions={singleQuote:!0,quoteKeys:!1,min:!0,spacingInner:` `,spacingOuter:` `,printBasicPrototype:!1,compareKeys:null,...multiline?{min:!1,spacingInner:void 0,spacingOuter:void 0}:{}},threshold=truncate??0,formatted=stringify(obj,void 0,{...prettyFormatOptions,...stringifyOptions,maxLength:threshold||void 0});if(threshold===0||formatted.length<=threshold)return formatted;let type=Object.prototype.toString.call(obj);if(typeof obj==`string`){let end=threshold-1;return end>0&&isHighSurrogate$1(formatted[end-1])&&--end,`'${formatted.slice(1,end)}…'`}return type===`[object Array]`||type===`[object Object]`||type===`[object Set]`||type===`[object Map]`?stringifyByMaxWidth(obj,threshold,{...prettyFormatOptions,...stringifyOptions,maxDepth:1}):stringify(obj,void 0,{...prettyFormatOptions,...stringifyOptions,maxDepth:0})}function truncateString(string,maxLength){if(string.length<=maxLength)return string;let end=maxLength-1;return isHighSurrogate$1(string[end-1])&&--end,`${string.slice(0,end)}…`}function stringifyByMaxWidth(object,threshold,options){function evaluate(x){return stringify(object,void 0,{...options,maxWidth:x})}return evaluate(binarySearch$1(0,threshold,x=>evaluate(x).length<=threshold))}function binarySearch$1(x0,x1,f){for(;x0+1<x1;){let x=Math.floor((x0+x1)/2);f(x)?x0=x:x1=x}return x0}function isHighSurrogate$1(char){return char>=`\ud800`&&char<=`\udbff`}RegExp(`\\.(${`apng.bmp.png.jpe?g.jfif.pjpeg.pjp.gif.svg.ico.webp.avif.mp4.webm.ogg.mp3.wav.flac.aac.woff2?.eot.ttf.otf.webmanifest.pdf.txt`.split(`.`).join(`|`)})$`);function createSimpleStackTrace(options){let{message=`$$stack trace error`,stackTraceLimit=1}=options||{},limit=Error.stackTraceLimit,prepareStackTrace=Error.prepareStackTrace;Error.stackTraceLimit=stackTraceLimit,Error.prepareStackTrace=e=>e.stack;let stackTrace=Error(message).stack||``;return Error.prepareStackTrace=prepareStackTrace,Error.stackTraceLimit=limit,stackTrace}function notNullish(v){return v!=null}function assertTypes(value,name,types){let receivedType=typeof value;if(!types.includes(receivedType))throw TypeError(`${name} value must be ${types.join(` or `)}, received "${receivedType}"`)}function isPrimitive$1(value){return value===null||typeof value!=`function`&&typeof value!=`object`}function filterOutComments(s){let result=[],commentState=`none`;for(let i=0;i<s.length;++i)commentState===`singleline`?s[i]===`
27
+ `&&(commentState=`none`):commentState===`multiline`?s[i-1]===`*`&&s[i]===`/`&&(commentState=`none`):commentState===`none`&&(s[i]===`/`&&s[i+1]===`/`?commentState=`singleline`:s[i]===`/`&&s[i+1]===`*`?(commentState=`multiline`,i+=2):result.push(s[i]));return result.join(``)}function toArray(array){return array??=[],Array.isArray(array)?array:[array]}function isObject(item){return typeof item==`object`&&!!item&&!Array.isArray(item)}function isFinalObj(obj){return obj===Object.prototype||obj===Function.prototype||obj===RegExp.prototype}function getType$1(value){return Object.prototype.toString.apply(value).slice(8,-1)}function collectOwnProperties(obj,collector){let collect=typeof collector==`function`?collector:key=>collector.add(key);Object.getOwnPropertyNames(obj).forEach(collect),Object.getOwnPropertySymbols(obj).forEach(collect)}function getOwnProperties(obj){let ownProps=new Set;return isFinalObj(obj)?[]:(collectOwnProperties(obj,ownProps),Array.from(ownProps))}const defaultCloneOptions={forceWritable:!1};function deepClone(val,options=defaultCloneOptions){return clone(val,new WeakMap,options)}function clone(val,seen,options=defaultCloneOptions){let k,out;if(seen.has(val))return seen.get(val);if(Array.isArray(val)){for(out=Array.from({length:k=val.length}),seen.set(val,out);k--;)out[k]=clone(val[k],seen,options);return out}if(Object.prototype.toString.call(val)===`[object Object]`){out=Object.create(Object.getPrototypeOf(val)),seen.set(val,out);let props=getOwnProperties(val);for(let k of props){let descriptor=Object.getOwnPropertyDescriptor(val,k);if(!descriptor)continue;let cloned=clone(val[k],seen,options);options.forceWritable?Object.defineProperty(out,k,{enumerable:descriptor.enumerable,configurable:!0,writable:!0,value:cloned}):`get`in descriptor?Object.defineProperty(out,k,{...descriptor,get(){return cloned}}):Object.defineProperty(out,k,{...descriptor,value:cloned})}return out}return val}function noop(){}function objectAttr(source,path,defaultValue=void 0){let paths=path.replace(/\[(\d+)\]/g,`.$1`).split(`.`),result=source;for(let p of paths)if(result=new Object(result)[p],result===void 0)return defaultValue;return result}function createDefer(){let resolve=null,reject=null,p=new Promise((_resolve,_reject)=>{resolve=_resolve,reject=_reject});return p.resolve=resolve,p.reject=reject,p}function getCallLastIndex(code){let charIndex=-1,inString=null,startedBracers=0,endedBracers=0,beforeChar=null;for(;charIndex<=code.length;){beforeChar=code[charIndex],charIndex++;let char=code[charIndex];if((char===`"`||char===`'`||char==="`")&&beforeChar!==`\\`&&(inString===char?inString=null:inString||=char),inString||(char===`(`&&startedBracers++,char===`)`&&endedBracers++),startedBracers&&endedBracers&&startedBracers===endedBracers)return charIndex}return null}function isNegativeNaN(val){if(!Number.isNaN(val))return!1;let f64=new Float64Array(1);return f64[0]=val,new Uint32Array(f64.buffer)[1]>>>31==1}function ordinal(i){let j=i%10,k=i%100;return j===1&&k!==11?`${i}st`:j===2&&k!==12?`${i}nd`:j===3&&k!==13?`${i}rd`:`${i}th`}function unique(array){return Array.from(new Set(array))}const _DRIVE_LETTER_START_RE=/^[A-Za-z]:\//;function normalizeWindowsPath(input=``){return input&&input.replace(/\\/g,`/`).replace(_DRIVE_LETTER_START_RE,r=>r.toUpperCase())}const _IS_ABSOLUTE_RE=/^[/\\](?![/\\])|^[/\\]{2}(?!\.)|^[A-Za-z]:[/\\]/;function cwd(){return typeof process<`u`&&typeof process.cwd==`function`?process.cwd().replace(/\\/g,`/`):`/`}const resolve=function(...arguments_){arguments_=arguments_.map(argument=>normalizeWindowsPath(argument));let resolvedPath=``,resolvedAbsolute=!1;for(let index=arguments_.length-1;index>=-1&&!resolvedAbsolute;index--){let path=index>=0?arguments_[index]:cwd();path&&path.length!==0&&(resolvedPath=`${path}/${resolvedPath}`,resolvedAbsolute=isAbsolute(path))}return resolvedPath=normalizeString(resolvedPath,!resolvedAbsolute),resolvedAbsolute&&!isAbsolute(resolvedPath)?`/${resolvedPath}`:resolvedPath.length>0?resolvedPath:`.`};function normalizeString(path,allowAboveRoot){let res=``,lastSegmentLength=0,lastSlash=-1,dots=0,char=null;for(let index=0;index<=path.length;++index){if(index<path.length)char=path[index];else if(char===`/`)break;else char=`/`;if(char===`/`){if(lastSlash!==index-1&&dots!==1){if(dots===2){if(res.length<2||lastSegmentLength!==2||res[res.length-1]!==`.`||res[res.length-2]!==`.`){if(res.length>2){let lastSlashIndex=res.lastIndexOf(`/`);lastSlashIndex===-1?(res=``,lastSegmentLength=0):(res=res.slice(0,lastSlashIndex),lastSegmentLength=res.length-1-res.lastIndexOf(`/`)),lastSlash=index,dots=0;continue}if(res.length>0){res=``,lastSegmentLength=0,lastSlash=index,dots=0;continue}}allowAboveRoot&&(res+=res.length>0?`/..`:`..`,lastSegmentLength=2)}else res.length>0?res+=`/${path.slice(lastSlash+1,index)}`:res=path.slice(lastSlash+1,index),lastSegmentLength=index-lastSlash-1}lastSlash=index,dots=0}else char===`.`&&dots!==-1?++dots:dots=-1}return res}const isAbsolute=function(p){return _IS_ABSOLUTE_RE.test(p)};var commonjsGlobal=typeof globalThis<`u`?globalThis:typeof window<`u`?window:typeof global<`u`?global:typeof self<`u`?self:{};function getDefaultExportFromCjs(x){return x&&x.__esModule&&Object.prototype.hasOwnProperty.call(x,`default`)?x.default:x}var build={},hasRequiredBuild;function requireBuild(){if(hasRequiredBuild)return build;hasRequiredBuild=1,Object.defineProperty(build,"__esModule",{value:!0}),build.default=diffSequence;let pkg=`diff-sequences`,countCommonItemsF=(aIndex,aEnd,bIndex,bEnd,isCommon)=>{let nCommon=0;for(;aIndex<aEnd&&bIndex<bEnd&&isCommon(aIndex,bIndex);)aIndex+=1,bIndex+=1,nCommon+=1;return nCommon},countCommonItemsR=(aStart,aIndex,bStart,bIndex,isCommon)=>{let nCommon=0;for(;aStart<=aIndex&&bStart<=bIndex&&isCommon(aIndex,bIndex);)--aIndex,--bIndex,nCommon+=1;return nCommon},extendPathsF=(d,aEnd,bEnd,bF,isCommon,aIndexesF,iMaxF)=>{let iF=0,kF=-d,aFirst=aIndexesF[iF],aIndexPrev1=aFirst;aIndexesF[iF]+=countCommonItemsF(aFirst+1,aEnd,bF+aFirst-kF+1,bEnd,isCommon);let nF=d<iMaxF?d:iMaxF;for(iF+=1,kF+=2;iF<=nF;iF+=1,kF+=2){if(iF!==d&&aIndexPrev1<aIndexesF[iF])aFirst=aIndexesF[iF];else if(aFirst=aIndexPrev1+1,aEnd<=aFirst)return iF-1;aIndexPrev1=aIndexesF[iF],aIndexesF[iF]=aFirst+countCommonItemsF(aFirst+1,aEnd,bF+aFirst-kF+1,bEnd,isCommon)}return iMaxF},extendPathsR=(d,aStart,bStart,bR,isCommon,aIndexesR,iMaxR)=>{let iR=0,kR=d,aFirst=aIndexesR[iR],aIndexPrev1=aFirst;aIndexesR[iR]-=countCommonItemsR(aStart,aFirst-1,bStart,bR+aFirst-kR-1,isCommon);let nR=d<iMaxR?d:iMaxR;for(iR+=1,kR-=2;iR<=nR;iR+=1,kR-=2){if(iR!==d&&aIndexesR[iR]<aIndexPrev1)aFirst=aIndexesR[iR];else if(aFirst=aIndexPrev1-1,aFirst<aStart)return iR-1;aIndexPrev1=aIndexesR[iR],aIndexesR[iR]=aFirst-countCommonItemsR(aStart,aFirst-1,bStart,bR+aFirst-kR-1,isCommon)}return iMaxR},extendOverlappablePathsF=(d,aStart,aEnd,bStart,bEnd,isCommon,aIndexesF,iMaxF,aIndexesR,iMaxR,division)=>{let bF=bStart-aStart,aLength=aEnd-aStart,baDeltaLength=bEnd-bStart-aLength,kMinOverlapF=-baDeltaLength-(d-1),kMaxOverlapF=-baDeltaLength+(d-1),aIndexPrev1=0,nF=d<iMaxF?d:iMaxF;for(let iF=0,kF=-d;iF<=nF;iF+=1,kF+=2){let insert=iF===0||iF!==d&&aIndexPrev1<aIndexesF[iF],aLastPrev=insert?aIndexesF[iF]:aIndexPrev1,aFirst=insert?aLastPrev:aLastPrev+1,bFirst=bF+aFirst-kF,nCommonF=countCommonItemsF(aFirst+1,aEnd,bFirst+1,bEnd,isCommon),aLast=aFirst+nCommonF;if(aIndexPrev1=aIndexesF[iF],aIndexesF[iF]=aLast,kMinOverlapF<=kF&&kF<=kMaxOverlapF){let iR=(d-1-(kF+baDeltaLength))/2;if(iR<=iMaxR&&aIndexesR[iR]-1<=aLast){let bLastPrev=bF+aLastPrev-(insert?kF+1:kF-1),nCommonR=countCommonItemsR(aStart,aLastPrev,bStart,bLastPrev,isCommon),aIndexPrevFirst=aLastPrev-nCommonR,bIndexPrevFirst=bLastPrev-nCommonR,aEndPreceding=aIndexPrevFirst+1,bEndPreceding=bIndexPrevFirst+1;division.nChangePreceding=d-1,d-1===aEndPreceding+bEndPreceding-aStart-bStart?(division.aEndPreceding=aStart,division.bEndPreceding=bStart):(division.aEndPreceding=aEndPreceding,division.bEndPreceding=bEndPreceding),division.nCommonPreceding=nCommonR,nCommonR!==0&&(division.aCommonPreceding=aEndPreceding,division.bCommonPreceding=bEndPreceding),division.nCommonFollowing=nCommonF,nCommonF!==0&&(division.aCommonFollowing=aFirst+1,division.bCommonFollowing=bFirst+1);let aStartFollowing=aLast+1,bStartFollowing=bFirst+nCommonF+1;return division.nChangeFollowing=d-1,d-1===aEnd+bEnd-aStartFollowing-bStartFollowing?(division.aStartFollowing=aEnd,division.bStartFollowing=bEnd):(division.aStartFollowing=aStartFollowing,division.bStartFollowing=bStartFollowing),!0}}}return!1},extendOverlappablePathsR=(d,aStart,aEnd,bStart,bEnd,isCommon,aIndexesF,iMaxF,aIndexesR,iMaxR,division)=>{let bR=bEnd-aEnd,aLength=aEnd-aStart,baDeltaLength=bEnd-bStart-aLength,kMinOverlapR=baDeltaLength-d,kMaxOverlapR=baDeltaLength+d,aIndexPrev1=0,nR=d<iMaxR?d:iMaxR;for(let iR=0,kR=d;iR<=nR;iR+=1,kR-=2){let insert=iR===0||iR!==d&&aIndexesR[iR]<aIndexPrev1,aLastPrev=insert?aIndexesR[iR]:aIndexPrev1,aFirst=insert?aLastPrev:aLastPrev-1,bFirst=bR+aFirst-kR,nCommonR=countCommonItemsR(aStart,aFirst-1,bStart,bFirst-1,isCommon),aLast=aFirst-nCommonR;if(aIndexPrev1=aIndexesR[iR],aIndexesR[iR]=aLast,kMinOverlapR<=kR&&kR<=kMaxOverlapR){let iF=(d+(kR-baDeltaLength))/2;if(iF<=iMaxF&&aLast-1<=aIndexesF[iF]){let bLast=bFirst-nCommonR;if(division.nChangePreceding=d,d===aLast+bLast-aStart-bStart?(division.aEndPreceding=aStart,division.bEndPreceding=bStart):(division.aEndPreceding=aLast,division.bEndPreceding=bLast),division.nCommonPreceding=nCommonR,nCommonR!==0&&(division.aCommonPreceding=aLast,division.bCommonPreceding=bLast),division.nChangeFollowing=d-1,d===1)division.nCommonFollowing=0,division.aStartFollowing=aEnd,division.bStartFollowing=bEnd;else{let bLastPrev=bR+aLastPrev-(insert?kR-1:kR+1),nCommonF=countCommonItemsF(aLastPrev,aEnd,bLastPrev,bEnd,isCommon);division.nCommonFollowing=nCommonF,nCommonF!==0&&(division.aCommonFollowing=aLastPrev,division.bCommonFollowing=bLastPrev);let aStartFollowing=aLastPrev+nCommonF,bStartFollowing=bLastPrev+nCommonF;d-1===aEnd+bEnd-aStartFollowing-bStartFollowing?(division.aStartFollowing=aEnd,division.bStartFollowing=bEnd):(division.aStartFollowing=aStartFollowing,division.bStartFollowing=bStartFollowing)}return!0}}}return!1},divide=(nChange,aStart,aEnd,bStart,bEnd,isCommon,aIndexesF,aIndexesR,division)=>{let bF=bStart-aStart,bR=bEnd-aEnd,aLength=aEnd-aStart,bLength=bEnd-bStart,baDeltaLength=bLength-aLength,iMaxF=aLength,iMaxR=aLength;if(aIndexesF[0]=aStart-1,aIndexesR[0]=aEnd,baDeltaLength%2==0){let dMin=(nChange||baDeltaLength)/2,dMax=(aLength+bLength)/2;for(let d=1;d<=dMax;d+=1)if(iMaxF=extendPathsF(d,aEnd,bEnd,bF,isCommon,aIndexesF,iMaxF),d<dMin)iMaxR=extendPathsR(d,aStart,bStart,bR,isCommon,aIndexesR,iMaxR);else if(extendOverlappablePathsR(d,aStart,aEnd,bStart,bEnd,isCommon,aIndexesF,iMaxF,aIndexesR,iMaxR,division))return}else{let dMin=((nChange||baDeltaLength)+1)/2,dMax=(aLength+bLength+1)/2,d=1;for(iMaxF=extendPathsF(d,aEnd,bEnd,bF,isCommon,aIndexesF,iMaxF),d+=1;d<=dMax;d+=1)if(iMaxR=extendPathsR(d-1,aStart,bStart,bR,isCommon,aIndexesR,iMaxR),d<dMin)iMaxF=extendPathsF(d,aEnd,bEnd,bF,isCommon,aIndexesF,iMaxF);else if(extendOverlappablePathsF(d,aStart,aEnd,bStart,bEnd,isCommon,aIndexesF,iMaxF,aIndexesR,iMaxR,division))return}throw Error(`${pkg}: no overlap aStart=${aStart} aEnd=${aEnd} bStart=${bStart} bEnd=${bEnd}`)},findSubsequences=(nChange,aStart,aEnd,bStart,bEnd,transposed,callbacks,aIndexesF,aIndexesR,division)=>{if(bEnd-bStart<aEnd-aStart){if(transposed=!transposed,transposed&&callbacks.length===1){let{foundSubsequence,isCommon}=callbacks[0];callbacks[1]={foundSubsequence:(nCommon,bCommon,aCommon)=>{foundSubsequence(nCommon,aCommon,bCommon)},isCommon:(bIndex,aIndex)=>isCommon(aIndex,bIndex)}}let tStart=aStart,tEnd=aEnd;aStart=bStart,aEnd=bEnd,bStart=tStart,bEnd=tEnd}let{foundSubsequence,isCommon}=callbacks[+!!transposed];divide(nChange,aStart,aEnd,bStart,bEnd,isCommon,aIndexesF,aIndexesR,division);let{nChangePreceding,aEndPreceding,bEndPreceding,nCommonPreceding,aCommonPreceding,bCommonPreceding,nCommonFollowing,aCommonFollowing,bCommonFollowing,nChangeFollowing,aStartFollowing,bStartFollowing}=division;aStart<aEndPreceding&&bStart<bEndPreceding&&findSubsequences(nChangePreceding,aStart,aEndPreceding,bStart,bEndPreceding,transposed,callbacks,aIndexesF,aIndexesR,division),nCommonPreceding!==0&&foundSubsequence(nCommonPreceding,aCommonPreceding,bCommonPreceding),nCommonFollowing!==0&&foundSubsequence(nCommonFollowing,aCommonFollowing,bCommonFollowing),aStartFollowing<aEnd&&bStartFollowing<bEnd&&findSubsequences(nChangeFollowing,aStartFollowing,aEnd,bStartFollowing,bEnd,transposed,callbacks,aIndexesF,aIndexesR,division)},validateLength=(name,arg)=>{if(typeof arg!=`number`)throw TypeError(`${pkg}: ${name} typeof ${typeof arg} is not a number`);if(!Number.isSafeInteger(arg))throw RangeError(`${pkg}: ${name} value ${arg} is not a safe integer`);if(arg<0)throw RangeError(`${pkg}: ${name} value ${arg} is a negative integer`)},validateCallback=(name,arg)=>{let type=typeof arg;if(type!==`function`)throw TypeError(`${pkg}: ${name} typeof ${type} is not a function`)};function diffSequence(aLength,bLength,isCommon,foundSubsequence){validateLength(`aLength`,aLength),validateLength(`bLength`,bLength),validateCallback(`isCommon`,isCommon),validateCallback(`foundSubsequence`,foundSubsequence);let nCommonF=countCommonItemsF(0,aLength,0,bLength,isCommon);if(nCommonF!==0&&foundSubsequence(nCommonF,0,0),aLength!==nCommonF||bLength!==nCommonF){let aStart=nCommonF,bStart=nCommonF,nCommonR=countCommonItemsR(aStart,aLength-1,bStart,bLength-1,isCommon),aEnd=aLength-nCommonR,bEnd=bLength-nCommonR,nCommonFR=nCommonF+nCommonR;aLength!==nCommonFR&&bLength!==nCommonFR&&findSubsequences(0,aStart,aEnd,bStart,bEnd,!1,[{foundSubsequence,isCommon}],[0],[0],{aCommonFollowing:0,aCommonPreceding:0,aEndPreceding:0,aStartFollowing:0,bCommonFollowing:0,bCommonPreceding:0,bEndPreceding:0,bStartFollowing:0,nChangeFollowing:0,nChangePreceding:0,nCommonFollowing:0,nCommonPreceding:0}),nCommonR!==0&&foundSubsequence(nCommonR,aEnd,bEnd)}}return build}var diffSequences=getDefaultExportFromCjs(requireBuild());function isImmutable(v){return v&&(v[`@@__IMMUTABLE_ITERABLE__@@`]||v[`@@__IMMUTABLE_RECORD__@@`])}const OBJECT_PROTO=Object.getPrototypeOf({});function getUnserializableMessage(err){return err instanceof Error?`<unserializable>: ${err.message}`:typeof err==`string`?`<unserializable>: ${err}`:`<unserializable>`}function serializeValue(val,seen=new WeakMap){if(!val||typeof val==`string`)return val;if(val instanceof Error&&`toJSON`in val&&typeof val.toJSON==`function`){let jsonValue=val.toJSON();return jsonValue&&jsonValue!==val&&typeof jsonValue==`object`&&(typeof val.message==`string`&&safe(()=>jsonValue.message??=normalizeErrorMessage(val.message)),typeof val.stack==`string`&&safe(()=>jsonValue.stack??=val.stack),typeof val.name==`string`&&safe(()=>jsonValue.name??=val.name),val.cause!=null&&safe(()=>jsonValue.cause??=serializeValue(val.cause,seen))),serializeValue(jsonValue,seen)}if(typeof val==`function`)return`Function<${val.name||`anonymous`}>`;if(typeof val==`symbol`)return val.toString();if(typeof val!=`object`)return val;if(typeof Buffer<`u`&&val instanceof Buffer)return`<Buffer(${val.length}) ...>`;if(typeof Uint8Array<`u`&&val instanceof Uint8Array)return`<Uint8Array(${val.length}) ...>`;if(isImmutable(val))return serializeValue(val.toJSON(),seen);if(val instanceof Promise||val.constructor&&val.constructor.prototype===`AsyncFunction`)return`Promise`;if(typeof Element<`u`&&val instanceof Element)return val.tagName;if(typeof val.toJSON==`function`)return serializeValue(val.toJSON(),seen);if(seen.has(val))return seen.get(val);if(Array.isArray(val)){let clone=Array(val.length);return seen.set(val,clone),val.forEach((e,i)=>{try{clone[i]=serializeValue(e,seen)}catch(err){clone[i]=getUnserializableMessage(err)}}),clone}{let clone=Object.create(null);seen.set(val,clone);let obj=val;for(;obj&&obj!==OBJECT_PROTO;)Object.getOwnPropertyNames(obj).forEach(key=>{if(!(key in clone))try{clone[key]=serializeValue(val[key],seen)}catch(err){delete clone[key],clone[key]=getUnserializableMessage(err)}}),obj=Object.getPrototypeOf(obj);return val instanceof Error&&safe(()=>clone.message=normalizeErrorMessage(val.message)),clone}}function safe(fn){try{return fn()}catch{}}function normalizeErrorMessage(message){return message.replace(/\(0\s?,\s?__vite_ssr_import_\d+__.(\w+)\)/g,`$1`).replace(/__(vite_ssr_import|vi_import)_\d+__\./g,``).replace(/getByTestId('__vitest_\d+__')/g,`page`)}const SAFE_TIMERS_SYMBOL=Symbol(`vitest:SAFE_TIMERS`);function getSafeTimers(){let{setTimeout:safeSetTimeout,setInterval:safeSetInterval,clearInterval:safeClearInterval,clearTimeout:safeClearTimeout,setImmediate:safeSetImmediate,clearImmediate:safeClearImmediate,queueMicrotask:safeQueueMicrotask}=globalThis[SAFE_TIMERS_SYMBOL]||globalThis,{nextTick:safeNextTick}=globalThis[SAFE_TIMERS_SYMBOL]||globalThis.process||{};return{nextTick:safeNextTick,setTimeout:safeSetTimeout,setInterval:safeSetInterval,clearInterval:safeClearInterval,clearTimeout:safeClearTimeout,setImmediate:safeSetImmediate,clearImmediate:safeClearImmediate,queueMicrotask:safeQueueMicrotask}}function delay(timeout,scheduler=setTimeout){return new Promise(resolve=>scheduler(resolve,timeout))}var comma=44,chars=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/`,intToChar=new Uint8Array(64),charToInt=new Uint8Array(128);for(let i=0;i<chars.length;i++){let c=chars.charCodeAt(i);intToChar[i]=c,charToInt[c]=i}function decodeInteger(reader,relative){let value=0,shift=0,integer=0;do integer=charToInt[reader.next()],value|=(integer&31)<<shift,shift+=5;while(integer&32);let shouldNegate=value&1;return value>>>=1,shouldNegate&&(value=-2147483648|-value),relative+value}function hasMoreVlq(reader,max){return reader.pos>=max?!1:reader.peek()!==comma}var StringReader=class{constructor(buffer){this.pos=0,this.buffer=buffer}next(){return this.buffer.charCodeAt(this.pos++)}peek(){return this.buffer.charCodeAt(this.pos)}indexOf(char){let{buffer,pos}=this,idx=buffer.indexOf(char,pos);return idx===-1?buffer.length:idx}};function decode(mappings){let{length}=mappings,reader=new StringReader(mappings),decoded=[],genColumn=0,sourcesIndex=0,sourceLine=0,sourceColumn=0,namesIndex=0;do{let semi=reader.indexOf(`;`),line=[],sorted=!0,lastCol=0;for(genColumn=0;reader.pos<semi;){let seg;genColumn=decodeInteger(reader,genColumn),genColumn<lastCol&&(sorted=!1),lastCol=genColumn,hasMoreVlq(reader,semi)?(sourcesIndex=decodeInteger(reader,sourcesIndex),sourceLine=decodeInteger(reader,sourceLine),sourceColumn=decodeInteger(reader,sourceColumn),hasMoreVlq(reader,semi)?(namesIndex=decodeInteger(reader,namesIndex),seg=[genColumn,sourcesIndex,sourceLine,sourceColumn,namesIndex]):seg=[genColumn,sourcesIndex,sourceLine,sourceColumn]):seg=[genColumn],line.push(seg),reader.pos++}sorted||sort(line),decoded.push(line),reader.pos=semi+1}while(reader.pos<=length);return decoded}function sort(line){line.sort(sortComparator$1)}function sortComparator$1(a,b){return a[0]-b[0]}var COLUMN=0,SOURCES_INDEX=1,SOURCE_LINE=2,SOURCE_COLUMN=3,NAMES_INDEX=4,found=!1;function binarySearch(haystack,needle,low,high){for(;low<=high;){let mid=low+(high-low>>1),cmp=haystack[mid][COLUMN]-needle;if(cmp===0)return found=!0,mid;cmp<0?low=mid+1:high=mid-1}return found=!1,low-1}function upperBound(haystack,needle,index){for(let i=index+1;i<haystack.length&&haystack[i][COLUMN]===needle;index=i++);return index}function lowerBound(haystack,needle,index){for(let i=index-1;i>=0&&haystack[i][COLUMN]===needle;index=i--);return index}function memoizedBinarySearch(haystack,needle,state,key){let{lastKey,lastNeedle,lastIndex}=state,low=0,high=haystack.length-1;if(key===lastKey){if(needle===lastNeedle)return found=lastIndex!==-1&&haystack[lastIndex][COLUMN]===needle,lastIndex;needle>=lastNeedle?low=lastIndex===-1?0:lastIndex:high=lastIndex}return state.lastKey=key,state.lastNeedle=needle,state.lastIndex=binarySearch(haystack,needle,low,high)}var LINE_GTR_ZERO="`line` must be greater than 0 (lines start at line 1)",COL_GTR_EQ_ZERO="`column` must be greater than or equal to 0 (columns start at column 0)",LEAST_UPPER_BOUND=-1,GREATEST_LOWER_BOUND=1;function cast(map){return map}function decodedMappings(map){var _a;return(_a=cast(map))._decoded||(_a._decoded=decode(cast(map)._encoded))}function originalPositionFor(map,needle){let{line,column,bias}=needle;if(line--,line<0)throw Error(LINE_GTR_ZERO);if(column<0)throw Error(COL_GTR_EQ_ZERO);let decoded=decodedMappings(map);if(line>=decoded.length)return OMapping(null,null,null,null);let segments=decoded[line],index=traceSegmentInternal(segments,cast(map)._decodedMemo,line,column,bias||GREATEST_LOWER_BOUND);if(index===-1)return OMapping(null,null,null,null);let segment=segments[index];if(segment.length===1)return OMapping(null,null,null,null);let{names,resolvedSources}=map;return OMapping(resolvedSources[segment[SOURCES_INDEX]],segment[SOURCE_LINE]+1,segment[SOURCE_COLUMN],segment.length===5?names[segment[NAMES_INDEX]]:null)}function OMapping(source,line,column,name){return{source,line,column,name}}function traceSegmentInternal(segments,memo,line,column,bias){let index=memoizedBinarySearch(segments,column,memo,line);return found?index=(bias===LEAST_UPPER_BOUND?upperBound:lowerBound)(segments,column,index):bias===LEAST_UPPER_BOUND&&index++,index===-1||index===segments.length?-1:index}const CHROME_IE_STACK_REGEXP=/^\s*at .*(?:\S:\d+|\(native\))/m,SAFARI_NATIVE_CODE_REGEXP=/^(?:eval@)?(?:\[native code\])?$/,stackIgnorePatterns=[`node:internal`,/\/packages\/\w+\/dist\//,/\/@vitest\/\w+\/dist\//,`/vitest/dist/`,`/vitest/src/`,`/packages/expect/src/`,`/packages/snapshot/src/`,`/node_modules/chai/`,`/node_modules/tinyspy/`,`/vite/dist/node/module-runner`,`/rolldown-vite/dist/node/module-runner`,`/deps/chunk-`,`/deps/@vitest`,`/deps/loupe`,`/deps/chai`,`/browser-playwright/dist/locators.js`,`/browser-webdriverio/dist/locators.js`,`/browser-preview/dist/locators.js`,/node:\w+/,/__vitest_test__/,/__vitest_browser__/,`/@id/__x00__vitest/browser`,/\/deps\/vitest_/,`/deps/vitest.js`],NOW_LENGTH=Date.now().toString().length,REGEXP_VITEST=RegExp(`vitest=\\d{${NOW_LENGTH}}`);function extractLocation(urlLike){if(!urlLike.includes(`:`))return[urlLike];let parts=/(.+?)(?::(\d+))?(?::(\d+))?$/.exec(urlLike.replace(/^\(|\)$/g,``));if(!parts)return[urlLike];let url=parts[1];if(url.startsWith(`async `)&&(url=url.slice(6)),url.startsWith(`http:`)||url.startsWith(`https:`)){let urlObj=new URL(url);urlObj.searchParams.delete(`import`),urlObj.searchParams.delete(`browserv`),url=urlObj.pathname+urlObj.hash+urlObj.search}if(url.startsWith(`/@fs/`)){let isWindows=/^\/@fs\/[a-zA-Z]:\//.test(url);url=url.slice(isWindows?5:4)}return url.includes(`vitest=`)&&(url=url.replace(REGEXP_VITEST,``).replace(/[?&]$/,``)),[url,parts[2]||void 0,parts[3]||void 0]}function parseSingleFFOrSafariStack(raw){let line=raw.trim();if(SAFARI_NATIVE_CODE_REGEXP.test(line)||(line.includes(` > eval`)&&(line=line.replace(/ line (\d+)(?: > eval line \d+)* > eval:\d+:\d+/g,`:$1`)),!line.includes(`@`)))return null;let atIndex=-1,locationPart=``,functionName;for(let i=0;i<line.length;i++)if(line[i]===`@`){let candidateLocation=line.slice(i+1);if(candidateLocation.includes(`:`)&&candidateLocation.length>=3){atIndex=i,locationPart=candidateLocation,functionName=i>0?line.slice(0,i):void 0;break}}if(atIndex===-1||!locationPart.includes(`:`)||locationPart.length<3)return null;let[url,lineNumber,columnNumber]=extractLocation(locationPart);return!url||!lineNumber||!columnNumber?null:{file:url,method:functionName||``,line:Number.parseInt(lineNumber),column:Number.parseInt(columnNumber)}}function parseSingleStack(raw){let line=raw.trim();return CHROME_IE_STACK_REGEXP.test(line)?parseSingleV8Stack(line):parseSingleFFOrSafariStack(line)}function parseSingleV8Stack(raw){let line=raw.trim();if(!CHROME_IE_STACK_REGEXP.test(line))return null;line.includes(`(eval `)&&(line=line.replace(/eval code/g,`eval`).replace(/(\(eval at [^()]*)|(,.*$)/g,``));let sanitizedLine=line.replace(/^\s+/,``).replace(/\(eval code/g,`(`).replace(/^.*?\s+/,``),location=sanitizedLine.match(/ (\(.+\)$)/);sanitizedLine=location?sanitizedLine.replace(location[0],``):sanitizedLine;let[url,lineNumber,columnNumber]=extractLocation(location?location[1]:sanitizedLine),method=location&&sanitizedLine||``,file=url&&[`eval`,`<anonymous>`].includes(url)?void 0:url;return!file||!lineNumber||!columnNumber?null:(method.startsWith(`async `)&&(method=method.slice(6)),file.startsWith(`file://`)&&(file=file.slice(7)),file=file.startsWith(`node:`)||file.startsWith(`internal:`)?file:resolve(file),method&&=method.replace(/\(0\s?,\s?__vite_ssr_import_\d+__.(\w+)\)/g,`$1`).replace(/__(vite_ssr_import|vi_import)_\d+__\./g,``).replace(/(Object\.)?__vite_ssr_export_default__\s?/g,``),{method,file,line:Number.parseInt(lineNumber),column:Number.parseInt(columnNumber)})}function parseStacktrace(stack,options={}){let{ignoreStackEntries=stackIgnorePatterns}=options,stacks=CHROME_IE_STACK_REGEXP.test(stack)?parseV8Stacktrace(stack):parseFFOrSafariStackTrace(stack),helperIndex=stacks.findLastIndex(s=>s.method.includes(`__VITEST_HELPER__`));return helperIndex>=0&&(stacks=stacks.slice(helperIndex+1)),stacks.map(stack=>{options.getUrlId&&(stack.file=options.getUrlId(stack.file));let map=options.getSourceMap?.(stack.file);if(!map||typeof map!=`object`||!map.version)return shouldFilter(ignoreStackEntries,stack.file)?null:stack;let traceMap=new DecodedMap(map,stack.file);if(stack.line<=0||stack.column<=0)return stack;let position=getOriginalPosition(traceMap,{line:stack.line,column:stack.column-1});if(!position)return stack;let{line,column,source,name}=position,file=source||stack.file;return/\/\w:\//.test(file)&&(file=file.slice(1)),shouldFilter(ignoreStackEntries,file)?null:line!=null&&column!=null?{line,column:column+1,file,method:name||stack.method}:stack}).filter(s=>s!=null)}function shouldFilter(ignoreStackEntries,file){return ignoreStackEntries.some(p=>file.match(p))}function parseFFOrSafariStackTrace(stack){return stack.split(`
28
+ `).map(line=>parseSingleFFOrSafariStack(line)).filter(notNullish)}function parseV8Stacktrace(stack){return stack.split(`
29
+ `).map(line=>parseSingleV8Stack(line)).filter(notNullish)}function parseErrorStacktrace(e,options={}){if(!e||isPrimitive$1(e))return[];if(`stacks`in e&&e.stacks)return e.stacks;let stackStr=e.stack||``,stackFrames=typeof stackStr==`string`?parseStacktrace(stackStr,options):[];if(!stackFrames.length){let e_=e;e_.fileName!=null&&e_.lineNumber!=null&&e_.columnNumber!=null&&(stackFrames=parseStacktrace(`${e_.fileName}:${e_.lineNumber}:${e_.columnNumber}`,options)),e_.sourceURL!=null&&e_.line!=null&&e_._column!=null&&(stackFrames=parseStacktrace(`${e_.sourceURL}:${e_.line}:${e_.column}`,options))}return options.frameFilter&&(stackFrames=stackFrames.filter(f=>options.frameFilter(e,f)!==!1)),e.stacks=stackFrames,stackFrames}var DecodedMap=class{map;_encoded;_decoded;_decodedMemo;url;version;names=[];resolvedSources;constructor(map,from){this.map=map;let{mappings,names,sources}=map;this.version=map.version,this.names=names||[],this._encoded=mappings||``,this._decodedMemo=memoizedState(),this.url=from,this.resolvedSources=(sources||[]).map(s=>resolve(from,`..`,s||``))}};function memoizedState(){return{lastKey:-1,lastNeedle:-1,lastIndex:-1}}function getOriginalPosition(map,needle){let result=originalPositionFor(map,needle);return result.column==null?null:result}function getNames(task){let names=[task.name],current=task;for(;current?.suite;)current=current.suite,current?.name&&names.unshift(current.name);return current!==task.file&&names.unshift(task.file.name),names}function createTaskName(names,separator=` > `){return names.filter(name=>name!==void 0).join(separator)}var Diff=class{0;1;constructor(op,text){this[0]=op,this[1]=text}};function diff_commonPrefix(text1,text2){if(!text1||!text2||text1.charAt(0)!==text2.charAt(0))return 0;let pointermin=0,pointermax=Math.min(text1.length,text2.length),pointermid=pointermax,pointerstart=0;for(;pointermin<pointermid;)text1.substring(pointerstart,pointermid)===text2.substring(pointerstart,pointermid)?(pointermin=pointermid,pointerstart=pointermin):pointermax=pointermid,pointermid=Math.floor((pointermax-pointermin)/2+pointermin);return pointermid}function diff_commonSuffix(text1,text2){if(!text1||!text2||text1.charAt(text1.length-1)!==text2.charAt(text2.length-1))return 0;let pointermin=0,pointermax=Math.min(text1.length,text2.length),pointermid=pointermax,pointerend=0;for(;pointermin<pointermid;)text1.substring(text1.length-pointermid,text1.length-pointerend)===text2.substring(text2.length-pointermid,text2.length-pointerend)?(pointermin=pointermid,pointerend=pointermin):pointermax=pointermid,pointermid=Math.floor((pointermax-pointermin)/2+pointermin);return pointermid}function diff_commonOverlap_(text1,text2){let text1_length=text1.length,text2_length=text2.length;if(text1_length===0||text2_length===0)return 0;text1_length>text2_length?text1=text1.substring(text1_length-text2_length):text1_length<text2_length&&(text2=text2.substring(0,text1_length));let text_length=Math.min(text1_length,text2_length);if(text1===text2)return text_length;let best=0,length=1;for(;;){let pattern=text1.substring(text_length-length),found=text2.indexOf(pattern);if(found===-1)return best;length+=found,(found===0||text1.substring(text_length-length)===text2.substring(0,length))&&(best=length,length++)}}function diff_cleanupSemantic(diffs){let changes=!1,equalities=[],equalitiesLength=0,lastEquality=null,pointer=0,length_insertions1=0,length_deletions1=0,length_insertions2=0,length_deletions2=0;for(;pointer<diffs.length;)diffs[pointer][0]===0?(equalities[equalitiesLength++]=pointer,length_insertions1=length_insertions2,length_deletions1=length_deletions2,length_insertions2=0,length_deletions2=0,lastEquality=diffs[pointer][1]):(diffs[pointer][0]===1?length_insertions2+=diffs[pointer][1].length:length_deletions2+=diffs[pointer][1].length,lastEquality&&lastEquality.length<=Math.max(length_insertions1,length_deletions1)&&lastEquality.length<=Math.max(length_insertions2,length_deletions2)&&(diffs.splice(equalities[equalitiesLength-1],0,new Diff(-1,lastEquality)),diffs[equalities[equalitiesLength-1]+1][0]=1,equalitiesLength--,equalitiesLength--,pointer=equalitiesLength>0?equalities[equalitiesLength-1]:-1,length_insertions1=0,length_deletions1=0,length_insertions2=0,length_deletions2=0,lastEquality=null,changes=!0)),pointer++;for(changes&&diff_cleanupMerge(diffs),diff_cleanupSemanticLossless(diffs),pointer=1;pointer<diffs.length;){if(diffs[pointer-1][0]===-1&&diffs[pointer][0]===1){let deletion=diffs[pointer-1][1],insertion=diffs[pointer][1],overlap_length1=diff_commonOverlap_(deletion,insertion),overlap_length2=diff_commonOverlap_(insertion,deletion);overlap_length1>=overlap_length2?(overlap_length1>=deletion.length/2||overlap_length1>=insertion.length/2)&&(diffs.splice(pointer,0,new Diff(0,insertion.substring(0,overlap_length1))),diffs[pointer-1][1]=deletion.substring(0,deletion.length-overlap_length1),diffs[pointer+1][1]=insertion.substring(overlap_length1),pointer++):(overlap_length2>=deletion.length/2||overlap_length2>=insertion.length/2)&&(diffs.splice(pointer,0,new Diff(0,deletion.substring(0,overlap_length2))),diffs[pointer-1][0]=1,diffs[pointer-1][1]=insertion.substring(0,insertion.length-overlap_length2),diffs[pointer+1][0]=-1,diffs[pointer+1][1]=deletion.substring(overlap_length2),pointer++),pointer++}pointer++}}const nonAlphaNumericRegex_=/[^a-z0-9]/i,whitespaceRegex_=/\s/,linebreakRegex_=/[\r\n]/,blanklineEndRegex_=/\n\r?\n$/,blanklineStartRegex_=/^\r?\n\r?\n/;function diff_cleanupSemanticLossless(diffs){let pointer=1;for(;pointer<diffs.length-1;){if(diffs[pointer-1][0]===0&&diffs[pointer+1][0]===0){let equality1=diffs[pointer-1][1],edit=diffs[pointer][1],equality2=diffs[pointer+1][1],commonOffset=diff_commonSuffix(equality1,edit);if(commonOffset){let commonString=edit.substring(edit.length-commonOffset);equality1=equality1.substring(0,equality1.length-commonOffset),edit=commonString+edit.substring(0,edit.length-commonOffset),equality2=commonString+equality2}let bestEquality1=equality1,bestEdit=edit,bestEquality2=equality2,bestScore=diff_cleanupSemanticScore_(equality1,edit)+diff_cleanupSemanticScore_(edit,equality2);for(;edit.charAt(0)===equality2.charAt(0);){equality1+=edit.charAt(0),edit=edit.substring(1)+equality2.charAt(0),equality2=equality2.substring(1);let score=diff_cleanupSemanticScore_(equality1,edit)+diff_cleanupSemanticScore_(edit,equality2);score>=bestScore&&(bestScore=score,bestEquality1=equality1,bestEdit=edit,bestEquality2=equality2)}diffs[pointer-1][1]!==bestEquality1&&(bestEquality1?diffs[pointer-1][1]=bestEquality1:(diffs.splice(pointer-1,1),pointer--),diffs[pointer][1]=bestEdit,bestEquality2?diffs[pointer+1][1]=bestEquality2:(diffs.splice(pointer+1,1),pointer--))}pointer++}}function diff_cleanupMerge(diffs){diffs.push(new Diff(0,``));let pointer=0,count_delete=0,count_insert=0,text_delete=``,text_insert=``,commonlength;for(;pointer<diffs.length;)switch(diffs[pointer][0]){case 1:count_insert++,text_insert+=diffs[pointer][1],pointer++;break;case-1:count_delete++,text_delete+=diffs[pointer][1],pointer++;break;case 0:count_delete+count_insert>1?(count_delete!==0&&count_insert!==0&&(commonlength=diff_commonPrefix(text_insert,text_delete),commonlength!==0&&(pointer-count_delete-count_insert>0&&diffs[pointer-count_delete-count_insert-1][0]===0?diffs[pointer-count_delete-count_insert-1][1]+=text_insert.substring(0,commonlength):(diffs.splice(0,0,new Diff(0,text_insert.substring(0,commonlength))),pointer++),text_insert=text_insert.substring(commonlength),text_delete=text_delete.substring(commonlength)),commonlength=diff_commonSuffix(text_insert,text_delete),commonlength!==0&&(diffs[pointer][1]=text_insert.substring(text_insert.length-commonlength)+diffs[pointer][1],text_insert=text_insert.substring(0,text_insert.length-commonlength),text_delete=text_delete.substring(0,text_delete.length-commonlength))),pointer-=count_delete+count_insert,diffs.splice(pointer,count_delete+count_insert),text_delete.length&&(diffs.splice(pointer,0,new Diff(-1,text_delete)),pointer++),text_insert.length&&(diffs.splice(pointer,0,new Diff(1,text_insert)),pointer++),pointer++):pointer!==0&&diffs[pointer-1][0]===0?(diffs[pointer-1][1]+=diffs[pointer][1],diffs.splice(pointer,1)):pointer++,count_insert=0,count_delete=0,text_delete=``,text_insert=``}diffs.at(-1)?.[1]===``&&diffs.pop();let changes=!1;for(pointer=1;pointer<diffs.length-1;)diffs[pointer-1][0]===0&&diffs[pointer+1][0]===0&&(diffs[pointer][1].substring(diffs[pointer][1].length-diffs[pointer-1][1].length)===diffs[pointer-1][1]?(diffs[pointer][1]=diffs[pointer-1][1]+diffs[pointer][1].substring(0,diffs[pointer][1].length-diffs[pointer-1][1].length),diffs[pointer+1][1]=diffs[pointer-1][1]+diffs[pointer+1][1],diffs.splice(pointer-1,1),changes=!0):diffs[pointer][1].substring(0,diffs[pointer+1][1].length)===diffs[pointer+1][1]&&(diffs[pointer-1][1]+=diffs[pointer+1][1],diffs[pointer][1]=diffs[pointer][1].substring(diffs[pointer+1][1].length)+diffs[pointer+1][1],diffs.splice(pointer+1,1),changes=!0)),pointer++;changes&&diff_cleanupMerge(diffs)}function diff_cleanupSemanticScore_(one,two){if(!one||!two)return 6;let char1=one.charAt(one.length-1),char2=two.charAt(0),nonAlphaNumeric1=char1.match(nonAlphaNumericRegex_),nonAlphaNumeric2=char2.match(nonAlphaNumericRegex_),whitespace1=nonAlphaNumeric1&&char1.match(whitespaceRegex_),whitespace2=nonAlphaNumeric2&&char2.match(whitespaceRegex_),lineBreak1=whitespace1&&char1.match(linebreakRegex_),lineBreak2=whitespace2&&char2.match(linebreakRegex_),blankLine1=lineBreak1&&one.match(blanklineEndRegex_),blankLine2=lineBreak2&&two.match(blanklineStartRegex_);return blankLine1||blankLine2?5:lineBreak1||lineBreak2?4:nonAlphaNumeric1&&!whitespace1&&whitespace2?3:whitespace1||whitespace2?2:nonAlphaNumeric1||nonAlphaNumeric2?1:0}const NO_DIFF_MESSAGE=`Compared values have no visual difference.`;function formatTrailingSpaces(line,trailingSpaceFormatter){return line.replace(/\s+$/,match=>trailingSpaceFormatter(match))}function printDiffLine(line,isFirstOrLast,color,indicator,trailingSpaceFormatter,emptyFirstOrLastLinePlaceholder){return line.length===0?indicator===` `?isFirstOrLast&&emptyFirstOrLastLinePlaceholder.length!==0?color(`${indicator} ${emptyFirstOrLastLinePlaceholder}`):``:color(indicator):color(`${indicator} ${formatTrailingSpaces(line,trailingSpaceFormatter)}`)}function printDeleteLine(line,isFirstOrLast,{aColor,aIndicator,changeLineTrailingSpaceColor,emptyFirstOrLastLinePlaceholder}){return printDiffLine(line,isFirstOrLast,aColor,aIndicator,changeLineTrailingSpaceColor,emptyFirstOrLastLinePlaceholder)}function printInsertLine(line,isFirstOrLast,{bColor,bIndicator,changeLineTrailingSpaceColor,emptyFirstOrLastLinePlaceholder}){return printDiffLine(line,isFirstOrLast,bColor,bIndicator,changeLineTrailingSpaceColor,emptyFirstOrLastLinePlaceholder)}function printCommonLine(line,isFirstOrLast,{commonColor,commonIndicator,commonLineTrailingSpaceColor,emptyFirstOrLastLinePlaceholder}){return printDiffLine(line,isFirstOrLast,commonColor,commonIndicator,commonLineTrailingSpaceColor,emptyFirstOrLastLinePlaceholder)}function createPatchMark(aStart,aEnd,bStart,bEnd,{patchColor}){return patchColor(`@@ -${aStart+1},${aEnd-aStart} +${bStart+1},${bEnd-bStart} @@`)}function joinAlignedDiffsNoExpand(diffs,options){let iLength=diffs.length,nContextLines=options.contextLines,nContextLines2=nContextLines+nContextLines,jLength=iLength,hasExcessAtStartOrEnd=!1,nExcessesBetweenChanges=0,i=0;for(;i!==iLength;){let iStart=i;for(;i!==iLength&&diffs[i][0]===0;)i+=1;if(iStart!==i){if(iStart===0)i>nContextLines&&(jLength-=i-nContextLines,hasExcessAtStartOrEnd=!0);else if(i===iLength){let n=i-iStart;n>nContextLines&&(jLength-=n-nContextLines,hasExcessAtStartOrEnd=!0)}else{let n=i-iStart;n>nContextLines2&&(jLength-=n-nContextLines2,nExcessesBetweenChanges+=1)}}for(;i!==iLength&&diffs[i][0]!==0;)i+=1}let hasPatch=nExcessesBetweenChanges!==0||hasExcessAtStartOrEnd;nExcessesBetweenChanges===0?hasExcessAtStartOrEnd&&(jLength+=1):jLength+=nExcessesBetweenChanges+1;let jLast=jLength-1,lines=[],jPatchMark=0;hasPatch&&lines.push(``);let aStart=0,bStart=0,aEnd=0,bEnd=0,pushCommonLine=line=>{let j=lines.length;lines.push(printCommonLine(line,j===0||j===jLast,options)),aEnd+=1,bEnd+=1},pushDeleteLine=line=>{let j=lines.length;lines.push(printDeleteLine(line,j===0||j===jLast,options)),aEnd+=1},pushInsertLine=line=>{let j=lines.length;lines.push(printInsertLine(line,j===0||j===jLast,options)),bEnd+=1};for(i=0;i!==iLength;){let iStart=i;for(;i!==iLength&&diffs[i][0]===0;)i+=1;if(iStart!==i){if(iStart===0){i>nContextLines&&(iStart=i-nContextLines,aStart=iStart,bStart=iStart,aEnd=aStart,bEnd=bStart);for(let iCommon=iStart;iCommon!==i;iCommon+=1)pushCommonLine(diffs[iCommon][1])}else if(i===iLength){let iEnd=i-iStart>nContextLines?iStart+nContextLines:i;for(let iCommon=iStart;iCommon!==iEnd;iCommon+=1)pushCommonLine(diffs[iCommon][1])}else{let nCommon=i-iStart;if(nCommon>nContextLines2){let iEnd=iStart+nContextLines;for(let iCommon=iStart;iCommon!==iEnd;iCommon+=1)pushCommonLine(diffs[iCommon][1]);lines[jPatchMark]=createPatchMark(aStart,aEnd,bStart,bEnd,options),jPatchMark=lines.length,lines.push(``);let nOmit=nCommon-nContextLines2;aStart=aEnd+nOmit,bStart=bEnd+nOmit,aEnd=aStart,bEnd=bStart;for(let iCommon=i-nContextLines;iCommon!==i;iCommon+=1)pushCommonLine(diffs[iCommon][1])}else for(let iCommon=iStart;iCommon!==i;iCommon+=1)pushCommonLine(diffs[iCommon][1])}}for(;i!==iLength&&diffs[i][0]===-1;)pushDeleteLine(diffs[i][1]),i+=1;for(;i!==iLength&&diffs[i][0]===1;)pushInsertLine(diffs[i][1]),i+=1}return hasPatch&&(lines[jPatchMark]=createPatchMark(aStart,aEnd,bStart,bEnd,options)),lines.join(`
30
+ `)}function joinAlignedDiffsExpand(diffs,options){return diffs.map((diff,i,diffs)=>{let line=diff[1],isFirstOrLast=i===0||i===diffs.length-1;switch(diff[0]){case-1:return printDeleteLine(line,isFirstOrLast,options);case 1:return printInsertLine(line,isFirstOrLast,options);default:return printCommonLine(line,isFirstOrLast,options)}}).join(`
31
+ `)}const noColor=string=>string;function getDefaultOptions(){return{aAnnotation:`Expected`,aColor:y$1.green,aIndicator:`-`,bAnnotation:`Received`,bColor:y$1.red,bIndicator:`+`,changeColor:y$1.inverse,changeLineTrailingSpaceColor:noColor,commonColor:y$1.dim,commonIndicator:` `,commonLineTrailingSpaceColor:noColor,compareKeys:void 0,contextLines:5,emptyFirstOrLastLinePlaceholder:``,expand:!1,includeChangeCounts:!1,omitAnnotationLines:!1,patchColor:y$1.yellow,printBasicPrototype:!1,truncateThreshold:0,truncateAnnotation:`... Diff result is truncated`,truncateAnnotationColor:noColor}}function getCompareKeys(compareKeys){return compareKeys&&typeof compareKeys==`function`?compareKeys:void 0}function getContextLines(contextLines){return typeof contextLines==`number`&&Number.isSafeInteger(contextLines)&&contextLines>=0?contextLines:5}function normalizeDiffOptions(options={}){return{...getDefaultOptions(),...options,compareKeys:getCompareKeys(options.compareKeys),contextLines:getContextLines(options.contextLines)}}function isEmptyString(lines){return lines.length===1&&lines[0].length===0}function countChanges(diffs){let a=0,b=0;return diffs.forEach(diff=>{switch(diff[0]){case-1:a+=1;break;case 1:b+=1}}),{a,b}}function printAnnotation({aAnnotation,aColor,aIndicator,bAnnotation,bColor,bIndicator,includeChangeCounts,omitAnnotationLines},changeCounts){if(omitAnnotationLines)return``;let aRest=``,bRest=``;if(includeChangeCounts){let aCount=String(changeCounts.a),bCount=String(changeCounts.b),baAnnotationLengthDiff=bAnnotation.length-aAnnotation.length,aAnnotationPadding=` `.repeat(Math.max(0,baAnnotationLengthDiff)),bAnnotationPadding=` `.repeat(Math.max(0,-baAnnotationLengthDiff)),baCountLengthDiff=bCount.length-aCount.length,aCountPadding=` `.repeat(Math.max(0,baCountLengthDiff)),bCountPadding=` `.repeat(Math.max(0,-baCountLengthDiff));aRest=`${aAnnotationPadding} ${aIndicator} ${aCountPadding}${aCount}`,bRest=`${bAnnotationPadding} ${bIndicator} ${bCountPadding}${bCount}`}let a=`${aIndicator} ${aAnnotation}${aRest}`,b=`${bIndicator} ${bAnnotation}${bRest}`;return`${aColor(a)}\n${bColor(b)}\n\n`}function printDiffLines(diffs,truncated,options){return printAnnotation(options,countChanges(diffs))+(options.expand?joinAlignedDiffsExpand(diffs,options):joinAlignedDiffsNoExpand(diffs,options))+(truncated?options.truncateAnnotationColor(`\n${options.truncateAnnotation}`):``)}function diffLinesUnified(aLines,bLines,options){let normalizedOptions=normalizeDiffOptions(options),[diffs,truncated]=diffLinesRaw(isEmptyString(aLines)?[]:aLines,isEmptyString(bLines)?[]:bLines,normalizedOptions);return printDiffLines(diffs,truncated,normalizedOptions)}function diffLinesUnified2(aLinesDisplay,bLinesDisplay,aLinesCompare,bLinesCompare,options){if(isEmptyString(aLinesDisplay)&&isEmptyString(aLinesCompare)&&(aLinesDisplay=[],aLinesCompare=[]),isEmptyString(bLinesDisplay)&&isEmptyString(bLinesCompare)&&(bLinesDisplay=[],bLinesCompare=[]),aLinesDisplay.length!==aLinesCompare.length||bLinesDisplay.length!==bLinesCompare.length)return diffLinesUnified(aLinesDisplay,bLinesDisplay,options);let[diffs,truncated]=diffLinesRaw(aLinesCompare,bLinesCompare,options),aIndex=0,bIndex=0;return diffs.forEach(diff=>{switch(diff[0]){case-1:diff[1]=aLinesDisplay[aIndex],aIndex+=1;break;case 1:diff[1]=bLinesDisplay[bIndex],bIndex+=1;break;default:diff[1]=bLinesDisplay[bIndex],aIndex+=1,bIndex+=1}}),printDiffLines(diffs,truncated,normalizeDiffOptions(options))}function diffLinesRaw(aLines,bLines,options){let truncate=options?.truncateThreshold??!1,truncateThreshold=Math.max(Math.floor(options?.truncateThreshold??0),0),aLength=truncate?Math.min(aLines.length,truncateThreshold):aLines.length,bLength=truncate?Math.min(bLines.length,truncateThreshold):bLines.length,truncated=aLength!==aLines.length||bLength!==bLines.length,isCommon=(aIndex,bIndex)=>aLines[aIndex]===bLines[bIndex],diffs=[],aIndex=0,bIndex=0;for(diffSequences(aLength,bLength,isCommon,(nCommon,aCommon,bCommon)=>{for(;aIndex!==aCommon;aIndex+=1)diffs.push(new Diff(-1,aLines[aIndex]));for(;bIndex!==bCommon;bIndex+=1)diffs.push(new Diff(1,bLines[bIndex]));for(;nCommon!==0;--nCommon,aIndex+=1,bIndex+=1)diffs.push(new Diff(0,bLines[bIndex]))});aIndex!==aLength;aIndex+=1)diffs.push(new Diff(-1,aLines[aIndex]));for(;bIndex!==bLength;bIndex+=1)diffs.push(new Diff(1,bLines[bIndex]));return[diffs,truncated]}function getType(value){if(value===void 0)return`undefined`;if(value===null)return`null`;if(Array.isArray(value))return`array`;if(typeof value==`boolean`)return`boolean`;if(typeof value==`function`)return`function`;if(typeof value==`number`)return`number`;if(typeof value==`string`)return`string`;if(typeof value==`bigint`)return`bigint`;if(typeof value==`object`){if(value!=null){if(value.constructor===RegExp)return`regexp`;if(value.constructor===Map)return`map`;if(value.constructor===Set)return`set`;if(value.constructor===Date)return`date`}return`object`}if(typeof value==`symbol`)return`symbol`;throw Error(`value of unknown type: ${value}`)}function getNewLineSymbol(string){return string.includes(`\r
32
+ `)?`\r
33
+ `:`
34
+ `}function diffStrings(a,b,options){let truncate=options?.truncateThreshold??!1,truncateThreshold=Math.max(Math.floor(options?.truncateThreshold??0),0),aLength=a.length,bLength=b.length;if(truncate){let aMultipleLines=a.includes(`
35
+ `),bMultipleLines=b.includes(`
36
+ `),aNewLineSymbol=getNewLineSymbol(a),bNewLineSymbol=getNewLineSymbol(b),_a=aMultipleLines?`${a.split(aNewLineSymbol,truncateThreshold).join(aNewLineSymbol)}\n`:a,_b=bMultipleLines?`${b.split(bNewLineSymbol,truncateThreshold).join(bNewLineSymbol)}\n`:b;aLength=_a.length,bLength=_b.length}let truncated=aLength!==a.length||bLength!==b.length,isCommon=(aIndex,bIndex)=>a[aIndex]===b[bIndex],aIndex=0,bIndex=0,diffs=[];return diffSequences(aLength,bLength,isCommon,(nCommon,aCommon,bCommon)=>{aIndex!==aCommon&&diffs.push(new Diff(-1,a.slice(aIndex,aCommon))),bIndex!==bCommon&&diffs.push(new Diff(1,b.slice(bIndex,bCommon))),aIndex=aCommon+nCommon,bIndex=bCommon+nCommon,diffs.push(new Diff(0,b.slice(bCommon,bIndex)))}),aIndex!==aLength&&diffs.push(new Diff(-1,a.slice(aIndex))),bIndex!==bLength&&diffs.push(new Diff(1,b.slice(bIndex))),[diffs,truncated]}function concatenateRelevantDiffs(op,diffs,changeColor){return diffs.reduce((reduced,diff)=>reduced+(diff[0]===0?diff[1]:diff[0]===op&&diff[1].length!==0?changeColor(diff[1]):``),``)}var ChangeBuffer=class{op;line;lines;changeColor;constructor(op,changeColor){this.op=op,this.line=[],this.lines=[],this.changeColor=changeColor}pushSubstring(substring){this.pushDiff(new Diff(this.op,substring))}pushLine(){this.lines.push(this.line.length===1?this.line[0][0]===this.op?this.line[0]:new Diff(this.op,this.line[0][1]):new Diff(this.op,concatenateRelevantDiffs(this.op,this.line,this.changeColor))),this.line.length=0}isLineEmpty(){return this.line.length===0}pushDiff(diff){this.line.push(diff)}align(diff){let string=diff[1];if(string.includes(`
37
+ `)){let substrings=string.split(`
38
+ `),iLast=substrings.length-1;substrings.forEach((substring,i)=>{i<iLast?(this.pushSubstring(substring),this.pushLine()):substring.length!==0&&this.pushSubstring(substring)})}else this.pushDiff(diff)}moveLinesTo(lines){this.isLineEmpty()||this.pushLine(),lines.push(...this.lines),this.lines.length=0}},CommonBuffer=class{deleteBuffer;insertBuffer;lines;constructor(deleteBuffer,insertBuffer){this.deleteBuffer=deleteBuffer,this.insertBuffer=insertBuffer,this.lines=[]}pushDiffCommonLine(diff){this.lines.push(diff)}pushDiffChangeLines(diff){let isDiffEmpty=diff[1].length===0;(!isDiffEmpty||this.deleteBuffer.isLineEmpty())&&this.deleteBuffer.pushDiff(diff),(!isDiffEmpty||this.insertBuffer.isLineEmpty())&&this.insertBuffer.pushDiff(diff)}flushChangeLines(){this.deleteBuffer.moveLinesTo(this.lines),this.insertBuffer.moveLinesTo(this.lines)}align(diff){let op=diff[0],string=diff[1];if(string.includes(`
39
+ `)){let substrings=string.split(`
40
+ `),iLast=substrings.length-1;substrings.forEach((substring,i)=>{if(i===0){let subdiff=new Diff(op,substring);this.deleteBuffer.isLineEmpty()&&this.insertBuffer.isLineEmpty()?(this.flushChangeLines(),this.pushDiffCommonLine(subdiff)):(this.pushDiffChangeLines(subdiff),this.flushChangeLines())}else i<iLast?this.pushDiffCommonLine(new Diff(op,substring)):substring.length!==0&&this.pushDiffChangeLines(new Diff(op,substring))})}else this.pushDiffChangeLines(diff)}getLines(){return this.flushChangeLines(),this.lines}};function getAlignedDiffs(diffs,changeColor){let deleteBuffer=new ChangeBuffer(-1,changeColor),insertBuffer=new ChangeBuffer(1,changeColor),commonBuffer=new CommonBuffer(deleteBuffer,insertBuffer);return diffs.forEach(diff=>{switch(diff[0]){case-1:deleteBuffer.align(diff);break;case 1:insertBuffer.align(diff);break;default:commonBuffer.align(diff)}}),commonBuffer.getLines()}function hasCommonDiff(diffs,isMultiline){if(isMultiline){let iLast=diffs.length-1;return diffs.some((diff,i)=>diff[0]===0&&(i!==iLast||diff[1]!==`
41
+ `))}return diffs.some(diff=>diff[0]===0)}function diffStringsUnified(a,b,options){if(a!==b&&a.length!==0&&b.length!==0){let isMultiline=a.includes(`
42
+ `)||b.includes(`
43
+ `),[diffs,truncated]=diffStringsRaw(isMultiline?`${a}\n`:a,isMultiline?`${b}\n`:b,!0,options);if(hasCommonDiff(diffs,isMultiline)){let optionsNormalized=normalizeDiffOptions(options);return printDiffLines(getAlignedDiffs(diffs,optionsNormalized.changeColor),truncated,optionsNormalized)}}return diffLinesUnified(a.split(`
44
+ `),b.split(`
45
+ `),options)}function diffStringsRaw(a,b,cleanup,options){let[diffs,truncated]=diffStrings(a,b,options);return diff_cleanupSemantic(diffs),[diffs,truncated]}function getCommonMessage(message,options){let{commonColor}=normalizeDiffOptions(options);return commonColor(message)}const{AsymmetricMatcher:AsymmetricMatcher$2,DOMCollection:DOMCollection$1,DOMElement:DOMElement$1,Immutable:Immutable$1,ReactElement:ReactElement$1,ReactTestComponent:ReactTestComponent$1}=plugins,PLUGINS$1=[ReactTestComponent$1,ReactElement$1,DOMElement$1,DOMCollection$1,Immutable$1,AsymmetricMatcher$2,plugins.Error],FORMAT_OPTIONS={maxDepth:20,plugins:PLUGINS$1},FALLBACK_FORMAT_OPTIONS={callToJSON:!1,maxDepth:8,plugins:PLUGINS$1},DEFAULT_MEMORIZE=(_,v)=>v;function diff(a,b,options,memorize=DEFAULT_MEMORIZE){if(Object.is(a,b))return``;let aType=getType(a),expectedType=aType,omitDifference=!1;if(aType===`object`&&typeof a.asymmetricMatch==`function`){if(a.$$typeof!==Symbol.for(`jest.asymmetricMatcher`)||typeof a.getExpectedType!=`function`)return;expectedType=a.getExpectedType(),omitDifference=expectedType===`string`}if(expectedType!==getType(b)){let{aAnnotation,aColor,aIndicator,bAnnotation,bColor,bIndicator}=normalizeDiffOptions(options),formatOptions=getFormatOptions(FALLBACK_FORMAT_OPTIONS,options),aDisplay=format$1(a,formatOptions),bDisplay=format$1(b,formatOptions),MAX_LENGTH=1e5;function truncate(s){return s.length<=MAX_LENGTH?s:`${s.slice(0,MAX_LENGTH)}...`}return aDisplay=memorize(`expected`,truncate(aDisplay)),bDisplay=memorize(`actual`,truncate(bDisplay)),`${`${aColor(`${aIndicator} ${aAnnotation}:`)}\n${aDisplay}`}\n\n${`${bColor(`${bIndicator} ${bAnnotation}:`)}\n${bDisplay}`}`}if(!omitDifference)switch(aType){case`string`:return diffLinesUnified(a.split(`
46
+ `),b.split(`
47
+ `),options);case`boolean`:case`number`:return comparePrimitive(a,b,options,memorize);case`map`:return compareObjects(sortMap(a),sortMap(b),options,memorize);case`set`:return compareObjects(sortSet(a),sortSet(b),options,memorize);default:return compareObjects(a,b,options,memorize)}}function createMemorize(memory){return(pointer,stringifiedValue)=>(memory[pointer]=stringifiedValue,stringifiedValue)}function comparePrimitive(a,b,options,memorize=DEFAULT_MEMORIZE){let aFormat=memorize(`expected`,format$1(a,FORMAT_OPTIONS)),bFormat=memorize(`actual`,format$1(b,FORMAT_OPTIONS));return aFormat===bFormat?``:diffLinesUnified(aFormat.split(`
48
+ `),bFormat.split(`
49
+ `),options)}function sortMap(map){return new Map(Array.from(map.entries()).sort())}function sortSet(set){return new Set(Array.from(set.values()).sort())}function compareObjects(a,b,options,memorize=DEFAULT_MEMORIZE){let difference,hasThrown=!1;try{difference=getObjectsDifference(a,b,getFormatOptions(FORMAT_OPTIONS,options),options,memorize)}catch{hasThrown=!0}let noDiffMessage=getCommonMessage(NO_DIFF_MESSAGE,options);return(difference===void 0||difference===noDiffMessage)&&(difference=getObjectsDifference(a,b,getFormatOptions(FALLBACK_FORMAT_OPTIONS,options),options,memorize),difference!==noDiffMessage&&!hasThrown&&(difference=`${getCommonMessage("Compared values serialize to the same structure.\nPrinting internal object structure without calling `toJSON` instead.",options)}\n\n${difference}`)),difference}function getDefaultFormatOptions(options){return getFormatOptions(FORMAT_OPTIONS,options)}function getFormatOptions(formatOptions,options){let{compareKeys,printBasicPrototype,maxDepth}=normalizeDiffOptions(options);return{...formatOptions,compareKeys,printBasicPrototype,maxDepth:maxDepth??formatOptions.maxDepth}}function getObjectsDifference(a,b,formatOptions,options,memorize=DEFAULT_MEMORIZE){let formatOptionsZeroIndent={...formatOptions,indent:0},aCompare=format$1(a,formatOptionsZeroIndent),bCompare=format$1(b,formatOptionsZeroIndent);if(aCompare===bCompare)return getCommonMessage(NO_DIFF_MESSAGE,options);{let aDisplay=memorize(`expected`,format$1(a,formatOptions)),bDisplay=memorize(`actual`,format$1(b,formatOptions));return diffLinesUnified2(aDisplay.split(`
50
+ `),bDisplay.split(`
51
+ `),aCompare.split(`
52
+ `),bCompare.split(`
53
+ `),options)}}const MAX_DIFF_STRING_LENGTH=2e4;function isAsymmetricMatcher(data){return getType$1(data)===`Object`&&typeof data.asymmetricMatch==`function`}function isReplaceable(obj1,obj2){let obj1Type=getType$1(obj1);return obj1Type===getType$1(obj2)&&(obj1Type===`Object`||obj1Type===`Array`)}function printDiffOrStringify(received,expected,options,memory){let{aAnnotation,bAnnotation}=normalizeDiffOptions(options);if(typeof expected==`string`&&typeof received==`string`&&expected.length>0&&received.length>0&&expected.length<=MAX_DIFF_STRING_LENGTH&&received.length<=MAX_DIFF_STRING_LENGTH&&expected!==received){if(expected.includes(`
54
+ `)||received.includes(`
55
+ `))return diffStringsUnified(expected,received,options);let[diffs]=diffStringsRaw(expected,received),hasCommonDiff=diffs.some(diff=>diff[0]===0),printLabel=getLabelPrinter(aAnnotation,bAnnotation);return`${printLabel(aAnnotation)+printExpected$1(getCommonAndChangedSubstrings(diffs,-1,hasCommonDiff))}\n${printLabel(bAnnotation)+printReceived$1(getCommonAndChangedSubstrings(diffs,1,hasCommonDiff))}`}let clonedExpected=deepClone(expected,{forceWritable:!0}),{replacedExpected,replacedActual}=replaceAsymmetricMatcher(deepClone(received,{forceWritable:!0}),clonedExpected);return diff(replacedExpected,replacedActual,options,memory?createMemorize(memory):DEFAULT_MEMORIZE)}function replaceAsymmetricMatcher(actual,expected,actualReplaced=new WeakSet,expectedReplaced=new WeakSet){return actual instanceof Error&&expected instanceof Error&&actual.cause!==void 0&&expected.cause===void 0?(delete actual.cause,{replacedActual:actual,replacedExpected:expected}):!isReplaceable(actual,expected)||actualReplaced.has(actual)||expectedReplaced.has(expected)?{replacedActual:actual,replacedExpected:expected}:(actualReplaced.add(actual),expectedReplaced.add(expected),getOwnProperties(expected).forEach(key=>{let expectedValue=expected[key],actualValue=actual[key];if(isAsymmetricMatcher(expectedValue)){if(expectedValue.asymmetricMatch(actualValue))expected[key]=actualValue;else if(`sample`in expectedValue&&expectedValue.sample!==void 0&&isReplaceable(actualValue,expectedValue.sample)){let replaced=replaceAsymmetricMatcher(actualValue,expectedValue.sample,actualReplaced,expectedReplaced);actual[key]=replaced.replacedActual,expected[key]=replaced.replacedExpected}}else if(isAsymmetricMatcher(actualValue)){if(actualValue.asymmetricMatch(expectedValue))actual[key]=expectedValue;else if(`sample`in actualValue&&actualValue.sample!==void 0&&isReplaceable(actualValue.sample,expectedValue)){let replaced=replaceAsymmetricMatcher(actualValue.sample,expectedValue,actualReplaced,expectedReplaced);actual[key]=replaced.replacedActual,expected[key]=replaced.replacedExpected}}else if(isReplaceable(actualValue,expectedValue)){let replaced=replaceAsymmetricMatcher(actualValue,expectedValue,actualReplaced,expectedReplaced);actual[key]=replaced.replacedActual,expected[key]=replaced.replacedExpected}}),{replacedActual:actual,replacedExpected:expected})}function getLabelPrinter(...strings){let maxLength=strings.reduce((max,string)=>string.length>max?string.length:max,0);return string=>`${string}: ${` `.repeat(maxLength-string.length)}`}function replaceTrailingSpaces$1(text){return text.replace(/\s+$/gm,spaces=>`·`.repeat(spaces.length))}function printReceived$1(object){return y$1.red(replaceTrailingSpaces$1(stringify(object)))}function printExpected$1(value){return y$1.green(replaceTrailingSpaces$1(stringify(value)))}function getCommonAndChangedSubstrings(diffs,op,hasCommonDiff){return diffs.reduce((reduced,diff)=>reduced+(diff[0]===0?diff[1]:diff[0]===op?hasCommonDiff?y$1.inverse(diff[1]):diff[1]:``),``)}function processError(_err,diffOptions,seen=new WeakSet){if(!_err||typeof _err!=`object`)return{message:String(_err)};let err=_err;if(err.showDiff||err.showDiff===void 0&&err.expected!==void 0&&err.actual!==void 0){let options={...diffOptions,...err.diffOptions};err.diff=printDiffOrStringify(err.actual,err.expected,options,err),err.expected=prettifyValue(err.expected,options),err.actual=prettifyValue(err.actual,options)}try{!seen.has(err)&&typeof err.cause==`object`&&(seen.add(err),err.cause=processError(err.cause,diffOptions,seen))}catch{}try{return serializeValue(err)}catch(e){return serializeValue(Error(`Failed to fully serialize error: ${e?.message}\nInner error message: ${err?.message}`))}}function prettifyValue(value,options){return typeof value==`string`?value:format$1(value,getDefaultFormatOptions(options))}var PendingError=class extends Error{message;note;code=`VITEST_PENDING`;taskId;constructor(message,task,note){super(message),this.message=message,this.note=note,this.taskId=task.id}},FixtureDependencyError=class extends Error{name=`FixtureDependencyError`},FixtureAccessError=class extends Error{name=`FixtureAccessError`},FixtureParseError=class extends Error{name=`FixtureParseError`},TestSyntaxError=class extends Error{name=`TestSyntaxError`;constructor(message){super(message),Object.defineProperty(this,"__vitest_test_syntax_error__",{value:!0,enumerable:!1})}};const fnMap=new WeakMap,testFixtureMap=new WeakMap,hooksMap=new WeakMap;function setFn(key,fn){fnMap.set(key,fn)}function setTestFixture(key,fixture){testFixtureMap.set(key,fixture)}function getTestFixtures(key){return testFixtureMap.get(key)}function setHooks(key,hooks){hooksMap.set(key,hooks)}function getHooks(key){return hooksMap.get(key)}const FIXTURE_STACK_TRACE_KEY=Symbol.for(`VITEST_FIXTURE_STACK_TRACE`);var TestFixtures=class TestFixtures{_suiteContexts;_overrides=new WeakMap;_registrations;static _definitions=[];static _builtinFixtures=[`task`,`signal`,`onTestFailed`,`onTestFinished`,`skip`,`annotate`,`bench`];static _fixtureOptionKeys=[`auto`,`injected`,`scope`];static _fixtureScopes=[`test`,`file`,`worker`];static _workerContextSuite={type:`worker`};static clearDefinitions(){TestFixtures._definitions.length=0}static getWorkerContexts(){return TestFixtures._definitions.map(f=>f.getWorkerContext())}static getFileContexts(file){return TestFixtures._definitions.map(f=>f.getFileContext(file))}static isFixtureOptions(obj){return isObject(obj)&&Object.keys(obj).some(key=>TestFixtures._fixtureOptionKeys.includes(key))}constructor(registrations){this._registrations=registrations??new Map,this._suiteContexts=new WeakMap,TestFixtures._definitions.push(this)}extend(runner,userFixtures){let{suite}=getCurrentSuite(),isTopLevel=!suite||suite.file===suite,registrations=this.parseUserFixtures(runner,userFixtures,isTopLevel);return new TestFixtures(registrations)}get(suite){let currentSuite=suite;for(;currentSuite;){let overrides=this._overrides.get(currentSuite);if(overrides)return overrides;if(currentSuite===currentSuite.file)break;currentSuite=currentSuite.suite||currentSuite.file}return this._registrations}override(runner,userFixtures){let{suite:currentSuite,file}=getCurrentSuite(),suite=currentSuite||file,isTopLevel=!currentSuite||currentSuite.file===currentSuite,suiteRegistrations=new Map(this.get(suite)),registrations=this.parseUserFixtures(runner,userFixtures,isTopLevel,suiteRegistrations);isTopLevel?this._registrations=registrations:this._overrides.set(suite,registrations)}getFileContext(file){return this._suiteContexts.has(file)||this._suiteContexts.set(file,Object.create(null)),this._suiteContexts.get(file)}getWorkerContext(){return this._suiteContexts.has(TestFixtures._workerContextSuite)||this._suiteContexts.set(TestFixtures._workerContextSuite,Object.create(null)),this._suiteContexts.get(TestFixtures._workerContextSuite)}parseUserFixtures(runner,userFixtures,supportNonTest,registrations=new Map(this._registrations)){let errors=[];Object.entries(userFixtures).forEach(([name,fn])=>{let options,value,_options;Array.isArray(fn)&&fn.length>=2&&TestFixtures.isFixtureOptions(fn[1])?(_options=fn[1],options={auto:_options.auto??!1,scope:_options.scope??`test`,injected:_options.injected??!1},value=options.injected?runner.injectValue?.(name)??fn[0]:fn[0]):value=fn;let parent=registrations.get(name);parent&&options?(parent.scope!==options.scope&&errors.push(new FixtureDependencyError(`The "${name}" fixture was already registered with a "${options.scope}" scope.`)),parent.auto!==options.auto&&errors.push(new FixtureDependencyError(`The "${name}" fixture was already registered as { auto: ${options.auto} }.`))):parent?options={auto:parent.auto,scope:parent.scope,injected:parent.injected}:options||={auto:!1,injected:!1,scope:`test`},options.scope&&!TestFixtures._fixtureScopes.includes(options.scope)&&errors.push(new FixtureDependencyError(`The "${name}" fixture has unknown scope "${options.scope}".`)),!supportNonTest&&options.scope!==`test`&&errors.push(new FixtureDependencyError(`The "${name}" fixture cannot be defined with a ${options.scope} scope${!_options?.scope&&parent?.scope?` (inherited from the base fixture)`:``} inside the describe block. Define it at the top level of the file instead.`));let deps=isFixtureFunction(value)?getUsedProps(value):new Set,item={name,value,auto:options.auto??!1,injected:options.injected??!1,scope:options.scope??`test`,deps,parent};isFixtureFunction(value)&&Object.assign(value,{[FIXTURE_STACK_TRACE_KEY]:Error(`STACK_TRACE_ERROR`)}),registrations.set(name,item),item.scope===`worker`&&(runner.pool===`vmThreads`||runner.pool===`vmForks`)&&(item.scope=`file`)});for(let fixture of registrations.values())for(let depName of fixture.deps){if(TestFixtures._builtinFixtures.includes(depName))continue;let dep=registrations.get(depName);if(!dep){errors.push(new FixtureDependencyError(`The "${fixture.name}" fixture depends on unknown fixture "${depName}".`));continue}if(depName===fixture.name&&!fixture.parent){errors.push(new FixtureDependencyError(`The "${fixture.name}" fixture depends on itself, but does not have a base implementation.`));continue}if(TestFixtures._fixtureScopes.indexOf(fixture.scope)>TestFixtures._fixtureScopes.indexOf(dep.scope)){errors.push(new FixtureDependencyError(`The ${fixture.scope} "${fixture.name}" fixture cannot depend on a ${dep.scope} fixture "${dep.name}".`));continue}}if(errors.length===1)throw errors[0];if(errors.length>1)throw AggregateError(errors,`Cannot resolve user fixtures. See errors for more information.`);return registrations}};const cleanupFnArrayMap=new WeakMap,contextHasFixturesCache=new WeakMap;function withFixtures(fn,options){let collector=getCurrentSuite(),suite=options?.suite||collector.suite||collector.file;return async hookContext=>{let context=hookContext||options?.context;if(!context)return options?.suiteHook&&validateSuiteHook(fn,options.suiteHook,options.stackTraceError),fn({});let fixtures=options?.fixtures||getTestFixtures(context);if(!fixtures)return fn(context);let registrations=fixtures.get(suite);if(!registrations.size)return fn(context);let usedFixtures=[],usedProps=getUsedProps(fn);for(let fixture of registrations.values())(isAutoFixture(fixture,options)||usedProps.has(fixture.name))&&usedFixtures.push(fixture);if(!usedFixtures.length)return fn(context);cleanupFnArrayMap.has(context)||cleanupFnArrayMap.set(context,[]);let cleanupFnArray=cleanupFnArrayMap.get(context),pendingFixtures=resolveDeps(usedFixtures,registrations);if(!pendingFixtures.length)return fn(context);if(options?.suiteHook){let testScopedFixtures=pendingFixtures.filter(f=>f.scope===`test`);if(testScopedFixtures.length>0){let fixtureNames=testScopedFixtures.map(f=>`"${f.name}"`).join(`, `),error=new FixtureDependencyError(`Test-scoped fixtures cannot be used inside ${options.suiteHook} hook. The following fixtures are test-scoped: ${fixtureNames}. Use { scope: 'file' } or { scope: 'worker' } fixtures instead, or move the logic to ${{aroundAll:`aroundEach`,beforeAll:`beforeEach`,afterAll:`afterEach`}[options.suiteHook]} hook.`);throw options.stackTraceError?.stack&&(error.stack=error.message+options.stackTraceError.stack.replace(options.stackTraceError.message,``)),error}}contextHasFixturesCache.has(context)||contextHasFixturesCache.set(context,new WeakSet);let cachedFixtures=contextHasFixturesCache.get(context);for(let fixture of pendingFixtures)if(fixture.scope===`test`){if(cachedFixtures.has(fixture))continue;cachedFixtures.add(fixture);let resolvedValue=await resolveTestFixtureValue(fixture,context,cleanupFnArray);context[fixture.name]=resolvedValue,cleanupFnArray.push(()=>{cachedFixtures.delete(fixture)})}else{let resolvedValue=await resolveScopeFixtureValue(fixtures,suite,fixture);context[fixture.name]=resolvedValue}return fn(context)}}function isAutoFixture(fixture,options){return!(!fixture.auto||options?.suiteHook&&fixture.scope===`test`)}function isFixtureFunction(value){return typeof value==`function`}function resolveTestFixtureValue(fixture,context,cleanupFnArray){return isFixtureFunction(fixture.value)?resolveFixtureFunction(fixture.value,fixture.name,context,cleanupFnArray):fixture.value}const scopedFixturePromiseCache=new WeakMap;async function resolveScopeFixtureValue(fixtures,suite,fixture){let workerContext=fixtures.getWorkerContext(),fileContext=fixtures.getFileContext(suite.file),fixtureContext=fixture.scope===`worker`?workerContext:fileContext;if(!isFixtureFunction(fixture.value))return fixtureContext[fixture.name]=fixture.value,fixture.value;if(fixture.name in fixtureContext)return fixtureContext[fixture.name];if(scopedFixturePromiseCache.has(fixture))return scopedFixturePromiseCache.get(fixture);cleanupFnArrayMap.has(fixtureContext)||cleanupFnArrayMap.set(fixtureContext,[]);let cleanupFnFileArray=cleanupFnArrayMap.get(fixtureContext),promise=resolveFixtureFunction(fixture.value,fixture.name,fixture.scope===`file`?{...workerContext,...fileContext}:fixtureContext,cleanupFnFileArray).then(value=>(fixtureContext[fixture.name]=value,scopedFixturePromiseCache.delete(fixture),value));return scopedFixturePromiseCache.set(fixture,promise),promise}async function resolveFixtureFunction(fixtureFn,fixtureName,context,cleanupFnArray){let useFnArgPromise=createDefer(),stackTraceError=FIXTURE_STACK_TRACE_KEY in fixtureFn&&fixtureFn[FIXTURE_STACK_TRACE_KEY]instanceof Error?fixtureFn[FIXTURE_STACK_TRACE_KEY]:void 0,isUseFnArgResolved=!1,fixtureReturn=fixtureFn(context,async useFnArg=>{isUseFnArgResolved=!0,useFnArgPromise.resolve(useFnArg);let useReturnPromise=createDefer();cleanupFnArray.push(async()=>{useReturnPromise.resolve(),await fixtureReturn}),await useReturnPromise}).then(()=>{if(!isUseFnArgResolved){let error=Error(`Fixture "${fixtureName}" returned without calling "use". Make sure to call "use" in every code path of the fixture function.`);stackTraceError?.stack&&(error.stack=error.message+stackTraceError.stack.replace(stackTraceError.message,``)),useFnArgPromise.reject(error)}}).catch(e=>{if(!isUseFnArgResolved){useFnArgPromise.reject(e);return}throw e});return useFnArgPromise}function resolveDeps(usedFixtures,registrations,depSet=new Set,pendingFixtures=[]){return usedFixtures.forEach(fixture=>{if(!pendingFixtures.includes(fixture)){if(!isFixtureFunction(fixture.value)||!fixture.deps){pendingFixtures.push(fixture);return}if(depSet.has(fixture)){if(fixture.parent)fixture=fixture.parent;else throw Error(`Circular fixture dependency detected: ${fixture.name} <- ${[...depSet].reverse().map(d=>d.name).join(` <- `)}`)}depSet.add(fixture),resolveDeps(Array.from(fixture.deps,n=>n===fixture.name?fixture.parent:registrations.get(n)).filter(n=>!!n),registrations,depSet,pendingFixtures),pendingFixtures.push(fixture),depSet.clear()}}),pendingFixtures}function validateSuiteHook(fn,hook,suiteError){let usedProps=getUsedProps(fn,{sourceError:suiteError,suiteHook:hook});if(usedProps.size){let error=new FixtureAccessError(`The ${hook} hook uses fixtures "${[...usedProps].join(`", "`)}", but has no access to context. Did you forget to call it as "test.${hook}()" instead of "${hook}()"?\nIf you used internal "suite" task as the first argument previously, access it in the second argument instead. See https://vitest.dev/guide/test-context#suite-level-hooks`);throw suiteError&&(error.stack=suiteError.stack?.replace(suiteError.message,error.message)),error}}const kPropsSymbol=Symbol(`$vitest:fixture-props`),kPropNamesSymbol=Symbol(`$vitest:fixture-prop-names`);function configureProps(fn,options){Object.defineProperty(fn,kPropsSymbol,{value:options,enumerable:!1})}function memoProps(fn,props){return fn[kPropNamesSymbol]=props,props}function getUsedProps(fn,{sourceError,suiteHook}={}){if(kPropNamesSymbol in fn)return fn[kPropNamesSymbol];let{index:fixturesIndex=0,original:implementation=fn}=kPropsSymbol in fn?fn[kPropsSymbol]:{},fnString=filterOutComments(implementation.toString());/__async\((?:this|null), (?:null|arguments|\[[_0-9, ]*\]), function\*/.test(fnString)&&(fnString=fnString.split(/__async\((?:this|null),/)[1]);let match=fnString.match(/[^(]*\(([^)]*)/);if(!match)return memoProps(fn,new Set);let args=splitByComma(match[1]);if(!args.length)return memoProps(fn,new Set);let fixturesArgument=args[fixturesIndex];if(!fixturesArgument)return memoProps(fn,new Set);if(!(fixturesArgument[0]===`{`&&fixturesArgument.endsWith(`}`))){let ordinalArgument=ordinal(fixturesIndex+1),error=new FixtureParseError(`The ${ordinalArgument} argument inside a fixture must use object destructuring pattern, e.g. ({ task } => {}). Instead, received "${fixturesArgument}".${suiteHook?` If you used internal "suite" task as the ${ordinalArgument} argument previously, access it in the ${ordinal(fixturesIndex+2)} argument instead.`:``}`);throw sourceError&&(error.stack=sourceError.stack?.replace(sourceError.message,error.message)),error}let props=splitByComma(fixturesArgument.slice(1,-1).replace(/\s/g,``)).map(prop=>prop.replace(/:.*|=.*/g,``)),last=props.at(-1);if(last&&last.startsWith(`...`)){let error=new FixtureParseError(`Rest parameters are not supported in fixtures, received "${last}".`);throw sourceError&&(error.stack=sourceError.stack?.replace(sourceError.message,error.message)),error}return memoProps(fn,new Set(props))}function splitByComma(s){let result=[],stack=[],start=0;for(let i=0;i<s.length;i++)if(s[i]===`{`||s[i]===`[`)stack.push(s[i]===`{`?`}`:`]`);else if(s[i]===stack.at(-1))stack.pop();else if(!stack.length&&s[i]===`,`){let token=s.substring(start,i).trim();token&&result.push(token),start=i+1}let lastToken=s.substring(start).trim();return lastToken&&result.push(lastToken),result}const kChainableContext=Symbol(`kChainableContext`);function getChainableContext(chainable){return chainable?.[kChainableContext]}function createChainable(keys,fn,context){function create(context){let chain=function(...args){return fn.apply(context,args)};Object.assign(chain,fn),Object.defineProperty(chain,kChainableContext,{value:{withContext:()=>chain.bind(context),getFixtures:()=>context.fixtures,setContext:(key,value)=>{context[key]=value},mergeContext:ctx=>{Object.assign(context,ctx)}},enumerable:!1});for(let key of keys)Object.defineProperty(chain,key,{get(){return create({...context,[key]:!0})}});return chain}let chain=create(context??{});return Object.defineProperty(chain,"fn",{value:fn,enumerable:!1}),chain}function getDefaultHookTimeout(){return getRunner().config.hookTimeout}const CLEANUP_TIMEOUT_KEY=Symbol.for(`VITEST_CLEANUP_TIMEOUT`),CLEANUP_STACK_TRACE_KEY=Symbol.for(`VITEST_CLEANUP_STACK_TRACE`),AROUND_TIMEOUT_KEY=Symbol.for(`VITEST_AROUND_TIMEOUT`),AROUND_STACK_TRACE_KEY=Symbol.for(`VITEST_AROUND_STACK_TRACE`);function beforeAll(fn,timeout=getDefaultHookTimeout()){assertTypes(fn,`"beforeAll" callback`,[`function`]);let stackTraceError=Error(`STACK_TRACE_ERROR`),context=getChainableContext(this);return getCurrentSuite().on(`beforeAll`,Object.assign(withTimeout(withSuiteFixtures(`beforeAll`,fn,context,stackTraceError),timeout,!0,stackTraceError),{[CLEANUP_TIMEOUT_KEY]:timeout,[CLEANUP_STACK_TRACE_KEY]:stackTraceError}))}function afterAll(fn,timeout){assertTypes(fn,`"afterAll" callback`,[`function`]);let context=getChainableContext(this),stackTraceError=Error(`STACK_TRACE_ERROR`);return getCurrentSuite().on(`afterAll`,withTimeout(withSuiteFixtures(`afterAll`,fn,context,stackTraceError),timeout??getDefaultHookTimeout(),!0,stackTraceError))}function beforeEach(fn,timeout=getDefaultHookTimeout()){assertTypes(fn,`"beforeEach" callback`,[`function`]);let stackTraceError=Error(`STACK_TRACE_ERROR`);return getCurrentSuite().on(`beforeEach`,Object.assign(withTimeout((context,suite)=>withFixtures(fn,{suite})(context),timeout??getDefaultHookTimeout(),!0,stackTraceError,abortIfTimeout),{[CLEANUP_TIMEOUT_KEY]:timeout,[CLEANUP_STACK_TRACE_KEY]:stackTraceError}))}function afterEach(fn,timeout){return assertTypes(fn,`"afterEach" callback`,[`function`]),getCurrentSuite().on(`afterEach`,withTimeout((context,suite)=>withFixtures(fn,{suite})(context),timeout??getDefaultHookTimeout(),!0,Error(`STACK_TRACE_ERROR`),abortIfTimeout))}const onTestFinished=createTestHook(`onTestFinished`,(test,handler,timeout)=>{test.onFinished||=[],test.onFinished.push(withTimeout(handler,timeout??getDefaultHookTimeout(),!0,Error(`STACK_TRACE_ERROR`),abortIfTimeout))});function aroundAll(fn,timeout){assertTypes(fn,`"aroundAll" callback`,[`function`]);let stackTraceError=Error(`STACK_TRACE_ERROR`),resolvedTimeout=timeout??getDefaultHookTimeout(),context=getChainableContext(this);return getCurrentSuite().on(`aroundAll`,Object.assign(withSuiteFixtures(`aroundAll`,fn,context,stackTraceError,1),{[AROUND_TIMEOUT_KEY]:resolvedTimeout,[AROUND_STACK_TRACE_KEY]:stackTraceError}))}function aroundEach(fn,timeout){assertTypes(fn,`"aroundEach" callback`,[`function`]);let stackTraceError=Error(`STACK_TRACE_ERROR`),resolvedTimeout=timeout??getDefaultHookTimeout();return getCurrentSuite().on(`aroundEach`,Object.assign((runTest,context,suite)=>{let innerFn=ctx=>fn(runTest,ctx,suite);return configureProps(innerFn,{index:1,original:fn}),withFixtures(innerFn,{suite})(context)},{[AROUND_TIMEOUT_KEY]:resolvedTimeout,[AROUND_STACK_TRACE_KEY]:stackTraceError}))}function withSuiteFixtures(suiteHook,fn,context,stackTraceError,contextIndex=0){return(...args)=>{let suite=args.at(-1),prefix=args.slice(0,-1),wrapper=ctx=>fn(...prefix,ctx,suite);configureProps(wrapper,{index:contextIndex,original:fn});let fixtures=context?.getFixtures(),fileContext=fixtures?.getFileContext(suite.file);return withFixtures(wrapper,{suiteHook,fixtures,context:fileContext,stackTraceError})()}}function createTestHook(name,handler){return(fn,timeout)=>{throw assertTypes(fn,`"${name}" callback`,[`function`]),Error(`Hook ${name}() can only be called inside a test`)}}function findTestFileStackTrace(testFilePath,error){let stack;try{stack=error.stack}catch{return}if(stack)return parseStacktrace(stack,{ignoreStackEntries:[]}).find(stack=>stack.file===testFilePath)}function validateTags(config,tags){if(!config.strictTags)return;let availableTags=new Set(config.tags.map(tag=>tag.name));for(let tag of tags)if(!availableTags.has(tag))throw createNoTagsError(config.tags,tag)}function createNoTagsError(availableTags,tag,prefix=`tag`){throw availableTags.length?Error(`The ${prefix} "${tag}" is not defined in the configuration. Available tags are:\n${availableTags.map(t=>`- ${t.name}${t.description?`: ${t.description}`:``}`).join(`
56
+ `)}`):Error(`The Vitest config doesn't define any "tags", cannot apply "${tag}" ${prefix} for this test. See: https://vitest.dev/guide/test-tags`)}const suite=createSuite();createTest(function(name,optionsOrFn,optionsOrTest){getCurrentSuite().test.fn.call(this,formatName(name),optionsOrFn,optionsOrTest)});let runner,defaultSuite,currentTestFilepath;function assert$2(condition,message){if(!condition)throw Error(`Vitest failed to find ${message}. One of the following is possible:
57
+ - "vitest" is imported directly without running "vitest" command
58
+ - "vitest" is imported inside "globalSetup" (to fix this, use "setupFiles" instead, because "globalSetup" runs in a different context)
59
+ - "vitest" is imported inside Vite / Vitest config file
60
+ - Otherwise, it might be a Vitest bug. Please report it to https://github.com/vitest-dev/vitest/issues
61
+ `)}function getRunner(){assert$2(runner,`the runner`)}function getCurrentSuite(){let currentSuite=collectorContext.currentSuite||defaultSuite;return assert$2(currentSuite,`the current suite`),currentSuite}function createSuiteHooks(){return{beforeAll:[],afterAll:[],beforeEach:[],afterEach:[],aroundEach:[],aroundAll:[]}}const POSITIVE_INFINITY=1/0;function parseArguments(optionsOrFn,timeoutOrTest){if(typeof timeoutOrTest==`object`&&timeoutOrTest)throw TypeError(`Signature "test(name, fn, { ... })" was deprecated in Vitest 3 and removed in Vitest 4. Please, provide options as a second argument instead.`);let options={},fn;if(typeof timeoutOrTest==`number`?options={timeout:timeoutOrTest}:typeof optionsOrFn==`object`&&(options=optionsOrFn),typeof optionsOrFn==`function`){if(typeof timeoutOrTest==`function`)throw TypeError(`Cannot use two functions as arguments. Please use the second argument for options.`);fn=optionsOrFn}else typeof timeoutOrTest==`function`&&(fn=timeoutOrTest);return{options,handler:fn}}function createSuiteCollector(name,factory=()=>{},mode,each,suiteOptions){let tasks=[],suite;initSuite(!0);let task=function(name=``,options={}){let currentSuite=collectorContext.currentSuite?.suite,testTags=unique([...(currentSuite??collectorContext.currentSuite?.file)?.tags||[],...toArray(options.tags)]),tagsOptions=testTags.map(tag=>{let tagDefinition=runner.config.tags?.find(t=>t.name===tag);if(!tagDefinition&&runner.config.strictTags)throw createNoTagsError(runner.config.tags,tag);return tagDefinition}).filter(r=>r!=null).sort((tag1,tag2)=>(tag2.priority??POSITIVE_INFINITY)-(tag1.priority??POSITIVE_INFINITY)).reduce((acc,tag)=>{let{name,description,priority,meta,...options}=tag;return Object.assign(acc,options),meta&&(acc.meta=Object.assign(acc.meta??Object.create(null),meta)),acc},{}),testOwnMeta=options.meta;options={...collectorContext.currentSuite?.options,...tagsOptions,...options};let timeout=options.timeout??runner.config.testTimeout,parentMeta=currentSuite?.meta,tagMeta=tagsOptions.meta,testMeta=Object.create(null);tagMeta&&Object.assign(testMeta,tagMeta),parentMeta&&Object.assign(testMeta,parentMeta),testOwnMeta&&Object.assign(testMeta,testOwnMeta);let task={id:``,name,fullName:createTaskName([currentSuite?.fullName??collectorContext.currentSuite?.file?.fullName,name]),fullTestName:createTaskName([currentSuite?.fullTestName,name]),suite:currentSuite,each:options.each,fails:options.fails,context:void 0,type:`test`,file:currentSuite?.file??collectorContext.currentSuite?.file,timeout,retry:options.retry??runner.config.retry,repeats:options.repeats??runner.config.repeats,mode:options.only?`only`:options.skip?`skip`:options.todo?`todo`:`run`,meta:testMeta,annotations:[],artifacts:[],benchmarks:[],tags:testTags},handler=options.handler;task.mode===`run`&&!handler&&(task.mode=`todo`),(options.concurrent??runner.config.sequence.concurrent)&&(task.concurrent=!0),task.shuffle=suiteOptions?.shuffle;let context=createTestContext(task,runner);Object.defineProperty(task,"context",{value:context,enumerable:!1}),setTestFixture(context,options.fixtures??new TestFixtures);let limit=Error.stackTraceLimit;Error.stackTraceLimit=10;let stackTraceError=Error(`STACK_TRACE_ERROR`);if(Error.stackTraceLimit=limit,handler&&setFn(task,withTimeout(withCancel(withAwaitAsyncAssertions(withFixtures(handler,{context}),task),task.context.signal),timeout,!1,stackTraceError,(_,error)=>abortIfTimeout([context],error))),runner.config.includeTaskLocation){let stack=findTestFileStackTrace(currentTestFilepath,stackTraceError);stack&&(task.location={line:stack.line,column:stack.column})}return tasks.push(task),task},test=createTest(function(name,optionsOrFn,timeoutOrTest){let{options,handler}=parseArguments(optionsOrFn,timeoutOrTest),concurrent=this.concurrent??options?.concurrent;concurrent!=null&&(options.concurrent=concurrent);let test=task(formatName(name),{...this,...options,handler});test.type=`test`}),collector={type:`collector`,name,mode,suite,options:suiteOptions,test,file:suite.file,tasks,collect,task,clear,on:addHook};function addHook(name,...fn){getHooks(suite)[name].push(...fn)}function initSuite(includeLocation){typeof suiteOptions==`number`&&(suiteOptions={timeout:suiteOptions});let currentSuite=collectorContext.currentSuite?.suite,parentTask=currentSuite??collectorContext.currentSuite?.file,suiteTags=toArray(suiteOptions?.tags);validateTags(runner.config,suiteTags),suite={id:``,type:`suite`,name,fullName:createTaskName([currentSuite?.fullName??collectorContext.currentSuite?.file?.fullName,name]),fullTestName:createTaskName([currentSuite?.fullTestName,name]),suite:currentSuite,mode,each,file:currentSuite?.file??collectorContext.currentSuite?.file,shuffle:suiteOptions?.shuffle,tasks:[],meta:suiteOptions?.meta??Object.create(null),concurrent:suiteOptions?.concurrent,tags:unique([...parentTask?.tags||[],...suiteTags])},setHooks(suite,createSuiteHooks())}function clear(){tasks.length=0,initSuite(!1)}async function collect(file){if(!file)throw TypeError(`File is required to collect tasks.`);factory&&await runWithSuite(collector,()=>factory(test));let allChildren=[],containsOnly=!1,containsTest=!1;for(let i of tasks){let child=i.type===`collector`?await i.collect(file):i;allChildren.push(child),(child.mode===`only`||child.type===`suite`&&child.containsOnly)&&(containsOnly=!0),(child.type===`test`||child.type===`suite`&&child.containsTest)&&(containsTest=!0)}return suite.tasks=allChildren,suite.containsOnly=containsOnly,suite.containsTest=containsTest,suite}return collectTask(collector),collector}function withAwaitAsyncAssertions(fn,task){return(async(...args)=>{let fnResult=await fn(...args);if(task.promises){let errors=(await Promise.allSettled(task.promises)).map(r=>r.status===`rejected`?r.reason:void 0).filter(Boolean);if(errors.length)throw errors}return fnResult})}function createSuite(){function suiteFn(name,factoryOrOptions,optionsOrFactory){let currentSuite=collectorContext.currentSuite||defaultSuite,{options,handler:factory}=parseArguments(factoryOrOptions,optionsOrFactory),{meta:parentMeta,...parentOptions}=currentSuite?.options||{};options={...parentOptions,...options};let shuffle=this.shuffle??options.shuffle??currentSuite?.options?.shuffle??void 0;shuffle!=null&&(options.shuffle=shuffle);let mode=this.only??options.only?`only`:this.skip??options.skip?`skip`:this.todo??options.todo?`todo`:`run`;mode===`run`&&!factory&&(mode=`todo`);let concurrent=this.concurrent??options.concurrent;return concurrent!=null&&(options.concurrent=concurrent),parentMeta&&(options.meta=Object.assign(Object.create(null),parentMeta,options.meta)),createSuiteCollector(formatName(name),factory,mode,this.each,options)}return suiteFn.each=function(cases,...args){let context=getChainableContext(this),suite=context.withContext();return context.setContext(`each`,!0),Array.isArray(cases)&&args.length&&(cases=formatTemplateString(cases,args)),(name,optionsOrFn,fnOrOptions)=>{let _name=formatName(name),arrayOnlyCases=cases.every(Array.isArray),{options,handler}=parseArguments(optionsOrFn,fnOrOptions),fnFirst=typeof optionsOrFn==`function`;cases.forEach((i,idx)=>{let items=Array.isArray(i)?i:[i];fnFirst?arrayOnlyCases?suite(formatTitle(_name,items,idx),handler?()=>handler(...items):void 0,options.timeout):suite(formatTitle(_name,items,idx),handler?()=>handler(i):void 0,options.timeout):arrayOnlyCases?suite(formatTitle(_name,items,idx),options,handler?()=>handler(...items):void 0):suite(formatTitle(_name,items,idx),options,handler?()=>handler(i):void 0)}),context.setContext(`each`,void 0)}},suiteFn.for=function(cases,...args){let suite=getChainableContext(this).withContext();return Array.isArray(cases)&&args.length&&(cases=formatTemplateString(cases,args)),(name,optionsOrFn,fnOrOptions)=>{let name_=formatName(name),{options,handler}=parseArguments(optionsOrFn,fnOrOptions);cases.forEach((item,idx)=>{suite(formatTitle(name_,toArray(item),idx),options,handler?()=>handler(item):void 0)})}},suiteFn.skipIf=condition=>condition?suite.skip:suite,suiteFn.runIf=condition=>condition?suite:suite.skip,createChainable([`concurrent`,`shuffle`,`skip`,`only`,`todo`],suiteFn)}function createTaskCollector(fn){let taskFn=fn;taskFn.each=function(cases,...args){let context=getChainableContext(this),test=context.withContext();return context.setContext(`each`,!0),Array.isArray(cases)&&args.length&&(cases=formatTemplateString(cases,args)),(name,optionsOrFn,fnOrOptions)=>{let _name=formatName(name),arrayOnlyCases=cases.every(Array.isArray),{options,handler}=parseArguments(optionsOrFn,fnOrOptions),fnFirst=typeof optionsOrFn==`function`;cases.forEach((i,idx)=>{let items=Array.isArray(i)?i:[i];fnFirst?arrayOnlyCases?test(formatTitle(_name,items,idx),handler?()=>handler(...items):void 0,options.timeout):test(formatTitle(_name,items,idx),handler?()=>handler(i):void 0,options.timeout):arrayOnlyCases?test(formatTitle(_name,items,idx),options,handler?()=>handler(...items):void 0):test(formatTitle(_name,items,idx),options,handler?()=>handler(i):void 0)}),context.setContext(`each`,void 0)}},taskFn.for=function(cases,...args){let test=getChainableContext(this).withContext();return Array.isArray(cases)&&args.length&&(cases=formatTemplateString(cases,args)),(name,optionsOrFn,fnOrOptions)=>{let _name=formatName(name),{options,handler}=parseArguments(optionsOrFn,fnOrOptions);cases.forEach((item,idx)=>{let handlerWrapper=handler?ctx=>handler(item,ctx):void 0;handlerWrapper&&configureProps(handlerWrapper,{index:1,original:handler}),test(formatTitle(_name,toArray(item),idx),options,handlerWrapper)})}},taskFn.skipIf=function(condition){return condition?this.skip:this},taskFn.runIf=function(condition){return condition?this:this.skip};function parseBuilderFixtures(fixturesOrName,optionsOrFn,maybeFn){if(typeof fixturesOrName!=`string`)return fixturesOrName;let fixtureName=fixturesOrName,fixtureOptions,fixtureValue;if(maybeFn===void 0?typeof optionsOrFn==`object`&&optionsOrFn&&!Array.isArray(optionsOrFn)&&TestFixtures.isFixtureOptions(optionsOrFn)?(fixtureOptions=optionsOrFn,fixtureValue={}):(fixtureOptions=void 0,fixtureValue=optionsOrFn):(fixtureOptions=optionsOrFn,fixtureValue=maybeFn),typeof fixtureValue==`function`){let builderFn=fixtureValue,fixture=async(ctx,use)=>{let cleanup;await use(await builderFn(ctx,{onCleanup:fn=>{if(cleanup!==void 0)throw Error(`onCleanup can only be called once per fixture. Define separate fixtures if you need multiple cleanup functions.`);cleanup=fn}})),cleanup&&await cleanup()};return configureProps(fixture,{original:builderFn}),fixtureOptions?{[fixtureName]:[fixture,fixtureOptions]}:{[fixtureName]:fixture}}return fixtureOptions?{[fixtureName]:[fixtureValue,fixtureOptions]}:{[fixtureName]:fixtureValue}}return taskFn.override=function(fixturesOrName,optionsOrFn,maybeFn){let userFixtures=parseBuilderFixtures(fixturesOrName,optionsOrFn,maybeFn);return getChainableContext(this).getFixtures().override(runner,userFixtures),this},taskFn.scoped=function(fixtures){return console.warn(`test.scoped() is deprecated and will be removed in future versions. Please use test.override() instead.`),this.override(fixtures)},taskFn.extend=function(fixturesOrName,optionsOrFn,maybeFn){let userFixtures=parseBuilderFixtures(fixturesOrName,optionsOrFn,maybeFn),fixtures=getChainableContext(this).getFixtures().extend(runner,userFixtures),_test=createTest(function(name,optionsOrFn,optionsOrTest){fn.call(this,formatName(name),optionsOrFn,optionsOrTest)});return getChainableContext(_test).mergeContext({fixtures}),_test},taskFn.describe=suite,taskFn.suite=suite,taskFn.beforeEach=beforeEach,taskFn.afterEach=afterEach,taskFn.beforeAll=beforeAll,taskFn.afterAll=afterAll,taskFn.aroundEach=aroundEach,taskFn.aroundAll=aroundAll,createChainable([`concurrent`,`skip`,`only`,`todo`,`fails`],taskFn,{fixtures:new TestFixtures})}function createTest(fn){return createTaskCollector(fn)}function formatName(name){return typeof name==`string`?name:typeof name==`function`?name.name||`<anonymous>`:String(name)}function formatTitle(template,items,idx){(template.includes(`%#`)||template.includes(`%$`))&&(template=template.replace(/%%/g,`__vitest_escaped_%__`).replace(/%#/g,`${idx}`).replace(/%\$/g,`${idx+1}`).replace(/__vitest_escaped_%__/g,`%%`));let count=template.split(`%`).length-1;template.includes(`%f`)&&(template.match(/%f/g)||[]).forEach((_,i)=>{if(isNegativeNaN(items[i])||Object.is(items[i],-0)){let occurrence=0;template=template.replace(/%f/g,match=>(occurrence++,occurrence===i+1?`-%f`:match))}});let inspectOptions={truncate:runner.config.taskTitleValueFormatTruncate},isObjectItem=isObject(items[0]);function formatAttribute(s){return s.replace(/\$([$\p{ID_Continue}.]+)/gu,(_,key)=>{let isArrayKey=/^\d+$/.test(key);if(!isObjectItem&&!isArrayKey)return`$${key}`;let arrayElement=isArrayKey?objectAttr(items,key):void 0,value=isObjectItem?objectAttr(items[0],key,arrayElement):arrayElement;return typeof value==`string`?truncateString(value,inspectOptions.truncate):inspect$1(value,inspectOptions)})}let output=``,i=0;return handleRegexMatch(template,formatRegExp,match=>{output+=i<count?format([match[0],items[i++]],inspectOptions):match[0]},nonMatch=>{output+=formatAttribute(nonMatch)}),output}function handleRegexMatch(input,regex,onMatch,onNonMatch){let lastIndex=0;for(let m of input.matchAll(regex))lastIndex<m.index&&onNonMatch(input.slice(lastIndex,m.index)),onMatch(m),lastIndex=m.index+m[0].length;lastIndex<input.length&&onNonMatch(input.slice(lastIndex))}function formatTemplateString(cases,args){let header=cases.join(``).trim().replace(/ /g,``).split(`
62
+ `).map(i=>i.split(`|`))[0],res=[];for(let i=0;i<Math.floor(args.length/header.length);i++){let oneCase={};for(let j=0;j<header.length;j++)oneCase[header[j]]=args[i*header.length+j];res.push(oneCase)}return res}async function recordArtifact(task,artifact){let runner=getRunner(),stack=findTestFileStackTrace(task.file.filepath,Error(`STACK_TRACE`));if(stack&&(artifact.location={file:stack.file,line:stack.line,column:stack.column},artifact.type===`internal:annotation`&&(artifact.annotation.location=artifact.location)),Array.isArray(artifact.attachments))for(let attachment of artifact.attachments)manageArtifactAttachment(attachment);if(artifact.type===`internal:annotation`)return artifact;if(!runner.onTestArtifactRecord)throw Error(`Test runner doesn't support test artifacts.`);await finishSendTasksUpdate(runner);let resolvedArtifact=await runner.onTestArtifactRecord(task,artifact);return task.artifacts.push(resolvedArtifact),resolvedArtifact}const table=[];for(let i=65;i<91;i++)table.push(String.fromCharCode(i));for(let i=97;i<123;i++)table.push(String.fromCharCode(i));for(let i=0;i<10;i++)table.push(i.toString(10));table.push(`+`,`/`);function encodeUint8Array(bytes){let base64=``,len=bytes.byteLength;for(let i=0;i<len;i+=3)if(len===i+1){let a=(bytes[i]&252)>>2,b=(bytes[i]&3)<<4;base64+=table[a],base64+=table[b],base64+=`==`}else if(len===i+2){let a=(bytes[i]&252)>>2,b=(bytes[i]&3)<<4|(bytes[i+1]&240)>>4,c=(bytes[i+1]&15)<<2;base64+=table[a],base64+=table[b],base64+=table[c],base64+=`=`}else{let a=(bytes[i]&252)>>2,b=(bytes[i]&3)<<4|(bytes[i+1]&240)>>4,c=(bytes[i+1]&15)<<2|(bytes[i+2]&192)>>6,d=bytes[i+2]&63;base64+=table[a],base64+=table[b],base64+=table[c],base64+=table[d]}return base64}function recordAsyncOperation(test,promise){return promise=promise.finally(()=>{if(!test.promises)return;let index=test.promises.indexOf(promise);index!==-1&&test.promises.splice(index,1)}),test.promises||=[],test.promises.push(promise),promise}function manageArtifactAttachment(attachment){if(attachment.body==null&&!attachment.path)throw TypeError(`Test attachment requires "body" or "path" to be set. Both are missing.`);if(attachment.body&&attachment.path)throw TypeError(`Test attachment requires only one of "body" or "path" to be set. Both are specified.`);if(attachment.path&&attachment.bodyEncoding)throw TypeError(`Test attachment with "path" should not have "bodyEncoding" specified.`);attachment.body instanceof Uint8Array&&(attachment.body=encodeUint8Array(attachment.body)),attachment.body!=null&&(attachment.bodyEncoding??=`base64`)}const now$2=globalThis.performance?globalThis.performance.now.bind(globalThis.performance):Date.now;var TaskDeadline=class{startTime=now$2();endTime;timer;operations=new Set;constructor(timeout,onTimeout){this.endTime=this.startTime+timeout;let{setTimeout}=getSafeTimers();this.timer=setTimeout(onTimeout,timeout),this.timer.unref?.()}remaining(){return this.endTime-now$2()}exceeded(){return now$2()>=this.endTime}clear(){let{clearTimeout}=getSafeTimers();clearTimeout(this.timer)}derive(){return Math.max(Math.floor(this.remaining())-100,1)}track(name,promise,timeout,source){let operation={name,source,promise,endTime:now$2()+timeout};return this.operations.add(operation),promise.finally(()=>this.operations.delete(operation)).catch(()=>{}),promise}settle(){if(!this.operations.size)return;let operations=[...this.operations],pending=()=>operations.filter(operation=>this.operations.has(operation)),due=operations.filter(operation=>operation.endTime<=this.endTime);if(!due.length)return Promise.resolve(operations);let{setTimeout}=getSafeTimers(),waitUntil=Math.max(...due.map(operation=>operation.endTime))+500;return Promise.race([Promise.all(due.map(operation=>operation.promise)).then(pending),new Promise(resolve=>setTimeout(()=>{resolve(pending())},Math.max(waitUntil-now$2(),0)))])}};const collectorContext={tasks:[],currentSuite:null};function collectTask(task){collectorContext.currentSuite?.tasks.push(task)}async function runWithSuite(suite,fn){let prev=collectorContext.currentSuite;collectorContext.currentSuite=suite,await fn(),collectorContext.currentSuite=prev}function withTimeout(fn,timeout,isHook=!1,stackTraceError,onTimeout){return timeout<=0||timeout===1/0?fn:(function(...args){let runner=getRunner(),previousDeadline=runner._deadline;return new Promise((resolve_,reject_)=>{let settled=!1,deadline=new TaskDeadline(timeout,()=>{let pending=deadline.settle();if(pending){pending.then(rejectTimeoutError,reject);return}rejectTimeoutError()});runner._deadline=deadline;function rejectTimeoutError(pending){if(settled)return;settled=!0;let error=makeTimeoutError(isHook,timeout,stackTraceError,pending);onTimeout?.(args,error),reject_(error)}function resolve(result){if(runner._deadline=previousDeadline,deadline.clear(),deadline.exceeded()){rejectTimeoutError();return}settled=!0,resolve_(result)}function reject(error){settled||(settled=!0,runner._deadline=previousDeadline,deadline.clear(),reject_(error))}try{let result=fn(...args);typeof result==`object`&&result&&typeof result.then==`function`?result.then(resolve,reject):resolve(result)}catch(error){reject(error)}})})}function withCancel(fn,signal){return(function(...args){return new Promise((resolve,reject)=>{let onAbort=()=>reject(signal.reason);signal.addEventListener(`abort`,onAbort,{once:!0});let cleanup=()=>signal.removeEventListener(`abort`,onAbort);try{let result=fn(...args);typeof result==`object`&&result&&typeof result.then==`function`?result.then(value=>{cleanup(),resolve(value)},error=>{cleanup(),reject(error)}):(cleanup(),resolve(result))}catch(error){cleanup(),reject(error)}})})}const abortControllers=new WeakMap;function abortIfTimeout([context],error){context&&abortContextSignal(context,error)}function abortContextSignal(context,error){abortControllers.get(context)?.abort(error)}function createTestContext(test,runner){let context=function(){throw Error(`done() callback is deprecated, use promise instead`)},abortController=abortControllers.get(context);return abortController||(abortController=new AbortController,abortControllers.set(context,abortController)),context.signal=abortController.signal,context.task=test,context.skip=(condition,note)=>{if(condition!==!1)throw test.result??={state:`skip`},test.result.pending=!0,new PendingError(`test is skipped; abort execution`,test,typeof condition==`string`?condition:note)},context.annotate=((message,type,attachment)=>{if(test.result&&test.result.state!==`run`)throw Error(`Cannot annotate tests outside of the test run. The test "${test.name}" finished running with the "${test.result.state}" state already.`);let annotation={message,type:typeof type==`object`||type===void 0?`notice`:type},annotationAttachment=typeof type==`object`?type:attachment;return annotationAttachment&&(annotation.attachment=annotationAttachment,manageArtifactAttachment(annotation.attachment)),recordAsyncOperation(test,recordArtifact(test,{type:`internal:annotation`,annotation}).then(async({annotation})=>{if(!runner.onTestAnnotate)throw Error(`Test runner doesn't support test annotations.`);await finishSendTasksUpdate(runner);let resolvedAnnotation=await runner.onTestAnnotate(test,annotation);return test.annotations.push(resolvedAnnotation),resolvedAnnotation}))}),context.onTestFailed=(handler,timeout)=>{test.onFailed||=[],test.onFailed.push(withTimeout(handler,timeout??runner.config.hookTimeout,!0,Error(`STACK_TRACE_ERROR`),(_,error)=>abortController.abort(error)))},context.onTestFinished=(handler,timeout)=>{test.onFinished||=[],test.onFinished.push(withTimeout(handler,timeout??runner.config.hookTimeout,!0,Error(`STACK_TRACE_ERROR`),(_,error)=>abortController.abort(error)))},runner.extendTaskContext?.(context)||context}function makeTimeoutError(isHook,timeout,stackTraceError,pending){let waiting=pending?.length?` while waiting for ${pending.map(operation=>operation.name).join(`, `)}`:``,lastOperationSource=pending?.at(-1)?.source;lastOperationSource&&(stackTraceError=lastOperationSource);let message=`${isHook?`Hook`:`Test`} timed out in ${timeout}ms${waiting}.\nIf this is a long-running ${isHook?`hook`:`test`}, pass a timeout value as the last argument or configure it globally with "${isHook?`hookTimeout`:`testTimeout`}".`,error=Error(message);return stackTraceError?.stack&&(error.stack=stackTraceError.stack.replace(stackTraceError.message,error.message)),error}globalThis.performance?globalThis.performance.now.bind(globalThis.performance):Date.now,globalThis.performance?globalThis.performance.now.bind(globalThis.performance):Date.now,Date.now;const{clearTimeout,setTimeout:setTimeout$1}=getSafeTimers(),packs=new Map,eventsPacks=[],pendingTasksUpdates=[];function sendTasksUpdate(runner){if(packs.size){let taskPacks=Array.from(packs).map(([id,task])=>[id,task[0],task[1]]),p=runner.onTaskUpdate?.(taskPacks,eventsPacks);p&&(pendingTasksUpdates.push(p),p.then(()=>pendingTasksUpdates.splice(pendingTasksUpdates.indexOf(p),1),()=>{})),eventsPacks.length=0,packs.clear()}}async function finishSendTasksUpdate(runner){sendTasksUpdate(runner),await Promise.all(pendingTasksUpdates)}function getWorkerState(){let workerState=globalThis.__vitest_worker__;if(!workerState)throw Error(`Vitest failed to access its internal state.
63
+
64
+ One of the following is possible:
65
+ - "vitest" is imported directly without running "vitest" command
66
+ - "vitest" is imported inside "globalSetup" (to fix this, use "setupFiles" instead, because "globalSetup" runs in a different context)
67
+ - "vitest" is imported inside Vite / Vitest config file
68
+ - Otherwise, it might be a Vitest bug. Please report it to https://github.com/vitest-dev/vitest/issues
69
+ `);return workerState}function isChildProcess(){return typeof process<`u`&&!!process.send}function resetModules(modules,resetMocks=!1){let skipPaths=[/\/vitest\/dist\//,/vitest-virtual-\w+\/dist/,/@vitest\/dist/,...resetMocks?[]:[/^mock:/]];modules.idToModuleMap.forEach((node,path)=>{skipPaths.some(re=>re.test(path))||(node.promise=void 0,node.exports=void 0,node.evaluated=!1,node.importers.clear())})}function isMockFunction(fn){return typeof fn==`function`&&`_isMockFunction`in fn&&fn._isMockFunction===!0}const MOCK_RESTORE=new Set,DIRTY_MOCK_STATES=new Set,REGISTERED_MOCKS=new Set,MOCK_FINALIZER=new FinalizationRegistry(ref=>{REGISTERED_MOCKS.delete(ref)}),MOCK_CONFIGS=new WeakMap,MOCKS_BY_STATE=new WeakMap;function createMockInstance(options={}){let{originalImplementation,restore,mockImplementation,resetToMockImplementation,resetToMockName}=options;restore&&MOCK_RESTORE.add(restore);let config=getDefaultConfig(originalImplementation),state=getDefaultState(),mock=createMock({config,state,...options}),mockLength=(mockImplementation||originalImplementation)?.length??0;Object.defineProperty(mock,"length",{writable:!0,enumerable:!1,value:mockLength,configurable:!0}),resetToMockName&&(config.mockName=mock.name||`vi.fn()`),MOCK_CONFIGS.set(mock,config),MOCKS_BY_STATE.set(state,mock);let ref=new WeakRef(mock);REGISTERED_MOCKS.add(ref),MOCK_FINALIZER.register(mock,ref),mock._isMockFunction=!0,mock.getMockImplementation=()=>config.onceMockImplementations[0]||config.mockImplementation;let updateMockPrototype=()=>{options.prototypeMembers?.length||reparentMockPrototype(mock,config.onceMockImplementations[0]||config.mockImplementation||originalImplementation)};return Object.defineProperty(mock,"mock",{configurable:!1,enumerable:!0,writable:!1,value:state}),mock.mockImplementation=function(implementation){return config.mockImplementation=implementation,updateMockPrototype(),mock},mock.mockImplementationOnce=function(implementation){return config.onceMockImplementations.push(implementation),updateMockPrototype(),mock},mock.withImplementation=function(implementation,callback){let previousImplementation=config.mockImplementation,previousOnceImplementations=config.onceMockImplementations,reset=()=>{config.mockImplementation=previousImplementation,config.onceMockImplementations=previousOnceImplementations,updateMockPrototype()};config.mockImplementation=implementation,config.onceMockImplementations=[],updateMockPrototype();let returnValue=callback();return typeof returnValue==`object`&&typeof returnValue?.then==`function`?returnValue.then(()=>(reset(),mock)):(reset(),mock)},mock.mockReturnThis=function(){return mock.mockImplementation(function(){return this})},mock.mockReturnValue=function(value){return mock.mockImplementation(function(){return new.target&&throwConstructorError(`mockReturnValue`),value})},mock.mockReturnValueOnce=function(value){return mock.mockImplementationOnce(function(){return new.target&&throwConstructorError(`mockReturnValueOnce`),value})},mock.mockThrow=function(value){return mock.mockImplementation(function(){throw value})},mock.mockThrowOnce=function(value){return mock.mockImplementationOnce(function(){throw value})},mock.mockResolvedValue=function(value){return mock.mockImplementation(function(){return new.target&&throwConstructorError(`mockResolvedValue`),Promise.resolve(value)})},mock.mockResolvedValueOnce=function(value){return mock.mockImplementationOnce(function(){return new.target&&throwConstructorError(`mockResolvedValueOnce`),Promise.resolve(value)})},mock.mockRejectedValue=function(value){return mock.mockImplementation(function(){return new.target&&throwConstructorError(`mockRejectedValue`),Promise.reject(value)})},mock.mockRejectedValueOnce=function(value){return mock.mockImplementationOnce(function(){return new.target&&throwConstructorError(`mockRejectedValueOnce`),Promise.reject(value)})},mock.mockClear=function(){return state.calls=[],state.contexts=[],state.instances=[],state.invocationCallOrder=[],state.results=[],state.settledResults=[],DIRTY_MOCK_STATES.delete(mock),mock},mock.mockReset=function(){return mock.mockClear(),config.mockImplementation=resetToMockImplementation?mockImplementation:void 0,config.mockName=resetToMockName&&mock.name||`vi.fn()`,config.onceMockImplementations=[],updateMockPrototype(),mock},mock.mockRestore=function(){return mock.mockReset(),restore?.()},mock.mockName=function(name){return typeof name==`string`&&(config.mockName=name),mock},mock.getMockName=function(){return config.mockName||`vi.fn()`},Symbol.dispose&&(mock[Symbol.dispose]=()=>mock.mockRestore()),mockImplementation?mock.mockImplementation(mockImplementation):updateMockPrototype(),mock}function fn(originalImplementation){return originalImplementation!=null&&isMockFunction(originalImplementation)?originalImplementation:createMockInstance({mockImplementation:originalImplementation,resetToMockImplementation:!0})}function spyOn(object,key,accessor){assert$1(object!=null,`The vi.spyOn() function could not find an object to spy upon. The first argument must be defined.`),assert$1(typeof object==`object`||typeof object==`function`,`Vitest cannot spy on a primitive value.`);let[originalDescriptorObject,originalDescriptor]=getDescriptor(object,key)||[];assert$1(originalDescriptor||key in object,`The property "${String(key)}" is not defined on the ${typeof object}.`);let accessType=accessor||`value`,ssr=!1;accessType===`value`&&originalDescriptor&&originalDescriptor.value==null&&originalDescriptor.get&&(accessType=`get`,ssr=!0);let original;originalDescriptor?(original=originalDescriptor[accessType],original==null&&accessType===`value`&&(original=object[key])):original=accessType===`value`?object[key]:()=>object[key];let originalImplementation=ssr&&original?original():original,originalType=typeof originalImplementation;if(assert$1(originalType===`function`||accessType!==`value`&&original==null,`vi.spyOn() can only spy on a function. Received ${originalType}.`),isMockFunction(originalImplementation))return originalImplementation;let reassign=cb=>{let{value,...desc}=originalDescriptor||{configurable:!0,writable:!0};accessType!==`value`&&delete desc.writable,desc[accessType]=cb,Object.defineProperty(object,key,desc)},mock=createMockInstance({restore:()=>{originalDescriptorObject===object?originalDescriptor&&!original?Object.defineProperty(object,key,originalDescriptor):reassign(original):Reflect.deleteProperty(object,key)},originalImplementation,resetToMockName:!0});try{reassign(ssr?()=>mock:mock)}catch(error){throw error instanceof TypeError&&Symbol.toStringTag&&object[Symbol.toStringTag]===`Module`&&(error.message.includes(`Cannot redefine property`)||error.message.includes(`Cannot replace module namespace`)||error.message.includes(`can't redefine non-configurable property`))?TypeError(`Cannot spy on export "${String(key)}". Module namespace is not configurable in ESM. See: https://vitest.dev/guide/mocking/modules#mocking-a-module`,{cause:error}):error}return mock}function getDescriptor(obj,method){let objDescriptor=Object.getOwnPropertyDescriptor(obj,method);if(objDescriptor)return[obj,objDescriptor];let currentProto=Object.getPrototypeOf(obj);for(;currentProto!==null;){let descriptor=Object.getOwnPropertyDescriptor(currentProto,method);if(descriptor)return[currentProto,descriptor];currentProto=Object.getPrototypeOf(currentProto)}}function assert$1(condition,message){if(!condition)throw Error(message)}let invocationCallCounter=1;function createMock({state,config,name:mockName,prototypeState,prototypeConfig,keepMembersImplementation,mockImplementation,prototypeMembers=[]}){let original=config.mockOriginal,pseudoOriginal=mockImplementation,name=mockName||original?.name||`Mock`,noopImplementation=function(){},prototypeMock=prototypeState&&MOCKS_BY_STATE.get(prototypeState),namedObject={[name]:(function(...args){DIRTY_MOCK_STATES.add(namedObject[name]),prototypeMock&&DIRTY_MOCK_STATES.add(prototypeMock),registerCalls(args,state,prototypeState),registerInvocationOrder(invocationCallCounter++,state,prototypeState);let result={type:`incomplete`,value:void 0},settledResult={type:`incomplete`,value:void 0};registerResult(result,state,prototypeState),registerSettledResult(settledResult,state,prototypeState);let context=new.target?void 0:this,[instanceIndex,instancePrototypeIndex]=registerInstance(context,state,prototypeState),[contextIndex,contextPrototypeIndex]=registerContext(context,state,prototypeState),implementation=config.onceMockImplementations.shift()||config.mockImplementation||prototypeConfig?.onceMockImplementations.shift()||prototypeConfig?.mockImplementation||original||noopImplementation,returnValue,thrownValue,didThrow=!1;try{if(new.target){prototypeMembers.length===0&&reparentMockPrototype(mock,implementation===noopImplementation?void 0:implementation),returnValue=Reflect.construct(implementation,args,new.target);for(let prop of prototypeMembers){let prototypeMock=returnValue[prop];if(prototypeMock!==mock.prototype[prop])continue;let isMock=isMockFunction(prototypeMock),prototypeState=isMock?prototypeMock.mock:void 0,prototypeConfig=isMock?MOCK_CONFIGS.get(prototypeMock):void 0;returnValue[prop]=createMockInstance({originalImplementation:keepMembersImplementation?prototypeConfig?.mockOriginal:void 0,prototypeState,prototypeConfig,keepMembersImplementation})}}else returnValue=implementation.apply(this,args)}catch(error){throw thrownValue=error,didThrow=!0,error instanceof TypeError&&error.message.includes(`is not a constructor`)&&console.warn(`[vitest] The ${namedObject[name].getMockName()} mock did not use 'function' or 'class' in its implementation, see https://vitest.dev/api/vi#vi-spyon for examples.`),error}finally{didThrow?(result.type=`throw`,result.value=thrownValue,settledResult.type=`rejected`,settledResult.value=thrownValue):(result.type=`return`,result.value=returnValue,new.target&&(state.contexts[contextIndex-1]=returnValue,state.instances[instanceIndex-1]=returnValue,contextPrototypeIndex!=null&&prototypeState&&(prototypeState.contexts[contextPrototypeIndex-1]=returnValue),instancePrototypeIndex!=null&&prototypeState&&(prototypeState.instances[instancePrototypeIndex-1]=returnValue)),returnValue instanceof Promise?returnValue.then(settledValue=>{settledResult.type=`fulfilled`,settledResult.value=settledValue},rejectedValue=>{settledResult.type=`rejected`,settledResult.value=rejectedValue}):(settledResult.type=`fulfilled`,settledResult.value=returnValue))}return returnValue})},mock=namedObject[name],copyPropertiesFrom=original||pseudoOriginal;return copyPropertiesFrom&&copyOriginalStaticProperties(mock,copyPropertiesFrom),mock}function reparentMockPrototype(mock,implementation){let mockPrototype=mock.prototype;if(mockPrototype==null)return;let parent=implementation?.prototype??Object.prototype;mockPrototype!==parent&&Object.getPrototypeOf(mockPrototype)!==parent&&Object.setPrototypeOf(mockPrototype,parent)}function registerCalls(args,state,prototypeState){state.calls.push(args),prototypeState?.calls.push(args)}function registerInvocationOrder(order,state,prototypeState){state.invocationCallOrder.push(order),prototypeState?.invocationCallOrder.push(order)}function registerResult(result,state,prototypeState){state.results.push(result),prototypeState?.results.push(result)}function registerSettledResult(result,state,prototypeState){state.settledResults.push(result),prototypeState?.settledResults.push(result)}function registerInstance(instance,state,prototypeState){return[state.instances.push(instance),prototypeState?.instances.push(instance)]}function registerContext(context,state,prototypeState){return[state.contexts.push(context),prototypeState?.contexts.push(context)]}function copyOriginalStaticProperties(mock,original){let{properties,descriptors}=getAllProperties(original);for(let key of properties){let descriptor=descriptors[key];getDescriptor(mock,key)||Object.defineProperty(mock,key,descriptor)}}const ignoreProperties=new Set([`length`,`name`,`prototype`,Symbol.for(`nodejs.util.promisify.custom`)]);function getAllProperties(original){let properties=new Set,descriptors={};for(;original&&original!==Object.prototype&&original!==Function.prototype;){let ownProperties=[...Object.getOwnPropertyNames(original),...Object.getOwnPropertySymbols(original)];for(let prop of ownProperties)descriptors[prop]||ignoreProperties.has(prop)||(properties.add(prop),descriptors[prop]=Object.getOwnPropertyDescriptor(original,prop));original=Object.getPrototypeOf(original)}return{properties,descriptors}}function getDefaultConfig(original){return{mockImplementation:void 0,mockOriginal:original,mockName:`vi.fn()`,onceMockImplementations:[]}}function getDefaultState(){let state={calls:[],contexts:[],instances:[],invocationCallOrder:[],settledResults:[],results:[],get lastCall(){return state.calls.at(-1)}};return state}function restoreAllMocks(){for(let restore of MOCK_RESTORE)restore();MOCK_RESTORE.clear()}function clearAllMocks(){for(let mock of DIRTY_MOCK_STATES)mock.mockClear()}function resetAllMocks(){for(let ref of REGISTERED_MOCKS){let mock=ref.deref();mock?mock.mockReset():REGISTERED_MOCKS.delete(ref)}}function throwConstructorError(shorthand){throw TypeError(`Cannot use \`${shorthand}\` when called with \`new\`. Use \`mockImplementation\` with a \`class\` keyword instead. See https://vitest.dev/api/mock#class-support for more information.`)}var __defProp=Object.defineProperty,__defNormalProp=(obj,key,value)=>key in obj?__defProp(obj,key,{enumerable:!0,configurable:!0,writable:!0,value}):obj[key]=value,__name=(target,value)=>__defProp(target,`name`,{value,configurable:!0}),__export=(target,all)=>{for(var name in all)__defProp(target,name,{get:all[name],enumerable:!0})},__publicField=(obj,key,value)=>__defNormalProp(obj,typeof key==`symbol`?key:key+``,value),utils_exports={};__export(utils_exports,{addChainableMethod:()=>addChainableMethod,addLengthGuard:()=>addLengthGuard,addMethod:()=>addMethod,addProperty:()=>addProperty,checkError:()=>check_error_exports,compareByInspect:()=>compareByInspect,eql:()=>deep_eql_default,events:()=>events,expectTypes:()=>expectTypes,flag:()=>flag,getActual:()=>getActual,getMessage:()=>getMessage2,getName:()=>getName,getOperator:()=>getOperator,getOwnEnumerableProperties:()=>getOwnEnumerableProperties,getOwnEnumerablePropertySymbols:()=>getOwnEnumerablePropertySymbols,getPathInfo:()=>getPathInfo,hasProperty:()=>hasProperty,inspect:()=>inspect2,isNaN:()=>isNaN2,isNumeric:()=>isNumeric,isProxyEnabled:()=>isProxyEnabled,isRegExp:()=>isRegExp2,objDisplay:()=>objDisplay,overwriteChainableMethod:()=>overwriteChainableMethod,overwriteMethod:()=>overwriteMethod,overwriteProperty:()=>overwriteProperty,proxify:()=>proxify,test:()=>test$1,transferFlags:()=>transferFlags,type:()=>type});var check_error_exports={};__export(check_error_exports,{compatibleConstructor:()=>compatibleConstructor,compatibleInstance:()=>compatibleInstance,compatibleMessage:()=>compatibleMessage,getConstructorName:()=>getConstructorName,getMessage:()=>getMessage});function isErrorInstance(obj){return obj instanceof Error||Object.prototype.toString.call(obj)===`[object Error]`}__name(isErrorInstance,`isErrorInstance`);function isRegExp(obj){return Object.prototype.toString.call(obj)===`[object RegExp]`}__name(isRegExp,`isRegExp`);function compatibleInstance(thrown,errorLike){return isErrorInstance(errorLike)&&thrown===errorLike}__name(compatibleInstance,`compatibleInstance`);function compatibleConstructor(thrown,errorLike){return isErrorInstance(errorLike)?thrown.constructor===errorLike.constructor||thrown instanceof errorLike.constructor:(typeof errorLike==`object`||typeof errorLike==`function`)&&errorLike.prototype?thrown.constructor===errorLike||thrown instanceof errorLike:!1}__name(compatibleConstructor,`compatibleConstructor`);function compatibleMessage(thrown,errMatcher){let comparisonString=typeof thrown==`string`?thrown:thrown.message;return isRegExp(errMatcher)?errMatcher.test(comparisonString):typeof errMatcher==`string`&&comparisonString.indexOf(errMatcher)!==-1}__name(compatibleMessage,`compatibleMessage`);function getConstructorName(errorLike){let constructorName=errorLike;return isErrorInstance(errorLike)?constructorName=errorLike.constructor.name:typeof errorLike==`function`&&(constructorName=errorLike.name,constructorName===``&&(constructorName=new errorLike().name||constructorName)),constructorName}__name(getConstructorName,`getConstructorName`);function getMessage(errorLike){let msg=``;return errorLike&&errorLike.message?msg=errorLike.message:typeof errorLike==`string`&&(msg=errorLike),msg}__name(getMessage,`getMessage`);function flag(obj,key,value){let flags=obj.__flags||=Object.create(null);if(arguments.length===3)flags[key]=value;else return flags[key]}__name(flag,`flag`);function test$1(obj,args){let negate=flag(obj,`negate`),expr=args[0];return negate?!expr:expr}__name(test$1,`test`);function type(obj){if(obj===void 0)return`undefined`;if(obj===null)return`null`;let stringTag=obj[Symbol.toStringTag];return typeof stringTag==`string`?stringTag:Object.prototype.toString.call(obj).slice(8,-1)}__name(type,`type`);var canElideFrames=`captureStackTrace`in Error,_AssertionError=class _AssertionError extends Error{constructor(message=`Unspecified AssertionError`,props,ssf){super(message),__publicField(this,`message`),this.message=message,canElideFrames&&Error.captureStackTrace(this,ssf||_AssertionError);for(let key in props)key in this||(this[key]=props[key])}get name(){return`AssertionError`}get ok(){return!1}toJSON(stack){return{...this,name:this.name,message:this.message,ok:!1,stack:stack===!1?void 0:this.stack}}};__name(_AssertionError,`AssertionError`);var AssertionError=_AssertionError;function expectTypes(obj,types){let flagMsg=flag(obj,`message`),ssfi=flag(obj,`ssfi`);flagMsg=flagMsg?flagMsg+`: `:``,obj=flag(obj,`object`),types=types.map(function(t){return t.toLowerCase()}),types.sort();let str=types.map(function(t,index){let art=~[`a`,`e`,`i`,`o`,`u`].indexOf(t.charAt(0))?`an`:`a`;return(types.length>1&&index===types.length-1?`or `:``)+art+` `+t}).join(`, `),objType=type(obj).toLowerCase();if(!types.some(function(expected){return objType===expected}))throw new AssertionError(flagMsg+`object tested must be `+str+`, but `+objType+` given`,void 0,ssfi)}__name(expectTypes,`expectTypes`);function getActual(obj,args){return args.length>4?args[4]:obj._obj}__name(getActual,`getActual`);var ansiColors={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`]},styles={special:`cyan`,number:`yellow`,bigint:`yellow`,boolean:`yellow`,undefined:`grey`,null:`bold`,string:`green`,symbol:`green`,date:`magenta`,regexp:`red`},truncator=`…`;function colorise(value,styleType){let color=ansiColors[styles[styleType]]||ansiColors[styleType]||``;return color?`\x1B[${color[0]}m${String(value)}\x1B[${color[1]}m`:String(value)}__name(colorise,`colorise`);function normaliseOptions({showHidden=!1,depth=2,colors=!1,customInspect=!0,showProxy=!1,maxArrayLength=1/0,breakLength=1/0,seen=[],truncate:truncate2=1/0,stylize=String}={},inspect3){let options={showHidden:!!showHidden,depth:Number(depth),colors:!!colors,customInspect:!!customInspect,showProxy:!!showProxy,maxArrayLength:Number(maxArrayLength),breakLength:Number(breakLength),truncate:Number(truncate2),seen,inspect:inspect3,stylize};return options.colors&&(options.stylize=colorise),options}__name(normaliseOptions,`normaliseOptions`);function isHighSurrogate(char){return char>=`\ud800`&&char<=`\udbff`}__name(isHighSurrogate,`isHighSurrogate`);function truncate(string,length,tail=truncator){string=String(string);let tailLength=tail.length,stringLength=string.length;if(tailLength>length&&stringLength>tailLength)return tail;if(stringLength>length&&stringLength>tailLength){let end=length-tailLength;return end>0&&isHighSurrogate(string[end-1])&&--end,`${string.slice(0,end)}${tail}`}return string}__name(truncate,`truncate`);function inspectList(list,options,inspectItem,separator=`, `){inspectItem||=options.inspect;let size=list.length;if(size===0)return``;let originalLength=options.truncate,output=``,peek=``,truncated=``;for(let i=0;i<size;i+=1){let last=i+1===list.length,secondToLast=i+2===list.length;truncated=`${truncator}(${list.length-i})`;let value=list[i];options.truncate=originalLength-output.length-(last?0:separator.length);let string=peek||inspectItem(value,options)+(last?``:separator),nextLength=output.length+string.length,truncatedLength=nextLength+truncated.length;if(last&&nextLength>originalLength&&output.length+truncated.length<=originalLength||!last&&!secondToLast&&truncatedLength>originalLength||(peek=last?``:inspectItem(list[i+1],options)+(secondToLast?``:separator),!last&&secondToLast&&truncatedLength>originalLength&&nextLength+peek.length>originalLength))break;if(output+=string,!last&&!secondToLast&&nextLength+peek.length>=originalLength){truncated=`${truncator}(${list.length-i-1})`;break}truncated=``}return`${output}${truncated}`}__name(inspectList,`inspectList`);function quoteComplexKey(key){return key.match(/^[a-zA-Z_][a-zA-Z_0-9]*$/)?key:JSON.stringify(key).replace(/'/g,`\\'`).replace(/\\"/g,`"`).replace(/(^"|"$)/g,`'`)}__name(quoteComplexKey,`quoteComplexKey`);function inspectProperty([key,value],options){return options.truncate-=2,typeof key==`string`?key=quoteComplexKey(key):typeof key!=`number`&&(key=`[${options.inspect(key,options)}]`),options.truncate-=key.length,value=options.inspect(value,options),`${key}: ${value}`}__name(inspectProperty,`inspectProperty`);function inspectArray(array,options){let nonIndexProperties=Object.keys(array).slice(array.length);if(!array.length&&!nonIndexProperties.length)return`[]`;options.truncate-=4;let listContents=inspectList(array,options);options.truncate-=listContents.length;let propertyContents=``;return nonIndexProperties.length&&(propertyContents=inspectList(nonIndexProperties.map(key=>[key,array[key]]),options,inspectProperty)),`[ ${listContents}${propertyContents?`, ${propertyContents}`:``} ]`}__name(inspectArray,`inspectArray`);var getArrayName=__name(array=>typeof Buffer==`function`&&array instanceof Buffer?`Buffer`:array[Symbol.toStringTag]?array[Symbol.toStringTag]:array.constructor.name,`getArrayName`);function inspectTypedArray(array,options){let name=getArrayName(array);options.truncate-=name.length+4;let nonIndexProperties=Object.keys(array).slice(array.length);if(!array.length&&!nonIndexProperties.length)return`${name}[]`;let output=``;for(let i=0;i<array.length;i++){let string=`${options.stylize(truncate(array[i],options.truncate),`number`)}${i===array.length-1?``:`, `}`;if(options.truncate-=string.length,array[i]!==array.length&&options.truncate<=3){output+=`${truncator}(${array.length-array[i]+1})`;break}output+=string}let propertyContents=``;return nonIndexProperties.length&&(propertyContents=inspectList(nonIndexProperties.map(key=>[key,array[key]]),options,inspectProperty)),`${name}[ ${output}${propertyContents?`, ${propertyContents}`:``} ]`}__name(inspectTypedArray,`inspectTypedArray`);function inspectDate(dateObject,options){let stringRepresentation=dateObject.toJSON();if(stringRepresentation===null)return`Invalid Date`;let split=stringRepresentation.split(`T`),date=split[0];return options.stylize(`${date}T${truncate(split[1],options.truncate-date.length-1)}`,`date`)}__name(inspectDate,`inspectDate`);function inspectFunction(func,options){let functionType=func[Symbol.toStringTag]||`Function`,name=func.name;return name?options.stylize(`[${functionType} ${truncate(name,options.truncate-11)}]`,`special`):options.stylize(`[${functionType}]`,`special`)}__name(inspectFunction,`inspectFunction`);function inspectMapEntry([key,value],options){return options.truncate-=4,key=options.inspect(key,options),options.truncate-=key.length,value=options.inspect(value,options),`${key} => ${value}`}__name(inspectMapEntry,`inspectMapEntry`);function mapToEntries(map){let entries=[];return map.forEach((value,key)=>{entries.push([key,value])}),entries}__name(mapToEntries,`mapToEntries`);function inspectMap(map,options){return map.size===0?`Map{}`:(options.truncate-=7,`Map{ ${inspectList(mapToEntries(map),options,inspectMapEntry)} }`)}__name(inspectMap,`inspectMap`);var isNaN=Number.isNaN||(i=>i!==i);function inspectNumber(number,options){return isNaN(number)?options.stylize(`NaN`,`number`):number===1/0?options.stylize(`Infinity`,`number`):number===-1/0?options.stylize(`-Infinity`,`number`):number===0?options.stylize(1/number==1/0?`+0`:`-0`,`number`):options.stylize(truncate(String(number),options.truncate),`number`)}__name(inspectNumber,`inspectNumber`);function inspectBigInt(number,options){let nums=truncate(number.toString(),options.truncate-1);return nums!==truncator&&(nums+=`n`),options.stylize(nums,`bigint`)}__name(inspectBigInt,`inspectBigInt`);function inspectRegExp(value,options){let flags=value.toString().split(`/`)[2],sourceLength=options.truncate-(2+flags.length),source=value.source;return options.stylize(`/${truncate(source,sourceLength)}/${flags}`,`regexp`)}__name(inspectRegExp,`inspectRegExp`);function arrayFromSet(set2){let values=[];return set2.forEach(value=>{values.push(value)}),values}__name(arrayFromSet,`arrayFromSet`);function inspectSet(set2,options){return set2.size===0?`Set{}`:(options.truncate-=7,`Set{ ${inspectList(arrayFromSet(set2),options)} }`)}__name(inspectSet,`inspectSet`);var stringEscapeChars=RegExp(`['\\u0000-\\u001f\\u007f-\\u009f\\u00ad\\u0600-\\u0604\\u070f\\u17b4\\u17b5\\u200c-\\u200f\\u2028-\\u202f\\u2060-\\u206f\\ufeff\\ufff0-\\uffff]`,`g`),escapeCharacters={"\b":`\\b`," ":`\\t`,"\n":`\\n`,"\f":`\\f`,"\r":`\\r`,"'":`\\'`,"\\":`\\\\`},hex=16,unicodeLength=4;function escape(char){return escapeCharacters[char]||`\\u${`0000${char.charCodeAt(0).toString(hex)}`.slice(-unicodeLength)}`}__name(escape,`escape`);function inspectString(string,options){return stringEscapeChars.test(string)&&(string=string.replace(stringEscapeChars,escape)),options.stylize(`'${truncate(string,options.truncate-2)}'`,`string`)}__name(inspectString,`inspectString`);function inspectSymbol(value){return`description`in Symbol.prototype?value.description?`Symbol(${value.description})`:`Symbol()`:value.toString()}__name(inspectSymbol,`inspectSymbol`);var promise_default=__name(()=>`Promise{…}`,`getPromiseValue`);function inspectObject(object,options){let properties=Object.getOwnPropertyNames(object),symbols=Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(object):[];if(properties.length===0&&symbols.length===0)return`{}`;if(options.truncate-=4,options.seen=options.seen||[],options.seen.includes(object))return`[Circular]`;options.seen.push(object);let propertyContents=inspectList(properties.map(key=>[key,object[key]]),options,inspectProperty),symbolContents=inspectList(symbols.map(key=>[key,object[key]]),options,inspectProperty);options.seen.pop();let sep=``;return propertyContents&&symbolContents&&(sep=`, `),`{ ${propertyContents}${sep}${symbolContents} }`}__name(inspectObject,`inspectObject`);var toStringTag=typeof Symbol<`u`&&Symbol.toStringTag?Symbol.toStringTag:!1;function inspectClass(value,options){let name=``;return toStringTag&&toStringTag in value&&(name=value[toStringTag]),name||=value.constructor.name,(!name||name===`_class`)&&(name=`<Anonymous Class>`),options.truncate-=name.length,`${name}${inspectObject(value,options)}`}__name(inspectClass,`inspectClass`);function inspectArguments(args,options){return args.length===0?`Arguments[]`:(options.truncate-=13,`Arguments[ ${inspectList(args,options)} ]`)}__name(inspectArguments,`inspectArguments`);var errorKeys=[`stack`,`line`,`column`,`name`,`message`,`fileName`,`lineNumber`,`columnNumber`,`number`,`description`,`cause`];function inspectObject2(error,options){let properties=Object.getOwnPropertyNames(error).filter(key=>errorKeys.indexOf(key)===-1),name=error.name;options.truncate-=name.length;let message=``;if(typeof error.message==`string`?message=truncate(error.message,options.truncate):properties.unshift(`message`),message=message?`: ${message}`:``,options.truncate-=message.length+5,options.seen=options.seen||[],options.seen.includes(error))return`[Circular]`;options.seen.push(error);let propertyContents=inspectList(properties.map(key=>[key,error[key]]),options,inspectProperty);return`${name}${message}${propertyContents?` { ${propertyContents} }`:``}`}__name(inspectObject2,`inspectObject`);function inspectAttribute([key,value],options){return options.truncate-=3,value?`${options.stylize(String(key),`yellow`)}=${options.stylize(`"${value}"`,`string`)}`:`${options.stylize(String(key),`yellow`)}`}__name(inspectAttribute,`inspectAttribute`);function inspectNodeCollection(collection,options){return inspectList(collection,options,inspectNode,`
70
+ `)}__name(inspectNodeCollection,`inspectNodeCollection`);function inspectNode(node,options){switch(node.nodeType){case 1:return inspectHTML(node,options);case 3:return options.inspect(node.data,options);default:return options.inspect(node,options)}}__name(inspectNode,`inspectNode`);function inspectHTML(element,options){let properties=element.getAttributeNames(),name=element.tagName.toLowerCase(),head=options.stylize(`<${name}`,`special`),headClose=options.stylize(`>`,`special`),tail=options.stylize(`</${name}>`,`special`);options.truncate-=name.length*2+5;let propertyContents=``;properties.length>0&&(propertyContents+=` `,propertyContents+=inspectList(properties.map(key=>[key,element.getAttribute(key)]),options,inspectAttribute,` `)),options.truncate-=propertyContents.length;let truncate2=options.truncate,children=inspectNodeCollection(element.children,options);return children&&children.length>truncate2&&(children=`${truncator}(${element.children.length})`),`${head}${propertyContents}${headClose}${children}${tail}`}__name(inspectHTML,`inspectHTML`);var chaiInspect=typeof Symbol==`function`&&typeof Symbol.for==`function`?Symbol.for(`chai/inspect`):`@@chai/inspect`,nodeInspect=Symbol.for(`nodejs.util.inspect.custom`),constructorMap=new WeakMap,stringTagMap={},baseTypesMap={undefined:__name((value,options)=>options.stylize(`undefined`,`undefined`),`undefined`),null:__name((value,options)=>options.stylize(`null`,`null`),`null`),boolean:__name((value,options)=>options.stylize(String(value),`boolean`),`boolean`),Boolean:__name((value,options)=>options.stylize(String(value),`boolean`),`Boolean`),number:inspectNumber,Number:inspectNumber,bigint:inspectBigInt,BigInt:inspectBigInt,string:inspectString,String:inspectString,function:inspectFunction,Function:inspectFunction,symbol:inspectSymbol,Symbol:inspectSymbol,Array:inspectArray,Date:inspectDate,Map:inspectMap,Set:inspectSet,RegExp:inspectRegExp,Promise:promise_default,WeakSet:__name((value,options)=>options.stylize(`WeakSet{…}`,`special`),`WeakSet`),WeakMap:__name((value,options)=>options.stylize(`WeakMap{…}`,`special`),`WeakMap`),Arguments:inspectArguments,Int8Array:inspectTypedArray,Uint8Array:inspectTypedArray,Uint8ClampedArray:inspectTypedArray,Int16Array:inspectTypedArray,Uint16Array:inspectTypedArray,Int32Array:inspectTypedArray,Uint32Array:inspectTypedArray,Float32Array:inspectTypedArray,Float64Array:inspectTypedArray,Generator:__name(()=>``,`Generator`),DataView:__name(()=>``,`DataView`),ArrayBuffer:__name(()=>``,`ArrayBuffer`),Error:inspectObject2,HTMLCollection:inspectNodeCollection,NodeList:inspectNodeCollection},inspectCustom=__name((value,options,type3,inspectFn)=>chaiInspect in value&&typeof value[chaiInspect]==`function`?value[chaiInspect](options):nodeInspect in value&&typeof value[nodeInspect]==`function`?value[nodeInspect](options.depth,options,inspectFn):`inspect`in value&&typeof value.inspect==`function`?value.inspect(options.depth,options):`constructor`in value&&constructorMap.has(value.constructor)?constructorMap.get(value.constructor)(value,options):stringTagMap[type3]?stringTagMap[type3](value,options):``,`inspectCustom`),toString=Object.prototype.toString;function inspect(value,opts={}){let options=normaliseOptions(opts,inspect),{customInspect}=options,type3=value===null?`null`:typeof value;if(type3===`object`&&(type3=toString.call(value).slice(8,-1)),type3 in baseTypesMap)return baseTypesMap[type3](value,options);if(customInspect&&value){let output=inspectCustom(value,options,type3,inspect);if(output)return typeof output==`string`?output:inspect(output,options)}let proto=value?Object.getPrototypeOf(value):!1;return proto===Object.prototype||proto===null?inspectObject(value,options):value&&typeof HTMLElement==`function`&&value instanceof HTMLElement?inspectHTML(value,options):`constructor`in value?value.constructor===Object?inspectObject(value,options):inspectClass(value,options):value===Object(value)?inspectObject(value,options):options.stylize(String(value),type3)}__name(inspect,`inspect`);var config={includeStack:!1,showDiff:!0,truncateThreshold:40,useProxy:!0,proxyExcludedKeys:[`then`,`catch`,`inspect`,`toJSON`],deepEqual:null};function inspect2(obj,showHidden,depth,colors){return inspect(obj,{colors,depth:depth===void 0?2:depth,showHidden,truncate:config.truncateThreshold?config.truncateThreshold:1/0})}__name(inspect2,`inspect`);function objDisplay(obj){let str=inspect2(obj),type3=Object.prototype.toString.call(obj);if(config.truncateThreshold&&str.length>=config.truncateThreshold){if(type3===`[object Function]`)return!obj.name||obj.name===``?`[Function]`:`[Function: `+obj.name+`]`;if(type3===`[object Array]`)return`[ Array(`+obj.length+`) ]`;if(type3===`[object Object]`){let keys=Object.keys(obj);return`{ Object (`+(keys.length>2?keys.splice(0,2).join(`, `)+`, ...`:keys.join(`, `))+`) }`}return str}return str}__name(objDisplay,`objDisplay`);function getMessage2(obj,args){let negate=flag(obj,`negate`),val=flag(obj,`object`),expected=args[3],actual=getActual(obj,args),msg=negate?args[2]:args[1],flagMsg=flag(obj,`message`);return typeof msg==`function`&&(msg=msg()),msg||=``,msg=msg.replace(/#\{this\}/g,function(){return objDisplay(val)}).replace(/#\{act\}/g,function(){return objDisplay(actual)}).replace(/#\{exp\}/g,function(){return objDisplay(expected)}),flagMsg?flagMsg+`: `+msg:msg}__name(getMessage2,`getMessage`);function transferFlags(assertion,object,includeAll){let flags=assertion.__flags||=Object.create(null);object.__flags||=Object.create(null),includeAll=arguments.length!==3||includeAll;for(let flag3 in flags)(includeAll||flag3!==`object`&&flag3!==`ssfi`&&flag3!==`lockSsfi`&&flag3!=`message`)&&(object.__flags[flag3]=flags[flag3])}__name(transferFlags,`transferFlags`);function type2(obj){if(obj===void 0)return`undefined`;if(obj===null)return`null`;let stringTag=obj[Symbol.toStringTag];return typeof stringTag==`string`?stringTag:Object.prototype.toString.call(obj).slice(8,-1)}__name(type2,`type`);function FakeMap(){this._key=`chai/deep-eql__`+Math.random()+Date.now()}__name(FakeMap,`FakeMap`),FakeMap.prototype={get:__name(function(key){return key[this._key]},`get`),set:__name(function(key,value){Object.isExtensible(key)&&Object.defineProperty(key,this._key,{value,configurable:!0})},`set`)};var MemoizeMap=typeof WeakMap==`function`?WeakMap:FakeMap;function memoizeCompare(leftHandOperand,rightHandOperand,memoizeMap){if(!memoizeMap||isPrimitive(leftHandOperand)||isPrimitive(rightHandOperand))return null;var leftHandMap=memoizeMap.get(leftHandOperand);if(leftHandMap){var result=leftHandMap.get(rightHandOperand);if(typeof result==`boolean`)return result}return null}__name(memoizeCompare,`memoizeCompare`);function memoizeSet(leftHandOperand,rightHandOperand,memoizeMap,result){if(!(!memoizeMap||isPrimitive(leftHandOperand)||isPrimitive(rightHandOperand))){var leftHandMap=memoizeMap.get(leftHandOperand);leftHandMap?leftHandMap.set(rightHandOperand,result):(leftHandMap=new MemoizeMap,leftHandMap.set(rightHandOperand,result),memoizeMap.set(leftHandOperand,leftHandMap))}}__name(memoizeSet,`memoizeSet`);var deep_eql_default=deepEqual;function deepEqual(leftHandOperand,rightHandOperand,options){if(options&&options.comparator)return extensiveDeepEqual(leftHandOperand,rightHandOperand,options);var simpleResult=simpleEqual(leftHandOperand,rightHandOperand);return simpleResult===null?extensiveDeepEqual(leftHandOperand,rightHandOperand,options):simpleResult}__name(deepEqual,`deepEqual`);function simpleEqual(leftHandOperand,rightHandOperand){return leftHandOperand===rightHandOperand?leftHandOperand!==0||1/leftHandOperand==1/rightHandOperand:leftHandOperand!==leftHandOperand&&rightHandOperand!==rightHandOperand?!0:isPrimitive(leftHandOperand)||isPrimitive(rightHandOperand)?!1:null}__name(simpleEqual,`simpleEqual`);function extensiveDeepEqual(leftHandOperand,rightHandOperand,options){options||={},options.memoize=options.memoize===!1?!1:options.memoize||new MemoizeMap;var comparator=options&&options.comparator,memoizeResultLeft=memoizeCompare(leftHandOperand,rightHandOperand,options.memoize);if(memoizeResultLeft!==null)return memoizeResultLeft;var memoizeResultRight=memoizeCompare(rightHandOperand,leftHandOperand,options.memoize);if(memoizeResultRight!==null)return memoizeResultRight;if(comparator){var comparatorResult=comparator(leftHandOperand,rightHandOperand);if(comparatorResult===!1||comparatorResult===!0)return memoizeSet(leftHandOperand,rightHandOperand,options.memoize,comparatorResult),comparatorResult;var simpleResult=simpleEqual(leftHandOperand,rightHandOperand);if(simpleResult!==null)return simpleResult}var leftHandType=type2(leftHandOperand);if(leftHandType!==type2(rightHandOperand))return memoizeSet(leftHandOperand,rightHandOperand,options.memoize,!1),!1;memoizeSet(leftHandOperand,rightHandOperand,options.memoize,!0);var result=extensiveDeepEqualByType(leftHandOperand,rightHandOperand,leftHandType,options);return memoizeSet(leftHandOperand,rightHandOperand,options.memoize,result),result}__name(extensiveDeepEqual,`extensiveDeepEqual`);function extensiveDeepEqualByType(leftHandOperand,rightHandOperand,leftHandType,options){switch(leftHandType){case`String`:case`Number`:case`Boolean`:case`Date`:return deepEqual(leftHandOperand.valueOf(),rightHandOperand.valueOf());case`Promise`:case`Symbol`:case`function`:case`WeakMap`:case`WeakSet`:return leftHandOperand===rightHandOperand;case`Error`:return keysEqual(leftHandOperand,rightHandOperand,[`name`,`message`,`code`],options);case`Arguments`:case`Int8Array`:case`Uint8Array`:case`Uint8ClampedArray`:case`Int16Array`:case`Uint16Array`:case`Int32Array`:case`Uint32Array`:case`Float32Array`:case`Float64Array`:case`Array`:return iterableEqual(leftHandOperand,rightHandOperand,options);case`RegExp`:return regexpEqual(leftHandOperand,rightHandOperand);case`Generator`:return generatorEqual(leftHandOperand,rightHandOperand,options);case`DataView`:return iterableEqual(new Uint8Array(leftHandOperand.buffer),new Uint8Array(rightHandOperand.buffer),options);case`ArrayBuffer`:return iterableEqual(new Uint8Array(leftHandOperand),new Uint8Array(rightHandOperand),options);case`Set`:return entriesEqual(leftHandOperand,rightHandOperand,options);case`Map`:return entriesEqual(leftHandOperand,rightHandOperand,options);case`Temporal.PlainDate`:case`Temporal.PlainTime`:case`Temporal.PlainDateTime`:case`Temporal.Instant`:case`Temporal.ZonedDateTime`:case`Temporal.PlainYearMonth`:case`Temporal.PlainMonthDay`:return leftHandOperand.equals(rightHandOperand);case`Temporal.Duration`:return leftHandOperand.total(`nanoseconds`)===rightHandOperand.total(`nanoseconds`);case`Temporal.TimeZone`:case`Temporal.Calendar`:return leftHandOperand.toString()===rightHandOperand.toString();default:return objectEqual(leftHandOperand,rightHandOperand,options)}}__name(extensiveDeepEqualByType,`extensiveDeepEqualByType`);function regexpEqual(leftHandOperand,rightHandOperand){return leftHandOperand.toString()===rightHandOperand.toString()}__name(regexpEqual,`regexpEqual`);function entriesEqual(leftHandOperand,rightHandOperand,options){try{if(leftHandOperand.size!==rightHandOperand.size)return!1;if(leftHandOperand.size===0)return!0}catch{return!1}var leftHandItems=[],rightHandItems=[];return leftHandOperand.forEach(__name(function(key,value){leftHandItems.push([key,value])},`gatherEntries`)),rightHandOperand.forEach(__name(function(key,value){rightHandItems.push([key,value])},`gatherEntries`)),iterableEqual(leftHandItems.sort(),rightHandItems.sort(),options)}__name(entriesEqual,`entriesEqual`);function iterableEqual(leftHandOperand,rightHandOperand,options){var length=leftHandOperand.length;if(length!==rightHandOperand.length)return!1;if(length===0)return!0;for(var index=-1;++index<length;)if(deepEqual(leftHandOperand[index],rightHandOperand[index],options)===!1)return!1;return!0}__name(iterableEqual,`iterableEqual`);function generatorEqual(leftHandOperand,rightHandOperand,options){return iterableEqual(getGeneratorEntries(leftHandOperand),getGeneratorEntries(rightHandOperand),options)}__name(generatorEqual,`generatorEqual`);function hasIteratorFunction(target){return typeof Symbol<`u`&&typeof target==`object`&&Symbol.iterator!==void 0&&typeof target[Symbol.iterator]==`function`}__name(hasIteratorFunction,`hasIteratorFunction`);function getIteratorEntries(target){if(hasIteratorFunction(target))try{return getGeneratorEntries(target[Symbol.iterator]())}catch{return[]}return[]}__name(getIteratorEntries,`getIteratorEntries`);function getGeneratorEntries(generator){for(var generatorResult=generator.next(),accumulator=[generatorResult.value];generatorResult.done===!1;)generatorResult=generator.next(),accumulator.push(generatorResult.value);return accumulator}__name(getGeneratorEntries,`getGeneratorEntries`);function getEnumerableKeys(target){var keys=[];for(var key in target)keys.push(key);return keys}__name(getEnumerableKeys,`getEnumerableKeys`);function getEnumerableSymbols(target){for(var keys=[],allKeys=Object.getOwnPropertySymbols(target),i=0;i<allKeys.length;i+=1){var key=allKeys[i];Object.getOwnPropertyDescriptor(target,key).enumerable&&keys.push(key)}return keys}__name(getEnumerableSymbols,`getEnumerableSymbols`);function keysEqual(leftHandOperand,rightHandOperand,keys,options){var length=keys.length;if(length===0)return!0;for(var i=0;i<length;i+=1)if(deepEqual(leftHandOperand[keys[i]],rightHandOperand[keys[i]],options)===!1)return!1;return!0}__name(keysEqual,`keysEqual`);function objectEqual(leftHandOperand,rightHandOperand,options){var leftHandKeys=getEnumerableKeys(leftHandOperand),rightHandKeys=getEnumerableKeys(rightHandOperand),leftHandSymbols=getEnumerableSymbols(leftHandOperand),rightHandSymbols=getEnumerableSymbols(rightHandOperand);if(leftHandKeys=leftHandKeys.concat(leftHandSymbols),rightHandKeys=rightHandKeys.concat(rightHandSymbols),leftHandKeys.length&&leftHandKeys.length===rightHandKeys.length)return iterableEqual(mapSymbols(leftHandKeys).sort(),mapSymbols(rightHandKeys).sort())!==!1&&keysEqual(leftHandOperand,rightHandOperand,leftHandKeys,options);var leftHandEntries=getIteratorEntries(leftHandOperand),rightHandEntries=getIteratorEntries(rightHandOperand);return leftHandEntries.length&&leftHandEntries.length===rightHandEntries.length?(leftHandEntries.sort(),rightHandEntries.sort(),iterableEqual(leftHandEntries,rightHandEntries,options)):leftHandKeys.length===0&&leftHandEntries.length===0&&rightHandKeys.length===0&&rightHandEntries.length===0}__name(objectEqual,`objectEqual`);function isPrimitive(value){return typeof value!=`object`||!value}__name(isPrimitive,`isPrimitive`);function mapSymbols(arr){return arr.map(__name(function(entry){return typeof entry==`symbol`?entry.toString():entry},`mapSymbol`))}__name(mapSymbols,`mapSymbols`);function hasProperty(obj,name){return obj!=null&&name in Object(obj)}__name(hasProperty,`hasProperty`);function parsePath(path){return path.replace(/([^\\])\[/g,`$1.[`).match(/(\\\.|[^.]+?)+/g).map(value=>{if(value===`constructor`||value===`__proto__`||value===`prototype`)return{};let mArr=/^\[(\d+)\]$/.exec(value),parsed=null;return parsed=mArr?{i:parseFloat(mArr[1])}:{p:value.replace(/\\([.[\]])/g,`$1`)},parsed})}__name(parsePath,`parsePath`);function internalGetPathValue(obj,parsed,pathDepth){let temporaryValue=obj,res=null;pathDepth=pathDepth===void 0?parsed.length:pathDepth;for(let i=0;i<pathDepth;i++){let part=parsed[i];temporaryValue&&(temporaryValue=part.p===void 0?temporaryValue[part.i]:temporaryValue[part.p],i===pathDepth-1&&(res=temporaryValue))}return res}__name(internalGetPathValue,`internalGetPathValue`);function getPathInfo(obj,path){let parsed=parsePath(path),last=parsed[parsed.length-1],info={parent:parsed.length>1?internalGetPathValue(obj,parsed,parsed.length-1):obj,name:last.p||last.i,value:internalGetPathValue(obj,parsed)};return info.exists=hasProperty(info.parent,info.name),info}__name(getPathInfo,`getPathInfo`);var _Assertion=class _Assertion{constructor(obj,msg,ssfi,lockSsfi){return __publicField(this,`__flags`,{}),flag(this,`ssfi`,ssfi||_Assertion),flag(this,`lockSsfi`,lockSsfi),flag(this,`object`,obj),flag(this,`message`,msg),flag(this,`eql`,config.deepEqual||deep_eql_default),proxify(this)}static get includeStack(){return console.warn(`Assertion.includeStack is deprecated, use chai.config.includeStack instead.`),config.includeStack}static set includeStack(value){console.warn(`Assertion.includeStack is deprecated, use chai.config.includeStack instead.`),config.includeStack=value}static get showDiff(){return console.warn(`Assertion.showDiff is deprecated, use chai.config.showDiff instead.`),config.showDiff}static set showDiff(value){console.warn(`Assertion.showDiff is deprecated, use chai.config.showDiff instead.`),config.showDiff=value}static addProperty(name,fn){addProperty(this.prototype,name,fn)}static addMethod(name,fn){addMethod(this.prototype,name,fn)}static addChainableMethod(name,fn,chainingBehavior){addChainableMethod(this.prototype,name,fn,chainingBehavior)}static overwriteProperty(name,fn){overwriteProperty(this.prototype,name,fn)}static overwriteMethod(name,fn){overwriteMethod(this.prototype,name,fn)}static overwriteChainableMethod(name,fn,chainingBehavior){overwriteChainableMethod(this.prototype,name,fn,chainingBehavior)}assert(_expr,msg,_negateMsg,expected,_actual,showDiff){let ok=test$1(this,arguments);if(!1!==showDiff&&(showDiff=!0),expected===void 0&&_actual===void 0&&(showDiff=!1),!0!==config.showDiff&&(showDiff=!1),!ok){msg=getMessage2(this,arguments);let assertionErrorObjectProperties={actual:getActual(this,arguments),expected,showDiff},operator=getOperator(this,arguments);throw operator&&(assertionErrorObjectProperties.operator=operator),new AssertionError(msg,assertionErrorObjectProperties,config.includeStack?this.assert:flag(this,`ssfi`))}}get _obj(){return flag(this,`object`)}set _obj(val){flag(this,`object`,val)}};__name(_Assertion,`Assertion`);var Assertion=_Assertion,events=new EventTarget,_PluginEvent=class extends Event{constructor(type3,name,fn){super(type3),this.name=String(name),this.fn=fn}};__name(_PluginEvent,`PluginEvent`);var PluginEvent=_PluginEvent;function isProxyEnabled(){return config.useProxy&&typeof Proxy<`u`&&typeof Reflect<`u`}__name(isProxyEnabled,`isProxyEnabled`);function addProperty(ctx,name,getter){getter=getter===void 0?function(){}:getter,Object.defineProperty(ctx,name,{get:__name(function propertyGetter(){!isProxyEnabled()&&!flag(this,`lockSsfi`)&&flag(this,`ssfi`,propertyGetter);let result=getter.call(this);if(result!==void 0)return result;let newAssertion=new Assertion;return transferFlags(this,newAssertion),newAssertion},`propertyGetter`),configurable:!0}),events.dispatchEvent(new PluginEvent(`addProperty`,name,getter))}__name(addProperty,`addProperty`);var fnLengthDesc=Object.getOwnPropertyDescriptor(function(){},`length`);function addLengthGuard(fn,assertionName,isChainable){return fnLengthDesc.configurable&&Object.defineProperty(fn,"length",{get:__name(function(){throw Error(isChainable?`Invalid Chai property: `+assertionName+`.length. Due to a compatibility issue, "length" cannot directly follow "`+assertionName+`". Use "`+assertionName+`.lengthOf" instead.`:`Invalid Chai property: `+assertionName+`.length. See docs for proper usage of "`+assertionName+`".`)},`get`)}),fn}__name(addLengthGuard,`addLengthGuard`);function getProperties(object){let result=Object.getOwnPropertyNames(object);function addProperty2(property){result.indexOf(property)===-1&&result.push(property)}__name(addProperty2,`addProperty`);let proto=Object.getPrototypeOf(object);for(;proto!==null;)Object.getOwnPropertyNames(proto).forEach(addProperty2),proto=Object.getPrototypeOf(proto);return result}__name(getProperties,`getProperties`);var builtins=[`__flags`,`__methods`,`_obj`,`assert`];function proxify(obj,nonChainableMethodName){return isProxyEnabled()?new Proxy(obj,{get:__name(function proxyGetter(target,property){if(typeof property==`string`&&config.proxyExcludedKeys.indexOf(property)===-1&&!Reflect.has(target,property)){if(nonChainableMethodName)throw Error(`Invalid Chai property: `+nonChainableMethodName+`.`+property+`. See docs for proper usage of "`+nonChainableMethodName+`".`);let suggestion=null,suggestionDistance=4;throw getProperties(target).forEach(function(prop){if(!Object.prototype.hasOwnProperty(prop)&&builtins.indexOf(prop)===-1){let dist=stringDistanceCapped(property,prop,suggestionDistance);dist<suggestionDistance&&(suggestion=prop,suggestionDistance=dist)}}),Error(suggestion===null?`Invalid Chai property: `+property:`Invalid Chai property: `+property+`. Did you mean "`+suggestion+`"?`)}return builtins.indexOf(property)===-1&&!flag(target,`lockSsfi`)&&flag(target,`ssfi`,proxyGetter),Reflect.get(target,property)},`proxyGetter`)}):obj}__name(proxify,`proxify`);function stringDistanceCapped(strA,strB,cap){if(Math.abs(strA.length-strB.length)>=cap)return cap;let memo=[];for(let i=0;i<=strA.length;i++)memo[i]=Array(strB.length+1).fill(0),memo[i][0]=i;for(let j=0;j<strB.length;j++)memo[0][j]=j;for(let i=1;i<=strA.length;i++){let ch=strA.charCodeAt(i-1);for(let j=1;j<=strB.length;j++){if(Math.abs(i-j)>=cap){memo[i][j]=cap;continue}memo[i][j]=Math.min(memo[i-1][j]+1,memo[i][j-1]+1,memo[i-1][j-1]+(ch===strB.charCodeAt(j-1)?0:1))}}return memo[strA.length][strB.length]}__name(stringDistanceCapped,`stringDistanceCapped`);function addMethod(ctx,name,method){let methodWrapper=__name(function(){flag(this,`lockSsfi`)||flag(this,`ssfi`,methodWrapper);let result=method.apply(this,arguments);if(result!==void 0)return result;let newAssertion=new Assertion;return transferFlags(this,newAssertion),newAssertion},`methodWrapper`);addLengthGuard(methodWrapper,name,!1),ctx[name]=proxify(methodWrapper,name),events.dispatchEvent(new PluginEvent(`addMethod`,name,method))}__name(addMethod,`addMethod`);function overwriteProperty(ctx,name,getter){let _get=Object.getOwnPropertyDescriptor(ctx,name),_super=__name(function(){},`_super`);_get&&typeof _get.get==`function`&&(_super=_get.get),Object.defineProperty(ctx,name,{get:__name(function overwritingPropertyGetter(){!isProxyEnabled()&&!flag(this,`lockSsfi`)&&flag(this,`ssfi`,overwritingPropertyGetter);let origLockSsfi=flag(this,`lockSsfi`);flag(this,`lockSsfi`,!0);let result=getter(_super).call(this);if(flag(this,`lockSsfi`,origLockSsfi),result!==void 0)return result;let newAssertion=new Assertion;return transferFlags(this,newAssertion),newAssertion},`overwritingPropertyGetter`),configurable:!0})}__name(overwriteProperty,`overwriteProperty`);function overwriteMethod(ctx,name,method){let _method=ctx[name],_super=__name(function(){throw Error(name+` is not a function`)},`_super`);_method&&typeof _method==`function`&&(_super=_method);let overwritingMethodWrapper=__name(function(){flag(this,`lockSsfi`)||flag(this,`ssfi`,overwritingMethodWrapper);let origLockSsfi=flag(this,`lockSsfi`);flag(this,`lockSsfi`,!0);let result=method(_super).apply(this,arguments);if(flag(this,`lockSsfi`,origLockSsfi),result!==void 0)return result;let newAssertion=new Assertion;return transferFlags(this,newAssertion),newAssertion},`overwritingMethodWrapper`);addLengthGuard(overwritingMethodWrapper,name,!1),ctx[name]=proxify(overwritingMethodWrapper,name)}__name(overwriteMethod,`overwriteMethod`);var canSetPrototype=typeof Object.setPrototypeOf==`function`,testFn=__name(function(){},`testFn`),excludeNames=Object.getOwnPropertyNames(testFn).filter(function(name){let propDesc=Object.getOwnPropertyDescriptor(testFn,name);return typeof propDesc!=`object`||!propDesc.configurable}),call=Function.prototype.call,apply=Function.prototype.apply,_PluginAddChainableMethodEvent=class extends PluginEvent{constructor(type3,name,fn,chainingBehavior){super(type3,name,fn),this.chainingBehavior=chainingBehavior}};__name(_PluginAddChainableMethodEvent,`PluginAddChainableMethodEvent`);var PluginAddChainableMethodEvent=_PluginAddChainableMethodEvent;function addChainableMethod(ctx,name,method,chainingBehavior){typeof chainingBehavior!=`function`&&(chainingBehavior=__name(function(){},`chainingBehavior`));let chainableBehavior={method,chainingBehavior};ctx.__methods||={},ctx.__methods[name]=chainableBehavior,Object.defineProperty(ctx,name,{get:__name(function(){chainableBehavior.chainingBehavior.call(this);let chainableMethodWrapper=__name(function(){flag(this,`lockSsfi`)||flag(this,`ssfi`,chainableMethodWrapper);let result=chainableBehavior.method.apply(this,arguments);if(result!==void 0)return result;let newAssertion=new Assertion;return transferFlags(this,newAssertion),newAssertion},`chainableMethodWrapper`);if(addLengthGuard(chainableMethodWrapper,name,!0),canSetPrototype){let prototype=Object.create(this);prototype.call=call,prototype.apply=apply,Object.setPrototypeOf(chainableMethodWrapper,prototype)}else Object.getOwnPropertyNames(ctx).forEach(function(asserterName){if(excludeNames.indexOf(asserterName)!==-1)return;let pd=Object.getOwnPropertyDescriptor(ctx,asserterName);Object.defineProperty(chainableMethodWrapper,asserterName,pd)});return transferFlags(this,chainableMethodWrapper),proxify(chainableMethodWrapper)},`chainableMethodGetter`),configurable:!0}),events.dispatchEvent(new PluginAddChainableMethodEvent(`addChainableMethod`,name,method,chainingBehavior))}__name(addChainableMethod,`addChainableMethod`);function overwriteChainableMethod(ctx,name,method,chainingBehavior){let chainableBehavior=ctx.__methods[name],_chainingBehavior=chainableBehavior.chainingBehavior;chainableBehavior.chainingBehavior=__name(function(){let result=chainingBehavior(_chainingBehavior).call(this);if(result!==void 0)return result;let newAssertion=new Assertion;return transferFlags(this,newAssertion),newAssertion},`overwritingChainableMethodGetter`);let _method=chainableBehavior.method;chainableBehavior.method=__name(function(){let result=method(_method).apply(this,arguments);if(result!==void 0)return result;let newAssertion=new Assertion;return transferFlags(this,newAssertion),newAssertion},`overwritingChainableMethodWrapper`)}__name(overwriteChainableMethod,`overwriteChainableMethod`);function compareByInspect(a,b){return inspect2(a)<inspect2(b)?-1:1}__name(compareByInspect,`compareByInspect`);function getOwnEnumerablePropertySymbols(obj){return typeof Object.getOwnPropertySymbols==`function`?Object.getOwnPropertySymbols(obj).filter(function(sym){return Object.getOwnPropertyDescriptor(obj,sym).enumerable}):[]}__name(getOwnEnumerablePropertySymbols,`getOwnEnumerablePropertySymbols`);function getOwnEnumerableProperties(obj){return Object.keys(obj).concat(getOwnEnumerablePropertySymbols(obj))}__name(getOwnEnumerableProperties,`getOwnEnumerableProperties`);var isNaN2=Number.isNaN;function isObjectType(obj){let objectType=type(obj);return[`Array`,`Object`,`Function`].indexOf(objectType)!==-1}__name(isObjectType,`isObjectType`);function getOperator(obj,args){let operator=flag(obj,`operator`),negate=flag(obj,`negate`),expected=args[3],msg=negate?args[2]:args[1];if(operator)return operator;if(typeof msg==`function`&&(msg=msg()),msg||=``,!msg||/\shave\s/.test(msg))return;let isObject=isObjectType(expected);return/\snot\s/.test(msg)?isObject?`notDeepStrictEqual`:`notStrictEqual`:isObject?`deepStrictEqual`:`strictEqual`}__name(getOperator,`getOperator`);function getName(fn){return fn.name}__name(getName,`getName`);function isRegExp2(obj){return Object.prototype.toString.call(obj)===`[object RegExp]`}__name(isRegExp2,`isRegExp`);function isNumeric(obj){return[`Number`,`BigInt`].includes(type(obj))}__name(isNumeric,`isNumeric`);var{flag:flag2}=utils_exports;[`to`,`be`,`been`,`is`,`and`,`has`,`have`,`with`,`that`,`which`,`at`,`of`,`same`,`but`,`does`,`still`,`also`].forEach(function(chain){Assertion.addProperty(chain)}),Assertion.addProperty(`not`,function(){flag2(this,`negate`,!0)}),Assertion.addProperty(`deep`,function(){flag2(this,`deep`,!0)}),Assertion.addProperty(`nested`,function(){flag2(this,`nested`,!0)}),Assertion.addProperty(`own`,function(){flag2(this,`own`,!0)}),Assertion.addProperty(`ordered`,function(){flag2(this,`ordered`,!0)}),Assertion.addProperty(`any`,function(){flag2(this,`any`,!0),flag2(this,`all`,!1)}),Assertion.addProperty(`all`,function(){flag2(this,`all`,!0),flag2(this,`any`,!1)});var functionTypes={function:[`function`,`asyncfunction`,`generatorfunction`,`asyncgeneratorfunction`],asyncfunction:[`asyncfunction`,`asyncgeneratorfunction`],generatorfunction:[`generatorfunction`,`asyncgeneratorfunction`],asyncgeneratorfunction:[`asyncgeneratorfunction`]};function an(type3,msg){msg&&flag2(this,`message`,msg),type3=type3.toLowerCase();let obj=flag2(this,`object`),article=~[`a`,`e`,`i`,`o`,`u`].indexOf(type3.charAt(0))?`an `:`a `,detectedType=type(obj).toLowerCase();functionTypes.function.includes(type3)?this.assert(functionTypes[type3].includes(detectedType),`expected #{this} to be `+article+type3,`expected #{this} not to be `+article+type3):this.assert(type3===detectedType,`expected #{this} to be `+article+type3,`expected #{this} not to be `+article+type3)}__name(an,`an`),Assertion.addChainableMethod(`an`,an),Assertion.addChainableMethod(`a`,an);function SameValueZero(a,b){return isNaN2(a)&&isNaN2(b)||a===b}__name(SameValueZero,`SameValueZero`);function includeChainingBehavior(){flag2(this,`contains`,!0)}__name(includeChainingBehavior,`includeChainingBehavior`);function include(val,msg){msg&&flag2(this,`message`,msg);let obj=flag2(this,`object`),objType=type(obj).toLowerCase(),flagMsg=flag2(this,`message`),negate=flag2(this,`negate`),ssfi=flag2(this,`ssfi`),isDeep=flag2(this,`deep`),descriptor=isDeep?`deep `:``,isEql=isDeep?flag2(this,`eql`):SameValueZero;flagMsg=flagMsg?flagMsg+`: `:``;let included=!1;switch(objType){case`string`:included=obj.indexOf(val)!==-1;break;case`weakset`:if(isDeep)throw new AssertionError(flagMsg+`unable to use .deep.include with WeakSet`,void 0,ssfi);included=obj.has(val);break;case`map`:obj.forEach(function(item){included||=isEql(item,val)});break;case`set`:isDeep?obj.forEach(function(item){included||=isEql(item,val)}):included=obj.has(val);break;case`array`:included=isDeep?obj.some(function(item){return isEql(item,val)}):obj.indexOf(val)!==-1;break;default:{if(val!==Object(val))throw new AssertionError(flagMsg+`the given combination of arguments (`+objType+` and `+type(val).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 `+type(val).toLowerCase(),void 0,ssfi);let props=Object.keys(val),firstErr=null,numErrs=0;if(props.forEach(function(prop){let propAssertion=new Assertion(obj);if(transferFlags(this,propAssertion,!0),flag2(propAssertion,`lockSsfi`,!0),!negate||props.length===1){propAssertion.property(prop,val[prop]);return}try{propAssertion.property(prop,val[prop])}catch(err){if(!check_error_exports.compatibleConstructor(err,AssertionError))throw err;firstErr===null&&(firstErr=err),numErrs++}},this),negate&&props.length>1&&numErrs===props.length)throw firstErr;return}}this.assert(included,`expected #{this} to `+descriptor+`include `+inspect2(val),`expected #{this} to not `+descriptor+`include `+inspect2(val))}__name(include,`include`),Assertion.addChainableMethod(`include`,include,includeChainingBehavior),Assertion.addChainableMethod(`contain`,include,includeChainingBehavior),Assertion.addChainableMethod(`contains`,include,includeChainingBehavior),Assertion.addChainableMethod(`includes`,include,includeChainingBehavior),Assertion.addProperty(`ok`,function(){this.assert(flag2(this,`object`),`expected #{this} to be truthy`,`expected #{this} to be falsy`)}),Assertion.addProperty(`true`,function(){this.assert(!0===flag2(this,`object`),`expected #{this} to be true`,`expected #{this} to be false`,!flag2(this,`negate`))}),Assertion.addProperty(`numeric`,function(){let object=flag2(this,`object`);this.assert([`Number`,`BigInt`].includes(type(object)),`expected #{this} to be numeric`,`expected #{this} to not be numeric`,!flag2(this,`negate`))}),Assertion.addProperty(`callable`,function(){let val=flag2(this,`object`),ssfi=flag2(this,`ssfi`),message=flag2(this,`message`),msg=message?`${message}: `:``,negate=flag2(this,`negate`),assertionMessage=negate?`${msg}expected ${inspect2(val)} not to be a callable function`:`${msg}expected ${inspect2(val)} to be a callable function`,isCallable=[`Function`,`AsyncFunction`,`GeneratorFunction`,`AsyncGeneratorFunction`].includes(type(val));if(isCallable&&negate||!isCallable&&!negate)throw new AssertionError(assertionMessage,void 0,ssfi)}),Assertion.addProperty(`false`,function(){this.assert(!1===flag2(this,`object`),`expected #{this} to be false`,`expected #{this} to be true`,!!flag2(this,`negate`))}),Assertion.addProperty(`null`,function(){this.assert(flag2(this,`object`)===null,`expected #{this} to be null`,`expected #{this} not to be null`)}),Assertion.addProperty(`undefined`,function(){this.assert(flag2(this,`object`)===void 0,`expected #{this} to be undefined`,`expected #{this} not to be undefined`)}),Assertion.addProperty(`NaN`,function(){this.assert(isNaN2(flag2(this,`object`)),`expected #{this} to be NaN`,`expected #{this} not to be NaN`)});function assertExist(){let val=flag2(this,`object`);this.assert(val!=null,`expected #{this} to exist`,`expected #{this} to not exist`)}__name(assertExist,`assertExist`),Assertion.addProperty(`exist`,assertExist),Assertion.addProperty(`exists`,assertExist),Assertion.addProperty(`empty`,function(){let val=flag2(this,`object`),ssfi=flag2(this,`ssfi`),flagMsg=flag2(this,`message`),itemsCount;switch(flagMsg=flagMsg?flagMsg+`: `:``,type(val).toLowerCase()){case`array`:case`string`:itemsCount=val.length;break;case`map`:case`set`:itemsCount=val.size;break;case`weakmap`:case`weakset`:throw new AssertionError(flagMsg+`.empty was passed a weak collection`,void 0,ssfi);case`function`:throw new AssertionError((flagMsg+`.empty was passed a function `+getName(val)).trim(),void 0,ssfi);default:if(val!==Object(val))throw new AssertionError(flagMsg+`.empty was passed non-string primitive `+inspect2(val),void 0,ssfi);itemsCount=Object.keys(val).length}this.assert(itemsCount===0,`expected #{this} to be empty`,`expected #{this} not to be empty`)});function checkArguments(){let type3=type(flag2(this,`object`));this.assert(type3===`Arguments`,`expected #{this} to be arguments but got `+type3,`expected #{this} to not be arguments`)}__name(checkArguments,`checkArguments`),Assertion.addProperty(`arguments`,checkArguments),Assertion.addProperty(`Arguments`,checkArguments);function assertEqual(val,msg){msg&&flag2(this,`message`,msg);let obj=flag2(this,`object`);if(flag2(this,`deep`)){let prevLockSsfi=flag2(this,`lockSsfi`);flag2(this,`lockSsfi`,!0),this.eql(val),flag2(this,`lockSsfi`,prevLockSsfi)}else this.assert(val===obj,`expected #{this} to equal #{exp}`,`expected #{this} to not equal #{exp}`,val,this._obj,!0)}__name(assertEqual,`assertEqual`),Assertion.addMethod(`equal`,assertEqual),Assertion.addMethod(`equals`,assertEqual),Assertion.addMethod(`eq`,assertEqual);function assertEql(obj,msg){msg&&flag2(this,`message`,msg);let eql=flag2(this,`eql`);this.assert(eql(obj,flag2(this,`object`)),`expected #{this} to deeply equal #{exp}`,`expected #{this} to not deeply equal #{exp}`,obj,this._obj,!0)}__name(assertEql,`assertEql`),Assertion.addMethod(`eql`,assertEql),Assertion.addMethod(`eqls`,assertEql);function assertAbove(n,msg){msg&&flag2(this,`message`,msg);let obj=flag2(this,`object`),doLength=flag2(this,`doLength`),flagMsg=flag2(this,`message`),msgPrefix=flagMsg?flagMsg+`: `:``,ssfi=flag2(this,`ssfi`),objType=type(obj).toLowerCase(),nType=type(n).toLowerCase();if(doLength&&objType!==`map`&&objType!==`set`&&new Assertion(obj,flagMsg,ssfi,!0).to.have.property(`length`),!doLength&&objType===`date`&&nType!==`date`)throw new AssertionError(msgPrefix+`the argument to above must be a date`,void 0,ssfi);if(!isNumeric(n)&&(doLength||isNumeric(obj)))throw new AssertionError(msgPrefix+`the argument to above must be a number`,void 0,ssfi);if(!doLength&&objType!==`date`&&!isNumeric(obj)){let printObj=objType===`string`?`'`+obj+`'`:obj;throw new AssertionError(msgPrefix+`expected `+printObj+` to be a number or a date`,void 0,ssfi)}if(doLength){let descriptor=`length`,itemsCount;objType===`map`||objType===`set`?(descriptor=`size`,itemsCount=obj.size):itemsCount=obj.length,this.assert(itemsCount>n,`expected #{this} to have a `+descriptor+` above #{exp} but got #{act}`,`expected #{this} to not have a `+descriptor+` above #{exp}`,n,itemsCount)}else this.assert(obj>n,`expected #{this} to be above #{exp}`,`expected #{this} to be at most #{exp}`,n)}__name(assertAbove,`assertAbove`),Assertion.addMethod(`above`,assertAbove),Assertion.addMethod(`gt`,assertAbove),Assertion.addMethod(`greaterThan`,assertAbove);function assertLeast(n,msg){msg&&flag2(this,`message`,msg);let obj=flag2(this,`object`),doLength=flag2(this,`doLength`),flagMsg=flag2(this,`message`),msgPrefix=flagMsg?flagMsg+`: `:``,ssfi=flag2(this,`ssfi`),objType=type(obj).toLowerCase(),nType=type(n).toLowerCase(),errorMessage,shouldThrow=!0;if(doLength&&objType!==`map`&&objType!==`set`&&new Assertion(obj,flagMsg,ssfi,!0).to.have.property(`length`),!doLength&&objType===`date`&&nType!==`date`)errorMessage=msgPrefix+`the argument to least must be a date`;else if(!isNumeric(n)&&(doLength||isNumeric(obj)))errorMessage=msgPrefix+`the argument to least must be a number`;else if(!doLength&&objType!==`date`&&!isNumeric(obj)){let printObj=objType===`string`?`'`+obj+`'`:obj;errorMessage=msgPrefix+`expected `+printObj+` to be a number or a date`}else shouldThrow=!1;if(shouldThrow)throw new AssertionError(errorMessage,void 0,ssfi);if(doLength){let descriptor=`length`,itemsCount;objType===`map`||objType===`set`?(descriptor=`size`,itemsCount=obj.size):itemsCount=obj.length,this.assert(itemsCount>=n,`expected #{this} to have a `+descriptor+` at least #{exp} but got #{act}`,`expected #{this} to have a `+descriptor+` below #{exp}`,n,itemsCount)}else this.assert(obj>=n,`expected #{this} to be at least #{exp}`,`expected #{this} to be below #{exp}`,n)}__name(assertLeast,`assertLeast`),Assertion.addMethod(`least`,assertLeast),Assertion.addMethod(`gte`,assertLeast),Assertion.addMethod(`greaterThanOrEqual`,assertLeast);function assertBelow(n,msg){msg&&flag2(this,`message`,msg);let obj=flag2(this,`object`),doLength=flag2(this,`doLength`),flagMsg=flag2(this,`message`),msgPrefix=flagMsg?flagMsg+`: `:``,ssfi=flag2(this,`ssfi`),objType=type(obj).toLowerCase(),nType=type(n).toLowerCase(),errorMessage,shouldThrow=!0;if(doLength&&objType!==`map`&&objType!==`set`&&new Assertion(obj,flagMsg,ssfi,!0).to.have.property(`length`),!doLength&&objType===`date`&&nType!==`date`)errorMessage=msgPrefix+`the argument to below must be a date`;else if(!isNumeric(n)&&(doLength||isNumeric(obj)))errorMessage=msgPrefix+`the argument to below must be a number`;else if(!doLength&&objType!==`date`&&!isNumeric(obj)){let printObj=objType===`string`?`'`+obj+`'`:obj;errorMessage=msgPrefix+`expected `+printObj+` to be a number or a date`}else shouldThrow=!1;if(shouldThrow)throw new AssertionError(errorMessage,void 0,ssfi);if(doLength){let descriptor=`length`,itemsCount;objType===`map`||objType===`set`?(descriptor=`size`,itemsCount=obj.size):itemsCount=obj.length,this.assert(itemsCount<n,`expected #{this} to have a `+descriptor+` below #{exp} but got #{act}`,`expected #{this} to not have a `+descriptor+` below #{exp}`,n,itemsCount)}else this.assert(obj<n,`expected #{this} to be below #{exp}`,`expected #{this} to be at least #{exp}`,n)}__name(assertBelow,`assertBelow`),Assertion.addMethod(`below`,assertBelow),Assertion.addMethod(`lt`,assertBelow),Assertion.addMethod(`lessThan`,assertBelow);function assertMost(n,msg){msg&&flag2(this,`message`,msg);let obj=flag2(this,`object`),doLength=flag2(this,`doLength`),flagMsg=flag2(this,`message`),msgPrefix=flagMsg?flagMsg+`: `:``,ssfi=flag2(this,`ssfi`),objType=type(obj).toLowerCase(),nType=type(n).toLowerCase(),errorMessage,shouldThrow=!0;if(doLength&&objType!==`map`&&objType!==`set`&&new Assertion(obj,flagMsg,ssfi,!0).to.have.property(`length`),!doLength&&objType===`date`&&nType!==`date`)errorMessage=msgPrefix+`the argument to most must be a date`;else if(!isNumeric(n)&&(doLength||isNumeric(obj)))errorMessage=msgPrefix+`the argument to most must be a number`;else if(!doLength&&objType!==`date`&&!isNumeric(obj)){let printObj=objType===`string`?`'`+obj+`'`:obj;errorMessage=msgPrefix+`expected `+printObj+` to be a number or a date`}else shouldThrow=!1;if(shouldThrow)throw new AssertionError(errorMessage,void 0,ssfi);if(doLength){let descriptor=`length`,itemsCount;objType===`map`||objType===`set`?(descriptor=`size`,itemsCount=obj.size):itemsCount=obj.length,this.assert(itemsCount<=n,`expected #{this} to have a `+descriptor+` at most #{exp} but got #{act}`,`expected #{this} to have a `+descriptor+` above #{exp}`,n,itemsCount)}else this.assert(obj<=n,`expected #{this} to be at most #{exp}`,`expected #{this} to be above #{exp}`,n)}__name(assertMost,`assertMost`),Assertion.addMethod(`most`,assertMost),Assertion.addMethod(`lte`,assertMost),Assertion.addMethod(`lessThanOrEqual`,assertMost),Assertion.addMethod(`within`,function(start,finish,msg){msg&&flag2(this,`message`,msg);let obj=flag2(this,`object`),doLength=flag2(this,`doLength`),flagMsg=flag2(this,`message`),msgPrefix=flagMsg?flagMsg+`: `:``,ssfi=flag2(this,`ssfi`),objType=type(obj).toLowerCase(),startType=type(start).toLowerCase(),finishType=type(finish).toLowerCase(),errorMessage,shouldThrow=!0,range=startType===`date`&&finishType===`date`?start.toISOString()+`..`+finish.toISOString():start+`..`+finish;if(doLength&&objType!==`map`&&objType!==`set`&&new Assertion(obj,flagMsg,ssfi,!0).to.have.property(`length`),!doLength&&objType===`date`&&(startType!==`date`||finishType!==`date`))errorMessage=msgPrefix+`the arguments to within must be dates`;else if((!isNumeric(start)||!isNumeric(finish))&&(doLength||isNumeric(obj)))errorMessage=msgPrefix+`the arguments to within must be numbers`;else if(!doLength&&objType!==`date`&&!isNumeric(obj)){let printObj=objType===`string`?`'`+obj+`'`:obj;errorMessage=msgPrefix+`expected `+printObj+` to be a number or a date`}else shouldThrow=!1;if(shouldThrow)throw new AssertionError(errorMessage,void 0,ssfi);if(doLength){let descriptor=`length`,itemsCount;objType===`map`||objType===`set`?(descriptor=`size`,itemsCount=obj.size):itemsCount=obj.length,this.assert(itemsCount>=start&&itemsCount<=finish,`expected #{this} to have a `+descriptor+` within `+range,`expected #{this} to not have a `+descriptor+` within `+range)}else this.assert(obj>=start&&obj<=finish,`expected #{this} to be within `+range,`expected #{this} to not be within `+range)});function assertInstanceOf(constructor,msg){msg&&flag2(this,`message`,msg);let target=flag2(this,`object`),ssfi=flag2(this,`ssfi`),flagMsg=flag2(this,`message`),isInstanceOf;try{isInstanceOf=target instanceof constructor}catch(err){throw err instanceof TypeError?(flagMsg=flagMsg?flagMsg+`: `:``,new AssertionError(flagMsg+`The instanceof assertion needs a constructor but `+type(constructor)+` was given.`,void 0,ssfi)):err}let name=getName(constructor);name??=`an unnamed constructor`,this.assert(isInstanceOf,`expected #{this} to be an instance of `+name,`expected #{this} to not be an instance of `+name)}__name(assertInstanceOf,`assertInstanceOf`),Assertion.addMethod(`instanceof`,assertInstanceOf),Assertion.addMethod(`instanceOf`,assertInstanceOf);function assertProperty(name,val,msg){msg&&flag2(this,`message`,msg);let isNested=flag2(this,`nested`),isOwn=flag2(this,`own`),flagMsg=flag2(this,`message`),obj=flag2(this,`object`),ssfi=flag2(this,`ssfi`),nameType=typeof name;if(flagMsg=flagMsg?flagMsg+`: `:``,isNested){if(nameType!==`string`)throw new AssertionError(flagMsg+`the argument to property must be a string when using nested syntax`,void 0,ssfi)}else if(nameType!==`string`&&nameType!==`number`&&nameType!==`symbol`)throw new AssertionError(flagMsg+`the argument to property must be a string, number, or symbol`,void 0,ssfi);if(isNested&&isOwn)throw new AssertionError(flagMsg+`The "nested" and "own" flags cannot be combined.`,void 0,ssfi);if(obj==null)throw new AssertionError(flagMsg+`Target cannot be null or undefined.`,void 0,ssfi);let isDeep=flag2(this,`deep`),negate=flag2(this,`negate`),pathInfo=isNested?getPathInfo(obj,name):null,value=isNested?pathInfo.value:obj[name],isEql=isDeep?flag2(this,`eql`):(val1,val2)=>val1===val2,descriptor=``;isDeep&&(descriptor+=`deep `),isOwn&&(descriptor+=`own `),isNested&&(descriptor+=`nested `),descriptor+=`property `;let hasProperty2;hasProperty2=isOwn?Object.prototype.hasOwnProperty.call(obj,name):isNested?pathInfo.exists:hasProperty(obj,name),(!negate||arguments.length===1)&&this.assert(hasProperty2,`expected #{this} to have `+descriptor+inspect2(name),`expected #{this} to not have `+descriptor+inspect2(name)),arguments.length>1&&this.assert(hasProperty2&&isEql(val,value),`expected #{this} to have `+descriptor+inspect2(name)+` of #{exp}, but got #{act}`,`expected #{this} to not have `+descriptor+inspect2(name)+` of #{act}`,val,value),flag2(this,`object`,value)}__name(assertProperty,`assertProperty`),Assertion.addMethod(`property`,assertProperty);function assertOwnProperty(_name,_value,_msg){flag2(this,`own`,!0),assertProperty.apply(this,arguments)}__name(assertOwnProperty,`assertOwnProperty`),Assertion.addMethod(`ownProperty`,assertOwnProperty),Assertion.addMethod(`haveOwnProperty`,assertOwnProperty);function assertOwnPropertyDescriptor(name,descriptor,msg){typeof descriptor==`string`&&(msg=descriptor,descriptor=null),msg&&flag2(this,`message`,msg);let obj=flag2(this,`object`),actualDescriptor=Object.getOwnPropertyDescriptor(Object(obj),name),eql=flag2(this,`eql`);actualDescriptor&&descriptor?this.assert(eql(descriptor,actualDescriptor),`expected the own property descriptor for `+inspect2(name)+` on #{this} to match `+inspect2(descriptor)+`, got `+inspect2(actualDescriptor),`expected the own property descriptor for `+inspect2(name)+` on #{this} to not match `+inspect2(descriptor),descriptor,actualDescriptor,!0):this.assert(actualDescriptor,`expected #{this} to have an own property descriptor for `+inspect2(name),`expected #{this} to not have an own property descriptor for `+inspect2(name)),flag2(this,`object`,actualDescriptor)}__name(assertOwnPropertyDescriptor,`assertOwnPropertyDescriptor`),Assertion.addMethod(`ownPropertyDescriptor`,assertOwnPropertyDescriptor),Assertion.addMethod(`haveOwnPropertyDescriptor`,assertOwnPropertyDescriptor);function assertLengthChain(){flag2(this,`doLength`,!0)}__name(assertLengthChain,`assertLengthChain`);function assertLength(n,msg){msg&&flag2(this,`message`,msg);let obj=flag2(this,`object`),objType=type(obj).toLowerCase(),flagMsg=flag2(this,`message`),ssfi=flag2(this,`ssfi`),descriptor=`length`,itemsCount;switch(objType){case`map`:case`set`:descriptor=`size`,itemsCount=obj.size;break;default:new Assertion(obj,flagMsg,ssfi,!0).to.have.property(`length`),itemsCount=obj.length}this.assert(itemsCount==n,`expected #{this} to have a `+descriptor+` of #{exp} but got #{act}`,`expected #{this} to not have a `+descriptor+` of #{act}`,n,itemsCount)}__name(assertLength,`assertLength`),Assertion.addChainableMethod(`length`,assertLength,assertLengthChain),Assertion.addChainableMethod(`lengthOf`,assertLength,assertLengthChain);function assertMatch(re,msg){msg&&flag2(this,`message`,msg);let obj=flag2(this,`object`);this.assert(re.exec(obj),`expected #{this} to match `+re,`expected #{this} not to match `+re)}__name(assertMatch,`assertMatch`),Assertion.addMethod(`match`,assertMatch),Assertion.addMethod(`matches`,assertMatch),Assertion.addMethod(`string`,function(str,msg){msg&&flag2(this,`message`,msg);let obj=flag2(this,`object`);new Assertion(obj,flag2(this,`message`),flag2(this,`ssfi`),!0).is.a(`string`),this.assert(~obj.indexOf(str),`expected #{this} to contain `+inspect2(str),`expected #{this} to not contain `+inspect2(str))});function assertKeys(keys){let obj=flag2(this,`object`),objType=type(obj),keysType=type(keys),ssfi=flag2(this,`ssfi`),isDeep=flag2(this,`deep`),str,deepStr=``,actual,ok=!0,flagMsg=flag2(this,`message`);flagMsg=flagMsg?flagMsg+`: `:``;let mixedArgsMsg=flagMsg+`when testing keys against an object or an array you must give a single Array|Object|String argument or multiple String arguments`;if(objType===`Map`||objType===`Set`)deepStr=isDeep?`deeply `:``,actual=[],obj.forEach(function(val,key){actual.push(key)}),keysType!==`Array`&&(keys=Array.prototype.slice.call(arguments));else{switch(actual=getOwnEnumerableProperties(obj),keysType){case`Array`:if(arguments.length>1)throw new AssertionError(mixedArgsMsg,void 0,ssfi);break;case`Object`:if(arguments.length>1)throw new AssertionError(mixedArgsMsg,void 0,ssfi);keys=Object.keys(keys);break;default:keys=Array.prototype.slice.call(arguments)}keys=keys.map(function(val){return typeof val==`symbol`?val:String(val)})}if(!keys.length)throw new AssertionError(flagMsg+`keys required`,void 0,ssfi);let len=keys.length,any=flag2(this,`any`),all=flag2(this,`all`),expected=keys,isEql=isDeep?flag2(this,`eql`):(val1,val2)=>val1===val2;if(!any&&!all&&(all=!0),any&&(ok=expected.some(function(expectedKey){return actual.some(function(actualKey){return isEql(expectedKey,actualKey)})})),all&&(ok=expected.every(function(expectedKey){return actual.some(function(actualKey){return isEql(expectedKey,actualKey)})}),flag2(this,`contains`)||(ok&&=keys.length==actual.length)),len>1){keys=keys.map(function(key){return inspect2(key)});let last=keys.pop();all&&(str=keys.join(`, `)+`, and `+last),any&&(str=keys.join(`, `)+`, or `+last)}else str=inspect2(keys[0]);str=(len>1?`keys `:`key `)+str,str=(flag2(this,`contains`)?`contain `:`have `)+str,this.assert(ok,`expected #{this} to `+deepStr+str,`expected #{this} to not `+deepStr+str,expected.slice(0).sort(compareByInspect),actual.sort(compareByInspect),!0)}__name(assertKeys,`assertKeys`),Assertion.addMethod(`keys`,assertKeys),Assertion.addMethod(`key`,assertKeys);function assertThrows(errorLike,errMsgMatcher,msg){msg&&flag2(this,`message`,msg);let obj=flag2(this,`object`),ssfi=flag2(this,`ssfi`),flagMsg=flag2(this,`message`),negate=flag2(this,`negate`)||!1;new Assertion(obj,flagMsg,ssfi,!0).is.a(`function`),(isRegExp2(errorLike)||typeof errorLike==`string`)&&(errMsgMatcher=errorLike,errorLike=null);let caughtErr,errorWasThrown=!1;try{obj()}catch(err){errorWasThrown=!0,caughtErr=err}let everyArgIsUndefined=errorLike===void 0&&errMsgMatcher===void 0,everyArgIsDefined=!!(errorLike&&errMsgMatcher),errorLikeFail=!1,errMsgMatcherFail=!1;if(everyArgIsUndefined||!everyArgIsUndefined&&!negate){let errorLikeString=`an error`;errorLike instanceof Error?errorLikeString=`#{exp}`:errorLike&&(errorLikeString=check_error_exports.getConstructorName(errorLike));let actual=caughtErr;if(caughtErr instanceof Error)actual=caughtErr.toString();else if(typeof caughtErr==`string`)actual=caughtErr;else if(caughtErr&&(typeof caughtErr==`object`||typeof caughtErr==`function`))try{actual=check_error_exports.getConstructorName(caughtErr)}catch{}this.assert(errorWasThrown,`expected #{this} to throw `+errorLikeString,`expected #{this} to not throw an error but #{act} was thrown`,errorLike&&errorLike.toString(),actual)}if(errorLike&&caughtErr&&(errorLike instanceof Error&&check_error_exports.compatibleInstance(caughtErr,errorLike)===negate&&(everyArgIsDefined&&negate?errorLikeFail=!0:this.assert(negate,`expected #{this} to throw #{exp} but #{act} was thrown`,`expected #{this} to not throw #{exp}`+(caughtErr&&!negate?` but #{act} was thrown`:``),errorLike.toString(),caughtErr.toString())),check_error_exports.compatibleConstructor(caughtErr,errorLike)===negate&&(everyArgIsDefined&&negate?errorLikeFail=!0:this.assert(negate,`expected #{this} to throw #{exp} but #{act} was thrown`,`expected #{this} to not throw #{exp}`+(caughtErr?` but #{act} was thrown`:``),errorLike instanceof Error?errorLike.toString():errorLike&&check_error_exports.getConstructorName(errorLike),caughtErr instanceof Error?caughtErr.toString():caughtErr&&check_error_exports.getConstructorName(caughtErr)))),caughtErr&&errMsgMatcher!=null){let placeholder=`including`;isRegExp2(errMsgMatcher)&&(placeholder=`matching`),check_error_exports.compatibleMessage(caughtErr,errMsgMatcher)===negate&&(everyArgIsDefined&&negate?errMsgMatcherFail=!0:this.assert(negate,`expected #{this} to throw error `+placeholder+` #{exp} but got #{act}`,`expected #{this} to throw error not `+placeholder+` #{exp}`,errMsgMatcher,check_error_exports.getMessage(caughtErr)))}errorLikeFail&&errMsgMatcherFail&&this.assert(negate,`expected #{this} to throw #{exp} but #{act} was thrown`,`expected #{this} to not throw #{exp}`+(caughtErr?` but #{act} was thrown`:``),errorLike instanceof Error?errorLike.toString():errorLike&&check_error_exports.getConstructorName(errorLike),caughtErr instanceof Error?caughtErr.toString():caughtErr&&check_error_exports.getConstructorName(caughtErr)),flag2(this,`object`,caughtErr)}__name(assertThrows,`assertThrows`),Assertion.addMethod(`throw`,assertThrows),Assertion.addMethod(`throws`,assertThrows),Assertion.addMethod(`Throw`,assertThrows);function respondTo(method,msg){msg&&flag2(this,`message`,msg);let obj=flag2(this,`object`),itself=flag2(this,`itself`),context=typeof obj==`function`&&!itself?obj.prototype[method]:obj[method];this.assert(typeof context==`function`,`expected #{this} to respond to `+inspect2(method),`expected #{this} to not respond to `+inspect2(method))}__name(respondTo,`respondTo`),Assertion.addMethod(`respondTo`,respondTo),Assertion.addMethod(`respondsTo`,respondTo),Assertion.addProperty(`itself`,function(){flag2(this,`itself`,!0)});function satisfy(matcher,msg){msg&&flag2(this,`message`,msg);let result=matcher(flag2(this,`object`));this.assert(result,`expected #{this} to satisfy `+objDisplay(matcher),`expected #{this} to not satisfy`+objDisplay(matcher),!flag2(this,`negate`),result)}__name(satisfy,`satisfy`),Assertion.addMethod(`satisfy`,satisfy),Assertion.addMethod(`satisfies`,satisfy);function closeTo(expected,delta,msg){msg&&flag2(this,`message`,msg);let obj=flag2(this,`object`),flagMsg=flag2(this,`message`),ssfi=flag2(this,`ssfi`);new Assertion(obj,flagMsg,ssfi,!0).is.numeric;let message="A `delta` value is required for `closeTo`";if(delta==null||(new Assertion(delta,flagMsg,ssfi,!0).is.numeric,message="A `expected` value is required for `closeTo`",expected==null))throw new AssertionError(flagMsg?`${flagMsg}: ${message}`:message,void 0,ssfi);new Assertion(expected,flagMsg,ssfi,!0).is.numeric;let abs=__name(x=>x<0?-x:x,`abs`),strip=__name(number=>parseFloat(parseFloat(number).toPrecision(12)),`strip`);this.assert(strip(abs(obj-expected))<=delta,`expected #{this} to be close to `+expected+` +/- `+delta,`expected #{this} not to be close to `+expected+` +/- `+delta)}__name(closeTo,`closeTo`),Assertion.addMethod(`closeTo`,closeTo),Assertion.addMethod(`approximately`,closeTo);function isSubsetOf(_subset,_superset,cmp,contains,ordered){let superset=Array.from(_superset),subset=Array.from(_subset);if(!contains){if(subset.length!==superset.length)return!1;superset=superset.slice()}return subset.every(function(elem,idx){if(ordered)return cmp?cmp(elem,superset[idx]):elem===superset[idx];if(!cmp){let matchIdx=superset.indexOf(elem);return matchIdx!==-1&&(contains||superset.splice(matchIdx,1),!0)}return superset.some(function(elem2,matchIdx){return cmp(elem,elem2)?(contains||superset.splice(matchIdx,1),!0):!1})})}__name(isSubsetOf,`isSubsetOf`),Assertion.addMethod(`members`,function(subset,msg){msg&&flag2(this,`message`,msg);let obj=flag2(this,`object`),flagMsg=flag2(this,`message`),ssfi=flag2(this,`ssfi`);new Assertion(obj,flagMsg,ssfi,!0).to.be.iterable,new Assertion(subset,flagMsg,ssfi,!0).to.be.iterable;let contains=flag2(this,`contains`),ordered=flag2(this,`ordered`),subject,failMsg,failNegateMsg;contains?(subject=ordered?`an ordered superset`:`a superset`,failMsg=`expected #{this} to be `+subject+` of #{exp}`,failNegateMsg=`expected #{this} to not be `+subject+` of #{exp}`):(subject=ordered?`ordered members`:`members`,failMsg=`expected #{this} to have the same `+subject+` as #{exp}`,failNegateMsg=`expected #{this} to not have the same `+subject+` as #{exp}`);let cmp=flag2(this,`deep`)?flag2(this,`eql`):void 0;this.assert(isSubsetOf(subset,obj,cmp,contains,ordered),failMsg,failNegateMsg,subset,obj,!0)}),Assertion.addProperty(`iterable`,function(msg){msg&&flag2(this,`message`,msg);let obj=flag2(this,`object`);this.assert(obj!=null&&obj[Symbol.iterator],`expected #{this} to be an iterable`,`expected #{this} to not be an iterable`,obj)});function oneOf(list,msg){msg&&flag2(this,`message`,msg);let expected=flag2(this,`object`),flagMsg=flag2(this,`message`),ssfi=flag2(this,`ssfi`),contains=flag2(this,`contains`),isDeep=flag2(this,`deep`),eql=flag2(this,`eql`);new Assertion(list,flagMsg,ssfi,!0).to.be.an(`array`),contains?this.assert(list.some(function(possibility){return expected.indexOf(possibility)>-1}),`expected #{this} to contain one of #{exp}`,`expected #{this} to not contain one of #{exp}`,list,expected):isDeep?this.assert(list.some(function(possibility){return eql(expected,possibility)}),`expected #{this} to deeply equal one of #{exp}`,`expected #{this} to deeply equal one of #{exp}`,list,expected):this.assert(list.indexOf(expected)>-1,`expected #{this} to be one of #{exp}`,`expected #{this} to not be one of #{exp}`,list,expected)}__name(oneOf,`oneOf`),Assertion.addMethod(`oneOf`,oneOf);function assertChanges(subject,prop,msg){msg&&flag2(this,`message`,msg);let fn=flag2(this,`object`),flagMsg=flag2(this,`message`),ssfi=flag2(this,`ssfi`);new Assertion(fn,flagMsg,ssfi,!0).is.a(`function`);let initial;prop?(new Assertion(subject,flagMsg,ssfi,!0).to.have.property(prop),initial=subject[prop]):(new Assertion(subject,flagMsg,ssfi,!0).is.a(`function`),initial=subject()),fn();let final=prop==null?subject():subject[prop],msgObj=prop==null?initial:`.`+prop;flag2(this,`deltaMsgObj`,msgObj),flag2(this,`initialDeltaValue`,initial),flag2(this,`finalDeltaValue`,final),flag2(this,`deltaBehavior`,`change`),flag2(this,`realDelta`,final!==initial),this.assert(initial!==final,`expected `+msgObj+` to change`,`expected `+msgObj+` to not change`)}__name(assertChanges,`assertChanges`),Assertion.addMethod(`change`,assertChanges),Assertion.addMethod(`changes`,assertChanges);function assertIncreases(subject,prop,msg){msg&&flag2(this,`message`,msg);let fn=flag2(this,`object`),flagMsg=flag2(this,`message`),ssfi=flag2(this,`ssfi`);new Assertion(fn,flagMsg,ssfi,!0).is.a(`function`);let initial;prop?(new Assertion(subject,flagMsg,ssfi,!0).to.have.property(prop),initial=subject[prop]):(new Assertion(subject,flagMsg,ssfi,!0).is.a(`function`),initial=subject()),new Assertion(initial,flagMsg,ssfi,!0).is.a(`number`),fn();let final=prop==null?subject():subject[prop],msgObj=prop==null?initial:`.`+prop;flag2(this,`deltaMsgObj`,msgObj),flag2(this,`initialDeltaValue`,initial),flag2(this,`finalDeltaValue`,final),flag2(this,`deltaBehavior`,`increase`),flag2(this,`realDelta`,final-initial),this.assert(final-initial>0,`expected `+msgObj+` to increase`,`expected `+msgObj+` to not increase`)}__name(assertIncreases,`assertIncreases`),Assertion.addMethod(`increase`,assertIncreases),Assertion.addMethod(`increases`,assertIncreases);function assertDecreases(subject,prop,msg){msg&&flag2(this,`message`,msg);let fn=flag2(this,`object`),flagMsg=flag2(this,`message`),ssfi=flag2(this,`ssfi`);new Assertion(fn,flagMsg,ssfi,!0).is.a(`function`);let initial;prop?(new Assertion(subject,flagMsg,ssfi,!0).to.have.property(prop),initial=subject[prop]):(new Assertion(subject,flagMsg,ssfi,!0).is.a(`function`),initial=subject()),new Assertion(initial,flagMsg,ssfi,!0).is.a(`number`),fn();let final=prop==null?subject():subject[prop],msgObj=prop==null?initial:`.`+prop;flag2(this,`deltaMsgObj`,msgObj),flag2(this,`initialDeltaValue`,initial),flag2(this,`finalDeltaValue`,final),flag2(this,`deltaBehavior`,`decrease`),flag2(this,`realDelta`,initial-final),this.assert(final-initial<0,`expected `+msgObj+` to decrease`,`expected `+msgObj+` to not decrease`)}__name(assertDecreases,`assertDecreases`),Assertion.addMethod(`decrease`,assertDecreases),Assertion.addMethod(`decreases`,assertDecreases);function assertDelta(delta,msg){msg&&flag2(this,`message`,msg);let msgObj=flag2(this,`deltaMsgObj`),initial=flag2(this,`initialDeltaValue`),final=flag2(this,`finalDeltaValue`),behavior=flag2(this,`deltaBehavior`),realDelta=flag2(this,`realDelta`),expression;expression=behavior===`change`?Math.abs(final-initial)===Math.abs(delta):realDelta===Math.abs(delta),this.assert(expression,`expected `+msgObj+` to `+behavior+` by `+delta,`expected `+msgObj+` to not `+behavior+` by `+delta)}__name(assertDelta,`assertDelta`),Assertion.addMethod(`by`,assertDelta),Assertion.addProperty(`extensible`,function(){let obj=flag2(this,`object`),isExtensible=obj===Object(obj)&&Object.isExtensible(obj);this.assert(isExtensible,`expected #{this} to be extensible`,`expected #{this} to not be extensible`)}),Assertion.addProperty(`sealed`,function(){let obj=flag2(this,`object`),isSealed=obj!==Object(obj)||Object.isSealed(obj);this.assert(isSealed,`expected #{this} to be sealed`,`expected #{this} to not be sealed`)}),Assertion.addProperty(`frozen`,function(){let obj=flag2(this,`object`),isFrozen=obj!==Object(obj)||Object.isFrozen(obj);this.assert(isFrozen,`expected #{this} to be frozen`,`expected #{this} to not be frozen`)}),Assertion.addProperty(`finite`,function(_msg){let obj=flag2(this,`object`);this.assert(typeof obj==`number`&&isFinite(obj),`expected #{this} to be a finite number`,`expected #{this} to not be a finite number`)});function compareSubset(expected,actual){return expected===actual?!0:typeof actual==typeof expected?typeof expected!=`object`||!expected?expected===actual:actual?Array.isArray(expected)?Array.isArray(actual)?expected.every(function(exp){return actual.some(function(act){return compareSubset(exp,act)})}):!1:expected instanceof Date?actual instanceof Date&&expected.getTime()===actual.getTime():Object.keys(expected).every(function(key){let expectedValue=expected[key],actualValue=actual[key];return typeof expectedValue==`object`&&expectedValue&&actualValue!==null?compareSubset(expectedValue,actualValue):typeof expectedValue==`function`?expectedValue(actualValue):actualValue===expectedValue}):!1:!1}__name(compareSubset,`compareSubset`),Assertion.addMethod(`containSubset`,function(expected){let actual=flag(this,`object`),showDiff=config.showDiff;this.assert(compareSubset(expected,actual),`expected #{act} to contain subset #{exp}`,`expected #{act} to not contain subset #{exp}`,expected,actual,showDiff)});function expect(val,message){return new Assertion(val,message)}__name(expect,`expect`),expect.fail=function(actual,expected,message,operator){throw arguments.length<2&&(message=actual,actual=void 0),message||=`expect.fail()`,new AssertionError(message,{actual,expected,operator},expect.fail)};var should_exports={};__export(should_exports,{Should:()=>Should,should:()=>should});function loadShould(){function shouldGetter(){return this instanceof String||this instanceof Number||this instanceof Boolean||typeof Symbol==`function`&&this instanceof Symbol||typeof BigInt==`function`&&this instanceof BigInt?new Assertion(this.valueOf(),null,shouldGetter):new Assertion(this,null,shouldGetter)}__name(shouldGetter,`shouldGetter`);function shouldSetter(value){Object.defineProperty(this,"should",{value,enumerable:!0,configurable:!0,writable:!0})}__name(shouldSetter,`shouldSetter`),Object.defineProperty(Object.prototype,"should",{set:shouldSetter,get:shouldGetter,configurable:!0});let should2={};return should2.fail=function(actual,expected,message,operator){throw arguments.length<2&&(message=actual,actual=void 0),message||=`should.fail()`,new AssertionError(message,{actual,expected,operator},should2.fail)},should2.equal=function(actual,expected,message){new Assertion(actual,message).to.equal(expected)},should2.Throw=function(fn,errt,errs,msg){new Assertion(fn,msg).to.Throw(errt,errs)},should2.exist=function(val,msg){new Assertion(val,msg).to.exist},should2.not={},should2.not.equal=function(actual,expected,msg){new Assertion(actual,msg).to.not.equal(expected)},should2.not.Throw=function(fn,errt,errs,msg){new Assertion(fn,msg).to.not.Throw(errt,errs)},should2.not.exist=function(val,msg){new Assertion(val,msg).to.not.exist},should2.throw=should2.Throw,should2.not.throw=should2.not.Throw,should2}__name(loadShould,`loadShould`);var should=loadShould,Should=loadShould;function assert(express,errmsg){new Assertion(null,null,assert,!0).assert(express,errmsg,`[ negation message unavailable ]`)}__name(assert,`assert`),assert.fail=function(actual,expected,message,operator){throw arguments.length<2&&(message=actual,actual=void 0),message||=`assert.fail()`,new AssertionError(message,{actual,expected,operator},assert.fail)},assert.isOk=function(val,msg){new Assertion(val,msg,assert.isOk,!0).is.ok},assert.isNotOk=function(val,msg){new Assertion(val,msg,assert.isNotOk,!0).is.not.ok},assert.equal=function(act,exp,msg){let test2=new Assertion(act,msg,assert.equal,!0);test2.assert(exp==flag(test2,`object`),`expected #{this} to equal #{exp}`,`expected #{this} to not equal #{act}`,exp,act,!0)},assert.notEqual=function(act,exp,msg){let test2=new Assertion(act,msg,assert.notEqual,!0);test2.assert(exp!=flag(test2,`object`),`expected #{this} to not equal #{exp}`,`expected #{this} to equal #{act}`,exp,act,!0)},assert.strictEqual=function(act,exp,msg){new Assertion(act,msg,assert.strictEqual,!0).to.equal(exp)},assert.notStrictEqual=function(act,exp,msg){new Assertion(act,msg,assert.notStrictEqual,!0).to.not.equal(exp)},assert.deepEqual=assert.deepStrictEqual=function(act,exp,msg){new Assertion(act,msg,assert.deepEqual,!0).to.eql(exp)},assert.notDeepEqual=function(act,exp,msg){new Assertion(act,msg,assert.notDeepEqual,!0).to.not.eql(exp)},assert.isAbove=function(val,abv,msg){new Assertion(val,msg,assert.isAbove,!0).to.be.above(abv)},assert.isAtLeast=function(val,atlst,msg){new Assertion(val,msg,assert.isAtLeast,!0).to.be.least(atlst)},assert.isBelow=function(val,blw,msg){new Assertion(val,msg,assert.isBelow,!0).to.be.below(blw)},assert.isAtMost=function(val,atmst,msg){new Assertion(val,msg,assert.isAtMost,!0).to.be.most(atmst)},assert.isTrue=function(val,msg){new Assertion(val,msg,assert.isTrue,!0).is.true},assert.isNotTrue=function(val,msg){new Assertion(val,msg,assert.isNotTrue,!0).to.not.equal(!0)},assert.isFalse=function(val,msg){new Assertion(val,msg,assert.isFalse,!0).is.false},assert.isNotFalse=function(val,msg){new Assertion(val,msg,assert.isNotFalse,!0).to.not.equal(!1)},assert.isNull=function(val,msg){new Assertion(val,msg,assert.isNull,!0).to.equal(null)},assert.isNotNull=function(val,msg){new Assertion(val,msg,assert.isNotNull,!0).to.not.equal(null)},assert.isNaN=function(val,msg){new Assertion(val,msg,assert.isNaN,!0).to.be.NaN},assert.isNotNaN=function(value,message){new Assertion(value,message,assert.isNotNaN,!0).not.to.be.NaN},assert.exists=function(val,msg){new Assertion(val,msg,assert.exists,!0).to.exist},assert.notExists=function(val,msg){new Assertion(val,msg,assert.notExists,!0).to.not.exist},assert.isUndefined=function(val,msg){new Assertion(val,msg,assert.isUndefined,!0).to.equal(void 0)},assert.isDefined=function(val,msg){new Assertion(val,msg,assert.isDefined,!0).to.not.equal(void 0)},assert.isCallable=function(value,message){new Assertion(value,message,assert.isCallable,!0).is.callable},assert.isNotCallable=function(value,message){new Assertion(value,message,assert.isNotCallable,!0).is.not.callable},assert.isObject=function(val,msg){new Assertion(val,msg,assert.isObject,!0).to.be.a(`object`)},assert.isNotObject=function(val,msg){new Assertion(val,msg,assert.isNotObject,!0).to.not.be.a(`object`)},assert.isArray=function(val,msg){new Assertion(val,msg,assert.isArray,!0).to.be.an(`array`)},assert.isNotArray=function(val,msg){new Assertion(val,msg,assert.isNotArray,!0).to.not.be.an(`array`)},assert.isString=function(val,msg){new Assertion(val,msg,assert.isString,!0).to.be.a(`string`)},assert.isNotString=function(val,msg){new Assertion(val,msg,assert.isNotString,!0).to.not.be.a(`string`)},assert.isNumber=function(val,msg){new Assertion(val,msg,assert.isNumber,!0).to.be.a(`number`)},assert.isNotNumber=function(val,msg){new Assertion(val,msg,assert.isNotNumber,!0).to.not.be.a(`number`)},assert.isNumeric=function(val,msg){new Assertion(val,msg,assert.isNumeric,!0).is.numeric},assert.isNotNumeric=function(val,msg){new Assertion(val,msg,assert.isNotNumeric,!0).is.not.numeric},assert.isFinite=function(val,msg){new Assertion(val,msg,assert.isFinite,!0).to.be.finite},assert.isBoolean=function(val,msg){new Assertion(val,msg,assert.isBoolean,!0).to.be.a(`boolean`)},assert.isNotBoolean=function(val,msg){new Assertion(val,msg,assert.isNotBoolean,!0).to.not.be.a(`boolean`)},assert.typeOf=function(val,type3,msg){new Assertion(val,msg,assert.typeOf,!0).to.be.a(type3)},assert.notTypeOf=function(value,type3,message){new Assertion(value,message,assert.notTypeOf,!0).to.not.be.a(type3)},assert.instanceOf=function(val,type3,msg){new Assertion(val,msg,assert.instanceOf,!0).to.be.instanceOf(type3)},assert.notInstanceOf=function(val,type3,msg){new Assertion(val,msg,assert.notInstanceOf,!0).to.not.be.instanceOf(type3)},assert.include=function(exp,inc,msg){new Assertion(exp,msg,assert.include,!0).include(inc)},assert.notInclude=function(exp,inc,msg){new Assertion(exp,msg,assert.notInclude,!0).not.include(inc)},assert.deepInclude=function(exp,inc,msg){new Assertion(exp,msg,assert.deepInclude,!0).deep.include(inc)},assert.notDeepInclude=function(exp,inc,msg){new Assertion(exp,msg,assert.notDeepInclude,!0).not.deep.include(inc)},assert.nestedInclude=function(exp,inc,msg){new Assertion(exp,msg,assert.nestedInclude,!0).nested.include(inc)},assert.notNestedInclude=function(exp,inc,msg){new Assertion(exp,msg,assert.notNestedInclude,!0).not.nested.include(inc)},assert.deepNestedInclude=function(exp,inc,msg){new Assertion(exp,msg,assert.deepNestedInclude,!0).deep.nested.include(inc)},assert.notDeepNestedInclude=function(exp,inc,msg){new Assertion(exp,msg,assert.notDeepNestedInclude,!0).not.deep.nested.include(inc)},assert.ownInclude=function(exp,inc,msg){new Assertion(exp,msg,assert.ownInclude,!0).own.include(inc)},assert.notOwnInclude=function(exp,inc,msg){new Assertion(exp,msg,assert.notOwnInclude,!0).not.own.include(inc)},assert.deepOwnInclude=function(exp,inc,msg){new Assertion(exp,msg,assert.deepOwnInclude,!0).deep.own.include(inc)},assert.notDeepOwnInclude=function(exp,inc,msg){new Assertion(exp,msg,assert.notDeepOwnInclude,!0).not.deep.own.include(inc)},assert.match=function(exp,re,msg){new Assertion(exp,msg,assert.match,!0).to.match(re)},assert.notMatch=function(exp,re,msg){new Assertion(exp,msg,assert.notMatch,!0).to.not.match(re)},assert.property=function(obj,prop,msg){new Assertion(obj,msg,assert.property,!0).to.have.property(prop)},assert.notProperty=function(obj,prop,msg){new Assertion(obj,msg,assert.notProperty,!0).to.not.have.property(prop)},assert.propertyVal=function(obj,prop,val,msg){new Assertion(obj,msg,assert.propertyVal,!0).to.have.property(prop,val)},assert.notPropertyVal=function(obj,prop,val,msg){new Assertion(obj,msg,assert.notPropertyVal,!0).to.not.have.property(prop,val)},assert.deepPropertyVal=function(obj,prop,val,msg){new Assertion(obj,msg,assert.deepPropertyVal,!0).to.have.deep.property(prop,val)},assert.notDeepPropertyVal=function(obj,prop,val,msg){new Assertion(obj,msg,assert.notDeepPropertyVal,!0).to.not.have.deep.property(prop,val)},assert.ownProperty=function(obj,prop,msg){new Assertion(obj,msg,assert.ownProperty,!0).to.have.own.property(prop)},assert.notOwnProperty=function(obj,prop,msg){new Assertion(obj,msg,assert.notOwnProperty,!0).to.not.have.own.property(prop)},assert.ownPropertyVal=function(obj,prop,value,msg){new Assertion(obj,msg,assert.ownPropertyVal,!0).to.have.own.property(prop,value)},assert.notOwnPropertyVal=function(obj,prop,value,msg){new Assertion(obj,msg,assert.notOwnPropertyVal,!0).to.not.have.own.property(prop,value)},assert.deepOwnPropertyVal=function(obj,prop,value,msg){new Assertion(obj,msg,assert.deepOwnPropertyVal,!0).to.have.deep.own.property(prop,value)},assert.notDeepOwnPropertyVal=function(obj,prop,value,msg){new Assertion(obj,msg,assert.notDeepOwnPropertyVal,!0).to.not.have.deep.own.property(prop,value)},assert.nestedProperty=function(obj,prop,msg){new Assertion(obj,msg,assert.nestedProperty,!0).to.have.nested.property(prop)},assert.notNestedProperty=function(obj,prop,msg){new Assertion(obj,msg,assert.notNestedProperty,!0).to.not.have.nested.property(prop)},assert.nestedPropertyVal=function(obj,prop,val,msg){new Assertion(obj,msg,assert.nestedPropertyVal,!0).to.have.nested.property(prop,val)},assert.notNestedPropertyVal=function(obj,prop,val,msg){new Assertion(obj,msg,assert.notNestedPropertyVal,!0).to.not.have.nested.property(prop,val)},assert.deepNestedPropertyVal=function(obj,prop,val,msg){new Assertion(obj,msg,assert.deepNestedPropertyVal,!0).to.have.deep.nested.property(prop,val)},assert.notDeepNestedPropertyVal=function(obj,prop,val,msg){new Assertion(obj,msg,assert.notDeepNestedPropertyVal,!0).to.not.have.deep.nested.property(prop,val)},assert.lengthOf=function(exp,len,msg){new Assertion(exp,msg,assert.lengthOf,!0).to.have.lengthOf(len)},assert.hasAnyKeys=function(obj,keys,msg){new Assertion(obj,msg,assert.hasAnyKeys,!0).to.have.any.keys(keys)},assert.hasAllKeys=function(obj,keys,msg){new Assertion(obj,msg,assert.hasAllKeys,!0).to.have.all.keys(keys)},assert.containsAllKeys=function(obj,keys,msg){new Assertion(obj,msg,assert.containsAllKeys,!0).to.contain.all.keys(keys)},assert.doesNotHaveAnyKeys=function(obj,keys,msg){new Assertion(obj,msg,assert.doesNotHaveAnyKeys,!0).to.not.have.any.keys(keys)},assert.doesNotHaveAllKeys=function(obj,keys,msg){new Assertion(obj,msg,assert.doesNotHaveAllKeys,!0).to.not.have.all.keys(keys)},assert.hasAnyDeepKeys=function(obj,keys,msg){new Assertion(obj,msg,assert.hasAnyDeepKeys,!0).to.have.any.deep.keys(keys)},assert.hasAllDeepKeys=function(obj,keys,msg){new Assertion(obj,msg,assert.hasAllDeepKeys,!0).to.have.all.deep.keys(keys)},assert.containsAllDeepKeys=function(obj,keys,msg){new Assertion(obj,msg,assert.containsAllDeepKeys,!0).to.contain.all.deep.keys(keys)},assert.doesNotHaveAnyDeepKeys=function(obj,keys,msg){new Assertion(obj,msg,assert.doesNotHaveAnyDeepKeys,!0).to.not.have.any.deep.keys(keys)},assert.doesNotHaveAllDeepKeys=function(obj,keys,msg){new Assertion(obj,msg,assert.doesNotHaveAllDeepKeys,!0).to.not.have.all.deep.keys(keys)},assert.throws=function(fn,errorLike,errMsgMatcher,msg){return(typeof errorLike==`string`||errorLike instanceof RegExp)&&(errMsgMatcher=errorLike,errorLike=null),flag(new Assertion(fn,msg,assert.throws,!0).to.throw(errorLike,errMsgMatcher),`object`)},assert.doesNotThrow=function(fn,errorLike,errMsgMatcher,message){(typeof errorLike==`string`||errorLike instanceof RegExp)&&(errMsgMatcher=errorLike,errorLike=null),new Assertion(fn,message,assert.doesNotThrow,!0).to.not.throw(errorLike,errMsgMatcher)},assert.operator=function(val,operator,val2,msg){let ok;switch(operator){case`==`:ok=val==val2;break;case`===`:ok=val===val2;break;case`>`:ok=val>val2;break;case`>=`:ok=val>=val2;break;case`<`:ok=val<val2;break;case`<=`:ok=val<=val2;break;case`!=`:ok=val!=val2;break;case`!==`:ok=val!==val2;break;default:throw msg&&=msg+`: `,new AssertionError(msg+`Invalid operator "`+operator+`"`,void 0,assert.operator)}let test2=new Assertion(ok,msg,assert.operator,!0);test2.assert(!0===flag(test2,`object`),`expected `+inspect2(val)+` to be `+operator+` `+inspect2(val2),`expected `+inspect2(val)+` to not be `+operator+` `+inspect2(val2))},assert.closeTo=function(act,exp,delta,msg){new Assertion(act,msg,assert.closeTo,!0).to.be.closeTo(exp,delta)},assert.approximately=function(act,exp,delta,msg){new Assertion(act,msg,assert.approximately,!0).to.be.approximately(exp,delta)},assert.sameMembers=function(set1,set2,msg){new Assertion(set1,msg,assert.sameMembers,!0).to.have.same.members(set2)},assert.notSameMembers=function(set1,set2,msg){new Assertion(set1,msg,assert.notSameMembers,!0).to.not.have.same.members(set2)},assert.sameDeepMembers=function(set1,set2,msg){new Assertion(set1,msg,assert.sameDeepMembers,!0).to.have.same.deep.members(set2)},assert.notSameDeepMembers=function(set1,set2,msg){new Assertion(set1,msg,assert.notSameDeepMembers,!0).to.not.have.same.deep.members(set2)},assert.sameOrderedMembers=function(set1,set2,msg){new Assertion(set1,msg,assert.sameOrderedMembers,!0).to.have.same.ordered.members(set2)},assert.notSameOrderedMembers=function(set1,set2,msg){new Assertion(set1,msg,assert.notSameOrderedMembers,!0).to.not.have.same.ordered.members(set2)},assert.sameDeepOrderedMembers=function(set1,set2,msg){new Assertion(set1,msg,assert.sameDeepOrderedMembers,!0).to.have.same.deep.ordered.members(set2)},assert.notSameDeepOrderedMembers=function(set1,set2,msg){new Assertion(set1,msg,assert.notSameDeepOrderedMembers,!0).to.not.have.same.deep.ordered.members(set2)},assert.includeMembers=function(superset,subset,msg){new Assertion(superset,msg,assert.includeMembers,!0).to.include.members(subset)},assert.notIncludeMembers=function(superset,subset,msg){new Assertion(superset,msg,assert.notIncludeMembers,!0).to.not.include.members(subset)},assert.includeDeepMembers=function(superset,subset,msg){new Assertion(superset,msg,assert.includeDeepMembers,!0).to.include.deep.members(subset)},assert.notIncludeDeepMembers=function(superset,subset,msg){new Assertion(superset,msg,assert.notIncludeDeepMembers,!0).to.not.include.deep.members(subset)},assert.includeOrderedMembers=function(superset,subset,msg){new Assertion(superset,msg,assert.includeOrderedMembers,!0).to.include.ordered.members(subset)},assert.notIncludeOrderedMembers=function(superset,subset,msg){new Assertion(superset,msg,assert.notIncludeOrderedMembers,!0).to.not.include.ordered.members(subset)},assert.includeDeepOrderedMembers=function(superset,subset,msg){new Assertion(superset,msg,assert.includeDeepOrderedMembers,!0).to.include.deep.ordered.members(subset)},assert.notIncludeDeepOrderedMembers=function(superset,subset,msg){new Assertion(superset,msg,assert.notIncludeDeepOrderedMembers,!0).to.not.include.deep.ordered.members(subset)},assert.oneOf=function(inList,list,msg){new Assertion(inList,msg,assert.oneOf,!0).to.be.oneOf(list)},assert.isIterable=function(obj,msg){if(obj==null||!obj[Symbol.iterator])throw msg=msg?`${msg} expected ${inspect2(obj)} to be an iterable`:`expected ${inspect2(obj)} to be an iterable`,new AssertionError(msg,void 0,assert.isIterable)},assert.changes=function(fn,obj,prop,msg){arguments.length===3&&typeof obj==`function`&&(msg=prop,prop=null),new Assertion(fn,msg,assert.changes,!0).to.change(obj,prop)},assert.changesBy=function(fn,obj,prop,delta,msg){if(arguments.length===4&&typeof obj==`function`){let tmpMsg=delta;delta=prop,msg=tmpMsg}else arguments.length===3&&(delta=prop,prop=null);new Assertion(fn,msg,assert.changesBy,!0).to.change(obj,prop).by(delta)},assert.doesNotChange=function(fn,obj,prop,msg){return arguments.length===3&&typeof obj==`function`&&(msg=prop,prop=null),new Assertion(fn,msg,assert.doesNotChange,!0).to.not.change(obj,prop)},assert.changesButNotBy=function(fn,obj,prop,delta,msg){if(arguments.length===4&&typeof obj==`function`){let tmpMsg=delta;delta=prop,msg=tmpMsg}else arguments.length===3&&(delta=prop,prop=null);new Assertion(fn,msg,assert.changesButNotBy,!0).to.change(obj,prop).but.not.by(delta)},assert.increases=function(fn,obj,prop,msg){return arguments.length===3&&typeof obj==`function`&&(msg=prop,prop=null),new Assertion(fn,msg,assert.increases,!0).to.increase(obj,prop)},assert.increasesBy=function(fn,obj,prop,delta,msg){if(arguments.length===4&&typeof obj==`function`){let tmpMsg=delta;delta=prop,msg=tmpMsg}else arguments.length===3&&(delta=prop,prop=null);new Assertion(fn,msg,assert.increasesBy,!0).to.increase(obj,prop).by(delta)},assert.doesNotIncrease=function(fn,obj,prop,msg){return arguments.length===3&&typeof obj==`function`&&(msg=prop,prop=null),new Assertion(fn,msg,assert.doesNotIncrease,!0).to.not.increase(obj,prop)},assert.increasesButNotBy=function(fn,obj,prop,delta,msg){if(arguments.length===4&&typeof obj==`function`){let tmpMsg=delta;delta=prop,msg=tmpMsg}else arguments.length===3&&(delta=prop,prop=null);new Assertion(fn,msg,assert.increasesButNotBy,!0).to.increase(obj,prop).but.not.by(delta)},assert.decreases=function(fn,obj,prop,msg){return arguments.length===3&&typeof obj==`function`&&(msg=prop,prop=null),new Assertion(fn,msg,assert.decreases,!0).to.decrease(obj,prop)},assert.decreasesBy=function(fn,obj,prop,delta,msg){if(arguments.length===4&&typeof obj==`function`){let tmpMsg=delta;delta=prop,msg=tmpMsg}else arguments.length===3&&(delta=prop,prop=null);new Assertion(fn,msg,assert.decreasesBy,!0).to.decrease(obj,prop).by(delta)},assert.doesNotDecrease=function(fn,obj,prop,msg){return arguments.length===3&&typeof obj==`function`&&(msg=prop,prop=null),new Assertion(fn,msg,assert.doesNotDecrease,!0).to.not.decrease(obj,prop)},assert.doesNotDecreaseBy=function(fn,obj,prop,delta,msg){if(arguments.length===4&&typeof obj==`function`){let tmpMsg=delta;delta=prop,msg=tmpMsg}else arguments.length===3&&(delta=prop,prop=null);return new Assertion(fn,msg,assert.doesNotDecreaseBy,!0).to.not.decrease(obj,prop).by(delta)},assert.decreasesButNotBy=function(fn,obj,prop,delta,msg){if(arguments.length===4&&typeof obj==`function`){let tmpMsg=delta;delta=prop,msg=tmpMsg}else arguments.length===3&&(delta=prop,prop=null);new Assertion(fn,msg,assert.decreasesButNotBy,!0).to.decrease(obj,prop).but.not.by(delta)},assert.ifError=function(val){if(val)throw val},assert.isExtensible=function(obj,msg){new Assertion(obj,msg,assert.isExtensible,!0).to.be.extensible},assert.isNotExtensible=function(obj,msg){new Assertion(obj,msg,assert.isNotExtensible,!0).to.not.be.extensible},assert.isSealed=function(obj,msg){new Assertion(obj,msg,assert.isSealed,!0).to.be.sealed},assert.isNotSealed=function(obj,msg){new Assertion(obj,msg,assert.isNotSealed,!0).to.not.be.sealed},assert.isFrozen=function(obj,msg){new Assertion(obj,msg,assert.isFrozen,!0).to.be.frozen},assert.isNotFrozen=function(obj,msg){new Assertion(obj,msg,assert.isNotFrozen,!0).to.not.be.frozen},assert.isEmpty=function(val,msg){new Assertion(val,msg,assert.isEmpty,!0).to.be.empty},assert.isNotEmpty=function(val,msg){new Assertion(val,msg,assert.isNotEmpty,!0).to.not.be.empty},assert.containsSubset=function(val,exp,msg){new Assertion(val,msg).to.containSubset(exp)},assert.doesNotContainSubset=function(val,exp,msg){new Assertion(val,msg).to.not.containSubset(exp)};for(let[name,as]of[[`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`],[`containsSubset`,`containSubset`]])assert[as]=assert[name];var used=[];function use(fn){let exports={use,AssertionError,util:utils_exports,config,expect,assert,Assertion,...should_exports};return~used.indexOf(fn)||(fn(exports,utils_exports),used.push(fn)),exports}__name(use,`use`);const plugin={serialize:(val,config,indentation,depth,refs,printer)=>{let name=val.getMockName(),nameString=name===`vi.fn()`?``:` ${name}`,callsString=``;if(val.mock.calls.length!==0){let indentationNext=indentation+config.indent;callsString=` {${config.spacingOuter}${indentationNext}"calls": ${printer(val.mock.calls,config,indentationNext,depth,refs)}${config.min?`, `:`,`}${config.spacingOuter}${indentationNext}"results": ${printer(val.mock.results,config,indentationNext,depth,refs)}${config.min?``:`,`}${config.spacingOuter}${indentation}}`}return`[MockFunction${nameString}]${callsString}`},test:val=>val&&!!val._isMockFunction},{DOMCollection,DOMElement,Immutable,ReactElement,ReactTestComponent,AsymmetricMatcher:AsymmetricMatcher$1}=plugins;let PLUGINS=[ReactTestComponent,ReactElement,DOMElement,DOMCollection,Immutable,AsymmetricMatcher$1,plugin];function addSerializer(plugin){PLUGINS=[plugin].concat(PLUGINS)}function getSerializers(){return PLUGINS}const lineSplitRE=/\r?\n/;function positionToOffset(source,lineNumber,columnNumber){let lines=source.split(lineSplitRE),nl=/\r\n/.test(source)?2:1,start=0;if(lineNumber>lines.length)return source.length;for(let i=0;i<lineNumber-1;i++)start+=lines[i].length+nl;return start+columnNumber}function offsetToLineNumber(source,offset){if(offset>source.length)throw Error(`offset is longer than source length! offset ${offset} > length ${source.length}`);let lines=source.split(lineSplitRE),nl=/\r\n/.test(source)?2:1,counted=0,line=0;for(;line<lines.length;line++){let lineLength=lines[line].length+nl;if(counted+lineLength>=offset)break;counted+=lineLength}return line+1}Object.freeze(()=>{}),globalThis.Event;function r(e=globalThis){let t=`unknown`,n=`unknown`;return e.Bun||e.process&&e.process.versions?.bun?(t=`bun`,n=e.Bun.version||`unknown`):e.Deno?(t=`deno`,n=e.Deno.version?.deno??`unknown`):e.process&&e.process.release?.name===`node`?(t=`node`,n=e.process.versions?.node??`unknown`):e.HermesInternal?(t=`hermes`,n=e.HermesInternal.getRuntimeProperties?.()[`OSS Release Version`]??`unknown`):i(e)&&e.navigator.userAgent===`Cloudflare-Workers`?t=`workerd`:i(e)&&e.navigator.userAgent.toLowerCase().startsWith(`quickjs-ng`)?(t=`quickjs-ng`,n=e.navigator.userAgent.split(`/`)[1]??`unknown`):typeof e.Netlify==`object`?t=`netlify`:typeof e.EdgeRuntime==`string`?t=`edge-light`:e.__lagon__?t=`lagon`:e.fastly?t=`fastly`:e.$262&&e.lockdown&&e.AsyncDisposableStack?t=`moddable`:e.d8?(t=`v8`,n=typeof e.version==`function`?e.version():`unknown`):e.inIon&&e.performance&&e.performance.mozMemory?t=`spidermonkey`:typeof e.$==`object`&&e.$!==null&&`IsHTMLDDA`in e.$?t=`jsc`:e.window&&e.navigator&&(t=`browser`),{runtime:t,version:n}}function i(e=globalThis){return typeof e.navigator==`object`&&e.navigator!==null&&typeof e.navigator.userAgent==`string`}const{runtime:a,version:o}=r();(async()=>{}).constructor,globalThis.performance.now.bind(globalThis.performance),globalThis.process?.hrtime?.bigint.bind(globalThis.process?.hrtime),globalThis.Bun?.nanoseconds;var require_branding=__commonJSMin((exports=>{Object.defineProperty(exports,"__esModule",{value:!0})})),require_messages=__commonJSMin((exports=>{Object.defineProperty(exports,"__esModule",{value:!0})})),require_overloads=__commonJSMin((exports=>{Object.defineProperty(exports,"__esModule",{value:!0})})),require_utils=__commonJSMin((exports=>{Object.defineProperty(exports,"__esModule",{value:!0})}));__commonJSMin((exports=>{var __createBinding=exports&&exports.__createBinding||(Object.create?(function(o,m,k,k2){k2===void 0&&(k2=k);var desc=Object.getOwnPropertyDescriptor(m,k);(!desc||(`get`in desc?!m.__esModule:desc.writable||desc.configurable))&&(desc={enumerable:!0,get:function(){return m[k]}}),Object.defineProperty(o,k2,desc)}):(function(o,m,k,k2){k2===void 0&&(k2=k),o[k2]=m[k]})),__exportStar=exports&&exports.__exportStar||function(m,exports$1){for(var p in m)p!=="default"&&!Object.prototype.hasOwnProperty.call(exports$1,p)&&__createBinding(exports$1,m,p)};Object.defineProperty(exports,"__esModule",{value:!0}),exports.expectTypeOf=void 0,__exportStar(require_branding(),exports),__exportStar(require_messages(),exports),__exportStar(require_overloads(),exports),__exportStar(require_utils(),exports);let fn=()=>!0;exports.expectTypeOf=_actual=>{let nonFunctionProperties=[`parameters`,`returns`,`resolves`,`not`,`items`,`constructorParameters`,`thisParameter`,`instance`,`guards`,`asserts`];function createBranded(){return{inspect:()=>!0,configure:()=>createBranded(),toEqualTypeOf:fn}}let obj={toBeAny:fn,toBeUnknown:fn,toBeNever:fn,toBeFunction:fn,toBeObject:fn,toBeArray:fn,toBeString:fn,toBeNumber:fn,toBeBoolean:fn,toBeVoid:fn,toBeSymbol:fn,toBeNull:fn,toBeUndefined:fn,toBeNullable:fn,toBeBigInt:fn,toMatchTypeOf:fn,toEqualTypeOf:fn,toBeConstructibleWith:fn,toMatchObjectType:fn,toExtend:fn,map:exports.expectTypeOf,toBeCallableWith:exports.expectTypeOf,extract:exports.expectTypeOf,exclude:exports.expectTypeOf,pick:exports.expectTypeOf,omit:exports.expectTypeOf,toHaveProperty:exports.expectTypeOf,parameter:exports.expectTypeOf,get branded(){return createBranded()}};return nonFunctionProperties.forEach(prop=>Object.defineProperty(obj,prop,{get:()=>(0,exports.expectTypeOf)({})})),obj}}))();var naturalCompare$1={exports:{}},hasRequiredNaturalCompare;function requireNaturalCompare(){if(hasRequiredNaturalCompare)return naturalCompare$1.exports;hasRequiredNaturalCompare=1;
71
+ /*
72
+ * @version 1.4.0
73
+ * @date 2015-10-26
74
+ * @stability 3 - Stable
75
+ * @author Lauri Rooden (https://github.com/litejs/natural-compare-lite)
76
+ * @license MIT License
77
+ */
78
+ var naturalCompare=function(a,b){var i,codeA,codeB=1,posA=0,posB=0,alphabet=String.alphabet;function getCode(str,pos,code){if(code){for(i=pos;code=getCode(str,i),code<76&&code>65;)++i;return+str.slice(pos-1,i)}return code=alphabet&&alphabet.indexOf(str.charAt(pos)),code>-1?code+76:(code=str.charCodeAt(pos)||0,code<45||code>127?code:code<46?65:code<48?code-1:code<58?code+18:code<65?code-11:code<91?code+11:code<97?code-37:code<123?code+5:code-63)}if((a+=``)!=(b+=``)){for(;codeB;)if(codeA=getCode(a,posA++),codeB=getCode(b,posB++),codeA<76&&codeB<76&&codeA>66&&codeB>66&&(codeA=getCode(a,posA,posA),codeB=getCode(b,posB,posA=i),posB=i),codeA!=codeB)return codeA<codeB?-1:1}return 0};try{naturalCompare$1.exports=naturalCompare}catch{String.naturalCompare=naturalCompare}return naturalCompare$1.exports}var naturalCompare=getDefaultExportFromCjs(requireNaturalCompare());function testNameToKey(testName,count){return`${testName} ${count}`}function keyToTestName(key){if(!/ \d+$/.test(key))throw Error(`Snapshot keys must end with a number.`);return key.replace(/ \d+$/,``)}function evaluateSnapshotFile(filepath,content){let data=Object.create(null);try{Function(`exports`,content)(data)}catch(cause){throw Error(`Invalid snapshot file, please manually fix or delete it: ${filepath}`,{cause})}return data}function addExtraLineBreaks(string){return string.includes(`
79
+ `)?`\n${string}\n`:string}function removeExtraLineBreaks(string){return string.length>2&&string[0]===`
80
+ `&&string.endsWith(`
81
+ `)?string.slice(1,-1):string}function serialize(val,indent=2,formatOverrides={}){return normalizeNewlines(format$1(val,{escapeRegex:!0,indent,plugins:getSerializers(),printFunctionName:!1,...formatOverrides}))}function escapeBacktickString(str){return str.replace(/`|\\|\$\{/g,`\\$&`)}function printBacktickString(str){return`\`${escapeBacktickString(str)}\``}function normalizeNewlines(string){return string.replace(/\r\n|\r/g,`
82
+ `)}async function saveSnapshotFile(environment,snapshotData,snapshotPath){let snapshots=Object.keys(snapshotData).sort(naturalCompare).map(key=>`exports[${printBacktickString(key)}] = ${printBacktickString(normalizeNewlines(snapshotData[key]))};`),content=`${environment.getHeader()}\n\n${snapshots.join(`
83
+
84
+ `)}\n`,oldContent=await environment.readSnapshotFile(snapshotPath);(oldContent==null||oldContent!==content)&&await environment.saveSnapshotFile(snapshotPath,content)}function deepMergeArray(target=[],source=[]){let mergedOutput=Array.from(target);return source.forEach((sourceElement,index)=>{let targetElement=mergedOutput[index];Array.isArray(target[index])?mergedOutput[index]=deepMergeArray(target[index],sourceElement):isObject(targetElement)?mergedOutput[index]=deepMergeSnapshot(target[index],sourceElement):mergedOutput[index]=sourceElement}),mergedOutput}function deepMergeSnapshot(target,source){if(isObject(target)&&isObject(source)){let mergedOutput={...target};return Object.keys(source).forEach(key=>{isObject(source[key])&&!source[key].$$typeof?key in target?mergedOutput[key]=deepMergeSnapshot(target[key],source[key]):Object.assign(mergedOutput,{[key]:source[key]}):Array.isArray(source[key])?mergedOutput[key]=deepMergeArray(target[key],source[key]):Object.assign(mergedOutput,{[key]:source[key]})}),mergedOutput}return Array.isArray(target)&&Array.isArray(source)?deepMergeArray(target,source):target}var DefaultMap=class extends Map{defaultFn;constructor(defaultFn,entries){super(entries),this.defaultFn=defaultFn}get(key){return this.has(key)||this.set(key,this.defaultFn(key)),super.get(key)}},CounterMap=class extends DefaultMap{constructor(){super(()=>0)}_total;valueOf(){return this._total=this.total()}increment(key){this._total!==void 0&&this._total++,this.set(key,this.get(key)+1)}total(){if(this._total!==void 0)return this._total;let total=0;for(let x of this.values())total+=x;return total}};function memo(fn){let cache=new Map;return arg=>(cache.has(arg)||cache.set(arg,fn(arg)),cache.get(arg))}async function saveInlineSnapshots(environment,snapshots){let MagicString=(await import(`../dist-ByNfzdQp.mjs`)).default,files=new Set(snapshots.map(i=>i.file));await Promise.all(Array.from(files).map(async file=>{let snaps=snapshots.filter(i=>i.file===file),code=await environment.readSnapshotFile(file);if(code==null)throw Error(`cannot read ${file} when saving inline snapshot`);let s=new MagicString(code);for(let snap of snaps)replaceInlineSnap(code,s,positionToOffset(code,snap.line,snap.column),snap.snapshot,snap.assertionName);let transformed=s.toString();transformed!==code&&await environment.saveSnapshotFile(file,transformed)}))}const defaultStartObjectRegex=/(?:toMatchInlineSnapshot|toThrowErrorMatchingInlineSnapshot)\s*\(\s*(?:\/\*[\s\S]*\*\/\s*|\/\/.*(?:[\n\r\u2028\u2029]\s*|[\t\v\f \xA0\u1680\u2000-\u200A\u202F\u205F\u3000\uFEFF]))*\{/;function escapeRegExp(s){return s.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}const buildStartObjectRegex=memo(assertionName=>{let replaced=defaultStartObjectRegex.source.replace(`toMatchInlineSnapshot|toThrowErrorMatchingInlineSnapshot`,escapeRegExp(assertionName));return new RegExp(replaced)});function replaceObjectSnap(code,s,index,newSnap,assertionName){let _code=code.slice(index),startMatch=(assertionName?buildStartObjectRegex(assertionName):defaultStartObjectRegex).exec(_code);if(!startMatch)return!1;_code=_code.slice(startMatch.index);let callEnd=getCallLastIndex(_code);if(callEnd===null)return!1;callEnd+=index+startMatch.index;let shapeEnd=getObjectShapeEndIndex(code,index+startMatch.index+startMatch[0].length),snap=`, ${prepareSnapString(newSnap,code,index)}`;return shapeEnd===callEnd?s.appendLeft(callEnd,snap):s.overwrite(shapeEnd,callEnd,snap),!0}function getObjectShapeEndIndex(code,index){let startBraces=1,endBraces=0;for(;startBraces!==endBraces&&index<code.length;){let s=code[index++];s===`{`?startBraces++:s===`}`&&endBraces++}return index}function prepareSnapString(snap,source,index){let lineNumber=offsetToLineNumber(source,index),indent=source.split(lineSplitRE)[lineNumber-1].match(/^\s*/)[0]||``,indentNext=indent.includes(` `)?`${indent}\t`:`${indent} `,lines=snap.trim().replace(/\\/g,`\\\\`).split(/\n/g);return lines.length<=1?`\`${lines.join(`
85
+ `).replace(/`/g,"\\`").replace(/\$\{/g,"\\${")}\``:`\`\n${lines.map(i=>i?indentNext+i:``).join(`
86
+ `).replace(/`/g,"\\`").replace(/\$\{/g,"\\${")}\n${indent}\``}const defaultMethodNames=[`toMatchInlineSnapshot`,`toThrowErrorMatchingInlineSnapshot`];function getCodeStartingAtIndex(code,index,methodNames){for(let name of methodNames){let adjusted=index-name.length;if(adjusted>=0&&code.slice(adjusted,index)===name)return{code:code.slice(adjusted),index:adjusted}}return{code:code.slice(index),index}}const defaultStartRegex=/(?:toMatchInlineSnapshot|toThrowErrorMatchingInlineSnapshot)\s*\(\s*(?:\/\*[\s\S]*\*\/\s*|\/\/.*(?:[\n\r\u2028\u2029]\s*|[\t\v\f \xA0\u1680\u2000-\u200A\u202F\u205F\u3000\uFEFF]))*[\w$]*(['"`)])/,buildStartRegex=memo(assertionName=>{let replaced=defaultStartRegex.source.replace(`toMatchInlineSnapshot|toThrowErrorMatchingInlineSnapshot`,escapeRegExp(assertionName));return new RegExp(replaced)});function replaceInlineSnap(code,s,currentIndex,newSnap,assertionName){let{code:codeStartingAtIndex,index}=getCodeStartingAtIndex(code,currentIndex,assertionName?[assertionName]:defaultMethodNames),startMatch=(assertionName?buildStartRegex(assertionName):defaultStartRegex).exec(codeStartingAtIndex),firstKeywordMatch=(assertionName?new RegExp(escapeRegExp(assertionName)):/toMatchInlineSnapshot|toThrowErrorMatchingInlineSnapshot/).exec(codeStartingAtIndex);if(!startMatch||startMatch.index!==firstKeywordMatch?.index)return replaceObjectSnap(code,s,index,newSnap,assertionName);let quote=startMatch[1],startIndex=index+startMatch.index+startMatch[0].length,snapString=prepareSnapString(newSnap,code,index);if(quote===`)`)return s.appendRight(startIndex-1,snapString),!0;let endMatch=RegExp(`(?:^|[^\\\\])${quote}`).exec(code.slice(startIndex));if(!endMatch)return!1;let endIndex=startIndex+endMatch.index+endMatch[0].length;return s.overwrite(startIndex-1,endIndex,snapString),!0}const INDENTATION_REGEX=/^([^\S\n]*)\S/m;function stripSnapshotIndentation(inlineSnapshot){let match=inlineSnapshot.match(INDENTATION_REGEX);if(!match||!match[1])return inlineSnapshot;let indentation=match[1],lines=inlineSnapshot.split(/\n/g);if(lines.length<=2||lines[0].trim()!==``||lines.at(-1)?.trim()!==``)return inlineSnapshot;for(let i=1;i<lines.length-1;i++)if(lines[i]!==``){if(lines[i].indexOf(indentation)!==0)return inlineSnapshot;lines[i]=lines[i].substring(indentation.length)}return lines[lines.length-1]=``,inlineSnapshot=lines.join(`
87
+ `),inlineSnapshot}async function saveRawSnapshots(environment,snapshots){await Promise.all(snapshots.map(async snap=>{snap.readonly||await environment.saveSnapshotFile(snap.file,snap.snapshot)}))}function isSameStackPosition(x,y){return x.file===y.file&&x.column===y.column&&x.line===y.line}var SnapshotState=class SnapshotState{testFilePath;snapshotPath;_counters=new CounterMap;_dirty;_updateSnapshot;_snapshotData;_initialData;_inlineSnapshots;_inlineSnapshotStacks;_testIdToKeys=new DefaultMap(()=>[]);_rawSnapshots;_uncheckedKeys;_snapshotFormat;_environment;_fileExists;expand;_added=new CounterMap;_matched=new CounterMap;_unmatched=new CounterMap;_updated=new CounterMap;get added(){return this._added}set added(value){this._added._total=value}get matched(){return this._matched}set matched(value){this._matched._total=value}get unmatched(){return this._unmatched}set unmatched(value){this._unmatched._total=value}get updated(){return this._updated}set updated(value){this._updated._total=value}constructor(testFilePath,snapshotPath,fileData,options){this.testFilePath=testFilePath,this.snapshotPath=snapshotPath;let data=fileData??Object.create(null);this._fileExists=fileData!=null;let update=options.updateSnapshot,dirty=(update===`all`||update===`new`)&&fileData!=null;this._initialData={...data},this._snapshotData={...data},this._dirty=dirty,this._inlineSnapshots=[],this._inlineSnapshotStacks=[],this._rawSnapshots=[],this._uncheckedKeys=new Set(Object.keys(this._snapshotData)),this.expand=options.expand||!1,this._updateSnapshot=options.updateSnapshot,this._snapshotFormat={printBasicPrototype:!1,escapeString:!1,maxOutputLength:2**27,...options.snapshotFormat},this._environment=options.snapshotEnvironment}static async create(testFilePath,options){let environment=options.snapshotEnvironment,snapshotPath=await environment.resolvePath(testFilePath),fileData;if(environment.readSnapshotFileData)fileData=await environment.readSnapshotFileData(snapshotPath);else{let content=await environment.readSnapshotFile(snapshotPath);fileData=content==null?null:evaluateSnapshotFile(snapshotPath,content)}return new SnapshotState(testFilePath,snapshotPath,fileData,options)}get snapshotUpdateState(){return this._updateSnapshot}get environment(){return this._environment}markSnapshotsAsCheckedForTest(testName){this._uncheckedKeys.forEach(uncheckedKey=>{uncheckedKey.startsWith(testName)&&/^ \d+$|^ > /.test(uncheckedKey.slice(testName.length))&&this._uncheckedKeys.delete(uncheckedKey)})}clearTest(testId){this._inlineSnapshots=this._inlineSnapshots.filter(s=>s.testId!==testId),this._inlineSnapshotStacks=this._inlineSnapshotStacks.filter(s=>s.testId!==testId);for(let key of this._testIdToKeys.get(testId)){let name=keyToTestName(key),count=this._counters.get(name);count>0&&((key in this._snapshotData||key in this._initialData)&&(this._snapshotData[key]=this._initialData[key]),this._counters.set(name,count-1))}this._testIdToKeys.delete(testId),this.added.delete(testId),this.updated.delete(testId),this.matched.delete(testId),this.unmatched.delete(testId)}_inferInlineSnapshotStack(stacks){let promiseIndex=stacks.findIndex(i=>i.method.match(/__VITEST_(RESOLVES|REJECTS)__/));if(promiseIndex!==-1)return stacks[promiseIndex+3];let pollChainIndex=stacks.findIndex(i=>i.method.match(/__VITEST_POLL_CHAIN__/));if(pollChainIndex!==-1)return stacks[pollChainIndex+1];for(let i=0;i<stacks.length;i++){let match=stacks[i].method.match(/__INLINE_SNAPSHOT_OFFSET_(\d+)__/);if(match)return stacks[i+Number(match[1])]??null}let customMatcherIndex=stacks.findIndex(i=>i.method.includes(`__VITEST_EXTEND_ASSERTION__`));if(customMatcherIndex!==-1)return stacks[customMatcherIndex+3]??null;let stackIndex=stacks.findIndex(i=>i.method.includes(`__INLINE_SNAPSHOT__`));return stackIndex===-1?null:stacks[stackIndex+2]}_addSnapshot(key,receivedSerialized,options){this._dirty=!0,options.stack?this._inlineSnapshots.push({...options.stack,snapshot:receivedSerialized,testId:options.testId,assertionName:options.assertionName}):options.rawSnapshot?this._rawSnapshots.push({...options.rawSnapshot,snapshot:receivedSerialized}):this._snapshotData[key]=receivedSerialized}_resolveKey(testId,testName,key){this._counters.increment(testName);let count=this._counters.get(testName);return key||=testNameToKey(testName,count),this._testIdToKeys.get(testId).push(key),{key,count}}_resolveInlineStack(options){let{testId,snapshot,assertionName,error}=options,stacks=parseErrorStacktrace(error,{ignoreStackEntries:[]}),_stack=this._inferInlineSnapshotStack(stacks);if(!_stack){let message=stacks.map(s=>` ${s.file}:${s.line}:${s.column}${s.method?` (${s.method})`:``}`).join(`
88
+ `);throw Error(`@vitest/snapshot: Couldn't infer stack frame for inline snapshot.\n${message}`)}let stack=this.environment.processStackTrace?.(_stack)||_stack;stack.column--;let snapshotsWithSameStack=this._inlineSnapshotStacks.filter(s=>isSameStackPosition(s,stack));if(snapshotsWithSameStack.length>0){this._inlineSnapshots=this._inlineSnapshots.filter(s=>!isSameStackPosition(s,stack));let differentSnapshot=snapshotsWithSameStack.find(s=>s.snapshot!==snapshot);if(differentSnapshot)throw Object.assign(Error(`${assertionName} with different snapshots cannot be called at the same location`),{actual:snapshot,expected:differentSnapshot.snapshot})}return this._inlineSnapshotStacks.push({...stack,testId,snapshot}),stack}_reconcile(opts){return opts.hasSnapshot&&this._updateSnapshot===`all`||(!opts.hasSnapshot||!opts.snapshotIsPersisted)&&(this._updateSnapshot===`new`||this._updateSnapshot===`all`)?(this._updateSnapshot===`all`?opts.pass?this.matched.increment(opts.testId):(opts.hasSnapshot?this.updated.increment(opts.testId):this.added.increment(opts.testId),this._addSnapshot(opts.key,opts.addValue,{stack:opts.stack,testId:opts.testId,rawSnapshot:opts.rawSnapshot,assertionName:opts.assertionName})):(this._addSnapshot(opts.key,opts.addValue,{stack:opts.stack,testId:opts.testId,rawSnapshot:opts.rawSnapshot,assertionName:opts.assertionName}),this.added.increment(opts.testId)),{actual:``,count:opts.count,expected:``,key:opts.key,pass:!0}):opts.pass?(this.matched.increment(opts.testId),{actual:``,count:opts.count,expected:``,key:opts.key,pass:!0}):(this.unmatched.increment(opts.testId),{actual:opts.actualDisplay,count:opts.count,expected:opts.expectedDisplay,key:opts.key,pass:!1})}async save(){let hasExternalSnapshots=Object.keys(this._snapshotData).length,hasInlineSnapshots=this._inlineSnapshots.length,hasRawSnapshots=this._rawSnapshots.length,isEmpty=!hasExternalSnapshots&&!hasInlineSnapshots&&!hasRawSnapshots,status={deleted:!1,saved:!1};return(this._dirty||this._uncheckedKeys.size)&&!isEmpty?(hasExternalSnapshots&&(await saveSnapshotFile(this._environment,this._snapshotData,this.snapshotPath),this._fileExists=!0),hasInlineSnapshots&&await saveInlineSnapshots(this._environment,this._inlineSnapshots),hasRawSnapshots&&await saveRawSnapshots(this._environment,this._rawSnapshots),status.saved=!0):!hasExternalSnapshots&&this._fileExists&&(this._updateSnapshot===`all`&&(await this._environment.removeSnapshotFile(this.snapshotPath),this._fileExists=!1),status.deleted=!0),status}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(key=>delete this._snapshotData[key]),this._uncheckedKeys.clear())}probeExpectedSnapshot(options){let count=this._counters.get(options.testName)+1,key=testNameToKey(options.testName,count);return{key,count,data:options?.isInline?options.inlineSnapshot:this._snapshotData[key],markAsChecked:()=>{this._counters.increment(options.testName),this._testIdToKeys.get(options.testId).push(key),this._uncheckedKeys.delete(key)}}}match({testId,testName,received,key,inlineSnapshot,isInline,error,rawSnapshot,assertionName}){let resolved=this._resolveKey(testId,testName,key);key=resolved.key;let count=resolved.count;isInline&&this._snapshotData[key]!==void 0||this._uncheckedKeys.delete(key);let receivedSerialized=rawSnapshot&&typeof received==`string`?received:serialize(received,void 0,this._snapshotFormat);rawSnapshot||(receivedSerialized=addExtraLineBreaks(receivedSerialized)),rawSnapshot&&rawSnapshot.content&&/\r\n/.test(rawSnapshot.content)&&!/\r\n/.test(receivedSerialized)&&(rawSnapshot.content=normalizeNewlines(rawSnapshot.content));let expected=isInline?inlineSnapshot:rawSnapshot?rawSnapshot.content:this._snapshotData[key],expectedTrimmed=rawSnapshot?expected:expected?.trim(),pass=expectedTrimmed===(rawSnapshot?receivedSerialized:receivedSerialized.trim()),hasSnapshot=expected!==void 0,snapshotIsPersisted=isInline||this._fileExists||rawSnapshot&&rawSnapshot.content!=null;pass&&!isInline&&!rawSnapshot&&(this._snapshotData[key]=receivedSerialized);let stack=isInline?this._resolveInlineStack({testId,snapshot:receivedSerialized,assertionName:assertionName||`toMatchInlineSnapshot`,error:error||Error(`snapshot`)}):void 0;return this._reconcile({testId,key,count,pass,hasSnapshot,snapshotIsPersisted:!!snapshotIsPersisted,addValue:receivedSerialized,actualDisplay:rawSnapshot?receivedSerialized:removeExtraLineBreaks(receivedSerialized),expectedDisplay:expectedTrimmed===void 0?void 0:rawSnapshot?expectedTrimmed:removeExtraLineBreaks(expectedTrimmed),stack,rawSnapshot,assertionName})}processDomainSnapshot({testId,received,expectedSnapshot,matchResult,isInline,error,assertionName}){let stack=isInline?this._resolveInlineStack({testId,snapshot:received,assertionName,error:error||Error(`STACK_TRACE_ERROR`)}):void 0,actualResolved=matchResult?.resolved??received,expectedResolved=matchResult?.expected??expectedSnapshot.data;return this._reconcile({testId,key:expectedSnapshot.key,count:expectedSnapshot.count,pass:matchResult?.pass??!1,hasSnapshot:expectedSnapshot.data!==void 0,snapshotIsPersisted:isInline?!0:this._fileExists,addValue:actualResolved,actualDisplay:removeExtraLineBreaks(actualResolved),expectedDisplay:expectedResolved===void 0?void 0:removeExtraLineBreaks(expectedResolved),stack,assertionName})}async pack(){let snapshot={filepath:this.testFilePath,added:0,fileDeleted:!1,matched:0,unchecked:0,uncheckedKeys:[],unmatched:0,updated:0},uncheckedCount=this.getUncheckedCount(),uncheckedKeys=this.getUncheckedKeys();uncheckedCount&&this.removeUncheckedKeys();let status=await this.save();return snapshot.fileDeleted=status.deleted,snapshot.added=this.added.total(),snapshot.matched=this.matched.total(),snapshot.unmatched=this.unmatched.total(),snapshot.updated=this.updated.total(),snapshot.unchecked=status.deleted?0:uncheckedCount,snapshot.uncheckedKeys=Array.from(uncheckedKeys),snapshot}};function createMismatchError(message,expand,actual,expected){let error=Error(message);return Object.defineProperty(error,"actual",{value:actual,enumerable:!0,configurable:!0,writable:!0}),Object.defineProperty(error,"expected",{value:expected,enumerable:!0,configurable:!0,writable:!0}),Object.defineProperty(error,"diffOptions",{value:{expand}}),error}var SnapshotClient=class{options;snapshotStateMap=new Map;constructor(options={}){this.options=options}async setup(filepath,options){this.snapshotStateMap.has(filepath)||this.snapshotStateMap.set(filepath,await SnapshotState.create(filepath,options))}async finish(filepath){let result=await this.getSnapshotState(filepath).pack();return this.snapshotStateMap.delete(filepath),result}skipTest(filepath,testName){this.getSnapshotState(filepath).markSnapshotsAsCheckedForTest(testName)}clearTest(filepath,testId){this.getSnapshotState(filepath).clearTest(testId)}getSnapshotState(filepath){let state=this.snapshotStateMap.get(filepath);if(!state)throw Error(`The snapshot state for '${filepath}' is not found. Did you call 'SnapshotClient.setup()'?`);return state}match(options){let{filepath,name,testId=name,message,isInline=!1,properties,inlineSnapshot,error,errorMessage,rawSnapshot,assertionName}=options,{received}=options;if(!filepath)throw Error(`Snapshot cannot be used outside of test`);let snapshotState=this.getSnapshotState(filepath);if(rawSnapshot?.file===snapshotState.snapshotPath)throw Error(`File snapshot cannot use the same path as the test snapshot file: ${rawSnapshot.file}`);let testName=[name,...message?[message]:[]].join(` > `),expectedSnapshot=snapshotState.probeExpectedSnapshot({testName,testId,isInline,inlineSnapshot});if(typeof properties==`object`){if(typeof received!=`object`||!received)throw expectedSnapshot.markAsChecked(),Error(`Received value must be an object when the matcher has properties`);let propertiesPass;try{propertiesPass=this.options.isEqual?.(received,properties)??!1}catch(err){throw expectedSnapshot.markAsChecked(),err}if(!propertiesPass)return expectedSnapshot.markAsChecked(),{pass:!1,message:()=>errorMessage||`Snapshot properties mismatched`,actual:received,expected:properties};received=deepMergeSnapshot(received,properties)}let{actual,expected,key,pass}=snapshotState.match({testId,testName,received,isInline,error,inlineSnapshot,rawSnapshot,assertionName});return{pass,message:()=>`Snapshot \`${key||`unknown`}\` mismatched`,actual:rawSnapshot?actual:actual?.trim(),expected:rawSnapshot?expected:expected?.trim()}}assert(options){let result=this.match(options);if(!result.pass){let snapshotState=this.getSnapshotState(options.filepath);throw createMismatchError(result.message(),snapshotState.expand,result.actual,result.expected)}}matchDomain(options){let{received,filepath,name,testId=name,message,adapter,isInline=!1,inlineSnapshot,error}=options;if(!filepath)throw Error(`Snapshot cannot be used outside of test`);let captured=adapter.capture(received),rendered=adapter.render(captured),snapshotState=this.getSnapshotState(filepath),testName=[name,...message?[message]:[]].join(` > `),expectedSnapshot=snapshotState.probeExpectedSnapshot({testName,testId,isInline,inlineSnapshot});expectedSnapshot.markAsChecked();let matchResult=expectedSnapshot.data===void 0?void 0:adapter.match(captured,adapter.parseExpected(expectedSnapshot.data)),{actual,expected,key,pass}=snapshotState.processDomainSnapshot({testId,received:rendered,expectedSnapshot,matchResult,isInline,error,assertionName:options.assertionName});return{pass,message:()=>`Snapshot \`${key}\` mismatched`,actual:actual?.trim(),expected:expected?.trim()}}async pollMatchDomain(options){let{poll,filepath,name,testId=name,message,adapter,isInline=!1,inlineSnapshot,error,timeout=1e3,interval=50}=options;if(!filepath)throw Error(`Snapshot cannot be used outside of test`);let snapshotState=this.getSnapshotState(filepath),testName=[name,...message?[message]:[]].join(` > `),expectedSnapshot=snapshotState.probeExpectedSnapshot({testName,testId,isInline,inlineSnapshot}),reference=expectedSnapshot.data!==void 0&&snapshotState.snapshotUpdateState!==`all`?adapter.parseExpected(expectedSnapshot.data):void 0,timeoutController=new AbortController,stableResult=await getStableSnapshot({adapter,poll:()=>poll({signal:timeoutController.signal}),interval,timedOut:timeout>0?new Promise(r=>setTimeout(()=>{timeoutController.abort(),r()},timeout)):void 0,match:reference?captured=>adapter.match(captured,reference).pass:void 0});if(expectedSnapshot.markAsChecked(),stableResult?.rendered===void 0){if(stableResult?.lastPollError)throw stableResult.lastPollError;return{pass:!1,message:()=>`poll() did not produce a stable snapshot within the timeout`}}let matchResult=expectedSnapshot.data===void 0?void 0:adapter.match(stableResult.captured,adapter.parseExpected(expectedSnapshot.data)),{actual,expected,key,pass}=snapshotState.processDomainSnapshot({testId,received:stableResult.rendered,expectedSnapshot,matchResult,isInline,error,assertionName:options.assertionName});return{pass,message:()=>`Snapshot \`${key}\` mismatched`,actual:actual?.trim(),expected:expected?.trim()}}async assertRaw(options){if(!options.rawSnapshot)throw Error(`Raw snapshot is required`);let{filepath,rawSnapshot}=options;if(rawSnapshot.content==null){if(!filepath)throw Error(`Snapshot cannot be used outside of test`);let snapshotState=this.getSnapshotState(filepath);options.filepath||=filepath,rawSnapshot.file=await snapshotState.environment.resolveRawPath(filepath,rawSnapshot.file),rawSnapshot.content=await snapshotState.environment.readSnapshotFile(rawSnapshot.file)??void 0}return this.assert(options)}clear(){this.snapshotStateMap.clear()}};async function getStableSnapshot({adapter,poll,interval,timedOut,match}){let lastRendered,lastPollError,lastStable;for(;;){try{let pollResult=await raceWith$1(Promise.resolve(poll()),timedOut);if(!pollResult.ok)break;let captured=adapter.capture(pollResult.value),rendered=adapter.render(captured);if(lastRendered!==void 0&&rendered===lastRendered){if(lastStable={captured,rendered},!match||match(captured))break}else lastRendered=rendered,lastStable=void 0}catch(pollError){lastRendered=void 0,lastStable=void 0,lastPollError=pollError}if(!(await raceWith$1(new Promise(r=>setTimeout(r,interval)),timedOut)).ok)break}return{...lastStable,lastPollError}}function raceWith$1(promise,other){let left=promise.then(value=>({ok:!0,value}));return other?Promise.race([left,other.then(value=>({ok:!1,value}))]):left}const ChaiStyleAssertions=(chai,utils)=>{function defProperty(name,delegateTo){utils.addProperty(chai.Assertion.prototype,name,function(){let jestMethod=chai.Assertion.prototype[delegateTo];if(!jestMethod)throw Error(`Cannot delegate to ${String(delegateTo)}: method not found. Ensure JestChaiExpect plugin is loaded first.`);return jestMethod.call(this)})}function defPropertyWithArgs(name,delegateTo,...args){utils.addProperty(chai.Assertion.prototype,name,function(){let jestMethod=chai.Assertion.prototype[delegateTo];if(!jestMethod)throw Error(`Cannot delegate to ${String(delegateTo)}: method not found. Ensure JestChaiExpect plugin is loaded first.`);return jestMethod.call(this,...args)})}function defMethod(name,delegateTo){utils.addMethod(chai.Assertion.prototype,name,function(...args){let jestMethod=chai.Assertion.prototype[delegateTo];if(!jestMethod)throw Error(`Cannot delegate to ${String(delegateTo)}: method not found. Ensure JestChaiExpect plugin is loaded first.`);return jestMethod.call(this,...args)})}defProperty(`called`,`toHaveBeenCalled`),defProperty(`calledOnce`,`toHaveBeenCalledOnce`),defPropertyWithArgs(`calledTwice`,`toHaveBeenCalledTimes`,2),defPropertyWithArgs(`calledThrice`,`toHaveBeenCalledTimes`,3),defMethod(`callCount`,`toHaveBeenCalledTimes`),defMethod(`calledWith`,`toHaveBeenCalledWith`),defMethod(`calledOnceWith`,`toHaveBeenCalledExactlyOnceWith`),defMethod(`lastCalledWith`,`toHaveBeenLastCalledWith`),defMethod(`nthCalledWith`,`toHaveBeenNthCalledWith`),defMethod(`returned`,`toHaveReturned`),defMethod(`returnedWith`,`toHaveReturnedWith`),defMethod(`returnedTimes`,`toHaveReturnedTimes`),defMethod(`lastReturnedWith`,`toHaveLastReturnedWith`),defMethod(`nthReturnedWith`,`toHaveNthReturnedWith`),defMethod(`calledBefore`,`toHaveBeenCalledBefore`),defMethod(`calledAfter`,`toHaveBeenCalledAfter`)},MATCHERS_OBJECT=Symbol.for(`matchers-object`),JEST_MATCHERS_OBJECT=Symbol.for(`$$jest-matchers-object`),GLOBAL_EXPECT=Symbol.for(`expect-global`),ASYMMETRIC_MATCHERS_OBJECT=Symbol.for(`asymmetric-matchers-object`),customMatchers={toSatisfy(actual,expected,message){let{printReceived,printExpected,matcherHint}=this.utils,pass=expected(actual);return{pass,message:()=>pass?`\
89
+ ${matcherHint(`.not.toSatisfy`,`received`,``)}
90
+
91
+ Expected value to not satisfy:
92
+ ${message||printExpected(expected)}
93
+ Received:
94
+ ${printReceived(actual)}`:`\
95
+ ${matcherHint(`.toSatisfy`,`received`,``)}
96
+
97
+ Expected value to satisfy:
98
+ ${message||printExpected(expected)}
99
+
100
+ Received:
101
+ ${printReceived(actual)}`}},toBeOneOf(actual,expected){let{equals,customTesters}=this,{printReceived,printExpected,matcherHint}=this.utils,pass;if(Array.isArray(expected))pass=expected.length===0||expected.some(item=>equals(item,actual,customTesters));else if(expected instanceof Set)pass=expected.size===0||expected.has(actual)||[...expected].some(item=>equals(item,actual,customTesters));else throw TypeError(`You must provide an array or set to ${matcherHint(`.toBeOneOf`)}, not '${typeof expected}'.`);return{pass,message:()=>pass?`\
102
+ ${matcherHint(`.not.toBeOneOf`,`received`,``)}
103
+
104
+ Expected value to not be one of:
105
+ ${printExpected(expected)}
106
+ Received:
107
+ ${printReceived(actual)}`:`\
108
+ ${matcherHint(`.toBeOneOf`,`received`,``)}
109
+
110
+ Expected value to be one of:
111
+ ${printExpected(expected)}
112
+
113
+ Received:
114
+ ${printReceived(actual)}`}}},EXPECTED_COLOR=y$1.green,RECEIVED_COLOR=y$1.red,INVERTED_COLOR=y$1.inverse,BOLD_WEIGHT=y$1.bold,DIM_COLOR=y$1.dim;function matcherHint(matcherName,received=`received`,expected=`expected`,options={}){let{comment=``,isDirectExpectCall=!1,isNot=!1,promise=``,secondArgument=``,expectedColor=EXPECTED_COLOR,receivedColor=RECEIVED_COLOR,secondArgumentColor=EXPECTED_COLOR}=options,hint=``,dimString=`expect`;return!isDirectExpectCall&&received!==``&&(hint+=DIM_COLOR(`${dimString}(`)+receivedColor(received),dimString=`)`),promise!==``&&(hint+=DIM_COLOR(`${dimString}.`)+promise,dimString=``),isNot&&(hint+=`${DIM_COLOR(`${dimString}.`)}not`,dimString=``),matcherName.includes(`.`)?dimString+=matcherName:(hint+=DIM_COLOR(`${dimString}.`)+matcherName,dimString=``),expected===``?dimString+=`()`:(hint+=DIM_COLOR(`${dimString}(`)+expectedColor(expected),secondArgument&&(hint+=DIM_COLOR(`, `)+secondArgumentColor(secondArgument)),dimString=`)`),comment!==``&&(dimString+=` // ${comment}`),dimString!==``&&(hint+=DIM_COLOR(dimString)),hint}function replaceTrailingSpaces(text){return text.replace(/\s+$/gm,spaces=>`·`.repeat(spaces.length))}function printReceived(object){return RECEIVED_COLOR(replaceTrailingSpaces(stringify(object)))}function printExpected(value){return EXPECTED_COLOR(replaceTrailingSpaces(stringify(value)))}function getMatcherUtils(){return{EXPECTED_COLOR,RECEIVED_COLOR,INVERTED_COLOR,BOLD_WEIGHT,DIM_COLOR,diff,matcherHint,printReceived,printExpected,printDiffOrStringify,printWithType}}function printWithType(name,value,print){let type=getType$1(value);return(type!==`null`&&type!==`undefined`?`${name} has type: ${type}\n`:``)+`${name} has value: ${print(value)}`}function addCustomEqualityTesters(newTesters){if(!Array.isArray(newTesters))throw TypeError(`expect.customEqualityTesters: Must be set to an array of Testers. Was given "${getType$1(newTesters)}"`);globalThis[JEST_MATCHERS_OBJECT].customEqualityTesters.push(...newTesters)}function getCustomEqualityTesters(){return globalThis[JEST_MATCHERS_OBJECT].customEqualityTesters}function equals(a,b,customTesters,strictCheck){return customTesters||=[],eq(a,b,[],[],customTesters,strictCheck?hasKey:hasDefinedKey)}function isAsymmetric(obj){return!!obj&&typeof obj==`object`&&`asymmetricMatch`in obj&&isA(`Function`,obj.asymmetricMatch)}function asymmetricMatch(a,b,customTesters){let asymmetricA=isAsymmetric(a),asymmetricB=isAsymmetric(b);if(!(asymmetricA&&asymmetricB)){if(asymmetricA)return a.asymmetricMatch(b,customTesters);if(asymmetricB)return b.asymmetricMatch(a,customTesters)}}function isError(value){if(typeof Error.isError==`function`)return Error.isError(value);switch(Object.prototype.toString.call(value)){case`[object Error]`:case`[object Exception]`:case`[object DOMException]`:return!0;default:return value instanceof Error}}function eq(a,b,aStack,bStack,customTesters,hasKey){let result=!0,asymmetricResult=asymmetricMatch(a,b,customTesters);if(asymmetricResult!==void 0)return asymmetricResult;let testerContext={equals};for(let i=0;i<customTesters.length;i++){let customTesterResult=customTesters[i].call(testerContext,a,b,customTesters);if(customTesterResult!==void 0)return customTesterResult}if(typeof URL==`function`&&a instanceof URL&&b instanceof URL)return a.href===b.href;if(Object.is(a,b))return!0;if(a===null||b===null)return a===b;let className=Object.prototype.toString.call(a);if(className!==Object.prototype.toString.call(b))return!1;switch(className){case`[object Boolean]`:case`[object String]`:case`[object Number]`:return typeof a==typeof b?typeof a!=`object`&&typeof b!=`object`?Object.is(a,b):Object.is(a.valueOf(),b.valueOf()):!1;case`[object Date]`:{let numA=+a,numB=+b;return numA===numB||Number.isNaN(numA)&&Number.isNaN(numB)}case`[object RegExp]`:return a.source===b.source&&a.flags===b.flags;case`[object Temporal.Instant]`:case`[object Temporal.ZonedDateTime]`:case`[object Temporal.PlainDateTime]`:case`[object Temporal.PlainDate]`:case`[object Temporal.PlainTime]`:case`[object Temporal.PlainYearMonth]`:case`[object Temporal.PlainMonthDay]`:return a.equals(b);case`[object Temporal.Duration]`:return a.toString()===b.toString()}if(typeof a!=`object`||typeof b!=`object`)return!1;if(isDomNode(a)&&isDomNode(b))return a.isEqualNode(b);let length=aStack.length;for(;length--;)if(aStack[length]===a)return bStack[length]===b;else if(bStack[length]===b)return!1;if(aStack.push(a),bStack.push(b),className===`[object Array]`&&a.length!==b.length)return!1;if(isError(a)&&isError(b))try{return isErrorEqual(a,b,aStack,bStack,customTesters,hasKey)}finally{aStack.pop(),bStack.pop()}let aKeys=keys(a,hasKey),key,size=aKeys.length;if(keys(b,hasKey).length!==size)return!1;for(;size--;)if(key=aKeys[size],result=hasKey(b,key)&&eq(a[key],b[key],aStack,bStack,customTesters,hasKey),!result)return!1;return aStack.pop(),bStack.pop(),result}function isErrorEqual(a,b,aStack,bStack,customTesters,hasKey){let result=Object.prototype.toString.call(a)===Object.prototype.toString.call(b)&&a.name===b.name&&a.message===b.message;return b.cause!==void 0&&(result&&=eq(a.cause,b.cause,aStack,bStack,customTesters,hasKey)),a instanceof AggregateError&&b instanceof AggregateError&&(result&&=eq(a.errors,b.errors,aStack,bStack,customTesters,hasKey)),result&&=eq({...a},{...b},aStack,bStack,customTesters,hasKey),result}function keys(obj,hasKey){let keys=[];for(let key in obj)hasKey(obj,key)&&keys.push(key);return keys.concat(Object.getOwnPropertySymbols(obj).filter(symbol=>Object.getOwnPropertyDescriptor(obj,symbol).enumerable))}function hasDefinedKey(obj,key){return hasKey(obj,key)&&obj[key]!==void 0}function hasKey(obj,key){return Object.hasOwn(obj,key)}function isA(typeName,value){return Object.prototype.toString.apply(value)===`[object ${typeName}]`}function isDomNode(obj){return typeof obj==`object`&&!!obj&&`nodeType`in obj&&typeof obj.nodeType==`number`&&`nodeName`in obj&&typeof obj.nodeName==`string`&&`isEqualNode`in obj&&typeof obj.isEqualNode==`function`}const IS_KEYED_SENTINEL=`@@__IMMUTABLE_KEYED__@@`,IS_SET_SENTINEL=`@@__IMMUTABLE_SET__@@`,IS_ORDERED_SENTINEL=`@@__IMMUTABLE_ORDERED__@@`;function isImmutableUnorderedKeyed(maybeKeyed){return!!(maybeKeyed&&maybeKeyed[IS_KEYED_SENTINEL]&&!maybeKeyed[IS_ORDERED_SENTINEL])}function isImmutableUnorderedSet(maybeSet){return!!(maybeSet&&maybeSet[IS_SET_SENTINEL]&&!maybeSet[IS_ORDERED_SENTINEL])}function isObjectLiteral(source){return typeof source==`object`&&!!source&&!Array.isArray(source)}function isImmutableList(source){return!!(source&&isObjectLiteral(source)&&source[`@@__IMMUTABLE_LIST__@@`])}function isImmutableOrderedKeyed(source){return!!(source&&isObjectLiteral(source)&&source[IS_KEYED_SENTINEL]&&source[IS_ORDERED_SENTINEL])}function isImmutableOrderedSet(source){return!!(source&&isObjectLiteral(source)&&source[IS_SET_SENTINEL]&&source[IS_ORDERED_SENTINEL])}function isImmutableRecord(source){return!!(source&&isObjectLiteral(source)&&source[`@@__IMMUTABLE_RECORD__@@`])}const IteratorSymbol=Symbol.iterator;function hasIterator(object){return!!(object!=null&&object[IteratorSymbol])}function iterableEquality(a,b,customTesters=[],aStack=[],bStack=[]){if(typeof a!=`object`||typeof b!=`object`||Array.isArray(a)||Array.isArray(b)||!hasIterator(a)||!hasIterator(b))return;if(a.constructor!==b.constructor)return!1;let length=aStack.length;for(;length--;)if(aStack[length]===a)return bStack[length]===b;aStack.push(a),bStack.push(b);let filteredCustomTesters=[...customTesters.filter(t=>t!==iterableEquality),iterableEqualityWithStack];function iterableEqualityWithStack(a,b){return iterableEquality(a,b,[...customTesters],[...aStack],[...bStack])}if(a.size!==void 0){if(a.size!==b.size)return!1;if(isA(`Set`,a)||isImmutableUnorderedSet(a)){let allFound=!0;for(let aValue of a)if(!b.has(aValue)){let has=!1;for(let bValue of b)equals(aValue,bValue,filteredCustomTesters)===!0&&(has=!0);if(has===!1){allFound=!1;break}}return aStack.pop(),bStack.pop(),allFound}if(isA(`Map`,a)||isImmutableUnorderedKeyed(a)){let allFound=!0;for(let aEntry of a)if(!b.has(aEntry[0])||!equals(aEntry[1],b.get(aEntry[0]),filteredCustomTesters)){let has=!1;for(let bEntry of b){let matchedKey=equals(aEntry[0],bEntry[0],filteredCustomTesters),matchedValue=!1;matchedKey===!0&&(matchedValue=equals(aEntry[1],bEntry[1],filteredCustomTesters)),matchedValue===!0&&(has=!0)}if(has===!1){allFound=!1;break}}return aStack.pop(),bStack.pop(),allFound}}let bIterator=b[IteratorSymbol]();for(let aValue of a){let nextB=bIterator.next();if(nextB.done||!equals(aValue,nextB.value,filteredCustomTesters))return!1}return!bIterator.next().done||!isImmutableList(a)&&!isImmutableOrderedKeyed(a)&&!isImmutableOrderedSet(a)&&!isImmutableRecord(a)&&!equals(Object.entries(a),Object.entries(b),filteredCustomTesters)?!1:(aStack.pop(),bStack.pop(),!0)}function hasPropertyInObject(object,key){return!object||typeof object!=`object`||object===Object.prototype?!1:Object.hasOwn(object,key)||hasPropertyInObject(Object.getPrototypeOf(object),key)}function isObjectWithKeys(a){return isObject(a)&&!isError(a)&&!Array.isArray(a)&&!(a instanceof Date)&&!(a instanceof Set)&&!(a instanceof Map)}function subsetEquality(object,subset,customTesters=[]){let filteredCustomTesters=customTesters.filter(t=>t!==subsetEquality),subsetEqualityWithContext=(seenReferences=new WeakMap)=>(object,subset)=>{if(isObjectWithKeys(subset))return Object.keys(subset).every(key=>{if(subset[key]!=null&&typeof subset[key]==`object`){if(seenReferences.has(subset[key]))return equals(object[key],subset[key],filteredCustomTesters);seenReferences.set(subset[key],!0)}let result=object!=null&&hasPropertyInObject(object,key)&&equals(object[key],subset[key],[...filteredCustomTesters,subsetEqualityWithContext(seenReferences)]);return seenReferences.delete(subset[key]),result})};return subsetEqualityWithContext()(object,subset)}function typeEquality(a,b){if(a!=null&&b!=null&&a.constructor!==b.constructor)return!1}function arrayBufferEquality(a,b){let dataViewA=a,dataViewB=b;if(!(a instanceof DataView&&b instanceof DataView)){if(!(a instanceof ArrayBuffer)||!(b instanceof ArrayBuffer))return;try{dataViewA=new DataView(a),dataViewB=new DataView(b)}catch{return}}if(dataViewA.byteLength!==dataViewB.byteLength)return!1;for(let i=0;i<dataViewA.byteLength;i++)if(dataViewA.getUint8(i)!==dataViewB.getUint8(i))return!1;return!0}function sparseArrayEquality(a,b,customTesters=[]){if(!Array.isArray(a)||!Array.isArray(b))return;let aKeys=Object.keys(a),bKeys=Object.keys(b);return equals(a,b,customTesters.filter(t=>t!==sparseArrayEquality),!0)&&equals(aKeys,bKeys)}function generateToBeMessage(deepEqualityName,expected=`#{this}`,actual=`#{exp}`){let toBeMessage=`expected ${expected} to be ${actual} // Object.is equality`;return[`toStrictEqual`,`toEqual`].includes(deepEqualityName)?`${toBeMessage}\n\nIf it should pass with deep equality, replace "toBe" with "${deepEqualityName}"\n\nExpected: ${expected}\nReceived: serializes to the same string\n`:toBeMessage}function pluralize(word,count){return`${count} ${word}${count===1?``:`s`}`}function getObjectKeys(object){return[...Object.keys(object),...Object.getOwnPropertySymbols(object).filter(s=>Object.getOwnPropertyDescriptor(object,s)?.enumerable)]}function getObjectSubset(object,subset,customTesters){let stripped=0,getObjectSubsetWithContext=(seenReferences=new WeakMap)=>(object,subset)=>{if(Array.isArray(object)){if(Array.isArray(subset)&&subset.length===object.length)return subset.map((sub,i)=>getObjectSubsetWithContext(seenReferences)(object[i],sub))}else if(object instanceof Date)return object;else if(isObject(object)&&isObject(subset)){if(equals(object,subset,[...customTesters,iterableEquality,subsetEquality]))return subset;let trimmed={};seenReferences.set(object,trimmed),typeof object.constructor==`function`&&typeof object.constructor.name==`string`&&Object.defineProperty(trimmed,"constructor",{enumerable:!1,value:object.constructor});for(let key of getObjectKeys(object))hasPropertyInObject(subset,key)?trimmed[key]=seenReferences.has(object[key])?seenReferences.get(object[key]):getObjectSubsetWithContext(seenReferences)(object[key],subset[key]):seenReferences.has(object[key])||(stripped+=1,isObject(object[key])&&(stripped+=getObjectKeys(object[key]).length),getObjectSubsetWithContext(seenReferences)(object[key],subset[key]));if(getObjectKeys(trimmed).length>0)return trimmed}return object};return{subset:getObjectSubsetWithContext()(object,subset),stripped}}function isStandardSchema(obj){return!!obj&&(typeof obj==`object`||typeof obj==`function`)&&obj[`~standard`]&&typeof obj[`~standard`].validate==`function`}if(!Object.hasOwn(globalThis,MATCHERS_OBJECT)){let globalState=new WeakMap,matchers=Object.create(null),customEqualityTesters=[],asymmetricMatchers=Object.create(null);Object.defineProperty(globalThis,MATCHERS_OBJECT,{configurable:!0,get:()=>globalState}),Object.defineProperty(globalThis,JEST_MATCHERS_OBJECT,{configurable:!0,get:()=>({state:globalState.get(globalThis[GLOBAL_EXPECT]),matchers,customEqualityTesters})}),Object.defineProperty(globalThis,ASYMMETRIC_MATCHERS_OBJECT,{configurable:!0,get:()=>asymmetricMatchers})}function getState(expect){return globalThis[MATCHERS_OBJECT].get(expect)}function setState(state,expect){let map=globalThis[MATCHERS_OBJECT],current=map.get(expect),next=Object.defineProperties(current||{},Object.getOwnPropertyDescriptors(state));current||map.set(expect,next)}var AsymmetricMatcher=class{sample;inverse;$$typeof=Symbol.for(`jest.asymmetricMatcher`);constructor(sample,inverse=!1){this.sample=sample,this.inverse=inverse}getMatcherContext(expect){return{...getState(expect||globalThis[GLOBAL_EXPECT]),equals,isNot:this.inverse,customTesters:getCustomEqualityTesters(),utils:{...getMatcherUtils(),diff,stringify,iterableEquality,subsetEquality}}}};AsymmetricMatcher.prototype[Symbol.for(`chai/inspect`)]=function(options){let result=stringify(this,options.depth,{min:!0});return result.length<=options.truncate?result:`${this.toString()}{…}`};var StringContaining=class extends AsymmetricMatcher{constructor(sample,inverse=!1){if(!isA(`String`,sample))throw Error(`Expected is not a string`);super(sample,inverse)}asymmetricMatch(other){let result=isA(`String`,other)&&other.includes(this.sample);return this.inverse?!result:result}toString(){return`String${this.inverse?`Not`:``}Containing`}getExpectedType(){return`string`}},Anything=class extends AsymmetricMatcher{asymmetricMatch(other){return other!=null}toString(){return`Anything`}toAsymmetricMatcher(){return`Anything`}},ObjectContaining=class extends AsymmetricMatcher{constructor(sample,inverse=!1){super(sample,inverse)}getPrototype(obj){return Object.getPrototypeOf?Object.getPrototypeOf(obj):obj.constructor.prototype===obj?null:obj.constructor.prototype}hasProperty(obj,property){return obj?Object.hasOwn(obj,property)?!0:this.hasProperty(this.getPrototype(obj),property):!1}getProperties(obj){return[...Object.keys(obj),...Object.getOwnPropertySymbols(obj).filter(s=>Object.getOwnPropertyDescriptor(obj,s)?.enumerable)]}asymmetricMatch(other,customTesters){if(typeof this.sample!=`object`)throw TypeError(`You must provide an object to ${this.toString()}, not '${typeof this.sample}'.`);let result=!0,properties=this.getProperties(this.sample);for(let property of properties){if(!this.hasProperty(other,property)){result=!1;break}let value=this.sample[property],otherValue=other[property];if(!equals(value,otherValue,customTesters)){result=!1;break}}return this.inverse?!result:result}toString(){return`Object${this.inverse?`Not`:``}Containing`}getExpectedType(){return`object`}},ArrayContaining=class extends AsymmetricMatcher{constructor(sample,inverse=!1){super(sample,inverse)}asymmetricMatch(other,customTesters){if(!Array.isArray(this.sample))throw TypeError(`You must provide an array to ${this.toString()}, not '${typeof this.sample}'.`);let result=this.sample.length===0||Array.isArray(other)&&this.sample.every(item=>other.some(another=>equals(item,another,customTesters)));return this.inverse?!result:result}toString(){return`Array${this.inverse?`Not`:``}Containing`}getExpectedType(){return`array`}},Any=class extends AsymmetricMatcher{constructor(sample){if(sample===void 0)throw TypeError(`any() expects to be passed a constructor function. Please pass one or use anything() to match any object.`);super(sample)}fnNameFor(func){if(func.name)return func.name;let matches=Function.prototype.toString.call(func).match(/^(?:async)?\s*function\s*(?:\*\s*)?([\w$]+)\s*\(/);return matches?matches[1]:`<anonymous>`}asymmetricMatch(other){return this.sample===String?typeof other==`string`||other instanceof String:this.sample===Number?typeof other==`number`||other instanceof Number:this.sample===Function?typeof other==`function`||typeof other==`function`:this.sample===Boolean?typeof other==`boolean`||other instanceof Boolean:this.sample===BigInt?typeof other==`bigint`||other instanceof BigInt:this.sample===Symbol?typeof other==`symbol`||other instanceof Symbol:this.sample===Object?typeof other==`object`:other 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)}>`}},StringMatching=class extends AsymmetricMatcher{constructor(sample,inverse=!1){if(!isA(`String`,sample)&&!isA(`RegExp`,sample))throw Error(`Expected is not a String or a RegExp`);super(new RegExp(sample),inverse)}asymmetricMatch(other){let result=isA(`String`,other)&&this.sample.test(other);return this.inverse?!result:result}toString(){return`String${this.inverse?`Not`:``}Matching`}getExpectedType(){return`string`}},CloseTo=class extends AsymmetricMatcher{precision;constructor(sample,precision=2,inverse=!1){if(!isA(`Number`,sample))throw Error(`Expected is not a Number`);if(!isA(`Number`,precision))throw Error(`Precision is not a Number`);super(sample),this.inverse=inverse,this.precision=precision}asymmetricMatch(other){if(!isA(`Number`,other))return!1;let result=!1;return result=other===1/0&&this.sample===1/0||other===-1/0&&this.sample===-1/0||Math.abs(this.sample-other)<10**-this.precision/2,this.inverse?!result:result}toString(){return`Number${this.inverse?`Not`:``}CloseTo`}getExpectedType(){return`number`}toAsymmetricMatcher(){return[this.toString(),this.sample,`(${pluralize(`digit`,this.precision)})`].join(` `)}},SchemaMatching=class extends AsymmetricMatcher{result;constructor(sample,inverse=!1){if(!isStandardSchema(sample))throw TypeError(`SchemaMatching expected to receive a Standard Schema.`);super(sample,inverse)}asymmetricMatch(other){let result=this.sample[`~standard`].validate(other);if(result instanceof Promise)throw TypeError(`Async schema validation is not supported in asymmetric matchers.`);this.result=result;let pass=!this.result.issues||this.result.issues.length===0;return this.inverse?!pass:pass}toString(){return`Schema${this.inverse?`Not`:``}Matching`}getExpectedType(){return`object`}toAsymmetricMatcher(){let{utils}=this.getMatcherContext();return(this.result?.issues||[]).length>0?`${this.toString()} ${utils.stringify(this.result,void 0,{printBasicPrototype:!1})}`:this.toString()}};const JestAsymmetricMatchers=(chai,utils)=>{utils.addMethod(chai.expect,`anything`,()=>new Anything),utils.addMethod(chai.expect,`any`,expected=>new Any(expected)),utils.addMethod(chai.expect,`stringContaining`,expected=>new StringContaining(expected)),utils.addMethod(chai.expect,`objectContaining`,expected=>new ObjectContaining(expected)),utils.addMethod(chai.expect,`arrayContaining`,expected=>new ArrayContaining(expected)),utils.addMethod(chai.expect,`stringMatching`,expected=>new StringMatching(expected)),utils.addMethod(chai.expect,`closeTo`,(expected,precision)=>new CloseTo(expected,precision)),utils.addMethod(chai.expect,`schemaMatching`,expected=>new SchemaMatching(expected)),chai.expect.not={stringContaining:expected=>new StringContaining(expected,!0),objectContaining:expected=>new ObjectContaining(expected,!0),arrayContaining:expected=>new ArrayContaining(expected,!0),stringMatching:expected=>new StringMatching(expected,!0),closeTo:(expected,precision)=>new CloseTo(expected,precision,!0),schemaMatching:expected=>new SchemaMatching(expected,!0)}};function createAssertionMessage(util,assertion,hasArgs){let soft=util.flag(assertion,`soft`)?`.soft`:``,not=util.flag(assertion,`negate`)?`not.`:``,name=`${util.flag(assertion,`_name`)}(${hasArgs?`expected`:``})`,promiseName=util.flag(assertion,`promise`);return`expect${soft}(actual)${promiseName?`.${promiseName}`:``}.${not}${name}`}function recordAsyncExpect(_test,promise,assertion,error,isSoft){let test=_test;if(test&&promise instanceof Promise){promise=promise.finally(()=>{if(!test.promises)return;let index=test.promises.indexOf(promise);index!==-1&&test.promises.splice(index,1)}),test.promises||=[],isSoft&&(promise=promise.then(noop,err=>{handleTestError(test,err)})),test.promises.push(promise);let resolved=!1;return test.onFinished??=[],test.onFinished.push(()=>{if(!resolved){let awaitError=Error(`Promise returned by \`${assertion}\` was not awaited. This assertion is asynchronous and must be awaited; otherwise, it is not guaranteed to complete before the test finishes:\n\nawait ${assertion}\n`);throw error.stack&&(awaitError.stack=error.stack.replace(error.message,awaitError.message)),awaitError}}),{then(onFulfilled,onRejected){return resolved=!0,promise.then(onFulfilled,onRejected)},catch(onRejected){return resolved=!0,promise.catch(onRejected)},finally(onFinally){return resolved=!0,promise.finally(onFinally)},[Symbol.toStringTag]:`Promise`}}return promise}function handleTestError(test,err){test.result||={state:`fail`},test.result.state=`fail`,test.result.errors||=[],test.result.errors.push(processError(err))}function wrapAssertion(utils,name,fn){return function(...args){if(name!==`withTest`&&utils.flag(this,`_name`,name),!utils.flag(this,`soft`))try{return fn.apply(this,args)}finally{}let test=utils.flag(this,`vitest-test`);if(!test)throw Error(`expect.soft() can only be used inside a test`);try{let result=fn.apply(this,args);return result&&typeof result==`object`&&typeof result.then==`function`?result.then(noop,err=>{handleTestError(test,err)}):result}catch(err){handleTestError(test,err)}}}const JestChaiExpect=(chai,utils)=>{let{AssertionError}=chai,customTesters=getCustomEqualityTesters();function def(name,fn){let addMethod=n=>{let softWrapper=wrapAssertion(utils,n,fn);utils.addMethod(chai.Assertion.prototype,n,softWrapper),utils.addMethod(globalThis[JEST_MATCHERS_OBJECT].matchers,n,softWrapper)};Array.isArray(name)?name.forEach(n=>addMethod(n)):addMethod(name)}[`throw`,`throws`,`Throw`].forEach(m=>{utils.overwriteMethod(chai.Assertion.prototype,m,_super=>function(...args){let promise=utils.flag(this,`promise`),object=utils.flag(this,`object`),isNot=utils.flag(this,`negate`);if(promise===`rejects`)utils.flag(this,`object`,()=>{throw object});else if(promise===`resolves`&&typeof object!=`function`){if(isNot)return;{let message=utils.flag(this,`message`)||`expected promise to throw an error, but it didn't`;throw new AssertionError(message,{showDiff:!1},utils.flag(this,`ssfi`))}}_super.apply(this,args)})}),def(`withTest`,function(test){return utils.flag(this,`vitest-test`,test),this}),def(`toEqual`,function(expected){let actual=utils.flag(this,`object`),equal=equals(actual,expected,[...customTesters,iterableEquality]);return this.assert(equal,`expected #{this} to deeply equal #{exp}`,`expected #{this} to not deeply equal #{exp}`,expected,actual)}),def(`toStrictEqual`,function(expected){let obj=utils.flag(this,`object`),equal=equals(obj,expected,[...customTesters,iterableEquality,typeEquality,sparseArrayEquality,arrayBufferEquality],!0);return this.assert(equal,`expected #{this} to strictly equal #{exp}`,`expected #{this} to not strictly equal #{exp}`,expected,obj)}),def(`toBe`,function(expected){let actual=this._obj,pass=Object.is(actual,expected),deepEqualityName=``;return pass||(equals(actual,expected,[...customTesters,iterableEquality,typeEquality,sparseArrayEquality,arrayBufferEquality],!0)?deepEqualityName=`toStrictEqual`:equals(actual,expected,[...customTesters,iterableEquality])&&(deepEqualityName=`toEqual`)),this.assert(pass,generateToBeMessage(deepEqualityName),`expected #{this} not to be #{exp} // Object.is equality`,expected,actual)}),def(`toMatchObject`,function(expected){let actual=this._obj,pass=equals(actual,expected,[...customTesters,iterableEquality,subsetEquality]),isNot=utils.flag(this,`negate`),{subset:actualSubset,stripped}=getObjectSubset(actual,expected,customTesters);if(pass&&isNot||!pass&&!isNot){let msg=utils.getMessage(this,[pass,`expected #{this} to match object #{exp}`,`expected #{this} to not match object #{exp}`,expected,actualSubset,!1]),message=stripped===0?msg:`${msg}\n(${stripped} matching ${stripped===1?`property`:`properties`} omitted from actual)`;throw new AssertionError(message,{showDiff:!0,expected,actual:actualSubset})}}),def(`toMatch`,function(expected){let actual=this._obj;if(typeof actual!=`string`)throw TypeError(`.toMatch() expects to receive a string, but got ${typeof actual}`);return this.assert(typeof expected==`string`?actual.includes(expected):actual.match(expected),`expected #{this} to match #{exp}`,`expected #{this} not to match #{exp}`,expected,actual)}),def(`toContain`,function(item){let actual=this._obj;if(typeof Node<`u`&&actual instanceof Node){if(!(item instanceof Node))throw TypeError(`toContain() expected a DOM node as the argument, but got ${typeof item}`);return this.assert(actual.contains(item),`expected #{this} to contain element #{exp}`,`expected #{this} not to contain element #{exp}`,item,actual)}if(typeof DOMTokenList<`u`&&actual instanceof DOMTokenList){assertTypes(item,`class name`,[`string`]);let expectedClassList=utils.flag(this,`negate`)?actual.value.replace(item,``).trim():`${actual.value} ${item}`;return this.assert(actual.contains(item),`expected "${actual.value}" to contain "${item}"`,`expected "${actual.value}" not to contain "${item}"`,expectedClassList,actual.value)}return typeof actual==`string`&&typeof item==`string`?this.assert(actual.includes(item),`expected #{this} to contain #{exp}`,`expected #{this} not to contain #{exp}`,item,actual):(actual!=null&&typeof actual!=`string`&&utils.flag(this,`object`,Array.from(actual)),this.contain(item))}),def(`toContainEqual`,function(expected){let obj=utils.flag(this,`object`),index=Array.from(obj).findIndex(item=>equals(item,expected,customTesters));this.assert(index!==-1,`expected #{this} to deep equally contain #{exp}`,`expected #{this} to not deep equally contain #{exp}`,expected)}),def(`toBeTruthy`,function(){let obj=utils.flag(this,`object`);this.assert(!!obj,`expected #{this} to be truthy`,`expected #{this} to not be truthy`,!0,obj)}),def(`toBeFalsy`,function(){let obj=utils.flag(this,`object`);this.assert(!obj,`expected #{this} to be falsy`,`expected #{this} to not be falsy`,!1,obj)}),def(`toBeGreaterThan`,function(expected){let actual=this._obj;return assertTypes(actual,`actual`,[`number`,`bigint`]),assertTypes(expected,`expected`,[`number`,`bigint`]),this.assert(actual>expected,`expected ${actual} to be greater than ${expected}`,`expected ${actual} to be not greater than ${expected}`,expected,actual,!1)}),def(`toBeGreaterThanOrEqual`,function(expected){let actual=this._obj;return assertTypes(actual,`actual`,[`number`,`bigint`]),assertTypes(expected,`expected`,[`number`,`bigint`]),this.assert(actual>=expected,`expected ${actual} to be greater than or equal to ${expected}`,`expected ${actual} to be not greater than or equal to ${expected}`,expected,actual,!1)}),def(`toBeLessThan`,function(expected){let actual=this._obj;return assertTypes(actual,`actual`,[`number`,`bigint`]),assertTypes(expected,`expected`,[`number`,`bigint`]),this.assert(actual<expected,`expected ${actual} to be less than ${expected}`,`expected ${actual} to be not less than ${expected}`,expected,actual,!1)}),def(`toBeLessThanOrEqual`,function(expected){let actual=this._obj;return assertTypes(actual,`actual`,[`number`,`bigint`]),assertTypes(expected,`expected`,[`number`,`bigint`]),this.assert(actual<=expected,`expected ${actual} to be less than or equal to ${expected}`,`expected ${actual} to be not less than or equal to ${expected}`,expected,actual,!1)}),def(`toBeNaN`,function(){let obj=utils.flag(this,`object`);this.assert(Number.isNaN(obj),`expected #{this} to be NaN`,`expected #{this} not to be NaN`,NaN,obj)}),def(`toBeUndefined`,function(){let obj=utils.flag(this,`object`);this.assert(obj===void 0,`expected #{this} to be undefined`,`expected #{this} not to be undefined`,void 0,obj)}),def(`toBeNull`,function(){let obj=utils.flag(this,`object`);this.assert(obj===null,`expected #{this} to be null`,`expected #{this} not to be null`,null,obj)}),def(`toBeNullable`,function(){let obj=utils.flag(this,`object`);this.assert(obj==null,`expected #{this} to be nullish`,`expected #{this} not to be nullish`,null,obj)}),def(`toBeDefined`,function(){let obj=utils.flag(this,`object`);this.assert(obj!==void 0,`expected #{this} to be defined`,`expected #{this} to be undefined`,obj)}),def(`toBeTypeOf`,function(expected){let actual=typeof this._obj,equal=expected===actual;return this.assert(equal,`expected #{this} to be type of #{exp}`,`expected #{this} not to be type of #{exp}`,expected,actual)}),def(`toBeInstanceOf`,function(obj){return this.instanceOf(obj)}),def(`toHaveLength`,function(length){return this.have.length(length)}),def(`toHaveProperty`,function(...args){Array.isArray(args[0])&&(args[0]=args[0].map(key=>String(key).replace(/([.[\]])/g,`\\$1`)).join(`.`));let actual=this._obj;if(actual==null)throw TypeError(`.toHaveProperty() expects to receive a valid object, but got ${actual}`);let[propertyName,expected]=args,{value,exists}=Object.hasOwn(actual,propertyName)?{value:actual[propertyName],exists:!0}:utils.getPathInfo(actual,propertyName),pass=exists&&(args.length===1||equals(expected,value,customTesters)),valueString=args.length===1?``:` with value ${inspect$1(expected,{truncate:40})}`;return this.assert(pass,`expected #{this} to have property "${propertyName}"${valueString}`,`expected #{this} to not have property "${propertyName}"${valueString}`,expected,exists?value:void 0)}),def(`toBeCloseTo`,function(received,precision=2){let expected=this._obj,pass=!1,expectedDiff=0,receivedDiff=0;return received===1/0&&expected===1/0||received===-1/0&&expected===-1/0?pass=!0:(expectedDiff=10**-precision/2,receivedDiff=Math.abs(expected-received),pass=receivedDiff<expectedDiff),this.assert(pass,`expected #{this} to be close to #{exp}, received difference is ${receivedDiff}, but expected ${expectedDiff}`,`expected #{this} to not be close to #{exp}, received difference is ${receivedDiff}, but expected ${expectedDiff}`,received,expected,!1)});function assertIsMock(assertion){if(!isMockFunction(assertion._obj))throw TypeError(`${utils.inspect(assertion._obj)} is not a spy or a call to a spy!`)}function getSpy(assertion){return assertIsMock(assertion),assertion._obj}def([`toHaveBeenCalledTimes`,`toBeCalledTimes`],function(number){let spy=getSpy(this),spyName=spy.getMockName(),callCount=spy.mock.calls.length;return this.assert(callCount===number,`expected "${spyName}" to be called #{exp} times, but got ${callCount} times`,`expected "${spyName}" to not be called #{exp} times`,number,callCount,!1)}),def(`toHaveBeenCalledOnce`,function(){let spy=getSpy(this),spyName=spy.getMockName(),callCount=spy.mock.calls.length;return this.assert(callCount===1,`expected "${spyName}" to be called once, but got ${callCount} times`,`expected "${spyName}" to not be called once`,1,callCount,!1)}),def([`toHaveBeenCalled`,`toBeCalled`],function(){let spy=getSpy(this),spyName=spy.getMockName(),callCount=spy.mock.calls.length,called=callCount>0,isNot=utils.flag(this,`negate`),msg=utils.getMessage(this,[called,`expected "${spyName}" to be called at least once`,`expected "${spyName}" to not be called at all, but actually been called ${callCount} times`,!0,called]);if(called&&isNot&&(msg=formatCalls(spy,msg)),called&&isNot||!called&&!isNot)throw new AssertionError(msg)});function equalsArgumentArray(a,b){return a.length===b.length&&a.every((aItem,i)=>equals(aItem,b[i],[...customTesters,iterableEquality]))}def([`toHaveBeenCalledWith`,`toBeCalledWith`],function(...args){let spy=getSpy(this),spyName=spy.getMockName(),pass=spy.mock.calls.some(callArg=>equalsArgumentArray(callArg,args)),isNot=utils.flag(this,`negate`);if(pass&&isNot||!pass&&!isNot){let msg=utils.getMessage(this,[pass,`expected "${spyName}" to be called with arguments: #{exp}`,`expected "${spyName}" to not be called with arguments: #{exp}`,args]);throw new AssertionError(formatCalls(spy,msg,args))}}),def(`toHaveBeenCalledExactlyOnceWith`,function(...args){let spy=getSpy(this),spyName=spy.getMockName(),callCount=spy.mock.calls.length,pass=spy.mock.calls.some(callArg=>equalsArgumentArray(callArg,args))&&callCount===1,isNot=utils.flag(this,`negate`);if(pass&&isNot||!pass&&!isNot){let msg=utils.getMessage(this,[pass,`expected "${spyName}" to be called once with arguments: #{exp}`,`expected "${spyName}" to not be called once with arguments: #{exp}`,args]);throw new AssertionError(formatCalls(spy,msg,args))}}),def(`toHaveBeenNthCalledWith`,function(times,...args){let spy=getSpy(this),spyName=spy.getMockName(),nthCall=spy.mock.calls[times-1],callCount=spy.mock.calls.length,isCalled=times<=callCount;this.assert(nthCall&&equalsArgumentArray(nthCall,args),`expected ${ordinal(times)} "${spyName}" call to have been called with #{exp}${isCalled?``:`, but called only ${callCount} times`}`,`expected ${ordinal(times)} "${spyName}" call to not have been called with #{exp}`,args,nthCall,isCalled)}),def(`toHaveBeenLastCalledWith`,function(...args){let spy=getSpy(this),spyName=spy.getMockName(),lastCall=spy.mock.calls.at(-1);this.assert(lastCall&&equalsArgumentArray(lastCall,args),`expected last "${spyName}" call to have been called with #{exp}`,`expected last "${spyName}" call to not have been called with #{exp}`,args,lastCall)});function isSpyCalledBeforeAnotherSpy(beforeSpy,afterSpy,failIfNoFirstInvocation){let beforeInvocationCallOrder=beforeSpy.mock.invocationCallOrder,afterInvocationCallOrder=afterSpy.mock.invocationCallOrder;return beforeInvocationCallOrder.length===0?!failIfNoFirstInvocation:afterInvocationCallOrder.length!==0&&beforeInvocationCallOrder[0]<afterInvocationCallOrder[0]}def([`toHaveBeenCalledBefore`],function(resultSpy,failIfNoFirstInvocation=!0){let expectSpy=getSpy(this);if(!isMockFunction(resultSpy))throw TypeError(`${utils.inspect(resultSpy)} is not a spy or a call to a spy`);this.assert(isSpyCalledBeforeAnotherSpy(expectSpy,resultSpy,failIfNoFirstInvocation),`expected "${expectSpy.getMockName()}" to have been called before "${resultSpy.getMockName()}"`,`expected "${expectSpy.getMockName()}" to not have been called before "${resultSpy.getMockName()}"`,resultSpy,expectSpy)}),def([`toHaveBeenCalledAfter`],function(resultSpy,failIfNoFirstInvocation=!0){let expectSpy=getSpy(this);if(!isMockFunction(resultSpy))throw TypeError(`${utils.inspect(resultSpy)} is not a spy or a call to a spy`);this.assert(isSpyCalledBeforeAnotherSpy(resultSpy,expectSpy,failIfNoFirstInvocation),`expected "${expectSpy.getMockName()}" to have been called after "${resultSpy.getMockName()}"`,`expected "${expectSpy.getMockName()}" to not have been called after "${resultSpy.getMockName()}"`,resultSpy,expectSpy)}),def([`toThrow`,`toThrowError`],function(expected){if(typeof expected==`string`||expected===void 0||expected instanceof RegExp)return this.throws(expected);let obj=this._obj,promise=utils.flag(this,`promise`),isNot=utils.flag(this,`negate`),thrown=null;if(promise===`rejects`)thrown=obj;else if(promise===`resolves`&&typeof obj!=`function`){if(isNot)return;{let message=utils.flag(this,`message`)||`expected promise to throw an error, but it didn't`;throw new AssertionError(message,{showDiff:!1},utils.flag(this,`ssfi`))}}else{let isThrow=!1;try{obj()}catch(err){isThrow=!0,thrown=err}if(!isThrow&&!isNot){let message=utils.flag(this,`message`)||`expected function to throw an error, but it didn't`;throw new AssertionError(message,{showDiff:!1},utils.flag(this,`ssfi`))}}if(typeof expected==`function`){let name=expected.name||expected.prototype.constructor.name;return this.assert(thrown&&thrown instanceof expected,`expected error to be instance of ${name}`,`expected error not to be instance of ${name}`,expected,thrown)}if(isError(expected)){let equal=equals(thrown,expected,[...customTesters,iterableEquality]);return this.assert(equal,`expected a thrown error to be #{exp}`,`expected a thrown error not to be #{exp}`,expected,thrown)}if(typeof expected==`object`&&`asymmetricMatch`in expected&&typeof expected.asymmetricMatch==`function`){let matcher=expected;return this.assert(thrown&&matcher.asymmetricMatch(thrown),`expected error to match asymmetric matcher`,`expected error not to match asymmetric matcher`,matcher,thrown)}let equal=equals(thrown,expected,[...customTesters,iterableEquality]);return this.assert(equal,`expected a thrown value to equal #{exp}`,`expected a thrown value not to equal #{exp}`,expected,thrown)}),[{name:`toHaveResolved`,condition:spy=>spy.mock.settledResults.length>0&&spy.mock.settledResults.some(({type})=>type===`fulfilled`),action:`resolved`},{name:[`toHaveReturned`,`toReturn`],condition:spy=>spy.mock.calls.length>0&&spy.mock.results.some(({type})=>type!==`throw`),action:`called`}].forEach(({name,condition,action})=>{def(name,function(){let spy=getSpy(this),spyName=spy.getMockName(),pass=condition(spy);this.assert(pass,`expected "${spyName}" to be successfully ${action} at least once`,`expected "${spyName}" to not be successfully ${action}`,pass,!pass,!1)})}),[{name:`toHaveResolvedTimes`,condition:(spy,times)=>spy.mock.settledResults.reduce((s,{type})=>type===`fulfilled`?++s:s,0)===times,action:`resolved`},{name:[`toHaveReturnedTimes`,`toReturnTimes`],condition:(spy,times)=>spy.mock.results.reduce((s,{type})=>type===`throw`?s:++s,0)===times,action:`called`}].forEach(({name,condition,action})=>{def(name,function(times){let spy=getSpy(this),spyName=spy.getMockName(),pass=condition(spy,times);this.assert(pass,`expected "${spyName}" to be successfully ${action} ${times} times`,`expected "${spyName}" to not be successfully ${action} ${times} times`,`expected resolved times: ${times}`,`received resolved times: ${pass}`,!1)})}),[{name:`toHaveResolvedWith`,condition:(spy,value)=>spy.mock.settledResults.some(({type,value:result})=>type===`fulfilled`&&equals(value,result)),action:`resolve`},{name:[`toHaveReturnedWith`,`toReturnWith`],condition:(spy,value)=>spy.mock.results.some(({type,value:result})=>type===`return`&&equals(value,result)),action:`return`}].forEach(({name,condition,action})=>{def(name,function(value){let spy=getSpy(this),pass=condition(spy,value),isNot=utils.flag(this,`negate`);if(pass&&isNot||!pass&&!isNot){let spyName=spy.getMockName(),msg=utils.getMessage(this,[pass,`expected "${spyName}" to ${action} with: #{exp} at least once`,`expected "${spyName}" to not ${action} with: #{exp}`,value]),results=action===`return`?spy.mock.results:spy.mock.settledResults;throw new AssertionError(formatReturns(spy,results,msg,value))}})}),[{name:`toHaveLastResolvedWith`,condition:(spy,value)=>{let result=spy.mock.settledResults.at(-1);return!!(result&&result.type===`fulfilled`&&equals(result.value,value))},action:`resolve`},{name:`toHaveLastReturnedWith`,condition:(spy,value)=>{let result=spy.mock.results.at(-1);return!!(result&&result.type===`return`&&equals(result.value,value))},action:`return`}].forEach(({name,condition,action})=>{def(name,function(value){let spy=getSpy(this),result=(action===`return`?spy.mock.results:spy.mock.settledResults).at(-1),spyName=spy.getMockName();this.assert(condition(spy,value),`expected last "${spyName}" call to ${action} #{exp}`,`expected last "${spyName}" call to not ${action} #{exp}`,value,result?.value)})}),[{name:`toHaveNthResolvedWith`,condition:(spy,index,value)=>{let result=spy.mock.settledResults[index-1];return result&&result.type===`fulfilled`&&equals(result.value,value)},action:`resolve`},{name:`toHaveNthReturnedWith`,condition:(spy,index,value)=>{let result=spy.mock.results[index-1];return result&&result.type===`return`&&equals(result.value,value)},action:`return`}].forEach(({name,condition,action})=>{def(name,function(nthCall,value){let spy=getSpy(this),spyName=spy.getMockName(),result=(action===`return`?spy.mock.results:spy.mock.settledResults)[nthCall-1],ordinalCall=`${ordinal(nthCall)} call`;this.assert(condition(spy,nthCall,value),`expected ${ordinalCall} "${spyName}" call to ${action} #{exp}`,`expected ${ordinalCall} "${spyName}" call to not ${action} #{exp}`,value,result?.value)})}),def(`withContext`,function(context){for(let key in context)utils.flag(this,key,context[key]);return this}),utils.addProperty(chai.Assertion.prototype,`resolves`,function(){let error=Error(`resolves`);utils.flag(this,`promise`,`resolves`),utils.flag(this,`error`,error);let test=utils.flag(this,`vitest-test`),obj=utils.flag(this,`object`);if(utils.flag(this,`poll`))throw SyntaxError(`expect.poll() is not supported in combination with .resolves`);if(typeof obj?.then!=`function`)throw TypeError(`You must provide a Promise to expect() when using .resolves, not '${typeof obj}'.`);let proxy=new Proxy(this,{get:(target,key,receiver)=>{let result=Reflect.get(target,key,receiver);return typeof result==`function`?(...args)=>{utils.flag(this,`_name`,key);let promise=Promise.resolve(obj).then(value=>(utils.flag(this,`object`,value),result.call(this,...args)),err=>{let _error=new AssertionError(`promise rejected "${utils.inspect(err)}" instead of resolving`,{showDiff:!1});throw _error.cause=err,_error}).catch(err=>{throw isError(err)&&error.stack&&(err.stack=error.stack.replace(error.message,err.message)),err});return recordAsyncExpect(test,promise,createAssertionMessage(utils,this,!!args.length),error,utils.flag(this,`soft`))}:result instanceof chai.Assertion?proxy:result}});return proxy}),utils.addProperty(chai.Assertion.prototype,`rejects`,function(){let error=Error(`rejects`);utils.flag(this,`promise`,`rejects`),utils.flag(this,`error`,error);let test=utils.flag(this,`vitest-test`),obj=utils.flag(this,`object`),wrapper=typeof obj==`function`?obj():obj;if(utils.flag(this,`poll`))throw SyntaxError(`expect.poll() is not supported in combination with .rejects`);if(typeof wrapper?.then!=`function`)throw TypeError(`You must provide a Promise to expect() when using .rejects, not '${typeof wrapper}'.`);let proxy=new Proxy(this,{get:(target,key,receiver)=>{let result=Reflect.get(target,key,receiver);return typeof result==`function`?(...args)=>{utils.flag(this,`_name`,key);let promise=Promise.resolve(wrapper).then(value=>{throw new AssertionError(`promise resolved "${utils.inspect(value)}" instead of rejecting`,{showDiff:!0,expected:Error(`rejected promise`),actual:value})},err=>(utils.flag(this,`object`,err),result.call(this,...args))).catch(err=>{throw isError(err)&&error.stack&&(err.stack=error.stack.replace(error.message,err.message)),err});return recordAsyncExpect(test,promise,createAssertionMessage(utils,this,!!args.length),error,utils.flag(this,`soft`))}:result instanceof chai.Assertion?proxy:result}});return proxy})};function formatCalls(spy,msg,showActualCall){return spy.mock.calls.length&&(msg+=y$1.gray(`\n\nReceived:\n\n${spy.mock.calls.map((callArg,i)=>{let methodCall=y$1.bold(` ${ordinal(i+1)} ${spy.getMockName()} call:\n\n`);return methodCall+=showActualCall?diff(showActualCall,callArg,{omitAnnotationLines:!0}):stringify(callArg).split(`
115
+ `).map(line=>` ${line}`).join(`
116
+ `),methodCall+=`
117
+ `,methodCall}).join(`
118
+ `)}`)),msg+=y$1.gray(`\n\nNumber of calls: ${y$1.bold(spy.mock.calls.length)}\n`),msg}function formatReturns(spy,results,msg,showActualReturn){return results.length&&(msg+=y$1.gray(`\n\nReceived:\n\n${results.map((callReturn,i)=>{let methodCall=y$1.bold(` ${ordinal(i+1)} ${spy.getMockName()} call return:\n\n`);return methodCall+=showActualReturn?diff(showActualReturn,callReturn.value,{omitAnnotationLines:!0}):stringify(callReturn).split(`
119
+ `).map(line=>` ${line}`).join(`
120
+ `),methodCall+=`
121
+ `,methodCall}).join(`
122
+ `)}`)),msg+=y$1.gray(`\n\nNumber of calls: ${y$1.bold(spy.mock.calls.length)}\n`),msg}function getMatcherState(assertion,expect){let obj=assertion._obj,isNot=utils_exports.flag(assertion,`negate`),promise=utils_exports.flag(assertion,`promise`)||``,customMessage=utils_exports.flag(assertion,`message`),jestUtils={...getMatcherUtils(),diff,stringify,iterableEquality,subsetEquality},task=utils_exports.flag(assertion,`vitest-test`),currentTestName=task?.fullTestName??``;task?.type!==`test`&&(task=void 0);let matcherState={...getState(expect),currentTestName,customTesters:getCustomEqualityTesters(),isNot,utils:jestUtils,promise,equals,suppressedErrors:[],soft:utils_exports.flag(assertion,`soft`),poll:utils_exports.flag(assertion,`poll`),assertion};return Object.assign(matcherState,{task}),{state:matcherState,isNot,obj,customMessage}}var JestExtendError=class extends Error{actual;expected;__vitest_error_context__;constructor(message,actual,expected,__vitest_error_context__){super(message),this.actual=actual,this.expected=expected,this.__vitest_error_context__=__vitest_error_context__}};function JestExtendPlugin(c,expect,matchers){return(_,utils)=>{Object.entries(matchers).forEach(([expectAssertionName,expectAssertion])=>{function __VITEST_EXTEND_ASSERTION__(...args){let{state,isNot,obj,customMessage}=getMatcherState(this,expect),result=expectAssertion.call(state,obj,...args);if(result&&typeof result==`object`&&typeof result.then==`function`)return result.then(({pass,message,actual,expected,meta})=>{if(pass&&isNot||!pass&&!isNot)throw new JestExtendError((customMessage?`${customMessage}: `:``)+message(),actual,expected,{assertionName:expectAssertionName,meta})});let{pass,message,actual,expected,meta}=result;if(pass&&isNot||!pass&&!isNot)throw new JestExtendError((customMessage?`${customMessage}: `:``)+message(),actual,expected,{assertionName:expectAssertionName,meta})}let softWrapper=wrapAssertion(utils,expectAssertionName,__VITEST_EXTEND_ASSERTION__);if(utils.addMethod(globalThis[JEST_MATCHERS_OBJECT].matchers,expectAssertionName,softWrapper),utils.addMethod(c.Assertion.prototype,expectAssertionName,softWrapper),expectAssertion.__vitest_poll_takeover__){let addedMethod=c.Assertion.prototype[expectAssertionName];Object.defineProperty(addedMethod,"__vitest_poll_takeover__",{value:!0})}class CustomMatcher extends AsymmetricMatcher{constructor(inverse=!1,...sample){super(sample,inverse)}asymmetricMatch(other){let{pass}=expectAssertion.call(this.getMatcherContext(expect),other,...this.sample);return this.inverse?!pass:pass}toString(){return`${this.inverse?`not.`:``}${expectAssertionName}`}getExpectedType(){return`any`}toAsymmetricMatcher(){return`${this.toString()}<${this.sample.map(item=>stringify(item)).join(`, `)}>`}}let customMatcher=(...sample)=>new CustomMatcher(!1,...sample);Object.defineProperty(expect,expectAssertionName,{configurable:!0,enumerable:!0,value:customMatcher,writable:!0}),Object.defineProperty(expect.not,expectAssertionName,{configurable:!0,enumerable:!0,value:(...sample)=>new CustomMatcher(!0,...sample),writable:!0}),Object.defineProperty(globalThis[ASYMMETRIC_MATCHERS_OBJECT],expectAssertionName,{configurable:!0,enumerable:!0,value:customMatcher,writable:!0})})}}const JestExtend=(chai,utils)=>{utils.addMethod(chai.expect,`extend`,(expect,expects)=>{use(JestExtendPlugin(chai,expect,expects))})};function isBenchResult(value){return typeof value==`object`&&!!value&&`latency`in value&&typeof value.latency?.mean==`number`}function formatOps(ops){return ops.toLocaleString(`en-US`,{minimumFractionDigits:2,maximumFractionDigits:2})}const benchMatchers={toBeFasterThan(actual,expected,options){let{matcherHint,RECEIVED_COLOR,EXPECTED_COLOR}=this.utils,delta=options?.delta??0;if(!isBenchResult(actual))throw TypeError(`${matcherHint(`.toBeFasterThan`)} expects the actual value to be a benchmark result.`);if(!isBenchResult(expected))throw TypeError(`${matcherHint(`.toBeFasterThan`)} expects the expected value to be a benchmark result.`);let threshold=expected.latency.mean*(1-delta),pass=actual.latency.mean<threshold;return{pass,message:()=>{let relation=((actual.latency.mean-expected.latency.mean)/expected.latency.mean*100).toFixed(2);return pass?`${matcherHint(`.not.toBeFasterThan`)}\n\nExpected to not be faster, but was ${Math.abs(Number(relation))}% faster.\n\nReceived: ${RECEIVED_COLOR(formatOps(actual.throughput.mean))} ops/sec\nExpected: ${EXPECTED_COLOR(formatOps(expected.throughput.mean))} ops/sec\n`:`${matcherHint(`.toBeFasterThan`)}\n\nExpected to be faster${delta>0?` by at least ${(delta*100).toFixed(0)}%`:``}, but was ${Number(relation)>0?`${relation}% slower`:`only ${Math.abs(Number(relation))}% faster`}.\n\nReceived: ${RECEIVED_COLOR(formatOps(actual.throughput.mean))} ops/sec\nExpected: ${EXPECTED_COLOR(formatOps(expected.throughput.mean))} ops/sec\n`}}},toBeSlowerThan(actual,expected,options){let{matcherHint,RECEIVED_COLOR,EXPECTED_COLOR}=this.utils,delta=options?.delta??0;if(!isBenchResult(actual))throw TypeError(`${matcherHint(`.toBeSlowerThan`)} expects the actual value to be a benchmark result.`);if(!isBenchResult(expected))throw TypeError(`${matcherHint(`.toBeSlowerThan`)} expects the expected value to be a benchmark result.`);let threshold=expected.latency.mean*(1+delta),pass=actual.latency.mean>threshold;return{pass,message:()=>{let relation=((actual.latency.mean-expected.latency.mean)/expected.latency.mean*100).toFixed(2);return pass?`${matcherHint(`.not.toBeSlowerThan`)}\n\nExpected to not be slower, but was ${relation}% slower.\n\nReceived: ${RECEIVED_COLOR(formatOps(actual.throughput.mean))} ops/sec\nExpected: ${EXPECTED_COLOR(formatOps(expected.throughput.mean))} ops/sec\n`:`${matcherHint(`.toBeSlowerThan`)}\n\nExpected to be slower${delta>0?` by at least ${(delta*100).toFixed(0)}%`:``}, but was ${Number(relation)<0?`${Math.abs(Number(relation))}% faster`:`only ${relation}% slower`}.\n\nReceived: ${RECEIVED_COLOR(formatOps(actual.throughput.mean))} ops/sec\nExpected: ${EXPECTED_COLOR(formatOps(expected.throughput.mean))} ops/sec\n`}}}};var fakeTimersSrc={},global$1,hasRequiredGlobal;function requireGlobal(){return hasRequiredGlobal?global$1:(hasRequiredGlobal=1,global$1=commonjsGlobal===void 0?typeof window<`u`?window:self:commonjsGlobal,global$1)}var throwsOnProto_1,hasRequiredThrowsOnProto;function requireThrowsOnProto(){if(hasRequiredThrowsOnProto)return throwsOnProto_1;hasRequiredThrowsOnProto=1;let throwsOnProto;try{({}).__proto__,throwsOnProto=!1}catch{throwsOnProto=!0}return throwsOnProto_1=throwsOnProto,throwsOnProto_1}var copyPrototypeMethods,hasRequiredCopyPrototypeMethods;function requireCopyPrototypeMethods(){if(hasRequiredCopyPrototypeMethods)return copyPrototypeMethods;hasRequiredCopyPrototypeMethods=1;var call=Function.call,throwsOnProto=requireThrowsOnProto(),disallowedProperties=[`size`,`caller`,`callee`,`arguments`];return throwsOnProto&&disallowedProperties.push(`__proto__`),copyPrototypeMethods=function(prototype){return Object.getOwnPropertyNames(prototype).reduce(function(result,name){return disallowedProperties.includes(name)||typeof prototype[name]!=`function`||(result[name]=call.bind(prototype[name])),result},Object.create(null))},copyPrototypeMethods}var array,hasRequiredArray;function requireArray(){return hasRequiredArray?array:(hasRequiredArray=1,array=requireCopyPrototypeMethods()(Array.prototype),array)}var calledInOrder_1,hasRequiredCalledInOrder;function requireCalledInOrder(){if(hasRequiredCalledInOrder)return calledInOrder_1;hasRequiredCalledInOrder=1;var every=requireArray().every;function hasCallsLeft(callMap,spy){return callMap[spy.id]===void 0&&(callMap[spy.id]=0),callMap[spy.id]<spy.callCount}function checkAdjacentCalls(callMap,spy,index,spies){var calledBeforeNext=!0;return index!==spies.length-1&&(calledBeforeNext=spy.calledBefore(spies[index+1])),hasCallsLeft(callMap,spy)&&calledBeforeNext?(callMap[spy.id]+=1,!0):!1}function calledInOrder(spies){return every(arguments.length>1?arguments:spies,checkAdjacentCalls.bind(null,{}))}return calledInOrder_1=calledInOrder,calledInOrder_1}var className_1,hasRequiredClassName;function requireClassName(){if(hasRequiredClassName)return className_1;hasRequiredClassName=1;function className(value){return value.constructor&&value.constructor.name||null}return className_1=className,className_1}var deprecated={},hasRequiredDeprecated;function requireDeprecated(){return hasRequiredDeprecated?deprecated:(hasRequiredDeprecated=1,(function(exports){exports.wrap=function(func,msg){var wrapped=function(){return exports.printWarning(msg),func.apply(this,arguments)};return func.prototype&&(wrapped.prototype=func.prototype),wrapped},exports.defaultMsg=function(packageName,funcName){return`${packageName}.${funcName} is deprecated and will be removed from the public API in a future version of ${packageName}.`},exports.printWarning=function(msg){typeof process==`object`&&process.emitWarning?process.emitWarning(msg):console.info?console.info(msg):console.log(msg)}})(deprecated),deprecated)}var every,hasRequiredEvery;function requireEvery(){return hasRequiredEvery?every:(hasRequiredEvery=1,every=function(obj,fn){var pass=!0;try{obj.forEach(function(){if(!fn.apply(this,arguments))throw Error()})}catch{pass=!1}return pass},every)}var functionName,hasRequiredFunctionName;function requireFunctionName(){return hasRequiredFunctionName?functionName:(hasRequiredFunctionName=1,functionName=function(func){if(!func)return``;try{return func.displayName||func.name||(String(func).match(/function ([^\s(]+)/)||[])[1]}catch{return``}},functionName)}var orderByFirstCall_1,hasRequiredOrderByFirstCall;function requireOrderByFirstCall(){if(hasRequiredOrderByFirstCall)return orderByFirstCall_1;hasRequiredOrderByFirstCall=1;var sort=requireArray().sort,slice=requireArray().slice;function comparator(a,b){var aCall=a.getCall(0),bCall=b.getCall(0);return(aCall&&aCall.callId||-1)<(bCall&&bCall.callId||-1)?-1:1}function orderByFirstCall(spies){return sort(slice(spies),comparator)}return orderByFirstCall_1=orderByFirstCall,orderByFirstCall_1}var _function,hasRequired_function;function require_function(){return hasRequired_function?_function:(hasRequired_function=1,_function=requireCopyPrototypeMethods()(Function.prototype),_function)}var map,hasRequiredMap;function requireMap(){return hasRequiredMap?map:(hasRequiredMap=1,map=requireCopyPrototypeMethods()(Map.prototype),map)}var object,hasRequiredObject;function requireObject(){return hasRequiredObject?object:(hasRequiredObject=1,object=requireCopyPrototypeMethods()(Object.prototype),object)}var set,hasRequiredSet;function requireSet(){return hasRequiredSet?set:(hasRequiredSet=1,set=requireCopyPrototypeMethods()(Set.prototype),set)}var string,hasRequiredString;function requireString(){return hasRequiredString?string:(hasRequiredString=1,string=requireCopyPrototypeMethods()(String.prototype),string)}var prototypes,hasRequiredPrototypes;function requirePrototypes(){return hasRequiredPrototypes?prototypes:(hasRequiredPrototypes=1,prototypes={array:requireArray(),function:require_function(),map:requireMap(),object:requireObject(),set:requireSet(),string:requireString()},prototypes)}var typeDetect$1={exports:{}},typeDetect=typeDetect$1.exports,hasRequiredTypeDetect;function requireTypeDetect(){return hasRequiredTypeDetect?typeDetect$1.exports:(hasRequiredTypeDetect=1,(function(module,exports){(function(global,factory){module.exports=factory()})(typeDetect,(function(){var promiseExists=typeof Promise==`function`,globalObject=typeof self==`object`?self:commonjsGlobal,symbolExists=typeof Symbol<`u`,mapExists=typeof Map<`u`,setExists=typeof Set<`u`,weakMapExists=typeof WeakMap<`u`,weakSetExists=typeof WeakSet<`u`,dataViewExists=typeof DataView<`u`,symbolIteratorExists=symbolExists&&Symbol.iterator!==void 0,symbolToStringTagExists=symbolExists&&Symbol.toStringTag!==void 0,setEntriesExists=setExists&&typeof Set.prototype.entries==`function`,mapEntriesExists=mapExists&&typeof Map.prototype.entries==`function`,setIteratorPrototype=setEntriesExists&&Object.getPrototypeOf(new Set().entries()),mapIteratorPrototype=mapEntriesExists&&Object.getPrototypeOf(new Map().entries()),arrayIteratorExists=symbolIteratorExists&&typeof Array.prototype[Symbol.iterator]==`function`,arrayIteratorPrototype=arrayIteratorExists&&Object.getPrototypeOf([][Symbol.iterator]()),stringIteratorExists=symbolIteratorExists&&typeof String.prototype[Symbol.iterator]==`function`,stringIteratorPrototype=stringIteratorExists&&Object.getPrototypeOf(``[Symbol.iterator]()),toStringLeftSliceLength=8,toStringRightSliceLength=-1;function typeDetect(obj){var typeofObj=typeof obj;if(typeofObj!==`object`)return typeofObj;if(obj===null)return`null`;if(obj===globalObject)return`global`;if(Array.isArray(obj)&&(symbolToStringTagExists===!1||!(Symbol.toStringTag in obj)))return`Array`;if(typeof window==`object`&&window!==null){if(typeof window.location==`object`&&obj===window.location)return`Location`;if(typeof window.document==`object`&&obj===window.document)return`Document`;if(typeof window.navigator==`object`){if(typeof window.navigator.mimeTypes==`object`&&obj===window.navigator.mimeTypes)return`MimeTypeArray`;if(typeof window.navigator.plugins==`object`&&obj===window.navigator.plugins)return`PluginArray`}if((typeof window.HTMLElement==`function`||typeof window.HTMLElement==`object`)&&obj instanceof window.HTMLElement){if(obj.tagName===`BLOCKQUOTE`)return`HTMLQuoteElement`;if(obj.tagName===`TD`)return`HTMLTableDataCellElement`;if(obj.tagName===`TH`)return`HTMLTableHeaderCellElement`}}var stringTag=symbolToStringTagExists&&obj[Symbol.toStringTag];if(typeof stringTag==`string`)return stringTag;var objPrototype=Object.getPrototypeOf(obj);return objPrototype===RegExp.prototype?`RegExp`:objPrototype===Date.prototype?`Date`:promiseExists&&objPrototype===Promise.prototype?`Promise`:setExists&&objPrototype===Set.prototype?`Set`:mapExists&&objPrototype===Map.prototype?`Map`:weakSetExists&&objPrototype===WeakSet.prototype?`WeakSet`:weakMapExists&&objPrototype===WeakMap.prototype?`WeakMap`:dataViewExists&&objPrototype===DataView.prototype?`DataView`:mapExists&&objPrototype===mapIteratorPrototype?`Map Iterator`:setExists&&objPrototype===setIteratorPrototype?`Set Iterator`:arrayIteratorExists&&objPrototype===arrayIteratorPrototype?`Array Iterator`:stringIteratorExists&&objPrototype===stringIteratorPrototype?`String Iterator`:objPrototype===null?`Object`:Object.prototype.toString.call(obj).slice(toStringLeftSliceLength,toStringRightSliceLength)}return typeDetect}))})(typeDetect$1),typeDetect$1.exports)}var typeOf,hasRequiredTypeOf;function requireTypeOf(){if(hasRequiredTypeOf)return typeOf;hasRequiredTypeOf=1;var type=requireTypeDetect();return typeOf=function(value){return type(value).toLowerCase()},typeOf}var valueToString_1,hasRequiredValueToString;function requireValueToString(){if(hasRequiredValueToString)return valueToString_1;hasRequiredValueToString=1;function valueToString(value){return value&&value.toString?value.toString():String(value)}return valueToString_1=valueToString,valueToString_1}var lib,hasRequiredLib;function requireLib(){return hasRequiredLib?lib:(hasRequiredLib=1,lib={global:requireGlobal(),calledInOrder:requireCalledInOrder(),className:requireClassName(),deprecated:requireDeprecated(),every:requireEvery(),functionName:requireFunctionName(),orderByFirstCall:requireOrderByFirstCall(),prototypes:requirePrototypes(),typeOf:requireTypeOf(),valueToString:requireValueToString()},lib)}var hasRequiredFakeTimersSrc;function requireFakeTimersSrc(){if(hasRequiredFakeTimersSrc)return fakeTimersSrc;hasRequiredFakeTimersSrc=1;let globalObject=requireLib().global,timersModule,timersPromisesModule;if(typeof __vitest_required__<`u`){try{timersModule=__vitest_required__.timers}catch{}try{timersPromisesModule=__vitest_required__.timersPromises}catch{}}function withGlobal(_global){let maxTimeout=2**31-1,idCounterStart=0xe8d4a51000,NOOP=function(){},NOOP_ARRAY=function(){return[]},isPresent={},timeoutResult,addTimerReturnsObject=!1;_global.setTimeout&&(isPresent.setTimeout=!0,timeoutResult=_global.setTimeout(NOOP,0),addTimerReturnsObject=typeof timeoutResult==`object`),isPresent.clearTimeout=!!_global.clearTimeout,isPresent.setInterval=!!_global.setInterval,isPresent.clearInterval=!!_global.clearInterval,isPresent.hrtime=_global.process&&typeof _global.process.hrtime==`function`,isPresent.hrtimeBigint=isPresent.hrtime&&typeof _global.process.hrtime.bigint==`function`,isPresent.nextTick=_global.process&&typeof _global.process.nextTick==`function`;let utilPromisify=_global.process&&_global.__vitest_required__&&_global.__vitest_required__.util.promisify;isPresent.performance=_global.performance&&typeof _global.performance.now==`function`;let hasPerformancePrototype=_global.Performance&&(typeof _global.Performance).match(/^(function|object)$/),hasPerformanceConstructorPrototype=_global.performance&&_global.performance.constructor&&_global.performance.constructor.prototype;isPresent.queueMicrotask=Object.prototype.hasOwnProperty.call(_global,`queueMicrotask`),isPresent.requestAnimationFrame=_global.requestAnimationFrame&&typeof _global.requestAnimationFrame==`function`,isPresent.cancelAnimationFrame=_global.cancelAnimationFrame&&typeof _global.cancelAnimationFrame==`function`,isPresent.requestIdleCallback=_global.requestIdleCallback&&typeof _global.requestIdleCallback==`function`,isPresent.cancelIdleCallback=_global.cancelIdleCallback&&typeof _global.cancelIdleCallback==`function`,isPresent.setImmediate=_global.setImmediate&&typeof _global.setImmediate==`function`,isPresent.clearImmediate=_global.clearImmediate&&typeof _global.clearImmediate==`function`,isPresent.Intl=_global.Intl&&typeof _global.Intl==`object`,isPresent.Temporal=_global.Temporal!==null&&typeof _global.Temporal==`object`&&_global.Temporal.Now!==void 0&&_global.Temporal.Instant!==void 0,_global.clearTimeout&&_global.clearTimeout(timeoutResult);let NativeDate=_global.Date,NativeIntl=isPresent.Intl?Object.defineProperties(Object.create(null),Object.getOwnPropertyDescriptors(_global.Intl)):void 0,NativeTemporal=isPresent.Temporal?_global.Temporal:void 0,uniqueTimerId=idCounterStart,uniqueTimerOrder=0;if(NativeDate===void 0)throw Error("The global scope doesn't have a `Date` object (see https://github.com/sinonjs/sinon/issues/1852#issuecomment-419622780)");isPresent.Date=!0;class FakePerformanceEntry{constructor(name,entryType,startTime,duration){this.name=name,this.entryType=entryType,this.startTime=startTime,this.duration=duration}toJSON(){return JSON.stringify({...this})}}function isNumberFinite(num){return Number.isFinite?Number.isFinite(num):isFinite(num)}function checkIsNearInfiniteLimit(clock,i){clock.loopLimit&&i===clock.loopLimit-1&&(clock.isNearInfiniteLimit=!0)}function resetIsNearInfiniteLimit(clock){clock&&(clock.isNearInfiniteLimit=!1)}function parseTime(str){if(!str)return 0;let strings=str.split(`:`),l=strings.length,i=l,ms=0,parsed;if(l>3||!/^(\d\d:){0,2}\d\d?$/.test(str))throw Error(`tick only understands numbers, 'm:s' and 'h:m:s'. Each part must be two digits`);for(;i--;){if(parsed=parseInt(strings[i],10),parsed>=60)throw Error(`Invalid time ${str}`);ms+=parsed*60**(l-i-1)}return ms*1e3}function nanoRemainder(msFloat){let modulo=1e6,remainder=msFloat*1e6%modulo,positiveRemainder=remainder<0?remainder+modulo:remainder;return Math.floor(positiveRemainder)}function getEpoch(epoch){if(!epoch)return 0;if(typeof epoch==`number`)return epoch;if(typeof epoch.getTime==`function`)return epoch.getTime();if(typeof epoch.epochMilliseconds==`number`)return epoch.epochMilliseconds;throw TypeError(`now should be milliseconds since UNIX epoch`)}function inRange(from,to,timer){return timer&&timer.callAt>=from&&timer.callAt<=to}function getInfiniteLoopError(clock,job){let infiniteLoopError=Error(`Aborting after running ${clock.loopLimit} timers, assuming an infinite loop!`);if(!job.error)return infiniteLoopError;let computedTargetPattern=/target\.*[<|(|[].*?[>|\]|)]\s*/,clockMethodPattern=new RegExp(String(Object.keys(clock).join(`|`)));addTimerReturnsObject&&(clockMethodPattern=RegExp(`\\s+at (Object\\.)?(?:${Object.keys(clock).join(`|`)})\\s+`));let matchedLineIndex=-1;job.error.stack.split(`
123
+ `).some(function(line,i){return line.match(computedTargetPattern)?(matchedLineIndex=i,!0):line.match(clockMethodPattern)?(matchedLineIndex=i,!1):matchedLineIndex>=0});let stack=`${infiniteLoopError}\n${job.type||`Microtask`} - ${job.func.name||`anonymous`}\n${job.error.stack.split(`
124
+ `).slice(matchedLineIndex+1).join(`
125
+ `)}`;try{Object.defineProperty(infiniteLoopError,"stack",{value:stack})}catch{}return infiniteLoopError}function createDate(){class ClockDate extends NativeDate{static clock;constructor(...args){args.length===0?super(ClockDate.clock.now):super(...args),Object.defineProperty(this,"constructor",{value:NativeDate,enumerable:!1})}static[Symbol.hasInstance](instance){return instance instanceof NativeDate}}ClockDate.isFake=!0,NativeDate.now&&(ClockDate.now=function(){return ClockDate.clock.now});let NativeDateWithToSource=NativeDate;return NativeDateWithToSource.toSource&&(ClockDate.toSource=function(){return NativeDateWithToSource.toSource()}),ClockDate.toString=function(){return NativeDateWithToSource.toString()},new Proxy(ClockDate,{apply(){if(this instanceof ClockDate)throw TypeError("A Proxy should only capture `new` calls with the `construct` handler. This is not supposed to be possible, so check the logic.");return new NativeDate(ClockDate.clock.now).toString()}})}function createIntl(clock){let IntlWithClock={clock};return Object.getOwnPropertyNames(NativeIntl).forEach(property=>IntlWithClock[property]=NativeIntl[property]),IntlWithClock.DateTimeFormat=function(...args){let realFormatter=new NativeIntl.DateTimeFormat(...args),formatter={};return[`formatRange`,`formatRangeToParts`,`resolvedOptions`].forEach(method=>{formatter[method]=realFormatter[method].bind(realFormatter)}),[`format`,`formatToParts`].forEach(method=>{formatter[method]=function(date){return realFormatter[method](date||IntlWithClock.clock.now)}}),formatter},IntlWithClock.DateTimeFormat.prototype=Object.create(NativeIntl.DateTimeFormat.prototype),IntlWithClock.DateTimeFormat.supportedLocalesOf=NativeIntl.DateTimeFormat.supportedLocalesOf,IntlWithClock}function createTemporal(clock,getNanos){let fakeNow={instant(){return NativeTemporal.Instant.fromEpochNanoseconds(BigInt(clock.now)*1000000n+BigInt(getNanos()))},timeZoneId(){return NativeTemporal.Now.timeZoneId()},zonedDateTimeISO(timeZone){let tz=timeZone??NativeTemporal.Now.timeZoneId();return fakeNow.instant().toZonedDateTimeISO(tz)},plainDateTimeISO(timeZone){return fakeNow.zonedDateTimeISO(timeZone).toPlainDateTime()},plainDateISO(timeZone){return fakeNow.zonedDateTimeISO(timeZone).toPlainDate()},plainTimeISO(timeZone){return fakeNow.zonedDateTimeISO(timeZone).toPlainTime()}},TemporalWithClock=Object.create(Object.getPrototypeOf(NativeTemporal));return[...Object.getOwnPropertyNames(NativeTemporal),...Object.getOwnPropertySymbols(NativeTemporal)].forEach(prop=>{Object.defineProperty(TemporalWithClock,prop,Object.getOwnPropertyDescriptor(NativeTemporal,prop))}),Object.defineProperty(TemporalWithClock,"Now",{value:fakeNow,writable:!0,enumerable:!1,configurable:!0}),TemporalWithClock}function enqueueJob(clock,job){clock.jobs||=[],clock.jobs.push(job)}function runJobs(clock){if(!clock.jobs)return;let wasNearLimit=clock.isNearInfiniteLimit;for(let i=0;i<clock.jobs.length;i++){let job=clock.jobs[i];if(job.func.apply(null,job.args),checkIsNearInfiniteLimit(clock,i),clock.loopLimit&&i>clock.loopLimit)throw getInfiniteLoopError(clock,job)}wasNearLimit||resetIsNearInfiniteLimit(clock),clock.jobs=[]}class TimerHeap{constructor(){this.timers=[]}peek(){return this.timers[0]}push(timer){this.timers.push(timer),this.bubbleUp(this.timers.length-1)}pop(){if(this.timers.length===0)return;let first=this.timers[0],last=this.timers.pop();return this.timers.length>0&&(this.timers[0]=last,last.heapIndex=0,this.bubbleDown(0)),delete first.heapIndex,first}remove(timer){let index=timer.heapIndex;if(index===void 0||this.timers[index]!==timer)return!1;let last=this.timers.pop();return timer!==last&&(this.timers[index]=last,last.heapIndex=index,compareTimers(last,timer)<0?this.bubbleUp(index):this.bubbleDown(index)),delete timer.heapIndex,!0}bubbleUp(index){let timer=this.timers[index],currentIndex=index;for(;currentIndex>0;){let parentIndex=Math.floor((currentIndex-1)/2),parent=this.timers[parentIndex];if(compareTimers(timer,parent)<0)this.timers[currentIndex]=parent,parent.heapIndex=currentIndex,currentIndex=parentIndex;else break}this.timers[currentIndex]=timer,timer.heapIndex=currentIndex}bubbleDown(index){let timer=this.timers[index],currentIndex=index,halfLength=Math.floor(this.timers.length/2);for(;currentIndex<halfLength;){let leftIndex=currentIndex*2+1,rightIndex=leftIndex+1,bestChildIndex=leftIndex,bestChild=this.timers[leftIndex];if(rightIndex<this.timers.length&&compareTimers(this.timers[rightIndex],bestChild)<0&&(bestChildIndex=rightIndex,bestChild=this.timers[rightIndex]),compareTimers(bestChild,timer)<0)this.timers[currentIndex]=bestChild,bestChild.heapIndex=currentIndex,currentIndex=bestChildIndex;else break}this.timers[currentIndex]=timer,timer.heapIndex=currentIndex}}function ensureTimerState(clock){clock.timers||(clock.timers=new Map,clock.timerHeap=new TimerHeap)}function hasTimer(clock,id){return clock.timers?clock.timers.has(id):!1}function getTimer(clock,id){return clock.timers?clock.timers.get(id):void 0}function setTimer(clock,timer){ensureTimerState(clock),clock.timers.set(timer.id,timer)}function deleteTimer(clock,id){return clock.timers?clock.timers.delete(id):!1}function forEachActiveTimer(clock,callback){if(clock.timers)for(let timer of clock.timers.values())callback(timer)}function rebuildTimerHeap(clock){clock.timerHeap=new TimerHeap,forEachActiveTimer(clock,timer=>{clock.timerHeap.push(timer)})}function addTimer(clock,timer){if(timer.func===void 0)throw Error(`Callback must be provided to timer calls`);if(typeof timer.func!=`function`)throw TypeError(`[ERR_INVALID_CALLBACK]: Callback must be a function. Received ${timer.func} of type ${typeof timer.func}`);for(clock.isNearInfiniteLimit&&(timer.error=Error()),timer.type=timer.immediate?`Immediate`:`Timeout`,Object.prototype.hasOwnProperty.call(timer,`delay`)&&(typeof timer.delay!=`number`&&(timer.delay=parseInt(timer.delay,10)),isNumberFinite(timer.delay)||(timer.delay=0),timer.delay=timer.delay>maxTimeout?1:timer.delay,timer.delay=Math.max(0,timer.delay)),Object.prototype.hasOwnProperty.call(timer,`interval`)&&(timer.type=`Interval`,timer.interval=timer.interval>maxTimeout?1:timer.interval),Object.prototype.hasOwnProperty.call(timer,`animation`)&&(timer.type=`AnimationFrame`,timer.animation=!0),Object.prototype.hasOwnProperty.call(timer,`requestIdleCallback`)&&(timer.delay||(timer.type=`IdleCallback`),timer.requestIdleCallback=!0),ensureTimerState(clock);hasTimer(clock,uniqueTimerId);)uniqueTimerId++,uniqueTimerId>=2**53-1&&(uniqueTimerId=idCounterStart);return timer.id=uniqueTimerId++,uniqueTimerId>=2**53-1&&(uniqueTimerId=idCounterStart),timer.order=uniqueTimerOrder++,timer.createdAt=clock.now,timer.callAt=clock.now+(parseInt(String(timer.delay))||+!!clock.duringTick),setTimer(clock,timer),clock.timerHeap.push(timer),addTimerReturnsObject?{refed:!0,ref:function(){return this.refed=!0,this},unref:function(){return this.refed=!1,this},hasRef:function(){return this.refed},refresh:function(){return timer.callAt=clock.now+(parseInt(String(timer.delay))||+!!clock.duringTick),clock.timerHeap.remove(timer),timer.order=uniqueTimerOrder++,setTimer(clock,timer),clock.timerHeap.push(timer),this},[Symbol.toPrimitive]:function(){return timer.id}}:timer.id}function compareTimers(a,b){return a.type===`IdleCallback`&&b.type!==`IdleCallback`?1:a.type!==`IdleCallback`&&b.type===`IdleCallback`||a.callAt<b.callAt?-1:a.callAt>b.callAt?1:a.immediate&&!b.immediate?-1:!a.immediate&&b.immediate?1:a.order<b.order?-1:a.order>b.order?1:a.createdAt<b.createdAt?-1:a.createdAt>b.createdAt?1:a.id<b.id?-1:+(a.id>b.id)}function firstTimerInRange(clock,from,to){if(!clock.timerHeap)return null;let timers=clock.timerHeap.timers;if(timers.length===1&&timers[0].requestIdleCallback)return timers[0];let first=clock.timerHeap.peek();if(first&&inRange(from,to,first))return first;let timer=null;for(let i=0;i<timers.length;i++)inRange(from,to,timers[i])&&(!timer||compareTimers(timer,timers[i])===1)&&(timer=timers[i]);return timer}function firstTimer(clock){return clock.timerHeap&&clock.timerHeap.peek()||null}function lastTimer(clock){if(!clock.timerHeap)return null;let timers=clock.timerHeap.timers,timer=null;for(let i=0;i<timers.length;i++)(!timer||compareTimers(timer,timers[i])===-1)&&(timer=timers[i]);return timer}function callTimer(clock,timer){typeof timer.interval==`number`?(clock.timerHeap.remove(timer),timer.callAt+=timer.interval,timer.order=uniqueTimerOrder++,clock.isNearInfiniteLimit&&(timer.error=Error()),clock.timerHeap.push(timer)):(deleteTimer(clock,timer.id),clock.timerHeap.remove(timer)),typeof timer.func==`function`&&timer.func.apply(null,timer.args)}function getClearHandler(ttype){return ttype===`IdleCallback`||ttype===`AnimationFrame`?`cancel${ttype}`:`clear${ttype}`}function getScheduleHandler(ttype){return ttype===`IdleCallback`||ttype===`AnimationFrame`?`request${ttype}`:`set${ttype}`}function createWarnOnce(){let calls=0;return function(msg){!calls++&&console.warn(msg)}}let warnOnce=createWarnOnce();function clearTimer(clock,timerId,ttype){if(!timerId)return;let id=Number(timerId);if(Number.isNaN(id)||id<idCounterStart){let handlerName=getClearHandler(ttype);if(clock.shouldClearNativeTimers===!0){let nativeHandler=clock[`_${handlerName}`];return typeof nativeHandler==`function`?nativeHandler(timerId):void 0}let stackTrace=Error().stack.split(`
126
+ `).slice(1).join(`
127
+ `);warnOnce(`FakeTimers: ${handlerName} was invoked to clear a native timer instead of one created by this library.
128
+ To automatically clean-up native timers, use \`shouldClearNativeTimers\`.\n${stackTrace}`)}if(hasTimer(clock,id)){let timer=getTimer(clock,id);if(timer.type===ttype||timer.type===`Timeout`&&ttype===`Interval`||timer.type===`Interval`&&ttype===`Timeout`)deleteTimer(clock,id),clock.timerHeap.remove(timer);else{let clear=getClearHandler(ttype),schedule=getScheduleHandler(timer.type);throw Error(`Cannot clear timer: timer created with ${schedule}() but cleared with ${clear}()`)}}}function hijackMethod(target,method,clock){if(clock[method].hasOwnProperty=Object.prototype.hasOwnProperty.call(target,method),clock[`_${method}`]=target[method],method===`Date`)target[method]=clock[method];else if(method===`Intl`)target[method]=clock[method];else if(method===`Temporal`)target[method]=clock[method];else if(method===`performance`){let originalPerfDescriptor=Object.getOwnPropertyDescriptor(target,method);if(originalPerfDescriptor&&originalPerfDescriptor.get&&!originalPerfDescriptor.set){Object.defineProperty(clock,`_${method}`,originalPerfDescriptor);let perfDescriptor=Object.getOwnPropertyDescriptor(clock,method);Object.defineProperty(target,method,perfDescriptor)}else target[method]=clock[method]}else target[method]=function(){return clock[method].apply(clock,arguments)},Object.defineProperties(target[method],Object.getOwnPropertyDescriptors(clock[method]));target[method].clock=clock}function doIntervalTick(clock,advanceTimeDelta){clock.tick(advanceTimeDelta)}let timers={setTimeout:_global.setTimeout,clearTimeout:_global.clearTimeout,setInterval:_global.setInterval,clearInterval:_global.clearInterval,Date:_global.Date};isPresent.setImmediate&&(timers.setImmediate=_global.setImmediate),isPresent.clearImmediate&&(timers.clearImmediate=_global.clearImmediate),isPresent.hrtime&&(timers.hrtime=_global.process.hrtime),isPresent.nextTick&&(timers.nextTick=_global.process.nextTick),isPresent.performance&&(timers.performance=_global.performance),isPresent.requestAnimationFrame&&(timers.requestAnimationFrame=_global.requestAnimationFrame),isPresent.queueMicrotask&&(timers.queueMicrotask=_global.queueMicrotask),isPresent.cancelAnimationFrame&&(timers.cancelAnimationFrame=_global.cancelAnimationFrame),isPresent.requestIdleCallback&&(timers.requestIdleCallback=_global.requestIdleCallback),isPresent.cancelIdleCallback&&(timers.cancelIdleCallback=_global.cancelIdleCallback),isPresent.Intl&&(timers.Intl=NativeIntl),isPresent.Temporal&&(timers.Temporal=NativeTemporal);let originalSetTimeout=_global.setImmediate||_global.setTimeout,originalClearInterval=_global.clearInterval,originalSetInterval=_global.setInterval;function createClock(start,loopLimit){start=Math.floor(getEpoch(start));let startTimestamp=start;loopLimit||=1e3;let nanos=0,uninstalled=!1,adjustedSystemTime=[0,0],clock={now:start,Date:createDate(),loopLimit,isNearInfiniteLimit:!1,tickMode:{mode:`manual`,counter:0,delta:void 0}};clock.Date.clock=clock;function getTimeToNextFrame(){return 16-(clock.now-startTimestamp)%16}function hrtime(prev){let millisSinceStart=clock.now-adjustedSystemTime[0]-startTimestamp,secsSinceStart=Math.floor(millisSinceStart/1e3),remainderInNanos=(millisSinceStart-secsSinceStart*1e3)*1e6+nanos-adjustedSystemTime[1];if(Array.isArray(prev)){if(prev[1]>1e9)throw TypeError(`Number of nanoseconds can't exceed a billion`);let oldSecs=prev[0],nanoDiff=remainderInNanos-prev[1],secDiff=secsSinceStart-oldSecs;return nanoDiff<0&&(nanoDiff+=1e9,--secDiff),[secDiff,nanoDiff]}return[secsSinceStart,remainderInNanos]}function fakePerformanceNow(){let hrt=hrtime();return hrt[0]*1e3+hrt[1]/1e6}isPresent.hrtimeBigint&&(hrtime.bigint=function(){let parts=hrtime();return BigInt(parts[0])*BigInt(1e9)+BigInt(parts[1])}),isPresent.Intl&&(clock.Intl=createIntl(clock),clock.Intl.clock=clock),isPresent.Temporal&&(clock.Temporal=createTemporal(clock,()=>nanos)),clock.setTickMode=function(tickModeConfig){let{mode:newMode,delta:newDelta}=tickModeConfig,{mode:oldMode,delta:oldDelta}=clock.tickMode;(newMode!==oldMode||newDelta!==oldDelta)&&(oldMode===`interval`&&originalClearInterval(clock.attachedInterval),clock.tickMode={counter:clock.tickMode.counter+1,mode:newMode,delta:newDelta},newMode===`nextAsync`?advanceUntilModeChanges():newMode===`interval`&&createIntervalTick(clock,newDelta||20))};async function advanceUntilModeChanges(){async function newMacrotask(){let channel=new MessageChannel;await new Promise(resolve=>{channel.port1.onmessage=()=>{resolve(void 0),channel.port1.close()},channel.port2.postMessage(void 0)}),channel.port1.close(),channel.port2.close(),await new Promise(resolve=>{originalSetTimeout(resolve)})}let{counter}=clock.tickMode;for(;clock.tickMode.counter===counter;){if(await newMacrotask(),clock.tickMode.counter!==counter)return;clock.next()}}function pauseAutoTickUntilFinished(promise){return clock.tickMode.mode===`nextAsync`?(clock.setTickMode({mode:`manual`}),promise.finally(()=>{uninstalled||clock.setTickMode({mode:`nextAsync`})})):promise}function getTimeToNextIdlePeriod(){let timeToNextIdlePeriod=0;return clock.countTimers()>0&&(timeToNextIdlePeriod=50),timeToNextIdlePeriod}clock.requestIdleCallback=function(func,{timeout}={}){let result=addTimer(clock,{func,args:[{didTimeout:!0,timeRemaining:getTimeToNextIdlePeriod}],delay:timeout,requestIdleCallback:!0});return Number(result)},clock.cancelIdleCallback=function(timerId){return clearTimer(clock,timerId,`IdleCallback`)},clock.setTimeout=function(func,timeout){return addTimer(clock,{func,args:Array.prototype.slice.call(arguments,2),delay:timeout})},_global.Promise!==void 0&&utilPromisify&&(clock.setTimeout[utilPromisify.custom]=function(timeout,arg){return new _global.Promise(function(resolve){addTimer(clock,{func:resolve,args:[arg],delay:timeout})})}),clock.clearTimeout=function(timerId){return clearTimer(clock,timerId,`Timeout`)},clock.nextTick=function(func){return enqueueJob(clock,{func,args:Array.prototype.slice.call(arguments,1),error:clock.isNearInfiniteLimit?Error():null})},clock.queueMicrotask=function(func){return clock.nextTick(func)},clock.setInterval=function(func,timeout){return timeout=parseInt(String(timeout),10),addTimer(clock,{func,args:Array.prototype.slice.call(arguments,2),delay:timeout,interval:timeout})},clock.clearInterval=function(timerId){return clearTimer(clock,timerId,`Interval`)},isPresent.setImmediate&&(clock.setImmediate=(function(func){return addTimer(clock,{func,args:Array.prototype.slice.call(arguments,1),immediate:!0})}),_global.Promise!==void 0&&utilPromisify&&(clock.setImmediate[utilPromisify.custom]=function(arg){return new _global.Promise(function(resolve){addTimer(clock,{func:resolve,args:[arg],immediate:!0})})}),clock.clearImmediate=function(timerId){return clearTimer(clock,timerId,`Immediate`)}),clock.countTimers=function(){return(clock.timerHeap?clock.timerHeap.timers.length:0)+(clock.jobs||[]).length},clock.requestAnimationFrame=function(func){let result=addTimer(clock,{func,delay:getTimeToNextFrame(),get args(){return[fakePerformanceNow()]},animation:!0});return Number(result)},clock.cancelAnimationFrame=function(timerId){return clearTimer(clock,timerId,`AnimationFrame`)},clock.runMicrotasks=function(){runJobs(clock)};function durationToMs(duration){let relativeTo=NativeTemporal.Instant.fromEpochMilliseconds(clock.now).toZonedDateTimeISO(NativeTemporal.Now.timeZoneId());return duration.total({unit:`millisecond`,relativeTo})}function tickValueToMs(tickValue){return typeof tickValue==`number`?tickValue:isPresent.Temporal&&typeof tickValue==`object`&&tickValue&&typeof tickValue.total==`function`?durationToMs(tickValue):parseTime(tickValue)}function createTickState(tickValue){let msFloat=tickValueToMs(tickValue),ms=Math.floor(msFloat),remainder=nanoRemainder(msFloat),nanosTotal=nanos+remainder,tickTo=clock.now+ms;if(msFloat<0)throw TypeError(`Negative ticks are not supported`);return nanosTotal>=1e6&&(tickTo+=1,nanosTotal-=1e6),{msFloat,ms,nanosTotal,tickFrom:clock.now,tickTo,previous:clock.now,timer:null,firstException:null,oldNow:null}}function applyClockChangeCompensation(state,oldNow,options){if(oldNow!==clock.now){let difference=clock.now-oldNow;state.tickFrom+=difference,state.tickTo+=difference,options&&options.includePrevious&&(state.previous+=difference)}}function runInitialJobs(state){state.oldNow=clock.now,runJobs(clock),applyClockChangeCompensation(state,state.oldNow)}function runPostLoopJobs(state){state.oldNow=clock.now,runJobs(clock),applyClockChangeCompensation(state,state.oldNow)}function selectNextTimerInRange(state){state.timer=firstTimerInRange(clock,state.previous,state.tickTo),state.previous=state.tickFrom}function runTimersInRange(state,isAsync,nextPromiseTick,compensationCheck){for(state.timer=firstTimerInRange(clock,state.tickFrom,state.tickTo);state.timer&&state.tickFrom<=state.tickTo;){if(hasTimer(clock,state.timer.id)){state.tickFrom=state.timer.callAt,clock.now=state.timer.callAt,state.oldNow=clock.now;try{runJobs(clock),callTimer(clock,state.timer)}catch(e){state.firstException=state.firstException||e}if(isAsync)return originalSetTimeout(nextPromiseTick),!0;compensationCheck()}selectNextTimerInRange(state)}return!1}function finalizeTick(state,isAsync,resolve){if(state.timer=firstTimerInRange(clock,state.tickFrom,state.tickTo),state.timer)try{clock.tick(state.tickTo-clock.now)}catch(e){state.firstException=state.firstException||e}else clock.now=state.tickTo,nanos=state.nanosTotal;if(state.firstException)throw state.firstException;if(isAsync)resolve(clock.now);else return clock.now}function doTick(tickValue,isAsync,resolve,reject){let state=createTickState(tickValue);nanos=state.nanosTotal,clock.duringTick=!0,runInitialJobs(state);let compensationCheck=function(){applyClockChangeCompensation(state,state.oldNow,{includePrevious:!0})},nextPromiseTick=isAsync&&function(){try{compensationCheck(),selectNextTimerInRange(state),doTickInner()}catch(e){reject(e)}};function doTickInner(){if(!runTimersInRange(state,isAsync,nextPromiseTick,compensationCheck))return runPostLoopJobs(state),clock.duringTick=!1,finalizeTick(state,isAsync,resolve)}return doTickInner()}clock.tick=function(tickValue){return doTick(tickValue,!1)},clock.next=function(){runJobs(clock);let timer=firstTimer(clock);if(!timer)return clock.now;clock.duringTick=!0;try{return clock.now=timer.callAt,callTimer(clock,timer),runJobs(clock),clock.now}finally{clock.duringTick=!1}};function runAsyncWithNativeTimeout(callback){return pauseAutoTickUntilFinished(new _global.Promise(function(resolve,reject){originalSetTimeout(function(){try{callback(resolve,reject)}catch(e){reject(e)}})}))}return clock.runAll=function(){runJobs(clock);for(let i=0;i<clock.loopLimit;i++){if(!clock.timers||clock.timerHeap.timers.length===0)return resetIsNearInfiniteLimit(clock),clock.now;checkIsNearInfiniteLimit(clock,i),clock.next()}let excessJob=firstTimer(clock);throw getInfiniteLoopError(clock,excessJob)},clock.runToFrame=function(){return clock.tick(getTimeToNextFrame())},clock.runToLast=function(){let timer=lastTimer(clock);return timer?clock.tick(timer.callAt-clock.now):(runJobs(clock),clock.now)},_global.Promise!==void 0&&(clock.tickAsync=function(tickValue){return runAsyncWithNativeTimeout(function(resolve,reject){doTick(tickValue,!0,resolve,reject)})},clock.nextAsync=function(){return runAsyncWithNativeTimeout(function(resolve,reject){let timer=firstTimer(clock);if(!timer){resolve(clock.now);return}let err;clock.duringTick=!0,clock.now=timer.callAt;try{callTimer(clock,timer)}catch(e){err=e}clock.duringTick=!1,originalSetTimeout(function(){err?reject(err):resolve(clock.now)})})},clock.runAllAsync=function(){let i=0;function doRun(resolve,reject){try{runJobs(clock);let numTimers;if(i<clock.loopLimit){if(!clock.timerHeap){resetIsNearInfiniteLimit(clock),resolve(clock.now);return}if(numTimers=clock.timerHeap.timers.length,numTimers===0){resetIsNearInfiniteLimit(clock),resolve(clock.now);return}checkIsNearInfiniteLimit(clock,i),clock.next(),i++,originalSetTimeout(function(){doRun(resolve,reject)});return}let excessJob=firstTimer(clock);reject(getInfiniteLoopError(clock,excessJob))}catch(e){reject(e)}}return runAsyncWithNativeTimeout(function(resolve,reject){doRun(resolve,reject)})},clock.runToLastAsync=function(){return runAsyncWithNativeTimeout(function(resolve){let timer=lastTimer(clock);if(!timer){runJobs(clock),resolve(clock.now);return}resolve(clock.tickAsync(timer.callAt-clock.now))})}),clock.reset=function(){nanos=0,clock.timers=new Map,clock.timerHeap=new TimerHeap,clock.jobs=[],clock.now=start},clock.setSystemTime=function(systemTime){let newNow=getEpoch(systemTime),difference=newNow-clock.now;adjustedSystemTime[0]+=difference,adjustedSystemTime[1]+=nanos,clock.now=newNow,nanos=0,forEachActiveTimer(clock,timer=>{timer.createdAt+=difference,timer.callAt+=difference})},clock.jump=function(tickValue){let msFloat=tickValueToMs(tickValue),ms=Math.floor(msFloat);return forEachActiveTimer(clock,timer=>{clock.now+ms>timer.callAt&&(timer.callAt=clock.now+ms)}),rebuildTimerHeap(clock),clock.tick(ms),clock.now},isPresent.performance&&(clock.performance=Object.create(null),clock.performance.now=fakePerformanceNow),isPresent.hrtime&&(clock.hrtime=hrtime),clock.uninstall=function(){if(uninstalled=!0,clock.setTickMode({mode:`manual`}),clock.methods){let method,i,l;for(i=0,l=clock.methods.length;i<l;i++){if(method=clock.methods[i],method===`hrtime`&&_global.process)_global.process.hrtime=clock._hrtime;else if(method===`nextTick`&&_global.process)_global.process.nextTick=clock._nextTick;else if(method===`performance`){let originalPerfDescriptor=Object.getOwnPropertyDescriptor(clock,`_${method}`);originalPerfDescriptor&&originalPerfDescriptor.get&&!originalPerfDescriptor.set?Object.defineProperty(_global,method,originalPerfDescriptor):originalPerfDescriptor.configurable&&(_global[method]=clock[`_${method}`])}else if(clock[method]&&clock[method].hasOwnProperty)_global[method]=clock[`_${method}`];else try{delete _global[method]}catch{}if(clock.timersModuleMethods!==void 0)for(let j=0;j<clock.timersModuleMethods.length;j++){let entry=clock.timersModuleMethods[j];timersModule[entry.methodName]=entry.original}if(clock.timersPromisesModuleMethods!==void 0)for(let j=0;j<clock.timersPromisesModuleMethods.length;j++){let entry=clock.timersPromisesModuleMethods[j];timersPromisesModule[entry.methodName]=entry.original}}clock.methods=[]}if(clock.abortListenerMap)for(let[listener,signal]of clock.abortListenerMap.entries())signal.removeEventListener(`abort`,listener),clock.abortListenerMap.delete(listener);return clock.timerHeap?clock.timerHeap.timers.slice():[]},clock}function createIntervalTick(clock,delta){let intervalTick=doIntervalTick.bind(null,clock,delta);clock.attachedInterval=originalSetInterval(intervalTick,delta)}function install(config){if(arguments.length>1||config instanceof Date||Array.isArray(config)||typeof config==`number`)throw TypeError(`FakeTimers.install called with ${String(config)} install requires an object parameter`);if(_global.Date.isFake===!0)throw TypeError(`Can't install fake timers twice on the same global object.`);config=config===void 0?{}:config,config.shouldAdvanceTime=config.shouldAdvanceTime||!1,config.advanceTimeDelta=config.advanceTimeDelta||20,config.shouldClearNativeTimers=config.shouldClearNativeTimers||!1;let hasToFake=Object.prototype.hasOwnProperty.call(config,`toFake`),hasToNotFake=Object.prototype.hasOwnProperty.call(config,`toNotFake`);if(hasToFake&&hasToNotFake)throw TypeError(`config.toFake and config.toNotFake cannot be used together`);if(config.target)throw TypeError("config.target is no longer supported. Use `withGlobal(target)` instead.");function handleMissingTimer(timer){if(!config.ignoreMissingTimers)throw ReferenceError(`non-existent timers and/or objects cannot be faked: '${timer}'`)}let i,l,clock=createClock(config.now,config.loopLimit);if(clock.shouldClearNativeTimers=config.shouldClearNativeTimers,clock.abortListenerMap=new Map,hasToFake)clock.methods=config.toFake||[],clock.methods.length===0&&(clock.methods=Object.keys(timers));else if(hasToNotFake){let methodsToNotFake=config.toNotFake||[];clock.methods=Object.keys(timers).filter(method=>!methodsToNotFake.includes(method))}else clock.methods=Object.keys(timers);if(config.shouldAdvanceTime===!0&&clock.setTickMode({mode:`interval`,delta:config.advanceTimeDelta}),clock.methods.includes(`performance`)){let proto=(()=>{if(hasPerformanceConstructorPrototype)return _global.performance.constructor.prototype;if(hasPerformancePrototype)return _global.Performance.prototype})();proto?(Object.getOwnPropertyNames(proto).forEach(function(name){name!==`now`&&(clock.performance[name]=name.indexOf(`getEntries`)===0?NOOP_ARRAY:NOOP)}),clock.performance.mark=name=>new FakePerformanceEntry(name,`mark`,0,0),clock.performance.measure=name=>new FakePerformanceEntry(name,`measure`,0,100),clock.performance.timeOrigin=getEpoch(config.now)):(config.toFake||[]).includes(`performance`)&&handleMissingTimer(`performance`)}for(_global===globalObject&&timersModule&&(clock.timersModuleMethods=[]),_global===globalObject&&timersPromisesModule&&(clock.timersPromisesModuleMethods=[]),i=0,l=clock.methods.length;i<l;i++){let nameOfMethodToReplace=clock.methods[i];if(!isPresent[nameOfMethodToReplace]){handleMissingTimer(nameOfMethodToReplace);continue}if(nameOfMethodToReplace===`hrtime`?_global.process&&typeof _global.process.hrtime==`function`&&hijackMethod(_global.process,nameOfMethodToReplace,clock):nameOfMethodToReplace===`nextTick`?_global.process&&typeof _global.process.nextTick==`function`&&hijackMethod(_global.process,nameOfMethodToReplace,clock):hijackMethod(_global,nameOfMethodToReplace,clock),clock.timersModuleMethods!==void 0&&timersModule[nameOfMethodToReplace]){let original=timersModule[nameOfMethodToReplace];clock.timersModuleMethods.push({methodName:nameOfMethodToReplace,original}),timersModule[nameOfMethodToReplace]=_global[nameOfMethodToReplace]}clock.timersPromisesModuleMethods!==void 0&&(nameOfMethodToReplace===`setTimeout`?(clock.timersPromisesModuleMethods.push({methodName:`setTimeout`,original:timersPromisesModule.setTimeout}),timersPromisesModule.setTimeout=(delay,value,options={})=>new Promise((resolve,reject)=>{let abort=()=>{options.signal.removeEventListener(`abort`,abort),clock.abortListenerMap.delete(abort),clock.clearTimeout(handle),reject(options.signal.reason)},handle=clock.setTimeout(()=>{options.signal&&(options.signal.removeEventListener(`abort`,abort),clock.abortListenerMap.delete(abort)),resolve(value)},delay);options.signal&&(options.signal.aborted?abort():(options.signal.addEventListener(`abort`,abort),clock.abortListenerMap.set(abort,options.signal)))})):nameOfMethodToReplace===`setImmediate`?(clock.timersPromisesModuleMethods.push({methodName:`setImmediate`,original:timersPromisesModule.setImmediate}),timersPromisesModule.setImmediate=(value,options={})=>new Promise((resolve,reject)=>{let abort=()=>{options.signal.removeEventListener(`abort`,abort),clock.abortListenerMap.delete(abort),clock.clearImmediate(handle),reject(options.signal.reason)},handle=clock.setImmediate(()=>{options.signal&&(options.signal.removeEventListener(`abort`,abort),clock.abortListenerMap.delete(abort)),resolve(value)});options.signal&&(options.signal.aborted?abort():(options.signal.addEventListener(`abort`,abort),clock.abortListenerMap.set(abort,options.signal)))})):nameOfMethodToReplace===`setInterval`&&(clock.timersPromisesModuleMethods.push({methodName:`setInterval`,original:timersPromisesModule.setInterval}),timersPromisesModule.setInterval=(delay,value,options={})=>({[Symbol.asyncIterator]:()=>{let createResolvable=()=>{let resolve,reject,promise=new Promise((res,rej)=>{resolve=res,reject=rej});return promise.resolve=resolve,promise.reject=reject,promise},done=!1,hasThrown=!1,returnCall,nextAvailable=0,nextQueue=[],handle=clock.setInterval(()=>{nextQueue.length>0?nextQueue.shift().resolve():nextAvailable++},delay),abort=()=>{options.signal.removeEventListener(`abort`,abort),clock.abortListenerMap.delete(abort),clock.clearInterval(handle),done=!0;for(let resolvable of nextQueue)resolvable.resolve()};return options.signal&&(options.signal.aborted?done=!0:(options.signal.addEventListener(`abort`,abort),clock.abortListenerMap.set(abort,options.signal))),{next:async()=>{if(options.signal?.aborted&&!hasThrown)throw hasThrown=!0,options.signal.reason;if(done)return{done:!0,value:void 0};if(nextAvailable>0)return nextAvailable--,{done:!1,value};let resolvable=createResolvable();if(nextQueue.push(resolvable),await resolvable,returnCall&&nextQueue.length===0&&returnCall.resolve(),options.signal?.aborted&&!hasThrown)throw hasThrown=!0,options.signal.reason;return done?{done:!0,value:void 0}:{done:!1,value}},return:async()=>done?{done:!0,value:void 0}:(nextQueue.length>0&&(returnCall=createResolvable(),await returnCall),clock.clearInterval(handle),done=!0,options.signal&&(options.signal.removeEventListener(`abort`,abort),clock.abortListenerMap.delete(abort)),{done:!0,value:void 0})}}})))}return clock}return{timers,createClock,install,withGlobal}}let defaultImplementation=withGlobal(globalObject);return fakeTimersSrc.timers=defaultImplementation.timers,fakeTimersSrc.createClock=defaultImplementation.createClock,fakeTimersSrc.install=defaultImplementation.install,fakeTimersSrc.withGlobal=withGlobal,fakeTimersSrc}var fakeTimersSrcExports=requireFakeTimersSrc();const RealDate=globalThis.Date;var FakeTimers=class{_global;_clock;_fakingTime;_fakingDate;_fakeTimers;_userConfig;_now=RealDate.now;constructor({global,config}){this._userConfig=config,this._fakingDate=null,this._fakingTime=!1,this._fakeTimers=fakeTimersSrcExports.withGlobal(global),this._global=global}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(steps=1){if(this._checkFakeTimers())for(let i=steps;i>0&&(this._clock.next(),this._clock.tick(0),this._clock.countTimers()!==0);i--);}async advanceTimersToNextTimerAsync(steps=1){if(this._checkFakeTimers())for(let i=steps;i>0&&(await this._clock.nextAsync(),this._clock.tick(0),this._clock.countTimers()!==0);i--);}advanceTimersByTime(msToRun){this._checkFakeTimers()&&this._clock.tick(msToRun)}async advanceTimersByTimeAsync(msToRun){this._checkFakeTimers()&&await this._clock.tickAsync(msToRun)}advanceTimersToNextFrame(){this._checkFakeTimers()&&this._clock.runToFrame()}runAllTicks(){this._checkFakeTimers()&&this._clock.runMicrotasks()}useRealTimers(){this._fakingDate&&=(this._clock.uninstall(),null),this._fakingTime&&=(this._clock.uninstall(),!1)}useFakeTimers(){let fakeDate=this._fakingDate||Date.now();this._fakingDate&&=(this._clock.uninstall(),null),this._fakingTime&&this._clock.uninstall();let toFake=this._userConfig?.toFake;if(isChildProcess()&&toFake?.includes(`nextTick`))throw Error(`process.nextTick cannot be mocked inside child_process`);let toNotFake=this._userConfig?.toNotFake;if(toFake===void 0&&toNotFake===void 0)toFake=Object.keys(this._fakeTimers.timers).filter(timer=>timer!==`nextTick`&&timer!==`queueMicrotask`);else if(toFake===void 0&&toNotFake!==void 0)for(let timer of[`nextTick`,`queueMicrotask`])toNotFake.includes(timer)||(toNotFake=[...toNotFake,timer]);isChildProcess()&&toNotFake&&!toNotFake.includes(`nextTick`)&&(toNotFake=[...toNotFake,`nextTick`]),this._clock=this._fakeTimers.install({now:fakeDate,...this._userConfig,...toFake&&{toFake},...toNotFake&&{toNotFake},ignoreMissingTimers:!0}),this._fakingTime=!0}reset(){if(this._checkFakeTimers()){let{now}=this._clock;this._clock.reset(),this._clock.setSystemTime(now)}}setSystemTime(now){let date=now===void 0||now instanceof Date?now:new Date(now);if(this._fakingTime)this._clock.setSystemTime(date);else{let newFakingDate=date??new Date(this.getRealSystemTime());this._fakingDate?(this._fakingDate=newFakingDate,this._clock.setSystemTime(newFakingDate)):(this._fakingDate=newFakingDate,this._clock=this._fakeTimers.install({now:newFakingDate,toFake:[`Date`,`Temporal`],ignoreMissingTimers:!0}))}}getMockedSystemTime(){return this._fakingTime?new Date(this._clock.now):this._fakingDate}getRealSystemTime(){return this._now()}getTimerCount(){return this._checkFakeTimers()?this._clock.countTimers():0}setTimerTickMode(mode,interval){if(this._checkFakeTimers()){if(mode===`manual`)this._clock.setTickMode({mode:`manual`});else if(mode===`nextTimerAsync`)this._clock.setTickMode({mode:`nextAsync`});else if(mode===`interval`)this._clock.setTickMode({mode:`interval`,delta:interval});else throw Error(`Invalid tick mode: ${mode}`)}}configure(config){this._userConfig=config}isFakeTimers(){return this._fakingTime}_checkFakeTimers(){if(!this._fakingTime)throw Error("A function to advance timers was called but the timers APIs are not mocked. Call `vi.useFakeTimers()` in the test file first.");return this._fakingTime}};const whenSymbol=Symbol.for(`$$vitest:when`);function isWhenChain(input){try{return Reflect.has(input,whenSymbol)}catch{return!1}}function when(spy,options){if(!isMockFunction(spy))throw TypeError("vi.when: the argument must be a mock function created with `vi.fn()` or `vi.spyOn()`");let behaviors=[],originalImplementation=spy.getMockImplementation();function findAction(args){let testers=[...getCustomEqualityTesters(),iterableEquality];for(let behavior of behaviors)if(equals(args,behavior.arguments,testers))return behavior.actions.findLast(action=>!(action.remaining===0&&action.called))??null;return null}spy.mockImplementation((...args)=>{let action=findAction(args);if(action===null)return(typeof options?.onUnmatched==`function`?options.onUnmatched:options?.onUnmatched===`throw`?()=>{throw Error(`vi.when: no behavior defined when called with [${args.map(arg=>stringify(arg)).join(`, `)}]`)}:originalImplementation)?.(...args);switch(--action.remaining,action.called=!0,action.type){case`return`:return action.value;case`throw`:throw action.value;case`resolve`:return Promise.resolve(action.value);case`reject`:return Promise.reject(action.value)}});function getOrCreateBehavior(args){let testers=[...getCustomEqualityTesters(),iterableEquality],behavior=behaviors.find(behavior=>equals(args,behavior.arguments,testers));return behavior===void 0&&(behavior={arguments:args,actions:[]},behaviors.push(behavior)),behavior}let output=markWhenChain({calledWith:(...args)=>{let behavior=getOrCreateBehavior(args);function appendAction(behavior,type,value,times){behavior.actions.push({type,value,times,remaining:times,called:!1})}let calledWithInstance=markWhenChain({...output,thenThrow:(value,options)=>(validateOptions(options),appendAction(behavior,`throw`,value,options?.times??1/0),calledWithInstance),thenThrowOnce:value=>(appendAction(behavior,`throw`,value,1),calledWithInstance),thenReturn:(value,options)=>(validateOptions(options),appendAction(behavior,`return`,value,options?.times??1/0),calledWithInstance),thenReturnOnce:value=>(appendAction(behavior,`return`,value,1),calledWithInstance),thenResolve:(value,options)=>(validateOptions(options),appendAction(behavior,`resolve`,value,options?.times??1/0),calledWithInstance),thenResolveOnce:value=>(appendAction(behavior,`resolve`,value,1),calledWithInstance),thenReject:(value,options)=>(validateOptions(options),appendAction(behavior,`reject`,value,options?.times??1/0),calledWithInstance),thenRejectOnce:value=>(appendAction(behavior,`reject`,value,1),calledWithInstance)});return calledWithInstance},_getDiagnostics:()=>{let pendingBehaviors=behaviors.filter(behavior=>behavior.actions.length===0||behavior.actions.some(action=>!hasBeenConsumed(action)));return{isExhausted:behaviors.length!==0&&pendingBehaviors.length===0,pendingBehaviors:pendingBehaviors.map(behavior=>`calledWith(${behavior.arguments.map(argument=>stringify(argument)).join(`, `)})${behavior.actions.length===0?` → no actions`:`\n${formatActions(behavior.actions)}`}`).join(`
129
+
130
+ `)}}});return Symbol.dispose&&(output[Symbol.dispose]=()=>{spy.mockImplementation(originalImplementation??noop)}),output}const whenChainMarkerOptions={};function markWhenChain(input){return Reflect.defineProperty(input,whenSymbol,whenChainMarkerOptions),input}function formatActions(actions){let lines=actions.map((action,index)=>{let method=getMethodName(action.type),left=` ${getSymbol(action)} ${method}(${stringify(action.value)}${action.times===1/0?``:`, { times: ${action.times} }`})`,unreachable=!hasBeenConsumed(action)&&actions.slice(index+1).some(later=>later.times===1/0);return{left,remaining:getRemainingLabel(action)+(unreachable?` → unreachable action`:``)}}),maxLeft=Math.max(...lines.map(line=>line.left.length));return lines.map(({left,remaining})=>`${left.padEnd(maxLeft+2)}${remaining}`).join(`
131
+ `)}function getMethodName(type){switch(type){case`return`:return`thenReturn`;case`resolve`:return`thenResolve`;case`throw`:return`thenThrow`;case`reject`:return`thenReject`;default:throw Error(`vi.when: "${type}" is not a known method`)}}function hasBeenConsumed(action){return action.remaining===0||action.remaining===1/0&&action.called}function getRemainingLabel(action){return hasBeenConsumed(action)?action.remaining===1/0?`exhausted`:`exhausted (${action.times} of ${action.times})`:action.remaining===1/0?`never called`:`${action.remaining} remaining (out of ${action.times})`}function getSymbol(action){return hasBeenConsumed(action)?`✓`:`✗`}function validateOptions(options){if(typeof options?.times==`number`&&options.times<=0)throw RangeError("vi.when: `times` option must be greater than 0")}function copyStackTrace$2(target,source){return source.stack!==void 0&&(target.stack=source.stack.replace(source.message,target.message)),target}function waitFor(callback,options={}){let{setTimeout,setInterval,clearTimeout,clearInterval}=getSafeTimers(),{interval=50,timeout=1e3}=typeof options==`number`?{timeout:options}:options,STACK_TRACE_ERROR=Error(`STACK_TRACE_ERROR`);return new Promise((resolve,reject)=>{let lastError,promiseStatus=`idle`,timeoutId,intervalId,onResolve=result=>{timeoutId&&clearTimeout(timeoutId),intervalId&&clearInterval(intervalId),resolve(result)},handleTimeout=()=>{intervalId&&clearInterval(intervalId);let error=lastError;error||=copyStackTrace$2(Error(`Timed out in waitFor!`),STACK_TRACE_ERROR),reject(error)},checkCallback=()=>{if(vi.isFakeTimers()&&vi.advanceTimersByTime(interval),promiseStatus!==`pending`)try{let result=callback();if(typeof result==`object`&&result&&typeof result.then==`function`){let thenable=result;promiseStatus=`pending`,thenable.then(resolvedValue=>{promiseStatus=`resolved`,onResolve(resolvedValue)},rejectedValue=>{promiseStatus=`rejected`,lastError=rejectedValue})}else return onResolve(result),!0}catch(error){lastError=error}};checkCallback()!==!0&&(timeoutId=setTimeout(handleTimeout,timeout),intervalId=setInterval(checkCallback,interval))})}function waitUntil(callback,options={}){let{setTimeout,setInterval,clearTimeout,clearInterval}=getSafeTimers(),{interval=50,timeout=1e3}=typeof options==`number`?{timeout:options}:options,STACK_TRACE_ERROR=Error(`STACK_TRACE_ERROR`);return new Promise((resolve,reject)=>{let promiseStatus=`idle`,timeoutId,intervalId,onReject=error=>{intervalId&&clearInterval(intervalId),error||=copyStackTrace$2(Error(`Timed out in waitUntil!`),STACK_TRACE_ERROR),reject(error)},onResolve=result=>{if(result)return timeoutId&&clearTimeout(timeoutId),intervalId&&clearInterval(intervalId),resolve(result),!0},checkCallback=()=>{if(vi.isFakeTimers()&&vi.advanceTimersByTime(interval),promiseStatus!==`pending`)try{let result=callback();if(typeof result==`object`&&result&&typeof result.then==`function`){let thenable=result;promiseStatus=`pending`,thenable.then(resolvedValue=>{promiseStatus=`resolved`,onResolve(resolvedValue)},rejectedValue=>{promiseStatus=`rejected`,onReject(rejectedValue)})}else return onResolve(result)}catch(error){onReject(error)}};checkCallback()!==!0&&(timeoutId=setTimeout(onReject,timeout),intervalId=setInterval(checkCallback,interval))})}function createVitest(){let _config=null,state=()=>getWorkerState(),_timers,timers=()=>_timers||=new FakeTimers({global:globalThis,config:state().config.fakeTimers}),_stubsGlobal=new Map,_stubsEnv=new Map,_envBooleans=[`PROD`,`DEV`,`SSR`],utils={useFakeTimers(config){if(isChildProcess()&&(config?.toFake?.includes(`nextTick`)||state().config?.fakeTimers?.toFake?.includes(`nextTick`)))throw Error(`vi.useFakeTimers({ toFake: ["nextTick"] }) is not supported in node:child_process. Use --pool=threads if mocking nextTick is required.`);return config?timers().configure({...state().config.fakeTimers,...config}):timers().configure(state().config.fakeTimers),timers().useFakeTimers(),utils},isFakeTimers(){return timers().isFakeTimers()},useRealTimers(){return timers().useRealTimers(),utils},runOnlyPendingTimers(){return timers().runOnlyPendingTimers(),utils},async runOnlyPendingTimersAsync(){return await timers().runOnlyPendingTimersAsync(),utils},runAllTimers(){return timers().runAllTimers(),utils},async runAllTimersAsync(){return await timers().runAllTimersAsync(),utils},runAllTicks(){return timers().runAllTicks(),utils},advanceTimersByTime(ms){return timers().advanceTimersByTime(ms),utils},async advanceTimersByTimeAsync(ms){return await timers().advanceTimersByTimeAsync(ms),utils},advanceTimersToNextTimer(){return timers().advanceTimersToNextTimer(),utils},async advanceTimersToNextTimerAsync(){return await timers().advanceTimersToNextTimerAsync(),utils},advanceTimersToNextFrame(){return timers().advanceTimersToNextFrame(),utils},getTimerCount(){return timers().getTimerCount()},setSystemTime(time){return timers().setSystemTime(time),utils},getMockedSystemTime(){return timers().getMockedSystemTime()},getRealSystemTime(){return timers().getRealSystemTime()},clearAllTimers(){return timers().clearAllTimers(),utils},setTimerTickMode(mode,interval){return timers().setTimerTickMode(mode,interval),utils},spyOn,fn,when,isWhenChain,waitFor,waitUntil,defineHelper:fn=>function(...args){let result=fn.apply(this,args);if(result&&typeof result==`object`&&typeof result.then==`function`){let stackTraceError=Error(`STACK_TRACE_ERROR`);return(async function(){try{return await result}catch(error){throw error instanceof Error&&!error.stack?.includes(`__VITEST_HELPER__`)&&copyStackTrace$1(error,stackTraceError),error}})()}return result},hoisted(factory){return assertTypes(factory,`"vi.hoisted" factory`,[`function`]),factory()},mock(path,factory){if(typeof path!=`string`)throw TypeError(`vi.mock() expects a string path, but received a ${typeof path}`);let importer=getImporter(`mock`);_mocker().queueMock(path,importer,typeof factory==`function`?()=>factory(()=>_mocker().importActual(path,importer,_mocker().getMockContext().callstack)):factory)},unmock(path){if(typeof path!=`string`)throw TypeError(`vi.unmock() expects a string path, but received a ${typeof path}`);_mocker().queueUnmock(path,getImporter(`unmock`))},doMock(path,factory){if(typeof path!=`string`)throw TypeError(`vi.doMock() expects a string path, but received a ${typeof path}`);let importer=getImporter(`doMock`);_mocker().queueMock(path,importer,typeof factory==`function`?()=>factory(()=>_mocker().importActual(path,importer,_mocker().getMockContext().callstack)):factory);let rv={};return Symbol.dispose&&(rv[Symbol.dispose]=()=>{_mocker().queueUnmock(path,importer)}),rv},doUnmock(path){if(typeof path!=`string`)throw TypeError(`vi.doUnmock() expects a string path, but received a ${typeof path}`);let importer=getImporter(`doUnmock`);_mocker().queueUnmock(path,importer)},async importActual(path){let importer=getImporter(`importActual`);return _mocker().importActual(path,importer,_mocker().getMockContext().callstack)},async importMock(path){let importer=getImporter(`importMock`);return _mocker().importMock(path,importer)},mockObject(value,options){return _mocker().mockObject({value},void 0,options?.spy?`autospy`:`automock`).value},mocked(item,_options={}){return item},isMockFunction(fn){return isMockFunction(fn)},clearAllMocks(){return clearAllMocks(),utils},resetAllMocks(){return resetAllMocks(),utils},restoreAllMocks(){return restoreAllMocks(),utils},stubGlobal(name,value){return _stubsGlobal.has(name)||_stubsGlobal.set(name,Object.getOwnPropertyDescriptor(globalThis,name)),Object.defineProperty(globalThis,name,{value,writable:!0,configurable:!0,enumerable:!0}),utils},stubEnv(name,value){let env=state().metaEnv;return _stubsEnv.has(name)||_stubsEnv.set(name,env[name]),value===void 0?delete env[name]:env[name]=_envBooleans.includes(name)?value?`1`:``:String(value),utils},unstubAllGlobals(){return _stubsGlobal.forEach((original,name)=>{original?Object.defineProperty(globalThis,name,original):Reflect.deleteProperty(globalThis,name)}),_stubsGlobal.clear(),utils},unstubAllEnvs(){let env=state().metaEnv;return _stubsEnv.forEach((original,name)=>{original===void 0?delete env[name]:env[name]=original}),_stubsEnv.clear(),utils},resetModules(){return resetModules(state().evaluatedModules),utils},async dynamicImportSettled(){return waitForImportsToResolve()},setConfig(config){_config||={...state().config},Object.assign(state().config,config)},resetConfig(){_config&&Object.assign(state().config,_config)}};return utils}const vi=createVitest();function _mocker(){return typeof __vitest_mocker__<`u`?__vitest_mocker__:new Proxy({},{get(_,name){throw Error(`Vitest mocker was not initialized in this environment. vi.${String(name)}() is forbidden.`)}})}function getImporter(name){let stackArray=createSimpleStackTrace({stackTraceLimit:5}).split(`
132
+ `);return parseSingleStack(stackArray[stackArray.findLastIndex(stack=>stack.includes(` at Object.${name}`)||stack.includes(`${name}@`)||stack.includes(` at ${name} (`))+1])?.file||``}function copyStackTrace$1(target,source){return source.stack!==void 0&&(target.stack=source.stack.replace(source.message,target.message)),target}function waitNextTick(){let{setTimeout}=getSafeTimers();return new Promise(resolve=>setTimeout(resolve,0))}async function waitForImportsToResolve(){await waitNextTick();let state=getWorkerState(),promises=[],resolvingCount=state.resolvingModules.size;for(let[_,mod]of state.evaluatedModules.idToModuleMap)mod.promise&&!mod.evaluated&&promises.push(mod.promise);(promises.length||resolvingCount)&&(await Promise.allSettled(promises),await waitForImportsToResolve())}const unsupported=[`matchSnapshot`,`toMatchSnapshot`,`toMatchInlineSnapshot`,`toThrowErrorMatchingSnapshot`,`toThrowErrorMatchingInlineSnapshot`,`throws`,`Throw`,`throw`,`toThrow`,`toThrowError`];function throwWithCause(error,source){throw error.cause??=Error(`Matcher did not succeed in time.`),copyStackTrace(error,source)}function createExpectPoll(expect){return function(fn,options={}){let defaults=getWorkerState().config.expect?.poll??{},{interval=defaults.interval??50,timeout=defaults.timeout??1e3,message}=options,assertion=expect(null,message).withContext({poll:!0});fn=fn.bind(assertion),utils_exports.flag(assertion,`_poll.fn`,fn),utils_exports.flag(assertion,`_poll.timeout`,timeout),utils_exports.flag(assertion,`_poll.interval`,interval);let test=utils_exports.flag(assertion,`vitest-test`);if(!test)throw Error(`expect.poll() must be called inside a test`);let proxy=new Proxy(assertion,{get(target,key,receiver){let assertionFunction=Reflect.get(target,key,receiver);if(typeof assertionFunction!=`function`)return assertionFunction instanceof Assertion?proxy:assertionFunction;if(key===`assert`)return assertionFunction;if(typeof key==`string`&&unsupported.includes(key))throw SyntaxError(`expect.poll() is not supported in combination with .${key}(). Use vi.waitFor() if your assertion condition is unstable.`);return function(...args){let STACK_TRACE_ERROR=Error(`STACK_TRACE_ERROR`),promise=async()=>{utils_exports.flag(assertion,`_name`,key),utils_exports.flag(assertion,`error`,STACK_TRACE_ERROR);let onStart=utils_exports.flag(assertion,`_poll.onStart`),onSettled=utils_exports.flag(assertion,`_poll.onSettled`);if(await onStart?.({assertion}),Object.getOwnPropertyDescriptor(assertionFunction,`__vitest_poll_takeover__`)?.value)try{let output=await assertionFunction.call(assertion,...args);return await onSettled?.({assertion,status:`pass`}),output}catch(err){await onSettled?.({assertion,status:`fail`}),throwWithCause(err,STACK_TRACE_ERROR)}let{setTimeout,clearTimeout}=getSafeTimers(),timerId,timeoutController=new AbortController,timeoutPromise=new Promise(resolve=>{timerId=setTimeout(()=>{timeoutController.abort(),resolve()},timeout)}),lastError;try{for(;;)try{let fnResult=await raceWith(Promise.resolve().then(()=>fn({signal:timeoutController.signal})),timeoutPromise);if(!fnResult.ok){lastError??=Error(`expect.poll() function didn't resolve in time.`);break}let obj=fnResult.value;utils_exports.flag(assertion,`object`,obj);let assertionResult=await raceWith(Promise.resolve().then(()=>assertionFunction.apply(assertion,args)),timeoutPromise);if(!assertionResult.ok){lastError??=Error(`expect.poll() assertion didn't resolve in time.`);break}let output=assertionResult.value;return await onSettled?.({assertion,status:`pass`}),output}catch(err){if(lastError=err,key===`toMatchScreenshot`||!(await raceWith(delay(interval,setTimeout),timeoutPromise)).ok)break;vi.isFakeTimers()&&vi.advanceTimersByTime(interval)}}finally{clearTimeout(timerId)}lastError&&(await onSettled?.({assertion,status:`fail`}),throwWithCause(lastError,STACK_TRACE_ERROR))},awaited=!1;test.onFinished??=[],test.onFinished.push(()=>{if(!awaited){let negated=utils_exports.flag(assertion,`negate`)?`not.`:``,assertionString=`expect.${utils_exports.flag(assertion,`_poll.element`)?`element(locator)`:`poll(assertion)`}.${negated}${String(key)}()`;throw copyStackTrace(Error(`${assertionString} was not awaited. This assertion is asynchronous and must be awaited; otherwise, it is not executed to avoid unhandled rejections:\n\nawait ${assertionString}\n`),STACK_TRACE_ERROR)}});let resultPromise,wrap=utils_exports.flag(assertion,`_poll.wrap`),start=()=>resultPromise||=wrap?wrap(promise(),STACK_TRACE_ERROR):promise();return{then(onFulfilled,onRejected){return awaited=!0,start().then(onFulfilled,onRejected)},catch(onRejected){return awaited=!0,start().catch(onRejected)},finally(onFinally){return awaited=!0,start().finally(onFinally)},[Symbol.toStringTag]:`Promise`}}}});return proxy}}function copyStackTrace(target,source){return source.stack!==void 0&&(target.stack=source.stack.replace(source.message,target.message)),target}function raceWith(promise,other){let left=promise.then(value=>({ok:!0,value}));return other?Promise.race([left,other.then(value=>({ok:!1,value}))]):left}const MockPlugin=(chai,utils)=>{utils.addMethod(chai.Assertion.prototype,`toHaveBeenExhausted`,wrapAssertion(utils,`toHaveBeenExhausted`,function(){let chain=utils.flag(this,`object`);if(!isWhenChain(chain))throw TypeError(`${utils.inspect(chain)} is not a \`vi.when\` instance`);let diagnostics=chain._getDiagnostics();this.assert(diagnostics.isExhausted,`expected all behaviors to have been exhausted, but some remain:\n\n ${diagnostics.pendingBehaviors.replaceAll(/\n(?!\n)/g,`
133
+ `)}`,`expected at least one behavior to remain un-exhausted, but all were`)}))};let _client;function getSnapshotClient(){return _client||=new SnapshotClient({isEqual:(received,expected)=>equals(received,expected,[iterableEquality,subsetEquality])}),_client}function getError(expected,promise){if(typeof expected!=`function`){if(!promise)throw Error(`expected must be a function, received ${typeof expected}`);return expected}try{expected()}catch(e){return e}throw Error(`snapshot function didn't throw`)}function getTestNames(test){return{filepath:test.file.filepath,name:getNames(test).slice(1).join(` > `),testId:test.id}}function getAssertionName(assertion){let name=utils_exports.flag(assertion,`_name`);if(!name)throw Error(`Assertion name is not set. This is a bug in Vitest. Please, open a new issue with reproduction.`);return name}function getTest(obj){let test=utils_exports.flag(obj,`vitest-test`);if(!test)throw Error(`'${getAssertionName(obj)}' cannot be used without test context`);if(test.fails)throw new TestSyntaxError(`'${getAssertionName(obj)}' cannot be used with 'test.fails'`);return test}function validateAssertion(assertion){if(utils_exports.flag(assertion,`negate`))throw Error(`${getAssertionName(assertion)} cannot be used with "not"`)}const SnapshotPlugin=(chai,utils)=>{for(let key of[`matchSnapshot`,`toMatchSnapshot`])utils.addMethod(chai.Assertion.prototype,key,wrapAssertion(utils,key,function(propertiesOrHint,hint){return assertMatchResult(toMatchSnapshotImpl({assertion:this,received:utils.flag(this,`object`),...normalizeArguments(propertiesOrHint,hint)}),chai.util.flag(this,`message`))}));utils.addMethod(chai.Assertion.prototype,`toMatchFileSnapshot`,function(filepath,hint){utils.flag(this,`_name`,`toMatchFileSnapshot`),validateAssertion(this);let assertPromise=toMatchFileSnapshotImpl({assertion:this,received:utils.flag(this,`object`),filepath,hint}).then(result=>assertMatchResult(result,chai.util.flag(this,`message`)));return recordAsyncExpect(getTest(this),assertPromise,createAssertionMessage(utils,this,!0),Error(`resolves`),utils.flag(this,`soft`))}),utils.addMethod(chai.Assertion.prototype,`toMatchInlineSnapshot`,wrapAssertion(utils,`toMatchInlineSnapshot`,function(propertiesOrInlineSnapshot,inlineSnapshotOrHint,hint){return assertMatchResult(toMatchSnapshotImpl({assertion:this,received:utils.flag(this,`object`),isInline:!0,...normalizeInlineArguments(propertiesOrInlineSnapshot,inlineSnapshotOrHint,hint)}),chai.util.flag(this,`message`))})),utils.addMethod(chai.Assertion.prototype,`toThrowErrorMatchingSnapshot`,wrapAssertion(utils,`toThrowErrorMatchingSnapshot`,function(propertiesOrHint,hint){validateAssertion(this);let received=utils.flag(this,`object`),promise=utils.flag(this,`promise`);return assertMatchResult(toMatchSnapshotImpl({assertion:this,received:getError(received,promise),...normalizeArguments(propertiesOrHint,hint)}),chai.util.flag(this,`message`))})),utils.addMethod(chai.Assertion.prototype,`toThrowErrorMatchingInlineSnapshot`,wrapAssertion(utils,`toThrowErrorMatchingInlineSnapshot`,function(inlineSnapshotOrHint,hint){validateAssertion(this);let received=utils.flag(this,`object`),promise=utils.flag(this,`promise`);return assertMatchResult(toMatchSnapshotImpl({assertion:this,received:getError(received,promise),isInline:!0,...normalizeInlineArguments(void 0,inlineSnapshotOrHint,hint)}),chai.util.flag(this,`message`))})),utils.addMethod(chai.expect,`addSnapshotSerializer`,addSerializer)};function normalizeArguments(propertiesOrHint,hint){return typeof propertiesOrHint==`string`?{hint:propertiesOrHint}:{properties:propertiesOrHint,hint}}function normalizeInlineArguments(propertiesOrInlineSnapshot,inlineSnapshotOrHint,hint){let inlineSnapshot;return typeof propertiesOrInlineSnapshot==`string`?(inlineSnapshot=stripSnapshotIndentation(propertiesOrInlineSnapshot),{inlineSnapshot,hint:inlineSnapshotOrHint}):(inlineSnapshotOrHint&&(inlineSnapshot=stripSnapshotIndentation(inlineSnapshotOrHint)),{properties:propertiesOrInlineSnapshot,inlineSnapshot,hint})}function toMatchSnapshotImpl(options){let{assertion}=options;validateAssertion(assertion);let assertionName=getAssertionName(assertion),test=getTest(assertion);return getSnapshotClient().match({received:options.received,properties:options.properties,message:options.hint,isInline:options.isInline,inlineSnapshot:options.inlineSnapshot,assertionName,error:utils_exports.flag(assertion,`error`),...getTestNames(test)})}async function toMatchFileSnapshotImpl(options){let{assertion}=options;validateAssertion(assertion);let testNames=getTestNames(getTest(assertion)),snapshotState=getSnapshotClient().getSnapshotState(testNames.filepath),rawSnapshotFile=await snapshotState.environment.resolveRawPath(testNames.filepath,options.filepath),rawSnapshotContent=await snapshotState.environment.readSnapshotFile(rawSnapshotFile);return getSnapshotClient().match({received:options.received,message:options.hint,rawSnapshot:{file:rawSnapshotFile,content:rawSnapshotContent??void 0},...testNames})}function assertMatchResult(result,customMessage){if(!result.pass){let errorMessage=(customMessage?`${customMessage}: `:``)+result.message();throw Object.assign(Error(errorMessage),{actual:result.actual,expected:result.expected,diffOptions:{expand:getWorkerState().config.snapshotOptions.expand}})}}use(JestExtend),use(JestChaiExpect),use(ChaiStyleAssertions),use(SnapshotPlugin),use(JestAsymmetricMatchers),use(MockPlugin);function createExpect(test){let expect$1=((value,message)=>{let{assertionCalls}=getState(expect$1);setState({assertionCalls:assertionCalls+1},expect$1);let assert=expect(value,message),_test=test||void 0;return _test?assert.withTest(_test):assert});Object.assign(expect$1,expect),Object.assign(expect$1,globalThis[ASYMMETRIC_MATCHERS_OBJECT]),expect$1.getState=()=>getState(expect$1),expect$1.setState=state=>setState(state,expect$1);let globalState=getState(globalThis[GLOBAL_EXPECT])||{};setState({...globalState,assertionCalls:0,isExpectingAssertions:!1,isExpectingAssertionsError:null,expectedAssertionsNumber:null,expectedAssertionsNumberErrorGen:null,get testPath(){return getWorkerState().filepath},currentTestName:test?test.fullTestName??``:globalState.currentTestName},expect$1),expect$1.assert=assert,expect$1.extend=matchers=>expect.extend(expect$1,matchers),expect$1.addEqualityTesters=customTesters=>addCustomEqualityTesters(customTesters),expect$1.soft=(...args)=>expect$1(...args).withContext({soft:!0}),expect$1.poll=createExpectPoll(expect$1),expect$1.unreachable=message=>{assert.fail(`expected${message?` "${message}" `:` `}not to be reached`)};function assertions(expected){let errorGen=()=>Error(`expected number of assertions to be ${expected}, but got ${expect$1.getState().assertionCalls}`);Error.captureStackTrace&&Error.captureStackTrace(errorGen(),assertions),expect$1.setState({expectedAssertionsNumber:expected,expectedAssertionsNumberErrorGen:errorGen})}function hasAssertions(){let error=Error(`expected any number of assertion, but got none`);Error.captureStackTrace&&Error.captureStackTrace(error,hasAssertions),expect$1.setState({isExpectingAssertions:!0,isExpectingAssertionsError:error})}return utils_exports.addMethod(expect$1,`assertions`,assertions),utils_exports.addMethod(expect$1,`hasAssertions`,hasAssertions),expect$1.extend(customMatchers),expect$1.extend(benchMatchers),expect$1}const globalExpect=createExpect();Object.defineProperty(globalThis,GLOBAL_EXPECT,{value:globalExpect,writable:!0,configurable:!0}),globalThis.performance?globalThis.performance.now.bind(globalThis.performance):Date.now;function registration(){vi.useFakeTimers({toFake:[`Date`,`setTimeout`,`clearTimeout`]});let fetcher=vi.fn().mockResolvedValue(Response.json({ok:!0})),tracker=new SessionTracker({device:new DeviceManager(async()=>await Promise.resolve(null)),geo:new GeoDetector(async()=>await Promise.resolve(new Response(`loc=`))),fetcher,target:{baseUrl:`https://registration.invalid`,publicKeyHeader:{apiKey:`test`}}});return onTestFinished(()=>{tracker.dispose(),tracker.discardDeviceIdentity();for(let key of[`interfere:session_id`,`interfere:last_activity`,`interfere:session_started`])localStorage.removeItem(key);vi.useRealTimers()}),{fetcher,tracker}}export{registration};