twd-js 1.3.0-beta.1 → 1.3.0-beta.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.
@@ -29736,7 +29736,7 @@ const AU = {
29736
29736
  }, si = (a) => {
29737
29737
  const u = Bl.size ? Array.from(Bl.values()).find((s) => s.status === "running") : null;
29738
29738
  u && u.logs?.push(a);
29739
- }, LC = "1.3.0-beta.1", wU = () => typeof window < "u" ? (window.__TWD_MOCK_STATE__ || (window.__TWD_MOCK_STATE__ = {
29739
+ }, LC = "1.3.0-beta.2", wU = () => typeof window < "u" ? (window.__TWD_MOCK_STATE__ || (window.__TWD_MOCK_STATE__ = {
29740
29740
  rules: []
29741
29741
  }), window.__TWD_MOCK_STATE__) : {
29742
29742
  rules: []
@@ -46056,7 +46056,7 @@ function UL(a, u, s) {
46056
46056
  }
46057
46057
  return d === "within" ? `helper: within(<${(s[0]?.tagName || "unknown").toLowerCase()}>) called` : d === "prettyDOM" || d === "logDOM" ? `debug: ${d} called` : ["act", "waitFor", "waitForElementToBeRemoved"].includes(d) ? `async utility: ${d} executed` : `method: ${a}.${d} executed`;
46058
46058
  }
46059
- const jL = () => document.querySelector("body > div:not(#twd-sidebar-root)") ?? document.body, BL = (a, u) => {
46059
+ const jL = () => document.querySelector("body > :not(#twd-sidebar-root):not(script):not(style)") ?? document.body, BL = (a, u) => {
46060
46060
  const s = jL(), m = J3(s)[a];
46061
46061
  if (typeof m == "function")
46062
46062
  return m(...u);
@@ -245,7 +245,7 @@ You might need to use a local HTTP server (instead of file://): https://react.de
245
245
  0% { transform: rotate(0deg); }
246
246
  100% { transform: rotate(360deg); }
247
247
  }
248
- `,document.head.appendChild(fS));const dS=({className:a,children:u,dataTestId:s})=>We.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"#000",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:`lucide ${a}`,"data-testid":s,children:u}),Pz=()=>We.jsx(dS,{className:"lucide-play-icon lucide-play",dataTestId:"play-icon",children:We.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"})}),uw=({id:a,name:u,skip:s,only:d})=>We.jsxs(We.Fragment,{children:[u," ",d&&We.jsxs("span",{style:{color:"#2563eb"},"data-testid":`only-indicator-${a}`,children:[" ","(only)"]}),s&&We.jsxs("span",{style:{color:"#6b7280"},"data-testid":`skip-indicator-${a}`,children:[" ","(skipped)"]})]}),kz=a=>{switch(a.status){case"pass":return{item:{background:"#dcfce7"},container:{borderLeft:"3px solid #00c951"}};case"fail":return{item:{background:"#fee2e2"},container:{borderLeft:"3px solid #fb2c36"}};case"skip":return{item:{background:"#f3f4f6"}};case"running":return{item:{background:"#fef9c3"}};default:return{item:{background:"transparent"}}}},Xz=a=>a.startsWith("Assertion passed")||a.startsWith("Event fired")?{color:"#0d542b",fontWeight:"700"}:a.startsWith("Test failed")?{color:"#fb2c36",fontWeight:"700"}:{},Qz=({node:a,depth:u,id:s,runTest:d})=>{const m=kz(a);return We.jsxs("li",{style:{marginBottom:"4px",marginLeft:u*6,...m.container},"data-testid":`test-list-item-${s}`,children:[We.jsxs("div",{style:{display:"flex",alignItems:"left",justifyContent:"space-between",padding:"4px 6px",borderRadius:"4px",...m.item},children:[We.jsx("span",{style:{fontWeight:"500",color:"#374151",maxWidth:"220px"},children:We.jsx(uw,{id:s,name:a.name,skip:a.skip,only:a.only})}),We.jsx("button",{onClick:()=>d(s),"aria-label":`Run ${a.name} test`,style:{background:"transparent",border:"1px solid #d1d5db",borderRadius:"4px",padding:"0",cursor:"pointer",verticalAlign:"middle",fontSize:"12px",width:"24px",height:"24px",display:"flex",alignItems:"center",justifyContent:"center"},disabled:a.status==="running","data-testid":`run-test-button-${s}`,children:a.status==="running"?We.jsx(Vz,{}):We.jsx(Pz,{})})]}),a.logs&&a.logs.length>0&&We.jsx("ul",{style:{borderRadius:"4px",maxHeight:"260px",overflowY:"auto",padding:0,background:"#f3f4f6",listStyle:"none",marginTop:"4px",textAlign:"left"},children:a.logs.map((b,g)=>We.jsx("li",{style:{fontSize:"12px",padding:"4px 6px",borderBottom:"1px solid #d1d5db",color:"#374151",...Xz(b)},children:b},g))})]},a.name)},$z=()=>We.jsx(dS,{className:"lucide-chevron-down-icon lucide-chevron-down",dataTestId:"chevron-down-icon",children:We.jsx("path",{d:"m6 9 6 6 6-6"})}),Zz=()=>We.jsx(dS,{className:"lucide-chevron-right-icon lucide-chevron-right",dataTestId:"chevron-right-icon",children:We.jsx("path",{d:"m9 18 6-6-6-6"})}),Jz=({tests:a,runTest:u})=>{const[s,d]=cS.useState({}),m=S=>d(R=>({...R,[S]:!R[S]})),b=(S,R=0)=>{if(S.type==="test")return We.jsx(Qz,{node:S,depth:R,id:S.id,runTest:()=>u(S.id)},S.id);const _=s[S.id];return We.jsxs("li",{style:{marginLeft:R*12},children:[We.jsxs("span",{style:{fontWeight:"bold",cursor:"pointer",color:"#374151",display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:"4px",gap:"6px"},"data-testid":`test-group-${S.name}`,tabIndex:0,role:"button","aria-expanded":!_,onClick:()=>m(S.id),children:[We.jsx(uw,{id:S.id,name:S.name,skip:S.skip,only:S.only}),_?We.jsx(Zz,{}):We.jsx($z,{})]}),!_&&S.childrenNodes&&S.childrenNodes.length>0&&We.jsx("ul",{style:{listStyle:"none",padding:0,margin:0},children:S.childrenNodes.map(O=>b(O,R+1))})]},S.id)},g=Yz(a);return We.jsx("ul",{style:{listStyle:"none",padding:0,margin:0},children:g.map(S=>b(S))})},Kz={left:{left:0,borderTopRightRadius:"6px",borderBottomRightRadius:"6px",borderTopLeftRadius:"0",borderBottomLeftRadius:"0"},right:{right:0,borderTopLeftRadius:"6px",borderBottomLeftRadius:"6px",borderTopRightRadius:"0",borderBottomRightRadius:"0"}},Iz=({setOpen:a,position:u})=>We.jsx("button",{"aria-label":"Open TWD sidebar",style:{position:"fixed",top:"50%",transform:"translateY(-50%)",background:"#1A6EF4",color:"white",padding:"6px 10px",cursor:"pointer",fontSize:"12px",...Kz[u]},onClick:()=>a(!0),children:"TWD"}),Fz=({isOpen:a,position:u})=>{cS.useEffect(()=>{const s=document.documentElement;return a?u==="left"?s.style.marginLeft="280px":s.style.marginRight="280px":(s.style.marginRight="0",s.style.marginLeft="0"),()=>{s.style.marginRight="0",s.style.marginLeft="0"}},[a,u])},pS=typeof window<"u"?(window.__TWD_STATE__||(window.__TWD_STATE__={handlers:new Map,beforeEachHooks:new Map,afterEachHooks:new Map,stack:[]}),window.__TWD_STATE__):{handlers:new Map,beforeEachHooks:new Map,afterEachHooks:new Map,stack:[]},fl=pS.handlers,iw=pS.beforeEachHooks,ow=pS.afterEachHooks;pS.stack;const Wz=a=>{const u=[],s=[];let d=a;for(;d;)iw.has(d)&&u.unshift(...iw.get(d)),ow.has(d)&&s.push(...ow.get(d)),d=fl.get(d)?.parent;return{before:u,after:s}},OT=a=>{const u=fl.get(a);return u?u.only?!0:u.children?u.children.some(s=>OT(s)):!1:!1},eN=a=>{let u=fl.get(a);for(;u?.parent;){const s=fl.get(u.parent);if(s?.only)return!0;u=s}return!1},sw=a=>{let u=fl.get(a);for(;u;){if(u.skip)return!0;if(!u.parent)break;u=fl.get(u.parent)}return!1};class cw{events;constructor(u){this.events=u}async runAll(){const u=Array.from(fl.values()).filter(d=>!d.parent&&d.type==="suite"),s=Array.from(fl.values()).some(d=>d.only);for(const d of u)await this.runSuite(d,s);return fl}async runSingle(u){const s=fl.get(u);if(!s||s.type!=="test")return;await this.runTest(s,!1)}async runSuite(u,s){if(sw(u.id)&&!OT(u.id)){this.events.onSkip?.(u);return}if(s&&!OT(u.id))return;this.events.onSuiteStart?.(u);const m=(u.children||[]).map(b=>fl.get(b));for(const b of m)b.type==="suite"?await this.runSuite(b,s):b.type==="test"&&await this.runTest(b,s);this.events.onSuiteEnd?.(u)}async runTest(u,s){if((sw(u.id)||u.skip)&&!u.only){this.events.onSkip(u);return}const m=eN(u.id);if(s&&!u.only&&!m){this.events.onSkip(u);return}this.events.onStart?.(u);const b=Wz(u.parent);try{for(const g of b.before)await g();u.logs=[],await u.handler(),this.events.onPass(u)}catch(g){this.events.onFail(u,g)}finally{for(const g of b.after)await g()}}}window.__testRunner=cw;const tN=(a,u,s=2e3,d=50)=>new Promise((m,b)=>{const g=Date.now(),S=()=>{const R=u();if(R)return m(R);if(Date.now()-g>s)return b(new Error(`Timeout waiting for element ${a}`));setTimeout(S,d)};S()}),nN=(a,u,s=2e3,d=50)=>new Promise((m,b)=>{const g=Date.now(),S=()=>{const R=u();if(R&&R.length>0)return m(Array.from(R));if(Date.now()-g>s)return b(new Error(`Timeout waiting for elements ${a}`));setTimeout(S,d)};S()}),hS=a=>new Promise(u=>setTimeout(u,a)),MT=(a,u,s,d)=>{if(!a&&!u)throw new Error(d);if(a&&u)throw new Error(d.replace("to be","to not be").replace("to have","to not have").replace("to contain","to not contain"));return s};function aN(a){if(!a.isConnected)return!1;let u=a;for(;u;){const s=getComputedStyle(u);if(s.display==="none"||s.visibility==="hidden"||s.visibility==="collapse")return!1;u=u.parentElement}return!0}const lN={"have.text":{positive:{pass:a=>`Assertion passed: Text is exactly "${a[0]}"`,fail:(a,u)=>`Assertion failed: Expected text to be "${a[0]}", but got "${u}"`},negative:{pass:a=>`Assertion passed: Text is not exactly "${a[0]}"`,fail:(a,u)=>`Assertion failed: Expected text to not be "${a[0]}", but got "${u}"`}},"contain.text":{positive:{pass:a=>`Assertion passed: Text contains "${a[0]}"`,fail:(a,u)=>`Assertion failed: Expected text to contain "${a[0]}", but got "${u}"`},negative:{pass:a=>`Assertion passed: Text does not contain "${a[0]}"`,fail:(a,u)=>`Assertion failed: Expected text to not contain "${a[0]}", but got "${u}"`}},"be.empty":{positive:{pass:()=>"Assertion passed: Text is empty",fail:(a,u)=>`Assertion failed: Expected text to be empty, but got "${u}"`},negative:{pass:()=>"Assertion passed: Text is not empty",fail:(a,u)=>`Assertion failed: Expected text to not be empty, but got "${u}"`}},"have.attr":{positive:{pass:a=>`Assertion passed: Attribute "${a[0]}" is "${a[1]}"`,fail:(a,u)=>`Assertion failed: Expected attribute "${a[0]}" to be "${a[1]}", but got "${u}"`},negative:{pass:a=>`Assertion passed: Attribute "${a[0]}" is not "${a[1]}"`,fail:(a,u)=>`Assertion failed: Expected attribute "${a[0]}" to not be "${a[1]}", but got "${u}"`}},"have.value":{positive:{pass:a=>`Assertion passed: Value is "${a[0]}"`,fail:(a,u)=>`Assertion failed: Expected value to be "${a[0]}", but got "${u}"`},negative:{pass:a=>`Assertion passed: Value is not "${a[0]}"`,fail:(a,u)=>`Assertion failed: Expected value to not be "${a[0]}", but got "${u}"`}},"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"}},"have.class":{positive:{pass:a=>`Assertion passed: Element has class "${a[0]}"`,fail:a=>`Assertion failed: Expected element to have class "${a[0]}"`},negative:{pass:a=>`Assertion passed: Element does not have class "${a[0]}"`,fail:a=>`Assertion failed: Expected element to not have class "${a[0]}"`}}},xT=(a,u,...s)=>{const d=u.startsWith("not."),m=d?u.slice(4):u,b=(a.textContent||"").trim(),g=lN[m];if(!g)throw new Error(`Unknown assertion: ${m}`);const S=d?"negative":"positive";let R,_;switch(m){case"have.text":R=b===s[0],_=b;break;case"contain.text":R=b.includes(s[0]),_=b;break;case"be.empty":R=b.length===0,_=b;break;case"have.attr":_=a.getAttribute(s[0]),R=_===s[1];break;case"have.value":_=a.value,R=_===s[0];break;case"be.disabled":R=a.disabled===!0;break;case"be.enabled":R=a.disabled===!1;break;case"be.checked":R=a.checked===!0;break;case"be.selected":R=a.selected===!0;break;case"be.focused":R=document.activeElement===a;break;case"be.visible":R=aN(a);break;case"have.class":R=a.classList.contains(s[0]);break;default:throw new Error(`Unknown assertion: ${m}`)}return MT(R,d,g[S].pass(s),g[S].fail(s,_))},qu=a=>{const u=fl.size?Array.from(fl.values()).find(s=>s.status==="running"):null;u&&u.logs?.push(a)},qT="1.3.0-beta.1",qs=(typeof window<"u"?(window.__TWD_MOCK_STATE__||(window.__TWD_MOCK_STATE__={rules:[]}),window.__TWD_MOCK_STATE__):{rules:[]}).rules,rN=100,uN=async a=>{if("serviceWorker"in navigator){const u=a??"/mock-sw.js";await navigator.serviceWorker.register(`${u}?v=${qT}`),navigator.serviceWorker.controller||await new Promise(s=>{navigator.serviceWorker.addEventListener("controllerchange",s,{once:!0})}),navigator.serviceWorker.addEventListener("message",s=>{if(s.data?.type==="EXECUTED"){const{alias:d,request:m}=s.data,b=qs.find(g=>g.alias===d);b&&(b.executed=!0,b.request=m)}})}},iN=async(a,u)=>{const s={alias:a,...u,executed:!1},d=qs.findIndex(m=>m.alias===a);d!==-1?qs[d]=s:qs.push(s),navigator.serviceWorker.controller?.postMessage({type:"ADD_RULE",rule:s,version:qT}),await hS(rN),await Promise.resolve()},oN=async a=>await Promise.all(a.map(s=>fw(s))),fw=async(a,u=10,s=100)=>{if(!qs.find(m=>m.alias===a))throw new Error(`Rule ${a} not found`);for(let m=0;m<u;m++){const b=qs.find(g=>g.alias===a&&g.executed);if(b)return Promise.resolve(b);m<u-1&&await new Promise(g=>setTimeout(g,s))}throw console.log(`Rule ${a} was not executed within ${u*s}ms`),new Error(`Rule ${a} was not executed within ${u*s}ms`)},sN=()=>qs,cN=()=>{navigator.serviceWorker.controller?.postMessage({type:"CLEAR_RULES",version:qT}),qs.length=0},fN=(a,u)=>{const s=a.startsWith("not.");switch(s?a.slice(4):a){case"eq":return MT(window.location.href===u,s,`Assertion passed: URL is ${u}`,`Assertion failed: Expected URL to be ${u}, but got ${window.location.href}`);case"contain.url":return MT(window.location.href.includes(u),s,`Assertion passed: URL contains ${u}`,`Assertion failed: Expected URL to contain ${u}, but got ${window.location.href}`);default:throw new Error(`Unknown assertion: ${a}`)}},dN=()=>({location:window.location,should:async(a,u,s=5)=>{let d="",m;for(let b=0;b<s;b++)try{d=fN(a,u),qu(d);break}catch(g){await new Promise(S=>setTimeout(S,100)),m=g}if(m)throw m;return d}}),pN=100,hN=async(a,u)=>{if(qu(`visit("${a}")`),window.location.pathname===a||u){const s=`/__dummy_${Math.random().toString(36).slice(2)}`;window.history.pushState({},"",s),window.dispatchEvent(new PopStateEvent("popstate")),await hS(10)}window.history.pushState({},"",a),window.dispatchEvent(new PopStateEvent("popstate")),await hS(pN)},dw=new Map,mN=(a,u)=>{dw.set(a,u)};function yN(){dw.clear()}const pw={get:async a=>{const u=`body > div:not(#twd-sidebar-root) ${a}`;qu(`Searching get("${a}")`);const s=await tN(a,()=>document.querySelector(u)),d={el:s,should:(m,...b)=>{const g=xT(s,m,...b);return qu(g),d}};return d},setInputValue:(a,u)=>{const{set:s}=Object.getOwnPropertyDescriptor(a.__proto__,"value");s.call(a,u),a.dispatchEvent(new Event("input",{bubbles:!0}))},getAll:async a=>{const u=`body > div:not(#twd-sidebar-root) ${a}`;return qu(`Searching getAll("${a}")`),(await nN(a,()=>document.querySelectorAll(u))).map(d=>{const m={el:d,should:(b,...g)=>{const S=xT(d,b,...g);return qu(S),m}};return m})},visit:hN,url:dN,mockRequest:iN,waitForRequest:fw,waitForRequests:oN,initRequestMocking:uN,clearRequestMockRules:cN,getRequestMockRules:sN,should:(a,u,...s)=>{const d=xT(a,u,...s);qu(d)},wait:hS,mockComponent:mN,clearComponentMocks:yN,notExists:async a=>{const u=`body > div:not(#twd-sidebar-root) ${a}`;if(qu(`Checking notExists("${a}")`),document.querySelector(u))throw new Error(`Element "${a}" exists in the DOM.`);qu(`Assertion passed: Element "${a}" does not exist in the DOM.`)}};var DT=Object.defineProperty,vN=(a,u,s)=>u in a?DT(a,u,{enumerable:!0,configurable:!0,writable:!0,value:s}):a[u]=s,le=(a,u)=>DT(a,"name",{value:u,configurable:!0}),zT=(a,u)=>{for(var s in u)DT(a,s,{get:u[s],enumerable:!0})},hw=(a,u,s)=>vN(a,typeof u!="symbol"?u+"":u,s),mS={};zT(mS,{addChainableMethod:()=>s_,addLengthGuard:()=>oy,addMethod:()=>u_,addProperty:()=>r_,checkError:()=>tr,compareByInspect:()=>RS,eql:()=>$w,events:()=>SS,expectTypes:()=>Rw,flag:()=>Et,getActual:()=>vS,getMessage:()=>kT,getName:()=>_S,getOperator:()=>p_,getOwnEnumerableProperties:()=>d_,getOwnEnumerablePropertySymbols:()=>f_,getPathInfo:()=>a_,hasProperty:()=>ES,inspect:()=>Yt,isNaN:()=>TS,isNumeric:()=>Ra,isProxyEnabled:()=>iy,isRegExp:()=>AS,objDisplay:()=>gf,overwriteChainableMethod:()=>c_,overwriteMethod:()=>o_,overwriteProperty:()=>i_,proxify:()=>Ep,test:()=>NT,transferFlags:()=>Du,type:()=>rn});var tr={};zT(tr,{compatibleConstructor:()=>vw,compatibleInstance:()=>yw,compatibleMessage:()=>bw,getConstructorName:()=>gw,getMessage:()=>Ew});function yS(a){return a instanceof Error||Object.prototype.toString.call(a)==="[object Error]"}le(yS,"isErrorInstance");function mw(a){return Object.prototype.toString.call(a)==="[object RegExp]"}le(mw,"isRegExp");function yw(a,u){return yS(u)&&a===u}le(yw,"compatibleInstance");function vw(a,u){return yS(u)?a.constructor===u.constructor||a instanceof u.constructor:(typeof u=="object"||typeof u=="function")&&u.prototype?a.constructor===u||a instanceof u:!1}le(vw,"compatibleConstructor");function bw(a,u){const s=typeof a=="string"?a:a.message;return mw(u)?u.test(s):typeof u=="string"?s.indexOf(u)!==-1:!1}le(bw,"compatibleMessage");function gw(a){let u=a;return yS(a)?u=a.constructor.name:typeof a=="function"&&(u=a.name,u===""&&(u=new a().name||u)),u}le(gw,"getConstructorName");function Ew(a){let u="";return a&&a.message?u=a.message:typeof a=="string"&&(u=a),u}le(Ew,"getMessage");function Et(a,u,s){let d=a.__flags||(a.__flags=Object.create(null));if(arguments.length===3)d[u]=s;else return d[u]}le(Et,"flag");function NT(a,u){let s=Et(a,"negate"),d=u[0];return s?!d:d}le(NT,"test");function rn(a){if(typeof a>"u")return"undefined";if(a===null)return"null";const u=a[Symbol.toStringTag];return typeof u=="string"?u:Object.prototype.toString.call(a).slice(8,-1)}le(rn,"type");var bN="captureStackTrace"in Error,Sw=class Tz extends Error{constructor(u="Unspecified AssertionError",s,d){super(u),hw(this,"message"),this.message=u,bN&&Error.captureStackTrace(this,d||Tz);for(const m in s)m in this||(this[m]=s[m])}get name(){return"AssertionError"}get ok(){return!1}toJSON(u){return{...this,name:this.name,message:this.message,ok:!1,stack:u!==!1?this.stack:void 0}}};le(Sw,"AssertionError");var Xt=Sw;function Rw(a,u){let s=Et(a,"message"),d=Et(a,"ssfi");s=s?s+": ":"",a=Et(a,"object"),u=u.map(function(g){return g.toLowerCase()}),u.sort();let m=u.map(function(g,S){let R=~["a","e","i","o","u"].indexOf(g.charAt(0))?"an":"a";return(u.length>1&&S===u.length-1?"or ":"")+R+" "+g}).join(", "),b=rn(a).toLowerCase();if(!u.some(function(g){return b===g}))throw new Xt(s+"object tested must be "+m+", but "+b+" given",void 0,d)}le(Rw,"expectTypes");function vS(a,u){return u.length>4?u[4]:a._obj}le(vS,"getActual");var Tw={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"]},gN={special:"cyan",number:"yellow",bigint:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",symbol:"green",date:"magenta",regexp:"red"},bp="…";function _w(a,u){const s=Tw[gN[u]]||Tw[u]||"";return s?`\x1B[${s[0]}m${String(a)}\x1B[${s[1]}m`:String(a)}le(_w,"colorise");function Aw({showHidden:a=!1,depth:u=2,colors:s=!1,customInspect:d=!0,showProxy:m=!1,maxArrayLength:b=1/0,breakLength:g=1/0,seen:S=[],truncate:R=1/0,stylize:_=String}={},O){const A={showHidden:!!a,depth:Number(u),colors:!!s,customInspect:!!d,showProxy:!!m,maxArrayLength:Number(b),breakLength:Number(g),truncate:Number(R),seen:S,inspect:O,stylize:_};return A.colors&&(A.stylize=_w),A}le(Aw,"normaliseOptions");function Cw(a){return a>="\uD800"&&a<="\uDBFF"}le(Cw,"isHighSurrogate");function uo(a,u,s=bp){a=String(a);const d=s.length,m=a.length;if(d>u&&m>d)return s;if(m>u&&m>d){let b=u-d;return b>0&&Cw(a[b-1])&&(b=b-1),`${a.slice(0,b)}${s}`}return a}le(uo,"truncate");function Nr(a,u,s,d=", "){s=s||u.inspect;const m=a.length;if(m===0)return"";const b=u.truncate;let g="",S="",R="";for(let _=0;_<m;_+=1){const O=_+1===a.length,A=_+2===a.length;R=`${bp}(${a.length-_})`;const T=a[_];u.truncate=b-g.length-(O?0:d.length);const z=S||s(T,u)+(O?"":d),U=g.length+z.length,G=U+R.length;if(O&&U>b&&g.length+R.length<=b||!O&&!A&&G>b||(S=O?"":s(a[_+1],u)+(A?"":d),!O&&A&&G>b&&U+S.length>b))break;if(g+=z,!O&&!A&&U+S.length>=b){R=`${bp}(${a.length-_-1})`;break}R=""}return`${g}${R}`}le(Nr,"inspectList");function ww(a){return a.match(/^[a-zA-Z_][a-zA-Z_0-9]*$/)?a:JSON.stringify(a).replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'")}le(ww,"quoteComplexKey");function gp([a,u],s){return s.truncate-=2,typeof a=="string"?a=ww(a):typeof a!="number"&&(a=`[${s.inspect(a,s)}]`),s.truncate-=a.length,u=s.inspect(u,s),`${a}: ${u}`}le(gp,"inspectProperty");function Ow(a,u){const s=Object.keys(a).slice(a.length);if(!a.length&&!s.length)return"[]";u.truncate-=4;const d=Nr(a,u);u.truncate-=d.length;let m="";return s.length&&(m=Nr(s.map(b=>[b,a[b]]),u,gp)),`[ ${d}${m?`, ${m}`:""} ]`}le(Ow,"inspectArray");var EN=le(a=>typeof Buffer=="function"&&a instanceof Buffer?"Buffer":a[Symbol.toStringTag]?a[Symbol.toStringTag]:a.constructor.name,"getArrayName");function di(a,u){const s=EN(a);u.truncate-=s.length+4;const d=Object.keys(a).slice(a.length);if(!a.length&&!d.length)return`${s}[]`;let m="";for(let g=0;g<a.length;g++){const S=`${u.stylize(uo(a[g],u.truncate),"number")}${g===a.length-1?"":", "}`;if(u.truncate-=S.length,a[g]!==a.length&&u.truncate<=3){m+=`${bp}(${a.length-a[g]+1})`;break}m+=S}let b="";return d.length&&(b=Nr(d.map(g=>[g,a[g]]),u,gp)),`${s}[ ${m}${b?`, ${b}`:""} ]`}le(di,"inspectTypedArray");function Mw(a,u){const s=a.toJSON();if(s===null)return"Invalid Date";const d=s.split("T"),m=d[0];return u.stylize(`${m}T${uo(d[1],u.truncate-m.length-1)}`,"date")}le(Mw,"inspectDate");function UT(a,u){const s=a[Symbol.toStringTag]||"Function",d=a.name;return d?u.stylize(`[${s} ${uo(d,u.truncate-11)}]`,"special"):u.stylize(`[${s}]`,"special")}le(UT,"inspectFunction");function xw([a,u],s){return s.truncate-=4,a=s.inspect(a,s),s.truncate-=a.length,u=s.inspect(u,s),`${a} => ${u}`}le(xw,"inspectMapEntry");function qw(a){const u=[];return a.forEach((s,d)=>{u.push([d,s])}),u}le(qw,"mapToEntries");function Dw(a,u){return a.size===0?"Map{}":(u.truncate-=7,`Map{ ${Nr(qw(a),u,xw)} }`)}le(Dw,"inspectMap");var SN=Number.isNaN||(a=>a!==a);function jT(a,u){return SN(a)?u.stylize("NaN","number"):a===1/0?u.stylize("Infinity","number"):a===-1/0?u.stylize("-Infinity","number"):a===0?u.stylize(1/a===1/0?"+0":"-0","number"):u.stylize(uo(String(a),u.truncate),"number")}le(jT,"inspectNumber");function BT(a,u){let s=uo(a.toString(),u.truncate-1);return s!==bp&&(s+="n"),u.stylize(s,"bigint")}le(BT,"inspectBigInt");function zw(a,u){const s=a.toString().split("/")[2],d=u.truncate-(2+s.length),m=a.source;return u.stylize(`/${uo(m,d)}/${s}`,"regexp")}le(zw,"inspectRegExp");function Nw(a){const u=[];return a.forEach(s=>{u.push(s)}),u}le(Nw,"arrayFromSet");function Uw(a,u){return a.size===0?"Set{}":(u.truncate-=7,`Set{ ${Nr(Nw(a),u)} }`)}le(Uw,"inspectSet");var jw=new RegExp("['\\u0000-\\u001f\\u007f-\\u009f\\u00ad\\u0600-\\u0604\\u070f\\u17b4\\u17b5\\u200c-\\u200f\\u2028-\\u202f\\u2060-\\u206f\\ufeff\\ufff0-\\uffff]","g"),RN={"\b":"\\b"," ":"\\t","\n":"\\n","\f":"\\f","\r":"\\r","'":"\\'","\\":"\\\\"},TN=16;function Bw(a){return RN[a]||`\\u${`0000${a.charCodeAt(0).toString(TN)}`.slice(-4)}`}le(Bw,"escape");function HT(a,u){return jw.test(a)&&(a=a.replace(jw,Bw)),u.stylize(`'${uo(a,u.truncate-2)}'`,"string")}le(HT,"inspectString");function LT(a){return"description"in Symbol.prototype?a.description?`Symbol(${a.description})`:"Symbol()":a.toString()}le(LT,"inspectSymbol");var _N=le(()=>"Promise{…}","getPromiseValue"),AN=_N;function ay(a,u){const s=Object.getOwnPropertyNames(a),d=Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(a):[];if(s.length===0&&d.length===0)return"{}";if(u.truncate-=4,u.seen=u.seen||[],u.seen.includes(a))return"[Circular]";u.seen.push(a);const m=Nr(s.map(S=>[S,a[S]]),u,gp),b=Nr(d.map(S=>[S,a[S]]),u,gp);u.seen.pop();let g="";return m&&b&&(g=", "),`{ ${m}${g}${b} }`}le(ay,"inspectObject");var YT=typeof Symbol<"u"&&Symbol.toStringTag?Symbol.toStringTag:!1;function Hw(a,u){let s="";return YT&&YT in a&&(s=a[YT]),s=s||a.constructor.name,(!s||s==="_class")&&(s="<Anonymous Class>"),u.truncate-=s.length,`${s}${ay(a,u)}`}le(Hw,"inspectClass");function Lw(a,u){return a.length===0?"Arguments[]":(u.truncate-=13,`Arguments[ ${Nr(a,u)} ]`)}le(Lw,"inspectArguments");var CN=["stack","line","column","name","message","fileName","lineNumber","columnNumber","number","description","cause"];function Yw(a,u){const s=Object.getOwnPropertyNames(a).filter(g=>CN.indexOf(g)===-1),d=a.name;u.truncate-=d.length;let m="";if(typeof a.message=="string"?m=uo(a.message,u.truncate):s.unshift("message"),m=m?`: ${m}`:"",u.truncate-=m.length+5,u.seen=u.seen||[],u.seen.includes(a))return"[Circular]";u.seen.push(a);const b=Nr(s.map(g=>[g,a[g]]),u,gp);return`${d}${m}${b?` { ${b} }`:""}`}le(Yw,"inspectObject");function Gw([a,u],s){return s.truncate-=3,u?`${s.stylize(String(a),"yellow")}=${s.stylize(`"${u}"`,"string")}`:`${s.stylize(String(a),"yellow")}`}le(Gw,"inspectAttribute");function bS(a,u){return Nr(a,u,Vw,`
248
+ `,document.head.appendChild(fS));const dS=({className:a,children:u,dataTestId:s})=>We.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"#000",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:`lucide ${a}`,"data-testid":s,children:u}),Pz=()=>We.jsx(dS,{className:"lucide-play-icon lucide-play",dataTestId:"play-icon",children:We.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"})}),uw=({id:a,name:u,skip:s,only:d})=>We.jsxs(We.Fragment,{children:[u," ",d&&We.jsxs("span",{style:{color:"#2563eb"},"data-testid":`only-indicator-${a}`,children:[" ","(only)"]}),s&&We.jsxs("span",{style:{color:"#6b7280"},"data-testid":`skip-indicator-${a}`,children:[" ","(skipped)"]})]}),kz=a=>{switch(a.status){case"pass":return{item:{background:"#dcfce7"},container:{borderLeft:"3px solid #00c951"}};case"fail":return{item:{background:"#fee2e2"},container:{borderLeft:"3px solid #fb2c36"}};case"skip":return{item:{background:"#f3f4f6"}};case"running":return{item:{background:"#fef9c3"}};default:return{item:{background:"transparent"}}}},Xz=a=>a.startsWith("Assertion passed")||a.startsWith("Event fired")?{color:"#0d542b",fontWeight:"700"}:a.startsWith("Test failed")?{color:"#fb2c36",fontWeight:"700"}:{},Qz=({node:a,depth:u,id:s,runTest:d})=>{const m=kz(a);return We.jsxs("li",{style:{marginBottom:"4px",marginLeft:u*6,...m.container},"data-testid":`test-list-item-${s}`,children:[We.jsxs("div",{style:{display:"flex",alignItems:"left",justifyContent:"space-between",padding:"4px 6px",borderRadius:"4px",...m.item},children:[We.jsx("span",{style:{fontWeight:"500",color:"#374151",maxWidth:"220px"},children:We.jsx(uw,{id:s,name:a.name,skip:a.skip,only:a.only})}),We.jsx("button",{onClick:()=>d(s),"aria-label":`Run ${a.name} test`,style:{background:"transparent",border:"1px solid #d1d5db",borderRadius:"4px",padding:"0",cursor:"pointer",verticalAlign:"middle",fontSize:"12px",width:"24px",height:"24px",display:"flex",alignItems:"center",justifyContent:"center"},disabled:a.status==="running","data-testid":`run-test-button-${s}`,children:a.status==="running"?We.jsx(Vz,{}):We.jsx(Pz,{})})]}),a.logs&&a.logs.length>0&&We.jsx("ul",{style:{borderRadius:"4px",maxHeight:"260px",overflowY:"auto",padding:0,background:"#f3f4f6",listStyle:"none",marginTop:"4px",textAlign:"left"},children:a.logs.map((b,g)=>We.jsx("li",{style:{fontSize:"12px",padding:"4px 6px",borderBottom:"1px solid #d1d5db",color:"#374151",...Xz(b)},children:b},g))})]},a.name)},$z=()=>We.jsx(dS,{className:"lucide-chevron-down-icon lucide-chevron-down",dataTestId:"chevron-down-icon",children:We.jsx("path",{d:"m6 9 6 6 6-6"})}),Zz=()=>We.jsx(dS,{className:"lucide-chevron-right-icon lucide-chevron-right",dataTestId:"chevron-right-icon",children:We.jsx("path",{d:"m9 18 6-6-6-6"})}),Jz=({tests:a,runTest:u})=>{const[s,d]=cS.useState({}),m=S=>d(R=>({...R,[S]:!R[S]})),b=(S,R=0)=>{if(S.type==="test")return We.jsx(Qz,{node:S,depth:R,id:S.id,runTest:()=>u(S.id)},S.id);const _=s[S.id];return We.jsxs("li",{style:{marginLeft:R*12},children:[We.jsxs("span",{style:{fontWeight:"bold",cursor:"pointer",color:"#374151",display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:"4px",gap:"6px"},"data-testid":`test-group-${S.name}`,tabIndex:0,role:"button","aria-expanded":!_,onClick:()=>m(S.id),children:[We.jsx(uw,{id:S.id,name:S.name,skip:S.skip,only:S.only}),_?We.jsx(Zz,{}):We.jsx($z,{})]}),!_&&S.childrenNodes&&S.childrenNodes.length>0&&We.jsx("ul",{style:{listStyle:"none",padding:0,margin:0},children:S.childrenNodes.map(O=>b(O,R+1))})]},S.id)},g=Yz(a);return We.jsx("ul",{style:{listStyle:"none",padding:0,margin:0},children:g.map(S=>b(S))})},Kz={left:{left:0,borderTopRightRadius:"6px",borderBottomRightRadius:"6px",borderTopLeftRadius:"0",borderBottomLeftRadius:"0"},right:{right:0,borderTopLeftRadius:"6px",borderBottomLeftRadius:"6px",borderTopRightRadius:"0",borderBottomRightRadius:"0"}},Iz=({setOpen:a,position:u})=>We.jsx("button",{"aria-label":"Open TWD sidebar",style:{position:"fixed",top:"50%",transform:"translateY(-50%)",background:"#1A6EF4",color:"white",padding:"6px 10px",cursor:"pointer",fontSize:"12px",...Kz[u]},onClick:()=>a(!0),children:"TWD"}),Fz=({isOpen:a,position:u})=>{cS.useEffect(()=>{const s=document.documentElement;return a?u==="left"?s.style.marginLeft="280px":s.style.marginRight="280px":(s.style.marginRight="0",s.style.marginLeft="0"),()=>{s.style.marginRight="0",s.style.marginLeft="0"}},[a,u])},pS=typeof window<"u"?(window.__TWD_STATE__||(window.__TWD_STATE__={handlers:new Map,beforeEachHooks:new Map,afterEachHooks:new Map,stack:[]}),window.__TWD_STATE__):{handlers:new Map,beforeEachHooks:new Map,afterEachHooks:new Map,stack:[]},fl=pS.handlers,iw=pS.beforeEachHooks,ow=pS.afterEachHooks;pS.stack;const Wz=a=>{const u=[],s=[];let d=a;for(;d;)iw.has(d)&&u.unshift(...iw.get(d)),ow.has(d)&&s.push(...ow.get(d)),d=fl.get(d)?.parent;return{before:u,after:s}},OT=a=>{const u=fl.get(a);return u?u.only?!0:u.children?u.children.some(s=>OT(s)):!1:!1},eN=a=>{let u=fl.get(a);for(;u?.parent;){const s=fl.get(u.parent);if(s?.only)return!0;u=s}return!1},sw=a=>{let u=fl.get(a);for(;u;){if(u.skip)return!0;if(!u.parent)break;u=fl.get(u.parent)}return!1};class cw{events;constructor(u){this.events=u}async runAll(){const u=Array.from(fl.values()).filter(d=>!d.parent&&d.type==="suite"),s=Array.from(fl.values()).some(d=>d.only);for(const d of u)await this.runSuite(d,s);return fl}async runSingle(u){const s=fl.get(u);if(!s||s.type!=="test")return;await this.runTest(s,!1)}async runSuite(u,s){if(sw(u.id)&&!OT(u.id)){this.events.onSkip?.(u);return}if(s&&!OT(u.id))return;this.events.onSuiteStart?.(u);const m=(u.children||[]).map(b=>fl.get(b));for(const b of m)b.type==="suite"?await this.runSuite(b,s):b.type==="test"&&await this.runTest(b,s);this.events.onSuiteEnd?.(u)}async runTest(u,s){if((sw(u.id)||u.skip)&&!u.only){this.events.onSkip(u);return}const m=eN(u.id);if(s&&!u.only&&!m){this.events.onSkip(u);return}this.events.onStart?.(u);const b=Wz(u.parent);try{for(const g of b.before)await g();u.logs=[],await u.handler(),this.events.onPass(u)}catch(g){this.events.onFail(u,g)}finally{for(const g of b.after)await g()}}}window.__testRunner=cw;const tN=(a,u,s=2e3,d=50)=>new Promise((m,b)=>{const g=Date.now(),S=()=>{const R=u();if(R)return m(R);if(Date.now()-g>s)return b(new Error(`Timeout waiting for element ${a}`));setTimeout(S,d)};S()}),nN=(a,u,s=2e3,d=50)=>new Promise((m,b)=>{const g=Date.now(),S=()=>{const R=u();if(R&&R.length>0)return m(Array.from(R));if(Date.now()-g>s)return b(new Error(`Timeout waiting for elements ${a}`));setTimeout(S,d)};S()}),hS=a=>new Promise(u=>setTimeout(u,a)),MT=(a,u,s,d)=>{if(!a&&!u)throw new Error(d);if(a&&u)throw new Error(d.replace("to be","to not be").replace("to have","to not have").replace("to contain","to not contain"));return s};function aN(a){if(!a.isConnected)return!1;let u=a;for(;u;){const s=getComputedStyle(u);if(s.display==="none"||s.visibility==="hidden"||s.visibility==="collapse")return!1;u=u.parentElement}return!0}const lN={"have.text":{positive:{pass:a=>`Assertion passed: Text is exactly "${a[0]}"`,fail:(a,u)=>`Assertion failed: Expected text to be "${a[0]}", but got "${u}"`},negative:{pass:a=>`Assertion passed: Text is not exactly "${a[0]}"`,fail:(a,u)=>`Assertion failed: Expected text to not be "${a[0]}", but got "${u}"`}},"contain.text":{positive:{pass:a=>`Assertion passed: Text contains "${a[0]}"`,fail:(a,u)=>`Assertion failed: Expected text to contain "${a[0]}", but got "${u}"`},negative:{pass:a=>`Assertion passed: Text does not contain "${a[0]}"`,fail:(a,u)=>`Assertion failed: Expected text to not contain "${a[0]}", but got "${u}"`}},"be.empty":{positive:{pass:()=>"Assertion passed: Text is empty",fail:(a,u)=>`Assertion failed: Expected text to be empty, but got "${u}"`},negative:{pass:()=>"Assertion passed: Text is not empty",fail:(a,u)=>`Assertion failed: Expected text to not be empty, but got "${u}"`}},"have.attr":{positive:{pass:a=>`Assertion passed: Attribute "${a[0]}" is "${a[1]}"`,fail:(a,u)=>`Assertion failed: Expected attribute "${a[0]}" to be "${a[1]}", but got "${u}"`},negative:{pass:a=>`Assertion passed: Attribute "${a[0]}" is not "${a[1]}"`,fail:(a,u)=>`Assertion failed: Expected attribute "${a[0]}" to not be "${a[1]}", but got "${u}"`}},"have.value":{positive:{pass:a=>`Assertion passed: Value is "${a[0]}"`,fail:(a,u)=>`Assertion failed: Expected value to be "${a[0]}", but got "${u}"`},negative:{pass:a=>`Assertion passed: Value is not "${a[0]}"`,fail:(a,u)=>`Assertion failed: Expected value to not be "${a[0]}", but got "${u}"`}},"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"}},"have.class":{positive:{pass:a=>`Assertion passed: Element has class "${a[0]}"`,fail:a=>`Assertion failed: Expected element to have class "${a[0]}"`},negative:{pass:a=>`Assertion passed: Element does not have class "${a[0]}"`,fail:a=>`Assertion failed: Expected element to not have class "${a[0]}"`}}},xT=(a,u,...s)=>{const d=u.startsWith("not."),m=d?u.slice(4):u,b=(a.textContent||"").trim(),g=lN[m];if(!g)throw new Error(`Unknown assertion: ${m}`);const S=d?"negative":"positive";let R,_;switch(m){case"have.text":R=b===s[0],_=b;break;case"contain.text":R=b.includes(s[0]),_=b;break;case"be.empty":R=b.length===0,_=b;break;case"have.attr":_=a.getAttribute(s[0]),R=_===s[1];break;case"have.value":_=a.value,R=_===s[0];break;case"be.disabled":R=a.disabled===!0;break;case"be.enabled":R=a.disabled===!1;break;case"be.checked":R=a.checked===!0;break;case"be.selected":R=a.selected===!0;break;case"be.focused":R=document.activeElement===a;break;case"be.visible":R=aN(a);break;case"have.class":R=a.classList.contains(s[0]);break;default:throw new Error(`Unknown assertion: ${m}`)}return MT(R,d,g[S].pass(s),g[S].fail(s,_))},qu=a=>{const u=fl.size?Array.from(fl.values()).find(s=>s.status==="running"):null;u&&u.logs?.push(a)},qT="1.3.0-beta.2",qs=(typeof window<"u"?(window.__TWD_MOCK_STATE__||(window.__TWD_MOCK_STATE__={rules:[]}),window.__TWD_MOCK_STATE__):{rules:[]}).rules,rN=100,uN=async a=>{if("serviceWorker"in navigator){const u=a??"/mock-sw.js";await navigator.serviceWorker.register(`${u}?v=${qT}`),navigator.serviceWorker.controller||await new Promise(s=>{navigator.serviceWorker.addEventListener("controllerchange",s,{once:!0})}),navigator.serviceWorker.addEventListener("message",s=>{if(s.data?.type==="EXECUTED"){const{alias:d,request:m}=s.data,b=qs.find(g=>g.alias===d);b&&(b.executed=!0,b.request=m)}})}},iN=async(a,u)=>{const s={alias:a,...u,executed:!1},d=qs.findIndex(m=>m.alias===a);d!==-1?qs[d]=s:qs.push(s),navigator.serviceWorker.controller?.postMessage({type:"ADD_RULE",rule:s,version:qT}),await hS(rN),await Promise.resolve()},oN=async a=>await Promise.all(a.map(s=>fw(s))),fw=async(a,u=10,s=100)=>{if(!qs.find(m=>m.alias===a))throw new Error(`Rule ${a} not found`);for(let m=0;m<u;m++){const b=qs.find(g=>g.alias===a&&g.executed);if(b)return Promise.resolve(b);m<u-1&&await new Promise(g=>setTimeout(g,s))}throw console.log(`Rule ${a} was not executed within ${u*s}ms`),new Error(`Rule ${a} was not executed within ${u*s}ms`)},sN=()=>qs,cN=()=>{navigator.serviceWorker.controller?.postMessage({type:"CLEAR_RULES",version:qT}),qs.length=0},fN=(a,u)=>{const s=a.startsWith("not.");switch(s?a.slice(4):a){case"eq":return MT(window.location.href===u,s,`Assertion passed: URL is ${u}`,`Assertion failed: Expected URL to be ${u}, but got ${window.location.href}`);case"contain.url":return MT(window.location.href.includes(u),s,`Assertion passed: URL contains ${u}`,`Assertion failed: Expected URL to contain ${u}, but got ${window.location.href}`);default:throw new Error(`Unknown assertion: ${a}`)}},dN=()=>({location:window.location,should:async(a,u,s=5)=>{let d="",m;for(let b=0;b<s;b++)try{d=fN(a,u),qu(d);break}catch(g){await new Promise(S=>setTimeout(S,100)),m=g}if(m)throw m;return d}}),pN=100,hN=async(a,u)=>{if(qu(`visit("${a}")`),window.location.pathname===a||u){const s=`/__dummy_${Math.random().toString(36).slice(2)}`;window.history.pushState({},"",s),window.dispatchEvent(new PopStateEvent("popstate")),await hS(10)}window.history.pushState({},"",a),window.dispatchEvent(new PopStateEvent("popstate")),await hS(pN)},dw=new Map,mN=(a,u)=>{dw.set(a,u)};function yN(){dw.clear()}const pw={get:async a=>{const u=`body > div:not(#twd-sidebar-root) ${a}`;qu(`Searching get("${a}")`);const s=await tN(a,()=>document.querySelector(u)),d={el:s,should:(m,...b)=>{const g=xT(s,m,...b);return qu(g),d}};return d},setInputValue:(a,u)=>{const{set:s}=Object.getOwnPropertyDescriptor(a.__proto__,"value");s.call(a,u),a.dispatchEvent(new Event("input",{bubbles:!0}))},getAll:async a=>{const u=`body > div:not(#twd-sidebar-root) ${a}`;return qu(`Searching getAll("${a}")`),(await nN(a,()=>document.querySelectorAll(u))).map(d=>{const m={el:d,should:(b,...g)=>{const S=xT(d,b,...g);return qu(S),m}};return m})},visit:hN,url:dN,mockRequest:iN,waitForRequest:fw,waitForRequests:oN,initRequestMocking:uN,clearRequestMockRules:cN,getRequestMockRules:sN,should:(a,u,...s)=>{const d=xT(a,u,...s);qu(d)},wait:hS,mockComponent:mN,clearComponentMocks:yN,notExists:async a=>{const u=`body > div:not(#twd-sidebar-root) ${a}`;if(qu(`Checking notExists("${a}")`),document.querySelector(u))throw new Error(`Element "${a}" exists in the DOM.`);qu(`Assertion passed: Element "${a}" does not exist in the DOM.`)}};var DT=Object.defineProperty,vN=(a,u,s)=>u in a?DT(a,u,{enumerable:!0,configurable:!0,writable:!0,value:s}):a[u]=s,le=(a,u)=>DT(a,"name",{value:u,configurable:!0}),zT=(a,u)=>{for(var s in u)DT(a,s,{get:u[s],enumerable:!0})},hw=(a,u,s)=>vN(a,typeof u!="symbol"?u+"":u,s),mS={};zT(mS,{addChainableMethod:()=>s_,addLengthGuard:()=>oy,addMethod:()=>u_,addProperty:()=>r_,checkError:()=>tr,compareByInspect:()=>RS,eql:()=>$w,events:()=>SS,expectTypes:()=>Rw,flag:()=>Et,getActual:()=>vS,getMessage:()=>kT,getName:()=>_S,getOperator:()=>p_,getOwnEnumerableProperties:()=>d_,getOwnEnumerablePropertySymbols:()=>f_,getPathInfo:()=>a_,hasProperty:()=>ES,inspect:()=>Yt,isNaN:()=>TS,isNumeric:()=>Ra,isProxyEnabled:()=>iy,isRegExp:()=>AS,objDisplay:()=>gf,overwriteChainableMethod:()=>c_,overwriteMethod:()=>o_,overwriteProperty:()=>i_,proxify:()=>Ep,test:()=>NT,transferFlags:()=>Du,type:()=>rn});var tr={};zT(tr,{compatibleConstructor:()=>vw,compatibleInstance:()=>yw,compatibleMessage:()=>bw,getConstructorName:()=>gw,getMessage:()=>Ew});function yS(a){return a instanceof Error||Object.prototype.toString.call(a)==="[object Error]"}le(yS,"isErrorInstance");function mw(a){return Object.prototype.toString.call(a)==="[object RegExp]"}le(mw,"isRegExp");function yw(a,u){return yS(u)&&a===u}le(yw,"compatibleInstance");function vw(a,u){return yS(u)?a.constructor===u.constructor||a instanceof u.constructor:(typeof u=="object"||typeof u=="function")&&u.prototype?a.constructor===u||a instanceof u:!1}le(vw,"compatibleConstructor");function bw(a,u){const s=typeof a=="string"?a:a.message;return mw(u)?u.test(s):typeof u=="string"?s.indexOf(u)!==-1:!1}le(bw,"compatibleMessage");function gw(a){let u=a;return yS(a)?u=a.constructor.name:typeof a=="function"&&(u=a.name,u===""&&(u=new a().name||u)),u}le(gw,"getConstructorName");function Ew(a){let u="";return a&&a.message?u=a.message:typeof a=="string"&&(u=a),u}le(Ew,"getMessage");function Et(a,u,s){let d=a.__flags||(a.__flags=Object.create(null));if(arguments.length===3)d[u]=s;else return d[u]}le(Et,"flag");function NT(a,u){let s=Et(a,"negate"),d=u[0];return s?!d:d}le(NT,"test");function rn(a){if(typeof a>"u")return"undefined";if(a===null)return"null";const u=a[Symbol.toStringTag];return typeof u=="string"?u:Object.prototype.toString.call(a).slice(8,-1)}le(rn,"type");var bN="captureStackTrace"in Error,Sw=class Tz extends Error{constructor(u="Unspecified AssertionError",s,d){super(u),hw(this,"message"),this.message=u,bN&&Error.captureStackTrace(this,d||Tz);for(const m in s)m in this||(this[m]=s[m])}get name(){return"AssertionError"}get ok(){return!1}toJSON(u){return{...this,name:this.name,message:this.message,ok:!1,stack:u!==!1?this.stack:void 0}}};le(Sw,"AssertionError");var Xt=Sw;function Rw(a,u){let s=Et(a,"message"),d=Et(a,"ssfi");s=s?s+": ":"",a=Et(a,"object"),u=u.map(function(g){return g.toLowerCase()}),u.sort();let m=u.map(function(g,S){let R=~["a","e","i","o","u"].indexOf(g.charAt(0))?"an":"a";return(u.length>1&&S===u.length-1?"or ":"")+R+" "+g}).join(", "),b=rn(a).toLowerCase();if(!u.some(function(g){return b===g}))throw new Xt(s+"object tested must be "+m+", but "+b+" given",void 0,d)}le(Rw,"expectTypes");function vS(a,u){return u.length>4?u[4]:a._obj}le(vS,"getActual");var Tw={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"]},gN={special:"cyan",number:"yellow",bigint:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",symbol:"green",date:"magenta",regexp:"red"},bp="…";function _w(a,u){const s=Tw[gN[u]]||Tw[u]||"";return s?`\x1B[${s[0]}m${String(a)}\x1B[${s[1]}m`:String(a)}le(_w,"colorise");function Aw({showHidden:a=!1,depth:u=2,colors:s=!1,customInspect:d=!0,showProxy:m=!1,maxArrayLength:b=1/0,breakLength:g=1/0,seen:S=[],truncate:R=1/0,stylize:_=String}={},O){const A={showHidden:!!a,depth:Number(u),colors:!!s,customInspect:!!d,showProxy:!!m,maxArrayLength:Number(b),breakLength:Number(g),truncate:Number(R),seen:S,inspect:O,stylize:_};return A.colors&&(A.stylize=_w),A}le(Aw,"normaliseOptions");function Cw(a){return a>="\uD800"&&a<="\uDBFF"}le(Cw,"isHighSurrogate");function uo(a,u,s=bp){a=String(a);const d=s.length,m=a.length;if(d>u&&m>d)return s;if(m>u&&m>d){let b=u-d;return b>0&&Cw(a[b-1])&&(b=b-1),`${a.slice(0,b)}${s}`}return a}le(uo,"truncate");function Nr(a,u,s,d=", "){s=s||u.inspect;const m=a.length;if(m===0)return"";const b=u.truncate;let g="",S="",R="";for(let _=0;_<m;_+=1){const O=_+1===a.length,A=_+2===a.length;R=`${bp}(${a.length-_})`;const T=a[_];u.truncate=b-g.length-(O?0:d.length);const z=S||s(T,u)+(O?"":d),U=g.length+z.length,G=U+R.length;if(O&&U>b&&g.length+R.length<=b||!O&&!A&&G>b||(S=O?"":s(a[_+1],u)+(A?"":d),!O&&A&&G>b&&U+S.length>b))break;if(g+=z,!O&&!A&&U+S.length>=b){R=`${bp}(${a.length-_-1})`;break}R=""}return`${g}${R}`}le(Nr,"inspectList");function ww(a){return a.match(/^[a-zA-Z_][a-zA-Z_0-9]*$/)?a:JSON.stringify(a).replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'")}le(ww,"quoteComplexKey");function gp([a,u],s){return s.truncate-=2,typeof a=="string"?a=ww(a):typeof a!="number"&&(a=`[${s.inspect(a,s)}]`),s.truncate-=a.length,u=s.inspect(u,s),`${a}: ${u}`}le(gp,"inspectProperty");function Ow(a,u){const s=Object.keys(a).slice(a.length);if(!a.length&&!s.length)return"[]";u.truncate-=4;const d=Nr(a,u);u.truncate-=d.length;let m="";return s.length&&(m=Nr(s.map(b=>[b,a[b]]),u,gp)),`[ ${d}${m?`, ${m}`:""} ]`}le(Ow,"inspectArray");var EN=le(a=>typeof Buffer=="function"&&a instanceof Buffer?"Buffer":a[Symbol.toStringTag]?a[Symbol.toStringTag]:a.constructor.name,"getArrayName");function di(a,u){const s=EN(a);u.truncate-=s.length+4;const d=Object.keys(a).slice(a.length);if(!a.length&&!d.length)return`${s}[]`;let m="";for(let g=0;g<a.length;g++){const S=`${u.stylize(uo(a[g],u.truncate),"number")}${g===a.length-1?"":", "}`;if(u.truncate-=S.length,a[g]!==a.length&&u.truncate<=3){m+=`${bp}(${a.length-a[g]+1})`;break}m+=S}let b="";return d.length&&(b=Nr(d.map(g=>[g,a[g]]),u,gp)),`${s}[ ${m}${b?`, ${b}`:""} ]`}le(di,"inspectTypedArray");function Mw(a,u){const s=a.toJSON();if(s===null)return"Invalid Date";const d=s.split("T"),m=d[0];return u.stylize(`${m}T${uo(d[1],u.truncate-m.length-1)}`,"date")}le(Mw,"inspectDate");function UT(a,u){const s=a[Symbol.toStringTag]||"Function",d=a.name;return d?u.stylize(`[${s} ${uo(d,u.truncate-11)}]`,"special"):u.stylize(`[${s}]`,"special")}le(UT,"inspectFunction");function xw([a,u],s){return s.truncate-=4,a=s.inspect(a,s),s.truncate-=a.length,u=s.inspect(u,s),`${a} => ${u}`}le(xw,"inspectMapEntry");function qw(a){const u=[];return a.forEach((s,d)=>{u.push([d,s])}),u}le(qw,"mapToEntries");function Dw(a,u){return a.size===0?"Map{}":(u.truncate-=7,`Map{ ${Nr(qw(a),u,xw)} }`)}le(Dw,"inspectMap");var SN=Number.isNaN||(a=>a!==a);function jT(a,u){return SN(a)?u.stylize("NaN","number"):a===1/0?u.stylize("Infinity","number"):a===-1/0?u.stylize("-Infinity","number"):a===0?u.stylize(1/a===1/0?"+0":"-0","number"):u.stylize(uo(String(a),u.truncate),"number")}le(jT,"inspectNumber");function BT(a,u){let s=uo(a.toString(),u.truncate-1);return s!==bp&&(s+="n"),u.stylize(s,"bigint")}le(BT,"inspectBigInt");function zw(a,u){const s=a.toString().split("/")[2],d=u.truncate-(2+s.length),m=a.source;return u.stylize(`/${uo(m,d)}/${s}`,"regexp")}le(zw,"inspectRegExp");function Nw(a){const u=[];return a.forEach(s=>{u.push(s)}),u}le(Nw,"arrayFromSet");function Uw(a,u){return a.size===0?"Set{}":(u.truncate-=7,`Set{ ${Nr(Nw(a),u)} }`)}le(Uw,"inspectSet");var jw=new RegExp("['\\u0000-\\u001f\\u007f-\\u009f\\u00ad\\u0600-\\u0604\\u070f\\u17b4\\u17b5\\u200c-\\u200f\\u2028-\\u202f\\u2060-\\u206f\\ufeff\\ufff0-\\uffff]","g"),RN={"\b":"\\b"," ":"\\t","\n":"\\n","\f":"\\f","\r":"\\r","'":"\\'","\\":"\\\\"},TN=16;function Bw(a){return RN[a]||`\\u${`0000${a.charCodeAt(0).toString(TN)}`.slice(-4)}`}le(Bw,"escape");function HT(a,u){return jw.test(a)&&(a=a.replace(jw,Bw)),u.stylize(`'${uo(a,u.truncate-2)}'`,"string")}le(HT,"inspectString");function LT(a){return"description"in Symbol.prototype?a.description?`Symbol(${a.description})`:"Symbol()":a.toString()}le(LT,"inspectSymbol");var _N=le(()=>"Promise{…}","getPromiseValue"),AN=_N;function ay(a,u){const s=Object.getOwnPropertyNames(a),d=Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(a):[];if(s.length===0&&d.length===0)return"{}";if(u.truncate-=4,u.seen=u.seen||[],u.seen.includes(a))return"[Circular]";u.seen.push(a);const m=Nr(s.map(S=>[S,a[S]]),u,gp),b=Nr(d.map(S=>[S,a[S]]),u,gp);u.seen.pop();let g="";return m&&b&&(g=", "),`{ ${m}${g}${b} }`}le(ay,"inspectObject");var YT=typeof Symbol<"u"&&Symbol.toStringTag?Symbol.toStringTag:!1;function Hw(a,u){let s="";return YT&&YT in a&&(s=a[YT]),s=s||a.constructor.name,(!s||s==="_class")&&(s="<Anonymous Class>"),u.truncate-=s.length,`${s}${ay(a,u)}`}le(Hw,"inspectClass");function Lw(a,u){return a.length===0?"Arguments[]":(u.truncate-=13,`Arguments[ ${Nr(a,u)} ]`)}le(Lw,"inspectArguments");var CN=["stack","line","column","name","message","fileName","lineNumber","columnNumber","number","description","cause"];function Yw(a,u){const s=Object.getOwnPropertyNames(a).filter(g=>CN.indexOf(g)===-1),d=a.name;u.truncate-=d.length;let m="";if(typeof a.message=="string"?m=uo(a.message,u.truncate):s.unshift("message"),m=m?`: ${m}`:"",u.truncate-=m.length+5,u.seen=u.seen||[],u.seen.includes(a))return"[Circular]";u.seen.push(a);const b=Nr(s.map(g=>[g,a[g]]),u,gp);return`${d}${m}${b?` { ${b} }`:""}`}le(Yw,"inspectObject");function Gw([a,u],s){return s.truncate-=3,u?`${s.stylize(String(a),"yellow")}=${s.stylize(`"${u}"`,"string")}`:`${s.stylize(String(a),"yellow")}`}le(Gw,"inspectAttribute");function bS(a,u){return Nr(a,u,Vw,`
249
249
  `)}le(bS,"inspectNodeCollection");function Vw(a,u){switch(a.nodeType){case 1:return GT(a,u);case 3:return u.inspect(a.data,u);default:return u.inspect(a,u)}}le(Vw,"inspectNode");function GT(a,u){const s=a.getAttributeNames(),d=a.tagName.toLowerCase(),m=u.stylize(`<${d}`,"special"),b=u.stylize(">","special"),g=u.stylize(`</${d}>`,"special");u.truncate-=d.length*2+5;let S="";s.length>0&&(S+=" ",S+=Nr(s.map(O=>[O,a.getAttribute(O)]),u,Gw," ")),u.truncate-=S.length;const R=u.truncate;let _=bS(a.children,u);return _&&_.length>R&&(_=`${bp}(${a.children.length})`),`${m}${S}${b}${_}${g}`}le(GT,"inspectHTML");var wN=typeof Symbol=="function"&&typeof Symbol.for=="function",VT=wN?Symbol.for("chai/inspect"):"@@chai/inspect",PT=Symbol.for("nodejs.util.inspect.custom"),Pw=new WeakMap,kw={},Xw={undefined:le((a,u)=>u.stylize("undefined","undefined"),"undefined"),null:le((a,u)=>u.stylize("null","null"),"null"),boolean:le((a,u)=>u.stylize(String(a),"boolean"),"boolean"),Boolean:le((a,u)=>u.stylize(String(a),"boolean"),"Boolean"),number:jT,Number:jT,bigint:BT,BigInt:BT,string:HT,String:HT,function:UT,Function:UT,symbol:LT,Symbol:LT,Array:Ow,Date:Mw,Map:Dw,Set:Uw,RegExp:zw,Promise:AN,WeakSet:le((a,u)=>u.stylize("WeakSet{…}","special"),"WeakSet"),WeakMap:le((a,u)=>u.stylize("WeakMap{…}","special"),"WeakMap"),Arguments:Lw,Int8Array:di,Uint8Array:di,Uint8ClampedArray:di,Int16Array:di,Uint16Array:di,Int32Array:di,Uint32Array:di,Float32Array:di,Float64Array:di,Generator:le(()=>"","Generator"),DataView:le(()=>"","DataView"),ArrayBuffer:le(()=>"","ArrayBuffer"),Error:Yw,HTMLCollection:bS,NodeList:bS},ON=le((a,u,s,d)=>VT in a&&typeof a[VT]=="function"?a[VT](u):PT in a&&typeof a[PT]=="function"?a[PT](u.depth,u,d):"inspect"in a&&typeof a.inspect=="function"?a.inspect(u.depth,u):"constructor"in a&&Pw.has(a.constructor)?Pw.get(a.constructor)(a,u):kw[s]?kw[s](a,u):"","inspectCustom"),MN=Object.prototype.toString;function ly(a,u={}){const s=Aw(u,ly),{customInspect:d}=s;let m=a===null?"null":typeof a;if(m==="object"&&(m=MN.call(a).slice(8,-1)),m in Xw)return Xw[m](a,s);if(d&&a){const g=ON(a,s,m,ly);if(g)return typeof g=="string"?g:ly(g,s)}const b=a?Object.getPrototypeOf(a):!1;return b===Object.prototype||b===null?ay(a,s):a&&typeof HTMLElement=="function"&&a instanceof HTMLElement?GT(a,s):"constructor"in a?a.constructor!==Object?Hw(a,s):ay(a,s):a===Object(a)?ay(a,s):s.stylize(String(a),m)}le(ly,"inspect");var Ia={includeStack:!1,showDiff:!0,truncateThreshold:40,useProxy:!0,proxyExcludedKeys:["then","catch","inspect","toJSON"],deepEqual:null};function Yt(a,u,s,d){let m={colors:d,depth:typeof s>"u"?2:s,showHidden:u,truncate:Ia.truncateThreshold?Ia.truncateThreshold:1/0};return ly(a,m)}le(Yt,"inspect");function gf(a){let u=Yt(a),s=Object.prototype.toString.call(a);if(Ia.truncateThreshold&&u.length>=Ia.truncateThreshold){if(s==="[object Function]")return!a.name||a.name===""?"[Function]":"[Function: "+a.name+"]";if(s==="[object Array]")return"[ Array("+a.length+") ]";if(s==="[object Object]"){let d=Object.keys(a);return"{ Object ("+(d.length>2?d.splice(0,2).join(", ")+", ...":d.join(", "))+") }"}else return u}else return u}le(gf,"objDisplay");function kT(a,u){let s=Et(a,"negate"),d=Et(a,"object"),m=u[3],b=vS(a,u),g=s?u[2]:u[1],S=Et(a,"message");return typeof g=="function"&&(g=g()),g=g||"",g=g.replace(/#\{this\}/g,function(){return gf(d)}).replace(/#\{act\}/g,function(){return gf(b)}).replace(/#\{exp\}/g,function(){return gf(m)}),S?S+": "+g:g}le(kT,"getMessage");function Du(a,u,s){let d=a.__flags||(a.__flags=Object.create(null));u.__flags||(u.__flags=Object.create(null)),s=arguments.length===3?s:!0;for(let m in d)(s||m!=="object"&&m!=="ssfi"&&m!=="lockSsfi"&&m!="message")&&(u.__flags[m]=d[m])}le(Du,"transferFlags");function XT(a){if(typeof a>"u")return"undefined";if(a===null)return"null";const u=a[Symbol.toStringTag];return typeof u=="string"?u:Object.prototype.toString.call(a).slice(8,-1)}le(XT,"type");function QT(){this._key="chai/deep-eql__"+Math.random()+Date.now()}le(QT,"FakeMap"),QT.prototype={get:le(function(u){return u[this._key]},"get"),set:le(function(u,s){Object.isExtensible(u)&&Object.defineProperty(u,this._key,{value:s,configurable:!0})},"set")};var Qw=typeof WeakMap=="function"?WeakMap:QT;function $T(a,u,s){if(!s||Ef(a)||Ef(u))return null;var d=s.get(a);if(d){var m=d.get(u);if(typeof m=="boolean")return m}return null}le($T,"memoizeCompare");function ry(a,u,s,d){if(!(!s||Ef(a)||Ef(u))){var m=s.get(a);m?m.set(u,d):(m=new Qw,m.set(u,d),s.set(a,m))}}le(ry,"memoizeSet");var $w=uy;function uy(a,u,s){if(s&&s.comparator)return JT(a,u,s);var d=ZT(a,u);return d!==null?d:JT(a,u,s)}le(uy,"deepEqual");function ZT(a,u){return a===u?a!==0||1/a===1/u:a!==a&&u!==u?!0:Ef(a)||Ef(u)?!1:null}le(ZT,"simpleEqual");function JT(a,u,s){s=s||{},s.memoize=s.memoize===!1?!1:s.memoize||new Qw;var d=s&&s.comparator,m=$T(a,u,s.memoize);if(m!==null)return m;var b=$T(u,a,s.memoize);if(b!==null)return b;if(d){var g=d(a,u);if(g===!1||g===!0)return ry(a,u,s.memoize,g),g;var S=ZT(a,u);if(S!==null)return S}var R=XT(a);if(R!==XT(u))return ry(a,u,s.memoize,!1),!1;ry(a,u,s.memoize,!0);var _=Zw(a,u,R,s);return ry(a,u,s.memoize,_),_}le(JT,"extensiveDeepEqual");function Zw(a,u,s,d){switch(s){case"String":case"Number":case"Boolean":case"Date":return uy(a.valueOf(),u.valueOf());case"Promise":case"Symbol":case"function":case"WeakMap":case"WeakSet":return a===u;case"Error":return e_(a,u,["name","message","code"],d);case"Arguments":case"Int8Array":case"Uint8Array":case"Uint8ClampedArray":case"Int16Array":case"Uint16Array":case"Int32Array":case"Uint32Array":case"Float32Array":case"Float64Array":case"Array":return Ds(a,u,d);case"RegExp":return Jw(a,u);case"Generator":return Kw(a,u,d);case"DataView":return Ds(new Uint8Array(a.buffer),new Uint8Array(u.buffer),d);case"ArrayBuffer":return Ds(new Uint8Array(a),new Uint8Array(u),d);case"Set":return KT(a,u,d);case"Map":return KT(a,u,d);case"Temporal.PlainDate":case"Temporal.PlainTime":case"Temporal.PlainDateTime":case"Temporal.Instant":case"Temporal.ZonedDateTime":case"Temporal.PlainYearMonth":case"Temporal.PlainMonthDay":return a.equals(u);case"Temporal.Duration":return a.total("nanoseconds")===u.total("nanoseconds");case"Temporal.TimeZone":case"Temporal.Calendar":return a.toString()===u.toString();default:return Fw(a,u,d)}}le(Zw,"extensiveDeepEqualByType");function Jw(a,u){return a.toString()===u.toString()}le(Jw,"regexpEqual");function KT(a,u,s){try{if(a.size!==u.size)return!1;if(a.size===0)return!0}catch{return!1}var d=[],m=[];return a.forEach(le(function(g,S){d.push([g,S])},"gatherEntries")),u.forEach(le(function(g,S){m.push([g,S])},"gatherEntries")),Ds(d.sort(),m.sort(),s)}le(KT,"entriesEqual");function Ds(a,u,s){var d=a.length;if(d!==u.length)return!1;if(d===0)return!0;for(var m=-1;++m<d;)if(uy(a[m],u[m],s)===!1)return!1;return!0}le(Ds,"iterableEqual");function Kw(a,u,s){return Ds(gS(a),gS(u),s)}le(Kw,"generatorEqual");function Iw(a){return typeof Symbol<"u"&&typeof a=="object"&&typeof Symbol.iterator<"u"&&typeof a[Symbol.iterator]=="function"}le(Iw,"hasIteratorFunction");function IT(a){if(Iw(a))try{return gS(a[Symbol.iterator]())}catch{return[]}return[]}le(IT,"getIteratorEntries");function gS(a){for(var u=a.next(),s=[u.value];u.done===!1;)u=a.next(),s.push(u.value);return s}le(gS,"getGeneratorEntries");function FT(a){var u=[];for(var s in a)u.push(s);return u}le(FT,"getEnumerableKeys");function WT(a){for(var u=[],s=Object.getOwnPropertySymbols(a),d=0;d<s.length;d+=1){var m=s[d];Object.getOwnPropertyDescriptor(a,m).enumerable&&u.push(m)}return u}le(WT,"getEnumerableSymbols");function e_(a,u,s,d){var m=s.length;if(m===0)return!0;for(var b=0;b<m;b+=1)if(uy(a[s[b]],u[s[b]],d)===!1)return!1;return!0}le(e_,"keysEqual");function Fw(a,u,s){var d=FT(a),m=FT(u),b=WT(a),g=WT(u);if(d=d.concat(b),m=m.concat(g),d.length&&d.length===m.length)return Ds(t_(d).sort(),t_(m).sort())===!1?!1:e_(a,u,d,s);var S=IT(a),R=IT(u);return S.length&&S.length===R.length?(S.sort(),R.sort(),Ds(S,R,s)):d.length===0&&S.length===0&&m.length===0&&R.length===0}le(Fw,"objectEqual");function Ef(a){return a===null||typeof a!="object"}le(Ef,"isPrimitive");function t_(a){return a.map(le(function(s){return typeof s=="symbol"?s.toString():s},"mapSymbol"))}le(t_,"mapSymbols");function ES(a,u){return typeof a>"u"||a===null?!1:u in Object(a)}le(ES,"hasProperty");function Ww(a){return a.replace(/([^\\])\[/g,"$1.[").match(/(\\\.|[^.]+?)+/g).map(d=>{if(d==="constructor"||d==="__proto__"||d==="prototype")return{};const b=/^\[(\d+)\]$/.exec(d);let g=null;return b?g={i:parseFloat(b[1])}:g={p:d.replace(/\\([.[\]])/g,"$1")},g})}le(Ww,"parsePath");function n_(a,u,s){let d=a,m=null;s=typeof s>"u"?u.length:s;for(let b=0;b<s;b++){const g=u[b];d&&(typeof g.p>"u"?d=d[g.i]:d=d[g.p],b===s-1&&(m=d))}return m}le(n_,"internalGetPathValue");function a_(a,u){const s=Ww(u),d=s[s.length-1],m={parent:s.length>1?n_(a,s,s.length-1):a,name:d.p||d.i,value:n_(a,s)};return m.exists=ES(m.parent,m.name),m}le(a_,"getPathInfo");var eO=class _z{constructor(u,s,d,m){return hw(this,"__flags",{}),Et(this,"ssfi",d||_z),Et(this,"lockSsfi",m),Et(this,"object",u),Et(this,"message",s),Et(this,"eql",Ia.deepEqual||$w),Ep(this)}static get includeStack(){return console.warn("Assertion.includeStack is deprecated, use chai.config.includeStack instead."),Ia.includeStack}static set includeStack(u){console.warn("Assertion.includeStack is deprecated, use chai.config.includeStack instead."),Ia.includeStack=u}static get showDiff(){return console.warn("Assertion.showDiff is deprecated, use chai.config.showDiff instead."),Ia.showDiff}static set showDiff(u){console.warn("Assertion.showDiff is deprecated, use chai.config.showDiff instead."),Ia.showDiff=u}static addProperty(u,s){r_(this.prototype,u,s)}static addMethod(u,s){u_(this.prototype,u,s)}static addChainableMethod(u,s,d){s_(this.prototype,u,s,d)}static overwriteProperty(u,s){i_(this.prototype,u,s)}static overwriteMethod(u,s){o_(this.prototype,u,s)}static overwriteChainableMethod(u,s,d){c_(this.prototype,u,s,d)}assert(u,s,d,m,b,g){const S=NT(this,arguments);if(g!==!1&&(g=!0),m===void 0&&b===void 0&&(g=!1),Ia.showDiff!==!0&&(g=!1),!S){s=kT(this,arguments);const _={actual:vS(this,arguments),expected:m,showDiff:g},O=p_(this,arguments);throw O&&(_.operator=O),new Xt(s,_,Ia.includeStack?this.assert:Et(this,"ssfi"))}}get _obj(){return Et(this,"object")}set _obj(u){Et(this,"object",u)}};le(eO,"Assertion");var H=eO,SS=new EventTarget,tO=class extends Event{constructor(u,s,d){super(u),this.name=String(s),this.fn=d}};le(tO,"PluginEvent");var l_=tO;function iy(){return Ia.useProxy&&typeof Proxy<"u"&&typeof Reflect<"u"}le(iy,"isProxyEnabled");function r_(a,u,s){s=s===void 0?function(){}:s,Object.defineProperty(a,u,{get:le(function d(){!iy()&&!Et(this,"lockSsfi")&&Et(this,"ssfi",d);let m=s.call(this);if(m!==void 0)return m;let b=new H;return Du(this,b),b},"propertyGetter"),configurable:!0}),SS.dispatchEvent(new l_("addProperty",u,s))}le(r_,"addProperty");var xN=Object.getOwnPropertyDescriptor(function(){},"length");function oy(a,u,s){return xN.configurable&&Object.defineProperty(a,"length",{get:le(function(){throw Error(s?"Invalid Chai property: "+u+'.length. Due to a compatibility issue, "length" cannot directly follow "'+u+'". Use "'+u+'.lengthOf" instead.':"Invalid Chai property: "+u+'.length. See docs for proper usage of "'+u+'".')},"get")}),a}le(oy,"addLengthGuard");function nO(a){let u=Object.getOwnPropertyNames(a);function s(m){u.indexOf(m)===-1&&u.push(m)}le(s,"addProperty");let d=Object.getPrototypeOf(a);for(;d!==null;)Object.getOwnPropertyNames(d).forEach(s),d=Object.getPrototypeOf(d);return u}le(nO,"getProperties");var aO=["__flags","__methods","_obj","assert"];function Ep(a,u){return iy()?new Proxy(a,{get:le(function s(d,m){if(typeof m=="string"&&Ia.proxyExcludedKeys.indexOf(m)===-1&&!Reflect.has(d,m)){if(u)throw Error("Invalid Chai property: "+u+"."+m+'. See docs for proper usage of "'+u+'".');let b=null,g=4;throw nO(d).forEach(function(S){if(!Object.prototype.hasOwnProperty(S)&&aO.indexOf(S)===-1){let R=lO(m,S,g);R<g&&(b=S,g=R)}}),Error(b!==null?"Invalid Chai property: "+m+'. Did you mean "'+b+'"?':"Invalid Chai property: "+m)}return aO.indexOf(m)===-1&&!Et(d,"lockSsfi")&&Et(d,"ssfi",s),Reflect.get(d,m)},"proxyGetter")}):a}le(Ep,"proxify");function lO(a,u,s){if(Math.abs(a.length-u.length)>=s)return s;let d=[];for(let m=0;m<=a.length;m++)d[m]=Array(u.length+1).fill(0),d[m][0]=m;for(let m=0;m<u.length;m++)d[0][m]=m;for(let m=1;m<=a.length;m++){let b=a.charCodeAt(m-1);for(let g=1;g<=u.length;g++){if(Math.abs(m-g)>=s){d[m][g]=s;continue}d[m][g]=Math.min(d[m-1][g]+1,d[m][g-1]+1,d[m-1][g-1]+(b===u.charCodeAt(g-1)?0:1))}}return d[a.length][u.length]}le(lO,"stringDistanceCapped");function u_(a,u,s){let d=le(function(){Et(this,"lockSsfi")||Et(this,"ssfi",d);let m=s.apply(this,arguments);if(m!==void 0)return m;let b=new H;return Du(this,b),b},"methodWrapper");oy(d,u,!1),a[u]=Ep(d,u),SS.dispatchEvent(new l_("addMethod",u,s))}le(u_,"addMethod");function i_(a,u,s){let d=Object.getOwnPropertyDescriptor(a,u),m=le(function(){},"_super");d&&typeof d.get=="function"&&(m=d.get),Object.defineProperty(a,u,{get:le(function b(){!iy()&&!Et(this,"lockSsfi")&&Et(this,"ssfi",b);let g=Et(this,"lockSsfi");Et(this,"lockSsfi",!0);let S=s(m).call(this);if(Et(this,"lockSsfi",g),S!==void 0)return S;let R=new H;return Du(this,R),R},"overwritingPropertyGetter"),configurable:!0})}le(i_,"overwriteProperty");function o_(a,u,s){let d=a[u],m=le(function(){throw new Error(u+" is not a function")},"_super");d&&typeof d=="function"&&(m=d);let b=le(function(){Et(this,"lockSsfi")||Et(this,"ssfi",b);let g=Et(this,"lockSsfi");Et(this,"lockSsfi",!0);let S=s(m).apply(this,arguments);if(Et(this,"lockSsfi",g),S!==void 0)return S;let R=new H;return Du(this,R),R},"overwritingMethodWrapper");oy(b,u,!1),a[u]=Ep(b,u)}le(o_,"overwriteMethod");var qN=typeof Object.setPrototypeOf=="function",rO=le(function(){},"testFn"),DN=Object.getOwnPropertyNames(rO).filter(function(a){let u=Object.getOwnPropertyDescriptor(rO,a);return typeof u!="object"?!0:!u.configurable}),zN=Function.prototype.call,NN=Function.prototype.apply,uO=class extends l_{constructor(u,s,d,m){super(u,s,d),this.chainingBehavior=m}};le(uO,"PluginAddChainableMethodEvent");var UN=uO;function s_(a,u,s,d){typeof d!="function"&&(d=le(function(){},"chainingBehavior"));let m={method:s,chainingBehavior:d};a.__methods||(a.__methods={}),a.__methods[u]=m,Object.defineProperty(a,u,{get:le(function(){m.chainingBehavior.call(this);let g=le(function(){Et(this,"lockSsfi")||Et(this,"ssfi",g);let S=m.method.apply(this,arguments);if(S!==void 0)return S;let R=new H;return Du(this,R),R},"chainableMethodWrapper");if(oy(g,u,!0),qN){let S=Object.create(this);S.call=zN,S.apply=NN,Object.setPrototypeOf(g,S)}else Object.getOwnPropertyNames(a).forEach(function(R){if(DN.indexOf(R)!==-1)return;let _=Object.getOwnPropertyDescriptor(a,R);Object.defineProperty(g,R,_)});return Du(this,g),Ep(g)},"chainableMethodGetter"),configurable:!0}),SS.dispatchEvent(new UN("addChainableMethod",u,s,d))}le(s_,"addChainableMethod");function c_(a,u,s,d){let m=a.__methods[u],b=m.chainingBehavior;m.chainingBehavior=le(function(){let R=d(b).call(this);if(R!==void 0)return R;let _=new H;return Du(this,_),_},"overwritingChainableMethodGetter");let g=m.method;m.method=le(function(){let R=s(g).apply(this,arguments);if(R!==void 0)return R;let _=new H;return Du(this,_),_},"overwritingChainableMethodWrapper")}le(c_,"overwriteChainableMethod");function RS(a,u){return Yt(a)<Yt(u)?-1:1}le(RS,"compareByInspect");function f_(a){return typeof Object.getOwnPropertySymbols!="function"?[]:Object.getOwnPropertySymbols(a).filter(function(u){return Object.getOwnPropertyDescriptor(a,u).enumerable})}le(f_,"getOwnEnumerablePropertySymbols");function d_(a){return Object.keys(a).concat(f_(a))}le(d_,"getOwnEnumerableProperties");var TS=Number.isNaN;function iO(a){let u=rn(a);return["Array","Object","Function"].indexOf(u)!==-1}le(iO,"isObjectType");function p_(a,u){let s=Et(a,"operator"),d=Et(a,"negate"),m=u[3],b=d?u[2]:u[1];if(s)return s;if(typeof b=="function"&&(b=b()),b=b||"",!b||/\shave\s/.test(b))return;let g=iO(m);return/\snot\s/.test(b)?g?"notDeepStrictEqual":"notStrictEqual":g?"deepStrictEqual":"strictEqual"}le(p_,"getOperator");function _S(a){return a.name}le(_S,"getName");function AS(a){return Object.prototype.toString.call(a)==="[object RegExp]"}le(AS,"isRegExp");function Ra(a){return["Number","BigInt"].includes(rn(a))}le(Ra,"isNumeric");var{flag:F}=mS;["to","be","been","is","and","has","have","with","that","which","at","of","same","but","does","still","also"].forEach(function(a){H.addProperty(a)}),H.addProperty("not",function(){F(this,"negate",!0)}),H.addProperty("deep",function(){F(this,"deep",!0)}),H.addProperty("nested",function(){F(this,"nested",!0)}),H.addProperty("own",function(){F(this,"own",!0)}),H.addProperty("ordered",function(){F(this,"ordered",!0)}),H.addProperty("any",function(){F(this,"any",!0),F(this,"all",!1)}),H.addProperty("all",function(){F(this,"all",!0),F(this,"any",!1)});var oO={function:["function","asyncfunction","generatorfunction","asyncgeneratorfunction"],asyncfunction:["asyncfunction","asyncgeneratorfunction"],generatorfunction:["generatorfunction","asyncgeneratorfunction"],asyncgeneratorfunction:["asyncgeneratorfunction"]};function h_(a,u){u&&F(this,"message",u),a=a.toLowerCase();let s=F(this,"object"),d=~["a","e","i","o","u"].indexOf(a.charAt(0))?"an ":"a ";const m=rn(s).toLowerCase();oO.function.includes(a)?this.assert(oO[a].includes(m),"expected #{this} to be "+d+a,"expected #{this} not to be "+d+a):this.assert(a===m,"expected #{this} to be "+d+a,"expected #{this} not to be "+d+a)}le(h_,"an"),H.addChainableMethod("an",h_),H.addChainableMethod("a",h_);function sO(a,u){return TS(a)&&TS(u)||a===u}le(sO,"SameValueZero");function sy(){F(this,"contains",!0)}le(sy,"includeChainingBehavior");function cy(a,u){u&&F(this,"message",u);let s=F(this,"object"),d=rn(s).toLowerCase(),m=F(this,"message"),b=F(this,"negate"),g=F(this,"ssfi"),S=F(this,"deep"),R=S?"deep ":"",_=S?F(this,"eql"):sO;m=m?m+": ":"";let O=!1;switch(d){case"string":O=s.indexOf(a)!==-1;break;case"weakset":if(S)throw new Xt(m+"unable to use .deep.include with WeakSet",void 0,g);O=s.has(a);break;case"map":s.forEach(function(A){O=O||_(A,a)});break;case"set":S?s.forEach(function(A){O=O||_(A,a)}):O=s.has(a);break;case"array":S?O=s.some(function(A){return _(A,a)}):O=s.indexOf(a)!==-1;break;default:{if(a!==Object(a))throw new Xt(m+"the given combination of arguments ("+d+" and "+rn(a).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 "+rn(a).toLowerCase(),void 0,g);let A=Object.keys(a),T=null,z=0;if(A.forEach(function(U){let G=new H(s);if(Du(this,G,!0),F(G,"lockSsfi",!0),!b||A.length===1){G.property(U,a[U]);return}try{G.property(U,a[U])}catch(oe){if(!tr.compatibleConstructor(oe,Xt))throw oe;T===null&&(T=oe),z++}},this),b&&A.length>1&&z===A.length)throw T;return}}this.assert(O,"expected #{this} to "+R+"include "+Yt(a),"expected #{this} to not "+R+"include "+Yt(a))}le(cy,"include"),H.addChainableMethod("include",cy,sy),H.addChainableMethod("contain",cy,sy),H.addChainableMethod("contains",cy,sy),H.addChainableMethod("includes",cy,sy),H.addProperty("ok",function(){this.assert(F(this,"object"),"expected #{this} to be truthy","expected #{this} to be falsy")}),H.addProperty("true",function(){this.assert(F(this,"object")===!0,"expected #{this} to be true","expected #{this} to be false",!F(this,"negate"))}),H.addProperty("numeric",function(){const a=F(this,"object");this.assert(["Number","BigInt"].includes(rn(a)),"expected #{this} to be numeric","expected #{this} to not be numeric",!F(this,"negate"))}),H.addProperty("callable",function(){const a=F(this,"object"),u=F(this,"ssfi"),s=F(this,"message"),d=s?`${s}: `:"",m=F(this,"negate"),b=m?`${d}expected ${Yt(a)} not to be a callable function`:`${d}expected ${Yt(a)} to be a callable function`,g=["Function","AsyncFunction","GeneratorFunction","AsyncGeneratorFunction"].includes(rn(a));if(g&&m||!g&&!m)throw new Xt(b,void 0,u)}),H.addProperty("false",function(){this.assert(F(this,"object")===!1,"expected #{this} to be false","expected #{this} to be true",!!F(this,"negate"))}),H.addProperty("null",function(){this.assert(F(this,"object")===null,"expected #{this} to be null","expected #{this} not to be null")}),H.addProperty("undefined",function(){this.assert(F(this,"object")===void 0,"expected #{this} to be undefined","expected #{this} not to be undefined")}),H.addProperty("NaN",function(){this.assert(TS(F(this,"object")),"expected #{this} to be NaN","expected #{this} not to be NaN")});function m_(){let a=F(this,"object");this.assert(a!=null,"expected #{this} to exist","expected #{this} to not exist")}le(m_,"assertExist"),H.addProperty("exist",m_),H.addProperty("exists",m_),H.addProperty("empty",function(){let a=F(this,"object"),u=F(this,"ssfi"),s=F(this,"message"),d;switch(s=s?s+": ":"",rn(a).toLowerCase()){case"array":case"string":d=a.length;break;case"map":case"set":d=a.size;break;case"weakmap":case"weakset":throw new Xt(s+".empty was passed a weak collection",void 0,u);case"function":{const m=s+".empty was passed a function "+_S(a);throw new Xt(m.trim(),void 0,u)}default:if(a!==Object(a))throw new Xt(s+".empty was passed non-string primitive "+Yt(a),void 0,u);d=Object.keys(a).length}this.assert(d===0,"expected #{this} to be empty","expected #{this} not to be empty")});function y_(){let a=F(this,"object"),u=rn(a);this.assert(u==="Arguments","expected #{this} to be arguments but got "+u,"expected #{this} to not be arguments")}le(y_,"checkArguments"),H.addProperty("arguments",y_),H.addProperty("Arguments",y_);function CS(a,u){u&&F(this,"message",u);let s=F(this,"object");if(F(this,"deep")){let d=F(this,"lockSsfi");F(this,"lockSsfi",!0),this.eql(a),F(this,"lockSsfi",d)}else this.assert(a===s,"expected #{this} to equal #{exp}","expected #{this} to not equal #{exp}",a,this._obj,!0)}le(CS,"assertEqual"),H.addMethod("equal",CS),H.addMethod("equals",CS),H.addMethod("eq",CS);function v_(a,u){u&&F(this,"message",u);let s=F(this,"eql");this.assert(s(a,F(this,"object")),"expected #{this} to deeply equal #{exp}","expected #{this} to not deeply equal #{exp}",a,this._obj,!0)}le(v_,"assertEql"),H.addMethod("eql",v_),H.addMethod("eqls",v_);function wS(a,u){u&&F(this,"message",u);let s=F(this,"object"),d=F(this,"doLength"),m=F(this,"message"),b=m?m+": ":"",g=F(this,"ssfi"),S=rn(s).toLowerCase(),R=rn(a).toLowerCase();if(d&&S!=="map"&&S!=="set"&&new H(s,m,g,!0).to.have.property("length"),!d&&S==="date"&&R!=="date")throw new Xt(b+"the argument to above must be a date",void 0,g);if(!Ra(a)&&(d||Ra(s)))throw new Xt(b+"the argument to above must be a number",void 0,g);if(!d&&S!=="date"&&!Ra(s)){let _=S==="string"?"'"+s+"'":s;throw new Xt(b+"expected "+_+" to be a number or a date",void 0,g)}if(d){let _="length",O;S==="map"||S==="set"?(_="size",O=s.size):O=s.length,this.assert(O>a,"expected #{this} to have a "+_+" above #{exp} but got #{act}","expected #{this} to not have a "+_+" above #{exp}",a,O)}else this.assert(s>a,"expected #{this} to be above #{exp}","expected #{this} to be at most #{exp}",a)}le(wS,"assertAbove"),H.addMethod("above",wS),H.addMethod("gt",wS),H.addMethod("greaterThan",wS);function OS(a,u){u&&F(this,"message",u);let s=F(this,"object"),d=F(this,"doLength"),m=F(this,"message"),b=m?m+": ":"",g=F(this,"ssfi"),S=rn(s).toLowerCase(),R=rn(a).toLowerCase(),_,O=!0;if(d&&S!=="map"&&S!=="set"&&new H(s,m,g,!0).to.have.property("length"),!d&&S==="date"&&R!=="date")_=b+"the argument to least must be a date";else if(!Ra(a)&&(d||Ra(s)))_=b+"the argument to least must be a number";else if(!d&&S!=="date"&&!Ra(s)){let A=S==="string"?"'"+s+"'":s;_=b+"expected "+A+" to be a number or a date"}else O=!1;if(O)throw new Xt(_,void 0,g);if(d){let A="length",T;S==="map"||S==="set"?(A="size",T=s.size):T=s.length,this.assert(T>=a,"expected #{this} to have a "+A+" at least #{exp} but got #{act}","expected #{this} to have a "+A+" below #{exp}",a,T)}else this.assert(s>=a,"expected #{this} to be at least #{exp}","expected #{this} to be below #{exp}",a)}le(OS,"assertLeast"),H.addMethod("least",OS),H.addMethod("gte",OS),H.addMethod("greaterThanOrEqual",OS);function MS(a,u){u&&F(this,"message",u);let s=F(this,"object"),d=F(this,"doLength"),m=F(this,"message"),b=m?m+": ":"",g=F(this,"ssfi"),S=rn(s).toLowerCase(),R=rn(a).toLowerCase(),_,O=!0;if(d&&S!=="map"&&S!=="set"&&new H(s,m,g,!0).to.have.property("length"),!d&&S==="date"&&R!=="date")_=b+"the argument to below must be a date";else if(!Ra(a)&&(d||Ra(s)))_=b+"the argument to below must be a number";else if(!d&&S!=="date"&&!Ra(s)){let A=S==="string"?"'"+s+"'":s;_=b+"expected "+A+" to be a number or a date"}else O=!1;if(O)throw new Xt(_,void 0,g);if(d){let A="length",T;S==="map"||S==="set"?(A="size",T=s.size):T=s.length,this.assert(T<a,"expected #{this} to have a "+A+" below #{exp} but got #{act}","expected #{this} to not have a "+A+" below #{exp}",a,T)}else this.assert(s<a,"expected #{this} to be below #{exp}","expected #{this} to be at least #{exp}",a)}le(MS,"assertBelow"),H.addMethod("below",MS),H.addMethod("lt",MS),H.addMethod("lessThan",MS);function xS(a,u){u&&F(this,"message",u);let s=F(this,"object"),d=F(this,"doLength"),m=F(this,"message"),b=m?m+": ":"",g=F(this,"ssfi"),S=rn(s).toLowerCase(),R=rn(a).toLowerCase(),_,O=!0;if(d&&S!=="map"&&S!=="set"&&new H(s,m,g,!0).to.have.property("length"),!d&&S==="date"&&R!=="date")_=b+"the argument to most must be a date";else if(!Ra(a)&&(d||Ra(s)))_=b+"the argument to most must be a number";else if(!d&&S!=="date"&&!Ra(s)){let A=S==="string"?"'"+s+"'":s;_=b+"expected "+A+" to be a number or a date"}else O=!1;if(O)throw new Xt(_,void 0,g);if(d){let A="length",T;S==="map"||S==="set"?(A="size",T=s.size):T=s.length,this.assert(T<=a,"expected #{this} to have a "+A+" at most #{exp} but got #{act}","expected #{this} to have a "+A+" above #{exp}",a,T)}else this.assert(s<=a,"expected #{this} to be at most #{exp}","expected #{this} to be above #{exp}",a)}le(xS,"assertMost"),H.addMethod("most",xS),H.addMethod("lte",xS),H.addMethod("lessThanOrEqual",xS),H.addMethod("within",function(a,u,s){s&&F(this,"message",s);let d=F(this,"object"),m=F(this,"doLength"),b=F(this,"message"),g=b?b+": ":"",S=F(this,"ssfi"),R=rn(d).toLowerCase(),_=rn(a).toLowerCase(),O=rn(u).toLowerCase(),A,T=!0,z=_==="date"&&O==="date"?a.toISOString()+".."+u.toISOString():a+".."+u;if(m&&R!=="map"&&R!=="set"&&new H(d,b,S,!0).to.have.property("length"),!m&&R==="date"&&(_!=="date"||O!=="date"))A=g+"the arguments to within must be dates";else if((!Ra(a)||!Ra(u))&&(m||Ra(d)))A=g+"the arguments to within must be numbers";else if(!m&&R!=="date"&&!Ra(d)){let U=R==="string"?"'"+d+"'":d;A=g+"expected "+U+" to be a number or a date"}else T=!1;if(T)throw new Xt(A,void 0,S);if(m){let U="length",G;R==="map"||R==="set"?(U="size",G=d.size):G=d.length,this.assert(G>=a&&G<=u,"expected #{this} to have a "+U+" within "+z,"expected #{this} to not have a "+U+" within "+z)}else this.assert(d>=a&&d<=u,"expected #{this} to be within "+z,"expected #{this} to not be within "+z)});function b_(a,u){u&&F(this,"message",u);let s=F(this,"object"),d=F(this,"ssfi"),m=F(this,"message"),b;try{b=s instanceof a}catch(S){throw S instanceof TypeError?(m=m?m+": ":"",new Xt(m+"The instanceof assertion needs a constructor but "+rn(a)+" was given.",void 0,d)):S}let g=_S(a);g==null&&(g="an unnamed constructor"),this.assert(b,"expected #{this} to be an instance of "+g,"expected #{this} to not be an instance of "+g)}le(b_,"assertInstanceOf"),H.addMethod("instanceof",b_),H.addMethod("instanceOf",b_);function g_(a,u,s){s&&F(this,"message",s);let d=F(this,"nested"),m=F(this,"own"),b=F(this,"message"),g=F(this,"object"),S=F(this,"ssfi"),R=typeof a;if(b=b?b+": ":"",d){if(R!=="string")throw new Xt(b+"the argument to property must be a string when using nested syntax",void 0,S)}else if(R!=="string"&&R!=="number"&&R!=="symbol")throw new Xt(b+"the argument to property must be a string, number, or symbol",void 0,S);if(d&&m)throw new Xt(b+'The "nested" and "own" flags cannot be combined.',void 0,S);if(g==null)throw new Xt(b+"Target cannot be null or undefined.",void 0,S);let _=F(this,"deep"),O=F(this,"negate"),A=d?a_(g,a):null,T=d?A.value:g[a],z=_?F(this,"eql"):(oe,D)=>oe===D,U="";_&&(U+="deep "),m&&(U+="own "),d&&(U+="nested "),U+="property ";let G;m?G=Object.prototype.hasOwnProperty.call(g,a):d?G=A.exists:G=ES(g,a),(!O||arguments.length===1)&&this.assert(G,"expected #{this} to have "+U+Yt(a),"expected #{this} to not have "+U+Yt(a)),arguments.length>1&&this.assert(G&&z(u,T),"expected #{this} to have "+U+Yt(a)+" of #{exp}, but got #{act}","expected #{this} to not have "+U+Yt(a)+" of #{act}",u,T),F(this,"object",T)}le(g_,"assertProperty"),H.addMethod("property",g_);function E_(a,u,s){F(this,"own",!0),g_.apply(this,arguments)}le(E_,"assertOwnProperty"),H.addMethod("ownProperty",E_),H.addMethod("haveOwnProperty",E_);function S_(a,u,s){typeof u=="string"&&(s=u,u=null),s&&F(this,"message",s);let d=F(this,"object"),m=Object.getOwnPropertyDescriptor(Object(d),a),b=F(this,"eql");m&&u?this.assert(b(u,m),"expected the own property descriptor for "+Yt(a)+" on #{this} to match "+Yt(u)+", got "+Yt(m),"expected the own property descriptor for "+Yt(a)+" on #{this} to not match "+Yt(u),u,m,!0):this.assert(m,"expected #{this} to have an own property descriptor for "+Yt(a),"expected #{this} to not have an own property descriptor for "+Yt(a)),F(this,"object",m)}le(S_,"assertOwnPropertyDescriptor"),H.addMethod("ownPropertyDescriptor",S_),H.addMethod("haveOwnPropertyDescriptor",S_);function R_(){F(this,"doLength",!0)}le(R_,"assertLengthChain");function T_(a,u){u&&F(this,"message",u);let s=F(this,"object"),d=rn(s).toLowerCase(),m=F(this,"message"),b=F(this,"ssfi"),g="length",S;switch(d){case"map":case"set":g="size",S=s.size;break;default:new H(s,m,b,!0).to.have.property("length"),S=s.length}this.assert(S==a,"expected #{this} to have a "+g+" of #{exp} but got #{act}","expected #{this} to not have a "+g+" of #{act}",a,S)}le(T_,"assertLength"),H.addChainableMethod("length",T_,R_),H.addChainableMethod("lengthOf",T_,R_);function __(a,u){u&&F(this,"message",u);let s=F(this,"object");this.assert(a.exec(s),"expected #{this} to match "+a,"expected #{this} not to match "+a)}le(__,"assertMatch"),H.addMethod("match",__),H.addMethod("matches",__),H.addMethod("string",function(a,u){u&&F(this,"message",u);let s=F(this,"object"),d=F(this,"message"),m=F(this,"ssfi");new H(s,d,m,!0).is.a("string"),this.assert(~s.indexOf(a),"expected #{this} to contain "+Yt(a),"expected #{this} to not contain "+Yt(a))});function A_(a){let u=F(this,"object"),s=rn(u),d=rn(a),m=F(this,"ssfi"),b=F(this,"deep"),g,S="",R,_=!0,O=F(this,"message");O=O?O+": ":"";let A=O+"when testing keys against an object or an array you must give a single Array|Object|String argument or multiple String arguments";if(s==="Map"||s==="Set")S=b?"deeply ":"",R=[],u.forEach(function(D,ne){R.push(ne)}),d!=="Array"&&(a=Array.prototype.slice.call(arguments));else{switch(R=d_(u),d){case"Array":if(arguments.length>1)throw new Xt(A,void 0,m);break;case"Object":if(arguments.length>1)throw new Xt(A,void 0,m);a=Object.keys(a);break;default:a=Array.prototype.slice.call(arguments)}a=a.map(function(D){return typeof D=="symbol"?D:String(D)})}if(!a.length)throw new Xt(O+"keys required",void 0,m);let T=a.length,z=F(this,"any"),U=F(this,"all"),G=a,oe=b?F(this,"eql"):(D,ne)=>D===ne;if(!z&&!U&&(U=!0),z&&(_=G.some(function(D){return R.some(function(ne){return oe(D,ne)})})),U&&(_=G.every(function(D){return R.some(function(ne){return oe(D,ne)})}),F(this,"contains")||(_=_&&a.length==R.length)),T>1){a=a.map(function(ne){return Yt(ne)});let D=a.pop();U&&(g=a.join(", ")+", and "+D),z&&(g=a.join(", ")+", or "+D)}else g=Yt(a[0]);g=(T>1?"keys ":"key ")+g,g=(F(this,"contains")?"contain ":"have ")+g,this.assert(_,"expected #{this} to "+S+g,"expected #{this} to not "+S+g,G.slice(0).sort(RS),R.sort(RS),!0)}le(A_,"assertKeys"),H.addMethod("keys",A_),H.addMethod("key",A_);function qS(a,u,s){s&&F(this,"message",s);let d=F(this,"object"),m=F(this,"ssfi"),b=F(this,"message"),g=F(this,"negate")||!1;new H(d,b,m,!0).is.a("function"),(AS(a)||typeof a=="string")&&(u=a,a=null);let S,R=!1;try{d()}catch(z){R=!0,S=z}let _=a===void 0&&u===void 0,O=!!(a&&u),A=!1,T=!1;if(_||!_&&!g){let z="an error";a instanceof Error?z="#{exp}":a&&(z=tr.getConstructorName(a));let U=S;if(S instanceof Error)U=S.toString();else if(typeof S=="string")U=S;else if(S&&(typeof S=="object"||typeof S=="function"))try{U=tr.getConstructorName(S)}catch{}this.assert(R,"expected #{this} to throw "+z,"expected #{this} to not throw an error but #{act} was thrown",a&&a.toString(),U)}if(a&&S&&(a instanceof Error&&tr.compatibleInstance(S,a)===g&&(O&&g?A=!0:this.assert(g,"expected #{this} to throw #{exp} but #{act} was thrown","expected #{this} to not throw #{exp}"+(S&&!g?" but #{act} was thrown":""),a.toString(),S.toString())),tr.compatibleConstructor(S,a)===g&&(O&&g?A=!0:this.assert(g,"expected #{this} to throw #{exp} but #{act} was thrown","expected #{this} to not throw #{exp}"+(S?" but #{act} was thrown":""),a instanceof Error?a.toString():a&&tr.getConstructorName(a),S instanceof Error?S.toString():S&&tr.getConstructorName(S)))),S&&u!==void 0&&u!==null){let z="including";AS(u)&&(z="matching"),tr.compatibleMessage(S,u)===g&&(O&&g?T=!0:this.assert(g,"expected #{this} to throw error "+z+" #{exp} but got #{act}","expected #{this} to throw error not "+z+" #{exp}",u,tr.getMessage(S)))}A&&T&&this.assert(g,"expected #{this} to throw #{exp} but #{act} was thrown","expected #{this} to not throw #{exp}"+(S?" but #{act} was thrown":""),a instanceof Error?a.toString():a&&tr.getConstructorName(a),S instanceof Error?S.toString():S&&tr.getConstructorName(S)),F(this,"object",S)}le(qS,"assertThrows"),H.addMethod("throw",qS),H.addMethod("throws",qS),H.addMethod("Throw",qS);function C_(a,u){u&&F(this,"message",u);let s=F(this,"object"),d=F(this,"itself"),m=typeof s=="function"&&!d?s.prototype[a]:s[a];this.assert(typeof m=="function","expected #{this} to respond to "+Yt(a),"expected #{this} to not respond to "+Yt(a))}le(C_,"respondTo"),H.addMethod("respondTo",C_),H.addMethod("respondsTo",C_),H.addProperty("itself",function(){F(this,"itself",!0)});function w_(a,u){u&&F(this,"message",u);let s=F(this,"object"),d=a(s);this.assert(d,"expected #{this} to satisfy "+gf(a),"expected #{this} to not satisfy"+gf(a),!F(this,"negate"),d)}le(w_,"satisfy"),H.addMethod("satisfy",w_),H.addMethod("satisfies",w_);function O_(a,u,s){s&&F(this,"message",s);let d=F(this,"object"),m=F(this,"message"),b=F(this,"ssfi");new H(d,m,b,!0).is.numeric;let g="A `delta` value is required for `closeTo`";if(u==null)throw new Xt(m?`${m}: ${g}`:g,void 0,b);if(new H(u,m,b,!0).is.numeric,g="A `expected` value is required for `closeTo`",a==null)throw new Xt(m?`${m}: ${g}`:g,void 0,b);new H(a,m,b,!0).is.numeric;const S=le(_=>_<0n?-_:_,"abs"),R=le(_=>parseFloat(parseFloat(_).toPrecision(12)),"strip");this.assert(R(S(d-a))<=u,"expected #{this} to be close to "+a+" +/- "+u,"expected #{this} not to be close to "+a+" +/- "+u)}le(O_,"closeTo"),H.addMethod("closeTo",O_),H.addMethod("approximately",O_);function cO(a,u,s,d,m){let b=Array.from(u),g=Array.from(a);if(!d){if(g.length!==b.length)return!1;b=b.slice()}return g.every(function(S,R){if(m)return s?s(S,b[R]):S===b[R];if(!s){let _=b.indexOf(S);return _===-1?!1:(d||b.splice(_,1),!0)}return b.some(function(_,O){return s(S,_)?(d||b.splice(O,1),!0):!1})})}le(cO,"isSubsetOf"),H.addMethod("members",function(a,u){u&&F(this,"message",u);let s=F(this,"object"),d=F(this,"message"),m=F(this,"ssfi");new H(s,d,m,!0).to.be.iterable,new H(a,d,m,!0).to.be.iterable;let b=F(this,"contains"),g=F(this,"ordered"),S,R,_;b?(S=g?"an ordered superset":"a superset",R="expected #{this} to be "+S+" of #{exp}",_="expected #{this} to not be "+S+" of #{exp}"):(S=g?"ordered members":"members",R="expected #{this} to have the same "+S+" as #{exp}",_="expected #{this} to not have the same "+S+" as #{exp}");let O=F(this,"deep")?F(this,"eql"):void 0;this.assert(cO(a,s,O,b,g),R,_,a,s,!0)}),H.addProperty("iterable",function(a){a&&F(this,"message",a);let u=F(this,"object");this.assert(u!=null&&u[Symbol.iterator],"expected #{this} to be an iterable","expected #{this} to not be an iterable",u)});function fO(a,u){u&&F(this,"message",u);let s=F(this,"object"),d=F(this,"message"),m=F(this,"ssfi"),b=F(this,"contains"),g=F(this,"deep"),S=F(this,"eql");new H(a,d,m,!0).to.be.an("array"),b?this.assert(a.some(function(R){return s.indexOf(R)>-1}),"expected #{this} to contain one of #{exp}","expected #{this} to not contain one of #{exp}",a,s):g?this.assert(a.some(function(R){return S(s,R)}),"expected #{this} to deeply equal one of #{exp}","expected #{this} to deeply equal one of #{exp}",a,s):this.assert(a.indexOf(s)>-1,"expected #{this} to be one of #{exp}","expected #{this} to not be one of #{exp}",a,s)}le(fO,"oneOf"),H.addMethod("oneOf",fO);function M_(a,u,s){s&&F(this,"message",s);let d=F(this,"object"),m=F(this,"message"),b=F(this,"ssfi");new H(d,m,b,!0).is.a("function");let g;u?(new H(a,m,b,!0).to.have.property(u),g=a[u]):(new H(a,m,b,!0).is.a("function"),g=a()),d();let S=u==null?a():a[u],R=u==null?g:"."+u;F(this,"deltaMsgObj",R),F(this,"initialDeltaValue",g),F(this,"finalDeltaValue",S),F(this,"deltaBehavior","change"),F(this,"realDelta",S!==g),this.assert(g!==S,"expected "+R+" to change","expected "+R+" to not change")}le(M_,"assertChanges"),H.addMethod("change",M_),H.addMethod("changes",M_);function x_(a,u,s){s&&F(this,"message",s);let d=F(this,"object"),m=F(this,"message"),b=F(this,"ssfi");new H(d,m,b,!0).is.a("function");let g;u?(new H(a,m,b,!0).to.have.property(u),g=a[u]):(new H(a,m,b,!0).is.a("function"),g=a()),new H(g,m,b,!0).is.a("number"),d();let S=u==null?a():a[u],R=u==null?g:"."+u;F(this,"deltaMsgObj",R),F(this,"initialDeltaValue",g),F(this,"finalDeltaValue",S),F(this,"deltaBehavior","increase"),F(this,"realDelta",S-g),this.assert(S-g>0,"expected "+R+" to increase","expected "+R+" to not increase")}le(x_,"assertIncreases"),H.addMethod("increase",x_),H.addMethod("increases",x_);function q_(a,u,s){s&&F(this,"message",s);let d=F(this,"object"),m=F(this,"message"),b=F(this,"ssfi");new H(d,m,b,!0).is.a("function");let g;u?(new H(a,m,b,!0).to.have.property(u),g=a[u]):(new H(a,m,b,!0).is.a("function"),g=a()),new H(g,m,b,!0).is.a("number"),d();let S=u==null?a():a[u],R=u==null?g:"."+u;F(this,"deltaMsgObj",R),F(this,"initialDeltaValue",g),F(this,"finalDeltaValue",S),F(this,"deltaBehavior","decrease"),F(this,"realDelta",g-S),this.assert(S-g<0,"expected "+R+" to decrease","expected "+R+" to not decrease")}le(q_,"assertDecreases"),H.addMethod("decrease",q_),H.addMethod("decreases",q_);function dO(a,u){u&&F(this,"message",u);let s=F(this,"deltaMsgObj"),d=F(this,"initialDeltaValue"),m=F(this,"finalDeltaValue"),b=F(this,"deltaBehavior"),g=F(this,"realDelta"),S;b==="change"?S=Math.abs(m-d)===Math.abs(a):S=g===Math.abs(a),this.assert(S,"expected "+s+" to "+b+" by "+a,"expected "+s+" to not "+b+" by "+a)}le(dO,"assertDelta"),H.addMethod("by",dO),H.addProperty("extensible",function(){let a=F(this,"object"),u=a===Object(a)&&Object.isExtensible(a);this.assert(u,"expected #{this} to be extensible","expected #{this} to not be extensible")}),H.addProperty("sealed",function(){let a=F(this,"object"),u=a===Object(a)?Object.isSealed(a):!0;this.assert(u,"expected #{this} to be sealed","expected #{this} to not be sealed")}),H.addProperty("frozen",function(){let a=F(this,"object"),u=a===Object(a)?Object.isFrozen(a):!0;this.assert(u,"expected #{this} to be frozen","expected #{this} to not be frozen")}),H.addProperty("finite",function(a){let u=F(this,"object");this.assert(typeof u=="number"&&isFinite(u),"expected #{this} to be a finite number","expected #{this} to not be a finite number")});function DS(a,u){return a===u?!0:typeof u!=typeof a?!1:typeof a!="object"||a===null?a===u:u?Array.isArray(a)?Array.isArray(u)?a.every(function(s){return u.some(function(d){return DS(s,d)})}):!1:a instanceof Date?u instanceof Date?a.getTime()===u.getTime():!1:Object.keys(a).every(function(s){let d=a[s],m=u[s];return typeof d=="object"&&d!==null&&m!==null?DS(d,m):typeof d=="function"?d(m):m===d}):!1}le(DS,"compareSubset"),H.addMethod("containSubset",function(a){const u=Et(this,"object"),s=Ia.showDiff;this.assert(DS(a,u),"expected #{act} to contain subset #{exp}","expected #{act} to not contain subset #{exp}",a,u,s)});function zS(a,u){return new H(a,u)}le(zS,"expect"),zS.fail=function(a,u,s,d){throw arguments.length<2&&(s=a,a=void 0),s=s||"expect.fail()",new Xt(s,{actual:a,expected:u,operator:d},zS.fail)};var pO={};zT(pO,{Should:()=>BN,should:()=>jN});function D_(){function a(){return this instanceof String||this instanceof Number||this instanceof Boolean||typeof Symbol=="function"&&this instanceof Symbol||typeof BigInt=="function"&&this instanceof BigInt?new H(this.valueOf(),null,a):new H(this,null,a)}le(a,"shouldGetter");function u(d){Object.defineProperty(this,"should",{value:d,enumerable:!0,configurable:!0,writable:!0})}le(u,"shouldSetter"),Object.defineProperty(Object.prototype,"should",{set:u,get:a,configurable:!0});let s={};return s.fail=function(d,m,b,g){throw arguments.length<2&&(b=d,d=void 0),b=b||"should.fail()",new Xt(b,{actual:d,expected:m,operator:g},s.fail)},s.equal=function(d,m,b){new H(d,b).to.equal(m)},s.Throw=function(d,m,b,g){new H(d,g).to.Throw(m,b)},s.exist=function(d,m){new H(d,m).to.exist},s.not={},s.not.equal=function(d,m,b){new H(d,b).to.not.equal(m)},s.not.Throw=function(d,m,b,g){new H(d,g).to.not.Throw(m,b)},s.not.exist=function(d,m){new H(d,m).to.not.exist},s.throw=s.Throw,s.not.throw=s.not.Throw,s}le(D_,"loadShould");var jN=D_,BN=D_;function j(a,u){new H(null,null,j,!0).assert(a,u,"[ negation message unavailable ]")}le(j,"assert"),j.fail=function(a,u,s,d){throw arguments.length<2&&(s=a,a=void 0),s=s||"assert.fail()",new Xt(s,{actual:a,expected:u,operator:d},j.fail)},j.isOk=function(a,u){new H(a,u,j.isOk,!0).is.ok},j.isNotOk=function(a,u){new H(a,u,j.isNotOk,!0).is.not.ok},j.equal=function(a,u,s){let d=new H(a,s,j.equal,!0);d.assert(u==Et(d,"object"),"expected #{this} to equal #{exp}","expected #{this} to not equal #{act}",u,a,!0)},j.notEqual=function(a,u,s){let d=new H(a,s,j.notEqual,!0);d.assert(u!=Et(d,"object"),"expected #{this} to not equal #{exp}","expected #{this} to equal #{act}",u,a,!0)},j.strictEqual=function(a,u,s){new H(a,s,j.strictEqual,!0).to.equal(u)},j.notStrictEqual=function(a,u,s){new H(a,s,j.notStrictEqual,!0).to.not.equal(u)},j.deepEqual=j.deepStrictEqual=function(a,u,s){new H(a,s,j.deepEqual,!0).to.eql(u)},j.notDeepEqual=function(a,u,s){new H(a,s,j.notDeepEqual,!0).to.not.eql(u)},j.isAbove=function(a,u,s){new H(a,s,j.isAbove,!0).to.be.above(u)},j.isAtLeast=function(a,u,s){new H(a,s,j.isAtLeast,!0).to.be.least(u)},j.isBelow=function(a,u,s){new H(a,s,j.isBelow,!0).to.be.below(u)},j.isAtMost=function(a,u,s){new H(a,s,j.isAtMost,!0).to.be.most(u)},j.isTrue=function(a,u){new H(a,u,j.isTrue,!0).is.true},j.isNotTrue=function(a,u){new H(a,u,j.isNotTrue,!0).to.not.equal(!0)},j.isFalse=function(a,u){new H(a,u,j.isFalse,!0).is.false},j.isNotFalse=function(a,u){new H(a,u,j.isNotFalse,!0).to.not.equal(!1)},j.isNull=function(a,u){new H(a,u,j.isNull,!0).to.equal(null)},j.isNotNull=function(a,u){new H(a,u,j.isNotNull,!0).to.not.equal(null)},j.isNaN=function(a,u){new H(a,u,j.isNaN,!0).to.be.NaN},j.isNotNaN=function(a,u){new H(a,u,j.isNotNaN,!0).not.to.be.NaN},j.exists=function(a,u){new H(a,u,j.exists,!0).to.exist},j.notExists=function(a,u){new H(a,u,j.notExists,!0).to.not.exist},j.isUndefined=function(a,u){new H(a,u,j.isUndefined,!0).to.equal(void 0)},j.isDefined=function(a,u){new H(a,u,j.isDefined,!0).to.not.equal(void 0)},j.isCallable=function(a,u){new H(a,u,j.isCallable,!0).is.callable},j.isNotCallable=function(a,u){new H(a,u,j.isNotCallable,!0).is.not.callable},j.isObject=function(a,u){new H(a,u,j.isObject,!0).to.be.a("object")},j.isNotObject=function(a,u){new H(a,u,j.isNotObject,!0).to.not.be.a("object")},j.isArray=function(a,u){new H(a,u,j.isArray,!0).to.be.an("array")},j.isNotArray=function(a,u){new H(a,u,j.isNotArray,!0).to.not.be.an("array")},j.isString=function(a,u){new H(a,u,j.isString,!0).to.be.a("string")},j.isNotString=function(a,u){new H(a,u,j.isNotString,!0).to.not.be.a("string")},j.isNumber=function(a,u){new H(a,u,j.isNumber,!0).to.be.a("number")},j.isNotNumber=function(a,u){new H(a,u,j.isNotNumber,!0).to.not.be.a("number")},j.isNumeric=function(a,u){new H(a,u,j.isNumeric,!0).is.numeric},j.isNotNumeric=function(a,u){new H(a,u,j.isNotNumeric,!0).is.not.numeric},j.isFinite=function(a,u){new H(a,u,j.isFinite,!0).to.be.finite},j.isBoolean=function(a,u){new H(a,u,j.isBoolean,!0).to.be.a("boolean")},j.isNotBoolean=function(a,u){new H(a,u,j.isNotBoolean,!0).to.not.be.a("boolean")},j.typeOf=function(a,u,s){new H(a,s,j.typeOf,!0).to.be.a(u)},j.notTypeOf=function(a,u,s){new H(a,s,j.notTypeOf,!0).to.not.be.a(u)},j.instanceOf=function(a,u,s){new H(a,s,j.instanceOf,!0).to.be.instanceOf(u)},j.notInstanceOf=function(a,u,s){new H(a,s,j.notInstanceOf,!0).to.not.be.instanceOf(u)},j.include=function(a,u,s){new H(a,s,j.include,!0).include(u)},j.notInclude=function(a,u,s){new H(a,s,j.notInclude,!0).not.include(u)},j.deepInclude=function(a,u,s){new H(a,s,j.deepInclude,!0).deep.include(u)},j.notDeepInclude=function(a,u,s){new H(a,s,j.notDeepInclude,!0).not.deep.include(u)},j.nestedInclude=function(a,u,s){new H(a,s,j.nestedInclude,!0).nested.include(u)},j.notNestedInclude=function(a,u,s){new H(a,s,j.notNestedInclude,!0).not.nested.include(u)},j.deepNestedInclude=function(a,u,s){new H(a,s,j.deepNestedInclude,!0).deep.nested.include(u)},j.notDeepNestedInclude=function(a,u,s){new H(a,s,j.notDeepNestedInclude,!0).not.deep.nested.include(u)},j.ownInclude=function(a,u,s){new H(a,s,j.ownInclude,!0).own.include(u)},j.notOwnInclude=function(a,u,s){new H(a,s,j.notOwnInclude,!0).not.own.include(u)},j.deepOwnInclude=function(a,u,s){new H(a,s,j.deepOwnInclude,!0).deep.own.include(u)},j.notDeepOwnInclude=function(a,u,s){new H(a,s,j.notDeepOwnInclude,!0).not.deep.own.include(u)},j.match=function(a,u,s){new H(a,s,j.match,!0).to.match(u)},j.notMatch=function(a,u,s){new H(a,s,j.notMatch,!0).to.not.match(u)},j.property=function(a,u,s){new H(a,s,j.property,!0).to.have.property(u)},j.notProperty=function(a,u,s){new H(a,s,j.notProperty,!0).to.not.have.property(u)},j.propertyVal=function(a,u,s,d){new H(a,d,j.propertyVal,!0).to.have.property(u,s)},j.notPropertyVal=function(a,u,s,d){new H(a,d,j.notPropertyVal,!0).to.not.have.property(u,s)},j.deepPropertyVal=function(a,u,s,d){new H(a,d,j.deepPropertyVal,!0).to.have.deep.property(u,s)},j.notDeepPropertyVal=function(a,u,s,d){new H(a,d,j.notDeepPropertyVal,!0).to.not.have.deep.property(u,s)},j.ownProperty=function(a,u,s){new H(a,s,j.ownProperty,!0).to.have.own.property(u)},j.notOwnProperty=function(a,u,s){new H(a,s,j.notOwnProperty,!0).to.not.have.own.property(u)},j.ownPropertyVal=function(a,u,s,d){new H(a,d,j.ownPropertyVal,!0).to.have.own.property(u,s)},j.notOwnPropertyVal=function(a,u,s,d){new H(a,d,j.notOwnPropertyVal,!0).to.not.have.own.property(u,s)},j.deepOwnPropertyVal=function(a,u,s,d){new H(a,d,j.deepOwnPropertyVal,!0).to.have.deep.own.property(u,s)},j.notDeepOwnPropertyVal=function(a,u,s,d){new H(a,d,j.notDeepOwnPropertyVal,!0).to.not.have.deep.own.property(u,s)},j.nestedProperty=function(a,u,s){new H(a,s,j.nestedProperty,!0).to.have.nested.property(u)},j.notNestedProperty=function(a,u,s){new H(a,s,j.notNestedProperty,!0).to.not.have.nested.property(u)},j.nestedPropertyVal=function(a,u,s,d){new H(a,d,j.nestedPropertyVal,!0).to.have.nested.property(u,s)},j.notNestedPropertyVal=function(a,u,s,d){new H(a,d,j.notNestedPropertyVal,!0).to.not.have.nested.property(u,s)},j.deepNestedPropertyVal=function(a,u,s,d){new H(a,d,j.deepNestedPropertyVal,!0).to.have.deep.nested.property(u,s)},j.notDeepNestedPropertyVal=function(a,u,s,d){new H(a,d,j.notDeepNestedPropertyVal,!0).to.not.have.deep.nested.property(u,s)},j.lengthOf=function(a,u,s){new H(a,s,j.lengthOf,!0).to.have.lengthOf(u)},j.hasAnyKeys=function(a,u,s){new H(a,s,j.hasAnyKeys,!0).to.have.any.keys(u)},j.hasAllKeys=function(a,u,s){new H(a,s,j.hasAllKeys,!0).to.have.all.keys(u)},j.containsAllKeys=function(a,u,s){new H(a,s,j.containsAllKeys,!0).to.contain.all.keys(u)},j.doesNotHaveAnyKeys=function(a,u,s){new H(a,s,j.doesNotHaveAnyKeys,!0).to.not.have.any.keys(u)},j.doesNotHaveAllKeys=function(a,u,s){new H(a,s,j.doesNotHaveAllKeys,!0).to.not.have.all.keys(u)},j.hasAnyDeepKeys=function(a,u,s){new H(a,s,j.hasAnyDeepKeys,!0).to.have.any.deep.keys(u)},j.hasAllDeepKeys=function(a,u,s){new H(a,s,j.hasAllDeepKeys,!0).to.have.all.deep.keys(u)},j.containsAllDeepKeys=function(a,u,s){new H(a,s,j.containsAllDeepKeys,!0).to.contain.all.deep.keys(u)},j.doesNotHaveAnyDeepKeys=function(a,u,s){new H(a,s,j.doesNotHaveAnyDeepKeys,!0).to.not.have.any.deep.keys(u)},j.doesNotHaveAllDeepKeys=function(a,u,s){new H(a,s,j.doesNotHaveAllDeepKeys,!0).to.not.have.all.deep.keys(u)},j.throws=function(a,u,s,d){(typeof u=="string"||u instanceof RegExp)&&(s=u,u=null);let m=new H(a,d,j.throws,!0).to.throw(u,s);return Et(m,"object")},j.doesNotThrow=function(a,u,s,d){(typeof u=="string"||u instanceof RegExp)&&(s=u,u=null),new H(a,d,j.doesNotThrow,!0).to.not.throw(u,s)},j.operator=function(a,u,s,d){let m;switch(u){case"==":m=a==s;break;case"===":m=a===s;break;case">":m=a>s;break;case">=":m=a>=s;break;case"<":m=a<s;break;case"<=":m=a<=s;break;case"!=":m=a!=s;break;case"!==":m=a!==s;break;default:throw d=d&&d+": ",new Xt(d+'Invalid operator "'+u+'"',void 0,j.operator)}let b=new H(m,d,j.operator,!0);b.assert(Et(b,"object")===!0,"expected "+Yt(a)+" to be "+u+" "+Yt(s),"expected "+Yt(a)+" to not be "+u+" "+Yt(s))},j.closeTo=function(a,u,s,d){new H(a,d,j.closeTo,!0).to.be.closeTo(u,s)},j.approximately=function(a,u,s,d){new H(a,d,j.approximately,!0).to.be.approximately(u,s)},j.sameMembers=function(a,u,s){new H(a,s,j.sameMembers,!0).to.have.same.members(u)},j.notSameMembers=function(a,u,s){new H(a,s,j.notSameMembers,!0).to.not.have.same.members(u)},j.sameDeepMembers=function(a,u,s){new H(a,s,j.sameDeepMembers,!0).to.have.same.deep.members(u)},j.notSameDeepMembers=function(a,u,s){new H(a,s,j.notSameDeepMembers,!0).to.not.have.same.deep.members(u)},j.sameOrderedMembers=function(a,u,s){new H(a,s,j.sameOrderedMembers,!0).to.have.same.ordered.members(u)},j.notSameOrderedMembers=function(a,u,s){new H(a,s,j.notSameOrderedMembers,!0).to.not.have.same.ordered.members(u)},j.sameDeepOrderedMembers=function(a,u,s){new H(a,s,j.sameDeepOrderedMembers,!0).to.have.same.deep.ordered.members(u)},j.notSameDeepOrderedMembers=function(a,u,s){new H(a,s,j.notSameDeepOrderedMembers,!0).to.not.have.same.deep.ordered.members(u)},j.includeMembers=function(a,u,s){new H(a,s,j.includeMembers,!0).to.include.members(u)},j.notIncludeMembers=function(a,u,s){new H(a,s,j.notIncludeMembers,!0).to.not.include.members(u)},j.includeDeepMembers=function(a,u,s){new H(a,s,j.includeDeepMembers,!0).to.include.deep.members(u)},j.notIncludeDeepMembers=function(a,u,s){new H(a,s,j.notIncludeDeepMembers,!0).to.not.include.deep.members(u)},j.includeOrderedMembers=function(a,u,s){new H(a,s,j.includeOrderedMembers,!0).to.include.ordered.members(u)},j.notIncludeOrderedMembers=function(a,u,s){new H(a,s,j.notIncludeOrderedMembers,!0).to.not.include.ordered.members(u)},j.includeDeepOrderedMembers=function(a,u,s){new H(a,s,j.includeDeepOrderedMembers,!0).to.include.deep.ordered.members(u)},j.notIncludeDeepOrderedMembers=function(a,u,s){new H(a,s,j.notIncludeDeepOrderedMembers,!0).to.not.include.deep.ordered.members(u)},j.oneOf=function(a,u,s){new H(a,s,j.oneOf,!0).to.be.oneOf(u)},j.isIterable=function(a,u){if(a==null||!a[Symbol.iterator])throw u=u?`${u} expected ${Yt(a)} to be an iterable`:`expected ${Yt(a)} to be an iterable`,new Xt(u,void 0,j.isIterable)},j.changes=function(a,u,s,d){arguments.length===3&&typeof u=="function"&&(d=s,s=null),new H(a,d,j.changes,!0).to.change(u,s)},j.changesBy=function(a,u,s,d,m){if(arguments.length===4&&typeof u=="function"){let b=d;d=s,m=b}else arguments.length===3&&(d=s,s=null);new H(a,m,j.changesBy,!0).to.change(u,s).by(d)},j.doesNotChange=function(a,u,s,d){return arguments.length===3&&typeof u=="function"&&(d=s,s=null),new H(a,d,j.doesNotChange,!0).to.not.change(u,s)},j.changesButNotBy=function(a,u,s,d,m){if(arguments.length===4&&typeof u=="function"){let b=d;d=s,m=b}else arguments.length===3&&(d=s,s=null);new H(a,m,j.changesButNotBy,!0).to.change(u,s).but.not.by(d)},j.increases=function(a,u,s,d){return arguments.length===3&&typeof u=="function"&&(d=s,s=null),new H(a,d,j.increases,!0).to.increase(u,s)},j.increasesBy=function(a,u,s,d,m){if(arguments.length===4&&typeof u=="function"){let b=d;d=s,m=b}else arguments.length===3&&(d=s,s=null);new H(a,m,j.increasesBy,!0).to.increase(u,s).by(d)},j.doesNotIncrease=function(a,u,s,d){return arguments.length===3&&typeof u=="function"&&(d=s,s=null),new H(a,d,j.doesNotIncrease,!0).to.not.increase(u,s)},j.increasesButNotBy=function(a,u,s,d,m){if(arguments.length===4&&typeof u=="function"){let b=d;d=s,m=b}else arguments.length===3&&(d=s,s=null);new H(a,m,j.increasesButNotBy,!0).to.increase(u,s).but.not.by(d)},j.decreases=function(a,u,s,d){return arguments.length===3&&typeof u=="function"&&(d=s,s=null),new H(a,d,j.decreases,!0).to.decrease(u,s)},j.decreasesBy=function(a,u,s,d,m){if(arguments.length===4&&typeof u=="function"){let b=d;d=s,m=b}else arguments.length===3&&(d=s,s=null);new H(a,m,j.decreasesBy,!0).to.decrease(u,s).by(d)},j.doesNotDecrease=function(a,u,s,d){return arguments.length===3&&typeof u=="function"&&(d=s,s=null),new H(a,d,j.doesNotDecrease,!0).to.not.decrease(u,s)},j.doesNotDecreaseBy=function(a,u,s,d,m){if(arguments.length===4&&typeof u=="function"){let b=d;d=s,m=b}else arguments.length===3&&(d=s,s=null);return new H(a,m,j.doesNotDecreaseBy,!0).to.not.decrease(u,s).by(d)},j.decreasesButNotBy=function(a,u,s,d,m){if(arguments.length===4&&typeof u=="function"){let b=d;d=s,m=b}else arguments.length===3&&(d=s,s=null);new H(a,m,j.decreasesButNotBy,!0).to.decrease(u,s).but.not.by(d)},j.ifError=function(a){if(a)throw a},j.isExtensible=function(a,u){new H(a,u,j.isExtensible,!0).to.be.extensible},j.isNotExtensible=function(a,u){new H(a,u,j.isNotExtensible,!0).to.not.be.extensible},j.isSealed=function(a,u){new H(a,u,j.isSealed,!0).to.be.sealed},j.isNotSealed=function(a,u){new H(a,u,j.isNotSealed,!0).to.not.be.sealed},j.isFrozen=function(a,u){new H(a,u,j.isFrozen,!0).to.be.frozen},j.isNotFrozen=function(a,u){new H(a,u,j.isNotFrozen,!0).to.not.be.frozen},j.isEmpty=function(a,u){new H(a,u,j.isEmpty,!0).to.be.empty},j.isNotEmpty=function(a,u){new H(a,u,j.isNotEmpty,!0).to.not.be.empty},j.containsSubset=function(a,u,s){new H(a,s).to.containSubset(u)},j.doesNotContainSubset=function(a,u,s){new H(a,s).to.not.containSubset(u)};var HN=[["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"]];for(const[a,u]of HN)j[u]=j[a];var hO=[];function mO(a){const u={use:mO,AssertionError:Xt,util:mS,config:Ia,expect:zS,assert:j,Assertion:H,...pO};return~hO.indexOf(a)||(a(u,mS),hO.push(a)),u}le(mO,"use");function Ot(a,u,s){return a.namespaceURI&&a.namespaceURI!=="http://www.w3.org/1999/xhtml"||(u=Array.isArray(u)?u:[u],!u.includes(a.tagName.toLowerCase()))?!1:s?Object.entries(s).every(([d,m])=>a[d]===m):!0}function Ur(a){var u;if(LN(a)&&a.defaultView)return a.defaultView;if(!((u=a.ownerDocument)===null||u===void 0)&&u.defaultView)return a.ownerDocument.defaultView;throw new Error(`Could not determine window of node. Node was ${YN(a)}`)}function LN(a){return a.nodeType===9}function YN(a){return typeof a=="function"?`function ${a.name}`:a===null?"null":String(a)}function yO(a,u){return new Promise((s,d)=>{const m=new u;m.onerror=d,m.onabort=d,m.onload=()=>{s(String(m.result))},m.readAsText(a)})}function z_(a,u){const s={...u,length:u.length,item:d=>s[d],[Symbol.iterator]:function*(){for(let m=0;m<s.length;m++)yield s[m]}};return s.constructor=a.FileList,a.FileList&&Object.setPrototypeOf(s,a.FileList.prototype),Object.freeze(s),s}function zs(a,u,s){return u in a?Object.defineProperty(a,u,{value:s,enumerable:!0,configurable:!0,writable:!0}):a[u]=s,a}class vO{getAsFile(){return this.file}getAsString(u){typeof this.data=="string"&&u(this.data)}webkitGetAsEntry(){throw new Error("not implemented")}constructor(u,s){zs(this,"kind",void 0),zs(this,"type",void 0),zs(this,"file",null),zs(this,"data",void 0),typeof u=="string"?(this.kind="string",this.type=String(s),this.data=u):(this.kind="file",this.type=u.type,this.file=u)}}class GN extends Array{add(...u){const s=new vO(u[0],u[1]);return this.push(s),s}clear(){this.splice(0,this.length)}remove(u){this.splice(u,1)}}function NS(a,u){const[s,d]=a.split("/"),m=!d||d==="*";return b=>u?b.type===(m?s:a):m?b.type.startsWith(`${s}/`):b.type===s}function VN(a){return new class{getData(s){var d;const m=(d=this.items.find(NS(s,!0)))!==null&&d!==void 0?d:this.items.find(NS(s,!1));let b="";return m?.getAsString(g=>{b=g}),b}setData(s,d){const m=this.items.findIndex(NS(s,!0)),b=new vO(d,s);m>=0?this.items.splice(m,1,b):this.items.push(b)}clearData(s){if(s){const d=this.items.findIndex(NS(s,!0));d>=0&&this.items.remove(d)}else this.items.clear()}get types(){const s=[];return this.files.length&&s.push("Files"),this.items.forEach(d=>s.push(d.type)),Object.freeze(s),s}setDragImage(){}constructor(){zs(this,"dropEffect","none"),zs(this,"effectAllowed","uninitialized"),zs(this,"items",new GN),zs(this,"files",z_(a,[]))}}}function N_(a,u=[]){const s=typeof a.DataTransfer>"u"?VN(a):new a.DataTransfer;return Object.defineProperty(s,"files",{get:()=>z_(a,u)}),s}async function PN(a,u){return u.kind==="file"?u.getAsFile():new a.Blob([await new Promise(s=>u.getAsString(s))],{type:u.type})}function bO(a,u,s){return u in a?Object.defineProperty(a,u,{value:s,enumerable:!0,configurable:!0,writable:!0}):a[u]=s,a}function gO(a,...u){const s=Object.fromEntries(u.map(d=>[typeof d=="string"?"text/plain":d.type,Promise.resolve(d)]));return typeof a.ClipboardItem<"u"?new a.ClipboardItem(s):new class{get types(){return Array.from(Object.keys(this.data))}async getType(m){const b=await this.data[m];if(!b)throw new Error(`${m} is not one of the available MIME types on this item.`);return b instanceof a.Blob?b:new a.Blob([b],{type:m})}constructor(m){bO(this,"data",void 0),this.data=m}}(s)}const Sp=Symbol("Manage ClipboardSub");function EO(a,u){return Object.assign(new class extends a.EventTarget{async read(){return Array.from(this.items)}async readText(){let d="";for(const m of this.items){const b=m.types.includes("text/plain")?"text/plain":m.types.find(g=>g.startsWith("text/"));b&&(d+=await m.getType(b).then(g=>yO(g,a.FileReader)))}return d}async write(d){this.items=d}async writeText(d){this.items=[gO(a,d)]}constructor(...d){super(...d),bO(this,"items",[])}},{[Sp]:u})}function U_(a){return!!a?.[Sp]}function kN(a){if(U_(a.navigator.clipboard))return a.navigator.clipboard[Sp];const u=Object.getOwnPropertyDescriptor(a.navigator,"clipboard");let s;const d={resetClipboardStub:()=>{s=EO(a,d)},detachClipboardStub:()=>{u?Object.defineProperty(a.navigator,"clipboard",u):Object.defineProperty(a.navigator,"clipboard",{value:void 0,configurable:!0})}};return s=EO(a,d),Object.defineProperty(a.navigator,"clipboard",{get:()=>s,configurable:!0}),s[Sp]}function XN(a){U_(a.navigator.clipboard)&&a.navigator.clipboard[Sp].resetClipboardStub()}function QN(a){U_(a.navigator.clipboard)&&a.navigator.clipboard[Sp].detachClipboardStub()}async function $N(a){const u=a.defaultView,s=u?.navigator.clipboard,d=s&&await s.read();if(!d)throw new Error("The Clipboard API is unavailable.");const m=N_(u);for(const b of d)for(const g of b.types)m.setData(g,await b.getType(g).then(S=>yO(S,u.FileReader)));return m}async function SO(a,u){const s=Ur(a),d=s.navigator.clipboard,m=[];for(let g=0;g<u.items.length;g++){const S=u.items[g],R=await PN(s,S);m.push(gO(s,R))}if(!(d&&await d.write(m).then(()=>!0,()=>!1)))throw new Error("The Clipboard API is unavailable.")}const US=globalThis;typeof US.afterEach=="function"&&US.afterEach(()=>XN(globalThis.window)),typeof US.afterAll=="function"&&US.afterAll(()=>QN(globalThis.window));const RO=["input:not([type=hidden]):not([disabled])","button:not([disabled])","select:not([disabled])","textarea:not([disabled])",'[contenteditable=""]','[contenteditable="true"]',"a[href]","[tabindex]:not([disabled])"].join(", ");function j_(a){return a.matches(RO)}function ZN(a){return new a.constructor(a.type,a)}function io(a){for(let s=a;s;s=s.parentElement)if(Ot(s,["button","input","select","textarea","optgroup","option"])){if(s.hasAttribute("disabled"))return!0}else if(Ot(s,"fieldset")){var u;if(s.hasAttribute("disabled")&&!(!((u=s.querySelector(":scope > legend"))===null||u===void 0)&&u.contains(a)))return!0}else if(s.tagName.includes("-")&&s.constructor.formAssociated&&s.hasAttribute("disabled"))return!0;return!1}function fy(a){const u=a.activeElement;return u?.shadowRoot?fy(u.shadowRoot):io(u)?a.ownerDocument?a.ownerDocument.body:a.body:u}function B_(a){var u;return(u=fy(a))!==null&&u!==void 0?u:a.body}function JN(a,u){let s=a;do{if(u(s))return s;s=s.parentElement}while(s&&s!==a.ownerDocument.body)}function Sf(a){return a.hasAttribute("contenteditable")&&(a.getAttribute("contenteditable")=="true"||a.getAttribute("contenteditable")=="")}function dy(a){const u=KN(a);return u&&(u.closest('[contenteditable=""]')||u.closest('[contenteditable="true"]'))}function KN(a){return a.nodeType===1?a:a.parentElement}var TO=(function(a){return a.button="button",a.color="color",a.file="file",a.image="image",a.reset="reset",a.submit="submit",a.checkbox="checkbox",a.radio="radio",a})(TO||{});function _O(a){return Ot(a,"button")||Ot(a,"input")&&a.type in TO}function Rp(a){return CO(a)&&!a.readOnly||Sf(a)}var AO=(function(a){return a.text="text",a.date="date",a["datetime-local"]="datetime-local",a.email="email",a.month="month",a.number="number",a.password="password",a.search="search",a.tel="tel",a.time="time",a.url="url",a.week="week",a})(AO||{});function CO(a){return Ot(a,"textarea")||Ot(a,"input")&&a.type in AO}function pi(a){return wO(a)&&CO(a)}function IN(a){return wO(a)&&_O(a)}function wO(a){return a.nodeType===1}function FN(a){const u=a.ownerDocument.getSelection();if(u?.focusNode&&pi(a)){const d=dy(u.focusNode);if(d){if(!u.isCollapsed){var s;const m=((s=d.firstChild)===null||s===void 0?void 0:s.nodeType)===3?d.firstChild:d;u.setBaseAndExtent(m,0,m,0)}}else u.setBaseAndExtent(a,0,a,0)}}var hi={},jS={exports:{}};jS.exports;var OO;function MO(){return OO||(OO=1,(function(a){const s=(b=0)=>g=>`\x1B[${38+b};5;${g}m`,d=(b=0)=>(g,S,R)=>`\x1B[${38+b};2;${g};${S};${R}m`;function m(){const b=new Map,g={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}};g.color.gray=g.color.blackBright,g.bgColor.bgGray=g.bgColor.bgBlackBright,g.color.grey=g.color.blackBright,g.bgColor.bgGrey=g.bgColor.bgBlackBright;for(const[S,R]of Object.entries(g)){for(const[_,O]of Object.entries(R))g[_]={open:`\x1B[${O[0]}m`,close:`\x1B[${O[1]}m`},R[_]=g[_],b.set(O[0],O[1]);Object.defineProperty(g,S,{value:R,enumerable:!1})}return Object.defineProperty(g,"codes",{value:b,enumerable:!1}),g.color.close="\x1B[39m",g.bgColor.close="\x1B[49m",g.color.ansi256=s(),g.color.ansi16m=d(),g.bgColor.ansi256=s(10),g.bgColor.ansi16m=d(10),Object.defineProperties(g,{rgbToAnsi256:{value:(S,R,_)=>S===R&&R===_?S<8?16:S>248?231:Math.round((S-8)/247*24)+232:16+36*Math.round(S/255*5)+6*Math.round(R/255*5)+Math.round(_/255*5),enumerable:!1},hexToRgb:{value:S=>{const R=/(?<colorString>[a-f\d]{6}|[a-f\d]{3})/i.exec(S.toString(16));if(!R)return[0,0,0];let{colorString:_}=R.groups;_.length===3&&(_=_.split("").map(A=>A+A).join(""));const O=Number.parseInt(_,16);return[O>>16&255,O>>8&255,O&255]},enumerable:!1},hexToAnsi256:{value:S=>g.rgbToAnsi256(...g.hexToRgb(S)),enumerable:!1}}),g}Object.defineProperty(a,"exports",{enumerable:!0,get:m})})(jS)),jS.exports}var Rf={},xO;function BS(){if(xO)return Rf;xO=1,Object.defineProperty(Rf,"__esModule",{value:!0}),Rf.printIteratorEntries=u,Rf.printIteratorValues=s,Rf.printListItems=d,Rf.printObjectProperties=m;const a=(b,g)=>{const S=Object.keys(b).sort(g);return Object.getOwnPropertySymbols&&Object.getOwnPropertySymbols(b).forEach(R=>{Object.getOwnPropertyDescriptor(b,R).enumerable&&S.push(R)}),S};function u(b,g,S,R,_,O,A=": "){let T="",z=b.next();if(!z.done){T+=g.spacingOuter;const U=S+g.indent;for(;!z.done;){const G=O(z.value[0],g,U,R,_),oe=O(z.value[1],g,U,R,_);T+=U+G+A+oe,z=b.next(),z.done?g.min||(T+=","):T+=","+g.spacingInner}T+=g.spacingOuter+S}return T}function s(b,g,S,R,_,O){let A="",T=b.next();if(!T.done){A+=g.spacingOuter;const z=S+g.indent;for(;!T.done;)A+=z+O(T.value,g,z,R,_),T=b.next(),T.done?g.min||(A+=","):A+=","+g.spacingInner;A+=g.spacingOuter+S}return A}function d(b,g,S,R,_,O){let A="";if(b.length){A+=g.spacingOuter;const T=S+g.indent;for(let z=0;z<b.length;z++)A+=T,z in b&&(A+=O(b[z],g,T,R,_)),z<b.length-1?A+=","+g.spacingInner:g.min||(A+=",");A+=g.spacingOuter+S}return A}function m(b,g,S,R,_,O){let A="";const T=a(b,g.compareKeys);if(T.length){A+=g.spacingOuter;const z=S+g.indent;for(let U=0;U<T.length;U++){const G=T[U],oe=O(G,g,z,R,_),D=O(b[G],g,z,R,_);A+=z+oe+": "+D,U<T.length-1?A+=","+g.spacingInner:g.min||(A+=",")}A+=g.spacingOuter+S}return A}return Rf}var oo={},qO;function WN(){if(qO)return oo;qO=1,Object.defineProperty(oo,"__esModule",{value:!0}),oo.test=oo.serialize=oo.default=void 0;var a=BS(),u=(function(){return typeof globalThis<"u"?globalThis:typeof u<"u"?u:typeof self<"u"?self:typeof window<"u"?window:Function("return this")()})(),s=u["jest-symbol-do-not-touch"]||u.Symbol;const d=typeof s=="function"&&s.for?s.for("jest.asymmetricMatcher"):1267621,m=" ",b=(_,O,A,T,z,U)=>{const G=_.toString();return G==="ArrayContaining"||G==="ArrayNotContaining"?++T>O.maxDepth?"["+G+"]":G+m+"["+(0,a.printListItems)(_.sample,O,A,T,z,U)+"]":G==="ObjectContaining"||G==="ObjectNotContaining"?++T>O.maxDepth?"["+G+"]":G+m+"{"+(0,a.printObjectProperties)(_.sample,O,A,T,z,U)+"}":G==="StringMatching"||G==="StringNotMatching"||G==="StringContaining"||G==="StringNotContaining"?G+m+U(_.sample,O,A,T,z):_.toAsymmetricMatcher()};oo.serialize=b;const g=_=>_&&_.$$typeof===d;oo.test=g;var R={serialize:b,test:g};return oo.default=R,oo}var so={},H_,DO;function eU(){return DO||(DO=1,H_=({onlyFirst:a=!1}={})=>{const u=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))"].join("|");return new RegExp(u,a?void 0:"g")}),H_}var zO;function tU(){if(zO)return so;zO=1,Object.defineProperty(so,"__esModule",{value:!0}),so.test=so.serialize=so.default=void 0;var a=s(eU()),u=s(MO());function s(R){return R&&R.__esModule?R:{default:R}}const d=R=>R.replace((0,a.default)(),_=>{switch(_){case u.default.red.close:case u.default.green.close:case u.default.cyan.close:case u.default.gray.close:case u.default.white.close:case u.default.yellow.close:case u.default.bgRed.close:case u.default.bgGreen.close:case u.default.bgYellow.close:case u.default.inverse.close:case u.default.dim.close:case u.default.bold.close:case u.default.reset.open:case u.default.reset.close:return"</>";case u.default.red.open:return"<red>";case u.default.green.open:return"<green>";case u.default.cyan.open:return"<cyan>";case u.default.gray.open:return"<gray>";case u.default.white.open:return"<white>";case u.default.yellow.open:return"<yellow>";case u.default.bgRed.open:return"<bgRed>";case u.default.bgGreen.open:return"<bgGreen>";case u.default.bgYellow.open:return"<bgYellow>";case u.default.inverse.open:return"<inverse>";case u.default.dim.open:return"<dim>";case u.default.bold.open:return"<bold>";default:return""}}),m=R=>typeof R=="string"&&!!R.match((0,a.default)());so.test=m;const b=(R,_,O,A,T,z)=>z(d(R),_,O,A,T);so.serialize=b;var S={serialize:b,test:m};return so.default=S,so}var co={},NO;function nU(){if(NO)return co;NO=1,Object.defineProperty(co,"__esModule",{value:!0}),co.test=co.serialize=co.default=void 0;var a=BS();const u=" ",s=["DOMStringMap","NamedNodeMap"],d=/^(HTML\w*Collection|NodeList)$/,m=O=>s.indexOf(O)!==-1||d.test(O),b=O=>O&&O.constructor&&!!O.constructor.name&&m(O.constructor.name);co.test=b;const g=O=>O.constructor.name==="NamedNodeMap",S=(O,A,T,z,U,G)=>{const oe=O.constructor.name;return++z>A.maxDepth?"["+oe+"]":(A.min?"":oe+u)+(s.indexOf(oe)!==-1?"{"+(0,a.printObjectProperties)(g(O)?Array.from(O).reduce((D,ne)=>(D[ne.name]=ne.value,D),{}):{...O},A,T,z,U,G)+"}":"["+(0,a.printListItems)(Array.from(O),A,T,z,U,G)+"]")};co.serialize=S;var _={serialize:S,test:b};return co.default=_,co}var fo={},dl={},HS={},UO;function aU(){if(UO)return HS;UO=1,Object.defineProperty(HS,"__esModule",{value:!0}),HS.default=a;function a(u){return u.replace(/</g,"&lt;").replace(/>/g,"&gt;")}return HS}var jO;function L_(){if(jO)return dl;jO=1,Object.defineProperty(dl,"__esModule",{value:!0}),dl.printText=dl.printProps=dl.printElementAsLeaf=dl.printElement=dl.printComment=dl.printChildren=void 0;var a=u(aU());function u(R){return R&&R.__esModule?R:{default:R}}const s=(R,_,O,A,T,z,U)=>{const G=A+O.indent,oe=O.colors;return R.map(D=>{const ne=_[D];let te=U(ne,O,G,T,z);return typeof ne!="string"&&(te.indexOf(`
250
250
  `)!==-1&&(te=O.spacingOuter+G+te+O.spacingOuter+A),te="{"+te+"}"),O.spacingInner+A+oe.prop.open+D+oe.prop.close+"="+oe.value.open+te+oe.value.close}).join("")};dl.printProps=s;const d=(R,_,O,A,T,z)=>R.map(U=>_.spacingOuter+O+(typeof U=="string"?m(U,_):z(U,_,O,A,T))).join("");dl.printChildren=d;const m=(R,_)=>{const O=_.colors.content;return O.open+(0,a.default)(R)+O.close};dl.printText=m;const b=(R,_)=>{const O=_.colors.comment;return O.open+"<!--"+(0,a.default)(R)+"-->"+O.close};dl.printComment=b;const g=(R,_,O,A,T)=>{const z=A.colors.tag;return z.open+"<"+R+(_&&z.close+_+A.spacingOuter+T+z.open)+(O?">"+z.close+O+A.spacingOuter+T+z.open+"</"+R:(_&&!A.min?"":" ")+"/")+">"+z.close};dl.printElement=g;const S=(R,_)=>{const O=_.colors.tag;return O.open+"<"+R+O.close+" …"+O.open+" />"+O.close};return dl.printElementAsLeaf=S,dl}var BO;function lU(){if(BO)return fo;BO=1,Object.defineProperty(fo,"__esModule",{value:!0}),fo.test=fo.serialize=fo.default=void 0;var a=L_();const u=1,s=3,d=8,m=11,b=/^((HTML|SVG)\w*)?Element$/,g=G=>{try{return typeof G.hasAttribute=="function"&&G.hasAttribute("is")}catch{return!1}},S=G=>{const oe=G.constructor.name,{nodeType:D,tagName:ne}=G,te=typeof ne=="string"&&ne.includes("-")||g(G);return D===u&&(b.test(oe)||te)||D===s&&oe==="Text"||D===d&&oe==="Comment"||D===m&&oe==="DocumentFragment"},R=G=>{var oe;return(G==null||(oe=G.constructor)===null||oe===void 0?void 0:oe.name)&&S(G)};fo.test=R;function _(G){return G.nodeType===s}function O(G){return G.nodeType===d}function A(G){return G.nodeType===m}const T=(G,oe,D,ne,te,fe)=>{if(_(G))return(0,a.printText)(G.data,oe);if(O(G))return(0,a.printComment)(G.data,oe);const ue=A(G)?"DocumentFragment":G.tagName.toLowerCase();return++ne>oe.maxDepth?(0,a.printElementAsLeaf)(ue,oe):(0,a.printElement)(ue,(0,a.printProps)(A(G)?[]:Array.from(G.attributes).map(L=>L.name).sort(),A(G)?{}:Array.from(G.attributes).reduce((L,B)=>(L[B.name]=B.value,L),{}),oe,D+oe.indent,ne,te,fe),(0,a.printChildren)(Array.prototype.slice.call(G.childNodes||G.children),oe,D+oe.indent,ne,te,fe),oe,D)};fo.serialize=T;var U={serialize:T,test:R};return fo.default=U,fo}var po={},HO;function rU(){if(HO)return po;HO=1,Object.defineProperty(po,"__esModule",{value:!0}),po.test=po.serialize=po.default=void 0;var a=BS();const u="@@__IMMUTABLE_ITERABLE__@@",s="@@__IMMUTABLE_LIST__@@",d="@@__IMMUTABLE_KEYED__@@",m="@@__IMMUTABLE_MAP__@@",b="@@__IMMUTABLE_ORDERED__@@",g="@@__IMMUTABLE_RECORD__@@",S="@@__IMMUTABLE_SEQ__@@",R="@@__IMMUTABLE_SET__@@",_="@@__IMMUTABLE_STACK__@@",O=B=>"Immutable."+B,A=B=>"["+B+"]",T=" ",z="…",U=(B,Q,Ee,ve,ze,_e,de)=>++ve>Q.maxDepth?A(O(de)):O(de)+T+"{"+(0,a.printIteratorEntries)(B.entries(),Q,Ee,ve,ze,_e)+"}";function G(B){let Q=0;return{next(){if(Q<B._keys.length){const Ee=B._keys[Q++];return{done:!1,value:[Ee,B.get(Ee)]}}return{done:!0,value:void 0}}}}const oe=(B,Q,Ee,ve,ze,_e)=>{const de=O(B._name||"Record");return++ve>Q.maxDepth?A(de):de+T+"{"+(0,a.printIteratorEntries)(G(B),Q,Ee,ve,ze,_e)+"}"},D=(B,Q,Ee,ve,ze,_e)=>{const de=O("Seq");return++ve>Q.maxDepth?A(de):B[d]?de+T+"{"+(B._iter||B._object?(0,a.printIteratorEntries)(B.entries(),Q,Ee,ve,ze,_e):z)+"}":de+T+"["+(B._iter||B._array||B._collection||B._iterable?(0,a.printIteratorValues)(B.values(),Q,Ee,ve,ze,_e):z)+"]"},ne=(B,Q,Ee,ve,ze,_e,de)=>++ve>Q.maxDepth?A(O(de)):O(de)+T+"["+(0,a.printIteratorValues)(B.values(),Q,Ee,ve,ze,_e)+"]",te=(B,Q,Ee,ve,ze,_e)=>B[m]?U(B,Q,Ee,ve,ze,_e,B[b]?"OrderedMap":"Map"):B[s]?ne(B,Q,Ee,ve,ze,_e,"List"):B[R]?ne(B,Q,Ee,ve,ze,_e,B[b]?"OrderedSet":"Set"):B[_]?ne(B,Q,Ee,ve,ze,_e,"Stack"):B[S]?D(B,Q,Ee,ve,ze,_e):oe(B,Q,Ee,ve,ze,_e);po.serialize=te;const fe=B=>B&&(B[u]===!0||B[g]===!0);po.test=fe;var L={serialize:te,test:fe};return po.default=L,po}var ho={},LS={exports:{}},un={};var LO;function uU(){if(LO)return un;LO=1;var a=60103,u=60106,s=60107,d=60108,m=60114,b=60109,g=60110,S=60112,R=60113,_=60120,O=60115,A=60116,T=60121,z=60122,U=60117,G=60129,oe=60131;if(typeof Symbol=="function"&&Symbol.for){var D=Symbol.for;a=D("react.element"),u=D("react.portal"),s=D("react.fragment"),d=D("react.strict_mode"),m=D("react.profiler"),b=D("react.provider"),g=D("react.context"),S=D("react.forward_ref"),R=D("react.suspense"),_=D("react.suspense_list"),O=D("react.memo"),A=D("react.lazy"),T=D("react.block"),z=D("react.server.block"),U=D("react.fundamental"),G=D("react.debug_trace_mode"),oe=D("react.legacy_hidden")}function ne(de){if(typeof de=="object"&&de!==null){var xe=de.$$typeof;switch(xe){case a:switch(de=de.type,de){case s:case m:case d:case R:case _:return de;default:switch(de=de&&de.$$typeof,de){case g:case S:case A:case O:case b:return de;default:return xe}}case u:return xe}}}var te=b,fe=a,ue=S,L=s,B=A,Q=O,Ee=u,ve=m,ze=d,_e=R;return un.ContextConsumer=g,un.ContextProvider=te,un.Element=fe,un.ForwardRef=ue,un.Fragment=L,un.Lazy=B,un.Memo=Q,un.Portal=Ee,un.Profiler=ve,un.StrictMode=ze,un.Suspense=_e,un.isAsyncMode=function(){return!1},un.isConcurrentMode=function(){return!1},un.isContextConsumer=function(de){return ne(de)===g},un.isContextProvider=function(de){return ne(de)===b},un.isElement=function(de){return typeof de=="object"&&de!==null&&de.$$typeof===a},un.isForwardRef=function(de){return ne(de)===S},un.isFragment=function(de){return ne(de)===s},un.isLazy=function(de){return ne(de)===A},un.isMemo=function(de){return ne(de)===O},un.isPortal=function(de){return ne(de)===u},un.isProfiler=function(de){return ne(de)===m},un.isStrictMode=function(de){return ne(de)===d},un.isSuspense=function(de){return ne(de)===R},un.isValidElementType=function(de){return typeof de=="string"||typeof de=="function"||de===s||de===m||de===G||de===d||de===R||de===_||de===oe||typeof de=="object"&&de!==null&&(de.$$typeof===A||de.$$typeof===O||de.$$typeof===b||de.$$typeof===g||de.$$typeof===S||de.$$typeof===U||de.$$typeof===T||de[0]===z)},un.typeOf=ne,un}var on={};var YO;function iU(){return YO||(YO=1,process.env.NODE_ENV!=="production"&&(function(){var a=60103,u=60106,s=60107,d=60108,m=60114,b=60109,g=60110,S=60112,R=60113,_=60120,O=60115,A=60116,T=60121,z=60122,U=60117,G=60129,oe=60131;if(typeof Symbol=="function"&&Symbol.for){var D=Symbol.for;a=D("react.element"),u=D("react.portal"),s=D("react.fragment"),d=D("react.strict_mode"),m=D("react.profiler"),b=D("react.provider"),g=D("react.context"),S=D("react.forward_ref"),R=D("react.suspense"),_=D("react.suspense_list"),O=D("react.memo"),A=D("react.lazy"),T=D("react.block"),z=D("react.server.block"),U=D("react.fundamental"),D("react.scope"),D("react.opaque.id"),G=D("react.debug_trace_mode"),D("react.offscreen"),oe=D("react.legacy_hidden")}var ne=!1;function te(ie){return!!(typeof ie=="string"||typeof ie=="function"||ie===s||ie===m||ie===G||ie===d||ie===R||ie===_||ie===oe||ne||typeof ie=="object"&&ie!==null&&(ie.$$typeof===A||ie.$$typeof===O||ie.$$typeof===b||ie.$$typeof===g||ie.$$typeof===S||ie.$$typeof===U||ie.$$typeof===T||ie[0]===z))}function fe(ie){if(typeof ie=="object"&&ie!==null){var mt=ie.$$typeof;switch(mt){case a:var dt=ie.type;switch(dt){case s:case m:case d:case R:case _:return dt;default:var Nt=dt&&dt.$$typeof;switch(Nt){case g:case S:case A:case O:case b:return Nt;default:return mt}}case u:return mt}}}var ue=g,L=b,B=a,Q=S,Ee=s,ve=A,ze=O,_e=u,de=m,xe=d,je=R,P=!1,ce=!1;function Oe(ie){return P||(P=!0,console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 18+.")),!1}function Be(ie){return ce||(ce=!0,console.warn("The ReactIs.isConcurrentMode() alias has been deprecated, and will be removed in React 18+.")),!1}function Qe(ie){return fe(ie)===g}function N(ie){return fe(ie)===b}function ae(ie){return typeof ie=="object"&&ie!==null&&ie.$$typeof===a}function me(ie){return fe(ie)===S}function we(ie){return fe(ie)===s}function Pe(ie){return fe(ie)===A}function Je(ie){return fe(ie)===O}function $e(ie){return fe(ie)===u}function Gt(ie){return fe(ie)===m}function I(ie){return fe(ie)===d}function Le(ie){return fe(ie)===R}on.ContextConsumer=ue,on.ContextProvider=L,on.Element=B,on.ForwardRef=Q,on.Fragment=Ee,on.Lazy=ve,on.Memo=ze,on.Portal=_e,on.Profiler=de,on.StrictMode=xe,on.Suspense=je,on.isAsyncMode=Oe,on.isConcurrentMode=Be,on.isContextConsumer=Qe,on.isContextProvider=N,on.isElement=ae,on.isForwardRef=me,on.isFragment=we,on.isLazy=Pe,on.isMemo=Je,on.isPortal=$e,on.isProfiler=Gt,on.isStrictMode=I,on.isSuspense=Le,on.isValidElementType=te,on.typeOf=fe})()),on}var GO;function oU(){return GO||(GO=1,process.env.NODE_ENV==="production"?LS.exports=uU():LS.exports=iU()),LS.exports}var VO;function sU(){if(VO)return ho;VO=1,Object.defineProperty(ho,"__esModule",{value:!0}),ho.test=ho.serialize=ho.default=void 0;var a=d(oU()),u=L_();function s(A){if(typeof WeakMap!="function")return null;var T=new WeakMap,z=new WeakMap;return(s=function(U){return U?z:T})(A)}function d(A,T){if(A&&A.__esModule)return A;if(A===null||typeof A!="object"&&typeof A!="function")return{default:A};var z=s(T);if(z&&z.has(A))return z.get(A);var U={},G=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var oe in A)if(oe!=="default"&&Object.prototype.hasOwnProperty.call(A,oe)){var D=G?Object.getOwnPropertyDescriptor(A,oe):null;D&&(D.get||D.set)?Object.defineProperty(U,oe,D):U[oe]=A[oe]}return U.default=A,z&&z.set(A,U),U}const m=(A,T=[])=>(Array.isArray(A)?A.forEach(z=>{m(z,T)}):A!=null&&A!==!1&&T.push(A),T),b=A=>{const T=A.type;if(typeof T=="string")return T;if(typeof T=="function")return T.displayName||T.name||"Unknown";if(a.isFragment(A))return"React.Fragment";if(a.isSuspense(A))return"React.Suspense";if(typeof T=="object"&&T!==null){if(a.isContextProvider(A))return"Context.Provider";if(a.isContextConsumer(A))return"Context.Consumer";if(a.isForwardRef(A)){if(T.displayName)return T.displayName;const z=T.render.displayName||T.render.name||"";return z!==""?"ForwardRef("+z+")":"ForwardRef"}if(a.isMemo(A)){const z=T.displayName||T.type.displayName||T.type.name||"";return z!==""?"Memo("+z+")":"Memo"}}return"UNDEFINED"},g=A=>{const{props:T}=A;return Object.keys(T).filter(z=>z!=="children"&&T[z]!==void 0).sort()},S=(A,T,z,U,G,oe)=>++U>T.maxDepth?(0,u.printElementAsLeaf)(b(A),T):(0,u.printElement)(b(A),(0,u.printProps)(g(A),A.props,T,z+T.indent,U,G,oe),(0,u.printChildren)(m(A.props.children),T,z+T.indent,U,G,oe),T,z);ho.serialize=S;const R=A=>A!=null&&a.isElement(A);ho.test=R;var O={serialize:S,test:R};return ho.default=O,ho}var mo={},PO;function cU(){if(PO)return mo;PO=1,Object.defineProperty(mo,"__esModule",{value:!0}),mo.test=mo.serialize=mo.default=void 0;var a=L_(),u=(function(){return typeof globalThis<"u"?globalThis:typeof u<"u"?u:typeof self<"u"?self:typeof window<"u"?window:Function("return this")()})(),s=u["jest-symbol-do-not-touch"]||u.Symbol;const d=typeof s=="function"&&s.for?s.for("react.test.json"):245830487,m=_=>{const{props:O}=_;return O?Object.keys(O).filter(A=>O[A]!==void 0).sort():[]},b=(_,O,A,T,z,U)=>++T>O.maxDepth?(0,a.printElementAsLeaf)(_.type,O):(0,a.printElement)(_.type,_.props?(0,a.printProps)(m(_),_.props,O,A+O.indent,T,z,U):"",_.children?(0,a.printChildren)(_.children,O,A+O.indent,T,z,U):"",O,A);mo.serialize=b;const g=_=>_&&_.$$typeof===d;mo.test=g;var R={serialize:b,test:g};return mo.default=R,mo}var kO;function fU(){if(kO)return hi;kO=1,Object.defineProperty(hi,"__esModule",{value:!0}),hi.default=hi.DEFAULT_OPTIONS=void 0,hi.format=Je,hi.plugins=void 0;var a=_(MO()),u=BS(),s=_(WN()),d=_(tU()),m=_(nU()),b=_(lU()),g=_(rU()),S=_(sU()),R=_(cU());function _(I){return I&&I.__esModule?I:{default:I}}const O=Object.prototype.toString,A=Date.prototype.toISOString,T=Error.prototype.toString,z=RegExp.prototype.toString,U=I=>typeof I.constructor=="function"&&I.constructor.name||"Object",G=I=>typeof window<"u"&&I===window,oe=/^Symbol\((.*)\)(.*)$/,D=/\n/gi;class ne extends Error{constructor(Le,ie){super(Le),this.stack=ie,this.name=this.constructor.name}}function te(I){return I==="[object Array]"||I==="[object ArrayBuffer]"||I==="[object DataView]"||I==="[object Float32Array]"||I==="[object Float64Array]"||I==="[object Int8Array]"||I==="[object Int16Array]"||I==="[object Int32Array]"||I==="[object Uint8Array]"||I==="[object Uint8ClampedArray]"||I==="[object Uint16Array]"||I==="[object Uint32Array]"}function fe(I){return Object.is(I,-0)?"-0":String(I)}function ue(I){return`${I}n`}function L(I,Le){return Le?"[Function "+(I.name||"anonymous")+"]":"[Function]"}function B(I){return String(I).replace(oe,"Symbol($1)")}function Q(I){return"["+T.call(I)+"]"}function Ee(I,Le,ie,mt){if(I===!0||I===!1)return""+I;if(I===void 0)return"undefined";if(I===null)return"null";const dt=typeof I;if(dt==="number")return fe(I);if(dt==="bigint")return ue(I);if(dt==="string")return mt?'"'+I.replace(/"|\\/g,"\\$&")+'"':'"'+I+'"';if(dt==="function")return L(I,Le);if(dt==="symbol")return B(I);const Nt=O.call(I);return Nt==="[object WeakMap]"?"WeakMap {}":Nt==="[object WeakSet]"?"WeakSet {}":Nt==="[object Function]"||Nt==="[object GeneratorFunction]"?L(I,Le):Nt==="[object Symbol]"?B(I):Nt==="[object Date]"?isNaN(+I)?"Date { NaN }":A.call(I):Nt==="[object Error]"?Q(I):Nt==="[object RegExp]"?ie?z.call(I).replace(/[\\^$*+?.()|[\]{}]/g,"\\$&"):z.call(I):I instanceof Error?Q(I):null}function ve(I,Le,ie,mt,dt,Nt){if(dt.indexOf(I)!==-1)return"[Circular]";dt=dt.slice(),dt.push(I);const ln=++mt>Le.maxDepth,lt=Le.min;if(Le.callToJSON&&!ln&&I.toJSON&&typeof I.toJSON=="function"&&!Nt)return xe(I.toJSON(),Le,ie,mt,dt,!0);const sn=O.call(I);return sn==="[object Arguments]"?ln?"[Arguments]":(lt?"":"Arguments ")+"["+(0,u.printListItems)(I,Le,ie,mt,dt,xe)+"]":te(sn)?ln?"["+I.constructor.name+"]":(lt||!Le.printBasicPrototype&&I.constructor.name==="Array"?"":I.constructor.name+" ")+"["+(0,u.printListItems)(I,Le,ie,mt,dt,xe)+"]":sn==="[object Map]"?ln?"[Map]":"Map {"+(0,u.printIteratorEntries)(I.entries(),Le,ie,mt,dt,xe," => ")+"}":sn==="[object Set]"?ln?"[Set]":"Set {"+(0,u.printIteratorValues)(I.values(),Le,ie,mt,dt,xe)+"}":ln||G(I)?"["+U(I)+"]":(lt||!Le.printBasicPrototype&&U(I)==="Object"?"":U(I)+" ")+"{"+(0,u.printObjectProperties)(I,Le,ie,mt,dt,xe)+"}"}function ze(I){return I.serialize!=null}function _e(I,Le,ie,mt,dt,Nt){let ln;try{ln=ze(I)?I.serialize(Le,ie,mt,dt,Nt,xe):I.print(Le,lt=>xe(lt,ie,mt,dt,Nt),lt=>{const sn=mt+ie.indent;return sn+lt.replace(D,`
251
251
  `+sn)},{edgeSpacing:ie.spacingOuter,min:ie.min,spacing:ie.spacingInner},ie.colors)}catch(lt){throw new ne(lt.message,lt.stack)}if(typeof ln!="string")throw new Error(`pretty-format: Plugin must return type "string" but instead returned "${typeof ln}".`);return ln}function de(I,Le){for(let ie=0;ie<I.length;ie++)try{if(I[ie].test(Le))return I[ie]}catch(mt){throw new ne(mt.message,mt.stack)}return null}function xe(I,Le,ie,mt,dt,Nt){const ln=de(Le.plugins,I);if(ln!==null)return _e(ln,I,Le,ie,mt,dt);const lt=Ee(I,Le.printFunctionName,Le.escapeRegex,Le.escapeString);return lt!==null?lt:ve(I,Le,ie,mt,dt,Nt)}const je={comment:"gray",content:"reset",prop:"yellow",tag:"cyan",value:"green"},P=Object.keys(je),ce={callToJSON:!0,compareKeys:void 0,escapeRegex:!1,escapeString:!0,highlight:!1,indent:2,maxDepth:1/0,min:!1,plugins:[],printBasicPrototype:!0,printFunctionName:!0,theme:je};hi.DEFAULT_OPTIONS=ce;function Oe(I){if(Object.keys(I).forEach(Le=>{if(!ce.hasOwnProperty(Le))throw new Error(`pretty-format: Unknown option "${Le}".`)}),I.min&&I.indent!==void 0&&I.indent!==0)throw new Error('pretty-format: Options "min" and "indent" cannot be used together.');if(I.theme!==void 0){if(I.theme===null)throw new Error('pretty-format: Option "theme" must not be null.');if(typeof I.theme!="object")throw new Error(`pretty-format: Option "theme" must be of type "object" but instead received "${typeof I.theme}".`)}}const Be=I=>P.reduce((Le,ie)=>{const mt=I.theme&&I.theme[ie]!==void 0?I.theme[ie]:je[ie],dt=mt&&a.default[mt];if(dt&&typeof dt.close=="string"&&typeof dt.open=="string")Le[ie]=dt;else throw new Error(`pretty-format: Option "theme" has a key "${ie}" whose value "${mt}" is undefined in ansi-styles.`);return Le},Object.create(null)),Qe=()=>P.reduce((I,Le)=>(I[Le]={close:"",open:""},I),Object.create(null)),N=I=>I&&I.printFunctionName!==void 0?I.printFunctionName:ce.printFunctionName,ae=I=>I&&I.escapeRegex!==void 0?I.escapeRegex:ce.escapeRegex,me=I=>I&&I.escapeString!==void 0?I.escapeString:ce.escapeString,we=I=>{var Le;return{callToJSON:I&&I.callToJSON!==void 0?I.callToJSON:ce.callToJSON,colors:I&&I.highlight?Be(I):Qe(),compareKeys:I&&typeof I.compareKeys=="function"?I.compareKeys:ce.compareKeys,escapeRegex:ae(I),escapeString:me(I),indent:I&&I.min?"":Pe(I&&I.indent!==void 0?I.indent:ce.indent),maxDepth:I&&I.maxDepth!==void 0?I.maxDepth:ce.maxDepth,min:I&&I.min!==void 0?I.min:ce.min,plugins:I&&I.plugins!==void 0?I.plugins:ce.plugins,printBasicPrototype:(Le=I?.printBasicPrototype)!==null&&Le!==void 0?Le:!0,printFunctionName:N(I),spacingInner:I&&I.min?" ":`
@@ -308,4 +308,4 @@ Unable to find an `+(d===!1?"accessible ":"")+'element with the role "'+u+'"'+R+
308
308
  `))}function uH(a){return a.reverse().map((u,s)=>["".padEnd(s),u.tagName,u.id&&`#${u.id}`,u.hasAttribute("data-testid")&&`(testId=${u.getAttribute("data-testid")})`,iH(u),a.length>1&&s===0&&" <-- This element declared `pointer-events: none`",a.length>1&&s===a.length-1&&" <-- Asserted pointer events here"].filter(Boolean).join("")).join(`
309
309
  `)}function iH(a){var u;let s;if(a.hasAttribute("aria-label"))s=a.getAttribute("aria-label");else if(a.hasAttribute("aria-labelledby")){var d,m;s=(m=a.ownerDocument.getElementById(a.getAttribute("aria-labelledby")))===null||m===void 0||(d=m.textContent)===null||d===void 0?void 0:d.trim()}else if(Ot(a,["button","input","meter","output","progress","select","textarea"])&&(!((u=a.labels)===null||u===void 0)&&u.length))s=Array.from(a.labels).map(g=>{var S;return(S=g.textContent)===null||S===void 0?void 0:S.trim()}).join("|");else if(Ot(a,"button")){var b;s=(b=a.textContent)===null||b===void 0?void 0:b.trim()}return s=s?.replace(/\n/g," "),Number(s?.length)>30&&(s=`${s?.substring(0,29)}…`),s?`(label=${s})`:""}function Fq(a,u){return(a&u)>0}function Eo(a,u,s){return u in a?Object.defineProperty(a,u,{value:s,enumerable:!0,configurable:!0,writable:!0}):a[u]=s,a}class oH{init(u){const s=this.getTarget(u),[,d]=og(null,s),m=this.getEventInit();return sg(u,s),u.dispatchUIEvent(s,"pointerover",m),d.forEach(b=>u.dispatchUIEvent(b,"pointerenter",m)),this}move(u,s){const d=this.position,m=this.getTarget(u);if(this.position=s,!Jq(d,s))return;const b=this.getTarget(u),g=this.getEventInit(-1),[S,R]=og(m,b);return{leave:()=>{a1(u,m)&&m!==b&&(u.dispatchUIEvent(m,"pointerout",g),S.forEach(_=>u.dispatchUIEvent(_,"pointerleave",g)))},enter:()=>{sg(u,b),m!==b&&(u.dispatchUIEvent(b,"pointerover",g),R.forEach(_=>u.dispatchUIEvent(_,"pointerenter",g)))},move:()=>{u.dispatchUIEvent(b,"pointermove",g)}}}down(u,s=0){if(this.isDown)return;const d=this.getTarget(u);sg(u,d),this.isDown=!0,this.isPrevented=!u.dispatchUIEvent(d,"pointerdown",this.getEventInit(s))}up(u,s=0){if(!this.isDown)return;const d=this.getTarget(u);sg(u,d),this.isPrevented=!1,this.isDown=!1,u.dispatchUIEvent(d,"pointerup",this.getEventInit(s))}release(u){const s=this.getTarget(u),[d]=og(s,null),m=this.getEventInit();a1(u,s)&&(u.dispatchUIEvent(s,"pointerout",m),d.forEach(b=>u.dispatchUIEvent(b,"pointerleave",m))),this.isCancelled=!0}getTarget(u){var s;return(s=this.position.target)!==null&&s!==void 0?s:u.config.document.body}getEventInit(u){return{...this.position.coords,pointerId:this.pointerId,pointerType:this.pointerType,isPrimary:this.isPrimary,button:pA(u),buttons:this.buttons.getButtons()}}constructor({pointerId:u,pointerType:s,isPrimary:d},m){Eo(this,"pointerId",void 0),Eo(this,"pointerType",void 0),Eo(this,"isPrimary",void 0),Eo(this,"buttons",void 0),Eo(this,"isMultitouch",!1),Eo(this,"isCancelled",!1),Eo(this,"isDown",!1),Eo(this,"isPrevented",!1),Eo(this,"position",{}),this.pointerId=u,this.pointerType=s,this.isPrimary=d,this.isMultitouch=!d,this.buttons=m}}function Ls(a,u,s){return u in a?Object.defineProperty(a,u,{value:s,enumerable:!0,configurable:!0,writable:!0}):a[u]=s,a}class sH{isKeyPressed(u){return this.devices.get(u.pointerType).isPressed(u)}async press(u,s,d){this.devices.get(s.pointerType).addPressed(s),this.buttons.down(s);const m=this.getPointerName(s),b=s.pointerType==="touch"?this.pointers.new(m,s.pointerType,this.buttons):this.pointers.get(m);b.position=d,b.pointerType!=="touch"&&(this.mouse.position=d),b.pointerType==="touch"&&b.init(u),b.down(u,s.button),b.pointerType!=="touch"&&this.mouse.down(u,s,b.isPrevented)}async move(u,s,d){const m=this.pointers.get(s),b=m.move(u,d),g=m.pointerType==="touch"?void 0:this.mouse.move(u,d,m.isPrevented);b?.leave(),g?.leave(),b?.enter(),g?.enter(),b?.move(),g?.move()}async release(u,s,d){const m=this.devices.get(s.pointerType);m.removePressed(s),this.buttons.up(s);const b=this.pointers.get(this.getPointerName(s)),g=b.isPrevented;if(b.position=d,b.pointerType!=="touch"&&(this.mouse.position=d),m.countPressed===0&&b.up(u,s.button),b.pointerType==="touch"&&b.release(u),b.pointerType==="touch"&&!b.isMultitouch){const S=this.mouse.move(u,d,g);S?.leave(),S?.enter(),S?.move(),this.mouse.down(u,s,g)}if(!b.isMultitouch){const S=this.mouse.move(u,d,g);S?.leave(),S?.enter(),S?.move(),this.mouse.up(u,s,g)}}getPointerName(u){return u.pointerType==="touch"?u.name:u.pointerType}getPreviousPosition(u){return this.pointers.has(u)?this.pointers.get(u).position:void 0}resetClickCount(){this.mouse.resetClickCount()}getMouseTarget(u){var s;return(s=this.mouse.position.target)!==null&&s!==void 0?s:u.config.document.body}setMousePosition(u){this.mouse.position=u,this.pointers.get("mouse").position=u}constructor(u){Ls(this,"system",void 0),Ls(this,"mouse",void 0),Ls(this,"buttons",void 0),Ls(this,"devices",new class{get(s){var d,m,b;return(b=(d=this.registry)[m=s])!==null&&b!==void 0?b:d[m]=new eH}constructor(){Ls(this,"registry",{})}}),Ls(this,"pointers",new class{new(s,d,m){const b=d!=="touch"||!Object.values(this.registry).some(g=>g.pointerType==="touch"&&!g.isCancelled);return b||Object.values(this.registry).forEach(g=>{g.pointerType===d&&!g.isCancelled&&(g.isMultitouch=!0)}),this.registry[s]=new oH({pointerId:this.nextId++,pointerType:d,isPrimary:b},m),this.registry[s]}get(s){if(!this.has(s))throw new Error(`Trying to access pointer "${s}" which does not exist.`);return this.registry[s]}has(s){return s in this.registry}constructor(){Ls(this,"registry",{}),Ls(this,"nextId",1)}}),this.system=u,this.buttons=new Xq,this.mouse=new lH,this.pointers.new("mouse","mouse",this.buttons)}}function Wq(a,u,s){return u in a?Object.defineProperty(a,u,{value:s,enumerable:!0,configurable:!0,writable:!0}):a[u]=s,a}class eD{getUIEventModifiers(){return{altKey:this.keyboard.modifiers.Alt,ctrlKey:this.keyboard.modifiers.Control,metaKey:this.keyboard.modifiers.Meta,shiftKey:this.keyboard.modifiers.Shift,modifierAltGraph:this.keyboard.modifiers.AltGraph,modifierCapsLock:this.keyboard.modifiers.CapsLock,modifierFn:this.keyboard.modifiers.Fn,modifierFnLock:this.keyboard.modifiers.FnLock,modifierNumLock:this.keyboard.modifiers.NumLock,modifierScrollLock:this.keyboard.modifiers.ScrollLock,modifierSymbol:this.keyboard.modifiers.Symbol,modifierSymbolLock:this.keyboard.modifiers.SymbolLock}}constructor(){Wq(this,"keyboard",new J8(this)),Wq(this,"pointer",new sH(this))}}async function cH(a){const u=[];return this.config.skipHover||u.push({target:a}),u.push({keys:"[MouseLeft]",target:a}),this.pointer(u)}async function fH(a){return this.pointer([{target:a},"[MouseLeft][MouseLeft]"])}async function dH(a){return this.pointer([{target:a},"[MouseLeft][MouseLeft][MouseLeft]"])}async function pH(a){return this.pointer({target:a})}async function hH(a){return sg(this,this.system.pointer.getMouseTarget(this)),this.pointer({target:a.ownerDocument.body})}async function mH({shift:a}={}){return this.keyboard(a===!0?"{Shift>}{Tab}{/Shift}":a===!1?"[/ShiftLeft][/ShiftRight]{Tab}":"{Tab}")}var mA=(function(a){return a["{"]="}",a["["]="]",a})(mA||{});function tD(a,u){let s=0;const d=a[s]in mA?a[s]:"";s+=d.length;const b=new RegExp(`^\\${d}{2}`).test(a)?"":d;return{type:b,...b===""?yH(a,s,u):vH(a,s,b,u)}}function yH(a,u,s){const d=a[u];return nD(d,a,u,s),u+=d.length,{consumedLength:u,descriptor:d,releasePrevious:!1,releaseSelf:!0,repeat:1}}function vH(a,u,s,d){var m,b;const g=a[u]==="/"?"/":"";u+=g.length;const S=s==="{"&&a[u]==="\\";u+=Number(S);const R=S?a[u]:(m=a.slice(u).match(s==="{"?/^\w+|^[^}>/]/:/^\w+/))===null||m===void 0?void 0:m[0];nD(R,a,u,d),u+=R.length;var _;const O=(_=(b=a.slice(u).match(/^>\d+/))===null||b===void 0?void 0:b[0])!==null&&_!==void 0?_:"";u+=O.length;const A=a[u]==="/"||!O&&a[u]===">"?a[u]:"";u+=A.length;const T=mA[s],z=a[u]===T?T:"";if(!z)throw new Error(aD([!O&&"repeat modifier",!A&&"release modifier",`"${T}"`].filter(Boolean).join(" or "),a[u],a,d));return u+=z.length,{consumedLength:u,descriptor:R,releasePrevious:!!g,repeat:O?Math.max(Number(O.substr(1)),1):1,releaseSelf:bH(A,O)}}function nD(a,u,s,d){if(!a)throw new Error(aD("key descriptor",u[s],u,d))}function bH(a,u){if(a)return a==="/";if(u)return!1}function aD(a,u,s,d){return`Expected ${a} but found "${u??""}" in "${s}"
310
310
  See ${d==="pointer"?"https://testing-library.com/docs/user-event/pointer#pressing-a-button-or-touching-the-screen":"https://testing-library.com/docs/user-event/keyboard"}
311
- for more information about how userEvent parses your input.`}function gH(a,u){const s=[];do{const{type:m,descriptor:b,consumedLength:g,releasePrevious:S,releaseSelf:R=!0,repeat:_}=tD(u,"keyboard");var d;const O=(d=a.find(A=>{if(m==="["){var T;return((T=A.code)===null||T===void 0?void 0:T.toLowerCase())===b.toLowerCase()}else if(m==="{"){var z;return((z=A.key)===null||z===void 0?void 0:z.toLowerCase())===b.toLowerCase()}return A.key===b}))!==null&&d!==void 0?d:{key:"Unknown",code:"Unknown",[m==="["?"code":"key"]:b};s.push({keyDef:O,releasePrevious:S,releaseSelf:R,repeat:_}),u=u.slice(g)}while(u);return s}async function EH(a){const u=gH(this.config.keyboardMap,a);for(let s=0;s<u.length;s++)await qp(this.config),await SH(this,u[s])}async function SH(a,{keyDef:u,releasePrevious:s,releaseSelf:d,repeat:m}){const{system:b}=a;if(b.keyboard.isKeyPressed(u)&&await b.keyboard.keyup(a,u),!s){for(let g=1;g<=m;g++)await b.keyboard.keydown(a,u),g<m&&await qp(a.config);d&&await b.keyboard.keyup(a,u)}}async function RH(a){for(const u of a.system.keyboard.getPressedKeys())await a.system.keyboard.keyup(a,u)}function lD(a){const u=pi(a)?{"text/plain":TH(a)}:{"text/plain":String(a.ownerDocument.getSelection())},s=N_(Ur(a));for(const d in u)u[d]&&s.setData(d,u[d]);return s}function TH(a){const u=ag(a);return mi(a).substring(u.startOffset,u.endOffset)}async function _H(){const a=this.config.document;var u;const s=(u=a.activeElement)!==null&&u!==void 0?u:a.body,d=lD(s);if(d.items.length!==0)return this.dispatchUIEvent(s,"copy",{clipboardData:d})&&this.config.writeToClipboard&&await SO(a,d),d}async function AH(){const a=this.config.document;var u;const s=(u=a.activeElement)!==null&&u!==void 0?u:a.body,d=lD(s);if(d.items.length!==0)return this.dispatchUIEvent(s,"cut",{clipboardData:d})&&this.config.writeToClipboard&&await SO(s.ownerDocument,d),d}async function CH(a){const u=this.config.document;var s;const d=(s=u.activeElement)!==null&&s!==void 0?s:u.body;var m;const b=(m=typeof a=="string"?wH(u,a):a)!==null&&m!==void 0?m:await $N(u).catch(()=>{throw new Error("`userEvent.paste()` without `clipboardData` requires the `ClipboardAPI` to be available.")});this.dispatchUIEvent(d,"paste",{clipboardData:b})}function wH(a,u){const s=N_(Ur(a));return s.setData("text",u),s}function rD(a,u){const s=[];do{const{descriptor:d,consumedLength:m,releasePrevious:b,releaseSelf:g=!0}=tD(u,"pointer"),S=a.find(R=>R.name===d);S&&s.push({keyDef:S,releasePrevious:b,releaseSelf:g}),u=u.slice(m)}while(u);return s}async function OH(a){const{pointerMap:u}=this.config,s=[];(Array.isArray(a)?a:[a]).forEach(d=>{typeof d=="string"?s.push(...rD(u,d)):"keys"in d?s.push(...rD(u,d.keys).map(m=>({...d,...m}))):s.push(d)});for(let d=0;d<s.length;d++)await qp(this.config),await MH(this,s[d]);this.system.pointer.resetClickCount()}async function MH(a,u){var s,d;const m="pointerName"in u&&u.pointerName?u.pointerName:"keyDef"in u?a.system.pointer.getPointerName(u.keyDef):"mouse",b=a.system.pointer.getPreviousPosition(m);var g,S,R,_;const O={target:(g=u.target)!==null&&g!==void 0?g:xH(a,b),coords:(S=u.coords)!==null&&S!==void 0?S:b?.coords,caret:{node:(R=u.node)!==null&&R!==void 0?R:uD(u)||b==null||(s=b.caret)===null||s===void 0?void 0:s.node,offset:(_=u.offset)!==null&&_!==void 0?_:uD(u)||b==null||(d=b.caret)===null||d===void 0?void 0:d.offset}};"keyDef"in u?(a.system.pointer.isKeyPressed(u.keyDef)&&(ig(a,ar.Trigger),await a.system.pointer.release(a,u.keyDef,O)),u.releasePrevious||(ig(a,ar.Trigger),await a.system.pointer.press(a,u.keyDef,O),u.releaseSelf&&(ig(a,ar.Trigger),await a.system.pointer.release(a,u.keyDef,O)))):(ig(a,ar.Trigger),await a.system.pointer.move(a,m,O))}function uD(a){var u,s;return!!((s=(u=a.target)!==null&&u!==void 0?u:a.node)!==null&&s!==void 0?s:a.offset!==void 0)}function xH(a,u){if(!u)throw new Error("This pointer has no previous position. Provide a target property!");var s;return(s=u.target)!==null&&s!==void 0?s:a.config.document.body}async function qH(a){if(!Rp(a)||io(a))throw new Error("clear()` is only supported on editable elements.");if(js(a),a.ownerDocument.activeElement!==a)throw new Error("The element to be cleared could not be focused.");if(xq(a),!C8(a))throw new Error("The element content to be cleared could not be selected.");Op(this,a,"","deleteContentBackward")}async function DH(a,u){return iD.call(this,!0,a,u)}async function zH(a,u){return iD.call(this,!1,a,u)}async function iD(a,u,s){if(!a&&!u.multiple)throw Qt().getElementError("Unable to deselect an option in a non-multiple select. Use selectOptions to change the selection instead.",u);const d=Array.isArray(s)?s:[s],m=Array.from(u.querySelectorAll('option, [role="option"]')),b=d.map(S=>{if(typeof S!="string"&&m.includes(S))return S;{const R=m.find(_=>_.value===S||_.innerHTML===S);if(R)return R;throw Qt().getElementError(`Value "${String(S)}" not found in options`,u)}}).filter(S=>!io(S));if(io(u)||!b.length)return;const g=S=>{S.selected=a,this.dispatchUIEvent(u,"input",{bubbles:!0,cancelable:!1,composed:!0}),this.dispatchUIEvent(u,"change")};if(Ot(u,"select"))if(u.multiple)for(const S of b){const R=this.config.pointerEventsCheck===0?!0:a1(this,S);R&&(this.dispatchUIEvent(S,"pointerover"),this.dispatchUIEvent(u,"pointerenter"),this.dispatchUIEvent(S,"mouseover"),this.dispatchUIEvent(u,"mouseenter"),this.dispatchUIEvent(S,"pointermove"),this.dispatchUIEvent(S,"mousemove"),this.dispatchUIEvent(S,"pointerdown"),this.dispatchUIEvent(S,"mousedown")),js(u),R&&(this.dispatchUIEvent(S,"pointerup"),this.dispatchUIEvent(S,"mouseup")),g(S),R&&this.dispatchUIEvent(S,"click"),await qp(this.config)}else if(b.length===1){const S=this.config.pointerEventsCheck===0?!0:a1(this,u);S?await this.click(u):js(u),g(b[0]),S&&(this.dispatchUIEvent(u,"pointerover"),this.dispatchUIEvent(u,"pointerenter"),this.dispatchUIEvent(u,"mouseover"),this.dispatchUIEvent(u,"mouseenter"),this.dispatchUIEvent(u,"pointerup"),this.dispatchUIEvent(u,"mouseup"),this.dispatchUIEvent(u,"click")),await qp(this.config)}else throw Qt().getElementError("Cannot select multiple options on a non-multiple select",u);else if(u.getAttribute("role")==="listbox")for(const S of b)await this.click(S),await this.unhover(S);else throw Qt().getElementError("Cannot select options on elements that are neither select nor listbox elements",u)}async function NH(a,u,{skipClick:s=this.config.skipClick,skipAutoClose:d=this.config.skipAutoClose,initialSelectionStart:m,initialSelectionEnd:b}={}){a.disabled||(s||await this.click(a),m!==void 0&&rg(a,m,b??m),await this.keyboard(u),d||await RH(this))}const oD=Symbol("files and value properties are mocked");function yA(a,u,s){s?Object.defineProperty(a,u,s):delete a[u]}function UH(a,u){var s;(s=a[oD])===null||s===void 0||s.restore();const d=Object.getOwnPropertyDescriptor(a,"type"),m=Object.getOwnPropertyDescriptor(a,"value"),b=Object.getOwnPropertyDescriptor(a,"files");function g(){yA(a,"type",d),yA(a,"value",m),yA(a,"files",b)}a[oD]={restore:g},Object.defineProperties(a,{files:{configurable:!0,get:()=>u},value:{configurable:!0,get:()=>u.length?`C:\\fakepath\\${u[0].name}`:"",set(S){if(S==="")g();else{var R;m==null||(R=m.set)===null||R===void 0||R.call(a,S)}}},type:{configurable:!0,get:()=>"file",set(S){S!=="file"&&(g(),a.type=S)}}})}async function jH(a,u){const s=Ot(a,"label")?a.control:a;if(!s||!Ot(s,"input",{type:"file"}))throw new TypeError(`The ${s===a?"given":"associated"} ${s?.tagName} element does not accept file uploads`);if(io(a))return;const d=(Array.isArray(u)?u:[u]).filter(b=>!this.config.applyAccept||BH(b,s.accept)).slice(0,s.multiple?void 0:1),m=()=>{var b;d.length===((b=s.files)===null||b===void 0?void 0:b.length)&&d.every((g,S)=>{var R;return g===((R=s.files)===null||R===void 0?void 0:R.item(S))})||(UH(s,z_(Ur(a),d)),this.dispatchUIEvent(s,"input"),this.dispatchUIEvent(s,"change"))};s.addEventListener("fileDialog",m),await this.click(a),s.removeEventListener("fileDialog",m)}function l1(a){return a.toLowerCase().replace(/(\.|\/)jpg\b/g,"$1jpeg")}function BH(a,u){if(!u)return!0;const s=["audio/*","image/*","video/*"];return l1(u).trim().split(/\s*,\s*/).some(d=>d.startsWith(".")?l1(a.name).endsWith(d):s.includes(d)?l1(a.type).startsWith(d.replace("*","")):l1(a.type)===d)}const sD={click:cH,dblClick:fH,tripleClick:dH,hover:pH,unhover:hH,tab:mH,keyboard:EH,copy:_H,cut:AH,paste:CH,pointer:OH,clear:qH,deselectOptions:zH,selectOptions:DH,type:NH,upload:jH};function HH(a){return Qt().asyncWrapper(a)}const cD={applyAccept:!0,autoModify:!0,delay:0,document:globalThis.document,keyboardMap:K8,pointerMap:I8,pointerEventsCheck:n1.EachApiCall,skipAutoClose:!1,skipClick:!1,skipHover:!1,writeToClipboard:!1,advanceTimers:()=>Promise.resolve()},LH={...cD,writeToClipboard:!0};function fD(a={},u=LH,s){const d=PH(a,s,u);return{...u,...a,document:d}}function YH(a={}){const u=fD(a);Gq(u.document),Lq(Ur(u.document).HTMLElement);var s;const d=(s=u.document.defaultView)!==null&&s!==void 0?s:globalThis.window;return kN(d),vA(u).api}function Wa({keyboardState:a,pointerState:u,...s}={},d){const m=fD(s,cD,d);Gq(m.document),Lq(Ur(m.document).HTMLElement);var b;const g=(b=u??a)!==null&&b!==void 0?b:new eD;return{api:vA(m,g).api,system:g}}function GH(a){return vA({...this.config,...a},this.system).api}function VH(a,u){function s(...d){return ig(a,ar.Call),HH(()=>u.apply(a,d).then(async m=>(await qp(a.config),m)))}return Object.defineProperty(s,"name",{get:()=>u.name}),s}function vA(a,u=new eD){const s={};return Object.assign(s,{config:a,dispatchEvent:Bq.bind(s),dispatchUIEvent:Y8.bind(s),system:u,levelRefs:{},...sD}),{instance:s,api:{...Object.fromEntries(Object.entries(sD).map(([d,m])=>[d,VH(s,m)])),setup:GH.bind(s)}}}function PH(a,u,s){var d,m;return(m=(d=a.document)!==null&&d!==void 0?d:u&&X8(u))!==null&&m!==void 0?m:s.document}function kH(a){return Wa().api.clear(a)}function XH(a,u={}){return Wa(u,a).api.click(a)}function QH(a={}){return Wa(a).api.copy()}function $H(a={}){return Wa(a).api.cut()}function ZH(a,u={}){return Wa(u).api.dblClick(a)}function JH(a,u,s={}){return Wa(s).api.deselectOptions(a,u)}function KH(a,u={}){return Wa(u).api.hover(a)}async function IH(a,u={}){const{api:s,system:d}=Wa(u);return s.keyboard(a).then(()=>d)}async function FH(a,u={}){const{api:s,system:d}=Wa(u);return s.pointer(a).then(()=>d)}function WH(a,u){return Wa(u).api.paste(a)}function e7(a,u,s={}){return Wa(s).api.selectOptions(a,u)}function t7(a,u={}){return Wa(u).api.tripleClick(a)}function n7(a,u,s={}){return Wa(s,a).api.type(a,u,s)}function a7(a,u={}){const{api:s,system:d}=Wa(u);return d.pointer.setMousePosition({target:a}),s.unhover(a)}function l7(a,u,s={}){return Wa(s).api.upload(a,u)}function r7(a={}){return Wa().api.tab(a)}const u7={...Object.freeze(Object.defineProperty({__proto__:null,clear:kH,click:XH,copy:QH,cut:$H,dblClick:ZH,deselectOptions:JH,hover:KH,keyboard:IH,paste:WH,pointer:FH,selectOptions:e7,tab:r7,tripleClick:t7,type:n7,unhover:a7,upload:l7},Symbol.toStringTag,{value:"Module"})),setup:YH};function i7(a,u,s){switch(u){case"type":return`Event fired: Typed "${s[1]}" into element`;case"selectOptions":return`Event fired: Selected option(s) ${JSON.stringify(s[1])}`;case"click":return"Event fired: Clicked element";case"dblClick":return"Event fired: Double-clicked element";case"tripleClick":return"Event fired: Triple-clicked element";default:return`Event fired: ${a}.${String(u)} executed`}}function dD(a,u="userEvent"){return new Proxy(a,{get(s,d,m){const b=Reflect.get(s,d,m);return typeof b!="function"?b:d==="setup"?(...g)=>{const S=b(...g);return dD(S,`${u}.instance`)}:async(...g)=>{const S=await b(...g);return qu(i7(u,d,g)),S}}})}dD(u7);function o7(a,u,s){const d=String(u);if(/^(get|query|find)(All)?By/.test(d)){const m=s[0];return`query: ${d}("${m}")`}return d==="within"?`helper: within(<${(s[0]?.tagName||"unknown").toLowerCase()}>) called`:d==="prettyDOM"||d==="logDOM"?`debug: ${d} called`:["act","waitFor","waitForElementToBeRemoved"].includes(d)?`async utility: ${d} executed`:`method: ${a}.${d} executed`}const s7=()=>document.querySelector("body > div:not(#twd-sidebar-root)")??document.body,c7=(a,u)=>{const s=s7(),m=yq(s)[a];if(typeof m=="function")return m(...u);const b=gq[a];return typeof b=="function"?b(...u):b};function f7(a,u="screen"){return new Proxy(a,{get(s,d,m){const b=Reflect.get(s,d,m);return typeof b!="function"?b:(...g)=>{const S=c7(d,g);return qu(o7(u,d,g)),S}}})}f7(gq),pB({getElementError(a){return new Error(`${a}`)}}),Ia.truncateThreshold=0;const d7=()=>We.jsxs(dS,{className:"lucide-wifi-pen-icon lucide-wifi-pen",dataTestId:"wifi-pen-icon",children:[We.jsx("path",{d:"M2 8.82a15 15 0 0 1 20 0"}),We.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"}),We.jsx("path",{d:"M5 12.859a10 10 0 0 1 10.5-2.222"}),We.jsx("path",{d:"M8.5 16.429a5 5 0 0 1 3-1.406"})]}),p7=()=>{const a=pw.getRequestMockRules(),u=a.filter(d=>d.executed),s=()=>{console.group("🌐 TWD Mock Rules"),console.log("Total rules:",a.length),console.log("Triggered rules:",u.length),console.log("Rules details:"),console.log(a),console.groupEnd()};return We.jsxs("button",{onClick:s,"aria-label":"View mock rules details in console",style:{background:"#f8fafc",border:"1px solid #cbd5e1",borderRadius:"6px",padding:"8px 12px",cursor:"pointer",fontSize:"12px",color:"#475569",display:"flex",alignItems:"center",gap:"8px",marginBottom:"10px",width:"100%",textAlign:"left",transition:"all 0.2s ease",boxShadow:"0 1px 2px rgba(0, 0, 0, 0.05)"},children:[We.jsx(d7,{}),We.jsxs("span",{style:{flex:1},children:["Rules: ",u.length,"/",a.length," triggered"]}),We.jsx("span",{style:{fontSize:"10px",color:"#1E293B",fontWeight:"500"},children:"View rules in console"})]})},h7={left:{left:0,borderRight:"1px solid #e5e7eb"},right:{right:0,borderLeft:"1px solid #e5e7eb"}},m7='-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"',y7=({open:a,position:u="left"})=>{const[s,d]=cS.useState(0),[m,b]=cS.useState(a);Fz({isOpen:m,position:u});const g=new cw({onStart:A=>{A.status="running",d(T=>T+1)},onPass:A=>{A.status="pass",d(T=>T+1)},onFail:(A,T)=>{A.status="fail",console.error("Test failed:",A.name,T),A.logs.push(`Test failed: ${T.message}`),d(z=>z+1)},onSkip:A=>{A.status="skip",d(T=>T+1)}}),S=async()=>{await g.runAll()},R=async A=>{const T=Array.from(fl.values()).filter(z=>z.type==="test").find(z=>z.id===A);T&&await g.runSingle(T.id)},_=Array.from(fl.values());if(!m)return We.jsx(Iz,{position:u,setOpen:b});const O=_.filter(A=>A.type==="test").length;return We.jsxs("div",{style:{fontFamily:m7,position:"fixed",top:0,bottom:0,width:"280px",background:"#f9fafb",fontSize:"14px",overflowY:"auto",boxShadow:"2px 0 6px rgba(0,0,0,0.1)",textAlign:"left",zIndex:1e3,...h7[u]},"data-testid":"twd-sidebar",children:[We.jsxs("div",{style:{padding:"8px",background:"#f9fafb",position:"sticky",top:0,zIndex:1e3,borderBottom:"1px solid #e5e7eb"},children:[We.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"14px"},children:[We.jsx("button",{onClick:S,style:{background:"#1A6EF4",color:"white",padding:"4px 8px",borderRadius:"4px",border:"none",cursor:"pointer"},children:"Run All"}),We.jsx("button",{"aria-label":"Close sidebar",style:{background:"transparent",border:"none",cursor:"pointer",fontSize:"14px",paddingRight:"0",paddingLeft:"0"},onClick:()=>b(!1),children:"✖"})]}),We.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",fontSize:"14px",color:"#6b7280",marginBottom:"10px"},children:[We.jsxs("span",{style:{color:"#374151"},children:["Total: ",O]}),We.jsxs("div",{style:{display:"flex",gap:"4px"},children:[We.jsxs("span",{style:{color:"#00c951"},children:["✓ ",_.filter(A=>A.status==="pass").length]}),We.jsxs("span",{style:{color:"#fb2c36"},children:["✗ ",_.filter(A=>A.status==="fail").length]})]})]}),We.jsx(p7,{})]}),We.jsx("div",{style:{padding:"8px"},children:We.jsx(Jz,{tests:_.map(A=>({name:A.name,depth:A.depth,status:A.status,logs:A.logs,id:A.id,parent:A.parent,type:A.type,only:A.only,skip:A.skip})),runTest:R})})]})},v7=(a,u)=>{const{open:s=!0,position:d="left"}=u||{};Lz(a,We.jsx(y7,{open:s,position:d}),Bz.createRoot),pw.initRequestMocking().then(()=>{console.log("Request mocking initialized")}).catch(m=>{console.error("Error initializing request mocking:",m)})};yp.initTWD=v7,Object.defineProperty(yp,Symbol.toStringTag,{value:"Module"})}));
311
+ for more information about how userEvent parses your input.`}function gH(a,u){const s=[];do{const{type:m,descriptor:b,consumedLength:g,releasePrevious:S,releaseSelf:R=!0,repeat:_}=tD(u,"keyboard");var d;const O=(d=a.find(A=>{if(m==="["){var T;return((T=A.code)===null||T===void 0?void 0:T.toLowerCase())===b.toLowerCase()}else if(m==="{"){var z;return((z=A.key)===null||z===void 0?void 0:z.toLowerCase())===b.toLowerCase()}return A.key===b}))!==null&&d!==void 0?d:{key:"Unknown",code:"Unknown",[m==="["?"code":"key"]:b};s.push({keyDef:O,releasePrevious:S,releaseSelf:R,repeat:_}),u=u.slice(g)}while(u);return s}async function EH(a){const u=gH(this.config.keyboardMap,a);for(let s=0;s<u.length;s++)await qp(this.config),await SH(this,u[s])}async function SH(a,{keyDef:u,releasePrevious:s,releaseSelf:d,repeat:m}){const{system:b}=a;if(b.keyboard.isKeyPressed(u)&&await b.keyboard.keyup(a,u),!s){for(let g=1;g<=m;g++)await b.keyboard.keydown(a,u),g<m&&await qp(a.config);d&&await b.keyboard.keyup(a,u)}}async function RH(a){for(const u of a.system.keyboard.getPressedKeys())await a.system.keyboard.keyup(a,u)}function lD(a){const u=pi(a)?{"text/plain":TH(a)}:{"text/plain":String(a.ownerDocument.getSelection())},s=N_(Ur(a));for(const d in u)u[d]&&s.setData(d,u[d]);return s}function TH(a){const u=ag(a);return mi(a).substring(u.startOffset,u.endOffset)}async function _H(){const a=this.config.document;var u;const s=(u=a.activeElement)!==null&&u!==void 0?u:a.body,d=lD(s);if(d.items.length!==0)return this.dispatchUIEvent(s,"copy",{clipboardData:d})&&this.config.writeToClipboard&&await SO(a,d),d}async function AH(){const a=this.config.document;var u;const s=(u=a.activeElement)!==null&&u!==void 0?u:a.body,d=lD(s);if(d.items.length!==0)return this.dispatchUIEvent(s,"cut",{clipboardData:d})&&this.config.writeToClipboard&&await SO(s.ownerDocument,d),d}async function CH(a){const u=this.config.document;var s;const d=(s=u.activeElement)!==null&&s!==void 0?s:u.body;var m;const b=(m=typeof a=="string"?wH(u,a):a)!==null&&m!==void 0?m:await $N(u).catch(()=>{throw new Error("`userEvent.paste()` without `clipboardData` requires the `ClipboardAPI` to be available.")});this.dispatchUIEvent(d,"paste",{clipboardData:b})}function wH(a,u){const s=N_(Ur(a));return s.setData("text",u),s}function rD(a,u){const s=[];do{const{descriptor:d,consumedLength:m,releasePrevious:b,releaseSelf:g=!0}=tD(u,"pointer"),S=a.find(R=>R.name===d);S&&s.push({keyDef:S,releasePrevious:b,releaseSelf:g}),u=u.slice(m)}while(u);return s}async function OH(a){const{pointerMap:u}=this.config,s=[];(Array.isArray(a)?a:[a]).forEach(d=>{typeof d=="string"?s.push(...rD(u,d)):"keys"in d?s.push(...rD(u,d.keys).map(m=>({...d,...m}))):s.push(d)});for(let d=0;d<s.length;d++)await qp(this.config),await MH(this,s[d]);this.system.pointer.resetClickCount()}async function MH(a,u){var s,d;const m="pointerName"in u&&u.pointerName?u.pointerName:"keyDef"in u?a.system.pointer.getPointerName(u.keyDef):"mouse",b=a.system.pointer.getPreviousPosition(m);var g,S,R,_;const O={target:(g=u.target)!==null&&g!==void 0?g:xH(a,b),coords:(S=u.coords)!==null&&S!==void 0?S:b?.coords,caret:{node:(R=u.node)!==null&&R!==void 0?R:uD(u)||b==null||(s=b.caret)===null||s===void 0?void 0:s.node,offset:(_=u.offset)!==null&&_!==void 0?_:uD(u)||b==null||(d=b.caret)===null||d===void 0?void 0:d.offset}};"keyDef"in u?(a.system.pointer.isKeyPressed(u.keyDef)&&(ig(a,ar.Trigger),await a.system.pointer.release(a,u.keyDef,O)),u.releasePrevious||(ig(a,ar.Trigger),await a.system.pointer.press(a,u.keyDef,O),u.releaseSelf&&(ig(a,ar.Trigger),await a.system.pointer.release(a,u.keyDef,O)))):(ig(a,ar.Trigger),await a.system.pointer.move(a,m,O))}function uD(a){var u,s;return!!((s=(u=a.target)!==null&&u!==void 0?u:a.node)!==null&&s!==void 0?s:a.offset!==void 0)}function xH(a,u){if(!u)throw new Error("This pointer has no previous position. Provide a target property!");var s;return(s=u.target)!==null&&s!==void 0?s:a.config.document.body}async function qH(a){if(!Rp(a)||io(a))throw new Error("clear()` is only supported on editable elements.");if(js(a),a.ownerDocument.activeElement!==a)throw new Error("The element to be cleared could not be focused.");if(xq(a),!C8(a))throw new Error("The element content to be cleared could not be selected.");Op(this,a,"","deleteContentBackward")}async function DH(a,u){return iD.call(this,!0,a,u)}async function zH(a,u){return iD.call(this,!1,a,u)}async function iD(a,u,s){if(!a&&!u.multiple)throw Qt().getElementError("Unable to deselect an option in a non-multiple select. Use selectOptions to change the selection instead.",u);const d=Array.isArray(s)?s:[s],m=Array.from(u.querySelectorAll('option, [role="option"]')),b=d.map(S=>{if(typeof S!="string"&&m.includes(S))return S;{const R=m.find(_=>_.value===S||_.innerHTML===S);if(R)return R;throw Qt().getElementError(`Value "${String(S)}" not found in options`,u)}}).filter(S=>!io(S));if(io(u)||!b.length)return;const g=S=>{S.selected=a,this.dispatchUIEvent(u,"input",{bubbles:!0,cancelable:!1,composed:!0}),this.dispatchUIEvent(u,"change")};if(Ot(u,"select"))if(u.multiple)for(const S of b){const R=this.config.pointerEventsCheck===0?!0:a1(this,S);R&&(this.dispatchUIEvent(S,"pointerover"),this.dispatchUIEvent(u,"pointerenter"),this.dispatchUIEvent(S,"mouseover"),this.dispatchUIEvent(u,"mouseenter"),this.dispatchUIEvent(S,"pointermove"),this.dispatchUIEvent(S,"mousemove"),this.dispatchUIEvent(S,"pointerdown"),this.dispatchUIEvent(S,"mousedown")),js(u),R&&(this.dispatchUIEvent(S,"pointerup"),this.dispatchUIEvent(S,"mouseup")),g(S),R&&this.dispatchUIEvent(S,"click"),await qp(this.config)}else if(b.length===1){const S=this.config.pointerEventsCheck===0?!0:a1(this,u);S?await this.click(u):js(u),g(b[0]),S&&(this.dispatchUIEvent(u,"pointerover"),this.dispatchUIEvent(u,"pointerenter"),this.dispatchUIEvent(u,"mouseover"),this.dispatchUIEvent(u,"mouseenter"),this.dispatchUIEvent(u,"pointerup"),this.dispatchUIEvent(u,"mouseup"),this.dispatchUIEvent(u,"click")),await qp(this.config)}else throw Qt().getElementError("Cannot select multiple options on a non-multiple select",u);else if(u.getAttribute("role")==="listbox")for(const S of b)await this.click(S),await this.unhover(S);else throw Qt().getElementError("Cannot select options on elements that are neither select nor listbox elements",u)}async function NH(a,u,{skipClick:s=this.config.skipClick,skipAutoClose:d=this.config.skipAutoClose,initialSelectionStart:m,initialSelectionEnd:b}={}){a.disabled||(s||await this.click(a),m!==void 0&&rg(a,m,b??m),await this.keyboard(u),d||await RH(this))}const oD=Symbol("files and value properties are mocked");function yA(a,u,s){s?Object.defineProperty(a,u,s):delete a[u]}function UH(a,u){var s;(s=a[oD])===null||s===void 0||s.restore();const d=Object.getOwnPropertyDescriptor(a,"type"),m=Object.getOwnPropertyDescriptor(a,"value"),b=Object.getOwnPropertyDescriptor(a,"files");function g(){yA(a,"type",d),yA(a,"value",m),yA(a,"files",b)}a[oD]={restore:g},Object.defineProperties(a,{files:{configurable:!0,get:()=>u},value:{configurable:!0,get:()=>u.length?`C:\\fakepath\\${u[0].name}`:"",set(S){if(S==="")g();else{var R;m==null||(R=m.set)===null||R===void 0||R.call(a,S)}}},type:{configurable:!0,get:()=>"file",set(S){S!=="file"&&(g(),a.type=S)}}})}async function jH(a,u){const s=Ot(a,"label")?a.control:a;if(!s||!Ot(s,"input",{type:"file"}))throw new TypeError(`The ${s===a?"given":"associated"} ${s?.tagName} element does not accept file uploads`);if(io(a))return;const d=(Array.isArray(u)?u:[u]).filter(b=>!this.config.applyAccept||BH(b,s.accept)).slice(0,s.multiple?void 0:1),m=()=>{var b;d.length===((b=s.files)===null||b===void 0?void 0:b.length)&&d.every((g,S)=>{var R;return g===((R=s.files)===null||R===void 0?void 0:R.item(S))})||(UH(s,z_(Ur(a),d)),this.dispatchUIEvent(s,"input"),this.dispatchUIEvent(s,"change"))};s.addEventListener("fileDialog",m),await this.click(a),s.removeEventListener("fileDialog",m)}function l1(a){return a.toLowerCase().replace(/(\.|\/)jpg\b/g,"$1jpeg")}function BH(a,u){if(!u)return!0;const s=["audio/*","image/*","video/*"];return l1(u).trim().split(/\s*,\s*/).some(d=>d.startsWith(".")?l1(a.name).endsWith(d):s.includes(d)?l1(a.type).startsWith(d.replace("*","")):l1(a.type)===d)}const sD={click:cH,dblClick:fH,tripleClick:dH,hover:pH,unhover:hH,tab:mH,keyboard:EH,copy:_H,cut:AH,paste:CH,pointer:OH,clear:qH,deselectOptions:zH,selectOptions:DH,type:NH,upload:jH};function HH(a){return Qt().asyncWrapper(a)}const cD={applyAccept:!0,autoModify:!0,delay:0,document:globalThis.document,keyboardMap:K8,pointerMap:I8,pointerEventsCheck:n1.EachApiCall,skipAutoClose:!1,skipClick:!1,skipHover:!1,writeToClipboard:!1,advanceTimers:()=>Promise.resolve()},LH={...cD,writeToClipboard:!0};function fD(a={},u=LH,s){const d=PH(a,s,u);return{...u,...a,document:d}}function YH(a={}){const u=fD(a);Gq(u.document),Lq(Ur(u.document).HTMLElement);var s;const d=(s=u.document.defaultView)!==null&&s!==void 0?s:globalThis.window;return kN(d),vA(u).api}function Wa({keyboardState:a,pointerState:u,...s}={},d){const m=fD(s,cD,d);Gq(m.document),Lq(Ur(m.document).HTMLElement);var b;const g=(b=u??a)!==null&&b!==void 0?b:new eD;return{api:vA(m,g).api,system:g}}function GH(a){return vA({...this.config,...a},this.system).api}function VH(a,u){function s(...d){return ig(a,ar.Call),HH(()=>u.apply(a,d).then(async m=>(await qp(a.config),m)))}return Object.defineProperty(s,"name",{get:()=>u.name}),s}function vA(a,u=new eD){const s={};return Object.assign(s,{config:a,dispatchEvent:Bq.bind(s),dispatchUIEvent:Y8.bind(s),system:u,levelRefs:{},...sD}),{instance:s,api:{...Object.fromEntries(Object.entries(sD).map(([d,m])=>[d,VH(s,m)])),setup:GH.bind(s)}}}function PH(a,u,s){var d,m;return(m=(d=a.document)!==null&&d!==void 0?d:u&&X8(u))!==null&&m!==void 0?m:s.document}function kH(a){return Wa().api.clear(a)}function XH(a,u={}){return Wa(u,a).api.click(a)}function QH(a={}){return Wa(a).api.copy()}function $H(a={}){return Wa(a).api.cut()}function ZH(a,u={}){return Wa(u).api.dblClick(a)}function JH(a,u,s={}){return Wa(s).api.deselectOptions(a,u)}function KH(a,u={}){return Wa(u).api.hover(a)}async function IH(a,u={}){const{api:s,system:d}=Wa(u);return s.keyboard(a).then(()=>d)}async function FH(a,u={}){const{api:s,system:d}=Wa(u);return s.pointer(a).then(()=>d)}function WH(a,u){return Wa(u).api.paste(a)}function e7(a,u,s={}){return Wa(s).api.selectOptions(a,u)}function t7(a,u={}){return Wa(u).api.tripleClick(a)}function n7(a,u,s={}){return Wa(s,a).api.type(a,u,s)}function a7(a,u={}){const{api:s,system:d}=Wa(u);return d.pointer.setMousePosition({target:a}),s.unhover(a)}function l7(a,u,s={}){return Wa(s).api.upload(a,u)}function r7(a={}){return Wa().api.tab(a)}const u7={...Object.freeze(Object.defineProperty({__proto__:null,clear:kH,click:XH,copy:QH,cut:$H,dblClick:ZH,deselectOptions:JH,hover:KH,keyboard:IH,paste:WH,pointer:FH,selectOptions:e7,tab:r7,tripleClick:t7,type:n7,unhover:a7,upload:l7},Symbol.toStringTag,{value:"Module"})),setup:YH};function i7(a,u,s){switch(u){case"type":return`Event fired: Typed "${s[1]}" into element`;case"selectOptions":return`Event fired: Selected option(s) ${JSON.stringify(s[1])}`;case"click":return"Event fired: Clicked element";case"dblClick":return"Event fired: Double-clicked element";case"tripleClick":return"Event fired: Triple-clicked element";default:return`Event fired: ${a}.${String(u)} executed`}}function dD(a,u="userEvent"){return new Proxy(a,{get(s,d,m){const b=Reflect.get(s,d,m);return typeof b!="function"?b:d==="setup"?(...g)=>{const S=b(...g);return dD(S,`${u}.instance`)}:async(...g)=>{const S=await b(...g);return qu(i7(u,d,g)),S}}})}dD(u7);function o7(a,u,s){const d=String(u);if(/^(get|query|find)(All)?By/.test(d)){const m=s[0];return`query: ${d}("${m}")`}return d==="within"?`helper: within(<${(s[0]?.tagName||"unknown").toLowerCase()}>) called`:d==="prettyDOM"||d==="logDOM"?`debug: ${d} called`:["act","waitFor","waitForElementToBeRemoved"].includes(d)?`async utility: ${d} executed`:`method: ${a}.${d} executed`}const s7=()=>document.querySelector("body > :not(#twd-sidebar-root):not(script):not(style)")??document.body,c7=(a,u)=>{const s=s7(),m=yq(s)[a];if(typeof m=="function")return m(...u);const b=gq[a];return typeof b=="function"?b(...u):b};function f7(a,u="screen"){return new Proxy(a,{get(s,d,m){const b=Reflect.get(s,d,m);return typeof b!="function"?b:(...g)=>{const S=c7(d,g);return qu(o7(u,d,g)),S}}})}f7(gq),pB({getElementError(a){return new Error(`${a}`)}}),Ia.truncateThreshold=0;const d7=()=>We.jsxs(dS,{className:"lucide-wifi-pen-icon lucide-wifi-pen",dataTestId:"wifi-pen-icon",children:[We.jsx("path",{d:"M2 8.82a15 15 0 0 1 20 0"}),We.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"}),We.jsx("path",{d:"M5 12.859a10 10 0 0 1 10.5-2.222"}),We.jsx("path",{d:"M8.5 16.429a5 5 0 0 1 3-1.406"})]}),p7=()=>{const a=pw.getRequestMockRules(),u=a.filter(d=>d.executed),s=()=>{console.group("🌐 TWD Mock Rules"),console.log("Total rules:",a.length),console.log("Triggered rules:",u.length),console.log("Rules details:"),console.log(a),console.groupEnd()};return We.jsxs("button",{onClick:s,"aria-label":"View mock rules details in console",style:{background:"#f8fafc",border:"1px solid #cbd5e1",borderRadius:"6px",padding:"8px 12px",cursor:"pointer",fontSize:"12px",color:"#475569",display:"flex",alignItems:"center",gap:"8px",marginBottom:"10px",width:"100%",textAlign:"left",transition:"all 0.2s ease",boxShadow:"0 1px 2px rgba(0, 0, 0, 0.05)"},children:[We.jsx(d7,{}),We.jsxs("span",{style:{flex:1},children:["Rules: ",u.length,"/",a.length," triggered"]}),We.jsx("span",{style:{fontSize:"10px",color:"#1E293B",fontWeight:"500"},children:"View rules in console"})]})},h7={left:{left:0,borderRight:"1px solid #e5e7eb"},right:{right:0,borderLeft:"1px solid #e5e7eb"}},m7='-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"',y7=({open:a,position:u="left"})=>{const[s,d]=cS.useState(0),[m,b]=cS.useState(a);Fz({isOpen:m,position:u});const g=new cw({onStart:A=>{A.status="running",d(T=>T+1)},onPass:A=>{A.status="pass",d(T=>T+1)},onFail:(A,T)=>{A.status="fail",console.error("Test failed:",A.name,T),A.logs.push(`Test failed: ${T.message}`),d(z=>z+1)},onSkip:A=>{A.status="skip",d(T=>T+1)}}),S=async()=>{await g.runAll()},R=async A=>{const T=Array.from(fl.values()).filter(z=>z.type==="test").find(z=>z.id===A);T&&await g.runSingle(T.id)},_=Array.from(fl.values());if(!m)return We.jsx(Iz,{position:u,setOpen:b});const O=_.filter(A=>A.type==="test").length;return We.jsxs("div",{style:{fontFamily:m7,position:"fixed",top:0,bottom:0,width:"280px",background:"#f9fafb",fontSize:"14px",overflowY:"auto",boxShadow:"2px 0 6px rgba(0,0,0,0.1)",textAlign:"left",zIndex:1e3,...h7[u]},"data-testid":"twd-sidebar",children:[We.jsxs("div",{style:{padding:"8px",background:"#f9fafb",position:"sticky",top:0,zIndex:1e3,borderBottom:"1px solid #e5e7eb"},children:[We.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"14px"},children:[We.jsx("button",{onClick:S,style:{background:"#1A6EF4",color:"white",padding:"4px 8px",borderRadius:"4px",border:"none",cursor:"pointer"},children:"Run All"}),We.jsx("button",{"aria-label":"Close sidebar",style:{background:"transparent",border:"none",cursor:"pointer",fontSize:"14px",paddingRight:"0",paddingLeft:"0"},onClick:()=>b(!1),children:"✖"})]}),We.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",fontSize:"14px",color:"#6b7280",marginBottom:"10px"},children:[We.jsxs("span",{style:{color:"#374151"},children:["Total: ",O]}),We.jsxs("div",{style:{display:"flex",gap:"4px"},children:[We.jsxs("span",{style:{color:"#00c951"},children:["✓ ",_.filter(A=>A.status==="pass").length]}),We.jsxs("span",{style:{color:"#fb2c36"},children:["✗ ",_.filter(A=>A.status==="fail").length]})]})]}),We.jsx(p7,{})]}),We.jsx("div",{style:{padding:"8px"},children:We.jsx(Jz,{tests:_.map(A=>({name:A.name,depth:A.depth,status:A.status,logs:A.logs,id:A.id,parent:A.parent,type:A.type,only:A.only,skip:A.skip})),runTest:R})})]})},v7=(a,u)=>{const{open:s=!0,position:d="left"}=u||{};Lz(a,We.jsx(y7,{open:s,position:d}),Bz.createRoot),pw.initRequestMocking().then(()=>{console.log("Request mocking initialized")}).catch(m=>{console.error("Error initializing request mocking:",m)})};yp.initTWD=v7,Object.defineProperty(yp,Symbol.toStringTag,{value:"Module"})}));
package/dist/index.cjs.js CHANGED
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const xo=require("./runner.cjs.js"),B=require("./jsx-runtime-CjngqUuo.js"),oi=require("react"),lm=(e,t,r=2e3,n=50)=>new Promise((o,i)=>{const a=Date.now(),s=()=>{const l=t();if(l)return o(l);if(Date.now()-a>r)return i(new Error(`Timeout waiting for element ${e}`));setTimeout(s,n)};s()}),um=(e,t,r=2e3,n=50)=>new Promise((o,i)=>{const a=Date.now(),s=()=>{const l=t();if(l&&l.length>0)return o(Array.from(l));if(Date.now()-a>r)return i(new Error(`Timeout waiting for elements ${e}`));setTimeout(s,n)};s()}),ii=e=>new Promise(t=>setTimeout(t,e)),Yi=(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 cm(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}const dm={"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"}},"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]}"`}}},ji=(e,t,...r)=>{const n=t.startsWith("not."),o=n?t.slice(4):t,i=(e.textContent||"").trim(),a=dm[o];if(!a)throw new Error(`Unknown assertion: ${o}`);const s=n?"negative":"positive";let l,u;switch(o){case"have.text":l=i===r[0],u=i;break;case"contain.text":l=i.includes(r[0]),u=i;break;case"be.empty":l=i.length===0,u=i;break;case"have.attr":u=e.getAttribute(r[0]),l=u===r[1];break;case"have.value":u=e.value,l=u===r[0];break;case"be.disabled":l=e.disabled===!0;break;case"be.enabled":l=e.disabled===!1;break;case"be.checked":l=e.checked===!0;break;case"be.selected":l=e.selected===!0;break;case"be.focused":l=document.activeElement===e;break;case"be.visible":l=cm(e);break;case"have.class":l=e.classList.contains(r[0]);break;default:throw new Error(`Unknown assertion: ${o}`)}return Yi(l,n,a[s].pass(r),a[s].fail(r,u))},Re=e=>{const t=xo.handlers.size?Array.from(xo.handlers.values()).find(r=>r.status==="running"):null;t&&t.logs?.push(e)},xa="1.3.0-beta.1",fm=()=>typeof window<"u"?(window.__TWD_MOCK_STATE__||(window.__TWD_MOCK_STATE__={rules:[]}),window.__TWD_MOCK_STATE__):{rules:[]},pm=fm(),Xe=pm.rules,mm=100,hm=async e=>{if("serviceWorker"in navigator){const t=e??"/mock-sw.js";await navigator.serviceWorker.register(`${t}?v=${xa}`),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:o}=r.data,i=Xe.find(a=>a.alias===n);i&&(i.executed=!0,i.request=o)}})}},bm=async(e,t)=>{const r={alias:e,...t,executed:!1},n=Xe.findIndex(o=>o.alias===e);n!==-1?Xe[n]=r:Xe.push(r),navigator.serviceWorker.controller?.postMessage({type:"ADD_RULE",rule:r,version:xa}),await ii(mm),await Promise.resolve()},vm=async e=>await Promise.all(e.map(r=>bd(r))),bd=async(e,t=10,r=100)=>{if(!Xe.find(o=>o.alias===e))throw new Error(`Rule ${e} not found`);for(let o=0;o<t;o++){const i=Xe.find(a=>a.alias===e&&a.executed);if(i)return Promise.resolve(i);o<t-1&&await new Promise(a=>setTimeout(a,r))}throw console.log(`Rule ${e} was not executed within ${t*r}ms`),new Error(`Rule ${e} was not executed within ${t*r}ms`)},ym=()=>Xe,gm=()=>{navigator.serviceWorker.controller?.postMessage({type:"CLEAR_RULES",version:xa}),Xe.length=0},Rm=(e,t)=>{const r=e.startsWith("not.");switch(r?e.slice(4):e){case"eq":return Yi(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 Yi(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}`)}},wm=()=>({location:window.location,should:async(e,t,r=5)=>{let n="",o;for(let i=0;i<r;i++)try{n=Rm(e,t),Re(n);break}catch(a){await new Promise(s=>setTimeout(s,100)),o=a}if(o)throw o;return n}}),Em=100,xm=async(e,t)=>{if(Re(`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 ii(10)}window.history.pushState({},"",e),window.dispatchEvent(new PopStateEvent("popstate")),await ii(Em)},vd={get:async e=>{const t=`body > div:not(#twd-sidebar-root) ${e}`;Re(`Searching get("${e}")`);const r=await lm(e,()=>document.querySelector(t)),n={el:r,should:(o,...i)=>{const a=ji(r,o,...i);return Re(a),n}};return n},setInputValue:(e,t)=>{const{set:r}=Object.getOwnPropertyDescriptor(e.__proto__,"value");r.call(e,t),e.dispatchEvent(new Event("input",{bubbles:!0}))},getAll:async e=>{const t=`body > div:not(#twd-sidebar-root) ${e}`;return Re(`Searching getAll("${e}")`),(await um(e,()=>document.querySelectorAll(t))).map(n=>{const o={el:n,should:(i,...a)=>{const s=ji(n,i,...a);return Re(s),o}};return o})},visit:xm,url:wm,mockRequest:bm,waitForRequest:bd,waitForRequests:vm,initRequestMocking:hm,clearRequestMockRules:gm,getRequestMockRules:ym,should:(e,t,...r)=>{const n=ji(e,t,...r);Re(n)},wait:ii,mockComponent:B.mockComponent,clearComponentMocks:B.clearComponentMocks,notExists:async e=>{const t=`body > div:not(#twd-sidebar-root) ${e}`;if(Re(`Checking notExists("${e}")`),document.querySelector(t))throw new Error(`Element "${e}" exists in the DOM.`);Re(`Assertion passed: Element "${e}" does not exist in the DOM.`)}};var Ca=Object.defineProperty,Cm=(e,t,r)=>t in e?Ca(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,x=(e,t)=>Ca(e,"name",{value:t,configurable:!0}),qa=(e,t)=>{for(var r in t)Ca(e,r,{get:t[r],enumerable:!0})},yd=(e,t,r)=>Cm(e,typeof t!="symbol"?t+"":t,r),ai={};qa(ai,{addChainableMethod:()=>$a,addLengthGuard:()=>jo,addMethod:()=>ka,addProperty:()=>Na,checkError:()=>fe,compareByInspect:()=>ui,eql:()=>Gd,events:()=>Ci,expectTypes:()=>Pd,flag:()=>U,getActual:()=>Ei,getMessage:()=>Ta,getName:()=>qi,getOperator:()=>Ua,getOwnEnumerableProperties:()=>Fa,getOwnEnumerablePropertySymbols:()=>La,getPathInfo:()=>Oa,hasProperty:()=>xi,inspect:()=>H,isNaN:()=>ci,isNumeric:()=>ne,isProxyEnabled:()=>ko,isRegExp:()=>di,objDisplay:()=>st,overwriteChainableMethod:()=>Ba,overwriteMethod:()=>Da,overwriteProperty:()=>ja,proxify:()=>_t,test:()=>_a,transferFlags:()=>Ee,type:()=>Q});var fe={};qa(fe,{compatibleConstructor:()=>wd,compatibleInstance:()=>Rd,compatibleMessage:()=>Ed,getConstructorName:()=>xd,getMessage:()=>Cd});function wi(e){return e instanceof Error||Object.prototype.toString.call(e)==="[object Error]"}x(wi,"isErrorInstance");function gd(e){return Object.prototype.toString.call(e)==="[object RegExp]"}x(gd,"isRegExp");function Rd(e,t){return wi(t)&&e===t}x(Rd,"compatibleInstance");function wd(e,t){return wi(t)?e.constructor===t.constructor||e instanceof t.constructor:(typeof t=="object"||typeof t=="function")&&t.prototype?e.constructor===t||e instanceof t:!1}x(wd,"compatibleConstructor");function Ed(e,t){const r=typeof e=="string"?e:e.message;return gd(t)?t.test(r):typeof t=="string"?r.indexOf(t)!==-1:!1}x(Ed,"compatibleMessage");function xd(e){let t=e;return wi(e)?t=e.constructor.name:typeof e=="function"&&(t=e.name,t===""&&(t=new e().name||t)),t}x(xd,"getConstructorName");function Cd(e){let t="";return e&&e.message?t=e.message:typeof e=="string"&&(t=e),t}x(Cd,"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]}x(U,"flag");function _a(e,t){let r=U(e,"negate"),n=t[0];return r?!n:n}x(_a,"test");function Q(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)}x(Q,"type");var qm="captureStackTrace"in Error,qd=class _d extends Error{constructor(t="Unspecified AssertionError",r,n){super(t),yd(this,"message"),this.message=t,qm&&Error.captureStackTrace(this,n||_d);for(const o in r)o in this||(this[o]=r[o])}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}}};x(qd,"AssertionError");var G=qd;function Pd(e,t){let r=U(e,"message"),n=U(e,"ssfi");r=r?r+": ":"",e=U(e,"object"),t=t.map(function(a){return a.toLowerCase()}),t.sort();let o=t.map(function(a,s){let l=~["a","e","i","o","u"].indexOf(a.charAt(0))?"an":"a";return(t.length>1&&s===t.length-1?"or ":"")+l+" "+a}).join(", "),i=Q(e).toLowerCase();if(!t.some(function(a){return i===a}))throw new G(r+"object tested must be "+o+", but "+i+" given",void 0,n)}x(Pd,"expectTypes");function Ei(e,t){return t.length>4?t[4]:e._obj}x(Ei,"getActual");var qs={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"]},_m={special:"cyan",number:"yellow",bigint:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",symbol:"green",date:"magenta",regexp:"red"},yt="…";function Td(e,t){const r=qs[_m[t]]||qs[t]||"";return r?`\x1B[${r[0]}m${String(e)}\x1B[${r[1]}m`:String(e)}x(Td,"colorise");function Sd({showHidden:e=!1,depth:t=2,colors:r=!1,customInspect:n=!0,showProxy:o=!1,maxArrayLength:i=1/0,breakLength:a=1/0,seen:s=[],truncate:l=1/0,stylize:u=String}={},f){const c={showHidden:!!e,depth:Number(t),colors:!!r,customInspect:!!n,showProxy:!!o,maxArrayLength:Number(i),breakLength:Number(a),truncate:Number(l),seen:s,inspect:f,stylize:u};return c.colors&&(c.stylize=Td),c}x(Sd,"normaliseOptions");function Ad(e){return e>="\uD800"&&e<="\uDBFF"}x(Ad,"isHighSurrogate");function Fe(e,t,r=yt){e=String(e);const n=r.length,o=e.length;if(n>t&&o>n)return r;if(o>t&&o>n){let i=t-n;return i>0&&Ad(e[i-1])&&(i=i-1),`${e.slice(0,i)}${r}`}return e}x(Fe,"truncate");function he(e,t,r,n=", "){r=r||t.inspect;const o=e.length;if(o===0)return"";const i=t.truncate;let a="",s="",l="";for(let u=0;u<o;u+=1){const f=u+1===e.length,c=u+2===e.length;l=`${yt}(${e.length-u})`;const d=e[u];t.truncate=i-a.length-(f?0:n.length);const b=s||r(d,t)+(f?"":n),v=a.length+b.length,R=v+l.length;if(f&&v>i&&a.length+l.length<=i||!f&&!c&&R>i||(s=f?"":r(e[u+1],t)+(c?"":n),!f&&c&&R>i&&v+s.length>i))break;if(a+=b,!f&&!c&&v+s.length>=i){l=`${yt}(${e.length-u-1})`;break}l=""}return`${a}${l}`}x(he,"inspectList");function Md(e){return e.match(/^[a-zA-Z_][a-zA-Z_0-9]*$/)?e:JSON.stringify(e).replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'")}x(Md,"quoteComplexKey");function gt([e,t],r){return r.truncate-=2,typeof e=="string"?e=Md(e):typeof e!="number"&&(e=`[${r.inspect(e,r)}]`),r.truncate-=e.length,t=r.inspect(t,r),`${e}: ${t}`}x(gt,"inspectProperty");function Od(e,t){const r=Object.keys(e).slice(e.length);if(!e.length&&!r.length)return"[]";t.truncate-=4;const n=he(e,t);t.truncate-=n.length;let o="";return r.length&&(o=he(r.map(i=>[i,e[i]]),t,gt)),`[ ${n}${o?`, ${o}`:""} ]`}x(Od,"inspectArray");var Pm=x(e=>typeof Buffer=="function"&&e instanceof Buffer?"Buffer":e[Symbol.toStringTag]?e[Symbol.toStringTag]:e.constructor.name,"getArrayName");function qe(e,t){const r=Pm(e);t.truncate-=r.length+4;const n=Object.keys(e).slice(e.length);if(!e.length&&!n.length)return`${r}[]`;let o="";for(let a=0;a<e.length;a++){const s=`${t.stylize(Fe(e[a],t.truncate),"number")}${a===e.length-1?"":", "}`;if(t.truncate-=s.length,e[a]!==e.length&&t.truncate<=3){o+=`${yt}(${e.length-e[a]+1})`;break}o+=s}let i="";return n.length&&(i=he(n.map(a=>[a,e[a]]),t,gt)),`${r}[ ${o}${i?`, ${i}`:""} ]`}x(qe,"inspectTypedArray");function Id(e,t){const r=e.toJSON();if(r===null)return"Invalid Date";const n=r.split("T"),o=n[0];return t.stylize(`${o}T${Fe(n[1],t.truncate-o.length-1)}`,"date")}x(Id,"inspectDate");function Xi(e,t){const r=e[Symbol.toStringTag]||"Function",n=e.name;return n?t.stylize(`[${r} ${Fe(n,t.truncate-11)}]`,"special"):t.stylize(`[${r}]`,"special")}x(Xi,"inspectFunction");function Nd([e,t],r){return r.truncate-=4,e=r.inspect(e,r),r.truncate-=e.length,t=r.inspect(t,r),`${e} => ${t}`}x(Nd,"inspectMapEntry");function kd(e){const t=[];return e.forEach((r,n)=>{t.push([n,r])}),t}x(kd,"mapToEntries");function jd(e,t){return e.size===0?"Map{}":(t.truncate-=7,`Map{ ${he(kd(e),t,Nd)} }`)}x(jd,"inspectMap");var Tm=Number.isNaN||(e=>e!==e);function Ji(e,t){return Tm(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(Fe(String(e),t.truncate),"number")}x(Ji,"inspectNumber");function Qi(e,t){let r=Fe(e.toString(),t.truncate-1);return r!==yt&&(r+="n"),t.stylize(r,"bigint")}x(Qi,"inspectBigInt");function Dd(e,t){const r=e.toString().split("/")[2],n=t.truncate-(2+r.length),o=e.source;return t.stylize(`/${Fe(o,n)}/${r}`,"regexp")}x(Dd,"inspectRegExp");function $d(e){const t=[];return e.forEach(r=>{t.push(r)}),t}x($d,"arrayFromSet");function Bd(e,t){return e.size===0?"Set{}":(t.truncate-=7,`Set{ ${he($d(e),t)} }`)}x(Bd,"inspectSet");var _s=new RegExp("['\\u0000-\\u001f\\u007f-\\u009f\\u00ad\\u0600-\\u0604\\u070f\\u17b4\\u17b5\\u200c-\\u200f\\u2028-\\u202f\\u2060-\\u206f\\ufeff\\ufff0-\\uffff]","g"),Sm={"\b":"\\b"," ":"\\t","\n":"\\n","\f":"\\f","\r":"\\r","'":"\\'","\\":"\\\\"},Am=16;function Ld(e){return Sm[e]||`\\u${`0000${e.charCodeAt(0).toString(Am)}`.slice(-4)}`}x(Ld,"escape");function Zi(e,t){return _s.test(e)&&(e=e.replace(_s,Ld)),t.stylize(`'${Fe(e,t.truncate-2)}'`,"string")}x(Zi,"inspectString");function ea(e){return"description"in Symbol.prototype?e.description?`Symbol(${e.description})`:"Symbol()":e.toString()}x(ea,"inspectSymbol");var Mm=x(()=>"Promise{…}","getPromiseValue"),Om=Mm;function Co(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 o=he(r.map(s=>[s,e[s]]),t,gt),i=he(n.map(s=>[s,e[s]]),t,gt);t.seen.pop();let a="";return o&&i&&(a=", "),`{ ${o}${a}${i} }`}x(Co,"inspectObject");var Di=typeof Symbol<"u"&&Symbol.toStringTag?Symbol.toStringTag:!1;function Fd(e,t){let r="";return Di&&Di in e&&(r=e[Di]),r=r||e.constructor.name,(!r||r==="_class")&&(r="<Anonymous Class>"),t.truncate-=r.length,`${r}${Co(e,t)}`}x(Fd,"inspectClass");function Ud(e,t){return e.length===0?"Arguments[]":(t.truncate-=13,`Arguments[ ${he(e,t)} ]`)}x(Ud,"inspectArguments");var Im=["stack","line","column","name","message","fileName","lineNumber","columnNumber","number","description","cause"];function zd(e,t){const r=Object.getOwnPropertyNames(e).filter(a=>Im.indexOf(a)===-1),n=e.name;t.truncate-=n.length;let o="";if(typeof e.message=="string"?o=Fe(e.message,t.truncate):r.unshift("message"),o=o?`: ${o}`:"",t.truncate-=o.length+5,t.seen=t.seen||[],t.seen.includes(e))return"[Circular]";t.seen.push(e);const i=he(r.map(a=>[a,e[a]]),t,gt);return`${n}${o}${i?` { ${i} }`:""}`}x(zd,"inspectObject");function Vd([e,t],r){return r.truncate-=3,t?`${r.stylize(String(e),"yellow")}=${r.stylize(`"${t}"`,"string")}`:`${r.stylize(String(e),"yellow")}`}x(Vd,"inspectAttribute");function si(e,t){return he(e,t,Hd,`
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const xo=require("./runner.cjs.js"),B=require("./jsx-runtime-CjngqUuo.js"),oi=require("react"),lm=(e,t,r=2e3,n=50)=>new Promise((o,i)=>{const a=Date.now(),s=()=>{const l=t();if(l)return o(l);if(Date.now()-a>r)return i(new Error(`Timeout waiting for element ${e}`));setTimeout(s,n)};s()}),um=(e,t,r=2e3,n=50)=>new Promise((o,i)=>{const a=Date.now(),s=()=>{const l=t();if(l&&l.length>0)return o(Array.from(l));if(Date.now()-a>r)return i(new Error(`Timeout waiting for elements ${e}`));setTimeout(s,n)};s()}),ii=e=>new Promise(t=>setTimeout(t,e)),Yi=(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 cm(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}const dm={"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"}},"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]}"`}}},ji=(e,t,...r)=>{const n=t.startsWith("not."),o=n?t.slice(4):t,i=(e.textContent||"").trim(),a=dm[o];if(!a)throw new Error(`Unknown assertion: ${o}`);const s=n?"negative":"positive";let l,u;switch(o){case"have.text":l=i===r[0],u=i;break;case"contain.text":l=i.includes(r[0]),u=i;break;case"be.empty":l=i.length===0,u=i;break;case"have.attr":u=e.getAttribute(r[0]),l=u===r[1];break;case"have.value":u=e.value,l=u===r[0];break;case"be.disabled":l=e.disabled===!0;break;case"be.enabled":l=e.disabled===!1;break;case"be.checked":l=e.checked===!0;break;case"be.selected":l=e.selected===!0;break;case"be.focused":l=document.activeElement===e;break;case"be.visible":l=cm(e);break;case"have.class":l=e.classList.contains(r[0]);break;default:throw new Error(`Unknown assertion: ${o}`)}return Yi(l,n,a[s].pass(r),a[s].fail(r,u))},Re=e=>{const t=xo.handlers.size?Array.from(xo.handlers.values()).find(r=>r.status==="running"):null;t&&t.logs?.push(e)},xa="1.3.0-beta.2",fm=()=>typeof window<"u"?(window.__TWD_MOCK_STATE__||(window.__TWD_MOCK_STATE__={rules:[]}),window.__TWD_MOCK_STATE__):{rules:[]},pm=fm(),Xe=pm.rules,mm=100,hm=async e=>{if("serviceWorker"in navigator){const t=e??"/mock-sw.js";await navigator.serviceWorker.register(`${t}?v=${xa}`),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:o}=r.data,i=Xe.find(a=>a.alias===n);i&&(i.executed=!0,i.request=o)}})}},bm=async(e,t)=>{const r={alias:e,...t,executed:!1},n=Xe.findIndex(o=>o.alias===e);n!==-1?Xe[n]=r:Xe.push(r),navigator.serviceWorker.controller?.postMessage({type:"ADD_RULE",rule:r,version:xa}),await ii(mm),await Promise.resolve()},vm=async e=>await Promise.all(e.map(r=>bd(r))),bd=async(e,t=10,r=100)=>{if(!Xe.find(o=>o.alias===e))throw new Error(`Rule ${e} not found`);for(let o=0;o<t;o++){const i=Xe.find(a=>a.alias===e&&a.executed);if(i)return Promise.resolve(i);o<t-1&&await new Promise(a=>setTimeout(a,r))}throw console.log(`Rule ${e} was not executed within ${t*r}ms`),new Error(`Rule ${e} was not executed within ${t*r}ms`)},ym=()=>Xe,gm=()=>{navigator.serviceWorker.controller?.postMessage({type:"CLEAR_RULES",version:xa}),Xe.length=0},Rm=(e,t)=>{const r=e.startsWith("not.");switch(r?e.slice(4):e){case"eq":return Yi(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 Yi(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}`)}},wm=()=>({location:window.location,should:async(e,t,r=5)=>{let n="",o;for(let i=0;i<r;i++)try{n=Rm(e,t),Re(n);break}catch(a){await new Promise(s=>setTimeout(s,100)),o=a}if(o)throw o;return n}}),Em=100,xm=async(e,t)=>{if(Re(`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 ii(10)}window.history.pushState({},"",e),window.dispatchEvent(new PopStateEvent("popstate")),await ii(Em)},vd={get:async e=>{const t=`body > div:not(#twd-sidebar-root) ${e}`;Re(`Searching get("${e}")`);const r=await lm(e,()=>document.querySelector(t)),n={el:r,should:(o,...i)=>{const a=ji(r,o,...i);return Re(a),n}};return n},setInputValue:(e,t)=>{const{set:r}=Object.getOwnPropertyDescriptor(e.__proto__,"value");r.call(e,t),e.dispatchEvent(new Event("input",{bubbles:!0}))},getAll:async e=>{const t=`body > div:not(#twd-sidebar-root) ${e}`;return Re(`Searching getAll("${e}")`),(await um(e,()=>document.querySelectorAll(t))).map(n=>{const o={el:n,should:(i,...a)=>{const s=ji(n,i,...a);return Re(s),o}};return o})},visit:xm,url:wm,mockRequest:bm,waitForRequest:bd,waitForRequests:vm,initRequestMocking:hm,clearRequestMockRules:gm,getRequestMockRules:ym,should:(e,t,...r)=>{const n=ji(e,t,...r);Re(n)},wait:ii,mockComponent:B.mockComponent,clearComponentMocks:B.clearComponentMocks,notExists:async e=>{const t=`body > div:not(#twd-sidebar-root) ${e}`;if(Re(`Checking notExists("${e}")`),document.querySelector(t))throw new Error(`Element "${e}" exists in the DOM.`);Re(`Assertion passed: Element "${e}" does not exist in the DOM.`)}};var Ca=Object.defineProperty,Cm=(e,t,r)=>t in e?Ca(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,x=(e,t)=>Ca(e,"name",{value:t,configurable:!0}),qa=(e,t)=>{for(var r in t)Ca(e,r,{get:t[r],enumerable:!0})},yd=(e,t,r)=>Cm(e,typeof t!="symbol"?t+"":t,r),ai={};qa(ai,{addChainableMethod:()=>$a,addLengthGuard:()=>jo,addMethod:()=>ka,addProperty:()=>Na,checkError:()=>fe,compareByInspect:()=>ui,eql:()=>Gd,events:()=>Ci,expectTypes:()=>Pd,flag:()=>U,getActual:()=>Ei,getMessage:()=>Ta,getName:()=>qi,getOperator:()=>Ua,getOwnEnumerableProperties:()=>Fa,getOwnEnumerablePropertySymbols:()=>La,getPathInfo:()=>Oa,hasProperty:()=>xi,inspect:()=>H,isNaN:()=>ci,isNumeric:()=>ne,isProxyEnabled:()=>ko,isRegExp:()=>di,objDisplay:()=>st,overwriteChainableMethod:()=>Ba,overwriteMethod:()=>Da,overwriteProperty:()=>ja,proxify:()=>_t,test:()=>_a,transferFlags:()=>Ee,type:()=>Q});var fe={};qa(fe,{compatibleConstructor:()=>wd,compatibleInstance:()=>Rd,compatibleMessage:()=>Ed,getConstructorName:()=>xd,getMessage:()=>Cd});function wi(e){return e instanceof Error||Object.prototype.toString.call(e)==="[object Error]"}x(wi,"isErrorInstance");function gd(e){return Object.prototype.toString.call(e)==="[object RegExp]"}x(gd,"isRegExp");function Rd(e,t){return wi(t)&&e===t}x(Rd,"compatibleInstance");function wd(e,t){return wi(t)?e.constructor===t.constructor||e instanceof t.constructor:(typeof t=="object"||typeof t=="function")&&t.prototype?e.constructor===t||e instanceof t:!1}x(wd,"compatibleConstructor");function Ed(e,t){const r=typeof e=="string"?e:e.message;return gd(t)?t.test(r):typeof t=="string"?r.indexOf(t)!==-1:!1}x(Ed,"compatibleMessage");function xd(e){let t=e;return wi(e)?t=e.constructor.name:typeof e=="function"&&(t=e.name,t===""&&(t=new e().name||t)),t}x(xd,"getConstructorName");function Cd(e){let t="";return e&&e.message?t=e.message:typeof e=="string"&&(t=e),t}x(Cd,"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]}x(U,"flag");function _a(e,t){let r=U(e,"negate"),n=t[0];return r?!n:n}x(_a,"test");function Q(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)}x(Q,"type");var qm="captureStackTrace"in Error,qd=class _d extends Error{constructor(t="Unspecified AssertionError",r,n){super(t),yd(this,"message"),this.message=t,qm&&Error.captureStackTrace(this,n||_d);for(const o in r)o in this||(this[o]=r[o])}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}}};x(qd,"AssertionError");var G=qd;function Pd(e,t){let r=U(e,"message"),n=U(e,"ssfi");r=r?r+": ":"",e=U(e,"object"),t=t.map(function(a){return a.toLowerCase()}),t.sort();let o=t.map(function(a,s){let l=~["a","e","i","o","u"].indexOf(a.charAt(0))?"an":"a";return(t.length>1&&s===t.length-1?"or ":"")+l+" "+a}).join(", "),i=Q(e).toLowerCase();if(!t.some(function(a){return i===a}))throw new G(r+"object tested must be "+o+", but "+i+" given",void 0,n)}x(Pd,"expectTypes");function Ei(e,t){return t.length>4?t[4]:e._obj}x(Ei,"getActual");var qs={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"]},_m={special:"cyan",number:"yellow",bigint:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",symbol:"green",date:"magenta",regexp:"red"},yt="…";function Td(e,t){const r=qs[_m[t]]||qs[t]||"";return r?`\x1B[${r[0]}m${String(e)}\x1B[${r[1]}m`:String(e)}x(Td,"colorise");function Sd({showHidden:e=!1,depth:t=2,colors:r=!1,customInspect:n=!0,showProxy:o=!1,maxArrayLength:i=1/0,breakLength:a=1/0,seen:s=[],truncate:l=1/0,stylize:u=String}={},f){const c={showHidden:!!e,depth:Number(t),colors:!!r,customInspect:!!n,showProxy:!!o,maxArrayLength:Number(i),breakLength:Number(a),truncate:Number(l),seen:s,inspect:f,stylize:u};return c.colors&&(c.stylize=Td),c}x(Sd,"normaliseOptions");function Ad(e){return e>="\uD800"&&e<="\uDBFF"}x(Ad,"isHighSurrogate");function Fe(e,t,r=yt){e=String(e);const n=r.length,o=e.length;if(n>t&&o>n)return r;if(o>t&&o>n){let i=t-n;return i>0&&Ad(e[i-1])&&(i=i-1),`${e.slice(0,i)}${r}`}return e}x(Fe,"truncate");function he(e,t,r,n=", "){r=r||t.inspect;const o=e.length;if(o===0)return"";const i=t.truncate;let a="",s="",l="";for(let u=0;u<o;u+=1){const f=u+1===e.length,c=u+2===e.length;l=`${yt}(${e.length-u})`;const d=e[u];t.truncate=i-a.length-(f?0:n.length);const b=s||r(d,t)+(f?"":n),v=a.length+b.length,R=v+l.length;if(f&&v>i&&a.length+l.length<=i||!f&&!c&&R>i||(s=f?"":r(e[u+1],t)+(c?"":n),!f&&c&&R>i&&v+s.length>i))break;if(a+=b,!f&&!c&&v+s.length>=i){l=`${yt}(${e.length-u-1})`;break}l=""}return`${a}${l}`}x(he,"inspectList");function Md(e){return e.match(/^[a-zA-Z_][a-zA-Z_0-9]*$/)?e:JSON.stringify(e).replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'")}x(Md,"quoteComplexKey");function gt([e,t],r){return r.truncate-=2,typeof e=="string"?e=Md(e):typeof e!="number"&&(e=`[${r.inspect(e,r)}]`),r.truncate-=e.length,t=r.inspect(t,r),`${e}: ${t}`}x(gt,"inspectProperty");function Od(e,t){const r=Object.keys(e).slice(e.length);if(!e.length&&!r.length)return"[]";t.truncate-=4;const n=he(e,t);t.truncate-=n.length;let o="";return r.length&&(o=he(r.map(i=>[i,e[i]]),t,gt)),`[ ${n}${o?`, ${o}`:""} ]`}x(Od,"inspectArray");var Pm=x(e=>typeof Buffer=="function"&&e instanceof Buffer?"Buffer":e[Symbol.toStringTag]?e[Symbol.toStringTag]:e.constructor.name,"getArrayName");function qe(e,t){const r=Pm(e);t.truncate-=r.length+4;const n=Object.keys(e).slice(e.length);if(!e.length&&!n.length)return`${r}[]`;let o="";for(let a=0;a<e.length;a++){const s=`${t.stylize(Fe(e[a],t.truncate),"number")}${a===e.length-1?"":", "}`;if(t.truncate-=s.length,e[a]!==e.length&&t.truncate<=3){o+=`${yt}(${e.length-e[a]+1})`;break}o+=s}let i="";return n.length&&(i=he(n.map(a=>[a,e[a]]),t,gt)),`${r}[ ${o}${i?`, ${i}`:""} ]`}x(qe,"inspectTypedArray");function Id(e,t){const r=e.toJSON();if(r===null)return"Invalid Date";const n=r.split("T"),o=n[0];return t.stylize(`${o}T${Fe(n[1],t.truncate-o.length-1)}`,"date")}x(Id,"inspectDate");function Xi(e,t){const r=e[Symbol.toStringTag]||"Function",n=e.name;return n?t.stylize(`[${r} ${Fe(n,t.truncate-11)}]`,"special"):t.stylize(`[${r}]`,"special")}x(Xi,"inspectFunction");function Nd([e,t],r){return r.truncate-=4,e=r.inspect(e,r),r.truncate-=e.length,t=r.inspect(t,r),`${e} => ${t}`}x(Nd,"inspectMapEntry");function kd(e){const t=[];return e.forEach((r,n)=>{t.push([n,r])}),t}x(kd,"mapToEntries");function jd(e,t){return e.size===0?"Map{}":(t.truncate-=7,`Map{ ${he(kd(e),t,Nd)} }`)}x(jd,"inspectMap");var Tm=Number.isNaN||(e=>e!==e);function Ji(e,t){return Tm(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(Fe(String(e),t.truncate),"number")}x(Ji,"inspectNumber");function Qi(e,t){let r=Fe(e.toString(),t.truncate-1);return r!==yt&&(r+="n"),t.stylize(r,"bigint")}x(Qi,"inspectBigInt");function Dd(e,t){const r=e.toString().split("/")[2],n=t.truncate-(2+r.length),o=e.source;return t.stylize(`/${Fe(o,n)}/${r}`,"regexp")}x(Dd,"inspectRegExp");function $d(e){const t=[];return e.forEach(r=>{t.push(r)}),t}x($d,"arrayFromSet");function Bd(e,t){return e.size===0?"Set{}":(t.truncate-=7,`Set{ ${he($d(e),t)} }`)}x(Bd,"inspectSet");var _s=new RegExp("['\\u0000-\\u001f\\u007f-\\u009f\\u00ad\\u0600-\\u0604\\u070f\\u17b4\\u17b5\\u200c-\\u200f\\u2028-\\u202f\\u2060-\\u206f\\ufeff\\ufff0-\\uffff]","g"),Sm={"\b":"\\b"," ":"\\t","\n":"\\n","\f":"\\f","\r":"\\r","'":"\\'","\\":"\\\\"},Am=16;function Ld(e){return Sm[e]||`\\u${`0000${e.charCodeAt(0).toString(Am)}`.slice(-4)}`}x(Ld,"escape");function Zi(e,t){return _s.test(e)&&(e=e.replace(_s,Ld)),t.stylize(`'${Fe(e,t.truncate-2)}'`,"string")}x(Zi,"inspectString");function ea(e){return"description"in Symbol.prototype?e.description?`Symbol(${e.description})`:"Symbol()":e.toString()}x(ea,"inspectSymbol");var Mm=x(()=>"Promise{…}","getPromiseValue"),Om=Mm;function Co(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 o=he(r.map(s=>[s,e[s]]),t,gt),i=he(n.map(s=>[s,e[s]]),t,gt);t.seen.pop();let a="";return o&&i&&(a=", "),`{ ${o}${a}${i} }`}x(Co,"inspectObject");var Di=typeof Symbol<"u"&&Symbol.toStringTag?Symbol.toStringTag:!1;function Fd(e,t){let r="";return Di&&Di in e&&(r=e[Di]),r=r||e.constructor.name,(!r||r==="_class")&&(r="<Anonymous Class>"),t.truncate-=r.length,`${r}${Co(e,t)}`}x(Fd,"inspectClass");function Ud(e,t){return e.length===0?"Arguments[]":(t.truncate-=13,`Arguments[ ${he(e,t)} ]`)}x(Ud,"inspectArguments");var Im=["stack","line","column","name","message","fileName","lineNumber","columnNumber","number","description","cause"];function zd(e,t){const r=Object.getOwnPropertyNames(e).filter(a=>Im.indexOf(a)===-1),n=e.name;t.truncate-=n.length;let o="";if(typeof e.message=="string"?o=Fe(e.message,t.truncate):r.unshift("message"),o=o?`: ${o}`:"",t.truncate-=o.length+5,t.seen=t.seen||[],t.seen.includes(e))return"[Circular]";t.seen.push(e);const i=he(r.map(a=>[a,e[a]]),t,gt);return`${n}${o}${i?` { ${i} }`:""}`}x(zd,"inspectObject");function Vd([e,t],r){return r.truncate-=3,t?`${r.stylize(String(e),"yellow")}=${r.stylize(`"${t}"`,"string")}`:`${r.stylize(String(e),"yellow")}`}x(Vd,"inspectAttribute");function si(e,t){return he(e,t,Hd,`
2
2
  `)}x(si,"inspectNodeCollection");function Hd(e,t){switch(e.nodeType){case 1:return Pa(e,t);case 3:return t.inspect(e.data,t);default:return t.inspect(e,t)}}x(Hd,"inspectNode");function Pa(e,t){const r=e.getAttributeNames(),n=e.tagName.toLowerCase(),o=t.stylize(`<${n}`,"special"),i=t.stylize(">","special"),a=t.stylize(`</${n}>`,"special");t.truncate-=n.length*2+5;let s="";r.length>0&&(s+=" ",s+=he(r.map(f=>[f,e.getAttribute(f)]),t,Vd," ")),t.truncate-=s.length;const l=t.truncate;let u=si(e.children,t);return u&&u.length>l&&(u=`${yt}(${e.children.length})`),`${o}${s}${i}${u}${a}`}x(Pa,"inspectHTML");var Nm=typeof Symbol=="function"&&typeof Symbol.for=="function",$i=Nm?Symbol.for("chai/inspect"):"@@chai/inspect",Bi=Symbol.for("nodejs.util.inspect.custom"),Ps=new WeakMap,Ts={},Ss={undefined:x((e,t)=>t.stylize("undefined","undefined"),"undefined"),null:x((e,t)=>t.stylize("null","null"),"null"),boolean:x((e,t)=>t.stylize(String(e),"boolean"),"boolean"),Boolean:x((e,t)=>t.stylize(String(e),"boolean"),"Boolean"),number:Ji,Number:Ji,bigint:Qi,BigInt:Qi,string:Zi,String:Zi,function:Xi,Function:Xi,symbol:ea,Symbol:ea,Array:Od,Date:Id,Map:jd,Set:Bd,RegExp:Dd,Promise:Om,WeakSet:x((e,t)=>t.stylize("WeakSet{…}","special"),"WeakSet"),WeakMap:x((e,t)=>t.stylize("WeakMap{…}","special"),"WeakMap"),Arguments:Ud,Int8Array:qe,Uint8Array:qe,Uint8ClampedArray:qe,Int16Array:qe,Uint16Array:qe,Int32Array:qe,Uint32Array:qe,Float32Array:qe,Float64Array:qe,Generator:x(()=>"","Generator"),DataView:x(()=>"","DataView"),ArrayBuffer:x(()=>"","ArrayBuffer"),Error:zd,HTMLCollection:si,NodeList:si},km=x((e,t,r,n)=>$i in e&&typeof e[$i]=="function"?e[$i](t):Bi in e&&typeof e[Bi]=="function"?e[Bi](t.depth,t,n):"inspect"in e&&typeof e.inspect=="function"?e.inspect(t.depth,t):"constructor"in e&&Ps.has(e.constructor)?Ps.get(e.constructor)(e,t):Ts[r]?Ts[r](e,t):"","inspectCustom"),jm=Object.prototype.toString;function qo(e,t={}){const r=Sd(t,qo),{customInspect:n}=r;let o=e===null?"null":typeof e;if(o==="object"&&(o=jm.call(e).slice(8,-1)),o in Ss)return Ss[o](e,r);if(n&&e){const a=km(e,r,o,qo);if(a)return typeof a=="string"?a:qo(a,r)}const i=e?Object.getPrototypeOf(e):!1;return i===Object.prototype||i===null?Co(e,r):e&&typeof HTMLElement=="function"&&e instanceof HTMLElement?Pa(e,r):"constructor"in e?e.constructor!==Object?Fd(e,r):Co(e,r):e===Object(e)?Co(e,r):r.stylize(String(e),o)}x(qo,"inspect");var ie={includeStack:!1,showDiff:!0,truncateThreshold:40,useProxy:!0,proxyExcludedKeys:["then","catch","inspect","toJSON"],deepEqual:null};function H(e,t,r,n){let o={colors:n,depth:typeof r>"u"?2:r,showHidden:t,truncate:ie.truncateThreshold?ie.truncateThreshold:1/0};return qo(e,o)}x(H,"inspect");function st(e){let t=H(e),r=Object.prototype.toString.call(e);if(ie.truncateThreshold&&t.length>=ie.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}x(st,"objDisplay");function Ta(e,t){let r=U(e,"negate"),n=U(e,"object"),o=t[3],i=Ei(e,t),a=r?t[2]:t[1],s=U(e,"message");return typeof a=="function"&&(a=a()),a=a||"",a=a.replace(/#\{this\}/g,function(){return st(n)}).replace(/#\{act\}/g,function(){return st(i)}).replace(/#\{exp\}/g,function(){return st(o)}),s?s+": "+a:a}x(Ta,"getMessage");function Ee(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 o in n)(r||o!=="object"&&o!=="ssfi"&&o!=="lockSsfi"&&o!="message")&&(t.__flags[o]=n[o])}x(Ee,"transferFlags");function ta(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)}x(ta,"type");function Sa(){this._key="chai/deep-eql__"+Math.random()+Date.now()}x(Sa,"FakeMap");Sa.prototype={get:x(function(t){return t[this._key]},"get"),set:x(function(t,r){Object.isExtensible(t)&&Object.defineProperty(t,this._key,{value:r,configurable:!0})},"set")};var Wd=typeof WeakMap=="function"?WeakMap:Sa;function ra(e,t,r){if(!r||ut(e)||ut(t))return null;var n=r.get(e);if(n){var o=n.get(t);if(typeof o=="boolean")return o}return null}x(ra,"memoizeCompare");function go(e,t,r,n){if(!(!r||ut(e)||ut(t))){var o=r.get(e);o?o.set(t,n):(o=new Wd,o.set(t,n),r.set(e,o))}}x(go,"memoizeSet");var Gd=No;function No(e,t,r){if(r&&r.comparator)return na(e,t,r);var n=Aa(e,t);return n!==null?n:na(e,t,r)}x(No,"deepEqual");function Aa(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t?!0:ut(e)||ut(t)?!1:null}x(Aa,"simpleEqual");function na(e,t,r){r=r||{},r.memoize=r.memoize===!1?!1:r.memoize||new Wd;var n=r&&r.comparator,o=ra(e,t,r.memoize);if(o!==null)return o;var i=ra(t,e,r.memoize);if(i!==null)return i;if(n){var a=n(e,t);if(a===!1||a===!0)return go(e,t,r.memoize,a),a;var s=Aa(e,t);if(s!==null)return s}var l=ta(e);if(l!==ta(t))return go(e,t,r.memoize,!1),!1;go(e,t,r.memoize,!0);var u=Kd(e,t,l,r);return go(e,t,r.memoize,u),u}x(na,"extensiveDeepEqual");function Kd(e,t,r,n){switch(r){case"String":case"Number":case"Boolean":case"Date":return No(e.valueOf(),t.valueOf());case"Promise":case"Symbol":case"function":case"WeakMap":case"WeakSet":return e===t;case"Error":return Ma(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 Je(e,t,n);case"RegExp":return Yd(e,t);case"Generator":return Xd(e,t,n);case"DataView":return Je(new Uint8Array(e.buffer),new Uint8Array(t.buffer),n);case"ArrayBuffer":return Je(new Uint8Array(e),new Uint8Array(t),n);case"Set":return oa(e,t,n);case"Map":return oa(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 Qd(e,t,n)}}x(Kd,"extensiveDeepEqualByType");function Yd(e,t){return e.toString()===t.toString()}x(Yd,"regexpEqual");function oa(e,t,r){try{if(e.size!==t.size)return!1;if(e.size===0)return!0}catch{return!1}var n=[],o=[];return e.forEach(x(function(a,s){n.push([a,s])},"gatherEntries")),t.forEach(x(function(a,s){o.push([a,s])},"gatherEntries")),Je(n.sort(),o.sort(),r)}x(oa,"entriesEqual");function Je(e,t,r){var n=e.length;if(n!==t.length)return!1;if(n===0)return!0;for(var o=-1;++o<n;)if(No(e[o],t[o],r)===!1)return!1;return!0}x(Je,"iterableEqual");function Xd(e,t,r){return Je(li(e),li(t),r)}x(Xd,"generatorEqual");function Jd(e){return typeof Symbol<"u"&&typeof e=="object"&&typeof Symbol.iterator<"u"&&typeof e[Symbol.iterator]=="function"}x(Jd,"hasIteratorFunction");function ia(e){if(Jd(e))try{return li(e[Symbol.iterator]())}catch{return[]}return[]}x(ia,"getIteratorEntries");function li(e){for(var t=e.next(),r=[t.value];t.done===!1;)t=e.next(),r.push(t.value);return r}x(li,"getGeneratorEntries");function aa(e){var t=[];for(var r in e)t.push(r);return t}x(aa,"getEnumerableKeys");function sa(e){for(var t=[],r=Object.getOwnPropertySymbols(e),n=0;n<r.length;n+=1){var o=r[n];Object.getOwnPropertyDescriptor(e,o).enumerable&&t.push(o)}return t}x(sa,"getEnumerableSymbols");function Ma(e,t,r,n){var o=r.length;if(o===0)return!0;for(var i=0;i<o;i+=1)if(No(e[r[i]],t[r[i]],n)===!1)return!1;return!0}x(Ma,"keysEqual");function Qd(e,t,r){var n=aa(e),o=aa(t),i=sa(e),a=sa(t);if(n=n.concat(i),o=o.concat(a),n.length&&n.length===o.length)return Je(la(n).sort(),la(o).sort())===!1?!1:Ma(e,t,n,r);var s=ia(e),l=ia(t);return s.length&&s.length===l.length?(s.sort(),l.sort(),Je(s,l,r)):n.length===0&&s.length===0&&o.length===0&&l.length===0}x(Qd,"objectEqual");function ut(e){return e===null||typeof e!="object"}x(ut,"isPrimitive");function la(e){return e.map(x(function(r){return typeof r=="symbol"?r.toString():r},"mapSymbol"))}x(la,"mapSymbols");function xi(e,t){return typeof e>"u"||e===null?!1:t in Object(e)}x(xi,"hasProperty");function Zd(e){return e.replace(/([^\\])\[/g,"$1.[").match(/(\\\.|[^.]+?)+/g).map(n=>{if(n==="constructor"||n==="__proto__"||n==="prototype")return{};const i=/^\[(\d+)\]$/.exec(n);let a=null;return i?a={i:parseFloat(i[1])}:a={p:n.replace(/\\([.[\]])/g,"$1")},a})}x(Zd,"parsePath");function ua(e,t,r){let n=e,o=null;r=typeof r>"u"?t.length:r;for(let i=0;i<r;i++){const a=t[i];n&&(typeof a.p>"u"?n=n[a.i]:n=n[a.p],i===r-1&&(o=n))}return o}x(ua,"internalGetPathValue");function Oa(e,t){const r=Zd(t),n=r[r.length-1],o={parent:r.length>1?ua(e,r,r.length-1):e,name:n.p||n.i,value:ua(e,r)};return o.exists=xi(o.parent,o.name),o}x(Oa,"getPathInfo");var ef=class tf{constructor(t,r,n,o){return yd(this,"__flags",{}),U(this,"ssfi",n||tf),U(this,"lockSsfi",o),U(this,"object",t),U(this,"message",r),U(this,"eql",ie.deepEqual||Gd),_t(this)}static get includeStack(){return console.warn("Assertion.includeStack is deprecated, use chai.config.includeStack instead."),ie.includeStack}static set includeStack(t){console.warn("Assertion.includeStack is deprecated, use chai.config.includeStack instead."),ie.includeStack=t}static get showDiff(){return console.warn("Assertion.showDiff is deprecated, use chai.config.showDiff instead."),ie.showDiff}static set showDiff(t){console.warn("Assertion.showDiff is deprecated, use chai.config.showDiff instead."),ie.showDiff=t}static addProperty(t,r){Na(this.prototype,t,r)}static addMethod(t,r){ka(this.prototype,t,r)}static addChainableMethod(t,r,n){$a(this.prototype,t,r,n)}static overwriteProperty(t,r){ja(this.prototype,t,r)}static overwriteMethod(t,r){Da(this.prototype,t,r)}static overwriteChainableMethod(t,r,n){Ba(this.prototype,t,r,n)}assert(t,r,n,o,i,a){const s=_a(this,arguments);if(a!==!1&&(a=!0),o===void 0&&i===void 0&&(a=!1),ie.showDiff!==!0&&(a=!1),!s){r=Ta(this,arguments);const u={actual:Ei(this,arguments),expected:o,showDiff:a},f=Ua(this,arguments);throw f&&(u.operator=f),new G(r,u,ie.includeStack?this.assert:U(this,"ssfi"))}}get _obj(){return U(this,"object")}set _obj(t){U(this,"object",t)}};x(ef,"Assertion");var h=ef,Ci=new EventTarget,rf=class extends Event{constructor(t,r,n){super(t),this.name=String(r),this.fn=n}};x(rf,"PluginEvent");var Ia=rf;function ko(){return ie.useProxy&&typeof Proxy<"u"&&typeof Reflect<"u"}x(ko,"isProxyEnabled");function Na(e,t,r){r=r===void 0?function(){}:r,Object.defineProperty(e,t,{get:x(function n(){!ko()&&!U(this,"lockSsfi")&&U(this,"ssfi",n);let o=r.call(this);if(o!==void 0)return o;let i=new h;return Ee(this,i),i},"propertyGetter"),configurable:!0}),Ci.dispatchEvent(new Ia("addProperty",t,r))}x(Na,"addProperty");var Dm=Object.getOwnPropertyDescriptor(function(){},"length");function jo(e,t,r){return Dm.configurable&&Object.defineProperty(e,"length",{get:x(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}x(jo,"addLengthGuard");function nf(e){let t=Object.getOwnPropertyNames(e);function r(o){t.indexOf(o)===-1&&t.push(o)}x(r,"addProperty");let n=Object.getPrototypeOf(e);for(;n!==null;)Object.getOwnPropertyNames(n).forEach(r),n=Object.getPrototypeOf(n);return t}x(nf,"getProperties");var As=["__flags","__methods","_obj","assert"];function _t(e,t){return ko()?new Proxy(e,{get:x(function r(n,o){if(typeof o=="string"&&ie.proxyExcludedKeys.indexOf(o)===-1&&!Reflect.has(n,o)){if(t)throw Error("Invalid Chai property: "+t+"."+o+'. See docs for proper usage of "'+t+'".');let i=null,a=4;throw nf(n).forEach(function(s){if(!Object.prototype.hasOwnProperty(s)&&As.indexOf(s)===-1){let l=of(o,s,a);l<a&&(i=s,a=l)}}),Error(i!==null?"Invalid Chai property: "+o+'. Did you mean "'+i+'"?':"Invalid Chai property: "+o)}return As.indexOf(o)===-1&&!U(n,"lockSsfi")&&U(n,"ssfi",r),Reflect.get(n,o)},"proxyGetter")}):e}x(_t,"proxify");function of(e,t,r){if(Math.abs(e.length-t.length)>=r)return r;let n=[];for(let o=0;o<=e.length;o++)n[o]=Array(t.length+1).fill(0),n[o][0]=o;for(let o=0;o<t.length;o++)n[0][o]=o;for(let o=1;o<=e.length;o++){let i=e.charCodeAt(o-1);for(let a=1;a<=t.length;a++){if(Math.abs(o-a)>=r){n[o][a]=r;continue}n[o][a]=Math.min(n[o-1][a]+1,n[o][a-1]+1,n[o-1][a-1]+(i===t.charCodeAt(a-1)?0:1))}}return n[e.length][t.length]}x(of,"stringDistanceCapped");function ka(e,t,r){let n=x(function(){U(this,"lockSsfi")||U(this,"ssfi",n);let o=r.apply(this,arguments);if(o!==void 0)return o;let i=new h;return Ee(this,i),i},"methodWrapper");jo(n,t,!1),e[t]=_t(n,t),Ci.dispatchEvent(new Ia("addMethod",t,r))}x(ka,"addMethod");function ja(e,t,r){let n=Object.getOwnPropertyDescriptor(e,t),o=x(function(){},"_super");n&&typeof n.get=="function"&&(o=n.get),Object.defineProperty(e,t,{get:x(function i(){!ko()&&!U(this,"lockSsfi")&&U(this,"ssfi",i);let a=U(this,"lockSsfi");U(this,"lockSsfi",!0);let s=r(o).call(this);if(U(this,"lockSsfi",a),s!==void 0)return s;let l=new h;return Ee(this,l),l},"overwritingPropertyGetter"),configurable:!0})}x(ja,"overwriteProperty");function Da(e,t,r){let n=e[t],o=x(function(){throw new Error(t+" is not a function")},"_super");n&&typeof n=="function"&&(o=n);let i=x(function(){U(this,"lockSsfi")||U(this,"ssfi",i);let a=U(this,"lockSsfi");U(this,"lockSsfi",!0);let s=r(o).apply(this,arguments);if(U(this,"lockSsfi",a),s!==void 0)return s;let l=new h;return Ee(this,l),l},"overwritingMethodWrapper");jo(i,t,!1),e[t]=_t(i,t)}x(Da,"overwriteMethod");var $m=typeof Object.setPrototypeOf=="function",Ms=x(function(){},"testFn"),Bm=Object.getOwnPropertyNames(Ms).filter(function(e){let t=Object.getOwnPropertyDescriptor(Ms,e);return typeof t!="object"?!0:!t.configurable}),Lm=Function.prototype.call,Fm=Function.prototype.apply,af=class extends Ia{constructor(t,r,n,o){super(t,r,n),this.chainingBehavior=o}};x(af,"PluginAddChainableMethodEvent");var Um=af;function $a(e,t,r,n){typeof n!="function"&&(n=x(function(){},"chainingBehavior"));let o={method:r,chainingBehavior:n};e.__methods||(e.__methods={}),e.__methods[t]=o,Object.defineProperty(e,t,{get:x(function(){o.chainingBehavior.call(this);let a=x(function(){U(this,"lockSsfi")||U(this,"ssfi",a);let s=o.method.apply(this,arguments);if(s!==void 0)return s;let l=new h;return Ee(this,l),l},"chainableMethodWrapper");if(jo(a,t,!0),$m){let s=Object.create(this);s.call=Lm,s.apply=Fm,Object.setPrototypeOf(a,s)}else Object.getOwnPropertyNames(e).forEach(function(l){if(Bm.indexOf(l)!==-1)return;let u=Object.getOwnPropertyDescriptor(e,l);Object.defineProperty(a,l,u)});return Ee(this,a),_t(a)},"chainableMethodGetter"),configurable:!0}),Ci.dispatchEvent(new Um("addChainableMethod",t,r,n))}x($a,"addChainableMethod");function Ba(e,t,r,n){let o=e.__methods[t],i=o.chainingBehavior;o.chainingBehavior=x(function(){let l=n(i).call(this);if(l!==void 0)return l;let u=new h;return Ee(this,u),u},"overwritingChainableMethodGetter");let a=o.method;o.method=x(function(){let l=r(a).apply(this,arguments);if(l!==void 0)return l;let u=new h;return Ee(this,u),u},"overwritingChainableMethodWrapper")}x(Ba,"overwriteChainableMethod");function ui(e,t){return H(e)<H(t)?-1:1}x(ui,"compareByInspect");function La(e){return typeof Object.getOwnPropertySymbols!="function"?[]:Object.getOwnPropertySymbols(e).filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})}x(La,"getOwnEnumerablePropertySymbols");function Fa(e){return Object.keys(e).concat(La(e))}x(Fa,"getOwnEnumerableProperties");var ci=Number.isNaN;function sf(e){let t=Q(e);return["Array","Object","Function"].indexOf(t)!==-1}x(sf,"isObjectType");function Ua(e,t){let r=U(e,"operator"),n=U(e,"negate"),o=t[3],i=n?t[2]:t[1];if(r)return r;if(typeof i=="function"&&(i=i()),i=i||"",!i||/\shave\s/.test(i))return;let a=sf(o);return/\snot\s/.test(i)?a?"notDeepStrictEqual":"notStrictEqual":a?"deepStrictEqual":"strictEqual"}x(Ua,"getOperator");function qi(e){return e.name}x(qi,"getName");function di(e){return Object.prototype.toString.call(e)==="[object RegExp]"}x(di,"isRegExp");function ne(e){return["Number","BigInt"].includes(Q(e))}x(ne,"isNumeric");var{flag:w}=ai;["to","be","been","is","and","has","have","with","that","which","at","of","same","but","does","still","also"].forEach(function(e){h.addProperty(e)});h.addProperty("not",function(){w(this,"negate",!0)});h.addProperty("deep",function(){w(this,"deep",!0)});h.addProperty("nested",function(){w(this,"nested",!0)});h.addProperty("own",function(){w(this,"own",!0)});h.addProperty("ordered",function(){w(this,"ordered",!0)});h.addProperty("any",function(){w(this,"any",!0),w(this,"all",!1)});h.addProperty("all",function(){w(this,"all",!0),w(this,"any",!1)});var Os={function:["function","asyncfunction","generatorfunction","asyncgeneratorfunction"],asyncfunction:["asyncfunction","asyncgeneratorfunction"],generatorfunction:["generatorfunction","asyncgeneratorfunction"],asyncgeneratorfunction:["asyncgeneratorfunction"]};function za(e,t){t&&w(this,"message",t),e=e.toLowerCase();let r=w(this,"object"),n=~["a","e","i","o","u"].indexOf(e.charAt(0))?"an ":"a ";const o=Q(r).toLowerCase();Os.function.includes(e)?this.assert(Os[e].includes(o),"expected #{this} to be "+n+e,"expected #{this} not to be "+n+e):this.assert(e===o,"expected #{this} to be "+n+e,"expected #{this} not to be "+n+e)}x(za,"an");h.addChainableMethod("an",za);h.addChainableMethod("a",za);function lf(e,t){return ci(e)&&ci(t)||e===t}x(lf,"SameValueZero");function Do(){w(this,"contains",!0)}x(Do,"includeChainingBehavior");function $o(e,t){t&&w(this,"message",t);let r=w(this,"object"),n=Q(r).toLowerCase(),o=w(this,"message"),i=w(this,"negate"),a=w(this,"ssfi"),s=w(this,"deep"),l=s?"deep ":"",u=s?w(this,"eql"):lf;o=o?o+": ":"";let f=!1;switch(n){case"string":f=r.indexOf(e)!==-1;break;case"weakset":if(s)throw new G(o+"unable to use .deep.include with WeakSet",void 0,a);f=r.has(e);break;case"map":r.forEach(function(c){f=f||u(c,e)});break;case"set":s?r.forEach(function(c){f=f||u(c,e)}):f=r.has(e);break;case"array":s?f=r.some(function(c){return u(c,e)}):f=r.indexOf(e)!==-1;break;default:{if(e!==Object(e))throw new G(o+"the given combination of arguments ("+n+" and "+Q(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 "+Q(e).toLowerCase(),void 0,a);let c=Object.keys(e),d=null,b=0;if(c.forEach(function(v){let R=new h(r);if(Ee(this,R,!0),w(R,"lockSsfi",!0),!i||c.length===1){R.property(v,e[v]);return}try{R.property(v,e[v])}catch(S){if(!fe.compatibleConstructor(S,G))throw S;d===null&&(d=S),b++}},this),i&&c.length>1&&b===c.length)throw d;return}}this.assert(f,"expected #{this} to "+l+"include "+H(e),"expected #{this} to not "+l+"include "+H(e))}x($o,"include");h.addChainableMethod("include",$o,Do);h.addChainableMethod("contain",$o,Do);h.addChainableMethod("contains",$o,Do);h.addChainableMethod("includes",$o,Do);h.addProperty("ok",function(){this.assert(w(this,"object"),"expected #{this} to be truthy","expected #{this} to be falsy")});h.addProperty("true",function(){this.assert(w(this,"object")===!0,"expected #{this} to be true","expected #{this} to be false",!w(this,"negate"))});h.addProperty("numeric",function(){const e=w(this,"object");this.assert(["Number","BigInt"].includes(Q(e)),"expected #{this} to be numeric","expected #{this} to not be numeric",!w(this,"negate"))});h.addProperty("callable",function(){const e=w(this,"object"),t=w(this,"ssfi"),r=w(this,"message"),n=r?`${r}: `:"",o=w(this,"negate"),i=o?`${n}expected ${H(e)} not to be a callable function`:`${n}expected ${H(e)} to be a callable function`,a=["Function","AsyncFunction","GeneratorFunction","AsyncGeneratorFunction"].includes(Q(e));if(a&&o||!a&&!o)throw new G(i,void 0,t)});h.addProperty("false",function(){this.assert(w(this,"object")===!1,"expected #{this} to be false","expected #{this} to be true",!!w(this,"negate"))});h.addProperty("null",function(){this.assert(w(this,"object")===null,"expected #{this} to be null","expected #{this} not to be null")});h.addProperty("undefined",function(){this.assert(w(this,"object")===void 0,"expected #{this} to be undefined","expected #{this} not to be undefined")});h.addProperty("NaN",function(){this.assert(ci(w(this,"object")),"expected #{this} to be NaN","expected #{this} not to be NaN")});function Va(){let e=w(this,"object");this.assert(e!=null,"expected #{this} to exist","expected #{this} to not exist")}x(Va,"assertExist");h.addProperty("exist",Va);h.addProperty("exists",Va);h.addProperty("empty",function(){let e=w(this,"object"),t=w(this,"ssfi"),r=w(this,"message"),n;switch(r=r?r+": ":"",Q(e).toLowerCase()){case"array":case"string":n=e.length;break;case"map":case"set":n=e.size;break;case"weakmap":case"weakset":throw new G(r+".empty was passed a weak collection",void 0,t);case"function":{const o=r+".empty was passed a function "+qi(e);throw new G(o.trim(),void 0,t)}default:if(e!==Object(e))throw new G(r+".empty was passed non-string primitive "+H(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 Ha(){let e=w(this,"object"),t=Q(e);this.assert(t==="Arguments","expected #{this} to be arguments but got "+t,"expected #{this} to not be arguments")}x(Ha,"checkArguments");h.addProperty("arguments",Ha);h.addProperty("Arguments",Ha);function _i(e,t){t&&w(this,"message",t);let r=w(this,"object");if(w(this,"deep")){let n=w(this,"lockSsfi");w(this,"lockSsfi",!0),this.eql(e),w(this,"lockSsfi",n)}else this.assert(e===r,"expected #{this} to equal #{exp}","expected #{this} to not equal #{exp}",e,this._obj,!0)}x(_i,"assertEqual");h.addMethod("equal",_i);h.addMethod("equals",_i);h.addMethod("eq",_i);function Wa(e,t){t&&w(this,"message",t);let r=w(this,"eql");this.assert(r(e,w(this,"object")),"expected #{this} to deeply equal #{exp}","expected #{this} to not deeply equal #{exp}",e,this._obj,!0)}x(Wa,"assertEql");h.addMethod("eql",Wa);h.addMethod("eqls",Wa);function Pi(e,t){t&&w(this,"message",t);let r=w(this,"object"),n=w(this,"doLength"),o=w(this,"message"),i=o?o+": ":"",a=w(this,"ssfi"),s=Q(r).toLowerCase(),l=Q(e).toLowerCase();if(n&&s!=="map"&&s!=="set"&&new h(r,o,a,!0).to.have.property("length"),!n&&s==="date"&&l!=="date")throw new G(i+"the argument to above must be a date",void 0,a);if(!ne(e)&&(n||ne(r)))throw new G(i+"the argument to above must be a number",void 0,a);if(!n&&s!=="date"&&!ne(r)){let u=s==="string"?"'"+r+"'":r;throw new G(i+"expected "+u+" to be a number or a date",void 0,a)}if(n){let u="length",f;s==="map"||s==="set"?(u="size",f=r.size):f=r.length,this.assert(f>e,"expected #{this} to have a "+u+" above #{exp} but got #{act}","expected #{this} to not have a "+u+" above #{exp}",e,f)}else this.assert(r>e,"expected #{this} to be above #{exp}","expected #{this} to be at most #{exp}",e)}x(Pi,"assertAbove");h.addMethod("above",Pi);h.addMethod("gt",Pi);h.addMethod("greaterThan",Pi);function Ti(e,t){t&&w(this,"message",t);let r=w(this,"object"),n=w(this,"doLength"),o=w(this,"message"),i=o?o+": ":"",a=w(this,"ssfi"),s=Q(r).toLowerCase(),l=Q(e).toLowerCase(),u,f=!0;if(n&&s!=="map"&&s!=="set"&&new h(r,o,a,!0).to.have.property("length"),!n&&s==="date"&&l!=="date")u=i+"the argument to least must be a date";else if(!ne(e)&&(n||ne(r)))u=i+"the argument to least must be a number";else if(!n&&s!=="date"&&!ne(r)){let c=s==="string"?"'"+r+"'":r;u=i+"expected "+c+" to be a number or a date"}else f=!1;if(f)throw new G(u,void 0,a);if(n){let c="length",d;s==="map"||s==="set"?(c="size",d=r.size):d=r.length,this.assert(d>=e,"expected #{this} to have a "+c+" at least #{exp} but got #{act}","expected #{this} to have a "+c+" below #{exp}",e,d)}else this.assert(r>=e,"expected #{this} to be at least #{exp}","expected #{this} to be below #{exp}",e)}x(Ti,"assertLeast");h.addMethod("least",Ti);h.addMethod("gte",Ti);h.addMethod("greaterThanOrEqual",Ti);function Si(e,t){t&&w(this,"message",t);let r=w(this,"object"),n=w(this,"doLength"),o=w(this,"message"),i=o?o+": ":"",a=w(this,"ssfi"),s=Q(r).toLowerCase(),l=Q(e).toLowerCase(),u,f=!0;if(n&&s!=="map"&&s!=="set"&&new h(r,o,a,!0).to.have.property("length"),!n&&s==="date"&&l!=="date")u=i+"the argument to below must be a date";else if(!ne(e)&&(n||ne(r)))u=i+"the argument to below must be a number";else if(!n&&s!=="date"&&!ne(r)){let c=s==="string"?"'"+r+"'":r;u=i+"expected "+c+" to be a number or a date"}else f=!1;if(f)throw new G(u,void 0,a);if(n){let c="length",d;s==="map"||s==="set"?(c="size",d=r.size):d=r.length,this.assert(d<e,"expected #{this} to have a "+c+" below #{exp} but got #{act}","expected #{this} to not have a "+c+" below #{exp}",e,d)}else this.assert(r<e,"expected #{this} to be below #{exp}","expected #{this} to be at least #{exp}",e)}x(Si,"assertBelow");h.addMethod("below",Si);h.addMethod("lt",Si);h.addMethod("lessThan",Si);function Ai(e,t){t&&w(this,"message",t);let r=w(this,"object"),n=w(this,"doLength"),o=w(this,"message"),i=o?o+": ":"",a=w(this,"ssfi"),s=Q(r).toLowerCase(),l=Q(e).toLowerCase(),u,f=!0;if(n&&s!=="map"&&s!=="set"&&new h(r,o,a,!0).to.have.property("length"),!n&&s==="date"&&l!=="date")u=i+"the argument to most must be a date";else if(!ne(e)&&(n||ne(r)))u=i+"the argument to most must be a number";else if(!n&&s!=="date"&&!ne(r)){let c=s==="string"?"'"+r+"'":r;u=i+"expected "+c+" to be a number or a date"}else f=!1;if(f)throw new G(u,void 0,a);if(n){let c="length",d;s==="map"||s==="set"?(c="size",d=r.size):d=r.length,this.assert(d<=e,"expected #{this} to have a "+c+" at most #{exp} but got #{act}","expected #{this} to have a "+c+" above #{exp}",e,d)}else this.assert(r<=e,"expected #{this} to be at most #{exp}","expected #{this} to be above #{exp}",e)}x(Ai,"assertMost");h.addMethod("most",Ai);h.addMethod("lte",Ai);h.addMethod("lessThanOrEqual",Ai);h.addMethod("within",function(e,t,r){r&&w(this,"message",r);let n=w(this,"object"),o=w(this,"doLength"),i=w(this,"message"),a=i?i+": ":"",s=w(this,"ssfi"),l=Q(n).toLowerCase(),u=Q(e).toLowerCase(),f=Q(t).toLowerCase(),c,d=!0,b=u==="date"&&f==="date"?e.toISOString()+".."+t.toISOString():e+".."+t;if(o&&l!=="map"&&l!=="set"&&new h(n,i,s,!0).to.have.property("length"),!o&&l==="date"&&(u!=="date"||f!=="date"))c=a+"the arguments to within must be dates";else if((!ne(e)||!ne(t))&&(o||ne(n)))c=a+"the arguments to within must be numbers";else if(!o&&l!=="date"&&!ne(n)){let v=l==="string"?"'"+n+"'":n;c=a+"expected "+v+" to be a number or a date"}else d=!1;if(d)throw new G(c,void 0,s);if(o){let v="length",R;l==="map"||l==="set"?(v="size",R=n.size):R=n.length,this.assert(R>=e&&R<=t,"expected #{this} to have a "+v+" within "+b,"expected #{this} to not have a "+v+" within "+b)}else this.assert(n>=e&&n<=t,"expected #{this} to be within "+b,"expected #{this} to not be within "+b)});function Ga(e,t){t&&w(this,"message",t);let r=w(this,"object"),n=w(this,"ssfi"),o=w(this,"message"),i;try{i=r instanceof e}catch(s){throw s instanceof TypeError?(o=o?o+": ":"",new G(o+"The instanceof assertion needs a constructor but "+Q(e)+" was given.",void 0,n)):s}let a=qi(e);a==null&&(a="an unnamed constructor"),this.assert(i,"expected #{this} to be an instance of "+a,"expected #{this} to not be an instance of "+a)}x(Ga,"assertInstanceOf");h.addMethod("instanceof",Ga);h.addMethod("instanceOf",Ga);function Ka(e,t,r){r&&w(this,"message",r);let n=w(this,"nested"),o=w(this,"own"),i=w(this,"message"),a=w(this,"object"),s=w(this,"ssfi"),l=typeof e;if(i=i?i+": ":"",n){if(l!=="string")throw new G(i+"the argument to property must be a string when using nested syntax",void 0,s)}else if(l!=="string"&&l!=="number"&&l!=="symbol")throw new G(i+"the argument to property must be a string, number, or symbol",void 0,s);if(n&&o)throw new G(i+'The "nested" and "own" flags cannot be combined.',void 0,s);if(a==null)throw new G(i+"Target cannot be null or undefined.",void 0,s);let u=w(this,"deep"),f=w(this,"negate"),c=n?Oa(a,e):null,d=n?c.value:a[e],b=u?w(this,"eql"):(S,p)=>S===p,v="";u&&(v+="deep "),o&&(v+="own "),n&&(v+="nested "),v+="property ";let R;o?R=Object.prototype.hasOwnProperty.call(a,e):n?R=c.exists:R=xi(a,e),(!f||arguments.length===1)&&this.assert(R,"expected #{this} to have "+v+H(e),"expected #{this} to not have "+v+H(e)),arguments.length>1&&this.assert(R&&b(t,d),"expected #{this} to have "+v+H(e)+" of #{exp}, but got #{act}","expected #{this} to not have "+v+H(e)+" of #{act}",t,d),w(this,"object",d)}x(Ka,"assertProperty");h.addMethod("property",Ka);function Ya(e,t,r){w(this,"own",!0),Ka.apply(this,arguments)}x(Ya,"assertOwnProperty");h.addMethod("ownProperty",Ya);h.addMethod("haveOwnProperty",Ya);function Xa(e,t,r){typeof t=="string"&&(r=t,t=null),r&&w(this,"message",r);let n=w(this,"object"),o=Object.getOwnPropertyDescriptor(Object(n),e),i=w(this,"eql");o&&t?this.assert(i(t,o),"expected the own property descriptor for "+H(e)+" on #{this} to match "+H(t)+", got "+H(o),"expected the own property descriptor for "+H(e)+" on #{this} to not match "+H(t),t,o,!0):this.assert(o,"expected #{this} to have an own property descriptor for "+H(e),"expected #{this} to not have an own property descriptor for "+H(e)),w(this,"object",o)}x(Xa,"assertOwnPropertyDescriptor");h.addMethod("ownPropertyDescriptor",Xa);h.addMethod("haveOwnPropertyDescriptor",Xa);function Ja(){w(this,"doLength",!0)}x(Ja,"assertLengthChain");function Qa(e,t){t&&w(this,"message",t);let r=w(this,"object"),n=Q(r).toLowerCase(),o=w(this,"message"),i=w(this,"ssfi"),a="length",s;switch(n){case"map":case"set":a="size",s=r.size;break;default:new h(r,o,i,!0).to.have.property("length"),s=r.length}this.assert(s==e,"expected #{this} to have a "+a+" of #{exp} but got #{act}","expected #{this} to not have a "+a+" of #{act}",e,s)}x(Qa,"assertLength");h.addChainableMethod("length",Qa,Ja);h.addChainableMethod("lengthOf",Qa,Ja);function Za(e,t){t&&w(this,"message",t);let r=w(this,"object");this.assert(e.exec(r),"expected #{this} to match "+e,"expected #{this} not to match "+e)}x(Za,"assertMatch");h.addMethod("match",Za);h.addMethod("matches",Za);h.addMethod("string",function(e,t){t&&w(this,"message",t);let r=w(this,"object"),n=w(this,"message"),o=w(this,"ssfi");new h(r,n,o,!0).is.a("string"),this.assert(~r.indexOf(e),"expected #{this} to contain "+H(e),"expected #{this} to not contain "+H(e))});function es(e){let t=w(this,"object"),r=Q(t),n=Q(e),o=w(this,"ssfi"),i=w(this,"deep"),a,s="",l,u=!0,f=w(this,"message");f=f?f+": ":"";let c=f+"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=i?"deeply ":"",l=[],t.forEach(function(p,q){l.push(q)}),n!=="Array"&&(e=Array.prototype.slice.call(arguments));else{switch(l=Fa(t),n){case"Array":if(arguments.length>1)throw new G(c,void 0,o);break;case"Object":if(arguments.length>1)throw new G(c,void 0,o);e=Object.keys(e);break;default:e=Array.prototype.slice.call(arguments)}e=e.map(function(p){return typeof p=="symbol"?p:String(p)})}if(!e.length)throw new G(f+"keys required",void 0,o);let d=e.length,b=w(this,"any"),v=w(this,"all"),R=e,S=i?w(this,"eql"):(p,q)=>p===q;if(!b&&!v&&(v=!0),b&&(u=R.some(function(p){return l.some(function(q){return S(p,q)})})),v&&(u=R.every(function(p){return l.some(function(q){return S(p,q)})}),w(this,"contains")||(u=u&&e.length==l.length)),d>1){e=e.map(function(q){return H(q)});let p=e.pop();v&&(a=e.join(", ")+", and "+p),b&&(a=e.join(", ")+", or "+p)}else a=H(e[0]);a=(d>1?"keys ":"key ")+a,a=(w(this,"contains")?"contain ":"have ")+a,this.assert(u,"expected #{this} to "+s+a,"expected #{this} to not "+s+a,R.slice(0).sort(ui),l.sort(ui),!0)}x(es,"assertKeys");h.addMethod("keys",es);h.addMethod("key",es);function Mi(e,t,r){r&&w(this,"message",r);let n=w(this,"object"),o=w(this,"ssfi"),i=w(this,"message"),a=w(this,"negate")||!1;new h(n,i,o,!0).is.a("function"),(di(e)||typeof e=="string")&&(t=e,e=null);let s,l=!1;try{n()}catch(b){l=!0,s=b}let u=e===void 0&&t===void 0,f=!!(e&&t),c=!1,d=!1;if(u||!u&&!a){let b="an error";e instanceof Error?b="#{exp}":e&&(b=fe.getConstructorName(e));let v=s;if(s instanceof Error)v=s.toString();else if(typeof s=="string")v=s;else if(s&&(typeof s=="object"||typeof s=="function"))try{v=fe.getConstructorName(s)}catch{}this.assert(l,"expected #{this} to throw "+b,"expected #{this} to not throw an error but #{act} was thrown",e&&e.toString(),v)}if(e&&s&&(e instanceof Error&&fe.compatibleInstance(s,e)===a&&(f&&a?c=!0:this.assert(a,"expected #{this} to throw #{exp} but #{act} was thrown","expected #{this} to not throw #{exp}"+(s&&!a?" but #{act} was thrown":""),e.toString(),s.toString())),fe.compatibleConstructor(s,e)===a&&(f&&a?c=!0:this.assert(a,"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&&fe.getConstructorName(e),s instanceof Error?s.toString():s&&fe.getConstructorName(s)))),s&&t!==void 0&&t!==null){let b="including";di(t)&&(b="matching"),fe.compatibleMessage(s,t)===a&&(f&&a?d=!0:this.assert(a,"expected #{this} to throw error "+b+" #{exp} but got #{act}","expected #{this} to throw error not "+b+" #{exp}",t,fe.getMessage(s)))}c&&d&&this.assert(a,"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&&fe.getConstructorName(e),s instanceof Error?s.toString():s&&fe.getConstructorName(s)),w(this,"object",s)}x(Mi,"assertThrows");h.addMethod("throw",Mi);h.addMethod("throws",Mi);h.addMethod("Throw",Mi);function ts(e,t){t&&w(this,"message",t);let r=w(this,"object"),n=w(this,"itself"),o=typeof r=="function"&&!n?r.prototype[e]:r[e];this.assert(typeof o=="function","expected #{this} to respond to "+H(e),"expected #{this} to not respond to "+H(e))}x(ts,"respondTo");h.addMethod("respondTo",ts);h.addMethod("respondsTo",ts);h.addProperty("itself",function(){w(this,"itself",!0)});function rs(e,t){t&&w(this,"message",t);let r=w(this,"object"),n=e(r);this.assert(n,"expected #{this} to satisfy "+st(e),"expected #{this} to not satisfy"+st(e),!w(this,"negate"),n)}x(rs,"satisfy");h.addMethod("satisfy",rs);h.addMethod("satisfies",rs);function ns(e,t,r){r&&w(this,"message",r);let n=w(this,"object"),o=w(this,"message"),i=w(this,"ssfi");new h(n,o,i,!0).is.numeric;let a="A `delta` value is required for `closeTo`";if(t==null)throw new G(o?`${o}: ${a}`:a,void 0,i);if(new h(t,o,i,!0).is.numeric,a="A `expected` value is required for `closeTo`",e==null)throw new G(o?`${o}: ${a}`:a,void 0,i);new h(e,o,i,!0).is.numeric;const s=x(u=>u<0n?-u:u,"abs"),l=x(u=>parseFloat(parseFloat(u).toPrecision(12)),"strip");this.assert(l(s(n-e))<=t,"expected #{this} to be close to "+e+" +/- "+t,"expected #{this} not to be close to "+e+" +/- "+t)}x(ns,"closeTo");h.addMethod("closeTo",ns);h.addMethod("approximately",ns);function uf(e,t,r,n,o){let i=Array.from(t),a=Array.from(e);if(!n){if(a.length!==i.length)return!1;i=i.slice()}return a.every(function(s,l){if(o)return r?r(s,i[l]):s===i[l];if(!r){let u=i.indexOf(s);return u===-1?!1:(n||i.splice(u,1),!0)}return i.some(function(u,f){return r(s,u)?(n||i.splice(f,1),!0):!1})})}x(uf,"isSubsetOf");h.addMethod("members",function(e,t){t&&w(this,"message",t);let r=w(this,"object"),n=w(this,"message"),o=w(this,"ssfi");new h(r,n,o,!0).to.be.iterable,new h(e,n,o,!0).to.be.iterable;let i=w(this,"contains"),a=w(this,"ordered"),s,l,u;i?(s=a?"an ordered superset":"a superset",l="expected #{this} to be "+s+" of #{exp}",u="expected #{this} to not be "+s+" of #{exp}"):(s=a?"ordered members":"members",l="expected #{this} to have the same "+s+" as #{exp}",u="expected #{this} to not have the same "+s+" as #{exp}");let f=w(this,"deep")?w(this,"eql"):void 0;this.assert(uf(e,r,f,i,a),l,u,e,r,!0)});h.addProperty("iterable",function(e){e&&w(this,"message",e);let t=w(this,"object");this.assert(t!=null&&t[Symbol.iterator],"expected #{this} to be an iterable","expected #{this} to not be an iterable",t)});function cf(e,t){t&&w(this,"message",t);let r=w(this,"object"),n=w(this,"message"),o=w(this,"ssfi"),i=w(this,"contains"),a=w(this,"deep"),s=w(this,"eql");new h(e,n,o,!0).to.be.an("array"),i?this.assert(e.some(function(l){return r.indexOf(l)>-1}),"expected #{this} to contain one of #{exp}","expected #{this} to not contain one of #{exp}",e,r):a?this.assert(e.some(function(l){return s(r,l)}),"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)}x(cf,"oneOf");h.addMethod("oneOf",cf);function os(e,t,r){r&&w(this,"message",r);let n=w(this,"object"),o=w(this,"message"),i=w(this,"ssfi");new h(n,o,i,!0).is.a("function");let a;t?(new h(e,o,i,!0).to.have.property(t),a=e[t]):(new h(e,o,i,!0).is.a("function"),a=e()),n();let s=t==null?e():e[t],l=t==null?a:"."+t;w(this,"deltaMsgObj",l),w(this,"initialDeltaValue",a),w(this,"finalDeltaValue",s),w(this,"deltaBehavior","change"),w(this,"realDelta",s!==a),this.assert(a!==s,"expected "+l+" to change","expected "+l+" to not change")}x(os,"assertChanges");h.addMethod("change",os);h.addMethod("changes",os);function is(e,t,r){r&&w(this,"message",r);let n=w(this,"object"),o=w(this,"message"),i=w(this,"ssfi");new h(n,o,i,!0).is.a("function");let a;t?(new h(e,o,i,!0).to.have.property(t),a=e[t]):(new h(e,o,i,!0).is.a("function"),a=e()),new h(a,o,i,!0).is.a("number"),n();let s=t==null?e():e[t],l=t==null?a:"."+t;w(this,"deltaMsgObj",l),w(this,"initialDeltaValue",a),w(this,"finalDeltaValue",s),w(this,"deltaBehavior","increase"),w(this,"realDelta",s-a),this.assert(s-a>0,"expected "+l+" to increase","expected "+l+" to not increase")}x(is,"assertIncreases");h.addMethod("increase",is);h.addMethod("increases",is);function as(e,t,r){r&&w(this,"message",r);let n=w(this,"object"),o=w(this,"message"),i=w(this,"ssfi");new h(n,o,i,!0).is.a("function");let a;t?(new h(e,o,i,!0).to.have.property(t),a=e[t]):(new h(e,o,i,!0).is.a("function"),a=e()),new h(a,o,i,!0).is.a("number"),n();let s=t==null?e():e[t],l=t==null?a:"."+t;w(this,"deltaMsgObj",l),w(this,"initialDeltaValue",a),w(this,"finalDeltaValue",s),w(this,"deltaBehavior","decrease"),w(this,"realDelta",a-s),this.assert(s-a<0,"expected "+l+" to decrease","expected "+l+" to not decrease")}x(as,"assertDecreases");h.addMethod("decrease",as);h.addMethod("decreases",as);function df(e,t){t&&w(this,"message",t);let r=w(this,"deltaMsgObj"),n=w(this,"initialDeltaValue"),o=w(this,"finalDeltaValue"),i=w(this,"deltaBehavior"),a=w(this,"realDelta"),s;i==="change"?s=Math.abs(o-n)===Math.abs(e):s=a===Math.abs(e),this.assert(s,"expected "+r+" to "+i+" by "+e,"expected "+r+" to not "+i+" by "+e)}x(df,"assertDelta");h.addMethod("by",df);h.addProperty("extensible",function(){let e=w(this,"object"),t=e===Object(e)&&Object.isExtensible(e);this.assert(t,"expected #{this} to be extensible","expected #{this} to not be extensible")});h.addProperty("sealed",function(){let e=w(this,"object"),t=e===Object(e)?Object.isSealed(e):!0;this.assert(t,"expected #{this} to be sealed","expected #{this} to not be sealed")});h.addProperty("frozen",function(){let e=w(this,"object"),t=e===Object(e)?Object.isFrozen(e):!0;this.assert(t,"expected #{this} to be frozen","expected #{this} to not be frozen")});h.addProperty("finite",function(e){let t=w(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 fi(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 fi(r,n)})}):!1:e instanceof Date?t instanceof Date?e.getTime()===t.getTime():!1:Object.keys(e).every(function(r){let n=e[r],o=t[r];return typeof n=="object"&&n!==null&&o!==null?fi(n,o):typeof n=="function"?n(o):o===n}):!1}x(fi,"compareSubset");h.addMethod("containSubset",function(e){const t=U(this,"object"),r=ie.showDiff;this.assert(fi(e,t),"expected #{act} to contain subset #{exp}","expected #{act} to not contain subset #{exp}",e,t,r)});function Po(e,t){return new h(e,t)}x(Po,"expect");Po.fail=function(e,t,r,n){throw arguments.length<2&&(r=e,e=void 0),r=r||"expect.fail()",new G(r,{actual:e,expected:t,operator:n},Po.fail)};var ff={};qa(ff,{Should:()=>Vm,should:()=>zm});function ss(){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 h(this.valueOf(),null,e):new h(this,null,e)}x(e,"shouldGetter");function t(n){Object.defineProperty(this,"should",{value:n,enumerable:!0,configurable:!0,writable:!0})}x(t,"shouldSetter"),Object.defineProperty(Object.prototype,"should",{set:t,get:e,configurable:!0});let r={};return r.fail=function(n,o,i,a){throw arguments.length<2&&(i=n,n=void 0),i=i||"should.fail()",new G(i,{actual:n,expected:o,operator:a},r.fail)},r.equal=function(n,o,i){new h(n,i).to.equal(o)},r.Throw=function(n,o,i,a){new h(n,a).to.Throw(o,i)},r.exist=function(n,o){new h(n,o).to.exist},r.not={},r.not.equal=function(n,o,i){new h(n,i).to.not.equal(o)},r.not.Throw=function(n,o,i,a){new h(n,a).to.not.Throw(o,i)},r.not.exist=function(n,o){new h(n,o).to.not.exist},r.throw=r.Throw,r.not.throw=r.not.Throw,r}x(ss,"loadShould");var zm=ss,Vm=ss;function m(e,t){new h(null,null,m,!0).assert(e,t,"[ negation message unavailable ]")}x(m,"assert");m.fail=function(e,t,r,n){throw arguments.length<2&&(r=e,e=void 0),r=r||"assert.fail()",new G(r,{actual:e,expected:t,operator:n},m.fail)};m.isOk=function(e,t){new h(e,t,m.isOk,!0).is.ok};m.isNotOk=function(e,t){new h(e,t,m.isNotOk,!0).is.not.ok};m.equal=function(e,t,r){let n=new h(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 h(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 h(e,r,m.strictEqual,!0).to.equal(t)};m.notStrictEqual=function(e,t,r){new h(e,r,m.notStrictEqual,!0).to.not.equal(t)};m.deepEqual=m.deepStrictEqual=function(e,t,r){new h(e,r,m.deepEqual,!0).to.eql(t)};m.notDeepEqual=function(e,t,r){new h(e,r,m.notDeepEqual,!0).to.not.eql(t)};m.isAbove=function(e,t,r){new h(e,r,m.isAbove,!0).to.be.above(t)};m.isAtLeast=function(e,t,r){new h(e,r,m.isAtLeast,!0).to.be.least(t)};m.isBelow=function(e,t,r){new h(e,r,m.isBelow,!0).to.be.below(t)};m.isAtMost=function(e,t,r){new h(e,r,m.isAtMost,!0).to.be.most(t)};m.isTrue=function(e,t){new h(e,t,m.isTrue,!0).is.true};m.isNotTrue=function(e,t){new h(e,t,m.isNotTrue,!0).to.not.equal(!0)};m.isFalse=function(e,t){new h(e,t,m.isFalse,!0).is.false};m.isNotFalse=function(e,t){new h(e,t,m.isNotFalse,!0).to.not.equal(!1)};m.isNull=function(e,t){new h(e,t,m.isNull,!0).to.equal(null)};m.isNotNull=function(e,t){new h(e,t,m.isNotNull,!0).to.not.equal(null)};m.isNaN=function(e,t){new h(e,t,m.isNaN,!0).to.be.NaN};m.isNotNaN=function(e,t){new h(e,t,m.isNotNaN,!0).not.to.be.NaN};m.exists=function(e,t){new h(e,t,m.exists,!0).to.exist};m.notExists=function(e,t){new h(e,t,m.notExists,!0).to.not.exist};m.isUndefined=function(e,t){new h(e,t,m.isUndefined,!0).to.equal(void 0)};m.isDefined=function(e,t){new h(e,t,m.isDefined,!0).to.not.equal(void 0)};m.isCallable=function(e,t){new h(e,t,m.isCallable,!0).is.callable};m.isNotCallable=function(e,t){new h(e,t,m.isNotCallable,!0).is.not.callable};m.isObject=function(e,t){new h(e,t,m.isObject,!0).to.be.a("object")};m.isNotObject=function(e,t){new h(e,t,m.isNotObject,!0).to.not.be.a("object")};m.isArray=function(e,t){new h(e,t,m.isArray,!0).to.be.an("array")};m.isNotArray=function(e,t){new h(e,t,m.isNotArray,!0).to.not.be.an("array")};m.isString=function(e,t){new h(e,t,m.isString,!0).to.be.a("string")};m.isNotString=function(e,t){new h(e,t,m.isNotString,!0).to.not.be.a("string")};m.isNumber=function(e,t){new h(e,t,m.isNumber,!0).to.be.a("number")};m.isNotNumber=function(e,t){new h(e,t,m.isNotNumber,!0).to.not.be.a("number")};m.isNumeric=function(e,t){new h(e,t,m.isNumeric,!0).is.numeric};m.isNotNumeric=function(e,t){new h(e,t,m.isNotNumeric,!0).is.not.numeric};m.isFinite=function(e,t){new h(e,t,m.isFinite,!0).to.be.finite};m.isBoolean=function(e,t){new h(e,t,m.isBoolean,!0).to.be.a("boolean")};m.isNotBoolean=function(e,t){new h(e,t,m.isNotBoolean,!0).to.not.be.a("boolean")};m.typeOf=function(e,t,r){new h(e,r,m.typeOf,!0).to.be.a(t)};m.notTypeOf=function(e,t,r){new h(e,r,m.notTypeOf,!0).to.not.be.a(t)};m.instanceOf=function(e,t,r){new h(e,r,m.instanceOf,!0).to.be.instanceOf(t)};m.notInstanceOf=function(e,t,r){new h(e,r,m.notInstanceOf,!0).to.not.be.instanceOf(t)};m.include=function(e,t,r){new h(e,r,m.include,!0).include(t)};m.notInclude=function(e,t,r){new h(e,r,m.notInclude,!0).not.include(t)};m.deepInclude=function(e,t,r){new h(e,r,m.deepInclude,!0).deep.include(t)};m.notDeepInclude=function(e,t,r){new h(e,r,m.notDeepInclude,!0).not.deep.include(t)};m.nestedInclude=function(e,t,r){new h(e,r,m.nestedInclude,!0).nested.include(t)};m.notNestedInclude=function(e,t,r){new h(e,r,m.notNestedInclude,!0).not.nested.include(t)};m.deepNestedInclude=function(e,t,r){new h(e,r,m.deepNestedInclude,!0).deep.nested.include(t)};m.notDeepNestedInclude=function(e,t,r){new h(e,r,m.notDeepNestedInclude,!0).not.deep.nested.include(t)};m.ownInclude=function(e,t,r){new h(e,r,m.ownInclude,!0).own.include(t)};m.notOwnInclude=function(e,t,r){new h(e,r,m.notOwnInclude,!0).not.own.include(t)};m.deepOwnInclude=function(e,t,r){new h(e,r,m.deepOwnInclude,!0).deep.own.include(t)};m.notDeepOwnInclude=function(e,t,r){new h(e,r,m.notDeepOwnInclude,!0).not.deep.own.include(t)};m.match=function(e,t,r){new h(e,r,m.match,!0).to.match(t)};m.notMatch=function(e,t,r){new h(e,r,m.notMatch,!0).to.not.match(t)};m.property=function(e,t,r){new h(e,r,m.property,!0).to.have.property(t)};m.notProperty=function(e,t,r){new h(e,r,m.notProperty,!0).to.not.have.property(t)};m.propertyVal=function(e,t,r,n){new h(e,n,m.propertyVal,!0).to.have.property(t,r)};m.notPropertyVal=function(e,t,r,n){new h(e,n,m.notPropertyVal,!0).to.not.have.property(t,r)};m.deepPropertyVal=function(e,t,r,n){new h(e,n,m.deepPropertyVal,!0).to.have.deep.property(t,r)};m.notDeepPropertyVal=function(e,t,r,n){new h(e,n,m.notDeepPropertyVal,!0).to.not.have.deep.property(t,r)};m.ownProperty=function(e,t,r){new h(e,r,m.ownProperty,!0).to.have.own.property(t)};m.notOwnProperty=function(e,t,r){new h(e,r,m.notOwnProperty,!0).to.not.have.own.property(t)};m.ownPropertyVal=function(e,t,r,n){new h(e,n,m.ownPropertyVal,!0).to.have.own.property(t,r)};m.notOwnPropertyVal=function(e,t,r,n){new h(e,n,m.notOwnPropertyVal,!0).to.not.have.own.property(t,r)};m.deepOwnPropertyVal=function(e,t,r,n){new h(e,n,m.deepOwnPropertyVal,!0).to.have.deep.own.property(t,r)};m.notDeepOwnPropertyVal=function(e,t,r,n){new h(e,n,m.notDeepOwnPropertyVal,!0).to.not.have.deep.own.property(t,r)};m.nestedProperty=function(e,t,r){new h(e,r,m.nestedProperty,!0).to.have.nested.property(t)};m.notNestedProperty=function(e,t,r){new h(e,r,m.notNestedProperty,!0).to.not.have.nested.property(t)};m.nestedPropertyVal=function(e,t,r,n){new h(e,n,m.nestedPropertyVal,!0).to.have.nested.property(t,r)};m.notNestedPropertyVal=function(e,t,r,n){new h(e,n,m.notNestedPropertyVal,!0).to.not.have.nested.property(t,r)};m.deepNestedPropertyVal=function(e,t,r,n){new h(e,n,m.deepNestedPropertyVal,!0).to.have.deep.nested.property(t,r)};m.notDeepNestedPropertyVal=function(e,t,r,n){new h(e,n,m.notDeepNestedPropertyVal,!0).to.not.have.deep.nested.property(t,r)};m.lengthOf=function(e,t,r){new h(e,r,m.lengthOf,!0).to.have.lengthOf(t)};m.hasAnyKeys=function(e,t,r){new h(e,r,m.hasAnyKeys,!0).to.have.any.keys(t)};m.hasAllKeys=function(e,t,r){new h(e,r,m.hasAllKeys,!0).to.have.all.keys(t)};m.containsAllKeys=function(e,t,r){new h(e,r,m.containsAllKeys,!0).to.contain.all.keys(t)};m.doesNotHaveAnyKeys=function(e,t,r){new h(e,r,m.doesNotHaveAnyKeys,!0).to.not.have.any.keys(t)};m.doesNotHaveAllKeys=function(e,t,r){new h(e,r,m.doesNotHaveAllKeys,!0).to.not.have.all.keys(t)};m.hasAnyDeepKeys=function(e,t,r){new h(e,r,m.hasAnyDeepKeys,!0).to.have.any.deep.keys(t)};m.hasAllDeepKeys=function(e,t,r){new h(e,r,m.hasAllDeepKeys,!0).to.have.all.deep.keys(t)};m.containsAllDeepKeys=function(e,t,r){new h(e,r,m.containsAllDeepKeys,!0).to.contain.all.deep.keys(t)};m.doesNotHaveAnyDeepKeys=function(e,t,r){new h(e,r,m.doesNotHaveAnyDeepKeys,!0).to.not.have.any.deep.keys(t)};m.doesNotHaveAllDeepKeys=function(e,t,r){new h(e,r,m.doesNotHaveAllDeepKeys,!0).to.not.have.all.deep.keys(t)};m.throws=function(e,t,r,n){(typeof t=="string"||t instanceof RegExp)&&(r=t,t=null);let o=new h(e,n,m.throws,!0).to.throw(t,r);return U(o,"object")};m.doesNotThrow=function(e,t,r,n){(typeof t=="string"||t instanceof RegExp)&&(r=t,t=null),new h(e,n,m.doesNotThrow,!0).to.not.throw(t,r)};m.operator=function(e,t,r,n){let o;switch(t){case"==":o=e==r;break;case"===":o=e===r;break;case">":o=e>r;break;case">=":o=e>=r;break;case"<":o=e<r;break;case"<=":o=e<=r;break;case"!=":o=e!=r;break;case"!==":o=e!==r;break;default:throw n=n&&n+": ",new G(n+'Invalid operator "'+t+'"',void 0,m.operator)}let i=new h(o,n,m.operator,!0);i.assert(U(i,"object")===!0,"expected "+H(e)+" to be "+t+" "+H(r),"expected "+H(e)+" to not be "+t+" "+H(r))};m.closeTo=function(e,t,r,n){new h(e,n,m.closeTo,!0).to.be.closeTo(t,r)};m.approximately=function(e,t,r,n){new h(e,n,m.approximately,!0).to.be.approximately(t,r)};m.sameMembers=function(e,t,r){new h(e,r,m.sameMembers,!0).to.have.same.members(t)};m.notSameMembers=function(e,t,r){new h(e,r,m.notSameMembers,!0).to.not.have.same.members(t)};m.sameDeepMembers=function(e,t,r){new h(e,r,m.sameDeepMembers,!0).to.have.same.deep.members(t)};m.notSameDeepMembers=function(e,t,r){new h(e,r,m.notSameDeepMembers,!0).to.not.have.same.deep.members(t)};m.sameOrderedMembers=function(e,t,r){new h(e,r,m.sameOrderedMembers,!0).to.have.same.ordered.members(t)};m.notSameOrderedMembers=function(e,t,r){new h(e,r,m.notSameOrderedMembers,!0).to.not.have.same.ordered.members(t)};m.sameDeepOrderedMembers=function(e,t,r){new h(e,r,m.sameDeepOrderedMembers,!0).to.have.same.deep.ordered.members(t)};m.notSameDeepOrderedMembers=function(e,t,r){new h(e,r,m.notSameDeepOrderedMembers,!0).to.not.have.same.deep.ordered.members(t)};m.includeMembers=function(e,t,r){new h(e,r,m.includeMembers,!0).to.include.members(t)};m.notIncludeMembers=function(e,t,r){new h(e,r,m.notIncludeMembers,!0).to.not.include.members(t)};m.includeDeepMembers=function(e,t,r){new h(e,r,m.includeDeepMembers,!0).to.include.deep.members(t)};m.notIncludeDeepMembers=function(e,t,r){new h(e,r,m.notIncludeDeepMembers,!0).to.not.include.deep.members(t)};m.includeOrderedMembers=function(e,t,r){new h(e,r,m.includeOrderedMembers,!0).to.include.ordered.members(t)};m.notIncludeOrderedMembers=function(e,t,r){new h(e,r,m.notIncludeOrderedMembers,!0).to.not.include.ordered.members(t)};m.includeDeepOrderedMembers=function(e,t,r){new h(e,r,m.includeDeepOrderedMembers,!0).to.include.deep.ordered.members(t)};m.notIncludeDeepOrderedMembers=function(e,t,r){new h(e,r,m.notIncludeDeepOrderedMembers,!0).to.not.include.deep.ordered.members(t)};m.oneOf=function(e,t,r){new h(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 ${H(e)} to be an iterable`:`expected ${H(e)} to be an iterable`,new G(t,void 0,m.isIterable)};m.changes=function(e,t,r,n){arguments.length===3&&typeof t=="function"&&(n=r,r=null),new h(e,n,m.changes,!0).to.change(t,r)};m.changesBy=function(e,t,r,n,o){if(arguments.length===4&&typeof t=="function"){let i=n;n=r,o=i}else arguments.length===3&&(n=r,r=null);new h(e,o,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 h(e,n,m.doesNotChange,!0).to.not.change(t,r)};m.changesButNotBy=function(e,t,r,n,o){if(arguments.length===4&&typeof t=="function"){let i=n;n=r,o=i}else arguments.length===3&&(n=r,r=null);new h(e,o,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 h(e,n,m.increases,!0).to.increase(t,r)};m.increasesBy=function(e,t,r,n,o){if(arguments.length===4&&typeof t=="function"){let i=n;n=r,o=i}else arguments.length===3&&(n=r,r=null);new h(e,o,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 h(e,n,m.doesNotIncrease,!0).to.not.increase(t,r)};m.increasesButNotBy=function(e,t,r,n,o){if(arguments.length===4&&typeof t=="function"){let i=n;n=r,o=i}else arguments.length===3&&(n=r,r=null);new h(e,o,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 h(e,n,m.decreases,!0).to.decrease(t,r)};m.decreasesBy=function(e,t,r,n,o){if(arguments.length===4&&typeof t=="function"){let i=n;n=r,o=i}else arguments.length===3&&(n=r,r=null);new h(e,o,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 h(e,n,m.doesNotDecrease,!0).to.not.decrease(t,r)};m.doesNotDecreaseBy=function(e,t,r,n,o){if(arguments.length===4&&typeof t=="function"){let i=n;n=r,o=i}else arguments.length===3&&(n=r,r=null);return new h(e,o,m.doesNotDecreaseBy,!0).to.not.decrease(t,r).by(n)};m.decreasesButNotBy=function(e,t,r,n,o){if(arguments.length===4&&typeof t=="function"){let i=n;n=r,o=i}else arguments.length===3&&(n=r,r=null);new h(e,o,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 h(e,t,m.isExtensible,!0).to.be.extensible};m.isNotExtensible=function(e,t){new h(e,t,m.isNotExtensible,!0).to.not.be.extensible};m.isSealed=function(e,t){new h(e,t,m.isSealed,!0).to.be.sealed};m.isNotSealed=function(e,t){new h(e,t,m.isNotSealed,!0).to.not.be.sealed};m.isFrozen=function(e,t){new h(e,t,m.isFrozen,!0).to.be.frozen};m.isNotFrozen=function(e,t){new h(e,t,m.isNotFrozen,!0).to.not.be.frozen};m.isEmpty=function(e,t){new h(e,t,m.isEmpty,!0).to.be.empty};m.isNotEmpty=function(e,t){new h(e,t,m.isNotEmpty,!0).to.not.be.empty};m.containsSubset=function(e,t,r){new h(e,r).to.containSubset(t)};m.doesNotContainSubset=function(e,t,r){new h(e,r).to.not.containSubset(t)};var Hm=[["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"]];for(const[e,t]of Hm)m[t]=m[e];var Is=[];function pf(e){const t={use:pf,AssertionError:G,util:ai,config:ie,expect:Po,assert:m,Assertion:h,...ff};return~Is.indexOf(e)||(e(t,ai),Is.push(e)),t}x(pf,"use");function Wm(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}const Gm=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},Km={animation:"spin 1s linear infinite"},Ym=()=>B.jsxRuntimeExports.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"#364153",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"lucide lucide-loader-circle-icon lucide-loader-circle",style:Km,"data-testid":"loader-icon",children:B.jsxRuntimeExports.jsx("path",{d:"M21 12a9 9 0 1 1-6.219-8.56"})}),zo=document.createElement("style");zo&&!document.getElementById("loader-spin-keyframes")&&(zo.id="loader-spin-keyframes",zo.innerHTML=`
3
3
  @keyframes spin {
4
4
  0% { transform: rotate(0deg); }
@@ -66,4 +66,4 @@ Unable to find an `+(n===!1?"accessible ":"")+'element with the role "'+t+'"'+l+
66
66
  `))}function kE(e){return e.reverse().map((t,r)=>["".padEnd(r),t.tagName,t.id&&`#${t.id}`,t.hasAttribute("data-testid")&&`(testId=${t.getAttribute("data-testid")})`,jE(t),e.length>1&&r===0&&" <-- This element declared `pointer-events: none`",e.length>1&&r===e.length-1&&" <-- Asserted pointer events here"].filter(Boolean).join("")).join(`
67
67
  `)}function jE(e){var t;let r;if(e.hasAttribute("aria-label"))r=e.getAttribute("aria-label");else if(e.hasAttribute("aria-labelledby")){var n,o;r=(o=e.ownerDocument.getElementById(e.getAttribute("aria-labelledby")))===null||o===void 0||(n=o.textContent)===null||n===void 0?void 0:n.trim()}else if(z(e,["button","input","meter","output","progress","select","textarea"])&&(!((t=e.labels)===null||t===void 0)&&t.length))r=Array.from(e.labels).map(a=>{var s;return(s=a.textContent)===null||s===void 0?void 0:s.trim()}).join("|");else if(z(e,"button")){var i;r=(i=e.textContent)===null||i===void 0?void 0:i.trim()}return r=r?.replace(/\n/g," "),Number(r?.length)>30&&(r=`${r?.substring(0,29)}…`),r?`(label=${r})`:""}function cd(e,t){return(e&t)>0}function je(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}class DE{init(t){const r=this.getTarget(t),[,n]=_o(null,r),o=this.getEventInit();return Eo(t,r),t.dispatchUIEvent(r,"pointerover",o),n.forEach(i=>t.dispatchUIEvent(i,"pointerenter",o)),this}move(t,r){const n=this.position,o=this.getTarget(t);if(this.position=r,!Rp(n,r))return;const i=this.getTarget(t),a=this.getEventInit(-1),[s,l]=_o(o,i);return{leave:()=>{Ri(t,o)&&o!==i&&(t.dispatchUIEvent(o,"pointerout",a),s.forEach(u=>t.dispatchUIEvent(u,"pointerleave",a)))},enter:()=>{Eo(t,i),o!==i&&(t.dispatchUIEvent(i,"pointerover",a),l.forEach(u=>t.dispatchUIEvent(u,"pointerenter",a)))},move:()=>{t.dispatchUIEvent(i,"pointermove",a)}}}down(t,r=0){if(this.isDown)return;const n=this.getTarget(t);Eo(t,n),this.isDown=!0,this.isPrevented=!t.dispatchUIEvent(n,"pointerdown",this.getEventInit(r))}up(t,r=0){if(!this.isDown)return;const n=this.getTarget(t);Eo(t,n),this.isPrevented=!1,this.isDown=!1,t.dispatchUIEvent(n,"pointerup",this.getEventInit(r))}release(t){const r=this.getTarget(t),[n]=_o(r,null),o=this.getEventInit();Ri(t,r)&&(t.dispatchUIEvent(r,"pointerout",o),n.forEach(i=>t.dispatchUIEvent(i,"pointerleave",o))),this.isCancelled=!0}getTarget(t){var r;return(r=this.position.target)!==null&&r!==void 0?r:t.config.document.body}getEventInit(t){return{...this.position.coords,pointerId:this.pointerId,pointerType:this.pointerType,isPrimary:this.isPrimary,button:wa(t),buttons:this.buttons.getButtons()}}constructor({pointerId:t,pointerType:r,isPrimary:n},o){je(this,"pointerId",void 0),je(this,"pointerType",void 0),je(this,"isPrimary",void 0),je(this,"buttons",void 0),je(this,"isMultitouch",!1),je(this,"isCancelled",!1),je(this,"isDown",!1),je(this,"isPrevented",!1),je(this,"position",{}),this.pointerId=t,this.pointerType=r,this.isPrimary=n,this.isMultitouch=!n,this.buttons=o}}function Ke(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}class $E{isKeyPressed(t){return this.devices.get(t.pointerType).isPressed(t)}async press(t,r,n){this.devices.get(r.pointerType).addPressed(r),this.buttons.down(r);const o=this.getPointerName(r),i=r.pointerType==="touch"?this.pointers.new(o,r.pointerType,this.buttons):this.pointers.get(o);i.position=n,i.pointerType!=="touch"&&(this.mouse.position=n),i.pointerType==="touch"&&i.init(t),i.down(t,r.button),i.pointerType!=="touch"&&this.mouse.down(t,r,i.isPrevented)}async move(t,r,n){const o=this.pointers.get(r),i=o.move(t,n),a=o.pointerType==="touch"?void 0:this.mouse.move(t,n,o.isPrevented);i?.leave(),a?.leave(),i?.enter(),a?.enter(),i?.move(),a?.move()}async release(t,r,n){const o=this.devices.get(r.pointerType);o.removePressed(r),this.buttons.up(r);const i=this.pointers.get(this.getPointerName(r)),a=i.isPrevented;if(i.position=n,i.pointerType!=="touch"&&(this.mouse.position=n),o.countPressed===0&&i.up(t,r.button),i.pointerType==="touch"&&i.release(t),i.pointerType==="touch"&&!i.isMultitouch){const s=this.mouse.move(t,n,a);s?.leave(),s?.enter(),s?.move(),this.mouse.down(t,r,a)}if(!i.isMultitouch){const s=this.mouse.move(t,n,a);s?.leave(),s?.enter(),s?.move(),this.mouse.up(t,r,a)}}getPointerName(t){return t.pointerType==="touch"?t.name:t.pointerType}getPreviousPosition(t){return this.pointers.has(t)?this.pointers.get(t).position:void 0}resetClickCount(){this.mouse.resetClickCount()}getMouseTarget(t){var r;return(r=this.mouse.position.target)!==null&&r!==void 0?r:t.config.document.body}setMousePosition(t){this.mouse.position=t,this.pointers.get("mouse").position=t}constructor(t){Ke(this,"system",void 0),Ke(this,"mouse",void 0),Ke(this,"buttons",void 0),Ke(this,"devices",new class{get(r){var n,o,i;return(i=(n=this.registry)[o=r])!==null&&i!==void 0?i:n[o]=new SE}constructor(){Ke(this,"registry",{})}}),Ke(this,"pointers",new class{new(r,n,o){const i=n!=="touch"||!Object.values(this.registry).some(a=>a.pointerType==="touch"&&!a.isCancelled);return i||Object.values(this.registry).forEach(a=>{a.pointerType===n&&!a.isCancelled&&(a.isMultitouch=!0)}),this.registry[r]=new DE({pointerId:this.nextId++,pointerType:n,isPrimary:i},o),this.registry[r]}get(r){if(!this.has(r))throw new Error(`Trying to access pointer "${r}" which does not exist.`);return this.registry[r]}has(r){return r in this.registry}constructor(){Ke(this,"registry",{}),Ke(this,"nextId",1)}}),this.system=t,this.buttons=new yp,this.mouse=new IE,this.pointers.new("mouse","mouse",this.buttons)}}function dd(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}class Ep{getUIEventModifiers(){return{altKey:this.keyboard.modifiers.Alt,ctrlKey:this.keyboard.modifiers.Control,metaKey:this.keyboard.modifiers.Meta,shiftKey:this.keyboard.modifiers.Shift,modifierAltGraph:this.keyboard.modifiers.AltGraph,modifierCapsLock:this.keyboard.modifiers.CapsLock,modifierFn:this.keyboard.modifiers.Fn,modifierFnLock:this.keyboard.modifiers.FnLock,modifierNumLock:this.keyboard.modifiers.NumLock,modifierScrollLock:this.keyboard.modifiers.ScrollLock,modifierSymbol:this.keyboard.modifiers.Symbol,modifierSymbolLock:this.keyboard.modifiers.SymbolLock}}constructor(){dd(this,"keyboard",new CE(this)),dd(this,"pointer",new $E(this))}}async function BE(e){const t=[];return this.config.skipHover||t.push({target:e}),t.push({keys:"[MouseLeft]",target:e}),this.pointer(t)}async function LE(e){return this.pointer([{target:e},"[MouseLeft][MouseLeft]"])}async function FE(e){return this.pointer([{target:e},"[MouseLeft][MouseLeft][MouseLeft]"])}async function UE(e){return this.pointer({target:e})}async function zE(e){return Eo(this,this.system.pointer.getMouseTarget(this)),this.pointer({target:e.ownerDocument.body})}async function VE({shift:e}={}){return this.keyboard(e===!0?"{Shift>}{Tab}{/Shift}":e===!1?"[/ShiftLeft][/ShiftRight]{Tab}":"{Tab}")}var xs=(function(e){return e["{"]="}",e["["]="]",e})(xs||{});function xp(e,t){let r=0;const n=e[r]in xs?e[r]:"";r+=n.length;const i=new RegExp(`^\\${n}{2}`).test(e)?"":n;return{type:i,...i===""?HE(e,r,t):WE(e,r,i,t)}}function HE(e,t,r){const n=e[t];return Cp(n,e,t,r),t+=n.length,{consumedLength:t,descriptor:n,releasePrevious:!1,releaseSelf:!0,repeat:1}}function WE(e,t,r,n){var o,i;const a=e[t]==="/"?"/":"";t+=a.length;const s=r==="{"&&e[t]==="\\";t+=Number(s);const l=s?e[t]:(o=e.slice(t).match(r==="{"?/^\w+|^[^}>/]/:/^\w+/))===null||o===void 0?void 0:o[0];Cp(l,e,t,n),t+=l.length;var u;const f=(u=(i=e.slice(t).match(/^>\d+/))===null||i===void 0?void 0:i[0])!==null&&u!==void 0?u:"";t+=f.length;const c=e[t]==="/"||!f&&e[t]===">"?e[t]:"";t+=c.length;const d=xs[r],b=e[t]===d?d:"";if(!b)throw new Error(qp([!f&&"repeat modifier",!c&&"release modifier",`"${d}"`].filter(Boolean).join(" or "),e[t],e,n));return t+=b.length,{consumedLength:t,descriptor:l,releasePrevious:!!a,repeat:f?Math.max(Number(f.substr(1)),1):1,releaseSelf:GE(c,f)}}function Cp(e,t,r,n){if(!e)throw new Error(qp("key descriptor",t[r],t,n))}function GE(e,t){if(e)return e==="/";if(t)return!1}function qp(e,t,r,n){return`Expected ${e} but found "${t??""}" in "${r}"
68
68
  See ${n==="pointer"?"https://testing-library.com/docs/user-event/pointer#pressing-a-button-or-touching-the-screen":"https://testing-library.com/docs/user-event/keyboard"}
69
- for more information about how userEvent parses your input.`}function KE(e,t){const r=[];do{const{type:o,descriptor:i,consumedLength:a,releasePrevious:s,releaseSelf:l=!0,repeat:u}=xp(t,"keyboard");var n;const f=(n=e.find(c=>{if(o==="["){var d;return((d=c.code)===null||d===void 0?void 0:d.toLowerCase())===i.toLowerCase()}else if(o==="{"){var b;return((b=c.key)===null||b===void 0?void 0:b.toLowerCase())===i.toLowerCase()}return c.key===i}))!==null&&n!==void 0?n:{key:"Unknown",code:"Unknown",[o==="["?"code":"key"]:i};r.push({keyDef:f,releasePrevious:s,releaseSelf:l,repeat:u}),t=t.slice(a)}while(t);return r}async function YE(e){const t=KE(this.config.keyboardMap,e);for(let r=0;r<t.length;r++)await qt(this.config),await XE(this,t[r])}async function XE(e,{keyDef:t,releasePrevious:r,releaseSelf:n,repeat:o}){const{system:i}=e;if(i.keyboard.isKeyPressed(t)&&await i.keyboard.keyup(e,t),!r){for(let a=1;a<=o;a++)await i.keyboard.keydown(e,t),a<o&&await qt(e.config);n&&await i.keyboard.keyup(e,t)}}async function JE(e){for(const t of e.system.keyboard.getPressedKeys())await e.system.keyboard.keyup(e,t)}function _p(e){const t=_e(e)?{"text/plain":QE(e)}:{"text/plain":String(e.ownerDocument.getSelection())},r=us(ve(e));for(const n in t)t[n]&&r.setData(n,t[n]);return r}function QE(e){const t=Oo(e);return Pe(e).substring(t.startOffset,t.endOffset)}async function ZE(){const e=this.config.document;var t;const r=(t=e.activeElement)!==null&&t!==void 0?t:e.body,n=_p(r);if(n.items.length!==0)return this.dispatchUIEvent(r,"copy",{clipboardData:n})&&this.config.writeToClipboard&&await gf(e,n),n}async function ex(){const e=this.config.document;var t;const r=(t=e.activeElement)!==null&&t!==void 0?t:e.body,n=_p(r);if(n.items.length!==0)return this.dispatchUIEvent(r,"cut",{clipboardData:n})&&this.config.writeToClipboard&&await gf(r.ownerDocument,n),n}async function tx(e){const t=this.config.document;var r;const n=(r=t.activeElement)!==null&&r!==void 0?r:t.body;var o;const i=(o=typeof e=="string"?rx(t,e):e)!==null&&o!==void 0?o:await wh(t).catch(()=>{throw new Error("`userEvent.paste()` without `clipboardData` requires the `ClipboardAPI` to be available.")});this.dispatchUIEvent(n,"paste",{clipboardData:i})}function rx(e,t){const r=us(ve(e));return r.setData("text",t),r}function fd(e,t){const r=[];do{const{descriptor:n,consumedLength:o,releasePrevious:i,releaseSelf:a=!0}=xp(t,"pointer"),s=e.find(l=>l.name===n);s&&r.push({keyDef:s,releasePrevious:i,releaseSelf:a}),t=t.slice(o)}while(t);return r}async function nx(e){const{pointerMap:t}=this.config,r=[];(Array.isArray(e)?e:[e]).forEach(n=>{typeof n=="string"?r.push(...fd(t,n)):"keys"in n?r.push(...fd(t,n.keys).map(o=>({...n,...o}))):r.push(n)});for(let n=0;n<r.length;n++)await qt(this.config),await ox(this,r[n]);this.system.pointer.resetClickCount()}async function ox(e,t){var r,n;const o="pointerName"in t&&t.pointerName?t.pointerName:"keyDef"in t?e.system.pointer.getPointerName(t.keyDef):"mouse",i=e.system.pointer.getPreviousPosition(o);var a,s,l,u;const f={target:(a=t.target)!==null&&a!==void 0?a:ix(e,i),coords:(s=t.coords)!==null&&s!==void 0?s:i?.coords,caret:{node:(l=t.node)!==null&&l!==void 0?l:pd(t)||i==null||(r=i.caret)===null||r===void 0?void 0:r.node,offset:(u=t.offset)!==null&&u!==void 0?u:pd(t)||i==null||(n=i.caret)===null||n===void 0?void 0:n.offset}};"keyDef"in t?(e.system.pointer.isKeyPressed(t.keyDef)&&(wo(e,pe.Trigger),await e.system.pointer.release(e,t.keyDef,f)),t.releasePrevious||(wo(e,pe.Trigger),await e.system.pointer.press(e,t.keyDef,f),t.releaseSelf&&(wo(e,pe.Trigger),await e.system.pointer.release(e,t.keyDef,f)))):(wo(e,pe.Trigger),await e.system.pointer.move(e,o,f))}function pd(e){var t,r;return!!((r=(t=e.target)!==null&&t!==void 0?t:e.node)!==null&&r!==void 0?r:e.offset!==void 0)}function ix(e,t){if(!t)throw new Error("This pointer has no previous position. Provide a target property!");var r;return(r=t.target)!==null&&r!==void 0?r:e.config.document.body}async function ax(e){if(!wt(e)||Le(e))throw new Error("clear()` is only supported on editable elements.");if(Qe(e),e.ownerDocument.activeElement!==e)throw new Error("The element to be cleared could not be focused.");if(dp(e),!tE(e))throw new Error("The element content to be cleared could not be selected.");Ct(this,e,"","deleteContentBackward")}async function sx(e,t){return Pp.call(this,!0,e,t)}async function lx(e,t){return Pp.call(this,!1,e,t)}async function Pp(e,t,r){if(!e&&!t.multiple)throw K().getElementError("Unable to deselect an option in a non-multiple select. Use selectOptions to change the selection instead.",t);const n=Array.isArray(r)?r:[r],o=Array.from(t.querySelectorAll('option, [role="option"]')),i=n.map(s=>{if(typeof s!="string"&&o.includes(s))return s;{const l=o.find(u=>u.value===s||u.innerHTML===s);if(l)return l;throw K().getElementError(`Value "${String(s)}" not found in options`,t)}}).filter(s=>!Le(s));if(Le(t)||!i.length)return;const a=s=>{s.selected=e,this.dispatchUIEvent(t,"input",{bubbles:!0,cancelable:!1,composed:!0}),this.dispatchUIEvent(t,"change")};if(z(t,"select"))if(t.multiple)for(const s of i){const l=this.config.pointerEventsCheck===0?!0:Ri(this,s);l&&(this.dispatchUIEvent(s,"pointerover"),this.dispatchUIEvent(t,"pointerenter"),this.dispatchUIEvent(s,"mouseover"),this.dispatchUIEvent(t,"mouseenter"),this.dispatchUIEvent(s,"pointermove"),this.dispatchUIEvent(s,"mousemove"),this.dispatchUIEvent(s,"pointerdown"),this.dispatchUIEvent(s,"mousedown")),Qe(t),l&&(this.dispatchUIEvent(s,"pointerup"),this.dispatchUIEvent(s,"mouseup")),a(s),l&&this.dispatchUIEvent(s,"click"),await qt(this.config)}else if(i.length===1){const s=this.config.pointerEventsCheck===0?!0:Ri(this,t);s?await this.click(t):Qe(t),a(i[0]),s&&(this.dispatchUIEvent(t,"pointerover"),this.dispatchUIEvent(t,"pointerenter"),this.dispatchUIEvent(t,"mouseover"),this.dispatchUIEvent(t,"mouseenter"),this.dispatchUIEvent(t,"pointerup"),this.dispatchUIEvent(t,"mouseup"),this.dispatchUIEvent(t,"click")),await qt(this.config)}else throw K().getElementError("Cannot select multiple options on a non-multiple select",t);else if(t.getAttribute("role")==="listbox")for(const s of i)await this.click(s),await this.unhover(s);else throw K().getElementError("Cannot select options on elements that are neither select nor listbox elements",t)}async function ux(e,t,{skipClick:r=this.config.skipClick,skipAutoClose:n=this.config.skipAutoClose,initialSelectionStart:o,initialSelectionEnd:i}={}){e.disabled||(r||await this.click(e),o!==void 0&&Ro(e,o,i??o),await this.keyboard(t),n||await JE(this))}const md=Symbol("files and value properties are mocked");function Ki(e,t,r){r?Object.defineProperty(e,t,r):delete e[t]}function cx(e,t){var r;(r=e[md])===null||r===void 0||r.restore();const n=Object.getOwnPropertyDescriptor(e,"type"),o=Object.getOwnPropertyDescriptor(e,"value"),i=Object.getOwnPropertyDescriptor(e,"files");function a(){Ki(e,"type",n),Ki(e,"value",o),Ki(e,"files",i)}e[md]={restore:a},Object.defineProperties(e,{files:{configurable:!0,get:()=>t},value:{configurable:!0,get:()=>t.length?`C:\\fakepath\\${t[0].name}`:"",set(s){if(s==="")a();else{var l;o==null||(l=o.set)===null||l===void 0||l.call(e,s)}}},type:{configurable:!0,get:()=>"file",set(s){s!=="file"&&(a(),e.type=s)}}})}async function dx(e,t){const r=z(e,"label")?e.control:e;if(!r||!z(r,"input",{type:"file"}))throw new TypeError(`The ${r===e?"given":"associated"} ${r?.tagName} element does not accept file uploads`);if(Le(e))return;const n=(Array.isArray(t)?t:[t]).filter(i=>!this.config.applyAccept||fx(i,r.accept)).slice(0,r.multiple?void 0:1),o=()=>{var i;n.length===((i=r.files)===null||i===void 0?void 0:i.length)&&n.every((a,s)=>{var l;return a===((l=r.files)===null||l===void 0?void 0:l.item(s))})||(cx(r,ls(ve(e),n)),this.dispatchUIEvent(r,"input"),this.dispatchUIEvent(r,"change"))};r.addEventListener("fileDialog",o),await this.click(e),r.removeEventListener("fileDialog",o)}function Qo(e){return e.toLowerCase().replace(/(\.|\/)jpg\b/g,"$1jpeg")}function fx(e,t){if(!t)return!0;const r=["audio/*","image/*","video/*"];return Qo(t).trim().split(/\s*,\s*/).some(n=>n.startsWith(".")?Qo(e.name).endsWith(n):r.includes(n)?Qo(e.type).startsWith(n.replace("*","")):Qo(e.type)===n)}const hd={click:BE,dblClick:LE,tripleClick:FE,hover:UE,unhover:zE,tab:VE,keyboard:YE,copy:ZE,cut:ex,paste:tx,pointer:nx,clear:ax,deselectOptions:lx,selectOptions:sx,type:ux,upload:dx};function px(e){return K().asyncWrapper(e)}const Tp={applyAccept:!0,autoModify:!0,delay:0,document:globalThis.document,keyboardMap:qE,pointerMap:_E,pointerEventsCheck:ni.EachApiCall,skipAutoClose:!1,skipClick:!1,skipHover:!1,writeToClipboard:!1,advanceTimers:()=>Promise.resolve()},mx={...Tp,writeToClipboard:!0};function Sp(e={},t=mx,r){const n=yx(e,r,t);return{...t,...e,document:n}}function hx(e={}){const t=Sp(e);vp(t.document),bp(ve(t.document).HTMLElement);var r;const n=(r=t.document.defaultView)!==null&&r!==void 0?r:globalThis.window;return yh(n),Cs(t).api}function se({keyboardState:e,pointerState:t,...r}={},n){const o=Sp(r,Tp,n);vp(o.document),bp(ve(o.document).HTMLElement);var i;const a=(i=t??e)!==null&&i!==void 0?i:new Ep;return{api:Cs(o,a).api,system:a}}function bx(e){return Cs({...this.config,...e},this.system).api}function vx(e,t){function r(...n){return wo(e,pe.Call),px(()=>t.apply(e,n).then(async o=>(await qt(e.config),o)))}return Object.defineProperty(r,"name",{get:()=>t.name}),r}function Cs(e,t=new Ep){const r={};return Object.assign(r,{config:e,dispatchEvent:hp.bind(r),dispatchUIEvent:hE.bind(r),system:t,levelRefs:{},...hd}),{instance:r,api:{...Object.fromEntries(Object.entries(hd).map(([n,o])=>[n,vx(r,o)])),setup:bx.bind(r)}}}function yx(e,t,r){var n,o;return(o=(n=e.document)!==null&&n!==void 0?n:t&&RE(t))!==null&&o!==void 0?o:r.document}function gx(e){return se().api.clear(e)}function Rx(e,t={}){return se(t,e).api.click(e)}function wx(e={}){return se(e).api.copy()}function Ex(e={}){return se(e).api.cut()}function xx(e,t={}){return se(t).api.dblClick(e)}function Cx(e,t,r={}){return se(r).api.deselectOptions(e,t)}function qx(e,t={}){return se(t).api.hover(e)}async function _x(e,t={}){const{api:r,system:n}=se(t);return r.keyboard(e).then(()=>n)}async function Px(e,t={}){const{api:r,system:n}=se(t);return r.pointer(e).then(()=>n)}function Tx(e,t){return se(t).api.paste(e)}function Sx(e,t,r={}){return se(r).api.selectOptions(e,t)}function Ax(e,t={}){return se(t).api.tripleClick(e)}function Mx(e,t,r={}){return se(r,e).api.type(e,t,r)}function Ox(e,t={}){const{api:r,system:n}=se(t);return n.pointer.setMousePosition({target:e}),r.unhover(e)}function Ix(e,t,r={}){return se(r).api.upload(e,t)}function Nx(e={}){return se().api.tab(e)}const kx=Object.freeze(Object.defineProperty({__proto__:null,clear:gx,click:Rx,copy:wx,cut:Ex,dblClick:xx,deselectOptions:Cx,hover:qx,keyboard:_x,paste:Tx,pointer:Px,selectOptions:Sx,tab:Nx,tripleClick:Ax,type:Mx,unhover:Ox,upload:Ix},Symbol.toStringTag,{value:"Module"})),jx={...kx,setup:hx};function Dx(e,t,r){switch(t){case"type":return`Event fired: Typed "${r[1]}" into element`;case"selectOptions":return`Event fired: Selected option(s) ${JSON.stringify(r[1])}`;case"click":return"Event fired: Clicked element";case"dblClick":return"Event fired: Double-clicked element";case"tripleClick":return"Event fired: Triple-clicked element";default:return`Event fired: ${e}.${String(t)} executed`}}function Ap(e,t="userEvent"){return new Proxy(e,{get(r,n,o){const i=Reflect.get(r,n,o);return typeof i!="function"?i:n==="setup"?(...a)=>{const s=i(...a);return Ap(s,`${t}.instance`)}:async(...a)=>{const s=await i(...a);return Re(Dx(t,n,a)),s}}})}const $x=Ap(jx);function Bx(e,t,r){const n=String(t);if(/^(get|query|find)(All)?By/.test(n)){const o=r[0];return`query: ${n}("${o}")`}return n==="within"?`helper: within(<${(r[0]?.tagName||"unknown").toLowerCase()}>) called`:n==="prettyDOM"||n==="logDOM"?`debug: ${n} called`:["act","waitFor","waitForElementToBeRemoved"].includes(n)?`async utility: ${n} executed`:`method: ${e}.${n} executed`}const Lx=()=>document.querySelector("body > div:not(#twd-sidebar-root)")??document.body,Fx=(e,t)=>{const r=Lx(),o=np(r)[e];if(typeof o=="function")return o(...t);const i=op[e];return typeof i=="function"?i(...t):i};function Ux(e,t="screen"){return new Proxy(e,{get(r,n,o){const i=Reflect.get(r,n,o);return typeof i!="function"?i:(...a)=>{const s=Fx(n,a);return Re(Bx(t,n,a)),s}}})}const zx=Ux(op);Vf({getElementError(e){return new Error(`${e}`)}});const Vx=Vf;ie.truncateThreshold=0;exports.TWDSidebar=ch;exports.configureScreenDom=Vx;exports.expect=Po;exports.initTests=fh;exports.screenDom=zx;exports.twd=vd;exports.userEvent=$x;
69
+ for more information about how userEvent parses your input.`}function KE(e,t){const r=[];do{const{type:o,descriptor:i,consumedLength:a,releasePrevious:s,releaseSelf:l=!0,repeat:u}=xp(t,"keyboard");var n;const f=(n=e.find(c=>{if(o==="["){var d;return((d=c.code)===null||d===void 0?void 0:d.toLowerCase())===i.toLowerCase()}else if(o==="{"){var b;return((b=c.key)===null||b===void 0?void 0:b.toLowerCase())===i.toLowerCase()}return c.key===i}))!==null&&n!==void 0?n:{key:"Unknown",code:"Unknown",[o==="["?"code":"key"]:i};r.push({keyDef:f,releasePrevious:s,releaseSelf:l,repeat:u}),t=t.slice(a)}while(t);return r}async function YE(e){const t=KE(this.config.keyboardMap,e);for(let r=0;r<t.length;r++)await qt(this.config),await XE(this,t[r])}async function XE(e,{keyDef:t,releasePrevious:r,releaseSelf:n,repeat:o}){const{system:i}=e;if(i.keyboard.isKeyPressed(t)&&await i.keyboard.keyup(e,t),!r){for(let a=1;a<=o;a++)await i.keyboard.keydown(e,t),a<o&&await qt(e.config);n&&await i.keyboard.keyup(e,t)}}async function JE(e){for(const t of e.system.keyboard.getPressedKeys())await e.system.keyboard.keyup(e,t)}function _p(e){const t=_e(e)?{"text/plain":QE(e)}:{"text/plain":String(e.ownerDocument.getSelection())},r=us(ve(e));for(const n in t)t[n]&&r.setData(n,t[n]);return r}function QE(e){const t=Oo(e);return Pe(e).substring(t.startOffset,t.endOffset)}async function ZE(){const e=this.config.document;var t;const r=(t=e.activeElement)!==null&&t!==void 0?t:e.body,n=_p(r);if(n.items.length!==0)return this.dispatchUIEvent(r,"copy",{clipboardData:n})&&this.config.writeToClipboard&&await gf(e,n),n}async function ex(){const e=this.config.document;var t;const r=(t=e.activeElement)!==null&&t!==void 0?t:e.body,n=_p(r);if(n.items.length!==0)return this.dispatchUIEvent(r,"cut",{clipboardData:n})&&this.config.writeToClipboard&&await gf(r.ownerDocument,n),n}async function tx(e){const t=this.config.document;var r;const n=(r=t.activeElement)!==null&&r!==void 0?r:t.body;var o;const i=(o=typeof e=="string"?rx(t,e):e)!==null&&o!==void 0?o:await wh(t).catch(()=>{throw new Error("`userEvent.paste()` without `clipboardData` requires the `ClipboardAPI` to be available.")});this.dispatchUIEvent(n,"paste",{clipboardData:i})}function rx(e,t){const r=us(ve(e));return r.setData("text",t),r}function fd(e,t){const r=[];do{const{descriptor:n,consumedLength:o,releasePrevious:i,releaseSelf:a=!0}=xp(t,"pointer"),s=e.find(l=>l.name===n);s&&r.push({keyDef:s,releasePrevious:i,releaseSelf:a}),t=t.slice(o)}while(t);return r}async function nx(e){const{pointerMap:t}=this.config,r=[];(Array.isArray(e)?e:[e]).forEach(n=>{typeof n=="string"?r.push(...fd(t,n)):"keys"in n?r.push(...fd(t,n.keys).map(o=>({...n,...o}))):r.push(n)});for(let n=0;n<r.length;n++)await qt(this.config),await ox(this,r[n]);this.system.pointer.resetClickCount()}async function ox(e,t){var r,n;const o="pointerName"in t&&t.pointerName?t.pointerName:"keyDef"in t?e.system.pointer.getPointerName(t.keyDef):"mouse",i=e.system.pointer.getPreviousPosition(o);var a,s,l,u;const f={target:(a=t.target)!==null&&a!==void 0?a:ix(e,i),coords:(s=t.coords)!==null&&s!==void 0?s:i?.coords,caret:{node:(l=t.node)!==null&&l!==void 0?l:pd(t)||i==null||(r=i.caret)===null||r===void 0?void 0:r.node,offset:(u=t.offset)!==null&&u!==void 0?u:pd(t)||i==null||(n=i.caret)===null||n===void 0?void 0:n.offset}};"keyDef"in t?(e.system.pointer.isKeyPressed(t.keyDef)&&(wo(e,pe.Trigger),await e.system.pointer.release(e,t.keyDef,f)),t.releasePrevious||(wo(e,pe.Trigger),await e.system.pointer.press(e,t.keyDef,f),t.releaseSelf&&(wo(e,pe.Trigger),await e.system.pointer.release(e,t.keyDef,f)))):(wo(e,pe.Trigger),await e.system.pointer.move(e,o,f))}function pd(e){var t,r;return!!((r=(t=e.target)!==null&&t!==void 0?t:e.node)!==null&&r!==void 0?r:e.offset!==void 0)}function ix(e,t){if(!t)throw new Error("This pointer has no previous position. Provide a target property!");var r;return(r=t.target)!==null&&r!==void 0?r:e.config.document.body}async function ax(e){if(!wt(e)||Le(e))throw new Error("clear()` is only supported on editable elements.");if(Qe(e),e.ownerDocument.activeElement!==e)throw new Error("The element to be cleared could not be focused.");if(dp(e),!tE(e))throw new Error("The element content to be cleared could not be selected.");Ct(this,e,"","deleteContentBackward")}async function sx(e,t){return Pp.call(this,!0,e,t)}async function lx(e,t){return Pp.call(this,!1,e,t)}async function Pp(e,t,r){if(!e&&!t.multiple)throw K().getElementError("Unable to deselect an option in a non-multiple select. Use selectOptions to change the selection instead.",t);const n=Array.isArray(r)?r:[r],o=Array.from(t.querySelectorAll('option, [role="option"]')),i=n.map(s=>{if(typeof s!="string"&&o.includes(s))return s;{const l=o.find(u=>u.value===s||u.innerHTML===s);if(l)return l;throw K().getElementError(`Value "${String(s)}" not found in options`,t)}}).filter(s=>!Le(s));if(Le(t)||!i.length)return;const a=s=>{s.selected=e,this.dispatchUIEvent(t,"input",{bubbles:!0,cancelable:!1,composed:!0}),this.dispatchUIEvent(t,"change")};if(z(t,"select"))if(t.multiple)for(const s of i){const l=this.config.pointerEventsCheck===0?!0:Ri(this,s);l&&(this.dispatchUIEvent(s,"pointerover"),this.dispatchUIEvent(t,"pointerenter"),this.dispatchUIEvent(s,"mouseover"),this.dispatchUIEvent(t,"mouseenter"),this.dispatchUIEvent(s,"pointermove"),this.dispatchUIEvent(s,"mousemove"),this.dispatchUIEvent(s,"pointerdown"),this.dispatchUIEvent(s,"mousedown")),Qe(t),l&&(this.dispatchUIEvent(s,"pointerup"),this.dispatchUIEvent(s,"mouseup")),a(s),l&&this.dispatchUIEvent(s,"click"),await qt(this.config)}else if(i.length===1){const s=this.config.pointerEventsCheck===0?!0:Ri(this,t);s?await this.click(t):Qe(t),a(i[0]),s&&(this.dispatchUIEvent(t,"pointerover"),this.dispatchUIEvent(t,"pointerenter"),this.dispatchUIEvent(t,"mouseover"),this.dispatchUIEvent(t,"mouseenter"),this.dispatchUIEvent(t,"pointerup"),this.dispatchUIEvent(t,"mouseup"),this.dispatchUIEvent(t,"click")),await qt(this.config)}else throw K().getElementError("Cannot select multiple options on a non-multiple select",t);else if(t.getAttribute("role")==="listbox")for(const s of i)await this.click(s),await this.unhover(s);else throw K().getElementError("Cannot select options on elements that are neither select nor listbox elements",t)}async function ux(e,t,{skipClick:r=this.config.skipClick,skipAutoClose:n=this.config.skipAutoClose,initialSelectionStart:o,initialSelectionEnd:i}={}){e.disabled||(r||await this.click(e),o!==void 0&&Ro(e,o,i??o),await this.keyboard(t),n||await JE(this))}const md=Symbol("files and value properties are mocked");function Ki(e,t,r){r?Object.defineProperty(e,t,r):delete e[t]}function cx(e,t){var r;(r=e[md])===null||r===void 0||r.restore();const n=Object.getOwnPropertyDescriptor(e,"type"),o=Object.getOwnPropertyDescriptor(e,"value"),i=Object.getOwnPropertyDescriptor(e,"files");function a(){Ki(e,"type",n),Ki(e,"value",o),Ki(e,"files",i)}e[md]={restore:a},Object.defineProperties(e,{files:{configurable:!0,get:()=>t},value:{configurable:!0,get:()=>t.length?`C:\\fakepath\\${t[0].name}`:"",set(s){if(s==="")a();else{var l;o==null||(l=o.set)===null||l===void 0||l.call(e,s)}}},type:{configurable:!0,get:()=>"file",set(s){s!=="file"&&(a(),e.type=s)}}})}async function dx(e,t){const r=z(e,"label")?e.control:e;if(!r||!z(r,"input",{type:"file"}))throw new TypeError(`The ${r===e?"given":"associated"} ${r?.tagName} element does not accept file uploads`);if(Le(e))return;const n=(Array.isArray(t)?t:[t]).filter(i=>!this.config.applyAccept||fx(i,r.accept)).slice(0,r.multiple?void 0:1),o=()=>{var i;n.length===((i=r.files)===null||i===void 0?void 0:i.length)&&n.every((a,s)=>{var l;return a===((l=r.files)===null||l===void 0?void 0:l.item(s))})||(cx(r,ls(ve(e),n)),this.dispatchUIEvent(r,"input"),this.dispatchUIEvent(r,"change"))};r.addEventListener("fileDialog",o),await this.click(e),r.removeEventListener("fileDialog",o)}function Qo(e){return e.toLowerCase().replace(/(\.|\/)jpg\b/g,"$1jpeg")}function fx(e,t){if(!t)return!0;const r=["audio/*","image/*","video/*"];return Qo(t).trim().split(/\s*,\s*/).some(n=>n.startsWith(".")?Qo(e.name).endsWith(n):r.includes(n)?Qo(e.type).startsWith(n.replace("*","")):Qo(e.type)===n)}const hd={click:BE,dblClick:LE,tripleClick:FE,hover:UE,unhover:zE,tab:VE,keyboard:YE,copy:ZE,cut:ex,paste:tx,pointer:nx,clear:ax,deselectOptions:lx,selectOptions:sx,type:ux,upload:dx};function px(e){return K().asyncWrapper(e)}const Tp={applyAccept:!0,autoModify:!0,delay:0,document:globalThis.document,keyboardMap:qE,pointerMap:_E,pointerEventsCheck:ni.EachApiCall,skipAutoClose:!1,skipClick:!1,skipHover:!1,writeToClipboard:!1,advanceTimers:()=>Promise.resolve()},mx={...Tp,writeToClipboard:!0};function Sp(e={},t=mx,r){const n=yx(e,r,t);return{...t,...e,document:n}}function hx(e={}){const t=Sp(e);vp(t.document),bp(ve(t.document).HTMLElement);var r;const n=(r=t.document.defaultView)!==null&&r!==void 0?r:globalThis.window;return yh(n),Cs(t).api}function se({keyboardState:e,pointerState:t,...r}={},n){const o=Sp(r,Tp,n);vp(o.document),bp(ve(o.document).HTMLElement);var i;const a=(i=t??e)!==null&&i!==void 0?i:new Ep;return{api:Cs(o,a).api,system:a}}function bx(e){return Cs({...this.config,...e},this.system).api}function vx(e,t){function r(...n){return wo(e,pe.Call),px(()=>t.apply(e,n).then(async o=>(await qt(e.config),o)))}return Object.defineProperty(r,"name",{get:()=>t.name}),r}function Cs(e,t=new Ep){const r={};return Object.assign(r,{config:e,dispatchEvent:hp.bind(r),dispatchUIEvent:hE.bind(r),system:t,levelRefs:{},...hd}),{instance:r,api:{...Object.fromEntries(Object.entries(hd).map(([n,o])=>[n,vx(r,o)])),setup:bx.bind(r)}}}function yx(e,t,r){var n,o;return(o=(n=e.document)!==null&&n!==void 0?n:t&&RE(t))!==null&&o!==void 0?o:r.document}function gx(e){return se().api.clear(e)}function Rx(e,t={}){return se(t,e).api.click(e)}function wx(e={}){return se(e).api.copy()}function Ex(e={}){return se(e).api.cut()}function xx(e,t={}){return se(t).api.dblClick(e)}function Cx(e,t,r={}){return se(r).api.deselectOptions(e,t)}function qx(e,t={}){return se(t).api.hover(e)}async function _x(e,t={}){const{api:r,system:n}=se(t);return r.keyboard(e).then(()=>n)}async function Px(e,t={}){const{api:r,system:n}=se(t);return r.pointer(e).then(()=>n)}function Tx(e,t){return se(t).api.paste(e)}function Sx(e,t,r={}){return se(r).api.selectOptions(e,t)}function Ax(e,t={}){return se(t).api.tripleClick(e)}function Mx(e,t,r={}){return se(r,e).api.type(e,t,r)}function Ox(e,t={}){const{api:r,system:n}=se(t);return n.pointer.setMousePosition({target:e}),r.unhover(e)}function Ix(e,t,r={}){return se(r).api.upload(e,t)}function Nx(e={}){return se().api.tab(e)}const kx=Object.freeze(Object.defineProperty({__proto__:null,clear:gx,click:Rx,copy:wx,cut:Ex,dblClick:xx,deselectOptions:Cx,hover:qx,keyboard:_x,paste:Tx,pointer:Px,selectOptions:Sx,tab:Nx,tripleClick:Ax,type:Mx,unhover:Ox,upload:Ix},Symbol.toStringTag,{value:"Module"})),jx={...kx,setup:hx};function Dx(e,t,r){switch(t){case"type":return`Event fired: Typed "${r[1]}" into element`;case"selectOptions":return`Event fired: Selected option(s) ${JSON.stringify(r[1])}`;case"click":return"Event fired: Clicked element";case"dblClick":return"Event fired: Double-clicked element";case"tripleClick":return"Event fired: Triple-clicked element";default:return`Event fired: ${e}.${String(t)} executed`}}function Ap(e,t="userEvent"){return new Proxy(e,{get(r,n,o){const i=Reflect.get(r,n,o);return typeof i!="function"?i:n==="setup"?(...a)=>{const s=i(...a);return Ap(s,`${t}.instance`)}:async(...a)=>{const s=await i(...a);return Re(Dx(t,n,a)),s}}})}const $x=Ap(jx);function Bx(e,t,r){const n=String(t);if(/^(get|query|find)(All)?By/.test(n)){const o=r[0];return`query: ${n}("${o}")`}return n==="within"?`helper: within(<${(r[0]?.tagName||"unknown").toLowerCase()}>) called`:n==="prettyDOM"||n==="logDOM"?`debug: ${n} called`:["act","waitFor","waitForElementToBeRemoved"].includes(n)?`async utility: ${n} executed`:`method: ${e}.${n} executed`}const Lx=()=>document.querySelector("body > :not(#twd-sidebar-root):not(script):not(style)")??document.body,Fx=(e,t)=>{const r=Lx(),o=np(r)[e];if(typeof o=="function")return o(...t);const i=op[e];return typeof i=="function"?i(...t):i};function Ux(e,t="screen"){return new Proxy(e,{get(r,n,o){const i=Reflect.get(r,n,o);return typeof i!="function"?i:(...a)=>{const s=Fx(n,a);return Re(Bx(t,n,a)),s}}})}const zx=Ux(op);Vf({getElementError(e){return new Error(`${e}`)}});const Vx=Vf;ie.truncateThreshold=0;exports.TWDSidebar=ch;exports.configureScreenDom=Vx;exports.expect=Po;exports.initTests=fh;exports.screenDom=zx;exports.twd=vd;exports.userEvent=$x;
package/dist/index.es.js CHANGED
@@ -213,7 +213,7 @@ const mm = {
213
213
  }, we = (e) => {
214
214
  const t = ri.size ? Array.from(ri.values()).find((r) => r.status === "running") : null;
215
215
  t && t.logs?.push(e);
216
- }, Ca = "1.3.0-beta.1", hm = () => typeof window < "u" ? (window.__TWD_MOCK_STATE__ || (window.__TWD_MOCK_STATE__ = {
216
+ }, Ca = "1.3.0-beta.2", hm = () => typeof window < "u" ? (window.__TWD_MOCK_STATE__ || (window.__TWD_MOCK_STATE__ = {
217
217
  rules: []
218
218
  }), window.__TWD_MOCK_STATE__) : {
219
219
  rules: []
@@ -17003,7 +17003,7 @@ function LC(e, t, r) {
17003
17003
  }
17004
17004
  return n === "within" ? `helper: within(<${(r[0]?.tagName || "unknown").toLowerCase()}>) called` : n === "prettyDOM" || n === "logDOM" ? `debug: ${n} called` : ["act", "waitFor", "waitForElementToBeRemoved"].includes(n) ? `async utility: ${n} executed` : `method: ${e}.${n} executed`;
17005
17005
  }
17006
- const FC = () => document.querySelector("body > div:not(#twd-sidebar-root)") ?? document.body, UC = (e, t) => {
17006
+ const FC = () => document.querySelector("body > :not(#twd-sidebar-root):not(script):not(style)") ?? document.body, UC = (e, t) => {
17007
17007
  const r = FC(), o = rp(r)[e];
17008
17008
  if (typeof o == "function")
17009
17009
  return o(...t);
package/dist/mock-sw.js CHANGED
@@ -1,4 +1,4 @@
1
- const h=e=>{try{return new RegExp(e),!0}catch{return!1}},u=e=>{const s=e.split("?")[0];return/\.([a-zA-Z0-9]+)$/.test(s)};function f(e,s,n){return n.find(t=>{const o=t.method.toLowerCase()===e.toLowerCase();if(t.urlRegex&&h(t.url)){const r=new RegExp(t.url);return o&&r.test(s)}if(u(t.url))return o&&s.includes(t.url);const l=t.url===s||s.includes(t.url);return o&&l&&!u(s)})}function p(e,s,n){e.forEach(t=>t.postMessage({type:"EXECUTED",alias:s.alias,request:n}))}const y=(e,s,n)=>{const o=![204,205,304].includes(s),i=o?JSON.stringify(e):null;return new Response(i,{status:s,headers:o?n||{"Content-Type":"application/json"}:n||{}})},c="1.3.0-beta.1";let a=[];const g=async e=>{const{method:s}=e.request,n=e.request.url,t=f(s,n,a);t&&(console.log("[TWD] Mock hit:",t.alias,s,n),e.respondWith((async()=>{let o=null;const i=e.request.headers.get("content-type")||"application/json";if(i.includes("application/json"))try{o=await e.request.clone().json()}catch{}else if(i.includes("form"))try{const l=await e.request.clone().formData();o={},l.forEach((r,d)=>{o[d]=r})}catch{}else if(i.includes("text"))try{o=await e.request.clone().text()}catch{}else if(i.includes("octet-stream"))try{o=await e.request.clone().arrayBuffer()}catch{}else if(i.includes("image"))try{o=await e.request.clone().blob()}catch{}else try{o=await e.request.clone().text()}catch{}return self.clients.matchAll().then(l=>{p(l,t,o)}),y(t.response,t.status??200,t.responseHeaders)})()))},m=e=>{e!==c&&console.warn(`[TWD] ⚠️ Version mismatch detected:
1
+ const h=e=>{try{return new RegExp(e),!0}catch{return!1}},u=e=>{const s=e.split("?")[0];return/\.([a-zA-Z0-9]+)$/.test(s)};function f(e,s,n){return n.find(t=>{const o=t.method.toLowerCase()===e.toLowerCase();if(t.urlRegex&&h(t.url)){const r=new RegExp(t.url);return o&&r.test(s)}if(u(t.url))return o&&s.includes(t.url);const l=t.url===s||s.includes(t.url);return o&&l&&!u(s)})}function p(e,s,n){e.forEach(t=>t.postMessage({type:"EXECUTED",alias:s.alias,request:n}))}const y=(e,s,n)=>{const o=![204,205,304].includes(s),i=o?JSON.stringify(e):null;return new Response(i,{status:s,headers:o?n||{"Content-Type":"application/json"}:n||{}})},c="1.3.0-beta.2";let a=[];const g=async e=>{const{method:s}=e.request,n=e.request.url,t=f(s,n,a);t&&(console.log("[TWD] Mock hit:",t.alias,s,n),e.respondWith((async()=>{let o=null;const i=e.request.headers.get("content-type")||"application/json";if(i.includes("application/json"))try{o=await e.request.clone().json()}catch{}else if(i.includes("form"))try{const l=await e.request.clone().formData();o={},l.forEach((r,d)=>{o[d]=r})}catch{}else if(i.includes("text"))try{o=await e.request.clone().text()}catch{}else if(i.includes("octet-stream"))try{o=await e.request.clone().arrayBuffer()}catch{}else if(i.includes("image"))try{o=await e.request.clone().blob()}catch{}else try{o=await e.request.clone().text()}catch{}return self.clients.matchAll().then(l=>{p(l,t,o)}),y(t.response,t.status??200,t.responseHeaders)})()))},m=e=>{e!==c&&console.warn(`[TWD] ⚠️ Version mismatch detected:
2
2
  Client version: ${e}
3
3
  Service Worker version: ${c}
4
4
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "twd-js",
3
- "version": "1.3.0-beta.1",
3
+ "version": "1.3.0-beta.2",
4
4
  "description": "Test While Developing (TWD) - in-browser testing",
5
5
  "license": "MIT",
6
6
  "author": "BRIKEV",