@cuadra-ai/uikit 0.2.0 → 0.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.
Files changed (44) hide show
  1. package/README.md +142 -2
  2. package/dist/adapters/attachmentAdapter.d.ts +63 -4
  3. package/dist/adapters/attachmentAdapter.d.ts.map +1 -1
  4. package/dist/components/CuadraChat.d.ts +54 -110
  5. package/dist/components/CuadraChat.d.ts.map +1 -1
  6. package/dist/components/CuadraChatContext.d.ts +141 -0
  7. package/dist/components/CuadraChatContext.d.ts.map +1 -0
  8. package/dist/components/ErrorBoundary.d.ts +79 -0
  9. package/dist/components/ErrorBoundary.d.ts.map +1 -0
  10. package/dist/index.cjs +204 -18
  11. package/dist/index.cjs.map +1 -1
  12. package/dist/index.d.ts +8 -0
  13. package/dist/index.d.ts.map +1 -1
  14. package/dist/index.mjs +25250 -2529
  15. package/dist/index.mjs.map +1 -1
  16. package/dist/lib/cuadraChatClient.d.ts +2 -1
  17. package/dist/lib/cuadraChatClient.d.ts.map +1 -1
  18. package/dist/magic-string.es-B81Zo59j.cjs +11 -0
  19. package/dist/magic-string.es-B81Zo59j.cjs.map +1 -0
  20. package/dist/magic-string.es-uPKorP4O.js +664 -0
  21. package/dist/magic-string.es-uPKorP4O.js.map +1 -0
  22. package/dist/test/fixtures/index.d.ts +7 -0
  23. package/dist/test/fixtures/index.d.ts.map +1 -0
  24. package/dist/test/fixtures/mockChats.d.ts +41 -0
  25. package/dist/test/fixtures/mockChats.d.ts.map +1 -0
  26. package/dist/test/fixtures/mockModels.d.ts +31 -0
  27. package/dist/test/fixtures/mockModels.d.ts.map +1 -0
  28. package/dist/test/fixtures/mockStreams.d.ts +60 -0
  29. package/dist/test/fixtures/mockStreams.d.ts.map +1 -0
  30. package/dist/test/utils/index.d.ts +6 -0
  31. package/dist/test/utils/index.d.ts.map +1 -0
  32. package/dist/test/utils/mockFetch.d.ts +67 -0
  33. package/dist/test/utils/mockFetch.d.ts.map +1 -0
  34. package/dist/test/utils/renderWithProviders.d.ts +136 -0
  35. package/dist/test/utils/renderWithProviders.d.ts.map +1 -0
  36. package/dist/types/props.d.ts +500 -0
  37. package/dist/types/props.d.ts.map +1 -0
  38. package/dist/uikit.css +1 -1
  39. package/dist/utils/sanitize.d.ts +90 -0
  40. package/dist/utils/sanitize.d.ts.map +1 -0
  41. package/dist/widget/cuadra-uikit.css +1 -1
  42. package/dist/widget/cuadra-uikit.umd.js +24 -24
  43. package/dist/widget/cuadra-uikit.umd.js.map +1 -1
  44. package/package.json +1 -1
package/dist/index.cjs CHANGED
@@ -1,23 +1,209 @@
1
- "use strict";var xr=Object.defineProperty;var br=(e,r,t)=>r in e?xr(e,r,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[r]=t;var ae=(e,r,t)=>br(e,typeof r!="symbol"?r+"":r,t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("react/jsx-runtime"),y=require("react"),qe=require("react-dom"),M=require("@assistant-ui/react"),He=require("@assistant-ui/react-markdown");var fe=typeof document<"u"?document.currentScript:null;let ge=!1,dt=!1;function ft(){if(dt||(dt=!0,typeof document>"u"||typeof window>"u"))return;const e=document.querySelector("link[data-cuadra-uikit-styles]"),r=document.querySelector("style[data-cuadra-uikit-styles]");if(e||r){ge=!0;return}try{const t=document.createElement("div");t.className="cuadra-flex",t.style.visibility="hidden",t.style.position="absolute",t.style.pointerEvents="none",document.body.appendChild(t);const a=window.getComputedStyle(t).display==="flex";if(document.body.removeChild(t),a){ge=!0;return}}catch{}yr()}function yr(){if(ge)return;const e=document.createElement("link");e.setAttribute("data-cuadra-uikit-styles","true"),e.rel="stylesheet",e.type="text/css";try{const r=new URL(typeof document>"u"?require("url").pathToFileURL(__filename).href:fe&&fe.tagName.toUpperCase()==="SCRIPT"&&fe.src||new URL("index.cjs",document.baseURI).href),t=new URL("../dist/uikit.css",r);e.href=t.href}catch{e.href="/node_modules/@cuadra-ai/uikit/dist/uikit.css"}e.onload=()=>{ge=!0},e.onerror=()=>{const r=["/node_modules/@cuadra-ai/uikit/dist/uikit.css","https://unpkg.com/@cuadra-ai/uikit@latest/dist/uikit.css"];let t=0;const a=()=>{t<r.length&&(e.href=r[t++],e.onerror=a,e.onload=()=>{ge=!0})};a()},document.head.appendChild(e)}typeof document<"u"&&typeof window<"u"&&(document.readyState==="loading"?document.addEventListener("DOMContentLoaded",ft):ft());const kr=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),wr=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(r,t,a)=>a?a.toUpperCase():t.toLowerCase()),ht=e=>{const r=wr(e);return r.charAt(0).toUpperCase()+r.slice(1)},At=(...e)=>e.filter((r,t,a)=>!!r&&r.trim()!==""&&a.indexOf(r)===t).join(" ").trim(),vr=e=>{for(const r in e)if(r.startsWith("aria-")||r==="role"||r==="title")return!0};var Cr={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};const jr=y.forwardRef(({color:e="currentColor",size:r=24,strokeWidth:t=2,absoluteStrokeWidth:a,className:i="",children:o,iconNode:n,...c},s)=>y.createElement("svg",{ref:s,...Cr,width:r,height:r,stroke:e,strokeWidth:a?Number(t)*24/Number(r):t,className:At("lucide",i),...!o&&!vr(c)&&{"aria-hidden":"true"},...c},[...n.map(([l,f])=>y.createElement(l,f)),...Array.isArray(o)?o:[o]]));const O=(e,r)=>{const t=y.forwardRef(({className:a,...i},o)=>y.createElement(jr,{ref:o,iconNode:r,className:At(`lucide-${kr(ht(e))}`,`lucide-${e}`,a),...i}));return t.displayName=ht(e),t};const Tr=[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]],Mr=O("arrow-up",Tr);const Ar=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],Sr=O("check",Ar);const Ir=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],Ve=O("chevron-down",Ir);const Nr=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 18a6 6 0 0 0 0-12v12z",key:"j4l70d"}]],Pr=O("contrast",Nr);const Rr=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],Lr=O("copy",Rr);const Er=[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"12",cy:"5",r:"1",key:"gxeob9"}],["circle",{cx:"12",cy:"19",r:"1",key:"lyex9k"}]],Dr=O("ellipsis-vertical",Er);const _r=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M8 13h2",key:"yr2amv"}],["path",{d:"M14 13h2",key:"un5t4a"}],["path",{d:"M8 17h2",key:"2yhykz"}],["path",{d:"M14 17h2",key:"10kma7"}]],Fr=O("file-spreadsheet",_r);const zr=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],St=O("file-text",zr);const $r=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M11 18h2",key:"12mj7e"}],["path",{d:"M12 12v6",key:"3ahymv"}],["path",{d:"M9 13v-.5a.5.5 0 0 1 .5-.5h5a.5.5 0 0 1 .5.5v.5",key:"qbrxap"}]],Or=O("file-type",$r);const Ur=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],It=O("loader-circle",Ur);const Br=[["path",{d:"m16 17 5-5-5-5",key:"1bji2h"}],["path",{d:"M21 12H9",key:"dn1m92"}],["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}]],Wr=O("log-out",Br);const qr=[["path",{d:"M4 5h16",key:"1tepv9"}],["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 19h16",key:"1djgab"}]],Hr=O("menu",qr);const Vr=[["path",{d:"m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551",key:"1miecu"}]],Nt=O("paperclip",Vr);const Xr=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],Kr=O("plus",Xr);const Qr=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Ge=O("x",Qr);class Pt{constructor(r,t,a=!1){ae(this,"baseUrl");ae(this,"sessionToken",null);ae(this,"isProxyMode",!1);this.baseUrl=r.replace(/\/$/,""),this.isProxyMode=a,t&&(this.sessionToken=t)}setSessionToken(r){this.sessionToken=r}getUrl(r){if(this.isProxyMode){const t=`${this.baseUrl}${r.replace("/v1","")}`;return t.startsWith("/")||t.startsWith("./"),t}return`${this.baseUrl}${r}`}async createOrContinueChat(r,t){const a=this.getUrl("/v1/chats"),o={"Content-Type":"application/json",Accept:"text/event-stream","Accept-Encoding":"identity","Cache-Control":"no-cache","X-Accel-Buffering":"no","Idempotency-Key":this.generateIdempotencyKey()};this.sessionToken&&(o.Authorization=`Bearer ${this.sessionToken}`);const n={...r,stream:!0},c=await fetch(a,{method:"POST",headers:o,body:JSON.stringify(n),signal:t,cache:"no-store"});if(!c.ok){const s=await c.json().catch(()=>({}));throw new Error(s.detail||s.message||`API error: ${c.status} ${c.statusText}`)}if(!c.body)throw new Error("Response body is null");return c.body}async getChat(r){const t=this.getUrl(`/v1/chats/${r}`),a={"Content-Type":"application/json"};this.sessionToken&&(a.Authorization=`Bearer ${this.sessionToken}`);const i=await fetch(t,{method:"GET",headers:a});if(!i.ok){const o=await i.json().catch(()=>({}));throw new Error(o.detail||o.message||`API error: ${i.status} ${i.statusText}`)}return i.json()}async listChats(r){const t=this.getUrl("/v1/chats"),a=t.startsWith("/")||t.startsWith("./")?new URL(t,window.location.origin):new URL(t);r?.limit&&a.searchParams.set("limit",r.limit.toString()),r?.cursor&&a.searchParams.set("cursor",r.cursor),r?.["expand[]"]&&r["expand[]"].forEach(n=>{a.searchParams.append("expand[]",n)});const i={"Content-Type":"application/json"};this.sessionToken&&(i.Authorization=`Bearer ${this.sessionToken}`);const o=await fetch(a.toString(),{method:"GET",headers:i});if(!o.ok){const n=await o.json().catch(()=>({}));throw new Error(n.detail||n.message||`API error: ${o.status} ${o.statusText}`)}return o.json()}generateIdempotencyKey(){try{if(typeof crypto<"u"&&crypto.randomUUID)return crypto.randomUUID()}catch{}const r=a=>Array.from({length:a},()=>Math.floor(Math.random()*16).toString(16)).join(""),t=()=>{const a=["8","9","a","b"];return a[Math.floor(Math.random()*a.length)]};return`${r(8)}-${r(4)}-4${r(3)}-${t()}${r(3)}-${r(12)}`}async updateChat(r,t){const a=`/v1/chats/${r}`,i=this.getUrl(a),o=i.startsWith("/")||i.startsWith("./")?new URL(i,window.location.origin):new URL(i),c={"Content-Type":"application/json","Idempotency-Key":this.generateIdempotencyKey()};this.sessionToken&&(c.Authorization=`Bearer ${this.sessionToken}`);const s=await fetch(o.toString(),{method:"PATCH",headers:c,body:JSON.stringify(t)});if(!s.ok){const f=await s.text();let d={};try{d=JSON.parse(f)}catch{d={detail:f}}throw new Error(d.detail||d.message||`API error: ${s.status} ${s.statusText}`)}if(s.status===204)return{};const l=await s.text();if(!l)return{};try{return JSON.parse(l)}catch{return{}}}async deleteChat(r){const t=`/v1/chats/${r}`,a=this.getUrl(t),i=a.startsWith("/")||a.startsWith("./")?new URL(a,window.location.origin):new URL(a),n={"Content-Type":"application/json","Idempotency-Key":this.generateIdempotencyKey()};this.sessionToken&&(n.Authorization=`Bearer ${this.sessionToken}`);const c=await fetch(i.toString(),{method:"DELETE",headers:n});if(!c.ok){const s=await c.json().catch(()=>({}));throw new Error(s.detail||s.message||`API error: ${c.status} ${c.statusText}`)}}async listModels(r){const t=this.getUrl("/v1/models"),a=t.startsWith("/")||t.startsWith("./")?new URL(t,window.location.origin):new URL(t);r?.limit&&a.searchParams.set("limit",r.limit.toString()),r?.cursor&&a.searchParams.set("cursor",r.cursor),r?.["expand[]"]&&r["expand[]"].forEach(n=>{a.searchParams.append("expand[]",n)});const i={"Content-Type":"application/json"};this.sessionToken&&(i.Authorization=`Bearer ${this.sessionToken}`);const o=await fetch(a.toString(),{method:"GET",headers:i});if(!o.ok){const n=await o.json().catch(()=>({}));throw new Error(n.detail||n.message||`API error: ${o.status} ${o.statusText}`)}return o.json()}async getModel(r){const t=this.getUrl(`/v1/models/${r}`),a={"Content-Type":"application/json"};this.sessionToken&&(a.Authorization=`Bearer ${this.sessionToken}`);const i=await fetch(t,{method:"GET",headers:a});if(!i.ok){const o=await i.json().catch(()=>({}));throw new Error(o.detail||o.message||`API error: ${i.status} ${i.statusText}`)}return i.json()}async uploadFile(r,t,a){const i=this.getUrl("/v1/files"),o=this.generateIdempotencyKey(),n=new FormData;n.append("file",r),t&&n.append("resource_type",t),a&&n.append("resource_id",a);const c={"Idempotency-Key":o};this.sessionToken&&(c.Authorization=`Bearer ${this.sessionToken}`);const s=await fetch(i,{method:"POST",headers:c,body:n});if(!s.ok){const l=await s.json().catch(()=>({}));throw new Error(l.detail||l.message||`API error: ${s.status} ${s.statusText}`)}return s.json()}}async function*Gr(e,r){const t=e.getReader(),a=new TextDecoder;let i="";try{for(;;){if(r?.aborted){t.cancel();break}const{done:o,value:n}=await t.read();if(o)break;i+=a.decode(n,{stream:!0});const c=i.split(`
2
-
3
- `);i=c.pop()||"";for(const s of c)if(s.startsWith("data: ")){const l=s.slice(6);if(l.trim()==="[DONE]"){yield{done:!0};continue}try{yield JSON.parse(l)}catch{}}}}finally{t.releaseLock()}}function Zr(e){return e.map(r=>{let t="";if(typeof r.content=="string")t=r.content;else if(Array.isArray(r.content)){const a=r.content.find(i=>i.type==="text");a&&typeof a=="object"&&"text"in a&&(t=a.text)}return{role:r.role,content:t}})}function Jr(e){return{id:e.id,role:e.role,content:[{type:"text",text:e.content}],createdAt:new Date(e.createdAt),metadata:{custom:{}},...e.role==="assistant"&&{status:{type:"complete",reason:"stop"},metadata:{unstable_state:null,unstable_annotations:[],unstable_data:[],steps:[],custom:{}}},...e.role==="user"&&{attachments:[]}}}const Ie=new Map;function Yr(e,r){return{async list(){const t=[];let i,o=0;do{const c=await e.listChats({limit:50,cursor:i}),s=c.items||[];Array.isArray(s)&&s.length>0&&t.push(...s),i=c.nextCursor||void 0,o++}while(i&&o<50);return{threads:t.map(c=>{const s=c.id;return!s||c.deletedAt?null:{status:"regular",remoteId:s,title:c.title||"New Chat",createdAt:c.createdAt?new Date(c.createdAt):new Date,updatedAt:c.updatedAt?new Date(c.updatedAt):new Date}}).filter(c=>c!==null)}},async initialize(t){return{remoteId:Ie.get(t)||t,externalId:void 0}},async rename(t,a){await e.updateChat(t,{title:a})},async archive(t){},async unarchive(t){},async delete(t){await e.deleteChat(t)},async generateTitle(t,a){return new ReadableStream},async fetch(t){try{const a=await e.getChat(t);return{status:"regular",remoteId:a.id||t,title:a.title||"Chat",createdAt:a.createdAt?new Date(a.createdAt):new Date,updatedAt:a.updatedAt?new Date(a.updatedAt):new Date}}catch{return{status:"regular",remoteId:t,createdAt:new Date,updatedAt:new Date}}},updateRemoteId(t,a){Ie.set(t,a),r?.(t,a)},unstable_Provider:({children:t})=>{const i=M.useThreadListItem()?.remoteId,o=y.useMemo(()=>({async load(){if(!i)return{messages:[]};try{const c=await e.getChat(i);return!c.messages||c.messages.length===0?{messages:[]}:{messages:c.messages.map(l=>Jr(l))}}catch{return{messages:[]}}},async append(c){}}),[i,e]),n=y.useMemo(()=>({history:o}),[o]);return u.jsx(M.RuntimeAdapterProvider,{adapters:n,children:t})}}}class ea{constructor(){ae(this,"messageMetadata",new Map);ae(this,"currentMessageId",null);ae(this,"listeners",new Set)}setCurrentMessage(r){this.currentMessageId=r}update(r){if(!this.currentMessageId)return;const t=this.messageMetadata.get(this.currentMessageId)||{},a=r.sources;a&&a.length>0&&(this.messageMetadata.set(this.currentMessageId,{...t,sources:a}),this.notify())}get(){return this.currentMessageId?this.messageMetadata.get(this.currentMessageId)||{}:{}}getForMessage(r){return this.messageMetadata.get(r)||{}}getCurrentMessageId(){return this.currentMessageId}clear(){this.currentMessageId=null}subscribe(r){return this.listeners.add(r),()=>this.listeners.delete(r)}notify(){this.listeners.forEach(r=>r())}}const J=new ea,mt=new Map,Xe=[];let Me=[];function Rt(e,r,t=50,a=800){Xe.push({question:e,response:r,streamingSpeed:t,initialDelay:a})}function Lt(e,r){const{modelId:t,systemPrompt:a,ephemeral:i,enableReasoning:o,onChatCreated:n,onUserMessage:c,onThreadIdUpdate:s,onBeforeRequest:l,mockResponseOnBlocked:f}=r;let d;return{async*run(p){const{messages:g,abortSignal:m,context:k}=p,x=Xe.shift();if(x){c?.();const j=x.initialDelay??800;if(j>0&&await new Promise(N=>setTimeout(N,j)),m?.aborted)throw new Error("Request aborted");const S=x.response.split(" ");let E="";const P=x.streamingSpeed||50,q=`premade-${Date.now()}`;i&&n?.(q);for(let N=0;N<S.length;N++){if(m?.aborted)throw new Error("Request aborted");E+=(N===0?"":" ")+S[N],yield{content:[{type:"text",text:E}]},await new Promise(W=>setTimeout(W,P+Math.random()*(P*.5)))}yield{content:[{type:"text",text:E}]},Me.push({role:"user",content:x.question},{role:"assistant",content:x.response});return}const b=k?.threadId;let w=b;if(!w&&g.length>0){const j=g.find(S=>S.role==="user");j&&(w=(typeof j.content=="string"?j.content:Array.isArray(j.content)&&j.content.find(E=>E.type==="text")?.text||"").substring(0,50))}let v;b&&(v=Ie.get(b)),!v&&w&&(v=mt.get(w)),!v&&d&&(v=d),c?.();let R=g,I=-1;for(let j=g.length-1;j>=0;j--)if(g[j].role==="assistant"){I=j;break}(v||I>=0)&&I>=0&&(R=g.slice(I+1));const C=Zr(R);if(Me.length>0&&!v){const j=Me.map(S=>({role:S.role,content:S.content}));C.unshift(...j),Me=[]}const L={messages:C,chatId:v||null,systemPrompt:a,ephemeral:i,enableReasoning:o,stream:!0};if(t&&t.trim()!==""&&(L.modelId=t),l&&!await l()){if(f){const S=typeof f=="function"?f():f,E=g.filter(W=>W.role==="user"),P=E.length>0?E[E.length-1]:void 0;let q="Message";P&&(typeof P.content=="string"?q=P.content:Array.isArray(P.content)&&(q=P.content.find(H=>H.type==="text")?.text||"Message")),Rt(q,S,40,400);const N=Xe.shift();if(N){c?.();const W=N.initialDelay??400;if(W>0&&await new Promise(G=>setTimeout(G,W)),m?.aborted)throw new Error("Request aborted");const H=N.response.split(" ");let re="";const oe=N.streamingSpeed||40,se=`mock-${Date.now()}`;i&&n?.(se);for(let G=0;G<H.length;G++){if(m?.aborted)throw new Error("Request aborted");re+=(G===0?"":" ")+H[G],yield{content:[{type:"text",text:re}]},await new Promise(ve=>setTimeout(ve,oe+Math.random()*(oe*.3)))}yield{content:[{type:"text",text:re}]};return}}throw new Error("Request blocked")}const D=await e.createOrContinueChat(L,m);let A="",h="",U;const F=[];let V=0,X=!1;const ke=`msg_${Date.now()}_${Math.random().toString(36).substring(2,9)}`;J.clear(),J.setCurrentMessage(ke);const we=()=>{F.length!==V&&(V=F.length,J.update({sources:F.length>0?[...F]:void 0}))},Q=()=>{we();const j=[];return h&&j.push({type:"reasoning",text:h}),A&&j.push({type:"text",text:A}),j.length===0&&j.push({type:"text",text:""}),{content:j}};for await(const j of Gr(D,m)){if(m?.aborted)throw new Error("Request aborted");const S=j.id||j.chatId||j.messageId;S&&!U&&(U=S,d=S,n?.(S),b&&s&&(s(b,S),Ie.set(b,S)),w&&mt.set(w,S));const E=j.sources;if(E&&Array.isArray(E)&&E.length>0)for(const N of E)F.some(W=>W.sourceId===N.sourceId)||F.push({sourceId:N.sourceId,filename:N.filename||"Unknown",score:N.score??1,chunkId:N.chunkId,datasetId:N.datasetId});const P=j.reasoning;if(P&&P.length>0&&(h+=P,yield Q()),j.type)switch(j.type){case"source-document":j.sourceId&&F.push({sourceId:j.sourceId,filename:j.title||"Unknown",score:1});continue;case"reasoning-start":continue;case"reasoning-delta":j.delta&&(h+=j.delta),(A||h)&&(yield Q());continue;case"reasoning-end":(A||h)&&(yield Q());continue;case"text-delta":j.delta&&(h&&!X&&!A&&(X=!0,await new Promise(N=>setTimeout(N,400))),A+=j.delta),A&&(yield Q());continue;case"error":throw new Error(j.errorText||"Stream error");case"text-start":case"text-end":case"start":case"start-step":case"finish-step":case"finish":continue}const q=j.delta;if(q!=null&&(h&&!X&&!A&&(X=!0,await new Promise(N=>setTimeout(N,400))),A+=q),j.content&&(A+=j.content),j.message&&(A+=j.message.content||""),j.finished){(A||h||F.length>0)&&(yield Q());break}(A||h||F.length>0)&&(yield Q())}(A||h||F.length>0)&&(yield Q())}}}function Et(){return{accept:".pdf,.docx,.txt,.md,.csv,.json,image/*",async add({file:e}){let r="file";return e.type.startsWith("image/")?r="image":(e.type.includes("pdf")||e.type.includes("document")||e.type.includes("text")||e.name.endsWith(".pdf")||e.name.endsWith(".docx")||e.name.endsWith(".txt")||e.name.endsWith(".md")||e.name.endsWith(".csv")||e.name.endsWith(".json"))&&(r="document"),{id:`${e.name}-${Date.now()}`,type:r,name:e.name,contentType:e.type,file:e,status:{type:"requires-action",reason:"composer-send"}}},async remove(){},async send(e){if(e.type==="image"&&e.file){const r=await new Promise((t,a)=>{const i=new FileReader;i.onload=()=>t(i.result),i.onerror=a,i.readAsDataURL(e.file)});return{...e,status:{type:"complete"},content:[{type:"image",image:r}]}}return{...e,status:{type:"complete"},content:[]}}}}function ta({children:e,baseUrl:r,sessionToken:t,isProxyMode:a=!1,mode:i="multiChat",modelId:o,onModelChange:n,ephemeral:c=!1,systemPrompt:s,enableReasoning:l=!1,initialThreadId:f,onError:d,onChatCreated:p,onUserMessage:g,onThreadIdUpdate:m,onChatsLoaded:k,enableAttachments:x=!1,onBeforeRequest:b,mockResponseOnBlocked:w}){const v=y.useMemo(()=>new Pt(r,t||void 0,a),[r,t,a]),[R,I]=y.useState(o||null);y.useEffect(()=>{o&&I(o)},[o]);const C=y.useCallback(A=>{p?.(A)},[p]),L=y.useCallback((A,h)=>{m?.(A,h)},[m]),D=y.useMemo(()=>Lt(v,{modelId:R||void 0,systemPrompt:s,ephemeral:c,enableReasoning:l,onChatCreated:C,onUserMessage:g,onBeforeRequest:b,mockResponseOnBlocked:w}),[v,R,s,c,l,C,g,b,w]);return i==="singleChat"?u.jsx(ra,{modelAdapter:D,enableAttachments:x,children:e}):u.jsx(aa,{client:v,modelAdapterOptions:{modelId:R||void 0,systemPrompt:s,ephemeral:c,enableReasoning:l,onChatCreated:C,onUserMessage:g,onBeforeRequest:b,mockResponseOnBlocked:w},initialThreadId:f,onChatsLoaded:k,onThreadIdUpdate:L,onError:d,enableAttachments:x,children:e})}function ra({modelAdapter:e,enableAttachments:r,children:t}){const a=y.useMemo(()=>r?Et():void 0,[r]),i=M.useLocalRuntime(e,{adapters:{...a&&{attachments:a}}});return u.jsx(M.AssistantRuntimeProvider,{runtime:i,children:t})}function aa({client:e,modelAdapterOptions:r,initialThreadId:t,onChatsLoaded:a,onThreadIdUpdate:i,onError:o,enableAttachments:n,children:c}){const s=y.useMemo(()=>Yr(e,(k,x)=>{i?.(k,x)}),[e,i]),l=y.useCallback((k,x)=>{s.updateRemoteId&&s.updateRemoteId(k,x),i?.(k,x)},[s,i]),f=y.useMemo(()=>({...s,async list(){const k=await s.list();return a?.(),k}}),[s,a]);y.useEffect(()=>{window.__cuadraThreadListAdapter=f,window.__cuadraThreadListRuntime=null},[f]);const d=y.useMemo(()=>Lt(e,{...r,onThreadIdUpdate:l}),[e,r,l]),p=y.useMemo(()=>n?Et():void 0,[n]),g=y.useCallback(()=>M.useLocalRuntime(d,{adapters:{...p&&{attachments:p}}}),[d,p]),m=M.unstable_useRemoteThreadListRuntime({adapter:f,runtimeHook:g});return y.useEffect(()=>{window.__cuadraThreadListRuntime=m},[m]),u.jsx(M.AssistantRuntimeProvider,{runtime:m,children:c})}function pt(e,r){const t=String(e);if(typeof r!="string")throw new TypeError("Expected character");let a=0,i=t.indexOf(r);for(;i!==-1;)a++,i=t.indexOf(r,i+r.length);return a}const xe=Le(/[A-Za-z]/),Ze=Le(/[\dA-Za-z]/);function na(e){return e!==null&&(e<32||e===127)}function de(e){return e!==null&&e<-2}function B(e){return e!==null&&(e<0||e===32)}function Y(e){return e===-2||e===-1||e===32}const Re=Le(/\p{P}|\p{S}/u),ie=Le(/\s/);function Le(e){return r;function r(t){return t!==null&&t>-1&&e.test(String.fromCharCode(t))}}function ia(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}const Ee=(function(e){if(e==null)return ua;if(typeof e=="function")return De(e);if(typeof e=="object")return Array.isArray(e)?oa(e):sa(e);if(typeof e=="string")return ca(e);throw new Error("Expected function, string, or object as test")});function oa(e){const r=[];let t=-1;for(;++t<e.length;)r[t]=Ee(e[t]);return De(a);function a(...i){let o=-1;for(;++o<r.length;)if(r[o].apply(this,i))return!0;return!1}}function sa(e){const r=e;return De(t);function t(a){const i=a;let o;for(o in e)if(i[o]!==r[o])return!1;return!0}}function ca(e){return De(r);function r(t){return t&&t.type===e}}function De(e){return r;function r(t,a,i){return!!(la(t)&&e.call(this,t,typeof a=="number"?a:void 0,i||void 0))}}function ua(){return!0}function la(e){return e!==null&&typeof e=="object"&&"type"in e}const Dt=[],da=!0,Ke=!1,fa="skip";function _t(e,r,t,a){let i;typeof r=="function"&&typeof t!="function"?(a=t,t=r):i=r;const o=Ee(i),n=a?-1:1;c(e,void 0,[])();function c(s,l,f){const d=s&&typeof s=="object"?s:{};if(typeof d.type=="string"){const g=typeof d.tagName=="string"?d.tagName:typeof d.name=="string"?d.name:void 0;Object.defineProperty(p,"name",{value:"node ("+(s.type+(g?"<"+g+">":""))+")"})}return p;function p(){let g=Dt,m,k,x;if((!r||o(s,l,f[f.length-1]||void 0))&&(g=ha(t(s,f)),g[0]===Ke))return g;if("children"in s&&s.children){const b=s;if(b.children&&g[0]!==fa)for(k=(a?b.children.length:-1)+n,x=f.concat(b);k>-1&&k<b.children.length;){const w=b.children[k];if(m=c(w,k,x)(),m[0]===Ke)return m;k=typeof m[1]=="number"?m[1]:k+n}}return g}}}function ha(e){return Array.isArray(e)?e:typeof e=="number"?[da,e]:e==null?Dt:[e]}function ma(e,r,t){const i=Ee((t||{}).ignore||[]),o=pa(r);let n=-1;for(;++n<o.length;)_t(e,"text",c);function c(l,f){let d=-1,p;for(;++d<f.length;){const g=f[d],m=p?p.children:void 0;if(i(g,m?m.indexOf(g):void 0,p))return;p=g}if(p)return s(l,f)}function s(l,f){const d=f[f.length-1],p=o[n][0],g=o[n][1];let m=0;const x=d.children.indexOf(l);let b=!1,w=[];p.lastIndex=0;let v=p.exec(l.value);for(;v;){const R=v.index,I={index:v.index,input:v.input,stack:[...f,l]};let C=g(...v,I);if(typeof C=="string"&&(C=C.length>0?{type:"text",value:C}:void 0),C===!1?p.lastIndex=R+1:(m!==R&&w.push({type:"text",value:l.value.slice(m,R)}),Array.isArray(C)?w.push(...C):C&&w.push(C),m=R+v[0].length,b=!0),!p.global)break;v=p.exec(l.value)}return b?(m<l.value.length&&w.push({type:"text",value:l.value.slice(m)}),d.children.splice(x,1,...w)):w=[l],x+w.length}}function pa(e){const r=[];if(!Array.isArray(e))throw new TypeError("Expected find and replace tuple or list of tuples");const t=!e[0]||Array.isArray(e[0])?e:[e];let a=-1;for(;++a<t.length;){const i=t[a];r.push([ga(i[0]),xa(i[1])])}return r}function ga(e){return typeof e=="string"?new RegExp(ia(e),"g"):e}function xa(e){return typeof e=="function"?e:function(){return e}}const ze="phrasing",$e=["autolink","link","image","label"];function ba(){return{transforms:[Ta],enter:{literalAutolink:ka,literalAutolinkEmail:Oe,literalAutolinkHttp:Oe,literalAutolinkWww:Oe},exit:{literalAutolink:ja,literalAutolinkEmail:Ca,literalAutolinkHttp:wa,literalAutolinkWww:va}}}function ya(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:ze,notInConstruct:$e},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:ze,notInConstruct:$e},{character:":",before:"[ps]",after:"\\/",inConstruct:ze,notInConstruct:$e}]}}function ka(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function Oe(e){this.config.enter.autolinkProtocol.call(this,e)}function wa(e){this.config.exit.autolinkProtocol.call(this,e)}function va(e){this.config.exit.data.call(this,e);const r=this.stack[this.stack.length-1];r.type,r.url="http://"+this.sliceSerialize(e)}function Ca(e){this.config.exit.autolinkEmail.call(this,e)}function ja(e){this.exit(e)}function Ta(e){ma(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,Ma],[/(?<=^|\s|\p{P}|\p{S})([-.\w+]+)@([-\w]+(?:\.[-\w]+)+)/gu,Aa]],{ignore:["link","linkReference"]})}function Ma(e,r,t,a,i){let o="";if(!Ft(i)||(/^w/i.test(r)&&(t=r+t,r="",o="http://"),!Sa(t)))return!1;const n=Ia(t+a);if(!n[0])return!1;const c={type:"link",title:null,url:o+r+n[0],children:[{type:"text",value:r+n[0]}]};return n[1]?[c,{type:"text",value:n[1]}]:c}function Aa(e,r,t,a){return!Ft(a,!0)||/[-\d_]$/.test(t)?!1:{type:"link",title:null,url:"mailto:"+r+"@"+t,children:[{type:"text",value:r+"@"+t}]}}function Sa(e){const r=e.split(".");return!(r.length<2||r[r.length-1]&&(/_/.test(r[r.length-1])||!/[a-zA-Z\d]/.test(r[r.length-1]))||r[r.length-2]&&(/_/.test(r[r.length-2])||!/[a-zA-Z\d]/.test(r[r.length-2])))}function Ia(e){const r=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!r)return[e,void 0];e=e.slice(0,r.index);let t=r[0],a=t.indexOf(")");const i=pt(e,"(");let o=pt(e,")");for(;a!==-1&&i>o;)e+=t.slice(0,a+1),t=t.slice(a+1),a=t.indexOf(")"),o++;return[e,t]}function Ft(e,r){const t=e.input.charCodeAt(e.index-1);return(e.index===0||ie(t)||Re(t))&&(!r||t!==47)}function ye(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}zt.peek=za;function Na(){this.buffer()}function Pa(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function Ra(){this.buffer()}function La(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function Ea(e){const r=this.resume(),t=this.stack[this.stack.length-1];t.type,t.identifier=ye(this.sliceSerialize(e)).toLowerCase(),t.label=r}function Da(e){this.exit(e)}function _a(e){const r=this.resume(),t=this.stack[this.stack.length-1];t.type,t.identifier=ye(this.sliceSerialize(e)).toLowerCase(),t.label=r}function Fa(e){this.exit(e)}function za(){return"["}function zt(e,r,t,a){const i=t.createTracker(a);let o=i.move("[^");const n=t.enter("footnoteReference"),c=t.enter("reference");return o+=i.move(t.safe(t.associationId(e),{after:"]",before:o})),c(),n(),o+=i.move("]"),o}function $a(){return{enter:{gfmFootnoteCallString:Na,gfmFootnoteCall:Pa,gfmFootnoteDefinitionLabelString:Ra,gfmFootnoteDefinition:La},exit:{gfmFootnoteCallString:Ea,gfmFootnoteCall:Da,gfmFootnoteDefinitionLabelString:_a,gfmFootnoteDefinition:Fa}}}function Oa(e){let r=!1;return e&&e.firstLineBlank&&(r=!0),{handlers:{footnoteDefinition:t,footnoteReference:zt},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function t(a,i,o,n){const c=o.createTracker(n);let s=c.move("[^");const l=o.enter("footnoteDefinition"),f=o.enter("label");return s+=c.move(o.safe(o.associationId(a),{before:s,after:"]"})),f(),s+=c.move("]:"),a.children&&a.children.length>0&&(c.shift(4),s+=c.move((r?`
4
- `:" ")+o.indentLines(o.containerFlow(a,c.current()),r?$t:Ua))),l(),s}}function Ua(e,r,t){return r===0?e:$t(e,r,t)}function $t(e,r,t){return(t?"":" ")+e}const Ba=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];Ot.peek=Xa;function Wa(){return{canContainEols:["delete"],enter:{strikethrough:Ha},exit:{strikethrough:Va}}}function qa(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:Ba}],handlers:{delete:Ot}}}function Ha(e){this.enter({type:"delete",children:[]},e)}function Va(e){this.exit(e)}function Ot(e,r,t,a){const i=t.createTracker(a),o=t.enter("strikethrough");let n=i.move("~~");return n+=t.containerPhrasing(e,{...i.current(),before:n,after:"~"}),n+=i.move("~~"),o(),n}function Xa(){return"~"}function Ka(e){return e.length}function Qa(e,r){const t=r||{},a=(t.align||[]).concat(),i=t.stringLength||Ka,o=[],n=[],c=[],s=[];let l=0,f=-1;for(;++f<e.length;){const k=[],x=[];let b=-1;for(e[f].length>l&&(l=e[f].length);++b<e[f].length;){const w=Ga(e[f][b]);if(t.alignDelimiters!==!1){const v=i(w);x[b]=v,(s[b]===void 0||v>s[b])&&(s[b]=v)}k.push(w)}n[f]=k,c[f]=x}let d=-1;if(typeof a=="object"&&"length"in a)for(;++d<l;)o[d]=gt(a[d]);else{const k=gt(a);for(;++d<l;)o[d]=k}d=-1;const p=[],g=[];for(;++d<l;){const k=o[d];let x="",b="";k===99?(x=":",b=":"):k===108?x=":":k===114&&(b=":");let w=t.alignDelimiters===!1?1:Math.max(1,s[d]-x.length-b.length);const v=x+"-".repeat(w)+b;t.alignDelimiters!==!1&&(w=x.length+w+b.length,w>s[d]&&(s[d]=w),g[d]=w),p[d]=v}n.splice(1,0,p),c.splice(1,0,g),f=-1;const m=[];for(;++f<n.length;){const k=n[f],x=c[f];d=-1;const b=[];for(;++d<l;){const w=k[d]||"";let v="",R="";if(t.alignDelimiters!==!1){const I=s[d]-(x[d]||0),C=o[d];C===114?v=" ".repeat(I):C===99?I%2?(v=" ".repeat(I/2+.5),R=" ".repeat(I/2-.5)):(v=" ".repeat(I/2),R=v):R=" ".repeat(I)}t.delimiterStart!==!1&&!d&&b.push("|"),t.padding!==!1&&!(t.alignDelimiters===!1&&w==="")&&(t.delimiterStart!==!1||d)&&b.push(" "),t.alignDelimiters!==!1&&b.push(v),b.push(w),t.alignDelimiters!==!1&&b.push(R),t.padding!==!1&&b.push(" "),(t.delimiterEnd!==!1||d!==l-1)&&b.push("|")}m.push(t.delimiterEnd===!1?b.join("").replace(/ +$/,""):b.join(""))}return m.join(`
5
- `)}function Ga(e){return e==null?"":String(e)}function gt(e){const r=typeof e=="string"?e.codePointAt(0):0;return r===67||r===99?99:r===76||r===108?108:r===82||r===114?114:0}function Za(e,r,t,a){const i=t.enter("blockquote"),o=t.createTracker(a);o.move("> "),o.shift(2);const n=t.indentLines(t.containerFlow(e,o.current()),Ja);return i(),n}function Ja(e,r,t){return">"+(t?"":" ")+e}function Ya(e,r){return xt(e,r.inConstruct,!0)&&!xt(e,r.notInConstruct,!1)}function xt(e,r,t){if(typeof r=="string"&&(r=[r]),!r||r.length===0)return t;let a=-1;for(;++a<r.length;)if(e.includes(r[a]))return!0;return!1}function bt(e,r,t,a){let i=-1;for(;++i<t.unsafe.length;)if(t.unsafe[i].character===`
6
- `&&Ya(t.stack,t.unsafe[i]))return/[ \t]/.test(a.before)?"":" ";return`\\
7
- `}function en(e,r){const t=String(e);let a=t.indexOf(r),i=a,o=0,n=0;if(typeof r!="string")throw new TypeError("Expected substring");for(;a!==-1;)a===i?++o>n&&(n=o):o=1,i=a+r.length,a=t.indexOf(r,i);return n}function tn(e,r){return!!(r.options.fences===!1&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}function rn(e){const r=e.options.fence||"`";if(r!=="`"&&r!=="~")throw new Error("Cannot serialize code with `"+r+"` for `options.fence`, expected `` ` `` or `~`");return r}function an(e,r,t,a){const i=rn(t),o=e.value||"",n=i==="`"?"GraveAccent":"Tilde";if(tn(e,t)){const d=t.enter("codeIndented"),p=t.indentLines(o,nn);return d(),p}const c=t.createTracker(a),s=i.repeat(Math.max(en(o,i)+1,3)),l=t.enter("codeFenced");let f=c.move(s);if(e.lang){const d=t.enter(`codeFencedLang${n}`);f+=c.move(t.safe(e.lang,{before:f,after:" ",encode:["`"],...c.current()})),d()}if(e.lang&&e.meta){const d=t.enter(`codeFencedMeta${n}`);f+=c.move(" "),f+=c.move(t.safe(e.meta,{before:f,after:`
8
- `,encode:["`"],...c.current()})),d()}return f+=c.move(`
9
- `),o&&(f+=c.move(o+`
10
- `)),f+=c.move(s),l(),f}function nn(e,r,t){return(t?"":" ")+e}function Je(e){const r=e.options.quote||'"';if(r!=='"'&&r!=="'")throw new Error("Cannot serialize title with `"+r+"` for `options.quote`, expected `\"`, or `'`");return r}function on(e,r,t,a){const i=Je(t),o=i==='"'?"Quote":"Apostrophe",n=t.enter("definition");let c=t.enter("label");const s=t.createTracker(a);let l=s.move("[");return l+=s.move(t.safe(t.associationId(e),{before:l,after:"]",...s.current()})),l+=s.move("]: "),c(),!e.url||/[\0- \u007F]/.test(e.url)?(c=t.enter("destinationLiteral"),l+=s.move("<"),l+=s.move(t.safe(e.url,{before:l,after:">",...s.current()})),l+=s.move(">")):(c=t.enter("destinationRaw"),l+=s.move(t.safe(e.url,{before:l,after:e.title?" ":`
11
- `,...s.current()}))),c(),e.title&&(c=t.enter(`title${o}`),l+=s.move(" "+i),l+=s.move(t.safe(e.title,{before:l,after:i,...s.current()})),l+=s.move(i),c()),n(),l}function sn(e){const r=e.options.emphasis||"*";if(r!=="*"&&r!=="_")throw new Error("Cannot serialize emphasis with `"+r+"` for `options.emphasis`, expected `*`, or `_`");return r}function be(e){return"&#x"+e.toString(16).toUpperCase()+";"}function Ne(e){if(e===null||B(e)||ie(e))return 1;if(Re(e))return 2}function Pe(e,r,t){const a=Ne(e),i=Ne(r);return a===void 0?i===void 0?t==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:a===1?i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}Ut.peek=cn;function Ut(e,r,t,a){const i=sn(t),o=t.enter("emphasis"),n=t.createTracker(a),c=n.move(i);let s=n.move(t.containerPhrasing(e,{after:i,before:c,...n.current()}));const l=s.charCodeAt(0),f=Pe(a.before.charCodeAt(a.before.length-1),l,i);f.inside&&(s=be(l)+s.slice(1));const d=s.charCodeAt(s.length-1),p=Pe(a.after.charCodeAt(0),d,i);p.inside&&(s=s.slice(0,-1)+be(d));const g=n.move(i);return o(),t.attentionEncodeSurroundingInfo={after:p.outside,before:f.outside},c+s+g}function cn(e,r,t){return t.options.emphasis||"*"}function un(e,r,t,a){let i,o,n;typeof r=="function"&&typeof t!="function"?(o=void 0,n=r,i=t):(o=r,n=t,i=a),_t(e,o,c,i);function c(s,l){const f=l[l.length-1],d=f?f.children.indexOf(s):void 0;return n(s,d,f)}}const ln={};function Bt(e,r){const t=ln,a=typeof t.includeImageAlt=="boolean"?t.includeImageAlt:!0,i=typeof t.includeHtml=="boolean"?t.includeHtml:!0;return Wt(e,a,i)}function Wt(e,r,t){if(dn(e)){if("value"in e)return e.type==="html"&&!t?"":e.value;if(r&&"alt"in e&&e.alt)return e.alt;if("children"in e)return yt(e.children,r,t)}return Array.isArray(e)?yt(e,r,t):""}function yt(e,r,t){const a=[];let i=-1;for(;++i<e.length;)a[i]=Wt(e[i],r,t);return a.join("")}function dn(e){return!!(e&&typeof e=="object")}function fn(e,r){let t=!1;return un(e,function(a){if("value"in a&&/\r?\n|\r/.test(a.value)||a.type==="break")return t=!0,Ke}),!!((!e.depth||e.depth<3)&&Bt(e)&&(r.options.setext||t))}function hn(e,r,t,a){const i=Math.max(Math.min(6,e.depth||1),1),o=t.createTracker(a);if(fn(e,t)){const f=t.enter("headingSetext"),d=t.enter("phrasing"),p=t.containerPhrasing(e,{...o.current(),before:`
1
+ "use strict";var iw=Object.defineProperty;var sw=(e,t,r)=>t in e?iw(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var re=(e,t,r)=>sw(e,typeof t!="symbol"?t+"":t,r);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const _=require("react/jsx-runtime"),V=require("react"),ir=require("react-dom"),pe=require("@assistant-ui/react");require("@assistant-ui/react-markdown/styles/dot.css");const Sl=require("@assistant-ui/react-markdown"),lw=require("react-dom/test-utils"),uw=require("react-dom/client");var Pr=typeof document<"u"?document.currentScript:null;function yu(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:()=>e[r]})}}return t.default=e,Object.freeze(t)}const Xo=yu(V),cw=yu(lw),Uc=yu(uw);let Vo=!1,Wc=!1;function Vc(){if(Wc||(Wc=!0,typeof document>"u"||typeof window>"u"))return;const e=document.querySelector("link[data-cuadra-uikit-styles]"),t=document.querySelector("style[data-cuadra-uikit-styles]");if(e||t){Vo=!0;return}try{const r=document.createElement("div");r.className="cuadra-flex",r.style.visibility="hidden",r.style.position="absolute",r.style.pointerEvents="none",document.body.appendChild(r);const n=window.getComputedStyle(r).display==="flex";if(document.body.removeChild(r),n){Vo=!0;return}}catch{}dw()}function dw(){if(Vo)return;const e=document.createElement("link");e.setAttribute("data-cuadra-uikit-styles","true"),e.rel="stylesheet",e.type="text/css";try{const t=new URL(typeof document>"u"?require("url").pathToFileURL(__filename).href:Pr&&Pr.tagName.toUpperCase()==="SCRIPT"&&Pr.src||new URL("index.cjs",document.baseURI).href),r=new URL("../dist/uikit.css",t);e.href=r.href}catch{e.href="/node_modules/@cuadra-ai/uikit/dist/uikit.css"}e.onload=()=>{Vo=!0},e.onerror=()=>{const t=["/node_modules/@cuadra-ai/uikit/dist/uikit.css","https://unpkg.com/@cuadra-ai/uikit@latest/dist/uikit.css"];let r=0;const n=()=>{r<t.length&&(e.href=t[r++],e.onerror=n,e.onload=()=>{Vo=!0})};n()},document.head.appendChild(e)}typeof document<"u"&&typeof window<"u"&&(document.readyState==="loading"?document.addEventListener("DOMContentLoaded",Vc):Vc());const fw=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),pw=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,r,n)=>n?n.toUpperCase():r.toLowerCase()),Hc=e=>{const t=pw(e);return t.charAt(0).toUpperCase()+t.slice(1)},qg=(...e)=>e.filter((t,r,n)=>!!t&&t.trim()!==""&&n.indexOf(t)===r).join(" ").trim(),mw=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0};var hw={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};const gw=V.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:r=2,absoluteStrokeWidth:n,className:a="",children:i,iconNode:o,...s},l)=>V.createElement("svg",{ref:l,...hw,width:t,height:t,stroke:e,strokeWidth:n?Number(r)*24/Number(t):r,className:qg("lucide",a),...!i&&!mw(s)&&{"aria-hidden":"true"},...s},[...o.map(([u,d])=>V.createElement(u,d)),...Array.isArray(i)?i:[i]]));const Je=(e,t)=>{const r=V.forwardRef(({className:n,...a},i)=>V.createElement(gw,{ref:i,iconNode:t,className:qg(`lucide-${fw(Hc(e))}`,`lucide-${e}`,n),...a}));return r.displayName=Hc(e),r};const bw=[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]],yw=Je("arrow-up",bw);const vw=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],ww=Je("check",vw);const xw=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],_l=Je("chevron-down",xw);const Rw=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 18a6 6 0 0 0 0-12v12z",key:"j4l70d"}]],Cw=Je("contrast",Rw);const Ew=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],Tw=Je("copy",Ew);const Sw=[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"12",cy:"5",r:"1",key:"gxeob9"}],["circle",{cx:"12",cy:"19",r:"1",key:"lyex9k"}]],_w=Je("ellipsis-vertical",Sw);const Pw=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M8 13h2",key:"yr2amv"}],["path",{d:"M14 13h2",key:"un5t4a"}],["path",{d:"M8 17h2",key:"2yhykz"}],["path",{d:"M14 17h2",key:"10kma7"}]],kw=Je("file-spreadsheet",Pw);const Mw=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],Ig=Je("file-text",Mw);const Aw=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M11 18h2",key:"12mj7e"}],["path",{d:"M12 12v6",key:"3ahymv"}],["path",{d:"M9 13v-.5a.5.5 0 0 1 .5-.5h5a.5.5 0 0 1 .5.5v.5",key:"qbrxap"}]],qw=Je("file-type",Aw);const Iw=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],Og=Je("loader-circle",Iw);const Ow=[["path",{d:"m16 17 5-5-5-5",key:"1bji2h"}],["path",{d:"M21 12H9",key:"dn1m92"}],["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}]],Nw=Je("log-out",Ow);const $w=[["path",{d:"M4 5h16",key:"1tepv9"}],["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 19h16",key:"1djgab"}]],jw=Je("menu",$w);const Dw=[["path",{d:"m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551",key:"1miecu"}]],Ng=Je("paperclip",Dw);const Lw=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],Fw=Je("plus",Lw);const Bw=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],vu=Je("x",Bw);function zw(){if(typeof crypto<"u"&&crypto.randomUUID)return crypto.randomUUID();if(typeof crypto<"u"&&crypto.getRandomValues){const e=new Uint8Array(16);crypto.getRandomValues(e),e[6]=e[6]&15|64,e[8]=e[8]&63|128;const t=Array.from(e,r=>r.toString(16).padStart(2,"0")).join("");return`${t.slice(0,8)}-${t.slice(8,12)}-${t.slice(12,16)}-${t.slice(16,20)}-${t.slice(20)}`}return typeof process<"u"&&process.env?.NODE_ENV==="development"&&console.warn("[CuadraUIKit] Using non-cryptographic fallback for UUID generation"),`${Date.now().toString(36)}-${Math.random().toString(36).slice(2)}-${Math.random().toString(36).slice(2)}`}class $g{constructor(t,r,n=!1){re(this,"baseUrl");re(this,"sessionToken",null);re(this,"isProxyMode",!1);this.baseUrl=t.replace(/\/$/,""),this.isProxyMode=n,r&&(this.sessionToken=r)}setSessionToken(t){this.sessionToken=t}getUrl(t){if(this.isProxyMode){const r=`${this.baseUrl}${t.replace("/v1","")}`;return r.startsWith("/")||r.startsWith("./"),r}return`${this.baseUrl}${t}`}async createOrContinueChat(t,r){const n=this.getUrl("/v1/chats"),i={"Content-Type":"application/json",Accept:"text/event-stream","Accept-Encoding":"identity","Cache-Control":"no-cache","X-Accel-Buffering":"no","Idempotency-Key":this.generateIdempotencyKey()};this.sessionToken&&(i.Authorization=`Bearer ${this.sessionToken}`);const o={...t,stream:!0},s=await fetch(n,{method:"POST",headers:i,body:JSON.stringify(o),signal:r,cache:"no-store"});if(!s.ok){const l=await s.json().catch(()=>({}));throw new Error(l.detail||l.message||`API error: ${s.status} ${s.statusText}`)}if(!s.body)throw new Error("Response body is null");return s.body}async getChat(t){const r=this.getUrl(`/v1/chats/${t}`),n={"Content-Type":"application/json"};this.sessionToken&&(n.Authorization=`Bearer ${this.sessionToken}`);const a=await fetch(r,{method:"GET",headers:n});if(!a.ok){const i=await a.json().catch(()=>({}));throw new Error(i.detail||i.message||`API error: ${a.status} ${a.statusText}`)}return a.json()}async listChats(t){const r=this.getUrl("/v1/chats"),n=r.startsWith("/")||r.startsWith("./")?new URL(r,window.location.origin):new URL(r);t?.limit&&n.searchParams.set("limit",t.limit.toString()),t?.cursor&&n.searchParams.set("cursor",t.cursor),t?.["expand[]"]&&t["expand[]"].forEach(o=>{n.searchParams.append("expand[]",o)});const a={"Content-Type":"application/json"};this.sessionToken&&(a.Authorization=`Bearer ${this.sessionToken}`);const i=await fetch(n.toString(),{method:"GET",headers:a});if(!i.ok){const o=await i.json().catch(()=>({}));throw new Error(o.detail||o.message||`API error: ${i.status} ${i.statusText}`)}return i.json()}generateIdempotencyKey(){return zw()}async updateChat(t,r){const n=`/v1/chats/${t}`,a=this.getUrl(n),i=a.startsWith("/")||a.startsWith("./")?new URL(a,window.location.origin):new URL(a),s={"Content-Type":"application/json","Idempotency-Key":this.generateIdempotencyKey()};this.sessionToken&&(s.Authorization=`Bearer ${this.sessionToken}`);const l=await fetch(i.toString(),{method:"PATCH",headers:s,body:JSON.stringify(r)});if(!l.ok){const d=await l.text();let c={};try{c=JSON.parse(d)}catch{c={detail:d}}throw new Error(c.detail||c.message||`API error: ${l.status} ${l.statusText}`)}if(l.status===204)return{};const u=await l.text();if(!u)return{};try{return JSON.parse(u)}catch{return{}}}async deleteChat(t){const r=`/v1/chats/${t}`,n=this.getUrl(r),a=n.startsWith("/")||n.startsWith("./")?new URL(n,window.location.origin):new URL(n),o={"Content-Type":"application/json","Idempotency-Key":this.generateIdempotencyKey()};this.sessionToken&&(o.Authorization=`Bearer ${this.sessionToken}`);const s=await fetch(a.toString(),{method:"DELETE",headers:o});if(!s.ok){const l=await s.json().catch(()=>({}));throw new Error(l.detail||l.message||`API error: ${s.status} ${s.statusText}`)}}async listModels(t){const r=this.getUrl("/v1/models"),n=r.startsWith("/")||r.startsWith("./")?new URL(r,window.location.origin):new URL(r);t?.limit&&n.searchParams.set("limit",t.limit.toString()),t?.cursor&&n.searchParams.set("cursor",t.cursor),t?.["expand[]"]&&t["expand[]"].forEach(o=>{n.searchParams.append("expand[]",o)});const a={"Content-Type":"application/json"};this.sessionToken&&(a.Authorization=`Bearer ${this.sessionToken}`);const i=await fetch(n.toString(),{method:"GET",headers:a});if(!i.ok){const o=await i.json().catch(()=>({}));throw new Error(o.detail||o.message||`API error: ${i.status} ${i.statusText}`)}return i.json()}async getModel(t){const r=this.getUrl(`/v1/models/${t}`),n={"Content-Type":"application/json"};this.sessionToken&&(n.Authorization=`Bearer ${this.sessionToken}`);const a=await fetch(r,{method:"GET",headers:n});if(!a.ok){const i=await a.json().catch(()=>({}));throw new Error(i.detail||i.message||`API error: ${a.status} ${a.statusText}`)}return a.json()}async uploadFile(t,r,n){const a=this.getUrl("/v1/files"),i=this.generateIdempotencyKey(),o=new FormData;o.append("file",t),r&&o.append("resource_type",r),n&&o.append("resource_id",n);const s={"Idempotency-Key":i};this.sessionToken&&(s.Authorization=`Bearer ${this.sessionToken}`);const l=await fetch(a,{method:"POST",headers:s,body:o});if(!l.ok){const u=await l.json().catch(()=>({}));throw new Error(u.detail||u.message||`API error: ${l.status} ${l.statusText}`)}return l.json()}}async function*Uw(e,t){const r=e.getReader(),n=new TextDecoder;let a="";try{for(;;){if(t?.aborted){r.cancel();break}const{done:i,value:o}=await r.read();if(i)break;a+=n.decode(o,{stream:!0});const s=a.split(`
2
+
3
+ `);a=s.pop()||"";for(const l of s)if(l.startsWith("data: ")){const u=l.slice(6);if(u.trim()==="[DONE]"){yield{done:!0};continue}try{yield JSON.parse(u)}catch{}}}}finally{r.releaseLock()}}function Ww(e){return e.map(t=>{let r="";if(typeof t.content=="string")r=t.content;else if(Array.isArray(t.content)){const n=t.content.find(a=>a.type==="text");n&&typeof n=="object"&&"text"in n&&(r=n.text)}return{role:t.role,content:r}})}function Vw(e){return{id:e.id,role:e.role,content:[{type:"text",text:e.content}],createdAt:new Date(e.createdAt),metadata:{custom:{}},...e.role==="assistant"&&{status:{type:"complete",reason:"stop"},metadata:{unstable_state:null,unstable_annotations:[],unstable_data:[],steps:[],custom:{}}},...e.role==="user"&&{attachments:[]}}}const Fi=new Map;function Hw(e,t){return{async list(){const r=[];let a,i=0;do{const s=await e.listChats({limit:50,cursor:a}),l=s.items||[];Array.isArray(l)&&l.length>0&&r.push(...l),a=s.nextCursor||void 0,i++}while(a&&i<50);return{threads:r.map(s=>{const l=s.id;return!l||s.deletedAt?null:{status:"regular",remoteId:l,title:s.title||"New Chat",createdAt:s.createdAt?new Date(s.createdAt):new Date,updatedAt:s.updatedAt?new Date(s.updatedAt):new Date}}).filter(s=>s!==null)}},async initialize(r){return{remoteId:Fi.get(r)||r,externalId:void 0}},async rename(r,n){await e.updateChat(r,{title:n})},async archive(r){},async unarchive(r){},async delete(r){await e.deleteChat(r)},async generateTitle(r,n){return new ReadableStream},async fetch(r){try{const n=await e.getChat(r);return{status:"regular",remoteId:n.id||r,title:n.title||"Chat",createdAt:n.createdAt?new Date(n.createdAt):new Date,updatedAt:n.updatedAt?new Date(n.updatedAt):new Date}}catch{return{status:"regular",remoteId:r,createdAt:new Date,updatedAt:new Date}}},updateRemoteId(r,n){Fi.set(r,n),t?.(r,n)},unstable_Provider:({children:r})=>{const a=pe.useThreadListItem()?.remoteId,i=V.useMemo(()=>({async load(){if(!a)return{messages:[]};try{const s=await e.getChat(a);return!s.messages||s.messages.length===0?{messages:[]}:{messages:s.messages.map(u=>Vw(u))}}catch{return{messages:[]}}},async append(s){}}),[a,e]),o=V.useMemo(()=>({history:i}),[i]);return _.jsx(pe.RuntimeAdapterProvider,{adapters:o,children:r})}}}class Gw{constructor(){re(this,"messageMetadata",new Map);re(this,"currentMessageId",null);re(this,"listeners",new Set)}setCurrentMessage(t){this.currentMessageId=t}update(t){if(!this.currentMessageId)return;const r=this.messageMetadata.get(this.currentMessageId)||{},n=t.sources;n&&n.length>0&&(this.messageMetadata.set(this.currentMessageId,{...r,sources:n}),this.notify())}get(){return this.currentMessageId?this.messageMetadata.get(this.currentMessageId)||{}:{}}getForMessage(t){return this.messageMetadata.get(t)||{}}getCurrentMessageId(){return this.currentMessageId}clear(){this.currentMessageId=null}subscribe(t){return this.listeners.add(t),()=>this.listeners.delete(t)}notify(){this.listeners.forEach(t=>t())}}const Mt=new Gw,Gc=new Map,Pl=[];let bi=[];function jg(e,t,r=50,n=800){Pl.push({question:e,response:t,streamingSpeed:r,initialDelay:n})}function Dg(e,t){const{modelId:r,systemPrompt:n,ephemeral:a,enableReasoning:i,onChatCreated:o,onUserMessage:s,onThreadIdUpdate:l,onBeforeRequest:u,mockResponseOnBlocked:d}=t;let c;return{async*run(f){const{messages:p,abortSignal:m,context:g}=f,b=Pl.shift();if(b){s?.();const L=b.initialDelay??800;if(L>0&&await new Promise(H=>setTimeout(H,L)),m?.aborted)throw new Error("Request aborted");const Z=b.response.split(" ");let ae="";const ne=b.streamingSpeed||50,fe=`premade-${Date.now()}`;a&&o?.(fe);for(let H=0;H<Z.length;H++){if(m?.aborted)throw new Error("Request aborted");ae+=(H===0?"":" ")+Z[H],yield{content:[{type:"text",text:ae}]},await new Promise(me=>setTimeout(me,ne+Math.random()*(ne*.5)))}yield{content:[{type:"text",text:ae}]},bi.push({role:"user",content:b.question},{role:"assistant",content:b.response});return}const h=g?.threadId;let w=h;if(!w&&p.length>0){const L=p.find(Z=>Z.role==="user");L&&(w=(typeof L.content=="string"?L.content:Array.isArray(L.content)&&L.content.find(ae=>ae.type==="text")?.text||"").substring(0,50))}let x;h&&(x=Fi.get(h)),!x&&w&&(x=Gc.get(w)),!x&&c&&(x=c),s?.();let T=p,E=-1;for(let L=p.length-1;L>=0;L--)if(p[L].role==="assistant"){E=L;break}(x||E>=0)&&E>=0&&(T=p.slice(E+1));const y=Ww(T);if(bi.length>0&&!x){const L=bi.map(Z=>({role:Z.role,content:Z.content}));y.unshift(...L),bi=[]}const v={messages:y,chatId:x||null,systemPrompt:n,ephemeral:a,enableReasoning:i,stream:!0};if(r&&r.trim()!==""&&(v.modelId=r),u&&!await u()){if(d){const Z=typeof d=="function"?d():d,ae=p.filter(me=>me.role==="user"),ne=ae.length>0?ae[ae.length-1]:void 0;let fe="Message";ne&&(typeof ne.content=="string"?fe=ne.content:Array.isArray(ne.content)&&(fe=ne.content.find(ce=>ce.type==="text")?.text||"Message")),jg(fe,Z,40,400);const H=Pl.shift();if(H){s?.();const me=H.initialDelay??400;if(me>0&&await new Promise(q=>setTimeout(q,me)),m?.aborted)throw new Error("Request aborted");const ce=H.response.split(" ");let se="";const Se=H.streamingSpeed||40,Me=`mock-${Date.now()}`;a&&o?.(Me);for(let q=0;q<ce.length;q++){if(m?.aborted)throw new Error("Request aborted");se+=(q===0?"":" ")+ce[q],yield{content:[{type:"text",text:se}]},await new Promise(Q=>setTimeout(Q,Se+Math.random()*(Se*.3)))}yield{content:[{type:"text",text:se}]};return}}throw new Error("Request blocked")}const R=await e.createOrContinueChat(v,m);let k="",P="",M;const F=[];let j=0,D=!1;const J=`msg_${Date.now()}_${Math.random().toString(36).substring(2,9)}`;Mt.clear(),Mt.setCurrentMessage(J);const B=()=>{F.length!==j&&(j=F.length,Mt.update({sources:F.length>0?[...F]:void 0}))},Y=()=>{B();const L=[];return P&&L.push({type:"reasoning",text:P}),k&&L.push({type:"text",text:k}),L.length===0&&L.push({type:"text",text:""}),{content:L}};for await(const L of Uw(R,m)){if(m?.aborted)throw new Error("Request aborted");const Z=L.id||L.chatId||L.messageId;Z&&!M&&(M=Z,c=Z,o?.(Z),h&&l&&(l(h,Z),Fi.set(h,Z)),w&&Gc.set(w,Z));const ae=L.sources;if(ae&&Array.isArray(ae)&&ae.length>0)for(const H of ae)F.some(me=>me.sourceId===H.sourceId)||F.push({sourceId:H.sourceId,filename:H.filename||"Unknown",score:H.score??1,chunkId:H.chunkId,datasetId:H.datasetId});const ne=L.reasoning;if(ne&&ne.length>0&&(P+=ne,yield Y()),L.type)switch(L.type){case"source-document":L.sourceId&&F.push({sourceId:L.sourceId,filename:L.title||"Unknown",score:1});continue;case"reasoning-start":continue;case"reasoning-delta":L.delta&&(P+=L.delta),(k||P)&&(yield Y());continue;case"reasoning-end":(k||P)&&(yield Y());continue;case"text-delta":L.delta&&(P&&!D&&!k&&(D=!0,await new Promise(H=>setTimeout(H,400))),k+=L.delta),k&&(yield Y());continue;case"error":throw new Error(L.errorText||"Stream error");case"text-start":case"text-end":case"start":case"start-step":case"finish-step":case"finish":continue}const fe=L.delta;if(fe!=null&&(P&&!D&&!k&&(D=!0,await new Promise(H=>setTimeout(H,400))),k+=fe),L.content&&(k+=L.content),L.message&&(k+=L.message.content||""),L.finished){(k||P||F.length>0)&&(yield Y());break}(k||P||F.length>0)&&(yield Y())}(k||P||F.length>0)&&(yield Y())}}}class Bo extends Error{constructor(t,r,n){super(t),this.code=r,this.file=n,this.name="AttachmentValidationError"}}const Kw=["image/jpeg","image/png","image/gif","image/webp","image/svg+xml","application/pdf","application/msword","application/vnd.openxmlformats-officedocument.wordprocessingml.document","application/vnd.ms-excel","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet","text/plain","text/markdown","text/csv","application/json"],Jw=[".pdf",".doc",".docx",".xls",".xlsx",".txt",".md",".csv",".json",".jpg",".jpeg",".png",".gif",".webp",".svg"],Xw=10*1024*1024;function Kc(e){if(e===0)return"0 Bytes";const t=1024,r=["Bytes","KB","MB","GB"],n=Math.floor(Math.log(e)/Math.log(t));return parseFloat((e/Math.pow(t,n)).toFixed(2))+" "+r[n]}function Yw(e){return e.lastIndexOf(".")>=0?e.slice(e.lastIndexOf(".")).toLowerCase():""}function Qw(e,t){const n={"image/jpeg":[".jpg",".jpeg"],"image/png":[".png"],"image/gif":[".gif"],"image/webp":[".webp"],"image/svg+xml":[".svg"],"application/pdf":[".pdf"],"text/plain":[".txt"],"text/markdown":[".md"],"text/csv":[".csv"],"application/json":[".json"]}[e];return n?n.includes(t.toLowerCase()):!0}function Zw(){return typeof crypto<"u"&&crypto.randomUUID?"attachment-"+crypto.randomUUID():"attachment-"+Date.now()+"-"+Math.random().toString(36).slice(2,11)}function wu(e={}){const{validation:t={},onValidationError:r,onAttachmentAdded:n,onAttachmentRemoved:a}=e,{maxFileSizeBytes:i=Xw,allowedMimeTypes:o=Kw,allowedExtensions:s=Jw,validateContentType:l=!0}=t,u=s.join(",");function d(c){if(c.size>i){const p=new Bo('File "'+c.name+'" is too large ('+Kc(c.size)+"). Maximum size is "+Kc(i)+".","FILE_TOO_LARGE",c);throw r?.(p),p}const f=Yw(c.name);if(f&&!s.some(p=>p.toLowerCase()===f)){const p=new Bo('File type "'+f+'" is not allowed. Allowed types: '+s.join(", "),"INVALID_TYPE",c);throw r?.(p),p}if(c.type&&!o.some(p=>{if(p.endsWith("/*")){const m=p.slice(0,-1);return c.type.startsWith(m)}return c.type===p})){const p=new Bo('File type "'+c.type+'" is not allowed.',"INVALID_TYPE",c);throw r?.(p),p}if(l&&c.type&&f&&!Qw(c.type,f)){const p=new Bo('File extension "'+f+'" does not match content type "'+c.type+'".',"VALIDATION_FAILED",c);throw r?.(p),p}}return{accept:u,async add({file:c}){d(c);let f="file";c.type.startsWith("image/")?f="image":(c.type.includes("pdf")||c.type.includes("document")||c.type.includes("text")||c.name.endsWith(".pdf")||c.name.endsWith(".docx")||c.name.endsWith(".txt")||c.name.endsWith(".md")||c.name.endsWith(".csv")||c.name.endsWith(".json"))&&(f="document");const p={id:Zw(),type:f,name:c.name,contentType:c.type,file:c,status:{type:"requires-action",reason:"composer-send"}};return n?.(p),p},async remove(c){a?.(c.id)},async send(c){if(c.type==="image"&&c.file){const f=await new Promise((p,m)=>{const g=new FileReader;g.onload=()=>p(g.result),g.onerror=()=>m(new Error("Failed to read file")),g.readAsDataURL(c.file)});return{...c,status:{type:"complete"},content:[{type:"image",image:f}]}}return{...c,status:{type:"complete"},content:[]}}}}function ex({children:e,baseUrl:t,sessionToken:r,isProxyMode:n=!1,mode:a="multiChat",modelId:i,onModelChange:o,ephemeral:s=!1,systemPrompt:l,enableReasoning:u=!1,initialThreadId:d,onError:c,onChatCreated:f,onUserMessage:p,onThreadIdUpdate:m,onChatsLoaded:g,enableAttachments:b=!1,onBeforeRequest:h,mockResponseOnBlocked:w}){const x=V.useMemo(()=>new $g(t,r||void 0,n),[t,r,n]),[T,E]=V.useState(i||null);V.useEffect(()=>{i&&E(i)},[i]);const y=V.useCallback(k=>{f?.(k)},[f]),v=V.useCallback((k,P)=>{m?.(k,P)},[m]),R=V.useMemo(()=>Dg(x,{modelId:T||void 0,systemPrompt:l,ephemeral:s,enableReasoning:u,onChatCreated:y,onUserMessage:p,onBeforeRequest:h,mockResponseOnBlocked:w}),[x,T,l,s,u,y,p,h,w]);return a==="singleChat"?_.jsx(tx,{modelAdapter:R,enableAttachments:b,children:e}):_.jsx(rx,{client:x,modelAdapterOptions:{modelId:T||void 0,systemPrompt:l,ephemeral:s,enableReasoning:u,onChatCreated:y,onUserMessage:p,onBeforeRequest:h,mockResponseOnBlocked:w},initialThreadId:d,onChatsLoaded:g,onThreadIdUpdate:v,onError:c,enableAttachments:b,children:e})}function tx({modelAdapter:e,enableAttachments:t,children:r}){const n=V.useMemo(()=>t?wu():void 0,[t]),a=pe.useLocalRuntime(e,{adapters:{...n&&{attachments:n}}});return _.jsx(pe.AssistantRuntimeProvider,{runtime:a,children:r})}function rx({client:e,modelAdapterOptions:t,initialThreadId:r,onChatsLoaded:n,onThreadIdUpdate:a,onError:i,enableAttachments:o,children:s}){const l=V.useMemo(()=>Hw(e,(g,b)=>{a?.(g,b)}),[e,a]),u=V.useCallback((g,b)=>{l.updateRemoteId&&l.updateRemoteId(g,b),a?.(g,b)},[l,a]),d=V.useMemo(()=>({...l,async list(){const g=await l.list();return n?.(),g}}),[l,n]);V.useEffect(()=>{window.__cuadraThreadListAdapter=d,window.__cuadraThreadListRuntime=null},[d]);const c=V.useMemo(()=>Dg(e,{...t,onThreadIdUpdate:u}),[e,t,u]),f=V.useMemo(()=>o?wu():void 0,[o]),p=V.useCallback(()=>pe.useLocalRuntime(c,{adapters:{...f&&{attachments:f}}}),[c,f]),m=pe.unstable_useRemoteThreadListRuntime({adapter:d,runtimeHook:p});return V.useEffect(()=>{window.__cuadraThreadListRuntime=m},[m]),_.jsx(pe.AssistantRuntimeProvider,{runtime:m,children:s})}function Jc(e,t){const r=String(e);if(typeof t!="string")throw new TypeError("Expected character");let n=0,a=r.indexOf(t);for(;a!==-1;)n++,a=r.indexOf(t,a+t.length);return n}const Yo=ls(/[A-Za-z]/),xu=ls(/[\dA-Za-z]/);function nx(e){return e!==null&&(e<32||e===127)}function Er(e){return e!==null&&e<-2}function Qe(e){return e!==null&&(e<0||e===32)}function At(e){return e===-2||e===-1||e===32}const ss=ls(/\p{P}|\p{S}/u),pr=ls(/\s/);function ls(e){return t;function t(r){return r!==null&&r>-1&&e.test(String.fromCharCode(r))}}function ax(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}const us=(function(e){if(e==null)return lx;if(typeof e=="function")return cs(e);if(typeof e=="object")return Array.isArray(e)?ox(e):ix(e);if(typeof e=="string")return sx(e);throw new Error("Expected function, string, or object as test")});function ox(e){const t=[];let r=-1;for(;++r<e.length;)t[r]=us(e[r]);return cs(n);function n(...a){let i=-1;for(;++i<t.length;)if(t[i].apply(this,a))return!0;return!1}}function ix(e){const t=e;return cs(r);function r(n){const a=n;let i;for(i in e)if(a[i]!==t[i])return!1;return!0}}function sx(e){return cs(t);function t(r){return r&&r.type===e}}function cs(e){return t;function t(r,n,a){return!!(ux(r)&&e.call(this,r,typeof n=="number"?n:void 0,a||void 0))}}function lx(){return!0}function ux(e){return e!==null&&typeof e=="object"&&"type"in e}const Lg=[],cx=!0,kl=!1,dx="skip";function Fg(e,t,r,n){let a;typeof t=="function"&&typeof r!="function"?(n=r,r=t):a=t;const i=us(a),o=n?-1:1;s(e,void 0,[])();function s(l,u,d){const c=l&&typeof l=="object"?l:{};if(typeof c.type=="string"){const p=typeof c.tagName=="string"?c.tagName:typeof c.name=="string"?c.name:void 0;Object.defineProperty(f,"name",{value:"node ("+(l.type+(p?"<"+p+">":""))+")"})}return f;function f(){let p=Lg,m,g,b;if((!t||i(l,u,d[d.length-1]||void 0))&&(p=fx(r(l,d)),p[0]===kl))return p;if("children"in l&&l.children){const h=l;if(h.children&&p[0]!==dx)for(g=(n?h.children.length:-1)+o,b=d.concat(h);g>-1&&g<h.children.length;){const w=h.children[g];if(m=s(w,g,b)(),m[0]===kl)return m;g=typeof m[1]=="number"?m[1]:g+o}}return p}}}function fx(e){return Array.isArray(e)?e:typeof e=="number"?[cx,e]:e==null?Lg:[e]}function px(e,t,r){const a=us((r||{}).ignore||[]),i=mx(t);let o=-1;for(;++o<i.length;)Fg(e,"text",s);function s(u,d){let c=-1,f;for(;++c<d.length;){const p=d[c],m=f?f.children:void 0;if(a(p,m?m.indexOf(p):void 0,f))return;f=p}if(f)return l(u,d)}function l(u,d){const c=d[d.length-1],f=i[o][0],p=i[o][1];let m=0;const b=c.children.indexOf(u);let h=!1,w=[];f.lastIndex=0;let x=f.exec(u.value);for(;x;){const T=x.index,E={index:x.index,input:x.input,stack:[...d,u]};let y=p(...x,E);if(typeof y=="string"&&(y=y.length>0?{type:"text",value:y}:void 0),y===!1?f.lastIndex=T+1:(m!==T&&w.push({type:"text",value:u.value.slice(m,T)}),Array.isArray(y)?w.push(...y):y&&w.push(y),m=T+x[0].length,h=!0),!f.global)break;x=f.exec(u.value)}return h?(m<u.value.length&&w.push({type:"text",value:u.value.slice(m)}),c.children.splice(b,1,...w)):w=[u],b+w.length}}function mx(e){const t=[];if(!Array.isArray(e))throw new TypeError("Expected find and replace tuple or list of tuples");const r=!e[0]||Array.isArray(e[0])?e:[e];let n=-1;for(;++n<r.length;){const a=r[n];t.push([hx(a[0]),gx(a[1])])}return t}function hx(e){return typeof e=="string"?new RegExp(ax(e),"g"):e}function gx(e){return typeof e=="function"?e:function(){return e}}const Ms="phrasing",As=["autolink","link","image","label"];function bx(){return{transforms:[Ex],enter:{literalAutolink:vx,literalAutolinkEmail:qs,literalAutolinkHttp:qs,literalAutolinkWww:qs},exit:{literalAutolink:Cx,literalAutolinkEmail:Rx,literalAutolinkHttp:wx,literalAutolinkWww:xx}}}function yx(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:Ms,notInConstruct:As},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:Ms,notInConstruct:As},{character:":",before:"[ps]",after:"\\/",inConstruct:Ms,notInConstruct:As}]}}function vx(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function qs(e){this.config.enter.autolinkProtocol.call(this,e)}function wx(e){this.config.exit.autolinkProtocol.call(this,e)}function xx(e){this.config.exit.data.call(this,e);const t=this.stack[this.stack.length-1];t.type,t.url="http://"+this.sliceSerialize(e)}function Rx(e){this.config.exit.autolinkEmail.call(this,e)}function Cx(e){this.exit(e)}function Ex(e){px(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,Tx],[/(?<=^|\s|\p{P}|\p{S})([-.\w+]+)@([-\w]+(?:\.[-\w]+)+)/gu,Sx]],{ignore:["link","linkReference"]})}function Tx(e,t,r,n,a){let i="";if(!Bg(a)||(/^w/i.test(t)&&(r=t+r,t="",i="http://"),!_x(r)))return!1;const o=Px(r+n);if(!o[0])return!1;const s={type:"link",title:null,url:i+t+o[0],children:[{type:"text",value:t+o[0]}]};return o[1]?[s,{type:"text",value:o[1]}]:s}function Sx(e,t,r,n){return!Bg(n,!0)||/[-\d_]$/.test(r)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+r,children:[{type:"text",value:t+"@"+r}]}}function _x(e){const t=e.split(".");return!(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[a-zA-Z\d]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[a-zA-Z\d]/.test(t[t.length-2])))}function Px(e){const t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let r=t[0],n=r.indexOf(")");const a=Jc(e,"(");let i=Jc(e,")");for(;n!==-1&&a>i;)e+=r.slice(0,n+1),r=r.slice(n+1),n=r.indexOf(")"),i++;return[e,r]}function Bg(e,t){const r=e.input.charCodeAt(e.index-1);return(e.index===0||pr(r)||ss(r))&&(!t||r!==47)}function ii(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}zg.peek=jx;function kx(){this.buffer()}function Mx(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function Ax(){this.buffer()}function qx(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function Ix(e){const t=this.resume(),r=this.stack[this.stack.length-1];r.type,r.identifier=ii(this.sliceSerialize(e)).toLowerCase(),r.label=t}function Ox(e){this.exit(e)}function Nx(e){const t=this.resume(),r=this.stack[this.stack.length-1];r.type,r.identifier=ii(this.sliceSerialize(e)).toLowerCase(),r.label=t}function $x(e){this.exit(e)}function jx(){return"["}function zg(e,t,r,n){const a=r.createTracker(n);let i=a.move("[^");const o=r.enter("footnoteReference"),s=r.enter("reference");return i+=a.move(r.safe(r.associationId(e),{after:"]",before:i})),s(),o(),i+=a.move("]"),i}function Dx(){return{enter:{gfmFootnoteCallString:kx,gfmFootnoteCall:Mx,gfmFootnoteDefinitionLabelString:Ax,gfmFootnoteDefinition:qx},exit:{gfmFootnoteCallString:Ix,gfmFootnoteCall:Ox,gfmFootnoteDefinitionLabelString:Nx,gfmFootnoteDefinition:$x}}}function Lx(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:r,footnoteReference:zg},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function r(n,a,i,o){const s=i.createTracker(o);let l=s.move("[^");const u=i.enter("footnoteDefinition"),d=i.enter("label");return l+=s.move(i.safe(i.associationId(n),{before:l,after:"]"})),d(),l+=s.move("]:"),n.children&&n.children.length>0&&(s.shift(4),l+=s.move((t?`
4
+ `:" ")+i.indentLines(i.containerFlow(n,s.current()),t?Ug:Fx))),u(),l}}function Fx(e,t,r){return t===0?e:Ug(e,t,r)}function Ug(e,t,r){return(r?"":" ")+e}const Bx=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];Wg.peek=Hx;function zx(){return{canContainEols:["delete"],enter:{strikethrough:Wx},exit:{strikethrough:Vx}}}function Ux(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:Bx}],handlers:{delete:Wg}}}function Wx(e){this.enter({type:"delete",children:[]},e)}function Vx(e){this.exit(e)}function Wg(e,t,r,n){const a=r.createTracker(n),i=r.enter("strikethrough");let o=a.move("~~");return o+=r.containerPhrasing(e,{...a.current(),before:o,after:"~"}),o+=a.move("~~"),i(),o}function Hx(){return"~"}function Gx(e){return e.length}function Kx(e,t){const r=t||{},n=(r.align||[]).concat(),a=r.stringLength||Gx,i=[],o=[],s=[],l=[];let u=0,d=-1;for(;++d<e.length;){const g=[],b=[];let h=-1;for(e[d].length>u&&(u=e[d].length);++h<e[d].length;){const w=Jx(e[d][h]);if(r.alignDelimiters!==!1){const x=a(w);b[h]=x,(l[h]===void 0||x>l[h])&&(l[h]=x)}g.push(w)}o[d]=g,s[d]=b}let c=-1;if(typeof n=="object"&&"length"in n)for(;++c<u;)i[c]=Xc(n[c]);else{const g=Xc(n);for(;++c<u;)i[c]=g}c=-1;const f=[],p=[];for(;++c<u;){const g=i[c];let b="",h="";g===99?(b=":",h=":"):g===108?b=":":g===114&&(h=":");let w=r.alignDelimiters===!1?1:Math.max(1,l[c]-b.length-h.length);const x=b+"-".repeat(w)+h;r.alignDelimiters!==!1&&(w=b.length+w+h.length,w>l[c]&&(l[c]=w),p[c]=w),f[c]=x}o.splice(1,0,f),s.splice(1,0,p),d=-1;const m=[];for(;++d<o.length;){const g=o[d],b=s[d];c=-1;const h=[];for(;++c<u;){const w=g[c]||"";let x="",T="";if(r.alignDelimiters!==!1){const E=l[c]-(b[c]||0),y=i[c];y===114?x=" ".repeat(E):y===99?E%2?(x=" ".repeat(E/2+.5),T=" ".repeat(E/2-.5)):(x=" ".repeat(E/2),T=x):T=" ".repeat(E)}r.delimiterStart!==!1&&!c&&h.push("|"),r.padding!==!1&&!(r.alignDelimiters===!1&&w==="")&&(r.delimiterStart!==!1||c)&&h.push(" "),r.alignDelimiters!==!1&&h.push(x),h.push(w),r.alignDelimiters!==!1&&h.push(T),r.padding!==!1&&h.push(" "),(r.delimiterEnd!==!1||c!==u-1)&&h.push("|")}m.push(r.delimiterEnd===!1?h.join("").replace(/ +$/,""):h.join(""))}return m.join(`
5
+ `)}function Jx(e){return e==null?"":String(e)}function Xc(e){const t=typeof e=="string"?e.codePointAt(0):0;return t===67||t===99?99:t===76||t===108?108:t===82||t===114?114:0}function Xx(e,t,r,n){const a=r.enter("blockquote"),i=r.createTracker(n);i.move("> "),i.shift(2);const o=r.indentLines(r.containerFlow(e,i.current()),Yx);return a(),o}function Yx(e,t,r){return">"+(r?"":" ")+e}function Qx(e,t){return Yc(e,t.inConstruct,!0)&&!Yc(e,t.notInConstruct,!1)}function Yc(e,t,r){if(typeof t=="string"&&(t=[t]),!t||t.length===0)return r;let n=-1;for(;++n<t.length;)if(e.includes(t[n]))return!0;return!1}function Qc(e,t,r,n){let a=-1;for(;++a<r.unsafe.length;)if(r.unsafe[a].character===`
6
+ `&&Qx(r.stack,r.unsafe[a]))return/[ \t]/.test(n.before)?"":" ";return`\\
7
+ `}function Zx(e,t){const r=String(e);let n=r.indexOf(t),a=n,i=0,o=0;if(typeof t!="string")throw new TypeError("Expected substring");for(;n!==-1;)n===a?++i>o&&(o=i):i=1,a=n+t.length,n=r.indexOf(t,a);return o}function e0(e,t){return!!(t.options.fences===!1&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}function t0(e){const t=e.options.fence||"`";if(t!=="`"&&t!=="~")throw new Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}function r0(e,t,r,n){const a=t0(r),i=e.value||"",o=a==="`"?"GraveAccent":"Tilde";if(e0(e,r)){const c=r.enter("codeIndented"),f=r.indentLines(i,n0);return c(),f}const s=r.createTracker(n),l=a.repeat(Math.max(Zx(i,a)+1,3)),u=r.enter("codeFenced");let d=s.move(l);if(e.lang){const c=r.enter(`codeFencedLang${o}`);d+=s.move(r.safe(e.lang,{before:d,after:" ",encode:["`"],...s.current()})),c()}if(e.lang&&e.meta){const c=r.enter(`codeFencedMeta${o}`);d+=s.move(" "),d+=s.move(r.safe(e.meta,{before:d,after:`
8
+ `,encode:["`"],...s.current()})),c()}return d+=s.move(`
9
+ `),i&&(d+=s.move(i+`
10
+ `)),d+=s.move(l),u(),d}function n0(e,t,r){return(r?"":" ")+e}function Ru(e){const t=e.options.quote||'"';if(t!=='"'&&t!=="'")throw new Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function a0(e,t,r,n){const a=Ru(r),i=a==='"'?"Quote":"Apostrophe",o=r.enter("definition");let s=r.enter("label");const l=r.createTracker(n);let u=l.move("[");return u+=l.move(r.safe(r.associationId(e),{before:u,after:"]",...l.current()})),u+=l.move("]: "),s(),!e.url||/[\0- \u007F]/.test(e.url)?(s=r.enter("destinationLiteral"),u+=l.move("<"),u+=l.move(r.safe(e.url,{before:u,after:">",...l.current()})),u+=l.move(">")):(s=r.enter("destinationRaw"),u+=l.move(r.safe(e.url,{before:u,after:e.title?" ":`
11
+ `,...l.current()}))),s(),e.title&&(s=r.enter(`title${i}`),u+=l.move(" "+a),u+=l.move(r.safe(e.title,{before:u,after:a,...l.current()})),u+=l.move(a),s()),o(),u}function o0(e){const t=e.options.emphasis||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}function Qo(e){return"&#x"+e.toString(16).toUpperCase()+";"}function Bi(e){if(e===null||Qe(e)||pr(e))return 1;if(ss(e))return 2}function zi(e,t,r){const n=Bi(e),a=Bi(t);return n===void 0?a===void 0?r==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:a===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:n===1?a===void 0?{inside:!1,outside:!1}:a===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:a===void 0?{inside:!1,outside:!1}:a===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}Vg.peek=i0;function Vg(e,t,r,n){const a=o0(r),i=r.enter("emphasis"),o=r.createTracker(n),s=o.move(a);let l=o.move(r.containerPhrasing(e,{after:a,before:s,...o.current()}));const u=l.charCodeAt(0),d=zi(n.before.charCodeAt(n.before.length-1),u,a);d.inside&&(l=Qo(u)+l.slice(1));const c=l.charCodeAt(l.length-1),f=zi(n.after.charCodeAt(0),c,a);f.inside&&(l=l.slice(0,-1)+Qo(c));const p=o.move(a);return i(),r.attentionEncodeSurroundingInfo={after:f.outside,before:d.outside},s+l+p}function i0(e,t,r){return r.options.emphasis||"*"}function s0(e,t,r,n){let a,i,o;typeof t=="function"&&typeof r!="function"?(i=void 0,o=t,a=r):(i=t,o=r,a=n),Fg(e,i,s,a);function s(l,u){const d=u[u.length-1],c=d?d.children.indexOf(l):void 0;return o(l,c,d)}}const l0={};function Hg(e,t){const r=l0,n=typeof r.includeImageAlt=="boolean"?r.includeImageAlt:!0,a=typeof r.includeHtml=="boolean"?r.includeHtml:!0;return Gg(e,n,a)}function Gg(e,t,r){if(u0(e)){if("value"in e)return e.type==="html"&&!r?"":e.value;if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return Zc(e.children,t,r)}return Array.isArray(e)?Zc(e,t,r):""}function Zc(e,t,r){const n=[];let a=-1;for(;++a<e.length;)n[a]=Gg(e[a],t,r);return n.join("")}function u0(e){return!!(e&&typeof e=="object")}function c0(e,t){let r=!1;return s0(e,function(n){if("value"in n&&/\r?\n|\r/.test(n.value)||n.type==="break")return r=!0,kl}),!!((!e.depth||e.depth<3)&&Hg(e)&&(t.options.setext||r))}function d0(e,t,r,n){const a=Math.max(Math.min(6,e.depth||1),1),i=r.createTracker(n);if(c0(e,r)){const d=r.enter("headingSetext"),c=r.enter("phrasing"),f=r.containerPhrasing(e,{...i.current(),before:`
12
12
  `,after:`
13
- `});return d(),f(),p+`
14
- `+(i===1?"=":"-").repeat(p.length-(Math.max(p.lastIndexOf("\r"),p.lastIndexOf(`
15
- `))+1))}const n="#".repeat(i),c=t.enter("headingAtx"),s=t.enter("phrasing");o.move(n+" ");let l=t.containerPhrasing(e,{before:"# ",after:`
16
- `,...o.current()});return/^[\t ]/.test(l)&&(l=be(l.charCodeAt(0))+l.slice(1)),l=l?n+" "+l:n,t.options.closeAtx&&(l+=" "+n),s(),c(),l}qt.peek=mn;function qt(e){return e.value||""}function mn(){return"<"}Ht.peek=pn;function Ht(e,r,t,a){const i=Je(t),o=i==='"'?"Quote":"Apostrophe",n=t.enter("image");let c=t.enter("label");const s=t.createTracker(a);let l=s.move("![");return l+=s.move(t.safe(e.alt,{before:l,after:"]",...s.current()})),l+=s.move("]("),c(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(c=t.enter("destinationLiteral"),l+=s.move("<"),l+=s.move(t.safe(e.url,{before:l,after:">",...s.current()})),l+=s.move(">")):(c=t.enter("destinationRaw"),l+=s.move(t.safe(e.url,{before:l,after:e.title?" ":")",...s.current()}))),c(),e.title&&(c=t.enter(`title${o}`),l+=s.move(" "+i),l+=s.move(t.safe(e.title,{before:l,after:i,...s.current()})),l+=s.move(i),c()),l+=s.move(")"),n(),l}function pn(){return"!"}Vt.peek=gn;function Vt(e,r,t,a){const i=e.referenceType,o=t.enter("imageReference");let n=t.enter("label");const c=t.createTracker(a);let s=c.move("![");const l=t.safe(e.alt,{before:s,after:"]",...c.current()});s+=c.move(l+"]["),n();const f=t.stack;t.stack=[],n=t.enter("reference");const d=t.safe(t.associationId(e),{before:s,after:"]",...c.current()});return n(),t.stack=f,o(),i==="full"||!l||l!==d?s+=c.move(d+"]"):i==="shortcut"?s=s.slice(0,-1):s+=c.move("]"),s}function gn(){return"!"}Xt.peek=xn;function Xt(e,r,t){let a=e.value||"",i="`",o=-1;for(;new RegExp("(^|[^`])"+i+"([^`]|$)").test(a);)i+="`";for(/[^ \r\n]/.test(a)&&(/^[ \r\n]/.test(a)&&/[ \r\n]$/.test(a)||/^`|`$/.test(a))&&(a=" "+a+" ");++o<t.unsafe.length;){const n=t.unsafe[o],c=t.compilePattern(n);let s;if(n.atBreak)for(;s=c.exec(a);){let l=s.index;a.charCodeAt(l)===10&&a.charCodeAt(l-1)===13&&l--,a=a.slice(0,l)+" "+a.slice(s.index+1)}}return i+a+i}function xn(){return"`"}function Kt(e,r){const t=Bt(e);return!!(!r.options.resourceLink&&e.url&&!e.title&&e.children&&e.children.length===1&&e.children[0].type==="text"&&(t===e.url||"mailto:"+t===e.url)&&/^[a-z][a-z+.-]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}Qt.peek=bn;function Qt(e,r,t,a){const i=Je(t),o=i==='"'?"Quote":"Apostrophe",n=t.createTracker(a);let c,s;if(Kt(e,t)){const f=t.stack;t.stack=[],c=t.enter("autolink");let d=n.move("<");return d+=n.move(t.containerPhrasing(e,{before:d,after:">",...n.current()})),d+=n.move(">"),c(),t.stack=f,d}c=t.enter("link"),s=t.enter("label");let l=n.move("[");return l+=n.move(t.containerPhrasing(e,{before:l,after:"](",...n.current()})),l+=n.move("]("),s(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(s=t.enter("destinationLiteral"),l+=n.move("<"),l+=n.move(t.safe(e.url,{before:l,after:">",...n.current()})),l+=n.move(">")):(s=t.enter("destinationRaw"),l+=n.move(t.safe(e.url,{before:l,after:e.title?" ":")",...n.current()}))),s(),e.title&&(s=t.enter(`title${o}`),l+=n.move(" "+i),l+=n.move(t.safe(e.title,{before:l,after:i,...n.current()})),l+=n.move(i),s()),l+=n.move(")"),c(),l}function bn(e,r,t){return Kt(e,t)?"<":"["}Gt.peek=yn;function Gt(e,r,t,a){const i=e.referenceType,o=t.enter("linkReference");let n=t.enter("label");const c=t.createTracker(a);let s=c.move("[");const l=t.containerPhrasing(e,{before:s,after:"]",...c.current()});s+=c.move(l+"]["),n();const f=t.stack;t.stack=[],n=t.enter("reference");const d=t.safe(t.associationId(e),{before:s,after:"]",...c.current()});return n(),t.stack=f,o(),i==="full"||!l||l!==d?s+=c.move(d+"]"):i==="shortcut"?s=s.slice(0,-1):s+=c.move("]"),s}function yn(){return"["}function Ye(e){const r=e.options.bullet||"*";if(r!=="*"&&r!=="+"&&r!=="-")throw new Error("Cannot serialize items with `"+r+"` for `options.bullet`, expected `*`, `+`, or `-`");return r}function kn(e){const r=Ye(e),t=e.options.bulletOther;if(!t)return r==="*"?"-":"*";if(t!=="*"&&t!=="+"&&t!=="-")throw new Error("Cannot serialize items with `"+t+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(t===r)throw new Error("Expected `bullet` (`"+r+"`) and `bulletOther` (`"+t+"`) to be different");return t}function wn(e){const r=e.options.bulletOrdered||".";if(r!=="."&&r!==")")throw new Error("Cannot serialize items with `"+r+"` for `options.bulletOrdered`, expected `.` or `)`");return r}function Zt(e){const r=e.options.rule||"*";if(r!=="*"&&r!=="-"&&r!=="_")throw new Error("Cannot serialize rules with `"+r+"` for `options.rule`, expected `*`, `-`, or `_`");return r}function vn(e,r,t,a){const i=t.enter("list"),o=t.bulletCurrent;let n=e.ordered?wn(t):Ye(t);const c=e.ordered?n==="."?")":".":kn(t);let s=r&&t.bulletLastUsed?n===t.bulletLastUsed:!1;if(!e.ordered){const f=e.children?e.children[0]:void 0;if((n==="*"||n==="-")&&f&&(!f.children||!f.children[0])&&t.stack[t.stack.length-1]==="list"&&t.stack[t.stack.length-2]==="listItem"&&t.stack[t.stack.length-3]==="list"&&t.stack[t.stack.length-4]==="listItem"&&t.indexStack[t.indexStack.length-1]===0&&t.indexStack[t.indexStack.length-2]===0&&t.indexStack[t.indexStack.length-3]===0&&(s=!0),Zt(t)===n&&f){let d=-1;for(;++d<e.children.length;){const p=e.children[d];if(p&&p.type==="listItem"&&p.children&&p.children[0]&&p.children[0].type==="thematicBreak"){s=!0;break}}}}s&&(n=c),t.bulletCurrent=n;const l=t.containerFlow(e,a);return t.bulletLastUsed=n,t.bulletCurrent=o,i(),l}function Cn(e){const r=e.options.listItemIndent||"one";if(r!=="tab"&&r!=="one"&&r!=="mixed")throw new Error("Cannot serialize items with `"+r+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return r}function jn(e,r,t,a){const i=Cn(t);let o=t.bulletCurrent||Ye(t);r&&r.type==="list"&&r.ordered&&(o=(typeof r.start=="number"&&r.start>-1?r.start:1)+(t.options.incrementListMarker===!1?0:r.children.indexOf(e))+o);let n=o.length+1;(i==="tab"||i==="mixed"&&(r&&r.type==="list"&&r.spread||e.spread))&&(n=Math.ceil(n/4)*4);const c=t.createTracker(a);c.move(o+" ".repeat(n-o.length)),c.shift(n);const s=t.enter("listItem"),l=t.indentLines(t.containerFlow(e,c.current()),f);return s(),l;function f(d,p,g){return p?(g?"":" ".repeat(n))+d:(g?o:o+" ".repeat(n-o.length))+d}}function Tn(e,r,t,a){const i=t.enter("paragraph"),o=t.enter("phrasing"),n=t.containerPhrasing(e,a);return o(),i(),n}const Mn=Ee(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function An(e,r,t,a){return(e.children.some(function(n){return Mn(n)})?t.containerPhrasing:t.containerFlow).call(t,e,a)}function Sn(e){const r=e.options.strong||"*";if(r!=="*"&&r!=="_")throw new Error("Cannot serialize strong with `"+r+"` for `options.strong`, expected `*`, or `_`");return r}Jt.peek=In;function Jt(e,r,t,a){const i=Sn(t),o=t.enter("strong"),n=t.createTracker(a),c=n.move(i+i);let s=n.move(t.containerPhrasing(e,{after:i,before:c,...n.current()}));const l=s.charCodeAt(0),f=Pe(a.before.charCodeAt(a.before.length-1),l,i);f.inside&&(s=be(l)+s.slice(1));const d=s.charCodeAt(s.length-1),p=Pe(a.after.charCodeAt(0),d,i);p.inside&&(s=s.slice(0,-1)+be(d));const g=n.move(i+i);return o(),t.attentionEncodeSurroundingInfo={after:p.outside,before:f.outside},c+s+g}function In(e,r,t){return t.options.strong||"*"}function Nn(e,r,t,a){return t.safe(e.value,a)}function Pn(e){const r=e.options.ruleRepetition||3;if(r<3)throw new Error("Cannot serialize rules with repetition `"+r+"` for `options.ruleRepetition`, expected `3` or more");return r}function Rn(e,r,t){const a=(Zt(t)+(t.options.ruleSpaces?" ":"")).repeat(Pn(t));return t.options.ruleSpaces?a.slice(0,-1):a}const Yt={blockquote:Za,break:bt,code:an,definition:on,emphasis:Ut,hardBreak:bt,heading:hn,html:qt,image:Ht,imageReference:Vt,inlineCode:Xt,link:Qt,linkReference:Gt,list:vn,listItem:jn,paragraph:Tn,root:An,strong:Jt,text:Nn,thematicBreak:Rn};function Ln(){return{enter:{table:En,tableData:kt,tableHeader:kt,tableRow:_n},exit:{codeText:Fn,table:Dn,tableData:Ue,tableHeader:Ue,tableRow:Ue}}}function En(e){const r=e._align;this.enter({type:"table",align:r.map(function(t){return t==="none"?null:t}),children:[]},e),this.data.inTable=!0}function Dn(e){this.exit(e),this.data.inTable=void 0}function _n(e){this.enter({type:"tableRow",children:[]},e)}function Ue(e){this.exit(e)}function kt(e){this.enter({type:"tableCell",children:[]},e)}function Fn(e){let r=this.resume();this.data.inTable&&(r=r.replace(/\\([\\|])/g,zn));const t=this.stack[this.stack.length-1];t.type,t.value=r,this.exit(e)}function zn(e,r){return r==="|"?r:e}function $n(e){const r=e||{},t=r.tableCellPadding,a=r.tablePipeAlign,i=r.stringLength,o=t?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
17
- `,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:p,table:n,tableCell:s,tableRow:c}};function n(g,m,k,x){return l(f(g,k,x),g.align)}function c(g,m,k,x){const b=d(g,k,x),w=l([b]);return w.slice(0,w.indexOf(`
18
- `))}function s(g,m,k,x){const b=k.enter("tableCell"),w=k.enter("phrasing"),v=k.containerPhrasing(g,{...x,before:o,after:o});return w(),b(),v}function l(g,m){return Qa(g,{align:m,alignDelimiters:a,padding:t,stringLength:i})}function f(g,m,k){const x=g.children;let b=-1;const w=[],v=m.enter("table");for(;++b<x.length;)w[b]=d(x[b],m,k);return v(),w}function d(g,m,k){const x=g.children;let b=-1;const w=[],v=m.enter("tableRow");for(;++b<x.length;)w[b]=s(x[b],g,m,k);return v(),w}function p(g,m,k){let x=Yt.inlineCode(g,m,k);return k.stack.includes("tableCell")&&(x=x.replace(/\|/g,"\\$&")),x}}function On(){return{exit:{taskListCheckValueChecked:wt,taskListCheckValueUnchecked:wt,paragraph:Bn}}}function Un(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:Wn}}}function wt(e){const r=this.stack[this.stack.length-2];r.type,r.checked=e.type==="taskListCheckValueChecked"}function Bn(e){const r=this.stack[this.stack.length-2];if(r&&r.type==="listItem"&&typeof r.checked=="boolean"){const t=this.stack[this.stack.length-1];t.type;const a=t.children[0];if(a&&a.type==="text"){const i=r.children;let o=-1,n;for(;++o<i.length;){const c=i[o];if(c.type==="paragraph"){n=c;break}}n===t&&(a.value=a.value.slice(1),a.value.length===0?t.children.shift():t.position&&a.position&&typeof a.position.start.offset=="number"&&(a.position.start.column++,a.position.start.offset++,t.position.start=Object.assign({},a.position.start)))}}this.exit(e)}function Wn(e,r,t,a){const i=e.children[0],o=typeof e.checked=="boolean"&&i&&i.type==="paragraph",n="["+(e.checked?"x":" ")+"] ",c=t.createTracker(a);o&&c.move(n);let s=Yt.listItem(e,r,t,{...a,...c.current()});return o&&(s=s.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,l)),s;function l(f){return f+n}}function qn(){return[ba(),$a(),Wa(),Ln(),On()]}function Hn(e){return{extensions:[ya(),Oa(e),qa(),$n(e),Un()]}}function Se(e,r,t,a){const i=e.length;let o=0,n;if(r<0?r=-r>i?0:i+r:r=r>i?i:r,t=t>0?t:0,a.length<1e4)n=Array.from(a),n.unshift(r,t),e.splice(...n);else for(t&&e.splice(r,t);o<a.length;)n=a.slice(o,o+1e4),n.unshift(r,0),e.splice(...n),o+=1e4,r+=1e4}const vt={}.hasOwnProperty;function Vn(e){const r={};let t=-1;for(;++t<e.length;)Xn(r,e[t]);return r}function Xn(e,r){let t;for(t in r){const i=(vt.call(e,t)?e[t]:void 0)||(e[t]={}),o=r[t];let n;if(o)for(n in o){vt.call(i,n)||(i[n]=[]);const c=o[n];Kn(i[n],Array.isArray(c)?c:c?[c]:[])}}}function Kn(e,r){let t=-1;const a=[];for(;++t<r.length;)(r[t].add==="after"?e:a).push(r[t]);Se(e,0,0,a)}const Qn={tokenize:ti,partial:!0},er={tokenize:ri,partial:!0},tr={tokenize:ai,partial:!0},rr={tokenize:ni,partial:!0},Gn={tokenize:ii,partial:!0},ar={name:"wwwAutolink",tokenize:Yn,previous:ir},nr={name:"protocolAutolink",tokenize:ei,previous:or},te={name:"emailAutolink",tokenize:Jn,previous:sr},K={};function Zn(){return{text:K}}let ne=48;for(;ne<123;)K[ne]=te,ne++,ne===58?ne=65:ne===91&&(ne=97);K[43]=te;K[45]=te;K[46]=te;K[95]=te;K[72]=[te,nr];K[104]=[te,nr];K[87]=[te,ar];K[119]=[te,ar];function Jn(e,r,t){const a=this;let i,o;return n;function n(d){return!Qe(d)||!sr.call(a,a.previous)||et(a.events)?t(d):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),c(d))}function c(d){return Qe(d)?(e.consume(d),c):d===64?(e.consume(d),s):t(d)}function s(d){return d===46?e.check(Gn,f,l)(d):d===45||d===95||Ze(d)?(o=!0,e.consume(d),s):f(d)}function l(d){return e.consume(d),i=!0,s}function f(d){return o&&i&&xe(a.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),r(d)):t(d)}}function Yn(e,r,t){const a=this;return i;function i(n){return n!==87&&n!==119||!ir.call(a,a.previous)||et(a.events)?t(n):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(Qn,e.attempt(er,e.attempt(tr,o),t),t)(n))}function o(n){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),r(n)}}function ei(e,r,t){const a=this;let i="",o=!1;return n;function n(d){return(d===72||d===104)&&or.call(a,a.previous)&&!et(a.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),i+=String.fromCodePoint(d),e.consume(d),c):t(d)}function c(d){if(xe(d)&&i.length<5)return i+=String.fromCodePoint(d),e.consume(d),c;if(d===58){const p=i.toLowerCase();if(p==="http"||p==="https")return e.consume(d),s}return t(d)}function s(d){return d===47?(e.consume(d),o?l:(o=!0,s)):t(d)}function l(d){return d===null||na(d)||B(d)||ie(d)||Re(d)?t(d):e.attempt(er,e.attempt(tr,f),t)(d)}function f(d){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),r(d)}}function ti(e,r,t){let a=0;return i;function i(n){return(n===87||n===119)&&a<3?(a++,e.consume(n),i):n===46&&a===3?(e.consume(n),o):t(n)}function o(n){return n===null?t(n):r(n)}}function ri(e,r,t){let a,i,o;return n;function n(l){return l===46||l===95?e.check(rr,s,c)(l):l===null||B(l)||ie(l)||l!==45&&Re(l)?s(l):(o=!0,e.consume(l),n)}function c(l){return l===95?a=!0:(i=a,a=void 0),e.consume(l),n}function s(l){return i||a||!o?t(l):r(l)}}function ai(e,r){let t=0,a=0;return i;function i(n){return n===40?(t++,e.consume(n),i):n===41&&a<t?o(n):n===33||n===34||n===38||n===39||n===41||n===42||n===44||n===46||n===58||n===59||n===60||n===63||n===93||n===95||n===126?e.check(rr,r,o)(n):n===null||B(n)||ie(n)?r(n):(e.consume(n),i)}function o(n){return n===41&&a++,e.consume(n),i}}function ni(e,r,t){return a;function a(c){return c===33||c===34||c===39||c===41||c===42||c===44||c===46||c===58||c===59||c===63||c===95||c===126?(e.consume(c),a):c===38?(e.consume(c),o):c===93?(e.consume(c),i):c===60||c===null||B(c)||ie(c)?r(c):t(c)}function i(c){return c===null||c===40||c===91||B(c)||ie(c)?r(c):a(c)}function o(c){return xe(c)?n(c):t(c)}function n(c){return c===59?(e.consume(c),a):xe(c)?(e.consume(c),n):t(c)}}function ii(e,r,t){return a;function a(o){return e.consume(o),i}function i(o){return Ze(o)?t(o):r(o)}}function ir(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||B(e)}function or(e){return!xe(e)}function sr(e){return!(e===47||Qe(e))}function Qe(e){return e===43||e===45||e===46||e===95||Ze(e)}function et(e){let r=e.length,t=!1;for(;r--;){const a=e[r][1];if((a.type==="labelLink"||a.type==="labelImage")&&!a._balanced){t=!0;break}if(a._gfmAutolinkLiteralWalkedInto){t=!1;break}}return e.length>0&&!t&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),t}function oi(e,r,t){const a=[];let i=-1;for(;++i<e.length;){const o=e[i].resolveAll;o&&!a.includes(o)&&(r=o(r,t),a.push(o))}return r}function ee(e,r,t,a){const i=a?a-1:Number.POSITIVE_INFINITY;let o=0;return n;function n(s){return Y(s)?(e.enter(t),c(s)):r(s)}function c(s){return Y(s)&&o++<i?(e.consume(s),c):(e.exit(t),r(s))}}const si={partial:!0,tokenize:ci};function ci(e,r,t){return a;function a(o){return Y(o)?ee(e,i,"linePrefix")(o):i(o)}function i(o){return o===null||de(o)?r(o):t(o)}}const ui={tokenize:xi,partial:!0};function li(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:mi,continuation:{tokenize:pi},exit:gi}},text:{91:{name:"gfmFootnoteCall",tokenize:hi},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:di,resolveTo:fi}}}}function di(e,r,t){const a=this;let i=a.events.length;const o=a.parser.gfmFootnotes||(a.parser.gfmFootnotes=[]);let n;for(;i--;){const s=a.events[i][1];if(s.type==="labelImage"){n=s;break}if(s.type==="gfmFootnoteCall"||s.type==="labelLink"||s.type==="label"||s.type==="image"||s.type==="link")break}return c;function c(s){if(!n||!n._balanced)return t(s);const l=ye(a.sliceSerialize({start:n.end,end:a.now()}));return l.codePointAt(0)!==94||!o.includes(l.slice(1))?t(s):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(s),e.exit("gfmFootnoteCallLabelMarker"),r(s))}}function fi(e,r){let t=e.length;for(;t--;)if(e[t][1].type==="labelImage"&&e[t][0]==="enter"){e[t][1];break}e[t+1][1].type="data",e[t+3][1].type="gfmFootnoteCallLabelMarker";const a={type:"gfmFootnoteCall",start:Object.assign({},e[t+3][1].start),end:Object.assign({},e[e.length-1][1].end)},i={type:"gfmFootnoteCallMarker",start:Object.assign({},e[t+3][1].end),end:Object.assign({},e[t+3][1].end)};i.end.column++,i.end.offset++,i.end._bufferIndex++;const o={type:"gfmFootnoteCallString",start:Object.assign({},i.end),end:Object.assign({},e[e.length-1][1].start)},n={type:"chunkString",contentType:"string",start:Object.assign({},o.start),end:Object.assign({},o.end)},c=[e[t+1],e[t+2],["enter",a,r],e[t+3],e[t+4],["enter",i,r],["exit",i,r],["enter",o,r],["enter",n,r],["exit",n,r],["exit",o,r],e[e.length-2],e[e.length-1],["exit",a,r]];return e.splice(t,e.length-t+1,...c),e}function hi(e,r,t){const a=this,i=a.parser.gfmFootnotes||(a.parser.gfmFootnotes=[]);let o=0,n;return c;function c(d){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(d),e.exit("gfmFootnoteCallLabelMarker"),s}function s(d){return d!==94?t(d):(e.enter("gfmFootnoteCallMarker"),e.consume(d),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",l)}function l(d){if(o>999||d===93&&!n||d===null||d===91||B(d))return t(d);if(d===93){e.exit("chunkString");const p=e.exit("gfmFootnoteCallString");return i.includes(ye(a.sliceSerialize(p)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(d),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),r):t(d)}return B(d)||(n=!0),o++,e.consume(d),d===92?f:l}function f(d){return d===91||d===92||d===93?(e.consume(d),o++,l):l(d)}}function mi(e,r,t){const a=this,i=a.parser.gfmFootnotes||(a.parser.gfmFootnotes=[]);let o,n=0,c;return s;function s(m){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(m),e.exit("gfmFootnoteDefinitionLabelMarker"),l}function l(m){return m===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(m),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",f):t(m)}function f(m){if(n>999||m===93&&!c||m===null||m===91||B(m))return t(m);if(m===93){e.exit("chunkString");const k=e.exit("gfmFootnoteDefinitionLabelString");return o=ye(a.sliceSerialize(k)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(m),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),p}return B(m)||(c=!0),n++,e.consume(m),m===92?d:f}function d(m){return m===91||m===92||m===93?(e.consume(m),n++,f):f(m)}function p(m){return m===58?(e.enter("definitionMarker"),e.consume(m),e.exit("definitionMarker"),i.includes(o)||i.push(o),ee(e,g,"gfmFootnoteDefinitionWhitespace")):t(m)}function g(m){return r(m)}}function pi(e,r,t){return e.check(si,r,e.attempt(ui,r,t))}function gi(e){e.exit("gfmFootnoteDefinition")}function xi(e,r,t){const a=this;return ee(e,i,"gfmFootnoteDefinitionIndent",5);function i(o){const n=a.events[a.events.length-1];return n&&n[1].type==="gfmFootnoteDefinitionIndent"&&n[2].sliceSerialize(n[1],!0).length===4?r(o):t(o)}}function bi(e){let t=(e||{}).singleTilde;const a={name:"strikethrough",tokenize:o,resolveAll:i};return t==null&&(t=!0),{text:{126:a},insideSpan:{null:[a]},attentionMarkers:{null:[126]}};function i(n,c){let s=-1;for(;++s<n.length;)if(n[s][0]==="enter"&&n[s][1].type==="strikethroughSequenceTemporary"&&n[s][1]._close){let l=s;for(;l--;)if(n[l][0]==="exit"&&n[l][1].type==="strikethroughSequenceTemporary"&&n[l][1]._open&&n[s][1].end.offset-n[s][1].start.offset===n[l][1].end.offset-n[l][1].start.offset){n[s][1].type="strikethroughSequence",n[l][1].type="strikethroughSequence";const f={type:"strikethrough",start:Object.assign({},n[l][1].start),end:Object.assign({},n[s][1].end)},d={type:"strikethroughText",start:Object.assign({},n[l][1].end),end:Object.assign({},n[s][1].start)},p=[["enter",f,c],["enter",n[l][1],c],["exit",n[l][1],c],["enter",d,c]],g=c.parser.constructs.insideSpan.null;g&&Se(p,p.length,0,oi(g,n.slice(l+1,s),c)),Se(p,p.length,0,[["exit",d,c],["enter",n[s][1],c],["exit",n[s][1],c],["exit",f,c]]),Se(n,l-1,s-l+3,p),s=l+p.length-2;break}}for(s=-1;++s<n.length;)n[s][1].type==="strikethroughSequenceTemporary"&&(n[s][1].type="data");return n}function o(n,c,s){const l=this.previous,f=this.events;let d=0;return p;function p(m){return l===126&&f[f.length-1][1].type!=="characterEscape"?s(m):(n.enter("strikethroughSequenceTemporary"),g(m))}function g(m){const k=Ne(l);if(m===126)return d>1?s(m):(n.consume(m),d++,g);if(d<2&&!t)return s(m);const x=n.exit("strikethroughSequenceTemporary"),b=Ne(m);return x._open=!b||b===2&&!!k,x._close=!k||k===2&&!!b,c(m)}}}class yi{constructor(){this.map=[]}add(r,t,a){ki(this,r,t,a)}consume(r){if(this.map.sort(function(o,n){return o[0]-n[0]}),this.map.length===0)return;let t=this.map.length;const a=[];for(;t>0;)t-=1,a.push(r.slice(this.map[t][0]+this.map[t][1]),this.map[t][2]),r.length=this.map[t][0];a.push(r.slice()),r.length=0;let i=a.pop();for(;i;){for(const o of i)r.push(o);i=a.pop()}this.map.length=0}}function ki(e,r,t,a){let i=0;if(!(t===0&&a.length===0)){for(;i<e.map.length;){if(e.map[i][0]===r){e.map[i][1]+=t,e.map[i][2].push(...a);return}i+=1}e.map.push([r,t,a])}}function wi(e,r){let t=!1;const a=[];for(;r<e.length;){const i=e[r];if(t){if(i[0]==="enter")i[1].type==="tableContent"&&a.push(e[r+1][1].type==="tableDelimiterMarker"?"left":"none");else if(i[1].type==="tableContent"){if(e[r-1][1].type==="tableDelimiterMarker"){const o=a.length-1;a[o]=a[o]==="left"?"center":"right"}}else if(i[1].type==="tableDelimiterRow")break}else i[0]==="enter"&&i[1].type==="tableDelimiterRow"&&(t=!0);r+=1}return a}function vi(){return{flow:{null:{name:"table",tokenize:Ci,resolveAll:ji}}}}function Ci(e,r,t){const a=this;let i=0,o=0,n;return c;function c(h){let U=a.events.length-1;for(;U>-1;){const X=a.events[U][1].type;if(X==="lineEnding"||X==="linePrefix")U--;else break}const F=U>-1?a.events[U][1].type:null,V=F==="tableHead"||F==="tableRow"?C:s;return V===C&&a.parser.lazy[a.now().line]?t(h):V(h)}function s(h){return e.enter("tableHead"),e.enter("tableRow"),l(h)}function l(h){return h===124||(n=!0,o+=1),f(h)}function f(h){return h===null?t(h):de(h)?o>1?(o=0,a.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(h),e.exit("lineEnding"),g):t(h):Y(h)?ee(e,f,"whitespace")(h):(o+=1,n&&(n=!1,i+=1),h===124?(e.enter("tableCellDivider"),e.consume(h),e.exit("tableCellDivider"),n=!0,f):(e.enter("data"),d(h)))}function d(h){return h===null||h===124||B(h)?(e.exit("data"),f(h)):(e.consume(h),h===92?p:d)}function p(h){return h===92||h===124?(e.consume(h),d):d(h)}function g(h){return a.interrupt=!1,a.parser.lazy[a.now().line]?t(h):(e.enter("tableDelimiterRow"),n=!1,Y(h)?ee(e,m,"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(h):m(h))}function m(h){return h===45||h===58?x(h):h===124?(n=!0,e.enter("tableCellDivider"),e.consume(h),e.exit("tableCellDivider"),k):I(h)}function k(h){return Y(h)?ee(e,x,"whitespace")(h):x(h)}function x(h){return h===58?(o+=1,n=!0,e.enter("tableDelimiterMarker"),e.consume(h),e.exit("tableDelimiterMarker"),b):h===45?(o+=1,b(h)):h===null||de(h)?R(h):I(h)}function b(h){return h===45?(e.enter("tableDelimiterFiller"),w(h)):I(h)}function w(h){return h===45?(e.consume(h),w):h===58?(n=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(h),e.exit("tableDelimiterMarker"),v):(e.exit("tableDelimiterFiller"),v(h))}function v(h){return Y(h)?ee(e,R,"whitespace")(h):R(h)}function R(h){return h===124?m(h):h===null||de(h)?!n||i!==o?I(h):(e.exit("tableDelimiterRow"),e.exit("tableHead"),r(h)):I(h)}function I(h){return t(h)}function C(h){return e.enter("tableRow"),L(h)}function L(h){return h===124?(e.enter("tableCellDivider"),e.consume(h),e.exit("tableCellDivider"),L):h===null||de(h)?(e.exit("tableRow"),r(h)):Y(h)?ee(e,L,"whitespace")(h):(e.enter("data"),D(h))}function D(h){return h===null||h===124||B(h)?(e.exit("data"),L(h)):(e.consume(h),h===92?A:D)}function A(h){return h===92||h===124?(e.consume(h),D):D(h)}}function ji(e,r){let t=-1,a=!0,i=0,o=[0,0,0,0],n=[0,0,0,0],c=!1,s=0,l,f,d;const p=new yi;for(;++t<e.length;){const g=e[t],m=g[1];g[0]==="enter"?m.type==="tableHead"?(c=!1,s!==0&&(Ct(p,r,s,l,f),f=void 0,s=0),l={type:"table",start:Object.assign({},m.start),end:Object.assign({},m.end)},p.add(t,0,[["enter",l,r]])):m.type==="tableRow"||m.type==="tableDelimiterRow"?(a=!0,d=void 0,o=[0,0,0,0],n=[0,t+1,0,0],c&&(c=!1,f={type:"tableBody",start:Object.assign({},m.start),end:Object.assign({},m.end)},p.add(t,0,[["enter",f,r]])),i=m.type==="tableDelimiterRow"?2:f?3:1):i&&(m.type==="data"||m.type==="tableDelimiterMarker"||m.type==="tableDelimiterFiller")?(a=!1,n[2]===0&&(o[1]!==0&&(n[0]=n[1],d=Ae(p,r,o,i,void 0,d),o=[0,0,0,0]),n[2]=t)):m.type==="tableCellDivider"&&(a?a=!1:(o[1]!==0&&(n[0]=n[1],d=Ae(p,r,o,i,void 0,d)),o=n,n=[o[1],t,0,0])):m.type==="tableHead"?(c=!0,s=t):m.type==="tableRow"||m.type==="tableDelimiterRow"?(s=t,o[1]!==0?(n[0]=n[1],d=Ae(p,r,o,i,t,d)):n[1]!==0&&(d=Ae(p,r,n,i,t,d)),i=0):i&&(m.type==="data"||m.type==="tableDelimiterMarker"||m.type==="tableDelimiterFiller")&&(n[3]=t)}for(s!==0&&Ct(p,r,s,l,f),p.consume(r.events),t=-1;++t<r.events.length;){const g=r.events[t];g[0]==="enter"&&g[1].type==="table"&&(g[1]._align=wi(r.events,t))}return e}function Ae(e,r,t,a,i,o){const n=a===1?"tableHeader":a===2?"tableDelimiter":"tableData",c="tableContent";t[0]!==0&&(o.end=Object.assign({},le(r.events,t[0])),e.add(t[0],0,[["exit",o,r]]));const s=le(r.events,t[1]);if(o={type:n,start:Object.assign({},s),end:Object.assign({},s)},e.add(t[1],0,[["enter",o,r]]),t[2]!==0){const l=le(r.events,t[2]),f=le(r.events,t[3]),d={type:c,start:Object.assign({},l),end:Object.assign({},f)};if(e.add(t[2],0,[["enter",d,r]]),a!==2){const p=r.events[t[2]],g=r.events[t[3]];if(p[1].end=Object.assign({},g[1].end),p[1].type="chunkText",p[1].contentType="text",t[3]>t[2]+1){const m=t[2]+1,k=t[3]-t[2]-1;e.add(m,k,[])}}e.add(t[3]+1,0,[["exit",d,r]])}return i!==void 0&&(o.end=Object.assign({},le(r.events,i)),e.add(i,0,[["exit",o,r]]),o=void 0),o}function Ct(e,r,t,a,i){const o=[],n=le(r.events,t);i&&(i.end=Object.assign({},n),o.push(["exit",i,r])),a.end=Object.assign({},n),o.push(["exit",a,r]),e.add(t+1,0,o)}function le(e,r){const t=e[r],a=t[0]==="enter"?"start":"end";return t[1][a]}const Ti={name:"tasklistCheck",tokenize:Ai};function Mi(){return{text:{91:Ti}}}function Ai(e,r,t){const a=this;return i;function i(s){return a.previous!==null||!a._gfmTasklistFirstContentOfListItem?t(s):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(s),e.exit("taskListCheckMarker"),o)}function o(s){return B(s)?(e.enter("taskListCheckValueUnchecked"),e.consume(s),e.exit("taskListCheckValueUnchecked"),n):s===88||s===120?(e.enter("taskListCheckValueChecked"),e.consume(s),e.exit("taskListCheckValueChecked"),n):t(s)}function n(s){return s===93?(e.enter("taskListCheckMarker"),e.consume(s),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),c):t(s)}function c(s){return de(s)?r(s):Y(s)?e.check({tokenize:Si},r,t)(s):t(s)}}function Si(e,r,t){return ee(e,a,"whitespace");function a(i){return i===null?t(i):r(i)}}function Ii(e){return Vn([Zn(),li(),bi(e),vi(),Mi()])}const Ni={};function Pi(e){const r=this,t=e||Ni,a=r.data(),i=a.micromarkExtensions||(a.micromarkExtensions=[]),o=a.fromMarkdownExtensions||(a.fromMarkdownExtensions=[]),n=a.toMarkdownExtensions||(a.toMarkdownExtensions=[]);i.push(Ii(t)),o.push(qn()),n.push(Hn(t))}function $(...e){return e.filter(Boolean).join(" ")}const Ri=({content:e})=>u.jsx(He.MarkdownTextPrimitive,{remarkPlugins:[Pi],className:"cuadra-aui-md",components:Di,children:e}),tt=y.memo(Ri),Li=({language:e,code:r})=>{const{isCopied:t,copyToClipboard:a}=Ei(),i=()=>{!r||t||a(r)};return u.jsxs("div",{className:"cuadra-flex cuadra-items-center cuadra-justify-between cuadra-gap-4 cuadra-mt-4 cuadra-rounded-t-lg cuadra-bg-muted/50 cuadra-border-b cuadra-border-border cuadra-px-4 cuadra-py-2 cuadra-text-sm cuadra-font-normal cuadra-text-foreground cuadra-font-brand",children:[u.jsx("span",{className:"cuadra-lowercase [&>span]:cuadra-text-xs cuadra-font-brand",children:e}),u.jsxs("button",{onClick:i,className:"cuadra-p-1 cuadra-rounded hover:cuadra-bg-muted cuadra-transition-colors","aria-label":"Copy code",children:[!t&&u.jsx(Lr,{className:"cuadra-h-4 cuadra-w-4"}),t&&u.jsx(Sr,{className:"cuadra-h-4 cuadra-w-4"})]})]})},Ei=({copiedDuration:e=3e3}={})=>{const[r,t]=y.useState(!1);return{isCopied:r,copyToClipboard:i=>{i&&navigator.clipboard.writeText(i).then(()=>{t(!0),setTimeout(()=>t(!1),e)})}}},Di=He.unstable_memoizeMarkdownComponents({h1:({className:e,...r})=>u.jsx("h1",{className:$("cuadra-mb-6 cuadra-scroll-m-20 cuadra-text-2xl cuadra-font-normal cuadra-tracking-tight last:cuadra-mb-0 font-brand",e),...r}),h2:({className:e,...r})=>u.jsx("h2",{className:$("cuadra-mb-4 cuadra-mt-6 cuadra-scroll-m-20 cuadra-text-xl cuadra-font-normal cuadra-tracking-tight first:cuadra-mt-0 last:cuadra-mb-0 font-brand",e),...r}),h3:({className:e,...r})=>u.jsx("h3",{className:$("cuadra-mb-3 cuadra-mt-5 cuadra-scroll-m-20 cuadra-text-lg cuadra-font-normal cuadra-tracking-tight first:cuadra-mt-0 last:cuadra-mb-0 font-brand",e),...r}),h4:({className:e,...r})=>u.jsx("h4",{className:$("cuadra-mb-4 cuadra-mt-6 cuadra-scroll-m-20 cuadra-text-xl cuadra-font-normal cuadra-tracking-tight first:cuadra-mt-0 last:cuadra-mb-0 font-brand",e),...r}),h5:({className:e,...r})=>u.jsx("h5",{className:$("cuadra-my-4 cuadra-text-lg cuadra-font-normal first:cuadra-mt-0 last:cuadra-mb-0 font-brand",e),...r}),h6:({className:e,...r})=>u.jsx("h6",{className:$("cuadra-my-4 cuadra-font-normal first:cuadra-mb-0 font-brand",e),...r}),p:({className:e,...r})=>u.jsx("p",{className:$("cuadra-mb-5 cuadra-mt-5 cuadra-leading-7 first:cuadra-mt-0 last:cuadra-mb-0 font-brand",e),...r}),a:({className:e,...r})=>u.jsx("a",{className:$("cuadra-text-primary cuadra-font-medium cuadra-underline cuadra-underline-offset-4 font-brand",e),...r}),blockquote:({className:e,...r})=>u.jsx("blockquote",{className:$("cuadra-border-l-2 cuadra-pl-6 cuadra-italic font-brand",e),...r}),ul:({className:e,...r})=>u.jsx("ul",{className:$("cuadra-my-5 cuadra-ml-6 cuadra-list-disc [&>li]:cuadra-mt-2 font-brand",e),...r}),ol:({className:e,...r})=>u.jsx("ol",{className:$("cuadra-my-5 cuadra-ml-6 cuadra-list-decimal [&>li]:cuadra-mt-2 font-brand",e),...r}),hr:({className:e,...r})=>u.jsx("hr",{className:$("cuadra-my-5 cuadra-border-b",e),...r}),table:({className:e,...r})=>u.jsx("table",{className:$("cuadra-my-5 cuadra-w-full cuadra-border-separate cuadra-border-spacing-0 cuadra-overflow-y-auto font-brand",e),...r}),th:({className:e,...r})=>u.jsx("th",{className:$("cuadra-bg-muted cuadra-px-4 cuadra-py-2 cuadra-text-left cuadra-font-normal first:cuadra-rounded-tl-lg last:cuadra-rounded-tr-lg [&[align=center]]:cuadra-text-center [&[align=right]]:cuadra-text-right font-brand",e),...r}),td:({className:e,...r})=>u.jsx("td",{className:$("cuadra-border-b cuadra-border-l cuadra-px-4 cuadra-py-2 cuadra-text-left last:cuadra-border-r [&[align=center]]:cuadra-text-center [&[align=right]]:cuadra-text-right font-brand",e),...r}),tr:({className:e,...r})=>u.jsx("tr",{className:$("cuadra-m-0 cuadra-border-b cuadra-p-0 first:cuadra-border-t [&:last-child>td:first-child]:cuadra-rounded-bl-lg [&:last-child>td:last-child]:cuadra-rounded-br-lg",e),...r}),sup:({className:e,...r})=>u.jsx("sup",{className:$("[&>a]:cuadra-text-xs [&>a]:cuadra-no-underline font-brand",e),...r}),pre:({className:e,...r})=>u.jsx("pre",{className:$("cuadra-overflow-x-auto cuadra-rounded-b-lg !cuadra-rounded-t-none cuadra-bg-muted cuadra-p-4 cuadra-text-foreground font-brand",e),...r}),code:function({className:r,...t}){const a=He.useIsMarkdownCodeBlock();return u.jsx("code",{className:$(!a&&"cuadra-bg-muted cuadra-rounded cuadra-border cuadra-font-normal font-brand",r),...t})},CodeHeader:Li});function rt({className:e="",variant:r="default",...t}){const a="cuadra-inline-flex cuadra-items-center cuadra-rounded-md cuadra-px-3 cuadra-py-1.5 cuadra-text-xs cuadra-font-medium font-brand",i={default:"cuadra-border cuadra-border-border cuadra-bg-muted cuadra-text-muted-foreground",subtle:"cuadra-border cuadra-border-border/50 cuadra-bg-muted/50 cuadra-text-muted-foreground",outline:"cuadra-border cuadra-border-border cuadra-bg-background cuadra-text-foreground",ghost:"cuadra-text-muted-foreground"};return u.jsx("div",{className:`${a} ${i[r]||i.default} ${e}`,...t})}function _i(e){const r=new Map;for(const t of e){const a=r.get(t.filename);(!a||t.score>a.score)&&r.set(t.filename,t)}return Array.from(r.values()).sort((t,a)=>a.score-t.score)}function cr({sources:e,maxVisible:r=3}){if(!e||e.length===0)return null;const t=_i(e),a=t.slice(0,r),i=t.length-r;return u.jsxs("div",{className:"cuadra-mt-4 cuadra-pt-3 cuadra-border-t cuadra-border-border",children:[u.jsxs("div",{className:"cuadra-flex cuadra-items-center cuadra-gap-1.5 cuadra-mb-2.5",children:[u.jsx(St,{className:"cuadra-h-3.5 cuadra-w-3.5 cuadra-text-muted-foreground"}),u.jsx("span",{className:"cuadra-text-xs cuadra-font-medium cuadra-text-muted-foreground font-brand",children:"Sources"})]}),u.jsxs("div",{className:"cuadra-flex cuadra-flex-wrap cuadra-gap-2",children:[a.map((o,n)=>u.jsx(zi,{source:o},o.sourceId||n)),i>0&&u.jsxs(rt,{variant:"subtle",children:["+",i," more"]})]})]})}function Fi(e){switch(e.split(".").pop()?.toLowerCase()){case"csv":case"xlsx":case"xls":return Fr;case"md":case"txt":return Or;default:return St}}function zi({source:e}){const{filename:r,score:t}=e,a=Fi(r);return u.jsxs(rt,{className:"cuadra-gap-2 cuadra-cursor-default",title:t<1?`${Math.round(t*100)}% relevant`:void 0,children:[u.jsx(a,{className:"cuadra-h-3.5 cuadra-w-3.5 cuadra-shrink-0 cuadra-opacity-60"}),u.jsx("span",{className:"cuadra-truncate cuadra-max-w-[180px]",children:r}),t<1&&t>0&&u.jsxs("span",{className:"cuadra-opacity-50 cuadra-text-[10px] cuadra-tabular-nums",children:[Math.round(t*100),"%"]})]})}const jt=y.forwardRef(function({welcomeTitle:r="Hi, how can I help you today?",welcomeSubtitle:t="Start exploring our platform and discover what you can build.",extraTopPadding:a,suggestions:i,inputPlaceholder:o="Type your message...",enableAttachments:n=!1,preMadeResponseDelay:c=1e3,streamingSpeed:s=50},l){const f=M.useThreadRuntime(),d=M.useAssistantApi(),[p,g]=y.useState(!1),[m,k]=y.useState(null),[x,b]=y.useState(!1),w=y.useCallback((C,L,D)=>{if(!x)try{const A=D?.streamingSpeed??s,h=D?.delay??c;Rt(C,L,A,h),d.composer().setText(C),setTimeout(()=>{d.composer().send()},10)}catch{}},[x,s,c,d]),v=y.useCallback(C=>{try{d.composer().setText(C),setTimeout(()=>{d.composer().send()},10)}catch{}},[d]),R=y.useCallback(async C=>{if(!(x||!f))try{if(C.response){const L=C.responseDelay??c;await w(C.prompt,C.response,{delay:L,streamingSpeed:s})}else v(C.prompt)}catch{}},[f,x,c,s,w,v]),I=y.useCallback(()=>{try{const C=window.__cuadraThreadListRuntime;C?.switchToNewThread&&C.switchToNewThread()}catch{}},[]);return y.useImperativeHandle(l,()=>({sendMessage:v,sendPreMadeQA:w,clearChat:I}),[v,w,I]),y.useEffect(()=>{if(!f){g(!1);return}try{const C=f?.store;if(!C){g(!1);return}const L=C.subscribe?.(A=>{const h=A?.threadId,U=A?.messages||[],F=A?.isLoadingHistory||!1,V=U.length;h&&h!==m&&k(h),g(F&&V===0)}),D=C.getState?.();if(D){const A=D?.threadId,h=D?.messages||[],U=D?.isLoadingHistory||!1,F=h.length;A&&A!==m&&k(A),g(U&&F===0)}return()=>{L&&L()}}catch{g(!1)}},[f,m]),u.jsxs(M.ThreadPrimitive.Root,{className:"cuadra-bg-inherit cuadra-flex cuadra-flex-col cuadra-w-full cuadra-h-full",children:[u.jsx(M.ThreadPrimitive.Viewport,{className:"cuadra-w-full cuadra-bg-inherit cuadra-px-4 cuadra-flex-1 cuadra-min-h-0 cuadra-overflow-y-auto cuadra-relative scrollbar-thin cuadra-pt-4",style:a?{paddingTop:a}:void 0,children:p?u.jsx("div",{className:"cuadra-absolute cuadra-inset-0 cuadra-flex cuadra-items-center cuadra-justify-center",children:u.jsxs("div",{className:"cuadra-flex cuadra-flex-col cuadra-items-center cuadra-gap-2",children:[u.jsx(It,{className:"cuadra-h-6 cuadra-w-6 cuadra-animate-spin cuadra-text-muted-foreground"}),u.jsx("p",{className:"cuadra-text-sm cuadra-text-muted-foreground font-brand",children:"Loading messages..."})]})}):u.jsxs(u.Fragment,{children:[u.jsx(M.ThreadPrimitive.Empty,{children:u.jsx($i,{title:r,subtitle:t,suggestions:i,onSuggestionClick:R,isProcessing:x})}),u.jsx(M.ThreadPrimitive.Messages,{components:{UserMessage:Oi,AssistantMessage:Wi}})]})}),u.jsxs("div",{className:"cuadra-w-full cuadra-mt-3 cuadra-border-t cuadra-border-border cuadra-pt-4",children:[n&&u.jsx(M.ComposerPrimitive.Attachments,{components:{Attachment:()=>{const C=M.useAssistantState(({attachment:L})=>L);return C?u.jsxs("div",{className:"cuadra-relative cuadra-inline-flex cuadra-items-center cuadra-gap-2 cuadra-mb-2 cuadra-px-2 cuadra-py-1 cuadra-rounded-md cuadra-bg-muted cuadra-border cuadra-border-border",children:[u.jsx("span",{className:"cuadra-text-xs cuadra-text-muted-foreground font-brand",children:C.name||"Attachment"}),u.jsx(M.AttachmentPrimitive.Remove,{asChild:!0,children:u.jsx("button",{type:"button",className:"cuadra-flex cuadra-items-center cuadra-justify-center cuadra-size-4 cuadra-rounded hover:cuadra-bg-background cuadra-transition-colors","aria-label":"Remove attachment",children:u.jsx(Ge,{className:"cuadra-h-3 cuadra-w-3 cuadra-text-muted-foreground"})})})]}):null}}}),u.jsxs(M.ComposerPrimitive.Root,{className:"cuadra-relative !cuadra-relative cuadra-flex-1 cuadra-w-full",children:[u.jsx(M.ComposerPrimitive.Input,{asChild:!0,children:u.jsx("textarea",{rows:3,placeholder:o,className:"cuadra-flex cuadra-min-h-[80px] cuadra-w-full cuadra-rounded-md cuadra-border cuadra-border-border cuadra-bg-background cuadra-px-3 cuadra-py-2 cuadra-text-base cuadra-text-foreground placeholder:cuadra-text-muted-foreground focus-visible:cuadra-outline-none disabled:cuadra-cursor-not-allowed disabled:cuadra-opacity-50 cuadra-resize-none font-brand",style:{paddingRight:n?"5rem":"3rem",fontSize:"1rem",borderWidth:"1px"}})}),n&&u.jsx(M.ComposerPrimitive.AddAttachment,{multiple:!0,asChild:!0,children:u.jsx("button",{type:"button",className:"!cuadra-absolute !cuadra-bottom-2 !cuadra-right-12 cuadra-size-8 cuadra-rounded-md hover:cuadra-bg-muted cuadra-transition-colors cuadra-flex cuadra-items-center cuadra-justify-center cuadra-border cuadra-border-border",style:{position:"absolute",bottom:"0.5rem",right:"3rem"},"aria-label":"Attach file",children:u.jsx(Nt,{className:"cuadra-h-4 cuadra-w-4 cuadra-text-muted-foreground",strokeWidth:1.5})})}),u.jsx(M.ComposerPrimitive.Send,{asChild:!0,children:u.jsx("button",{className:"!cuadra-absolute !cuadra-bottom-2 !cuadra-right-2 cuadra-size-8 cuadra-rounded-md cuadra-shadow-sm hover:cuadra-opacity-90 disabled:cuadra-opacity-50 disabled:cuadra-cursor-not-allowed cuadra-flex cuadra-items-center cuadra-justify-center",style:{position:"absolute",bottom:"0.5rem",right:"0.5rem",backgroundColor:"var(--cuadra-primary)",color:"hsl(var(--cuadra-primary-foreground))"},"aria-label":"Send message",type:"button",children:u.jsx(Mr,{className:"cuadra-h-4 cuadra-w-4"})})})]})]})]})});function $i({title:e,subtitle:r,suggestions:t,onSuggestionClick:a,isProcessing:i}){return u.jsx("div",{className:"cuadra-flex cuadra-flex-col cuadra-items-center cuadra-h-full cuadra-py-12 cuadra-px-4 cuadra-overflow-y-auto scrollbar-hide",children:u.jsxs("div",{className:"cuadra-text-center cuadra-max-w-3xl cuadra-w-full cuadra-flex cuadra-flex-col cuadra-items-center cuadra-justify-center cuadra-min-h-full",children:[u.jsxs("div",{className:"cuadra-flex cuadra-flex-col cuadra-items-center cuadra-justify-center cuadra-mb-8",children:[u.jsx("h2",{className:"cuadra-text-lg cuadra-font-normal cuadra-text-foreground cuadra-mb-2 font-brand",children:e}),u.jsx("p",{className:"cuadra-text-muted-foreground font-brand",children:r})]}),t&&t.length>0&&u.jsx("div",{className:"cuadra-grid cuadra-grid-cols-2 cuadra-gap-2 cuadra-pb-4 cuadra-w-full cuadra-max-w-2xl",children:t.map((o,n)=>u.jsx("button",{type:"button",onClick:()=>a(o),disabled:i,className:"cuadra-w-full cuadra-text-center cuadra-px-4 cuadra-py-3 cuadra-rounded-lg cuadra-border cuadra-border-border cuadra-bg-background cuadra-text-sm cuadra-text-foreground font-brand cuadra-cursor-pointer focus:cuadra-outline-none focus:cuadra-ring-0 disabled:cuadra-opacity-50 disabled:cuadra-cursor-not-allowed",style:{borderWidth:"1px"},children:o.prompt},`suggestion-${n}`))})]})})}function Oi(){return u.jsxs(M.MessagePrimitive.Root,{className:"cuadra-grid cuadra-w-full cuadra-auto-rows-auto cuadra-grid-cols-[minmax(72px,1fr)_auto] cuadra-gap-y-2 cuadra-py-3 [&:where(>*)]:cuadra-col-start-2",children:[u.jsx(M.MessagePrimitive.Attachments,{components:{Attachment:()=>{const e=M.useAssistantState(({attachment:o})=>o);if(!e)return null;const r=e.type==="image",t=e.file,a=e.content?.find(o=>o.type==="image"),i=t?URL.createObjectURL(t):a?.image;return u.jsx("div",{className:"cuadra-col-start-2 cuadra-row-start-1 cuadra-mb-2 cuadra-max-w-[calc(42rem*0.8)]",children:r&&i?u.jsx("img",{src:i,alt:e.name||"Attachment",className:"cuadra-rounded-lg cuadra-border cuadra-border-border cuadra-max-h-64 cuadra-max-w-full cuadra-object-contain",style:{borderWidth:"1px"}}):u.jsxs("div",{className:"cuadra-flex cuadra-items-center cuadra-gap-2 cuadra-rounded-lg cuadra-border cuadra-border-border cuadra-bg-muted cuadra-px-3 cuadra-py-2",children:[u.jsx(Nt,{className:"cuadra-h-4 cuadra-w-4 cuadra-text-muted-foreground"}),u.jsx("span",{className:"cuadra-text-sm cuadra-text-foreground font-brand",children:e.name||"Attachment"})]})})}}}),u.jsx("div",{className:"cuadra-bg-muted cuadra-text-foreground cuadra-col-start-2 cuadra-row-start-2 cuadra-max-w-[calc(42rem*0.8)] cuadra-break-words cuadra-rounded-3xl cuadra-border cuadra-border-border cuadra-px-5 cuadra-py-2.5 font-brand",style:{maxWidth:"calc(42rem * 0.8)",borderRadius:"1.5rem",backgroundColor:"var(--cuadra-muted)",color:"hsl(var(--cuadra-foreground))",paddingLeft:"1.25rem",paddingRight:"1.25rem",paddingTop:"0.625rem",paddingBottom:"0.625rem",wordBreak:"break-word",borderWidth:"1px"},children:u.jsx(M.MessagePrimitive.Parts,{components:{Text:({text:e})=>u.jsx(tt,{content:e||""})}})})]})}function Ui({text:e}){const[r,t]=y.useState(!1),a=M.useAssistantState(({message:i})=>i?.status?.type==="running");return e?a?u.jsx("div",{className:"cuadra-mb-3 cuadra-py-1",children:u.jsx("div",{className:"cuadra-text-sm cuadra-text-muted-foreground cuadra-leading-relaxed font-brand cuadra-animate-text-shimmer",children:e})}):u.jsxs("div",{className:"cuadra-mb-3",children:[u.jsxs("button",{type:"button",onClick:()=>t(!r),className:"cuadra-flex cuadra-items-center cuadra-gap-1.5 cuadra-py-1 cuadra-text-sm cuadra-text-muted-foreground hover:cuadra-text-foreground cuadra-transition-colors font-brand",children:[u.jsx(Ve,{className:`cuadra-h-3.5 cuadra-w-3.5 cuadra-shrink-0 cuadra-transition-transform cuadra-duration-200 ${r?"":"cuadra--rotate-90"}`}),u.jsx("span",{children:"Reasoning"})]}),u.jsx("div",{className:`cuadra-overflow-hidden cuadra-transition-all cuadra-duration-200 cuadra-ease-out ${r?"cuadra-max-h-[2000px] cuadra-opacity-100":"cuadra-max-h-0 cuadra-opacity-0"}`,children:u.jsx("div",{className:"cuadra-pl-5 cuadra-pt-2 cuadra-text-sm cuadra-text-muted-foreground cuadra-leading-relaxed font-brand",children:u.jsx(tt,{content:e})})})]}):null}function Bi(){return u.jsxs("div",{className:"cuadra-flex cuadra-items-center cuadra-gap-2 cuadra-text-muted-foreground cuadra-text-sm font-brand cuadra-py-2",children:[u.jsxs("div",{className:"cuadra-flex cuadra-items-center cuadra-gap-1",children:[u.jsx("span",{className:"cuadra-inline-block cuadra-w-1.5 cuadra-h-1.5 cuadra-bg-current cuadra-rounded-full cuadra-animate-bounce",style:{animationDelay:"0ms"}}),u.jsx("span",{className:"cuadra-inline-block cuadra-w-1.5 cuadra-h-1.5 cuadra-bg-current cuadra-rounded-full cuadra-animate-bounce",style:{animationDelay:"150ms"}}),u.jsx("span",{className:"cuadra-inline-block cuadra-w-1.5 cuadra-h-1.5 cuadra-bg-current cuadra-rounded-full cuadra-animate-bounce",style:{animationDelay:"300ms"}})]}),u.jsx("span",{children:"Thinking..."})]})}function Wi(){const[e]=y.useState(()=>J.getCurrentMessageId()),r=M.useAssistantState(({message:i})=>i?.status?.type==="running"),t=M.useAssistantState(({message:i})=>{const o=i?.content;return!o||!Array.isArray(o)?!1:o.some(n=>!!(n.type==="text"&&n.text&&n.text.length>0||n.type==="reasoning"&&n.text&&n.text.length>0))}),a=y.useSyncExternalStore(i=>J.subscribe(i),()=>{if(e){const o=J.getForMessage(e);return o.sources?.length?o.sources:null}const i=J.getCurrentMessageId();if(i){const o=J.getForMessage(i);return o.sources?.length?o.sources:null}return null},()=>null);return u.jsx(M.MessagePrimitive.Root,{className:"cuadra-relative cuadra-grid cuadra-w-full cuadra-grid-cols-[auto_auto_1fr] cuadra-grid-rows-[auto_1fr] cuadra-py-3",children:u.jsxs("div",{className:"cuadra-text-foreground cuadra-col-span-2 cuadra-col-start-2 cuadra-row-start-1 cuadra-my-1.5 cuadra-max-w-[90%] cuadra-break-words cuadra-leading-7 font-brand",style:{maxWidth:"90%",marginTop:"0.375rem",marginBottom:"0.375rem"},children:[u.jsx(M.MessagePrimitive.Parts,{components:{Text:({text:i})=>u.jsx(tt,{content:i||""}),Reasoning:({text:i})=>u.jsx(Ui,{text:i||""})}}),r&&!t&&u.jsx(Bi,{}),a&&a.length>0&&u.jsx(cr,{sources:a})]})})}const ur=({className:e="",theme:r="system"})=>{const t=()=>{if(typeof window>"u")return"light";if(r==="system"){const n=localStorage.getItem("theme");return n||(window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light")}return r},[a,i]=y.useState(t);y.useEffect(()=>{r!=="system"&&i(r)},[r]),y.useEffect(()=>{const n=document.documentElement;n.classList.remove("light","dark"),n.classList.add(a),r==="system"&&localStorage.setItem("theme",a)},[a,r]);const o=()=>{r==="system"&&i(n=>n==="light"?"dark":"light")};return u.jsx("button",{type:"button","aria-label":"Toggle theme",onClick:o,disabled:r!=="system",className:`cuadra-flex cuadra-items-center cuadra-justify-center cuadra-h-8 cuadra-w-8 cuadra-rounded-full cuadra-bg-muted hover:cuadra-bg-muted/80 cuadra-transition-colors disabled:cuadra-opacity-50 disabled:cuadra-cursor-not-allowed ${e}`,children:u.jsx(Pr,{className:`cuadra-h-4 cuadra-w-4 cuadra-transition-colors ${a==="dark"?"cuadra-text-primary":"cuadra-text-gray-400"}`})})};function qi({onThreadSelect:e}){const r=M.useThreadListItem(),t=M.useThread(x=>x.threadId),[a,i]=y.useState(null),o=r?.id===t,n=a===r?.id,[c,s]=y.useState(!1),[l,f]=y.useState(r?.title||""),[d,p]=y.useState(!1),[g,m]=y.useState(!1),k=async()=>{if(!r?.remoteId||!l||l===r.title){s(!1);return}try{m(!0);const x=window.__cuadraThreadListAdapter;x&&typeof x.rename=="function"&&await x.rename(r.remoteId,l),s(!1),p(!1)}catch{s(!1),p(!1)}finally{m(!1)}};return y.useEffect(()=>{r?.title&&!c&&f(r.title)},[r?.title,c]),r?u.jsxs(M.ThreadListItemPrimitive.Root,{className:`group cuadra-relative cuadra-flex cuadra-items-center cuadra-rounded-lg cuadra-transition-colors cuadra-cursor-pointer cuadra-border cuadra-mb-2 ${o?"cuadra-bg-muted cuadra-border-border":"cuadra-border-transparent hover:cuadra-bg-muted hover:cuadra-border-border"}`,style:{marginBottom:"0.5rem"},onMouseEnter:()=>i(r.id),onMouseLeave:()=>i(null),children:[u.jsx(M.ThreadListItemPrimitive.Trigger,{className:"cuadra-p-3 cuadra-flex-1 cuadra-flex cuadra-items-center cuadra-min-w-0 cuadra-cursor-pointer",onClick:()=>e?.(),children:u.jsx("div",{className:"cuadra-flex cuadra-flex-col cuadra-min-w-0 cuadra-flex-1 cuadra-items-start cuadra-text-left",children:c?u.jsx("input",{className:"cuadra-flex cuadra-w-full cuadra-rounded-md cuadra-border cuadra-border-input cuadra-bg-background cuadra-px-3 cuadra-py-2 cuadra-text-sm placeholder:cuadra-text-muted-foreground focus-visible:cuadra-outline-none disabled:cuadra-cursor-not-allowed disabled:cuadra-opacity-50 font-brand",value:l,onChange:x=>f(x.target.value),onKeyDown:x=>{x.key==="Enter"&&k(),x.key==="Escape"&&(s(!1),f(r.title||""))},disabled:g,autoFocus:!0,onClick:x=>x.stopPropagation()}):u.jsxs(u.Fragment,{children:[u.jsx("span",{className:"cuadra-text-sm cuadra-font-normal cuadra-text-foreground cuadra-truncate font-brand",children:(r.title?.length||0)>60?`${r.title?.slice(0,60)}…`:r.title||"Chat"}),r.updatedAt&&u.jsx("span",{className:"cuadra-text-xs cuadra-text-muted-foreground cuadra-mt-1 font-brand",children:new Date(r.updatedAt).toLocaleDateString()})]})})}),u.jsx("div",{className:"cuadra-mr-2 cuadra-flex-shrink-0 cuadra-w-6 cuadra-h-6 cuadra-flex cuadra-items-center cuadra-justify-center",children:(n||o||d)&&u.jsxs("div",{className:"cuadra-relative",children:[u.jsx("button",{type:"button",className:"cuadra-p-1 cuadra-rounded hover:cuadra-bg-background/50 cuadra-transition-colors",onClick:x=>{x.stopPropagation(),p(!d)},"aria-label":"Thread options",children:u.jsx(Dr,{className:"cuadra-h-4 cuadra-w-4 cuadra-text-muted-foreground"})}),d&&u.jsxs(u.Fragment,{children:[u.jsx("div",{className:"cuadra-fixed cuadra-inset-0 cuadra-z-40",onClick:()=>p(!1)}),u.jsx("div",{className:"cuadra-absolute cuadra-right-0 cuadra-top-8 cuadra-z-50 cuadra-bg-background cuadra-border cuadra-border-border cuadra-rounded-lg cuadra-shadow-lg cuadra-min-w-[120px] cuadra-overflow-hidden",children:c?u.jsx("button",{type:"button",className:"cuadra-w-full cuadra-px-3 cuadra-py-2 cuadra-text-sm cuadra-text-left hover:cuadra-bg-muted cuadra-transition-colors font-brand",onClick:x=>{x.stopPropagation(),k()},disabled:g,children:"Save"}):u.jsxs(u.Fragment,{children:[u.jsx("button",{type:"button",className:"cuadra-w-full cuadra-px-3 cuadra-py-2 cuadra-text-sm cuadra-text-left hover:cuadra-bg-muted cuadra-transition-colors font-brand",onClick:x=>{x.stopPropagation(),s(!0),f(r.title||""),p(!1)},children:"Rename"}),u.jsx("div",{className:"cuadra-border-t cuadra-border-border"}),u.jsx(M.ThreadListItemPrimitive.Delete,{asChild:!0,children:u.jsx("button",{type:"button",className:"cuadra-w-full cuadra-px-3 cuadra-py-2 cuadra-text-sm cuadra-text-left cuadra-text-destructive hover:cuadra-bg-muted cuadra-transition-colors font-brand",onClick:x=>{x.stopPropagation(),p(!1)},children:"Delete"})})]})})]})]})})]}):null}function Tt({onThreadSelect:e,showThemeToggle:r,theme:t,onLogout:a}){return u.jsxs(M.ThreadListPrimitive.Root,{className:"!cuadra-border-r cuadra-border-border cuadra-flex cuadra-flex-col cuadra-bg-background cuadra-transition-all cuadra-duration-300 cuadra-ease-in-out cuadra-h-full cuadra-w-80",style:{borderRightWidth:"1px"},children:[u.jsx("div",{className:"cuadra-border-b cuadra-border-border cuadra-flex cuadra-items-center cuadra-justify-end cuadra-transition-all cuadra-duration-300 cuadra-h-16 cuadra-px-4",children:u.jsx("button",{type:"button",onClick:e,className:"cuadra-flex md:cuadra-hidden cuadra-items-center cuadra-justify-center cuadra-h-8 cuadra-w-8 cuadra-rounded-full cuadra-bg-muted hover:cuadra-bg-muted/80 cuadra-transition-colors","aria-label":"Close",children:u.jsx(Ge,{className:"cuadra-h-4 cuadra-w-4 cuadra-text-foreground"})})}),u.jsxs("div",{className:"cuadra-flex-1 cuadra-overflow-y-auto cuadra-p-2 scrollbar-thin",children:[u.jsx(M.ThreadListPrimitive.New,{className:"group cuadra-relative cuadra-flex cuadra-items-center cuadra-gap-3 cuadra-p-3 cuadra-rounded-lg cuadra-cursor-pointer cuadra-transition-colors cuadra-border cuadra-border-transparent hover:cuadra-bg-muted hover:cuadra-border-border",onClick:()=>e?.(),children:u.jsx("div",{className:"cuadra-flex-1 cuadra-min-w-0",children:u.jsxs("div",{className:"cuadra-flex cuadra-items-center cuadra-gap-2",children:[u.jsx(Kr,{className:"cuadra-h-4 cuadra-w-4 cuadra-text-muted-foreground"}),u.jsx("h4",{className:"cuadra-text-sm cuadra-font-normal cuadra-text-foreground font-brand",children:"New Chat"})]})})}),u.jsx("div",{className:"cuadra-my-2 cuadra-border-t cuadra-border-border"}),u.jsx(M.ThreadListPrimitive.Items,{components:{ThreadListItem:i=>u.jsx(qi,{...i,onThreadSelect:e})}})]}),(r||a)&&u.jsxs("div",{className:"cuadra-border-t cuadra-border-border cuadra-flex md:cuadra-hidden cuadra-items-center cuadra-justify-between cuadra-px-4 cuadra-py-4",children:[a&&u.jsx("button",{type:"button",onClick:a,className:"cuadra-flex cuadra-items-center cuadra-justify-center cuadra-h-8 cuadra-w-8 cuadra-rounded-full cuadra-bg-muted hover:cuadra-bg-muted/80 cuadra-transition-colors","aria-label":"Logout",children:u.jsx(Wr,{className:"cuadra-h-4 cuadra-w-4 cuadra-text-foreground"})}),r&&u.jsx(ur,{theme:t})]})]})}const Hi=`
13
+ `});return c(),d(),f+`
14
+ `+(a===1?"=":"-").repeat(f.length-(Math.max(f.lastIndexOf("\r"),f.lastIndexOf(`
15
+ `))+1))}const o="#".repeat(a),s=r.enter("headingAtx"),l=r.enter("phrasing");i.move(o+" ");let u=r.containerPhrasing(e,{before:"# ",after:`
16
+ `,...i.current()});return/^[\t ]/.test(u)&&(u=Qo(u.charCodeAt(0))+u.slice(1)),u=u?o+" "+u:o,r.options.closeAtx&&(u+=" "+o),l(),s(),u}Kg.peek=f0;function Kg(e){return e.value||""}function f0(){return"<"}Jg.peek=p0;function Jg(e,t,r,n){const a=Ru(r),i=a==='"'?"Quote":"Apostrophe",o=r.enter("image");let s=r.enter("label");const l=r.createTracker(n);let u=l.move("![");return u+=l.move(r.safe(e.alt,{before:u,after:"]",...l.current()})),u+=l.move("]("),s(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(s=r.enter("destinationLiteral"),u+=l.move("<"),u+=l.move(r.safe(e.url,{before:u,after:">",...l.current()})),u+=l.move(">")):(s=r.enter("destinationRaw"),u+=l.move(r.safe(e.url,{before:u,after:e.title?" ":")",...l.current()}))),s(),e.title&&(s=r.enter(`title${i}`),u+=l.move(" "+a),u+=l.move(r.safe(e.title,{before:u,after:a,...l.current()})),u+=l.move(a),s()),u+=l.move(")"),o(),u}function p0(){return"!"}Xg.peek=m0;function Xg(e,t,r,n){const a=e.referenceType,i=r.enter("imageReference");let o=r.enter("label");const s=r.createTracker(n);let l=s.move("![");const u=r.safe(e.alt,{before:l,after:"]",...s.current()});l+=s.move(u+"]["),o();const d=r.stack;r.stack=[],o=r.enter("reference");const c=r.safe(r.associationId(e),{before:l,after:"]",...s.current()});return o(),r.stack=d,i(),a==="full"||!u||u!==c?l+=s.move(c+"]"):a==="shortcut"?l=l.slice(0,-1):l+=s.move("]"),l}function m0(){return"!"}Yg.peek=h0;function Yg(e,t,r){let n=e.value||"",a="`",i=-1;for(;new RegExp("(^|[^`])"+a+"([^`]|$)").test(n);)a+="`";for(/[^ \r\n]/.test(n)&&(/^[ \r\n]/.test(n)&&/[ \r\n]$/.test(n)||/^`|`$/.test(n))&&(n=" "+n+" ");++i<r.unsafe.length;){const o=r.unsafe[i],s=r.compilePattern(o);let l;if(o.atBreak)for(;l=s.exec(n);){let u=l.index;n.charCodeAt(u)===10&&n.charCodeAt(u-1)===13&&u--,n=n.slice(0,u)+" "+n.slice(l.index+1)}}return a+n+a}function h0(){return"`"}function Qg(e,t){const r=Hg(e);return!!(!t.options.resourceLink&&e.url&&!e.title&&e.children&&e.children.length===1&&e.children[0].type==="text"&&(r===e.url||"mailto:"+r===e.url)&&/^[a-z][a-z+.-]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}Zg.peek=g0;function Zg(e,t,r,n){const a=Ru(r),i=a==='"'?"Quote":"Apostrophe",o=r.createTracker(n);let s,l;if(Qg(e,r)){const d=r.stack;r.stack=[],s=r.enter("autolink");let c=o.move("<");return c+=o.move(r.containerPhrasing(e,{before:c,after:">",...o.current()})),c+=o.move(">"),s(),r.stack=d,c}s=r.enter("link"),l=r.enter("label");let u=o.move("[");return u+=o.move(r.containerPhrasing(e,{before:u,after:"](",...o.current()})),u+=o.move("]("),l(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(l=r.enter("destinationLiteral"),u+=o.move("<"),u+=o.move(r.safe(e.url,{before:u,after:">",...o.current()})),u+=o.move(">")):(l=r.enter("destinationRaw"),u+=o.move(r.safe(e.url,{before:u,after:e.title?" ":")",...o.current()}))),l(),e.title&&(l=r.enter(`title${i}`),u+=o.move(" "+a),u+=o.move(r.safe(e.title,{before:u,after:a,...o.current()})),u+=o.move(a),l()),u+=o.move(")"),s(),u}function g0(e,t,r){return Qg(e,r)?"<":"["}eb.peek=b0;function eb(e,t,r,n){const a=e.referenceType,i=r.enter("linkReference");let o=r.enter("label");const s=r.createTracker(n);let l=s.move("[");const u=r.containerPhrasing(e,{before:l,after:"]",...s.current()});l+=s.move(u+"]["),o();const d=r.stack;r.stack=[],o=r.enter("reference");const c=r.safe(r.associationId(e),{before:l,after:"]",...s.current()});return o(),r.stack=d,i(),a==="full"||!u||u!==c?l+=s.move(c+"]"):a==="shortcut"?l=l.slice(0,-1):l+=s.move("]"),l}function b0(){return"["}function Cu(e){const t=e.options.bullet||"*";if(t!=="*"&&t!=="+"&&t!=="-")throw new Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function y0(e){const t=Cu(e),r=e.options.bulletOther;if(!r)return t==="*"?"-":"*";if(r!=="*"&&r!=="+"&&r!=="-")throw new Error("Cannot serialize items with `"+r+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(r===t)throw new Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+r+"`) to be different");return r}function v0(e){const t=e.options.bulletOrdered||".";if(t!=="."&&t!==")")throw new Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function tb(e){const t=e.options.rule||"*";if(t!=="*"&&t!=="-"&&t!=="_")throw new Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function w0(e,t,r,n){const a=r.enter("list"),i=r.bulletCurrent;let o=e.ordered?v0(r):Cu(r);const s=e.ordered?o==="."?")":".":y0(r);let l=t&&r.bulletLastUsed?o===r.bulletLastUsed:!1;if(!e.ordered){const d=e.children?e.children[0]:void 0;if((o==="*"||o==="-")&&d&&(!d.children||!d.children[0])&&r.stack[r.stack.length-1]==="list"&&r.stack[r.stack.length-2]==="listItem"&&r.stack[r.stack.length-3]==="list"&&r.stack[r.stack.length-4]==="listItem"&&r.indexStack[r.indexStack.length-1]===0&&r.indexStack[r.indexStack.length-2]===0&&r.indexStack[r.indexStack.length-3]===0&&(l=!0),tb(r)===o&&d){let c=-1;for(;++c<e.children.length;){const f=e.children[c];if(f&&f.type==="listItem"&&f.children&&f.children[0]&&f.children[0].type==="thematicBreak"){l=!0;break}}}}l&&(o=s),r.bulletCurrent=o;const u=r.containerFlow(e,n);return r.bulletLastUsed=o,r.bulletCurrent=i,a(),u}function x0(e){const t=e.options.listItemIndent||"one";if(t!=="tab"&&t!=="one"&&t!=="mixed")throw new Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}function R0(e,t,r,n){const a=x0(r);let i=r.bulletCurrent||Cu(r);t&&t.type==="list"&&t.ordered&&(i=(typeof t.start=="number"&&t.start>-1?t.start:1)+(r.options.incrementListMarker===!1?0:t.children.indexOf(e))+i);let o=i.length+1;(a==="tab"||a==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(o=Math.ceil(o/4)*4);const s=r.createTracker(n);s.move(i+" ".repeat(o-i.length)),s.shift(o);const l=r.enter("listItem"),u=r.indentLines(r.containerFlow(e,s.current()),d);return l(),u;function d(c,f,p){return f?(p?"":" ".repeat(o))+c:(p?i:i+" ".repeat(o-i.length))+c}}function C0(e,t,r,n){const a=r.enter("paragraph"),i=r.enter("phrasing"),o=r.containerPhrasing(e,n);return i(),a(),o}const E0=us(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function T0(e,t,r,n){return(e.children.some(function(o){return E0(o)})?r.containerPhrasing:r.containerFlow).call(r,e,n)}function S0(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}rb.peek=_0;function rb(e,t,r,n){const a=S0(r),i=r.enter("strong"),o=r.createTracker(n),s=o.move(a+a);let l=o.move(r.containerPhrasing(e,{after:a,before:s,...o.current()}));const u=l.charCodeAt(0),d=zi(n.before.charCodeAt(n.before.length-1),u,a);d.inside&&(l=Qo(u)+l.slice(1));const c=l.charCodeAt(l.length-1),f=zi(n.after.charCodeAt(0),c,a);f.inside&&(l=l.slice(0,-1)+Qo(c));const p=o.move(a+a);return i(),r.attentionEncodeSurroundingInfo={after:f.outside,before:d.outside},s+l+p}function _0(e,t,r){return r.options.strong||"*"}function P0(e,t,r,n){return r.safe(e.value,n)}function k0(e){const t=e.options.ruleRepetition||3;if(t<3)throw new Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function M0(e,t,r){const n=(tb(r)+(r.options.ruleSpaces?" ":"")).repeat(k0(r));return r.options.ruleSpaces?n.slice(0,-1):n}const nb={blockquote:Xx,break:Qc,code:r0,definition:a0,emphasis:Vg,hardBreak:Qc,heading:d0,html:Kg,image:Jg,imageReference:Xg,inlineCode:Yg,link:Zg,linkReference:eb,list:w0,listItem:R0,paragraph:C0,root:T0,strong:rb,text:P0,thematicBreak:M0};function A0(){return{enter:{table:q0,tableData:ed,tableHeader:ed,tableRow:O0},exit:{codeText:N0,table:I0,tableData:Is,tableHeader:Is,tableRow:Is}}}function q0(e){const t=e._align;this.enter({type:"table",align:t.map(function(r){return r==="none"?null:r}),children:[]},e),this.data.inTable=!0}function I0(e){this.exit(e),this.data.inTable=void 0}function O0(e){this.enter({type:"tableRow",children:[]},e)}function Is(e){this.exit(e)}function ed(e){this.enter({type:"tableCell",children:[]},e)}function N0(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,$0));const r=this.stack[this.stack.length-1];r.type,r.value=t,this.exit(e)}function $0(e,t){return t==="|"?t:e}function j0(e){const t=e||{},r=t.tableCellPadding,n=t.tablePipeAlign,a=t.stringLength,i=r?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
17
+ `,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:f,table:o,tableCell:l,tableRow:s}};function o(p,m,g,b){return u(d(p,g,b),p.align)}function s(p,m,g,b){const h=c(p,g,b),w=u([h]);return w.slice(0,w.indexOf(`
18
+ `))}function l(p,m,g,b){const h=g.enter("tableCell"),w=g.enter("phrasing"),x=g.containerPhrasing(p,{...b,before:i,after:i});return w(),h(),x}function u(p,m){return Kx(p,{align:m,alignDelimiters:n,padding:r,stringLength:a})}function d(p,m,g){const b=p.children;let h=-1;const w=[],x=m.enter("table");for(;++h<b.length;)w[h]=c(b[h],m,g);return x(),w}function c(p,m,g){const b=p.children;let h=-1;const w=[],x=m.enter("tableRow");for(;++h<b.length;)w[h]=l(b[h],p,m,g);return x(),w}function f(p,m,g){let b=nb.inlineCode(p,m,g);return g.stack.includes("tableCell")&&(b=b.replace(/\|/g,"\\$&")),b}}function D0(){return{exit:{taskListCheckValueChecked:td,taskListCheckValueUnchecked:td,paragraph:F0}}}function L0(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:B0}}}function td(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function F0(e){const t=this.stack[this.stack.length-2];if(t&&t.type==="listItem"&&typeof t.checked=="boolean"){const r=this.stack[this.stack.length-1];r.type;const n=r.children[0];if(n&&n.type==="text"){const a=t.children;let i=-1,o;for(;++i<a.length;){const s=a[i];if(s.type==="paragraph"){o=s;break}}o===r&&(n.value=n.value.slice(1),n.value.length===0?r.children.shift():r.position&&n.position&&typeof n.position.start.offset=="number"&&(n.position.start.column++,n.position.start.offset++,r.position.start=Object.assign({},n.position.start)))}}this.exit(e)}function B0(e,t,r,n){const a=e.children[0],i=typeof e.checked=="boolean"&&a&&a.type==="paragraph",o="["+(e.checked?"x":" ")+"] ",s=r.createTracker(n);i&&s.move(o);let l=nb.listItem(e,t,r,{...n,...s.current()});return i&&(l=l.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,u)),l;function u(d){return d+o}}function z0(){return[bx(),Dx(),zx(),A0(),D0()]}function U0(e){return{extensions:[yx(),Lx(e),Ux(),j0(e),L0()]}}function Mi(e,t,r,n){const a=e.length;let i=0,o;if(t<0?t=-t>a?0:a+t:t=t>a?a:t,r=r>0?r:0,n.length<1e4)o=Array.from(n),o.unshift(t,r),e.splice(...o);else for(r&&e.splice(t,r);i<n.length;)o=n.slice(i,i+1e4),o.unshift(t,0),e.splice(...o),i+=1e4,t+=1e4}const rd={}.hasOwnProperty;function W0(e){const t={};let r=-1;for(;++r<e.length;)V0(t,e[r]);return t}function V0(e,t){let r;for(r in t){const a=(rd.call(e,r)?e[r]:void 0)||(e[r]={}),i=t[r];let o;if(i)for(o in i){rd.call(a,o)||(a[o]=[]);const s=i[o];H0(a[o],Array.isArray(s)?s:s?[s]:[])}}}function H0(e,t){let r=-1;const n=[];for(;++r<t.length;)(t[r].add==="after"?e:n).push(t[r]);Mi(e,0,0,n)}const G0={tokenize:Z0,partial:!0},ab={tokenize:eR,partial:!0},ob={tokenize:tR,partial:!0},ib={tokenize:rR,partial:!0},K0={tokenize:nR,partial:!0},sb={name:"wwwAutolink",tokenize:Y0,previous:ub},lb={name:"protocolAutolink",tokenize:Q0,previous:cb},jt={name:"emailAutolink",tokenize:X0,previous:db},vt={};function J0(){return{text:vt}}let rr=48;for(;rr<123;)vt[rr]=jt,rr++,rr===58?rr=65:rr===91&&(rr=97);vt[43]=jt;vt[45]=jt;vt[46]=jt;vt[95]=jt;vt[72]=[jt,lb];vt[104]=[jt,lb];vt[87]=[jt,sb];vt[119]=[jt,sb];function X0(e,t,r){const n=this;let a,i;return o;function o(c){return!Ml(c)||!db.call(n,n.previous)||Eu(n.events)?r(c):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),s(c))}function s(c){return Ml(c)?(e.consume(c),s):c===64?(e.consume(c),l):r(c)}function l(c){return c===46?e.check(K0,d,u)(c):c===45||c===95||xu(c)?(i=!0,e.consume(c),l):d(c)}function u(c){return e.consume(c),a=!0,l}function d(c){return i&&a&&Yo(n.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(c)):r(c)}}function Y0(e,t,r){const n=this;return a;function a(o){return o!==87&&o!==119||!ub.call(n,n.previous)||Eu(n.events)?r(o):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(G0,e.attempt(ab,e.attempt(ob,i),r),r)(o))}function i(o){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(o)}}function Q0(e,t,r){const n=this;let a="",i=!1;return o;function o(c){return(c===72||c===104)&&cb.call(n,n.previous)&&!Eu(n.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),a+=String.fromCodePoint(c),e.consume(c),s):r(c)}function s(c){if(Yo(c)&&a.length<5)return a+=String.fromCodePoint(c),e.consume(c),s;if(c===58){const f=a.toLowerCase();if(f==="http"||f==="https")return e.consume(c),l}return r(c)}function l(c){return c===47?(e.consume(c),i?u:(i=!0,l)):r(c)}function u(c){return c===null||nx(c)||Qe(c)||pr(c)||ss(c)?r(c):e.attempt(ab,e.attempt(ob,d),r)(c)}function d(c){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(c)}}function Z0(e,t,r){let n=0;return a;function a(o){return(o===87||o===119)&&n<3?(n++,e.consume(o),a):o===46&&n===3?(e.consume(o),i):r(o)}function i(o){return o===null?r(o):t(o)}}function eR(e,t,r){let n,a,i;return o;function o(u){return u===46||u===95?e.check(ib,l,s)(u):u===null||Qe(u)||pr(u)||u!==45&&ss(u)?l(u):(i=!0,e.consume(u),o)}function s(u){return u===95?n=!0:(a=n,n=void 0),e.consume(u),o}function l(u){return a||n||!i?r(u):t(u)}}function tR(e,t){let r=0,n=0;return a;function a(o){return o===40?(r++,e.consume(o),a):o===41&&n<r?i(o):o===33||o===34||o===38||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===60||o===63||o===93||o===95||o===126?e.check(ib,t,i)(o):o===null||Qe(o)||pr(o)?t(o):(e.consume(o),a)}function i(o){return o===41&&n++,e.consume(o),a}}function rR(e,t,r){return n;function n(s){return s===33||s===34||s===39||s===41||s===42||s===44||s===46||s===58||s===59||s===63||s===95||s===126?(e.consume(s),n):s===38?(e.consume(s),i):s===93?(e.consume(s),a):s===60||s===null||Qe(s)||pr(s)?t(s):r(s)}function a(s){return s===null||s===40||s===91||Qe(s)||pr(s)?t(s):n(s)}function i(s){return Yo(s)?o(s):r(s)}function o(s){return s===59?(e.consume(s),n):Yo(s)?(e.consume(s),o):r(s)}}function nR(e,t,r){return n;function n(i){return e.consume(i),a}function a(i){return xu(i)?r(i):t(i)}}function ub(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||Qe(e)}function cb(e){return!Yo(e)}function db(e){return!(e===47||Ml(e))}function Ml(e){return e===43||e===45||e===46||e===95||xu(e)}function Eu(e){let t=e.length,r=!1;for(;t--;){const n=e[t][1];if((n.type==="labelLink"||n.type==="labelImage")&&!n._balanced){r=!0;break}if(n._gfmAutolinkLiteralWalkedInto){r=!1;break}}return e.length>0&&!r&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),r}function aR(e,t,r){const n=[];let a=-1;for(;++a<e.length;){const i=e[a].resolveAll;i&&!n.includes(i)&&(t=i(t,r),n.push(i))}return t}function qt(e,t,r,n){const a=n?n-1:Number.POSITIVE_INFINITY;let i=0;return o;function o(l){return At(l)?(e.enter(r),s(l)):t(l)}function s(l){return At(l)&&i++<a?(e.consume(l),s):(e.exit(r),t(l))}}const oR={partial:!0,tokenize:iR};function iR(e,t,r){return n;function n(i){return At(i)?qt(e,a,"linePrefix")(i):a(i)}function a(i){return i===null||Er(i)?t(i):r(i)}}const sR={tokenize:hR,partial:!0};function lR(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:fR,continuation:{tokenize:pR},exit:mR}},text:{91:{name:"gfmFootnoteCall",tokenize:dR},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:uR,resolveTo:cR}}}}function uR(e,t,r){const n=this;let a=n.events.length;const i=n.parser.gfmFootnotes||(n.parser.gfmFootnotes=[]);let o;for(;a--;){const l=n.events[a][1];if(l.type==="labelImage"){o=l;break}if(l.type==="gfmFootnoteCall"||l.type==="labelLink"||l.type==="label"||l.type==="image"||l.type==="link")break}return s;function s(l){if(!o||!o._balanced)return r(l);const u=ii(n.sliceSerialize({start:o.end,end:n.now()}));return u.codePointAt(0)!==94||!i.includes(u.slice(1))?r(l):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(l),e.exit("gfmFootnoteCallLabelMarker"),t(l))}}function cR(e,t){let r=e.length;for(;r--;)if(e[r][1].type==="labelImage"&&e[r][0]==="enter"){e[r][1];break}e[r+1][1].type="data",e[r+3][1].type="gfmFootnoteCallLabelMarker";const n={type:"gfmFootnoteCall",start:Object.assign({},e[r+3][1].start),end:Object.assign({},e[e.length-1][1].end)},a={type:"gfmFootnoteCallMarker",start:Object.assign({},e[r+3][1].end),end:Object.assign({},e[r+3][1].end)};a.end.column++,a.end.offset++,a.end._bufferIndex++;const i={type:"gfmFootnoteCallString",start:Object.assign({},a.end),end:Object.assign({},e[e.length-1][1].start)},o={type:"chunkString",contentType:"string",start:Object.assign({},i.start),end:Object.assign({},i.end)},s=[e[r+1],e[r+2],["enter",n,t],e[r+3],e[r+4],["enter",a,t],["exit",a,t],["enter",i,t],["enter",o,t],["exit",o,t],["exit",i,t],e[e.length-2],e[e.length-1],["exit",n,t]];return e.splice(r,e.length-r+1,...s),e}function dR(e,t,r){const n=this,a=n.parser.gfmFootnotes||(n.parser.gfmFootnotes=[]);let i=0,o;return s;function s(c){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(c),e.exit("gfmFootnoteCallLabelMarker"),l}function l(c){return c!==94?r(c):(e.enter("gfmFootnoteCallMarker"),e.consume(c),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",u)}function u(c){if(i>999||c===93&&!o||c===null||c===91||Qe(c))return r(c);if(c===93){e.exit("chunkString");const f=e.exit("gfmFootnoteCallString");return a.includes(ii(n.sliceSerialize(f)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(c),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):r(c)}return Qe(c)||(o=!0),i++,e.consume(c),c===92?d:u}function d(c){return c===91||c===92||c===93?(e.consume(c),i++,u):u(c)}}function fR(e,t,r){const n=this,a=n.parser.gfmFootnotes||(n.parser.gfmFootnotes=[]);let i,o=0,s;return l;function l(m){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(m),e.exit("gfmFootnoteDefinitionLabelMarker"),u}function u(m){return m===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(m),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",d):r(m)}function d(m){if(o>999||m===93&&!s||m===null||m===91||Qe(m))return r(m);if(m===93){e.exit("chunkString");const g=e.exit("gfmFootnoteDefinitionLabelString");return i=ii(n.sliceSerialize(g)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(m),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),f}return Qe(m)||(s=!0),o++,e.consume(m),m===92?c:d}function c(m){return m===91||m===92||m===93?(e.consume(m),o++,d):d(m)}function f(m){return m===58?(e.enter("definitionMarker"),e.consume(m),e.exit("definitionMarker"),a.includes(i)||a.push(i),qt(e,p,"gfmFootnoteDefinitionWhitespace")):r(m)}function p(m){return t(m)}}function pR(e,t,r){return e.check(oR,t,e.attempt(sR,t,r))}function mR(e){e.exit("gfmFootnoteDefinition")}function hR(e,t,r){const n=this;return qt(e,a,"gfmFootnoteDefinitionIndent",5);function a(i){const o=n.events[n.events.length-1];return o&&o[1].type==="gfmFootnoteDefinitionIndent"&&o[2].sliceSerialize(o[1],!0).length===4?t(i):r(i)}}function gR(e){let r=(e||{}).singleTilde;const n={name:"strikethrough",tokenize:i,resolveAll:a};return r==null&&(r=!0),{text:{126:n},insideSpan:{null:[n]},attentionMarkers:{null:[126]}};function a(o,s){let l=-1;for(;++l<o.length;)if(o[l][0]==="enter"&&o[l][1].type==="strikethroughSequenceTemporary"&&o[l][1]._close){let u=l;for(;u--;)if(o[u][0]==="exit"&&o[u][1].type==="strikethroughSequenceTemporary"&&o[u][1]._open&&o[l][1].end.offset-o[l][1].start.offset===o[u][1].end.offset-o[u][1].start.offset){o[l][1].type="strikethroughSequence",o[u][1].type="strikethroughSequence";const d={type:"strikethrough",start:Object.assign({},o[u][1].start),end:Object.assign({},o[l][1].end)},c={type:"strikethroughText",start:Object.assign({},o[u][1].end),end:Object.assign({},o[l][1].start)},f=[["enter",d,s],["enter",o[u][1],s],["exit",o[u][1],s],["enter",c,s]],p=s.parser.constructs.insideSpan.null;p&&Mi(f,f.length,0,aR(p,o.slice(u+1,l),s)),Mi(f,f.length,0,[["exit",c,s],["enter",o[l][1],s],["exit",o[l][1],s],["exit",d,s]]),Mi(o,u-1,l-u+3,f),l=u+f.length-2;break}}for(l=-1;++l<o.length;)o[l][1].type==="strikethroughSequenceTemporary"&&(o[l][1].type="data");return o}function i(o,s,l){const u=this.previous,d=this.events;let c=0;return f;function f(m){return u===126&&d[d.length-1][1].type!=="characterEscape"?l(m):(o.enter("strikethroughSequenceTemporary"),p(m))}function p(m){const g=Bi(u);if(m===126)return c>1?l(m):(o.consume(m),c++,p);if(c<2&&!r)return l(m);const b=o.exit("strikethroughSequenceTemporary"),h=Bi(m);return b._open=!h||h===2&&!!g,b._close=!g||g===2&&!!h,s(m)}}}class bR{constructor(){this.map=[]}add(t,r,n){yR(this,t,r,n)}consume(t){if(this.map.sort(function(i,o){return i[0]-o[0]}),this.map.length===0)return;let r=this.map.length;const n=[];for(;r>0;)r-=1,n.push(t.slice(this.map[r][0]+this.map[r][1]),this.map[r][2]),t.length=this.map[r][0];n.push(t.slice()),t.length=0;let a=n.pop();for(;a;){for(const i of a)t.push(i);a=n.pop()}this.map.length=0}}function yR(e,t,r,n){let a=0;if(!(r===0&&n.length===0)){for(;a<e.map.length;){if(e.map[a][0]===t){e.map[a][1]+=r,e.map[a][2].push(...n);return}a+=1}e.map.push([t,r,n])}}function vR(e,t){let r=!1;const n=[];for(;t<e.length;){const a=e[t];if(r){if(a[0]==="enter")a[1].type==="tableContent"&&n.push(e[t+1][1].type==="tableDelimiterMarker"?"left":"none");else if(a[1].type==="tableContent"){if(e[t-1][1].type==="tableDelimiterMarker"){const i=n.length-1;n[i]=n[i]==="left"?"center":"right"}}else if(a[1].type==="tableDelimiterRow")break}else a[0]==="enter"&&a[1].type==="tableDelimiterRow"&&(r=!0);t+=1}return n}function wR(){return{flow:{null:{name:"table",tokenize:xR,resolveAll:RR}}}}function xR(e,t,r){const n=this;let a=0,i=0,o;return s;function s(P){let M=n.events.length-1;for(;M>-1;){const D=n.events[M][1].type;if(D==="lineEnding"||D==="linePrefix")M--;else break}const F=M>-1?n.events[M][1].type:null,j=F==="tableHead"||F==="tableRow"?y:l;return j===y&&n.parser.lazy[n.now().line]?r(P):j(P)}function l(P){return e.enter("tableHead"),e.enter("tableRow"),u(P)}function u(P){return P===124||(o=!0,i+=1),d(P)}function d(P){return P===null?r(P):Er(P)?i>1?(i=0,n.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(P),e.exit("lineEnding"),p):r(P):At(P)?qt(e,d,"whitespace")(P):(i+=1,o&&(o=!1,a+=1),P===124?(e.enter("tableCellDivider"),e.consume(P),e.exit("tableCellDivider"),o=!0,d):(e.enter("data"),c(P)))}function c(P){return P===null||P===124||Qe(P)?(e.exit("data"),d(P)):(e.consume(P),P===92?f:c)}function f(P){return P===92||P===124?(e.consume(P),c):c(P)}function p(P){return n.interrupt=!1,n.parser.lazy[n.now().line]?r(P):(e.enter("tableDelimiterRow"),o=!1,At(P)?qt(e,m,"linePrefix",n.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(P):m(P))}function m(P){return P===45||P===58?b(P):P===124?(o=!0,e.enter("tableCellDivider"),e.consume(P),e.exit("tableCellDivider"),g):E(P)}function g(P){return At(P)?qt(e,b,"whitespace")(P):b(P)}function b(P){return P===58?(i+=1,o=!0,e.enter("tableDelimiterMarker"),e.consume(P),e.exit("tableDelimiterMarker"),h):P===45?(i+=1,h(P)):P===null||Er(P)?T(P):E(P)}function h(P){return P===45?(e.enter("tableDelimiterFiller"),w(P)):E(P)}function w(P){return P===45?(e.consume(P),w):P===58?(o=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(P),e.exit("tableDelimiterMarker"),x):(e.exit("tableDelimiterFiller"),x(P))}function x(P){return At(P)?qt(e,T,"whitespace")(P):T(P)}function T(P){return P===124?m(P):P===null||Er(P)?!o||a!==i?E(P):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(P)):E(P)}function E(P){return r(P)}function y(P){return e.enter("tableRow"),v(P)}function v(P){return P===124?(e.enter("tableCellDivider"),e.consume(P),e.exit("tableCellDivider"),v):P===null||Er(P)?(e.exit("tableRow"),t(P)):At(P)?qt(e,v,"whitespace")(P):(e.enter("data"),R(P))}function R(P){return P===null||P===124||Qe(P)?(e.exit("data"),v(P)):(e.consume(P),P===92?k:R)}function k(P){return P===92||P===124?(e.consume(P),R):R(P)}}function RR(e,t){let r=-1,n=!0,a=0,i=[0,0,0,0],o=[0,0,0,0],s=!1,l=0,u,d,c;const f=new bR;for(;++r<e.length;){const p=e[r],m=p[1];p[0]==="enter"?m.type==="tableHead"?(s=!1,l!==0&&(nd(f,t,l,u,d),d=void 0,l=0),u={type:"table",start:Object.assign({},m.start),end:Object.assign({},m.end)},f.add(r,0,[["enter",u,t]])):m.type==="tableRow"||m.type==="tableDelimiterRow"?(n=!0,c=void 0,i=[0,0,0,0],o=[0,r+1,0,0],s&&(s=!1,d={type:"tableBody",start:Object.assign({},m.start),end:Object.assign({},m.end)},f.add(r,0,[["enter",d,t]])),a=m.type==="tableDelimiterRow"?2:d?3:1):a&&(m.type==="data"||m.type==="tableDelimiterMarker"||m.type==="tableDelimiterFiller")?(n=!1,o[2]===0&&(i[1]!==0&&(o[0]=o[1],c=yi(f,t,i,a,void 0,c),i=[0,0,0,0]),o[2]=r)):m.type==="tableCellDivider"&&(n?n=!1:(i[1]!==0&&(o[0]=o[1],c=yi(f,t,i,a,void 0,c)),i=o,o=[i[1],r,0,0])):m.type==="tableHead"?(s=!0,l=r):m.type==="tableRow"||m.type==="tableDelimiterRow"?(l=r,i[1]!==0?(o[0]=o[1],c=yi(f,t,i,a,r,c)):o[1]!==0&&(c=yi(f,t,o,a,r,c)),a=0):a&&(m.type==="data"||m.type==="tableDelimiterMarker"||m.type==="tableDelimiterFiller")&&(o[3]=r)}for(l!==0&&nd(f,t,l,u,d),f.consume(t.events),r=-1;++r<t.events.length;){const p=t.events[r];p[0]==="enter"&&p[1].type==="table"&&(p[1]._align=vR(t.events,r))}return e}function yi(e,t,r,n,a,i){const o=n===1?"tableHeader":n===2?"tableDelimiter":"tableData",s="tableContent";r[0]!==0&&(i.end=Object.assign({},Rr(t.events,r[0])),e.add(r[0],0,[["exit",i,t]]));const l=Rr(t.events,r[1]);if(i={type:o,start:Object.assign({},l),end:Object.assign({},l)},e.add(r[1],0,[["enter",i,t]]),r[2]!==0){const u=Rr(t.events,r[2]),d=Rr(t.events,r[3]),c={type:s,start:Object.assign({},u),end:Object.assign({},d)};if(e.add(r[2],0,[["enter",c,t]]),n!==2){const f=t.events[r[2]],p=t.events[r[3]];if(f[1].end=Object.assign({},p[1].end),f[1].type="chunkText",f[1].contentType="text",r[3]>r[2]+1){const m=r[2]+1,g=r[3]-r[2]-1;e.add(m,g,[])}}e.add(r[3]+1,0,[["exit",c,t]])}return a!==void 0&&(i.end=Object.assign({},Rr(t.events,a)),e.add(a,0,[["exit",i,t]]),i=void 0),i}function nd(e,t,r,n,a){const i=[],o=Rr(t.events,r);a&&(a.end=Object.assign({},o),i.push(["exit",a,t])),n.end=Object.assign({},o),i.push(["exit",n,t]),e.add(r+1,0,i)}function Rr(e,t){const r=e[t],n=r[0]==="enter"?"start":"end";return r[1][n]}const CR={name:"tasklistCheck",tokenize:TR};function ER(){return{text:{91:CR}}}function TR(e,t,r){const n=this;return a;function a(l){return n.previous!==null||!n._gfmTasklistFirstContentOfListItem?r(l):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(l),e.exit("taskListCheckMarker"),i)}function i(l){return Qe(l)?(e.enter("taskListCheckValueUnchecked"),e.consume(l),e.exit("taskListCheckValueUnchecked"),o):l===88||l===120?(e.enter("taskListCheckValueChecked"),e.consume(l),e.exit("taskListCheckValueChecked"),o):r(l)}function o(l){return l===93?(e.enter("taskListCheckMarker"),e.consume(l),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),s):r(l)}function s(l){return Er(l)?t(l):At(l)?e.check({tokenize:SR},t,r)(l):r(l)}}function SR(e,t,r){return qt(e,n,"whitespace");function n(a){return a===null?r(a):t(a)}}function _R(e){return W0([J0(),lR(),gR(e),wR(),ER()])}const PR={};function kR(e){const t=this,r=e||PR,n=t.data(),a=n.micromarkExtensions||(n.micromarkExtensions=[]),i=n.fromMarkdownExtensions||(n.fromMarkdownExtensions=[]),o=n.toMarkdownExtensions||(n.toMarkdownExtensions=[]);a.push(_R(r)),i.push(z0()),o.push(U0(r))}function De(...e){return e.filter(Boolean).join(" ")}const MR=({content:e})=>_.jsx(Sl.MarkdownTextPrimitive,{remarkPlugins:[kR],className:"cuadra-aui-md",components:IR,children:e}),Tu=V.memo(MR),AR=({language:e,code:t})=>{const{isCopied:r,copyToClipboard:n}=qR(),a=()=>{!t||r||n(t)};return _.jsxs("div",{className:"cuadra-flex cuadra-items-center cuadra-justify-between cuadra-gap-4 cuadra-mt-4 cuadra-rounded-t-lg cuadra-bg-muted/50 cuadra-border-b cuadra-border-border cuadra-px-4 cuadra-py-2 cuadra-text-sm cuadra-font-normal cuadra-text-foreground cuadra-font-brand",children:[_.jsx("span",{className:"cuadra-lowercase [&>span]:cuadra-text-xs cuadra-font-brand",children:e}),_.jsxs("button",{onClick:a,className:"cuadra-p-1 cuadra-rounded hover:cuadra-bg-muted cuadra-transition-colors","aria-label":"Copy code",children:[!r&&_.jsx(Tw,{className:"cuadra-h-4 cuadra-w-4"}),r&&_.jsx(ww,{className:"cuadra-h-4 cuadra-w-4"})]})]})},qR=({copiedDuration:e=3e3}={})=>{const[t,r]=V.useState(!1);return{isCopied:t,copyToClipboard:a=>{a&&navigator.clipboard.writeText(a).then(()=>{r(!0),setTimeout(()=>r(!1),e)})}}},IR=Sl.unstable_memoizeMarkdownComponents({h1:({className:e,...t})=>_.jsx("h1",{className:De("cuadra-mb-6 cuadra-scroll-m-20 cuadra-text-2xl cuadra-font-normal cuadra-tracking-tight last:cuadra-mb-0 font-brand",e),...t}),h2:({className:e,...t})=>_.jsx("h2",{className:De("cuadra-mb-4 cuadra-mt-6 cuadra-scroll-m-20 cuadra-text-xl cuadra-font-normal cuadra-tracking-tight first:cuadra-mt-0 last:cuadra-mb-0 font-brand",e),...t}),h3:({className:e,...t})=>_.jsx("h3",{className:De("cuadra-mb-3 cuadra-mt-5 cuadra-scroll-m-20 cuadra-text-lg cuadra-font-normal cuadra-tracking-tight first:cuadra-mt-0 last:cuadra-mb-0 font-brand",e),...t}),h4:({className:e,...t})=>_.jsx("h4",{className:De("cuadra-mb-4 cuadra-mt-6 cuadra-scroll-m-20 cuadra-text-xl cuadra-font-normal cuadra-tracking-tight first:cuadra-mt-0 last:cuadra-mb-0 font-brand",e),...t}),h5:({className:e,...t})=>_.jsx("h5",{className:De("cuadra-my-4 cuadra-text-lg cuadra-font-normal first:cuadra-mt-0 last:cuadra-mb-0 font-brand",e),...t}),h6:({className:e,...t})=>_.jsx("h6",{className:De("cuadra-my-4 cuadra-font-normal first:cuadra-mb-0 font-brand",e),...t}),p:({className:e,...t})=>_.jsx("p",{className:De("cuadra-mb-5 cuadra-mt-5 cuadra-leading-7 first:cuadra-mt-0 last:cuadra-mb-0 font-brand",e),...t}),a:({className:e,...t})=>_.jsx("a",{className:De("cuadra-text-primary cuadra-font-medium cuadra-underline cuadra-underline-offset-4 font-brand",e),...t}),blockquote:({className:e,...t})=>_.jsx("blockquote",{className:De("cuadra-border-l-2 cuadra-pl-6 cuadra-italic font-brand",e),...t}),ul:({className:e,...t})=>_.jsx("ul",{className:De("cuadra-my-5 cuadra-ml-6 cuadra-list-disc [&>li]:cuadra-mt-2 font-brand",e),...t}),ol:({className:e,...t})=>_.jsx("ol",{className:De("cuadra-my-5 cuadra-ml-6 cuadra-list-decimal [&>li]:cuadra-mt-2 font-brand",e),...t}),hr:({className:e,...t})=>_.jsx("hr",{className:De("cuadra-my-5 cuadra-border-b",e),...t}),table:({className:e,...t})=>_.jsx("table",{className:De("cuadra-my-5 cuadra-w-full cuadra-border-separate cuadra-border-spacing-0 cuadra-overflow-y-auto font-brand",e),...t}),th:({className:e,...t})=>_.jsx("th",{className:De("cuadra-bg-muted cuadra-px-4 cuadra-py-2 cuadra-text-left cuadra-font-normal first:cuadra-rounded-tl-lg last:cuadra-rounded-tr-lg [&[align=center]]:cuadra-text-center [&[align=right]]:cuadra-text-right font-brand",e),...t}),td:({className:e,...t})=>_.jsx("td",{className:De("cuadra-border-b cuadra-border-l cuadra-px-4 cuadra-py-2 cuadra-text-left last:cuadra-border-r [&[align=center]]:cuadra-text-center [&[align=right]]:cuadra-text-right font-brand",e),...t}),tr:({className:e,...t})=>_.jsx("tr",{className:De("cuadra-m-0 cuadra-border-b cuadra-p-0 first:cuadra-border-t [&:last-child>td:first-child]:cuadra-rounded-bl-lg [&:last-child>td:last-child]:cuadra-rounded-br-lg",e),...t}),sup:({className:e,...t})=>_.jsx("sup",{className:De("[&>a]:cuadra-text-xs [&>a]:cuadra-no-underline font-brand",e),...t}),pre:({className:e,...t})=>_.jsx("pre",{className:De("cuadra-overflow-x-auto cuadra-rounded-b-lg !cuadra-rounded-t-none cuadra-bg-muted cuadra-p-4 cuadra-text-foreground font-brand",e),...t}),code:function({className:t,...r}){const n=Sl.useIsMarkdownCodeBlock();return _.jsx("code",{className:De(!n&&"cuadra-bg-muted cuadra-rounded cuadra-border cuadra-font-normal font-brand",t),...r})},CodeHeader:AR});function Su({className:e="",variant:t="default",...r}){const n="cuadra-inline-flex cuadra-items-center cuadra-rounded-md cuadra-px-3 cuadra-py-1.5 cuadra-text-xs cuadra-font-medium font-brand",a={default:"cuadra-border cuadra-border-border cuadra-bg-muted cuadra-text-muted-foreground",subtle:"cuadra-border cuadra-border-border/50 cuadra-bg-muted/50 cuadra-text-muted-foreground",outline:"cuadra-border cuadra-border-border cuadra-bg-background cuadra-text-foreground",ghost:"cuadra-text-muted-foreground"};return _.jsx("div",{className:`${n} ${a[t]||a.default} ${e}`,...r})}function OR(e){const t=new Map;for(const r of e){const n=t.get(r.filename);(!n||r.score>n.score)&&t.set(r.filename,r)}return Array.from(t.values()).sort((r,n)=>n.score-r.score)}function fb({sources:e,maxVisible:t=3}){if(!e||e.length===0)return null;const r=OR(e),n=r.slice(0,t),a=r.length-t;return _.jsxs("div",{className:"cuadra-mt-4 cuadra-pt-3 cuadra-border-t cuadra-border-border",children:[_.jsxs("div",{className:"cuadra-flex cuadra-items-center cuadra-gap-1.5 cuadra-mb-2.5",children:[_.jsx(Ig,{className:"cuadra-h-3.5 cuadra-w-3.5 cuadra-text-muted-foreground"}),_.jsx("span",{className:"cuadra-text-xs cuadra-font-medium cuadra-text-muted-foreground font-brand",children:"Sources"})]}),_.jsxs("div",{className:"cuadra-flex cuadra-flex-wrap cuadra-gap-2",children:[n.map((i,o)=>_.jsx($R,{source:i},i.sourceId||o)),a>0&&_.jsxs(Su,{variant:"subtle",children:["+",a," more"]})]})]})}function NR(e){switch(e.split(".").pop()?.toLowerCase()){case"csv":case"xlsx":case"xls":return kw;case"md":case"txt":return qw;default:return Ig}}function $R({source:e}){const{filename:t,score:r}=e,n=NR(t);return _.jsxs(Su,{className:"cuadra-gap-2 cuadra-cursor-default",title:r<1?`${Math.round(r*100)}% relevant`:void 0,children:[_.jsx(n,{className:"cuadra-h-3.5 cuadra-w-3.5 cuadra-shrink-0 cuadra-opacity-60"}),_.jsx("span",{className:"cuadra-truncate cuadra-max-w-[180px]",children:t}),r<1&&r>0&&_.jsxs("span",{className:"cuadra-opacity-50 cuadra-text-[10px] cuadra-tabular-nums",children:[Math.round(r*100),"%"]})]})}const ad=V.forwardRef(function({welcomeTitle:t="Hi, how can I help you today?",welcomeSubtitle:r="Start exploring our platform and discover what you can build.",extraTopPadding:n,suggestions:a,inputPlaceholder:i="Type your message...",enableAttachments:o=!1,preMadeResponseDelay:s=1e3,streamingSpeed:l=50},u){const d=pe.useThreadRuntime(),c=pe.useAssistantApi(),[f,p]=V.useState(!1),[m,g]=V.useState(null),[b,h]=V.useState(!1),w=V.useCallback((y,v,R)=>{if(!b)try{const k=R?.streamingSpeed??l,P=R?.delay??s;jg(y,v,k,P),c.composer().setText(y),setTimeout(()=>{c.composer().send()},10)}catch{}},[b,l,s,c]),x=V.useCallback(y=>{try{c.composer().setText(y),setTimeout(()=>{c.composer().send()},10)}catch{}},[c]),T=V.useCallback(async y=>{if(!(b||!d))try{if(y.response){const v=y.responseDelay??s;await w(y.prompt,y.response,{delay:v,streamingSpeed:l})}else x(y.prompt)}catch{}},[d,b,s,l,w,x]),E=V.useCallback(()=>{try{const y=window.__cuadraThreadListRuntime;y?.switchToNewThread&&y.switchToNewThread()}catch{}},[]);return V.useImperativeHandle(u,()=>({sendMessage:x,sendPreMadeQA:w,clearChat:E}),[x,w,E]),V.useEffect(()=>{if(!d){p(!1);return}try{const y=d?.store;if(!y){p(!1);return}const v=y.subscribe?.(k=>{const P=k?.threadId,M=k?.messages||[],F=k?.isLoadingHistory||!1,j=M.length;P&&P!==m&&g(P),p(F&&j===0)}),R=y.getState?.();if(R){const k=R?.threadId,P=R?.messages||[],M=R?.isLoadingHistory||!1,F=P.length;k&&k!==m&&g(k),p(M&&F===0)}return()=>{v&&v()}}catch{p(!1)}},[d,m]),_.jsxs(pe.ThreadPrimitive.Root,{className:"cuadra-bg-inherit cuadra-flex cuadra-flex-col cuadra-w-full cuadra-h-full",children:[_.jsx(pe.ThreadPrimitive.Viewport,{className:"cuadra-w-full cuadra-bg-inherit cuadra-px-4 cuadra-flex-1 cuadra-min-h-0 cuadra-overflow-y-auto cuadra-relative scrollbar-thin cuadra-pt-4",style:n?{paddingTop:n}:void 0,children:f?_.jsx("div",{className:"cuadra-absolute cuadra-inset-0 cuadra-flex cuadra-items-center cuadra-justify-center",children:_.jsxs("div",{className:"cuadra-flex cuadra-flex-col cuadra-items-center cuadra-gap-2",children:[_.jsx(Og,{className:"cuadra-h-6 cuadra-w-6 cuadra-animate-spin cuadra-text-muted-foreground"}),_.jsx("p",{className:"cuadra-text-sm cuadra-text-muted-foreground font-brand",children:"Loading messages..."})]})}):_.jsxs(_.Fragment,{children:[_.jsx(pe.ThreadPrimitive.Empty,{children:_.jsx(jR,{title:t,subtitle:r,suggestions:a,onSuggestionClick:T,isProcessing:b})}),_.jsx(pe.ThreadPrimitive.Messages,{components:{UserMessage:DR,AssistantMessage:BR}})]})}),_.jsxs("div",{className:"cuadra-w-full cuadra-mt-3 cuadra-border-t cuadra-border-border cuadra-pt-4",children:[o&&_.jsx(pe.ComposerPrimitive.Attachments,{components:{Attachment:()=>{const y=pe.useAssistantState(({attachment:v})=>v);return y?_.jsxs("div",{className:"cuadra-relative cuadra-inline-flex cuadra-items-center cuadra-gap-2 cuadra-mb-2 cuadra-px-2 cuadra-py-1 cuadra-rounded-md cuadra-bg-muted cuadra-border cuadra-border-border",children:[_.jsx("span",{className:"cuadra-text-xs cuadra-text-muted-foreground font-brand",children:y.name||"Attachment"}),_.jsx(pe.AttachmentPrimitive.Remove,{asChild:!0,children:_.jsx("button",{type:"button",className:"cuadra-flex cuadra-items-center cuadra-justify-center cuadra-size-4 cuadra-rounded hover:cuadra-bg-background cuadra-transition-colors","aria-label":"Remove attachment",children:_.jsx(vu,{className:"cuadra-h-3 cuadra-w-3 cuadra-text-muted-foreground"})})})]}):null}}}),_.jsxs(pe.ComposerPrimitive.Root,{className:"cuadra-relative !cuadra-relative cuadra-flex-1 cuadra-w-full",children:[_.jsx(pe.ComposerPrimitive.Input,{asChild:!0,children:_.jsx("textarea",{rows:3,placeholder:i,className:"cuadra-flex cuadra-min-h-[80px] cuadra-w-full cuadra-rounded-md cuadra-border cuadra-border-border cuadra-bg-background cuadra-px-3 cuadra-py-2 cuadra-text-base cuadra-text-foreground placeholder:cuadra-text-muted-foreground focus-visible:cuadra-outline-none disabled:cuadra-cursor-not-allowed disabled:cuadra-opacity-50 cuadra-resize-none font-brand",style:{paddingRight:o?"5rem":"3rem",fontSize:"1rem",borderWidth:"1px"}})}),o&&_.jsx(pe.ComposerPrimitive.AddAttachment,{multiple:!0,asChild:!0,children:_.jsx("button",{type:"button",className:"!cuadra-absolute !cuadra-bottom-2 !cuadra-right-12 cuadra-size-8 cuadra-rounded-md hover:cuadra-bg-muted cuadra-transition-colors cuadra-flex cuadra-items-center cuadra-justify-center cuadra-border cuadra-border-border",style:{position:"absolute",bottom:"0.5rem",right:"3rem"},"aria-label":"Attach file",children:_.jsx(Ng,{className:"cuadra-h-4 cuadra-w-4 cuadra-text-muted-foreground",strokeWidth:1.5})})}),_.jsx(pe.ComposerPrimitive.Send,{asChild:!0,children:_.jsx("button",{className:"!cuadra-absolute !cuadra-bottom-2 !cuadra-right-2 cuadra-size-8 cuadra-rounded-md cuadra-shadow-sm hover:cuadra-opacity-90 disabled:cuadra-opacity-50 disabled:cuadra-cursor-not-allowed cuadra-flex cuadra-items-center cuadra-justify-center",style:{position:"absolute",bottom:"0.5rem",right:"0.5rem",backgroundColor:"var(--cuadra-primary)",color:"hsl(var(--cuadra-primary-foreground))"},"aria-label":"Send message",type:"button",children:_.jsx(yw,{className:"cuadra-h-4 cuadra-w-4"})})})]})]})]})});function jR({title:e,subtitle:t,suggestions:r,onSuggestionClick:n,isProcessing:a}){return _.jsx("div",{className:"cuadra-flex cuadra-flex-col cuadra-items-center cuadra-h-full cuadra-py-12 cuadra-px-4 cuadra-overflow-y-auto scrollbar-hide",children:_.jsxs("div",{className:"cuadra-text-center cuadra-max-w-3xl cuadra-w-full cuadra-flex cuadra-flex-col cuadra-items-center cuadra-justify-center cuadra-min-h-full",children:[_.jsxs("div",{className:"cuadra-flex cuadra-flex-col cuadra-items-center cuadra-justify-center cuadra-mb-8",children:[_.jsx("h2",{className:"cuadra-text-lg cuadra-font-normal cuadra-text-foreground cuadra-mb-2 font-brand",children:e}),_.jsx("p",{className:"cuadra-text-muted-foreground font-brand",children:t})]}),r&&r.length>0&&_.jsx("div",{className:"cuadra-grid cuadra-grid-cols-2 cuadra-gap-2 cuadra-pb-4 cuadra-w-full cuadra-max-w-2xl",children:r.map((i,o)=>_.jsx("button",{type:"button",onClick:()=>n(i),disabled:a,className:"cuadra-w-full cuadra-text-center cuadra-px-4 cuadra-py-3 cuadra-rounded-lg cuadra-border cuadra-border-border cuadra-bg-background cuadra-text-sm cuadra-text-foreground font-brand cuadra-cursor-pointer focus:cuadra-outline-none focus:cuadra-ring-0 disabled:cuadra-opacity-50 disabled:cuadra-cursor-not-allowed",style:{borderWidth:"1px"},children:i.prompt},`suggestion-${o}`))})]})})}function DR(){return _.jsxs(pe.MessagePrimitive.Root,{className:"cuadra-grid cuadra-w-full cuadra-auto-rows-auto cuadra-grid-cols-[minmax(72px,1fr)_auto] cuadra-gap-y-2 cuadra-py-3 [&:where(>*)]:cuadra-col-start-2",children:[_.jsx(pe.MessagePrimitive.Attachments,{components:{Attachment:()=>{const e=pe.useAssistantState(({attachment:i})=>i);if(!e)return null;const t=e.type==="image",r=e.file,n=e.content?.find(i=>i.type==="image"),a=r?URL.createObjectURL(r):n?.image;return _.jsx("div",{className:"cuadra-col-start-2 cuadra-row-start-1 cuadra-mb-2 cuadra-max-w-[calc(42rem*0.8)]",children:t&&a?_.jsx("img",{src:a,alt:e.name||"Attachment",className:"cuadra-rounded-lg cuadra-border cuadra-border-border cuadra-max-h-64 cuadra-max-w-full cuadra-object-contain",style:{borderWidth:"1px"}}):_.jsxs("div",{className:"cuadra-flex cuadra-items-center cuadra-gap-2 cuadra-rounded-lg cuadra-border cuadra-border-border cuadra-bg-muted cuadra-px-3 cuadra-py-2",children:[_.jsx(Ng,{className:"cuadra-h-4 cuadra-w-4 cuadra-text-muted-foreground"}),_.jsx("span",{className:"cuadra-text-sm cuadra-text-foreground font-brand",children:e.name||"Attachment"})]})})}}}),_.jsx("div",{className:"cuadra-bg-muted cuadra-text-foreground cuadra-col-start-2 cuadra-row-start-2 cuadra-max-w-[calc(42rem*0.8)] cuadra-break-words cuadra-rounded-3xl cuadra-border cuadra-border-border cuadra-px-5 cuadra-py-2.5 font-brand",style:{maxWidth:"calc(42rem * 0.8)",borderRadius:"1.5rem",backgroundColor:"var(--cuadra-muted)",color:"hsl(var(--cuadra-foreground))",paddingLeft:"1.25rem",paddingRight:"1.25rem",paddingTop:"0.625rem",paddingBottom:"0.625rem",wordBreak:"break-word",borderWidth:"1px"},children:_.jsx(pe.MessagePrimitive.Parts,{components:{Text:({text:e})=>_.jsx(Tu,{content:e||""})}})})]})}function LR({text:e}){const[t,r]=V.useState(!1),n=pe.useAssistantState(({message:a})=>a?.status?.type==="running");return e?n?_.jsx("div",{className:"cuadra-mb-3 cuadra-py-1",children:_.jsx("div",{className:"cuadra-text-sm cuadra-text-muted-foreground cuadra-leading-relaxed font-brand cuadra-animate-text-shimmer",children:e})}):_.jsxs("div",{className:"cuadra-mb-3",children:[_.jsxs("button",{type:"button",onClick:()=>r(!t),className:"cuadra-flex cuadra-items-center cuadra-gap-1.5 cuadra-py-1 cuadra-text-sm cuadra-text-muted-foreground hover:cuadra-text-foreground cuadra-transition-colors font-brand",children:[_.jsx(_l,{className:`cuadra-h-3.5 cuadra-w-3.5 cuadra-shrink-0 cuadra-transition-transform cuadra-duration-200 ${t?"":"cuadra--rotate-90"}`}),_.jsx("span",{children:"Reasoning"})]}),_.jsx("div",{className:`cuadra-overflow-hidden cuadra-transition-all cuadra-duration-200 cuadra-ease-out ${t?"cuadra-max-h-[2000px] cuadra-opacity-100":"cuadra-max-h-0 cuadra-opacity-0"}`,children:_.jsx("div",{className:"cuadra-pl-5 cuadra-pt-2 cuadra-text-sm cuadra-text-muted-foreground cuadra-leading-relaxed font-brand",children:_.jsx(Tu,{content:e})})})]}):null}function FR(){return _.jsxs("div",{className:"cuadra-flex cuadra-items-center cuadra-gap-2 cuadra-text-muted-foreground cuadra-text-sm font-brand cuadra-py-2",children:[_.jsxs("div",{className:"cuadra-flex cuadra-items-center cuadra-gap-1",children:[_.jsx("span",{className:"cuadra-inline-block cuadra-w-1.5 cuadra-h-1.5 cuadra-bg-current cuadra-rounded-full cuadra-animate-bounce",style:{animationDelay:"0ms"}}),_.jsx("span",{className:"cuadra-inline-block cuadra-w-1.5 cuadra-h-1.5 cuadra-bg-current cuadra-rounded-full cuadra-animate-bounce",style:{animationDelay:"150ms"}}),_.jsx("span",{className:"cuadra-inline-block cuadra-w-1.5 cuadra-h-1.5 cuadra-bg-current cuadra-rounded-full cuadra-animate-bounce",style:{animationDelay:"300ms"}})]}),_.jsx("span",{children:"Thinking..."})]})}function BR(){const[e]=V.useState(()=>Mt.getCurrentMessageId()),t=pe.useAssistantState(({message:a})=>a?.status?.type==="running"),r=pe.useAssistantState(({message:a})=>{const i=a?.content;return!i||!Array.isArray(i)?!1:i.some(o=>!!(o.type==="text"&&o.text&&o.text.length>0||o.type==="reasoning"&&o.text&&o.text.length>0))}),n=V.useSyncExternalStore(a=>Mt.subscribe(a),()=>{if(e){const i=Mt.getForMessage(e);return i.sources?.length?i.sources:null}const a=Mt.getCurrentMessageId();if(a){const i=Mt.getForMessage(a);return i.sources?.length?i.sources:null}return null},()=>null);return _.jsx(pe.MessagePrimitive.Root,{className:"cuadra-relative cuadra-grid cuadra-w-full cuadra-grid-cols-[auto_auto_1fr] cuadra-grid-rows-[auto_1fr] cuadra-py-3",children:_.jsxs("div",{className:"cuadra-text-foreground cuadra-col-span-2 cuadra-col-start-2 cuadra-row-start-1 cuadra-my-1.5 cuadra-max-w-[90%] cuadra-break-words cuadra-leading-7 font-brand",style:{maxWidth:"90%",marginTop:"0.375rem",marginBottom:"0.375rem"},children:[_.jsx(pe.MessagePrimitive.Parts,{components:{Text:({text:a})=>_.jsx(Tu,{content:a||""}),Reasoning:({text:a})=>_.jsx(LR,{text:a||""})}}),t&&!r&&_.jsx(FR,{}),n&&n.length>0&&_.jsx(fb,{sources:n})]})})}const pb=({className:e="",theme:t="system"})=>{const r=()=>{if(typeof window>"u")return"light";if(t==="system"){const o=localStorage.getItem("theme");return o||(window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light")}return t},[n,a]=V.useState(r);V.useEffect(()=>{t!=="system"&&a(t)},[t]),V.useEffect(()=>{const o=document.documentElement;o.classList.remove("light","dark"),o.classList.add(n),t==="system"&&localStorage.setItem("theme",n)},[n,t]);const i=()=>{t==="system"&&a(o=>o==="light"?"dark":"light")};return _.jsx("button",{type:"button","aria-label":"Toggle theme",onClick:i,disabled:t!=="system",className:`cuadra-flex cuadra-items-center cuadra-justify-center cuadra-h-8 cuadra-w-8 cuadra-rounded-full cuadra-bg-muted hover:cuadra-bg-muted/80 cuadra-transition-colors disabled:cuadra-opacity-50 disabled:cuadra-cursor-not-allowed ${e}`,children:_.jsx(Cw,{className:`cuadra-h-4 cuadra-w-4 cuadra-transition-colors ${n==="dark"?"cuadra-text-primary":"cuadra-text-gray-400"}`})})};function zR({onThreadSelect:e}){const t=pe.useThreadListItem(),r=pe.useThread(b=>b.threadId),[n,a]=V.useState(null),i=t?.id===r,o=n===t?.id,[s,l]=V.useState(!1),[u,d]=V.useState(t?.title||""),[c,f]=V.useState(!1),[p,m]=V.useState(!1),g=async()=>{if(!t?.remoteId||!u||u===t.title){l(!1);return}try{m(!0);const b=window.__cuadraThreadListAdapter;b&&typeof b.rename=="function"&&await b.rename(t.remoteId,u),l(!1),f(!1)}catch{l(!1),f(!1)}finally{m(!1)}};return V.useEffect(()=>{t?.title&&!s&&d(t.title)},[t?.title,s]),t?_.jsxs(pe.ThreadListItemPrimitive.Root,{className:`group cuadra-relative cuadra-flex cuadra-items-center cuadra-rounded-lg cuadra-transition-colors cuadra-cursor-pointer cuadra-border cuadra-mb-2 ${i?"cuadra-bg-muted cuadra-border-border":"cuadra-border-transparent hover:cuadra-bg-muted hover:cuadra-border-border"}`,style:{marginBottom:"0.5rem"},onMouseEnter:()=>a(t.id),onMouseLeave:()=>a(null),children:[_.jsx(pe.ThreadListItemPrimitive.Trigger,{className:"cuadra-p-3 cuadra-flex-1 cuadra-flex cuadra-items-center cuadra-min-w-0 cuadra-cursor-pointer",onClick:()=>e?.(),children:_.jsx("div",{className:"cuadra-flex cuadra-flex-col cuadra-min-w-0 cuadra-flex-1 cuadra-items-start cuadra-text-left",children:s?_.jsx("input",{className:"cuadra-flex cuadra-w-full cuadra-rounded-md cuadra-border cuadra-border-input cuadra-bg-background cuadra-px-3 cuadra-py-2 cuadra-text-sm placeholder:cuadra-text-muted-foreground focus-visible:cuadra-outline-none disabled:cuadra-cursor-not-allowed disabled:cuadra-opacity-50 font-brand",value:u,onChange:b=>d(b.target.value),onKeyDown:b=>{b.key==="Enter"&&g(),b.key==="Escape"&&(l(!1),d(t.title||""))},disabled:p,autoFocus:!0,onClick:b=>b.stopPropagation()}):_.jsxs(_.Fragment,{children:[_.jsx("span",{className:"cuadra-text-sm cuadra-font-normal cuadra-text-foreground cuadra-truncate font-brand",children:(t.title?.length||0)>60?`${t.title?.slice(0,60)}…`:t.title||"Chat"}),t.updatedAt&&_.jsx("span",{className:"cuadra-text-xs cuadra-text-muted-foreground cuadra-mt-1 font-brand",children:new Date(t.updatedAt).toLocaleDateString()})]})})}),_.jsx("div",{className:"cuadra-mr-2 cuadra-flex-shrink-0 cuadra-w-6 cuadra-h-6 cuadra-flex cuadra-items-center cuadra-justify-center",children:(o||i||c)&&_.jsxs("div",{className:"cuadra-relative",children:[_.jsx("button",{type:"button",className:"cuadra-p-1 cuadra-rounded hover:cuadra-bg-background/50 cuadra-transition-colors",onClick:b=>{b.stopPropagation(),f(!c)},"aria-label":"Thread options",children:_.jsx(_w,{className:"cuadra-h-4 cuadra-w-4 cuadra-text-muted-foreground"})}),c&&_.jsxs(_.Fragment,{children:[_.jsx("div",{className:"cuadra-fixed cuadra-inset-0 cuadra-z-40",onClick:()=>f(!1)}),_.jsx("div",{className:"cuadra-absolute cuadra-right-0 cuadra-top-8 cuadra-z-50 cuadra-bg-background cuadra-border cuadra-border-border cuadra-rounded-lg cuadra-shadow-lg cuadra-min-w-[120px] cuadra-overflow-hidden",children:s?_.jsx("button",{type:"button",className:"cuadra-w-full cuadra-px-3 cuadra-py-2 cuadra-text-sm cuadra-text-left hover:cuadra-bg-muted cuadra-transition-colors font-brand",onClick:b=>{b.stopPropagation(),g()},disabled:p,children:"Save"}):_.jsxs(_.Fragment,{children:[_.jsx("button",{type:"button",className:"cuadra-w-full cuadra-px-3 cuadra-py-2 cuadra-text-sm cuadra-text-left hover:cuadra-bg-muted cuadra-transition-colors font-brand",onClick:b=>{b.stopPropagation(),l(!0),d(t.title||""),f(!1)},children:"Rename"}),_.jsx("div",{className:"cuadra-border-t cuadra-border-border"}),_.jsx(pe.ThreadListItemPrimitive.Delete,{asChild:!0,children:_.jsx("button",{type:"button",className:"cuadra-w-full cuadra-px-3 cuadra-py-2 cuadra-text-sm cuadra-text-left cuadra-text-destructive hover:cuadra-bg-muted cuadra-transition-colors font-brand",onClick:b=>{b.stopPropagation(),f(!1)},children:"Delete"})})]})})]})]})})]}):null}function od({onThreadSelect:e,showThemeToggle:t,theme:r,onLogout:n}){return _.jsxs(pe.ThreadListPrimitive.Root,{className:"!cuadra-border-r cuadra-border-border cuadra-flex cuadra-flex-col cuadra-bg-background cuadra-transition-all cuadra-duration-300 cuadra-ease-in-out cuadra-h-full cuadra-w-80",style:{borderRightWidth:"1px"},children:[_.jsx("div",{className:"cuadra-border-b cuadra-border-border cuadra-flex cuadra-items-center cuadra-justify-end cuadra-transition-all cuadra-duration-300 cuadra-h-16 cuadra-px-4",children:_.jsx("button",{type:"button",onClick:e,className:"cuadra-flex md:cuadra-hidden cuadra-items-center cuadra-justify-center cuadra-h-8 cuadra-w-8 cuadra-rounded-full cuadra-bg-muted hover:cuadra-bg-muted/80 cuadra-transition-colors","aria-label":"Close",children:_.jsx(vu,{className:"cuadra-h-4 cuadra-w-4 cuadra-text-foreground"})})}),_.jsxs("div",{className:"cuadra-flex-1 cuadra-overflow-y-auto cuadra-p-2 scrollbar-thin",children:[_.jsx(pe.ThreadListPrimitive.New,{className:"group cuadra-relative cuadra-flex cuadra-items-center cuadra-gap-3 cuadra-p-3 cuadra-rounded-lg cuadra-cursor-pointer cuadra-transition-colors cuadra-border cuadra-border-transparent hover:cuadra-bg-muted hover:cuadra-border-border",onClick:()=>e?.(),children:_.jsx("div",{className:"cuadra-flex-1 cuadra-min-w-0",children:_.jsxs("div",{className:"cuadra-flex cuadra-items-center cuadra-gap-2",children:[_.jsx(Fw,{className:"cuadra-h-4 cuadra-w-4 cuadra-text-muted-foreground"}),_.jsx("h4",{className:"cuadra-text-sm cuadra-font-normal cuadra-text-foreground font-brand",children:"New Chat"})]})})}),_.jsx("div",{className:"cuadra-my-2 cuadra-border-t cuadra-border-border"}),_.jsx(pe.ThreadListPrimitive.Items,{components:{ThreadListItem:a=>_.jsx(zR,{...a,onThreadSelect:e})}})]}),(t||n)&&_.jsxs("div",{className:"cuadra-border-t cuadra-border-border cuadra-flex md:cuadra-hidden cuadra-items-center cuadra-justify-between cuadra-px-4 cuadra-py-4",children:[n&&_.jsx("button",{type:"button",onClick:n,className:"cuadra-flex cuadra-items-center cuadra-justify-center cuadra-h-8 cuadra-w-8 cuadra-rounded-full cuadra-bg-muted hover:cuadra-bg-muted/80 cuadra-transition-colors","aria-label":"Logout",children:_.jsx(Nw,{className:"cuadra-h-4 cuadra-w-4 cuadra-text-foreground"})}),t&&_.jsx(pb,{theme:r})]})]})}const UR=`
19
19
  @keyframes rotate {
20
20
  100% { transform: rotate(1turn); }
21
21
  }
22
- `,Be=({children:e,className:r="",paddingX:t="px-0",paddingY:a="py-0",borderSizePx:i=4,style:o,contentStyle:n,rotating:c=!1})=>u.jsxs(u.Fragment,{children:[u.jsx("style",{children:Hi}),u.jsxs("div",{className:`cuadra-relative cuadra-bg-background md:cuadra-rounded-xl cuadra-overflow-hidden ${r}`,style:{padding:i,...o},children:[u.jsx("div",{className:`cuadra-absolute md:cuadra-rounded-xl cuadra-textured-card-border ${c?"cuadra-textured-card-border-rotating":""}`,style:c?{left:"-100%",top:"-100%",width:"300%",height:"300%",backgroundRepeat:"no-repeat",backgroundSize:"cover",backgroundPosition:"center",animation:"rotate 4s linear infinite"}:{backgroundSize:"cover",backgroundPosition:"center",backgroundRepeat:"no-repeat",top:"0",left:"0",width:"100%",height:"100%"}}),u.jsx("div",{className:`cuadra-relative cuadra-bg-background cuadra-h-full cuadra-z-10 cuadra-flex cuadra-flex-col cuadra-overflow-hidden ${t} ${a}`,style:{borderRadius:"calc(0.75rem - 4px)",...n},children:e})]})]}),Mt=({currentModel:e,models:r,modelsLoading:t,modelsError:a,onModelChange:i,hideModelSelector:o=!1,showThemeToggle:n=!0,theme:c="system",onMobileMenuClick:s,showMobileMenuButton:l=!1})=>{const[f,d]=y.useState(!1),[p,g]=y.useState(!1),m=y.useRef(null);y.useEffect(()=>{const b=w=>{m.current&&!m.current.contains(w.target)&&d(!1)};return f&&document.addEventListener("mousedown",b),()=>{document.removeEventListener("mousedown",b)}},[f]);const k=r.find(b=>b.id===e),x=b=>{i(b),d(!1),g(!1)};return u.jsxs("div",{className:"cuadra-h-16 cuadra-px-4 cuadra-border-b cuadra-border-border cuadra-flex cuadra-items-center cuadra-justify-between cuadra-bg-background",children:[u.jsxs("div",{className:"cuadra-flex cuadra-items-center cuadra-gap-2",children:[l&&u.jsx("button",{type:"button",onClick:s,className:"cuadra-flex cuadra-items-center cuadra-justify-center cuadra-h-8 cuadra-w-8 cuadra-rounded-full cuadra-bg-muted hover:cuadra-bg-muted/80 cuadra-transition-colors disabled:cuadra-opacity-50 disabled:cuadra-cursor-not-allowed md:cuadra-hidden","aria-label":"Toggle thread list",children:u.jsx(Hr,{className:"cuadra-h-4 cuadra-w-4 cuadra-text-foreground"})}),n&&u.jsx("div",{className:"cuadra-hidden md:cuadra-flex cuadra-items-center cuadra-gap-2",children:u.jsx(ur,{theme:c})})]}),u.jsxs("div",{className:"cuadra-flex cuadra-items-center cuadra-gap-2 md:cuadra-ml-0 cuadra-ml-auto",children:[!o&&u.jsx("label",{className:"cuadra-hidden md:cuadra-inline cuadra-text-sm cuadra-text-muted-foreground cuadra-font-brand",children:"Model"}),o?null:t?u.jsx("div",{className:"cuadra-w-48 cuadra-rounded-md cuadra-border cuadra-border-border cuadra-px-3 cuadra-py-2 cuadra-bg-muted",children:u.jsx("span",{className:"cuadra-text-muted-foreground cuadra-text-sm cuadra-font-brand",children:"Loading..."})}):a?u.jsx("div",{className:"cuadra-w-48 cuadra-rounded-md cuadra-border cuadra-border-destructive cuadra-px-3 cuadra-py-2 cuadra-bg-destructive/10",children:u.jsx("span",{className:"cuadra-text-destructive cuadra-text-sm cuadra-font-brand",children:"Failed to load models"})}):u.jsxs(u.Fragment,{children:[u.jsxs("div",{ref:m,className:"cuadra-hidden md:cuadra-block cuadra-relative cuadra-w-48",children:[u.jsxs("button",{type:"button",onClick:()=>d(!f),disabled:t||r.length===0||!!a,className:"cuadra-flex cuadra-h-10 cuadra-w-full cuadra-items-center cuadra-justify-between cuadra-rounded-md cuadra-border cuadra-border-input cuadra-bg-background cuadra-px-3 cuadra-py-2 cuadra-text-sm placeholder:cuadra-text-muted-foreground focus:cuadra-outline-none disabled:cuadra-cursor-not-allowed disabled:cuadra-opacity-50 cuadra-font-brand",children:[u.jsx("span",{className:k?"cuadra-text-foreground":"cuadra-text-muted-foreground",children:k?.name||"Select model"}),u.jsx(Ve,{className:"cuadra-ml-2 cuadra-h-4 cuadra-w-4 cuadra-opacity-50"})]}),f&&r.length>0&&u.jsx("div",{className:"cuadra-absolute cuadra-z-50 cuadra-mt-1 cuadra-w-full cuadra-min-w-[8rem] cuadra-overflow-hidden cuadra-rounded-md glass-popover cuadra-text-popover-foreground cuadra-animate-in fade-in-80 cuadra-border cuadra-border-border cuadra-bg-popover cuadra-shadow-md",children:u.jsx("div",{className:"cuadra-p-1",children:r.map(b=>u.jsxs("button",{type:"button",onClick:()=>x(b.id),className:`cuadra-relative cuadra-flex cuadra-w-full cuadra-cursor-pointer cuadra-select-none cuadra-items-center cuadra-rounded-sm cuadra-py-1.5 cuadra-pl-8 cuadra-pr-2 cuadra-text-sm cuadra-outline-none focus:cuadra-bg-secondary focus:cuadra-text-secondary-foreground font-brand cuadra-transition-colors ${e===b.id?"cuadra-bg-secondary cuadra-text-secondary-foreground":"hover:cuadra-bg-secondary/50"}`,children:[e===b.id&&u.jsx("span",{className:"cuadra-absolute cuadra-left-2 cuadra-flex cuadra-h-3.5 cuadra-w-3.5 cuadra-items-center cuadra-justify-center",children:u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",fill:"none",viewBox:"0 0 16 16",children:u.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M6.47 10.03a.75.75 0 0 1-1.06-1.06l2-2a.75.75 0 0 1 1.06 0l2 2a.75.75 0 1 1-1.06 1.06L8 9.06l-1.53 1.53Z",clipRule:"evenodd"})})}),u.jsx("span",{children:b.name})]},b.id))})})]}),u.jsxs("button",{type:"button",onClick:()=>g(!0),disabled:t||r.length===0||!!a,className:"cuadra-flex md:cuadra-hidden cuadra-h-10 cuadra-w-full cuadra-items-center cuadra-justify-between cuadra-rounded-md cuadra-border cuadra-border-input cuadra-bg-background cuadra-px-3 cuadra-py-2 cuadra-text-sm placeholder:cuadra-text-muted-foreground focus:cuadra-outline-none disabled:cuadra-cursor-not-allowed disabled:cuadra-opacity-50 cuadra-font-brand",children:[u.jsx("span",{className:k?"cuadra-text-foreground":"cuadra-text-muted-foreground",children:k?.name||"Select model"}),u.jsx(Ve,{className:"cuadra-ml-2 cuadra-h-4 cuadra-w-4 cuadra-opacity-50"})]}),p&&typeof document<"u"&&qe.createPortal(u.jsxs(u.Fragment,{children:[u.jsx("div",{className:"cuadra-fixed cuadra-inset-0 cuadra-bg-black/50 cuadra-z-50 md:cuadra-hidden",onClick:()=>g(!1)}),u.jsxs("div",{className:"cuadra-fixed cuadra-inset-0 cuadra-z-50 cuadra-flex cuadra-flex-col cuadra-bg-background md:cuadra-hidden",children:[u.jsxs("div",{className:"cuadra-flex cuadra-items-center cuadra-justify-between cuadra-border-b cuadra-border-border cuadra-px-4 cuadra-py-4",children:[u.jsx("h2",{className:"cuadra-text-lg cuadra-font-normal cuadra-text-foreground font-brand",children:"Select Model"}),u.jsx("button",{type:"button",onClick:()=>g(!1),className:"cuadra-flex cuadra-items-center cuadra-justify-center cuadra-h-8 cuadra-w-8 cuadra-rounded-full cuadra-bg-muted hover:cuadra-bg-muted/80 cuadra-transition-colors","aria-label":"Close",children:u.jsx(Ge,{className:"cuadra-h-4 cuadra-w-4 cuadra-text-foreground"})})]}),u.jsx("div",{className:"cuadra-flex-1 cuadra-overflow-y-auto cuadra-p-4",children:t?u.jsx("div",{className:"cuadra-flex cuadra-items-center cuadra-justify-center cuadra-py-8",children:u.jsx("span",{className:"cuadra-text-muted-foreground cuadra-text-sm cuadra-font-brand",children:"Loading models..."})}):a?u.jsx("div",{className:"cuadra-flex cuadra-items-center cuadra-justify-center cuadra-py-8",children:u.jsx("span",{className:"cuadra-text-destructive cuadra-text-sm cuadra-font-brand",children:"Failed to load models"})}):r.length===0?u.jsx("div",{className:"cuadra-flex cuadra-items-center cuadra-justify-center cuadra-py-8",children:u.jsx("span",{className:"cuadra-text-muted-foreground cuadra-text-sm cuadra-font-brand",children:"No models available"})}):u.jsx("div",{className:"cuadra-space-y-2",children:r.map(b=>u.jsxs("button",{type:"button",onClick:()=>x(b.id),className:`cuadra-w-full cuadra-flex cuadra-items-center cuadra-justify-between cuadra-rounded-lg cuadra-border cuadra-px-4 cuadra-py-4 cuadra-text-left cuadra-transition-colors font-brand cuadra-bg-background cuadra-text-foreground cuadra-border-border hover:cuadra-bg-muted ${e===b.id?"cuadra-border-primary":""}`,children:[u.jsx("span",{className:"cuadra-text-base cuadra-font-normal",children:b.name}),e===b.id&&u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",fill:"none",viewBox:"0 0 20 20",className:"cuadra-text-primary",children:u.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M16.707 5.293a1 1 0 0 1 0 1.414l-8 8a1 1 0 0 1-1.414 0l-4-4a1 1 0 0 1 1.414-1.414L8 12.586l7.293-7.293a1 1 0 0 1 1.414 0Z",clipRule:"evenodd"})})]},b.id))})})]})]}),document.body)]})]})]})},Vi=y.createContext(void 0),We=({children:e,value:r})=>u.jsx(Vi.Provider,{value:r,children:e});function Xi(){y.useEffect(()=>{if(document.querySelector("style[data-cuadra-uikit]"))return;const r=document.createElement("div");r.className="cuadra-flex",document.body.appendChild(r);const t=window.getComputedStyle(r).display==="flex";if(document.body.removeChild(r),t)return;const a=document.createElement("link");a.setAttribute("data-cuadra-uikit","true"),a.rel="stylesheet",a.type="text/css";const i=["/node_modules/@cuadra-ai/uikit/dist/uikit.css",new URL("../dist/uikit.css",typeof document>"u"?require("url").pathToFileURL(__filename).href:fe&&fe.tagName.toUpperCase()==="SCRIPT"&&fe.src||new URL("index.cjs",document.baseURI).href).href];let o=!1;for(const n of i)if(a.href=n,a.onload=()=>{o=!0},a.onerror=()=>{},document.head.appendChild(a),o)break},[])}const Ki=y.forwardRef(function({config:r},t){Xi();const a=y.useRef(null),i=y.useRef(!1),{baseUrl:o,proxyUrl:n,sessionToken:c,mode:s="multiChat",modelMode:l="fixed",modelId:f,onModelChange:d,ephemeral:p=!1,systemPrompt:g,enableReasoning:m=!1,initialThreadId:k,welcomeTitle:x,welcomeSubtitle:b,extraTopPadding:w,suggestions:v,inputPlaceholder:R,preMadeResponseDelay:I=1e3,streamingSpeed:C=50,showThemeToggle:L=!0,initialMessage:D,initialPreMadeQA:A,theme:h="system",onError:U,onChatCreated:F,onUserMessage:V,onThreadIdUpdate:X,onLogout:ke,enableAttachments:we=!1,onBeforeRequest:Q,mockResponseOnBlocked:j}=r;y.useImperativeHandle(t,()=>({sendMessage:T=>{a.current?.sendMessage(T)},sendPreMadeQA:(T,_,z)=>{a.current?.sendPreMadeQA(T,_,z)},clearChat:()=>{a.current?.clearChat()}}),[]),y.useEffect(()=>{if(i.current)return;const T=setTimeout(()=>{A?(i.current=!0,a.current?.sendPreMadeQA(A.question,A.answer,{delay:I,streamingSpeed:C})):D&&(i.current=!0,a.current?.sendMessage(D))},500);return()=>clearTimeout(T)},[D,A,I,C]);const[S,E]=y.useState(!1),[P,q]=y.useState(null),[N,W]=y.useState(null),[H,re]=y.useState(!1),oe=y.useRef(null),se=T=>{if(T<30)return!0;if(oe.current){const _=oe.current.getBoundingClientRect();if(T-_.left<30)return!0}return!1},G=T=>{const z=T.touches[0].clientX;(se(z)||S)&&(q(z),W(z),re(!0))},ve=T=>{if(P===null||!H)return;const _=T.touches[0];W(_.clientX)},at=()=>{if(P===null||N===null){re(!1);return}const T=N-P,_=50,z=.3,lt=Math.abs(T)/300;T>_&&!S&&P!==null?se(P)&&E(!0):((T<-_||T<0&&lt>z)&&S||S&&T<-20&&lt>z)&&E(!1),q(null),W(null),re(!1)},fr=()=>{if(H&&P!==null&&N!==null){const T=N-P;if(S)return`translateX(${Math.min(0,T)}px)`;if(P!==null&&se(P))return`translateX(${Math.min(0,-320+T)}px)`}return S?"translateX(0)":"translateX(-100%)"},hr=()=>{if(!H||P===null||N===null)return S?.5:0;const _=N-P;return S?Math.max(0,Math.min(1,(320+_)/320))*.5:P!==null&&se(P)?Math.max(0,Math.min(1,(_+320)/320))*.5:0},Ce=n||o||"",je=!!n,nt=y.useMemo(()=>new Pt(Ce,c||void 0,je),[Ce,c,je]),[ce,mr]=y.useState(null),[he,it]=y.useState(!1),[me,ot]=y.useState(null),[pr,st]=y.useState(!1);y.useEffect(()=>{s==="multiChat"&&st(!0)},[s]);const ue=y.useCallback(async()=>{if(l==="selector"){it(!0),ot(null);try{const T=await nt.listModels();mr(T)}catch(T){ot(T instanceof Error?T:new Error("Failed to load models"))}finally{it(!1)}}},[nt,l]);y.useEffect(()=>{l==="selector"&&ue()},[l,ue]),y.useEffect(()=>(typeof window<"u"&&(window.__cuadraUIKitRefetchModels=ue),()=>{typeof window<"u"&&delete window.__cuadraUIKitRefetchModels}),[ue]);const[Z,ct]=y.useState(l==="fixed"&&f||null),ut=y.useRef(Z),pe=y.useCallback(T=>{const _=ut.current;ct(T),ut.current=T,d?.(T),_!==null&&_!==T&&s==="multiChat"&&setTimeout(()=>{const z=window.__cuadraThreadListRuntime;if(z?.threads?.switchToNewThread)try{z.threads.switchToNewThread()}catch{}else if(z?.threads?.createThread)try{z.threads.createThread()}catch{}else if(z?.switchToNewThread)try{z.switchToNewThread()}catch{}},100)},[d,s]);y.useEffect(()=>{if(l==="selector"&&ce?.items&&ce.items.length>0&&!Z){const T=ce.items[0];if(T?.id){const _=T.id;ct(_),d?.(_)}}},[l,ce?.items,Z,d]);const gr=l==="fixed"?!!f:!!Z,Te=y.useMemo(()=>(ce?.items||[]).filter(T=>T?.id&&T?.displayName).map(T=>({id:T.id,name:T.displayName})),[ce]),_e=y.useMemo(()=>({currentModelId:Z||"",models:Te,modelsLoading:he,modelsError:me,onModelChange:pe,refetchModels:ue}),[Z,Te,he,me,pe,ue]);return l==="selector"&&he||s==="multiChat"&&pr?u.jsx(We,{value:_e,children:u.jsx(Be,{className:"cuadra-h-full",paddingX:"cuadra-px-0",paddingY:"cuadra-py-0",children:u.jsx("div",{className:"cuadra-flex cuadra-items-center cuadra-justify-center cuadra-h-full",children:u.jsx(It,{className:"cuadra-h-6 cuadra-w-6 cuadra-animate-spin cuadra-text-muted-foreground"})})})}):l==="selector"&&!gr&&me?u.jsx(We,{value:_e,children:u.jsx(Be,{className:"cuadra-h-full",paddingX:"cuadra-px-0",paddingY:"cuadra-py-0",children:u.jsx("div",{className:"cuadra-flex cuadra-items-center cuadra-justify-center cuadra-h-full",children:u.jsx("div",{className:"cuadra-flex cuadra-flex-col cuadra-items-center cuadra-gap-2",children:u.jsx("p",{className:"cuadra-text-sm cuadra-text-destructive font-brand",children:"Failed to load models"})})})})}):u.jsx("div",{className:"cuadra-uikit cuadra-h-full cuadra-w-full",style:{height:"100%",width:"100%"},children:u.jsx(We,{value:_e,children:u.jsx(ta,{baseUrl:je?Ce:o||Ce,sessionToken:c,isProxyMode:je,mode:s,modelMode:l,modelId:Z||f||void 0,onModelChange:pe,ephemeral:p,systemPrompt:g,enableReasoning:m,initialThreadId:k,enableAttachments:we,onError:U,onChatCreated:F,onUserMessage:V,onThreadIdUpdate:X,onBeforeRequest:Q,mockResponseOnBlocked:j,onChatsLoaded:()=>{s==="multiChat"&&st(!1)},children:u.jsx(Be,{paddingX:"cuadra-px-0",paddingY:"cuadra-py-0",className:`cuadra-h-full ${r.containerClass||""}`,borderSizePx:4,style:{height:"100%"},children:u.jsx("div",{className:"cuadra-h-full cuadra-flex cuadra-relative",style:{height:"100%"},onTouchStart:G,onTouchMove:ve,onTouchEnd:at,children:s==="multiChat"?u.jsxs(u.Fragment,{children:[typeof document<"u"&&qe.createPortal(u.jsx("div",{className:`cuadra-fixed cuadra-inset-0 cuadra-bg-black cuadra-z-40 md:cuadra-hidden cuadra-transition-opacity cuadra-duration-300 ${S||H?"":"cuadra-pointer-events-none"}`,style:{opacity:hr()},onClick:()=>E(!1)}),document.body),typeof document<"u"&&u.jsxs(u.Fragment,{children:[u.jsx("div",{className:"cuadra-hidden md:cuadra-block !cuadra-border-r cuadra-border-border cuadra-flex cuadra-flex-col cuadra-bg-background cuadra-transition-all cuadra-duration-300 cuadra-ease-in-out cuadra-h-full cuadra-w-80 cuadra-relative",style:{borderRightWidth:"1px",height:"100%"},children:u.jsx(Tt,{onThreadSelect:()=>E(!1),showThemeToggle:L,theme:h,onLogout:ke})}),typeof document<"u"&&qe.createPortal(u.jsx("div",{className:`cuadra-block md:cuadra-hidden !cuadra-border-r cuadra-border-border cuadra-flex cuadra-flex-col cuadra-bg-background cuadra-h-screen cuadra-w-80 cuadra-fixed cuadra-z-50 cuadra-top-0 cuadra-left-0 ${S||H?"":"cuadra-pointer-events-none"}`,style:{borderRightWidth:"1px",transform:fr(),transition:H?"none":"transform 0.3s ease-in-out"},onTouchStart:G,onTouchMove:ve,onTouchEnd:at,children:u.jsx(Tt,{onThreadSelect:()=>E(!1),showThemeToggle:L,theme:h,onLogout:ke})}),document.body)]}),u.jsxs("div",{ref:oe,className:"cuadra-flex-1 cuadra-flex cuadra-flex-col",children:[l==="selector"&&u.jsx(Mt,{currentModel:Z||"",models:Te,modelsLoading:he,modelsError:me,onModelChange:pe,showThemeToggle:L,theme:h,onMobileMenuClick:()=>E(!S),showMobileMenuButton:s==="multiChat"}),u.jsx("div",{className:"cuadra-flex-1 cuadra-relative cuadra-min-h-0 cuadra-space-y-4 cuadra-p-4",children:u.jsx(jt,{ref:a,welcomeTitle:x,welcomeSubtitle:b,extraTopPadding:w,suggestions:v,inputPlaceholder:R,enableAttachments:we,preMadeResponseDelay:I,streamingSpeed:C})})]})]}):u.jsxs("div",{className:"cuadra-flex-1 cuadra-flex cuadra-flex-col",children:[l==="selector"&&u.jsx(Mt,{currentModel:Z||"",models:Te,modelsLoading:he,modelsError:me,onModelChange:pe,showThemeToggle:L,theme:h}),u.jsx("div",{className:"cuadra-flex-1 cuadra-relative cuadra-min-h-0 cuadra-space-y-4 cuadra-p-4",children:u.jsx(jt,{ref:a,welcomeTitle:x,welcomeSubtitle:b,extraTopPadding:w,suggestions:v,inputPlaceholder:R,preMadeResponseDelay:I,streamingSpeed:C})})]})})})})})})});function lr(e,r=":root"){if(typeof document>"u")return;const t=document.documentElement;if(e.light&&Gi(e.light,t),e.dark){let a=document.getElementById("cuadra-theme-dark");a||(a=document.createElement("style"),a.id="cuadra-theme-dark",document.head.appendChild(a));const i=Zi(e.dark);a.textContent=`.dark { ${i} }`}}const Qi={background:"background",foreground:"foreground",card:"card",cardForeground:"card-foreground",popover:"popover",popoverForeground:"popover-foreground",primary:"primary",primaryForeground:"primary-foreground",primaryLight:"primary-light",primaryLighter:"primary-lighter",secondary:"secondary",secondaryForeground:"secondary-foreground",muted:"muted",mutedForeground:"muted-foreground",accent:"accent",accentForeground:"accent-foreground",border:"border",input:"input",ring:"ring",destructive:"destructive",destructiveForeground:"destructive-foreground",success:"success",successForeground:"success-foreground",info:"info",infoForeground:"info-foreground",warning:"warning",warningForeground:"warning-foreground"};function dr(e){const r=Qi[e];return r?`--cuadra-${r}`:`--cuadra-${e.replace(/([A-Z])/g,"-$1").toLowerCase()}`}function Gi(e,r){Object.entries(e).forEach(([t,a])=>{if(a){const i=dr(t);r.style.setProperty(i,a)}})}function Zi(e){return Object.entries(e).map(([r,t])=>t?`${dr(r)}: ${t};`:"").filter(Boolean).join(" ")}function Ji(){if(typeof document>"u")return;const e=document.documentElement;Array.from(e.style).filter(a=>a.startsWith("--cuadra-")).forEach(a=>e.style.removeProperty(a));const t=document.getElementById("cuadra-theme-dark");t&&t.remove()}const Yi=y.forwardRef(function(r,t){const a=y.useRef(null);y.useEffect(()=>{r.customTheme&&lr(r.customTheme)},[r.customTheme]),y.useImperativeHandle(t,()=>({sendMessage:o=>{a.current?.sendMessage(o)},sendPreMadeQA:(o,n,c)=>{a.current?.sendPreMadeQA(o,n,c)},clearChat:()=>{a.current?.clearChat()}}),[]),y.useEffect(()=>(typeof window<"u"&&(window.__cuadraChatControls={sendMessage:o=>a.current?.sendMessage(o),sendPreMadeQA:(o,n,c)=>a.current?.sendPreMadeQA(o,n,c),clearChat:()=>a.current?.clearChat()}),()=>{typeof window<"u"&&delete window.__cuadraChatControls}),[]);const i={baseUrl:r.baseUrl,proxyUrl:r.proxyUrl,sessionToken:r.sessionToken||null,mode:r.mode||"multiChat",modelMode:r.modelMode||"fixed",modelId:r.modelId,onModelChange:r.onModelChange,ephemeral:r.ephemeral,systemPrompt:r.systemPrompt,enableReasoning:r.enableReasoning,initialThreadId:r.initialThreadId,language:r.language,welcomeTitle:r.welcomeTitle,welcomeSubtitle:r.welcomeSubtitle,extraTopPadding:r.extraTopPadding,suggestions:r.suggestions,inputPlaceholder:r.inputPlaceholder,preMadeResponseDelay:r.preMadeResponseDelay,streamingSpeed:r.streamingSpeed,onError:r.onError,onChatCreated:r.onChatCreated,onUserMessage:r.onUserMessage,onThreadIdUpdate:r.onThreadIdUpdate,showThemeToggle:r.showThemeToggle,theme:r.theme,onLogout:r.onLogout,enableAttachments:r.enableAttachments,containerClass:r.className,initialMessage:r.initialMessage,initialPreMadeQA:r.initialPreMadeQA,onBeforeRequest:r.onBeforeRequest,mockResponseOnBlocked:r.mockResponseOnBlocked};return u.jsx(Ki,{ref:a,config:i})});exports.Badge=rt;exports.CuadraChat=Yi;exports.SourceCitations=cr;exports.applyTheme=lr;exports.removeTheme=Ji;exports.streamingMetadataStore=J;
22
+ `,Os=({children:e,className:t="",paddingX:r="px-0",paddingY:n="py-0",borderSizePx:a=4,style:i,contentStyle:o,rotating:s=!1})=>_.jsxs(_.Fragment,{children:[_.jsx("style",{children:UR}),_.jsxs("div",{className:`cuadra-relative cuadra-bg-background md:cuadra-rounded-xl cuadra-overflow-hidden ${t}`,style:{padding:a,...i},children:[_.jsx("div",{className:`cuadra-absolute md:cuadra-rounded-xl cuadra-textured-card-border ${s?"cuadra-textured-card-border-rotating":""}`,style:s?{left:"-100%",top:"-100%",width:"300%",height:"300%",backgroundRepeat:"no-repeat",backgroundSize:"cover",backgroundPosition:"center",animation:"rotate 4s linear infinite"}:{backgroundSize:"cover",backgroundPosition:"center",backgroundRepeat:"no-repeat",top:"0",left:"0",width:"100%",height:"100%"}}),_.jsx("div",{className:`cuadra-relative cuadra-bg-background cuadra-h-full cuadra-z-10 cuadra-flex cuadra-flex-col cuadra-overflow-hidden ${r} ${n}`,style:{borderRadius:"calc(0.75rem - 4px)",...o},children:e})]})]}),id=({currentModel:e,models:t,modelsLoading:r,modelsError:n,onModelChange:a,hideModelSelector:i=!1,showThemeToggle:o=!0,theme:s="system",onMobileMenuClick:l,showMobileMenuButton:u=!1})=>{const[d,c]=V.useState(!1),[f,p]=V.useState(!1),m=V.useRef(null);V.useEffect(()=>{const h=w=>{m.current&&!m.current.contains(w.target)&&c(!1)};return d&&document.addEventListener("mousedown",h),()=>{document.removeEventListener("mousedown",h)}},[d]);const g=t.find(h=>h.id===e),b=h=>{a(h),c(!1),p(!1)};return _.jsxs("div",{className:"cuadra-h-16 cuadra-px-4 cuadra-border-b cuadra-border-border cuadra-flex cuadra-items-center cuadra-justify-between cuadra-bg-background",children:[_.jsxs("div",{className:"cuadra-flex cuadra-items-center cuadra-gap-2",children:[u&&_.jsx("button",{type:"button",onClick:l,className:"cuadra-flex cuadra-items-center cuadra-justify-center cuadra-h-8 cuadra-w-8 cuadra-rounded-full cuadra-bg-muted hover:cuadra-bg-muted/80 cuadra-transition-colors disabled:cuadra-opacity-50 disabled:cuadra-cursor-not-allowed md:cuadra-hidden","aria-label":"Toggle thread list",children:_.jsx(jw,{className:"cuadra-h-4 cuadra-w-4 cuadra-text-foreground"})}),o&&_.jsx("div",{className:"cuadra-hidden md:cuadra-flex cuadra-items-center cuadra-gap-2",children:_.jsx(pb,{theme:s})})]}),_.jsxs("div",{className:"cuadra-flex cuadra-items-center cuadra-gap-2 md:cuadra-ml-0 cuadra-ml-auto",children:[!i&&_.jsx("label",{className:"cuadra-hidden md:cuadra-inline cuadra-text-sm cuadra-text-muted-foreground cuadra-font-brand",children:"Model"}),i?null:r?_.jsx("div",{className:"cuadra-w-48 cuadra-rounded-md cuadra-border cuadra-border-border cuadra-px-3 cuadra-py-2 cuadra-bg-muted",children:_.jsx("span",{className:"cuadra-text-muted-foreground cuadra-text-sm cuadra-font-brand",children:"Loading..."})}):n?_.jsx("div",{className:"cuadra-w-48 cuadra-rounded-md cuadra-border cuadra-border-destructive cuadra-px-3 cuadra-py-2 cuadra-bg-destructive/10",children:_.jsx("span",{className:"cuadra-text-destructive cuadra-text-sm cuadra-font-brand",children:"Failed to load models"})}):_.jsxs(_.Fragment,{children:[_.jsxs("div",{ref:m,className:"cuadra-hidden md:cuadra-block cuadra-relative cuadra-w-48",children:[_.jsxs("button",{type:"button",onClick:()=>c(!d),disabled:r||t.length===0||!!n,className:"cuadra-flex cuadra-h-10 cuadra-w-full cuadra-items-center cuadra-justify-between cuadra-rounded-md cuadra-border cuadra-border-input cuadra-bg-background cuadra-px-3 cuadra-py-2 cuadra-text-sm placeholder:cuadra-text-muted-foreground focus:cuadra-outline-none disabled:cuadra-cursor-not-allowed disabled:cuadra-opacity-50 cuadra-font-brand",children:[_.jsx("span",{className:g?"cuadra-text-foreground":"cuadra-text-muted-foreground",children:g?.name||"Select model"}),_.jsx(_l,{className:"cuadra-ml-2 cuadra-h-4 cuadra-w-4 cuadra-opacity-50"})]}),d&&t.length>0&&_.jsx("div",{className:"cuadra-absolute cuadra-z-50 cuadra-mt-1 cuadra-w-full cuadra-min-w-[8rem] cuadra-overflow-hidden cuadra-rounded-md glass-popover cuadra-text-popover-foreground cuadra-animate-in fade-in-80 cuadra-border cuadra-border-border cuadra-bg-popover cuadra-shadow-md",children:_.jsx("div",{className:"cuadra-p-1",children:t.map(h=>_.jsxs("button",{type:"button",onClick:()=>b(h.id),className:`cuadra-relative cuadra-flex cuadra-w-full cuadra-cursor-pointer cuadra-select-none cuadra-items-center cuadra-rounded-sm cuadra-py-1.5 cuadra-pl-8 cuadra-pr-2 cuadra-text-sm cuadra-outline-none focus:cuadra-bg-secondary focus:cuadra-text-secondary-foreground font-brand cuadra-transition-colors ${e===h.id?"cuadra-bg-secondary cuadra-text-secondary-foreground":"hover:cuadra-bg-secondary/50"}`,children:[e===h.id&&_.jsx("span",{className:"cuadra-absolute cuadra-left-2 cuadra-flex cuadra-h-3.5 cuadra-w-3.5 cuadra-items-center cuadra-justify-center",children:_.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",fill:"none",viewBox:"0 0 16 16",children:_.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M6.47 10.03a.75.75 0 0 1-1.06-1.06l2-2a.75.75 0 0 1 1.06 0l2 2a.75.75 0 1 1-1.06 1.06L8 9.06l-1.53 1.53Z",clipRule:"evenodd"})})}),_.jsx("span",{children:h.name})]},h.id))})})]}),_.jsxs("button",{type:"button",onClick:()=>p(!0),disabled:r||t.length===0||!!n,className:"cuadra-flex md:cuadra-hidden cuadra-h-10 cuadra-w-full cuadra-items-center cuadra-justify-between cuadra-rounded-md cuadra-border cuadra-border-input cuadra-bg-background cuadra-px-3 cuadra-py-2 cuadra-text-sm placeholder:cuadra-text-muted-foreground focus:cuadra-outline-none disabled:cuadra-cursor-not-allowed disabled:cuadra-opacity-50 cuadra-font-brand",children:[_.jsx("span",{className:g?"cuadra-text-foreground":"cuadra-text-muted-foreground",children:g?.name||"Select model"}),_.jsx(_l,{className:"cuadra-ml-2 cuadra-h-4 cuadra-w-4 cuadra-opacity-50"})]}),f&&typeof document<"u"&&ir.createPortal(_.jsxs(_.Fragment,{children:[_.jsx("div",{className:"cuadra-fixed cuadra-inset-0 cuadra-bg-black/50 cuadra-z-50 md:cuadra-hidden",onClick:()=>p(!1)}),_.jsxs("div",{className:"cuadra-fixed cuadra-inset-0 cuadra-z-50 cuadra-flex cuadra-flex-col cuadra-bg-background md:cuadra-hidden",children:[_.jsxs("div",{className:"cuadra-flex cuadra-items-center cuadra-justify-between cuadra-border-b cuadra-border-border cuadra-px-4 cuadra-py-4",children:[_.jsx("h2",{className:"cuadra-text-lg cuadra-font-normal cuadra-text-foreground font-brand",children:"Select Model"}),_.jsx("button",{type:"button",onClick:()=>p(!1),className:"cuadra-flex cuadra-items-center cuadra-justify-center cuadra-h-8 cuadra-w-8 cuadra-rounded-full cuadra-bg-muted hover:cuadra-bg-muted/80 cuadra-transition-colors","aria-label":"Close",children:_.jsx(vu,{className:"cuadra-h-4 cuadra-w-4 cuadra-text-foreground"})})]}),_.jsx("div",{className:"cuadra-flex-1 cuadra-overflow-y-auto cuadra-p-4",children:r?_.jsx("div",{className:"cuadra-flex cuadra-items-center cuadra-justify-center cuadra-py-8",children:_.jsx("span",{className:"cuadra-text-muted-foreground cuadra-text-sm cuadra-font-brand",children:"Loading models..."})}):n?_.jsx("div",{className:"cuadra-flex cuadra-items-center cuadra-justify-center cuadra-py-8",children:_.jsx("span",{className:"cuadra-text-destructive cuadra-text-sm cuadra-font-brand",children:"Failed to load models"})}):t.length===0?_.jsx("div",{className:"cuadra-flex cuadra-items-center cuadra-justify-center cuadra-py-8",children:_.jsx("span",{className:"cuadra-text-muted-foreground cuadra-text-sm cuadra-font-brand",children:"No models available"})}):_.jsx("div",{className:"cuadra-space-y-2",children:t.map(h=>_.jsxs("button",{type:"button",onClick:()=>b(h.id),className:`cuadra-w-full cuadra-flex cuadra-items-center cuadra-justify-between cuadra-rounded-lg cuadra-border cuadra-px-4 cuadra-py-4 cuadra-text-left cuadra-transition-colors font-brand cuadra-bg-background cuadra-text-foreground cuadra-border-border hover:cuadra-bg-muted ${e===h.id?"cuadra-border-primary":""}`,children:[_.jsx("span",{className:"cuadra-text-base cuadra-font-normal",children:h.name}),e===h.id&&_.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",fill:"none",viewBox:"0 0 20 20",className:"cuadra-text-primary",children:_.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M16.707 5.293a1 1 0 0 1 0 1.414l-8 8a1 1 0 0 1-1.414 0l-4-4a1 1 0 0 1 1.414-1.414L8 12.586l7.293-7.293a1 1 0 0 1 1.414 0Z",clipRule:"evenodd"})})]},h.id))})})]})]}),document.body)]})]})]})},WR=V.createContext(void 0),Ns=({children:e,value:t})=>_.jsx(WR.Provider,{value:t,children:e});function VR(){V.useEffect(()=>{if(document.querySelector("style[data-cuadra-uikit]"))return;const t=document.createElement("div");t.className="cuadra-flex",document.body.appendChild(t);const r=window.getComputedStyle(t).display==="flex";if(document.body.removeChild(t),r)return;const n=document.createElement("link");n.setAttribute("data-cuadra-uikit","true"),n.rel="stylesheet",n.type="text/css";const a=["/node_modules/@cuadra-ai/uikit/dist/uikit.css",new URL("../dist/uikit.css",typeof document>"u"?require("url").pathToFileURL(__filename).href:Pr&&Pr.tagName.toUpperCase()==="SCRIPT"&&Pr.src||new URL("index.cjs",document.baseURI).href).href];let i=!1;for(const o of a)if(n.href=o,n.onload=()=>{i=!0},n.onerror=()=>{},document.head.appendChild(n),i)break},[])}const HR=V.forwardRef(function({config:t},r){VR();const n=V.useRef(null),a=V.useRef(!1),{baseUrl:i,proxyUrl:o,sessionToken:s,mode:l="multiChat",modelMode:u="fixed",modelId:d,onModelChange:c,ephemeral:f=!1,systemPrompt:p,enableReasoning:m=!1,initialThreadId:g,welcomeTitle:b,welcomeSubtitle:h,extraTopPadding:w,suggestions:x,inputPlaceholder:T,preMadeResponseDelay:E=1e3,streamingSpeed:y=50,showThemeToggle:v=!0,initialMessage:R,initialPreMadeQA:k,theme:P="system",onError:M,onChatCreated:F,onUserMessage:j,onThreadIdUpdate:D,onLogout:J,enableAttachments:B=!1,onBeforeRequest:Y,mockResponseOnBlocked:L}=t;V.useImperativeHandle(r,()=>({sendMessage:U=>{n.current?.sendMessage(U)},sendPreMadeQA:(U,ee,te)=>{n.current?.sendPreMadeQA(U,ee,te)},clearChat:()=>{n.current?.clearChat()}}),[]),V.useEffect(()=>{if(a.current)return;const U=setTimeout(()=>{k?(a.current=!0,n.current?.sendPreMadeQA(k.question,k.answer,{delay:E,streamingSpeed:y})):R&&(a.current=!0,n.current?.sendMessage(R))},500);return()=>clearTimeout(U)},[R,k,E,y]);const[Z,ae]=V.useState(!1),[ne,fe]=V.useState(null),[H,me]=V.useState(null),[ce,se]=V.useState(!1),Se=V.useRef(null),Me=U=>{if(U<30)return!0;if(Se.current){const ee=Se.current.getBoundingClientRect();if(U-ee.left<30)return!0}return!1},q=U=>{const te=U.touches[0].clientX;(Me(te)||Z)&&(fe(te),me(te),se(!0))},Q=U=>{if(ne===null||!ce)return;const ee=U.touches[0];me(ee.clientX)},W=()=>{if(ne===null||H===null){se(!1);return}const U=H-ne,ee=50,te=.3,Ne=Math.abs(U)/300;U>ee&&!Z&&ne!==null?Me(ne)&&ae(!0):((U<-ee||U<0&&Ne>te)&&Z||Z&&U<-20&&Ne>te)&&ae(!1),fe(null),me(null),se(!1)},le=()=>{if(ce&&ne!==null&&H!==null){const U=H-ne;if(Z)return`translateX(${Math.min(0,U)}px)`;if(ne!==null&&Me(ne))return`translateX(${Math.min(0,-320+U)}px)`}return Z?"translateX(0)":"translateX(-100%)"},de=()=>{if(!ce||ne===null||H===null)return Z?.5:0;const ee=H-ne;return Z?Math.max(0,Math.min(1,(320+ee)/320))*.5:ne!==null&&Me(ne)?Math.max(0,Math.min(1,(ee+320)/320))*.5:0},X=o||i||"",_e=!!o,xe=V.useMemo(()=>new $g(X,s||void 0,_e),[X,s,_e]),[Oe,Zt]=V.useState(null),[wt,Le]=V.useState(!1),[Xe,er]=V.useState(null),[Vr,O]=V.useState(!1);V.useEffect(()=>{l==="multiChat"&&O(!0)},[l]);const N=V.useCallback(async()=>{if(u==="selector"){Le(!0),er(null);try{const U=await xe.listModels();Zt(U)}catch(U){er(U instanceof Error?U:new Error("Failed to load models"))}finally{Le(!1)}}},[xe,u]);V.useEffect(()=>{u==="selector"&&N()},[u,N]),V.useEffect(()=>(typeof window<"u"&&(window.__cuadraUIKitRefetchModels=N),()=>{typeof window<"u"&&delete window.__cuadraUIKitRefetchModels}),[N]);const[z,G]=V.useState(u==="fixed"&&d||null),A=V.useRef(z),oe=V.useCallback(U=>{const ee=A.current;G(U),A.current=U,c?.(U),ee!==null&&ee!==U&&l==="multiChat"&&setTimeout(()=>{const te=window.__cuadraThreadListRuntime;if(te?.threads?.switchToNewThread)try{te.threads.switchToNewThread()}catch{}else if(te?.threads?.createThread)try{te.threads.createThread()}catch{}else if(te?.switchToNewThread)try{te.switchToNewThread()}catch{}},100)},[c,l]);V.useEffect(()=>{if(u==="selector"&&Oe?.items&&Oe.items.length>0&&!z){const U=Oe.items[0];if(U?.id){const ee=U.id;G(ee),c?.(ee)}}},[u,Oe?.items,z,c]);const je=u==="fixed"?!!d:!!z,Pe=V.useMemo(()=>(Oe?.items||[]).filter(U=>U?.id&&U?.displayName).map(U=>({id:U.id,name:U.displayName})),[Oe]),ze=V.useMemo(()=>({currentModelId:z||"",models:Pe,modelsLoading:wt,modelsError:Xe,onModelChange:oe,refetchModels:N}),[z,Pe,wt,Xe,oe,N]);return u==="selector"&&wt||l==="multiChat"&&Vr?_.jsx(Ns,{value:ze,children:_.jsx(Os,{className:"cuadra-h-full",paddingX:"cuadra-px-0",paddingY:"cuadra-py-0",children:_.jsx("div",{className:"cuadra-flex cuadra-items-center cuadra-justify-center cuadra-h-full",children:_.jsx(Og,{className:"cuadra-h-6 cuadra-w-6 cuadra-animate-spin cuadra-text-muted-foreground"})})})}):u==="selector"&&!je&&Xe?_.jsx(Ns,{value:ze,children:_.jsx(Os,{className:"cuadra-h-full",paddingX:"cuadra-px-0",paddingY:"cuadra-py-0",children:_.jsx("div",{className:"cuadra-flex cuadra-items-center cuadra-justify-center cuadra-h-full",children:_.jsx("div",{className:"cuadra-flex cuadra-flex-col cuadra-items-center cuadra-gap-2",children:_.jsx("p",{className:"cuadra-text-sm cuadra-text-destructive font-brand",children:"Failed to load models"})})})})}):_.jsx("div",{className:"cuadra-uikit cuadra-h-full cuadra-w-full",style:{height:"100%",width:"100%"},children:_.jsx(Ns,{value:ze,children:_.jsx(ex,{baseUrl:_e?X:i||X,sessionToken:s,isProxyMode:_e,mode:l,modelMode:u,modelId:z||d||void 0,onModelChange:oe,ephemeral:f,systemPrompt:p,enableReasoning:m,initialThreadId:g,enableAttachments:B,onError:M,onChatCreated:F,onUserMessage:j,onThreadIdUpdate:D,onBeforeRequest:Y,mockResponseOnBlocked:L,onChatsLoaded:()=>{l==="multiChat"&&O(!1)},children:_.jsx(Os,{paddingX:"cuadra-px-0",paddingY:"cuadra-py-0",className:`cuadra-h-full ${t.containerClass||""}`,borderSizePx:4,style:{height:"100%"},children:_.jsx("div",{className:"cuadra-h-full cuadra-flex cuadra-relative",style:{height:"100%"},onTouchStart:q,onTouchMove:Q,onTouchEnd:W,children:l==="multiChat"?_.jsxs(_.Fragment,{children:[typeof document<"u"&&ir.createPortal(_.jsx("div",{className:`cuadra-fixed cuadra-inset-0 cuadra-bg-black cuadra-z-40 md:cuadra-hidden cuadra-transition-opacity cuadra-duration-300 ${Z||ce?"":"cuadra-pointer-events-none"}`,style:{opacity:de()},onClick:()=>ae(!1)}),document.body),typeof document<"u"&&_.jsxs(_.Fragment,{children:[_.jsx("div",{className:"cuadra-hidden md:cuadra-block !cuadra-border-r cuadra-border-border cuadra-flex cuadra-flex-col cuadra-bg-background cuadra-transition-all cuadra-duration-300 cuadra-ease-in-out cuadra-h-full cuadra-w-80 cuadra-relative",style:{borderRightWidth:"1px",height:"100%"},children:_.jsx(od,{onThreadSelect:()=>ae(!1),showThemeToggle:v,theme:P,onLogout:J})}),typeof document<"u"&&ir.createPortal(_.jsx("div",{className:`cuadra-block md:cuadra-hidden !cuadra-border-r cuadra-border-border cuadra-flex cuadra-flex-col cuadra-bg-background cuadra-h-screen cuadra-w-80 cuadra-fixed cuadra-z-50 cuadra-top-0 cuadra-left-0 ${Z||ce?"":"cuadra-pointer-events-none"}`,style:{borderRightWidth:"1px",transform:le(),transition:ce?"none":"transform 0.3s ease-in-out"},onTouchStart:q,onTouchMove:Q,onTouchEnd:W,children:_.jsx(od,{onThreadSelect:()=>ae(!1),showThemeToggle:v,theme:P,onLogout:J})}),document.body)]}),_.jsxs("div",{ref:Se,className:"cuadra-flex-1 cuadra-flex cuadra-flex-col",children:[u==="selector"&&_.jsx(id,{currentModel:z||"",models:Pe,modelsLoading:wt,modelsError:Xe,onModelChange:oe,showThemeToggle:v,theme:P,onMobileMenuClick:()=>ae(!Z),showMobileMenuButton:l==="multiChat"}),_.jsx("div",{className:"cuadra-flex-1 cuadra-relative cuadra-min-h-0 cuadra-space-y-4 cuadra-p-4",children:_.jsx(ad,{ref:n,welcomeTitle:b,welcomeSubtitle:h,extraTopPadding:w,suggestions:x,inputPlaceholder:T,enableAttachments:B,preMadeResponseDelay:E,streamingSpeed:y})})]})]}):_.jsxs("div",{className:"cuadra-flex-1 cuadra-flex cuadra-flex-col",children:[u==="selector"&&_.jsx(id,{currentModel:z||"",models:Pe,modelsLoading:wt,modelsError:Xe,onModelChange:oe,showThemeToggle:v,theme:P}),_.jsx("div",{className:"cuadra-flex-1 cuadra-relative cuadra-min-h-0 cuadra-space-y-4 cuadra-p-4",children:_.jsx(ad,{ref:n,welcomeTitle:b,welcomeSubtitle:h,extraTopPadding:w,suggestions:x,inputPlaceholder:T,preMadeResponseDelay:E,streamingSpeed:y})})]})})})})})})});function mb(e,t=":root"){if(typeof document>"u")return;const r=document.documentElement;if(e.light&&KR(e.light,r),e.dark){let n=document.getElementById("cuadra-theme-dark");n||(n=document.createElement("style"),n.id="cuadra-theme-dark",document.head.appendChild(n));const a=JR(e.dark);n.textContent=`.dark { ${a} }`}}const GR={background:"background",foreground:"foreground",card:"card",cardForeground:"card-foreground",popover:"popover",popoverForeground:"popover-foreground",primary:"primary",primaryForeground:"primary-foreground",primaryLight:"primary-light",primaryLighter:"primary-lighter",secondary:"secondary",secondaryForeground:"secondary-foreground",muted:"muted",mutedForeground:"muted-foreground",accent:"accent",accentForeground:"accent-foreground",border:"border",input:"input",ring:"ring",destructive:"destructive",destructiveForeground:"destructive-foreground",success:"success",successForeground:"success-foreground",info:"info",infoForeground:"info-foreground",warning:"warning",warningForeground:"warning-foreground"};function hb(e){const t=GR[e];return t?`--cuadra-${t}`:`--cuadra-${e.replace(/([A-Z])/g,"-$1").toLowerCase()}`}function KR(e,t){Object.entries(e).forEach(([r,n])=>{if(n){const a=hb(r);t.style.setProperty(a,n)}})}function JR(e){return Object.entries(e).map(([t,r])=>r?`${hb(t)}: ${r};`:"").filter(Boolean).join(" ")}function XR(){if(typeof document>"u")return;const e=document.documentElement;Array.from(e.style).filter(n=>n.startsWith("--cuadra-")).forEach(n=>e.style.removeProperty(n));const r=document.getElementById("cuadra-theme-dark");r&&r.remove()}function YR({onReset:e,error:t}){return _.jsxs("div",{className:"cuadra-flex cuadra-flex-col cuadra-items-center cuadra-justify-center cuadra-h-full cuadra-p-6 cuadra-text-center",children:[_.jsx("div",{className:"cuadra-mb-4",children:_.jsx("svg",{className:"cuadra-w-12 cuadra-h-12 cuadra-text-destructive cuadra-mx-auto",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:_.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"})})}),_.jsx("h3",{className:"cuadra-text-lg cuadra-font-medium cuadra-text-foreground cuadra-mb-2",children:"Something went wrong"}),_.jsx("p",{className:"cuadra-text-sm cuadra-text-muted-foreground cuadra-mb-4 cuadra-max-w-sm",children:t?.message||"An unexpected error occurred. Please try again."}),_.jsx("button",{onClick:e,className:"cuadra-px-4 cuadra-py-2 cuadra-text-sm cuadra-font-medium cuadra-rounded-md cuadra-transition-colors",style:{backgroundColor:"var(--cuadra-primary)",color:"hsl(var(--cuadra-primary-foreground))"},children:"Try Again"})]})}class QR extends V.Component{constructor(r){super(r);re(this,"reset",()=>{this.setState({hasError:!1,error:null})});this.state={hasError:!1,error:null}}static getDerivedStateFromError(r){return{hasError:!0,error:r}}componentDidCatch(r,n){this.props.onError?.(r,n)}render(){if(this.state.hasError){const{fallback:r}=this.props,{error:n}=this.state;return typeof r=="function"?r(n,this.reset):r||_.jsx(YR,{error:n,onReset:this.reset})}return this.props.children}}const Lr=V.createContext(null);Lr.displayName="CuadraChatContext";function ZR(){const e=V.useContext(Lr);if(e===null)throw new Error("useCuadraChat must be used within a CuadraChatProvider. Wrap your component tree with <CuadraChatProvider>...</CuadraChatProvider>");return{controls:e.controls,isReady:e.controls!==null}}function eC(){const e=V.useContext(Lr);return e===null?null:{controls:e.controls,isReady:e.controls!==null}}function _u({children:e}){const[t,r]=V.useState(null),n=V.useCallback(o=>{r(o)},[]),a=V.useCallback(()=>{r(null)},[]),i={controls:t,registerControls:n,unregisterControls:a};return _.jsx(Lr.Provider,{value:i,children:e})}function gb(e){return"connection"in e&&typeof e.connection=="object"}function bb(e){return gb(e)?tC(e):rC(e)}function tC(e){return{connection:{baseUrl:e.connection.baseUrl||"",proxyUrl:e.connection.proxyUrl||"",sessionToken:e.connection.sessionToken??null},chat:{mode:e.chat?.mode??"multiChat",modelMode:e.chat?.modelMode??"fixed",modelId:e.chat?.modelId??"",systemPrompt:e.chat?.systemPrompt??"",ephemeral:e.chat?.ephemeral??!1,enableReasoning:e.chat?.enableReasoning??!1,enableAttachments:e.chat?.enableAttachments??!1,initialThreadId:e.chat?.initialThreadId},ui:{theme:e.ui?.theme??"system",customTheme:e.ui?.customTheme,showThemeToggle:e.ui?.showThemeToggle??!0,language:e.ui?.language,welcomeTitle:e.ui?.welcomeTitle??"Hi, how can I help you today?",welcomeSubtitle:e.ui?.welcomeSubtitle??"Start exploring our platform and discover what you can build.",suggestions:e.ui?.suggestions,inputPlaceholder:e.ui?.inputPlaceholder??"Type your message...",extraTopPadding:e.ui?.extraTopPadding},preMade:{responseDelay:e.preMade?.responseDelay??1e3,streamingSpeed:e.preMade?.streamingSpeed??50},initial:{message:e.initial?.message,preMadeQA:e.initial?.preMadeQA},interceptors:{onBeforeRequest:e.interceptors?.onBeforeRequest,mockResponseOnBlocked:e.interceptors?.mockResponseOnBlocked},callbacks:{onChatCreated:e.callbacks?.onChatCreated,onError:e.callbacks?.onError,onUserMessage:e.callbacks?.onUserMessage,onModelChange:e.callbacks?.onModelChange,onThreadIdUpdate:e.callbacks?.onThreadIdUpdate,onLogout:e.callbacks?.onLogout},className:e.className,errorFallback:e.errorFallback}}function rC(e){return typeof process<"u"&&process.env?.NODE_ENV==="development"&&console.warn(`[CuadraUIKit] Using legacy flat props format. Consider migrating to grouped props for better organization.
23
+ See: https://docs.cuadra.ai/guides/uikit-migration`),{connection:{baseUrl:e.baseUrl||"",proxyUrl:e.proxyUrl||"",sessionToken:e.sessionToken??null},chat:{mode:e.mode??"multiChat",modelMode:e.modelMode??"fixed",modelId:e.modelId??"",systemPrompt:e.systemPrompt??"",ephemeral:e.ephemeral??!1,enableReasoning:e.enableReasoning??!1,enableAttachments:e.enableAttachments??!1,initialThreadId:e.initialThreadId},ui:{theme:e.theme??"system",customTheme:e.customTheme,showThemeToggle:e.showThemeToggle??!0,language:e.language,welcomeTitle:e.welcomeTitle??"Hi, how can I help you today?",welcomeSubtitle:e.welcomeSubtitle??"Start exploring our platform and discover what you can build.",suggestions:e.suggestions,inputPlaceholder:e.inputPlaceholder??"Type your message...",extraTopPadding:e.extraTopPadding},preMade:{responseDelay:e.preMadeResponseDelay??1e3,streamingSpeed:e.streamingSpeed??50},initial:{message:e.initialMessage,preMadeQA:e.initialPreMadeQA},interceptors:{onBeforeRequest:e.onBeforeRequest,mockResponseOnBlocked:e.mockResponseOnBlocked},callbacks:{onChatCreated:e.onChatCreated,onError:e.onError,onUserMessage:e.onUserMessage,onModelChange:e.onModelChange,onThreadIdUpdate:e.onThreadIdUpdate,onLogout:e.onLogout},className:e.className,errorFallback:e.errorFallback}}const nC=V.forwardRef(function({config:t},r){const n=V.useRef(null),a=V.useContext(Lr);V.useEffect(()=>{t.ui.customTheme&&mb(t.ui.customTheme)},[t.ui.customTheme]);const i={sendMessage:s=>n.current?.sendMessage(s),sendPreMadeQA:(s,l,u)=>n.current?.sendPreMadeQA(s,l,u),clearChat:()=>n.current?.clearChat()};V.useImperativeHandle(r,()=>i,[]),V.useEffect(()=>{if(a)return a.registerControls(i),()=>a.unregisterControls()},[a,i]),V.useEffect(()=>(typeof window<"u"&&(process.env.NODE_ENV==="development"&&console.warn("[CuadraUIKit] window.__cuadraChatControls is deprecated. Use CuadraChatProvider and useCuadraChat() hook instead. See: https://docs.cuadra.ai/guides/uikit-migration"),window.__cuadraChatControls=i),()=>{typeof window<"u"&&delete window.__cuadraChatControls}),[i]);const o={baseUrl:t.connection.baseUrl||void 0,proxyUrl:t.connection.proxyUrl||void 0,sessionToken:t.connection.sessionToken,mode:t.chat.mode,modelMode:t.chat.modelMode,modelId:t.chat.modelId||void 0,systemPrompt:t.chat.systemPrompt||void 0,ephemeral:t.chat.ephemeral,enableReasoning:t.chat.enableReasoning,enableAttachments:t.chat.enableAttachments,initialThreadId:t.chat.initialThreadId,theme:t.ui.theme,showThemeToggle:t.ui.showThemeToggle,language:t.ui.language,welcomeTitle:t.ui.welcomeTitle,welcomeSubtitle:t.ui.welcomeSubtitle,suggestions:t.ui.suggestions,inputPlaceholder:t.ui.inputPlaceholder,extraTopPadding:t.ui.extraTopPadding,containerClass:t.className,preMadeResponseDelay:t.preMade.responseDelay,streamingSpeed:t.preMade.streamingSpeed,initialMessage:t.initial.message,initialPreMadeQA:t.initial.preMadeQA,onBeforeRequest:t.interceptors.onBeforeRequest,mockResponseOnBlocked:t.interceptors.mockResponseOnBlocked,onChatCreated:t.callbacks.onChatCreated,onError:t.callbacks.onError,onUserMessage:t.callbacks.onUserMessage,onModelChange:t.callbacks.onModelChange,onThreadIdUpdate:t.callbacks.onThreadIdUpdate,onLogout:t.callbacks.onLogout};return _.jsx(HR,{ref:n,config:o})}),aC=V.forwardRef(function(t,r){const n=bb(t),a=n.errorFallback;return _.jsx(QR,{fallback:a,onError:(i,o)=>{n.callbacks.onError?.(i),process.env.NODE_ENV==="development"&&console.error("[CuadraChat] Error caught by boundary:",i,o)},children:_.jsx(nC,{ref:r,config:n})})});function or(e={}){return{id:"model-test-123",displayName:"Test Model",description:"A test model for unit testing",provider:"openai",modelName:"gpt-4",contextWindow:128e3,maxTokensPerRequest:4096,supportsStreaming:!0,enabled:!0,isSystemModel:!1,creditMultiplier:1,createdAt:"2024-01-01T00:00:00Z",updatedAt:"2024-01-01T00:00:00Z",...e}}function oC(e=[or()],t={}){return{items:e,hasMore:!1,...t}}const iC={gpt4:or({id:"model-gpt4",displayName:"GPT-4",provider:"openai",modelName:"gpt-4",contextWindow:128e3}),claude:or({id:"model-claude",displayName:"Claude 3",provider:"anthropic",modelName:"claude-3-opus",contextWindow:2e5}),reasoningModel:or({id:"model-o1",displayName:"O1",provider:"openai",modelName:"o1-preview",description:"Model with reasoning capability"}),systemModel:or({id:"model-system",displayName:"System Default",isSystemModel:!0})};function sC(e){return Array.from({length:e},(t,r)=>or({id:`model-${r+1}`,displayName:`Test Model ${r+1}`}))}function zo(e={}){return{id:"chat-test-123",modelId:"model-test-123",organizationId:"org-test-123",title:"Test Conversation",messages:[],createdAt:"2024-01-01T00:00:00Z",updatedAt:"2024-01-01T00:00:00Z",createdBy:"user-test-123",...e}}function Pu(e={}){return{id:"chat-test-123",modelId:"model-test-123",organizationId:"org-test-123",title:"Test Conversation",createdAt:"2024-01-01T00:00:00Z",updatedAt:"2024-01-01T00:00:00Z",...e}}function lC(e=[Pu()],t={}){return{items:e,hasMore:!1,...t}}function kt(e,t,r={}){return{id:`msg-${Date.now()}-${Math.random().toString(36).slice(2)}`,role:e,content:t,chatId:"chat-test-123",createdAt:new Date().toISOString(),...r}}const uC={empty:zo({id:"chat-empty",title:"New Conversation",messages:[]}),singleExchange:zo({id:"chat-single",title:"Quick Question",messages:[kt("user","Hello, how are you?"),kt("assistant","I'm doing well, thank you! How can I help you today?")]}),multipleExchanges:zo({id:"chat-multi",title:"Ongoing Discussion",messages:[kt("user","What is TypeScript?"),kt("assistant","TypeScript is a typed superset of JavaScript that compiles to plain JavaScript."),kt("user","How do I use it with React?"),kt("assistant","You can use TypeScript with React by creating .tsx files and adding type annotations to your components.")]}),withSources:zo({id:"chat-sources",title:"Research Query",messages:[kt("user","Tell me about our product pricing"),kt("assistant","Based on the documentation, here are the pricing tiers...",{metadata:{sources:[{sourceId:"src-1",filename:"pricing-guide.pdf",score:.95},{sourceId:"src-2",filename:"enterprise-plans.pdf",score:.87}]}})]})};function cC(e){return Array.from({length:e},(t,r)=>Pu({id:`chat-${r+1}`,title:`Conversation ${r+1}`}))}function ku(e){const t=[];return e.id&&t.push(`id: ${e.id}`),e.event&&t.push(`event: ${e.event}`),t.push(`data: ${e.data}`),t.push(""),t.join(`
24
+ `)+`
25
+ `}function Uo(e,t={}){const{chatId:r="chat-test-123",modelId:n="model-test-123",includeThinking:a=!1,thinkingContent:i="Let me think about this...",sources:o=[],chunkSize:s=10}=t,l=[];if(l.push({data:JSON.stringify({type:"chat_created",chat_id:r,model_id:n})}),a){const d=sd(i,s);for(const c of d)l.push({data:JSON.stringify({type:"thinking",content:c})});l.push({data:JSON.stringify({type:"thinking_end"})})}const u=sd(e,s);for(const d of u)l.push({data:JSON.stringify({type:"content",content:d})});return o.length>0&&l.push({data:JSON.stringify({type:"sources",sources:o})}),l.push({data:JSON.stringify({type:"done"})}),l.map(ku).join("")}function yb(e,t){return ku({data:JSON.stringify({type:"error",error:e,code:t})})}function sd(e,t){const r=[],n=e.split(" ");let a="";for(const i of n)a.length+i.length+1>t&&a.length>0?(r.push(a),a=i):a=a?`${a} ${i}`:i;return a&&r.push(a),r}function vb(e){const t=new TextEncoder,r=e.split(`
26
+
27
+ `).filter(Boolean).map(a=>a+`
28
+
29
+ `);let n=0;return new ReadableStream({pull(a){n<r.length?(a.enqueue(t.encode(r[n])),n++):a.close()}})}function Mu(e,t=200){return new Response(vb(e),{status:t,headers:{"Content-Type":"text/event-stream","Cache-Control":"no-cache",Connection:"keep-alive"}})}const dC={simple:Uo("Hello! How can I help you today?"),withThinking:Uo("Based on my analysis, the answer is 42.",{includeThinking:!0,thinkingContent:"Let me analyze this step by step..."}),withSources:Uo("According to the documentation, you can do this by following these steps...",{sources:[{id:"src-1",title:"Getting Started Guide",url:"https://docs.example.com/start"},{id:"src-2",title:"API Reference",url:"https://docs.example.com/api"}]}),longResponse:Uo("This is a longer response that contains multiple sentences. It helps test how the UI handles progressively streaming content. The response should appear word by word or chunk by chunk. This simulates a real AI response that takes time to generate.",{chunkSize:5}),error:yb("Rate limit exceeded","RATE_LIMIT")};function fC(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var gt={},Ai={exports:{}};Ai.exports;var ld;function wb(){return ld||(ld=1,(function(e){const r=(i=0)=>o=>`\x1B[${38+i};5;${o}m`,n=(i=0)=>(o,s,l)=>`\x1B[${38+i};2;${o};${s};${l}m`;function a(){const i=new Map,o={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]}};o.color.gray=o.color.blackBright,o.bgColor.bgGray=o.bgColor.bgBlackBright,o.color.grey=o.color.blackBright,o.bgColor.bgGrey=o.bgColor.bgBlackBright;for(const[s,l]of Object.entries(o)){for(const[u,d]of Object.entries(l))o[u]={open:`\x1B[${d[0]}m`,close:`\x1B[${d[1]}m`},l[u]=o[u],i.set(d[0],d[1]);Object.defineProperty(o,s,{value:l,enumerable:!1})}return Object.defineProperty(o,"codes",{value:i,enumerable:!1}),o.color.close="\x1B[39m",o.bgColor.close="\x1B[49m",o.color.ansi256=r(),o.color.ansi16m=n(),o.bgColor.ansi256=r(10),o.bgColor.ansi16m=n(10),Object.defineProperties(o,{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 d=Number.parseInt(u,16);return[d>>16&255,d>>8&255,d&255]},enumerable:!1},hexToAnsi256:{value:s=>o.rgbToAnsi256(...o.hexToRgb(s)),enumerable:!1}}),o}Object.defineProperty(e,"exports",{enumerable:!0,get:a})})(Ai)),Ai.exports}var nr={},ud;function ds(){if(ud)return nr;ud=1,Object.defineProperty(nr,"__esModule",{value:!0}),nr.printIteratorEntries=t,nr.printIteratorValues=r,nr.printListItems=n,nr.printObjectProperties=a;const e=(i,o)=>{const s=Object.keys(i).sort(o);return Object.getOwnPropertySymbols&&Object.getOwnPropertySymbols(i).forEach(l=>{Object.getOwnPropertyDescriptor(i,l).enumerable&&s.push(l)}),s};function t(i,o,s,l,u,d,c=": "){let f="",p=i.next();if(!p.done){f+=o.spacingOuter;const m=s+o.indent;for(;!p.done;){const g=d(p.value[0],o,m,l,u),b=d(p.value[1],o,m,l,u);f+=m+g+c+b,p=i.next(),p.done?o.min||(f+=","):f+=","+o.spacingInner}f+=o.spacingOuter+s}return f}function r(i,o,s,l,u,d){let c="",f=i.next();if(!f.done){c+=o.spacingOuter;const p=s+o.indent;for(;!f.done;)c+=p+d(f.value,o,p,l,u),f=i.next(),f.done?o.min||(c+=","):c+=","+o.spacingInner;c+=o.spacingOuter+s}return c}function n(i,o,s,l,u,d){let c="";if(i.length){c+=o.spacingOuter;const f=s+o.indent;for(let p=0;p<i.length;p++)c+=f,p in i&&(c+=d(i[p],o,f,l,u)),p<i.length-1?c+=","+o.spacingInner:o.min||(c+=",");c+=o.spacingOuter+s}return c}function a(i,o,s,l,u,d){let c="";const f=e(i,o.compareKeys);if(f.length){c+=o.spacingOuter;const p=s+o.indent;for(let m=0;m<f.length;m++){const g=f[m],b=d(g,o,p,l,u),h=d(i[g],o,p,l,u);c+=p+b+": "+h,m<f.length-1?c+=","+o.spacingInner:o.min||(c+=",")}c+=o.spacingOuter+s}return c}return nr}var xt={},cd;function pC(){if(cd)return xt;cd=1,Object.defineProperty(xt,"__esModule",{value:!0}),xt.test=xt.serialize=xt.default=void 0;var e=ds(),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,a=" ",i=(u,d,c,f,p,m)=>{const g=u.toString();return g==="ArrayContaining"||g==="ArrayNotContaining"?++f>d.maxDepth?"["+g+"]":g+a+"["+(0,e.printListItems)(u.sample,d,c,f,p,m)+"]":g==="ObjectContaining"||g==="ObjectNotContaining"?++f>d.maxDepth?"["+g+"]":g+a+"{"+(0,e.printObjectProperties)(u.sample,d,c,f,p,m)+"}":g==="StringMatching"||g==="StringNotMatching"||g==="StringContaining"||g==="StringNotContaining"?g+a+m(u.sample,d,c,f,p):u.toAsymmetricMatcher()};xt.serialize=i;const o=u=>u&&u.$$typeof===n;xt.test=o;var l={serialize:i,test:o};return xt.default=l,xt}var Rt={},$s,dd;function mC(){return dd||(dd=1,$s=({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")}),$s}var fd;function hC(){if(fd)return Rt;fd=1,Object.defineProperty(Rt,"__esModule",{value:!0}),Rt.test=Rt.serialize=Rt.default=void 0;var e=r(mC()),t=r(wb());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""}}),a=l=>typeof l=="string"&&!!l.match((0,e.default)());Rt.test=a;const i=(l,u,d,c,f,p)=>p(n(l),u,d,c,f);Rt.serialize=i;var s={serialize:i,test:a};return Rt.default=s,Rt}var Ct={},pd;function gC(){if(pd)return Ct;pd=1,Object.defineProperty(Ct,"__esModule",{value:!0}),Ct.test=Ct.serialize=Ct.default=void 0;var e=ds();const t=" ",r=["DOMStringMap","NamedNodeMap"],n=/^(HTML\w*Collection|NodeList)$/,a=d=>r.indexOf(d)!==-1||n.test(d),i=d=>d&&d.constructor&&!!d.constructor.name&&a(d.constructor.name);Ct.test=i;const o=d=>d.constructor.name==="NamedNodeMap",s=(d,c,f,p,m,g)=>{const b=d.constructor.name;return++p>c.maxDepth?"["+b+"]":(c.min?"":b+t)+(r.indexOf(b)!==-1?"{"+(0,e.printObjectProperties)(o(d)?Array.from(d).reduce((h,w)=>(h[w.name]=w.value,h),{}):{...d},c,f,p,m,g)+"}":"["+(0,e.printListItems)(Array.from(d),c,f,p,m,g)+"]")};Ct.serialize=s;var u={serialize:s,test:i};return Ct.default=u,Ct}var Et={},He={},vi={},md;function bC(){if(md)return vi;md=1,Object.defineProperty(vi,"__esModule",{value:!0}),vi.default=e;function e(t){return t.replace(/</g,"&lt;").replace(/>/g,"&gt;")}return vi}var hd;function Au(){if(hd)return He;hd=1,Object.defineProperty(He,"__esModule",{value:!0}),He.printText=He.printProps=He.printElementAsLeaf=He.printElement=He.printComment=He.printChildren=void 0;var e=t(bC());function t(l){return l&&l.__esModule?l:{default:l}}const r=(l,u,d,c,f,p,m)=>{const g=c+d.indent,b=d.colors;return l.map(h=>{const w=u[h];let x=m(w,d,g,f,p);return typeof w!="string"&&(x.indexOf(`
30
+ `)!==-1&&(x=d.spacingOuter+g+x+d.spacingOuter+c),x="{"+x+"}"),d.spacingInner+c+b.prop.open+h+b.prop.close+"="+b.value.open+x+b.value.close}).join("")};He.printProps=r;const n=(l,u,d,c,f,p)=>l.map(m=>u.spacingOuter+d+(typeof m=="string"?a(m,u):p(m,u,d,c,f))).join("");He.printChildren=n;const a=(l,u)=>{const d=u.colors.content;return d.open+(0,e.default)(l)+d.close};He.printText=a;const i=(l,u)=>{const d=u.colors.comment;return d.open+"<!--"+(0,e.default)(l)+"-->"+d.close};He.printComment=i;const o=(l,u,d,c,f)=>{const p=c.colors.tag;return p.open+"<"+l+(u&&p.close+u+c.spacingOuter+f+p.open)+(d?">"+p.close+d+c.spacingOuter+f+p.open+"</"+l:(u&&!c.min?"":" ")+"/")+">"+p.close};He.printElement=o;const s=(l,u)=>{const d=u.colors.tag;return d.open+"<"+l+d.close+" …"+d.open+" />"+d.close};return He.printElementAsLeaf=s,He}var gd;function yC(){if(gd)return Et;gd=1,Object.defineProperty(Et,"__esModule",{value:!0}),Et.test=Et.serialize=Et.default=void 0;var e=Au();const t=1,r=3,n=8,a=11,i=/^((HTML|SVG)\w*)?Element$/,o=g=>{try{return typeof g.hasAttribute=="function"&&g.hasAttribute("is")}catch{return!1}},s=g=>{const b=g.constructor.name,{nodeType:h,tagName:w}=g,x=typeof w=="string"&&w.includes("-")||o(g);return h===t&&(i.test(b)||x)||h===r&&b==="Text"||h===n&&b==="Comment"||h===a&&b==="DocumentFragment"},l=g=>{var b;return(g==null||(b=g.constructor)===null||b===void 0?void 0:b.name)&&s(g)};Et.test=l;function u(g){return g.nodeType===r}function d(g){return g.nodeType===n}function c(g){return g.nodeType===a}const f=(g,b,h,w,x,T)=>{if(u(g))return(0,e.printText)(g.data,b);if(d(g))return(0,e.printComment)(g.data,b);const E=c(g)?"DocumentFragment":g.tagName.toLowerCase();return++w>b.maxDepth?(0,e.printElementAsLeaf)(E,b):(0,e.printElement)(E,(0,e.printProps)(c(g)?[]:Array.from(g.attributes).map(y=>y.name).sort(),c(g)?{}:Array.from(g.attributes).reduce((y,v)=>(y[v.name]=v.value,y),{}),b,h+b.indent,w,x,T),(0,e.printChildren)(Array.prototype.slice.call(g.childNodes||g.children),b,h+b.indent,w,x,T),b,h)};Et.serialize=f;var m={serialize:f,test:l};return Et.default=m,Et}var Tt={},bd;function vC(){if(bd)return Tt;bd=1,Object.defineProperty(Tt,"__esModule",{value:!0}),Tt.test=Tt.serialize=Tt.default=void 0;var e=ds();const t="@@__IMMUTABLE_ITERABLE__@@",r="@@__IMMUTABLE_LIST__@@",n="@@__IMMUTABLE_KEYED__@@",a="@@__IMMUTABLE_MAP__@@",i="@@__IMMUTABLE_ORDERED__@@",o="@@__IMMUTABLE_RECORD__@@",s="@@__IMMUTABLE_SEQ__@@",l="@@__IMMUTABLE_SET__@@",u="@@__IMMUTABLE_STACK__@@",d=v=>"Immutable."+v,c=v=>"["+v+"]",f=" ",p="…",m=(v,R,k,P,M,F,j)=>++P>R.maxDepth?c(d(j)):d(j)+f+"{"+(0,e.printIteratorEntries)(v.entries(),R,k,P,M,F)+"}";function g(v){let R=0;return{next(){if(R<v._keys.length){const k=v._keys[R++];return{done:!1,value:[k,v.get(k)]}}return{done:!0,value:void 0}}}}const b=(v,R,k,P,M,F)=>{const j=d(v._name||"Record");return++P>R.maxDepth?c(j):j+f+"{"+(0,e.printIteratorEntries)(g(v),R,k,P,M,F)+"}"},h=(v,R,k,P,M,F)=>{const j=d("Seq");return++P>R.maxDepth?c(j):v[n]?j+f+"{"+(v._iter||v._object?(0,e.printIteratorEntries)(v.entries(),R,k,P,M,F):p)+"}":j+f+"["+(v._iter||v._array||v._collection||v._iterable?(0,e.printIteratorValues)(v.values(),R,k,P,M,F):p)+"]"},w=(v,R,k,P,M,F,j)=>++P>R.maxDepth?c(d(j)):d(j)+f+"["+(0,e.printIteratorValues)(v.values(),R,k,P,M,F)+"]",x=(v,R,k,P,M,F)=>v[a]?m(v,R,k,P,M,F,v[i]?"OrderedMap":"Map"):v[r]?w(v,R,k,P,M,F,"List"):v[l]?w(v,R,k,P,M,F,v[i]?"OrderedSet":"Set"):v[u]?w(v,R,k,P,M,F,"Stack"):v[s]?h(v,R,k,P,M,F):b(v,R,k,P,M,F);Tt.serialize=x;const T=v=>v&&(v[t]===!0||v[o]===!0);Tt.test=T;var y={serialize:x,test:T};return Tt.default=y,Tt}var St={},wi={exports:{}},Re={};var yd;function wC(){if(yd)return Re;yd=1;var e=60103,t=60106,r=60107,n=60108,a=60114,i=60109,o=60110,s=60112,l=60113,u=60120,d=60115,c=60116,f=60121,p=60122,m=60117,g=60129,b=60131;if(typeof Symbol=="function"&&Symbol.for){var h=Symbol.for;e=h("react.element"),t=h("react.portal"),r=h("react.fragment"),n=h("react.strict_mode"),a=h("react.profiler"),i=h("react.provider"),o=h("react.context"),s=h("react.forward_ref"),l=h("react.suspense"),u=h("react.suspense_list"),d=h("react.memo"),c=h("react.lazy"),f=h("react.block"),p=h("react.server.block"),m=h("react.fundamental"),g=h("react.debug_trace_mode"),b=h("react.legacy_hidden")}function w(j){if(typeof j=="object"&&j!==null){var D=j.$$typeof;switch(D){case e:switch(j=j.type,j){case r:case a:case n:case l:case u:return j;default:switch(j=j&&j.$$typeof,j){case o:case s:case c:case d:case i:return j;default:return D}}case t:return D}}}var x=i,T=e,E=s,y=r,v=c,R=d,k=t,P=a,M=n,F=l;return Re.ContextConsumer=o,Re.ContextProvider=x,Re.Element=T,Re.ForwardRef=E,Re.Fragment=y,Re.Lazy=v,Re.Memo=R,Re.Portal=k,Re.Profiler=P,Re.StrictMode=M,Re.Suspense=F,Re.isAsyncMode=function(){return!1},Re.isConcurrentMode=function(){return!1},Re.isContextConsumer=function(j){return w(j)===o},Re.isContextProvider=function(j){return w(j)===i},Re.isElement=function(j){return typeof j=="object"&&j!==null&&j.$$typeof===e},Re.isForwardRef=function(j){return w(j)===s},Re.isFragment=function(j){return w(j)===r},Re.isLazy=function(j){return w(j)===c},Re.isMemo=function(j){return w(j)===d},Re.isPortal=function(j){return w(j)===t},Re.isProfiler=function(j){return w(j)===a},Re.isStrictMode=function(j){return w(j)===n},Re.isSuspense=function(j){return w(j)===l},Re.isValidElementType=function(j){return typeof j=="string"||typeof j=="function"||j===r||j===a||j===g||j===n||j===l||j===u||j===b||typeof j=="object"&&j!==null&&(j.$$typeof===c||j.$$typeof===d||j.$$typeof===i||j.$$typeof===o||j.$$typeof===s||j.$$typeof===m||j.$$typeof===f||j[0]===p)},Re.typeOf=w,Re}var Ce={};var vd;function xC(){return vd||(vd=1,process.env.NODE_ENV!=="production"&&(function(){var e=60103,t=60106,r=60107,n=60108,a=60114,i=60109,o=60110,s=60112,l=60113,u=60120,d=60115,c=60116,f=60121,p=60122,m=60117,g=60129,b=60131;if(typeof Symbol=="function"&&Symbol.for){var h=Symbol.for;e=h("react.element"),t=h("react.portal"),r=h("react.fragment"),n=h("react.strict_mode"),a=h("react.profiler"),i=h("react.provider"),o=h("react.context"),s=h("react.forward_ref"),l=h("react.suspense"),u=h("react.suspense_list"),d=h("react.memo"),c=h("react.lazy"),f=h("react.block"),p=h("react.server.block"),m=h("react.fundamental"),h("react.scope"),h("react.opaque.id"),g=h("react.debug_trace_mode"),h("react.offscreen"),b=h("react.legacy_hidden")}var w=!1;function x(W){return!!(typeof W=="string"||typeof W=="function"||W===r||W===a||W===g||W===n||W===l||W===u||W===b||w||typeof W=="object"&&W!==null&&(W.$$typeof===c||W.$$typeof===d||W.$$typeof===i||W.$$typeof===o||W.$$typeof===s||W.$$typeof===m||W.$$typeof===f||W[0]===p))}function T(W){if(typeof W=="object"&&W!==null){var le=W.$$typeof;switch(le){case e:var de=W.type;switch(de){case r:case a:case n:case l:case u:return de;default:var X=de&&de.$$typeof;switch(X){case o:case s:case c:case d:case i:return X;default:return le}}case t:return le}}}var E=o,y=i,v=e,R=s,k=r,P=c,M=d,F=t,j=a,D=n,J=l,B=!1,Y=!1;function L(W){return B||(B=!0,console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 18+.")),!1}function Z(W){return Y||(Y=!0,console.warn("The ReactIs.isConcurrentMode() alias has been deprecated, and will be removed in React 18+.")),!1}function ae(W){return T(W)===o}function ne(W){return T(W)===i}function fe(W){return typeof W=="object"&&W!==null&&W.$$typeof===e}function H(W){return T(W)===s}function me(W){return T(W)===r}function ce(W){return T(W)===c}function se(W){return T(W)===d}function Se(W){return T(W)===t}function Me(W){return T(W)===a}function q(W){return T(W)===n}function Q(W){return T(W)===l}Ce.ContextConsumer=E,Ce.ContextProvider=y,Ce.Element=v,Ce.ForwardRef=R,Ce.Fragment=k,Ce.Lazy=P,Ce.Memo=M,Ce.Portal=F,Ce.Profiler=j,Ce.StrictMode=D,Ce.Suspense=J,Ce.isAsyncMode=L,Ce.isConcurrentMode=Z,Ce.isContextConsumer=ae,Ce.isContextProvider=ne,Ce.isElement=fe,Ce.isForwardRef=H,Ce.isFragment=me,Ce.isLazy=ce,Ce.isMemo=se,Ce.isPortal=Se,Ce.isProfiler=Me,Ce.isStrictMode=q,Ce.isSuspense=Q,Ce.isValidElementType=x,Ce.typeOf=T})()),Ce}var wd;function RC(){return wd||(wd=1,process.env.NODE_ENV==="production"?wi.exports=wC():wi.exports=xC()),wi.exports}var xd;function CC(){if(xd)return St;xd=1,Object.defineProperty(St,"__esModule",{value:!0}),St.test=St.serialize=St.default=void 0;var e=n(RC()),t=Au();function r(c){if(typeof WeakMap!="function")return null;var f=new WeakMap,p=new WeakMap;return(r=function(m){return m?p:f})(c)}function n(c,f){if(c&&c.__esModule)return c;if(c===null||typeof c!="object"&&typeof c!="function")return{default:c};var p=r(f);if(p&&p.has(c))return p.get(c);var m={},g=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var b in c)if(b!=="default"&&Object.prototype.hasOwnProperty.call(c,b)){var h=g?Object.getOwnPropertyDescriptor(c,b):null;h&&(h.get||h.set)?Object.defineProperty(m,b,h):m[b]=c[b]}return m.default=c,p&&p.set(c,m),m}const a=(c,f=[])=>(Array.isArray(c)?c.forEach(p=>{a(p,f)}):c!=null&&c!==!1&&f.push(c),f),i=c=>{const f=c.type;if(typeof f=="string")return f;if(typeof f=="function")return f.displayName||f.name||"Unknown";if(e.isFragment(c))return"React.Fragment";if(e.isSuspense(c))return"React.Suspense";if(typeof f=="object"&&f!==null){if(e.isContextProvider(c))return"Context.Provider";if(e.isContextConsumer(c))return"Context.Consumer";if(e.isForwardRef(c)){if(f.displayName)return f.displayName;const p=f.render.displayName||f.render.name||"";return p!==""?"ForwardRef("+p+")":"ForwardRef"}if(e.isMemo(c)){const p=f.displayName||f.type.displayName||f.type.name||"";return p!==""?"Memo("+p+")":"Memo"}}return"UNDEFINED"},o=c=>{const{props:f}=c;return Object.keys(f).filter(p=>p!=="children"&&f[p]!==void 0).sort()},s=(c,f,p,m,g,b)=>++m>f.maxDepth?(0,t.printElementAsLeaf)(i(c),f):(0,t.printElement)(i(c),(0,t.printProps)(o(c),c.props,f,p+f.indent,m,g,b),(0,t.printChildren)(a(c.props.children),f,p+f.indent,m,g,b),f,p);St.serialize=s;const l=c=>c!=null&&e.isElement(c);St.test=l;var d={serialize:s,test:l};return St.default=d,St}var _t={},Rd;function EC(){if(Rd)return _t;Rd=1,Object.defineProperty(_t,"__esModule",{value:!0}),_t.test=_t.serialize=_t.default=void 0;var e=Au(),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,a=u=>{const{props:d}=u;return d?Object.keys(d).filter(c=>d[c]!==void 0).sort():[]},i=(u,d,c,f,p,m)=>++f>d.maxDepth?(0,e.printElementAsLeaf)(u.type,d):(0,e.printElement)(u.type,u.props?(0,e.printProps)(a(u),u.props,d,c+d.indent,f,p,m):"",u.children?(0,e.printChildren)(u.children,d,c+d.indent,f,p,m):"",d,c);_t.serialize=i;const o=u=>u&&u.$$typeof===n;_t.test=o;var l={serialize:i,test:o};return _t.default=l,_t}var Cd;function TC(){if(Cd)return gt;Cd=1,Object.defineProperty(gt,"__esModule",{value:!0}),gt.default=gt.DEFAULT_OPTIONS=void 0,gt.format=se,gt.plugins=void 0;var e=u(wb()),t=ds(),r=u(pC()),n=u(hC()),a=u(gC()),i=u(yC()),o=u(vC()),s=u(CC()),l=u(EC());function u(q){return q&&q.__esModule?q:{default:q}}const d=Object.prototype.toString,c=Date.prototype.toISOString,f=Error.prototype.toString,p=RegExp.prototype.toString,m=q=>typeof q.constructor=="function"&&q.constructor.name||"Object",g=q=>typeof window<"u"&&q===window,b=/^Symbol\((.*)\)(.*)$/,h=/\n/gi;class w extends Error{constructor(Q,W){super(Q),this.stack=W,this.name=this.constructor.name}}function x(q){return q==="[object Array]"||q==="[object ArrayBuffer]"||q==="[object DataView]"||q==="[object Float32Array]"||q==="[object Float64Array]"||q==="[object Int8Array]"||q==="[object Int16Array]"||q==="[object Int32Array]"||q==="[object Uint8Array]"||q==="[object Uint8ClampedArray]"||q==="[object Uint16Array]"||q==="[object Uint32Array]"}function T(q){return Object.is(q,-0)?"-0":String(q)}function E(q){return`${q}n`}function y(q,Q){return Q?"[Function "+(q.name||"anonymous")+"]":"[Function]"}function v(q){return String(q).replace(b,"Symbol($1)")}function R(q){return"["+f.call(q)+"]"}function k(q,Q,W,le){if(q===!0||q===!1)return""+q;if(q===void 0)return"undefined";if(q===null)return"null";const de=typeof q;if(de==="number")return T(q);if(de==="bigint")return E(q);if(de==="string")return le?'"'+q.replace(/"|\\/g,"\\$&")+'"':'"'+q+'"';if(de==="function")return y(q,Q);if(de==="symbol")return v(q);const X=d.call(q);return X==="[object WeakMap]"?"WeakMap {}":X==="[object WeakSet]"?"WeakSet {}":X==="[object Function]"||X==="[object GeneratorFunction]"?y(q,Q):X==="[object Symbol]"?v(q):X==="[object Date]"?isNaN(+q)?"Date { NaN }":c.call(q):X==="[object Error]"?R(q):X==="[object RegExp]"?W?p.call(q).replace(/[\\^$*+?.()|[\]{}]/g,"\\$&"):p.call(q):q instanceof Error?R(q):null}function P(q,Q,W,le,de,X){if(de.indexOf(q)!==-1)return"[Circular]";de=de.slice(),de.push(q);const _e=++le>Q.maxDepth,xe=Q.min;if(Q.callToJSON&&!_e&&q.toJSON&&typeof q.toJSON=="function"&&!X)return D(q.toJSON(),Q,W,le,de,!0);const Oe=d.call(q);return Oe==="[object Arguments]"?_e?"[Arguments]":(xe?"":"Arguments ")+"["+(0,t.printListItems)(q,Q,W,le,de,D)+"]":x(Oe)?_e?"["+q.constructor.name+"]":(xe||!Q.printBasicPrototype&&q.constructor.name==="Array"?"":q.constructor.name+" ")+"["+(0,t.printListItems)(q,Q,W,le,de,D)+"]":Oe==="[object Map]"?_e?"[Map]":"Map {"+(0,t.printIteratorEntries)(q.entries(),Q,W,le,de,D," => ")+"}":Oe==="[object Set]"?_e?"[Set]":"Set {"+(0,t.printIteratorValues)(q.values(),Q,W,le,de,D)+"}":_e||g(q)?"["+m(q)+"]":(xe||!Q.printBasicPrototype&&m(q)==="Object"?"":m(q)+" ")+"{"+(0,t.printObjectProperties)(q,Q,W,le,de,D)+"}"}function M(q){return q.serialize!=null}function F(q,Q,W,le,de,X){let _e;try{_e=M(q)?q.serialize(Q,W,le,de,X,D):q.print(Q,xe=>D(xe,W,le,de,X),xe=>{const Oe=le+W.indent;return Oe+xe.replace(h,`
31
+ `+Oe)},{edgeSpacing:W.spacingOuter,min:W.min,spacing:W.spacingInner},W.colors)}catch(xe){throw new w(xe.message,xe.stack)}if(typeof _e!="string")throw new Error(`pretty-format: Plugin must return type "string" but instead returned "${typeof _e}".`);return _e}function j(q,Q){for(let W=0;W<q.length;W++)try{if(q[W].test(Q))return q[W]}catch(le){throw new w(le.message,le.stack)}return null}function D(q,Q,W,le,de,X){const _e=j(Q.plugins,q);if(_e!==null)return F(_e,q,Q,W,le,de);const xe=k(q,Q.printFunctionName,Q.escapeRegex,Q.escapeString);return xe!==null?xe:P(q,Q,W,le,de,X)}const J={comment:"gray",content:"reset",prop:"yellow",tag:"cyan",value:"green"},B=Object.keys(J),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:J};gt.DEFAULT_OPTIONS=Y;function L(q){if(Object.keys(q).forEach(Q=>{if(!Y.hasOwnProperty(Q))throw new Error(`pretty-format: Unknown option "${Q}".`)}),q.min&&q.indent!==void 0&&q.indent!==0)throw new Error('pretty-format: Options "min" and "indent" cannot be used together.');if(q.theme!==void 0){if(q.theme===null)throw new Error('pretty-format: Option "theme" must not be null.');if(typeof q.theme!="object")throw new Error(`pretty-format: Option "theme" must be of type "object" but instead received "${typeof q.theme}".`)}}const Z=q=>B.reduce((Q,W)=>{const le=q.theme&&q.theme[W]!==void 0?q.theme[W]:J[W],de=le&&e.default[le];if(de&&typeof de.close=="string"&&typeof de.open=="string")Q[W]=de;else throw new Error(`pretty-format: Option "theme" has a key "${W}" whose value "${le}" is undefined in ansi-styles.`);return Q},Object.create(null)),ae=()=>B.reduce((q,Q)=>(q[Q]={close:"",open:""},q),Object.create(null)),ne=q=>q&&q.printFunctionName!==void 0?q.printFunctionName:Y.printFunctionName,fe=q=>q&&q.escapeRegex!==void 0?q.escapeRegex:Y.escapeRegex,H=q=>q&&q.escapeString!==void 0?q.escapeString:Y.escapeString,me=q=>{var Q;return{callToJSON:q&&q.callToJSON!==void 0?q.callToJSON:Y.callToJSON,colors:q&&q.highlight?Z(q):ae(),compareKeys:q&&typeof q.compareKeys=="function"?q.compareKeys:Y.compareKeys,escapeRegex:fe(q),escapeString:H(q),indent:q&&q.min?"":ce(q&&q.indent!==void 0?q.indent:Y.indent),maxDepth:q&&q.maxDepth!==void 0?q.maxDepth:Y.maxDepth,min:q&&q.min!==void 0?q.min:Y.min,plugins:q&&q.plugins!==void 0?q.plugins:Y.plugins,printBasicPrototype:(Q=q?.printBasicPrototype)!==null&&Q!==void 0?Q:!0,printFunctionName:ne(q),spacingInner:q&&q.min?" ":`
32
+ `,spacingOuter:q&&q.min?"":`
33
+ `}};function ce(q){return new Array(q+1).join(" ")}function se(q,Q){if(Q&&(L(Q),Q.plugins)){const le=j(Q.plugins,q);if(le!==null)return F(le,q,me(Q),"",0,[])}const W=k(q,ne(Q),fe(Q),H(Q));return W!==null?W:P(q,me(Q),"",0,[])}const Se={AsymmetricMatcher:r.default,ConvertAnsi:n.default,DOMCollection:a.default,DOMElement:i.default,Immutable:o.default,ReactElement:s.default,ReactTestComponent:l.default};gt.plugins=Se;var Me=se;return gt.default=Me,gt}var xb=TC(),SC=Object.prototype.toString;function _C(e){return typeof e=="function"||SC.call(e)==="[object Function]"}function PC(e){var t=Number(e);return isNaN(t)?0:t===0||!isFinite(t)?t:(t>0?1:-1)*Math.floor(Math.abs(t))}var kC=Math.pow(2,53)-1;function MC(e){var t=PC(e);return Math.min(Math.max(t,0),kC)}function ut(e,t){var r=Array,n=Object(e);if(e==null)throw new TypeError("Array.from requires an array-like object - not null or undefined");for(var a=MC(n.length),i=_C(r)?Object(new r(a)):new Array(a),o=0,s;o<a;)s=n[o],i[o]=s,o+=1;return i.length=a,i}function Zo(e){"@babel/helpers - typeof";return Zo=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Zo(e)}function AC(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function qC(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Rb(n.key),n)}}function IC(e,t,r){return t&&qC(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function OC(e,t,r){return t=Rb(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Rb(e){var t=NC(e,"string");return Zo(t)==="symbol"?t:String(t)}function NC(e,t){if(Zo(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Zo(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var $C=(function(){function e(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];AC(this,e),OC(this,"items",void 0),this.items=t}return IC(e,[{key:"add",value:function(r){return this.has(r)===!1&&this.items.push(r),this}},{key:"clear",value:function(){this.items=[]}},{key:"delete",value:function(r){var n=this.items.length;return this.items=this.items.filter(function(a){return a!==r}),n!==this.items.length}},{key:"forEach",value:function(r){var n=this;this.items.forEach(function(a){r(a,a,n)})}},{key:"has",value:function(r){return this.items.indexOf(r)!==-1}},{key:"size",get:function(){return this.items.length}}]),e})();const jC=typeof Set>"u"?Set:$C;function We(e){var t;return(t=e.localName)!==null&&t!==void 0?t:e.tagName.toLowerCase()}var DC={article:"article",aside:"complementary",button:"button",datalist:"listbox",dd:"definition",details:"group",dialog:"dialog",dt:"term",fieldset:"group",figure:"figure",form:"form",footer:"contentinfo",h1:"heading",h2:"heading",h3:"heading",h4:"heading",h5:"heading",h6:"heading",header:"banner",hr:"separator",html:"document",legend:"legend",li:"listitem",math:"math",main:"main",menu:"list",nav:"navigation",ol:"list",optgroup:"group",option:"option",output:"status",progress:"progressbar",section:"region",summary:"button",table:"table",tbody:"rowgroup",textarea:"textbox",tfoot:"rowgroup",td:"cell",th:"columnheader",thead:"rowgroup",tr:"row",ul:"list"},LC={caption:new Set(["aria-label","aria-labelledby"]),code:new Set(["aria-label","aria-labelledby"]),deletion:new Set(["aria-label","aria-labelledby"]),emphasis:new Set(["aria-label","aria-labelledby"]),generic:new Set(["aria-label","aria-labelledby","aria-roledescription"]),insertion:new Set(["aria-label","aria-labelledby"]),paragraph:new Set(["aria-label","aria-labelledby"]),presentation:new Set(["aria-label","aria-labelledby"]),strong:new Set(["aria-label","aria-labelledby"]),subscript:new Set(["aria-label","aria-labelledby"]),superscript:new Set(["aria-label","aria-labelledby"])};function FC(e,t){return["aria-atomic","aria-busy","aria-controls","aria-current","aria-describedby","aria-details","aria-dropeffect","aria-flowto","aria-grabbed","aria-hidden","aria-keyshortcuts","aria-label","aria-labelledby","aria-live","aria-owns","aria-relevant","aria-roledescription"].some(function(r){var n;return e.hasAttribute(r)&&!((n=LC[t])!==null&&n!==void 0&&n.has(r))})}function Cb(e,t){return FC(e,t)}function BC(e){var t=UC(e);if(t===null||t==="presentation"){var r=zC(e);if(t!=="presentation"||Cb(e,r||""))return r}return t}function zC(e){var t=DC[We(e)];if(t!==void 0)return t;switch(We(e)){case"a":case"area":case"link":if(e.hasAttribute("href"))return"link";break;case"img":return e.getAttribute("alt")===""&&!Cb(e,"img")?"presentation":"img";case"input":{var r=e,n=r.type;switch(n){case"button":case"image":case"reset":case"submit":return"button";case"checkbox":case"radio":return n;case"range":return"slider";case"email":case"tel":case"text":case"url":return e.hasAttribute("list")?"combobox":"textbox";case"search":return e.hasAttribute("list")?"combobox":"searchbox";case"number":return"spinbutton";default:return null}}case"select":return e.hasAttribute("multiple")||e.size>1?"listbox":"combobox"}return null}function UC(e){var t=e.getAttribute("role");if(t!==null){var r=t.trim().split(" ")[0];if(r.length>0)return r}return null}function ke(e){return e!==null&&e.nodeType===e.ELEMENT_NODE}function Eb(e){return ke(e)&&We(e)==="caption"}function qi(e){return ke(e)&&We(e)==="input"}function WC(e){return ke(e)&&We(e)==="optgroup"}function VC(e){return ke(e)&&We(e)==="select"}function HC(e){return ke(e)&&We(e)==="table"}function GC(e){return ke(e)&&We(e)==="textarea"}function KC(e){var t=e.ownerDocument===null?e:e.ownerDocument,r=t.defaultView;if(r===null)throw new TypeError("no window available");return r}function JC(e){return ke(e)&&We(e)==="fieldset"}function XC(e){return ke(e)&&We(e)==="legend"}function YC(e){return ke(e)&&We(e)==="slot"}function QC(e){return ke(e)&&e.ownerSVGElement!==void 0}function ZC(e){return ke(e)&&We(e)==="svg"}function eE(e){return QC(e)&&We(e)==="title"}function Ui(e,t){if(ke(e)&&e.hasAttribute(t)){var r=e.getAttribute(t).split(" "),n=e.getRootNode?e.getRootNode():e.ownerDocument;return r.map(function(a){return n.getElementById(a)}).filter(function(a){return a!==null})}return[]}function Nt(e,t){return ke(e)?t.indexOf(BC(e))!==-1:!1}function tE(e){return e.trim().replace(/\s\s+/g," ")}function rE(e,t){if(!ke(e))return!1;if(e.hasAttribute("hidden")||e.getAttribute("aria-hidden")==="true")return!0;var r=t(e);return r.getPropertyValue("display")==="none"||r.getPropertyValue("visibility")==="hidden"}function nE(e){return Nt(e,["button","combobox","listbox","textbox"])||Tb(e,"range")}function Tb(e,t){if(!ke(e))return!1;switch(t){case"range":return Nt(e,["meter","progressbar","scrollbar","slider","spinbutton"]);default:throw new TypeError("No knowledge about abstract role '".concat(t,"'. This is likely a bug :("))}}function Ed(e,t){var r=ut(e.querySelectorAll(t));return Ui(e,"aria-owns").forEach(function(n){r.push.apply(r,ut(n.querySelectorAll(t)))}),r}function aE(e){return VC(e)?e.selectedOptions||Ed(e,"[selected]"):Ed(e,'[aria-selected="true"]')}function oE(e){return Nt(e,["none","presentation"])}function iE(e){return Eb(e)}function sE(e){return Nt(e,["button","cell","checkbox","columnheader","gridcell","heading","label","legend","link","menuitem","menuitemcheckbox","menuitemradio","option","radio","row","rowheader","switch","tab","tooltip","treeitem"])}function lE(e){return!1}function uE(e){return qi(e)||GC(e)?e.value:e.textContent||""}function Td(e){var t=e.getPropertyValue("content");return/^["'].*["']$/.test(t)?t.slice(1,-1):""}function Sb(e){var t=We(e);return t==="button"||t==="input"&&e.getAttribute("type")!=="hidden"||t==="meter"||t==="output"||t==="progress"||t==="select"||t==="textarea"}function _b(e){if(Sb(e))return e;var t=null;return e.childNodes.forEach(function(r){if(t===null&&ke(r)){var n=_b(r);n!==null&&(t=n)}}),t}function cE(e){if(e.control!==void 0)return e.control;var t=e.getAttribute("for");return t!==null?e.ownerDocument.getElementById(t):_b(e)}function dE(e){var t=e.labels;if(t===null)return t;if(t!==void 0)return ut(t);if(!Sb(e))return null;var r=e.ownerDocument;return ut(r.querySelectorAll("label")).filter(function(n){return cE(n)===e})}function fE(e){var t=e.assignedNodes();return t.length===0?ut(e.childNodes):t}function Pb(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=new jC,n=KC(e),a=t.compute,i=a===void 0?"name":a,o=t.computedStyleSupportsPseudoElements,s=o===void 0?t.getComputedStyle!==void 0:o,l=t.getComputedStyle,u=l===void 0?n.getComputedStyle.bind(n):l,d=t.hidden,c=d===void 0?!1:d;function f(h,w){var x="";if(ke(h)&&s){var T=u(h,"::before"),E=Td(T);x="".concat(E," ").concat(x)}var y=YC(h)?fE(h):ut(h.childNodes).concat(Ui(h,"aria-owns"));if(y.forEach(function(k){var P=b(k,{isEmbeddedInLabel:w.isEmbeddedInLabel,isReferenced:!1,recursion:!0}),M=ke(k)?u(k).getPropertyValue("display"):"inline",F=M!=="inline"?" ":"";x+="".concat(F).concat(P).concat(F)}),ke(h)&&s){var v=u(h,"::after"),R=Td(v);x="".concat(x," ").concat(R)}return x.trim()}function p(h,w){var x=h.getAttributeNode(w);return x!==null&&!r.has(x)&&x.value.trim()!==""?(r.add(x),x.value):null}function m(h){return ke(h)?p(h,"title"):null}function g(h){if(!ke(h))return null;if(JC(h)){r.add(h);for(var w=ut(h.childNodes),x=0;x<w.length;x+=1){var T=w[x];if(XC(T))return b(T,{isEmbeddedInLabel:!1,isReferenced:!1,recursion:!1})}}else if(HC(h)){r.add(h);for(var E=ut(h.childNodes),y=0;y<E.length;y+=1){var v=E[y];if(Eb(v))return b(v,{isEmbeddedInLabel:!1,isReferenced:!1,recursion:!1})}}else if(ZC(h)){r.add(h);for(var R=ut(h.childNodes),k=0;k<R.length;k+=1){var P=R[k];if(eE(P))return P.textContent}return null}else if(We(h)==="img"||We(h)==="area"){var M=p(h,"alt");if(M!==null)return M}else if(WC(h)){var F=p(h,"label");if(F!==null)return F}if(qi(h)&&(h.type==="button"||h.type==="submit"||h.type==="reset")){var j=p(h,"value");if(j!==null)return j;if(h.type==="submit")return"Submit";if(h.type==="reset")return"Reset"}var D=dE(h);if(D!==null&&D.length!==0)return r.add(h),ut(D).map(function(L){return b(L,{isEmbeddedInLabel:!0,isReferenced:!1,recursion:!0})}).filter(function(L){return L.length>0}).join(" ");if(qi(h)&&h.type==="image"){var J=p(h,"alt");if(J!==null)return J;var B=p(h,"title");return B!==null?B:"Submit Query"}if(Nt(h,["button"])){var Y=f(h,{isEmbeddedInLabel:!1});if(Y!=="")return Y}return null}function b(h,w){if(r.has(h))return"";if(!c&&rE(h,u)&&!w.isReferenced)return r.add(h),"";var x=ke(h)?h.getAttributeNode("aria-labelledby"):null,T=x!==null&&!r.has(x)?Ui(h,"aria-labelledby"):[];if(i==="name"&&!w.isReferenced&&T.length>0)return r.add(x),T.map(function(M){return b(M,{isEmbeddedInLabel:w.isEmbeddedInLabel,isReferenced:!0,recursion:!1})}).join(" ");var E=w.recursion&&nE(h)&&i==="name";if(!E){var y=(ke(h)&&h.getAttribute("aria-label")||"").trim();if(y!==""&&i==="name")return r.add(h),y;if(!oE(h)){var v=g(h);if(v!==null)return r.add(h),v}}if(Nt(h,["menu"]))return r.add(h),"";if(E||w.isEmbeddedInLabel||w.isReferenced){if(Nt(h,["combobox","listbox"])){r.add(h);var R=aE(h);return R.length===0?qi(h)?h.value:"":ut(R).map(function(M){return b(M,{isEmbeddedInLabel:w.isEmbeddedInLabel,isReferenced:!1,recursion:!0})}).join(" ")}if(Tb(h,"range"))return r.add(h),h.hasAttribute("aria-valuetext")?h.getAttribute("aria-valuetext"):h.hasAttribute("aria-valuenow")?h.getAttribute("aria-valuenow"):h.getAttribute("value")||"";if(Nt(h,["textbox"]))return r.add(h),uE(h)}if(sE(h)||ke(h)&&w.isReferenced||iE(h)||lE()){var k=f(h,{isEmbeddedInLabel:w.isEmbeddedInLabel});if(k!=="")return r.add(h),k}if(h.nodeType===h.TEXT_NODE)return r.add(h),h.textContent||"";if(w.recursion)return r.add(h),f(h,{isEmbeddedInLabel:w.isEmbeddedInLabel});var P=m(h);return P!==null?(r.add(h),P):(r.add(h),"")}return tE(b(e,{isEmbeddedInLabel:!1,isReferenced:i==="description",recursion:!1}))}function ei(e){"@babel/helpers - typeof";return ei=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ei(e)}function Sd(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function _d(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Sd(Object(r),!0).forEach(function(n){pE(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Sd(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function pE(e,t,r){return t=mE(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function mE(e){var t=hE(e,"string");return ei(t)==="symbol"?t:String(t)}function hE(e,t){if(ei(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(ei(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function kb(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=Ui(e,"aria-describedby").map(function(a){return Pb(a,_d(_d({},t),{},{compute:"description"}))}).join(" ");if(r===""){var n=e.getAttribute("title");r=n===null?"":n}return r}function gE(e){return Nt(e,["caption","code","deletion","emphasis","generic","insertion","paragraph","presentation","strong","subscript","superscript"])}function qu(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return gE(e)?"":Pb(e,t)}var Ze={},Xr={},xi={},Yr={},Pd;function bE(){if(Pd)return Yr;Pd=1,Object.defineProperty(Yr,"__esModule",{value:!0}),Yr.default=void 0;function e(){var r=this,n=0,a={"@@iterator":function(){return a},next:function(){if(n<r.length){var o=r[n];return n=n+1,{done:!1,value:o}}else return{done:!0}}};return a}var t=e;return Yr.default=t,Yr}var kd;function si(){if(kd)return xi;kd=1,Object.defineProperty(xi,"__esModule",{value:!0}),xi.default=n;var e=t(bE());function t(a){return a&&a.__esModule?a:{default:a}}function r(a){"@babel/helpers - typeof";return r=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(i){return typeof i}:function(i){return i&&typeof Symbol=="function"&&i.constructor===Symbol&&i!==Symbol.prototype?"symbol":typeof i},r(a)}function n(a,i){return typeof Symbol=="function"&&r(Symbol.iterator)==="symbol"&&Object.defineProperty(a,Symbol.iterator,{value:e.default.bind(i)}),a}return xi}var Md;function yE(){if(Md)return Xr;Md=1,Object.defineProperty(Xr,"__esModule",{value:!0}),Xr.default=void 0;var e=t(si());function t(f){return f&&f.__esModule?f:{default:f}}function r(f,p){return i(f)||a(f,p)||s(f,p)||n()}function n(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
34
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function a(f,p){var m=f==null?null:typeof Symbol<"u"&&f[Symbol.iterator]||f["@@iterator"];if(m!=null){var g=[],b=!0,h=!1,w,x;try{for(m=m.call(f);!(b=(w=m.next()).done)&&(g.push(w.value),!(p&&g.length===p));b=!0);}catch(T){h=!0,x=T}finally{try{!b&&m.return!=null&&m.return()}finally{if(h)throw x}}return g}}function i(f){if(Array.isArray(f))return f}function o(f,p){var m=typeof Symbol<"u"&&f[Symbol.iterator]||f["@@iterator"];if(!m){if(Array.isArray(f)||(m=s(f))||p){m&&(f=m);var g=0,b=function(){};return{s:b,n:function(){return g>=f.length?{done:!0}:{done:!1,value:f[g++]}},e:function(E){throw E},f:b}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
35
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var h=!0,w=!1,x;return{s:function(){m=m.call(f)},n:function(){var E=m.next();return h=E.done,E},e:function(E){w=!0,x=E},f:function(){try{!h&&m.return!=null&&m.return()}finally{if(w)throw x}}}}function s(f,p){if(f){if(typeof f=="string")return l(f,p);var m=Object.prototype.toString.call(f).slice(8,-1);if(m==="Object"&&f.constructor&&(m=f.constructor.name),m==="Map"||m==="Set")return Array.from(f);if(m==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(m))return l(f,p)}}function l(f,p){(p==null||p>f.length)&&(p=f.length);for(var m=0,g=new Array(p);m<p;m++)g[m]=f[m];return g}var u=[["aria-activedescendant",{type:"id"}],["aria-atomic",{type:"boolean"}],["aria-autocomplete",{type:"token",values:["inline","list","both","none"]}],["aria-braillelabel",{type:"string"}],["aria-brailleroledescription",{type:"string"}],["aria-busy",{type:"boolean"}],["aria-checked",{type:"tristate"}],["aria-colcount",{type:"integer"}],["aria-colindex",{type:"integer"}],["aria-colspan",{type:"integer"}],["aria-controls",{type:"idlist"}],["aria-current",{type:"token",values:["page","step","location","date","time",!0,!1]}],["aria-describedby",{type:"idlist"}],["aria-description",{type:"string"}],["aria-details",{type:"id"}],["aria-disabled",{type:"boolean"}],["aria-dropeffect",{type:"tokenlist",values:["copy","execute","link","move","none","popup"]}],["aria-errormessage",{type:"id"}],["aria-expanded",{type:"boolean",allowundefined:!0}],["aria-flowto",{type:"idlist"}],["aria-grabbed",{type:"boolean",allowundefined:!0}],["aria-haspopup",{type:"token",values:[!1,!0,"menu","listbox","tree","grid","dialog"]}],["aria-hidden",{type:"boolean",allowundefined:!0}],["aria-invalid",{type:"token",values:["grammar",!1,"spelling",!0]}],["aria-keyshortcuts",{type:"string"}],["aria-label",{type:"string"}],["aria-labelledby",{type:"idlist"}],["aria-level",{type:"integer"}],["aria-live",{type:"token",values:["assertive","off","polite"]}],["aria-modal",{type:"boolean"}],["aria-multiline",{type:"boolean"}],["aria-multiselectable",{type:"boolean"}],["aria-orientation",{type:"token",values:["vertical","undefined","horizontal"]}],["aria-owns",{type:"idlist"}],["aria-placeholder",{type:"string"}],["aria-posinset",{type:"integer"}],["aria-pressed",{type:"tristate"}],["aria-readonly",{type:"boolean"}],["aria-relevant",{type:"tokenlist",values:["additions","all","removals","text"]}],["aria-required",{type:"boolean"}],["aria-roledescription",{type:"string"}],["aria-rowcount",{type:"integer"}],["aria-rowindex",{type:"integer"}],["aria-rowspan",{type:"integer"}],["aria-selected",{type:"boolean",allowundefined:!0}],["aria-setsize",{type:"integer"}],["aria-sort",{type:"token",values:["ascending","descending","none","other"]}],["aria-valuemax",{type:"number"}],["aria-valuemin",{type:"number"}],["aria-valuenow",{type:"number"}],["aria-valuetext",{type:"string"}]],d={entries:function(){return u},forEach:function(p){var m=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null,g=o(u),b;try{for(g.s();!(b=g.n()).done;){var h=r(b.value,2),w=h[0],x=h[1];p.call(m,x,w,u)}}catch(T){g.e(T)}finally{g.f()}},get:function(p){var m=u.find(function(g){return g[0]===p});return m&&m[1]},has:function(p){return!!d.get(p)},keys:function(){return u.map(function(p){var m=r(p,1),g=m[0];return g})},values:function(){return u.map(function(p){var m=r(p,2),g=m[1];return g})}},c=(0,e.default)(d,d.entries());return Xr.default=c,Xr}var Qr={},Ad;function vE(){if(Ad)return Qr;Ad=1,Object.defineProperty(Qr,"__esModule",{value:!0}),Qr.default=void 0;var e=t(si());function t(f){return f&&f.__esModule?f:{default:f}}function r(f,p){return i(f)||a(f,p)||s(f,p)||n()}function n(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
36
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function a(f,p){var m=f==null?null:typeof Symbol<"u"&&f[Symbol.iterator]||f["@@iterator"];if(m!=null){var g=[],b=!0,h=!1,w,x;try{for(m=m.call(f);!(b=(w=m.next()).done)&&(g.push(w.value),!(p&&g.length===p));b=!0);}catch(T){h=!0,x=T}finally{try{!b&&m.return!=null&&m.return()}finally{if(h)throw x}}return g}}function i(f){if(Array.isArray(f))return f}function o(f,p){var m=typeof Symbol<"u"&&f[Symbol.iterator]||f["@@iterator"];if(!m){if(Array.isArray(f)||(m=s(f))||p){m&&(f=m);var g=0,b=function(){};return{s:b,n:function(){return g>=f.length?{done:!0}:{done:!1,value:f[g++]}},e:function(E){throw E},f:b}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
37
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var h=!0,w=!1,x;return{s:function(){m=m.call(f)},n:function(){var E=m.next();return h=E.done,E},e:function(E){w=!0,x=E},f:function(){try{!h&&m.return!=null&&m.return()}finally{if(w)throw x}}}}function s(f,p){if(f){if(typeof f=="string")return l(f,p);var m=Object.prototype.toString.call(f).slice(8,-1);if(m==="Object"&&f.constructor&&(m=f.constructor.name),m==="Map"||m==="Set")return Array.from(f);if(m==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(m))return l(f,p)}}function l(f,p){(p==null||p>f.length)&&(p=f.length);for(var m=0,g=new Array(p);m<p;m++)g[m]=f[m];return g}var u=[["a",{reserved:!1}],["abbr",{reserved:!1}],["acronym",{reserved:!1}],["address",{reserved:!1}],["applet",{reserved:!1}],["area",{reserved:!1}],["article",{reserved:!1}],["aside",{reserved:!1}],["audio",{reserved:!1}],["b",{reserved:!1}],["base",{reserved:!0}],["bdi",{reserved:!1}],["bdo",{reserved:!1}],["big",{reserved:!1}],["blink",{reserved:!1}],["blockquote",{reserved:!1}],["body",{reserved:!1}],["br",{reserved:!1}],["button",{reserved:!1}],["canvas",{reserved:!1}],["caption",{reserved:!1}],["center",{reserved:!1}],["cite",{reserved:!1}],["code",{reserved:!1}],["col",{reserved:!0}],["colgroup",{reserved:!0}],["content",{reserved:!1}],["data",{reserved:!1}],["datalist",{reserved:!1}],["dd",{reserved:!1}],["del",{reserved:!1}],["details",{reserved:!1}],["dfn",{reserved:!1}],["dialog",{reserved:!1}],["dir",{reserved:!1}],["div",{reserved:!1}],["dl",{reserved:!1}],["dt",{reserved:!1}],["em",{reserved:!1}],["embed",{reserved:!1}],["fieldset",{reserved:!1}],["figcaption",{reserved:!1}],["figure",{reserved:!1}],["font",{reserved:!1}],["footer",{reserved:!1}],["form",{reserved:!1}],["frame",{reserved:!1}],["frameset",{reserved:!1}],["h1",{reserved:!1}],["h2",{reserved:!1}],["h3",{reserved:!1}],["h4",{reserved:!1}],["h5",{reserved:!1}],["h6",{reserved:!1}],["head",{reserved:!0}],["header",{reserved:!1}],["hgroup",{reserved:!1}],["hr",{reserved:!1}],["html",{reserved:!0}],["i",{reserved:!1}],["iframe",{reserved:!1}],["img",{reserved:!1}],["input",{reserved:!1}],["ins",{reserved:!1}],["kbd",{reserved:!1}],["keygen",{reserved:!1}],["label",{reserved:!1}],["legend",{reserved:!1}],["li",{reserved:!1}],["link",{reserved:!0}],["main",{reserved:!1}],["map",{reserved:!1}],["mark",{reserved:!1}],["marquee",{reserved:!1}],["menu",{reserved:!1}],["menuitem",{reserved:!1}],["meta",{reserved:!0}],["meter",{reserved:!1}],["nav",{reserved:!1}],["noembed",{reserved:!0}],["noscript",{reserved:!0}],["object",{reserved:!1}],["ol",{reserved:!1}],["optgroup",{reserved:!1}],["option",{reserved:!1}],["output",{reserved:!1}],["p",{reserved:!1}],["param",{reserved:!0}],["picture",{reserved:!0}],["pre",{reserved:!1}],["progress",{reserved:!1}],["q",{reserved:!1}],["rp",{reserved:!1}],["rt",{reserved:!1}],["rtc",{reserved:!1}],["ruby",{reserved:!1}],["s",{reserved:!1}],["samp",{reserved:!1}],["script",{reserved:!0}],["section",{reserved:!1}],["select",{reserved:!1}],["small",{reserved:!1}],["source",{reserved:!0}],["spacer",{reserved:!1}],["span",{reserved:!1}],["strike",{reserved:!1}],["strong",{reserved:!1}],["style",{reserved:!0}],["sub",{reserved:!1}],["summary",{reserved:!1}],["sup",{reserved:!1}],["table",{reserved:!1}],["tbody",{reserved:!1}],["td",{reserved:!1}],["textarea",{reserved:!1}],["tfoot",{reserved:!1}],["th",{reserved:!1}],["thead",{reserved:!1}],["time",{reserved:!1}],["title",{reserved:!0}],["tr",{reserved:!1}],["track",{reserved:!0}],["tt",{reserved:!1}],["u",{reserved:!1}],["ul",{reserved:!1}],["var",{reserved:!1}],["video",{reserved:!1}],["wbr",{reserved:!1}],["xmp",{reserved:!1}]],d={entries:function(){return u},forEach:function(p){var m=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null,g=o(u),b;try{for(g.s();!(b=g.n()).done;){var h=r(b.value,2),w=h[0],x=h[1];p.call(m,x,w,u)}}catch(T){g.e(T)}finally{g.f()}},get:function(p){var m=u.find(function(g){return g[0]===p});return m&&m[1]},has:function(p){return!!d.get(p)},keys:function(){return u.map(function(p){var m=r(p,1),g=m[0];return g})},values:function(){return u.map(function(p){var m=r(p,2),g=m[1];return g})}},c=(0,e.default)(d,d.entries());return Qr.default=c,Qr}var Zr={},en={},tn={},qd;function wE(){if(qd)return tn;qd=1,Object.defineProperty(tn,"__esModule",{value:!0}),tn.default=void 0;var e={abstract:!0,accessibleNameRequired:!1,baseConcepts:[],childrenPresentational:!1,nameFrom:["author"],prohibitedProps:[],props:{},relatedConcepts:[],requireContextRole:[],requiredContextRole:[],requiredOwnedElements:[],requiredProps:{},superClass:[["roletype","widget"]]},t=e;return tn.default=t,tn}var rn={},Id;function xE(){if(Id)return rn;Id=1,Object.defineProperty(rn,"__esModule",{value:!0}),rn.default=void 0;var e={abstract:!0,accessibleNameRequired:!1,baseConcepts:[],childrenPresentational:!1,nameFrom:["author"],prohibitedProps:[],props:{"aria-activedescendant":null,"aria-disabled":null},relatedConcepts:[],requireContextRole:[],requiredContextRole:[],requiredOwnedElements:[],requiredProps:{},superClass:[["roletype","widget"]]},t=e;return rn.default=t,rn}var nn={},Od;function RE(){if(Od)return nn;Od=1,Object.defineProperty(nn,"__esModule",{value:!0}),nn.default=void 0;var e={abstract:!0,accessibleNameRequired:!1,baseConcepts:[],childrenPresentational:!1,nameFrom:["author"],prohibitedProps:[],props:{"aria-disabled":null},relatedConcepts:[{concept:{name:"input"},module:"XForms"}],requireContextRole:[],requiredContextRole:[],requiredOwnedElements:[],requiredProps:{},superClass:[["roletype","widget"]]},t=e;return nn.default=t,nn}var an={},Nd;function CE(){if(Nd)return an;Nd=1,Object.defineProperty(an,"__esModule",{value:!0}),an.default=void 0;var e={abstract:!0,accessibleNameRequired:!1,baseConcepts:[],childrenPresentational:!1,nameFrom:["author"],prohibitedProps:[],props:{},relatedConcepts:[],requireContextRole:[],requiredContextRole:[],requiredOwnedElements:[],requiredProps:{},superClass:[["roletype","structure","section"]]},t=e;return an.default=t,an}var on={},$d;function EE(){if($d)return on;$d=1,Object.defineProperty(on,"__esModule",{value:!0}),on.default=void 0;var e={abstract:!0,accessibleNameRequired:!1,baseConcepts:[],childrenPresentational:!1,nameFrom:["author"],prohibitedProps:[],props:{"aria-valuemax":null,"aria-valuemin":null,"aria-valuenow":null},relatedConcepts:[],requireContextRole:[],requiredContextRole:[],requiredOwnedElements:[],requiredProps:{},superClass:[["roletype","structure"]]},t=e;return on.default=t,on}var sn={},jd;function TE(){if(jd)return sn;jd=1,Object.defineProperty(sn,"__esModule",{value:!0}),sn.default=void 0;var e={abstract:!0,accessibleNameRequired:!1,baseConcepts:[],childrenPresentational:!1,nameFrom:[],prohibitedProps:[],props:{"aria-atomic":null,"aria-busy":null,"aria-controls":null,"aria-current":null,"aria-describedby":null,"aria-details":null,"aria-dropeffect":null,"aria-flowto":null,"aria-grabbed":null,"aria-hidden":null,"aria-keyshortcuts":null,"aria-label":null,"aria-labelledby":null,"aria-live":null,"aria-owns":null,"aria-relevant":null,"aria-roledescription":null},relatedConcepts:[{concept:{name:"role"},module:"XHTML"},{concept:{name:"type"},module:"Dublin Core"}],requireContextRole:[],requiredContextRole:[],requiredOwnedElements:[],requiredProps:{},superClass:[]},t=e;return sn.default=t,sn}var ln={},Dd;function SE(){if(Dd)return ln;Dd=1,Object.defineProperty(ln,"__esModule",{value:!0}),ln.default=void 0;var e={abstract:!0,accessibleNameRequired:!1,baseConcepts:[],childrenPresentational:!1,nameFrom:[],prohibitedProps:[],props:{},relatedConcepts:[{concept:{name:"frontmatter"},module:"DTB"},{concept:{name:"level"},module:"DTB"},{concept:{name:"level"},module:"SMIL"}],requireContextRole:[],requiredContextRole:[],requiredOwnedElements:[],requiredProps:{},superClass:[["roletype","structure"]]},t=e;return ln.default=t,ln}var un={},Ld;function _E(){if(Ld)return un;Ld=1,Object.defineProperty(un,"__esModule",{value:!0}),un.default=void 0;var e={abstract:!0,accessibleNameRequired:!1,baseConcepts:[],childrenPresentational:!1,nameFrom:["author","contents"],prohibitedProps:[],props:{},relatedConcepts:[],requireContextRole:[],requiredContextRole:[],requiredOwnedElements:[],requiredProps:{},superClass:[["roletype","structure"]]},t=e;return un.default=t,un}var cn={},Fd;function PE(){if(Fd)return cn;Fd=1,Object.defineProperty(cn,"__esModule",{value:!0}),cn.default=void 0;var e={abstract:!0,accessibleNameRequired:!1,baseConcepts:[],childrenPresentational:!1,nameFrom:["author"],prohibitedProps:[],props:{"aria-orientation":null},relatedConcepts:[],requireContextRole:[],requiredContextRole:[],requiredOwnedElements:[],requiredProps:{},superClass:[["roletype","widget","composite"],["roletype","structure","section","group"]]},t=e;return cn.default=t,cn}var dn={},Bd;function kE(){if(Bd)return dn;Bd=1,Object.defineProperty(dn,"__esModule",{value:!0}),dn.default=void 0;var e={abstract:!0,accessibleNameRequired:!1,baseConcepts:[],childrenPresentational:!1,nameFrom:[],prohibitedProps:[],props:{},relatedConcepts:[],requireContextRole:[],requiredContextRole:[],requiredOwnedElements:[],requiredProps:{},superClass:[["roletype"]]},t=e;return dn.default=t,dn}var fn={},zd;function ME(){if(zd)return fn;zd=1,Object.defineProperty(fn,"__esModule",{value:!0}),fn.default=void 0;var e={abstract:!0,accessibleNameRequired:!1,baseConcepts:[],childrenPresentational:!1,nameFrom:[],prohibitedProps:[],props:{},relatedConcepts:[],requireContextRole:[],requiredContextRole:[],requiredOwnedElements:[],requiredProps:{},superClass:[["roletype"]]},t=e;return fn.default=t,fn}var pn={},Ud;function AE(){if(Ud)return pn;Ud=1,Object.defineProperty(pn,"__esModule",{value:!0}),pn.default=void 0;var e={abstract:!0,accessibleNameRequired:!1,baseConcepts:[],childrenPresentational:!1,nameFrom:["author"],prohibitedProps:[],props:{"aria-modal":null},relatedConcepts:[],requireContextRole:[],requiredContextRole:[],requiredOwnedElements:[],requiredProps:{},superClass:[["roletype"]]},t=e;return pn.default=t,pn}var Wd;function qE(){if(Wd)return en;Wd=1,Object.defineProperty(en,"__esModule",{value:!0}),en.default=void 0;var e=f(wE()),t=f(xE()),r=f(RE()),n=f(CE()),a=f(EE()),i=f(TE()),o=f(SE()),s=f(_E()),l=f(PE()),u=f(kE()),d=f(ME()),c=f(AE());function f(g){return g&&g.__esModule?g:{default:g}}var p=[["command",e.default],["composite",t.default],["input",r.default],["landmark",n.default],["range",a.default],["roletype",i.default],["section",o.default],["sectionhead",s.default],["select",l.default],["structure",u.default],["widget",d.default],["window",c.default]],m=p;return en.default=m,en}var mn={},hn={},Vd;function IE(){if(Vd)return hn;Vd=1,Object.defineProperty(hn,"__esModule",{value:!0}),hn.default=void 0;var e={abstract:!1,accessibleNameRequired:!1,baseConcepts:[],childrenPresentational:!1,nameFrom:["author"],prohibitedProps:[],props:{"aria-atomic":"true","aria-live":"assertive"},relatedConcepts:[{concept:{name:"alert"},module:"XForms"}],requireContextRole:[],requiredContextRole:[],requiredOwnedElements:[],requiredProps:{},superClass:[["roletype","structure","section"]]},t=e;return hn.default=t,hn}var gn={},Hd;function OE(){if(Hd)return gn;Hd=1,Object.defineProperty(gn,"__esModule",{value:!0}),gn.default=void 0;var e={abstract:!1,accessibleNameRequired:!0,baseConcepts:[],childrenPresentational:!1,nameFrom:["author"],prohibitedProps:[],props:{},relatedConcepts:[{concept:{name:"alert"},module:"XForms"}],requireContextRole:[],requiredContextRole:[],requiredOwnedElements:[],requiredProps:{},superClass:[["roletype","structure","section","alert"],["roletype","window","dialog"]]},t=e;return gn.default=t,gn}var bn={},Gd;function NE(){if(Gd)return bn;Gd=1,Object.defineProperty(bn,"__esModule",{value:!0}),bn.default=void 0;var e={abstract:!1,accessibleNameRequired:!0,baseConcepts:[],childrenPresentational:!1,nameFrom:["author"],prohibitedProps:[],props:{"aria-activedescendant":null,"aria-disabled":null,"aria-errormessage":null,"aria-expanded":null,"aria-haspopup":null,"aria-invalid":null},relatedConcepts:[{concept:{name:"Device Independence Delivery Unit"}}],requireContextRole:[],requiredContextRole:[],requiredOwnedElements:[],requiredProps:{},superClass:[["roletype","structure"]]},t=e;return bn.default=t,bn}var yn={},Kd;function $E(){if(Kd)return yn;Kd=1,Object.defineProperty(yn,"__esModule",{value:!0}),yn.default=void 0;var e={abstract:!1,accessibleNameRequired:!1,baseConcepts:[],childrenPresentational:!1,nameFrom:["author"],prohibitedProps:[],props:{"aria-posinset":null,"aria-setsize":null},relatedConcepts:[{concept:{name:"article"},module:"HTML"}],requireContextRole:[],requiredContextRole:[],requiredOwnedElements:[],requiredProps:{},superClass:[["roletype","structure","document"]]},t=e;return yn.default=t,yn}var vn={},Jd;function jE(){if(Jd)return vn;Jd=1,Object.defineProperty(vn,"__esModule",{value:!0}),vn.default=void 0;var e={abstract:!1,accessibleNameRequired:!1,baseConcepts:[],childrenPresentational:!1,nameFrom:["author"],prohibitedProps:[],props:{},relatedConcepts:[{concept:{constraints:["scoped to the body element"],name:"header"},module:"HTML"}],requireContextRole:[],requiredContextRole:[],requiredOwnedElements:[],requiredProps:{},superClass:[["roletype","structure","section","landmark"]]},t=e;return vn.default=t,vn}var wn={},Xd;function DE(){if(Xd)return wn;Xd=1,Object.defineProperty(wn,"__esModule",{value:!0}),wn.default=void 0;var e={abstract:!1,accessibleNameRequired:!1,baseConcepts:[],childrenPresentational:!1,nameFrom:["author"],prohibitedProps:[],props:{},relatedConcepts:[{concept:{name:"blockquote"},module:"HTML"}],requireContextRole:[],requiredContextRole:[],requiredOwnedElements:[],requiredProps:{},superClass:[["roletype","structure","section"]]},t=e;return wn.default=t,wn}var xn={},Yd;function LE(){if(Yd)return xn;Yd=1,Object.defineProperty(xn,"__esModule",{value:!0}),xn.default=void 0;var e={abstract:!1,accessibleNameRequired:!0,baseConcepts:[],childrenPresentational:!0,nameFrom:["author","contents"],prohibitedProps:[],props:{"aria-disabled":null,"aria-expanded":null,"aria-haspopup":null,"aria-pressed":null},relatedConcepts:[{concept:{attributes:[{name:"type",value:"button"}],name:"input"},module:"HTML"},{concept:{attributes:[{name:"type",value:"image"}],name:"input"},module:"HTML"},{concept:{attributes:[{name:"type",value:"reset"}],name:"input"},module:"HTML"},{concept:{attributes:[{name:"type",value:"submit"}],name:"input"},module:"HTML"},{concept:{name:"button"},module:"HTML"},{concept:{name:"trigger"},module:"XForms"}],requireContextRole:[],requiredContextRole:[],requiredOwnedElements:[],requiredProps:{},superClass:[["roletype","widget","command"]]},t=e;return xn.default=t,xn}var Rn={},Qd;function FE(){if(Qd)return Rn;Qd=1,Object.defineProperty(Rn,"__esModule",{value:!0}),Rn.default=void 0;var e={abstract:!1,accessibleNameRequired:!1,baseConcepts:[],childrenPresentational:!1,nameFrom:["prohibited"],prohibitedProps:["aria-label","aria-labelledby"],props:{},relatedConcepts:[{concept:{name:"caption"},module:"HTML"}],requireContextRole:["figure","grid","table"],requiredContextRole:["figure","grid","table"],requiredOwnedElements:[],requiredProps:{},superClass:[["roletype","structure","section"]]},t=e;return Rn.default=t,Rn}var Cn={},Zd;function BE(){if(Zd)return Cn;Zd=1,Object.defineProperty(Cn,"__esModule",{value:!0}),Cn.default=void 0;var e={abstract:!1,accessibleNameRequired:!1,baseConcepts:[],childrenPresentational:!1,nameFrom:["author","contents"],prohibitedProps:[],props:{"aria-colindex":null,"aria-colspan":null,"aria-rowindex":null,"aria-rowspan":null},relatedConcepts:[{concept:{constraints:["ancestor table element has table role"],name:"td"},module:"HTML"}],requireContextRole:["row"],requiredContextRole:["row"],requiredOwnedElements:[],requiredProps:{},superClass:[["roletype","structure","section"]]},t=e;return Cn.default=t,Cn}var En={},ef;function zE(){if(ef)return En;ef=1,Object.defineProperty(En,"__esModule",{value:!0}),En.default=void 0;var e={abstract:!1,accessibleNameRequired:!0,baseConcepts:[],childrenPresentational:!0,nameFrom:["author","contents"],prohibitedProps:[],props:{"aria-checked":null,"aria-errormessage":null,"aria-expanded":null,"aria-invalid":null,"aria-readonly":null,"aria-required":null},relatedConcepts:[{concept:{attributes:[{name:"type",value:"checkbox"}],name:"input"},module:"HTML"},{concept:{name:"option"},module:"ARIA"}],requireContextRole:[],requiredContextRole:[],requiredOwnedElements:[],requiredProps:{"aria-checked":null},superClass:[["roletype","widget","input"]]},t=e;return En.default=t,En}var Tn={},tf;function UE(){if(tf)return Tn;tf=1,Object.defineProperty(Tn,"__esModule",{value:!0}),Tn.default=void 0;var e={abstract:!1,accessibleNameRequired:!1,baseConcepts:[],childrenPresentational:!1,nameFrom:["prohibited"],prohibitedProps:["aria-label","aria-labelledby"],props:{},relatedConcepts:[{concept:{name:"code"},module:"HTML"}],requireContextRole:[],requiredContextRole:[],requiredOwnedElements:[],requiredProps:{},superClass:[["roletype","structure","section"]]},t=e;return Tn.default=t,Tn}var Sn={},rf;function WE(){if(rf)return Sn;rf=1,Object.defineProperty(Sn,"__esModule",{value:!0}),Sn.default=void 0;var e={abstract:!1,accessibleNameRequired:!0,baseConcepts:[],childrenPresentational:!1,nameFrom:["author","contents"],prohibitedProps:[],props:{"aria-sort":null},relatedConcepts:[{concept:{name:"th"},module:"HTML"},{concept:{attributes:[{name:"scope",value:"col"}],name:"th"},module:"HTML"},{concept:{attributes:[{name:"scope",value:"colgroup"}],name:"th"},module:"HTML"}],requireContextRole:["row"],requiredContextRole:["row"],requiredOwnedElements:[],requiredProps:{},superClass:[["roletype","structure","section","cell"],["roletype","structure","section","cell","gridcell"],["roletype","widget","gridcell"],["roletype","structure","sectionhead"]]},t=e;return Sn.default=t,Sn}var _n={},nf;function VE(){if(nf)return _n;nf=1,Object.defineProperty(_n,"__esModule",{value:!0}),_n.default=void 0;var e={abstract:!1,accessibleNameRequired:!0,baseConcepts:[],childrenPresentational:!1,nameFrom:["author"],prohibitedProps:[],props:{"aria-activedescendant":null,"aria-autocomplete":null,"aria-errormessage":null,"aria-invalid":null,"aria-readonly":null,"aria-required":null,"aria-expanded":"false","aria-haspopup":"listbox"},relatedConcepts:[{concept:{attributes:[{constraints:["set"],name:"list"},{name:"type",value:"email"}],name:"input"},module:"HTML"},{concept:{attributes:[{constraints:["set"],name:"list"},{name:"type",value:"search"}],name:"input"},module:"HTML"},{concept:{attributes:[{constraints:["set"],name:"list"},{name:"type",value:"tel"}],name:"input"},module:"HTML"},{concept:{attributes:[{constraints:["set"],name:"list"},{name:"type",value:"text"}],name:"input"},module:"HTML"},{concept:{attributes:[{constraints:["set"],name:"list"},{name:"type",value:"url"}],name:"input"},module:"HTML"},{concept:{attributes:[{constraints:["set"],name:"list"},{name:"type",value:"url"}],name:"input"},module:"HTML"},{concept:{attributes:[{constraints:["undefined"],name:"multiple"},{constraints:["undefined"],name:"size"}],constraints:["the multiple attribute is not set and the size attribute does not have a value greater than 1"],name:"select"},module:"HTML"},{concept:{name:"select"},module:"XForms"}],requireContextRole:[],requiredContextRole:[],requiredOwnedElements:[],requiredProps:{"aria-controls":null,"aria-expanded":"false"},superClass:[["roletype","widget","input"]]},t=e;return _n.default=t,_n}var Pn={},af;function HE(){if(af)return Pn;af=1,Object.defineProperty(Pn,"__esModule",{value:!0}),Pn.default=void 0;var e={abstract:!1,accessibleNameRequired:!1,baseConcepts:[],childrenPresentational:!1,nameFrom:["author"],prohibitedProps:[],props:{},relatedConcepts:[{concept:{name:"aside"},module:"HTML"},{concept:{attributes:[{constraints:["set"],name:"aria-label"}],constraints:["scoped to a sectioning content element","scoped to a sectioning root element other than body"],name:"aside"},module:"HTML"},{concept:{attributes:[{constraints:["set"],name:"aria-labelledby"}],constraints:["scoped to a sectioning content element","scoped to a sectioning root element other than body"],name:"aside"},module:"HTML"}],requireContextRole:[],requiredContextRole:[],requiredOwnedElements:[],requiredProps:{},superClass:[["roletype","structure","section","landmark"]]},t=e;return Pn.default=t,Pn}var kn={},of;function GE(){if(of)return kn;of=1,Object.defineProperty(kn,"__esModule",{value:!0}),kn.default=void 0;var e={abstract:!1,accessibleNameRequired:!1,baseConcepts:[],childrenPresentational:!1,nameFrom:["author"],prohibitedProps:[],props:{},relatedConcepts:[{concept:{constraints:["scoped to the body element"],name:"footer"},module:"HTML"}],requireContextRole:[],requiredContextRole:[],requiredOwnedElements:[],requiredProps:{},superClass:[["roletype","structure","section","landmark"]]},t=e;return kn.default=t,kn}var Mn={},sf;function KE(){if(sf)return Mn;sf=1,Object.defineProperty(Mn,"__esModule",{value:!0}),Mn.default=void 0;var e={abstract:!1,accessibleNameRequired:!1,baseConcepts:[],childrenPresentational:!1,nameFrom:["author"],prohibitedProps:[],props:{},relatedConcepts:[{concept:{name:"dd"},module:"HTML"}],requireContextRole:[],requiredContextRole:[],requiredOwnedElements:[],requiredProps:{},superClass:[["roletype","structure","section"]]},t=e;return Mn.default=t,Mn}var An={},lf;function JE(){if(lf)return An;lf=1,Object.defineProperty(An,"__esModule",{value:!0}),An.default=void 0;var e={abstract:!1,accessibleNameRequired:!1,baseConcepts:[],childrenPresentational:!1,nameFrom:["prohibited"],prohibitedProps:["aria-label","aria-labelledby"],props:{},relatedConcepts:[{concept:{name:"del"},module:"HTML"}],requireContextRole:[],requiredContextRole:[],requiredOwnedElements:[],requiredProps:{},superClass:[["roletype","structure","section"]]},t=e;return An.default=t,An}var qn={},uf;function XE(){if(uf)return qn;uf=1,Object.defineProperty(qn,"__esModule",{value:!0}),qn.default=void 0;var e={abstract:!1,accessibleNameRequired:!0,baseConcepts:[],childrenPresentational:!1,nameFrom:["author"],prohibitedProps:[],props:{},relatedConcepts:[{concept:{name:"dialog"},module:"HTML"}],requireContextRole:[],requiredContextRole:[],requiredOwnedElements:[],requiredProps:{},superClass:[["roletype","window"]]},t=e;return qn.default=t,qn}var In={},cf;function YE(){if(cf)return In;cf=1,Object.defineProperty(In,"__esModule",{value:!0}),In.default=void 0;var e={abstract:!1,accessibleNameRequired:!1,baseConcepts:[],childrenPresentational:!1,nameFrom:["author"],prohibitedProps:[],props:{},relatedConcepts:[{module:"DAISY Guide"}],requireContextRole:[],requiredContextRole:[],requiredOwnedElements:[],requiredProps:{},superClass:[["roletype","structure","section","list"]]},t=e;return In.default=t,In}var On={},df;function QE(){if(df)return On;df=1,Object.defineProperty(On,"__esModule",{value:!0}),On.default=void 0;var e={abstract:!1,accessibleNameRequired:!1,baseConcepts:[],childrenPresentational:!1,nameFrom:["author"],prohibitedProps:[],props:{},relatedConcepts:[{concept:{name:"Device Independence Delivery Unit"}},{concept:{name:"html"},module:"HTML"}],requireContextRole:[],requiredContextRole:[],requiredOwnedElements:[],requiredProps:{},superClass:[["roletype","structure"]]},t=e;return On.default=t,On}var Nn={},ff;function ZE(){if(ff)return Nn;ff=1,Object.defineProperty(Nn,"__esModule",{value:!0}),Nn.default=void 0;var e={abstract:!1,accessibleNameRequired:!1,baseConcepts:[],childrenPresentational:!1,nameFrom:["prohibited"],prohibitedProps:["aria-label","aria-labelledby"],props:{},relatedConcepts:[{concept:{name:"em"},module:"HTML"}],requireContextRole:[],requiredContextRole:[],requiredOwnedElements:[],requiredProps:{},superClass:[["roletype","structure","section"]]},t=e;return Nn.default=t,Nn}var $n={},pf;function e1(){if(pf)return $n;pf=1,Object.defineProperty($n,"__esModule",{value:!0}),$n.default=void 0;var e={abstract:!1,accessibleNameRequired:!1,baseConcepts:[],childrenPresentational:!1,nameFrom:["author"],prohibitedProps:[],props:{},relatedConcepts:[],requireContextRole:[],requiredContextRole:[],requiredOwnedElements:[["article"]],requiredProps:{},superClass:[["roletype","structure","section","list"]]},t=e;return $n.default=t,$n}var jn={},mf;function t1(){if(mf)return jn;mf=1,Object.defineProperty(jn,"__esModule",{value:!0}),jn.default=void 0;var e={abstract:!1,accessibleNameRequired:!1,baseConcepts:[],childrenPresentational:!1,nameFrom:["author"],prohibitedProps:[],props:{},relatedConcepts:[{concept:{name:"figure"},module:"HTML"}],requireContextRole:[],requiredContextRole:[],requiredOwnedElements:[],requiredProps:{},superClass:[["roletype","structure","section"]]},t=e;return jn.default=t,jn}var Dn={},hf;function r1(){if(hf)return Dn;hf=1,Object.defineProperty(Dn,"__esModule",{value:!0}),Dn.default=void 0;var e={abstract:!1,accessibleNameRequired:!1,baseConcepts:[],childrenPresentational:!1,nameFrom:["author"],prohibitedProps:[],props:{},relatedConcepts:[{concept:{attributes:[{constraints:["set"],name:"aria-label"}],name:"form"},module:"HTML"},{concept:{attributes:[{constraints:["set"],name:"aria-labelledby"}],name:"form"},module:"HTML"},{concept:{attributes:[{constraints:["set"],name:"name"}],name:"form"},module:"HTML"}],requireContextRole:[],requiredContextRole:[],requiredOwnedElements:[],requiredProps:{},superClass:[["roletype","structure","section","landmark"]]},t=e;return Dn.default=t,Dn}var Ln={},gf;function n1(){if(gf)return Ln;gf=1,Object.defineProperty(Ln,"__esModule",{value:!0}),Ln.default=void 0;var e={abstract:!1,accessibleNameRequired:!1,baseConcepts:[],childrenPresentational:!1,nameFrom:["prohibited"],prohibitedProps:["aria-label","aria-labelledby"],props:{},relatedConcepts:[{concept:{name:"a"},module:"HTML"},{concept:{name:"area"},module:"HTML"},{concept:{name:"aside"},module:"HTML"},{concept:{name:"b"},module:"HTML"},{concept:{name:"bdo"},module:"HTML"},{concept:{name:"body"},module:"HTML"},{concept:{name:"data"},module:"HTML"},{concept:{name:"div"},module:"HTML"},{concept:{constraints:["scoped to the main element","scoped to a sectioning content element","scoped to a sectioning root element other than body"],name:"footer"},module:"HTML"},{concept:{constraints:["scoped to the main element","scoped to a sectioning content element","scoped to a sectioning root element other than body"],name:"header"},module:"HTML"},{concept:{name:"hgroup"},module:"HTML"},{concept:{name:"i"},module:"HTML"},{concept:{name:"pre"},module:"HTML"},{concept:{name:"q"},module:"HTML"},{concept:{name:"samp"},module:"HTML"},{concept:{name:"section"},module:"HTML"},{concept:{name:"small"},module:"HTML"},{concept:{name:"span"},module:"HTML"},{concept:{name:"u"},module:"HTML"}],requireContextRole:[],requiredContextRole:[],requiredOwnedElements:[],requiredProps:{},superClass:[["roletype","structure"]]},t=e;return Ln.default=t,Ln}var Fn={},bf;function a1(){if(bf)return Fn;bf=1,Object.defineProperty(Fn,"__esModule",{value:!0}),Fn.default=void 0;var e={abstract:!1,accessibleNameRequired:!0,baseConcepts:[],childrenPresentational:!1,nameFrom:["author"],prohibitedProps:[],props:{"aria-multiselectable":null,"aria-readonly":null},relatedConcepts:[],requireContextRole:[],requiredContextRole:[],requiredOwnedElements:[["row"],["row","rowgroup"]],requiredProps:{},superClass:[["roletype","widget","composite"],["roletype","structure","section","table"]]},t=e;return Fn.default=t,Fn}var Bn={},yf;function o1(){if(yf)return Bn;yf=1,Object.defineProperty(Bn,"__esModule",{value:!0}),Bn.default=void 0;var e={abstract:!1,accessibleNameRequired:!1,baseConcepts:[],childrenPresentational:!1,nameFrom:["author","contents"],prohibitedProps:[],props:{"aria-disabled":null,"aria-errormessage":null,"aria-expanded":null,"aria-haspopup":null,"aria-invalid":null,"aria-readonly":null,"aria-required":null,"aria-selected":null},relatedConcepts:[{concept:{constraints:["ancestor table element has grid role","ancestor table element has treegrid role"],name:"td"},module:"HTML"}],requireContextRole:["row"],requiredContextRole:["row"],requiredOwnedElements:[],requiredProps:{},superClass:[["roletype","structure","section","cell"],["roletype","widget"]]},t=e;return Bn.default=t,Bn}var zn={},vf;function i1(){if(vf)return zn;vf=1,Object.defineProperty(zn,"__esModule",{value:!0}),zn.default=void 0;var e={abstract:!1,accessibleNameRequired:!1,baseConcepts:[],childrenPresentational:!1,nameFrom:["author"],prohibitedProps:[],props:{"aria-activedescendant":null,"aria-disabled":null},relatedConcepts:[{concept:{name:"details"},module:"HTML"},{concept:{name:"fieldset"},module:"HTML"},{concept:{name:"optgroup"},module:"HTML"},{concept:{name:"address"},module:"HTML"}],requireContextRole:[],requiredContextRole:[],requiredOwnedElements:[],requiredProps:{},superClass:[["roletype","structure","section"]]},t=e;return zn.default=t,zn}var Un={},wf;function s1(){if(wf)return Un;wf=1,Object.defineProperty(Un,"__esModule",{value:!0}),Un.default=void 0;var e={abstract:!1,accessibleNameRequired:!0,baseConcepts:[],childrenPresentational:!1,nameFrom:["author","contents"],prohibitedProps:[],props:{"aria-level":"2"},relatedConcepts:[{concept:{name:"h1"},module:"HTML"},{concept:{name:"h2"},module:"HTML"},{concept:{name:"h3"},module:"HTML"},{concept:{name:"h4"},module:"HTML"},{concept:{name:"h5"},module:"HTML"},{concept:{name:"h6"},module:"HTML"}],requireContextRole:[],requiredContextRole:[],requiredOwnedElements:[],requiredProps:{"aria-level":"2"},superClass:[["roletype","structure","sectionhead"]]},t=e;return Un.default=t,Un}var Wn={},xf;function l1(){if(xf)return Wn;xf=1,Object.defineProperty(Wn,"__esModule",{value:!0}),Wn.default=void 0;var e={abstract:!1,accessibleNameRequired:!0,baseConcepts:[],childrenPresentational:!0,nameFrom:["author"],prohibitedProps:[],props:{},relatedConcepts:[{concept:{attributes:[{constraints:["set"],name:"alt"}],name:"img"},module:"HTML"},{concept:{attributes:[{constraints:["undefined"],name:"alt"}],name:"img"},module:"HTML"},{concept:{name:"imggroup"},module:"DTB"}],requireContextRole:[],requiredContextRole:[],requiredOwnedElements:[],requiredProps:{},superClass:[["roletype","structure","section"]]},t=e;return Wn.default=t,Wn}var Vn={},Rf;function u1(){if(Rf)return Vn;Rf=1,Object.defineProperty(Vn,"__esModule",{value:!0}),Vn.default=void 0;var e={abstract:!1,accessibleNameRequired:!1,baseConcepts:[],childrenPresentational:!1,nameFrom:["prohibited"],prohibitedProps:["aria-label","aria-labelledby"],props:{},relatedConcepts:[{concept:{name:"ins"},module:"HTML"}],requireContextRole:[],requiredContextRole:[],requiredOwnedElements:[],requiredProps:{},superClass:[["roletype","structure","section"]]},t=e;return Vn.default=t,Vn}var Hn={},Cf;function c1(){if(Cf)return Hn;Cf=1,Object.defineProperty(Hn,"__esModule",{value:!0}),Hn.default=void 0;var e={abstract:!1,accessibleNameRequired:!0,baseConcepts:[],childrenPresentational:!1,nameFrom:["author","contents"],prohibitedProps:[],props:{"aria-disabled":null,"aria-expanded":null,"aria-haspopup":null},relatedConcepts:[{concept:{attributes:[{constraints:["set"],name:"href"}],name:"a"},module:"HTML"},{concept:{attributes:[{constraints:["set"],name:"href"}],name:"area"},module:"HTML"}],requireContextRole:[],requiredContextRole:[],requiredOwnedElements:[],requiredProps:{},superClass:[["roletype","widget","command"]]},t=e;return Hn.default=t,Hn}var Gn={},Ef;function d1(){if(Ef)return Gn;Ef=1,Object.defineProperty(Gn,"__esModule",{value:!0}),Gn.default=void 0;var e={abstract:!1,accessibleNameRequired:!1,baseConcepts:[],childrenPresentational:!1,nameFrom:["author"],prohibitedProps:[],props:{},relatedConcepts:[{concept:{name:"menu"},module:"HTML"},{concept:{name:"ol"},module:"HTML"},{concept:{name:"ul"},module:"HTML"}],requireContextRole:[],requiredContextRole:[],requiredOwnedElements:[["listitem"]],requiredProps:{},superClass:[["roletype","structure","section"]]},t=e;return Gn.default=t,Gn}var Kn={},Tf;function f1(){if(Tf)return Kn;Tf=1,Object.defineProperty(Kn,"__esModule",{value:!0}),Kn.default=void 0;var e={abstract:!1,accessibleNameRequired:!0,baseConcepts:[],childrenPresentational:!1,nameFrom:["author"],prohibitedProps:[],props:{"aria-errormessage":null,"aria-expanded":null,"aria-invalid":null,"aria-multiselectable":null,"aria-readonly":null,"aria-required":null,"aria-orientation":"vertical"},relatedConcepts:[{concept:{attributes:[{constraints:[">1"],name:"size"}],constraints:["the size attribute value is greater than 1"],name:"select"},module:"HTML"},{concept:{attributes:[{name:"multiple"}],name:"select"},module:"HTML"},{concept:{name:"datalist"},module:"HTML"},{concept:{name:"list"},module:"ARIA"},{concept:{name:"select"},module:"XForms"}],requireContextRole:[],requiredContextRole:[],requiredOwnedElements:[["option","group"],["option"]],requiredProps:{},superClass:[["roletype","widget","composite","select"],["roletype","structure","section","group","select"]]},t=e;return Kn.default=t,Kn}var Jn={},Sf;function p1(){if(Sf)return Jn;Sf=1,Object.defineProperty(Jn,"__esModule",{value:!0}),Jn.default=void 0;var e={abstract:!1,accessibleNameRequired:!1,baseConcepts:[],childrenPresentational:!1,nameFrom:["author"],prohibitedProps:[],props:{"aria-level":null,"aria-posinset":null,"aria-setsize":null},relatedConcepts:[{concept:{constraints:["direct descendant of ol","direct descendant of ul","direct descendant of menu"],name:"li"},module:"HTML"},{concept:{name:"item"},module:"XForms"}],requireContextRole:["directory","list"],requiredContextRole:["directory","list"],requiredOwnedElements:[],requiredProps:{},superClass:[["roletype","structure","section"]]},t=e;return Jn.default=t,Jn}var Xn={},_f;function m1(){if(_f)return Xn;_f=1,Object.defineProperty(Xn,"__esModule",{value:!0}),Xn.default=void 0;var e={abstract:!1,accessibleNameRequired:!1,baseConcepts:[],childrenPresentational:!1,nameFrom:["author"],prohibitedProps:[],props:{"aria-live":"polite"},relatedConcepts:[],requireContextRole:[],requiredContextRole:[],requiredOwnedElements:[],requiredProps:{},superClass:[["roletype","structure","section"]]},t=e;return Xn.default=t,Xn}var Yn={},Pf;function h1(){if(Pf)return Yn;Pf=1,Object.defineProperty(Yn,"__esModule",{value:!0}),Yn.default=void 0;var e={abstract:!1,accessibleNameRequired:!1,baseConcepts:[],childrenPresentational:!1,nameFrom:["author"],prohibitedProps:[],props:{},relatedConcepts:[{concept:{name:"main"},module:"HTML"}],requireContextRole:[],requiredContextRole:[],requiredOwnedElements:[],requiredProps:{},superClass:[["roletype","structure","section","landmark"]]},t=e;return Yn.default=t,Yn}var Qn={},kf;function g1(){if(kf)return Qn;kf=1,Object.defineProperty(Qn,"__esModule",{value:!0}),Qn.default=void 0;var e={abstract:!1,accessibleNameRequired:!1,baseConcepts:[],childrenPresentational:!1,nameFrom:["prohibited"],prohibitedProps:[],props:{"aria-braillelabel":null,"aria-brailleroledescription":null,"aria-description":null},relatedConcepts:[{concept:{name:"mark"},module:"HTML"}],requireContextRole:[],requiredContextRole:[],requiredOwnedElements:[],requiredProps:{},superClass:[["roletype","structure","section"]]},t=e;return Qn.default=t,Qn}var Zn={},Mf;function b1(){if(Mf)return Zn;Mf=1,Object.defineProperty(Zn,"__esModule",{value:!0}),Zn.default=void 0;var e={abstract:!1,accessibleNameRequired:!0,baseConcepts:[],childrenPresentational:!1,nameFrom:["author"],prohibitedProps:[],props:{},relatedConcepts:[],requireContextRole:[],requiredContextRole:[],requiredOwnedElements:[],requiredProps:{},superClass:[["roletype","structure","section"]]},t=e;return Zn.default=t,Zn}var ea={},Af;function y1(){if(Af)return ea;Af=1,Object.defineProperty(ea,"__esModule",{value:!0}),ea.default=void 0;var e={abstract:!1,accessibleNameRequired:!1,baseConcepts:[],childrenPresentational:!1,nameFrom:["author"],prohibitedProps:[],props:{},relatedConcepts:[{concept:{name:"math"},module:"HTML"}],requireContextRole:[],requiredContextRole:[],requiredOwnedElements:[],requiredProps:{},superClass:[["roletype","structure","section"]]},t=e;return ea.default=t,ea}var ta={},qf;function v1(){if(qf)return ta;qf=1,Object.defineProperty(ta,"__esModule",{value:!0}),ta.default=void 0;var e={abstract:!1,accessibleNameRequired:!1,baseConcepts:[],childrenPresentational:!1,nameFrom:["author"],prohibitedProps:[],props:{"aria-orientation":"vertical"},relatedConcepts:[{concept:{name:"MENU"},module:"JAPI"},{concept:{name:"list"},module:"ARIA"},{concept:{name:"select"},module:"XForms"},{concept:{name:"sidebar"},module:"DTB"}],requireContextRole:[],requiredContextRole:[],requiredOwnedElements:[["menuitem","group"],["menuitemradio","group"],["menuitemcheckbox","group"],["menuitem"],["menuitemcheckbox"],["menuitemradio"]],requiredProps:{},superClass:[["roletype","widget","composite","select"],["roletype","structure","section","group","select"]]},t=e;return ta.default=t,ta}var ra={},If;function w1(){if(If)return ra;If=1,Object.defineProperty(ra,"__esModule",{value:!0}),ra.default=void 0;var e={abstract:!1,accessibleNameRequired:!1,baseConcepts:[],childrenPresentational:!1,nameFrom:["author"],prohibitedProps:[],props:{"aria-orientation":"horizontal"},relatedConcepts:[{concept:{name:"toolbar"},module:"ARIA"}],requireContextRole:[],requiredContextRole:[],requiredOwnedElements:[["menuitem","group"],["menuitemradio","group"],["menuitemcheckbox","group"],["menuitem"],["menuitemcheckbox"],["menuitemradio"]],requiredProps:{},superClass:[["roletype","widget","composite","select","menu"],["roletype","structure","section","group","select","menu"]]},t=e;return ra.default=t,ra}var na={},Of;function x1(){if(Of)return na;Of=1,Object.defineProperty(na,"__esModule",{value:!0}),na.default=void 0;var e={abstract:!1,accessibleNameRequired:!0,baseConcepts:[],childrenPresentational:!1,nameFrom:["author","contents"],prohibitedProps:[],props:{"aria-disabled":null,"aria-expanded":null,"aria-haspopup":null,"aria-posinset":null,"aria-setsize":null},relatedConcepts:[{concept:{name:"MENU_ITEM"},module:"JAPI"},{concept:{name:"listitem"},module:"ARIA"},{concept:{name:"option"},module:"ARIA"}],requireContextRole:["group","menu","menubar"],requiredContextRole:["group","menu","menubar"],requiredOwnedElements:[],requiredProps:{},superClass:[["roletype","widget","command"]]},t=e;return na.default=t,na}var aa={},Nf;function R1(){if(Nf)return aa;Nf=1,Object.defineProperty(aa,"__esModule",{value:!0}),aa.default=void 0;var e={abstract:!1,accessibleNameRequired:!0,baseConcepts:[],childrenPresentational:!0,nameFrom:["author","contents"],prohibitedProps:[],props:{},relatedConcepts:[{concept:{name:"menuitem"},module:"ARIA"}],requireContextRole:["group","menu","menubar"],requiredContextRole:["group","menu","menubar"],requiredOwnedElements:[],requiredProps:{"aria-checked":null},superClass:[["roletype","widget","input","checkbox"],["roletype","widget","command","menuitem"]]},t=e;return aa.default=t,aa}var oa={},$f;function C1(){if($f)return oa;$f=1,Object.defineProperty(oa,"__esModule",{value:!0}),oa.default=void 0;var e={abstract:!1,accessibleNameRequired:!0,baseConcepts:[],childrenPresentational:!0,nameFrom:["author","contents"],prohibitedProps:[],props:{},relatedConcepts:[{concept:{name:"menuitem"},module:"ARIA"}],requireContextRole:["group","menu","menubar"],requiredContextRole:["group","menu","menubar"],requiredOwnedElements:[],requiredProps:{"aria-checked":null},superClass:[["roletype","widget","input","checkbox","menuitemcheckbox"],["roletype","widget","command","menuitem","menuitemcheckbox"],["roletype","widget","input","radio"]]},t=e;return oa.default=t,oa}var ia={},jf;function E1(){if(jf)return ia;jf=1,Object.defineProperty(ia,"__esModule",{value:!0}),ia.default=void 0;var e={abstract:!1,accessibleNameRequired:!0,baseConcepts:[],childrenPresentational:!0,nameFrom:["author"],prohibitedProps:[],props:{"aria-valuetext":null,"aria-valuemax":"100","aria-valuemin":"0"},relatedConcepts:[{concept:{name:"meter"},module:"HTML"}],requireContextRole:[],requiredContextRole:[],requiredOwnedElements:[],requiredProps:{"aria-valuenow":null},superClass:[["roletype","structure","range"]]},t=e;return ia.default=t,ia}var sa={},Df;function T1(){if(Df)return sa;Df=1,Object.defineProperty(sa,"__esModule",{value:!0}),sa.default=void 0;var e={abstract:!1,accessibleNameRequired:!1,baseConcepts:[],childrenPresentational:!1,nameFrom:["author"],prohibitedProps:[],props:{},relatedConcepts:[{concept:{name:"nav"},module:"HTML"}],requireContextRole:[],requiredContextRole:[],requiredOwnedElements:[],requiredProps:{},superClass:[["roletype","structure","section","landmark"]]},t=e;return sa.default=t,sa}var la={},Lf;function S1(){if(Lf)return la;Lf=1,Object.defineProperty(la,"__esModule",{value:!0}),la.default=void 0;var e={abstract:!1,accessibleNameRequired:!1,baseConcepts:[],childrenPresentational:!1,nameFrom:[],prohibitedProps:[],props:{},relatedConcepts:[],requireContextRole:[],requiredContextRole:[],requiredOwnedElements:[],requiredProps:{},superClass:[]},t=e;return la.default=t,la}var ua={},Ff;function _1(){if(Ff)return ua;Ff=1,Object.defineProperty(ua,"__esModule",{value:!0}),ua.default=void 0;var e={abstract:!1,accessibleNameRequired:!1,baseConcepts:[],childrenPresentational:!1,nameFrom:["author"],prohibitedProps:[],props:{},relatedConcepts:[],requireContextRole:[],requiredContextRole:[],requiredOwnedElements:[],requiredProps:{},superClass:[["roletype","structure","section"]]},t=e;return ua.default=t,ua}var ca={},Bf;function P1(){if(Bf)return ca;Bf=1,Object.defineProperty(ca,"__esModule",{value:!0}),ca.default=void 0;var e={abstract:!1,accessibleNameRequired:!0,baseConcepts:[],childrenPresentational:!0,nameFrom:["author","contents"],prohibitedProps:[],props:{"aria-checked":null,"aria-posinset":null,"aria-setsize":null,"aria-selected":"false"},relatedConcepts:[{concept:{name:"item"},module:"XForms"},{concept:{name:"listitem"},module:"ARIA"},{concept:{name:"option"},module:"HTML"}],requireContextRole:[],requiredContextRole:[],requiredOwnedElements:[],requiredProps:{"aria-selected":"false"},superClass:[["roletype","widget","input"]]},t=e;return ca.default=t,ca}var da={},zf;function k1(){if(zf)return da;zf=1,Object.defineProperty(da,"__esModule",{value:!0}),da.default=void 0;var e={abstract:!1,accessibleNameRequired:!1,baseConcepts:[],childrenPresentational:!1,nameFrom:["prohibited"],prohibitedProps:["aria-label","aria-labelledby"],props:{},relatedConcepts:[{concept:{name:"p"},module:"HTML"}],requireContextRole:[],requiredContextRole:[],requiredOwnedElements:[],requiredProps:{},superClass:[["roletype","structure","section"]]},t=e;return da.default=t,da}var fa={},Uf;function M1(){if(Uf)return fa;Uf=1,Object.defineProperty(fa,"__esModule",{value:!0}),fa.default=void 0;var e={abstract:!1,accessibleNameRequired:!1,baseConcepts:[],childrenPresentational:!1,nameFrom:["prohibited"],prohibitedProps:["aria-label","aria-labelledby"],props:{},relatedConcepts:[{concept:{attributes:[{name:"alt",value:""}],name:"img"},module:"HTML"}],requireContextRole:[],requiredContextRole:[],requiredOwnedElements:[],requiredProps:{},superClass:[["roletype","structure"]]},t=e;return fa.default=t,fa}var pa={},Wf;function A1(){if(Wf)return pa;Wf=1,Object.defineProperty(pa,"__esModule",{value:!0}),pa.default=void 0;var e={abstract:!1,accessibleNameRequired:!0,baseConcepts:[],childrenPresentational:!0,nameFrom:["author"],prohibitedProps:[],props:{"aria-valuetext":null},relatedConcepts:[{concept:{name:"progress"},module:"HTML"},{concept:{name:"status"},module:"ARIA"}],requireContextRole:[],requiredContextRole:[],requiredOwnedElements:[],requiredProps:{},superClass:[["roletype","structure","range"],["roletype","widget"]]},t=e;return pa.default=t,pa}var ma={},Vf;function q1(){if(Vf)return ma;Vf=1,Object.defineProperty(ma,"__esModule",{value:!0}),ma.default=void 0;var e={abstract:!1,accessibleNameRequired:!0,baseConcepts:[],childrenPresentational:!0,nameFrom:["author","contents"],prohibitedProps:[],props:{"aria-checked":null,"aria-posinset":null,"aria-setsize":null},relatedConcepts:[{concept:{attributes:[{name:"type",value:"radio"}],name:"input"},module:"HTML"}],requireContextRole:[],requiredContextRole:[],requiredOwnedElements:[],requiredProps:{"aria-checked":null},superClass:[["roletype","widget","input"]]},t=e;return ma.default=t,ma}var ha={},Hf;function I1(){if(Hf)return ha;Hf=1,Object.defineProperty(ha,"__esModule",{value:!0}),ha.default=void 0;var e={abstract:!1,accessibleNameRequired:!0,baseConcepts:[],childrenPresentational:!1,nameFrom:["author"],prohibitedProps:[],props:{"aria-errormessage":null,"aria-invalid":null,"aria-readonly":null,"aria-required":null},relatedConcepts:[{concept:{name:"list"},module:"ARIA"}],requireContextRole:[],requiredContextRole:[],requiredOwnedElements:[["radio"]],requiredProps:{},superClass:[["roletype","widget","composite","select"],["roletype","structure","section","group","select"]]},t=e;return ha.default=t,ha}var ga={},Gf;function O1(){if(Gf)return ga;Gf=1,Object.defineProperty(ga,"__esModule",{value:!0}),ga.default=void 0;var e={abstract:!1,accessibleNameRequired:!0,baseConcepts:[],childrenPresentational:!1,nameFrom:["author"],prohibitedProps:[],props:{},relatedConcepts:[{concept:{attributes:[{constraints:["set"],name:"aria-label"}],name:"section"},module:"HTML"},{concept:{attributes:[{constraints:["set"],name:"aria-labelledby"}],name:"section"},module:"HTML"},{concept:{name:"Device Independence Glossart perceivable unit"}}],requireContextRole:[],requiredContextRole:[],requiredOwnedElements:[],requiredProps:{},superClass:[["roletype","structure","section","landmark"]]},t=e;return ga.default=t,ga}var ba={},Kf;function N1(){if(Kf)return ba;Kf=1,Object.defineProperty(ba,"__esModule",{value:!0}),ba.default=void 0;var e={abstract:!1,accessibleNameRequired:!1,baseConcepts:[],childrenPresentational:!1,nameFrom:["author","contents"],prohibitedProps:[],props:{"aria-colindex":null,"aria-expanded":null,"aria-level":null,"aria-posinset":null,"aria-rowindex":null,"aria-selected":null,"aria-setsize":null},relatedConcepts:[{concept:{name:"tr"},module:"HTML"}],requireContextRole:["grid","rowgroup","table","treegrid"],requiredContextRole:["grid","rowgroup","table","treegrid"],requiredOwnedElements:[["cell"],["columnheader"],["gridcell"],["rowheader"]],requiredProps:{},superClass:[["roletype","structure","section","group"],["roletype","widget"]]},t=e;return ba.default=t,ba}var ya={},Jf;function $1(){if(Jf)return ya;Jf=1,Object.defineProperty(ya,"__esModule",{value:!0}),ya.default=void 0;var e={abstract:!1,accessibleNameRequired:!1,baseConcepts:[],childrenPresentational:!1,nameFrom:["author","contents"],prohibitedProps:[],props:{},relatedConcepts:[{concept:{name:"tbody"},module:"HTML"},{concept:{name:"tfoot"},module:"HTML"},{concept:{name:"thead"},module:"HTML"}],requireContextRole:["grid","table","treegrid"],requiredContextRole:["grid","table","treegrid"],requiredOwnedElements:[["row"]],requiredProps:{},superClass:[["roletype","structure"]]},t=e;return ya.default=t,ya}var va={},Xf;function j1(){if(Xf)return va;Xf=1,Object.defineProperty(va,"__esModule",{value:!0}),va.default=void 0;var e={abstract:!1,accessibleNameRequired:!0,baseConcepts:[],childrenPresentational:!1,nameFrom:["author","contents"],prohibitedProps:[],props:{"aria-sort":null},relatedConcepts:[{concept:{attributes:[{name:"scope",value:"row"}],name:"th"},module:"HTML"},{concept:{attributes:[{name:"scope",value:"rowgroup"}],name:"th"},module:"HTML"}],requireContextRole:["row","rowgroup"],requiredContextRole:["row","rowgroup"],requiredOwnedElements:[],requiredProps:{},superClass:[["roletype","structure","section","cell"],["roletype","structure","section","cell","gridcell"],["roletype","widget","gridcell"],["roletype","structure","sectionhead"]]},t=e;return va.default=t,va}var wa={},Yf;function D1(){if(Yf)return wa;Yf=1,Object.defineProperty(wa,"__esModule",{value:!0}),wa.default=void 0;var e={abstract:!1,accessibleNameRequired:!1,baseConcepts:[],childrenPresentational:!0,nameFrom:["author"],prohibitedProps:[],props:{"aria-disabled":null,"aria-valuetext":null,"aria-orientation":"vertical","aria-valuemax":"100","aria-valuemin":"0"},relatedConcepts:[],requireContextRole:[],requiredContextRole:[],requiredOwnedElements:[],requiredProps:{"aria-controls":null,"aria-valuenow":null},superClass:[["roletype","structure","range"],["roletype","widget"]]},t=e;return wa.default=t,wa}var xa={},Qf;function L1(){if(Qf)return xa;Qf=1,Object.defineProperty(xa,"__esModule",{value:!0}),xa.default=void 0;var e={abstract:!1,accessibleNameRequired:!1,baseConcepts:[],childrenPresentational:!1,nameFrom:["author"],prohibitedProps:[],props:{},relatedConcepts:[],requireContextRole:[],requiredContextRole:[],requiredOwnedElements:[],requiredProps:{},superClass:[["roletype","structure","section","landmark"]]},t=e;return xa.default=t,xa}var Ra={},Zf;function F1(){if(Zf)return Ra;Zf=1,Object.defineProperty(Ra,"__esModule",{value:!0}),Ra.default=void 0;var e={abstract:!1,accessibleNameRequired:!0,baseConcepts:[],childrenPresentational:!1,nameFrom:["author"],prohibitedProps:[],props:{},relatedConcepts:[{concept:{attributes:[{constraints:["undefined"],name:"list"},{name:"type",value:"search"}],constraints:["the list attribute is not set"],name:"input"},module:"HTML"}],requireContextRole:[],requiredContextRole:[],requiredOwnedElements:[],requiredProps:{},superClass:[["roletype","widget","input","textbox"]]},t=e;return Ra.default=t,Ra}var Ca={},ep;function B1(){if(ep)return Ca;ep=1,Object.defineProperty(Ca,"__esModule",{value:!0}),Ca.default=void 0;var e={abstract:!1,accessibleNameRequired:!1,baseConcepts:[],childrenPresentational:!0,nameFrom:["author"],prohibitedProps:[],props:{"aria-disabled":null,"aria-orientation":"horizontal","aria-valuemax":"100","aria-valuemin":"0","aria-valuenow":null,"aria-valuetext":null},relatedConcepts:[{concept:{name:"hr"},module:"HTML"}],requireContextRole:[],requiredContextRole:[],requiredOwnedElements:[],requiredProps:{},superClass:[["roletype","structure"]]},t=e;return Ca.default=t,Ca}var Ea={},tp;function z1(){if(tp)return Ea;tp=1,Object.defineProperty(Ea,"__esModule",{value:!0}),Ea.default=void 0;var e={abstract:!1,accessibleNameRequired:!0,baseConcepts:[],childrenPresentational:!0,nameFrom:["author"],prohibitedProps:[],props:{"aria-errormessage":null,"aria-haspopup":null,"aria-invalid":null,"aria-readonly":null,"aria-valuetext":null,"aria-orientation":"horizontal","aria-valuemax":"100","aria-valuemin":"0"},relatedConcepts:[{concept:{attributes:[{name:"type",value:"range"}],name:"input"},module:"HTML"}],requireContextRole:[],requiredContextRole:[],requiredOwnedElements:[],requiredProps:{"aria-valuenow":null},superClass:[["roletype","widget","input"],["roletype","structure","range"]]},t=e;return Ea.default=t,Ea}var Ta={},rp;function U1(){if(rp)return Ta;rp=1,Object.defineProperty(Ta,"__esModule",{value:!0}),Ta.default=void 0;var e={abstract:!1,accessibleNameRequired:!0,baseConcepts:[],childrenPresentational:!1,nameFrom:["author"],prohibitedProps:[],props:{"aria-errormessage":null,"aria-invalid":null,"aria-readonly":null,"aria-required":null,"aria-valuetext":null,"aria-valuenow":"0"},relatedConcepts:[{concept:{attributes:[{name:"type",value:"number"}],name:"input"},module:"HTML"}],requireContextRole:[],requiredContextRole:[],requiredOwnedElements:[],requiredProps:{},superClass:[["roletype","widget","composite"],["roletype","widget","input"],["roletype","structure","range"]]},t=e;return Ta.default=t,Ta}var Sa={},np;function W1(){if(np)return Sa;np=1,Object.defineProperty(Sa,"__esModule",{value:!0}),Sa.default=void 0;var e={abstract:!1,accessibleNameRequired:!1,baseConcepts:[],childrenPresentational:!1,nameFrom:["author"],prohibitedProps:[],props:{"aria-atomic":"true","aria-live":"polite"},relatedConcepts:[{concept:{name:"output"},module:"HTML"}],requireContextRole:[],requiredContextRole:[],requiredOwnedElements:[],requiredProps:{},superClass:[["roletype","structure","section"]]},t=e;return Sa.default=t,Sa}var _a={},ap;function V1(){if(ap)return _a;ap=1,Object.defineProperty(_a,"__esModule",{value:!0}),_a.default=void 0;var e={abstract:!1,accessibleNameRequired:!1,baseConcepts:[],childrenPresentational:!1,nameFrom:["prohibited"],prohibitedProps:["aria-label","aria-labelledby"],props:{},relatedConcepts:[{concept:{name:"strong"},module:"HTML"}],requireContextRole:[],requiredContextRole:[],requiredOwnedElements:[],requiredProps:{},superClass:[["roletype","structure","section"]]},t=e;return _a.default=t,_a}var Pa={},op;function H1(){if(op)return Pa;op=1,Object.defineProperty(Pa,"__esModule",{value:!0}),Pa.default=void 0;var e={abstract:!1,accessibleNameRequired:!1,baseConcepts:[],childrenPresentational:!1,nameFrom:["prohibited"],prohibitedProps:["aria-label","aria-labelledby"],props:{},relatedConcepts:[{concept:{name:"sub"},module:"HTML"}],requireContextRole:[],requiredContextRole:[],requiredOwnedElements:[],requiredProps:{},superClass:[["roletype","structure","section"]]},t=e;return Pa.default=t,Pa}var ka={},ip;function G1(){if(ip)return ka;ip=1,Object.defineProperty(ka,"__esModule",{value:!0}),ka.default=void 0;var e={abstract:!1,accessibleNameRequired:!1,baseConcepts:[],childrenPresentational:!1,nameFrom:["prohibited"],prohibitedProps:["aria-label","aria-labelledby"],props:{},relatedConcepts:[{concept:{name:"sup"},module:"HTML"}],requireContextRole:[],requiredContextRole:[],requiredOwnedElements:[],requiredProps:{},superClass:[["roletype","structure","section"]]},t=e;return ka.default=t,ka}var Ma={},sp;function K1(){if(sp)return Ma;sp=1,Object.defineProperty(Ma,"__esModule",{value:!0}),Ma.default=void 0;var e={abstract:!1,accessibleNameRequired:!0,baseConcepts:[],childrenPresentational:!0,nameFrom:["author","contents"],prohibitedProps:[],props:{},relatedConcepts:[{concept:{name:"button"},module:"ARIA"}],requireContextRole:[],requiredContextRole:[],requiredOwnedElements:[],requiredProps:{"aria-checked":null},superClass:[["roletype","widget","input","checkbox"]]},t=e;return Ma.default=t,Ma}var Aa={},lp;function J1(){if(lp)return Aa;lp=1,Object.defineProperty(Aa,"__esModule",{value:!0}),Aa.default=void 0;var e={abstract:!1,accessibleNameRequired:!1,baseConcepts:[],childrenPresentational:!0,nameFrom:["author","contents"],prohibitedProps:[],props:{"aria-disabled":null,"aria-expanded":null,"aria-haspopup":null,"aria-posinset":null,"aria-setsize":null,"aria-selected":"false"},relatedConcepts:[],requireContextRole:["tablist"],requiredContextRole:["tablist"],requiredOwnedElements:[],requiredProps:{},superClass:[["roletype","structure","sectionhead"],["roletype","widget"]]},t=e;return Aa.default=t,Aa}var qa={},up;function X1(){if(up)return qa;up=1,Object.defineProperty(qa,"__esModule",{value:!0}),qa.default=void 0;var e={abstract:!1,accessibleNameRequired:!0,baseConcepts:[],childrenPresentational:!1,nameFrom:["author"],prohibitedProps:[],props:{"aria-colcount":null,"aria-rowcount":null},relatedConcepts:[{concept:{name:"table"},module:"HTML"}],requireContextRole:[],requiredContextRole:[],requiredOwnedElements:[["row"],["row","rowgroup"]],requiredProps:{},superClass:[["roletype","structure","section"]]},t=e;return qa.default=t,qa}var Ia={},cp;function Y1(){if(cp)return Ia;cp=1,Object.defineProperty(Ia,"__esModule",{value:!0}),Ia.default=void 0;var e={abstract:!1,accessibleNameRequired:!1,baseConcepts:[],childrenPresentational:!1,nameFrom:["author"],prohibitedProps:[],props:{"aria-level":null,"aria-multiselectable":null,"aria-orientation":"horizontal"},relatedConcepts:[{module:"DAISY",concept:{name:"guide"}}],requireContextRole:[],requiredContextRole:[],requiredOwnedElements:[["tab"]],requiredProps:{},superClass:[["roletype","widget","composite"]]},t=e;return Ia.default=t,Ia}var Oa={},dp;function Q1(){if(dp)return Oa;dp=1,Object.defineProperty(Oa,"__esModule",{value:!0}),Oa.default=void 0;var e={abstract:!1,accessibleNameRequired:!0,baseConcepts:[],childrenPresentational:!1,nameFrom:["author"],prohibitedProps:[],props:{},relatedConcepts:[],requireContextRole:[],requiredContextRole:[],requiredOwnedElements:[],requiredProps:{},superClass:[["roletype","structure","section"]]},t=e;return Oa.default=t,Oa}var Na={},fp;function Z1(){if(fp)return Na;fp=1,Object.defineProperty(Na,"__esModule",{value:!0}),Na.default=void 0;var e={abstract:!1,accessibleNameRequired:!1,baseConcepts:[],childrenPresentational:!1,nameFrom:["author"],prohibitedProps:[],props:{},relatedConcepts:[{concept:{name:"dfn"},module:"HTML"},{concept:{name:"dt"},module:"HTML"}],requireContextRole:[],requiredContextRole:[],requiredOwnedElements:[],requiredProps:{},superClass:[["roletype","structure","section"]]},t=e;return Na.default=t,Na}var $a={},pp;function eT(){if(pp)return $a;pp=1,Object.defineProperty($a,"__esModule",{value:!0}),$a.default=void 0;var e={abstract:!1,accessibleNameRequired:!0,baseConcepts:[],childrenPresentational:!1,nameFrom:["author"],prohibitedProps:[],props:{"aria-activedescendant":null,"aria-autocomplete":null,"aria-errormessage":null,"aria-haspopup":null,"aria-invalid":null,"aria-multiline":null,"aria-placeholder":null,"aria-readonly":null,"aria-required":null},relatedConcepts:[{concept:{attributes:[{constraints:["undefined"],name:"type"},{constraints:["undefined"],name:"list"}],constraints:["the list attribute is not set"],name:"input"},module:"HTML"},{concept:{attributes:[{constraints:["undefined"],name:"list"},{name:"type",value:"email"}],constraints:["the list attribute is not set"],name:"input"},module:"HTML"},{concept:{attributes:[{constraints:["undefined"],name:"list"},{name:"type",value:"tel"}],constraints:["the list attribute is not set"],name:"input"},module:"HTML"},{concept:{attributes:[{constraints:["undefined"],name:"list"},{name:"type",value:"text"}],constraints:["the list attribute is not set"],name:"input"},module:"HTML"},{concept:{attributes:[{constraints:["undefined"],name:"list"},{name:"type",value:"url"}],constraints:["the list attribute is not set"],name:"input"},module:"HTML"},{concept:{name:"input"},module:"XForms"},{concept:{name:"textarea"},module:"HTML"}],requireContextRole:[],requiredContextRole:[],requiredOwnedElements:[],requiredProps:{},superClass:[["roletype","widget","input"]]},t=e;return $a.default=t,$a}var ja={},mp;function tT(){if(mp)return ja;mp=1,Object.defineProperty(ja,"__esModule",{value:!0}),ja.default=void 0;var e={abstract:!1,accessibleNameRequired:!1,baseConcepts:[],childrenPresentational:!1,nameFrom:["author"],prohibitedProps:[],props:{},relatedConcepts:[{concept:{name:"time"},module:"HTML"}],requireContextRole:[],requiredContextRole:[],requiredOwnedElements:[],requiredProps:{},superClass:[["roletype","structure","section"]]},t=e;return ja.default=t,ja}var Da={},hp;function rT(){if(hp)return Da;hp=1,Object.defineProperty(Da,"__esModule",{value:!0}),Da.default=void 0;var e={abstract:!1,accessibleNameRequired:!1,baseConcepts:[],childrenPresentational:!1,nameFrom:["author"],prohibitedProps:[],props:{},relatedConcepts:[],requireContextRole:[],requiredContextRole:[],requiredOwnedElements:[],requiredProps:{},superClass:[["roletype","structure","section","status"]]},t=e;return Da.default=t,Da}var La={},gp;function nT(){if(gp)return La;gp=1,Object.defineProperty(La,"__esModule",{value:!0}),La.default=void 0;var e={abstract:!1,accessibleNameRequired:!1,baseConcepts:[],childrenPresentational:!1,nameFrom:["author"],prohibitedProps:[],props:{"aria-orientation":"horizontal"},relatedConcepts:[{concept:{name:"menubar"},module:"ARIA"}],requireContextRole:[],requiredContextRole:[],requiredOwnedElements:[],requiredProps:{},superClass:[["roletype","structure","section","group"]]},t=e;return La.default=t,La}var Fa={},bp;function aT(){if(bp)return Fa;bp=1,Object.defineProperty(Fa,"__esModule",{value:!0}),Fa.default=void 0;var e={abstract:!1,accessibleNameRequired:!0,baseConcepts:[],childrenPresentational:!1,nameFrom:["author","contents"],prohibitedProps:[],props:{},relatedConcepts:[],requireContextRole:[],requiredContextRole:[],requiredOwnedElements:[],requiredProps:{},superClass:[["roletype","structure","section"]]},t=e;return Fa.default=t,Fa}var Ba={},yp;function oT(){if(yp)return Ba;yp=1,Object.defineProperty(Ba,"__esModule",{value:!0}),Ba.default=void 0;var e={abstract:!1,accessibleNameRequired:!0,baseConcepts:[],childrenPresentational:!1,nameFrom:["author"],prohibitedProps:[],props:{"aria-errormessage":null,"aria-invalid":null,"aria-multiselectable":null,"aria-required":null,"aria-orientation":"vertical"},relatedConcepts:[],requireContextRole:[],requiredContextRole:[],requiredOwnedElements:[["treeitem","group"],["treeitem"]],requiredProps:{},superClass:[["roletype","widget","composite","select"],["roletype","structure","section","group","select"]]},t=e;return Ba.default=t,Ba}var za={},vp;function iT(){if(vp)return za;vp=1,Object.defineProperty(za,"__esModule",{value:!0}),za.default=void 0;var e={abstract:!1,accessibleNameRequired:!0,baseConcepts:[],childrenPresentational:!1,nameFrom:["author"],prohibitedProps:[],props:{},relatedConcepts:[],requireContextRole:[],requiredContextRole:[],requiredOwnedElements:[["row"],["row","rowgroup"]],requiredProps:{},superClass:[["roletype","widget","composite","grid"],["roletype","structure","section","table","grid"],["roletype","widget","composite","select","tree"],["roletype","structure","section","group","select","tree"]]},t=e;return za.default=t,za}var Ua={},wp;function sT(){if(wp)return Ua;wp=1,Object.defineProperty(Ua,"__esModule",{value:!0}),Ua.default=void 0;var e={abstract:!1,accessibleNameRequired:!0,baseConcepts:[],childrenPresentational:!1,nameFrom:["author","contents"],prohibitedProps:[],props:{"aria-expanded":null,"aria-haspopup":null},relatedConcepts:[],requireContextRole:["group","tree"],requiredContextRole:["group","tree"],requiredOwnedElements:[],requiredProps:{"aria-selected":null},superClass:[["roletype","structure","section","listitem"],["roletype","widget","input","option"]]},t=e;return Ua.default=t,Ua}var xp;function lT(){if(xp)return mn;xp=1,Object.defineProperty(mn,"__esModule",{value:!0}),mn.default=void 0;var e=K(IE()),t=K(OE()),r=K(NE()),n=K($E()),a=K(jE()),i=K(DE()),o=K(LE()),s=K(FE()),l=K(BE()),u=K(zE()),d=K(UE()),c=K(WE()),f=K(VE()),p=K(HE()),m=K(GE()),g=K(KE()),b=K(JE()),h=K(XE()),w=K(YE()),x=K(QE()),T=K(ZE()),E=K(e1()),y=K(t1()),v=K(r1()),R=K(n1()),k=K(a1()),P=K(o1()),M=K(i1()),F=K(s1()),j=K(l1()),D=K(u1()),J=K(c1()),B=K(d1()),Y=K(f1()),L=K(p1()),Z=K(m1()),ae=K(h1()),ne=K(g1()),fe=K(b1()),H=K(y1()),me=K(v1()),ce=K(w1()),se=K(x1()),Se=K(R1()),Me=K(C1()),q=K(E1()),Q=K(T1()),W=K(S1()),le=K(_1()),de=K(P1()),X=K(k1()),_e=K(M1()),xe=K(A1()),Oe=K(q1()),Zt=K(I1()),wt=K(O1()),Le=K(N1()),Xe=K($1()),er=K(j1()),Vr=K(D1()),O=K(L1()),N=K(F1()),z=K(B1()),G=K(z1()),A=K(U1()),oe=K(W1()),je=K(V1()),Pe=K(H1()),ze=K(G1()),ie=K(K1()),U=K(J1()),ee=K(X1()),te=K(Y1()),ye=K(Q1()),Ne=K(Z1()),Ft=K(eT()),vr=K(tT()),tt=K(rT()),ht=K(nT()),Hr=K(aT()),it=K(oT()),Bt=K(iT()),Ve=K(sT());function K(tr){return tr&&tr.__esModule?tr:{default:tr}}var Gr=[["alert",e.default],["alertdialog",t.default],["application",r.default],["article",n.default],["banner",a.default],["blockquote",i.default],["button",o.default],["caption",s.default],["cell",l.default],["checkbox",u.default],["code",d.default],["columnheader",c.default],["combobox",f.default],["complementary",p.default],["contentinfo",m.default],["definition",g.default],["deletion",b.default],["dialog",h.default],["directory",w.default],["document",x.default],["emphasis",T.default],["feed",E.default],["figure",y.default],["form",v.default],["generic",R.default],["grid",k.default],["gridcell",P.default],["group",M.default],["heading",F.default],["img",j.default],["insertion",D.default],["link",J.default],["list",B.default],["listbox",Y.default],["listitem",L.default],["log",Z.default],["main",ae.default],["mark",ne.default],["marquee",fe.default],["math",H.default],["menu",me.default],["menubar",ce.default],["menuitem",se.default],["menuitemcheckbox",Se.default],["menuitemradio",Me.default],["meter",q.default],["navigation",Q.default],["none",W.default],["note",le.default],["option",de.default],["paragraph",X.default],["presentation",_e.default],["progressbar",xe.default],["radio",Oe.default],["radiogroup",Zt.default],["region",wt.default],["row",Le.default],["rowgroup",Xe.default],["rowheader",er.default],["scrollbar",Vr.default],["search",O.default],["searchbox",N.default],["separator",z.default],["slider",G.default],["spinbutton",A.default],["status",oe.default],["strong",je.default],["subscript",Pe.default],["superscript",ze.default],["switch",ie.default],["tab",U.default],["table",ee.default],["tablist",te.default],["tabpanel",ye.default],["term",Ne.default],["textbox",Ft.default],["time",vr.default],["timer",tt.default],["toolbar",ht.default],["tooltip",Hr.default],["tree",it.default],["treegrid",Bt.default],["treeitem",Ve.default]],Kr=Gr;return mn.default=Kr,mn}var Wa={},Va={},Rp;function uT(){if(Rp)return Va;Rp=1,Object.defineProperty(Va,"__esModule",{value:!0}),Va.default=void 0;var e={abstract:!1,accessibleNameRequired:!1,baseConcepts:[],childrenPresentational:!1,nameFrom:["author"],prohibitedProps:[],props:{"aria-disabled":null,"aria-errormessage":null,"aria-expanded":null,"aria-haspopup":null,"aria-invalid":null},relatedConcepts:[{concept:{name:"abstract [EPUB-SSV]"},module:"EPUB"}],requireContextRole:[],requiredContextRole:[],requiredOwnedElements:[],requiredProps:{},superClass:[["roletype","structure","section"]]},t=e;return Va.default=t,Va}var Ha={},Cp;function cT(){if(Cp)return Ha;Cp=1,Object.defineProperty(Ha,"__esModule",{value:!0}),Ha.default=void 0;var e={abstract:!1,accessibleNameRequired:!1,baseConcepts:[],childrenPresentational:!1,nameFrom:["author"],prohibitedProps:[],props:{"aria-disabled":null,"aria-errormessage":null,"aria-expanded":null,"aria-haspopup":null,"aria-invalid":null},relatedConcepts:[{concept:{name:"acknowledgments [EPUB-SSV]"},module:"EPUB"}],requireContextRole:[],requiredContextRole:[],requiredOwnedElements:[],requiredProps:{},superClass:[["roletype","structure","section","landmark"]]},t=e;return Ha.default=t,Ha}var Ga={},Ep;function dT(){if(Ep)return Ga;Ep=1,Object.defineProperty(Ga,"__esModule",{value:!0}),Ga.default=void 0;var e={abstract:!1,accessibleNameRequired:!1,baseConcepts:[],childrenPresentational:!1,nameFrom:["author"],prohibitedProps:[],props:{"aria-disabled":null,"aria-errormessage":null,"aria-expanded":null,"aria-haspopup":null,"aria-invalid":null},relatedConcepts:[{concept:{name:"afterword [EPUB-SSV]"},module:"EPUB"}],requireContextRole:[],requiredContextRole:[],requiredOwnedElements:[],requiredProps:{},superClass:[["roletype","structure","section","landmark"]]},t=e;return Ga.default=t,Ga}var Ka={},Tp;function fT(){if(Tp)return Ka;Tp=1,Object.defineProperty(Ka,"__esModule",{value:!0}),Ka.default=void 0;var e={abstract:!1,accessibleNameRequired:!1,baseConcepts:[],childrenPresentational:!1,nameFrom:["author"],prohibitedProps:[],props:{"aria-disabled":null,"aria-errormessage":null,"aria-expanded":null,"aria-haspopup":null,"aria-invalid":null},relatedConcepts:[{concept:{name:"appendix [EPUB-SSV]"},module:"EPUB"}],requireContextRole:[],requiredContextRole:[],requiredOwnedElements:[],requiredProps:{},superClass:[["roletype","structure","section","landmark"]]},t=e;return Ka.default=t,Ka}var Ja={},Sp;function pT(){if(Sp)return Ja;Sp=1,Object.defineProperty(Ja,"__esModule",{value:!0}),Ja.default=void 0;var e={abstract:!1,accessibleNameRequired:!0,baseConcepts:[],childrenPresentational:!1,nameFrom:["author","contents"],prohibitedProps:[],props:{"aria-errormessage":null,"aria-invalid":null},relatedConcepts:[{concept:{name:"referrer [EPUB-SSV]"},module:"EPUB"}],requireContextRole:[],requiredContextRole:[],requiredOwnedElements:[],requiredProps:{},superClass:[["roletype","widget","command","link"]]},t=e;return Ja.default=t,Ja}var Xa={},_p;function mT(){if(_p)return Xa;_p=1,Object.defineProperty(Xa,"__esModule",{value:!0}),Xa.default=void 0;var e={abstract:!1,accessibleNameRequired:!0,baseConcepts:[],childrenPresentational:!1,nameFrom:["author"],prohibitedProps:[],props:{"aria-disabled":null,"aria-errormessage":null,"aria-expanded":null,"aria-haspopup":null,"aria-invalid":null},relatedConcepts:[{concept:{name:"EPUB biblioentry [EPUB-SSV]"},module:"EPUB"}],requireContextRole:["doc-bibliography"],requiredContextRole:["doc-bibliography"],requiredOwnedElements:[],requiredProps:{},superClass:[["roletype","structure","section","listitem"]]},t=e;return Xa.default=t,Xa}var Ya={},Pp;function hT(){if(Pp)return Ya;Pp=1,Object.defineProperty(Ya,"__esModule",{value:!0}),Ya.default=void 0;var e={abstract:!1,accessibleNameRequired:!1,baseConcepts:[],childrenPresentational:!1,nameFrom:["author"],prohibitedProps:[],props:{"aria-disabled":null,"aria-errormessage":null,"aria-expanded":null,"aria-haspopup":null,"aria-invalid":null},relatedConcepts:[{concept:{name:"bibliography [EPUB-SSV]"},module:"EPUB"}],requireContextRole:[],requiredContextRole:[],requiredOwnedElements:[["doc-biblioentry"]],requiredProps:{},superClass:[["roletype","structure","section","landmark"]]},t=e;return Ya.default=t,Ya}var Qa={},kp;function gT(){if(kp)return Qa;kp=1,Object.defineProperty(Qa,"__esModule",{value:!0}),Qa.default=void 0;var e={abstract:!1,accessibleNameRequired:!0,baseConcepts:[],childrenPresentational:!1,nameFrom:["author","contents"],prohibitedProps:[],props:{"aria-errormessage":null,"aria-invalid":null},relatedConcepts:[{concept:{name:"biblioref [EPUB-SSV]"},module:"EPUB"}],requireContextRole:[],requiredContextRole:[],requiredOwnedElements:[],requiredProps:{},superClass:[["roletype","widget","command","link"]]},t=e;return Qa.default=t,Qa}var Za={},Mp;function bT(){if(Mp)return Za;Mp=1,Object.defineProperty(Za,"__esModule",{value:!0}),Za.default=void 0;var e={abstract:!1,accessibleNameRequired:!1,baseConcepts:[],childrenPresentational:!1,nameFrom:["author"],prohibitedProps:[],props:{"aria-disabled":null,"aria-errormessage":null,"aria-expanded":null,"aria-haspopup":null,"aria-invalid":null},relatedConcepts:[{concept:{name:"chapter [EPUB-SSV]"},module:"EPUB"}],requireContextRole:[],requiredContextRole:[],requiredOwnedElements:[],requiredProps:{},superClass:[["roletype","structure","section","landmark"]]},t=e;return Za.default=t,Za}var eo={},Ap;function yT(){if(Ap)return eo;Ap=1,Object.defineProperty(eo,"__esModule",{value:!0}),eo.default=void 0;var e={abstract:!1,accessibleNameRequired:!1,baseConcepts:[],childrenPresentational:!1,nameFrom:["author"],prohibitedProps:[],props:{"aria-disabled":null,"aria-errormessage":null,"aria-expanded":null,"aria-haspopup":null,"aria-invalid":null},relatedConcepts:[{concept:{name:"colophon [EPUB-SSV]"},module:"EPUB"}],requireContextRole:[],requiredContextRole:[],requiredOwnedElements:[],requiredProps:{},superClass:[["roletype","structure","section"]]},t=e;return eo.default=t,eo}var to={},qp;function vT(){if(qp)return to;qp=1,Object.defineProperty(to,"__esModule",{value:!0}),to.default=void 0;var e={abstract:!1,accessibleNameRequired:!1,baseConcepts:[],childrenPresentational:!1,nameFrom:["author"],prohibitedProps:[],props:{"aria-disabled":null,"aria-errormessage":null,"aria-expanded":null,"aria-haspopup":null,"aria-invalid":null},relatedConcepts:[{concept:{name:"conclusion [EPUB-SSV]"},module:"EPUB"}],requireContextRole:[],requiredContextRole:[],requiredOwnedElements:[],requiredProps:{},superClass:[["roletype","structure","section","landmark"]]},t=e;return to.default=t,to}var ro={},Ip;function wT(){if(Ip)return ro;Ip=1,Object.defineProperty(ro,"__esModule",{value:!0}),ro.default=void 0;var e={abstract:!1,accessibleNameRequired:!1,baseConcepts:[],childrenPresentational:!1,nameFrom:["author"],prohibitedProps:[],props:{"aria-disabled":null,"aria-errormessage":null,"aria-expanded":null,"aria-haspopup":null,"aria-invalid":null},relatedConcepts:[{concept:{name:"cover [EPUB-SSV]"},module:"EPUB"}],requireContextRole:[],requiredContextRole:[],requiredOwnedElements:[],requiredProps:{},superClass:[["roletype","structure","section","img"]]},t=e;return ro.default=t,ro}var no={},Op;function xT(){if(Op)return no;Op=1,Object.defineProperty(no,"__esModule",{value:!0}),no.default=void 0;var e={abstract:!1,accessibleNameRequired:!1,baseConcepts:[],childrenPresentational:!1,nameFrom:["author"],prohibitedProps:[],props:{"aria-disabled":null,"aria-errormessage":null,"aria-expanded":null,"aria-haspopup":null,"aria-invalid":null},relatedConcepts:[{concept:{name:"credit [EPUB-SSV]"},module:"EPUB"}],requireContextRole:[],requiredContextRole:[],requiredOwnedElements:[],requiredProps:{},superClass:[["roletype","structure","section"]]},t=e;return no.default=t,no}var ao={},Np;function RT(){if(Np)return ao;Np=1,Object.defineProperty(ao,"__esModule",{value:!0}),ao.default=void 0;var e={abstract:!1,accessibleNameRequired:!1,baseConcepts:[],childrenPresentational:!1,nameFrom:["author"],prohibitedProps:[],props:{"aria-disabled":null,"aria-errormessage":null,"aria-expanded":null,"aria-haspopup":null,"aria-invalid":null},relatedConcepts:[{concept:{name:"credits [EPUB-SSV]"},module:"EPUB"}],requireContextRole:[],requiredContextRole:[],requiredOwnedElements:[],requiredProps:{},superClass:[["roletype","structure","section","landmark"]]},t=e;return ao.default=t,ao}var oo={},$p;function CT(){if($p)return oo;$p=1,Object.defineProperty(oo,"__esModule",{value:!0}),oo.default=void 0;var e={abstract:!1,accessibleNameRequired:!1,baseConcepts:[],childrenPresentational:!1,nameFrom:["author"],prohibitedProps:[],props:{"aria-disabled":null,"aria-errormessage":null,"aria-expanded":null,"aria-haspopup":null,"aria-invalid":null},relatedConcepts:[{concept:{name:"dedication [EPUB-SSV]"},module:"EPUB"}],requireContextRole:[],requiredContextRole:[],requiredOwnedElements:[],requiredProps:{},superClass:[["roletype","structure","section"]]},t=e;return oo.default=t,oo}var io={},jp;function ET(){if(jp)return io;jp=1,Object.defineProperty(io,"__esModule",{value:!0}),io.default=void 0;var e={abstract:!1,accessibleNameRequired:!1,baseConcepts:[],childrenPresentational:!1,nameFrom:["author"],prohibitedProps:[],props:{"aria-disabled":null,"aria-errormessage":null,"aria-expanded":null,"aria-haspopup":null,"aria-invalid":null},relatedConcepts:[{concept:{name:"rearnote [EPUB-SSV]"},module:"EPUB"}],requireContextRole:["doc-endnotes"],requiredContextRole:["doc-endnotes"],requiredOwnedElements:[],requiredProps:{},superClass:[["roletype","structure","section","listitem"]]},t=e;return io.default=t,io}var so={},Dp;function TT(){if(Dp)return so;Dp=1,Object.defineProperty(so,"__esModule",{value:!0}),so.default=void 0;var e={abstract:!1,accessibleNameRequired:!1,baseConcepts:[],childrenPresentational:!1,nameFrom:["author"],prohibitedProps:[],props:{"aria-disabled":null,"aria-errormessage":null,"aria-expanded":null,"aria-haspopup":null,"aria-invalid":null},relatedConcepts:[{concept:{name:"rearnotes [EPUB-SSV]"},module:"EPUB"}],requireContextRole:[],requiredContextRole:[],requiredOwnedElements:[["doc-endnote"]],requiredProps:{},superClass:[["roletype","structure","section","landmark"]]},t=e;return so.default=t,so}var lo={},Lp;function ST(){if(Lp)return lo;Lp=1,Object.defineProperty(lo,"__esModule",{value:!0}),lo.default=void 0;var e={abstract:!1,accessibleNameRequired:!1,baseConcepts:[],childrenPresentational:!1,nameFrom:["author"],prohibitedProps:[],props:{"aria-disabled":null,"aria-errormessage":null,"aria-expanded":null,"aria-haspopup":null,"aria-invalid":null},relatedConcepts:[{concept:{name:"epigraph [EPUB-SSV]"},module:"EPUB"}],requireContextRole:[],requiredContextRole:[],requiredOwnedElements:[],requiredProps:{},superClass:[["roletype","structure","section"]]},t=e;return lo.default=t,lo}var uo={},Fp;function _T(){if(Fp)return uo;Fp=1,Object.defineProperty(uo,"__esModule",{value:!0}),uo.default=void 0;var e={abstract:!1,accessibleNameRequired:!1,baseConcepts:[],childrenPresentational:!1,nameFrom:["author"],prohibitedProps:[],props:{"aria-disabled":null,"aria-errormessage":null,"aria-expanded":null,"aria-haspopup":null,"aria-invalid":null},relatedConcepts:[{concept:{name:"epilogue [EPUB-SSV]"},module:"EPUB"}],requireContextRole:[],requiredContextRole:[],requiredOwnedElements:[],requiredProps:{},superClass:[["roletype","structure","section","landmark"]]},t=e;return uo.default=t,uo}var co={},Bp;function PT(){if(Bp)return co;Bp=1,Object.defineProperty(co,"__esModule",{value:!0}),co.default=void 0;var e={abstract:!1,accessibleNameRequired:!1,baseConcepts:[],childrenPresentational:!1,nameFrom:["author"],prohibitedProps:[],props:{"aria-disabled":null,"aria-errormessage":null,"aria-expanded":null,"aria-haspopup":null,"aria-invalid":null},relatedConcepts:[{concept:{name:"errata [EPUB-SSV]"},module:"EPUB"}],requireContextRole:[],requiredContextRole:[],requiredOwnedElements:[],requiredProps:{},superClass:[["roletype","structure","section","landmark"]]},t=e;return co.default=t,co}var fo={},zp;function kT(){if(zp)return fo;zp=1,Object.defineProperty(fo,"__esModule",{value:!0}),fo.default=void 0;var e={abstract:!1,accessibleNameRequired:!1,baseConcepts:[],childrenPresentational:!1,nameFrom:["author"],prohibitedProps:[],props:{"aria-disabled":null,"aria-errormessage":null,"aria-expanded":null,"aria-haspopup":null,"aria-invalid":null},relatedConcepts:[],requireContextRole:[],requiredContextRole:[],requiredOwnedElements:[],requiredProps:{},superClass:[["roletype","structure","section"]]},t=e;return fo.default=t,fo}var po={},Up;function MT(){if(Up)return po;Up=1,Object.defineProperty(po,"__esModule",{value:!0}),po.default=void 0;var e={abstract:!1,accessibleNameRequired:!1,baseConcepts:[],childrenPresentational:!1,nameFrom:["author"],prohibitedProps:[],props:{"aria-disabled":null,"aria-errormessage":null,"aria-expanded":null,"aria-haspopup":null,"aria-invalid":null},relatedConcepts:[{concept:{name:"footnote [EPUB-SSV]"},module:"EPUB"}],requireContextRole:[],requiredContextRole:[],requiredOwnedElements:[],requiredProps:{},superClass:[["roletype","structure","section"]]},t=e;return po.default=t,po}var mo={},Wp;function AT(){if(Wp)return mo;Wp=1,Object.defineProperty(mo,"__esModule",{value:!0}),mo.default=void 0;var e={abstract:!1,accessibleNameRequired:!1,baseConcepts:[],childrenPresentational:!1,nameFrom:["author"],prohibitedProps:[],props:{"aria-disabled":null,"aria-errormessage":null,"aria-expanded":null,"aria-haspopup":null,"aria-invalid":null},relatedConcepts:[{concept:{name:"foreword [EPUB-SSV]"},module:"EPUB"}],requireContextRole:[],requiredContextRole:[],requiredOwnedElements:[],requiredProps:{},superClass:[["roletype","structure","section","landmark"]]},t=e;return mo.default=t,mo}var ho={},Vp;function qT(){if(Vp)return ho;Vp=1,Object.defineProperty(ho,"__esModule",{value:!0}),ho.default=void 0;var e={abstract:!1,accessibleNameRequired:!1,baseConcepts:[],childrenPresentational:!1,nameFrom:["author"],prohibitedProps:[],props:{"aria-disabled":null,"aria-errormessage":null,"aria-expanded":null,"aria-haspopup":null,"aria-invalid":null},relatedConcepts:[{concept:{name:"glossary [EPUB-SSV]"},module:"EPUB"}],requireContextRole:[],requiredContextRole:[],requiredOwnedElements:[["definition"],["term"]],requiredProps:{},superClass:[["roletype","structure","section","landmark"]]},t=e;return ho.default=t,ho}var go={},Hp;function IT(){if(Hp)return go;Hp=1,Object.defineProperty(go,"__esModule",{value:!0}),go.default=void 0;var e={abstract:!1,accessibleNameRequired:!0,baseConcepts:[],childrenPresentational:!1,nameFrom:["author","contents"],prohibitedProps:[],props:{"aria-errormessage":null,"aria-invalid":null},relatedConcepts:[{concept:{name:"glossref [EPUB-SSV]"},module:"EPUB"}],requireContextRole:[],requiredContextRole:[],requiredOwnedElements:[],requiredProps:{},superClass:[["roletype","widget","command","link"]]},t=e;return go.default=t,go}var bo={},Gp;function OT(){if(Gp)return bo;Gp=1,Object.defineProperty(bo,"__esModule",{value:!0}),bo.default=void 0;var e={abstract:!1,accessibleNameRequired:!1,baseConcepts:[],childrenPresentational:!1,nameFrom:["author"],prohibitedProps:[],props:{"aria-disabled":null,"aria-errormessage":null,"aria-expanded":null,"aria-haspopup":null,"aria-invalid":null},relatedConcepts:[{concept:{name:"index [EPUB-SSV]"},module:"EPUB"}],requireContextRole:[],requiredContextRole:[],requiredOwnedElements:[],requiredProps:{},superClass:[["roletype","structure","section","landmark","navigation"]]},t=e;return bo.default=t,bo}var yo={},Kp;function NT(){if(Kp)return yo;Kp=1,Object.defineProperty(yo,"__esModule",{value:!0}),yo.default=void 0;var e={abstract:!1,accessibleNameRequired:!1,baseConcepts:[],childrenPresentational:!1,nameFrom:["author"],prohibitedProps:[],props:{"aria-disabled":null,"aria-errormessage":null,"aria-expanded":null,"aria-haspopup":null,"aria-invalid":null},relatedConcepts:[{concept:{name:"introduction [EPUB-SSV]"},module:"EPUB"}],requireContextRole:[],requiredContextRole:[],requiredOwnedElements:[],requiredProps:{},superClass:[["roletype","structure","section","landmark"]]},t=e;return yo.default=t,yo}var vo={},Jp;function $T(){if(Jp)return vo;Jp=1,Object.defineProperty(vo,"__esModule",{value:!0}),vo.default=void 0;var e={abstract:!1,accessibleNameRequired:!0,baseConcepts:[],childrenPresentational:!1,nameFrom:["author","contents"],prohibitedProps:[],props:{"aria-errormessage":null,"aria-invalid":null},relatedConcepts:[{concept:{name:"noteref [EPUB-SSV]"},module:"EPUB"}],requireContextRole:[],requiredContextRole:[],requiredOwnedElements:[],requiredProps:{},superClass:[["roletype","widget","command","link"]]},t=e;return vo.default=t,vo}var wo={},Xp;function jT(){if(Xp)return wo;Xp=1,Object.defineProperty(wo,"__esModule",{value:!0}),wo.default=void 0;var e={abstract:!1,accessibleNameRequired:!1,baseConcepts:[],childrenPresentational:!1,nameFrom:["author"],prohibitedProps:[],props:{"aria-disabled":null,"aria-errormessage":null,"aria-expanded":null,"aria-haspopup":null,"aria-invalid":null},relatedConcepts:[{concept:{name:"notice [EPUB-SSV]"},module:"EPUB"}],requireContextRole:[],requiredContextRole:[],requiredOwnedElements:[],requiredProps:{},superClass:[["roletype","structure","section","note"]]},t=e;return wo.default=t,wo}var xo={},Yp;function DT(){if(Yp)return xo;Yp=1,Object.defineProperty(xo,"__esModule",{value:!0}),xo.default=void 0;var e={abstract:!1,accessibleNameRequired:!0,baseConcepts:[],childrenPresentational:!0,nameFrom:["author"],prohibitedProps:[],props:{"aria-errormessage":null,"aria-expanded":null,"aria-haspopup":null,"aria-invalid":null},relatedConcepts:[{concept:{name:"pagebreak [EPUB-SSV]"},module:"EPUB"}],requireContextRole:[],requiredContextRole:[],requiredOwnedElements:[],requiredProps:{},superClass:[["roletype","structure","separator"]]},t=e;return xo.default=t,xo}var Ro={},Qp;function LT(){if(Qp)return Ro;Qp=1,Object.defineProperty(Ro,"__esModule",{value:!0}),Ro.default=void 0;var e={abstract:!1,accessibleNameRequired:!1,baseConcepts:[],childrenPresentational:!1,nameFrom:["author"],prohibitedProps:[],props:{"aria-disabled":null,"aria-errormessage":null,"aria-expanded":null,"aria-haspopup":null,"aria-invalid":null},relatedConcepts:[{concept:{name:"page-list [EPUB-SSV]"},module:"EPUB"}],requireContextRole:[],requiredContextRole:[],requiredOwnedElements:[],requiredProps:{},superClass:[["roletype","structure","section","landmark","navigation"]]},t=e;return Ro.default=t,Ro}var Co={},Zp;function FT(){if(Zp)return Co;Zp=1,Object.defineProperty(Co,"__esModule",{value:!0}),Co.default=void 0;var e={abstract:!1,accessibleNameRequired:!0,baseConcepts:[],childrenPresentational:!1,nameFrom:["author"],prohibitedProps:[],props:{"aria-disabled":null,"aria-errormessage":null,"aria-expanded":null,"aria-haspopup":null,"aria-invalid":null},relatedConcepts:[{concept:{name:"part [EPUB-SSV]"},module:"EPUB"}],requireContextRole:[],requiredContextRole:[],requiredOwnedElements:[],requiredProps:{},superClass:[["roletype","structure","section","landmark"]]},t=e;return Co.default=t,Co}var Eo={},em;function BT(){if(em)return Eo;em=1,Object.defineProperty(Eo,"__esModule",{value:!0}),Eo.default=void 0;var e={abstract:!1,accessibleNameRequired:!1,baseConcepts:[],childrenPresentational:!1,nameFrom:["author"],prohibitedProps:[],props:{"aria-disabled":null,"aria-errormessage":null,"aria-expanded":null,"aria-haspopup":null,"aria-invalid":null},relatedConcepts:[{concept:{name:"preface [EPUB-SSV]"},module:"EPUB"}],requireContextRole:[],requiredContextRole:[],requiredOwnedElements:[],requiredProps:{},superClass:[["roletype","structure","section","landmark"]]},t=e;return Eo.default=t,Eo}var To={},tm;function zT(){if(tm)return To;tm=1,Object.defineProperty(To,"__esModule",{value:!0}),To.default=void 0;var e={abstract:!1,accessibleNameRequired:!1,baseConcepts:[],childrenPresentational:!1,nameFrom:["author"],prohibitedProps:[],props:{"aria-disabled":null,"aria-errormessage":null,"aria-expanded":null,"aria-haspopup":null,"aria-invalid":null},relatedConcepts:[{concept:{name:"prologue [EPUB-SSV]"},module:"EPUB"}],requireContextRole:[],requiredContextRole:[],requiredOwnedElements:[],requiredProps:{},superClass:[["roletype","structure","section","landmark"]]},t=e;return To.default=t,To}var So={},rm;function UT(){if(rm)return So;rm=1,Object.defineProperty(So,"__esModule",{value:!0}),So.default=void 0;var e={abstract:!1,accessibleNameRequired:!1,baseConcepts:[],childrenPresentational:!1,nameFrom:["author"],prohibitedProps:[],props:{},relatedConcepts:[{concept:{name:"pullquote [EPUB-SSV]"},module:"EPUB"}],requireContextRole:[],requiredContextRole:[],requiredOwnedElements:[],requiredProps:{},superClass:[["none"]]},t=e;return So.default=t,So}var _o={},nm;function WT(){if(nm)return _o;nm=1,Object.defineProperty(_o,"__esModule",{value:!0}),_o.default=void 0;var e={abstract:!1,accessibleNameRequired:!1,baseConcepts:[],childrenPresentational:!1,nameFrom:["author"],prohibitedProps:[],props:{"aria-disabled":null,"aria-errormessage":null,"aria-expanded":null,"aria-haspopup":null,"aria-invalid":null},relatedConcepts:[{concept:{name:"qna [EPUB-SSV]"},module:"EPUB"}],requireContextRole:[],requiredContextRole:[],requiredOwnedElements:[],requiredProps:{},superClass:[["roletype","structure","section"]]},t=e;return _o.default=t,_o}var Po={},am;function VT(){if(am)return Po;am=1,Object.defineProperty(Po,"__esModule",{value:!0}),Po.default=void 0;var e={abstract:!1,accessibleNameRequired:!1,baseConcepts:[],childrenPresentational:!1,nameFrom:["author"],prohibitedProps:[],props:{"aria-disabled":null,"aria-errormessage":null,"aria-expanded":null,"aria-haspopup":null,"aria-invalid":null},relatedConcepts:[{concept:{name:"subtitle [EPUB-SSV]"},module:"EPUB"}],requireContextRole:[],requiredContextRole:[],requiredOwnedElements:[],requiredProps:{},superClass:[["roletype","structure","sectionhead"]]},t=e;return Po.default=t,Po}var ko={},om;function HT(){if(om)return ko;om=1,Object.defineProperty(ko,"__esModule",{value:!0}),ko.default=void 0;var e={abstract:!1,accessibleNameRequired:!1,baseConcepts:[],childrenPresentational:!1,nameFrom:["author"],prohibitedProps:[],props:{"aria-disabled":null,"aria-errormessage":null,"aria-expanded":null,"aria-haspopup":null,"aria-invalid":null},relatedConcepts:[{concept:{name:"help [EPUB-SSV]"},module:"EPUB"}],requireContextRole:[],requiredContextRole:[],requiredOwnedElements:[],requiredProps:{},superClass:[["roletype","structure","section","note"]]},t=e;return ko.default=t,ko}var Mo={},im;function GT(){if(im)return Mo;im=1,Object.defineProperty(Mo,"__esModule",{value:!0}),Mo.default=void 0;var e={abstract:!1,accessibleNameRequired:!1,baseConcepts:[],childrenPresentational:!1,nameFrom:["author"],prohibitedProps:[],props:{"aria-disabled":null,"aria-errormessage":null,"aria-expanded":null,"aria-haspopup":null,"aria-invalid":null},relatedConcepts:[{concept:{name:"toc [EPUB-SSV]"},module:"EPUB"}],requireContextRole:[],requiredContextRole:[],requiredOwnedElements:[],requiredProps:{},superClass:[["roletype","structure","section","landmark","navigation"]]},t=e;return Mo.default=t,Mo}var sm;function KT(){if(sm)return Wa;sm=1,Object.defineProperty(Wa,"__esModule",{value:!0}),Wa.default=void 0;var e=H(uT()),t=H(cT()),r=H(dT()),n=H(fT()),a=H(pT()),i=H(mT()),o=H(hT()),s=H(gT()),l=H(bT()),u=H(yT()),d=H(vT()),c=H(wT()),f=H(xT()),p=H(RT()),m=H(CT()),g=H(ET()),b=H(TT()),h=H(ST()),w=H(_T()),x=H(PT()),T=H(kT()),E=H(MT()),y=H(AT()),v=H(qT()),R=H(IT()),k=H(OT()),P=H(NT()),M=H($T()),F=H(jT()),j=H(DT()),D=H(LT()),J=H(FT()),B=H(BT()),Y=H(zT()),L=H(UT()),Z=H(WT()),ae=H(VT()),ne=H(HT()),fe=H(GT());function H(se){return se&&se.__esModule?se:{default:se}}var me=[["doc-abstract",e.default],["doc-acknowledgments",t.default],["doc-afterword",r.default],["doc-appendix",n.default],["doc-backlink",a.default],["doc-biblioentry",i.default],["doc-bibliography",o.default],["doc-biblioref",s.default],["doc-chapter",l.default],["doc-colophon",u.default],["doc-conclusion",d.default],["doc-cover",c.default],["doc-credit",f.default],["doc-credits",p.default],["doc-dedication",m.default],["doc-endnote",g.default],["doc-endnotes",b.default],["doc-epigraph",h.default],["doc-epilogue",w.default],["doc-errata",x.default],["doc-example",T.default],["doc-footnote",E.default],["doc-foreword",y.default],["doc-glossary",v.default],["doc-glossref",R.default],["doc-index",k.default],["doc-introduction",P.default],["doc-noteref",M.default],["doc-notice",F.default],["doc-pagebreak",j.default],["doc-pagelist",D.default],["doc-part",J.default],["doc-preface",B.default],["doc-prologue",Y.default],["doc-pullquote",L.default],["doc-qna",Z.default],["doc-subtitle",ae.default],["doc-tip",ne.default],["doc-toc",fe.default]],ce=me;return Wa.default=ce,Wa}var Ao={},qo={},lm;function JT(){if(lm)return qo;lm=1,Object.defineProperty(qo,"__esModule",{value:!0}),qo.default=void 0;var e={abstract:!1,accessibleNameRequired:!0,baseConcepts:[],childrenPresentational:!1,nameFrom:["author"],prohibitedProps:[],props:{"aria-disabled":null,"aria-errormessage":null,"aria-expanded":null,"aria-haspopup":null,"aria-invalid":null},relatedConcepts:[{module:"GRAPHICS",concept:{name:"graphics-object"}},{module:"ARIA",concept:{name:"img"}},{module:"ARIA",concept:{name:"article"}}],requireContextRole:[],requiredContextRole:[],requiredOwnedElements:[],requiredProps:{},superClass:[["roletype","structure","document"]]},t=e;return qo.default=t,qo}var Io={},um;function XT(){if(um)return Io;um=1,Object.defineProperty(Io,"__esModule",{value:!0}),Io.default=void 0;var e={abstract:!1,accessibleNameRequired:!1,baseConcepts:[],childrenPresentational:!1,nameFrom:["author","contents"],prohibitedProps:[],props:{"aria-errormessage":null,"aria-expanded":null,"aria-haspopup":null,"aria-invalid":null},relatedConcepts:[{module:"GRAPHICS",concept:{name:"graphics-document"}},{module:"ARIA",concept:{name:"group"}},{module:"ARIA",concept:{name:"img"}},{module:"GRAPHICS",concept:{name:"graphics-symbol"}}],requireContextRole:[],requiredContextRole:[],requiredOwnedElements:[],requiredProps:{},superClass:[["roletype","structure","section","group"]]},t=e;return Io.default=t,Io}var Oo={},cm;function YT(){if(cm)return Oo;cm=1,Object.defineProperty(Oo,"__esModule",{value:!0}),Oo.default=void 0;var e={abstract:!1,accessibleNameRequired:!0,baseConcepts:[],childrenPresentational:!0,nameFrom:["author"],prohibitedProps:[],props:{"aria-disabled":null,"aria-errormessage":null,"aria-expanded":null,"aria-haspopup":null,"aria-invalid":null},relatedConcepts:[],requireContextRole:[],requiredContextRole:[],requiredOwnedElements:[],requiredProps:{},superClass:[["roletype","structure","section","img"]]},t=e;return Oo.default=t,Oo}var dm;function QT(){if(dm)return Ao;dm=1,Object.defineProperty(Ao,"__esModule",{value:!0}),Ao.default=void 0;var e=n(JT()),t=n(XT()),r=n(YT());function n(o){return o&&o.__esModule?o:{default:o}}var a=[["graphics-document",e.default],["graphics-object",t.default],["graphics-symbol",r.default]],i=a;return Ao.default=i,Ao}var fm;function Iu(){if(fm)return Zr;fm=1,Object.defineProperty(Zr,"__esModule",{value:!0}),Zr.default=void 0;var e=i(qE()),t=i(lT()),r=i(KT()),n=i(QT()),a=i(si());function i(h){return h&&h.__esModule?h:{default:h}}function o(h,w,x){return w in h?Object.defineProperty(h,w,{value:x,enumerable:!0,configurable:!0,writable:!0}):h[w]=x,h}function s(h,w){var x=typeof Symbol<"u"&&h[Symbol.iterator]||h["@@iterator"];if(!x){if(Array.isArray(h)||(x=d(h))||w){x&&(h=x);var T=0,E=function(){};return{s:E,n:function(){return T>=h.length?{done:!0}:{done:!1,value:h[T++]}},e:function(P){throw P},f:E}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
38
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var y=!0,v=!1,R;return{s:function(){x=x.call(h)},n:function(){var P=x.next();return y=P.done,P},e:function(P){v=!0,R=P},f:function(){try{!y&&x.return!=null&&x.return()}finally{if(v)throw R}}}}function l(h,w){return p(h)||f(h,w)||d(h,w)||u()}function u(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
39
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function d(h,w){if(h){if(typeof h=="string")return c(h,w);var x=Object.prototype.toString.call(h).slice(8,-1);if(x==="Object"&&h.constructor&&(x=h.constructor.name),x==="Map"||x==="Set")return Array.from(h);if(x==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(x))return c(h,w)}}function c(h,w){(w==null||w>h.length)&&(w=h.length);for(var x=0,T=new Array(w);x<w;x++)T[x]=h[x];return T}function f(h,w){var x=h==null?null:typeof Symbol<"u"&&h[Symbol.iterator]||h["@@iterator"];if(x!=null){var T=[],E=!0,y=!1,v,R;try{for(x=x.call(h);!(E=(v=x.next()).done)&&(T.push(v.value),!(w&&T.length===w));E=!0);}catch(k){y=!0,R=k}finally{try{!E&&x.return!=null&&x.return()}finally{if(y)throw R}}return T}}function p(h){if(Array.isArray(h))return h}var m=[].concat(e.default,t.default,r.default,n.default);m.forEach(function(h){var w=l(h,2),x=w[1],T=s(x.superClass),E;try{for(T.s();!(E=T.n()).done;){var y=E.value,v=s(y),R;try{var k=function(){var M=R.value,F=m.find(function(Y){var L=l(Y,1),Z=L[0];return Z===M});if(F)for(var j=F[1],D=0,J=Object.keys(j.props);D<J.length;D++){var B=J[D];Object.prototype.hasOwnProperty.call(x.props,B)||Object.assign(x.props,o({},B,j.props[B]))}};for(v.s();!(R=v.n()).done;)k()}catch(P){v.e(P)}finally{v.f()}}}catch(P){T.e(P)}finally{T.f()}});var g={entries:function(){return m},forEach:function(w){var x=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null,T=s(m),E;try{for(T.s();!(E=T.n()).done;){var y=l(E.value,2),v=y[0],R=y[1];w.call(x,R,v,m)}}catch(k){T.e(k)}finally{T.f()}},get:function(w){var x=m.find(function(T){return T[0]===w});return x&&x[1]},has:function(w){return!!g.get(w)},keys:function(){return m.map(function(w){var x=l(w,1),T=x[0];return T})},values:function(){return m.map(function(w){var x=l(w,2),T=x[1];return T})}},b=(0,a.default)(g,g.entries());return Zr.default=b,Zr}var No={},js={},pm;function ZT(){if(pm)return js;pm=1;var e=Object.prototype.hasOwnProperty;function t(r,n){var a,i;if(r===n)return!0;if(r&&n&&(a=r.constructor)===n.constructor){if(a===Date)return r.getTime()===n.getTime();if(a===RegExp)return r.toString()===n.toString();if(a===Array){if((i=r.length)===n.length)for(;i--&&t(r[i],n[i]););return i===-1}if(!a||typeof r=="object"){i=0;for(a in r)if(e.call(r,a)&&++i&&!e.call(n,a)||!(a in n)||!t(r[a],n[a]))return!1;return Object.keys(n).length===i}}return r!==r&&n!==n}return js.dequal=t,js}var mm;function eS(){if(mm)return No;mm=1,Object.defineProperty(No,"__esModule",{value:!0}),No.default=void 0;var e=ZT(),t=n(si()),r=n(Iu());function n(E){return E&&E.__esModule?E:{default:E}}function a(E,y){return s(E)||o(E,y)||u(E,y)||i()}function i(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
40
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function o(E,y){var v=E==null?null:typeof Symbol<"u"&&E[Symbol.iterator]||E["@@iterator"];if(v!=null){var R=[],k=!0,P=!1,M,F;try{for(v=v.call(E);!(k=(M=v.next()).done)&&(R.push(M.value),!(y&&R.length===y));k=!0);}catch(j){P=!0,F=j}finally{try{!k&&v.return!=null&&v.return()}finally{if(P)throw F}}return R}}function s(E){if(Array.isArray(E))return E}function l(E,y){var v=typeof Symbol<"u"&&E[Symbol.iterator]||E["@@iterator"];if(!v){if(Array.isArray(E)||(v=u(E))||y){v&&(E=v);var R=0,k=function(){};return{s:k,n:function(){return R>=E.length?{done:!0}:{done:!1,value:E[R++]}},e:function(D){throw D},f:k}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
41
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var P=!0,M=!1,F;return{s:function(){v=v.call(E)},n:function(){var D=v.next();return P=D.done,D},e:function(D){M=!0,F=D},f:function(){try{!P&&v.return!=null&&v.return()}finally{if(M)throw F}}}}function u(E,y){if(E){if(typeof E=="string")return d(E,y);var v=Object.prototype.toString.call(E).slice(8,-1);if(v==="Object"&&E.constructor&&(v=E.constructor.name),v==="Map"||v==="Set")return Array.from(E);if(v==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(v))return d(E,y)}}function d(E,y){(y==null||y>E.length)&&(y=E.length);for(var v=0,R=new Array(y);v<y;v++)R[v]=E[v];return R}for(var c=[],f=r.default.keys(),p=0;p<f.length;p++){var m=f[p],g=r.default.get(m);if(g)for(var b=[].concat(g.baseConcepts,g.relatedConcepts),h=0;h<b.length;h++){var w=b[h];w.module==="HTML"&&(function(){var E=w.concept;if(E){var y=c.find(function(P){return(0,e.dequal)(P,E)}),v;y?v=y[1]:v=[];for(var R=!0,k=0;k<v.length;k++)if(v[k]===m){R=!1;break}R&&v.push(m),c.push([E,v])}})()}}var x={entries:function(){return c},forEach:function(y){var v=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null,R=l(c),k;try{for(R.s();!(k=R.n()).done;){var P=a(k.value,2),M=P[0],F=P[1];y.call(v,F,M,c)}}catch(j){R.e(j)}finally{R.f()}},get:function(y){var v=c.find(function(R){return y.name===R[0].name&&(0,e.dequal)(y.attributes,R[0].attributes)});return v&&v[1]},has:function(y){return!!x.get(y)},keys:function(){return c.map(function(y){var v=a(y,1),R=v[0];return R})},values:function(){return c.map(function(y){var v=a(y,2),R=v[1];return R})}},T=(0,t.default)(x,x.entries());return No.default=T,No}var $o={},hm;function tS(){if(hm)return $o;hm=1,Object.defineProperty($o,"__esModule",{value:!0}),$o.default=void 0;var e=r(si()),t=r(Iu());function r(y){return y&&y.__esModule?y:{default:y}}function n(y,v){return o(y)||i(y,v)||l(y,v)||a()}function a(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
42
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function i(y,v){var R=y==null?null:typeof Symbol<"u"&&y[Symbol.iterator]||y["@@iterator"];if(R!=null){var k=[],P=!0,M=!1,F,j;try{for(R=R.call(y);!(P=(F=R.next()).done)&&(k.push(F.value),!(v&&k.length===v));P=!0);}catch(D){M=!0,j=D}finally{try{!P&&R.return!=null&&R.return()}finally{if(M)throw j}}return k}}function o(y){if(Array.isArray(y))return y}function s(y,v){var R=typeof Symbol<"u"&&y[Symbol.iterator]||y["@@iterator"];if(!R){if(Array.isArray(y)||(R=l(y))||v){R&&(y=R);var k=0,P=function(){};return{s:P,n:function(){return k>=y.length?{done:!0}:{done:!1,value:y[k++]}},e:function(J){throw J},f:P}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
43
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var M=!0,F=!1,j;return{s:function(){R=R.call(y)},n:function(){var J=R.next();return M=J.done,J},e:function(J){F=!0,j=J},f:function(){try{!M&&R.return!=null&&R.return()}finally{if(F)throw j}}}}function l(y,v){if(y){if(typeof y=="string")return u(y,v);var R=Object.prototype.toString.call(y).slice(8,-1);if(R==="Object"&&y.constructor&&(R=y.constructor.name),R==="Map"||R==="Set")return Array.from(y);if(R==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(R))return u(y,v)}}function u(y,v){(v==null||v>y.length)&&(v=y.length);for(var R=0,k=new Array(v);R<v;R++)k[R]=y[R];return k}for(var d=[],c=t.default.keys(),f=0;f<c.length;f++){var p=c[f],m=t.default.get(p),g=[];if(m){for(var b=[].concat(m.baseConcepts,m.relatedConcepts),h=0;h<b.length;h++){var w=b[h];if(w.module==="HTML"){var x=w.concept;x!=null&&g.push(x)}}g.length>0&&d.push([p,g])}}var T={entries:function(){return d},forEach:function(v){var R=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null,k=s(d),P;try{for(k.s();!(P=k.n()).done;){var M=n(P.value,2),F=M[0],j=M[1];v.call(R,j,F,d)}}catch(D){k.e(D)}finally{k.f()}},get:function(v){var R=d.find(function(k){return k[0]===v});return R&&R[1]},has:function(v){return!!T.get(v)},keys:function(){return d.map(function(v){var R=n(v,1),k=R[0];return k})},values:function(){return d.map(function(v){var R=n(v,2),k=R[1];return k})}},E=(0,e.default)(T,T.entries());return $o.default=E,$o}var gm;function rS(){if(gm)return Ze;gm=1,Object.defineProperty(Ze,"__esModule",{value:!0}),Ze.roles=Ze.roleElements=Ze.elementRoles=Ze.dom=Ze.aria=void 0;var e=i(yE()),t=i(vE()),r=i(Iu()),n=i(eS()),a=i(tS());function i(c){return c&&c.__esModule?c:{default:c}}var o=e.default;Ze.aria=o;var s=t.default;Ze.dom=s;var l=r.default;Ze.roles=l;var u=n.default;Ze.elementRoles=u;var d=a.default;return Ze.roleElements=d,Ze}var rt=rS(),Ds={exports:{}},bm;function nS(){return bm||(bm=1,(function(e){var t=(function(){var r=String.fromCharCode,n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+-$",i={};function o(l,u){if(!i[l]){i[l]={};for(var d=0;d<l.length;d++)i[l][l.charAt(d)]=d}return i[l][u]}var s={compressToBase64:function(l){if(l==null)return"";var u=s._compress(l,6,function(d){return n.charAt(d)});switch(u.length%4){default:case 0:return u;case 1:return u+"===";case 2:return u+"==";case 3:return u+"="}},decompressFromBase64:function(l){return l==null?"":l==""?null:s._decompress(l.length,32,function(u){return o(n,l.charAt(u))})},compressToUTF16:function(l){return l==null?"":s._compress(l,15,function(u){return r(u+32)})+" "},decompressFromUTF16:function(l){return l==null?"":l==""?null:s._decompress(l.length,16384,function(u){return l.charCodeAt(u)-32})},compressToUint8Array:function(l){for(var u=s.compress(l),d=new Uint8Array(u.length*2),c=0,f=u.length;c<f;c++){var p=u.charCodeAt(c);d[c*2]=p>>>8,d[c*2+1]=p%256}return d},decompressFromUint8Array:function(l){if(l==null)return s.decompress(l);for(var u=new Array(l.length/2),d=0,c=u.length;d<c;d++)u[d]=l[d*2]*256+l[d*2+1];var f=[];return u.forEach(function(p){f.push(r(p))}),s.decompress(f.join(""))},compressToEncodedURIComponent:function(l){return l==null?"":s._compress(l,6,function(u){return a.charAt(u)})},decompressFromEncodedURIComponent:function(l){return l==null?"":l==""?null:(l=l.replace(/ /g,"+"),s._decompress(l.length,32,function(u){return o(a,l.charAt(u))}))},compress:function(l){return s._compress(l,16,function(u){return r(u)})},_compress:function(l,u,d){if(l==null)return"";var c,f,p={},m={},g="",b="",h="",w=2,x=3,T=2,E=[],y=0,v=0,R;for(R=0;R<l.length;R+=1)if(g=l.charAt(R),Object.prototype.hasOwnProperty.call(p,g)||(p[g]=x++,m[g]=!0),b=h+g,Object.prototype.hasOwnProperty.call(p,b))h=b;else{if(Object.prototype.hasOwnProperty.call(m,h)){if(h.charCodeAt(0)<256){for(c=0;c<T;c++)y=y<<1,v==u-1?(v=0,E.push(d(y)),y=0):v++;for(f=h.charCodeAt(0),c=0;c<8;c++)y=y<<1|f&1,v==u-1?(v=0,E.push(d(y)),y=0):v++,f=f>>1}else{for(f=1,c=0;c<T;c++)y=y<<1|f,v==u-1?(v=0,E.push(d(y)),y=0):v++,f=0;for(f=h.charCodeAt(0),c=0;c<16;c++)y=y<<1|f&1,v==u-1?(v=0,E.push(d(y)),y=0):v++,f=f>>1}w--,w==0&&(w=Math.pow(2,T),T++),delete m[h]}else for(f=p[h],c=0;c<T;c++)y=y<<1|f&1,v==u-1?(v=0,E.push(d(y)),y=0):v++,f=f>>1;w--,w==0&&(w=Math.pow(2,T),T++),p[b]=x++,h=String(g)}if(h!==""){if(Object.prototype.hasOwnProperty.call(m,h)){if(h.charCodeAt(0)<256){for(c=0;c<T;c++)y=y<<1,v==u-1?(v=0,E.push(d(y)),y=0):v++;for(f=h.charCodeAt(0),c=0;c<8;c++)y=y<<1|f&1,v==u-1?(v=0,E.push(d(y)),y=0):v++,f=f>>1}else{for(f=1,c=0;c<T;c++)y=y<<1|f,v==u-1?(v=0,E.push(d(y)),y=0):v++,f=0;for(f=h.charCodeAt(0),c=0;c<16;c++)y=y<<1|f&1,v==u-1?(v=0,E.push(d(y)),y=0):v++,f=f>>1}w--,w==0&&(w=Math.pow(2,T),T++),delete m[h]}else for(f=p[h],c=0;c<T;c++)y=y<<1|f&1,v==u-1?(v=0,E.push(d(y)),y=0):v++,f=f>>1;w--,w==0&&(w=Math.pow(2,T),T++)}for(f=2,c=0;c<T;c++)y=y<<1|f&1,v==u-1?(v=0,E.push(d(y)),y=0):v++,f=f>>1;for(;;)if(y=y<<1,v==u-1){E.push(d(y));break}else v++;return E.join("")},decompress:function(l){return l==null?"":l==""?null:s._decompress(l.length,32768,function(u){return l.charCodeAt(u)})},_decompress:function(l,u,d){var c=[],f=4,p=4,m=3,g="",b=[],h,w,x,T,E,y,v,R={val:d(0),position:u,index:1};for(h=0;h<3;h+=1)c[h]=h;for(x=0,E=Math.pow(2,2),y=1;y!=E;)T=R.val&R.position,R.position>>=1,R.position==0&&(R.position=u,R.val=d(R.index++)),x|=(T>0?1:0)*y,y<<=1;switch(x){case 0:for(x=0,E=Math.pow(2,8),y=1;y!=E;)T=R.val&R.position,R.position>>=1,R.position==0&&(R.position=u,R.val=d(R.index++)),x|=(T>0?1:0)*y,y<<=1;v=r(x);break;case 1:for(x=0,E=Math.pow(2,16),y=1;y!=E;)T=R.val&R.position,R.position>>=1,R.position==0&&(R.position=u,R.val=d(R.index++)),x|=(T>0?1:0)*y,y<<=1;v=r(x);break;case 2:return""}for(c[3]=v,w=v,b.push(v);;){if(R.index>l)return"";for(x=0,E=Math.pow(2,m),y=1;y!=E;)T=R.val&R.position,R.position>>=1,R.position==0&&(R.position=u,R.val=d(R.index++)),x|=(T>0?1:0)*y,y<<=1;switch(v=x){case 0:for(x=0,E=Math.pow(2,8),y=1;y!=E;)T=R.val&R.position,R.position>>=1,R.position==0&&(R.position=u,R.val=d(R.index++)),x|=(T>0?1:0)*y,y<<=1;c[p++]=r(x),v=p-1,f--;break;case 1:for(x=0,E=Math.pow(2,16),y=1;y!=E;)T=R.val&R.position,R.position>>=1,R.position==0&&(R.position=u,R.val=d(R.index++)),x|=(T>0?1:0)*y,y<<=1;c[p++]=r(x),v=p-1,f--;break;case 2:return b.join("")}if(f==0&&(f=Math.pow(2,m),m++),c[v])g=c[v];else if(v===p)g=w+w.charAt(0);else return null;b.push(g),c[p++]=w+g.charAt(0),f--,w=g,f==0&&(f=Math.pow(2,m),m++)}}};return s})();e!=null?e.exports=t:typeof angular<"u"&&angular!=null&&angular.module("LZString",[]).factory("LZString",function(){return t})})(Ds)),Ds.exports}var aS=nS();const oS=fC(aS);function Mb(e){return e.replace(/</g,"&lt;").replace(/>/g,"&gt;")}const iS=(e,t,r,n,a,i,o)=>{const s=n+r.indent,l=r.colors;return e.map(u=>{const d=t[u];let c=o(d,r,s,a,i);return typeof d!="string"&&(c.indexOf(`
44
+ `)!==-1&&(c=r.spacingOuter+s+c+r.spacingOuter+n),c="{"+c+"}"),r.spacingInner+n+l.prop.open+u+l.prop.close+"="+l.value.open+c+l.value.close}).join("")},sS=3,lS=(e,t,r,n,a,i)=>e.map(o=>{const s=typeof o=="string"?Ab(o,t):i(o,t,r,n,a);return s===""&&typeof o=="object"&&o!==null&&o.nodeType!==sS?"":t.spacingOuter+r+s}).join(""),Ab=(e,t)=>{const r=t.colors.content;return r.open+Mb(e)+r.close},uS=(e,t)=>{const r=t.colors.comment;return r.open+"<!--"+Mb(e)+"-->"+r.close},cS=(e,t,r,n,a)=>{const i=n.colors.tag;return i.open+"<"+e+(t&&i.close+t+n.spacingOuter+a+i.open)+(r?">"+i.close+r+n.spacingOuter+a+i.open+"</"+e:(t&&!n.min?"":" ")+"/")+">"+i.close},dS=(e,t)=>{const r=t.colors.tag;return r.open+"<"+e+r.close+" …"+r.open+" />"+r.close},fS=1,qb=3,Ib=8,Ob=11,pS=/^((HTML|SVG)\w*)?Element$/,Nb=e=>{const{tagName:t}=e;return!!(typeof t=="string"&&t.includes("-")||typeof e.hasAttribute=="function"&&e.hasAttribute("is"))},mS=e=>{const t=e.constructor.name,{nodeType:r}=e;return r===fS&&(pS.test(t)||Nb(e))||r===qb&&t==="Text"||r===Ib&&t==="Comment"||r===Ob&&t==="DocumentFragment"};function hS(e){return e.nodeType===qb}function gS(e){return e.nodeType===Ib}function Ls(e){return e.nodeType===Ob}function bS(e){return{test:t=>{var r;return((t==null||(r=t.constructor)==null?void 0:r.name)||Nb(t))&&mS(t)},serialize:(t,r,n,a,i,o)=>{if(hS(t))return Ab(t.data,r);if(gS(t))return uS(t.data,r);const s=Ls(t)?"DocumentFragment":t.tagName.toLowerCase();return++a>r.maxDepth?dS(s,r):cS(s,iS(Ls(t)?[]:Array.from(t.attributes).map(l=>l.name).sort(),Ls(t)?{}:Array.from(t.attributes).reduce((l,u)=>(l[u.name]=u.value,l),{}),r,n+r.indent,a,i,o),lS(Array.prototype.slice.call(t.childNodes||t.children).filter(e),r,n+r.indent,a,i,o),r,n)}}}let $b=null,Ou=null,Nu=null;try{const e=module&&module.require;Ou=e.call(module,"fs").readFileSync,Nu=e.call(module,"@babel/code-frame").codeFrameColumns,$b=e.call(module,"picocolors")}catch{}function yS(e){const t=e.indexOf("(")+1,r=e.indexOf(")"),n=e.slice(t,r),a=n.split(":"),[i,o,s]=[a[0],parseInt(a[1],10),parseInt(a[2],10)];let l="";try{l=Ou(i,"utf-8")}catch{return""}const u=Nu(l,{start:{line:o,column:s}},{highlightCode:!0,linesBelow:0});return $b.dim(n)+`
45
+ `+u+`
46
+ `}function vS(){if(!Ou||!Nu)return"";const t=new Error().stack.split(`
47
+ `).slice(1).find(r=>!r.includes("node_modules/"));return yS(t)}const jb=3;function Fs(){return typeof jest<"u"&&jest!==null?setTimeout._isMockFunction===!0||Object.prototype.hasOwnProperty.call(setTimeout,"clock"):!1}function $u(){if(typeof window>"u")throw new Error("Could not find default container");return window.document}function Db(e){if(e.defaultView)return e.defaultView;if(e.ownerDocument&&e.ownerDocument.defaultView)return e.ownerDocument.defaultView;if(e.window)return e.window;throw e.ownerDocument&&e.ownerDocument.defaultView===null?new Error("It looks like the window object is not available for the provided node."):e.then instanceof Function?new Error("It looks like you passed a Promise object instead of a DOM node. Did you do something like `fireEvent.click(screen.findBy...` when you meant to use a `getBy` query `fireEvent.click(screen.getBy...`, or await the findBy query `fireEvent.click(await screen.findBy...`?"):Array.isArray(e)?new Error("It looks like you passed an Array instead of a DOM node. Did you do something like `fireEvent.click(screen.getAllBy...` when you meant to use a `getBy` query `fireEvent.click(screen.getBy...`?"):typeof e.debug=="function"&&typeof e.logTestingPlaygroundURL=="function"?new Error("It looks like you passed a `screen` object. Did you do something like `fireEvent.click(screen, ...` when you meant to use a query, e.g. `fireEvent.click(screen.getBy..., `?"):new Error("The given node is not an Element, the node type is: "+typeof e+".")}function Dt(e){if(!e||typeof e.querySelector!="function"||typeof e.querySelectorAll!="function")throw new TypeError("Expected container to be an Element, a Document or a DocumentFragment but got "+t(e)+".");function t(r){return typeof r=="object"?r===null?"null":r.constructor.name:typeof r}}const wS=()=>{if(typeof process>"u")return!1;let e;try{var t;const r=(t=process.env)==null?void 0:t.COLORS;r&&(e=JSON.parse(r))}catch{}return typeof e=="boolean"?e:process.versions!==void 0&&process.versions.node!==void 0},{DOMCollection:xS}=xb.plugins,RS=1,CS=8;function ES(e){return e.nodeType!==CS&&(e.nodeType!==RS||!e.matches(Ee().defaultIgnore))}function Ir(e,t,r){if(r===void 0&&(r={}),e||(e=$u().body),typeof t!="number"&&(t=typeof process<"u"&&typeof process.env<"u"&&process.env.DEBUG_PRINT_LIMIT||7e3),t===0)return"";e.documentElement&&(e=e.documentElement);let n=typeof e;if(n==="object"?n=e.constructor.name:e={},!("outerHTML"in e))throw new TypeError("Expected an element or document but got "+n);const{filterNode:a=ES,...i}=r,o=xb.format(e,{plugins:[bS(a),xS],printFunctionName:!1,highlight:wS(),...i});return t!==void 0&&e.outerHTML.length>t?o.slice(0,t)+"...":o}const ym=function(){const e=vS();console.log(e?Ir(...arguments)+`
48
+
49
+ `+e:Ir(...arguments))};let sr={testIdAttribute:"data-testid",asyncUtilTimeout:1e3,asyncWrapper:e=>e(),unstable_advanceTimersWrapper:e=>e(),eventWrapper:e=>e(),defaultHidden:!1,defaultIgnore:"script, style",showOriginalStackTrace:!1,throwSuggestions:!1,getElementError(e,t){const r=Ir(t),n=new Error([e,"Ignored nodes: comments, "+sr.defaultIgnore+`
50
+ `+r].filter(Boolean).join(`
51
+
52
+ `));return n.name="TestingLibraryElementError",n},_disableExpensiveErrorDiagnostics:!1,computedStyleSupportsPseudoElements:!1};function TS(e){try{return sr._disableExpensiveErrorDiagnostics=!0,e()}finally{sr._disableExpensiveErrorDiagnostics=!1}}function SS(e){typeof e=="function"&&(e=e(sr)),sr={...sr,...e}}function Ee(){return sr}const _S=["button","meter","output","progress","select","textarea","input"];function Lb(e){return _S.includes(e.nodeName.toLowerCase())?"":e.nodeType===jb?e.textContent:Array.from(e.childNodes).map(t=>Lb(t)).join("")}function Al(e){let t;return e.tagName.toLowerCase()==="label"?t=Lb(e):t=e.value||e.textContent,t}function Fb(e){if(e.labels!==void 0){var t;return(t=e.labels)!=null?t:[]}if(!PS(e))return[];const r=e.ownerDocument.querySelectorAll("label");return Array.from(r).filter(n=>n.control===e)}function PS(e){return/BUTTON|METER|OUTPUT|PROGRESS|SELECT|TEXTAREA/.test(e.tagName)||e.tagName==="INPUT"&&e.getAttribute("type")!=="hidden"}function Bb(e,t,r){let{selector:n="*"}=r===void 0?{}:r;const a=t.getAttribute("aria-labelledby"),i=a?a.split(" "):[];return i.length?i.map(o=>{const s=e.querySelector('[id="'+o+'"]');return s?{content:Al(s),formControl:null}:{content:"",formControl:null}}):Array.from(Fb(t)).map(o=>{const s=Al(o),u=Array.from(o.querySelectorAll("button, input, meter, output, progress, select, textarea")).filter(d=>d.matches(n))[0];return{content:s,formControl:u}})}function zb(e){if(e==null)throw new Error("It looks like "+e+" was passed instead of a matcher. Did you do something like getByText("+e+")?")}function Fr(e,t,r,n){if(typeof e!="string")return!1;zb(r);const a=n(e);return typeof r=="string"||typeof r=="number"?a.toLowerCase().includes(r.toString().toLowerCase()):typeof r=="function"?r(a,t):Wb(r,a)}function $t(e,t,r,n){if(typeof e!="string")return!1;zb(r);const a=n(e);return r instanceof Function?r(a,t):r instanceof RegExp?Wb(r,a):a===String(r)}function Ub(e){let{trim:t=!0,collapseWhitespace:r=!0}=e===void 0?{}:e;return n=>{let a=n;return a=t?a.trim():a,a=r?a.replace(/\s+/g," "):a,a}}function gr(e){let{trim:t,collapseWhitespace:r,normalizer:n}=e;if(!n)return Ub({trim:t,collapseWhitespace:r});if(typeof t<"u"||typeof r<"u")throw new Error('trim and collapseWhitespace are not supported with a normalizer. If you want to use the default trim and collapseWhitespace logic in your normalizer, use "getDefaultNormalizer({trim, collapseWhitespace})" and compose that into your normalizer');return n}function Wb(e,t){const r=e.test(t);return e.global&&e.lastIndex!==0&&(console.warn("To match all elements we had to reset the lastIndex of the RegExp because the global flag is enabled. We encourage to remove the global flag from the RegExp."),e.lastIndex=0),r}function fs(e){return e.matches("input[type=submit], input[type=button], input[type=reset]")?e.value:Array.from(e.childNodes).filter(t=>t.nodeType===jb&&!!t.textContent).map(t=>t.textContent).join("")}const kS=MS(rt.elementRoles);function Vb(e){return e.hidden===!0||e.getAttribute("aria-hidden")==="true"||e.ownerDocument.defaultView.getComputedStyle(e).display==="none"}function ju(e,t){t===void 0&&(t={});const{isSubtreeInaccessible:r=Vb}=t;if(e.ownerDocument.defaultView.getComputedStyle(e).visibility==="hidden")return!0;let a=e;for(;a;){if(r(a))return!0;a=a.parentElement}return!1}function Du(e){for(const{match:t,roles:r}of kS)if(t(e))return[...r];return[]}function MS(e){function t(o){let{name:s,attributes:l}=o;return""+s+l.map(u=>{let{name:d,value:c,constraints:f=[]}=u;const p=f.indexOf("undefined")!==-1,m=f.indexOf("set")!==-1;return typeof c<"u"?"["+d+'="'+c+'"]':p?":not(["+d+"])":m?"["+d+"]:not(["+d+'=""])':"["+d+"]"}).join("")}function r(o){let{attributes:s=[]}=o;return s.length}function n(o,s){let{specificity:l}=o,{specificity:u}=s;return u-l}function a(o){let{attributes:s=[]}=o;const l=s.findIndex(d=>d.value&&d.name==="type"&&d.value==="text");l>=0&&(s=[...s.slice(0,l),...s.slice(l+1)]);const u=t({...o,attributes:s});return d=>l>=0&&d.type!=="text"?!1:d.matches(u)}let i=[];for(const[o,s]of e.entries())i=[...i,{match:a(o),roles:Array.from(s),specificity:r(o)}];return i.sort(n)}function AS(e,t){let{hidden:r=!1}=t===void 0?{}:t;function n(a){return[a,...Array.from(a.children).reduce((i,o)=>[...i,...n(o)],[])]}return n(e).filter(a=>r===!1?ju(a)===!1:!0).reduce((a,i)=>{let o=[];return i.hasAttribute("role")?o=i.getAttribute("role").split(" ").slice(0,1):o=Du(i),o.reduce((s,l)=>Array.isArray(s[l])?{...s,[l]:[...s[l],i]}:{...s,[l]:[i]},a)},{})}function qS(e,t){let{hidden:r,includeDescription:n}=t;const a=AS(e,{hidden:r});return Object.entries(a).filter(i=>{let[o]=i;return o!=="generic"}).map(i=>{let[o,s]=i;const l="-".repeat(50),u=s.map(d=>{const c='Name "'+qu(d,{computedStyleSupportsPseudoElements:Ee().computedStyleSupportsPseudoElements})+`":
53
+ `,f=Ir(d.cloneNode(!1));if(n){const p='Description "'+kb(d,{computedStyleSupportsPseudoElements:Ee().computedStyleSupportsPseudoElements})+`":
54
+ `;return""+c+p+f}return""+c+f}).join(`
55
+
56
+ `);return o+`:
57
+
58
+ `+u+`
59
+
60
+ `+l}).join(`
61
+ `)}function IS(e){return e.tagName==="OPTION"?e.selected:li(e,"aria-selected")}function OS(e){return e.getAttribute("aria-busy")==="true"}function NS(e){if(!("indeterminate"in e&&e.indeterminate))return"checked"in e?e.checked:li(e,"aria-checked")}function $S(e){return li(e,"aria-pressed")}function jS(e){var t,r;return(t=(r=li(e,"aria-current"))!=null?r:e.getAttribute("aria-current"))!=null?t:!1}function DS(e){return li(e,"aria-expanded")}function li(e,t){const r=e.getAttribute(t);if(r==="true")return!0;if(r==="false")return!1}function LS(e){const t={H1:1,H2:2,H3:3,H4:4,H5:5,H6:6};return e.getAttribute("aria-level")&&Number(e.getAttribute("aria-level"))||t[e.tagName]}function FS(e){const t=e.getAttribute("aria-valuenow");return t===null?void 0:+t}function BS(e){const t=e.getAttribute("aria-valuemax");return t===null?void 0:+t}function zS(e){const t=e.getAttribute("aria-valuemin");return t===null?void 0:+t}function US(e){const t=e.getAttribute("aria-valuetext");return t===null?void 0:t}const vm=Ub();function WS(e){return e.replace(/[.*+\-?^${}()|[\]\\]/g,"\\$&")}function wm(e){return new RegExp(WS(e.toLowerCase()),"i")}function zt(e,t,r,n){let{variant:a,name:i}=n,o="";const s={},l=[["Role","TestId"].includes(e)?r:wm(r)];i&&(s.name=wm(i)),e==="Role"&&ju(t)&&(s.hidden=!0,o=`Element is inaccessible. This means that the element and all its children are invisible to screen readers.
62
+ If you are using the aria-hidden prop, make sure this is the right choice for your case.
63
+ `),Object.keys(s).length>0&&l.push(s);const u=a+"By"+e;return{queryName:e,queryMethod:u,queryArgs:l,variant:a,warning:o,toString(){o&&console.warn(o);let[d,c]=l;return d=typeof d=="string"?"'"+d+"'":d,c=c?", { "+Object.entries(c).map(f=>{let[p,m]=f;return p+": "+m}).join(", ")+" }":"",u+"("+d+c+")"}}}function Ut(e,t,r){return r&&!0}function ql(e,t,r){var n,a;if(t===void 0&&(t="get"),e.matches(Ee().defaultIgnore))return;const i=(n=e.getAttribute("role"))!=null?n:(a=Du(e))==null?void 0:a[0];if(i!=="generic"&&Ut("Role",r,i))return zt("Role",e,i,{variant:t,name:qu(e,{computedStyleSupportsPseudoElements:Ee().computedStyleSupportsPseudoElements})});const o=Bb(document,e).map(f=>f.content).join(" ");if(Ut("LabelText",r,o))return zt("LabelText",e,o,{variant:t});const s=e.getAttribute("placeholder");if(Ut("PlaceholderText",r,s))return zt("PlaceholderText",e,s,{variant:t});const l=vm(fs(e));if(Ut("Text",r,l))return zt("Text",e,l,{variant:t});if(Ut("DisplayValue",r,e.value))return zt("DisplayValue",e,vm(e.value),{variant:t});const u=e.getAttribute("alt");if(Ut("AltText",r,u))return zt("AltText",e,u,{variant:t});const d=e.getAttribute("title");if(Ut("Title",r,d))return zt("Title",e,d,{variant:t});const c=e.getAttribute(Ee().testIdAttribute);if(Ut("TestId",r,c))return zt("TestId",e,c,{variant:t})}function Ri(e,t){e.stack=t.stack.replace(t.message,e.message)}function VS(e,t){let{container:r=$u(),timeout:n=Ee().asyncUtilTimeout,showOriginalStackTrace:a=Ee().showOriginalStackTrace,stackTraceError:i,interval:o=50,onTimeout:s=u=>(Object.defineProperty(u,"message",{value:Ee().getElementError(u.message,r).message}),u),mutationObserverOptions:l={subtree:!0,childList:!0,attributes:!0,characterData:!0}}=t;if(typeof e!="function")throw new TypeError("Received `callback` arg must be a function");return new Promise(async(u,d)=>{let c,f,p,m=!1,g="idle";const b=setTimeout(E,n),h=Fs();if(h){const{unstable_advanceTimersWrapper:y}=Ee();for(T();!m;){if(!Fs()){const v=new Error("Changed from using fake timers to real timers while using waitFor. This is not allowed and will result in very strange behavior. Please ensure you're awaiting all async things your test is doing before changing to real timers. For more info, please go to https://github.com/testing-library/dom-testing-library/issues/830");a||Ri(v,i),d(v);return}if(await y(async()=>{jest.advanceTimersByTime(o)}),m)break;T()}}else{try{Dt(r)}catch(v){d(v);return}f=setInterval(x,o);const{MutationObserver:y}=Db(r);p=new y(x),p.observe(r,l),T()}function w(y,v){m=!0,clearTimeout(b),h||(clearInterval(f),p.disconnect()),y?d(y):u(v)}function x(){if(Fs()){const y=new Error("Changed from using real timers to fake timers while using waitFor. This is not allowed and will result in very strange behavior. Please ensure you're awaiting all async things your test is doing before changing to fake timers. For more info, please go to https://github.com/testing-library/dom-testing-library/issues/830");return a||Ri(y,i),d(y)}else return T()}function T(){if(g!=="pending")try{const y=TS(e);typeof y?.then=="function"?(g="pending",y.then(v=>{g="resolved",w(null,v)},v=>{g="rejected",c=v})):w(null,y)}catch(y){c=y}}function E(){let y;c?(y=c,!a&&y.name==="TestingLibraryElementError"&&Ri(y,i)):(y=new Error("Timed out in waitFor."),a||Ri(y,i)),w(s(y),null)}})}function HS(e,t){const r=new Error("STACK_TRACE_MESSAGE");return Ee().asyncWrapper(()=>VS(e,{stackTraceError:r,...t}))}function Hb(e,t){return Ee().getElementError(e,t)}function GS(e,t){return Hb(e+"\n\n(If this is intentional, then use the `*AllBy*` variant of the query (like `queryAllByText`, `getAllByText`, or `findAllByText`)).",t)}function ps(e,t,r,n){let{exact:a=!0,collapseWhitespace:i,trim:o,normalizer:s}=n===void 0?{}:n;const l=a?$t:Fr,u=gr({collapseWhitespace:i,trim:o,normalizer:s});return Array.from(t.querySelectorAll("["+e+"]")).filter(d=>l(d.getAttribute(e),d,r,u))}function Wi(e,t){return function(r){for(var n=arguments.length,a=new Array(n>1?n-1:0),i=1;i<n;i++)a[i-1]=arguments[i];const o=e(r,...a);if(o.length>1){const s=o.map(l=>Hb(null,l).message).join(`
64
+
65
+ `);throw GS(t(r,...a)+`
66
+
67
+ Here are the matching elements:
68
+
69
+ `+s,r)}return o[0]||null}}function Gb(e,t){return Ee().getElementError(`A better query is available, try this:
70
+ `+e.toString()+`
71
+ `,t)}function KS(e,t){return function(r){for(var n=arguments.length,a=new Array(n>1?n-1:0),i=1;i<n;i++)a[i-1]=arguments[i];const o=e(r,...a);if(!o.length)throw Ee().getElementError(t(r,...a),r);return o}}function Vi(e){return(t,r,n,a)=>HS(()=>e(t,r,n),{container:t,...a})}const kr=(e,t,r)=>function(n){for(var a=arguments.length,i=new Array(a>1?a-1:0),o=1;o<a;o++)i[o-1]=arguments[o];const s=e(n,...i),[{suggest:l=Ee().throwSuggestions}={}]=i.slice(-1);if(s&&l){const u=ql(s,r);if(u&&!t.endsWith(u.queryName))throw Gb(u.toString(),n)}return s},nt=(e,t,r)=>function(n){for(var a=arguments.length,i=new Array(a>1?a-1:0),o=1;o<a;o++)i[o-1]=arguments[o];const s=e(n,...i),[{suggest:l=Ee().throwSuggestions}={}]=i.slice(-1);if(s.length&&l){const u=[...new Set(s.map(d=>{var c;return(c=ql(d,r))==null?void 0:c.toString()}))];if(u.length===1&&!t.endsWith(ql(s[0],r).queryName))throw Gb(u[0],n)}return s};function br(e,t,r){const n=kr(Wi(e,t),e.name,"query"),a=KS(e,r),i=Wi(a,t),o=kr(i,e.name,"get"),s=nt(a,e.name.replace("query","get"),"getAll"),l=Vi(nt(a,e.name,"findAll")),u=Vi(kr(i,e.name,"find"));return[n,s,o,l,u]}function JS(e){return Array.from(e.querySelectorAll("label,input")).map(t=>({node:t,textToMatch:Al(t)})).filter(t=>{let{textToMatch:r}=t;return r!==null})}const XS=function(e,t,r){let{exact:n=!0,trim:a,collapseWhitespace:i,normalizer:o}=r===void 0?{}:r;const s=n?$t:Fr,l=gr({collapseWhitespace:i,trim:a,normalizer:o});return JS(e).filter(d=>{let{node:c,textToMatch:f}=d;return s(f,c,t,l)}).map(d=>{let{node:c}=d;return c})},ti=function(e,t,r){let{selector:n="*",exact:a=!0,collapseWhitespace:i,trim:o,normalizer:s}=r===void 0?{}:r;Dt(e);const l=a?$t:Fr,u=gr({collapseWhitespace:i,trim:o,normalizer:s}),d=Array.from(e.querySelectorAll("*")).filter(c=>Fb(c).length||c.hasAttribute("aria-labelledby")).reduce((c,f)=>{const p=Bb(e,f,{selector:n});p.filter(g=>!!g.formControl).forEach(g=>{l(g.content,g.formControl,t,u)&&g.formControl&&c.push(g.formControl)});const m=p.filter(g=>!!g.content).map(g=>g.content);return l(m.join(" "),f,t,u)&&c.push(f),m.length>1&&m.forEach((g,b)=>{l(g,f,t,u)&&c.push(f);const h=[...m];h.splice(b,1),h.length>1&&l(h.join(" "),f,t,u)&&c.push(f)}),c},[]).concat(ps("aria-label",e,t,{exact:a,normalizer:u}));return Array.from(new Set(d)).filter(c=>c.matches(n))},mr=function(e,t){for(var r=arguments.length,n=new Array(r>2?r-2:0),a=2;a<r;a++)n[a-2]=arguments[a];const i=ti(e,t,...n);if(!i.length){const o=XS(e,t,...n);if(o.length){const s=o.map(l=>YS(e,l)).filter(l=>!!l);throw s.length?Ee().getElementError(s.map(l=>"Found a label with the text of: "+t+", however the element associated with this label (<"+l+" />) is non-labellable [https://html.spec.whatwg.org/multipage/forms.html#category-label]. If you really need to label a <"+l+" />, you can use aria-label or aria-labelledby instead.").join(`
72
+
73
+ `),e):Ee().getElementError("Found a label with the text of: "+t+`, however no form control was found associated to that label. Make sure you're using the "for" attribute or "aria-labelledby" attribute correctly.`,e)}else throw Ee().getElementError("Unable to find a label with the text of: "+t,e)}return i};function YS(e,t){const r=t.getAttribute("for");if(!r)return null;const n=e.querySelector('[id="'+r+'"]');return n?n.tagName.toLowerCase():null}const Kb=(e,t)=>"Found multiple elements with the text of: "+t,QS=kr(Wi(ti,Kb),ti.name,"query"),Jb=Wi(mr,Kb),ZS=Vi(nt(mr,mr.name,"findAll")),e_=Vi(kr(Jb,mr.name,"find")),t_=nt(mr,mr.name,"getAll"),r_=kr(Jb,mr.name,"get"),n_=nt(ti,ti.name,"queryAll"),Il=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return Dt(t[0]),ps("placeholder",...t)},a_=(e,t)=>"Found multiple elements with the placeholder text of: "+t,o_=(e,t)=>"Unable to find an element with the placeholder text of: "+t,i_=nt(Il,Il.name,"queryAll"),[s_,l_,u_,c_,d_]=br(Il,a_,o_),Ol=function(e,t,r){let{selector:n="*",exact:a=!0,collapseWhitespace:i,trim:o,ignore:s=Ee().defaultIgnore,normalizer:l}=r===void 0?{}:r;Dt(e);const u=a?$t:Fr,d=gr({collapseWhitespace:i,trim:o,normalizer:l});let c=[];return typeof e.matches=="function"&&e.matches(n)&&(c=[e]),[...c,...Array.from(e.querySelectorAll(n))].filter(f=>!s||!f.matches(s)).filter(f=>u(fs(f),f,t,d))},f_=(e,t)=>"Found multiple elements with the text: "+t,p_=function(e,t,r){r===void 0&&(r={});const{collapseWhitespace:n,trim:a,normalizer:i,selector:o}=r,l=gr({collapseWhitespace:n,trim:a,normalizer:i})(t.toString()),u=l!==t.toString(),d=(o??"*")!=="*";return"Unable to find an element with the text: "+(u?l+" (normalized from '"+t+"')":t)+(d?", which matches selector '"+o+"'":"")+". This could be because the text is broken up by multiple elements. In this case, you can provide a function for your text matcher to make your matcher more flexible."},m_=nt(Ol,Ol.name,"queryAll"),[h_,g_,b_,y_,v_]=br(Ol,f_,p_),Nl=function(e,t,r){let{exact:n=!0,collapseWhitespace:a,trim:i,normalizer:o}=r===void 0?{}:r;Dt(e);const s=n?$t:Fr,l=gr({collapseWhitespace:a,trim:i,normalizer:o});return Array.from(e.querySelectorAll("input,textarea,select")).filter(u=>u.tagName==="SELECT"?Array.from(u.options).filter(c=>c.selected).some(c=>s(fs(c),c,t,l)):s(u.value,u,t,l))},w_=(e,t)=>"Found multiple elements with the display value: "+t+".",x_=(e,t)=>"Unable to find an element with the display value: "+t+".",R_=nt(Nl,Nl.name,"queryAll"),[C_,E_,T_,S_,__]=br(Nl,w_,x_),P_=/^(img|input|area|.+-.+)$/i,$l=function(e,t,r){return r===void 0&&(r={}),Dt(e),ps("alt",e,t,r).filter(n=>P_.test(n.tagName))},k_=(e,t)=>"Found multiple elements with the alt text: "+t,M_=(e,t)=>"Unable to find an element with the alt text: "+t,A_=nt($l,$l.name,"queryAll"),[q_,I_,O_,N_,$_]=br($l,k_,M_),j_=e=>{var t;return e.tagName.toLowerCase()==="title"&&((t=e.parentElement)==null?void 0:t.tagName.toLowerCase())==="svg"},jl=function(e,t,r){let{exact:n=!0,collapseWhitespace:a,trim:i,normalizer:o}=r===void 0?{}:r;Dt(e);const s=n?$t:Fr,l=gr({collapseWhitespace:a,trim:i,normalizer:o});return Array.from(e.querySelectorAll("[title], svg > title")).filter(u=>s(u.getAttribute("title"),u,t,l)||j_(u)&&s(fs(u),u,t,l))},D_=(e,t)=>"Found multiple elements with the title: "+t+".",L_=(e,t)=>"Unable to find an element with the title: "+t+".",F_=nt(jl,jl.name,"queryAll"),[B_,z_,U_,W_,V_]=br(jl,D_,L_),Dl=function(e,t,r){let{hidden:n=Ee().defaultHidden,name:a,description:i,queryFallbacks:o=!1,selected:s,busy:l,checked:u,pressed:d,current:c,level:f,expanded:p,value:{now:m,min:g,max:b,text:h}={}}=r===void 0?{}:r;if(Dt(e),s!==void 0){var w;if(((w=rt.roles.get(t))==null?void 0:w.props["aria-selected"])===void 0)throw new Error('"aria-selected" is not supported on role "'+t+'".')}if(l!==void 0){var x;if(((x=rt.roles.get(t))==null?void 0:x.props["aria-busy"])===void 0)throw new Error('"aria-busy" is not supported on role "'+t+'".')}if(u!==void 0){var T;if(((T=rt.roles.get(t))==null?void 0:T.props["aria-checked"])===void 0)throw new Error('"aria-checked" is not supported on role "'+t+'".')}if(d!==void 0){var E;if(((E=rt.roles.get(t))==null?void 0:E.props["aria-pressed"])===void 0)throw new Error('"aria-pressed" is not supported on role "'+t+'".')}if(c!==void 0){var y;if(((y=rt.roles.get(t))==null?void 0:y.props["aria-current"])===void 0)throw new Error('"aria-current" is not supported on role "'+t+'".')}if(f!==void 0&&t!=="heading")throw new Error('Role "'+t+'" cannot have "level" property.');if(m!==void 0){var v;if(((v=rt.roles.get(t))==null?void 0:v.props["aria-valuenow"])===void 0)throw new Error('"aria-valuenow" is not supported on role "'+t+'".')}if(b!==void 0){var R;if(((R=rt.roles.get(t))==null?void 0:R.props["aria-valuemax"])===void 0)throw new Error('"aria-valuemax" is not supported on role "'+t+'".')}if(g!==void 0){var k;if(((k=rt.roles.get(t))==null?void 0:k.props["aria-valuemin"])===void 0)throw new Error('"aria-valuemin" is not supported on role "'+t+'".')}if(h!==void 0){var P;if(((P=rt.roles.get(t))==null?void 0:P.props["aria-valuetext"])===void 0)throw new Error('"aria-valuetext" is not supported on role "'+t+'".')}if(p!==void 0){var M;if(((M=rt.roles.get(t))==null?void 0:M.props["aria-expanded"])===void 0)throw new Error('"aria-expanded" is not supported on role "'+t+'".')}const F=new WeakMap;function j(D){return F.has(D)||F.set(D,Vb(D)),F.get(D)}return Array.from(e.querySelectorAll(H_(t))).filter(D=>{if(D.hasAttribute("role")){const Y=D.getAttribute("role");if(o)return Y.split(" ").filter(Boolean).some(Z=>Z===t);const[L]=Y.split(" ");return L===t}return Du(D).some(Y=>Y===t)}).filter(D=>{if(s!==void 0)return s===IS(D);if(l!==void 0)return l===OS(D);if(u!==void 0)return u===NS(D);if(d!==void 0)return d===$S(D);if(c!==void 0)return c===jS(D);if(p!==void 0)return p===DS(D);if(f!==void 0)return f===LS(D);if(m!==void 0||b!==void 0||g!==void 0||h!==void 0){let B=!0;if(m!==void 0&&B&&(B=m===FS(D)),b!==void 0&&B&&(B=b===BS(D)),g!==void 0&&B&&(B=g===zS(D)),h!==void 0){var J;B&&(B=$t((J=US(D))!=null?J:null,D,h,Y=>Y))}return B}return!0}).filter(D=>a===void 0?!0:$t(qu(D,{computedStyleSupportsPseudoElements:Ee().computedStyleSupportsPseudoElements}),D,a,J=>J)).filter(D=>i===void 0?!0:$t(kb(D,{computedStyleSupportsPseudoElements:Ee().computedStyleSupportsPseudoElements}),D,i,J=>J)).filter(D=>n===!1?ju(D,{isSubtreeInaccessible:j})===!1:!0)};function H_(e){var t;const r='*[role~="'+e+'"]',n=(t=rt.roleElements.get(e))!=null?t:new Set,a=new Set(Array.from(n).map(i=>{let{name:o}=i;return o}));return[r].concat(Array.from(a)).join(",")}const Xb=e=>{let t="";return e===void 0?t="":typeof e=="string"?t=' and name "'+e+'"':t=" and name `"+e+"`",t},G_=function(e,t,r){let{name:n}=r===void 0?{}:r;return'Found multiple elements with the role "'+t+'"'+Xb(n)},K_=function(e,t,r){let{hidden:n=Ee().defaultHidden,name:a,description:i}=r===void 0?{}:r;if(Ee()._disableExpensiveErrorDiagnostics)return'Unable to find role="'+t+'"'+Xb(a);let o="";Array.from(e.children).forEach(d=>{o+=qS(d,{hidden:n,includeDescription:i!==void 0})});let s;o.length===0?n===!1?s="There are no accessible roles. But there might be some inaccessible roles. If you wish to access them, then set the `hidden` option to `true`. Learn more about this here: https://testing-library.com/docs/dom-testing-library/api-queries#byrole":s="There are no available roles.":s=(`
74
+ Here are the `+(n===!1?"accessible":"available")+` roles:
75
+
76
+ `+o.replace(/\n/g,`
77
+ `).replace(/\n\s\s\n/g,`
78
+
79
+ `)+`
80
+ `).trim();let l="";a===void 0?l="":typeof a=="string"?l=' and name "'+a+'"':l=" and name `"+a+"`";let u="";return i===void 0?u="":typeof i=="string"?u=' and description "'+i+'"':u=" and description `"+i+"`",(`
81
+ Unable to find an `+(n===!1?"accessible ":"")+'element with the role "'+t+'"'+l+u+`
82
+
83
+ `+s).trim()},J_=nt(Dl,Dl.name,"queryAll"),[X_,Y_,Q_,Z_,eP]=br(Dl,G_,K_),Lu=()=>Ee().testIdAttribute,Ll=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return Dt(t[0]),ps(Lu(),...t)},tP=(e,t)=>"Found multiple elements by: ["+Lu()+'="'+t+'"]',rP=(e,t)=>"Unable to find an element by: ["+Lu()+'="'+t+'"]',nP=nt(Ll,Ll.name,"queryAll"),[aP,oP,iP,sP,lP]=br(Ll,tP,rP);var Fl=Object.freeze({__proto__:null,queryAllByLabelText:n_,queryByLabelText:QS,getAllByLabelText:t_,getByLabelText:r_,findAllByLabelText:ZS,findByLabelText:e_,queryByPlaceholderText:s_,queryAllByPlaceholderText:i_,getByPlaceholderText:u_,getAllByPlaceholderText:l_,findAllByPlaceholderText:c_,findByPlaceholderText:d_,queryByText:h_,queryAllByText:m_,getByText:b_,getAllByText:g_,findAllByText:y_,findByText:v_,queryByDisplayValue:C_,queryAllByDisplayValue:R_,getByDisplayValue:T_,getAllByDisplayValue:E_,findAllByDisplayValue:S_,findByDisplayValue:__,queryByAltText:q_,queryAllByAltText:A_,getByAltText:O_,getAllByAltText:I_,findAllByAltText:N_,findByAltText:$_,queryByTitle:B_,queryAllByTitle:F_,getByTitle:U_,getAllByTitle:z_,findAllByTitle:W_,findByTitle:V_,queryByRole:X_,queryAllByRole:J_,getAllByRole:Y_,getByRole:Q_,findAllByRole:Z_,findByRole:eP,queryByTestId:aP,queryAllByTestId:nP,getByTestId:iP,getAllByTestId:oP,findAllByTestId:sP,findByTestId:lP});function Yb(e,t,r){return t===void 0&&(t=Fl),r===void 0&&(r={}),Object.keys(t).reduce((n,a)=>{const i=t[a];return n[a]=i.bind(null,e),n},r)}const xm={copy:{EventType:"ClipboardEvent",defaultInit:{bubbles:!0,cancelable:!0,composed:!0}},cut:{EventType:"ClipboardEvent",defaultInit:{bubbles:!0,cancelable:!0,composed:!0}},paste:{EventType:"ClipboardEvent",defaultInit:{bubbles:!0,cancelable:!0,composed:!0}},compositionEnd:{EventType:"CompositionEvent",defaultInit:{bubbles:!0,cancelable:!0,composed:!0}},compositionStart:{EventType:"CompositionEvent",defaultInit:{bubbles:!0,cancelable:!0,composed:!0}},compositionUpdate:{EventType:"CompositionEvent",defaultInit:{bubbles:!0,cancelable:!0,composed:!0}},keyDown:{EventType:"KeyboardEvent",defaultInit:{bubbles:!0,cancelable:!0,charCode:0,composed:!0}},keyPress:{EventType:"KeyboardEvent",defaultInit:{bubbles:!0,cancelable:!0,charCode:0,composed:!0}},keyUp:{EventType:"KeyboardEvent",defaultInit:{bubbles:!0,cancelable:!0,charCode:0,composed:!0}},focus:{EventType:"FocusEvent",defaultInit:{bubbles:!1,cancelable:!1,composed:!0}},blur:{EventType:"FocusEvent",defaultInit:{bubbles:!1,cancelable:!1,composed:!0}},focusIn:{EventType:"FocusEvent",defaultInit:{bubbles:!0,cancelable:!1,composed:!0}},focusOut:{EventType:"FocusEvent",defaultInit:{bubbles:!0,cancelable:!1,composed:!0}},change:{EventType:"Event",defaultInit:{bubbles:!0,cancelable:!1}},input:{EventType:"InputEvent",defaultInit:{bubbles:!0,cancelable:!1,composed:!0}},invalid:{EventType:"Event",defaultInit:{bubbles:!1,cancelable:!0}},submit:{EventType:"Event",defaultInit:{bubbles:!0,cancelable:!0}},reset:{EventType:"Event",defaultInit:{bubbles:!0,cancelable:!0}},click:{EventType:"MouseEvent",defaultInit:{bubbles:!0,cancelable:!0,button:0,composed:!0}},contextMenu:{EventType:"MouseEvent",defaultInit:{bubbles:!0,cancelable:!0,composed:!0}},dblClick:{EventType:"MouseEvent",defaultInit:{bubbles:!0,cancelable:!0,composed:!0}},drag:{EventType:"DragEvent",defaultInit:{bubbles:!0,cancelable:!0,composed:!0}},dragEnd:{EventType:"DragEvent",defaultInit:{bubbles:!0,cancelable:!1,composed:!0}},dragEnter:{EventType:"DragEvent",defaultInit:{bubbles:!0,cancelable:!0,composed:!0}},dragExit:{EventType:"DragEvent",defaultInit:{bubbles:!0,cancelable:!1,composed:!0}},dragLeave:{EventType:"DragEvent",defaultInit:{bubbles:!0,cancelable:!1,composed:!0}},dragOver:{EventType:"DragEvent",defaultInit:{bubbles:!0,cancelable:!0,composed:!0}},dragStart:{EventType:"DragEvent",defaultInit:{bubbles:!0,cancelable:!0,composed:!0}},drop:{EventType:"DragEvent",defaultInit:{bubbles:!0,cancelable:!0,composed:!0}},mouseDown:{EventType:"MouseEvent",defaultInit:{bubbles:!0,cancelable:!0,composed:!0}},mouseEnter:{EventType:"MouseEvent",defaultInit:{bubbles:!1,cancelable:!1,composed:!0}},mouseLeave:{EventType:"MouseEvent",defaultInit:{bubbles:!1,cancelable:!1,composed:!0}},mouseMove:{EventType:"MouseEvent",defaultInit:{bubbles:!0,cancelable:!0,composed:!0}},mouseOut:{EventType:"MouseEvent",defaultInit:{bubbles:!0,cancelable:!0,composed:!0}},mouseOver:{EventType:"MouseEvent",defaultInit:{bubbles:!0,cancelable:!0,composed:!0}},mouseUp:{EventType:"MouseEvent",defaultInit:{bubbles:!0,cancelable:!0,composed:!0}},select:{EventType:"Event",defaultInit:{bubbles:!0,cancelable:!1}},touchCancel:{EventType:"TouchEvent",defaultInit:{bubbles:!0,cancelable:!1,composed:!0}},touchEnd:{EventType:"TouchEvent",defaultInit:{bubbles:!0,cancelable:!0,composed:!0}},touchMove:{EventType:"TouchEvent",defaultInit:{bubbles:!0,cancelable:!0,composed:!0}},touchStart:{EventType:"TouchEvent",defaultInit:{bubbles:!0,cancelable:!0,composed:!0}},resize:{EventType:"UIEvent",defaultInit:{bubbles:!1,cancelable:!1}},scroll:{EventType:"UIEvent",defaultInit:{bubbles:!1,cancelable:!1}},wheel:{EventType:"WheelEvent",defaultInit:{bubbles:!0,cancelable:!0,composed:!0}},abort:{EventType:"Event",defaultInit:{bubbles:!1,cancelable:!1}},canPlay:{EventType:"Event",defaultInit:{bubbles:!1,cancelable:!1}},canPlayThrough:{EventType:"Event",defaultInit:{bubbles:!1,cancelable:!1}},durationChange:{EventType:"Event",defaultInit:{bubbles:!1,cancelable:!1}},emptied:{EventType:"Event",defaultInit:{bubbles:!1,cancelable:!1}},encrypted:{EventType:"Event",defaultInit:{bubbles:!1,cancelable:!1}},ended:{EventType:"Event",defaultInit:{bubbles:!1,cancelable:!1}},loadedData:{EventType:"Event",defaultInit:{bubbles:!1,cancelable:!1}},loadedMetadata:{EventType:"Event",defaultInit:{bubbles:!1,cancelable:!1}},loadStart:{EventType:"ProgressEvent",defaultInit:{bubbles:!1,cancelable:!1}},pause:{EventType:"Event",defaultInit:{bubbles:!1,cancelable:!1}},play:{EventType:"Event",defaultInit:{bubbles:!1,cancelable:!1}},playing:{EventType:"Event",defaultInit:{bubbles:!1,cancelable:!1}},progress:{EventType:"ProgressEvent",defaultInit:{bubbles:!1,cancelable:!1}},rateChange:{EventType:"Event",defaultInit:{bubbles:!1,cancelable:!1}},seeked:{EventType:"Event",defaultInit:{bubbles:!1,cancelable:!1}},seeking:{EventType:"Event",defaultInit:{bubbles:!1,cancelable:!1}},stalled:{EventType:"Event",defaultInit:{bubbles:!1,cancelable:!1}},suspend:{EventType:"Event",defaultInit:{bubbles:!1,cancelable:!1}},timeUpdate:{EventType:"Event",defaultInit:{bubbles:!1,cancelable:!1}},volumeChange:{EventType:"Event",defaultInit:{bubbles:!1,cancelable:!1}},waiting:{EventType:"Event",defaultInit:{bubbles:!1,cancelable:!1}},load:{EventType:"Event",defaultInit:{bubbles:!1,cancelable:!1}},error:{EventType:"Event",defaultInit:{bubbles:!1,cancelable:!1}},animationStart:{EventType:"AnimationEvent",defaultInit:{bubbles:!0,cancelable:!1}},animationEnd:{EventType:"AnimationEvent",defaultInit:{bubbles:!0,cancelable:!1}},animationIteration:{EventType:"AnimationEvent",defaultInit:{bubbles:!0,cancelable:!1}},transitionCancel:{EventType:"TransitionEvent",defaultInit:{bubbles:!0,cancelable:!1}},transitionEnd:{EventType:"TransitionEvent",defaultInit:{bubbles:!0,cancelable:!0}},transitionRun:{EventType:"TransitionEvent",defaultInit:{bubbles:!0,cancelable:!1}},transitionStart:{EventType:"TransitionEvent",defaultInit:{bubbles:!0,cancelable:!1}},pointerOver:{EventType:"PointerEvent",defaultInit:{bubbles:!0,cancelable:!0,composed:!0}},pointerEnter:{EventType:"PointerEvent",defaultInit:{bubbles:!1,cancelable:!1}},pointerDown:{EventType:"PointerEvent",defaultInit:{bubbles:!0,cancelable:!0,composed:!0}},pointerMove:{EventType:"PointerEvent",defaultInit:{bubbles:!0,cancelable:!0,composed:!0}},pointerUp:{EventType:"PointerEvent",defaultInit:{bubbles:!0,cancelable:!0,composed:!0}},pointerCancel:{EventType:"PointerEvent",defaultInit:{bubbles:!0,cancelable:!1,composed:!0}},pointerOut:{EventType:"PointerEvent",defaultInit:{bubbles:!0,cancelable:!0,composed:!0}},pointerLeave:{EventType:"PointerEvent",defaultInit:{bubbles:!1,cancelable:!1}},gotPointerCapture:{EventType:"PointerEvent",defaultInit:{bubbles:!0,cancelable:!1,composed:!0}},lostPointerCapture:{EventType:"PointerEvent",defaultInit:{bubbles:!0,cancelable:!1,composed:!0}},popState:{EventType:"PopStateEvent",defaultInit:{bubbles:!0,cancelable:!1}},offline:{EventType:"Event",defaultInit:{bubbles:!1,cancelable:!1}},online:{EventType:"Event",defaultInit:{bubbles:!1,cancelable:!1}},pageHide:{EventType:"PageTransitionEvent",defaultInit:{bubbles:!0,cancelable:!0}},pageShow:{EventType:"PageTransitionEvent",defaultInit:{bubbles:!0,cancelable:!0}}},Rm={doubleClick:"dblClick"};function ri(e,t){return Ee().eventWrapper(()=>{if(!t)throw new Error("Unable to fire an event - please provide an event object.");if(!e)throw new Error('Unable to fire a "'+t.type+'" event - please provide a DOM element.');return e.dispatchEvent(t)})}function Bs(e,t,r,n){let{EventType:a="Event",defaultInit:i={}}=n===void 0?{}:n;if(!t)throw new Error('Unable to fire a "'+e+'" event - please provide a DOM element.');const o={...i,...r},{target:{value:s,files:l,...u}={}}=o;s!==void 0&&uP(t,s),l!==void 0&&Object.defineProperty(t,"files",{configurable:!0,enumerable:!0,writable:!0,value:l}),Object.assign(t,u);const d=Db(t),c=d[a]||d.Event;let f;if(typeof c=="function")f=new c(e,o);else{f=d.document.createEvent(a);const{bubbles:m,cancelable:g,detail:b,...h}=o;f.initEvent(e,m,g,b),Object.keys(h).forEach(w=>{f[w]=h[w]})}return["dataTransfer","clipboardData"].forEach(m=>{const g=o[m];typeof g=="object"&&(typeof d.DataTransfer=="function"?Object.defineProperty(f,m,{value:Object.getOwnPropertyNames(g).reduce((b,h)=>(Object.defineProperty(b,h,{value:g[h]}),b),new d.DataTransfer)}):Object.defineProperty(f,m,{value:g}))}),f}Object.keys(xm).forEach(e=>{const{EventType:t,defaultInit:r}=xm[e],n=e.toLowerCase();Bs[e]=(a,i)=>Bs(n,a,i,{EventType:t,defaultInit:r}),ri[e]=(a,i)=>ri(a,Bs[e](a,i))});function uP(e,t){const{set:r}=Object.getOwnPropertyDescriptor(e,"value")||{},n=Object.getPrototypeOf(e),{set:a}=Object.getOwnPropertyDescriptor(n,"value")||{};if(a&&r!==a)a.call(e,t);else if(r)r.call(e,t);else throw new Error("The given element does not have a value setter")}Object.keys(Rm).forEach(e=>{const t=Rm[e];ri[e]=function(){return ri[t](...arguments)}});function cP(e){return e.replace(/[ \t]*[\n][ \t]*/g,`
84
+ `)}function dP(e){return oS.compressToEncodedURIComponent(cP(e))}function fP(e){return"https://testing-playground.com/#markup="+dP(e)}const pP=(e,t,r)=>Array.isArray(e)?e.forEach(n=>ym(n,t,r)):ym(e,t,r),mP=function(e){if(e===void 0&&(e=$u().body),!e||!("innerHTML"in e)){console.log("The element you're providing isn't a valid DOM element.");return}if(!e.innerHTML){console.log("The provided element doesn't have any children.");return}const t=fP(e.innerHTML);return console.log(`Open this URL in your browser
85
+
86
+ `+t),t},Cm={debug:pP,logTestingPlaygroundURL:mP};typeof document<"u"&&document.body?Yb(document.body,Fl,Cm):Object.keys(Fl).reduce((e,t)=>(e[t]=()=>{throw new TypeError("For queries bound to document.body a global document has to be available... Learn more: https://testing-library.com/s/screen-global-error")},e),Cm);const hP=typeof Xo.act=="function"?Xo.act:cw.act;function Qb(){if(typeof globalThis<"u")return globalThis;if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw new Error("unable to locate global object")}function It(e){Qb().IS_REACT_ACT_ENVIRONMENT=e}function Hi(){return Qb().IS_REACT_ACT_ENVIRONMENT}function gP(e){return t=>{const r=Hi();It(!0);try{let n=!1;const a=e(()=>{const i=t();return i!==null&&typeof i=="object"&&typeof i.then=="function"&&(n=!0),i});if(n){const i=a;return{then:(o,s)=>{i.then(l=>{It(r),o(l)},l=>{It(r),s(l)})}}}else return It(r),a}catch(n){throw It(r),n}}}const Or=gP(hP);Object.keys(ri).forEach(e=>{});let bP={reactStrictMode:!1};function yP(){return{...Ee(),...bP}}function vP(){return typeof jest<"u"&&jest!==null?setTimeout._isMockFunction===!0||Object.prototype.hasOwnProperty.call(setTimeout,"clock"):!1}SS({unstable_advanceTimersWrapper:e=>Or(e),asyncWrapper:async e=>{const t=Hi();It(!1);try{const r=await e();return await new Promise(n=>{setTimeout(()=>{n()},0),vP()&&jest.advanceTimersByTime(0)}),r}finally{It(t)}},eventWrapper:e=>{let t;return Or(()=>{t=e()}),t}});const Bl=new Set,Gi=[];function zl(e,t){return t??yP().reactStrictMode?Xo.createElement(Xo.StrictMode,null,e):e}function Ul(e,t){return t?Xo.createElement(t,null,e):e}function wP(e,t){let{hydrate:r,onCaughtError:n,onRecoverableError:a,ui:i,wrapper:o,reactStrictMode:s}=t,l;return r?Or(()=>{l=Uc.hydrateRoot(e,zl(Ul(i,o),s),{onCaughtError:n,onRecoverableError:a})}):l=Uc.createRoot(e,{onCaughtError:n,onRecoverableError:a}),{hydrate(){if(!r)throw new Error("Attempted to hydrate a non-hydrateable root. This is a bug in `@testing-library/react`.")},render(u){l.render(u)},unmount(){l.unmount()}}}function xP(e){return{hydrate(t){ir.hydrate(t,e)},render(t){ir.render(t,e)},unmount(){ir.unmountComponentAtNode(e)}}}function Zb(e,t){let{baseElement:r,container:n,hydrate:a,queries:i,root:o,wrapper:s,reactStrictMode:l}=t;return Or(()=>{a?o.hydrate(zl(Ul(e,s),l),n):o.render(zl(Ul(e,s),l),n)}),{container:n,baseElement:r,debug:function(u,d,c){return u===void 0&&(u=r),Array.isArray(u)?u.forEach(f=>console.log(Ir(f,d,c))):console.log(Ir(u,d,c))},unmount:()=>{Or(()=>{o.unmount()})},rerender:u=>{Zb(u,{container:n,baseElement:r,root:o,wrapper:s,reactStrictMode:l})},asFragment:()=>{if(typeof document.createRange=="function")return document.createRange().createContextualFragment(n.innerHTML);{const u=document.createElement("template");return u.innerHTML=n.innerHTML,u.content}},...Yb(r,i)}}function Wl(e,t){let{container:r,baseElement:n=r,legacyRoot:a=!1,onCaughtError:i,onUncaughtError:o,onRecoverableError:s,queries:l,hydrate:u=!1,wrapper:d,reactStrictMode:c}=t===void 0?{}:t;if(o!==void 0)throw new Error("onUncaughtError is not supported. The `render` call will already throw on uncaught errors.");if(a&&typeof ir.render!="function"){const p=new Error("`legacyRoot: true` is not supported in this version of React. If your app runs React 19 or later, you should remove this flag. If your app runs React 18 or earlier, visit https://react.dev/blog/2022/03/08/react-18-upgrade-guide for upgrade instructions.");throw Error.captureStackTrace(p,Wl),p}n||(n=document.body),r||(r=n.appendChild(document.createElement("div")));let f;return Bl.has(r)?Gi.forEach(p=>{p.container===r&&(f=p.root)}):(f=(a?xP:wP)(r,{hydrate:u,onCaughtError:i,onRecoverableError:s,ui:e,wrapper:d,reactStrictMode:c}),Gi.push({container:r,root:f}),Bl.add(r)),Zb(e,{container:r,baseElement:n,queries:l,hydrate:u,wrapper:d,root:f,reactStrictMode:c})}function Em(){Gi.forEach(e=>{let{root:t,container:r}=e;Or(()=>{t.unmount()}),r.parentNode===document.body&&document.body.removeChild(r)}),Gi.length=0,Bl.clear()}if((typeof process>"u"||!process.env?.RTL_SKIP_AUTO_CLEANUP)&&(typeof afterEach=="function"?afterEach(()=>{Em()}):typeof teardown=="function"&&teardown(()=>{Em()}),typeof beforeAll=="function"&&typeof afterAll=="function")){let e=Hi();beforeAll(()=>{e=Hi(),It(!0)}),afterAll(()=>{It(e)})}function RP(e,{withChatProvider:t=!0,...r}={}){function n({children:a}){return t?_.jsx(_u,{children:a}):_.jsx(_.Fragment,{children:a})}return{...Wl(e,{wrapper:n,...r}),rerender:a=>Wl(a,{wrapper:n,...r})}}function CP(e={}){const{withChatProvider:t=!0}=e;return function({children:n}){return t?_.jsx(_u,{children:n}):_.jsx(_.Fragment,{children:n})}}function EP(e=0){return new Promise(t=>setTimeout(t,e))}function TP(){let e,t;return{promise:new Promise((n,a)=>{e=n,t=a}),resolve:e,reject:t}}var SP={reset:[0,0],bold:[1,22,"\x1B[22m\x1B[1m"],dim:[2,22,"\x1B[22m\x1B[2m"],italic:[3,23],underline:[4,24],inverse:[7,27],hidden:[8,28],strikethrough:[9,29],black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],gray:[90,39],bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],blackBright:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39],bgBlackBright:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]},_P=Object.entries(SP);function Fu(e){return String(e)}Fu.open="";Fu.close="";function PP(e=!1){let t=typeof process<"u"?process:void 0,r=t?.env||{},n=t?.argv||[];return!("NO_COLOR"in r||n.includes("--no-color"))&&("FORCE_COLOR"in r||n.includes("--color")||t?.platform==="win32"||e&&r.TERM!=="dumb"||"CI"in r)||typeof window<"u"&&!!window.chrome}function kP(e=!1){let t=PP(e),r=(o,s,l,u)=>{let d="",c=0;do d+=o.substring(c,u)+l,c=u+s.length,u=o.indexOf(s,c);while(~u);return d+o.substring(c)},n=(o,s,l=o)=>{let u=d=>{let c=String(d),f=c.indexOf(s,o.length);return~f?o+r(c,s,l,f)+s:o+c+s};return u.open=o,u.close=s,u},a={isColorSupported:t},i=o=>`\x1B[${o}m`;for(let[o,s]of _P)a[o]=t?n(i(s[0]),i(s[1]),s[2]):Fu;return a}var Ie=kP(!1);function MP(e,t){const r=Object.keys(e),n=t===null?r:r.sort(t);if(Object.getOwnPropertySymbols)for(const a of Object.getOwnPropertySymbols(e))Object.getOwnPropertyDescriptor(e,a).enumerable&&n.push(a);return n}function ms(e,t,r,n,a,i,o=": "){let s="",l=0,u=e.next();if(!u.done){s+=t.spacingOuter;const d=r+t.indent;for(;!u.done;){if(s+=d,l++===t.maxWidth){s+="…";break}const c=i(u.value[0],t,d,n,a),f=i(u.value[1],t,d,n,a);s+=c+o+f,u=e.next(),u.done?t.min||(s+=","):s+=`,${t.spacingInner}`}s+=t.spacingOuter+r}return s}function Bu(e,t,r,n,a,i){let o="",s=0,l=e.next();if(!l.done){o+=t.spacingOuter;const u=r+t.indent;for(;!l.done;){if(o+=u,s++===t.maxWidth){o+="…";break}o+=i(l.value,t,u,n,a),l=e.next(),l.done?t.min||(o+=","):o+=`,${t.spacingInner}`}o+=t.spacingOuter+r}return o}function Ki(e,t,r,n,a,i){let o="";e=e instanceof ArrayBuffer?new DataView(e):e;const s=u=>u instanceof DataView,l=s(e)?e.byteLength:e.length;if(l>0){o+=t.spacingOuter;const u=r+t.indent;for(let d=0;d<l;d++){if(o+=u,d===t.maxWidth){o+="…";break}(s(e)||d in e)&&(o+=i(s(e)?e.getInt8(d):e[d],t,u,n,a)),d<l-1?o+=`,${t.spacingInner}`:t.min||(o+=",")}o+=t.spacingOuter+r}return o}function zu(e,t,r,n,a,i){let o="";const s=MP(e,t.compareKeys);if(s.length>0){o+=t.spacingOuter;const l=r+t.indent;for(let u=0;u<s.length;u++){const d=s[u],c=i(d,t,l,n,a),f=i(e[d],t,l,n,a);o+=`${l+c}: ${f}`,u<s.length-1?o+=`,${t.spacingInner}`:t.min||(o+=",")}o+=t.spacingOuter+r}return o}const AP=typeof Symbol=="function"&&Symbol.for?Symbol.for("jest.asymmetricMatcher"):1267621,Ci=" ",qP=(e,t,r,n,a,i)=>{const o=e.toString();if(o==="ArrayContaining"||o==="ArrayNotContaining")return++n>t.maxDepth?`[${o}]`:`${o+Ci}[${Ki(e.sample,t,r,n,a,i)}]`;if(o==="ObjectContaining"||o==="ObjectNotContaining")return++n>t.maxDepth?`[${o}]`:`${o+Ci}{${zu(e.sample,t,r,n,a,i)}}`;if(o==="StringMatching"||o==="StringNotMatching"||o==="StringContaining"||o==="StringNotContaining")return o+Ci+i(e.sample,t,r,n,a);if(typeof e.toAsymmetricMatcher!="function")throw new TypeError(`Asymmetric matcher ${e.constructor.name} does not implement toAsymmetricMatcher()`);return e.toAsymmetricMatcher()},IP=e=>e&&e.$$typeof===AP,OP={serialize:qP,test:IP},NP=" ",ey=new Set(["DOMStringMap","NamedNodeMap"]),$P=/^(?:HTML\w*Collection|NodeList)$/;function jP(e){return ey.has(e)||$P.test(e)}const DP=e=>e&&e.constructor&&!!e.constructor.name&&jP(e.constructor.name);function LP(e){return e.constructor.name==="NamedNodeMap"}const FP=(e,t,r,n,a,i)=>{const o=e.constructor.name;return++n>t.maxDepth?`[${o}]`:(t.min?"":o+NP)+(ey.has(o)?`{${zu(LP(e)?[...e].reduce((s,l)=>(s[l.name]=l.value,s),{}):{...e},t,r,n,a,i)}}`:`[${Ki([...e],t,r,n,a,i)}]`)},BP={serialize:FP,test:DP};function ty(e){return e.replaceAll("<","&lt;").replaceAll(">","&gt;")}function Uu(e,t,r,n,a,i,o){const s=n+r.indent,l=r.colors;return e.map(u=>{const d=t[u];let c=o(d,r,s,a,i);return typeof d!="string"&&(c.includes(`
87
+ `)&&(c=r.spacingOuter+s+c+r.spacingOuter+n),c=`{${c}}`),`${r.spacingInner+n+l.prop.open+u+l.prop.close}=${l.value.open}${c}${l.value.close}`}).join("")}function Wu(e,t,r,n,a,i){return e.map(o=>t.spacingOuter+r+(typeof o=="string"?ry(o,t):i(o,t,r,n,a))).join("")}function ry(e,t){const r=t.colors.content;return r.open+ty(e)+r.close}function zP(e,t){const r=t.colors.comment;return`${r.open}<!--${ty(e)}-->${r.close}`}function Vu(e,t,r,n,a){const i=n.colors.tag;return`${i.open}<${e}${t&&i.close+t+n.spacingOuter+a+i.open}${r?`>${i.close}${r}${n.spacingOuter}${a}${i.open}</${e}`:`${t&&!n.min?"":" "}/`}>${i.close}`}function Hu(e,t){const r=t.colors.tag;return`${r.open}<${e}${r.close} …${r.open} />${r.close}`}const UP=1,ny=3,ay=8,oy=11,WP=/^(?:(?:HTML|SVG)\w*)?Element$/;function VP(e){try{return typeof e.hasAttribute=="function"&&e.hasAttribute("is")}catch{return!1}}function HP(e){const t=e.constructor.name,{nodeType:r,tagName:n}=e,a=typeof n=="string"&&n.includes("-")||VP(e);return r===UP&&(WP.test(t)||a)||r===ny&&t==="Text"||r===ay&&t==="Comment"||r===oy&&t==="DocumentFragment"}const GP=e=>{var t;return((t=e?.constructor)==null?void 0:t.name)&&HP(e)};function KP(e){return e.nodeType===ny}function JP(e){return e.nodeType===ay}function zs(e){return e.nodeType===oy}const XP=(e,t,r,n,a,i)=>{if(KP(e))return ry(e.data,t);if(JP(e))return zP(e.data,t);const o=zs(e)?"DocumentFragment":e.tagName.toLowerCase();return++n>t.maxDepth?Hu(o,t):Vu(o,Uu(zs(e)?[]:Array.from(e.attributes,s=>s.name).sort(),zs(e)?{}:[...e.attributes].reduce((s,l)=>(s[l.name]=l.value,s),{}),t,r+t.indent,n,a,i),Wu(Array.prototype.slice.call(e.childNodes||e.children),t,r+t.indent,n,a,i),t,r)},YP={serialize:XP,test:GP},QP="@@__IMMUTABLE_ITERABLE__@@",ZP="@@__IMMUTABLE_LIST__@@",ek="@@__IMMUTABLE_KEYED__@@",tk="@@__IMMUTABLE_MAP__@@",Tm="@@__IMMUTABLE_ORDERED__@@",rk="@@__IMMUTABLE_RECORD__@@",nk="@@__IMMUTABLE_SEQ__@@",ak="@@__IMMUTABLE_SET__@@",ok="@@__IMMUTABLE_STACK__@@",Nr=e=>`Immutable.${e}`,hs=e=>`[${e}]`,ni=" ",Sm="…";function ik(e,t,r,n,a,i,o){return++n>t.maxDepth?hs(Nr(o)):`${Nr(o)+ni}{${ms(e.entries(),t,r,n,a,i)}}`}function sk(e){let t=0;return{next(){if(t<e._keys.length){const r=e._keys[t++];return{done:!1,value:[r,e.get(r)]}}return{done:!0,value:void 0}}}}function lk(e,t,r,n,a,i){const o=Nr(e._name||"Record");return++n>t.maxDepth?hs(o):`${o+ni}{${ms(sk(e),t,r,n,a,i)}}`}function uk(e,t,r,n,a,i){const o=Nr("Seq");return++n>t.maxDepth?hs(o):e[ek]?`${o+ni}{${e._iter||e._object?ms(e.entries(),t,r,n,a,i):Sm}}`:`${o+ni}[${e._iter||e._array||e._collection||e._iterable?Bu(e.values(),t,r,n,a,i):Sm}]`}function Us(e,t,r,n,a,i,o){return++n>t.maxDepth?hs(Nr(o)):`${Nr(o)+ni}[${Bu(e.values(),t,r,n,a,i)}]`}const ck=(e,t,r,n,a,i)=>e[tk]?ik(e,t,r,n,a,i,e[Tm]?"OrderedMap":"Map"):e[ZP]?Us(e,t,r,n,a,i,"List"):e[ak]?Us(e,t,r,n,a,i,e[Tm]?"OrderedSet":"Set"):e[ok]?Us(e,t,r,n,a,i,"Stack"):e[nk]?uk(e,t,r,n,a,i):lk(e,t,r,n,a,i),dk=e=>e&&(e[QP]===!0||e[rk]===!0),fk={serialize:ck,test:dk};var Ei={exports:{}},ve={};var _m;function pk(){if(_m)return ve;_m=1;var e=Symbol.for("react.element"),t=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),n=Symbol.for("react.strict_mode"),a=Symbol.for("react.profiler"),i=Symbol.for("react.provider"),o=Symbol.for("react.context"),s=Symbol.for("react.server_context"),l=Symbol.for("react.forward_ref"),u=Symbol.for("react.suspense"),d=Symbol.for("react.suspense_list"),c=Symbol.for("react.memo"),f=Symbol.for("react.lazy"),p=Symbol.for("react.offscreen"),m;m=Symbol.for("react.module.reference");function g(b){if(typeof b=="object"&&b!==null){var h=b.$$typeof;switch(h){case e:switch(b=b.type,b){case r:case a:case n:case u:case d:return b;default:switch(b=b&&b.$$typeof,b){case s:case o:case l:case f:case c:case i:return b;default:return h}}case t:return h}}}return ve.ContextConsumer=o,ve.ContextProvider=i,ve.Element=e,ve.ForwardRef=l,ve.Fragment=r,ve.Lazy=f,ve.Memo=c,ve.Portal=t,ve.Profiler=a,ve.StrictMode=n,ve.Suspense=u,ve.SuspenseList=d,ve.isAsyncMode=function(){return!1},ve.isConcurrentMode=function(){return!1},ve.isContextConsumer=function(b){return g(b)===o},ve.isContextProvider=function(b){return g(b)===i},ve.isElement=function(b){return typeof b=="object"&&b!==null&&b.$$typeof===e},ve.isForwardRef=function(b){return g(b)===l},ve.isFragment=function(b){return g(b)===r},ve.isLazy=function(b){return g(b)===f},ve.isMemo=function(b){return g(b)===c},ve.isPortal=function(b){return g(b)===t},ve.isProfiler=function(b){return g(b)===a},ve.isStrictMode=function(b){return g(b)===n},ve.isSuspense=function(b){return g(b)===u},ve.isSuspenseList=function(b){return g(b)===d},ve.isValidElementType=function(b){return typeof b=="string"||typeof b=="function"||b===r||b===a||b===n||b===u||b===d||b===p||typeof b=="object"&&b!==null&&(b.$$typeof===f||b.$$typeof===c||b.$$typeof===i||b.$$typeof===o||b.$$typeof===l||b.$$typeof===m||b.getModuleId!==void 0)},ve.typeOf=g,ve}var we={};var Pm;function mk(){return Pm||(Pm=1,process.env.NODE_ENV!=="production"&&(function(){var e=Symbol.for("react.element"),t=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),n=Symbol.for("react.strict_mode"),a=Symbol.for("react.profiler"),i=Symbol.for("react.provider"),o=Symbol.for("react.context"),s=Symbol.for("react.server_context"),l=Symbol.for("react.forward_ref"),u=Symbol.for("react.suspense"),d=Symbol.for("react.suspense_list"),c=Symbol.for("react.memo"),f=Symbol.for("react.lazy"),p=Symbol.for("react.offscreen"),m=!1,g=!1,b=!1,h=!1,w=!1,x;x=Symbol.for("react.module.reference");function T(X){return!!(typeof X=="string"||typeof X=="function"||X===r||X===a||w||X===n||X===u||X===d||h||X===p||m||g||b||typeof X=="object"&&X!==null&&(X.$$typeof===f||X.$$typeof===c||X.$$typeof===i||X.$$typeof===o||X.$$typeof===l||X.$$typeof===x||X.getModuleId!==void 0))}function E(X){if(typeof X=="object"&&X!==null){var _e=X.$$typeof;switch(_e){case e:var xe=X.type;switch(xe){case r:case a:case n:case u:case d:return xe;default:var Oe=xe&&xe.$$typeof;switch(Oe){case s:case o:case l:case f:case c:case i:return Oe;default:return _e}}case t:return _e}}}var y=o,v=i,R=e,k=l,P=r,M=f,F=c,j=t,D=a,J=n,B=u,Y=d,L=!1,Z=!1;function ae(X){return L||(L=!0,console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 18+.")),!1}function ne(X){return Z||(Z=!0,console.warn("The ReactIs.isConcurrentMode() alias has been deprecated, and will be removed in React 18+.")),!1}function fe(X){return E(X)===o}function H(X){return E(X)===i}function me(X){return typeof X=="object"&&X!==null&&X.$$typeof===e}function ce(X){return E(X)===l}function se(X){return E(X)===r}function Se(X){return E(X)===f}function Me(X){return E(X)===c}function q(X){return E(X)===t}function Q(X){return E(X)===a}function W(X){return E(X)===n}function le(X){return E(X)===u}function de(X){return E(X)===d}we.ContextConsumer=y,we.ContextProvider=v,we.Element=R,we.ForwardRef=k,we.Fragment=P,we.Lazy=M,we.Memo=F,we.Portal=j,we.Profiler=D,we.StrictMode=J,we.Suspense=B,we.SuspenseList=Y,we.isAsyncMode=ae,we.isConcurrentMode=ne,we.isContextConsumer=fe,we.isContextProvider=H,we.isElement=me,we.isForwardRef=ce,we.isFragment=se,we.isLazy=Se,we.isMemo=Me,we.isPortal=q,we.isProfiler=Q,we.isStrictMode=W,we.isSuspense=le,we.isSuspenseList=de,we.isValidElementType=T,we.typeOf=E})()),we}var km;function hk(){return km||(km=1,process.env.NODE_ENV==="production"?Ei.exports=pk():Ei.exports=mk()),Ei.exports}var ar=hk();function iy(e,t=[]){if(Array.isArray(e))for(const r of e)iy(r,t);else e!=null&&e!==!1&&e!==""&&t.push(e);return t}function Mm(e){const t=e.type;if(typeof t=="string")return t;if(typeof t=="function")return t.displayName||t.name||"Unknown";if(ar.isFragment(e))return"React.Fragment";if(ar.isSuspense(e))return"React.Suspense";if(typeof t=="object"&&t!==null){if(ar.isContextProvider(e))return"Context.Provider";if(ar.isContextConsumer(e))return"Context.Consumer";if(ar.isForwardRef(e)){if(t.displayName)return t.displayName;const r=t.render.displayName||t.render.name||"";return r===""?"ForwardRef":`ForwardRef(${r})`}if(ar.isMemo(e)){const r=t.displayName||t.type.displayName||t.type.name||"";return r===""?"Memo":`Memo(${r})`}}return"UNDEFINED"}function gk(e){const{props:t}=e;return Object.keys(t).filter(r=>r!=="children"&&t[r]!==void 0).sort()}const bk=(e,t,r,n,a,i)=>++n>t.maxDepth?Hu(Mm(e),t):Vu(Mm(e),Uu(gk(e),e.props,t,r+t.indent,n,a,i),Wu(iy(e.props.children),t,r+t.indent,n,a,i),t,r),yk=e=>e!=null&&ar.isElement(e),vk={serialize:bk,test:yk},wk=typeof Symbol=="function"&&Symbol.for?Symbol.for("react.test.json"):245830487;function xk(e){const{props:t}=e;return t?Object.keys(t).filter(r=>t[r]!==void 0).sort():[]}const Rk=(e,t,r,n,a,i)=>++n>t.maxDepth?Hu(e.type,t):Vu(e.type,e.props?Uu(xk(e),e.props,t,r+t.indent,n,a,i):"",e.children?Wu(e.children,t,r+t.indent,n,a,i):"",t,r),Ck=e=>e&&e.$$typeof===wk,Ek={serialize:Rk,test:Ck},sy=Object.prototype.toString,Tk=Date.prototype.toISOString,Sk=Error.prototype.toString,Am=RegExp.prototype.toString;function Ws(e){return typeof e.constructor=="function"&&e.constructor.name||"Object"}function _k(e){return typeof window<"u"&&e===window}const Pk=/^Symbol\((.*)\)(.*)$/,kk=/\n/g;class ly extends Error{constructor(t,r){super(t),this.stack=r,this.name=this.constructor.name}}function Mk(e){return e==="[object Array]"||e==="[object ArrayBuffer]"||e==="[object DataView]"||e==="[object Float32Array]"||e==="[object Float64Array]"||e==="[object Int8Array]"||e==="[object Int16Array]"||e==="[object Int32Array]"||e==="[object Uint8Array]"||e==="[object Uint8ClampedArray]"||e==="[object Uint16Array]"||e==="[object Uint32Array]"}function Ak(e){return Object.is(e,-0)?"-0":String(e)}function qk(e){return`${e}n`}function qm(e,t){return t?`[Function ${e.name||"anonymous"}]`:"[Function]"}function Im(e){return String(e).replace(Pk,"Symbol($1)")}function Om(e){return`[${Sk.call(e)}]`}function uy(e,t,r,n){if(e===!0||e===!1)return`${e}`;if(e===void 0)return"undefined";if(e===null)return"null";const a=typeof e;if(a==="number")return Ak(e);if(a==="bigint")return qk(e);if(a==="string")return n?`"${e.replaceAll(/"|\\/g,"\\$&")}"`:`"${e}"`;if(a==="function")return qm(e,t);if(a==="symbol")return Im(e);const i=sy.call(e);return i==="[object WeakMap]"?"WeakMap {}":i==="[object WeakSet]"?"WeakSet {}":i==="[object Function]"||i==="[object GeneratorFunction]"?qm(e,t):i==="[object Symbol]"?Im(e):i==="[object Date]"?Number.isNaN(+e)?"Date { NaN }":Tk.call(e):i==="[object Error]"?Om(e):i==="[object RegExp]"?r?Am.call(e).replaceAll(/[$()*+.?[\\\]^{|}]/g,"\\$&"):Am.call(e):e instanceof Error?Om(e):null}function cy(e,t,r,n,a,i){if(a.includes(e))return"[Circular]";a=[...a],a.push(e);const o=++n>t.maxDepth,s=t.min;if(t.callToJSON&&!o&&e.toJSON&&typeof e.toJSON=="function"&&!i)return Vt(e.toJSON(),t,r,n,a,!0);const l=sy.call(e);return l==="[object Arguments]"?o?"[Arguments]":`${s?"":"Arguments "}[${Ki(e,t,r,n,a,Vt)}]`:Mk(l)?o?`[${e.constructor.name}]`:`${s||!t.printBasicPrototype&&e.constructor.name==="Array"?"":`${e.constructor.name} `}[${Ki(e,t,r,n,a,Vt)}]`:l==="[object Map]"?o?"[Map]":`Map {${ms(e.entries(),t,r,n,a,Vt," => ")}}`:l==="[object Set]"?o?"[Set]":`Set {${Bu(e.values(),t,r,n,a,Vt)}}`:o||_k(e)?`[${Ws(e)}]`:`${s||!t.printBasicPrototype&&Ws(e)==="Object"?"":`${Ws(e)} `}{${zu(e,t,r,n,a,Vt)}}`}function Ik(e){return e.serialize!=null}function dy(e,t,r,n,a,i){let o;try{o=Ik(e)?e.serialize(t,r,n,a,i,Vt):e.print(t,s=>Vt(s,r,n,a,i),s=>{const l=n+r.indent;return l+s.replaceAll(kk,`
88
+ ${l}`)},{edgeSpacing:r.spacingOuter,min:r.min,spacing:r.spacingInner},r.colors)}catch(s){throw new ly(s.message,s.stack)}if(typeof o!="string")throw new TypeError(`pretty-format: Plugin must return type "string" but instead returned "${typeof o}".`);return o}function fy(e,t){for(const r of e)try{if(r.test(t))return r}catch(n){throw new ly(n.message,n.stack)}return null}function Vt(e,t,r,n,a,i){const o=fy(t.plugins,e);if(o!==null)return dy(o,e,t,r,n,a);const s=uy(e,t.printFunctionName,t.escapeRegex,t.escapeString);return s!==null?s:cy(e,t,r,n,a,i)}const Gu={comment:"gray",content:"reset",prop:"yellow",tag:"cyan",value:"green"},py=Object.keys(Gu),lt={callToJSON:!0,compareKeys:void 0,escapeRegex:!1,escapeString:!0,highlight:!1,indent:2,maxDepth:Number.POSITIVE_INFINITY,maxWidth:Number.POSITIVE_INFINITY,min:!1,plugins:[],printBasicPrototype:!0,printFunctionName:!0,theme:Gu};function Ok(e){for(const t of Object.keys(e))if(!Object.prototype.hasOwnProperty.call(lt,t))throw new Error(`pretty-format: Unknown option "${t}".`);if(e.min&&e.indent!==void 0&&e.indent!==0)throw new Error('pretty-format: Options "min" and "indent" cannot be used together.')}function Nk(){return py.reduce((e,t)=>{const r=Gu[t],n=r&&Ie[r];if(n&&typeof n.close=="string"&&typeof n.open=="string")e[t]=n;else throw new Error(`pretty-format: Option "theme" has a key "${t}" whose value "${r}" is undefined in ansi-styles.`);return e},Object.create(null))}function $k(){return py.reduce((e,t)=>(e[t]={close:"",open:""},e),Object.create(null))}function my(e){return e?.printFunctionName??lt.printFunctionName}function hy(e){return e?.escapeRegex??lt.escapeRegex}function gy(e){return e?.escapeString??lt.escapeString}function Nm(e){return{callToJSON:e?.callToJSON??lt.callToJSON,colors:e?.highlight?Nk():$k(),compareKeys:typeof e?.compareKeys=="function"||e?.compareKeys===null?e.compareKeys:lt.compareKeys,escapeRegex:hy(e),escapeString:gy(e),indent:e?.min?"":jk(e?.indent??lt.indent),maxDepth:e?.maxDepth??lt.maxDepth,maxWidth:e?.maxWidth??lt.maxWidth,min:e?.min??lt.min,plugins:e?.plugins??lt.plugins,printBasicPrototype:e?.printBasicPrototype??!0,printFunctionName:my(e),spacingInner:e?.min?" ":`
89
+ `,spacingOuter:e?.min?"":`
90
+ `}}function jk(e){return Array.from({length:e+1}).join(" ")}function dt(e,t){if(t&&(Ok(t),t.plugins)){const n=fy(t.plugins,e);if(n!==null)return dy(n,e,Nm(t),"",0,[])}const r=uy(e,my(t),hy(t),gy(t));return r!==null?r:cy(e,Nm(t),"",0,[])}const Ku={AsymmetricMatcher:OP,DOMCollection:BP,DOMElement:YP,Immutable:fk,ReactElement:vk,ReactTestComponent:Ek},$m={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"]},Dk={special:"cyan",number:"yellow",bigint:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",symbol:"green",date:"magenta",regexp:"red"},$r="…";function Lk(e,t){const r=$m[Dk[t]]||$m[t]||"";return r?`\x1B[${r[0]}m${String(e)}\x1B[${r[1]}m`:String(e)}function Fk({showHidden:e=!1,depth:t=2,colors:r=!1,customInspect:n=!0,showProxy:a=!1,maxArrayLength:i=1/0,breakLength:o=1/0,seen:s=[],truncate:l=1/0,stylize:u=String}={},d){const c={showHidden:!!e,depth:Number(t),colors:!!r,customInspect:!!n,showProxy:!!a,maxArrayLength:Number(i),breakLength:Number(o),truncate:Number(l),seen:s,inspect:d,stylize:u};return c.colors&&(c.stylize=Lk),c}function Bk(e){return e>="\uD800"&&e<="\uDBFF"}function Xt(e,t,r=$r){e=String(e);const n=r.length,a=e.length;if(n>t&&a>n)return r;if(a>t&&a>n){let i=t-n;return i>0&&Bk(e[i-1])&&(i=i-1),`${e.slice(0,i)}${r}`}return e}function pt(e,t,r,n=", "){r=r||t.inspect;const a=e.length;if(a===0)return"";const i=t.truncate;let o="",s="",l="";for(let u=0;u<a;u+=1){const d=u+1===e.length,c=u+2===e.length;l=`${$r}(${e.length-u})`;const f=e[u];t.truncate=i-o.length-(d?0:n.length);const p=s||r(f,t)+(d?"":n),m=o.length+p.length,g=m+l.length;if(d&&m>i&&o.length+l.length<=i||!d&&!c&&g>i||(s=d?"":r(e[u+1],t)+(c?"":n),!d&&c&&g>i&&m+s.length>i))break;if(o+=p,!d&&!c&&m+s.length>=i){l=`${$r}(${e.length-u-1})`;break}l=""}return`${o}${l}`}function zk(e){return e.match(/^[a-zA-Z_][a-zA-Z_0-9]*$/)?e:JSON.stringify(e).replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'")}function ai([e,t],r){return r.truncate-=2,typeof e=="string"?e=zk(e):typeof e!="number"&&(e=`[${r.inspect(e,r)}]`),r.truncate-=e.length,t=r.inspect(t,r),`${e}: ${t}`}function Uk(e,t){const r=Object.keys(e).slice(e.length);if(!e.length&&!r.length)return"[]";t.truncate-=4;const n=pt(e,t);t.truncate-=n.length;let a="";return r.length&&(a=pt(r.map(i=>[i,e[i]]),t,ai)),`[ ${n}${a?`, ${a}`:""} ]`}const Wk=e=>typeof Buffer=="function"&&e instanceof Buffer?"Buffer":e[Symbol.toStringTag]?e[Symbol.toStringTag]:e.constructor.name;function Pt(e,t){const r=Wk(e);t.truncate-=r.length+4;const n=Object.keys(e).slice(e.length);if(!e.length&&!n.length)return`${r}[]`;let a="";for(let o=0;o<e.length;o++){const s=`${t.stylize(Xt(e[o],t.truncate),"number")}${o===e.length-1?"":", "}`;if(t.truncate-=s.length,e[o]!==e.length&&t.truncate<=3){a+=`${$r}(${e.length-e[o]+1})`;break}a+=s}let i="";return n.length&&(i=pt(n.map(o=>[o,e[o]]),t,ai)),`${r}[ ${a}${i?`, ${i}`:""} ]`}function Vk(e,t){const r=e.toJSON();if(r===null)return"Invalid Date";const n=r.split("T"),a=n[0];return t.stylize(`${a}T${Xt(n[1],t.truncate-a.length-1)}`,"date")}function jm(e,t){const r=e[Symbol.toStringTag]||"Function",n=e.name;return n?t.stylize(`[${r} ${Xt(n,t.truncate-11)}]`,"special"):t.stylize(`[${r}]`,"special")}function Hk([e,t],r){return r.truncate-=4,e=r.inspect(e,r),r.truncate-=e.length,t=r.inspect(t,r),`${e} => ${t}`}function Gk(e){const t=[];return e.forEach((r,n)=>{t.push([n,r])}),t}function Kk(e,t){return e.size===0?"Map{}":(t.truncate-=7,`Map{ ${pt(Gk(e),t,Hk)} }`)}const Jk=Number.isNaN||(e=>e!==e);function Dm(e,t){return Jk(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(Xt(String(e),t.truncate),"number")}function Lm(e,t){let r=Xt(e.toString(),t.truncate-1);return r!==$r&&(r+="n"),t.stylize(r,"bigint")}function Xk(e,t){const r=e.toString().split("/")[2],n=t.truncate-(2+r.length),a=e.source;return t.stylize(`/${Xt(a,n)}/${r}`,"regexp")}function Yk(e){const t=[];return e.forEach(r=>{t.push(r)}),t}function Qk(e,t){return e.size===0?"Set{}":(t.truncate-=7,`Set{ ${pt(Yk(e),t)} }`)}const Fm=new RegExp("['\\u0000-\\u001f\\u007f-\\u009f\\u00ad\\u0600-\\u0604\\u070f\\u17b4\\u17b5\\u200c-\\u200f\\u2028-\\u202f\\u2060-\\u206f\\ufeff\\ufff0-\\uffff]","g"),Zk={"\b":"\\b"," ":"\\t","\n":"\\n","\f":"\\f","\r":"\\r","'":"\\'","\\":"\\\\"},eM=16;function tM(e){return Zk[e]||`\\u${`0000${e.charCodeAt(0).toString(eM)}`.slice(-4)}`}function Bm(e,t){return Fm.test(e)&&(e=e.replace(Fm,tM)),t.stylize(`'${Xt(e,t.truncate-2)}'`,"string")}function zm(e){return"description"in Symbol.prototype?e.description?`Symbol(${e.description})`:"Symbol()":e.toString()}const rM=()=>"Promise{…}";function Ii(e,t){const r=Object.getOwnPropertyNames(e),n=Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(e):[];if(r.length===0&&n.length===0)return"{}";if(t.truncate-=4,t.seen=t.seen||[],t.seen.includes(e))return"[Circular]";t.seen.push(e);const a=pt(r.map(s=>[s,e[s]]),t,ai),i=pt(n.map(s=>[s,e[s]]),t,ai);t.seen.pop();let o="";return a&&i&&(o=", "),`{ ${a}${o}${i} }`}const Vs=typeof Symbol<"u"&&Symbol.toStringTag?Symbol.toStringTag:!1;function nM(e,t){let r="";return Vs&&Vs in e&&(r=e[Vs]),r=r||e.constructor.name,(!r||r==="_class")&&(r="<Anonymous Class>"),t.truncate-=r.length,`${r}${Ii(e,t)}`}function aM(e,t){return e.length===0?"Arguments[]":(t.truncate-=13,`Arguments[ ${pt(e,t)} ]`)}const oM=["stack","line","column","name","message","fileName","lineNumber","columnNumber","number","description","cause"];function iM(e,t){const r=Object.getOwnPropertyNames(e).filter(o=>oM.indexOf(o)===-1),n=e.name;t.truncate-=n.length;let a="";if(typeof e.message=="string"?a=Xt(e.message,t.truncate):r.unshift("message"),a=a?`: ${a}`:"",t.truncate-=a.length+5,t.seen=t.seen||[],t.seen.includes(e))return"[Circular]";t.seen.push(e);const i=pt(r.map(o=>[o,e[o]]),t,ai);return`${n}${a}${i?` { ${i} }`:""}`}function sM([e,t],r){return r.truncate-=3,t?`${r.stylize(String(e),"yellow")}=${r.stylize(`"${t}"`,"string")}`:`${r.stylize(String(e),"yellow")}`}function Vl(e,t){return pt(e,t,lM,`
91
+ `)}function lM(e,t){switch(e.nodeType){case 1:return by(e,t);case 3:return t.inspect(e.data,t);default:return t.inspect(e,t)}}function by(e,t){const r=e.getAttributeNames(),n=e.tagName.toLowerCase(),a=t.stylize(`<${n}`,"special"),i=t.stylize(">","special"),o=t.stylize(`</${n}>`,"special");t.truncate-=n.length*2+5;let s="";r.length>0&&(s+=" ",s+=pt(r.map(d=>[d,e.getAttribute(d)]),t,sM," ")),t.truncate-=s.length;const l=t.truncate;let u=Vl(e.children,t);return u&&u.length>l&&(u=`${$r}(${e.children.length})`),`${a}${s}${i}${u}${o}`}const uM=typeof Symbol=="function"&&typeof Symbol.for=="function",Hs=uM?Symbol.for("chai/inspect"):"@@chai/inspect",Gs=Symbol.for("nodejs.util.inspect.custom"),Um=new WeakMap,Wm={},Vm={undefined:(e,t)=>t.stylize("undefined","undefined"),null:(e,t)=>t.stylize("null","null"),boolean:(e,t)=>t.stylize(String(e),"boolean"),Boolean:(e,t)=>t.stylize(String(e),"boolean"),number:Dm,Number:Dm,bigint:Lm,BigInt:Lm,string:Bm,String:Bm,function:jm,Function:jm,symbol:zm,Symbol:zm,Array:Uk,Date:Vk,Map:Kk,Set:Qk,RegExp:Xk,Promise:rM,WeakSet:(e,t)=>t.stylize("WeakSet{…}","special"),WeakMap:(e,t)=>t.stylize("WeakMap{…}","special"),Arguments:aM,Int8Array:Pt,Uint8Array:Pt,Uint8ClampedArray:Pt,Int16Array:Pt,Uint16Array:Pt,Int32Array:Pt,Uint32Array:Pt,Float32Array:Pt,Float64Array:Pt,Generator:()=>"",DataView:()=>"",ArrayBuffer:()=>"",Error:iM,HTMLCollection:Vl,NodeList:Vl},cM=(e,t,r,n)=>Hs in e&&typeof e[Hs]=="function"?e[Hs](t):Gs in e&&typeof e[Gs]=="function"?e[Gs](t.depth,t,n):"inspect"in e&&typeof e.inspect=="function"?e.inspect(t.depth,t):"constructor"in e&&Um.has(e.constructor)?Um.get(e.constructor)(e,t):Wm[r]?Wm[r](e,t):"",dM=Object.prototype.toString;function Oi(e,t={}){const r=Fk(t,Oi),{customInspect:n}=r;let a=e===null?"null":typeof e;if(a==="object"&&(a=dM.call(e).slice(8,-1)),a in Vm)return Vm[a](e,r);if(n&&e){const o=cM(e,r,a,Oi);if(o)return typeof o=="string"?o:Oi(o,r)}const i=e?Object.getPrototypeOf(e):!1;return i===Object.prototype||i===null?Ii(e,r):e&&typeof HTMLElement=="function"&&e instanceof HTMLElement?by(e,r):"constructor"in e?e.constructor!==Object?nM(e,r):Ii(e,r):e===Object(e)?Ii(e,r):r.stylize(String(e),a)}const{AsymmetricMatcher:fM,DOMCollection:pM,DOMElement:mM,Immutable:hM,ReactElement:gM,ReactTestComponent:bM}=Ku,Hm=[bM,gM,mM,pM,hM,fM];function at(e,t=10,{maxLength:r,...n}={}){const a=r??1e4;let i;try{i=dt(e,{maxDepth:t,escapeString:!1,plugins:Hm,...n})}catch{i=dt(e,{callToJSON:!1,maxDepth:t,escapeString:!1,plugins:Hm,...n})}return i.length>=a&&t>1?at(e,Math.floor(t/2)):i}const yM=/%[sdjifoOc%]/g;function yy(...e){if(typeof e[0]!="string"){const i=[];for(let o=0;o<e.length;o++)i.push(Cr(e[o],{depth:0,colors:!1}));return i.join(" ")}const t=e.length;let r=1;const n=e[0];let a=String(n).replace(yM,i=>{if(i==="%%")return"%";if(r>=t)return i;switch(i){case"%s":{const o=e[r++];return typeof o=="bigint"?`${o.toString()}n`:typeof o=="number"&&o===0&&1/o<0?"-0":typeof o=="object"&&o!==null?Cr(o,{depth:0,colors:!1}):String(o)}case"%d":{const o=e[r++];return typeof o=="bigint"?`${o.toString()}n`:Number(o).toString()}case"%i":{const o=e[r++];return typeof o=="bigint"?`${o.toString()}n`:Number.parseInt(String(o)).toString()}case"%f":return Number.parseFloat(String(e[r++])).toString();case"%o":return Cr(e[r++],{showHidden:!0,showProxy:!0});case"%O":return Cr(e[r++]);case"%c":return r++,"";case"%j":try{return JSON.stringify(e[r++])}catch(o){const s=o.message;if(s.includes("circular structure")||s.includes("cyclic structures")||s.includes("cyclic object"))return"[Circular]";throw o}default:return i}});for(let i=e[r];r<t;i=e[++r])i===null||typeof i!="object"?a+=` ${i}`:a+=` ${Cr(i)}`;return a}function Cr(e,t={}){return t.truncate===0&&(t.truncate=Number.POSITIVE_INFINITY),Oi(e,t)}function vM(e,t={}){typeof t.truncate>"u"&&(t.truncate=40);const r=Cr(e,t),n=Object.prototype.toString.call(e);if(t.truncate&&r.length>=t.truncate)if(n==="[object Function]"){const a=e;return a.name?`[Function: ${a.name}]`:"[Function]"}else{if(n==="[object Array]")return`[ Array(${e.length}) ]`;if(n==="[object Object]"){const a=Object.keys(e);return`{ Object (${a.length>2?`${a.splice(0,2).join(", ")}, ...`:a.join(", ")}) }`}else return r}return r}function wM(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function xM(e){const{message:t="$$stack trace error",stackTraceLimit:r=1}=e||{},n=Error.stackTraceLimit,a=Error.prepareStackTrace;Error.stackTraceLimit=r,Error.prepareStackTrace=s=>s.stack;const o=new Error(t).stack||"";return Error.prepareStackTrace=a,Error.stackTraceLimit=n,o}function bt(e,t,r){const n=typeof e;if(!r.includes(n))throw new TypeError(`${t} value must be ${r.join(" or ")}, received "${n}"`)}function RM(e){return e==null&&(e=[]),Array.isArray(e)?e:[e]}function Mr(e){return e!=null&&typeof e=="object"&&!Array.isArray(e)}function CM(e){return e===Object.prototype||e===Function.prototype||e===RegExp.prototype}function Ji(e){return Object.prototype.toString.apply(e).slice(8,-1)}function EM(e,t){const r=typeof t=="function"?t:n=>t.add(n);Object.getOwnPropertyNames(e).forEach(r),Object.getOwnPropertySymbols(e).forEach(r)}function vy(e){const t=new Set;return CM(e)?[]:(EM(e,t),Array.from(t))}const wy={forceWritable:!1};function Gm(e,t=wy){return Hl(e,new WeakMap,t)}function Hl(e,t,r=wy){let n,a;if(t.has(e))return t.get(e);if(Array.isArray(e)){for(a=Array.from({length:n=e.length}),t.set(e,a);n--;)a[n]=Hl(e[n],t,r);return a}if(Object.prototype.toString.call(e)==="[object Object]"){a=Object.create(Object.getPrototypeOf(e)),t.set(e,a);const i=vy(e);for(const o of i){const s=Object.getOwnPropertyDescriptor(e,o);if(!s)continue;const l=Hl(e[o],t,r);r.forceWritable?Object.defineProperty(a,o,{enumerable:s.enumerable,configurable:!0,writable:!0,value:l}):"get"in s?Object.defineProperty(a,o,{...s,get(){return l}}):Object.defineProperty(a,o,{...s,value:l})}return a}return e}function TM(e,t,r=void 0){const n=t.replace(/\[(\d+)\]/g,".$1").split(".");let a=e;for(const i of n)if(a=new Object(a)[i],a===void 0)return r;return a}function Km(){let e=null,t=null;const r=new Promise((n,a)=>{e=n,t=a});return r.resolve=e,r.reject=t,r}function SM(e){if(!Number.isNaN(e))return!1;const t=new Float64Array(1);return t[0]=e,new Uint32Array(t.buffer)[1]>>>31===1}var Ks,Jm;function _M(){if(Jm)return Ks;Jm=1;var e,t,r,n,a,i,o,s,l,u,d,c,f,p,m,g,b,h,w;return f=/\/(?![*\/])(?:\[(?:(?![\]\\]).|\\.)*\]|(?![\/\\]).|\\.)*(\/[$_\u200C\u200D\p{ID_Continue}]*|\\)?/yu,c=/--|\+\+|=>|\.{3}|\??\.(?!\d)|(?:&&|\|\||\?\?|[+\-%&|^]|\*{1,2}|<{1,2}|>{1,3}|!=?|={1,2}|\/(?![\/*]))=?|[?~,:;[\](){}]/y,e=/(\x23?)(?=[$_\p{ID_Start}\\])(?:[$_\u200C\u200D\p{ID_Continue}]|\\u[\da-fA-F]{4}|\\u\{[\da-fA-F]+\})+/yu,m=/(['"])(?:(?!\1)[^\\\n\r]|\\(?:\r\n|[^]))*(\1)?/y,d=/(?:0[xX][\da-fA-F](?:_?[\da-fA-F])*|0[oO][0-7](?:_?[0-7])*|0[bB][01](?:_?[01])*)n?|0n|[1-9](?:_?\d)*n|(?:(?:0(?!\d)|0\d*[89]\d*|[1-9](?:_?\d)*)(?:\.(?:\d(?:_?\d)*)?)?|\.\d(?:_?\d)*)(?:[eE][+-]?\d(?:_?\d)*)?|0[0-7]+/y,g=/[`}](?:[^`\\$]|\\[^]|\$(?!\{))*(`|\$\{)?/y,w=/[\t\v\f\ufeff\p{Zs}]+/yu,s=/\r?\n|[\r\u2028\u2029]/y,l=/\/\*(?:[^*]|\*(?!\/))*(\*\/)?/y,p=/\/\/.*/y,r=/[<>.:={}]|\/(?![\/*])/y,t=/[$_\p{ID_Start}][$_\u200C\u200D\p{ID_Continue}-]*/yu,n=/(['"])(?:(?!\1)[^])*(\1)?/y,a=/[^<>{}]+/y,h=/^(?:[\/+-]|\.{3}|\?(?:InterpolationIn(?:JSX|Template)|NoLineTerminatorHere|NonExpressionParenEnd|UnaryIncDec))?$|[{}([,;<>=*%&|^!~?:]$/,b=/^(?:=>|[;\]){}]|else|\?(?:NoLineTerminatorHere|NonExpressionParenEnd))?$/,i=/^(?:await|case|default|delete|do|else|instanceof|new|return|throw|typeof|void|yield)$/,o=/^(?:return|throw|yield)$/,u=RegExp(s.source),Ks=function*(x,{jsx:T=!1}={}){var E,y,v,R,k,P,M,F,j,D,J,B,Y,L;for({length:P}=x,R=0,k="",L=[{tag:"JS"}],E=[],J=0,B=!1;R<P;){switch(F=L[L.length-1],F.tag){case"JS":case"JSNonExpressionParen":case"InterpolationInTemplate":case"InterpolationInJSX":if(x[R]==="/"&&(h.test(k)||i.test(k))&&(f.lastIndex=R,M=f.exec(x))){R=f.lastIndex,k=M[0],B=!0,yield{type:"RegularExpressionLiteral",value:M[0],closed:M[1]!==void 0&&M[1]!=="\\"};continue}if(c.lastIndex=R,M=c.exec(x)){switch(Y=M[0],j=c.lastIndex,D=Y,Y){case"(":k==="?NonExpressionParenKeyword"&&L.push({tag:"JSNonExpressionParen",nesting:J}),J++,B=!1;break;case")":J--,B=!0,F.tag==="JSNonExpressionParen"&&J===F.nesting&&(L.pop(),D="?NonExpressionParenEnd",B=!1);break;case"{":c.lastIndex=0,v=!b.test(k)&&(h.test(k)||i.test(k)),E.push(v),B=!1;break;case"}":switch(F.tag){case"InterpolationInTemplate":if(E.length===F.nesting){g.lastIndex=R,M=g.exec(x),R=g.lastIndex,k=M[0],M[1]==="${"?(k="?InterpolationInTemplate",B=!1,yield{type:"TemplateMiddle",value:M[0]}):(L.pop(),B=!0,yield{type:"TemplateTail",value:M[0],closed:M[1]==="`"});continue}break;case"InterpolationInJSX":if(E.length===F.nesting){L.pop(),R+=1,k="}",yield{type:"JSXPunctuator",value:"}"};continue}}B=E.pop(),D=B?"?ExpressionBraceEnd":"}";break;case"]":B=!0;break;case"++":case"--":D=B?"?PostfixIncDec":"?UnaryIncDec";break;case"<":if(T&&(h.test(k)||i.test(k))){L.push({tag:"JSXTag"}),R+=1,k="<",yield{type:"JSXPunctuator",value:Y};continue}B=!1;break;default:B=!1}R=j,k=D,yield{type:"Punctuator",value:Y};continue}if(e.lastIndex=R,M=e.exec(x)){switch(R=e.lastIndex,D=M[0],M[0]){case"for":case"if":case"while":case"with":k!=="."&&k!=="?."&&(D="?NonExpressionParenKeyword")}k=D,B=!i.test(M[0]),yield{type:M[1]==="#"?"PrivateIdentifier":"IdentifierName",value:M[0]};continue}if(m.lastIndex=R,M=m.exec(x)){R=m.lastIndex,k=M[0],B=!0,yield{type:"StringLiteral",value:M[0],closed:M[2]!==void 0};continue}if(d.lastIndex=R,M=d.exec(x)){R=d.lastIndex,k=M[0],B=!0,yield{type:"NumericLiteral",value:M[0]};continue}if(g.lastIndex=R,M=g.exec(x)){R=g.lastIndex,k=M[0],M[1]==="${"?(k="?InterpolationInTemplate",L.push({tag:"InterpolationInTemplate",nesting:E.length}),B=!1,yield{type:"TemplateHead",value:M[0]}):(B=!0,yield{type:"NoSubstitutionTemplate",value:M[0],closed:M[1]==="`"});continue}break;case"JSXTag":case"JSXTagEnd":if(r.lastIndex=R,M=r.exec(x)){switch(R=r.lastIndex,D=M[0],M[0]){case"<":L.push({tag:"JSXTag"});break;case">":L.pop(),k==="/"||F.tag==="JSXTagEnd"?(D="?JSX",B=!0):L.push({tag:"JSXChildren"});break;case"{":L.push({tag:"InterpolationInJSX",nesting:E.length}),D="?InterpolationInJSX",B=!1;break;case"/":k==="<"&&(L.pop(),L[L.length-1].tag==="JSXChildren"&&L.pop(),L.push({tag:"JSXTagEnd"}))}k=D,yield{type:"JSXPunctuator",value:M[0]};continue}if(t.lastIndex=R,M=t.exec(x)){R=t.lastIndex,k=M[0],yield{type:"JSXIdentifier",value:M[0]};continue}if(n.lastIndex=R,M=n.exec(x)){R=n.lastIndex,k=M[0],yield{type:"JSXString",value:M[0],closed:M[2]!==void 0};continue}break;case"JSXChildren":if(a.lastIndex=R,M=a.exec(x)){R=a.lastIndex,k=M[0],yield{type:"JSXText",value:M[0]};continue}switch(x[R]){case"<":L.push({tag:"JSXTag"}),R++,k="<",yield{type:"JSXPunctuator",value:"<"};continue;case"{":L.push({tag:"InterpolationInJSX",nesting:E.length}),R++,k="?InterpolationInJSX",B=!1,yield{type:"JSXPunctuator",value:"{"};continue}}if(w.lastIndex=R,M=w.exec(x)){R=w.lastIndex,yield{type:"WhiteSpace",value:M[0]};continue}if(s.lastIndex=R,M=s.exec(x)){R=s.lastIndex,B=!1,o.test(k)&&(k="?NoLineTerminatorHere"),yield{type:"LineTerminatorSequence",value:M[0]};continue}if(l.lastIndex=R,M=l.exec(x)){R=l.lastIndex,u.test(M[0])&&(B=!1,o.test(k)&&(k="?NoLineTerminatorHere")),yield{type:"MultiLineComment",value:M[0],closed:M[1]!==void 0};continue}if(p.lastIndex=R,M=p.exec(x)){R=p.lastIndex,B=!1,yield{type:"SingleLineComment",value:M[0]};continue}y=String.fromCodePoint(x.codePointAt(R)),R+=y.length,k=y,B=!1,yield{type:F.tag.startsWith("JSX")?"JSXInvalid":"Invalid",value:y}}},Ks}_M();var xy={keyword:["break","case","catch","continue","debugger","default","do","else","finally","for","function","if","return","switch","throw","try","var","const","while","with","new","this","super","class","extends","export","import","null","true","false","in","instanceof","typeof","void","delete"],strict:["implements","interface","let","package","private","protected","public","static","yield"]};new Set(xy.keyword);new Set(xy.strict);const Xm=Symbol("vitest:SAFE_TIMERS");function ui(){const{setTimeout:e,setInterval:t,clearInterval:r,clearTimeout:n,setImmediate:a,clearImmediate:i}=globalThis[Xm]||globalThis,{nextTick:o}=globalThis[Xm]||globalThis.process||{nextTick:s=>s()};return{nextTick:o,setTimeout:e,setInterval:t,clearInterval:r,clearTimeout:n,setImmediate:a,clearImmediate:i}}const Ue=-1,Be=1,qe=0;class Ae{constructor(t,r){re(this,0);re(this,1);this[0]=t,this[1]=r}}const PM=function(e,t){if(!e||!t||e.charAt(0)!==t.charAt(0))return 0;let r=0,n=Math.min(e.length,t.length),a=n,i=0;for(;r<a;)e.substring(i,a)===t.substring(i,a)?(r=a,i=r):n=a,a=Math.floor((n-r)/2+r);return a},Ry=function(e,t){if(!e||!t||e.charAt(e.length-1)!==t.charAt(t.length-1))return 0;let r=0,n=Math.min(e.length,t.length),a=n,i=0;for(;r<a;)e.substring(e.length-a,e.length-i)===t.substring(t.length-a,t.length-i)?(r=a,i=r):n=a,a=Math.floor((n-r)/2+r);return a},Ym=function(e,t){const r=e.length,n=t.length;if(r===0||n===0)return 0;r>n?e=e.substring(r-n):r<n&&(t=t.substring(0,r));const a=Math.min(r,n);if(e===t)return a;let i=0,o=1;for(;;){const s=e.substring(a-o),l=t.indexOf(s);if(l===-1)return i;o+=l,(l===0||e.substring(a-o)===t.substring(0,o))&&(i=o,o++)}},kM=function(e){let t=!1;const r=[];let n=0,a=null,i=0,o=0,s=0,l=0,u=0;for(;i<e.length;)e[i][0]===qe?(r[n++]=i,o=l,s=u,l=0,u=0,a=e[i][1]):(e[i][0]===Be?l+=e[i][1].length:u+=e[i][1].length,a&&a.length<=Math.max(o,s)&&a.length<=Math.max(l,u)&&(e.splice(r[n-1],0,new Ae(Ue,a)),e[r[n-1]+1][0]=Be,n--,n--,i=n>0?r[n-1]:-1,o=0,s=0,l=0,u=0,a=null,t=!0)),i++;for(t&&Cy(e),qM(e),i=1;i<e.length;){if(e[i-1][0]===Ue&&e[i][0]===Be){const d=e[i-1][1],c=e[i][1],f=Ym(d,c),p=Ym(c,d);f>=p?(f>=d.length/2||f>=c.length/2)&&(e.splice(i,0,new Ae(qe,c.substring(0,f))),e[i-1][1]=d.substring(0,d.length-f),e[i+1][1]=c.substring(f),i++):(p>=d.length/2||p>=c.length/2)&&(e.splice(i,0,new Ae(qe,d.substring(0,p))),e[i-1][0]=Be,e[i-1][1]=c.substring(0,c.length-p),e[i+1][0]=Ue,e[i+1][1]=d.substring(p),i++),i++}i++}},Qm=/[^a-z0-9]/i,Zm=/\s/,eh=/[\r\n]/,MM=/\n\r?\n$/,AM=/^\r?\n\r?\n/;function qM(e){let t=1;for(;t<e.length-1;){if(e[t-1][0]===qe&&e[t+1][0]===qe){let r=e[t-1][1],n=e[t][1],a=e[t+1][1];const i=Ry(r,n);if(i){const d=n.substring(n.length-i);r=r.substring(0,r.length-i),n=d+n.substring(0,n.length-i),a=d+a}let o=r,s=n,l=a,u=Ti(r,n)+Ti(n,a);for(;n.charAt(0)===a.charAt(0);){r+=n.charAt(0),n=n.substring(1)+a.charAt(0),a=a.substring(1);const d=Ti(r,n)+Ti(n,a);d>=u&&(u=d,o=r,s=n,l=a)}e[t-1][1]!==o&&(o?e[t-1][1]=o:(e.splice(t-1,1),t--),e[t][1]=s,l?e[t+1][1]=l:(e.splice(t+1,1),t--))}t++}}function Cy(e){e.push(new Ae(qe,""));let t=0,r=0,n=0,a="",i="",o;for(;t<e.length;)switch(e[t][0]){case Be:n++,i+=e[t][1],t++;break;case Ue:r++,a+=e[t][1],t++;break;case qe:r+n>1?(r!==0&&n!==0&&(o=PM(i,a),o!==0&&(t-r-n>0&&e[t-r-n-1][0]===qe?e[t-r-n-1][1]+=i.substring(0,o):(e.splice(0,0,new Ae(qe,i.substring(0,o))),t++),i=i.substring(o),a=a.substring(o)),o=Ry(i,a),o!==0&&(e[t][1]=i.substring(i.length-o)+e[t][1],i=i.substring(0,i.length-o),a=a.substring(0,a.length-o))),t-=r+n,e.splice(t,r+n),a.length&&(e.splice(t,0,new Ae(Ue,a)),t++),i.length&&(e.splice(t,0,new Ae(Be,i)),t++),t++):t!==0&&e[t-1][0]===qe?(e[t-1][1]+=e[t][1],e.splice(t,1)):t++,n=0,r=0,a="",i="";break}e[e.length-1][1]===""&&e.pop();let s=!1;for(t=1;t<e.length-1;)e[t-1][0]===qe&&e[t+1][0]===qe&&(e[t][1].substring(e[t][1].length-e[t-1][1].length)===e[t-1][1]?(e[t][1]=e[t-1][1]+e[t][1].substring(0,e[t][1].length-e[t-1][1].length),e[t+1][1]=e[t-1][1]+e[t+1][1],e.splice(t-1,1),s=!0):e[t][1].substring(0,e[t+1][1].length)===e[t+1][1]&&(e[t-1][1]+=e[t+1][1],e[t][1]=e[t][1].substring(e[t+1][1].length)+e[t+1][1],e.splice(t+1,1),s=!0)),t++;s&&Cy(e)}function Ti(e,t){if(!e||!t)return 6;const r=e.charAt(e.length-1),n=t.charAt(0),a=r.match(Qm),i=n.match(Qm),o=a&&r.match(Zm),s=i&&n.match(Zm),l=o&&r.match(eh),u=s&&n.match(eh),d=l&&e.match(MM),c=u&&t.match(AM);return d||c?5:l||u?4:a&&!o&&s?3:o||s?2:a||i?1:0}const Ey="Compared values have no visual difference.",IM="Compared values serialize to the same structure.\nPrinting internal object structure without calling `toJSON` instead.";var Si={},th;function OM(){if(th)return Si;th=1,Object.defineProperty(Si,"__esModule",{value:!0}),Si.default=f;const e="diff-sequences",t=0,r=(p,m,g,b,h)=>{let w=0;for(;p<m&&g<b&&h(p,g);)p+=1,g+=1,w+=1;return w},n=(p,m,g,b,h)=>{let w=0;for(;p<=m&&g<=b&&h(m,b);)m-=1,b-=1,w+=1;return w},a=(p,m,g,b,h,w,x)=>{let T=0,E=-p,y=w[T],v=y;w[T]+=r(y+1,m,b+y-E+1,g,h);const R=p<x?p:x;for(T+=1,E+=2;T<=R;T+=1,E+=2){if(T!==p&&v<w[T])y=w[T];else if(y=v+1,m<=y)return T-1;v=w[T],w[T]=y+r(y+1,m,b+y-E+1,g,h)}return x},i=(p,m,g,b,h,w,x)=>{let T=0,E=p,y=w[T],v=y;w[T]-=n(m,y-1,g,b+y-E-1,h);const R=p<x?p:x;for(T+=1,E-=2;T<=R;T+=1,E-=2){if(T!==p&&w[T]<v)y=w[T];else if(y=v-1,y<m)return T-1;v=w[T],w[T]=y-n(m,y-1,g,b+y-E-1,h)}return x},o=(p,m,g,b,h,w,x,T,E,y,v)=>{const R=b-m,k=g-m,M=h-b-k,F=-M-(p-1),j=-M+(p-1);let D=t;const J=p<T?p:T;for(let B=0,Y=-p;B<=J;B+=1,Y+=2){const L=B===0||B!==p&&D<x[B],Z=L?x[B]:D,ae=L?Z:Z+1,ne=R+ae-Y,fe=r(ae+1,g,ne+1,h,w),H=ae+fe;if(D=x[B],x[B]=H,F<=Y&&Y<=j){const me=(p-1-(Y+M))/2;if(me<=y&&E[me]-1<=H){const ce=R+Z-(L?Y+1:Y-1),se=n(m,Z,b,ce,w),Se=Z-se,Me=ce-se,q=Se+1,Q=Me+1;v.nChangePreceding=p-1,p-1===q+Q-m-b?(v.aEndPreceding=m,v.bEndPreceding=b):(v.aEndPreceding=q,v.bEndPreceding=Q),v.nCommonPreceding=se,se!==0&&(v.aCommonPreceding=q,v.bCommonPreceding=Q),v.nCommonFollowing=fe,fe!==0&&(v.aCommonFollowing=ae+1,v.bCommonFollowing=ne+1);const W=H+1,le=ne+fe+1;return v.nChangeFollowing=p-1,p-1===g+h-W-le?(v.aStartFollowing=g,v.bStartFollowing=h):(v.aStartFollowing=W,v.bStartFollowing=le),!0}}}return!1},s=(p,m,g,b,h,w,x,T,E,y,v)=>{const R=h-g,k=g-m,M=h-b-k,F=M-p,j=M+p;let D=t;const J=p<y?p:y;for(let B=0,Y=p;B<=J;B+=1,Y-=2){const L=B===0||B!==p&&E[B]<D,Z=L?E[B]:D,ae=L?Z:Z-1,ne=R+ae-Y,fe=n(m,ae-1,b,ne-1,w),H=ae-fe;if(D=E[B],E[B]=H,F<=Y&&Y<=j){const me=(p+(Y-M))/2;if(me<=T&&H-1<=x[me]){const ce=ne-fe;if(v.nChangePreceding=p,p===H+ce-m-b?(v.aEndPreceding=m,v.bEndPreceding=b):(v.aEndPreceding=H,v.bEndPreceding=ce),v.nCommonPreceding=fe,fe!==0&&(v.aCommonPreceding=H,v.bCommonPreceding=ce),v.nChangeFollowing=p-1,p===1)v.nCommonFollowing=0,v.aStartFollowing=g,v.bStartFollowing=h;else{const se=R+Z-(L?Y-1:Y+1),Se=r(Z,g,se,h,w);v.nCommonFollowing=Se,Se!==0&&(v.aCommonFollowing=Z,v.bCommonFollowing=se);const Me=Z+Se,q=se+Se;p-1===g+h-Me-q?(v.aStartFollowing=g,v.bStartFollowing=h):(v.aStartFollowing=Me,v.bStartFollowing=q)}return!0}}}return!1},l=(p,m,g,b,h,w,x,T,E)=>{const y=b-m,v=h-g,R=g-m,k=h-b,P=k-R;let M=R,F=R;if(x[0]=m-1,T[0]=g,P%2===0){const j=(p||P)/2,D=(R+k)/2;for(let J=1;J<=D;J+=1)if(M=a(J,g,h,y,w,x,M),J<j)F=i(J,m,b,v,w,T,F);else if(s(J,m,g,b,h,w,x,M,T,F,E))return}else{const j=((p||P)+1)/2,D=(R+k+1)/2;let J=1;for(M=a(J,g,h,y,w,x,M),J+=1;J<=D;J+=1)if(F=i(J-1,m,b,v,w,T,F),J<j)M=a(J,g,h,y,w,x,M);else if(o(J,m,g,b,h,w,x,M,T,F,E))return}throw new Error(`${e}: no overlap aStart=${m} aEnd=${g} bStart=${b} bEnd=${h}`)},u=(p,m,g,b,h,w,x,T,E,y)=>{if(h-b<g-m){if(w=!w,w&&x.length===1){const{foundSubsequence:H,isCommon:me}=x[0];x[1]={foundSubsequence:(ce,se,Se)=>{H(ce,Se,se)},isCommon:(ce,se)=>me(se,ce)}}const ne=m,fe=g;m=b,g=h,b=ne,h=fe}const{foundSubsequence:v,isCommon:R}=x[w?1:0];l(p,m,g,b,h,R,T,E,y);const{nChangePreceding:k,aEndPreceding:P,bEndPreceding:M,nCommonPreceding:F,aCommonPreceding:j,bCommonPreceding:D,nCommonFollowing:J,aCommonFollowing:B,bCommonFollowing:Y,nChangeFollowing:L,aStartFollowing:Z,bStartFollowing:ae}=y;m<P&&b<M&&u(k,m,P,b,M,w,x,T,E,y),F!==0&&v(F,j,D),J!==0&&v(J,B,Y),Z<g&&ae<h&&u(L,Z,g,ae,h,w,x,T,E,y)},d=(p,m)=>{if(typeof m!="number")throw new TypeError(`${e}: ${p} typeof ${typeof m} is not a number`);if(!Number.isSafeInteger(m))throw new RangeError(`${e}: ${p} value ${m} is not a safe integer`);if(m<0)throw new RangeError(`${e}: ${p} value ${m} is a negative integer`)},c=(p,m)=>{const g=typeof m;if(g!=="function")throw new TypeError(`${e}: ${p} typeof ${g} is not a function`)};function f(p,m,g,b){d("aLength",p),d("bLength",m),c("isCommon",g),c("foundSubsequence",b);const h=r(0,p,0,m,g);if(h!==0&&b(h,0,0),p!==h||m!==h){const w=h,x=h,T=n(w,p-1,x,m-1,g),E=p-T,y=m-T,v=h+T;p!==v&&m!==v&&u(0,w,E,x,y,!1,[{foundSubsequence:b,isCommon:g}],[t],[t],{aCommonFollowing:t,aCommonPreceding:t,aEndPreceding:t,aStartFollowing:t,bCommonFollowing:t,bCommonPreceding:t,bEndPreceding:t,bStartFollowing:t,nChangeFollowing:t,nChangePreceding:t,nCommonFollowing:t,nCommonPreceding:t}),T!==0&&b(T,E,y)}}return Si}var NM=OM(),Ty=wM(NM);function $M(e,t){return e.replace(/\s+$/,r=>t(r))}function Ju(e,t,r,n,a,i){return e.length!==0?r(`${n} ${$M(e,a)}`):n!==" "?r(n):t&&i.length!==0?r(`${n} ${i}`):""}function Sy(e,t,{aColor:r,aIndicator:n,changeLineTrailingSpaceColor:a,emptyFirstOrLastLinePlaceholder:i}){return Ju(e,t,r,n,a,i)}function _y(e,t,{bColor:r,bIndicator:n,changeLineTrailingSpaceColor:a,emptyFirstOrLastLinePlaceholder:i}){return Ju(e,t,r,n,a,i)}function Py(e,t,{commonColor:r,commonIndicator:n,commonLineTrailingSpaceColor:a,emptyFirstOrLastLinePlaceholder:i}){return Ju(e,t,r,n,a,i)}function rh(e,t,r,n,{patchColor:a}){return a(`@@ -${e+1},${t-e} +${r+1},${n-r} @@`)}function jM(e,t){const r=e.length,n=t.contextLines,a=n+n;let i=r,o=!1,s=0,l=0;for(;l!==r;){const T=l;for(;l!==r&&e[l][0]===qe;)l+=1;if(T!==l)if(T===0)l>n&&(i-=l-n,o=!0);else if(l===r){const E=l-T;E>n&&(i-=E-n,o=!0)}else{const E=l-T;E>a&&(i-=E-a,s+=1)}for(;l!==r&&e[l][0]!==qe;)l+=1}const u=s!==0||o;s!==0?i+=s+1:o&&(i+=1);const d=i-1,c=[];let f=0;u&&c.push("");let p=0,m=0,g=0,b=0;const h=T=>{const E=c.length;c.push(Py(T,E===0||E===d,t)),g+=1,b+=1},w=T=>{const E=c.length;c.push(Sy(T,E===0||E===d,t)),g+=1},x=T=>{const E=c.length;c.push(_y(T,E===0||E===d,t)),b+=1};for(l=0;l!==r;){let T=l;for(;l!==r&&e[l][0]===qe;)l+=1;if(T!==l)if(T===0){l>n&&(T=l-n,p=T,m=T,g=p,b=m);for(let E=T;E!==l;E+=1)h(e[E][1])}else if(l===r){const E=l-T>n?T+n:l;for(let y=T;y!==E;y+=1)h(e[y][1])}else{const E=l-T;if(E>a){const y=T+n;for(let R=T;R!==y;R+=1)h(e[R][1]);c[f]=rh(p,g,m,b,t),f=c.length,c.push("");const v=E-a;p=g+v,m=b+v,g=p,b=m;for(let R=l-n;R!==l;R+=1)h(e[R][1])}else for(let y=T;y!==l;y+=1)h(e[y][1])}for(;l!==r&&e[l][0]===Ue;)w(e[l][1]),l+=1;for(;l!==r&&e[l][0]===Be;)x(e[l][1]),l+=1}return u&&(c[f]=rh(p,g,m,b,t)),c.join(`
92
+ `)}function DM(e,t){return e.map((r,n,a)=>{const i=r[1],o=n===0||n===a.length-1;switch(r[0]){case Ue:return Sy(i,o,t);case Be:return _y(i,o,t);default:return Py(i,o,t)}}).join(`
93
+ `)}const Js=e=>e,ky=5,LM=0;function FM(){return{aAnnotation:"Expected",aColor:Ie.green,aIndicator:"-",bAnnotation:"Received",bColor:Ie.red,bIndicator:"+",changeColor:Ie.inverse,changeLineTrailingSpaceColor:Js,commonColor:Ie.dim,commonIndicator:" ",commonLineTrailingSpaceColor:Js,compareKeys:void 0,contextLines:ky,emptyFirstOrLastLinePlaceholder:"",expand:!0,includeChangeCounts:!1,omitAnnotationLines:!1,patchColor:Ie.yellow,truncateThreshold:LM,truncateAnnotation:"... Diff result is truncated",truncateAnnotationColor:Js}}function BM(e){return e&&typeof e=="function"?e:void 0}function zM(e){return typeof e=="number"&&Number.isSafeInteger(e)&&e>=0?e:ky}function yr(e={}){return{...FM(),...e,compareKeys:BM(e.compareKeys),contextLines:zM(e.contextLines)}}function Tr(e){return e.length===1&&e[0].length===0}function UM(e){let t=0,r=0;return e.forEach(n=>{switch(n[0]){case Ue:t+=1;break;case Be:r+=1;break}}),{a:t,b:r}}function WM({aAnnotation:e,aColor:t,aIndicator:r,bAnnotation:n,bColor:a,bIndicator:i,includeChangeCounts:o,omitAnnotationLines:s},l){if(s)return"";let u="",d="";if(o){const p=String(l.a),m=String(l.b),g=n.length-e.length,b=" ".repeat(Math.max(0,g)),h=" ".repeat(Math.max(0,-g)),w=m.length-p.length,x=" ".repeat(Math.max(0,w)),T=" ".repeat(Math.max(0,-w));u=`${b} ${r} ${x}${p}`,d=`${h} ${i} ${T}${m}`}const c=`${r} ${e}${u}`,f=`${i} ${n}${d}`;return`${t(c)}
94
+ ${a(f)}
95
+
96
+ `}function Xu(e,t,r){return WM(r,UM(e))+(r.expand?DM(e,r):jM(e,r))+(t?r.truncateAnnotationColor(`
97
+ ${r.truncateAnnotation}`):"")}function gs(e,t,r){const n=yr(r),[a,i]=My(Tr(e)?[]:e,Tr(t)?[]:t,n);return Xu(a,i,n)}function VM(e,t,r,n,a){if(Tr(e)&&Tr(r)&&(e=[],r=[]),Tr(t)&&Tr(n)&&(t=[],n=[]),e.length!==r.length||t.length!==n.length)return gs(e,t,a);const[i,o]=My(r,n,a);let s=0,l=0;return i.forEach(u=>{switch(u[0]){case Ue:u[1]=e[s],s+=1;break;case Be:u[1]=t[l],l+=1;break;default:u[1]=t[l],s+=1,l+=1}}),Xu(i,o,yr(a))}function My(e,t,r){const n=r?.truncateThreshold??!1,a=Math.max(Math.floor(r?.truncateThreshold??0),0),i=n?Math.min(e.length,a):e.length,o=n?Math.min(t.length,a):t.length,s=i!==e.length||o!==t.length,l=(p,m)=>e[p]===t[m],u=[];let d=0,c=0;for(Ty(i,o,l,(p,m,g)=>{for(;d!==m;d+=1)u.push(new Ae(Ue,e[d]));for(;c!==g;c+=1)u.push(new Ae(Be,t[c]));for(;p!==0;p-=1,d+=1,c+=1)u.push(new Ae(qe,t[c]))});d!==i;d+=1)u.push(new Ae(Ue,e[d]));for(;c!==o;c+=1)u.push(new Ae(Be,t[c]));return[u,s]}function nh(e){if(e===void 0)return"undefined";if(e===null)return"null";if(Array.isArray(e))return"array";if(typeof e=="boolean")return"boolean";if(typeof e=="function")return"function";if(typeof e=="number")return"number";if(typeof e=="string")return"string";if(typeof e=="bigint")return"bigint";if(typeof e=="object"){if(e!=null){if(e.constructor===RegExp)return"regexp";if(e.constructor===Map)return"map";if(e.constructor===Set)return"set";if(e.constructor===Date)return"date"}return"object"}else if(typeof e=="symbol")return"symbol";throw new Error(`value of unknown type: ${e}`)}function ah(e){return e.includes(`\r
98
+ `)?`\r
99
+ `:`
100
+ `}function HM(e,t,r){const n=r?.truncateThreshold??!1,a=Math.max(Math.floor(r?.truncateThreshold??0),0);let i=e.length,o=t.length;if(n){const p=e.includes(`
101
+ `),m=t.includes(`
102
+ `),g=ah(e),b=ah(t),h=p?`${e.split(g,a).join(g)}
103
+ `:e,w=m?`${t.split(b,a).join(b)}
104
+ `:t;i=h.length,o=w.length}const s=i!==e.length||o!==t.length,l=(p,m)=>e[p]===t[m];let u=0,d=0;const c=[];return Ty(i,o,l,(p,m,g)=>{u!==m&&c.push(new Ae(Ue,e.slice(u,m))),d!==g&&c.push(new Ae(Be,t.slice(d,g))),u=m+p,d=g+p,c.push(new Ae(qe,t.slice(g,d)))}),u!==i&&c.push(new Ae(Ue,e.slice(u))),d!==o&&c.push(new Ae(Be,t.slice(d))),[c,s]}function GM(e,t,r){return t.reduce((n,a)=>n+(a[0]===qe?a[1]:a[0]===e&&a[1].length!==0?r(a[1]):""),"")}class oh{constructor(t,r){re(this,"op");re(this,"line");re(this,"lines");re(this,"changeColor");this.op=t,this.line=[],this.lines=[],this.changeColor=r}pushSubstring(t){this.pushDiff(new Ae(this.op,t))}pushLine(){this.lines.push(this.line.length!==1?new Ae(this.op,GM(this.op,this.line,this.changeColor)):this.line[0][0]===this.op?this.line[0]:new Ae(this.op,this.line[0][1])),this.line.length=0}isLineEmpty(){return this.line.length===0}pushDiff(t){this.line.push(t)}align(t){const r=t[1];if(r.includes(`
105
+ `)){const n=r.split(`
106
+ `),a=n.length-1;n.forEach((i,o)=>{o<a?(this.pushSubstring(i),this.pushLine()):i.length!==0&&this.pushSubstring(i)})}else this.pushDiff(t)}moveLinesTo(t){this.isLineEmpty()||this.pushLine(),t.push(...this.lines),this.lines.length=0}}class KM{constructor(t,r){re(this,"deleteBuffer");re(this,"insertBuffer");re(this,"lines");this.deleteBuffer=t,this.insertBuffer=r,this.lines=[]}pushDiffCommonLine(t){this.lines.push(t)}pushDiffChangeLines(t){const r=t[1].length===0;(!r||this.deleteBuffer.isLineEmpty())&&this.deleteBuffer.pushDiff(t),(!r||this.insertBuffer.isLineEmpty())&&this.insertBuffer.pushDiff(t)}flushChangeLines(){this.deleteBuffer.moveLinesTo(this.lines),this.insertBuffer.moveLinesTo(this.lines)}align(t){const r=t[0],n=t[1];if(n.includes(`
107
+ `)){const a=n.split(`
108
+ `),i=a.length-1;a.forEach((o,s)=>{if(s===0){const l=new Ae(r,o);this.deleteBuffer.isLineEmpty()&&this.insertBuffer.isLineEmpty()?(this.flushChangeLines(),this.pushDiffCommonLine(l)):(this.pushDiffChangeLines(l),this.flushChangeLines())}else s<i?this.pushDiffCommonLine(new Ae(r,o)):o.length!==0&&this.pushDiffChangeLines(new Ae(r,o))})}else this.pushDiffChangeLines(t)}getLines(){return this.flushChangeLines(),this.lines}}function JM(e,t){const r=new oh(Ue,t),n=new oh(Be,t),a=new KM(r,n);return e.forEach(i=>{switch(i[0]){case Ue:r.align(i);break;case Be:n.align(i);break;default:a.align(i)}}),a.getLines()}function XM(e,t){if(t){const r=e.length-1;return e.some((n,a)=>n[0]===qe&&(a!==r||n[1]!==`
109
+ `))}return e.some(r=>r[0]===qe)}function YM(e,t,r){if(e!==t&&e.length!==0&&t.length!==0){const n=e.includes(`
110
+ `)||t.includes(`
111
+ `),[a,i]=Ay(n?`${e}
112
+ `:e,n?`${t}
113
+ `:t,!0,r);if(XM(a,n)){const o=yr(r),s=JM(a,o.changeColor);return Xu(s,i,o)}}return gs(e.split(`
114
+ `),t.split(`
115
+ `),r)}function Ay(e,t,r,n){const[a,i]=HM(e,t,n);return kM(a),[a,i]}function Gl(e,t){const{commonColor:r}=yr(t);return r(e)}const{AsymmetricMatcher:QM,DOMCollection:ZM,DOMElement:eA,Immutable:tA,ReactElement:rA,ReactTestComponent:nA}=Ku,qy=[nA,rA,eA,ZM,tA,QM],Kl={plugins:qy},Iy={callToJSON:!1,maxDepth:10,plugins:qy};function Br(e,t,r){if(Object.is(e,t))return"";const n=nh(e);let a=n,i=!1;if(n==="object"&&typeof e.asymmetricMatch=="function"){if(e.$$typeof!==Symbol.for("jest.asymmetricMatcher")||typeof e.getExpectedType!="function")return;a=e.getExpectedType(),i=a==="string"}if(a!==nh(t)){const{aAnnotation:o,aColor:s,aIndicator:l,bAnnotation:u,bColor:d,bIndicator:c}=yr(r),f=Jl(Iy,r),p=dt(e,f),m=dt(t,f),g=`${s(`${l} ${o}:`)}
116
+ ${p}`,b=`${d(`${c} ${u}:`)}
117
+ ${m}`;return`${g}
118
+
119
+ ${b}`}if(!i)switch(n){case"string":return gs(e.split(`
120
+ `),t.split(`
121
+ `),r);case"boolean":case"number":return aA(e,t,r);case"map":return Xs(ih(e),ih(t),r);case"set":return Xs(sh(e),sh(t),r);default:return Xs(e,t,r)}}function aA(e,t,r){const n=dt(e,Kl),a=dt(t,Kl);return n===a?"":gs(n.split(`
122
+ `),a.split(`
123
+ `),r)}function ih(e){return new Map(Array.from(e.entries()).sort())}function sh(e){return new Set(Array.from(e.values()).sort())}function Xs(e,t,r){let n,a=!1;try{const o=Jl(Kl,r);n=lh(e,t,o,r)}catch{a=!0}const i=Gl(Ey,r);if(n===void 0||n===i){const o=Jl(Iy,r);n=lh(e,t,o,r),n!==i&&!a&&(n=`${Gl(IM,r)}
124
+
125
+ ${n}`)}return n}function Jl(e,t){const{compareKeys:r}=yr(t);return{...e,compareKeys:r}}function lh(e,t,r,n){const a={...r,indent:0},i=dt(e,a),o=dt(t,a);if(i===o)return Gl(Ey,n);{const s=dt(e,r),l=dt(t,r);return VM(s.split(`
126
+ `),l.split(`
127
+ `),i.split(`
128
+ `),o.split(`
129
+ `),n)}}const uh=2e4;function ch(e){return Ji(e)==="Object"&&typeof e.asymmetricMatch=="function"}function dh(e,t){const r=Ji(e),n=Ji(t);return r===n&&(r==="Object"||r==="Array")}function Oy(e,t,r){const{aAnnotation:n,bAnnotation:a}=yr(r);if(typeof e=="string"&&typeof t=="string"&&e.length>0&&t.length>0&&e.length<=uh&&t.length<=uh&&e!==t){if(e.includes(`
130
+ `)||t.includes(`
131
+ `))return YM(t,e,r);const[d]=Ay(t,e),c=d.some(g=>g[0]===qe),f=oA(n,a),p=f(n)+lA(fh(d,Ue,c)),m=f(a)+sA(fh(d,Be,c));return`${p}
132
+ ${m}`}const i=Gm(e,{forceWritable:!0}),o=Gm(t,{forceWritable:!0}),{replacedExpected:s,replacedActual:l}=Ny(i,o);return Br(s,l,r)}function Ny(e,t,r=new WeakSet,n=new WeakSet){return dh(e,t)?r.has(e)||n.has(t)?{replacedActual:e,replacedExpected:t}:(r.add(e),n.add(t),vy(t).forEach(a=>{const i=t[a],o=e[a];if(ch(i))i.asymmetricMatch(o)&&(e[a]=i);else if(ch(o))o.asymmetricMatch(i)&&(t[a]=o);else if(dh(o,i)){const s=Ny(o,i,r,n);e[a]=s.replacedActual,t[a]=s.replacedExpected}}),{replacedActual:e,replacedExpected:t}):{replacedActual:e,replacedExpected:t}}function oA(...e){const t=e.reduce((r,n)=>n.length>r?n.length:r,0);return r=>`${r}: ${" ".repeat(t-r.length)}`}const iA="·";function $y(e){return e.replace(/\s+$/gm,t=>iA.repeat(t.length))}function sA(e){return Ie.red($y(at(e)))}function lA(e){return Ie.green($y(at(e)))}function fh(e,t,r){return e.reduce((n,a)=>n+(a[0]===qe?a[1]:a[0]===t?r?Ie.inverse(a[1]):a[1]:""),"")}function Ni(e,t){if(!e)throw new Error(t)}function Sr(e,t){return typeof t===e}function uA(e){return e instanceof Promise}function Xl(e,t,r){Object.defineProperty(e,t,r)}function Ar(e,t,r){Object.defineProperty(e,t,{value:r})}var Ho=Symbol.for("tinyspy:spy"),cA=new Set,dA=e=>{e.called=!1,e.callCount=0,e.calls=[],e.results=[],e.resolves=[],e.next=[]},fA=e=>(Xl(e,Ho,{value:{reset:()=>dA(e[Ho])}}),e[Ho]),Yl=e=>e[Ho]||fA(e);function pA(e){Ni(Sr("function",e)||Sr("undefined",e),"cannot spy on a non-function value");let t=function(...n){let a=Yl(t);a.called=!0,a.callCount++,a.calls.push(n);let i=a.next.shift();if(i){a.results.push(i);let[d,c]=i;if(d==="ok")return c;throw c}let o,s="ok",l=a.results.length;if(a.impl)try{new.target?o=Reflect.construct(a.impl,n,new.target):o=a.impl.apply(this,n),s="ok"}catch(d){throw o=d,s="error",a.results.push([s,d]),d}let u=[s,o];return uA(o)&&o.then(d=>a.resolves[l]=["ok",d],d=>a.resolves[l]=["error",d]),a.results.push(u),o};Ar(t,"_isMockFunction",!0),Ar(t,"length",e?e.length:0),Ar(t,"name",e&&e.name||"spy");let r=Yl(t);return r.reset(),r.impl=e,t}var ph=(e,t)=>Object.getOwnPropertyDescriptor(e,t),mh=(e,t)=>{t!=null&&typeof t=="function"&&t.prototype!=null&&Object.setPrototypeOf(e.prototype,t.prototype)};function jy(e,t,r){Ni(!Sr("undefined",e),"spyOn could not find an object to spy upon"),Ni(Sr("object",e)||Sr("function",e),"cannot spyOn on a primitive value");let[n,a]=(()=>{if(!Sr("object",t))return[t,"value"];if("getter"in t&&"setter"in t)throw new Error("cannot spy on both getter and setter");if("getter"in t)return[t.getter,"get"];if("setter"in t)return[t.setter,"set"];throw new Error("specify getter or setter to spy on")})(),i=ph(e,n),o=Object.getPrototypeOf(e),s=o&&ph(o,n),l=i||s;Ni(l||n in e,`${String(n)} does not exist`);let u=!1;a==="value"&&l&&!l.value&&l.get&&(a="get",u=!0,r=l.get());let d;l?d=l[a]:a!=="value"?d=()=>e[n]:d=e[n];let c=g=>{let{value:b,...h}=l||{configurable:!0,writable:!0};a!=="value"&&delete h.writable,h[a]=g,Xl(e,n,h)},f=()=>l?Xl(e,n,l):c(d);r||(r=d);let p=pA(r);a==="value"&&mh(p,d);let m=p[Ho];return Ar(m,"restore",f),Ar(m,"getOriginal",()=>u?d():d),Ar(m,"willCall",g=>(m.impl=g,p)),c(u?()=>(mh(p,r),p):p),cA.add(p),p}const $i=new Set;function Dy(e){return typeof e=="function"&&"_isMockFunction"in e&&e._isMockFunction}function mA(e,t,r){const a=r?{[{get:"getter",set:"setter"}[r]]:t}:t,i=jy(e,a);return Ly(i)}let hA=0;function Ly(e){const t=e;let r,n=[],a=[],i=[];const o=Yl(e),s={get calls(){return o.calls},get contexts(){return a},get instances(){return n},get invocationCallOrder(){return i},get results(){return o.results.map(([p,m])=>({type:p==="error"?"throw":"return",value:m}))},get settledResults(){return o.resolves.map(([p,m])=>({type:p==="error"?"rejected":"fulfilled",value:m}))},get lastCall(){return o.calls[o.calls.length-1]}};let l=[],u=!1;function d(...p){return n.push(this),a.push(this),i.push(++hA),(u?r:l.shift()||r||o.getOriginal()||(()=>{})).apply(this,p)}let c=t.name;t.getMockName=()=>c||"vi.fn()",t.mockName=p=>(c=p,t),t.mockClear=()=>(o.reset(),n=[],a=[],i=[],t),t.mockReset=()=>(t.mockClear(),r=()=>{},l=[],t),t.mockRestore=()=>(t.mockReset(),o.restore(),r=void 0,t),t.getMockImplementation=()=>r,t.mockImplementation=p=>(r=p,o.willCall(d),t),t.mockImplementationOnce=p=>(l.push(p),t);function f(p,m){const g=r;r=p,o.willCall(d),u=!0;const b=()=>{r=g,u=!1},h=m();return h instanceof Promise?h.then(()=>(b(),t)):(b(),t)}return t.withImplementation=f,t.mockReturnThis=()=>t.mockImplementation(function(){return this}),t.mockReturnValue=p=>t.mockImplementation(()=>p),t.mockReturnValueOnce=p=>t.mockImplementationOnce(()=>p),t.mockResolvedValue=p=>t.mockImplementation(()=>Promise.resolve(p)),t.mockResolvedValueOnce=p=>t.mockImplementationOnce(()=>Promise.resolve(p)),t.mockRejectedValue=p=>t.mockImplementation(()=>Promise.reject(p)),t.mockRejectedValueOnce=p=>t.mockImplementationOnce(()=>Promise.reject(p)),Object.defineProperty(t,"mock",{get:()=>s}),o.willCall(d),$i.add(t),t}function gA(e){const t=Ly(jy({spy:e||function(){}},"spy"));return e&&t.mockImplementation(e),t}const bA="@@__IMMUTABLE_RECORD__@@",yA="@@__IMMUTABLE_ITERABLE__@@";function vA(e){return e&&(e[yA]||e[bA])}const wA=Object.getPrototypeOf({});function hh(e){return e instanceof Error?`<unserializable>: ${e.message}`:typeof e=="string"?`<unserializable>: ${e}`:"<unserializable>"}function _r(e,t=new WeakMap){if(!e||typeof e=="string")return e;if(typeof e=="function")return`Function<${e.name||"anonymous"}>`;if(typeof e=="symbol")return e.toString();if(typeof e!="object")return e;if(vA(e))return _r(e.toJSON(),t);if(e instanceof Promise||e.constructor&&e.constructor.prototype==="AsyncFunction")return"Promise";if(typeof Element<"u"&&e instanceof Element)return e.tagName;if(typeof e.asymmetricMatch=="function")return`${e.toString()} ${yy(e.sample)}`;if(typeof e.toJSON=="function")return _r(e.toJSON(),t);if(t.has(e))return t.get(e);if(Array.isArray(e)){const r=new Array(e.length);return t.set(e,r),e.forEach((n,a)=>{try{r[a]=_r(n,t)}catch(i){r[a]=hh(i)}}),r}else{const r=Object.create(null);t.set(e,r);let n=e;for(;n&&n!==wA;)Object.getOwnPropertyNames(n).forEach(a=>{if(!(a in r))try{r[a]=_r(e[a],t)}catch(i){delete r[a],r[a]=hh(i)}}),n=Object.getPrototypeOf(n);return r}}function xA(e){return e.replace(/__(vite_ssr_import|vi_import)_\d+__\./g,"")}function Fy(e,t,r=new WeakSet){if(!e||typeof e!="object")return{message:String(e)};const n=e;n.stack&&(n.stackStr=String(n.stack)),n.name&&(n.nameStr=String(n.name)),(n.showDiff||n.showDiff===void 0&&n.expected!==void 0&&n.actual!==void 0)&&(n.diff=Oy(n.actual,n.expected,{...t,...n.diffOptions})),typeof n.expected!="string"&&(n.expected=at(n.expected,10)),typeof n.actual!="string"&&(n.actual=at(n.actual,10));try{typeof n.message=="string"&&(n.message=xA(n.message))}catch{}try{!r.has(n)&&typeof n.cause=="object"&&(r.add(n),n.cause=Fy(n.cause,t,r))}catch{}try{return _r(n)}catch(a){return _r(new Error(`Failed to fully serialize error: ${a?.message}
133
+ Inner error message: ${n?.message}`))}}var By=Object.defineProperty,$=(e,t)=>By(e,"name",{value:t,configurable:!0}),Yu=(e,t)=>{for(var r in t)By(e,r,{get:t[r],enumerable:!0})},Ke={};Yu(Ke,{addChainableMethod:()=>uc,addLengthGuard:()=>fi,addMethod:()=>ic,addProperty:()=>oc,checkError:()=>et,compareByInspect:()=>Zi,eql:()=>mv,expectTypes:()=>Ky,flag:()=>ue,getActual:()=>ys,getMessage:()=>ec,getName:()=>ws,getOperator:()=>pc,getOwnEnumerableProperties:()=>fc,getOwnEnumerablePropertySymbols:()=>dc,getPathInfo:()=>ac,hasProperty:()=>vs,inspect:()=>ge,isNaN:()=>es,isNumeric:()=>Fe,isProxyEnabled:()=>di,isRegExp:()=>ts,objDisplay:()=>lr,overwriteChainableMethod:()=>cc,overwriteMethod:()=>lc,overwriteProperty:()=>sc,proxify:()=>zr,test:()=>Qu,transferFlags:()=>mt,type:()=>Te});var et={};Yu(et,{compatibleConstructor:()=>Wy,compatibleInstance:()=>Uy,compatibleMessage:()=>Vy,getConstructorName:()=>Hy,getMessage:()=>Gy});function bs(e){return e instanceof Error||Object.prototype.toString.call(e)==="[object Error]"}$(bs,"isErrorInstance");function zy(e){return Object.prototype.toString.call(e)==="[object RegExp]"}$(zy,"isRegExp");function Uy(e,t){return bs(t)&&e===t}$(Uy,"compatibleInstance");function Wy(e,t){return bs(t)?e.constructor===t.constructor||e instanceof t.constructor:(typeof t=="object"||typeof t=="function")&&t.prototype?e.constructor===t||e instanceof t:!1}$(Wy,"compatibleConstructor");function Vy(e,t){const r=typeof e=="string"?e:e.message;return zy(t)?t.test(r):typeof t=="string"?r.indexOf(t)!==-1:!1}$(Vy,"compatibleMessage");function Hy(e){let t=e;return bs(e)?t=e.constructor.name:typeof e=="function"&&(t=e.name,t===""&&(t=new e().name||t)),t}$(Hy,"getConstructorName");function Gy(e){let t="";return e&&e.message?t=e.message:typeof e=="string"&&(t=e),t}$(Gy,"getMessage");function ue(e,t,r){let n=e.__flags||(e.__flags=Object.create(null));if(arguments.length===3)n[t]=r;else return n[t]}$(ue,"flag");function Qu(e,t){let r=ue(e,"negate"),n=t[0];return r?!n:n}$(Qu,"test");function Te(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)}$(Te,"type");var RA="captureStackTrace"in Error,dr,be=(dr=class extends Error{constructor(r="Unspecified AssertionError",n,a){super(r);re(this,"message");this.message=r,RA&&Error.captureStackTrace(this,a||dr);for(const i in n)i in this||(this[i]=n[i])}get name(){return"AssertionError"}get ok(){return!1}toJSON(r){return{...this,name:this.name,message:this.message,ok:!1,stack:r!==!1?this.stack:void 0}}},$(dr,"AssertionError"),dr);function Ky(e,t){let r=ue(e,"message"),n=ue(e,"ssfi");r=r?r+": ":"",e=ue(e,"object"),t=t.map(function(o){return o.toLowerCase()}),t.sort();let a=t.map(function(o,s){let l=~["a","e","i","o","u"].indexOf(o.charAt(0))?"an":"a";return(t.length>1&&s===t.length-1?"or ":"")+l+" "+o}).join(", "),i=Te(e).toLowerCase();if(!t.some(function(o){return i===o}))throw new be(r+"object tested must be "+a+", but "+i+" given",void 0,n)}$(Ky,"expectTypes");function ys(e,t){return t.length>4?t[4]:e._obj}$(ys,"getActual");var gh={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"]},CA={special:"cyan",number:"yellow",bigint:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",symbol:"green",date:"magenta",regexp:"red"},jr="…";function Jy(e,t){const r=gh[CA[t]]||gh[t]||"";return r?`\x1B[${r[0]}m${String(e)}\x1B[${r[1]}m`:String(e)}$(Jy,"colorise");function Xy({showHidden:e=!1,depth:t=2,colors:r=!1,customInspect:n=!0,showProxy:a=!1,maxArrayLength:i=1/0,breakLength:o=1/0,seen:s=[],truncate:l=1/0,stylize:u=String}={},d){const c={showHidden:!!e,depth:Number(t),colors:!!r,customInspect:!!n,showProxy:!!a,maxArrayLength:Number(i),breakLength:Number(o),truncate:Number(l),seen:s,inspect:d,stylize:u};return c.colors&&(c.stylize=Jy),c}$(Xy,"normaliseOptions");function Yy(e){return e>="\uD800"&&e<="\uDBFF"}$(Yy,"isHighSurrogate");function Lt(e,t,r=jr){e=String(e);const n=r.length,a=e.length;if(n>t&&a>n)return r;if(a>t&&a>n){let i=t-n;return i>0&&Yy(e[i-1])&&(i=i-1),`${e.slice(0,i)}${r}`}return e}$(Lt,"truncate");function ot(e,t,r,n=", "){r=r||t.inspect;const a=e.length;if(a===0)return"";const i=t.truncate;let o="",s="",l="";for(let u=0;u<a;u+=1){const d=u+1===e.length,c=u+2===e.length;l=`${jr}(${e.length-u})`;const f=e[u];t.truncate=i-o.length-(d?0:n.length);const p=s||r(f,t)+(d?"":n),m=o.length+p.length,g=m+l.length;if(d&&m>i&&o.length+l.length<=i||!d&&!c&&g>i||(s=d?"":r(e[u+1],t)+(c?"":n),!d&&c&&g>i&&m+s.length>i))break;if(o+=p,!d&&!c&&m+s.length>=i){l=`${jr}(${e.length-u-1})`;break}l=""}return`${o}${l}`}$(ot,"inspectList");function Qy(e){return e.match(/^[a-zA-Z_][a-zA-Z_0-9]*$/)?e:JSON.stringify(e).replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'")}$(Qy,"quoteComplexKey");function Dr([e,t],r){return r.truncate-=2,typeof e=="string"?e=Qy(e):typeof e!="number"&&(e=`[${r.inspect(e,r)}]`),r.truncate-=e.length,t=r.inspect(t,r),`${e}: ${t}`}$(Dr,"inspectProperty");function Zy(e,t){const r=Object.keys(e).slice(e.length);if(!e.length&&!r.length)return"[]";t.truncate-=4;const n=ot(e,t);t.truncate-=n.length;let a="";return r.length&&(a=ot(r.map(i=>[i,e[i]]),t,Dr)),`[ ${n}${a?`, ${a}`:""} ]`}$(Zy,"inspectArray");var EA=$(e=>typeof Buffer=="function"&&e instanceof Buffer?"Buffer":e[Symbol.toStringTag]?e[Symbol.toStringTag]:e.constructor.name,"getArrayName");function yt(e,t){const r=EA(e);t.truncate-=r.length+4;const n=Object.keys(e).slice(e.length);if(!e.length&&!n.length)return`${r}[]`;let a="";for(let o=0;o<e.length;o++){const s=`${t.stylize(Lt(e[o],t.truncate),"number")}${o===e.length-1?"":", "}`;if(t.truncate-=s.length,e[o]!==e.length&&t.truncate<=3){a+=`${jr}(${e.length-e[o]+1})`;break}a+=s}let i="";return n.length&&(i=ot(n.map(o=>[o,e[o]]),t,Dr)),`${r}[ ${a}${i?`, ${i}`:""} ]`}$(yt,"inspectTypedArray");function ev(e,t){const r=e.toJSON();if(r===null)return"Invalid Date";const n=r.split("T"),a=n[0];return t.stylize(`${a}T${Lt(n[1],t.truncate-a.length-1)}`,"date")}$(ev,"inspectDate");function Ql(e,t){const r=e[Symbol.toStringTag]||"Function",n=e.name;return n?t.stylize(`[${r} ${Lt(n,t.truncate-11)}]`,"special"):t.stylize(`[${r}]`,"special")}$(Ql,"inspectFunction");function tv([e,t],r){return r.truncate-=4,e=r.inspect(e,r),r.truncate-=e.length,t=r.inspect(t,r),`${e} => ${t}`}$(tv,"inspectMapEntry");function rv(e){const t=[];return e.forEach((r,n)=>{t.push([n,r])}),t}$(rv,"mapToEntries");function nv(e,t){return e.size===0?"Map{}":(t.truncate-=7,`Map{ ${ot(rv(e),t,tv)} }`)}$(nv,"inspectMap");var TA=Number.isNaN||(e=>e!==e);function Zl(e,t){return TA(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(Lt(String(e),t.truncate),"number")}$(Zl,"inspectNumber");function eu(e,t){let r=Lt(e.toString(),t.truncate-1);return r!==jr&&(r+="n"),t.stylize(r,"bigint")}$(eu,"inspectBigInt");function av(e,t){const r=e.toString().split("/")[2],n=t.truncate-(2+r.length),a=e.source;return t.stylize(`/${Lt(a,n)}/${r}`,"regexp")}$(av,"inspectRegExp");function ov(e){const t=[];return e.forEach(r=>{t.push(r)}),t}$(ov,"arrayFromSet");function iv(e,t){return e.size===0?"Set{}":(t.truncate-=7,`Set{ ${ot(ov(e),t)} }`)}$(iv,"inspectSet");var bh=new RegExp("['\\u0000-\\u001f\\u007f-\\u009f\\u00ad\\u0600-\\u0604\\u070f\\u17b4\\u17b5\\u200c-\\u200f\\u2028-\\u202f\\u2060-\\u206f\\ufeff\\ufff0-\\uffff]","g"),SA={"\b":"\\b"," ":"\\t","\n":"\\n","\f":"\\f","\r":"\\r","'":"\\'","\\":"\\\\"},_A=16;function sv(e){return SA[e]||`\\u${`0000${e.charCodeAt(0).toString(_A)}`.slice(-4)}`}$(sv,"escape");function tu(e,t){return bh.test(e)&&(e=e.replace(bh,sv)),t.stylize(`'${Lt(e,t.truncate-2)}'`,"string")}$(tu,"inspectString");function ru(e){return"description"in Symbol.prototype?e.description?`Symbol(${e.description})`:"Symbol()":e.toString()}$(ru,"inspectSymbol");var PA=$(()=>"Promise{…}","getPromiseValue"),kA=PA;function Go(e,t){const r=Object.getOwnPropertyNames(e),n=Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(e):[];if(r.length===0&&n.length===0)return"{}";if(t.truncate-=4,t.seen=t.seen||[],t.seen.includes(e))return"[Circular]";t.seen.push(e);const a=ot(r.map(s=>[s,e[s]]),t,Dr),i=ot(n.map(s=>[s,e[s]]),t,Dr);t.seen.pop();let o="";return a&&i&&(o=", "),`{ ${a}${o}${i} }`}$(Go,"inspectObject");var Ys=typeof Symbol<"u"&&Symbol.toStringTag?Symbol.toStringTag:!1;function lv(e,t){let r="";return Ys&&Ys in e&&(r=e[Ys]),r=r||e.constructor.name,(!r||r==="_class")&&(r="<Anonymous Class>"),t.truncate-=r.length,`${r}${Go(e,t)}`}$(lv,"inspectClass");function uv(e,t){return e.length===0?"Arguments[]":(t.truncate-=13,`Arguments[ ${ot(e,t)} ]`)}$(uv,"inspectArguments");var MA=["stack","line","column","name","message","fileName","lineNumber","columnNumber","number","description","cause"];function cv(e,t){const r=Object.getOwnPropertyNames(e).filter(o=>MA.indexOf(o)===-1),n=e.name;t.truncate-=n.length;let a="";if(typeof e.message=="string"?a=Lt(e.message,t.truncate):r.unshift("message"),a=a?`: ${a}`:"",t.truncate-=a.length+5,t.seen=t.seen||[],t.seen.includes(e))return"[Circular]";t.seen.push(e);const i=ot(r.map(o=>[o,e[o]]),t,Dr);return`${n}${a}${i?` { ${i} }`:""}`}$(cv,"inspectObject");function dv([e,t],r){return r.truncate-=3,t?`${r.stylize(String(e),"yellow")}=${r.stylize(`"${t}"`,"string")}`:`${r.stylize(String(e),"yellow")}`}$(dv,"inspectAttribute");function Xi(e,t){return ot(e,t,fv,`
134
+ `)}$(Xi,"inspectNodeCollection");function fv(e,t){switch(e.nodeType){case 1:return Zu(e,t);case 3:return t.inspect(e.data,t);default:return t.inspect(e,t)}}$(fv,"inspectNode");function Zu(e,t){const r=e.getAttributeNames(),n=e.tagName.toLowerCase(),a=t.stylize(`<${n}`,"special"),i=t.stylize(">","special"),o=t.stylize(`</${n}>`,"special");t.truncate-=n.length*2+5;let s="";r.length>0&&(s+=" ",s+=ot(r.map(d=>[d,e.getAttribute(d)]),t,dv," ")),t.truncate-=s.length;const l=t.truncate;let u=Xi(e.children,t);return u&&u.length>l&&(u=`${jr}(${e.children.length})`),`${a}${s}${i}${u}${o}`}$(Zu,"inspectHTML");var AA=typeof Symbol=="function"&&typeof Symbol.for=="function",Qs=AA?Symbol.for("chai/inspect"):"@@chai/inspect",Zs=Symbol.for("nodejs.util.inspect.custom"),yh=new WeakMap,vh={},wh={undefined:$((e,t)=>t.stylize("undefined","undefined"),"undefined"),null:$((e,t)=>t.stylize("null","null"),"null"),boolean:$((e,t)=>t.stylize(String(e),"boolean"),"boolean"),Boolean:$((e,t)=>t.stylize(String(e),"boolean"),"Boolean"),number:Zl,Number:Zl,bigint:eu,BigInt:eu,string:tu,String:tu,function:Ql,Function:Ql,symbol:ru,Symbol:ru,Array:Zy,Date:ev,Map:nv,Set:iv,RegExp:av,Promise:kA,WeakSet:$((e,t)=>t.stylize("WeakSet{…}","special"),"WeakSet"),WeakMap:$((e,t)=>t.stylize("WeakMap{…}","special"),"WeakMap"),Arguments:uv,Int8Array:yt,Uint8Array:yt,Uint8ClampedArray:yt,Int16Array:yt,Uint16Array:yt,Int32Array:yt,Uint32Array:yt,Float32Array:yt,Float64Array:yt,Generator:$(()=>"","Generator"),DataView:$(()=>"","DataView"),ArrayBuffer:$(()=>"","ArrayBuffer"),Error:cv,HTMLCollection:Xi,NodeList:Xi},qA=$((e,t,r)=>Qs in e&&typeof e[Qs]=="function"?e[Qs](t):Zs in e&&typeof e[Zs]=="function"?e[Zs](t.depth,t):"inspect"in e&&typeof e.inspect=="function"?e.inspect(t.depth,t):"constructor"in e&&yh.has(e.constructor)?yh.get(e.constructor)(e,t):vh[r]?vh[r](e,t):"","inspectCustom"),IA=Object.prototype.toString;function Yi(e,t={}){const r=Xy(t,Yi),{customInspect:n}=r;let a=e===null?"null":typeof e;if(a==="object"&&(a=IA.call(e).slice(8,-1)),a in wh)return wh[a](e,r);if(n&&e){const o=qA(e,r,a);if(o)return typeof o=="string"?o:Yi(o,r)}const i=e?Object.getPrototypeOf(e):!1;return i===Object.prototype||i===null?Go(e,r):e&&typeof HTMLElement=="function"&&e instanceof HTMLElement?Zu(e,r):"constructor"in e?e.constructor!==Object?lv(e,r):Go(e,r):e===Object(e)?Go(e,r):r.stylize(String(e),a)}$(Yi,"inspect");var Ge={includeStack:!1,showDiff:!0,truncateThreshold:40,useProxy:!0,proxyExcludedKeys:["then","catch","inspect","toJSON"],deepEqual:null};function ge(e,t,r,n){let a={colors:n,depth:typeof r>"u"?2:r,showHidden:t,truncate:Ge.truncateThreshold?Ge.truncateThreshold:1/0};return Yi(e,a)}$(ge,"inspect");function lr(e){let t=ge(e),r=Object.prototype.toString.call(e);if(Ge.truncateThreshold&&t.length>=Ge.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}$(lr,"objDisplay");function ec(e,t){let r=ue(e,"negate"),n=ue(e,"object"),a=t[3],i=ys(e,t),o=r?t[2]:t[1],s=ue(e,"message");return typeof o=="function"&&(o=o()),o=o||"",o=o.replace(/#\{this\}/g,function(){return lr(n)}).replace(/#\{act\}/g,function(){return lr(i)}).replace(/#\{exp\}/g,function(){return lr(a)}),s?s+": "+o:o}$(ec,"getMessage");function mt(e,t,r){let n=e.__flags||(e.__flags=Object.create(null));t.__flags||(t.__flags=Object.create(null)),r=arguments.length===3?r:!0;for(let a in n)(r||a!=="object"&&a!=="ssfi"&&a!=="lockSsfi"&&a!="message")&&(t.__flags[a]=n[a])}$(mt,"transferFlags");function nu(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)}$(nu,"type");function tc(){this._key="chai/deep-eql__"+Math.random()+Date.now()}$(tc,"FakeMap");tc.prototype={get:$(function(t){return t[this._key]},"get"),set:$(function(t,r){Object.isExtensible(t)&&Object.defineProperty(t,this._key,{value:r,configurable:!0})},"set")};var pv=typeof WeakMap=="function"?WeakMap:tc;function au(e,t,r){if(!r||hr(e)||hr(t))return null;var n=r.get(e);if(n){var a=n.get(t);if(typeof a=="boolean")return a}return null}$(au,"memoizeCompare");function Wo(e,t,r,n){if(!(!r||hr(e)||hr(t))){var a=r.get(e);a?a.set(t,n):(a=new pv,a.set(t,n),r.set(e,a))}}$(Wo,"memoizeSet");var mv=ci;function ci(e,t,r){if(r&&r.comparator)return ou(e,t,r);var n=rc(e,t);return n!==null?n:ou(e,t,r)}$(ci,"deepEqual");function rc(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t?!0:hr(e)||hr(t)?!1:null}$(rc,"simpleEqual");function ou(e,t,r){r=r||{},r.memoize=r.memoize===!1?!1:r.memoize||new pv;var n=r&&r.comparator,a=au(e,t,r.memoize);if(a!==null)return a;var i=au(t,e,r.memoize);if(i!==null)return i;if(n){var o=n(e,t);if(o===!1||o===!0)return Wo(e,t,r.memoize,o),o;var s=rc(e,t);if(s!==null)return s}var l=nu(e);if(l!==nu(t))return Wo(e,t,r.memoize,!1),!1;Wo(e,t,r.memoize,!0);var u=hv(e,t,l,r);return Wo(e,t,r.memoize,u),u}$(ou,"extensiveDeepEqual");function hv(e,t,r,n){switch(r){case"String":case"Number":case"Boolean":case"Date":return ci(e.valueOf(),t.valueOf());case"Promise":case"Symbol":case"function":case"WeakMap":case"WeakSet":return e===t;case"Error":return nc(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 Ht(e,t,n);case"RegExp":return gv(e,t);case"Generator":return bv(e,t,n);case"DataView":return Ht(new Uint8Array(e.buffer),new Uint8Array(t.buffer),n);case"ArrayBuffer":return Ht(new Uint8Array(e),new Uint8Array(t),n);case"Set":return iu(e,t,n);case"Map":return iu(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 vv(e,t,n)}}$(hv,"extensiveDeepEqualByType");function gv(e,t){return e.toString()===t.toString()}$(gv,"regexpEqual");function iu(e,t,r){try{if(e.size!==t.size)return!1;if(e.size===0)return!0}catch{return!1}var n=[],a=[];return e.forEach($(function(o,s){n.push([o,s])},"gatherEntries")),t.forEach($(function(o,s){a.push([o,s])},"gatherEntries")),Ht(n.sort(),a.sort(),r)}$(iu,"entriesEqual");function Ht(e,t,r){var n=e.length;if(n!==t.length)return!1;if(n===0)return!0;for(var a=-1;++a<n;)if(ci(e[a],t[a],r)===!1)return!1;return!0}$(Ht,"iterableEqual");function bv(e,t,r){return Ht(Qi(e),Qi(t),r)}$(bv,"generatorEqual");function yv(e){return typeof Symbol<"u"&&typeof e=="object"&&typeof Symbol.iterator<"u"&&typeof e[Symbol.iterator]=="function"}$(yv,"hasIteratorFunction");function su(e){if(yv(e))try{return Qi(e[Symbol.iterator]())}catch{return[]}return[]}$(su,"getIteratorEntries");function Qi(e){for(var t=e.next(),r=[t.value];t.done===!1;)t=e.next(),r.push(t.value);return r}$(Qi,"getGeneratorEntries");function lu(e){var t=[];for(var r in e)t.push(r);return t}$(lu,"getEnumerableKeys");function uu(e){for(var t=[],r=Object.getOwnPropertySymbols(e),n=0;n<r.length;n+=1){var a=r[n];Object.getOwnPropertyDescriptor(e,a).enumerable&&t.push(a)}return t}$(uu,"getEnumerableSymbols");function nc(e,t,r,n){var a=r.length;if(a===0)return!0;for(var i=0;i<a;i+=1)if(ci(e[r[i]],t[r[i]],n)===!1)return!1;return!0}$(nc,"keysEqual");function vv(e,t,r){var n=lu(e),a=lu(t),i=uu(e),o=uu(t);if(n=n.concat(i),a=a.concat(o),n.length&&n.length===a.length)return Ht(cu(n).sort(),cu(a).sort())===!1?!1:nc(e,t,n,r);var s=su(e),l=su(t);return s.length&&s.length===l.length?(s.sort(),l.sort(),Ht(s,l,r)):n.length===0&&s.length===0&&a.length===0&&l.length===0}$(vv,"objectEqual");function hr(e){return e===null||typeof e!="object"}$(hr,"isPrimitive");function cu(e){return e.map($(function(r){return typeof r=="symbol"?r.toString():r},"mapSymbol"))}$(cu,"mapSymbols");function vs(e,t){return typeof e>"u"||e===null?!1:t in Object(e)}$(vs,"hasProperty");function wv(e){return e.replace(/([^\\])\[/g,"$1.[").match(/(\\\.|[^.]+?)+/g).map(n=>{if(n==="constructor"||n==="__proto__"||n==="prototype")return{};const i=/^\[(\d+)\]$/.exec(n);let o=null;return i?o={i:parseFloat(i[1])}:o={p:n.replace(/\\([.[\]])/g,"$1")},o})}$(wv,"parsePath");function du(e,t,r){let n=e,a=null;r=typeof r>"u"?t.length:r;for(let i=0;i<r;i++){const o=t[i];n&&(typeof o.p>"u"?n=n[o.i]:n=n[o.p],i===r-1&&(a=n))}return a}$(du,"internalGetPathValue");function ac(e,t){const r=wv(t),n=r[r.length-1],a={parent:r.length>1?du(e,r,r.length-1):e,name:n.p||n.i,value:du(e,r)};return a.exists=vs(a.parent,a.name),a}$(ac,"getPathInfo");var fr,S=(fr=class{constructor(t,r,n,a){re(this,"__flags",{});return ue(this,"ssfi",n||fr),ue(this,"lockSsfi",a),ue(this,"object",t),ue(this,"message",r),ue(this,"eql",Ge.deepEqual||mv),zr(this)}static get includeStack(){return console.warn("Assertion.includeStack is deprecated, use chai.config.includeStack instead."),Ge.includeStack}static set includeStack(t){console.warn("Assertion.includeStack is deprecated, use chai.config.includeStack instead."),Ge.includeStack=t}static get showDiff(){return console.warn("Assertion.showDiff is deprecated, use chai.config.showDiff instead."),Ge.showDiff}static set showDiff(t){console.warn("Assertion.showDiff is deprecated, use chai.config.showDiff instead."),Ge.showDiff=t}static addProperty(t,r){oc(this.prototype,t,r)}static addMethod(t,r){ic(this.prototype,t,r)}static addChainableMethod(t,r,n){uc(this.prototype,t,r,n)}static overwriteProperty(t,r){sc(this.prototype,t,r)}static overwriteMethod(t,r){lc(this.prototype,t,r)}static overwriteChainableMethod(t,r,n){cc(this.prototype,t,r,n)}assert(t,r,n,a,i,o){const s=Qu(this,arguments);if(o!==!1&&(o=!0),a===void 0&&i===void 0&&(o=!1),Ge.showDiff!==!0&&(o=!1),!s){r=ec(this,arguments);const u={actual:ys(this,arguments),expected:a,showDiff:o},d=pc(this,arguments);throw d&&(u.operator=d),new be(r,u,Ge.includeStack?this.assert:ue(this,"ssfi"))}}get _obj(){return ue(this,"object")}set _obj(t){ue(this,"object",t)}},$(fr,"Assertion"),fr);function di(){return Ge.useProxy&&typeof Proxy<"u"&&typeof Reflect<"u"}$(di,"isProxyEnabled");function oc(e,t,r){r=r===void 0?function(){}:r,Object.defineProperty(e,t,{get:$(function n(){!di()&&!ue(this,"lockSsfi")&&ue(this,"ssfi",n);let a=r.call(this);if(a!==void 0)return a;let i=new S;return mt(this,i),i},"propertyGetter"),configurable:!0})}$(oc,"addProperty");var OA=Object.getOwnPropertyDescriptor(function(){},"length");function fi(e,t,r){return OA.configurable&&Object.defineProperty(e,"length",{get:$(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}$(fi,"addLengthGuard");function xv(e){let t=Object.getOwnPropertyNames(e);function r(a){t.indexOf(a)===-1&&t.push(a)}$(r,"addProperty");let n=Object.getPrototypeOf(e);for(;n!==null;)Object.getOwnPropertyNames(n).forEach(r),n=Object.getPrototypeOf(n);return t}$(xv,"getProperties");var xh=["__flags","__methods","_obj","assert"];function zr(e,t){return di()?new Proxy(e,{get:$(function r(n,a){if(typeof a=="string"&&Ge.proxyExcludedKeys.indexOf(a)===-1&&!Reflect.has(n,a)){if(t)throw Error("Invalid Chai property: "+t+"."+a+'. See docs for proper usage of "'+t+'".');let i=null,o=4;throw xv(n).forEach(function(s){if(!Object.prototype.hasOwnProperty(s)&&xh.indexOf(s)===-1){let l=Rv(a,s,o);l<o&&(i=s,o=l)}}),Error(i!==null?"Invalid Chai property: "+a+'. Did you mean "'+i+'"?':"Invalid Chai property: "+a)}return xh.indexOf(a)===-1&&!ue(n,"lockSsfi")&&ue(n,"ssfi",r),Reflect.get(n,a)},"proxyGetter")}):e}$(zr,"proxify");function Rv(e,t,r){if(Math.abs(e.length-t.length)>=r)return r;let n=[];for(let a=0;a<=e.length;a++)n[a]=Array(t.length+1).fill(0),n[a][0]=a;for(let a=0;a<t.length;a++)n[0][a]=a;for(let a=1;a<=e.length;a++){let i=e.charCodeAt(a-1);for(let o=1;o<=t.length;o++){if(Math.abs(a-o)>=r){n[a][o]=r;continue}n[a][o]=Math.min(n[a-1][o]+1,n[a][o-1]+1,n[a-1][o-1]+(i===t.charCodeAt(o-1)?0:1))}}return n[e.length][t.length]}$(Rv,"stringDistanceCapped");function ic(e,t,r){let n=$(function(){ue(this,"lockSsfi")||ue(this,"ssfi",n);let a=r.apply(this,arguments);if(a!==void 0)return a;let i=new S;return mt(this,i),i},"methodWrapper");fi(n,t,!1),e[t]=zr(n,t)}$(ic,"addMethod");function sc(e,t,r){let n=Object.getOwnPropertyDescriptor(e,t),a=$(function(){},"_super");n&&typeof n.get=="function"&&(a=n.get),Object.defineProperty(e,t,{get:$(function i(){!di()&&!ue(this,"lockSsfi")&&ue(this,"ssfi",i);let o=ue(this,"lockSsfi");ue(this,"lockSsfi",!0);let s=r(a).call(this);if(ue(this,"lockSsfi",o),s!==void 0)return s;let l=new S;return mt(this,l),l},"overwritingPropertyGetter"),configurable:!0})}$(sc,"overwriteProperty");function lc(e,t,r){let n=e[t],a=$(function(){throw new Error(t+" is not a function")},"_super");n&&typeof n=="function"&&(a=n);let i=$(function(){ue(this,"lockSsfi")||ue(this,"ssfi",i);let o=ue(this,"lockSsfi");ue(this,"lockSsfi",!0);let s=r(a).apply(this,arguments);if(ue(this,"lockSsfi",o),s!==void 0)return s;let l=new S;return mt(this,l),l},"overwritingMethodWrapper");fi(i,t,!1),e[t]=zr(i,t)}$(lc,"overwriteMethod");var NA=typeof Object.setPrototypeOf=="function",Rh=$(function(){},"testFn"),$A=Object.getOwnPropertyNames(Rh).filter(function(e){let t=Object.getOwnPropertyDescriptor(Rh,e);return typeof t!="object"?!0:!t.configurable}),jA=Function.prototype.call,DA=Function.prototype.apply;function uc(e,t,r,n){typeof n!="function"&&(n=$(function(){},"chainingBehavior"));let a={method:r,chainingBehavior:n};e.__methods||(e.__methods={}),e.__methods[t]=a,Object.defineProperty(e,t,{get:$(function(){a.chainingBehavior.call(this);let o=$(function(){ue(this,"lockSsfi")||ue(this,"ssfi",o);let s=a.method.apply(this,arguments);if(s!==void 0)return s;let l=new S;return mt(this,l),l},"chainableMethodWrapper");if(fi(o,t,!0),NA){let s=Object.create(this);s.call=jA,s.apply=DA,Object.setPrototypeOf(o,s)}else Object.getOwnPropertyNames(e).forEach(function(l){if($A.indexOf(l)!==-1)return;let u=Object.getOwnPropertyDescriptor(e,l);Object.defineProperty(o,l,u)});return mt(this,o),zr(o)},"chainableMethodGetter"),configurable:!0})}$(uc,"addChainableMethod");function cc(e,t,r,n){let a=e.__methods[t],i=a.chainingBehavior;a.chainingBehavior=$(function(){let l=n(i).call(this);if(l!==void 0)return l;let u=new S;return mt(this,u),u},"overwritingChainableMethodGetter");let o=a.method;a.method=$(function(){let l=r(o).apply(this,arguments);if(l!==void 0)return l;let u=new S;return mt(this,u),u},"overwritingChainableMethodWrapper")}$(cc,"overwriteChainableMethod");function Zi(e,t){return ge(e)<ge(t)?-1:1}$(Zi,"compareByInspect");function dc(e){return typeof Object.getOwnPropertySymbols!="function"?[]:Object.getOwnPropertySymbols(e).filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})}$(dc,"getOwnEnumerablePropertySymbols");function fc(e){return Object.keys(e).concat(dc(e))}$(fc,"getOwnEnumerableProperties");var es=Number.isNaN;function Cv(e){let t=Te(e);return["Array","Object","Function"].indexOf(t)!==-1}$(Cv,"isObjectType");function pc(e,t){let r=ue(e,"operator"),n=ue(e,"negate"),a=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 o=Cv(a);return/\snot\s/.test(i)?o?"notDeepStrictEqual":"notStrictEqual":o?"deepStrictEqual":"strictEqual"}$(pc,"getOperator");function ws(e){return e.name}$(ws,"getName");function ts(e){return Object.prototype.toString.call(e)==="[object RegExp]"}$(ts,"isRegExp");function Fe(e){return["Number","BigInt"].includes(Te(e))}$(Fe,"isNumeric");var{flag:I}=Ke;["to","be","been","is","and","has","have","with","that","which","at","of","same","but","does","still","also"].forEach(function(e){S.addProperty(e)});S.addProperty("not",function(){I(this,"negate",!0)});S.addProperty("deep",function(){I(this,"deep",!0)});S.addProperty("nested",function(){I(this,"nested",!0)});S.addProperty("own",function(){I(this,"own",!0)});S.addProperty("ordered",function(){I(this,"ordered",!0)});S.addProperty("any",function(){I(this,"any",!0),I(this,"all",!1)});S.addProperty("all",function(){I(this,"all",!0),I(this,"any",!1)});var Ch={function:["function","asyncfunction","generatorfunction","asyncgeneratorfunction"],asyncfunction:["asyncfunction","asyncgeneratorfunction"],generatorfunction:["generatorfunction","asyncgeneratorfunction"],asyncgeneratorfunction:["asyncgeneratorfunction"]};function mc(e,t){t&&I(this,"message",t),e=e.toLowerCase();let r=I(this,"object"),n=~["a","e","i","o","u"].indexOf(e.charAt(0))?"an ":"a ";const a=Te(r).toLowerCase();Ch.function.includes(e)?this.assert(Ch[e].includes(a),"expected #{this} to be "+n+e,"expected #{this} not to be "+n+e):this.assert(e===a,"expected #{this} to be "+n+e,"expected #{this} not to be "+n+e)}$(mc,"an");S.addChainableMethod("an",mc);S.addChainableMethod("a",mc);function Ev(e,t){return es(e)&&es(t)||e===t}$(Ev,"SameValueZero");function pi(){I(this,"contains",!0)}$(pi,"includeChainingBehavior");function mi(e,t){t&&I(this,"message",t);let r=I(this,"object"),n=Te(r).toLowerCase(),a=I(this,"message"),i=I(this,"negate"),o=I(this,"ssfi"),s=I(this,"deep"),l=s?"deep ":"",u=s?I(this,"eql"):Ev;a=a?a+": ":"";let d=!1;switch(n){case"string":d=r.indexOf(e)!==-1;break;case"weakset":if(s)throw new be(a+"unable to use .deep.include with WeakSet",void 0,o);d=r.has(e);break;case"map":r.forEach(function(c){d=d||u(c,e)});break;case"set":s?r.forEach(function(c){d=d||u(c,e)}):d=r.has(e);break;case"array":s?d=r.some(function(c){return u(c,e)}):d=r.indexOf(e)!==-1;break;default:{if(e!==Object(e))throw new be(a+"the given combination of arguments ("+n+" and "+Te(e).toLowerCase()+") is invalid for this assertion. You can use an array, a map, an object, a set, a string, or a weakset instead of a "+Te(e).toLowerCase(),void 0,o);let c=Object.keys(e),f=null,p=0;if(c.forEach(function(m){let g=new S(r);if(mt(this,g,!0),I(g,"lockSsfi",!0),!i||c.length===1){g.property(m,e[m]);return}try{g.property(m,e[m])}catch(b){if(!et.compatibleConstructor(b,be))throw b;f===null&&(f=b),p++}},this),i&&c.length>1&&p===c.length)throw f;return}}this.assert(d,"expected #{this} to "+l+"include "+ge(e),"expected #{this} to not "+l+"include "+ge(e))}$(mi,"include");S.addChainableMethod("include",mi,pi);S.addChainableMethod("contain",mi,pi);S.addChainableMethod("contains",mi,pi);S.addChainableMethod("includes",mi,pi);S.addProperty("ok",function(){this.assert(I(this,"object"),"expected #{this} to be truthy","expected #{this} to be falsy")});S.addProperty("true",function(){this.assert(I(this,"object")===!0,"expected #{this} to be true","expected #{this} to be false",!I(this,"negate"))});S.addProperty("numeric",function(){const e=I(this,"object");this.assert(["Number","BigInt"].includes(Te(e)),"expected #{this} to be numeric","expected #{this} to not be numeric",!I(this,"negate"))});S.addProperty("callable",function(){const e=I(this,"object"),t=I(this,"ssfi"),r=I(this,"message"),n=r?`${r}: `:"",a=I(this,"negate"),i=a?`${n}expected ${ge(e)} not to be a callable function`:`${n}expected ${ge(e)} to be a callable function`,o=["Function","AsyncFunction","GeneratorFunction","AsyncGeneratorFunction"].includes(Te(e));if(o&&a||!o&&!a)throw new be(i,void 0,t)});S.addProperty("false",function(){this.assert(I(this,"object")===!1,"expected #{this} to be false","expected #{this} to be true",!!I(this,"negate"))});S.addProperty("null",function(){this.assert(I(this,"object")===null,"expected #{this} to be null","expected #{this} not to be null")});S.addProperty("undefined",function(){this.assert(I(this,"object")===void 0,"expected #{this} to be undefined","expected #{this} not to be undefined")});S.addProperty("NaN",function(){this.assert(es(I(this,"object")),"expected #{this} to be NaN","expected #{this} not to be NaN")});function hc(){let e=I(this,"object");this.assert(e!=null,"expected #{this} to exist","expected #{this} to not exist")}$(hc,"assertExist");S.addProperty("exist",hc);S.addProperty("exists",hc);S.addProperty("empty",function(){let e=I(this,"object"),t=I(this,"ssfi"),r=I(this,"message"),n;switch(r=r?r+": ":"",Te(e).toLowerCase()){case"array":case"string":n=e.length;break;case"map":case"set":n=e.size;break;case"weakmap":case"weakset":throw new be(r+".empty was passed a weak collection",void 0,t);case"function":{const a=r+".empty was passed a function "+ws(e);throw new be(a.trim(),void 0,t)}default:if(e!==Object(e))throw new be(r+".empty was passed non-string primitive "+ge(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 gc(){let e=I(this,"object"),t=Te(e);this.assert(t==="Arguments","expected #{this} to be arguments but got "+t,"expected #{this} to not be arguments")}$(gc,"checkArguments");S.addProperty("arguments",gc);S.addProperty("Arguments",gc);function xs(e,t){t&&I(this,"message",t);let r=I(this,"object");if(I(this,"deep")){let n=I(this,"lockSsfi");I(this,"lockSsfi",!0),this.eql(e),I(this,"lockSsfi",n)}else this.assert(e===r,"expected #{this} to equal #{exp}","expected #{this} to not equal #{exp}",e,this._obj,!0)}$(xs,"assertEqual");S.addMethod("equal",xs);S.addMethod("equals",xs);S.addMethod("eq",xs);function bc(e,t){t&&I(this,"message",t);let r=I(this,"eql");this.assert(r(e,I(this,"object")),"expected #{this} to deeply equal #{exp}","expected #{this} to not deeply equal #{exp}",e,this._obj,!0)}$(bc,"assertEql");S.addMethod("eql",bc);S.addMethod("eqls",bc);function Rs(e,t){t&&I(this,"message",t);let r=I(this,"object"),n=I(this,"doLength"),a=I(this,"message"),i=a?a+": ":"",o=I(this,"ssfi"),s=Te(r).toLowerCase(),l=Te(e).toLowerCase();if(n&&s!=="map"&&s!=="set"&&new S(r,a,o,!0).to.have.property("length"),!n&&s==="date"&&l!=="date")throw new be(i+"the argument to above must be a date",void 0,o);if(!Fe(e)&&(n||Fe(r)))throw new be(i+"the argument to above must be a number",void 0,o);if(!n&&s!=="date"&&!Fe(r)){let u=s==="string"?"'"+r+"'":r;throw new be(i+"expected "+u+" to be a number or a date",void 0,o)}if(n){let u="length",d;s==="map"||s==="set"?(u="size",d=r.size):d=r.length,this.assert(d>e,"expected #{this} to have a "+u+" above #{exp} but got #{act}","expected #{this} to not have a "+u+" above #{exp}",e,d)}else this.assert(r>e,"expected #{this} to be above #{exp}","expected #{this} to be at most #{exp}",e)}$(Rs,"assertAbove");S.addMethod("above",Rs);S.addMethod("gt",Rs);S.addMethod("greaterThan",Rs);function Cs(e,t){t&&I(this,"message",t);let r=I(this,"object"),n=I(this,"doLength"),a=I(this,"message"),i=a?a+": ":"",o=I(this,"ssfi"),s=Te(r).toLowerCase(),l=Te(e).toLowerCase(),u,d=!0;if(n&&s!=="map"&&s!=="set"&&new S(r,a,o,!0).to.have.property("length"),!n&&s==="date"&&l!=="date")u=i+"the argument to least must be a date";else if(!Fe(e)&&(n||Fe(r)))u=i+"the argument to least must be a number";else if(!n&&s!=="date"&&!Fe(r)){let c=s==="string"?"'"+r+"'":r;u=i+"expected "+c+" to be a number or a date"}else d=!1;if(d)throw new be(u,void 0,o);if(n){let c="length",f;s==="map"||s==="set"?(c="size",f=r.size):f=r.length,this.assert(f>=e,"expected #{this} to have a "+c+" at least #{exp} but got #{act}","expected #{this} to have a "+c+" below #{exp}",e,f)}else this.assert(r>=e,"expected #{this} to be at least #{exp}","expected #{this} to be below #{exp}",e)}$(Cs,"assertLeast");S.addMethod("least",Cs);S.addMethod("gte",Cs);S.addMethod("greaterThanOrEqual",Cs);function Es(e,t){t&&I(this,"message",t);let r=I(this,"object"),n=I(this,"doLength"),a=I(this,"message"),i=a?a+": ":"",o=I(this,"ssfi"),s=Te(r).toLowerCase(),l=Te(e).toLowerCase(),u,d=!0;if(n&&s!=="map"&&s!=="set"&&new S(r,a,o,!0).to.have.property("length"),!n&&s==="date"&&l!=="date")u=i+"the argument to below must be a date";else if(!Fe(e)&&(n||Fe(r)))u=i+"the argument to below must be a number";else if(!n&&s!=="date"&&!Fe(r)){let c=s==="string"?"'"+r+"'":r;u=i+"expected "+c+" to be a number or a date"}else d=!1;if(d)throw new be(u,void 0,o);if(n){let c="length",f;s==="map"||s==="set"?(c="size",f=r.size):f=r.length,this.assert(f<e,"expected #{this} to have a "+c+" below #{exp} but got #{act}","expected #{this} to not have a "+c+" below #{exp}",e,f)}else this.assert(r<e,"expected #{this} to be below #{exp}","expected #{this} to be at least #{exp}",e)}$(Es,"assertBelow");S.addMethod("below",Es);S.addMethod("lt",Es);S.addMethod("lessThan",Es);function Ts(e,t){t&&I(this,"message",t);let r=I(this,"object"),n=I(this,"doLength"),a=I(this,"message"),i=a?a+": ":"",o=I(this,"ssfi"),s=Te(r).toLowerCase(),l=Te(e).toLowerCase(),u,d=!0;if(n&&s!=="map"&&s!=="set"&&new S(r,a,o,!0).to.have.property("length"),!n&&s==="date"&&l!=="date")u=i+"the argument to most must be a date";else if(!Fe(e)&&(n||Fe(r)))u=i+"the argument to most must be a number";else if(!n&&s!=="date"&&!Fe(r)){let c=s==="string"?"'"+r+"'":r;u=i+"expected "+c+" to be a number or a date"}else d=!1;if(d)throw new be(u,void 0,o);if(n){let c="length",f;s==="map"||s==="set"?(c="size",f=r.size):f=r.length,this.assert(f<=e,"expected #{this} to have a "+c+" at most #{exp} but got #{act}","expected #{this} to have a "+c+" above #{exp}",e,f)}else this.assert(r<=e,"expected #{this} to be at most #{exp}","expected #{this} to be above #{exp}",e)}$(Ts,"assertMost");S.addMethod("most",Ts);S.addMethod("lte",Ts);S.addMethod("lessThanOrEqual",Ts);S.addMethod("within",function(e,t,r){r&&I(this,"message",r);let n=I(this,"object"),a=I(this,"doLength"),i=I(this,"message"),o=i?i+": ":"",s=I(this,"ssfi"),l=Te(n).toLowerCase(),u=Te(e).toLowerCase(),d=Te(t).toLowerCase(),c,f=!0,p=u==="date"&&d==="date"?e.toISOString()+".."+t.toISOString():e+".."+t;if(a&&l!=="map"&&l!=="set"&&new S(n,i,s,!0).to.have.property("length"),!a&&l==="date"&&(u!=="date"||d!=="date"))c=o+"the arguments to within must be dates";else if((!Fe(e)||!Fe(t))&&(a||Fe(n)))c=o+"the arguments to within must be numbers";else if(!a&&l!=="date"&&!Fe(n)){let m=l==="string"?"'"+n+"'":n;c=o+"expected "+m+" to be a number or a date"}else f=!1;if(f)throw new be(c,void 0,s);if(a){let m="length",g;l==="map"||l==="set"?(m="size",g=n.size):g=n.length,this.assert(g>=e&&g<=t,"expected #{this} to have a "+m+" within "+p,"expected #{this} to not have a "+m+" within "+p)}else this.assert(n>=e&&n<=t,"expected #{this} to be within "+p,"expected #{this} to not be within "+p)});function yc(e,t){t&&I(this,"message",t);let r=I(this,"object"),n=I(this,"ssfi"),a=I(this,"message"),i;try{i=r instanceof e}catch(s){throw s instanceof TypeError?(a=a?a+": ":"",new be(a+"The instanceof assertion needs a constructor but "+Te(e)+" was given.",void 0,n)):s}let o=ws(e);o==null&&(o="an unnamed constructor"),this.assert(i,"expected #{this} to be an instance of "+o,"expected #{this} to not be an instance of "+o)}$(yc,"assertInstanceOf");S.addMethod("instanceof",yc);S.addMethod("instanceOf",yc);function vc(e,t,r){r&&I(this,"message",r);let n=I(this,"nested"),a=I(this,"own"),i=I(this,"message"),o=I(this,"object"),s=I(this,"ssfi"),l=typeof e;if(i=i?i+": ":"",n){if(l!=="string")throw new be(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 be(i+"the argument to property must be a string, number, or symbol",void 0,s);if(n&&a)throw new be(i+'The "nested" and "own" flags cannot be combined.',void 0,s);if(o==null)throw new be(i+"Target cannot be null or undefined.",void 0,s);let u=I(this,"deep"),d=I(this,"negate"),c=n?ac(o,e):null,f=n?c.value:o[e],p=u?I(this,"eql"):(b,h)=>b===h,m="";u&&(m+="deep "),a&&(m+="own "),n&&(m+="nested "),m+="property ";let g;a?g=Object.prototype.hasOwnProperty.call(o,e):n?g=c.exists:g=vs(o,e),(!d||arguments.length===1)&&this.assert(g,"expected #{this} to have "+m+ge(e),"expected #{this} to not have "+m+ge(e)),arguments.length>1&&this.assert(g&&p(t,f),"expected #{this} to have "+m+ge(e)+" of #{exp}, but got #{act}","expected #{this} to not have "+m+ge(e)+" of #{act}",t,f),I(this,"object",f)}$(vc,"assertProperty");S.addMethod("property",vc);function wc(e,t,r){I(this,"own",!0),vc.apply(this,arguments)}$(wc,"assertOwnProperty");S.addMethod("ownProperty",wc);S.addMethod("haveOwnProperty",wc);function xc(e,t,r){typeof t=="string"&&(r=t,t=null),r&&I(this,"message",r);let n=I(this,"object"),a=Object.getOwnPropertyDescriptor(Object(n),e),i=I(this,"eql");a&&t?this.assert(i(t,a),"expected the own property descriptor for "+ge(e)+" on #{this} to match "+ge(t)+", got "+ge(a),"expected the own property descriptor for "+ge(e)+" on #{this} to not match "+ge(t),t,a,!0):this.assert(a,"expected #{this} to have an own property descriptor for "+ge(e),"expected #{this} to not have an own property descriptor for "+ge(e)),I(this,"object",a)}$(xc,"assertOwnPropertyDescriptor");S.addMethod("ownPropertyDescriptor",xc);S.addMethod("haveOwnPropertyDescriptor",xc);function Rc(){I(this,"doLength",!0)}$(Rc,"assertLengthChain");function Cc(e,t){t&&I(this,"message",t);let r=I(this,"object"),n=Te(r).toLowerCase(),a=I(this,"message"),i=I(this,"ssfi"),o="length",s;switch(n){case"map":case"set":o="size",s=r.size;break;default:new S(r,a,i,!0).to.have.property("length"),s=r.length}this.assert(s==e,"expected #{this} to have a "+o+" of #{exp} but got #{act}","expected #{this} to not have a "+o+" of #{act}",e,s)}$(Cc,"assertLength");S.addChainableMethod("length",Cc,Rc);S.addChainableMethod("lengthOf",Cc,Rc);function Ec(e,t){t&&I(this,"message",t);let r=I(this,"object");this.assert(e.exec(r),"expected #{this} to match "+e,"expected #{this} not to match "+e)}$(Ec,"assertMatch");S.addMethod("match",Ec);S.addMethod("matches",Ec);S.addMethod("string",function(e,t){t&&I(this,"message",t);let r=I(this,"object"),n=I(this,"message"),a=I(this,"ssfi");new S(r,n,a,!0).is.a("string"),this.assert(~r.indexOf(e),"expected #{this} to contain "+ge(e),"expected #{this} to not contain "+ge(e))});function Tc(e){let t=I(this,"object"),r=Te(t),n=Te(e),a=I(this,"ssfi"),i=I(this,"deep"),o,s="",l,u=!0,d=I(this,"message");d=d?d+": ":"";let c=d+"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(h,w){l.push(w)}),n!=="Array"&&(e=Array.prototype.slice.call(arguments));else{switch(l=fc(t),n){case"Array":if(arguments.length>1)throw new be(c,void 0,a);break;case"Object":if(arguments.length>1)throw new be(c,void 0,a);e=Object.keys(e);break;default:e=Array.prototype.slice.call(arguments)}e=e.map(function(h){return typeof h=="symbol"?h:String(h)})}if(!e.length)throw new be(d+"keys required",void 0,a);let f=e.length,p=I(this,"any"),m=I(this,"all"),g=e,b=i?I(this,"eql"):(h,w)=>h===w;if(!p&&!m&&(m=!0),p&&(u=g.some(function(h){return l.some(function(w){return b(h,w)})})),m&&(u=g.every(function(h){return l.some(function(w){return b(h,w)})}),I(this,"contains")||(u=u&&e.length==l.length)),f>1){e=e.map(function(w){return ge(w)});let h=e.pop();m&&(o=e.join(", ")+", and "+h),p&&(o=e.join(", ")+", or "+h)}else o=ge(e[0]);o=(f>1?"keys ":"key ")+o,o=(I(this,"contains")?"contain ":"have ")+o,this.assert(u,"expected #{this} to "+s+o,"expected #{this} to not "+s+o,g.slice(0).sort(Zi),l.sort(Zi),!0)}$(Tc,"assertKeys");S.addMethod("keys",Tc);S.addMethod("key",Tc);function Ss(e,t,r){r&&I(this,"message",r);let n=I(this,"object"),a=I(this,"ssfi"),i=I(this,"message"),o=I(this,"negate")||!1;new S(n,i,a,!0).is.a("function"),(ts(e)||typeof e=="string")&&(t=e,e=null);let s,l=!1;try{n()}catch(p){l=!0,s=p}let u=e===void 0&&t===void 0,d=!!(e&&t),c=!1,f=!1;if(u||!u&&!o){let p="an error";e instanceof Error?p="#{exp}":e&&(p=et.getConstructorName(e));let m=s;if(s instanceof Error)m=s.toString();else if(typeof s=="string")m=s;else if(s&&(typeof s=="object"||typeof s=="function"))try{m=et.getConstructorName(s)}catch{}this.assert(l,"expected #{this} to throw "+p,"expected #{this} to not throw an error but #{act} was thrown",e&&e.toString(),m)}if(e&&s&&(e instanceof Error&&et.compatibleInstance(s,e)===o&&(d&&o?c=!0:this.assert(o,"expected #{this} to throw #{exp} but #{act} was thrown","expected #{this} to not throw #{exp}"+(s&&!o?" but #{act} was thrown":""),e.toString(),s.toString())),et.compatibleConstructor(s,e)===o&&(d&&o?c=!0:this.assert(o,"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&&et.getConstructorName(e),s instanceof Error?s.toString():s&&et.getConstructorName(s)))),s&&t!==void 0&&t!==null){let p="including";ts(t)&&(p="matching"),et.compatibleMessage(s,t)===o&&(d&&o?f=!0:this.assert(o,"expected #{this} to throw error "+p+" #{exp} but got #{act}","expected #{this} to throw error not "+p+" #{exp}",t,et.getMessage(s)))}c&&f&&this.assert(o,"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&&et.getConstructorName(e),s instanceof Error?s.toString():s&&et.getConstructorName(s)),I(this,"object",s)}$(Ss,"assertThrows");S.addMethod("throw",Ss);S.addMethod("throws",Ss);S.addMethod("Throw",Ss);function Sc(e,t){t&&I(this,"message",t);let r=I(this,"object"),n=I(this,"itself"),a=typeof r=="function"&&!n?r.prototype[e]:r[e];this.assert(typeof a=="function","expected #{this} to respond to "+ge(e),"expected #{this} to not respond to "+ge(e))}$(Sc,"respondTo");S.addMethod("respondTo",Sc);S.addMethod("respondsTo",Sc);S.addProperty("itself",function(){I(this,"itself",!0)});function _c(e,t){t&&I(this,"message",t);let r=I(this,"object"),n=e(r);this.assert(n,"expected #{this} to satisfy "+lr(e),"expected #{this} to not satisfy"+lr(e),!I(this,"negate"),n)}$(_c,"satisfy");S.addMethod("satisfy",_c);S.addMethod("satisfies",_c);function Pc(e,t,r){r&&I(this,"message",r);let n=I(this,"object"),a=I(this,"message"),i=I(this,"ssfi");new S(n,a,i,!0).is.numeric;let o="A `delta` value is required for `closeTo`";if(t==null)throw new be(a?`${a}: ${o}`:o,void 0,i);if(new S(t,a,i,!0).is.numeric,o="A `expected` value is required for `closeTo`",e==null)throw new be(a?`${a}: ${o}`:o,void 0,i);new S(e,a,i,!0).is.numeric;const s=$(u=>u<0n?-u:u,"abs"),l=$(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)}$(Pc,"closeTo");S.addMethod("closeTo",Pc);S.addMethod("approximately",Pc);function Tv(e,t,r,n,a){let i=Array.from(t),o=Array.from(e);if(!n){if(o.length!==i.length)return!1;i=i.slice()}return o.every(function(s,l){if(a)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,d){return r(s,u)?(n||i.splice(d,1),!0):!1})})}$(Tv,"isSubsetOf");S.addMethod("members",function(e,t){t&&I(this,"message",t);let r=I(this,"object"),n=I(this,"message"),a=I(this,"ssfi");new S(r,n,a,!0).to.be.iterable,new S(e,n,a,!0).to.be.iterable;let i=I(this,"contains"),o=I(this,"ordered"),s,l,u;i?(s=o?"an ordered superset":"a superset",l="expected #{this} to be "+s+" of #{exp}",u="expected #{this} to not be "+s+" of #{exp}"):(s=o?"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 d=I(this,"deep")?I(this,"eql"):void 0;this.assert(Tv(e,r,d,i,o),l,u,e,r,!0)});S.addProperty("iterable",function(e){e&&I(this,"message",e);let t=I(this,"object");this.assert(t!=null&&t[Symbol.iterator],"expected #{this} to be an iterable","expected #{this} to not be an iterable",t)});function Sv(e,t){t&&I(this,"message",t);let r=I(this,"object"),n=I(this,"message"),a=I(this,"ssfi"),i=I(this,"contains"),o=I(this,"deep"),s=I(this,"eql");new S(e,n,a,!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):o?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)}$(Sv,"oneOf");S.addMethod("oneOf",Sv);function kc(e,t,r){r&&I(this,"message",r);let n=I(this,"object"),a=I(this,"message"),i=I(this,"ssfi");new S(n,a,i,!0).is.a("function");let o;t?(new S(e,a,i,!0).to.have.property(t),o=e[t]):(new S(e,a,i,!0).is.a("function"),o=e()),n();let s=t==null?e():e[t],l=t==null?o:"."+t;I(this,"deltaMsgObj",l),I(this,"initialDeltaValue",o),I(this,"finalDeltaValue",s),I(this,"deltaBehavior","change"),I(this,"realDelta",s!==o),this.assert(o!==s,"expected "+l+" to change","expected "+l+" to not change")}$(kc,"assertChanges");S.addMethod("change",kc);S.addMethod("changes",kc);function Mc(e,t,r){r&&I(this,"message",r);let n=I(this,"object"),a=I(this,"message"),i=I(this,"ssfi");new S(n,a,i,!0).is.a("function");let o;t?(new S(e,a,i,!0).to.have.property(t),o=e[t]):(new S(e,a,i,!0).is.a("function"),o=e()),new S(o,a,i,!0).is.a("number"),n();let s=t==null?e():e[t],l=t==null?o:"."+t;I(this,"deltaMsgObj",l),I(this,"initialDeltaValue",o),I(this,"finalDeltaValue",s),I(this,"deltaBehavior","increase"),I(this,"realDelta",s-o),this.assert(s-o>0,"expected "+l+" to increase","expected "+l+" to not increase")}$(Mc,"assertIncreases");S.addMethod("increase",Mc);S.addMethod("increases",Mc);function Ac(e,t,r){r&&I(this,"message",r);let n=I(this,"object"),a=I(this,"message"),i=I(this,"ssfi");new S(n,a,i,!0).is.a("function");let o;t?(new S(e,a,i,!0).to.have.property(t),o=e[t]):(new S(e,a,i,!0).is.a("function"),o=e()),new S(o,a,i,!0).is.a("number"),n();let s=t==null?e():e[t],l=t==null?o:"."+t;I(this,"deltaMsgObj",l),I(this,"initialDeltaValue",o),I(this,"finalDeltaValue",s),I(this,"deltaBehavior","decrease"),I(this,"realDelta",o-s),this.assert(s-o<0,"expected "+l+" to decrease","expected "+l+" to not decrease")}$(Ac,"assertDecreases");S.addMethod("decrease",Ac);S.addMethod("decreases",Ac);function _v(e,t){t&&I(this,"message",t);let r=I(this,"deltaMsgObj"),n=I(this,"initialDeltaValue"),a=I(this,"finalDeltaValue"),i=I(this,"deltaBehavior"),o=I(this,"realDelta"),s;i==="change"?s=Math.abs(a-n)===Math.abs(e):s=o===Math.abs(e),this.assert(s,"expected "+r+" to "+i+" by "+e,"expected "+r+" to not "+i+" by "+e)}$(_v,"assertDelta");S.addMethod("by",_v);S.addProperty("extensible",function(){let e=I(this,"object"),t=e===Object(e)&&Object.isExtensible(e);this.assert(t,"expected #{this} to be extensible","expected #{this} to not be extensible")});S.addProperty("sealed",function(){let e=I(this,"object"),t=e===Object(e)?Object.isSealed(e):!0;this.assert(t,"expected #{this} to be sealed","expected #{this} to not be sealed")});S.addProperty("frozen",function(){let e=I(this,"object"),t=e===Object(e)?Object.isFrozen(e):!0;this.assert(t,"expected #{this} to be frozen","expected #{this} to not be frozen")});S.addProperty("finite",function(e){let t=I(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 rs(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 rs(r,n)})}):!1:e instanceof Date?t instanceof Date?e.getTime()===t.getTime():!1:Object.keys(e).every(function(r){let n=e[r],a=t[r];return typeof n=="object"&&n!==null&&a!==null?rs(n,a):typeof n=="function"?n(a):a===n}):!1}$(rs,"compareSubset");S.addMethod("containSubset",function(e){const t=ue(this,"object"),r=Ge.showDiff;this.assert(rs(e,t),"expected #{act} to contain subset #{exp}","expected #{act} to not contain subset #{exp}",e,t,r)});function ur(e,t){return new S(e,t)}$(ur,"expect");ur.fail=function(e,t,r,n){throw arguments.length<2&&(r=e,e=void 0),r=r||"expect.fail()",new be(r,{actual:e,expected:t,operator:n},ur.fail)};var Pv={};Yu(Pv,{Should:()=>FA,should:()=>LA});function qc(){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 S(this.valueOf(),null,e):new S(this,null,e)}$(e,"shouldGetter");function t(n){Object.defineProperty(this,"should",{value:n,enumerable:!0,configurable:!0,writable:!0})}$(t,"shouldSetter"),Object.defineProperty(Object.prototype,"should",{set:t,get:e,configurable:!0});let r={};return r.fail=function(n,a,i,o){throw arguments.length<2&&(i=n,n=void 0),i=i||"should.fail()",new be(i,{actual:n,expected:a,operator:o},r.fail)},r.equal=function(n,a,i){new S(n,i).to.equal(a)},r.Throw=function(n,a,i,o){new S(n,o).to.Throw(a,i)},r.exist=function(n,a){new S(n,a).to.exist},r.not={},r.not.equal=function(n,a,i){new S(n,i).to.not.equal(a)},r.not.Throw=function(n,a,i,o){new S(n,o).to.not.Throw(a,i)},r.not.exist=function(n,a){new S(n,a).to.not.exist},r.throw=r.Throw,r.not.throw=r.not.Throw,r}$(qc,"loadShould");var LA=qc,FA=qc;function C(e,t){new S(null,null,C,!0).assert(e,t,"[ negation message unavailable ]")}$(C,"assert");C.fail=function(e,t,r,n){throw arguments.length<2&&(r=e,e=void 0),r=r||"assert.fail()",new be(r,{actual:e,expected:t,operator:n},C.fail)};C.isOk=function(e,t){new S(e,t,C.isOk,!0).is.ok};C.isNotOk=function(e,t){new S(e,t,C.isNotOk,!0).is.not.ok};C.equal=function(e,t,r){let n=new S(e,r,C.equal,!0);n.assert(t==ue(n,"object"),"expected #{this} to equal #{exp}","expected #{this} to not equal #{act}",t,e,!0)};C.notEqual=function(e,t,r){let n=new S(e,r,C.notEqual,!0);n.assert(t!=ue(n,"object"),"expected #{this} to not equal #{exp}","expected #{this} to equal #{act}",t,e,!0)};C.strictEqual=function(e,t,r){new S(e,r,C.strictEqual,!0).to.equal(t)};C.notStrictEqual=function(e,t,r){new S(e,r,C.notStrictEqual,!0).to.not.equal(t)};C.deepEqual=C.deepStrictEqual=function(e,t,r){new S(e,r,C.deepEqual,!0).to.eql(t)};C.notDeepEqual=function(e,t,r){new S(e,r,C.notDeepEqual,!0).to.not.eql(t)};C.isAbove=function(e,t,r){new S(e,r,C.isAbove,!0).to.be.above(t)};C.isAtLeast=function(e,t,r){new S(e,r,C.isAtLeast,!0).to.be.least(t)};C.isBelow=function(e,t,r){new S(e,r,C.isBelow,!0).to.be.below(t)};C.isAtMost=function(e,t,r){new S(e,r,C.isAtMost,!0).to.be.most(t)};C.isTrue=function(e,t){new S(e,t,C.isTrue,!0).is.true};C.isNotTrue=function(e,t){new S(e,t,C.isNotTrue,!0).to.not.equal(!0)};C.isFalse=function(e,t){new S(e,t,C.isFalse,!0).is.false};C.isNotFalse=function(e,t){new S(e,t,C.isNotFalse,!0).to.not.equal(!1)};C.isNull=function(e,t){new S(e,t,C.isNull,!0).to.equal(null)};C.isNotNull=function(e,t){new S(e,t,C.isNotNull,!0).to.not.equal(null)};C.isNaN=function(e,t){new S(e,t,C.isNaN,!0).to.be.NaN};C.isNotNaN=function(e,t){new S(e,t,C.isNotNaN,!0).not.to.be.NaN};C.exists=function(e,t){new S(e,t,C.exists,!0).to.exist};C.notExists=function(e,t){new S(e,t,C.notExists,!0).to.not.exist};C.isUndefined=function(e,t){new S(e,t,C.isUndefined,!0).to.equal(void 0)};C.isDefined=function(e,t){new S(e,t,C.isDefined,!0).to.not.equal(void 0)};C.isCallable=function(e,t){new S(e,t,C.isCallable,!0).is.callable};C.isNotCallable=function(e,t){new S(e,t,C.isNotCallable,!0).is.not.callable};C.isObject=function(e,t){new S(e,t,C.isObject,!0).to.be.a("object")};C.isNotObject=function(e,t){new S(e,t,C.isNotObject,!0).to.not.be.a("object")};C.isArray=function(e,t){new S(e,t,C.isArray,!0).to.be.an("array")};C.isNotArray=function(e,t){new S(e,t,C.isNotArray,!0).to.not.be.an("array")};C.isString=function(e,t){new S(e,t,C.isString,!0).to.be.a("string")};C.isNotString=function(e,t){new S(e,t,C.isNotString,!0).to.not.be.a("string")};C.isNumber=function(e,t){new S(e,t,C.isNumber,!0).to.be.a("number")};C.isNotNumber=function(e,t){new S(e,t,C.isNotNumber,!0).to.not.be.a("number")};C.isNumeric=function(e,t){new S(e,t,C.isNumeric,!0).is.numeric};C.isNotNumeric=function(e,t){new S(e,t,C.isNotNumeric,!0).is.not.numeric};C.isFinite=function(e,t){new S(e,t,C.isFinite,!0).to.be.finite};C.isBoolean=function(e,t){new S(e,t,C.isBoolean,!0).to.be.a("boolean")};C.isNotBoolean=function(e,t){new S(e,t,C.isNotBoolean,!0).to.not.be.a("boolean")};C.typeOf=function(e,t,r){new S(e,r,C.typeOf,!0).to.be.a(t)};C.notTypeOf=function(e,t,r){new S(e,r,C.notTypeOf,!0).to.not.be.a(t)};C.instanceOf=function(e,t,r){new S(e,r,C.instanceOf,!0).to.be.instanceOf(t)};C.notInstanceOf=function(e,t,r){new S(e,r,C.notInstanceOf,!0).to.not.be.instanceOf(t)};C.include=function(e,t,r){new S(e,r,C.include,!0).include(t)};C.notInclude=function(e,t,r){new S(e,r,C.notInclude,!0).not.include(t)};C.deepInclude=function(e,t,r){new S(e,r,C.deepInclude,!0).deep.include(t)};C.notDeepInclude=function(e,t,r){new S(e,r,C.notDeepInclude,!0).not.deep.include(t)};C.nestedInclude=function(e,t,r){new S(e,r,C.nestedInclude,!0).nested.include(t)};C.notNestedInclude=function(e,t,r){new S(e,r,C.notNestedInclude,!0).not.nested.include(t)};C.deepNestedInclude=function(e,t,r){new S(e,r,C.deepNestedInclude,!0).deep.nested.include(t)};C.notDeepNestedInclude=function(e,t,r){new S(e,r,C.notDeepNestedInclude,!0).not.deep.nested.include(t)};C.ownInclude=function(e,t,r){new S(e,r,C.ownInclude,!0).own.include(t)};C.notOwnInclude=function(e,t,r){new S(e,r,C.notOwnInclude,!0).not.own.include(t)};C.deepOwnInclude=function(e,t,r){new S(e,r,C.deepOwnInclude,!0).deep.own.include(t)};C.notDeepOwnInclude=function(e,t,r){new S(e,r,C.notDeepOwnInclude,!0).not.deep.own.include(t)};C.match=function(e,t,r){new S(e,r,C.match,!0).to.match(t)};C.notMatch=function(e,t,r){new S(e,r,C.notMatch,!0).to.not.match(t)};C.property=function(e,t,r){new S(e,r,C.property,!0).to.have.property(t)};C.notProperty=function(e,t,r){new S(e,r,C.notProperty,!0).to.not.have.property(t)};C.propertyVal=function(e,t,r,n){new S(e,n,C.propertyVal,!0).to.have.property(t,r)};C.notPropertyVal=function(e,t,r,n){new S(e,n,C.notPropertyVal,!0).to.not.have.property(t,r)};C.deepPropertyVal=function(e,t,r,n){new S(e,n,C.deepPropertyVal,!0).to.have.deep.property(t,r)};C.notDeepPropertyVal=function(e,t,r,n){new S(e,n,C.notDeepPropertyVal,!0).to.not.have.deep.property(t,r)};C.ownProperty=function(e,t,r){new S(e,r,C.ownProperty,!0).to.have.own.property(t)};C.notOwnProperty=function(e,t,r){new S(e,r,C.notOwnProperty,!0).to.not.have.own.property(t)};C.ownPropertyVal=function(e,t,r,n){new S(e,n,C.ownPropertyVal,!0).to.have.own.property(t,r)};C.notOwnPropertyVal=function(e,t,r,n){new S(e,n,C.notOwnPropertyVal,!0).to.not.have.own.property(t,r)};C.deepOwnPropertyVal=function(e,t,r,n){new S(e,n,C.deepOwnPropertyVal,!0).to.have.deep.own.property(t,r)};C.notDeepOwnPropertyVal=function(e,t,r,n){new S(e,n,C.notDeepOwnPropertyVal,!0).to.not.have.deep.own.property(t,r)};C.nestedProperty=function(e,t,r){new S(e,r,C.nestedProperty,!0).to.have.nested.property(t)};C.notNestedProperty=function(e,t,r){new S(e,r,C.notNestedProperty,!0).to.not.have.nested.property(t)};C.nestedPropertyVal=function(e,t,r,n){new S(e,n,C.nestedPropertyVal,!0).to.have.nested.property(t,r)};C.notNestedPropertyVal=function(e,t,r,n){new S(e,n,C.notNestedPropertyVal,!0).to.not.have.nested.property(t,r)};C.deepNestedPropertyVal=function(e,t,r,n){new S(e,n,C.deepNestedPropertyVal,!0).to.have.deep.nested.property(t,r)};C.notDeepNestedPropertyVal=function(e,t,r,n){new S(e,n,C.notDeepNestedPropertyVal,!0).to.not.have.deep.nested.property(t,r)};C.lengthOf=function(e,t,r){new S(e,r,C.lengthOf,!0).to.have.lengthOf(t)};C.hasAnyKeys=function(e,t,r){new S(e,r,C.hasAnyKeys,!0).to.have.any.keys(t)};C.hasAllKeys=function(e,t,r){new S(e,r,C.hasAllKeys,!0).to.have.all.keys(t)};C.containsAllKeys=function(e,t,r){new S(e,r,C.containsAllKeys,!0).to.contain.all.keys(t)};C.doesNotHaveAnyKeys=function(e,t,r){new S(e,r,C.doesNotHaveAnyKeys,!0).to.not.have.any.keys(t)};C.doesNotHaveAllKeys=function(e,t,r){new S(e,r,C.doesNotHaveAllKeys,!0).to.not.have.all.keys(t)};C.hasAnyDeepKeys=function(e,t,r){new S(e,r,C.hasAnyDeepKeys,!0).to.have.any.deep.keys(t)};C.hasAllDeepKeys=function(e,t,r){new S(e,r,C.hasAllDeepKeys,!0).to.have.all.deep.keys(t)};C.containsAllDeepKeys=function(e,t,r){new S(e,r,C.containsAllDeepKeys,!0).to.contain.all.deep.keys(t)};C.doesNotHaveAnyDeepKeys=function(e,t,r){new S(e,r,C.doesNotHaveAnyDeepKeys,!0).to.not.have.any.deep.keys(t)};C.doesNotHaveAllDeepKeys=function(e,t,r){new S(e,r,C.doesNotHaveAllDeepKeys,!0).to.not.have.all.deep.keys(t)};C.throws=function(e,t,r,n){(typeof t=="string"||t instanceof RegExp)&&(r=t,t=null);let a=new S(e,n,C.throws,!0).to.throw(t,r);return ue(a,"object")};C.doesNotThrow=function(e,t,r,n){(typeof t=="string"||t instanceof RegExp)&&(r=t,t=null),new S(e,n,C.doesNotThrow,!0).to.not.throw(t,r)};C.operator=function(e,t,r,n){let a;switch(t){case"==":a=e==r;break;case"===":a=e===r;break;case">":a=e>r;break;case">=":a=e>=r;break;case"<":a=e<r;break;case"<=":a=e<=r;break;case"!=":a=e!=r;break;case"!==":a=e!==r;break;default:throw n=n&&n+": ",new be(n+'Invalid operator "'+t+'"',void 0,C.operator)}let i=new S(a,n,C.operator,!0);i.assert(ue(i,"object")===!0,"expected "+ge(e)+" to be "+t+" "+ge(r),"expected "+ge(e)+" to not be "+t+" "+ge(r))};C.closeTo=function(e,t,r,n){new S(e,n,C.closeTo,!0).to.be.closeTo(t,r)};C.approximately=function(e,t,r,n){new S(e,n,C.approximately,!0).to.be.approximately(t,r)};C.sameMembers=function(e,t,r){new S(e,r,C.sameMembers,!0).to.have.same.members(t)};C.notSameMembers=function(e,t,r){new S(e,r,C.notSameMembers,!0).to.not.have.same.members(t)};C.sameDeepMembers=function(e,t,r){new S(e,r,C.sameDeepMembers,!0).to.have.same.deep.members(t)};C.notSameDeepMembers=function(e,t,r){new S(e,r,C.notSameDeepMembers,!0).to.not.have.same.deep.members(t)};C.sameOrderedMembers=function(e,t,r){new S(e,r,C.sameOrderedMembers,!0).to.have.same.ordered.members(t)};C.notSameOrderedMembers=function(e,t,r){new S(e,r,C.notSameOrderedMembers,!0).to.not.have.same.ordered.members(t)};C.sameDeepOrderedMembers=function(e,t,r){new S(e,r,C.sameDeepOrderedMembers,!0).to.have.same.deep.ordered.members(t)};C.notSameDeepOrderedMembers=function(e,t,r){new S(e,r,C.notSameDeepOrderedMembers,!0).to.not.have.same.deep.ordered.members(t)};C.includeMembers=function(e,t,r){new S(e,r,C.includeMembers,!0).to.include.members(t)};C.notIncludeMembers=function(e,t,r){new S(e,r,C.notIncludeMembers,!0).to.not.include.members(t)};C.includeDeepMembers=function(e,t,r){new S(e,r,C.includeDeepMembers,!0).to.include.deep.members(t)};C.notIncludeDeepMembers=function(e,t,r){new S(e,r,C.notIncludeDeepMembers,!0).to.not.include.deep.members(t)};C.includeOrderedMembers=function(e,t,r){new S(e,r,C.includeOrderedMembers,!0).to.include.ordered.members(t)};C.notIncludeOrderedMembers=function(e,t,r){new S(e,r,C.notIncludeOrderedMembers,!0).to.not.include.ordered.members(t)};C.includeDeepOrderedMembers=function(e,t,r){new S(e,r,C.includeDeepOrderedMembers,!0).to.include.deep.ordered.members(t)};C.notIncludeDeepOrderedMembers=function(e,t,r){new S(e,r,C.notIncludeDeepOrderedMembers,!0).to.not.include.deep.ordered.members(t)};C.oneOf=function(e,t,r){new S(e,r,C.oneOf,!0).to.be.oneOf(t)};C.isIterable=function(e,t){if(e==null||!e[Symbol.iterator])throw t=t?`${t} expected ${ge(e)} to be an iterable`:`expected ${ge(e)} to be an iterable`,new be(t,void 0,C.isIterable)};C.changes=function(e,t,r,n){arguments.length===3&&typeof t=="function"&&(n=r,r=null),new S(e,n,C.changes,!0).to.change(t,r)};C.changesBy=function(e,t,r,n,a){if(arguments.length===4&&typeof t=="function"){let i=n;n=r,a=i}else arguments.length===3&&(n=r,r=null);new S(e,a,C.changesBy,!0).to.change(t,r).by(n)};C.doesNotChange=function(e,t,r,n){return arguments.length===3&&typeof t=="function"&&(n=r,r=null),new S(e,n,C.doesNotChange,!0).to.not.change(t,r)};C.changesButNotBy=function(e,t,r,n,a){if(arguments.length===4&&typeof t=="function"){let i=n;n=r,a=i}else arguments.length===3&&(n=r,r=null);new S(e,a,C.changesButNotBy,!0).to.change(t,r).but.not.by(n)};C.increases=function(e,t,r,n){return arguments.length===3&&typeof t=="function"&&(n=r,r=null),new S(e,n,C.increases,!0).to.increase(t,r)};C.increasesBy=function(e,t,r,n,a){if(arguments.length===4&&typeof t=="function"){let i=n;n=r,a=i}else arguments.length===3&&(n=r,r=null);new S(e,a,C.increasesBy,!0).to.increase(t,r).by(n)};C.doesNotIncrease=function(e,t,r,n){return arguments.length===3&&typeof t=="function"&&(n=r,r=null),new S(e,n,C.doesNotIncrease,!0).to.not.increase(t,r)};C.increasesButNotBy=function(e,t,r,n,a){if(arguments.length===4&&typeof t=="function"){let i=n;n=r,a=i}else arguments.length===3&&(n=r,r=null);new S(e,a,C.increasesButNotBy,!0).to.increase(t,r).but.not.by(n)};C.decreases=function(e,t,r,n){return arguments.length===3&&typeof t=="function"&&(n=r,r=null),new S(e,n,C.decreases,!0).to.decrease(t,r)};C.decreasesBy=function(e,t,r,n,a){if(arguments.length===4&&typeof t=="function"){let i=n;n=r,a=i}else arguments.length===3&&(n=r,r=null);new S(e,a,C.decreasesBy,!0).to.decrease(t,r).by(n)};C.doesNotDecrease=function(e,t,r,n){return arguments.length===3&&typeof t=="function"&&(n=r,r=null),new S(e,n,C.doesNotDecrease,!0).to.not.decrease(t,r)};C.doesNotDecreaseBy=function(e,t,r,n,a){if(arguments.length===4&&typeof t=="function"){let i=n;n=r,a=i}else arguments.length===3&&(n=r,r=null);return new S(e,a,C.doesNotDecreaseBy,!0).to.not.decrease(t,r).by(n)};C.decreasesButNotBy=function(e,t,r,n,a){if(arguments.length===4&&typeof t=="function"){let i=n;n=r,a=i}else arguments.length===3&&(n=r,r=null);new S(e,a,C.decreasesButNotBy,!0).to.decrease(t,r).but.not.by(n)};C.ifError=function(e){if(e)throw e};C.isExtensible=function(e,t){new S(e,t,C.isExtensible,!0).to.be.extensible};C.isNotExtensible=function(e,t){new S(e,t,C.isNotExtensible,!0).to.not.be.extensible};C.isSealed=function(e,t){new S(e,t,C.isSealed,!0).to.be.sealed};C.isNotSealed=function(e,t){new S(e,t,C.isNotSealed,!0).to.not.be.sealed};C.isFrozen=function(e,t){new S(e,t,C.isFrozen,!0).to.be.frozen};C.isNotFrozen=function(e,t){new S(e,t,C.isNotFrozen,!0).to.not.be.frozen};C.isEmpty=function(e,t){new S(e,t,C.isEmpty,!0).to.be.empty};C.isNotEmpty=function(e,t){new S(e,t,C.isNotEmpty,!0).to.not.be.empty};C.containsSubset=function(e,t,r){new S(e,r).to.containSubset(t)};C.doesNotContainSubset=function(e,t,r){new S(e,r).to.not.containSubset(t)};var BA=[["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 BA)C[t]=C[e];var Eh=[];function Yt(e){const t={use:Yt,AssertionError:be,util:Ke,config:Ge,expect:ur,assert:C,Assertion:S,...Pv};return~Eh.indexOf(e)||(e(t,Ke),Eh.push(e)),t}$(Yt,"use");const ns=Symbol.for("matchers-object"),hi=Symbol.for("$$jest-matchers-object"),_s=Symbol.for("expect-global"),Ic=Symbol.for("asymmetric-matchers-object"),as=Ie.green,Oc=Ie.red,zA=Ie.inverse,UA=Ie.bold,Wt=Ie.dim;function WA(e,t="received",r="expected",n={}){const{comment:a="",isDirectExpectCall:i=!1,isNot:o=!1,promise:s="",secondArgument:l="",expectedColor:u=as,receivedColor:d=Oc,secondArgumentColor:c=as}=n;let f="",p="expect";return!i&&t!==""&&(f+=Wt(`${p}(`)+d(t),p=")"),s!==""&&(f+=Wt(`${p}.`)+s,p=""),o&&(f+=`${Wt(`${p}.`)}not`,p=""),e.includes(".")?p+=e:(f+=Wt(`${p}.`)+e,p=""),r===""?p+="()":(f+=Wt(`${p}(`)+u(r),l&&(f+=Wt(", ")+c(l)),p=")"),a!==""&&(p+=` // ${a}`),p!==""&&(f+=Wt(p)),f}const VA="·";function kv(e){return e.replace(/\s+$/gm,t=>VA.repeat(t.length))}function HA(e){return Oc(kv(at(e)))}function GA(e){return as(kv(at(e)))}function Mv(){return{EXPECTED_COLOR:as,RECEIVED_COLOR:Oc,INVERTED_COLOR:zA,BOLD_WEIGHT:UA,DIM_COLOR:Wt,diff:Br,matcherHint:WA,printReceived:HA,printExpected:GA,printDiffOrStringify:Oy}}function KA(e){if(!Array.isArray(e))throw new TypeError(`expect.customEqualityTesters: Must be set to an array of Testers. Was given "${Ji(e)}"`);globalThis[hi].customEqualityTesters.push(...e)}function Nc(){return globalThis[hi].customEqualityTesters}function he(e,t,r,n){return r=r||[],Av(e,t,[],[],r,n?qv:XA)}function Th(e){return!!e&&typeof e=="object"&&"asymmetricMatch"in e&&ft("Function",e.asymmetricMatch)}function JA(e,t){const r=Th(e),n=Th(t);if(!(r&&n)){if(r)return e.asymmetricMatch(t);if(n)return t.asymmetricMatch(e)}}function Av(e,t,r,n,a,i){let o=!0;const s=JA(e,t);if(s!==void 0)return s;const l={equals:he};for(let m=0;m<a.length;m++){const g=a[m].call(l,e,t,a);if(g!==void 0)return g}if(e instanceof Error&&t instanceof Error)return e.message===t.message;if(typeof URL=="function"&&e instanceof URL&&t instanceof URL)return e.href===t.href;if(Object.is(e,t))return!0;if(e===null||t===null)return e===t;const u=Object.prototype.toString.call(e);if(u!==Object.prototype.toString.call(t))return!1;switch(u){case"[object Boolean]":case"[object String]":case"[object Number]":return typeof e!=typeof t?!1:typeof e!="object"&&typeof t!="object"?Object.is(e,t):Object.is(e.valueOf(),t.valueOf());case"[object Date]":{const m=+e,g=+t;return m===g||Number.isNaN(m)&&Number.isNaN(g)}case"[object RegExp]":return e.source===t.source&&e.flags===t.flags}if(typeof e!="object"||typeof t!="object")return!1;if(_h(e)&&_h(t))return e.isEqualNode(t);let d=r.length;for(;d--;){if(r[d]===e)return n[d]===t;if(n[d]===t)return!1}if(r.push(e),n.push(t),u==="[object Array]"&&e.length!==t.length)return!1;const c=Sh(e,i);let f,p=c.length;if(Sh(t,i).length!==p)return!1;for(;p--;)if(f=c[p],o=i(t,f)&&Av(e[f],t[f],r,n,a,i),!o)return!1;return r.pop(),n.pop(),o}function Sh(e,t){const r=[];for(const n in e)t(e,n)&&r.push(n);return r.concat(Object.getOwnPropertySymbols(e).filter(n=>Object.getOwnPropertyDescriptor(e,n).enumerable))}function XA(e,t){return qv(e,t)&&e[t]!==void 0}function qv(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function ft(e,t){return Object.prototype.toString.apply(t)===`[object ${e}]`}function _h(e){return e!==null&&typeof e=="object"&&"nodeType"in e&&typeof e.nodeType=="number"&&"nodeName"in e&&typeof e.nodeName=="string"&&"isEqualNode"in e&&typeof e.isEqualNode=="function"}const Iv="@@__IMMUTABLE_KEYED__@@",Ov="@@__IMMUTABLE_SET__@@",YA="@@__IMMUTABLE_LIST__@@",Ps="@@__IMMUTABLE_ORDERED__@@",QA="@@__IMMUTABLE_RECORD__@@";function ZA(e){return!!(e&&e[Iv]&&!e[Ps])}function eq(e){return!!(e&&e[Ov]&&!e[Ps])}function ks(e){return e!=null&&typeof e=="object"&&!Array.isArray(e)}function tq(e){return!!(e&&ks(e)&&e[YA])}function rq(e){return!!(e&&ks(e)&&e[Iv]&&e[Ps])}function nq(e){return!!(e&&ks(e)&&e[Ov]&&e[Ps])}function aq(e){return!!(e&&ks(e)&&e[QA])}const Nv=Symbol.iterator;function Ph(e){return!!(e!=null&&e[Nv])}function Ye(e,t,r=[],n=[],a=[]){if(typeof e!="object"||typeof t!="object"||Array.isArray(e)||Array.isArray(t)||!Ph(e)||!Ph(t))return;if(e.constructor!==t.constructor)return!1;let i=n.length;for(;i--;)if(n[i]===e)return a[i]===t;n.push(e),a.push(t);const o=[...r.filter(u=>u!==Ye),s];function s(u,d){return Ye(u,d,[...r],[...n],[...a])}if(e.size!==void 0){if(e.size!==t.size)return!1;if(ft("Set",e)||eq(e)){let u=!0;for(const d of e)if(!t.has(d)){let c=!1;for(const f of t)he(d,f,o)===!0&&(c=!0);if(c===!1){u=!1;break}}return n.pop(),a.pop(),u}else if(ft("Map",e)||ZA(e)){let u=!0;for(const d of e)if(!t.has(d[0])||!he(d[1],t.get(d[0]),o)){let c=!1;for(const f of t){const p=he(d[0],f[0],o);let m=!1;p===!0&&(m=he(d[1],f[1],o)),m===!0&&(c=!0)}if(c===!1){u=!1;break}}return n.pop(),a.pop(),u}}const l=t[Nv]();for(const u of e){const d=l.next();if(d.done||!he(u,d.value,o))return!1}if(!l.next().done)return!1;if(!tq(e)&&!rq(e)&&!nq(e)&&!aq(e)){const u=Object.entries(e),d=Object.entries(t);if(!he(u,d))return!1}return n.pop(),a.pop(),!0}function $c(e,t){return!e||typeof e!="object"||e===Object.prototype?!1:Object.prototype.hasOwnProperty.call(e,t)||$c(Object.getPrototypeOf(e),t)}function oq(e){return Mr(e)&&!(e instanceof Error)&&!Array.isArray(e)&&!(e instanceof Date)}function Ur(e,t,r=[]){const n=r.filter(i=>i!==Ur),a=(i=new WeakMap)=>(o,s)=>{if(oq(s))return Object.keys(s).every(l=>{if(s[l]!=null&&typeof s[l]=="object"){if(i.has(s[l]))return he(o[l],s[l],n);i.set(s[l],!0)}const u=o!=null&&$c(o,l)&&he(o[l],s[l],[...n,a(i)]);return i.delete(s[l]),u})};return a()(e,t)}function kh(e,t){if(!(e==null||t==null||e.constructor===t.constructor))return!1}function Mh(e,t){let r=e,n=t;if(!(e instanceof DataView&&t instanceof DataView)){if(!(e instanceof ArrayBuffer)||!(t instanceof ArrayBuffer))return;try{r=new DataView(e),n=new DataView(t)}catch{return}}if(r.byteLength!==n.byteLength)return!1;for(let a=0;a<r.byteLength;a++)if(r.getUint8(a)!==n.getUint8(a))return!1;return!0}function fu(e,t,r=[]){if(!Array.isArray(e)||!Array.isArray(t))return;const n=Object.keys(e),a=Object.keys(t),i=r.filter(o=>o!==fu);return he(e,t,i,!0)&&he(n,a)}function iq(e,t="#{this}",r="#{exp}"){const n=`expected ${t} to be ${r} // Object.is equality`;return["toStrictEqual","toEqual"].includes(e)?`${n}
135
+
136
+ If it should pass with deep equality, replace "toBe" with "${e}"
137
+
138
+ Expected: ${t}
139
+ Received: serializes to the same string
140
+ `:n}function sq(e,t){return`${t} ${e}${t===1?"":"s"}`}function el(e){return[...Object.keys(e),...Object.getOwnPropertySymbols(e).filter(t=>{var r;return(r=Object.getOwnPropertyDescriptor(e,t))==null?void 0:r.enumerable})]}function lq(e,t,r){let n=0;const a=(i=new WeakMap)=>(o,s)=>{if(Array.isArray(o)){if(Array.isArray(s)&&s.length===o.length)return s.map((l,u)=>a(i)(o[u],l))}else{if(o instanceof Date)return o;if(Mr(o)&&Mr(s)){if(he(o,s,[...r,Ye,Ur]))return s;const l={};i.set(o,l),typeof o.constructor=="function"&&typeof o.constructor.name=="string"&&Object.defineProperty(l,"constructor",{enumerable:!1,value:o.constructor});for(const u of el(o))$c(s,u)?l[u]=i.has(o[u])?i.get(o[u]):a(i)(o[u],s[u]):i.has(o[u])||(n+=1,Mr(o[u])&&(n+=el(o[u]).length),a(i)(o[u],s[u]));if(el(l).length>0)return l}}return o};return{subset:a()(e,t),stripped:n}}if(!Object.prototype.hasOwnProperty.call(globalThis,ns)){const e=new WeakMap,t=Object.create(null),r=[],n=Object.create(null);Object.defineProperty(globalThis,ns,{get:()=>e}),Object.defineProperty(globalThis,hi,{configurable:!0,get:()=>({state:e.get(globalThis[_s]),matchers:t,customEqualityTesters:r})}),Object.defineProperty(globalThis,Ic,{get:()=>n})}function Ko(e){return globalThis[ns].get(e)}function tl(e,t){const r=globalThis[ns],n=r.get(t)||{},a=Object.defineProperties(n,{...Object.getOwnPropertyDescriptors(n),...Object.getOwnPropertyDescriptors(e)});r.set(t,a)}let Qt=class{constructor(t,r=!1){re(this,"$$typeof",Symbol.for("jest.asymmetricMatcher"));this.sample=t,this.inverse=r}getMatcherContext(t){return{...Ko(t||globalThis[_s]),equals:he,isNot:this.inverse,customTesters:Nc(),utils:{...Mv(),diff:Br,stringify:at,iterableEquality:Ye,subsetEquality:Ur}}}[Symbol.for("chai/inspect")](t){const r=at(this,t.depth,{min:!0});return r.length<=t.truncate?r:`${this.toString()}{…}`}};class Ah extends Qt{constructor(t,r=!1){if(!ft("String",t))throw new Error("Expected is not a string");super(t,r)}asymmetricMatch(t){const r=ft("String",t)&&t.includes(this.sample);return this.inverse?!r:r}toString(){return`String${this.inverse?"Not":""}Containing`}getExpectedType(){return"string"}}class uq extends Qt{asymmetricMatch(t){return t!=null}toString(){return"Anything"}toAsymmetricMatcher(){return"Anything"}}class qh extends Qt{constructor(t,r=!1){super(t,r)}getPrototype(t){return Object.getPrototypeOf?Object.getPrototypeOf(t):t.constructor.prototype===t?null:t.constructor.prototype}hasProperty(t,r){return t?Object.prototype.hasOwnProperty.call(t,r)?!0:this.hasProperty(this.getPrototype(t),r):!1}asymmetricMatch(t){if(typeof this.sample!="object")throw new TypeError(`You must provide an object to ${this.toString()}, not '${typeof this.sample}'.`);let r=!0;const n=this.getMatcherContext();for(const a in this.sample)if(!this.hasProperty(t,a)||!he(this.sample[a],t[a],n.customTesters)){r=!1;break}return this.inverse?!r:r}toString(){return`Object${this.inverse?"Not":""}Containing`}getExpectedType(){return"object"}}class Ih extends Qt{constructor(t,r=!1){super(t,r)}asymmetricMatch(t){if(!Array.isArray(this.sample))throw new TypeError(`You must provide an array to ${this.toString()}, not '${typeof this.sample}'.`);const r=this.getMatcherContext(),n=this.sample.length===0||Array.isArray(t)&&this.sample.every(a=>t.some(i=>he(a,i,r.customTesters)));return this.inverse?!n:n}toString(){return`Array${this.inverse?"Not":""}Containing`}getExpectedType(){return"array"}}class cq extends Qt{constructor(t){if(typeof t>"u")throw new TypeError("any() expects to be passed a constructor function. Please pass one or use anything() to match any object.");super(t)}fnNameFor(t){if(t.name)return t.name;const n=Function.prototype.toString.call(t).match(/^(?:async)?\s*function\s*(?:\*\s*)?([\w$]+)\s*\(/);return n?n[1]:"<anonymous>"}asymmetricMatch(t){return this.sample===String?typeof t=="string"||t instanceof String:this.sample===Number?typeof t=="number"||t instanceof Number:this.sample===Function?typeof t=="function"||t instanceof Function:this.sample===Boolean?typeof t=="boolean"||t instanceof Boolean:this.sample===BigInt?typeof t=="bigint"||t instanceof BigInt:this.sample===Symbol?typeof t=="symbol"||t instanceof Symbol:this.sample===Object?typeof t=="object":t instanceof this.sample}toString(){return"Any"}getExpectedType(){return this.sample===String?"string":this.sample===Number?"number":this.sample===Function?"function":this.sample===Object?"object":this.sample===Boolean?"boolean":this.fnNameFor(this.sample)}toAsymmetricMatcher(){return`Any<${this.fnNameFor(this.sample)}>`}}class Oh extends Qt{constructor(t,r=!1){if(!ft("String",t)&&!ft("RegExp",t))throw new Error("Expected is not a String or a RegExp");super(new RegExp(t),r)}asymmetricMatch(t){const r=ft("String",t)&&this.sample.test(t);return this.inverse?!r:r}toString(){return`String${this.inverse?"Not":""}Matching`}getExpectedType(){return"string"}}class Nh extends Qt{constructor(r,n=2,a=!1){if(!ft("Number",r))throw new Error("Expected is not a Number");if(!ft("Number",n))throw new Error("Precision is not a Number");super(r);re(this,"precision");this.inverse=a,this.precision=n}asymmetricMatch(r){if(!ft("Number",r))return!1;let n=!1;return r===Number.POSITIVE_INFINITY&&this.sample===Number.POSITIVE_INFINITY||r===Number.NEGATIVE_INFINITY&&this.sample===Number.NEGATIVE_INFINITY?n=!0:n=Math.abs(this.sample-r)<10**-this.precision/2,this.inverse?!n:n}toString(){return`Number${this.inverse?"Not":""}CloseTo`}getExpectedType(){return"number"}toAsymmetricMatcher(){return[this.toString(),this.sample,`(${sq("digit",this.precision)})`].join(" ")}}const dq=(e,t)=>{t.addMethod(e.expect,"anything",()=>new uq),t.addMethod(e.expect,"any",r=>new cq(r)),t.addMethod(e.expect,"stringContaining",r=>new Ah(r)),t.addMethod(e.expect,"objectContaining",r=>new qh(r)),t.addMethod(e.expect,"arrayContaining",r=>new Ih(r)),t.addMethod(e.expect,"stringMatching",r=>new Oh(r)),t.addMethod(e.expect,"closeTo",(r,n)=>new Nh(r,n)),e.expect.not={stringContaining:r=>new Ah(r,!0),objectContaining:r=>new qh(r,!0),arrayContaining:r=>new Ih(r,!0),stringMatching:r=>new Oh(r,!0),closeTo:(r,n)=>new Nh(r,n,!0)}};function $h(e,t,r){const n=e.flag(t,"negate")?"not.":"",a=`${e.flag(t,"_name")}(${r?"expected":""})`,i=e.flag(t,"promise");return`expect(actual)${i?`.${i}`:""}.${n}${a}`}function jh(e,t,r,n){const a=e;if(a&&t instanceof Promise){t=t.finally(()=>{if(!a.promises)return;const o=a.promises.indexOf(t);o!==-1&&a.promises.splice(o,1)}),a.promises||(a.promises=[]),a.promises.push(t);let i=!1;return a.onFinished??(a.onFinished=[]),a.onFinished.push(()=>{var o;if(!i){const l=(((o=globalThis.__vitest_worker__)==null?void 0:o.onFilterStackTrace)||(u=>u||""))(n.stack);console.warn([`Promise returned by \`${r}\` was not awaited. `,"Vitest currently auto-awaits hanging assertions at the end of the test, but this will cause the test to fail in Vitest 3. ",`Please remember to await the assertion.
141
+ `,l].join(""))}}),{then(o,s){return i=!0,t.then(o,s)},catch(o){return t.catch(o)},finally(o){return t.finally(o)},[Symbol.toStringTag]:"Promise"}}return t}function $v(e,t,r){return function(...n){var a;if(t!=="withTest"&&e.flag(this,"_name",t),!e.flag(this,"soft"))return r.apply(this,n);const i=e.flag(this,"vitest-test");if(!i)throw new Error("expect.soft() can only be used inside a test");try{return r.apply(this,n)}catch(o){i.result||(i.result={state:"fail"}),i.result.state="fail",(a=i.result).errors||(a.errors=[]),i.result.errors.push(Fy(o))}}}const fq=(e,t)=>{const{AssertionError:r}=e,n=Nc();function a(s,l){const u=d=>{const c=$v(t,d,l);t.addMethod(e.Assertion.prototype,d,c),t.addMethod(globalThis[hi].matchers,d,c)};Array.isArray(s)?s.forEach(d=>u(d)):u(s)}["throw","throws","Throw"].forEach(s=>{t.overwriteMethod(e.Assertion.prototype,s,l=>function(...u){const d=t.flag(this,"promise"),c=t.flag(this,"object"),f=t.flag(this,"negate");if(d==="rejects")t.flag(this,"object",()=>{throw c});else if(d==="resolves"&&typeof c!="function"){if(f)return;{const p=t.flag(this,"message")||"expected promise to throw an error, but it didn't",m={showDiff:!1};throw new r(p,m,t.flag(this,"ssfi"))}}l.apply(this,u)})}),a("withTest",function(s){return t.flag(this,"vitest-test",s),this}),a("toEqual",function(s){const l=t.flag(this,"object"),u=he(l,s,[...n,Ye]);return this.assert(u,"expected #{this} to deeply equal #{exp}","expected #{this} to not deeply equal #{exp}",s,l)}),a("toStrictEqual",function(s){const l=t.flag(this,"object"),u=he(l,s,[...n,Ye,kh,fu,Mh],!0);return this.assert(u,"expected #{this} to strictly equal #{exp}","expected #{this} to not strictly equal #{exp}",s,l)}),a("toBe",function(s){const l=this._obj,u=Object.is(l,s);let d="";return u||(he(l,s,[...n,Ye,kh,fu,Mh],!0)?d="toStrictEqual":he(l,s,[...n,Ye])&&(d="toEqual")),this.assert(u,iq(d),"expected #{this} not to be #{exp} // Object.is equality",s,l)}),a("toMatchObject",function(s){const l=this._obj,u=he(l,s,[...n,Ye,Ur]),d=t.flag(this,"negate"),{subset:c,stripped:f}=lq(l,s,n);if(u&&d||!u&&!d){const p=t.getMessage(this,[u,"expected #{this} to match object #{exp}","expected #{this} to not match object #{exp}",s,c,!1]),m=f===0?p:`${p}
142
+ (${f} matching ${f===1?"property":"properties"} omitted from actual)`;throw new r(m,{showDiff:!0,expected:s,actual:c})}}),a("toMatch",function(s){const l=this._obj;if(typeof l!="string")throw new TypeError(`.toMatch() expects to receive a string, but got ${typeof l}`);return this.assert(typeof s=="string"?l.includes(s):l.match(s),"expected #{this} to match #{exp}","expected #{this} not to match #{exp}",s,l)}),a("toContain",function(s){const l=this._obj;if(typeof Node<"u"&&l instanceof Node){if(!(s instanceof Node))throw new TypeError(`toContain() expected a DOM node as the argument, but got ${typeof s}`);return this.assert(l.contains(s),"expected #{this} to contain element #{exp}","expected #{this} not to contain element #{exp}",s,l)}if(typeof DOMTokenList<"u"&&l instanceof DOMTokenList){bt(s,"class name",["string"]);const d=t.flag(this,"negate")?l.value.replace(s,"").trim():`${l.value} ${s}`;return this.assert(l.contains(s),`expected "${l.value}" to contain "${s}"`,`expected "${l.value}" not to contain "${s}"`,d,l.value)}return typeof l=="string"&&typeof s=="string"?this.assert(l.includes(s),"expected #{this} to contain #{exp}","expected #{this} not to contain #{exp}",s,l):(l!=null&&typeof l!="string"&&t.flag(this,"object",Array.from(l)),this.contain(s))}),a("toContainEqual",function(s){const l=t.flag(this,"object"),u=Array.from(l).findIndex(d=>he(d,s,n));this.assert(u!==-1,"expected #{this} to deep equally contain #{exp}","expected #{this} to not deep equally contain #{exp}",s)}),a("toBeTruthy",function(){const s=t.flag(this,"object");this.assert(!!s,"expected #{this} to be truthy","expected #{this} to not be truthy",!0,s)}),a("toBeFalsy",function(){const s=t.flag(this,"object");this.assert(!s,"expected #{this} to be falsy","expected #{this} to not be falsy",!1,s)}),a("toBeGreaterThan",function(s){const l=this._obj;return bt(l,"actual",["number","bigint"]),bt(s,"expected",["number","bigint"]),this.assert(l>s,`expected ${l} to be greater than ${s}`,`expected ${l} to be not greater than ${s}`,s,l,!1)}),a("toBeGreaterThanOrEqual",function(s){const l=this._obj;return bt(l,"actual",["number","bigint"]),bt(s,"expected",["number","bigint"]),this.assert(l>=s,`expected ${l} to be greater than or equal to ${s}`,`expected ${l} to be not greater than or equal to ${s}`,s,l,!1)}),a("toBeLessThan",function(s){const l=this._obj;return bt(l,"actual",["number","bigint"]),bt(s,"expected",["number","bigint"]),this.assert(l<s,`expected ${l} to be less than ${s}`,`expected ${l} to be not less than ${s}`,s,l,!1)}),a("toBeLessThanOrEqual",function(s){const l=this._obj;return bt(l,"actual",["number","bigint"]),bt(s,"expected",["number","bigint"]),this.assert(l<=s,`expected ${l} to be less than or equal to ${s}`,`expected ${l} to be not less than or equal to ${s}`,s,l,!1)}),a("toBeNaN",function(){const s=t.flag(this,"object");this.assert(Number.isNaN(s),"expected #{this} to be NaN","expected #{this} not to be NaN",Number.NaN,s)}),a("toBeUndefined",function(){const s=t.flag(this,"object");this.assert(s===void 0,"expected #{this} to be undefined","expected #{this} not to be undefined",void 0,s)}),a("toBeNull",function(){const s=t.flag(this,"object");this.assert(s===null,"expected #{this} to be null","expected #{this} not to be null",null,s)}),a("toBeDefined",function(){const s=t.flag(this,"object");this.assert(typeof s<"u","expected #{this} to be defined","expected #{this} to be undefined",s)}),a("toBeTypeOf",function(s){const l=typeof this._obj,u=s===l;return this.assert(u,"expected #{this} to be type of #{exp}","expected #{this} not to be type of #{exp}",s,l)}),a("toBeInstanceOf",function(s){return this.instanceOf(s)}),a("toHaveLength",function(s){return this.have.length(s)}),a("toHaveProperty",function(...s){Array.isArray(s[0])&&(s[0]=s[0].map(b=>String(b).replace(/([.[\]])/g,"\\$1")).join("."));const l=this._obj,[u,d]=s,c=()=>Object.prototype.hasOwnProperty.call(l,u)?{value:l[u],exists:!0}:t.getPathInfo(l,u),{value:f,exists:p}=c(),m=p&&(s.length===1||he(d,f,n)),g=s.length===1?"":` with value ${t.objDisplay(d)}`;return this.assert(m,`expected #{this} to have property "${u}"${g}`,`expected #{this} to not have property "${u}"${g}`,d,p?f:void 0)}),a("toBeCloseTo",function(s,l=2){const u=this._obj;let d=!1,c=0,f=0;return s===Number.POSITIVE_INFINITY&&u===Number.POSITIVE_INFINITY||s===Number.NEGATIVE_INFINITY&&u===Number.NEGATIVE_INFINITY?d=!0:(c=10**-l/2,f=Math.abs(u-s),d=f<c),this.assert(d,`expected #{this} to be close to #{exp}, received difference is ${f}, but expected ${c}`,`expected #{this} to not be close to #{exp}, received difference is ${f}, but expected ${c}`,s,u,!1)});function i(s){if(!Dy(s._obj))throw new TypeError(`${t.inspect(s._obj)} is not a spy or a call to a spy!`)}function o(s){return i(s),s._obj}a(["toHaveBeenCalledTimes","toBeCalledTimes"],function(s){const l=o(this),u=l.getMockName(),d=l.mock.calls.length;return this.assert(d===s,`expected "${u}" to be called #{exp} times, but got ${d} times`,`expected "${u}" to not be called #{exp} times`,s,d,!1)}),a("toHaveBeenCalledOnce",function(){const s=o(this),l=s.getMockName(),u=s.mock.calls.length;return this.assert(u===1,`expected "${l}" to be called once, but got ${u} times`,`expected "${l}" to not be called once`,1,u,!1)}),a(["toHaveBeenCalled","toBeCalled"],function(){const s=o(this),l=s.getMockName(),u=s.mock.calls.length,d=u>0,c=t.flag(this,"negate");let f=t.getMessage(this,[d,`expected "${l}" to be called at least once`,`expected "${l}" to not be called at all, but actually been called ${u} times`,!0,d]);if(d&&c&&(f=Dh(s,f)),d&&c||!d&&!c)throw new r(f)}),a(["toHaveBeenCalledWith","toBeCalledWith"],function(...s){const l=o(this),u=l.getMockName(),d=l.mock.calls.some(p=>he(p,s,[...n,Ye])),c=t.flag(this,"negate"),f=t.getMessage(this,[d,`expected "${u}" to be called with arguments: #{exp}`,`expected "${u}" to not be called with arguments: #{exp}`,s]);if(d&&c||!d&&!c)throw new r(Dh(l,f,s))}),a(["toHaveBeenNthCalledWith","nthCalledWith"],function(s,...l){const u=o(this),d=u.getMockName(),c=u.mock.calls[s-1],f=u.mock.calls.length,p=s<=f;this.assert(he(c,l,[...n,Ye]),`expected ${Jo(s)} "${d}" call to have been called with #{exp}${p?"":`, but called only ${f} times`}`,`expected ${Jo(s)} "${d}" call to not have been called with #{exp}`,l,c,p)}),a(["toHaveBeenLastCalledWith","lastCalledWith"],function(...s){const l=o(this),u=l.getMockName(),d=l.mock.calls[l.mock.calls.length-1];this.assert(he(d,s,[...n,Ye]),`expected last "${u}" call to have been called with #{exp}`,`expected last "${u}" call to not have been called with #{exp}`,s,d)}),a(["toThrow","toThrowError"],function(s){if(typeof s=="string"||typeof s>"u"||s instanceof RegExp)return this.throws(s===""?/^$/:s);const l=this._obj,u=t.flag(this,"promise"),d=t.flag(this,"negate");let c=null;if(u==="rejects")c=l;else if(u==="resolves"&&typeof l!="function"){if(d)return;{const f=t.flag(this,"message")||"expected promise to throw an error, but it didn't",p={showDiff:!1};throw new r(f,p,t.flag(this,"ssfi"))}}else{let f=!1;try{l()}catch(p){f=!0,c=p}if(!f&&!d){const p=t.flag(this,"message")||"expected function to throw an error, but it didn't",m={showDiff:!1};throw new r(p,m,t.flag(this,"ssfi"))}}if(typeof s=="function"){const f=s.name||s.prototype.constructor.name;return this.assert(c&&c instanceof s,`expected error to be instance of ${f}`,`expected error not to be instance of ${f}`,s,c)}if(s instanceof Error)return this.assert(c&&s.message===c.message,`expected error to have message: ${s.message}`,`expected error not to have message: ${s.message}`,s.message,c&&c.message);if(typeof s=="object"&&"asymmetricMatch"in s&&typeof s.asymmetricMatch=="function"){const f=s;return this.assert(c&&f.asymmetricMatch(c),"expected error to match asymmetric matcher","expected error not to match asymmetric matcher",f,c)}throw new Error(`"toThrow" expects string, RegExp, function, Error instance or asymmetric matcher, got "${typeof s}"`)}),[{name:"toHaveResolved",condition:s=>s.mock.settledResults.length>0&&s.mock.settledResults.some(({type:l})=>l==="fulfilled"),action:"resolved"},{name:["toHaveReturned","toReturn"],condition:s=>s.mock.calls.length>0&&s.mock.results.some(({type:l})=>l!=="throw"),action:"called"}].forEach(({name:s,condition:l,action:u})=>{a(s,function(){const d=o(this),c=d.getMockName(),f=l(d);this.assert(f,`expected "${c}" to be successfully ${u} at least once`,`expected "${c}" to not be successfully ${u}`,f,!f,!1)})}),[{name:"toHaveResolvedTimes",condition:(s,l)=>s.mock.settledResults.reduce((u,{type:d})=>d==="fulfilled"?++u:u,0)===l,action:"resolved"},{name:["toHaveReturnedTimes","toReturnTimes"],condition:(s,l)=>s.mock.results.reduce((u,{type:d})=>d==="throw"?u:++u,0)===l,action:"called"}].forEach(({name:s,condition:l,action:u})=>{a(s,function(d){const c=o(this),f=c.getMockName(),p=l(c,d);this.assert(p,`expected "${f}" to be successfully ${u} ${d} times`,`expected "${f}" to not be successfully ${u} ${d} times`,`expected resolved times: ${d}`,`received resolved times: ${p}`,!1)})}),[{name:"toHaveResolvedWith",condition:(s,l)=>s.mock.settledResults.some(({type:u,value:d})=>u==="fulfilled"&&he(l,d)),action:"resolve"},{name:["toHaveReturnedWith","toReturnWith"],condition:(s,l)=>s.mock.results.some(({type:u,value:d})=>u==="return"&&he(l,d)),action:"return"}].forEach(({name:s,condition:l,action:u})=>{a(s,function(d){const c=o(this),f=l(c,d),p=t.flag(this,"negate");if(f&&p||!f&&!p){const m=c.getMockName(),g=t.getMessage(this,[f,`expected "${m}" to ${u} with: #{exp} at least once`,`expected "${m}" to not ${u} with: #{exp}`,d]),b=u==="return"?c.mock.results:c.mock.settledResults;throw new r(pq(c,b,g,d))}})}),[{name:"toHaveLastResolvedWith",condition:(s,l)=>{const u=s.mock.settledResults[s.mock.settledResults.length-1];return u&&u.type==="fulfilled"&&he(u.value,l)},action:"resolve"},{name:["toHaveLastReturnedWith","lastReturnedWith"],condition:(s,l)=>{const u=s.mock.results[s.mock.results.length-1];return u&&u.type==="return"&&he(u.value,l)},action:"return"}].forEach(({name:s,condition:l,action:u})=>{a(s,function(d){const c=o(this),f=u==="return"?c.mock.results:c.mock.settledResults,p=f[f.length-1],m=c.getMockName();this.assert(l(c,d),`expected last "${m}" call to ${u} #{exp}`,`expected last "${m}" call to not ${u} #{exp}`,d,p?.value)})}),[{name:"toHaveNthResolvedWith",condition:(s,l,u)=>{const d=s.mock.settledResults[l-1];return d&&d.type==="fulfilled"&&he(d.value,u)},action:"resolve"},{name:["toHaveNthReturnedWith","nthReturnedWith"],condition:(s,l,u)=>{const d=s.mock.results[l-1];return d&&d.type==="return"&&he(d.value,u)},action:"return"}].forEach(({name:s,condition:l,action:u})=>{a(s,function(d,c){const f=o(this),p=f.getMockName(),g=(u==="return"?f.mock.results:f.mock.settledResults)[d-1],b=`${Jo(d)} call`;this.assert(l(f,d,c),`expected ${b} "${p}" call to ${u} #{exp}`,`expected ${b} "${p}" call to not ${u} #{exp}`,c,g?.value)})}),a("toSatisfy",function(s,l){return this.be.satisfy(s,l)}),a("withContext",function(s){for(const l in s)t.flag(this,l,s[l]);return this}),t.addProperty(e.Assertion.prototype,"resolves",function(){const l=new Error("resolves");t.flag(this,"promise","resolves"),t.flag(this,"error",l);const u=t.flag(this,"vitest-test"),d=t.flag(this,"object");if(t.flag(this,"poll"))throw new SyntaxError("expect.poll() is not supported in combination with .resolves");if(typeof d?.then!="function")throw new TypeError(`You must provide a Promise to expect() when using .resolves, not '${typeof d}'.`);const c=new Proxy(this,{get:(f,p,m)=>{const g=Reflect.get(f,p,m);return typeof g!="function"?g instanceof e.Assertion?c:g:(...b)=>{t.flag(this,"_name",p);const h=d.then(w=>(t.flag(this,"object",w),g.call(this,...b)),w=>{const x=new r(`promise rejected "${t.inspect(w)}" instead of resolving`,{showDiff:!1});throw x.cause=w,x.stack=l.stack.replace(l.message,x.message),x});return jh(u,h,$h(t,this,!!b.length),l)}}});return c}),t.addProperty(e.Assertion.prototype,"rejects",function(){const l=new Error("rejects");t.flag(this,"promise","rejects"),t.flag(this,"error",l);const u=t.flag(this,"vitest-test"),d=t.flag(this,"object"),c=typeof d=="function"?d():d;if(t.flag(this,"poll"))throw new SyntaxError("expect.poll() is not supported in combination with .rejects");if(typeof c?.then!="function")throw new TypeError(`You must provide a Promise to expect() when using .rejects, not '${typeof c}'.`);const f=new Proxy(this,{get:(p,m,g)=>{const b=Reflect.get(p,m,g);return typeof b!="function"?b instanceof e.Assertion?f:b:(...h)=>{t.flag(this,"_name",m);const w=c.then(x=>{const T=new r(`promise resolved "${t.inspect(x)}" instead of rejecting`,{showDiff:!0,expected:new Error("rejected promise"),actual:x});throw T.stack=l.stack.replace(l.message,T.message),T},x=>(t.flag(this,"object",x),b.call(this,...h)));return jh(u,w,$h(t,this,!!h.length),l)}}});return f})};function Jo(e){const t=e%10,r=e%100;return t===1&&r!==11?`${e}st`:t===2&&r!==12?`${e}nd`:t===3&&r!==13?`${e}rd`:`${e}th`}function Dh(e,t,r){return e.mock.calls&&(t+=Ie.gray(`
143
+
144
+ Received:
145
+
146
+ ${e.mock.calls.map((n,a)=>{let i=Ie.bold(` ${Jo(a+1)} ${e.getMockName()} call:
147
+
148
+ `);return r?i+=Br(r,n,{omitAnnotationLines:!0}):i+=at(n).split(`
149
+ `).map(o=>` ${o}`).join(`
150
+ `),i+=`
151
+ `,i}).join(`
152
+ `)}`)),t+=Ie.gray(`
153
+
154
+ Number of calls: ${Ie.bold(e.mock.calls.length)}
155
+ `),t}function pq(e,t,r,n){return r+=Ie.gray(`
156
+
157
+ Received:
158
+
159
+ ${t.map((a,i)=>{let o=Ie.bold(` ${Jo(i+1)} ${e.getMockName()} call return:
160
+
161
+ `);return n?o+=Br(n,a.value,{omitAnnotationLines:!0}):o+=at(a).split(`
162
+ `).map(s=>` ${s}`).join(`
163
+ `),o+=`
164
+ `,o}).join(`
165
+ `)}`),r+=Ie.gray(`
166
+
167
+ Number of calls: ${Ie.bold(e.mock.calls.length)}
168
+ `),r}function mq(e,t){const r=e._obj,n=Ke.flag(e,"negate"),a=Ke.flag(e,"promise")||"",i={...Mv(),diff:Br,stringify:at,iterableEquality:Ye,subsetEquality:Ur};return{state:{...Ko(t),customTesters:Nc(),isNot:n,utils:i,promise:a,equals:he,suppressedErrors:[],soft:Ke.flag(e,"soft"),poll:Ke.flag(e,"poll")},isNot:n,obj:r}}class Lh extends Error{constructor(t,r,n){super(t),this.actual=r,this.expected=n}}function hq(e,t,r){return(n,a)=>{Object.entries(r).forEach(([i,o])=>{function s(...c){const{state:f,isNot:p,obj:m}=mq(this,t),g=o.call(f,m,...c);if(g&&typeof g=="object"&&g instanceof Promise)return g.then(({pass:T,message:E,actual:y,expected:v})=>{if(T&&p||!T&&!p)throw new Lh(E(),y,v)});const{pass:b,message:h,actual:w,expected:x}=g;if(b&&p||!b&&!p)throw new Lh(h(),w,x)}const l=$v(a,i,s);a.addMethod(globalThis[hi].matchers,i,l),a.addMethod(e.Assertion.prototype,i,l);class u extends Qt{constructor(f=!1,...p){super(p,f)}asymmetricMatch(f){const{pass:p}=o.call(this.getMatcherContext(t),f,...this.sample);return this.inverse?!p:p}toString(){return`${this.inverse?"not.":""}${i}`}getExpectedType(){return"any"}toAsymmetricMatcher(){return`${this.toString()}<${this.sample.map(String).join(", ")}>`}}const d=(...c)=>new u(!1,...c);Object.defineProperty(t,i,{configurable:!0,enumerable:!0,value:d,writable:!0}),Object.defineProperty(t.not,i,{configurable:!0,enumerable:!0,value:(...c)=>new u(!0,...c),writable:!0}),Object.defineProperty(globalThis[Ic],i,{configurable:!0,enumerable:!0,value:d,writable:!0})})}}const gq=(e,t)=>{t.addMethod(e.expect,"extend",(r,n)=>{Yt(hq(e,r,n))})},Fh="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bq=new Uint8Array(64),yq=new Uint8Array(128);for(let e=0;e<Fh.length;e++){const t=Fh.charCodeAt(e);bq[e]=t,yq[t]=e}var Bh;(function(e){e[e.Empty=1]="Empty",e[e.Hash=2]="Hash",e[e.Query=3]="Query",e[e.RelativePath=4]="RelativePath",e[e.AbsolutePath=5]="AbsolutePath",e[e.SchemeRelative=6]="SchemeRelative",e[e.Absolute=7]="Absolute"})(Bh||(Bh={}));const vq=/^[A-Za-z]:\//;function wq(e=""){return e&&e.replace(/\\/g,"/").replace(vq,t=>t.toUpperCase())}const xq=/^[/\\](?![/\\])|^[/\\]{2}(?!\.)|^[A-Za-z]:[/\\]/;function Rq(){return typeof process<"u"&&typeof process.cwd=="function"?process.cwd().replace(/\\/g,"/"):"/"}const Cq=function(...e){e=e.map(n=>wq(n));let t="",r=!1;for(let n=e.length-1;n>=-1&&!r;n--){const a=n>=0?e[n]:Rq();!a||a.length===0||(t=`${a}/${t}`,r=zh(a))}return t=Eq(t,!r),r&&!zh(t)?`/${t}`:t.length>0?t:"."};function Eq(e,t){let r="",n=0,a=-1,i=0,o=null;for(let s=0;s<=e.length;++s){if(s<e.length)o=e[s];else{if(o==="/")break;o="/"}if(o==="/"){if(!(a===s-1||i===1))if(i===2){if(r.length<2||n!==2||r[r.length-1]!=="."||r[r.length-2]!=="."){if(r.length>2){const l=r.lastIndexOf("/");l===-1?(r="",n=0):(r=r.slice(0,l),n=r.length-1-r.lastIndexOf("/")),a=s,i=0;continue}else if(r.length>0){r="",n=0,a=s,i=0;continue}}t&&(r+=r.length>0?"/..":"..",n=2)}else r.length>0?r+=`/${e.slice(a+1,s)}`:r=e.slice(a+1,s),n=s-a-1;a=s,i=0}else o==="."&&i!==-1?++i:i=-1}return r}const zh=function(e){return xq.test(e)},jv=/^\s*at .*(?:\S:\d+|\(native\))/m,Tq=/^(?:eval@)?(?:\[native code\])?$/;function Dv(e){if(!e.includes(":"))return[e];const r=/(.+?)(?::(\d+))?(?::(\d+))?$/.exec(e.replace(/^\(|\)$/g,""));if(!r)return[e];let n=r[1];if(n.startsWith("async ")&&(n=n.slice(6)),(n.startsWith("http:")||n.startsWith("https:"))&&(n=new URL(n).pathname),n.startsWith("/@fs/")){const a=/^\/@fs\/[a-zA-Z]:\//.test(n);n=n.slice(a?5:4)}return[n,r[2]||void 0,r[3]||void 0]}function Sq(e){let t=e.trim();if(Tq.test(t)||(t.includes(" > eval")&&(t=t.replace(/ line (\d+)(?: > eval line \d+)* > eval:\d+:\d+/g,":$1")),!t.includes("@")&&!t.includes(":")))return null;const r=/((.*".+"[^@]*)?[^@]*)(@)/,n=t.match(r),a=n&&n[1]?n[1]:void 0,[i,o,s]=Dv(t.replace(r,""));return!i||!o||!s?null:{file:i,method:a||"",line:Number.parseInt(o),column:Number.parseInt(s)}}function Lv(e){const t=e.trim();return jv.test(t)?_q(t):Sq(t)}function _q(e){let t=e.trim();if(!jv.test(t))return null;t.includes("(eval ")&&(t=t.replace(/eval code/g,"eval").replace(/(\(eval at [^()]*)|(,.*$)/g,""));let r=t.replace(/^\s+/,"").replace(/\(eval code/g,"(").replace(/^.*?\s+/,"");const n=r.match(/ (\(.+\)$)/);r=n?r.replace(n[0],""):r;const[a,i,o]=Dv(n?n[1]:r);let s=n&&r||"",l=a&&["eval","<anonymous>"].includes(a)?void 0:a;return!l||!i||!o?null:(s.startsWith("async ")&&(s=s.slice(6)),l.startsWith("file://")&&(l=l.slice(7)),l=Cq(l),s&&(s=s.replace(/__vite_ssr_import_\d+__\./g,"")),{method:s,file:l,line:Number.parseInt(i),column:Number.parseInt(o)})}const Pq=/^[A-Za-z]:\//;function kq(e=""){return e&&e.replace(/\\/g,"/").replace(Pq,t=>t.toUpperCase())}const Mq=/^[/\\](?![/\\])|^[/\\]{2}(?!\.)|^[A-Za-z]:[/\\]/;function Aq(){return typeof process<"u"&&typeof process.cwd=="function"?process.cwd().replace(/\\/g,"/"):"/"}const qq=function(...e){e=e.map(n=>kq(n));let t="",r=!1;for(let n=e.length-1;n>=-1&&!r;n--){const a=n>=0?e[n]:Aq();!a||a.length===0||(t=`${a}/${t}`,r=Uh(a))}return t=Iq(t,!r),r&&!Uh(t)?`/${t}`:t.length>0?t:"."};function Iq(e,t){let r="",n=0,a=-1,i=0,o=null;for(let s=0;s<=e.length;++s){if(s<e.length)o=e[s];else{if(o==="/")break;o="/"}if(o==="/"){if(!(a===s-1||i===1))if(i===2){if(r.length<2||n!==2||r[r.length-1]!=="."||r[r.length-2]!=="."){if(r.length>2){const l=r.lastIndexOf("/");l===-1?(r="",n=0):(r=r.slice(0,l),n=r.length-1-r.lastIndexOf("/")),a=s,i=0;continue}else if(r.length>0){r="",n=0,a=s,i=0;continue}}t&&(r+=r.length>0?"/..":"..",n=2)}else r.length>0?r+=`/${e.slice(a+1,s)}`:r=e.slice(a+1,s),n=s-a-1;a=s,i=0}else o==="."&&i!==-1?++i:i=-1}return r}const Uh=function(e){return Mq.test(e)};function Fv(e,t){function r(a){const i=function(...o){return t.apply(a,o)};Object.assign(i,t),i.withContext=()=>i.bind(a),i.setContext=(o,s)=>{a[o]=s},i.mergeContext=o=>{Object.assign(a,o)};for(const o of e)Object.defineProperty(i,o,{get(){return r({...a,[o]:!0})}});return i}const n=r({});return n.fn=t,n}function Oq(e){const t=[e.name];let r=e;for(;r?.suite;)r=r.suite,r?.name&&t.unshift(r.name);return r!==e.file&&t.unshift(e.file.name),t}class Nq extends Error{constructor(r,n){super(r);re(this,"code","VITEST_PENDING");re(this,"taskId");this.message=r,this.taskId=n.id}}const qr={currentSuite:null};function $q(e){var t;(t=qr.currentSuite)==null||t.tasks.push(e)}async function jq(e,t){const r=qr.currentSuite;qr.currentSuite=e,await t(),qr.currentSuite=r}function Dq(e,t,r=!1){if(t<=0||t===Number.POSITIVE_INFINITY)return e;const{setTimeout:n,clearTimeout:a}=ui();return function(...o){return Promise.race([e(...o),new Promise((s,l)=>{var u;const d=n(()=>{a(d),l(new Error(Fq(r,t)))},t);(u=d.unref)==null||u.call(d)})])}}function Lq(e,t){var r;const n=function(){throw new Error("done() callback is deprecated, use promise instead")};return n.task=e,n.skip=()=>{throw e.pending=!0,new Nq("test is skipped; abort execution",e)},n.onTestFailed=a=>{e.onFailed||(e.onFailed=[]),e.onFailed.push(a)},n.onTestFinished=a=>{e.onFinished||(e.onFinished=[]),e.onFinished.push(a)},((r=t.extendTaskContext)==null?void 0:r.call(t,n))||n}function Fq(e,t){return`${e?"Hook":"Test"} timed out in ${t}ms.
169
+ If this is a long-running ${e?"hook":"test"}, pass a timeout value as the last argument or configure it globally with "${e?"hookTimeout":"testTimeout"}".`}const Bq=new WeakMap,Bv=new WeakMap,zv=new WeakMap;function zq(e,t){Bq.set(e,t)}function Uq(e,t){Bv.set(e,t)}function Wq(e){return Bv.get(e)}function Vq(e,t){zv.set(e,t)}function Hq(e){return zv.get(e)}function Gq(e,t={}){const r=["auto"],n=Object.entries(e).map(([a,i])=>{const o={value:i};return Array.isArray(i)&&i.length>=2&&Mr(i[1])&&Object.keys(i[1]).some(s=>r.includes(s))&&(Object.assign(o,i[1]),o.value=i[0]),o.prop=a,o.isFn=typeof o.value=="function",o});return Array.isArray(t.fixtures)?t.fixtures=t.fixtures.concat(n):t.fixtures=n,n.forEach(a=>{if(a.isFn){const i=Wv(a.value);i.length&&(a.deps=t.fixtures.filter(({prop:o})=>o!==a.prop&&i.includes(o)))}}),t}const rl=new Map,nl=new Map;function Kq(e,t){return r=>{const n=r||t;if(!n)return e({});const a=Wq(n);if(!a?.length)return e(n);const i=Wv(e),o=a.some(({auto:f})=>f);if(!i.length&&!o)return e(n);rl.get(n)||rl.set(n,new Map);const s=rl.get(n);nl.has(n)||nl.set(n,[]);const l=nl.get(n),u=a.filter(({prop:f,auto:p})=>p||i.includes(f)),d=Uv(u);if(!d.length)return e(n);async function c(){for(const f of d){if(s.has(f))continue;const p=f.isFn?await Jq(f.value,n,l):f.value;n[f.prop]=p,s.set(f,p),l.unshift(()=>{s.delete(f)})}}return c().then(()=>e(n))}}async function Jq(e,t,r){const n=Km();let a=!1;const i=e(t,async o=>{a=!0,n.resolve(o);const s=Km();r.push(async()=>{s.resolve(),await i}),await s}).catch(o=>{if(!a){n.reject(o);return}throw o});return n}function Uv(e,t=new Set,r=[]){return e.forEach(n=>{if(!r.includes(n)){if(!n.isFn||!n.deps){r.push(n);return}if(t.has(n))throw new Error(`Circular fixture dependency detected: ${n.prop} <- ${[...t].reverse().map(a=>a.prop).join(" <- ")}`);t.add(n),Uv(n.deps,t,r),r.push(n),t.clear()}}),r}function Wv(e){let t=e.toString();/__async\(this, (?:null|arguments|\[[_0-9, ]*\]), function\*/.test(t)&&(t=t.split("__async(this,")[1]);const r=t.match(/[^(]*\(([^)]*)/);if(!r)return[];const n=Wh(r[1]);if(!n.length)return[];let a=n[0];if("__VITEST_FIXTURE_INDEX__"in e&&(a=n[e.__VITEST_FIXTURE_INDEX__],!a))return[];if(!(a.startsWith("{")&&a.endsWith("}")))throw new Error(`The first argument inside a fixture must use object destructuring pattern, e.g. ({ test } => {}). Instead, received "${a}".`);const i=a.slice(1,-1).replace(/\s/g,""),o=Wh(i).map(l=>l.replace(/:.*|=.*/g,"")),s=o.at(-1);if(s&&s.startsWith("..."))throw new Error(`Rest parameters are not supported in fixtures, received "${s}".`);return o}function Wh(e){const t=[],r=[];let n=0;for(let i=0;i<e.length;i++)if(e[i]==="{"||e[i]==="[")r.push(e[i]==="{"?"}":"]");else if(e[i]===r[r.length-1])r.pop();else if(!r.length&&e[i]===","){const o=e.substring(n,i).trim();o&&t.push(o),n=i+1}const a=e.substring(n).trim();return a&&t.push(a),t}const _i=rI();jc(function(e,t,r){Hv().test.fn.call(this,cr(e),t,r)});let jo,Vv,Xq;function Yq(e,t){if(!e)throw new Error(`Vitest failed to find ${t}. This is a bug in Vitest. Please, open an issue with reproduction.`)}function Qq(){return Xq}function Hv(){const e=qr.currentSuite||Vv;return Yq(e,"the current suite"),e}function Zq(){return{beforeAll:[],afterAll:[],beforeEach:[],afterEach:[]}}function oi(e,t){let r={},n=()=>{};if(typeof t=="object"){if(typeof e=="object")throw new TypeError("Cannot use two objects as arguments. Please provide options and a function callback in that order.");r=t}else typeof t=="number"?r={timeout:t}:typeof e=="object"&&(r=e);if(typeof e=="function"){if(typeof t=="function")throw new TypeError("Cannot use two functions as arguments. Please use the second argument for options.");n=e}else typeof t=="function"&&(n=t);return{options:r,handler:n}}function eI(e,t=()=>{},r,n,a,i){const o=[],s=[];let l;p();const u=function(b="",h={}){const w={id:"",name:b,suite:void 0,each:h.each,fails:h.fails,context:void 0,type:"custom",file:void 0,retry:h.retry??jo.config.retry,repeats:h.repeats,mode:h.only?"only":h.skip?"skip":h.todo?"todo":"run",meta:h.meta??Object.create(null)},x=h.handler;(h.concurrent||!h.sequential&&jo.config.sequence.concurrent)&&(w.concurrent=!0),n&&(w.shuffle=!0);const T=Lq(w,jo);if(Object.defineProperty(w,"context",{value:T,enumerable:!1}),Uq(T,h.fixtures),x&&zq(w,Dq(tI(Kq(x,T),w),h?.timeout??jo.config.testTimeout)),jo.config.includeTaskLocation){const E=Error.stackTraceLimit;Error.stackTraceLimit=15;const y=new Error("stacktrace").stack;Error.stackTraceLimit=E;const v=aI(y,w.each??!1);v&&(w.location=v)}return o.push(w),w},d=jc(function(b,h,w){let{options:x,handler:T}=oi(h,w);typeof i=="object"&&(x=Object.assign({},i,x)),x.concurrent=this.concurrent||!this.sequential&&x?.concurrent,x.sequential=this.sequential||!this.concurrent&&x?.sequential;const E=u(cr(b),{...this,...x,handler:T});E.type="test"}),c={type:"collector",name:e,mode:r,options:i,test:d,tasks:o,collect:g,task:u,clear:m,on:f};function f(b,...h){Hq(l)[b].push(...h)}function p(b){typeof i=="number"&&(i={timeout:i}),l={id:"",type:"suite",name:e,mode:r,each:a,file:void 0,shuffle:n,tasks:[],meta:Object.create(null),concurrent:i?.concurrent},Vq(l,Zq())}function m(){o.length=0,s.length=0,p()}async function g(b){if(!b)throw new TypeError("File is required to collect tasks.");s.length=0,t&&await jq(c,()=>t(d));const h=[];for(const w of[...s,...o])h.push(w.type==="collector"?await w.collect(b):w);return l.file=b,l.tasks=h,h.forEach(w=>{w.suite=l,w.file=b}),l}return $q(c),c}function tI(e,t){return async(...r)=>{if(await e(...r),t.promises){const a=(await Promise.allSettled(t.promises)).map(i=>i.status==="rejected"?i.reason:void 0).filter(Boolean);if(a.length)throw a}}}function rI(){function e(t,r,n={}){const a=this.only?"only":this.skip?"skip":this.todo?"todo":"run",i=qr.currentSuite||Vv;let{options:o,handler:s}=oi(r,n);const l=o.concurrent||this.concurrent||o.sequential===!1,u=o.sequential||this.sequential||o.concurrent===!1;i?.options&&(o={...i.options,...o});const d=l||o.concurrent&&!u,c=u||o.sequential&&!l;return o.concurrent=d&&!c,o.sequential=c&&!d,eI(cr(t),s,a,this.shuffle,this.each,o)}return e.each=function(t,...r){const n=this.withContext();return this.setContext("each",!0),Array.isArray(t)&&r.length&&(t=pu(t,r)),(a,i,o)=>{const s=cr(a),l=t.every(Array.isArray),{options:u,handler:d}=oi(i,o),c=typeof i=="function";t.forEach((f,p)=>{const m=Array.isArray(f)?f:[f];c?l?n(Ot(s,m,p),()=>d(...m),u):n(Ot(s,m,p),()=>d(f),u):l?n(Ot(s,m,p),u,()=>d(...m)):n(Ot(s,m,p),u,()=>d(f))}),this.setContext("each",void 0)}},e.skipIf=t=>t?_i.skip:_i,e.runIf=t=>t?_i:_i.skip,Fv(["concurrent","sequential","shuffle","skip","only","todo"],e)}function nI(e,t){const r=e;r.each=function(a,...i){const o=this.withContext();return this.setContext("each",!0),Array.isArray(a)&&i.length&&(a=pu(a,i)),(s,l,u)=>{const d=cr(s),c=a.every(Array.isArray),{options:f,handler:p}=oi(l,u),m=typeof l=="function";a.forEach((g,b)=>{const h=Array.isArray(g)?g:[g];m?c?o(Ot(d,h,b),()=>p(...h),f):o(Ot(d,h,b),()=>p(g),f):c?o(Ot(d,h,b),f,()=>p(...h)):o(Ot(d,h,b),f,()=>p(g))}),this.setContext("each",void 0)}},r.for=function(a,...i){const o=this.withContext();return Array.isArray(a)&&i.length&&(a=pu(a,i)),(s,l,u)=>{const d=cr(s),{options:c,handler:f}=oi(l,u);a.forEach((p,m)=>{const g=b=>f(p,b);g.__VITEST_FIXTURE_INDEX__=1,g.toString=()=>f.toString(),o(Ot(d,RM(p),m),c,g)})}},r.skipIf=function(a){return a?this.skip:this},r.runIf=function(a){return a?this:this.skip},r.extend=function(a){const i=Gq(a,t);return jc(function(s,l,u){Hv().test.fn.call(this,cr(s),l,u)},i)};const n=Fv(["concurrent","sequential","skip","only","todo","fails"],r);return t&&n.mergeContext(t),n}function jc(e,t){return nI(e,t)}function cr(e){return typeof e=="string"?e:e instanceof Function?e.name||"<anonymous>":String(e)}function Ot(e,t,r){e.includes("%#")&&(e=e.replace(/%%/g,"__vitest_escaped_%__").replace(/%#/g,`${r}`).replace(/__vitest_escaped_%__/g,"%%"));const n=e.split("%").length-1;e.includes("%f")&&(e.match(/%f/g)||[]).forEach((o,s)=>{if(SM(t[s])||Object.is(t[s],-0)){let l=0;e=e.replace(/%f/g,u=>(l++,l===s+1?"-%f":u))}});let a=yy(e,...t.slice(0,n));return Mr(t[0])&&(a=a.replace(/\$([$\w.]+)/g,(i,o)=>{var s,l;return vM(TM(t[0],o),{truncate:(l=(s=void 0)==null?void 0:s.chaiConfig)==null?void 0:l.truncateThreshold})})),a}function pu(e,t){const r=e.join("").trim().replace(/ /g,"").split(`
170
+ `).map(a=>a.split("|"))[0],n=[];for(let a=0;a<Math.floor(t.length/r.length);a++){const i={};for(let o=0;o<r.length;o++)i[r[o]]=t[a*r.length+o];n.push(i)}return n}function aI(e,t){const r=e.split(`
171
+ `).slice(1);for(const n of r){const a=Lv(n);if(a&&a.file===Qq())return{line:a.line,column:t?a.column+1:a.column}}}globalThis.performance?globalThis.performance.now.bind(globalThis.performance):Date.now;globalThis.performance?globalThis.performance.now.bind(globalThis.performance):Date.now;const oI="__vitest_worker__";function gi(){const e=globalThis[oI];if(!e){const t=`Vitest failed to access its internal state.
172
+
173
+ One of the following is possible:
174
+ - "vitest" is imported directly without running "vitest" command
175
+ - "vitest" is imported inside "globalSetup" (to fix this, use "setupFiles" instead, because "globalSetup" runs in a different context)
176
+ - Otherwise, it might be a Vitest bug. Please report it to https://github.com/vitest-dev/vitest/issues
177
+ `;throw new Error(t)}return e}function iI(){return gi()?.environment.name}function Gv(){return typeof process<"u"&&!!process.send}function sI(e,t=!1){const r=[/\/vitest\/dist\//,/\/vite-node\/dist\//,/vitest-virtual-\w+\/dist/,/@vitest\/dist/,...t?[]:[/^mock:/]];e.forEach((n,a)=>{r.some(i=>i.test(a))||e.invalidateModule(n)})}function lI(){const{setTimeout:e}=ui();return new Promise(t=>e(t,0))}async function Kv(){await lI();const e=gi(),t=[];let r=0;for(const n of e.moduleCache.values())n.promise&&!n.evaluated&&t.push(n.promise),n.resolving&&r++;!t.length&&!r||(await Promise.allSettled(t),await Kv())}var mu=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function uI(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}const cI=44,Vh="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",dI=new Uint8Array(64),Jv=new Uint8Array(128);for(let e=0;e<Vh.length;e++){const t=Vh.charCodeAt(e);dI[e]=t,Jv[t]=e}function Do(e,t){let r=0,n=0,a=0;do{const o=e.next();a=Jv[o],r|=(a&31)<<n,n+=5}while(a&32);const i=r&1;return r>>>=1,i&&(r=-2147483648|-r),t+r}function Hh(e,t){return e.pos>=t?!1:e.peek()!==cI}class fI{constructor(t){this.pos=0,this.buffer=t}next(){return this.buffer.charCodeAt(this.pos++)}peek(){return this.buffer.charCodeAt(this.pos)}indexOf(t){const{buffer:r,pos:n}=this,a=r.indexOf(t,n);return a===-1?r.length:a}}function pI(e){const{length:t}=e,r=new fI(e),n=[];let a=0,i=0,o=0,s=0,l=0;do{const u=r.indexOf(";"),d=[];let c=!0,f=0;for(a=0;r.pos<u;){let p;a=Do(r,a),a<f&&(c=!1),f=a,Hh(r,u)?(i=Do(r,i),o=Do(r,o),s=Do(r,s),Hh(r,u)?(l=Do(r,l),p=[a,i,o,s,l]):p=[a,i,o,s]):p=[a],d.push(p),r.pos++}c||mI(d),n.push(d),r.pos=u+1}while(r.pos<=t);return n}function mI(e){e.sort(hI)}function hI(e,t){return e[0]-t[0]}const gI=/^[\w+.-]+:\/\//,bI=/^([\w+.-]+:)\/\/([^@/#?]*@)?([^:/#?]*)(:\d+)?(\/[^#?]*)?(\?[^#]*)?(#.*)?/,yI=/^file:(?:\/\/((?![a-z]:)[^/#?]*)?)?(\/?[^#?]*)(\?[^#]*)?(#.*)?/i;var $e;(function(e){e[e.Empty=1]="Empty",e[e.Hash=2]="Hash",e[e.Query=3]="Query",e[e.RelativePath=4]="RelativePath",e[e.AbsolutePath=5]="AbsolutePath",e[e.SchemeRelative=6]="SchemeRelative",e[e.Absolute=7]="Absolute"})($e||($e={}));function vI(e){return gI.test(e)}function wI(e){return e.startsWith("//")}function Xv(e){return e.startsWith("/")}function xI(e){return e.startsWith("file:")}function Gh(e){return/^[.?#]/.test(e)}function Pi(e){const t=bI.exec(e);return Yv(t[1],t[2]||"",t[3],t[4]||"",t[5]||"/",t[6]||"",t[7]||"")}function RI(e){const t=yI.exec(e),r=t[2];return Yv("file:","",t[1]||"","",Xv(r)?r:"/"+r,t[3]||"",t[4]||"")}function Yv(e,t,r,n,a,i,o){return{scheme:e,user:t,host:r,port:n,path:a,query:i,hash:o,type:$e.Absolute}}function Kh(e){if(wI(e)){const r=Pi("http:"+e);return r.scheme="",r.type=$e.SchemeRelative,r}if(Xv(e)){const r=Pi("http://foo.com"+e);return r.scheme="",r.host="",r.type=$e.AbsolutePath,r}if(xI(e))return RI(e);if(vI(e))return Pi(e);const t=Pi("http://foo.com/"+e);return t.scheme="",t.host="",t.type=e?e.startsWith("?")?$e.Query:e.startsWith("#")?$e.Hash:$e.RelativePath:$e.Empty,t}function CI(e){if(e.endsWith("/.."))return e;const t=e.lastIndexOf("/");return e.slice(0,t+1)}function EI(e,t){Qv(t,t.type),e.path==="/"?e.path=t.path:e.path=CI(t.path)+e.path}function Qv(e,t){const r=t<=$e.RelativePath,n=e.path.split("/");let a=1,i=0,o=!1;for(let l=1;l<n.length;l++){const u=n[l];if(!u){o=!0;continue}if(o=!1,u!=="."){if(u===".."){i?(o=!0,i--,a--):r&&(n[a++]=u);continue}n[a++]=u,i++}}let s="";for(let l=1;l<a;l++)s+="/"+n[l];(!s||o&&!s.endsWith("/.."))&&(s+="/"),e.path=s}function TI(e,t){if(!e&&!t)return"";const r=Kh(e);let n=r.type;if(t&&n!==$e.Absolute){const i=Kh(t),o=i.type;switch(n){case $e.Empty:r.hash=i.hash;case $e.Hash:r.query=i.query;case $e.Query:case $e.RelativePath:EI(r,i);case $e.AbsolutePath:r.user=i.user,r.host=i.host,r.port=i.port;case $e.SchemeRelative:r.scheme=i.scheme}o>n&&(n=o)}Qv(r,n);const a=r.query+r.hash;switch(n){case $e.Hash:case $e.Query:return a;case $e.RelativePath:{const i=r.path.slice(1);return i?Gh(t||e)&&!Gh(i)?"./"+i+a:i+a:a||"."}case $e.AbsolutePath:return r.path+a;default:return r.scheme+"//"+r.user+r.host+r.port+r.path+a}}function Jh(e,t){return t&&!t.endsWith("/")&&(t+="/"),TI(e,t)}function SI(e){if(!e)return"";const t=e.lastIndexOf("/");return e.slice(0,t+1)}const Gt=0,_I=1,PI=2,kI=3,MI=4;function AI(e,t){const r=Xh(e,0);if(r===e.length)return e;t||(e=e.slice());for(let n=r;n<e.length;n=Xh(e,n+1))e[n]=II(e[n],t);return e}function Xh(e,t){for(let r=t;r<e.length;r++)if(!qI(e[r]))return r;return e.length}function qI(e){for(let t=1;t<e.length;t++)if(e[t][Gt]<e[t-1][Gt])return!1;return!0}function II(e,t){return t||(e=e.slice()),e.sort(OI)}function OI(e,t){return e[Gt]-t[Gt]}let os=!1;function NI(e,t,r,n){for(;r<=n;){const a=r+(n-r>>1),i=e[a][Gt]-t;if(i===0)return os=!0,a;i<0?r=a+1:n=a-1}return os=!1,r-1}function $I(e,t,r){for(let n=r+1;n<e.length&&e[n][Gt]===t;r=n++);return r}function jI(e,t,r){for(let n=r-1;n>=0&&e[n][Gt]===t;r=n--);return r}function DI(){return{lastKey:-1,lastNeedle:-1,lastIndex:-1}}function LI(e,t,r,n){const{lastKey:a,lastNeedle:i,lastIndex:o}=r;let s=0,l=e.length-1;if(n===a){if(t===i)return os=o!==-1&&e[o][Gt]===t,o;t>=i?s=o===-1?0:o:l=o}return r.lastKey=n,r.lastNeedle=t,r.lastIndex=NI(e,t,s,l)}const FI="`line` must be greater than 0 (lines start at line 1)",BI="`column` must be greater than or equal to 0 (columns start at column 0)",Yh=-1,zI=1;class UI{constructor(t,r){const n=typeof t=="string";if(!n&&t._decodedMemo)return t;const a=n?JSON.parse(t):t,{version:i,file:o,names:s,sourceRoot:l,sources:u,sourcesContent:d}=a;this.version=i,this.file=o,this.names=s||[],this.sourceRoot=l,this.sources=u,this.sourcesContent=d,this.ignoreList=a.ignoreList||a.x_google_ignoreList||void 0;const c=Jh(l||"",SI(r));this.resolvedSources=u.map(p=>Jh(p||"",c));const{mappings:f}=a;typeof f=="string"?(this._encoded=f,this._decoded=void 0):(this._encoded=void 0,this._decoded=AI(f,n)),this._decodedMemo=DI(),this._bySources=void 0,this._bySourceMemos=void 0}}function WI(e){var t;return(t=e)._decoded||(t._decoded=pI(e._encoded))}function VI(e,t){let{line:r,column:n,bias:a}=t;if(r--,r<0)throw new Error(FI);if(n<0)throw new Error(BI);const i=WI(e);if(r>=i.length)return ki(null,null,null,null);const o=i[r],s=HI(o,e._decodedMemo,r,n,a||zI);if(s===-1)return ki(null,null,null,null);const l=o[s];if(l.length===1)return ki(null,null,null,null);const{names:u,resolvedSources:d}=e;return ki(d[l[_I]],l[PI]+1,l[kI],l.length===5?u[l[MI]]:null)}function ki(e,t,r,n){return{source:e,line:t,column:r,name:n}}function HI(e,t,r,n,a){let i=LI(e,n,t,r);return os?i=(a===Yh?$I:jI)(e,n,i):a===Yh&&i++,i===-1||i===e.length?-1:i}function Zv(e){return e!=null}function GI(e){return e===null||typeof e!="function"&&typeof e!="object"}function ji(e){return e!=null&&typeof e=="object"&&!Array.isArray(e)}function KI(e){let t=-1,r=null,n=0,a=0,i=null;for(;t<=e.length;){i=e[t],t++;const o=e[t];if((o==='"'||o==="'"||o==="`")&&i!=="\\"&&(r===o?r=null:r||(r=o)),r||(o==="("&&n++,o===")"&&a++),n&&a&&n===a)return t}return null}const ew=/^\s*at .*(?:\S:\d+|\(native\))/m,JI=/^(?:eval@)?(?:\[native code\])?$/,XI=["node:internal",/\/packages\/\w+\/dist\//,/\/@vitest\/\w+\/dist\//,"/vitest/dist/","/vitest/src/","/vite-node/dist/","/vite-node/src/","/node_modules/chai/","/node_modules/tinypool/","/node_modules/tinyspy/","/deps/chunk-","/deps/@vitest","/deps/loupe","/deps/chai",/node:\w+/,/__vitest_test__/,/__vitest_browser__/,/\/deps\/vitest_/];function tw(e){if(!e.includes(":"))return[e];const r=/(.+?)(?::(\d+))?(?::(\d+))?$/.exec(e.replace(/^\(|\)$/g,""));if(!r)return[e];let n=r[1];if(n.startsWith("async ")&&(n=n.slice(6)),(n.startsWith("http:")||n.startsWith("https:"))&&(n=new URL(n).pathname),n.startsWith("/@fs/")){const a=/^\/@fs\/[a-zA-Z]:\//.test(n);n=n.slice(a?5:4)}return[n,r[2]||void 0,r[3]||void 0]}function YI(e){let t=e.trim();if(JI.test(t)||(t.includes(" > eval")&&(t=t.replace(/ line (\d+)(?: > eval line \d+)* > eval:\d+:\d+/g,":$1")),!t.includes("@")&&!t.includes(":")))return null;const r=/((.*".+"[^@]*)?[^@]*)(@)/,n=t.match(r),a=n&&n[1]?n[1]:void 0,[i,o,s]=tw(t.replace(r,""));return!i||!o||!s?null:{file:i,method:a||"",line:Number.parseInt(o),column:Number.parseInt(s)}}function QI(e){let t=e.trim();if(!ew.test(t))return null;t.includes("(eval ")&&(t=t.replace(/eval code/g,"eval").replace(/(\(eval at [^()]*)|(,.*$)/g,""));let r=t.replace(/^\s+/,"").replace(/\(eval code/g,"(").replace(/^.*?\s+/,"");const n=r.match(/ (\(.+\)$)/);r=n?r.replace(n[0],""):r;const[a,i,o]=tw(n?n[1]:r);let s=n&&r||"",l=a&&["eval","<anonymous>"].includes(a)?void 0:a;return!l||!i||!o?null:(s.startsWith("async ")&&(s=s.slice(6)),l.startsWith("file://")&&(l=l.slice(7)),l=qq(l),s&&(s=s.replace(/__vite_ssr_import_\d+__\./g,"")),{method:s,file:l,line:Number.parseInt(i),column:Number.parseInt(o)})}function ZI(e,t={}){const{ignoreStackEntries:r=XI}=t;let n=ew.test(e)?tO(e):eO(e);return r.length&&(n=n.filter(a=>!r.some(i=>a.file.match(i)))),n.map(a=>{var i;t.getFileName&&(a.file=t.getFileName(a.file));const o=(i=t.getSourceMap)==null?void 0:i.call(t,a.file);if(!o||typeof o!="object"||!o.version)return a;const s=new UI(o),{line:l,column:u}=VI(s,a);return l!=null&&u!=null?{...a,line:l,column:u}:a})}function eO(e){return e.split(`
178
+ `).map(t=>YI(t)).filter(Zv)}function tO(e){return e.split(`
179
+ `).map(t=>QI(t)).filter(Zv)}function rO(e,t={}){if(!e||GI(e))return[];if(e.stacks)return e.stacks;const r=e.stack||e.stackStr||"";let n=ZI(r,t);return t.frameFilter&&(n=n.filter(a=>t.frameFilter(e,a)!==!1)),e.stacks=n,n}let nO=()=>"Promise{…}";try{const{getPromiseDetails:e,kPending:t,kRejected:r}=process.binding("util");Array.isArray(e(Promise.resolve()))&&(nO=(n,a)=>{const[i,o]=e(n);return i===t?"Promise{<pending>}":`Promise${i===r?"!":""}{${a.inspect(o,a)}}`})}catch{}let Qh=!1;try{const e=require("util");Qh=e.inspect?e.inspect.custom:!1}catch{Qh=!1}function aO(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var al,Zh;function oO(){if(Zh)return al;Zh=1;var e,t,r,n,a,i,o,s,l,u,d,c,f,p,m,g,b,h,w;return f=/\/(?![*\/])(?:\[(?:(?![\]\\]).|\\.)*\]|(?![\/\\]).|\\.)*(\/[$_\u200C\u200D\p{ID_Continue}]*|\\)?/yu,c=/--|\+\+|=>|\.{3}|\??\.(?!\d)|(?:&&|\|\||\?\?|[+\-%&|^]|\*{1,2}|<{1,2}|>{1,3}|!=?|={1,2}|\/(?![\/*]))=?|[?~,:;[\](){}]/y,e=/(\x23?)(?=[$_\p{ID_Start}\\])(?:[$_\u200C\u200D\p{ID_Continue}]|\\u[\da-fA-F]{4}|\\u\{[\da-fA-F]+\})+/yu,m=/(['"])(?:(?!\1)[^\\\n\r]|\\(?:\r\n|[^]))*(\1)?/y,d=/(?:0[xX][\da-fA-F](?:_?[\da-fA-F])*|0[oO][0-7](?:_?[0-7])*|0[bB][01](?:_?[01])*)n?|0n|[1-9](?:_?\d)*n|(?:(?:0(?!\d)|0\d*[89]\d*|[1-9](?:_?\d)*)(?:\.(?:\d(?:_?\d)*)?)?|\.\d(?:_?\d)*)(?:[eE][+-]?\d(?:_?\d)*)?|0[0-7]+/y,g=/[`}](?:[^`\\$]|\\[^]|\$(?!\{))*(`|\$\{)?/y,w=/[\t\v\f\ufeff\p{Zs}]+/yu,s=/\r?\n|[\r\u2028\u2029]/y,l=/\/\*(?:[^*]|\*(?!\/))*(\*\/)?/y,p=/\/\/.*/y,r=/[<>.:={}]|\/(?![\/*])/y,t=/[$_\p{ID_Start}][$_\u200C\u200D\p{ID_Continue}-]*/yu,n=/(['"])(?:(?!\1)[^])*(\1)?/y,a=/[^<>{}]+/y,h=/^(?:[\/+-]|\.{3}|\?(?:InterpolationIn(?:JSX|Template)|NoLineTerminatorHere|NonExpressionParenEnd|UnaryIncDec))?$|[{}([,;<>=*%&|^!~?:]$/,b=/^(?:=>|[;\]){}]|else|\?(?:NoLineTerminatorHere|NonExpressionParenEnd))?$/,i=/^(?:await|case|default|delete|do|else|instanceof|new|return|throw|typeof|void|yield)$/,o=/^(?:return|throw|yield)$/,u=RegExp(s.source),al=function*(x,{jsx:T=!1}={}){var E,y,v,R,k,P,M,F,j,D,J,B,Y,L;for({length:P}=x,R=0,k="",L=[{tag:"JS"}],E=[],J=0,B=!1;R<P;){switch(F=L[L.length-1],F.tag){case"JS":case"JSNonExpressionParen":case"InterpolationInTemplate":case"InterpolationInJSX":if(x[R]==="/"&&(h.test(k)||i.test(k))&&(f.lastIndex=R,M=f.exec(x))){R=f.lastIndex,k=M[0],B=!0,yield{type:"RegularExpressionLiteral",value:M[0],closed:M[1]!==void 0&&M[1]!=="\\"};continue}if(c.lastIndex=R,M=c.exec(x)){switch(Y=M[0],j=c.lastIndex,D=Y,Y){case"(":k==="?NonExpressionParenKeyword"&&L.push({tag:"JSNonExpressionParen",nesting:J}),J++,B=!1;break;case")":J--,B=!0,F.tag==="JSNonExpressionParen"&&J===F.nesting&&(L.pop(),D="?NonExpressionParenEnd",B=!1);break;case"{":c.lastIndex=0,v=!b.test(k)&&(h.test(k)||i.test(k)),E.push(v),B=!1;break;case"}":switch(F.tag){case"InterpolationInTemplate":if(E.length===F.nesting){g.lastIndex=R,M=g.exec(x),R=g.lastIndex,k=M[0],M[1]==="${"?(k="?InterpolationInTemplate",B=!1,yield{type:"TemplateMiddle",value:M[0]}):(L.pop(),B=!0,yield{type:"TemplateTail",value:M[0],closed:M[1]==="`"});continue}break;case"InterpolationInJSX":if(E.length===F.nesting){L.pop(),R+=1,k="}",yield{type:"JSXPunctuator",value:"}"};continue}}B=E.pop(),D=B?"?ExpressionBraceEnd":"}";break;case"]":B=!0;break;case"++":case"--":D=B?"?PostfixIncDec":"?UnaryIncDec";break;case"<":if(T&&(h.test(k)||i.test(k))){L.push({tag:"JSXTag"}),R+=1,k="<",yield{type:"JSXPunctuator",value:Y};continue}B=!1;break;default:B=!1}R=j,k=D,yield{type:"Punctuator",value:Y};continue}if(e.lastIndex=R,M=e.exec(x)){switch(R=e.lastIndex,D=M[0],M[0]){case"for":case"if":case"while":case"with":k!=="."&&k!=="?."&&(D="?NonExpressionParenKeyword")}k=D,B=!i.test(M[0]),yield{type:M[1]==="#"?"PrivateIdentifier":"IdentifierName",value:M[0]};continue}if(m.lastIndex=R,M=m.exec(x)){R=m.lastIndex,k=M[0],B=!0,yield{type:"StringLiteral",value:M[0],closed:M[2]!==void 0};continue}if(d.lastIndex=R,M=d.exec(x)){R=d.lastIndex,k=M[0],B=!0,yield{type:"NumericLiteral",value:M[0]};continue}if(g.lastIndex=R,M=g.exec(x)){R=g.lastIndex,k=M[0],M[1]==="${"?(k="?InterpolationInTemplate",L.push({tag:"InterpolationInTemplate",nesting:E.length}),B=!1,yield{type:"TemplateHead",value:M[0]}):(B=!0,yield{type:"NoSubstitutionTemplate",value:M[0],closed:M[1]==="`"});continue}break;case"JSXTag":case"JSXTagEnd":if(r.lastIndex=R,M=r.exec(x)){switch(R=r.lastIndex,D=M[0],M[0]){case"<":L.push({tag:"JSXTag"});break;case">":L.pop(),k==="/"||F.tag==="JSXTagEnd"?(D="?JSX",B=!0):L.push({tag:"JSXChildren"});break;case"{":L.push({tag:"InterpolationInJSX",nesting:E.length}),D="?InterpolationInJSX",B=!1;break;case"/":k==="<"&&(L.pop(),L[L.length-1].tag==="JSXChildren"&&L.pop(),L.push({tag:"JSXTagEnd"}))}k=D,yield{type:"JSXPunctuator",value:M[0]};continue}if(t.lastIndex=R,M=t.exec(x)){R=t.lastIndex,k=M[0],yield{type:"JSXIdentifier",value:M[0]};continue}if(n.lastIndex=R,M=n.exec(x)){R=n.lastIndex,k=M[0],yield{type:"JSXString",value:M[0],closed:M[2]!==void 0};continue}break;case"JSXChildren":if(a.lastIndex=R,M=a.exec(x)){R=a.lastIndex,k=M[0],yield{type:"JSXText",value:M[0]};continue}switch(x[R]){case"<":L.push({tag:"JSXTag"}),R++,k="<",yield{type:"JSXPunctuator",value:"<"};continue;case"{":L.push({tag:"InterpolationInJSX",nesting:E.length}),R++,k="?InterpolationInJSX",B=!1,yield{type:"JSXPunctuator",value:"{"};continue}}if(w.lastIndex=R,M=w.exec(x)){R=w.lastIndex,yield{type:"WhiteSpace",value:M[0]};continue}if(s.lastIndex=R,M=s.exec(x)){R=s.lastIndex,B=!1,o.test(k)&&(k="?NoLineTerminatorHere"),yield{type:"LineTerminatorSequence",value:M[0]};continue}if(l.lastIndex=R,M=l.exec(x)){R=l.lastIndex,u.test(M[0])&&(B=!1,o.test(k)&&(k="?NoLineTerminatorHere")),yield{type:"MultiLineComment",value:M[0],closed:M[1]!==void 0};continue}if(p.lastIndex=R,M=p.exec(x)){R=p.lastIndex,B=!1,yield{type:"SingleLineComment",value:M[0]};continue}y=String.fromCodePoint(x.codePointAt(R)),R+=y.length,k=y,B=!1,yield{type:F.tag.startsWith("JSX")?"JSXInvalid":"Invalid",value:y}}},al}oO();var rw={keyword:["break","case","catch","continue","debugger","default","do","else","finally","for","function","if","return","switch","throw","try","var","const","while","with","new","this","super","class","extends","export","import","null","true","false","in","instanceof","typeof","void","delete"],strict:["implements","interface","let","package","private","protected","public","static","yield"]};new Set(rw.keyword);new Set(rw.strict);var iO={reset:[0,0],bold:[1,22,"\x1B[22m\x1B[1m"],dim:[2,22,"\x1B[22m\x1B[2m"],italic:[3,23],underline:[4,24],inverse:[7,27],hidden:[8,28],strikethrough:[9,29],black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],gray:[90,39],bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],blackBright:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39],bgBlackBright:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]},sO=Object.entries(iO);function Dc(e){return String(e)}Dc.open="";Dc.close="";function lO(e=!1){let t=typeof process<"u"?process:void 0,r=t?.env||{},n=t?.argv||[];return!("NO_COLOR"in r||n.includes("--no-color"))&&("FORCE_COLOR"in r||n.includes("--color")||t?.platform==="win32"||e&&r.TERM!=="dumb"||"CI"in r)||typeof window<"u"&&!!window.chrome}function uO(e=!1){let t=lO(e),r=(o,s,l,u)=>{let d="",c=0;do d+=o.substring(c,u)+l,c=u+s.length,u=o.indexOf(s,c);while(~u);return d+o.substring(c)},n=(o,s,l=o)=>{let u=d=>{let c=String(d),f=c.indexOf(s,o.length);return~f?o+r(c,s,l,f)+s:o+c+s};return u.open=o,u.close=s,u},a={isColorSupported:t},i=o=>`\x1B[${o}m`;for(let[o,s]of sO)a[o]=t?n(i(s[0]),i(s[1]),s[2]):Dc;return a}uO(!1);const Lc=/\r?\n/;function cO(e,t,r){const n=e.split(Lc),a=/\r\n/.test(e)?2:1;let i=0;if(t>n.length)return e.length;for(let o=0;o<t-1;o++)i+=n[o].length+a;return i+r}function dO(e,t){if(t>e.length)throw new Error(`offset is longer than source length! offset ${t} > length ${e.length}`);const r=e.split(Lc),n=/\r\n/.test(e)?2:1;let a=0,i=0;for(;i<r.length;i++){const o=r[i].length+n;if(a+o>=t)break;a+=o}return i+1}async function fO(e,t){const r=(await Promise.resolve().then(()=>require("./magic-string.es-B81Zo59j.cjs"))).default,n=new Set(t.map(a=>a.file));await Promise.all(Array.from(n).map(async a=>{const i=t.filter(u=>u.file===a),o=await e.readSnapshotFile(a),s=new r(o);for(const u of i){const d=cO(o,u.line,u.column);yO(o,s,d,u.snapshot)}const l=s.toString();l!==o&&await e.saveSnapshotFile(a,l)}))}const pO=/(?:toMatchInlineSnapshot|toThrowErrorMatchingInlineSnapshot)\s*\(\s*(?:\/\*[\s\S]*\*\/\s*|\/\/.*(?:[\n\r\u2028\u2029]\s*|[\t\v\f \xA0\u1680\u2000-\u200A\u202F\u205F\u3000\uFEFF]))*\{/;function mO(e,t,r,n){let a=e.slice(r);const i=pO.exec(a);if(!i)return!1;a=a.slice(i.index);let o=KI(a);if(o===null)return!1;o+=r+i.index;const s=r+i.index+i[0].length,l=hO(e,s),u=`, ${nw(n,e,r)}`;return l===o?t.appendLeft(o,u):t.overwrite(l,o,u),!0}function hO(e,t){let r=1,n=0;for(;r!==n&&t<e.length;){const a=e[t++];a==="{"?r++:a==="}"&&n++}return t}function nw(e,t,r){const n=dO(t,r),i=t.split(Lc)[n-1].match(/^\s*/)[0]||"",o=i.includes(" ")?`${i} `:`${i} `,s=e.trim().replace(/\\/g,"\\\\").split(/\n/g),l=s.length<=1,u="`";return l?`${u}${s.join(`
180
+ `).replace(/`/g,"\\`").replace(/\$\{/g,"\\${")}${u}`:`${u}
181
+ ${s.map(d=>d?o+d:"").join(`
182
+ `).replace(/`/g,"\\`").replace(/\$\{/g,"\\${")}
183
+ ${i}${u}`}const eg="toMatchInlineSnapshot",tg="toThrowErrorMatchingInlineSnapshot";function gO(e,t){const r=t-eg.length;if(e.slice(r,t)===eg)return{code:e.slice(r),index:r};const n=t-tg.length;return e.slice(t-n,t)===tg?{code:e.slice(t-n),index:t-n}:{code:e.slice(t),index:t}}const bO=/(?:toMatchInlineSnapshot|toThrowErrorMatchingInlineSnapshot)\s*\(\s*(?:\/\*[\s\S]*\*\/\s*|\/\/.*(?:[\n\r\u2028\u2029]\s*|[\t\v\f \xA0\u1680\u2000-\u200A\u202F\u205F\u3000\uFEFF]))*[\w$]*(['"`)])/;function yO(e,t,r,n){const{code:a,index:i}=gO(e,r),o=bO.exec(a),s=/toMatchInlineSnapshot|toThrowErrorMatchingInlineSnapshot/.exec(a);if(!o||o.index!==s?.index)return mO(e,t,i,n);const l=o[1],u=i+o.index+o[0].length,d=nw(n,e,i);if(l===")")return t.appendRight(u-1,d),!0;const f=new RegExp(`(?:^|[^\\\\])${l}`).exec(e.slice(u));if(!f)return!1;const p=u+f.index+f[0].length;return t.overwrite(u-1,p,d),!0}const vO=/^([^\S\n]*)\S/m;function rg(e){const t=e.match(vO);if(!t||!t[1])return e;const r=t[1],n=e.split(/\n/g);if(n.length<=2||n[0].trim()!==""||n[n.length-1].trim()!=="")return e;for(let a=1;a<n.length-1;a++)if(n[a]!==""){if(n[a].indexOf(r)!==0)return e;n[a]=n[a].substring(r.length)}return n[n.length-1]="",e=n.join(`
184
+ `),e}async function wO(e,t){await Promise.all(t.map(async r=>{r.readonly||await e.saveSnapshotFile(r.file,r.snapshot)}))}var ol={exports:{}},ng;function xO(){if(ng)return ol.exports;ng=1;var e=function(t,r){var n,a,i=1,o=0,s=0,l=String.alphabet;function u(d,c,f){if(f){for(n=c;f=u(d,n),f<76&&f>65;)++n;return+d.slice(c-1,n)}return f=l&&l.indexOf(d.charAt(c)),f>-1?f+76:(f=d.charCodeAt(c)||0,f<45||f>127?f:f<46?65:f<48?f-1:f<58?f+18:f<65?f-11:f<91?f+11:f<97?f-37:f<123?f+5:f-63)}if((t+="")!=(r+="")){for(;i;)if(a=u(t,o++),i=u(r,s++),a<76&&i<76&&a>66&&i>66&&(a=u(t,o,o),i=u(r,s,o=n),s=n),a!=i)return a<i?-1:1}return 0};try{ol.exports=e}catch{String.naturalCompare=e}return ol.exports}var RO=xO(),CO=aO(RO);const EO=(e,t,r,n,a,i)=>{const o=e.getMockName(),s=o==="vi.fn()"?"":` ${o}`;let l="";if(e.mock.calls.length!==0){const u=r+t.indent;l=` {${t.spacingOuter}${u}"calls": ${i(e.mock.calls,t,u,n,a)}${t.min?", ":","}${t.spacingOuter}${u}"results": ${i(e.mock.results,t,u,n,a)}${t.min?"":","}${t.spacingOuter}${r}}`}return`[MockFunction${s}]${l}`},TO=e=>e&&!!e._isMockFunction,SO={serialize:EO,test:TO},{DOMCollection:_O,DOMElement:PO,Immutable:kO,ReactElement:MO,ReactTestComponent:AO,AsymmetricMatcher:qO}=Ku;let hu=[AO,MO,PO,_O,kO,qO,SO];function IO(e){hu=[e].concat(hu)}function OO(){return hu}function NO(e,t){return`${e} ${t}`}function $O(e){if(!/ \d+$/.test(e))throw new Error("Snapshot keys must end with a number.");return e.replace(/ \d+$/,"")}function jO(e,t){const r=t.updateSnapshot,n=Object.create(null);let a="",i=!1;if(e!=null)try{a=e,new Function("exports",a)(n)}catch{}return(r==="all"||r==="new")&&a&&(i=!0),{data:n,dirty:i}}function DO(e){return e.includes(`
185
+ `)?`
186
+ ${e}
187
+ `:e}function ag(e){return e.length>2&&e.startsWith(`
188
+ `)&&e.endsWith(`
189
+ `)?e.slice(1,-1):e}const LO=!0,FO=!1;function BO(e,t=2,r={}){return Fc(dt(e,{escapeRegex:LO,indent:t,plugins:OO(),printFunctionName:FO,...r}))}function zO(e){return e.replace(/`|\\|\$\{/g,"\\$&")}function og(e){return`\`${zO(e)}\``}function Fc(e){return e.replace(/\r\n|\r/g,`
190
+ `)}async function UO(e,t,r){const n=Object.keys(t).sort(CO).map(s=>`exports[${og(s)}] = ${og(Fc(t[s]))};`),a=`${e.getHeader()}
191
+
192
+ ${n.join(`
193
+
194
+ `)}
195
+ `,i=await e.readSnapshotFile(r);i!=null&&i===a||await e.saveSnapshotFile(r,a)}function ig(e){function t(){var a,i;const o=/^( +)\}\s+$/m.exec(e||""),s=(a=o?.[1])==null?void 0:a.length;if(s)return s;const l=/^\n( +)"/.exec(e||"");return((i=l?.[1])==null?void 0:i.length)||0}const r=t();let n=e?.trim();return r&&(n=n?.replace(new RegExp(`^${" ".repeat(r)}`,"gm"),"").replace(/ +\}$/,"}")),n}function gu(e=[],t=[]){const r=Array.from(e);return t.forEach((n,a)=>{const i=r[a];Array.isArray(e[a])?r[a]=gu(e[a],n):ji(i)?r[a]=Bc(e[a],n):r[a]=n}),r}function Bc(e,t){if(ji(e)&&ji(t)){const r={...e};return Object.keys(t).forEach(n=>{ji(t[n])&&!t[n].$$typeof?n in e?r[n]=Bc(e[n],t[n]):Object.assign(r,{[n]:t[n]}):Array.isArray(t[n])?r[n]=gu(e[n],t[n]):Object.assign(r,{[n]:t[n]})}),r}else if(Array.isArray(e)&&Array.isArray(t))return gu(e,t);return e}class zc{constructor(t,r,n,a){re(this,"_counters");re(this,"_dirty");re(this,"_updateSnapshot");re(this,"_snapshotData");re(this,"_initialData");re(this,"_inlineSnapshots");re(this,"_inlineSnapshotStacks");re(this,"_rawSnapshots");re(this,"_uncheckedKeys");re(this,"_snapshotFormat");re(this,"_environment");re(this,"_fileExists");re(this,"added");re(this,"expand");re(this,"matched");re(this,"unmatched");re(this,"updated");this.testFilePath=t,this.snapshotPath=r;const{data:i,dirty:o}=jO(n,a);this._fileExists=n!=null,this._initialData=i,this._snapshotData=i,this._dirty=o,this._inlineSnapshots=[],this._inlineSnapshotStacks=[],this._rawSnapshots=[],this._uncheckedKeys=new Set(Object.keys(this._snapshotData)),this._counters=new Map,this.expand=a.expand||!1,this.added=0,this.matched=0,this.unmatched=0,this._updateSnapshot=a.updateSnapshot,this.updated=0,this._snapshotFormat={printBasicPrototype:!1,escapeString:!1,...a.snapshotFormat},this._environment=a.snapshotEnvironment}static async create(t,r){const n=await r.snapshotEnvironment.resolvePath(t),a=await r.snapshotEnvironment.readSnapshotFile(n);return new zc(t,n,a,r)}get environment(){return this._environment}markSnapshotsAsCheckedForTest(t){this._uncheckedKeys.forEach(r=>{$O(r)===t&&this._uncheckedKeys.delete(r)})}_inferInlineSnapshotStack(t){const r=t.findIndex(a=>a.method.match(/__VITEST_(RESOLVES|REJECTS)__/));if(r!==-1)return t[r+3];const n=t.findIndex(a=>a.method.includes("__INLINE_SNAPSHOT__"));return n!==-1?t[n+2]:null}_addSnapshot(t,r,n){this._dirty=!0,n.stack?this._inlineSnapshots.push({snapshot:r,...n.stack}):n.rawSnapshot?this._rawSnapshots.push({...n.rawSnapshot,snapshot:r}):this._snapshotData[t]=r}clear(){this._snapshotData=this._initialData,this._counters=new Map,this.added=0,this.matched=0,this.unmatched=0,this.updated=0,this._dirty=!1}async save(){const t=Object.keys(this._snapshotData).length,r=this._inlineSnapshots.length,n=this._rawSnapshots.length,a=!t&&!r&&!n,i={deleted:!1,saved:!1};return(this._dirty||this._uncheckedKeys.size)&&!a?(t&&(await UO(this._environment,this._snapshotData,this.snapshotPath),this._fileExists=!0),r&&await fO(this._environment,this._inlineSnapshots),n&&await wO(this._environment,this._rawSnapshots),i.saved=!0):!t&&this._fileExists&&(this._updateSnapshot==="all"&&(await this._environment.removeSnapshotFile(this.snapshotPath),this._fileExists=!1),i.deleted=!0),i}getUncheckedCount(){return this._uncheckedKeys.size||0}getUncheckedKeys(){return Array.from(this._uncheckedKeys)}removeUncheckedKeys(){this._updateSnapshot==="all"&&this._uncheckedKeys.size&&(this._dirty=!0,this._uncheckedKeys.forEach(t=>delete this._snapshotData[t]),this._uncheckedKeys.clear())}match({testName:t,received:r,key:n,inlineSnapshot:a,isInline:i,error:o,rawSnapshot:s}){var l,u;this._counters.set(t,(this._counters.get(t)||0)+1);const d=Number(this._counters.get(t));n||(n=NO(t,d)),i&&this._snapshotData[n]!==void 0||this._uncheckedKeys.delete(n);let c=s&&typeof r=="string"?r:BO(r,void 0,this._snapshotFormat);s||(c=DO(c)),s&&s.content&&s.content.match(/\r\n/)&&!c.match(/\r\n/)&&(s.content=Fc(s.content));const f=i?a:s?s.content:this._snapshotData[n],p=ig(f),m=p===ig(c),g=f!==void 0,b=i||this._fileExists||s&&s.content!=null;m&&!i&&!s&&(this._snapshotData[n]=c);let h;if(i){const w=rO(o||new Error("snapshot"),{ignoreStackEntries:[]}),x=this._inferInlineSnapshotStack(w);if(!x)throw new Error(`@vitest/snapshot: Couldn't infer stack frame for inline snapshot.
196
+ ${JSON.stringify(w)}`);if(h=((u=(l=this.environment).processStackTrace)==null?void 0:u.call(l,x))||x,h.column--,this._inlineSnapshotStacks.some(T=>T.file===h.file&&T.line===h.line&&T.column===h.column))throw this._inlineSnapshots=this._inlineSnapshots.filter(T=>!(T.file===h.file&&T.line===h.line&&T.column===h.column)),new Error("toMatchInlineSnapshot cannot be called multiple times at the same location.");this._inlineSnapshotStacks.push(h)}return g&&this._updateSnapshot==="all"||(!g||!b)&&(this._updateSnapshot==="new"||this._updateSnapshot==="all")?(this._updateSnapshot==="all"?m?this.matched++:(g?this.updated++:this.added++,this._addSnapshot(n,c,{stack:h,rawSnapshot:s})):(this._addSnapshot(n,c,{stack:h,rawSnapshot:s}),this.added++),{actual:"",count:d,expected:"",key:n,pass:!0}):m?(this.matched++,{actual:"",count:d,expected:"",key:n,pass:!0}):(this.unmatched++,{actual:ag(c),count:d,expected:p!==void 0?ag(p):void 0,key:n,pass:!1})}async pack(){const t={filepath:this.testFilePath,added:0,fileDeleted:!1,matched:0,unchecked:0,uncheckedKeys:[],unmatched:0,updated:0},r=this.getUncheckedCount(),n=this.getUncheckedKeys();r&&this.removeUncheckedKeys();const a=await this.save();return t.fileDeleted=a.deleted,t.added=this.added,t.matched=this.matched,t.unmatched=this.unmatched,t.updated=this.updated,t.unchecked=a.deleted?0:r,t.uncheckedKeys=Array.from(n),t}}function sg(e,t,r,n){const a=new Error(e);return Object.defineProperty(a,"actual",{value:r,enumerable:!0,configurable:!0,writable:!0}),Object.defineProperty(a,"expected",{value:n,enumerable:!0,configurable:!0,writable:!0}),Object.defineProperty(a,"diffOptions",{value:{expand:t}}),a}class WO{constructor(t={}){re(this,"filepath");re(this,"name");re(this,"snapshotState");re(this,"snapshotStateMap",new Map);this.options=t}async startCurrentRun(t,r,n){var a;this.filepath=t,this.name=r,((a=this.snapshotState)==null?void 0:a.testFilePath)!==t&&(await this.finishCurrentRun(),this.getSnapshotState(t)||this.snapshotStateMap.set(t,await zc.create(t,n)),this.snapshotState=this.getSnapshotState(t))}getSnapshotState(t){return this.snapshotStateMap.get(t)}clearTest(){this.filepath=void 0,this.name=void 0}skipTestSnapshots(t){var r;(r=this.snapshotState)==null||r.markSnapshotsAsCheckedForTest(t)}assert(t){var r,n,a,i;const{filepath:o=this.filepath,name:s=this.name,message:l,isInline:u=!1,properties:d,inlineSnapshot:c,error:f,errorMessage:p,rawSnapshot:m}=t;let{received:g}=t;if(!o)throw new Error("Snapshot cannot be used outside of test");if(typeof d=="object"){if(typeof g!="object"||!g)throw new Error("Received value must be an object when the matcher has properties");try{if(((n=(r=this.options).isEqual)==null?void 0:n.call(r,g,d))??!1)g=Bc(g,d);else throw sg("Snapshot properties mismatched",(a=this.snapshotState)==null?void 0:a.expand,g,d)}catch(y){throw y.message=p||"Snapshot mismatched",y}}const b=[s,...l?[l]:[]].join(" > "),h=this.getSnapshotState(o),{actual:w,expected:x,key:T,pass:E}=h.match({testName:b,received:g,isInline:u,error:f,inlineSnapshot:c,rawSnapshot:m});if(!E)throw sg(`Snapshot \`${T||"unknown"}\` mismatched`,(i=this.snapshotState)==null?void 0:i.expand,w?.trim(),x?.trim())}async assertRaw(t){if(!t.rawSnapshot)throw new Error("Raw snapshot is required");const{filepath:r=this.filepath,rawSnapshot:n}=t;if(n.content==null){if(!r)throw new Error("Snapshot cannot be used outside of test");const a=this.getSnapshotState(r);t.filepath||(t.filepath=r),n.file=await a.environment.resolveRawPath(r,n.file),n.content=await a.environment.readSnapshotFile(n.file)??void 0}return this.assert(t)}async finishCurrentRun(){if(!this.snapshotState)return null;const t=await this.snapshotState.pack();return this.snapshotState=void 0,t}clear(){this.snapshotStateMap.clear()}}const ct=Date;let bu=null;class Kt extends ct{constructor(t,r,n,a,i,o,s){super();let l;switch(arguments.length){case 0:bu!==null?l=new ct(bu.valueOf()):l=new ct;break;case 1:l=new ct(t);break;default:n=typeof n>"u"?1:n,a=a||0,i=i||0,o=o||0,s=s||0,l=new ct(t,r,n,a,i,o,s);break}return Object.setPrototypeOf(l,Kt.prototype),l}}Kt.UTC=ct.UTC;Kt.now=function(){return new Kt().valueOf()};Kt.parse=function(e){return ct.parse(e)};Kt.toString=function(){return ct.toString()};function VO(e){const t=new ct(e.valueOf());if(Number.isNaN(t.getTime()))throw new TypeError(`mockdate: The time set is an invalid date: ${e}`);globalThis.Date=Kt,bu=t.valueOf()}function HO(){globalThis.Date=ct}const GO=["matchSnapshot","toMatchSnapshot","toMatchInlineSnapshot","toThrowErrorMatchingSnapshot","toThrowErrorMatchingInlineSnapshot","throws","Throw","throw","toThrow","toThrowError"];function KO(e){return function(r,n={}){const i=gi().config.expect?.poll??{},{interval:o=i.interval??50,timeout:s=i.timeout??1e3,message:l}=n,u=e(null,l).withContext({poll:!0});r=r.bind(u);const d=Ke.flag(u,"vitest-test");if(!d)throw new Error("expect.poll() must be called inside a test");const c=new Proxy(u,{get(f,p,m){const g=Reflect.get(f,p,m);if(typeof g!="function")return g instanceof S?c:g;if(p==="assert")return g;if(typeof p=="string"&&GO.includes(p))throw new SyntaxError(`expect.poll() is not supported in combination with .${p}(). Use vi.waitFor() if your assertion condition is unstable.`);return function(...b){const h=new Error("STACK_TRACE_ERROR"),w=()=>new Promise((E,y)=>{let v,R;const{setTimeout:k,clearTimeout:P}=ui(),M=k(()=>{P(v),y(lg(new Error(`Matcher did not succeed in ${s}ms`,{cause:R}),h))},s),F=async()=>{try{Ke.flag(u,"_name",p);const j=await r();Ke.flag(u,"object",j),E(await g.call(u,...b)),P(v),P(M)}catch(j){R=j,v=k(F,o)}};F()});let x=!1;d.onFinished??(d.onFinished=[]),d.onFinished.push(()=>{if(!x){const E=Ke.flag(u,"negate")?"not.":"",v=`expect.${Ke.flag(u,"_poll.element")?"element(locator)":"poll(assertion)"}.${E}${String(p)}()`,R=new Error(`${v} was not awaited. This assertion is asynchronous and must be awaited; otherwise, it is not executed to avoid unhandled rejections:
197
+
198
+ await ${v}
199
+ `);throw lg(R,h)}});let T;return{then(E,y){return x=!0,(T||(T=w())).then(E,y)},catch(E){return(T||(T=w())).catch(E)},finally(E){return(T||(T=w())).finally(E)},[Symbol.toStringTag]:"Promise"}}}});return c}}function lg(e,t){return t.stack!==void 0&&(e.stack=t.stack.replace(t.message,e.message)),e}function JO(e){throw new Error('Could not dynamically require "'+e+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var Di={exports:{}},XO=Di.exports,ug;function YO(){return ug||(ug=1,(function(e,t){(function(){(function(r){return typeof JO=="function"?e.exports=r:chai.use(r)})(function(r,n){var a=r.Assertion,i=a.prototype;a.addMethod("containSubset",function(s){var l=n.flag(this,"object"),u=r.config.showDiff;i.assert.call(this,o(s,l),"expected #{act} to contain subset #{exp}","expected #{act} to not contain subset #{exp}",s,l,u)}),r.assert.containSubset=function(s,l,u){new r.Assertion(s,u).to.be.containSubset(l)};function o(s,l){if(s===l)return!0;if(typeof l!=typeof s)return!1;if(typeof s!="object"||s===null)return s===l;if(s&&!l)return!1;if(Array.isArray(s)){if(typeof l.length!="number")return!1;var u=Array.prototype.slice.call(l);return s.every(function(d){return u.some(function(c){return o(d,c)})})}return s instanceof Date?l instanceof Date?s.getTime()===l.getTime():!1:Object.keys(s).every(function(d){var c=s[d],f=l[d];return typeof c=="object"&&c!==null&&f!==null?o(c,f):typeof c=="function"?c(f):f===c})}})}).call(XO)})(Di)),Di.exports}var QO=YO(),ZO=uI(QO);function eN(e,t,r){const n=e.flag(t,"negate")?"not.":"",a=`${e.flag(t,"_name")}(expected)`,i=e.flag(t,"promise");return`expect(actual)${i?`.${i}`:""}.${n}${a}`}function tN(e,t,r,n){const a=e;if(a&&t instanceof Promise){t=t.finally(()=>{if(!a.promises)return;const o=a.promises.indexOf(t);o!==-1&&a.promises.splice(o,1)}),a.promises||(a.promises=[]),a.promises.push(t);let i=!1;return a.onFinished??(a.onFinished=[]),a.onFinished.push(()=>{if(!i){const s=(globalThis.__vitest_worker__?.onFilterStackTrace||(l=>l||""))(n.stack);console.warn([`Promise returned by \`${r}\` was not awaited. `,"Vitest currently auto-awaits hanging assertions at the end of the test, but this will cause the test to fail in Vitest 3. ",`Please remember to await the assertion.
200
+ `,s].join(""))}}),{then(o,s){return i=!0,t.then(o,s)},catch(o){return t.catch(o)},finally(o){return t.finally(o)},[Symbol.toStringTag]:"Promise"}}return t}let il;function Lo(){return il||(il=new WO({isEqual:(e,t)=>he(e,t,[Ye,Ur])})),il}function cg(e,t){if(typeof e!="function"){if(!t)throw new Error(`expected must be a function, received ${typeof e}`);return e}try{e()}catch(r){return r}throw new Error("snapshot function didn't throw")}function Fo(e){return e?{filepath:e.file.filepath,name:Oq(e).slice(1).join(" > ")}:{}}const rN=(e,t)=>{for(const r of["matchSnapshot","toMatchSnapshot"])t.addMethod(e.Assertion.prototype,r,function(n,a){if(t.flag(this,"_name",r),t.flag(this,"negate"))throw new Error(`${r} cannot be used with "not"`);const o=t.flag(this,"object"),s=t.flag(this,"vitest-test");typeof n=="string"&&typeof a>"u"&&(a=n,n=void 0);const l=t.flag(this,"message");Lo().assert({received:o,message:a,isInline:!1,properties:n,errorMessage:l,...Fo(s)})});t.addMethod(e.Assertion.prototype,"toMatchFileSnapshot",function(r,n){if(t.flag(this,"_name","toMatchFileSnapshot"),t.flag(this,"negate"))throw new Error('toMatchFileSnapshot cannot be used with "not"');const i=new Error("resolves"),o=t.flag(this,"object"),s=t.flag(this,"vitest-test"),l=t.flag(this,"message"),u=Lo().assertRaw({received:o,message:n,isInline:!1,rawSnapshot:{file:r},errorMessage:l,...Fo(s)});return tN(s,u,eN(t,this),i)}),t.addMethod(e.Assertion.prototype,"toMatchInlineSnapshot",function(n,a,i){if(t.flag(this,"_name","toMatchInlineSnapshot"),t.flag(this,"negate"))throw new Error('toMatchInlineSnapshot cannot be used with "not"');const s=t.flag(this,"vitest-test");if(s&&(s.each||s.suite?.each))throw new Error("InlineSnapshot cannot be used inside of test.each or describe.each");const u=t.flag(this,"object"),d=t.flag(this,"error");typeof n=="string"&&(i=a,a=n,n=void 0),a&&(a=rg(a));const c=t.flag(this,"message");Lo().assert({received:u,message:i,isInline:!0,properties:n,inlineSnapshot:a,error:d,errorMessage:c,...Fo(s)})}),t.addMethod(e.Assertion.prototype,"toThrowErrorMatchingSnapshot",function(r){if(t.flag(this,"_name","toThrowErrorMatchingSnapshot"),t.flag(this,"negate"))throw new Error('toThrowErrorMatchingSnapshot cannot be used with "not"');const a=t.flag(this,"object"),i=t.flag(this,"vitest-test"),o=t.flag(this,"promise"),s=t.flag(this,"message");Lo().assert({received:cg(a,o),message:r,errorMessage:s,...Fo(i)})}),t.addMethod(e.Assertion.prototype,"toThrowErrorMatchingInlineSnapshot",function(n,a){if(t.flag(this,"negate"))throw new Error('toThrowErrorMatchingInlineSnapshot cannot be used with "not"');const o=t.flag(this,"vitest-test");if(o&&(o.each||o.suite?.each))throw new Error("InlineSnapshot cannot be used inside of test.each or describe.each");const l=t.flag(this,"object"),u=t.flag(this,"error"),d=t.flag(this,"promise"),c=t.flag(this,"message");n&&(n=rg(n)),Lo().assert({received:cg(l,d),message:a,inlineSnapshot:n,isInline:!0,error:u,errorMessage:c,...Fo(o)})}),t.addMethod(e.expect,"addSnapshotSerializer",IO)};Yt(gq);Yt(fq);Yt(ZO);Yt(rN);Yt(dq);function nN(e){const t=(i,o)=>{const{assertionCalls:s}=Ko(t);return tl({assertionCalls:s+1},t),ur(i,o)};Object.assign(t,ur),Object.assign(t,globalThis[Ic]),t.getState=()=>Ko(t),t.setState=i=>tl(i,t);const r=Ko(globalThis[_s])||{};tl({...r,assertionCalls:0,isExpectingAssertions:!1,isExpectingAssertionsError:null,expectedAssertionsNumber:null,expectedAssertionsNumberErrorGen:null,environment:iI(),get testPath(){return gi().filepath},currentTestName:r.currentTestName},t),t.extend=i=>ur.extend(t,i),t.addEqualityTesters=i=>KA(i),t.soft=(...i)=>t(...i).withContext({soft:!0}),t.poll=KO(t),t.unreachable=i=>{C.fail(`expected${i?` "${i}" `:" "}not to be reached`)};function n(i){const o=()=>new Error(`expected number of assertions to be ${i}, but got ${t.getState().assertionCalls}`);Error.captureStackTrace&&Error.captureStackTrace(o(),n),t.setState({expectedAssertionsNumber:i,expectedAssertionsNumberErrorGen:o})}function a(){const i=new Error("expected any number of assertion, but got none");Error.captureStackTrace&&Error.captureStackTrace(i,a),t.setState({isExpectingAssertions:!0,isExpectingAssertionsError:i})}return Ke.addMethod(t,"assertions",n),Ke.addMethod(t,"hasAssertions",a),t}const aN=nN();Object.defineProperty(globalThis,_s,{value:aN,writable:!0,configurable:!0});var wr={},sl,dg;function oN(){if(dg)return sl;dg=1;var e;return typeof mu<"u"?e=mu:typeof window<"u"?e=window:e=self,sl=e,sl}var ll,fg;function iN(){if(fg)return ll;fg=1;let e;try{({}).__proto__,e=!1}catch{e=!0}return ll=e,ll}var ul,pg;function Wr(){if(pg)return ul;pg=1;var e=Function.call,t=iN(),r=["size","caller","callee","arguments"];return t&&r.push("__proto__"),ul=function(a){return Object.getOwnPropertyNames(a).reduce(function(i,o){return r.includes(o)||typeof a[o]!="function"||(i[o]=e.bind(a[o])),i},Object.create(null))},ul}var cl,mg;function is(){if(mg)return cl;mg=1;var e=Wr();return cl=e(Array.prototype),cl}var dl,hg;function sN(){if(hg)return dl;hg=1;var e=is().every;function t(a,i){return a[i.id]===void 0&&(a[i.id]=0),a[i.id]<i.callCount}function r(a,i,o,s){var l=!0;return o!==s.length-1&&(l=i.calledBefore(s[o+1])),t(a,i)&&l?(a[i.id]+=1,!0):!1}function n(a){var i={},o=arguments.length>1?arguments:a;return e(o,r.bind(null,i))}return dl=n,dl}var fl,gg;function aw(){return gg||(gg=1,fl=function(t){if(!t)return"";try{return t.displayName||t.name||(String(t).match(/function ([^\s(]+)/)||[])[1]}catch{return""}}),fl}var pl,bg;function lN(){if(bg)return pl;bg=1;var e=aw();function t(r){return r.constructor&&r.constructor.name||typeof r.constructor=="function"&&e(r.constructor)||null}return pl=t,pl}var ml={},yg;function uN(){return yg||(yg=1,(function(e){e.wrap=function(t,r){var n=function(){return e.printWarning(r),t.apply(this,arguments)};return t.prototype&&(n.prototype=t.prototype),n},e.defaultMsg=function(t,r){return`${t}.${r} is deprecated and will be removed from the public API in a future version of ${t}.`},e.printWarning=function(t){typeof process=="object"&&process.emitWarning?process.emitWarning(t):console.info?console.info(t):console.log(t)}})(ml)),ml}var hl,vg;function cN(){return vg||(vg=1,hl=function(t,r){var n=!0;try{t.forEach(function(){if(!r.apply(this,arguments))throw new Error})}catch{n=!1}return n}),hl}var gl,wg;function dN(){if(wg)return gl;wg=1;var e=is().sort,t=is().slice;function r(a,i){var o=a.getCall(0),s=i.getCall(0),l=o&&o.callId||-1,u=s&&s.callId||-1;return l<u?-1:1}function n(a){return e(t(a),r)}return gl=n,gl}var bl,xg;function fN(){if(xg)return bl;xg=1;var e=Wr();return bl=e(Function.prototype),bl}var yl,Rg;function pN(){if(Rg)return yl;Rg=1;var e=Wr();return yl=e(Map.prototype),yl}var vl,Cg;function mN(){if(Cg)return vl;Cg=1;var e=Wr();return vl=e(Object.prototype),vl}var wl,Eg;function hN(){if(Eg)return wl;Eg=1;var e=Wr();return wl=e(Set.prototype),wl}var xl,Tg;function gN(){if(Tg)return xl;Tg=1;var e=Wr();return xl=e(String.prototype),xl}var Rl,Sg;function bN(){return Sg||(Sg=1,Rl={array:is(),function:fN(),map:pN(),object:mN(),set:hN(),string:gN()}),Rl}var Li={exports:{}},yN=Li.exports,_g;function vN(){return _g||(_g=1,(function(e,t){(function(r,n){e.exports=n()})(yN,(function(){var r=typeof Promise=="function",n=typeof self=="object"?self:mu,a=typeof Symbol<"u",i=typeof Map<"u",o=typeof Set<"u",s=typeof WeakMap<"u",l=typeof WeakSet<"u",u=typeof DataView<"u",d=a&&typeof Symbol.iterator<"u",c=a&&typeof Symbol.toStringTag<"u",f=o&&typeof Set.prototype.entries=="function",p=i&&typeof Map.prototype.entries=="function",m=f&&Object.getPrototypeOf(new Set().entries()),g=p&&Object.getPrototypeOf(new Map().entries()),b=d&&typeof Array.prototype[Symbol.iterator]=="function",h=b&&Object.getPrototypeOf([][Symbol.iterator]()),w=d&&typeof String.prototype[Symbol.iterator]=="function",x=w&&Object.getPrototypeOf(""[Symbol.iterator]()),T=8,E=-1;function y(v){var R=typeof v;if(R!=="object")return R;if(v===null)return"null";if(v===n)return"global";if(Array.isArray(v)&&(c===!1||!(Symbol.toStringTag in v)))return"Array";if(typeof window=="object"&&window!==null){if(typeof window.location=="object"&&v===window.location)return"Location";if(typeof window.document=="object"&&v===window.document)return"Document";if(typeof window.navigator=="object"){if(typeof window.navigator.mimeTypes=="object"&&v===window.navigator.mimeTypes)return"MimeTypeArray";if(typeof window.navigator.plugins=="object"&&v===window.navigator.plugins)return"PluginArray"}if((typeof window.HTMLElement=="function"||typeof window.HTMLElement=="object")&&v instanceof window.HTMLElement){if(v.tagName==="BLOCKQUOTE")return"HTMLQuoteElement";if(v.tagName==="TD")return"HTMLTableDataCellElement";if(v.tagName==="TH")return"HTMLTableHeaderCellElement"}}var k=c&&v[Symbol.toStringTag];if(typeof k=="string")return k;var P=Object.getPrototypeOf(v);return P===RegExp.prototype?"RegExp":P===Date.prototype?"Date":r&&P===Promise.prototype?"Promise":o&&P===Set.prototype?"Set":i&&P===Map.prototype?"Map":l&&P===WeakSet.prototype?"WeakSet":s&&P===WeakMap.prototype?"WeakMap":u&&P===DataView.prototype?"DataView":i&&P===g?"Map Iterator":o&&P===m?"Set Iterator":b&&P===h?"Array Iterator":w&&P===x?"String Iterator":P===null?"Object":Object.prototype.toString.call(v).slice(T,E)}return y}))})(Li)),Li.exports}var Cl,Pg;function wN(){if(Pg)return Cl;Pg=1;var e=vN();return Cl=function(r){return e(r).toLowerCase()},Cl}var El,kg;function xN(){if(kg)return El;kg=1;function e(t){return t&&t.toString?t.toString():String(t)}return El=e,El}var Tl,Mg;function RN(){return Mg||(Mg=1,Tl={global:oN(),calledInOrder:sN(),className:lN(),deprecated:uN(),every:cN(),functionName:aw(),orderByFirstCall:dN(),prototypes:bN(),typeOf:wN(),valueToString:xN()}),Tl}var Ag;function CN(){if(Ag)return wr;Ag=1;const e=RN().global;let t;if(typeof __vitest_required__<"u")try{t=__vitest_required__.timers}catch{}function r(a){const i=Math.pow(2,31)-1,o=1e12,s=function(){},l=function(){return[]},u=a.setTimeout(s,0),d=typeof u=="object",c=a.process&&typeof a.process.hrtime=="function",f=c&&typeof a.process.hrtime.bigint=="function",p=a.process&&typeof a.process.nextTick=="function",m=a.process&&a.__vitest_required__&&a.__vitest_required__.util.promisify,g=a.performance&&typeof a.performance.now=="function",b=a.Performance&&(typeof a.Performance).match(/^(function|object)$/),h=a.performance&&a.performance.constructor&&a.performance.constructor.prototype,w=a.hasOwnProperty("queueMicrotask"),x=a.requestAnimationFrame&&typeof a.requestAnimationFrame=="function",T=a.cancelAnimationFrame&&typeof a.cancelAnimationFrame=="function",E=a.requestIdleCallback&&typeof a.requestIdleCallback=="function",y=a.cancelIdleCallback&&typeof a.cancelIdleCallback=="function",v=a.setImmediate&&typeof a.setImmediate=="function",R=a.Intl&&typeof a.Intl=="object";a.clearTimeout(u);const k=a.Date,P=a.Intl;let M=o;function F(O){return Number.isFinite?Number.isFinite(O):isFinite(O)}let j=!1;function D(O,N){O.loopLimit&&N===O.loopLimit-1&&(j=!0)}function J(){j=!1}function B(O){if(!O)return 0;const N=O.split(":"),z=N.length;let G=z,A=0,oe;if(z>3||!/^(\d\d:){0,2}\d\d?$/.test(O))throw new Error("tick only understands numbers, 'm:s' and 'h:m:s'. Each part must be two digits");for(;G--;){if(oe=parseInt(N[G],10),oe>=60)throw new Error(`Invalid time ${O}`);A+=oe*Math.pow(60,z-G-1)}return A*1e3}function Y(O){const z=O*1e6%1e6,G=z<0?z+1e6:z;return Math.floor(G)}function L(O){if(!O)return 0;if(typeof O.getTime=="function")return O.getTime();if(typeof O=="number")return O;throw new TypeError("now should be milliseconds since UNIX epoch")}function Z(O,N,z){return z&&z.callAt>=O&&z.callAt<=N}function ae(O,N){const z=new Error(`Aborting after running ${O.loopLimit} timers, assuming an infinite loop!`);if(!N.error)return z;const G=/target\.*[<|(|[].*?[>|\]|)]\s*/;let A=new RegExp(String(Object.keys(O).join("|")));d&&(A=new RegExp(`\\s+at (Object\\.)?(?:${Object.keys(O).join("|")})\\s+`));let oe=-1;N.error.stack.split(`
201
+ `).some(function(Pe,ze){return Pe.match(G)?(oe=ze,!0):Pe.match(A)?(oe=ze,!1):oe>=0});const je=`${z}
202
+ ${N.type||"Microtask"} - ${N.func.name||"anonymous"}
203
+ ${N.error.stack.split(`
204
+ `).slice(oe+1).join(`
205
+ `)}`;try{Object.defineProperty(z,"stack",{value:je})}catch{}return z}function ne(O,N){let z;for(z in N)N.hasOwnProperty(z)&&(O[z]=N[z]);return N.now?O.now=function(){return O.clock.now}:delete O.now,N.toSource?O.toSource=function(){return N.toSource()}:delete O.toSource,O.toString=function(){return N.toString()},O.prototype=N.prototype,O.parse=N.parse,O.UTC=N.UTC,O.prototype.toUTCString=N.prototype.toUTCString,O.isFake=!0,O}function fe(){function O(N,z,G,A,oe,je,Pe){if(!(this instanceof O))return new k(O.clock.now).toString();switch(arguments.length){case 0:return new k(O.clock.now);case 1:return new k(N);case 2:return new k(N,z);case 3:return new k(N,z,G);case 4:return new k(N,z,G,A);case 5:return new k(N,z,G,A,oe);case 6:return new k(N,z,G,A,oe,je);default:return new k(N,z,G,A,oe,je,Pe)}}return ne(O,k)}function H(){const O={...P};return O.DateTimeFormat=function(...N){const z=new P.DateTimeFormat(...N),G={};return["formatRange","formatRangeToParts","resolvedOptions"].forEach(A=>{G[A]=z[A].bind(z)}),["format","formatToParts"].forEach(A=>{G[A]=function(oe){return z[A](oe||O.clock.now)}}),G},O.DateTimeFormat.prototype=Object.create(P.DateTimeFormat.prototype),O.DateTimeFormat.supportedLocalesOf=P.DateTimeFormat.supportedLocalesOf,O}function me(O,N){O.jobs||(O.jobs=[]),O.jobs.push(N)}function ce(O){if(O.jobs){for(let N=0;N<O.jobs.length;N++){const z=O.jobs[N];if(z.func.apply(null,z.args),D(O,N),O.loopLimit&&N>O.loopLimit)throw ae(O,z)}J(),O.jobs=[]}}function se(O,N){if(N.func===void 0)throw new Error("Callback must be provided to timer calls");if(d&&typeof N.func!="function")throw new TypeError(`[ERR_INVALID_CALLBACK]: Callback must be a function. Received ${N.func} of type ${typeof N.func}`);if(j&&(N.error=new Error),N.type=N.immediate?"Immediate":"Timeout",N.hasOwnProperty("delay")&&(typeof N.delay!="number"&&(N.delay=parseInt(N.delay,10)),F(N.delay)||(N.delay=0),N.delay=N.delay>i?1:N.delay,N.delay=Math.max(0,N.delay)),N.hasOwnProperty("interval")&&(N.type="Interval",N.interval=N.interval>i?1:N.interval),N.hasOwnProperty("animation")&&(N.type="AnimationFrame",N.animation=!0),N.hasOwnProperty("idleCallback")&&(N.type="IdleCallback",N.idleCallback=!0),O.timers||(O.timers={}),N.id=M++,N.createdAt=O.now,N.callAt=O.now+(parseInt(N.delay)||(O.duringTick?1:0)),O.timers[N.id]=N,d){const z={refed:!0,ref:function(){return this.refed=!0,z},unref:function(){return this.refed=!1,z},hasRef:function(){return this.refed},refresh:function(){return N.callAt=O.now+(parseInt(N.delay)||(O.duringTick?1:0)),O.timers[N.id]=N,z},[Symbol.toPrimitive]:function(){return N.id}};return z}return N.id}function Se(O,N){if(O.callAt<N.callAt)return-1;if(O.callAt>N.callAt)return 1;if(O.immediate&&!N.immediate)return-1;if(!O.immediate&&N.immediate)return 1;if(O.createdAt<N.createdAt)return-1;if(O.createdAt>N.createdAt)return 1;if(O.id<N.id)return-1;if(O.id>N.id)return 1}function Me(O,N,z){const G=O.timers;let A=null,oe,je;for(oe in G)G.hasOwnProperty(oe)&&(je=Z(N,z,G[oe]),je&&(!A||Se(A,G[oe])===1)&&(A=G[oe]));return A}function q(O){const N=O.timers;let z=null,G;for(G in N)N.hasOwnProperty(G)&&(!z||Se(z,N[G])===1)&&(z=N[G]);return z}function Q(O){const N=O.timers;let z=null,G;for(G in N)N.hasOwnProperty(G)&&(!z||Se(z,N[G])===-1)&&(z=N[G]);return z}function W(O,N){if(typeof N.interval=="number"?O.timers[N.id].callAt+=N.interval:delete O.timers[N.id],typeof N.func=="function")N.func.apply(null,N.args);else{const z=eval;(function(){z(N.func)})()}}function le(O){return O==="IdleCallback"||O==="AnimationFrame"?`cancel${O}`:`clear${O}`}function de(O){return O==="IdleCallback"||O==="AnimationFrame"?`request${O}`:`set${O}`}function X(){let O=0;return function(N){!O++&&console.warn(N)}}const _e=X();function xe(O,N,z){if(!N)return;O.timers||(O.timers={});const G=Number(N);if(Number.isNaN(G)||G<o){const A=le(z);if(O.shouldClearNativeTimers===!0){const oe=O[`_${A}`];return typeof oe=="function"?oe(N):void 0}_e(`FakeTimers: ${A} was invoked to clear a native timer instead of one created by this library.
206
+ To automatically clean-up native timers, use \`shouldClearNativeTimers\`.`)}if(O.timers.hasOwnProperty(G)){const A=O.timers[G];if(A.type===z||A.type==="Timeout"&&z==="Interval"||A.type==="Interval"&&z==="Timeout")delete O.timers[G];else{const oe=le(z),je=de(A.type);throw new Error(`Cannot clear timer: timer created with ${je}() but cleared with ${oe}()`)}}}function Oe(O,N){let z,G,A;const oe="_hrtime",je="_nextTick";for(G=0,A=O.methods.length;G<A;G++){if(z=O.methods[G],z==="hrtime"&&a.process)a.process.hrtime=O[oe];else if(z==="nextTick"&&a.process)a.process.nextTick=O[je];else if(z==="performance"){const Pe=Object.getOwnPropertyDescriptor(O,`_${z}`);Pe&&Pe.get&&!Pe.set?Object.defineProperty(a,z,Pe):Pe.configurable&&(a[z]=O[`_${z}`])}else if(a[z]&&a[z].hadOwnProperty)a[z]=O[`_${z}`];else try{delete a[z]}catch{}if(O.timersModuleMethods!==void 0)for(let Pe=0;Pe<O.timersModuleMethods.length;Pe++){const ze=O.timersModuleMethods[Pe];t[ze.methodName]=ze.original}}return N.shouldAdvanceTime===!0&&a.clearInterval(O.attachedInterval),O.methods=[],O.timers?Object.keys(O.timers).map(function(ze){return O.timers[ze]}):[]}function Zt(O,N,z){if(z[N].hadOwnProperty=Object.prototype.hasOwnProperty.call(O,N),z[`_${N}`]=O[N],N==="Date"){const G=ne(z[N],O[N]);O[N]=G}else if(N==="Intl")O[N]=z[N];else if(N==="performance"){const G=Object.getOwnPropertyDescriptor(O,N);if(G&&G.get&&!G.set){Object.defineProperty(z,`_${N}`,G);const A=Object.getOwnPropertyDescriptor(z,N);Object.defineProperty(O,N,A)}else O[N]=z[N]}else O[N]=function(){return z[N].apply(z,arguments)},Object.defineProperties(O[N],Object.getOwnPropertyDescriptors(z[N]));O[N].clock=z}function wt(O,N){O.tick(N)}const Le={setTimeout:a.setTimeout,clearTimeout:a.clearTimeout,setInterval:a.setInterval,clearInterval:a.clearInterval,Date:a.Date};v&&(Le.setImmediate=a.setImmediate,Le.clearImmediate=a.clearImmediate),c&&(Le.hrtime=a.process.hrtime),p&&(Le.nextTick=a.process.nextTick),g&&(Le.performance=a.performance),x&&(Le.requestAnimationFrame=a.requestAnimationFrame),w&&(Le.queueMicrotask=!0),T&&(Le.cancelAnimationFrame=a.cancelAnimationFrame),E&&(Le.requestIdleCallback=a.requestIdleCallback),y&&(Le.cancelIdleCallback=a.cancelIdleCallback),R&&(Le.Intl=a.Intl);const Xe=a.setImmediate||a.setTimeout;function er(O,N){O=Math.floor(L(O)),N=N||1e3;let z=0;const G=[0,0];if(k===void 0)throw new Error("The global scope doesn't have a `Date` object (see https://github.com/sinonjs/sinon/issues/1852#issuecomment-419622780)");const A={now:O,Date:fe(),loopLimit:N};A.Date.clock=A;function oe(){return 16-(A.now-O)%16}function je(ie){const U=A.now-G[0]-O,ee=Math.floor(U/1e3),te=(U-ee*1e3)*1e6+z-G[1];if(Array.isArray(ie)){if(ie[1]>1e9)throw new TypeError("Number of nanoseconds can't exceed a billion");const ye=ie[0];let Ne=te-ie[1],Ft=ee-ye;return Ne<0&&(Ne+=1e9,Ft-=1),[Ft,Ne]}return[ee,te]}function Pe(){const ie=je();return ie[0]*1e3+ie[1]/1e6}f&&(je.bigint=function(){const ie=je();return BigInt(ie[0])*BigInt(1e9)+BigInt(ie[1])}),R&&(A.Intl=H(),A.Intl.clock=A),A.requestIdleCallback=function(U,ee){let te=0;A.countTimers()>0&&(te=50);const ye=se(A,{func:U,args:Array.prototype.slice.call(arguments,2),delay:typeof ee>"u"?te:Math.min(ee,te),idleCallback:!0});return Number(ye)},A.cancelIdleCallback=function(U){return xe(A,U,"IdleCallback")},A.setTimeout=function(U,ee){return se(A,{func:U,args:Array.prototype.slice.call(arguments,2),delay:ee})},typeof a.Promise<"u"&&m&&(A.setTimeout[m.custom]=function(U,ee){return new a.Promise(function(ye){se(A,{func:ye,args:[ee],delay:U})})}),A.clearTimeout=function(U){return xe(A,U,"Timeout")},A.nextTick=function(U){return me(A,{func:U,args:Array.prototype.slice.call(arguments,1),error:j?new Error:null})},A.queueMicrotask=function(U){return A.nextTick(U)},A.setInterval=function(U,ee){return ee=parseInt(ee,10),se(A,{func:U,args:Array.prototype.slice.call(arguments,2),delay:ee,interval:ee})},A.clearInterval=function(U){return xe(A,U,"Interval")},v&&(A.setImmediate=function(U){return se(A,{func:U,args:Array.prototype.slice.call(arguments,1),immediate:!0})},typeof a.Promise<"u"&&m&&(A.setImmediate[m.custom]=function(U){return new a.Promise(function(te){se(A,{func:te,args:[U],immediate:!0})})}),A.clearImmediate=function(U){return xe(A,U,"Immediate")}),A.countTimers=function(){return Object.keys(A.timers||{}).length+(A.jobs||[]).length},A.requestAnimationFrame=function(U){const ee=se(A,{func:U,delay:oe(),get args(){return[Pe()]},animation:!0});return Number(ee)},A.cancelAnimationFrame=function(U){return xe(A,U,"AnimationFrame")},A.runMicrotasks=function(){ce(A)};function ze(ie,U,ee,te){const ye=typeof ie=="number"?ie:B(ie),Ne=Math.floor(ye),Ft=Y(ye);let vr=z+Ft,tt=A.now+Ne;if(ye<0)throw new TypeError("Negative ticks are not supported");vr>=1e6&&(tt+=1,vr-=1e6),z=vr;let ht=A.now,Hr=A.now,it,Bt,Ve,K,Gr,Kr;A.duringTick=!0,Ve=A.now,ce(A),Ve!==A.now&&(ht+=A.now-Ve,tt+=A.now-Ve);function tr(){for(it=Me(A,ht,tt);it&&ht<=tt;){if(A.timers[it.id]){ht=it.callAt,A.now=it.callAt,Ve=A.now;try{ce(A),W(A,it)}catch(Jr){Bt=Bt||Jr}if(U){Xe(K);return}Gr()}Kr()}if(Ve=A.now,ce(A),Ve!==A.now&&(ht+=A.now-Ve,tt+=A.now-Ve),A.duringTick=!1,it=Me(A,ht,tt),it)try{A.tick(tt-A.now)}catch(Jr){Bt=Bt||Jr}else A.now=tt,z=vr;if(Bt)throw Bt;if(U)ee(A.now);else return A.now}return K=U&&function(){try{Gr(),Kr(),tr()}catch(Jr){te(Jr)}},Gr=function(){Ve!==A.now&&(ht+=A.now-Ve,tt+=A.now-Ve,Hr+=A.now-Ve)},Kr=function(){it=Me(A,Hr,tt),Hr=ht},tr()}return A.tick=function(U){return ze(U,!1)},typeof a.Promise<"u"&&(A.tickAsync=function(U){return new a.Promise(function(ee,te){Xe(function(){try{ze(U,!0,ee,te)}catch(ye){te(ye)}})})}),A.next=function(){ce(A);const U=q(A);if(!U)return A.now;A.duringTick=!0;try{return A.now=U.callAt,W(A,U),ce(A),A.now}finally{A.duringTick=!1}},typeof a.Promise<"u"&&(A.nextAsync=function(){return new a.Promise(function(U,ee){Xe(function(){try{const te=q(A);if(!te){U(A.now);return}let ye;A.duringTick=!0,A.now=te.callAt;try{W(A,te)}catch(Ne){ye=Ne}A.duringTick=!1,Xe(function(){ye?ee(ye):U(A.now)})}catch(te){ee(te)}})})}),A.runAll=function(){let U,ee;for(ce(A),ee=0;ee<A.loopLimit;ee++){if(!A.timers||(U=Object.keys(A.timers).length,U===0))return J(),A.now;A.next(),D(A,ee)}const te=q(A);throw ae(A,te)},A.runToFrame=function(){return A.tick(oe())},typeof a.Promise<"u"&&(A.runAllAsync=function(){return new a.Promise(function(U,ee){let te=0;function ye(){Xe(function(){try{let Ne;if(te<A.loopLimit){if(!A.timers){J(),U(A.now);return}if(Ne=Object.keys(A.timers).length,Ne===0){J(),U(A.now);return}A.next(),te++,ye(),D(A,te);return}const Ft=q(A);ee(ae(A,Ft))}catch(Ne){ee(Ne)}})}ye()})}),A.runToLast=function(){const U=Q(A);return U?A.tick(U.callAt-A.now):(ce(A),A.now)},typeof a.Promise<"u"&&(A.runToLastAsync=function(){return new a.Promise(function(U,ee){Xe(function(){try{const te=Q(A);te||U(A.now),U(A.tickAsync(te.callAt-A.now))}catch(te){ee(te)}})})}),A.reset=function(){z=0,A.timers={},A.jobs=[],A.now=O},A.setSystemTime=function(U){const ee=L(U),te=ee-A.now;let ye,Ne;G[0]=G[0]+te,G[1]=G[1]+z,A.now=ee,z=0;for(ye in A.timers)A.timers.hasOwnProperty(ye)&&(Ne=A.timers[ye],Ne.createdAt+=te,Ne.callAt+=te)},A.jump=function(U){const ee=typeof U=="number"?U:B(U),te=Math.floor(ee);for(const ye of Object.values(A.timers))A.now+te>ye.callAt&&(ye.callAt=A.now+te);A.tick(te)},g&&(A.performance=Object.create(null),A.performance.now=Pe),c&&(A.hrtime=je),A}function Vr(O){if(arguments.length>1||O instanceof Date||Array.isArray(O)||typeof O=="number")throw new TypeError(`FakeTimers.install called with ${String(O)} install requires an object parameter`);if(a.Date.isFake===!0)throw new TypeError("Can't install fake timers twice on the same global object.");if(O=typeof O<"u"?O:{},O.shouldAdvanceTime=O.shouldAdvanceTime||!1,O.advanceTimeDelta=O.advanceTimeDelta||20,O.shouldClearNativeTimers=O.shouldClearNativeTimers||!1,O.target)throw new TypeError("config.target is no longer supported. Use `withGlobal(target)` instead.");let N,z;const G=er(O.now,O.loopLimit);if(G.shouldClearNativeTimers=O.shouldClearNativeTimers,G.uninstall=function(){return Oe(G,O)},G.methods=O.toFake||[],G.methods.length===0&&(G.methods=Object.keys(Le).filter(function(A){return A!=="nextTick"&&A!=="queueMicrotask"})),O.shouldAdvanceTime===!0){const A=wt.bind(null,G,O.advanceTimeDelta),oe=a.setInterval(A,O.advanceTimeDelta);G.attachedInterval=oe}if(G.methods.includes("performance")){const A=(()=>{if(h)return a.performance.constructor.prototype;if(b)return a.Performance.prototype})();if(A)Object.getOwnPropertyNames(A).forEach(function(oe){oe!=="now"&&(G.performance[oe]=oe.indexOf("getEntries")===0?l:s)});else if((O.toFake||[]).includes("performance"))throw new ReferenceError("non-existent performance object cannot be faked")}for(a===e&&t&&(G.timersModuleMethods=[]),N=0,z=G.methods.length;N<z;N++){const A=G.methods[N];if(A==="hrtime"?a.process&&typeof a.process.hrtime=="function"&&Zt(a.process,A,G):A==="nextTick"?a.process&&typeof a.process.nextTick=="function"&&Zt(a.process,A,G):Zt(a,A,G),G.timersModuleMethods!==void 0&&t[A]){const oe=t[A];G.timersModuleMethods.push({methodName:A,original:oe}),t[A]=a[A]}}return G}return{timers:Le,createClock:er,install:Vr,withGlobal:r}}const n=r(e);return wr.timers=n.timers,wr.createClock=n.createClock,wr.install=n.install,wr.withGlobal=r,wr}var EN=CN();class TN{constructor({global:t,config:r}){re(this,"_global");re(this,"_clock");re(this,"_fakingTime");re(this,"_fakingDate");re(this,"_fakeTimers");re(this,"_userConfig");re(this,"_now",ct.now);this._userConfig=r,this._fakingDate=!1,this._fakingTime=!1,this._fakeTimers=EN.withGlobal(t),this._global=t}clearAllTimers(){this._fakingTime&&this._clock.reset()}dispose(){this.useRealTimers()}runAllTimers(){this._checkFakeTimers()&&this._clock.runAll()}async runAllTimersAsync(){this._checkFakeTimers()&&await this._clock.runAllAsync()}runOnlyPendingTimers(){this._checkFakeTimers()&&this._clock.runToLast()}async runOnlyPendingTimersAsync(){this._checkFakeTimers()&&await this._clock.runToLastAsync()}advanceTimersToNextTimer(t=1){if(this._checkFakeTimers())for(let r=t;r>0&&(this._clock.next(),this._clock.tick(0),this._clock.countTimers()!==0);r--);}async advanceTimersToNextTimerAsync(t=1){if(this._checkFakeTimers())for(let r=t;r>0&&(await this._clock.nextAsync(),this._clock.tick(0),this._clock.countTimers()!==0);r--);}advanceTimersByTime(t){this._checkFakeTimers()&&this._clock.tick(t)}async advanceTimersByTimeAsync(t){this._checkFakeTimers()&&await this._clock.tickAsync(t)}advanceTimersToNextFrame(){this._checkFakeTimers()&&this._clock.runToFrame()}runAllTicks(){this._checkFakeTimers()&&this._clock.runMicrotasks()}useRealTimers(){this._fakingDate&&(HO(),this._fakingDate=!1),this._fakingTime&&(this._clock.uninstall(),this._fakingTime=!1)}useFakeTimers(){if(this._fakingDate)throw new Error('"setSystemTime" was called already and date was mocked. Reset timers using `vi.useRealTimers()` if you want to use fake timers again.');if(!this._fakingTime){const t=Object.keys(this._fakeTimers.timers).filter(n=>n!=="nextTick");if(this._userConfig?.toFake?.includes("nextTick")&&Gv())throw new Error("process.nextTick cannot be mocked inside child_process");const r=(this._userConfig?.toFake||t).filter(n=>{switch(n){case"setImmediate":case"clearImmediate":return n in this._global&&this._global[n];default:return!0}});this._clock=this._fakeTimers.install({now:Date.now(),...this._userConfig,toFake:r}),this._fakingTime=!0}}reset(){if(this._checkFakeTimers()){const{now:t}=this._clock;this._clock.reset(),this._clock.setSystemTime(t)}}setSystemTime(t){this._fakingTime?this._clock.setSystemTime(t):(VO(t??this.getRealSystemTime()),this._fakingDate=!0)}getRealSystemTime(){return this._now()}getTimerCount(){return this._checkFakeTimers()?this._clock.countTimers():0}configure(t){this._userConfig=t}isFakeTimers(){return this._fakingTime}_checkFakeTimers(){if(!this._fakingTime)throw new Error('Timers are not mocked. Try calling "vi.useFakeTimers()" first.');return this._fakingTime}}function ow(e,t){return t.stack!==void 0&&(e.stack=t.stack.replace(t.message,e.message)),e}function SN(e,t={}){const{setTimeout:r,setInterval:n,clearTimeout:a,clearInterval:i}=ui(),{interval:o=50,timeout:s=1e3}=typeof t=="number"?{timeout:t}:t,l=new Error("STACK_TRACE_ERROR");return new Promise((u,d)=>{let c,f="idle",p,m;const g=w=>{p&&a(p),m&&i(m),u(w)},b=()=>{m&&i(m);let w=c;w||(w=ow(new Error("Timed out in waitFor!"),l)),d(w)},h=()=>{if(Jt.isFakeTimers()&&Jt.advanceTimersByTime(o),f!=="pending")try{const w=e();if(w!==null&&typeof w=="object"&&typeof w.then=="function"){const x=w;f="pending",x.then(T=>{f="resolved",g(T)},T=>{f="rejected",c=T})}else return g(w),!0}catch(w){c=w}};h()!==!0&&(p=r(b,s),m=n(h,o))})}function _N(e,t={}){const{setTimeout:r,setInterval:n,clearTimeout:a,clearInterval:i}=ui(),{interval:o=50,timeout:s=1e3}=typeof t=="number"?{timeout:t}:t,l=new Error("STACK_TRACE_ERROR");return new Promise((u,d)=>{let c="idle",f,p;const m=h=>{p&&i(p),h||(h=ow(new Error("Timed out in waitUntil!"),l)),d(h)},g=h=>{if(h)return f&&a(f),p&&i(p),u(h),!0},b=()=>{if(Jt.isFakeTimers()&&Jt.advanceTimersByTime(o),c!=="pending")try{const h=e();if(h!==null&&typeof h=="object"&&typeof h.then=="function"){const w=h;c="pending",w.then(x=>{c="resolved",g(x)},x=>{c="rejected",m(x)})}else return g(h)}catch(h){m(h)}};b()!==!0&&(f=r(m,s),p=n(b,o))})}function PN(){let e=null,t=null;const r=gi();let n;const a=()=>n||(n=new TN({global:globalThis,config:r.config.fakeTimers})),i=new Map,o=new Map,s=["PROD","DEV","SSR"],l={useFakeTimers(u){if(Gv()&&(u?.toFake?.includes("nextTick")||r.config?.fakeTimers?.toFake?.includes("nextTick")))throw new Error('vi.useFakeTimers({ toFake: ["nextTick"] }) is not supported in node:child_process. Use --pool=threads if mocking nextTick is required.');return u?a().configure({...r.config.fakeTimers,...u}):a().configure(r.config.fakeTimers),a().useFakeTimers(),l},isFakeTimers(){return a().isFakeTimers()},useRealTimers(){return a().useRealTimers(),e=null,l},runOnlyPendingTimers(){return a().runOnlyPendingTimers(),l},async runOnlyPendingTimersAsync(){return await a().runOnlyPendingTimersAsync(),l},runAllTimers(){return a().runAllTimers(),l},async runAllTimersAsync(){return await a().runAllTimersAsync(),l},runAllTicks(){return a().runAllTicks(),l},advanceTimersByTime(u){return a().advanceTimersByTime(u),l},async advanceTimersByTimeAsync(u){return await a().advanceTimersByTimeAsync(u),l},advanceTimersToNextTimer(){return a().advanceTimersToNextTimer(),l},async advanceTimersToNextTimerAsync(){return await a().advanceTimersToNextTimerAsync(),l},advanceTimersToNextFrame(){return a().advanceTimersToNextFrame(),l},getTimerCount(){return a().getTimerCount()},setSystemTime(u){const d=u instanceof Date?u:new Date(u);return e=d,a().setSystemTime(d),l},getMockedSystemTime(){return e},getRealSystemTime(){return a().getRealSystemTime()},clearAllTimers(){return a().clearAllTimers(),l},spyOn:mA,fn:gA,waitFor:SN,waitUntil:_N,hoisted(u){return bt(u,'"vi.hoisted" factory',["function"]),u()},mock(u,d){if(typeof u!="string")throw new TypeError(`vi.mock() expects a string path, but received a ${typeof u}`);const c=xr("mock");st().queueMock(u,c,typeof d=="function"?()=>d(()=>st().importActual(u,c,st().getMockContext().callstack)):d)},unmock(u){if(typeof u!="string")throw new TypeError(`vi.unmock() expects a string path, but received a ${typeof u}`);st().queueUnmock(u,xr("unmock"))},doMock(u,d){if(typeof u!="string")throw new TypeError(`vi.doMock() expects a string path, but received a ${typeof u}`);const c=xr("doMock");st().queueMock(u,c,typeof d=="function"?()=>d(()=>st().importActual(u,c,st().getMockContext().callstack)):d)},doUnmock(u){if(typeof u!="string")throw new TypeError(`vi.doUnmock() expects a string path, but received a ${typeof u}`);st().queueUnmock(u,xr("doUnmock"))},async importActual(u){return st().importActual(u,xr("importActual"),st().getMockContext().callstack)},async importMock(u){return st().importMock(u,xr("importMock"))},mocked(u,d={}){return u},isMockFunction(u){return Dy(u)},clearAllMocks(){return $i.forEach(u=>u.mockClear()),l},resetAllMocks(){return $i.forEach(u=>u.mockReset()),l},restoreAllMocks(){return $i.forEach(u=>u.mockRestore()),l},stubGlobal(u,d){return i.has(u)||i.set(u,Object.getOwnPropertyDescriptor(globalThis,u)),Object.defineProperty(globalThis,u,{value:d,writable:!0,configurable:!0,enumerable:!0}),l},stubEnv(u,d){return o.has(u)||o.set(u,process.env[u]),s.includes(u)?process.env[u]=d?"1":"":d===void 0?delete process.env[u]:process.env[u]=String(d),l},unstubAllGlobals(){return i.forEach((u,d)=>{u?Object.defineProperty(globalThis,d,u):Reflect.deleteProperty(globalThis,d)}),i.clear(),l},unstubAllEnvs(){return o.forEach((u,d)=>{u===void 0?delete process.env[d]:process.env[d]=u}),o.clear(),l},resetModules(){return sI(r.moduleCache),l},async dynamicImportSettled(){return Kv()},setConfig(u){t||(t={...r.config}),Object.assign(r.config,u)},resetConfig(){t&&Object.assign(r.config,t)}};return l}const kN=PN(),Jt=kN;function st(){return typeof __vitest_mocker__<"u"?__vitest_mocker__:new Proxy({},{get(e,t){throw new Error(`Vitest mocker was not initialized in this environment. vi.${String(t)}() is forbidden.`)}})}function xr(e){const r=xM({stackTraceLimit:5}).split(`
207
+ `),n=r.findIndex(i=>i.includes(` at Object.${e}`)||i.includes(`${e}@`));return Lv(r[n+1])?.file||""}function MN(e={}){const{body:t={},status:r=200,headers:n={},delay:a=0,streaming:i=!1,sseText:o,error:s}=e;return Jt.fn().mockImplementation(async()=>{if(a>0&&await new Promise(u=>setTimeout(u,a)),s)throw s;if(i&&o)return Mu(o,r);const l=typeof t=="string"?t:JSON.stringify(t);return new Response(l,{status:r,headers:{"Content-Type":"application/json",...n}})})}function AN(e){return Jt.fn().mockImplementation(async(t,r)=>{const n=typeof t=="string"?t:t.url;for(const[a,i]of Object.entries(e))if(new RegExp(a).test(n)){const{body:s={},status:l=200,headers:u={},delay:d=0,streaming:c=!1,sseText:f,error:p}=i;if(d>0&&await new Promise(g=>setTimeout(g,d)),p)throw p;if(c&&f)return Mu(f,l);const m=typeof s=="string"?s:JSON.stringify(s);return new Response(m,{status:l,headers:{"Content-Type":"application/json",...u}})}return new Response(JSON.stringify({error:"Not Found"}),{status:404,headers:{"Content-Type":"application/json"}})})}function qN(e){Jt.stubGlobal("fetch",e)}function IN(){Jt.unstubAllGlobals()}function ON(e,t,r){const n=e.mock.calls;if(!n.find(([i,o])=>{if(!(typeof t=="string"?i.includes(t):t.test(i)))return!1;if(r){if(r.method&&o?.method!==r.method)return!1;if(r.headers){const l=o?.headers;for(const[u,d]of Object.entries(r.headers))if(l?.[u]!==d)return!1}}return!0}))throw new Error(`Expected fetch to be called with URL matching ${t}.
208
+ Actual calls: ${n.map(([i])=>i).join(", ")}`)}exports.AttachmentValidationError=Bo;exports.Badge=Su;exports.CuadraChat=aC;exports.CuadraChatContext=Lr;exports.CuadraChatProvider=_u;exports.SourceCitations=fb;exports.applyTheme=mb;exports.cleanupFetchMock=IN;exports.createAttachmentAdapter=wu;exports.createDeferred=TP;exports.createMockChat=zo;exports.createMockChatStream=Uo;exports.createMockChatSummaries=cC;exports.createMockChatSummary=Pu;exports.createMockChatSummaryPage=lC;exports.createMockErrorStream=yb;exports.createMockFetch=MN;exports.createMockMessage=kt;exports.createMockModel=or;exports.createMockModelPage=oC;exports.createMockModels=sC;exports.createMockReadableStream=vb;exports.createMockStreamingResponse=Mu;exports.createRoutedMockFetch=AN;exports.createSSEEvent=ku;exports.createWrapper=CP;exports.expectFetchCalledWith=ON;exports.isV2Props=gb;exports.mockChats=uC;exports.mockModels=iC;exports.mockStreams=dC;exports.normalizeCuadraChatProps=bb;exports.removeTheme=XR;exports.renderWithProviders=RP;exports.setupFetchMock=qN;exports.streamingMetadataStore=Mt;exports.useCuadraChat=ZR;exports.useCuadraChatOptional=eC;exports.waitForAsync=EP;
23
209
  //# sourceMappingURL=index.cjs.map