twd-js 1.8.1 → 1.8.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +13 -13
- package/dist/bundled.es.js +1352 -1352
- package/dist/constants/version.d.ts +1 -1
- package/dist/index.cjs.js +5 -6
- package/dist/index.es.js +5 -6
- package/dist/mock-sw.js +1 -1
- package/dist/ui/ClosedSidebar.d.ts +1 -1
- package/dist/ui/Icons/BaseIcon.d.ts +1 -1
- package/dist/ui/Icons/ChevronDown.d.ts +1 -1
- package/dist/ui/Icons/ChevronRight.d.ts +1 -1
- package/dist/ui/Icons/Loader.d.ts +1 -1
- package/dist/ui/Icons/MockRequestIcon.d.ts +1 -1
- package/dist/ui/Icons/Play.d.ts +1 -1
- package/dist/ui/LogItem.d.ts +1 -1
- package/dist/ui/MockRulesButton.d.ts +1 -1
- package/dist/ui/MockedComponent.d.ts +1 -1
- package/dist/ui/SearchInput.d.ts +1 -1
- package/dist/ui/SkipOnlyName.d.ts +1 -1
- package/dist/ui/TWDSidebar.d.ts +1 -1
- package/dist/ui/TestList.d.ts +1 -1
- package/dist/ui/TestListItem.d.ts +1 -1
- package/dist/ui/utils/styles.d.ts +1 -1
- package/dist/ui.d.ts +1 -1
- package/package.json +18 -6
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const TWD_VERSION = "1.8.
|
|
1
|
+
export declare const TWD_VERSION = "1.8.2";
|
package/dist/index.cjs.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var Rl=Object.create,lr=Object.defineProperty,Tl=Object.getOwnPropertyDescriptor,Sl=Object.getOwnPropertyNames,xl=Object.getPrototypeOf,Ol=Object.prototype.hasOwnProperty,P=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),Ml=(e,t)=>{let r={};for(var n in e)lr(r,n,{get:e[n],enumerable:!0});return t||lr(r,Symbol.toStringTag,{value:"Module"}),r},Al=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(var a=Sl(t),o=0,i=a.length,s;o<i;o++)s=a[o],!Ol.call(e,s)&&s!==r&&lr(e,s,{get:(u=>t[u]).bind(null,s),enumerable:!(n=Tl(t,s))||n.enumerable});return e},To=(e,t,r)=>(r=e!=null?Rl(xl(e)):{},Al(t||!e||!e.__esModule?lr(r,"default",{value:e,enumerable:!0}):r,e));const Mt=require("./runner-ClPPXm0J.cjs"),tn=require("./componentMocks-BklBTS5K.cjs");let oe=require("react"),j=require("react/jsx-runtime");var Il=(e,t,r=2e3,n=50)=>new Promise((a,o)=>{const i=Date.now(),s=()=>{const u=t();if(u)return a(u);if(Date.now()-i>r)return o(new Error(`Timeout waiting for element ${e}`));setTimeout(s,n)};s()}),Nl=(e,t,r=2e3,n=50)=>new Promise((a,o)=>{const i=Date.now(),s=()=>{const u=t();if(u&&u.length>0)return a(Array.from(u));if(Date.now()-i>r)return o(new Error(`Timeout waiting for elements ${e}`));setTimeout(s,n)};s()}),ur=e=>new Promise(t=>setTimeout(t,e)),te=e=>{const t=Mt.handlers.size?Array.from(Mt.handlers.values()).find(r=>r.status==="running"):null;t&&t.logs?.push(e)},kl=(e,t)=>{const r=t?.timeout??2e3,n=t?.interval??50,a=t?.message;return new Promise((o,i)=>{const s=Date.now();let u=!1;const l=async()=>{try{const c=await e();if(u)return;u=!0,te(a?`waitFor: resolved (${a})`:"waitFor: resolved"),o(c)}catch(c){if(u)return;const d=c instanceof Error?c:new Error(String(c));if(Date.now()-s>=r){u=!0;const p=`waitFor timed out after ${r}ms`,f=a?` waiting for: ${a}`:"",g=`
|
|
2
|
-
Last error: ${d.message}`;i(new Error(`${p}${f}.${g}`));return}setTimeout(l,n)}};l()})},rn=(e,t,r,n)=>{if(!e&&!t)throw new Error(n);if(e&&t)throw new Error(n.replace("to be","to not be").replace("to have","to not have").replace("to contain","to not contain"));return r};function Na(e){if(!e.isConnected)return!1;let t=e;for(;t;){const r=getComputedStyle(t);if(r.display==="none"||r.visibility==="hidden"||r.visibility==="collapse")return!1;t=t.parentElement}return!0}var jl={"have.text":{positive:{pass:e=>`Assertion passed: Text is exactly "${e[0]}"`,fail:(e,t)=>`Assertion failed: Expected text to be "${e[0]}", but got "${t}"`},negative:{pass:e=>`Assertion passed: Text is not exactly "${e[0]}"`,fail:(e,t)=>`Assertion failed: Expected text to not be "${e[0]}", but got "${t}"`}},"contain.text":{positive:{pass:e=>`Assertion passed: Text contains "${e[0]}"`,fail:(e,t)=>`Assertion failed: Expected text to contain "${e[0]}", but got "${t}"`},negative:{pass:e=>`Assertion passed: Text does not contain "${e[0]}"`,fail:(e,t)=>`Assertion failed: Expected text to not contain "${e[0]}", but got "${t}"`}},"be.empty":{positive:{pass:()=>"Assertion passed: Text is empty",fail:(e,t)=>`Assertion failed: Expected text to be empty, but got "${t}"`},negative:{pass:()=>"Assertion passed: Text is not empty",fail:(e,t)=>`Assertion failed: Expected text to not be empty, but got "${t}"`}},"have.attr":{positive:{pass:e=>`Assertion passed: Attribute "${e[0]}" is "${e[1]}"`,fail:(e,t)=>`Assertion failed: Expected attribute "${e[0]}" to be "${e[1]}", but got "${t}"`},negative:{pass:e=>`Assertion passed: Attribute "${e[0]}" is not "${e[1]}"`,fail:(e,t)=>`Assertion failed: Expected attribute "${e[0]}" to not be "${e[1]}", but got "${t}"`}},"have.value":{positive:{pass:e=>`Assertion passed: Value is "${e[0]}"`,fail:(e,t)=>`Assertion failed: Expected value to be "${e[0]}", but got "${t}"`},negative:{pass:e=>`Assertion passed: Value is not "${e[0]}"`,fail:(e,t)=>`Assertion failed: Expected value to not be "${e[0]}", but got "${t}"`}},"be.disabled":{positive:{pass:()=>"Assertion passed: Element is disabled",fail:()=>"Assertion failed: Expected element to be disabled"},negative:{pass:()=>"Assertion passed: Element is not disabled",fail:()=>"Assertion failed: Expected element to not be disabled"}},"be.enabled":{positive:{pass:()=>"Assertion passed: Element is enabled",fail:()=>"Assertion failed: Expected element to be enabled"},negative:{pass:()=>"Assertion passed: Element is not enabled",fail:()=>"Assertion failed: Expected element to not be enabled"}},"be.checked":{positive:{pass:()=>"Assertion passed: Element is checked",fail:()=>"Assertion failed: Expected element to be checked"},negative:{pass:()=>"Assertion passed: Element is not checked",fail:()=>"Assertion failed: Expected element to not be checked"}},"be.selected":{positive:{pass:()=>"Assertion passed: Element is selected",fail:()=>"Assertion failed: Expected element to be selected"},negative:{pass:()=>"Assertion passed: Element is not selected",fail:()=>"Assertion failed: Expected element to not be selected"}},"be.focused":{positive:{pass:()=>"Assertion passed: Element is focused",fail:()=>"Assertion failed: Expected element to be focused"},negative:{pass:()=>"Assertion passed: Element is not focused",fail:()=>"Assertion failed: Expected element to not be focused"}},"be.visible":{positive:{pass:()=>"Assertion passed: Element is visible",fail:()=>"Assertion failed: Expected element to be visible"},negative:{pass:()=>"Assertion passed: Element is not visible",fail:()=>"Assertion failed: Expected element to not be visible"}},"be.hidden":{positive:{pass:()=>"Assertion passed: Element is hidden",fail:()=>"Assertion failed: Expected element to be hidden"},negative:{pass:()=>"Assertion passed: Element is not hidden",fail:()=>"Assertion failed: Expected element to not be hidden"}},"have.class":{positive:{pass:e=>`Assertion passed: Element has class "${e[0]}"`,fail:e=>`Assertion failed: Expected element to have class "${e[0]}"`},negative:{pass:e=>`Assertion passed: Element does not have class "${e[0]}"`,fail:e=>`Assertion failed: Expected element to not have class "${e[0]}"`}}},Vr=(e,t,...r)=>{const n=t.startsWith("not."),a=n?t.slice(4):t,o=(e.textContent||"").trim(),i=jl[a];if(!i)throw new Error(`Unknown assertion: ${a}`);const s=n?"negative":"positive";let u,l;switch(a){case"have.text":u=o===r[0],l=o;break;case"contain.text":u=o.includes(r[0]),l=o;break;case"be.empty":u=o.length===0,l=o;break;case"have.attr":l=e.getAttribute(r[0]),u=l===r[1];break;case"have.value":l=e.value,u=l===r[0];break;case"be.disabled":u=e.disabled===!0;break;case"be.enabled":u=e.disabled===!1;break;case"be.checked":u=e.checked===!0;break;case"be.selected":u=e.selected===!0;break;case"be.focused":u=document.activeElement===e;break;case"be.visible":u=Na(e);break;case"be.hidden":u=!Na(e);break;case"have.class":u=e.classList.contains(r[0]);break;default:throw new Error(`Unknown assertion: ${String(a)}`)}return rn(u,n,i[s].pass(r),i[s].fail(r,l))},Tr="1.8.
|
|
2
|
+
Last error: ${d.message}`;i(new Error(`${p}${f}.${g}`));return}setTimeout(l,n)}};l()})},rn=(e,t,r,n)=>{if(!e&&!t)throw new Error(n);if(e&&t)throw new Error(n.replace("to be","to not be").replace("to have","to not have").replace("to contain","to not contain"));return r};function Na(e){if(!e.isConnected)return!1;let t=e;for(;t;){const r=getComputedStyle(t);if(r.display==="none"||r.visibility==="hidden"||r.visibility==="collapse")return!1;t=t.parentElement}return!0}var jl={"have.text":{positive:{pass:e=>`Assertion passed: Text is exactly "${e[0]}"`,fail:(e,t)=>`Assertion failed: Expected text to be "${e[0]}", but got "${t}"`},negative:{pass:e=>`Assertion passed: Text is not exactly "${e[0]}"`,fail:(e,t)=>`Assertion failed: Expected text to not be "${e[0]}", but got "${t}"`}},"contain.text":{positive:{pass:e=>`Assertion passed: Text contains "${e[0]}"`,fail:(e,t)=>`Assertion failed: Expected text to contain "${e[0]}", but got "${t}"`},negative:{pass:e=>`Assertion passed: Text does not contain "${e[0]}"`,fail:(e,t)=>`Assertion failed: Expected text to not contain "${e[0]}", but got "${t}"`}},"be.empty":{positive:{pass:()=>"Assertion passed: Text is empty",fail:(e,t)=>`Assertion failed: Expected text to be empty, but got "${t}"`},negative:{pass:()=>"Assertion passed: Text is not empty",fail:(e,t)=>`Assertion failed: Expected text to not be empty, but got "${t}"`}},"have.attr":{positive:{pass:e=>`Assertion passed: Attribute "${e[0]}" is "${e[1]}"`,fail:(e,t)=>`Assertion failed: Expected attribute "${e[0]}" to be "${e[1]}", but got "${t}"`},negative:{pass:e=>`Assertion passed: Attribute "${e[0]}" is not "${e[1]}"`,fail:(e,t)=>`Assertion failed: Expected attribute "${e[0]}" to not be "${e[1]}", but got "${t}"`}},"have.value":{positive:{pass:e=>`Assertion passed: Value is "${e[0]}"`,fail:(e,t)=>`Assertion failed: Expected value to be "${e[0]}", but got "${t}"`},negative:{pass:e=>`Assertion passed: Value is not "${e[0]}"`,fail:(e,t)=>`Assertion failed: Expected value to not be "${e[0]}", but got "${t}"`}},"be.disabled":{positive:{pass:()=>"Assertion passed: Element is disabled",fail:()=>"Assertion failed: Expected element to be disabled"},negative:{pass:()=>"Assertion passed: Element is not disabled",fail:()=>"Assertion failed: Expected element to not be disabled"}},"be.enabled":{positive:{pass:()=>"Assertion passed: Element is enabled",fail:()=>"Assertion failed: Expected element to be enabled"},negative:{pass:()=>"Assertion passed: Element is not enabled",fail:()=>"Assertion failed: Expected element to not be enabled"}},"be.checked":{positive:{pass:()=>"Assertion passed: Element is checked",fail:()=>"Assertion failed: Expected element to be checked"},negative:{pass:()=>"Assertion passed: Element is not checked",fail:()=>"Assertion failed: Expected element to not be checked"}},"be.selected":{positive:{pass:()=>"Assertion passed: Element is selected",fail:()=>"Assertion failed: Expected element to be selected"},negative:{pass:()=>"Assertion passed: Element is not selected",fail:()=>"Assertion failed: Expected element to not be selected"}},"be.focused":{positive:{pass:()=>"Assertion passed: Element is focused",fail:()=>"Assertion failed: Expected element to be focused"},negative:{pass:()=>"Assertion passed: Element is not focused",fail:()=>"Assertion failed: Expected element to not be focused"}},"be.visible":{positive:{pass:()=>"Assertion passed: Element is visible",fail:()=>"Assertion failed: Expected element to be visible"},negative:{pass:()=>"Assertion passed: Element is not visible",fail:()=>"Assertion failed: Expected element to not be visible"}},"be.hidden":{positive:{pass:()=>"Assertion passed: Element is hidden",fail:()=>"Assertion failed: Expected element to be hidden"},negative:{pass:()=>"Assertion passed: Element is not hidden",fail:()=>"Assertion failed: Expected element to not be hidden"}},"have.class":{positive:{pass:e=>`Assertion passed: Element has class "${e[0]}"`,fail:e=>`Assertion failed: Expected element to have class "${e[0]}"`},negative:{pass:e=>`Assertion passed: Element does not have class "${e[0]}"`,fail:e=>`Assertion failed: Expected element to not have class "${e[0]}"`}}},Vr=(e,t,...r)=>{const n=t.startsWith("not."),a=n?t.slice(4):t,o=(e.textContent||"").trim(),i=jl[a];if(!i)throw new Error(`Unknown assertion: ${a}`);const s=n?"negative":"positive";let u,l;switch(a){case"have.text":u=o===r[0],l=o;break;case"contain.text":u=o.includes(r[0]),l=o;break;case"be.empty":u=o.length===0,l=o;break;case"have.attr":l=e.getAttribute(r[0]),u=l===r[1];break;case"have.value":l=e.value,u=l===r[0];break;case"be.disabled":u=e.disabled===!0;break;case"be.enabled":u=e.disabled===!1;break;case"be.checked":u=e.checked===!0;break;case"be.selected":u=e.selected===!0;break;case"be.focused":u=document.activeElement===e;break;case"be.visible":u=Na(e);break;case"be.hidden":u=!Na(e);break;case"have.class":u=e.classList.contains(r[0]);break;default:throw new Error(`Unknown assertion: ${String(a)}`)}return rn(u,n,i[s].pass(r),i[s].fail(r,l))},Tr="1.8.2",Dl=()=>typeof window<"u"?(window.__TWD_MOCK_STATE__||(window.__TWD_MOCK_STATE__={rules:[],counts:{}}),window.__TWD_MOCK_STATE__):{rules:[],counts:{}},tt=Dl(),Ce=tt.rules,Ll=100,ka=!1,Bl=async e=>{if(ka){console.warn("[TWD] Request mocking already initialized");return}if("serviceWorker"in navigator){ka=!0;const t=e??"/mock-sw.js";await navigator.serviceWorker.register(`${t}?v=${Tr}`),navigator.serviceWorker.controller||await new Promise(r=>{navigator.serviceWorker.addEventListener("controllerchange",r,{once:!0})}),navigator.serviceWorker.addEventListener("message",r=>{if(r.data?.type==="EXECUTED"){const{alias:n,request:a,hitCount:o}=r.data,i=Ce.find(s=>s.alias===n);i&&(i.executed=!0,i.request=a,i.hitCount=o),tt.counts[n]=o??(tt.counts[n]??0)+1}})}},$l=async(e,t)=>{const r={alias:e,...t,executed:!1},n=Ce.findIndex(a=>a.alias===e);if(n!==-1?Ce[n]=r:Ce.push(r),typeof window.__twdCollectMock=="function"){const a=window.__TWD_STATE__?.handlers,o=a&&[...a.values()].find(i=>i.status==="running");o&&window.__twdCollectMock({alias:e,url:String(t.url),method:t.method,status:t.status||200,response:t.response,responseHeaders:t.responseHeaders,urlRegex:t.urlRegex||!1,testId:o.id})}navigator.serviceWorker.controller?.postMessage({type:"ADD_RULE",rule:r,version:Tr}),await ur(Ll),await Promise.resolve()},Fl=async e=>await Promise.all(e.map(t=>So(t))),So=async(e,t=10,r=100)=>{const n=Ce.find(u=>u.alias===e);if(!n)throw new Error(`Rule ${e} not found`);for(let u=0;u<t;u++){const l=Ce.find(c=>c.alias===e&&c.executed);if(l)return Promise.resolve(l);u<t-1&&await new Promise(c=>setTimeout(c,r))}const a=t*r,o=Ce.filter(u=>u.executed).map(u=>`${u.alias} (${u.method} ${u.url})`).join(", "),i=Ce.filter(u=>!u.executed).map(u=>`${u.alias} (${u.method} ${u.url})`).join(", "),s=[`Rule "${e}" was not executed within ${a}ms.`,` Expected: ${n.method} ${n.url}`,` Executed rules: ${o||"none"}`,` Not executed rules: ${i||"none"}`].join(`
|
|
3
3
|
`);throw console.log(s),new Error(s)},xo=()=>Ce,Oo=()=>{navigator.serviceWorker.controller?.postMessage({type:"CLEAR_RULES",version:Tr}),Ce.length=0;for(const e in tt.counts)delete tt.counts[e]},Ul=e=>tt.counts[e]??0,zl=()=>({...tt.counts}),Vl=(e,t)=>{const r=e.startsWith("not.");switch(r?e.slice(4):e){case"eq":return rn(window.location.href===t,r,`Assertion passed: URL is ${t}`,`Assertion failed: Expected URL to be ${t}, but got ${window.location.href}`);case"contain.url":return rn(window.location.href.includes(t),r,`Assertion passed: URL contains ${t}`,`Assertion failed: Expected URL to contain ${t}, but got ${window.location.href}`);default:throw new Error(`Unknown assertion: ${e}`)}},Hl=()=>({location:window.location,should:async(e,t,r=5)=>{let n="",a;for(let o=0;o<r;o++)try{n=Vl(e,t),te(n);break}catch(i){await new Promise(s=>setTimeout(s,100)),a=i}if(a)throw a;return n}}),Wl=100,Kl=async(e,t)=>{if(te(`visit("${e}")`),window.location.pathname===e||t){const r=`/__dummy_${Math.random().toString(36).slice(2)}`;window.history.pushState({},"",r),window.dispatchEvent(new PopStateEvent("popstate")),await ur(10)}window.history.pushState({},"",e),window.dispatchEvent(new PopStateEvent("popstate")),await ur(Wl)},nn="twd-viewport-styles",an="twd-viewport-iframe",fe=null,ut=null,Gl=()=>{if(fe)return;const{style:e}=document.body;fe={maxWidth:e.maxWidth,maxHeight:e.maxHeight,minHeight:e.minHeight,overflow:e.overflow,margin:e.margin,boxSizing:e.boxSizing,boxShadow:e.boxShadow}},Yl=(e,t)=>{let r=document.getElementById(nn);r||(r=document.createElement("style"),r.id=nn,document.head.appendChild(r));const n=t?`${e} × ${t}`:`${e}`;r.textContent=`
|
|
4
4
|
#twd-viewport-badge {
|
|
5
5
|
position: fixed;
|
|
@@ -17,7 +17,7 @@ Last error: ${d.message}`;i(new Error(`${p}${f}.${g}`));return}setTimeout(l,n)}}
|
|
|
17
17
|
white-space: nowrap;
|
|
18
18
|
}
|
|
19
19
|
`;let a=document.getElementById("twd-viewport-badge");a||(a=document.createElement("div"),a.id="twd-viewport-badge",document.body.appendChild(a)),a.textContent=n},Xl=()=>{document.getElementById(nn)?.remove(),document.getElementById("twd-viewport-badge")?.remove()},Jl=(e,t)=>{let r=document.getElementById(an);return r||(r=document.createElement("iframe"),r.id=an,r.style.cssText="position:fixed;top:-9999px;left:-9999px;visibility:hidden;pointer-events:none;border:none;",document.body.appendChild(r)),r.style.width=`${e}px`,r.style.height=`${t}px`,r},Ql=()=>{document.getElementById(an)?.remove()},Zl=(e,t,r)=>{e.originalInnerWidthDesc=Object.getOwnPropertyDescriptor(window,"innerWidth"),e.originalInnerHeightDesc=Object.getOwnPropertyDescriptor(window,"innerHeight"),e.originalMatchMedia=window.matchMedia??null,Object.defineProperty(window,"innerWidth",{get:()=>t,configurable:!0}),r!==void 0&&Object.defineProperty(window,"innerHeight",{get:()=>r,configurable:!0});const n=e.iframe;if(n?.contentWindow?.matchMedia){const a=n.contentWindow.matchMedia.bind(n.contentWindow);window.matchMedia=o=>a(o)}},eu=e=>{e.originalInnerWidthDesc?Object.defineProperty(window,"innerWidth",e.originalInnerWidthDesc):delete window.innerWidth,e.originalInnerHeightDesc?Object.defineProperty(window,"innerHeight",e.originalInnerHeightDesc):delete window.innerHeight,e.originalMatchMedia&&(window.matchMedia=e.originalMatchMedia)},tu=(e,t,r)=>{const n=document.styleSheets;for(let a=0;a<n.length;a++){const o=n[a];let i;try{i=o.cssRules}catch{continue}for(let s=i.length-1;s>=0;s--){const u=i[s];u instanceof CSSMediaRule&&ru(e,o,s,u,t,r)}}},ru=(e,t,r,n,a,o)=>{const i=n.conditionText??n.media.mediaText;if(!i)return;const s=o(i).matches,u=a(i).matches;if(s===u)return;const l=n.cssText;if(u&&!s){const c=[];for(let p=0;p<n.cssRules.length;p++)c.push(n.cssRules[p].cssText);t.deleteRule(r);let d=0;for(let p=0;p<c.length;p++)try{t.insertRule(c[p],r+p),d++}catch{}e.patches.push({sheet:t,originalIndex:r,originalCssText:l,injectedRulesCount:d})}else!u&&s&&(t.deleteRule(r),e.patches.push({sheet:t,originalIndex:r,originalCssText:l,injectedRulesCount:0}))},nu=e=>{for(let t=e.patches.length-1;t>=0;t--){const{sheet:r,originalIndex:n,originalCssText:a,injectedRulesCount:o}=e.patches[t];try{for(let i=0;i<o;i++)r.deleteRule(n);r.insertRule(a,n)}catch{}}},au=(e,t)=>{ut&&Mo();const r=Jl(e,t??window.innerHeight),n={patches:[],originalInnerWidthDesc:void 0,originalInnerHeightDesc:void 0,originalMatchMedia:null,iframe:r};ut=n;const a=window.matchMedia?window.matchMedia.bind(window):null;Zl(n,e,t),a&&r.contentWindow?.matchMedia&&tu(n,r.contentWindow.matchMedia.bind(r.contentWindow),a),window.dispatchEvent(new Event("resize"))},Mo=()=>{ut&&(nu(ut),eu(ut),Ql(),ut=null,window.dispatchEvent(new Event("resize")))},ou=(e,t)=>{if(e===void 0){Ao();return}Gl();const{style:r}=document.body;r.maxWidth=`${e}px`,r.margin="0 auto",r.overflow="auto",r.boxSizing="border-box",r.boxShadow="0 0 0 1px rgba(37, 99, 235, 0.4)",t!==void 0?(r.minHeight=`${t}px`,r.maxHeight=`${t}px`):(r.minHeight=fe.minHeight,r.maxHeight=fe.maxHeight),au(e,t),Yl(e,t),te(`viewport(${e}${t!==void 0?`, ${t}`:""})`)},Ao=()=>{if(!fe)return;Mo();const{style:e}=document.body;e.maxWidth=fe.maxWidth,e.maxHeight=fe.maxHeight,e.minHeight=fe.minHeight,e.overflow=fe.overflow,e.margin=fe.margin,e.boxSizing=fe.boxSizing,e.boxShadow=fe.boxShadow,fe=null,Xl(),te("resetViewport()")},iu={get:async e=>{const t=`body > div:not(#twd-sidebar-root) ${e}`;te(`Searching get("${e}")`);const r=await Il(e,()=>document.querySelector(t)),n={el:r,should:(a,...o)=>(te(Vr(r,a,...o)),n)};return n},setInputValue:(e,t)=>{Object.getOwnPropertyDescriptor(e.__proto__,"value").set.call(e,t),e.dispatchEvent(new Event("input",{bubbles:!0}))},getAll:async e=>{const t=`body > div:not(#twd-sidebar-root) ${e}`;return te(`Searching getAll("${e}")`),(await Nl(e,()=>document.querySelectorAll(t))).map(r=>{const n={el:r,should:(a,...o)=>(te(Vr(r,a,...o)),n)};return n})},visit:Kl,url:Hl,mockRequest:$l,waitForRequest:So,waitForRequests:Fl,initRequestMocking:Bl,clearRequestMockRules:Oo,getRequestMockRules:xo,getRequestCount:Ul,getRequestCounts:zl,should:(e,t,...r)=>{te(Vr(e,t,...r))},wait:ur,waitFor:kl,mockComponent:tn.mockComponent,clearComponentMocks:tn.clearComponentMocks,viewport:ou,resetViewport:Ao,notExists:e=>{const t=`body > div:not(#twd-sidebar-root) ${e}`;return te(`Checking notExists("${e}")`),document.querySelector(t)?Promise.reject(new Error(`Element "${e}" exists in the DOM.`)):(te(`Assertion passed: Element "${e}" does not exist in the DOM.`),Promise.resolve())}},In=Object.defineProperty,su=(e,t,r)=>t in e?In(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,q=(e,t)=>In(e,"name",{value:t,configurable:!0}),Nn=(e,t)=>{for(var r in t)In(e,r,{get:t[r],enumerable:!0})},Io=(e,t,r)=>su(e,typeof t!="symbol"?t+"":t,r),cr={};Nn(cr,{addChainableMethod:()=>Kn,addLengthGuard:()=>Vt,addMethod:()=>Vn,addProperty:()=>zn,checkError:()=>de,compareByInspect:()=>pr,eql:()=>li,events:()=>Mr,expectTypes:()=>Uo,flag:()=>U,getActual:()=>xr,getMessage:()=>Dn,getName:()=>Ar,getOperator:()=>Jn,getOwnEnumerableProperties:()=>Xn,getOwnEnumerablePropertySymbols:()=>Yn,getPathInfo:()=>Fn,hasProperty:()=>Or,inspect:()=>K,isNaN:()=>mr,isNumeric:()=>ae,isProxyEnabled:()=>zt,isRegExp:()=>br,objDisplay:()=>Qe,overwriteChainableMethod:()=>Gn,overwriteMethod:()=>Wn,overwriteProperty:()=>Hn,proxify:()=>Et,test:()=>kn,transferFlags:()=>ye,type:()=>J});var de={};Nn(de,{compatibleConstructor:()=>jo,compatibleInstance:()=>ko,compatibleMessage:()=>Do,getConstructorName:()=>Lo,getMessage:()=>Bo});function Sr(e){return e instanceof Error||Object.prototype.toString.call(e)==="[object Error]"}q(Sr,"isErrorInstance");function No(e){return Object.prototype.toString.call(e)==="[object RegExp]"}q(No,"isRegExp");function ko(e,t){return Sr(t)&&e===t}q(ko,"compatibleInstance");function jo(e,t){return Sr(t)?e.constructor===t.constructor||e instanceof t.constructor:(typeof t=="object"||typeof t=="function")&&t.prototype?e.constructor===t||e instanceof t:!1}q(jo,"compatibleConstructor");function Do(e,t){const r=typeof e=="string"?e:e.message;return No(t)?t.test(r):typeof t=="string"?r.indexOf(t)!==-1:!1}q(Do,"compatibleMessage");function Lo(e){let t=e;return Sr(e)?t=e.constructor.name:typeof e=="function"&&(t=e.name,t===""&&(t=new e().name||t)),t}q(Lo,"getConstructorName");function Bo(e){let t="";return e&&e.message?t=e.message:typeof e=="string"&&(t=e),t}q(Bo,"getMessage");function U(e,t,r){let n=e.__flags||(e.__flags=Object.create(null));if(arguments.length===3)n[t]=r;else return n[t]}q(U,"flag");function kn(e,t){let r=U(e,"negate"),n=t[0];return r?!n:n}q(kn,"test");function J(e){if(typeof e>"u")return"undefined";if(e===null)return"null";const t=e[Symbol.toStringTag];return typeof t=="string"?t:Object.prototype.toString.call(e).slice(8,-1)}q(J,"type");var lu="captureStackTrace"in Error,$o=class Fo extends Error{constructor(t="Unspecified AssertionError",r,n){super(t),Io(this,"message"),this.message=t,lu&&Error.captureStackTrace(this,n||Fo);for(const a in r)a in this||(this[a]=r[a])}get name(){return"AssertionError"}get ok(){return!1}toJSON(t){return{...this,name:this.name,message:this.message,ok:!1,stack:t!==!1?this.stack:void 0}}};q($o,"AssertionError");var X=$o;function Uo(e,t){let r=U(e,"message"),n=U(e,"ssfi");r=r?r+": ":"",e=U(e,"object"),t=t.map(function(i){return i.toLowerCase()}),t.sort();let a=t.map(function(i,s){let u=~["a","e","i","o","u"].indexOf(i.charAt(0))?"an":"a";return(t.length>1&&s===t.length-1?"or ":"")+u+" "+i}).join(", "),o=J(e).toLowerCase();if(!t.some(function(i){return o===i}))throw new X(r+"object tested must be "+a+", but "+o+" given",void 0,n)}q(Uo,"expectTypes");function xr(e,t){return t.length>4?t[4]:e._obj}q(xr,"getActual");var ja={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"]},uu={special:"cyan",number:"yellow",bigint:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",symbol:"green",date:"magenta",regexp:"red"},pt="…";function zo(e,t){const r=ja[uu[t]]||ja[t]||"";return r?`\x1B[${r[0]}m${String(e)}\x1B[${r[1]}m`:String(e)}q(zo,"colorise");function Vo({showHidden:e=!1,depth:t=2,colors:r=!1,customInspect:n=!0,showProxy:a=!1,maxArrayLength:o=1/0,breakLength:i=1/0,seen:s=[],truncate:u=1/0,stylize:l=String}={},c){const d={showHidden:!!e,depth:Number(t),colors:!!r,customInspect:!!n,showProxy:!!a,maxArrayLength:Number(o),breakLength:Number(i),truncate:Number(u),seen:s,inspect:c,stylize:l};return d.colors&&(d.stylize=zo),d}q(Vo,"normaliseOptions");function Ho(e){return e>="\uD800"&&e<="\uDBFF"}q(Ho,"isHighSurrogate");function Ae(e,t,r=pt){e=String(e);const n=r.length,a=e.length;if(n>t&&a>n)return r;if(a>t&&a>n){let o=t-n;return o>0&&Ho(e[o-1])&&(o=o-1),`${e.slice(0,o)}${r}`}return e}q(Ae,"truncate");function be(e,t,r,n=", "){r=r||t.inspect;const a=e.length;if(a===0)return"";const o=t.truncate;let i="",s="",u="";for(let l=0;l<a;l+=1){const c=l+1===e.length,d=l+2===e.length;u=`${pt}(${e.length-l})`;const p=e[l];t.truncate=o-i.length-(c?0:n.length);const f=s||r(p,t)+(c?"":n),g=i.length+f.length,h=g+u.length;if(c&&g>o&&i.length+u.length<=o||!c&&!d&&h>o||(s=c?"":r(e[l+1],t)+(d?"":n),!c&&d&&h>o&&g+s.length>o))break;if(i+=f,!c&&!d&&g+s.length>=o){u=`${pt}(${e.length-l-1})`;break}u=""}return`${i}${u}`}q(be,"inspectList");function Wo(e){return e.match(/^[a-zA-Z_][a-zA-Z_0-9]*$/)?e:JSON.stringify(e).replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'")}q(Wo,"quoteComplexKey");function mt([e,t],r){return r.truncate-=2,typeof e=="string"?e=Wo(e):typeof e!="number"&&(e=`[${r.inspect(e,r)}]`),r.truncate-=e.length,t=r.inspect(t,r),`${e}: ${t}`}q(mt,"inspectProperty");function Ko(e,t){const r=Object.keys(e).slice(e.length);if(!e.length&&!r.length)return"[]";t.truncate-=4;const n=be(e,t);t.truncate-=n.length;let a="";return r.length&&(a=be(r.map(o=>[o,e[o]]),t,mt)),`[ ${n}${a?`, ${a}`:""} ]`}q(Ko,"inspectArray");var cu=q(e=>typeof Buffer=="function"&&e instanceof Buffer?"Buffer":e[Symbol.toStringTag]?e[Symbol.toStringTag]:e.constructor.name,"getArrayName");function _e(e,t){const r=cu(e);t.truncate-=r.length+4;const n=Object.keys(e).slice(e.length);if(!e.length&&!n.length)return`${r}[]`;let a="";for(let i=0;i<e.length;i++){const s=`${t.stylize(Ae(e[i],t.truncate),"number")}${i===e.length-1?"":", "}`;if(t.truncate-=s.length,e[i]!==e.length&&t.truncate<=3){a+=`${pt}(${e.length-e[i]+1})`;break}a+=s}let o="";return n.length&&(o=be(n.map(i=>[i,e[i]]),t,mt)),`${r}[ ${a}${o?`, ${o}`:""} ]`}q(_e,"inspectTypedArray");function Go(e,t){const r=e.toJSON();if(r===null)return"Invalid Date";const n=r.split("T"),a=n[0];return t.stylize(`${a}T${Ae(n[1],t.truncate-a.length-1)}`,"date")}q(Go,"inspectDate");function on(e,t){const r=e[Symbol.toStringTag]||"Function",n=e.name;return n?t.stylize(`[${r} ${Ae(n,t.truncate-11)}]`,"special"):t.stylize(`[${r}]`,"special")}q(on,"inspectFunction");function Yo([e,t],r){return r.truncate-=4,e=r.inspect(e,r),r.truncate-=e.length,t=r.inspect(t,r),`${e} => ${t}`}q(Yo,"inspectMapEntry");function Xo(e){const t=[];return e.forEach((r,n)=>{t.push([n,r])}),t}q(Xo,"mapToEntries");function Jo(e,t){return e.size===0?"Map{}":(t.truncate-=7,`Map{ ${be(Xo(e),t,Yo)} }`)}q(Jo,"inspectMap");var du=Number.isNaN||(e=>e!==e);function sn(e,t){return du(e)?t.stylize("NaN","number"):e===1/0?t.stylize("Infinity","number"):e===-1/0?t.stylize("-Infinity","number"):e===0?t.stylize(1/e===1/0?"+0":"-0","number"):t.stylize(Ae(String(e),t.truncate),"number")}q(sn,"inspectNumber");function ln(e,t){let r=Ae(e.toString(),t.truncate-1);return r!==pt&&(r+="n"),t.stylize(r,"bigint")}q(ln,"inspectBigInt");function Qo(e,t){const r=e.toString().split("/")[2],n=t.truncate-(2+r.length),a=e.source;return t.stylize(`/${Ae(a,n)}/${r}`,"regexp")}q(Qo,"inspectRegExp");function Zo(e){const t=[];return e.forEach(r=>{t.push(r)}),t}q(Zo,"arrayFromSet");function ei(e,t){return e.size===0?"Set{}":(t.truncate-=7,`Set{ ${be(Zo(e),t)} }`)}q(ei,"inspectSet");var Da=new RegExp("['\\u0000-\\u001f\\u007f-\\u009f\\u00ad\\u0600-\\u0604\\u070f\\u17b4\\u17b5\\u200c-\\u200f\\u2028-\\u202f\\u2060-\\u206f\\ufeff\\ufff0-\\uffff]","g"),fu={"\b":"\\b"," ":"\\t","\n":"\\n","\f":"\\f","\r":"\\r","'":"\\'","\\":"\\\\"},pu=16,mu=4;function ti(e){return fu[e]||`\\u${`0000${e.charCodeAt(0).toString(pu)}`.slice(-mu)}`}q(ti,"escape");function un(e,t){return Da.test(e)&&(e=e.replace(Da,ti)),t.stylize(`'${Ae(e,t.truncate-2)}'`,"string")}q(un,"inspectString");function cn(e){return"description"in Symbol.prototype?e.description?`Symbol(${e.description})`:"Symbol()":e.toString()}q(cn,"inspectSymbol");var bu=q(()=>"Promise{…}","getPromiseValue");function At(e,t){const r=Object.getOwnPropertyNames(e),n=Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(e):[];if(r.length===0&&n.length===0)return"{}";if(t.truncate-=4,t.seen=t.seen||[],t.seen.includes(e))return"[Circular]";t.seen.push(e);const a=be(r.map(s=>[s,e[s]]),t,mt),o=be(n.map(s=>[s,e[s]]),t,mt);t.seen.pop();let i="";return a&&o&&(i=", "),`{ ${a}${i}${o} }`}q(At,"inspectObject");var Hr=typeof Symbol<"u"&&Symbol.toStringTag?Symbol.toStringTag:!1;function ri(e,t){let r="";return Hr&&Hr in e&&(r=e[Hr]),r=r||e.constructor.name,(!r||r==="_class")&&(r="<Anonymous Class>"),t.truncate-=r.length,`${r}${At(e,t)}`}q(ri,"inspectClass");function ni(e,t){return e.length===0?"Arguments[]":(t.truncate-=13,`Arguments[ ${be(e,t)} ]`)}q(ni,"inspectArguments");var hu=["stack","line","column","name","message","fileName","lineNumber","columnNumber","number","description","cause"];function ai(e,t){const r=Object.getOwnPropertyNames(e).filter(i=>hu.indexOf(i)===-1),n=e.name;t.truncate-=n.length;let a="";if(typeof e.message=="string"?a=Ae(e.message,t.truncate):r.unshift("message"),a=a?`: ${a}`:"",t.truncate-=a.length+5,t.seen=t.seen||[],t.seen.includes(e))return"[Circular]";t.seen.push(e);const o=be(r.map(i=>[i,e[i]]),t,mt);return`${n}${a}${o?` { ${o} }`:""}`}q(ai,"inspectObject");function oi([e,t],r){return r.truncate-=3,t?`${r.stylize(String(e),"yellow")}=${r.stylize(`"${t}"`,"string")}`:`${r.stylize(String(e),"yellow")}`}q(oi,"inspectAttribute");function dr(e,t){return be(e,t,ii,`
|
|
20
|
-
`)}q(dr,"inspectNodeCollection");function ii(e,t){switch(e.nodeType){case 1:return jn(e,t);case 3:return t.inspect(e.data,t);default:return t.inspect(e,t)}}q(ii,"inspectNode");function jn(e,t){const r=e.getAttributeNames(),n=e.tagName.toLowerCase(),a=t.stylize(`<${n}`,"special"),o=t.stylize(">","special"),i=t.stylize(`</${n}>`,"special");t.truncate-=n.length*2+5;let s="";r.length>0&&(s+=" ",s+=be(r.map(c=>[c,e.getAttribute(c)]),t,oi," ")),t.truncate-=s.length;const u=t.truncate;let l=dr(e.children,t);return l&&l.length>u&&(l=`${pt}(${e.children.length})`),`${a}${s}${o}${l}${i}`}q(jn,"inspectHTML");var Wr=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("chai/inspect"):"@@chai/inspect",Kr=Symbol.for("nodejs.util.inspect.custom"),La=new WeakMap,Ba={},$a={undefined:q((e,t)=>t.stylize("undefined","undefined"),"undefined"),null:q((e,t)=>t.stylize("null","null"),"null"),boolean:q((e,t)=>t.stylize(String(e),"boolean"),"boolean"),Boolean:q((e,t)=>t.stylize(String(e),"boolean"),"Boolean"),number:sn,Number:sn,bigint:ln,BigInt:ln,string:un,String:un,function:on,Function:on,symbol:cn,Symbol:cn,Array:Ko,Date:Go,Map:Jo,Set:ei,RegExp:Qo,Promise:bu,WeakSet:q((e,t)=>t.stylize("WeakSet{…}","special"),"WeakSet"),WeakMap:q((e,t)=>t.stylize("WeakMap{…}","special"),"WeakMap"),Arguments:ni,Int8Array:_e,Uint8Array:_e,Uint8ClampedArray:_e,Int16Array:_e,Uint16Array:_e,Int32Array:_e,Uint32Array:_e,Float32Array:_e,Float64Array:_e,Generator:q(()=>"","Generator"),DataView:q(()=>"","DataView"),ArrayBuffer:q(()=>"","ArrayBuffer"),Error:ai,HTMLCollection:dr,NodeList:dr},vu=q((e,t,r,n)=>Wr in e&&typeof e[Wr]=="function"?e[Wr](t):Kr in e&&typeof e[Kr]=="function"?e[Kr](t.depth,t,n):"inspect"in e&&typeof e.inspect=="function"?e.inspect(t.depth,t):"constructor"in e&&La.has(e.constructor)?La.get(e.constructor)(e,t):Ba[r]?Ba[r](e,t):"","inspectCustom"),gu=Object.prototype.toString;function It(e,t={}){const r=Vo(t,It),{customInspect:n}=r;let a=e===null?"null":typeof e;if(a==="object"&&(a=gu.call(e).slice(8,-1)),a in $a)return $a[a](e,r);if(n&&e){const i=vu(e,r,a,It);if(i)return typeof i=="string"?i:It(i,r)}const o=e?Object.getPrototypeOf(e):!1;return o===Object.prototype||o===null?At(e,r):e&&typeof HTMLElement=="function"&&e instanceof HTMLElement?jn(e,r):"constructor"in e?e.constructor!==Object?ri(e,r):At(e,r):e===Object(e)?At(e,r):r.stylize(String(e),a)}q(It,"inspect");var se={includeStack:!1,showDiff:!0,truncateThreshold:40,useProxy:!0,proxyExcludedKeys:["then","catch","inspect","toJSON"],deepEqual:null};function K(e,t,r,n){return It(e,{colors:n,depth:typeof r>"u"?2:r,showHidden:t,truncate:se.truncateThreshold?se.truncateThreshold:1/0})}q(K,"inspect");function Qe(e){let t=K(e),r=Object.prototype.toString.call(e);if(se.truncateThreshold&&t.length>=se.truncateThreshold){if(r==="[object Function]")return!e.name||e.name===""?"[Function]":"[Function: "+e.name+"]";if(r==="[object Array]")return"[ Array("+e.length+") ]";if(r==="[object Object]"){let n=Object.keys(e);return"{ Object ("+(n.length>2?n.splice(0,2).join(", ")+", ...":n.join(", "))+") }"}else return t}else return t}q(Qe,"objDisplay");function Dn(e,t){let r=U(e,"negate"),n=U(e,"object"),a=t[3],o=xr(e,t),i=r?t[2]:t[1],s=U(e,"message");return typeof i=="function"&&(i=i()),i=i||"",i=i.replace(/#\{this\}/g,function(){return Qe(n)}).replace(/#\{act\}/g,function(){return Qe(o)}).replace(/#\{exp\}/g,function(){return Qe(a)}),s?s+": "+i:i}q(Dn,"getMessage");function ye(e,t,r){let n=e.__flags||(e.__flags=Object.create(null));t.__flags||(t.__flags=Object.create(null)),r=arguments.length===3?r:!0;for(let a in n)(r||a!=="object"&&a!=="ssfi"&&a!=="lockSsfi"&&a!="message")&&(t.__flags[a]=n[a])}q(ye,"transferFlags");function dn(e){if(typeof e>"u")return"undefined";if(e===null)return"null";const t=e[Symbol.toStringTag];return typeof t=="string"?t:Object.prototype.toString.call(e).slice(8,-1)}q(dn,"type");function Ln(){this._key="chai/deep-eql__"+Math.random()+Date.now()}q(Ln,"FakeMap");Ln.prototype={get:q(function(t){return t[this._key]},"get"),set:q(function(t,r){Object.isExtensible(t)&&Object.defineProperty(t,this._key,{value:r,configurable:!0})},"set")};var si=typeof WeakMap=="function"?WeakMap:Ln;function fn(e,t,r){if(!r||rt(e)||rt(t))return null;var n=r.get(e);if(n){var a=n.get(t);if(typeof a=="boolean")return a}return null}q(fn,"memoizeCompare");function Tt(e,t,r,n){if(!(!r||rt(e)||rt(t))){var a=r.get(e);a?a.set(t,n):(a=new si,a.set(t,n),r.set(e,a))}}q(Tt,"memoizeSet");var li=Ut;function Ut(e,t,r){if(r&&r.comparator)return pn(e,t,r);var n=Bn(e,t);return n!==null?n:pn(e,t,r)}q(Ut,"deepEqual");function Bn(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t?!0:rt(e)||rt(t)?!1:null}q(Bn,"simpleEqual");function pn(e,t,r){r=r||{},r.memoize=r.memoize===!1?!1:r.memoize||new si;var n=r&&r.comparator,a=fn(e,t,r.memoize);if(a!==null)return a;var o=fn(t,e,r.memoize);if(o!==null)return o;if(n){var i=n(e,t);if(i===!1||i===!0)return Tt(e,t,r.memoize,i),i;var s=Bn(e,t);if(s!==null)return s}var u=dn(e);if(u!==dn(t))return Tt(e,t,r.memoize,!1),!1;Tt(e,t,r.memoize,!0);var l=ui(e,t,u,r);return Tt(e,t,r.memoize,l),l}q(pn,"extensiveDeepEqual");function ui(e,t,r,n){switch(r){case"String":case"Number":case"Boolean":case"Date":return Ut(e.valueOf(),t.valueOf());case"Promise":case"Symbol":case"function":case"WeakMap":case"WeakSet":return e===t;case"Error":return $n(e,t,["name","message","code"],n);case"Arguments":case"Int8Array":case"Uint8Array":case"Uint8ClampedArray":case"Int16Array":case"Uint16Array":case"Int32Array":case"Uint32Array":case"Float32Array":case"Float64Array":case"Array":return Ue(e,t,n);case"RegExp":return ci(e,t);case"Generator":return di(e,t,n);case"DataView":return Ue(new Uint8Array(e.buffer),new Uint8Array(t.buffer),n);case"ArrayBuffer":return Ue(new Uint8Array(e),new Uint8Array(t),n);case"Set":return mn(e,t,n);case"Map":return mn(e,t,n);case"Temporal.PlainDate":case"Temporal.PlainTime":case"Temporal.PlainDateTime":case"Temporal.Instant":case"Temporal.ZonedDateTime":case"Temporal.PlainYearMonth":case"Temporal.PlainMonthDay":return e.equals(t);case"Temporal.Duration":return e.total("nanoseconds")===t.total("nanoseconds");case"Temporal.TimeZone":case"Temporal.Calendar":return e.toString()===t.toString();default:return pi(e,t,n)}}q(ui,"extensiveDeepEqualByType");function ci(e,t){return e.toString()===t.toString()}q(ci,"regexpEqual");function mn(e,t,r){try{if(e.size!==t.size)return!1;if(e.size===0)return!0}catch{return!1}var n=[],a=[];return e.forEach(q(function(i,s){n.push([i,s])},"gatherEntries")),t.forEach(q(function(i,s){a.push([i,s])},"gatherEntries")),Ue(n.sort(),a.sort(),r)}q(mn,"entriesEqual");function Ue(e,t,r){var n=e.length;if(n!==t.length)return!1;if(n===0)return!0;for(var a=-1;++a<n;)if(Ut(e[a],t[a],r)===!1)return!1;return!0}q(Ue,"iterableEqual");function di(e,t,r){return Ue(fr(e),fr(t),r)}q(di,"generatorEqual");function fi(e){return typeof Symbol<"u"&&typeof e=="object"&&typeof Symbol.iterator<"u"&&typeof e[Symbol.iterator]=="function"}q(fi,"hasIteratorFunction");function bn(e){if(fi(e))try{return fr(e[Symbol.iterator]())}catch{return[]}return[]}q(bn,"getIteratorEntries");function fr(e){for(var t=e.next(),r=[t.value];t.done===!1;)t=e.next(),r.push(t.value);return r}q(fr,"getGeneratorEntries");function hn(e){var t=[];for(var r in e)t.push(r);return t}q(hn,"getEnumerableKeys");function vn(e){for(var t=[],r=Object.getOwnPropertySymbols(e),n=0;n<r.length;n+=1){var a=r[n];Object.getOwnPropertyDescriptor(e,a).enumerable&&t.push(a)}return t}q(vn,"getEnumerableSymbols");function $n(e,t,r,n){var a=r.length;if(a===0)return!0;for(var o=0;o<a;o+=1)if(Ut(e[r[o]],t[r[o]],n)===!1)return!1;return!0}q($n,"keysEqual");function pi(e,t,r){var n=hn(e),a=hn(t),o=vn(e),i=vn(t);if(n=n.concat(o),a=a.concat(i),n.length&&n.length===a.length)return Ue(gn(n).sort(),gn(a).sort())===!1?!1:$n(e,t,n,r);var s=bn(e),u=bn(t);return s.length&&s.length===u.length?(s.sort(),u.sort(),Ue(s,u,r)):n.length===0&&s.length===0&&a.length===0&&u.length===0}q(pi,"objectEqual");function rt(e){return e===null||typeof e!="object"}q(rt,"isPrimitive");function gn(e){return e.map(q(function(r){return typeof r=="symbol"?r.toString():r},"mapSymbol"))}q(gn,"mapSymbols");function Or(e,t){return typeof e>"u"||e===null?!1:t in Object(e)}q(Or,"hasProperty");function mi(e){return e.replace(/([^\\])\[/g,"$1.[").match(/(\\\.|[^.]+?)+/g).map(t=>{if(t==="constructor"||t==="__proto__"||t==="prototype")return{};const r=/^\[(\d+)\]$/.exec(t);let n=null;return r?n={i:parseFloat(r[1])}:n={p:t.replace(/\\([.[\]])/g,"$1")},n})}q(mi,"parsePath");function yn(e,t,r){let n=e,a=null;r=typeof r>"u"?t.length:r;for(let o=0;o<r;o++){const i=t[o];n&&(typeof i.p>"u"?n=n[i.i]:n=n[i.p],o===r-1&&(a=n))}return a}q(yn,"internalGetPathValue");function Fn(e,t){const r=mi(t),n=r[r.length-1],a={parent:r.length>1?yn(e,r,r.length-1):e,name:n.p||n.i,value:yn(e,r)};return a.exists=Or(a.parent,a.name),a}q(Fn,"getPathInfo");var bi=class hi{constructor(t,r,n,a){return Io(this,"__flags",{}),U(this,"ssfi",n||hi),U(this,"lockSsfi",a),U(this,"object",t),U(this,"message",r),U(this,"eql",se.deepEqual||li),Et(this)}static get includeStack(){return console.warn("Assertion.includeStack is deprecated, use chai.config.includeStack instead."),se.includeStack}static set includeStack(t){console.warn("Assertion.includeStack is deprecated, use chai.config.includeStack instead."),se.includeStack=t}static get showDiff(){return console.warn("Assertion.showDiff is deprecated, use chai.config.showDiff instead."),se.showDiff}static set showDiff(t){console.warn("Assertion.showDiff is deprecated, use chai.config.showDiff instead."),se.showDiff=t}static addProperty(t,r){zn(this.prototype,t,r)}static addMethod(t,r){Vn(this.prototype,t,r)}static addChainableMethod(t,r,n){Kn(this.prototype,t,r,n)}static overwriteProperty(t,r){Hn(this.prototype,t,r)}static overwriteMethod(t,r){Wn(this.prototype,t,r)}static overwriteChainableMethod(t,r,n){Gn(this.prototype,t,r,n)}assert(t,r,n,a,o,i){const s=kn(this,arguments);if(i!==!1&&(i=!0),a===void 0&&o===void 0&&(i=!1),se.showDiff!==!0&&(i=!1),!s){r=Dn(this,arguments);const u={actual:xr(this,arguments),expected:a,showDiff:i},l=Jn(this,arguments);throw l&&(u.operator=l),new X(r,u,se.includeStack?this.assert:U(this,"ssfi"))}}get _obj(){return U(this,"object")}set _obj(t){U(this,"object",t)}};q(bi,"Assertion");var b=bi,Mr=new EventTarget,vi=class extends Event{constructor(t,r,n){super(t),this.name=String(r),this.fn=n}};q(vi,"PluginEvent");var Un=vi;function zt(){return se.useProxy&&typeof Proxy<"u"&&typeof Reflect<"u"}q(zt,"isProxyEnabled");function zn(e,t,r){r=r===void 0?function(){}:r,Object.defineProperty(e,t,{get:q(function n(){!zt()&&!U(this,"lockSsfi")&&U(this,"ssfi",n);let a=r.call(this);if(a!==void 0)return a;let o=new b;return ye(this,o),o},"propertyGetter"),configurable:!0}),Mr.dispatchEvent(new Un("addProperty",t,r))}q(zn,"addProperty");var yu=Object.getOwnPropertyDescriptor(function(){},"length");function Vt(e,t,r){return yu.configurable&&Object.defineProperty(e,"length",{get:q(function(){throw Error(r?"Invalid Chai property: "+t+'.length. Due to a compatibility issue, "length" cannot directly follow "'+t+'". Use "'+t+'.lengthOf" instead.':"Invalid Chai property: "+t+'.length. See docs for proper usage of "'+t+'".')},"get")}),e}q(Vt,"addLengthGuard");function gi(e){let t=Object.getOwnPropertyNames(e);function r(a){t.indexOf(a)===-1&&t.push(a)}q(r,"addProperty");let n=Object.getPrototypeOf(e);for(;n!==null;)Object.getOwnPropertyNames(n).forEach(r),n=Object.getPrototypeOf(n);return t}q(gi,"getProperties");var Fa=["__flags","__methods","_obj","assert"];function Et(e,t){return zt()?new Proxy(e,{get:q(function r(n,a){if(typeof a=="string"&&se.proxyExcludedKeys.indexOf(a)===-1&&!Reflect.has(n,a)){if(t)throw Error("Invalid Chai property: "+t+"."+a+'. See docs for proper usage of "'+t+'".');let o=null,i=4;throw gi(n).forEach(function(s){if(!Object.prototype.hasOwnProperty(s)&&Fa.indexOf(s)===-1){let u=yi(a,s,i);u<i&&(o=s,i=u)}}),Error(o!==null?"Invalid Chai property: "+a+'. Did you mean "'+o+'"?':"Invalid Chai property: "+a)}return Fa.indexOf(a)===-1&&!U(n,"lockSsfi")&&U(n,"ssfi",r),Reflect.get(n,a)},"proxyGetter")}):e}q(Et,"proxify");function yi(e,t,r){if(Math.abs(e.length-t.length)>=r)return r;let n=[];for(let a=0;a<=e.length;a++)n[a]=Array(t.length+1).fill(0),n[a][0]=a;for(let a=0;a<t.length;a++)n[0][a]=a;for(let a=1;a<=e.length;a++){let o=e.charCodeAt(a-1);for(let i=1;i<=t.length;i++){if(Math.abs(a-i)>=r){n[a][i]=r;continue}n[a][i]=Math.min(n[a-1][i]+1,n[a][i-1]+1,n[a-1][i-1]+(o===t.charCodeAt(i-1)?0:1))}}return n[e.length][t.length]}q(yi,"stringDistanceCapped");function Vn(e,t,r){let n=q(function(){U(this,"lockSsfi")||U(this,"ssfi",n);let a=r.apply(this,arguments);if(a!==void 0)return a;let o=new b;return ye(this,o),o},"methodWrapper");Vt(n,t,!1),e[t]=Et(n,t),Mr.dispatchEvent(new Un("addMethod",t,r))}q(Vn,"addMethod");function Hn(e,t,r){let n=Object.getOwnPropertyDescriptor(e,t),a=q(function(){},"_super");n&&typeof n.get=="function"&&(a=n.get),Object.defineProperty(e,t,{get:q(function o(){!zt()&&!U(this,"lockSsfi")&&U(this,"ssfi",o);let i=U(this,"lockSsfi");U(this,"lockSsfi",!0);let s=r(a).call(this);if(U(this,"lockSsfi",i),s!==void 0)return s;let u=new b;return ye(this,u),u},"overwritingPropertyGetter"),configurable:!0})}q(Hn,"overwriteProperty");function Wn(e,t,r){let n=e[t],a=q(function(){throw new Error(t+" is not a function")},"_super");n&&typeof n=="function"&&(a=n);let o=q(function(){U(this,"lockSsfi")||U(this,"ssfi",o);let i=U(this,"lockSsfi");U(this,"lockSsfi",!0);let s=r(a).apply(this,arguments);if(U(this,"lockSsfi",i),s!==void 0)return s;let u=new b;return ye(this,u),u},"overwritingMethodWrapper");Vt(o,t,!1),e[t]=Et(o,t)}q(Wn,"overwriteMethod");var wu=typeof Object.setPrototypeOf=="function",Ua=q(function(){},"testFn"),Eu=Object.getOwnPropertyNames(Ua).filter(function(e){let t=Object.getOwnPropertyDescriptor(Ua,e);return typeof t!="object"?!0:!t.configurable}),_u=Function.prototype.call,Cu=Function.prototype.apply,wi=class extends Un{constructor(t,r,n,a){super(t,r,n),this.chainingBehavior=a}};q(wi,"PluginAddChainableMethodEvent");var Pu=wi;function Kn(e,t,r,n){typeof n!="function"&&(n=q(function(){},"chainingBehavior"));let a={method:r,chainingBehavior:n};e.__methods||(e.__methods={}),e.__methods[t]=a,Object.defineProperty(e,t,{get:q(function(){a.chainingBehavior.call(this);let i=q(function(){U(this,"lockSsfi")||U(this,"ssfi",i);let s=a.method.apply(this,arguments);if(s!==void 0)return s;let u=new b;return ye(this,u),u},"chainableMethodWrapper");if(Vt(i,t,!0),wu){let s=Object.create(this);s.call=_u,s.apply=Cu,Object.setPrototypeOf(i,s)}else Object.getOwnPropertyNames(e).forEach(function(s){Eu.indexOf(s)===-1&&Object.defineProperty(i,s,Object.getOwnPropertyDescriptor(e,s))});return ye(this,i),Et(i)},"chainableMethodGetter"),configurable:!0}),Mr.dispatchEvent(new Pu("addChainableMethod",t,r,n))}q(Kn,"addChainableMethod");function Gn(e,t,r,n){let a=e.__methods[t],o=a.chainingBehavior;a.chainingBehavior=q(function(){let u=n(o).call(this);if(u!==void 0)return u;let l=new b;return ye(this,l),l},"overwritingChainableMethodGetter");let i=a.method;a.method=q(function(){let u=r(i).apply(this,arguments);if(u!==void 0)return u;let l=new b;return ye(this,l),l},"overwritingChainableMethodWrapper")}q(Gn,"overwriteChainableMethod");function pr(e,t){return K(e)<K(t)?-1:1}q(pr,"compareByInspect");function Yn(e){return typeof Object.getOwnPropertySymbols!="function"?[]:Object.getOwnPropertySymbols(e).filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})}q(Yn,"getOwnEnumerablePropertySymbols");function Xn(e){return Object.keys(e).concat(Yn(e))}q(Xn,"getOwnEnumerableProperties");var mr=Number.isNaN;function Ei(e){let t=J(e);return["Array","Object","Function"].indexOf(t)!==-1}q(Ei,"isObjectType");function Jn(e,t){let r=U(e,"operator"),n=U(e,"negate"),a=t[3],o=n?t[2]:t[1];if(r)return r;if(typeof o=="function"&&(o=o()),o=o||"",!o||/\shave\s/.test(o))return;let i=Ei(a);return/\snot\s/.test(o)?i?"notDeepStrictEqual":"notStrictEqual":i?"deepStrictEqual":"strictEqual"}q(Jn,"getOperator");function Ar(e){return e.name}q(Ar,"getName");function br(e){return Object.prototype.toString.call(e)==="[object RegExp]"}q(br,"isRegExp");function ae(e){return["Number","BigInt"].includes(J(e))}q(ae,"isNumeric");var{flag:C}=cr;["to","be","been","is","and","has","have","with","that","which","at","of","same","but","does","still","also"].forEach(function(e){b.addProperty(e)});b.addProperty("not",function(){C(this,"negate",!0)});b.addProperty("deep",function(){C(this,"deep",!0)});b.addProperty("nested",function(){C(this,"nested",!0)});b.addProperty("own",function(){C(this,"own",!0)});b.addProperty("ordered",function(){C(this,"ordered",!0)});b.addProperty("any",function(){C(this,"any",!0),C(this,"all",!1)});b.addProperty("all",function(){C(this,"all",!0),C(this,"any",!1)});var za={function:["function","asyncfunction","generatorfunction","asyncgeneratorfunction"],asyncfunction:["asyncfunction","asyncgeneratorfunction"],generatorfunction:["generatorfunction","asyncgeneratorfunction"],asyncgeneratorfunction:["asyncgeneratorfunction"]};function Qn(e,t){t&&C(this,"message",t),e=e.toLowerCase();let r=C(this,"object"),n=~["a","e","i","o","u"].indexOf(e.charAt(0))?"an ":"a ";const a=J(r).toLowerCase();za.function.includes(e)?this.assert(za[e].includes(a),"expected #{this} to be "+n+e,"expected #{this} not to be "+n+e):this.assert(e===a,"expected #{this} to be "+n+e,"expected #{this} not to be "+n+e)}q(Qn,"an");b.addChainableMethod("an",Qn);b.addChainableMethod("a",Qn);function _i(e,t){return mr(e)&&mr(t)||e===t}q(_i,"SameValueZero");function Ht(){C(this,"contains",!0)}q(Ht,"includeChainingBehavior");function Wt(e,t){t&&C(this,"message",t);let r=C(this,"object"),n=J(r).toLowerCase(),a=C(this,"message"),o=C(this,"negate"),i=C(this,"ssfi"),s=C(this,"deep"),u=s?"deep ":"",l=s?C(this,"eql"):_i;a=a?a+": ":"";let c=!1;switch(n){case"string":c=r.indexOf(e)!==-1;break;case"weakset":if(s)throw new X(a+"unable to use .deep.include with WeakSet",void 0,i);c=r.has(e);break;case"map":r.forEach(function(d){c=c||l(d,e)});break;case"set":s?r.forEach(function(d){c=c||l(d,e)}):c=r.has(e);break;case"array":s?c=r.some(function(d){return l(d,e)}):c=r.indexOf(e)!==-1;break;default:{if(e!==Object(e))throw new X(a+"the given combination of arguments ("+n+" and "+J(e).toLowerCase()+") is invalid for this assertion. You can use an array, a map, an object, a set, a string, or a weakset instead of a "+J(e).toLowerCase(),void 0,i);let d=Object.keys(e),p=null,f=0;if(d.forEach(function(g){let h=new b(r);if(ye(this,h,!0),C(h,"lockSsfi",!0),!o||d.length===1){h.property(g,e[g]);return}try{h.property(g,e[g])}catch(S){if(!de.compatibleConstructor(S,X))throw S;p===null&&(p=S),f++}},this),o&&d.length>1&&f===d.length)throw p;return}}this.assert(c,"expected #{this} to "+u+"include "+K(e),"expected #{this} to not "+u+"include "+K(e))}q(Wt,"include");b.addChainableMethod("include",Wt,Ht);b.addChainableMethod("contain",Wt,Ht);b.addChainableMethod("contains",Wt,Ht);b.addChainableMethod("includes",Wt,Ht);b.addProperty("ok",function(){this.assert(C(this,"object"),"expected #{this} to be truthy","expected #{this} to be falsy")});b.addProperty("true",function(){this.assert(C(this,"object")===!0,"expected #{this} to be true","expected #{this} to be false",!C(this,"negate"))});b.addProperty("numeric",function(){const e=C(this,"object");this.assert(["Number","BigInt"].includes(J(e)),"expected #{this} to be numeric","expected #{this} to not be numeric",!C(this,"negate"))});b.addProperty("callable",function(){const e=C(this,"object"),t=C(this,"ssfi"),r=C(this,"message"),n=r?`${r}: `:"",a=C(this,"negate"),o=a?`${n}expected ${K(e)} not to be a callable function`:`${n}expected ${K(e)} to be a callable function`,i=["Function","AsyncFunction","GeneratorFunction","AsyncGeneratorFunction"].includes(J(e));if(i&&a||!i&&!a)throw new X(o,void 0,t)});b.addProperty("false",function(){this.assert(C(this,"object")===!1,"expected #{this} to be false","expected #{this} to be true",!!C(this,"negate"))});b.addProperty("null",function(){this.assert(C(this,"object")===null,"expected #{this} to be null","expected #{this} not to be null")});b.addProperty("undefined",function(){this.assert(C(this,"object")===void 0,"expected #{this} to be undefined","expected #{this} not to be undefined")});b.addProperty("NaN",function(){this.assert(mr(C(this,"object")),"expected #{this} to be NaN","expected #{this} not to be NaN")});function Zn(){let e=C(this,"object");this.assert(e!=null,"expected #{this} to exist","expected #{this} to not exist")}q(Zn,"assertExist");b.addProperty("exist",Zn);b.addProperty("exists",Zn);b.addProperty("empty",function(){let e=C(this,"object"),t=C(this,"ssfi"),r=C(this,"message"),n;switch(r=r?r+": ":"",J(e).toLowerCase()){case"array":case"string":n=e.length;break;case"map":case"set":n=e.size;break;case"weakmap":case"weakset":throw new X(r+".empty was passed a weak collection",void 0,t);case"function":throw new X((r+".empty was passed a function "+Ar(e)).trim(),void 0,t);default:if(e!==Object(e))throw new X(r+".empty was passed non-string primitive "+K(e),void 0,t);n=Object.keys(e).length}this.assert(n===0,"expected #{this} to be empty","expected #{this} not to be empty")});function ea(){let e=J(C(this,"object"));this.assert(e==="Arguments","expected #{this} to be arguments but got "+e,"expected #{this} to not be arguments")}q(ea,"checkArguments");b.addProperty("arguments",ea);b.addProperty("Arguments",ea);function Ir(e,t){t&&C(this,"message",t);let r=C(this,"object");if(C(this,"deep")){let n=C(this,"lockSsfi");C(this,"lockSsfi",!0),this.eql(e),C(this,"lockSsfi",n)}else this.assert(e===r,"expected #{this} to equal #{exp}","expected #{this} to not equal #{exp}",e,this._obj,!0)}q(Ir,"assertEqual");b.addMethod("equal",Ir);b.addMethod("equals",Ir);b.addMethod("eq",Ir);function ta(e,t){t&&C(this,"message",t);let r=C(this,"eql");this.assert(r(e,C(this,"object")),"expected #{this} to deeply equal #{exp}","expected #{this} to not deeply equal #{exp}",e,this._obj,!0)}q(ta,"assertEql");b.addMethod("eql",ta);b.addMethod("eqls",ta);function Nr(e,t){t&&C(this,"message",t);let r=C(this,"object"),n=C(this,"doLength"),a=C(this,"message"),o=a?a+": ":"",i=C(this,"ssfi"),s=J(r).toLowerCase(),u=J(e).toLowerCase();if(n&&s!=="map"&&s!=="set"&&new b(r,a,i,!0).to.have.property("length"),!n&&s==="date"&&u!=="date")throw new X(o+"the argument to above must be a date",void 0,i);if(!ae(e)&&(n||ae(r)))throw new X(o+"the argument to above must be a number",void 0,i);if(!n&&s!=="date"&&!ae(r)){let l=s==="string"?"'"+r+"'":r;throw new X(o+"expected "+l+" to be a number or a date",void 0,i)}if(n){let l="length",c;s==="map"||s==="set"?(l="size",c=r.size):c=r.length,this.assert(c>e,"expected #{this} to have a "+l+" above #{exp} but got #{act}","expected #{this} to not have a "+l+" above #{exp}",e,c)}else this.assert(r>e,"expected #{this} to be above #{exp}","expected #{this} to be at most #{exp}",e)}q(Nr,"assertAbove");b.addMethod("above",Nr);b.addMethod("gt",Nr);b.addMethod("greaterThan",Nr);function kr(e,t){t&&C(this,"message",t);let r=C(this,"object"),n=C(this,"doLength"),a=C(this,"message"),o=a?a+": ":"",i=C(this,"ssfi"),s=J(r).toLowerCase(),u=J(e).toLowerCase(),l,c=!0;if(n&&s!=="map"&&s!=="set"&&new b(r,a,i,!0).to.have.property("length"),!n&&s==="date"&&u!=="date")l=o+"the argument to least must be a date";else if(!ae(e)&&(n||ae(r)))l=o+"the argument to least must be a number";else if(!n&&s!=="date"&&!ae(r)){let d=s==="string"?"'"+r+"'":r;l=o+"expected "+d+" to be a number or a date"}else c=!1;if(c)throw new X(l,void 0,i);if(n){let d="length",p;s==="map"||s==="set"?(d="size",p=r.size):p=r.length,this.assert(p>=e,"expected #{this} to have a "+d+" at least #{exp} but got #{act}","expected #{this} to have a "+d+" below #{exp}",e,p)}else this.assert(r>=e,"expected #{this} to be at least #{exp}","expected #{this} to be below #{exp}",e)}q(kr,"assertLeast");b.addMethod("least",kr);b.addMethod("gte",kr);b.addMethod("greaterThanOrEqual",kr);function jr(e,t){t&&C(this,"message",t);let r=C(this,"object"),n=C(this,"doLength"),a=C(this,"message"),o=a?a+": ":"",i=C(this,"ssfi"),s=J(r).toLowerCase(),u=J(e).toLowerCase(),l,c=!0;if(n&&s!=="map"&&s!=="set"&&new b(r,a,i,!0).to.have.property("length"),!n&&s==="date"&&u!=="date")l=o+"the argument to below must be a date";else if(!ae(e)&&(n||ae(r)))l=o+"the argument to below must be a number";else if(!n&&s!=="date"&&!ae(r)){let d=s==="string"?"'"+r+"'":r;l=o+"expected "+d+" to be a number or a date"}else c=!1;if(c)throw new X(l,void 0,i);if(n){let d="length",p;s==="map"||s==="set"?(d="size",p=r.size):p=r.length,this.assert(p<e,"expected #{this} to have a "+d+" below #{exp} but got #{act}","expected #{this} to not have a "+d+" below #{exp}",e,p)}else this.assert(r<e,"expected #{this} to be below #{exp}","expected #{this} to be at least #{exp}",e)}q(jr,"assertBelow");b.addMethod("below",jr);b.addMethod("lt",jr);b.addMethod("lessThan",jr);function Dr(e,t){t&&C(this,"message",t);let r=C(this,"object"),n=C(this,"doLength"),a=C(this,"message"),o=a?a+": ":"",i=C(this,"ssfi"),s=J(r).toLowerCase(),u=J(e).toLowerCase(),l,c=!0;if(n&&s!=="map"&&s!=="set"&&new b(r,a,i,!0).to.have.property("length"),!n&&s==="date"&&u!=="date")l=o+"the argument to most must be a date";else if(!ae(e)&&(n||ae(r)))l=o+"the argument to most must be a number";else if(!n&&s!=="date"&&!ae(r)){let d=s==="string"?"'"+r+"'":r;l=o+"expected "+d+" to be a number or a date"}else c=!1;if(c)throw new X(l,void 0,i);if(n){let d="length",p;s==="map"||s==="set"?(d="size",p=r.size):p=r.length,this.assert(p<=e,"expected #{this} to have a "+d+" at most #{exp} but got #{act}","expected #{this} to have a "+d+" above #{exp}",e,p)}else this.assert(r<=e,"expected #{this} to be at most #{exp}","expected #{this} to be above #{exp}",e)}q(Dr,"assertMost");b.addMethod("most",Dr);b.addMethod("lte",Dr);b.addMethod("lessThanOrEqual",Dr);b.addMethod("within",function(e,t,r){r&&C(this,"message",r);let n=C(this,"object"),a=C(this,"doLength"),o=C(this,"message"),i=o?o+": ":"",s=C(this,"ssfi"),u=J(n).toLowerCase(),l=J(e).toLowerCase(),c=J(t).toLowerCase(),d,p=!0,f=l==="date"&&c==="date"?e.toISOString()+".."+t.toISOString():e+".."+t;if(a&&u!=="map"&&u!=="set"&&new b(n,o,s,!0).to.have.property("length"),!a&&u==="date"&&(l!=="date"||c!=="date"))d=i+"the arguments to within must be dates";else if((!ae(e)||!ae(t))&&(a||ae(n)))d=i+"the arguments to within must be numbers";else if(!a&&u!=="date"&&!ae(n)){let g=u==="string"?"'"+n+"'":n;d=i+"expected "+g+" to be a number or a date"}else p=!1;if(p)throw new X(d,void 0,s);if(a){let g="length",h;u==="map"||u==="set"?(g="size",h=n.size):h=n.length,this.assert(h>=e&&h<=t,"expected #{this} to have a "+g+" within "+f,"expected #{this} to not have a "+g+" within "+f)}else this.assert(n>=e&&n<=t,"expected #{this} to be within "+f,"expected #{this} to not be within "+f)});function ra(e,t){t&&C(this,"message",t);let r=C(this,"object"),n=C(this,"ssfi"),a=C(this,"message"),o;try{o=r instanceof e}catch(s){throw s instanceof TypeError?(a=a?a+": ":"",new X(a+"The instanceof assertion needs a constructor but "+J(e)+" was given.",void 0,n)):s}let i=Ar(e);i==null&&(i="an unnamed constructor"),this.assert(o,"expected #{this} to be an instance of "+i,"expected #{this} to not be an instance of "+i)}q(ra,"assertInstanceOf");b.addMethod("instanceof",ra);b.addMethod("instanceOf",ra);function na(e,t,r){r&&C(this,"message",r);let n=C(this,"nested"),a=C(this,"own"),o=C(this,"message"),i=C(this,"object"),s=C(this,"ssfi"),u=typeof e;if(o=o?o+": ":"",n){if(u!=="string")throw new X(o+"the argument to property must be a string when using nested syntax",void 0,s)}else if(u!=="string"&&u!=="number"&&u!=="symbol")throw new X(o+"the argument to property must be a string, number, or symbol",void 0,s);if(n&&a)throw new X(o+'The "nested" and "own" flags cannot be combined.',void 0,s);if(i==null)throw new X(o+"Target cannot be null or undefined.",void 0,s);let l=C(this,"deep"),c=C(this,"negate"),d=n?Fn(i,e):null,p=n?d.value:i[e],f=l?C(this,"eql"):(S,E)=>S===E,g="";l&&(g+="deep "),a&&(g+="own "),n&&(g+="nested "),g+="property ";let h;a?h=Object.prototype.hasOwnProperty.call(i,e):n?h=d.exists:h=Or(i,e),(!c||arguments.length===1)&&this.assert(h,"expected #{this} to have "+g+K(e),"expected #{this} to not have "+g+K(e)),arguments.length>1&&this.assert(h&&f(t,p),"expected #{this} to have "+g+K(e)+" of #{exp}, but got #{act}","expected #{this} to not have "+g+K(e)+" of #{act}",t,p),C(this,"object",p)}q(na,"assertProperty");b.addMethod("property",na);function aa(e,t,r){C(this,"own",!0),na.apply(this,arguments)}q(aa,"assertOwnProperty");b.addMethod("ownProperty",aa);b.addMethod("haveOwnProperty",aa);function oa(e,t,r){typeof t=="string"&&(r=t,t=null),r&&C(this,"message",r);let n=C(this,"object"),a=Object.getOwnPropertyDescriptor(Object(n),e),o=C(this,"eql");a&&t?this.assert(o(t,a),"expected the own property descriptor for "+K(e)+" on #{this} to match "+K(t)+", got "+K(a),"expected the own property descriptor for "+K(e)+" on #{this} to not match "+K(t),t,a,!0):this.assert(a,"expected #{this} to have an own property descriptor for "+K(e),"expected #{this} to not have an own property descriptor for "+K(e)),C(this,"object",a)}q(oa,"assertOwnPropertyDescriptor");b.addMethod("ownPropertyDescriptor",oa);b.addMethod("haveOwnPropertyDescriptor",oa);function ia(){C(this,"doLength",!0)}q(ia,"assertLengthChain");function sa(e,t){t&&C(this,"message",t);let r=C(this,"object"),n=J(r).toLowerCase(),a=C(this,"message"),o=C(this,"ssfi"),i="length",s;switch(n){case"map":case"set":i="size",s=r.size;break;default:new b(r,a,o,!0).to.have.property("length"),s=r.length}this.assert(s==e,"expected #{this} to have a "+i+" of #{exp} but got #{act}","expected #{this} to not have a "+i+" of #{act}",e,s)}q(sa,"assertLength");b.addChainableMethod("length",sa,ia);b.addChainableMethod("lengthOf",sa,ia);function la(e,t){t&&C(this,"message",t);let r=C(this,"object");this.assert(e.exec(r),"expected #{this} to match "+e,"expected #{this} not to match "+e)}q(la,"assertMatch");b.addMethod("match",la);b.addMethod("matches",la);b.addMethod("string",function(e,t){t&&C(this,"message",t);let r=C(this,"object");new b(r,C(this,"message"),C(this,"ssfi"),!0).is.a("string"),this.assert(~r.indexOf(e),"expected #{this} to contain "+K(e),"expected #{this} to not contain "+K(e))});function ua(e){let t=C(this,"object"),r=J(t),n=J(e),a=C(this,"ssfi"),o=C(this,"deep"),i,s="",u,l=!0,c=C(this,"message");c=c?c+": ":"";let d=c+"when testing keys against an object or an array you must give a single Array|Object|String argument or multiple String arguments";if(r==="Map"||r==="Set")s=o?"deeply ":"",u=[],t.forEach(function(E,w){u.push(w)}),n!=="Array"&&(e=Array.prototype.slice.call(arguments));else{switch(u=Xn(t),n){case"Array":if(arguments.length>1)throw new X(d,void 0,a);break;case"Object":if(arguments.length>1)throw new X(d,void 0,a);e=Object.keys(e);break;default:e=Array.prototype.slice.call(arguments)}e=e.map(function(E){return typeof E=="symbol"?E:String(E)})}if(!e.length)throw new X(c+"keys required",void 0,a);let p=e.length,f=C(this,"any"),g=C(this,"all"),h=e,S=o?C(this,"eql"):(E,w)=>E===w;if(!f&&!g&&(g=!0),f&&(l=h.some(function(E){return u.some(function(w){return S(E,w)})})),g&&(l=h.every(function(E){return u.some(function(w){return S(E,w)})}),C(this,"contains")||(l=l&&e.length==u.length)),p>1){e=e.map(function(w){return K(w)});let E=e.pop();g&&(i=e.join(", ")+", and "+E),f&&(i=e.join(", ")+", or "+E)}else i=K(e[0]);i=(p>1?"keys ":"key ")+i,i=(C(this,"contains")?"contain ":"have ")+i,this.assert(l,"expected #{this} to "+s+i,"expected #{this} to not "+s+i,h.slice(0).sort(pr),u.sort(pr),!0)}q(ua,"assertKeys");b.addMethod("keys",ua);b.addMethod("key",ua);function Lr(e,t,r){r&&C(this,"message",r);let n=C(this,"object"),a=C(this,"ssfi"),o=C(this,"message"),i=C(this,"negate")||!1;new b(n,o,a,!0).is.a("function"),(br(e)||typeof e=="string")&&(t=e,e=null);let s,u=!1;try{n()}catch(f){u=!0,s=f}let l=e===void 0&&t===void 0,c=!!(e&&t),d=!1,p=!1;if(l||!l&&!i){let f="an error";e instanceof Error?f="#{exp}":e&&(f=de.getConstructorName(e));let g=s;if(s instanceof Error)g=s.toString();else if(typeof s=="string")g=s;else if(s&&(typeof s=="object"||typeof s=="function"))try{g=de.getConstructorName(s)}catch{}this.assert(u,"expected #{this} to throw "+f,"expected #{this} to not throw an error but #{act} was thrown",e&&e.toString(),g)}if(e&&s&&(e instanceof Error&&de.compatibleInstance(s,e)===i&&(c&&i?d=!0:this.assert(i,"expected #{this} to throw #{exp} but #{act} was thrown","expected #{this} to not throw #{exp}"+(s&&!i?" but #{act} was thrown":""),e.toString(),s.toString())),de.compatibleConstructor(s,e)===i&&(c&&i?d=!0:this.assert(i,"expected #{this} to throw #{exp} but #{act} was thrown","expected #{this} to not throw #{exp}"+(s?" but #{act} was thrown":""),e instanceof Error?e.toString():e&&de.getConstructorName(e),s instanceof Error?s.toString():s&&de.getConstructorName(s)))),s&&t!==void 0&&t!==null){let f="including";br(t)&&(f="matching"),de.compatibleMessage(s,t)===i&&(c&&i?p=!0:this.assert(i,"expected #{this} to throw error "+f+" #{exp} but got #{act}","expected #{this} to throw error not "+f+" #{exp}",t,de.getMessage(s)))}d&&p&&this.assert(i,"expected #{this} to throw #{exp} but #{act} was thrown","expected #{this} to not throw #{exp}"+(s?" but #{act} was thrown":""),e instanceof Error?e.toString():e&&de.getConstructorName(e),s instanceof Error?s.toString():s&&de.getConstructorName(s)),C(this,"object",s)}q(Lr,"assertThrows");b.addMethod("throw",Lr);b.addMethod("throws",Lr);b.addMethod("Throw",Lr);function ca(e,t){t&&C(this,"message",t);let r=C(this,"object"),n=C(this,"itself"),a=typeof r=="function"&&!n?r.prototype[e]:r[e];this.assert(typeof a=="function","expected #{this} to respond to "+K(e),"expected #{this} to not respond to "+K(e))}q(ca,"respondTo");b.addMethod("respondTo",ca);b.addMethod("respondsTo",ca);b.addProperty("itself",function(){C(this,"itself",!0)});function da(e,t){t&&C(this,"message",t);let r=e(C(this,"object"));this.assert(r,"expected #{this} to satisfy "+Qe(e),"expected #{this} to not satisfy"+Qe(e),!C(this,"negate"),r)}q(da,"satisfy");b.addMethod("satisfy",da);b.addMethod("satisfies",da);function fa(e,t,r){r&&C(this,"message",r);let n=C(this,"object"),a=C(this,"message"),o=C(this,"ssfi");new b(n,a,o,!0).is.numeric;let i="A `delta` value is required for `closeTo`";if(t==null)throw new X(a?`${a}: ${i}`:i,void 0,o);if(new b(t,a,o,!0).is.numeric,i="A `expected` value is required for `closeTo`",e==null)throw new X(a?`${a}: ${i}`:i,void 0,o);new b(e,a,o,!0).is.numeric;const s=q(l=>l<0?-l:l,"abs"),u=q(l=>parseFloat(parseFloat(l).toPrecision(12)),"strip");this.assert(u(s(n-e))<=t,"expected #{this} to be close to "+e+" +/- "+t,"expected #{this} not to be close to "+e+" +/- "+t)}q(fa,"closeTo");b.addMethod("closeTo",fa);b.addMethod("approximately",fa);function Ci(e,t,r,n,a){let o=Array.from(t),i=Array.from(e);if(!n){if(i.length!==o.length)return!1;o=o.slice()}return i.every(function(s,u){if(a)return r?r(s,o[u]):s===o[u];if(!r){let l=o.indexOf(s);return l===-1?!1:(n||o.splice(l,1),!0)}return o.some(function(l,c){return r(s,l)?(n||o.splice(c,1),!0):!1})})}q(Ci,"isSubsetOf");b.addMethod("members",function(e,t){t&&C(this,"message",t);let r=C(this,"object"),n=C(this,"message"),a=C(this,"ssfi");new b(r,n,a,!0).to.be.iterable,new b(e,n,a,!0).to.be.iterable;let o=C(this,"contains"),i=C(this,"ordered"),s,u,l;o?(s=i?"an ordered superset":"a superset",u="expected #{this} to be "+s+" of #{exp}",l="expected #{this} to not be "+s+" of #{exp}"):(s=i?"ordered members":"members",u="expected #{this} to have the same "+s+" as #{exp}",l="expected #{this} to not have the same "+s+" as #{exp}");let c=C(this,"deep")?C(this,"eql"):void 0;this.assert(Ci(e,r,c,o,i),u,l,e,r,!0)});b.addProperty("iterable",function(e){e&&C(this,"message",e);let t=C(this,"object");this.assert(t!=null&&t[Symbol.iterator],"expected #{this} to be an iterable","expected #{this} to not be an iterable",t)});function Pi(e,t){t&&C(this,"message",t);let r=C(this,"object"),n=C(this,"message"),a=C(this,"ssfi"),o=C(this,"contains"),i=C(this,"deep"),s=C(this,"eql");new b(e,n,a,!0).to.be.an("array"),o?this.assert(e.some(function(u){return r.indexOf(u)>-1}),"expected #{this} to contain one of #{exp}","expected #{this} to not contain one of #{exp}",e,r):i?this.assert(e.some(function(u){return s(r,u)}),"expected #{this} to deeply equal one of #{exp}","expected #{this} to deeply equal one of #{exp}",e,r):this.assert(e.indexOf(r)>-1,"expected #{this} to be one of #{exp}","expected #{this} to not be one of #{exp}",e,r)}q(Pi,"oneOf");b.addMethod("oneOf",Pi);function pa(e,t,r){r&&C(this,"message",r);let n=C(this,"object"),a=C(this,"message"),o=C(this,"ssfi");new b(n,a,o,!0).is.a("function");let i;t?(new b(e,a,o,!0).to.have.property(t),i=e[t]):(new b(e,a,o,!0).is.a("function"),i=e()),n();let s=t==null?e():e[t],u=t==null?i:"."+t;C(this,"deltaMsgObj",u),C(this,"initialDeltaValue",i),C(this,"finalDeltaValue",s),C(this,"deltaBehavior","change"),C(this,"realDelta",s!==i),this.assert(i!==s,"expected "+u+" to change","expected "+u+" to not change")}q(pa,"assertChanges");b.addMethod("change",pa);b.addMethod("changes",pa);function ma(e,t,r){r&&C(this,"message",r);let n=C(this,"object"),a=C(this,"message"),o=C(this,"ssfi");new b(n,a,o,!0).is.a("function");let i;t?(new b(e,a,o,!0).to.have.property(t),i=e[t]):(new b(e,a,o,!0).is.a("function"),i=e()),new b(i,a,o,!0).is.a("number"),n();let s=t==null?e():e[t],u=t==null?i:"."+t;C(this,"deltaMsgObj",u),C(this,"initialDeltaValue",i),C(this,"finalDeltaValue",s),C(this,"deltaBehavior","increase"),C(this,"realDelta",s-i),this.assert(s-i>0,"expected "+u+" to increase","expected "+u+" to not increase")}q(ma,"assertIncreases");b.addMethod("increase",ma);b.addMethod("increases",ma);function ba(e,t,r){r&&C(this,"message",r);let n=C(this,"object"),a=C(this,"message"),o=C(this,"ssfi");new b(n,a,o,!0).is.a("function");let i;t?(new b(e,a,o,!0).to.have.property(t),i=e[t]):(new b(e,a,o,!0).is.a("function"),i=e()),new b(i,a,o,!0).is.a("number"),n();let s=t==null?e():e[t],u=t==null?i:"."+t;C(this,"deltaMsgObj",u),C(this,"initialDeltaValue",i),C(this,"finalDeltaValue",s),C(this,"deltaBehavior","decrease"),C(this,"realDelta",i-s),this.assert(s-i<0,"expected "+u+" to decrease","expected "+u+" to not decrease")}q(ba,"assertDecreases");b.addMethod("decrease",ba);b.addMethod("decreases",ba);function qi(e,t){t&&C(this,"message",t);let r=C(this,"deltaMsgObj"),n=C(this,"initialDeltaValue"),a=C(this,"finalDeltaValue"),o=C(this,"deltaBehavior"),i=C(this,"realDelta"),s;o==="change"?s=Math.abs(a-n)===Math.abs(e):s=i===Math.abs(e),this.assert(s,"expected "+r+" to "+o+" by "+e,"expected "+r+" to not "+o+" by "+e)}q(qi,"assertDelta");b.addMethod("by",qi);b.addProperty("extensible",function(){let e=C(this,"object"),t=e===Object(e)&&Object.isExtensible(e);this.assert(t,"expected #{this} to be extensible","expected #{this} to not be extensible")});b.addProperty("sealed",function(){let e=C(this,"object"),t=e===Object(e)?Object.isSealed(e):!0;this.assert(t,"expected #{this} to be sealed","expected #{this} to not be sealed")});b.addProperty("frozen",function(){let e=C(this,"object"),t=e===Object(e)?Object.isFrozen(e):!0;this.assert(t,"expected #{this} to be frozen","expected #{this} to not be frozen")});b.addProperty("finite",function(e){let t=C(this,"object");this.assert(typeof t=="number"&&isFinite(t),"expected #{this} to be a finite number","expected #{this} to not be a finite number")});function hr(e,t){return e===t?!0:typeof t!=typeof e?!1:typeof e!="object"||e===null?e===t:t?Array.isArray(e)?Array.isArray(t)?e.every(function(r){return t.some(function(n){return hr(r,n)})}):!1:e instanceof Date?t instanceof Date?e.getTime()===t.getTime():!1:Object.keys(e).every(function(r){let n=e[r],a=t[r];return typeof n=="object"&&n!==null&&a!==null?hr(n,a):typeof n=="function"?n(a):a===n}):!1}q(hr,"compareSubset");b.addMethod("containSubset",function(e){const t=U(this,"object"),r=se.showDiff;this.assert(hr(e,t),"expected #{act} to contain subset #{exp}","expected #{act} to not contain subset #{exp}",e,t,r)});function kt(e,t){return new b(e,t)}q(kt,"expect");kt.fail=function(e,t,r,n){throw arguments.length<2&&(r=e,e=void 0),r=r||"expect.fail()",new X(r,{actual:e,expected:t,operator:n},kt.fail)};var Ri={};Nn(Ri,{Should:()=>Ru,should:()=>qu});function ha(){function e(){return this instanceof String||this instanceof Number||this instanceof Boolean||typeof Symbol=="function"&&this instanceof Symbol||typeof BigInt=="function"&&this instanceof BigInt?new b(this.valueOf(),null,e):new b(this,null,e)}q(e,"shouldGetter");function t(n){Object.defineProperty(this,"should",{value:n,enumerable:!0,configurable:!0,writable:!0})}q(t,"shouldSetter"),Object.defineProperty(Object.prototype,"should",{set:t,get:e,configurable:!0});let r={};return r.fail=function(n,a,o,i){throw arguments.length<2&&(o=n,n=void 0),o=o||"should.fail()",new X(o,{actual:n,expected:a,operator:i},r.fail)},r.equal=function(n,a,o){new b(n,o).to.equal(a)},r.Throw=function(n,a,o,i){new b(n,i).to.Throw(a,o)},r.exist=function(n,a){new b(n,a).to.exist},r.not={},r.not.equal=function(n,a,o){new b(n,o).to.not.equal(a)},r.not.Throw=function(n,a,o,i){new b(n,i).to.not.Throw(a,o)},r.not.exist=function(n,a){new b(n,a).to.not.exist},r.throw=r.Throw,r.not.throw=r.not.Throw,r}q(ha,"loadShould");var qu=ha,Ru=ha;function m(e,t){new b(null,null,m,!0).assert(e,t,"[ negation message unavailable ]")}q(m,"assert");m.fail=function(e,t,r,n){throw arguments.length<2&&(r=e,e=void 0),r=r||"assert.fail()",new X(r,{actual:e,expected:t,operator:n},m.fail)};m.isOk=function(e,t){new b(e,t,m.isOk,!0).is.ok};m.isNotOk=function(e,t){new b(e,t,m.isNotOk,!0).is.not.ok};m.equal=function(e,t,r){let n=new b(e,r,m.equal,!0);n.assert(t==U(n,"object"),"expected #{this} to equal #{exp}","expected #{this} to not equal #{act}",t,e,!0)};m.notEqual=function(e,t,r){let n=new b(e,r,m.notEqual,!0);n.assert(t!=U(n,"object"),"expected #{this} to not equal #{exp}","expected #{this} to equal #{act}",t,e,!0)};m.strictEqual=function(e,t,r){new b(e,r,m.strictEqual,!0).to.equal(t)};m.notStrictEqual=function(e,t,r){new b(e,r,m.notStrictEqual,!0).to.not.equal(t)};m.deepEqual=m.deepStrictEqual=function(e,t,r){new b(e,r,m.deepEqual,!0).to.eql(t)};m.notDeepEqual=function(e,t,r){new b(e,r,m.notDeepEqual,!0).to.not.eql(t)};m.isAbove=function(e,t,r){new b(e,r,m.isAbove,!0).to.be.above(t)};m.isAtLeast=function(e,t,r){new b(e,r,m.isAtLeast,!0).to.be.least(t)};m.isBelow=function(e,t,r){new b(e,r,m.isBelow,!0).to.be.below(t)};m.isAtMost=function(e,t,r){new b(e,r,m.isAtMost,!0).to.be.most(t)};m.isTrue=function(e,t){new b(e,t,m.isTrue,!0).is.true};m.isNotTrue=function(e,t){new b(e,t,m.isNotTrue,!0).to.not.equal(!0)};m.isFalse=function(e,t){new b(e,t,m.isFalse,!0).is.false};m.isNotFalse=function(e,t){new b(e,t,m.isNotFalse,!0).to.not.equal(!1)};m.isNull=function(e,t){new b(e,t,m.isNull,!0).to.equal(null)};m.isNotNull=function(e,t){new b(e,t,m.isNotNull,!0).to.not.equal(null)};m.isNaN=function(e,t){new b(e,t,m.isNaN,!0).to.be.NaN};m.isNotNaN=function(e,t){new b(e,t,m.isNotNaN,!0).not.to.be.NaN};m.exists=function(e,t){new b(e,t,m.exists,!0).to.exist};m.notExists=function(e,t){new b(e,t,m.notExists,!0).to.not.exist};m.isUndefined=function(e,t){new b(e,t,m.isUndefined,!0).to.equal(void 0)};m.isDefined=function(e,t){new b(e,t,m.isDefined,!0).to.not.equal(void 0)};m.isCallable=function(e,t){new b(e,t,m.isCallable,!0).is.callable};m.isNotCallable=function(e,t){new b(e,t,m.isNotCallable,!0).is.not.callable};m.isObject=function(e,t){new b(e,t,m.isObject,!0).to.be.a("object")};m.isNotObject=function(e,t){new b(e,t,m.isNotObject,!0).to.not.be.a("object")};m.isArray=function(e,t){new b(e,t,m.isArray,!0).to.be.an("array")};m.isNotArray=function(e,t){new b(e,t,m.isNotArray,!0).to.not.be.an("array")};m.isString=function(e,t){new b(e,t,m.isString,!0).to.be.a("string")};m.isNotString=function(e,t){new b(e,t,m.isNotString,!0).to.not.be.a("string")};m.isNumber=function(e,t){new b(e,t,m.isNumber,!0).to.be.a("number")};m.isNotNumber=function(e,t){new b(e,t,m.isNotNumber,!0).to.not.be.a("number")};m.isNumeric=function(e,t){new b(e,t,m.isNumeric,!0).is.numeric};m.isNotNumeric=function(e,t){new b(e,t,m.isNotNumeric,!0).is.not.numeric};m.isFinite=function(e,t){new b(e,t,m.isFinite,!0).to.be.finite};m.isBoolean=function(e,t){new b(e,t,m.isBoolean,!0).to.be.a("boolean")};m.isNotBoolean=function(e,t){new b(e,t,m.isNotBoolean,!0).to.not.be.a("boolean")};m.typeOf=function(e,t,r){new b(e,r,m.typeOf,!0).to.be.a(t)};m.notTypeOf=function(e,t,r){new b(e,r,m.notTypeOf,!0).to.not.be.a(t)};m.instanceOf=function(e,t,r){new b(e,r,m.instanceOf,!0).to.be.instanceOf(t)};m.notInstanceOf=function(e,t,r){new b(e,r,m.notInstanceOf,!0).to.not.be.instanceOf(t)};m.include=function(e,t,r){new b(e,r,m.include,!0).include(t)};m.notInclude=function(e,t,r){new b(e,r,m.notInclude,!0).not.include(t)};m.deepInclude=function(e,t,r){new b(e,r,m.deepInclude,!0).deep.include(t)};m.notDeepInclude=function(e,t,r){new b(e,r,m.notDeepInclude,!0).not.deep.include(t)};m.nestedInclude=function(e,t,r){new b(e,r,m.nestedInclude,!0).nested.include(t)};m.notNestedInclude=function(e,t,r){new b(e,r,m.notNestedInclude,!0).not.nested.include(t)};m.deepNestedInclude=function(e,t,r){new b(e,r,m.deepNestedInclude,!0).deep.nested.include(t)};m.notDeepNestedInclude=function(e,t,r){new b(e,r,m.notDeepNestedInclude,!0).not.deep.nested.include(t)};m.ownInclude=function(e,t,r){new b(e,r,m.ownInclude,!0).own.include(t)};m.notOwnInclude=function(e,t,r){new b(e,r,m.notOwnInclude,!0).not.own.include(t)};m.deepOwnInclude=function(e,t,r){new b(e,r,m.deepOwnInclude,!0).deep.own.include(t)};m.notDeepOwnInclude=function(e,t,r){new b(e,r,m.notDeepOwnInclude,!0).not.deep.own.include(t)};m.match=function(e,t,r){new b(e,r,m.match,!0).to.match(t)};m.notMatch=function(e,t,r){new b(e,r,m.notMatch,!0).to.not.match(t)};m.property=function(e,t,r){new b(e,r,m.property,!0).to.have.property(t)};m.notProperty=function(e,t,r){new b(e,r,m.notProperty,!0).to.not.have.property(t)};m.propertyVal=function(e,t,r,n){new b(e,n,m.propertyVal,!0).to.have.property(t,r)};m.notPropertyVal=function(e,t,r,n){new b(e,n,m.notPropertyVal,!0).to.not.have.property(t,r)};m.deepPropertyVal=function(e,t,r,n){new b(e,n,m.deepPropertyVal,!0).to.have.deep.property(t,r)};m.notDeepPropertyVal=function(e,t,r,n){new b(e,n,m.notDeepPropertyVal,!0).to.not.have.deep.property(t,r)};m.ownProperty=function(e,t,r){new b(e,r,m.ownProperty,!0).to.have.own.property(t)};m.notOwnProperty=function(e,t,r){new b(e,r,m.notOwnProperty,!0).to.not.have.own.property(t)};m.ownPropertyVal=function(e,t,r,n){new b(e,n,m.ownPropertyVal,!0).to.have.own.property(t,r)};m.notOwnPropertyVal=function(e,t,r,n){new b(e,n,m.notOwnPropertyVal,!0).to.not.have.own.property(t,r)};m.deepOwnPropertyVal=function(e,t,r,n){new b(e,n,m.deepOwnPropertyVal,!0).to.have.deep.own.property(t,r)};m.notDeepOwnPropertyVal=function(e,t,r,n){new b(e,n,m.notDeepOwnPropertyVal,!0).to.not.have.deep.own.property(t,r)};m.nestedProperty=function(e,t,r){new b(e,r,m.nestedProperty,!0).to.have.nested.property(t)};m.notNestedProperty=function(e,t,r){new b(e,r,m.notNestedProperty,!0).to.not.have.nested.property(t)};m.nestedPropertyVal=function(e,t,r,n){new b(e,n,m.nestedPropertyVal,!0).to.have.nested.property(t,r)};m.notNestedPropertyVal=function(e,t,r,n){new b(e,n,m.notNestedPropertyVal,!0).to.not.have.nested.property(t,r)};m.deepNestedPropertyVal=function(e,t,r,n){new b(e,n,m.deepNestedPropertyVal,!0).to.have.deep.nested.property(t,r)};m.notDeepNestedPropertyVal=function(e,t,r,n){new b(e,n,m.notDeepNestedPropertyVal,!0).to.not.have.deep.nested.property(t,r)};m.lengthOf=function(e,t,r){new b(e,r,m.lengthOf,!0).to.have.lengthOf(t)};m.hasAnyKeys=function(e,t,r){new b(e,r,m.hasAnyKeys,!0).to.have.any.keys(t)};m.hasAllKeys=function(e,t,r){new b(e,r,m.hasAllKeys,!0).to.have.all.keys(t)};m.containsAllKeys=function(e,t,r){new b(e,r,m.containsAllKeys,!0).to.contain.all.keys(t)};m.doesNotHaveAnyKeys=function(e,t,r){new b(e,r,m.doesNotHaveAnyKeys,!0).to.not.have.any.keys(t)};m.doesNotHaveAllKeys=function(e,t,r){new b(e,r,m.doesNotHaveAllKeys,!0).to.not.have.all.keys(t)};m.hasAnyDeepKeys=function(e,t,r){new b(e,r,m.hasAnyDeepKeys,!0).to.have.any.deep.keys(t)};m.hasAllDeepKeys=function(e,t,r){new b(e,r,m.hasAllDeepKeys,!0).to.have.all.deep.keys(t)};m.containsAllDeepKeys=function(e,t,r){new b(e,r,m.containsAllDeepKeys,!0).to.contain.all.deep.keys(t)};m.doesNotHaveAnyDeepKeys=function(e,t,r){new b(e,r,m.doesNotHaveAnyDeepKeys,!0).to.not.have.any.deep.keys(t)};m.doesNotHaveAllDeepKeys=function(e,t,r){new b(e,r,m.doesNotHaveAllDeepKeys,!0).to.not.have.all.deep.keys(t)};m.throws=function(e,t,r,n){return(typeof t=="string"||t instanceof RegExp)&&(r=t,t=null),U(new b(e,n,m.throws,!0).to.throw(t,r),"object")};m.doesNotThrow=function(e,t,r,n){(typeof t=="string"||t instanceof RegExp)&&(r=t,t=null),new b(e,n,m.doesNotThrow,!0).to.not.throw(t,r)};m.operator=function(e,t,r,n){let a;switch(t){case"==":a=e==r;break;case"===":a=e===r;break;case">":a=e>r;break;case">=":a=e>=r;break;case"<":a=e<r;break;case"<=":a=e<=r;break;case"!=":a=e!=r;break;case"!==":a=e!==r;break;default:throw n=n&&n+": ",new X(n+'Invalid operator "'+t+'"',void 0,m.operator)}let o=new b(a,n,m.operator,!0);o.assert(U(o,"object")===!0,"expected "+K(e)+" to be "+t+" "+K(r),"expected "+K(e)+" to not be "+t+" "+K(r))};m.closeTo=function(e,t,r,n){new b(e,n,m.closeTo,!0).to.be.closeTo(t,r)};m.approximately=function(e,t,r,n){new b(e,n,m.approximately,!0).to.be.approximately(t,r)};m.sameMembers=function(e,t,r){new b(e,r,m.sameMembers,!0).to.have.same.members(t)};m.notSameMembers=function(e,t,r){new b(e,r,m.notSameMembers,!0).to.not.have.same.members(t)};m.sameDeepMembers=function(e,t,r){new b(e,r,m.sameDeepMembers,!0).to.have.same.deep.members(t)};m.notSameDeepMembers=function(e,t,r){new b(e,r,m.notSameDeepMembers,!0).to.not.have.same.deep.members(t)};m.sameOrderedMembers=function(e,t,r){new b(e,r,m.sameOrderedMembers,!0).to.have.same.ordered.members(t)};m.notSameOrderedMembers=function(e,t,r){new b(e,r,m.notSameOrderedMembers,!0).to.not.have.same.ordered.members(t)};m.sameDeepOrderedMembers=function(e,t,r){new b(e,r,m.sameDeepOrderedMembers,!0).to.have.same.deep.ordered.members(t)};m.notSameDeepOrderedMembers=function(e,t,r){new b(e,r,m.notSameDeepOrderedMembers,!0).to.not.have.same.deep.ordered.members(t)};m.includeMembers=function(e,t,r){new b(e,r,m.includeMembers,!0).to.include.members(t)};m.notIncludeMembers=function(e,t,r){new b(e,r,m.notIncludeMembers,!0).to.not.include.members(t)};m.includeDeepMembers=function(e,t,r){new b(e,r,m.includeDeepMembers,!0).to.include.deep.members(t)};m.notIncludeDeepMembers=function(e,t,r){new b(e,r,m.notIncludeDeepMembers,!0).to.not.include.deep.members(t)};m.includeOrderedMembers=function(e,t,r){new b(e,r,m.includeOrderedMembers,!0).to.include.ordered.members(t)};m.notIncludeOrderedMembers=function(e,t,r){new b(e,r,m.notIncludeOrderedMembers,!0).to.not.include.ordered.members(t)};m.includeDeepOrderedMembers=function(e,t,r){new b(e,r,m.includeDeepOrderedMembers,!0).to.include.deep.ordered.members(t)};m.notIncludeDeepOrderedMembers=function(e,t,r){new b(e,r,m.notIncludeDeepOrderedMembers,!0).to.not.include.deep.ordered.members(t)};m.oneOf=function(e,t,r){new b(e,r,m.oneOf,!0).to.be.oneOf(t)};m.isIterable=function(e,t){if(e==null||!e[Symbol.iterator])throw t=t?`${t} expected ${K(e)} to be an iterable`:`expected ${K(e)} to be an iterable`,new X(t,void 0,m.isIterable)};m.changes=function(e,t,r,n){arguments.length===3&&typeof t=="function"&&(n=r,r=null),new b(e,n,m.changes,!0).to.change(t,r)};m.changesBy=function(e,t,r,n,a){if(arguments.length===4&&typeof t=="function"){let o=n;n=r,a=o}else arguments.length===3&&(n=r,r=null);new b(e,a,m.changesBy,!0).to.change(t,r).by(n)};m.doesNotChange=function(e,t,r,n){return arguments.length===3&&typeof t=="function"&&(n=r,r=null),new b(e,n,m.doesNotChange,!0).to.not.change(t,r)};m.changesButNotBy=function(e,t,r,n,a){if(arguments.length===4&&typeof t=="function"){let o=n;n=r,a=o}else arguments.length===3&&(n=r,r=null);new b(e,a,m.changesButNotBy,!0).to.change(t,r).but.not.by(n)};m.increases=function(e,t,r,n){return arguments.length===3&&typeof t=="function"&&(n=r,r=null),new b(e,n,m.increases,!0).to.increase(t,r)};m.increasesBy=function(e,t,r,n,a){if(arguments.length===4&&typeof t=="function"){let o=n;n=r,a=o}else arguments.length===3&&(n=r,r=null);new b(e,a,m.increasesBy,!0).to.increase(t,r).by(n)};m.doesNotIncrease=function(e,t,r,n){return arguments.length===3&&typeof t=="function"&&(n=r,r=null),new b(e,n,m.doesNotIncrease,!0).to.not.increase(t,r)};m.increasesButNotBy=function(e,t,r,n,a){if(arguments.length===4&&typeof t=="function"){let o=n;n=r,a=o}else arguments.length===3&&(n=r,r=null);new b(e,a,m.increasesButNotBy,!0).to.increase(t,r).but.not.by(n)};m.decreases=function(e,t,r,n){return arguments.length===3&&typeof t=="function"&&(n=r,r=null),new b(e,n,m.decreases,!0).to.decrease(t,r)};m.decreasesBy=function(e,t,r,n,a){if(arguments.length===4&&typeof t=="function"){let o=n;n=r,a=o}else arguments.length===3&&(n=r,r=null);new b(e,a,m.decreasesBy,!0).to.decrease(t,r).by(n)};m.doesNotDecrease=function(e,t,r,n){return arguments.length===3&&typeof t=="function"&&(n=r,r=null),new b(e,n,m.doesNotDecrease,!0).to.not.decrease(t,r)};m.doesNotDecreaseBy=function(e,t,r,n,a){if(arguments.length===4&&typeof t=="function"){let o=n;n=r,a=o}else arguments.length===3&&(n=r,r=null);return new b(e,a,m.doesNotDecreaseBy,!0).to.not.decrease(t,r).by(n)};m.decreasesButNotBy=function(e,t,r,n,a){if(arguments.length===4&&typeof t=="function"){let o=n;n=r,a=o}else arguments.length===3&&(n=r,r=null);new b(e,a,m.decreasesButNotBy,!0).to.decrease(t,r).but.not.by(n)};m.ifError=function(e){if(e)throw e};m.isExtensible=function(e,t){new b(e,t,m.isExtensible,!0).to.be.extensible};m.isNotExtensible=function(e,t){new b(e,t,m.isNotExtensible,!0).to.not.be.extensible};m.isSealed=function(e,t){new b(e,t,m.isSealed,!0).to.be.sealed};m.isNotSealed=function(e,t){new b(e,t,m.isNotSealed,!0).to.not.be.sealed};m.isFrozen=function(e,t){new b(e,t,m.isFrozen,!0).to.be.frozen};m.isNotFrozen=function(e,t){new b(e,t,m.isNotFrozen,!0).to.not.be.frozen};m.isEmpty=function(e,t){new b(e,t,m.isEmpty,!0).to.be.empty};m.isNotEmpty=function(e,t){new b(e,t,m.isNotEmpty,!0).to.not.be.empty};m.containsSubset=function(e,t,r){new b(e,r).to.containSubset(t)};m.doesNotContainSubset=function(e,t,r){new b(e,r).to.not.containSubset(t)};for(const[e,t]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"]])m[t]=m[e];var Va=[];function Ti(e){const t={use:Ti,AssertionError:X,util:cr,config:se,expect:kt,assert:m,Assertion:b,...Ri};return~Va.indexOf(e)||(e(t,cr),Va.push(e)),t}q(Ti,"use");var Tu=()=>(0,j.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"var(--twd-icon-color-secondary)",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"lucide lucide-loader-circle-icon lucide-loader-circle twd-loader","data-testid":"loader-icon",children:(0,j.jsx)("path",{d:"M21 12a9 9 0 1 1-6.219-8.56"})}),Br=({className:e,children:t,dataTestId:r})=>(0,j.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"var(--twd-icon-color)",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:`lucide ${e}`,"data-testid":r,children:t}),Su=()=>(0,j.jsx)(Br,{className:"lucide-play-icon lucide-play",dataTestId:"play-icon",children:(0,j.jsx)("path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z"})}),Si=({id:e,name:t,skip:r,only:n})=>(0,j.jsxs)(j.Fragment,{children:[t," ",n&&(0,j.jsxs)("span",{style:{color:"var(--twd-primary)"},"data-testid":`only-indicator-${e}`,children:[" ","(only)"]}),r&&(0,j.jsxs)("span",{style:{color:"var(--twd-text-secondary)"},"data-testid":`skip-indicator-${e}`,children:[" ","(skipped)"]})]}),Ze=(function(e){return e.CHAI_DIFF="chai-diff",e.CHAI_MESSAGE="chai-message",e.ERROR="error",e})({}),xu=e=>{try{const t=JSON.parse(e);if(t&&typeof t=="object"&&"type"in t)return t}catch{}return null},Ha=e=>{if(e===null)return"null";if(e===void 0)return"undefined";if(typeof e=="string")return e;if(typeof e=="object")try{return JSON.stringify(e,null,2)}catch{return String(e)}return String(e)},Ou=e=>e.startsWith("Assertion passed")||e.startsWith("Event fired")?{color:"var(--twd-success)",fontWeight:"var(--twd-font-weight-bold)"}:e.startsWith("Test failed")?{color:"var(--twd-error)",fontWeight:"var(--twd-font-weight-bold)"}:{},Mu=e=>e.type==="chai-message"||e.type==="error",Au=(e,t)=>t&&Mu(t)?t.message:e,Iu=({log:e,index:t})=>{const r=xu(e);if(r?.type===Ze.CHAI_DIFF)return(0,j.jsxs)("li",{style:{fontSize:"var(--twd-font-size-sm)",padding:"var(--twd-spacing-sm)",borderBottom:"1px solid var(--twd-border-light)",color:"var(--twd-text)"},children:[(0,j.jsx)("div",{style:{color:"var(--twd-error)",fontWeight:"var(--twd-font-weight-bold)",marginBottom:"var(--twd-spacing-xs)"},children:"❌ Assertion failed"}),(0,j.jsxs)("div",{style:{marginTop:"var(--twd-spacing-xs)",paddingLeft:"var(--twd-spacing-sm)",borderLeft:"2px solid var(--twd-success)"},children:[(0,j.jsx)("div",{style:{color:"var(--twd-success)",fontWeight:"var(--twd-font-weight-medium)",marginBottom:"var(--twd-spacing-xs)"},children:"Expected:"}),(0,j.jsx)("pre",{style:{margin:0,padding:"var(--twd-spacing-xs)",background:"var(--twd-background)",borderRadius:"var(--twd-border-radius)",fontSize:"var(--twd-font-size-xs)",overflowX:"auto",whiteSpace:"pre-wrap",wordBreak:"break-word"},children:Ha(r.expected)})]}),(0,j.jsxs)("div",{style:{marginTop:"var(--twd-spacing-xs)",paddingLeft:"var(--twd-spacing-sm)",borderLeft:"2px solid var(--twd-error)"},children:[(0,j.jsx)("div",{style:{color:"var(--twd-error)",fontWeight:"var(--twd-font-weight-medium)",marginBottom:"var(--twd-spacing-xs)"},children:"Actual:"}),(0,j.jsx)("pre",{style:{margin:0,padding:"var(--twd-spacing-xs)",background:"var(--twd-background)",borderRadius:"var(--twd-border-radius)",fontSize:"var(--twd-font-size-xs)",overflowX:"auto",whiteSpace:"pre-wrap",wordBreak:"break-word"},children:Ha(r.actual)})]})]},t);const n=Au(e,r);return(0,j.jsx)("li",{style:{fontSize:"var(--twd-font-size-sm)",padding:"var(--twd-spacing-xs) var(--twd-spacing-sm)",borderBottom:"1px solid var(--twd-border-light)",color:"var(--twd-text)",...Ou(n)},children:n},t)},Nu=e=>{switch(e){case"pass":return"twd-status-pass";case"fail":return"twd-status-fail";case"skip":return"twd-status-skip";case"running":return"twd-status-running";default:return""}},ku=({node:e,depth:t,id:r,runTest:n})=>{const a=(0,oe.useRef)(null),o=(0,oe.useRef)(e.status),i=(0,oe.useRef)(e.logs?.length||0),s=typeof window<"u"&&sessionStorage.getItem("twd-last-run-test-name")===e.name;(0,oe.useEffect)(()=>{const l=a.current;if(!l||!e.logs||e.logs.length===0)return;const c=o.current==="running"&&(e.status==="pass"||e.status==="fail"),d=e.logs.length>i.current;(c||d)&&setTimeout(()=>{l.scrollTop=l.scrollHeight},0),o.current=e.status,i.current=e.logs.length},[e.status,e.logs]);const u=()=>{switch(e.status){case"pass":return"passed";case"fail":return"failed";case"running":return"running";case"skip":return"skipped";default:return"not run"}};return(0,j.jsxs)("li",{style:{marginBottom:"var(--twd-spacing-xs)",marginLeft:`calc(${t} * var(--twd-spacing-sm))`},"data-testid":`test-list-item-${r}`,"data-test-name":e.name,role:"listitem","aria-label":`Test ${e.name}, status: ${u()}`,children:[(0,j.jsxs)("div",{className:`twd-test-item ${Nu(e.status)}`,style:s?{border:"1px dashed var(--twd-border)"}:void 0,children:[(0,j.jsx)("span",{className:"twd-test-item-name",children:(0,j.jsx)(Si,{id:r,name:e.name,skip:e.skip,only:e.only})}),(0,j.jsx)("button",{onClick:()=>n(r),"aria-label":`Run ${e.name} test`,className:"twd-btn twd-btn-icon",disabled:e.status==="running","data-testid":`run-test-button-${r}`,children:e.status==="running"?(0,j.jsx)(Tu,{}):(0,j.jsx)(Su,{})})]}),e.logs&&e.logs.length>0&&(0,j.jsx)("ul",{ref:a,className:"twd-test-item-logs",children:e.logs.map((l,c)=>(0,j.jsx)(Iu,{log:l,index:c},c))})]},e.name)},ju=()=>(0,j.jsx)(Br,{className:"lucide-chevron-down-icon lucide-chevron-down",dataTestId:"chevron-down-icon",children:(0,j.jsx)("path",{d:"m6 9 6 6 6-6"})}),Du=()=>(0,j.jsx)(Br,{className:"lucide-chevron-right-icon lucide-chevron-right",dataTestId:"chevron-right-icon",children:(0,j.jsx)("path",{d:"m9 18 6-6-6-6"})}),Lu=({roots:e,runTest:t,searchQuery:r=""})=>{const[n,a]=(0,oe.useState)({}),o=(0,oe.useRef)(null),i=(0,oe.useRef)(!1),s=l=>a(c=>({...c,[l]:!c[l]}));(0,oe.useEffect)(()=>{if(i.current)return;const l=sessionStorage.getItem("twd-last-run-test-name");if(!l)return;const c=setTimeout(()=>{const d=document.querySelector(`[data-test-name="${l}"]`);if(d){const p=o.current?.closest('[data-testid="twd-sidebar"]');if(p){const f=d.getBoundingClientRect(),g=p.getBoundingClientRect(),h=p.scrollTop,S=f.top-g.top+h,E=p.querySelector('[data-testid="twd-sidebar-header"]'),w=E?E.getBoundingClientRect().height+16:150;p.scrollTo({top:S-w,behavior:"smooth"})}i.current=!0}},100);return()=>clearTimeout(c)},[]);const u=(l,c=0)=>{if(l.type==="test")return(0,j.jsx)(ku,{node:l,depth:c,id:l.id,runTest:()=>{t(l.id)}},l.id);const d=n[l.id];return(0,j.jsxs)("li",{style:{marginLeft:`calc(${c} * var(--twd-spacing-lg))`},children:[(0,j.jsx)("div",{className:"twd-test-group",children:(0,j.jsxs)("span",{className:"twd-test-group-toggle","data-testid":`test-group-${l.name}`,tabIndex:0,role:"button","aria-expanded":!d,"aria-label":`${d?"Expand":"Collapse"} test suite ${l.name}`,onClick:()=>s(l.id),children:[(0,j.jsx)(Si,{id:l.id,name:l.name,skip:l.skip,only:l.only}),d?(0,j.jsx)(Du,{}):(0,j.jsx)(ju,{})]})}),!d&&l.childrenNodes&&l.childrenNodes.length>0&&(0,j.jsx)("ul",{className:"twd-test-list",children:l.childrenNodes.map(p=>u(p,c+1))})]},l.id)};return(0,j.jsx)("ul",{ref:o,className:"twd-test-list",role:"list","aria-label":"Test list",children:e.length===0&&r?(0,j.jsxs)("li",{style:{padding:"var(--twd-spacing-md)",color:"var(--twd-text-secondary)",fontSize:"var(--twd-font-size-sm)",textAlign:"center"},children:['No tests match "',r,'"']}):e.map(l=>u(l))})},Bu={left:{left:0,borderTopRightRadius:"var(--twd-border-radius-lg)",borderBottomRightRadius:"var(--twd-border-radius-lg)",borderTopLeftRadius:"0",borderBottomLeftRadius:"0"},right:{right:0,borderTopLeftRadius:"var(--twd-border-radius-lg)",borderBottomLeftRadius:"var(--twd-border-radius-lg)",borderTopRightRadius:"0",borderBottomRightRadius:"0"}},$u=({setOpen:e,position:t})=>(0,j.jsx)("button",{"aria-label":"Open TWD sidebar",className:"twd-btn twd-sidebar-closed",style:{...Bu[t]},onClick:()=>e(!0),children:"TWD"}),Fu=({isOpen:e,position:t})=>{(0,oe.useEffect)(()=>{const r=document.documentElement,n=getComputedStyle(document.documentElement).getPropertyValue("--twd-sidebar-width")||"280px";return e?t==="left"?r.style.marginLeft=n:r.style.marginRight=n:(r.style.marginRight="0",r.style.marginLeft="0"),()=>{r.style.marginRight="0",r.style.marginLeft="0"}},[e,t])},Uu=()=>(0,j.jsxs)(Br,{className:"lucide-wifi-pen-icon lucide-wifi-pen",dataTestId:"wifi-pen-icon",children:[(0,j.jsx)("path",{d:"M2 8.82a15 15 0 0 1 20 0"}),(0,j.jsx)("path",{d:"M21.378 16.626a1 1 0 0 0-3.004-3.004l-4.01 4.012a2 2 0 0 0-.506.854l-.837 2.87a.5.5 0 0 0 .62.62l2.87-.837a2 2 0 0 0 .854-.506z"}),(0,j.jsx)("path",{d:"M5 12.859a10 10 0 0 1 10.5-2.222"}),(0,j.jsx)("path",{d:"M8.5 16.429a5 5 0 0 1 3-1.406"})]}),zu=()=>{const e=xo(),t=e.filter(n=>n.executed),r=()=>{console.group("🌐 TWD Mock Rules"),console.log("Total rules:",e.length),console.log("Triggered rules:",t.length),console.log("Rules details:"),console.log(e),console.groupEnd()};return(0,j.jsxs)("button",{onClick:r,"aria-label":"View mock rules details in console",className:"twd-btn twd-btn-mock-rules",children:[(0,j.jsx)(Uu,{}),(0,j.jsxs)("span",{style:{flex:1},children:["Rules: ",t.length,"/",e.length," triggered"]}),(0,j.jsx)("span",{style:{fontSize:"var(--twd-font-size-xs)",color:"var(--twd-text)",fontWeight:"var(--twd-font-weight-medium)"},children:"View rules in console"})]})},Vu=e=>e instanceof Error&&"actual"in e&&"expected"in e,xi=e=>e.actual!==void 0&&e.expected!==void 0?{type:"diff",actual:e.actual,expected:e.expected,operator:e.operator}:{type:"message",message:e.message},Hu=e=>{const t=xi(e);if(t.type==="diff"){const r=t.operator||"unknown";console.error(`Assertion failed with operator: ${r}`),console.group("Expected:"),console.log(t.expected),console.groupEnd(),console.group("Actual:"),console.log(t.actual),console.groupEnd()}else console.error(t.message)},Wu=e=>{if(e.status==="pass")return`Test "${e.name}" passed.`;if(e.status==="fail"){if(!e.logs||e.logs.length===0)return`Test "${e.name}" failed.`;const t=e.logs[e.logs.length-1];try{const r=JSON.parse(t);return r.type===Ze.CHAI_MESSAGE||r.type===Ze.ERROR?`Test "${e.name}" failed. ${r.message}`:r.type===Ze.CHAI_DIFF?`Test "${e.name}" failed. Expected value does not match actual value.`:`Test "${e.name}" failed.`}catch{return`Test "${e.name}" failed. ${t}`}}else if(e.status==="skip")return`Test "${e.name}" skipped.`;return""},Ku=e=>{const t=e.filter(i=>i.type==="test"),r=t.filter(i=>i.status==="pass").length,n=t.filter(i=>i.status==="fail").length,a=t.filter(i=>i.status==="skip").length,o=[];return n>0?(o.push("Test run completed."),o.push(`${r} test${r!==1?"s":""} passed`),o.push(`${n} test${n!==1?"s":""} failed`),a>0&&o.push(`${a} test${a!==1?"s":""} skipped`),o.join(", ")+"."):(o.push("All tests passed."),o.push(`${r} test${r!==1?"s":""} completed`),a>0&&o.push(`${a} test${a!==1?"s":""} skipped`),o.join(", ")+".")},Gu=({value:e,onChange:t})=>(0,j.jsx)("div",{className:"twd-search-wrapper",children:(0,j.jsx)("input",{type:"search",id:"twd-search-input","aria-label":"Filter tests",placeholder:"Filter tests...",value:e,onInput:r=>t(r.target.value),className:"twd-search-input"})}),Yu=(e,t)=>{if(!t.trim())return e;const r=t.toLowerCase(),n=a=>{const o=a.name.toLowerCase().includes(r);if(a.type==="test")return o?a:null;const i=(a.childrenNodes||[]).map(n).filter(s=>s!==null);return o||i.length>0?{...a,childrenNodes:o?a.childrenNodes:i}:null};return e.map(n).filter(a=>a!==null)},Xu=e=>{const t=new Map,r=[];for(const n of e)t.set(n.id,{...n,childrenNodes:[]});for(const n of t.values())n.parent?t.get(n.parent)?.childrenNodes?.push(n):r.push(n);return r},Ju={left:{left:0,borderRight:"1px solid var(--twd-border)"},right:{right:0,borderLeft:"1px solid var(--twd-border)"}},Qu=e=>e?sessionStorage.getItem("twd-search-filter")||"":(sessionStorage.removeItem("twd-search-filter"),""),Zu=e=>sessionStorage.getItem("twd-sidebar-open")?sessionStorage.getItem("twd-sidebar-open")==="true":e,Oi=e=>{const t=[];for(const r of e)r.type==="test"&&t.push(r.id),r.childrenNodes&&t.push(...Oi(r.childrenNodes));return t},ec=({open:e,position:t="left",search:r})=>{const[n,a]=(0,oe.useState)(0),[o,i]=(0,oe.useState)(Zu(e));Fu({isOpen:o,position:t});const[s,u]=(0,oe.useState)(""),[l,c]=(0,oe.useState)(Qu(r));(0,oe.useEffect)(()=>{const y=()=>a(v=>v+1);return window.addEventListener("twd:state-change",y),()=>window.removeEventListener("twd:state-change",y)},[]);const d=new Mt.TestRunner({onStart:y=>{y.status="running",a(v=>v+1)},onPass:y=>{y.status="pass",a(v=>v+1)},onFail:(y,v)=>{if(y.status="fail",console.group(`%c❌ Test failed: ${y.name}`,"color: red; font-weight: bold;"),Vu(v)){Hu(v);const _=xi(v);_.type==="diff"?y.logs.push(JSON.stringify({type:Ze.CHAI_DIFF,expected:_.expected,actual:_.actual})):y.logs.push(JSON.stringify({type:Ze.CHAI_MESSAGE,message:`Test failed: ${_.message}`}))}else console.error(v.message),y.logs.push(JSON.stringify({type:Ze.ERROR,message:`Test failed: ${v.message}`}));console.groupEnd(),a(_=>_+1)},onSkip:y=>{y.status="skip",a(v=>v+1)}}),p=y=>{c(y),y?sessionStorage.setItem("twd-search-filter",y):sessionStorage.removeItem("twd-search-filter")},f=y=>{i(y),sessionStorage.setItem("twd-sidebar-open",y.toString())},g=Array.from(Mt.handlers.values()),h=(0,oe.useMemo)(()=>Xu(g),[n]),S=(0,oe.useMemo)(()=>Yu(h,l),[h,l]),{filteredTestIds:E,displayTests:w}=(0,oe.useMemo)(()=>{if(l){const y=Oi(S),v=new Set(y);return{filteredTestIds:y,displayTests:g.filter(_=>_.type==="test"&&v.has(_.id))}}return{filteredTestIds:null,displayTests:g.filter(y=>y.type==="test")}},[S,l,n]),x=async()=>{u(""),sessionStorage.removeItem("twd-last-run-test-name"),E?await d.runByIds(E):await d.runAll(),u(Ku(g))},M=async y=>{const v=Array.from(Mt.handlers.values()).filter(_=>_.type==="test").find(_=>_.id===y);v&&(u(""),sessionStorage.setItem("twd-last-run-test-name",v.name),await d.runSingle(v.id),u(Wu(v)))};if(!o)return(0,j.jsx)($u,{position:t,setOpen:f});const A=w.length;return(0,j.jsxs)("div",{className:"twd-sidebar",style:Ju[t],"data-testid":"twd-sidebar",role:"complementary","aria-label":"Test While Developing sidebar",children:[(0,j.jsx)("div",{"aria-live":"polite","aria-atomic":"true",style:{position:"absolute",width:"1px",height:"1px",margin:"-1px",border:"0",padding:"0",overflow:"hidden",clip:"rect(0 0 0 0)"},children:s}),(0,j.jsxs)("div",{"data-testid":"twd-sidebar-header",className:"twd-sidebar-header",children:[(0,j.jsxs)("div",{className:"twd-sidebar-header-row",children:[(0,j.jsxs)("div",{className:"twd-sidebar-header-buttons",children:[(0,j.jsx)("button",{onClick:()=>{x()},className:"twd-btn twd-btn-primary",children:(0,j.jsx)("span",{"aria-live":"polite",children:l?"Run Filtered":"Run All"})}),(0,j.jsx)("button",{onClick:()=>{Oo(),tn.clearComponentMocks()},"aria-label":"Clear all mocks",className:"twd-btn twd-btn-secondary",children:"Clear mocks"}),(0,j.jsxs)("span",{className:"twd-sidebar-version",children:["v",Tr]})]}),(0,j.jsx)("button",{"aria-label":"Close sidebar",className:"twd-btn twd-btn-icon",onClick:()=>f(!1),children:"✖"})]}),(0,j.jsxs)("div",{className:"twd-sidebar-stats",children:[(0,j.jsxs)("span",{style:{color:"var(--twd-text)"},children:["Total: ",A]}),(0,j.jsxs)("div",{className:"twd-sidebar-stats-counts",children:[(0,j.jsxs)("span",{style:{color:"var(--twd-success)"},children:["✓ ",w.filter(y=>y.status==="pass").length]}),(0,j.jsxs)("span",{style:{color:"var(--twd-error)"},children:["✗ ",w.filter(y=>y.status==="fail").length]})]})]}),(0,j.jsx)(zu,{}),r&&(0,j.jsx)(Gu,{value:l,onChange:p})]}),(0,j.jsx)("div",{className:"twd-sidebar-content",children:(0,j.jsx)(Lu,{roots:S,runTest:M,searchQuery:l})})]})},Mi={primary:"#2563eb",background:"#1e293b",backgroundSecondary:"#182130",border:"#475569",borderLight:"#64748b",text:"#f1f5f9",textSecondary:"#cbd5e1",textMuted:"#94a3b8",describeBg:"#0f172a",describeText:"#94a3b8",describeBorder:"#334155",success:"#22c55e",successBg:"#14532d",error:"#ff5252",errorBg:"#7f1d1d",warning:"#fbbf24",warningBg:"#78350f",skip:"#475569",skipBg:"#334155",buttonPrimary:"#2563eb",buttonPrimaryText:"#ffffff",buttonSecondary:"#334155",buttonSecondaryText:"#f1f5f9",buttonBorder:"#475569",spacingXs:"4px",spacingSm:"6px",spacingMd:"8px",spacingLg:"12px",spacingXl:"14px",fontSizeXs:"10px",fontSizeSm:"12px",fontSizeMd:"14px",fontSizeLg:"16px",fontWeightNormal:"400",fontWeightMedium:"500",fontWeightBold:"700",sidebarWidth:"320px",borderRadius:"8px",borderRadiusLg:"6px",shadow:"2px 0 8px rgba(0,0,0,0.3)",shadowSm:"0 2px 4px rgba(0, 0, 0, 0.2)",zIndexSidebar:"99999",zIndexSticky:"100000",animationDuration:"0.2s",iconColor:"#f1f5f9",iconColorSecondary:"#cbd5e1"};function tc(e={}){const t={...Mi,...e};return Object.entries(t).map(([r,n])=>`${`--twd-${r.replace(/([A-Z])/g,"-$1").toLowerCase()}`}: ${n};`).join(`
|
|
20
|
+
`)}q(dr,"inspectNodeCollection");function ii(e,t){switch(e.nodeType){case 1:return jn(e,t);case 3:return t.inspect(e.data,t);default:return t.inspect(e,t)}}q(ii,"inspectNode");function jn(e,t){const r=e.getAttributeNames(),n=e.tagName.toLowerCase(),a=t.stylize(`<${n}`,"special"),o=t.stylize(">","special"),i=t.stylize(`</${n}>`,"special");t.truncate-=n.length*2+5;let s="";r.length>0&&(s+=" ",s+=be(r.map(c=>[c,e.getAttribute(c)]),t,oi," ")),t.truncate-=s.length;const u=t.truncate;let l=dr(e.children,t);return l&&l.length>u&&(l=`${pt}(${e.children.length})`),`${a}${s}${o}${l}${i}`}q(jn,"inspectHTML");var Wr=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("chai/inspect"):"@@chai/inspect",Kr=Symbol.for("nodejs.util.inspect.custom"),La=new WeakMap,Ba={},$a={undefined:q((e,t)=>t.stylize("undefined","undefined"),"undefined"),null:q((e,t)=>t.stylize("null","null"),"null"),boolean:q((e,t)=>t.stylize(String(e),"boolean"),"boolean"),Boolean:q((e,t)=>t.stylize(String(e),"boolean"),"Boolean"),number:sn,Number:sn,bigint:ln,BigInt:ln,string:un,String:un,function:on,Function:on,symbol:cn,Symbol:cn,Array:Ko,Date:Go,Map:Jo,Set:ei,RegExp:Qo,Promise:bu,WeakSet:q((e,t)=>t.stylize("WeakSet{…}","special"),"WeakSet"),WeakMap:q((e,t)=>t.stylize("WeakMap{…}","special"),"WeakMap"),Arguments:ni,Int8Array:_e,Uint8Array:_e,Uint8ClampedArray:_e,Int16Array:_e,Uint16Array:_e,Int32Array:_e,Uint32Array:_e,Float32Array:_e,Float64Array:_e,Generator:q(()=>"","Generator"),DataView:q(()=>"","DataView"),ArrayBuffer:q(()=>"","ArrayBuffer"),Error:ai,HTMLCollection:dr,NodeList:dr},vu=q((e,t,r,n)=>Wr in e&&typeof e[Wr]=="function"?e[Wr](t):Kr in e&&typeof e[Kr]=="function"?e[Kr](t.depth,t,n):"inspect"in e&&typeof e.inspect=="function"?e.inspect(t.depth,t):"constructor"in e&&La.has(e.constructor)?La.get(e.constructor)(e,t):Ba[r]?Ba[r](e,t):"","inspectCustom"),gu=Object.prototype.toString;function It(e,t={}){const r=Vo(t,It),{customInspect:n}=r;let a=e===null?"null":typeof e;if(a==="object"&&(a=gu.call(e).slice(8,-1)),a in $a)return $a[a](e,r);if(n&&e){const i=vu(e,r,a,It);if(i)return typeof i=="string"?i:It(i,r)}const o=e?Object.getPrototypeOf(e):!1;return o===Object.prototype||o===null?At(e,r):e&&typeof HTMLElement=="function"&&e instanceof HTMLElement?jn(e,r):"constructor"in e?e.constructor!==Object?ri(e,r):At(e,r):e===Object(e)?At(e,r):r.stylize(String(e),a)}q(It,"inspect");var se={includeStack:!1,showDiff:!0,truncateThreshold:40,useProxy:!0,proxyExcludedKeys:["then","catch","inspect","toJSON"],deepEqual:null};function K(e,t,r,n){return It(e,{colors:n,depth:typeof r>"u"?2:r,showHidden:t,truncate:se.truncateThreshold?se.truncateThreshold:1/0})}q(K,"inspect");function Qe(e){let t=K(e),r=Object.prototype.toString.call(e);if(se.truncateThreshold&&t.length>=se.truncateThreshold){if(r==="[object Function]")return!e.name||e.name===""?"[Function]":"[Function: "+e.name+"]";if(r==="[object Array]")return"[ Array("+e.length+") ]";if(r==="[object Object]"){let n=Object.keys(e);return"{ Object ("+(n.length>2?n.splice(0,2).join(", ")+", ...":n.join(", "))+") }"}else return t}else return t}q(Qe,"objDisplay");function Dn(e,t){let r=U(e,"negate"),n=U(e,"object"),a=t[3],o=xr(e,t),i=r?t[2]:t[1],s=U(e,"message");return typeof i=="function"&&(i=i()),i=i||"",i=i.replace(/#\{this\}/g,function(){return Qe(n)}).replace(/#\{act\}/g,function(){return Qe(o)}).replace(/#\{exp\}/g,function(){return Qe(a)}),s?s+": "+i:i}q(Dn,"getMessage");function ye(e,t,r){let n=e.__flags||(e.__flags=Object.create(null));t.__flags||(t.__flags=Object.create(null)),r=arguments.length===3?r:!0;for(let a in n)(r||a!=="object"&&a!=="ssfi"&&a!=="lockSsfi"&&a!="message")&&(t.__flags[a]=n[a])}q(ye,"transferFlags");function dn(e){if(typeof e>"u")return"undefined";if(e===null)return"null";const t=e[Symbol.toStringTag];return typeof t=="string"?t:Object.prototype.toString.call(e).slice(8,-1)}q(dn,"type");function Ln(){this._key="chai/deep-eql__"+Math.random()+Date.now()}q(Ln,"FakeMap");Ln.prototype={get:q(function(t){return t[this._key]},"get"),set:q(function(t,r){Object.isExtensible(t)&&Object.defineProperty(t,this._key,{value:r,configurable:!0})},"set")};var si=typeof WeakMap=="function"?WeakMap:Ln;function fn(e,t,r){if(!r||rt(e)||rt(t))return null;var n=r.get(e);if(n){var a=n.get(t);if(typeof a=="boolean")return a}return null}q(fn,"memoizeCompare");function Tt(e,t,r,n){if(!(!r||rt(e)||rt(t))){var a=r.get(e);a?a.set(t,n):(a=new si,a.set(t,n),r.set(e,a))}}q(Tt,"memoizeSet");var li=Ut;function Ut(e,t,r){if(r&&r.comparator)return pn(e,t,r);var n=Bn(e,t);return n!==null?n:pn(e,t,r)}q(Ut,"deepEqual");function Bn(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t?!0:rt(e)||rt(t)?!1:null}q(Bn,"simpleEqual");function pn(e,t,r){r=r||{},r.memoize=r.memoize===!1?!1:r.memoize||new si;var n=r&&r.comparator,a=fn(e,t,r.memoize);if(a!==null)return a;var o=fn(t,e,r.memoize);if(o!==null)return o;if(n){var i=n(e,t);if(i===!1||i===!0)return Tt(e,t,r.memoize,i),i;var s=Bn(e,t);if(s!==null)return s}var u=dn(e);if(u!==dn(t))return Tt(e,t,r.memoize,!1),!1;Tt(e,t,r.memoize,!0);var l=ui(e,t,u,r);return Tt(e,t,r.memoize,l),l}q(pn,"extensiveDeepEqual");function ui(e,t,r,n){switch(r){case"String":case"Number":case"Boolean":case"Date":return Ut(e.valueOf(),t.valueOf());case"Promise":case"Symbol":case"function":case"WeakMap":case"WeakSet":return e===t;case"Error":return $n(e,t,["name","message","code"],n);case"Arguments":case"Int8Array":case"Uint8Array":case"Uint8ClampedArray":case"Int16Array":case"Uint16Array":case"Int32Array":case"Uint32Array":case"Float32Array":case"Float64Array":case"Array":return Ue(e,t,n);case"RegExp":return ci(e,t);case"Generator":return di(e,t,n);case"DataView":return Ue(new Uint8Array(e.buffer),new Uint8Array(t.buffer),n);case"ArrayBuffer":return Ue(new Uint8Array(e),new Uint8Array(t),n);case"Set":return mn(e,t,n);case"Map":return mn(e,t,n);case"Temporal.PlainDate":case"Temporal.PlainTime":case"Temporal.PlainDateTime":case"Temporal.Instant":case"Temporal.ZonedDateTime":case"Temporal.PlainYearMonth":case"Temporal.PlainMonthDay":return e.equals(t);case"Temporal.Duration":return e.total("nanoseconds")===t.total("nanoseconds");case"Temporal.TimeZone":case"Temporal.Calendar":return e.toString()===t.toString();default:return pi(e,t,n)}}q(ui,"extensiveDeepEqualByType");function ci(e,t){return e.toString()===t.toString()}q(ci,"regexpEqual");function mn(e,t,r){try{if(e.size!==t.size)return!1;if(e.size===0)return!0}catch{return!1}var n=[],a=[];return e.forEach(q(function(i,s){n.push([i,s])},"gatherEntries")),t.forEach(q(function(i,s){a.push([i,s])},"gatherEntries")),Ue(n.sort(),a.sort(),r)}q(mn,"entriesEqual");function Ue(e,t,r){var n=e.length;if(n!==t.length)return!1;if(n===0)return!0;for(var a=-1;++a<n;)if(Ut(e[a],t[a],r)===!1)return!1;return!0}q(Ue,"iterableEqual");function di(e,t,r){return Ue(fr(e),fr(t),r)}q(di,"generatorEqual");function fi(e){return typeof Symbol<"u"&&typeof e=="object"&&typeof Symbol.iterator<"u"&&typeof e[Symbol.iterator]=="function"}q(fi,"hasIteratorFunction");function bn(e){if(fi(e))try{return fr(e[Symbol.iterator]())}catch{return[]}return[]}q(bn,"getIteratorEntries");function fr(e){for(var t=e.next(),r=[t.value];t.done===!1;)t=e.next(),r.push(t.value);return r}q(fr,"getGeneratorEntries");function hn(e){var t=[];for(var r in e)t.push(r);return t}q(hn,"getEnumerableKeys");function vn(e){for(var t=[],r=Object.getOwnPropertySymbols(e),n=0;n<r.length;n+=1){var a=r[n];Object.getOwnPropertyDescriptor(e,a).enumerable&&t.push(a)}return t}q(vn,"getEnumerableSymbols");function $n(e,t,r,n){var a=r.length;if(a===0)return!0;for(var o=0;o<a;o+=1)if(Ut(e[r[o]],t[r[o]],n)===!1)return!1;return!0}q($n,"keysEqual");function pi(e,t,r){var n=hn(e),a=hn(t),o=vn(e),i=vn(t);if(n=n.concat(o),a=a.concat(i),n.length&&n.length===a.length)return Ue(gn(n).sort(),gn(a).sort())===!1?!1:$n(e,t,n,r);var s=bn(e),u=bn(t);return s.length&&s.length===u.length?(s.sort(),u.sort(),Ue(s,u,r)):n.length===0&&s.length===0&&a.length===0&&u.length===0}q(pi,"objectEqual");function rt(e){return e===null||typeof e!="object"}q(rt,"isPrimitive");function gn(e){return e.map(q(function(r){return typeof r=="symbol"?r.toString():r},"mapSymbol"))}q(gn,"mapSymbols");function Or(e,t){return typeof e>"u"||e===null?!1:t in Object(e)}q(Or,"hasProperty");function mi(e){return e.replace(/([^\\])\[/g,"$1.[").match(/(\\\.|[^.]+?)+/g).map(t=>{if(t==="constructor"||t==="__proto__"||t==="prototype")return{};const r=/^\[(\d+)\]$/.exec(t);let n=null;return r?n={i:parseFloat(r[1])}:n={p:t.replace(/\\([.[\]])/g,"$1")},n})}q(mi,"parsePath");function yn(e,t,r){let n=e,a=null;r=typeof r>"u"?t.length:r;for(let o=0;o<r;o++){const i=t[o];n&&(typeof i.p>"u"?n=n[i.i]:n=n[i.p],o===r-1&&(a=n))}return a}q(yn,"internalGetPathValue");function Fn(e,t){const r=mi(t),n=r[r.length-1],a={parent:r.length>1?yn(e,r,r.length-1):e,name:n.p||n.i,value:yn(e,r)};return a.exists=Or(a.parent,a.name),a}q(Fn,"getPathInfo");var bi=class hi{constructor(t,r,n,a){return Io(this,"__flags",{}),U(this,"ssfi",n||hi),U(this,"lockSsfi",a),U(this,"object",t),U(this,"message",r),U(this,"eql",se.deepEqual||li),Et(this)}static get includeStack(){return console.warn("Assertion.includeStack is deprecated, use chai.config.includeStack instead."),se.includeStack}static set includeStack(t){console.warn("Assertion.includeStack is deprecated, use chai.config.includeStack instead."),se.includeStack=t}static get showDiff(){return console.warn("Assertion.showDiff is deprecated, use chai.config.showDiff instead."),se.showDiff}static set showDiff(t){console.warn("Assertion.showDiff is deprecated, use chai.config.showDiff instead."),se.showDiff=t}static addProperty(t,r){zn(this.prototype,t,r)}static addMethod(t,r){Vn(this.prototype,t,r)}static addChainableMethod(t,r,n){Kn(this.prototype,t,r,n)}static overwriteProperty(t,r){Hn(this.prototype,t,r)}static overwriteMethod(t,r){Wn(this.prototype,t,r)}static overwriteChainableMethod(t,r,n){Gn(this.prototype,t,r,n)}assert(t,r,n,a,o,i){const s=kn(this,arguments);if(i!==!1&&(i=!0),a===void 0&&o===void 0&&(i=!1),se.showDiff!==!0&&(i=!1),!s){r=Dn(this,arguments);const u={actual:xr(this,arguments),expected:a,showDiff:i},l=Jn(this,arguments);throw l&&(u.operator=l),new X(r,u,se.includeStack?this.assert:U(this,"ssfi"))}}get _obj(){return U(this,"object")}set _obj(t){U(this,"object",t)}};q(bi,"Assertion");var b=bi,Mr=new EventTarget,vi=class extends Event{constructor(t,r,n){super(t),this.name=String(r),this.fn=n}};q(vi,"PluginEvent");var Un=vi;function zt(){return se.useProxy&&typeof Proxy<"u"&&typeof Reflect<"u"}q(zt,"isProxyEnabled");function zn(e,t,r){r=r===void 0?function(){}:r,Object.defineProperty(e,t,{get:q(function n(){!zt()&&!U(this,"lockSsfi")&&U(this,"ssfi",n);let a=r.call(this);if(a!==void 0)return a;let o=new b;return ye(this,o),o},"propertyGetter"),configurable:!0}),Mr.dispatchEvent(new Un("addProperty",t,r))}q(zn,"addProperty");var yu=Object.getOwnPropertyDescriptor(function(){},"length");function Vt(e,t,r){return yu.configurable&&Object.defineProperty(e,"length",{get:q(function(){throw Error(r?"Invalid Chai property: "+t+'.length. Due to a compatibility issue, "length" cannot directly follow "'+t+'". Use "'+t+'.lengthOf" instead.':"Invalid Chai property: "+t+'.length. See docs for proper usage of "'+t+'".')},"get")}),e}q(Vt,"addLengthGuard");function gi(e){let t=Object.getOwnPropertyNames(e);function r(a){t.indexOf(a)===-1&&t.push(a)}q(r,"addProperty");let n=Object.getPrototypeOf(e);for(;n!==null;)Object.getOwnPropertyNames(n).forEach(r),n=Object.getPrototypeOf(n);return t}q(gi,"getProperties");var Fa=["__flags","__methods","_obj","assert"];function Et(e,t){return zt()?new Proxy(e,{get:q(function r(n,a){if(typeof a=="string"&&se.proxyExcludedKeys.indexOf(a)===-1&&!Reflect.has(n,a)){if(t)throw Error("Invalid Chai property: "+t+"."+a+'. See docs for proper usage of "'+t+'".');let o=null,i=4;throw gi(n).forEach(function(s){if(!Object.prototype.hasOwnProperty(s)&&Fa.indexOf(s)===-1){let u=yi(a,s,i);u<i&&(o=s,i=u)}}),Error(o!==null?"Invalid Chai property: "+a+'. Did you mean "'+o+'"?':"Invalid Chai property: "+a)}return Fa.indexOf(a)===-1&&!U(n,"lockSsfi")&&U(n,"ssfi",r),Reflect.get(n,a)},"proxyGetter")}):e}q(Et,"proxify");function yi(e,t,r){if(Math.abs(e.length-t.length)>=r)return r;let n=[];for(let a=0;a<=e.length;a++)n[a]=Array(t.length+1).fill(0),n[a][0]=a;for(let a=0;a<t.length;a++)n[0][a]=a;for(let a=1;a<=e.length;a++){let o=e.charCodeAt(a-1);for(let i=1;i<=t.length;i++){if(Math.abs(a-i)>=r){n[a][i]=r;continue}n[a][i]=Math.min(n[a-1][i]+1,n[a][i-1]+1,n[a-1][i-1]+(o===t.charCodeAt(i-1)?0:1))}}return n[e.length][t.length]}q(yi,"stringDistanceCapped");function Vn(e,t,r){let n=q(function(){U(this,"lockSsfi")||U(this,"ssfi",n);let a=r.apply(this,arguments);if(a!==void 0)return a;let o=new b;return ye(this,o),o},"methodWrapper");Vt(n,t,!1),e[t]=Et(n,t),Mr.dispatchEvent(new Un("addMethod",t,r))}q(Vn,"addMethod");function Hn(e,t,r){let n=Object.getOwnPropertyDescriptor(e,t),a=q(function(){},"_super");n&&typeof n.get=="function"&&(a=n.get),Object.defineProperty(e,t,{get:q(function o(){!zt()&&!U(this,"lockSsfi")&&U(this,"ssfi",o);let i=U(this,"lockSsfi");U(this,"lockSsfi",!0);let s=r(a).call(this);if(U(this,"lockSsfi",i),s!==void 0)return s;let u=new b;return ye(this,u),u},"overwritingPropertyGetter"),configurable:!0})}q(Hn,"overwriteProperty");function Wn(e,t,r){let n=e[t],a=q(function(){throw new Error(t+" is not a function")},"_super");n&&typeof n=="function"&&(a=n);let o=q(function(){U(this,"lockSsfi")||U(this,"ssfi",o);let i=U(this,"lockSsfi");U(this,"lockSsfi",!0);let s=r(a).apply(this,arguments);if(U(this,"lockSsfi",i),s!==void 0)return s;let u=new b;return ye(this,u),u},"overwritingMethodWrapper");Vt(o,t,!1),e[t]=Et(o,t)}q(Wn,"overwriteMethod");var wu=typeof Object.setPrototypeOf=="function",Ua=q(function(){},"testFn"),Eu=Object.getOwnPropertyNames(Ua).filter(function(e){let t=Object.getOwnPropertyDescriptor(Ua,e);return typeof t!="object"?!0:!t.configurable}),_u=Function.prototype.call,Cu=Function.prototype.apply,wi=class extends Un{constructor(t,r,n,a){super(t,r,n),this.chainingBehavior=a}};q(wi,"PluginAddChainableMethodEvent");var Pu=wi;function Kn(e,t,r,n){typeof n!="function"&&(n=q(function(){},"chainingBehavior"));let a={method:r,chainingBehavior:n};e.__methods||(e.__methods={}),e.__methods[t]=a,Object.defineProperty(e,t,{get:q(function(){a.chainingBehavior.call(this);let i=q(function(){U(this,"lockSsfi")||U(this,"ssfi",i);let s=a.method.apply(this,arguments);if(s!==void 0)return s;let u=new b;return ye(this,u),u},"chainableMethodWrapper");if(Vt(i,t,!0),wu){let s=Object.create(this);s.call=_u,s.apply=Cu,Object.setPrototypeOf(i,s)}else Object.getOwnPropertyNames(e).forEach(function(s){Eu.indexOf(s)===-1&&Object.defineProperty(i,s,Object.getOwnPropertyDescriptor(e,s))});return ye(this,i),Et(i)},"chainableMethodGetter"),configurable:!0}),Mr.dispatchEvent(new Pu("addChainableMethod",t,r,n))}q(Kn,"addChainableMethod");function Gn(e,t,r,n){let a=e.__methods[t],o=a.chainingBehavior;a.chainingBehavior=q(function(){let u=n(o).call(this);if(u!==void 0)return u;let l=new b;return ye(this,l),l},"overwritingChainableMethodGetter");let i=a.method;a.method=q(function(){let u=r(i).apply(this,arguments);if(u!==void 0)return u;let l=new b;return ye(this,l),l},"overwritingChainableMethodWrapper")}q(Gn,"overwriteChainableMethod");function pr(e,t){return K(e)<K(t)?-1:1}q(pr,"compareByInspect");function Yn(e){return typeof Object.getOwnPropertySymbols!="function"?[]:Object.getOwnPropertySymbols(e).filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})}q(Yn,"getOwnEnumerablePropertySymbols");function Xn(e){return Object.keys(e).concat(Yn(e))}q(Xn,"getOwnEnumerableProperties");var mr=Number.isNaN;function Ei(e){let t=J(e);return["Array","Object","Function"].indexOf(t)!==-1}q(Ei,"isObjectType");function Jn(e,t){let r=U(e,"operator"),n=U(e,"negate"),a=t[3],o=n?t[2]:t[1];if(r)return r;if(typeof o=="function"&&(o=o()),o=o||"",!o||/\shave\s/.test(o))return;let i=Ei(a);return/\snot\s/.test(o)?i?"notDeepStrictEqual":"notStrictEqual":i?"deepStrictEqual":"strictEqual"}q(Jn,"getOperator");function Ar(e){return e.name}q(Ar,"getName");function br(e){return Object.prototype.toString.call(e)==="[object RegExp]"}q(br,"isRegExp");function ae(e){return["Number","BigInt"].includes(J(e))}q(ae,"isNumeric");var{flag:C}=cr;["to","be","been","is","and","has","have","with","that","which","at","of","same","but","does","still","also"].forEach(function(e){b.addProperty(e)});b.addProperty("not",function(){C(this,"negate",!0)});b.addProperty("deep",function(){C(this,"deep",!0)});b.addProperty("nested",function(){C(this,"nested",!0)});b.addProperty("own",function(){C(this,"own",!0)});b.addProperty("ordered",function(){C(this,"ordered",!0)});b.addProperty("any",function(){C(this,"any",!0),C(this,"all",!1)});b.addProperty("all",function(){C(this,"all",!0),C(this,"any",!1)});var za={function:["function","asyncfunction","generatorfunction","asyncgeneratorfunction"],asyncfunction:["asyncfunction","asyncgeneratorfunction"],generatorfunction:["generatorfunction","asyncgeneratorfunction"],asyncgeneratorfunction:["asyncgeneratorfunction"]};function Qn(e,t){t&&C(this,"message",t),e=e.toLowerCase();let r=C(this,"object"),n=~["a","e","i","o","u"].indexOf(e.charAt(0))?"an ":"a ";const a=J(r).toLowerCase();za.function.includes(e)?this.assert(za[e].includes(a),"expected #{this} to be "+n+e,"expected #{this} not to be "+n+e):this.assert(e===a,"expected #{this} to be "+n+e,"expected #{this} not to be "+n+e)}q(Qn,"an");b.addChainableMethod("an",Qn);b.addChainableMethod("a",Qn);function _i(e,t){return mr(e)&&mr(t)||e===t}q(_i,"SameValueZero");function Ht(){C(this,"contains",!0)}q(Ht,"includeChainingBehavior");function Wt(e,t){t&&C(this,"message",t);let r=C(this,"object"),n=J(r).toLowerCase(),a=C(this,"message"),o=C(this,"negate"),i=C(this,"ssfi"),s=C(this,"deep"),u=s?"deep ":"",l=s?C(this,"eql"):_i;a=a?a+": ":"";let c=!1;switch(n){case"string":c=r.indexOf(e)!==-1;break;case"weakset":if(s)throw new X(a+"unable to use .deep.include with WeakSet",void 0,i);c=r.has(e);break;case"map":r.forEach(function(d){c=c||l(d,e)});break;case"set":s?r.forEach(function(d){c=c||l(d,e)}):c=r.has(e);break;case"array":s?c=r.some(function(d){return l(d,e)}):c=r.indexOf(e)!==-1;break;default:{if(e!==Object(e))throw new X(a+"the given combination of arguments ("+n+" and "+J(e).toLowerCase()+") is invalid for this assertion. You can use an array, a map, an object, a set, a string, or a weakset instead of a "+J(e).toLowerCase(),void 0,i);let d=Object.keys(e),p=null,f=0;if(d.forEach(function(g){let h=new b(r);if(ye(this,h,!0),C(h,"lockSsfi",!0),!o||d.length===1){h.property(g,e[g]);return}try{h.property(g,e[g])}catch(S){if(!de.compatibleConstructor(S,X))throw S;p===null&&(p=S),f++}},this),o&&d.length>1&&f===d.length)throw p;return}}this.assert(c,"expected #{this} to "+u+"include "+K(e),"expected #{this} to not "+u+"include "+K(e))}q(Wt,"include");b.addChainableMethod("include",Wt,Ht);b.addChainableMethod("contain",Wt,Ht);b.addChainableMethod("contains",Wt,Ht);b.addChainableMethod("includes",Wt,Ht);b.addProperty("ok",function(){this.assert(C(this,"object"),"expected #{this} to be truthy","expected #{this} to be falsy")});b.addProperty("true",function(){this.assert(C(this,"object")===!0,"expected #{this} to be true","expected #{this} to be false",!C(this,"negate"))});b.addProperty("numeric",function(){const e=C(this,"object");this.assert(["Number","BigInt"].includes(J(e)),"expected #{this} to be numeric","expected #{this} to not be numeric",!C(this,"negate"))});b.addProperty("callable",function(){const e=C(this,"object"),t=C(this,"ssfi"),r=C(this,"message"),n=r?`${r}: `:"",a=C(this,"negate"),o=a?`${n}expected ${K(e)} not to be a callable function`:`${n}expected ${K(e)} to be a callable function`,i=["Function","AsyncFunction","GeneratorFunction","AsyncGeneratorFunction"].includes(J(e));if(i&&a||!i&&!a)throw new X(o,void 0,t)});b.addProperty("false",function(){this.assert(C(this,"object")===!1,"expected #{this} to be false","expected #{this} to be true",!!C(this,"negate"))});b.addProperty("null",function(){this.assert(C(this,"object")===null,"expected #{this} to be null","expected #{this} not to be null")});b.addProperty("undefined",function(){this.assert(C(this,"object")===void 0,"expected #{this} to be undefined","expected #{this} not to be undefined")});b.addProperty("NaN",function(){this.assert(mr(C(this,"object")),"expected #{this} to be NaN","expected #{this} not to be NaN")});function Zn(){let e=C(this,"object");this.assert(e!=null,"expected #{this} to exist","expected #{this} to not exist")}q(Zn,"assertExist");b.addProperty("exist",Zn);b.addProperty("exists",Zn);b.addProperty("empty",function(){let e=C(this,"object"),t=C(this,"ssfi"),r=C(this,"message"),n;switch(r=r?r+": ":"",J(e).toLowerCase()){case"array":case"string":n=e.length;break;case"map":case"set":n=e.size;break;case"weakmap":case"weakset":throw new X(r+".empty was passed a weak collection",void 0,t);case"function":throw new X((r+".empty was passed a function "+Ar(e)).trim(),void 0,t);default:if(e!==Object(e))throw new X(r+".empty was passed non-string primitive "+K(e),void 0,t);n=Object.keys(e).length}this.assert(n===0,"expected #{this} to be empty","expected #{this} not to be empty")});function ea(){let e=J(C(this,"object"));this.assert(e==="Arguments","expected #{this} to be arguments but got "+e,"expected #{this} to not be arguments")}q(ea,"checkArguments");b.addProperty("arguments",ea);b.addProperty("Arguments",ea);function Ir(e,t){t&&C(this,"message",t);let r=C(this,"object");if(C(this,"deep")){let n=C(this,"lockSsfi");C(this,"lockSsfi",!0),this.eql(e),C(this,"lockSsfi",n)}else this.assert(e===r,"expected #{this} to equal #{exp}","expected #{this} to not equal #{exp}",e,this._obj,!0)}q(Ir,"assertEqual");b.addMethod("equal",Ir);b.addMethod("equals",Ir);b.addMethod("eq",Ir);function ta(e,t){t&&C(this,"message",t);let r=C(this,"eql");this.assert(r(e,C(this,"object")),"expected #{this} to deeply equal #{exp}","expected #{this} to not deeply equal #{exp}",e,this._obj,!0)}q(ta,"assertEql");b.addMethod("eql",ta);b.addMethod("eqls",ta);function Nr(e,t){t&&C(this,"message",t);let r=C(this,"object"),n=C(this,"doLength"),a=C(this,"message"),o=a?a+": ":"",i=C(this,"ssfi"),s=J(r).toLowerCase(),u=J(e).toLowerCase();if(n&&s!=="map"&&s!=="set"&&new b(r,a,i,!0).to.have.property("length"),!n&&s==="date"&&u!=="date")throw new X(o+"the argument to above must be a date",void 0,i);if(!ae(e)&&(n||ae(r)))throw new X(o+"the argument to above must be a number",void 0,i);if(!n&&s!=="date"&&!ae(r)){let l=s==="string"?"'"+r+"'":r;throw new X(o+"expected "+l+" to be a number or a date",void 0,i)}if(n){let l="length",c;s==="map"||s==="set"?(l="size",c=r.size):c=r.length,this.assert(c>e,"expected #{this} to have a "+l+" above #{exp} but got #{act}","expected #{this} to not have a "+l+" above #{exp}",e,c)}else this.assert(r>e,"expected #{this} to be above #{exp}","expected #{this} to be at most #{exp}",e)}q(Nr,"assertAbove");b.addMethod("above",Nr);b.addMethod("gt",Nr);b.addMethod("greaterThan",Nr);function kr(e,t){t&&C(this,"message",t);let r=C(this,"object"),n=C(this,"doLength"),a=C(this,"message"),o=a?a+": ":"",i=C(this,"ssfi"),s=J(r).toLowerCase(),u=J(e).toLowerCase(),l,c=!0;if(n&&s!=="map"&&s!=="set"&&new b(r,a,i,!0).to.have.property("length"),!n&&s==="date"&&u!=="date")l=o+"the argument to least must be a date";else if(!ae(e)&&(n||ae(r)))l=o+"the argument to least must be a number";else if(!n&&s!=="date"&&!ae(r)){let d=s==="string"?"'"+r+"'":r;l=o+"expected "+d+" to be a number or a date"}else c=!1;if(c)throw new X(l,void 0,i);if(n){let d="length",p;s==="map"||s==="set"?(d="size",p=r.size):p=r.length,this.assert(p>=e,"expected #{this} to have a "+d+" at least #{exp} but got #{act}","expected #{this} to have a "+d+" below #{exp}",e,p)}else this.assert(r>=e,"expected #{this} to be at least #{exp}","expected #{this} to be below #{exp}",e)}q(kr,"assertLeast");b.addMethod("least",kr);b.addMethod("gte",kr);b.addMethod("greaterThanOrEqual",kr);function jr(e,t){t&&C(this,"message",t);let r=C(this,"object"),n=C(this,"doLength"),a=C(this,"message"),o=a?a+": ":"",i=C(this,"ssfi"),s=J(r).toLowerCase(),u=J(e).toLowerCase(),l,c=!0;if(n&&s!=="map"&&s!=="set"&&new b(r,a,i,!0).to.have.property("length"),!n&&s==="date"&&u!=="date")l=o+"the argument to below must be a date";else if(!ae(e)&&(n||ae(r)))l=o+"the argument to below must be a number";else if(!n&&s!=="date"&&!ae(r)){let d=s==="string"?"'"+r+"'":r;l=o+"expected "+d+" to be a number or a date"}else c=!1;if(c)throw new X(l,void 0,i);if(n){let d="length",p;s==="map"||s==="set"?(d="size",p=r.size):p=r.length,this.assert(p<e,"expected #{this} to have a "+d+" below #{exp} but got #{act}","expected #{this} to not have a "+d+" below #{exp}",e,p)}else this.assert(r<e,"expected #{this} to be below #{exp}","expected #{this} to be at least #{exp}",e)}q(jr,"assertBelow");b.addMethod("below",jr);b.addMethod("lt",jr);b.addMethod("lessThan",jr);function Dr(e,t){t&&C(this,"message",t);let r=C(this,"object"),n=C(this,"doLength"),a=C(this,"message"),o=a?a+": ":"",i=C(this,"ssfi"),s=J(r).toLowerCase(),u=J(e).toLowerCase(),l,c=!0;if(n&&s!=="map"&&s!=="set"&&new b(r,a,i,!0).to.have.property("length"),!n&&s==="date"&&u!=="date")l=o+"the argument to most must be a date";else if(!ae(e)&&(n||ae(r)))l=o+"the argument to most must be a number";else if(!n&&s!=="date"&&!ae(r)){let d=s==="string"?"'"+r+"'":r;l=o+"expected "+d+" to be a number or a date"}else c=!1;if(c)throw new X(l,void 0,i);if(n){let d="length",p;s==="map"||s==="set"?(d="size",p=r.size):p=r.length,this.assert(p<=e,"expected #{this} to have a "+d+" at most #{exp} but got #{act}","expected #{this} to have a "+d+" above #{exp}",e,p)}else this.assert(r<=e,"expected #{this} to be at most #{exp}","expected #{this} to be above #{exp}",e)}q(Dr,"assertMost");b.addMethod("most",Dr);b.addMethod("lte",Dr);b.addMethod("lessThanOrEqual",Dr);b.addMethod("within",function(e,t,r){r&&C(this,"message",r);let n=C(this,"object"),a=C(this,"doLength"),o=C(this,"message"),i=o?o+": ":"",s=C(this,"ssfi"),u=J(n).toLowerCase(),l=J(e).toLowerCase(),c=J(t).toLowerCase(),d,p=!0,f=l==="date"&&c==="date"?e.toISOString()+".."+t.toISOString():e+".."+t;if(a&&u!=="map"&&u!=="set"&&new b(n,o,s,!0).to.have.property("length"),!a&&u==="date"&&(l!=="date"||c!=="date"))d=i+"the arguments to within must be dates";else if((!ae(e)||!ae(t))&&(a||ae(n)))d=i+"the arguments to within must be numbers";else if(!a&&u!=="date"&&!ae(n)){let g=u==="string"?"'"+n+"'":n;d=i+"expected "+g+" to be a number or a date"}else p=!1;if(p)throw new X(d,void 0,s);if(a){let g="length",h;u==="map"||u==="set"?(g="size",h=n.size):h=n.length,this.assert(h>=e&&h<=t,"expected #{this} to have a "+g+" within "+f,"expected #{this} to not have a "+g+" within "+f)}else this.assert(n>=e&&n<=t,"expected #{this} to be within "+f,"expected #{this} to not be within "+f)});function ra(e,t){t&&C(this,"message",t);let r=C(this,"object"),n=C(this,"ssfi"),a=C(this,"message"),o;try{o=r instanceof e}catch(s){throw s instanceof TypeError?(a=a?a+": ":"",new X(a+"The instanceof assertion needs a constructor but "+J(e)+" was given.",void 0,n)):s}let i=Ar(e);i==null&&(i="an unnamed constructor"),this.assert(o,"expected #{this} to be an instance of "+i,"expected #{this} to not be an instance of "+i)}q(ra,"assertInstanceOf");b.addMethod("instanceof",ra);b.addMethod("instanceOf",ra);function na(e,t,r){r&&C(this,"message",r);let n=C(this,"nested"),a=C(this,"own"),o=C(this,"message"),i=C(this,"object"),s=C(this,"ssfi"),u=typeof e;if(o=o?o+": ":"",n){if(u!=="string")throw new X(o+"the argument to property must be a string when using nested syntax",void 0,s)}else if(u!=="string"&&u!=="number"&&u!=="symbol")throw new X(o+"the argument to property must be a string, number, or symbol",void 0,s);if(n&&a)throw new X(o+'The "nested" and "own" flags cannot be combined.',void 0,s);if(i==null)throw new X(o+"Target cannot be null or undefined.",void 0,s);let l=C(this,"deep"),c=C(this,"negate"),d=n?Fn(i,e):null,p=n?d.value:i[e],f=l?C(this,"eql"):(S,E)=>S===E,g="";l&&(g+="deep "),a&&(g+="own "),n&&(g+="nested "),g+="property ";let h;a?h=Object.prototype.hasOwnProperty.call(i,e):n?h=d.exists:h=Or(i,e),(!c||arguments.length===1)&&this.assert(h,"expected #{this} to have "+g+K(e),"expected #{this} to not have "+g+K(e)),arguments.length>1&&this.assert(h&&f(t,p),"expected #{this} to have "+g+K(e)+" of #{exp}, but got #{act}","expected #{this} to not have "+g+K(e)+" of #{act}",t,p),C(this,"object",p)}q(na,"assertProperty");b.addMethod("property",na);function aa(e,t,r){C(this,"own",!0),na.apply(this,arguments)}q(aa,"assertOwnProperty");b.addMethod("ownProperty",aa);b.addMethod("haveOwnProperty",aa);function oa(e,t,r){typeof t=="string"&&(r=t,t=null),r&&C(this,"message",r);let n=C(this,"object"),a=Object.getOwnPropertyDescriptor(Object(n),e),o=C(this,"eql");a&&t?this.assert(o(t,a),"expected the own property descriptor for "+K(e)+" on #{this} to match "+K(t)+", got "+K(a),"expected the own property descriptor for "+K(e)+" on #{this} to not match "+K(t),t,a,!0):this.assert(a,"expected #{this} to have an own property descriptor for "+K(e),"expected #{this} to not have an own property descriptor for "+K(e)),C(this,"object",a)}q(oa,"assertOwnPropertyDescriptor");b.addMethod("ownPropertyDescriptor",oa);b.addMethod("haveOwnPropertyDescriptor",oa);function ia(){C(this,"doLength",!0)}q(ia,"assertLengthChain");function sa(e,t){t&&C(this,"message",t);let r=C(this,"object"),n=J(r).toLowerCase(),a=C(this,"message"),o=C(this,"ssfi"),i="length",s;switch(n){case"map":case"set":i="size",s=r.size;break;default:new b(r,a,o,!0).to.have.property("length"),s=r.length}this.assert(s==e,"expected #{this} to have a "+i+" of #{exp} but got #{act}","expected #{this} to not have a "+i+" of #{act}",e,s)}q(sa,"assertLength");b.addChainableMethod("length",sa,ia);b.addChainableMethod("lengthOf",sa,ia);function la(e,t){t&&C(this,"message",t);let r=C(this,"object");this.assert(e.exec(r),"expected #{this} to match "+e,"expected #{this} not to match "+e)}q(la,"assertMatch");b.addMethod("match",la);b.addMethod("matches",la);b.addMethod("string",function(e,t){t&&C(this,"message",t);let r=C(this,"object");new b(r,C(this,"message"),C(this,"ssfi"),!0).is.a("string"),this.assert(~r.indexOf(e),"expected #{this} to contain "+K(e),"expected #{this} to not contain "+K(e))});function ua(e){let t=C(this,"object"),r=J(t),n=J(e),a=C(this,"ssfi"),o=C(this,"deep"),i,s="",u,l=!0,c=C(this,"message");c=c?c+": ":"";let d=c+"when testing keys against an object or an array you must give a single Array|Object|String argument or multiple String arguments";if(r==="Map"||r==="Set")s=o?"deeply ":"",u=[],t.forEach(function(E,w){u.push(w)}),n!=="Array"&&(e=Array.prototype.slice.call(arguments));else{switch(u=Xn(t),n){case"Array":if(arguments.length>1)throw new X(d,void 0,a);break;case"Object":if(arguments.length>1)throw new X(d,void 0,a);e=Object.keys(e);break;default:e=Array.prototype.slice.call(arguments)}e=e.map(function(E){return typeof E=="symbol"?E:String(E)})}if(!e.length)throw new X(c+"keys required",void 0,a);let p=e.length,f=C(this,"any"),g=C(this,"all"),h=e,S=o?C(this,"eql"):(E,w)=>E===w;if(!f&&!g&&(g=!0),f&&(l=h.some(function(E){return u.some(function(w){return S(E,w)})})),g&&(l=h.every(function(E){return u.some(function(w){return S(E,w)})}),C(this,"contains")||(l=l&&e.length==u.length)),p>1){e=e.map(function(w){return K(w)});let E=e.pop();g&&(i=e.join(", ")+", and "+E),f&&(i=e.join(", ")+", or "+E)}else i=K(e[0]);i=(p>1?"keys ":"key ")+i,i=(C(this,"contains")?"contain ":"have ")+i,this.assert(l,"expected #{this} to "+s+i,"expected #{this} to not "+s+i,h.slice(0).sort(pr),u.sort(pr),!0)}q(ua,"assertKeys");b.addMethod("keys",ua);b.addMethod("key",ua);function Lr(e,t,r){r&&C(this,"message",r);let n=C(this,"object"),a=C(this,"ssfi"),o=C(this,"message"),i=C(this,"negate")||!1;new b(n,o,a,!0).is.a("function"),(br(e)||typeof e=="string")&&(t=e,e=null);let s,u=!1;try{n()}catch(f){u=!0,s=f}let l=e===void 0&&t===void 0,c=!!(e&&t),d=!1,p=!1;if(l||!l&&!i){let f="an error";e instanceof Error?f="#{exp}":e&&(f=de.getConstructorName(e));let g=s;if(s instanceof Error)g=s.toString();else if(typeof s=="string")g=s;else if(s&&(typeof s=="object"||typeof s=="function"))try{g=de.getConstructorName(s)}catch{}this.assert(u,"expected #{this} to throw "+f,"expected #{this} to not throw an error but #{act} was thrown",e&&e.toString(),g)}if(e&&s&&(e instanceof Error&&de.compatibleInstance(s,e)===i&&(c&&i?d=!0:this.assert(i,"expected #{this} to throw #{exp} but #{act} was thrown","expected #{this} to not throw #{exp}"+(s&&!i?" but #{act} was thrown":""),e.toString(),s.toString())),de.compatibleConstructor(s,e)===i&&(c&&i?d=!0:this.assert(i,"expected #{this} to throw #{exp} but #{act} was thrown","expected #{this} to not throw #{exp}"+(s?" but #{act} was thrown":""),e instanceof Error?e.toString():e&&de.getConstructorName(e),s instanceof Error?s.toString():s&&de.getConstructorName(s)))),s&&t!==void 0&&t!==null){let f="including";br(t)&&(f="matching"),de.compatibleMessage(s,t)===i&&(c&&i?p=!0:this.assert(i,"expected #{this} to throw error "+f+" #{exp} but got #{act}","expected #{this} to throw error not "+f+" #{exp}",t,de.getMessage(s)))}d&&p&&this.assert(i,"expected #{this} to throw #{exp} but #{act} was thrown","expected #{this} to not throw #{exp}"+(s?" but #{act} was thrown":""),e instanceof Error?e.toString():e&&de.getConstructorName(e),s instanceof Error?s.toString():s&&de.getConstructorName(s)),C(this,"object",s)}q(Lr,"assertThrows");b.addMethod("throw",Lr);b.addMethod("throws",Lr);b.addMethod("Throw",Lr);function ca(e,t){t&&C(this,"message",t);let r=C(this,"object"),n=C(this,"itself"),a=typeof r=="function"&&!n?r.prototype[e]:r[e];this.assert(typeof a=="function","expected #{this} to respond to "+K(e),"expected #{this} to not respond to "+K(e))}q(ca,"respondTo");b.addMethod("respondTo",ca);b.addMethod("respondsTo",ca);b.addProperty("itself",function(){C(this,"itself",!0)});function da(e,t){t&&C(this,"message",t);let r=e(C(this,"object"));this.assert(r,"expected #{this} to satisfy "+Qe(e),"expected #{this} to not satisfy"+Qe(e),!C(this,"negate"),r)}q(da,"satisfy");b.addMethod("satisfy",da);b.addMethod("satisfies",da);function fa(e,t,r){r&&C(this,"message",r);let n=C(this,"object"),a=C(this,"message"),o=C(this,"ssfi");new b(n,a,o,!0).is.numeric;let i="A `delta` value is required for `closeTo`";if(t==null)throw new X(a?`${a}: ${i}`:i,void 0,o);if(new b(t,a,o,!0).is.numeric,i="A `expected` value is required for `closeTo`",e==null)throw new X(a?`${a}: ${i}`:i,void 0,o);new b(e,a,o,!0).is.numeric;const s=q(l=>l<0?-l:l,"abs"),u=q(l=>parseFloat(parseFloat(l).toPrecision(12)),"strip");this.assert(u(s(n-e))<=t,"expected #{this} to be close to "+e+" +/- "+t,"expected #{this} not to be close to "+e+" +/- "+t)}q(fa,"closeTo");b.addMethod("closeTo",fa);b.addMethod("approximately",fa);function Ci(e,t,r,n,a){let o=Array.from(t),i=Array.from(e);if(!n){if(i.length!==o.length)return!1;o=o.slice()}return i.every(function(s,u){if(a)return r?r(s,o[u]):s===o[u];if(!r){let l=o.indexOf(s);return l===-1?!1:(n||o.splice(l,1),!0)}return o.some(function(l,c){return r(s,l)?(n||o.splice(c,1),!0):!1})})}q(Ci,"isSubsetOf");b.addMethod("members",function(e,t){t&&C(this,"message",t);let r=C(this,"object"),n=C(this,"message"),a=C(this,"ssfi");new b(r,n,a,!0).to.be.iterable,new b(e,n,a,!0).to.be.iterable;let o=C(this,"contains"),i=C(this,"ordered"),s,u,l;o?(s=i?"an ordered superset":"a superset",u="expected #{this} to be "+s+" of #{exp}",l="expected #{this} to not be "+s+" of #{exp}"):(s=i?"ordered members":"members",u="expected #{this} to have the same "+s+" as #{exp}",l="expected #{this} to not have the same "+s+" as #{exp}");let c=C(this,"deep")?C(this,"eql"):void 0;this.assert(Ci(e,r,c,o,i),u,l,e,r,!0)});b.addProperty("iterable",function(e){e&&C(this,"message",e);let t=C(this,"object");this.assert(t!=null&&t[Symbol.iterator],"expected #{this} to be an iterable","expected #{this} to not be an iterable",t)});function Pi(e,t){t&&C(this,"message",t);let r=C(this,"object"),n=C(this,"message"),a=C(this,"ssfi"),o=C(this,"contains"),i=C(this,"deep"),s=C(this,"eql");new b(e,n,a,!0).to.be.an("array"),o?this.assert(e.some(function(u){return r.indexOf(u)>-1}),"expected #{this} to contain one of #{exp}","expected #{this} to not contain one of #{exp}",e,r):i?this.assert(e.some(function(u){return s(r,u)}),"expected #{this} to deeply equal one of #{exp}","expected #{this} to deeply equal one of #{exp}",e,r):this.assert(e.indexOf(r)>-1,"expected #{this} to be one of #{exp}","expected #{this} to not be one of #{exp}",e,r)}q(Pi,"oneOf");b.addMethod("oneOf",Pi);function pa(e,t,r){r&&C(this,"message",r);let n=C(this,"object"),a=C(this,"message"),o=C(this,"ssfi");new b(n,a,o,!0).is.a("function");let i;t?(new b(e,a,o,!0).to.have.property(t),i=e[t]):(new b(e,a,o,!0).is.a("function"),i=e()),n();let s=t==null?e():e[t],u=t==null?i:"."+t;C(this,"deltaMsgObj",u),C(this,"initialDeltaValue",i),C(this,"finalDeltaValue",s),C(this,"deltaBehavior","change"),C(this,"realDelta",s!==i),this.assert(i!==s,"expected "+u+" to change","expected "+u+" to not change")}q(pa,"assertChanges");b.addMethod("change",pa);b.addMethod("changes",pa);function ma(e,t,r){r&&C(this,"message",r);let n=C(this,"object"),a=C(this,"message"),o=C(this,"ssfi");new b(n,a,o,!0).is.a("function");let i;t?(new b(e,a,o,!0).to.have.property(t),i=e[t]):(new b(e,a,o,!0).is.a("function"),i=e()),new b(i,a,o,!0).is.a("number"),n();let s=t==null?e():e[t],u=t==null?i:"."+t;C(this,"deltaMsgObj",u),C(this,"initialDeltaValue",i),C(this,"finalDeltaValue",s),C(this,"deltaBehavior","increase"),C(this,"realDelta",s-i),this.assert(s-i>0,"expected "+u+" to increase","expected "+u+" to not increase")}q(ma,"assertIncreases");b.addMethod("increase",ma);b.addMethod("increases",ma);function ba(e,t,r){r&&C(this,"message",r);let n=C(this,"object"),a=C(this,"message"),o=C(this,"ssfi");new b(n,a,o,!0).is.a("function");let i;t?(new b(e,a,o,!0).to.have.property(t),i=e[t]):(new b(e,a,o,!0).is.a("function"),i=e()),new b(i,a,o,!0).is.a("number"),n();let s=t==null?e():e[t],u=t==null?i:"."+t;C(this,"deltaMsgObj",u),C(this,"initialDeltaValue",i),C(this,"finalDeltaValue",s),C(this,"deltaBehavior","decrease"),C(this,"realDelta",i-s),this.assert(s-i<0,"expected "+u+" to decrease","expected "+u+" to not decrease")}q(ba,"assertDecreases");b.addMethod("decrease",ba);b.addMethod("decreases",ba);function qi(e,t){t&&C(this,"message",t);let r=C(this,"deltaMsgObj"),n=C(this,"initialDeltaValue"),a=C(this,"finalDeltaValue"),o=C(this,"deltaBehavior"),i=C(this,"realDelta"),s;o==="change"?s=Math.abs(a-n)===Math.abs(e):s=i===Math.abs(e),this.assert(s,"expected "+r+" to "+o+" by "+e,"expected "+r+" to not "+o+" by "+e)}q(qi,"assertDelta");b.addMethod("by",qi);b.addProperty("extensible",function(){let e=C(this,"object"),t=e===Object(e)&&Object.isExtensible(e);this.assert(t,"expected #{this} to be extensible","expected #{this} to not be extensible")});b.addProperty("sealed",function(){let e=C(this,"object"),t=e===Object(e)?Object.isSealed(e):!0;this.assert(t,"expected #{this} to be sealed","expected #{this} to not be sealed")});b.addProperty("frozen",function(){let e=C(this,"object"),t=e===Object(e)?Object.isFrozen(e):!0;this.assert(t,"expected #{this} to be frozen","expected #{this} to not be frozen")});b.addProperty("finite",function(e){let t=C(this,"object");this.assert(typeof t=="number"&&isFinite(t),"expected #{this} to be a finite number","expected #{this} to not be a finite number")});function hr(e,t){return e===t?!0:typeof t!=typeof e?!1:typeof e!="object"||e===null?e===t:t?Array.isArray(e)?Array.isArray(t)?e.every(function(r){return t.some(function(n){return hr(r,n)})}):!1:e instanceof Date?t instanceof Date?e.getTime()===t.getTime():!1:Object.keys(e).every(function(r){let n=e[r],a=t[r];return typeof n=="object"&&n!==null&&a!==null?hr(n,a):typeof n=="function"?n(a):a===n}):!1}q(hr,"compareSubset");b.addMethod("containSubset",function(e){const t=U(this,"object"),r=se.showDiff;this.assert(hr(e,t),"expected #{act} to contain subset #{exp}","expected #{act} to not contain subset #{exp}",e,t,r)});function kt(e,t){return new b(e,t)}q(kt,"expect");kt.fail=function(e,t,r,n){throw arguments.length<2&&(r=e,e=void 0),r=r||"expect.fail()",new X(r,{actual:e,expected:t,operator:n},kt.fail)};var Ri={};Nn(Ri,{Should:()=>Ru,should:()=>qu});function ha(){function e(){return this instanceof String||this instanceof Number||this instanceof Boolean||typeof Symbol=="function"&&this instanceof Symbol||typeof BigInt=="function"&&this instanceof BigInt?new b(this.valueOf(),null,e):new b(this,null,e)}q(e,"shouldGetter");function t(n){Object.defineProperty(this,"should",{value:n,enumerable:!0,configurable:!0,writable:!0})}q(t,"shouldSetter"),Object.defineProperty(Object.prototype,"should",{set:t,get:e,configurable:!0});let r={};return r.fail=function(n,a,o,i){throw arguments.length<2&&(o=n,n=void 0),o=o||"should.fail()",new X(o,{actual:n,expected:a,operator:i},r.fail)},r.equal=function(n,a,o){new b(n,o).to.equal(a)},r.Throw=function(n,a,o,i){new b(n,i).to.Throw(a,o)},r.exist=function(n,a){new b(n,a).to.exist},r.not={},r.not.equal=function(n,a,o){new b(n,o).to.not.equal(a)},r.not.Throw=function(n,a,o,i){new b(n,i).to.not.Throw(a,o)},r.not.exist=function(n,a){new b(n,a).to.not.exist},r.throw=r.Throw,r.not.throw=r.not.Throw,r}q(ha,"loadShould");var qu=ha,Ru=ha;function m(e,t){new b(null,null,m,!0).assert(e,t,"[ negation message unavailable ]")}q(m,"assert");m.fail=function(e,t,r,n){throw arguments.length<2&&(r=e,e=void 0),r=r||"assert.fail()",new X(r,{actual:e,expected:t,operator:n},m.fail)};m.isOk=function(e,t){new b(e,t,m.isOk,!0).is.ok};m.isNotOk=function(e,t){new b(e,t,m.isNotOk,!0).is.not.ok};m.equal=function(e,t,r){let n=new b(e,r,m.equal,!0);n.assert(t==U(n,"object"),"expected #{this} to equal #{exp}","expected #{this} to not equal #{act}",t,e,!0)};m.notEqual=function(e,t,r){let n=new b(e,r,m.notEqual,!0);n.assert(t!=U(n,"object"),"expected #{this} to not equal #{exp}","expected #{this} to equal #{act}",t,e,!0)};m.strictEqual=function(e,t,r){new b(e,r,m.strictEqual,!0).to.equal(t)};m.notStrictEqual=function(e,t,r){new b(e,r,m.notStrictEqual,!0).to.not.equal(t)};m.deepEqual=m.deepStrictEqual=function(e,t,r){new b(e,r,m.deepEqual,!0).to.eql(t)};m.notDeepEqual=function(e,t,r){new b(e,r,m.notDeepEqual,!0).to.not.eql(t)};m.isAbove=function(e,t,r){new b(e,r,m.isAbove,!0).to.be.above(t)};m.isAtLeast=function(e,t,r){new b(e,r,m.isAtLeast,!0).to.be.least(t)};m.isBelow=function(e,t,r){new b(e,r,m.isBelow,!0).to.be.below(t)};m.isAtMost=function(e,t,r){new b(e,r,m.isAtMost,!0).to.be.most(t)};m.isTrue=function(e,t){new b(e,t,m.isTrue,!0).is.true};m.isNotTrue=function(e,t){new b(e,t,m.isNotTrue,!0).to.not.equal(!0)};m.isFalse=function(e,t){new b(e,t,m.isFalse,!0).is.false};m.isNotFalse=function(e,t){new b(e,t,m.isNotFalse,!0).to.not.equal(!1)};m.isNull=function(e,t){new b(e,t,m.isNull,!0).to.equal(null)};m.isNotNull=function(e,t){new b(e,t,m.isNotNull,!0).to.not.equal(null)};m.isNaN=function(e,t){new b(e,t,m.isNaN,!0).to.be.NaN};m.isNotNaN=function(e,t){new b(e,t,m.isNotNaN,!0).not.to.be.NaN};m.exists=function(e,t){new b(e,t,m.exists,!0).to.exist};m.notExists=function(e,t){new b(e,t,m.notExists,!0).to.not.exist};m.isUndefined=function(e,t){new b(e,t,m.isUndefined,!0).to.equal(void 0)};m.isDefined=function(e,t){new b(e,t,m.isDefined,!0).to.not.equal(void 0)};m.isCallable=function(e,t){new b(e,t,m.isCallable,!0).is.callable};m.isNotCallable=function(e,t){new b(e,t,m.isNotCallable,!0).is.not.callable};m.isObject=function(e,t){new b(e,t,m.isObject,!0).to.be.a("object")};m.isNotObject=function(e,t){new b(e,t,m.isNotObject,!0).to.not.be.a("object")};m.isArray=function(e,t){new b(e,t,m.isArray,!0).to.be.an("array")};m.isNotArray=function(e,t){new b(e,t,m.isNotArray,!0).to.not.be.an("array")};m.isString=function(e,t){new b(e,t,m.isString,!0).to.be.a("string")};m.isNotString=function(e,t){new b(e,t,m.isNotString,!0).to.not.be.a("string")};m.isNumber=function(e,t){new b(e,t,m.isNumber,!0).to.be.a("number")};m.isNotNumber=function(e,t){new b(e,t,m.isNotNumber,!0).to.not.be.a("number")};m.isNumeric=function(e,t){new b(e,t,m.isNumeric,!0).is.numeric};m.isNotNumeric=function(e,t){new b(e,t,m.isNotNumeric,!0).is.not.numeric};m.isFinite=function(e,t){new b(e,t,m.isFinite,!0).to.be.finite};m.isBoolean=function(e,t){new b(e,t,m.isBoolean,!0).to.be.a("boolean")};m.isNotBoolean=function(e,t){new b(e,t,m.isNotBoolean,!0).to.not.be.a("boolean")};m.typeOf=function(e,t,r){new b(e,r,m.typeOf,!0).to.be.a(t)};m.notTypeOf=function(e,t,r){new b(e,r,m.notTypeOf,!0).to.not.be.a(t)};m.instanceOf=function(e,t,r){new b(e,r,m.instanceOf,!0).to.be.instanceOf(t)};m.notInstanceOf=function(e,t,r){new b(e,r,m.notInstanceOf,!0).to.not.be.instanceOf(t)};m.include=function(e,t,r){new b(e,r,m.include,!0).include(t)};m.notInclude=function(e,t,r){new b(e,r,m.notInclude,!0).not.include(t)};m.deepInclude=function(e,t,r){new b(e,r,m.deepInclude,!0).deep.include(t)};m.notDeepInclude=function(e,t,r){new b(e,r,m.notDeepInclude,!0).not.deep.include(t)};m.nestedInclude=function(e,t,r){new b(e,r,m.nestedInclude,!0).nested.include(t)};m.notNestedInclude=function(e,t,r){new b(e,r,m.notNestedInclude,!0).not.nested.include(t)};m.deepNestedInclude=function(e,t,r){new b(e,r,m.deepNestedInclude,!0).deep.nested.include(t)};m.notDeepNestedInclude=function(e,t,r){new b(e,r,m.notDeepNestedInclude,!0).not.deep.nested.include(t)};m.ownInclude=function(e,t,r){new b(e,r,m.ownInclude,!0).own.include(t)};m.notOwnInclude=function(e,t,r){new b(e,r,m.notOwnInclude,!0).not.own.include(t)};m.deepOwnInclude=function(e,t,r){new b(e,r,m.deepOwnInclude,!0).deep.own.include(t)};m.notDeepOwnInclude=function(e,t,r){new b(e,r,m.notDeepOwnInclude,!0).not.deep.own.include(t)};m.match=function(e,t,r){new b(e,r,m.match,!0).to.match(t)};m.notMatch=function(e,t,r){new b(e,r,m.notMatch,!0).to.not.match(t)};m.property=function(e,t,r){new b(e,r,m.property,!0).to.have.property(t)};m.notProperty=function(e,t,r){new b(e,r,m.notProperty,!0).to.not.have.property(t)};m.propertyVal=function(e,t,r,n){new b(e,n,m.propertyVal,!0).to.have.property(t,r)};m.notPropertyVal=function(e,t,r,n){new b(e,n,m.notPropertyVal,!0).to.not.have.property(t,r)};m.deepPropertyVal=function(e,t,r,n){new b(e,n,m.deepPropertyVal,!0).to.have.deep.property(t,r)};m.notDeepPropertyVal=function(e,t,r,n){new b(e,n,m.notDeepPropertyVal,!0).to.not.have.deep.property(t,r)};m.ownProperty=function(e,t,r){new b(e,r,m.ownProperty,!0).to.have.own.property(t)};m.notOwnProperty=function(e,t,r){new b(e,r,m.notOwnProperty,!0).to.not.have.own.property(t)};m.ownPropertyVal=function(e,t,r,n){new b(e,n,m.ownPropertyVal,!0).to.have.own.property(t,r)};m.notOwnPropertyVal=function(e,t,r,n){new b(e,n,m.notOwnPropertyVal,!0).to.not.have.own.property(t,r)};m.deepOwnPropertyVal=function(e,t,r,n){new b(e,n,m.deepOwnPropertyVal,!0).to.have.deep.own.property(t,r)};m.notDeepOwnPropertyVal=function(e,t,r,n){new b(e,n,m.notDeepOwnPropertyVal,!0).to.not.have.deep.own.property(t,r)};m.nestedProperty=function(e,t,r){new b(e,r,m.nestedProperty,!0).to.have.nested.property(t)};m.notNestedProperty=function(e,t,r){new b(e,r,m.notNestedProperty,!0).to.not.have.nested.property(t)};m.nestedPropertyVal=function(e,t,r,n){new b(e,n,m.nestedPropertyVal,!0).to.have.nested.property(t,r)};m.notNestedPropertyVal=function(e,t,r,n){new b(e,n,m.notNestedPropertyVal,!0).to.not.have.nested.property(t,r)};m.deepNestedPropertyVal=function(e,t,r,n){new b(e,n,m.deepNestedPropertyVal,!0).to.have.deep.nested.property(t,r)};m.notDeepNestedPropertyVal=function(e,t,r,n){new b(e,n,m.notDeepNestedPropertyVal,!0).to.not.have.deep.nested.property(t,r)};m.lengthOf=function(e,t,r){new b(e,r,m.lengthOf,!0).to.have.lengthOf(t)};m.hasAnyKeys=function(e,t,r){new b(e,r,m.hasAnyKeys,!0).to.have.any.keys(t)};m.hasAllKeys=function(e,t,r){new b(e,r,m.hasAllKeys,!0).to.have.all.keys(t)};m.containsAllKeys=function(e,t,r){new b(e,r,m.containsAllKeys,!0).to.contain.all.keys(t)};m.doesNotHaveAnyKeys=function(e,t,r){new b(e,r,m.doesNotHaveAnyKeys,!0).to.not.have.any.keys(t)};m.doesNotHaveAllKeys=function(e,t,r){new b(e,r,m.doesNotHaveAllKeys,!0).to.not.have.all.keys(t)};m.hasAnyDeepKeys=function(e,t,r){new b(e,r,m.hasAnyDeepKeys,!0).to.have.any.deep.keys(t)};m.hasAllDeepKeys=function(e,t,r){new b(e,r,m.hasAllDeepKeys,!0).to.have.all.deep.keys(t)};m.containsAllDeepKeys=function(e,t,r){new b(e,r,m.containsAllDeepKeys,!0).to.contain.all.deep.keys(t)};m.doesNotHaveAnyDeepKeys=function(e,t,r){new b(e,r,m.doesNotHaveAnyDeepKeys,!0).to.not.have.any.deep.keys(t)};m.doesNotHaveAllDeepKeys=function(e,t,r){new b(e,r,m.doesNotHaveAllDeepKeys,!0).to.not.have.all.deep.keys(t)};m.throws=function(e,t,r,n){return(typeof t=="string"||t instanceof RegExp)&&(r=t,t=null),U(new b(e,n,m.throws,!0).to.throw(t,r),"object")};m.doesNotThrow=function(e,t,r,n){(typeof t=="string"||t instanceof RegExp)&&(r=t,t=null),new b(e,n,m.doesNotThrow,!0).to.not.throw(t,r)};m.operator=function(e,t,r,n){let a;switch(t){case"==":a=e==r;break;case"===":a=e===r;break;case">":a=e>r;break;case">=":a=e>=r;break;case"<":a=e<r;break;case"<=":a=e<=r;break;case"!=":a=e!=r;break;case"!==":a=e!==r;break;default:throw n=n&&n+": ",new X(n+'Invalid operator "'+t+'"',void 0,m.operator)}let o=new b(a,n,m.operator,!0);o.assert(U(o,"object")===!0,"expected "+K(e)+" to be "+t+" "+K(r),"expected "+K(e)+" to not be "+t+" "+K(r))};m.closeTo=function(e,t,r,n){new b(e,n,m.closeTo,!0).to.be.closeTo(t,r)};m.approximately=function(e,t,r,n){new b(e,n,m.approximately,!0).to.be.approximately(t,r)};m.sameMembers=function(e,t,r){new b(e,r,m.sameMembers,!0).to.have.same.members(t)};m.notSameMembers=function(e,t,r){new b(e,r,m.notSameMembers,!0).to.not.have.same.members(t)};m.sameDeepMembers=function(e,t,r){new b(e,r,m.sameDeepMembers,!0).to.have.same.deep.members(t)};m.notSameDeepMembers=function(e,t,r){new b(e,r,m.notSameDeepMembers,!0).to.not.have.same.deep.members(t)};m.sameOrderedMembers=function(e,t,r){new b(e,r,m.sameOrderedMembers,!0).to.have.same.ordered.members(t)};m.notSameOrderedMembers=function(e,t,r){new b(e,r,m.notSameOrderedMembers,!0).to.not.have.same.ordered.members(t)};m.sameDeepOrderedMembers=function(e,t,r){new b(e,r,m.sameDeepOrderedMembers,!0).to.have.same.deep.ordered.members(t)};m.notSameDeepOrderedMembers=function(e,t,r){new b(e,r,m.notSameDeepOrderedMembers,!0).to.not.have.same.deep.ordered.members(t)};m.includeMembers=function(e,t,r){new b(e,r,m.includeMembers,!0).to.include.members(t)};m.notIncludeMembers=function(e,t,r){new b(e,r,m.notIncludeMembers,!0).to.not.include.members(t)};m.includeDeepMembers=function(e,t,r){new b(e,r,m.includeDeepMembers,!0).to.include.deep.members(t)};m.notIncludeDeepMembers=function(e,t,r){new b(e,r,m.notIncludeDeepMembers,!0).to.not.include.deep.members(t)};m.includeOrderedMembers=function(e,t,r){new b(e,r,m.includeOrderedMembers,!0).to.include.ordered.members(t)};m.notIncludeOrderedMembers=function(e,t,r){new b(e,r,m.notIncludeOrderedMembers,!0).to.not.include.ordered.members(t)};m.includeDeepOrderedMembers=function(e,t,r){new b(e,r,m.includeDeepOrderedMembers,!0).to.include.deep.ordered.members(t)};m.notIncludeDeepOrderedMembers=function(e,t,r){new b(e,r,m.notIncludeDeepOrderedMembers,!0).to.not.include.deep.ordered.members(t)};m.oneOf=function(e,t,r){new b(e,r,m.oneOf,!0).to.be.oneOf(t)};m.isIterable=function(e,t){if(e==null||!e[Symbol.iterator])throw t=t?`${t} expected ${K(e)} to be an iterable`:`expected ${K(e)} to be an iterable`,new X(t,void 0,m.isIterable)};m.changes=function(e,t,r,n){arguments.length===3&&typeof t=="function"&&(n=r,r=null),new b(e,n,m.changes,!0).to.change(t,r)};m.changesBy=function(e,t,r,n,a){if(arguments.length===4&&typeof t=="function"){let o=n;n=r,a=o}else arguments.length===3&&(n=r,r=null);new b(e,a,m.changesBy,!0).to.change(t,r).by(n)};m.doesNotChange=function(e,t,r,n){return arguments.length===3&&typeof t=="function"&&(n=r,r=null),new b(e,n,m.doesNotChange,!0).to.not.change(t,r)};m.changesButNotBy=function(e,t,r,n,a){if(arguments.length===4&&typeof t=="function"){let o=n;n=r,a=o}else arguments.length===3&&(n=r,r=null);new b(e,a,m.changesButNotBy,!0).to.change(t,r).but.not.by(n)};m.increases=function(e,t,r,n){return arguments.length===3&&typeof t=="function"&&(n=r,r=null),new b(e,n,m.increases,!0).to.increase(t,r)};m.increasesBy=function(e,t,r,n,a){if(arguments.length===4&&typeof t=="function"){let o=n;n=r,a=o}else arguments.length===3&&(n=r,r=null);new b(e,a,m.increasesBy,!0).to.increase(t,r).by(n)};m.doesNotIncrease=function(e,t,r,n){return arguments.length===3&&typeof t=="function"&&(n=r,r=null),new b(e,n,m.doesNotIncrease,!0).to.not.increase(t,r)};m.increasesButNotBy=function(e,t,r,n,a){if(arguments.length===4&&typeof t=="function"){let o=n;n=r,a=o}else arguments.length===3&&(n=r,r=null);new b(e,a,m.increasesButNotBy,!0).to.increase(t,r).but.not.by(n)};m.decreases=function(e,t,r,n){return arguments.length===3&&typeof t=="function"&&(n=r,r=null),new b(e,n,m.decreases,!0).to.decrease(t,r)};m.decreasesBy=function(e,t,r,n,a){if(arguments.length===4&&typeof t=="function"){let o=n;n=r,a=o}else arguments.length===3&&(n=r,r=null);new b(e,a,m.decreasesBy,!0).to.decrease(t,r).by(n)};m.doesNotDecrease=function(e,t,r,n){return arguments.length===3&&typeof t=="function"&&(n=r,r=null),new b(e,n,m.doesNotDecrease,!0).to.not.decrease(t,r)};m.doesNotDecreaseBy=function(e,t,r,n,a){if(arguments.length===4&&typeof t=="function"){let o=n;n=r,a=o}else arguments.length===3&&(n=r,r=null);return new b(e,a,m.doesNotDecreaseBy,!0).to.not.decrease(t,r).by(n)};m.decreasesButNotBy=function(e,t,r,n,a){if(arguments.length===4&&typeof t=="function"){let o=n;n=r,a=o}else arguments.length===3&&(n=r,r=null);new b(e,a,m.decreasesButNotBy,!0).to.decrease(t,r).but.not.by(n)};m.ifError=function(e){if(e)throw e};m.isExtensible=function(e,t){new b(e,t,m.isExtensible,!0).to.be.extensible};m.isNotExtensible=function(e,t){new b(e,t,m.isNotExtensible,!0).to.not.be.extensible};m.isSealed=function(e,t){new b(e,t,m.isSealed,!0).to.be.sealed};m.isNotSealed=function(e,t){new b(e,t,m.isNotSealed,!0).to.not.be.sealed};m.isFrozen=function(e,t){new b(e,t,m.isFrozen,!0).to.be.frozen};m.isNotFrozen=function(e,t){new b(e,t,m.isNotFrozen,!0).to.not.be.frozen};m.isEmpty=function(e,t){new b(e,t,m.isEmpty,!0).to.be.empty};m.isNotEmpty=function(e,t){new b(e,t,m.isNotEmpty,!0).to.not.be.empty};m.containsSubset=function(e,t,r){new b(e,r).to.containSubset(t)};m.doesNotContainSubset=function(e,t,r){new b(e,r).to.not.containSubset(t)};for(const[e,t]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"]])m[t]=m[e];var Va=[];function Ti(e){const t={use:Ti,AssertionError:X,util:cr,config:se,expect:kt,assert:m,Assertion:b,...Ri};return~Va.indexOf(e)||(e(t,cr),Va.push(e)),t}q(Ti,"use");var Tu=()=>(0,j.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"var(--twd-icon-color-secondary)",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"lucide lucide-loader-circle-icon lucide-loader-circle twd-loader","data-testid":"loader-icon",children:(0,j.jsx)("path",{d:"M21 12a9 9 0 1 1-6.219-8.56"})}),Br=({className:e,children:t,dataTestId:r})=>(0,j.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"var(--twd-icon-color)",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:`lucide ${e}`,"data-testid":r,children:t}),Su=()=>(0,j.jsx)(Br,{className:"lucide-play-icon lucide-play",dataTestId:"play-icon",children:(0,j.jsx)("path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z"})}),Si=({id:e,name:t,skip:r,only:n})=>(0,j.jsxs)(j.Fragment,{children:[t," ",n&&(0,j.jsxs)("span",{style:{color:"var(--twd-primary)"},"data-testid":`only-indicator-${e}`,children:[" ","(only)"]}),r&&(0,j.jsxs)("span",{style:{color:"var(--twd-text-secondary)"},"data-testid":`skip-indicator-${e}`,children:[" ","(skipped)"]})]}),Ze=(function(e){return e.CHAI_DIFF="chai-diff",e.CHAI_MESSAGE="chai-message",e.ERROR="error",e})({}),xu=e=>{try{const t=JSON.parse(e);if(t&&typeof t=="object"&&"type"in t)return t}catch{}return null},Ha=e=>{if(e===null)return"null";if(e===void 0)return"undefined";if(typeof e=="string")return e;if(typeof e=="object")try{return JSON.stringify(e,null,2)}catch{return String(e)}return String(e)},Ou=e=>e.startsWith("Assertion passed")||e.startsWith("Event fired")?{color:"var(--twd-success)",fontWeight:"var(--twd-font-weight-bold)"}:e.startsWith("Test failed")?{color:"var(--twd-error)",fontWeight:"var(--twd-font-weight-bold)"}:{},Mu=e=>e.type==="chai-message"||e.type==="error",Au=(e,t)=>t&&Mu(t)?t.message:e,Iu=({log:e,index:t})=>{const r=xu(e);if(r?.type===Ze.CHAI_DIFF)return(0,j.jsxs)("li",{style:{fontSize:"var(--twd-font-size-sm)",padding:"var(--twd-spacing-sm)",borderBottom:"1px solid var(--twd-border-light)",color:"var(--twd-text)"},children:[(0,j.jsx)("div",{style:{color:"var(--twd-error)",fontWeight:"var(--twd-font-weight-bold)",marginBottom:"var(--twd-spacing-xs)"},children:"❌ Assertion failed"}),(0,j.jsxs)("div",{style:{marginTop:"var(--twd-spacing-xs)",paddingLeft:"var(--twd-spacing-sm)",borderLeft:"2px solid var(--twd-success)"},children:[(0,j.jsx)("div",{style:{color:"var(--twd-success)",fontWeight:"var(--twd-font-weight-medium)",marginBottom:"var(--twd-spacing-xs)"},children:"Expected:"}),(0,j.jsx)("pre",{style:{margin:0,padding:"var(--twd-spacing-xs)",background:"var(--twd-background)",borderRadius:"var(--twd-border-radius)",fontSize:"var(--twd-font-size-xs)",overflowX:"auto",whiteSpace:"pre-wrap",wordBreak:"break-word"},children:Ha(r.expected)})]}),(0,j.jsxs)("div",{style:{marginTop:"var(--twd-spacing-xs)",paddingLeft:"var(--twd-spacing-sm)",borderLeft:"2px solid var(--twd-error)"},children:[(0,j.jsx)("div",{style:{color:"var(--twd-error)",fontWeight:"var(--twd-font-weight-medium)",marginBottom:"var(--twd-spacing-xs)"},children:"Actual:"}),(0,j.jsx)("pre",{style:{margin:0,padding:"var(--twd-spacing-xs)",background:"var(--twd-background)",borderRadius:"var(--twd-border-radius)",fontSize:"var(--twd-font-size-xs)",overflowX:"auto",whiteSpace:"pre-wrap",wordBreak:"break-word"},children:Ha(r.actual)})]})]},t);const n=Au(e,r);return(0,j.jsx)("li",{style:{fontSize:"var(--twd-font-size-sm)",padding:"var(--twd-spacing-xs) var(--twd-spacing-sm)",borderBottom:"1px solid var(--twd-border-light)",color:"var(--twd-text)",...Ou(n)},children:n},t)},Nu=e=>{switch(e){case"pass":return"twd-status-pass";case"fail":return"twd-status-fail";case"skip":return"twd-status-skip";case"running":return"twd-status-running";default:return""}},ku=({node:e,depth:t,id:r,runTest:n})=>{const a=(0,oe.useRef)(null),o=(0,oe.useRef)(e.status),i=(0,oe.useRef)(e.logs?.length||0),s=typeof window<"u"&&sessionStorage.getItem("twd-last-run-test-name")===e.name;(0,oe.useEffect)(()=>{const l=a.current;if(!l||!e.logs||e.logs.length===0)return;const c=o.current==="running"&&(e.status==="pass"||e.status==="fail"),d=e.logs.length>i.current;(c||d)&&setTimeout(()=>{l.scrollTop=l.scrollHeight},0),o.current=e.status,i.current=e.logs.length},[e.status,e.logs]);const u=()=>{switch(e.status){case"pass":return"passed";case"fail":return"failed";case"running":return"running";case"skip":return"skipped";default:return"not run"}};return(0,j.jsxs)("li",{style:{marginBottom:"var(--twd-spacing-xs)",marginLeft:`calc(${t} * var(--twd-spacing-sm))`},"data-testid":`test-list-item-${r}`,"data-test-name":e.name,role:"listitem","aria-label":`Test ${e.name}, status: ${u()}`,children:[(0,j.jsxs)("div",{className:`twd-test-item ${Nu(e.status)}`,style:s?{border:"1px dashed var(--twd-border)"}:void 0,children:[(0,j.jsx)("span",{className:"twd-test-item-name",children:(0,j.jsx)(Si,{id:r,name:e.name,skip:e.skip,only:e.only})}),(0,j.jsx)("button",{onClick:()=>n(r),"aria-label":`Run ${e.name} test`,className:"twd-btn twd-btn-icon",disabled:e.status==="running","data-testid":`run-test-button-${r}`,children:e.status==="running"?(0,j.jsx)(Tu,{}):(0,j.jsx)(Su,{})})]}),e.logs&&e.logs.length>0&&(0,j.jsx)("ul",{ref:a,className:"twd-test-item-logs",children:e.logs.map((l,c)=>(0,j.jsx)(Iu,{log:l,index:c},c))})]},e.name)},ju=()=>(0,j.jsx)(Br,{className:"lucide-chevron-down-icon lucide-chevron-down",dataTestId:"chevron-down-icon",children:(0,j.jsx)("path",{d:"m6 9 6 6 6-6"})}),Du=()=>(0,j.jsx)(Br,{className:"lucide-chevron-right-icon lucide-chevron-right",dataTestId:"chevron-right-icon",children:(0,j.jsx)("path",{d:"m9 18 6-6-6-6"})}),Lu=({roots:e,runTest:t,searchQuery:r=""})=>{const[n,a]=(0,oe.useState)({}),o=(0,oe.useRef)(null),i=(0,oe.useRef)(!1),s=l=>a(c=>({...c,[l]:!c[l]}));(0,oe.useEffect)(()=>{if(i.current)return;const l=sessionStorage.getItem("twd-last-run-test-name");if(!l)return;const c=setTimeout(()=>{const d=document.querySelector(`[data-test-name="${l}"]`);if(d){const p=o.current?.closest('[data-testid="twd-sidebar"]');if(p){const f=d.getBoundingClientRect(),g=p.getBoundingClientRect(),h=p.scrollTop,S=f.top-g.top+h,E=p.querySelector('[data-testid="twd-sidebar-header"]'),w=E?E.getBoundingClientRect().height+16:150;p.scrollTo({top:S-w,behavior:"smooth"})}i.current=!0}},100);return()=>clearTimeout(c)},[]);const u=(l,c=0)=>{if(l.type==="test")return(0,j.jsx)(ku,{node:l,depth:c,id:l.id,runTest:()=>{t(l.id)}},l.id);const d=n[l.id];return(0,j.jsxs)("li",{style:{marginLeft:`calc(${c} * var(--twd-spacing-lg))`},children:[(0,j.jsx)("div",{className:"twd-test-group",children:(0,j.jsxs)("span",{className:"twd-test-group-toggle","data-testid":`test-group-${l.name}`,tabIndex:0,role:"button","aria-expanded":!d,"aria-label":`${d?"Expand":"Collapse"} test suite ${l.name}`,onClick:()=>s(l.id),children:[(0,j.jsx)(Si,{id:l.id,name:l.name,skip:l.skip,only:l.only}),d?(0,j.jsx)(Du,{}):(0,j.jsx)(ju,{})]})}),!d&&l.childrenNodes&&l.childrenNodes.length>0&&(0,j.jsx)("ul",{className:"twd-test-list",children:l.childrenNodes.map(p=>u(p,c+1))})]},l.id)};return(0,j.jsx)("ul",{ref:o,className:"twd-test-list",role:"list","aria-label":"Test list",children:e.length===0&&r?(0,j.jsxs)("li",{style:{padding:"var(--twd-spacing-md)",color:"var(--twd-text-secondary)",fontSize:"var(--twd-font-size-sm)",textAlign:"center"},children:['No tests match "',r,'"']}):e.map(l=>u(l))})},Bu={left:{left:0,borderTopRightRadius:"var(--twd-border-radius-lg)",borderBottomRightRadius:"var(--twd-border-radius-lg)",borderTopLeftRadius:"0",borderBottomLeftRadius:"0"},right:{right:0,borderTopLeftRadius:"var(--twd-border-radius-lg)",borderBottomLeftRadius:"var(--twd-border-radius-lg)",borderTopRightRadius:"0",borderBottomRightRadius:"0"}},$u=({setOpen:e,position:t})=>(0,j.jsx)("button",{"aria-label":"Open TWD sidebar",className:"twd-btn twd-sidebar-closed",style:{...Bu[t]},onClick:()=>e(!0),children:"TWD"}),Fu=({isOpen:e,position:t})=>{(0,oe.useEffect)(()=>{const r=document.documentElement,n=getComputedStyle(document.documentElement).getPropertyValue("--twd-sidebar-width")||"280px";return e?t==="left"?r.style.marginLeft=n:r.style.marginRight=n:(r.style.marginRight="0",r.style.marginLeft="0"),()=>{r.style.marginRight="0",r.style.marginLeft="0"}},[e,t])},Uu=()=>(0,j.jsxs)(Br,{className:"lucide-wifi-pen-icon lucide-wifi-pen",dataTestId:"wifi-pen-icon",children:[(0,j.jsx)("path",{d:"M2 8.82a15 15 0 0 1 20 0"}),(0,j.jsx)("path",{d:"M21.378 16.626a1 1 0 0 0-3.004-3.004l-4.01 4.012a2 2 0 0 0-.506.854l-.837 2.87a.5.5 0 0 0 .62.62l2.87-.837a2 2 0 0 0 .854-.506z"}),(0,j.jsx)("path",{d:"M5 12.859a10 10 0 0 1 10.5-2.222"}),(0,j.jsx)("path",{d:"M8.5 16.429a5 5 0 0 1 3-1.406"})]}),zu=()=>{const e=xo(),t=e.filter(n=>n.executed),r=()=>{console.group("🌐 TWD Mock Rules"),console.log("Total rules:",e.length),console.log("Triggered rules:",t.length),console.log("Rules details:"),console.log(e),console.groupEnd()};return(0,j.jsxs)("button",{onClick:r,"aria-label":"View mock rules details in console",className:"twd-btn twd-btn-mock-rules",children:[(0,j.jsx)(Uu,{}),(0,j.jsxs)("span",{style:{flex:1},children:["Rules: ",t.length,"/",e.length," triggered"]}),(0,j.jsx)("span",{style:{fontSize:"var(--twd-font-size-xs)",color:"var(--twd-text)",fontWeight:"var(--twd-font-weight-medium)"},children:"View rules in console"})]})},Vu=e=>e instanceof Error&&"actual"in e&&"expected"in e,xi=e=>e.actual!==void 0&&e.expected!==void 0?{type:"diff",actual:e.actual,expected:e.expected,operator:e.operator}:{type:"message",message:e.message},Hu=e=>{const t=xi(e);if(t.type==="diff"){const r=t.operator||"unknown";console.error(`Assertion failed with operator: ${r}`),console.group("Expected:"),console.log(t.expected),console.groupEnd(),console.group("Actual:"),console.log(t.actual),console.groupEnd()}else console.error(t.message)},Wu=e=>{if(e.status==="pass")return`Test "${e.name}" passed.`;if(e.status==="fail"){if(!e.logs||e.logs.length===0)return`Test "${e.name}" failed.`;const t=e.logs[e.logs.length-1];try{const r=JSON.parse(t);return r.type===Ze.CHAI_MESSAGE||r.type===Ze.ERROR?`Test "${e.name}" failed. ${r.message}`:r.type===Ze.CHAI_DIFF?`Test "${e.name}" failed. Expected value does not match actual value.`:`Test "${e.name}" failed.`}catch{return`Test "${e.name}" failed. ${t}`}}else if(e.status==="skip")return`Test "${e.name}" skipped.`;return""},Ku=e=>{const t=e.filter(i=>i.type==="test"),r=t.filter(i=>i.status==="pass").length,n=t.filter(i=>i.status==="fail").length,a=t.filter(i=>i.status==="skip").length,o=[];return n>0?(o.push("Test run completed."),o.push(`${r} test${r!==1?"s":""} passed`),o.push(`${n} test${n!==1?"s":""} failed`),a>0&&o.push(`${a} test${a!==1?"s":""} skipped`),o.join(", ")+"."):(o.push("All tests passed."),o.push(`${r} test${r!==1?"s":""} completed`),a>0&&o.push(`${a} test${a!==1?"s":""} skipped`),o.join(", ")+".")},Gu=({value:e,onChange:t})=>(0,j.jsx)("div",{className:"twd-search-wrapper",children:(0,j.jsx)("input",{type:"search",id:"twd-search-input","aria-label":"Filter tests",placeholder:"Filter tests...",value:e,onInput:r=>t(r.target.value),className:"twd-search-input"})}),Yu=(e,t)=>{if(!t.trim())return e;const r=t.toLowerCase(),n=a=>{const o=a.name.toLowerCase().includes(r);if(a.type==="test")return o?a:null;const i=(a.childrenNodes||[]).map(n).filter(s=>s!==null);return o||i.length>0?{...a,childrenNodes:o?a.childrenNodes:i}:null};return e.map(n).filter(a=>a!==null)},Xu=e=>{const t=new Map,r=[];for(const n of e)t.set(n.id,{...n,childrenNodes:[]});for(const n of t.values())n.parent?t.get(n.parent)?.childrenNodes?.push(n):r.push(n);return r},Ju={left:{left:0,borderRight:"1px solid var(--twd-border)"},right:{right:0,borderLeft:"1px solid var(--twd-border)"}},Qu=e=>e?sessionStorage.getItem("twd-search-filter")||"":(sessionStorage.removeItem("twd-search-filter"),""),Zu=e=>sessionStorage.getItem("twd-sidebar-open")?sessionStorage.getItem("twd-sidebar-open")==="true":e,Oi=e=>{const t=[];for(const r of e)r.type==="test"&&t.push(r.id),r.childrenNodes&&t.push(...Oi(r.childrenNodes));return t},ec=({open:e,position:t="left",search:r})=>{const[n,a]=(0,oe.useState)(0),[o,i]=(0,oe.useState)(Zu(e));Fu({isOpen:o,position:t});const[s,u]=(0,oe.useState)(""),[l,c]=(0,oe.useState)(Qu(r));(0,oe.useEffect)(()=>{const y=()=>a(v=>v+1);return window.addEventListener("twd:state-change",y),()=>window.removeEventListener("twd:state-change",y)},[]);const d=new Mt.TestRunner({onStart:y=>{y.status="running",a(v=>v+1)},onPass:y=>{y.status="pass",a(v=>v+1)},onFail:(y,v)=>{if(y.status="fail",console.group(`%c❌ Test failed: ${y.name}`,"color: red; font-weight: bold;"),Vu(v)){Hu(v);const _=xi(v);_.type==="diff"?y.logs.push(JSON.stringify({type:Ze.CHAI_DIFF,expected:_.expected,actual:_.actual})):y.logs.push(JSON.stringify({type:Ze.CHAI_MESSAGE,message:`Test failed: ${_.message}`}))}else console.error(v.message),y.logs.push(JSON.stringify({type:Ze.ERROR,message:`Test failed: ${v.message}`}));console.groupEnd(),a(_=>_+1)},onSkip:y=>{y.status="skip",a(v=>v+1)}}),p=y=>{c(y),y?sessionStorage.setItem("twd-search-filter",y):sessionStorage.removeItem("twd-search-filter")},f=y=>{i(y),sessionStorage.setItem("twd-sidebar-open",y.toString())},g=Array.from(Mt.handlers.values()),h=(0,oe.useMemo)(()=>Xu(g),[n]),S=(0,oe.useMemo)(()=>Yu(h,l),[h,l]),{filteredTestIds:E,displayTests:w}=(0,oe.useMemo)(()=>{if(l){const y=Oi(S),v=new Set(y);return{filteredTestIds:y,displayTests:g.filter(_=>_.type==="test"&&v.has(_.id))}}return{filteredTestIds:null,displayTests:g.filter(y=>y.type==="test")}},[S,l,n]),x=async()=>{u(""),sessionStorage.removeItem("twd-last-run-test-name"),E?await d.runByIds(E):await d.runAll(),u(Ku(g))},M=async y=>{const v=Array.from(Mt.handlers.values()).filter(_=>_.type==="test").find(_=>_.id===y);v&&(u(""),sessionStorage.setItem("twd-last-run-test-name",v.name),await d.runSingle(v.id),u(Wu(v)))};if(!o)return(0,j.jsx)($u,{position:t,setOpen:f});const A=w.length;return(0,j.jsxs)("div",{className:"twd-sidebar",style:Ju[t],"data-testid":"twd-sidebar",role:"complementary","aria-label":"Test While Developing sidebar",children:[(0,j.jsx)("div",{"aria-live":"polite","aria-atomic":"true",style:{position:"absolute",width:"1px",height:"1px",margin:"-1px",border:"0",padding:"0",overflow:"hidden",clip:"rect(0 0 0 0)"},children:s}),(0,j.jsxs)("div",{"data-testid":"twd-sidebar-header",className:"twd-sidebar-header",children:[(0,j.jsxs)("div",{className:"twd-sidebar-header-row",children:[(0,j.jsxs)("div",{className:"twd-sidebar-header-buttons",children:[(0,j.jsx)("button",{onClick:()=>{x()},className:"twd-btn twd-btn-primary",children:(0,j.jsx)("span",{"aria-live":"polite",children:l?"Run Filtered":"Run All"})}),(0,j.jsx)("button",{onClick:()=>{Oo(),tn.clearComponentMocks()},"aria-label":"Clear all mocks",className:"twd-btn twd-btn-secondary",children:"Clear mocks"}),(0,j.jsxs)("span",{className:"twd-sidebar-version",children:["v",Tr]})]}),(0,j.jsx)("button",{"aria-label":"Close sidebar",className:"twd-btn twd-btn-icon",onClick:()=>f(!1),children:"✖"})]}),(0,j.jsxs)("div",{className:"twd-sidebar-stats",children:[(0,j.jsxs)("span",{style:{color:"var(--twd-text)"},children:["Total: ",A]}),(0,j.jsxs)("div",{className:"twd-sidebar-stats-counts",children:[(0,j.jsxs)("span",{style:{color:"var(--twd-success)"},children:["✓ ",w.filter(y=>y.status==="pass").length]}),(0,j.jsxs)("span",{style:{color:"var(--twd-error)"},children:["✗ ",w.filter(y=>y.status==="fail").length]})]})]}),(0,j.jsx)(zu,{}),r&&(0,j.jsx)(Gu,{value:l,onChange:p})]}),(0,j.jsx)("div",{className:"twd-sidebar-content",children:(0,j.jsx)(Lu,{roots:S,runTest:M,searchQuery:l})})]})},Mi={primary:"#2563eb",background:"#1e293b",backgroundSecondary:"#182130",border:"#475569",borderLight:"#64748b",text:"#f1f5f9",textSecondary:"#cbd5e1",textMuted:"#94a3b8",describeBg:"#0f172a",describeText:"#f1f5f9",describeBorder:"#334155",success:"#22c55e",successBg:"#14532d",error:"#ff5252",errorBg:"#7f1d1d",warning:"#fbbf24",warningBg:"#78350f",skip:"#475569",skipBg:"#334155",buttonPrimary:"#2563eb",buttonPrimaryText:"#ffffff",buttonSecondary:"#334155",buttonSecondaryText:"#f1f5f9",buttonBorder:"#475569",spacingXs:"4px",spacingSm:"6px",spacingMd:"8px",spacingLg:"12px",spacingXl:"14px",fontSizeXs:"10px",fontSizeSm:"12px",fontSizeMd:"14px",fontSizeLg:"16px",fontWeightNormal:"400",fontWeightMedium:"500",fontWeightBold:"700",sidebarWidth:"320px",borderRadius:"8px",borderRadiusLg:"6px",shadow:"2px 0 8px rgba(0,0,0,0.3)",shadowSm:"0 2px 4px rgba(0, 0, 0, 0.2)",zIndexSidebar:"99999",zIndexSticky:"100000",animationDuration:"0.2s",iconColor:"#f1f5f9",iconColorSecondary:"#cbd5e1"};function tc(e={}){const t={...Mi,...e};return Object.entries(t).map(([r,n])=>`${`--twd-${r.replace(/([A-Z])/g,"-$1").toLowerCase()}`}: ${n};`).join(`
|
|
21
21
|
`)}function Ai(e){const t="twd-theme-variables";let r=document.getElementById(t);r||(r=document.createElement("style"),r.id=t,document.head.appendChild(r));const n=tc(e);r.textContent=`
|
|
22
22
|
:root {
|
|
23
23
|
${n}
|
|
@@ -178,15 +178,14 @@ Last error: ${d.message}`;i(new Error(`${p}${f}.${g}`));return}setTimeout(l,n)}}
|
|
|
178
178
|
margin-bottom: var(--twd-spacing-sm);
|
|
179
179
|
}
|
|
180
180
|
.twd-test-group-toggle {
|
|
181
|
-
font-weight: var(--twd-font-weight-
|
|
182
|
-
font-size: var(--twd-font-size-
|
|
181
|
+
font-weight: var(--twd-font-weight-bold);
|
|
182
|
+
font-size: var(--twd-font-size-md);
|
|
183
183
|
cursor: pointer;
|
|
184
184
|
color: var(--twd-describe-text);
|
|
185
185
|
display: flex;
|
|
186
186
|
align-items: center;
|
|
187
187
|
justify-content: space-between;
|
|
188
188
|
gap: var(--twd-spacing-sm);
|
|
189
|
-
text-transform: uppercase;
|
|
190
189
|
letter-spacing: 0.05em;
|
|
191
190
|
}
|
|
192
191
|
.twd-test-item {
|
|
@@ -197,7 +196,7 @@ Last error: ${d.message}`;i(new Error(`${p}${f}.${g}`));return}setTimeout(l,n)}}
|
|
|
197
196
|
border-radius: var(--twd-border-radius);
|
|
198
197
|
}
|
|
199
198
|
.twd-test-item-name {
|
|
200
|
-
font-weight: var(--twd-font-weight-
|
|
199
|
+
font-weight: var(--twd-font-weight-normal);
|
|
201
200
|
font-size: var(--twd-font-size-md);
|
|
202
201
|
color: var(--twd-text);
|
|
203
202
|
max-width: 220px;
|
package/dist/index.es.js
CHANGED
|
@@ -260,7 +260,7 @@ var Fl = {
|
|
|
260
260
|
throw new Error(`Unknown assertion: ${String(a)}`);
|
|
261
261
|
}
|
|
262
262
|
return on(u, n, i[s].pass(r), i[s].fail(r, l));
|
|
263
|
-
}, Mr = "1.8.
|
|
263
|
+
}, Mr = "1.8.2", Ul = () => typeof window < "u" ? (window.__TWD_MOCK_STATE__ || (window.__TWD_MOCK_STATE__ = {
|
|
264
264
|
rules: [],
|
|
265
265
|
counts: {}
|
|
266
266
|
}), window.__TWD_MOCK_STATE__) : {
|
|
@@ -3420,7 +3420,7 @@ var xu = () => /* @__PURE__ */ $("svg", {
|
|
|
3420
3420
|
textSecondary: "#cbd5e1",
|
|
3421
3421
|
textMuted: "#94a3b8",
|
|
3422
3422
|
describeBg: "#0f172a",
|
|
3423
|
-
describeText: "#
|
|
3423
|
+
describeText: "#f1f5f9",
|
|
3424
3424
|
describeBorder: "#334155",
|
|
3425
3425
|
success: "#22c55e",
|
|
3426
3426
|
successBg: "#14532d",
|
|
@@ -3633,15 +3633,14 @@ var sc = `
|
|
|
3633
3633
|
margin-bottom: var(--twd-spacing-sm);
|
|
3634
3634
|
}
|
|
3635
3635
|
.twd-test-group-toggle {
|
|
3636
|
-
font-weight: var(--twd-font-weight-
|
|
3637
|
-
font-size: var(--twd-font-size-
|
|
3636
|
+
font-weight: var(--twd-font-weight-bold);
|
|
3637
|
+
font-size: var(--twd-font-size-md);
|
|
3638
3638
|
cursor: pointer;
|
|
3639
3639
|
color: var(--twd-describe-text);
|
|
3640
3640
|
display: flex;
|
|
3641
3641
|
align-items: center;
|
|
3642
3642
|
justify-content: space-between;
|
|
3643
3643
|
gap: var(--twd-spacing-sm);
|
|
3644
|
-
text-transform: uppercase;
|
|
3645
3644
|
letter-spacing: 0.05em;
|
|
3646
3645
|
}
|
|
3647
3646
|
.twd-test-item {
|
|
@@ -3652,7 +3651,7 @@ var sc = `
|
|
|
3652
3651
|
border-radius: var(--twd-border-radius);
|
|
3653
3652
|
}
|
|
3654
3653
|
.twd-test-item-name {
|
|
3655
|
-
font-weight: var(--twd-font-weight-
|
|
3654
|
+
font-weight: var(--twd-font-weight-normal);
|
|
3656
3655
|
font-size: var(--twd-font-size-md);
|
|
3657
3656
|
color: var(--twd-text);
|
|
3658
3657
|
max-width: 220px;
|