twd-js 1.3.0 → 1.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +9 -2
- package/dist/bundled.es.js +801 -46108
- package/dist/bundled.umd.js +2 -307
- package/dist/index.cjs.js +3 -3
- package/dist/index.es.js +1081 -1081
- package/dist/mock-sw.js +1 -1
- package/package.json +5 -3
package/dist/index.cjs.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
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",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.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`)},vd=()=>Xe,ym=()=>{navigator.serviceWorker.controller?.postMessage({type:"CLEAR_RULES",version:xa}),Xe.length=0},gm=(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}`)}},Rm=()=>({location:window.location,should:async(e,t,r=5)=>{let n="",o;for(let i=0;i<r;i++)try{n=gm(e,t),Re(n);break}catch(a){await new Promise(s=>setTimeout(s,100)),o=a}if(o)throw o;return n}}),wm=100,Em=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(wm)},xm={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:Em,url:Rm,mockRequest:bm,waitForRequest:bd,waitForRequests:vm,initRequestMocking:hm,clearRequestMockRules:ym,getRequestMockRules:vd,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); }
|
|
5
5
|
100% { transform: rotate(360deg); }
|
|
6
6
|
}
|
|
7
|
-
`,document.head.appendChild(zo));const Oi=({className:e,children:t,dataTestId:r})=>B.jsxRuntimeExports.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 ${e}`,"data-testid":r,children:t}),Xm=()=>B.jsxRuntimeExports.jsx(Oi,{className:"lucide-play-icon lucide-play",dataTestId:"play-icon",children:B.jsxRuntimeExports.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"})}),mf=({id:e,name:t,skip:r,only:n})=>B.jsxRuntimeExports.jsxs(B.jsxRuntimeExports.Fragment,{children:[t," ",n&&B.jsxRuntimeExports.jsxs("span",{style:{color:"#2563eb"},"data-testid":`only-indicator-${e}`,children:[" ","(only)"]}),r&&B.jsxRuntimeExports.jsxs("span",{style:{color:"#6b7280"},"data-testid":`skip-indicator-${e}`,children:[" ","(skipped)"]})]}),Jm=e=>{switch(e.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"}}}},Qm=e=>e.startsWith("Assertion passed")||e.startsWith("Event fired")?{color:"#0d542b",fontWeight:"700"}:e.startsWith("Test failed")?{color:"#fb2c36",fontWeight:"700"}:{},Zm=({node:e,depth:t,id:r,runTest:n})=>{const o=Jm(e);return B.jsxRuntimeExports.jsxs("li",{style:{marginBottom:"4px",marginLeft:t*6,...o.container},"data-testid":`test-list-item-${r}`,children:[B.jsxRuntimeExports.jsxs("div",{style:{display:"flex",alignItems:"left",justifyContent:"space-between",padding:"4px 6px",borderRadius:"4px",...o.item},children:[B.jsxRuntimeExports.jsx("span",{style:{fontWeight:"500",color:"#374151",maxWidth:"220px"},children:B.jsxRuntimeExports.jsx(mf,{id:r,name:e.name,skip:e.skip,only:e.only})}),B.jsxRuntimeExports.jsx("button",{onClick:()=>n(r),"aria-label":`Run ${e.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:e.status==="running","data-testid":`run-test-button-${r}`,children:e.status==="running"?B.jsxRuntimeExports.jsx(Ym,{}):B.jsxRuntimeExports.jsx(Xm,{})})]}),e.logs&&e.logs.length>0&&B.jsxRuntimeExports.jsx("ul",{style:{borderRadius:"4px",maxHeight:"260px",overflowY:"auto",padding:0,background:"#f3f4f6",listStyle:"none",marginTop:"4px",textAlign:"left"},children:e.logs.map((i,a)=>B.jsxRuntimeExports.jsx("li",{style:{fontSize:"12px",padding:"4px 6px",borderBottom:"1px solid #d1d5db",color:"#374151",...Qm(i)},children:i},a))})]},e.name)},eh=()=>B.jsxRuntimeExports.jsx(Oi,{className:"lucide-chevron-down-icon lucide-chevron-down",dataTestId:"chevron-down-icon",children:B.jsxRuntimeExports.jsx("path",{d:"m6 9 6 6 6-6"})}),th=()=>B.jsxRuntimeExports.jsx(Oi,{className:"lucide-chevron-right-icon lucide-chevron-right",dataTestId:"chevron-right-icon",children:B.jsxRuntimeExports.jsx("path",{d:"m9 18 6-6-6-6"})}),rh=({tests:e,runTest:t})=>{const[r,n]=oi.useState({}),o=s=>n(l=>({...l,[s]:!l[s]})),i=(s,l=0)=>{if(s.type==="test")return B.jsxRuntimeExports.jsx(Zm,{node:s,depth:l,id:s.id,runTest:()=>t(s.id)},s.id);const u=r[s.id];return B.jsxRuntimeExports.jsxs("li",{style:{marginLeft:l*12},children:[B.jsxRuntimeExports.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":!u,onClick:()=>o(s.id),children:[B.jsxRuntimeExports.jsx(mf,{id:s.id,name:s.name,skip:s.skip,only:s.only}),u?B.jsxRuntimeExports.jsx(th,{}):B.jsxRuntimeExports.jsx(eh,{})]}),!u&&s.childrenNodes&&s.childrenNodes.length>0&&B.jsxRuntimeExports.jsx("ul",{style:{listStyle:"none",padding:0,margin:0},children:s.childrenNodes.map(f=>i(f,l+1))})]},s.id)},a=Gm(e);return B.jsxRuntimeExports.jsx("ul",{style:{listStyle:"none",padding:0,margin:0},children:a.map(s=>i(s))})},nh={left:{left:0,borderTopRightRadius:"6px",borderBottomRightRadius:"6px",borderTopLeftRadius:"0",borderBottomLeftRadius:"0"},right:{right:0,borderTopLeftRadius:"6px",borderBottomLeftRadius:"6px",borderTopRightRadius:"0",borderBottomRightRadius:"0"}},oh=({setOpen:e,position:t})=>B.jsxRuntimeExports.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",...nh[t]},onClick:()=>e(!0),children:"TWD"}),ih=({isOpen:e,position:t})=>{oi.useEffect(()=>{const r=document.documentElement;return e?t==="left"?r.style.marginLeft="280px":r.style.marginRight="280px":(r.style.marginRight="0",r.style.marginLeft="0"),()=>{r.style.marginRight="0",r.style.marginLeft="0"}},[e,t])},ah=()=>B.jsxRuntimeExports.jsxs(Oi,{className:"lucide-wifi-pen-icon lucide-wifi-pen",dataTestId:"wifi-pen-icon",children:[B.jsxRuntimeExports.jsx("path",{d:"M2 8.82a15 15 0 0 1 20 0"}),B.jsxRuntimeExports.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"}),B.jsxRuntimeExports.jsx("path",{d:"M5 12.859a10 10 0 0 1 10.5-2.222"}),B.jsxRuntimeExports.jsx("path",{d:"M8.5 16.429a5 5 0 0 1 3-1.406"})]}),sh=()=>{const e=vd.getRequestMockRules(),t=e.filter(n=>n.executed),r=()=>{console.group("🌐 TWD Mock Rules"),console.log("Total rules:",e.length),console.log("Triggered rules:",t.length),console.log("Rules details:"),console.log(e),console.groupEnd()};return B.jsxRuntimeExports.jsxs("button",{onClick:r,"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:[B.jsxRuntimeExports.jsx(ah,{}),B.jsxRuntimeExports.jsxs("span",{style:{flex:1},children:["Rules: ",t.length,"/",e.length," triggered"]}),B.jsxRuntimeExports.jsx("span",{style:{fontSize:"10px",color:"#1E293B",fontWeight:"500"},children:"View rules in console"})]})},lh={left:{left:0,borderRight:"1px solid #e5e7eb"},right:{right:0,borderLeft:"1px solid #e5e7eb"}},uh='-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"',ch=({open:e,position:t="left"})=>{const[r,n]=oi.useState(0),[o,i]=oi.useState(e);ih({isOpen:o,position:t});const a=new xo.TestRunner({onStart:c=>{c.status="running",n(d=>d+1)},onPass:c=>{c.status="pass",n(d=>d+1)},onFail:(c,d)=>{c.status="fail",console.error("Test failed:",c.name,d),c.logs.push(`Test failed: ${d.message}`),n(b=>b+1)},onSkip:c=>{c.status="skip",n(d=>d+1)}}),s=async()=>{await a.runAll()},l=async c=>{const d=Array.from(xo.handlers.values()).filter(b=>b.type==="test").find(b=>b.id===c);d&&await a.runSingle(d.id)},u=Array.from(xo.handlers.values());if(!o)return B.jsxRuntimeExports.jsx(oh,{position:t,setOpen:i});const f=u.filter(c=>c.type==="test").length;return B.jsxRuntimeExports.jsxs("div",{style:{fontFamily:uh,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,...lh[t]},"data-testid":"twd-sidebar",children:[B.jsxRuntimeExports.jsxs("div",{style:{padding:"8px",background:"#f9fafb",position:"sticky",top:0,zIndex:1e3,borderBottom:"1px solid #e5e7eb"},children:[B.jsxRuntimeExports.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"14px"},children:[B.jsxRuntimeExports.jsx("button",{onClick:s,style:{background:"#1A6EF4",color:"white",padding:"4px 8px",borderRadius:"4px",border:"none",cursor:"pointer"},children:"Run All"}),B.jsxRuntimeExports.jsx("button",{"aria-label":"Close sidebar",style:{background:"transparent",border:"none",cursor:"pointer",fontSize:"14px",paddingRight:"0",paddingLeft:"0"},onClick:()=>i(!1),children:"✖"})]}),B.jsxRuntimeExports.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",fontSize:"14px",color:"#6b7280",marginBottom:"10px"},children:[B.jsxRuntimeExports.jsxs("span",{style:{color:"#374151"},children:["Total: ",f]}),B.jsxRuntimeExports.jsxs("div",{style:{display:"flex",gap:"4px"},children:[B.jsxRuntimeExports.jsxs("span",{style:{color:"#00c951"},children:["✓ ",u.filter(c=>c.status==="pass").length]}),B.jsxRuntimeExports.jsxs("span",{style:{color:"#fb2c36"},children:["✗ ",u.filter(c=>c.status==="fail").length]})]})]}),B.jsxRuntimeExports.jsx(sh,{})]}),B.jsxRuntimeExports.jsx("div",{style:{padding:"8px"},children:B.jsxRuntimeExports.jsx(rh,{tests:u.map(c=>({name:c.name,depth:c.depth,status:c.status,logs:c.logs,id:c.id,parent:c.parent,type:c.type,only:c.only,skip:c.skip})),runTest:l})})]})},dh=e=>{const{Component:t,createRoot:r}=e,n=document.createElement("div");n.setAttribute("id","twd-sidebar-root"),document.body.appendChild(n),r(n).render(t)},fh=async(e,t,r)=>{for(const n in e)await e[n]();dh({Component:t,createRoot:r})};function z(e,t,r){return e.namespaceURI&&e.namespaceURI!=="http://www.w3.org/1999/xhtml"||(t=Array.isArray(t)?t:[t],!t.includes(e.tagName.toLowerCase()))?!1:r?Object.entries(r).every(([n,o])=>e[n]===o):!0}function ve(e){var t;if(ph(e)&&e.defaultView)return e.defaultView;if(!((t=e.ownerDocument)===null||t===void 0)&&t.defaultView)return e.ownerDocument.defaultView;throw new Error(`Could not determine window of node. Node was ${mh(e)}`)}function ph(e){return e.nodeType===9}function mh(e){return typeof e=="function"?`function ${e.name}`:e===null?"null":String(e)}function hf(e,t){return new Promise((r,n)=>{const o=new t;o.onerror=n,o.onabort=n,o.onload=()=>{r(String(o.result))},o.readAsText(e)})}function ls(e,t){const r={...t,length:t.length,item:n=>r[n],[Symbol.iterator]:function*(){for(let o=0;o<r.length;o++)yield r[o]}};return r.constructor=e.FileList,e.FileList&&Object.setPrototypeOf(r,e.FileList.prototype),Object.freeze(r),r}function Ye(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}class bf{getAsFile(){return this.file}getAsString(t){typeof this.data=="string"&&t(this.data)}webkitGetAsEntry(){throw new Error("not implemented")}constructor(t,r){Ye(this,"kind",void 0),Ye(this,"type",void 0),Ye(this,"file",null),Ye(this,"data",void 0),typeof t=="string"?(this.kind="string",this.type=String(r),this.data=t):(this.kind="file",this.type=t.type,this.file=t)}}class hh extends Array{add(...t){const r=new bf(t[0],t[1]);return this.push(r),r}clear(){this.splice(0,this.length)}remove(t){this.splice(t,1)}}function Vo(e,t){const[r,n]=e.split("/"),o=!n||n==="*";return i=>t?i.type===(o?r:e):o?i.type.startsWith(`${r}/`):i.type===r}function bh(e){return new class{getData(r){var n;const o=(n=this.items.find(Vo(r,!0)))!==null&&n!==void 0?n:this.items.find(Vo(r,!1));let i="";return o?.getAsString(a=>{i=a}),i}setData(r,n){const o=this.items.findIndex(Vo(r,!0)),i=new bf(n,r);o>=0?this.items.splice(o,1,i):this.items.push(i)}clearData(r){if(r){const n=this.items.findIndex(Vo(r,!0));n>=0&&this.items.remove(n)}else this.items.clear()}get types(){const r=[];return this.files.length&&r.push("Files"),this.items.forEach(n=>r.push(n.type)),Object.freeze(r),r}setDragImage(){}constructor(){Ye(this,"dropEffect","none"),Ye(this,"effectAllowed","uninitialized"),Ye(this,"items",new hh),Ye(this,"files",ls(e,[]))}}}function us(e,t=[]){const r=typeof e.DataTransfer>"u"?bh(e):new e.DataTransfer;return Object.defineProperty(r,"files",{get:()=>ls(e,t)}),r}async function vh(e,t){return t.kind==="file"?t.getAsFile():new e.Blob([await new Promise(r=>t.getAsString(r))],{type:t.type})}function vf(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function yf(e,...t){const r=Object.fromEntries(t.map(n=>[typeof n=="string"?"text/plain":n.type,Promise.resolve(n)]));return typeof e.ClipboardItem<"u"?new e.ClipboardItem(r):new class{get types(){return Array.from(Object.keys(this.data))}async getType(o){const i=await this.data[o];if(!i)throw new Error(`${o} is not one of the available MIME types on this item.`);return i instanceof e.Blob?i:new e.Blob([i],{type:o})}constructor(o){vf(this,"data",void 0),this.data=o}}(r)}const Rt=Symbol("Manage ClipboardSub");function Ns(e,t){return Object.assign(new class extends e.EventTarget{async read(){return Array.from(this.items)}async readText(){let n="";for(const o of this.items){const i=o.types.includes("text/plain")?"text/plain":o.types.find(a=>a.startsWith("text/"));i&&(n+=await o.getType(i).then(a=>hf(a,e.FileReader)))}return n}async write(n){this.items=n}async writeText(n){this.items=[yf(e,n)]}constructor(...n){super(...n),vf(this,"items",[])}},{[Rt]:t})}function cs(e){return!!e?.[Rt]}function yh(e){if(cs(e.navigator.clipboard))return e.navigator.clipboard[Rt];const t=Object.getOwnPropertyDescriptor(e.navigator,"clipboard");let r;const n={resetClipboardStub:()=>{r=Ns(e,n)},detachClipboardStub:()=>{t?Object.defineProperty(e.navigator,"clipboard",t):Object.defineProperty(e.navigator,"clipboard",{value:void 0,configurable:!0})}};return r=Ns(e,n),Object.defineProperty(e.navigator,"clipboard",{get:()=>r,configurable:!0}),r[Rt]}function gh(e){cs(e.navigator.clipboard)&&e.navigator.clipboard[Rt].resetClipboardStub()}function Rh(e){cs(e.navigator.clipboard)&&e.navigator.clipboard[Rt].detachClipboardStub()}async function wh(e){const t=e.defaultView,r=t?.navigator.clipboard,n=r&&await r.read();if(!n)throw new Error("The Clipboard API is unavailable.");const o=us(t);for(const i of n)for(const a of i.types)o.setData(a,await i.getType(a).then(s=>hf(s,t.FileReader)));return o}async function gf(e,t){const r=ve(e),n=r.navigator.clipboard,o=[];for(let a=0;a<t.items.length;a++){const s=t.items[a],l=await vh(r,s);o.push(yf(r,l))}if(!(n&&await n.write(o).then(()=>!0,()=>!1)))throw new Error("The Clipboard API is unavailable.")}const pi=globalThis;typeof pi.afterEach=="function"&&pi.afterEach(()=>gh(globalThis.window));typeof pi.afterAll=="function"&&pi.afterAll(()=>Rh(globalThis.window));const Rf=["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 ds(e){return e.matches(Rf)}function Eh(e){return new e.constructor(e.type,e)}function Le(e){for(let r=e;r;r=r.parentElement)if(z(r,["button","input","select","textarea","optgroup","option"])){if(r.hasAttribute("disabled"))return!0}else if(z(r,"fieldset")){var t;if(r.hasAttribute("disabled")&&!(!((t=r.querySelector(":scope > legend"))===null||t===void 0)&&t.contains(e)))return!0}else if(r.tagName.includes("-")&&r.constructor.formAssociated&&r.hasAttribute("disabled"))return!0;return!1}function Bo(e){const t=e.activeElement;return t?.shadowRoot?Bo(t.shadowRoot):Le(t)?e.ownerDocument?e.ownerDocument.body:e.body:t}function Li(e){var t;return(t=Bo(e))!==null&&t!==void 0?t:e.body}function xh(e,t){let r=e;do{if(t(r))return r;r=r.parentElement}while(r&&r!==e.ownerDocument.body)}function ct(e){return e.hasAttribute("contenteditable")&&(e.getAttribute("contenteditable")=="true"||e.getAttribute("contenteditable")=="")}function To(e){const t=Ch(e);return t&&(t.closest('[contenteditable=""]')||t.closest('[contenteditable="true"]'))}function Ch(e){return e.nodeType===1?e:e.parentElement}var wf=(function(e){return e.button="button",e.color="color",e.file="file",e.image="image",e.reset="reset",e.submit="submit",e.checkbox="checkbox",e.radio="radio",e})(wf||{});function Ef(e){return z(e,"button")||z(e,"input")&&e.type in wf}function wt(e){return Cf(e)&&!e.readOnly||ct(e)}var xf=(function(e){return e.text="text",e.date="date",e["datetime-local"]="datetime-local",e.email="email",e.month="month",e.number="number",e.password="password",e.search="search",e.tel="tel",e.time="time",e.url="url",e.week="week",e})(xf||{});function Cf(e){return z(e,"textarea")||z(e,"input")&&e.type in xf}function _e(e){return qf(e)&&Cf(e)}function qh(e){return qf(e)&&Ef(e)}function qf(e){return e.nodeType===1}function _h(e){const t=e.ownerDocument.getSelection();if(t?.focusNode&&_e(e)){const n=To(t.focusNode);if(n){if(!t.isCollapsed){var r;const o=((r=n.firstChild)===null||r===void 0?void 0:r.nodeType)===3?n.firstChild:n;t.setBaseAndExtent(o,0,o,0)}}else t.setBaseAndExtent(e,0,e,0)}}var xe={},Zo={exports:{}};Zo.exports;var ks;function _f(){return ks||(ks=1,(function(e){const r=(i=0)=>a=>`\x1B[${38+i};5;${a}m`,n=(i=0)=>(a,s,l)=>`\x1B[${38+i};2;${a};${s};${l}m`;function o(){const i=new Map,a={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]}};a.color.gray=a.color.blackBright,a.bgColor.bgGray=a.bgColor.bgBlackBright,a.color.grey=a.color.blackBright,a.bgColor.bgGrey=a.bgColor.bgBlackBright;for(const[s,l]of Object.entries(a)){for(const[u,f]of Object.entries(l))a[u]={open:`\x1B[${f[0]}m`,close:`\x1B[${f[1]}m`},l[u]=a[u],i.set(f[0],f[1]);Object.defineProperty(a,s,{value:l,enumerable:!1})}return Object.defineProperty(a,"codes",{value:i,enumerable:!1}),a.color.close="\x1B[39m",a.bgColor.close="\x1B[49m",a.color.ansi256=r(),a.color.ansi16m=n(),a.bgColor.ansi256=r(10),a.bgColor.ansi16m=n(10),Object.defineProperties(a,{rgbToAnsi256:{value:(s,l,u)=>s===l&&l===u?s<8?16:s>248?231:Math.round((s-8)/247*24)+232:16+36*Math.round(s/255*5)+6*Math.round(l/255*5)+Math.round(u/255*5),enumerable:!1},hexToRgb:{value:s=>{const l=/(?<colorString>[a-f\d]{6}|[a-f\d]{3})/i.exec(s.toString(16));if(!l)return[0,0,0];let{colorString:u}=l.groups;u.length===3&&(u=u.split("").map(c=>c+c).join(""));const f=Number.parseInt(u,16);return[f>>16&255,f>>8&255,f&255]},enumerable:!1},hexToAnsi256:{value:s=>a.rgbToAnsi256(...a.hexToRgb(s)),enumerable:!1}}),a}Object.defineProperty(e,"exports",{enumerable:!0,get:o})})(Zo)),Zo.exports}var nt={},js;function Ii(){if(js)return nt;js=1,Object.defineProperty(nt,"__esModule",{value:!0}),nt.printIteratorEntries=t,nt.printIteratorValues=r,nt.printListItems=n,nt.printObjectProperties=o;const e=(i,a)=>{const s=Object.keys(i).sort(a);return Object.getOwnPropertySymbols&&Object.getOwnPropertySymbols(i).forEach(l=>{Object.getOwnPropertyDescriptor(i,l).enumerable&&s.push(l)}),s};function t(i,a,s,l,u,f,c=": "){let d="",b=i.next();if(!b.done){d+=a.spacingOuter;const v=s+a.indent;for(;!b.done;){const R=f(b.value[0],a,v,l,u),S=f(b.value[1],a,v,l,u);d+=v+R+c+S,b=i.next(),b.done?a.min||(d+=","):d+=","+a.spacingInner}d+=a.spacingOuter+s}return d}function r(i,a,s,l,u,f){let c="",d=i.next();if(!d.done){c+=a.spacingOuter;const b=s+a.indent;for(;!d.done;)c+=b+f(d.value,a,b,l,u),d=i.next(),d.done?a.min||(c+=","):c+=","+a.spacingInner;c+=a.spacingOuter+s}return c}function n(i,a,s,l,u,f){let c="";if(i.length){c+=a.spacingOuter;const d=s+a.indent;for(let b=0;b<i.length;b++)c+=d,b in i&&(c+=f(i[b],a,d,l,u)),b<i.length-1?c+=","+a.spacingInner:a.min||(c+=",");c+=a.spacingOuter+s}return c}function o(i,a,s,l,u,f){let c="";const d=e(i,a.compareKeys);if(d.length){c+=a.spacingOuter;const b=s+a.indent;for(let v=0;v<d.length;v++){const R=d[v],S=f(R,a,b,l,u),p=f(i[R],a,b,l,u);c+=b+S+": "+p,v<d.length-1?c+=","+a.spacingInner:a.min||(c+=",")}c+=a.spacingOuter+s}return c}return nt}var Se={},Ds;function Ph(){if(Ds)return Se;Ds=1,Object.defineProperty(Se,"__esModule",{value:!0}),Se.test=Se.serialize=Se.default=void 0;var e=Ii(),t=(function(){return typeof globalThis<"u"?globalThis:typeof t<"u"?t:typeof self<"u"?self:typeof window<"u"?window:Function("return this")()})(),r=t["jest-symbol-do-not-touch"]||t.Symbol;const n=typeof r=="function"&&r.for?r.for("jest.asymmetricMatcher"):1267621,o=" ",i=(u,f,c,d,b,v)=>{const R=u.toString();return R==="ArrayContaining"||R==="ArrayNotContaining"?++d>f.maxDepth?"["+R+"]":R+o+"["+(0,e.printListItems)(u.sample,f,c,d,b,v)+"]":R==="ObjectContaining"||R==="ObjectNotContaining"?++d>f.maxDepth?"["+R+"]":R+o+"{"+(0,e.printObjectProperties)(u.sample,f,c,d,b,v)+"}":R==="StringMatching"||R==="StringNotMatching"||R==="StringContaining"||R==="StringNotContaining"?R+o+v(u.sample,f,c,d,b):u.toAsymmetricMatcher()};Se.serialize=i;const a=u=>u&&u.$$typeof===n;Se.test=a;var l={serialize:i,test:a};return Se.default=l,Se}var Ae={},Fi,$s;function Th(){return $s||($s=1,Fi=({onlyFirst:e=!1}={})=>{const t=["[\\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(t,e?void 0:"g")}),Fi}var Bs;function Sh(){if(Bs)return Ae;Bs=1,Object.defineProperty(Ae,"__esModule",{value:!0}),Ae.test=Ae.serialize=Ae.default=void 0;var e=r(Th()),t=r(_f());function r(l){return l&&l.__esModule?l:{default:l}}const n=l=>l.replace((0,e.default)(),u=>{switch(u){case t.default.red.close:case t.default.green.close:case t.default.cyan.close:case t.default.gray.close:case t.default.white.close:case t.default.yellow.close:case t.default.bgRed.close:case t.default.bgGreen.close:case t.default.bgYellow.close:case t.default.inverse.close:case t.default.dim.close:case t.default.bold.close:case t.default.reset.open:case t.default.reset.close:return"</>";case t.default.red.open:return"<red>";case t.default.green.open:return"<green>";case t.default.cyan.open:return"<cyan>";case t.default.gray.open:return"<gray>";case t.default.white.open:return"<white>";case t.default.yellow.open:return"<yellow>";case t.default.bgRed.open:return"<bgRed>";case t.default.bgGreen.open:return"<bgGreen>";case t.default.bgYellow.open:return"<bgYellow>";case t.default.inverse.open:return"<inverse>";case t.default.dim.open:return"<dim>";case t.default.bold.open:return"<bold>";default:return""}}),o=l=>typeof l=="string"&&!!l.match((0,e.default)());Ae.test=o;const i=(l,u,f,c,d,b)=>b(n(l),u,f,c,d);Ae.serialize=i;var s={serialize:i,test:o};return Ae.default=s,Ae}var Me={},Ls;function Ah(){if(Ls)return Me;Ls=1,Object.defineProperty(Me,"__esModule",{value:!0}),Me.test=Me.serialize=Me.default=void 0;var e=Ii();const t=" ",r=["DOMStringMap","NamedNodeMap"],n=/^(HTML\w*Collection|NodeList)$/,o=f=>r.indexOf(f)!==-1||n.test(f),i=f=>f&&f.constructor&&!!f.constructor.name&&o(f.constructor.name);Me.test=i;const a=f=>f.constructor.name==="NamedNodeMap",s=(f,c,d,b,v,R)=>{const S=f.constructor.name;return++b>c.maxDepth?"["+S+"]":(c.min?"":S+t)+(r.indexOf(S)!==-1?"{"+(0,e.printObjectProperties)(a(f)?Array.from(f).reduce((p,q)=>(p[q.name]=q.value,p),{}):{...f},c,d,b,v,R)+"}":"["+(0,e.printListItems)(Array.from(f),c,d,b,v,R)+"]")};Me.serialize=s;var u={serialize:s,test:i};return Me.default=u,Me}var Oe={},ce={},Ho={},Fs;function Mh(){if(Fs)return Ho;Fs=1,Object.defineProperty(Ho,"__esModule",{value:!0}),Ho.default=e;function e(t){return t.replace(/</g,"<").replace(/>/g,">")}return Ho}var Us;function fs(){if(Us)return ce;Us=1,Object.defineProperty(ce,"__esModule",{value:!0}),ce.printText=ce.printProps=ce.printElementAsLeaf=ce.printElement=ce.printComment=ce.printChildren=void 0;var e=t(Mh());function t(l){return l&&l.__esModule?l:{default:l}}const r=(l,u,f,c,d,b,v)=>{const R=c+f.indent,S=f.colors;return l.map(p=>{const q=u[p];let _=v(q,f,R,d,b);return typeof q!="string"&&(_.indexOf(`
|
|
7
|
+
`,document.head.appendChild(zo));const Oi=({className:e,children:t,dataTestId:r})=>B.jsxRuntimeExports.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 ${e}`,"data-testid":r,children:t}),Xm=()=>B.jsxRuntimeExports.jsx(Oi,{className:"lucide-play-icon lucide-play",dataTestId:"play-icon",children:B.jsxRuntimeExports.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"})}),mf=({id:e,name:t,skip:r,only:n})=>B.jsxRuntimeExports.jsxs(B.jsxRuntimeExports.Fragment,{children:[t," ",n&&B.jsxRuntimeExports.jsxs("span",{style:{color:"#2563eb"},"data-testid":`only-indicator-${e}`,children:[" ","(only)"]}),r&&B.jsxRuntimeExports.jsxs("span",{style:{color:"#6b7280"},"data-testid":`skip-indicator-${e}`,children:[" ","(skipped)"]})]}),Jm=e=>{switch(e.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"}}}},Qm=e=>e.startsWith("Assertion passed")||e.startsWith("Event fired")?{color:"#0d542b",fontWeight:"700"}:e.startsWith("Test failed")?{color:"#fb2c36",fontWeight:"700"}:{},Zm=({node:e,depth:t,id:r,runTest:n})=>{const o=Jm(e);return B.jsxRuntimeExports.jsxs("li",{style:{marginBottom:"4px",marginLeft:t*6,...o.container},"data-testid":`test-list-item-${r}`,children:[B.jsxRuntimeExports.jsxs("div",{style:{display:"flex",alignItems:"left",justifyContent:"space-between",padding:"4px 6px",borderRadius:"4px",...o.item},children:[B.jsxRuntimeExports.jsx("span",{style:{fontWeight:"500",color:"#374151",maxWidth:"220px"},children:B.jsxRuntimeExports.jsx(mf,{id:r,name:e.name,skip:e.skip,only:e.only})}),B.jsxRuntimeExports.jsx("button",{onClick:()=>n(r),"aria-label":`Run ${e.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:e.status==="running","data-testid":`run-test-button-${r}`,children:e.status==="running"?B.jsxRuntimeExports.jsx(Ym,{}):B.jsxRuntimeExports.jsx(Xm,{})})]}),e.logs&&e.logs.length>0&&B.jsxRuntimeExports.jsx("ul",{style:{borderRadius:"4px",maxHeight:"260px",overflowY:"auto",padding:0,background:"#f3f4f6",listStyle:"none",marginTop:"4px",textAlign:"left"},children:e.logs.map((i,a)=>B.jsxRuntimeExports.jsx("li",{style:{fontSize:"12px",padding:"4px 6px",borderBottom:"1px solid #d1d5db",color:"#374151",...Qm(i)},children:i},a))})]},e.name)},eh=()=>B.jsxRuntimeExports.jsx(Oi,{className:"lucide-chevron-down-icon lucide-chevron-down",dataTestId:"chevron-down-icon",children:B.jsxRuntimeExports.jsx("path",{d:"m6 9 6 6 6-6"})}),th=()=>B.jsxRuntimeExports.jsx(Oi,{className:"lucide-chevron-right-icon lucide-chevron-right",dataTestId:"chevron-right-icon",children:B.jsxRuntimeExports.jsx("path",{d:"m9 18 6-6-6-6"})}),rh=({tests:e,runTest:t})=>{const[r,n]=oi.useState({}),o=s=>n(l=>({...l,[s]:!l[s]})),i=(s,l=0)=>{if(s.type==="test")return B.jsxRuntimeExports.jsx(Zm,{node:s,depth:l,id:s.id,runTest:()=>t(s.id)},s.id);const u=r[s.id];return B.jsxRuntimeExports.jsxs("li",{style:{marginLeft:l*12},children:[B.jsxRuntimeExports.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":!u,onClick:()=>o(s.id),children:[B.jsxRuntimeExports.jsx(mf,{id:s.id,name:s.name,skip:s.skip,only:s.only}),u?B.jsxRuntimeExports.jsx(th,{}):B.jsxRuntimeExports.jsx(eh,{})]}),!u&&s.childrenNodes&&s.childrenNodes.length>0&&B.jsxRuntimeExports.jsx("ul",{style:{listStyle:"none",padding:0,margin:0},children:s.childrenNodes.map(f=>i(f,l+1))})]},s.id)},a=Gm(e);return B.jsxRuntimeExports.jsx("ul",{style:{listStyle:"none",padding:0,margin:0},children:a.map(s=>i(s))})},nh={left:{left:0,borderTopRightRadius:"6px",borderBottomRightRadius:"6px",borderTopLeftRadius:"0",borderBottomLeftRadius:"0"},right:{right:0,borderTopLeftRadius:"6px",borderBottomLeftRadius:"6px",borderTopRightRadius:"0",borderBottomRightRadius:"0"}},oh=({setOpen:e,position:t})=>B.jsxRuntimeExports.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",...nh[t]},onClick:()=>e(!0),children:"TWD"}),ih=({isOpen:e,position:t})=>{oi.useEffect(()=>{const r=document.documentElement;return e?t==="left"?r.style.marginLeft="280px":r.style.marginRight="280px":(r.style.marginRight="0",r.style.marginLeft="0"),()=>{r.style.marginRight="0",r.style.marginLeft="0"}},[e,t])},ah=()=>B.jsxRuntimeExports.jsxs(Oi,{className:"lucide-wifi-pen-icon lucide-wifi-pen",dataTestId:"wifi-pen-icon",children:[B.jsxRuntimeExports.jsx("path",{d:"M2 8.82a15 15 0 0 1 20 0"}),B.jsxRuntimeExports.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"}),B.jsxRuntimeExports.jsx("path",{d:"M5 12.859a10 10 0 0 1 10.5-2.222"}),B.jsxRuntimeExports.jsx("path",{d:"M8.5 16.429a5 5 0 0 1 3-1.406"})]}),sh=()=>{const e=vd(),t=e.filter(n=>n.executed),r=()=>{console.group("🌐 TWD Mock Rules"),console.log("Total rules:",e.length),console.log("Triggered rules:",t.length),console.log("Rules details:"),console.log(e),console.groupEnd()};return B.jsxRuntimeExports.jsxs("button",{onClick:r,"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:[B.jsxRuntimeExports.jsx(ah,{}),B.jsxRuntimeExports.jsxs("span",{style:{flex:1},children:["Rules: ",t.length,"/",e.length," triggered"]}),B.jsxRuntimeExports.jsx("span",{style:{fontSize:"10px",color:"#1E293B",fontWeight:"500"},children:"View rules in console"})]})},lh={left:{left:0,borderRight:"1px solid #e5e7eb"},right:{right:0,borderLeft:"1px solid #e5e7eb"}},uh='-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"',ch=({open:e,position:t="left"})=>{const[r,n]=oi.useState(0),[o,i]=oi.useState(e);ih({isOpen:o,position:t});const a=new xo.TestRunner({onStart:c=>{c.status="running",n(d=>d+1)},onPass:c=>{c.status="pass",n(d=>d+1)},onFail:(c,d)=>{c.status="fail",console.error("Test failed:",c.name,d),c.logs.push(`Test failed: ${d.message}`),n(b=>b+1)},onSkip:c=>{c.status="skip",n(d=>d+1)}}),s=async()=>{await a.runAll()},l=async c=>{const d=Array.from(xo.handlers.values()).filter(b=>b.type==="test").find(b=>b.id===c);d&&await a.runSingle(d.id)},u=Array.from(xo.handlers.values());if(!o)return B.jsxRuntimeExports.jsx(oh,{position:t,setOpen:i});const f=u.filter(c=>c.type==="test").length;return B.jsxRuntimeExports.jsxs("div",{style:{fontFamily:uh,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,...lh[t]},"data-testid":"twd-sidebar",children:[B.jsxRuntimeExports.jsxs("div",{style:{padding:"8px",background:"#f9fafb",position:"sticky",top:0,zIndex:1e3,borderBottom:"1px solid #e5e7eb"},children:[B.jsxRuntimeExports.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"14px"},children:[B.jsxRuntimeExports.jsx("button",{onClick:s,style:{background:"#1A6EF4",color:"white",padding:"4px 8px",borderRadius:"4px",border:"none",cursor:"pointer"},children:"Run All"}),B.jsxRuntimeExports.jsx("button",{"aria-label":"Close sidebar",style:{background:"transparent",border:"none",cursor:"pointer",fontSize:"14px",paddingRight:"0",paddingLeft:"0"},onClick:()=>i(!1),children:"✖"})]}),B.jsxRuntimeExports.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",fontSize:"14px",color:"#6b7280",marginBottom:"10px"},children:[B.jsxRuntimeExports.jsxs("span",{style:{color:"#374151"},children:["Total: ",f]}),B.jsxRuntimeExports.jsxs("div",{style:{display:"flex",gap:"4px"},children:[B.jsxRuntimeExports.jsxs("span",{style:{color:"#00c951"},children:["✓ ",u.filter(c=>c.status==="pass").length]}),B.jsxRuntimeExports.jsxs("span",{style:{color:"#fb2c36"},children:["✗ ",u.filter(c=>c.status==="fail").length]})]})]}),B.jsxRuntimeExports.jsx(sh,{})]}),B.jsxRuntimeExports.jsx("div",{style:{padding:"8px"},children:B.jsxRuntimeExports.jsx(rh,{tests:u.map(c=>({name:c.name,depth:c.depth,status:c.status,logs:c.logs,id:c.id,parent:c.parent,type:c.type,only:c.only,skip:c.skip})),runTest:l})})]})},dh=e=>{const{Component:t,createRoot:r}=e,n=document.createElement("div");n.setAttribute("id","twd-sidebar-root"),document.body.appendChild(n),r(n).render(t)},fh=async(e,t,r)=>{for(const n in e)await e[n]();dh({Component:t,createRoot:r})};function z(e,t,r){return e.namespaceURI&&e.namespaceURI!=="http://www.w3.org/1999/xhtml"||(t=Array.isArray(t)?t:[t],!t.includes(e.tagName.toLowerCase()))?!1:r?Object.entries(r).every(([n,o])=>e[n]===o):!0}function ve(e){var t;if(ph(e)&&e.defaultView)return e.defaultView;if(!((t=e.ownerDocument)===null||t===void 0)&&t.defaultView)return e.ownerDocument.defaultView;throw new Error(`Could not determine window of node. Node was ${mh(e)}`)}function ph(e){return e.nodeType===9}function mh(e){return typeof e=="function"?`function ${e.name}`:e===null?"null":String(e)}function hf(e,t){return new Promise((r,n)=>{const o=new t;o.onerror=n,o.onabort=n,o.onload=()=>{r(String(o.result))},o.readAsText(e)})}function ls(e,t){const r={...t,length:t.length,item:n=>r[n],[Symbol.iterator]:function*(){for(let o=0;o<r.length;o++)yield r[o]}};return r.constructor=e.FileList,e.FileList&&Object.setPrototypeOf(r,e.FileList.prototype),Object.freeze(r),r}function Ye(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}class bf{getAsFile(){return this.file}getAsString(t){typeof this.data=="string"&&t(this.data)}webkitGetAsEntry(){throw new Error("not implemented")}constructor(t,r){Ye(this,"kind",void 0),Ye(this,"type",void 0),Ye(this,"file",null),Ye(this,"data",void 0),typeof t=="string"?(this.kind="string",this.type=String(r),this.data=t):(this.kind="file",this.type=t.type,this.file=t)}}class hh extends Array{add(...t){const r=new bf(t[0],t[1]);return this.push(r),r}clear(){this.splice(0,this.length)}remove(t){this.splice(t,1)}}function Vo(e,t){const[r,n]=e.split("/"),o=!n||n==="*";return i=>t?i.type===(o?r:e):o?i.type.startsWith(`${r}/`):i.type===r}function bh(e){return new class{getData(r){var n;const o=(n=this.items.find(Vo(r,!0)))!==null&&n!==void 0?n:this.items.find(Vo(r,!1));let i="";return o?.getAsString(a=>{i=a}),i}setData(r,n){const o=this.items.findIndex(Vo(r,!0)),i=new bf(n,r);o>=0?this.items.splice(o,1,i):this.items.push(i)}clearData(r){if(r){const n=this.items.findIndex(Vo(r,!0));n>=0&&this.items.remove(n)}else this.items.clear()}get types(){const r=[];return this.files.length&&r.push("Files"),this.items.forEach(n=>r.push(n.type)),Object.freeze(r),r}setDragImage(){}constructor(){Ye(this,"dropEffect","none"),Ye(this,"effectAllowed","uninitialized"),Ye(this,"items",new hh),Ye(this,"files",ls(e,[]))}}}function us(e,t=[]){const r=typeof e.DataTransfer>"u"?bh(e):new e.DataTransfer;return Object.defineProperty(r,"files",{get:()=>ls(e,t)}),r}async function vh(e,t){return t.kind==="file"?t.getAsFile():new e.Blob([await new Promise(r=>t.getAsString(r))],{type:t.type})}function vf(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function yf(e,...t){const r=Object.fromEntries(t.map(n=>[typeof n=="string"?"text/plain":n.type,Promise.resolve(n)]));return typeof e.ClipboardItem<"u"?new e.ClipboardItem(r):new class{get types(){return Array.from(Object.keys(this.data))}async getType(o){const i=await this.data[o];if(!i)throw new Error(`${o} is not one of the available MIME types on this item.`);return i instanceof e.Blob?i:new e.Blob([i],{type:o})}constructor(o){vf(this,"data",void 0),this.data=o}}(r)}const Rt=Symbol("Manage ClipboardSub");function Ns(e,t){return Object.assign(new class extends e.EventTarget{async read(){return Array.from(this.items)}async readText(){let n="";for(const o of this.items){const i=o.types.includes("text/plain")?"text/plain":o.types.find(a=>a.startsWith("text/"));i&&(n+=await o.getType(i).then(a=>hf(a,e.FileReader)))}return n}async write(n){this.items=n}async writeText(n){this.items=[yf(e,n)]}constructor(...n){super(...n),vf(this,"items",[])}},{[Rt]:t})}function cs(e){return!!e?.[Rt]}function yh(e){if(cs(e.navigator.clipboard))return e.navigator.clipboard[Rt];const t=Object.getOwnPropertyDescriptor(e.navigator,"clipboard");let r;const n={resetClipboardStub:()=>{r=Ns(e,n)},detachClipboardStub:()=>{t?Object.defineProperty(e.navigator,"clipboard",t):Object.defineProperty(e.navigator,"clipboard",{value:void 0,configurable:!0})}};return r=Ns(e,n),Object.defineProperty(e.navigator,"clipboard",{get:()=>r,configurable:!0}),r[Rt]}function gh(e){cs(e.navigator.clipboard)&&e.navigator.clipboard[Rt].resetClipboardStub()}function Rh(e){cs(e.navigator.clipboard)&&e.navigator.clipboard[Rt].detachClipboardStub()}async function wh(e){const t=e.defaultView,r=t?.navigator.clipboard,n=r&&await r.read();if(!n)throw new Error("The Clipboard API is unavailable.");const o=us(t);for(const i of n)for(const a of i.types)o.setData(a,await i.getType(a).then(s=>hf(s,t.FileReader)));return o}async function gf(e,t){const r=ve(e),n=r.navigator.clipboard,o=[];for(let a=0;a<t.items.length;a++){const s=t.items[a],l=await vh(r,s);o.push(yf(r,l))}if(!(n&&await n.write(o).then(()=>!0,()=>!1)))throw new Error("The Clipboard API is unavailable.")}const pi=globalThis;typeof pi.afterEach=="function"&&pi.afterEach(()=>gh(globalThis.window));typeof pi.afterAll=="function"&&pi.afterAll(()=>Rh(globalThis.window));const Rf=["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 ds(e){return e.matches(Rf)}function Eh(e){return new e.constructor(e.type,e)}function Le(e){for(let r=e;r;r=r.parentElement)if(z(r,["button","input","select","textarea","optgroup","option"])){if(r.hasAttribute("disabled"))return!0}else if(z(r,"fieldset")){var t;if(r.hasAttribute("disabled")&&!(!((t=r.querySelector(":scope > legend"))===null||t===void 0)&&t.contains(e)))return!0}else if(r.tagName.includes("-")&&r.constructor.formAssociated&&r.hasAttribute("disabled"))return!0;return!1}function Bo(e){const t=e.activeElement;return t?.shadowRoot?Bo(t.shadowRoot):Le(t)?e.ownerDocument?e.ownerDocument.body:e.body:t}function Li(e){var t;return(t=Bo(e))!==null&&t!==void 0?t:e.body}function xh(e,t){let r=e;do{if(t(r))return r;r=r.parentElement}while(r&&r!==e.ownerDocument.body)}function ct(e){return e.hasAttribute("contenteditable")&&(e.getAttribute("contenteditable")=="true"||e.getAttribute("contenteditable")=="")}function To(e){const t=Ch(e);return t&&(t.closest('[contenteditable=""]')||t.closest('[contenteditable="true"]'))}function Ch(e){return e.nodeType===1?e:e.parentElement}var wf=(function(e){return e.button="button",e.color="color",e.file="file",e.image="image",e.reset="reset",e.submit="submit",e.checkbox="checkbox",e.radio="radio",e})(wf||{});function Ef(e){return z(e,"button")||z(e,"input")&&e.type in wf}function wt(e){return Cf(e)&&!e.readOnly||ct(e)}var xf=(function(e){return e.text="text",e.date="date",e["datetime-local"]="datetime-local",e.email="email",e.month="month",e.number="number",e.password="password",e.search="search",e.tel="tel",e.time="time",e.url="url",e.week="week",e})(xf||{});function Cf(e){return z(e,"textarea")||z(e,"input")&&e.type in xf}function _e(e){return qf(e)&&Cf(e)}function qh(e){return qf(e)&&Ef(e)}function qf(e){return e.nodeType===1}function _h(e){const t=e.ownerDocument.getSelection();if(t?.focusNode&&_e(e)){const n=To(t.focusNode);if(n){if(!t.isCollapsed){var r;const o=((r=n.firstChild)===null||r===void 0?void 0:r.nodeType)===3?n.firstChild:n;t.setBaseAndExtent(o,0,o,0)}}else t.setBaseAndExtent(e,0,e,0)}}var xe={},Zo={exports:{}};Zo.exports;var ks;function _f(){return ks||(ks=1,(function(e){const r=(i=0)=>a=>`\x1B[${38+i};5;${a}m`,n=(i=0)=>(a,s,l)=>`\x1B[${38+i};2;${a};${s};${l}m`;function o(){const i=new Map,a={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]}};a.color.gray=a.color.blackBright,a.bgColor.bgGray=a.bgColor.bgBlackBright,a.color.grey=a.color.blackBright,a.bgColor.bgGrey=a.bgColor.bgBlackBright;for(const[s,l]of Object.entries(a)){for(const[u,f]of Object.entries(l))a[u]={open:`\x1B[${f[0]}m`,close:`\x1B[${f[1]}m`},l[u]=a[u],i.set(f[0],f[1]);Object.defineProperty(a,s,{value:l,enumerable:!1})}return Object.defineProperty(a,"codes",{value:i,enumerable:!1}),a.color.close="\x1B[39m",a.bgColor.close="\x1B[49m",a.color.ansi256=r(),a.color.ansi16m=n(),a.bgColor.ansi256=r(10),a.bgColor.ansi16m=n(10),Object.defineProperties(a,{rgbToAnsi256:{value:(s,l,u)=>s===l&&l===u?s<8?16:s>248?231:Math.round((s-8)/247*24)+232:16+36*Math.round(s/255*5)+6*Math.round(l/255*5)+Math.round(u/255*5),enumerable:!1},hexToRgb:{value:s=>{const l=/(?<colorString>[a-f\d]{6}|[a-f\d]{3})/i.exec(s.toString(16));if(!l)return[0,0,0];let{colorString:u}=l.groups;u.length===3&&(u=u.split("").map(c=>c+c).join(""));const f=Number.parseInt(u,16);return[f>>16&255,f>>8&255,f&255]},enumerable:!1},hexToAnsi256:{value:s=>a.rgbToAnsi256(...a.hexToRgb(s)),enumerable:!1}}),a}Object.defineProperty(e,"exports",{enumerable:!0,get:o})})(Zo)),Zo.exports}var nt={},js;function Ii(){if(js)return nt;js=1,Object.defineProperty(nt,"__esModule",{value:!0}),nt.printIteratorEntries=t,nt.printIteratorValues=r,nt.printListItems=n,nt.printObjectProperties=o;const e=(i,a)=>{const s=Object.keys(i).sort(a);return Object.getOwnPropertySymbols&&Object.getOwnPropertySymbols(i).forEach(l=>{Object.getOwnPropertyDescriptor(i,l).enumerable&&s.push(l)}),s};function t(i,a,s,l,u,f,c=": "){let d="",b=i.next();if(!b.done){d+=a.spacingOuter;const v=s+a.indent;for(;!b.done;){const R=f(b.value[0],a,v,l,u),S=f(b.value[1],a,v,l,u);d+=v+R+c+S,b=i.next(),b.done?a.min||(d+=","):d+=","+a.spacingInner}d+=a.spacingOuter+s}return d}function r(i,a,s,l,u,f){let c="",d=i.next();if(!d.done){c+=a.spacingOuter;const b=s+a.indent;for(;!d.done;)c+=b+f(d.value,a,b,l,u),d=i.next(),d.done?a.min||(c+=","):c+=","+a.spacingInner;c+=a.spacingOuter+s}return c}function n(i,a,s,l,u,f){let c="";if(i.length){c+=a.spacingOuter;const d=s+a.indent;for(let b=0;b<i.length;b++)c+=d,b in i&&(c+=f(i[b],a,d,l,u)),b<i.length-1?c+=","+a.spacingInner:a.min||(c+=",");c+=a.spacingOuter+s}return c}function o(i,a,s,l,u,f){let c="";const d=e(i,a.compareKeys);if(d.length){c+=a.spacingOuter;const b=s+a.indent;for(let v=0;v<d.length;v++){const R=d[v],S=f(R,a,b,l,u),p=f(i[R],a,b,l,u);c+=b+S+": "+p,v<d.length-1?c+=","+a.spacingInner:a.min||(c+=",")}c+=a.spacingOuter+s}return c}return nt}var Se={},Ds;function Ph(){if(Ds)return Se;Ds=1,Object.defineProperty(Se,"__esModule",{value:!0}),Se.test=Se.serialize=Se.default=void 0;var e=Ii(),t=(function(){return typeof globalThis<"u"?globalThis:typeof t<"u"?t:typeof self<"u"?self:typeof window<"u"?window:Function("return this")()})(),r=t["jest-symbol-do-not-touch"]||t.Symbol;const n=typeof r=="function"&&r.for?r.for("jest.asymmetricMatcher"):1267621,o=" ",i=(u,f,c,d,b,v)=>{const R=u.toString();return R==="ArrayContaining"||R==="ArrayNotContaining"?++d>f.maxDepth?"["+R+"]":R+o+"["+(0,e.printListItems)(u.sample,f,c,d,b,v)+"]":R==="ObjectContaining"||R==="ObjectNotContaining"?++d>f.maxDepth?"["+R+"]":R+o+"{"+(0,e.printObjectProperties)(u.sample,f,c,d,b,v)+"}":R==="StringMatching"||R==="StringNotMatching"||R==="StringContaining"||R==="StringNotContaining"?R+o+v(u.sample,f,c,d,b):u.toAsymmetricMatcher()};Se.serialize=i;const a=u=>u&&u.$$typeof===n;Se.test=a;var l={serialize:i,test:a};return Se.default=l,Se}var Ae={},Fi,$s;function Th(){return $s||($s=1,Fi=({onlyFirst:e=!1}={})=>{const t=["[\\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(t,e?void 0:"g")}),Fi}var Bs;function Sh(){if(Bs)return Ae;Bs=1,Object.defineProperty(Ae,"__esModule",{value:!0}),Ae.test=Ae.serialize=Ae.default=void 0;var e=r(Th()),t=r(_f());function r(l){return l&&l.__esModule?l:{default:l}}const n=l=>l.replace((0,e.default)(),u=>{switch(u){case t.default.red.close:case t.default.green.close:case t.default.cyan.close:case t.default.gray.close:case t.default.white.close:case t.default.yellow.close:case t.default.bgRed.close:case t.default.bgGreen.close:case t.default.bgYellow.close:case t.default.inverse.close:case t.default.dim.close:case t.default.bold.close:case t.default.reset.open:case t.default.reset.close:return"</>";case t.default.red.open:return"<red>";case t.default.green.open:return"<green>";case t.default.cyan.open:return"<cyan>";case t.default.gray.open:return"<gray>";case t.default.white.open:return"<white>";case t.default.yellow.open:return"<yellow>";case t.default.bgRed.open:return"<bgRed>";case t.default.bgGreen.open:return"<bgGreen>";case t.default.bgYellow.open:return"<bgYellow>";case t.default.inverse.open:return"<inverse>";case t.default.dim.open:return"<dim>";case t.default.bold.open:return"<bold>";default:return""}}),o=l=>typeof l=="string"&&!!l.match((0,e.default)());Ae.test=o;const i=(l,u,f,c,d,b)=>b(n(l),u,f,c,d);Ae.serialize=i;var s={serialize:i,test:o};return Ae.default=s,Ae}var Me={},Ls;function Ah(){if(Ls)return Me;Ls=1,Object.defineProperty(Me,"__esModule",{value:!0}),Me.test=Me.serialize=Me.default=void 0;var e=Ii();const t=" ",r=["DOMStringMap","NamedNodeMap"],n=/^(HTML\w*Collection|NodeList)$/,o=f=>r.indexOf(f)!==-1||n.test(f),i=f=>f&&f.constructor&&!!f.constructor.name&&o(f.constructor.name);Me.test=i;const a=f=>f.constructor.name==="NamedNodeMap",s=(f,c,d,b,v,R)=>{const S=f.constructor.name;return++b>c.maxDepth?"["+S+"]":(c.min?"":S+t)+(r.indexOf(S)!==-1?"{"+(0,e.printObjectProperties)(a(f)?Array.from(f).reduce((p,q)=>(p[q.name]=q.value,p),{}):{...f},c,d,b,v,R)+"}":"["+(0,e.printListItems)(Array.from(f),c,d,b,v,R)+"]")};Me.serialize=s;var u={serialize:s,test:i};return Me.default=u,Me}var Oe={},ce={},Ho={},Fs;function Mh(){if(Fs)return Ho;Fs=1,Object.defineProperty(Ho,"__esModule",{value:!0}),Ho.default=e;function e(t){return t.replace(/</g,"<").replace(/>/g,">")}return Ho}var Us;function fs(){if(Us)return ce;Us=1,Object.defineProperty(ce,"__esModule",{value:!0}),ce.printText=ce.printProps=ce.printElementAsLeaf=ce.printElement=ce.printComment=ce.printChildren=void 0;var e=t(Mh());function t(l){return l&&l.__esModule?l:{default:l}}const r=(l,u,f,c,d,b,v)=>{const R=c+f.indent,S=f.colors;return l.map(p=>{const q=u[p];let _=v(q,f,R,d,b);return typeof q!="string"&&(_.indexOf(`
|
|
8
8
|
`)!==-1&&(_=f.spacingOuter+R+_+f.spacingOuter+c),_="{"+_+"}"),f.spacingInner+c+S.prop.open+p+S.prop.close+"="+S.value.open+_+S.value.close}).join("")};ce.printProps=r;const n=(l,u,f,c,d,b)=>l.map(v=>u.spacingOuter+f+(typeof v=="string"?o(v,u):b(v,u,f,c,d))).join("");ce.printChildren=n;const o=(l,u)=>{const f=u.colors.content;return f.open+(0,e.default)(l)+f.close};ce.printText=o;const i=(l,u)=>{const f=u.colors.comment;return f.open+"<!--"+(0,e.default)(l)+"-->"+f.close};ce.printComment=i;const a=(l,u,f,c,d)=>{const b=c.colors.tag;return b.open+"<"+l+(u&&b.close+u+c.spacingOuter+d+b.open)+(f?">"+b.close+f+c.spacingOuter+d+b.open+"</"+l:(u&&!c.min?"":" ")+"/")+">"+b.close};ce.printElement=a;const s=(l,u)=>{const f=u.colors.tag;return f.open+"<"+l+f.close+" …"+f.open+" />"+f.close};return ce.printElementAsLeaf=s,ce}var zs;function Oh(){if(zs)return Oe;zs=1,Object.defineProperty(Oe,"__esModule",{value:!0}),Oe.test=Oe.serialize=Oe.default=void 0;var e=fs();const t=1,r=3,n=8,o=11,i=/^((HTML|SVG)\w*)?Element$/,a=R=>{try{return typeof R.hasAttribute=="function"&&R.hasAttribute("is")}catch{return!1}},s=R=>{const S=R.constructor.name,{nodeType:p,tagName:q}=R,_=typeof q=="string"&&q.includes("-")||a(R);return p===t&&(i.test(S)||_)||p===r&&S==="Text"||p===n&&S==="Comment"||p===o&&S==="DocumentFragment"},l=R=>{var S;return(R==null||(S=R.constructor)===null||S===void 0?void 0:S.name)&&s(R)};Oe.test=l;function u(R){return R.nodeType===r}function f(R){return R.nodeType===n}function c(R){return R.nodeType===o}const d=(R,S,p,q,_,T)=>{if(u(R))return(0,e.printText)(R.data,S);if(f(R))return(0,e.printComment)(R.data,S);const P=c(R)?"DocumentFragment":R.tagName.toLowerCase();return++q>S.maxDepth?(0,e.printElementAsLeaf)(P,S):(0,e.printElement)(P,(0,e.printProps)(c(R)?[]:Array.from(R.attributes).map(y=>y.name).sort(),c(R)?{}:Array.from(R.attributes).reduce((y,g)=>(y[g.name]=g.value,y),{}),S,p+S.indent,q,_,T),(0,e.printChildren)(Array.prototype.slice.call(R.childNodes||R.children),S,p+S.indent,q,_,T),S,p)};Oe.serialize=d;var v={serialize:d,test:l};return Oe.default=v,Oe}var Ie={},Vs;function Ih(){if(Vs)return Ie;Vs=1,Object.defineProperty(Ie,"__esModule",{value:!0}),Ie.test=Ie.serialize=Ie.default=void 0;var e=Ii();const t="@@__IMMUTABLE_ITERABLE__@@",r="@@__IMMUTABLE_LIST__@@",n="@@__IMMUTABLE_KEYED__@@",o="@@__IMMUTABLE_MAP__@@",i="@@__IMMUTABLE_ORDERED__@@",a="@@__IMMUTABLE_RECORD__@@",s="@@__IMMUTABLE_SEQ__@@",l="@@__IMMUTABLE_SET__@@",u="@@__IMMUTABLE_STACK__@@",f=g=>"Immutable."+g,c=g=>"["+g+"]",d=" ",b="…",v=(g,E,M,N,j,D,A)=>++N>E.maxDepth?c(f(A)):f(A)+d+"{"+(0,e.printIteratorEntries)(g.entries(),E,M,N,j,D)+"}";function R(g){let E=0;return{next(){if(E<g._keys.length){const M=g._keys[E++];return{done:!1,value:[M,g.get(M)]}}return{done:!0,value:void 0}}}}const S=(g,E,M,N,j,D)=>{const A=f(g._name||"Record");return++N>E.maxDepth?c(A):A+d+"{"+(0,e.printIteratorEntries)(R(g),E,M,N,j,D)+"}"},p=(g,E,M,N,j,D)=>{const A=f("Seq");return++N>E.maxDepth?c(A):g[n]?A+d+"{"+(g._iter||g._object?(0,e.printIteratorEntries)(g.entries(),E,M,N,j,D):b)+"}":A+d+"["+(g._iter||g._array||g._collection||g._iterable?(0,e.printIteratorValues)(g.values(),E,M,N,j,D):b)+"]"},q=(g,E,M,N,j,D,A)=>++N>E.maxDepth?c(f(A)):f(A)+d+"["+(0,e.printIteratorValues)(g.values(),E,M,N,j,D)+"]",_=(g,E,M,N,j,D)=>g[o]?v(g,E,M,N,j,D,g[i]?"OrderedMap":"Map"):g[r]?q(g,E,M,N,j,D,"List"):g[l]?q(g,E,M,N,j,D,g[i]?"OrderedSet":"Set"):g[u]?q(g,E,M,N,j,D,"Stack"):g[s]?p(g,E,M,N,j,D):S(g,E,M,N,j,D);Ie.serialize=_;const T=g=>g&&(g[t]===!0||g[a]===!0);Ie.test=T;var y={serialize:_,test:T};return Ie.default=y,Ie}var Ne={},Wo={exports:{}},X={};var Hs;function Nh(){if(Hs)return X;Hs=1;var e=60103,t=60106,r=60107,n=60108,o=60114,i=60109,a=60110,s=60112,l=60113,u=60120,f=60115,c=60116,d=60121,b=60122,v=60117,R=60129,S=60131;if(typeof Symbol=="function"&&Symbol.for){var p=Symbol.for;e=p("react.element"),t=p("react.portal"),r=p("react.fragment"),n=p("react.strict_mode"),o=p("react.profiler"),i=p("react.provider"),a=p("react.context"),s=p("react.forward_ref"),l=p("react.suspense"),u=p("react.suspense_list"),f=p("react.memo"),c=p("react.lazy"),d=p("react.block"),b=p("react.server.block"),v=p("react.fundamental"),R=p("react.debug_trace_mode"),S=p("react.legacy_hidden")}function q(A){if(typeof A=="object"&&A!==null){var k=A.$$typeof;switch(k){case e:switch(A=A.type,A){case r:case o:case n:case l:case u:return A;default:switch(A=A&&A.$$typeof,A){case a:case s:case c:case f:case i:return A;default:return k}}case t:return k}}}var _=i,T=e,P=s,y=r,g=c,E=f,M=t,N=o,j=n,D=l;return X.ContextConsumer=a,X.ContextProvider=_,X.Element=T,X.ForwardRef=P,X.Fragment=y,X.Lazy=g,X.Memo=E,X.Portal=M,X.Profiler=N,X.StrictMode=j,X.Suspense=D,X.isAsyncMode=function(){return!1},X.isConcurrentMode=function(){return!1},X.isContextConsumer=function(A){return q(A)===a},X.isContextProvider=function(A){return q(A)===i},X.isElement=function(A){return typeof A=="object"&&A!==null&&A.$$typeof===e},X.isForwardRef=function(A){return q(A)===s},X.isFragment=function(A){return q(A)===r},X.isLazy=function(A){return q(A)===c},X.isMemo=function(A){return q(A)===f},X.isPortal=function(A){return q(A)===t},X.isProfiler=function(A){return q(A)===o},X.isStrictMode=function(A){return q(A)===n},X.isSuspense=function(A){return q(A)===l},X.isValidElementType=function(A){return typeof A=="string"||typeof A=="function"||A===r||A===o||A===R||A===n||A===l||A===u||A===S||typeof A=="object"&&A!==null&&(A.$$typeof===c||A.$$typeof===f||A.$$typeof===i||A.$$typeof===a||A.$$typeof===s||A.$$typeof===v||A.$$typeof===d||A[0]===b)},X.typeOf=q,X}var J={};var Ws;function kh(){return Ws||(Ws=1,process.env.NODE_ENV!=="production"&&(function(){var e=60103,t=60106,r=60107,n=60108,o=60114,i=60109,a=60110,s=60112,l=60113,u=60120,f=60115,c=60116,d=60121,b=60122,v=60117,R=60129,S=60131;if(typeof Symbol=="function"&&Symbol.for){var p=Symbol.for;e=p("react.element"),t=p("react.portal"),r=p("react.fragment"),n=p("react.strict_mode"),o=p("react.profiler"),i=p("react.provider"),a=p("react.context"),s=p("react.forward_ref"),l=p("react.suspense"),u=p("react.suspense_list"),f=p("react.memo"),c=p("react.lazy"),d=p("react.block"),b=p("react.server.block"),v=p("react.fundamental"),p("react.scope"),p("react.opaque.id"),R=p("react.debug_trace_mode"),p("react.offscreen"),S=p("react.legacy_hidden")}var q=!1;function _(O){return!!(typeof O=="string"||typeof O=="function"||O===r||O===o||O===R||O===n||O===l||O===u||O===S||q||typeof O=="object"&&O!==null&&(O.$$typeof===c||O.$$typeof===f||O.$$typeof===i||O.$$typeof===a||O.$$typeof===s||O.$$typeof===v||O.$$typeof===d||O[0]===b))}function T(O){if(typeof O=="object"&&O!==null){var W=O.$$typeof;switch(W){case e:var V=O.type;switch(V){case r:case o:case n:case l:case u:return V;default:var re=V&&V.$$typeof;switch(re){case a:case s:case c:case f:case i:return re;default:return W}}case t:return W}}}var P=a,y=i,g=e,E=s,M=r,N=c,j=f,D=t,A=o,k=n,F=l,Z=!1,Y=!1;function le(O){return Z||(Z=!0,console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 18+.")),!1}function ye(O){return Y||(Y=!0,console.warn("The ReactIs.isConcurrentMode() alias has been deprecated, and will be removed in React 18+.")),!1}function tt(O){return T(O)===a}function ze(O){return T(O)===i}function Ve(O){return typeof O=="object"&&O!==null&&O.$$typeof===e}function L(O){return T(O)===s}function He(O){return T(O)===r}function rt(O){return T(O)===c}function ge(O){return T(O)===f}function St(O){return T(O)===t}function At(O){return T(O)===o}function C(O){return T(O)===n}function $(O){return T(O)===l}J.ContextConsumer=P,J.ContextProvider=y,J.Element=g,J.ForwardRef=E,J.Fragment=M,J.Lazy=N,J.Memo=j,J.Portal=D,J.Profiler=A,J.StrictMode=k,J.Suspense=F,J.isAsyncMode=le,J.isConcurrentMode=ye,J.isContextConsumer=tt,J.isContextProvider=ze,J.isElement=Ve,J.isForwardRef=L,J.isFragment=He,J.isLazy=rt,J.isMemo=ge,J.isPortal=St,J.isProfiler=At,J.isStrictMode=C,J.isSuspense=$,J.isValidElementType=_,J.typeOf=T})()),J}var Gs;function jh(){return Gs||(Gs=1,process.env.NODE_ENV==="production"?Wo.exports=Nh():Wo.exports=kh()),Wo.exports}var Ks;function Dh(){if(Ks)return Ne;Ks=1,Object.defineProperty(Ne,"__esModule",{value:!0}),Ne.test=Ne.serialize=Ne.default=void 0;var e=n(jh()),t=fs();function r(c){if(typeof WeakMap!="function")return null;var d=new WeakMap,b=new WeakMap;return(r=function(v){return v?b:d})(c)}function n(c,d){if(c&&c.__esModule)return c;if(c===null||typeof c!="object"&&typeof c!="function")return{default:c};var b=r(d);if(b&&b.has(c))return b.get(c);var v={},R=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var S in c)if(S!=="default"&&Object.prototype.hasOwnProperty.call(c,S)){var p=R?Object.getOwnPropertyDescriptor(c,S):null;p&&(p.get||p.set)?Object.defineProperty(v,S,p):v[S]=c[S]}return v.default=c,b&&b.set(c,v),v}const o=(c,d=[])=>(Array.isArray(c)?c.forEach(b=>{o(b,d)}):c!=null&&c!==!1&&d.push(c),d),i=c=>{const d=c.type;if(typeof d=="string")return d;if(typeof d=="function")return d.displayName||d.name||"Unknown";if(e.isFragment(c))return"React.Fragment";if(e.isSuspense(c))return"React.Suspense";if(typeof d=="object"&&d!==null){if(e.isContextProvider(c))return"Context.Provider";if(e.isContextConsumer(c))return"Context.Consumer";if(e.isForwardRef(c)){if(d.displayName)return d.displayName;const b=d.render.displayName||d.render.name||"";return b!==""?"ForwardRef("+b+")":"ForwardRef"}if(e.isMemo(c)){const b=d.displayName||d.type.displayName||d.type.name||"";return b!==""?"Memo("+b+")":"Memo"}}return"UNDEFINED"},a=c=>{const{props:d}=c;return Object.keys(d).filter(b=>b!=="children"&&d[b]!==void 0).sort()},s=(c,d,b,v,R,S)=>++v>d.maxDepth?(0,t.printElementAsLeaf)(i(c),d):(0,t.printElement)(i(c),(0,t.printProps)(a(c),c.props,d,b+d.indent,v,R,S),(0,t.printChildren)(o(c.props.children),d,b+d.indent,v,R,S),d,b);Ne.serialize=s;const l=c=>c!=null&&e.isElement(c);Ne.test=l;var f={serialize:s,test:l};return Ne.default=f,Ne}var ke={},Ys;function $h(){if(Ys)return ke;Ys=1,Object.defineProperty(ke,"__esModule",{value:!0}),ke.test=ke.serialize=ke.default=void 0;var e=fs(),t=(function(){return typeof globalThis<"u"?globalThis:typeof t<"u"?t:typeof self<"u"?self:typeof window<"u"?window:Function("return this")()})(),r=t["jest-symbol-do-not-touch"]||t.Symbol;const n=typeof r=="function"&&r.for?r.for("react.test.json"):245830487,o=u=>{const{props:f}=u;return f?Object.keys(f).filter(c=>f[c]!==void 0).sort():[]},i=(u,f,c,d,b,v)=>++d>f.maxDepth?(0,e.printElementAsLeaf)(u.type,f):(0,e.printElement)(u.type,u.props?(0,e.printProps)(o(u),u.props,f,c+f.indent,d,b,v):"",u.children?(0,e.printChildren)(u.children,f,c+f.indent,d,b,v):"",f,c);ke.serialize=i;const a=u=>u&&u.$$typeof===n;ke.test=a;var l={serialize:i,test:a};return ke.default=l,ke}var Xs;function Bh(){if(Xs)return xe;Xs=1,Object.defineProperty(xe,"__esModule",{value:!0}),xe.default=xe.DEFAULT_OPTIONS=void 0,xe.format=ge,xe.plugins=void 0;var e=u(_f()),t=Ii(),r=u(Ph()),n=u(Sh()),o=u(Ah()),i=u(Oh()),a=u(Ih()),s=u(Dh()),l=u($h());function u(C){return C&&C.__esModule?C:{default:C}}const f=Object.prototype.toString,c=Date.prototype.toISOString,d=Error.prototype.toString,b=RegExp.prototype.toString,v=C=>typeof C.constructor=="function"&&C.constructor.name||"Object",R=C=>typeof window<"u"&&C===window,S=/^Symbol\((.*)\)(.*)$/,p=/\n/gi;class q extends Error{constructor($,O){super($),this.stack=O,this.name=this.constructor.name}}function _(C){return C==="[object Array]"||C==="[object ArrayBuffer]"||C==="[object DataView]"||C==="[object Float32Array]"||C==="[object Float64Array]"||C==="[object Int8Array]"||C==="[object Int16Array]"||C==="[object Int32Array]"||C==="[object Uint8Array]"||C==="[object Uint8ClampedArray]"||C==="[object Uint16Array]"||C==="[object Uint32Array]"}function T(C){return Object.is(C,-0)?"-0":String(C)}function P(C){return`${C}n`}function y(C,$){return $?"[Function "+(C.name||"anonymous")+"]":"[Function]"}function g(C){return String(C).replace(S,"Symbol($1)")}function E(C){return"["+d.call(C)+"]"}function M(C,$,O,W){if(C===!0||C===!1)return""+C;if(C===void 0)return"undefined";if(C===null)return"null";const V=typeof C;if(V==="number")return T(C);if(V==="bigint")return P(C);if(V==="string")return W?'"'+C.replace(/"|\\/g,"\\$&")+'"':'"'+C+'"';if(V==="function")return y(C,$);if(V==="symbol")return g(C);const re=f.call(C);return re==="[object WeakMap]"?"WeakMap {}":re==="[object WeakSet]"?"WeakSet {}":re==="[object Function]"||re==="[object GeneratorFunction]"?y(C,$):re==="[object Symbol]"?g(C):re==="[object Date]"?isNaN(+C)?"Date { NaN }":c.call(C):re==="[object Error]"?E(C):re==="[object RegExp]"?O?b.call(C).replace(/[\\^$*+?.()|[\]{}]/g,"\\$&"):b.call(C):C instanceof Error?E(C):null}function N(C,$,O,W,V,re){if(V.indexOf(C)!==-1)return"[Circular]";V=V.slice(),V.push(C);const oe=++W>$.maxDepth,ue=$.min;if($.callToJSON&&!oe&&C.toJSON&&typeof C.toJSON=="function"&&!re)return k(C.toJSON(),$,O,W,V,!0);const Te=f.call(C);return Te==="[object Arguments]"?oe?"[Arguments]":(ue?"":"Arguments ")+"["+(0,t.printListItems)(C,$,O,W,V,k)+"]":_(Te)?oe?"["+C.constructor.name+"]":(ue||!$.printBasicPrototype&&C.constructor.name==="Array"?"":C.constructor.name+" ")+"["+(0,t.printListItems)(C,$,O,W,V,k)+"]":Te==="[object Map]"?oe?"[Map]":"Map {"+(0,t.printIteratorEntries)(C.entries(),$,O,W,V,k," => ")+"}":Te==="[object Set]"?oe?"[Set]":"Set {"+(0,t.printIteratorValues)(C.values(),$,O,W,V,k)+"}":oe||R(C)?"["+v(C)+"]":(ue||!$.printBasicPrototype&&v(C)==="Object"?"":v(C)+" ")+"{"+(0,t.printObjectProperties)(C,$,O,W,V,k)+"}"}function j(C){return C.serialize!=null}function D(C,$,O,W,V,re){let oe;try{oe=j(C)?C.serialize($,O,W,V,re,k):C.print($,ue=>k(ue,O,W,V,re),ue=>{const Te=W+O.indent;return Te+ue.replace(p,`
|
|
9
9
|
`+Te)},{edgeSpacing:O.spacingOuter,min:O.min,spacing:O.spacingInner},O.colors)}catch(ue){throw new q(ue.message,ue.stack)}if(typeof oe!="string")throw new Error(`pretty-format: Plugin must return type "string" but instead returned "${typeof oe}".`);return oe}function A(C,$){for(let O=0;O<C.length;O++)try{if(C[O].test($))return C[O]}catch(W){throw new q(W.message,W.stack)}return null}function k(C,$,O,W,V,re){const oe=A($.plugins,C);if(oe!==null)return D(oe,C,$,O,W,V);const ue=M(C,$.printFunctionName,$.escapeRegex,$.escapeString);return ue!==null?ue:N(C,$,O,W,V,re)}const F={comment:"gray",content:"reset",prop:"yellow",tag:"cyan",value:"green"},Z=Object.keys(F),Y={callToJSON:!0,compareKeys:void 0,escapeRegex:!1,escapeString:!0,highlight:!1,indent:2,maxDepth:1/0,min:!1,plugins:[],printBasicPrototype:!0,printFunctionName:!0,theme:F};xe.DEFAULT_OPTIONS=Y;function le(C){if(Object.keys(C).forEach($=>{if(!Y.hasOwnProperty($))throw new Error(`pretty-format: Unknown option "${$}".`)}),C.min&&C.indent!==void 0&&C.indent!==0)throw new Error('pretty-format: Options "min" and "indent" cannot be used together.');if(C.theme!==void 0){if(C.theme===null)throw new Error('pretty-format: Option "theme" must not be null.');if(typeof C.theme!="object")throw new Error(`pretty-format: Option "theme" must be of type "object" but instead received "${typeof C.theme}".`)}}const ye=C=>Z.reduce(($,O)=>{const W=C.theme&&C.theme[O]!==void 0?C.theme[O]:F[O],V=W&&e.default[W];if(V&&typeof V.close=="string"&&typeof V.open=="string")$[O]=V;else throw new Error(`pretty-format: Option "theme" has a key "${O}" whose value "${W}" is undefined in ansi-styles.`);return $},Object.create(null)),tt=()=>Z.reduce((C,$)=>(C[$]={close:"",open:""},C),Object.create(null)),ze=C=>C&&C.printFunctionName!==void 0?C.printFunctionName:Y.printFunctionName,Ve=C=>C&&C.escapeRegex!==void 0?C.escapeRegex:Y.escapeRegex,L=C=>C&&C.escapeString!==void 0?C.escapeString:Y.escapeString,He=C=>{var $;return{callToJSON:C&&C.callToJSON!==void 0?C.callToJSON:Y.callToJSON,colors:C&&C.highlight?ye(C):tt(),compareKeys:C&&typeof C.compareKeys=="function"?C.compareKeys:Y.compareKeys,escapeRegex:Ve(C),escapeString:L(C),indent:C&&C.min?"":rt(C&&C.indent!==void 0?C.indent:Y.indent),maxDepth:C&&C.maxDepth!==void 0?C.maxDepth:Y.maxDepth,min:C&&C.min!==void 0?C.min:Y.min,plugins:C&&C.plugins!==void 0?C.plugins:Y.plugins,printBasicPrototype:($=C?.printBasicPrototype)!==null&&$!==void 0?$:!0,printFunctionName:ze(C),spacingInner:C&&C.min?" ":`
|
|
10
10
|
`,spacingOuter:C&&C.min?"":`
|
|
@@ -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 > :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;
|
|
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=xm;exports.userEvent=$x;
|