@spikonado/sprocket 0.4.0 → 0.4.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.
@@ -70,19 +70,19 @@ An authorization_code was supplied for a login which did not originate at the ap
70
70
  * This could have been an attempted Login CSRF attack. You were not affected.
71
71
  * The developer may not have configured a Login Initiation endpoint.`)}let a=new URL(window.location.toString());a.searchParams.delete(`code`),a.searchParams.delete(`state`),window.sessionStorage.removeItem(Nf.codeVerifier),window.history.replaceState({},``,a)},Np=function(){vf(this,bp).tag===`AUTHENTICATED`&&xf(this,jp,Pp).call(this)},Pp=async function(){vf(this,bp).tag!==`SIGNED_OUT`&&bf(this,xp,setTimeout(()=>{xf(this,jp,Rp).call(this)&&vf(this,Ep).call(this)?xf(this,jp,Fp).call(this).catch(e=>{vf(this,bp).tag!==`SIGNED_OUT`&&console.debug(e)}).finally(()=>xf(this,jp,Pp).call(this)):xf(this,jp,Pp).call(this)},1e3))},Fp=async function({organizationId:e}={}){if(xf(this,jp,Lp).call(this),vf(this,bp).tag===`AUTHENTICATING`){await vf(this,bp).response;return}let t=vf(this,bp);bf(this,bp,{tag:`AUTHENTICATING`,response:xf(this,jp,Ip).call(this,{organizationId:e,beginningState:t})}),await vf(this,bp).response},Ip=async function({organizationId:e,beginningState:t}){try{return await np(vp,async()=>{if(xf(this,jp,Lp).call(this),e)sessionStorage.setItem(_p(vf(this,Sp)),e);else{let t=xf(this,jp,Bp).call(this);e=t?Pf(t)?.org_id:sessionStorage.getItem(_p(vf(this,Sp)))??sessionStorage.getItem(gp)??void 0}let t=await vf(this,Cp).authenticateWithRefreshToken({refreshToken:Rf({devMode:vf(this,Tp),clientId:vf(this,Sp)}),organizationId:e,useCookie:vf(this,jp,Hp)});return xf(this,jp,Lp).call(this),bf(this,bp,{tag:`AUTHENTICATED`}),If(t,{devMode:vf(this,Tp),clientId:vf(this,Sp)}),xf(this,jp,Up).call(this,t),t})}catch(e){throw xf(this,jp,Lp).call(this),e instanceof ap&&e.name===`AcquisitionTimeoutError`?(console.warn(`Couldn't acquire refresh lock.`),bf(this,bp,t),new Wf(void 0,{cause:e})):(t.tag!==`INITIAL`&&console.debug(e),e instanceof Vf&&!e.isTransient?(Lf({devMode:vf(this,Tp),clientId:vf(this,Sp)}),sessionStorage.removeItem(_p(vf(this,Sp))),sessionStorage.removeItem(gp),t.tag!==`INITIAL`&&vf(this,kp)&&vf(this,kp).call(this,{signIn:this.signIn.bind(this)}),bf(this,bp,{tag:`ERROR`})):bf(this,bp,{tag:`AUTHENTICATED`}),e)}},Lp=function(){if(vf(this,bp).tag===`SIGNED_OUT`)throw new Uf},Rp=function(){switch(vf(this,bp).tag){case`INITIAL`:case`AUTHENTICATING`:return!0;case`SIGNED_OUT`:case`ERROR`:return!1;case`AUTHENTICATED`:let e=Tf.getItem(Nf.accessToken),t=Tf.getItem(Nf.expiresAt);return!e||!t||t-vf(this,Ap)*1e3<Date.now()}},zp=async function({context:e,invitationToken:t,loginHint:n,organizationId:r,passwordResetToken:i,state:a,screenHint:o}){let{codeVerifier:s,codeChallenge:c}=await Ef();return window.sessionStorage.setItem(Nf.codeVerifier,s),vf(this,Cp).getAuthorizationUrl({codeChallenge:c,codeChallengeMethod:`S256`,context:e,invitationToken:t,loginHint:n,organizationId:r,passwordResetToken:i,redirectUri:vf(this,wp),screenHint:o,state:a?JSON.stringify(a):void 0})},Bp=function(){return Tf.getItem(Nf.accessToken)},Vp=function(){let e=xf(this,jp,Bp).call(this),t=Tf.getItem(Nf.expiresAt);return e&&t&&t>Date.now()?e:void 0},Hp=function(){return!vf(this,Tp)},Up=async function(e){if(vf(this,Op)){let{refreshToken:t,...n}=e;vf(this,Op).call(this,n)}};async function Gp(e,t={}){let n=new Wp(e,t);return await n.initialize(),n}function Kp(e,t){return new Proxy({},{get(n,r){if(typeof r==`string`)return Kp(e,[...t,r]);if(r===xt){if(t.length<1){let n=[e,...t].join(`.`);throw Error(`API path is expected to be of the form \`${e}.childComponent.functionName\`. Found: \`${n}\``)}return`_reference/childComponent/`+t.join(`/`)}}})}var qp=()=>Kp(`components`,[]),Jp=Ot;qp();var Yp=Od({error:L().optional()});function Xp(e,t){let n=e.trim().slice(0,120);return n.startsWith(`<!`)?Error(`The Sprocket API at ${t} returned a web page instead of JSON. Make sure the server is running correctly.`):Error(n.length>0?`Local API returned an unexpected response: ${n}`:`Local API returned an empty response.`)}async function Zp(e,t,n){let r=await e.text();if(!(e.headers.get(`content-type`)??``).includes(`application/json`))throw Xp(r,n);let i;try{i=JSON.parse(r)}catch{throw Xp(r,n)}let a=t.safeParse(i);if(!a.success)throw Error(`Local API returned an unexpected response.`);return a.data}async function Qp(e,t){let n=await e.text(),r;try{r=JSON.parse(n)}catch{return Xp(n,t)}let i=Yp.safeParse(r);return i.success?Error(i.data.error?i.data.error:`Local request failed (${e.status}).`):Error(`Local API returned an unexpected response.`)}async function $p(e,t){if(!e.ok)throw await Qp(e,t);return e}function em(e){let t=e.split(`
72
72
  `).map(e=>e.endsWith(`\r`)?e.slice(0,-1):e).filter(e=>e===`data`||e.startsWith(`data:`)).map(e=>e===`data`?``:e.slice(5).replace(/^ /,``));return t.length>0?t.join(`
73
- `):null}async function tm(e,t,n){if(!e.body)return;let r=e.body.getReader(),i=new TextDecoder,a=``,o=()=>void r.cancel(t.reason).catch(()=>void 0);t.addEventListener(`abort`,o,{once:!0});try{for(;!t.aborted;){let{done:e,value:o}=await r.read();a+=i.decode(o,{stream:!e});let s=/\r?\n\r?\n/.exec(a);for(;s;){let e=em(a.slice(0,s.index));a=a.slice(s.index+s[0].length),e!==null&&!t.aborted&&n(e),s=/\r?\n\r?\n/.exec(a)}if(e)break}}catch(e){if(!t.aborted)throw e}finally{t.removeEventListener(`abort`,o),await r.cancel().catch(()=>void 0),r.releaseLock()}}function nm(e){async function t(t,n){return await fetch(`${e}${t}`,{...n,credentials:`include`,headers:{"content-type":`application/json`,...n?.headers}})}return{async request(n,r,i){let a=await $p(await t(n,i),e);if(a.status===204)throw Error(`Local API returned an empty response.`);return await Zp(a,r,e)},async response(n,r){return await $p(await t(n,r),e)},async postEventStream(n,r,i,a){await tm(await $p(await t(n,{method:`POST`,body:JSON.stringify(r),signal:i}),e),i,a)}}}var rm=Od({error:L().optional()}),im=Od({authenticated:vd().optional()}),am=Od({parentPath:L(),entries:Ed(Od({name:L(),fullPath:L()})),volumeList:vd().optional()}),om=Od({skills:Ed(Od({name:L(),description:L()})),warnings:Ed(L())}),sm=Od({entries:Ed(Od({path:L(),kind:zd([`file`,`directory`])})),scanning:vd()}),cm=Od({workspacePath:L(),displayName:L(),repositoryKey:L()}),lm=Od({workspacePath:L(),repositoryKey:L(),attachmentKey:L(),displayName:L(),availability:zd([`available`,`unavailable`]),lastValidatedAt:gd(),lastUsedAt:gd(),lastMessageSentAt:gd().optional(),unavailableReason:L().optional()}),um=Od({commands:Ed(Od({sessionId:L(),command:L(),workdir:L(),startedAt:md()}))}),dm=Od({runId:L(),threadId:L()}),fm=Od({storageId:L(),name:L(),mediaType:L(),size:gd(),url:Zu().optional()}),pm=jd([Od({storageId:L(),name:L(),mediaType:L(),size:md(),url:L()}),Od({error:L()})]);function mm(e){let t=`userId=${encodeURIComponent(e.userId)}&name=${encodeURIComponent(e.name)}`;return e.threadId&&(t+=`&threadId=${encodeURIComponent(e.threadId)}`),`/api/transcript/upload?${t}`}var hm=Od({id:L(),threadId:L(),runId:L(),sequence:gd().nonnegative(),kind:zd([`prompt`,`text`,`work`,`approval`]),text:L().optional(),attachments:Ed(fm).optional(),mandateId:L().optional(),approvalUrl:L().optional(),itemCount:gd().nonnegative(),pendingTools:gd().nonnegative(),provisional:vd().optional(),startedAt:md().optional(),completedAt:md().optional(),closed:vd(),revision:gd().nonnegative()}).transform(e=>({...e,threadId:Em(e.threadId),runId:Em(e.runId),attachments:e.attachments?.map(e=>({...e,storageId:Em(e.storageId)}))})),gm=Od({replicaId:L(),rows:Ed(hm),indexing:vd(),stale:vd(),nextBefore:gd().nonnegative().optional(),endSequence:gd().nonnegative(),revision:gd().nonnegative(),persistedStreams:Ed(Od({runId:L().transform(e=>Em(e)),streamId:L()})),changes:Ed(Od({id:L(),row:hm.nullable()})),changesCursor:Od({revision:gd().nonnegative(),sequence:gd().min(-1)}),moreChanges:vd()}),_m=Od({parts:Ed(Sd()),indexing:vd(),nextAfter:gd().nonnegative().optional(),previousBefore:gd().nonnegative().optional(),revision:gd().nonnegative(),stale:vd()}),vm=Od({eventType:L(),totalParts:gd().optional(),stale:vd()}),ym=Od({threadId:L(),runId:L(),runStatus:zd([`queued`,`running`,`completed`,`failed`,`cancelled`]),streamId:L().min(1),text:L(),parts:Ed(Sd()),runStartedAt:gd()}),bm=Nd(`eventType`,[Od({eventType:Vd(`updated`),live:ym}),Od({eventType:Vd(`cleared`)})]),xm=Od({artifacts:Ed(Od({_id:L(),userId:L(),repositoryKey:L(),localPath:L().optional(),content:L(),type:zd([`markdown`,`html`,`react`]),title:L(),revision:md(),createdAt:md(),updatedAt:md(),localError:L().optional()})),stale:vd(),error:L().optional()}),Sm=Od({accounts:Ed(Od({connectionId:L(),label:L(),connected:vd()})),activeConnectionId:L().nullable(),loginAvailable:vd(),error:L().optional()}),Cm=Od({state:L(),authorizeUrl:L()}),wm=Od({status:zd([`pending`,`complete`,`error`]),error:L().optional()}),Tm=Od({warning:L().nullable()});function Em(e){return e}function Dm(e){return e}function Om(e){return{threadId:Em(e.threadId),runId:Em(e.runId),runStatus:e.runStatus,streamId:e.streamId,text:e.text,parts:e.parts,runStartedAt:e.runStartedAt}}function km(e){return e.eventType===`updated`?{eventType:`updated`,live:Om(e.live)}:{eventType:`cleared`}}function Am(e){return{artifacts:e.artifacts,stale:e.stale,error:e.error}}function jm(){return globalThis.window?globalThis.window.location.origin:null}function Mm(e){if(!globalThis.window)return null;let t=globalThis.window.location.hash.startsWith(`#`)?globalThis.window.location.hash.slice(1):globalThis.window.location.hash;return new URLSearchParams(t).get(e)}function Nm(){return Mm(`workspace`)}function Pm(){if(!globalThis.window)return;let e=new URL(globalThis.window.location.href);e.hash=``,globalThis.window.history.replaceState(null,``,`${e.pathname}${e.search}`)}async function Fm(e){let t=await fetch(`${e}/api/auth/bootstrap`,{method:`POST`,credentials:`include`});if(!t.ok){let e=rm.safeParse(await t.json().catch(()=>null));throw Error(e.success?e.data.error??`Failed to authenticate with the Sprocket server.`:`Failed to authenticate with the Sprocket server.`)}}async function Im(e){let t=await fetch(`${e}/api/auth/session`,{credentials:`include`});if(!t.ok)return!1;let n=im.safeParse(await t.json());return n.success?!!n.data.authenticated:!1}var Lm=new Map;async function Rm(e){let t=Lm.get(e);if(t)return await t;let n=zm(e);Lm.set(e,n);try{await n}finally{Lm.delete(e)}}async function zm(e){await Im(e)||await Fm(e)}function Bm(e){let t=nm(e),{request:n}=t;return{browseFilesystem:e=>{let t=e.cwd?{partialPath:e.partialPath,cwd:e.cwd}:{partialPath:e.partialPath};return n(`/api/workspace/browse`,am,{method:`POST`,body:JSON.stringify(t)})},listWorkspaceSkills:e=>n(`/api/workspace/skills`,om,{method:`POST`,body:JSON.stringify({workspacePath:e.workspacePath})}),searchWorkspace:(e,t)=>n(`/api/workspace/search`,sm,{method:`POST`,body:JSON.stringify(e),signal:t}),resolveWorkspacePath:e=>{let t=e.createIfMissing?{workspacePath:e.workspacePath,createIfMissing:!0}:{workspacePath:e.workspacePath};return n(`/api/workspace/resolve`,cm,{method:`POST`,body:JSON.stringify(t)})},listProjectAttachments:async()=>(await n(`/api/workspace/projects`,Ed(lm))).map(Dm),attachProject:async e=>Dm(await n(`/api/workspace/projects`,lm,{method:`POST`,body:JSON.stringify(e)})),listRunningCommands:(e,t)=>n(`/api/agent/commands`,um,{method:`POST`,body:JSON.stringify(e),signal:t}),terminateCommand:e=>n(`/api/agent/commands/terminate`,Od({terminated:vd()}),{method:`POST`,body:JSON.stringify(e)}),runAgent:async e=>{let t=await n(`/api/agent/run`,dm,{method:`POST`,body:JSON.stringify(e)});return{runId:Em(t.runId),threadId:Em(t.threadId)}},fetchTranscriptDisplay:async(e,t)=>await n(`/api/transcript/display`,gm,{method:`POST`,body:JSON.stringify(e),signal:t}),fetchTranscriptDisplayDetails:async(e,t)=>{let r=await n(`/api/transcript/display-details`,_m,{method:`POST`,body:JSON.stringify(e),signal:t});return{...r,parts:r.parts}},watchTranscript:async(e,n)=>{await t.postEventStream(`/api/transcript/watch`,e,n.signal,e=>{let t=vm.safeParse(JSON.parse(e));t.success&&n.onEvent(t.data)})},watchLiveCompletion:async(e,n)=>{await t.postEventStream(`/api/agent/live`,e,n.signal,e=>{let t=bm.safeParse(JSON.parse(e));t.success&&n.onEvent(km(t.data))})},clearTranscriptReplica:async e=>{await t.response(`/api/transcript/clear`,{method:`POST`,body:JSON.stringify(e)})},fetchTranscriptAttachment:async t=>{let n=await fetch(`${e}/api/transcript/attachment`,{method:`POST`,credentials:`include`,headers:{"content-type":`application/json`},body:JSON.stringify(t)});return n.status===404||!n.ok?null:await n.blob()},uploadTranscriptAttachment:async e=>{let t=await n(mm({userId:e.userId,name:e.name,threadId:e.threadId}),pm,{method:`POST`,headers:{"content-type":e.file.type.trim()||`application/octet-stream`},body:e.file});return`error`in t?t:{storageId:Em(t.storageId),name:t.name,mediaType:t.mediaType,size:t.size,url:t.url}},discardTranscriptAttachment:async e=>await n(`/api/transcript/discard`,vd(),{method:`POST`,body:JSON.stringify({userId:e.userId,storageId:e.storageId,threadId:e.threadId})}),deleteArtifact:async e=>{await n(`/api/artifacts/delete`,bd(),{method:`POST`,body:JSON.stringify(e)})},watchArtifacts:async(e,n)=>{await t.postEventStream(`/api/artifacts/watch`,e,n.signal,e=>{let t=xm.parse(JSON.parse(e));n.onEvent(Am(t))})},requestRunCancellation:async e=>{await n(`/api/threads/cancel`,vd(),{method:`POST`,body:JSON.stringify(e)})},startAccountSession:async e=>{await n(`/api/threads/account-session/start`,bd(),{method:`POST`,body:JSON.stringify(e)})},endAccountSession:async e=>{await n(`/api/threads/account-session/end`,bd(),{method:`POST`,body:JSON.stringify(e)})},fetchChatGptStatus:async e=>await n(`/api/chatgpt/status`,Sm,{method:`POST`,body:JSON.stringify(e)}),startChatGptBrowserLogin:async e=>await n(`/api/chatgpt/browser/start`,Cm,{method:`POST`,body:JSON.stringify(e)}),fetchChatGptBrowserLoginResult:async e=>await n(`/api/chatgpt/browser/result`,wm,{method:`POST`,body:JSON.stringify(e)}),cancelChatGptBrowserLogin:async e=>{await n(`/api/chatgpt/browser/cancel`,bd(),{method:`POST`,body:JSON.stringify(e)})},selectChatGptAccount:async e=>{await n(`/api/chatgpt/select`,bd(),{method:`POST`,body:JSON.stringify(e)})},disconnectChatGptAccount:async e=>{let{warning:t}=await n(`/api/chatgpt/disconnect`,Tm,{method:`POST`,body:JSON.stringify(e)});return t}}}async function Vm(){let e=jm();if(!e)throw Error(`Unable to resolve the Sprocket server URL.`);return await Rm(e),Bm(e)}function Hm(e){let t=e,n=new Set,r=e=>{if(!Object.is(t,e)){t=e;for(let e of n)e()}};return{getSnapshot:()=>t,subscribe(e){return n.add(e),()=>{n.delete(e)}},set:r,update:e=>r(e(t))}}function Um(e,t){let n=e.getSnapshot(),r=t(n);return{subscribe:e.subscribe,getSnapshot(){let i=e.getSnapshot();return Object.is(n,i)||(n=i,r=t(i)),r}}}function Wm(e){return(0,F.useSyncExternalStore)(e.subscribe,e.getSnapshot)}var Gm=Hm({isLoading:!0,isReady:!1,isConfigured:!0,isWaitingForBrowserSignIn:!1,browserSignInUrl:null,user:null,nativeSession:`notRequired`,error:null}),Km=Um(Gm,e=>e.user?.id??null),qm=Um(Gm,e=>!e.isReady||e.isLoading),Jm=Hm(0),Ym=Hm(!1),Xm=1500,Zm=3e5,Qm=`Native sign-in is temporarily unavailable. Try again.`,$m=null,eh=`This device is signed in with a different account. Sign out, then sign in with the same account.`,th={createAuthKitClient:Gp,resolveLocalApiBaseUrl:jm,ensureLocalSession:Rm},nh=!1;function rh(){return globalThis.window??null}var ih=null,ah=null,oh=null,sh=!1,ch=null,lh=Promise.resolve(),uh=0,dh=null,fh=null,ph=Od({error:L().optional()}),mh=Od({authorizationUrl:Zu(),loginId:L()}),hh=Od({id:L(),email:qu(),firstName:L().nullable().optional(),lastName:L().nullable().optional(),profilePictureUrl:L().nullable().optional()}),gh=Od({accessToken:L(),user:hh}).nullable(),_h=Nd(`status`,[Od({status:Vd(`signedOut`)}),Od({status:Vd(`pending`)}),Od({status:Vd(`authenticated`),user:Od({id:L(),email:qu()})}),Od({status:Vd(`unavailable`),error:L()}),Od({status:Vd(`failed`),error:L()})]);function vh(e){return{id:e.id,email:e.email,firstName:e.firstName??null,lastName:e.lastName??null,profilePictureUrl:e.profilePictureUrl??null}}function yh(e={}){return{isLoading:!1,isReady:!0,isConfigured:!0,isWaitingForBrowserSignIn:!1,browserSignInUrl:null,user:null,nativeSession:`notRequired`,error:null,...e}}function bh(e){return e===408||e===429||e===500||e===502||e===503||e===504}function xh(){return!!(nh||Dh()||Oh())}function Sh(){return nh&&!Dh()&&!Oh()}function Ch(){ag(),uh+=1,fh=null}function wh(){if(oh)return oh;throw Error(`Auth bootstrap is not initialized.`)}async function Th(){if(ah)return await ah;ah=wh().query(Jp.authBootstrap.getClientConfig,{});try{return await ah}catch(e){throw ah=null,e}}async function Eh(){return(await Th()).workosClientId?.trim()||void 0}function Dh(){let e=rh();if(!e)return null;let t=e.sprocketDesktopBridge;return!t?.openExternal||!t.focusWindow?null:t}function Oh(){let e=rh();return e?pr(e.location.hostname,!1):!1}async function kh(){let e=th.resolveLocalApiBaseUrl();if(!e)throw Error(`Unable to resolve the Sprocket server URL.`);await th.ensureLocalSession(e)}async function Ah(){return rh()?(ih||=(async()=>{let e=await Eh();if(!e)return Gm.set(yh({isConfigured:!1})),null;let t=null;try{t=await th.createAuthKitClient(e,{redirectUri:`${rh()?.location.origin}/callback`,onRedirectCallback:()=>{window.location.replace(`/`)},onRefresh:()=>{let e=t?.getUser()??null;Gm.update(t=>({...t,user:e?vh(e):null,error:null}))},onRefreshFailure:()=>{let e=t?.getUser()??null;Gm.update(t=>({...t,user:e?vh(e):null,error:t.user&&!e&&!sh?`Session refresh failed. Sign in again.`:t.error}))}});let n=t.getUser();return Gm.set({isLoading:!1,isReady:!0,isConfigured:!0,isWaitingForBrowserSignIn:!1,browserSignInUrl:null,user:n?vh(n):null,nativeSession:Gm.getSnapshot().nativeSession,error:null}),t}catch(e){throw ih=null,e}})(),await ih):null}async function jh(e,t={}){nh=t.machine===!0,oh=e;let n=uh,r=Gm.getSnapshot();Gm.set({...r,isLoading:!0,nativeSession:xh()&&!r.user?`loading`:r.nativeSession});try{if(xh()){if(Sh()&&rh()?.location.protocol!==`https:`)throw Error(`Remote Sprocket access requires HTTPS.`);if(await kh(),n!==uh)return;await Ph(n),Mh();return}await Nh()}catch(e){if(n!==uh)return;Gm.update(t=>({...t,isLoading:!1,isReady:!0,isWaitingForBrowserSignIn:!1,browserSignInUrl:null,nativeSession:t.nativeSession===`loading`?`unavailable`:t.nativeSession,error:e instanceof Error?e.message:`Failed to initialize authentication.`}))}}function Mh(){if(dh||!globalThis.EventSource)return;let e=new EventSource(`/api/auth/changes`);dh=e,e.onmessage=()=>{dh!==e||sh||(Ch(),Ph(uh))}}async function Nh(){let e=(await Ah())?.getUser()??null;Gm.update(t=>t.isConfigured?{isLoading:!1,isReady:!0,isConfigured:!0,isWaitingForBrowserSignIn:!1,browserSignInUrl:null,user:e?vh(e):null,nativeSession:`notRequired`,error:null}:{...t,isLoading:!1,isReady:!0})}async function Ph(e){let t=await zh(!1,e);e===uh&&Fh(t)}function Fh(e){switch(e.kind){case`session`:Gm.set({isLoading:!1,isReady:!0,isConfigured:!0,isWaitingForBrowserSignIn:!1,browserSignInUrl:null,user:e.user,nativeSession:`ready`,error:null});return;case`signedOut`:Gm.set(yh());return;case`transient`:Gm.update(t=>({...t,isLoading:!1,isReady:!0,nativeSession:t.nativeSession===`loading`?`unavailable`:t.nativeSession,error:t.nativeSession===`loading`?e.error:t.error}));return;case`unauthorized`:Gm.update(t=>({...t,isLoading:!1,isReady:!0,nativeSession:`unavailable`,error:e.error}));return;case`mismatch`:Gm.update(t=>({...t,isLoading:!1,isReady:!0,nativeSession:`mismatch`,error:e.error}));return;case`stale`:return;case`error`:Gm.update(t=>({...t,isLoading:!1,isReady:!0,nativeSession:t.nativeSession===`loading`?`unavailable`:t.nativeSession,error:e.error}))}}async function Ih(){let e=await fetch(`/api/auth/native-session`,{method:`DELETE`,credentials:`include`});if(!e.ok)throw Error(await Vh(e,`Failed to clear native session.`))}async function Lh(){let e=await fetch(`/api/auth/session`,{method:`DELETE`,credentials:`include`});if(!e.ok)throw Error(await Vh(e,`Failed to clear browser session.`))}async function Rh(){if(!xh())return;let e=uh,t=await zh(!1,e);e===uh&&Fh(t)}async function zh(e,t){if(t!==uh)return{kind:`stale`};let n=fh;if(n&&n.generation===t){let r=await n.promise;if(t!==uh)return{kind:`stale`};if(!e||n.forceRefreshToken)return r}let r=Bh(e);fh={generation:t,forceRefreshToken:e,promise:r};try{let e=await r;return t===uh?e:{kind:`stale`}}finally{fh?.promise===r&&(fh=null)}}async function Bh(e){let t;try{t=await fetch(`/api/auth/native-session/token`,{method:`POST`,credentials:`include`,signal:AbortSignal.timeout(3e4),headers:{"content-type":`application/json`},body:JSON.stringify({forceRefreshToken:e})})}catch(e){return{kind:`transient`,error:e instanceof Error?e.message:Qm}}if(t.status===401)return{kind:`unauthorized`,error:await Vh(t,`Your local Sprocket session is unavailable. Reload the app to reconnect.`)};if(t.status===409)return{kind:`mismatch`,error:await Vh(t,eh)};if(bh(t.status))return{kind:`transient`,error:await Vh(t,Qm)};if(!t.ok)return{kind:`error`,error:await Vh(t,`Failed to read the native session.`)};let n=gh.safeParse(await t.json().catch(()=>void 0));return n.success?n.data===null?{kind:`signedOut`}:{kind:`session`,accessToken:n.data.accessToken,user:vh(n.data.user)}:{kind:`error`,error:`Local server returned an invalid native session.`}}async function Vh(e,t){let n=ph.safeParse(await e.json().catch(()=>null));return n.success?n.data.error??t:t}async function Hh(e){let t=await fetch(`/api/auth/desktop-login/start`,{method:`POST`,credentials:`include`,headers:{"content-type":`application/json`},body:JSON.stringify({flow:e})});if(!t.ok)throw Error(await Vh(t,`Failed to start desktop sign-in.`));let n=mh.safeParse(await t.json());if(!n.success)throw Error(`Local server returned an invalid desktop sign-in URL.`);return n.data}function Uh(e){return ch===e&&!e.abort.signal.aborted}function Wh(e){if(!Uh(e))throw new DOMException(`Aborted`,`AbortError`)}async function Gh(e,t){let n=lh,r;lh=new Promise(e=>{r=e}),await n;try{Wh(e);let{authorizationUrl:n,loginId:r}=await Hh(t);return e.loginId=r,Wh(e),n}finally{r()}}async function Kh(e){let t;try{t=await fetch(`/api/auth/desktop-login/result`,{method:`POST`,credentials:`include`,signal:AbortSignal.any([e,AbortSignal.timeout(15e3)])})}catch(t){if(e.aborted)throw t;return null}if(bh(t.status))return null;if(!t.ok)throw Error(await Vh(t,`Failed to check desktop sign-in status.`));return _h.parse(await t.json())}async function qh(e){let t=Date.now();for(;!e.aborted;){if(Date.now()-t>Zm)throw Error(`Sign-in timed out. Try again.`);let n=await Kh(e);if(n?.status===`failed`)throw Error(n.error||`Desktop sign-in failed.`);if(n?.status===`authenticated`)return n.user;await new Promise((t,n)=>{let r=setTimeout(()=>{e.removeEventListener(`abort`,i),t()},Xm);function i(){clearTimeout(r),n(new DOMException(`Aborted`,`AbortError`))}e.addEventListener(`abort`,i,{once:!0})})}throw new DOMException(`Aborted`,`AbortError`)}async function Jh(e){let t=Dh();if(!xh())throw Error(`Machine browser sign-in is unavailable.`);Zh();let n={abort:new AbortController,loginId:null};ch=n,Gm.update(e=>({...e,isWaitingForBrowserSignIn:!0,browserSignInUrl:null,error:null}));try{await kh(),Wh(n);let r=await Gh(n,e);if(Wh(n),Gm.update(e=>({...e,browserSignInUrl:r})),Wh(n),t)t.openExternal(r).catch(e=>{if(!Uh(n))return;let t=e instanceof Error?e.message.trim():``;Gm.update(e=>({...e,error:t||`Automatic browser open failed.`}))});else{let e=window.open(r,`_blank`);if(e)try{e.opener=null}catch{}else Gm.update(e=>({...e,error:`Your browser blocked the sign-in window.`}))}let i=await qh(n.abort.signal);if(Wh(n),t)try{await t.focusWindow()}catch(e){Uh(n)&&console.warn(`Failed to focus desktop window after sign-in`,e)}Wh(n),await Yh(n,i)}catch(e){if(ch!==n)return;if(e instanceof DOMException&&e.name===`AbortError`){Gm.update(e=>({...e,isWaitingForBrowserSignIn:!1,browserSignInUrl:null,error:null}));return}Gm.update(t=>({...t,isWaitingForBrowserSignIn:!1,browserSignInUrl:null,error:e instanceof Error?e.message:`Failed to sign in with the browser.`}))}finally{ch===n&&(ch=null)}}async function Yh(e,t){Ch();let n=await zh(!1,uh);Wh(e),n.kind!==`stale`&&Xh(n,vh(t))}function Xh(e,t){switch(e.kind){case`session`:Gm.set({isLoading:!1,isReady:!0,isConfigured:!0,isWaitingForBrowserSignIn:!1,browserSignInUrl:null,user:e.user,nativeSession:`ready`,error:null});return;case`transient`:Gm.set({isLoading:!1,isReady:!0,isConfigured:!0,isWaitingForBrowserSignIn:!1,browserSignInUrl:null,user:t,nativeSession:`ready`,error:null});return;case`signedOut`:Gm.set(yh({error:`Native sign-in finished without a session. Try again.`}));return;case`unauthorized`:Gm.update(t=>({...t,isWaitingForBrowserSignIn:!1,browserSignInUrl:null,nativeSession:`unavailable`,error:e.error}));return;case`mismatch`:Gm.update(t=>({...t,isWaitingForBrowserSignIn:!1,browserSignInUrl:null,nativeSession:`mismatch`,error:e.error}));return;case`error`:Gm.update(t=>({...t,isWaitingForBrowserSignIn:!1,browserSignInUrl:null,nativeSession:`unavailable`,error:e.error}));return;case`stale`:return}}function Zh(){ch?.abort.abort(),ch=null}function Qh(){let e=ch,t=lh;Zh(),Gm.update(e=>({...e,isWaitingForBrowserSignIn:!1,browserSignInUrl:null,error:null})),e&&t.then(async()=>{e.loginId&&await fetch(`/api/auth/desktop-login/cancel`,{method:`POST`,credentials:`include`,headers:{"content-type":`application/json`},body:JSON.stringify({loginId:e.loginId})})}).catch(()=>{})}function $h(){Gm.update(e=>!e.isWaitingForBrowserSignIn||e.error===null?e:{...e,error:null})}async function eg(e){if(xh()){await Jh(e);return}let t=await Ah();if(t&&await Eh()){if(e===`signUp`){await t.signUp();return}await t.signIn()}}async function tg(){await eg(`signIn`)}async function ng(){await eg(`signUp`)}async function rg(){Qh(),sh=!0,Ch(),Gm.update(e=>({...e,isLoading:!0}));let e=[],t=!1,n=null;try{if(xh())try{Sh()?await Lh():await Ih()}catch(t){e.push(t instanceof Error?t.message:`Failed to clear native session.`)}else{let r=await Ah();if(!r){Gm.set(yh());return}try{await r.signOut({navigate:!1,returnTo:window.location.origin})}catch(i){t=!0;let a=r.getUser();n=a?vh(a):null,e.push(i instanceof Error?i.message:`Failed to clear browser session.`)}}Ym.set(!1),Gm.set(yh({user:t?n:null,nativeSession:e.length===0?`notRequired`:`unavailable`,error:e.length===0?null:e.join(` `)}))}catch(e){Gm.update(t=>({...t,isLoading:!1,error:e instanceof Error?e.message:`Failed to sign out.`}))}finally{sh=!1}}async function ig({forceRefreshToken:e=!1}={}){if(xh()){let t=uh,n=await zh(e,t);return t!==uh||n.kind===`stale`?null:sg(n,t)}return await cg({forceRefreshToken:e})}function ag(){$m!==null&&(clearTimeout($m),$m=null)}async function og(e){let t=uh;try{if(xh()&&Gm.getSnapshot().nativeSession===`unavailable`&&(await kh(),t!==uh))return null;let n=await ig(e);return t===uh?(ag(),n):null}catch(e){if(t!==uh)return null;Gm.update(t=>({...t,error:e instanceof Error?e.message:`Session refresh is temporarily unavailable.`}));let n=Gm.getSnapshot();return n.user&&n.nativeSession!==`mismatch`&&$m===null&&($m=setTimeout(()=>{$m=null,t===uh&&Gm.getSnapshot().user&&Jm.update(e=>e+1)},5e3)),null}}function sg(e,t){if(t!==uh)return null;switch(e.kind){case`session`:return Gm.update(t=>({...t,user:e.user,nativeSession:`ready`,error:null})),e.accessToken;case`signedOut`:return Gm.update(e=>({...e,user:null,nativeSession:`notRequired`,error:null})),null;case`transient`:throw Error(e.error);case`unauthorized`:throw Gm.update(t=>({...t,nativeSession:`unavailable`,error:e.error})),Error(e.error);case`mismatch`:throw Gm.update(t=>({...t,nativeSession:`mismatch`,error:e.error})),Error(e.error);case`error`:throw Error(e.error);case`stale`:return null}}async function cg({forceRefreshToken:e}){let t=await Ah();if(!t)return null;try{return await t.getAccessToken({forceRefresh:e})}catch(e){if(e instanceof Error&&e.name===`LoginRequiredError`)return Gm.update(e=>({...e,user:null})),null;throw e}}function lg(e){return e.retryPending?e.isAuthenticated?{clearPending:!0,sawLoadingDuringRetry:e.sawLoadingDuringRetry}:e.isLoading?{clearPending:!1,sawLoadingDuringRetry:!0}:e.sawLoadingDuringRetry?{clearPending:!0,sawLoadingDuringRetry:!0}:{clearPending:!1,sawLoadingDuringRetry:!1}:{clearPending:!1,sawLoadingDuringRetry:!1}}async function ug(){let e=uh;Gm.update(e=>({...e,isLoading:!0,error:null})),Ym.set(!0);try{if(xh()&&(await kh(),e!==uh))return;let t=await ig({forceRefreshToken:!0});if(e!==uh)return;if(!t)throw Error(`Your session has expired. Sign in again.`);Jm.update(e=>e+1),Gm.update(e=>({...e,isLoading:!1,error:null}))}catch(t){if(e!==uh)return;Ym.set(!1),Gm.update(e=>({...e,isLoading:!1,error:t instanceof Error?t.message:`Failed to refresh authentication.`}))}}var dg=o((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.fragment`);function r(e,n,r){var i=null;if(r!==void 0&&(i=``+r),n.key!==void 0&&(i=``+n.key),`key`in n)for(var a in r={},n)a!==`key`&&(r[a]=n[a]);else r=n;return n=r.ref,{$$typeof:t,type:e,key:i,ref:n===void 0?null:n,props:r}}e.Fragment=n,e.jsx=r,e.jsxs=r})),R=o(((e,t)=>{t.exports=dg()}))();function fg(){let e=Wm(qm),t=Wm(Km),n=Wm(Jm),r=(0,F.useCallback)(e=>og(e),[n,t]);return{isLoading:e,isAuthenticated:!!t,fetchAccessToken:r}}function pg({client:e,machine:t,children:n}){return(0,F.useEffect)(()=>{jh(e,{machine:t})},[e,t]),(0,R.jsx)(lr,{client:e,useAuth:fg,children:n})}var mg=e=>e?.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase();function hg(e,t,n=[]){if(t==null)throw Error(`[lucide]: iconNode is required when icon name is used`);return{name:mg(e),size:24,node:t,...n.length>0?{aliases:n}:{}}}var gg=e=>{let t=``,n=!1;for(let r of e){if(r===`-`||r===`_`||r<=` `){n=t.length>0;continue}t.length===0?t+=r.toLowerCase():t+=n?r.toUpperCase():r,n=!1}return t},_g=e=>{let t=gg(e);return t.charAt(0).toUpperCase()+t.slice(1)},vg=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),yg={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":2,"stroke-linecap":`round`,"stroke-linejoin":`round`};function bg(e){return e!=null}function xg(e,t={}){let n=t.attributeNames??{},r=e=>n[e]??e,i=e.size??e.width??yg.width,a=e.size??e.height??yg.height,o=e.aliases?.filter(e=>typeof e==`string`&&e.trim()!==``).map(e=>`lucide-${e}`)??[],s=[...e.name?[`lucide-${e.name}`]:[],...o],c=t.className?.split(` `).filter(Boolean)??[],l=t.includeDefaultClasses===!1?vg(...c):vg(`lucide`,...s,...c),u=t.absoluteStrokeWidth?Number(t.strokeWidth??yg[`stroke-width`])*Number(e.size??e.width??yg.width)/Number(t.size??t.width??yg.width):t.strokeWidth??yg[`stroke-width`];return[`svg`,{...Object.entries(yg).reduce((e,[t,n])=>(e[r(t)]=n,e),{}),...`color`in t&&t.color&&{[r(`stroke`)]:t.color},...`size`in t&&bg(t.size)&&{[r(`width`)]:t.size,[r(`height`)]:t.size},...`width`in t&&bg(t.width)&&{[r(`width`)]:t.width},...`height`in t&&bg(t.height)&&{[r(`height`)]:t.height},[r(`stroke-width`)]:u,...l&&{[r(`class`)]:l},[r(`viewBox`)]:`0 0 ${i} ${a}`,...t.hasA11yProp===!1?{[r(`aria-hidden`)]:`true`}:{},...`attributes`in t&&t.attributes},e.node.map(e=>{let[n,i,a]=e,o=t.nonScalingStroke?{[r(`vector-effect`)]:`non-scaling-stroke`,...i}:i;return a?[n,o,a]:[n,o]})]}function Sg(e,t={}){return xg(e,{...t,attributeNames:{...t.attributeNames,class:`className`,"stroke-width":`strokeWidth`,"stroke-linecap":`strokeLinecap`,"stroke-linejoin":`strokeLinejoin`,"vector-effect":`vectorEffect`}})}var Cg=e=>{for(let t in e)if(t.startsWith(`aria-`)||t===`role`||t===`title`)return!0;return!1},wg=(0,F.createContext)({}),Tg=()=>(0,F.useContext)(wg),Eg=(0,F.forwardRef)(({color:e,size:t,width:n,height:r,strokeWidth:i,absoluteStrokeWidth:a,nonScalingStroke:o,className:s=``,children:c,iconNode:l=[],icon:u={node:l,aliases:[],size:24},...d},f)=>{let{size:p=24,strokeWidth:m=2,absoluteStrokeWidth:h=!1,nonScalingStroke:g=!1,color:_=`currentColor`,className:v=``}=Tg()??{},y=!!c||Cg(d),[b,x,S=[]]=Sg(u,{color:e??_,width:n??t??p,height:r??t??p,strokeWidth:i??m,absoluteStrokeWidth:a??h,nonScalingStroke:o??g,className:vg(v,s),hasA11yProp:y,attributes:d});return(0,F.createElement)(b,{ref:f,...x},[...S.map(([e,t])=>(0,F.createElement)(e,t)),...Array.isArray(c)?c:[c]])});function Dg(e,t=[],n=[]){let r=typeof e==`string`?hg(e,t,n):e,i=(0,F.forwardRef)(({className:e,...t},n)=>(0,F.createElement)(Eg,{ref:n,icon:r,className:e,...t}));return r.name&&(i.displayName=_g(r.name)),i}var Og={name:`arrow-left`,size:24,node:[[`path`,{d:`m12 19-7-7 7-7`,key:`1l729n`}],[`path`,{d:`M19 12H5`,key:`x3x0zl`}]]};Og.node;var kg=Dg(Og),Ag={name:`arrow-up`,size:24,node:[[`path`,{d:`m5 12 7-7 7 7`,key:`hav0vg`}],[`path`,{d:`M12 19V5`,key:`x0mq9r`}]]};Ag.node;var jg=Dg(Ag),Mg={name:`book-open`,size:24,node:[[`path`,{d:`M12 5v16`,key:`1f6ucr`}],[`path`,{d:`M20.001 19A2 2 0 0022 17V5a2 2 0 00-1.999-2L16 3.002A5 5 0 0012 5a5 5 0 00-4-2H4a2 2 0 00-2 2v12a2 2 0 001.999 2H8a5 5 0 014 2 5 5 0 014-2z`,key:`1fyvmf`}]]};Mg.node;var Ng=Dg(Mg),Pg={name:`bot`,size:24,node:[[`path`,{d:`M12 8V4H8`,key:`hb8ula`}],[`rect`,{width:`16`,height:`12`,x:`4`,y:`8`,rx:`2`,key:`enze0r`}],[`path`,{d:`M2 14h2`,key:`vft8re`}],[`path`,{d:`M20 14h2`,key:`4cs60a`}],[`path`,{d:`M15 13v2`,key:`1xurst`}],[`path`,{d:`M9 13v2`,key:`rq6x2g`}]]};Pg.node;var Fg=Dg(Pg),Ig={name:`brain`,size:24,node:[[`path`,{d:`M12 18V5`,key:`adv99a`}],[`path`,{d:`M15 13a4.17 4.17 0 0 1-3-4 4.17 4.17 0 0 1-3 4`,key:`1e3is1`}],[`path`,{d:`M17.598 6.5A3 3 0 1 0 12 5a3 3 0 1 0-5.598 1.5`,key:`1gqd8o`}],[`path`,{d:`M17.997 5.125a4 4 0 0 1 2.526 5.77`,key:`iwvgf7`}],[`path`,{d:`M18 18a4 4 0 0 0 2-7.464`,key:`efp6ie`}],[`path`,{d:`M19.967 17.483A4 4 0 1 1 12 18a4 4 0 1 1-7.967-.517`,key:`1gq6am`}],[`path`,{d:`M6 18a4 4 0 0 1-2-7.464`,key:`k1g0md`}],[`path`,{d:`M6.003 5.125a4 4 0 0 0-2.526 5.77`,key:`q97ue3`}]]};Ig.node;var Lg=Dg(Ig),Rg={name:`camera`,size:24,node:[[`path`,{d:`M13.997 4a2 2 0 0 1 1.76 1.05l.486.9A2 2 0 0 0 18.003 7H20a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V9a2 2 0 0 1 2-2h1.997a2 2 0 0 0 1.759-1.048l.489-.904A2 2 0 0 1 10.004 4z`,key:`18u6gg`}],[`circle`,{cx:`12`,cy:`13`,r:`3`,key:`1vg3eu`}]]};Rg.node;var zg=Dg(Rg),Bg={name:`chart-no-axes-column`,size:24,node:[[`path`,{d:`M5 21v-6`,key:`1hz6c0`}],[`path`,{d:`M12 21V3`,key:`1lcnhd`}],[`path`,{d:`M19 21V9`,key:`unv183`}]],aliases:[`bar-chart-2`]};Bg.node;var Vg=Dg(Bg),Hg={name:`check`,size:24,node:[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]};Hg.node;var Ug=Dg(Hg),Wg={name:`chevron-down`,size:24,node:[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]};Wg.node;var Gg=Dg(Wg),Kg={name:`chevron-right`,size:24,node:[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]};Kg.node;var qg=Dg(Kg),Jg={name:`circle-alert`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`line`,{x1:`12`,x2:`12`,y1:`8`,y2:`12`,key:`1pkeuh`}],[`line`,{x1:`12`,x2:`12.01`,y1:`16`,y2:`16`,key:`4dfq90`}]],aliases:[`alert-circle`]};Jg.node;var Yg=Dg(Jg),Xg={name:`circle-dollar-sign`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M16 8h-6a2 2 0 1 0 0 4h4a2 2 0 1 1 0 4H8`,key:`1h4pet`}],[`path`,{d:`M12 18V6`,key:`zqpxq5`}]]};Xg.node;var Zg=Dg(Xg),Qg={name:`circle-question-mark`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3`,key:`1u773s`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]],aliases:[`help-circle`,`circle-help`]};Qg.node;var $g=Dg(Qg),e_={name:`code-xml`,size:24,node:[[`path`,{d:`m18 16 4-4-4-4`,key:`1inbqp`}],[`path`,{d:`m6 8-4 4 4 4`,key:`15zrgr`}],[`path`,{d:`m14.5 4-5 16`,key:`e7oirm`}]],aliases:[`code-2`]};e_.node;var t_=Dg(e_),n_={name:`copy`,size:24,node:[[`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`}]]};n_.node;var r_=Dg(n_),i_={name:`credit-card`,size:24,node:[[`rect`,{width:`20`,height:`14`,x:`2`,y:`5`,rx:`2`,key:`ynyp8z`}],[`line`,{x1:`2`,x2:`22`,y1:`10`,y2:`10`,key:`1b3vmo`}],[`path`,{d:`M6 14h2`,key:`mk7k0u`}]]};i_.node;var a_=Dg(i_),o_={name:`download`,size:24,node:[[`path`,{d:`M12 15V3`,key:`m9g1x1`}],[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}],[`path`,{d:`m7 10 5 5 5-5`,key:`brsn70`}]]};o_.node;var s_=Dg(o_),c_={name:`ellipsis`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`1`,key:`41hilf`}],[`circle`,{cx:`19`,cy:`12`,r:`1`,key:`1wjl8i`}],[`circle`,{cx:`5`,cy:`12`,r:`1`,key:`1pcz8c`}]],aliases:[`more-horizontal`]};c_.node;var l_=Dg(c_),u_={name:`expand`,size:24,node:[[`path`,{d:`m15 15 6 6`,key:`1s409w`}],[`path`,{d:`m15 9 6-6`,key:`ko1vev`}],[`path`,{d:`M21 16v5h-5`,key:`1ck2sf`}],[`path`,{d:`M21 8V3h-5`,key:`1qoq8a`}],[`path`,{d:`M3 16v5h5`,key:`1t08am`}],[`path`,{d:`m3 21 6-6`,key:`wwnumi`}],[`path`,{d:`M3 8V3h5`,key:`1ln10m`}],[`path`,{d:`M9 9 3 3`,key:`v551iv`}]]};u_.node;var d_=Dg(u_),f_={name:`external-link`,size:24,node:[[`path`,{d:`M15 3h6v6`,key:`1q9fwt`}],[`path`,{d:`M10 14 21 3`,key:`gplh6r`}],[`path`,{d:`M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6`,key:`a6xqqp`}]]};f_.node;var p_=Dg(f_),m_={name:`eye-off`,size:24,node:[[`path`,{d:`M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49`,key:`ct8e1f`}],[`path`,{d:`M14.084 14.158a3 3 0 0 1-4.242-4.242`,key:`151rxh`}],[`path`,{d:`M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143`,key:`13bj9a`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}]]};m_.node;var h_=Dg(m_),g_={name:`eye`,size:24,node:[[`path`,{d:`M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0`,key:`1nclc0`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]};g_.node;var __=Dg(g_),v_={name:`file-code`,size:24,node:[[`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 12.5 8 15l2 2.5`,key:`1tg20x`}],[`path`,{d:`m14 12.5 2 2.5-2 2.5`,key:`yinavb`}]]};v_.node;var y_=Dg(v_),b_={name:`file-diff`,size:24,node:[[`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:`M9 10h6`,key:`9gxzsh`}],[`path`,{d:`M12 13V7`,key:`h0r20n`}],[`path`,{d:`M9 17h6`,key:`r8uit2`}]]};b_.node;var x_=Dg(b_),S_={name:`file-text`,size:24,node:[[`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`}]]};S_.node;var C_=Dg(S_),w_={name:`file`,size:24,node:[[`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`}]]};w_.node;var T_=Dg(w_),E_={name:`folder-plus`,size:24,node:[[`path`,{d:`M12 10v6`,key:`1bos4e`}],[`path`,{d:`M9 13h6`,key:`1uhe8q`}],[`path`,{d:`M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z`,key:`1kt360`}]]};E_.node;var D_=Dg(E_),O_={name:`folder`,size:24,node:[[`path`,{d:`M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z`,key:`1kt360`}]]};O_.node;var k_=Dg(O_),A_={name:`fullscreen`,size:24,node:[[`path`,{d:`M3 7V5a2 2 0 0 1 2-2h2`,key:`aa7l1z`}],[`path`,{d:`M17 3h2a2 2 0 0 1 2 2v2`,key:`4qcy5o`}],[`path`,{d:`M21 17v2a2 2 0 0 1-2 2h-2`,key:`6vwrx8`}],[`path`,{d:`M7 21H5a2 2 0 0 1-2-2v-2`,key:`ioqczr`}],[`rect`,{width:`10`,height:`8`,x:`7`,y:`8`,rx:`1`,key:`vys8me`}]]};A_.node;var j_=Dg(A_),M_={name:`globe`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20`,key:`13o1zl`}],[`path`,{d:`M2 12h20`,key:`9i4pu4`}]]};M_.node;var N_=Dg(M_),P_={name:`hourglass`,size:24,node:[[`path`,{d:`M5 22h14`,key:`ehvnwv`}],[`path`,{d:`M5 2h14`,key:`pdyrp9`}],[`path`,{d:`M17 22v-4.172a2 2 0 0 0-.586-1.414L12 12l-4.414 4.414A2 2 0 0 0 7 17.828V22`,key:`1d314k`}],[`path`,{d:`M7 2v4.172a2 2 0 0 0 .586 1.414L12 12l4.414-4.414A2 2 0 0 0 17 6.172V2`,key:`1vvvr6`}]]};P_.node;var F_=Dg(P_),I_={name:`key-round`,size:24,node:[[`path`,{d:`M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z`,key:`1s6t7t`}],[`circle`,{cx:`16.5`,cy:`7.5`,r:`.5`,fill:`currentColor`,key:`w0ekpg`}]]};I_.node;var L_=Dg(I_),R_={name:`list-checks`,size:24,node:[[`path`,{d:`M13 5h8`,key:`a7qcls`}],[`path`,{d:`M13 12h8`,key:`h98zly`}],[`path`,{d:`M13 19h8`,key:`c3s6r1`}],[`path`,{d:`m3 17 2 2 4-4`,key:`1jhpwq`}],[`path`,{d:`m3 7 2 2 4-4`,key:`1obspn`}]]};R_.node;var z_=Dg(R_),B_={name:`loader-circle`,size:24,node:[[`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`,key:`13zald`}]],aliases:[`loader-2`]};B_.node;var V_=Dg(B_),H_={name:`log-out`,size:24,node:[[`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`}]]};H_.node;var U_=Dg(H_),W_={name:`moon`,size:24,node:[[`path`,{d:`M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401`,key:`kfwtm`}]]};W_.node;var G_=Dg(W_),K_={name:`notebook-pen`,size:24,node:[[`path`,{d:`M13.4 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-7.4`,key:`re6nr2`}],[`path`,{d:`M2 6h4`,key:`aawbzj`}],[`path`,{d:`M2 10h4`,key:`l0bgd4`}],[`path`,{d:`M2 14h4`,key:`1gsvsf`}],[`path`,{d:`M2 18h4`,key:`1bu2t1`}],[`path`,{d:`M21.378 5.626a1 1 0 1 0-3.004-3.004l-5.01 5.012a2 2 0 0 0-.506.854l-.837 2.87a.5.5 0 0 0 .62.62l2.87-.837a2 2 0 0 0 .854-.506z`,key:`pqwjuv`}]]};K_.node;var q_=Dg(K_),J_={name:`panel-left`,size:24,node:[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M9 3v18`,key:`fh3hqa`}]],aliases:[`sidebar`]};J_.node;var Y_=Dg(J_),X_={name:`panel-right`,size:24,node:[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M15 3v18`,key:`14nvp0`}]]};X_.node;var Z_=Dg(X_),Q_={name:`paperclip`,size:24,node:[[`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`}]]};Q_.node;var $_=Dg(Q_),ev={name:`refresh-cw`,size:24,node:[[`path`,{d:`M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8`,key:`v9h5vc`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}],[`path`,{d:`M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16`,key:`3uifl3`}],[`path`,{d:`M8 16H3v5`,key:`1cv678`}]]};ev.node;var tv=Dg(ev),nv={name:`rotate-ccw`,size:24,node:[[`path`,{d:`M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`,key:`1357e3`}],[`path`,{d:`M3 3v5h5`,key:`1xhq8a`}]]};nv.node;var rv=Dg(nv),iv={name:`save`,size:24,node:[[`path`,{d:`M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z`,key:`1c8476`}],[`path`,{d:`M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7`,key:`1ydtos`}],[`path`,{d:`M7 3v4a1 1 0 0 0 1 1h7`,key:`t51u73`}]]};iv.node;var av=Dg(iv),ov={name:`scroll-text`,size:24,node:[[`path`,{d:`M15 12h-5`,key:`r7krc0`}],[`path`,{d:`M15 8h-5`,key:`1khuty`}],[`path`,{d:`M19 17V5a2 2 0 0 0-2-2H4`,key:`zz82l3`}],[`path`,{d:`M8 21h12a2 2 0 0 0 2-2v-1a1 1 0 0 0-1-1H11a1 1 0 0 0-1 1v1a2 2 0 1 1-4 0V5a2 2 0 1 0-4 0v2a1 1 0 0 0 1 1h3`,key:`1ph1d7`}]]};ov.node;var sv=Dg(ov),cv={name:`search`,size:24,node:[[`path`,{d:`m21 21-4.34-4.34`,key:`14j7rj`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}]]};cv.node;var lv=Dg(cv),uv={name:`settings`,size:24,node:[[`path`,{d:`M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915`,key:`1i5ecw`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]};uv.node;var dv=Dg(uv),fv={name:`shrink`,size:24,node:[[`path`,{d:`m15 15 6 6m-6-6v4.8m0-4.8h4.8`,key:`17vawe`}],[`path`,{d:`M9 19.8V15m0 0H4.2M9 15l-6 6`,key:`chjx8e`}],[`path`,{d:`M15 4.2V9m0 0h4.8M15 9l6-6`,key:`lav6yq`}],[`path`,{d:`M9 4.2V9m0 0H4.2M9 9 3 3`,key:`1pxi2q`}]]};fv.node;var pv=Dg(fv),mv={name:`square-pen`,size:24,node:[[`path`,{d:`M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7`,key:`1m0v6g`}],[`path`,{d:`M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z`,key:`ohrbg2`}]],aliases:[`pen-box`,`edit`,`pen-square`]};mv.node;var hv=Dg(mv),gv={name:`square-terminal`,size:24,node:[[`path`,{d:`m7 11 2-2-2-2`,key:`1lz0vl`}],[`path`,{d:`M11 13h4`,key:`1p7l4v`}],[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,ry:`2`,key:`1m3agn`}]],aliases:[`terminal-square`]};gv.node;var _v=Dg(gv),vv={name:`square`,size:24,node:[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}]]};vv.node;var yv=Dg(vv),bv={name:`sun`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`4`,key:`4exip2`}],[`path`,{d:`M12 2v2`,key:`tus03m`}],[`path`,{d:`M12 20v2`,key:`1lh1kg`}],[`path`,{d:`m4.93 4.93 1.41 1.41`,key:`149t6j`}],[`path`,{d:`m17.66 17.66 1.41 1.41`,key:`ptbguv`}],[`path`,{d:`M2 12h2`,key:`1t8f8n`}],[`path`,{d:`M20 12h2`,key:`1q8mjw`}],[`path`,{d:`m6.34 17.66-1.41 1.41`,key:`1m8zz5`}],[`path`,{d:`m19.07 4.93-1.41 1.41`,key:`1shlcs`}]]};bv.node;var xv=Dg(bv),Sv={name:`terminal`,size:24,node:[[`path`,{d:`M12 19h8`,key:`baeox8`}],[`path`,{d:`m4 17 6-6-6-6`,key:`1yngyt`}]]};Sv.node;var Cv=Dg(Sv),wv={name:`text-wrap`,size:24,node:[[`path`,{d:`m16 16-3 3 3 3`,key:`117b85`}],[`path`,{d:`M3 12h14.5a1 1 0 0 1 0 7H13`,key:`18xa6z`}],[`path`,{d:`M3 19h6`,key:`1ygdsz`}],[`path`,{d:`M3 5h18`,key:`1u36vt`}]],aliases:[`wrap-text`]};wv.node;var Tv=Dg(wv),Ev={name:`trash`,size:24,node:[[`path`,{d:`M10 11v6`,key:`nco0om`}],[`path`,{d:`M14 11v6`,key:`outv1u`}],[`path`,{d:`M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6`,key:`miytrc`}],[`path`,{d:`M3 6h18`,key:`d0wm0j`}],[`path`,{d:`M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2`,key:`e791ji`}]],aliases:[`trash-2`]};Ev.node;var Dv=Dg(Ev),Ov={name:`user-round`,size:24,node:[[`circle`,{cx:`12`,cy:`8`,r:`5`,key:`1hypcn`}],[`path`,{d:`M20 21a8 8 0 0 0-16 0`,key:`rfgkzh`}]],aliases:[`user-2`]};Ov.node;var kv=Dg(Ov),Av={name:`wallet`,size:24,node:[[`path`,{d:`M19 7V4a1 1 0 0 0-1-1H5a2 2 0 0 0 0 4h15a1 1 0 0 1 1 1v4h-3a2 2 0 0 0 0 4h3a1 1 0 0 0 1-1v-2a1 1 0 0 0-1-1`,key:`18etb6`}],[`path`,{d:`M3 5v14a2 2 0 0 0 2 2h15a1 1 0 0 0 1-1v-4`,key:`xoc0q4`}]]};Av.node;var jv=Dg(Av),Mv={name:`wrench`,size:24,node:[[`path`,{d:`M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z`,key:`1ngwbx`}]]};Mv.node;var Nv=Dg(Mv),Pv={name:`x`,size:24,node:[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]};Pv.node;var Fv=Dg(Pv),Iv={name:`zap`,size:24,node:[[`path`,{d:`M15.914 4a1.5 1.5 0 00-2.474-1.561l-9 9A1.5 1.5 0 005.5 14h4.002a.5.5 0 01.471.666L8.086 20a1.5 1.5 0 002.475 1.56l9-9A1.5 1.5 0 0018.5 10h-3.997a.5.5 0 01-.472-.667z`,key:`1v7up4`}]]};Iv.node;var Lv=Dg(Iv);function Rv(e){var t,n,r=``;if(typeof e==`string`||typeof e==`number`)r+=e;else if(typeof e==`object`){if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=Rv(e[t]))&&(r&&(r+=` `),r+=n)}else for(n in e)e[n]&&(r&&(r+=` `),r+=n)}return r}function zv(){for(var e,t,n=0,r=``,i=arguments.length;n<i;n++)(e=arguments[n])&&(t=Rv(e))&&(r&&(r+=` `),r+=t);return r}var Bv=(e,t)=>{let n=Array(e.length+t.length);for(let t=0;t<e.length;t++)n[t]=e[t];for(let r=0;r<t.length;r++)n[e.length+r]=t[r];return n},Vv=(e,t)=>({classGroupId:e,validator:t}),Hv=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),Uv=`-`,Wv=[],Gv=`arbitrary..`,Kv=e=>{let t=Yv(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:e=>{if(e.startsWith(`[`)&&e.endsWith(`]`))return Jv(e);let n=e.split(Uv);return qv(n,+(n[0]===``&&n.length>1),t)},getConflictingClassGroupIds:(e,t)=>{if(t){let t=r[e],i=n[e];return t?i?Bv(i,t):t:i||Wv}return n[e]||Wv}}},qv=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;let r=e[t],i=n.nextPart.get(r);if(i){let n=qv(e,t+1,i);if(n)return n}let a=n.validators;if(a===null)return;let o=t===0?e.join(Uv):e.slice(t).join(Uv),s=a.length;for(let e=0;e<s;e++){let t=a[e];if(t.validator(o))return t.classGroupId}},Jv=e=>e.slice(1,-1).indexOf(`:`)===-1?void 0:(()=>{let t=e.slice(1,-1),n=t.indexOf(`:`),r=t.slice(0,n);return r?Gv+r:void 0})(),Yv=e=>{let{theme:t,classGroups:n}=e;return Xv(n,t)},Xv=(e,t)=>{let n=Hv();for(let r in e){let i=e[r];Zv(i,n,r,t)}return n},Zv=(e,t,n,r)=>{let i=e.length;for(let a=0;a<i;a++){let i=e[a];Qv(i,t,n,r)}},Qv=(e,t,n,r)=>{if(typeof e==`string`){$v(e,t,n);return}if(typeof e==`function`){ey(e,t,n,r);return}ty(e,t,n,r)},$v=(e,t,n)=>{let r=e===``?t:ny(t,e);r.classGroupId=n},ey=(e,t,n,r)=>{if(ry(e)){Zv(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(Vv(n,e))},ty=(e,t,n,r)=>{let i=Object.entries(e),a=i.length;for(let e=0;e<a;e++){let[a,o]=i[e];Zv(o,ny(t,a),n,r)}},ny=(e,t)=>{let n=e,r=t.split(Uv),i=r.length;for(let e=0;e<i;e++){let t=r[e],i=n.nextPart.get(t);i||(i=Hv(),n.nextPart.set(t,i)),n=i}return n},ry=e=>`isThemeGetter`in e&&e.isThemeGetter===!0,iy=e=>{if(e<1)return{get:()=>void 0,set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null),i=(i,a)=>{n[i]=a,t++,t>e&&(t=0,r=n,n=Object.create(null))};return{get(e){let t=n[e];if(t!==void 0)return t;if((t=r[e])!==void 0)return i(e,t),t},set(e,t){e in n?n[e]=t:i(e,t)}}},ay=`!`,oy=`:`,sy=[],cy=(e,t,n,r,i)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:i}),ly=e=>{let{prefix:t,experimentalParseClassName:n}=e,r=e=>{let t=[],n=0,r=0,i=0,a,o=e.length;for(let s=0;s<o;s++){let o=e[s];if(n===0&&r===0){if(o===oy){t.push(e.slice(i,s)),i=s+1;continue}if(o===`/`){a=s;continue}}o===`[`?n++:o===`]`?n--:o===`(`?r++:o===`)`&&r--}let s=t.length===0?e:e.slice(i),c=s,l=!1;s.endsWith(ay)?(c=s.slice(0,-1),l=!0):s.startsWith(ay)&&(c=s.slice(1),l=!0);let u=a&&a>i?a-i:void 0;return cy(t,l,c,u)};if(t){let e=t+oy,n=r;r=t=>t.startsWith(e)?n(t.slice(e.length)):cy(sy,!1,t,void 0,!0)}if(n){let e=r;r=t=>n({className:t,parseClassName:e})}return r},uy=e=>{let t=new Map;return e.orderSensitiveModifiers.forEach((e,n)=>{t.set(e,1e6+n)}),e=>{let n=[],r=[];for(let i=0;i<e.length;i++){let a=e[i],o=a[0]===`[`,s=t.has(a);o||s?(r.length>0&&(r.sort(),n.push(...r),r=[]),n.push(a)):r.push(a)}return r.length>0&&(r.sort(),n.push(...r)),n}},dy=e=>({cache:iy(e.cacheSize),parseClassName:ly(e),sortModifiers:uy(e),postfixLookupClassGroupIds:fy(e),...Kv(e)}),fy=e=>{let t=Object.create(null),n=e.postfixLookupClassGroups;if(n)for(let e=0;e<n.length;e++)t[n[e]]=!0;return t},py=/\s+/,my=(e,t)=>{let{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i,sortModifiers:a,postfixLookupClassGroupIds:o}=t,s=[],c=e.trim().split(py),l=``;for(let e=c.length-1;e>=0;--e){let t=c[e],{isExternal:u,modifiers:d,hasImportantModifier:f,baseClassName:p,maybePostfixModifierPosition:m}=n(t);if(u){l=t+(l.length>0?` `+l:l);continue}let h=!!m,g;if(h){g=r(p.substring(0,m));let e=g&&o[g]?r(p):void 0;e&&e!==g&&(g=e,h=!1)}else g=r(p);if(!g){if(!h){l=t+(l.length>0?` `+l:l);continue}if(g=r(p),!g){l=t+(l.length>0?` `+l:l);continue}h=!1}let _=d.length===0?``:d.length===1?d[0]:a(d).join(`:`),v=f?_+ay:_,y=v+g;if(s.indexOf(y)>-1)continue;s.push(y);let b=i(g,h);for(let e=0;e<b.length;++e){let t=b[e];s.push(v+t)}l=t+(l.length>0?` `+l:l)}return l},hy=(...e)=>{let t=0,n,r,i=``;for(;t<e.length;)(n=e[t++])&&(r=gy(n))&&(i&&(i+=` `),i+=r);return i},gy=e=>{if(typeof e==`string`)return e;let t,n=``;for(let r=0;r<e.length;r++)e[r]&&(t=gy(e[r]))&&(n&&(n+=` `),n+=t);return n},_y=(e,...t)=>{let n,r,i,a,o=o=>(n=dy(t.reduce((e,t)=>t(e),e())),r=n.cache.get,i=n.cache.set,a=s,s(o)),s=e=>{let t=r(e);if(t)return t;let a=my(e,n);return i(e,a),a};return a=o,(...e)=>a(hy(...e))},vy=[],yy=e=>{let t=t=>t[e]||vy;return t.isThemeGetter=!0,t.themeKey=e,t},by=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,xy=/^\((?:(\w[\w-]*):)?(.+)\)$/i,Sy=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,Cy=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,wy=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,Ty=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix|color|light-dark)\(.+\)$/,Ey=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Dy=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Oy=e=>Sy.test(e),ky=e=>!!e&&!Number.isNaN(Number(e)),Ay=e=>!!e&&Number.isInteger(Number(e)),jy=e=>e.endsWith(`%`)&&ky(e.slice(0,-1)),My=e=>Cy.test(e),Ny=()=>!0,Py=e=>wy.test(e)&&!Ty.test(e),Fy=()=>!1,Iy=e=>Ey.test(e),Ly=e=>Dy.test(e),Ry=e=>!z(e)&&!Jy(e),zy=e=>e.startsWith(`@container`)&&(e[10]===`/`&&e[11]!==void 0||e[11]===`s`&&e[16]!==void 0&&e.startsWith(`-size/`,10)||e[11]===`n`&&e[18]!==void 0&&e.startsWith(`-normal/`,10)),By=e=>nb(e,ob,Fy),z=e=>by.test(e),Vy=e=>nb(e,sb,Py),Hy=e=>nb(e,cb,ky),Uy=e=>nb(e,ub,Ny),Wy=e=>nb(e,lb,Fy),Gy=e=>nb(e,ib,Fy),Ky=e=>nb(e,ab,Ly),qy=e=>nb(e,db,Iy),Jy=e=>xy.test(e),Yy=e=>rb(e,sb),Xy=e=>rb(e,lb),Zy=e=>rb(e,ib),Qy=e=>rb(e,ob),$y=e=>rb(e,ab),eb=e=>rb(e,db,!0),tb=e=>rb(e,ub,!0),nb=(e,t,n)=>{let r=by.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},rb=(e,t,n=!1)=>{let r=xy.exec(e);return r?r[1]?t(r[1]):n:!1},ib=e=>e===`position`||e===`percentage`,ab=e=>e===`image`||e===`url`,ob=e=>e===`length`||e===`size`||e===`bg-size`,sb=e=>e===`length`,cb=e=>e===`number`,lb=e=>e===`family-name`,ub=e=>e===`number`||e===`weight`,db=e=>e===`shadow`,fb=_y(()=>{let e=yy(`color`),t=yy(`font`),n=yy(`text`),r=yy(`font-weight`),i=yy(`tracking`),a=yy(`leading`),o=yy(`breakpoint`),s=yy(`container`),c=yy(`spacing`),l=yy(`radius`),u=yy(`shadow`),d=yy(`inset-shadow`),f=yy(`text-shadow`),p=yy(`drop-shadow`),m=yy(`blur`),h=yy(`perspective`),g=yy(`aspect`),_=yy(`ease`),v=yy(`animate`),y=()=>[`auto`,`avoid`,`all`,`avoid-page`,`page`,`left`,`right`,`column`],b=()=>[`center`,`top`,`bottom`,`left`,`right`,`top-left`,`left-top`,`top-right`,`right-top`,`bottom-right`,`right-bottom`,`bottom-left`,`left-bottom`],x=()=>[...b(),Jy,z],S=()=>[`auto`,`hidden`,`clip`,`visible`,`scroll`],C=()=>[`auto`,`contain`,`none`],w=()=>[Jy,z,c],T=()=>[Oy,`full`,`auto`,...w()],E=()=>[Ay,`none`,`subgrid`,Jy,z],D=()=>[`auto`,{span:[`full`,Ay,Jy,z]},Ay,Jy,z],ee=()=>[Ay,`auto`,Jy,z],O=()=>[`auto`,`min`,`max`,`fr`,Jy,z],te=()=>[`start`,`end`,`center`,`between`,`around`,`evenly`,`stretch`,`baseline`,`center-safe`,`end-safe`],ne=()=>[`start`,`end`,`center`,`stretch`,`center-safe`,`end-safe`],re=()=>[`auto`,...w()],ie=()=>[Oy,`auto`,`full`,`dvw`,`dvh`,`lvw`,`lvh`,`svw`,`svh`,`min`,`max`,`fit`,...w()],k=()=>[s,Oy,`screen`,`full`,`dvw`,`lvw`,`svw`,`min`,`max`,`fit`,...w()],ae=()=>[Oy,`screen`,`full`,`lh`,`dvh`,`lvh`,`svh`,`min`,`max`,`fit`,...w()],A=()=>[e,Jy,z],oe=()=>[...b(),Zy,Gy,{position:[Jy,z]}],se=()=>[`no-repeat`,{repeat:[``,`x`,`y`,`space`,`round`]}],ce=()=>[`auto`,`cover`,`contain`,Qy,By,{size:[Jy,z]}],le=()=>[jy,Yy,Vy],ue=()=>[``,`none`,`full`,l,Jy,z],de=()=>[``,ky,Yy,Vy],fe=()=>[`solid`,`dashed`,`dotted`,`double`],pe=()=>[`normal`,`multiply`,`screen`,`overlay`,`darken`,`lighten`,`color-dodge`,`color-burn`,`hard-light`,`soft-light`,`difference`,`exclusion`,`hue`,`saturation`,`color`,`luminosity`],me=()=>[ky,jy,Zy,Gy],he=()=>[``,`none`,m,Jy,z],ge=()=>[`none`,ky,Jy,z],_e=()=>[`none`,ky,Jy,z],ve=()=>[ky,Jy,z],ye=()=>[Oy,`full`,...w()];return{cacheSize:500,theme:{animate:[`spin`,`ping`,`pulse`,`bounce`],aspect:[`video`],blur:[My],breakpoint:[My],color:[Ny],container:[My],"drop-shadow":[My],ease:[`in`,`out`,`in-out`],font:[Ry],"font-weight":[`thin`,`extralight`,`light`,`normal`,`medium`,`semibold`,`bold`,`extrabold`,`black`],"inset-shadow":[My],leading:[`none`,`tight`,`snug`,`normal`,`relaxed`,`loose`],perspective:[`dramatic`,`near`,`normal`,`midrange`,`distant`,`none`],radius:[My],shadow:[My],spacing:[`px`,ky],text:[My],"text-shadow":[My],tracking:[`tighter`,`tight`,`normal`,`wide`,`wider`,`widest`]},classGroups:{aspect:[{aspect:[`auto`,`square`,Oy,z,Jy,g]}],container:[`container`],"container-type":[{"@container":[``,`normal`,`size`,Jy,z]}],"container-named":[zy],columns:[{columns:[ky,`auto`,z,Jy,s]}],"break-after":[{"break-after":y()}],"break-before":[{"break-before":y()}],"break-inside":[{"break-inside":[`auto`,`avoid`,`avoid-page`,`avoid-column`]}],"box-decoration":[{"box-decoration":[`slice`,`clone`]}],box:[{box:[`border`,`content`]}],display:[`block`,`inline-block`,`inline`,`flex`,`inline-flex`,`table`,`inline-table`,`table-caption`,`table-cell`,`table-column`,`table-column-group`,`table-footer-group`,`table-header-group`,`table-row-group`,`table-row`,`flow-root`,`grid`,`inline-grid`,`contents`,`list-item`,`hidden`],sr:[`sr-only`,`not-sr-only`],float:[{float:[`right`,`left`,`none`,`start`,`end`]}],clear:[{clear:[`left`,`right`,`both`,`none`,`start`,`end`]}],isolation:[`isolate`,`isolation-auto`],"object-fit":[{object:[`contain`,`cover`,`fill`,`none`,`scale-down`]}],"object-position":[{object:x()}],overflow:[{overflow:S()}],"overflow-x":[{"overflow-x":S()}],"overflow-y":[{"overflow-y":S()}],overscroll:[{overscroll:C()}],"overscroll-x":[{"overscroll-x":C()}],"overscroll-y":[{"overscroll-y":C()}],position:[`static`,`fixed`,`absolute`,`relative`,`sticky`],inset:[{inset:T()}],"inset-x":[{"inset-x":T()}],"inset-y":[{"inset-y":T()}],start:[{"inset-s":T(),start:T()}],end:[{"inset-e":T(),end:T()}],"inset-bs":[{"inset-bs":T()}],"inset-be":[{"inset-be":T()}],top:[{top:T()}],right:[{right:T()}],bottom:[{bottom:T()}],left:[{left:T()}],visibility:[`visible`,`invisible`,`collapse`],z:[{z:[Ay,`auto`,Jy,z]}],basis:[{basis:[Oy,`full`,`auto`,s,...w()]}],"flex-direction":[{flex:[`row`,`row-reverse`,`col`,`col-reverse`]}],"flex-wrap":[{flex:[`nowrap`,`wrap`,`wrap-reverse`]}],flex:[{flex:[ky,Oy,`auto`,`initial`,`none`,z]}],grow:[{grow:[``,ky,Jy,z]}],shrink:[{shrink:[``,ky,Jy,z]}],order:[{order:[Ay,`first`,`last`,`none`,Jy,z]}],"grid-cols":[{"grid-cols":E()}],"col-start-end":[{col:D()}],"col-start":[{"col-start":ee()}],"col-end":[{"col-end":ee()}],"grid-rows":[{"grid-rows":E()}],"row-start-end":[{row:D()}],"row-start":[{"row-start":ee()}],"row-end":[{"row-end":ee()}],"grid-flow":[{"grid-flow":[`row`,`col`,`dense`,`row-dense`,`col-dense`]}],"auto-cols":[{"auto-cols":O()}],"auto-rows":[{"auto-rows":O()}],gap:[{gap:w()}],"gap-x":[{"gap-x":w()}],"gap-y":[{"gap-y":w()}],"justify-content":[{justify:[...te(),`normal`]}],"justify-items":[{"justify-items":[...ne(),`normal`]}],"justify-self":[{"justify-self":[`auto`,...ne()]}],"align-content":[{content:[`normal`,...te()]}],"align-items":[{items:[...ne(),{baseline:[``,`last`]}]}],"align-self":[{self:[`auto`,...ne(),{baseline:[``,`last`]}]}],"place-content":[{"place-content":te()}],"place-items":[{"place-items":[...ne(),`baseline`]}],"place-self":[{"place-self":[`auto`,...ne()]}],p:[{p:w()}],px:[{px:w()}],py:[{py:w()}],ps:[{ps:w()}],pe:[{pe:w()}],pbs:[{pbs:w()}],pbe:[{pbe:w()}],pt:[{pt:w()}],pr:[{pr:w()}],pb:[{pb:w()}],pl:[{pl:w()}],m:[{m:re()}],mx:[{mx:re()}],my:[{my:re()}],ms:[{ms:re()}],me:[{me:re()}],mbs:[{mbs:re()}],mbe:[{mbe:re()}],mt:[{mt:re()}],mr:[{mr:re()}],mb:[{mb:re()}],ml:[{ml:re()}],"space-x":[{"space-x":w()}],"space-x-reverse":[`space-x-reverse`],"space-y":[{"space-y":w()}],"space-y-reverse":[`space-y-reverse`],size:[{size:ie()}],"inline-size":[{inline:[`auto`,...k()]}],"min-inline-size":[{"min-inline":[`auto`,...k()]}],"max-inline-size":[{"max-inline":[`none`,...k()]}],"block-size":[{block:[`auto`,...ae()]}],"min-block-size":[{"min-block":[`auto`,...ae()]}],"max-block-size":[{"max-block":[`none`,...ae()]}],w:[{w:[s,`screen`,...ie()]}],"min-w":[{"min-w":[s,`screen`,`none`,...ie()]}],"max-w":[{"max-w":[s,`screen`,`none`,`prose`,{screen:[o]},...ie()]}],h:[{h:[`screen`,`lh`,...ie()]}],"min-h":[{"min-h":[`screen`,`lh`,`none`,...ie()]}],"max-h":[{"max-h":[`screen`,`lh`,`none`,...ie()]}],"font-size":[{text:[`base`,n,Yy,Vy]}],"font-smoothing":[`antialiased`,`subpixel-antialiased`],"font-style":[`italic`,`not-italic`],"font-weight":[{font:[r,tb,Uy]}],"font-stretch":[{"font-stretch":[`ultra-condensed`,`extra-condensed`,`condensed`,`semi-condensed`,`normal`,`semi-expanded`,`expanded`,`extra-expanded`,`ultra-expanded`,jy,z]}],"font-family":[{font:[Xy,Wy,t]}],"font-features":[{"font-features":[z]}],"fvn-normal":[`normal-nums`],"fvn-ordinal":[`ordinal`],"fvn-slashed-zero":[`slashed-zero`],"fvn-figure":[`lining-nums`,`oldstyle-nums`],"fvn-spacing":[`proportional-nums`,`tabular-nums`],"fvn-fraction":[`diagonal-fractions`,`stacked-fractions`],tracking:[{tracking:[i,Jy,z]}],"line-clamp":[{"line-clamp":[ky,`none`,Jy,Hy]}],leading:[{leading:[`none`,a,...w()]}],"list-image":[{"list-image":[`none`,Jy,z]}],"list-style-position":[{list:[`inside`,`outside`]}],"list-style-type":[{list:[`disc`,`decimal`,`none`,Jy,z]}],"text-alignment":[{text:[`left`,`center`,`right`,`justify`,`start`,`end`]}],"placeholder-color":[{placeholder:A()}],"text-color":[{text:A()}],"text-decoration":[`underline`,`overline`,`line-through`,`no-underline`],"text-decoration-style":[{decoration:[...fe(),`wavy`]}],"text-decoration-thickness":[{decoration:[ky,`from-font`,`auto`,Jy,Vy]}],"text-decoration-color":[{decoration:A()}],"underline-offset":[{"underline-offset":[ky,`auto`,Jy,z]}],"text-transform":[`uppercase`,`lowercase`,`capitalize`,`normal-case`],"text-overflow":[`truncate`,`text-ellipsis`,`text-clip`],"text-wrap":[{text:[`wrap`,`nowrap`,`balance`,`pretty`]}],indent:[{indent:w()}],"tab-size":[{tab:[Ay,Jy,z]}],"vertical-align":[{align:[`baseline`,`top`,`middle`,`bottom`,`text-top`,`text-bottom`,`sub`,`super`,Jy,z]}],whitespace:[{whitespace:[`normal`,`nowrap`,`pre`,`pre-line`,`pre-wrap`,`break-spaces`]}],break:[{break:[`normal`,`words`,`all`,`keep`]}],wrap:[{wrap:[`break-word`,`anywhere`,`normal`]}],hyphens:[{hyphens:[`none`,`manual`,`auto`]}],content:[{content:[`none`,Jy,z]}],"bg-attachment":[{bg:[`fixed`,`local`,`scroll`]}],"bg-clip":[{"bg-clip":[`border`,`padding`,`content`,`text`]}],"bg-origin":[{"bg-origin":[`border`,`padding`,`content`]}],"bg-position":[{bg:oe()}],"bg-repeat":[{bg:se()}],"bg-size":[{bg:ce()}],"bg-image":[{bg:[`none`,{linear:[{to:[`t`,`tr`,`r`,`br`,`b`,`bl`,`l`,`tl`]},Ay,Jy,z],radial:[``,Jy,z],conic:[``,Ay,Jy,z]},$y,Ky]}],"bg-color":[{bg:A()}],"gradient-from-pos":[{from:le()}],"gradient-via-pos":[{via:le()}],"gradient-to-pos":[{to:le()}],"gradient-from":[{from:A()}],"gradient-via":[{via:A()}],"gradient-to":[{to:A()}],rounded:[{rounded:ue()}],"rounded-s":[{"rounded-s":ue()}],"rounded-e":[{"rounded-e":ue()}],"rounded-t":[{"rounded-t":ue()}],"rounded-r":[{"rounded-r":ue()}],"rounded-b":[{"rounded-b":ue()}],"rounded-l":[{"rounded-l":ue()}],"rounded-ss":[{"rounded-ss":ue()}],"rounded-se":[{"rounded-se":ue()}],"rounded-ee":[{"rounded-ee":ue()}],"rounded-es":[{"rounded-es":ue()}],"rounded-tl":[{"rounded-tl":ue()}],"rounded-tr":[{"rounded-tr":ue()}],"rounded-br":[{"rounded-br":ue()}],"rounded-bl":[{"rounded-bl":ue()}],"border-w":[{border:de()}],"border-w-x":[{"border-x":de()}],"border-w-y":[{"border-y":de()}],"border-w-s":[{"border-s":de()}],"border-w-e":[{"border-e":de()}],"border-w-bs":[{"border-bs":de()}],"border-w-be":[{"border-be":de()}],"border-w-t":[{"border-t":de()}],"border-w-r":[{"border-r":de()}],"border-w-b":[{"border-b":de()}],"border-w-l":[{"border-l":de()}],"divide-x":[{"divide-x":de()}],"divide-x-reverse":[`divide-x-reverse`],"divide-y":[{"divide-y":de()}],"divide-y-reverse":[`divide-y-reverse`],"border-style":[{border:[...fe(),`hidden`,`none`]}],"divide-style":[{divide:[...fe(),`hidden`,`none`]}],"border-color":[{border:A()}],"border-color-x":[{"border-x":A()}],"border-color-y":[{"border-y":A()}],"border-color-s":[{"border-s":A()}],"border-color-e":[{"border-e":A()}],"border-color-bs":[{"border-bs":A()}],"border-color-be":[{"border-be":A()}],"border-color-t":[{"border-t":A()}],"border-color-r":[{"border-r":A()}],"border-color-b":[{"border-b":A()}],"border-color-l":[{"border-l":A()}],"divide-color":[{divide:A()}],"outline-style":[{outline:[...fe(),`none`,`hidden`]}],"outline-offset":[{"outline-offset":[ky,Jy,z]}],"outline-w":[{outline:[``,ky,Yy,Vy]}],"outline-color":[{outline:A()}],shadow:[{shadow:[``,`inner`,`none`,u,eb,qy]}],"shadow-color":[{shadow:A()}],"inset-shadow":[{"inset-shadow":[`none`,d,eb,qy]}],"inset-shadow-color":[{"inset-shadow":A()}],"ring-w":[{ring:de()}],"ring-w-inset":[`ring-inset`],"ring-color":[{ring:A()}],"ring-offset-w":[{"ring-offset":[ky,Vy]}],"ring-offset-color":[{"ring-offset":A()}],"inset-ring-w":[{"inset-ring":de()}],"inset-ring-color":[{"inset-ring":A()}],"text-shadow":[{"text-shadow":[`none`,f,eb,qy]}],"text-shadow-color":[{"text-shadow":A()}],opacity:[{opacity:[ky,Jy,z]}],"mix-blend":[{"mix-blend":[...pe(),`plus-darker`,`plus-lighter`]}],"bg-blend":[{"bg-blend":pe()}],"mask-clip":[{"mask-clip":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]},`mask-no-clip`],"mask-composite":[{mask:[`add`,`subtract`,`intersect`,`exclude`]}],"mask-image-linear-pos":[{"mask-linear":[ky]}],"mask-image-linear-from-pos":[{"mask-linear-from":me()}],"mask-image-linear-to-pos":[{"mask-linear-to":me()}],"mask-image-linear-from-color":[{"mask-linear-from":A()}],"mask-image-linear-to-color":[{"mask-linear-to":A()}],"mask-image-t-from-pos":[{"mask-t-from":me()}],"mask-image-t-to-pos":[{"mask-t-to":me()}],"mask-image-t-from-color":[{"mask-t-from":A()}],"mask-image-t-to-color":[{"mask-t-to":A()}],"mask-image-r-from-pos":[{"mask-r-from":me()}],"mask-image-r-to-pos":[{"mask-r-to":me()}],"mask-image-r-from-color":[{"mask-r-from":A()}],"mask-image-r-to-color":[{"mask-r-to":A()}],"mask-image-b-from-pos":[{"mask-b-from":me()}],"mask-image-b-to-pos":[{"mask-b-to":me()}],"mask-image-b-from-color":[{"mask-b-from":A()}],"mask-image-b-to-color":[{"mask-b-to":A()}],"mask-image-l-from-pos":[{"mask-l-from":me()}],"mask-image-l-to-pos":[{"mask-l-to":me()}],"mask-image-l-from-color":[{"mask-l-from":A()}],"mask-image-l-to-color":[{"mask-l-to":A()}],"mask-image-x-from-pos":[{"mask-x-from":me()}],"mask-image-x-to-pos":[{"mask-x-to":me()}],"mask-image-x-from-color":[{"mask-x-from":A()}],"mask-image-x-to-color":[{"mask-x-to":A()}],"mask-image-y-from-pos":[{"mask-y-from":me()}],"mask-image-y-to-pos":[{"mask-y-to":me()}],"mask-image-y-from-color":[{"mask-y-from":A()}],"mask-image-y-to-color":[{"mask-y-to":A()}],"mask-image-radial":[{"mask-radial":[Jy,z]}],"mask-image-radial-from-pos":[{"mask-radial-from":me()}],"mask-image-radial-to-pos":[{"mask-radial-to":me()}],"mask-image-radial-from-color":[{"mask-radial-from":A()}],"mask-image-radial-to-color":[{"mask-radial-to":A()}],"mask-image-radial-shape":[{"mask-radial":[`circle`,`ellipse`]}],"mask-image-radial-size":[{"mask-radial":[{closest:[`side`,`corner`],farthest:[`side`,`corner`]}]}],"mask-image-radial-pos":[{"mask-radial-at":b()}],"mask-image-conic-pos":[{"mask-conic":[ky]}],"mask-image-conic-from-pos":[{"mask-conic-from":me()}],"mask-image-conic-to-pos":[{"mask-conic-to":me()}],"mask-image-conic-from-color":[{"mask-conic-from":A()}],"mask-image-conic-to-color":[{"mask-conic-to":A()}],"mask-mode":[{mask:[`alpha`,`luminance`,`match`]}],"mask-origin":[{"mask-origin":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]}],"mask-position":[{mask:oe()}],"mask-repeat":[{mask:se()}],"mask-size":[{mask:ce()}],"mask-type":[{"mask-type":[`alpha`,`luminance`]}],"mask-image":[{mask:[`none`,Jy,z]}],filter:[{filter:[``,`none`,Jy,z]}],blur:[{blur:he()}],brightness:[{brightness:[ky,Jy,z]}],contrast:[{contrast:[ky,Jy,z]}],"drop-shadow":[{"drop-shadow":[``,`none`,p,eb,qy]}],"drop-shadow-color":[{"drop-shadow":A()}],grayscale:[{grayscale:[``,ky,Jy,z]}],"hue-rotate":[{"hue-rotate":[ky,Jy,z]}],invert:[{invert:[``,ky,Jy,z]}],saturate:[{saturate:[ky,Jy,z]}],sepia:[{sepia:[``,ky,Jy,z]}],"backdrop-filter":[{"backdrop-filter":[``,`none`,Jy,z]}],"backdrop-blur":[{"backdrop-blur":he()}],"backdrop-brightness":[{"backdrop-brightness":[ky,Jy,z]}],"backdrop-contrast":[{"backdrop-contrast":[ky,Jy,z]}],"backdrop-grayscale":[{"backdrop-grayscale":[``,ky,Jy,z]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[ky,Jy,z]}],"backdrop-invert":[{"backdrop-invert":[``,ky,Jy,z]}],"backdrop-opacity":[{"backdrop-opacity":[ky,Jy,z]}],"backdrop-saturate":[{"backdrop-saturate":[ky,Jy,z]}],"backdrop-sepia":[{"backdrop-sepia":[``,ky,Jy,z]}],"border-collapse":[{border:[`collapse`,`separate`]}],"border-spacing":[{"border-spacing":w()}],"border-spacing-x":[{"border-spacing-x":w()}],"border-spacing-y":[{"border-spacing-y":w()}],"table-layout":[{table:[`auto`,`fixed`]}],caption:[{caption:[`top`,`bottom`]}],transition:[{transition:[``,`all`,`colors`,`opacity`,`shadow`,`transform`,`none`,Jy,z]}],"transition-behavior":[{transition:[`normal`,`discrete`]}],duration:[{duration:[ky,`initial`,Jy,z]}],ease:[{ease:[`linear`,`initial`,_,Jy,z]}],delay:[{delay:[ky,Jy,z]}],animate:[{animate:[`none`,v,Jy,z]}],backface:[{backface:[`hidden`,`visible`]}],perspective:[{perspective:[h,Jy,z]}],"perspective-origin":[{"perspective-origin":x()}],rotate:[{rotate:ge()}],"rotate-x":[{"rotate-x":ge()}],"rotate-y":[{"rotate-y":ge()}],"rotate-z":[{"rotate-z":ge()}],scale:[{scale:_e()}],"scale-x":[{"scale-x":_e()}],"scale-y":[{"scale-y":_e()}],"scale-z":[{"scale-z":_e()}],"scale-3d":[`scale-3d`],skew:[{skew:ve()}],"skew-x":[{"skew-x":ve()}],"skew-y":[{"skew-y":ve()}],transform:[{transform:[Jy,z,``,`none`,`gpu`,`cpu`]}],"transform-origin":[{origin:x()}],"transform-style":[{transform:[`3d`,`flat`]}],translate:[{translate:ye()}],"translate-x":[{"translate-x":ye()}],"translate-y":[{"translate-y":ye()}],"translate-z":[{"translate-z":ye()}],"translate-none":[`translate-none`],zoom:[{zoom:[Ay,Jy,z]}],accent:[{accent:A()}],appearance:[{appearance:[`none`,`auto`]}],"caret-color":[{caret:A()}],"color-scheme":[{scheme:[`normal`,`dark`,`light`,`light-dark`,`only-dark`,`only-light`]}],cursor:[{cursor:[`auto`,`default`,`pointer`,`wait`,`text`,`move`,`help`,`not-allowed`,`none`,`context-menu`,`progress`,`cell`,`crosshair`,`vertical-text`,`alias`,`copy`,`no-drop`,`grab`,`grabbing`,`all-scroll`,`col-resize`,`row-resize`,`n-resize`,`e-resize`,`s-resize`,`w-resize`,`ne-resize`,`nw-resize`,`se-resize`,`sw-resize`,`ew-resize`,`ns-resize`,`nesw-resize`,`nwse-resize`,`zoom-in`,`zoom-out`,Jy,z]}],"field-sizing":[{"field-sizing":[`fixed`,`content`]}],"pointer-events":[{"pointer-events":[`auto`,`none`]}],resize:[{resize:[`none`,``,`y`,`x`]}],"scroll-behavior":[{scroll:[`auto`,`smooth`]}],"scrollbar-thumb-color":[{"scrollbar-thumb":A()}],"scrollbar-track-color":[{"scrollbar-track":A()}],"scrollbar-gutter":[{"scrollbar-gutter":[`auto`,`stable`,`both`]}],"scrollbar-w":[{scrollbar:[`auto`,`thin`,`none`]}],"scroll-m":[{"scroll-m":w()}],"scroll-mx":[{"scroll-mx":w()}],"scroll-my":[{"scroll-my":w()}],"scroll-ms":[{"scroll-ms":w()}],"scroll-me":[{"scroll-me":w()}],"scroll-mbs":[{"scroll-mbs":w()}],"scroll-mbe":[{"scroll-mbe":w()}],"scroll-mt":[{"scroll-mt":w()}],"scroll-mr":[{"scroll-mr":w()}],"scroll-mb":[{"scroll-mb":w()}],"scroll-ml":[{"scroll-ml":w()}],"scroll-p":[{"scroll-p":w()}],"scroll-px":[{"scroll-px":w()}],"scroll-py":[{"scroll-py":w()}],"scroll-ps":[{"scroll-ps":w()}],"scroll-pe":[{"scroll-pe":w()}],"scroll-pbs":[{"scroll-pbs":w()}],"scroll-pbe":[{"scroll-pbe":w()}],"scroll-pt":[{"scroll-pt":w()}],"scroll-pr":[{"scroll-pr":w()}],"scroll-pb":[{"scroll-pb":w()}],"scroll-pl":[{"scroll-pl":w()}],"snap-align":[{snap:[`start`,`end`,`center`,`align-none`]}],"snap-stop":[{snap:[`normal`,`always`]}],"snap-type":[{snap:[`none`,`x`,`y`,`both`]}],"snap-strictness":[{snap:[`mandatory`,`proximity`]}],touch:[{touch:[`auto`,`none`,`manipulation`]}],"touch-x":[{"touch-pan":[`x`,`left`,`right`]}],"touch-y":[{"touch-pan":[`y`,`up`,`down`]}],"touch-pz":[`touch-pinch-zoom`],select:[{select:[`none`,`text`,`all`,`auto`]}],"will-change":[{"will-change":[`auto`,`scroll`,`contents`,`transform`,Jy,z]}],fill:[{fill:[`none`,...A()]}],"stroke-w":[{stroke:[ky,Yy,Vy,Hy]}],stroke:[{stroke:[`none`,...A()]}],"forced-color-adjust":[{"forced-color-adjust":[`auto`,`none`]}]},conflictingClassGroups:{"container-named":[`container-type`],overflow:[`overflow-x`,`overflow-y`],overscroll:[`overscroll-x`,`overscroll-y`],inset:[`inset-x`,`inset-y`,`inset-bs`,`inset-be`,`start`,`end`,`top`,`right`,`bottom`,`left`],"inset-x":[`start`,`end`,`right`,`left`],"inset-y":[`inset-bs`,`inset-be`,`top`,`bottom`],flex:[`basis`,`grow`,`shrink`],gap:[`gap-x`,`gap-y`],p:[`px`,`py`,`ps`,`pe`,`pbs`,`pbe`,`pt`,`pr`,`pb`,`pl`],px:[`ps`,`pe`,`pr`,`pl`],py:[`pbs`,`pbe`,`pt`,`pb`],m:[`mx`,`my`,`ms`,`me`,`mbs`,`mbe`,`mt`,`mr`,`mb`,`ml`],mx:[`ms`,`me`,`mr`,`ml`],my:[`mbs`,`mbe`,`mt`,`mb`],size:[`w`,`h`],"font-size":[`leading`],"fvn-normal":[`fvn-ordinal`,`fvn-slashed-zero`,`fvn-figure`,`fvn-spacing`,`fvn-fraction`],"fvn-ordinal":[`fvn-normal`],"fvn-slashed-zero":[`fvn-normal`],"fvn-figure":[`fvn-normal`],"fvn-spacing":[`fvn-normal`],"fvn-fraction":[`fvn-normal`],"line-clamp":[`display`,`overflow`],rounded:[`rounded-s`,`rounded-e`,`rounded-t`,`rounded-r`,`rounded-b`,`rounded-l`,`rounded-ss`,`rounded-se`,`rounded-ee`,`rounded-es`,`rounded-tl`,`rounded-tr`,`rounded-br`,`rounded-bl`],"rounded-s":[`rounded-ss`,`rounded-es`],"rounded-e":[`rounded-se`,`rounded-ee`],"rounded-t":[`rounded-tl`,`rounded-tr`],"rounded-r":[`rounded-tr`,`rounded-br`],"rounded-b":[`rounded-br`,`rounded-bl`],"rounded-l":[`rounded-tl`,`rounded-bl`],"border-spacing":[`border-spacing-x`,`border-spacing-y`],"border-w":[`border-w-x`,`border-w-y`,`border-w-s`,`border-w-e`,`border-w-bs`,`border-w-be`,`border-w-t`,`border-w-r`,`border-w-b`,`border-w-l`],"border-w-x":[`border-w-s`,`border-w-e`,`border-w-r`,`border-w-l`],"border-w-y":[`border-w-bs`,`border-w-be`,`border-w-t`,`border-w-b`],"border-color":[`border-color-x`,`border-color-y`,`border-color-s`,`border-color-e`,`border-color-bs`,`border-color-be`,`border-color-t`,`border-color-r`,`border-color-b`,`border-color-l`],"border-color-x":[`border-color-s`,`border-color-e`,`border-color-r`,`border-color-l`],"border-color-y":[`border-color-bs`,`border-color-be`,`border-color-t`,`border-color-b`],translate:[`translate-x`,`translate-y`,`translate-none`],"translate-none":[`translate`,`translate-x`,`translate-y`,`translate-z`],"scroll-m":[`scroll-mx`,`scroll-my`,`scroll-ms`,`scroll-me`,`scroll-mbs`,`scroll-mbe`,`scroll-mt`,`scroll-mr`,`scroll-mb`,`scroll-ml`],"scroll-mx":[`scroll-ms`,`scroll-me`,`scroll-mr`,`scroll-ml`],"scroll-my":[`scroll-mbs`,`scroll-mbe`,`scroll-mt`,`scroll-mb`],"scroll-p":[`scroll-px`,`scroll-py`,`scroll-ps`,`scroll-pe`,`scroll-pbs`,`scroll-pbe`,`scroll-pt`,`scroll-pr`,`scroll-pb`,`scroll-pl`],"scroll-px":[`scroll-ps`,`scroll-pe`,`scroll-pr`,`scroll-pl`],"scroll-py":[`scroll-pbs`,`scroll-pbe`,`scroll-pt`,`scroll-pb`],touch:[`touch-x`,`touch-y`,`touch-pz`],"touch-x":[`touch`],"touch-y":[`touch`],"touch-pz":[`touch`]},conflictingClassGroupModifiers:{"font-size":[`leading`]},postfixLookupClassGroups:[`container-type`],orderSensitiveModifiers:[`*`,`**`,`after`,`backdrop`,`before`,`details-content`,`file`,`first-letter`,`first-line`,`marker`,`placeholder`,`selection`]}});function pb(...e){return fb(zv(e))}function mb({type:e=`button`,variant:t=`default`,className:n=``,disabled:r=!1,href:i,onclick:a,children:o}){let s=pb(`focus-visible:ring-ring/50 inline-flex h-10 items-center justify-center gap-2 rounded-full border border-transparent px-5 py-2 text-sm font-medium transition-opacity focus-visible:ring-2 focus-visible:outline-none disabled:pointer-events-none disabled:opacity-50`,t===`outline`?`border-border bg-surface/80 text-foreground hover:bg-hover-fill`:`bg-primary text-primary-foreground hover:opacity-90`,n);return i&&!r?(0,R.jsx)(`a`,{href:i,className:s,onClick:a,children:o}):(0,R.jsx)(`button`,{type:e,disabled:r,className:s,onClick:a,children:o})}function hb({class:e=``,size:t=`md`,onclick:n,label:r}){let i=t===`sm`?`h-6 w-6`:`h-7 w-7`,a=t===`sm`?`text-lg`:`text-[1.15rem]`,o=(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(`img`,{src:`/logo.png`,alt:``,className:pb(`shrink-0`,i)}),(0,R.jsx)(`span`,{className:pb(`font-brand text-foreground truncate font-semibold tracking-tight`,a),children:`Sprocket`})]});return n?(0,R.jsx)(`button`,{type:`button`,className:pb(`flex min-w-0 items-center gap-2`,e),"aria-label":r,title:r,onClick:n,children:o}):(0,R.jsx)(`div`,{className:pb(`flex min-w-0 items-center gap-2`,e),children:o})}function gb(e){return e===`light`||e===`dark`}function _b(e){return e??`light`}var vb=0,yb=null;function bb(e){document.documentElement.dataset.theme=e,document.documentElement.style.colorScheme=e}function xb(e){if(globalThis.document){if(vb>0){yb=e;return}bb(e)}}function Sb(){return globalThis.document?(vb===0&&(yb=gb(document.documentElement.dataset.theme)?document.documentElement.dataset.theme:_b(null),bb(`light`)),vb+=1,()=>{if(vb=Math.max(0,vb-1),vb===0){let e=yb??_b(null);yb=null,bb(e)}}):()=>{}}function Cb({title:e,description:t=null,busy:n=!1,class:r=``,children:i,actions:a}){return(0,F.useLayoutEffect)(Sb,[]),(0,R.jsx)(`div`,{className:pb(`app-entry-shell relative flex min-h-screen items-center justify-center px-8 py-10 text-center`,r),children:(0,R.jsxs)(`div`,{className:`relative z-10 w-full max-w-md`,"aria-busy":n||void 0,"aria-live":n?`polite`:void 0,children:[(0,R.jsx)(`div`,{className:`mb-8 flex justify-center`,children:(0,R.jsx)(hb,{})}),(0,R.jsx)(`h1`,{className:`font-brand text-foreground text-[1.5rem] font-semibold tracking-tight`,children:e}),t&&(0,R.jsx)(`p`,{className:`text-muted-foreground mt-3 text-sm leading-[1.55]`,children:t}),i&&(0,R.jsx)(`div`,{className:`mt-5 space-y-4 text-left [&:not(:has(*))]:mt-0 [&:not(:has(*))]:hidden`,children:i}),a&&(0,R.jsx)(`div`,{className:`mt-6 flex flex-wrap items-center justify-center gap-3 [&:not(:has(*))]:mt-0 [&:not(:has(*))]:hidden`,children:a})]})})}function wb({authState:e,overlayOpen:t=!1,onSignIn:n,onSignOut:r,onRetry:i,retryLabel:a=`Retry`,onSignUp:o}){let s=e.isAuthenticated&&(e.isLoading||!e.connectionFailed),c=!e.isAuthenticated&&e.isLoading,l=e.isConfigured?s?`Confirming your session`:e.connectionFailed?`Couldn’t connect your account`:c?`Preparing sign-in`:`Sign in to continue`:`Sign-in unavailable`,u=e.isConfigured?s?`Verifying your secure connection before opening your projects.`:e.connectionFailed?`Your session could not be confirmed. Retry when the connection is available.`:c?`Getting account sign-in ready. This usually takes a moment.`:`Sign in to sync your coding threads, streaming responses, and projects.`:`Account sign-in is not configured on this deployment, so account actions are disabled.`;return(0,R.jsx)(`div`,{inert:t,"aria-hidden":t||void 0,children:(0,R.jsxs)(Cb,{title:l,description:u,actions:(0,R.jsxs)(R.Fragment,{children:[e.connectionFailed&&e.isConfigured&&(0,R.jsx)(mb,{onclick:i,disabled:e.isLoading,children:a}),e.isAuthenticated?(0,R.jsx)(mb,{variant:`outline`,onclick:r,children:`Sign Out`}):e.isConfigured&&!e.connectionFailed&&(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(mb,{onclick:n,disabled:e.isLoading,children:`Sign In`}),(0,R.jsx)(mb,{variant:`outline`,onclick:o,disabled:e.isLoading,children:`Create Account`})]})]}),children:[e.isConfigured&&e.error&&!t&&(0,R.jsx)(`p`,{className:`text-destructive text-center text-sm`,role:`alert`,children:e.error}),e.isLoading&&(0,R.jsxs)(`div`,{className:`text-muted-foreground flex items-center justify-center gap-2 text-sm`,"aria-live":`polite`,"aria-busy":`true`,children:[(0,R.jsx)(V_,{className:`size-3.5 animate-spin`,"aria-hidden":`true`}),(0,R.jsx)(`span`,{children:e.isAuthenticated?`Almost there`:`One moment`})]})]})})}function Tb({open:e,signInUrl:t,error:n=null,onCancel:r,onClearOpenError:i}){let[a,o]=(0,F.useState)(!1),[s,c]=(0,F.useState)(null),l=(0,F.useRef)(null),u=(0,F.useRef)(null),d=(0,F.useRef)(r),f=(0,F.useRef)(i);(0,F.useEffect)(()=>{d.current=r,f.current=i}),(0,F.useEffect)(()=>{if(!e){o(!1),c(null);return}let t=document.activeElement instanceof HTMLElement?document.activeElement:null;l.current?.focus();function n(e){if(e.key===`Escape`){e.preventDefault(),e.stopPropagation(),d.current();return}let t=l.current;if(e.key!==`Tab`||!t)return;let n=Array.from(t.querySelectorAll(`a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])`)).filter(e=>!e.hasAttribute(`hidden`)&&e.offsetParent!==null);if(n.length===0){e.preventDefault(),t.focus();return}let r=n[0],i=n[n.length-1],a=document.activeElement;e.shiftKey&&(a===t||a===r||!t.contains(a))?(e.preventDefault(),i.focus()):!e.shiftKey&&(a===t||a===i||!t.contains(a))&&(e.preventDefault(),r.focus())}return window.addEventListener(`keydown`,n,!0),()=>{window.removeEventListener(`keydown`,n,!0),u.current!==null&&(window.clearTimeout(u.current),u.current=null),t?.isConnected&&t.focus()}},[e]);async function p(){if(t)try{await navigator.clipboard.writeText(t),o(!0),c(null),u.current!==null&&window.clearTimeout(u.current),u.current=window.setTimeout(()=>{o(!1),u.current=null},2e3)}catch{o(!1),c(`Could not copy the sign-in link. Select it above and copy manually.`)}}function m(){if(!t)return;let e=window.open(t,`_blank`);if(e){try{e.opener=null}catch{}f.current?.()}}if(!e)return null;let h=t?n?{title:`Open the sign-in link`,description:`Your browser didn’t open automatically. Continue with the options below.`}:{title:`Finish signing in`,description:`We opened your browser to complete sign-in. Waiting for you to finish there.`}:{title:`Preparing sign-in`,description:`Preparing a secure sign-in link. This usually takes a moment.`};return(0,R.jsx)(`div`,{className:`app-entry-shell fixed inset-0 z-50 flex items-center justify-center px-6`,role:`presentation`,onClick:e=>{e.target===e.currentTarget&&r()},children:(0,R.jsxs)(`div`,{ref:l,className:`border-border/70 bg-surface relative z-10 w-full max-w-md rounded-2xl border p-8 text-center shadow-[0_18px_50px_-28px_oklch(0.2_0.02_260/0.45)] outline-none`,role:`dialog`,"aria-modal":`true`,"aria-labelledby":`browser-signin-title`,"aria-describedby":`browser-signin-desc`,tabIndex:-1,children:[!t&&(0,R.jsx)(`div`,{className:`text-muted-foreground mb-4 flex justify-center`,"aria-hidden":`true`,children:(0,R.jsx)(V_,{className:`size-5 animate-spin`})}),(0,R.jsx)(`h2`,{id:`browser-signin-title`,className:`font-brand text-foreground text-[1.35rem] font-semibold tracking-tight`,children:h.title}),(0,R.jsx)(`p`,{id:`browser-signin-desc`,className:`text-muted-foreground mt-3 text-sm leading-[1.55]`,children:h.description}),t&&(0,R.jsx)(`p`,{className:`text-muted-foreground mt-6 max-h-24 overflow-y-auto font-mono text-[11px] leading-5 break-all select-all`,title:t,children:t}),n&&(0,R.jsx)(`p`,{className:`text-destructive mt-4 text-sm`,role:`alert`,children:n}),s&&(0,R.jsx)(`p`,{className:`mt-4 text-sm text-amber-700`,role:`alert`,children:s}),(0,R.jsx)(`div`,{className:`mt-6 flex flex-wrap items-center justify-center gap-3`,children:t?(0,R.jsxs)(R.Fragment,{children:[(0,R.jsxs)(mb,{onclick:m,children:[(0,R.jsx)(p_,{className:`size-4`,"aria-hidden":`true`}),`Open browser`]}),(0,R.jsx)(mb,{variant:`outline`,onclick:()=>void p(),children:a?(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(Ug,{className:`size-4`,"aria-hidden":`true`}),`Copied`]}):(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(r_,{className:`size-4`,"aria-hidden":`true`}),`Copy link`]})})]}):(0,R.jsx)(`span`,{className:`text-muted-foreground border-border inline-flex h-10 items-center justify-center gap-2 rounded-full border px-4 text-sm`,children:`Preparing link…`})}),(0,R.jsx)(`div`,{className:`mt-6`,children:(0,R.jsx)(`button`,{type:`button`,className:`text-muted-foreground hover:text-foreground decoration-foreground/30 hover:decoration-foreground text-[13px] underline underline-offset-4 transition-colors`,onClick:r,children:`Cancel`})})]})})}var Eb=`agent_decide`;function Db(e){return!!e.selectedOptionId?.trim()||!!e.text.trim()}var Ob=[`none`,`low`,`medium`,`high`,`xhigh`,`max`],kb=`gpt-5.6-sol`,Ab=`high`;function jb(e){return e.key===`Enter`&&!e.shiftKey&&!e.isComposing}function Mb(e){return e!==null&&Array.from(e.types).includes(`Files`)}var Nb=/(^|\s)@([^\s"@]*|"(?:[^"\\]|\\.)*)$/,Pb=/\\(["\\])/g,Fb=/[\\[\]`*_<>&~]/g,Ib=/[!'()*]/g;function Lb(e){return e.path+(e.kind===`directory`?`/`:``)}function Rb(e){return e.replace(Fb,e=>e===`&`?`&amp;`:`&#${e.charCodeAt(0)};`)}function zb(e){return encodeURIComponent(e).replace(Ib,e=>`%${e.charCodeAt(0).toString(16).toUpperCase()}`)}function Bb(e,t){if(t<0||t>e.length)return null;let n=e.slice(0,t).match(Nb);if(!n||n.index===void 0)return null;let r=n[2],i=r.startsWith(`"`);return{query:i?r.slice(1).replace(Pb,`$1`):r,quoted:i,start:n.index+n[1].length}}function Vb(e,t,n){let r=Bb(e,t);if(!r)return null;let i=t;if(r.quoted){for(;i<e.length&&e[i]!==`"`;)i+=e[i]===`\\`&&i+1<e.length?2:1;e[i]===`"`&&(i+=1)}else for(;i<e.length&&!/\s/.test(e[i]);)i+=1;e[i]===` `&&(i+=1);let a=Lb(n),o=`[${Rb(n.path.slice(n.path.lastIndexOf(`/`)+1))}](${a.split(`/`).map(zb).join(`/`)}) `;return{text:e.slice(0,r.start)+o+e.slice(i),caret:r.start+o.length}}var Hb=/(^|\s)\$([a-z0-9-]*)$/i;function Ub(e,t){if(t<0||t>e.length)return null;let n=e.slice(0,t).match(Hb);return!n||n.index===void 0?null:{query:n[2].toLowerCase(),tokenStart:n.index+n[1].length}}function Wb(e,t){return Ub(e,t)?.query??null}function Gb(e,t){let n=t.toLowerCase(),r=[],i=[];for(let t of e){let e=t.name.toLowerCase();e.startsWith(n)?r.push(t):n.length>0&&e.includes(n)&&i.push(t)}return r.sort((e,t)=>e.name.localeCompare(t.name)),i.sort((e,t)=>e.name.localeCompare(t.name)),[...r,...i]}function Kb(e,t,n){let r=Ub(e,t);if(!r)return null;let i=t;for(;i<e.length&&/[a-z0-9-]/i.test(e[i]??``);)i+=1;e[i]===` `&&(i+=1);let a=`$${n} `;return{text:`${e.slice(0,r.tokenStart)}${a}${e.slice(i)}`,caret:r.tokenStart+a.length}}var qb=`/api`,Jb=`Model catalog is unavailable.`;function Yb(e,t){return e.models.find(e=>e.id===t)}function Xb(e){return e.reasoningEfforts.length!==1||e.reasoningEfforts[0]!==`none`}function Zb(e,t){return e.models.filter(e=>t===`spikonado`||e.provider===`openai`).map(e=>({id:e.id,label:e.label,provider:e.provider}))}function Qb(e,t,n){let r=Zb(e,t);return r.some(e=>e.id===n)?n:r.some(t=>t.id===e.defaultModelId)?e.defaultModelId:r[0]?.id}function $b(e){switch(e){case`none`:return`None`;case`low`:return`Low`;case`medium`:return`Medium`;case`high`:return`High`;case`xhigh`:return`Extra High`;case`max`:return`Max`;default:return e}}var ex=kd({id:L().min(1),label:L().min(1),provider:L().min(1),supportsImages:vd(),contextWindowTokens:gd(),autoCompactTokenLimit:gd(),reasoningEfforts:Ed(L()).min(1),defaultReasoningEffort:L().min(1),serviceTiers:Ed(L()).min(1),usagePolicy:Vd(`unlimited`).optional()}),tx=Od({sprocket:Od({protocolVersion:gd(),catalogVersion:L().min(1),defaultModelId:L().min(1),defaultReasoningEffort:L().min(1),defaultServiceTier:L().min(1),models:Ed(ex).min(1)})});function nx(e){let t=e.sprocket;if(t.protocolVersion!==1)throw Error(`${Jb} Unsupported protocol version ${t.protocolVersion}.`);return{protocolVersion:t.protocolVersion,catalogVersion:t.catalogVersion,defaultModelId:t.defaultModelId,defaultReasoningEffort:t.defaultReasoningEffort,models:t.models.map(e=>({id:e.id,label:e.label,provider:e.provider,supportsImages:e.supportsImages,contextWindowTokens:e.contextWindowTokens,autoHandoffTokenLimit:e.autoCompactTokenLimit,reasoningEfforts:e.reasoningEfforts,defaultReasoningEffort:e.defaultReasoningEffort,supportsFastMode:e.serviceTiers.includes(`fast`),usagePolicy:e.usagePolicy}))}}async function rx(e){let t=e.replace(/\/+$/,``);if(!t)throw Error(Jb);let n=await fetch(`${t}${qb}/v1/models`,{headers:{accept:`application/json`}});if(!n.ok)throw Error(Jb);let r=tx.safeParse(await n.json());if(!r.success)throw Error(Jb);return nx(r.data)}function ix(e){let t=Math.floor(e/60),n=e%60;return t===0?`${n}s`:`${t}m ${n}s`}function ax(e){let t=Math.max(0,e),n=Math.ceil(t/36e5);if(n>=24){let e=Math.floor(n/24),t=n%24;return t>0?`${e}d ${t}h`:`${e}d`}return t>=36e5?`${n}h`:`${Math.max(1,Math.ceil(t/6e4))}m`}function ox(e){let t=Math.max(0,Math.floor(e/1e3)),n=Math.floor(t/86400),r=Math.floor(t%86400/3600),i=Math.floor(t%3600/60),a=t%60;return n>0?r>0?`${n}d ${r}h`:`${n}d`:r>0?i>0?`${r}h ${i}m`:`${r}h`:i>0?`${i}m ${a}s`:`${a}s`}function sx(){let[e,t]=(0,F.useState)(()=>Date.now());return(0,F.useEffect)(()=>{let e=setInterval(()=>t(Date.now()),6e4);return()=>clearInterval(e)},[]),e}function cx({question:e,options:t,selectedOptionId:n,onToggleOption:r}){return(0,R.jsxs)(`div`,{className:`mb-3`,role:`group`,"aria-label":`Agent question`,children:[(0,R.jsx)(`p`,{className:`text-foreground text-[14px] leading-6 font-medium`,children:e}),(0,R.jsx)(`ul`,{className:`mt-2 flex flex-col gap-1.5`,"aria-label":`Answer options`,children:t.map(e=>{let t=e.id===Eb,i=n===e.id;return(0,R.jsx)(`li`,{children:(0,R.jsx)(`button`,{type:`button`,className:`w-full rounded-lg border px-3 py-2 text-left text-[13px] leading-5 transition ${i?`border-foreground/40 bg-hover-fill-strong text-foreground`:t?`border-border/70 text-muted-foreground/80 hover:text-muted-foreground hover:bg-hover-fill`:`border-border text-muted-foreground hover:text-foreground hover:bg-hover-fill`}`,"aria-pressed":i,onClick:()=>r(e.id),children:e.label})},e.id)})})]})}function lx(e){let[t,n]=(0,F.useState)(Date.now);return(0,F.useEffect)(()=>{if(!e)return;n(Date.now());let t=setInterval(()=>n(Date.now()),1e3);return()=>clearInterval(t)},[e]),t}function ux(e,t){if(!(e===void 0||e<=0||t===void 0||!Number.isFinite(e)||!Number.isFinite(t)))return Math.max(0,Math.floor((t-e)/1e3))}function dx({startedAt:e}){let t=ux(e,lx(!0));return t===void 0?null:ix(t)}function fx(e,{userId:t,threadId:n}){let[r,i]=(0,F.useState)(null);(0,F.useEffect)(()=>{let r=new AbortController,a={api:e,controller:r,stopping:new Set},o;async function s(){try{let{commands:o}=await e.listRunningCommands({userId:t,threadId:n},r.signal);r.signal.aborted||i(e=>({lifetime:a,commands:o,refreshError:null,stopError:e?.lifetime===a&&o.some(t=>t.sessionId===e.stopError?.sessionId)?e.stopError:null,stopping:[...a.stopping]}))}catch{r.signal.aborted||i(e=>e?.lifetime===a?{...e,refreshError:`Unable to refresh running commands. Reconnecting…`}:null)}finally{r.signal.aborted||(o=setTimeout(s,1e3))}}return s(),()=>{r.abort(),clearTimeout(o)}},[e,t,n]);let a=r?.lifetime.api===e&&!r.lifetime.controller.signal.aborted?r:null;async function o(r){let o=a?.lifetime;if(!(!o||o.controller.signal.aborted||o.stopping.has(r))){o.stopping.add(r),i(e=>e?.lifetime===o?{...e,stopping:[...o.stopping],stopError:null}:e);try{await e.terminateCommand({userId:t,threadId:n,sessionId:r})}catch(e){o.controller.signal.aborted||i(t=>t?.lifetime===o?{...t,stopError:{sessionId:r,message:e instanceof Error?e.message:`Unable to stop command.`}}:t)}finally{o.stopping.delete(r),o.controller.signal.aborted||i(e=>e?.lifetime===o?{...e,stopping:[...o.stopping]}:e)}}}return{commands:a?.commands??[],error:a?.stopError?.message??a?.refreshError??null,stopping:a?.stopping??[],terminate:o}}function px({api:e,scope:t,collapseWhen:n=!1}){let{commands:r,stopping:i,error:a,terminate:o}=fx(e,t),[s,c]=(0,F.useState)(!1),[l,u]=(0,F.useState)(n),d=(0,F.useId)();return n!==l&&(u(n),n&&c(!1)),r.length===0?null:(0,R.jsx)(`section`,{"aria-label":`Running commands`,className:`mx-auto mb-3 w-full max-w-[48rem] shrink-0 px-4`,children:(0,R.jsxs)(`div`,{className:`border-hairline bg-surface overflow-hidden rounded-xl border`,children:[(0,R.jsxs)(`button`,{type:`button`,"aria-label":`Running commands`,"aria-expanded":s,"aria-controls":d,onClick:()=>c(e=>!e),className:`text-muted-foreground hover:bg-hover-fill focus-visible:ring-ring flex w-full items-center gap-2 px-3 py-2 text-left text-xs transition focus-visible:ring-2 focus-visible:outline-none focus-visible:ring-inset`,children:[(0,R.jsx)(Gg,{className:`size-3.5 shrink-0 transition-transform ${s?``:`-rotate-90`}`,"aria-hidden":`true`}),(0,R.jsx)(`span`,{className:`font-medium`,children:`Running commands`}),(0,R.jsx)(`span`,{className:`bg-muted rounded px-1.5 py-0.5 text-[10px] tabular-nums`,children:r.length})]}),(0,R.jsx)(`div`,{id:d,children:s&&(0,R.jsx)(`ul`,{className:`divide-hairline border-hairline max-h-40 divide-y overflow-y-auto border-t`,children:r.map(e=>(0,R.jsxs)(`li`,{className:`flex items-center gap-3 px-3 py-2`,children:[(0,R.jsx)(`span`,{className:`size-1.5 shrink-0 rounded-full bg-emerald-500`,"aria-hidden":`true`}),(0,R.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,R.jsx)(`p`,{className:`text-foreground truncate font-mono text-xs`,title:e.command,children:e.command}),(0,R.jsx)(`p`,{className:`text-muted-foreground mt-0.5 truncate text-[11px]`,title:e.workdir,children:e.workdir})]}),(0,R.jsx)(`button`,{type:`button`,"aria-label":`Stop command: ${e.command}`,title:`Stop command`,disabled:i.includes(e.sessionId),onClick:()=>void o(e.sessionId),className:`text-muted-foreground hover:bg-destructive/10 hover:text-destructive focus-visible:ring-ring flex size-8 shrink-0 items-center justify-center rounded-md transition focus-visible:ring-2 focus-visible:outline-none disabled:opacity-40`,children:(0,R.jsx)(Dv,{className:`size-3.5`,"aria-hidden":`true`})})]},e.sessionId))})}),a&&(0,R.jsx)(`p`,{role:`alert`,className:`text-destructive border-hairline border-t px-3 py-2 text-xs`,children:a})]})})}function mx(e){return(0,R.jsx)(px,{...e},`${e.scope.userId}:${e.scope.threadId}`)}function hx(e,t){let n=e??[],r=t??[];return n.length===r.length&&n.every((e,t)=>e===r[t])}var gx=new Set([`image/jpeg`,`image/png`,`image/gif`,`image/webp`]);function _x(e){return gx.has(e.toLowerCase())}function vx(e){let t=e.trim();return t.length>0?t:`application/octet-stream`}function yx(e){let t=e.name.trim();return t.length>0?t:`Attached file`}function bx(e){return e<1024?`${e} B`:e<1048576?`${Math.max(1,Math.round(e/1024))} KiB`:`${(e/1048576).toFixed(1).replace(/\.0$/,``)} MiB`}function xx(e){e?.startsWith(`blob:`)&&URL.revokeObjectURL(e)}function Sx(e){return!e.url&&_x(e.mediaType)}function Cx(e,t){let n=document.createElement(`a`);n.href=e,n.download=t,n.rel=`noopener`,document.body.append(n),n.click(),n.remove()}function wx({attachments:e,disabled:t,onRemove:n}){return(0,R.jsx)(`ul`,{className:`mb-3 flex max-h-36 flex-wrap items-center gap-2 overflow-y-auto`,"aria-label":`Attached files`,children:e.map(e=>{let r=_x(e.mediaType)&&!!e.previewUrl;return(0,R.jsxs)(`li`,{className:r?`group relative size-14 overflow-hidden rounded-xl border ${e.status===`error`?`border-rose-500/60`:`border-border`}`:`group relative flex h-14 max-w-56 items-center gap-2 overflow-hidden rounded-xl border pr-7 pl-2 ${e.status===`error`?`border-rose-500/60`:`border-border`}`,title:e.error??`${e.name} · ${bx(e.size)}`,children:[r?(0,R.jsx)(`img`,{src:e.previewUrl,alt:e.name,className:`size-full object-cover ${e.status===`uploading`?`opacity-50`:``}`}):(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(C_,{className:`text-muted-foreground size-4 shrink-0`,"aria-hidden":`true`}),(0,R.jsxs)(`span`,{className:`min-w-0 text-[12px] leading-4`,children:[(0,R.jsx)(`span`,{className:`text-foreground block truncate`,children:e.name}),(0,R.jsx)(`span`,{className:`text-muted-foreground block`,children:bx(e.size)})]})]}),e.status===`uploading`?(0,R.jsx)(`span`,{className:`absolute inset-0 flex items-center justify-center ${r?``:`bg-background/60`}`,role:`status`,"aria-label":`Uploading ${e.name}`,children:(0,R.jsx)(`span`,{className:`border-border border-t-foreground/80 size-3.5 animate-spin rounded-full border-2`})}):e.status===`error`?(0,R.jsx)(`span`,{className:`text-destructive absolute inset-x-0 bottom-0 bg-rose-950/80 px-1 py-0.5 text-center text-[9px] leading-3`,role:`alert`,children:`Failed`}):null,(0,R.jsx)(`button`,{type:`button`,className:`bg-foreground/70 text-background hover:bg-foreground/90 absolute top-1 right-1 flex size-4.5 cursor-pointer items-center justify-center rounded-full transition disabled:cursor-not-allowed disabled:opacity-40`,"aria-label":`Remove ${e.name}`,disabled:t,onClick:()=>n(e.localId),children:(0,R.jsx)(Fv,{className:`size-3`,"aria-hidden":`true`})})]},e.localId)})})}function Tx({loadState:e,skills:t,highlightedIndex:n,onRetry:r,onHighlight:i,onSelect:a}){let o=(0,F.useRef)([]);return(0,F.useEffect)(()=>{t.length>0&&o.current[n]?.scrollIntoView({block:`nearest`})},[t,n]),(0,R.jsx)(`div`,{className:`border-border bg-popover absolute inset-x-0 bottom-full z-30 mb-2 max-h-56 overflow-y-auto rounded-xl border py-1 shadow-2xl`,id:`composer-skills-listbox`,"aria-label":`Available skills`,role:e===`ready`&&t.length>0?`listbox`:`status`,children:e===`loading`?(0,R.jsx)(`p`,{className:`text-muted-foreground px-3 py-2 text-sm`,children:`Loading skills…`}):e===`error`?(0,R.jsxs)(`div`,{className:`flex items-center justify-between gap-3 px-3 py-2`,children:[(0,R.jsx)(`p`,{className:`text-muted-foreground text-sm`,children:`Couldn’t load skills`}),(0,R.jsx)(`button`,{type:`button`,className:`text-muted-foreground hover:text-foreground text-sm underline-offset-2 hover:underline`,onClick:r,children:`Retry`})]}):t.length===0?(0,R.jsx)(`p`,{className:`text-muted-foreground px-3 py-2 text-sm`,children:`No matching skills`}):t.map((e,t)=>(0,R.jsxs)(`button`,{ref:e=>{o.current[t]=e},type:`button`,id:`composer-skill-option-${t}`,className:`flex w-full flex-col gap-0.5 px-3 py-2 text-left transition ${n===t?`text-foreground bg-hover-fill-strong`:`text-muted-foreground hover:text-foreground hover:bg-hover-fill`}`,role:`option`,"aria-selected":n===t,onPointerEnter:()=>i(t),onClick:()=>a(e),children:[(0,R.jsxs)(`span`,{className:`text-sm font-medium`,children:[`$`,e.name]}),(0,R.jsx)(`span`,{className:`text-muted-foreground line-clamp-2 text-[12px]`,children:e.description})]},e.name))})}function Ex({loadState:e,entries:t,scanning:n,highlightedIndex:r,onRetry:i,onHighlight:a,onSelect:o}){let s=(0,F.useRef)([]);return(0,F.useEffect)(()=>{s.current[r]?.scrollIntoView({block:`nearest`})},[t,r]),(0,R.jsx)(`div`,{className:`border-border bg-popover absolute inset-x-0 bottom-full z-30 mb-2 max-h-56 overflow-y-auto rounded-xl border py-1 shadow-2xl`,id:`composer-paths-listbox`,"aria-label":`Workspace files and directories`,role:`listbox`,"aria-busy":e===`loading`||n,children:e===`unavailable`?(0,R.jsx)(`p`,{className:`text-muted-foreground px-3 py-2 text-sm`,role:`status`,children:`Select a workspace and connect its server to tag files.`}):e===`error`?(0,R.jsxs)(`div`,{className:`flex items-center justify-between gap-3 px-3 py-2`,children:[(0,R.jsx)(`p`,{className:`text-muted-foreground text-sm`,role:`status`,children:`Couldn't search workspace files`}),(0,R.jsx)(`button`,{type:`button`,className:`text-sm hover:underline`,onClick:i,children:`Retry`})]}):e===`loading`||n&&t.length===0?(0,R.jsx)(`p`,{className:`text-muted-foreground px-3 py-2 text-sm`,role:`status`,children:`Searching workspace files...`}):t.length===0?(0,R.jsx)(`p`,{className:`text-muted-foreground px-3 py-2 text-sm`,role:`status`,children:`No matching files or directories`}):t.map((e,t)=>{let n=e.kind===`directory`?k_:T_;return(0,R.jsxs)(`button`,{ref:e=>{s.current[t]=e},type:`button`,id:`composer-path-option-${t}`,className:`flex w-full items-center gap-2 px-3 py-2 text-left text-sm transition ${r===t?`text-foreground bg-hover-fill-strong`:`text-muted-foreground hover:text-foreground hover:bg-hover-fill`}`,role:`option`,"aria-selected":r===t,onPointerEnter:()=>a(t),onMouseDown:e=>e.preventDefault(),onClick:()=>o(e),children:[(0,R.jsx)(n,{className:`size-4 shrink-0`,"aria-hidden":`true`}),(0,R.jsx)(`span`,{className:`break-all`,children:Lb(e)})]},`${e.kind}:${e.path}`)})})}function Dx({title:e,children:t,tone:n=`warning`,action:r}){return(0,R.jsxs)(`div`,{className:`flex items-start gap-2.5 rounded-xl border px-3.5 py-3 ${n===`error`?`border-rose-500/25 bg-rose-500/10 text-rose-800 dark:text-rose-200`:`border-amber-500/25 bg-amber-500/10 text-amber-800 dark:text-amber-200`}`,role:n===`status`?`status`:`alert`,children:[(0,R.jsx)(Yg,{className:`mt-0.5 size-4 shrink-0`,"aria-hidden":`true`}),(0,R.jsxs)(`div`,{className:`min-w-0 flex-1 [overflow-wrap:anywhere]`,children:[(0,R.jsx)(`p`,{className:`text-[13px] leading-5 font-medium`,children:e}),(0,R.jsx)(`div`,{className:`text-[12.5px] leading-5 opacity-90`,children:t}),r?(0,R.jsx)(`div`,{className:`mt-2`,children:r}):null]})]})}function Ox(e,t){let[n,r]=(0,F.useState)(null),[i,a]=(0,F.useState)(0);(0,F.useEffect)(()=>{if(!e||t===null)return;let n=new AbortController,i;async function a(){if(e&&t!==null)try{let o=await e.search(t,n.signal);if(n.signal.aborted)return;r({source:e,query:t,result:o,error:!1}),o.scanning&&(i=setTimeout(a,250))}catch{n.signal.aborted||r({source:e,query:t,result:null,error:!0})}}return i=setTimeout(a,100),()=>{n.abort(),clearTimeout(i)}},[e,t,i]);let o=n?.source===e&&n.query===t?n:null;return{loadState:e?o?.error?`error`:o?.result?`ready`:`loading`:`unavailable`,entries:o?.result?.entries??[],scanning:o?.result?.scanning??!1,retry:()=>{r(null),a(e=>e+1)}}}function kx(e){function t(t){let n=t.target;n instanceof Node&&(e.getRoot()?.contains(n)||e.onOutside())}function n(t){t.key===`Escape`&&e.onEscape()}return document.addEventListener(`pointerdown`,t),document.addEventListener(`keydown`,n),()=>{document.removeEventListener(`pointerdown`,t),document.removeEventListener(`keydown`,n)}}function Ax({title:e,onDismiss:t,children:n,footer:r,returnFocusRef:i}){let a=(0,F.useRef)(null);return(0,F.useEffect)(()=>{let e=a.current,t=i.current;return e?.showModal(),()=>{e?.close(),t?.focus()}},[i]),(0,R.jsx)(`dialog`,{ref:a,"aria-label":e,className:`bg-popover text-foreground fixed inset-x-0 top-auto bottom-0 m-0 max-h-[85dvh] w-full max-w-none overflow-hidden rounded-t-[28px] border border-[var(--hairline)] p-0 shadow-2xl backdrop:bg-black/45 backdrop:backdrop-blur-sm`,onCancel:e=>{e.preventDefault(),t()},onClick:e=>{if(e.target!==e.currentTarget)return;let n=e.currentTarget.getBoundingClientRect();(e.clientY<n.top||e.clientY>n.bottom)&&t()},children:(0,R.jsxs)(`div`,{className:`flex max-h-[85dvh] flex-col pb-[max(1rem,env(safe-area-inset-bottom))]`,children:[(0,R.jsx)(`div`,{className:`bg-muted-foreground/25 mx-auto mt-3 h-1 w-9 shrink-0 rounded-full`,"aria-hidden":`true`}),(0,R.jsxs)(`header`,{className:`flex shrink-0 items-center justify-between px-5 py-2`,children:[(0,R.jsx)(`h2`,{className:`text-lg font-semibold`,children:e}),(0,R.jsx)(`button`,{type:`button`,className:`text-muted-foreground hover:bg-hover-fill focus-visible:ring-ring flex size-11 items-center justify-center rounded-full outline-none focus-visible:ring-2`,"aria-label":`Close ${e.toLocaleLowerCase()}`,onClick:t,children:(0,R.jsx)(Fv,{className:`size-5`})})]}),(0,R.jsx)(`div`,{className:`min-h-0 overflow-y-auto overscroll-contain px-4`,children:n}),r?(0,R.jsx)(`footer`,{className:`shrink-0 border-t border-[var(--hairline)] px-5 pt-4`,children:r}):null]})})}function jx(){let[e,t]=(0,F.useState)(()=>window.matchMedia?.(`(max-width: 639px)`).matches??!1);return(0,F.useEffect)(()=>{let e=window.matchMedia?.(`(max-width: 639px)`);if(!e)return;function n(){t(e.matches)}return n(),e.addEventListener?.(`change`,n),()=>e.removeEventListener?.(`change`,n)},[]),e}function Mx({value:e,options:t,ariaLabel:n,menuTitle:r,disabled:i=!1,className:a=``,triggerClassName:o=``,searchable:s=!1,compactOnMobile:c=!1,onValueChange:l,optionIcon:u}){let[d,f]=(0,F.useState)(!1),p=jx(),m=c&&p,[h,g]=(0,F.useState)(``),_=(0,F.useRef)(null),v=(0,F.useRef)(null),y=(0,F.useRef)(null),b=(0,F.useRef)(null),[x,S]=(0,F.useState)({left:0,bottom:0,maxHeight:0}),C=t.find(t=>t.id===e)??t[0]??null,w=s&&h.trim()?t.filter(e=>e.label.toLocaleLowerCase().includes(h.trim().toLocaleLowerCase())):t;function T(){if(i)return;let e=!d;f(e),e&&s?queueMicrotask(()=>y.current?.focus()):g(``)}function E(n){t.find(e=>e.id===n)&&(n!==e&&l?.(n),f(!1),g(``),v.current?.focus())}function D(e){e.key!==`Enter`||e.nativeEvent.isComposing||w.length!==0&&(e.preventDefault(),E(w[0].id))}return(0,F.useLayoutEffect)(()=>{if(!d||!c||m)return;function e(){let e=v.current?.getBoundingClientRect(),t=b.current?.getBoundingClientRect();e&&t&&S({left:Math.max(8,Math.min(e.left,window.innerWidth-t.width-8)),bottom:window.innerHeight-e.top+12,maxHeight:Math.max(0,e.top-20)})}return e(),window.addEventListener(`resize`,e),window.addEventListener(`scroll`,e,!0),()=>{window.removeEventListener(`resize`,e),window.removeEventListener(`scroll`,e,!0)}},[d,c,m]),(0,F.useEffect)(()=>{if(!d){g(``);return}if(!m)return kx({getRoot:()=>_.current,onOutside:()=>{f(!1)},onEscape:()=>{f(!1),v.current?.focus()}})},[d,m]),(0,F.useEffect)(()=>{i&&f(!1)},[i]),(0,R.jsxs)(`div`,{ref:_,className:pb(`relative`,a),children:[(0,R.jsxs)(`button`,{ref:v,type:`button`,className:pb(`focus-visible:ring-ring/60 text-muted-foreground hover:bg-hover-fill inline-flex h-8 shrink-0 items-center gap-2 rounded-lg border border-transparent bg-transparent px-2 text-sm font-medium transition outline-none focus-visible:ring-2 disabled:pointer-events-none disabled:opacity-50`,!u&&`gap-1`,o),"aria-haspopup":`dialog`,"aria-expanded":d,"aria-label":n,title:c?C?.label??e:void 0,disabled:i,onClick:T,children:[u&&C?u(C):null,(0,R.jsx)(`span`,{className:pb(`truncate`,c&&`hidden sm:inline`),children:C?.triggerLabel??C?.label??e}),(0,R.jsx)(Gg,{className:pb(`text-muted-foreground size-3 shrink-0 transition-transform`,d&&`rotate-180`)})]}),d&&m?(0,R.jsx)(Ax,{title:r,onDismiss:()=>f(!1),returnFocusRef:v,children:(0,R.jsx)(`div`,{className:`space-y-1 pb-2`,children:t.map(t=>(0,R.jsxs)(`button`,{type:`button`,"aria-label":t.label,"aria-pressed":t.id===e,className:pb(`focus-visible:ring-ring flex min-h-16 w-full items-center gap-3 rounded-2xl px-4 py-3 text-left outline-none focus-visible:ring-2`,t.id===e?`bg-hover-fill`:`hover:bg-hover-fill`),onClick:()=>E(t.id),children:[u?(0,R.jsx)(`span`,{className:`flex size-6 shrink-0 items-center justify-center`,children:u(t)}):null,(0,R.jsx)(`span`,{className:`min-w-0 flex-1 text-[15px] font-medium`,children:t.label}),t.id===e?(0,R.jsx)(Ug,{className:`text-accent-strong size-5 shrink-0`}):null]},t.id))})}):d?(0,R.jsxs)(`div`,{ref:b,className:pb(`bg-popover/96 z-50 rounded-[18px] border border-[var(--hairline)] p-2 shadow-[var(--composer-shadow)] backdrop-blur-xl`,c?`fixed w-[min(19rem,calc(100vw-1rem))] overflow-y-auto`:`absolute bottom-[calc(100%+0.75rem)] left-0 min-w-[19rem]`),style:c?x:void 0,role:`dialog`,"aria-label":r,children:[s?(0,R.jsxs)(`label`,{className:`text-muted-foreground flex h-10 items-center gap-2 border-b border-[var(--hairline)] px-2`,children:[(0,R.jsx)(lv,{className:`size-4 shrink-0`}),(0,R.jsxs)(`span`,{className:`sr-only`,children:[`Search `,r.toLocaleLowerCase()]}),(0,R.jsx)(`input`,{ref:y,value:h,onChange:e=>g(e.target.value),className:`text-foreground placeholder:text-muted-foreground min-w-0 flex-1 bg-transparent text-sm outline-none`,placeholder:`Search ${r.toLocaleLowerCase()}…`,onKeyDown:D})]}):(0,R.jsx)(`p`,{className:`text-muted-foreground px-3 pt-1 pb-2 text-[11px] font-medium`,children:r}),(0,R.jsxs)(`div`,{className:pb(`space-y-0.5`,s&&`pt-1.5`),children:[w.map(t=>(0,R.jsxs)(`button`,{type:`button`,className:pb(`focus-visible:ring-ring/60 hover:bg-hover-fill flex w-full items-center gap-3 rounded-xl px-3 py-2.5 text-left outline-none focus-visible:ring-2`,t.id===e&&`bg-hover-fill`),"aria-pressed":t.id===e,onClick:()=>{E(t.id)},children:[u?(0,R.jsx)(`span`,{className:pb(`flex size-7 shrink-0 items-center justify-center`,`text-muted-foreground`),children:u(t)}):null,(0,R.jsx)(`span`,{className:`text-foreground min-w-0 flex-1 truncate text-sm font-medium`,children:t.label}),(0,R.jsx)(Ug,{className:pb(`text-accent-strong size-4 shrink-0 transition-opacity`,t.id===e?`opacity-100`:`opacity-0`)})]},t.id)),w.length===0?(0,R.jsx)(`p`,{className:`text-muted-foreground px-3 py-5 text-center text-sm`,children:`No matches found`}):null]})]}):null]})}function Nx({className:e=``,title:t=`OpenAI`}){return(0,R.jsxs)(`svg`,{viewBox:`146.694 227.042 267.198 264.812`,xmlns:`http://www.w3.org/2000/svg`,className:pb(`size-4`,e),role:`img`,"aria-hidden":!t||void 0,fill:`none`,children:[t?(0,R.jsx)(`title`,{children:t}):null,(0,R.jsx)(`path`,{d:`M249.176 323.434V298.276C249.176 296.158 249.971 294.569 251.825 293.509L302.406 264.381C309.29 260.409 317.5 258.555 325.973 258.555C357.75 258.555 377.877 283.185 377.877 309.399C377.877 311.253 377.877 313.371 377.611 315.49L325.178 284.771C322.001 282.919 318.822 282.919 315.645 284.771L249.176 323.434ZM367.283 421.415V361.301C367.283 357.592 365.694 354.945 362.516 353.092L296.048 314.43L317.763 301.982C319.617 300.925 321.206 300.925 323.058 301.982L373.639 331.112C388.205 339.586 398.003 357.592 398.003 375.069C398.003 395.195 386.087 413.733 367.283 421.412V421.415ZM233.553 368.452L211.838 355.742C209.986 354.684 209.19 353.095 209.19 350.975V292.718C209.19 264.383 230.905 242.932 260.301 242.932C271.423 242.932 281.748 246.641 290.49 253.26L238.321 283.449C235.146 285.303 233.555 287.951 233.555 291.659V368.455L233.553 368.452ZM280.292 395.462L249.176 377.985V340.913L280.292 323.436L311.407 340.913V377.985L280.292 395.462ZM300.286 475.968C289.163 475.968 278.837 472.259 270.097 465.64L322.264 435.449C325.441 433.597 327.03 430.949 327.03 427.239V350.445L349.011 363.155C350.865 364.213 351.66 365.802 351.66 367.922V426.179C351.66 454.514 329.679 475.965 300.286 475.965V475.968ZM237.525 416.915L186.944 387.785C172.378 379.31 162.582 361.305 162.582 343.827C162.582 323.436 174.763 305.164 193.563 297.485V357.861C193.563 361.571 195.154 364.217 198.33 366.071L264.535 404.467L242.82 416.915C240.967 417.972 239.377 417.972 237.525 416.915ZM234.614 460.343C204.689 460.343 182.71 437.833 182.71 410.028C182.71 407.91 182.976 405.792 183.238 403.672L235.405 433.863C238.582 435.715 241.763 435.715 244.938 433.863L311.407 395.466V420.622C311.407 422.742 310.612 424.331 308.758 425.389L258.179 454.519C251.293 458.491 243.083 460.343 234.611 460.343H234.614ZM300.286 491.854C332.329 491.854 359.073 469.082 365.167 438.892C394.825 431.211 413.892 403.406 413.892 375.073C413.892 356.535 405.948 338.529 391.648 325.552C392.972 319.991 393.766 314.43 393.766 308.87C393.766 271.003 363.048 242.666 327.562 242.666C320.413 242.666 313.528 243.723 306.644 246.109C294.725 234.457 278.307 227.042 260.301 227.042C228.258 227.042 201.513 249.815 195.42 280.004C165.761 287.685 146.694 315.49 146.694 343.824C146.694 362.362 154.638 380.368 168.938 393.344C167.613 398.906 166.819 404.467 166.819 410.027C166.819 447.894 197.538 476.231 233.024 476.231C240.172 476.231 247.058 475.173 253.943 472.788C265.859 484.441 282.278 491.854 300.286 491.854Z`,fill:`currentColor`})]})}function Px({provider:e,className:t=``}){return e===`spikonado`?(0,R.jsx)(`img`,{src:`/logo.png`,alt:``,className:pb(`size-4 shrink-0`,t)}):e===`openai`||e===`chatgpt`?(0,R.jsx)(Nx,{className:pb(`text-foreground size-4`,t)}):e===`anthropic`?(0,R.jsx)(`svg`,{viewBox:`0 0 24 24`,className:pb(`size-4 text-[#D97757]`,t),role:`img`,"aria-label":`Anthropic`,fill:`currentColor`,children:(0,R.jsx)(`path`,{d:`M17.304 3.541h-3.672l6.696 16.918H24Zm-10.608 0L0 20.459h3.744l1.37-3.553h7.005l1.369 3.553h3.744L10.536 3.541Zm-.371 10.223 2.291-5.945 2.292 5.945Z`})}):e===`xai`?(0,R.jsx)(`svg`,{viewBox:`0 0 24 24`,className:pb(`text-foreground size-4`,t),role:`img`,"aria-label":`xAI`,fill:`currentColor`,children:(0,R.jsx)(`path`,{d:`M6.469 8.776 16.512 23h-4.464L2.005 8.776H6.47Zm-.004 7.9 2.233 3.164L6.467 23H2l4.465-6.324ZM22 2.582V23h-3.659V7.764L22 2.582ZM22 1l-9.952 14.095-2.233-3.163L17.533 1H22Z`})}):e===`zai`?(0,R.jsx)(`svg`,{viewBox:`0 0 24 24`,className:pb(`text-foreground size-4`,t),role:`img`,"aria-label":`Z.AI`,fill:`currentColor`,children:(0,R.jsx)(`path`,{d:`M12.606 1.806l-1.677 2.388c-0.258 0.374-0.697 0.606-1.161 0.606h-9.162V1.794C0.594 1.806 12.606 1.806 12.606 1.806zM24 1.806L9.6 22.206 0 22.206 14.4 1.806zM11.394 22.206l1.69-2.4c0.258-0.374 0.697-0.606 1.161-0.606h9.149v3.006H11.394z`})}):e===`deepseek`?(0,R.jsx)(`svg`,{viewBox:`0 0 24 24`,className:pb(`size-4 text-[#4D6BFE]`,t),role:`img`,"aria-label":`DeepSeek`,fill:`currentColor`,children:(0,R.jsx)(`path`,{d:`M23.748 4.651c-.254-.124-.364.113-.512.233-.051.04-.094.09-.137.137-.372.397-.806.657-1.373.626-.829-.046-1.537.214-2.163.848-.133-.782-.575-1.248-1.247-1.548-.352-.155-.708-.311-.955-.65-.172-.24-.219-.509-.305-.774-.055-.16-.11-.323-.293-.35-.2-.031-.278.136-.356.276-.313.572-.434 1.202-.422 1.84.027 1.436.633 2.58 1.838 3.393.137.094.172.187.129.323-.082.28-.18.553-.266.833-.055.179-.137.218-.328.14a5.5 5.5 0 0 1-1.737-1.179c-.857-.828-1.631-1.743-2.597-2.46a12 12 0 0 0-.689-.47c-.985-.957.13-1.743.387-1.836.27-.098.094-.433-.778-.428-.872.003-1.67.295-2.687.685a3 3 0 0 1-.465.136 9.6 9.6 0 0 0-2.883-.101c-1.885.21-3.39 1.1-4.497 2.622C.082 8.776-.231 10.854.152 13.02c.403 2.284 1.568 4.175 3.36 5.653 1.857 1.533 3.997 2.284 6.438 2.14 1.482-.085 3.132-.284 4.994-1.86.47.234.962.328 1.78.398.629.058 1.235-.031 1.705-.129.735-.155.684-.836.418-.961-2.155-1.004-1.682-.595-2.112-.926 1.095-1.295 2.768-3.598 3.284-6.733.05-.346.115-.834.108-1.114-.004-.171.035-.238.23-.257a4.2 4.2 0 0 0 1.545-.475c1.397-.763 1.96-2.016 2.093-3.517.02-.23-.004-.467-.247-.588M11.58 18.168c-2.088-1.642-3.101-2.183-3.52-2.16-.39.024-.32.472-.234.763.09.288.207.487.371.74.114.167.192.416-.113.603-.673.416-1.842-.14-1.897-.168-1.361-.801-2.5-1.86-3.301-3.306-.775-1.393-1.225-2.888-1.299-4.482-.02-.385.094-.522.477-.592a4.7 4.7 0 0 1 1.53-.038c2.131.311 3.946 1.264 5.467 2.774.868.86 1.525 1.887 2.202 2.89.72 1.066 1.494 2.082 2.48 2.915.348.291.626.513.892.677-.802.09-2.14.109-3.055-.615zm1.001-6.44a.306.306 0 0 1 .415-.287.3.3 0 0 1 .113.074.3.3 0 0 1 .086.214c0 .17-.136.307-.308.307a.303.303 0 0 1-.306-.307m3.11 1.596c-.2.081-.4.151-.591.16a1.25 1.25 0 0 1-.798-.254c-.274-.23-.47-.358-.551-.758a1.7 1.7 0 0 1 .015-.588c.07-.327-.007-.537-.238-.727-.188-.156-.426-.199-.689-.199a.6.6 0 0 1-.254-.078.253.253 0 0 1-.114-.358 1 1 0 0 1 .192-.21c.356-.202.767-.136 1.146.016.352.144.618.408 1.001.782.392.451.462.576.685.915.176.264.336.536.446.848.066.194-.02.353-.25.45`})}):e===`kimi`||e===`moonshotai`?(0,R.jsx)(`svg`,{viewBox:`0 0 465 465`,className:pb(`text-foreground size-4`,t),role:`img`,"aria-label":`Moonshot AI`,fill:`currentColor`,children:(0,R.jsx)(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M418.766 93.78C388.626 53.17 345.086 22.07 292.446 7.97C239.806 -6.13 186.536 -0.97 140.136 19.13L418.766 93.78ZM40.7758 100.85C61.3758 70.84 88.5858 46.43 119.776 29.15L325.036 84.15C311.566 91.92 297.136 105.31 285.966 120.03L454.736 165.25C459.526 181.08 462.646 197.49 463.956 214.24L40.7758 100.85ZM456.686 292.45C454.306 301.35 451.436 309.99 448.116 318.34L2.44584 198.93C3.74584 190.03 5.58584 181.12 7.96584 172.22C13.5658 151.31 21.8458 131.84 32.3458 114.08L250.436 172.52C241.706 185 233.756 198.56 226.756 213.07L460.516 275.71C459.446 281.3 458.166 286.88 456.676 292.47L456.686 292.45ZM13.4858 310.23C2.67584 279.96 -1.93416 247.22 0.745843 213.95L206.426 269.06C204.946 273.74 203.556 278.48 202.266 283.29C199.646 293.08 197.506 302.85 195.846 312.55L417.946 372.06C407.606 385.79 395.826 398.23 382.896 409.21L13.4858 310.23ZM172.206 456.69C102.096 437.9 48.1158 388.98 20.4758 327.59L187.846 372.44C187.576 388.05 188.546 403.26 190.676 417.85L312.286 450.43C268.876 466.39 220.286 469.57 172.206 456.69Z`})}):(0,R.jsxs)(`svg`,{viewBox:`0 0 24 24`,className:pb(`text-muted-foreground size-4`,t),role:`img`,"aria-label":e||`Unknown provider`,fill:`none`,stroke:`currentColor`,strokeWidth:1.5,children:[(0,R.jsx)(`circle`,{cx:`12`,cy:`12`,r:`9`}),(0,R.jsx)(`path`,{d:`M12 8v4l2.5 1.5`,strokeLinecap:`round`,strokeLinejoin:`round`})]})}function Fx({model:e,reasoningEffort:t,onSelect:n}){return e.reasoningEfforts.map(r=>(0,R.jsxs)(`button`,{type:`button`,className:`focus-visible:ring-ring/60 text-foreground hover:bg-hover-fill flex w-full items-center gap-2 rounded-xl px-3 py-2.5 text-left text-sm outline-none focus-visible:ring-2`,"aria-label":`${$b(r)}${r===e.defaultReasoningEffort?` (default)`:``}`,"aria-pressed":r===t,"data-default-reasoning":r===e.defaultReasoningEffort?``:void 0,title:r===e.defaultReasoningEffort?`Default reasoning`:void 0,onClick:()=>n(r),onKeyDown:e=>{if(e.key===`ArrowDown`||e.key===`ArrowUp`){e.preventDefault();let t=Array.from(e.currentTarget.parentElement?.querySelectorAll(`button`)??[]);t[(t.indexOf(e.currentTarget)+(e.key===`ArrowDown`?1:-1)+t.length)%t.length]?.focus()}},children:[(0,R.jsx)(`span`,{className:`min-w-0 flex-1`,children:$b(r)}),r===e.defaultReasoningEffort?(0,R.jsx)(`span`,{className:`text-muted-foreground shrink-0 text-xs`,children:`Default`}):null,r===t?(0,R.jsx)(Ug,{className:`text-accent-strong size-3 shrink-0`}):null]},r))}function Ix({models:e,modelId:t,reasoningEffort:n,fastMode:r,allowsFastMode:i,onApply:a,onDismiss:o,returnFocusRef:s}){let[c,l]=(0,F.useState)(t),[u,d]=(0,F.useState)(n),[f,p]=(0,F.useState)(r),m=e.find(e=>e.id===c)??e[0],h=i&&m?.supportsFastMode;return(0,R.jsxs)(Ax,{title:`Model settings`,onDismiss:o,returnFocusRef:s,footer:(0,R.jsx)(`button`,{type:`button`,className:`bg-primary text-primary-foreground focus-visible:ring-ring h-12 w-full rounded-2xl text-base font-semibold outline-none focus-visible:ring-2 disabled:opacity-40`,disabled:!m,onClick:()=>{m&&a(m,u,!!(h&&f))},children:`Done`}),children:[(0,R.jsx)(`div`,{role:`group`,"aria-label":`Models`,className:`space-y-1 pb-4`,children:e.map(e=>(0,R.jsxs)(`button`,{type:`button`,"aria-pressed":e.id===m?.id,className:pb(`focus-visible:ring-ring flex min-h-14 w-full items-center gap-3 rounded-2xl px-4 py-3 text-left outline-none focus-visible:ring-2`,e.id===m?.id?`bg-hover-fill`:`hover:bg-hover-fill`),onClick:()=>{e.id!==m?.id&&(l(e.id),d(e.defaultReasoningEffort),e.supportsFastMode||p(!1))},children:[(0,R.jsx)(Px,{provider:e.provider,className:`size-5 shrink-0`}),(0,R.jsx)(`span`,{className:`min-w-0 flex-1 text-[15px] leading-5 font-medium`,children:e.label}),e.id===m?.id?(0,R.jsx)(Ug,{className:`text-accent-strong size-5 shrink-0`}):null]},e.id))}),m&&Xb(m)?(0,R.jsxs)(`div`,{role:`group`,"aria-label":`Reasoning for ${m.label}`,className:`border-t border-[var(--hairline)] px-1 py-4`,children:[(0,R.jsxs)(`div`,{className:`mb-3 flex items-center justify-between gap-3`,children:[(0,R.jsx)(`h3`,{className:`text-sm font-semibold`,children:`Reasoning`}),(0,R.jsxs)(`span`,{className:`text-muted-foreground text-xs`,children:[`Default: `,$b(m.defaultReasoningEffort)]})]}),(0,R.jsx)(`div`,{className:`grid grid-cols-3 gap-2`,children:m.reasoningEfforts.map(e=>(0,R.jsx)(`button`,{type:`button`,"aria-label":$b(e),"aria-pressed":e===u,className:pb(`focus-visible:ring-ring flex min-h-11 items-center justify-center rounded-xl border px-2 py-2 text-sm outline-none focus-visible:ring-2`,e===u?`border-accent-strong bg-accent/15`:`hover:bg-hover-fill border-[var(--hairline)]`),onClick:()=>d(e),children:(0,R.jsx)(`span`,{children:$b(e)})},e))})]}):null,h?(0,R.jsxs)(`button`,{type:`button`,role:`switch`,"aria-checked":f,"aria-label":`Fast mode`,className:`focus-visible:ring-ring flex min-h-14 w-full items-center gap-3 border-t border-[var(--hairline)] px-1 py-4 text-left outline-none focus-visible:ring-2`,onClick:()=>p(!f),children:[(0,R.jsx)(Lv,{className:`size-5 shrink-0 text-amber-500`}),(0,R.jsx)(`span`,{className:`flex-1 text-sm font-semibold`,children:`Fast mode`}),(0,R.jsx)(`span`,{className:pb(`inline-flex h-6 w-11 shrink-0 items-center rounded-full p-0.5`,f?`bg-accent-strong`:`bg-hover-fill-strong`),"aria-hidden":`true`,children:(0,R.jsx)(`span`,{className:pb(`bg-background size-5 rounded-full transition-transform`,f&&`translate-x-5`)})})]}):null]})}function Lx({models:e,modelId:t,reasoningEffort:n,fastMode:r,allowsFastMode:i,disabled:a,onSelect:o,onFastModeChange:s}){let[c,l]=(0,F.useState)(!1),u=jx(),[d,f]=(0,F.useState)(null),[p,m]=(0,F.useState)({left:0,bottom:0,maxHeight:0}),[h,g]=(0,F.useState)(0),_=(0,F.useRef)(null),v=(0,F.useRef)(null),y=(0,F.useRef)(null),b=(0,F.useRef)(new Map),x=(0,F.useRef)(null),S=(0,F.useRef)(!1),C=e.find(e=>e.id===t),w=i&&C?.supportsFastMode,T=e.find(e=>e.id===d),E=[C&&Xb(C)?$b(n):null,w&&r?`Fast`:null].filter(Boolean).join(` · `);function D(){l(!1),f(null)}function ee(e,t=e.defaultReasoningEffort){o(e.id,t),D(),v.current?.focus()}function O(t){let n=e[(t+e.length)%e.length];n&&b.current.get(n.id)?.focus()}return(0,F.useLayoutEffect)(()=>{if(!c||u)return;function e(){let e=v.current?.getBoundingClientRect(),t=y.current?.getBoundingClientRect();if(!e||!t)return;m({left:Math.max(8,Math.min(e.left,window.innerWidth-t.width-8)),bottom:window.innerHeight-e.top+12,maxHeight:Math.max(0,e.top-20)});let n=d?b.current.get(d)?.getBoundingClientRect():null,r=x.current,i=r?.querySelector(`[data-default-reasoning]`);if(!n||!r||!i)return;let a=e.top-12-t.height,o=n.top-t.top+n.height/2-i.offsetTop-i.offsetHeight/2;g(Math.max(8-a,Math.min(o,window.innerHeight-a-r.offsetHeight-8)))}return e(),window.addEventListener(`resize`,e),window.addEventListener(`scroll`,e,!0),()=>{window.removeEventListener(`resize`,e),window.removeEventListener(`scroll`,e,!0)}},[c,u,d,w,p.maxHeight]),(0,F.useEffect)(()=>{if(c&&!u)return(b.current.get(t)??b.current.values().next().value)?.focus(),kx({getRoot:()=>_.current,onOutside:D,onEscape:()=>{D(),v.current?.focus()}})},[c,u,t]),(0,F.useEffect)(()=>{a&&D()},[a]),(0,R.jsxs)(`div`,{ref:_,className:pb(`relative min-w-0 flex-1 sm:flex-none`,c?`z-30`:`z-20`),children:[(0,R.jsxs)(`button`,{ref:v,type:`button`,className:`text-foreground focus-visible:ring-ring/60 inline-flex h-11 max-w-full items-center gap-2 rounded-lg px-2 text-[15px] outline-none focus-visible:ring-2 disabled:pointer-events-none disabled:opacity-50 sm:h-9`,"aria-label":`Select model`,title:[C?.label??t,E].filter(Boolean).join(` · `),"aria-haspopup":`dialog`,"aria-expanded":c,disabled:a,onClick:()=>c?D():l(!0),children:[C?(0,R.jsx)(Px,{provider:C.provider,className:`size-4 shrink-0`}):null,(0,R.jsxs)(`span`,{className:`truncate`,children:[C?.label??t,E?(0,R.jsxs)(`span`,{className:`hidden sm:inline`,children:[` · `,E]}):null]}),(0,R.jsx)(Gg,{className:pb(`text-muted-foreground size-3 shrink-0`,c&&`rotate-180`)})]}),c&&u?(0,R.jsx)(Ix,{models:e,modelId:t,reasoningEffort:n,fastMode:r,allowsFastMode:i,onDismiss:D,returnFocusRef:v,onApply:(e,t,n)=>{ee(e,t),s?.(n)}}):c?(0,R.jsxs)(`div`,{ref:y,role:`dialog`,"aria-label":`Model`,className:`fixed z-50 flex w-[min(19rem,calc(100vw-1rem))] flex-col gap-1 overflow-y-auto sm:block sm:w-[30.75rem] sm:overflow-visible`,style:p,children:[(0,R.jsxs)(`div`,{className:`bg-popover/96 flex min-h-0 shrink-0 flex-col overflow-hidden rounded-[18px] border border-[var(--hairline)] p-2 shadow-[var(--composer-shadow)] backdrop-blur-xl sm:w-[19rem]`,style:{maxHeight:p.maxHeight},children:[(0,R.jsx)(`div`,{role:`group`,"aria-label":`Models`,className:`min-h-0 space-y-0.5 overflow-y-auto`,children:e.map((e,n)=>(0,R.jsxs)(`button`,{ref:t=>{t?b.current.set(e.id,t):b.current.delete(e.id)},type:`button`,"aria-label":e.label,"aria-pressed":e.id===t,"aria-haspopup":Xb(e)?`true`:void 0,className:pb(`text-foreground focus-visible:ring-ring/60 hover:bg-hover-fill flex w-full items-center gap-3 rounded-xl px-3 py-2.5 text-left text-sm outline-none focus-visible:ring-2`,e.id===d&&`bg-hover-fill`),onMouseEnter:()=>f(e.id),onFocus:()=>f(e.id),onPointerDown:t=>{S.current=t.pointerType===`touch`&&Xb(e)&&d!==e.id},onClick:()=>{if(S.current){S.current=!1,f(e.id);return}ee(e)},onKeyDown:t=>{t.key===`ArrowDown`||t.key===`ArrowUp`?(t.preventDefault(),O(n+(t.key===`ArrowDown`?1:-1))):t.key===`ArrowRight`&&Xb(e)&&(t.preventDefault(),x.current?.querySelector(`[data-default-reasoning]`)?.focus())},children:[(0,R.jsx)(Px,{provider:e.provider,className:`size-4 shrink-0`}),(0,R.jsx)(`span`,{className:`min-w-0 flex-1 truncate font-medium`,children:e.label}),e.id===t?(0,R.jsx)(Ug,{className:`text-accent-strong size-3.5 shrink-0`}):null,Xb(e)?(0,R.jsx)(qg,{className:`text-muted-foreground size-3 shrink-0`}):null]},e.id))}),w?(0,R.jsx)(`div`,{role:`group`,"aria-label":`Speed`,className:`shrink-0 border-t border-[var(--hairline)] pt-1`,children:(0,R.jsxs)(`button`,{type:`button`,role:`switch`,className:`focus-visible:ring-ring/60 text-foreground hover:bg-hover-fill flex w-full items-center gap-3 rounded-xl px-3 py-2.5 text-left text-sm outline-none focus-visible:ring-2`,"aria-checked":r,onClick:()=>s?.(!r),children:[(0,R.jsx)(Lv,{className:`size-3.5 shrink-0 text-amber-400`}),(0,R.jsx)(`span`,{children:`Fast`}),(0,R.jsx)(`span`,{className:pb(`relative ml-auto inline-flex h-5 w-9 shrink-0 items-center rounded-full transition`,r?`bg-foreground`:`bg-hover-fill-strong`),"aria-hidden":`true`,children:(0,R.jsx)(`span`,{className:pb(`bg-background inline-block size-3.5 rounded-full transition`,r?`translate-x-[18px]`:`translate-x-[3px]`)})})]})}):null]}),T&&Xb(T)?(0,R.jsx)(`div`,{ref:x,role:`group`,"aria-label":`Reasoning for ${T.label}`,className:`bg-popover/96 max-h-[50vh] shrink-0 overflow-y-auto rounded-[18px] border border-[var(--hairline)] p-2 shadow-[var(--composer-shadow)] backdrop-blur-xl sm:absolute sm:right-0 sm:w-46`,style:{top:h},onKeyDown:e=>{e.key===`ArrowLeft`&&(e.preventDefault(),b.current.get(T.id)?.focus())},children:(0,R.jsx)(Fx,{model:T,reasoningEffort:T.id===t?n:``,onSelect:e=>ee(T,e)})}):null]}):null]})}var Rx=68,zx=160,Bx=!!globalThis.CSS?.supports(`field-sizing`,`content`),Vx=`Attach files`,Hx=`composer-shell mx-auto w-full max-w-[48rem] rounded-[28px] p-px transition-colors duration-200`,Ux=`composer-inner rounded-[27px] border border-[var(--hairline)] transition-colors duration-200`;function Wx({notices:e,prompt:t=``,onPromptChange:n,attachments:r,onAttachFiles:i,onRemoveAttachment:a,modelCatalog:o,selectedModel:s=kb,onSelectedModelChange:c,configuredProviders:l=[`spikonado`],providersReady:u=!0,selectedCompletionProvider:d=`spikonado`,onSelectedCompletionProviderChange:f,selectedReasoningEffort:p=Ab,onSelectedReasoningEffortChange:m,fastMode:h=!1,onFastModeChange:g,pendingQuestion:_=null,showContinueWorking:v=!1,onContinueWorking:y,runningCommands:b=null,selectedQuestionOptionId:x=null,onSelectedQuestionOptionIdChange:S,canSend:C,isSubmitting:w,isStarting:T,isRunning:E,runStartedAt:D,projectSkills:ee=null,projectPaths:O=null,onSubmit:te,onCancel:ne,usage:re,usageFailed:ie}){let[k,ae]=(0,F.useState)(()=>Date.now()),A=v&&!!y;(0,F.useEffect)(()=>{let e=setInterval(()=>{ae(Date.now())},1e3);return()=>{clearInterval(e)}},[]);let oe=l.map(e=>({id:e,label:e===`spikonado`?`Spikonado`:e===`chatgpt`?`ChatGPT Subscription`:`OpenAI API`})),se=o?Zb(o,d):[],ce=o?Yb(o,s):void 0,le=(d===`spikonado`||u&&l.includes(d))&&ce!==void 0&&(d===`spikonado`?ie||re!==void 0:ce.provider===`openai`),ue=(0,F.useRef)(null),de=(0,F.useRef)(null),[fe,pe]=(0,F.useState)(null),[me,he]=(0,F.useState)([]),[ge,_e]=(0,F.useState)(`idle`),[ve,ye]=(0,F.useState)(!1),[j,M]=(0,F.useState)(0),[be,xe]=(0,F.useState)(0),[N,Se]=(0,F.useState)(!1),[Ce,we]=(0,F.useState)(0),Te=(0,F.useRef)(0),Ee=(0,F.useRef)(void 0),[De,Oe]=(0,F.useState)(!1),[ke,Ae]=(0,F.useState)(null),je=_!=null,Me=E&&!je||w,Ne=ce?.usagePolicy===`unlimited`,Pe=re?.exhausted===!0&&(re.resetsAt===null||re.resetsAt>k)&&!Ne&&d===`spikonado`,Fe=o?se.find(e=>Yb(o,e.id)?.usagePolicy===`unlimited`)?.label??null:null,Ie=(()=>{if(!Pe||re===void 0)return null;let e=Fe===null?`Upgrade your subscription to keep going.`:`Switch to ${Fe} or upgrade your subscription to keep going.`;return re.resetsAt===null?e:`Your limit resets in ${ox(re.resetsAt-k)}. ${e}`})(),Le=!!t.trim()||r.length>0,Re=Db({selectedOptionId:x,text:t}),ze=je?Re:Le,Be=r.some(e=>e.status!==`ready`),Ve=!Me&&!je,He=Wb(t,be),P=Bb(t,be),Ue=P?.query??null,We=He!==null&&Ue===null&&!ve&&!je,Ge=Ue!==null&&!N&&!je&&!w,Ke=Ox(O,Ge?Ue:null),qe=Math.min(Ce,Math.max(0,Ke.entries.length-1)),Je=We||Ge,Ye=(0,F.useMemo)(()=>He===null?[]:Gb(me,He),[He,me]),Xe=Ge&&Ke.entries[qe]?`composer-path-option-${qe}`:We&&Ye.length>0?`composer-skill-option-${j}`:void 0,Ze=(0,F.useCallback)(()=>{xe(ue.current?.selectionStart??t.length)},[t.length]),Qe=(0,F.useCallback)(()=>{let e=ue.current;if(!e||Bx)return;e.style.height=`${Rx}px`;let t=Math.min(Math.max(e.scrollHeight,Rx),zx);e.style.height=`${t}px`,e.style.overflowY=e.scrollHeight>t?`auto`:`hidden`},[]),$e=(0,F.useCallback)(()=>{he([]),_e(`idle`),ye(!1),M(0),Te.current+=1},[]),et=(0,F.useCallback)(async(e=!1)=>{if(ge===`loading`||(ge===`ready`||ge===`error`)&&!e)return;if(!ee?.load){he([]),_e(`ready`);return}let t=++Te.current;_e(`loading`);try{let e=await ee.load();if(t!==Te.current)return;he(e),_e(`ready`)}catch{if(t!==Te.current)return;he([]),_e(`error`)}},[ee,ge]);function tt(e){let r=Kb(t,be,e.name);r&&(n?.(r.text),xe(r.caret),ye(!0),queueMicrotask(()=>{let e=ue.current;e&&(e.focus(),e.setSelectionRange(r.caret,r.caret),Qe())}))}function nt(e){let r=Vb(t,be,e);r&&(n?.(r.text),xe(r.caret),Se(!0),queueMicrotask(()=>{let e=ue.current;e&&(e.focus(),e.setSelectionRange(r.caret,r.caret),Qe())}))}function rt(e){let t=e.currentTarget,n=Array.from(t.files??[]);t.value=``,n.length>0&&i(n)}function it(e){let t=Array.from(e.clipboardData.files);t.length!==0&&Ve&&(e.clipboardData.getData(`text/plain`)||e.preventDefault(),i(t))}function at(e){Mb(e.dataTransfer)&&(e.preventDefault(),Ve&&Oe(!0))}function ot(e){Mb(e.dataTransfer)&&(e.preventDefault(),e.dataTransfer.dropEffect=Ve?`copy`:`none`)}function st(e){let t=e.currentTarget,n=e.relatedTarget;n instanceof Node&&t.contains(n)||Oe(!1)}function ct(e){if(!Mb(e.dataTransfer)||(e.preventDefault(),Oe(!1),!Ve))return;let t=Array.from(e.dataTransfer.files);t.length>0&&i(t)}function lt(e){let t=e.currentTarget;if(t.disabled)return;let n=t.getBoundingClientRect();pe({top:n.top-8,left:n.left+n.width/2})}function ut(){pe(null)}function dt(e){if(!e.nativeEvent.isComposing&&!(e.key===`Enter`&&window.matchMedia?.(`(pointer: coarse)`).matches)){if(Ge){if(e.key===`ArrowDown`||e.key===`ArrowUp`){e.preventDefault();let t=Ke.entries.length;if(t>0){let n=e.key===`ArrowDown`?1:-1;we((qe+n+t)%t)}return}if(e.key===`Escape`){e.preventDefault(),Se(!0);return}if((e.key===`Enter`||e.key===`Tab`)&&!e.shiftKey){let t=Ke.entries[qe];if(t){e.preventDefault(),nt(t);return}}}if(We){if(e.key===`ArrowDown`||e.key===`ArrowUp`){if(e.preventDefault(),Ye.length===0)return;let t=e.key===`ArrowDown`?1:-1;M(e=>(e+t+Ye.length)%Ye.length);return}if(e.key===`Escape`){e.preventDefault(),ye(!0);return}if((e.key===`Enter`||e.key===`Tab`)&&!e.shiftKey){e.preventDefault();let t=Ye[j];t&&tt(t);return}}!C||!je&&!le||!je&&Pe||w||Me||!ze||!je&&Be||jb({key:e.key,shiftKey:e.shiftKey,isComposing:e.nativeEvent.isComposing})&&(e.preventDefault(),te())}}function ft(e){S?.(x===e?null:e)}function pt(e,t){o&&(c?.(e),Yb(o,e)&&m?.(t))}function mt(e){if(!o)return;f?.(e);let t=Qb(o,e,s);t&&(c?.(t),m?.(Yb(o,t)?.defaultReasoningEffort??o.defaultReasoningEffort),g?.(!1))}return(0,F.useEffect)(()=>{if(!o)return;let e=u&&!l.includes(d)?`spikonado`:d;e!==d&&f?.(e);let t=Qb(o,e,s);t&&t!==s&&(c?.(t),m?.(Yb(o,t)?.defaultReasoningEffort??o.defaultReasoningEffort),g?.(!1))},[o,u,l,d,s,f,c,m,g]),(0,F.useEffect)(()=>{d!==`spikonado`&&h&&g?.(!1)},[d,h,g]),(0,F.useEffect)(()=>{ce&&(ce.reasoningEfforts.includes(p)||m?.(ce.defaultReasoningEffort),h&&!ce.supportsFastMode&&g?.(!1))},[ce,p,m,h,g]),(0,F.useEffect)(()=>{Qe()},[t,Qe]),(0,F.useEffect)(()=>{Ve||Oe(!1)},[Ve]),(0,F.useEffect)(()=>{let e=_?.questionId??null;e!==ke&&(Ae(e),x!==null&&S?.(null),t.trim()&&n?.(``))},[_,ke,x,t,S,n]),(0,F.useEffect)(()=>{let e=ee?.workspacePath??null;if(Ee.current!==e&&(Ee.current=e,$e()),He===null){ye(!1);return}ve||et()},[ee,He,ve,et,$e]),(0,F.useEffect)(()=>{M(0)},[Ye]),(0,F.useEffect)(()=>{Se(!1),we(0)},[Ue,P?.start,O]),(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(`footer`,{className:`shrink-0 px-2 pt-2 pb-[max(0.5rem,env(safe-area-inset-bottom))] sm:px-6 sm:py-4`,children:(0,R.jsxs)(`div`,{className:`mx-auto max-w-336`,children:[D!==null&&D>0&&Number.isFinite(D)?(0,R.jsxs)(`div`,{className:`text-muted-foreground mb-3 flex items-center gap-2 px-4 text-[11px]`,children:[(0,R.jsxs)(`span`,{className:`inline-flex items-center gap-0.75`,children:[(0,R.jsx)(`span`,{className:`bg-foreground/28 size-1 animate-pulse rounded-full`}),(0,R.jsx)(`span`,{className:`bg-foreground/28 size-1 animate-pulse rounded-full [animation-delay:200ms]`}),(0,R.jsx)(`span`,{className:`bg-foreground/28 size-1 animate-pulse rounded-full [animation-delay:400ms]`})]}),(0,R.jsxs)(`span`,{children:[`Working for `,(0,R.jsx)(dx,{startedAt:D})]})]}):w?(0,R.jsxs)(`div`,{className:`text-muted-foreground mb-3 flex items-center gap-2 px-4 text-[11px]`,role:`status`,"aria-live":`polite`,children:[(0,R.jsx)(`span`,{className:`bg-foreground/28 size-1.5 animate-pulse rounded-full`}),(0,R.jsx)(`span`,{children:T?`Starting agent…`:`Sending request…`})]}):null,b&&(0,R.jsx)(mx,{...b,collapseWhen:A}),A?(0,R.jsx)(`div`,{className:`mx-auto mb-3 w-full max-w-[48rem] px-4`,children:(0,R.jsx)(`button`,{type:`button`,className:`border-border bg-surface/80 text-foreground hover:bg-hover-fill rounded-full border px-3 py-1.5 text-[13px] font-medium transition`,onClick:y,disabled:w,children:`Continue working`})}):null,(0,R.jsx)(`div`,{className:Hx,role:`group`,"aria-label":`Message composer`,onDragEnter:at,onDragOver:ot,onDragLeave:st,onDrop:ct,children:(0,R.jsxs)(`div`,{className:`${Ux} relative`,children:[De?(0,R.jsxs)(`div`,{className:`bg-surface/90 border-primary/70 pointer-events-none absolute inset-0 z-30 flex items-center justify-center gap-2 rounded-[27px] border-2 border-dashed backdrop-blur-sm`,role:`status`,"aria-live":`polite`,children:[(0,R.jsx)($_,{className:`text-primary size-5`,"aria-hidden":`true`}),(0,R.jsx)(`span`,{className:`text-foreground text-sm font-medium`,children:`Drop files to attach`})]}):null,(0,R.jsxs)(`div`,{className:`relative flex min-h-33 flex-col px-4 pt-4 pb-2.5`,children:[(0,R.jsxs)(`div`,{className:`mb-3 max-h-[min(30vh,16rem)] space-y-2 overflow-y-auto empty:hidden`,role:`region`,"aria-label":`Conversation notices`,tabIndex:0,children:[e,Ie?(0,R.jsx)(Dx,{title:`You're out of usage`,children:Ie}):null]}),_?(0,R.jsx)(cx,{question:_.question,options:_.options,selectedOptionId:x,onToggleOption:ft}):null,r.length>0&&!je?(0,R.jsx)(wx,{attachments:r,disabled:Me,onRemove:a}):null,(0,R.jsxs)(`div`,{className:`relative min-h-0 flex-1`,children:[Ge?(0,R.jsx)(Ex,{loadState:Ke.loadState,entries:Ke.entries,scanning:Ke.scanning,highlightedIndex:qe,onRetry:()=>{Ke.retry(),ue.current?.focus()},onHighlight:we,onSelect:nt}):null,We?(0,R.jsx)(Tx,{loadState:ge,skills:Ye,highlightedIndex:j,onRetry:()=>void et(!0),onHighlight:e=>{M(e)},onSelect:tt}):null,(0,R.jsx)(`textarea`,{ref:ue,value:t,rows:1,className:`text-foreground placeholder:text-muted-foreground field-sizing-content max-h-40 min-h-17 w-full resize-none overflow-y-auto border-0 bg-transparent px-0 py-0 text-base leading-6 outline-none sm:text-[14px]`,placeholder:je?`Add detail, or type a custom answer`:`Ask anything, use / for commands, @ to tag files/folders, and $ for skills`,disabled:w,role:`combobox`,"aria-autocomplete":`list`,"aria-haspopup":`listbox`,"aria-expanded":Je,"aria-controls":Ge?`composer-paths-listbox`:We?`composer-skills-listbox`:void 0,"aria-activedescendant":Xe,autoComplete:`off`,enterKeyHint:`enter`,onKeyDown:dt,onPaste:it,onFocus:Ze,onChange:e=>{n?.(e.target.value),Ze(),Qe()},onKeyUp:Ze,onClick:Ze,onSelect:Ze})]}),(0,R.jsxs)(`div`,{className:`flex min-w-0 items-center justify-between gap-1 overflow-visible pt-2.5 sm:gap-3`,children:[(0,R.jsxs)(`div`,{className:`-m-1 flex min-w-0 flex-1 items-center gap-1 overflow-visible p-1`,children:[(0,R.jsx)(`input`,{ref:de,type:`file`,className:`hidden`,multiple:!0,onChange:rt}),(0,R.jsx)(`button`,{type:`button`,className:`text-muted-foreground enabled:hover:text-foreground flex size-11 shrink-0 items-center justify-center rounded-lg transition enabled:cursor-pointer disabled:opacity-40 sm:size-9`,"aria-label":Vx,disabled:!Ve,onMouseEnter:lt,onMouseLeave:ut,onFocus:lt,onBlur:ut,onClick:()=>{ut(),de.current?.click()},children:(0,R.jsx)($_,{className:`size-4`,"aria-hidden":`true`})}),(0,R.jsx)(`div`,{className:`bg-hover-fill-strong mx-1 hidden h-4 w-px shrink-0 sm:block`}),(0,R.jsx)(Lx,{modelId:s,models:o?.models.filter(e=>se.some(t=>t.id===e.id))??[],reasoningEffort:p,fastMode:h,allowsFastMode:d===`spikonado`,disabled:Me||je||o===void 0,onSelect:pt,onFastModeChange:g}),(0,R.jsx)(`div`,{className:`bg-hover-fill-strong mx-1 hidden h-4 w-px shrink-0 sm:block`}),(0,R.jsx)(Mx,{value:d,options:oe,ariaLabel:`Select provider`,menuTitle:`Provider`,compactOnMobile:!0,disabled:Me||je||!u,onValueChange:mt,className:`z-20 shrink-0`,triggerClassName:`h-11 border-0 bg-transparent px-2 text-[15px] text-foreground shadow-none hover:bg-transparent sm:h-9`,optionIcon:e=>(0,R.jsx)(Px,{provider:e.id,className:`size-4 shrink-0`})})]}),(0,R.jsxs)(`div`,{className:`flex shrink-0 flex-nowrap items-center justify-end gap-2.5`,children:[E?(0,R.jsx)(`button`,{type:`button`,className:`flex size-11 cursor-pointer items-center justify-center rounded-full bg-rose-500/90 text-white transition-all duration-150 hover:scale-105 hover:bg-rose-500 disabled:pointer-events-none disabled:opacity-60 disabled:hover:scale-100 sm:size-10`,"aria-label":`Stop generation`,title:`Stop`,onClick:ne,children:(0,R.jsx)(yv,{className:`size-3.5 fill-current`})}):null,je||!E?(0,R.jsx)(`button`,{type:`button`,className:`bg-primary/90 text-primary-foreground hover:bg-primary flex size-11 items-center justify-center rounded-full transition-all duration-150 hover:scale-105 enabled:cursor-pointer disabled:pointer-events-none disabled:opacity-30 disabled:hover:scale-100 sm:size-10`,onClick:te,disabled:!C||!je&&!le||!je&&Pe||w||!ze||!je&&Be,"aria-label":je?`Submit answer`:`Send message`,children:(0,R.jsx)(jg,{className:`size-4`})}):null]})]})]})]})})]})}),fe?(0,R.jsx)(`div`,{className:`bg-tooltip text-tooltip-foreground ring-border pointer-events-none fixed z-100 -translate-x-1/2 -translate-y-full rounded-md px-2.5 py-1.5 text-[12px] leading-4 whitespace-nowrap shadow-lg ring-1`,style:{top:fe.top,left:fe.left},role:`tooltip`,children:Vx}):null]})}function Gx(e){let t=cr(),n=sx(),r=qn({query:Jp.usage.getMyUsage,args:t.isAuthenticated&&!t.isLoading?{now:n}:`skip`});return(0,R.jsx)(Wx,{...e,usage:r.status===`success`?r.data:void 0,usageFailed:r.status===`error`})}function Kx({error:e,runError:t,reconnecting:n,catalogError:r,catalogLoading:i,onRetryCatalog:a}){return(0,R.jsxs)(R.Fragment,{children:[e?(0,R.jsx)(Dx,{title:`Something went wrong`,tone:`error`,children:e}):null,t&&t!==e?(0,R.jsx)(Dx,{title:`Run couldn't continue`,children:t}):null,n?(0,R.jsx)(Dx,{title:`Reconnecting`,tone:`status`,children:`Reconnecting to conversation history.`}):null,r?(0,R.jsx)(Dx,{title:`Models unavailable`,tone:`error`,action:(0,R.jsx)(mb,{variant:`outline`,className:`h-8 px-3`,disabled:i,onclick:a,children:i?`Retrying…`:`Retry`}),children:Jb}):null]})}function qx({projects:e,workspacePath:t,onProject:n,onAddProject:r}){let i=e.find(e=>e.workspacePath===t)?.displayName??`Choose a project`,a=e.findIndex(e=>e.workspacePath===t),[o,s]=(0,F.useState)(!1),[c,l]=(0,F.useState)(0),u=(0,F.useRef)(null),d=(0,F.useRef)(null),f=(0,F.useRef)([]);function p(t){return e.some(e=>e.workspacePath!==t.workspacePath&&e.displayName===t.displayName)}function m(e){return p(e)?`${e.displayName}, ${e.workspacePath}`:e.displayName}let h=(0,F.useCallback)(t=>{let n=e.length+1,r=(t+n)%n;l(r),queueMicrotask(()=>f.current[r]?.focus())},[e.length]),g=(0,F.useCallback)(e=>{s(!0),h(e??(a>=0?a:0))},[h,a]),_=(0,F.useCallback)(e=>{s(!1),e&&queueMicrotask(()=>d.current?.focus())},[]);function v(e){_(!0),e.workspacePath!==t&&n(e.workspacePath)}function y(){_(!1),r()}function b(t){let n=e[t];if(n){v(n);return}y()}function x(t){(t.key===`ArrowDown`||t.key===`ArrowUp`)&&(t.preventDefault(),g(t.key===`ArrowUp`?e.length:void 0))}function S(t,n){switch(t.key){case`ArrowDown`:t.preventDefault(),h(n+1);break;case`ArrowUp`:t.preventDefault(),h(n-1);break;case`Home`:t.preventDefault(),h(0);break;case`End`:t.preventDefault(),h(e.length);break;case`Enter`:case` `:t.preventDefault(),b(n);break;case`Tab`:s(!1)}}return(0,F.useEffect)(()=>{if(o)return kx({getRoot:()=>u.current,onOutside:()=>_(!1),onEscape:()=>_(!0)})},[o,_]),(0,F.useEffect)(()=>{e.length===0&&s(!1)},[e.length]),(0,R.jsx)(`div`,{ref:u,className:`create-thread-heading`,children:e.length?(0,R.jsxs)(`h1`,{children:[`What should we build in`,` `,(0,R.jsxs)(`span`,{className:`create-thread-project-phrase`,children:[(0,R.jsxs)(`span`,{className:`create-thread-project-control`,children:[(0,R.jsxs)(`button`,{ref:d,type:`button`,className:`create-thread-project-trigger`,"aria-label":`Select project. Current project: ${i}`,"aria-haspopup":`menu`,"aria-expanded":o,"aria-controls":o?`create-thread-project-menu`:void 0,onClick:()=>{o?_(!1):g()},onKeyDown:x,children:[(0,R.jsx)(`span`,{children:i}),(0,R.jsx)(Gg,{className:o?`is-open`:``,"aria-hidden":`true`})]}),o?(0,R.jsxs)(`span`,{id:`create-thread-project-menu`,className:`create-thread-project-menu`,role:`menu`,"aria-label":`Projects`,children:[(0,R.jsx)(`span`,{className:`create-thread-project-options`,children:e.map((e,n)=>(0,R.jsxs)(`button`,{ref:e=>{f.current[n]=e},type:`button`,className:pb(c===n&&`active`,e.workspacePath===t&&`selected`),role:`menuitemradio`,"aria-checked":e.workspacePath===t,"aria-label":m(e),onPointerEnter:()=>{l(n)},onKeyDown:e=>S(e,n),onClick:()=>v(e),children:[(0,R.jsxs)(`span`,{className:`create-thread-project-option-label`,children:[(0,R.jsx)(`span`,{children:e.displayName}),p(e)?(0,R.jsx)(`small`,{title:e.workspacePath,children:e.workspacePath}):null]}),(0,R.jsx)(Ug,{"aria-hidden":`true`})]},e.workspacePath))}),(0,R.jsx)(`span`,{className:`create-thread-project-menu-footer`,children:(0,R.jsxs)(`button`,{ref:t=>{f.current[e.length]=t},type:`button`,className:pb(c===e.length&&`active`),role:`menuitem`,onPointerEnter:()=>{l(e.length)},onKeyDown:t=>S(t,e.length),onClick:y,children:[(0,R.jsx)(D_,{"aria-hidden":`true`}),(0,R.jsx)(`span`,{children:`Add project`})]})})]}):null]}),(0,R.jsx)(`span`,{"aria-hidden":`true`,children:`?`})]})]}):(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(`h1`,{children:`What should we work on?`}),(0,R.jsx)(`p`,{className:`text-muted-foreground mt-3 text-sm`,children:`Add a project to start your first thread.`}),(0,R.jsx)(`button`,{type:`button`,className:`mt-5 rounded-lg border border-[var(--hairline)] px-4 py-2 text-sm`,onClick:r,children:`Add project`})]})})}P.union(P.literal(`unsettled`),P.literal(`settled`));function Jx(e){return e.archivedAt===void 0?`unsettled`:`settled`}function Yx(e){return e.parentThreadId===void 0}function Xx(e,t,n){let r=new Set([t]),i=[t];for(;i.length>0;){let e=i.pop();for(let t of n.get(e)??[])r.has(t)||(r.add(t),i.push(t))}return e.filter(e=>!r.has(e))}function Zx(e,t,n){return t>0?`${Qx(t)} · Working`:e>0&&!n?Qx(e):null}function Qx(e){return`${e} ${e===1?`subagent`:`subagents`}`}function $x(e){return`sprocket.inbox.expanded-threads:${e}`}var eS=20;function tS(e,t){let n=(0,F.useRef)(null),{rows:r,loading:i,canLoadMore:a,error:o,loadMore:s}=t;(0,F.useEffect)(()=>{!e||i||o||!a||r.some(t=>t._id===e)||(n.current?.threadId!==e||n.current.rows!==r)&&(n.current={threadId:e,rows:r},s())},[e,r,i,a,o,s])}function nS(e){let t=rr({query:Jp.threads.listChildren,args:{threadId:e},initialNumItems:eS});return{rows:t.data??[],loading:t.isLoading,canLoadMore:t.canLoadMore,error:t.error?.message,loadMore:()=>t.loadMore(eS)}}function rS({threadId:e,enabled:t}){let n=qn({query:Jp.threads.subtreeSummaryForThread,args:t&&e?{threadId:e}:`skip`});return n.status===`success`?n.data:void 0}function iS(e){try{let t=localStorage.getItem($x(e)),n=t?Ed(L()).safeParse(JSON.parse(t)):null;return n?.success?n.data:[]}catch{return[]}}function aS(e,t){try{localStorage.setItem($x(e),JSON.stringify(t))}catch{}}function oS(e){let[t,n]=(0,F.useState)([]),r=(0,F.useRef)(null),i=(0,F.useRef)(new Map);(0,F.useEffect)(()=>{r.current!==e&&(r.current=e,n(e?iS(e):[]))},[e]);let a=t=>{t.length!==0&&n(n=>{let r=[...new Set([...n,...t])];return r.length===n.length?n:(e&&aS(e,r),r)})};return{isExpanded:e=>t.includes(e),expand:e=>a([e]),revealAncestors:a,registerChildren:(e,t)=>{let n=i.current.get(e);n||(n=new Set,i.current.set(e,n));for(let e of t)n.add(e._id)},collapse:t=>{n(n=>{if(!n.includes(t))return n;let r=Xx(n,t,i.current);return e&&aS(e,r),r})}}}function sS({currentThreadId:e,enabled:t,expansion:n}){let r=qn({query:Jp.threads.ancestorChain,args:t&&e?{threadId:e}:`skip`}),i=r.status===`success`?r.data:void 0,a=n.revealAncestors,o=(0,F.useRef)(null);return(0,F.useEffect)(()=>{if(!e||!i||i.length===0){o.current=null;return}let t=`${e}:${i.join(`,`)}`;o.current!==t&&(o.current=t,a(i))},[e,i,a]),(0,F.useMemo)(()=>t&&e&&i?[...i,e]:[],[t,e,i])}var cS=Od({method:zd([`desktop`,`package`]),status:zd([`unavailable`,`idle`,`checking`,`available`,`downloading`,`downloaded`,`installing`,`installed`,`error`]),currentVersion:L(),version:L().nullable(),progress:md().nullable().optional(),error:L().nullable(),message:L().nullable().optional()});function lS(e){switch(e.status){case`available`:return`Update available`;case`downloading`:return e.progress==null?`Downloading update…`:`Downloading… ${e.progress}%`;case`downloaded`:return`Restart to update`;case`installing`:return`Installing update…`;case`installed`:return`Update installed`;case`error`:return e.version?`Retry update`:null;default:return null}}async function uS(e){let t=jm();if(!t)return null;let n=await fetch(`${t}/api/update${e?`/install`:``}`,{method:e?`POST`:`GET`,credentials:`include`,headers:{"content-type":`application/json`},signal:AbortSignal.timeout(3e4)});if(!n.ok){let e=Od({error:L()}).safeParse(await n.json().catch(()=>null));throw Error(e.success?e.data.error:`Update request failed (${n.status}). Try again.`)}return cS.parse(await n.json())}var dS=[`downloading`,`downloaded`,`installing`,`installed`];function fS(){let[e,t]=(0,F.useState)(null),[n,r]=(0,F.useState)(null),[i,a]=(0,F.useState)(!1),o=(0,F.useRef)(!1),s=(0,F.useRef)(0),c=e?lS(e):null,l=i||e?.status===`downloading`||e?.status===`installing`,u=e=>{o.current=e,a(e)},d=(0,F.useCallback)(e=>{t(e),e&&dS.includes(e.status)&&r(null)},[]);(0,F.useEffect)(()=>{let e=!1,t=!1,n=!1,r=window.sprocketDesktopBridge?.updates,i=r?.onState(e=>{s.current+=1,d(e)});async function a(){if(t||e||o.current||n)return;t=!0;let i=s.current;try{let t=r?await r.getState():await uS(!1);!e&&s.current===i&&(d(t),n=t===null||t.status===`unavailable`)}catch{}finally{t=!1}}a();let c=setInterval(()=>void a(),5e3);return()=>{e=!0,clearInterval(c),i?.()}},[d]);async function f(){if(!e||l)return;let t=++s.current;u(!0),r(null);try{let n=window.sprocketDesktopBridge?.updates;if(e.method===`desktop`&&n){let r=await(e.status===`downloaded`?n.install():n.download());s.current===t&&d(r)}else e.method===`package`&&d(await uS(!0))}catch(e){r(e instanceof Error?e.message:String(e))}finally{u(!1)}}return!c||!e?null:(0,R.jsxs)(`div`,{className:`mb-1`,"aria-live":`polite`,children:[(0,R.jsxs)(`button`,{type:`button`,className:`text-foreground hover:bg-hover-fill flex min-h-9 w-full min-w-0 items-center gap-2.5 rounded-lg px-2 py-1.5 text-left text-[13px] font-medium tracking-[-0.02em] transition disabled:cursor-default disabled:opacity-70`,disabled:l||e.status===`installed`,onClick:()=>void f(),title:e.version?`Sprocket ${e.version}`:void 0,"aria-busy":l,children:[l?(0,R.jsx)(V_,{className:`size-4 shrink-0 animate-spin`,"aria-hidden":`true`}):e.status===`downloaded`?(0,R.jsx)(tv,{className:`size-4 shrink-0`,"aria-hidden":`true`}):(0,R.jsx)(s_,{className:`size-4 shrink-0`,"aria-hidden":`true`}),(0,R.jsx)(`span`,{children:c})]}),e.status===`installed`&&(0,R.jsx)(`p`,{className:`text-muted-foreground px-2 pb-2 text-xs`,children:`Wait for active agents to finish, then stop Sprocket in your terminal and launch it again.`}),(n||e.error)&&(0,R.jsx)(`p`,{className:`text-destructive px-2 pb-2 text-xs break-words`,role:`alert`,children:n||e.error})]})}function pS({section:e}){return(0,R.jsx)(`div`,{className:`inbox-load-more`,"aria-live":`polite`,children:e.error?(0,R.jsx)(`span`,{role:`alert`,children:e.error}):e.loading?(0,R.jsx)(`span`,{children:`Loading...`}):e.canLoadMore?(0,R.jsx)(`button`,{type:`button`,onClick:e.loadMore,children:`Show more`}):null})}var mS=`text-muted-foreground hover:text-foreground hover:bg-hover-fill inline-flex size-7 shrink-0 items-center justify-center rounded-md transition`;function hS({theme:e,onThemeChange:t,onClose:n}){return(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(`button`,{type:`button`,className:mS,"aria-label":e===`dark`?`Switch to light mode`:`Switch to dark mode`,title:e===`dark`?`Light mode`:`Dark mode`,onClick:()=>t(e===`dark`?`light`:`dark`),children:e===`dark`?(0,R.jsx)(xv,{className:`size-3.5`,"aria-hidden":`true`}):(0,R.jsx)(G_,{className:`size-3.5`,"aria-hidden":`true`})}),n&&(0,R.jsx)(`button`,{type:`button`,className:mS,"aria-label":`Close sidebar`,title:`Close sidebar`,onClick:n,children:(0,R.jsx)(Y_,{className:`size-3.5`,"aria-hidden":`true`})})]})}var gS=`sprocket.inbox.settled-open`,_S={unsettled:`Unsettled`,settled:`Settled Threads`};function vS({sections:e,projects:t,models:n,selectedProjects:r,currentThreadId:i,settledOpen:a=!1,onSettledOpenChange:o,mutationsEnabled:s,theme:c,onThemeChange:l,onFilter:u,onSelect:d,onNew:f,onAddProject:p,onSettings:m,onClose:h,onChange:g,onRename:_,expansion:v,resolveChildren:y,readTreeSummary:b=rS}){let[x,S]=(0,F.useState)(null),[C,w]=(0,F.useState)(null),[T,E]=(0,F.useState)(null),[D,ee]=(0,F.useState)(!1),[O,te]=(0,F.useState)(null),[ne,re]=(0,F.useState)(``),[ie,k]=(0,F.useState)(``),ae=(0,F.useRef)(!1),A=(0,F.useRef)(null),oe=(0,F.useRef)(null),se=(0,F.useRef)(null),ce=(0,F.useRef)(o),le=(0,F.useCallback)(()=>{let e=A.current;A.current=null,w(null),e?.focus()},[]),ue=e.flatMap(e=>e.rows),de=t.filter(e=>e.displayName.toLocaleLowerCase().includes(ie.trim().toLocaleLowerCase())),fe=e.filter(e=>e.rows.length||e.loading||e.error||e.canLoadMore||e.state===`settled`&&!a),pe=r.length===0?`All projects`:r.length===1?t.find(e=>e.repositoryKey===r[0])?.displayName??`All projects`:`${r.length} projects`,me=C?.thread??null,he=b({threadId:me?._id??null,enabled:s}),ge=b({threadId:x?._id??null,enabled:s});(0,F.useEffect)(()=>{ce.current=o}),(0,F.useEffect)(()=>{try{let e=localStorage.getItem(gS);e!==null&&ce.current(e===`true`)}catch{}},[]),(0,F.useEffect)(()=>{O&&oe.current&&(oe.current.focus(),oe.current.select())},[O]),(0,F.useEffect)(()=>{C&&document.querySelector(`.inbox-context-menu button:not(:disabled)`)?.focus()},[C]);function _e(e){return t.find(t=>t.repositoryKey===e.repositoryKey)?.displayName??e.repositoryKey}function ve(e){return n.find(t=>t.id===e.selectedModel)}function ye(){se.current&&(se.current.open=!1),k(``)}function j(e){u(e),ye()}function M(){ye(),p()}function be(){let e=!a;o(e);try{localStorage.setItem(gS,String(e))}catch{}}function xe(e){w(null),te(e),re(e.title??``)}function N(){te(null),re(``)}async function Se(){if(!O)return;let e=O,t=ne.trim();if(!t||t===(e.title??``)){N();return}N();try{await _(e,t)}catch(e){E(e instanceof Error?e.message:`Could not rename thread.`)}}function Ce(e,t,n){return Jx(e)===t||!Yx(e)?!1:t!==`settled`||xS(e,n)}async function we(e,t,n){if(s&&!ae.current){if(le(),ae.current=!0,ee(!0),E(null),!Ce(e,t,n)){ae.current=!1,ee(!1);return}try{await g(e,t)}catch(e){E(e instanceof Error?e.message:`Could not update thread.`)}finally{ae.current=!1,ee(!1)}}}function Te(e){return s&&!D&&x!==null&&Ce(x,e,ge?.anyActive===!0)}function Ee(e,t){e.preventDefault(),x&&Te(t)&&we(x,t,ge?.anyActive===!0),S(null)}function De(e,t){e.preventDefault();let n=e.currentTarget instanceof HTMLElement?e.currentTarget:null;A.current=n;let r=n?.getBoundingClientRect(),i=e.clientX,a=e.clientY;w({thread:t,x:Math.min(i||r?.left||8,window.innerWidth-230),y:Math.min(a||r?.bottom||8,window.innerHeight-260)})}let Oe=(e,t,n)=>(0,R.jsx)(yS,{thread:e,sectionState:t,depth:n,selected:e._id===i,mutationsEnabled:s,busy:D,renaming:O?._id===e._id,renameTitle:ne,renameInputRef:oe,expansion:v,resolveChildren:y,readTreeSummary:b,projectName:_e(e),model:ve(e),renderChildren:e=>(0,R.jsx)(R.Fragment,{children:e.map(e=>Oe(e,t,n+1))}),onChoose:d,onOpenMenu:De,onBeginRename:xe,onCancelRename:N,onCommitRename:Se,onRenameTitleChange:re,onChange:we,onDragStart:e=>S(e),onDragEnd:()=>S(null)},e._id);function ke(e){if(e.key===`Tab`||e.key===`Escape`){e.preventDefault(),le();return}if(![`ArrowUp`,`ArrowDown`,`Home`,`End`].includes(e.key))return;e.preventDefault();let t=[...e.currentTarget.querySelectorAll(`button:not(:disabled)`)],n=t.findIndex(e=>e===document.activeElement);t[e.key===`Home`?0:e.key===`End`?t.length-1:(n+(e.key===`ArrowUp`?-1:1)+t.length)%t.length]?.focus()}let Ae=(0,F.useCallback)(e=>{if(!e.defaultPrevented){if(e.key===`Escape`){C&&le();return}if(e.altKey&&e.key.toLowerCase()===`n`&&(e.preventDefault(),f()),!(e.target instanceof Element&&e.target.closest(`input, textarea, [contenteditable="true"], dialog`))&&e.altKey&&[`ArrowUp`,`ArrowDown`].includes(e.key)){let t=ue.findIndex(e=>e._id===i),n=ue[t+(e.key===`ArrowDown`?1:-1)];n&&(e.preventDefault(),d(n))}}},[C,le,f,ue,i,d]);return(0,F.useEffect)(()=>(window.addEventListener(`keydown`,Ae),()=>window.removeEventListener(`keydown`,Ae)),[Ae]),(0,R.jsxs)(`aside`,{className:`inbox-sidebar`,"aria-label":`Thread inbox`,children:[(0,R.jsxs)(`header`,{className:`flex items-center gap-2 px-4 pt-4 pb-3`,children:[(0,R.jsx)(hb,{size:`sm`,class:`mr-auto`,label:`Close sidebar`,onclick:()=>h()}),(0,R.jsx)(hS,{theme:c,onThemeChange:l,onClose:h})]}),(0,R.jsxs)(`div`,{className:`px-3 pb-3`,children:[(0,R.jsxs)(`button`,{className:`inbox-menu-item inbox-primary-navigation`,type:`button`,onClick:f,children:[(0,R.jsx)(hv,{size:15}),`New thread`]}),(0,R.jsxs)(`div`,{className:`inbox-project-controls`,children:[(0,R.jsxs)(`details`,{ref:se,children:[(0,R.jsxs)(`summary`,{className:`inbox-filter inbox-primary-navigation`,children:[(0,R.jsx)(`span`,{className:`truncate`,children:pe}),(0,R.jsx)(Gg,{size:14})]}),(0,R.jsxs)(`div`,{className:`inbox-project-menu`,children:[(0,R.jsxs)(`label`,{className:`inbox-project-search`,children:[(0,R.jsx)(lv,{size:14}),(0,R.jsx)(`input`,{value:ie,onChange:e=>k(e.currentTarget.value),"aria-label":`Search projects`,placeholder:`Search projects`})]}),(0,R.jsxs)(`div`,{className:`inbox-project-list`,children:[(0,R.jsx)(`button`,{className:pb(`inbox-project-option`,{"inbox-project-selected":r.length===0}),type:`button`,"aria-pressed":r.length===0,onClick:()=>j([]),children:`All projects`}),de.map(e=>{let t=r.length===1&&r[0]===e.repositoryKey;return(0,R.jsx)(`button`,{className:pb(`inbox-project-option`,{"inbox-project-selected":t}),type:`button`,"aria-pressed":t,onClick:()=>j([e.repositoryKey]),children:e.displayName},e.repositoryKey)})]})]})]}),(0,R.jsx)(`button`,{className:`inbox-icon inbox-add-project-button`,type:`button`,"aria-label":`Create or add project`,onClick:M,children:(0,R.jsx)(D_,{size:17})})]})]}),(0,R.jsx)(`div`,{className:`inbox-scroll`,children:fe.map(e=>(0,R.jsxs)(`section`,{id:`inbox-${e.state}`,onDragOver:t=>{Te(e.state)&&t.preventDefault()},onDrop:t=>Ee(t,e.state),"aria-label":_S[e.state],children:[e.state===`settled`&&(0,R.jsxs)(`button`,{className:`inbox-section-heading inbox-primary-navigation`,type:`button`,"aria-expanded":a,"aria-controls":`inbox-settled-threads`,onClick:be,children:[(0,R.jsx)(`span`,{children:`Settled Threads`}),(0,R.jsx)(Gg,{className:a?`inbox-section-chevron-open`:void 0,size:14})]}),(0,R.jsx)(`div`,{id:e.state===`settled`?`inbox-settled-threads`:void 0,children:(e.state!==`settled`||a)&&(0,R.jsxs)(R.Fragment,{children:[e.rows.map(t=>Oe(t,e.state,0)),(0,R.jsx)(pS,{section:e})]})})]},e.state))}),T&&(0,R.jsxs)(`div`,{className:`inbox-notice`,role:`status`,children:[(0,R.jsx)(`span`,{children:T}),(0,R.jsx)(`button`,{type:`button`,"aria-label":`Dismiss notification`,onClick:()=>E(null),children:(0,R.jsx)(Fv,{size:13})})]}),(0,R.jsxs)(`footer`,{className:`inbox-footer`,children:[(0,R.jsxs)(`button`,{className:`inbox-menu-item inbox-primary-navigation`,type:`button`,onClick:m,children:[(0,R.jsx)(dv,{size:15}),`Settings`]}),(0,R.jsx)(fS,{})]}),C&&me&&(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(`button`,{className:`fixed inset-0 z-[200] cursor-default`,type:`button`,"aria-label":`Close thread actions`,onClick:le}),(0,R.jsxs)(`div`,{className:`inbox-context-menu`,style:{left:`${Math.max(8,C.x)}px`,top:`${Math.max(8,C.y)}px`},role:`menu`,tabIndex:-1,onKeyDown:ke,children:[Yx(me)&&(Jx(me)===`unsettled`?(0,R.jsxs)(`button`,{type:`button`,role:`menuitem`,disabled:!s||D||!Ce(me,`settled`,he?.anyActive===!0),onClick:()=>void we(me,`settled`,he?.anyActive===!0),children:[(0,R.jsx)(Ug,{size:14}),`Settle`]}):(0,R.jsxs)(`button`,{type:`button`,role:`menuitem`,disabled:!s||D,onClick:()=>void we(me,`unsettled`,!1),children:[(0,R.jsx)(rv,{size:14}),`Unsettle`]})),(0,R.jsxs)(`button`,{type:`button`,role:`menuitem`,disabled:!s,onClick:()=>xe(me),children:[(0,R.jsx)(hv,{size:14}),`Rename`]}),(0,R.jsxs)(`button`,{type:`button`,role:`menuitem`,onClick:()=>{navigator.clipboard.writeText(me._id).catch(()=>{E(`Could not copy thread ID.`)}),w(null)},children:[(0,R.jsx)(r_,{size:14}),`Copy thread ID`]})]})]})]})}function yS({thread:e,sectionState:t,depth:n,selected:r,mutationsEnabled:i,busy:a,renaming:o,renameTitle:s,renameInputRef:c,expansion:l,resolveChildren:u,readTreeSummary:d=rS,projectName:f,model:p,renderChildren:m,onChoose:h,onOpenMenu:g,onBeginRename:_,onCancelRename:v,onCommitRename:y,onRenameTitleChange:b,onChange:x,onDragStart:S,onDragEnd:C}){let w=d({threadId:e._id,enabled:i}),T=bS(e),E=w?.descendantCount??0,D=w?.workingDescendantCount??0,ee=Zx(E,D,w?.descendantsActive??!1),O=l.isExpanded(e._id),te=Yx(e),ne=n>0?{marginLeft:`${n*14}px`}:void 0;return(0,R.jsxs)(`div`,{className:`inbox-tree-node`,children:[(0,R.jsxs)(`div`,{className:pb(`inbox-row`,{"inbox-row-selected":r}),style:ne,draggable:i&&!a&&!o&&te,onDragStart:t=>S(e,t),onDragEnd:C,onContextMenu:t=>g(t,e),role:`group`,"aria-label":e.title??`New thread`,children:[o?(0,R.jsxs)(`form`,{className:`inbox-row-main`,onSubmit:e=>{e.preventDefault(),y()},children:[(0,R.jsxs)(`span`,{className:`inbox-row-meta`,children:[(0,R.jsx)(`span`,{className:`truncate`,children:f}),T&&(0,R.jsx)(`span`,{className:pb(`inbox-status shrink-0`,T.className),children:T.label})]}),(0,R.jsx)(`input`,{ref:c,value:s,onChange:e=>b(e.currentTarget.value),className:`inbox-row-rename-input`,"aria-label":`Rename thread`,maxLength:300,onKeyDown:e=>{e.key===`Escape`&&(e.preventDefault(),v())},onBlur:()=>void y()}),(0,R.jsx)(`span`,{className:`inbox-row-model`,children:p?(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(Px,{provider:p.provider,className:`size-3.5 shrink-0`}),(0,R.jsx)(`span`,{className:`truncate`,children:p.label})]}):(0,R.jsx)(`span`,{className:`truncate`,children:`Unknown model`})})]}):(0,R.jsxs)(`button`,{className:`inbox-row-main`,type:`button`,title:`${e.title??`New thread`}\n${f}`,onClick:()=>h(e),onDoubleClick:()=>{i&&!a&&_(e)},"aria-current":r?`page`:void 0,children:[(0,R.jsxs)(`span`,{className:`inbox-row-meta`,children:[(0,R.jsx)(`span`,{className:`truncate`,children:f}),T&&(0,R.jsx)(`span`,{className:pb(`inbox-status shrink-0`,T.className),children:T.label})]}),(0,R.jsx)(`span`,{className:`inbox-row-title truncate`,children:e.title??`New thread`}),(0,R.jsx)(`span`,{className:`inbox-row-model`,children:p?(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(Px,{provider:p.provider,className:`size-3.5 shrink-0`}),(0,R.jsx)(`span`,{className:`truncate`,children:p.label})]}):(0,R.jsx)(`span`,{className:`truncate`,children:`Unknown model`})})]}),!o&&te&&(0,R.jsx)(`div`,{className:`inbox-row-actions`,children:t===`unsettled`?(0,R.jsx)(`button`,{className:`inbox-icon inbox-row-state-action`,type:`button`,disabled:!i||a||!xS(e,w?.anyActive===!0),"aria-label":`Settle ${e.title??`thread`}`,"data-tooltip":`Settle`,onClick:()=>void x(e,`settled`,w?.anyActive===!0),children:(0,R.jsx)(Ug,{size:14})}):(0,R.jsx)(`button`,{className:`inbox-icon inbox-row-state-action`,type:`button`,disabled:!i||a,"aria-label":`Unsettle ${e.title??`thread`}`,"data-tooltip":`Unsettle`,onClick:()=>void x(e,`unsettled`,!1),children:(0,R.jsx)(rv,{size:14})})}),E>0&&!o&&(0,R.jsxs)(`button`,{className:`inbox-subagents`,type:`button`,"aria-expanded":O,"aria-label":`${O?`Collapse`:`Expand`} subagents of ${e.title??`thread`}${ee?`: ${ee}`:``}`,onClick:()=>{O?l.collapse(e._id):l.expand(e._id)},children:[O?(0,R.jsx)(Gg,{size:13}):(0,R.jsx)(qg,{size:13}),ee&&(0,R.jsx)(`span`,{className:pb(`inbox-row-subagents`,{"inbox-working":D>0}),children:ee})]})]}),O&&(0,R.jsx)(`div`,{className:`inbox-children`,children:u({threadId:e._id,renderRows:m})})]})}function bS(e){return e.status===`queued`?{label:`Starting`,className:`inbox-working`}:e.status===`running`?{label:`Working`,className:`inbox-working`}:e.status===`failed`?{label:`Failed`,className:`inbox-attention`}:null}function xS(e,t){return!t&&e.status!==`running`&&e.status!==`queued`}function SS({user:e,onSignOut:t}){let[n,r]=(0,F.useState)(!1),i=cr(),a=qn({query:Jp.billing.getMySubscription,args:i.isAuthenticated&&!i.isLoading?{}:`skip`}),o=a.status===`success`?a.data:null,s=a.status===`error`,c=[e?.firstName,e?.lastName].filter(Boolean).join(` `).trim()||null;return(0,R.jsxs)(`section`,{className:`flex h-full min-h-0 flex-col overflow-hidden`,children:[(0,R.jsx)(`header`,{className:`flex h-12 shrink-0 items-center px-6`,children:(0,R.jsx)(`h1`,{className:`text-foreground text-[1rem] font-medium tracking-[-0.03em]`,children:`Account`})}),(0,R.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto px-6 py-8`,children:(0,R.jsxs)(`div`,{className:`max-w-xl space-y-10`,children:[(0,R.jsxs)(`div`,{children:[(0,R.jsx)(`p`,{className:`text-muted-foreground font-mono text-[11px] tracking-[0.18em] uppercase`,children:`Profile`}),c||e?.email?(0,R.jsxs)(`div`,{className:`mt-3 space-y-1`,children:[c&&(0,R.jsx)(`p`,{className:`text-foreground text-[15px]`,children:c}),e?.email&&(0,R.jsx)(`button`,{type:`button`,className:`text-muted-foreground hover:text-foreground block text-left text-sm transition`,"aria-pressed":n,"aria-label":n?`Hide email address`:`Show email address`,onClick:()=>r(e=>!e),children:(0,R.jsx)(`span`,{className:n?void 0:`blur-[5px] select-none`,children:e.email})})]}):(0,R.jsx)(`p`,{className:`text-muted-foreground mt-3 text-sm`,children:`You’re signed in to Sprocket.`})]}),(0,R.jsxs)(`div`,{children:[(0,R.jsx)(`p`,{className:`text-muted-foreground font-mono text-[11px] tracking-[0.18em] uppercase`,children:`Spikonado Subscription Tier`}),o?(0,R.jsx)(`p`,{className:`text-foreground mt-3 text-[15px]`,children:o.tierLabel}):s?(0,R.jsx)(`p`,{className:`text-muted-foreground mt-3 text-sm`,children:`Couldn’t load your subscription right now.`}):(0,R.jsx)(`div`,{className:`bg-hover-fill mt-3.5 h-4 w-16 animate-pulse rounded`,"aria-hidden":`true`})]}),(0,R.jsx)(`div`,{children:(0,R.jsxs)(mb,{variant:`outline`,onclick:t,children:[(0,R.jsx)(U_,{className:`mr-2 size-4`,"aria-hidden":`true`}),`Sign Out`]})})]})})]})}function CS({approval:e}){return(0,R.jsxs)(`div`,{className:`max-w-md`,children:[(0,R.jsxs)(`p`,{className:`text-foreground text-sm`,children:[`Approve spending`,e.label?` · ${e.label}`:``]}),(0,R.jsx)(`p`,{className:`text-muted-foreground mt-0.5 text-xs leading-5`,children:`Opens Prava in a new tab so you can confirm with your passkey.`}),(0,R.jsx)(`a`,{href:e.approvalUrl,target:`_blank`,rel:`noopener noreferrer`,className:`border-border bg-surface/80 text-foreground hover:bg-hover-fill mt-3 inline-flex h-9 items-center rounded-full border px-4 text-xs font-medium transition`,children:`Approve mandate`})]})}var wS=`Uncaught ConvexError: `,TS=`Uncaught Error: `;function ES(e,t){if(!e.startsWith(t))return null;let n=e.slice(t.length),r=n.indexOf(`
74
- `),i=r===-1?n:n.slice(0,r),a=i.indexOf(`(`);return(a===-1?i:i.slice(0,a)).trim()||null}function DS(e){if(e instanceof Ye){let t=e.data.trim();if(t)return t}let t=e.message.trim();return t?ES(t,wS)??ES(t,TS)??t:null}function OS(e,t){return DS(e)||t}function kS(e,t){return e instanceof Error?OS(e,t):t}var AS=`border-border bg-hover-fill text-foreground placeholder:text-muted-foreground focus:border-ring h-9 w-full rounded-lg border px-3 text-[13px] outline-none`,jS=`text-muted-foreground text-[12px]`,MS=`text-muted-foreground hover:text-foreground text-[12px] transition disabled:pointer-events-none disabled:opacity-40`,NS={pause:{idle:`Pause`,busy:`Pausing…`},resume:{idle:`Resume`,busy:`Resuming…`},cancel:{idle:`Cancel`,busy:`Cancelling…`}},PS=[{value:`one_time`,label:`One time`},{value:`weekly`,label:`Weekly`},{value:`monthly`,label:`Monthly`},{value:`yearly`,label:`Yearly`}],FS=[{value:`listed`,label:`Listed merchant`},{value:`any`,label:`Any merchant`}];function IS(e,t){return e.find(e=>e.value===t)?.value??null}function LS(){let e=cr(),t=Yn(Jp.payments.listMyMandates),n=Yn(Jp.payments.setupMyMandate),r=Yn(Jp.payments.setMyMandateLifecycle),[i,a]=(0,F.useState)(``),[o,s]=(0,F.useState)(``),[c,l]=(0,F.useState)(`US`),[u,d]=(0,F.useState)(``),[f,p]=(0,F.useState)(`USD`),[m,h]=(0,F.useState)(`monthly`),[g,_]=(0,F.useState)(`listed`),[v,y]=(0,F.useState)(``),[b,x]=(0,F.useState)(!1),[S,C]=(0,F.useState)(null),[w,T]=(0,F.useState)(null),[E,D]=(0,F.useState)([]),[ee,O]=(0,F.useState)(!1),[te,ne]=(0,F.useState)(null),[re,ie]=(0,F.useState)(null),[k,ae]=(0,F.useState)(null),A=(0,F.useRef)(null),oe=e=>{A.current=e,T(e)};(0,F.useEffect)(()=>{g===`any`&&m!==`one_time`&&h(`one_time`)},[g,m]);let se=(0,F.useCallback)(async()=>{O(!0),ne(null);try{let e=await t({});D(e.mandates);let n=A.current?.mandateId;n&&e.mandates.some(e=>e.mandateId===n&&(e.status===`active`||e.status===`paused`))&&(A.current=null,T(null))}catch(e){ne(kS(e,`Couldn’t load mandates.`))}finally{O(!1)}},[t]);(0,F.useEffect)(()=>{e.isAuthenticated&&!e.isLoading&&se()},[e.isAuthenticated,e.isLoading,se]),(0,F.useEffect)(()=>{if(!w||!e.isAuthenticated)return;let t=()=>{document.visibilityState&&document.visibilityState!==`visible`||se()};return window.addEventListener(`focus`,t),document.addEventListener(`visibilitychange`,t),()=>{window.removeEventListener(`focus`,t),document.removeEventListener(`visibilitychange`,t)}},[w,e.isAuthenticated,se]);async function ce(e){e.preventDefault(),x(!0),C(null),oe(null);let t=g===`listed`;try{let e=await n({merchantName:t&&i.trim()||void 0,merchantUrl:t&&o.trim()||void 0,countryCode:t&&c.trim()||void 0,amountCap:u.trim(),currency:f.trim(),frequency:m,scope:g,description:v.trim()});oe({mandateId:e.mandateId,approvalUrl:e.approvalUrl,label:v.trim()}),await se()}catch(e){C(kS(e,`Couldn’t set up mandate.`))}finally{x(!1)}}async function le(e,t){if(e.mandateId&&re===null){ie(e.pravaMandateId),ae(t),ne(null);try{await r({mandateId:e.mandateId,action:t}),await se()}catch(e){ne(kS(e,`Couldn’t ${t} mandate.`))}finally{ie(null),ae(null)}}}return(0,R.jsxs)(`section`,{className:`flex h-full min-h-0 flex-col overflow-hidden`,children:[(0,R.jsx)(`header`,{className:`flex h-12 shrink-0 items-center px-6`,children:(0,R.jsx)(`h1`,{className:`text-foreground text-[1rem] font-medium tracking-[-0.03em]`,children:`Payments`})}),(0,R.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto px-6 py-8`,children:(0,R.jsxs)(`div`,{className:`max-w-xl space-y-10`,children:[(0,R.jsxs)(`div`,{children:[(0,R.jsx)(`p`,{className:`text-muted-foreground font-mono text-[11px] tracking-[0.18em] uppercase`,children:`Set up a spending mandate`}),(0,R.jsx)(`p`,{className:`text-muted-foreground mt-2 text-sm leading-6`,children:`Create a Prava mandate, then approve it in a new tab with your passkey.`}),(0,R.jsxs)(`form`,{className:`mt-4 space-y-3`,onSubmit:e=>void ce(e),children:[(0,R.jsxs)(`div`,{className:`grid gap-3 sm:grid-cols-2`,children:[(0,R.jsxs)(`label`,{className:`block space-y-1.5`,children:[(0,R.jsx)(`span`,{className:jS,children:`Merchant name`}),(0,R.jsx)(`input`,{className:AS,value:i,onChange:e=>a(e.currentTarget.value),placeholder:`Example Shop`,disabled:b||g===`any`})]}),(0,R.jsxs)(`label`,{className:`block space-y-1.5`,children:[(0,R.jsx)(`span`,{className:jS,children:`Merchant URL`}),(0,R.jsx)(`input`,{className:AS,value:o,onChange:e=>s(e.currentTarget.value),placeholder:`https://example.com`,disabled:b||g===`any`})]}),(0,R.jsxs)(`label`,{className:`block space-y-1.5`,children:[(0,R.jsx)(`span`,{className:jS,children:`Country code`}),(0,R.jsx)(`input`,{className:AS,value:c,onChange:e=>l(e.currentTarget.value),placeholder:`US`,disabled:b||g===`any`})]}),(0,R.jsxs)(`label`,{className:`block space-y-1.5`,children:[(0,R.jsx)(`span`,{className:jS,children:`Amount cap`}),(0,R.jsx)(`input`,{className:AS,value:u,onChange:e=>d(e.currentTarget.value),placeholder:`120.00`,required:!0,disabled:b})]}),(0,R.jsxs)(`label`,{className:`block space-y-1.5`,children:[(0,R.jsx)(`span`,{className:jS,children:`Currency`}),(0,R.jsx)(`input`,{className:AS,value:f,onChange:e=>p(e.currentTarget.value),placeholder:`USD`,required:!0,disabled:b})]}),(0,R.jsxs)(`label`,{className:`block space-y-1.5`,children:[(0,R.jsx)(`span`,{className:jS,children:`Frequency`}),(0,R.jsx)(`select`,{className:AS,value:m,onChange:e=>{let t=IS(PS,e.currentTarget.value);t&&h(t)},disabled:b||g===`any`,children:PS.map(e=>(0,R.jsx)(`option`,{value:e.value,children:e.label},e.value))})]}),(0,R.jsxs)(`label`,{className:`block space-y-1.5 sm:col-span-2`,children:[(0,R.jsx)(`span`,{className:jS,children:`Scope`}),(0,R.jsx)(`select`,{className:AS,value:g,onChange:e=>{let t=IS(FS,e.currentTarget.value);t&&_(t)},disabled:b,children:FS.map(e=>(0,R.jsx)(`option`,{value:e.value,children:e.label},e.value))})]}),(0,R.jsxs)(`label`,{className:`block space-y-1.5 sm:col-span-2`,children:[(0,R.jsx)(`span`,{className:jS,children:`Description`}),(0,R.jsx)(`input`,{className:AS,value:v,onChange:e=>y(e.currentTarget.value),placeholder:`Agent shopping budget`,required:!0,disabled:b})]})]}),S&&(0,R.jsx)(`p`,{className:`text-destructive text-sm`,children:S}),(0,R.jsx)(mb,{type:`submit`,variant:`outline`,disabled:b,children:b?`Setting up…`:`Set up mandate`})]}),w&&(0,R.jsx)(`div`,{className:`mt-4`,children:(0,R.jsx)(CS,{approval:w})})]}),(0,R.jsxs)(`div`,{children:[(0,R.jsx)(`p`,{className:`text-muted-foreground font-mono text-[11px] tracking-[0.18em] uppercase`,children:`Your mandates`}),te&&(0,R.jsx)(`p`,{className:`text-destructive mt-3 text-sm`,children:te}),ee&&E.length===0?(0,R.jsx)(`div`,{className:`mt-4 animate-pulse space-y-4`,"aria-hidden":`true`,children:[0,1].map(e=>(0,R.jsxs)(`div`,{className:`space-y-2`,children:[(0,R.jsx)(`div`,{className:`bg-hover-fill h-3.5 w-40 rounded`}),(0,R.jsx)(`div`,{className:`bg-hover-fill h-3 w-56 rounded`})]},e))}):E.length===0?(0,R.jsx)(`p`,{className:`text-muted-foreground mt-3 text-sm leading-6`,children:`No mandates yet.`}):(0,R.jsx)(`ul`,{className:`mt-3 space-y-1`,children:E.map(e=>{let t=re===e.pravaMandateId?k:null,n=!!e.mandateId&&e.status===`active`,r=!!e.mandateId&&e.status===`paused`,i=[n?`pause`:`resume`,`cancel`];return(0,R.jsxs)(`li`,{className:`py-2`,children:[(0,R.jsxs)(`div`,{className:`flex items-baseline justify-between gap-3`,children:[(0,R.jsx)(`p`,{className:`text-foreground truncate text-[14px]`,children:e.description?.trim()||e.merchantName?.trim()||`Spending mandate`}),(0,R.jsx)(`p`,{className:`text-muted-foreground shrink-0 text-[12px] capitalize`,children:e.status})]}),(0,R.jsxs)(`p`,{className:`text-muted-foreground mt-0.5 text-[12px]`,children:[e.approvedAmount,` `,e.currency,e.remaining!==void 0&&(0,R.jsxs)(R.Fragment,{children:[` · `,e.remaining,` remaining`]}),e.validUntil&&(0,R.jsxs)(R.Fragment,{children:[` · until `,e.validUntil]}),e.renewsAt&&(0,R.jsxs)(R.Fragment,{children:[` · renews `,e.renewsAt]})]}),(n||r)&&(0,R.jsx)(`div`,{className:`mt-1.5 flex flex-wrap items-center gap-x-3 gap-y-1`,children:i.map(n=>(0,R.jsx)(`button`,{type:`button`,className:MS,disabled:re!==null,onClick:()=>void le(e,n),children:t===n?NS[n].busy:NS[n].idle},n))})]},e.pravaMandateId)})})]})]})})]})}function RS({userId:e,desktopApi:t,openAiConfigured:n,chatGptStatus:r,chatGptLoading:i,chatGptStatusError:a,loading:o,loadError:s,onChatGptStatusChange:c,onConfigurationChange:l}){let u=Yn(Jp.providerCredentials.saveOpenAiKey),d=Yn(Jp.providerCredentials.removeOpenAiKey),[f,p]=(0,F.useState)(``),[m,h]=(0,F.useState)(!1),[g,_]=(0,F.useState)(!1),[v,y]=(0,F.useState)(!1),[b,x]=(0,F.useState)(null),[S,C]=(0,F.useState)(!1),[w,T]=(0,F.useState)(!1),[E,D]=(0,F.useState)(!1),[ee,O]=(0,F.useState)(null),[te,ne]=(0,F.useState)(null),re=(0,F.useRef)(null),ie=(0,F.useRef)(null),k=(0,F.useRef)(0),ae=r?.accounts.find(e=>e.connectionId===r.activeConnectionId)??null,A=(e,t)=>{re.current=t?{userId:e,login:t}:null,D(!!t),t||oe()};function oe(){ie.current?.close(),ie.current=null}function se(e,t){return DS(e)??t}function ce(e){t?.cancelChatGptBrowserLogin({userId:e.userId,state:e.login.state}).catch(()=>{})}function le(){k.current+=1;let e=re.current;return re.current=null,D(!1),oe(),T(!1),e}(0,F.useEffect)(()=>(D(!1),T(!1),ne(null),O(null),()=>{k.current+=1;let e=re.current;re.current=null,oe(),e&&t?.cancelChatGptBrowserLogin({userId:e.userId,state:e.login.state}).catch(()=>{})}),[t,e]);async function ue(e,n,r){for(;;){if(await new Promise(e=>setTimeout(e,1500)),r!==k.current)return;try{let i=await n.fetchChatGptBrowserLoginResult({userId:e.userId,state:e.login.state});if(r!==k.current)return;if(i.status===`pending`)continue;if(A(e.userId,null),T(!1),i.status===`error`){ne(i.error??`ChatGPT sign-in failed.`);return}let a=await n.fetchChatGptStatus({userId:e.userId});if(r!==k.current||n!==t)return;c(a);return}catch(t){if(r!==k.current)return;A(e.userId,null),T(!1),ne(se(pf(Error).catch(Error()).parse(t),`Couldn’t complete ChatGPT sign-in. Check your connection status.`));return}}}async function de(n){let r=t;if(!r||w)return;T(!0),D(!0),ne(null),O(null);let i=e,a=++k.current,o=window.sprocketDesktopBridge,s=null,c=null;try{if(!o){if(s=window.open(`about:blank`,`_blank`),ie.current=s,!s)throw Error(`Your browser blocked the sign-in window. Allow popups and try again.`);s.opener=null}let e=await r.startChatGptBrowserLogin(n?{userId:i,connectionId:n}:{userId:i});if(c={userId:i,login:e},a!==k.current){ce(c);return}if(o?await o.openExternal(e.authorizeUrl):s?.location.replace(e.authorizeUrl),a!==k.current){ce(c);return}A(i,e),ue(c,r,a)}catch(e){if(ie.current===s&&oe(),c&&ce(c),a!==k.current)return;D(!1),ne(se(pf(Error).catch(Error()).parse(e),`Couldn’t start ChatGPT sign-in.`)),T(!1)}}function fe(){let e=le();e&&ce(e)}async function pe(n){let r=t;if(!r||w)return;T(!0),ne(null),O(null);let i=e,a=++k.current;try{await r.selectChatGptAccount({userId:i,connectionId:n});let e=await r.fetchChatGptStatus({userId:i});if(a!==k.current||r!==t)return;c(e)}catch(e){if(a!==k.current)return;ne(se(pf(Error).catch(Error()).parse(e),`Couldn’t switch ChatGPT account.`))}finally{a===k.current&&T(!1)}}async function me(){let n=t;if(!n||w)return;let r=++k.current;T(!0),ne(null);try{let t=await n.fetchChatGptStatus({userId:e});r===k.current&&c(t)}catch(e){r===k.current&&ne(se(pf(Error).catch(Error()).parse(e),`Could not refresh ChatGPT status.`))}finally{r===k.current&&T(!1)}}async function he(n){let i=t;if(!i||w)return;let a=le();a&&ce(a),T(!0),ne(null),O(null);let o=e,s=++k.current;try{let e=await i.disconnectChatGptAccount({userId:o,connectionId:n});if(s!==k.current||i!==t)return;if(O(e),r){let e=r.activeConnectionId===n?null:r.activeConnectionId;c({accounts:r.accounts.filter(e=>e.connectionId!==n),activeConnectionId:e,loginAvailable:r.loginAvailable})}let a=await i.fetchChatGptStatus({userId:o});if(s!==k.current||i!==t)return;c(a)}catch(e){if(s!==k.current)return;ne(se(pf(Error).catch(Error()).parse(e),`Couldn’t sign out of ChatGPT.`))}finally{s===k.current&&T(!1)}}async function ge(e){if(e.preventDefault(),f.trim()&&!g){_(!0),x(null),C(!1);try{await u({apiKey:f}),p(``),h(!1),C(!0),l({provider:`openai`,configured:!0})}catch(e){x(se(pf(Error).catch(Error()).parse(e),`Couldn’t save the OpenAI key.`))}finally{_(!1)}}}async function _e(){if(!g){_(!0),x(null),C(!1);try{await d({}),y(!1),l({provider:`openai`,configured:!1})}catch(e){x(se(pf(Error).catch(Error()).parse(e),`Couldn’t remove the OpenAI key.`))}finally{_(!1)}}}let ve=i?`Checking connection…`:a?`Connection status unavailable`:ae?.connected?`Connected as ${ae.label}`:r&&r.accounts.length>0?`Signed out`:`Not connected`;return(0,R.jsxs)(`section`,{className:`flex h-full min-h-0 flex-col overflow-hidden`,children:[(0,R.jsx)(`header`,{className:`flex h-12 shrink-0 items-center px-6`,children:(0,R.jsx)(`h1`,{className:`text-foreground text-[1rem] font-medium tracking-[-0.03em]`,children:`BYOK/BYOS`})}),(0,R.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto px-6 py-8`,children:(0,R.jsxs)(`div`,{className:`max-w-xl space-y-4`,children:[(0,R.jsx)(`p`,{className:`text-muted-foreground mb-5 text-sm leading-6`,children:`Use your own API keys or subscriptions. ChatGPT credentials stay in a protected file on this computer. OpenAI API keys are encrypted in WorkOS Vault.`}),(0,R.jsxs)(`div`,{className:`border-border rounded-xl border p-5`,children:[(0,R.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,R.jsx)(Px,{provider:`openai`,className:`size-5`}),(0,R.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,R.jsx)(`p`,{className:`text-foreground text-[15px] font-medium`,children:`ChatGPT Subscription`}),(0,R.jsx)(`p`,{className:`text-muted-foreground mt-0.5 text-[12px]`,children:ve})]}),(0,R.jsx)(`button`,{type:`button`,className:`text-primary text-[13px] disabled:opacity-50`,disabled:!t||w||i,onClick:()=>void me(),children:`Refresh`})]}),E?(0,R.jsxs)(`div`,{className:`mt-5 flex items-center gap-3`,children:[(0,R.jsx)(`span`,{className:`text-muted-foreground text-[12px]`,children:`Signing in…`}),(0,R.jsx)(`button`,{type:`button`,className:`text-muted-foreground text-[13px]`,onClick:fe,children:`Cancel`})]}):(0,R.jsxs)(`div`,{className:`mt-5 space-y-4`,children:[r&&r.accounts.length>0&&(0,R.jsx)(`ul`,{className:`space-y-2`,children:r.accounts.map(e=>{let t=e.connectionId===r.activeConnectionId;return(0,R.jsxs)(`li`,{className:`border-border flex items-center gap-3 rounded-lg border px-3 py-2`,children:[(0,R.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,R.jsx)(`p`,{className:`text-foreground truncate text-[13px] font-medium`,children:e.label}),(0,R.jsx)(`p`,{className:`text-muted-foreground text-[12px]`,children:t?`Active`:e.connected?`Signed in`:`Signed out`})]}),!t&&e.connected&&(0,R.jsx)(`button`,{type:`button`,className:`text-primary text-[13px] disabled:opacity-50`,disabled:w,onClick:()=>void pe(e.connectionId),children:`Use`}),!e.connected&&(0,R.jsx)(`button`,{type:`button`,className:`text-primary text-[13px] disabled:opacity-50`,disabled:w||!r.loginAvailable,onClick:()=>void de(e.connectionId),children:`Reconnect`}),(0,R.jsx)(`button`,{type:`button`,className:`text-muted-foreground hover:text-foreground text-[13px] disabled:opacity-50`,disabled:w,onClick:()=>void he(e.connectionId),children:`Sign out`})]},e.connectionId)})}),r?.loginAvailable===!1?(0,R.jsx)(`p`,{className:`text-muted-foreground text-[12px] leading-5`,children:`ChatGPT sign-in runs through the local Sprocket server, which isn’t available for this window. Open Sprocket on your desktop to sign in.`}):(0,R.jsx)(mb,{disabled:w||i||!t,onclick:()=>void de(),children:w?`Starting…`:r?.accounts.length?`Add account`:`Continue with ChatGPT`})]}),ee&&(0,R.jsx)(`p`,{className:`text-muted-foreground mt-4 text-[12px]`,role:`status`,children:ee}),(0,R.jsx)(`p`,{className:`text-muted-foreground mt-4 text-[12px] leading-5`,children:`Usage counts against your ChatGPT Codex allowance.`}),te&&(0,R.jsx)(`p`,{className:`text-destructive mt-4 text-sm`,role:`alert`,children:te}),a&&(0,R.jsx)(`p`,{className:`text-destructive mt-4 text-sm`,role:`alert`,children:a})]}),(0,R.jsxs)(`div`,{className:`border-border rounded-xl border p-5`,children:[(0,R.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,R.jsx)(Px,{provider:`openai`,className:`size-5`}),(0,R.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,R.jsx)(`p`,{className:`text-foreground text-[15px] font-medium`,children:`OpenAI API`}),(0,R.jsx)(`p`,{className:`text-muted-foreground mt-0.5 text-[12px]`,children:o?`Checking configuration…`:n?`Connected`:`Not configured`})]})]}),(0,R.jsxs)(`form`,{className:`mt-5 space-y-3`,onSubmit:e=>void ge(e),children:[(0,R.jsxs)(`label`,{className:`block space-y-1.5`,children:[(0,R.jsx)(`span`,{className:`text-muted-foreground text-[12px]`,children:`API key`}),(0,R.jsxs)(`div`,{className:`relative`,children:[(0,R.jsx)(`input`,{type:m?`text`:`password`,value:f,onChange:e=>p(e.currentTarget.value),autoComplete:`off`,spellCheck:!1,placeholder:n?`Enter a replacement key`:`sk-…`,disabled:g||o,className:`border-border bg-hover-fill text-foreground placeholder:text-muted-foreground focus:border-ring h-10 w-full rounded-lg border pr-10 pl-3 font-mono text-[13px] outline-none disabled:opacity-50`}),(0,R.jsx)(`button`,{type:`button`,className:`text-muted-foreground hover:text-foreground absolute inset-y-0 right-0 flex w-10 items-center justify-center`,"aria-label":m?`Hide API key`:`Show API key`,disabled:g||o,onClick:()=>h(e=>!e),children:m?(0,R.jsx)(h_,{className:`size-4`}):(0,R.jsx)(__,{className:`size-4`})})]})]}),(0,R.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3`,children:[(0,R.jsx)(mb,{type:`submit`,disabled:g||o||!f.trim(),children:g?`Saving…`:n?`Replace key`:`Connect API key`}),n&&!v?(0,R.jsx)(mb,{type:`button`,variant:`outline`,disabled:g,onclick:()=>y(!0),children:`Remove`}):v?(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(mb,{type:`button`,variant:`outline`,disabled:g,onclick:()=>void _e(),children:g?`Removing…`:`Confirm removal`}),(0,R.jsx)(`button`,{type:`button`,className:`text-muted-foreground hover:text-foreground text-[13px]`,disabled:g,onClick:()=>y(!1),children:`Cancel`})]}):null,S&&(0,R.jsx)(`span`,{className:`text-muted-foreground text-[12px]`,children:`Saved`})]})]}),b&&(0,R.jsx)(`p`,{className:`text-destructive mt-4 text-sm`,role:`alert`,children:b})]}),s&&(0,R.jsx)(`p`,{className:`text-destructive text-sm`,role:`alert`,children:s})]})})]})}var zS=[{id:`account`,label:`Account`,icon:kv},{id:`usage`,label:`Usage`,icon:Vg},{id:`providers`,label:`BYOK/BYOS`,icon:L_},{id:`payments`,label:`Payments`,icon:a_}],BS=`flex w-full items-center gap-2.5 rounded-lg px-2.5 py-1.5 text-left text-[13px] transition`,VS=`bg-hover-fill-strong text-foreground`,HS=`text-muted-foreground hover:bg-hover-fill hover:text-foreground`;function US({activePage:e,theme:t,onThemeChange:n,onBack:r,onNavigate:i}){return(0,R.jsx)(`aside`,{className:`app-sidebar-panel`,children:(0,R.jsxs)(`div`,{className:`flex h-full min-h-0 flex-col overflow-hidden`,children:[(0,R.jsxs)(`div`,{className:`flex items-center justify-between gap-2 px-3.5 pt-3 pb-3`,children:[(0,R.jsxs)(`button`,{type:`button`,className:`text-muted-foreground hover:text-foreground hover:bg-hover-fill inline-flex h-8 items-center gap-2 rounded-lg px-2 text-[13px] transition`,onClick:r,children:[(0,R.jsx)(kg,{className:`size-3.5`,"aria-hidden":`true`}),`Back`]}),(0,R.jsx)(hS,{theme:t,onThemeChange:n})]}),(0,R.jsx)(`nav`,{className:`hide-scrollbar min-h-0 flex-1 space-y-0.5 overflow-y-auto px-2.5 pb-4`,"aria-label":`Settings`,children:zS.map(t=>(0,R.jsxs)(`button`,{type:`button`,className:`${BS} ${e===t.id?VS:HS}`,"aria-current":e===t.id?`page`:void 0,onClick:()=>{i(t.id)},children:[(0,R.jsx)(t.icon,{className:`text-muted-foreground size-4 shrink-0`,"aria-hidden":`true`}),(0,R.jsx)(`span`,{className:`truncate`,children:t.label})]},t.id))})]})})}var WS=[{id:`modelUsage`,label:`Model usage`,noun:`model usage`,description:`More expensive models use up more usage.`}],GS=[`weekly`,`monthly`],KS=1e9,qS=new Intl.NumberFormat(`en-US`,{style:`currency`,currency:`USD`,minimumFractionDigits:2,maximumFractionDigits:2}),JS={weekly:`Weekly`,monthly:`Monthly`};function YS(e){return qS.format(e/KS)}function XS(e,t){return e?`bg-rose-400/90`:t?`bg-amber-400/90`:`bg-foreground/25`}function ZS(){let e=cr(),t=sx(),n=qn({query:Jp.usage.getMyUsage,args:e.isAuthenticated&&!e.isLoading?{now:t}:`skip`}),r=n.status===`success`?n.data:null,i=n.status===`error`;return(0,R.jsxs)(`section`,{className:`flex h-full min-h-0 flex-col overflow-hidden`,children:[(0,R.jsx)(`header`,{className:`flex h-12 shrink-0 items-center px-6`,children:(0,R.jsx)(`h1`,{className:`text-foreground text-[1rem] font-medium tracking-[-0.03em]`,children:`Usage`})}),(0,R.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto px-6 py-8`,children:(0,R.jsx)(`div`,{className:`max-w-xl space-y-10`,children:i?(0,R.jsx)(`p`,{className:`text-muted-foreground text-sm leading-6`,children:`Couldn’t load your usage right now. Try again in a moment.`}):r===null?(0,R.jsxs)(`div`,{className:`animate-pulse space-y-10`,"aria-hidden":`true`,children:[(0,R.jsx)(`div`,{className:`bg-hover-fill h-4 w-24 rounded`}),WS.map(e=>(0,R.jsxs)(`div`,{className:`space-y-5`,children:[(0,R.jsx)(`div`,{className:`bg-hover-fill h-3 w-28 rounded`}),GS.map(e=>(0,R.jsxs)(`div`,{className:`space-y-2`,children:[(0,R.jsx)(`div`,{className:`bg-hover-fill h-3.5 w-full rounded`}),(0,R.jsx)(`div`,{className:`bg-hover-fill h-1.5 w-full rounded-full`})]},e))]},e.id))]}):(0,R.jsxs)(R.Fragment,{children:[(0,R.jsxs)(`div`,{children:[(0,R.jsx)(`p`,{className:`text-muted-foreground text-[11px] tracking-[0.18em] uppercase`,children:`Subscription Tier`}),(0,R.jsx)(`p`,{className:`text-foreground mt-3 text-[15px]`,children:r.tierLabel})]}),r.meters.map(e=>(0,R.jsxs)(`div`,{children:[(0,R.jsx)(`p`,{className:`text-muted-foreground text-[11px] tracking-[0.18em] uppercase`,children:e.label}),e.description&&(0,R.jsx)(`p`,{className:`text-muted-foreground mt-1 text-[12px]`,children:e.description}),(0,R.jsx)(`div`,{className:`mt-4 space-y-6`,children:e.windows.map(n=>{let r=n.limit>0,i=r?Math.round(n.used/n.limit*100):0,a=r&&n.used>=n.limit,o=r&&n.used>=n.limit*.9;return(0,R.jsxs)(`div`,{children:[(0,R.jsxs)(`div`,{className:`flex items-baseline justify-between gap-3`,children:[(0,R.jsx)(`p`,{className:`text-muted-foreground text-[13px]`,children:JS[n.period]}),r&&(0,R.jsxs)(`p`,{className:`text-[12px] ${a?`text-destructive`:o?`text-amber-800 dark:text-amber-300`:`text-muted-foreground`}`,children:[i,`% used`]})]}),(0,R.jsxs)(`p`,{className:`text-muted-foreground mt-0.5 text-[12px]`,children:[YS(r?n.used:0),` /`,` `,YS(r?n.limit:0)]}),(0,R.jsx)(`div`,{className:`bg-hover-fill mt-2 h-1.5 overflow-hidden rounded-full`,role:`progressbar`,"aria-label":`${e.label} — ${JS[n.period]}`,"aria-valuemin":0,"aria-valuemax":r?n.limit:0,"aria-valuenow":r?Math.min(n.used,n.limit):0,"aria-valuetext":r?`${i}% used`:`0 / 0`,children:(0,R.jsx)(`div`,{className:`h-full rounded-full transition-[width] duration-300 ${XS(a,o)}`,style:{width:`${r?Math.min(100,Math.max(0,i)):0}%`}})}),n.resetsAt!==null&&(0,R.jsxs)(`p`,{className:`text-muted-foreground mt-1.5 text-[12px]`,children:[`Resets in `,ax(n.resetsAt-t)]})]},n.period)})})]},e.id))]})})})]})}function QS(e){return Object.prototype.toString.call(e)===`[object String]`&&!(e instanceof String)}function $S(e){return e!=null&&!Array.isArray(e)&&Object(e)===e}var eC=P.union(P.string(),P.number(),P.boolean(),P.null()),tC=8;function nC(e){return e===0?eC:P.union(eC,P.array(nC(e-1)),P.record(P.string(),nC(e-1)))}var rC=nC(tC);function iC(e){if($S(e)&&QS(e.error)&&(e.status===`cancelled`||e.status===`failed`))return{error:e.error,status:e.status}}function aC(e){let t=``,n,r=!1;for(let i of e)i.type===`text`&&i.text.length!==0&&(r&&n!==void 0&&i.turnId!==void 0&&i.turnId!==n&&(t+=`
73
+ `):null}async function tm(e,t,n){if(!e.body)return;let r=e.body.getReader(),i=new TextDecoder,a=``,o=()=>void r.cancel(t.reason).catch(()=>void 0);t.addEventListener(`abort`,o,{once:!0});try{for(;!t.aborted;){let{done:e,value:o}=await r.read();a+=i.decode(o,{stream:!e});let s=/\r?\n\r?\n/.exec(a);for(;s;){let e=em(a.slice(0,s.index));a=a.slice(s.index+s[0].length),e!==null&&!t.aborted&&n(e),s=/\r?\n\r?\n/.exec(a)}if(e)break}}catch(e){if(!t.aborted)throw e}finally{t.removeEventListener(`abort`,o),await r.cancel().catch(()=>void 0),r.releaseLock()}}function nm(e){async function t(t,n){return await fetch(`${e}${t}`,{...n,credentials:`include`,headers:{"content-type":`application/json`,...n?.headers}})}return{async request(n,r,i){let a=await $p(await t(n,i),e);if(a.status===204)throw Error(`Local API returned an empty response.`);return await Zp(a,r,e)},async response(n,r){return await $p(await t(n,r),e)},async postEventStream(n,r,i,a){await tm(await $p(await t(n,{method:`POST`,body:JSON.stringify(r),signal:i}),e),i,a)}}}var rm=Od({error:L().optional()}),im=Od({authenticated:vd().optional()}),am=Od({parentPath:L(),entries:Ed(Od({name:L(),fullPath:L()})),volumeList:vd().optional()}),om=Od({skills:Ed(Od({name:L(),description:L()})),warnings:Ed(L())}),sm=Od({entries:Ed(Od({path:L(),kind:zd([`file`,`directory`])})),scanning:vd()}),cm=Od({workspacePath:L(),displayName:L(),repositoryKey:L()}),lm=Od({workspacePath:L(),repositoryKey:L(),attachmentKey:L(),displayName:L(),availability:zd([`available`,`unavailable`]),lastValidatedAt:gd(),lastUsedAt:gd(),lastMessageSentAt:gd().optional(),unavailableReason:L().optional()}),um=Od({commands:Ed(Od({sessionId:L(),command:L(),workdir:L(),startedAt:md()}))}),dm=Od({runId:L(),threadId:L()}),fm=Od({storageId:L(),name:L(),mediaType:L(),size:gd(),url:Zu().optional()}),pm=jd([Od({storageId:L(),name:L(),mediaType:L(),size:md(),url:L()}),Od({error:L()})]);function mm(e){let t=`userId=${encodeURIComponent(e.userId)}&name=${encodeURIComponent(e.name)}`;return e.threadId&&(t+=`&threadId=${encodeURIComponent(e.threadId)}`),`/api/transcript/upload?${t}`}var hm=Od({id:L(),threadId:L(),runId:L(),sequence:gd().nonnegative(),kind:zd([`prompt`,`text`,`work`,`approval`]),text:L().optional(),attachments:Ed(fm).optional(),mandateId:L().optional(),approvalUrl:L().optional(),itemCount:gd().nonnegative(),pendingTools:gd().nonnegative(),provisional:vd().optional(),startedAt:md().optional(),completedAt:md().optional(),closed:vd(),revision:gd().nonnegative()}).transform(e=>({...e,threadId:Em(e.threadId),runId:Em(e.runId),attachments:e.attachments?.map(e=>({...e,storageId:Em(e.storageId)}))})),gm=Od({replicaId:L(),rows:Ed(hm),indexing:vd(),stale:vd(),nextBefore:gd().nonnegative().optional(),endSequence:gd().nonnegative(),revision:gd().nonnegative(),persistedStreams:Ed(Od({runId:L().transform(e=>Em(e)),streamId:L()})),changes:Ed(Od({id:L(),row:hm.nullable()})),changesCursor:Od({revision:gd().nonnegative(),sequence:gd().min(-1)}),moreChanges:vd()}),_m=Od({parts:Ed(Sd()),indexing:vd(),nextAfter:gd().nonnegative().optional(),previousBefore:gd().nonnegative().optional(),revision:gd().nonnegative(),stale:vd()}),vm=Od({eventType:L(),totalParts:gd().optional(),stale:vd()}),ym=Od({threadId:L(),runId:L(),runStatus:zd([`queued`,`running`,`completed`,`failed`,`cancelled`]),streamId:L().min(1),text:L(),parts:Ed(Sd()),runStartedAt:gd()}),bm=Nd(`eventType`,[Od({eventType:Vd(`updated`),live:ym}),Od({eventType:Vd(`cleared`)})]),xm=Od({artifacts:Ed(Od({_id:L(),userId:L(),repositoryKey:L(),localPath:L().optional(),content:L(),type:zd([`markdown`,`html`,`react`]),title:L(),revision:md(),createdAt:md(),updatedAt:md(),localError:L().optional()})),stale:vd(),error:L().optional()}),Sm=Od({accounts:Ed(Od({connectionId:L(),label:L(),connected:vd()})),activeConnectionId:L().nullable(),loginAvailable:vd(),error:L().optional()}),Cm=Od({state:L(),authorizeUrl:L()}),wm=Od({status:zd([`pending`,`complete`,`error`]),error:L().optional()}),Tm=Od({warning:L().nullable()});function Em(e){return e}function Dm(e){return e}function Om(e){return{threadId:Em(e.threadId),runId:Em(e.runId),runStatus:e.runStatus,streamId:e.streamId,text:e.text,parts:e.parts,runStartedAt:e.runStartedAt}}function km(e){return e.eventType===`updated`?{eventType:`updated`,live:Om(e.live)}:{eventType:`cleared`}}function Am(e){return{artifacts:e.artifacts,stale:e.stale,error:e.error}}function jm(){return globalThis.window?globalThis.window.location.origin:null}function Mm(e){if(!globalThis.window)return null;let t=globalThis.window.location.hash.startsWith(`#`)?globalThis.window.location.hash.slice(1):globalThis.window.location.hash;return new URLSearchParams(t).get(e)}function Nm(){return Mm(`workspace`)}function Pm(){if(!globalThis.window)return;let e=new URL(globalThis.window.location.href);e.hash=``,globalThis.window.history.replaceState(null,``,`${e.pathname}${e.search}`)}async function Fm(e){let t=await fetch(`${e}/api/auth/bootstrap`,{method:`POST`,credentials:`include`});if(!t.ok){let e=rm.safeParse(await t.json().catch(()=>null));throw Error(e.success?e.data.error??`Failed to authenticate with the Sprocket server.`:`Failed to authenticate with the Sprocket server.`)}}async function Im(e){let t=await fetch(`${e}/api/auth/session`,{credentials:`include`});if(!t.ok)return!1;let n=im.safeParse(await t.json());return n.success?!!n.data.authenticated:!1}var Lm=new Map;async function Rm(e){let t=Lm.get(e);if(t)return await t;let n=zm(e);Lm.set(e,n);try{await n}finally{Lm.delete(e)}}async function zm(e){await Im(e)||await Fm(e)}function Bm(e){let t=nm(e),{request:n}=t;return{browseFilesystem:e=>{let t=e.cwd?{partialPath:e.partialPath,cwd:e.cwd}:{partialPath:e.partialPath};return n(`/api/workspace/browse`,am,{method:`POST`,body:JSON.stringify(t)})},listWorkspaceSkills:e=>n(`/api/workspace/skills`,om,{method:`POST`,body:JSON.stringify({workspacePath:e.workspacePath})}),searchWorkspace:(e,t)=>n(`/api/workspace/search`,sm,{method:`POST`,body:JSON.stringify(e),signal:t}),resolveWorkspacePath:e=>{let t=e.createIfMissing?{workspacePath:e.workspacePath,createIfMissing:!0}:{workspacePath:e.workspacePath};return n(`/api/workspace/resolve`,cm,{method:`POST`,body:JSON.stringify(t)})},listProjectAttachments:async()=>(await n(`/api/workspace/projects`,Ed(lm))).map(Dm),attachProject:async e=>Dm(await n(`/api/workspace/projects`,lm,{method:`POST`,body:JSON.stringify(e)})),listRunningCommands:(e,t)=>n(`/api/agent/commands`,um,{method:`POST`,body:JSON.stringify(e),signal:t}),terminateCommand:e=>n(`/api/agent/commands/terminate`,Od({terminated:vd()}),{method:`POST`,body:JSON.stringify(e)}),runAgent:async e=>{let t=await n(`/api/agent/run`,dm,{method:`POST`,body:JSON.stringify(e)});return{runId:Em(t.runId),threadId:Em(t.threadId)}},fetchTranscriptDisplay:async(e,t)=>await n(`/api/transcript/display`,gm,{method:`POST`,body:JSON.stringify(e),signal:t}),fetchTranscriptDisplayDetails:async(e,t)=>{let r=await n(`/api/transcript/display-details`,_m,{method:`POST`,body:JSON.stringify(e),signal:t});return{...r,parts:r.parts}},watchTranscript:async(e,n)=>{await t.postEventStream(`/api/transcript/watch`,e,n.signal,e=>{let t=vm.safeParse(JSON.parse(e));t.success&&n.onEvent(t.data)})},watchLiveCompletion:async(e,n)=>{await t.postEventStream(`/api/agent/live`,e,n.signal,e=>{let t=bm.safeParse(JSON.parse(e));t.success&&n.onEvent(km(t.data))})},clearTranscriptReplica:async e=>{await t.response(`/api/transcript/clear`,{method:`POST`,body:JSON.stringify(e)})},fetchTranscriptAttachment:async t=>{let n=await fetch(`${e}/api/transcript/attachment`,{method:`POST`,credentials:`include`,headers:{"content-type":`application/json`},body:JSON.stringify(t)});return n.status===404||!n.ok?null:await n.blob()},uploadTranscriptAttachment:async e=>{let t=await n(mm({userId:e.userId,name:e.name,threadId:e.threadId}),pm,{method:`POST`,headers:{"content-type":e.file.type.trim()||`application/octet-stream`},body:e.file});return`error`in t?t:{storageId:Em(t.storageId),name:t.name,mediaType:t.mediaType,size:t.size,url:t.url}},discardTranscriptAttachment:async e=>await n(`/api/transcript/discard`,vd(),{method:`POST`,body:JSON.stringify({userId:e.userId,storageId:e.storageId,threadId:e.threadId})}),deleteArtifact:async e=>{await n(`/api/artifacts/delete`,bd(),{method:`POST`,body:JSON.stringify(e)})},watchArtifacts:async(e,n)=>{await t.postEventStream(`/api/artifacts/watch`,e,n.signal,e=>{let t=xm.parse(JSON.parse(e));n.onEvent(Am(t))})},requestRunCancellation:async e=>{await n(`/api/threads/cancel`,vd(),{method:`POST`,body:JSON.stringify(e)})},startAccountSession:async e=>{await n(`/api/threads/account-session/start`,bd(),{method:`POST`,body:JSON.stringify(e)})},endAccountSession:async e=>{await n(`/api/threads/account-session/end`,bd(),{method:`POST`,body:JSON.stringify(e)})},fetchChatGptStatus:async e=>await n(`/api/chatgpt/status`,Sm,{method:`POST`,body:JSON.stringify(e)}),startChatGptBrowserLogin:async e=>await n(`/api/chatgpt/browser/start`,Cm,{method:`POST`,body:JSON.stringify(e)}),fetchChatGptBrowserLoginResult:async e=>await n(`/api/chatgpt/browser/result`,wm,{method:`POST`,body:JSON.stringify(e)}),cancelChatGptBrowserLogin:async e=>{await n(`/api/chatgpt/browser/cancel`,bd(),{method:`POST`,body:JSON.stringify(e)})},selectChatGptAccount:async e=>{await n(`/api/chatgpt/select`,bd(),{method:`POST`,body:JSON.stringify(e)})},disconnectChatGptAccount:async e=>{let{warning:t}=await n(`/api/chatgpt/disconnect`,Tm,{method:`POST`,body:JSON.stringify(e)});return t}}}async function Vm(){let e=jm();if(!e)throw Error(`Unable to resolve the Sprocket server URL.`);return await Rm(e),Bm(e)}function Hm(e){let t=e,n=new Set,r=e=>{if(!Object.is(t,e)){t=e;for(let e of n)e()}};return{getSnapshot:()=>t,subscribe(e){return n.add(e),()=>{n.delete(e)}},set:r,update:e=>r(e(t))}}function Um(e,t){let n=e.getSnapshot(),r=t(n);return{subscribe:e.subscribe,getSnapshot(){let i=e.getSnapshot();return Object.is(n,i)||(n=i,r=t(i)),r}}}function Wm(e){return(0,F.useSyncExternalStore)(e.subscribe,e.getSnapshot)}var Gm=Hm({isLoading:!0,isReady:!1,isConfigured:!0,isWaitingForBrowserSignIn:!1,browserSignInUrl:null,user:null,nativeSession:`notRequired`,error:null}),Km=Um(Gm,e=>e.user?.id??null),qm=Um(Gm,e=>!e.isReady||e.isLoading),Jm=Hm(0),Ym=Hm(!1),Xm=1500,Zm=3e5,Qm=`Native sign-in is temporarily unavailable. Try again.`,$m=null,eh=`This device is signed in with a different account. Sign out, then sign in with the same account.`,th={createAuthKitClient:Gp,resolveLocalApiBaseUrl:jm,ensureLocalSession:Rm},nh=!1;function rh(){return globalThis.window??null}var ih=null,ah=null,oh=null,sh=!1,ch=null,lh=Promise.resolve(),uh=0,dh=null,fh=null,ph=Od({error:L().optional()}),mh=Od({authorizationUrl:Zu(),loginId:L()}),hh=Od({id:L(),email:qu(),firstName:L().nullable().optional(),lastName:L().nullable().optional(),profilePictureUrl:L().nullable().optional()}),gh=Od({accessToken:L(),user:hh}).nullable(),_h=Nd(`status`,[Od({status:Vd(`signedOut`)}),Od({status:Vd(`pending`)}),Od({status:Vd(`authenticated`),user:Od({id:L(),email:qu()})}),Od({status:Vd(`unavailable`),error:L()}),Od({status:Vd(`failed`),error:L()})]);function vh(e){return{id:e.id,email:e.email,firstName:e.firstName??null,lastName:e.lastName??null,profilePictureUrl:e.profilePictureUrl??null}}function yh(e={}){return{isLoading:!1,isReady:!0,isConfigured:!0,isWaitingForBrowserSignIn:!1,browserSignInUrl:null,user:null,nativeSession:`notRequired`,error:null,...e}}function bh(e){return e===408||e===429||e===500||e===502||e===503||e===504}function xh(){return!!(nh||Dh()||Oh())}function Sh(){return nh&&!Dh()&&!Oh()}function Ch(){ag(),uh+=1,fh=null}function wh(){if(oh)return oh;throw Error(`Auth bootstrap is not initialized.`)}async function Th(){if(ah)return await ah;ah=wh().query(Jp.authBootstrap.getClientConfig,{});try{return await ah}catch(e){throw ah=null,e}}async function Eh(){return(await Th()).workosClientId?.trim()||void 0}function Dh(){let e=rh();if(!e)return null;let t=e.sprocketDesktopBridge;return!t?.openExternal||!t.focusWindow?null:t}function Oh(){let e=rh();return e?pr(e.location.hostname,!1):!1}async function kh(){let e=th.resolveLocalApiBaseUrl();if(!e)throw Error(`Unable to resolve the Sprocket server URL.`);await th.ensureLocalSession(e)}async function Ah(){return rh()?(ih||=(async()=>{let e=await Eh();if(!e)return Gm.set(yh({isConfigured:!1})),null;let t=null;try{t=await th.createAuthKitClient(e,{redirectUri:`${rh()?.location.origin}/callback`,onRedirectCallback:()=>{window.location.replace(`/`)},onRefresh:()=>{let e=t?.getUser()??null;Gm.update(t=>({...t,user:e?vh(e):null,error:null}))},onRefreshFailure:()=>{let e=t?.getUser()??null;Gm.update(t=>({...t,user:e?vh(e):null,error:t.user&&!e&&!sh?`Session refresh failed. Sign in again.`:t.error}))}});let n=t.getUser();return Gm.set({isLoading:!1,isReady:!0,isConfigured:!0,isWaitingForBrowserSignIn:!1,browserSignInUrl:null,user:n?vh(n):null,nativeSession:Gm.getSnapshot().nativeSession,error:null}),t}catch(e){throw ih=null,e}})(),await ih):null}async function jh(e,t={}){nh=t.machine===!0,oh=e;let n=uh,r=Gm.getSnapshot();Gm.set({...r,isLoading:!0,nativeSession:xh()&&!r.user?`loading`:r.nativeSession});try{if(xh()){if(Sh()&&rh()?.location.protocol!==`https:`)throw Error(`Remote Sprocket access requires HTTPS.`);if(await kh(),n!==uh)return;await Ph(n),Mh();return}await Nh()}catch(e){if(n!==uh)return;Gm.update(t=>({...t,isLoading:!1,isReady:!0,isWaitingForBrowserSignIn:!1,browserSignInUrl:null,nativeSession:t.nativeSession===`loading`?`unavailable`:t.nativeSession,error:e instanceof Error?e.message:`Failed to initialize authentication.`}))}}function Mh(){if(dh||!globalThis.EventSource)return;let e=new EventSource(`/api/auth/changes`);dh=e,e.onmessage=()=>{dh!==e||sh||(Ch(),Ph(uh))}}async function Nh(){let e=(await Ah())?.getUser()??null;Gm.update(t=>t.isConfigured?{isLoading:!1,isReady:!0,isConfigured:!0,isWaitingForBrowserSignIn:!1,browserSignInUrl:null,user:e?vh(e):null,nativeSession:`notRequired`,error:null}:{...t,isLoading:!1,isReady:!0})}async function Ph(e){let t=await zh(!1,e);e===uh&&Fh(t)}function Fh(e){switch(e.kind){case`session`:Gm.set({isLoading:!1,isReady:!0,isConfigured:!0,isWaitingForBrowserSignIn:!1,browserSignInUrl:null,user:e.user,nativeSession:`ready`,error:null});return;case`signedOut`:Gm.set(yh());return;case`transient`:Gm.update(t=>({...t,isLoading:!1,isReady:!0,nativeSession:t.nativeSession===`loading`?`unavailable`:t.nativeSession,error:t.nativeSession===`loading`?e.error:t.error}));return;case`unauthorized`:Gm.update(t=>({...t,isLoading:!1,isReady:!0,nativeSession:`unavailable`,error:e.error}));return;case`mismatch`:Gm.update(t=>({...t,isLoading:!1,isReady:!0,nativeSession:`mismatch`,error:e.error}));return;case`stale`:return;case`error`:Gm.update(t=>({...t,isLoading:!1,isReady:!0,nativeSession:t.nativeSession===`loading`?`unavailable`:t.nativeSession,error:e.error}))}}async function Ih(){let e=await fetch(`/api/auth/native-session`,{method:`DELETE`,credentials:`include`});if(!e.ok)throw Error(await Vh(e,`Failed to clear native session.`))}async function Lh(){let e=await fetch(`/api/auth/session`,{method:`DELETE`,credentials:`include`});if(!e.ok)throw Error(await Vh(e,`Failed to clear browser session.`))}async function Rh(){if(!xh())return;let e=uh,t=await zh(!1,e);e===uh&&Fh(t)}async function zh(e,t){if(t!==uh)return{kind:`stale`};let n=fh;if(n&&n.generation===t){let r=await n.promise;if(t!==uh)return{kind:`stale`};if(!e||n.forceRefreshToken)return r}let r=Bh(e);fh={generation:t,forceRefreshToken:e,promise:r};try{let e=await r;return t===uh?e:{kind:`stale`}}finally{fh?.promise===r&&(fh=null)}}async function Bh(e){let t;try{t=await fetch(`/api/auth/native-session/token`,{method:`POST`,credentials:`include`,signal:AbortSignal.timeout(3e4),headers:{"content-type":`application/json`},body:JSON.stringify({forceRefreshToken:e})})}catch(e){return{kind:`transient`,error:e instanceof Error?e.message:Qm}}if(t.status===401)return{kind:`unauthorized`,error:await Vh(t,`Your local Sprocket session is unavailable. Reload the app to reconnect.`)};if(t.status===409)return{kind:`mismatch`,error:await Vh(t,eh)};if(bh(t.status))return{kind:`transient`,error:await Vh(t,Qm)};if(!t.ok)return{kind:`error`,error:await Vh(t,`Failed to read the native session.`)};let n=gh.safeParse(await t.json().catch(()=>void 0));return n.success?n.data===null?{kind:`signedOut`}:{kind:`session`,accessToken:n.data.accessToken,user:vh(n.data.user)}:{kind:`error`,error:`Local server returned an invalid native session.`}}async function Vh(e,t){let n=ph.safeParse(await e.json().catch(()=>null));return n.success?n.data.error??t:t}async function Hh(e){let t=await fetch(`/api/auth/desktop-login/start`,{method:`POST`,credentials:`include`,headers:{"content-type":`application/json`},body:JSON.stringify({flow:e})});if(!t.ok)throw Error(await Vh(t,`Failed to start desktop sign-in.`));let n=mh.safeParse(await t.json());if(!n.success)throw Error(`Local server returned an invalid desktop sign-in URL.`);return n.data}function Uh(e){return ch===e&&!e.abort.signal.aborted}function Wh(e){if(!Uh(e))throw new DOMException(`Aborted`,`AbortError`)}async function Gh(e,t){let n=lh,r;lh=new Promise(e=>{r=e}),await n;try{Wh(e);let{authorizationUrl:n,loginId:r}=await Hh(t);return e.loginId=r,Wh(e),n}finally{r()}}async function Kh(e){let t;try{t=await fetch(`/api/auth/desktop-login/result`,{method:`POST`,credentials:`include`,signal:AbortSignal.any([e,AbortSignal.timeout(15e3)])})}catch(t){if(e.aborted)throw t;return null}if(bh(t.status))return null;if(!t.ok)throw Error(await Vh(t,`Failed to check desktop sign-in status.`));return _h.parse(await t.json())}async function qh(e){let t=Date.now();for(;!e.aborted;){if(Date.now()-t>Zm)throw Error(`Sign-in timed out. Try again.`);let n=await Kh(e);if(n?.status===`failed`)throw Error(n.error||`Desktop sign-in failed.`);if(n?.status===`authenticated`)return n.user;await new Promise((t,n)=>{let r=setTimeout(()=>{e.removeEventListener(`abort`,i),t()},Xm);function i(){clearTimeout(r),n(new DOMException(`Aborted`,`AbortError`))}e.addEventListener(`abort`,i,{once:!0})})}throw new DOMException(`Aborted`,`AbortError`)}async function Jh(e){let t=Dh();if(!xh())throw Error(`Machine browser sign-in is unavailable.`);Zh();let n={abort:new AbortController,loginId:null};ch=n,Gm.update(e=>({...e,isWaitingForBrowserSignIn:!0,browserSignInUrl:null,error:null}));try{await kh(),Wh(n);let r=await Gh(n,e);if(Wh(n),Gm.update(e=>({...e,browserSignInUrl:r})),Wh(n),t)t.openExternal(r).catch(e=>{if(!Uh(n))return;let t=e instanceof Error?e.message.trim():``;Gm.update(e=>({...e,error:t||`Automatic browser open failed.`}))});else{let e=window.open(r,`_blank`);if(e)try{e.opener=null}catch{}else Gm.update(e=>({...e,error:`Your browser blocked the sign-in window.`}))}let i=await qh(n.abort.signal);if(Wh(n),t)try{await t.focusWindow()}catch(e){Uh(n)&&console.warn(`Failed to focus desktop window after sign-in`,e)}Wh(n),await Yh(n,i)}catch(e){if(ch!==n)return;if(e instanceof DOMException&&e.name===`AbortError`){Gm.update(e=>({...e,isWaitingForBrowserSignIn:!1,browserSignInUrl:null,error:null}));return}Gm.update(t=>({...t,isWaitingForBrowserSignIn:!1,browserSignInUrl:null,error:e instanceof Error?e.message:`Failed to sign in with the browser.`}))}finally{ch===n&&(ch=null)}}async function Yh(e,t){Ch();let n=await zh(!1,uh);Wh(e),n.kind!==`stale`&&Xh(n,vh(t))}function Xh(e,t){switch(e.kind){case`session`:Gm.set({isLoading:!1,isReady:!0,isConfigured:!0,isWaitingForBrowserSignIn:!1,browserSignInUrl:null,user:e.user,nativeSession:`ready`,error:null});return;case`transient`:Gm.set({isLoading:!1,isReady:!0,isConfigured:!0,isWaitingForBrowserSignIn:!1,browserSignInUrl:null,user:t,nativeSession:`ready`,error:null});return;case`signedOut`:Gm.set(yh({error:`Native sign-in finished without a session. Try again.`}));return;case`unauthorized`:Gm.update(t=>({...t,isWaitingForBrowserSignIn:!1,browserSignInUrl:null,nativeSession:`unavailable`,error:e.error}));return;case`mismatch`:Gm.update(t=>({...t,isWaitingForBrowserSignIn:!1,browserSignInUrl:null,nativeSession:`mismatch`,error:e.error}));return;case`error`:Gm.update(t=>({...t,isWaitingForBrowserSignIn:!1,browserSignInUrl:null,nativeSession:`unavailable`,error:e.error}));return;case`stale`:return}}function Zh(){ch?.abort.abort(),ch=null}function Qh(){let e=ch,t=lh;Zh(),Gm.update(e=>({...e,isWaitingForBrowserSignIn:!1,browserSignInUrl:null,error:null})),e&&t.then(async()=>{e.loginId&&await fetch(`/api/auth/desktop-login/cancel`,{method:`POST`,credentials:`include`,headers:{"content-type":`application/json`},body:JSON.stringify({loginId:e.loginId})})}).catch(()=>{})}function $h(){Gm.update(e=>!e.isWaitingForBrowserSignIn||e.error===null?e:{...e,error:null})}async function eg(e){if(xh()){await Jh(e);return}let t=await Ah();if(t&&await Eh()){if(e===`signUp`){await t.signUp();return}await t.signIn()}}async function tg(){await eg(`signIn`)}async function ng(){await eg(`signUp`)}async function rg(){Qh(),sh=!0,Ch(),Gm.update(e=>({...e,isLoading:!0}));let e=[],t=!1,n=null;try{if(xh())try{Sh()?await Lh():await Ih()}catch(t){e.push(t instanceof Error?t.message:`Failed to clear native session.`)}else{let r=await Ah();if(!r){Gm.set(yh());return}try{await r.signOut({navigate:!1,returnTo:window.location.origin})}catch(i){t=!0;let a=r.getUser();n=a?vh(a):null,e.push(i instanceof Error?i.message:`Failed to clear browser session.`)}}Ym.set(!1),Gm.set(yh({user:t?n:null,nativeSession:e.length===0?`notRequired`:`unavailable`,error:e.length===0?null:e.join(` `)}))}catch(e){Gm.update(t=>({...t,isLoading:!1,error:e instanceof Error?e.message:`Failed to sign out.`}))}finally{sh=!1}}async function ig({forceRefreshToken:e=!1}={}){if(xh()){let t=uh,n=await zh(e,t);return t!==uh||n.kind===`stale`?null:sg(n,t)}return await cg({forceRefreshToken:e})}function ag(){$m!==null&&(clearTimeout($m),$m=null)}async function og(e){let t=uh;try{if(xh()&&Gm.getSnapshot().nativeSession===`unavailable`&&(await kh(),t!==uh))return null;let n=await ig(e);return t===uh?(ag(),n):null}catch(e){if(t!==uh)return null;Gm.update(t=>({...t,error:e instanceof Error?e.message:`Session refresh is temporarily unavailable.`}));let n=Gm.getSnapshot();return n.user&&n.nativeSession!==`mismatch`&&$m===null&&($m=setTimeout(()=>{$m=null,t===uh&&Gm.getSnapshot().user&&Jm.update(e=>e+1)},5e3)),null}}function sg(e,t){if(t!==uh)return null;switch(e.kind){case`session`:return Gm.update(t=>({...t,user:e.user,nativeSession:`ready`,error:null})),e.accessToken;case`signedOut`:return Gm.update(e=>({...e,user:null,nativeSession:`notRequired`,error:null})),null;case`transient`:throw Error(e.error);case`unauthorized`:throw Gm.update(t=>({...t,nativeSession:`unavailable`,error:e.error})),Error(e.error);case`mismatch`:throw Gm.update(t=>({...t,nativeSession:`mismatch`,error:e.error})),Error(e.error);case`error`:throw Error(e.error);case`stale`:return null}}async function cg({forceRefreshToken:e}){let t=await Ah();if(!t)return null;try{return await t.getAccessToken({forceRefresh:e})}catch(e){if(e instanceof Error&&e.name===`LoginRequiredError`)return Gm.update(e=>({...e,user:null})),null;throw e}}function lg(e){return e.retryPending?e.isAuthenticated?{clearPending:!0,sawLoadingDuringRetry:e.sawLoadingDuringRetry}:e.isLoading?{clearPending:!1,sawLoadingDuringRetry:!0}:e.sawLoadingDuringRetry?{clearPending:!0,sawLoadingDuringRetry:!0}:{clearPending:!1,sawLoadingDuringRetry:!1}:{clearPending:!1,sawLoadingDuringRetry:!1}}async function ug(){let e=uh;Gm.update(e=>({...e,isLoading:!0,error:null})),Ym.set(!0);try{if(xh()&&(await kh(),e!==uh))return;let t=await ig({forceRefreshToken:!0});if(e!==uh)return;if(!t)throw Error(`Your session has expired. Sign in again.`);Jm.update(e=>e+1),Gm.update(e=>({...e,isLoading:!1,error:null}))}catch(t){if(e!==uh)return;Ym.set(!1),Gm.update(e=>({...e,isLoading:!1,error:t instanceof Error?t.message:`Failed to refresh authentication.`}))}}var dg=o((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.fragment`);function r(e,n,r){var i=null;if(r!==void 0&&(i=``+r),n.key!==void 0&&(i=``+n.key),`key`in n)for(var a in r={},n)a!==`key`&&(r[a]=n[a]);else r=n;return n=r.ref,{$$typeof:t,type:e,key:i,ref:n===void 0?null:n,props:r}}e.Fragment=n,e.jsx=r,e.jsxs=r})),R=o(((e,t)=>{t.exports=dg()}))();function fg(){let e=Wm(qm),t=Wm(Km),n=Wm(Jm),r=(0,F.useCallback)(e=>og(e),[n,t]);return{isLoading:e,isAuthenticated:!!t,fetchAccessToken:r}}function pg({client:e,machine:t,children:n}){return(0,F.useEffect)(()=>{jh(e,{machine:t})},[e,t]),(0,R.jsx)(lr,{client:e,useAuth:fg,children:n})}var mg=e=>e?.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase();function hg(e,t,n=[]){if(t==null)throw Error(`[lucide]: iconNode is required when icon name is used`);return{name:mg(e),size:24,node:t,...n.length>0?{aliases:n}:{}}}var gg=e=>{let t=``,n=!1;for(let r of e){if(r===`-`||r===`_`||r<=` `){n=t.length>0;continue}t.length===0?t+=r.toLowerCase():t+=n?r.toUpperCase():r,n=!1}return t},_g=e=>{let t=gg(e);return t.charAt(0).toUpperCase()+t.slice(1)},vg=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),yg={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":2,"stroke-linecap":`round`,"stroke-linejoin":`round`};function bg(e){return e!=null}function xg(e,t={}){let n=t.attributeNames??{},r=e=>n[e]??e,i=e.size??e.width??yg.width,a=e.size??e.height??yg.height,o=e.aliases?.filter(e=>typeof e==`string`&&e.trim()!==``).map(e=>`lucide-${e}`)??[],s=[...e.name?[`lucide-${e.name}`]:[],...o],c=t.className?.split(` `).filter(Boolean)??[],l=t.includeDefaultClasses===!1?vg(...c):vg(`lucide`,...s,...c),u=t.absoluteStrokeWidth?Number(t.strokeWidth??yg[`stroke-width`])*Number(e.size??e.width??yg.width)/Number(t.size??t.width??yg.width):t.strokeWidth??yg[`stroke-width`];return[`svg`,{...Object.entries(yg).reduce((e,[t,n])=>(e[r(t)]=n,e),{}),...`color`in t&&t.color&&{[r(`stroke`)]:t.color},...`size`in t&&bg(t.size)&&{[r(`width`)]:t.size,[r(`height`)]:t.size},...`width`in t&&bg(t.width)&&{[r(`width`)]:t.width},...`height`in t&&bg(t.height)&&{[r(`height`)]:t.height},[r(`stroke-width`)]:u,...l&&{[r(`class`)]:l},[r(`viewBox`)]:`0 0 ${i} ${a}`,...t.hasA11yProp===!1?{[r(`aria-hidden`)]:`true`}:{},...`attributes`in t&&t.attributes},e.node.map(e=>{let[n,i,a]=e,o=t.nonScalingStroke?{[r(`vector-effect`)]:`non-scaling-stroke`,...i}:i;return a?[n,o,a]:[n,o]})]}function Sg(e,t={}){return xg(e,{...t,attributeNames:{...t.attributeNames,class:`className`,"stroke-width":`strokeWidth`,"stroke-linecap":`strokeLinecap`,"stroke-linejoin":`strokeLinejoin`,"vector-effect":`vectorEffect`}})}var Cg=e=>{for(let t in e)if(t.startsWith(`aria-`)||t===`role`||t===`title`)return!0;return!1},wg=(0,F.createContext)({}),Tg=()=>(0,F.useContext)(wg),Eg=(0,F.forwardRef)(({color:e,size:t,width:n,height:r,strokeWidth:i,absoluteStrokeWidth:a,nonScalingStroke:o,className:s=``,children:c,iconNode:l=[],icon:u={node:l,aliases:[],size:24},...d},f)=>{let{size:p=24,strokeWidth:m=2,absoluteStrokeWidth:h=!1,nonScalingStroke:g=!1,color:_=`currentColor`,className:v=``}=Tg()??{},y=!!c||Cg(d),[b,x,S=[]]=Sg(u,{color:e??_,width:n??t??p,height:r??t??p,strokeWidth:i??m,absoluteStrokeWidth:a??h,nonScalingStroke:o??g,className:vg(v,s),hasA11yProp:y,attributes:d});return(0,F.createElement)(b,{ref:f,...x},[...S.map(([e,t])=>(0,F.createElement)(e,t)),...Array.isArray(c)?c:[c]])});function Dg(e,t=[],n=[]){let r=typeof e==`string`?hg(e,t,n):e,i=(0,F.forwardRef)(({className:e,...t},n)=>(0,F.createElement)(Eg,{ref:n,icon:r,className:e,...t}));return r.name&&(i.displayName=_g(r.name)),i}var Og={name:`arrow-left`,size:24,node:[[`path`,{d:`m12 19-7-7 7-7`,key:`1l729n`}],[`path`,{d:`M19 12H5`,key:`x3x0zl`}]]};Og.node;var kg=Dg(Og),Ag={name:`arrow-up`,size:24,node:[[`path`,{d:`m5 12 7-7 7 7`,key:`hav0vg`}],[`path`,{d:`M12 19V5`,key:`x0mq9r`}]]};Ag.node;var jg=Dg(Ag),Mg={name:`book-open`,size:24,node:[[`path`,{d:`M12 5v16`,key:`1f6ucr`}],[`path`,{d:`M20.001 19A2 2 0 0022 17V5a2 2 0 00-1.999-2L16 3.002A5 5 0 0012 5a5 5 0 00-4-2H4a2 2 0 00-2 2v12a2 2 0 001.999 2H8a5 5 0 014 2 5 5 0 014-2z`,key:`1fyvmf`}]]};Mg.node;var Ng=Dg(Mg),Pg={name:`bot`,size:24,node:[[`path`,{d:`M12 8V4H8`,key:`hb8ula`}],[`rect`,{width:`16`,height:`12`,x:`4`,y:`8`,rx:`2`,key:`enze0r`}],[`path`,{d:`M2 14h2`,key:`vft8re`}],[`path`,{d:`M20 14h2`,key:`4cs60a`}],[`path`,{d:`M15 13v2`,key:`1xurst`}],[`path`,{d:`M9 13v2`,key:`rq6x2g`}]]};Pg.node;var Fg=Dg(Pg),Ig={name:`brain`,size:24,node:[[`path`,{d:`M12 18V5`,key:`adv99a`}],[`path`,{d:`M15 13a4.17 4.17 0 0 1-3-4 4.17 4.17 0 0 1-3 4`,key:`1e3is1`}],[`path`,{d:`M17.598 6.5A3 3 0 1 0 12 5a3 3 0 1 0-5.598 1.5`,key:`1gqd8o`}],[`path`,{d:`M17.997 5.125a4 4 0 0 1 2.526 5.77`,key:`iwvgf7`}],[`path`,{d:`M18 18a4 4 0 0 0 2-7.464`,key:`efp6ie`}],[`path`,{d:`M19.967 17.483A4 4 0 1 1 12 18a4 4 0 1 1-7.967-.517`,key:`1gq6am`}],[`path`,{d:`M6 18a4 4 0 0 1-2-7.464`,key:`k1g0md`}],[`path`,{d:`M6.003 5.125a4 4 0 0 0-2.526 5.77`,key:`q97ue3`}]]};Ig.node;var Lg=Dg(Ig),Rg={name:`camera`,size:24,node:[[`path`,{d:`M13.997 4a2 2 0 0 1 1.76 1.05l.486.9A2 2 0 0 0 18.003 7H20a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V9a2 2 0 0 1 2-2h1.997a2 2 0 0 0 1.759-1.048l.489-.904A2 2 0 0 1 10.004 4z`,key:`18u6gg`}],[`circle`,{cx:`12`,cy:`13`,r:`3`,key:`1vg3eu`}]]};Rg.node;var zg=Dg(Rg),Bg={name:`chart-no-axes-column`,size:24,node:[[`path`,{d:`M5 21v-6`,key:`1hz6c0`}],[`path`,{d:`M12 21V3`,key:`1lcnhd`}],[`path`,{d:`M19 21V9`,key:`unv183`}]],aliases:[`bar-chart-2`]};Bg.node;var Vg=Dg(Bg),Hg={name:`check`,size:24,node:[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]};Hg.node;var Ug=Dg(Hg),Wg={name:`chevron-down`,size:24,node:[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]};Wg.node;var Gg=Dg(Wg),Kg={name:`chevron-right`,size:24,node:[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]};Kg.node;var qg=Dg(Kg),Jg={name:`circle-alert`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`line`,{x1:`12`,x2:`12`,y1:`8`,y2:`12`,key:`1pkeuh`}],[`line`,{x1:`12`,x2:`12.01`,y1:`16`,y2:`16`,key:`4dfq90`}]],aliases:[`alert-circle`]};Jg.node;var Yg=Dg(Jg),Xg={name:`circle-dollar-sign`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M16 8h-6a2 2 0 1 0 0 4h4a2 2 0 1 1 0 4H8`,key:`1h4pet`}],[`path`,{d:`M12 18V6`,key:`zqpxq5`}]]};Xg.node;var Zg=Dg(Xg),Qg={name:`circle-question-mark`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3`,key:`1u773s`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]],aliases:[`help-circle`,`circle-help`]};Qg.node;var $g=Dg(Qg),e_={name:`code-xml`,size:24,node:[[`path`,{d:`m18 16 4-4-4-4`,key:`1inbqp`}],[`path`,{d:`m6 8-4 4 4 4`,key:`15zrgr`}],[`path`,{d:`m14.5 4-5 16`,key:`e7oirm`}]],aliases:[`code-2`]};e_.node;var t_=Dg(e_),n_={name:`copy`,size:24,node:[[`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`}]]};n_.node;var r_=Dg(n_),i_={name:`credit-card`,size:24,node:[[`rect`,{width:`20`,height:`14`,x:`2`,y:`5`,rx:`2`,key:`ynyp8z`}],[`line`,{x1:`2`,x2:`22`,y1:`10`,y2:`10`,key:`1b3vmo`}],[`path`,{d:`M6 14h2`,key:`mk7k0u`}]]};i_.node;var a_=Dg(i_),o_={name:`download`,size:24,node:[[`path`,{d:`M12 15V3`,key:`m9g1x1`}],[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}],[`path`,{d:`m7 10 5 5 5-5`,key:`brsn70`}]]};o_.node;var s_=Dg(o_),c_={name:`ellipsis`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`1`,key:`41hilf`}],[`circle`,{cx:`19`,cy:`12`,r:`1`,key:`1wjl8i`}],[`circle`,{cx:`5`,cy:`12`,r:`1`,key:`1pcz8c`}]],aliases:[`more-horizontal`]};c_.node;var l_=Dg(c_),u_={name:`expand`,size:24,node:[[`path`,{d:`m15 15 6 6`,key:`1s409w`}],[`path`,{d:`m15 9 6-6`,key:`ko1vev`}],[`path`,{d:`M21 16v5h-5`,key:`1ck2sf`}],[`path`,{d:`M21 8V3h-5`,key:`1qoq8a`}],[`path`,{d:`M3 16v5h5`,key:`1t08am`}],[`path`,{d:`m3 21 6-6`,key:`wwnumi`}],[`path`,{d:`M3 8V3h5`,key:`1ln10m`}],[`path`,{d:`M9 9 3 3`,key:`v551iv`}]]};u_.node;var d_=Dg(u_),f_={name:`external-link`,size:24,node:[[`path`,{d:`M15 3h6v6`,key:`1q9fwt`}],[`path`,{d:`M10 14 21 3`,key:`gplh6r`}],[`path`,{d:`M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6`,key:`a6xqqp`}]]};f_.node;var p_=Dg(f_),m_={name:`eye-off`,size:24,node:[[`path`,{d:`M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49`,key:`ct8e1f`}],[`path`,{d:`M14.084 14.158a3 3 0 0 1-4.242-4.242`,key:`151rxh`}],[`path`,{d:`M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143`,key:`13bj9a`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}]]};m_.node;var h_=Dg(m_),g_={name:`eye`,size:24,node:[[`path`,{d:`M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0`,key:`1nclc0`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]};g_.node;var __=Dg(g_),v_={name:`file-code`,size:24,node:[[`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 12.5 8 15l2 2.5`,key:`1tg20x`}],[`path`,{d:`m14 12.5 2 2.5-2 2.5`,key:`yinavb`}]]};v_.node;var y_=Dg(v_),b_={name:`file-diff`,size:24,node:[[`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:`M9 10h6`,key:`9gxzsh`}],[`path`,{d:`M12 13V7`,key:`h0r20n`}],[`path`,{d:`M9 17h6`,key:`r8uit2`}]]};b_.node;var x_=Dg(b_),S_={name:`file-text`,size:24,node:[[`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`}]]};S_.node;var C_=Dg(S_),w_={name:`file`,size:24,node:[[`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`}]]};w_.node;var T_=Dg(w_),E_={name:`folder-plus`,size:24,node:[[`path`,{d:`M12 10v6`,key:`1bos4e`}],[`path`,{d:`M9 13h6`,key:`1uhe8q`}],[`path`,{d:`M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z`,key:`1kt360`}]]};E_.node;var D_=Dg(E_),O_={name:`folder`,size:24,node:[[`path`,{d:`M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z`,key:`1kt360`}]]};O_.node;var k_=Dg(O_),A_={name:`fullscreen`,size:24,node:[[`path`,{d:`M3 7V5a2 2 0 0 1 2-2h2`,key:`aa7l1z`}],[`path`,{d:`M17 3h2a2 2 0 0 1 2 2v2`,key:`4qcy5o`}],[`path`,{d:`M21 17v2a2 2 0 0 1-2 2h-2`,key:`6vwrx8`}],[`path`,{d:`M7 21H5a2 2 0 0 1-2-2v-2`,key:`ioqczr`}],[`rect`,{width:`10`,height:`8`,x:`7`,y:`8`,rx:`1`,key:`vys8me`}]]};A_.node;var j_=Dg(A_),M_={name:`globe`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20`,key:`13o1zl`}],[`path`,{d:`M2 12h20`,key:`9i4pu4`}]]};M_.node;var N_=Dg(M_),P_={name:`hourglass`,size:24,node:[[`path`,{d:`M5 22h14`,key:`ehvnwv`}],[`path`,{d:`M5 2h14`,key:`pdyrp9`}],[`path`,{d:`M17 22v-4.172a2 2 0 0 0-.586-1.414L12 12l-4.414 4.414A2 2 0 0 0 7 17.828V22`,key:`1d314k`}],[`path`,{d:`M7 2v4.172a2 2 0 0 0 .586 1.414L12 12l4.414-4.414A2 2 0 0 0 17 6.172V2`,key:`1vvvr6`}]]};P_.node;var F_=Dg(P_),I_={name:`key-round`,size:24,node:[[`path`,{d:`M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z`,key:`1s6t7t`}],[`circle`,{cx:`16.5`,cy:`7.5`,r:`.5`,fill:`currentColor`,key:`w0ekpg`}]]};I_.node;var L_=Dg(I_),R_={name:`list-checks`,size:24,node:[[`path`,{d:`M13 5h8`,key:`a7qcls`}],[`path`,{d:`M13 12h8`,key:`h98zly`}],[`path`,{d:`M13 19h8`,key:`c3s6r1`}],[`path`,{d:`m3 17 2 2 4-4`,key:`1jhpwq`}],[`path`,{d:`m3 7 2 2 4-4`,key:`1obspn`}]]};R_.node;var z_=Dg(R_),B_={name:`loader-circle`,size:24,node:[[`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`,key:`13zald`}]],aliases:[`loader-2`]};B_.node;var V_=Dg(B_),H_={name:`log-out`,size:24,node:[[`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`}]]};H_.node;var U_=Dg(H_),W_={name:`moon`,size:24,node:[[`path`,{d:`M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401`,key:`kfwtm`}]]};W_.node;var G_=Dg(W_),K_={name:`notebook-pen`,size:24,node:[[`path`,{d:`M13.4 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-7.4`,key:`re6nr2`}],[`path`,{d:`M2 6h4`,key:`aawbzj`}],[`path`,{d:`M2 10h4`,key:`l0bgd4`}],[`path`,{d:`M2 14h4`,key:`1gsvsf`}],[`path`,{d:`M2 18h4`,key:`1bu2t1`}],[`path`,{d:`M21.378 5.626a1 1 0 1 0-3.004-3.004l-5.01 5.012a2 2 0 0 0-.506.854l-.837 2.87a.5.5 0 0 0 .62.62l2.87-.837a2 2 0 0 0 .854-.506z`,key:`pqwjuv`}]]};K_.node;var q_=Dg(K_),J_={name:`panel-left`,size:24,node:[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M9 3v18`,key:`fh3hqa`}]],aliases:[`sidebar`]};J_.node;var Y_=Dg(J_),X_={name:`panel-right`,size:24,node:[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M15 3v18`,key:`14nvp0`}]]};X_.node;var Z_=Dg(X_),Q_={name:`paperclip`,size:24,node:[[`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`}]]};Q_.node;var $_=Dg(Q_),ev={name:`refresh-cw`,size:24,node:[[`path`,{d:`M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8`,key:`v9h5vc`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}],[`path`,{d:`M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16`,key:`3uifl3`}],[`path`,{d:`M8 16H3v5`,key:`1cv678`}]]};ev.node;var tv=Dg(ev),nv={name:`rotate-ccw`,size:24,node:[[`path`,{d:`M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`,key:`1357e3`}],[`path`,{d:`M3 3v5h5`,key:`1xhq8a`}]]};nv.node;var rv=Dg(nv),iv={name:`save`,size:24,node:[[`path`,{d:`M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z`,key:`1c8476`}],[`path`,{d:`M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7`,key:`1ydtos`}],[`path`,{d:`M7 3v4a1 1 0 0 0 1 1h7`,key:`t51u73`}]]};iv.node;var av=Dg(iv),ov={name:`scroll-text`,size:24,node:[[`path`,{d:`M15 12h-5`,key:`r7krc0`}],[`path`,{d:`M15 8h-5`,key:`1khuty`}],[`path`,{d:`M19 17V5a2 2 0 0 0-2-2H4`,key:`zz82l3`}],[`path`,{d:`M8 21h12a2 2 0 0 0 2-2v-1a1 1 0 0 0-1-1H11a1 1 0 0 0-1 1v1a2 2 0 1 1-4 0V5a2 2 0 1 0-4 0v2a1 1 0 0 0 1 1h3`,key:`1ph1d7`}]]};ov.node;var sv=Dg(ov),cv={name:`search`,size:24,node:[[`path`,{d:`m21 21-4.34-4.34`,key:`14j7rj`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}]]};cv.node;var lv=Dg(cv),uv={name:`settings`,size:24,node:[[`path`,{d:`M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915`,key:`1i5ecw`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]};uv.node;var dv=Dg(uv),fv={name:`shrink`,size:24,node:[[`path`,{d:`m15 15 6 6m-6-6v4.8m0-4.8h4.8`,key:`17vawe`}],[`path`,{d:`M9 19.8V15m0 0H4.2M9 15l-6 6`,key:`chjx8e`}],[`path`,{d:`M15 4.2V9m0 0h4.8M15 9l6-6`,key:`lav6yq`}],[`path`,{d:`M9 4.2V9m0 0H4.2M9 9 3 3`,key:`1pxi2q`}]]};fv.node;var pv=Dg(fv),mv={name:`square-pen`,size:24,node:[[`path`,{d:`M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7`,key:`1m0v6g`}],[`path`,{d:`M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z`,key:`ohrbg2`}]],aliases:[`pen-box`,`edit`,`pen-square`]};mv.node;var hv=Dg(mv),gv={name:`square-terminal`,size:24,node:[[`path`,{d:`m7 11 2-2-2-2`,key:`1lz0vl`}],[`path`,{d:`M11 13h4`,key:`1p7l4v`}],[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,ry:`2`,key:`1m3agn`}]],aliases:[`terminal-square`]};gv.node;var _v=Dg(gv),vv={name:`square`,size:24,node:[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}]]};vv.node;var yv=Dg(vv),bv={name:`sun`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`4`,key:`4exip2`}],[`path`,{d:`M12 2v2`,key:`tus03m`}],[`path`,{d:`M12 20v2`,key:`1lh1kg`}],[`path`,{d:`m4.93 4.93 1.41 1.41`,key:`149t6j`}],[`path`,{d:`m17.66 17.66 1.41 1.41`,key:`ptbguv`}],[`path`,{d:`M2 12h2`,key:`1t8f8n`}],[`path`,{d:`M20 12h2`,key:`1q8mjw`}],[`path`,{d:`m6.34 17.66-1.41 1.41`,key:`1m8zz5`}],[`path`,{d:`m19.07 4.93-1.41 1.41`,key:`1shlcs`}]]};bv.node;var xv=Dg(bv),Sv={name:`terminal`,size:24,node:[[`path`,{d:`M12 19h8`,key:`baeox8`}],[`path`,{d:`m4 17 6-6-6-6`,key:`1yngyt`}]]};Sv.node;var Cv=Dg(Sv),wv={name:`text-wrap`,size:24,node:[[`path`,{d:`m16 16-3 3 3 3`,key:`117b85`}],[`path`,{d:`M3 12h14.5a1 1 0 0 1 0 7H13`,key:`18xa6z`}],[`path`,{d:`M3 19h6`,key:`1ygdsz`}],[`path`,{d:`M3 5h18`,key:`1u36vt`}]],aliases:[`wrap-text`]};wv.node;var Tv=Dg(wv),Ev={name:`trash`,size:24,node:[[`path`,{d:`M10 11v6`,key:`nco0om`}],[`path`,{d:`M14 11v6`,key:`outv1u`}],[`path`,{d:`M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6`,key:`miytrc`}],[`path`,{d:`M3 6h18`,key:`d0wm0j`}],[`path`,{d:`M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2`,key:`e791ji`}]],aliases:[`trash-2`]};Ev.node;var Dv=Dg(Ev),Ov={name:`user-round`,size:24,node:[[`circle`,{cx:`12`,cy:`8`,r:`5`,key:`1hypcn`}],[`path`,{d:`M20 21a8 8 0 0 0-16 0`,key:`rfgkzh`}]],aliases:[`user-2`]};Ov.node;var kv=Dg(Ov),Av={name:`wallet`,size:24,node:[[`path`,{d:`M19 7V4a1 1 0 0 0-1-1H5a2 2 0 0 0 0 4h15a1 1 0 0 1 1 1v4h-3a2 2 0 0 0 0 4h3a1 1 0 0 0 1-1v-2a1 1 0 0 0-1-1`,key:`18etb6`}],[`path`,{d:`M3 5v14a2 2 0 0 0 2 2h15a1 1 0 0 0 1-1v-4`,key:`xoc0q4`}]]};Av.node;var jv=Dg(Av),Mv={name:`wrench`,size:24,node:[[`path`,{d:`M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z`,key:`1ngwbx`}]]};Mv.node;var Nv=Dg(Mv),Pv={name:`x`,size:24,node:[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]};Pv.node;var Fv=Dg(Pv),Iv={name:`zap`,size:24,node:[[`path`,{d:`M15.914 4a1.5 1.5 0 00-2.474-1.561l-9 9A1.5 1.5 0 005.5 14h4.002a.5.5 0 01.471.666L8.086 20a1.5 1.5 0 002.475 1.56l9-9A1.5 1.5 0 0018.5 10h-3.997a.5.5 0 01-.472-.667z`,key:`1v7up4`}]]};Iv.node;var Lv=Dg(Iv);function Rv(e){var t,n,r=``;if(typeof e==`string`||typeof e==`number`)r+=e;else if(typeof e==`object`){if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=Rv(e[t]))&&(r&&(r+=` `),r+=n)}else for(n in e)e[n]&&(r&&(r+=` `),r+=n)}return r}function zv(){for(var e,t,n=0,r=``,i=arguments.length;n<i;n++)(e=arguments[n])&&(t=Rv(e))&&(r&&(r+=` `),r+=t);return r}var Bv=(e,t)=>{let n=Array(e.length+t.length);for(let t=0;t<e.length;t++)n[t]=e[t];for(let r=0;r<t.length;r++)n[e.length+r]=t[r];return n},Vv=(e,t)=>({classGroupId:e,validator:t}),Hv=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),Uv=`-`,Wv=[],Gv=`arbitrary..`,Kv=e=>{let t=Yv(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:e=>{if(e.startsWith(`[`)&&e.endsWith(`]`))return Jv(e);let n=e.split(Uv);return qv(n,+(n[0]===``&&n.length>1),t)},getConflictingClassGroupIds:(e,t)=>{if(t){let t=r[e],i=n[e];return t?i?Bv(i,t):t:i||Wv}return n[e]||Wv}}},qv=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;let r=e[t],i=n.nextPart.get(r);if(i){let n=qv(e,t+1,i);if(n)return n}let a=n.validators;if(a===null)return;let o=t===0?e.join(Uv):e.slice(t).join(Uv),s=a.length;for(let e=0;e<s;e++){let t=a[e];if(t.validator(o))return t.classGroupId}},Jv=e=>e.slice(1,-1).indexOf(`:`)===-1?void 0:(()=>{let t=e.slice(1,-1),n=t.indexOf(`:`),r=t.slice(0,n);return r?Gv+r:void 0})(),Yv=e=>{let{theme:t,classGroups:n}=e;return Xv(n,t)},Xv=(e,t)=>{let n=Hv();for(let r in e){let i=e[r];Zv(i,n,r,t)}return n},Zv=(e,t,n,r)=>{let i=e.length;for(let a=0;a<i;a++){let i=e[a];Qv(i,t,n,r)}},Qv=(e,t,n,r)=>{if(typeof e==`string`){$v(e,t,n);return}if(typeof e==`function`){ey(e,t,n,r);return}ty(e,t,n,r)},$v=(e,t,n)=>{let r=e===``?t:ny(t,e);r.classGroupId=n},ey=(e,t,n,r)=>{if(ry(e)){Zv(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(Vv(n,e))},ty=(e,t,n,r)=>{let i=Object.entries(e),a=i.length;for(let e=0;e<a;e++){let[a,o]=i[e];Zv(o,ny(t,a),n,r)}},ny=(e,t)=>{let n=e,r=t.split(Uv),i=r.length;for(let e=0;e<i;e++){let t=r[e],i=n.nextPart.get(t);i||(i=Hv(),n.nextPart.set(t,i)),n=i}return n},ry=e=>`isThemeGetter`in e&&e.isThemeGetter===!0,iy=e=>{if(e<1)return{get:()=>void 0,set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null),i=(i,a)=>{n[i]=a,t++,t>e&&(t=0,r=n,n=Object.create(null))};return{get(e){let t=n[e];if(t!==void 0)return t;if((t=r[e])!==void 0)return i(e,t),t},set(e,t){e in n?n[e]=t:i(e,t)}}},ay=`!`,oy=`:`,sy=[],cy=(e,t,n,r,i)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:i}),ly=e=>{let{prefix:t,experimentalParseClassName:n}=e,r=e=>{let t=[],n=0,r=0,i=0,a,o=e.length;for(let s=0;s<o;s++){let o=e[s];if(n===0&&r===0){if(o===oy){t.push(e.slice(i,s)),i=s+1;continue}if(o===`/`){a=s;continue}}o===`[`?n++:o===`]`?n--:o===`(`?r++:o===`)`&&r--}let s=t.length===0?e:e.slice(i),c=s,l=!1;s.endsWith(ay)?(c=s.slice(0,-1),l=!0):s.startsWith(ay)&&(c=s.slice(1),l=!0);let u=a&&a>i?a-i:void 0;return cy(t,l,c,u)};if(t){let e=t+oy,n=r;r=t=>t.startsWith(e)?n(t.slice(e.length)):cy(sy,!1,t,void 0,!0)}if(n){let e=r;r=t=>n({className:t,parseClassName:e})}return r},uy=e=>{let t=new Map;return e.orderSensitiveModifiers.forEach((e,n)=>{t.set(e,1e6+n)}),e=>{let n=[],r=[];for(let i=0;i<e.length;i++){let a=e[i],o=a[0]===`[`,s=t.has(a);o||s?(r.length>0&&(r.sort(),n.push(...r),r=[]),n.push(a)):r.push(a)}return r.length>0&&(r.sort(),n.push(...r)),n}},dy=e=>({cache:iy(e.cacheSize),parseClassName:ly(e),sortModifiers:uy(e),postfixLookupClassGroupIds:fy(e),...Kv(e)}),fy=e=>{let t=Object.create(null),n=e.postfixLookupClassGroups;if(n)for(let e=0;e<n.length;e++)t[n[e]]=!0;return t},py=/\s+/,my=(e,t)=>{let{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i,sortModifiers:a,postfixLookupClassGroupIds:o}=t,s=[],c=e.trim().split(py),l=``;for(let e=c.length-1;e>=0;--e){let t=c[e],{isExternal:u,modifiers:d,hasImportantModifier:f,baseClassName:p,maybePostfixModifierPosition:m}=n(t);if(u){l=t+(l.length>0?` `+l:l);continue}let h=!!m,g;if(h){g=r(p.substring(0,m));let e=g&&o[g]?r(p):void 0;e&&e!==g&&(g=e,h=!1)}else g=r(p);if(!g){if(!h){l=t+(l.length>0?` `+l:l);continue}if(g=r(p),!g){l=t+(l.length>0?` `+l:l);continue}h=!1}let _=d.length===0?``:d.length===1?d[0]:a(d).join(`:`),v=f?_+ay:_,y=v+g;if(s.indexOf(y)>-1)continue;s.push(y);let b=i(g,h);for(let e=0;e<b.length;++e){let t=b[e];s.push(v+t)}l=t+(l.length>0?` `+l:l)}return l},hy=(...e)=>{let t=0,n,r,i=``;for(;t<e.length;)(n=e[t++])&&(r=gy(n))&&(i&&(i+=` `),i+=r);return i},gy=e=>{if(typeof e==`string`)return e;let t,n=``;for(let r=0;r<e.length;r++)e[r]&&(t=gy(e[r]))&&(n&&(n+=` `),n+=t);return n},_y=(e,...t)=>{let n,r,i,a,o=o=>(n=dy(t.reduce((e,t)=>t(e),e())),r=n.cache.get,i=n.cache.set,a=s,s(o)),s=e=>{let t=r(e);if(t)return t;let a=my(e,n);return i(e,a),a};return a=o,(...e)=>a(hy(...e))},vy=[],yy=e=>{let t=t=>t[e]||vy;return t.isThemeGetter=!0,t.themeKey=e,t},by=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,xy=/^\((?:(\w[\w-]*):)?(.+)\)$/i,Sy=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,Cy=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,wy=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,Ty=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix|color|light-dark)\(.+\)$/,Ey=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Dy=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Oy=e=>Sy.test(e),ky=e=>!!e&&!Number.isNaN(Number(e)),Ay=e=>!!e&&Number.isInteger(Number(e)),jy=e=>e.endsWith(`%`)&&ky(e.slice(0,-1)),My=e=>Cy.test(e),Ny=()=>!0,Py=e=>wy.test(e)&&!Ty.test(e),Fy=()=>!1,Iy=e=>Ey.test(e),Ly=e=>Dy.test(e),Ry=e=>!z(e)&&!Jy(e),zy=e=>e.startsWith(`@container`)&&(e[10]===`/`&&e[11]!==void 0||e[11]===`s`&&e[16]!==void 0&&e.startsWith(`-size/`,10)||e[11]===`n`&&e[18]!==void 0&&e.startsWith(`-normal/`,10)),By=e=>nb(e,ob,Fy),z=e=>by.test(e),Vy=e=>nb(e,sb,Py),Hy=e=>nb(e,cb,ky),Uy=e=>nb(e,ub,Ny),Wy=e=>nb(e,lb,Fy),Gy=e=>nb(e,ib,Fy),Ky=e=>nb(e,ab,Ly),qy=e=>nb(e,db,Iy),Jy=e=>xy.test(e),Yy=e=>rb(e,sb),Xy=e=>rb(e,lb),Zy=e=>rb(e,ib),Qy=e=>rb(e,ob),$y=e=>rb(e,ab),eb=e=>rb(e,db,!0),tb=e=>rb(e,ub,!0),nb=(e,t,n)=>{let r=by.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},rb=(e,t,n=!1)=>{let r=xy.exec(e);return r?r[1]?t(r[1]):n:!1},ib=e=>e===`position`||e===`percentage`,ab=e=>e===`image`||e===`url`,ob=e=>e===`length`||e===`size`||e===`bg-size`,sb=e=>e===`length`,cb=e=>e===`number`,lb=e=>e===`family-name`,ub=e=>e===`number`||e===`weight`,db=e=>e===`shadow`,fb=_y(()=>{let e=yy(`color`),t=yy(`font`),n=yy(`text`),r=yy(`font-weight`),i=yy(`tracking`),a=yy(`leading`),o=yy(`breakpoint`),s=yy(`container`),c=yy(`spacing`),l=yy(`radius`),u=yy(`shadow`),d=yy(`inset-shadow`),f=yy(`text-shadow`),p=yy(`drop-shadow`),m=yy(`blur`),h=yy(`perspective`),g=yy(`aspect`),_=yy(`ease`),v=yy(`animate`),y=()=>[`auto`,`avoid`,`all`,`avoid-page`,`page`,`left`,`right`,`column`],b=()=>[`center`,`top`,`bottom`,`left`,`right`,`top-left`,`left-top`,`top-right`,`right-top`,`bottom-right`,`right-bottom`,`bottom-left`,`left-bottom`],x=()=>[...b(),Jy,z],S=()=>[`auto`,`hidden`,`clip`,`visible`,`scroll`],C=()=>[`auto`,`contain`,`none`],w=()=>[Jy,z,c],T=()=>[Oy,`full`,`auto`,...w()],E=()=>[Ay,`none`,`subgrid`,Jy,z],D=()=>[`auto`,{span:[`full`,Ay,Jy,z]},Ay,Jy,z],ee=()=>[Ay,`auto`,Jy,z],O=()=>[`auto`,`min`,`max`,`fr`,Jy,z],te=()=>[`start`,`end`,`center`,`between`,`around`,`evenly`,`stretch`,`baseline`,`center-safe`,`end-safe`],ne=()=>[`start`,`end`,`center`,`stretch`,`center-safe`,`end-safe`],re=()=>[`auto`,...w()],ie=()=>[Oy,`auto`,`full`,`dvw`,`dvh`,`lvw`,`lvh`,`svw`,`svh`,`min`,`max`,`fit`,...w()],k=()=>[s,Oy,`screen`,`full`,`dvw`,`lvw`,`svw`,`min`,`max`,`fit`,...w()],ae=()=>[Oy,`screen`,`full`,`lh`,`dvh`,`lvh`,`svh`,`min`,`max`,`fit`,...w()],A=()=>[e,Jy,z],oe=()=>[...b(),Zy,Gy,{position:[Jy,z]}],se=()=>[`no-repeat`,{repeat:[``,`x`,`y`,`space`,`round`]}],ce=()=>[`auto`,`cover`,`contain`,Qy,By,{size:[Jy,z]}],le=()=>[jy,Yy,Vy],ue=()=>[``,`none`,`full`,l,Jy,z],de=()=>[``,ky,Yy,Vy],fe=()=>[`solid`,`dashed`,`dotted`,`double`],pe=()=>[`normal`,`multiply`,`screen`,`overlay`,`darken`,`lighten`,`color-dodge`,`color-burn`,`hard-light`,`soft-light`,`difference`,`exclusion`,`hue`,`saturation`,`color`,`luminosity`],me=()=>[ky,jy,Zy,Gy],he=()=>[``,`none`,m,Jy,z],ge=()=>[`none`,ky,Jy,z],_e=()=>[`none`,ky,Jy,z],ve=()=>[ky,Jy,z],ye=()=>[Oy,`full`,...w()];return{cacheSize:500,theme:{animate:[`spin`,`ping`,`pulse`,`bounce`],aspect:[`video`],blur:[My],breakpoint:[My],color:[Ny],container:[My],"drop-shadow":[My],ease:[`in`,`out`,`in-out`],font:[Ry],"font-weight":[`thin`,`extralight`,`light`,`normal`,`medium`,`semibold`,`bold`,`extrabold`,`black`],"inset-shadow":[My],leading:[`none`,`tight`,`snug`,`normal`,`relaxed`,`loose`],perspective:[`dramatic`,`near`,`normal`,`midrange`,`distant`,`none`],radius:[My],shadow:[My],spacing:[`px`,ky],text:[My],"text-shadow":[My],tracking:[`tighter`,`tight`,`normal`,`wide`,`wider`,`widest`]},classGroups:{aspect:[{aspect:[`auto`,`square`,Oy,z,Jy,g]}],container:[`container`],"container-type":[{"@container":[``,`normal`,`size`,Jy,z]}],"container-named":[zy],columns:[{columns:[ky,`auto`,z,Jy,s]}],"break-after":[{"break-after":y()}],"break-before":[{"break-before":y()}],"break-inside":[{"break-inside":[`auto`,`avoid`,`avoid-page`,`avoid-column`]}],"box-decoration":[{"box-decoration":[`slice`,`clone`]}],box:[{box:[`border`,`content`]}],display:[`block`,`inline-block`,`inline`,`flex`,`inline-flex`,`table`,`inline-table`,`table-caption`,`table-cell`,`table-column`,`table-column-group`,`table-footer-group`,`table-header-group`,`table-row-group`,`table-row`,`flow-root`,`grid`,`inline-grid`,`contents`,`list-item`,`hidden`],sr:[`sr-only`,`not-sr-only`],float:[{float:[`right`,`left`,`none`,`start`,`end`]}],clear:[{clear:[`left`,`right`,`both`,`none`,`start`,`end`]}],isolation:[`isolate`,`isolation-auto`],"object-fit":[{object:[`contain`,`cover`,`fill`,`none`,`scale-down`]}],"object-position":[{object:x()}],overflow:[{overflow:S()}],"overflow-x":[{"overflow-x":S()}],"overflow-y":[{"overflow-y":S()}],overscroll:[{overscroll:C()}],"overscroll-x":[{"overscroll-x":C()}],"overscroll-y":[{"overscroll-y":C()}],position:[`static`,`fixed`,`absolute`,`relative`,`sticky`],inset:[{inset:T()}],"inset-x":[{"inset-x":T()}],"inset-y":[{"inset-y":T()}],start:[{"inset-s":T(),start:T()}],end:[{"inset-e":T(),end:T()}],"inset-bs":[{"inset-bs":T()}],"inset-be":[{"inset-be":T()}],top:[{top:T()}],right:[{right:T()}],bottom:[{bottom:T()}],left:[{left:T()}],visibility:[`visible`,`invisible`,`collapse`],z:[{z:[Ay,`auto`,Jy,z]}],basis:[{basis:[Oy,`full`,`auto`,s,...w()]}],"flex-direction":[{flex:[`row`,`row-reverse`,`col`,`col-reverse`]}],"flex-wrap":[{flex:[`nowrap`,`wrap`,`wrap-reverse`]}],flex:[{flex:[ky,Oy,`auto`,`initial`,`none`,z]}],grow:[{grow:[``,ky,Jy,z]}],shrink:[{shrink:[``,ky,Jy,z]}],order:[{order:[Ay,`first`,`last`,`none`,Jy,z]}],"grid-cols":[{"grid-cols":E()}],"col-start-end":[{col:D()}],"col-start":[{"col-start":ee()}],"col-end":[{"col-end":ee()}],"grid-rows":[{"grid-rows":E()}],"row-start-end":[{row:D()}],"row-start":[{"row-start":ee()}],"row-end":[{"row-end":ee()}],"grid-flow":[{"grid-flow":[`row`,`col`,`dense`,`row-dense`,`col-dense`]}],"auto-cols":[{"auto-cols":O()}],"auto-rows":[{"auto-rows":O()}],gap:[{gap:w()}],"gap-x":[{"gap-x":w()}],"gap-y":[{"gap-y":w()}],"justify-content":[{justify:[...te(),`normal`]}],"justify-items":[{"justify-items":[...ne(),`normal`]}],"justify-self":[{"justify-self":[`auto`,...ne()]}],"align-content":[{content:[`normal`,...te()]}],"align-items":[{items:[...ne(),{baseline:[``,`last`]}]}],"align-self":[{self:[`auto`,...ne(),{baseline:[``,`last`]}]}],"place-content":[{"place-content":te()}],"place-items":[{"place-items":[...ne(),`baseline`]}],"place-self":[{"place-self":[`auto`,...ne()]}],p:[{p:w()}],px:[{px:w()}],py:[{py:w()}],ps:[{ps:w()}],pe:[{pe:w()}],pbs:[{pbs:w()}],pbe:[{pbe:w()}],pt:[{pt:w()}],pr:[{pr:w()}],pb:[{pb:w()}],pl:[{pl:w()}],m:[{m:re()}],mx:[{mx:re()}],my:[{my:re()}],ms:[{ms:re()}],me:[{me:re()}],mbs:[{mbs:re()}],mbe:[{mbe:re()}],mt:[{mt:re()}],mr:[{mr:re()}],mb:[{mb:re()}],ml:[{ml:re()}],"space-x":[{"space-x":w()}],"space-x-reverse":[`space-x-reverse`],"space-y":[{"space-y":w()}],"space-y-reverse":[`space-y-reverse`],size:[{size:ie()}],"inline-size":[{inline:[`auto`,...k()]}],"min-inline-size":[{"min-inline":[`auto`,...k()]}],"max-inline-size":[{"max-inline":[`none`,...k()]}],"block-size":[{block:[`auto`,...ae()]}],"min-block-size":[{"min-block":[`auto`,...ae()]}],"max-block-size":[{"max-block":[`none`,...ae()]}],w:[{w:[s,`screen`,...ie()]}],"min-w":[{"min-w":[s,`screen`,`none`,...ie()]}],"max-w":[{"max-w":[s,`screen`,`none`,`prose`,{screen:[o]},...ie()]}],h:[{h:[`screen`,`lh`,...ie()]}],"min-h":[{"min-h":[`screen`,`lh`,`none`,...ie()]}],"max-h":[{"max-h":[`screen`,`lh`,`none`,...ie()]}],"font-size":[{text:[`base`,n,Yy,Vy]}],"font-smoothing":[`antialiased`,`subpixel-antialiased`],"font-style":[`italic`,`not-italic`],"font-weight":[{font:[r,tb,Uy]}],"font-stretch":[{"font-stretch":[`ultra-condensed`,`extra-condensed`,`condensed`,`semi-condensed`,`normal`,`semi-expanded`,`expanded`,`extra-expanded`,`ultra-expanded`,jy,z]}],"font-family":[{font:[Xy,Wy,t]}],"font-features":[{"font-features":[z]}],"fvn-normal":[`normal-nums`],"fvn-ordinal":[`ordinal`],"fvn-slashed-zero":[`slashed-zero`],"fvn-figure":[`lining-nums`,`oldstyle-nums`],"fvn-spacing":[`proportional-nums`,`tabular-nums`],"fvn-fraction":[`diagonal-fractions`,`stacked-fractions`],tracking:[{tracking:[i,Jy,z]}],"line-clamp":[{"line-clamp":[ky,`none`,Jy,Hy]}],leading:[{leading:[`none`,a,...w()]}],"list-image":[{"list-image":[`none`,Jy,z]}],"list-style-position":[{list:[`inside`,`outside`]}],"list-style-type":[{list:[`disc`,`decimal`,`none`,Jy,z]}],"text-alignment":[{text:[`left`,`center`,`right`,`justify`,`start`,`end`]}],"placeholder-color":[{placeholder:A()}],"text-color":[{text:A()}],"text-decoration":[`underline`,`overline`,`line-through`,`no-underline`],"text-decoration-style":[{decoration:[...fe(),`wavy`]}],"text-decoration-thickness":[{decoration:[ky,`from-font`,`auto`,Jy,Vy]}],"text-decoration-color":[{decoration:A()}],"underline-offset":[{"underline-offset":[ky,`auto`,Jy,z]}],"text-transform":[`uppercase`,`lowercase`,`capitalize`,`normal-case`],"text-overflow":[`truncate`,`text-ellipsis`,`text-clip`],"text-wrap":[{text:[`wrap`,`nowrap`,`balance`,`pretty`]}],indent:[{indent:w()}],"tab-size":[{tab:[Ay,Jy,z]}],"vertical-align":[{align:[`baseline`,`top`,`middle`,`bottom`,`text-top`,`text-bottom`,`sub`,`super`,Jy,z]}],whitespace:[{whitespace:[`normal`,`nowrap`,`pre`,`pre-line`,`pre-wrap`,`break-spaces`]}],break:[{break:[`normal`,`words`,`all`,`keep`]}],wrap:[{wrap:[`break-word`,`anywhere`,`normal`]}],hyphens:[{hyphens:[`none`,`manual`,`auto`]}],content:[{content:[`none`,Jy,z]}],"bg-attachment":[{bg:[`fixed`,`local`,`scroll`]}],"bg-clip":[{"bg-clip":[`border`,`padding`,`content`,`text`]}],"bg-origin":[{"bg-origin":[`border`,`padding`,`content`]}],"bg-position":[{bg:oe()}],"bg-repeat":[{bg:se()}],"bg-size":[{bg:ce()}],"bg-image":[{bg:[`none`,{linear:[{to:[`t`,`tr`,`r`,`br`,`b`,`bl`,`l`,`tl`]},Ay,Jy,z],radial:[``,Jy,z],conic:[``,Ay,Jy,z]},$y,Ky]}],"bg-color":[{bg:A()}],"gradient-from-pos":[{from:le()}],"gradient-via-pos":[{via:le()}],"gradient-to-pos":[{to:le()}],"gradient-from":[{from:A()}],"gradient-via":[{via:A()}],"gradient-to":[{to:A()}],rounded:[{rounded:ue()}],"rounded-s":[{"rounded-s":ue()}],"rounded-e":[{"rounded-e":ue()}],"rounded-t":[{"rounded-t":ue()}],"rounded-r":[{"rounded-r":ue()}],"rounded-b":[{"rounded-b":ue()}],"rounded-l":[{"rounded-l":ue()}],"rounded-ss":[{"rounded-ss":ue()}],"rounded-se":[{"rounded-se":ue()}],"rounded-ee":[{"rounded-ee":ue()}],"rounded-es":[{"rounded-es":ue()}],"rounded-tl":[{"rounded-tl":ue()}],"rounded-tr":[{"rounded-tr":ue()}],"rounded-br":[{"rounded-br":ue()}],"rounded-bl":[{"rounded-bl":ue()}],"border-w":[{border:de()}],"border-w-x":[{"border-x":de()}],"border-w-y":[{"border-y":de()}],"border-w-s":[{"border-s":de()}],"border-w-e":[{"border-e":de()}],"border-w-bs":[{"border-bs":de()}],"border-w-be":[{"border-be":de()}],"border-w-t":[{"border-t":de()}],"border-w-r":[{"border-r":de()}],"border-w-b":[{"border-b":de()}],"border-w-l":[{"border-l":de()}],"divide-x":[{"divide-x":de()}],"divide-x-reverse":[`divide-x-reverse`],"divide-y":[{"divide-y":de()}],"divide-y-reverse":[`divide-y-reverse`],"border-style":[{border:[...fe(),`hidden`,`none`]}],"divide-style":[{divide:[...fe(),`hidden`,`none`]}],"border-color":[{border:A()}],"border-color-x":[{"border-x":A()}],"border-color-y":[{"border-y":A()}],"border-color-s":[{"border-s":A()}],"border-color-e":[{"border-e":A()}],"border-color-bs":[{"border-bs":A()}],"border-color-be":[{"border-be":A()}],"border-color-t":[{"border-t":A()}],"border-color-r":[{"border-r":A()}],"border-color-b":[{"border-b":A()}],"border-color-l":[{"border-l":A()}],"divide-color":[{divide:A()}],"outline-style":[{outline:[...fe(),`none`,`hidden`]}],"outline-offset":[{"outline-offset":[ky,Jy,z]}],"outline-w":[{outline:[``,ky,Yy,Vy]}],"outline-color":[{outline:A()}],shadow:[{shadow:[``,`inner`,`none`,u,eb,qy]}],"shadow-color":[{shadow:A()}],"inset-shadow":[{"inset-shadow":[`none`,d,eb,qy]}],"inset-shadow-color":[{"inset-shadow":A()}],"ring-w":[{ring:de()}],"ring-w-inset":[`ring-inset`],"ring-color":[{ring:A()}],"ring-offset-w":[{"ring-offset":[ky,Vy]}],"ring-offset-color":[{"ring-offset":A()}],"inset-ring-w":[{"inset-ring":de()}],"inset-ring-color":[{"inset-ring":A()}],"text-shadow":[{"text-shadow":[`none`,f,eb,qy]}],"text-shadow-color":[{"text-shadow":A()}],opacity:[{opacity:[ky,Jy,z]}],"mix-blend":[{"mix-blend":[...pe(),`plus-darker`,`plus-lighter`]}],"bg-blend":[{"bg-blend":pe()}],"mask-clip":[{"mask-clip":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]},`mask-no-clip`],"mask-composite":[{mask:[`add`,`subtract`,`intersect`,`exclude`]}],"mask-image-linear-pos":[{"mask-linear":[ky]}],"mask-image-linear-from-pos":[{"mask-linear-from":me()}],"mask-image-linear-to-pos":[{"mask-linear-to":me()}],"mask-image-linear-from-color":[{"mask-linear-from":A()}],"mask-image-linear-to-color":[{"mask-linear-to":A()}],"mask-image-t-from-pos":[{"mask-t-from":me()}],"mask-image-t-to-pos":[{"mask-t-to":me()}],"mask-image-t-from-color":[{"mask-t-from":A()}],"mask-image-t-to-color":[{"mask-t-to":A()}],"mask-image-r-from-pos":[{"mask-r-from":me()}],"mask-image-r-to-pos":[{"mask-r-to":me()}],"mask-image-r-from-color":[{"mask-r-from":A()}],"mask-image-r-to-color":[{"mask-r-to":A()}],"mask-image-b-from-pos":[{"mask-b-from":me()}],"mask-image-b-to-pos":[{"mask-b-to":me()}],"mask-image-b-from-color":[{"mask-b-from":A()}],"mask-image-b-to-color":[{"mask-b-to":A()}],"mask-image-l-from-pos":[{"mask-l-from":me()}],"mask-image-l-to-pos":[{"mask-l-to":me()}],"mask-image-l-from-color":[{"mask-l-from":A()}],"mask-image-l-to-color":[{"mask-l-to":A()}],"mask-image-x-from-pos":[{"mask-x-from":me()}],"mask-image-x-to-pos":[{"mask-x-to":me()}],"mask-image-x-from-color":[{"mask-x-from":A()}],"mask-image-x-to-color":[{"mask-x-to":A()}],"mask-image-y-from-pos":[{"mask-y-from":me()}],"mask-image-y-to-pos":[{"mask-y-to":me()}],"mask-image-y-from-color":[{"mask-y-from":A()}],"mask-image-y-to-color":[{"mask-y-to":A()}],"mask-image-radial":[{"mask-radial":[Jy,z]}],"mask-image-radial-from-pos":[{"mask-radial-from":me()}],"mask-image-radial-to-pos":[{"mask-radial-to":me()}],"mask-image-radial-from-color":[{"mask-radial-from":A()}],"mask-image-radial-to-color":[{"mask-radial-to":A()}],"mask-image-radial-shape":[{"mask-radial":[`circle`,`ellipse`]}],"mask-image-radial-size":[{"mask-radial":[{closest:[`side`,`corner`],farthest:[`side`,`corner`]}]}],"mask-image-radial-pos":[{"mask-radial-at":b()}],"mask-image-conic-pos":[{"mask-conic":[ky]}],"mask-image-conic-from-pos":[{"mask-conic-from":me()}],"mask-image-conic-to-pos":[{"mask-conic-to":me()}],"mask-image-conic-from-color":[{"mask-conic-from":A()}],"mask-image-conic-to-color":[{"mask-conic-to":A()}],"mask-mode":[{mask:[`alpha`,`luminance`,`match`]}],"mask-origin":[{"mask-origin":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]}],"mask-position":[{mask:oe()}],"mask-repeat":[{mask:se()}],"mask-size":[{mask:ce()}],"mask-type":[{"mask-type":[`alpha`,`luminance`]}],"mask-image":[{mask:[`none`,Jy,z]}],filter:[{filter:[``,`none`,Jy,z]}],blur:[{blur:he()}],brightness:[{brightness:[ky,Jy,z]}],contrast:[{contrast:[ky,Jy,z]}],"drop-shadow":[{"drop-shadow":[``,`none`,p,eb,qy]}],"drop-shadow-color":[{"drop-shadow":A()}],grayscale:[{grayscale:[``,ky,Jy,z]}],"hue-rotate":[{"hue-rotate":[ky,Jy,z]}],invert:[{invert:[``,ky,Jy,z]}],saturate:[{saturate:[ky,Jy,z]}],sepia:[{sepia:[``,ky,Jy,z]}],"backdrop-filter":[{"backdrop-filter":[``,`none`,Jy,z]}],"backdrop-blur":[{"backdrop-blur":he()}],"backdrop-brightness":[{"backdrop-brightness":[ky,Jy,z]}],"backdrop-contrast":[{"backdrop-contrast":[ky,Jy,z]}],"backdrop-grayscale":[{"backdrop-grayscale":[``,ky,Jy,z]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[ky,Jy,z]}],"backdrop-invert":[{"backdrop-invert":[``,ky,Jy,z]}],"backdrop-opacity":[{"backdrop-opacity":[ky,Jy,z]}],"backdrop-saturate":[{"backdrop-saturate":[ky,Jy,z]}],"backdrop-sepia":[{"backdrop-sepia":[``,ky,Jy,z]}],"border-collapse":[{border:[`collapse`,`separate`]}],"border-spacing":[{"border-spacing":w()}],"border-spacing-x":[{"border-spacing-x":w()}],"border-spacing-y":[{"border-spacing-y":w()}],"table-layout":[{table:[`auto`,`fixed`]}],caption:[{caption:[`top`,`bottom`]}],transition:[{transition:[``,`all`,`colors`,`opacity`,`shadow`,`transform`,`none`,Jy,z]}],"transition-behavior":[{transition:[`normal`,`discrete`]}],duration:[{duration:[ky,`initial`,Jy,z]}],ease:[{ease:[`linear`,`initial`,_,Jy,z]}],delay:[{delay:[ky,Jy,z]}],animate:[{animate:[`none`,v,Jy,z]}],backface:[{backface:[`hidden`,`visible`]}],perspective:[{perspective:[h,Jy,z]}],"perspective-origin":[{"perspective-origin":x()}],rotate:[{rotate:ge()}],"rotate-x":[{"rotate-x":ge()}],"rotate-y":[{"rotate-y":ge()}],"rotate-z":[{"rotate-z":ge()}],scale:[{scale:_e()}],"scale-x":[{"scale-x":_e()}],"scale-y":[{"scale-y":_e()}],"scale-z":[{"scale-z":_e()}],"scale-3d":[`scale-3d`],skew:[{skew:ve()}],"skew-x":[{"skew-x":ve()}],"skew-y":[{"skew-y":ve()}],transform:[{transform:[Jy,z,``,`none`,`gpu`,`cpu`]}],"transform-origin":[{origin:x()}],"transform-style":[{transform:[`3d`,`flat`]}],translate:[{translate:ye()}],"translate-x":[{"translate-x":ye()}],"translate-y":[{"translate-y":ye()}],"translate-z":[{"translate-z":ye()}],"translate-none":[`translate-none`],zoom:[{zoom:[Ay,Jy,z]}],accent:[{accent:A()}],appearance:[{appearance:[`none`,`auto`]}],"caret-color":[{caret:A()}],"color-scheme":[{scheme:[`normal`,`dark`,`light`,`light-dark`,`only-dark`,`only-light`]}],cursor:[{cursor:[`auto`,`default`,`pointer`,`wait`,`text`,`move`,`help`,`not-allowed`,`none`,`context-menu`,`progress`,`cell`,`crosshair`,`vertical-text`,`alias`,`copy`,`no-drop`,`grab`,`grabbing`,`all-scroll`,`col-resize`,`row-resize`,`n-resize`,`e-resize`,`s-resize`,`w-resize`,`ne-resize`,`nw-resize`,`se-resize`,`sw-resize`,`ew-resize`,`ns-resize`,`nesw-resize`,`nwse-resize`,`zoom-in`,`zoom-out`,Jy,z]}],"field-sizing":[{"field-sizing":[`fixed`,`content`]}],"pointer-events":[{"pointer-events":[`auto`,`none`]}],resize:[{resize:[`none`,``,`y`,`x`]}],"scroll-behavior":[{scroll:[`auto`,`smooth`]}],"scrollbar-thumb-color":[{"scrollbar-thumb":A()}],"scrollbar-track-color":[{"scrollbar-track":A()}],"scrollbar-gutter":[{"scrollbar-gutter":[`auto`,`stable`,`both`]}],"scrollbar-w":[{scrollbar:[`auto`,`thin`,`none`]}],"scroll-m":[{"scroll-m":w()}],"scroll-mx":[{"scroll-mx":w()}],"scroll-my":[{"scroll-my":w()}],"scroll-ms":[{"scroll-ms":w()}],"scroll-me":[{"scroll-me":w()}],"scroll-mbs":[{"scroll-mbs":w()}],"scroll-mbe":[{"scroll-mbe":w()}],"scroll-mt":[{"scroll-mt":w()}],"scroll-mr":[{"scroll-mr":w()}],"scroll-mb":[{"scroll-mb":w()}],"scroll-ml":[{"scroll-ml":w()}],"scroll-p":[{"scroll-p":w()}],"scroll-px":[{"scroll-px":w()}],"scroll-py":[{"scroll-py":w()}],"scroll-ps":[{"scroll-ps":w()}],"scroll-pe":[{"scroll-pe":w()}],"scroll-pbs":[{"scroll-pbs":w()}],"scroll-pbe":[{"scroll-pbe":w()}],"scroll-pt":[{"scroll-pt":w()}],"scroll-pr":[{"scroll-pr":w()}],"scroll-pb":[{"scroll-pb":w()}],"scroll-pl":[{"scroll-pl":w()}],"snap-align":[{snap:[`start`,`end`,`center`,`align-none`]}],"snap-stop":[{snap:[`normal`,`always`]}],"snap-type":[{snap:[`none`,`x`,`y`,`both`]}],"snap-strictness":[{snap:[`mandatory`,`proximity`]}],touch:[{touch:[`auto`,`none`,`manipulation`]}],"touch-x":[{"touch-pan":[`x`,`left`,`right`]}],"touch-y":[{"touch-pan":[`y`,`up`,`down`]}],"touch-pz":[`touch-pinch-zoom`],select:[{select:[`none`,`text`,`all`,`auto`]}],"will-change":[{"will-change":[`auto`,`scroll`,`contents`,`transform`,Jy,z]}],fill:[{fill:[`none`,...A()]}],"stroke-w":[{stroke:[ky,Yy,Vy,Hy]}],stroke:[{stroke:[`none`,...A()]}],"forced-color-adjust":[{"forced-color-adjust":[`auto`,`none`]}]},conflictingClassGroups:{"container-named":[`container-type`],overflow:[`overflow-x`,`overflow-y`],overscroll:[`overscroll-x`,`overscroll-y`],inset:[`inset-x`,`inset-y`,`inset-bs`,`inset-be`,`start`,`end`,`top`,`right`,`bottom`,`left`],"inset-x":[`start`,`end`,`right`,`left`],"inset-y":[`inset-bs`,`inset-be`,`top`,`bottom`],flex:[`basis`,`grow`,`shrink`],gap:[`gap-x`,`gap-y`],p:[`px`,`py`,`ps`,`pe`,`pbs`,`pbe`,`pt`,`pr`,`pb`,`pl`],px:[`ps`,`pe`,`pr`,`pl`],py:[`pbs`,`pbe`,`pt`,`pb`],m:[`mx`,`my`,`ms`,`me`,`mbs`,`mbe`,`mt`,`mr`,`mb`,`ml`],mx:[`ms`,`me`,`mr`,`ml`],my:[`mbs`,`mbe`,`mt`,`mb`],size:[`w`,`h`],"font-size":[`leading`],"fvn-normal":[`fvn-ordinal`,`fvn-slashed-zero`,`fvn-figure`,`fvn-spacing`,`fvn-fraction`],"fvn-ordinal":[`fvn-normal`],"fvn-slashed-zero":[`fvn-normal`],"fvn-figure":[`fvn-normal`],"fvn-spacing":[`fvn-normal`],"fvn-fraction":[`fvn-normal`],"line-clamp":[`display`,`overflow`],rounded:[`rounded-s`,`rounded-e`,`rounded-t`,`rounded-r`,`rounded-b`,`rounded-l`,`rounded-ss`,`rounded-se`,`rounded-ee`,`rounded-es`,`rounded-tl`,`rounded-tr`,`rounded-br`,`rounded-bl`],"rounded-s":[`rounded-ss`,`rounded-es`],"rounded-e":[`rounded-se`,`rounded-ee`],"rounded-t":[`rounded-tl`,`rounded-tr`],"rounded-r":[`rounded-tr`,`rounded-br`],"rounded-b":[`rounded-br`,`rounded-bl`],"rounded-l":[`rounded-tl`,`rounded-bl`],"border-spacing":[`border-spacing-x`,`border-spacing-y`],"border-w":[`border-w-x`,`border-w-y`,`border-w-s`,`border-w-e`,`border-w-bs`,`border-w-be`,`border-w-t`,`border-w-r`,`border-w-b`,`border-w-l`],"border-w-x":[`border-w-s`,`border-w-e`,`border-w-r`,`border-w-l`],"border-w-y":[`border-w-bs`,`border-w-be`,`border-w-t`,`border-w-b`],"border-color":[`border-color-x`,`border-color-y`,`border-color-s`,`border-color-e`,`border-color-bs`,`border-color-be`,`border-color-t`,`border-color-r`,`border-color-b`,`border-color-l`],"border-color-x":[`border-color-s`,`border-color-e`,`border-color-r`,`border-color-l`],"border-color-y":[`border-color-bs`,`border-color-be`,`border-color-t`,`border-color-b`],translate:[`translate-x`,`translate-y`,`translate-none`],"translate-none":[`translate`,`translate-x`,`translate-y`,`translate-z`],"scroll-m":[`scroll-mx`,`scroll-my`,`scroll-ms`,`scroll-me`,`scroll-mbs`,`scroll-mbe`,`scroll-mt`,`scroll-mr`,`scroll-mb`,`scroll-ml`],"scroll-mx":[`scroll-ms`,`scroll-me`,`scroll-mr`,`scroll-ml`],"scroll-my":[`scroll-mbs`,`scroll-mbe`,`scroll-mt`,`scroll-mb`],"scroll-p":[`scroll-px`,`scroll-py`,`scroll-ps`,`scroll-pe`,`scroll-pbs`,`scroll-pbe`,`scroll-pt`,`scroll-pr`,`scroll-pb`,`scroll-pl`],"scroll-px":[`scroll-ps`,`scroll-pe`,`scroll-pr`,`scroll-pl`],"scroll-py":[`scroll-pbs`,`scroll-pbe`,`scroll-pt`,`scroll-pb`],touch:[`touch-x`,`touch-y`,`touch-pz`],"touch-x":[`touch`],"touch-y":[`touch`],"touch-pz":[`touch`]},conflictingClassGroupModifiers:{"font-size":[`leading`]},postfixLookupClassGroups:[`container-type`],orderSensitiveModifiers:[`*`,`**`,`after`,`backdrop`,`before`,`details-content`,`file`,`first-letter`,`first-line`,`marker`,`placeholder`,`selection`]}});function pb(...e){return fb(zv(e))}function mb({type:e=`button`,variant:t=`default`,className:n=``,disabled:r=!1,href:i,onclick:a,children:o}){let s=pb(`focus-visible:ring-ring/50 inline-flex h-10 items-center justify-center gap-2 rounded-full border border-transparent px-5 py-2 text-sm font-medium transition-opacity focus-visible:ring-2 focus-visible:outline-none disabled:pointer-events-none disabled:opacity-50`,t===`outline`?`border-border bg-surface/80 text-foreground hover:bg-hover-fill`:`bg-primary text-primary-foreground hover:opacity-90`,n);return i&&!r?(0,R.jsx)(`a`,{href:i,className:s,onClick:a,children:o}):(0,R.jsx)(`button`,{type:e,disabled:r,className:s,onClick:a,children:o})}function hb({class:e=``,size:t=`md`,onclick:n,label:r}){let i=t===`sm`?`h-6 w-6`:`h-7 w-7`,a=t===`sm`?`text-lg`:`text-[1.15rem]`,o=(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(`img`,{src:`/logo.png`,alt:``,className:pb(`shrink-0`,i)}),(0,R.jsx)(`span`,{className:pb(`font-brand text-foreground truncate font-semibold tracking-tight`,a),children:`Sprocket`})]});return n?(0,R.jsx)(`button`,{type:`button`,className:pb(`flex min-w-0 items-center gap-2`,e),"aria-label":r,title:r,onClick:n,children:o}):(0,R.jsx)(`div`,{className:pb(`flex min-w-0 items-center gap-2`,e),children:o})}function gb(e){return e===`light`||e===`dark`}function _b(e){return e??`light`}var vb=0,yb=null;function bb(e){document.documentElement.dataset.theme=e,document.documentElement.style.colorScheme=e}function xb(e){if(globalThis.document){if(vb>0){yb=e;return}bb(e)}}function Sb(){return globalThis.document?(vb===0&&(yb=gb(document.documentElement.dataset.theme)?document.documentElement.dataset.theme:_b(null),bb(`light`)),vb+=1,()=>{if(vb=Math.max(0,vb-1),vb===0){let e=yb??_b(null);yb=null,bb(e)}}):()=>{}}function Cb({title:e,description:t=null,busy:n=!1,class:r=``,children:i,actions:a}){return(0,F.useLayoutEffect)(Sb,[]),(0,R.jsx)(`div`,{className:pb(`app-entry-shell relative flex min-h-screen items-center justify-center px-8 py-10 text-center`,r),children:(0,R.jsxs)(`div`,{className:`relative z-10 w-full max-w-md`,"aria-busy":n||void 0,"aria-live":n?`polite`:void 0,children:[(0,R.jsx)(`div`,{className:`mb-8 flex justify-center`,children:(0,R.jsx)(hb,{})}),(0,R.jsx)(`h1`,{className:`font-brand text-foreground text-[1.5rem] font-semibold tracking-tight`,children:e}),t&&(0,R.jsx)(`p`,{className:`text-muted-foreground mt-3 text-sm leading-[1.55]`,children:t}),i&&(0,R.jsx)(`div`,{className:`mt-5 space-y-4 text-left [&:not(:has(*))]:mt-0 [&:not(:has(*))]:hidden`,children:i}),a&&(0,R.jsx)(`div`,{className:`mt-6 flex flex-wrap items-center justify-center gap-3 [&:not(:has(*))]:mt-0 [&:not(:has(*))]:hidden`,children:a})]})})}function wb({authState:e,overlayOpen:t=!1,onSignIn:n,onSignOut:r,onRetry:i,retryLabel:a=`Retry`,onSignUp:o}){let s=e.isAuthenticated&&(e.isLoading||!e.connectionFailed),c=!e.isAuthenticated&&e.isLoading,l=e.isConfigured?s?`Confirming your session`:e.connectionFailed?`Couldn’t connect your account`:c?`Preparing sign-in`:`Sign in to continue`:`Sign-in unavailable`,u=e.isConfigured?s?`Verifying your secure connection before opening your projects.`:e.connectionFailed?`Your session could not be confirmed. Retry when the connection is available.`:c?`Getting account sign-in ready. This usually takes a moment.`:`Sign in to sync your coding threads, streaming responses, and projects.`:`Account sign-in is not configured on this deployment, so account actions are disabled.`;return(0,R.jsx)(`div`,{inert:t,"aria-hidden":t||void 0,children:(0,R.jsxs)(Cb,{title:l,description:u,actions:(0,R.jsxs)(R.Fragment,{children:[e.connectionFailed&&e.isConfigured&&(0,R.jsx)(mb,{onclick:i,disabled:e.isLoading,children:a}),e.isAuthenticated?(0,R.jsx)(mb,{variant:`outline`,onclick:r,children:`Sign Out`}):e.isConfigured&&!e.connectionFailed&&(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(mb,{onclick:n,disabled:e.isLoading,children:`Sign In`}),(0,R.jsx)(mb,{variant:`outline`,onclick:o,disabled:e.isLoading,children:`Create Account`})]})]}),children:[e.isConfigured&&e.error&&!t&&(0,R.jsx)(`p`,{className:`text-destructive text-center text-sm`,role:`alert`,children:e.error}),e.isLoading&&(0,R.jsxs)(`div`,{className:`text-muted-foreground flex items-center justify-center gap-2 text-sm`,"aria-live":`polite`,"aria-busy":`true`,children:[(0,R.jsx)(V_,{className:`size-3.5 animate-spin`,"aria-hidden":`true`}),(0,R.jsx)(`span`,{children:e.isAuthenticated?`Almost there`:`One moment`})]})]})})}function Tb({open:e,signInUrl:t,error:n=null,onCancel:r,onClearOpenError:i}){let[a,o]=(0,F.useState)(!1),[s,c]=(0,F.useState)(null),l=(0,F.useRef)(null),u=(0,F.useRef)(null),d=(0,F.useRef)(r),f=(0,F.useRef)(i);(0,F.useEffect)(()=>{d.current=r,f.current=i}),(0,F.useEffect)(()=>{if(!e){o(!1),c(null);return}let t=document.activeElement instanceof HTMLElement?document.activeElement:null;l.current?.focus();function n(e){if(e.key===`Escape`){e.preventDefault(),e.stopPropagation(),d.current();return}let t=l.current;if(e.key!==`Tab`||!t)return;let n=Array.from(t.querySelectorAll(`a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])`)).filter(e=>!e.hasAttribute(`hidden`)&&e.offsetParent!==null);if(n.length===0){e.preventDefault(),t.focus();return}let r=n[0],i=n[n.length-1],a=document.activeElement;e.shiftKey&&(a===t||a===r||!t.contains(a))?(e.preventDefault(),i.focus()):!e.shiftKey&&(a===t||a===i||!t.contains(a))&&(e.preventDefault(),r.focus())}return window.addEventListener(`keydown`,n,!0),()=>{window.removeEventListener(`keydown`,n,!0),u.current!==null&&(window.clearTimeout(u.current),u.current=null),t?.isConnected&&t.focus()}},[e]);async function p(){if(t)try{await navigator.clipboard.writeText(t),o(!0),c(null),u.current!==null&&window.clearTimeout(u.current),u.current=window.setTimeout(()=>{o(!1),u.current=null},2e3)}catch{o(!1),c(`Could not copy the sign-in link. Select it above and copy manually.`)}}function m(){if(!t)return;let e=window.open(t,`_blank`);if(e){try{e.opener=null}catch{}f.current?.()}}if(!e)return null;let h=t?n?{title:`Open the sign-in link`,description:`Your browser didn’t open automatically. Continue with the options below.`}:{title:`Finish signing in`,description:`We opened your browser to complete sign-in. Waiting for you to finish there.`}:{title:`Preparing sign-in`,description:`Preparing a secure sign-in link. This usually takes a moment.`};return(0,R.jsx)(`div`,{className:`app-entry-shell fixed inset-0 z-50 flex items-center justify-center px-6`,role:`presentation`,onClick:e=>{e.target===e.currentTarget&&r()},children:(0,R.jsxs)(`div`,{ref:l,className:`border-border/70 bg-surface relative z-10 w-full max-w-md rounded-2xl border p-8 text-center shadow-[0_18px_50px_-28px_oklch(0.2_0.02_260/0.45)] outline-none`,role:`dialog`,"aria-modal":`true`,"aria-labelledby":`browser-signin-title`,"aria-describedby":`browser-signin-desc`,tabIndex:-1,children:[!t&&(0,R.jsx)(`div`,{className:`text-muted-foreground mb-4 flex justify-center`,"aria-hidden":`true`,children:(0,R.jsx)(V_,{className:`size-5 animate-spin`})}),(0,R.jsx)(`h2`,{id:`browser-signin-title`,className:`font-brand text-foreground text-[1.35rem] font-semibold tracking-tight`,children:h.title}),(0,R.jsx)(`p`,{id:`browser-signin-desc`,className:`text-muted-foreground mt-3 text-sm leading-[1.55]`,children:h.description}),t&&(0,R.jsx)(`p`,{className:`text-muted-foreground mt-6 max-h-24 overflow-y-auto font-mono text-[11px] leading-5 break-all select-all`,title:t,children:t}),n&&(0,R.jsx)(`p`,{className:`text-destructive mt-4 text-sm`,role:`alert`,children:n}),s&&(0,R.jsx)(`p`,{className:`mt-4 text-sm text-amber-700`,role:`alert`,children:s}),(0,R.jsx)(`div`,{className:`mt-6 flex flex-wrap items-center justify-center gap-3`,children:t?(0,R.jsxs)(R.Fragment,{children:[(0,R.jsxs)(mb,{onclick:m,children:[(0,R.jsx)(p_,{className:`size-4`,"aria-hidden":`true`}),`Open browser`]}),(0,R.jsx)(mb,{variant:`outline`,onclick:()=>void p(),children:a?(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(Ug,{className:`size-4`,"aria-hidden":`true`}),`Copied`]}):(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(r_,{className:`size-4`,"aria-hidden":`true`}),`Copy link`]})})]}):(0,R.jsx)(`span`,{className:`text-muted-foreground border-border inline-flex h-10 items-center justify-center gap-2 rounded-full border px-4 text-sm`,children:`Preparing link…`})}),(0,R.jsx)(`div`,{className:`mt-6`,children:(0,R.jsx)(`button`,{type:`button`,className:`text-muted-foreground hover:text-foreground decoration-foreground/30 hover:decoration-foreground text-[13px] underline underline-offset-4 transition-colors`,onClick:r,children:`Cancel`})})]})})}var Eb=`agent_decide`;function Db(e){return!!e.selectedOptionId?.trim()||!!e.text.trim()}var Ob=[`none`,`low`,`medium`,`high`,`xhigh`,`max`],kb=`gpt-5.6-sol`,Ab=`high`;function jb(e){return e.key===`Enter`&&!e.shiftKey&&!e.isComposing}function Mb(e){return e!==null&&Array.from(e.types).includes(`Files`)}var Nb=/(^|\s)@([^\s"@]*|"(?:[^"\\]|\\.)*)$/,Pb=/\\(["\\])/g,Fb=/[\\[\]`*_<>&~]/g,Ib=/[!'()*]/g;function Lb(e){return e.path+(e.kind===`directory`?`/`:``)}function Rb(e){return e.replace(Fb,e=>e===`&`?`&amp;`:`&#${e.charCodeAt(0)};`)}function zb(e){return encodeURIComponent(e).replace(Ib,e=>`%${e.charCodeAt(0).toString(16).toUpperCase()}`)}function Bb(e,t){if(t<0||t>e.length)return null;let n=e.slice(0,t).match(Nb);if(!n||n.index===void 0)return null;let r=n[2],i=r.startsWith(`"`);return{query:i?r.slice(1).replace(Pb,`$1`):r,quoted:i,start:n.index+n[1].length}}function Vb(e,t,n){let r=Bb(e,t);if(!r)return null;let i=t;if(r.quoted){for(;i<e.length&&e[i]!==`"`;)i+=e[i]===`\\`&&i+1<e.length?2:1;e[i]===`"`&&(i+=1)}else for(;i<e.length&&!/\s/.test(e[i]);)i+=1;e[i]===` `&&(i+=1);let a=Lb(n),o=`[${Rb(n.path.slice(n.path.lastIndexOf(`/`)+1))}](${a.split(`/`).map(zb).join(`/`)}) `;return{text:e.slice(0,r.start)+o+e.slice(i),caret:r.start+o.length}}var Hb=/(^|\s)\$([a-z0-9-]*)$/i;function Ub(e,t){if(t<0||t>e.length)return null;let n=e.slice(0,t).match(Hb);return!n||n.index===void 0?null:{query:n[2].toLowerCase(),tokenStart:n.index+n[1].length}}function Wb(e,t){return Ub(e,t)?.query??null}function Gb(e,t){let n=t.toLowerCase(),r=[],i=[];for(let t of e){let e=t.name.toLowerCase();e.startsWith(n)?r.push(t):n.length>0&&e.includes(n)&&i.push(t)}return r.sort((e,t)=>e.name.localeCompare(t.name)),i.sort((e,t)=>e.name.localeCompare(t.name)),[...r,...i]}function Kb(e,t,n){let r=Ub(e,t);if(!r)return null;let i=t;for(;i<e.length&&/[a-z0-9-]/i.test(e[i]??``);)i+=1;e[i]===` `&&(i+=1);let a=`$${n} `;return{text:`${e.slice(0,r.tokenStart)}${a}${e.slice(i)}`,caret:r.tokenStart+a.length}}var qb=`/api`,Jb=`Model catalog is unavailable.`;function Yb(e,t){return e.models.find(e=>e.id===t)}function Xb(e){return e.reasoningEfforts.length!==1||e.reasoningEfforts[0]!==`none`}function Zb(e,t){return e.models.filter(e=>t===`spikonado`||e.provider===`openai`).map(e=>({id:e.id,label:e.label,provider:e.provider}))}function Qb(e,t,n){let r=Zb(e,t);return r.some(e=>e.id===n)?n:r.some(t=>t.id===e.defaultModelId)?e.defaultModelId:r[0]?.id}function $b(e){switch(e){case`none`:return`None`;case`low`:return`Low`;case`medium`:return`Medium`;case`high`:return`High`;case`xhigh`:return`Extra High`;case`max`:return`Max`;default:return e}}var ex=kd({id:L().min(1),label:L().min(1),provider:L().min(1),supportsImages:vd(),contextWindowTokens:gd(),autoCompactTokenLimit:gd(),reasoningEfforts:Ed(L()).min(1),defaultReasoningEffort:L().min(1),serviceTiers:Ed(L()).min(1),usagePolicy:Vd(`unlimited`).optional()}),tx=Od({sprocket:Od({protocolVersion:gd(),catalogVersion:L().min(1),defaultModelId:L().min(1),defaultReasoningEffort:L().min(1),defaultServiceTier:L().min(1),models:Ed(ex).min(1)})});function nx(e){let t=e.sprocket;if(t.protocolVersion!==1)throw Error(`${Jb} Unsupported protocol version ${t.protocolVersion}.`);return{protocolVersion:t.protocolVersion,catalogVersion:t.catalogVersion,defaultModelId:t.defaultModelId,defaultReasoningEffort:t.defaultReasoningEffort,models:t.models.map(e=>({id:e.id,label:e.label,provider:e.provider,supportsImages:e.supportsImages,contextWindowTokens:e.contextWindowTokens,autoHandoffTokenLimit:e.autoCompactTokenLimit,reasoningEfforts:e.reasoningEfforts,defaultReasoningEffort:e.defaultReasoningEffort,supportsFastMode:e.serviceTiers.includes(`fast`),usagePolicy:e.usagePolicy}))}}async function rx(e){let t=e.replace(/\/+$/,``);if(!t)throw Error(Jb);let n=await fetch(`${t}${qb}/v1/models`,{headers:{accept:`application/json`}});if(!n.ok)throw Error(Jb);let r=tx.safeParse(await n.json());if(!r.success)throw Error(Jb);return nx(r.data)}function ix(e){let t=Math.floor(e/60),n=e%60;return t===0?`${n}s`:`${t}m ${n}s`}function ax(e){let t=Math.max(0,e),n=Math.ceil(t/36e5);if(n>=24){let e=Math.floor(n/24),t=n%24;return t>0?`${e}d ${t}h`:`${e}d`}return t>=36e5?`${n}h`:`${Math.max(1,Math.ceil(t/6e4))}m`}function ox(e){let t=Math.max(0,Math.floor(e/1e3)),n=Math.floor(t/86400),r=Math.floor(t%86400/3600),i=Math.floor(t%3600/60),a=t%60;return n>0?r>0?`${n}d ${r}h`:`${n}d`:r>0?i>0?`${r}h ${i}m`:`${r}h`:i>0?`${i}m ${a}s`:`${a}s`}function sx(){let[e,t]=(0,F.useState)(()=>Date.now());return(0,F.useEffect)(()=>{let e=setInterval(()=>t(Date.now()),6e4);return()=>clearInterval(e)},[]),e}function cx({question:e,options:t,selectedOptionId:n,onToggleOption:r}){return(0,R.jsxs)(`div`,{className:`mb-3`,role:`group`,"aria-label":`Agent question`,children:[(0,R.jsx)(`p`,{className:`text-foreground text-[14px] leading-6 font-medium`,children:e}),(0,R.jsx)(`ul`,{className:`mt-2 flex flex-col gap-1.5`,"aria-label":`Answer options`,children:t.map(e=>{let t=e.id===Eb,i=n===e.id;return(0,R.jsx)(`li`,{children:(0,R.jsx)(`button`,{type:`button`,className:`w-full rounded-lg border px-3 py-2 text-left text-[13px] leading-5 transition ${i?`border-foreground/40 bg-hover-fill-strong text-foreground`:t?`border-border/70 text-muted-foreground/80 hover:text-muted-foreground hover:bg-hover-fill`:`border-border text-muted-foreground hover:text-foreground hover:bg-hover-fill`}`,"aria-pressed":i,onClick:()=>r(e.id),children:e.label})},e.id)})})]})}function lx(e){let[t,n]=(0,F.useState)(Date.now);return(0,F.useEffect)(()=>{if(!e)return;n(Date.now());let t=setInterval(()=>n(Date.now()),1e3);return()=>clearInterval(t)},[e]),t}function ux(e,t){if(!(e===void 0||e<=0||t===void 0||!Number.isFinite(e)||!Number.isFinite(t)))return Math.max(0,Math.floor((t-e)/1e3))}function dx({startedAt:e}){let t=ux(e,lx(!0));return t===void 0?null:ix(t)}function fx(e,{userId:t,threadId:n}){let[r,i]=(0,F.useState)(null);(0,F.useEffect)(()=>{let r=new AbortController,a={api:e,controller:r,stopping:new Set},o;async function s(){try{let{commands:o}=await e.listRunningCommands({userId:t,threadId:n},r.signal);r.signal.aborted||i(e=>({lifetime:a,commands:o,refreshError:null,stopError:e?.lifetime===a&&o.some(t=>t.sessionId===e.stopError?.sessionId)?e.stopError:null,stopping:[...a.stopping]}))}catch{r.signal.aborted||i(e=>e?.lifetime===a?{...e,refreshError:`Unable to refresh running commands. Reconnecting…`}:null)}finally{r.signal.aborted||(o=setTimeout(s,1e3))}}return s(),()=>{r.abort(),clearTimeout(o)}},[e,t,n]);let a=r?.lifetime.api===e&&!r.lifetime.controller.signal.aborted?r:null;async function o(r){let o=a?.lifetime;if(!(!o||o.controller.signal.aborted||o.stopping.has(r))){o.stopping.add(r),i(e=>e?.lifetime===o?{...e,stopping:[...o.stopping],stopError:null}:e);try{await e.terminateCommand({userId:t,threadId:n,sessionId:r})}catch(e){o.controller.signal.aborted||i(t=>t?.lifetime===o?{...t,stopError:{sessionId:r,message:e instanceof Error?e.message:`Unable to stop command.`}}:t)}finally{o.stopping.delete(r),o.controller.signal.aborted||i(e=>e?.lifetime===o?{...e,stopping:[...o.stopping]}:e)}}}return{commands:a?.commands??[],error:a?.stopError?.message??a?.refreshError??null,stopping:a?.stopping??[],terminate:o}}function px({api:e,scope:t,collapseWhen:n=!1}){let{commands:r,stopping:i,error:a,terminate:o}=fx(e,t),[s,c]=(0,F.useState)(!1),[l,u]=(0,F.useState)(n),d=(0,F.useId)();return n!==l&&(u(n),n&&c(!1)),r.length===0?null:(0,R.jsx)(`section`,{"aria-label":`Running commands`,className:`mx-auto mb-3 w-full max-w-[48rem] shrink-0 px-4`,children:(0,R.jsxs)(`div`,{className:`border-hairline bg-surface overflow-hidden rounded-xl border`,children:[(0,R.jsxs)(`button`,{type:`button`,"aria-label":`Running commands`,"aria-expanded":s,"aria-controls":d,onClick:()=>c(e=>!e),className:`text-muted-foreground hover:bg-hover-fill focus-visible:ring-ring flex w-full items-center gap-2 px-3 py-2 text-left text-xs transition focus-visible:ring-2 focus-visible:outline-none focus-visible:ring-inset`,children:[(0,R.jsx)(Gg,{className:`size-3.5 shrink-0 transition-transform ${s?``:`-rotate-90`}`,"aria-hidden":`true`}),(0,R.jsx)(`span`,{className:`font-medium`,children:`Running commands`}),(0,R.jsx)(`span`,{className:`bg-muted rounded px-1.5 py-0.5 text-[10px] tabular-nums`,children:r.length})]}),(0,R.jsx)(`div`,{id:d,children:s&&(0,R.jsx)(`ul`,{className:`divide-hairline border-hairline max-h-40 divide-y overflow-y-auto border-t`,children:r.map(e=>(0,R.jsxs)(`li`,{className:`flex items-center gap-3 px-3 py-2`,children:[(0,R.jsx)(`span`,{className:`size-1.5 shrink-0 rounded-full bg-emerald-500`,"aria-hidden":`true`}),(0,R.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,R.jsx)(`p`,{className:`text-foreground truncate font-mono text-xs`,title:e.command,children:e.command}),(0,R.jsx)(`p`,{className:`text-muted-foreground mt-0.5 truncate text-[11px]`,title:e.workdir,children:e.workdir})]}),(0,R.jsx)(`button`,{type:`button`,"aria-label":`Stop command: ${e.command}`,title:`Stop command`,disabled:i.includes(e.sessionId),onClick:()=>void o(e.sessionId),className:`text-muted-foreground hover:bg-destructive/10 hover:text-destructive focus-visible:ring-ring flex size-8 shrink-0 items-center justify-center rounded-md transition focus-visible:ring-2 focus-visible:outline-none disabled:opacity-40`,children:(0,R.jsx)(Dv,{className:`size-3.5`,"aria-hidden":`true`})})]},e.sessionId))})}),a&&(0,R.jsx)(`p`,{role:`alert`,className:`text-destructive border-hairline border-t px-3 py-2 text-xs`,children:a})]})})}function mx(e){return(0,R.jsx)(px,{...e},`${e.scope.userId}:${e.scope.threadId}`)}function hx(e,t){let n=e??[],r=t??[];return n.length===r.length&&n.every((e,t)=>e===r[t])}var gx=new Set([`image/jpeg`,`image/png`,`image/gif`,`image/webp`]);function _x(e){return gx.has(e.toLowerCase())}function vx(e){let t=e.trim();return t.length>0?t:`application/octet-stream`}function yx(e){let t=e.name.trim();return t.length>0?t:`Attached file`}function bx(e){return e<1024?`${e} B`:e<1048576?`${Math.max(1,Math.round(e/1024))} KiB`:`${(e/1048576).toFixed(1).replace(/\.0$/,``)} MiB`}function xx(e){e?.startsWith(`blob:`)&&URL.revokeObjectURL(e)}function Sx(e){return!e.url&&_x(e.mediaType)}function Cx(e,t){let n=document.createElement(`a`);n.href=e,n.download=t,n.rel=`noopener`,document.body.append(n),n.click(),n.remove()}function wx({attachments:e,disabled:t,onRemove:n}){return(0,R.jsx)(`ul`,{className:`mb-3 flex max-h-36 flex-wrap items-center gap-2 overflow-y-auto`,"aria-label":`Attached files`,children:e.map(e=>{let r=_x(e.mediaType)&&!!e.previewUrl;return(0,R.jsxs)(`li`,{className:r?`group relative size-14 overflow-hidden rounded-xl border ${e.status===`error`?`border-rose-500/60`:`border-border`}`:`group relative flex h-14 max-w-56 items-center gap-2 overflow-hidden rounded-xl border pr-7 pl-2 ${e.status===`error`?`border-rose-500/60`:`border-border`}`,title:e.error??`${e.name} · ${bx(e.size)}`,children:[r?(0,R.jsx)(`img`,{src:e.previewUrl,alt:e.name,className:`size-full object-cover ${e.status===`uploading`?`opacity-50`:``}`}):(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(C_,{className:`text-muted-foreground size-4 shrink-0`,"aria-hidden":`true`}),(0,R.jsxs)(`span`,{className:`min-w-0 text-[12px] leading-4`,children:[(0,R.jsx)(`span`,{className:`text-foreground block truncate`,children:e.name}),(0,R.jsx)(`span`,{className:`text-muted-foreground block`,children:bx(e.size)})]})]}),e.status===`uploading`?(0,R.jsx)(`span`,{className:`absolute inset-0 flex items-center justify-center ${r?``:`bg-background/60`}`,role:`status`,"aria-label":`Uploading ${e.name}`,children:(0,R.jsx)(`span`,{className:`border-border border-t-foreground/80 size-3.5 animate-spin rounded-full border-2`})}):e.status===`error`?(0,R.jsx)(`span`,{className:`text-destructive absolute inset-x-0 bottom-0 bg-rose-950/80 px-1 py-0.5 text-center text-[9px] leading-3`,role:`alert`,children:`Failed`}):null,(0,R.jsx)(`button`,{type:`button`,className:`bg-foreground/70 text-background hover:bg-foreground/90 absolute top-1 right-1 flex size-4.5 cursor-pointer items-center justify-center rounded-full transition disabled:cursor-not-allowed disabled:opacity-40`,"aria-label":`Remove ${e.name}`,disabled:t,onClick:()=>n(e.localId),children:(0,R.jsx)(Fv,{className:`size-3`,"aria-hidden":`true`})})]},e.localId)})})}function Tx({loadState:e,skills:t,highlightedIndex:n,onRetry:r,onHighlight:i,onSelect:a}){let o=(0,F.useRef)([]);return(0,F.useEffect)(()=>{t.length>0&&o.current[n]?.scrollIntoView({block:`nearest`})},[t,n]),(0,R.jsx)(`div`,{className:`border-border bg-popover absolute inset-x-0 bottom-full z-30 mb-2 max-h-56 overflow-y-auto rounded-xl border py-1 shadow-2xl`,id:`composer-skills-listbox`,"aria-label":`Available skills`,role:e===`ready`&&t.length>0?`listbox`:`status`,children:e===`loading`?(0,R.jsx)(`p`,{className:`text-muted-foreground px-3 py-2 text-sm`,children:`Loading skills…`}):e===`error`?(0,R.jsxs)(`div`,{className:`flex items-center justify-between gap-3 px-3 py-2`,children:[(0,R.jsx)(`p`,{className:`text-muted-foreground text-sm`,children:`Couldn’t load skills`}),(0,R.jsx)(`button`,{type:`button`,className:`text-muted-foreground hover:text-foreground text-sm underline-offset-2 hover:underline`,onClick:r,children:`Retry`})]}):t.length===0?(0,R.jsx)(`p`,{className:`text-muted-foreground px-3 py-2 text-sm`,children:`No matching skills`}):t.map((e,t)=>(0,R.jsxs)(`button`,{ref:e=>{o.current[t]=e},type:`button`,id:`composer-skill-option-${t}`,className:`flex w-full flex-col gap-0.5 px-3 py-2 text-left transition ${n===t?`text-foreground bg-hover-fill-strong`:`text-muted-foreground hover:text-foreground hover:bg-hover-fill`}`,role:`option`,"aria-selected":n===t,onPointerEnter:()=>i(t),onClick:()=>a(e),children:[(0,R.jsxs)(`span`,{className:`text-sm font-medium`,children:[`$`,e.name]}),(0,R.jsx)(`span`,{className:`text-muted-foreground line-clamp-2 text-[12px]`,children:e.description})]},e.name))})}function Ex({loadState:e,entries:t,scanning:n,highlightedIndex:r,onRetry:i,onHighlight:a,onSelect:o}){let s=(0,F.useRef)([]);return(0,F.useEffect)(()=>{s.current[r]?.scrollIntoView({block:`nearest`})},[t,r]),(0,R.jsx)(`div`,{className:`border-border bg-popover absolute inset-x-0 bottom-full z-30 mb-2 max-h-56 overflow-y-auto rounded-xl border py-1 shadow-2xl`,id:`composer-paths-listbox`,"aria-label":`Workspace files and directories`,role:`listbox`,"aria-busy":e===`loading`||n,children:e===`unavailable`?(0,R.jsx)(`p`,{className:`text-muted-foreground px-3 py-2 text-sm`,role:`status`,children:`Select a workspace and connect its server to tag files.`}):e===`error`?(0,R.jsxs)(`div`,{className:`flex items-center justify-between gap-3 px-3 py-2`,children:[(0,R.jsx)(`p`,{className:`text-muted-foreground text-sm`,role:`status`,children:`Couldn't search workspace files`}),(0,R.jsx)(`button`,{type:`button`,className:`text-sm hover:underline`,onClick:i,children:`Retry`})]}):e===`loading`||n&&t.length===0?(0,R.jsx)(`p`,{className:`text-muted-foreground px-3 py-2 text-sm`,role:`status`,children:`Searching workspace files...`}):t.length===0?(0,R.jsx)(`p`,{className:`text-muted-foreground px-3 py-2 text-sm`,role:`status`,children:`No matching files or directories`}):t.map((e,t)=>{let n=e.kind===`directory`?k_:T_;return(0,R.jsxs)(`button`,{ref:e=>{s.current[t]=e},type:`button`,id:`composer-path-option-${t}`,className:`flex w-full items-center gap-2 px-3 py-2 text-left text-sm transition ${r===t?`text-foreground bg-hover-fill-strong`:`text-muted-foreground hover:text-foreground hover:bg-hover-fill`}`,role:`option`,"aria-selected":r===t,onPointerEnter:()=>a(t),onMouseDown:e=>e.preventDefault(),onClick:()=>o(e),children:[(0,R.jsx)(n,{className:`size-4 shrink-0`,"aria-hidden":`true`}),(0,R.jsx)(`span`,{className:`break-all`,children:Lb(e)})]},`${e.kind}:${e.path}`)})})}function Dx({title:e,children:t,tone:n=`warning`,action:r}){return(0,R.jsxs)(`div`,{className:`flex items-start gap-2.5 rounded-xl border px-3.5 py-3 ${n===`error`?`border-rose-500/25 bg-rose-500/10 text-rose-800 dark:text-rose-200`:`border-amber-500/25 bg-amber-500/10 text-amber-800 dark:text-amber-200`}`,role:n===`status`?`status`:`alert`,children:[(0,R.jsx)(Yg,{className:`mt-0.5 size-4 shrink-0`,"aria-hidden":`true`}),(0,R.jsxs)(`div`,{className:`min-w-0 flex-1 [overflow-wrap:anywhere]`,children:[(0,R.jsx)(`p`,{className:`text-[13px] leading-5 font-medium`,children:e}),(0,R.jsx)(`div`,{className:`text-[12.5px] leading-5 opacity-90`,children:t}),r?(0,R.jsx)(`div`,{className:`mt-2`,children:r}):null]})]})}function Ox(e,t){let[n,r]=(0,F.useState)(null),[i,a]=(0,F.useState)(0);(0,F.useEffect)(()=>{if(!e||t===null)return;let n=new AbortController,i;async function a(){if(e&&t!==null)try{let o=await e.search(t,n.signal);if(n.signal.aborted)return;r({source:e,query:t,result:o,error:!1}),o.scanning&&(i=setTimeout(a,250))}catch{n.signal.aborted||r({source:e,query:t,result:null,error:!0})}}return i=setTimeout(a,100),()=>{n.abort(),clearTimeout(i)}},[e,t,i]);let o=n?.source===e&&n.query===t?n:null;return{loadState:e?o?.error?`error`:o?.result?`ready`:`loading`:`unavailable`,entries:o?.result?.entries??[],scanning:o?.result?.scanning??!1,retry:()=>{r(null),a(e=>e+1)}}}function kx(e){function t(t){let n=t.target;n instanceof Node&&(e.getRoot()?.contains(n)||e.onOutside())}function n(t){t.key===`Escape`&&e.onEscape()}return document.addEventListener(`pointerdown`,t),document.addEventListener(`keydown`,n),()=>{document.removeEventListener(`pointerdown`,t),document.removeEventListener(`keydown`,n)}}function Ax({title:e,onDismiss:t,children:n,footer:r,returnFocusRef:i}){let a=(0,F.useRef)(null);return(0,F.useEffect)(()=>{let e=a.current,t=i.current;return e?.showModal(),()=>{e?.close(),t?.focus()}},[i]),(0,R.jsx)(`dialog`,{ref:a,"aria-label":e,className:`bg-popover text-foreground fixed inset-x-0 top-auto bottom-0 m-0 max-h-[85dvh] w-full max-w-none overflow-hidden rounded-t-[28px] border border-[var(--hairline)] p-0 shadow-2xl backdrop:bg-black/45 backdrop:backdrop-blur-sm`,onCancel:e=>{e.preventDefault(),t()},onClick:e=>{if(e.target!==e.currentTarget)return;let n=e.currentTarget.getBoundingClientRect();(e.clientY<n.top||e.clientY>n.bottom)&&t()},children:(0,R.jsxs)(`div`,{className:`flex max-h-[85dvh] flex-col pb-[max(1rem,env(safe-area-inset-bottom))]`,children:[(0,R.jsx)(`div`,{className:`bg-muted-foreground/25 mx-auto mt-3 h-1 w-9 shrink-0 rounded-full`,"aria-hidden":`true`}),(0,R.jsxs)(`header`,{className:`flex shrink-0 items-center justify-between px-5 py-2`,children:[(0,R.jsx)(`h2`,{className:`text-lg font-semibold`,children:e}),(0,R.jsx)(`button`,{type:`button`,className:`text-muted-foreground hover:bg-hover-fill focus-visible:ring-ring flex size-11 items-center justify-center rounded-full outline-none focus-visible:ring-2`,"aria-label":`Close ${e.toLocaleLowerCase()}`,onClick:t,children:(0,R.jsx)(Fv,{className:`size-5`})})]}),(0,R.jsx)(`div`,{className:`min-h-0 overflow-y-auto overscroll-contain px-4`,children:n}),r?(0,R.jsx)(`footer`,{className:`shrink-0 border-t border-[var(--hairline)] px-5 pt-4`,children:r}):null]})})}function jx(){let[e,t]=(0,F.useState)(()=>window.matchMedia?.(`(max-width: 639px)`).matches??!1);return(0,F.useEffect)(()=>{let e=window.matchMedia?.(`(max-width: 639px)`);if(!e)return;function n(){t(e.matches)}return n(),e.addEventListener?.(`change`,n),()=>e.removeEventListener?.(`change`,n)},[]),e}function Mx({value:e,options:t,ariaLabel:n,menuTitle:r,disabled:i=!1,className:a=``,triggerClassName:o=``,searchable:s=!1,compactOnMobile:c=!1,onValueChange:l,optionIcon:u}){let[d,f]=(0,F.useState)(!1),p=jx(),m=c&&p,[h,g]=(0,F.useState)(``),_=(0,F.useRef)(null),v=(0,F.useRef)(null),y=(0,F.useRef)(null),b=(0,F.useRef)(null),[x,S]=(0,F.useState)({left:0,bottom:0,maxHeight:0}),C=t.find(t=>t.id===e)??t[0]??null,w=s&&h.trim()?t.filter(e=>e.label.toLocaleLowerCase().includes(h.trim().toLocaleLowerCase())):t;function T(){if(i)return;let e=!d;f(e),e&&s?queueMicrotask(()=>y.current?.focus()):g(``)}function E(n){t.find(e=>e.id===n)&&(n!==e&&l?.(n),f(!1),g(``),v.current?.focus())}function D(e){e.key!==`Enter`||e.nativeEvent.isComposing||w.length!==0&&(e.preventDefault(),E(w[0].id))}return(0,F.useLayoutEffect)(()=>{if(!d||!c||m)return;function e(){let e=v.current?.getBoundingClientRect(),t=b.current?.getBoundingClientRect();e&&t&&S({left:Math.max(8,Math.min(e.left,window.innerWidth-t.width-8)),bottom:window.innerHeight-e.top+12,maxHeight:Math.max(0,e.top-20)})}return e(),window.addEventListener(`resize`,e),window.addEventListener(`scroll`,e,!0),()=>{window.removeEventListener(`resize`,e),window.removeEventListener(`scroll`,e,!0)}},[d,c,m]),(0,F.useEffect)(()=>{if(!d){g(``);return}if(!m)return kx({getRoot:()=>_.current,onOutside:()=>{f(!1)},onEscape:()=>{f(!1),v.current?.focus()}})},[d,m]),(0,F.useEffect)(()=>{i&&f(!1)},[i]),(0,R.jsxs)(`div`,{ref:_,className:pb(`relative`,a),children:[(0,R.jsxs)(`button`,{ref:v,type:`button`,className:pb(`focus-visible:ring-ring/60 text-muted-foreground hover:bg-hover-fill inline-flex h-8 shrink-0 items-center gap-2 rounded-lg border border-transparent bg-transparent px-2 text-sm font-medium transition outline-none focus-visible:ring-2 disabled:pointer-events-none disabled:opacity-50`,!u&&`gap-1`,o),"aria-haspopup":`dialog`,"aria-expanded":d,"aria-label":n,title:c?C?.label??e:void 0,disabled:i,onClick:T,children:[u&&C?u(C):null,(0,R.jsx)(`span`,{className:pb(`truncate`,c&&`hidden sm:inline`),children:C?.triggerLabel??C?.label??e}),(0,R.jsx)(Gg,{className:pb(`text-muted-foreground size-3 shrink-0 transition-transform`,d&&`rotate-180`)})]}),d&&m?(0,R.jsx)(Ax,{title:r,onDismiss:()=>f(!1),returnFocusRef:v,children:(0,R.jsx)(`div`,{className:`space-y-1 pb-2`,children:t.map(t=>(0,R.jsxs)(`button`,{type:`button`,"aria-label":t.label,"aria-pressed":t.id===e,className:pb(`focus-visible:ring-ring flex min-h-16 w-full items-center gap-3 rounded-2xl px-4 py-3 text-left outline-none focus-visible:ring-2`,t.id===e?`bg-hover-fill`:`hover:bg-hover-fill`),onClick:()=>E(t.id),children:[u?(0,R.jsx)(`span`,{className:`flex size-6 shrink-0 items-center justify-center`,children:u(t)}):null,(0,R.jsx)(`span`,{className:`min-w-0 flex-1 text-[15px] font-medium`,children:t.label}),t.id===e?(0,R.jsx)(Ug,{className:`text-accent-strong size-5 shrink-0`}):null]},t.id))})}):d?(0,R.jsxs)(`div`,{ref:b,className:pb(`bg-popover/96 z-50 rounded-[18px] border border-[var(--hairline)] p-2 shadow-[var(--composer-shadow)] backdrop-blur-xl`,c?`fixed w-[min(19rem,calc(100vw-1rem))] overflow-y-auto`:`absolute bottom-[calc(100%+0.75rem)] left-0 min-w-[19rem]`),style:c?x:void 0,role:`dialog`,"aria-label":r,children:[s?(0,R.jsxs)(`label`,{className:`text-muted-foreground flex h-10 items-center gap-2 border-b border-[var(--hairline)] px-2`,children:[(0,R.jsx)(lv,{className:`size-4 shrink-0`}),(0,R.jsxs)(`span`,{className:`sr-only`,children:[`Search `,r.toLocaleLowerCase()]}),(0,R.jsx)(`input`,{ref:y,value:h,onChange:e=>g(e.target.value),className:`text-foreground placeholder:text-muted-foreground min-w-0 flex-1 bg-transparent text-sm outline-none`,placeholder:`Search ${r.toLocaleLowerCase()}…`,onKeyDown:D})]}):(0,R.jsx)(`p`,{className:`text-muted-foreground px-3 pt-1 pb-2 text-[11px] font-medium`,children:r}),(0,R.jsxs)(`div`,{className:pb(`space-y-0.5`,s&&`pt-1.5`),children:[w.map(t=>(0,R.jsxs)(`button`,{type:`button`,className:pb(`focus-visible:ring-ring/60 hover:bg-hover-fill flex w-full items-center gap-3 rounded-xl px-3 py-2.5 text-left outline-none focus-visible:ring-2`,t.id===e&&`bg-hover-fill`),"aria-pressed":t.id===e,onClick:()=>{E(t.id)},children:[u?(0,R.jsx)(`span`,{className:pb(`flex size-7 shrink-0 items-center justify-center`,`text-muted-foreground`),children:u(t)}):null,(0,R.jsx)(`span`,{className:`text-foreground min-w-0 flex-1 truncate text-sm font-medium`,children:t.label}),(0,R.jsx)(Ug,{className:pb(`text-accent-strong size-4 shrink-0 transition-opacity`,t.id===e?`opacity-100`:`opacity-0`)})]},t.id)),w.length===0?(0,R.jsx)(`p`,{className:`text-muted-foreground px-3 py-5 text-center text-sm`,children:`No matches found`}):null]})]}):null]})}function Nx({className:e=``,title:t=`OpenAI`}){return(0,R.jsxs)(`svg`,{viewBox:`146.694 227.042 267.198 264.812`,xmlns:`http://www.w3.org/2000/svg`,className:pb(`size-4`,e),role:`img`,"aria-hidden":!t||void 0,fill:`none`,children:[t?(0,R.jsx)(`title`,{children:t}):null,(0,R.jsx)(`path`,{d:`M249.176 323.434V298.276C249.176 296.158 249.971 294.569 251.825 293.509L302.406 264.381C309.29 260.409 317.5 258.555 325.973 258.555C357.75 258.555 377.877 283.185 377.877 309.399C377.877 311.253 377.877 313.371 377.611 315.49L325.178 284.771C322.001 282.919 318.822 282.919 315.645 284.771L249.176 323.434ZM367.283 421.415V361.301C367.283 357.592 365.694 354.945 362.516 353.092L296.048 314.43L317.763 301.982C319.617 300.925 321.206 300.925 323.058 301.982L373.639 331.112C388.205 339.586 398.003 357.592 398.003 375.069C398.003 395.195 386.087 413.733 367.283 421.412V421.415ZM233.553 368.452L211.838 355.742C209.986 354.684 209.19 353.095 209.19 350.975V292.718C209.19 264.383 230.905 242.932 260.301 242.932C271.423 242.932 281.748 246.641 290.49 253.26L238.321 283.449C235.146 285.303 233.555 287.951 233.555 291.659V368.455L233.553 368.452ZM280.292 395.462L249.176 377.985V340.913L280.292 323.436L311.407 340.913V377.985L280.292 395.462ZM300.286 475.968C289.163 475.968 278.837 472.259 270.097 465.64L322.264 435.449C325.441 433.597 327.03 430.949 327.03 427.239V350.445L349.011 363.155C350.865 364.213 351.66 365.802 351.66 367.922V426.179C351.66 454.514 329.679 475.965 300.286 475.965V475.968ZM237.525 416.915L186.944 387.785C172.378 379.31 162.582 361.305 162.582 343.827C162.582 323.436 174.763 305.164 193.563 297.485V357.861C193.563 361.571 195.154 364.217 198.33 366.071L264.535 404.467L242.82 416.915C240.967 417.972 239.377 417.972 237.525 416.915ZM234.614 460.343C204.689 460.343 182.71 437.833 182.71 410.028C182.71 407.91 182.976 405.792 183.238 403.672L235.405 433.863C238.582 435.715 241.763 435.715 244.938 433.863L311.407 395.466V420.622C311.407 422.742 310.612 424.331 308.758 425.389L258.179 454.519C251.293 458.491 243.083 460.343 234.611 460.343H234.614ZM300.286 491.854C332.329 491.854 359.073 469.082 365.167 438.892C394.825 431.211 413.892 403.406 413.892 375.073C413.892 356.535 405.948 338.529 391.648 325.552C392.972 319.991 393.766 314.43 393.766 308.87C393.766 271.003 363.048 242.666 327.562 242.666C320.413 242.666 313.528 243.723 306.644 246.109C294.725 234.457 278.307 227.042 260.301 227.042C228.258 227.042 201.513 249.815 195.42 280.004C165.761 287.685 146.694 315.49 146.694 343.824C146.694 362.362 154.638 380.368 168.938 393.344C167.613 398.906 166.819 404.467 166.819 410.027C166.819 447.894 197.538 476.231 233.024 476.231C240.172 476.231 247.058 475.173 253.943 472.788C265.859 484.441 282.278 491.854 300.286 491.854Z`,fill:`currentColor`})]})}function Px({provider:e,className:t=``}){return e===`spikonado`?(0,R.jsx)(`img`,{src:`/logo.png`,alt:``,className:pb(`size-4 shrink-0`,t)}):e===`openai`||e===`chatgpt`?(0,R.jsx)(Nx,{className:pb(`text-foreground size-4`,t)}):e===`anthropic`?(0,R.jsx)(`svg`,{viewBox:`0 0 24 24`,className:pb(`size-4 text-[#D97757]`,t),role:`img`,"aria-label":`Anthropic`,fill:`currentColor`,children:(0,R.jsx)(`path`,{d:`M17.304 3.541h-3.672l6.696 16.918H24Zm-10.608 0L0 20.459h3.744l1.37-3.553h7.005l1.369 3.553h3.744L10.536 3.541Zm-.371 10.223 2.291-5.945 2.292 5.945Z`})}):e===`xai`?(0,R.jsx)(`svg`,{viewBox:`0 0 24 24`,className:pb(`text-foreground size-4`,t),role:`img`,"aria-label":`xAI`,fill:`currentColor`,children:(0,R.jsx)(`path`,{d:`M6.469 8.776 16.512 23h-4.464L2.005 8.776H6.47Zm-.004 7.9 2.233 3.164L6.467 23H2l4.465-6.324ZM22 2.582V23h-3.659V7.764L22 2.582ZM22 1l-9.952 14.095-2.233-3.163L17.533 1H22Z`})}):e===`zai`?(0,R.jsx)(`svg`,{viewBox:`0 0 24 24`,className:pb(`text-foreground size-4`,t),role:`img`,"aria-label":`Z.AI`,fill:`currentColor`,children:(0,R.jsx)(`path`,{d:`M12.606 1.806l-1.677 2.388c-0.258 0.374-0.697 0.606-1.161 0.606h-9.162V1.794C0.594 1.806 12.606 1.806 12.606 1.806zM24 1.806L9.6 22.206 0 22.206 14.4 1.806zM11.394 22.206l1.69-2.4c0.258-0.374 0.697-0.606 1.161-0.606h9.149v3.006H11.394z`})}):e===`deepseek`?(0,R.jsx)(`svg`,{viewBox:`0 0 24 24`,className:pb(`size-4 text-[#4D6BFE]`,t),role:`img`,"aria-label":`DeepSeek`,fill:`currentColor`,children:(0,R.jsx)(`path`,{d:`M23.748 4.651c-.254-.124-.364.113-.512.233-.051.04-.094.09-.137.137-.372.397-.806.657-1.373.626-.829-.046-1.537.214-2.163.848-.133-.782-.575-1.248-1.247-1.548-.352-.155-.708-.311-.955-.65-.172-.24-.219-.509-.305-.774-.055-.16-.11-.323-.293-.35-.2-.031-.278.136-.356.276-.313.572-.434 1.202-.422 1.84.027 1.436.633 2.58 1.838 3.393.137.094.172.187.129.323-.082.28-.18.553-.266.833-.055.179-.137.218-.328.14a5.5 5.5 0 0 1-1.737-1.179c-.857-.828-1.631-1.743-2.597-2.46a12 12 0 0 0-.689-.47c-.985-.957.13-1.743.387-1.836.27-.098.094-.433-.778-.428-.872.003-1.67.295-2.687.685a3 3 0 0 1-.465.136 9.6 9.6 0 0 0-2.883-.101c-1.885.21-3.39 1.1-4.497 2.622C.082 8.776-.231 10.854.152 13.02c.403 2.284 1.568 4.175 3.36 5.653 1.857 1.533 3.997 2.284 6.438 2.14 1.482-.085 3.132-.284 4.994-1.86.47.234.962.328 1.78.398.629.058 1.235-.031 1.705-.129.735-.155.684-.836.418-.961-2.155-1.004-1.682-.595-2.112-.926 1.095-1.295 2.768-3.598 3.284-6.733.05-.346.115-.834.108-1.114-.004-.171.035-.238.23-.257a4.2 4.2 0 0 0 1.545-.475c1.397-.763 1.96-2.016 2.093-3.517.02-.23-.004-.467-.247-.588M11.58 18.168c-2.088-1.642-3.101-2.183-3.52-2.16-.39.024-.32.472-.234.763.09.288.207.487.371.74.114.167.192.416-.113.603-.673.416-1.842-.14-1.897-.168-1.361-.801-2.5-1.86-3.301-3.306-.775-1.393-1.225-2.888-1.299-4.482-.02-.385.094-.522.477-.592a4.7 4.7 0 0 1 1.53-.038c2.131.311 3.946 1.264 5.467 2.774.868.86 1.525 1.887 2.202 2.89.72 1.066 1.494 2.082 2.48 2.915.348.291.626.513.892.677-.802.09-2.14.109-3.055-.615zm1.001-6.44a.306.306 0 0 1 .415-.287.3.3 0 0 1 .113.074.3.3 0 0 1 .086.214c0 .17-.136.307-.308.307a.303.303 0 0 1-.306-.307m3.11 1.596c-.2.081-.4.151-.591.16a1.25 1.25 0 0 1-.798-.254c-.274-.23-.47-.358-.551-.758a1.7 1.7 0 0 1 .015-.588c.07-.327-.007-.537-.238-.727-.188-.156-.426-.199-.689-.199a.6.6 0 0 1-.254-.078.253.253 0 0 1-.114-.358 1 1 0 0 1 .192-.21c.356-.202.767-.136 1.146.016.352.144.618.408 1.001.782.392.451.462.576.685.915.176.264.336.536.446.848.066.194-.02.353-.25.45`})}):e===`kimi`||e===`moonshotai`?(0,R.jsx)(`svg`,{viewBox:`0 0 465 465`,className:pb(`text-foreground size-4`,t),role:`img`,"aria-label":`Moonshot AI`,fill:`currentColor`,children:(0,R.jsx)(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M418.766 93.78C388.626 53.17 345.086 22.07 292.446 7.97C239.806 -6.13 186.536 -0.97 140.136 19.13L418.766 93.78ZM40.7758 100.85C61.3758 70.84 88.5858 46.43 119.776 29.15L325.036 84.15C311.566 91.92 297.136 105.31 285.966 120.03L454.736 165.25C459.526 181.08 462.646 197.49 463.956 214.24L40.7758 100.85ZM456.686 292.45C454.306 301.35 451.436 309.99 448.116 318.34L2.44584 198.93C3.74584 190.03 5.58584 181.12 7.96584 172.22C13.5658 151.31 21.8458 131.84 32.3458 114.08L250.436 172.52C241.706 185 233.756 198.56 226.756 213.07L460.516 275.71C459.446 281.3 458.166 286.88 456.676 292.47L456.686 292.45ZM13.4858 310.23C2.67584 279.96 -1.93416 247.22 0.745843 213.95L206.426 269.06C204.946 273.74 203.556 278.48 202.266 283.29C199.646 293.08 197.506 302.85 195.846 312.55L417.946 372.06C407.606 385.79 395.826 398.23 382.896 409.21L13.4858 310.23ZM172.206 456.69C102.096 437.9 48.1158 388.98 20.4758 327.59L187.846 372.44C187.576 388.05 188.546 403.26 190.676 417.85L312.286 450.43C268.876 466.39 220.286 469.57 172.206 456.69Z`})}):(0,R.jsxs)(`svg`,{viewBox:`0 0 24 24`,className:pb(`text-muted-foreground size-4`,t),role:`img`,"aria-label":e||`Unknown provider`,fill:`none`,stroke:`currentColor`,strokeWidth:1.5,children:[(0,R.jsx)(`circle`,{cx:`12`,cy:`12`,r:`9`}),(0,R.jsx)(`path`,{d:`M12 8v4l2.5 1.5`,strokeLinecap:`round`,strokeLinejoin:`round`})]})}function Fx({model:e,reasoningEffort:t,onSelect:n}){return e.reasoningEfforts.map(r=>(0,R.jsxs)(`button`,{type:`button`,className:`focus-visible:ring-ring/60 text-foreground hover:bg-hover-fill flex w-full items-center gap-2 rounded-xl px-3 py-2.5 text-left text-sm outline-none focus-visible:ring-2`,"aria-label":`${$b(r)}${r===e.defaultReasoningEffort?` (default)`:``}`,"aria-pressed":r===t,"data-default-reasoning":r===e.defaultReasoningEffort?``:void 0,title:r===e.defaultReasoningEffort?`Default reasoning`:void 0,onClick:()=>n(r),onKeyDown:e=>{if(e.key===`ArrowDown`||e.key===`ArrowUp`){e.preventDefault();let t=Array.from(e.currentTarget.parentElement?.querySelectorAll(`button`)??[]);t[(t.indexOf(e.currentTarget)+(e.key===`ArrowDown`?1:-1)+t.length)%t.length]?.focus()}},children:[(0,R.jsx)(`span`,{className:`min-w-0 flex-1`,children:$b(r)}),r===e.defaultReasoningEffort?(0,R.jsx)(`span`,{className:`text-muted-foreground shrink-0 text-xs`,children:`Default`}):null,r===t?(0,R.jsx)(Ug,{className:`text-accent-strong size-3 shrink-0`}):null]},r))}function Ix({models:e,modelId:t,reasoningEffort:n,fastMode:r,allowsFastMode:i,onApply:a,onDismiss:o,returnFocusRef:s}){let[c,l]=(0,F.useState)(t),[u,d]=(0,F.useState)(n),[f,p]=(0,F.useState)(r),m=e.find(e=>e.id===c)??e[0],h=i&&m?.supportsFastMode;return(0,R.jsxs)(Ax,{title:`Model settings`,onDismiss:o,returnFocusRef:s,footer:(0,R.jsx)(`button`,{type:`button`,className:`bg-primary text-primary-foreground focus-visible:ring-ring h-12 w-full rounded-2xl text-base font-semibold outline-none focus-visible:ring-2 disabled:opacity-40`,disabled:!m,onClick:()=>{m&&a(m,u,!!(h&&f))},children:`Done`}),children:[(0,R.jsx)(`div`,{role:`group`,"aria-label":`Models`,className:`space-y-1 pb-4`,children:e.map(e=>(0,R.jsxs)(`button`,{type:`button`,"aria-pressed":e.id===m?.id,className:pb(`focus-visible:ring-ring flex min-h-14 w-full items-center gap-3 rounded-2xl px-4 py-3 text-left outline-none focus-visible:ring-2`,e.id===m?.id?`bg-hover-fill`:`hover:bg-hover-fill`),onClick:()=>{e.id!==m?.id&&(l(e.id),d(e.defaultReasoningEffort),e.supportsFastMode||p(!1))},children:[(0,R.jsx)(Px,{provider:e.provider,className:`size-5 shrink-0`}),(0,R.jsx)(`span`,{className:`min-w-0 flex-1 text-[15px] leading-5 font-medium`,children:e.label}),e.id===m?.id?(0,R.jsx)(Ug,{className:`text-accent-strong size-5 shrink-0`}):null]},e.id))}),m&&Xb(m)?(0,R.jsxs)(`div`,{role:`group`,"aria-label":`Reasoning for ${m.label}`,className:`border-t border-[var(--hairline)] px-1 py-4`,children:[(0,R.jsxs)(`div`,{className:`mb-3 flex items-center justify-between gap-3`,children:[(0,R.jsx)(`h3`,{className:`text-sm font-semibold`,children:`Reasoning`}),(0,R.jsxs)(`span`,{className:`text-muted-foreground text-xs`,children:[`Default: `,$b(m.defaultReasoningEffort)]})]}),(0,R.jsx)(`div`,{className:`grid grid-cols-3 gap-2`,children:m.reasoningEfforts.map(e=>(0,R.jsx)(`button`,{type:`button`,"aria-label":$b(e),"aria-pressed":e===u,className:pb(`focus-visible:ring-ring flex min-h-11 items-center justify-center rounded-xl border px-2 py-2 text-sm outline-none focus-visible:ring-2`,e===u?`border-accent-strong bg-accent/15`:`hover:bg-hover-fill border-[var(--hairline)]`),onClick:()=>d(e),children:(0,R.jsx)(`span`,{children:$b(e)})},e))})]}):null,h?(0,R.jsxs)(`button`,{type:`button`,role:`switch`,"aria-checked":f,"aria-label":`Fast mode`,className:`focus-visible:ring-ring flex min-h-14 w-full items-center gap-3 border-t border-[var(--hairline)] px-1 py-4 text-left outline-none focus-visible:ring-2`,onClick:()=>p(!f),children:[(0,R.jsx)(Lv,{className:`size-5 shrink-0 text-amber-500`}),(0,R.jsx)(`span`,{className:`flex-1 text-sm font-semibold`,children:`Fast mode`}),(0,R.jsx)(`span`,{className:pb(`inline-flex h-6 w-11 shrink-0 items-center rounded-full p-0.5`,f?`bg-accent-strong`:`bg-hover-fill-strong`),"aria-hidden":`true`,children:(0,R.jsx)(`span`,{className:pb(`bg-background size-5 rounded-full transition-transform`,f&&`translate-x-5`)})})]}):null]})}function Lx({models:e,modelId:t,reasoningEffort:n,fastMode:r,allowsFastMode:i,disabled:a,onSelect:o,onFastModeChange:s}){let[c,l]=(0,F.useState)(!1),u=jx(),[d,f]=(0,F.useState)(null),[p,m]=(0,F.useState)({left:0,bottom:0,maxHeight:0}),[h,g]=(0,F.useState)(0),_=(0,F.useRef)(null),v=(0,F.useRef)(null),y=(0,F.useRef)(null),b=(0,F.useRef)(new Map),x=(0,F.useRef)(null),S=(0,F.useRef)(!1),C=e.find(e=>e.id===t),w=i&&C?.supportsFastMode,T=e.find(e=>e.id===d),E=[C&&Xb(C)?$b(n):null,w&&r?`Fast`:null].filter(Boolean).join(` · `);function D(){l(!1),f(null)}function ee(e,t=e.defaultReasoningEffort){o(e.id,t),D(),v.current?.focus()}function O(t){let n=e[(t+e.length)%e.length];n&&b.current.get(n.id)?.focus()}return(0,F.useLayoutEffect)(()=>{if(!c||u)return;function e(){let e=v.current?.getBoundingClientRect(),t=y.current?.getBoundingClientRect();if(!e||!t)return;m({left:Math.max(8,Math.min(e.left,window.innerWidth-t.width-8)),bottom:window.innerHeight-e.top+12,maxHeight:Math.max(0,e.top-20)});let n=d?b.current.get(d)?.getBoundingClientRect():null,r=x.current,i=r?.querySelector(`[data-default-reasoning]`);if(!n||!r||!i)return;let a=e.top-12-t.height,o=n.top-t.top+n.height/2-i.offsetTop-i.offsetHeight/2;g(Math.max(8-a,Math.min(o,window.innerHeight-a-r.offsetHeight-8)))}return e(),window.addEventListener(`resize`,e),window.addEventListener(`scroll`,e,!0),()=>{window.removeEventListener(`resize`,e),window.removeEventListener(`scroll`,e,!0)}},[c,u,d,w,p.maxHeight]),(0,F.useEffect)(()=>{if(c&&!u)return(b.current.get(t)??b.current.values().next().value)?.focus(),kx({getRoot:()=>_.current,onOutside:D,onEscape:()=>{D(),v.current?.focus()}})},[c,u,t]),(0,F.useEffect)(()=>{a&&D()},[a]),(0,R.jsxs)(`div`,{ref:_,className:pb(`relative min-w-0 flex-1 sm:flex-none`,c?`z-30`:`z-20`),children:[(0,R.jsxs)(`button`,{ref:v,type:`button`,className:`text-foreground focus-visible:ring-ring/60 inline-flex h-11 max-w-full items-center gap-2 rounded-lg px-2 text-[15px] outline-none focus-visible:ring-2 disabled:pointer-events-none disabled:opacity-50 sm:h-9`,"aria-label":`Select model`,title:[C?.label??t,E].filter(Boolean).join(` · `),"aria-haspopup":`dialog`,"aria-expanded":c,disabled:a,onClick:()=>c?D():l(!0),children:[C?(0,R.jsx)(Px,{provider:C.provider,className:`size-4 shrink-0`}):null,(0,R.jsxs)(`span`,{className:`truncate`,children:[C?.label??t,E?(0,R.jsxs)(`span`,{className:`hidden sm:inline`,children:[` · `,E]}):null]}),(0,R.jsx)(Gg,{className:pb(`text-muted-foreground size-3 shrink-0`,c&&`rotate-180`)})]}),c&&u?(0,R.jsx)(Ix,{models:e,modelId:t,reasoningEffort:n,fastMode:r,allowsFastMode:i,onDismiss:D,returnFocusRef:v,onApply:(e,t,n)=>{ee(e,t),s?.(n)}}):c?(0,R.jsxs)(`div`,{ref:y,role:`dialog`,"aria-label":`Model`,className:`fixed z-50 flex w-[min(19rem,calc(100vw-1rem))] flex-col gap-1 overflow-y-auto sm:block sm:w-[30.75rem] sm:overflow-visible`,style:p,children:[(0,R.jsxs)(`div`,{className:`bg-popover/96 flex min-h-0 shrink-0 flex-col overflow-hidden rounded-[18px] border border-[var(--hairline)] p-2 shadow-[var(--composer-shadow)] backdrop-blur-xl sm:w-[19rem]`,style:{maxHeight:p.maxHeight},children:[(0,R.jsx)(`div`,{role:`group`,"aria-label":`Models`,className:`min-h-0 space-y-0.5 overflow-y-auto`,children:e.map((e,n)=>(0,R.jsxs)(`button`,{ref:t=>{t?b.current.set(e.id,t):b.current.delete(e.id)},type:`button`,"aria-label":e.label,"aria-pressed":e.id===t,"aria-haspopup":Xb(e)?`true`:void 0,className:pb(`text-foreground focus-visible:ring-ring/60 hover:bg-hover-fill flex w-full items-center gap-3 rounded-xl px-3 py-2.5 text-left text-sm outline-none focus-visible:ring-2`,e.id===d&&`bg-hover-fill`),onMouseEnter:()=>f(e.id),onFocus:()=>f(e.id),onPointerDown:t=>{S.current=t.pointerType===`touch`&&Xb(e)&&d!==e.id},onClick:()=>{if(S.current){S.current=!1,f(e.id);return}ee(e)},onKeyDown:t=>{t.key===`ArrowDown`||t.key===`ArrowUp`?(t.preventDefault(),O(n+(t.key===`ArrowDown`?1:-1))):t.key===`ArrowRight`&&Xb(e)&&(t.preventDefault(),x.current?.querySelector(`[data-default-reasoning]`)?.focus())},children:[(0,R.jsx)(Px,{provider:e.provider,className:`size-4 shrink-0`}),(0,R.jsx)(`span`,{className:`min-w-0 flex-1 truncate font-medium`,children:e.label}),e.id===t?(0,R.jsx)(Ug,{className:`text-accent-strong size-3.5 shrink-0`}):null,Xb(e)?(0,R.jsx)(qg,{className:`text-muted-foreground size-3 shrink-0`}):null]},e.id))}),w?(0,R.jsx)(`div`,{role:`group`,"aria-label":`Speed`,className:`shrink-0 border-t border-[var(--hairline)] pt-1`,children:(0,R.jsxs)(`button`,{type:`button`,role:`switch`,className:`focus-visible:ring-ring/60 text-foreground hover:bg-hover-fill flex w-full items-center gap-3 rounded-xl px-3 py-2.5 text-left text-sm outline-none focus-visible:ring-2`,"aria-checked":r,onClick:()=>s?.(!r),children:[(0,R.jsx)(Lv,{className:`size-3.5 shrink-0 text-amber-400`}),(0,R.jsx)(`span`,{children:`Fast`}),(0,R.jsx)(`span`,{className:pb(`relative ml-auto inline-flex h-5 w-9 shrink-0 items-center rounded-full transition`,r?`bg-foreground`:`bg-hover-fill-strong`),"aria-hidden":`true`,children:(0,R.jsx)(`span`,{className:pb(`bg-background inline-block size-3.5 rounded-full transition`,r?`translate-x-[18px]`:`translate-x-[3px]`)})})]})}):null]}),T&&Xb(T)?(0,R.jsx)(`div`,{ref:x,role:`group`,"aria-label":`Reasoning for ${T.label}`,className:`bg-popover/96 max-h-[50vh] shrink-0 overflow-y-auto rounded-[18px] border border-[var(--hairline)] p-2 shadow-[var(--composer-shadow)] backdrop-blur-xl sm:absolute sm:right-0 sm:w-46`,style:{top:h},onKeyDown:e=>{e.key===`ArrowLeft`&&(e.preventDefault(),b.current.get(T.id)?.focus())},children:(0,R.jsx)(Fx,{model:T,reasoningEffort:T.id===t?n:``,onSelect:e=>ee(T,e)})}):null]}):null]})}var Rx=68,zx=160,Bx=!!globalThis.CSS?.supports(`field-sizing`,`content`),Vx=`Attach files`,Hx=`composer-shell mx-auto w-full max-w-[48rem] rounded-[28px] p-px transition-colors duration-200`,Ux=`composer-inner rounded-[27px] border border-[var(--hairline)] transition-colors duration-200`;function Wx({notices:e,prompt:t=``,onPromptChange:n,attachments:r,onAttachFiles:i,onRemoveAttachment:a,modelCatalog:o,selectedModel:s=kb,onSelectedModelChange:c,configuredProviders:l=[`spikonado`],providersReady:u=!0,selectedCompletionProvider:d=`spikonado`,onSelectedCompletionProviderChange:f,selectedReasoningEffort:p=Ab,onSelectedReasoningEffortChange:m,fastMode:h=!1,onFastModeChange:g,pendingQuestion:_=null,showContinueWorking:v=!1,onContinueWorking:y,runningCommands:b=null,selectedQuestionOptionId:x=null,onSelectedQuestionOptionIdChange:S,canSend:C,isSubmitting:w,isStarting:T,isRunning:E,runStartedAt:D,projectSkills:ee=null,projectPaths:O=null,onSubmit:te,onCancel:ne,usage:re,usageFailed:ie}){let[k,ae]=(0,F.useState)(()=>Date.now()),A=v&&!!y;(0,F.useEffect)(()=>{let e=setInterval(()=>{ae(Date.now())},1e3);return()=>{clearInterval(e)}},[]);let oe=l.map(e=>({id:e,label:e===`spikonado`?`Spikonado`:e===`chatgpt`?`ChatGPT Subscription`:`OpenAI API`})),se=o?Zb(o,d):[],ce=o?Yb(o,s):void 0,le=(d===`spikonado`||u&&l.includes(d))&&ce!==void 0&&(d===`spikonado`?ie||re!==void 0:ce.provider===`openai`),ue=(0,F.useRef)(null),de=(0,F.useRef)(null),[fe,pe]=(0,F.useState)(null),[me,he]=(0,F.useState)([]),[ge,_e]=(0,F.useState)(`idle`),[ve,ye]=(0,F.useState)(!1),[j,M]=(0,F.useState)(0),[be,xe]=(0,F.useState)(0),[N,Se]=(0,F.useState)(!1),[Ce,we]=(0,F.useState)(0),Te=(0,F.useRef)(0),Ee=(0,F.useRef)(void 0),[De,Oe]=(0,F.useState)(!1),[ke,Ae]=(0,F.useState)(null),je=_!=null,Me=E&&!je||w,Ne=ce?.usagePolicy===`unlimited`,Pe=re?.exhausted===!0&&(re.resetsAt===null||re.resetsAt>k)&&!Ne&&d===`spikonado`,Fe=o?se.find(e=>Yb(o,e.id)?.usagePolicy===`unlimited`)?.label??null:null,Ie=(()=>{if(!Pe||re===void 0)return null;let e=Fe===null?`Upgrade your subscription to keep going.`:`Switch to ${Fe} or upgrade your subscription to keep going.`;return re.resetsAt===null?e:`Your limit resets in ${ox(re.resetsAt-k)}. ${e}`})(),Le=!!t.trim()||r.length>0,Re=Db({selectedOptionId:x,text:t}),ze=je?Re:Le,Be=r.some(e=>e.status!==`ready`),Ve=!Me&&!je,He=Wb(t,be),P=Bb(t,be),Ue=P?.query??null,We=He!==null&&Ue===null&&!ve&&!je,Ge=Ue!==null&&!N&&!je&&!w,Ke=Ox(O,Ge?Ue:null),qe=Math.min(Ce,Math.max(0,Ke.entries.length-1)),Je=We||Ge,Ye=(0,F.useMemo)(()=>He===null?[]:Gb(me,He),[He,me]),Xe=Ge&&Ke.entries[qe]?`composer-path-option-${qe}`:We&&Ye.length>0?`composer-skill-option-${j}`:void 0,Ze=(0,F.useCallback)(()=>{xe(ue.current?.selectionStart??t.length)},[t.length]),Qe=(0,F.useCallback)(()=>{let e=ue.current;if(!e||Bx)return;e.style.height=`${Rx}px`;let t=Math.min(Math.max(e.scrollHeight,Rx),zx);e.style.height=`${t}px`,e.style.overflowY=e.scrollHeight>t?`auto`:`hidden`},[]),$e=(0,F.useCallback)(()=>{he([]),_e(`idle`),ye(!1),M(0),Te.current+=1},[]),et=(0,F.useCallback)(async(e=!1)=>{if(ge===`loading`||(ge===`ready`||ge===`error`)&&!e)return;if(!ee?.load){he([]),_e(`ready`);return}let t=++Te.current;_e(`loading`);try{let e=await ee.load();if(t!==Te.current)return;he(e),_e(`ready`)}catch{if(t!==Te.current)return;he([]),_e(`error`)}},[ee,ge]);function tt(e){let r=Kb(t,be,e.name);r&&(n?.(r.text),xe(r.caret),ye(!0),queueMicrotask(()=>{let e=ue.current;e&&(e.focus(),e.setSelectionRange(r.caret,r.caret),Qe())}))}function nt(e){let r=Vb(t,be,e);r&&(n?.(r.text),xe(r.caret),Se(!0),queueMicrotask(()=>{let e=ue.current;e&&(e.focus(),e.setSelectionRange(r.caret,r.caret),Qe())}))}function rt(e){let t=e.currentTarget,n=Array.from(t.files??[]);t.value=``,n.length>0&&i(n)}function it(e){let t=Array.from(e.clipboardData.files);t.length!==0&&Ve&&(e.clipboardData.getData(`text/plain`)||e.preventDefault(),i(t))}function at(e){Mb(e.dataTransfer)&&(e.preventDefault(),Ve&&Oe(!0))}function ot(e){Mb(e.dataTransfer)&&(e.preventDefault(),e.dataTransfer.dropEffect=Ve?`copy`:`none`)}function st(e){let t=e.currentTarget,n=e.relatedTarget;n instanceof Node&&t.contains(n)||Oe(!1)}function ct(e){if(!Mb(e.dataTransfer)||(e.preventDefault(),Oe(!1),!Ve))return;let t=Array.from(e.dataTransfer.files);t.length>0&&i(t)}function lt(e){let t=e.currentTarget;if(t.disabled)return;let n=t.getBoundingClientRect();pe({top:n.top-8,left:n.left+n.width/2})}function ut(){pe(null)}function dt(e){if(!e.nativeEvent.isComposing&&!(e.key===`Enter`&&window.matchMedia?.(`(pointer: coarse)`).matches)){if(Ge){if(e.key===`ArrowDown`||e.key===`ArrowUp`){e.preventDefault();let t=Ke.entries.length;if(t>0){let n=e.key===`ArrowDown`?1:-1;we((qe+n+t)%t)}return}if(e.key===`Escape`){e.preventDefault(),Se(!0);return}if((e.key===`Enter`||e.key===`Tab`)&&!e.shiftKey){let t=Ke.entries[qe];if(t){e.preventDefault(),nt(t);return}}}if(We){if(e.key===`ArrowDown`||e.key===`ArrowUp`){if(e.preventDefault(),Ye.length===0)return;let t=e.key===`ArrowDown`?1:-1;M(e=>(e+t+Ye.length)%Ye.length);return}if(e.key===`Escape`){e.preventDefault(),ye(!0);return}if((e.key===`Enter`||e.key===`Tab`)&&!e.shiftKey){e.preventDefault();let t=Ye[j];t&&tt(t);return}}!C||!je&&!le||!je&&Pe||w||Me||!ze||!je&&Be||jb({key:e.key,shiftKey:e.shiftKey,isComposing:e.nativeEvent.isComposing})&&(e.preventDefault(),te())}}function ft(e){S?.(x===e?null:e)}function pt(e,t){o&&(c?.(e),Yb(o,e)&&m?.(t))}function mt(e){if(!o)return;f?.(e);let t=Qb(o,e,s);t&&(c?.(t),m?.(Yb(o,t)?.defaultReasoningEffort??o.defaultReasoningEffort),g?.(!1))}return(0,F.useEffect)(()=>{if(!o)return;let e=u&&!l.includes(d)?`spikonado`:d;e!==d&&f?.(e);let t=Qb(o,e,s);t&&t!==s&&(c?.(t),m?.(Yb(o,t)?.defaultReasoningEffort??o.defaultReasoningEffort),g?.(!1))},[o,u,l,d,s,f,c,m,g]),(0,F.useEffect)(()=>{d!==`spikonado`&&h&&g?.(!1)},[d,h,g]),(0,F.useEffect)(()=>{ce&&(ce.reasoningEfforts.includes(p)||m?.(ce.defaultReasoningEffort),h&&!ce.supportsFastMode&&g?.(!1))},[ce,p,m,h,g]),(0,F.useEffect)(()=>{Qe()},[t,Qe]),(0,F.useEffect)(()=>{Ve||Oe(!1)},[Ve]),(0,F.useEffect)(()=>{let e=_?.questionId??null;e!==ke&&(Ae(e),x!==null&&S?.(null),t.trim()&&n?.(``))},[_,ke,x,t,S,n]),(0,F.useEffect)(()=>{let e=ee?.workspacePath??null;if(Ee.current!==e&&(Ee.current=e,$e()),He===null){ye(!1);return}ve||et()},[ee,He,ve,et,$e]),(0,F.useEffect)(()=>{M(0)},[Ye]),(0,F.useEffect)(()=>{Se(!1),we(0)},[Ue,P?.start,O]),(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(`footer`,{className:`shrink-0 px-2 pt-2 pb-[max(0.5rem,env(safe-area-inset-bottom))] sm:px-6 sm:py-4`,children:(0,R.jsxs)(`div`,{className:`mx-auto max-w-336`,children:[D!==null&&D>0&&Number.isFinite(D)?(0,R.jsxs)(`div`,{className:`text-muted-foreground mb-3 flex items-center gap-2 px-4 text-[11px]`,children:[(0,R.jsxs)(`span`,{className:`inline-flex items-center gap-0.75`,children:[(0,R.jsx)(`span`,{className:`bg-foreground/28 size-1 animate-pulse rounded-full`}),(0,R.jsx)(`span`,{className:`bg-foreground/28 size-1 animate-pulse rounded-full [animation-delay:200ms]`}),(0,R.jsx)(`span`,{className:`bg-foreground/28 size-1 animate-pulse rounded-full [animation-delay:400ms]`})]}),(0,R.jsxs)(`span`,{children:[`Working for `,(0,R.jsx)(dx,{startedAt:D})]})]}):w?(0,R.jsxs)(`div`,{className:`text-muted-foreground mb-3 flex items-center gap-2 px-4 text-[11px]`,role:`status`,"aria-live":`polite`,children:[(0,R.jsx)(`span`,{className:`bg-foreground/28 size-1.5 animate-pulse rounded-full`}),(0,R.jsx)(`span`,{children:T?`Starting agent…`:`Sending request…`})]}):null,b&&(0,R.jsx)(mx,{...b,collapseWhen:A}),A?(0,R.jsx)(`div`,{className:`mx-auto mb-3 w-full max-w-[48rem] px-4`,children:(0,R.jsx)(`button`,{type:`button`,className:`border-border bg-surface/80 text-foreground hover:bg-hover-fill rounded-full border px-3 py-1.5 text-[13px] font-medium transition`,onClick:y,disabled:w,children:`Continue working`})}):null,(0,R.jsx)(`div`,{className:Hx,role:`group`,"aria-label":`Message composer`,onDragEnter:at,onDragOver:ot,onDragLeave:st,onDrop:ct,children:(0,R.jsxs)(`div`,{className:`${Ux} relative`,children:[De?(0,R.jsxs)(`div`,{className:`bg-surface/90 border-primary/70 pointer-events-none absolute inset-0 z-30 flex items-center justify-center gap-2 rounded-[27px] border-2 border-dashed backdrop-blur-sm`,role:`status`,"aria-live":`polite`,children:[(0,R.jsx)($_,{className:`text-primary size-5`,"aria-hidden":`true`}),(0,R.jsx)(`span`,{className:`text-foreground text-sm font-medium`,children:`Drop files to attach`})]}):null,(0,R.jsxs)(`div`,{className:`relative flex min-h-33 flex-col px-4 pt-4 pb-2.5`,children:[(0,R.jsxs)(`div`,{className:`mb-3 max-h-[min(30vh,16rem)] space-y-2 overflow-y-auto empty:hidden`,role:`region`,"aria-label":`Conversation notices`,tabIndex:0,children:[e,Ie?(0,R.jsx)(Dx,{title:`You're out of usage`,children:Ie}):null]}),_?(0,R.jsx)(cx,{question:_.question,options:_.options,selectedOptionId:x,onToggleOption:ft}):null,r.length>0&&!je?(0,R.jsx)(wx,{attachments:r,disabled:Me,onRemove:a}):null,(0,R.jsxs)(`div`,{className:`relative min-h-0 flex-1`,children:[Ge?(0,R.jsx)(Ex,{loadState:Ke.loadState,entries:Ke.entries,scanning:Ke.scanning,highlightedIndex:qe,onRetry:()=>{Ke.retry(),ue.current?.focus()},onHighlight:we,onSelect:nt}):null,We?(0,R.jsx)(Tx,{loadState:ge,skills:Ye,highlightedIndex:j,onRetry:()=>void et(!0),onHighlight:e=>{M(e)},onSelect:tt}):null,(0,R.jsx)(`textarea`,{ref:ue,value:t,rows:1,className:`text-foreground placeholder:text-muted-foreground field-sizing-content max-h-40 min-h-17 w-full resize-none overflow-y-auto border-0 bg-transparent px-0 py-0 text-base leading-6 outline-none sm:text-[14px]`,placeholder:je?`Add detail, or type a custom answer`:`Ask anything, use / for commands, @ to tag files/folders, and $ for skills`,disabled:w,role:`combobox`,"aria-autocomplete":`list`,"aria-haspopup":`listbox`,"aria-expanded":Je,"aria-controls":Ge?`composer-paths-listbox`:We?`composer-skills-listbox`:void 0,"aria-activedescendant":Xe,autoComplete:`off`,enterKeyHint:`enter`,onKeyDown:dt,onPaste:it,onFocus:Ze,onChange:e=>{n?.(e.target.value),Ze(),Qe()},onKeyUp:Ze,onClick:Ze,onSelect:Ze})]}),(0,R.jsxs)(`div`,{className:`flex min-w-0 items-center justify-between gap-1 overflow-visible pt-2.5 sm:gap-3`,children:[(0,R.jsxs)(`div`,{className:`-m-1 flex min-w-0 flex-1 items-center gap-1 overflow-visible p-1`,children:[(0,R.jsx)(`input`,{ref:de,type:`file`,className:`hidden`,multiple:!0,onChange:rt}),(0,R.jsx)(`button`,{type:`button`,className:`text-muted-foreground enabled:hover:text-foreground flex size-11 shrink-0 items-center justify-center rounded-lg transition enabled:cursor-pointer disabled:opacity-40 sm:size-9`,"aria-label":Vx,disabled:!Ve,onMouseEnter:lt,onMouseLeave:ut,onFocus:lt,onBlur:ut,onClick:()=>{ut(),de.current?.click()},children:(0,R.jsx)($_,{className:`size-4`,"aria-hidden":`true`})}),(0,R.jsx)(`div`,{className:`bg-hover-fill-strong mx-1 hidden h-4 w-px shrink-0 sm:block`}),(0,R.jsx)(Lx,{modelId:s,models:o?.models.filter(e=>se.some(t=>t.id===e.id))??[],reasoningEffort:p,fastMode:h,allowsFastMode:d===`spikonado`,disabled:Me||je||o===void 0,onSelect:pt,onFastModeChange:g}),(0,R.jsx)(`div`,{className:`bg-hover-fill-strong mx-1 hidden h-4 w-px shrink-0 sm:block`}),(0,R.jsx)(Mx,{value:d,options:oe,ariaLabel:`Select provider`,menuTitle:`Provider`,compactOnMobile:!0,disabled:Me||je||!u,onValueChange:mt,className:`z-20 shrink-0`,triggerClassName:`h-11 border-0 bg-transparent px-2 text-[15px] text-foreground shadow-none hover:bg-transparent sm:h-9`,optionIcon:e=>(0,R.jsx)(Px,{provider:e.id,className:`size-4 shrink-0`})})]}),(0,R.jsxs)(`div`,{className:`flex shrink-0 flex-nowrap items-center justify-end gap-2.5`,children:[E?(0,R.jsx)(`button`,{type:`button`,className:`flex size-11 cursor-pointer items-center justify-center rounded-full bg-rose-500/90 text-white transition-all duration-150 hover:scale-105 hover:bg-rose-500 disabled:pointer-events-none disabled:opacity-60 disabled:hover:scale-100 sm:size-10`,"aria-label":`Stop generation`,title:`Stop`,onClick:ne,children:(0,R.jsx)(yv,{className:`size-3.5 fill-current`})}):null,je||!E?(0,R.jsx)(`button`,{type:`button`,className:`bg-primary/90 text-primary-foreground hover:bg-primary flex size-11 items-center justify-center rounded-full transition-all duration-150 hover:scale-105 enabled:cursor-pointer disabled:pointer-events-none disabled:opacity-30 disabled:hover:scale-100 sm:size-10`,onClick:te,disabled:!C||!je&&!le||!je&&Pe||w||!ze||!je&&Be,"aria-label":je?`Submit answer`:`Send message`,children:(0,R.jsx)(jg,{className:`size-4`})}):null]})]})]})]})})]})}),fe?(0,R.jsx)(`div`,{className:`bg-tooltip text-tooltip-foreground ring-border pointer-events-none fixed z-100 -translate-x-1/2 -translate-y-full rounded-md px-2.5 py-1.5 text-[12px] leading-4 whitespace-nowrap shadow-lg ring-1`,style:{top:fe.top,left:fe.left},role:`tooltip`,children:Vx}):null]})}function Gx(e){let t=cr(),n=sx(),r=qn({query:Jp.usage.getMyUsage,args:t.isAuthenticated&&!t.isLoading?{now:n}:`skip`});return(0,R.jsx)(Wx,{...e,usage:r.status===`success`?r.data:void 0,usageFailed:r.status===`error`})}function Kx({error:e,runError:t,reconnecting:n,catalogError:r,catalogLoading:i,onRetryCatalog:a}){return(0,R.jsxs)(R.Fragment,{children:[e?(0,R.jsx)(Dx,{title:`Something went wrong`,tone:`error`,children:e}):null,t&&t!==e?(0,R.jsx)(Dx,{title:`Run couldn't continue`,children:t}):null,n?(0,R.jsx)(Dx,{title:`Reconnecting`,tone:`status`,children:`Reconnecting to conversation history.`}):null,r?(0,R.jsx)(Dx,{title:`Models unavailable`,tone:`error`,action:(0,R.jsx)(mb,{variant:`outline`,className:`h-8 px-3`,disabled:i,onclick:a,children:i?`Retrying…`:`Retry`}),children:Jb}):null]})}function qx({projects:e,workspacePath:t,onProject:n,onAddProject:r}){let i=e.find(e=>e.workspacePath===t)?.displayName??`Choose a project`,a=e.findIndex(e=>e.workspacePath===t),[o,s]=(0,F.useState)(!1),[c,l]=(0,F.useState)(0),u=(0,F.useRef)(null),d=(0,F.useRef)(null),f=(0,F.useRef)([]);function p(t){return e.some(e=>e.workspacePath!==t.workspacePath&&e.displayName===t.displayName)}function m(e){return p(e)?`${e.displayName}, ${e.workspacePath}`:e.displayName}let h=(0,F.useCallback)(t=>{let n=e.length+1,r=(t+n)%n;l(r),queueMicrotask(()=>f.current[r]?.focus())},[e.length]),g=(0,F.useCallback)(e=>{s(!0),h(e??(a>=0?a:0))},[h,a]),_=(0,F.useCallback)(e=>{s(!1),e&&queueMicrotask(()=>d.current?.focus())},[]);function v(e){_(!0),e.workspacePath!==t&&n(e.workspacePath)}function y(){_(!1),r()}function b(t){let n=e[t];if(n){v(n);return}y()}function x(t){(t.key===`ArrowDown`||t.key===`ArrowUp`)&&(t.preventDefault(),g(t.key===`ArrowUp`?e.length:void 0))}function S(t,n){switch(t.key){case`ArrowDown`:t.preventDefault(),h(n+1);break;case`ArrowUp`:t.preventDefault(),h(n-1);break;case`Home`:t.preventDefault(),h(0);break;case`End`:t.preventDefault(),h(e.length);break;case`Enter`:case` `:t.preventDefault(),b(n);break;case`Tab`:s(!1)}}return(0,F.useEffect)(()=>{if(o)return kx({getRoot:()=>u.current,onOutside:()=>_(!1),onEscape:()=>_(!0)})},[o,_]),(0,F.useEffect)(()=>{e.length===0&&s(!1)},[e.length]),(0,R.jsx)(`div`,{ref:u,className:`create-thread-heading`,children:e.length?(0,R.jsxs)(`h1`,{children:[`What should we build in`,` `,(0,R.jsxs)(`span`,{className:`create-thread-project-phrase`,children:[(0,R.jsxs)(`span`,{className:`create-thread-project-control`,children:[(0,R.jsxs)(`button`,{ref:d,type:`button`,className:`create-thread-project-trigger`,"aria-label":`Select project. Current project: ${i}`,"aria-haspopup":`menu`,"aria-expanded":o,"aria-controls":o?`create-thread-project-menu`:void 0,onClick:()=>{o?_(!1):g()},onKeyDown:x,children:[(0,R.jsx)(`span`,{children:i}),(0,R.jsx)(Gg,{className:o?`is-open`:``,"aria-hidden":`true`})]}),o?(0,R.jsxs)(`span`,{id:`create-thread-project-menu`,className:`create-thread-project-menu`,role:`menu`,"aria-label":`Projects`,children:[(0,R.jsx)(`span`,{className:`create-thread-project-options`,children:e.map((e,n)=>(0,R.jsxs)(`button`,{ref:e=>{f.current[n]=e},type:`button`,className:pb(c===n&&`active`,e.workspacePath===t&&`selected`),role:`menuitemradio`,"aria-checked":e.workspacePath===t,"aria-label":m(e),onPointerEnter:()=>{l(n)},onKeyDown:e=>S(e,n),onClick:()=>v(e),children:[(0,R.jsxs)(`span`,{className:`create-thread-project-option-label`,children:[(0,R.jsx)(`span`,{children:e.displayName}),p(e)?(0,R.jsx)(`small`,{title:e.workspacePath,children:e.workspacePath}):null]}),(0,R.jsx)(Ug,{"aria-hidden":`true`})]},e.workspacePath))}),(0,R.jsx)(`span`,{className:`create-thread-project-menu-footer`,children:(0,R.jsxs)(`button`,{ref:t=>{f.current[e.length]=t},type:`button`,className:pb(c===e.length&&`active`),role:`menuitem`,onPointerEnter:()=>{l(e.length)},onKeyDown:t=>S(t,e.length),onClick:y,children:[(0,R.jsx)(D_,{"aria-hidden":`true`}),(0,R.jsx)(`span`,{children:`Add project`})]})})]}):null]}),(0,R.jsx)(`span`,{"aria-hidden":`true`,children:`?`})]})]}):(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(`h1`,{children:`What should we work on?`}),(0,R.jsx)(`p`,{className:`text-muted-foreground mt-3 text-sm`,children:`Add a project to start your first thread.`}),(0,R.jsx)(`button`,{type:`button`,className:`mt-5 rounded-lg border border-[var(--hairline)] px-4 py-2 text-sm`,onClick:r,children:`Add project`})]})})}P.union(P.literal(`unsettled`),P.literal(`settled`));function Jx(e){return e.archivedAt===void 0?`unsettled`:`settled`}function Yx(e){return e.parentThreadId===void 0}function Xx(e,t,n){let r=new Set([t]),i=[t];for(;i.length>0;){let e=i.pop();for(let t of n.get(e)??[])r.has(t)||(r.add(t),i.push(t))}return e.filter(e=>!r.has(e))}function Zx(e,t,n){return t>0?`${Qx(t)} · Working`:e>0&&!n?Qx(e):null}function Qx(e){return`${e} ${e===1?`subagent`:`subagents`}`}function $x(e){return`sprocket.inbox.expanded-threads:${e}`}var eS=20;function tS(e,t){let n=(0,F.useRef)(null),{rows:r,loading:i,canLoadMore:a,error:o,loadMore:s}=t;(0,F.useEffect)(()=>{!e||i||o||!a||r.some(t=>t._id===e)||(n.current?.threadId!==e||n.current.rows!==r)&&(n.current={threadId:e,rows:r},s())},[e,r,i,a,o,s])}function nS(e){let t=rr({query:Jp.threads.listChildren,args:{threadId:e},initialNumItems:eS});return{rows:t.data??[],loading:t.isLoading,canLoadMore:t.canLoadMore,error:t.error?.message,loadMore:()=>t.loadMore(eS)}}function rS({threadId:e,enabled:t}){let n=qn({query:Jp.threads.subtreeSummaryForThread,args:t&&e?{threadId:e}:`skip`});return n.status===`success`?n.data:void 0}function iS(e){try{let t=localStorage.getItem($x(e)),n=t?Ed(L()).safeParse(JSON.parse(t)):null;return n?.success?n.data:[]}catch{return[]}}function aS(e,t){try{localStorage.setItem($x(e),JSON.stringify(t))}catch{}}function oS(e){let[t,n]=(0,F.useState)([]),r=(0,F.useRef)(null),i=(0,F.useRef)(new Map);(0,F.useEffect)(()=>{r.current!==e&&(r.current=e,n(e?iS(e):[]))},[e]);let a=t=>{t.length!==0&&n(n=>{let r=[...new Set([...n,...t])];return r.length===n.length?n:(e&&aS(e,r),r)})};return{isExpanded:e=>t.includes(e),expand:e=>a([e]),revealAncestors:a,registerChildren:(e,t)=>{let n=i.current.get(e);n||(n=new Set,i.current.set(e,n));for(let e of t)n.add(e._id)},collapse:t=>{n(n=>{if(!n.includes(t))return n;let r=Xx(n,t,i.current);return e&&aS(e,r),r})}}}function sS({currentThreadId:e,enabled:t,expansion:n}){let r=qn({query:Jp.threads.ancestorChain,args:t&&e?{threadId:e}:`skip`}),i=r.status===`success`?r.data:void 0,a=n.revealAncestors,o=(0,F.useRef)(null);return(0,F.useEffect)(()=>{if(!e||!i||i.length===0){o.current=null;return}let t=`${e}:${i.join(`,`)}`;o.current!==t&&(o.current=t,a(i))},[e,i,a]),(0,F.useMemo)(()=>t&&e&&i?[...i,e]:[],[t,e,i])}var cS=Od({method:zd([`desktop`,`package`]),status:zd([`unavailable`,`idle`,`checking`,`available`,`downloading`,`downloaded`,`installing`,`installed`,`error`]),currentVersion:L(),version:L().nullable(),progress:md().nullable().optional(),error:L().nullable(),message:L().nullable().optional()});function lS(e){switch(e.status){case`available`:return`Update available`;case`downloading`:return e.progress==null?`Downloading update…`:`Downloading… ${e.progress}%`;case`downloaded`:return`Restart to update`;case`installing`:return`Installing update…`;case`installed`:return`Update installed`;case`error`:return e.version?`Retry update`:null;default:return null}}async function uS(e){let t=jm();if(!t)return null;let n=await fetch(`${t}/api/update${e?`/install`:``}`,{method:e?`POST`:`GET`,credentials:`include`,headers:{"content-type":`application/json`},signal:AbortSignal.timeout(3e4)});if(!n.ok){let e=Od({error:L()}).safeParse(await n.json().catch(()=>null));throw Error(e.success?e.data.error:`Update request failed (${n.status}). Try again.`)}return cS.parse(await n.json())}var dS=[`downloading`,`downloaded`,`installing`,`installed`];function fS(){let[e,t]=(0,F.useState)(null),[n,r]=(0,F.useState)(null),[i,a]=(0,F.useState)(!1),o=(0,F.useRef)(!1),s=(0,F.useRef)(0),c=e?lS(e):null,l=i||e?.status===`downloading`||e?.status===`installing`,u=e=>{o.current=e,a(e)},d=(0,F.useCallback)(e=>{t(e),e&&dS.includes(e.status)&&r(null)},[]);(0,F.useEffect)(()=>{let e=!1,t=!1,n=!1,r=window.sprocketDesktopBridge?.updates,i=r?.onState(e=>{s.current+=1,d(e)});async function a(){if(t||e||o.current||n)return;t=!0;let i=s.current;try{let t=r?await r.getState():await uS(!1);!e&&s.current===i&&(d(t),n=t===null||t.status===`unavailable`)}catch{}finally{t=!1}}a();let c=setInterval(()=>void a(),5e3);return()=>{e=!0,clearInterval(c),i?.()}},[d]);async function f(){if(!e||l)return;let t=++s.current;u(!0),r(null);try{let n=window.sprocketDesktopBridge?.updates;if(e.method===`desktop`&&n){let r=await(e.status===`downloaded`?n.install():n.download());s.current===t&&d(r)}else e.method===`package`&&d(await uS(!0))}catch(e){r(e instanceof Error?e.message:String(e))}finally{u(!1)}}return!c||!e?null:(0,R.jsxs)(`div`,{className:`mb-1`,"aria-live":`polite`,children:[(0,R.jsxs)(`button`,{type:`button`,className:`text-foreground hover:bg-hover-fill flex min-h-9 w-full min-w-0 items-center gap-2.5 rounded-lg px-2 py-1.5 text-left text-[13px] font-medium tracking-[-0.02em] transition disabled:cursor-default disabled:opacity-70`,disabled:l||e.status===`installed`,onClick:()=>void f(),title:e.version?`Sprocket ${e.version}`:void 0,"aria-busy":l,children:[l?(0,R.jsx)(V_,{className:`size-4 shrink-0 animate-spin`,"aria-hidden":`true`}):e.status===`downloaded`?(0,R.jsx)(tv,{className:`size-4 shrink-0`,"aria-hidden":`true`}):(0,R.jsx)(s_,{className:`size-4 shrink-0`,"aria-hidden":`true`}),(0,R.jsx)(`span`,{children:c})]}),e.status===`installed`&&(0,R.jsx)(`p`,{className:`text-muted-foreground px-2 pb-2 text-xs`,children:`Wait for active agents to finish, then stop Sprocket in your terminal and launch it again.`}),(n||e.error)&&(0,R.jsx)(`p`,{className:`text-destructive px-2 pb-2 text-xs break-words`,role:`alert`,children:n||e.error})]})}function pS({section:e}){return(0,R.jsx)(`div`,{className:`inbox-load-more`,"aria-live":`polite`,children:e.error?(0,R.jsx)(`span`,{role:`alert`,children:e.error}):e.loading?(0,R.jsx)(`span`,{children:`Loading...`}):e.canLoadMore?(0,R.jsx)(`button`,{type:`button`,onClick:e.loadMore,children:`Show more`}):null})}var mS=`text-muted-foreground hover:text-foreground hover:bg-hover-fill inline-flex size-7 shrink-0 items-center justify-center rounded-md transition`;function hS({theme:e,onThemeChange:t,onClose:n}){return(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(`button`,{type:`button`,className:mS,"aria-label":e===`dark`?`Switch to light mode`:`Switch to dark mode`,title:e===`dark`?`Light mode`:`Dark mode`,onClick:()=>t(e===`dark`?`light`:`dark`),children:e===`dark`?(0,R.jsx)(xv,{className:`size-3.5`,"aria-hidden":`true`}):(0,R.jsx)(G_,{className:`size-3.5`,"aria-hidden":`true`})}),n&&(0,R.jsx)(`button`,{type:`button`,className:mS,"aria-label":`Close sidebar`,title:`Close sidebar`,onClick:n,children:(0,R.jsx)(Y_,{className:`size-3.5`,"aria-hidden":`true`})})]})}var gS=`sprocket.inbox.settled-open`,_S={unsettled:`Unsettled`,settled:`Settled Threads`};function vS({sections:e,projects:t,models:n,selectedProjects:r,currentThreadId:i,settledOpen:a=!1,onSettledOpenChange:o,mutationsEnabled:s,theme:c,onThemeChange:l,onFilter:u,onSelect:d,onNew:f,onAddProject:p,onSettings:m,onClose:h,onChange:g,onRename:_,expansion:v,resolveChildren:y,readTreeSummary:b=rS}){let[x,S]=(0,F.useState)(null),[C,w]=(0,F.useState)(null),[T,E]=(0,F.useState)(null),[D,ee]=(0,F.useState)(!1),[O,te]=(0,F.useState)(null),[ne,re]=(0,F.useState)(``),[ie,k]=(0,F.useState)(``),ae=(0,F.useRef)(!1),A=(0,F.useRef)(null),oe=(0,F.useRef)(null),se=(0,F.useRef)(null),ce=(0,F.useRef)(o),le=(0,F.useCallback)(()=>{let e=A.current;A.current=null,w(null),e?.focus()},[]),ue=e.flatMap(e=>e.rows),de=t.filter(e=>e.displayName.toLocaleLowerCase().includes(ie.trim().toLocaleLowerCase())),fe=e.filter(e=>e.rows.length||e.loading||e.error||e.canLoadMore||e.state===`settled`&&!a),pe=r.length===0?`All projects`:r.length===1?t.find(e=>e.repositoryKey===r[0])?.displayName??`All projects`:`${r.length} projects`,me=C?.thread??null,he=b({threadId:me?._id??null,enabled:s}),ge=b({threadId:x?._id??null,enabled:s});(0,F.useEffect)(()=>{ce.current=o}),(0,F.useEffect)(()=>{try{let e=localStorage.getItem(gS);e!==null&&ce.current(e===`true`)}catch{}},[]),(0,F.useEffect)(()=>{O&&oe.current&&(oe.current.focus(),oe.current.select())},[O]),(0,F.useEffect)(()=>{C&&document.querySelector(`.inbox-context-menu button:not(:disabled)`)?.focus()},[C]);function _e(e){return t.find(t=>t.repositoryKey===e.repositoryKey)?.displayName??e.repositoryKey}function ve(e){return n.find(t=>t.id===e.selectedModel)}function ye(){se.current&&(se.current.open=!1),k(``)}function j(e){u(e),ye()}function M(){ye(),p()}function be(){let e=!a;o(e);try{localStorage.setItem(gS,String(e))}catch{}}function xe(e){w(null),te(e),re(e.title??``)}function N(){te(null),re(``)}async function Se(){if(!O)return;let e=O,t=ne.trim();if(!t||t===(e.title??``)){N();return}N();try{await _(e,t)}catch(e){E(e instanceof Error?e.message:`Could not rename thread.`)}}function Ce(e,t,n){return Jx(e)===t||!Yx(e)?!1:t!==`settled`||xS(e,n)}async function we(e,t,n){if(s&&!ae.current){if(le(),ae.current=!0,ee(!0),E(null),!Ce(e,t,n)){ae.current=!1,ee(!1);return}try{await g(e,t)}catch(e){E(e instanceof Error?e.message:`Could not update thread.`)}finally{ae.current=!1,ee(!1)}}}function Te(e){return s&&!D&&x!==null&&Ce(x,e,ge?.anyActive===!0)}function Ee(e,t){e.preventDefault(),x&&Te(t)&&we(x,t,ge?.anyActive===!0),S(null)}function De(e,t){e.preventDefault();let n=e.currentTarget instanceof HTMLElement?e.currentTarget:null;A.current=n;let r=n?.getBoundingClientRect(),i=e.clientX,a=e.clientY;w({thread:t,x:Math.min(i||r?.left||8,window.innerWidth-230),y:Math.min(a||r?.bottom||8,window.innerHeight-260)})}let Oe=(e,t,n)=>(0,R.jsx)(yS,{thread:e,sectionState:t,depth:n,selected:e._id===i,mutationsEnabled:s,busy:D,renaming:O?._id===e._id,renameTitle:ne,renameInputRef:oe,expansion:v,resolveChildren:y,readTreeSummary:b,projectName:_e(e),model:ve(e),renderChildren:e=>(0,R.jsx)(R.Fragment,{children:e.map(e=>Oe(e,t,n+1))}),onChoose:d,onOpenMenu:De,onBeginRename:xe,onCancelRename:N,onCommitRename:Se,onRenameTitleChange:re,onChange:we,onDragStart:e=>S(e),onDragEnd:()=>S(null)},e._id);function ke(e){if(e.key===`Tab`||e.key===`Escape`){e.preventDefault(),le();return}if(![`ArrowUp`,`ArrowDown`,`Home`,`End`].includes(e.key))return;e.preventDefault();let t=[...e.currentTarget.querySelectorAll(`button:not(:disabled)`)],n=t.findIndex(e=>e===document.activeElement);t[e.key===`Home`?0:e.key===`End`?t.length-1:(n+(e.key===`ArrowUp`?-1:1)+t.length)%t.length]?.focus()}let Ae=(0,F.useCallback)(e=>{if(!e.defaultPrevented){if(e.key===`Escape`){C&&le();return}if(e.altKey&&e.key.toLowerCase()===`n`&&(e.preventDefault(),f()),!(e.target instanceof Element&&e.target.closest(`input, textarea, [contenteditable="true"], dialog`))&&e.altKey&&[`ArrowUp`,`ArrowDown`].includes(e.key)){let t=ue.findIndex(e=>e._id===i),n=ue[t+(e.key===`ArrowDown`?1:-1)];n&&(e.preventDefault(),d(n))}}},[C,le,f,ue,i,d]);return(0,F.useEffect)(()=>(window.addEventListener(`keydown`,Ae),()=>window.removeEventListener(`keydown`,Ae)),[Ae]),(0,R.jsxs)(`aside`,{className:`inbox-sidebar`,"aria-label":`Thread inbox`,children:[(0,R.jsxs)(`header`,{className:`flex items-center gap-2 px-4 pt-4 pb-3`,children:[(0,R.jsx)(hb,{size:`sm`,class:`mr-auto`,label:`Close sidebar`,onclick:()=>h()}),(0,R.jsx)(hS,{theme:c,onThemeChange:l,onClose:h})]}),(0,R.jsxs)(`div`,{className:`px-3 pb-3`,children:[(0,R.jsxs)(`button`,{className:`inbox-menu-item inbox-primary-navigation`,type:`button`,onClick:f,children:[(0,R.jsx)(hv,{size:15}),`New thread`]}),(0,R.jsxs)(`div`,{className:`inbox-project-controls`,children:[(0,R.jsxs)(`details`,{ref:se,children:[(0,R.jsxs)(`summary`,{className:`inbox-filter inbox-primary-navigation`,children:[(0,R.jsx)(`span`,{className:`truncate`,children:pe}),(0,R.jsx)(Gg,{size:14})]}),(0,R.jsxs)(`div`,{className:`inbox-project-menu`,children:[(0,R.jsxs)(`label`,{className:`inbox-project-search`,children:[(0,R.jsx)(lv,{size:14}),(0,R.jsx)(`input`,{value:ie,onChange:e=>k(e.currentTarget.value),"aria-label":`Search projects`,placeholder:`Search projects`})]}),(0,R.jsxs)(`div`,{className:`inbox-project-list`,children:[(0,R.jsx)(`button`,{className:pb(`inbox-project-option`,{"inbox-project-selected":r.length===0}),type:`button`,"aria-pressed":r.length===0,onClick:()=>j([]),children:`All projects`}),de.map(e=>{let t=r.length===1&&r[0]===e.repositoryKey;return(0,R.jsx)(`button`,{className:pb(`inbox-project-option`,{"inbox-project-selected":t}),type:`button`,"aria-pressed":t,onClick:()=>j([e.repositoryKey]),children:e.displayName},e.repositoryKey)})]})]})]}),(0,R.jsx)(`button`,{className:`inbox-icon inbox-add-project-button`,type:`button`,"aria-label":`Create or add project`,onClick:M,children:(0,R.jsx)(D_,{size:17})})]})]}),(0,R.jsx)(`div`,{className:`inbox-scroll`,children:fe.map(e=>(0,R.jsxs)(`section`,{id:`inbox-${e.state}`,onDragOver:t=>{Te(e.state)&&t.preventDefault()},onDrop:t=>Ee(t,e.state),"aria-label":_S[e.state],children:[e.state===`settled`&&(0,R.jsxs)(`button`,{className:`inbox-section-heading inbox-primary-navigation`,type:`button`,"aria-expanded":a,"aria-controls":`inbox-settled-threads`,onClick:be,children:[(0,R.jsx)(`span`,{children:`Settled Threads`}),(0,R.jsx)(Gg,{className:a?`inbox-section-chevron-open`:void 0,size:14})]}),(0,R.jsx)(`div`,{id:e.state===`settled`?`inbox-settled-threads`:void 0,children:(e.state!==`settled`||a)&&(0,R.jsxs)(R.Fragment,{children:[e.rows.map(t=>Oe(t,e.state,0)),(0,R.jsx)(pS,{section:e})]})})]},e.state))}),T&&(0,R.jsxs)(`div`,{className:`inbox-notice`,role:`status`,children:[(0,R.jsx)(`span`,{children:T}),(0,R.jsx)(`button`,{type:`button`,"aria-label":`Dismiss notification`,onClick:()=>E(null),children:(0,R.jsx)(Fv,{size:13})})]}),(0,R.jsxs)(`footer`,{className:`inbox-footer`,children:[(0,R.jsxs)(`button`,{className:`inbox-menu-item inbox-primary-navigation`,type:`button`,onClick:m,children:[(0,R.jsx)(dv,{size:15}),`Settings`]}),(0,R.jsx)(fS,{})]}),C&&me&&(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(`button`,{className:`fixed inset-0 z-[200] cursor-default`,type:`button`,"aria-label":`Close thread actions`,onClick:le}),(0,R.jsxs)(`div`,{className:`inbox-context-menu`,style:{left:`${Math.max(8,C.x)}px`,top:`${Math.max(8,C.y)}px`},role:`menu`,tabIndex:-1,onKeyDown:ke,children:[Yx(me)&&(Jx(me)===`unsettled`?(0,R.jsxs)(`button`,{type:`button`,role:`menuitem`,disabled:!s||D||!Ce(me,`settled`,he?.anyActive===!0),onClick:()=>void we(me,`settled`,he?.anyActive===!0),children:[(0,R.jsx)(Ug,{size:14}),`Settle`]}):(0,R.jsxs)(`button`,{type:`button`,role:`menuitem`,disabled:!s||D,onClick:()=>void we(me,`unsettled`,!1),children:[(0,R.jsx)(rv,{size:14}),`Unsettle`]})),(0,R.jsxs)(`button`,{type:`button`,role:`menuitem`,disabled:!s,onClick:()=>xe(me),children:[(0,R.jsx)(hv,{size:14}),`Rename`]}),(0,R.jsxs)(`button`,{type:`button`,role:`menuitem`,onClick:()=>{navigator.clipboard.writeText(me._id).catch(()=>{E(`Could not copy thread ID.`)}),w(null)},children:[(0,R.jsx)(r_,{size:14}),`Copy thread ID`]})]})]})]})}function yS({thread:e,sectionState:t,depth:n,selected:r,mutationsEnabled:i,busy:a,renaming:o,renameTitle:s,renameInputRef:c,expansion:l,resolveChildren:u,readTreeSummary:d=rS,projectName:f,model:p,renderChildren:m,onChoose:h,onOpenMenu:g,onBeginRename:_,onCancelRename:v,onCommitRename:y,onRenameTitleChange:b,onChange:x,onDragStart:S,onDragEnd:C}){let w=d({threadId:e._id,enabled:i}),T=bS(e),E=w?.descendantCount??0,D=w?.workingDescendantCount??0,ee=Zx(E,D,w?.descendantsActive??!1),O=l.isExpanded(e._id),te=Yx(e),ne=n>0?{marginLeft:`${n*14}px`}:void 0;return(0,R.jsxs)(`div`,{className:`inbox-tree-node`,children:[(0,R.jsxs)(`div`,{className:pb(`inbox-row`,{"inbox-row-selected":r}),style:ne,draggable:i&&!a&&!o&&te,onDragStart:t=>S(e,t),onDragEnd:C,onContextMenu:t=>g(t,e),role:`group`,"aria-label":e.title??`New thread`,children:[o?(0,R.jsxs)(`form`,{className:`inbox-row-main`,onSubmit:e=>{e.preventDefault(),y()},children:[(0,R.jsxs)(`span`,{className:`inbox-row-meta`,children:[(0,R.jsx)(`span`,{className:`truncate`,children:f}),T&&(0,R.jsx)(`span`,{className:pb(`inbox-status shrink-0`,T.className),children:T.label})]}),(0,R.jsx)(`input`,{ref:c,value:s,onChange:e=>b(e.currentTarget.value),className:`inbox-row-rename-input`,"aria-label":`Rename thread`,maxLength:300,onKeyDown:e=>{e.key===`Escape`&&(e.preventDefault(),v())},onBlur:()=>void y()}),(0,R.jsx)(`span`,{className:`inbox-row-model`,children:p?(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(Px,{provider:p.provider,className:`size-3.5 shrink-0`}),(0,R.jsx)(`span`,{className:`truncate`,children:p.label})]}):(0,R.jsx)(`span`,{className:`truncate`,children:`Unknown model`})})]}):(0,R.jsxs)(`button`,{className:`inbox-row-main`,type:`button`,title:`${e.title??`New thread`}\n${f}`,onClick:()=>h(e),onDoubleClick:()=>{i&&!a&&_(e)},"aria-current":r?`page`:void 0,children:[(0,R.jsxs)(`span`,{className:`inbox-row-meta`,children:[(0,R.jsx)(`span`,{className:`truncate`,children:f}),T&&(0,R.jsx)(`span`,{className:pb(`inbox-status shrink-0`,T.className),children:T.label})]}),(0,R.jsx)(`span`,{className:`inbox-row-title truncate`,children:e.title??`New thread`}),(0,R.jsx)(`span`,{className:`inbox-row-model`,children:p?(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(Px,{provider:p.provider,className:`size-3.5 shrink-0`}),(0,R.jsx)(`span`,{className:`truncate`,children:p.label})]}):(0,R.jsx)(`span`,{className:`truncate`,children:`Unknown model`})})]}),!o&&te&&(0,R.jsx)(`div`,{className:`inbox-row-actions`,children:t===`unsettled`?(0,R.jsx)(`button`,{className:`inbox-icon inbox-row-state-action`,type:`button`,disabled:!i||a||!xS(e,w?.anyActive===!0),"aria-label":`Settle ${e.title??`thread`}`,"data-tooltip":`Settle`,onClick:()=>void x(e,`settled`,w?.anyActive===!0),children:(0,R.jsx)(Ug,{size:14})}):(0,R.jsx)(`button`,{className:`inbox-icon inbox-row-state-action`,type:`button`,disabled:!i||a,"aria-label":`Unsettle ${e.title??`thread`}`,"data-tooltip":`Unsettle`,onClick:()=>void x(e,`unsettled`,!1),children:(0,R.jsx)(rv,{size:14})})}),E>0&&!o&&(0,R.jsxs)(`button`,{className:`inbox-subagents`,type:`button`,"aria-expanded":O,"aria-label":`${O?`Collapse`:`Expand`} subagents of ${e.title??`thread`}${ee?`: ${ee}`:``}`,onClick:()=>{O?l.collapse(e._id):l.expand(e._id)},children:[O?(0,R.jsx)(Gg,{size:13}):(0,R.jsx)(qg,{size:13}),ee&&(0,R.jsx)(`span`,{className:pb(`inbox-row-subagents`,{"inbox-working":D>0}),children:ee})]})]}),O&&(0,R.jsx)(`div`,{className:`inbox-children`,children:u({threadId:e._id,renderRows:m})})]})}function bS(e){return e.status===`queued`?{label:`Starting`,className:`inbox-working`}:e.status===`running`?{label:`Working`,className:`inbox-working`}:e.status===`failed`?{label:`Failed`,className:`inbox-attention`}:null}function xS(e,t){return!t&&e.status!==`running`&&e.status!==`queued`}function SS({user:e,onSignOut:t}){let[n,r]=(0,F.useState)(!1),i=cr(),a=qn({query:Jp.billing.getMySubscription,args:i.isAuthenticated&&!i.isLoading?{}:`skip`}),o=a.status===`success`?a.data:null,s=a.status===`error`,c=[e?.firstName,e?.lastName].filter(Boolean).join(` `).trim()||null;return(0,R.jsxs)(`section`,{className:`flex h-full min-h-0 flex-col overflow-hidden`,children:[(0,R.jsx)(`header`,{className:`flex h-12 shrink-0 items-center px-6`,children:(0,R.jsx)(`h1`,{className:`text-foreground text-[1rem] font-medium tracking-[-0.03em]`,children:`Account`})}),(0,R.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto px-6 py-8`,children:(0,R.jsxs)(`div`,{className:`max-w-xl space-y-10`,children:[(0,R.jsxs)(`div`,{children:[(0,R.jsx)(`p`,{className:`text-muted-foreground font-mono text-[11px] tracking-[0.18em] uppercase`,children:`Profile`}),c||e?.email?(0,R.jsxs)(`div`,{className:`mt-3 space-y-1`,children:[c&&(0,R.jsx)(`p`,{className:`text-foreground text-[15px]`,children:c}),e?.email&&(0,R.jsx)(`button`,{type:`button`,className:`text-muted-foreground hover:text-foreground block text-left text-sm transition`,"aria-pressed":n,"aria-label":n?`Hide email address`:`Show email address`,onClick:()=>r(e=>!e),children:(0,R.jsx)(`span`,{className:n?void 0:`blur-[5px] select-none`,children:e.email})})]}):(0,R.jsx)(`p`,{className:`text-muted-foreground mt-3 text-sm`,children:`You’re signed in to Sprocket.`})]}),(0,R.jsxs)(`div`,{children:[(0,R.jsx)(`p`,{className:`text-muted-foreground font-mono text-[11px] tracking-[0.18em] uppercase`,children:`Spikonado Subscription Tier`}),o?(0,R.jsx)(`p`,{className:`text-foreground mt-3 text-[15px]`,children:o.tierLabel}):s?(0,R.jsx)(`p`,{className:`text-muted-foreground mt-3 text-sm`,children:`Couldn’t load your subscription right now.`}):(0,R.jsx)(`div`,{className:`bg-hover-fill mt-3.5 h-4 w-16 animate-pulse rounded`,"aria-hidden":`true`})]}),(0,R.jsx)(`div`,{children:(0,R.jsxs)(mb,{variant:`outline`,onclick:t,children:[(0,R.jsx)(U_,{className:`mr-2 size-4`,"aria-hidden":`true`}),`Sign Out`]})})]})})]})}function CS(){let e=cr(),t=qn({query:Jp.uiPreferences.getMine,args:e.isAuthenticated&&!e.isLoading?{}:`skip`}),n=Jn(Jp.uiPreferences.setAutomaticThreadTitles),[r,i]=(0,F.useState)(null),[a,o]=(0,F.useState)(null),s=r??(t.status===`success`?t.data?.automaticThreadTitles??!0:!0),c=t.status!==`success`||r!==null;async function l(){if(c)return;let e=!s;i(e),o(null);try{await n({enabled:e})}catch{o(`Couldn't save your preference. Try again.`)}finally{i(null)}}return(0,R.jsxs)(`section`,{className:`flex h-full min-h-0 flex-col overflow-hidden`,children:[(0,R.jsx)(`header`,{className:`flex h-12 shrink-0 items-center px-6`,children:(0,R.jsx)(`h1`,{className:`text-foreground text-[1rem] font-medium tracking-[-0.03em]`,children:`General`})}),(0,R.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto px-6 py-8`,children:(0,R.jsxs)(`div`,{className:`max-w-xl space-y-4`,children:[(0,R.jsxs)(`button`,{type:`button`,role:`switch`,"aria-checked":s,"aria-label":`Automatically name threads`,"aria-describedby":`automatic-thread-titles-description`,disabled:c,className:`focus-visible:ring-ring/60 text-foreground hover:bg-hover-fill flex w-full items-center gap-3 rounded-xl px-3 py-2.5 text-left text-sm outline-none focus-visible:ring-2 disabled:cursor-wait disabled:opacity-50`,onClick:()=>void l(),children:[(0,R.jsxs)(`span`,{className:`flex-1`,children:[(0,R.jsx)(`span`,{className:`block font-medium`,children:`Automatically name threads`}),(0,R.jsx)(`span`,{id:`automatic-thread-titles-description`,className:`text-muted-foreground mt-1 block text-[13px]`,children:`Name and update threads after every user prompt.`})]}),(0,R.jsx)(`span`,{className:pb(`relative ml-auto inline-flex h-5 w-9 shrink-0 items-center rounded-full transition`,s?`bg-foreground`:`bg-hover-fill-strong`),"aria-hidden":`true`,children:(0,R.jsx)(`span`,{className:pb(`bg-background inline-block size-3.5 rounded-full transition`,s?`translate-x-[18px]`:`translate-x-[3px]`)})})]}),t.status===`pending`&&(0,R.jsx)(`p`,{role:`status`,className:`text-muted-foreground px-3 text-sm`,children:`Loading preferences...`}),t.status===`error`&&(0,R.jsx)(`p`,{role:`alert`,className:`text-destructive px-3 text-sm`,children:`Couldn't load your preferences right now.`}),a&&(0,R.jsx)(`p`,{role:`alert`,className:`text-destructive px-3 text-sm`,children:a})]})})]})}function wS({approval:e}){return(0,R.jsxs)(`div`,{className:`max-w-md`,children:[(0,R.jsxs)(`p`,{className:`text-foreground text-sm`,children:[`Approve spending`,e.label?` · ${e.label}`:``]}),(0,R.jsx)(`p`,{className:`text-muted-foreground mt-0.5 text-xs leading-5`,children:`Opens Prava in a new tab so you can confirm with your passkey.`}),(0,R.jsx)(`a`,{href:e.approvalUrl,target:`_blank`,rel:`noopener noreferrer`,className:`border-border bg-surface/80 text-foreground hover:bg-hover-fill mt-3 inline-flex h-9 items-center rounded-full border px-4 text-xs font-medium transition`,children:`Approve mandate`})]})}var TS=`Uncaught ConvexError: `,ES=`Uncaught Error: `;function DS(e,t){if(!e.startsWith(t))return null;let n=e.slice(t.length),r=n.indexOf(`
74
+ `),i=r===-1?n:n.slice(0,r),a=i.indexOf(`(`);return(a===-1?i:i.slice(0,a)).trim()||null}function OS(e){if(e instanceof Ye){let t=e.data.trim();if(t)return t}let t=e.message.trim();return t?DS(t,TS)??DS(t,ES)??t:null}function kS(e,t){return OS(e)||t}function AS(e,t){return e instanceof Error?kS(e,t):t}var jS=`border-border bg-hover-fill text-foreground placeholder:text-muted-foreground focus:border-ring h-9 w-full rounded-lg border px-3 text-[13px] outline-none`,MS=`text-muted-foreground text-[12px]`,NS=`text-muted-foreground hover:text-foreground text-[12px] transition disabled:pointer-events-none disabled:opacity-40`,PS={pause:{idle:`Pause`,busy:`Pausing…`},resume:{idle:`Resume`,busy:`Resuming…`},cancel:{idle:`Cancel`,busy:`Cancelling…`}},FS=[{value:`one_time`,label:`One time`},{value:`weekly`,label:`Weekly`},{value:`monthly`,label:`Monthly`},{value:`yearly`,label:`Yearly`}],IS=[{value:`listed`,label:`Listed merchant`},{value:`any`,label:`Any merchant`}];function LS(e,t){return e.find(e=>e.value===t)?.value??null}function RS(){let e=cr(),t=Yn(Jp.payments.listMyMandates),n=Yn(Jp.payments.setupMyMandate),r=Yn(Jp.payments.setMyMandateLifecycle),[i,a]=(0,F.useState)(``),[o,s]=(0,F.useState)(``),[c,l]=(0,F.useState)(`US`),[u,d]=(0,F.useState)(``),[f,p]=(0,F.useState)(`USD`),[m,h]=(0,F.useState)(`monthly`),[g,_]=(0,F.useState)(`listed`),[v,y]=(0,F.useState)(``),[b,x]=(0,F.useState)(!1),[S,C]=(0,F.useState)(null),[w,T]=(0,F.useState)(null),[E,D]=(0,F.useState)([]),[ee,O]=(0,F.useState)(!1),[te,ne]=(0,F.useState)(null),[re,ie]=(0,F.useState)(null),[k,ae]=(0,F.useState)(null),A=(0,F.useRef)(null),oe=e=>{A.current=e,T(e)};(0,F.useEffect)(()=>{g===`any`&&m!==`one_time`&&h(`one_time`)},[g,m]);let se=(0,F.useCallback)(async()=>{O(!0),ne(null);try{let e=await t({});D(e.mandates);let n=A.current?.mandateId;n&&e.mandates.some(e=>e.mandateId===n&&(e.status===`active`||e.status===`paused`))&&(A.current=null,T(null))}catch(e){ne(AS(e,`Couldn’t load mandates.`))}finally{O(!1)}},[t]);(0,F.useEffect)(()=>{e.isAuthenticated&&!e.isLoading&&se()},[e.isAuthenticated,e.isLoading,se]),(0,F.useEffect)(()=>{if(!w||!e.isAuthenticated)return;let t=()=>{document.visibilityState&&document.visibilityState!==`visible`||se()};return window.addEventListener(`focus`,t),document.addEventListener(`visibilitychange`,t),()=>{window.removeEventListener(`focus`,t),document.removeEventListener(`visibilitychange`,t)}},[w,e.isAuthenticated,se]);async function ce(e){e.preventDefault(),x(!0),C(null),oe(null);let t=g===`listed`;try{let e=await n({merchantName:t&&i.trim()||void 0,merchantUrl:t&&o.trim()||void 0,countryCode:t&&c.trim()||void 0,amountCap:u.trim(),currency:f.trim(),frequency:m,scope:g,description:v.trim()});oe({mandateId:e.mandateId,approvalUrl:e.approvalUrl,label:v.trim()}),await se()}catch(e){C(AS(e,`Couldn’t set up mandate.`))}finally{x(!1)}}async function le(e,t){if(e.mandateId&&re===null){ie(e.pravaMandateId),ae(t),ne(null);try{await r({mandateId:e.mandateId,action:t}),await se()}catch(e){ne(AS(e,`Couldn’t ${t} mandate.`))}finally{ie(null),ae(null)}}}return(0,R.jsxs)(`section`,{className:`flex h-full min-h-0 flex-col overflow-hidden`,children:[(0,R.jsx)(`header`,{className:`flex h-12 shrink-0 items-center px-6`,children:(0,R.jsx)(`h1`,{className:`text-foreground text-[1rem] font-medium tracking-[-0.03em]`,children:`Payments`})}),(0,R.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto px-6 py-8`,children:(0,R.jsxs)(`div`,{className:`max-w-xl space-y-10`,children:[(0,R.jsxs)(`div`,{children:[(0,R.jsx)(`p`,{className:`text-muted-foreground font-mono text-[11px] tracking-[0.18em] uppercase`,children:`Set up a spending mandate`}),(0,R.jsx)(`p`,{className:`text-muted-foreground mt-2 text-sm leading-6`,children:`Create a Prava mandate, then approve it in a new tab with your passkey.`}),(0,R.jsxs)(`form`,{className:`mt-4 space-y-3`,onSubmit:e=>void ce(e),children:[(0,R.jsxs)(`div`,{className:`grid gap-3 sm:grid-cols-2`,children:[(0,R.jsxs)(`label`,{className:`block space-y-1.5`,children:[(0,R.jsx)(`span`,{className:MS,children:`Merchant name`}),(0,R.jsx)(`input`,{className:jS,value:i,onChange:e=>a(e.currentTarget.value),placeholder:`Example Shop`,disabled:b||g===`any`})]}),(0,R.jsxs)(`label`,{className:`block space-y-1.5`,children:[(0,R.jsx)(`span`,{className:MS,children:`Merchant URL`}),(0,R.jsx)(`input`,{className:jS,value:o,onChange:e=>s(e.currentTarget.value),placeholder:`https://example.com`,disabled:b||g===`any`})]}),(0,R.jsxs)(`label`,{className:`block space-y-1.5`,children:[(0,R.jsx)(`span`,{className:MS,children:`Country code`}),(0,R.jsx)(`input`,{className:jS,value:c,onChange:e=>l(e.currentTarget.value),placeholder:`US`,disabled:b||g===`any`})]}),(0,R.jsxs)(`label`,{className:`block space-y-1.5`,children:[(0,R.jsx)(`span`,{className:MS,children:`Amount cap`}),(0,R.jsx)(`input`,{className:jS,value:u,onChange:e=>d(e.currentTarget.value),placeholder:`120.00`,required:!0,disabled:b})]}),(0,R.jsxs)(`label`,{className:`block space-y-1.5`,children:[(0,R.jsx)(`span`,{className:MS,children:`Currency`}),(0,R.jsx)(`input`,{className:jS,value:f,onChange:e=>p(e.currentTarget.value),placeholder:`USD`,required:!0,disabled:b})]}),(0,R.jsxs)(`label`,{className:`block space-y-1.5`,children:[(0,R.jsx)(`span`,{className:MS,children:`Frequency`}),(0,R.jsx)(`select`,{className:jS,value:m,onChange:e=>{let t=LS(FS,e.currentTarget.value);t&&h(t)},disabled:b||g===`any`,children:FS.map(e=>(0,R.jsx)(`option`,{value:e.value,children:e.label},e.value))})]}),(0,R.jsxs)(`label`,{className:`block space-y-1.5 sm:col-span-2`,children:[(0,R.jsx)(`span`,{className:MS,children:`Scope`}),(0,R.jsx)(`select`,{className:jS,value:g,onChange:e=>{let t=LS(IS,e.currentTarget.value);t&&_(t)},disabled:b,children:IS.map(e=>(0,R.jsx)(`option`,{value:e.value,children:e.label},e.value))})]}),(0,R.jsxs)(`label`,{className:`block space-y-1.5 sm:col-span-2`,children:[(0,R.jsx)(`span`,{className:MS,children:`Description`}),(0,R.jsx)(`input`,{className:jS,value:v,onChange:e=>y(e.currentTarget.value),placeholder:`Agent shopping budget`,required:!0,disabled:b})]})]}),S&&(0,R.jsx)(`p`,{className:`text-destructive text-sm`,children:S}),(0,R.jsx)(mb,{type:`submit`,variant:`outline`,disabled:b,children:b?`Setting up…`:`Set up mandate`})]}),w&&(0,R.jsx)(`div`,{className:`mt-4`,children:(0,R.jsx)(wS,{approval:w})})]}),(0,R.jsxs)(`div`,{children:[(0,R.jsx)(`p`,{className:`text-muted-foreground font-mono text-[11px] tracking-[0.18em] uppercase`,children:`Your mandates`}),te&&(0,R.jsx)(`p`,{className:`text-destructive mt-3 text-sm`,children:te}),ee&&E.length===0?(0,R.jsx)(`div`,{className:`mt-4 animate-pulse space-y-4`,"aria-hidden":`true`,children:[0,1].map(e=>(0,R.jsxs)(`div`,{className:`space-y-2`,children:[(0,R.jsx)(`div`,{className:`bg-hover-fill h-3.5 w-40 rounded`}),(0,R.jsx)(`div`,{className:`bg-hover-fill h-3 w-56 rounded`})]},e))}):E.length===0?(0,R.jsx)(`p`,{className:`text-muted-foreground mt-3 text-sm leading-6`,children:`No mandates yet.`}):(0,R.jsx)(`ul`,{className:`mt-3 space-y-1`,children:E.map(e=>{let t=re===e.pravaMandateId?k:null,n=!!e.mandateId&&e.status===`active`,r=!!e.mandateId&&e.status===`paused`,i=[n?`pause`:`resume`,`cancel`];return(0,R.jsxs)(`li`,{className:`py-2`,children:[(0,R.jsxs)(`div`,{className:`flex items-baseline justify-between gap-3`,children:[(0,R.jsx)(`p`,{className:`text-foreground truncate text-[14px]`,children:e.description?.trim()||e.merchantName?.trim()||`Spending mandate`}),(0,R.jsx)(`p`,{className:`text-muted-foreground shrink-0 text-[12px] capitalize`,children:e.status})]}),(0,R.jsxs)(`p`,{className:`text-muted-foreground mt-0.5 text-[12px]`,children:[e.approvedAmount,` `,e.currency,e.remaining!==void 0&&(0,R.jsxs)(R.Fragment,{children:[` · `,e.remaining,` remaining`]}),e.validUntil&&(0,R.jsxs)(R.Fragment,{children:[` · until `,e.validUntil]}),e.renewsAt&&(0,R.jsxs)(R.Fragment,{children:[` · renews `,e.renewsAt]})]}),(n||r)&&(0,R.jsx)(`div`,{className:`mt-1.5 flex flex-wrap items-center gap-x-3 gap-y-1`,children:i.map(n=>(0,R.jsx)(`button`,{type:`button`,className:NS,disabled:re!==null,onClick:()=>void le(e,n),children:t===n?PS[n].busy:PS[n].idle},n))})]},e.pravaMandateId)})})]})]})})]})}function zS({userId:e,desktopApi:t,openAiConfigured:n,chatGptStatus:r,chatGptLoading:i,chatGptStatusError:a,loading:o,loadError:s,onChatGptStatusChange:c,onConfigurationChange:l}){let u=Yn(Jp.providerCredentials.saveOpenAiKey),d=Yn(Jp.providerCredentials.removeOpenAiKey),[f,p]=(0,F.useState)(``),[m,h]=(0,F.useState)(!1),[g,_]=(0,F.useState)(!1),[v,y]=(0,F.useState)(!1),[b,x]=(0,F.useState)(null),[S,C]=(0,F.useState)(!1),[w,T]=(0,F.useState)(!1),[E,D]=(0,F.useState)(!1),[ee,O]=(0,F.useState)(null),[te,ne]=(0,F.useState)(null),re=(0,F.useRef)(null),ie=(0,F.useRef)(null),k=(0,F.useRef)(0),ae=r?.accounts.find(e=>e.connectionId===r.activeConnectionId)??null,A=(e,t)=>{re.current=t?{userId:e,login:t}:null,D(!!t),t||oe()};function oe(){ie.current?.close(),ie.current=null}function se(e,t){return OS(e)??t}function ce(e){t?.cancelChatGptBrowserLogin({userId:e.userId,state:e.login.state}).catch(()=>{})}function le(){k.current+=1;let e=re.current;return re.current=null,D(!1),oe(),T(!1),e}(0,F.useEffect)(()=>(D(!1),T(!1),ne(null),O(null),()=>{k.current+=1;let e=re.current;re.current=null,oe(),e&&t?.cancelChatGptBrowserLogin({userId:e.userId,state:e.login.state}).catch(()=>{})}),[t,e]);async function ue(e,n,r){for(;;){if(await new Promise(e=>setTimeout(e,1500)),r!==k.current)return;try{let i=await n.fetchChatGptBrowserLoginResult({userId:e.userId,state:e.login.state});if(r!==k.current)return;if(i.status===`pending`)continue;if(A(e.userId,null),T(!1),i.status===`error`){ne(i.error??`ChatGPT sign-in failed.`);return}let a=await n.fetchChatGptStatus({userId:e.userId});if(r!==k.current||n!==t)return;c(a);return}catch(t){if(r!==k.current)return;A(e.userId,null),T(!1),ne(se(pf(Error).catch(Error()).parse(t),`Couldn’t complete ChatGPT sign-in. Check your connection status.`));return}}}async function de(n){let r=t;if(!r||w)return;T(!0),D(!0),ne(null),O(null);let i=e,a=++k.current,o=window.sprocketDesktopBridge,s=null,c=null;try{if(!o){if(s=window.open(`about:blank`,`_blank`),ie.current=s,!s)throw Error(`Your browser blocked the sign-in window. Allow popups and try again.`);s.opener=null}let e=await r.startChatGptBrowserLogin(n?{userId:i,connectionId:n}:{userId:i});if(c={userId:i,login:e},a!==k.current){ce(c);return}if(o?await o.openExternal(e.authorizeUrl):s?.location.replace(e.authorizeUrl),a!==k.current){ce(c);return}A(i,e),ue(c,r,a)}catch(e){if(ie.current===s&&oe(),c&&ce(c),a!==k.current)return;D(!1),ne(se(pf(Error).catch(Error()).parse(e),`Couldn’t start ChatGPT sign-in.`)),T(!1)}}function fe(){let e=le();e&&ce(e)}async function pe(n){let r=t;if(!r||w)return;T(!0),ne(null),O(null);let i=e,a=++k.current;try{await r.selectChatGptAccount({userId:i,connectionId:n});let e=await r.fetchChatGptStatus({userId:i});if(a!==k.current||r!==t)return;c(e)}catch(e){if(a!==k.current)return;ne(se(pf(Error).catch(Error()).parse(e),`Couldn’t switch ChatGPT account.`))}finally{a===k.current&&T(!1)}}async function me(){let n=t;if(!n||w)return;let r=++k.current;T(!0),ne(null);try{let t=await n.fetchChatGptStatus({userId:e});r===k.current&&c(t)}catch(e){r===k.current&&ne(se(pf(Error).catch(Error()).parse(e),`Could not refresh ChatGPT status.`))}finally{r===k.current&&T(!1)}}async function he(n){let i=t;if(!i||w)return;let a=le();a&&ce(a),T(!0),ne(null),O(null);let o=e,s=++k.current;try{let e=await i.disconnectChatGptAccount({userId:o,connectionId:n});if(s!==k.current||i!==t)return;if(O(e),r){let e=r.activeConnectionId===n?null:r.activeConnectionId;c({accounts:r.accounts.filter(e=>e.connectionId!==n),activeConnectionId:e,loginAvailable:r.loginAvailable})}let a=await i.fetchChatGptStatus({userId:o});if(s!==k.current||i!==t)return;c(a)}catch(e){if(s!==k.current)return;ne(se(pf(Error).catch(Error()).parse(e),`Couldn’t sign out of ChatGPT.`))}finally{s===k.current&&T(!1)}}async function ge(e){if(e.preventDefault(),f.trim()&&!g){_(!0),x(null),C(!1);try{await u({apiKey:f}),p(``),h(!1),C(!0),l({provider:`openai`,configured:!0})}catch(e){x(se(pf(Error).catch(Error()).parse(e),`Couldn’t save the OpenAI key.`))}finally{_(!1)}}}async function _e(){if(!g){_(!0),x(null),C(!1);try{await d({}),y(!1),l({provider:`openai`,configured:!1})}catch(e){x(se(pf(Error).catch(Error()).parse(e),`Couldn’t remove the OpenAI key.`))}finally{_(!1)}}}let ve=i?`Checking connection…`:a?`Connection status unavailable`:ae?.connected?`Connected as ${ae.label}`:r&&r.accounts.length>0?`Signed out`:`Not connected`;return(0,R.jsxs)(`section`,{className:`flex h-full min-h-0 flex-col overflow-hidden`,children:[(0,R.jsx)(`header`,{className:`flex h-12 shrink-0 items-center px-6`,children:(0,R.jsx)(`h1`,{className:`text-foreground text-[1rem] font-medium tracking-[-0.03em]`,children:`BYOK/BYOS`})}),(0,R.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto px-6 py-8`,children:(0,R.jsxs)(`div`,{className:`max-w-xl space-y-4`,children:[(0,R.jsx)(`p`,{className:`text-muted-foreground mb-5 text-sm leading-6`,children:`Use your own API keys or subscriptions. ChatGPT credentials stay in a protected file on this computer. OpenAI API keys are encrypted in WorkOS Vault.`}),(0,R.jsxs)(`div`,{className:`border-border rounded-xl border p-5`,children:[(0,R.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,R.jsx)(Px,{provider:`openai`,className:`size-5`}),(0,R.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,R.jsx)(`p`,{className:`text-foreground text-[15px] font-medium`,children:`ChatGPT Subscription`}),(0,R.jsx)(`p`,{className:`text-muted-foreground mt-0.5 text-[12px]`,children:ve})]}),(0,R.jsx)(`button`,{type:`button`,className:`text-primary text-[13px] disabled:opacity-50`,disabled:!t||w||i,onClick:()=>void me(),children:`Refresh`})]}),E?(0,R.jsxs)(`div`,{className:`mt-5 flex items-center gap-3`,children:[(0,R.jsx)(`span`,{className:`text-muted-foreground text-[12px]`,children:`Signing in…`}),(0,R.jsx)(`button`,{type:`button`,className:`text-muted-foreground text-[13px]`,onClick:fe,children:`Cancel`})]}):(0,R.jsxs)(`div`,{className:`mt-5 space-y-4`,children:[r&&r.accounts.length>0&&(0,R.jsx)(`ul`,{className:`space-y-2`,children:r.accounts.map(e=>{let t=e.connectionId===r.activeConnectionId;return(0,R.jsxs)(`li`,{className:`border-border flex items-center gap-3 rounded-lg border px-3 py-2`,children:[(0,R.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,R.jsx)(`p`,{className:`text-foreground truncate text-[13px] font-medium`,children:e.label}),(0,R.jsx)(`p`,{className:`text-muted-foreground text-[12px]`,children:t?`Active`:e.connected?`Signed in`:`Signed out`})]}),!t&&e.connected&&(0,R.jsx)(`button`,{type:`button`,className:`text-primary text-[13px] disabled:opacity-50`,disabled:w,onClick:()=>void pe(e.connectionId),children:`Use`}),!e.connected&&(0,R.jsx)(`button`,{type:`button`,className:`text-primary text-[13px] disabled:opacity-50`,disabled:w||!r.loginAvailable,onClick:()=>void de(e.connectionId),children:`Reconnect`}),(0,R.jsx)(`button`,{type:`button`,className:`text-muted-foreground hover:text-foreground text-[13px] disabled:opacity-50`,disabled:w,onClick:()=>void he(e.connectionId),children:`Sign out`})]},e.connectionId)})}),r?.loginAvailable===!1?(0,R.jsx)(`p`,{className:`text-muted-foreground text-[12px] leading-5`,children:`ChatGPT sign-in runs through the local Sprocket server, which isn’t available for this window. Open Sprocket on your desktop to sign in.`}):(0,R.jsx)(mb,{disabled:w||i||!t,onclick:()=>void de(),children:w?`Starting…`:r?.accounts.length?`Add account`:`Continue with ChatGPT`})]}),ee&&(0,R.jsx)(`p`,{className:`text-muted-foreground mt-4 text-[12px]`,role:`status`,children:ee}),(0,R.jsx)(`p`,{className:`text-muted-foreground mt-4 text-[12px] leading-5`,children:`Usage counts against your ChatGPT Codex allowance.`}),te&&(0,R.jsx)(`p`,{className:`text-destructive mt-4 text-sm`,role:`alert`,children:te}),a&&(0,R.jsx)(`p`,{className:`text-destructive mt-4 text-sm`,role:`alert`,children:a})]}),(0,R.jsxs)(`div`,{className:`border-border rounded-xl border p-5`,children:[(0,R.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,R.jsx)(Px,{provider:`openai`,className:`size-5`}),(0,R.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,R.jsx)(`p`,{className:`text-foreground text-[15px] font-medium`,children:`OpenAI API`}),(0,R.jsx)(`p`,{className:`text-muted-foreground mt-0.5 text-[12px]`,children:o?`Checking configuration…`:n?`Connected`:`Not configured`})]})]}),(0,R.jsxs)(`form`,{className:`mt-5 space-y-3`,onSubmit:e=>void ge(e),children:[(0,R.jsxs)(`label`,{className:`block space-y-1.5`,children:[(0,R.jsx)(`span`,{className:`text-muted-foreground text-[12px]`,children:`API key`}),(0,R.jsxs)(`div`,{className:`relative`,children:[(0,R.jsx)(`input`,{type:m?`text`:`password`,value:f,onChange:e=>p(e.currentTarget.value),autoComplete:`off`,spellCheck:!1,placeholder:n?`Enter a replacement key`:`sk-…`,disabled:g||o,className:`border-border bg-hover-fill text-foreground placeholder:text-muted-foreground focus:border-ring h-10 w-full rounded-lg border pr-10 pl-3 font-mono text-[13px] outline-none disabled:opacity-50`}),(0,R.jsx)(`button`,{type:`button`,className:`text-muted-foreground hover:text-foreground absolute inset-y-0 right-0 flex w-10 items-center justify-center`,"aria-label":m?`Hide API key`:`Show API key`,disabled:g||o,onClick:()=>h(e=>!e),children:m?(0,R.jsx)(h_,{className:`size-4`}):(0,R.jsx)(__,{className:`size-4`})})]})]}),(0,R.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3`,children:[(0,R.jsx)(mb,{type:`submit`,disabled:g||o||!f.trim(),children:g?`Saving…`:n?`Replace key`:`Connect API key`}),n&&!v?(0,R.jsx)(mb,{type:`button`,variant:`outline`,disabled:g,onclick:()=>y(!0),children:`Remove`}):v?(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(mb,{type:`button`,variant:`outline`,disabled:g,onclick:()=>void _e(),children:g?`Removing…`:`Confirm removal`}),(0,R.jsx)(`button`,{type:`button`,className:`text-muted-foreground hover:text-foreground text-[13px]`,disabled:g,onClick:()=>y(!1),children:`Cancel`})]}):null,S&&(0,R.jsx)(`span`,{className:`text-muted-foreground text-[12px]`,children:`Saved`})]})]}),b&&(0,R.jsx)(`p`,{className:`text-destructive mt-4 text-sm`,role:`alert`,children:b})]}),s&&(0,R.jsx)(`p`,{className:`text-destructive text-sm`,role:`alert`,children:s})]})})]})}var BS=[{id:`general`,label:`General`,icon:dv},{id:`account`,label:`Account`,icon:kv},{id:`usage`,label:`Usage`,icon:Vg},{id:`providers`,label:`BYOK/BYOS`,icon:L_},{id:`payments`,label:`Payments`,icon:a_}],VS=`flex w-full items-center gap-2.5 rounded-lg px-2.5 py-1.5 text-left text-[13px] transition`,HS=`bg-hover-fill-strong text-foreground`,US=`text-muted-foreground hover:bg-hover-fill hover:text-foreground`;function WS({activePage:e,theme:t,onThemeChange:n,onBack:r,onNavigate:i}){return(0,R.jsx)(`aside`,{className:`app-sidebar-panel`,children:(0,R.jsxs)(`div`,{className:`flex h-full min-h-0 flex-col overflow-hidden`,children:[(0,R.jsxs)(`div`,{className:`flex items-center justify-between gap-2 px-3.5 pt-3 pb-3`,children:[(0,R.jsxs)(`button`,{type:`button`,className:`text-muted-foreground hover:text-foreground hover:bg-hover-fill inline-flex h-8 items-center gap-2 rounded-lg px-2 text-[13px] transition`,onClick:r,children:[(0,R.jsx)(kg,{className:`size-3.5`,"aria-hidden":`true`}),`Back`]}),(0,R.jsx)(hS,{theme:t,onThemeChange:n})]}),(0,R.jsx)(`nav`,{className:`hide-scrollbar min-h-0 flex-1 space-y-0.5 overflow-y-auto px-2.5 pb-4`,"aria-label":`Settings`,children:BS.map(t=>(0,R.jsxs)(`button`,{type:`button`,className:`${VS} ${e===t.id?HS:US}`,"aria-current":e===t.id?`page`:void 0,onClick:()=>{i(t.id)},children:[(0,R.jsx)(t.icon,{className:`text-muted-foreground size-4 shrink-0`,"aria-hidden":`true`}),(0,R.jsx)(`span`,{className:`truncate`,children:t.label})]},t.id))})]})})}var GS=[{id:`modelUsage`,label:`Model usage`,noun:`model usage`,description:`More expensive models use up more usage.`}],KS=[`weekly`,`monthly`],qS=1e9,JS=new Intl.NumberFormat(`en-US`,{style:`currency`,currency:`USD`,minimumFractionDigits:2,maximumFractionDigits:2}),YS={weekly:`Weekly`,monthly:`Monthly`};function XS(e){return JS.format(e/qS)}function ZS(e,t){return e?`bg-rose-400/90`:t?`bg-amber-400/90`:`bg-foreground/25`}function QS(){let e=cr(),t=sx(),n=qn({query:Jp.usage.getMyUsage,args:e.isAuthenticated&&!e.isLoading?{now:t}:`skip`}),r=n.status===`success`?n.data:null,i=n.status===`error`;return(0,R.jsxs)(`section`,{className:`flex h-full min-h-0 flex-col overflow-hidden`,children:[(0,R.jsx)(`header`,{className:`flex h-12 shrink-0 items-center px-6`,children:(0,R.jsx)(`h1`,{className:`text-foreground text-[1rem] font-medium tracking-[-0.03em]`,children:`Usage`})}),(0,R.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto px-6 py-8`,children:(0,R.jsx)(`div`,{className:`max-w-xl space-y-10`,children:i?(0,R.jsx)(`p`,{className:`text-muted-foreground text-sm leading-6`,children:`Couldn’t load your usage right now. Try again in a moment.`}):r===null?(0,R.jsxs)(`div`,{className:`animate-pulse space-y-10`,"aria-hidden":`true`,children:[(0,R.jsx)(`div`,{className:`bg-hover-fill h-4 w-24 rounded`}),GS.map(e=>(0,R.jsxs)(`div`,{className:`space-y-5`,children:[(0,R.jsx)(`div`,{className:`bg-hover-fill h-3 w-28 rounded`}),KS.map(e=>(0,R.jsxs)(`div`,{className:`space-y-2`,children:[(0,R.jsx)(`div`,{className:`bg-hover-fill h-3.5 w-full rounded`}),(0,R.jsx)(`div`,{className:`bg-hover-fill h-1.5 w-full rounded-full`})]},e))]},e.id))]}):(0,R.jsxs)(R.Fragment,{children:[(0,R.jsxs)(`div`,{children:[(0,R.jsx)(`p`,{className:`text-muted-foreground text-[11px] tracking-[0.18em] uppercase`,children:`Subscription Tier`}),(0,R.jsx)(`p`,{className:`text-foreground mt-3 text-[15px]`,children:r.tierLabel})]}),r.meters.map(e=>(0,R.jsxs)(`div`,{children:[(0,R.jsx)(`p`,{className:`text-muted-foreground text-[11px] tracking-[0.18em] uppercase`,children:e.label}),e.description&&(0,R.jsx)(`p`,{className:`text-muted-foreground mt-1 text-[12px]`,children:e.description}),(0,R.jsx)(`div`,{className:`mt-4 space-y-6`,children:e.windows.map(n=>{let r=n.limit>0,i=r?Math.round(n.used/n.limit*100):0,a=r&&n.used>=n.limit,o=r&&n.used>=n.limit*.9;return(0,R.jsxs)(`div`,{children:[(0,R.jsxs)(`div`,{className:`flex items-baseline justify-between gap-3`,children:[(0,R.jsx)(`p`,{className:`text-muted-foreground text-[13px]`,children:YS[n.period]}),r&&(0,R.jsxs)(`p`,{className:`text-[12px] ${a?`text-destructive`:o?`text-amber-800 dark:text-amber-300`:`text-muted-foreground`}`,children:[i,`% used`]})]}),(0,R.jsxs)(`p`,{className:`text-muted-foreground mt-0.5 text-[12px]`,children:[XS(r?n.used:0),` /`,` `,XS(r?n.limit:0)]}),(0,R.jsx)(`div`,{className:`bg-hover-fill mt-2 h-1.5 overflow-hidden rounded-full`,role:`progressbar`,"aria-label":`${e.label} — ${YS[n.period]}`,"aria-valuemin":0,"aria-valuemax":r?n.limit:0,"aria-valuenow":r?Math.min(n.used,n.limit):0,"aria-valuetext":r?`${i}% used`:`0 / 0`,children:(0,R.jsx)(`div`,{className:`h-full rounded-full transition-[width] duration-300 ${ZS(a,o)}`,style:{width:`${r?Math.min(100,Math.max(0,i)):0}%`}})}),n.resetsAt!==null&&(0,R.jsxs)(`p`,{className:`text-muted-foreground mt-1.5 text-[12px]`,children:[`Resets in `,ax(n.resetsAt-t)]})]},n.period)})})]},e.id))]})})})]})}function $S(e){return Object.prototype.toString.call(e)===`[object String]`&&!(e instanceof String)}function eC(e){return e!=null&&!Array.isArray(e)&&Object(e)===e}var tC=P.union(P.string(),P.number(),P.boolean(),P.null()),nC=8;function rC(e){return e===0?tC:P.union(tC,P.array(rC(e-1)),P.record(P.string(),rC(e-1)))}var iC=rC(nC);function aC(e){if(eC(e)&&$S(e.error)&&(e.status===`cancelled`||e.status===`failed`))return{error:e.error,status:e.status}}function oC(e){let t=``,n,r=!1;for(let i of e)i.type===`text`&&i.text.length!==0&&(r&&n!==void 0&&i.turnId!==void 0&&i.turnId!==n&&(t+=`
75
75
 
76
- `),t+=i.text,i.turnId!==void 0&&(n=i.turnId),r=!0);return t}function oC(e,t){let n=new Map,r=new Set,i=t.filter(t=>{if(!t.callId)return!0;let i=e.find(e=>e.callId===t.callId&&!r.has(e.callId));return i?(n.set(t.id,i.callId),r.add(i.callId),!1):!1}),a=t=>{let a=e.filter(e=>!r.has(e.callId)),o=new Map(i.flatMap(e=>n.has(e.id)?[]:[[e.id,a.filter(n=>t(n,e))]]));for(let e of i){if(n.has(e.id))continue;let t=o.get(e.id)??[];if(t.length!==1)continue;let[a]=t;i.filter(e=>!n.has(e.id)&&(o.get(e.id)??[]).some(e=>e.callId===a.callId)).length===1&&(n.set(e.id,a.callId),r.add(a.callId))}};return a((e,t)=>e.name===t.kind&&sC(e.input,t.payload)),a((e,t)=>e.name===t.kind),n}function sC(e,t){if(Object.is(e,t))return!0;if(Array.isArray(e)||Array.isArray(t))return Array.isArray(e)&&Array.isArray(t)&&e.length===t.length&&e.every((e,n)=>sC(e,t[n]));if(!$S(e)||!$S(t))return!1;let n=Object.keys(e),r=Object.keys(t);return n.length===r.length&&n.every(n=>Object.hasOwn(t,n)&&sC(e[n],t[n]))}var cC=new Set([`exec_cmd`,`exec_command`]),lC=new Set([`control_cmd`,`control_command`,`poll_cmd`,`poll_command`,`write_stdin`]);function uC(e){return cC.has(e)}function dC(e){return lC.has(e)}function fC(e){return uC(e)||dC(e)}function pC(e){return QS(e)?e:void 0}function mC(e,t){return $S(e)?pC(e[t]):void 0}function hC(e,t){return e.runId===t}function gC(e){return e.name||e.job?.kind||`tool`}function _C(e){let t=[];for(let n of e){if(n.type===`text`||n.type===`reasoning`){t.push(n);continue}let e=gC(n),r=t.at(-1);if(r?.type===`tool-group`&&r.toolKey===e){r.tools.push(n);continue}t.push({type:`tool-group`,toolKey:e,tools:[n]})}return t}function vC(e){return`${e.type}:${e.turnId??``}:${e.id}`}function yC(e){return e.type===`reasoning`?vC(e):e.tools[0]?.callId??e.toolKey}function bC(e){let t=[];for(let n of e){if(n.type===`text`){t.push(n);continue}let e=t.at(-1);if(e?.type===`work`){e.blocks.push(n);continue}t.push({type:`work`,key:yC(n),blocks:[n]})}return t}function xC(e,t){let n,r=t.endedAt;for(let i of e.blocks){let e=i.type===`tool-group`?i.tools:[i];for(let i of e){if(i.startedAt==null)return{};if(n=Math.min(n??i.startedAt,i.startedAt),!t.inProgress){let e=i.completedAt??t.endedAt;if(e===void 0)return{};r=Math.max(r??e,e)}}}return t.inProgress?{startedAtMs:n}:{startedAtMs:n,completedAtMs:r}}function SC(e){return e.output===void 0?!e.job||e.job.status===`pending`||e.job.status===`claimed`:!1}function CC(e){let t=gC(e);return fC(t)||t===`ask_question`||t===`await_question`||t===`poll_question`||t===`spawn_subagent`||t===`control_subagent`||t===`poll_subagent`}function wC(e,t){return t&&CC(e)&&SC(e)}function TC(e){return mC(e.output,`sessionId`)??mC(e.input,`sessionId`)??mC(e.job?.payload,`sessionId`)}function EC(e){let t=new Map;for(let n of e){let e=TC(n);if(!e)continue;let r=mC(n.output,`command`)??(uC(gC(n))?mC(n.input,`cmd`)??mC(n.job?.payload,`cmd`):void 0);r&&t.set(e,r)}return t}function DC(e,t){let n=TC(e);return mC(e.output,`command`)??(n?t.get(n):void 0)}function OC(e,t){let n=[],r=[];for(let i of e){if(i.type===`reasoning`){n.push(i);continue}let e=[];for(let n of i.tools)wC(n,t)?r.push(n):(!t||!SC(n))&&e.push(n);e.length>0&&n.push({type:`tool-group`,toolKey:i.toolKey,tools:e})}return{settledBlocks:n,runningTools:r}}function kC(e,t){return!t&&SC(e)?`interrupted`:e.job?.status===`cancelled`||e.job?.status===`failed`?e.job.status:iC(e.output)?.status}function AC(e,t){if(!t&&SC(e))return`The agent stopped before this tool call finished.`;let n=iC(e.output)?.error;return e.job?e.job.status===`cancelled`?e.job.error??n??`Tool stopped before completion.`:e.job.status===`failed`?e.job.error??n??`Executor job failed.`:void 0:n}function jC(e,t){let n=new Map;e.forEach(e=>{e.type===`tool-result`&&n.set(e.callId,e)});let r=oC(e.filter(e=>e.type===`tool-call`),t.map(e=>({id:e._id,kind:e.kind,callId:e.callId,payload:e.payload}))),i=new Map;for(let e of t){let t=r.get(e._id);t&&i.set(t,e)}let a=[],o=new Set;for(let t of e){if(t.type===`tool-result`)continue;if(t.type===`reasoning`||t.type===`text`){t.text.trim().length>0&&a.push(t);continue}let e=n.get(t.callId),r=i.get(t.callId);r&&o.add(r._id);let s={type:`tool`,callId:t.callId,name:t.name,input:t.input,startedAt:t.startedAt??r?.enqueuedAt,completedAt:e?.completedAt??r?.completedAt};e?s.output=e.output:r?.result!==void 0&&(s.output=r.result),r&&(s.job=r),a.push(s)}for(let e of t){if(o.has(e._id))continue;let t={type:`tool`,callId:e.callId??`executor-job:${e._id}`,name:e.kind,input:e.payload,startedAt:e.enqueuedAt,completedAt:e.completedAt,job:e};e.result!==void 0&&(t.output=e.result),a.push(t)}return a}function MC(e){return e.type===`reasoning`?[vC(e)]:e.tools.map(e=>`tool:${e.callId}`)}var NC=class{messages=new Map;nextId=0;retain(e){let t=new Set(e);for(let e of this.messages.keys())t.has(e)||this.messages.delete(e)}reconcile(e,t){let n=this.reconcileMembers(e,t.map(e=>e.type===`text`?[vC(e)]:e.blocks.flatMap(MC)));return t.map((e,t)=>({...e,renderKey:e.type===`text`?vC(e):n[t]}))}reconcileBlocks(e,t){let n=this.reconcileMembers(e,t.map(MC));return t.map((e,t)=>({block:e,renderKey:n[t]}))}reconcileMembers(e,t){let n=this.messages.get(e),r=new Map,i=new Set,a=t.map(e=>{let t=e.map(e=>n?.get(e)).find(e=>e!==void 0&&!i.has(e))??`work:${this.nextId++}`;i.add(t);for(let n of e)r.set(n,t);return t});return this.messages.set(e,r),a}};function PC(e,t){this.v=e,this.k=t}function FC(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function IC(e){if(Array.isArray(e))return e}function LC(e,t){var n=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n!=null){var r,i,a,o,s=[],c=!0,l=!1;try{if(a=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}function RC(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
77
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function zC(e,t){return IC(e)||LC(e,t)||BC(e,t)||RC()}function BC(e,t){if(e){if(typeof e==`string`)return FC(e,t);var n={}.toString.call(e).slice(8,-1);return n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`?Array.from(e):n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?FC(e,t):void 0}}function VC(e){var t,n;function r(t,n){try{var a=e[t](n),o=a.value,s=o instanceof PC;Promise.resolve(s?o.v:o).then(function(n){if(s){var c=t===`return`&&o.k?t:`next`;if(!o.k||n.done)return r(c,n);n=e[c](n).value}i(!!a.done,n)},function(e){r(`throw`,e)})}catch(e){i(2,e)}}function i(e,i){e===2?t.reject(i):t.resolve({value:i,done:e}),(t=t.next)?r(t.key,t.arg):n=null}this._invoke=function(e,i){return new Promise(function(a,o){var s={key:e,arg:i,resolve:a,reject:o,next:null};n?n=n.next=s:(t=n=s,r(e,i))})},typeof e.return!=`function`&&(this.return=void 0)}VC.prototype[typeof Symbol==`function`&&Symbol.asyncIterator||`@@asyncIterator`]=function(){return this},VC.prototype.next=function(e){return this._invoke(`next`,e)},VC.prototype.throw=function(e){return this._invoke(`throw`,e)},VC.prototype.return=function(e){return this._invoke(`return`,e)};var HC=Object.entries,UC=Object.setPrototypeOf,WC=Object.isFrozen,GC=Object.getPrototypeOf,KC=Object.getOwnPropertyDescriptor,qC=Object.freeze,JC=Object.seal,YC=Object.create,XC=typeof Reflect<`u`&&Reflect,ZC=XC.apply,QC=XC.construct;qC||=function(e){return e},JC||=function(e){return e},ZC||=function(e,t){var n=[...arguments].slice(2);return e.apply(t,n)},QC||=function(e){return new e(...[...arguments].slice(1))};var $C=yw(Array.prototype.forEach);Array.prototype.indexOf;var ew=yw(Array.prototype.lastIndexOf),tw=yw(Array.prototype.pop),nw=yw(Array.prototype.push);Array.prototype.slice;var rw=yw(Array.prototype.splice),iw=Array.isArray,aw=yw(String.prototype.toLowerCase),ow=yw(String.prototype.toString),sw=yw(String.prototype.match),cw=yw(String.prototype.replace),lw=yw(String.prototype.indexOf),uw=yw(String.prototype.trim),dw=yw(Number.prototype.toString),fw=yw(Boolean.prototype.toString),pw=typeof BigInt>`u`?null:yw(BigInt.prototype.toString),mw=typeof Symbol>`u`?null:yw(Symbol.prototype.toString),hw=yw(Object.prototype.hasOwnProperty),gw=yw(Object.prototype.toString),_w=yw(RegExp.prototype.test),vw=bw(TypeError);function yw(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);var n=[...arguments].slice(1);return ZC(e,t,n)}}function bw(e){return function(){return QC(e,[...arguments])}}function xw(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:aw;if(UC&&UC(e,null),!iw(t))return e;let r=t.length;for(;r--;){let i=t[r];if(typeof i==`string`){let e=n(i);e!==i&&(WC(t)||(t[r]=e),i=e)}e[i]=!0}return e}function Sw(e){for(let t=0;t<e.length;t++)hw(e,t)||(e[t]=null);return e}function Cw(e){let t=YC(null);for(let r of HC(e)){var n=zC(r,2);let i=n[0],a=n[1];hw(e,i)&&(t[i]=iw(a)?Sw(a):a&&typeof a==`object`&&a.constructor===Object?Cw(a):a)}return t}function ww(e){switch(typeof e){case`string`:return e;case`number`:return dw(e);case`boolean`:return fw(e);case`bigint`:return pw?pw(e):`0`;case`symbol`:return mw?mw(e):`Symbol()`;case`undefined`:return gw(e);case`function`:case`object`:{if(e===null)return gw(e);let t=e,n=Tw(t,`toString`);if(typeof n==`function`){let e=n(t);return typeof e==`string`?e:gw(e)}return gw(e)}default:return gw(e)}}function Tw(e,t){for(;e!==null;){let n=KC(e,t);if(n){if(n.get)return yw(n.get);if(typeof n.value==`function`)return yw(n.value)}e=GC(e)}function n(){return null}return n}function Ew(e){try{return _w(e,``),!0}catch{return!1}}var Dw=qC(`a.abbr.acronym.address.area.article.aside.audio.b.bdi.bdo.big.blink.blockquote.body.br.button.canvas.caption.center.cite.code.col.colgroup.content.data.datalist.dd.decorator.del.details.dfn.dialog.dir.div.dl.dt.element.em.fieldset.figcaption.figure.font.footer.form.h1.h2.h3.h4.h5.h6.head.header.hgroup.hr.html.i.img.input.ins.kbd.label.legend.li.main.map.mark.marquee.menu.menuitem.meter.nav.nobr.ol.optgroup.option.output.p.picture.pre.progress.q.rp.rt.ruby.s.samp.search.section.select.shadow.slot.small.source.spacer.span.strike.strong.style.sub.summary.sup.table.tbody.td.template.textarea.tfoot.th.thead.time.tr.track.tt.u.ul.var.video.wbr`.split(`.`)),Ow=qC(`svg.a.altglyph.altglyphdef.altglyphitem.animatecolor.animatemotion.animatetransform.circle.clippath.defs.desc.ellipse.enterkeyhint.exportparts.filter.font.g.glyph.glyphref.hkern.image.inputmode.line.lineargradient.marker.mask.metadata.mpath.part.path.pattern.polygon.polyline.radialgradient.rect.stop.style.switch.symbol.text.textpath.title.tref.tspan.view.vkern`.split(`.`)),kw=qC([`feBlend`,`feColorMatrix`,`feComponentTransfer`,`feComposite`,`feConvolveMatrix`,`feDiffuseLighting`,`feDisplacementMap`,`feDistantLight`,`feDropShadow`,`feFlood`,`feFuncA`,`feFuncB`,`feFuncG`,`feFuncR`,`feGaussianBlur`,`feImage`,`feMerge`,`feMergeNode`,`feMorphology`,`feOffset`,`fePointLight`,`feSpecularLighting`,`feSpotLight`,`feTile`,`feTurbulence`]),Aw=qC([`animate`,`color-profile`,`cursor`,`discard`,`font-face`,`font-face-format`,`font-face-name`,`font-face-src`,`font-face-uri`,`foreignobject`,`hatch`,`hatchpath`,`mesh`,`meshgradient`,`meshpatch`,`meshrow`,`missing-glyph`,`script`,`set`,`solidcolor`,`unknown`,`use`]),jw=qC(`math.menclose.merror.mfenced.mfrac.mglyph.mi.mlabeledtr.mmultiscripts.mn.mo.mover.mpadded.mphantom.mroot.mrow.ms.mspace.msqrt.mstyle.msub.msup.msubsup.mtable.mtd.mtext.mtr.munder.munderover.mprescripts`.split(`.`)),Mw=qC([`maction`,`maligngroup`,`malignmark`,`mlongdiv`,`mscarries`,`mscarry`,`msgroup`,`mstack`,`msline`,`msrow`,`semantics`,`annotation`,`annotation-xml`,`mprescripts`,`none`]),Nw=qC([`#text`]),Pw=qC(`accept.action.align.alt.autocapitalize.autocomplete.autopictureinpicture.autoplay.background.bgcolor.border.capture.cellpadding.cellspacing.checked.cite.class.clear.color.cols.colspan.command.commandfor.controls.controlslist.coords.crossorigin.datetime.decoding.default.dir.disabled.disablepictureinpicture.disableremoteplayback.download.draggable.enctype.enterkeyhint.exportparts.face.for.headers.height.hidden.high.href.hreflang.id.inert.inputmode.integrity.ismap.kind.label.lang.list.loading.loop.low.max.maxlength.media.method.min.minlength.multiple.muted.name.nonce.noshade.novalidate.nowrap.open.optimum.part.pattern.placeholder.playsinline.popover.popovertarget.popovertargetaction.poster.preload.pubdate.radiogroup.readonly.rel.required.rev.reversed.role.rows.rowspan.spellcheck.scope.selected.shape.size.sizes.slot.span.srclang.start.src.srcset.step.style.summary.tabindex.title.translate.type.usemap.valign.value.width.wrap.xmlns`.split(`.`)),Fw=qC(`accent-height.accumulate.additive.alignment-baseline.amplitude.ascent.attributename.attributetype.azimuth.basefrequency.baseline-shift.begin.bias.by.class.clip.clippathunits.clip-path.clip-rule.color.color-interpolation.color-interpolation-filters.color-profile.color-rendering.cx.cy.d.dx.dy.diffuseconstant.direction.display.divisor.dominant-baseline.dur.edgemode.elevation.end.exponent.fill.fill-opacity.fill-rule.filter.filterunits.flood-color.flood-opacity.font-family.font-size.font-size-adjust.font-stretch.font-style.font-variant.font-weight.fx.fy.g1.g2.glyph-name.glyphref.gradientunits.gradienttransform.height.href.id.image-rendering.in.in2.intercept.k.k1.k2.k3.k4.kerning.keypoints.keysplines.keytimes.lang.lengthadjust.letter-spacing.kernelmatrix.kernelunitlength.lighting-color.local.marker-end.marker-mid.marker-start.markerheight.markerunits.markerwidth.maskcontentunits.maskunits.max.mask.mask-type.media.method.mode.min.name.numoctaves.offset.operator.opacity.order.orient.orientation.origin.overflow.paint-order.path.pathlength.patterncontentunits.patterntransform.patternunits.pointer-events.points.preservealpha.preserveaspectratio.primitiveunits.r.rx.ry.radius.refx.refy.repeatcount.repeatdur.restart.result.rotate.scale.seed.shape-rendering.slope.specularconstant.specularexponent.spreadmethod.startoffset.stddeviation.stitchtiles.stop-color.stop-opacity.stroke-dasharray.stroke-dashoffset.stroke-linecap.stroke-linejoin.stroke-miterlimit.stroke-opacity.stroke.stroke-width.style.surfacescale.systemlanguage.tabindex.tablevalues.targetx.targety.transform.transform-origin.text-anchor.text-decoration.text-orientation.text-rendering.textlength.type.u1.u2.unicode.values.vector-effect.viewbox.visibility.version.vert-adv-y.vert-origin-x.vert-origin-y.width.word-spacing.wrap.writing-mode.xchannelselector.ychannelselector.x.x1.x2.xmlns.y.y1.y2.z.zoomandpan`.split(`.`)),Iw=qC(`accent.accentunder.align.bevelled.close.columnalign.columnlines.columnspacing.columnspan.denomalign.depth.dir.display.displaystyle.encoding.fence.frame.height.href.id.largeop.length.linethickness.lquote.lspace.mathbackground.mathcolor.mathsize.mathvariant.maxsize.minsize.movablelimits.notation.numalign.open.rowalign.rowlines.rowspacing.rowspan.rspace.rquote.scriptlevel.scriptminsize.scriptsizemultiplier.selection.separator.separators.stretchy.subscriptshift.supscriptshift.symmetric.voffset.width.xmlns`.split(`.`)),Lw=qC([`xlink:href`,`xml:id`,`xlink:title`,`xml:space`,`xmlns:xlink`]),Rw=JC(/{{[\w\W]*|^[\w\W]*}}/g),zw=JC(/<%[\w\W]*|^[\w\W]*%>/g),Bw=JC(/\${[\w\W]*/g),Vw=JC(/^data-[\-\w.\u00B7-\uFFFF]+$/),Hw=JC(/^aria-[\-\w]+$/),Uw=JC(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Ww=JC(/^(?:\w+script|data):/i),Gw=JC(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Kw=JC(/^html$/i),qw=JC(/^[a-z][.\w]*(-[.\w]+)+$/i),Jw=JC(/<[/\w!]/g),Yw=JC(/<[/\w]/g),Xw=JC(/<\/no(script|embed|frames)/i),Zw=JC(/\/>/i),Qw={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,processingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},$w=[`style`,`script`,`xmp`,`iframe`,`noembed`,`noframes`,`plaintext`,`noscript`],eT=qC(xw({},$w)),tT=function(){let e={};return $C($w,t=>{e[t]=JC(RegExp(`</`+t+`(?=[\\t\\n\\f\\r />])`,`i`))}),qC(e)}(),nT=function(){return typeof window>`u`?null:window},rT=function(e,t){if(typeof e!=`object`||typeof e.createPolicy!=`function`)return null;let n=null,r=`data-tt-policy-suffix`;t&&t.hasAttribute(r)&&(n=t.getAttribute(r));let i=`dompurify`+(n?`#`+n:``);try{return e.createPolicy(i,{createHTML(e){return e},createScriptURL(e){return e}})}catch{return console.warn(`TrustedTypes policy `+i+` could not be created.`),null}},iT=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},aT=function(e,t,n,r){return hw(e,t)&&iw(e[t])?xw(r.base?Cw(r.base):{},e[t],r.transform):n},oT=function(e,t,n){let r=hw(e,t)?e[t]:void 0;return r&&typeof r==`object`?Cw(r):n()};function sT(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:nT(),t=e=>sT(e);if(t.version=`3.4.16`,t.removed=[],!e||!e.document||e.document.nodeType!==Qw.document||!e.Element)return t.isSupported=!1,t;let n=e.document,r=n,i=r.currentScript;e.DocumentFragment;let a=e.HTMLTemplateElement,o=e.Node,s=e.Element,c=e.NodeFilter;e.NamedNodeMap===void 0&&(e.NamedNodeMap||e.MozNamedAttrMap),e.HTMLFormElement;let l=e.DOMParser,u=e.trustedTypes,d=s.prototype,f=Tw(d,`cloneNode`),p=Tw(d,`remove`),m=Tw(d,`removeAttributeNode`),h=Tw(d,`nextSibling`),g=Tw(d,`childNodes`),_=Tw(d,`parentNode`),v=Tw(d,`shadowRoot`),y=Tw(d,`attributes`),b=o&&o.prototype?Tw(o.prototype,`nodeType`):null,x=o&&o.prototype?Tw(o.prototype,`nodeName`):null,S=o&&o.prototype?Tw(o.prototype,`ownerDocument`):null,C=function(e){return b?b(e):e.nodeType},w=function(e){return x?x(e):e.nodeName};if(typeof a==`function`){let e=n.createElement(`template`);e.content&&e.content.ownerDocument&&(n=e.content.ownerDocument)}let T,E=``,D,ee=!1,O=0,te=function(){if(O>0)throw vw(`A configured TRUSTED_TYPES_POLICY callback (createHTML or createScriptURL) must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose callbacks wrap DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted Types" section of the README.`)},ne=function(e){te(),O++;try{return T.createHTML(e)}finally{O--}},re=function(e){te(),O++;try{return T.createScriptURL(e)}finally{O--}},ie=function(){return ee||=(D=rT(u,i),!0),D},k=n,ae=k.implementation,A=k.createNodeIterator,oe=k.createDocumentFragment,se=k.getElementsByTagName,ce=r.importNode,le=iT();t.isSupported=typeof HC==`function`&&typeof _==`function`&&ae&&ae.createHTMLDocument!==void 0;let ue=Rw,de=zw,fe=Bw,pe=Vw,me=Hw,he=Ww,ge=Gw,_e=qw,ve=Uw,ye=null,j=xw({},[...Dw,...Ow,...kw,...jw,...Nw]),M=null,be=xw({},[...Pw,...Fw,...Iw,...Lw]),xe=Object.seal(YC(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),N=null,Se=null,Ce=Object.seal(YC(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}})),we=!0,Te=!0,Ee=!1,De=!0,Oe=!1,ke=!0,Ae=!1,je=!1,Me=null,Ne=null,Pe=!1,Fe=!1,Ie=!1,Le=!1,Re=!0,ze=!1,Be=`user-content-`,Ve=!0,He=!1,P={},Ue=null,We=xw({},`annotation-xml.audio.colgroup.desc.foreignobject.head.iframe.math.mi.mn.mo.ms.mtext.noembed.noframes.noscript.plaintext.script.selectedcontent.style.svg.template.thead.title.video.xmp`.split(`.`)),Ge=null,Ke=xw({},[`audio`,`video`,`img`,`source`,`image`,`track`]),qe=null,Je=xw({},[`alt`,`class`,`for`,`id`,`label`,`name`,`pattern`,`placeholder`,`role`,`summary`,`title`,`value`,`style`,`xmlns`]),Ye=`http://www.w3.org/1998/Math/MathML`,Xe=`http://www.w3.org/2000/svg`,Ze=`http://www.w3.org/1999/xhtml`,Qe=Ze,$e=!1,et=null,tt=xw({},[Ye,Xe,Ze],ow),nt=qC([`mi`,`mo`,`mn`,`ms`,`mtext`]),rt=xw({},nt),it=qC([`annotation-xml`]),at=xw({},it),ot=xw({},[`title`,`style`,`font`,`a`,`script`]),st=null,ct=[`application/xhtml+xml`,`text/html`],lt=null,ut=null,dt=n.createElement(`form`),ft=function(e){return e instanceof RegExp||e instanceof Function},pt=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(ut&&ut===e)return;(!e||typeof e!=`object`)&&(e={}),e=Cw(e),st=ct.indexOf(e.PARSER_MEDIA_TYPE)===-1?`text/html`:e.PARSER_MEDIA_TYPE,lt=st===`application/xhtml+xml`?ow:aw,ye=aT(e,`ALLOWED_TAGS`,j,{transform:lt}),M=aT(e,`ALLOWED_ATTR`,be,{transform:lt}),et=aT(e,`ALLOWED_NAMESPACES`,tt,{transform:ow}),qe=aT(e,`ADD_URI_SAFE_ATTR`,Je,{transform:lt,base:Je}),Ge=aT(e,`ADD_DATA_URI_TAGS`,Ke,{transform:lt,base:Ke}),Ue=aT(e,`FORBID_CONTENTS`,We,{transform:lt}),N=aT(e,`FORBID_TAGS`,Cw({}),{transform:lt}),Se=aT(e,`FORBID_ATTR`,Cw({}),{transform:lt}),P=hw(e,`USE_PROFILES`)?e.USE_PROFILES&&typeof e.USE_PROFILES==`object`?Cw(e.USE_PROFILES):e.USE_PROFILES:!1,we=e.ALLOW_ARIA_ATTR!==!1,Te=e.ALLOW_DATA_ATTR!==!1,Ee=e.ALLOW_UNKNOWN_PROTOCOLS||!1,De=e.ALLOW_SELF_CLOSE_IN_ATTR!==!1,Oe=e.SAFE_FOR_TEMPLATES||!1,ke=e.SAFE_FOR_XML!==!1,Ae=e.WHOLE_DOCUMENT||!1,Fe=e.RETURN_DOM||!1,Ie=e.RETURN_DOM_FRAGMENT||!1,Le=e.RETURN_TRUSTED_TYPE||!1,Pe=e.FORCE_BODY||!1,Re=e.SANITIZE_DOM!==!1,ze=e.SANITIZE_NAMED_PROPS||!1,Ve=e.KEEP_CONTENT!==!1,He=e.IN_PLACE||!1,ve=Ew(e.ALLOWED_URI_REGEXP)?e.ALLOWED_URI_REGEXP:Uw,Qe=typeof e.NAMESPACE==`string`?e.NAMESPACE:Ze,rt=oT(e,`MATHML_TEXT_INTEGRATION_POINTS`,()=>xw({},nt)),at=oT(e,`HTML_INTEGRATION_POINTS`,()=>xw({},it));let t=oT(e,`CUSTOM_ELEMENT_HANDLING`,()=>YC(null));if(xe=YC(null),hw(t,`tagNameCheck`)&&ft(t.tagNameCheck)&&(xe.tagNameCheck=t.tagNameCheck),hw(t,`attributeNameCheck`)&&ft(t.attributeNameCheck)&&(xe.attributeNameCheck=t.attributeNameCheck),hw(t,`allowCustomizedBuiltInElements`)&&typeof t.allowCustomizedBuiltInElements==`boolean`&&(xe.allowCustomizedBuiltInElements=t.allowCustomizedBuiltInElements),JC(xe),Oe&&(Te=!1),Ie&&(Fe=!0),P&&(ye=xw({},Nw),M=YC(null),P.html===!0&&(xw(ye,Dw),xw(M,Pw)),P.svg===!0&&(xw(ye,Ow),xw(M,Fw),xw(M,Lw)),P.svgFilters===!0&&(xw(ye,kw),xw(M,Fw),xw(M,Lw)),P.mathMl===!0&&(xw(ye,jw),xw(M,Iw),xw(M,Lw))),Ce.tagCheck=null,Ce.attributeCheck=null,hw(e,`ADD_TAGS`)&&(typeof e.ADD_TAGS==`function`?Ce.tagCheck=e.ADD_TAGS:iw(e.ADD_TAGS)&&(ye===j&&(ye=Cw(ye)),xw(ye,e.ADD_TAGS,lt))),hw(e,`ADD_ATTR`)&&(typeof e.ADD_ATTR==`function`?Ce.attributeCheck=e.ADD_ATTR:iw(e.ADD_ATTR)&&(M===be&&(M=Cw(M)),xw(M,e.ADD_ATTR,lt))),hw(e,`ADD_FORBID_CONTENTS`)&&iw(e.ADD_FORBID_CONTENTS)&&(Ue===We&&(Ue=Cw(Ue)),xw(Ue,e.ADD_FORBID_CONTENTS,lt)),Ve&&(ye[`#text`]=!0),Ae&&xw(ye,[`html`,`head`,`body`]),ye.table&&(xw(ye,[`tbody`]),delete N.tbody),e.TRUSTED_TYPES_POLICY){if(typeof e.TRUSTED_TYPES_POLICY.createHTML!=`function`)throw vw(`TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.`);if(typeof e.TRUSTED_TYPES_POLICY.createScriptURL!=`function`)throw vw(`TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.`);let t=T;T=e.TRUSTED_TYPES_POLICY;try{E=ne(``)}catch(e){throw T=t,e}}else e.TRUSTED_TYPES_POLICY===null?(T=void 0,E=``):(T===void 0&&(T=ie()),T&&typeof E==`string`&&(E=ne(``)));qC&&qC(e),ut=e},mt=xw({},[...Ow,...kw,...Aw]),ht=xw({},[...jw,...Mw]),gt=function(e,t,n){return t.namespaceURI===Ze?e===`svg`:t.namespaceURI===Ye?e===`svg`&&(n===`annotation-xml`||rt[n]):!!mt[e]},_t=function(e,t,n){return t.namespaceURI===Ze?e===`math`:t.namespaceURI===Xe?e===`math`&&at[n]:!!ht[e]},vt=function(e,t,n){return t.namespaceURI===Xe&&!at[n]||t.namespaceURI===Ye&&!rt[n]?!1:!ht[e]&&(ot[e]||!mt[e])},yt=function(e){let t=_(e);(!t||!t.tagName)&&(t={namespaceURI:Qe,tagName:`template`});let n=aw(e.tagName),r=aw(t.tagName);return et[e.namespaceURI]?e.namespaceURI===Xe?gt(n,t,r):e.namespaceURI===Ye?_t(n,t,r):e.namespaceURI===Ze?vt(n,t,r):!!(st===`application/xhtml+xml`&&et[e.namespaceURI]):!1},bt=function(e){nw(t.removed,{element:e});try{_(e).removeChild(e)}catch{if(p(e),!_(e))throw vw(`a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place`)}},xt=function(e,t,n){try{m(e,t)}catch{try{e.removeAttribute(n)}catch{}}},St=function(e){Tt(e);let t=g(e);if(t){let e=[];$C(t,t=>{nw(e,t)}),$C(e,e=>{try{p(e)}catch{}})}let n=y(e);if(n)for(let t=n.length-1;t>=0;--t){let r=n[t],i=r&&r.name;typeof i==`string`&&xt(e,r,i)}},Ct=function(e,n,r){if(!r)try{r=n.getAttributeNode(e)}catch{r=null}nw(t.removed,{attribute:r||null,from:n});try{r?m(n,r):n.removeAttribute(e)}catch{try{n.removeAttribute(e)}catch{}}if(e===`is`){if(Fe||Ie)try{bt(n)}catch{}else try{n.setAttribute(e,``)}catch{}}},wt=function(e){let t=y(e);if(t)for(let n=t.length-1;n>=0;--n){let r=t[n],i=r&&r.name;typeof i!=`string`||M[lt(i)]||xt(e,r,i)}},Tt=function(e){let t=[e];for(;t.length>0;){let e=t.pop();C(e)===Qw.element&&wt(e);let n=g(e);if(n)for(let e=n.length-1;e>=0;--e)t.push(n[e])}},Et=function(e,t){return ke?e===`patchsrc`||e===`for`&&t!==`label`&&t!==`output`:!1},Dt=function(e){if(!ke)return;let t=[e];for(;t.length>0;){let e=t.pop(),n=C(e);if(n===Qw.processingInstruction||n===Qw.comment&&_w(Yw,e.data)){try{p(e)}catch{}continue}if(n===Qw.element){let t=e,n=lt(w(e));try{t.hasAttribute&&t.hasAttribute(`patchsrc`)&&t.removeAttribute(`patchsrc`),t.hasAttribute&&t.hasAttribute(`for`)&&Et(`for`,n)&&t.removeAttribute(`for`)}catch{}}let r=g(e);if(r)for(let e=r.length-1;e>=0;--e)t.push(r[e])}},Ot=function(e){let t=null,r=null;if(Pe)e=`<remove></remove>`+e;else{let t=sw(e,/^[\r\n\t ]+/);r=t&&t[0]}st===`application/xhtml+xml`&&Qe===Ze&&(e=`<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>`+e+`</body></html>`);let i=T?ne(e):e;if(Qe===Ze)try{t=new l().parseFromString(i,st)}catch{}if(!t||!t.documentElement){t=ae.createDocument(Qe,`template`,null);try{t.documentElement.innerHTML=$e?E:i}catch{}}let a=t.body||t.documentElement;return e&&r&&a.insertBefore(n.createTextNode(r),a.childNodes[0]||null),Qe===Ze?se.call(t,Ae?`html`:`body`)[0]:Ae?t.documentElement:a},kt=function(e){let t=S?S(e):e.ownerDocument;return A.call(t||e,e,c.SHOW_ELEMENT|c.SHOW_COMMENT|c.SHOW_TEXT|c.SHOW_PROCESSING_INSTRUCTION|c.SHOW_CDATA_SECTION,null)},At=function(e){return e=cw(e,ue,` `),e=cw(e,de,` `),e=cw(e,fe,` `),e},jt=function(e){e.normalize();let t=S?S(e):e.ownerDocument,n=A.call(t||e,e,c.SHOW_TEXT|c.SHOW_COMMENT|c.SHOW_CDATA_SECTION|c.SHOW_PROCESSING_INSTRUCTION,null),r=n.nextNode();for(;r;)r.data=At(r.data),r=n.nextNode();let i=e.querySelectorAll?.call(e,`template`);i&&$C(i,e=>{Nt(e.content)&&jt(e.content)})},Mt=function(e){let t=x?x(e):null;return typeof t!=`string`||lt(t)!==`form`?!1:typeof e.nodeName!=`string`||typeof e.textContent!=`string`||typeof e.removeChild!=`function`||e.attributes!==y(e)||typeof e.removeAttribute!=`function`||typeof e.removeAttributeNode!=`function`||typeof e.getAttributeNode!=`function`||typeof e.setAttribute!=`function`||typeof e.namespaceURI!=`string`||typeof e.insertBefore!=`function`||typeof e.hasChildNodes!=`function`||e.nodeType!==b(e)||e.childNodes!==g(e)},Nt=function(e){if(!b||typeof e!=`object`||!e)return!1;try{return b(e)===Qw.documentFragment}catch{return!1}},Pt=function(e){if(!b||typeof e!=`object`||!e)return!1;try{return typeof b(e)==`number`}catch{return!1}};function Ft(e,n,r){e.length!==0&&$C(e,e=>{e.call(t,n,r,ut)})}let It=function(e,t){return!!(ke&&e.hasChildNodes()&&!Pt(e.firstElementChild)&&_w(Jw,e.textContent)&&_w(Jw,e.innerHTML)||ke&&e.namespaceURI===Ze&&eT[t]&&(Pt(e.firstElementChild)||typeof e.textContent==`string`&&_w(tT[t],e.textContent))||e.nodeType===Qw.processingInstruction||ke&&e.nodeType===Qw.comment&&_w(Yw,e.data))},Lt=function(e,t){return e instanceof RegExp?_w(e,t):e instanceof Function&&!!e(t,...[...arguments].slice(2))},Rt=function(e,t,n){if(!N[t]&&Wt(t)&&Lt(xe.tagNameCheck,t))return!1;if(Ve&&!Ue[t]){let t=_(e),r=g(e);if(r&&t){let i=r.length;for(let a=i-1;a>=0;--a){let i=e===n?f(r[a],!0):r[a];t.insertBefore(i,h(e))}}}return bt(e),!0},zt=function(e,t,n,r){return e.length===0?t:t===n||t===r?Cw(t):t},Bt=function(e,t){return e===t||_(e)!==null?!1:(He&&Tt(e),!0)},Vt=function(e,n){if(Ft(le.beforeSanitizeElements,e,null),Bt(e,n))return!0;if(Mt(e))return bt(e),!0;let r=lt(w(e));if(ye=zt(le.uponSanitizeElement,ye,j,Me),Ft(le.uponSanitizeElement,e,{tagName:r,allowedTags:ye}),Bt(e,n))return!0;if(It(e,r))return bt(e),!0;if(N[r]||!(Ce.tagCheck instanceof Function&&Ce.tagCheck(r))&&!ye[r]){let t=Rt(e,r,n);return t===!1&&(Ft(le.afterSanitizeElements,e,null),Bt(e,n))?!0:t}if(C(e)===Qw.element&&!yt(e)||(r===`noscript`||r===`noembed`||r===`noframes`)&&_w(Xw,e.innerHTML))return bt(e),!0;if(Oe&&e.nodeType===Qw.text){let n=At(e.textContent);e.textContent!==n&&(nw(t.removed,{element:e.cloneNode()}),e.textContent=n)}return Ft(le.afterSanitizeElements,e,null),Bt(e,n)},Ht=function(e,t,r){if(Se[t]||Et(t,e)||Re&&(t===`id`||t===`name`)&&(r in n||r in dt))return!1;let i=M[t]||Ce.attributeCheck instanceof Function&&Ce.attributeCheck(t,e);return Te&&_w(pe,t)||we&&_w(me,t)?!0:i?qe[t]||_w(ve,cw(r,ge,``))||(t===`src`||t===`xlink:href`||t===`href`)&&e!==`script`&&lw(r,`data:`)===0&&Ge[e]||Ee&&!_w(he,cw(r,ge,``))?!0:!r:Wt(e)&&Lt(xe.tagNameCheck,e)&&Lt(xe.attributeNameCheck,t,e)||t===`is`&&xe.allowCustomizedBuiltInElements&&Lt(xe.tagNameCheck,r)},Ut=xw({},[`annotation-xml`,`color-profile`,`font-face`,`font-face-format`,`font-face-name`,`font-face-src`,`font-face-uri`,`missing-glyph`]),Wt=function(e){return!Ut[aw(e)]&&_w(_e,e)},Gt=function(e,t,n,r){if(T&&typeof u==`object`&&typeof u.getAttributeType==`function`&&!n)switch(u.getAttributeType(e,t)){case`TrustedHTML`:return ne(r);case`TrustedScriptURL`:return re(r)}return r},Kt=function(e,t,n,r){try{return n?e.setAttributeNS(n,t,r):e.setAttribute(t,r),!Mt(e)||(bt(e),!1)}catch{return Ct(t,e),!1}},qt=function(e,n){if(Ft(le.beforeSanitizeAttributes,e,null),Bt(e,n))return;let r=e.attributes;if(!r||Mt(e))return;M=zt(le.uponSanitizeAttribute,M,be,Ne);let i={attrName:``,attrValue:``,keepAttr:!0,allowedAttributes:M,forceKeepAttr:void 0},a=r.length,o=lt(e.nodeName);for(;a--;){let n=r[a],s=n.name,c=n.namespaceURI,l=n.value,u=lt(s),d=l,f=s===`value`?d:uw(d),p=!1;if(i.attrName=u,i.attrValue=f,i.keepAttr=!0,i.forceKeepAttr=void 0,Ft(le.uponSanitizeAttribute,e,i),f=i.attrValue,ze&&(u===`id`||u===`name`)&&lw(f,Be)!==0&&(Ct(s,e,n),f=Be+f,p=!0),ke&&_w(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,f)){Ct(s,e,n);continue}if(u===`attributename`&&sw(f,`href`)){Ct(s,e,n);continue}if(!i.forceKeepAttr){if(!i.keepAttr){Ct(s,e,n);continue}if(!De&&_w(Zw,f)){Ct(s,e,n);continue}if(Oe&&(f=At(f)),!Ht(o,u,f)){Ct(s,e,n);continue}f=Gt(o,u,c,f),f!==d&&Kt(e,s,c,f)&&p&&tw(t.removed)}}Ft(le.afterSanitizeAttributes,e,null),Bt(e,n)},Jt=function(e){let t=null,n=kt(e);for(Ft(le.beforeSanitizeShadowDOM,e,null);t=n.nextNode();)if(Ft(le.uponSanitizeShadowNode,t,null),Vt(t,e),qt(t,e),Nt(t.content)&&Jt(t.content),C(t)===Qw.element){let e=v(t);Nt(e)&&(Yt(e),Jt(e))}Ft(le.afterSanitizeShadowDOM,e,null)},Yt=function(e){let t=[{node:e,shadow:null}];for(;t.length>0;){let e=t.pop();if(e.shadow){Jt(e.shadow);continue}let n=e.node,r=C(n)===Qw.element,i=g(n);if(i)for(let e=i.length-1;e>=0;--e)t.push({node:i[e],shadow:null});if(r){let e=x?x(n):null;if(typeof e==`string`&&lt(e)===`template`){let e=n.content;Nt(e)&&t.push({node:e,shadow:null})}}if(r){let e=v(n);Nt(e)&&t.push({node:null,shadow:e},{node:e,shadow:null})}}};return t.sanitize=function(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=null,a=null,o=null,s=null;if($e=!e,$e&&(e=`<!-->`),typeof e!=`string`&&!Pt(e)&&(e=ww(e),typeof e!=`string`))throw vw(`dirty is not a string, aborting`);if(!t.isSupported)return e;je?(ye=Me,M=Ne):pt(n),(le.uponSanitizeElement.length>0||le.uponSanitizeAttribute.length>0)&&(ye=Cw(ye)),le.uponSanitizeAttribute.length>0&&(M=Cw(M)),t.removed=[];let c=He&&typeof e!=`string`&&Pt(e);if(c){Dt(e);let t=w(e);if(typeof t==`string`){let n=lt(t);if(!ye[n]||N[n])throw St(e),vw(`root node is forbidden and cannot be sanitized in-place`)}if(Mt(e))throw St(e),vw(`root node is clobbered and cannot be sanitized in-place`);try{Yt(e)}catch(t){throw St(e),t}}else if(Pt(e))i=Ot(`<!---->`),a=i.ownerDocument.importNode(e,!0),a.nodeType===Qw.element&&a.nodeName===`BODY`||a.nodeName===`HTML`?i=a:i.appendChild(a),Yt(i);else{if(!Fe&&!Oe&&!Ae&&e.indexOf(`<`)===-1)return T&&Le?ne(e):e;if(i=Ot(e),!i)return Fe?null:Le?E:``}i&&Pe&&bt(i.firstChild);let l=c?e:i;try{let e=kt(l);for(;o=e.nextNode();)Vt(o,l),qt(o,l),Nt(o.content)&&Jt(o.content)}catch(n){throw c&&(St(e),$C(t.removed,e=>{e.element&&Tt(e.element)})),n}if(c){let n=!1;if($C(t.removed,t=>{t.element&&(t.element===e&&(n=!0),Tt(t.element))}),n)throw vw(`a node selected for removal could not be safely returned; refusing to sanitize in place`);return Oe&&jt(e),e}if(Fe){if(Oe&&jt(i),Ie)for(s=oe.call(i.ownerDocument);i.firstChild;)s.appendChild(i.firstChild);else s=i;return(M.shadowroot||M.shadowrootmode)&&(s=ce.call(r,s,!0)),s}let u=Ae?i.outerHTML:i.innerHTML;return Ae&&ye[`!doctype`]&&i.ownerDocument&&i.ownerDocument.doctype&&i.ownerDocument.doctype.name&&_w(Kw,i.ownerDocument.doctype.name)&&(u=`<!DOCTYPE `+i.ownerDocument.doctype.name+`>
78
- `+u),Oe&&(u=At(u)),T&&Le?ne(u):u},t.setConfig=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};pt(e),je=!0,Me=ye,Ne=M},t.clearConfig=function(){ut=null,je=!1,Me=null,Ne=null,T=D,E=``},t.isValidAttribute=function(e,t,n){ut||pt({});let r=lt(e),i=lt(t);return Ht(r,i,n)},t.addHook=function(e,t){typeof t==`function`&&hw(le,e)&&nw(le[e],t)},t.removeHook=function(e,t){if(hw(le,e)){if(t!==void 0){let n=ew(le[e],t);return n===-1?void 0:rw(le[e],n,1)[0]}return tw(le[e])}},t.removeHooks=function(e){hw(le,e)&&(le[e]=[])},t.removeAllHooks=function(){le=iT()},t}var cT=sT(),lT=cT;cT.sanitize.bind(cT),cT.isSupported,cT.addHook.bind(cT),cT.removeHook.bind(cT),cT.removeHooks.bind(cT),cT.removeAllHooks.bind(cT),cT.setConfig.bind(cT),cT.clearConfig.bind(cT),cT.isValidAttribute.bind(cT),cT.version,cT.removed;function uT(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var dT=uT();function fT(e){dT=e}var pT={exec:()=>null};function mT(e){let t=[];return n=>{let r=Math.max(0,Math.min(3,n-1)),i=t[r];return i||(i=e(r),t[r]=i),i}}function hT(e,t=``){let n=typeof e==`string`?e:e.source,r={replace:(e,t)=>{let i=typeof t==`string`?t:t.source;return i=i.replace(_T.caret,`$1`),n=n.replace(e,i),r},getRegex:()=>new RegExp(n,t)};return r}var gT=((e=``)=>{try{return!!RegExp(`(?<=1)(?<!1)`+e)}catch{return!1}})(),_T={codeRemoveIndent:/^(?: {0,3}\t| {1,4})/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,endingSpaceTabChar:/[ \t]$/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,leadingSpaceTab:/^[ \t]+/,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,numericCharacterReference:/&#(?:(\d{1,7})|[Xx]([A-Fa-f0-9]{1,6}));/g,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:e=>RegExp(`^( {0,3}${e})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:mT(e=>RegExp(`^ {0,${e}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`)),hrRegex:mT(e=>RegExp(`^ {0,${e}}((?:-[ ]*){3,}|(?:_[ ]*){3,}|(?:\\*[ ]*){3,})(?:\\n+|$)`)),fencesBeginRegex:mT(e=>RegExp(`^ {0,${e}}(?:\`\`\`|~~~)`)),headingBeginRegex:mT(e=>RegExp(`^ {0,${e}}#`)),htmlBeginRegex:mT(e=>RegExp(`^ {0,${e}}(?:</?(?:${MT})(?: +|$|/?>)|<(?:script|pre|style|textarea|!--))`,`i`)),blockquoteBeginRegex:mT(e=>RegExp(`^ {0,${e}}>`))},vT=/^(?:[ \t]*(?:\n|$))+/,yT=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,bT=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,xT=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,ST=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,CT=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,wT=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |fences|blockquote|heading|hr|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,TT=hT(wT).replace(/bull/g,CT).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}(?:\s|$)/).replace(/hr/g,/ {0,3}(?:(?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,``).getRegex(),ET=hT(wT).replace(/bull/g,CT).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}(?:\s|$)/).replace(/hr/g,/ {0,3}(?:(?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),DT=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table|[ \t]+\n)[^\n]+)*)/,OT=/^[^\n]+/,kT=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,AT=hT(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace(`label`,kT).replace(`title`,/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),jT=hT(/^(bull)([ \t][^\n]*?)?(?:\n|$)/).replace(/bull/g,CT).getRegex(),MT=`address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul`,NT=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,PT=hT(`^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n*|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>[^\\n]*\\n*|$)|<![A-Z][\\s\\S]*?(?:>[^\\n]*\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>[^\\n]*\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][a-z0-9-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][a-z0-9-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))`,`i`).replace(`comment`,NT).replace(`tag`,MT).replace(`attribute`,/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),FT=e=>hT(DT).replace(`hr`,xT).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`|lheading`,``).replace(`|table`,``).replace(`blockquote`,` {0,3}>`).replace(`fences`," {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace(`list`,e).replace(`html`,`</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)`).replace(`tag`,MT).getRegex(),IT=FT(/ {0,3}(?:[*+-]|1[.)])[ \t]+[^ \t\n]/),LT=FT(/ {0,3}(?:[*+-]|\d{1,9}[.)])(?:[ \t]|\n|$)/),RT={blockquote:hT(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace(`paragraph`,LT).getRegex(),code:yT,def:AT,fences:bT,heading:ST,hr:xT,html:PT,lheading:TT,list:jT,newline:vT,paragraph:IT,table:pT,text:OT},zT=hT(`^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)`).replace(`hr`,xT).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`blockquote`,` {0,3}>`).replace(`code`,`(?: {4}| {0,3} )[^\\n]`).replace(`fences`," {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace(`list`,` {0,3}(?:[*+-]|1[.)])[ \\t]`).replace(`html`,`</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)`).replace(`tag`,MT).getRegex(),BT={...RT,lheading:ET,table:zT,paragraph:hT(DT).replace(`hr`,xT).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`|lheading`,``).replace(`table`,zT).replace(`blockquote`,` {0,3}>`).replace(`fences`," {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace(`list`,` {0,3}(?:[*+-]|1[.)])[ \\t]+[^ \\t\\n]`).replace(`html`,`</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)`).replace(`tag`,MT).getRegex()},VT={...RT,html:hT(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace(`comment`,NT).replace(/tag/g,`(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b`).getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:pT,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:hT(DT).replace(`hr`,xT).replace(`heading`,` *#{1,6} *[^
79
- ]`).replace(`lheading`,TT).replace(`|table`,``).replace(`blockquote`,` {0,3}>`).replace(`|fences`,``).replace(`|list`,``).replace(`|html`,``).replace(`|tag`,``).getRegex()},HT=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,UT=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,WT=/^( {2,}|\\)\n(?!\s*$)[ \t]*/,GT=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,KT=/[\p{P}\p{S}]/u,qT=/[\s\p{P}\p{S}]/u,JT=/[^\s\p{P}\p{S}]/u,YT=hT(/^((?![*_])punctSpace)/,`u`).replace(/punctSpace/g,qT).getRegex(),XT=/[\p{Pi}\p{Ps}"']/u,ZT=/(?!~)[\p{P}\p{S}]/u,QT=/(?!~)[\s\p{P}\p{S}]/u,$T=/(?:[^\s\p{P}\p{S}]|~)/u,eE=hT(/link|precode-code|html/,`g`).replace(`link`,/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace(`precode-`,gT?"(?<!`)()":"(^^|[^`])").replace(`code`,/(?<b>`+)[^`]+\k<b>(?!`)/).replace(`html`,/<(?! )[^<>]*?>/).getRegex(),tE=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,nE=hT(tE,`u`).replace(/punct/g,KT).getRegex(),rE=hT(tE,`u`).replace(/punct/g,ZT).getRegex(),iE=hT(/^(?:\*+(?:((?!\*)(?!openQuote)punct)|([^\s*]))?)|^_+(?:((?!_)(?!openQuote)punct)|([^\s_]))?/,`u`).replace(/openQuote/g,XT).replace(/punct/g,KT).getRegex(),aE=`^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)`,oE=hT(aE,`gu`).replace(/notPunctSpace/g,JT).replace(/punctSpace/g,qT).replace(/punct/g,KT).getRegex(),sE=hT(aE,`gu`).replace(/notPunctSpace/g,$T).replace(/punctSpace/g,QT).replace(/punct/g,ZT).getRegex(),cE=hT(`^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)[\\s](\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|(?:(?!\\*)punct|notPunctSpace)(\\*+)(?!\\*)(?=notPunctSpace)`,`gu`).replace(/notPunctSpace/g,JT).replace(/punctSpace/g,qT).replace(/punct/g,KT).getRegex(),lE=hT(`^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)`,`gu`).replace(/notPunctSpace/g,JT).replace(/punctSpace/g,qT).replace(/punct/g,KT).getRegex(),uE=hT(`^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)[\\s](_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)|(?:(?!_)punct|notPunctSpace)(_+)(?!_)(?=notPunctSpace)`,`gu`).replace(/notPunctSpace/g,JT).replace(/punctSpace/g,qT).replace(/punct/g,KT).getRegex(),dE=hT(/^~~?(?:((?!~)punct)|[^\s~])/,`u`).replace(/punct/g,KT).getRegex(),fE=hT(`^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)`,`gu`).replace(/notPunctSpace/g,JT).replace(/punctSpace/g,qT).replace(/punct/g,KT).getRegex(),pE=hT(/\\(punct)/,`gu`).replace(/punct/g,KT).getRegex(),mE=hT(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace(`scheme`,/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace(`email`,/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),hE=hT(NT).replace(`(?:-->|$)`,`-->`).getRegex(),gE=hT(`^comment|^</[a-zA-Z][a-zA-Z0-9-]*\\s*>|^<[a-zA-Z][a-zA-Z0-9-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>`).replace(`comment`,hE).replace(`attribute`,/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),_E=/\[(?:\\[\s\S]|[^\[\]\\])*\]/,vE=hT(/(?:\[(?:brackets|\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/).replace(`brackets`,_E).getRegex(),yE=hT(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace(`label`,vE).replace(`href`,/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]+|(?=\))/).replace(`title`,/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),bE=hT(/^!?\[(label)\]\[(ref)\]/).replace(`label`,vE).replace(`ref`,kT).getRegex(),xE=hT(/^!?\[(ref)\](?:\[\])?/).replace(`ref`,kT).getRegex(),SE=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\]){1,999}/,CE=hT(/(?:[^\[\]\\`]*(?:\[(?:brackets|\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\]))){0,999}?[^\[\]\\`]*?/).replace(`brackets`,_E).getRegex(),wE=hT(`reflink|nolink(?!\\()`,`g`).replace(`reflink`,hT(/^!?\[(label)\]\[(ref)\]/).replace(`label`,CE).replace(`ref`,SE).getRegex()).replace(`nolink`,hT(/^!?\[(ref)\](?:\[\])?/).replace(`ref`,SE).getRegex()).getRegex(),TE=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,EE=hT(/(?:mailto:email|xmpp:email(?:\/[A-Za-z0-9@.]+)?)/).replace(/email/g,/[A-Za-z0-9._+-]+@[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![\w-])/).getRegex(),DE={_backpedal:pT,anyPunctuation:pE,autolink:mE,blockSkip:eE,br:WT,code:UT,del:pT,delLDelim:pT,delRDelim:pT,emStrongLDelim:nE,emStrongRDelimAst:oE,emStrongRDelimUnd:lE,escape:HT,link:yE,nolink:xE,punctuation:YT,reflink:bE,reflinkSearch:wE,tag:gE,text:GT,url:pT},OE={...DE,emStrongLDelim:iE,emStrongRDelimAst:cE,emStrongRDelimUnd:uE,link:hT(/^!?\[(label)\]\((.*?)\)/).replace(`label`,vE).getRegex(),reflink:hT(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace(`label`,vE).getRegex()},kE={...DE,emStrongRDelimAst:sE,emStrongLDelim:rE,delLDelim:dE,delRDelim:fE,url:hT(/^emailProtocol|^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace(`emailProtocol`,EE).replace(`protocol`,TE).replace(`email`,/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![\w-])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:hT(/^(?:[^a-zA-Z0-9](?=emailProtocol)|(`+|~+|[^`~])(?:(?=[`~])|(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9](?=emailProtocol)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@))))/).replace(`protocol`,TE).replace(/emailProtocol/g,/(?:mailto|xmpp):/).getRegex()},AE={...kE,br:hT(WT).replace(`{2,}`,`*`).getRegex(),text:hT(kE.text).replace(`\\b_`,`\\b_| {2,}\\n`).replace(/\{2,\}/g,`*`).getRegex()},jE={normal:RT,gfm:BT,pedantic:VT},ME={normal:DE,gfm:kE,breaks:AE,pedantic:OE},NE={"&":`&amp;`,"<":`&lt;`,">":`&gt;`,'"':`&quot;`,"'":`&#39;`},PE=e=>NE[e];function FE(e,t){if(t){if(_T.escapeTest.test(e))return e.replace(_T.escapeReplace,PE)}else if(_T.escapeTestNoEncode.test(e))return e.replace(_T.escapeReplaceNoEncode,PE);return e}function IE(e){return e.replace(_T.numericCharacterReference,(e,t,n)=>{let r=t===void 0?Number.parseInt(n,16):Number.parseInt(t,10);return r===0||r>1114111||r>=55296&&r<=57343?`�`:String.fromCodePoint(r)})}function LE(e){try{e=encodeURI(e).replace(_T.percentDecode,`%`)}catch{return null}return e}function RE(e,t){let n=e.replace(_T.findPipe,(e,t,n)=>{let r=!1,i=t;for(;--i>=0&&n[i]===`\\`;)r=!r;return r?`|`:` |`}).split(_T.splitPipe),r=0;if(n[0].trim()||n.shift(),n.length>0&&!n.at(-1)?.trim()&&n.pop(),t){if(n.length>t)n.splice(t);else for(;n.length<t;)n.push(``)}for(;r<n.length;r++)n[r]=n[r].trim().replace(_T.slashPipe,`|`);return n}function zE(e,t,n){let r=e.length;if(r===0)return``;let i=0;for(;i<r;){let a=e.charAt(r-i-1);if(a===t&&!n)i++;else if(a!==t&&n)i++;else break}return e.slice(0,r-i)}function BE(e){let t=e.split(`
80
- `),n=t.length-1;for(;n>=0&&_T.blankLine.test(t[n]);)n--;return t.length-n<=2?e:t.slice(0,n+1).join(`
81
- `)}function VE(e){return e.trim().toLowerCase().toUpperCase().toLowerCase()}function HE(e,t){if(e.indexOf(t[1])===-1)return-1;let n=0;for(let r=0;r<e.length;r++)if(e[r]===`\\`)r++;else if(e[r]===t[0])n++;else if(e[r]===t[1]&&(n--,n<0))return r;return n>0?-2:-1}function UE(e,t=0){let n=t,r=``;for(let t of e)if(t===` `){let e=4-n%4;r+=` `.repeat(e),n+=e}else r+=t,n++;return r}function WE(e,t,n,r,i){let a=t.href,o=t.title||null,s=e[1].replace(i.other.outputLinkReplace,`$1`),c=e[0].charAt(0)===`!`;r.state.inLink=!0;let l=r.state.linkEmitted,u=r.state.inRawBlock;r.state.linkEmitted=!1;let d=r.inlineTokens(s),f=r.state.linkEmitted;if(r.state.linkEmitted=l,r.state.inLink=!1,!c){if(f){r.state.inRawBlock=u;return}r.state.linkEmitted=!0}return{type:c?`image`:`link`,raw:n,href:a,title:o,text:s,tokens:d}}function GE(e,t,n){let r=e.match(n.other.indentCodeCompensation);if(r===null)return t;let i=r[1];return t.split(`
76
+ `),t+=i.text,i.turnId!==void 0&&(n=i.turnId),r=!0);return t}function sC(e,t){let n=new Map,r=new Set,i=t.filter(t=>{if(!t.callId)return!0;let i=e.find(e=>e.callId===t.callId&&!r.has(e.callId));return i?(n.set(t.id,i.callId),r.add(i.callId),!1):!1}),a=t=>{let a=e.filter(e=>!r.has(e.callId)),o=new Map(i.flatMap(e=>n.has(e.id)?[]:[[e.id,a.filter(n=>t(n,e))]]));for(let e of i){if(n.has(e.id))continue;let t=o.get(e.id)??[];if(t.length!==1)continue;let[a]=t;i.filter(e=>!n.has(e.id)&&(o.get(e.id)??[]).some(e=>e.callId===a.callId)).length===1&&(n.set(e.id,a.callId),r.add(a.callId))}};return a((e,t)=>e.name===t.kind&&cC(e.input,t.payload)),a((e,t)=>e.name===t.kind),n}function cC(e,t){if(Object.is(e,t))return!0;if(Array.isArray(e)||Array.isArray(t))return Array.isArray(e)&&Array.isArray(t)&&e.length===t.length&&e.every((e,n)=>cC(e,t[n]));if(!eC(e)||!eC(t))return!1;let n=Object.keys(e),r=Object.keys(t);return n.length===r.length&&n.every(n=>Object.hasOwn(t,n)&&cC(e[n],t[n]))}var lC=new Set([`exec_cmd`,`exec_command`]),uC=new Set([`control_cmd`,`control_command`,`poll_cmd`,`poll_command`,`write_stdin`]);function dC(e){return lC.has(e)}function fC(e){return uC.has(e)}function pC(e){return dC(e)||fC(e)}function mC(e){return $S(e)?e:void 0}function hC(e,t){return eC(e)?mC(e[t]):void 0}function gC(e,t){return e.runId===t}function _C(e){return e.name||e.job?.kind||`tool`}function vC(e){let t=[];for(let n of e){if(n.type===`text`||n.type===`reasoning`){t.push(n);continue}let e=_C(n),r=t.at(-1);if(r?.type===`tool-group`&&r.toolKey===e){r.tools.push(n);continue}t.push({type:`tool-group`,toolKey:e,tools:[n]})}return t}function yC(e){return`${e.type}:${e.turnId??``}:${e.id}`}function bC(e){return e.type===`reasoning`?yC(e):e.tools[0]?.callId??e.toolKey}function xC(e){let t=[];for(let n of e){if(n.type===`text`){t.push(n);continue}let e=t.at(-1);if(e?.type===`work`){e.blocks.push(n);continue}t.push({type:`work`,key:bC(n),blocks:[n]})}return t}function SC(e,t){let n,r=t.endedAt;for(let i of e.blocks){let e=i.type===`tool-group`?i.tools:[i];for(let i of e){if(i.startedAt==null)return{};if(n=Math.min(n??i.startedAt,i.startedAt),!t.inProgress){let e=i.completedAt??t.endedAt;if(e===void 0)return{};r=Math.max(r??e,e)}}}return t.inProgress?{startedAtMs:n}:{startedAtMs:n,completedAtMs:r}}function CC(e){return e.output===void 0?!e.job||e.job.status===`pending`||e.job.status===`claimed`:!1}function wC(e){let t=_C(e);return pC(t)||t===`ask_question`||t===`await_question`||t===`poll_question`||t===`spawn_subagent`||t===`control_subagent`||t===`poll_subagent`}function TC(e,t){return t&&wC(e)&&CC(e)}function EC(e){return hC(e.output,`sessionId`)??hC(e.input,`sessionId`)??hC(e.job?.payload,`sessionId`)}function DC(e){let t=new Map;for(let n of e){let e=EC(n);if(!e)continue;let r=hC(n.output,`command`)??(dC(_C(n))?hC(n.input,`cmd`)??hC(n.job?.payload,`cmd`):void 0);r&&t.set(e,r)}return t}function OC(e,t){let n=EC(e);return hC(e.output,`command`)??(n?t.get(n):void 0)}function kC(e,t){let n=[],r=[];for(let i of e){if(i.type===`reasoning`){n.push(i);continue}let e=[];for(let n of i.tools)TC(n,t)?r.push(n):(!t||!CC(n))&&e.push(n);e.length>0&&n.push({type:`tool-group`,toolKey:i.toolKey,tools:e})}return{settledBlocks:n,runningTools:r}}function AC(e,t){return!t&&CC(e)?`interrupted`:e.job?.status===`cancelled`||e.job?.status===`failed`?e.job.status:aC(e.output)?.status}function jC(e,t){if(!t&&CC(e))return`The agent stopped before this tool call finished.`;let n=aC(e.output)?.error;return e.job?e.job.status===`cancelled`?e.job.error??n??`Tool stopped before completion.`:e.job.status===`failed`?e.job.error??n??`Executor job failed.`:void 0:n}function MC(e,t){let n=new Map;e.forEach(e=>{e.type===`tool-result`&&n.set(e.callId,e)});let r=sC(e.filter(e=>e.type===`tool-call`),t.map(e=>({id:e._id,kind:e.kind,callId:e.callId,payload:e.payload}))),i=new Map;for(let e of t){let t=r.get(e._id);t&&i.set(t,e)}let a=[],o=new Set;for(let t of e){if(t.type===`tool-result`)continue;if(t.type===`reasoning`||t.type===`text`){t.text.trim().length>0&&a.push(t);continue}let e=n.get(t.callId),r=i.get(t.callId);r&&o.add(r._id);let s={type:`tool`,callId:t.callId,name:t.name,input:t.input,startedAt:t.startedAt??r?.enqueuedAt,completedAt:e?.completedAt??r?.completedAt};e?s.output=e.output:r?.result!==void 0&&(s.output=r.result),r&&(s.job=r),a.push(s)}for(let e of t){if(o.has(e._id))continue;let t={type:`tool`,callId:e.callId??`executor-job:${e._id}`,name:e.kind,input:e.payload,startedAt:e.enqueuedAt,completedAt:e.completedAt,job:e};e.result!==void 0&&(t.output=e.result),a.push(t)}return a}function NC(e){return e.type===`reasoning`?[yC(e)]:e.tools.map(e=>`tool:${e.callId}`)}var PC=class{messages=new Map;nextId=0;retain(e){let t=new Set(e);for(let e of this.messages.keys())t.has(e)||this.messages.delete(e)}reconcile(e,t){let n=this.reconcileMembers(e,t.map(e=>e.type===`text`?[yC(e)]:e.blocks.flatMap(NC)));return t.map((e,t)=>({...e,renderKey:e.type===`text`?yC(e):n[t]}))}reconcileBlocks(e,t){let n=this.reconcileMembers(e,t.map(NC));return t.map((e,t)=>({block:e,renderKey:n[t]}))}reconcileMembers(e,t){let n=this.messages.get(e),r=new Map,i=new Set,a=t.map(e=>{let t=e.map(e=>n?.get(e)).find(e=>e!==void 0&&!i.has(e))??`work:${this.nextId++}`;i.add(t);for(let n of e)r.set(n,t);return t});return this.messages.set(e,r),a}};function FC(e,t){this.v=e,this.k=t}function IC(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function LC(e){if(Array.isArray(e))return e}function RC(e,t){var n=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n!=null){var r,i,a,o,s=[],c=!0,l=!1;try{if(a=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}function zC(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
77
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function BC(e,t){return LC(e)||RC(e,t)||VC(e,t)||zC()}function VC(e,t){if(e){if(typeof e==`string`)return IC(e,t);var n={}.toString.call(e).slice(8,-1);return n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`?Array.from(e):n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?IC(e,t):void 0}}function HC(e){var t,n;function r(t,n){try{var a=e[t](n),o=a.value,s=o instanceof FC;Promise.resolve(s?o.v:o).then(function(n){if(s){var c=t===`return`&&o.k?t:`next`;if(!o.k||n.done)return r(c,n);n=e[c](n).value}i(!!a.done,n)},function(e){r(`throw`,e)})}catch(e){i(2,e)}}function i(e,i){e===2?t.reject(i):t.resolve({value:i,done:e}),(t=t.next)?r(t.key,t.arg):n=null}this._invoke=function(e,i){return new Promise(function(a,o){var s={key:e,arg:i,resolve:a,reject:o,next:null};n?n=n.next=s:(t=n=s,r(e,i))})},typeof e.return!=`function`&&(this.return=void 0)}HC.prototype[typeof Symbol==`function`&&Symbol.asyncIterator||`@@asyncIterator`]=function(){return this},HC.prototype.next=function(e){return this._invoke(`next`,e)},HC.prototype.throw=function(e){return this._invoke(`throw`,e)},HC.prototype.return=function(e){return this._invoke(`return`,e)};var UC=Object.entries,WC=Object.setPrototypeOf,GC=Object.isFrozen,KC=Object.getPrototypeOf,qC=Object.getOwnPropertyDescriptor,JC=Object.freeze,YC=Object.seal,XC=Object.create,ZC=typeof Reflect<`u`&&Reflect,QC=ZC.apply,$C=ZC.construct;JC||=function(e){return e},YC||=function(e){return e},QC||=function(e,t){var n=[...arguments].slice(2);return e.apply(t,n)},$C||=function(e){return new e(...[...arguments].slice(1))};var ew=bw(Array.prototype.forEach);Array.prototype.indexOf;var tw=bw(Array.prototype.lastIndexOf),nw=bw(Array.prototype.pop),rw=bw(Array.prototype.push);Array.prototype.slice;var iw=bw(Array.prototype.splice),aw=Array.isArray,ow=bw(String.prototype.toLowerCase),sw=bw(String.prototype.toString),cw=bw(String.prototype.match),lw=bw(String.prototype.replace),uw=bw(String.prototype.indexOf),dw=bw(String.prototype.trim),fw=bw(Number.prototype.toString),pw=bw(Boolean.prototype.toString),mw=typeof BigInt>`u`?null:bw(BigInt.prototype.toString),hw=typeof Symbol>`u`?null:bw(Symbol.prototype.toString),gw=bw(Object.prototype.hasOwnProperty),_w=bw(Object.prototype.toString),vw=bw(RegExp.prototype.test),yw=xw(TypeError);function bw(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);var n=[...arguments].slice(1);return QC(e,t,n)}}function xw(e){return function(){return $C(e,[...arguments])}}function Sw(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:ow;if(WC&&WC(e,null),!aw(t))return e;let r=t.length;for(;r--;){let i=t[r];if(typeof i==`string`){let e=n(i);e!==i&&(GC(t)||(t[r]=e),i=e)}e[i]=!0}return e}function Cw(e){for(let t=0;t<e.length;t++)gw(e,t)||(e[t]=null);return e}function ww(e){let t=XC(null);for(let r of UC(e)){var n=BC(r,2);let i=n[0],a=n[1];gw(e,i)&&(t[i]=aw(a)?Cw(a):a&&typeof a==`object`&&a.constructor===Object?ww(a):a)}return t}function Tw(e){switch(typeof e){case`string`:return e;case`number`:return fw(e);case`boolean`:return pw(e);case`bigint`:return mw?mw(e):`0`;case`symbol`:return hw?hw(e):`Symbol()`;case`undefined`:return _w(e);case`function`:case`object`:{if(e===null)return _w(e);let t=e,n=Ew(t,`toString`);if(typeof n==`function`){let e=n(t);return typeof e==`string`?e:_w(e)}return _w(e)}default:return _w(e)}}function Ew(e,t){for(;e!==null;){let n=qC(e,t);if(n){if(n.get)return bw(n.get);if(typeof n.value==`function`)return bw(n.value)}e=KC(e)}function n(){return null}return n}function Dw(e){try{return vw(e,``),!0}catch{return!1}}var Ow=JC(`a.abbr.acronym.address.area.article.aside.audio.b.bdi.bdo.big.blink.blockquote.body.br.button.canvas.caption.center.cite.code.col.colgroup.content.data.datalist.dd.decorator.del.details.dfn.dialog.dir.div.dl.dt.element.em.fieldset.figcaption.figure.font.footer.form.h1.h2.h3.h4.h5.h6.head.header.hgroup.hr.html.i.img.input.ins.kbd.label.legend.li.main.map.mark.marquee.menu.menuitem.meter.nav.nobr.ol.optgroup.option.output.p.picture.pre.progress.q.rp.rt.ruby.s.samp.search.section.select.shadow.slot.small.source.spacer.span.strike.strong.style.sub.summary.sup.table.tbody.td.template.textarea.tfoot.th.thead.time.tr.track.tt.u.ul.var.video.wbr`.split(`.`)),kw=JC(`svg.a.altglyph.altglyphdef.altglyphitem.animatecolor.animatemotion.animatetransform.circle.clippath.defs.desc.ellipse.enterkeyhint.exportparts.filter.font.g.glyph.glyphref.hkern.image.inputmode.line.lineargradient.marker.mask.metadata.mpath.part.path.pattern.polygon.polyline.radialgradient.rect.stop.style.switch.symbol.text.textpath.title.tref.tspan.view.vkern`.split(`.`)),Aw=JC([`feBlend`,`feColorMatrix`,`feComponentTransfer`,`feComposite`,`feConvolveMatrix`,`feDiffuseLighting`,`feDisplacementMap`,`feDistantLight`,`feDropShadow`,`feFlood`,`feFuncA`,`feFuncB`,`feFuncG`,`feFuncR`,`feGaussianBlur`,`feImage`,`feMerge`,`feMergeNode`,`feMorphology`,`feOffset`,`fePointLight`,`feSpecularLighting`,`feSpotLight`,`feTile`,`feTurbulence`]),jw=JC([`animate`,`color-profile`,`cursor`,`discard`,`font-face`,`font-face-format`,`font-face-name`,`font-face-src`,`font-face-uri`,`foreignobject`,`hatch`,`hatchpath`,`mesh`,`meshgradient`,`meshpatch`,`meshrow`,`missing-glyph`,`script`,`set`,`solidcolor`,`unknown`,`use`]),Mw=JC(`math.menclose.merror.mfenced.mfrac.mglyph.mi.mlabeledtr.mmultiscripts.mn.mo.mover.mpadded.mphantom.mroot.mrow.ms.mspace.msqrt.mstyle.msub.msup.msubsup.mtable.mtd.mtext.mtr.munder.munderover.mprescripts`.split(`.`)),Nw=JC([`maction`,`maligngroup`,`malignmark`,`mlongdiv`,`mscarries`,`mscarry`,`msgroup`,`mstack`,`msline`,`msrow`,`semantics`,`annotation`,`annotation-xml`,`mprescripts`,`none`]),Pw=JC([`#text`]),Fw=JC(`accept.action.align.alt.autocapitalize.autocomplete.autopictureinpicture.autoplay.background.bgcolor.border.capture.cellpadding.cellspacing.checked.cite.class.clear.color.cols.colspan.command.commandfor.controls.controlslist.coords.crossorigin.datetime.decoding.default.dir.disabled.disablepictureinpicture.disableremoteplayback.download.draggable.enctype.enterkeyhint.exportparts.face.for.headers.height.hidden.high.href.hreflang.id.inert.inputmode.integrity.ismap.kind.label.lang.list.loading.loop.low.max.maxlength.media.method.min.minlength.multiple.muted.name.nonce.noshade.novalidate.nowrap.open.optimum.part.pattern.placeholder.playsinline.popover.popovertarget.popovertargetaction.poster.preload.pubdate.radiogroup.readonly.rel.required.rev.reversed.role.rows.rowspan.spellcheck.scope.selected.shape.size.sizes.slot.span.srclang.start.src.srcset.step.style.summary.tabindex.title.translate.type.usemap.valign.value.width.wrap.xmlns`.split(`.`)),Iw=JC(`accent-height.accumulate.additive.alignment-baseline.amplitude.ascent.attributename.attributetype.azimuth.basefrequency.baseline-shift.begin.bias.by.class.clip.clippathunits.clip-path.clip-rule.color.color-interpolation.color-interpolation-filters.color-profile.color-rendering.cx.cy.d.dx.dy.diffuseconstant.direction.display.divisor.dominant-baseline.dur.edgemode.elevation.end.exponent.fill.fill-opacity.fill-rule.filter.filterunits.flood-color.flood-opacity.font-family.font-size.font-size-adjust.font-stretch.font-style.font-variant.font-weight.fx.fy.g1.g2.glyph-name.glyphref.gradientunits.gradienttransform.height.href.id.image-rendering.in.in2.intercept.k.k1.k2.k3.k4.kerning.keypoints.keysplines.keytimes.lang.lengthadjust.letter-spacing.kernelmatrix.kernelunitlength.lighting-color.local.marker-end.marker-mid.marker-start.markerheight.markerunits.markerwidth.maskcontentunits.maskunits.max.mask.mask-type.media.method.mode.min.name.numoctaves.offset.operator.opacity.order.orient.orientation.origin.overflow.paint-order.path.pathlength.patterncontentunits.patterntransform.patternunits.pointer-events.points.preservealpha.preserveaspectratio.primitiveunits.r.rx.ry.radius.refx.refy.repeatcount.repeatdur.restart.result.rotate.scale.seed.shape-rendering.slope.specularconstant.specularexponent.spreadmethod.startoffset.stddeviation.stitchtiles.stop-color.stop-opacity.stroke-dasharray.stroke-dashoffset.stroke-linecap.stroke-linejoin.stroke-miterlimit.stroke-opacity.stroke.stroke-width.style.surfacescale.systemlanguage.tabindex.tablevalues.targetx.targety.transform.transform-origin.text-anchor.text-decoration.text-orientation.text-rendering.textlength.type.u1.u2.unicode.values.vector-effect.viewbox.visibility.version.vert-adv-y.vert-origin-x.vert-origin-y.width.word-spacing.wrap.writing-mode.xchannelselector.ychannelselector.x.x1.x2.xmlns.y.y1.y2.z.zoomandpan`.split(`.`)),Lw=JC(`accent.accentunder.align.bevelled.close.columnalign.columnlines.columnspacing.columnspan.denomalign.depth.dir.display.displaystyle.encoding.fence.frame.height.href.id.largeop.length.linethickness.lquote.lspace.mathbackground.mathcolor.mathsize.mathvariant.maxsize.minsize.movablelimits.notation.numalign.open.rowalign.rowlines.rowspacing.rowspan.rspace.rquote.scriptlevel.scriptminsize.scriptsizemultiplier.selection.separator.separators.stretchy.subscriptshift.supscriptshift.symmetric.voffset.width.xmlns`.split(`.`)),Rw=JC([`xlink:href`,`xml:id`,`xlink:title`,`xml:space`,`xmlns:xlink`]),zw=YC(/{{[\w\W]*|^[\w\W]*}}/g),Bw=YC(/<%[\w\W]*|^[\w\W]*%>/g),Vw=YC(/\${[\w\W]*/g),Hw=YC(/^data-[\-\w.\u00B7-\uFFFF]+$/),Uw=YC(/^aria-[\-\w]+$/),Ww=YC(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Gw=YC(/^(?:\w+script|data):/i),Kw=YC(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),qw=YC(/^html$/i),Jw=YC(/^[a-z][.\w]*(-[.\w]+)+$/i),Yw=YC(/<[/\w!]/g),Xw=YC(/<[/\w]/g),Zw=YC(/<\/no(script|embed|frames)/i),Qw=YC(/\/>/i),$w={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,processingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},eT=[`style`,`script`,`xmp`,`iframe`,`noembed`,`noframes`,`plaintext`,`noscript`],tT=JC(Sw({},eT)),nT=function(){let e={};return ew(eT,t=>{e[t]=YC(RegExp(`</`+t+`(?=[\\t\\n\\f\\r />])`,`i`))}),JC(e)}(),rT=function(){return typeof window>`u`?null:window},iT=function(e,t){if(typeof e!=`object`||typeof e.createPolicy!=`function`)return null;let n=null,r=`data-tt-policy-suffix`;t&&t.hasAttribute(r)&&(n=t.getAttribute(r));let i=`dompurify`+(n?`#`+n:``);try{return e.createPolicy(i,{createHTML(e){return e},createScriptURL(e){return e}})}catch{return console.warn(`TrustedTypes policy `+i+` could not be created.`),null}},aT=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},oT=function(e,t,n,r){return gw(e,t)&&aw(e[t])?Sw(r.base?ww(r.base):{},e[t],r.transform):n},sT=function(e,t,n){let r=gw(e,t)?e[t]:void 0;return r&&typeof r==`object`?ww(r):n()};function cT(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:rT(),t=e=>cT(e);if(t.version=`3.4.16`,t.removed=[],!e||!e.document||e.document.nodeType!==$w.document||!e.Element)return t.isSupported=!1,t;let n=e.document,r=n,i=r.currentScript;e.DocumentFragment;let a=e.HTMLTemplateElement,o=e.Node,s=e.Element,c=e.NodeFilter;e.NamedNodeMap===void 0&&(e.NamedNodeMap||e.MozNamedAttrMap),e.HTMLFormElement;let l=e.DOMParser,u=e.trustedTypes,d=s.prototype,f=Ew(d,`cloneNode`),p=Ew(d,`remove`),m=Ew(d,`removeAttributeNode`),h=Ew(d,`nextSibling`),g=Ew(d,`childNodes`),_=Ew(d,`parentNode`),v=Ew(d,`shadowRoot`),y=Ew(d,`attributes`),b=o&&o.prototype?Ew(o.prototype,`nodeType`):null,x=o&&o.prototype?Ew(o.prototype,`nodeName`):null,S=o&&o.prototype?Ew(o.prototype,`ownerDocument`):null,C=function(e){return b?b(e):e.nodeType},w=function(e){return x?x(e):e.nodeName};if(typeof a==`function`){let e=n.createElement(`template`);e.content&&e.content.ownerDocument&&(n=e.content.ownerDocument)}let T,E=``,D,ee=!1,O=0,te=function(){if(O>0)throw yw(`A configured TRUSTED_TYPES_POLICY callback (createHTML or createScriptURL) must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose callbacks wrap DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted Types" section of the README.`)},ne=function(e){te(),O++;try{return T.createHTML(e)}finally{O--}},re=function(e){te(),O++;try{return T.createScriptURL(e)}finally{O--}},ie=function(){return ee||=(D=iT(u,i),!0),D},k=n,ae=k.implementation,A=k.createNodeIterator,oe=k.createDocumentFragment,se=k.getElementsByTagName,ce=r.importNode,le=aT();t.isSupported=typeof UC==`function`&&typeof _==`function`&&ae&&ae.createHTMLDocument!==void 0;let ue=zw,de=Bw,fe=Vw,pe=Hw,me=Uw,he=Gw,ge=Kw,_e=Jw,ve=Ww,ye=null,j=Sw({},[...Ow,...kw,...Aw,...Mw,...Pw]),M=null,be=Sw({},[...Fw,...Iw,...Lw,...Rw]),xe=Object.seal(XC(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),N=null,Se=null,Ce=Object.seal(XC(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}})),we=!0,Te=!0,Ee=!1,De=!0,Oe=!1,ke=!0,Ae=!1,je=!1,Me=null,Ne=null,Pe=!1,Fe=!1,Ie=!1,Le=!1,Re=!0,ze=!1,Be=`user-content-`,Ve=!0,He=!1,P={},Ue=null,We=Sw({},`annotation-xml.audio.colgroup.desc.foreignobject.head.iframe.math.mi.mn.mo.ms.mtext.noembed.noframes.noscript.plaintext.script.selectedcontent.style.svg.template.thead.title.video.xmp`.split(`.`)),Ge=null,Ke=Sw({},[`audio`,`video`,`img`,`source`,`image`,`track`]),qe=null,Je=Sw({},[`alt`,`class`,`for`,`id`,`label`,`name`,`pattern`,`placeholder`,`role`,`summary`,`title`,`value`,`style`,`xmlns`]),Ye=`http://www.w3.org/1998/Math/MathML`,Xe=`http://www.w3.org/2000/svg`,Ze=`http://www.w3.org/1999/xhtml`,Qe=Ze,$e=!1,et=null,tt=Sw({},[Ye,Xe,Ze],sw),nt=JC([`mi`,`mo`,`mn`,`ms`,`mtext`]),rt=Sw({},nt),it=JC([`annotation-xml`]),at=Sw({},it),ot=Sw({},[`title`,`style`,`font`,`a`,`script`]),st=null,ct=[`application/xhtml+xml`,`text/html`],lt=null,ut=null,dt=n.createElement(`form`),ft=function(e){return e instanceof RegExp||e instanceof Function},pt=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(ut&&ut===e)return;(!e||typeof e!=`object`)&&(e={}),e=ww(e),st=ct.indexOf(e.PARSER_MEDIA_TYPE)===-1?`text/html`:e.PARSER_MEDIA_TYPE,lt=st===`application/xhtml+xml`?sw:ow,ye=oT(e,`ALLOWED_TAGS`,j,{transform:lt}),M=oT(e,`ALLOWED_ATTR`,be,{transform:lt}),et=oT(e,`ALLOWED_NAMESPACES`,tt,{transform:sw}),qe=oT(e,`ADD_URI_SAFE_ATTR`,Je,{transform:lt,base:Je}),Ge=oT(e,`ADD_DATA_URI_TAGS`,Ke,{transform:lt,base:Ke}),Ue=oT(e,`FORBID_CONTENTS`,We,{transform:lt}),N=oT(e,`FORBID_TAGS`,ww({}),{transform:lt}),Se=oT(e,`FORBID_ATTR`,ww({}),{transform:lt}),P=gw(e,`USE_PROFILES`)?e.USE_PROFILES&&typeof e.USE_PROFILES==`object`?ww(e.USE_PROFILES):e.USE_PROFILES:!1,we=e.ALLOW_ARIA_ATTR!==!1,Te=e.ALLOW_DATA_ATTR!==!1,Ee=e.ALLOW_UNKNOWN_PROTOCOLS||!1,De=e.ALLOW_SELF_CLOSE_IN_ATTR!==!1,Oe=e.SAFE_FOR_TEMPLATES||!1,ke=e.SAFE_FOR_XML!==!1,Ae=e.WHOLE_DOCUMENT||!1,Fe=e.RETURN_DOM||!1,Ie=e.RETURN_DOM_FRAGMENT||!1,Le=e.RETURN_TRUSTED_TYPE||!1,Pe=e.FORCE_BODY||!1,Re=e.SANITIZE_DOM!==!1,ze=e.SANITIZE_NAMED_PROPS||!1,Ve=e.KEEP_CONTENT!==!1,He=e.IN_PLACE||!1,ve=Dw(e.ALLOWED_URI_REGEXP)?e.ALLOWED_URI_REGEXP:Ww,Qe=typeof e.NAMESPACE==`string`?e.NAMESPACE:Ze,rt=sT(e,`MATHML_TEXT_INTEGRATION_POINTS`,()=>Sw({},nt)),at=sT(e,`HTML_INTEGRATION_POINTS`,()=>Sw({},it));let t=sT(e,`CUSTOM_ELEMENT_HANDLING`,()=>XC(null));if(xe=XC(null),gw(t,`tagNameCheck`)&&ft(t.tagNameCheck)&&(xe.tagNameCheck=t.tagNameCheck),gw(t,`attributeNameCheck`)&&ft(t.attributeNameCheck)&&(xe.attributeNameCheck=t.attributeNameCheck),gw(t,`allowCustomizedBuiltInElements`)&&typeof t.allowCustomizedBuiltInElements==`boolean`&&(xe.allowCustomizedBuiltInElements=t.allowCustomizedBuiltInElements),YC(xe),Oe&&(Te=!1),Ie&&(Fe=!0),P&&(ye=Sw({},Pw),M=XC(null),P.html===!0&&(Sw(ye,Ow),Sw(M,Fw)),P.svg===!0&&(Sw(ye,kw),Sw(M,Iw),Sw(M,Rw)),P.svgFilters===!0&&(Sw(ye,Aw),Sw(M,Iw),Sw(M,Rw)),P.mathMl===!0&&(Sw(ye,Mw),Sw(M,Lw),Sw(M,Rw))),Ce.tagCheck=null,Ce.attributeCheck=null,gw(e,`ADD_TAGS`)&&(typeof e.ADD_TAGS==`function`?Ce.tagCheck=e.ADD_TAGS:aw(e.ADD_TAGS)&&(ye===j&&(ye=ww(ye)),Sw(ye,e.ADD_TAGS,lt))),gw(e,`ADD_ATTR`)&&(typeof e.ADD_ATTR==`function`?Ce.attributeCheck=e.ADD_ATTR:aw(e.ADD_ATTR)&&(M===be&&(M=ww(M)),Sw(M,e.ADD_ATTR,lt))),gw(e,`ADD_FORBID_CONTENTS`)&&aw(e.ADD_FORBID_CONTENTS)&&(Ue===We&&(Ue=ww(Ue)),Sw(Ue,e.ADD_FORBID_CONTENTS,lt)),Ve&&(ye[`#text`]=!0),Ae&&Sw(ye,[`html`,`head`,`body`]),ye.table&&(Sw(ye,[`tbody`]),delete N.tbody),e.TRUSTED_TYPES_POLICY){if(typeof e.TRUSTED_TYPES_POLICY.createHTML!=`function`)throw yw(`TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.`);if(typeof e.TRUSTED_TYPES_POLICY.createScriptURL!=`function`)throw yw(`TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.`);let t=T;T=e.TRUSTED_TYPES_POLICY;try{E=ne(``)}catch(e){throw T=t,e}}else e.TRUSTED_TYPES_POLICY===null?(T=void 0,E=``):(T===void 0&&(T=ie()),T&&typeof E==`string`&&(E=ne(``)));JC&&JC(e),ut=e},mt=Sw({},[...kw,...Aw,...jw]),ht=Sw({},[...Mw,...Nw]),gt=function(e,t,n){return t.namespaceURI===Ze?e===`svg`:t.namespaceURI===Ye?e===`svg`&&(n===`annotation-xml`||rt[n]):!!mt[e]},_t=function(e,t,n){return t.namespaceURI===Ze?e===`math`:t.namespaceURI===Xe?e===`math`&&at[n]:!!ht[e]},vt=function(e,t,n){return t.namespaceURI===Xe&&!at[n]||t.namespaceURI===Ye&&!rt[n]?!1:!ht[e]&&(ot[e]||!mt[e])},yt=function(e){let t=_(e);(!t||!t.tagName)&&(t={namespaceURI:Qe,tagName:`template`});let n=ow(e.tagName),r=ow(t.tagName);return et[e.namespaceURI]?e.namespaceURI===Xe?gt(n,t,r):e.namespaceURI===Ye?_t(n,t,r):e.namespaceURI===Ze?vt(n,t,r):!!(st===`application/xhtml+xml`&&et[e.namespaceURI]):!1},bt=function(e){rw(t.removed,{element:e});try{_(e).removeChild(e)}catch{if(p(e),!_(e))throw yw(`a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place`)}},xt=function(e,t,n){try{m(e,t)}catch{try{e.removeAttribute(n)}catch{}}},St=function(e){Tt(e);let t=g(e);if(t){let e=[];ew(t,t=>{rw(e,t)}),ew(e,e=>{try{p(e)}catch{}})}let n=y(e);if(n)for(let t=n.length-1;t>=0;--t){let r=n[t],i=r&&r.name;typeof i==`string`&&xt(e,r,i)}},Ct=function(e,n,r){if(!r)try{r=n.getAttributeNode(e)}catch{r=null}rw(t.removed,{attribute:r||null,from:n});try{r?m(n,r):n.removeAttribute(e)}catch{try{n.removeAttribute(e)}catch{}}if(e===`is`){if(Fe||Ie)try{bt(n)}catch{}else try{n.setAttribute(e,``)}catch{}}},wt=function(e){let t=y(e);if(t)for(let n=t.length-1;n>=0;--n){let r=t[n],i=r&&r.name;typeof i!=`string`||M[lt(i)]||xt(e,r,i)}},Tt=function(e){let t=[e];for(;t.length>0;){let e=t.pop();C(e)===$w.element&&wt(e);let n=g(e);if(n)for(let e=n.length-1;e>=0;--e)t.push(n[e])}},Et=function(e,t){return ke?e===`patchsrc`||e===`for`&&t!==`label`&&t!==`output`:!1},Dt=function(e){if(!ke)return;let t=[e];for(;t.length>0;){let e=t.pop(),n=C(e);if(n===$w.processingInstruction||n===$w.comment&&vw(Xw,e.data)){try{p(e)}catch{}continue}if(n===$w.element){let t=e,n=lt(w(e));try{t.hasAttribute&&t.hasAttribute(`patchsrc`)&&t.removeAttribute(`patchsrc`),t.hasAttribute&&t.hasAttribute(`for`)&&Et(`for`,n)&&t.removeAttribute(`for`)}catch{}}let r=g(e);if(r)for(let e=r.length-1;e>=0;--e)t.push(r[e])}},Ot=function(e){let t=null,r=null;if(Pe)e=`<remove></remove>`+e;else{let t=cw(e,/^[\r\n\t ]+/);r=t&&t[0]}st===`application/xhtml+xml`&&Qe===Ze&&(e=`<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>`+e+`</body></html>`);let i=T?ne(e):e;if(Qe===Ze)try{t=new l().parseFromString(i,st)}catch{}if(!t||!t.documentElement){t=ae.createDocument(Qe,`template`,null);try{t.documentElement.innerHTML=$e?E:i}catch{}}let a=t.body||t.documentElement;return e&&r&&a.insertBefore(n.createTextNode(r),a.childNodes[0]||null),Qe===Ze?se.call(t,Ae?`html`:`body`)[0]:Ae?t.documentElement:a},kt=function(e){let t=S?S(e):e.ownerDocument;return A.call(t||e,e,c.SHOW_ELEMENT|c.SHOW_COMMENT|c.SHOW_TEXT|c.SHOW_PROCESSING_INSTRUCTION|c.SHOW_CDATA_SECTION,null)},At=function(e){return e=lw(e,ue,` `),e=lw(e,de,` `),e=lw(e,fe,` `),e},jt=function(e){e.normalize();let t=S?S(e):e.ownerDocument,n=A.call(t||e,e,c.SHOW_TEXT|c.SHOW_COMMENT|c.SHOW_CDATA_SECTION|c.SHOW_PROCESSING_INSTRUCTION,null),r=n.nextNode();for(;r;)r.data=At(r.data),r=n.nextNode();let i=e.querySelectorAll?.call(e,`template`);i&&ew(i,e=>{Nt(e.content)&&jt(e.content)})},Mt=function(e){let t=x?x(e):null;return typeof t!=`string`||lt(t)!==`form`?!1:typeof e.nodeName!=`string`||typeof e.textContent!=`string`||typeof e.removeChild!=`function`||e.attributes!==y(e)||typeof e.removeAttribute!=`function`||typeof e.removeAttributeNode!=`function`||typeof e.getAttributeNode!=`function`||typeof e.setAttribute!=`function`||typeof e.namespaceURI!=`string`||typeof e.insertBefore!=`function`||typeof e.hasChildNodes!=`function`||e.nodeType!==b(e)||e.childNodes!==g(e)},Nt=function(e){if(!b||typeof e!=`object`||!e)return!1;try{return b(e)===$w.documentFragment}catch{return!1}},Pt=function(e){if(!b||typeof e!=`object`||!e)return!1;try{return typeof b(e)==`number`}catch{return!1}};function Ft(e,n,r){e.length!==0&&ew(e,e=>{e.call(t,n,r,ut)})}let It=function(e,t){return!!(ke&&e.hasChildNodes()&&!Pt(e.firstElementChild)&&vw(Yw,e.textContent)&&vw(Yw,e.innerHTML)||ke&&e.namespaceURI===Ze&&tT[t]&&(Pt(e.firstElementChild)||typeof e.textContent==`string`&&vw(nT[t],e.textContent))||e.nodeType===$w.processingInstruction||ke&&e.nodeType===$w.comment&&vw(Xw,e.data))},Lt=function(e,t){return e instanceof RegExp?vw(e,t):e instanceof Function&&!!e(t,...[...arguments].slice(2))},Rt=function(e,t,n){if(!N[t]&&Wt(t)&&Lt(xe.tagNameCheck,t))return!1;if(Ve&&!Ue[t]){let t=_(e),r=g(e);if(r&&t){let i=r.length;for(let a=i-1;a>=0;--a){let i=e===n?f(r[a],!0):r[a];t.insertBefore(i,h(e))}}}return bt(e),!0},zt=function(e,t,n,r){return e.length===0?t:t===n||t===r?ww(t):t},Bt=function(e,t){return e===t||_(e)!==null?!1:(He&&Tt(e),!0)},Vt=function(e,n){if(Ft(le.beforeSanitizeElements,e,null),Bt(e,n))return!0;if(Mt(e))return bt(e),!0;let r=lt(w(e));if(ye=zt(le.uponSanitizeElement,ye,j,Me),Ft(le.uponSanitizeElement,e,{tagName:r,allowedTags:ye}),Bt(e,n))return!0;if(It(e,r))return bt(e),!0;if(N[r]||!(Ce.tagCheck instanceof Function&&Ce.tagCheck(r))&&!ye[r]){let t=Rt(e,r,n);return t===!1&&(Ft(le.afterSanitizeElements,e,null),Bt(e,n))?!0:t}if(C(e)===$w.element&&!yt(e)||(r===`noscript`||r===`noembed`||r===`noframes`)&&vw(Zw,e.innerHTML))return bt(e),!0;if(Oe&&e.nodeType===$w.text){let n=At(e.textContent);e.textContent!==n&&(rw(t.removed,{element:e.cloneNode()}),e.textContent=n)}return Ft(le.afterSanitizeElements,e,null),Bt(e,n)},Ht=function(e,t,r){if(Se[t]||Et(t,e)||Re&&(t===`id`||t===`name`)&&(r in n||r in dt))return!1;let i=M[t]||Ce.attributeCheck instanceof Function&&Ce.attributeCheck(t,e);return Te&&vw(pe,t)||we&&vw(me,t)?!0:i?qe[t]||vw(ve,lw(r,ge,``))||(t===`src`||t===`xlink:href`||t===`href`)&&e!==`script`&&uw(r,`data:`)===0&&Ge[e]||Ee&&!vw(he,lw(r,ge,``))?!0:!r:Wt(e)&&Lt(xe.tagNameCheck,e)&&Lt(xe.attributeNameCheck,t,e)||t===`is`&&xe.allowCustomizedBuiltInElements&&Lt(xe.tagNameCheck,r)},Ut=Sw({},[`annotation-xml`,`color-profile`,`font-face`,`font-face-format`,`font-face-name`,`font-face-src`,`font-face-uri`,`missing-glyph`]),Wt=function(e){return!Ut[ow(e)]&&vw(_e,e)},Gt=function(e,t,n,r){if(T&&typeof u==`object`&&typeof u.getAttributeType==`function`&&!n)switch(u.getAttributeType(e,t)){case`TrustedHTML`:return ne(r);case`TrustedScriptURL`:return re(r)}return r},Kt=function(e,t,n,r){try{return n?e.setAttributeNS(n,t,r):e.setAttribute(t,r),!Mt(e)||(bt(e),!1)}catch{return Ct(t,e),!1}},qt=function(e,n){if(Ft(le.beforeSanitizeAttributes,e,null),Bt(e,n))return;let r=e.attributes;if(!r||Mt(e))return;M=zt(le.uponSanitizeAttribute,M,be,Ne);let i={attrName:``,attrValue:``,keepAttr:!0,allowedAttributes:M,forceKeepAttr:void 0},a=r.length,o=lt(e.nodeName);for(;a--;){let n=r[a],s=n.name,c=n.namespaceURI,l=n.value,u=lt(s),d=l,f=s===`value`?d:dw(d),p=!1;if(i.attrName=u,i.attrValue=f,i.keepAttr=!0,i.forceKeepAttr=void 0,Ft(le.uponSanitizeAttribute,e,i),f=i.attrValue,ze&&(u===`id`||u===`name`)&&uw(f,Be)!==0&&(Ct(s,e,n),f=Be+f,p=!0),ke&&vw(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,f)){Ct(s,e,n);continue}if(u===`attributename`&&cw(f,`href`)){Ct(s,e,n);continue}if(!i.forceKeepAttr){if(!i.keepAttr){Ct(s,e,n);continue}if(!De&&vw(Qw,f)){Ct(s,e,n);continue}if(Oe&&(f=At(f)),!Ht(o,u,f)){Ct(s,e,n);continue}f=Gt(o,u,c,f),f!==d&&Kt(e,s,c,f)&&p&&nw(t.removed)}}Ft(le.afterSanitizeAttributes,e,null),Bt(e,n)},Jt=function(e){let t=null,n=kt(e);for(Ft(le.beforeSanitizeShadowDOM,e,null);t=n.nextNode();)if(Ft(le.uponSanitizeShadowNode,t,null),Vt(t,e),qt(t,e),Nt(t.content)&&Jt(t.content),C(t)===$w.element){let e=v(t);Nt(e)&&(Yt(e),Jt(e))}Ft(le.afterSanitizeShadowDOM,e,null)},Yt=function(e){let t=[{node:e,shadow:null}];for(;t.length>0;){let e=t.pop();if(e.shadow){Jt(e.shadow);continue}let n=e.node,r=C(n)===$w.element,i=g(n);if(i)for(let e=i.length-1;e>=0;--e)t.push({node:i[e],shadow:null});if(r){let e=x?x(n):null;if(typeof e==`string`&&lt(e)===`template`){let e=n.content;Nt(e)&&t.push({node:e,shadow:null})}}if(r){let e=v(n);Nt(e)&&t.push({node:null,shadow:e},{node:e,shadow:null})}}};return t.sanitize=function(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=null,a=null,o=null,s=null;if($e=!e,$e&&(e=`<!-->`),typeof e!=`string`&&!Pt(e)&&(e=Tw(e),typeof e!=`string`))throw yw(`dirty is not a string, aborting`);if(!t.isSupported)return e;je?(ye=Me,M=Ne):pt(n),(le.uponSanitizeElement.length>0||le.uponSanitizeAttribute.length>0)&&(ye=ww(ye)),le.uponSanitizeAttribute.length>0&&(M=ww(M)),t.removed=[];let c=He&&typeof e!=`string`&&Pt(e);if(c){Dt(e);let t=w(e);if(typeof t==`string`){let n=lt(t);if(!ye[n]||N[n])throw St(e),yw(`root node is forbidden and cannot be sanitized in-place`)}if(Mt(e))throw St(e),yw(`root node is clobbered and cannot be sanitized in-place`);try{Yt(e)}catch(t){throw St(e),t}}else if(Pt(e))i=Ot(`<!---->`),a=i.ownerDocument.importNode(e,!0),a.nodeType===$w.element&&a.nodeName===`BODY`||a.nodeName===`HTML`?i=a:i.appendChild(a),Yt(i);else{if(!Fe&&!Oe&&!Ae&&e.indexOf(`<`)===-1)return T&&Le?ne(e):e;if(i=Ot(e),!i)return Fe?null:Le?E:``}i&&Pe&&bt(i.firstChild);let l=c?e:i;try{let e=kt(l);for(;o=e.nextNode();)Vt(o,l),qt(o,l),Nt(o.content)&&Jt(o.content)}catch(n){throw c&&(St(e),ew(t.removed,e=>{e.element&&Tt(e.element)})),n}if(c){let n=!1;if(ew(t.removed,t=>{t.element&&(t.element===e&&(n=!0),Tt(t.element))}),n)throw yw(`a node selected for removal could not be safely returned; refusing to sanitize in place`);return Oe&&jt(e),e}if(Fe){if(Oe&&jt(i),Ie)for(s=oe.call(i.ownerDocument);i.firstChild;)s.appendChild(i.firstChild);else s=i;return(M.shadowroot||M.shadowrootmode)&&(s=ce.call(r,s,!0)),s}let u=Ae?i.outerHTML:i.innerHTML;return Ae&&ye[`!doctype`]&&i.ownerDocument&&i.ownerDocument.doctype&&i.ownerDocument.doctype.name&&vw(qw,i.ownerDocument.doctype.name)&&(u=`<!DOCTYPE `+i.ownerDocument.doctype.name+`>
78
+ `+u),Oe&&(u=At(u)),T&&Le?ne(u):u},t.setConfig=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};pt(e),je=!0,Me=ye,Ne=M},t.clearConfig=function(){ut=null,je=!1,Me=null,Ne=null,T=D,E=``},t.isValidAttribute=function(e,t,n){ut||pt({});let r=lt(e),i=lt(t);return Ht(r,i,n)},t.addHook=function(e,t){typeof t==`function`&&gw(le,e)&&rw(le[e],t)},t.removeHook=function(e,t){if(gw(le,e)){if(t!==void 0){let n=tw(le[e],t);return n===-1?void 0:iw(le[e],n,1)[0]}return nw(le[e])}},t.removeHooks=function(e){gw(le,e)&&(le[e]=[])},t.removeAllHooks=function(){le=aT()},t}var lT=cT(),uT=lT;lT.sanitize.bind(lT),lT.isSupported,lT.addHook.bind(lT),lT.removeHook.bind(lT),lT.removeHooks.bind(lT),lT.removeAllHooks.bind(lT),lT.setConfig.bind(lT),lT.clearConfig.bind(lT),lT.isValidAttribute.bind(lT),lT.version,lT.removed;function dT(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var fT=dT();function pT(e){fT=e}var mT={exec:()=>null};function hT(e){let t=[];return n=>{let r=Math.max(0,Math.min(3,n-1)),i=t[r];return i||(i=e(r),t[r]=i),i}}function gT(e,t=``){let n=typeof e==`string`?e:e.source,r={replace:(e,t)=>{let i=typeof t==`string`?t:t.source;return i=i.replace(vT.caret,`$1`),n=n.replace(e,i),r},getRegex:()=>new RegExp(n,t)};return r}var _T=((e=``)=>{try{return!!RegExp(`(?<=1)(?<!1)`+e)}catch{return!1}})(),vT={codeRemoveIndent:/^(?: {0,3}\t| {1,4})/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,endingSpaceTabChar:/[ \t]$/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,leadingSpaceTab:/^[ \t]+/,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,numericCharacterReference:/&#(?:(\d{1,7})|[Xx]([A-Fa-f0-9]{1,6}));/g,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:e=>RegExp(`^( {0,3}${e})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:hT(e=>RegExp(`^ {0,${e}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`)),hrRegex:hT(e=>RegExp(`^ {0,${e}}((?:-[ ]*){3,}|(?:_[ ]*){3,}|(?:\\*[ ]*){3,})(?:\\n+|$)`)),fencesBeginRegex:hT(e=>RegExp(`^ {0,${e}}(?:\`\`\`|~~~)`)),headingBeginRegex:hT(e=>RegExp(`^ {0,${e}}#`)),htmlBeginRegex:hT(e=>RegExp(`^ {0,${e}}(?:</?(?:${NT})(?: +|$|/?>)|<(?:script|pre|style|textarea|!--))`,`i`)),blockquoteBeginRegex:hT(e=>RegExp(`^ {0,${e}}>`))},yT=/^(?:[ \t]*(?:\n|$))+/,bT=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,xT=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,ST=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,CT=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,wT=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,TT=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |fences|blockquote|heading|hr|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,ET=gT(TT).replace(/bull/g,wT).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}(?:\s|$)/).replace(/hr/g,/ {0,3}(?:(?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,``).getRegex(),DT=gT(TT).replace(/bull/g,wT).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}(?:\s|$)/).replace(/hr/g,/ {0,3}(?:(?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),OT=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table|[ \t]+\n)[^\n]+)*)/,kT=/^[^\n]+/,AT=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,jT=gT(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace(`label`,AT).replace(`title`,/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),MT=gT(/^(bull)([ \t][^\n]*?)?(?:\n|$)/).replace(/bull/g,wT).getRegex(),NT=`address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul`,PT=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,FT=gT(`^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n*|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>[^\\n]*\\n*|$)|<![A-Z][\\s\\S]*?(?:>[^\\n]*\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>[^\\n]*\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][a-z0-9-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][a-z0-9-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))`,`i`).replace(`comment`,PT).replace(`tag`,NT).replace(`attribute`,/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),IT=e=>gT(OT).replace(`hr`,ST).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`|lheading`,``).replace(`|table`,``).replace(`blockquote`,` {0,3}>`).replace(`fences`," {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace(`list`,e).replace(`html`,`</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)`).replace(`tag`,NT).getRegex(),LT=IT(/ {0,3}(?:[*+-]|1[.)])[ \t]+[^ \t\n]/),RT=IT(/ {0,3}(?:[*+-]|\d{1,9}[.)])(?:[ \t]|\n|$)/),zT={blockquote:gT(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace(`paragraph`,RT).getRegex(),code:bT,def:jT,fences:xT,heading:CT,hr:ST,html:FT,lheading:ET,list:MT,newline:yT,paragraph:LT,table:mT,text:kT},BT=gT(`^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)`).replace(`hr`,ST).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`blockquote`,` {0,3}>`).replace(`code`,`(?: {4}| {0,3} )[^\\n]`).replace(`fences`," {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace(`list`,` {0,3}(?:[*+-]|1[.)])[ \\t]`).replace(`html`,`</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)`).replace(`tag`,NT).getRegex(),VT={...zT,lheading:DT,table:BT,paragraph:gT(OT).replace(`hr`,ST).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`|lheading`,``).replace(`table`,BT).replace(`blockquote`,` {0,3}>`).replace(`fences`," {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace(`list`,` {0,3}(?:[*+-]|1[.)])[ \\t]+[^ \\t\\n]`).replace(`html`,`</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)`).replace(`tag`,NT).getRegex()},HT={...zT,html:gT(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace(`comment`,PT).replace(/tag/g,`(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b`).getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:mT,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:gT(OT).replace(`hr`,ST).replace(`heading`,` *#{1,6} *[^
79
+ ]`).replace(`lheading`,ET).replace(`|table`,``).replace(`blockquote`,` {0,3}>`).replace(`|fences`,``).replace(`|list`,``).replace(`|html`,``).replace(`|tag`,``).getRegex()},UT=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,WT=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,GT=/^( {2,}|\\)\n(?!\s*$)[ \t]*/,KT=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,qT=/[\p{P}\p{S}]/u,JT=/[\s\p{P}\p{S}]/u,YT=/[^\s\p{P}\p{S}]/u,XT=gT(/^((?![*_])punctSpace)/,`u`).replace(/punctSpace/g,JT).getRegex(),ZT=/[\p{Pi}\p{Ps}"']/u,QT=/(?!~)[\p{P}\p{S}]/u,$T=/(?!~)[\s\p{P}\p{S}]/u,eE=/(?:[^\s\p{P}\p{S}]|~)/u,tE=gT(/link|precode-code|html/,`g`).replace(`link`,/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace(`precode-`,_T?"(?<!`)()":"(^^|[^`])").replace(`code`,/(?<b>`+)[^`]+\k<b>(?!`)/).replace(`html`,/<(?! )[^<>]*?>/).getRegex(),nE=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,rE=gT(nE,`u`).replace(/punct/g,qT).getRegex(),iE=gT(nE,`u`).replace(/punct/g,QT).getRegex(),aE=gT(/^(?:\*+(?:((?!\*)(?!openQuote)punct)|([^\s*]))?)|^_+(?:((?!_)(?!openQuote)punct)|([^\s_]))?/,`u`).replace(/openQuote/g,ZT).replace(/punct/g,qT).getRegex(),oE=`^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)`,sE=gT(oE,`gu`).replace(/notPunctSpace/g,YT).replace(/punctSpace/g,JT).replace(/punct/g,qT).getRegex(),cE=gT(oE,`gu`).replace(/notPunctSpace/g,eE).replace(/punctSpace/g,$T).replace(/punct/g,QT).getRegex(),lE=gT(`^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)[\\s](\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|(?:(?!\\*)punct|notPunctSpace)(\\*+)(?!\\*)(?=notPunctSpace)`,`gu`).replace(/notPunctSpace/g,YT).replace(/punctSpace/g,JT).replace(/punct/g,qT).getRegex(),uE=gT(`^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)`,`gu`).replace(/notPunctSpace/g,YT).replace(/punctSpace/g,JT).replace(/punct/g,qT).getRegex(),dE=gT(`^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)[\\s](_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)|(?:(?!_)punct|notPunctSpace)(_+)(?!_)(?=notPunctSpace)`,`gu`).replace(/notPunctSpace/g,YT).replace(/punctSpace/g,JT).replace(/punct/g,qT).getRegex(),fE=gT(/^~~?(?:((?!~)punct)|[^\s~])/,`u`).replace(/punct/g,qT).getRegex(),pE=gT(`^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)`,`gu`).replace(/notPunctSpace/g,YT).replace(/punctSpace/g,JT).replace(/punct/g,qT).getRegex(),mE=gT(/\\(punct)/,`gu`).replace(/punct/g,qT).getRegex(),hE=gT(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace(`scheme`,/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace(`email`,/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),gE=gT(PT).replace(`(?:-->|$)`,`-->`).getRegex(),_E=gT(`^comment|^</[a-zA-Z][a-zA-Z0-9-]*\\s*>|^<[a-zA-Z][a-zA-Z0-9-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>`).replace(`comment`,gE).replace(`attribute`,/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),vE=/\[(?:\\[\s\S]|[^\[\]\\])*\]/,yE=gT(/(?:\[(?:brackets|\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/).replace(`brackets`,vE).getRegex(),bE=gT(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace(`label`,yE).replace(`href`,/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]+|(?=\))/).replace(`title`,/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),xE=gT(/^!?\[(label)\]\[(ref)\]/).replace(`label`,yE).replace(`ref`,AT).getRegex(),SE=gT(/^!?\[(ref)\](?:\[\])?/).replace(`ref`,AT).getRegex(),CE=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\]){1,999}/,wE=gT(/(?:[^\[\]\\`]*(?:\[(?:brackets|\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\]))){0,999}?[^\[\]\\`]*?/).replace(`brackets`,vE).getRegex(),TE=gT(`reflink|nolink(?!\\()`,`g`).replace(`reflink`,gT(/^!?\[(label)\]\[(ref)\]/).replace(`label`,wE).replace(`ref`,CE).getRegex()).replace(`nolink`,gT(/^!?\[(ref)\](?:\[\])?/).replace(`ref`,CE).getRegex()).getRegex(),EE=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,DE=gT(/(?:mailto:email|xmpp:email(?:\/[A-Za-z0-9@.]+)?)/).replace(/email/g,/[A-Za-z0-9._+-]+@[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![\w-])/).getRegex(),OE={_backpedal:mT,anyPunctuation:mE,autolink:hE,blockSkip:tE,br:GT,code:WT,del:mT,delLDelim:mT,delRDelim:mT,emStrongLDelim:rE,emStrongRDelimAst:sE,emStrongRDelimUnd:uE,escape:UT,link:bE,nolink:SE,punctuation:XT,reflink:xE,reflinkSearch:TE,tag:_E,text:KT,url:mT},kE={...OE,emStrongLDelim:aE,emStrongRDelimAst:lE,emStrongRDelimUnd:dE,link:gT(/^!?\[(label)\]\((.*?)\)/).replace(`label`,yE).getRegex(),reflink:gT(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace(`label`,yE).getRegex()},AE={...OE,emStrongRDelimAst:cE,emStrongLDelim:iE,delLDelim:fE,delRDelim:pE,url:gT(/^emailProtocol|^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace(`emailProtocol`,DE).replace(`protocol`,EE).replace(`email`,/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![\w-])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:gT(/^(?:[^a-zA-Z0-9](?=emailProtocol)|(`+|~+|[^`~])(?:(?=[`~])|(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9](?=emailProtocol)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@))))/).replace(`protocol`,EE).replace(/emailProtocol/g,/(?:mailto|xmpp):/).getRegex()},jE={...AE,br:gT(GT).replace(`{2,}`,`*`).getRegex(),text:gT(AE.text).replace(`\\b_`,`\\b_| {2,}\\n`).replace(/\{2,\}/g,`*`).getRegex()},ME={normal:zT,gfm:VT,pedantic:HT},NE={normal:OE,gfm:AE,breaks:jE,pedantic:kE},PE={"&":`&amp;`,"<":`&lt;`,">":`&gt;`,'"':`&quot;`,"'":`&#39;`},FE=e=>PE[e];function IE(e,t){if(t){if(vT.escapeTest.test(e))return e.replace(vT.escapeReplace,FE)}else if(vT.escapeTestNoEncode.test(e))return e.replace(vT.escapeReplaceNoEncode,FE);return e}function LE(e){return e.replace(vT.numericCharacterReference,(e,t,n)=>{let r=t===void 0?Number.parseInt(n,16):Number.parseInt(t,10);return r===0||r>1114111||r>=55296&&r<=57343?`�`:String.fromCodePoint(r)})}function RE(e){try{e=encodeURI(e).replace(vT.percentDecode,`%`)}catch{return null}return e}function zE(e,t){let n=e.replace(vT.findPipe,(e,t,n)=>{let r=!1,i=t;for(;--i>=0&&n[i]===`\\`;)r=!r;return r?`|`:` |`}).split(vT.splitPipe),r=0;if(n[0].trim()||n.shift(),n.length>0&&!n.at(-1)?.trim()&&n.pop(),t){if(n.length>t)n.splice(t);else for(;n.length<t;)n.push(``)}for(;r<n.length;r++)n[r]=n[r].trim().replace(vT.slashPipe,`|`);return n}function BE(e,t,n){let r=e.length;if(r===0)return``;let i=0;for(;i<r;){let a=e.charAt(r-i-1);if(a===t&&!n)i++;else if(a!==t&&n)i++;else break}return e.slice(0,r-i)}function VE(e){let t=e.split(`
80
+ `),n=t.length-1;for(;n>=0&&vT.blankLine.test(t[n]);)n--;return t.length-n<=2?e:t.slice(0,n+1).join(`
81
+ `)}function HE(e){return e.trim().toLowerCase().toUpperCase().toLowerCase()}function UE(e,t){if(e.indexOf(t[1])===-1)return-1;let n=0;for(let r=0;r<e.length;r++)if(e[r]===`\\`)r++;else if(e[r]===t[0])n++;else if(e[r]===t[1]&&(n--,n<0))return r;return n>0?-2:-1}function WE(e,t=0){let n=t,r=``;for(let t of e)if(t===` `){let e=4-n%4;r+=` `.repeat(e),n+=e}else r+=t,n++;return r}function GE(e,t,n,r,i){let a=t.href,o=t.title||null,s=e[1].replace(i.other.outputLinkReplace,`$1`),c=e[0].charAt(0)===`!`;r.state.inLink=!0;let l=r.state.linkEmitted,u=r.state.inRawBlock;r.state.linkEmitted=!1;let d=r.inlineTokens(s),f=r.state.linkEmitted;if(r.state.linkEmitted=l,r.state.inLink=!1,!c){if(f){r.state.inRawBlock=u;return}r.state.linkEmitted=!0}return{type:c?`image`:`link`,raw:n,href:a,title:o,text:s,tokens:d}}function KE(e,t,n){let r=e.match(n.other.indentCodeCompensation);if(r===null)return t;let i=r[1];return t.split(`
82
82
  `).map(e=>{let t=e.match(n.other.beginningSpace);if(t===null)return e;let[r]=t;return e.slice(Math.min(r.length,i.length))}).join(`
83
- `)}function KE(e,t,n,r){if(!t.includes(`<`))return!1;for(let i=0;i<t.length;i++){if(t[i]===`\\`){i++;continue}if(t[i]==="`"){let e=r.inline.code.exec(t.slice(i));if(e){i+=e[0].length-1;continue}}if(t[i]!==`<`)continue;let a=e.slice(n+i),o=r.inline.tag.exec(a)||r.inline.autolink.exec(a);if(o){if(o[0].length>t.length-i)return!0;i+=o[0].length-1}}return!1}var qE=class{options;rules;lexer;constructor(e){this.options=e||dT}space(e){let t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:`space`,raw:t[0]}}code(e){let t=this.rules.block.code.exec(e);if(t){let e=this.options.pedantic?t[0]:BE(t[0]);return{type:`code`,raw:e,codeBlockStyle:`indented`,text:e.replace(this.rules.other.codeRemoveIndent,``)}}}fences(e){let t=this.rules.block.fences.exec(e);if(t){let e=t[0],n=GE(e,t[3]||``,this.rules);return{type:`code`,raw:e,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation,`$1`):t[2],text:n}}}heading(e){let t=this.rules.block.heading.exec(e);if(t){let e=t[2].trim();if(this.rules.other.endingHash.test(e)){let t=zE(e,`#`);(this.options.pedantic||!t||this.rules.other.endingSpaceTabChar.test(t))&&(e=t.trim())}return{type:`heading`,raw:zE(t[0],`
84
- `),depth:t[1].length,text:e,tokens:this.lexer.inline(e)}}}hr(e){let t=this.rules.block.hr.exec(e);if(t)return{type:`hr`,raw:zE(t[0],`
85
- `)}}blockquote(e){let t=this.rules.block.blockquote.exec(e);if(t){let e=zE(t[0],`
83
+ `)}function qE(e,t,n,r){if(!t.includes(`<`))return!1;for(let i=0;i<t.length;i++){if(t[i]===`\\`){i++;continue}if(t[i]==="`"){let e=r.inline.code.exec(t.slice(i));if(e){i+=e[0].length-1;continue}}if(t[i]!==`<`)continue;let a=e.slice(n+i),o=r.inline.tag.exec(a)||r.inline.autolink.exec(a);if(o){if(o[0].length>t.length-i)return!0;i+=o[0].length-1}}return!1}var JE=class{options;rules;lexer;constructor(e){this.options=e||fT}space(e){let t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:`space`,raw:t[0]}}code(e){let t=this.rules.block.code.exec(e);if(t){let e=this.options.pedantic?t[0]:VE(t[0]);return{type:`code`,raw:e,codeBlockStyle:`indented`,text:e.replace(this.rules.other.codeRemoveIndent,``)}}}fences(e){let t=this.rules.block.fences.exec(e);if(t){let e=t[0],n=KE(e,t[3]||``,this.rules);return{type:`code`,raw:e,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation,`$1`):t[2],text:n}}}heading(e){let t=this.rules.block.heading.exec(e);if(t){let e=t[2].trim();if(this.rules.other.endingHash.test(e)){let t=BE(e,`#`);(this.options.pedantic||!t||this.rules.other.endingSpaceTabChar.test(t))&&(e=t.trim())}return{type:`heading`,raw:BE(t[0],`
84
+ `),depth:t[1].length,text:e,tokens:this.lexer.inline(e)}}}hr(e){let t=this.rules.block.hr.exec(e);if(t)return{type:`hr`,raw:BE(t[0],`
85
+ `)}}blockquote(e){let t=this.rules.block.blockquote.exec(e);if(t){let e=BE(t[0],`
86
86
  `).split(`
87
87
  `),n=``,r=``,i=[];for(;e.length>0;){let t=!1,a=[],o=0;for(;o<e.length;o++)if(this.rules.other.blockquoteStart.test(e[o]))a.push(e[o]),t=!0;else if(!t)a.push(e[o]);else break;e=e.slice(o);let s=a.join(`
88
88
  `),c=s.replace(this.rules.other.blockquoteSetextReplace,`
@@ -97,19 +97,19 @@ ${d.join(`
97
97
  `+e.join(`
98
98
  `),o=this.list(a);i[i.length-1]=o,n=n.substring(0,n.length-u.raw.length)+o.raw,r=r.substring(0,r.length-t.raw.length)+o.raw,e=a.substring(i.at(-1).raw.length).split(`
99
99
  `);continue}}return{type:`blockquote`,raw:n,tokens:i,text:r}}}list(e){let t=this.rules.block.list.exec(e);if(t){let n=t[1].trim(),r=n.length>1,i={type:`list`,raw:``,ordered:r,start:r?+n.slice(0,-1):``,loose:!1,items:[]};n=r?`\\d{1,9}\\${n.slice(-1)}`:`\\${n}`,this.options.pedantic&&(n=r?n:`[*+-]`);let a=this.rules.other.listItemRegex(n),o=!1;for(;e;){let n=!1,r=``,s=``;if(!(t=a.exec(e))||this.rules.block.hr.test(e))break;r=t[0],e=e.substring(r.length);let c=t[2].split(`
100
- `,1)[0],l=t[1].length,u=this.options.pedantic?UE(c,l):c.replace(this.rules.other.leadingSpaceTab,e=>UE(e,l)),d=e.split(`
100
+ `,1)[0],l=t[1].length,u=this.options.pedantic?WE(c,l):c.replace(this.rules.other.leadingSpaceTab,e=>WE(e,l)),d=e.split(`
101
101
  `,1)[0],f=!u.trim(),p=0;if(this.options.pedantic?(p=2,s=u.trimStart()):f?p=l+1:(p=u.search(this.rules.other.nonSpaceChar),p=p>4?1:p,s=u.slice(p),p+=l),f&&this.rules.other.blankLine.test(d)&&(r+=d+`
102
102
  `,e=e.substring(d.length+1),n=!0),!n){let t=this.rules.other.nextBulletRegex(p),n=this.rules.other.hrRegex(p),i=this.rules.other.fencesBeginRegex(p),a=this.rules.other.headingBeginRegex(p),o=this.rules.other.htmlBeginRegex(p),c=this.rules.other.blockquoteBeginRegex(p);for(;e;){let l=e.split(`
103
103
  `,1)[0],m;if(d=l,this.options.pedantic?(d=d.replace(this.rules.other.listReplaceNesting,` `),m=d):m=d.replace(this.rules.other.leadingSpaceTab,e=>e.replace(this.rules.other.tabCharGlobal,` `)),i.test(d)||a.test(d)||o.test(d)||c.test(d)||t.test(d)||n.test(d))break;if(m.search(this.rules.other.nonSpaceChar)>=p||!d.trim())s+=`
104
104
  `+m.slice(p);else{if(f||u.replace(this.rules.other.tabCharGlobal,` `).search(this.rules.other.nonSpaceChar)>=4||i.test(u)||a.test(u)||n.test(u))break;s+=`
105
105
  `+d}f=!d.trim(),r+=l+`
106
- `,e=e.substring(l.length+1),u=m.slice(p)}}i.loose||(o?i.loose=!0:this.rules.other.doubleBlankLine.test(r)&&(o=!0)),i.items.push({type:`list_item`,raw:r,task:!!this.options.gfm&&this.rules.other.listIsTask.test(s),loose:!1,text:s,tokens:[]}),i.raw+=r}let s=i.items.at(-1);if(s)s.raw=s.raw.trimEnd(),s.text=s.text.trimEnd();else return;i.raw=i.raw.trimEnd();for(let e of i.items)if(this.lexer.state.top=!1,e.tokens=this.lexer.blockTokens(e.text,[]),!i.loose){let t=e.tokens.filter(e=>e.type===`space`);i.loose=t.length>0&&t.some(e=>this.rules.other.anyLine.test(e.raw))}for(let e of i.items){let t=e.tokens[0];if(e.task&&(t?.type===`text`||t?.type===`paragraph`)){e.text=e.text.replace(this.rules.other.listReplaceTask,``),t.raw=t.raw.replace(this.rules.other.listReplaceTask,``),t.text=t.text.replace(this.rules.other.listReplaceTask,``);for(let e=this.lexer.inlineQueue.length-1;e>=0;e--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[e].src)){this.lexer.inlineQueue[e].src=this.lexer.inlineQueue[e].src.replace(this.rules.other.listReplaceTask,``);break}let n=this.rules.other.listTaskCheckbox.exec(e.raw);if(n){let t={type:`checkbox`,raw:n[0]+` `,checked:n[0]!==`[ ]`};e.checked=t.checked,i.loose?e.tokens[0]&&[`paragraph`,`text`].includes(e.tokens[0].type)&&`tokens`in e.tokens[0]&&e.tokens[0].tokens?(e.tokens[0].raw=t.raw+e.tokens[0].raw,e.tokens[0].text=t.raw+e.tokens[0].text,e.tokens[0].tokens.unshift(t)):e.tokens.unshift({type:`paragraph`,raw:t.raw,text:t.raw,tokens:[t]}):e.tokens.unshift(t)}}else e.task&&=!1}if(i.loose)for(let e of i.items){e.loose=!0;for(let t of e.tokens)t.type===`text`&&(t.type=`paragraph`)}return i}}html(e){let t=this.rules.block.html.exec(e);if(t){let e=BE(t[0]);return{type:`html`,block:!0,raw:e,pre:t[1]===`pre`||t[1]===`script`||t[1]===`style`,text:e}}}def(e){let t=this.rules.block.def.exec(e);if(t){let e=VE(t[1]).replace(this.rules.other.multipleSpaceGlobal,` `),n=t[2]?t[2].replace(this.rules.other.hrefBrackets,`$1`).replace(this.rules.inline.anyPunctuation,`$1`):``,r=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline.anyPunctuation,`$1`):t[3];return{type:`def`,tag:e,raw:zE(t[0],`
107
- `),href:n,title:r}}}table(e){let t=this.rules.block.table.exec(e);if(!t||!this.rules.other.tableDelimiter.test(t[2]))return;let n=RE(t[1]),r=t[2].replace(this.rules.other.tableAlignChars,``).split(`|`),i=t[3]?.trim()?t[3].replace(this.rules.other.tableRowBlankLine,``).split(`
108
- `):[],a={type:`table`,raw:zE(t[0],`
109
- `),header:[],align:[],rows:[]};if(n.length===r.length){for(let e of r)this.rules.other.tableAlignRight.test(e)?a.align.push(`right`):this.rules.other.tableAlignCenter.test(e)?a.align.push(`center`):this.rules.other.tableAlignLeft.test(e)?a.align.push(`left`):a.align.push(null);for(let e=0;e<n.length;e++)a.header.push({text:n[e],tokens:this.lexer.inline(n[e]),header:!0,align:a.align[e]});for(let e of i)a.rows.push(RE(e,a.header.length).map((e,t)=>({text:e,tokens:this.lexer.inline(e),header:!1,align:a.align[t]})));return a}}lheading(e){let t=this.rules.block.lheading.exec(e);if(t){let e=t[1].trim();return{type:`heading`,raw:zE(t[0],`
106
+ `,e=e.substring(l.length+1),u=m.slice(p)}}i.loose||(o?i.loose=!0:this.rules.other.doubleBlankLine.test(r)&&(o=!0)),i.items.push({type:`list_item`,raw:r,task:!!this.options.gfm&&this.rules.other.listIsTask.test(s),loose:!1,text:s,tokens:[]}),i.raw+=r}let s=i.items.at(-1);if(s)s.raw=s.raw.trimEnd(),s.text=s.text.trimEnd();else return;i.raw=i.raw.trimEnd();for(let e of i.items)if(this.lexer.state.top=!1,e.tokens=this.lexer.blockTokens(e.text,[]),!i.loose){let t=e.tokens.filter(e=>e.type===`space`);i.loose=t.length>0&&t.some(e=>this.rules.other.anyLine.test(e.raw))}for(let e of i.items){let t=e.tokens[0];if(e.task&&(t?.type===`text`||t?.type===`paragraph`)){e.text=e.text.replace(this.rules.other.listReplaceTask,``),t.raw=t.raw.replace(this.rules.other.listReplaceTask,``),t.text=t.text.replace(this.rules.other.listReplaceTask,``);for(let e=this.lexer.inlineQueue.length-1;e>=0;e--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[e].src)){this.lexer.inlineQueue[e].src=this.lexer.inlineQueue[e].src.replace(this.rules.other.listReplaceTask,``);break}let n=this.rules.other.listTaskCheckbox.exec(e.raw);if(n){let t={type:`checkbox`,raw:n[0]+` `,checked:n[0]!==`[ ]`};e.checked=t.checked,i.loose?e.tokens[0]&&[`paragraph`,`text`].includes(e.tokens[0].type)&&`tokens`in e.tokens[0]&&e.tokens[0].tokens?(e.tokens[0].raw=t.raw+e.tokens[0].raw,e.tokens[0].text=t.raw+e.tokens[0].text,e.tokens[0].tokens.unshift(t)):e.tokens.unshift({type:`paragraph`,raw:t.raw,text:t.raw,tokens:[t]}):e.tokens.unshift(t)}}else e.task&&=!1}if(i.loose)for(let e of i.items){e.loose=!0;for(let t of e.tokens)t.type===`text`&&(t.type=`paragraph`)}return i}}html(e){let t=this.rules.block.html.exec(e);if(t){let e=VE(t[0]);return{type:`html`,block:!0,raw:e,pre:t[1]===`pre`||t[1]===`script`||t[1]===`style`,text:e}}}def(e){let t=this.rules.block.def.exec(e);if(t){let e=HE(t[1]).replace(this.rules.other.multipleSpaceGlobal,` `),n=t[2]?t[2].replace(this.rules.other.hrefBrackets,`$1`).replace(this.rules.inline.anyPunctuation,`$1`):``,r=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline.anyPunctuation,`$1`):t[3];return{type:`def`,tag:e,raw:BE(t[0],`
107
+ `),href:n,title:r}}}table(e){let t=this.rules.block.table.exec(e);if(!t||!this.rules.other.tableDelimiter.test(t[2]))return;let n=zE(t[1]),r=t[2].replace(this.rules.other.tableAlignChars,``).split(`|`),i=t[3]?.trim()?t[3].replace(this.rules.other.tableRowBlankLine,``).split(`
108
+ `):[],a={type:`table`,raw:BE(t[0],`
109
+ `),header:[],align:[],rows:[]};if(n.length===r.length){for(let e of r)this.rules.other.tableAlignRight.test(e)?a.align.push(`right`):this.rules.other.tableAlignCenter.test(e)?a.align.push(`center`):this.rules.other.tableAlignLeft.test(e)?a.align.push(`left`):a.align.push(null);for(let e=0;e<n.length;e++)a.header.push({text:n[e],tokens:this.lexer.inline(n[e]),header:!0,align:a.align[e]});for(let e of i)a.rows.push(zE(e,a.header.length).map((e,t)=>({text:e,tokens:this.lexer.inline(e),header:!1,align:a.align[t]})));return a}}lheading(e){let t=this.rules.block.lheading.exec(e);if(t){let e=t[1].trim();return{type:`heading`,raw:BE(t[0],`
110
110
  `),depth:t[2].charAt(0)===`=`?1:2,text:e,tokens:this.lexer.inline(e)}}}paragraph(e){let t=this.rules.block.paragraph.exec(e);if(t){let e=t[1].charAt(t[1].length-1)===`
111
- `?t[1].slice(0,-1):t[1];return{type:`paragraph`,raw:t[0],text:e,tokens:this.lexer.inline(e)}}}text(e){let t=this.rules.block.text.exec(e);if(t)return{type:`text`,raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(e){let t=this.rules.inline.escape.exec(e);if(t)return{type:`escape`,raw:t[0],text:t[1]}}tag(e){let t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&this.rules.other.startATag.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:`html`,raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(e){let t=this.rules.inline.link.exec(e);if(t){let n=t[0].charAt(0)===`!`?2:1;if(!this.options.pedantic&&KE(e,t[1],n,this.rules))return;let r=t[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(r)){if(!this.rules.other.endAngleBracket.test(r))return;let e=zE(r.slice(0,-1),`\\`);if((r.length-e.length)%2==0)return}else{let e=HE(t[2],`()`);if(e===-2)return;if(e>-1){let n=(t[0].indexOf(`!`)===0?5:4)+t[1].length+e;t[2]=t[2].substring(0,e),t[0]=t[0].substring(0,n).trim(),t[3]=``}}let i=t[2],a=``;if(this.options.pedantic){let e=this.rules.other.pedanticHrefTitle.exec(i);e&&(i=e[1],a=e[3])}else a=t[3]?t[3].slice(1,-1):``;return i=i.trim(),this.rules.other.startAngleBracket.test(i)&&(i=this.options.pedantic&&!this.rules.other.endAngleBracket.test(r)?i.slice(1):i.slice(1,-1)),WE(t,{href:i&&i.replace(this.rules.inline.anyPunctuation,`$1`),title:a&&a.replace(this.rules.inline.anyPunctuation,`$1`)},t[0],this.lexer,this.rules)}}reflink(e,t){let n;if((n=this.rules.inline.reflink.exec(e))||(n=this.rules.inline.nolink.exec(e))){let r=n[0].charAt(0)===`!`?2:1;if(!this.options.pedantic&&KE(e,n[1],r,this.rules))return;let i=t[VE((n[2]||n[1]).replace(this.rules.other.multipleSpaceGlobal,` `))];if(!i){let e=n[0].charAt(0);return{type:`text`,raw:e,text:e}}return WE(n,i,n[0],this.lexer,this.rules)}}emStrong(e,t,n=``){let r=this.rules.inline.emStrongLDelim.exec(e);if(!(!r||!r[1]&&!r[2]&&!r[3]&&!r[4]||r[4]&&n.match(this.rules.other.unicodeAlphaNumeric))&&(!(r[1]||r[3])||!n||this.rules.inline.punctuation.exec(n))){let i=[...r[0]].length-1,a,o,s=i,c=0,l=r[0][0],u=n===l,d=l===`*`?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(d.lastIndex=0,t=t.slice(-1*e.length+i);(r=d.exec(t))!==null;){if(a=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!a)continue;if(o=[...a].length,r[3]||r[4]){s+=o;continue}if(r[5]||r[6]){if(i%3&&!((i+o)%3)){c+=o;continue}if(u)break}if(s-=o,s>0)continue;o=Math.min(o,o+s+c);let t=[...r[0]][0].length,n=e.slice(0,i+r.index+t+o);if(Math.min(i,o)%2){let e=n.slice(1,-1);return{type:`em`,raw:n,text:e,tokens:this.lexer.inlineTokens(e)}}let l=n.slice(2,-2);return{type:`strong`,raw:n,text:l,tokens:this.lexer.inlineTokens(l)}}}}codespan(e){let t=this.rules.inline.code.exec(e);if(t){let e=t[2].replace(this.rules.other.newLineCharGlobal,` `),n=this.rules.other.nonSpaceChar.test(e),r=this.rules.other.startingSpaceChar.test(e)&&this.rules.other.endingSpaceChar.test(e);return n&&r&&(e=e.substring(1,e.length-1)),{type:`codespan`,raw:t[0],text:e}}}br(e){let t=this.rules.inline.br.exec(e);if(t)return{type:`br`,raw:t[0]}}del(e,t,n=``){let r=this.rules.inline.delLDelim.exec(e);if(r&&(!r[1]||!n||this.rules.inline.punctuation.exec(n))){let n=[...r[0]].length-1,i,a,o=n,s=this.rules.inline.delRDelim;for(s.lastIndex=0,t=t.slice(-1*e.length+n);(r=s.exec(t))!==null;){if(i=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!i||(a=[...i].length,a!==n))continue;if(r[3]||r[4]){o+=a;continue}if(o-=a,o>0)continue;a=Math.min(a,a+o);let t=[...r[0]][0].length,s=e.slice(0,n+r.index+t+a),c=s.slice(n,-n);return{type:`del`,raw:s,text:c,tokens:this.lexer.inlineTokens(c)}}}}autolink(e){let t=this.rules.inline.autolink.exec(e);if(t){let e,n;return t[2]===`@`?(e=t[1],n=`mailto:`+e):(e=t[1],n=e),{type:`link`,raw:t[0],text:e,href:n,autolink:!0,tokens:[{type:`text`,raw:e,text:e}]}}}url(e){let t;if(t=this.rules.inline.url.exec(e)){let e,n;if(t[2]===`@`)e=t[0],n=`mailto:`+e;else{let r;do r=t[0],t[0]=this.rules.inline._backpedal.exec(t[0])?.[0]??``;while(r!==t[0]);e=t[0],n=t[1]===`www.`?`http://`+t[0]:t[0]}return{type:`link`,raw:t[0],text:e,href:n,autolink:!0,tokens:[{type:`text`,raw:e,text:e}]}}}inlineText(e){let t=this.rules.inline.text.exec(e);if(t){let e=this.lexer.state.inRawBlock;return{type:`text`,raw:t[0],text:e?t[0]:IE(t[0]),escaped:e}}}},JE=class e{tokens;options;state;inlineQueue;tokenizer;constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||dT,this.options.tokenizer=this.options.tokenizer||new qE,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,linkEmitted:!1,top:!0};let t={other:_T,block:jE.normal,inline:ME.normal};this.options.pedantic?(t.block=jE.pedantic,t.inline=ME.pedantic):this.options.gfm&&(t.block=jE.gfm,t.inline=this.options.breaks?ME.breaks:ME.gfm),this.tokenizer.rules=t}static get rules(){return{block:jE,inline:ME}}static lex(t,n){return new e(n).lex(t)}static lexInline(t,n){return new e(n).inlineTokens(t)}lex(e){e=e.replace(_T.carriageReturn,`
112
- `),this.blockTokens(e,this.tokens);for(let e=0;e<this.inlineQueue.length;e++){let t=this.inlineQueue[e];this.inlineTokens(t.src,t.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,t=[],n=!1){this.tokenizer.lexer=this,this.options.pedantic&&(e=e.replace(_T.tabCharGlobal,` `).replace(_T.spaceLine,``));let r=1/0;for(;e;){if(e.length<r)r=e.length;else{this.infiniteLoopError(e.charCodeAt(0));break}let i;if(this.options.extensions?.block?.some(n=>(i=n.call({lexer:this},e,t))?(e=e.substring(i.raw.length),t.push(i),!0):!1))continue;if(i=this.tokenizer.space(e)){e=e.substring(i.raw.length);let n=t.at(-1);i.raw.length===1&&n!==void 0?n.raw+=`
111
+ `?t[1].slice(0,-1):t[1];return{type:`paragraph`,raw:t[0],text:e,tokens:this.lexer.inline(e)}}}text(e){let t=this.rules.block.text.exec(e);if(t)return{type:`text`,raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(e){let t=this.rules.inline.escape.exec(e);if(t)return{type:`escape`,raw:t[0],text:t[1]}}tag(e){let t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&this.rules.other.startATag.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:`html`,raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(e){let t=this.rules.inline.link.exec(e);if(t){let n=t[0].charAt(0)===`!`?2:1;if(!this.options.pedantic&&qE(e,t[1],n,this.rules))return;let r=t[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(r)){if(!this.rules.other.endAngleBracket.test(r))return;let e=BE(r.slice(0,-1),`\\`);if((r.length-e.length)%2==0)return}else{let e=UE(t[2],`()`);if(e===-2)return;if(e>-1){let n=(t[0].indexOf(`!`)===0?5:4)+t[1].length+e;t[2]=t[2].substring(0,e),t[0]=t[0].substring(0,n).trim(),t[3]=``}}let i=t[2],a=``;if(this.options.pedantic){let e=this.rules.other.pedanticHrefTitle.exec(i);e&&(i=e[1],a=e[3])}else a=t[3]?t[3].slice(1,-1):``;return i=i.trim(),this.rules.other.startAngleBracket.test(i)&&(i=this.options.pedantic&&!this.rules.other.endAngleBracket.test(r)?i.slice(1):i.slice(1,-1)),GE(t,{href:i&&i.replace(this.rules.inline.anyPunctuation,`$1`),title:a&&a.replace(this.rules.inline.anyPunctuation,`$1`)},t[0],this.lexer,this.rules)}}reflink(e,t){let n;if((n=this.rules.inline.reflink.exec(e))||(n=this.rules.inline.nolink.exec(e))){let r=n[0].charAt(0)===`!`?2:1;if(!this.options.pedantic&&qE(e,n[1],r,this.rules))return;let i=t[HE((n[2]||n[1]).replace(this.rules.other.multipleSpaceGlobal,` `))];if(!i){let e=n[0].charAt(0);return{type:`text`,raw:e,text:e}}return GE(n,i,n[0],this.lexer,this.rules)}}emStrong(e,t,n=``){let r=this.rules.inline.emStrongLDelim.exec(e);if(!(!r||!r[1]&&!r[2]&&!r[3]&&!r[4]||r[4]&&n.match(this.rules.other.unicodeAlphaNumeric))&&(!(r[1]||r[3])||!n||this.rules.inline.punctuation.exec(n))){let i=[...r[0]].length-1,a,o,s=i,c=0,l=r[0][0],u=n===l,d=l===`*`?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(d.lastIndex=0,t=t.slice(-1*e.length+i);(r=d.exec(t))!==null;){if(a=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!a)continue;if(o=[...a].length,r[3]||r[4]){s+=o;continue}if(r[5]||r[6]){if(i%3&&!((i+o)%3)){c+=o;continue}if(u)break}if(s-=o,s>0)continue;o=Math.min(o,o+s+c);let t=[...r[0]][0].length,n=e.slice(0,i+r.index+t+o);if(Math.min(i,o)%2){let e=n.slice(1,-1);return{type:`em`,raw:n,text:e,tokens:this.lexer.inlineTokens(e)}}let l=n.slice(2,-2);return{type:`strong`,raw:n,text:l,tokens:this.lexer.inlineTokens(l)}}}}codespan(e){let t=this.rules.inline.code.exec(e);if(t){let e=t[2].replace(this.rules.other.newLineCharGlobal,` `),n=this.rules.other.nonSpaceChar.test(e),r=this.rules.other.startingSpaceChar.test(e)&&this.rules.other.endingSpaceChar.test(e);return n&&r&&(e=e.substring(1,e.length-1)),{type:`codespan`,raw:t[0],text:e}}}br(e){let t=this.rules.inline.br.exec(e);if(t)return{type:`br`,raw:t[0]}}del(e,t,n=``){let r=this.rules.inline.delLDelim.exec(e);if(r&&(!r[1]||!n||this.rules.inline.punctuation.exec(n))){let n=[...r[0]].length-1,i,a,o=n,s=this.rules.inline.delRDelim;for(s.lastIndex=0,t=t.slice(-1*e.length+n);(r=s.exec(t))!==null;){if(i=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!i||(a=[...i].length,a!==n))continue;if(r[3]||r[4]){o+=a;continue}if(o-=a,o>0)continue;a=Math.min(a,a+o);let t=[...r[0]][0].length,s=e.slice(0,n+r.index+t+a),c=s.slice(n,-n);return{type:`del`,raw:s,text:c,tokens:this.lexer.inlineTokens(c)}}}}autolink(e){let t=this.rules.inline.autolink.exec(e);if(t){let e,n;return t[2]===`@`?(e=t[1],n=`mailto:`+e):(e=t[1],n=e),{type:`link`,raw:t[0],text:e,href:n,autolink:!0,tokens:[{type:`text`,raw:e,text:e}]}}}url(e){let t;if(t=this.rules.inline.url.exec(e)){let e,n;if(t[2]===`@`)e=t[0],n=`mailto:`+e;else{let r;do r=t[0],t[0]=this.rules.inline._backpedal.exec(t[0])?.[0]??``;while(r!==t[0]);e=t[0],n=t[1]===`www.`?`http://`+t[0]:t[0]}return{type:`link`,raw:t[0],text:e,href:n,autolink:!0,tokens:[{type:`text`,raw:e,text:e}]}}}inlineText(e){let t=this.rules.inline.text.exec(e);if(t){let e=this.lexer.state.inRawBlock;return{type:`text`,raw:t[0],text:e?t[0]:LE(t[0]),escaped:e}}}},YE=class e{tokens;options;state;inlineQueue;tokenizer;constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||fT,this.options.tokenizer=this.options.tokenizer||new JE,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,linkEmitted:!1,top:!0};let t={other:vT,block:ME.normal,inline:NE.normal};this.options.pedantic?(t.block=ME.pedantic,t.inline=NE.pedantic):this.options.gfm&&(t.block=ME.gfm,t.inline=this.options.breaks?NE.breaks:NE.gfm),this.tokenizer.rules=t}static get rules(){return{block:ME,inline:NE}}static lex(t,n){return new e(n).lex(t)}static lexInline(t,n){return new e(n).inlineTokens(t)}lex(e){e=e.replace(vT.carriageReturn,`
112
+ `),this.blockTokens(e,this.tokens);for(let e=0;e<this.inlineQueue.length;e++){let t=this.inlineQueue[e];this.inlineTokens(t.src,t.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,t=[],n=!1){this.tokenizer.lexer=this,this.options.pedantic&&(e=e.replace(vT.tabCharGlobal,` `).replace(vT.spaceLine,``));let r=1/0;for(;e;){if(e.length<r)r=e.length;else{this.infiniteLoopError(e.charCodeAt(0));break}let i;if(this.options.extensions?.block?.some(n=>(i=n.call({lexer:this},e,t))?(e=e.substring(i.raw.length),t.push(i),!0):!1))continue;if(i=this.tokenizer.space(e)){e=e.substring(i.raw.length);let n=t.at(-1);i.raw.length===1&&n!==void 0?n.raw+=`
113
113
  `:t.push(i);continue}if(i=this.tokenizer.code(e)){e=e.substring(i.raw.length);let n=t.at(-1);n?.type===`paragraph`||n?.type===`text`?(n.raw+=(n.raw.endsWith(`
114
114
  `)?``:`
115
115
  `)+i.raw,n.text+=`
@@ -122,9 +122,9 @@ ${d.join(`
122
122
  `+i.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=r.text):t.push(i),n=a.length!==e.length,e=e.substring(i.raw.length);continue}if(i=this.tokenizer.text(e)){e=e.substring(i.raw.length);let n=t.at(-1);n?.type===`text`?(n.raw+=(n.raw.endsWith(`
123
123
  `)?``:`
124
124
  `)+i.raw,n.text+=`
125
- `+i.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=n.text):t.push(i);continue}if(e){this.infiniteLoopError(e.charCodeAt(0));break}}return this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}linkInText(e){if(!e.includes(`[`))return!1;let t=this.tokenizer.rules.inline.link;for(let n of e.matchAll(this.tokenizer.rules.inline.blockSkip))if(t.test(n[0])&&e.charAt(n.index-1)!==`!`)return!0;for(let t of e.matchAll(this.tokenizer.rules.inline.reflinkSearch)){let e=t[0],n=e.lastIndexOf(`[`);if(e.charAt(0)!==`!`&&Object.hasOwn(this.tokens.links,VE(e.slice(n+1,-1)))&&!(n>1&&this.linkInText(e.slice(1,n-1))))return!0}return!1}inlineTokens(e,t=[]){this.tokenizer.lexer=this;let n=e;if(this.tokens.links&&e.includes(`[`)){let e=this.tokenizer.rules.inline.reflinkSearch,t=n=>{let r=n.lastIndexOf(`[`);if(!Object.hasOwn(this.tokens.links,VE(n.slice(r+1,-1))))return n;if(r>1&&n.charAt(0)!==`!`){let i=n.slice(1,r-1);if(this.linkInText(i))return`[`+i.replace(e,t)+`][`+`a`.repeat(n.length-r-2)+`]`}return`[`+`a`.repeat(n.length-2)+`]`};n=n.replace(e,t)}n=n.replace(this.tokenizer.rules.inline.anyPunctuation,e=>`+`.repeat(e.length)),n=n.replace(this.tokenizer.rules.inline.blockSkip,(e,t,n)=>{let r=n?n.length:0;return e.slice(0,r)+`[`+`a`.repeat(e.length-r-2)+`]`}),n=this.options.hooks?.emStrongMask?.call({lexer:this},n)??n;let r=!1,i=``,a=1/0;for(;e;){if(e.length<a)a=e.length;else{this.infiniteLoopError(e.charCodeAt(0));break}r||(i=``),r=!1;let o;if(this.options.extensions?.inline?.some(n=>(o=n.call({lexer:this},e,t))?(e=e.substring(o.raw.length),t.push(o),!0):!1))continue;if(o=this.tokenizer.escape(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.tag(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.link(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(o.raw.length);let n=t.at(-1);o.type===`text`&&n?.type===`text`?(n.raw+=o.raw,n.text+=o.text):t.push(o);continue}if(o=this.tokenizer.emStrong(e,n,i)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.codespan(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.br(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.del(e,n,i)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.autolink(e)){e=e.substring(o.raw.length),t.push(o);continue}if(!this.state.inLink&&(o=this.tokenizer.url(e))){e=e.substring(o.raw.length),t.push(o);continue}let s=e;if(this.options.extensions?.startInline){let t=1/0,n=e.slice(1),r;this.options.extensions.startInline.forEach(e=>{r=e.call({lexer:this},n),typeof r==`number`&&r>=0&&(t=Math.min(t,r))}),t<1/0&&t>=0&&(s=e.substring(0,t+1))}if(o=this.tokenizer.inlineText(s)){e=e.substring(o.raw.length),o.raw.slice(-1)!==`_`&&(i=o.raw.slice(-1)),r=!0;let n=t.at(-1);n?.type===`text`?(n.raw+=o.raw,n.text+=o.text):t.push(o);continue}if(e){this.infiniteLoopError(e.charCodeAt(0));break}}return t}infiniteLoopError(e){let t=`Infinite loop on byte: `+e;if(this.options.silent)console.error(t);else throw Error(t)}},YE=class{options;parser;constructor(e){this.options=e||dT}space(e){return``}code({text:e,lang:t,escaped:n}){let r=(t||``).match(_T.notSpaceStart)?.[0],i=e?e.replace(_T.endingNewline,``)+`
126
- `:``;return r?`<pre><code class="language-`+FE(r)+`">`+(n?i:FE(i,!0))+`</code></pre>
127
- `:`<pre><code>`+(n?i:FE(i,!0))+`</code></pre>
125
+ `+i.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=n.text):t.push(i);continue}if(e){this.infiniteLoopError(e.charCodeAt(0));break}}return this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}linkInText(e){if(!e.includes(`[`))return!1;let t=this.tokenizer.rules.inline.link;for(let n of e.matchAll(this.tokenizer.rules.inline.blockSkip))if(t.test(n[0])&&e.charAt(n.index-1)!==`!`)return!0;for(let t of e.matchAll(this.tokenizer.rules.inline.reflinkSearch)){let e=t[0],n=e.lastIndexOf(`[`);if(e.charAt(0)!==`!`&&Object.hasOwn(this.tokens.links,HE(e.slice(n+1,-1)))&&!(n>1&&this.linkInText(e.slice(1,n-1))))return!0}return!1}inlineTokens(e,t=[]){this.tokenizer.lexer=this;let n=e;if(this.tokens.links&&e.includes(`[`)){let e=this.tokenizer.rules.inline.reflinkSearch,t=n=>{let r=n.lastIndexOf(`[`);if(!Object.hasOwn(this.tokens.links,HE(n.slice(r+1,-1))))return n;if(r>1&&n.charAt(0)!==`!`){let i=n.slice(1,r-1);if(this.linkInText(i))return`[`+i.replace(e,t)+`][`+`a`.repeat(n.length-r-2)+`]`}return`[`+`a`.repeat(n.length-2)+`]`};n=n.replace(e,t)}n=n.replace(this.tokenizer.rules.inline.anyPunctuation,e=>`+`.repeat(e.length)),n=n.replace(this.tokenizer.rules.inline.blockSkip,(e,t,n)=>{let r=n?n.length:0;return e.slice(0,r)+`[`+`a`.repeat(e.length-r-2)+`]`}),n=this.options.hooks?.emStrongMask?.call({lexer:this},n)??n;let r=!1,i=``,a=1/0;for(;e;){if(e.length<a)a=e.length;else{this.infiniteLoopError(e.charCodeAt(0));break}r||(i=``),r=!1;let o;if(this.options.extensions?.inline?.some(n=>(o=n.call({lexer:this},e,t))?(e=e.substring(o.raw.length),t.push(o),!0):!1))continue;if(o=this.tokenizer.escape(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.tag(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.link(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(o.raw.length);let n=t.at(-1);o.type===`text`&&n?.type===`text`?(n.raw+=o.raw,n.text+=o.text):t.push(o);continue}if(o=this.tokenizer.emStrong(e,n,i)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.codespan(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.br(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.del(e,n,i)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.autolink(e)){e=e.substring(o.raw.length),t.push(o);continue}if(!this.state.inLink&&(o=this.tokenizer.url(e))){e=e.substring(o.raw.length),t.push(o);continue}let s=e;if(this.options.extensions?.startInline){let t=1/0,n=e.slice(1),r;this.options.extensions.startInline.forEach(e=>{r=e.call({lexer:this},n),typeof r==`number`&&r>=0&&(t=Math.min(t,r))}),t<1/0&&t>=0&&(s=e.substring(0,t+1))}if(o=this.tokenizer.inlineText(s)){e=e.substring(o.raw.length),o.raw.slice(-1)!==`_`&&(i=o.raw.slice(-1)),r=!0;let n=t.at(-1);n?.type===`text`?(n.raw+=o.raw,n.text+=o.text):t.push(o);continue}if(e){this.infiniteLoopError(e.charCodeAt(0));break}}return t}infiniteLoopError(e){let t=`Infinite loop on byte: `+e;if(this.options.silent)console.error(t);else throw Error(t)}},XE=class{options;parser;constructor(e){this.options=e||fT}space(e){return``}code({text:e,lang:t,escaped:n}){let r=(t||``).match(vT.notSpaceStart)?.[0],i=e?e.replace(vT.endingNewline,``)+`
126
+ `:``;return r?`<pre><code class="language-`+IE(r)+`">`+(n?i:IE(i,!0))+`</code></pre>
127
+ `:`<pre><code>`+(n?i:IE(i,!0))+`</code></pre>
128
128
  `}blockquote({tokens:e}){return`<blockquote>
129
129
  ${this.parser.parse(e)}</blockquote>
130
130
  `}html({text:e}){return e}def(e){return``}heading({tokens:e,depth:t}){return`<h${t}>${this.parser.parseInline(e)}</h${t}>
@@ -140,8 +140,8 @@ ${this.parser.parse(e)}</blockquote>
140
140
  `}tablerow({text:e}){return`<tr>
141
141
  ${e}</tr>
142
142
  `}tablecell(e){let t=this.parser.parseInline(e.tokens),n=e.header?`th`:`td`;return(e.align?`<${n} align="${e.align}">`:`<${n}>`)+t+`</${n}>
143
- `}strong({tokens:e}){return`<strong>${this.parser.parseInline(e)}</strong>`}em({tokens:e}){return`<em>${this.parser.parseInline(e)}</em>`}codespan({text:e}){return`<code>${FE(e,!0)}</code>`}br(e){return`<br>`}del({tokens:e}){return`<del>${this.parser.parseInline(e)}</del>`}link({href:e,title:t,text:n,tokens:r,autolink:i}){let a=i?FE(n,!0):this.parser.parseInline(r),o=LE(e);if(o===null)return a;e=FE(o,i);let s=`<a href="`+e+`"`;return t&&(s+=` title="`+FE(t)+`"`),s+=`>`+a+`</a>`,s}image({href:e,title:t,text:n,tokens:r}){r&&(n=this.parser.parseInline(r,this.parser.textRenderer));let i=LE(e);if(i===null)return FE(n);e=i;let a=`<img src="${FE(e)}" alt="${FE(n)}"`;return t&&(a+=` title="${FE(t)}"`),a+=`>`,a}text(e){return`tokens`in e&&e.tokens?this.parser.parseInline(e.tokens):`escaped`in e&&e.escaped?e.text:FE(e.text)}},XE=class{strong({text:e}){return e}em({text:e}){return e}codespan({text:e}){return e}del({text:e}){return e}html({text:e}){return e}text({text:e}){return e}link({text:e}){return``+e}image({text:e}){return``+e}br(){return``}checkbox({raw:e}){return e}},ZE=class e{options;renderer;textRenderer;constructor(e){this.options=e||dT,this.options.renderer=this.options.renderer||new YE,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new XE}static parse(t,n){return new e(n).parse(t)}static parseInline(t,n){return new e(n).parseInline(t)}parse(e){this.renderer.parser=this;let t=``;for(let n=0;n<e.length;n++){let r=e[n];if(this.options.extensions?.renderers?.[r.type]){let e=r,n=this.options.extensions.renderers[e.type].call({parser:this},e);if(n!==!1||![`space`,`hr`,`heading`,`code`,`table`,`blockquote`,`list`,`checkbox`,`html`,`def`,`paragraph`,`text`].includes(e.type)){t+=n||``;continue}}let i=r;switch(i.type){case`space`:t+=this.renderer.space(i);break;case`hr`:t+=this.renderer.hr(i);break;case`heading`:t+=this.renderer.heading(i);break;case`code`:t+=this.renderer.code(i);break;case`table`:t+=this.renderer.table(i);break;case`blockquote`:t+=this.renderer.blockquote(i);break;case`list`:t+=this.renderer.list(i);break;case`checkbox`:t+=this.renderer.checkbox(i);break;case`html`:t+=this.renderer.html(i);break;case`def`:t+=this.renderer.def(i);break;case`paragraph`:t+=this.renderer.paragraph(i);break;case`text`:t+=this.renderer.text(i);break;default:{let e=`Token with "`+i.type+`" type was not found.`;if(this.options.silent)return console.error(e),``;throw Error(e)}}}return t}parseInline(e,t=this.renderer){this.renderer.parser=this;let n=``;for(let r=0;r<e.length;r++){let i=e[r];if(this.options.extensions?.renderers?.[i.type]){let e=this.options.extensions.renderers[i.type].call({parser:this},i);if(e!==!1||![`escape`,`html`,`link`,`image`,`checkbox`,`strong`,`em`,`codespan`,`br`,`del`,`text`].includes(i.type)){n+=e||``;continue}}let a=i;switch(a.type){case`escape`:n+=t.text(a);break;case`html`:n+=t.html(a);break;case`link`:n+=t.link(a);break;case`image`:n+=t.image(a);break;case`checkbox`:n+=t.checkbox(a);break;case`strong`:n+=t.strong(a);break;case`em`:n+=t.em(a);break;case`codespan`:n+=t.codespan(a);break;case`br`:n+=t.br(a);break;case`del`:n+=t.del(a);break;case`text`:n+=t.text(a);break;default:{let e=`Token with "`+a.type+`" type was not found.`;if(this.options.silent)return console.error(e),``;throw Error(e)}}}return n}},QE=class{options;block;constructor(e){this.options=e||dT}static passThroughHooks=new Set([`preprocess`,`postprocess`,`processAllTokens`,`emStrongMask`]);static passThroughHooksRespectAsync=new Set([`preprocess`,`postprocess`,`processAllTokens`]);preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}emStrongMask(e){return e}provideLexer(e=this.block){return e?JE.lex:JE.lexInline}provideParser(e=this.block){return e?ZE.parse:ZE.parseInline}},$E=class{defaults=uT();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=ZE;Renderer=YE;TextRenderer=XE;Lexer=JE;Tokenizer=qE;Hooks=QE;constructor(...e){this.use(...e)}walkTokens(e,t){let n=[];for(let r of e)switch(n=n.concat(t.call(this,r)),r.type){case`table`:{let e=r;for(let r of e.header)n=n.concat(this.walkTokens(r.tokens,t));for(let r of e.rows)for(let e of r)n=n.concat(this.walkTokens(e.tokens,t));break}case`list`:{let e=r;n=n.concat(this.walkTokens(e.items,t));break}default:{let e=r;this.defaults.extensions?.childTokens?.[e.type]?this.defaults.extensions.childTokens[e.type].forEach(r=>{let i=e[r].flat(1/0);n=n.concat(this.walkTokens(i,t))}):e.tokens&&(n=n.concat(this.walkTokens(e.tokens,t)))}}return n}use(...e){let t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(e=>{let n={...e};if(n.async=this.defaults.async||n.async||!1,e.extensions&&(e.extensions.forEach(e=>{if(!e.name)throw Error(`extension name required`);if(`renderer`in e){let n=t.renderers[e.name];n?t.renderers[e.name]=function(...t){let r=e.renderer.apply(this,t);return r===!1&&(r=n.apply(this,t)),r}:t.renderers[e.name]=e.renderer}if(`tokenizer`in e){if(!e.level||e.level!==`block`&&e.level!==`inline`)throw Error(`extension level must be 'block' or 'inline'`);let n=t[e.level];n?n.unshift(e.tokenizer):t[e.level]=[e.tokenizer],e.start&&(e.level===`block`?t.startBlock?t.startBlock.push(e.start):t.startBlock=[e.start]:e.level===`inline`&&(t.startInline?t.startInline.push(e.start):t.startInline=[e.start]))}`childTokens`in e&&e.childTokens&&(t.childTokens[e.name]=e.childTokens)}),n.extensions=t),e.renderer){let t=this.defaults.renderer||new YE(this.defaults);for(let n in e.renderer){if(!(n in t))throw Error(`renderer '${n}' does not exist`);if([`options`,`parser`].includes(n))continue;let r=n,i=e.renderer[r],a=t[r];t[r]=(...e)=>{let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n||``}}n.renderer=t}if(e.tokenizer){let t=this.defaults.tokenizer||new qE(this.defaults);for(let n in e.tokenizer){if(!(n in t))throw Error(`tokenizer '${n}' does not exist`);if([`options`,`rules`,`lexer`].includes(n))continue;let r=n,i=e.tokenizer[r],a=t[r];t[r]=(...e)=>{let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n}}n.tokenizer=t}if(e.hooks){let t=this.defaults.hooks||new QE;for(let n in e.hooks){if(!(n in t))throw Error(`hook '${n}' does not exist`);if([`options`,`block`].includes(n))continue;let r=n,i=e.hooks[r],a=t[r];t[r]=QE.passThroughHooks.has(n)?e=>{if(this.defaults.async&&QE.passThroughHooksRespectAsync.has(n))return(async()=>{let n=await i.call(t,e);return a.call(t,n)})();let r=i.call(t,e);return a.call(t,r)}:(...e)=>{if(this.defaults.async)return(async()=>{let n=await i.apply(t,e);return n===!1&&(n=await a.apply(t,e)),n})();let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n}}n.hooks=t}if(e.walkTokens){let t=this.defaults.walkTokens,r=e.walkTokens;n.walkTokens=function(e){let n=[];return n.push(r.call(this,e)),t&&(n=n.concat(t.call(this,e))),n}}this.defaults={...this.defaults,...n}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return JE.lex(e,t??this.defaults)}parser(e,t){return ZE.parse(e,t??this.defaults)}parseMarkdown(e){return(t,n)=>{let r={...n},i={...this.defaults,...r},a=this.onError(!!i.silent,!!i.async);if(this.defaults.async===!0&&r.async===!1)return a(Error(`marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise.`));if(typeof t>`u`||t===null)return a(Error(`marked(): input parameter is undefined or null`));if(typeof t!=`string`)return a(Error(`marked(): input parameter is of type `+Object.prototype.toString.call(t)+`, string expected`));if(i.hooks&&(i.hooks.options=i,i.hooks.block=e),i.async)return(async()=>{let n=i.hooks?await i.hooks.preprocess(t):t,r=await(i.hooks?await i.hooks.provideLexer(e):e?JE.lex:JE.lexInline)(n,i),a=i.hooks?await i.hooks.processAllTokens(r):r;i.walkTokens&&await Promise.all(this.walkTokens(a,i.walkTokens));let o=await(i.hooks?await i.hooks.provideParser(e):e?ZE.parse:ZE.parseInline)(a,i);return i.hooks?await i.hooks.postprocess(o):o})().catch(a);try{i.hooks&&(t=i.hooks.preprocess(t));let n=(i.hooks?i.hooks.provideLexer(e):e?JE.lex:JE.lexInline)(t,i);i.hooks&&(n=i.hooks.processAllTokens(n)),i.walkTokens&&this.walkTokens(n,i.walkTokens);let r=(i.hooks?i.hooks.provideParser(e):e?ZE.parse:ZE.parseInline)(n,i);return i.hooks&&(r=i.hooks.postprocess(r)),r}catch(e){return a(e)}}}onError(e,t){return n=>{if(n.message+=`
144
- Please report this to https://github.com/markedjs/marked.`,e){let e=`<p>An error occurred:</p><pre>`+FE(n.message+``,!0)+`</pre>`;return t?Promise.resolve(e):e}if(t)return Promise.reject(n);throw n}}},eD=new $E;function tD(e,t){return eD.parse(e,t)}tD.options=tD.setOptions=function(e){return eD.setOptions(e),tD.defaults=eD.defaults,fT(tD.defaults),tD},tD.getDefaults=uT,tD.defaults=dT;function nD(...e){return eD.use(...e),tD.defaults=eD.defaults,fT(tD.defaults),tD}tD.use=nD,tD.walkTokens=function(e,t){return eD.walkTokens(e,t)},tD.parseInline=eD.parseInline,tD.Parser=ZE,tD.parser=ZE.parse,tD.Renderer=YE,tD.TextRenderer=XE,tD.Lexer=JE,tD.lexer=JE.lex,tD.Tokenizer=qE,tD.Hooks=QE,tD.parse=tD,tD.options,tD.setOptions,tD.walkTokens,tD.parseInline,ZE.parse,JE.lex;function rD(e){return e.replace(/^file:\/\/\/([a-z]:[\\/])/i,`$1`).replace(/^file:\/\//i,``)}function iD(e){return/^[a-z]:[\\/]/i.test(e)}function aD(e){return/^[\\/]/.test(e)||iD(e)}var B=class e extends Error{constructor(t,n){var r=`KaTeX parse error: `+t,i,a,o=n&&n.loc;if(o&&o.start<=o.end){var s=o.lexer.input;i=o.start,a=o.end,i===s.length?r+=` at end of input: `:r+=` at position `+(i+1)+`: `;var c=s.slice(i,a).replace(/[^]/g,`$&̲`),l=i>15?`…`+s.slice(i-15,i):s.slice(0,i),u=a+15<s.length?s.slice(a,a+15)+`…`:s.slice(a);r+=l+c+u}super(r),this.name=`ParseError`,this.position=void 0,this.length=void 0,this.rawMessage=void 0,Object.setPrototypeOf(this,e.prototype),this.position=i,i!=null&&a!=null&&(this.length=a-i),this.rawMessage=t}},oD=/([A-Z])/g,sD=e=>e.replace(oD,`-$1`).toLowerCase(),cD={"&":`&amp;`,">":`&gt;`,"<":`&lt;`,'"':`&quot;`,"'":`&#x27;`},lD=/[&><"']/g,uD=e=>String(e).replace(lD,e=>cD[e]),dD=e=>e.type===`ordgroup`||e.type===`color`?e.body.length===1?dD(e.body[0]):e:e.type===`font`?dD(e.body):e,fD=new Set([`mathord`,`textord`,`atom`]),pD=e=>fD.has(dD(e).type),mD=e=>{var t=/^[\x00-\x20]*([^\\/#?]*?)(:|&#0*58|&#x0*3a|&colon)/i.exec(e);return t?t[2]!==`:`||!/^[a-zA-Z][a-zA-Z0-9+\-.]*$/.test(t[1])?null:t[1].toLowerCase():`_relative`},hD={displayMode:{type:`boolean`,description:`Render math in display mode, which puts the math in display style (so \\int and \\sum are large, for example), and centers the math on the page on its own line.`,cli:`-d, --display-mode`},output:{type:{enum:[`htmlAndMathml`,`html`,`mathml`]},description:`Determines the markup language of the output.`,cli:`-F, --format <type>`},leqno:{type:`boolean`,description:`Render display math in leqno style (left-justified tags).`},fleqn:{type:`boolean`,description:`Render display math flush left.`},throwOnError:{type:`boolean`,default:!0,cli:`-t, --no-throw-on-error`,cliDescription:`Render errors (in the color given by --error-color) instead of throwing a ParseError exception when encountering an error.`},errorColor:{type:`string`,default:`#cc0000`,cli:`-c, --error-color <color>`,cliDescription:`A color string given in the format 'rgb' or 'rrggbb' (no #). This option determines the color of errors rendered by the -t option.`,cliProcessor:e=>`#`+e},macros:{type:`object`,cli:`-m, --macro <def>`,cliDescription:`Define custom macro of the form '\\foo:expansion' (use multiple -m arguments for multiple macros).`,cliDefault:[],cliProcessor:(e,t)=>(t.push(e),t)},minRuleThickness:{type:`number`,description:"Specifies a minimum thickness, in ems, for fraction lines, `\\sqrt` top lines, `{array}` vertical lines, `\\hline`, `\\hdashline`, `\\underline`, `\\overline`, and the borders of `\\fbox`, `\\boxed`, and `\\fcolorbox`.",processor:e=>Math.max(0,e),cli:`--min-rule-thickness <size>`,cliProcessor:parseFloat},colorIsTextColor:{type:`boolean`,description:`Makes \\color behave like LaTeX's 2-argument \\textcolor, instead of LaTeX's one-argument \\color mode change.`,cli:`-b, --color-is-text-color`},strict:{type:[{enum:[`warn`,`ignore`,`error`]},`boolean`,`function`],description:`Turn on strict / LaTeX faithfulness mode, which throws an error if the input uses features that are not supported by LaTeX.`,cli:`-S, --strict`,cliDefault:!1},trust:{type:[`boolean`,`function`],description:`Trust the input, enabling all HTML features such as \\url.`,cli:`-T, --trust`},maxSize:{type:`number`,default:1/0,description:`If non-zero, all user-specified sizes, e.g. in \\rule{500em}{500em}, will be capped to maxSize ems. Otherwise, elements and spaces can be arbitrarily large`,processor:e=>Math.max(0,e),cli:`-s, --max-size <n>`,cliProcessor:parseInt},maxExpand:{type:`number`,default:1e3,description:`Limit the number of macro expansions to the specified number, to prevent e.g. infinite macro loops. If set to Infinity, the macro expander will try to fully expand as in LaTeX.`,processor:e=>Math.max(0,e),cli:`-e, --max-expand <n>`,cliProcessor:e=>e===`Infinity`?1/0:parseInt(e)},globalGroup:{type:`boolean`,cli:!1}};function gD(e){if(typeof e!=`string`)return e.enum[0];switch(e){case`boolean`:return!1;case`string`:return``;case`number`:return 0;case`object`:return{};default:throw Error(`Unexpected schema type; settings must declare an explicit default.`)}}function _D(e){return Object.prototype.hasOwnProperty.call(e,`default`)&&e.default!==void 0?e.default:gD(Array.isArray(e.type)?e.type[0]:e.type)}function vD(e,t,n,r){var i=Object.prototype.hasOwnProperty.call(n,t)?n[t]:void 0,a=Object.prototype.hasOwnProperty.call(r,`processor`)?r.processor:void 0;e[t]=i===void 0?_D(r):a?a(i):i}var yD=class{constructor(e){e===void 0&&(e={}),this.displayMode=void 0,this.output=void 0,this.leqno=void 0,this.fleqn=void 0,this.throwOnError=void 0,this.errorColor=void 0,this.macros=void 0,this.minRuleThickness=void 0,this.colorIsTextColor=void 0,this.strict=void 0,this.trust=void 0,this.maxSize=void 0,this.maxExpand=void 0,this.globalGroup=void 0,e||={};for(var t of Object.keys(hD)){var n=hD[t];n&&vD(this,t,e,n)}}isTrusted(e){if(`url`in e&&e.url&&!e.protocol){var t=mD(e.url);if(t==null)return!1;e.protocol=t}return!!(typeof this.trust==`function`?this.trust(e):this.trust)}},bD=class{constructor(e,t,n){this.id=void 0,this.size=void 0,this.cramped=void 0,this.id=e,this.size=t,this.cramped=n}sup(){return kD[AD[this.id]]}sub(){return kD[jD[this.id]]}fracNum(){return kD[MD[this.id]]}fracDen(){return kD[ND[this.id]]}cramp(){return kD[PD[this.id]]}text(){return kD[FD[this.id]]}isTight(){return this.size>=2}},xD=0,SD=1,CD=2,wD=3,TD=4,ED=5,DD=6,OD=7,kD=[new bD(xD,0,!1),new bD(SD,0,!0),new bD(CD,1,!1),new bD(wD,1,!0),new bD(TD,2,!1),new bD(ED,2,!0),new bD(DD,3,!1),new bD(OD,3,!0)],AD=[TD,ED,TD,ED,DD,OD,DD,OD],jD=[ED,ED,ED,ED,OD,OD,OD,OD],MD=[CD,wD,TD,ED,DD,OD,DD,OD],ND=[wD,wD,ED,ED,OD,OD,OD,OD],PD=[SD,SD,wD,wD,ED,ED,OD,OD],FD=[xD,SD,CD,wD,CD,wD,CD,wD],ID={DISPLAY:kD[xD],TEXT:kD[CD],SCRIPT:kD[TD],SCRIPTSCRIPT:kD[DD]},LD=[{name:`latin`,blocks:[[256,591],[768,879]]},{name:`cyrillic`,blocks:[[1024,1279]]},{name:`armenian`,blocks:[[1328,1423]]},{name:`brahmic`,blocks:[[2304,4255]]},{name:`georgian`,blocks:[[4256,4351]]},{name:`cjk`,blocks:[[12288,12543],[19968,40879],[65280,65376]]},{name:`hangul`,blocks:[[44032,55215]]}];function RD(e){for(var t=0;t<LD.length;t++)for(var n=LD[t],r=0;r<n.blocks.length;r++){var i=n.blocks[r];if(e>=i[0]&&e<=i[1])return n.name}return null}var zD=[];LD.forEach(e=>e.blocks.forEach(e=>zD.push(...e)));function BD(e){for(var t=0;t<zD.length;t+=2)if(e>=zD[t]&&e<=zD[t+1])return!0;return!1}var VD=e=>e+` `+e,HD=80,UD=function(e,t){return`M95,`+(622+e+t)+`
143
+ `}strong({tokens:e}){return`<strong>${this.parser.parseInline(e)}</strong>`}em({tokens:e}){return`<em>${this.parser.parseInline(e)}</em>`}codespan({text:e}){return`<code>${IE(e,!0)}</code>`}br(e){return`<br>`}del({tokens:e}){return`<del>${this.parser.parseInline(e)}</del>`}link({href:e,title:t,text:n,tokens:r,autolink:i}){let a=i?IE(n,!0):this.parser.parseInline(r),o=RE(e);if(o===null)return a;e=IE(o,i);let s=`<a href="`+e+`"`;return t&&(s+=` title="`+IE(t)+`"`),s+=`>`+a+`</a>`,s}image({href:e,title:t,text:n,tokens:r}){r&&(n=this.parser.parseInline(r,this.parser.textRenderer));let i=RE(e);if(i===null)return IE(n);e=i;let a=`<img src="${IE(e)}" alt="${IE(n)}"`;return t&&(a+=` title="${IE(t)}"`),a+=`>`,a}text(e){return`tokens`in e&&e.tokens?this.parser.parseInline(e.tokens):`escaped`in e&&e.escaped?e.text:IE(e.text)}},ZE=class{strong({text:e}){return e}em({text:e}){return e}codespan({text:e}){return e}del({text:e}){return e}html({text:e}){return e}text({text:e}){return e}link({text:e}){return``+e}image({text:e}){return``+e}br(){return``}checkbox({raw:e}){return e}},QE=class e{options;renderer;textRenderer;constructor(e){this.options=e||fT,this.options.renderer=this.options.renderer||new XE,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new ZE}static parse(t,n){return new e(n).parse(t)}static parseInline(t,n){return new e(n).parseInline(t)}parse(e){this.renderer.parser=this;let t=``;for(let n=0;n<e.length;n++){let r=e[n];if(this.options.extensions?.renderers?.[r.type]){let e=r,n=this.options.extensions.renderers[e.type].call({parser:this},e);if(n!==!1||![`space`,`hr`,`heading`,`code`,`table`,`blockquote`,`list`,`checkbox`,`html`,`def`,`paragraph`,`text`].includes(e.type)){t+=n||``;continue}}let i=r;switch(i.type){case`space`:t+=this.renderer.space(i);break;case`hr`:t+=this.renderer.hr(i);break;case`heading`:t+=this.renderer.heading(i);break;case`code`:t+=this.renderer.code(i);break;case`table`:t+=this.renderer.table(i);break;case`blockquote`:t+=this.renderer.blockquote(i);break;case`list`:t+=this.renderer.list(i);break;case`checkbox`:t+=this.renderer.checkbox(i);break;case`html`:t+=this.renderer.html(i);break;case`def`:t+=this.renderer.def(i);break;case`paragraph`:t+=this.renderer.paragraph(i);break;case`text`:t+=this.renderer.text(i);break;default:{let e=`Token with "`+i.type+`" type was not found.`;if(this.options.silent)return console.error(e),``;throw Error(e)}}}return t}parseInline(e,t=this.renderer){this.renderer.parser=this;let n=``;for(let r=0;r<e.length;r++){let i=e[r];if(this.options.extensions?.renderers?.[i.type]){let e=this.options.extensions.renderers[i.type].call({parser:this},i);if(e!==!1||![`escape`,`html`,`link`,`image`,`checkbox`,`strong`,`em`,`codespan`,`br`,`del`,`text`].includes(i.type)){n+=e||``;continue}}let a=i;switch(a.type){case`escape`:n+=t.text(a);break;case`html`:n+=t.html(a);break;case`link`:n+=t.link(a);break;case`image`:n+=t.image(a);break;case`checkbox`:n+=t.checkbox(a);break;case`strong`:n+=t.strong(a);break;case`em`:n+=t.em(a);break;case`codespan`:n+=t.codespan(a);break;case`br`:n+=t.br(a);break;case`del`:n+=t.del(a);break;case`text`:n+=t.text(a);break;default:{let e=`Token with "`+a.type+`" type was not found.`;if(this.options.silent)return console.error(e),``;throw Error(e)}}}return n}},$E=class{options;block;constructor(e){this.options=e||fT}static passThroughHooks=new Set([`preprocess`,`postprocess`,`processAllTokens`,`emStrongMask`]);static passThroughHooksRespectAsync=new Set([`preprocess`,`postprocess`,`processAllTokens`]);preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}emStrongMask(e){return e}provideLexer(e=this.block){return e?YE.lex:YE.lexInline}provideParser(e=this.block){return e?QE.parse:QE.parseInline}},eD=class{defaults=dT();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=QE;Renderer=XE;TextRenderer=ZE;Lexer=YE;Tokenizer=JE;Hooks=$E;constructor(...e){this.use(...e)}walkTokens(e,t){let n=[];for(let r of e)switch(n=n.concat(t.call(this,r)),r.type){case`table`:{let e=r;for(let r of e.header)n=n.concat(this.walkTokens(r.tokens,t));for(let r of e.rows)for(let e of r)n=n.concat(this.walkTokens(e.tokens,t));break}case`list`:{let e=r;n=n.concat(this.walkTokens(e.items,t));break}default:{let e=r;this.defaults.extensions?.childTokens?.[e.type]?this.defaults.extensions.childTokens[e.type].forEach(r=>{let i=e[r].flat(1/0);n=n.concat(this.walkTokens(i,t))}):e.tokens&&(n=n.concat(this.walkTokens(e.tokens,t)))}}return n}use(...e){let t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(e=>{let n={...e};if(n.async=this.defaults.async||n.async||!1,e.extensions&&(e.extensions.forEach(e=>{if(!e.name)throw Error(`extension name required`);if(`renderer`in e){let n=t.renderers[e.name];n?t.renderers[e.name]=function(...t){let r=e.renderer.apply(this,t);return r===!1&&(r=n.apply(this,t)),r}:t.renderers[e.name]=e.renderer}if(`tokenizer`in e){if(!e.level||e.level!==`block`&&e.level!==`inline`)throw Error(`extension level must be 'block' or 'inline'`);let n=t[e.level];n?n.unshift(e.tokenizer):t[e.level]=[e.tokenizer],e.start&&(e.level===`block`?t.startBlock?t.startBlock.push(e.start):t.startBlock=[e.start]:e.level===`inline`&&(t.startInline?t.startInline.push(e.start):t.startInline=[e.start]))}`childTokens`in e&&e.childTokens&&(t.childTokens[e.name]=e.childTokens)}),n.extensions=t),e.renderer){let t=this.defaults.renderer||new XE(this.defaults);for(let n in e.renderer){if(!(n in t))throw Error(`renderer '${n}' does not exist`);if([`options`,`parser`].includes(n))continue;let r=n,i=e.renderer[r],a=t[r];t[r]=(...e)=>{let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n||``}}n.renderer=t}if(e.tokenizer){let t=this.defaults.tokenizer||new JE(this.defaults);for(let n in e.tokenizer){if(!(n in t))throw Error(`tokenizer '${n}' does not exist`);if([`options`,`rules`,`lexer`].includes(n))continue;let r=n,i=e.tokenizer[r],a=t[r];t[r]=(...e)=>{let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n}}n.tokenizer=t}if(e.hooks){let t=this.defaults.hooks||new $E;for(let n in e.hooks){if(!(n in t))throw Error(`hook '${n}' does not exist`);if([`options`,`block`].includes(n))continue;let r=n,i=e.hooks[r],a=t[r];t[r]=$E.passThroughHooks.has(n)?e=>{if(this.defaults.async&&$E.passThroughHooksRespectAsync.has(n))return(async()=>{let n=await i.call(t,e);return a.call(t,n)})();let r=i.call(t,e);return a.call(t,r)}:(...e)=>{if(this.defaults.async)return(async()=>{let n=await i.apply(t,e);return n===!1&&(n=await a.apply(t,e)),n})();let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n}}n.hooks=t}if(e.walkTokens){let t=this.defaults.walkTokens,r=e.walkTokens;n.walkTokens=function(e){let n=[];return n.push(r.call(this,e)),t&&(n=n.concat(t.call(this,e))),n}}this.defaults={...this.defaults,...n}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return YE.lex(e,t??this.defaults)}parser(e,t){return QE.parse(e,t??this.defaults)}parseMarkdown(e){return(t,n)=>{let r={...n},i={...this.defaults,...r},a=this.onError(!!i.silent,!!i.async);if(this.defaults.async===!0&&r.async===!1)return a(Error(`marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise.`));if(typeof t>`u`||t===null)return a(Error(`marked(): input parameter is undefined or null`));if(typeof t!=`string`)return a(Error(`marked(): input parameter is of type `+Object.prototype.toString.call(t)+`, string expected`));if(i.hooks&&(i.hooks.options=i,i.hooks.block=e),i.async)return(async()=>{let n=i.hooks?await i.hooks.preprocess(t):t,r=await(i.hooks?await i.hooks.provideLexer(e):e?YE.lex:YE.lexInline)(n,i),a=i.hooks?await i.hooks.processAllTokens(r):r;i.walkTokens&&await Promise.all(this.walkTokens(a,i.walkTokens));let o=await(i.hooks?await i.hooks.provideParser(e):e?QE.parse:QE.parseInline)(a,i);return i.hooks?await i.hooks.postprocess(o):o})().catch(a);try{i.hooks&&(t=i.hooks.preprocess(t));let n=(i.hooks?i.hooks.provideLexer(e):e?YE.lex:YE.lexInline)(t,i);i.hooks&&(n=i.hooks.processAllTokens(n)),i.walkTokens&&this.walkTokens(n,i.walkTokens);let r=(i.hooks?i.hooks.provideParser(e):e?QE.parse:QE.parseInline)(n,i);return i.hooks&&(r=i.hooks.postprocess(r)),r}catch(e){return a(e)}}}onError(e,t){return n=>{if(n.message+=`
144
+ Please report this to https://github.com/markedjs/marked.`,e){let e=`<p>An error occurred:</p><pre>`+IE(n.message+``,!0)+`</pre>`;return t?Promise.resolve(e):e}if(t)return Promise.reject(n);throw n}}},tD=new eD;function nD(e,t){return tD.parse(e,t)}nD.options=nD.setOptions=function(e){return tD.setOptions(e),nD.defaults=tD.defaults,pT(nD.defaults),nD},nD.getDefaults=dT,nD.defaults=fT;function rD(...e){return tD.use(...e),nD.defaults=tD.defaults,pT(nD.defaults),nD}nD.use=rD,nD.walkTokens=function(e,t){return tD.walkTokens(e,t)},nD.parseInline=tD.parseInline,nD.Parser=QE,nD.parser=QE.parse,nD.Renderer=XE,nD.TextRenderer=ZE,nD.Lexer=YE,nD.lexer=YE.lex,nD.Tokenizer=JE,nD.Hooks=$E,nD.parse=nD,nD.options,nD.setOptions,nD.walkTokens,nD.parseInline,QE.parse,YE.lex;function iD(e){return e.replace(/^file:\/\/\/([a-z]:[\\/])/i,`$1`).replace(/^file:\/\//i,``)}function aD(e){return/^[a-z]:[\\/]/i.test(e)}function oD(e){return/^[\\/]/.test(e)||aD(e)}var B=class e extends Error{constructor(t,n){var r=`KaTeX parse error: `+t,i,a,o=n&&n.loc;if(o&&o.start<=o.end){var s=o.lexer.input;i=o.start,a=o.end,i===s.length?r+=` at end of input: `:r+=` at position `+(i+1)+`: `;var c=s.slice(i,a).replace(/[^]/g,`$&̲`),l=i>15?`…`+s.slice(i-15,i):s.slice(0,i),u=a+15<s.length?s.slice(a,a+15)+`…`:s.slice(a);r+=l+c+u}super(r),this.name=`ParseError`,this.position=void 0,this.length=void 0,this.rawMessage=void 0,Object.setPrototypeOf(this,e.prototype),this.position=i,i!=null&&a!=null&&(this.length=a-i),this.rawMessage=t}},sD=/([A-Z])/g,cD=e=>e.replace(sD,`-$1`).toLowerCase(),lD={"&":`&amp;`,">":`&gt;`,"<":`&lt;`,'"':`&quot;`,"'":`&#x27;`},uD=/[&><"']/g,dD=e=>String(e).replace(uD,e=>lD[e]),fD=e=>e.type===`ordgroup`||e.type===`color`?e.body.length===1?fD(e.body[0]):e:e.type===`font`?fD(e.body):e,pD=new Set([`mathord`,`textord`,`atom`]),mD=e=>pD.has(fD(e).type),hD=e=>{var t=/^[\x00-\x20]*([^\\/#?]*?)(:|&#0*58|&#x0*3a|&colon)/i.exec(e);return t?t[2]!==`:`||!/^[a-zA-Z][a-zA-Z0-9+\-.]*$/.test(t[1])?null:t[1].toLowerCase():`_relative`},gD={displayMode:{type:`boolean`,description:`Render math in display mode, which puts the math in display style (so \\int and \\sum are large, for example), and centers the math on the page on its own line.`,cli:`-d, --display-mode`},output:{type:{enum:[`htmlAndMathml`,`html`,`mathml`]},description:`Determines the markup language of the output.`,cli:`-F, --format <type>`},leqno:{type:`boolean`,description:`Render display math in leqno style (left-justified tags).`},fleqn:{type:`boolean`,description:`Render display math flush left.`},throwOnError:{type:`boolean`,default:!0,cli:`-t, --no-throw-on-error`,cliDescription:`Render errors (in the color given by --error-color) instead of throwing a ParseError exception when encountering an error.`},errorColor:{type:`string`,default:`#cc0000`,cli:`-c, --error-color <color>`,cliDescription:`A color string given in the format 'rgb' or 'rrggbb' (no #). This option determines the color of errors rendered by the -t option.`,cliProcessor:e=>`#`+e},macros:{type:`object`,cli:`-m, --macro <def>`,cliDescription:`Define custom macro of the form '\\foo:expansion' (use multiple -m arguments for multiple macros).`,cliDefault:[],cliProcessor:(e,t)=>(t.push(e),t)},minRuleThickness:{type:`number`,description:"Specifies a minimum thickness, in ems, for fraction lines, `\\sqrt` top lines, `{array}` vertical lines, `\\hline`, `\\hdashline`, `\\underline`, `\\overline`, and the borders of `\\fbox`, `\\boxed`, and `\\fcolorbox`.",processor:e=>Math.max(0,e),cli:`--min-rule-thickness <size>`,cliProcessor:parseFloat},colorIsTextColor:{type:`boolean`,description:`Makes \\color behave like LaTeX's 2-argument \\textcolor, instead of LaTeX's one-argument \\color mode change.`,cli:`-b, --color-is-text-color`},strict:{type:[{enum:[`warn`,`ignore`,`error`]},`boolean`,`function`],description:`Turn on strict / LaTeX faithfulness mode, which throws an error if the input uses features that are not supported by LaTeX.`,cli:`-S, --strict`,cliDefault:!1},trust:{type:[`boolean`,`function`],description:`Trust the input, enabling all HTML features such as \\url.`,cli:`-T, --trust`},maxSize:{type:`number`,default:1/0,description:`If non-zero, all user-specified sizes, e.g. in \\rule{500em}{500em}, will be capped to maxSize ems. Otherwise, elements and spaces can be arbitrarily large`,processor:e=>Math.max(0,e),cli:`-s, --max-size <n>`,cliProcessor:parseInt},maxExpand:{type:`number`,default:1e3,description:`Limit the number of macro expansions to the specified number, to prevent e.g. infinite macro loops. If set to Infinity, the macro expander will try to fully expand as in LaTeX.`,processor:e=>Math.max(0,e),cli:`-e, --max-expand <n>`,cliProcessor:e=>e===`Infinity`?1/0:parseInt(e)},globalGroup:{type:`boolean`,cli:!1}};function _D(e){if(typeof e!=`string`)return e.enum[0];switch(e){case`boolean`:return!1;case`string`:return``;case`number`:return 0;case`object`:return{};default:throw Error(`Unexpected schema type; settings must declare an explicit default.`)}}function vD(e){return Object.prototype.hasOwnProperty.call(e,`default`)&&e.default!==void 0?e.default:_D(Array.isArray(e.type)?e.type[0]:e.type)}function yD(e,t,n,r){var i=Object.prototype.hasOwnProperty.call(n,t)?n[t]:void 0,a=Object.prototype.hasOwnProperty.call(r,`processor`)?r.processor:void 0;e[t]=i===void 0?vD(r):a?a(i):i}var bD=class{constructor(e){e===void 0&&(e={}),this.displayMode=void 0,this.output=void 0,this.leqno=void 0,this.fleqn=void 0,this.throwOnError=void 0,this.errorColor=void 0,this.macros=void 0,this.minRuleThickness=void 0,this.colorIsTextColor=void 0,this.strict=void 0,this.trust=void 0,this.maxSize=void 0,this.maxExpand=void 0,this.globalGroup=void 0,e||={};for(var t of Object.keys(gD)){var n=gD[t];n&&yD(this,t,e,n)}}isTrusted(e){if(`url`in e&&e.url&&!e.protocol){var t=hD(e.url);if(t==null)return!1;e.protocol=t}return!!(typeof this.trust==`function`?this.trust(e):this.trust)}},xD=class{constructor(e,t,n){this.id=void 0,this.size=void 0,this.cramped=void 0,this.id=e,this.size=t,this.cramped=n}sup(){return AD[jD[this.id]]}sub(){return AD[MD[this.id]]}fracNum(){return AD[ND[this.id]]}fracDen(){return AD[PD[this.id]]}cramp(){return AD[FD[this.id]]}text(){return AD[ID[this.id]]}isTight(){return this.size>=2}},SD=0,CD=1,wD=2,TD=3,ED=4,DD=5,OD=6,kD=7,AD=[new xD(SD,0,!1),new xD(CD,0,!0),new xD(wD,1,!1),new xD(TD,1,!0),new xD(ED,2,!1),new xD(DD,2,!0),new xD(OD,3,!1),new xD(kD,3,!0)],jD=[ED,DD,ED,DD,OD,kD,OD,kD],MD=[DD,DD,DD,DD,kD,kD,kD,kD],ND=[wD,TD,ED,DD,OD,kD,OD,kD],PD=[TD,TD,DD,DD,kD,kD,kD,kD],FD=[CD,CD,TD,TD,DD,DD,kD,kD],ID=[SD,CD,wD,TD,wD,TD,wD,TD],LD={DISPLAY:AD[SD],TEXT:AD[wD],SCRIPT:AD[ED],SCRIPTSCRIPT:AD[OD]},RD=[{name:`latin`,blocks:[[256,591],[768,879]]},{name:`cyrillic`,blocks:[[1024,1279]]},{name:`armenian`,blocks:[[1328,1423]]},{name:`brahmic`,blocks:[[2304,4255]]},{name:`georgian`,blocks:[[4256,4351]]},{name:`cjk`,blocks:[[12288,12543],[19968,40879],[65280,65376]]},{name:`hangul`,blocks:[[44032,55215]]}];function zD(e){for(var t=0;t<RD.length;t++)for(var n=RD[t],r=0;r<n.blocks.length;r++){var i=n.blocks[r];if(e>=i[0]&&e<=i[1])return n.name}return null}var BD=[];RD.forEach(e=>e.blocks.forEach(e=>BD.push(...e)));function VD(e){for(var t=0;t<BD.length;t+=2)if(e>=BD[t]&&e<=BD[t+1])return!0;return!1}var HD=e=>e+` `+e,UD=80,WD=function(e,t){return`M95,`+(622+e+t)+`
145
145
  c-2.7,0,-7.17,-2.7,-13.5,-8c-5.8,-5.3,-9.5,-10,-9.5,-14
146
146
  c0,-2,0.3,-3.3,1,-4c1.3,-2.7,23.83,-20.7,67.5,-54
147
147
  c44.2,-33.3,65.8,-50.3,66.5,-51c1.3,-1.3,3,-2,5,-2c4.7,0,8.7,3.3,12,10
@@ -152,7 +152,7 @@ c5.3,-9.3,12,-14,20,-14
152
152
  H400000v`+(40+e)+`H845.2724
153
153
  s-225.272,467,-225.272,467s-235,486,-235,486c-2.7,4.7,-9,7,-19,7
154
154
  c-6,0,-10,-1,-12,-3s-194,-422,-194,-422s-65,47,-65,47z
155
- M`+(834+e)+` `+t+`h400000v`+(40+e)+`h-400000z`},WD=function(e,t){return`M263,`+(601+e+t)+`c0.7,0,18,39.7,52,119
155
+ M`+(834+e)+` `+t+`h400000v`+(40+e)+`h-400000z`},GD=function(e,t){return`M263,`+(601+e+t)+`c0.7,0,18,39.7,52,119
156
156
  c34,79.3,68.167,158.7,102.5,238c34.3,79.3,51.8,119.3,52.5,120
157
157
  c340,-704.7,510.7,-1060.3,512,-1067
158
158
  l`+e/2.084+` -`+e+`
@@ -162,7 +162,7 @@ s-271.3,567,-271.3,567c-38.7,80.7,-84,175,-136,283c-52,108,-89.167,185.3,-111.5,
162
162
  c-22.3,46.7,-33.8,70.3,-34.5,71c-4.7,4.7,-12.3,7,-23,7s-12,-1,-12,-1
163
163
  s-109,-253,-109,-253c-72.7,-168,-109.3,-252,-110,-252c-10.7,8,-22,16.7,-34,26
164
164
  c-22,17.3,-33.3,26,-34,26s-26,-26,-26,-26s76,-59,76,-59s76,-60,76,-60z
165
- M`+(1001+e)+` `+t+`h400000v`+(40+e)+`h-400000z`},GD=function(e,t){return`M983 `+(10+e+t)+`
165
+ M`+(1001+e)+` `+t+`h400000v`+(40+e)+`h-400000z`},KD=function(e,t){return`M983 `+(10+e+t)+`
166
166
  l`+e/3.13+` -`+e+`
167
167
  c4,-6.7,10,-10,18,-10 H400000v`+(40+e)+`
168
168
  H1013.1s-83.4,268,-264.1,840c-180.7,572,-277,876.3,-289,913c-4.7,4.7,-12.7,7,-24,7
@@ -171,7 +171,7 @@ c-10,12,-21,25,-33,39s-32,39,-32,39c-6,-5.3,-15,-14,-27,-26s25,-30,25,-30
171
171
  c26.7,-32.7,52,-63,76,-91s52,-60,52,-60s208,722,208,722
172
172
  c56,-175.3,126.3,-397.3,211,-666c84.7,-268.7,153.8,-488.2,207.5,-658.5
173
173
  c53.7,-170.3,84.5,-266.8,92.5,-289.5z
174
- M`+(1001+e)+` `+t+`h400000v`+(40+e)+`h-400000z`},KD=function(e,t){return`M424,`+(2398+e+t)+`
174
+ M`+(1001+e)+` `+t+`h400000v`+(40+e)+`h-400000z`},qD=function(e,t){return`M424,`+(2398+e+t)+`
175
175
  c-1.3,-0.7,-38.5,-172,-111.5,-514c-73,-342,-109.8,-513.3,-110.5,-514
176
176
  c0,-2,-10.7,14.3,-32,49c-4.7,7.3,-9.8,15.7,-15.5,25c-5.7,9.3,-9.8,16,-12.5,20
177
177
  s-5,7,-5,7c-4,-3.3,-8.3,-7.7,-13,-13s-13,-13,-13,-13s76,-122,76,-122s77,-121,77,-121
@@ -181,18 +181,18 @@ v`+(40+e)+`H1014.6
181
181
  s-87.3,378.7,-272.6,1166c-185.3,787.3,-279.3,1182.3,-282,1185
182
182
  c-2,6,-10,9,-24,9
183
183
  c-8,0,-12,-0.7,-12,-2z M`+(1001+e)+` `+t+`
184
- h400000v`+(40+e)+`h-400000z`},qD=function(e,t){return`M473,`+(2713+e+t)+`
184
+ h400000v`+(40+e)+`h-400000z`},JD=function(e,t){return`M473,`+(2713+e+t)+`
185
185
  c339.3,-1799.3,509.3,-2700,510,-2702 l`+e/5.298+` -`+e+`
186
186
  c3.3,-7.3,9.3,-11,18,-11 H400000v`+(40+e)+`H1017.7
187
187
  s-90.5,478,-276.2,1466c-185.7,988,-279.5,1483,-281.5,1485c-2,6,-10,9,-24,9
188
188
  c-8,0,-12,-0.7,-12,-2c0,-1.3,-5.3,-32,-16,-92c-50.7,-293.3,-119.7,-693.3,-207,-1200
189
189
  c0,-1.3,-5.3,8.7,-16,30c-10.7,21.3,-21.3,42.7,-32,64s-16,33,-16,33s-26,-26,-26,-26
190
190
  s76,-153,76,-153s77,-151,77,-151c0.7,0.7,35.7,202,105,604c67.3,400.7,102,602.7,104,
191
- 606zM`+(1001+e)+` `+t+`h400000v`+(40+e)+`H1017.7z`},JD=function(e){var t=e/2;return`M400000 `+e+` H0 L`+t+` 0 l65 45 L145 `+(e-80)+` H400000z`},YD=function(e,t,n){var r=n-54-t-e;return`M702 `+(e+t)+`H400000`+(40+e)+`
191
+ 606zM`+(1001+e)+` `+t+`h400000v`+(40+e)+`H1017.7z`},YD=function(e){var t=e/2;return`M400000 `+e+` H0 L`+t+` 0 l65 45 L145 `+(e-80)+` H400000z`},XD=function(e,t,n){var r=n-54-t-e;return`M702 `+(e+t)+`H400000`+(40+e)+`
192
192
  H742v`+r+`l-4 4-4 4c-.667.7 -2 1.5-4 2.5s-4.167 1.833-6.5 2.5-5.5 1-9.5 1
193
193
  h-12l-28-84c-16.667-52-96.667 -294.333-240-727l-212 -643 -85 170
194
194
  c-4-3.333-8.333-7.667-13 -13l-13-13l77-155 77-156c66 199.333 139 419.667
195
- 219 661 l218 661zM702 `+t+`H400000v`+(40+e)+`H742z`},XD=function(e,t,n){t=1e3*t;var r=``;switch(e){case`sqrtMain`:r=UD(t,HD);break;case`sqrtSize1`:r=WD(t,HD);break;case`sqrtSize2`:r=GD(t,HD);break;case`sqrtSize3`:r=KD(t,HD);break;case`sqrtSize4`:r=qD(t,HD);break;case`sqrtTall`:r=YD(t,HD,n)}return r},ZD=function(e,t){switch(e){case`⎜`:return VD(`M291 0 H417 V`+t+` H291z`);case`∣`:return VD(`M145 0 H188 V`+t+` H145z`);case`∥`:return VD(`M145 0 H188 V`+t+` H145z`)+VD(`M367 0 H410 V`+t+` H367z`);case`⎟`:return VD(`M457 0 H583 V`+t+` H457z`);case`⎢`:return VD(`M319 0 H403 V`+t+` H319z`);case`⎥`:return VD(`M263 0 H347 V`+t+` H263z`);case`⎪`:return VD(`M384 0 H504 V`+t+` H384z`);case`⏐`:return VD(`M312 0 H355 V`+t+` H312z`);case`‖`:return VD(`M257 0 H300 V`+t+` H257z`)+VD(`M478 0 H521 V`+t+` H478z`);default:return``}},QD={doubleleftarrow:`M262 157
195
+ 219 661 l218 661zM702 `+t+`H400000v`+(40+e)+`H742z`},ZD=function(e,t,n){t=1e3*t;var r=``;switch(e){case`sqrtMain`:r=WD(t,UD);break;case`sqrtSize1`:r=GD(t,UD);break;case`sqrtSize2`:r=KD(t,UD);break;case`sqrtSize3`:r=qD(t,UD);break;case`sqrtSize4`:r=JD(t,UD);break;case`sqrtTall`:r=XD(t,UD,n)}return r},QD=function(e,t){switch(e){case`⎜`:return HD(`M291 0 H417 V`+t+` H291z`);case`∣`:return HD(`M145 0 H188 V`+t+` H145z`);case`∥`:return HD(`M145 0 H188 V`+t+` H145z`)+HD(`M367 0 H410 V`+t+` H367z`);case`⎟`:return HD(`M457 0 H583 V`+t+` H457z`);case`⎢`:return HD(`M319 0 H403 V`+t+` H319z`);case`⎥`:return HD(`M263 0 H347 V`+t+` H263z`);case`⎪`:return HD(`M384 0 H504 V`+t+` H384z`);case`⏐`:return HD(`M312 0 H355 V`+t+` H312z`);case`‖`:return HD(`M257 0 H300 V`+t+` H257z`)+HD(`M478 0 H521 V`+t+` H478z`);default:return``}},$D={doubleleftarrow:`M262 157
196
196
  l10-10c34-36 62.7-77 86-123 3.3-8 5-13.3 5-16 0-5.3-6.7-8-20-8-7.3
197
197
  0-12.2.5-14.5 1.5-2.3 1-4.8 4.5-7.5 10.5-49.3 97.3-121.7 169.3-217 216-28
198
198
  14-57.3 25-88 33-6.7 2-11 3.8-13 5.5-2 1.7-3 4.2-3 7.5s1 5.8 3 7.5
@@ -238,10 +238,10 @@ m0 0v40h400000v-40z`,leftharpoondown:`M7 241c-4 4-6.333 8.667-7 14 0 5.333.667 9
238
238
  v40h399900v-40zM0 241v40h399900v-40zm0 0v40h399900v-40z`,lefthook:`M400000 281 H103s-33-11.2-61-33.5S0 197.3 0 164s14.2-61.2 42.5
239
239
  -83.5C70.8 58.2 104 47 142 47 c16.7 0 25 6.7 25 20 0 12-8.7 18.7-26 20-40 3.3
240
240
  -68.7 15.7-86 37-10 12-15 25.3-15 40 0 22.7 9.8 40.7 29.5 54 19.7 13.3 43.5 21
241
- 71.5 23h399859zM103 281v-40h399897v40z`,leftlinesegment:VD(`M40 281 V428 H0 V94 H40 V241 H400000 v40z`),leftbracketunder:VD(`M0 0 h120 V290 H399995 v120 H0z`),leftbracketover:VD(`M0 440 h120 V150 H399995 v-120 H0z`),leftmapsto:VD(`M40 281 V448H0V74H40V241H400000v40z`),leftToFrom:`M0 147h400000v40H0zm0 214c68 40 115.7 95.7 143 167h22c15.3 0 23
241
+ 71.5 23h399859zM103 281v-40h399897v40z`,leftlinesegment:HD(`M40 281 V428 H0 V94 H40 V241 H400000 v40z`),leftbracketunder:HD(`M0 0 h120 V290 H399995 v120 H0z`),leftbracketover:HD(`M0 440 h120 V150 H399995 v-120 H0z`),leftmapsto:HD(`M40 281 V448H0V74H40V241H400000v40z`),leftToFrom:`M0 147h400000v40H0zm0 214c68 40 115.7 95.7 143 167h22c15.3 0 23
242
242
  -.3 23-1 0-1.3-5.3-13.7-16-37-18-35.3-41.3-69-70-101l-7-8h399905v-40H95l7-8
243
243
  c28.7-32 52-65.7 70-101 10.7-23.3 16-35.7 16-37 0-.7-7.7-1-23-1h-22C115.7 265.3
244
- 68 321 0 361zm0-174v-40h399900v40zm100 154v40h399900v-40z`,longequal:VD(`M0 50 h400000 v40H0z m0 194h40000v40H0z`),midbrace:`M200428 334
244
+ 68 321 0 361zm0-174v-40h399900v40zm100 154v40h399900v-40z`,longequal:HD(`M0 50 h400000 v40H0z m0 194h40000v40H0z`),midbrace:`M200428 334
245
245
  c-100.7-8.3-195.3-44-280-108-55.3-42-101.7-93-139-153l-9-14c-2.7 4-5.7 8.7-9 14
246
246
  -53.3 86.7-123.7 153-211 199-66.7 36-137.3 56.3-212 62H0V214h199568c178.3-11.7
247
247
  311.7-78.3 403-201 6-8 9.7-12 11-12 .7-.7 6.7-1 18-1s17.3.3 18 1c1.3 0 5 4 11
@@ -290,7 +290,7 @@ m0 0v40h399900v-40z m100 194v40h399900v-40zm0 0v40h399900v-40z`,rightharpoondown
290
290
  m0-194v40h400000v-40zm0 0v40h400000v-40z`,righthook:`M399859 241c-764 0 0 0 0 0 40-3.3 68.7-15.7 86-37 10-12 15-25.3
291
291
  15-40 0-22.7-9.8-40.7-29.5-54-19.7-13.3-43.5-21-71.5-23-17.3-1.3-26-8-26-20 0
292
292
  -13.3 8.7-20 26-20 38 0 71 11.2 99 33.5 0 0 7 5.6 21 16.7 14 11.2 21 33.5 21
293
- 66.8s-14 61.2-42 83.5c-28 22.3-61 33.5-99 33.5L0 241z M0 281v-40h399859v40z`,rightlinesegment:VD(`M399960 241 V94 h40 V428 h-40 V281 H0 v-40z`),rightbracketunder:VD(`M399995 0 h-120 V290 H0 v120 H400000z`),rightbracketover:VD(`M399995 440 h-120 V150 H0 v-120 H399995z`),rightToFrom:`M400000 167c-70.7-42-118-97.7-142-167h-23c-15.3 0-23 .3-23
293
+ 66.8s-14 61.2-42 83.5c-28 22.3-61 33.5-99 33.5L0 241z M0 281v-40h399859v40z`,rightlinesegment:HD(`M399960 241 V94 h40 V428 h-40 V281 H0 v-40z`),rightbracketunder:HD(`M399995 0 h-120 V290 H0 v120 H400000z`),rightbracketover:HD(`M399995 440 h-120 V150 H0 v-120 H399995z`),rightToFrom:`M400000 167c-70.7-42-118-97.7-142-167h-23c-15.3 0-23 .3-23
294
294
  1 0 1.3 5.3 13.7 16 37 18 35.3 41.3 69 70 101l7 8H0v40h399905l-7 8c-28.7 32
295
295
  -52 65.7-70 101-10.7 23.3-16 35.7-16 37 0 .7 7.7 1 23 1h23c24-69.3 71.3-125 142
296
296
  -167z M100 147v40h399900v-40zM0 341v40h399900v-40z`,twoheadleftarrow:`M0 167c68 40
@@ -363,7 +363,7 @@ M93 435 v40 H400000 v-40z M500 241 v40 H400000 v-40z M500 241 v40 H400000 v-40z`
363
363
  c4.7,-4.7,7,-9.3,7,-14c0,-9.3,-3.7,-15.3,-11,-18c-92.7,-56.7,-159,-133.7,-199,
364
364
  -231c-3.3,-9.3,-6,-14.7,-8,-16c-2,-1.3,-7,-2,-15,-2c-10.7,0,-16.7,2,-18,6
365
365
  c-2,2.7,-1,9.7,3,21c15.3,42,36.7,81.8,64,119.5c27.3,37.7,58,69.2,92,94.5z
366
- M500 241 v40 H399408 v-40z M500 435 v40 H400000 v-40z`},$D=function(e,t){switch(e){case`lbrack`:return`M403 1759 V84 H666 V0 H319 V1759 v`+t+` v1759 v84 h347 v-84
366
+ M500 241 v40 H399408 v-40z M500 435 v40 H400000 v-40z`},eO=function(e,t){switch(e){case`lbrack`:return`M403 1759 V84 H666 V0 H319 V1759 v`+t+` v1759 v84 h347 v-84
367
367
  H403z M403 1759 V0 H319 V1759 v`+t+` v1759 v84 h84z`;case`rbrack`:return`M347 1759 V0 H0 V84 H263 V1759 v`+t+` v1759 H0 v84 H347z
368
368
  M347 1759 V0 H263 V1759 v`+t+` v1759 h84z`;case`vert`:return`M145 15 v585 v`+t+` v585 c2.667,10,9.667,15,21,15
369
369
  c10,0,16.667,-5,20,-15 v-585 v`+-t+` v-585 c-2.667,-10,-9.667,-15,-21,-15
@@ -391,13 +391,13 @@ c-55.7,194.7,-131.8,370.3,-228.5,527c-20.7,34.7,-41.7,66.3,-63,95c-2,3.3,-4,7,-6
391
391
  c0,7.3,5.7,11,17,11c0,0,11,0,11,0c9.3,0,14.3,-0.3,15,-1c5.3,-5.3,10.3,-11,15,-17
392
392
  c242.7,-294.7,395.3,-681.7,458,-1161c21.3,-164.7,33.3,-350.7,36,-558
393
393
  l0,-`+(t+144)+`c-2,-159.3,-10,-310.7,-24,-454c-53.3,-528,-210,-949.7,
394
- -470,-1265c-4.7,-6,-9.7,-11.7,-15,-17c-0.7,-0.7,-6.7,-1,-18,-1z`;default:throw Error(`Unknown stretchy delimiter.`)}};function eO(e){return`toText`in e}var tO=class{constructor(e){this.children=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,this.children=e,this.classes=[],this.height=0,this.depth=0,this.maxFontSize=0,this.style={}}hasClass(e){return this.classes.includes(e)}toNode(){for(var e=document.createDocumentFragment(),t=0;t<this.children.length;t++)e.appendChild(this.children[t].toNode());return e}toMarkup(){for(var e=``,t=0;t<this.children.length;t++)e+=this.children[t].toMarkup();return e}toText(){return this.children.map(e=>{if(eO(e))return e.toText();throw Error(`Expected MathDomNode with toText, got `+e.constructor.name)}).join(``)}},nO={pt:1,mm:7227/2540,cm:7227/254,in:72.27,bp:803/800,pc:12,dd:1238/1157,cc:14856/1157,nd:685/642,nc:1370/107,sp:1/65536,px:803/800},rO={ex:!0,em:!0,mu:!0},iO=function(e){return typeof e!=`string`&&(e=e.unit),e in nO||e in rO||e===`ex`},aO=function(e,t){var n;if(e.unit in nO)n=nO[e.unit]/t.fontMetrics().ptPerEm/t.sizeMultiplier;else if(e.unit===`mu`)n=t.fontMetrics().cssEmPerMu;else{var r=t.style.isTight()?t.havingStyle(t.style.text()):t;if(e.unit===`ex`)n=r.fontMetrics().xHeight;else if(e.unit===`em`)n=r.fontMetrics().quad;else throw new B(`Invalid unit: '`+e.unit+`'`);r!==t&&(n*=r.sizeMultiplier/t.sizeMultiplier)}return Math.min(e.number*n,t.maxSize)},V=function(e){return+e.toFixed(4)+`em`},oO=function(e){return e.filter(e=>e).join(` `)},sO=function(e){var t=``;for(var n of Object.keys(e)){var r=e[n];r!==void 0&&(t+=sD(n)+`:`+r+`;`)}return t},cO=function(e,t,n){if(this.classes=e||[],this.attributes={},this.height=0,this.depth=0,this.maxFontSize=0,this.style=n||{},t){t.style.isTight()&&this.classes.push(`mtight`);var r=t.getColor();r&&(this.style.color=r)}},lO=function(e){var t=document.createElement(e);t.className=oO(this.classes),Object.assign(t.style,this.style);for(var n of Object.keys(this.attributes))t.setAttribute(n,this.attributes[n]);for(var r=0;r<this.children.length;r++)t.appendChild(this.children[r].toNode());return t},uO=/[\s"'>/=\x00-\x1f]/,dO=function(e){var t=`<`+e;this.classes.length&&(t+=` class="`+uD(oO(this.classes))+`"`);var n=sO(this.style);n&&(t+=` style="`+uD(n)+`"`);for(var r of Object.keys(this.attributes)){if(uO.test(r))throw new B(`Invalid attribute name '`+r+`'`);t+=` `+r+`="`+uD(this.attributes[r])+`"`}t+=`>`;for(var i=0;i<this.children.length;i++)t+=this.children[i].toMarkup();return t+=`</`+e+`>`,t},fO=class{constructor(e,t,n,r){this.children=void 0,this.attributes=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.width=void 0,this.maxFontSize=void 0,this.style=void 0,this.italic=void 0,cO.call(this,e,n,r),this.children=t||[]}setAttribute(e,t){this.attributes[e]=t}hasClass(e){return this.classes.includes(e)}toNode(){return lO.call(this,`span`)}toMarkup(){return dO.call(this,`span`)}},pO=class{constructor(e,t,n,r){this.children=void 0,this.attributes=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,cO.call(this,t,r),this.children=n||[],this.setAttribute(`href`,e)}setAttribute(e,t){this.attributes[e]=t}hasClass(e){return this.classes.includes(e)}toNode(){return lO.call(this,`a`)}toMarkup(){return dO.call(this,`a`)}},mO=class{constructor(e,t,n){this.src=void 0,this.alt=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,this.alt=t,this.src=e,this.classes=[`mord`],this.height=0,this.depth=0,this.maxFontSize=0,this.style=n}hasClass(e){return this.classes.includes(e)}toNode(){var e=document.createElement(`img`);return e.src=this.src,e.alt=this.alt,e.className=`mord`,Object.assign(e.style,this.style),e}toMarkup(){var e=`<img src="`+uD(this.src)+`"`+(` alt="`+uD(this.alt)+`"`),t=sO(this.style);return t&&(e+=` style="`+uD(t)+`"`),e+=`'/>`,e}},hO={î:`ı̂`,ï:`ı̈`,í:`ı́`,ì:`ı̀`},gO=class{constructor(e,t,n,r,i,a,o,s){this.text=void 0,this.height=void 0,this.depth=void 0,this.italic=void 0,this.skew=void 0,this.width=void 0,this.maxFontSize=void 0,this.classes=void 0,this.style=void 0,this.text=e,this.height=t||0,this.depth=n||0,this.italic=r||0,this.skew=i||0,this.width=a||0,this.classes=o||[],this.style=s||{},this.maxFontSize=0;var c=RD(this.text.charCodeAt(0));c&&this.classes.push(c+`_fallback`),/[îïíì]/.test(this.text)&&(this.text=hO[this.text])}hasClass(e){return this.classes.includes(e)}toNode(){var e=document.createTextNode(this.text),t=null;return this.italic>0&&(t=document.createElement(`span`),t.style.marginRight=V(this.italic)),this.classes.length>0&&(t||=document.createElement(`span`),t.className=oO(this.classes)),Object.keys(this.style).length>0&&(t||=document.createElement(`span`),Object.assign(t.style,this.style)),t?(t.appendChild(e),t):e}toMarkup(){var e=!1,t=`<span`;this.classes.length&&(e=!0,t+=` class="`,t+=uD(oO(this.classes)),t+=`"`);var n=``;this.italic>0&&(n+=`margin-right:`+V(this.italic)+`;`),n+=sO(this.style),n&&(e=!0,t+=` style="`+uD(n)+`"`);var r=uD(this.text);return e?(t+=`>`,t+=r,t+=`</span>`,t):r}},_O=class{constructor(e,t){this.children=void 0,this.attributes=void 0,this.children=e||[],this.attributes=t||{}}toNode(){var e=document.createElementNS(`http://www.w3.org/2000/svg`,`svg`);for(var t of Object.keys(this.attributes))e.setAttribute(t,this.attributes[t]);for(var n=0;n<this.children.length;n++)e.appendChild(this.children[n].toNode());return e}toMarkup(){var e=`<svg xmlns="http://www.w3.org/2000/svg"`;for(var t of Object.keys(this.attributes))e+=` `+t+`="`+uD(this.attributes[t])+`"`;e+=`>`;for(var n=0;n<this.children.length;n++)e+=this.children[n].toMarkup();return e+=`</svg>`,e}},vO=class{constructor(e,t){this.pathName=void 0,this.alternate=void 0,this.pathName=e,this.alternate=t}toNode(){var e=document.createElementNS(`http://www.w3.org/2000/svg`,`path`);return this.alternate?e.setAttribute(`d`,this.alternate):e.setAttribute(`d`,QD[this.pathName]),e}toMarkup(){return this.alternate?`<path d="`+uD(this.alternate)+`"/>`:`<path d="`+uD(QD[this.pathName])+`"/>`}},yO=class{constructor(e){this.attributes=void 0,this.attributes=e||{}}toNode(){var e=document.createElementNS(`http://www.w3.org/2000/svg`,`line`);for(var t of Object.keys(this.attributes))e.setAttribute(t,this.attributes[t]);return e}toMarkup(){var e=`<line`;for(var t of Object.keys(this.attributes))e+=` `+t+`="`+uD(this.attributes[t])+`"`;return e+=`/>`,e}};function bO(e){if(e instanceof gO)return e;throw Error(`Expected symbolNode but got `+String(e)+`.`)}function xO(e){if(e instanceof fO)return e;throw Error(`Expected span<HtmlDomNode> but got `+String(e)+`.`)}var SO=e=>e instanceof fO||e instanceof pO||e instanceof tO,CO={"AMS-Regular":{32:[0,0,0,0,.25],65:[0,.68889,0,0,.72222],66:[0,.68889,0,0,.66667],67:[0,.68889,0,0,.72222],68:[0,.68889,0,0,.72222],69:[0,.68889,0,0,.66667],70:[0,.68889,0,0,.61111],71:[0,.68889,0,0,.77778],72:[0,.68889,0,0,.77778],73:[0,.68889,0,0,.38889],74:[.16667,.68889,0,0,.5],75:[0,.68889,0,0,.77778],76:[0,.68889,0,0,.66667],77:[0,.68889,0,0,.94445],78:[0,.68889,0,0,.72222],79:[.16667,.68889,0,0,.77778],80:[0,.68889,0,0,.61111],81:[.16667,.68889,0,0,.77778],82:[0,.68889,0,0,.72222],83:[0,.68889,0,0,.55556],84:[0,.68889,0,0,.66667],85:[0,.68889,0,0,.72222],86:[0,.68889,0,0,.72222],87:[0,.68889,0,0,1],88:[0,.68889,0,0,.72222],89:[0,.68889,0,0,.72222],90:[0,.68889,0,0,.66667],107:[0,.68889,0,0,.55556],160:[0,0,0,0,.25],165:[0,.675,.025,0,.75],174:[.15559,.69224,0,0,.94666],240:[0,.68889,0,0,.55556],295:[0,.68889,0,0,.54028],710:[0,.825,0,0,2.33334],732:[0,.9,0,0,2.33334],770:[0,.825,0,0,2.33334],771:[0,.9,0,0,2.33334],989:[.08167,.58167,0,0,.77778],1008:[0,.43056,.04028,0,.66667],8245:[0,.54986,0,0,.275],8463:[0,.68889,0,0,.54028],8487:[0,.68889,0,0,.72222],8498:[0,.68889,0,0,.55556],8502:[0,.68889,0,0,.66667],8503:[0,.68889,0,0,.44445],8504:[0,.68889,0,0,.66667],8513:[0,.68889,0,0,.63889],8592:[-.03598,.46402,0,0,.5],8594:[-.03598,.46402,0,0,.5],8602:[-.13313,.36687,0,0,1],8603:[-.13313,.36687,0,0,1],8606:[.01354,.52239,0,0,1],8608:[.01354,.52239,0,0,1],8610:[.01354,.52239,0,0,1.11111],8611:[.01354,.52239,0,0,1.11111],8619:[0,.54986,0,0,1],8620:[0,.54986,0,0,1],8621:[-.13313,.37788,0,0,1.38889],8622:[-.13313,.36687,0,0,1],8624:[0,.69224,0,0,.5],8625:[0,.69224,0,0,.5],8630:[0,.43056,0,0,1],8631:[0,.43056,0,0,1],8634:[.08198,.58198,0,0,.77778],8635:[.08198,.58198,0,0,.77778],8638:[.19444,.69224,0,0,.41667],8639:[.19444,.69224,0,0,.41667],8642:[.19444,.69224,0,0,.41667],8643:[.19444,.69224,0,0,.41667],8644:[.1808,.675,0,0,1],8646:[.1808,.675,0,0,1],8647:[.1808,.675,0,0,1],8648:[.19444,.69224,0,0,.83334],8649:[.1808,.675,0,0,1],8650:[.19444,.69224,0,0,.83334],8651:[.01354,.52239,0,0,1],8652:[.01354,.52239,0,0,1],8653:[-.13313,.36687,0,0,1],8654:[-.13313,.36687,0,0,1],8655:[-.13313,.36687,0,0,1],8666:[.13667,.63667,0,0,1],8667:[.13667,.63667,0,0,1],8669:[-.13313,.37788,0,0,1],8672:[-.064,.437,0,0,1.334],8674:[-.064,.437,0,0,1.334],8705:[0,.825,0,0,.5],8708:[0,.68889,0,0,.55556],8709:[.08167,.58167,0,0,.77778],8717:[0,.43056,0,0,.42917],8722:[-.03598,.46402,0,0,.5],8724:[.08198,.69224,0,0,.77778],8726:[.08167,.58167,0,0,.77778],8733:[0,.69224,0,0,.77778],8736:[0,.69224,0,0,.72222],8737:[0,.69224,0,0,.72222],8738:[.03517,.52239,0,0,.72222],8739:[.08167,.58167,0,0,.22222],8740:[.25142,.74111,0,0,.27778],8741:[.08167,.58167,0,0,.38889],8742:[.25142,.74111,0,0,.5],8756:[0,.69224,0,0,.66667],8757:[0,.69224,0,0,.66667],8764:[-.13313,.36687,0,0,.77778],8765:[-.13313,.37788,0,0,.77778],8769:[-.13313,.36687,0,0,.77778],8770:[-.03625,.46375,0,0,.77778],8774:[.30274,.79383,0,0,.77778],8776:[-.01688,.48312,0,0,.77778],8778:[.08167,.58167,0,0,.77778],8782:[.06062,.54986,0,0,.77778],8783:[.06062,.54986,0,0,.77778],8785:[.08198,.58198,0,0,.77778],8786:[.08198,.58198,0,0,.77778],8787:[.08198,.58198,0,0,.77778],8790:[0,.69224,0,0,.77778],8791:[.22958,.72958,0,0,.77778],8796:[.08198,.91667,0,0,.77778],8806:[.25583,.75583,0,0,.77778],8807:[.25583,.75583,0,0,.77778],8808:[.25142,.75726,0,0,.77778],8809:[.25142,.75726,0,0,.77778],8812:[.25583,.75583,0,0,.5],8814:[.20576,.70576,0,0,.77778],8815:[.20576,.70576,0,0,.77778],8816:[.30274,.79383,0,0,.77778],8817:[.30274,.79383,0,0,.77778],8818:[.22958,.72958,0,0,.77778],8819:[.22958,.72958,0,0,.77778],8822:[.1808,.675,0,0,.77778],8823:[.1808,.675,0,0,.77778],8828:[.13667,.63667,0,0,.77778],8829:[.13667,.63667,0,0,.77778],8830:[.22958,.72958,0,0,.77778],8831:[.22958,.72958,0,0,.77778],8832:[.20576,.70576,0,0,.77778],8833:[.20576,.70576,0,0,.77778],8840:[.30274,.79383,0,0,.77778],8841:[.30274,.79383,0,0,.77778],8842:[.13597,.63597,0,0,.77778],8843:[.13597,.63597,0,0,.77778],8847:[.03517,.54986,0,0,.77778],8848:[.03517,.54986,0,0,.77778],8858:[.08198,.58198,0,0,.77778],8859:[.08198,.58198,0,0,.77778],8861:[.08198,.58198,0,0,.77778],8862:[0,.675,0,0,.77778],8863:[0,.675,0,0,.77778],8864:[0,.675,0,0,.77778],8865:[0,.675,0,0,.77778],8872:[0,.69224,0,0,.61111],8873:[0,.69224,0,0,.72222],8874:[0,.69224,0,0,.88889],8876:[0,.68889,0,0,.61111],8877:[0,.68889,0,0,.61111],8878:[0,.68889,0,0,.72222],8879:[0,.68889,0,0,.72222],8882:[.03517,.54986,0,0,.77778],8883:[.03517,.54986,0,0,.77778],8884:[.13667,.63667,0,0,.77778],8885:[.13667,.63667,0,0,.77778],8888:[0,.54986,0,0,1.11111],8890:[.19444,.43056,0,0,.55556],8891:[.19444,.69224,0,0,.61111],8892:[.19444,.69224,0,0,.61111],8901:[0,.54986,0,0,.27778],8903:[.08167,.58167,0,0,.77778],8905:[.08167,.58167,0,0,.77778],8906:[.08167,.58167,0,0,.77778],8907:[0,.69224,0,0,.77778],8908:[0,.69224,0,0,.77778],8909:[-.03598,.46402,0,0,.77778],8910:[0,.54986,0,0,.76042],8911:[0,.54986,0,0,.76042],8912:[.03517,.54986,0,0,.77778],8913:[.03517,.54986,0,0,.77778],8914:[0,.54986,0,0,.66667],8915:[0,.54986,0,0,.66667],8916:[0,.69224,0,0,.66667],8918:[.0391,.5391,0,0,.77778],8919:[.0391,.5391,0,0,.77778],8920:[.03517,.54986,0,0,1.33334],8921:[.03517,.54986,0,0,1.33334],8922:[.38569,.88569,0,0,.77778],8923:[.38569,.88569,0,0,.77778],8926:[.13667,.63667,0,0,.77778],8927:[.13667,.63667,0,0,.77778],8928:[.30274,.79383,0,0,.77778],8929:[.30274,.79383,0,0,.77778],8934:[.23222,.74111,0,0,.77778],8935:[.23222,.74111,0,0,.77778],8936:[.23222,.74111,0,0,.77778],8937:[.23222,.74111,0,0,.77778],8938:[.20576,.70576,0,0,.77778],8939:[.20576,.70576,0,0,.77778],8940:[.30274,.79383,0,0,.77778],8941:[.30274,.79383,0,0,.77778],8994:[.19444,.69224,0,0,.77778],8995:[.19444,.69224,0,0,.77778],9416:[.15559,.69224,0,0,.90222],9484:[0,.69224,0,0,.5],9488:[0,.69224,0,0,.5],9492:[0,.37788,0,0,.5],9496:[0,.37788,0,0,.5],9585:[.19444,.68889,0,0,.88889],9586:[.19444,.74111,0,0,.88889],9632:[0,.675,0,0,.77778],9633:[0,.675,0,0,.77778],9650:[0,.54986,0,0,.72222],9651:[0,.54986,0,0,.72222],9654:[.03517,.54986,0,0,.77778],9660:[0,.54986,0,0,.72222],9661:[0,.54986,0,0,.72222],9664:[.03517,.54986,0,0,.77778],9674:[.11111,.69224,0,0,.66667],9733:[.19444,.69224,0,0,.94445],10003:[0,.69224,0,0,.83334],10016:[0,.69224,0,0,.83334],10731:[.11111,.69224,0,0,.66667],10846:[.19444,.75583,0,0,.61111],10877:[.13667,.63667,0,0,.77778],10878:[.13667,.63667,0,0,.77778],10885:[.25583,.75583,0,0,.77778],10886:[.25583,.75583,0,0,.77778],10887:[.13597,.63597,0,0,.77778],10888:[.13597,.63597,0,0,.77778],10889:[.26167,.75726,0,0,.77778],10890:[.26167,.75726,0,0,.77778],10891:[.48256,.98256,0,0,.77778],10892:[.48256,.98256,0,0,.77778],10901:[.13667,.63667,0,0,.77778],10902:[.13667,.63667,0,0,.77778],10933:[.25142,.75726,0,0,.77778],10934:[.25142,.75726,0,0,.77778],10935:[.26167,.75726,0,0,.77778],10936:[.26167,.75726,0,0,.77778],10937:[.26167,.75726,0,0,.77778],10938:[.26167,.75726,0,0,.77778],10949:[.25583,.75583,0,0,.77778],10950:[.25583,.75583,0,0,.77778],10955:[.28481,.79383,0,0,.77778],10956:[.28481,.79383,0,0,.77778],57350:[.08167,.58167,0,0,.22222],57351:[.08167,.58167,0,0,.38889],57352:[.08167,.58167,0,0,.77778],57353:[0,.43056,.04028,0,.66667],57356:[.25142,.75726,0,0,.77778],57357:[.25142,.75726,0,0,.77778],57358:[.41951,.91951,0,0,.77778],57359:[.30274,.79383,0,0,.77778],57360:[.30274,.79383,0,0,.77778],57361:[.41951,.91951,0,0,.77778],57366:[.25142,.75726,0,0,.77778],57367:[.25142,.75726,0,0,.77778],57368:[.25142,.75726,0,0,.77778],57369:[.25142,.75726,0,0,.77778],57370:[.13597,.63597,0,0,.77778],57371:[.13597,.63597,0,0,.77778]},"Caligraphic-Regular":{32:[0,0,0,0,.25],65:[0,.68333,0,.19445,.79847],66:[0,.68333,.03041,.13889,.65681],67:[0,.68333,.05834,.13889,.52653],68:[0,.68333,.02778,.08334,.77139],69:[0,.68333,.08944,.11111,.52778],70:[0,.68333,.09931,.11111,.71875],71:[.09722,.68333,.0593,.11111,.59487],72:[0,.68333,.00965,.11111,.84452],73:[0,.68333,.07382,0,.54452],74:[.09722,.68333,.18472,.16667,.67778],75:[0,.68333,.01445,.05556,.76195],76:[0,.68333,0,.13889,.68972],77:[0,.68333,0,.13889,1.2009],78:[0,.68333,.14736,.08334,.82049],79:[0,.68333,.02778,.11111,.79611],80:[0,.68333,.08222,.08334,.69556],81:[.09722,.68333,0,.11111,.81667],82:[0,.68333,0,.08334,.8475],83:[0,.68333,.075,.13889,.60556],84:[0,.68333,.25417,0,.54464],85:[0,.68333,.09931,.08334,.62583],86:[0,.68333,.08222,0,.61278],87:[0,.68333,.08222,.08334,.98778],88:[0,.68333,.14643,.13889,.7133],89:[.09722,.68333,.08222,.08334,.66834],90:[0,.68333,.07944,.13889,.72473],160:[0,0,0,0,.25]},"Fraktur-Regular":{32:[0,0,0,0,.25],33:[0,.69141,0,0,.29574],34:[0,.69141,0,0,.21471],38:[0,.69141,0,0,.73786],39:[0,.69141,0,0,.21201],40:[.24982,.74947,0,0,.38865],41:[.24982,.74947,0,0,.38865],42:[0,.62119,0,0,.27764],43:[.08319,.58283,0,0,.75623],44:[0,.10803,0,0,.27764],45:[.08319,.58283,0,0,.75623],46:[0,.10803,0,0,.27764],47:[.24982,.74947,0,0,.50181],48:[0,.47534,0,0,.50181],49:[0,.47534,0,0,.50181],50:[0,.47534,0,0,.50181],51:[.18906,.47534,0,0,.50181],52:[.18906,.47534,0,0,.50181],53:[.18906,.47534,0,0,.50181],54:[0,.69141,0,0,.50181],55:[.18906,.47534,0,0,.50181],56:[0,.69141,0,0,.50181],57:[.18906,.47534,0,0,.50181],58:[0,.47534,0,0,.21606],59:[.12604,.47534,0,0,.21606],61:[-.13099,.36866,0,0,.75623],63:[0,.69141,0,0,.36245],65:[0,.69141,0,0,.7176],66:[0,.69141,0,0,.88397],67:[0,.69141,0,0,.61254],68:[0,.69141,0,0,.83158],69:[0,.69141,0,0,.66278],70:[.12604,.69141,0,0,.61119],71:[0,.69141,0,0,.78539],72:[.06302,.69141,0,0,.7203],73:[0,.69141,0,0,.55448],74:[.12604,.69141,0,0,.55231],75:[0,.69141,0,0,.66845],76:[0,.69141,0,0,.66602],77:[0,.69141,0,0,1.04953],78:[0,.69141,0,0,.83212],79:[0,.69141,0,0,.82699],80:[.18906,.69141,0,0,.82753],81:[.03781,.69141,0,0,.82699],82:[0,.69141,0,0,.82807],83:[0,.69141,0,0,.82861],84:[0,.69141,0,0,.66899],85:[0,.69141,0,0,.64576],86:[0,.69141,0,0,.83131],87:[0,.69141,0,0,1.04602],88:[0,.69141,0,0,.71922],89:[.18906,.69141,0,0,.83293],90:[.12604,.69141,0,0,.60201],91:[.24982,.74947,0,0,.27764],93:[.24982,.74947,0,0,.27764],94:[0,.69141,0,0,.49965],97:[0,.47534,0,0,.50046],98:[0,.69141,0,0,.51315],99:[0,.47534,0,0,.38946],100:[0,.62119,0,0,.49857],101:[0,.47534,0,0,.40053],102:[.18906,.69141,0,0,.32626],103:[.18906,.47534,0,0,.5037],104:[.18906,.69141,0,0,.52126],105:[0,.69141,0,0,.27899],106:[0,.69141,0,0,.28088],107:[0,.69141,0,0,.38946],108:[0,.69141,0,0,.27953],109:[0,.47534,0,0,.76676],110:[0,.47534,0,0,.52666],111:[0,.47534,0,0,.48885],112:[.18906,.52396,0,0,.50046],113:[.18906,.47534,0,0,.48912],114:[0,.47534,0,0,.38919],115:[0,.47534,0,0,.44266],116:[0,.62119,0,0,.33301],117:[0,.47534,0,0,.5172],118:[0,.52396,0,0,.5118],119:[0,.52396,0,0,.77351],120:[.18906,.47534,0,0,.38865],121:[.18906,.47534,0,0,.49884],122:[.18906,.47534,0,0,.39054],160:[0,0,0,0,.25],8216:[0,.69141,0,0,.21471],8217:[0,.69141,0,0,.21471],58112:[0,.62119,0,0,.49749],58113:[0,.62119,0,0,.4983],58114:[.18906,.69141,0,0,.33328],58115:[.18906,.69141,0,0,.32923],58116:[.18906,.47534,0,0,.50343],58117:[0,.69141,0,0,.33301],58118:[0,.62119,0,0,.33409],58119:[0,.47534,0,0,.50073]},"Main-Bold":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.35],34:[0,.69444,0,0,.60278],35:[.19444,.69444,0,0,.95833],36:[.05556,.75,0,0,.575],37:[.05556,.75,0,0,.95833],38:[0,.69444,0,0,.89444],39:[0,.69444,0,0,.31944],40:[.25,.75,0,0,.44722],41:[.25,.75,0,0,.44722],42:[0,.75,0,0,.575],43:[.13333,.63333,0,0,.89444],44:[.19444,.15556,0,0,.31944],45:[0,.44444,0,0,.38333],46:[0,.15556,0,0,.31944],47:[.25,.75,0,0,.575],48:[0,.64444,0,0,.575],49:[0,.64444,0,0,.575],50:[0,.64444,0,0,.575],51:[0,.64444,0,0,.575],52:[0,.64444,0,0,.575],53:[0,.64444,0,0,.575],54:[0,.64444,0,0,.575],55:[0,.64444,0,0,.575],56:[0,.64444,0,0,.575],57:[0,.64444,0,0,.575],58:[0,.44444,0,0,.31944],59:[.19444,.44444,0,0,.31944],60:[.08556,.58556,0,0,.89444],61:[-.10889,.39111,0,0,.89444],62:[.08556,.58556,0,0,.89444],63:[0,.69444,0,0,.54305],64:[0,.69444,0,0,.89444],65:[0,.68611,0,0,.86944],66:[0,.68611,0,0,.81805],67:[0,.68611,0,0,.83055],68:[0,.68611,0,0,.88194],69:[0,.68611,0,0,.75555],70:[0,.68611,0,0,.72361],71:[0,.68611,0,0,.90416],72:[0,.68611,0,0,.9],73:[0,.68611,0,0,.43611],74:[0,.68611,0,0,.59444],75:[0,.68611,0,0,.90138],76:[0,.68611,0,0,.69166],77:[0,.68611,0,0,1.09166],78:[0,.68611,0,0,.9],79:[0,.68611,0,0,.86388],80:[0,.68611,0,0,.78611],81:[.19444,.68611,0,0,.86388],82:[0,.68611,0,0,.8625],83:[0,.68611,0,0,.63889],84:[0,.68611,0,0,.8],85:[0,.68611,0,0,.88472],86:[0,.68611,.01597,0,.86944],87:[0,.68611,.01597,0,1.18888],88:[0,.68611,0,0,.86944],89:[0,.68611,.02875,0,.86944],90:[0,.68611,0,0,.70277],91:[.25,.75,0,0,.31944],92:[.25,.75,0,0,.575],93:[.25,.75,0,0,.31944],94:[0,.69444,0,0,.575],95:[.31,.13444,.03194,0,.575],97:[0,.44444,0,0,.55902],98:[0,.69444,0,0,.63889],99:[0,.44444,0,0,.51111],100:[0,.69444,0,0,.63889],101:[0,.44444,0,0,.52708],102:[0,.69444,.10903,0,.35139],103:[.19444,.44444,.01597,0,.575],104:[0,.69444,0,0,.63889],105:[0,.69444,0,0,.31944],106:[.19444,.69444,0,0,.35139],107:[0,.69444,0,0,.60694],108:[0,.69444,0,0,.31944],109:[0,.44444,0,0,.95833],110:[0,.44444,0,0,.63889],111:[0,.44444,0,0,.575],112:[.19444,.44444,0,0,.63889],113:[.19444,.44444,0,0,.60694],114:[0,.44444,0,0,.47361],115:[0,.44444,0,0,.45361],116:[0,.63492,0,0,.44722],117:[0,.44444,0,0,.63889],118:[0,.44444,.01597,0,.60694],119:[0,.44444,.01597,0,.83055],120:[0,.44444,0,0,.60694],121:[.19444,.44444,.01597,0,.60694],122:[0,.44444,0,0,.51111],123:[.25,.75,0,0,.575],124:[.25,.75,0,0,.31944],125:[.25,.75,0,0,.575],126:[.35,.34444,0,0,.575],160:[0,0,0,0,.25],163:[0,.69444,0,0,.86853],168:[0,.69444,0,0,.575],172:[0,.44444,0,0,.76666],176:[0,.69444,0,0,.86944],177:[.13333,.63333,0,0,.89444],184:[.17014,0,0,0,.51111],198:[0,.68611,0,0,1.04166],215:[.13333,.63333,0,0,.89444],216:[.04861,.73472,0,0,.89444],223:[0,.69444,0,0,.59722],230:[0,.44444,0,0,.83055],247:[.13333,.63333,0,0,.89444],248:[.09722,.54167,0,0,.575],305:[0,.44444,0,0,.31944],338:[0,.68611,0,0,1.16944],339:[0,.44444,0,0,.89444],567:[.19444,.44444,0,0,.35139],710:[0,.69444,0,0,.575],711:[0,.63194,0,0,.575],713:[0,.59611,0,0,.575],714:[0,.69444,0,0,.575],715:[0,.69444,0,0,.575],728:[0,.69444,0,0,.575],729:[0,.69444,0,0,.31944],730:[0,.69444,0,0,.86944],732:[0,.69444,0,0,.575],733:[0,.69444,0,0,.575],915:[0,.68611,0,0,.69166],916:[0,.68611,0,0,.95833],920:[0,.68611,0,0,.89444],923:[0,.68611,0,0,.80555],926:[0,.68611,0,0,.76666],928:[0,.68611,0,0,.9],931:[0,.68611,0,0,.83055],933:[0,.68611,0,0,.89444],934:[0,.68611,0,0,.83055],936:[0,.68611,0,0,.89444],937:[0,.68611,0,0,.83055],8211:[0,.44444,.03194,0,.575],8212:[0,.44444,.03194,0,1.14999],8216:[0,.69444,0,0,.31944],8217:[0,.69444,0,0,.31944],8220:[0,.69444,0,0,.60278],8221:[0,.69444,0,0,.60278],8224:[.19444,.69444,0,0,.51111],8225:[.19444,.69444,0,0,.51111],8242:[0,.55556,0,0,.34444],8407:[0,.72444,.15486,0,.575],8463:[0,.69444,0,0,.66759],8465:[0,.69444,0,0,.83055],8467:[0,.69444,0,0,.47361],8472:[.19444,.44444,0,0,.74027],8476:[0,.69444,0,0,.83055],8501:[0,.69444,0,0,.70277],8592:[-.10889,.39111,0,0,1.14999],8593:[.19444,.69444,0,0,.575],8594:[-.10889,.39111,0,0,1.14999],8595:[.19444,.69444,0,0,.575],8596:[-.10889,.39111,0,0,1.14999],8597:[.25,.75,0,0,.575],8598:[.19444,.69444,0,0,1.14999],8599:[.19444,.69444,0,0,1.14999],8600:[.19444,.69444,0,0,1.14999],8601:[.19444,.69444,0,0,1.14999],8636:[-.10889,.39111,0,0,1.14999],8637:[-.10889,.39111,0,0,1.14999],8640:[-.10889,.39111,0,0,1.14999],8641:[-.10889,.39111,0,0,1.14999],8656:[-.10889,.39111,0,0,1.14999],8657:[.19444,.69444,0,0,.70277],8658:[-.10889,.39111,0,0,1.14999],8659:[.19444,.69444,0,0,.70277],8660:[-.10889,.39111,0,0,1.14999],8661:[.25,.75,0,0,.70277],8704:[0,.69444,0,0,.63889],8706:[0,.69444,.06389,0,.62847],8707:[0,.69444,0,0,.63889],8709:[.05556,.75,0,0,.575],8711:[0,.68611,0,0,.95833],8712:[.08556,.58556,0,0,.76666],8715:[.08556,.58556,0,0,.76666],8722:[.13333,.63333,0,0,.89444],8723:[.13333,.63333,0,0,.89444],8725:[.25,.75,0,0,.575],8726:[.25,.75,0,0,.575],8727:[-.02778,.47222,0,0,.575],8728:[-.02639,.47361,0,0,.575],8729:[-.02639,.47361,0,0,.575],8730:[.18,.82,0,0,.95833],8733:[0,.44444,0,0,.89444],8734:[0,.44444,0,0,1.14999],8736:[0,.69224,0,0,.72222],8739:[.25,.75,0,0,.31944],8741:[.25,.75,0,0,.575],8743:[0,.55556,0,0,.76666],8744:[0,.55556,0,0,.76666],8745:[0,.55556,0,0,.76666],8746:[0,.55556,0,0,.76666],8747:[.19444,.69444,.12778,0,.56875],8764:[-.10889,.39111,0,0,.89444],8768:[.19444,.69444,0,0,.31944],8771:[.00222,.50222,0,0,.89444],8773:[.027,.638,0,0,.894],8776:[.02444,.52444,0,0,.89444],8781:[.00222,.50222,0,0,.89444],8801:[.00222,.50222,0,0,.89444],8804:[.19667,.69667,0,0,.89444],8805:[.19667,.69667,0,0,.89444],8810:[.08556,.58556,0,0,1.14999],8811:[.08556,.58556,0,0,1.14999],8826:[.08556,.58556,0,0,.89444],8827:[.08556,.58556,0,0,.89444],8834:[.08556,.58556,0,0,.89444],8835:[.08556,.58556,0,0,.89444],8838:[.19667,.69667,0,0,.89444],8839:[.19667,.69667,0,0,.89444],8846:[0,.55556,0,0,.76666],8849:[.19667,.69667,0,0,.89444],8850:[.19667,.69667,0,0,.89444],8851:[0,.55556,0,0,.76666],8852:[0,.55556,0,0,.76666],8853:[.13333,.63333,0,0,.89444],8854:[.13333,.63333,0,0,.89444],8855:[.13333,.63333,0,0,.89444],8856:[.13333,.63333,0,0,.89444],8857:[.13333,.63333,0,0,.89444],8866:[0,.69444,0,0,.70277],8867:[0,.69444,0,0,.70277],8868:[0,.69444,0,0,.89444],8869:[0,.69444,0,0,.89444],8900:[-.02639,.47361,0,0,.575],8901:[-.02639,.47361,0,0,.31944],8902:[-.02778,.47222,0,0,.575],8968:[.25,.75,0,0,.51111],8969:[.25,.75,0,0,.51111],8970:[.25,.75,0,0,.51111],8971:[.25,.75,0,0,.51111],8994:[-.13889,.36111,0,0,1.14999],8995:[-.13889,.36111,0,0,1.14999],9651:[.19444,.69444,0,0,1.02222],9657:[-.02778,.47222,0,0,.575],9661:[.19444,.69444,0,0,1.02222],9667:[-.02778,.47222,0,0,.575],9711:[.19444,.69444,0,0,1.14999],9824:[.12963,.69444,0,0,.89444],9825:[.12963,.69444,0,0,.89444],9826:[.12963,.69444,0,0,.89444],9827:[.12963,.69444,0,0,.89444],9837:[0,.75,0,0,.44722],9838:[.19444,.69444,0,0,.44722],9839:[.19444,.69444,0,0,.44722],10216:[.25,.75,0,0,.44722],10217:[.25,.75,0,0,.44722],10815:[0,.68611,0,0,.9],10927:[.19667,.69667,0,0,.89444],10928:[.19667,.69667,0,0,.89444],57376:[.19444,.69444,0,0,0]},"Main-BoldItalic":{32:[0,0,0,0,.25],33:[0,.69444,.11417,0,.38611],34:[0,.69444,.07939,0,.62055],35:[.19444,.69444,.06833,0,.94444],37:[.05556,.75,.12861,0,.94444],38:[0,.69444,.08528,0,.88555],39:[0,.69444,.12945,0,.35555],40:[.25,.75,.15806,0,.47333],41:[.25,.75,.03306,0,.47333],42:[0,.75,.14333,0,.59111],43:[.10333,.60333,.03306,0,.88555],44:[.19444,.14722,0,0,.35555],45:[0,.44444,.02611,0,.41444],46:[0,.14722,0,0,.35555],47:[.25,.75,.15806,0,.59111],48:[0,.64444,.13167,0,.59111],49:[0,.64444,.13167,0,.59111],50:[0,.64444,.13167,0,.59111],51:[0,.64444,.13167,0,.59111],52:[.19444,.64444,.13167,0,.59111],53:[0,.64444,.13167,0,.59111],54:[0,.64444,.13167,0,.59111],55:[.19444,.64444,.13167,0,.59111],56:[0,.64444,.13167,0,.59111],57:[0,.64444,.13167,0,.59111],58:[0,.44444,.06695,0,.35555],59:[.19444,.44444,.06695,0,.35555],61:[-.10889,.39111,.06833,0,.88555],63:[0,.69444,.11472,0,.59111],64:[0,.69444,.09208,0,.88555],65:[0,.68611,0,0,.86555],66:[0,.68611,.0992,0,.81666],67:[0,.68611,.14208,0,.82666],68:[0,.68611,.09062,0,.87555],69:[0,.68611,.11431,0,.75666],70:[0,.68611,.12903,0,.72722],71:[0,.68611,.07347,0,.89527],72:[0,.68611,.17208,0,.8961],73:[0,.68611,.15681,0,.47166],74:[0,.68611,.145,0,.61055],75:[0,.68611,.14208,0,.89499],76:[0,.68611,0,0,.69777],77:[0,.68611,.17208,0,1.07277],78:[0,.68611,.17208,0,.8961],79:[0,.68611,.09062,0,.85499],80:[0,.68611,.0992,0,.78721],81:[.19444,.68611,.09062,0,.85499],82:[0,.68611,.02559,0,.85944],83:[0,.68611,.11264,0,.64999],84:[0,.68611,.12903,0,.7961],85:[0,.68611,.17208,0,.88083],86:[0,.68611,.18625,0,.86555],87:[0,.68611,.18625,0,1.15999],88:[0,.68611,.15681,0,.86555],89:[0,.68611,.19803,0,.86555],90:[0,.68611,.14208,0,.70888],91:[.25,.75,.1875,0,.35611],93:[.25,.75,.09972,0,.35611],94:[0,.69444,.06709,0,.59111],95:[.31,.13444,.09811,0,.59111],97:[0,.44444,.09426,0,.59111],98:[0,.69444,.07861,0,.53222],99:[0,.44444,.05222,0,.53222],100:[0,.69444,.10861,0,.59111],101:[0,.44444,.085,0,.53222],102:[.19444,.69444,.21778,0,.4],103:[.19444,.44444,.105,0,.53222],104:[0,.69444,.09426,0,.59111],105:[0,.69326,.11387,0,.35555],106:[.19444,.69326,.1672,0,.35555],107:[0,.69444,.11111,0,.53222],108:[0,.69444,.10861,0,.29666],109:[0,.44444,.09426,0,.94444],110:[0,.44444,.09426,0,.64999],111:[0,.44444,.07861,0,.59111],112:[.19444,.44444,.07861,0,.59111],113:[.19444,.44444,.105,0,.53222],114:[0,.44444,.11111,0,.50167],115:[0,.44444,.08167,0,.48694],116:[0,.63492,.09639,0,.385],117:[0,.44444,.09426,0,.62055],118:[0,.44444,.11111,0,.53222],119:[0,.44444,.11111,0,.76777],120:[0,.44444,.12583,0,.56055],121:[.19444,.44444,.105,0,.56166],122:[0,.44444,.13889,0,.49055],126:[.35,.34444,.11472,0,.59111],160:[0,0,0,0,.25],168:[0,.69444,.11473,0,.59111],176:[0,.69444,0,0,.94888],184:[.17014,0,0,0,.53222],198:[0,.68611,.11431,0,1.02277],216:[.04861,.73472,.09062,0,.88555],223:[.19444,.69444,.09736,0,.665],230:[0,.44444,.085,0,.82666],248:[.09722,.54167,.09458,0,.59111],305:[0,.44444,.09426,0,.35555],338:[0,.68611,.11431,0,1.14054],339:[0,.44444,.085,0,.82666],567:[.19444,.44444,.04611,0,.385],710:[0,.69444,.06709,0,.59111],711:[0,.63194,.08271,0,.59111],713:[0,.59444,.10444,0,.59111],714:[0,.69444,.08528,0,.59111],715:[0,.69444,0,0,.59111],728:[0,.69444,.10333,0,.59111],729:[0,.69444,.12945,0,.35555],730:[0,.69444,0,0,.94888],732:[0,.69444,.11472,0,.59111],733:[0,.69444,.11472,0,.59111],915:[0,.68611,.12903,0,.69777],916:[0,.68611,0,0,.94444],920:[0,.68611,.09062,0,.88555],923:[0,.68611,0,0,.80666],926:[0,.68611,.15092,0,.76777],928:[0,.68611,.17208,0,.8961],931:[0,.68611,.11431,0,.82666],933:[0,.68611,.10778,0,.88555],934:[0,.68611,.05632,0,.82666],936:[0,.68611,.10778,0,.88555],937:[0,.68611,.0992,0,.82666],8211:[0,.44444,.09811,0,.59111],8212:[0,.44444,.09811,0,1.18221],8216:[0,.69444,.12945,0,.35555],8217:[0,.69444,.12945,0,.35555],8220:[0,.69444,.16772,0,.62055],8221:[0,.69444,.07939,0,.62055]},"Main-Italic":{32:[0,0,0,0,.25],33:[0,.69444,.12417,0,.30667],34:[0,.69444,.06961,0,.51444],35:[.19444,.69444,.06616,0,.81777],37:[.05556,.75,.13639,0,.81777],38:[0,.69444,.09694,0,.76666],39:[0,.69444,.12417,0,.30667],40:[.25,.75,.16194,0,.40889],41:[.25,.75,.03694,0,.40889],42:[0,.75,.14917,0,.51111],43:[.05667,.56167,.03694,0,.76666],44:[.19444,.10556,0,0,.30667],45:[0,.43056,.02826,0,.35778],46:[0,.10556,0,0,.30667],47:[.25,.75,.16194,0,.51111],48:[0,.64444,.13556,0,.51111],49:[0,.64444,.13556,0,.51111],50:[0,.64444,.13556,0,.51111],51:[0,.64444,.13556,0,.51111],52:[.19444,.64444,.13556,0,.51111],53:[0,.64444,.13556,0,.51111],54:[0,.64444,.13556,0,.51111],55:[.19444,.64444,.13556,0,.51111],56:[0,.64444,.13556,0,.51111],57:[0,.64444,.13556,0,.51111],58:[0,.43056,.0582,0,.30667],59:[.19444,.43056,.0582,0,.30667],61:[-.13313,.36687,.06616,0,.76666],63:[0,.69444,.1225,0,.51111],64:[0,.69444,.09597,0,.76666],65:[0,.68333,0,0,.74333],66:[0,.68333,.10257,0,.70389],67:[0,.68333,.14528,0,.71555],68:[0,.68333,.09403,0,.755],69:[0,.68333,.12028,0,.67833],70:[0,.68333,.13305,0,.65277],71:[0,.68333,.08722,0,.77361],72:[0,.68333,.16389,0,.74333],73:[0,.68333,.15806,0,.38555],74:[0,.68333,.14028,0,.525],75:[0,.68333,.14528,0,.76888],76:[0,.68333,0,0,.62722],77:[0,.68333,.16389,0,.89666],78:[0,.68333,.16389,0,.74333],79:[0,.68333,.09403,0,.76666],80:[0,.68333,.10257,0,.67833],81:[.19444,.68333,.09403,0,.76666],82:[0,.68333,.03868,0,.72944],83:[0,.68333,.11972,0,.56222],84:[0,.68333,.13305,0,.71555],85:[0,.68333,.16389,0,.74333],86:[0,.68333,.18361,0,.74333],87:[0,.68333,.18361,0,.99888],88:[0,.68333,.15806,0,.74333],89:[0,.68333,.19383,0,.74333],90:[0,.68333,.14528,0,.61333],91:[.25,.75,.1875,0,.30667],93:[.25,.75,.10528,0,.30667],94:[0,.69444,.06646,0,.51111],95:[.31,.12056,.09208,0,.51111],97:[0,.43056,.07671,0,.51111],98:[0,.69444,.06312,0,.46],99:[0,.43056,.05653,0,.46],100:[0,.69444,.10333,0,.51111],101:[0,.43056,.07514,0,.46],102:[.19444,.69444,.21194,0,.30667],103:[.19444,.43056,.08847,0,.46],104:[0,.69444,.07671,0,.51111],105:[0,.65536,.1019,0,.30667],106:[.19444,.65536,.14467,0,.30667],107:[0,.69444,.10764,0,.46],108:[0,.69444,.10333,0,.25555],109:[0,.43056,.07671,0,.81777],110:[0,.43056,.07671,0,.56222],111:[0,.43056,.06312,0,.51111],112:[.19444,.43056,.06312,0,.51111],113:[.19444,.43056,.08847,0,.46],114:[0,.43056,.10764,0,.42166],115:[0,.43056,.08208,0,.40889],116:[0,.61508,.09486,0,.33222],117:[0,.43056,.07671,0,.53666],118:[0,.43056,.10764,0,.46],119:[0,.43056,.10764,0,.66444],120:[0,.43056,.12042,0,.46389],121:[.19444,.43056,.08847,0,.48555],122:[0,.43056,.12292,0,.40889],126:[.35,.31786,.11585,0,.51111],160:[0,0,0,0,.25],168:[0,.66786,.10474,0,.51111],176:[0,.69444,0,0,.83129],184:[.17014,0,0,0,.46],198:[0,.68333,.12028,0,.88277],216:[.04861,.73194,.09403,0,.76666],223:[.19444,.69444,.10514,0,.53666],230:[0,.43056,.07514,0,.71555],248:[.09722,.52778,.09194,0,.51111],338:[0,.68333,.12028,0,.98499],339:[0,.43056,.07514,0,.71555],710:[0,.69444,.06646,0,.51111],711:[0,.62847,.08295,0,.51111],713:[0,.56167,.10333,0,.51111],714:[0,.69444,.09694,0,.51111],715:[0,.69444,0,0,.51111],728:[0,.69444,.10806,0,.51111],729:[0,.66786,.11752,0,.30667],730:[0,.69444,0,0,.83129],732:[0,.66786,.11585,0,.51111],733:[0,.69444,.1225,0,.51111],915:[0,.68333,.13305,0,.62722],916:[0,.68333,0,0,.81777],920:[0,.68333,.09403,0,.76666],923:[0,.68333,0,0,.69222],926:[0,.68333,.15294,0,.66444],928:[0,.68333,.16389,0,.74333],931:[0,.68333,.12028,0,.71555],933:[0,.68333,.11111,0,.76666],934:[0,.68333,.05986,0,.71555],936:[0,.68333,.11111,0,.76666],937:[0,.68333,.10257,0,.71555],8211:[0,.43056,.09208,0,.51111],8212:[0,.43056,.09208,0,1.02222],8216:[0,.69444,.12417,0,.30667],8217:[0,.69444,.12417,0,.30667],8220:[0,.69444,.1685,0,.51444],8221:[0,.69444,.06961,0,.51444],8463:[0,.68889,0,0,.54028]},"Main-Regular":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.27778],34:[0,.69444,0,0,.5],35:[.19444,.69444,0,0,.83334],36:[.05556,.75,0,0,.5],37:[.05556,.75,0,0,.83334],38:[0,.69444,0,0,.77778],39:[0,.69444,0,0,.27778],40:[.25,.75,0,0,.38889],41:[.25,.75,0,0,.38889],42:[0,.75,0,0,.5],43:[.08333,.58333,0,0,.77778],44:[.19444,.10556,0,0,.27778],45:[0,.43056,0,0,.33333],46:[0,.10556,0,0,.27778],47:[.25,.75,0,0,.5],48:[0,.64444,0,0,.5],49:[0,.64444,0,0,.5],50:[0,.64444,0,0,.5],51:[0,.64444,0,0,.5],52:[0,.64444,0,0,.5],53:[0,.64444,0,0,.5],54:[0,.64444,0,0,.5],55:[0,.64444,0,0,.5],56:[0,.64444,0,0,.5],57:[0,.64444,0,0,.5],58:[0,.43056,0,0,.27778],59:[.19444,.43056,0,0,.27778],60:[.0391,.5391,0,0,.77778],61:[-.13313,.36687,0,0,.77778],62:[.0391,.5391,0,0,.77778],63:[0,.69444,0,0,.47222],64:[0,.69444,0,0,.77778],65:[0,.68333,0,0,.75],66:[0,.68333,0,0,.70834],67:[0,.68333,0,0,.72222],68:[0,.68333,0,0,.76389],69:[0,.68333,0,0,.68056],70:[0,.68333,0,0,.65278],71:[0,.68333,0,0,.78472],72:[0,.68333,0,0,.75],73:[0,.68333,0,0,.36111],74:[0,.68333,0,0,.51389],75:[0,.68333,0,0,.77778],76:[0,.68333,0,0,.625],77:[0,.68333,0,0,.91667],78:[0,.68333,0,0,.75],79:[0,.68333,0,0,.77778],80:[0,.68333,0,0,.68056],81:[.19444,.68333,0,0,.77778],82:[0,.68333,0,0,.73611],83:[0,.68333,0,0,.55556],84:[0,.68333,0,0,.72222],85:[0,.68333,0,0,.75],86:[0,.68333,.01389,0,.75],87:[0,.68333,.01389,0,1.02778],88:[0,.68333,0,0,.75],89:[0,.68333,.025,0,.75],90:[0,.68333,0,0,.61111],91:[.25,.75,0,0,.27778],92:[.25,.75,0,0,.5],93:[.25,.75,0,0,.27778],94:[0,.69444,0,0,.5],95:[.31,.12056,.02778,0,.5],97:[0,.43056,0,0,.5],98:[0,.69444,0,0,.55556],99:[0,.43056,0,0,.44445],100:[0,.69444,0,0,.55556],101:[0,.43056,0,0,.44445],102:[0,.69444,.07778,0,.30556],103:[.19444,.43056,.01389,0,.5],104:[0,.69444,0,0,.55556],105:[0,.66786,0,0,.27778],106:[.19444,.66786,0,0,.30556],107:[0,.69444,0,0,.52778],108:[0,.69444,0,0,.27778],109:[0,.43056,0,0,.83334],110:[0,.43056,0,0,.55556],111:[0,.43056,0,0,.5],112:[.19444,.43056,0,0,.55556],113:[.19444,.43056,0,0,.52778],114:[0,.43056,0,0,.39167],115:[0,.43056,0,0,.39445],116:[0,.61508,0,0,.38889],117:[0,.43056,0,0,.55556],118:[0,.43056,.01389,0,.52778],119:[0,.43056,.01389,0,.72222],120:[0,.43056,0,0,.52778],121:[.19444,.43056,.01389,0,.52778],122:[0,.43056,0,0,.44445],123:[.25,.75,0,0,.5],124:[.25,.75,0,0,.27778],125:[.25,.75,0,0,.5],126:[.35,.31786,0,0,.5],160:[0,0,0,0,.25],163:[0,.69444,0,0,.76909],167:[.19444,.69444,0,0,.44445],168:[0,.66786,0,0,.5],172:[0,.43056,0,0,.66667],176:[0,.69444,0,0,.75],177:[.08333,.58333,0,0,.77778],182:[.19444,.69444,0,0,.61111],184:[.17014,0,0,0,.44445],198:[0,.68333,0,0,.90278],215:[.08333,.58333,0,0,.77778],216:[.04861,.73194,0,0,.77778],223:[0,.69444,0,0,.5],230:[0,.43056,0,0,.72222],247:[.08333,.58333,0,0,.77778],248:[.09722,.52778,0,0,.5],305:[0,.43056,0,0,.27778],338:[0,.68333,0,0,1.01389],339:[0,.43056,0,0,.77778],567:[.19444,.43056,0,0,.30556],710:[0,.69444,0,0,.5],711:[0,.62847,0,0,.5],713:[0,.56778,0,0,.5],714:[0,.69444,0,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,0,0,.5],729:[0,.66786,0,0,.27778],730:[0,.69444,0,0,.75],732:[0,.66786,0,0,.5],733:[0,.69444,0,0,.5],915:[0,.68333,0,0,.625],916:[0,.68333,0,0,.83334],920:[0,.68333,0,0,.77778],923:[0,.68333,0,0,.69445],926:[0,.68333,0,0,.66667],928:[0,.68333,0,0,.75],931:[0,.68333,0,0,.72222],933:[0,.68333,0,0,.77778],934:[0,.68333,0,0,.72222],936:[0,.68333,0,0,.77778],937:[0,.68333,0,0,.72222],8211:[0,.43056,.02778,0,.5],8212:[0,.43056,.02778,0,1],8216:[0,.69444,0,0,.27778],8217:[0,.69444,0,0,.27778],8220:[0,.69444,0,0,.5],8221:[0,.69444,0,0,.5],8224:[.19444,.69444,0,0,.44445],8225:[.19444,.69444,0,0,.44445],8230:[0,.123,0,0,1.172],8242:[0,.55556,0,0,.275],8407:[0,.71444,.15382,0,.5],8463:[0,.68889,0,0,.54028],8465:[0,.69444,0,0,.72222],8467:[0,.69444,0,.11111,.41667],8472:[.19444,.43056,0,.11111,.63646],8476:[0,.69444,0,0,.72222],8501:[0,.69444,0,0,.61111],8592:[-.13313,.36687,0,0,1],8593:[.19444,.69444,0,0,.5],8594:[-.13313,.36687,0,0,1],8595:[.19444,.69444,0,0,.5],8596:[-.13313,.36687,0,0,1],8597:[.25,.75,0,0,.5],8598:[.19444,.69444,0,0,1],8599:[.19444,.69444,0,0,1],8600:[.19444,.69444,0,0,1],8601:[.19444,.69444,0,0,1],8614:[.011,.511,0,0,1],8617:[.011,.511,0,0,1.126],8618:[.011,.511,0,0,1.126],8636:[-.13313,.36687,0,0,1],8637:[-.13313,.36687,0,0,1],8640:[-.13313,.36687,0,0,1],8641:[-.13313,.36687,0,0,1],8652:[.011,.671,0,0,1],8656:[-.13313,.36687,0,0,1],8657:[.19444,.69444,0,0,.61111],8658:[-.13313,.36687,0,0,1],8659:[.19444,.69444,0,0,.61111],8660:[-.13313,.36687,0,0,1],8661:[.25,.75,0,0,.61111],8704:[0,.69444,0,0,.55556],8706:[0,.69444,.05556,.08334,.5309],8707:[0,.69444,0,0,.55556],8709:[.05556,.75,0,0,.5],8711:[0,.68333,0,0,.83334],8712:[.0391,.5391,0,0,.66667],8715:[.0391,.5391,0,0,.66667],8722:[.08333,.58333,0,0,.77778],8723:[.08333,.58333,0,0,.77778],8725:[.25,.75,0,0,.5],8726:[.25,.75,0,0,.5],8727:[-.03472,.46528,0,0,.5],8728:[-.05555,.44445,0,0,.5],8729:[-.05555,.44445,0,0,.5],8730:[.2,.8,0,0,.83334],8733:[0,.43056,0,0,.77778],8734:[0,.43056,0,0,1],8736:[0,.69224,0,0,.72222],8739:[.25,.75,0,0,.27778],8741:[.25,.75,0,0,.5],8743:[0,.55556,0,0,.66667],8744:[0,.55556,0,0,.66667],8745:[0,.55556,0,0,.66667],8746:[0,.55556,0,0,.66667],8747:[.19444,.69444,.11111,0,.41667],8764:[-.13313,.36687,0,0,.77778],8768:[.19444,.69444,0,0,.27778],8771:[-.03625,.46375,0,0,.77778],8773:[-.022,.589,0,0,.778],8776:[-.01688,.48312,0,0,.77778],8781:[-.03625,.46375,0,0,.77778],8784:[-.133,.673,0,0,.778],8801:[-.03625,.46375,0,0,.77778],8804:[.13597,.63597,0,0,.77778],8805:[.13597,.63597,0,0,.77778],8810:[.0391,.5391,0,0,1],8811:[.0391,.5391,0,0,1],8826:[.0391,.5391,0,0,.77778],8827:[.0391,.5391,0,0,.77778],8834:[.0391,.5391,0,0,.77778],8835:[.0391,.5391,0,0,.77778],8838:[.13597,.63597,0,0,.77778],8839:[.13597,.63597,0,0,.77778],8846:[0,.55556,0,0,.66667],8849:[.13597,.63597,0,0,.77778],8850:[.13597,.63597,0,0,.77778],8851:[0,.55556,0,0,.66667],8852:[0,.55556,0,0,.66667],8853:[.08333,.58333,0,0,.77778],8854:[.08333,.58333,0,0,.77778],8855:[.08333,.58333,0,0,.77778],8856:[.08333,.58333,0,0,.77778],8857:[.08333,.58333,0,0,.77778],8866:[0,.69444,0,0,.61111],8867:[0,.69444,0,0,.61111],8868:[0,.69444,0,0,.77778],8869:[0,.69444,0,0,.77778],8872:[.249,.75,0,0,.867],8900:[-.05555,.44445,0,0,.5],8901:[-.05555,.44445,0,0,.27778],8902:[-.03472,.46528,0,0,.5],8904:[.005,.505,0,0,.9],8942:[.03,.903,0,0,.278],8943:[-.19,.313,0,0,1.172],8945:[-.1,.823,0,0,1.282],8968:[.25,.75,0,0,.44445],8969:[.25,.75,0,0,.44445],8970:[.25,.75,0,0,.44445],8971:[.25,.75,0,0,.44445],8994:[-.14236,.35764,0,0,1],8995:[-.14236,.35764,0,0,1],9136:[.244,.744,0,0,.412],9137:[.244,.745,0,0,.412],9651:[.19444,.69444,0,0,.88889],9657:[-.03472,.46528,0,0,.5],9661:[.19444,.69444,0,0,.88889],9667:[-.03472,.46528,0,0,.5],9711:[.19444,.69444,0,0,1],9824:[.12963,.69444,0,0,.77778],9825:[.12963,.69444,0,0,.77778],9826:[.12963,.69444,0,0,.77778],9827:[.12963,.69444,0,0,.77778],9837:[0,.75,0,0,.38889],9838:[.19444,.69444,0,0,.38889],9839:[.19444,.69444,0,0,.38889],10216:[.25,.75,0,0,.38889],10217:[.25,.75,0,0,.38889],10222:[.244,.744,0,0,.412],10223:[.244,.745,0,0,.412],10229:[.011,.511,0,0,1.609],10230:[.011,.511,0,0,1.638],10231:[.011,.511,0,0,1.859],10232:[.024,.525,0,0,1.609],10233:[.024,.525,0,0,1.638],10234:[.024,.525,0,0,1.858],10236:[.011,.511,0,0,1.638],10815:[0,.68333,0,0,.75],10927:[.13597,.63597,0,0,.77778],10928:[.13597,.63597,0,0,.77778],57376:[.19444,.69444,0,0,0]},"Math-BoldItalic":{32:[0,0,0,0,.25],48:[0,.44444,0,0,.575],49:[0,.44444,0,0,.575],50:[0,.44444,0,0,.575],51:[.19444,.44444,0,0,.575],52:[.19444,.44444,0,0,.575],53:[.19444,.44444,0,0,.575],54:[0,.64444,0,0,.575],55:[.19444,.44444,0,0,.575],56:[0,.64444,0,0,.575],57:[.19444,.44444,0,0,.575],65:[0,.68611,0,0,.86944],66:[0,.68611,.04835,0,.8664],67:[0,.68611,.06979,0,.81694],68:[0,.68611,.03194,0,.93812],69:[0,.68611,.05451,0,.81007],70:[0,.68611,.15972,0,.68889],71:[0,.68611,0,0,.88673],72:[0,.68611,.08229,0,.98229],73:[0,.68611,.07778,0,.51111],74:[0,.68611,.10069,0,.63125],75:[0,.68611,.06979,0,.97118],76:[0,.68611,0,0,.75555],77:[0,.68611,.11424,0,1.14201],78:[0,.68611,.11424,0,.95034],79:[0,.68611,.03194,0,.83666],80:[0,.68611,.15972,0,.72309],81:[.19444,.68611,0,0,.86861],82:[0,.68611,.00421,0,.87235],83:[0,.68611,.05382,0,.69271],84:[0,.68611,.15972,0,.63663],85:[0,.68611,.11424,0,.80027],86:[0,.68611,.25555,0,.67778],87:[0,.68611,.15972,0,1.09305],88:[0,.68611,.07778,0,.94722],89:[0,.68611,.25555,0,.67458],90:[0,.68611,.06979,0,.77257],97:[0,.44444,0,0,.63287],98:[0,.69444,0,0,.52083],99:[0,.44444,0,0,.51342],100:[0,.69444,0,0,.60972],101:[0,.44444,0,0,.55361],102:[.19444,.69444,.11042,0,.56806],103:[.19444,.44444,.03704,0,.5449],104:[0,.69444,0,0,.66759],105:[0,.69326,0,0,.4048],106:[.19444,.69326,.0622,0,.47083],107:[0,.69444,.01852,0,.6037],108:[0,.69444,.0088,0,.34815],109:[0,.44444,0,0,1.0324],110:[0,.44444,0,0,.71296],111:[0,.44444,0,0,.58472],112:[.19444,.44444,0,0,.60092],113:[.19444,.44444,.03704,0,.54213],114:[0,.44444,.03194,0,.5287],115:[0,.44444,0,0,.53125],116:[0,.63492,0,0,.41528],117:[0,.44444,0,0,.68102],118:[0,.44444,.03704,0,.56666],119:[0,.44444,.02778,0,.83148],120:[0,.44444,0,0,.65903],121:[.19444,.44444,.03704,0,.59028],122:[0,.44444,.04213,0,.55509],160:[0,0,0,0,.25],915:[0,.68611,.15972,0,.65694],916:[0,.68611,0,0,.95833],920:[0,.68611,.03194,0,.86722],923:[0,.68611,0,0,.80555],926:[0,.68611,.07458,0,.84125],928:[0,.68611,.08229,0,.98229],931:[0,.68611,.05451,0,.88507],933:[0,.68611,.15972,0,.67083],934:[0,.68611,0,0,.76666],936:[0,.68611,.11653,0,.71402],937:[0,.68611,.04835,0,.8789],945:[0,.44444,0,0,.76064],946:[.19444,.69444,.03403,0,.65972],947:[.19444,.44444,.06389,0,.59003],948:[0,.69444,.03819,0,.52222],949:[0,.44444,0,0,.52882],950:[.19444,.69444,.06215,0,.50833],951:[.19444,.44444,.03704,0,.6],952:[0,.69444,.03194,0,.5618],953:[0,.44444,0,0,.41204],954:[0,.44444,0,0,.66759],955:[0,.69444,0,0,.67083],956:[.19444,.44444,0,0,.70787],957:[0,.44444,.06898,0,.57685],958:[.19444,.69444,.03021,0,.50833],959:[0,.44444,0,0,.58472],960:[0,.44444,.03704,0,.68241],961:[.19444,.44444,0,0,.6118],962:[.09722,.44444,.07917,0,.42361],963:[0,.44444,.03704,0,.68588],964:[0,.44444,.13472,0,.52083],965:[0,.44444,.03704,0,.63055],966:[.19444,.44444,0,0,.74722],967:[.19444,.44444,0,0,.71805],968:[.19444,.69444,.03704,0,.75833],969:[0,.44444,.03704,0,.71782],977:[0,.69444,0,0,.69155],981:[.19444,.69444,0,0,.7125],982:[0,.44444,.03194,0,.975],1009:[.19444,.44444,0,0,.6118],1013:[0,.44444,0,0,.48333],57649:[0,.44444,0,0,.39352],57911:[.19444,.44444,0,0,.43889]},"Math-Italic":{32:[0,0,0,0,.25],48:[0,.43056,0,0,.5],49:[0,.43056,0,0,.5],50:[0,.43056,0,0,.5],51:[.19444,.43056,0,0,.5],52:[.19444,.43056,0,0,.5],53:[.19444,.43056,0,0,.5],54:[0,.64444,0,0,.5],55:[.19444,.43056,0,0,.5],56:[0,.64444,0,0,.5],57:[.19444,.43056,0,0,.5],65:[0,.68333,0,.13889,.75],66:[0,.68333,.05017,.08334,.75851],67:[0,.68333,.07153,.08334,.71472],68:[0,.68333,.02778,.05556,.82792],69:[0,.68333,.05764,.08334,.7382],70:[0,.68333,.13889,.08334,.64306],71:[0,.68333,0,.08334,.78625],72:[0,.68333,.08125,.05556,.83125],73:[0,.68333,.07847,.11111,.43958],74:[0,.68333,.09618,.16667,.55451],75:[0,.68333,.07153,.05556,.84931],76:[0,.68333,0,.02778,.68056],77:[0,.68333,.10903,.08334,.97014],78:[0,.68333,.10903,.08334,.80347],79:[0,.68333,.02778,.08334,.76278],80:[0,.68333,.13889,.08334,.64201],81:[.19444,.68333,0,.08334,.79056],82:[0,.68333,.00773,.08334,.75929],83:[0,.68333,.05764,.08334,.6132],84:[0,.68333,.13889,.08334,.58438],85:[0,.68333,.10903,.02778,.68278],86:[0,.68333,.22222,0,.58333],87:[0,.68333,.13889,0,.94445],88:[0,.68333,.07847,.08334,.82847],89:[0,.68333,.22222,0,.58056],90:[0,.68333,.07153,.08334,.68264],97:[0,.43056,0,0,.52859],98:[0,.69444,0,0,.42917],99:[0,.43056,0,.05556,.43276],100:[0,.69444,0,.16667,.52049],101:[0,.43056,0,.05556,.46563],102:[.19444,.69444,.10764,.16667,.48959],103:[.19444,.43056,.03588,.02778,.47697],104:[0,.69444,0,0,.57616],105:[0,.65952,0,0,.34451],106:[.19444,.65952,.05724,0,.41181],107:[0,.69444,.03148,0,.5206],108:[0,.69444,.01968,.08334,.29838],109:[0,.43056,0,0,.87801],110:[0,.43056,0,0,.60023],111:[0,.43056,0,.05556,.48472],112:[.19444,.43056,0,.08334,.50313],113:[.19444,.43056,.03588,.08334,.44641],114:[0,.43056,.02778,.05556,.45116],115:[0,.43056,0,.05556,.46875],116:[0,.61508,0,.08334,.36111],117:[0,.43056,0,.02778,.57246],118:[0,.43056,.03588,.02778,.48472],119:[0,.43056,.02691,.08334,.71592],120:[0,.43056,0,.02778,.57153],121:[.19444,.43056,.03588,.05556,.49028],122:[0,.43056,.04398,.05556,.46505],160:[0,0,0,0,.25],915:[0,.68333,.13889,.08334,.61528],916:[0,.68333,0,.16667,.83334],920:[0,.68333,.02778,.08334,.76278],923:[0,.68333,0,.16667,.69445],926:[0,.68333,.07569,.08334,.74236],928:[0,.68333,.08125,.05556,.83125],931:[0,.68333,.05764,.08334,.77986],933:[0,.68333,.13889,.05556,.58333],934:[0,.68333,0,.08334,.66667],936:[0,.68333,.11,.05556,.61222],937:[0,.68333,.05017,.08334,.7724],945:[0,.43056,.0037,.02778,.6397],946:[.19444,.69444,.05278,.08334,.56563],947:[.19444,.43056,.05556,0,.51773],948:[0,.69444,.03785,.05556,.44444],949:[0,.43056,0,.08334,.46632],950:[.19444,.69444,.07378,.08334,.4375],951:[.19444,.43056,.03588,.05556,.49653],952:[0,.69444,.02778,.08334,.46944],953:[0,.43056,0,.05556,.35394],954:[0,.43056,0,0,.57616],955:[0,.69444,0,0,.58334],956:[.19444,.43056,0,.02778,.60255],957:[0,.43056,.06366,.02778,.49398],958:[.19444,.69444,.04601,.11111,.4375],959:[0,.43056,0,.05556,.48472],960:[0,.43056,.03588,0,.57003],961:[.19444,.43056,0,.08334,.51702],962:[.09722,.43056,.07986,.08334,.36285],963:[0,.43056,.03588,0,.57141],964:[0,.43056,.1132,.02778,.43715],965:[0,.43056,.03588,.02778,.54028],966:[.19444,.43056,0,.08334,.65417],967:[.19444,.43056,0,.05556,.62569],968:[.19444,.69444,.03588,.11111,.65139],969:[0,.43056,.03588,0,.62245],977:[0,.69444,0,.08334,.59144],981:[.19444,.69444,0,.08334,.59583],982:[0,.43056,.02778,0,.82813],1009:[.19444,.43056,0,.08334,.51702],1013:[0,.43056,0,.05556,.4059],57649:[0,.43056,0,.02778,.32246],57911:[.19444,.43056,0,.08334,.38403]},"SansSerif-Bold":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.36667],34:[0,.69444,0,0,.55834],35:[.19444,.69444,0,0,.91667],36:[.05556,.75,0,0,.55],37:[.05556,.75,0,0,1.02912],38:[0,.69444,0,0,.83056],39:[0,.69444,0,0,.30556],40:[.25,.75,0,0,.42778],41:[.25,.75,0,0,.42778],42:[0,.75,0,0,.55],43:[.11667,.61667,0,0,.85556],44:[.10556,.13056,0,0,.30556],45:[0,.45833,0,0,.36667],46:[0,.13056,0,0,.30556],47:[.25,.75,0,0,.55],48:[0,.69444,0,0,.55],49:[0,.69444,0,0,.55],50:[0,.69444,0,0,.55],51:[0,.69444,0,0,.55],52:[0,.69444,0,0,.55],53:[0,.69444,0,0,.55],54:[0,.69444,0,0,.55],55:[0,.69444,0,0,.55],56:[0,.69444,0,0,.55],57:[0,.69444,0,0,.55],58:[0,.45833,0,0,.30556],59:[.10556,.45833,0,0,.30556],61:[-.09375,.40625,0,0,.85556],63:[0,.69444,0,0,.51945],64:[0,.69444,0,0,.73334],65:[0,.69444,0,0,.73334],66:[0,.69444,0,0,.73334],67:[0,.69444,0,0,.70278],68:[0,.69444,0,0,.79445],69:[0,.69444,0,0,.64167],70:[0,.69444,0,0,.61111],71:[0,.69444,0,0,.73334],72:[0,.69444,0,0,.79445],73:[0,.69444,0,0,.33056],74:[0,.69444,0,0,.51945],75:[0,.69444,0,0,.76389],76:[0,.69444,0,0,.58056],77:[0,.69444,0,0,.97778],78:[0,.69444,0,0,.79445],79:[0,.69444,0,0,.79445],80:[0,.69444,0,0,.70278],81:[.10556,.69444,0,0,.79445],82:[0,.69444,0,0,.70278],83:[0,.69444,0,0,.61111],84:[0,.69444,0,0,.73334],85:[0,.69444,0,0,.76389],86:[0,.69444,.01528,0,.73334],87:[0,.69444,.01528,0,1.03889],88:[0,.69444,0,0,.73334],89:[0,.69444,.0275,0,.73334],90:[0,.69444,0,0,.67223],91:[.25,.75,0,0,.34306],93:[.25,.75,0,0,.34306],94:[0,.69444,0,0,.55],95:[.35,.10833,.03056,0,.55],97:[0,.45833,0,0,.525],98:[0,.69444,0,0,.56111],99:[0,.45833,0,0,.48889],100:[0,.69444,0,0,.56111],101:[0,.45833,0,0,.51111],102:[0,.69444,.07639,0,.33611],103:[.19444,.45833,.01528,0,.55],104:[0,.69444,0,0,.56111],105:[0,.69444,0,0,.25556],106:[.19444,.69444,0,0,.28611],107:[0,.69444,0,0,.53056],108:[0,.69444,0,0,.25556],109:[0,.45833,0,0,.86667],110:[0,.45833,0,0,.56111],111:[0,.45833,0,0,.55],112:[.19444,.45833,0,0,.56111],113:[.19444,.45833,0,0,.56111],114:[0,.45833,.01528,0,.37222],115:[0,.45833,0,0,.42167],116:[0,.58929,0,0,.40417],117:[0,.45833,0,0,.56111],118:[0,.45833,.01528,0,.5],119:[0,.45833,.01528,0,.74445],120:[0,.45833,0,0,.5],121:[.19444,.45833,.01528,0,.5],122:[0,.45833,0,0,.47639],126:[.35,.34444,0,0,.55],160:[0,0,0,0,.25],168:[0,.69444,0,0,.55],176:[0,.69444,0,0,.73334],180:[0,.69444,0,0,.55],184:[.17014,0,0,0,.48889],305:[0,.45833,0,0,.25556],567:[.19444,.45833,0,0,.28611],710:[0,.69444,0,0,.55],711:[0,.63542,0,0,.55],713:[0,.63778,0,0,.55],728:[0,.69444,0,0,.55],729:[0,.69444,0,0,.30556],730:[0,.69444,0,0,.73334],732:[0,.69444,0,0,.55],733:[0,.69444,0,0,.55],915:[0,.69444,0,0,.58056],916:[0,.69444,0,0,.91667],920:[0,.69444,0,0,.85556],923:[0,.69444,0,0,.67223],926:[0,.69444,0,0,.73334],928:[0,.69444,0,0,.79445],931:[0,.69444,0,0,.79445],933:[0,.69444,0,0,.85556],934:[0,.69444,0,0,.79445],936:[0,.69444,0,0,.85556],937:[0,.69444,0,0,.79445],8211:[0,.45833,.03056,0,.55],8212:[0,.45833,.03056,0,1.10001],8216:[0,.69444,0,0,.30556],8217:[0,.69444,0,0,.30556],8220:[0,.69444,0,0,.55834],8221:[0,.69444,0,0,.55834]},"SansSerif-Italic":{32:[0,0,0,0,.25],33:[0,.69444,.05733,0,.31945],34:[0,.69444,.00316,0,.5],35:[.19444,.69444,.05087,0,.83334],36:[.05556,.75,.11156,0,.5],37:[.05556,.75,.03126,0,.83334],38:[0,.69444,.03058,0,.75834],39:[0,.69444,.07816,0,.27778],40:[.25,.75,.13164,0,.38889],41:[.25,.75,.02536,0,.38889],42:[0,.75,.11775,0,.5],43:[.08333,.58333,.02536,0,.77778],44:[.125,.08333,0,0,.27778],45:[0,.44444,.01946,0,.33333],46:[0,.08333,0,0,.27778],47:[.25,.75,.13164,0,.5],48:[0,.65556,.11156,0,.5],49:[0,.65556,.11156,0,.5],50:[0,.65556,.11156,0,.5],51:[0,.65556,.11156,0,.5],52:[0,.65556,.11156,0,.5],53:[0,.65556,.11156,0,.5],54:[0,.65556,.11156,0,.5],55:[0,.65556,.11156,0,.5],56:[0,.65556,.11156,0,.5],57:[0,.65556,.11156,0,.5],58:[0,.44444,.02502,0,.27778],59:[.125,.44444,.02502,0,.27778],61:[-.13,.37,.05087,0,.77778],63:[0,.69444,.11809,0,.47222],64:[0,.69444,.07555,0,.66667],65:[0,.69444,0,0,.66667],66:[0,.69444,.08293,0,.66667],67:[0,.69444,.11983,0,.63889],68:[0,.69444,.07555,0,.72223],69:[0,.69444,.11983,0,.59722],70:[0,.69444,.13372,0,.56945],71:[0,.69444,.11983,0,.66667],72:[0,.69444,.08094,0,.70834],73:[0,.69444,.13372,0,.27778],74:[0,.69444,.08094,0,.47222],75:[0,.69444,.11983,0,.69445],76:[0,.69444,0,0,.54167],77:[0,.69444,.08094,0,.875],78:[0,.69444,.08094,0,.70834],79:[0,.69444,.07555,0,.73611],80:[0,.69444,.08293,0,.63889],81:[.125,.69444,.07555,0,.73611],82:[0,.69444,.08293,0,.64584],83:[0,.69444,.09205,0,.55556],84:[0,.69444,.13372,0,.68056],85:[0,.69444,.08094,0,.6875],86:[0,.69444,.1615,0,.66667],87:[0,.69444,.1615,0,.94445],88:[0,.69444,.13372,0,.66667],89:[0,.69444,.17261,0,.66667],90:[0,.69444,.11983,0,.61111],91:[.25,.75,.15942,0,.28889],93:[.25,.75,.08719,0,.28889],94:[0,.69444,.0799,0,.5],95:[.35,.09444,.08616,0,.5],97:[0,.44444,.00981,0,.48056],98:[0,.69444,.03057,0,.51667],99:[0,.44444,.08336,0,.44445],100:[0,.69444,.09483,0,.51667],101:[0,.44444,.06778,0,.44445],102:[0,.69444,.21705,0,.30556],103:[.19444,.44444,.10836,0,.5],104:[0,.69444,.01778,0,.51667],105:[0,.67937,.09718,0,.23889],106:[.19444,.67937,.09162,0,.26667],107:[0,.69444,.08336,0,.48889],108:[0,.69444,.09483,0,.23889],109:[0,.44444,.01778,0,.79445],110:[0,.44444,.01778,0,.51667],111:[0,.44444,.06613,0,.5],112:[.19444,.44444,.0389,0,.51667],113:[.19444,.44444,.04169,0,.51667],114:[0,.44444,.10836,0,.34167],115:[0,.44444,.0778,0,.38333],116:[0,.57143,.07225,0,.36111],117:[0,.44444,.04169,0,.51667],118:[0,.44444,.10836,0,.46111],119:[0,.44444,.10836,0,.68334],120:[0,.44444,.09169,0,.46111],121:[.19444,.44444,.10836,0,.46111],122:[0,.44444,.08752,0,.43472],126:[.35,.32659,.08826,0,.5],160:[0,0,0,0,.25],168:[0,.67937,.06385,0,.5],176:[0,.69444,0,0,.73752],184:[.17014,0,0,0,.44445],305:[0,.44444,.04169,0,.23889],567:[.19444,.44444,.04169,0,.26667],710:[0,.69444,.0799,0,.5],711:[0,.63194,.08432,0,.5],713:[0,.60889,.08776,0,.5],714:[0,.69444,.09205,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,.09483,0,.5],729:[0,.67937,.07774,0,.27778],730:[0,.69444,0,0,.73752],732:[0,.67659,.08826,0,.5],733:[0,.69444,.09205,0,.5],915:[0,.69444,.13372,0,.54167],916:[0,.69444,0,0,.83334],920:[0,.69444,.07555,0,.77778],923:[0,.69444,0,0,.61111],926:[0,.69444,.12816,0,.66667],928:[0,.69444,.08094,0,.70834],931:[0,.69444,.11983,0,.72222],933:[0,.69444,.09031,0,.77778],934:[0,.69444,.04603,0,.72222],936:[0,.69444,.09031,0,.77778],937:[0,.69444,.08293,0,.72222],8211:[0,.44444,.08616,0,.5],8212:[0,.44444,.08616,0,1],8216:[0,.69444,.07816,0,.27778],8217:[0,.69444,.07816,0,.27778],8220:[0,.69444,.14205,0,.5],8221:[0,.69444,.00316,0,.5]},"SansSerif-Regular":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.31945],34:[0,.69444,0,0,.5],35:[.19444,.69444,0,0,.83334],36:[.05556,.75,0,0,.5],37:[.05556,.75,0,0,.83334],38:[0,.69444,0,0,.75834],39:[0,.69444,0,0,.27778],40:[.25,.75,0,0,.38889],41:[.25,.75,0,0,.38889],42:[0,.75,0,0,.5],43:[.08333,.58333,0,0,.77778],44:[.125,.08333,0,0,.27778],45:[0,.44444,0,0,.33333],46:[0,.08333,0,0,.27778],47:[.25,.75,0,0,.5],48:[0,.65556,0,0,.5],49:[0,.65556,0,0,.5],50:[0,.65556,0,0,.5],51:[0,.65556,0,0,.5],52:[0,.65556,0,0,.5],53:[0,.65556,0,0,.5],54:[0,.65556,0,0,.5],55:[0,.65556,0,0,.5],56:[0,.65556,0,0,.5],57:[0,.65556,0,0,.5],58:[0,.44444,0,0,.27778],59:[.125,.44444,0,0,.27778],61:[-.13,.37,0,0,.77778],63:[0,.69444,0,0,.47222],64:[0,.69444,0,0,.66667],65:[0,.69444,0,0,.66667],66:[0,.69444,0,0,.66667],67:[0,.69444,0,0,.63889],68:[0,.69444,0,0,.72223],69:[0,.69444,0,0,.59722],70:[0,.69444,0,0,.56945],71:[0,.69444,0,0,.66667],72:[0,.69444,0,0,.70834],73:[0,.69444,0,0,.27778],74:[0,.69444,0,0,.47222],75:[0,.69444,0,0,.69445],76:[0,.69444,0,0,.54167],77:[0,.69444,0,0,.875],78:[0,.69444,0,0,.70834],79:[0,.69444,0,0,.73611],80:[0,.69444,0,0,.63889],81:[.125,.69444,0,0,.73611],82:[0,.69444,0,0,.64584],83:[0,.69444,0,0,.55556],84:[0,.69444,0,0,.68056],85:[0,.69444,0,0,.6875],86:[0,.69444,.01389,0,.66667],87:[0,.69444,.01389,0,.94445],88:[0,.69444,0,0,.66667],89:[0,.69444,.025,0,.66667],90:[0,.69444,0,0,.61111],91:[.25,.75,0,0,.28889],93:[.25,.75,0,0,.28889],94:[0,.69444,0,0,.5],95:[.35,.09444,.02778,0,.5],97:[0,.44444,0,0,.48056],98:[0,.69444,0,0,.51667],99:[0,.44444,0,0,.44445],100:[0,.69444,0,0,.51667],101:[0,.44444,0,0,.44445],102:[0,.69444,.06944,0,.30556],103:[.19444,.44444,.01389,0,.5],104:[0,.69444,0,0,.51667],105:[0,.67937,0,0,.23889],106:[.19444,.67937,0,0,.26667],107:[0,.69444,0,0,.48889],108:[0,.69444,0,0,.23889],109:[0,.44444,0,0,.79445],110:[0,.44444,0,0,.51667],111:[0,.44444,0,0,.5],112:[.19444,.44444,0,0,.51667],113:[.19444,.44444,0,0,.51667],114:[0,.44444,.01389,0,.34167],115:[0,.44444,0,0,.38333],116:[0,.57143,0,0,.36111],117:[0,.44444,0,0,.51667],118:[0,.44444,.01389,0,.46111],119:[0,.44444,.01389,0,.68334],120:[0,.44444,0,0,.46111],121:[.19444,.44444,.01389,0,.46111],122:[0,.44444,0,0,.43472],126:[.35,.32659,0,0,.5],160:[0,0,0,0,.25],168:[0,.67937,0,0,.5],176:[0,.69444,0,0,.66667],184:[.17014,0,0,0,.44445],305:[0,.44444,0,0,.23889],567:[.19444,.44444,0,0,.26667],710:[0,.69444,0,0,.5],711:[0,.63194,0,0,.5],713:[0,.60889,0,0,.5],714:[0,.69444,0,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,0,0,.5],729:[0,.67937,0,0,.27778],730:[0,.69444,0,0,.66667],732:[0,.67659,0,0,.5],733:[0,.69444,0,0,.5],915:[0,.69444,0,0,.54167],916:[0,.69444,0,0,.83334],920:[0,.69444,0,0,.77778],923:[0,.69444,0,0,.61111],926:[0,.69444,0,0,.66667],928:[0,.69444,0,0,.70834],931:[0,.69444,0,0,.72222],933:[0,.69444,0,0,.77778],934:[0,.69444,0,0,.72222],936:[0,.69444,0,0,.77778],937:[0,.69444,0,0,.72222],8211:[0,.44444,.02778,0,.5],8212:[0,.44444,.02778,0,1],8216:[0,.69444,0,0,.27778],8217:[0,.69444,0,0,.27778],8220:[0,.69444,0,0,.5],8221:[0,.69444,0,0,.5]},"Script-Regular":{32:[0,0,0,0,.25],65:[0,.7,.22925,0,.80253],66:[0,.7,.04087,0,.90757],67:[0,.7,.1689,0,.66619],68:[0,.7,.09371,0,.77443],69:[0,.7,.18583,0,.56162],70:[0,.7,.13634,0,.89544],71:[0,.7,.17322,0,.60961],72:[0,.7,.29694,0,.96919],73:[0,.7,.19189,0,.80907],74:[.27778,.7,.19189,0,1.05159],75:[0,.7,.31259,0,.91364],76:[0,.7,.19189,0,.87373],77:[0,.7,.15981,0,1.08031],78:[0,.7,.3525,0,.9015],79:[0,.7,.08078,0,.73787],80:[0,.7,.08078,0,1.01262],81:[0,.7,.03305,0,.88282],82:[0,.7,.06259,0,.85],83:[0,.7,.19189,0,.86767],84:[0,.7,.29087,0,.74697],85:[0,.7,.25815,0,.79996],86:[0,.7,.27523,0,.62204],87:[0,.7,.27523,0,.80532],88:[0,.7,.26006,0,.94445],89:[0,.7,.2939,0,.70961],90:[0,.7,.24037,0,.8212],160:[0,0,0,0,.25]},"Size1-Regular":{32:[0,0,0,0,.25],40:[.35001,.85,0,0,.45834],41:[.35001,.85,0,0,.45834],47:[.35001,.85,0,0,.57778],91:[.35001,.85,0,0,.41667],92:[.35001,.85,0,0,.57778],93:[.35001,.85,0,0,.41667],123:[.35001,.85,0,0,.58334],125:[.35001,.85,0,0,.58334],160:[0,0,0,0,.25],710:[0,.72222,0,0,.55556],732:[0,.72222,0,0,.55556],770:[0,.72222,0,0,.55556],771:[0,.72222,0,0,.55556],8214:[-99e-5,.601,0,0,.77778],8593:[1e-5,.6,0,0,.66667],8595:[1e-5,.6,0,0,.66667],8657:[1e-5,.6,0,0,.77778],8659:[1e-5,.6,0,0,.77778],8719:[.25001,.75,0,0,.94445],8720:[.25001,.75,0,0,.94445],8721:[.25001,.75,0,0,1.05556],8730:[.35001,.85,0,0,1],8739:[-.00599,.606,0,0,.33333],8741:[-.00599,.606,0,0,.55556],8747:[.30612,.805,.19445,0,.47222],8748:[.306,.805,.19445,0,.47222],8749:[.306,.805,.19445,0,.47222],8750:[.30612,.805,.19445,0,.47222],8896:[.25001,.75,0,0,.83334],8897:[.25001,.75,0,0,.83334],8898:[.25001,.75,0,0,.83334],8899:[.25001,.75,0,0,.83334],8968:[.35001,.85,0,0,.47222],8969:[.35001,.85,0,0,.47222],8970:[.35001,.85,0,0,.47222],8971:[.35001,.85,0,0,.47222],9168:[-99e-5,.601,0,0,.66667],10216:[.35001,.85,0,0,.47222],10217:[.35001,.85,0,0,.47222],10752:[.25001,.75,0,0,1.11111],10753:[.25001,.75,0,0,1.11111],10754:[.25001,.75,0,0,1.11111],10756:[.25001,.75,0,0,.83334],10758:[.25001,.75,0,0,.83334]},"Size2-Regular":{32:[0,0,0,0,.25],40:[.65002,1.15,0,0,.59722],41:[.65002,1.15,0,0,.59722],47:[.65002,1.15,0,0,.81111],91:[.65002,1.15,0,0,.47222],92:[.65002,1.15,0,0,.81111],93:[.65002,1.15,0,0,.47222],123:[.65002,1.15,0,0,.66667],125:[.65002,1.15,0,0,.66667],160:[0,0,0,0,.25],710:[0,.75,0,0,1],732:[0,.75,0,0,1],770:[0,.75,0,0,1],771:[0,.75,0,0,1],8719:[.55001,1.05,0,0,1.27778],8720:[.55001,1.05,0,0,1.27778],8721:[.55001,1.05,0,0,1.44445],8730:[.65002,1.15,0,0,1],8747:[.86225,1.36,.44445,0,.55556],8748:[.862,1.36,.44445,0,.55556],8749:[.862,1.36,.44445,0,.55556],8750:[.86225,1.36,.44445,0,.55556],8896:[.55001,1.05,0,0,1.11111],8897:[.55001,1.05,0,0,1.11111],8898:[.55001,1.05,0,0,1.11111],8899:[.55001,1.05,0,0,1.11111],8968:[.65002,1.15,0,0,.52778],8969:[.65002,1.15,0,0,.52778],8970:[.65002,1.15,0,0,.52778],8971:[.65002,1.15,0,0,.52778],10216:[.65002,1.15,0,0,.61111],10217:[.65002,1.15,0,0,.61111],10752:[.55001,1.05,0,0,1.51112],10753:[.55001,1.05,0,0,1.51112],10754:[.55001,1.05,0,0,1.51112],10756:[.55001,1.05,0,0,1.11111],10758:[.55001,1.05,0,0,1.11111]},"Size3-Regular":{32:[0,0,0,0,.25],40:[.95003,1.45,0,0,.73611],41:[.95003,1.45,0,0,.73611],47:[.95003,1.45,0,0,1.04445],91:[.95003,1.45,0,0,.52778],92:[.95003,1.45,0,0,1.04445],93:[.95003,1.45,0,0,.52778],123:[.95003,1.45,0,0,.75],125:[.95003,1.45,0,0,.75],160:[0,0,0,0,.25],710:[0,.75,0,0,1.44445],732:[0,.75,0,0,1.44445],770:[0,.75,0,0,1.44445],771:[0,.75,0,0,1.44445],8730:[.95003,1.45,0,0,1],8968:[.95003,1.45,0,0,.58334],8969:[.95003,1.45,0,0,.58334],8970:[.95003,1.45,0,0,.58334],8971:[.95003,1.45,0,0,.58334],10216:[.95003,1.45,0,0,.75],10217:[.95003,1.45,0,0,.75]},"Size4-Regular":{32:[0,0,0,0,.25],40:[1.25003,1.75,0,0,.79167],41:[1.25003,1.75,0,0,.79167],47:[1.25003,1.75,0,0,1.27778],91:[1.25003,1.75,0,0,.58334],92:[1.25003,1.75,0,0,1.27778],93:[1.25003,1.75,0,0,.58334],123:[1.25003,1.75,0,0,.80556],125:[1.25003,1.75,0,0,.80556],160:[0,0,0,0,.25],710:[0,.825,0,0,1.8889],732:[0,.825,0,0,1.8889],770:[0,.825,0,0,1.8889],771:[0,.825,0,0,1.8889],8730:[1.25003,1.75,0,0,1],8968:[1.25003,1.75,0,0,.63889],8969:[1.25003,1.75,0,0,.63889],8970:[1.25003,1.75,0,0,.63889],8971:[1.25003,1.75,0,0,.63889],9115:[.64502,1.155,0,0,.875],9116:[1e-5,.6,0,0,.875],9117:[.64502,1.155,0,0,.875],9118:[.64502,1.155,0,0,.875],9119:[1e-5,.6,0,0,.875],9120:[.64502,1.155,0,0,.875],9121:[.64502,1.155,0,0,.66667],9122:[-99e-5,.601,0,0,.66667],9123:[.64502,1.155,0,0,.66667],9124:[.64502,1.155,0,0,.66667],9125:[-99e-5,.601,0,0,.66667],9126:[.64502,1.155,0,0,.66667],9127:[1e-5,.9,0,0,.88889],9128:[.65002,1.15,0,0,.88889],9129:[.90001,0,0,0,.88889],9130:[0,.3,0,0,.88889],9131:[1e-5,.9,0,0,.88889],9132:[.65002,1.15,0,0,.88889],9133:[.90001,0,0,0,.88889],9143:[.88502,.915,0,0,1.05556],10216:[1.25003,1.75,0,0,.80556],10217:[1.25003,1.75,0,0,.80556],57344:[-.00499,.605,0,0,1.05556],57345:[-.00499,.605,0,0,1.05556],57680:[0,.12,0,0,.45],57681:[0,.12,0,0,.45],57682:[0,.12,0,0,.45],57683:[0,.12,0,0,.45]},"Typewriter-Regular":{32:[0,0,0,0,.525],33:[0,.61111,0,0,.525],34:[0,.61111,0,0,.525],35:[0,.61111,0,0,.525],36:[.08333,.69444,0,0,.525],37:[.08333,.69444,0,0,.525],38:[0,.61111,0,0,.525],39:[0,.61111,0,0,.525],40:[.08333,.69444,0,0,.525],41:[.08333,.69444,0,0,.525],42:[0,.52083,0,0,.525],43:[-.08056,.53055,0,0,.525],44:[.13889,.125,0,0,.525],45:[-.08056,.53055,0,0,.525],46:[0,.125,0,0,.525],47:[.08333,.69444,0,0,.525],48:[0,.61111,0,0,.525],49:[0,.61111,0,0,.525],50:[0,.61111,0,0,.525],51:[0,.61111,0,0,.525],52:[0,.61111,0,0,.525],53:[0,.61111,0,0,.525],54:[0,.61111,0,0,.525],55:[0,.61111,0,0,.525],56:[0,.61111,0,0,.525],57:[0,.61111,0,0,.525],58:[0,.43056,0,0,.525],59:[.13889,.43056,0,0,.525],60:[-.05556,.55556,0,0,.525],61:[-.19549,.41562,0,0,.525],62:[-.05556,.55556,0,0,.525],63:[0,.61111,0,0,.525],64:[0,.61111,0,0,.525],65:[0,.61111,0,0,.525],66:[0,.61111,0,0,.525],67:[0,.61111,0,0,.525],68:[0,.61111,0,0,.525],69:[0,.61111,0,0,.525],70:[0,.61111,0,0,.525],71:[0,.61111,0,0,.525],72:[0,.61111,0,0,.525],73:[0,.61111,0,0,.525],74:[0,.61111,0,0,.525],75:[0,.61111,0,0,.525],76:[0,.61111,0,0,.525],77:[0,.61111,0,0,.525],78:[0,.61111,0,0,.525],79:[0,.61111,0,0,.525],80:[0,.61111,0,0,.525],81:[.13889,.61111,0,0,.525],82:[0,.61111,0,0,.525],83:[0,.61111,0,0,.525],84:[0,.61111,0,0,.525],85:[0,.61111,0,0,.525],86:[0,.61111,0,0,.525],87:[0,.61111,0,0,.525],88:[0,.61111,0,0,.525],89:[0,.61111,0,0,.525],90:[0,.61111,0,0,.525],91:[.08333,.69444,0,0,.525],92:[.08333,.69444,0,0,.525],93:[.08333,.69444,0,0,.525],94:[0,.61111,0,0,.525],95:[.09514,0,0,0,.525],96:[0,.61111,0,0,.525],97:[0,.43056,0,0,.525],98:[0,.61111,0,0,.525],99:[0,.43056,0,0,.525],100:[0,.61111,0,0,.525],101:[0,.43056,0,0,.525],102:[0,.61111,0,0,.525],103:[.22222,.43056,0,0,.525],104:[0,.61111,0,0,.525],105:[0,.61111,0,0,.525],106:[.22222,.61111,0,0,.525],107:[0,.61111,0,0,.525],108:[0,.61111,0,0,.525],109:[0,.43056,0,0,.525],110:[0,.43056,0,0,.525],111:[0,.43056,0,0,.525],112:[.22222,.43056,0,0,.525],113:[.22222,.43056,0,0,.525],114:[0,.43056,0,0,.525],115:[0,.43056,0,0,.525],116:[0,.55358,0,0,.525],117:[0,.43056,0,0,.525],118:[0,.43056,0,0,.525],119:[0,.43056,0,0,.525],120:[0,.43056,0,0,.525],121:[.22222,.43056,0,0,.525],122:[0,.43056,0,0,.525],123:[.08333,.69444,0,0,.525],124:[.08333,.69444,0,0,.525],125:[.08333,.69444,0,0,.525],126:[0,.61111,0,0,.525],127:[0,.61111,0,0,.525],160:[0,0,0,0,.525],176:[0,.61111,0,0,.525],184:[.19445,0,0,0,.525],305:[0,.43056,0,0,.525],567:[.22222,.43056,0,0,.525],711:[0,.56597,0,0,.525],713:[0,.56555,0,0,.525],714:[0,.61111,0,0,.525],715:[0,.61111,0,0,.525],728:[0,.61111,0,0,.525],730:[0,.61111,0,0,.525],770:[0,.61111,0,0,.525],771:[0,.61111,0,0,.525],776:[0,.61111,0,0,.525],915:[0,.61111,0,0,.525],916:[0,.61111,0,0,.525],920:[0,.61111,0,0,.525],923:[0,.61111,0,0,.525],926:[0,.61111,0,0,.525],928:[0,.61111,0,0,.525],931:[0,.61111,0,0,.525],933:[0,.61111,0,0,.525],934:[0,.61111,0,0,.525],936:[0,.61111,0,0,.525],937:[0,.61111,0,0,.525],8216:[0,.61111,0,0,.525],8217:[0,.61111,0,0,.525],8242:[0,.61111,0,0,.525],9251:[.11111,.21944,0,0,.525]}},wO={slant:[.25,.25,.25],space:[0,0,0],stretch:[0,0,0],shrink:[0,0,0],xHeight:[.431,.431,.431],quad:[1,1.171,1.472],extraSpace:[0,0,0],num1:[.677,.732,.925],num2:[.394,.384,.387],num3:[.444,.471,.504],denom1:[.686,.752,1.025],denom2:[.345,.344,.532],sup1:[.413,.503,.504],sup2:[.363,.431,.404],sup3:[.289,.286,.294],sub1:[.15,.143,.2],sub2:[.247,.286,.4],supDrop:[.386,.353,.494],subDrop:[.05,.071,.1],delim1:[2.39,1.7,1.98],delim2:[1.01,1.157,1.42],axisHeight:[.25,.25,.25],defaultRuleThickness:[.04,.049,.049],bigOpSpacing1:[.111,.111,.111],bigOpSpacing2:[.166,.166,.166],bigOpSpacing3:[.2,.2,.2],bigOpSpacing4:[.6,.611,.611],bigOpSpacing5:[.1,.143,.143],sqrtRuleThickness:[.04,.04,.04],ptPerEm:[10,10,10],doubleRuleSep:[.2,.2,.2],arrayRuleWidth:[.04,.04,.04],fboxsep:[.3,.3,.3],fboxrule:[.04,.04,.04]},TO={Å:`A`,Ð:`D`,Þ:`o`,å:`a`,ð:`d`,þ:`o`,А:`A`,Б:`B`,В:`B`,Г:`F`,Д:`A`,Е:`E`,Ж:`K`,З:`3`,И:`N`,Й:`N`,К:`K`,Л:`N`,М:`M`,Н:`H`,О:`O`,П:`N`,Р:`P`,С:`C`,Т:`T`,У:`y`,Ф:`O`,Х:`X`,Ц:`U`,Ч:`h`,Ш:`W`,Щ:`W`,Ъ:`B`,Ы:`X`,Ь:`B`,Э:`3`,Ю:`X`,Я:`R`,а:`a`,б:`b`,в:`a`,г:`r`,д:`y`,е:`e`,ж:`m`,з:`e`,и:`n`,й:`n`,к:`n`,л:`n`,м:`m`,н:`n`,о:`o`,п:`n`,р:`p`,с:`c`,т:`o`,у:`y`,ф:`b`,х:`x`,ц:`n`,ч:`n`,ш:`w`,щ:`w`,ъ:`a`,ы:`m`,ь:`a`,э:`e`,ю:`m`,я:`r`};function EO(e,t){CO[e]=t}function DO(e,t,n){if(!CO[t])throw Error(`Font metrics not found for font: `+t+`.`);var r=e.charCodeAt(0),i=CO[t][r];if(!i&&e[0]in TO&&(r=TO[e[0]].charCodeAt(0),i=CO[t][r]),!i&&n===`text`&&BD(r)&&(i=CO[t][77]),i)return{depth:i[0],height:i[1],italic:i[2],skew:i[3],width:i[4]}}var OO={};function kO(e){var t=e>=5?0:e>=3?1:2;if(!OO[t]){var n=OO[t]={cssEmPerMu:wO.quad[t]/18};for(var r of Object.keys(wO))n[r]=wO[r][t]}return OO[t]}var AO={math:{},text:{}};function H(e,t,n,r,i,a){AO[e][i]={font:t,group:n,replace:r},a&&r&&(AO[e][r]=AO[e][i])}var U=`math`,W=`text`,G=`main`,K=`ams`,jO=`accent-token`,q=`bin`,MO=`close`,NO=`inner`,PO=`mathord`,FO=`op-token`,IO=`open`,LO=`punct`,J=`rel`,RO=`spacing`,Y=`textord`;H(U,G,J,`≡`,`\\equiv`,!0),H(U,G,J,`≺`,`\\prec`,!0),H(U,G,J,`≻`,`\\succ`,!0),H(U,G,J,`∼`,`\\sim`,!0),H(U,G,J,`⊥`,`\\perp`),H(U,G,J,`⪯`,`\\preceq`,!0),H(U,G,J,`⪰`,`\\succeq`,!0),H(U,G,J,`≃`,`\\simeq`,!0),H(U,G,J,`∣`,`\\mid`,!0),H(U,G,J,`≪`,`\\ll`,!0),H(U,G,J,`≫`,`\\gg`,!0),H(U,G,J,`≍`,`\\asymp`,!0),H(U,G,J,`∥`,`\\parallel`),H(U,G,J,`⋈`,`\\bowtie`,!0),H(U,G,J,`⌣`,`\\smile`,!0),H(U,G,J,`⊑`,`\\sqsubseteq`,!0),H(U,G,J,`⊒`,`\\sqsupseteq`,!0),H(U,G,J,`≐`,`\\doteq`,!0),H(U,G,J,`⌢`,`\\frown`,!0),H(U,G,J,`∋`,`\\ni`,!0),H(U,G,J,`∝`,`\\propto`,!0),H(U,G,J,`⊢`,`\\vdash`,!0),H(U,G,J,`⊣`,`\\dashv`,!0),H(U,G,J,`∋`,`\\owns`),H(U,G,LO,`.`,`\\ldotp`),H(U,G,LO,`⋅`,`\\cdotp`),H(U,G,LO,`⋅`,`·`),H(W,G,Y,`⋅`,`·`),H(U,G,Y,`#`,`\\#`),H(W,G,Y,`#`,`\\#`),H(U,G,Y,`&`,`\\&`),H(W,G,Y,`&`,`\\&`),H(U,G,Y,`ℵ`,`\\aleph`,!0),H(U,G,Y,`∀`,`\\forall`,!0),H(U,G,Y,`ℏ`,`\\hbar`,!0),H(U,G,Y,`∃`,`\\exists`,!0),H(U,G,Y,`∇`,`\\nabla`,!0),H(U,G,Y,`♭`,`\\flat`,!0),H(U,G,Y,`ℓ`,`\\ell`,!0),H(U,G,Y,`♮`,`\\natural`,!0),H(U,G,Y,`♣`,`\\clubsuit`,!0),H(U,G,Y,`℘`,`\\wp`,!0),H(U,G,Y,`♯`,`\\sharp`,!0),H(U,G,Y,`♢`,`\\diamondsuit`,!0),H(U,G,Y,`ℜ`,`\\Re`,!0),H(U,G,Y,`♡`,`\\heartsuit`,!0),H(U,G,Y,`ℑ`,`\\Im`,!0),H(U,G,Y,`♠`,`\\spadesuit`,!0),H(U,G,Y,`§`,`\\S`,!0),H(W,G,Y,`§`,`\\S`),H(U,G,Y,`¶`,`\\P`,!0),H(W,G,Y,`¶`,`\\P`),H(U,G,Y,`†`,`\\dag`),H(W,G,Y,`†`,`\\dag`),H(W,G,Y,`†`,`\\textdagger`),H(U,G,Y,`‡`,`\\ddag`),H(W,G,Y,`‡`,`\\ddag`),H(W,G,Y,`‡`,`\\textdaggerdbl`),H(U,G,MO,`⎱`,`\\rmoustache`,!0),H(U,G,IO,`⎰`,`\\lmoustache`,!0),H(U,G,MO,`⟯`,`\\rgroup`,!0),H(U,G,IO,`⟮`,`\\lgroup`,!0),H(U,G,q,`∓`,`\\mp`,!0),H(U,G,q,`⊖`,`\\ominus`,!0),H(U,G,q,`⊎`,`\\uplus`,!0),H(U,G,q,`⊓`,`\\sqcap`,!0),H(U,G,q,`∗`,`\\ast`),H(U,G,q,`⊔`,`\\sqcup`,!0),H(U,G,q,`◯`,`\\bigcirc`,!0),H(U,G,q,`∙`,`\\bullet`,!0),H(U,G,q,`‡`,`\\ddagger`),H(U,G,q,`≀`,`\\wr`,!0),H(U,G,q,`⨿`,`\\amalg`),H(U,G,q,`&`,`\\And`),H(U,G,J,`⟵`,`\\longleftarrow`,!0),H(U,G,J,`⇐`,`\\Leftarrow`,!0),H(U,G,J,`⟸`,`\\Longleftarrow`,!0),H(U,G,J,`⟶`,`\\longrightarrow`,!0),H(U,G,J,`⇒`,`\\Rightarrow`,!0),H(U,G,J,`⟹`,`\\Longrightarrow`,!0),H(U,G,J,`↔`,`\\leftrightarrow`,!0),H(U,G,J,`⟷`,`\\longleftrightarrow`,!0),H(U,G,J,`⇔`,`\\Leftrightarrow`,!0),H(U,G,J,`⟺`,`\\Longleftrightarrow`,!0),H(U,G,J,`↦`,`\\mapsto`,!0),H(U,G,J,`⟼`,`\\longmapsto`,!0),H(U,G,J,`↗`,`\\nearrow`,!0),H(U,G,J,`↩`,`\\hookleftarrow`,!0),H(U,G,J,`↪`,`\\hookrightarrow`,!0),H(U,G,J,`↘`,`\\searrow`,!0),H(U,G,J,`↼`,`\\leftharpoonup`,!0),H(U,G,J,`⇀`,`\\rightharpoonup`,!0),H(U,G,J,`↙`,`\\swarrow`,!0),H(U,G,J,`↽`,`\\leftharpoondown`,!0),H(U,G,J,`⇁`,`\\rightharpoondown`,!0),H(U,G,J,`↖`,`\\nwarrow`,!0),H(U,G,J,`⇌`,`\\rightleftharpoons`,!0),H(U,K,J,`≮`,`\\nless`,!0),H(U,K,J,``,`\\@nleqslant`),H(U,K,J,``,`\\@nleqq`),H(U,K,J,`⪇`,`\\lneq`,!0),H(U,K,J,`≨`,`\\lneqq`,!0),H(U,K,J,``,`\\@lvertneqq`),H(U,K,J,`⋦`,`\\lnsim`,!0),H(U,K,J,`⪉`,`\\lnapprox`,!0),H(U,K,J,`⊀`,`\\nprec`,!0),H(U,K,J,`⋠`,`\\npreceq`,!0),H(U,K,J,`⋨`,`\\precnsim`,!0),H(U,K,J,`⪹`,`\\precnapprox`,!0),H(U,K,J,`≁`,`\\nsim`,!0),H(U,K,J,``,`\\@nshortmid`),H(U,K,J,`∤`,`\\nmid`,!0),H(U,K,J,`⊬`,`\\nvdash`,!0),H(U,K,J,`⊭`,`\\nvDash`,!0),H(U,K,J,`⋪`,`\\ntriangleleft`),H(U,K,J,`⋬`,`\\ntrianglelefteq`,!0),H(U,K,J,`⊊`,`\\subsetneq`,!0),H(U,K,J,``,`\\@varsubsetneq`),H(U,K,J,`⫋`,`\\subsetneqq`,!0),H(U,K,J,``,`\\@varsubsetneqq`),H(U,K,J,`≯`,`\\ngtr`,!0),H(U,K,J,``,`\\@ngeqslant`),H(U,K,J,``,`\\@ngeqq`),H(U,K,J,`⪈`,`\\gneq`,!0),H(U,K,J,`≩`,`\\gneqq`,!0),H(U,K,J,``,`\\@gvertneqq`),H(U,K,J,`⋧`,`\\gnsim`,!0),H(U,K,J,`⪊`,`\\gnapprox`,!0),H(U,K,J,`⊁`,`\\nsucc`,!0),H(U,K,J,`⋡`,`\\nsucceq`,!0),H(U,K,J,`⋩`,`\\succnsim`,!0),H(U,K,J,`⪺`,`\\succnapprox`,!0),H(U,K,J,`≆`,`\\ncong`,!0),H(U,K,J,``,`\\@nshortparallel`),H(U,K,J,`∦`,`\\nparallel`,!0),H(U,K,J,`⊯`,`\\nVDash`,!0),H(U,K,J,`⋫`,`\\ntriangleright`),H(U,K,J,`⋭`,`\\ntrianglerighteq`,!0),H(U,K,J,``,`\\@nsupseteqq`),H(U,K,J,`⊋`,`\\supsetneq`,!0),H(U,K,J,``,`\\@varsupsetneq`),H(U,K,J,`⫌`,`\\supsetneqq`,!0),H(U,K,J,``,`\\@varsupsetneqq`),H(U,K,J,`⊮`,`\\nVdash`,!0),H(U,K,J,`⪵`,`\\precneqq`,!0),H(U,K,J,`⪶`,`\\succneqq`,!0),H(U,K,J,``,`\\@nsubseteqq`),H(U,K,q,`⊴`,`\\unlhd`),H(U,K,q,`⊵`,`\\unrhd`),H(U,K,J,`↚`,`\\nleftarrow`,!0),H(U,K,J,`↛`,`\\nrightarrow`,!0),H(U,K,J,`⇍`,`\\nLeftarrow`,!0),H(U,K,J,`⇏`,`\\nRightarrow`,!0),H(U,K,J,`↮`,`\\nleftrightarrow`,!0),H(U,K,J,`⇎`,`\\nLeftrightarrow`,!0),H(U,K,J,`△`,`\\vartriangle`),H(U,K,Y,`ℏ`,`\\hslash`),H(U,K,Y,`▽`,`\\triangledown`),H(U,K,Y,`◊`,`\\lozenge`),H(U,K,Y,`Ⓢ`,`\\circledS`),H(U,K,Y,`®`,`\\circledR`),H(W,K,Y,`®`,`\\circledR`),H(U,K,Y,`∡`,`\\measuredangle`,!0),H(U,K,Y,`∄`,`\\nexists`),H(U,K,Y,`℧`,`\\mho`),H(U,K,Y,`Ⅎ`,`\\Finv`,!0),H(U,K,Y,`⅁`,`\\Game`,!0),H(U,K,Y,`‵`,`\\backprime`),H(U,K,Y,`▲`,`\\blacktriangle`),H(U,K,Y,`▼`,`\\blacktriangledown`),H(U,K,Y,`■`,`\\blacksquare`),H(U,K,Y,`⧫`,`\\blacklozenge`),H(U,K,Y,`★`,`\\bigstar`),H(U,K,Y,`∢`,`\\sphericalangle`,!0),H(U,K,Y,`∁`,`\\complement`,!0),H(U,K,Y,`ð`,`\\eth`,!0),H(W,G,Y,`ð`,`ð`),H(U,K,Y,`╱`,`\\diagup`),H(U,K,Y,`╲`,`\\diagdown`),H(U,K,Y,`□`,`\\square`),H(U,K,Y,`□`,`\\Box`),H(U,K,Y,`◊`,`\\Diamond`),H(U,K,Y,`¥`,`\\yen`,!0),H(W,K,Y,`¥`,`\\yen`,!0),H(U,K,Y,`✓`,`\\checkmark`,!0),H(W,K,Y,`✓`,`\\checkmark`),H(U,K,Y,`ℶ`,`\\beth`,!0),H(U,K,Y,`ℸ`,`\\daleth`,!0),H(U,K,Y,`ℷ`,`\\gimel`,!0),H(U,K,Y,`ϝ`,`\\digamma`,!0),H(U,K,Y,`ϰ`,`\\varkappa`),H(U,K,IO,`┌`,`\\@ulcorner`,!0),H(U,K,MO,`┐`,`\\@urcorner`,!0),H(U,K,IO,`└`,`\\@llcorner`,!0),H(U,K,MO,`┘`,`\\@lrcorner`,!0),H(U,K,J,`≦`,`\\leqq`,!0),H(U,K,J,`⩽`,`\\leqslant`,!0),H(U,K,J,`⪕`,`\\eqslantless`,!0),H(U,K,J,`≲`,`\\lesssim`,!0),H(U,K,J,`⪅`,`\\lessapprox`,!0),H(U,K,J,`≊`,`\\approxeq`,!0),H(U,K,q,`⋖`,`\\lessdot`),H(U,K,J,`⋘`,`\\lll`,!0),H(U,K,J,`≶`,`\\lessgtr`,!0),H(U,K,J,`⋚`,`\\lesseqgtr`,!0),H(U,K,J,`⪋`,`\\lesseqqgtr`,!0),H(U,K,J,`≑`,`\\doteqdot`),H(U,K,J,`≓`,`\\risingdotseq`,!0),H(U,K,J,`≒`,`\\fallingdotseq`,!0),H(U,K,J,`∽`,`\\backsim`,!0),H(U,K,J,`⋍`,`\\backsimeq`,!0),H(U,K,J,`⫅`,`\\subseteqq`,!0),H(U,K,J,`⋐`,`\\Subset`,!0),H(U,K,J,`⊏`,`\\sqsubset`,!0),H(U,K,J,`≼`,`\\preccurlyeq`,!0),H(U,K,J,`⋞`,`\\curlyeqprec`,!0),H(U,K,J,`≾`,`\\precsim`,!0),H(U,K,J,`⪷`,`\\precapprox`,!0),H(U,K,J,`⊲`,`\\vartriangleleft`),H(U,K,J,`⊴`,`\\trianglelefteq`),H(U,K,J,`⊨`,`\\vDash`,!0),H(U,K,J,`⊪`,`\\Vvdash`,!0),H(U,K,J,`⌣`,`\\smallsmile`),H(U,K,J,`⌢`,`\\smallfrown`),H(U,K,J,`≏`,`\\bumpeq`,!0),H(U,K,J,`≎`,`\\Bumpeq`,!0),H(U,K,J,`≧`,`\\geqq`,!0),H(U,K,J,`⩾`,`\\geqslant`,!0),H(U,K,J,`⪖`,`\\eqslantgtr`,!0),H(U,K,J,`≳`,`\\gtrsim`,!0),H(U,K,J,`⪆`,`\\gtrapprox`,!0),H(U,K,q,`⋗`,`\\gtrdot`),H(U,K,J,`⋙`,`\\ggg`,!0),H(U,K,J,`≷`,`\\gtrless`,!0),H(U,K,J,`⋛`,`\\gtreqless`,!0),H(U,K,J,`⪌`,`\\gtreqqless`,!0),H(U,K,J,`≖`,`\\eqcirc`,!0),H(U,K,J,`≗`,`\\circeq`,!0),H(U,K,J,`≜`,`\\triangleq`,!0),H(U,K,J,`∼`,`\\thicksim`),H(U,K,J,`≈`,`\\thickapprox`),H(U,K,J,`⫆`,`\\supseteqq`,!0),H(U,K,J,`⋑`,`\\Supset`,!0),H(U,K,J,`⊐`,`\\sqsupset`,!0),H(U,K,J,`≽`,`\\succcurlyeq`,!0),H(U,K,J,`⋟`,`\\curlyeqsucc`,!0),H(U,K,J,`≿`,`\\succsim`,!0),H(U,K,J,`⪸`,`\\succapprox`,!0),H(U,K,J,`⊳`,`\\vartriangleright`),H(U,K,J,`⊵`,`\\trianglerighteq`),H(U,K,J,`⊩`,`\\Vdash`,!0),H(U,K,J,`∣`,`\\shortmid`),H(U,K,J,`∥`,`\\shortparallel`),H(U,K,J,`≬`,`\\between`,!0),H(U,K,J,`⋔`,`\\pitchfork`,!0),H(U,K,J,`∝`,`\\varpropto`),H(U,K,J,`◀`,`\\blacktriangleleft`),H(U,K,J,`∴`,`\\therefore`,!0),H(U,K,J,`∍`,`\\backepsilon`),H(U,K,J,`▶`,`\\blacktriangleright`),H(U,K,J,`∵`,`\\because`,!0),H(U,K,J,`⋘`,`\\llless`),H(U,K,J,`⋙`,`\\gggtr`),H(U,K,q,`⊲`,`\\lhd`),H(U,K,q,`⊳`,`\\rhd`),H(U,K,J,`≂`,`\\eqsim`,!0),H(U,G,J,`⋈`,`\\Join`),H(U,K,J,`≑`,`\\Doteq`,!0),H(U,K,q,`∔`,`\\dotplus`,!0),H(U,K,q,`∖`,`\\smallsetminus`),H(U,K,q,`⋒`,`\\Cap`,!0),H(U,K,q,`⋓`,`\\Cup`,!0),H(U,K,q,`⩞`,`\\doublebarwedge`,!0),H(U,K,q,`⊟`,`\\boxminus`,!0),H(U,K,q,`⊞`,`\\boxplus`,!0),H(U,K,q,`⋇`,`\\divideontimes`,!0),H(U,K,q,`⋉`,`\\ltimes`,!0),H(U,K,q,`⋊`,`\\rtimes`,!0),H(U,K,q,`⋋`,`\\leftthreetimes`,!0),H(U,K,q,`⋌`,`\\rightthreetimes`,!0),H(U,K,q,`⋏`,`\\curlywedge`,!0),H(U,K,q,`⋎`,`\\curlyvee`,!0),H(U,K,q,`⊝`,`\\circleddash`,!0),H(U,K,q,`⊛`,`\\circledast`,!0),H(U,K,q,`⋅`,`\\centerdot`),H(U,K,q,`⊺`,`\\intercal`,!0),H(U,K,q,`⋒`,`\\doublecap`),H(U,K,q,`⋓`,`\\doublecup`),H(U,K,q,`⊠`,`\\boxtimes`,!0),H(U,K,J,`⇢`,`\\dashrightarrow`,!0),H(U,K,J,`⇠`,`\\dashleftarrow`,!0),H(U,K,J,`⇇`,`\\leftleftarrows`,!0),H(U,K,J,`⇆`,`\\leftrightarrows`,!0),H(U,K,J,`⇚`,`\\Lleftarrow`,!0),H(U,K,J,`↞`,`\\twoheadleftarrow`,!0),H(U,K,J,`↢`,`\\leftarrowtail`,!0),H(U,K,J,`↫`,`\\looparrowleft`,!0),H(U,K,J,`⇋`,`\\leftrightharpoons`,!0),H(U,K,J,`↶`,`\\curvearrowleft`,!0),H(U,K,J,`↺`,`\\circlearrowleft`,!0),H(U,K,J,`↰`,`\\Lsh`,!0),H(U,K,J,`⇈`,`\\upuparrows`,!0),H(U,K,J,`↿`,`\\upharpoonleft`,!0),H(U,K,J,`⇃`,`\\downharpoonleft`,!0),H(U,G,J,`⊶`,`\\origof`,!0),H(U,G,J,`⊷`,`\\imageof`,!0),H(U,K,J,`⊸`,`\\multimap`,!0),H(U,K,J,`↭`,`\\leftrightsquigarrow`,!0),H(U,K,J,`⇉`,`\\rightrightarrows`,!0),H(U,K,J,`⇄`,`\\rightleftarrows`,!0),H(U,K,J,`↠`,`\\twoheadrightarrow`,!0),H(U,K,J,`↣`,`\\rightarrowtail`,!0),H(U,K,J,`↬`,`\\looparrowright`,!0),H(U,K,J,`↷`,`\\curvearrowright`,!0),H(U,K,J,`↻`,`\\circlearrowright`,!0),H(U,K,J,`↱`,`\\Rsh`,!0),H(U,K,J,`⇊`,`\\downdownarrows`,!0),H(U,K,J,`↾`,`\\upharpoonright`,!0),H(U,K,J,`⇂`,`\\downharpoonright`,!0),H(U,K,J,`⇝`,`\\rightsquigarrow`,!0),H(U,K,J,`⇝`,`\\leadsto`),H(U,K,J,`⇛`,`\\Rrightarrow`,!0),H(U,K,J,`↾`,`\\restriction`),H(U,G,Y,`‘`,"`"),H(U,G,Y,`$`,`\\$`),H(W,G,Y,`$`,`\\$`),H(W,G,Y,`$`,`\\textdollar`),H(U,G,Y,`%`,`\\%`),H(W,G,Y,`%`,`\\%`),H(U,G,Y,`_`,`\\_`),H(W,G,Y,`_`,`\\_`),H(W,G,Y,`_`,`\\textunderscore`),H(U,G,Y,`∠`,`\\angle`,!0),H(U,G,Y,`∞`,`\\infty`,!0),H(U,G,Y,`′`,`\\prime`),H(U,G,Y,`△`,`\\triangle`),H(U,G,Y,`Γ`,`\\Gamma`,!0),H(U,G,Y,`Δ`,`\\Delta`,!0),H(U,G,Y,`Θ`,`\\Theta`,!0),H(U,G,Y,`Λ`,`\\Lambda`,!0),H(U,G,Y,`Ξ`,`\\Xi`,!0),H(U,G,Y,`Π`,`\\Pi`,!0),H(U,G,Y,`Σ`,`\\Sigma`,!0),H(U,G,Y,`Υ`,`\\Upsilon`,!0),H(U,G,Y,`Φ`,`\\Phi`,!0),H(U,G,Y,`Ψ`,`\\Psi`,!0),H(U,G,Y,`Ω`,`\\Omega`,!0),H(U,G,Y,`A`,`Α`),H(U,G,Y,`B`,`Β`),H(U,G,Y,`E`,`Ε`),H(U,G,Y,`Z`,`Ζ`),H(U,G,Y,`H`,`Η`),H(U,G,Y,`I`,`Ι`),H(U,G,Y,`K`,`Κ`),H(U,G,Y,`M`,`Μ`),H(U,G,Y,`N`,`Ν`),H(U,G,Y,`O`,`Ο`),H(U,G,Y,`P`,`Ρ`),H(U,G,Y,`T`,`Τ`),H(U,G,Y,`X`,`Χ`),H(U,G,Y,`¬`,`\\neg`,!0),H(U,G,Y,`¬`,`\\lnot`),H(U,G,Y,`⊤`,`\\top`),H(U,G,Y,`⊥`,`\\bot`),H(U,G,Y,`∅`,`\\emptyset`),H(U,K,Y,`∅`,`\\varnothing`),H(U,G,PO,`α`,`\\alpha`,!0),H(U,G,PO,`β`,`\\beta`,!0),H(U,G,PO,`γ`,`\\gamma`,!0),H(U,G,PO,`δ`,`\\delta`,!0),H(U,G,PO,`ϵ`,`\\epsilon`,!0),H(U,G,PO,`ζ`,`\\zeta`,!0),H(U,G,PO,`η`,`\\eta`,!0),H(U,G,PO,`θ`,`\\theta`,!0),H(U,G,PO,`ι`,`\\iota`,!0),H(U,G,PO,`κ`,`\\kappa`,!0),H(U,G,PO,`λ`,`\\lambda`,!0),H(U,G,PO,`μ`,`\\mu`,!0),H(U,G,PO,`ν`,`\\nu`,!0),H(U,G,PO,`ξ`,`\\xi`,!0),H(U,G,PO,`ο`,`\\omicron`,!0),H(U,G,PO,`π`,`\\pi`,!0),H(U,G,PO,`ρ`,`\\rho`,!0),H(U,G,PO,`σ`,`\\sigma`,!0),H(U,G,PO,`τ`,`\\tau`,!0),H(U,G,PO,`υ`,`\\upsilon`,!0),H(U,G,PO,`ϕ`,`\\phi`,!0),H(U,G,PO,`χ`,`\\chi`,!0),H(U,G,PO,`ψ`,`\\psi`,!0),H(U,G,PO,`ω`,`\\omega`,!0),H(U,G,PO,`ε`,`\\varepsilon`,!0),H(U,G,PO,`ϑ`,`\\vartheta`,!0),H(U,G,PO,`ϖ`,`\\varpi`,!0),H(U,G,PO,`ϱ`,`\\varrho`,!0),H(U,G,PO,`ς`,`\\varsigma`,!0),H(U,G,PO,`φ`,`\\varphi`,!0),H(U,G,q,`∗`,`*`,!0),H(U,G,q,`+`,`+`),H(U,G,q,`−`,`-`,!0),H(U,G,q,`⋅`,`\\cdot`,!0),H(U,G,q,`∘`,`\\circ`,!0),H(U,G,q,`÷`,`\\div`,!0),H(U,G,q,`±`,`\\pm`,!0),H(U,G,q,`×`,`\\times`,!0),H(U,G,q,`∩`,`\\cap`,!0),H(U,G,q,`∪`,`\\cup`,!0),H(U,G,q,`∖`,`\\setminus`,!0),H(U,G,q,`∧`,`\\land`),H(U,G,q,`∨`,`\\lor`),H(U,G,q,`∧`,`\\wedge`,!0),H(U,G,q,`∨`,`\\vee`,!0),H(U,G,Y,`√`,`\\surd`),H(U,G,IO,`⟨`,`\\langle`,!0),H(U,G,IO,`∣`,`\\lvert`),H(U,G,IO,`∥`,`\\lVert`),H(U,G,MO,`?`,`?`),H(U,G,MO,`!`,`!`),H(U,G,MO,`⟩`,`\\rangle`,!0),H(U,G,MO,`∣`,`\\rvert`),H(U,G,MO,`∥`,`\\rVert`),H(U,G,J,`=`,`=`),H(U,G,J,`:`,`:`),H(U,G,J,`≈`,`\\approx`,!0),H(U,G,J,`≅`,`\\cong`,!0),H(U,G,J,`≥`,`\\ge`),H(U,G,J,`≥`,`\\geq`,!0),H(U,G,J,`←`,`\\gets`),H(U,G,J,`>`,`\\gt`,!0),H(U,G,J,`∈`,`\\in`,!0),H(U,G,J,``,`\\@not`),H(U,G,J,`⊂`,`\\subset`,!0),H(U,G,J,`⊃`,`\\supset`,!0),H(U,G,J,`⊆`,`\\subseteq`,!0),H(U,G,J,`⊇`,`\\supseteq`,!0),H(U,K,J,`⊈`,`\\nsubseteq`,!0),H(U,K,J,`⊉`,`\\nsupseteq`,!0),H(U,G,J,`⊨`,`\\models`),H(U,G,J,`←`,`\\leftarrow`,!0),H(U,G,J,`≤`,`\\le`),H(U,G,J,`≤`,`\\leq`,!0),H(U,G,J,`<`,`\\lt`,!0),H(U,G,J,`→`,`\\rightarrow`,!0),H(U,G,J,`→`,`\\to`),H(U,K,J,`≱`,`\\ngeq`,!0),H(U,K,J,`≰`,`\\nleq`,!0),H(U,G,RO,`\xA0`,`\\ `),H(U,G,RO,`\xA0`,`\\space`),H(U,G,RO,`\xA0`,`\\nobreakspace`),H(W,G,RO,`\xA0`,`\\ `),H(W,G,RO,`\xA0`,` `),H(W,G,RO,`\xA0`,`\\space`),H(W,G,RO,`\xA0`,`\\nobreakspace`),H(U,G,RO,``,`\\nobreak`),H(U,G,RO,``,`\\allowbreak`),H(U,G,LO,`,`,`,`),H(U,G,LO,`;`,`;`),H(U,K,q,`⊼`,`\\barwedge`,!0),H(U,K,q,`⊻`,`\\veebar`,!0),H(U,G,q,`⊙`,`\\odot`,!0),H(U,G,q,`⊕`,`\\oplus`,!0),H(U,G,q,`⊗`,`\\otimes`,!0),H(U,G,Y,`∂`,`\\partial`,!0),H(U,G,q,`⊘`,`\\oslash`,!0),H(U,K,q,`⊚`,`\\circledcirc`,!0),H(U,K,q,`⊡`,`\\boxdot`,!0),H(U,G,q,`△`,`\\bigtriangleup`),H(U,G,q,`▽`,`\\bigtriangledown`),H(U,G,q,`†`,`\\dagger`),H(U,G,q,`⋄`,`\\diamond`),H(U,G,q,`⋆`,`\\star`),H(U,G,q,`◃`,`\\triangleleft`),H(U,G,q,`▹`,`\\triangleright`),H(U,G,IO,`{`,`\\{`),H(W,G,Y,`{`,`\\{`),H(W,G,Y,`{`,`\\textbraceleft`),H(U,G,MO,`}`,`\\}`),H(W,G,Y,`}`,`\\}`),H(W,G,Y,`}`,`\\textbraceright`),H(U,G,IO,`{`,`\\lbrace`),H(U,G,MO,`}`,`\\rbrace`),H(U,G,IO,`[`,`\\lbrack`,!0),H(W,G,Y,`[`,`\\lbrack`,!0),H(U,G,MO,`]`,`\\rbrack`,!0),H(W,G,Y,`]`,`\\rbrack`,!0),H(U,G,IO,`(`,`\\lparen`,!0),H(U,G,MO,`)`,`\\rparen`,!0),H(W,G,Y,`<`,`\\textless`,!0),H(W,G,Y,`>`,`\\textgreater`,!0),H(U,G,IO,`⌊`,`\\lfloor`,!0),H(U,G,MO,`⌋`,`\\rfloor`,!0),H(U,G,IO,`⌈`,`\\lceil`,!0),H(U,G,MO,`⌉`,`\\rceil`,!0),H(U,G,Y,`\\`,`\\backslash`),H(U,G,Y,`∣`,`|`),H(U,G,Y,`∣`,`\\vert`),H(W,G,Y,`|`,`\\textbar`,!0),H(U,G,Y,`∥`,`\\|`),H(U,G,Y,`∥`,`\\Vert`),H(W,G,Y,`∥`,`\\textbardbl`),H(W,G,Y,`~`,`\\textasciitilde`),H(W,G,Y,`\\`,`\\textbackslash`),H(W,G,Y,`^`,`\\textasciicircum`),H(U,G,J,`↑`,`\\uparrow`,!0),H(U,G,J,`⇑`,`\\Uparrow`,!0),H(U,G,J,`↓`,`\\downarrow`,!0),H(U,G,J,`⇓`,`\\Downarrow`,!0),H(U,G,J,`↕`,`\\updownarrow`,!0),H(U,G,J,`⇕`,`\\Updownarrow`,!0),H(U,G,FO,`∐`,`\\coprod`),H(U,G,FO,`⋁`,`\\bigvee`),H(U,G,FO,`⋀`,`\\bigwedge`),H(U,G,FO,`⨄`,`\\biguplus`),H(U,G,FO,`⋂`,`\\bigcap`),H(U,G,FO,`⋃`,`\\bigcup`),H(U,G,FO,`∫`,`\\int`),H(U,G,FO,`∫`,`\\intop`),H(U,G,FO,`∬`,`\\iint`),H(U,G,FO,`∭`,`\\iiint`),H(U,G,FO,`∏`,`\\prod`),H(U,G,FO,`∑`,`\\sum`),H(U,G,FO,`⨂`,`\\bigotimes`),H(U,G,FO,`⨁`,`\\bigoplus`),H(U,G,FO,`⨀`,`\\bigodot`),H(U,G,FO,`∮`,`\\oint`),H(U,G,FO,`∯`,`\\oiint`),H(U,G,FO,`∰`,`\\oiiint`),H(U,G,FO,`⨆`,`\\bigsqcup`),H(U,G,FO,`∫`,`\\smallint`),H(W,G,NO,`…`,`\\textellipsis`),H(U,G,NO,`…`,`\\mathellipsis`),H(W,G,NO,`…`,`\\ldots`,!0),H(U,G,NO,`…`,`\\ldots`,!0),H(U,G,NO,`⋯`,`\\@cdots`,!0),H(U,G,NO,`⋱`,`\\ddots`,!0),H(U,G,Y,`⋮`,`\\varvdots`),H(W,G,Y,`⋮`,`\\varvdots`),H(U,G,jO,`ˊ`,`\\acute`),H(U,G,jO,`ˋ`,`\\grave`),H(U,G,jO,`¨`,`\\ddot`),H(U,G,jO,`~`,`\\tilde`),H(U,G,jO,`ˉ`,`\\bar`),H(U,G,jO,`˘`,`\\breve`),H(U,G,jO,`ˇ`,`\\check`),H(U,G,jO,`^`,`\\hat`),H(U,G,jO,`⃗`,`\\vec`),H(U,G,jO,`˙`,`\\dot`),H(U,G,jO,`˚`,`\\mathring`),H(U,G,PO,``,`\\@imath`),H(U,G,PO,``,`\\@jmath`),H(U,G,Y,`ı`,`ı`),H(U,G,Y,`ȷ`,`ȷ`),H(W,G,Y,`ı`,`\\i`,!0),H(W,G,Y,`ȷ`,`\\j`,!0),H(W,G,Y,`ß`,`\\ss`,!0),H(W,G,Y,`æ`,`\\ae`,!0),H(W,G,Y,`œ`,`\\oe`,!0),H(W,G,Y,`ø`,`\\o`,!0),H(W,G,Y,`Æ`,`\\AE`,!0),H(W,G,Y,`Œ`,`\\OE`,!0),H(W,G,Y,`Ø`,`\\O`,!0),H(W,G,jO,`ˊ`,`\\'`),H(W,G,jO,`ˋ`,"\\`"),H(W,G,jO,`ˆ`,`\\^`),H(W,G,jO,`˜`,`\\~`),H(W,G,jO,`ˉ`,`\\=`),H(W,G,jO,`˘`,`\\u`),H(W,G,jO,`˙`,`\\.`),H(W,G,jO,`¸`,`\\c`),H(W,G,jO,`˚`,`\\r`),H(W,G,jO,`ˇ`,`\\v`),H(W,G,jO,`¨`,`\\"`),H(W,G,jO,`˝`,`\\H`),H(W,G,jO,`◯`,`\\textcircled`);var zO={"--":!0,"---":!0,"``":!0,"''":!0};H(W,G,Y,`–`,`--`,!0),H(W,G,Y,`–`,`\\textendash`),H(W,G,Y,`—`,`---`,!0),H(W,G,Y,`—`,`\\textemdash`),H(W,G,Y,`‘`,"`",!0),H(W,G,Y,`‘`,`\\textquoteleft`),H(W,G,Y,`’`,`'`,!0),H(W,G,Y,`’`,`\\textquoteright`),H(W,G,Y,`“`,"``",!0),H(W,G,Y,`“`,`\\textquotedblleft`),H(W,G,Y,`”`,`''`,!0),H(W,G,Y,`”`,`\\textquotedblright`),H(U,G,Y,`°`,`\\degree`,!0),H(W,G,Y,`°`,`\\degree`),H(W,G,Y,`°`,`\\textdegree`,!0),H(U,G,Y,`£`,`\\pounds`),H(U,G,Y,`£`,`\\mathsterling`,!0),H(W,G,Y,`£`,`\\pounds`),H(W,G,Y,`£`,`\\textsterling`,!0),H(U,K,Y,`✠`,`\\maltese`),H(W,K,Y,`✠`,`\\maltese`);for(var BO=`0123456789/@."`,VO=0;VO<BO.length;VO++){var HO=BO.charAt(VO);H(U,G,Y,HO,HO)}for(var UO=`0123456789!@*()-=+";:?/.,`,WO=0;WO<UO.length;WO++){var GO=UO.charAt(WO);H(W,G,Y,GO,GO)}for(var KO=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz`,qO=0;qO<KO.length;qO++){var JO=KO.charAt(qO);H(U,G,PO,JO,JO),H(W,G,Y,JO,JO)}H(U,K,Y,`C`,`ℂ`),H(W,K,Y,`C`,`ℂ`),H(U,K,Y,`H`,`ℍ`),H(W,K,Y,`H`,`ℍ`),H(U,K,Y,`N`,`ℕ`),H(W,K,Y,`N`,`ℕ`),H(U,K,Y,`P`,`ℙ`),H(W,K,Y,`P`,`ℙ`),H(U,K,Y,`Q`,`ℚ`),H(W,K,Y,`Q`,`ℚ`),H(U,K,Y,`R`,`ℝ`),H(W,K,Y,`R`,`ℝ`),H(U,K,Y,`Z`,`ℤ`),H(W,K,Y,`Z`,`ℤ`),H(U,G,PO,`h`,`ℎ`),H(W,G,PO,`h`,`ℎ`);for(var YO,XO=0;XO<KO.length;XO++){var ZO=KO.charAt(XO);YO=String.fromCharCode(55349,56320+XO),H(U,G,PO,ZO,YO),H(W,G,Y,ZO,YO),YO=String.fromCharCode(55349,56372+XO),H(U,G,PO,ZO,YO),H(W,G,Y,ZO,YO),YO=String.fromCharCode(55349,56424+XO),H(U,G,PO,ZO,YO),H(W,G,Y,ZO,YO),YO=String.fromCharCode(55349,56580+XO),H(U,G,PO,ZO,YO),H(W,G,Y,ZO,YO),YO=String.fromCharCode(55349,56684+XO),H(U,G,PO,ZO,YO),H(W,G,Y,ZO,YO),YO=String.fromCharCode(55349,56736+XO),H(U,G,PO,ZO,YO),H(W,G,Y,ZO,YO),YO=String.fromCharCode(55349,56788+XO),H(U,G,PO,ZO,YO),H(W,G,Y,ZO,YO),YO=String.fromCharCode(55349,56840+XO),H(U,G,PO,ZO,YO),H(W,G,Y,ZO,YO),YO=String.fromCharCode(55349,56944+XO),H(U,G,PO,ZO,YO),H(W,G,Y,ZO,YO),XO<26&&(YO=String.fromCharCode(55349,56632+XO),H(U,G,PO,ZO,YO),H(W,G,Y,ZO,YO),YO=String.fromCharCode(55349,56476+XO),H(U,G,PO,ZO,YO),H(W,G,Y,ZO,YO))}YO=String.fromCharCode(55349,56668),H(U,G,PO,`k`,YO),H(W,G,Y,`k`,YO);for(var QO=0;QO<10;QO++){var $O=QO.toString();YO=String.fromCharCode(55349,57294+QO),H(U,G,PO,$O,YO),H(W,G,Y,$O,YO),YO=String.fromCharCode(55349,57314+QO),H(U,G,PO,$O,YO),H(W,G,Y,$O,YO),YO=String.fromCharCode(55349,57324+QO),H(U,G,PO,$O,YO),H(W,G,Y,$O,YO),YO=String.fromCharCode(55349,57334+QO),H(U,G,PO,$O,YO),H(W,G,Y,$O,YO)}for(var ek=`ÐÞþ`,tk=0;tk<ek.length;tk++){var nk=ek.charAt(tk);H(U,G,PO,nk,nk),H(W,G,Y,nk,nk)}var rk={mathClass:`mathbf`,textClass:`textbf`,font:`Main-Bold`},ik={mathClass:`mathnormal`,textClass:`textit`,font:`Math-Italic`},ak={mathClass:`boldsymbol`,textClass:`boldsymbol`,font:`Main-BoldItalic`},ok={mathClass:`mathscr`,textClass:`textscr`,font:`Script-Regular`},sk={mathClass:``,textClass:``,font:``},ck={mathClass:`mathfrak`,textClass:`textfrak`,font:`Fraktur-Regular`},lk={mathClass:`mathbb`,textClass:`textbb`,font:`AMS-Regular`},uk={mathClass:`mathboldfrak`,textClass:`textboldfrak`,font:`Fraktur-Regular`},dk={mathClass:`mathsf`,textClass:`textsf`,font:`SansSerif-Regular`},fk={mathClass:`mathboldsf`,textClass:`textboldsf`,font:`SansSerif-Bold`},pk={mathClass:`mathitsf`,textClass:`textitsf`,font:`SansSerif-Italic`},mk={mathClass:`mathtt`,textClass:`texttt`,font:`Typewriter-Regular`},hk=[rk,rk,ik,ik,ak,ak,ok,sk,sk,sk,ck,ck,lk,lk,uk,uk,dk,dk,fk,fk,pk,pk,sk,sk,mk,mk],gk=[rk,sk,dk,fk,mk],_k=e=>{var t=e.charCodeAt(0),n=e.charCodeAt(1),r=(t-55296)*1024+(n-56320)+65536;if(119808<=r&&r<120484)return hk[Math.floor((r-119808)/26)];if(120782<=r&&r<=120831)return gk[Math.floor((r-120782)/10)];if(r===120485||r===120486)return hk[0];if(120486<r&&r<120782)return sk;throw new B(`Unsupported character: `+e)};function vk(e){var t=e.strict,n=e.errorCode,r=e.errorMsg,i=e.token,a=e.report,o=t;if(typeof t==`function`){if(a)o=t(n,r,i);else try{o=t(n,r,i)}catch{o=`error`}}switch(o){case!0:case`error`:if(a)throw new B(`LaTeX-incompatible input and strict mode is set to 'error': `+(r+` [`+n+`]`),i);return!0;case!1:case`ignore`:if(!a)return!1;break;default:if(typeof console<`u`&&console.warn(`LaTeX-incompatible input and strict mode is set to 'warn': `+(r+` [`+n+`]`)),!a)return!1}}var yk=function(e,t,n){if(AO[n][e]){var r=AO[n][e].replace;r&&(e=r)}return{value:e,metrics:DO(e,t,n)}},bk=function(e,t,n,r,i){var a=yk(e,t,n),o=a.metrics;e=a.value;var s;if(o){var c=o.italic;(n===`text`||r&&r.font===`mathit`)&&(c=0),s=new gO(e,o.height,o.depth,c,o.skew,o.width,i)}else vk({strict:r.strict,errorCode:`symbolNotInFont`,errorMsg:`No character metrics for '`+e+`' in style '`+t+`' and mode '`+n+`'`,report:!0}),s=new gO(e,0,0,0,0,0,i);s.maxFontSize=r.sizeMultiplier,r.style.isTight()&&s.classes.push(`mtight`);var l=r.getColor();return l&&(s.style.color=l),s},xk=function(e,t,n,r){return r===void 0&&(r=[]),n.font===`boldsymbol`&&yk(e,`Main-Bold`,t).metrics?bk(e,`Main-Bold`,t,n,r.concat([`mathbf`])):e===`\\`||AO[t][e].font===`main`?bk(e,`Main-Regular`,t,n,r):bk(e,`AMS-Regular`,t,n,r.concat([`amsrm`]))},Sk=function(e,t,n){return n!==`textord`&&yk(e,`Math-BoldItalic`,t).metrics?{fontName:`Math-BoldItalic`,fontClass:`boldsymbol`}:{fontName:`Main-Bold`,fontClass:`mathbf`}},Ck=function(e,t){var n=e.type===`mathord`?`mathord`:`textord`,r=e.mode,i=e.text,a=[`mord`],o=t.font,s=t.fontFamily,c=t.fontWeight,l=t.fontShape,u=r===`math`||r===`text`&&!!o,d=u?o:s,f=``,p=``;if(i.charCodeAt(0)===55349){var m=_k(i);f=m.font,p=m[r+`Class`]}if(f)return bk(i,f,r,t,a.concat(p));if(d){var h,g;if(d===`boldsymbol`){var _=Sk(i,r,n);h=_.fontName,g=[_.fontClass]}else u?(h=Ik[o].fontName,g=[o]):(h=Fk(s,c,l),g=[s,c,l]);if(yk(i,h,r).metrics)return bk(i,h,r,t,a.concat(g));if(Object.prototype.hasOwnProperty.call(zO,i)&&h.slice(0,10)===`Typewriter`){for(var v=[],y=0;y<i.length;y++)v.push(bk(i[y],h,r,t,a.concat(g)));return Ak(v)}}if(n===`mathord`)return bk(i,`Math-Italic`,r,t,a.concat([`mathnormal`]));if(n===`textord`){var b=AO[r][i]&&AO[r][i].font;if(b===`ams`)return bk(i,Fk(`amsrm`,c,l),r,t,a.concat(`amsrm`,c,l));if(b===`main`||!b)return bk(i,Fk(`textrm`,c,l),r,t,a.concat(c,l));var x=Fk(b,c,l);return bk(i,x,r,t,a.concat(x,c,l))}throw Error(`unexpected type: `+n+` in makeOrd`)},wk=(e,t)=>{if(oO(e.classes)!==oO(t.classes)||e.skew!==t.skew||e.maxFontSize!==t.maxFontSize||e.italic!==0&&e.hasClass(`mathnormal`))return!1;if(e.classes.length===1){var n=e.classes[0];if(n===`mbin`||n===`mord`)return!1}for(var r of Object.keys(e.style))if(e.style[r]!==t.style[r])return!1;for(var i of Object.keys(t.style))if(e.style[i]!==t.style[i])return!1;return!0},Tk=e=>{for(var t=0;t<e.length-1;t++){var n=e[t],r=e[t+1];n instanceof gO&&r instanceof gO&&wk(n,r)&&(n.text+=r.text,n.height=Math.max(n.height,r.height),n.depth=Math.max(n.depth,r.depth),n.italic=r.italic,e.splice(t+1,1),t--)}return e},Ek=function(e){for(var t=0,n=0,r=0,i=0;i<e.children.length;i++){var a=e.children[i];a.height>t&&(t=a.height),a.depth>n&&(n=a.depth),a.maxFontSize>r&&(r=a.maxFontSize)}e.height=t,e.depth=n,e.maxFontSize=r},X=function(e,t,n,r){var i=new fO(e,t,n,r);return Ek(i),i},Dk=(e,t,n,r)=>new fO(e,t,n,r),Ok=function(e,t,n){var r=X([e],[],t);return r.height=Math.max(n||t.fontMetrics().defaultRuleThickness,t.minRuleThickness),r.style.borderBottomWidth=V(r.height),r.maxFontSize=1,r},kk=function(e,t,n,r){var i=new pO(e,t,n,r);return Ek(i),i},Ak=function(e){var t=new tO(e);return Ek(t),t},jk=function(e,t){return e instanceof tO?X([],[e],t):e},Mk=function(e){if(e.positionType===`individualShift`){for(var t=e.children,n=[t[0]],r=-t[0].shift-t[0].elem.depth,i=r,a=1;a<t.length;a++){var o=-t[a].shift-i-t[a].elem.depth,s=o-(t[a-1].elem.height+t[a-1].elem.depth);i+=o,n.push({type:`kern`,size:s}),n.push(t[a])}return{children:n,depth:r}}var c;if(e.positionType===`top`){for(var l=e.positionData,u=0;u<e.children.length;u++){var d=e.children[u];l-=d.type===`kern`?d.size:d.elem.height+d.elem.depth}c=l}else if(e.positionType===`bottom`)c=-e.positionData;else{var f=e.children[0];if(f.type!==`elem`)throw Error(`First child must have type "elem".`);if(e.positionType===`shift`)c=-f.elem.depth-e.positionData;else if(e.positionType===`firstBaseline`)c=-f.elem.depth;else throw Error(`Invalid positionType `+e.positionType+`.`)}return{children:e.children,depth:c}},Nk=function(e,t){for(var n=Mk(e),r=n.children,i=n.depth,a=0,o=0;o<r.length;o++){var s=r[o];if(s.type===`elem`){var c=s.elem;a=Math.max(a,c.maxFontSize,c.height)}}a+=2;var l=X([`pstrut`],[]);l.style.height=V(a);for(var u=[],d=i,f=i,p=i,m=0;m<r.length;m++){var h=r[m];if(h.type===`kern`)p+=h.size;else{var g=h.elem,_=h.wrapperClasses||[],v=h.wrapperStyle||{},y=X(_,[l,g],void 0,v);y.style.top=V(-a-p-g.depth),h.marginLeft&&(y.style.marginLeft=h.marginLeft),h.marginRight&&(y.style.marginRight=h.marginRight),u.push(y),p+=g.height+g.depth}d=Math.min(d,p),f=Math.max(f,p)}var b=X([`vlist`],u);b.style.height=V(f);var x;if(d<0){var S=X([`vlist`],[X([],[])]);S.style.height=V(-d),x=[X([`vlist-r`],[b,X([`vlist-s`],[new gO(`​`)])]),X([`vlist-r`],[S])]}else x=[X([`vlist-r`],[b])];var C=X([`vlist-t`],x);return x.length===2&&C.classes.push(`vlist-t2`),C.height=f,C.depth=-d,C},Pk=(e,t)=>{var n=X([`mspace`],[],t),r=aO(e,t);return n.style.marginRight=V(r),n},Fk=(e,t,n)=>{var r,i;switch(e){case`amsrm`:r=`AMS`;break;case`textrm`:r=`Main`;break;case`textsf`:r=`SansSerif`;break;case`texttt`:r=`Typewriter`;break;default:r=e}return i=t===`textbf`&&n===`textit`?`BoldItalic`:t===`textbf`?`Bold`:n===`textit`?`Italic`:`Regular`,r+`-`+i},Ik={mathbf:{variant:`bold`,fontName:`Main-Bold`},mathrm:{variant:`normal`,fontName:`Main-Regular`},textit:{variant:`italic`,fontName:`Main-Italic`},mathit:{variant:`italic`,fontName:`Main-Italic`},mathnormal:{variant:`italic`,fontName:`Math-Italic`},mathsfit:{variant:`sans-serif-italic`,fontName:`SansSerif-Italic`},mathbb:{variant:`double-struck`,fontName:`AMS-Regular`},mathcal:{variant:`script`,fontName:`Caligraphic-Regular`},mathfrak:{variant:`fraktur`,fontName:`Fraktur-Regular`},mathscr:{variant:`script`,fontName:`Script-Regular`},mathsf:{variant:`sans-serif`,fontName:`SansSerif-Regular`},mathtt:{variant:`monospace`,fontName:`Typewriter-Regular`}},Lk={vec:[`vec`,.471,.714],oiintSize1:[`oiintSize1`,.957,.499],oiintSize2:[`oiintSize2`,1.472,.659],oiiintSize1:[`oiiintSize1`,1.304,.499],oiiintSize2:[`oiiintSize2`,1.98,.659]},Rk=function(e,t){var n=Lk[e],r=n[0],i=n[1],a=n[2],o=Dk([`katex-overlay`],[new _O([new vO(r)],{width:V(i),height:V(a),style:`width:`+V(i),viewBox:`0 0 `+1e3*i+` `+1e3*a,preserveAspectRatio:`xMinYMin`})],t);return o.height=a,o.style.height=V(a),o.style.width=V(i),o},zk={number:3,unit:`mu`},Bk={number:4,unit:`mu`},Vk={number:5,unit:`mu`},Hk={mord:{mop:zk,mbin:Bk,mrel:Vk,minner:zk},mop:{mord:zk,mop:zk,mrel:Vk,minner:zk},mbin:{mord:Bk,mop:Bk,mopen:Bk,minner:Bk},mrel:{mord:Vk,mop:Vk,mopen:Vk,minner:Vk},mopen:{},mclose:{mop:zk,mbin:Bk,mrel:Vk,minner:zk},mpunct:{mord:zk,mop:zk,mrel:Vk,mopen:zk,mclose:zk,mpunct:zk,minner:zk},minner:{mord:zk,mop:zk,mbin:Bk,mrel:Vk,mopen:zk,mpunct:zk,minner:zk}},Uk={mord:{mop:zk},mop:{mord:zk,mop:zk},mbin:{},mrel:{},mopen:{},mclose:{mop:zk},mpunct:{},minner:{mop:zk}},Wk={},Gk={},Kk={};function Z(e){for(var t=e.type,n=e.names,r=e.htmlBuilder,i=e.mathmlBuilder,a=0;a<n.length;++a)Wk[n[a]]=e;t&&(r&&(Gk[t]=r),i&&(Kk[t]=i))}function qk(e){var t=e.type,n=e.htmlBuilder,r=e.mathmlBuilder;n&&(Gk[t]=n),r&&(Kk[t]=r)}var Jk=function(e){return e.type===`ordgroup`&&e.body.length===1?e.body[0]:e},Yk=function(e){return e.type===`ordgroup`?e.body:[e]},Xk=new Set([`leftmost`,`mbin`,`mopen`,`mrel`,`mop`,`mpunct`]),Zk=new Set([`rightmost`,`mrel`,`mclose`,`mpunct`]),Qk={display:ID.DISPLAY,text:ID.TEXT,script:ID.SCRIPT,scriptscript:ID.SCRIPTSCRIPT},$k={mord:`mord`,mop:`mop`,mbin:`mbin`,mrel:`mrel`,mopen:`mopen`,mclose:`mclose`,mpunct:`mpunct`,minner:`minner`},eA=function(e,t,n,r){r===void 0&&(r=[null,null]);for(var i=[],a=0;a<e.length;a++){var o=oA(e[a],t);if(o instanceof tO){var s=o.children;i.push(...s)}else i.push(o)}if(Tk(i),!n)return i;var c=t;if(e.length===1){var l=e[0];l.type===`sizing`?c=t.havingSize(l.size):l.type===`styling`&&(c=t.havingStyle(Qk[l.style]))}var u=X([r[0]||`leftmost`],[],t),d=X([r[1]||`rightmost`],[],t),f=n===`root`;return tA(i,(e,t)=>{var n=t.classes[0],r=e.classes[0];n===`mbin`&&Zk.has(r)?t.classes[0]=`mord`:r===`mbin`&&Xk.has(n)&&(e.classes[0]=`mord`)},{node:u},d,f),tA(i,(e,t)=>{var n=iA(t),r=iA(e),i=n&&r?e.hasClass(`mtight`)?Uk[n]?.[r]:Hk[n]?.[r]:null;if(i)return Pk(i,c)},{node:u},d,f),i},tA=function(e,t,n,r,i){r&&e.push(r);for(var a=0;a<e.length;a++){var o=e[a],s=nA(o);if(s){tA(s.children,t,n,null,i);continue}var c=!o.hasClass(`mspace`);if(c){var l=t(o,n.node);l&&(n.insertAfter?n.insertAfter(l):(e.unshift(l),a++))}c?n.node=o:i&&o.hasClass(`katex-newline`)&&(n.node=X([`leftmost`])),n.insertAfter=(t=>n=>{e.splice(t+1,0,n),a++})(a)}r&&e.pop()},nA=function(e){return e instanceof tO||e instanceof pO||e instanceof fO&&e.hasClass(`enclosing`)?e:null},rA=function(e,t){var n=nA(e);if(n){var r=n.children;if(r.length){if(t===`right`)return rA(r[r.length-1],`right`);if(t===`left`)return rA(r[0],`left`)}}return e},iA=function(e,t){return e?(t&&(e=rA(e,t)),$k[e.classes[0]]||null):null},aA=function(e,t){var n=[`nulldelimiter`].concat(e.baseSizingClasses());return X(t.concat(n))},oA=function(e,t,n){if(!e)return X();if(Gk[e.type]){var r=Gk[e.type](e,t);if(n&&t.size!==n.size){r=X(t.sizingClasses(n),[r],t);var i=t.sizeMultiplier/n.sizeMultiplier;r.height*=i,r.depth*=i}return r}throw new B(`Got group of unknown type: '`+e.type+`'`)};function sA(e,t){var n=X([`katex-base`],e,t),r=X([`katex-strut`]);return r.style.height=V(n.height+n.depth),n.depth&&(r.style.verticalAlign=V(-n.depth)),n.children.unshift(r),n}function cA(e,t){var n=null;e.length===1&&e[0].type===`tag`&&(n=e[0].tag,e=e[0].body);var r=eA(e,t,`root`),i;r.length===2&&r[1].hasClass(`katex-tag`)&&(i=r.pop());for(var a=[],o=[],s=0;s<r.length;s++)if(o.push(r[s]),r[s].hasClass(`mbin`)||r[s].hasClass(`mrel`)||r[s].hasClass(`allowbreak`)){for(var c=!1;s<r.length-1&&r[s+1].hasClass(`mspace`)&&!r[s+1].hasClass(`katex-newline`);)s++,o.push(r[s]),r[s].hasClass(`nobreak`)&&(c=!0);c||(a.push(sA(o,t)),o=[])}else r[s].hasClass(`katex-newline`)&&(o.pop(),o.length>0&&(a.push(sA(o,t)),o=[]),a.push(r[s]));o.length>0&&a.push(sA(o,t));var l;n?(l=sA(eA(n,t,!0),t),l.classes=[`katex-tag`],a.push(l)):i&&a.push(i);var u=X([`katex-html`],a);if(u.setAttribute(`aria-hidden`,`true`),l){var d=l.children[0];d.style.height=V(u.height+u.depth),u.depth&&(d.style.verticalAlign=V(-u.depth))}return u}function lA(e){return new tO(e)}var Q=class{constructor(e,t,n){this.type=void 0,this.attributes=void 0,this.children=void 0,this.classes=void 0,this.type=e,this.attributes={},this.children=t||[],this.classes=n||[]}setAttribute(e,t){this.attributes[e]=t}getAttribute(e){return this.attributes[e]}toNode(){var e=document.createElementNS(`http://www.w3.org/1998/Math/MathML`,this.type);for(var t of Object.entries(this.attributes)){var n=t[0],r=t[1];e.setAttribute(n,r)}this.classes.length>0&&(e.className=oO(this.classes));for(var i=0;i<this.children.length;i++)if(this.children[i]instanceof uA&&this.children[i+1]instanceof uA){for(var a=this.children[i].toText()+this.children[++i].toText();this.children[i+1]instanceof uA;)a+=this.children[++i].toText();e.appendChild(new uA(a).toNode())}else e.appendChild(this.children[i].toNode());return e}toMarkup(){var e=`<`+this.type;for(var t of Object.entries(this.attributes)){var n=t[0],r=t[1];e+=` `+n+`="`,e+=uD(r),e+=`"`}this.classes.length>0&&(e+=` class ="`+uD(oO(this.classes))+`"`),e+=`>`;for(var i=0;i<this.children.length;i++)e+=this.children[i].toMarkup();return e+=`</`+this.type+`>`,e}toText(){return this.children.map(e=>e.toText()).join(``)}},uA=class{constructor(e){this.text=void 0,this.text=e}toNode(){return document.createTextNode(this.text)}toMarkup(){return uD(this.toText())}toText(){return this.text}},dA=class{constructor(e){this.width=void 0,this.character=void 0,this.width=e,this.character=e>=.05555&&e<=.05556?` `:e>=.1666&&e<=.1667?` `:e>=.2222&&e<=.2223?` `:e>=.2777&&e<=.2778?`  `:e>=-.05556&&e<=-.05555?` ⁣`:e>=-.1667&&e<=-.1666?` ⁣`:e>=-.2223&&e<=-.2222?` ⁣`:e>=-.2778&&e<=-.2777?` ⁣`:null}toNode(){if(this.character)return document.createTextNode(this.character);var e=document.createElementNS(`http://www.w3.org/1998/Math/MathML`,`mspace`);return e.setAttribute(`width`,V(this.width)),e}toMarkup(){return this.character?`<mtext>`+this.character+`</mtext>`:`<mspace width="`+V(this.width)+`"/>`}toText(){return this.character?this.character:` `}},fA=new Set([`\\imath`,`\\jmath`]),pA=new Set([`mrow`,`mtable`]),mA=function(e,t,n){var r,i;return AO[t][e]&&AO[t][e].replace&&e.charCodeAt(0)!==55349&&(!Object.prototype.hasOwnProperty.call(zO,e)||(n==null||(r=n.fontFamily)==null?void 0:r.slice(4,6))!==`tt`&&(n==null||(i=n.font)==null?void 0:i.slice(4,6))!==`tt`)&&(e=AO[t][e].replace),new uA(e)},hA=function(e){return e.length===1?e[0]:new Q(`mrow`,e)},gA={mathit:`italic`,boldsymbol:e=>e.type===`textord`?`bold`:`bold-italic`,mathbf:`bold`,mathbb:`double-struck`,mathsfit:`sans-serif-italic`,mathfrak:`fraktur`,mathscr:`script`,mathcal:`script`,mathsf:`sans-serif`,mathtt:`monospace`},_A=(e,t)=>{if(e.mode===`text`){if(t.fontFamily===`texttt`)return`monospace`;if(t.fontFamily===`textsf`)return t.fontShape===`textit`&&t.fontWeight===`textbf`?`sans-serif-bold-italic`:t.fontShape===`textit`?`sans-serif-italic`:t.fontWeight===`textbf`?`bold-sans-serif`:`sans-serif`;if(t.fontShape===`textit`&&t.fontWeight===`textbf`)return`bold-italic`;if(t.fontShape===`textit`)return`italic`;if(t.fontWeight===`textbf`)return`bold`}var n=t.font;if(!n||n===`mathnormal`)return null;var r=e.mode,i=gA[n];if(i)return typeof i==`function`?i(e):i;var a=e.text;if(fA.has(a))return null;if(AO[r][a]){var o=AO[r][a].replace;o&&(a=o)}var s=Ik[n].fontName;return DO(a,s,r)?Ik[n].variant:null};function vA(e){if(!e)return!1;if(e.type===`mi`&&e.children.length===1){var t=e.children[0];return t instanceof uA&&t.text===`.`}if(e.type===`mo`&&e.children.length===1&&e.getAttribute(`separator`)===`true`&&e.getAttribute(`lspace`)===`0em`&&e.getAttribute(`rspace`)===`0em`){var n=e.children[0];return n instanceof uA&&n.text===`,`}return!1}var yA=function(e,t,n){if(e.length===1){var r=xA(e[0],t);return n&&r instanceof Q&&r.type===`mo`&&(r.setAttribute(`lspace`,`0em`),r.setAttribute(`rspace`,`0em`)),[r]}for(var i=[],a,o=0;o<e.length;o++){var s=xA(e[o],t);if(s instanceof Q&&a instanceof Q){if(s.type===`mtext`&&a.type===`mtext`&&s.getAttribute(`mathvariant`)===a.getAttribute(`mathvariant`)){a.children.push(...s.children);continue}if(s.type===`mn`&&a.type===`mn`){a.children.push(...s.children);continue}if(vA(s)&&a.type===`mn`){a.children.push(...s.children);continue}if(s.type===`mn`&&vA(a))s.children=[...a.children,...s.children],i.pop();else if((s.type===`msup`||s.type===`msub`)&&s.children.length>=1&&(a.type===`mn`||vA(a))){var c=s.children[0];c instanceof Q&&c.type===`mn`&&(c.children=[...a.children,...c.children],i.pop())}else if(a.type===`mi`&&a.children.length===1){var l=a.children[0];if(l instanceof uA&&l.text===`̸`&&(s.type===`mo`||s.type===`mi`||s.type===`mn`)){var u=s.children[0];u instanceof uA&&u.text.length>0&&(u.text=u.text.slice(0,1)+`̸`+u.text.slice(1),i.pop())}}}i.push(s),a=s}return i},bA=function(e,t,n){return hA(yA(e,t,n))},xA=function(e,t){if(!e)return new Q(`mrow`);if(Kk[e.type])return Kk[e.type](e,t);throw new B(`Got group of unknown type: '`+e.type+`'`)};function SA(e,t,n,r,i){var a=yA(e,n),o=a.length===1&&a[0]instanceof Q&&pA.has(a[0].type)?a[0]:new Q(`mrow`,a),s=new Q(`annotation`,[new uA(t)]);s.setAttribute(`encoding`,`application/x-tex`);var c=new Q(`math`,[new Q(`semantics`,[o,s])]);return c.setAttribute(`xmlns`,`http://www.w3.org/1998/Math/MathML`),r&&c.setAttribute(`display`,`block`),X([i?`katex`:`katex-mathml`],[c])}var CA=[[1,1,1],[2,1,1],[3,1,1],[4,2,1],[5,2,1],[6,3,1],[7,4,2],[8,6,3],[9,7,6],[10,8,7],[11,10,9]],wA=[.5,.6,.7,.8,.9,1,1.2,1.44,1.728,2.074,2.488],TA=function(e,t){return t.size<2?e:CA[e-1][t.size-1]},EA=class e{constructor(t){this.style=void 0,this.color=void 0,this.size=void 0,this.textSize=void 0,this.phantom=void 0,this.font=void 0,this.fontFamily=void 0,this.fontWeight=void 0,this.fontShape=void 0,this.sizeMultiplier=void 0,this.maxSize=void 0,this.minRuleThickness=void 0,this._fontMetrics=void 0,this.strict=void 0,this.style=t.style,this.color=t.color,this.size=t.size||e.BASESIZE,this.textSize=t.textSize||this.size,this.phantom=!!t.phantom,this.font=t.font||``,this.fontFamily=t.fontFamily||``,this.fontWeight=t.fontWeight||``,this.fontShape=t.fontShape||``,this.sizeMultiplier=wA[this.size-1],this.maxSize=t.maxSize,this.minRuleThickness=t.minRuleThickness,this.strict=t.strict,this._fontMetrics=void 0}extend(t){var n={style:this.style,size:this.size,textSize:this.textSize,color:this.color,phantom:this.phantom,font:this.font,fontFamily:this.fontFamily,fontWeight:this.fontWeight,fontShape:this.fontShape,maxSize:this.maxSize,minRuleThickness:this.minRuleThickness,strict:this.strict};return Object.assign(n,t),new e(n)}havingStyle(e){return this.style===e?this:this.extend({style:e,size:TA(this.textSize,e)})}havingCrampedStyle(){return this.havingStyle(this.style.cramp())}havingSize(e){return this.size===e&&this.textSize===e?this:this.extend({style:this.style.text(),size:e,textSize:e,sizeMultiplier:wA[e-1]})}havingBaseStyle(t){t||=this.style.text();var n=TA(e.BASESIZE,t);return this.size===n&&this.textSize===e.BASESIZE&&this.style===t?this:this.extend({style:t,size:n})}havingBaseSizing(){var e;switch(this.style.id){case 4:case 5:e=3;break;case 6:case 7:e=1;break;default:e=6}return this.extend({style:this.style.text(),size:e})}withColor(e){return this.extend({color:e})}withPhantom(){return this.extend({phantom:!0})}withFont(e){return this.extend({font:e})}withTextFontFamily(e){return this.extend({fontFamily:e,font:``})}withTextFontWeight(e){return this.extend({fontWeight:e,font:``})}withTextFontShape(e){return this.extend({fontShape:e,font:``})}sizingClasses(e){return e.size===this.size?[]:[`katex-sizing`,`reset-size`+e.size,`size`+this.size]}baseSizingClasses(){return this.size===e.BASESIZE?[]:[`katex-sizing`,`reset-size`+this.size,`size`+e.BASESIZE]}fontMetrics(){return this._fontMetrics||=kO(this.size),this._fontMetrics}getColor(){return this.phantom?`transparent`:this.color}};EA.BASESIZE=6;var DA=e=>new EA({style:e.displayMode?ID.DISPLAY:ID.TEXT,maxSize:e.maxSize,minRuleThickness:e.minRuleThickness,strict:e.strict}),OA=function(e,t){if(t.displayMode){var n=[`katex-display`];t.leqno&&n.push(`leqno`),t.fleqn&&n.push(`fleqn`),e=X(n,[e])}return e},kA=function(e,t,n){var r=DA(n),i;return n.output===`mathml`?SA(e,t,r,n.displayMode,!0):(i=n.output===`html`?X([`katex`],[cA(e,r)]):X([`katex`],[SA(e,t,r,n.displayMode,!1),cA(e,r)]),OA(i,n))},AA=function(e,t){return OA(X([`katex`],[cA(e,DA(t))]),t)},jA={widehat:`^`,widecheck:`ˇ`,widetilde:`~`,utilde:`~`,overleftarrow:`←`,underleftarrow:`←`,xleftarrow:`←`,overrightarrow:`→`,underrightarrow:`→`,xrightarrow:`→`,underbrace:`⏟`,overbrace:`⏞`,underbracket:`⎵`,overbracket:`⎴`,overgroup:`⏠`,undergroup:`⏡`,overleftrightarrow:`↔`,underleftrightarrow:`↔`,xleftrightarrow:`↔`,Overrightarrow:`⇒`,xRightarrow:`⇒`,overleftharpoon:`↼`,xleftharpoonup:`↼`,overrightharpoon:`⇀`,xrightharpoonup:`⇀`,xLeftarrow:`⇐`,xLeftrightarrow:`⇔`,xhookleftarrow:`↩`,xhookrightarrow:`↪`,xmapsto:`↦`,xrightharpoondown:`⇁`,xleftharpoondown:`↽`,xrightleftharpoons:`⇌`,xleftrightharpoons:`⇋`,xtwoheadleftarrow:`↞`,xtwoheadrightarrow:`↠`,xlongequal:`=`,xtofrom:`⇄`,xrightleftarrows:`⇄`,xrightequilibrium:`⇌`,xleftequilibrium:`⇋`,"\\cdrightarrow":`→`,"\\cdleftarrow":`←`,"\\cdlongequal":`=`},MA=function(e){var t=new Q(`mo`,[new uA(jA[e.replace(/^\\/,``)])]);return t.setAttribute(`stretchy`,`true`),t},NA={overrightarrow:[[`rightarrow`],.888,522,`xMaxYMin`],overleftarrow:[[`leftarrow`],.888,522,`xMinYMin`],underrightarrow:[[`rightarrow`],.888,522,`xMaxYMin`],underleftarrow:[[`leftarrow`],.888,522,`xMinYMin`],xrightarrow:[[`rightarrow`],1.469,522,`xMaxYMin`],"\\cdrightarrow":[[`rightarrow`],3,522,`xMaxYMin`],xleftarrow:[[`leftarrow`],1.469,522,`xMinYMin`],"\\cdleftarrow":[[`leftarrow`],3,522,`xMinYMin`],Overrightarrow:[[`doublerightarrow`],.888,560,`xMaxYMin`],xRightarrow:[[`doublerightarrow`],1.526,560,`xMaxYMin`],xLeftarrow:[[`doubleleftarrow`],1.526,560,`xMinYMin`],overleftharpoon:[[`leftharpoon`],.888,522,`xMinYMin`],xleftharpoonup:[[`leftharpoon`],.888,522,`xMinYMin`],xleftharpoondown:[[`leftharpoondown`],.888,522,`xMinYMin`],overrightharpoon:[[`rightharpoon`],.888,522,`xMaxYMin`],xrightharpoonup:[[`rightharpoon`],.888,522,`xMaxYMin`],xrightharpoondown:[[`rightharpoondown`],.888,522,`xMaxYMin`],xlongequal:[[`longequal`],.888,334,`xMinYMin`],"\\cdlongequal":[[`longequal`],3,334,`xMinYMin`],xtwoheadleftarrow:[[`twoheadleftarrow`],.888,334,`xMinYMin`],xtwoheadrightarrow:[[`twoheadrightarrow`],.888,334,`xMaxYMin`],overleftrightarrow:[[`leftarrow`,`rightarrow`],.888,522],overbrace:[[`leftbrace`,`midbrace`,`rightbrace`],1.6,548],underbrace:[[`leftbraceunder`,`midbraceunder`,`rightbraceunder`],1.6,548],underleftrightarrow:[[`leftarrow`,`rightarrow`],.888,522],xleftrightarrow:[[`leftarrow`,`rightarrow`],1.75,522],xLeftrightarrow:[[`doubleleftarrow`,`doublerightarrow`],1.75,560],xrightleftharpoons:[[`leftharpoondownplus`,`rightharpoonplus`],1.75,716],xleftrightharpoons:[[`leftharpoonplus`,`rightharpoondownplus`],1.75,716],xhookleftarrow:[[`leftarrow`,`righthook`],1.08,522],xhookrightarrow:[[`lefthook`,`rightarrow`],1.08,522],overlinesegment:[[`leftlinesegment`,`rightlinesegment`],.888,522],underlinesegment:[[`leftlinesegment`,`rightlinesegment`],.888,522],overbracket:[[`leftbracketover`,`rightbracketover`],1.6,440],underbracket:[[`leftbracketunder`,`rightbracketunder`],1.6,410],overgroup:[[`leftgroup`,`rightgroup`],.888,342],undergroup:[[`leftgroupunder`,`rightgroupunder`],.888,342],xmapsto:[[`leftmapsto`,`rightarrow`],1.5,522],xtofrom:[[`leftToFrom`,`rightToFrom`],1.75,528],xrightleftarrows:[[`baraboveleftarrow`,`rightarrowabovebar`],1.75,901],xrightequilibrium:[[`baraboveshortleftharpoon`,`rightharpoonaboveshortbar`],1.75,716],xleftequilibrium:[[`shortbaraboveleftharpoon`,`shortrightharpoonabovebar`],1.75,716]},PA=new Set([`widehat`,`widecheck`,`widetilde`,`utilde`]),FA=function(e,t){function n(){var n=4e5,r=e.label.slice(1);if(PA.has(r)&&`base`in e){var i=e.base.type===`ordgroup`?e.base.body.length:1,a,o,s;if(i>5)r===`widehat`||r===`widecheck`?(a=420,n=2364,s=.42,o=r+`4`):(a=312,n=2340,s=.34,o=`tilde4`);else{var c=[1,1,2,2,3,3][i];r===`widehat`||r===`widecheck`?(n=[0,1062,2364,2364,2364][c],a=[0,239,300,360,420][c],s=[0,.24,.3,.3,.36,.42][c],o=r+c):(n=[0,600,1033,2339,2340][c],a=[0,260,286,306,312][c],s=[0,.26,.286,.3,.306,.34][c],o=`tilde`+c)}return{span:Dk([],[new _O([new vO(o)],{width:`100%`,height:V(s),viewBox:`0 0 `+n+` `+a,preserveAspectRatio:`none`})],t),minWidth:0,height:s}}var l=[],u=NA[r];if(!u)throw Error(`No SVG data for "`+r+`".`);var d=u[0],f=u[1],p=u[2],m=p/1e3,h=d.length,g,_;if(h===1){if(u.length!==4)throw Error(`Expected 4-tuple for single-path SVG data "`+r+`".`);g=[`hide-tail`],_=[u[3]]}else if(h===2)g=[`halfarrow-left`,`halfarrow-right`],_=[`xMinYMin`,`xMaxYMin`];else if(h===3)g=[`brace-left`,`brace-center`,`brace-right`],_=[`xMinYMin`,`xMidYMin`,`xMaxYMin`];else throw Error(`Correct katexImagesData or update code here to support
395
- `+h+` children.`);for(var v=0;v<h;v++){var y=new _O([new vO(d[v])],{width:`400em`,height:V(m),viewBox:`0 0 `+n+` `+p,preserveAspectRatio:_[v]+` slice`}),b=Dk([g[v]],[y],t);if(h===1)return{span:b,minWidth:f,height:m};b.style.height=V(m),l.push(b)}return{span:X([`katex-stretchy`],l,t),minWidth:f,height:m}}var r=n(),i=r.span,a=r.minWidth,o=r.height;return i.height=o,i.style.height=V(o),a>0&&(i.style.minWidth=V(a)),i},IA=function(e,t,n,r,i){var a,o=e.height+e.depth+n+r;if(/fbox|color|angl/.test(t)){if(a=X([`katex-stretchy`,t],[],i),t===`fbox`){var s=i.color&&i.getColor();s&&(a.style.borderColor=s)}}else{var c=[];/^[bx]cancel$/.test(t)&&c.push(new yO({x1:`0`,y1:`0`,x2:`100%`,y2:`100%`,"stroke-width":`0.046em`})),/^x?cancel$/.test(t)&&c.push(new yO({x1:`0`,y1:`100%`,x2:`100%`,y2:`0`,"stroke-width":`0.046em`})),a=Dk([],[new _O(c,{width:`100%`,height:V(o)})],i)}return a.height=o,a.style.height=V(o),a},LA=[`bin`,`close`,`inner`,`open`,`punct`,`rel`],RA=[`accent-token`,`mathord`,`op-token`,`spacing`,`textord`],zA=new Set(LA),BA=new Set(RA);function VA(e){return zA.has(e)}function HA(e,t){if(!e||e.type!==t)throw Error(`Expected node of type `+t+`, but got `+(e?`node of type `+e.type:String(e)));return e}function UA(e){var t=WA(e);if(!t)throw Error(`Expected node of symbol group type, but got `+(e?`node of type `+e.type:String(e)));return t}function WA(e){return e.type===`atom`||BA.has(e.type)?e:null}function GA(e,t,n){var r=``;for(var i of e.body)if(i.type===`textord`)r+=i.text;else if(n&&i.type===`spacing`&&i.text===` `)r+=` `;else throw new B(t,e);return r}var KA=e=>{if(e instanceof gO)return e;if(SO(e)&&e.children.length===1)return KA(e.children[0])},qA=(e,t)=>{var n,r,i;e&&e.type===`supsub`?(r=HA(e.base,`accent`),n=r.base,e.base=n,i=xO(oA(e,t)),e.base=r):(r=HA(e,`accent`),n=r.base);var a=oA(n,t.havingCrampedStyle()),o=r.isShifty&&pD(n),s=0;o&&(s=KA(a)?.skew??0);var c=r.label===`\\c`,l=c?a.height+a.depth:Math.min(a.height,t.fontMetrics().xHeight),u;if(r.isStretchy)u=FA(r,t),u=Nk({positionType:`firstBaseline`,children:[{type:`elem`,elem:a},{type:`elem`,elem:u,wrapperClasses:[`svg-align`],wrapperStyle:s>0?{width:`calc(100% - `+V(2*s)+`)`,marginLeft:V(2*s)}:void 0}]});else{var d,f;r.label===`\\vec`?(d=Rk(`vec`,t),f=Lk.vec[1]):(d=Ck({type:`textord`,mode:r.mode,text:r.label},t),d=bO(d),d.italic=0,f=d.width,c&&(l+=d.depth)),u=X([`accent-body`],[d]);var p=r.label===`\\textcircled`;p&&(u.classes.push(`accent-full`),l=a.height);var m=s;p||(m-=f/2),u.style.left=V(m),r.label===`\\textcircled`&&(u.style.top=`.2em`),u=Nk({positionType:`firstBaseline`,children:[{type:`elem`,elem:a},{type:`kern`,size:-l},{type:`elem`,elem:u}]})}var h=X([`mord`,`katex-accent`],[u],t);return i?(i.children[0]=h,i.height=Math.max(h.height,i.height),i.classes[0]=`mord`,i):h},JA=(e,t)=>{var n=e.isStretchy?MA(e.label):new Q(`mo`,[mA(e.label,e.mode)]),r=new Q(`mover`,[xA(e.base,t),n]);return r.setAttribute(`accent`,`true`),r},YA=new RegExp([`\\acute`,`\\grave`,`\\ddot`,`\\tilde`,`\\bar`,`\\breve`,`\\check`,`\\hat`,`\\vec`,`\\dot`,`\\mathring`].map(e=>`\\`+e).join(`|`));Z({type:`accent`,names:[`\\acute`,`\\grave`,`\\ddot`,`\\tilde`,`\\bar`,`\\breve`,`\\check`,`\\hat`,`\\vec`,`\\dot`,`\\mathring`,`\\widecheck`,`\\widehat`,`\\widetilde`,`\\overrightarrow`,`\\overleftarrow`,`\\Overrightarrow`,`\\overleftrightarrow`,`\\overgroup`,`\\overlinesegment`,`\\overleftharpoon`,`\\overrightharpoon`],numArgs:1,handler:(e,t)=>{var n=Jk(t[0]),r=!YA.test(e.funcName),i=!r||e.funcName===`\\widehat`||e.funcName===`\\widetilde`||e.funcName===`\\widecheck`;return{type:`accent`,mode:e.parser.mode,label:e.funcName,isStretchy:r,isShifty:i,base:n}},htmlBuilder:qA,mathmlBuilder:JA}),Z({type:`accent`,names:[`\\'`,"\\`",`\\^`,`\\~`,`\\=`,`\\u`,`\\.`,`\\"`,`\\c`,`\\r`,`\\H`,`\\v`,`\\textcircled`],numArgs:1,allowedInText:!0,allowedInMath:!0,argTypes:[`primitive`],handler:(e,t)=>{var n=t[0],r=e.parser.mode;return r===`math`&&(vk({strict:e.parser.settings.strict,errorCode:`mathVsTextAccents`,errorMsg:`LaTeX's accent `+e.funcName+` works only in text mode`,report:!0}),r=`text`),{type:`accent`,mode:r,label:e.funcName,isStretchy:!1,isShifty:!0,base:n}}}),Z({type:`accentUnder`,names:[`\\underleftarrow`,`\\underrightarrow`,`\\underleftrightarrow`,`\\undergroup`,`\\underlinesegment`,`\\utilde`],numArgs:1,handler:(e,t)=>{var n=e.parser,r=e.funcName,i=t[0];return{type:`accentUnder`,mode:n.mode,label:r,base:i}},htmlBuilder:(e,t)=>{var n=oA(e.base,t),r=FA(e,t),i=e.label===`\\utilde`?.12:0;return X([`mord`,`accentunder`],[Nk({positionType:`top`,positionData:n.height,children:[{type:`elem`,elem:r,wrapperClasses:[`svg-align`]},{type:`kern`,size:i},{type:`elem`,elem:n}]})],t)},mathmlBuilder:(e,t)=>{var n=MA(e.label),r=new Q(`munder`,[xA(e.base,t),n]);return r.setAttribute(`accentunder`,`true`),r}});var XA=e=>{var t=new Q(`mpadded`,e?[e]:[]);return t.setAttribute(`width`,`+0.6em`),t.setAttribute(`lspace`,`0.3em`),t};Z({type:`xArrow`,names:[`\\xleftarrow`,`\\xrightarrow`,`\\xLeftarrow`,`\\xRightarrow`,`\\xleftrightarrow`,`\\xLeftrightarrow`,`\\xhookleftarrow`,`\\xhookrightarrow`,`\\xmapsto`,`\\xrightharpoondown`,`\\xrightharpoonup`,`\\xleftharpoondown`,`\\xleftharpoonup`,`\\xrightleftharpoons`,`\\xleftrightharpoons`,`\\xlongequal`,`\\xtwoheadrightarrow`,`\\xtwoheadleftarrow`,`\\xtofrom`,`\\xrightleftarrows`,`\\xrightequilibrium`,`\\xleftequilibrium`,`\\\\cdrightarrow`,`\\\\cdleftarrow`,`\\\\cdlongequal`],numArgs:1,numOptionalArgs:1,handler(e,t,n){var r=e.parser,i=e.funcName;return{type:`xArrow`,mode:r.mode,label:i,body:t[0],below:n[0]}},htmlBuilder(e,t){var n=t.style,r=t.havingStyle(n.sup()),i=jk(oA(e.body,r,t),t),a=e.label.slice(0,2)===`\\x`?`x`:`cd`;i.classes.push(a+`-arrow-pad`);var o;e.below&&(r=t.havingStyle(n.sub()),o=jk(oA(e.below,r,t),t),o.classes.push(a+`-arrow-pad`));var s=FA(e,t),c=-t.fontMetrics().axisHeight+.5*s.height,l=-t.fontMetrics().axisHeight-.5*s.height-.111;(i.depth>.25||e.label===`\\xleftequilibrium`)&&(l-=i.depth);var u;if(o){var d=-t.fontMetrics().axisHeight+o.height+.5*s.height+.111;u=Nk({positionType:`individualShift`,children:[{type:`elem`,elem:i,shift:l},{type:`elem`,elem:s,shift:c,wrapperClasses:[`svg-align`]},{type:`elem`,elem:o,shift:d}]})}else u=Nk({positionType:`individualShift`,children:[{type:`elem`,elem:i,shift:l},{type:`elem`,elem:s,shift:c,wrapperClasses:[`svg-align`]}]});return X([`mrel`,`x-arrow`],[u],t)},mathmlBuilder(e,t){var n=MA(e.label);n.setAttribute(`minsize`,e.label.charAt(0)===`x`?`1.75em`:`3.0em`);var r;if(e.body){var i=XA(xA(e.body,t));r=e.below?new Q(`munderover`,[n,XA(xA(e.below,t)),i]):new Q(`mover`,[n,i])}else e.below?r=new Q(`munder`,[n,XA(xA(e.below,t))]):(r=XA(),r=new Q(`mover`,[n,r]));return r}});function ZA(e,t){var n=eA(e.body,t,!0);return X([e.mclass],n,t)}function QA(e,t){var n,r=yA(e.body,t);return e.mclass===`minner`?n=new Q(`mpadded`,r):e.mclass===`mord`?e.isCharacterBox?(n=r[0],n.type=`mi`):n=new Q(`mi`,r):(e.isCharacterBox?(n=r[0],n.type=`mo`):n=new Q(`mo`,r),e.mclass===`mbin`?(n.attributes.lspace=`0.22em`,n.attributes.rspace=`0.22em`):e.mclass===`mpunct`?(n.attributes.lspace=`0em`,n.attributes.rspace=`0.17em`):(e.mclass===`mopen`||e.mclass===`mclose`)&&(n.attributes.lspace=`0em`,n.attributes.rspace=`0em`)),n}Z({type:`mclass`,names:[`\\mathord`,`\\mathbin`,`\\mathrel`,`\\mathopen`,`\\mathclose`,`\\mathpunct`,`\\mathinner`],numArgs:1,primitive:!0,handler(e,t){var n=e.parser,r=e.funcName,i=t[0];return{type:`mclass`,mode:n.mode,mclass:`m`+r.slice(5),body:Yk(i),isCharacterBox:pD(i)}},htmlBuilder:ZA,mathmlBuilder:QA});var $A=e=>{var t=e.type===`ordgroup`&&e.body.length?e.body[0]:e;return t.type===`atom`&&(t.family===`bin`||t.family===`rel`)?`m`+t.family:`mord`};Z({type:`mclass`,names:[`\\@binrel`],numArgs:2,handler(e,t){return{type:`mclass`,mode:e.parser.mode,mclass:$A(t[0]),body:Yk(t[1]),isCharacterBox:pD(t[1])}}}),Z({type:`mclass`,names:[`\\stackrel`,`\\overset`,`\\underset`],numArgs:2,handler(e,t){var n=e.parser,r=e.funcName,i=t[1],a=t[0],o=r===`\\stackrel`?`mrel`:$A(i),s={type:`op`,mode:i.mode,limits:!0,alwaysHandleSupSub:!0,parentIsSupSub:!1,symbol:!1,suppressBaseShift:r!==`\\stackrel`,body:Yk(i)},c=r===`\\underset`?{type:`supsub`,mode:a.mode,base:s,sub:a}:{type:`supsub`,mode:a.mode,base:s,sup:a};return{type:`mclass`,mode:n.mode,mclass:o,body:[c],isCharacterBox:pD(c)}}}),Z({type:`pmb`,names:[`\\pmb`],numArgs:1,allowedInText:!0,handler(e,t){return{type:`pmb`,mode:e.parser.mode,mclass:$A(t[0]),body:Yk(t[0])}},htmlBuilder(e,t){var n=eA(e.body,t,!0),r=X([e.mclass],n,t);return r.style.textShadow=`0.02em 0.01em 0.04px`,r},mathmlBuilder(e,t){var n=new Q(`mstyle`,yA(e.body,t));return n.setAttribute(`style`,`text-shadow: 0.02em 0.01em 0.04px`),n}});var ej={">":`\\\\cdrightarrow`,"<":`\\\\cdleftarrow`,"=":`\\\\cdlongequal`,A:`\\uparrow`,V:`\\downarrow`,"|":`\\Vert`,".":`no arrow`},tj=()=>({type:`styling`,body:[],mode:`math`,style:`display`,resetFont:!0}),nj=e=>e.type===`textord`&&e.text===`@`,rj=(e,t)=>(e.type===`mathord`||e.type===`atom`)&&e.text===t;function ij(e,t,n){var r=ej[e];switch(r){case`\\\\cdrightarrow`:case`\\\\cdleftarrow`:return n.callFunction(r,[t[0]],[t[1]]);case`\\uparrow`:case`\\downarrow`:var i=n.callFunction(`\\\\cdleft`,[t[0]],[]),a={type:`atom`,text:r,mode:`math`,family:`rel`},o={type:`ordgroup`,mode:`math`,body:[i,n.callFunction(`\\Big`,[a],[]),n.callFunction(`\\\\cdright`,[t[1]],[])]};return n.callFunction(`\\\\cdparent`,[o],[]);case`\\\\cdlongequal`:return n.callFunction(`\\\\cdlongequal`,[],[]);case`\\Vert`:return n.callFunction(`\\Big`,[{type:`textord`,text:`\\Vert`,mode:`math`}],[]);default:return{type:`textord`,text:` `,mode:`math`}}}function aj(e){var t=[];for(e.gullet.beginGroup(),e.gullet.macros.set(`\\cr`,`\\\\\\relax`),e.gullet.beginGroup();;){t.push(e.parseExpression(!1,`\\\\`)),e.gullet.endGroup(),e.gullet.beginGroup();var n=e.fetch().text;if(n===`&`||n===`\\\\`)e.consume();else if(n===`\\end`){t[t.length-1].length===0&&t.pop();break}else throw new B(`Expected \\\\ or \\cr or \\end`,e.nextToken)}for(var r=[],i=[r],a=0;a<t.length;a++){for(var o=t[a],s=tj(),c=0;c<o.length;c++)if(!nj(o[c]))s.body.push(o[c]);else{r.push(s),c+=1;var l=UA(o[c]).text,u=[,,];if(u[0]={type:`ordgroup`,mode:`math`,body:[]},u[1]={type:`ordgroup`,mode:`math`,body:[]},!`=|.`.includes(l)){if(`<>AV`.includes(l))for(var d=0;d<2;d++){for(var f=!0,p=c+1;p<o.length;p++){if(rj(o[p],l)){f=!1,c=p;break}if(nj(o[p]))throw new B(`Missing a `+l+` character to complete a CD arrow.`,o[p]);u[d].body.push(o[p])}if(f)throw new B(`Missing a `+l+` character to complete a CD arrow.`,o[c])}else throw new B(`Expected one of "<>AV=|." after @`,o[c])}var m={type:`styling`,body:[ij(l,u,e)],mode:`math`,style:`display`,resetFont:!0};r.push(m),s=tj()}a%2==0?r.push(s):r.shift(),r=[],i.push(r)}return e.gullet.endGroup(),e.gullet.endGroup(),{type:`array`,mode:`math`,body:i,arraystretch:1,addJot:!0,rowGaps:[null],cols:Array(i[0].length).fill({type:`align`,align:`c`,pregap:.25,postgap:.25}),colSeparationType:`CD`,hLinesBeforeRow:Array(i.length+1).fill([])}}Z({type:`cdlabel`,names:[`\\\\cdleft`,`\\\\cdright`],numArgs:1,handler(e,t){var n=e.parser,r=e.funcName;return{type:`cdlabel`,mode:n.mode,side:r.slice(4),label:t[0]}},htmlBuilder(e,t){var n=t.havingStyle(t.style.sup()),r=jk(oA(e.label,n,t),t);return r.classes.push(`cd-label-`+e.side),r.style.bottom=V(.8-r.depth),r.height=0,r.depth=0,r},mathmlBuilder(e,t){var n=new Q(`mrow`,[xA(e.label,t)]);return n=new Q(`mpadded`,[n]),n.setAttribute(`width`,`0`),e.side===`left`&&n.setAttribute(`lspace`,`-1width`),n.setAttribute(`voffset`,`0.7em`),n=new Q(`mstyle`,[n]),n.setAttribute(`displaystyle`,`false`),n.setAttribute(`scriptlevel`,`1`),n}}),Z({type:`cdlabelparent`,names:[`\\\\cdparent`],numArgs:1,handler(e,t){return{type:`cdlabelparent`,mode:e.parser.mode,fragment:t[0]}},htmlBuilder(e,t){var n=jk(oA(e.fragment,t),t);return n.classes.push(`cd-vert-arrow`),n},mathmlBuilder(e,t){return new Q(`mrow`,[xA(e.fragment,t)])}}),Z({type:`textord`,names:[`\\@char`],numArgs:1,allowedInText:!0,handler(e,t){var n=e.parser,r=GA(HA(t[0],`ordgroup`),`\\@char has non-numeric argument`),i=parseInt(r),a;if(isNaN(i))throw new B(`\\@char has non-numeric argument `+r);if(i<0||i>1114111)throw new B(`\\@char with invalid code point `+r);return i<=65535?a=String.fromCharCode(i):(i-=65536,a=String.fromCharCode((i>>10)+55296,(i&1023)+56320)),{type:`textord`,mode:n.mode,text:a}}}),Z({type:`color`,names:[`\\textcolor`],numArgs:2,allowedInText:!0,argTypes:[`color`,`original`],handler(e,t){var n=e.parser,r=HA(t[0],`color-token`).color,i=t[1];return{type:`color`,mode:n.mode,color:r,body:Yk(i)}},htmlBuilder:(e,t)=>Ak(eA(e.body,t.withColor(e.color),!1)),mathmlBuilder:(e,t)=>{var n=new Q(`mstyle`,yA(e.body,t.withColor(e.color)));return n.setAttribute(`mathcolor`,e.color),n}}),Z({type:`color`,names:[`\\color`],numArgs:1,allowedInText:!0,argTypes:[`color`],handler(e,t){var n=e.parser,r=e.breakOnTokenText,i=HA(t[0],`color-token`).color;n.gullet.macros.set(`\\current@color`,i);var a=n.parseExpression(!0,r);return{type:`color`,mode:n.mode,color:i,body:a}}}),Z({type:`cr`,names:[`\\\\`],numArgs:0,numOptionalArgs:0,allowedInText:!0,handler(e){var t=e.parser,n=t.gullet.future().text===`[`?t.parseSizeGroup(!0):null,r=!t.settings.displayMode||!vk({strict:t.settings.strict,errorCode:`newLineInDisplayMode`,errorMsg:`In LaTeX, \\\\ or \\newline does nothing in display mode`,report:!1});return{type:`cr`,mode:t.mode,newLine:r,size:n&&HA(n,`size`).value}},htmlBuilder(e,t){var n=X([`mspace`],[],t);return e.newLine&&(n.classes.push(`katex-newline`),e.size&&(n.style.marginTop=V(aO(e.size,t)))),n},mathmlBuilder(e,t){var n=new Q(`mspace`);return e.newLine&&(n.setAttribute(`linebreak`,`newline`),e.size&&n.setAttribute(`height`,V(aO(e.size,t)))),n}});var oj={"\\global":`\\global`,"\\long":`\\\\globallong`,"\\\\globallong":`\\\\globallong`,"\\def":`\\gdef`,"\\gdef":`\\gdef`,"\\edef":`\\xdef`,"\\xdef":`\\xdef`,"\\let":`\\\\globallet`,"\\futurelet":`\\\\globalfuture`},sj=e=>{var t=e.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(t))throw new B(`Expected a control sequence`,e);return t},cj=e=>{var t=e.gullet.popToken();return t.text===`=`&&(t=e.gullet.popToken(),t.text===` `&&(t=e.gullet.popToken())),t},lj=(e,t,n,r)=>{var i=e.gullet.macros.get(n.text);i??=(n.noexpand=!0,{tokens:[n],numArgs:0,unexpandable:!e.gullet.isExpandable(n.text)}),e.gullet.macros.set(t,i,r)};Z({type:`internal`,names:[`\\global`,`\\long`,`\\\\globallong`],numArgs:0,allowedInText:!0,handler(e){var t=e.parser,n=e.funcName;t.consumeSpaces();var r=t.fetch();if(oj[r.text])return(n===`\\global`||n===`\\\\globallong`)&&(r.text=oj[r.text]),HA(t.parseFunction(),`internal`);throw new B(`Invalid token after macro prefix`,r)}}),Z({type:`internal`,names:[`\\def`,`\\gdef`,`\\edef`,`\\xdef`],numArgs:0,allowedInText:!0,primitive:!0,handler(e){var t=e.parser,n=e.funcName,r=t.gullet.popToken(),i=r.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(i))throw new B(`Expected a control sequence`,r);for(var a=0,o,s=[[]];t.gullet.future().text!==`{`;)if(r=t.gullet.popToken(),r.text===`#`){if(t.gullet.future().text===`{`){o=t.gullet.future(),s[a].push(`{`);break}if(r=t.gullet.popToken(),!/^[1-9]$/.test(r.text))throw new B(`Invalid argument number "`+r.text+`"`);if(parseInt(r.text)!==a+1)throw new B(`Argument number "`+r.text+`" out of order`);a++,s.push([])}else if(r.text===`EOF`)throw new B(`Expected a macro definition`);else s[a].push(r.text);var c=t.gullet.consumeArg().tokens;return o&&c.unshift(o),(n===`\\edef`||n===`\\xdef`)&&(c=t.gullet.expandTokens(c),c.reverse()),t.gullet.macros.set(i,{tokens:c,numArgs:a,delimiters:s},n===oj[n]),{type:`internal`,mode:t.mode}}}),Z({type:`internal`,names:[`\\let`,`\\\\globallet`],numArgs:0,allowedInText:!0,primitive:!0,handler(e){var t=e.parser,n=e.funcName,r=sj(t.gullet.popToken());return t.gullet.consumeSpaces(),lj(t,r,cj(t),n===`\\\\globallet`),{type:`internal`,mode:t.mode}}}),Z({type:`internal`,names:[`\\futurelet`,`\\\\globalfuture`],numArgs:0,allowedInText:!0,primitive:!0,handler(e){var t=e.parser,n=e.funcName,r=sj(t.gullet.popToken()),i=t.gullet.popToken(),a=t.gullet.popToken();return lj(t,r,a,n===`\\\\globalfuture`),t.gullet.pushToken(a),t.gullet.pushToken(i),{type:`internal`,mode:t.mode}}});var uj=function(e,t,n){var r=DO(AO.math[e]&&AO.math[e].replace||e,t,n);if(!r)throw Error(`Unsupported symbol `+e+` and font size `+t+`.`);return r},dj=function(e,t,n,r){var i=n.havingBaseStyle(t),a=X(r.concat(i.sizingClasses(n)),[e],n),o=i.sizeMultiplier/n.sizeMultiplier;return a.height*=o,a.depth*=o,a.maxFontSize=i.sizeMultiplier,a},fj=function(e,t,n){var r=t.havingBaseStyle(n),i=(1-t.sizeMultiplier/r.sizeMultiplier)*t.fontMetrics().axisHeight;e.classes.push(`delimcenter`),e.style.top=V(i),e.height-=i,e.depth+=i},pj=function(e,t,n,r,i,a){var o=dj(bk(e,`Main-Regular`,i,r),t,r,a);return n&&fj(o,r,t),o},mj=function(e,t,n,r){return bk(e,`Size`+t+`-Regular`,n,r)},hj=function(e,t,n,r,i,a){var o=mj(e,t,i,r),s=dj(X([`delimsizing`,`size`+t],[o],r),ID.TEXT,r,a);return n&&fj(s,r,ID.TEXT),s},gj=function(e,t,n,r){return{type:`elem`,elem:X([`delimsizinginner`,t===`Size1-Regular`?`delim-size1`:`delim-size4`],[X([],[bk(e,t,n,r)])])}},_j=function(e,t,n){var r=CO[`Size4-Regular`][e.charCodeAt(0)]?CO[`Size4-Regular`][e.charCodeAt(0)][4]:CO[`Size1-Regular`][e.charCodeAt(0)][4],i=Dk([],[new _O([new vO(`inner`,ZD(e,Math.round(1e3*t)))],{width:V(r),height:V(t),style:`width:`+V(r),viewBox:`0 0 `+1e3*r+` `+Math.round(1e3*t),preserveAspectRatio:`xMinYMin`})],n);return i.height=t,i.style.height=V(t),i.style.width=V(r),{type:`elem`,elem:i}},vj=.008,yj={type:`kern`,size:-1*vj},bj=new Set([`|`,`\\lvert`,`\\rvert`,`\\vert`]),xj=new Set([`\\|`,`\\lVert`,`\\rVert`,`\\Vert`]),Sj=function(e,t,n,r,i,a){var o,s,c,l,u=``,d=0;o=c=l=e,s=null;var f=`Size1-Regular`;e===`\\uparrow`?c=l=`⏐`:e===`\\Uparrow`?c=l=`‖`:e===`\\downarrow`?o=c=`⏐`:e===`\\Downarrow`?o=c=`‖`:e===`\\updownarrow`?(o=`\\uparrow`,c=`⏐`,l=`\\downarrow`):e===`\\Updownarrow`?(o=`\\Uparrow`,c=`‖`,l=`\\Downarrow`):bj.has(e)?(c=`∣`,u=`vert`,d=333):xj.has(e)?(c=`∥`,u=`doublevert`,d=556):e===`[`||e===`\\lbrack`?(o=`⎡`,c=`⎢`,l=`⎣`,f=`Size4-Regular`,u=`lbrack`,d=667):e===`]`||e===`\\rbrack`?(o=`⎤`,c=`⎥`,l=`⎦`,f=`Size4-Regular`,u=`rbrack`,d=667):e===`\\lfloor`||e===`⌊`?(c=o=`⎢`,l=`⎣`,f=`Size4-Regular`,u=`lfloor`,d=667):e===`\\lceil`||e===`⌈`?(o=`⎡`,c=l=`⎢`,f=`Size4-Regular`,u=`lceil`,d=667):e===`\\rfloor`||e===`⌋`?(c=o=`⎥`,l=`⎦`,f=`Size4-Regular`,u=`rfloor`,d=667):e===`\\rceil`||e===`⌉`?(o=`⎤`,c=l=`⎥`,f=`Size4-Regular`,u=`rceil`,d=667):e===`(`||e===`\\lparen`?(o=`⎛`,c=`⎜`,l=`⎝`,f=`Size4-Regular`,u=`lparen`,d=875):e===`)`||e===`\\rparen`?(o=`⎞`,c=`⎟`,l=`⎠`,f=`Size4-Regular`,u=`rparen`,d=875):e===`\\{`||e===`\\lbrace`?(o=`⎧`,s=`⎨`,l=`⎩`,c=`⎪`,f=`Size4-Regular`):e===`\\}`||e===`\\rbrace`?(o=`⎫`,s=`⎬`,l=`⎭`,c=`⎪`,f=`Size4-Regular`):e===`\\lgroup`||e===`⟮`?(o=`⎧`,l=`⎩`,c=`⎪`,f=`Size4-Regular`):e===`\\rgroup`||e===`⟯`?(o=`⎫`,l=`⎭`,c=`⎪`,f=`Size4-Regular`):e===`\\lmoustache`||e===`⎰`?(o=`⎧`,l=`⎭`,c=`⎪`,f=`Size4-Regular`):(e===`\\rmoustache`||e===`⎱`)&&(o=`⎫`,l=`⎩`,c=`⎪`,f=`Size4-Regular`);var p=uj(o,f,i),m=p.height+p.depth,h=uj(c,f,i),g=h.height+h.depth,_=uj(l,f,i),v=_.height+_.depth,y=0,b=1;if(s!==null){var x=uj(s,f,i);y=x.height+x.depth,b=2}var S=m+v+y,C=S+Math.max(0,Math.ceil((t-S)/(b*g)))*b*g,w=r.fontMetrics().axisHeight;n&&(w*=r.sizeMultiplier);var T=C/2-w,E=[];if(u.length>0){var D=C-m-v,ee=Math.round(C*1e3),O=$D(u,Math.round(D*1e3)),te=new vO(u,O),ne=V(d/1e3),re=V(ee/1e3),ie=Dk([],[new _O([te],{width:ne,height:re,viewBox:`0 0 `+d+` `+ee})],r);ie.height=ee/1e3,ie.style.width=ne,ie.style.height=re,E.push({type:`elem`,elem:ie})}else{if(E.push(gj(l,f,i,r)),E.push(yj),s===null){var k=C-m-v+2*vj;E.push(_j(c,k,r))}else{var ae=(C-m-v-y)/2+2*vj;E.push(_j(c,ae,r)),E.push(yj),E.push(gj(s,f,i,r)),E.push(yj),E.push(_j(c,ae,r))}E.push(yj),E.push(gj(o,f,i,r))}var A=r.havingBaseStyle(ID.TEXT);return dj(X([`delimsizing`,`mult`],[Nk({positionType:`bottom`,positionData:T,children:E})],A),ID.TEXT,r,a)},Cj=80,wj=.08,Tj=function(e,t,n,r,i){return Dk([`hide-tail`],[new _O([new vO(e,XD(e,r,n))],{width:`400em`,height:V(t),viewBox:`0 0 400000 `+n,preserveAspectRatio:`xMinYMin slice`})],i)},Ej=function(e,t){var n=t.havingBaseSizing(),r=Ij(`\\surd`,e*n.sizeMultiplier,Pj,n),i=n.sizeMultiplier,a=Math.max(0,t.minRuleThickness-t.fontMetrics().sqrtRuleThickness),o,s,c,l,u;return r.type===`small`?(l=1e3+1e3*a+Cj,e<1?i=1:e<1.4&&(i=.7),s=(1+a+wj)/i,c=(1+a)/i,o=Tj(`sqrtMain`,s,l,a,t),o.style.minWidth=`0.853em`,u=.833/i):r.type===`large`?(l=(1e3+Cj)*Aj[r.size],c=(Aj[r.size]+a)/i,s=(Aj[r.size]+a+wj)/i,o=Tj(`sqrtSize`+r.size,s,l,a,t),o.style.minWidth=`1.02em`,u=1/i):(s=e+a+wj,c=e+a,l=Math.floor(1e3*e+a)+Cj,o=Tj(`sqrtTall`,s,l,a,t),o.style.minWidth=`0.742em`,u=1.056),o.height=c,o.style.height=V(s),{span:o,advanceWidth:u,ruleWidth:(t.fontMetrics().sqrtRuleThickness+a)*i}},Dj=new Set([`(`,`\\lparen`,`)`,`\\rparen`,`[`,`\\lbrack`,`]`,`\\rbrack`,`\\{`,`\\lbrace`,`\\}`,`\\rbrace`,`\\lfloor`,`\\rfloor`,`⌊`,`⌋`,`\\lceil`,`\\rceil`,`⌈`,`⌉`,`\\surd`]),Oj=new Set([`\\uparrow`,`\\downarrow`,`\\updownarrow`,`\\Uparrow`,`\\Downarrow`,`\\Updownarrow`,`|`,`\\|`,`\\vert`,`\\Vert`,`\\lvert`,`\\rvert`,`\\lVert`,`\\rVert`,`\\lgroup`,`\\rgroup`,`⟮`,`⟯`,`\\lmoustache`,`\\rmoustache`,`⎰`,`⎱`]),kj=new Set([`<`,`>`,`\\langle`,`\\rangle`,`/`,`\\backslash`,`\\lt`,`\\gt`]),Aj=[0,1.2,1.8,2.4,3],jj=function(e,t,n,r,i){if(e===`<`||e===`\\lt`||e===`⟨`?e=`\\langle`:(e===`>`||e===`\\gt`||e===`⟩`)&&(e=`\\rangle`),Dj.has(e)||kj.has(e))return hj(e,t,!1,n,r,i);if(Oj.has(e))return Sj(e,Aj[t],!1,n,r,i);throw new B(`Illegal delimiter: '`+e+`'`)},Mj=[{type:`small`,style:ID.SCRIPTSCRIPT},{type:`small`,style:ID.SCRIPT},{type:`small`,style:ID.TEXT},{type:`large`,size:1},{type:`large`,size:2},{type:`large`,size:3},{type:`large`,size:4}],Nj=[{type:`small`,style:ID.SCRIPTSCRIPT},{type:`small`,style:ID.SCRIPT},{type:`small`,style:ID.TEXT},{type:`stack`}],Pj=[{type:`small`,style:ID.SCRIPTSCRIPT},{type:`small`,style:ID.SCRIPT},{type:`small`,style:ID.TEXT},{type:`large`,size:1},{type:`large`,size:2},{type:`large`,size:3},{type:`large`,size:4},{type:`stack`}],Fj=function(e){if(e.type===`small`)return`Main-Regular`;if(e.type===`large`)return`Size`+e.size+`-Regular`;if(e.type===`stack`)return`Size4-Regular`;var t=e.type;throw Error(`Add support for delim type '`+t+`' here.`)},Ij=function(e,t,n,r){for(var i=Math.min(2,3-r.style.size);i<n.length;i++){var a=n[i];if(a.type===`stack`)break;var o=uj(e,Fj(a),`math`),s=o.height+o.depth;if(a.type===`small`){var c=r.havingBaseStyle(a.style);s*=c.sizeMultiplier}if(s>t)return a}return n[n.length-1]},Lj=function(e,t,n,r,i,a){e===`<`||e===`\\lt`||e===`⟨`?e=`\\langle`:(e===`>`||e===`\\gt`||e===`⟩`)&&(e=`\\rangle`);var o=kj.has(e)?Mj:Dj.has(e)?Pj:Nj,s=Ij(e,t,o,r);return s.type===`small`?pj(e,s.style,n,r,i,a):s.type===`large`?hj(e,s.size,n,r,i,a):Sj(e,t,n,r,i,a)},Rj=function(e,t,n,r,i,a){var o=r.fontMetrics().axisHeight*r.sizeMultiplier,s=901,c=5/r.fontMetrics().ptPerEm,l=Math.max(t-o,n+o);return Lj(e,Math.max(l/500*s,2*l-c),!0,r,i,a)},zj={"\\bigl":{mclass:`mopen`,size:1},"\\Bigl":{mclass:`mopen`,size:2},"\\biggl":{mclass:`mopen`,size:3},"\\Biggl":{mclass:`mopen`,size:4},"\\bigr":{mclass:`mclose`,size:1},"\\Bigr":{mclass:`mclose`,size:2},"\\biggr":{mclass:`mclose`,size:3},"\\Biggr":{mclass:`mclose`,size:4},"\\bigm":{mclass:`mrel`,size:1},"\\Bigm":{mclass:`mrel`,size:2},"\\biggm":{mclass:`mrel`,size:3},"\\Biggm":{mclass:`mrel`,size:4},"\\big":{mclass:`mord`,size:1},"\\Big":{mclass:`mord`,size:2},"\\bigg":{mclass:`mord`,size:3},"\\Bigg":{mclass:`mord`,size:4}},Bj=new Set(`(,\\lparen,),\\rparen,[,\\lbrack,],\\rbrack,\\{,\\lbrace,\\},\\rbrace,\\lfloor,\\rfloor,⌊,⌋,\\lceil,\\rceil,⌈,⌉,<,>,\\langle,⟨,\\rangle,⟩,\\lt,\\gt,\\lvert,\\rvert,\\lVert,\\rVert,\\lgroup,\\rgroup,⟮,⟯,\\lmoustache,\\rmoustache,⎰,⎱,/,\\backslash,|,\\vert,\\|,\\Vert,\\uparrow,\\Uparrow,\\downarrow,\\Downarrow,\\updownarrow,\\Updownarrow,.`.split(`,`));function Vj(e){return`isMiddle`in e}function Hj(e,t){var n=WA(e);if(n&&Bj.has(n.text))return n;throw n?new B(`Invalid delimiter '`+n.text+`' after '`+t.funcName+`'`,e):new B(`Invalid delimiter type '`+e.type+`'`,e)}Z({type:`delimsizing`,names:[`\\bigl`,`\\Bigl`,`\\biggl`,`\\Biggl`,`\\bigr`,`\\Bigr`,`\\biggr`,`\\Biggr`,`\\bigm`,`\\Bigm`,`\\biggm`,`\\Biggm`,`\\big`,`\\Big`,`\\bigg`,`\\Bigg`],numArgs:1,argTypes:[`primitive`],handler:(e,t)=>{var n=Hj(Jk(t[0]),e);return{type:`delimsizing`,mode:e.parser.mode,size:zj[e.funcName].size,mclass:zj[e.funcName].mclass,delim:n.text}},htmlBuilder:(e,t)=>e.delim===`.`?X([e.mclass]):jj(e.delim,e.size,t,e.mode,[e.mclass]),mathmlBuilder:e=>{var t=[];e.delim!==`.`&&t.push(mA(e.delim,e.mode));var n=new Q(`mo`,t);e.mclass===`mopen`||e.mclass===`mclose`?n.setAttribute(`fence`,`true`):n.setAttribute(`fence`,`false`),n.setAttribute(`stretchy`,`true`);var r=V(Aj[e.size]);return n.setAttribute(`minsize`,r),n.setAttribute(`maxsize`,r),n}});function Uj(e){if(!e.body)throw Error(`Bug: The leftright ParseNode wasn't fully parsed.`)}Z({type:`leftright-right`,names:[`\\right`],numArgs:1,primitive:!0,handler:(e,t)=>{var n=e.parser.gullet.macros.get(`\\current@color`);if(n&&typeof n!=`string`)throw new B(`\\current@color set to non-string in \\right`);return{type:`leftright-right`,mode:e.parser.mode,delim:Hj(t[0],e).text,color:n}}}),Z({type:`leftright`,names:[`\\left`],numArgs:1,primitive:!0,handler:(e,t)=>{var n=Hj(t[0],e),r=e.parser;++r.leftrightDepth;var i=r.parseExpression(!1);--r.leftrightDepth,r.expect(`\\right`,!1);var a=HA(r.parseFunction(),`leftright-right`);return{type:`leftright`,mode:r.mode,body:i,left:n.text,right:a.delim,rightColor:a.color}},htmlBuilder:(e,t)=>{Uj(e);for(var n=eA(e.body,t,!0,[`mopen`,`mclose`]),r=0,i=0,a=!1,o=0;o<n.length;o++){var s=n[o];Vj(s)?a=!0:(r=Math.max(n[o].height,r),i=Math.max(n[o].depth,i))}r*=t.sizeMultiplier,i*=t.sizeMultiplier;var c=e.left===`.`?aA(t,[`mopen`]):Rj(e.left,r,i,t,e.mode,[`mopen`]);if(n.unshift(c),a)for(var l=1;l<n.length;l++){var u=n[l];if(Vj(u)){var d=u.isMiddle;n[l]=Rj(d.delim,r,i,d.options,e.mode,[])}}var f;if(e.right===`.`)f=aA(t,[`mclose`]);else{var p=e.rightColor?t.withColor(e.rightColor):t;f=Rj(e.right,r,i,p,e.mode,[`mclose`])}return n.push(f),X([`minner`],n,t)},mathmlBuilder:(e,t)=>{Uj(e);var n=yA(e.body,t);if(e.left!==`.`){var r=new Q(`mo`,[mA(e.left,e.mode)]);r.setAttribute(`fence`,`true`),n.unshift(r)}if(e.right!==`.`){var i=new Q(`mo`,[mA(e.right,e.mode)]);i.setAttribute(`fence`,`true`),e.rightColor&&i.setAttribute(`mathcolor`,e.rightColor),n.push(i)}return hA(n)}}),Z({type:`middle`,names:[`\\middle`],numArgs:1,primitive:!0,handler:(e,t)=>{var n=Hj(t[0],e);if(!e.parser.leftrightDepth)throw new B(`\\middle without preceding \\left`,n);return{type:`middle`,mode:e.parser.mode,delim:n.text}},htmlBuilder:(e,t)=>{var n;return e.delim===`.`?n=aA(t,[]):(n=jj(e.delim,1,t,e.mode,[]),n.isMiddle={delim:e.delim,options:t}),n},mathmlBuilder:(e,t)=>{var n=new Q(`mo`,[e.delim===`\\vert`||e.delim===`|`?mA(`|`,`text`):mA(e.delim,e.mode)]);return n.setAttribute(`fence`,`true`),n.setAttribute(`lspace`,`0.05em`),n.setAttribute(`rspace`,`0.05em`),n}}),Z({type:`enclose`,names:[`\\colorbox`],numArgs:2,allowedInText:!0,argTypes:[`color`,`hbox`],handler(e,t,n){var r=e.parser,i=e.funcName,a=HA(t[0],`color-token`).color,o=t[1];return{type:`enclose`,mode:r.mode,label:i,backgroundColor:a,body:o}},htmlBuilder:(e,t)=>{var n=jk(oA(e.body,t),t),r=e.label.slice(1),i=t.sizeMultiplier,a,o,s=pD(e.body);if(r===`sout`)a=X([`katex-stretchy`,`katex-sout`]),a.height=t.fontMetrics().defaultRuleThickness/i,o=-.5*t.fontMetrics().xHeight;else if(r===`phase`){var c=aO({number:.6,unit:`pt`},t),l=aO({number:.35,unit:`ex`},t),u=t.havingBaseSizing();i/=u.sizeMultiplier;var d=n.height+n.depth+c+l;n.style.paddingLeft=V(d/2+c);var f=Math.floor(1e3*d*i);a=Dk([`hide-tail`],[new _O([new vO(`phase`,JD(f))],{width:`400em`,height:V(f/1e3),viewBox:`0 0 400000 `+f,preserveAspectRatio:`xMinYMin slice`})],t),a.style.height=V(d),o=n.depth+c+l}else{/cancel/.test(r)?s||n.classes.push(`cancel-pad`):r===`angl`?n.classes.push(`anglpad`):n.classes.push(`boxpad`);var p,m,h=0;/box/.test(r)?(h=Math.max(t.fontMetrics().fboxrule,t.minRuleThickness),p=t.fontMetrics().fboxsep+(r===`colorbox`?0:h),m=p):r===`angl`?(h=Math.max(t.fontMetrics().defaultRuleThickness,t.minRuleThickness),p=4*h,m=Math.max(0,.25-n.depth)):(p=s?.2:0,m=p),a=IA(n,r,p,m,t),/fbox|boxed|fcolorbox/.test(r)?(a.style.borderStyle=`solid`,a.style.borderWidth=V(h)):r===`angl`&&h!==.049&&(a.style.borderTopWidth=V(h),a.style.borderRightWidth=V(h)),o=n.depth+m,e.backgroundColor&&(a.style.backgroundColor=e.backgroundColor,e.borderColor&&(a.style.borderColor=e.borderColor))}var g;if(e.backgroundColor)g=Nk({positionType:`individualShift`,children:[{type:`elem`,elem:a,shift:o},{type:`elem`,elem:n,shift:0}]});else{var _=/cancel|phase/.test(r)?[`svg-align`]:[];g=Nk({positionType:`individualShift`,children:[{type:`elem`,elem:n,shift:0},{type:`elem`,elem:a,shift:o,wrapperClasses:_}]})}return/cancel/.test(r)&&(g.height=n.height,g.depth=n.depth),/cancel/.test(r)&&!s?X([`mord`,`cancel-lap`],[g],t):X([`mord`],[g],t)},mathmlBuilder:(e,t)=>{var n,r=new Q(e.label.includes(`colorbox`)?`mpadded`:`menclose`,[xA(e.body,t)]);switch(e.label){case`\\cancel`:r.setAttribute(`notation`,`updiagonalstrike`);break;case`\\bcancel`:r.setAttribute(`notation`,`downdiagonalstrike`);break;case`\\phase`:r.setAttribute(`notation`,`phasorangle`);break;case`\\sout`:r.setAttribute(`notation`,`horizontalstrike`);break;case`\\fbox`:r.setAttribute(`notation`,`box`);break;case`\\angl`:r.setAttribute(`notation`,`actuarial`);break;case`\\fcolorbox`:case`\\colorbox`:if(n=t.fontMetrics().fboxsep*t.fontMetrics().ptPerEm,r.setAttribute(`width`,`+`+2*n+`pt`),r.setAttribute(`height`,`+`+2*n+`pt`),r.setAttribute(`lspace`,n+`pt`),r.setAttribute(`voffset`,n+`pt`),e.label===`\\fcolorbox`){var i=Math.max(t.fontMetrics().fboxrule,t.minRuleThickness);r.setAttribute(`style`,`border: `+V(i)+` solid `+e.borderColor)}break;case`\\xcancel`:r.setAttribute(`notation`,`updiagonalstrike downdiagonalstrike`)}return e.backgroundColor&&r.setAttribute(`mathbackground`,e.backgroundColor),r}}),Z({type:`enclose`,names:[`\\fcolorbox`],numArgs:3,allowedInText:!0,argTypes:[`color`,`color`,`hbox`],handler(e,t,n){var r=e.parser,i=e.funcName,a=HA(t[0],`color-token`).color,o=HA(t[1],`color-token`).color,s=t[2];return{type:`enclose`,mode:r.mode,label:i,backgroundColor:o,borderColor:a,body:s}}}),Z({type:`enclose`,names:[`\\fbox`],numArgs:1,argTypes:[`hbox`],allowedInText:!0,handler(e,t){return{type:`enclose`,mode:e.parser.mode,label:`\\fbox`,body:t[0]}}}),Z({type:`enclose`,names:[`\\cancel`,`\\bcancel`,`\\xcancel`,`\\phase`],numArgs:1,handler(e,t){var n=e.parser,r=e.funcName,i=t[0];return{type:`enclose`,mode:n.mode,label:r,body:i}}}),Z({type:`enclose`,names:[`\\sout`],numArgs:1,allowedInText:!0,handler(e,t){var n=e.parser,r=e.funcName;n.mode===`math`&&vk({strict:n.settings.strict,errorCode:`mathVsSout`,errorMsg:`LaTeX's \\sout works only in text mode`,report:!0});var i=t[0];return{type:`enclose`,mode:n.mode,label:r,body:i}}}),Z({type:`enclose`,names:[`\\angl`],numArgs:1,argTypes:[`hbox`],allowedInText:!1,handler(e,t){return{type:`enclose`,mode:e.parser.mode,label:`\\angl`,body:t[0]}}});var Wj={};function Gj(e){for(var t=e.type,n=e.names,r=e.props,i=e.handler,a=e.htmlBuilder,o=e.mathmlBuilder,s={type:t,numArgs:r.numArgs||0,allowedInText:!1,numOptionalArgs:0,handler:i},c=0;c<n.length;++c)Wj[n[c]]=s;a&&(Gk[t]=a),o&&(Kk[t]=o)}var Kj={};function $(e,t){Kj[e]=t}var qj=class e{constructor(e,t,n){this.lexer=void 0,this.start=void 0,this.end=void 0,this.lexer=e,this.start=t,this.end=n}static range(t,n){return n?!t||!t.loc||!n.loc||t.loc.lexer!==n.loc.lexer?null:new e(t.loc.lexer,t.loc.start,n.loc.end):t&&t.loc}},Jj=class e{constructor(e,t){this.text=void 0,this.loc=void 0,this.noexpand=void 0,this.treatAsRelax=void 0,this.text=e,this.loc=t}range(t,n){return new e(n,qj.range(this,t))}};function Yj(e){var t=[];e.consumeSpaces();var n=e.fetch().text;for(n===`\\relax`&&(e.consume(),e.consumeSpaces(),n=e.fetch().text);n===`\\hline`||n===`\\hdashline`;)e.consume(),t.push(n===`\\hdashline`),e.consumeSpaces(),n=e.fetch().text;return t}var Xj=e=>{if(!e.parser.settings.displayMode)throw new B(`{`+e.envName+`} can be used only in display mode.`)},Zj=new Set([`gather`,`gather*`]);function Qj(e){if(!e.includes(`ed`))return!e.includes(`*`)}function $j(e,t,n){var r=t.hskipBeforeAndAfter,i=t.addJot,a=t.cols,o=t.arraystretch,s=t.colSeparationType,c=t.autoTag,l=t.singleRow,u=t.emptySingleRow,d=t.maxNumCols,f=t.leqno;if(e.gullet.beginGroup(),l||e.gullet.macros.set(`\\cr`,`\\\\\\relax`),!o){var p=e.gullet.expandMacroAsText(`\\arraystretch`);if(p==null)o=1;else if(o=parseFloat(p),!o||o<0)throw new B(`Invalid \\arraystretch: `+p)}e.gullet.beginGroup();var m=[],h=[m],g=[],_=[],v=c==null?void 0:[];function y(){c&&e.gullet.macros.set(`\\@eqnsw`,`1`,!0)}function b(){v&&(e.gullet.macros.get(`\\df@tag`)?(v.push(e.subparse([new Jj(`\\df@tag`)])),e.gullet.macros.set(`\\df@tag`,void 0,!0)):v.push(!!c&&e.gullet.macros.get(`\\@eqnsw`)===`1`))}for(y(),_.push(Yj(e));;){var x=e.parseExpression(!1,l?`\\end`:`\\\\`);e.gullet.endGroup(),e.gullet.beginGroup();var S={type:`ordgroup`,mode:e.mode,body:x};n&&(S={type:`styling`,mode:e.mode,style:n,resetFont:!0,body:[S]}),m.push(S);var C=e.fetch().text;if(C===`&`){if(d&&m.length===d){if(l||s)throw new B(`Too many tab characters: &`,e.nextToken);vk({strict:e.settings.strict,errorCode:`textEnv`,errorMsg:`Too few columns specified in the {array} column argument.`,report:!0})}e.consume()}else if(C===`\\end`){b(),m.length===1&&S.type===`styling`&&S.body.length===1&&S.body[0].type===`ordgroup`&&S.body[0].body.length===0&&(h.length>1||!u)&&!Array.isArray(v?.[v.length-1])&&!(c&&v?.[v.length-1]===!0)&&h.pop(),_.length<h.length+1&&_.push([]);break}else if(C===`\\\\`){e.consume();var w=void 0;e.gullet.future().text!==` `&&(w=e.parseSizeGroup(!0)),g.push(w?w.value:null),b(),_.push(Yj(e)),m=[],h.push(m),y()}else throw new B(`Expected & or \\\\ or \\cr or \\end`,e.nextToken)}return e.gullet.endGroup(),e.gullet.endGroup(),{type:`array`,mode:e.mode,addJot:i,arraystretch:o,body:h,cols:a,rowGaps:g,hskipBeforeAndAfter:r,hLinesBeforeRow:_,colSeparationType:s,tags:v,leqno:f}}function eM(e){return e.slice(0,1)===`d`?`display`:`text`}var tM=function(e,t){var n,r,i=e.body.length,a=e.hLinesBeforeRow,o=0,s=Array(i),c=[],l=Math.max(t.fontMetrics().arrayRuleWidth,t.minRuleThickness),u=1/t.fontMetrics().ptPerEm,d=5*u;e.colSeparationType&&e.colSeparationType===`small`&&(d=.2778*(t.havingStyle(ID.SCRIPT).sizeMultiplier/t.sizeMultiplier));var f=e.colSeparationType===`CD`?aO({number:3,unit:`ex`},t):12*u,p=3*u,m=e.arraystretch*f,h=.7*m,g=.3*m,_=0;function v(e){for(var t=0;t<e.length;++t)t>0&&(_+=.25),c.push({pos:_,isDashed:e[t]})}for(v(a[0]),n=0;n<e.body.length;++n){var y=e.body[n],b=h,x=g;o<y.length&&(o=y.length);var S={cells:Array(y.length),height:0,depth:0,pos:0};for(r=0;r<y.length;++r){var C=oA(y[r],t);x<C.depth&&(x=C.depth),b<C.height&&(b=C.height),S.cells[r]=C}var w=e.rowGaps[n],T=0;w&&(T=aO(w,t),T>0&&(T+=g,x<T&&(x=T),T=0)),e.addJot&&n<e.body.length-1&&(x+=p),S.height=b,S.depth=x,_+=b,S.pos=_,_+=x+T,s[n]=S,v(a[n+1])}var E=_/2+t.fontMetrics().axisHeight,D=e.cols||[],ee=[],O,te,ne=[];if(e.tags&&e.tags.some(e=>e))for(n=0;n<i;++n){var re=s[n],ie=re.pos-E,k=e.tags[n],ae=void 0;ae=k===!0?X([`eqn-num`],[],t):k===!1?X([],[],t):X([],eA(k,t,!0),t),ae.depth=re.depth,ae.height=re.height,ne.push({type:`elem`,elem:ae,shift:ie})}for(r=0,te=0;r<o||te<D.length;++r,++te){for(var A=D[te],oe=!0;(se=A)?.type===`separator`;){var se;if(oe||(O=X([`arraycolsep`],[]),O.style.width=V(t.fontMetrics().doubleRuleSep),ee.push(O)),A.separator===`|`||A.separator===`:`){var ce=A.separator===`|`?`solid`:`dashed`,le=X([`vertical-separator`],[],t);le.style.height=V(_),le.style.borderRightWidth=V(l),le.style.borderRightStyle=ce,le.style.margin=`0 `+V(-l/2);var ue=_-E;ue&&(le.style.verticalAlign=V(-ue)),ee.push(le)}else throw new B(`Invalid separator type: `+A.separator);te++,A=D[te],oe=!1}if(!(r>=o)){var de=void 0;(r>0||e.hskipBeforeAndAfter)&&(de=A?.pregap??d,de!==0&&(O=X([`arraycolsep`],[]),O.style.width=V(de),ee.push(O)));var fe=[];for(n=0;n<i;++n){var pe=s[n],me=pe.cells[r];if(me){var he=pe.pos-E;me.depth=pe.depth,me.height=pe.height,fe.push({type:`elem`,elem:me,shift:he})}}var ge=Nk({positionType:`individualShift`,children:fe}),_e=X([`col-align-`+(A?.align||`c`)],[ge]);ee.push(_e),(r<o-1||e.hskipBeforeAndAfter)&&(de=A?.postgap??d,de!==0&&(O=X([`arraycolsep`],[]),O.style.width=V(de),ee.push(O)))}}var ve=X([`mtable`],ee);if(c.length>0){for(var ye=Ok(`katex-hline`,t,l),j=Ok(`katex-hdashline`,t,l),M=[{type:`elem`,elem:ve,shift:0}];c.length>0;){var be=c.pop(),xe=be.pos-E;be.isDashed?M.push({type:`elem`,elem:j,shift:xe}):M.push({type:`elem`,elem:ye,shift:xe})}ve=Nk({positionType:`individualShift`,children:M})}if(ne.length===0)return X([`mord`],[ve],t);var N=X([`katex-tag`],[Nk({positionType:`individualShift`,children:ne})],t);return Ak([ve,N])},nM={c:`center `,l:`left `,r:`right `},rM=function(e,t){for(var n=[],r=new Q(`mtd`,[],[`mtr-glue`]),i=new Q(`mtd`,[],[`mml-eqn-num`]),a=0;a<e.body.length;a++){for(var o=e.body[a],s=[],c=0;c<o.length;c++)s.push(new Q(`mtd`,[xA(o[c],t)]));e.tags&&e.tags[a]&&(s.unshift(r),s.push(r),e.leqno?s.unshift(i):s.push(i)),n.push(new Q(`mtr`,s))}var l=new Q(`mtable`,n),u=e.arraystretch===.5?.1:.16+e.arraystretch-1+(e.addJot?.09:0);l.setAttribute(`rowspacing`,V(u));var d=``,f=``;if(e.cols&&e.cols.length>0){var p=e.cols,m=``,h=!1,g=0,_=p.length;p[0].type===`separator`&&(d+=`top `,g=1),p[p.length-1].type===`separator`&&(d+=`bottom `,--_);for(var v=g;v<_;v++){var y=p[v];y.type===`align`?(f+=nM[y.align],h&&(m+=`none `),h=!0):y.type===`separator`&&(h&&=(m+=y.separator===`|`?`solid `:`dashed `,!1))}l.setAttribute(`columnalign`,f.trim()),/[sd]/.test(m)&&l.setAttribute(`columnlines`,m.trim())}if(e.colSeparationType===`align`){for(var b=e.cols||[],x=``,S=1;S<b.length;S++)x+=S%2?`0em `:`1em `;l.setAttribute(`columnspacing`,x.trim())}else e.colSeparationType===`alignat`||e.colSeparationType===`gather`?l.setAttribute(`columnspacing`,`0em`):e.colSeparationType===`small`?l.setAttribute(`columnspacing`,`0.2778em`):e.colSeparationType===`CD`?l.setAttribute(`columnspacing`,`0.5em`):l.setAttribute(`columnspacing`,`1em`);var C=``,w=e.hLinesBeforeRow;d+=w[0].length>0?`left `:``,d+=w[w.length-1].length>0?`right `:``;for(var T=1;T<w.length-1;T++)C+=w[T].length===0?`none `:w[T][0]?`dashed `:`solid `;return/[sd]/.test(C)&&l.setAttribute(`rowlines`,C.trim()),d!==``&&(l=new Q(`menclose`,[l]),l.setAttribute(`notation`,d.trim())),e.arraystretch&&e.arraystretch<1&&(l=new Q(`mstyle`,[l]),l.setAttribute(`scriptlevel`,`1`)),l},iM=function(e,t){e.envName.includes(`ed`)||Xj(e);var n=[],r=e.envName===`split`,i=$j(e.parser,{cols:n,addJot:!0,autoTag:r?void 0:Qj(e.envName),emptySingleRow:!0,colSeparationType:e.envName.includes(`at`)?`alignat`:`align`,maxNumCols:r?2:void 0,leqno:e.parser.settings.leqno},`display`),a=0,o=0,s={type:`ordgroup`,mode:e.mode,body:[]};if(t[0]&&t[0].type===`ordgroup`){var c=`Number of columns should be a positive integer`,l=GA(t[0],c);if(!/^[0-9]+$/.test(l)||Number(l)<1)throw new B(c,t[0]);a=Number(l),o=a*2}var u=!o;i.body.forEach(function(e){for(var t=1;t<e.length;t+=2)HA(HA(e[t],`styling`).body[0],`ordgroup`).body.unshift(s);if(u)o<e.length&&(o=e.length);else{var n=e.length/2;if(a<n)throw new B(`Too many math in a row: `+(`expected `+a+`, but got `+n),e[0])}});for(var d=0;d<o;++d){var f=`r`,p=0;d%2==1?f=`l`:d>0&&u&&(p=1),n[d]={type:`align`,align:f,pregap:p,postgap:0}}return i.colSeparationType=u?`align`:`alignat`,i};Gj({type:`array`,names:[`array`,`darray`],props:{numArgs:1},handler(e,t){var n=(WA(t[0])?[t[0]]:HA(t[0],`ordgroup`).body).map(function(e){var t=UA(e).text;if(`lcr`.includes(t))return{type:`align`,align:t};if(t===`|`)return{type:`separator`,separator:`|`};if(t===`:`)return{type:`separator`,separator:`:`};throw new B(`Unknown column alignment: `+t,e)}),r={cols:n,hskipBeforeAndAfter:!0,maxNumCols:n.length};return $j(e.parser,r,eM(e.envName))},htmlBuilder:tM,mathmlBuilder:rM}),Gj({type:`array`,names:[`matrix`,`pmatrix`,`bmatrix`,`Bmatrix`,`vmatrix`,`Vmatrix`,`matrix*`,`pmatrix*`,`bmatrix*`,`Bmatrix*`,`vmatrix*`,`Vmatrix*`],props:{numArgs:0},handler(e){var t={matrix:null,pmatrix:[`(`,`)`],bmatrix:[`[`,`]`],Bmatrix:[`\\{`,`\\}`],vmatrix:[`|`,`|`],Vmatrix:[`\\Vert`,`\\Vert`]}[e.envName.replace(`*`,``)],n=`c`,r={hskipBeforeAndAfter:!1,cols:[{type:`align`,align:n}]};if(e.envName.charAt(e.envName.length-1)===`*`){var i=e.parser;if(i.consumeSpaces(),i.fetch().text===`[`){if(i.consume(),i.consumeSpaces(),n=i.fetch().text,!`lcr`.includes(n))throw new B(`Expected l or c or r`,i.nextToken);i.consume(),i.consumeSpaces(),i.expect(`]`),i.consume(),r.cols=[{type:`align`,align:n}]}}var a=$j(e.parser,r,eM(e.envName)),o=Math.max(0,...a.body.map(e=>e.length));return a.cols=Array(o).fill({type:`align`,align:n}),t?{type:`leftright`,mode:e.mode,body:[a],left:t[0],right:t[1],rightColor:void 0}:a},htmlBuilder:tM,mathmlBuilder:rM}),Gj({type:`array`,names:[`smallmatrix`],props:{numArgs:0},handler(e){var t=$j(e.parser,{arraystretch:.5},`script`);return t.colSeparationType=`small`,t},htmlBuilder:tM,mathmlBuilder:rM}),Gj({type:`array`,names:[`subarray`],props:{numArgs:1},handler(e,t){var n=(WA(t[0])?[t[0]]:HA(t[0],`ordgroup`).body).map(function(e){var t=UA(e).text;if(`lc`.includes(t))return{type:`align`,align:t};throw new B(`Unknown column alignment: `+t,e)});if(n.length>1)throw new B(`{subarray} can contain only one column`);var r={cols:n,hskipBeforeAndAfter:!1,arraystretch:.5},i=$j(e.parser,r,`script`);if(i.body.length>0&&i.body[0].length>1)throw new B(`{subarray} can contain only one column`);return i},htmlBuilder:tM,mathmlBuilder:rM}),Gj({type:`array`,names:[`cases`,`dcases`,`rcases`,`drcases`],props:{numArgs:0},handler(e){var t=$j(e.parser,{arraystretch:1.2,cols:[{type:`align`,align:`l`,pregap:0,postgap:1},{type:`align`,align:`l`,pregap:0,postgap:0}]},eM(e.envName));return{type:`leftright`,mode:e.mode,body:[t],left:e.envName.includes(`r`)?`.`:`\\{`,right:e.envName.includes(`r`)?`\\}`:`.`,rightColor:void 0}},htmlBuilder:tM,mathmlBuilder:rM}),Gj({type:`array`,names:[`align`,`align*`,`aligned`,`split`],props:{numArgs:0},handler:iM,htmlBuilder:tM,mathmlBuilder:rM}),Gj({type:`array`,names:[`gathered`,`gather`,`gather*`],props:{numArgs:0},handler(e){Zj.has(e.envName)&&Xj(e);var t={cols:[{type:`align`,align:`c`}],addJot:!0,colSeparationType:`gather`,autoTag:Qj(e.envName),emptySingleRow:!0,leqno:e.parser.settings.leqno};return $j(e.parser,t,`display`)},htmlBuilder:tM,mathmlBuilder:rM}),Gj({type:`array`,names:[`alignat`,`alignat*`,`alignedat`],props:{numArgs:1},handler:iM,htmlBuilder:tM,mathmlBuilder:rM}),Gj({type:`array`,names:[`equation`,`equation*`],props:{numArgs:0},handler(e){Xj(e);var t={autoTag:Qj(e.envName),emptySingleRow:!0,singleRow:!0,maxNumCols:1,leqno:e.parser.settings.leqno};return $j(e.parser,t,`display`)},htmlBuilder:tM,mathmlBuilder:rM}),Gj({type:`array`,names:[`CD`],props:{numArgs:0},handler(e){return Xj(e),aj(e.parser)},htmlBuilder:tM,mathmlBuilder:rM}),$(`\\nonumber`,`\\gdef\\@eqnsw{0}`),$(`\\notag`,`\\nonumber`),Z({type:`text`,names:[`\\hline`,`\\hdashline`],numArgs:0,allowedInText:!0,allowedInMath:!0,handler(e,t){throw new B(e.funcName+` valid only within array environment`)}});var aM=Wj;Z({type:`environment`,names:[`\\begin`,`\\end`],numArgs:1,argTypes:[`text`],handler(e,t){var n=e.parser,r=e.funcName,i=t[0];if(i.type!==`ordgroup`)throw new B(`Invalid environment name`,i);var a=GA(i,`Environment name should contain only text characters and spaces`,!0);if(r===`\\begin`){if(!Object.prototype.hasOwnProperty.call(aM,a))throw new B(`No such environment: `+a,i);var o=aM[a],s=n.parseArguments(`\\begin{`+a+`}`,o),c=s.args,l=s.optArgs,u={mode:n.mode,envName:a,parser:n},d=o.handler(u,c,l);n.expect(`\\end`,!1);var f=n.nextToken,p=HA(n.parseFunction(),`environment`);if(p.name!==a)throw new B(`Mismatch: \\begin{`+a+`} matched by \\end{`+p.name+`}`,f);return d}return{type:`environment`,mode:n.mode,name:a,nameGroup:i}}});var oM=(e,t)=>{var n=e.font,r=t.withFont(n);return oA(e.body,r)},sM=(e,t)=>{var n=e.font,r=t.withFont(n);return xA(e.body,r)},cM={"\\Bbb":`\\mathbb`,"\\bold":`\\mathbf`,"\\frak":`\\mathfrak`};Z({type:`font`,names:[`\\mathrm`,`\\mathit`,`\\mathbf`,`\\mathnormal`,`\\mathsfit`,`\\mathbb`,`\\mathcal`,`\\mathfrak`,`\\mathscr`,`\\mathsf`,`\\mathtt`,`\\Bbb`,`\\bold`,`\\frak`],numArgs:1,allowedInArgument:!0,handler:(e,t)=>{var n=e.parser,r=e.funcName,i=Jk(t[0]),a=r in cM?cM[r]:r;return{type:`font`,mode:n.mode,font:a.slice(1),body:i}},htmlBuilder:oM,mathmlBuilder:sM}),Z({type:`mclass`,names:[`\\boldsymbol`,`\\bm`],numArgs:1,handler:(e,t)=>{var n=e.parser,r=t[0];return{type:`mclass`,mode:n.mode,mclass:$A(r),body:[{type:`font`,mode:n.mode,font:`boldsymbol`,body:r}],isCharacterBox:pD(r)}}}),Z({type:`font`,names:[`\\rm`,`\\sf`,`\\tt`,`\\bf`,`\\it`,`\\cal`],numArgs:0,allowedInText:!0,handler:(e,t)=>{var n=e.parser,r=e.funcName,i=e.breakOnTokenText,a=n.mode,o=n.parseExpression(!0,i);return{type:`font`,mode:a,font:`math`+r.slice(1),body:{type:`ordgroup`,mode:n.mode,body:o}}}});var lM=(e,t)=>{var n=t.style,r=n.fracNum(),i=n.fracDen(),a=t.havingStyle(r),o=oA(e.numer,a,t);if(e.continued){var s=8.5/t.fontMetrics().ptPerEm,c=3.5/t.fontMetrics().ptPerEm;o.height=o.height<s?s:o.height,o.depth=o.depth<c?c:o.depth}a=t.havingStyle(i);var l=oA(e.denom,a,t),u,d,f;e.hasBarLine?(e.barSize?(d=aO(e.barSize,t),u=Ok(`frac-line`,t,d)):u=Ok(`frac-line`,t),d=u.height,f=u.height):(u=null,d=0,f=t.fontMetrics().defaultRuleThickness);var p,m,h;n.size===ID.DISPLAY.size?(p=t.fontMetrics().num1,m=d>0?3*f:7*f,h=t.fontMetrics().denom1):(d>0?(p=t.fontMetrics().num2,m=f):(p=t.fontMetrics().num3,m=3*f),h=t.fontMetrics().denom2);var g;if(u){var _=t.fontMetrics().axisHeight;p-o.depth-(_+.5*d)<m&&(p+=m-(p-o.depth-(_+.5*d))),_-.5*d-(l.height-h)<m&&(h+=m-(_-.5*d-(l.height-h)));var v=-(_-.5*d);g=Nk({positionType:`individualShift`,children:[{type:`elem`,elem:l,shift:h},{type:`elem`,elem:u,shift:v},{type:`elem`,elem:o,shift:-p}]})}else{var y=p-o.depth-(l.height-h);y<m&&(p+=.5*(m-y),h+=.5*(m-y)),g=Nk({positionType:`individualShift`,children:[{type:`elem`,elem:l,shift:h},{type:`elem`,elem:o,shift:-p}]})}a=t.havingStyle(n),g.height*=a.sizeMultiplier/t.sizeMultiplier,g.depth*=a.sizeMultiplier/t.sizeMultiplier;var b=n.size===ID.DISPLAY.size?t.fontMetrics().delim1:n.size===ID.SCRIPTSCRIPT.size?t.havingStyle(ID.SCRIPT).fontMetrics().delim2:t.fontMetrics().delim2,x=e.leftDelim==null?aA(t,[`mopen`]):Lj(e.leftDelim,b,!0,t.havingStyle(n),e.mode,[`mopen`]),S=e.continued?X([]):e.rightDelim==null?aA(t,[`mclose`]):Lj(e.rightDelim,b,!0,t.havingStyle(n),e.mode,[`mclose`]);return X([`mord`].concat(a.sizingClasses(t)),[x,X([`mfrac`],[g]),S],t)},uM=(e,t)=>{var n=new Q(`mfrac`,[xA(e.numer,t),xA(e.denom,t)]);if(!e.hasBarLine)n.setAttribute(`linethickness`,`0px`);else if(e.barSize){var r=aO(e.barSize,t);n.setAttribute(`linethickness`,V(r))}if(e.leftDelim!=null||e.rightDelim!=null){var i=[];if(e.leftDelim!=null){var a=new Q(`mo`,[new uA(e.leftDelim.replace(`\\`,``))]);a.setAttribute(`fence`,`true`),i.push(a)}if(i.push(n),e.rightDelim!=null){var o=new Q(`mo`,[new uA(e.rightDelim.replace(`\\`,``))]);o.setAttribute(`fence`,`true`),i.push(o)}return hA(i)}return n},dM=(e,t)=>t?{type:`styling`,mode:e.mode,style:t,body:[e]}:e;Z({type:`genfrac`,names:[`\\cfrac`,`\\dfrac`,`\\frac`,`\\tfrac`,`\\dbinom`,`\\binom`,`\\tbinom`,`\\\\atopfrac`,`\\\\bracefrac`,`\\\\brackfrac`],numArgs:2,allowedInArgument:!0,handler:(e,t)=>{var n=e.parser,r=e.funcName,i=t[0],a=t[1],o,s=null,c=null;switch(r){case`\\cfrac`:case`\\dfrac`:case`\\frac`:case`\\tfrac`:o=!0;break;case`\\\\atopfrac`:o=!1;break;case`\\dbinom`:case`\\binom`:case`\\tbinom`:o=!1,s=`(`,c=`)`;break;case`\\\\bracefrac`:o=!1,s=`\\{`,c=`\\}`;break;case`\\\\brackfrac`:o=!1,s=`[`,c=`]`;break;default:throw Error(`Unrecognized genfrac command`)}var l=r===`\\cfrac`,u=null;return l||r.startsWith(`\\d`)?u=`display`:r.startsWith(`\\t`)&&(u=`text`),dM({type:`genfrac`,mode:n.mode,numer:i,denom:a,continued:l,hasBarLine:o,leftDelim:s,rightDelim:c,barSize:null},u)},htmlBuilder:lM,mathmlBuilder:uM}),Z({type:`infix`,names:[`\\over`,`\\choose`,`\\atop`,`\\brace`,`\\brack`],numArgs:0,infix:!0,handler(e){var t=e.parser,n=e.funcName,r=e.token,i;switch(n){case`\\over`:i=`\\frac`;break;case`\\choose`:i=`\\binom`;break;case`\\atop`:i=`\\\\atopfrac`;break;case`\\brace`:i=`\\\\bracefrac`;break;case`\\brack`:i=`\\\\brackfrac`;break;default:throw Error(`Unrecognized infix genfrac command`)}return{type:`infix`,mode:t.mode,replaceWith:i,token:r}}});var fM=[`display`,`text`,`script`,`scriptscript`],pM=function(e){var t=null;return e.length>0&&(t=e,t=t===`.`?null:t),t};Z({type:`genfrac`,names:[`\\genfrac`],numArgs:6,allowedInArgument:!0,argTypes:[`math`,`math`,`size`,`text`,`math`,`math`],handler(e,t){var n=e.parser,r=t[4],i=t[5],a=Jk(t[0]),o=a.type===`atom`&&a.family===`open`?pM(a.text):null,s=Jk(t[1]),c=s.type===`atom`&&s.family===`close`?pM(s.text):null,l=HA(t[2],`size`),u,d=null;l.isBlank?u=!0:(d=l.value,u=d.number>0);var f=null,p=t[3];if(p.type===`ordgroup`){if(p.body.length>0){var m=HA(p.body[0],`textord`);f=fM[Number(m.text)]}}else p=HA(p,`textord`),f=fM[Number(p.text)];return dM({type:`genfrac`,mode:n.mode,numer:r,denom:i,continued:!1,hasBarLine:u,barSize:d,leftDelim:o,rightDelim:c},f)}}),Z({type:`infix`,names:[`\\above`],numArgs:1,argTypes:[`size`],infix:!0,handler(e,t){var n=e.parser;e.funcName;var r=e.token;return{type:`infix`,mode:n.mode,replaceWith:`\\\\abovefrac`,size:HA(t[0],`size`).value,token:r}}}),Z({type:`genfrac`,names:[`\\\\abovefrac`],numArgs:3,argTypes:[`math`,`size`,`math`],handler:(e,t)=>{var n=e.parser;e.funcName;var r=t[0],i=HA(t[1],`infix`).size;if(!i)throw Error(`\\\\abovefrac expected size, but got `+String(i));var a=t[2],o=i.number>0;return{type:`genfrac`,mode:n.mode,numer:r,denom:a,continued:!1,hasBarLine:o,barSize:i,leftDelim:null,rightDelim:null}}});var mM=(e,t)=>{var n=t.style,r,i;e.type===`supsub`?(r=e.sup?oA(e.sup,t.havingStyle(n.sup()),t):oA(e.sub,t.havingStyle(n.sub()),t),i=HA(e.base,`horizBrace`)):i=HA(e,`horizBrace`);var a=oA(i.base,t.havingBaseStyle(ID.DISPLAY)),o=FA(i,t),s=i.isOver?Nk({positionType:`firstBaseline`,children:[{type:`elem`,elem:a},{type:`kern`,size:.1},{type:`elem`,elem:o,wrapperClasses:[`svg-align`]}]}):Nk({positionType:`bottom`,positionData:a.depth+.1+o.height,children:[{type:`elem`,elem:o,wrapperClasses:[`svg-align`]},{type:`kern`,size:.1},{type:`elem`,elem:a}]});if(r){var c=X([`minner`,i.isOver?`mover`:`munder`],[s],t);s=i.isOver?Nk({positionType:`firstBaseline`,children:[{type:`elem`,elem:c},{type:`kern`,size:.2},{type:`elem`,elem:r}]}):Nk({positionType:`bottom`,positionData:c.depth+.2+r.height+r.depth,children:[{type:`elem`,elem:r},{type:`kern`,size:.2},{type:`elem`,elem:c}]})}return X([`minner`,i.isOver?`mover`:`munder`],[s],t)};Z({type:`horizBrace`,names:[`\\overbrace`,`\\underbrace`,`\\overbracket`,`\\underbracket`],numArgs:1,handler(e,t){var n=e.parser,r=e.funcName;return{type:`horizBrace`,mode:n.mode,label:r,isOver:r.includes(`\\over`),base:t[0]}},htmlBuilder:mM,mathmlBuilder:(e,t)=>{var n=MA(e.label);return new Q(e.isOver?`mover`:`munder`,[xA(e.base,t),n])}}),Z({type:`href`,names:[`\\href`],numArgs:2,argTypes:[`url`,`original`],allowedInText:!0,handler:(e,t)=>{var n=e.parser,r=t[1],i=HA(t[0],`url`).url;return n.settings.isTrusted({command:`\\href`,url:i})?{type:`href`,mode:n.mode,href:i,body:Yk(r)}:n.formatUnsupportedCmd(`\\href`)},htmlBuilder:(e,t)=>{var n=eA(e.body,t,!1);return kk(e.href,[],n,t)},mathmlBuilder:(e,t)=>{var n=bA(e.body,t);return n instanceof Q||(n=new Q(`mrow`,[n])),n.setAttribute(`href`,e.href),n}}),Z({type:`href`,names:[`\\url`],numArgs:1,argTypes:[`url`],allowedInText:!0,handler:(e,t)=>{var n=e.parser,r=HA(t[0],`url`).url;if(!n.settings.isTrusted({command:`\\url`,url:r}))return n.formatUnsupportedCmd(`\\url`);for(var i=[],a=0;a<r.length;a++){var o=r[a];o===`~`&&(o=`\\textasciitilde`),i.push({type:`textord`,mode:`text`,text:o})}var s={type:`text`,mode:n.mode,font:`\\texttt`,body:i};return{type:`href`,mode:n.mode,href:r,body:Yk(s)}}}),Z({type:`hbox`,names:[`\\hbox`],numArgs:1,argTypes:[`text`],allowedInText:!0,primitive:!0,handler(e,t){return{type:`hbox`,mode:e.parser.mode,body:Yk(t[0])}},htmlBuilder(e,t){return Ak(eA(e.body,t.withFont(``),!1))},mathmlBuilder(e,t){return new Q(`mrow`,yA(e.body,t.withFont(``)))}}),Z({type:`html`,names:[`\\htmlClass`,`\\htmlId`,`\\htmlStyle`,`\\htmlData`],numArgs:2,argTypes:[`raw`,`original`],allowedInText:!0,handler:(e,t)=>{var n=e.parser,r=e.funcName;e.token;var i=HA(t[0],`raw`).string,a=t[1];n.settings.strict&&vk({strict:n.settings.strict,errorCode:`htmlExtension`,errorMsg:`HTML extension is disabled on strict mode`,report:!0});var o,s={};switch(r){case`\\htmlClass`:s.class=i,o={command:`\\htmlClass`,class:i};break;case`\\htmlId`:s.id=i,o={command:`\\htmlId`,id:i};break;case`\\htmlStyle`:s.style=i,o={command:`\\htmlStyle`,style:i};break;case`\\htmlData`:for(var c=`{,}`,l=[],u=``,d=0;d<i.length;d++)i.startsWith(c,d)?(u+=`,`,d+=c.length-1):i[d]===`,`?(l.push(u),u=``):u+=i[d];l.push(u);for(var f=0;f<l.length;f++){var p=l[f],m=p.indexOf(`=`);if(m<0)throw new B(`\\htmlData key/value '`+p+`' missing equals sign`);var h=p.slice(0,m),g=p.slice(m+1);s[`data-`+h.trim()]=g}o={command:`\\htmlData`,attributes:s};break;default:throw Error(`Unrecognized html command`)}return n.settings.isTrusted(o)?{type:`html`,mode:n.mode,attributes:s,body:Yk(a)}:n.formatUnsupportedCmd(r)},htmlBuilder:(e,t)=>{var n=eA(e.body,t,!1),r=[`enclosing`];e.attributes.class&&r.push(...e.attributes.class.trim().split(/\s+/));var i=X(r,n,t);for(var a of Object.entries(e.attributes)){var o=a[0],s=a[1];o!==`class`&&i.setAttribute(o,s)}return i},mathmlBuilder:(e,t)=>bA(e.body,t)}),Z({type:`htmlmathml`,names:[`\\html@mathml`],numArgs:2,allowedInArgument:!0,allowedInText:!0,handler:(e,t)=>({type:`htmlmathml`,mode:e.parser.mode,html:Yk(t[0]),mathml:Yk(t[1])}),htmlBuilder:(e,t)=>Ak(eA(e.html,t,!1)),mathmlBuilder:(e,t)=>bA(e.mathml,t)});var hM=function(e){if(/^[-+]? *(\d+(\.\d*)?|\.\d+)$/.test(e))return{number:+e,unit:`bp`};var t=/([-+]?) *(\d+(?:\.\d*)?|\.\d+) *([a-z]{2})/.exec(e);if(!t)throw new B(`Invalid size: '`+e+`' in \\includegraphics`);var n={number:+(t[1]+t[2]),unit:t[3]};if(!iO(n))throw new B(`Invalid unit: '`+n.unit+`' in \\includegraphics.`);return n};Z({type:`includegraphics`,names:[`\\includegraphics`],numArgs:1,numOptionalArgs:1,argTypes:[`raw`,`url`],allowedInText:!1,handler:(e,t,n)=>{var r=e.parser,i={number:0,unit:`em`},a={number:.9,unit:`em`},o={number:0,unit:`em`},s=``;if(n[0])for(var c=HA(n[0],`raw`).string.split(`,`),l=0;l<c.length;l++){var u=c[l].split(`=`);if(u.length===2){var d=u[1].trim();switch(u[0].trim()){case`alt`:s=d;break;case`width`:i=hM(d);break;case`height`:a=hM(d);break;case`totalheight`:o=hM(d);break;default:throw new B(`Invalid key: '`+u[0]+`' in \\includegraphics.`)}}}var f=HA(t[0],`url`).url;return s===``&&(s=f,s=s.replace(/^.*[\\/]/,``),s=s.substring(0,s.lastIndexOf(`.`))),r.settings.isTrusted({command:`\\includegraphics`,url:f})?{type:`includegraphics`,mode:r.mode,alt:s,width:i,height:a,totalheight:o,src:f}:r.formatUnsupportedCmd(`\\includegraphics`)},htmlBuilder:(e,t)=>{var n=aO(e.height,t),r=0;e.totalheight.number>0&&(r=aO(e.totalheight,t)-n);var i=0;e.width.number>0&&(i=aO(e.width,t));var a={height:V(n+r)};i>0&&(a.width=V(i)),r>0&&(a.verticalAlign=V(-r));var o=new mO(e.src,e.alt,a);return o.height=n,o.depth=r,o},mathmlBuilder:(e,t)=>{var n=new Q(`mglyph`,[]);n.setAttribute(`alt`,e.alt);var r=aO(e.height,t),i=0;if(e.totalheight.number>0&&(i=aO(e.totalheight,t)-r,n.setAttribute(`valign`,V(-i))),n.setAttribute(`height`,V(r+i)),e.width.number>0){var a=aO(e.width,t);n.setAttribute(`width`,V(a))}return n.setAttribute(`src`,e.src),n}}),Z({type:`kern`,names:[`\\kern`,`\\mkern`,`\\hskip`,`\\mskip`],numArgs:1,argTypes:[`size`],primitive:!0,allowedInText:!0,handler(e,t){var n=e.parser,r=e.funcName,i=HA(t[0],`size`);if(n.settings.strict){var a=r[1]===`m`,o=i.value.unit===`mu`;a?(o||vk({strict:n.settings.strict,errorCode:`mathVsTextUnits`,errorMsg:`LaTeX's `+r+` supports only mu units, `+(`not `+i.value.unit+` units`),report:!0}),n.mode!==`math`&&vk({strict:n.settings.strict,errorCode:`mathVsTextUnits`,errorMsg:`LaTeX's `+r+` works only in math mode`,report:!0})):o&&vk({strict:n.settings.strict,errorCode:`mathVsTextUnits`,errorMsg:`LaTeX's `+r+` doesn't support mu units`,report:!0})}return{type:`kern`,mode:n.mode,dimension:i.value}},htmlBuilder(e,t){return Pk(e.dimension,t)},mathmlBuilder(e,t){return new dA(aO(e.dimension,t))}}),Z({type:`lap`,names:[`\\mathllap`,`\\mathrlap`,`\\mathclap`],numArgs:1,allowedInText:!0,handler:(e,t)=>{var n=e.parser,r=e.funcName,i=t[0];return{type:`lap`,mode:n.mode,alignment:r.slice(5),body:i}},htmlBuilder:(e,t)=>{var n;e.alignment===`clap`?(n=X([],[oA(e.body,t)]),n=X([`katex-inner`],[n],t)):n=X([`katex-inner`],[oA(e.body,t)]);var r=X([`katex-fix`],[]),i=X([e.alignment],[n,r],t),a=X([`katex-strut`]);return a.style.height=V(i.height+i.depth),i.depth&&(a.style.verticalAlign=V(-i.depth)),i.children.unshift(a),i=X([`katex-thinbox`],[i],t),X([`mord`,`katex-vbox`],[i],t)},mathmlBuilder:(e,t)=>{var n=new Q(`mpadded`,[xA(e.body,t)]);if(e.alignment!==`rlap`){var r=e.alignment===`llap`?`-1`:`-0.5`;n.setAttribute(`lspace`,r+`width`)}return n.setAttribute(`width`,`0px`),n}}),Z({type:`styling`,names:[`\\(`,`$`],numArgs:0,allowedInText:!0,allowedInMath:!1,handler(e,t){var n=e.funcName,r=e.parser,i=r.mode;r.switchMode(`math`);var a=n===`\\(`?`\\)`:`$`,o=r.parseExpression(!1,a);return r.expect(a),r.switchMode(i),{type:`styling`,mode:r.mode,style:`text`,resetFont:!0,body:o}}}),Z({type:`text`,names:[`\\)`,`\\]`],numArgs:0,allowedInText:!0,allowedInMath:!1,handler(e,t){throw new B(`Mismatched `+e.funcName)}});var gM=(e,t)=>{switch(t.style.size){case ID.DISPLAY.size:return e.display;case ID.TEXT.size:return e.text;case ID.SCRIPT.size:return e.script;case ID.SCRIPTSCRIPT.size:return e.scriptscript;default:return e.text}};Z({type:`mathchoice`,names:[`\\mathchoice`],numArgs:4,primitive:!0,handler:(e,t)=>({type:`mathchoice`,mode:e.parser.mode,display:Yk(t[0]),text:Yk(t[1]),script:Yk(t[2]),scriptscript:Yk(t[3])}),htmlBuilder:(e,t)=>Ak(eA(gM(e,t),t,!1)),mathmlBuilder:(e,t)=>bA(gM(e,t),t)});var _M=(e,t,n,r,i,a,o)=>{e=X([],[e]);var s=n&&pD(n),c,l;if(t){var u=oA(t,r.havingStyle(i.sup()),r);l={elem:u,kern:Math.max(r.fontMetrics().bigOpSpacing1,r.fontMetrics().bigOpSpacing3-u.depth)}}if(n){var d=oA(n,r.havingStyle(i.sub()),r);c={elem:d,kern:Math.max(r.fontMetrics().bigOpSpacing2,r.fontMetrics().bigOpSpacing4-d.height)}}var f;if(l&&c)f=Nk({positionType:`bottom`,positionData:r.fontMetrics().bigOpSpacing5+c.elem.height+c.elem.depth+c.kern+e.depth+o,children:[{type:`kern`,size:r.fontMetrics().bigOpSpacing5},{type:`elem`,elem:c.elem,marginLeft:V(-a)},{type:`kern`,size:c.kern},{type:`elem`,elem:e},{type:`kern`,size:l.kern},{type:`elem`,elem:l.elem,marginLeft:V(a)},{type:`kern`,size:r.fontMetrics().bigOpSpacing5}]});else if(c)f=Nk({positionType:`top`,positionData:e.height-o,children:[{type:`kern`,size:r.fontMetrics().bigOpSpacing5},{type:`elem`,elem:c.elem,marginLeft:V(-a)},{type:`kern`,size:c.kern},{type:`elem`,elem:e}]});else if(l)f=Nk({positionType:`bottom`,positionData:e.depth+o,children:[{type:`elem`,elem:e},{type:`kern`,size:l.kern},{type:`elem`,elem:l.elem,marginLeft:V(a)},{type:`kern`,size:r.fontMetrics().bigOpSpacing5}]});else return e;var p=[f];if(c&&a!==0&&!s){var m=X([`mspace`],[],r);m.style.marginRight=V(a),p.unshift(m)}return X([`mop`,`op-limits`],p,r)},vM=new Set([`\\smallint`]),yM=(e,t)=>{var n,r,i=!1,a;e.type===`supsub`?(n=e.sup,r=e.sub,a=HA(e.base,`op`),i=!0):a=HA(e,`op`);var o=t.style,s=!1;o.size===ID.DISPLAY.size&&a.symbol&&!vM.has(a.name)&&(s=!0);var c,l;if(a.symbol){var u=s?`Size2-Regular`:`Size1-Regular`,d=``;if((a.name===`\\oiint`||a.name===`\\oiiint`)&&(d=a.name.slice(1),a.name=d===`oiint`?`\\iint`:`\\iiint`),c=bk(a.name,u,`math`,t,[`mop`,`op-symbol`,s?`large-op`:`small-op`]),l=c.italic,d.length>0){var f=Rk(d+`Size`+(s?`2`:`1`),t);c=Nk({positionType:`individualShift`,children:[{type:`elem`,elem:c,shift:0},{type:`elem`,elem:f,shift:s?.08:0}]}),a.name=`\\`+d,c.classes.unshift(`mop`),c.italic=l}}else if(a.body){var p=eA(a.body,t,!0);p.length===1&&p[0]instanceof gO?(c=p[0],c.classes[0]=`mop`):c=X([`mop`],p,t)}else{for(var m=[],h=1;h<a.name.length;h++)m.push(xk(a.name[h],a.mode,t));c=X([`mop`],m,t)}var g=0,_=0;return(c instanceof gO||a.name===`\\oiint`||a.name===`\\oiiint`)&&!a.suppressBaseShift&&(g=(c.height-c.depth)/2-t.fontMetrics().axisHeight,_=c.italic??0),i?_M(c,n,r,t,o,_,g):(g&&(c.style.position=`relative`,c.style.top=V(g)),c)},bM=(e,t)=>{var n;if(e.symbol)n=new Q(`mo`,[mA(e.name,e.mode)]),vM.has(e.name)&&n.setAttribute(`largeop`,`false`);else if(e.body)n=new Q(`mo`,yA(e.body,t));else{n=new Q(`mi`,[new uA(e.name.slice(1))]);var r=new Q(`mo`,[mA(`⁡`,`text`)]);n=e.parentIsSupSub?new Q(`mrow`,[n,r]):lA([n,r])}return n},xM={"∏":`\\prod`,"∐":`\\coprod`,"∑":`\\sum`,"⋀":`\\bigwedge`,"⋁":`\\bigvee`,"⋂":`\\bigcap`,"⋃":`\\bigcup`,"⨀":`\\bigodot`,"⨁":`\\bigoplus`,"⨂":`\\bigotimes`,"⨄":`\\biguplus`,"⨆":`\\bigsqcup`};Z({type:`op`,names:`\\coprod.\\bigvee.\\bigwedge.\\biguplus.\\bigcap.\\bigcup.\\intop.\\prod.\\sum.\\bigotimes.\\bigoplus.\\bigodot.\\bigsqcup.\\smallint.∏.∐.∑.⋀.⋁.⋂.⋃.⨀.⨁.⨂.⨄.⨆`.split(`.`),numArgs:0,handler:(e,t)=>{var n=e.parser,r=e.funcName;return r.length===1&&(r=xM[r]),{type:`op`,mode:n.mode,limits:!0,parentIsSupSub:!1,symbol:!0,name:r}},htmlBuilder:yM,mathmlBuilder:bM}),Z({type:`op`,names:[`\\mathop`],numArgs:1,primitive:!0,handler:(e,t)=>{var n=e.parser,r=t[0];return{type:`op`,mode:n.mode,limits:!1,parentIsSupSub:!1,symbol:!1,body:Yk(r)}}});var SM={"∫":`\\int`,"∬":`\\iint`,"∭":`\\iiint`,"∮":`\\oint`,"∯":`\\oiint`,"∰":`\\oiiint`};Z({type:`op`,names:`\\arcsin.\\arccos.\\arctan.\\arctg.\\arcctg.\\arg.\\ch.\\cos.\\cosec.\\cosh.\\cot.\\cotg.\\coth.\\csc.\\ctg.\\cth.\\deg.\\dim.\\exp.\\hom.\\ker.\\lg.\\ln.\\log.\\sec.\\sin.\\sinh.\\sh.\\tan.\\tanh.\\tg.\\th`.split(`.`),numArgs:0,handler(e){var t=e.parser,n=e.funcName;return{type:`op`,mode:t.mode,limits:!1,parentIsSupSub:!1,symbol:!1,name:n}}}),Z({type:`op`,names:[`\\det`,`\\gcd`,`\\inf`,`\\lim`,`\\max`,`\\min`,`\\Pr`,`\\sup`],numArgs:0,handler(e){var t=e.parser,n=e.funcName;return{type:`op`,mode:t.mode,limits:!0,parentIsSupSub:!1,symbol:!1,name:n}}}),Z({type:`op`,names:[`\\int`,`\\iint`,`\\iiint`,`\\oint`,`\\oiint`,`\\oiiint`,`∫`,`∬`,`∭`,`∮`,`∯`,`∰`],numArgs:0,allowedInArgument:!0,handler(e){var t=e.parser,n=e.funcName;return n.length===1&&(n=SM[n]),{type:`op`,mode:t.mode,limits:!1,parentIsSupSub:!1,symbol:!0,name:n}}});var CM=(e,t)=>{var n,r,i=!1,a;e.type===`supsub`?(n=e.sup,r=e.sub,a=HA(e.base,`operatorname`),i=!0):a=HA(e,`operatorname`);var o;if(a.body.length>0){for(var s=eA(a.body.map(e=>{var t=`text`in e?e.text:void 0;return typeof t==`string`?{type:`textord`,mode:e.mode,text:t}:e}),t.withFont(`mathrm`),!0),c=0;c<s.length;c++){var l=s[c];l instanceof gO&&(l.text=l.text.replace(/\u2212/,`-`).replace(/\u2217/,`*`))}o=X([`mop`],s,t)}else o=X([`mop`],[],t);return i?_M(o,n,r,t,t.style,0,0):o};Z({type:`operatorname`,names:[`\\operatorname@`,`\\operatornamewithlimits`],numArgs:1,handler:(e,t)=>{var n=e.parser,r=e.funcName,i=t[0];return{type:`operatorname`,mode:n.mode,body:Yk(i),alwaysHandleSupSub:r===`\\operatornamewithlimits`,limits:!1,parentIsSupSub:!1}},htmlBuilder:CM,mathmlBuilder:(e,t)=>{for(var n=yA(e.body,t.withFont(`mathrm`)),r=!0,i=0;i<n.length;i++){var a=n[i];if(!(a instanceof dA)){if(a instanceof Q)switch(a.type){case`mi`:case`mn`:case`mspace`:case`mtext`:break;case`mo`:var o=a.children[0];a.children.length===1&&o instanceof uA?o.text=o.text.replace(/\u2212/,`-`).replace(/\u2217/,`*`):r=!1;break;default:r=!1}else r=!1}}r&&(n=[new uA(n.map(e=>e.toText()).join(``))]);var s=new Q(`mi`,n);s.setAttribute(`mathvariant`,`normal`);var c=new Q(`mo`,[mA(`⁡`,`text`)]);return e.parentIsSupSub?new Q(`mrow`,[s,c]):lA([s,c])}}),$(`\\operatorname`,`\\@ifstar\\operatornamewithlimits\\operatorname@`),qk({type:`ordgroup`,htmlBuilder(e,t){return e.semisimple?Ak(eA(e.body,t,!1)):X([`mord`],eA(e.body,t,!0),t)},mathmlBuilder(e,t){return bA(e.body,t,!0)}}),Z({type:`overline`,names:[`\\overline`],numArgs:1,handler(e,t){var n=e.parser,r=t[0];return{type:`overline`,mode:n.mode,body:r}},htmlBuilder(e,t){var n=oA(e.body,t.havingCrampedStyle()),r=Ok(`overline-line`,t),i=t.fontMetrics().defaultRuleThickness;return X([`mord`,`katex-overline`],[Nk({positionType:`firstBaseline`,children:[{type:`elem`,elem:n},{type:`kern`,size:3*i},{type:`elem`,elem:r},{type:`kern`,size:i}]})],t)},mathmlBuilder(e,t){var n=new Q(`mo`,[new uA(`‾`)]);n.setAttribute(`stretchy`,`true`);var r=new Q(`mover`,[xA(e.body,t),n]);return r.setAttribute(`accent`,`true`),r}}),Z({type:`phantom`,names:[`\\phantom`],numArgs:1,allowedInText:!0,handler:(e,t)=>{var n=e.parser,r=t[0];return{type:`phantom`,mode:n.mode,body:Yk(r)}},htmlBuilder:(e,t)=>Ak(eA(e.body,t.withPhantom(),!1)),mathmlBuilder:(e,t)=>new Q(`mphantom`,yA(e.body,t))}),$(`\\hphantom`,`\\smash{\\phantom{#1}}`),Z({type:`vphantom`,names:[`\\vphantom`],numArgs:1,allowedInText:!0,handler:(e,t)=>{var n=e.parser,r=t[0];return{type:`vphantom`,mode:n.mode,body:r}},htmlBuilder:(e,t)=>X([`mord`,`rlap`],[X([`katex-inner`],[oA(e.body,t.withPhantom())]),X([`katex-fix`],[])],t),mathmlBuilder:(e,t)=>{var n=new Q(`mpadded`,[new Q(`mphantom`,yA(Yk(e.body),t))]);return n.setAttribute(`width`,`0px`),n}}),Z({type:`raisebox`,names:[`\\raisebox`],numArgs:2,argTypes:[`size`,`hbox`],allowedInText:!0,handler(e,t){var n=e.parser,r=HA(t[0],`size`).value,i=t[1];return{type:`raisebox`,mode:n.mode,dy:r,body:i}},htmlBuilder(e,t){var n=oA(e.body,t);return Nk({positionType:`shift`,positionData:-aO(e.dy,t),children:[{type:`elem`,elem:n}]})},mathmlBuilder(e,t){var n=new Q(`mpadded`,[xA(e.body,t)]),r=e.dy.number+e.dy.unit;return n.setAttribute(`voffset`,r),n}});var wM=(e,t)=>({type:`reflectbox`,mode:e.parser.mode,body:t[0]});Z({type:`reflectbox`,names:[`\\reflectbox`],numArgs:1,argTypes:[`hbox`],allowedInText:!0,handler:wM,htmlBuilder(e,t){return X([`mord`,`reflectbox`],[oA(e.body,t)],t)},mathmlBuilder(e,t){return xA(e.body,t)}}),Z({type:`reflectbox`,names:[`\\mathreflectbox`],numArgs:1,argTypes:[`math`],handler:wM}),Z({type:`internal`,names:[`\\relax`],numArgs:0,allowedInText:!0,allowedInArgument:!0,handler(e){return{type:`internal`,mode:e.parser.mode}}}),Z({type:`rule`,names:[`\\rule`],numArgs:2,numOptionalArgs:1,allowedInText:!0,allowedInMath:!0,argTypes:[`size`,`size`,`size`],handler(e,t,n){var r=e.parser,i=n[0],a=HA(t[0],`size`),o=HA(t[1],`size`);return{type:`rule`,mode:r.mode,shift:i&&HA(i,`size`).value,width:a.value,height:o.value}},htmlBuilder(e,t){var n=X([`mord`,`katex-rule`],[],t),r=aO(e.width,t),i=aO(e.height,t),a=e.shift?aO(e.shift,t):0;return n.style.borderRightWidth=V(r),n.style.borderTopWidth=V(i),n.style.bottom=V(a),n.width=r,n.height=i+a,n.depth=-a,n.maxFontSize=i*1.125*t.sizeMultiplier,n},mathmlBuilder(e,t){var n=aO(e.width,t),r=aO(e.height,t),i=e.shift?aO(e.shift,t):0,a=t.color&&t.getColor()||`black`,o=new Q(`mspace`);o.setAttribute(`mathbackground`,a),o.setAttribute(`width`,V(n)),o.setAttribute(`height`,V(r));var s=new Q(`mpadded`,[o]);return i>=0?s.setAttribute(`height`,V(i)):(s.setAttribute(`height`,V(i)),s.setAttribute(`depth`,V(-i))),s.setAttribute(`voffset`,V(i)),s}});function TM(e,t,n){for(var r=eA(e,t,!1),i=t.sizeMultiplier/n.sizeMultiplier,a=0;a<r.length;a++){var o=r[a].classes.indexOf(`katex-sizing`);o<0?Array.prototype.push.apply(r[a].classes,t.sizingClasses(n)):r[a].classes[o+1]===`reset-size`+t.size&&(r[a].classes[o+1]=`reset-size`+n.size),r[a].height*=i,r[a].depth*=i}return Ak(r)}var EM=[`\\tiny`,`\\sixptsize`,`\\scriptsize`,`\\footnotesize`,`\\small`,`\\normalsize`,`\\large`,`\\Large`,`\\LARGE`,`\\huge`,`\\Huge`];Z({type:`sizing`,names:EM,numArgs:0,allowedInText:!0,handler:(e,t)=>{var n=e.breakOnTokenText,r=e.funcName,i=e.parser,a=i.parseExpression(!1,n);return{type:`sizing`,mode:i.mode,size:EM.indexOf(r)+1,body:a}},htmlBuilder:(e,t)=>{var n=t.havingSize(e.size);return TM(e.body,n,t)},mathmlBuilder:(e,t)=>{var n=t.havingSize(e.size),r=new Q(`mstyle`,yA(e.body,n));return r.setAttribute(`mathsize`,V(n.sizeMultiplier)),r}}),Z({type:`smash`,names:[`\\smash`],numArgs:1,numOptionalArgs:1,allowedInText:!0,handler:(e,t,n)=>{var r=e.parser,i=!1,a=!1,o=n[0]&&HA(n[0],`ordgroup`);if(o)for(var s,c=0;c<o.body.length;++c){var l=o.body[c];if(s=UA(l).text,s===`t`)i=!0;else if(s===`b`)a=!0;else{i=!1,a=!1;break}}else i=!0,a=!0;var u=t[0];return{type:`smash`,mode:r.mode,body:u,smashHeight:i,smashDepth:a}},htmlBuilder:(e,t)=>{var n=X([],[oA(e.body,t)]);if(!e.smashHeight&&!e.smashDepth)return n;if(e.smashHeight&&(n.height=0),e.smashDepth&&(n.depth=0),e.smashHeight&&e.smashDepth)return X([`mord`,`katex-smash`],[n],t);if(n.children)for(var r=0;r<n.children.length;r++)e.smashHeight&&(n.children[r].height=0),e.smashDepth&&(n.children[r].depth=0);return X([`mord`],[Nk({positionType:`firstBaseline`,children:[{type:`elem`,elem:n}]})],t)},mathmlBuilder:(e,t)=>{var n=new Q(`mpadded`,[xA(e.body,t)]);return e.smashHeight&&n.setAttribute(`height`,`0px`),e.smashDepth&&n.setAttribute(`depth`,`0px`),n}}),Z({type:`sqrt`,names:[`\\sqrt`],numArgs:1,numOptionalArgs:1,handler(e,t,n){var r=e.parser,i=n[0],a=t[0];return{type:`sqrt`,mode:r.mode,body:a,index:i}},htmlBuilder(e,t){var n=oA(e.body,t.havingCrampedStyle());n.height===0&&(n.height=t.fontMetrics().xHeight),n=jk(n,t);var r=t.fontMetrics().defaultRuleThickness,i=r;t.style.id<ID.TEXT.id&&(i=t.fontMetrics().xHeight);var a=r+i/4,o=Ej(n.height+n.depth+a+r,t),s=o.span,c=o.ruleWidth,l=o.advanceWidth,u=s.height-c;u>n.height+n.depth+a&&(a=(a+u-n.height-n.depth)/2);var d=s.height-n.height-a-c;n.style.paddingLeft=V(l);var f=Nk({positionType:`firstBaseline`,children:[{type:`elem`,elem:n,wrapperClasses:[`svg-align`]},{type:`kern`,size:-(n.height+d)},{type:`elem`,elem:s},{type:`kern`,size:c}]});if(e.index){var p=t.havingStyle(ID.SCRIPTSCRIPT),m=oA(e.index,p,t);return X([`mord`,`sqrt`],[X([`katex-root`],[Nk({positionType:`shift`,positionData:-(.6*(f.height-f.depth)),children:[{type:`elem`,elem:m}]})]),f],t)}return X([`mord`,`sqrt`],[f],t)},mathmlBuilder(e,t){var n=e.body,r=e.index;return r?new Q(`mroot`,[xA(n,t),xA(r,t)]):new Q(`msqrt`,[xA(n,t)])}});var DM={display:ID.DISPLAY,text:ID.TEXT,script:ID.SCRIPT,scriptscript:ID.SCRIPTSCRIPT};function OM(e){return e in DM}Z({type:`styling`,names:[`\\displaystyle`,`\\textstyle`,`\\scriptstyle`,`\\scriptscriptstyle`],numArgs:0,allowedInText:!0,primitive:!0,handler(e,t){var n=e.breakOnTokenText,r=e.funcName,i=e.parser,a=i.parseExpression(!0,n),o=r.slice(1,r.length-5);if(!OM(o))throw Error(`Unknown style: `+o);return{type:`styling`,mode:i.mode,style:o,body:a}},htmlBuilder(e,t){var n=DM[e.style],r=t.havingStyle(n);return e.resetFont&&(r=r.withFont(``)),TM(e.body,r,t)},mathmlBuilder(e,t){var n=DM[e.style],r=t.havingStyle(n);e.resetFont&&(r=r.withFont(``));var i=new Q(`mstyle`,yA(e.body,r)),a={display:[`0`,`true`],text:[`0`,`false`],script:[`1`,`false`],scriptscript:[`2`,`false`]}[e.style];return i.setAttribute(`scriptlevel`,a[0]),i.setAttribute(`displaystyle`,a[1]),i}});var kM=function(e,t){var n=e.base;return n?n.type===`op`?n.limits&&(t.style.size===ID.DISPLAY.size||n.alwaysHandleSupSub)?yM:null:n.type===`operatorname`?n.alwaysHandleSupSub&&(t.style.size===ID.DISPLAY.size||n.limits)?CM:null:n.type===`accent`?pD(n.base)?qA:null:n.type===`horizBrace`&&!e.sub===n.isOver?mM:null:null};qk({type:`supsub`,htmlBuilder(e,t){var n=kM(e,t);if(n)return n(e,t);var r=e.base,i=e.sup,a=e.sub,o=oA(r,t),s,c,l=t.fontMetrics(),u=0,d=0,f=r&&pD(r);if(i){var p=t.havingStyle(t.style.sup());s=oA(i,p,t),f||(u=o.height-p.fontMetrics().supDrop*p.sizeMultiplier/t.sizeMultiplier)}if(a){var m=t.havingStyle(t.style.sub());c=oA(a,m,t),f||(d=o.depth+m.fontMetrics().subDrop*m.sizeMultiplier/t.sizeMultiplier)}var h=t.style===ID.DISPLAY?l.sup1:t.style.cramped?l.sup3:l.sup2,g=t.sizeMultiplier,_=V(.5/l.ptPerEm/g),v=null;if(c){var y=e.base&&e.base.type===`op`&&e.base.name&&(e.base.name===`\\oiint`||e.base.name===`\\oiiint`);(o instanceof gO||y)&&(v=V(-(o.italic??0)))}var b;if(s&&c){u=Math.max(u,h,s.depth+.25*l.xHeight),d=Math.max(d,l.sub2);var x=4*l.defaultRuleThickness;if(u-s.depth-(c.height-d)<x){d=x-(u-s.depth)+c.height;var S=.8*l.xHeight-(u-s.depth);S>0&&(u+=S,d-=S)}b=Nk({positionType:`individualShift`,children:[{type:`elem`,elem:c,shift:d,marginRight:_,marginLeft:v},{type:`elem`,elem:s,shift:-u,marginRight:_}]})}else if(c)d=Math.max(d,l.sub1,c.height-.8*l.xHeight),b=Nk({positionType:`shift`,positionData:d,children:[{type:`elem`,elem:c,marginLeft:v,marginRight:_}]});else if(s)u=Math.max(u,h,s.depth+.25*l.xHeight),b=Nk({positionType:`shift`,positionData:-u,children:[{type:`elem`,elem:s,marginRight:_}]});else throw Error(`supsub must have either sup or sub.`);return X([iA(o,`right`)||`mord`],[o,X([`msupsub`],[b])],t)},mathmlBuilder(e,t){var n=!1,r,i;e.base&&e.base.type===`horizBrace`&&(i=!!e.sup,i===e.base.isOver&&(n=!0,r=e.base.isOver)),e.base&&(e.base.type===`op`||e.base.type===`operatorname`)&&(e.base.parentIsSupSub=!0);var a=[xA(e.base,t)];e.sub&&a.push(xA(e.sub,t)),e.sup&&a.push(xA(e.sup,t));var o;if(n)o=r?`mover`:`munder`;else if(!e.sub){var s=e.base;o=s&&s.type===`op`&&s.limits&&(t.style===ID.DISPLAY||s.alwaysHandleSupSub)||s&&s.type===`operatorname`&&s.alwaysHandleSupSub&&(s.limits||t.style===ID.DISPLAY)?`mover`:`msup`}else if(e.sup){var c=e.base;o=c&&c.type===`op`&&c.limits&&t.style===ID.DISPLAY||c&&c.type===`operatorname`&&c.alwaysHandleSupSub&&(t.style===ID.DISPLAY||c.limits)?`munderover`:`msubsup`}else{var l=e.base;o=l&&l.type===`op`&&l.limits&&(t.style===ID.DISPLAY||l.alwaysHandleSupSub)||l&&l.type===`operatorname`&&l.alwaysHandleSupSub&&(l.limits||t.style===ID.DISPLAY)?`munder`:`msub`}return new Q(o,a)}}),qk({type:`atom`,htmlBuilder(e,t){return xk(e.text,e.mode,t,[`m`+e.family])},mathmlBuilder(e,t){var n=new Q(`mo`,[mA(e.text,e.mode)]);if(e.family===`bin`){var r=_A(e,t);r===`bold-italic`&&n.setAttribute(`mathvariant`,r)}else e.family===`punct`?n.setAttribute(`separator`,`true`):(e.family===`open`||e.family===`close`)&&n.setAttribute(`stretchy`,`false`);return n}});var AM={mi:`italic`,mn:`normal`,mtext:`normal`};qk({type:`mathord`,htmlBuilder(e,t){return Ck(e,t)},mathmlBuilder(e,t){var n=new Q(`mi`,[mA(e.text,e.mode,t)]),r=_A(e,t)||`italic`;return r!==AM[n.type]&&n.setAttribute(`mathvariant`,r),n}}),qk({type:`textord`,htmlBuilder(e,t){return Ck(e,t)},mathmlBuilder(e,t){var n=mA(e.text,e.mode,t),r=_A(e,t)||`normal`,i=e.mode===`text`?new Q(`mtext`,[n]):/[0-9]/.test(e.text)?new Q(`mn`,[n]):e.text===`\\prime`?new Q(`mo`,[n]):new Q(`mi`,[n]);return r!==AM[i.type]&&i.setAttribute(`mathvariant`,r),i}});var jM=new Map([[`\\nobreak`,`nobreak`],[`\\allowbreak`,`allowbreak`]]),MM=new Map([[` `,{}],[`\\ `,{}],[`~`,{className:`nobreak`}],[`\\space`,{}],[`\\nobreakspace`,{className:`nobreak`}]]);qk({type:`spacing`,htmlBuilder(e,t){var n=MM.get(e.text),r=jM.get(e.text);if(n){var i=n.className||``;if(e.mode===`text`){var a=Ck(e,t);return a.classes.push(i),a}return X([`mspace`,i],[xk(e.text,e.mode,t)],t)}if(r)return X([`mspace`,r],[],t);throw new B(`Unknown type of space "`+e.text+`"`)},mathmlBuilder(e,t){var n;if(MM.has(e.text))n=new Q(`mtext`,[new uA(`\xA0`)]);else if(jM.has(e.text))return new Q(`mspace`);else throw new B(`Unknown type of space "`+e.text+`"`);return n}});var NM=()=>{var e=new Q(`mtd`,[]);return e.setAttribute(`width`,`50%`),e};qk({type:`tag`,mathmlBuilder(e,t){var n=new Q(`mtable`,[new Q(`mtr`,[NM(),new Q(`mtd`,[bA(e.body,t)]),NM(),new Q(`mtd`,[bA(e.tag,t)])])]);return n.setAttribute(`width`,`100%`),n}});var PM={"\\text":void 0,"\\textrm":`textrm`,"\\textsf":`textsf`,"\\texttt":`texttt`,"\\textnormal":`textrm`},FM={"\\textbf":`textbf`,"\\textmd":`textmd`},IM={"\\textit":`textit`,"\\textup":`textup`},LM=(e,t)=>{var n=e.font;return n?PM[n]?t.withTextFontFamily(PM[n]):FM[n]?t.withTextFontWeight(FM[n]):n===`\\emph`?t.fontShape===`textit`?t.withTextFontShape(`textup`):t.withTextFontShape(`textit`):t.withTextFontShape(IM[n]):t};Z({type:`text`,names:[`\\text`,`\\textrm`,`\\textsf`,`\\texttt`,`\\textnormal`,`\\textbf`,`\\textmd`,`\\textit`,`\\textup`,`\\emph`],numArgs:1,argTypes:[`text`],allowedInArgument:!0,allowedInText:!0,handler(e,t){var n=e.parser,r=e.funcName,i=t[0];return{type:`text`,mode:n.mode,body:Yk(i),font:r}},htmlBuilder(e,t){var n=LM(e,t);return X([`mord`,`text`],eA(e.body,n,!0),n)},mathmlBuilder(e,t){var n=LM(e,t);return bA(e.body,n)}}),Z({type:`underline`,names:[`\\underline`],numArgs:1,allowedInText:!0,handler(e,t){return{type:`underline`,mode:e.parser.mode,body:t[0]}},htmlBuilder(e,t){var n=oA(e.body,t),r=Ok(`underline-line`,t),i=t.fontMetrics().defaultRuleThickness;return X([`mord`,`katex-underline`],[Nk({positionType:`top`,positionData:n.height,children:[{type:`kern`,size:i},{type:`elem`,elem:r},{type:`kern`,size:3*i},{type:`elem`,elem:n}]})],t)},mathmlBuilder(e,t){var n=new Q(`mo`,[new uA(`‾`)]);n.setAttribute(`stretchy`,`true`);var r=new Q(`munder`,[xA(e.body,t),n]);return r.setAttribute(`accentunder`,`true`),r}}),Z({type:`vcenter`,names:[`\\vcenter`],numArgs:1,argTypes:[`original`],allowedInText:!1,handler(e,t){return{type:`vcenter`,mode:e.parser.mode,body:t[0]}},htmlBuilder(e,t){var n=oA(e.body,t),r=t.fontMetrics().axisHeight;return Nk({positionType:`shift`,positionData:.5*(n.height-r-(n.depth+r)),children:[{type:`elem`,elem:n}]})},mathmlBuilder(e,t){return new Q(`mrow`,[new Q(`mpadded`,[xA(e.body,t)],[`vcenter`])])}}),Z({type:`verb`,names:[`\\verb`],numArgs:0,allowedInText:!0,handler(e,t,n){throw new B(`\\verb ended by end of line instead of matching delimiter`)},htmlBuilder(e,t){for(var n=RM(e),r=[],i=t.havingStyle(t.style.text()),a=0;a<n.length;a++){var o=n[a];o===`~`&&(o=`\\textasciitilde`),r.push(bk(o,`Typewriter-Regular`,e.mode,i,[`mord`,`texttt`]))}return X([`mord`,`text`].concat(i.sizingClasses(t)),Tk(r),i)},mathmlBuilder(e,t){var n=new Q(`mtext`,[new uA(RM(e))]);return n.setAttribute(`mathvariant`,`monospace`),n}});var RM=e=>e.body.replace(/ /g,e.star?`␣`:`\xA0`),zM=Wk,BM=`[ \r
396
- ]`,VM=`\\\\[a-zA-Z@]+`,HM=`\\\\[^\ud800-\udfff]`,UM=`(`+VM+`)`+BM+`*`,WM=`\\\\(
394
+ -470,-1265c-4.7,-6,-9.7,-11.7,-15,-17c-0.7,-0.7,-6.7,-1,-18,-1z`;default:throw Error(`Unknown stretchy delimiter.`)}};function tO(e){return`toText`in e}var nO=class{constructor(e){this.children=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,this.children=e,this.classes=[],this.height=0,this.depth=0,this.maxFontSize=0,this.style={}}hasClass(e){return this.classes.includes(e)}toNode(){for(var e=document.createDocumentFragment(),t=0;t<this.children.length;t++)e.appendChild(this.children[t].toNode());return e}toMarkup(){for(var e=``,t=0;t<this.children.length;t++)e+=this.children[t].toMarkup();return e}toText(){return this.children.map(e=>{if(tO(e))return e.toText();throw Error(`Expected MathDomNode with toText, got `+e.constructor.name)}).join(``)}},rO={pt:1,mm:7227/2540,cm:7227/254,in:72.27,bp:803/800,pc:12,dd:1238/1157,cc:14856/1157,nd:685/642,nc:1370/107,sp:1/65536,px:803/800},iO={ex:!0,em:!0,mu:!0},aO=function(e){return typeof e!=`string`&&(e=e.unit),e in rO||e in iO||e===`ex`},oO=function(e,t){var n;if(e.unit in rO)n=rO[e.unit]/t.fontMetrics().ptPerEm/t.sizeMultiplier;else if(e.unit===`mu`)n=t.fontMetrics().cssEmPerMu;else{var r=t.style.isTight()?t.havingStyle(t.style.text()):t;if(e.unit===`ex`)n=r.fontMetrics().xHeight;else if(e.unit===`em`)n=r.fontMetrics().quad;else throw new B(`Invalid unit: '`+e.unit+`'`);r!==t&&(n*=r.sizeMultiplier/t.sizeMultiplier)}return Math.min(e.number*n,t.maxSize)},V=function(e){return+e.toFixed(4)+`em`},sO=function(e){return e.filter(e=>e).join(` `)},cO=function(e){var t=``;for(var n of Object.keys(e)){var r=e[n];r!==void 0&&(t+=cD(n)+`:`+r+`;`)}return t},lO=function(e,t,n){if(this.classes=e||[],this.attributes={},this.height=0,this.depth=0,this.maxFontSize=0,this.style=n||{},t){t.style.isTight()&&this.classes.push(`mtight`);var r=t.getColor();r&&(this.style.color=r)}},uO=function(e){var t=document.createElement(e);t.className=sO(this.classes),Object.assign(t.style,this.style);for(var n of Object.keys(this.attributes))t.setAttribute(n,this.attributes[n]);for(var r=0;r<this.children.length;r++)t.appendChild(this.children[r].toNode());return t},dO=/[\s"'>/=\x00-\x1f]/,fO=function(e){var t=`<`+e;this.classes.length&&(t+=` class="`+dD(sO(this.classes))+`"`);var n=cO(this.style);n&&(t+=` style="`+dD(n)+`"`);for(var r of Object.keys(this.attributes)){if(dO.test(r))throw new B(`Invalid attribute name '`+r+`'`);t+=` `+r+`="`+dD(this.attributes[r])+`"`}t+=`>`;for(var i=0;i<this.children.length;i++)t+=this.children[i].toMarkup();return t+=`</`+e+`>`,t},pO=class{constructor(e,t,n,r){this.children=void 0,this.attributes=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.width=void 0,this.maxFontSize=void 0,this.style=void 0,this.italic=void 0,lO.call(this,e,n,r),this.children=t||[]}setAttribute(e,t){this.attributes[e]=t}hasClass(e){return this.classes.includes(e)}toNode(){return uO.call(this,`span`)}toMarkup(){return fO.call(this,`span`)}},mO=class{constructor(e,t,n,r){this.children=void 0,this.attributes=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,lO.call(this,t,r),this.children=n||[],this.setAttribute(`href`,e)}setAttribute(e,t){this.attributes[e]=t}hasClass(e){return this.classes.includes(e)}toNode(){return uO.call(this,`a`)}toMarkup(){return fO.call(this,`a`)}},hO=class{constructor(e,t,n){this.src=void 0,this.alt=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,this.alt=t,this.src=e,this.classes=[`mord`],this.height=0,this.depth=0,this.maxFontSize=0,this.style=n}hasClass(e){return this.classes.includes(e)}toNode(){var e=document.createElement(`img`);return e.src=this.src,e.alt=this.alt,e.className=`mord`,Object.assign(e.style,this.style),e}toMarkup(){var e=`<img src="`+dD(this.src)+`"`+(` alt="`+dD(this.alt)+`"`),t=cO(this.style);return t&&(e+=` style="`+dD(t)+`"`),e+=`'/>`,e}},gO={î:`ı̂`,ï:`ı̈`,í:`ı́`,ì:`ı̀`},_O=class{constructor(e,t,n,r,i,a,o,s){this.text=void 0,this.height=void 0,this.depth=void 0,this.italic=void 0,this.skew=void 0,this.width=void 0,this.maxFontSize=void 0,this.classes=void 0,this.style=void 0,this.text=e,this.height=t||0,this.depth=n||0,this.italic=r||0,this.skew=i||0,this.width=a||0,this.classes=o||[],this.style=s||{},this.maxFontSize=0;var c=zD(this.text.charCodeAt(0));c&&this.classes.push(c+`_fallback`),/[îïíì]/.test(this.text)&&(this.text=gO[this.text])}hasClass(e){return this.classes.includes(e)}toNode(){var e=document.createTextNode(this.text),t=null;return this.italic>0&&(t=document.createElement(`span`),t.style.marginRight=V(this.italic)),this.classes.length>0&&(t||=document.createElement(`span`),t.className=sO(this.classes)),Object.keys(this.style).length>0&&(t||=document.createElement(`span`),Object.assign(t.style,this.style)),t?(t.appendChild(e),t):e}toMarkup(){var e=!1,t=`<span`;this.classes.length&&(e=!0,t+=` class="`,t+=dD(sO(this.classes)),t+=`"`);var n=``;this.italic>0&&(n+=`margin-right:`+V(this.italic)+`;`),n+=cO(this.style),n&&(e=!0,t+=` style="`+dD(n)+`"`);var r=dD(this.text);return e?(t+=`>`,t+=r,t+=`</span>`,t):r}},vO=class{constructor(e,t){this.children=void 0,this.attributes=void 0,this.children=e||[],this.attributes=t||{}}toNode(){var e=document.createElementNS(`http://www.w3.org/2000/svg`,`svg`);for(var t of Object.keys(this.attributes))e.setAttribute(t,this.attributes[t]);for(var n=0;n<this.children.length;n++)e.appendChild(this.children[n].toNode());return e}toMarkup(){var e=`<svg xmlns="http://www.w3.org/2000/svg"`;for(var t of Object.keys(this.attributes))e+=` `+t+`="`+dD(this.attributes[t])+`"`;e+=`>`;for(var n=0;n<this.children.length;n++)e+=this.children[n].toMarkup();return e+=`</svg>`,e}},yO=class{constructor(e,t){this.pathName=void 0,this.alternate=void 0,this.pathName=e,this.alternate=t}toNode(){var e=document.createElementNS(`http://www.w3.org/2000/svg`,`path`);return this.alternate?e.setAttribute(`d`,this.alternate):e.setAttribute(`d`,$D[this.pathName]),e}toMarkup(){return this.alternate?`<path d="`+dD(this.alternate)+`"/>`:`<path d="`+dD($D[this.pathName])+`"/>`}},bO=class{constructor(e){this.attributes=void 0,this.attributes=e||{}}toNode(){var e=document.createElementNS(`http://www.w3.org/2000/svg`,`line`);for(var t of Object.keys(this.attributes))e.setAttribute(t,this.attributes[t]);return e}toMarkup(){var e=`<line`;for(var t of Object.keys(this.attributes))e+=` `+t+`="`+dD(this.attributes[t])+`"`;return e+=`/>`,e}};function xO(e){if(e instanceof _O)return e;throw Error(`Expected symbolNode but got `+String(e)+`.`)}function SO(e){if(e instanceof pO)return e;throw Error(`Expected span<HtmlDomNode> but got `+String(e)+`.`)}var CO=e=>e instanceof pO||e instanceof mO||e instanceof nO,wO={"AMS-Regular":{32:[0,0,0,0,.25],65:[0,.68889,0,0,.72222],66:[0,.68889,0,0,.66667],67:[0,.68889,0,0,.72222],68:[0,.68889,0,0,.72222],69:[0,.68889,0,0,.66667],70:[0,.68889,0,0,.61111],71:[0,.68889,0,0,.77778],72:[0,.68889,0,0,.77778],73:[0,.68889,0,0,.38889],74:[.16667,.68889,0,0,.5],75:[0,.68889,0,0,.77778],76:[0,.68889,0,0,.66667],77:[0,.68889,0,0,.94445],78:[0,.68889,0,0,.72222],79:[.16667,.68889,0,0,.77778],80:[0,.68889,0,0,.61111],81:[.16667,.68889,0,0,.77778],82:[0,.68889,0,0,.72222],83:[0,.68889,0,0,.55556],84:[0,.68889,0,0,.66667],85:[0,.68889,0,0,.72222],86:[0,.68889,0,0,.72222],87:[0,.68889,0,0,1],88:[0,.68889,0,0,.72222],89:[0,.68889,0,0,.72222],90:[0,.68889,0,0,.66667],107:[0,.68889,0,0,.55556],160:[0,0,0,0,.25],165:[0,.675,.025,0,.75],174:[.15559,.69224,0,0,.94666],240:[0,.68889,0,0,.55556],295:[0,.68889,0,0,.54028],710:[0,.825,0,0,2.33334],732:[0,.9,0,0,2.33334],770:[0,.825,0,0,2.33334],771:[0,.9,0,0,2.33334],989:[.08167,.58167,0,0,.77778],1008:[0,.43056,.04028,0,.66667],8245:[0,.54986,0,0,.275],8463:[0,.68889,0,0,.54028],8487:[0,.68889,0,0,.72222],8498:[0,.68889,0,0,.55556],8502:[0,.68889,0,0,.66667],8503:[0,.68889,0,0,.44445],8504:[0,.68889,0,0,.66667],8513:[0,.68889,0,0,.63889],8592:[-.03598,.46402,0,0,.5],8594:[-.03598,.46402,0,0,.5],8602:[-.13313,.36687,0,0,1],8603:[-.13313,.36687,0,0,1],8606:[.01354,.52239,0,0,1],8608:[.01354,.52239,0,0,1],8610:[.01354,.52239,0,0,1.11111],8611:[.01354,.52239,0,0,1.11111],8619:[0,.54986,0,0,1],8620:[0,.54986,0,0,1],8621:[-.13313,.37788,0,0,1.38889],8622:[-.13313,.36687,0,0,1],8624:[0,.69224,0,0,.5],8625:[0,.69224,0,0,.5],8630:[0,.43056,0,0,1],8631:[0,.43056,0,0,1],8634:[.08198,.58198,0,0,.77778],8635:[.08198,.58198,0,0,.77778],8638:[.19444,.69224,0,0,.41667],8639:[.19444,.69224,0,0,.41667],8642:[.19444,.69224,0,0,.41667],8643:[.19444,.69224,0,0,.41667],8644:[.1808,.675,0,0,1],8646:[.1808,.675,0,0,1],8647:[.1808,.675,0,0,1],8648:[.19444,.69224,0,0,.83334],8649:[.1808,.675,0,0,1],8650:[.19444,.69224,0,0,.83334],8651:[.01354,.52239,0,0,1],8652:[.01354,.52239,0,0,1],8653:[-.13313,.36687,0,0,1],8654:[-.13313,.36687,0,0,1],8655:[-.13313,.36687,0,0,1],8666:[.13667,.63667,0,0,1],8667:[.13667,.63667,0,0,1],8669:[-.13313,.37788,0,0,1],8672:[-.064,.437,0,0,1.334],8674:[-.064,.437,0,0,1.334],8705:[0,.825,0,0,.5],8708:[0,.68889,0,0,.55556],8709:[.08167,.58167,0,0,.77778],8717:[0,.43056,0,0,.42917],8722:[-.03598,.46402,0,0,.5],8724:[.08198,.69224,0,0,.77778],8726:[.08167,.58167,0,0,.77778],8733:[0,.69224,0,0,.77778],8736:[0,.69224,0,0,.72222],8737:[0,.69224,0,0,.72222],8738:[.03517,.52239,0,0,.72222],8739:[.08167,.58167,0,0,.22222],8740:[.25142,.74111,0,0,.27778],8741:[.08167,.58167,0,0,.38889],8742:[.25142,.74111,0,0,.5],8756:[0,.69224,0,0,.66667],8757:[0,.69224,0,0,.66667],8764:[-.13313,.36687,0,0,.77778],8765:[-.13313,.37788,0,0,.77778],8769:[-.13313,.36687,0,0,.77778],8770:[-.03625,.46375,0,0,.77778],8774:[.30274,.79383,0,0,.77778],8776:[-.01688,.48312,0,0,.77778],8778:[.08167,.58167,0,0,.77778],8782:[.06062,.54986,0,0,.77778],8783:[.06062,.54986,0,0,.77778],8785:[.08198,.58198,0,0,.77778],8786:[.08198,.58198,0,0,.77778],8787:[.08198,.58198,0,0,.77778],8790:[0,.69224,0,0,.77778],8791:[.22958,.72958,0,0,.77778],8796:[.08198,.91667,0,0,.77778],8806:[.25583,.75583,0,0,.77778],8807:[.25583,.75583,0,0,.77778],8808:[.25142,.75726,0,0,.77778],8809:[.25142,.75726,0,0,.77778],8812:[.25583,.75583,0,0,.5],8814:[.20576,.70576,0,0,.77778],8815:[.20576,.70576,0,0,.77778],8816:[.30274,.79383,0,0,.77778],8817:[.30274,.79383,0,0,.77778],8818:[.22958,.72958,0,0,.77778],8819:[.22958,.72958,0,0,.77778],8822:[.1808,.675,0,0,.77778],8823:[.1808,.675,0,0,.77778],8828:[.13667,.63667,0,0,.77778],8829:[.13667,.63667,0,0,.77778],8830:[.22958,.72958,0,0,.77778],8831:[.22958,.72958,0,0,.77778],8832:[.20576,.70576,0,0,.77778],8833:[.20576,.70576,0,0,.77778],8840:[.30274,.79383,0,0,.77778],8841:[.30274,.79383,0,0,.77778],8842:[.13597,.63597,0,0,.77778],8843:[.13597,.63597,0,0,.77778],8847:[.03517,.54986,0,0,.77778],8848:[.03517,.54986,0,0,.77778],8858:[.08198,.58198,0,0,.77778],8859:[.08198,.58198,0,0,.77778],8861:[.08198,.58198,0,0,.77778],8862:[0,.675,0,0,.77778],8863:[0,.675,0,0,.77778],8864:[0,.675,0,0,.77778],8865:[0,.675,0,0,.77778],8872:[0,.69224,0,0,.61111],8873:[0,.69224,0,0,.72222],8874:[0,.69224,0,0,.88889],8876:[0,.68889,0,0,.61111],8877:[0,.68889,0,0,.61111],8878:[0,.68889,0,0,.72222],8879:[0,.68889,0,0,.72222],8882:[.03517,.54986,0,0,.77778],8883:[.03517,.54986,0,0,.77778],8884:[.13667,.63667,0,0,.77778],8885:[.13667,.63667,0,0,.77778],8888:[0,.54986,0,0,1.11111],8890:[.19444,.43056,0,0,.55556],8891:[.19444,.69224,0,0,.61111],8892:[.19444,.69224,0,0,.61111],8901:[0,.54986,0,0,.27778],8903:[.08167,.58167,0,0,.77778],8905:[.08167,.58167,0,0,.77778],8906:[.08167,.58167,0,0,.77778],8907:[0,.69224,0,0,.77778],8908:[0,.69224,0,0,.77778],8909:[-.03598,.46402,0,0,.77778],8910:[0,.54986,0,0,.76042],8911:[0,.54986,0,0,.76042],8912:[.03517,.54986,0,0,.77778],8913:[.03517,.54986,0,0,.77778],8914:[0,.54986,0,0,.66667],8915:[0,.54986,0,0,.66667],8916:[0,.69224,0,0,.66667],8918:[.0391,.5391,0,0,.77778],8919:[.0391,.5391,0,0,.77778],8920:[.03517,.54986,0,0,1.33334],8921:[.03517,.54986,0,0,1.33334],8922:[.38569,.88569,0,0,.77778],8923:[.38569,.88569,0,0,.77778],8926:[.13667,.63667,0,0,.77778],8927:[.13667,.63667,0,0,.77778],8928:[.30274,.79383,0,0,.77778],8929:[.30274,.79383,0,0,.77778],8934:[.23222,.74111,0,0,.77778],8935:[.23222,.74111,0,0,.77778],8936:[.23222,.74111,0,0,.77778],8937:[.23222,.74111,0,0,.77778],8938:[.20576,.70576,0,0,.77778],8939:[.20576,.70576,0,0,.77778],8940:[.30274,.79383,0,0,.77778],8941:[.30274,.79383,0,0,.77778],8994:[.19444,.69224,0,0,.77778],8995:[.19444,.69224,0,0,.77778],9416:[.15559,.69224,0,0,.90222],9484:[0,.69224,0,0,.5],9488:[0,.69224,0,0,.5],9492:[0,.37788,0,0,.5],9496:[0,.37788,0,0,.5],9585:[.19444,.68889,0,0,.88889],9586:[.19444,.74111,0,0,.88889],9632:[0,.675,0,0,.77778],9633:[0,.675,0,0,.77778],9650:[0,.54986,0,0,.72222],9651:[0,.54986,0,0,.72222],9654:[.03517,.54986,0,0,.77778],9660:[0,.54986,0,0,.72222],9661:[0,.54986,0,0,.72222],9664:[.03517,.54986,0,0,.77778],9674:[.11111,.69224,0,0,.66667],9733:[.19444,.69224,0,0,.94445],10003:[0,.69224,0,0,.83334],10016:[0,.69224,0,0,.83334],10731:[.11111,.69224,0,0,.66667],10846:[.19444,.75583,0,0,.61111],10877:[.13667,.63667,0,0,.77778],10878:[.13667,.63667,0,0,.77778],10885:[.25583,.75583,0,0,.77778],10886:[.25583,.75583,0,0,.77778],10887:[.13597,.63597,0,0,.77778],10888:[.13597,.63597,0,0,.77778],10889:[.26167,.75726,0,0,.77778],10890:[.26167,.75726,0,0,.77778],10891:[.48256,.98256,0,0,.77778],10892:[.48256,.98256,0,0,.77778],10901:[.13667,.63667,0,0,.77778],10902:[.13667,.63667,0,0,.77778],10933:[.25142,.75726,0,0,.77778],10934:[.25142,.75726,0,0,.77778],10935:[.26167,.75726,0,0,.77778],10936:[.26167,.75726,0,0,.77778],10937:[.26167,.75726,0,0,.77778],10938:[.26167,.75726,0,0,.77778],10949:[.25583,.75583,0,0,.77778],10950:[.25583,.75583,0,0,.77778],10955:[.28481,.79383,0,0,.77778],10956:[.28481,.79383,0,0,.77778],57350:[.08167,.58167,0,0,.22222],57351:[.08167,.58167,0,0,.38889],57352:[.08167,.58167,0,0,.77778],57353:[0,.43056,.04028,0,.66667],57356:[.25142,.75726,0,0,.77778],57357:[.25142,.75726,0,0,.77778],57358:[.41951,.91951,0,0,.77778],57359:[.30274,.79383,0,0,.77778],57360:[.30274,.79383,0,0,.77778],57361:[.41951,.91951,0,0,.77778],57366:[.25142,.75726,0,0,.77778],57367:[.25142,.75726,0,0,.77778],57368:[.25142,.75726,0,0,.77778],57369:[.25142,.75726,0,0,.77778],57370:[.13597,.63597,0,0,.77778],57371:[.13597,.63597,0,0,.77778]},"Caligraphic-Regular":{32:[0,0,0,0,.25],65:[0,.68333,0,.19445,.79847],66:[0,.68333,.03041,.13889,.65681],67:[0,.68333,.05834,.13889,.52653],68:[0,.68333,.02778,.08334,.77139],69:[0,.68333,.08944,.11111,.52778],70:[0,.68333,.09931,.11111,.71875],71:[.09722,.68333,.0593,.11111,.59487],72:[0,.68333,.00965,.11111,.84452],73:[0,.68333,.07382,0,.54452],74:[.09722,.68333,.18472,.16667,.67778],75:[0,.68333,.01445,.05556,.76195],76:[0,.68333,0,.13889,.68972],77:[0,.68333,0,.13889,1.2009],78:[0,.68333,.14736,.08334,.82049],79:[0,.68333,.02778,.11111,.79611],80:[0,.68333,.08222,.08334,.69556],81:[.09722,.68333,0,.11111,.81667],82:[0,.68333,0,.08334,.8475],83:[0,.68333,.075,.13889,.60556],84:[0,.68333,.25417,0,.54464],85:[0,.68333,.09931,.08334,.62583],86:[0,.68333,.08222,0,.61278],87:[0,.68333,.08222,.08334,.98778],88:[0,.68333,.14643,.13889,.7133],89:[.09722,.68333,.08222,.08334,.66834],90:[0,.68333,.07944,.13889,.72473],160:[0,0,0,0,.25]},"Fraktur-Regular":{32:[0,0,0,0,.25],33:[0,.69141,0,0,.29574],34:[0,.69141,0,0,.21471],38:[0,.69141,0,0,.73786],39:[0,.69141,0,0,.21201],40:[.24982,.74947,0,0,.38865],41:[.24982,.74947,0,0,.38865],42:[0,.62119,0,0,.27764],43:[.08319,.58283,0,0,.75623],44:[0,.10803,0,0,.27764],45:[.08319,.58283,0,0,.75623],46:[0,.10803,0,0,.27764],47:[.24982,.74947,0,0,.50181],48:[0,.47534,0,0,.50181],49:[0,.47534,0,0,.50181],50:[0,.47534,0,0,.50181],51:[.18906,.47534,0,0,.50181],52:[.18906,.47534,0,0,.50181],53:[.18906,.47534,0,0,.50181],54:[0,.69141,0,0,.50181],55:[.18906,.47534,0,0,.50181],56:[0,.69141,0,0,.50181],57:[.18906,.47534,0,0,.50181],58:[0,.47534,0,0,.21606],59:[.12604,.47534,0,0,.21606],61:[-.13099,.36866,0,0,.75623],63:[0,.69141,0,0,.36245],65:[0,.69141,0,0,.7176],66:[0,.69141,0,0,.88397],67:[0,.69141,0,0,.61254],68:[0,.69141,0,0,.83158],69:[0,.69141,0,0,.66278],70:[.12604,.69141,0,0,.61119],71:[0,.69141,0,0,.78539],72:[.06302,.69141,0,0,.7203],73:[0,.69141,0,0,.55448],74:[.12604,.69141,0,0,.55231],75:[0,.69141,0,0,.66845],76:[0,.69141,0,0,.66602],77:[0,.69141,0,0,1.04953],78:[0,.69141,0,0,.83212],79:[0,.69141,0,0,.82699],80:[.18906,.69141,0,0,.82753],81:[.03781,.69141,0,0,.82699],82:[0,.69141,0,0,.82807],83:[0,.69141,0,0,.82861],84:[0,.69141,0,0,.66899],85:[0,.69141,0,0,.64576],86:[0,.69141,0,0,.83131],87:[0,.69141,0,0,1.04602],88:[0,.69141,0,0,.71922],89:[.18906,.69141,0,0,.83293],90:[.12604,.69141,0,0,.60201],91:[.24982,.74947,0,0,.27764],93:[.24982,.74947,0,0,.27764],94:[0,.69141,0,0,.49965],97:[0,.47534,0,0,.50046],98:[0,.69141,0,0,.51315],99:[0,.47534,0,0,.38946],100:[0,.62119,0,0,.49857],101:[0,.47534,0,0,.40053],102:[.18906,.69141,0,0,.32626],103:[.18906,.47534,0,0,.5037],104:[.18906,.69141,0,0,.52126],105:[0,.69141,0,0,.27899],106:[0,.69141,0,0,.28088],107:[0,.69141,0,0,.38946],108:[0,.69141,0,0,.27953],109:[0,.47534,0,0,.76676],110:[0,.47534,0,0,.52666],111:[0,.47534,0,0,.48885],112:[.18906,.52396,0,0,.50046],113:[.18906,.47534,0,0,.48912],114:[0,.47534,0,0,.38919],115:[0,.47534,0,0,.44266],116:[0,.62119,0,0,.33301],117:[0,.47534,0,0,.5172],118:[0,.52396,0,0,.5118],119:[0,.52396,0,0,.77351],120:[.18906,.47534,0,0,.38865],121:[.18906,.47534,0,0,.49884],122:[.18906,.47534,0,0,.39054],160:[0,0,0,0,.25],8216:[0,.69141,0,0,.21471],8217:[0,.69141,0,0,.21471],58112:[0,.62119,0,0,.49749],58113:[0,.62119,0,0,.4983],58114:[.18906,.69141,0,0,.33328],58115:[.18906,.69141,0,0,.32923],58116:[.18906,.47534,0,0,.50343],58117:[0,.69141,0,0,.33301],58118:[0,.62119,0,0,.33409],58119:[0,.47534,0,0,.50073]},"Main-Bold":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.35],34:[0,.69444,0,0,.60278],35:[.19444,.69444,0,0,.95833],36:[.05556,.75,0,0,.575],37:[.05556,.75,0,0,.95833],38:[0,.69444,0,0,.89444],39:[0,.69444,0,0,.31944],40:[.25,.75,0,0,.44722],41:[.25,.75,0,0,.44722],42:[0,.75,0,0,.575],43:[.13333,.63333,0,0,.89444],44:[.19444,.15556,0,0,.31944],45:[0,.44444,0,0,.38333],46:[0,.15556,0,0,.31944],47:[.25,.75,0,0,.575],48:[0,.64444,0,0,.575],49:[0,.64444,0,0,.575],50:[0,.64444,0,0,.575],51:[0,.64444,0,0,.575],52:[0,.64444,0,0,.575],53:[0,.64444,0,0,.575],54:[0,.64444,0,0,.575],55:[0,.64444,0,0,.575],56:[0,.64444,0,0,.575],57:[0,.64444,0,0,.575],58:[0,.44444,0,0,.31944],59:[.19444,.44444,0,0,.31944],60:[.08556,.58556,0,0,.89444],61:[-.10889,.39111,0,0,.89444],62:[.08556,.58556,0,0,.89444],63:[0,.69444,0,0,.54305],64:[0,.69444,0,0,.89444],65:[0,.68611,0,0,.86944],66:[0,.68611,0,0,.81805],67:[0,.68611,0,0,.83055],68:[0,.68611,0,0,.88194],69:[0,.68611,0,0,.75555],70:[0,.68611,0,0,.72361],71:[0,.68611,0,0,.90416],72:[0,.68611,0,0,.9],73:[0,.68611,0,0,.43611],74:[0,.68611,0,0,.59444],75:[0,.68611,0,0,.90138],76:[0,.68611,0,0,.69166],77:[0,.68611,0,0,1.09166],78:[0,.68611,0,0,.9],79:[0,.68611,0,0,.86388],80:[0,.68611,0,0,.78611],81:[.19444,.68611,0,0,.86388],82:[0,.68611,0,0,.8625],83:[0,.68611,0,0,.63889],84:[0,.68611,0,0,.8],85:[0,.68611,0,0,.88472],86:[0,.68611,.01597,0,.86944],87:[0,.68611,.01597,0,1.18888],88:[0,.68611,0,0,.86944],89:[0,.68611,.02875,0,.86944],90:[0,.68611,0,0,.70277],91:[.25,.75,0,0,.31944],92:[.25,.75,0,0,.575],93:[.25,.75,0,0,.31944],94:[0,.69444,0,0,.575],95:[.31,.13444,.03194,0,.575],97:[0,.44444,0,0,.55902],98:[0,.69444,0,0,.63889],99:[0,.44444,0,0,.51111],100:[0,.69444,0,0,.63889],101:[0,.44444,0,0,.52708],102:[0,.69444,.10903,0,.35139],103:[.19444,.44444,.01597,0,.575],104:[0,.69444,0,0,.63889],105:[0,.69444,0,0,.31944],106:[.19444,.69444,0,0,.35139],107:[0,.69444,0,0,.60694],108:[0,.69444,0,0,.31944],109:[0,.44444,0,0,.95833],110:[0,.44444,0,0,.63889],111:[0,.44444,0,0,.575],112:[.19444,.44444,0,0,.63889],113:[.19444,.44444,0,0,.60694],114:[0,.44444,0,0,.47361],115:[0,.44444,0,0,.45361],116:[0,.63492,0,0,.44722],117:[0,.44444,0,0,.63889],118:[0,.44444,.01597,0,.60694],119:[0,.44444,.01597,0,.83055],120:[0,.44444,0,0,.60694],121:[.19444,.44444,.01597,0,.60694],122:[0,.44444,0,0,.51111],123:[.25,.75,0,0,.575],124:[.25,.75,0,0,.31944],125:[.25,.75,0,0,.575],126:[.35,.34444,0,0,.575],160:[0,0,0,0,.25],163:[0,.69444,0,0,.86853],168:[0,.69444,0,0,.575],172:[0,.44444,0,0,.76666],176:[0,.69444,0,0,.86944],177:[.13333,.63333,0,0,.89444],184:[.17014,0,0,0,.51111],198:[0,.68611,0,0,1.04166],215:[.13333,.63333,0,0,.89444],216:[.04861,.73472,0,0,.89444],223:[0,.69444,0,0,.59722],230:[0,.44444,0,0,.83055],247:[.13333,.63333,0,0,.89444],248:[.09722,.54167,0,0,.575],305:[0,.44444,0,0,.31944],338:[0,.68611,0,0,1.16944],339:[0,.44444,0,0,.89444],567:[.19444,.44444,0,0,.35139],710:[0,.69444,0,0,.575],711:[0,.63194,0,0,.575],713:[0,.59611,0,0,.575],714:[0,.69444,0,0,.575],715:[0,.69444,0,0,.575],728:[0,.69444,0,0,.575],729:[0,.69444,0,0,.31944],730:[0,.69444,0,0,.86944],732:[0,.69444,0,0,.575],733:[0,.69444,0,0,.575],915:[0,.68611,0,0,.69166],916:[0,.68611,0,0,.95833],920:[0,.68611,0,0,.89444],923:[0,.68611,0,0,.80555],926:[0,.68611,0,0,.76666],928:[0,.68611,0,0,.9],931:[0,.68611,0,0,.83055],933:[0,.68611,0,0,.89444],934:[0,.68611,0,0,.83055],936:[0,.68611,0,0,.89444],937:[0,.68611,0,0,.83055],8211:[0,.44444,.03194,0,.575],8212:[0,.44444,.03194,0,1.14999],8216:[0,.69444,0,0,.31944],8217:[0,.69444,0,0,.31944],8220:[0,.69444,0,0,.60278],8221:[0,.69444,0,0,.60278],8224:[.19444,.69444,0,0,.51111],8225:[.19444,.69444,0,0,.51111],8242:[0,.55556,0,0,.34444],8407:[0,.72444,.15486,0,.575],8463:[0,.69444,0,0,.66759],8465:[0,.69444,0,0,.83055],8467:[0,.69444,0,0,.47361],8472:[.19444,.44444,0,0,.74027],8476:[0,.69444,0,0,.83055],8501:[0,.69444,0,0,.70277],8592:[-.10889,.39111,0,0,1.14999],8593:[.19444,.69444,0,0,.575],8594:[-.10889,.39111,0,0,1.14999],8595:[.19444,.69444,0,0,.575],8596:[-.10889,.39111,0,0,1.14999],8597:[.25,.75,0,0,.575],8598:[.19444,.69444,0,0,1.14999],8599:[.19444,.69444,0,0,1.14999],8600:[.19444,.69444,0,0,1.14999],8601:[.19444,.69444,0,0,1.14999],8636:[-.10889,.39111,0,0,1.14999],8637:[-.10889,.39111,0,0,1.14999],8640:[-.10889,.39111,0,0,1.14999],8641:[-.10889,.39111,0,0,1.14999],8656:[-.10889,.39111,0,0,1.14999],8657:[.19444,.69444,0,0,.70277],8658:[-.10889,.39111,0,0,1.14999],8659:[.19444,.69444,0,0,.70277],8660:[-.10889,.39111,0,0,1.14999],8661:[.25,.75,0,0,.70277],8704:[0,.69444,0,0,.63889],8706:[0,.69444,.06389,0,.62847],8707:[0,.69444,0,0,.63889],8709:[.05556,.75,0,0,.575],8711:[0,.68611,0,0,.95833],8712:[.08556,.58556,0,0,.76666],8715:[.08556,.58556,0,0,.76666],8722:[.13333,.63333,0,0,.89444],8723:[.13333,.63333,0,0,.89444],8725:[.25,.75,0,0,.575],8726:[.25,.75,0,0,.575],8727:[-.02778,.47222,0,0,.575],8728:[-.02639,.47361,0,0,.575],8729:[-.02639,.47361,0,0,.575],8730:[.18,.82,0,0,.95833],8733:[0,.44444,0,0,.89444],8734:[0,.44444,0,0,1.14999],8736:[0,.69224,0,0,.72222],8739:[.25,.75,0,0,.31944],8741:[.25,.75,0,0,.575],8743:[0,.55556,0,0,.76666],8744:[0,.55556,0,0,.76666],8745:[0,.55556,0,0,.76666],8746:[0,.55556,0,0,.76666],8747:[.19444,.69444,.12778,0,.56875],8764:[-.10889,.39111,0,0,.89444],8768:[.19444,.69444,0,0,.31944],8771:[.00222,.50222,0,0,.89444],8773:[.027,.638,0,0,.894],8776:[.02444,.52444,0,0,.89444],8781:[.00222,.50222,0,0,.89444],8801:[.00222,.50222,0,0,.89444],8804:[.19667,.69667,0,0,.89444],8805:[.19667,.69667,0,0,.89444],8810:[.08556,.58556,0,0,1.14999],8811:[.08556,.58556,0,0,1.14999],8826:[.08556,.58556,0,0,.89444],8827:[.08556,.58556,0,0,.89444],8834:[.08556,.58556,0,0,.89444],8835:[.08556,.58556,0,0,.89444],8838:[.19667,.69667,0,0,.89444],8839:[.19667,.69667,0,0,.89444],8846:[0,.55556,0,0,.76666],8849:[.19667,.69667,0,0,.89444],8850:[.19667,.69667,0,0,.89444],8851:[0,.55556,0,0,.76666],8852:[0,.55556,0,0,.76666],8853:[.13333,.63333,0,0,.89444],8854:[.13333,.63333,0,0,.89444],8855:[.13333,.63333,0,0,.89444],8856:[.13333,.63333,0,0,.89444],8857:[.13333,.63333,0,0,.89444],8866:[0,.69444,0,0,.70277],8867:[0,.69444,0,0,.70277],8868:[0,.69444,0,0,.89444],8869:[0,.69444,0,0,.89444],8900:[-.02639,.47361,0,0,.575],8901:[-.02639,.47361,0,0,.31944],8902:[-.02778,.47222,0,0,.575],8968:[.25,.75,0,0,.51111],8969:[.25,.75,0,0,.51111],8970:[.25,.75,0,0,.51111],8971:[.25,.75,0,0,.51111],8994:[-.13889,.36111,0,0,1.14999],8995:[-.13889,.36111,0,0,1.14999],9651:[.19444,.69444,0,0,1.02222],9657:[-.02778,.47222,0,0,.575],9661:[.19444,.69444,0,0,1.02222],9667:[-.02778,.47222,0,0,.575],9711:[.19444,.69444,0,0,1.14999],9824:[.12963,.69444,0,0,.89444],9825:[.12963,.69444,0,0,.89444],9826:[.12963,.69444,0,0,.89444],9827:[.12963,.69444,0,0,.89444],9837:[0,.75,0,0,.44722],9838:[.19444,.69444,0,0,.44722],9839:[.19444,.69444,0,0,.44722],10216:[.25,.75,0,0,.44722],10217:[.25,.75,0,0,.44722],10815:[0,.68611,0,0,.9],10927:[.19667,.69667,0,0,.89444],10928:[.19667,.69667,0,0,.89444],57376:[.19444,.69444,0,0,0]},"Main-BoldItalic":{32:[0,0,0,0,.25],33:[0,.69444,.11417,0,.38611],34:[0,.69444,.07939,0,.62055],35:[.19444,.69444,.06833,0,.94444],37:[.05556,.75,.12861,0,.94444],38:[0,.69444,.08528,0,.88555],39:[0,.69444,.12945,0,.35555],40:[.25,.75,.15806,0,.47333],41:[.25,.75,.03306,0,.47333],42:[0,.75,.14333,0,.59111],43:[.10333,.60333,.03306,0,.88555],44:[.19444,.14722,0,0,.35555],45:[0,.44444,.02611,0,.41444],46:[0,.14722,0,0,.35555],47:[.25,.75,.15806,0,.59111],48:[0,.64444,.13167,0,.59111],49:[0,.64444,.13167,0,.59111],50:[0,.64444,.13167,0,.59111],51:[0,.64444,.13167,0,.59111],52:[.19444,.64444,.13167,0,.59111],53:[0,.64444,.13167,0,.59111],54:[0,.64444,.13167,0,.59111],55:[.19444,.64444,.13167,0,.59111],56:[0,.64444,.13167,0,.59111],57:[0,.64444,.13167,0,.59111],58:[0,.44444,.06695,0,.35555],59:[.19444,.44444,.06695,0,.35555],61:[-.10889,.39111,.06833,0,.88555],63:[0,.69444,.11472,0,.59111],64:[0,.69444,.09208,0,.88555],65:[0,.68611,0,0,.86555],66:[0,.68611,.0992,0,.81666],67:[0,.68611,.14208,0,.82666],68:[0,.68611,.09062,0,.87555],69:[0,.68611,.11431,0,.75666],70:[0,.68611,.12903,0,.72722],71:[0,.68611,.07347,0,.89527],72:[0,.68611,.17208,0,.8961],73:[0,.68611,.15681,0,.47166],74:[0,.68611,.145,0,.61055],75:[0,.68611,.14208,0,.89499],76:[0,.68611,0,0,.69777],77:[0,.68611,.17208,0,1.07277],78:[0,.68611,.17208,0,.8961],79:[0,.68611,.09062,0,.85499],80:[0,.68611,.0992,0,.78721],81:[.19444,.68611,.09062,0,.85499],82:[0,.68611,.02559,0,.85944],83:[0,.68611,.11264,0,.64999],84:[0,.68611,.12903,0,.7961],85:[0,.68611,.17208,0,.88083],86:[0,.68611,.18625,0,.86555],87:[0,.68611,.18625,0,1.15999],88:[0,.68611,.15681,0,.86555],89:[0,.68611,.19803,0,.86555],90:[0,.68611,.14208,0,.70888],91:[.25,.75,.1875,0,.35611],93:[.25,.75,.09972,0,.35611],94:[0,.69444,.06709,0,.59111],95:[.31,.13444,.09811,0,.59111],97:[0,.44444,.09426,0,.59111],98:[0,.69444,.07861,0,.53222],99:[0,.44444,.05222,0,.53222],100:[0,.69444,.10861,0,.59111],101:[0,.44444,.085,0,.53222],102:[.19444,.69444,.21778,0,.4],103:[.19444,.44444,.105,0,.53222],104:[0,.69444,.09426,0,.59111],105:[0,.69326,.11387,0,.35555],106:[.19444,.69326,.1672,0,.35555],107:[0,.69444,.11111,0,.53222],108:[0,.69444,.10861,0,.29666],109:[0,.44444,.09426,0,.94444],110:[0,.44444,.09426,0,.64999],111:[0,.44444,.07861,0,.59111],112:[.19444,.44444,.07861,0,.59111],113:[.19444,.44444,.105,0,.53222],114:[0,.44444,.11111,0,.50167],115:[0,.44444,.08167,0,.48694],116:[0,.63492,.09639,0,.385],117:[0,.44444,.09426,0,.62055],118:[0,.44444,.11111,0,.53222],119:[0,.44444,.11111,0,.76777],120:[0,.44444,.12583,0,.56055],121:[.19444,.44444,.105,0,.56166],122:[0,.44444,.13889,0,.49055],126:[.35,.34444,.11472,0,.59111],160:[0,0,0,0,.25],168:[0,.69444,.11473,0,.59111],176:[0,.69444,0,0,.94888],184:[.17014,0,0,0,.53222],198:[0,.68611,.11431,0,1.02277],216:[.04861,.73472,.09062,0,.88555],223:[.19444,.69444,.09736,0,.665],230:[0,.44444,.085,0,.82666],248:[.09722,.54167,.09458,0,.59111],305:[0,.44444,.09426,0,.35555],338:[0,.68611,.11431,0,1.14054],339:[0,.44444,.085,0,.82666],567:[.19444,.44444,.04611,0,.385],710:[0,.69444,.06709,0,.59111],711:[0,.63194,.08271,0,.59111],713:[0,.59444,.10444,0,.59111],714:[0,.69444,.08528,0,.59111],715:[0,.69444,0,0,.59111],728:[0,.69444,.10333,0,.59111],729:[0,.69444,.12945,0,.35555],730:[0,.69444,0,0,.94888],732:[0,.69444,.11472,0,.59111],733:[0,.69444,.11472,0,.59111],915:[0,.68611,.12903,0,.69777],916:[0,.68611,0,0,.94444],920:[0,.68611,.09062,0,.88555],923:[0,.68611,0,0,.80666],926:[0,.68611,.15092,0,.76777],928:[0,.68611,.17208,0,.8961],931:[0,.68611,.11431,0,.82666],933:[0,.68611,.10778,0,.88555],934:[0,.68611,.05632,0,.82666],936:[0,.68611,.10778,0,.88555],937:[0,.68611,.0992,0,.82666],8211:[0,.44444,.09811,0,.59111],8212:[0,.44444,.09811,0,1.18221],8216:[0,.69444,.12945,0,.35555],8217:[0,.69444,.12945,0,.35555],8220:[0,.69444,.16772,0,.62055],8221:[0,.69444,.07939,0,.62055]},"Main-Italic":{32:[0,0,0,0,.25],33:[0,.69444,.12417,0,.30667],34:[0,.69444,.06961,0,.51444],35:[.19444,.69444,.06616,0,.81777],37:[.05556,.75,.13639,0,.81777],38:[0,.69444,.09694,0,.76666],39:[0,.69444,.12417,0,.30667],40:[.25,.75,.16194,0,.40889],41:[.25,.75,.03694,0,.40889],42:[0,.75,.14917,0,.51111],43:[.05667,.56167,.03694,0,.76666],44:[.19444,.10556,0,0,.30667],45:[0,.43056,.02826,0,.35778],46:[0,.10556,0,0,.30667],47:[.25,.75,.16194,0,.51111],48:[0,.64444,.13556,0,.51111],49:[0,.64444,.13556,0,.51111],50:[0,.64444,.13556,0,.51111],51:[0,.64444,.13556,0,.51111],52:[.19444,.64444,.13556,0,.51111],53:[0,.64444,.13556,0,.51111],54:[0,.64444,.13556,0,.51111],55:[.19444,.64444,.13556,0,.51111],56:[0,.64444,.13556,0,.51111],57:[0,.64444,.13556,0,.51111],58:[0,.43056,.0582,0,.30667],59:[.19444,.43056,.0582,0,.30667],61:[-.13313,.36687,.06616,0,.76666],63:[0,.69444,.1225,0,.51111],64:[0,.69444,.09597,0,.76666],65:[0,.68333,0,0,.74333],66:[0,.68333,.10257,0,.70389],67:[0,.68333,.14528,0,.71555],68:[0,.68333,.09403,0,.755],69:[0,.68333,.12028,0,.67833],70:[0,.68333,.13305,0,.65277],71:[0,.68333,.08722,0,.77361],72:[0,.68333,.16389,0,.74333],73:[0,.68333,.15806,0,.38555],74:[0,.68333,.14028,0,.525],75:[0,.68333,.14528,0,.76888],76:[0,.68333,0,0,.62722],77:[0,.68333,.16389,0,.89666],78:[0,.68333,.16389,0,.74333],79:[0,.68333,.09403,0,.76666],80:[0,.68333,.10257,0,.67833],81:[.19444,.68333,.09403,0,.76666],82:[0,.68333,.03868,0,.72944],83:[0,.68333,.11972,0,.56222],84:[0,.68333,.13305,0,.71555],85:[0,.68333,.16389,0,.74333],86:[0,.68333,.18361,0,.74333],87:[0,.68333,.18361,0,.99888],88:[0,.68333,.15806,0,.74333],89:[0,.68333,.19383,0,.74333],90:[0,.68333,.14528,0,.61333],91:[.25,.75,.1875,0,.30667],93:[.25,.75,.10528,0,.30667],94:[0,.69444,.06646,0,.51111],95:[.31,.12056,.09208,0,.51111],97:[0,.43056,.07671,0,.51111],98:[0,.69444,.06312,0,.46],99:[0,.43056,.05653,0,.46],100:[0,.69444,.10333,0,.51111],101:[0,.43056,.07514,0,.46],102:[.19444,.69444,.21194,0,.30667],103:[.19444,.43056,.08847,0,.46],104:[0,.69444,.07671,0,.51111],105:[0,.65536,.1019,0,.30667],106:[.19444,.65536,.14467,0,.30667],107:[0,.69444,.10764,0,.46],108:[0,.69444,.10333,0,.25555],109:[0,.43056,.07671,0,.81777],110:[0,.43056,.07671,0,.56222],111:[0,.43056,.06312,0,.51111],112:[.19444,.43056,.06312,0,.51111],113:[.19444,.43056,.08847,0,.46],114:[0,.43056,.10764,0,.42166],115:[0,.43056,.08208,0,.40889],116:[0,.61508,.09486,0,.33222],117:[0,.43056,.07671,0,.53666],118:[0,.43056,.10764,0,.46],119:[0,.43056,.10764,0,.66444],120:[0,.43056,.12042,0,.46389],121:[.19444,.43056,.08847,0,.48555],122:[0,.43056,.12292,0,.40889],126:[.35,.31786,.11585,0,.51111],160:[0,0,0,0,.25],168:[0,.66786,.10474,0,.51111],176:[0,.69444,0,0,.83129],184:[.17014,0,0,0,.46],198:[0,.68333,.12028,0,.88277],216:[.04861,.73194,.09403,0,.76666],223:[.19444,.69444,.10514,0,.53666],230:[0,.43056,.07514,0,.71555],248:[.09722,.52778,.09194,0,.51111],338:[0,.68333,.12028,0,.98499],339:[0,.43056,.07514,0,.71555],710:[0,.69444,.06646,0,.51111],711:[0,.62847,.08295,0,.51111],713:[0,.56167,.10333,0,.51111],714:[0,.69444,.09694,0,.51111],715:[0,.69444,0,0,.51111],728:[0,.69444,.10806,0,.51111],729:[0,.66786,.11752,0,.30667],730:[0,.69444,0,0,.83129],732:[0,.66786,.11585,0,.51111],733:[0,.69444,.1225,0,.51111],915:[0,.68333,.13305,0,.62722],916:[0,.68333,0,0,.81777],920:[0,.68333,.09403,0,.76666],923:[0,.68333,0,0,.69222],926:[0,.68333,.15294,0,.66444],928:[0,.68333,.16389,0,.74333],931:[0,.68333,.12028,0,.71555],933:[0,.68333,.11111,0,.76666],934:[0,.68333,.05986,0,.71555],936:[0,.68333,.11111,0,.76666],937:[0,.68333,.10257,0,.71555],8211:[0,.43056,.09208,0,.51111],8212:[0,.43056,.09208,0,1.02222],8216:[0,.69444,.12417,0,.30667],8217:[0,.69444,.12417,0,.30667],8220:[0,.69444,.1685,0,.51444],8221:[0,.69444,.06961,0,.51444],8463:[0,.68889,0,0,.54028]},"Main-Regular":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.27778],34:[0,.69444,0,0,.5],35:[.19444,.69444,0,0,.83334],36:[.05556,.75,0,0,.5],37:[.05556,.75,0,0,.83334],38:[0,.69444,0,0,.77778],39:[0,.69444,0,0,.27778],40:[.25,.75,0,0,.38889],41:[.25,.75,0,0,.38889],42:[0,.75,0,0,.5],43:[.08333,.58333,0,0,.77778],44:[.19444,.10556,0,0,.27778],45:[0,.43056,0,0,.33333],46:[0,.10556,0,0,.27778],47:[.25,.75,0,0,.5],48:[0,.64444,0,0,.5],49:[0,.64444,0,0,.5],50:[0,.64444,0,0,.5],51:[0,.64444,0,0,.5],52:[0,.64444,0,0,.5],53:[0,.64444,0,0,.5],54:[0,.64444,0,0,.5],55:[0,.64444,0,0,.5],56:[0,.64444,0,0,.5],57:[0,.64444,0,0,.5],58:[0,.43056,0,0,.27778],59:[.19444,.43056,0,0,.27778],60:[.0391,.5391,0,0,.77778],61:[-.13313,.36687,0,0,.77778],62:[.0391,.5391,0,0,.77778],63:[0,.69444,0,0,.47222],64:[0,.69444,0,0,.77778],65:[0,.68333,0,0,.75],66:[0,.68333,0,0,.70834],67:[0,.68333,0,0,.72222],68:[0,.68333,0,0,.76389],69:[0,.68333,0,0,.68056],70:[0,.68333,0,0,.65278],71:[0,.68333,0,0,.78472],72:[0,.68333,0,0,.75],73:[0,.68333,0,0,.36111],74:[0,.68333,0,0,.51389],75:[0,.68333,0,0,.77778],76:[0,.68333,0,0,.625],77:[0,.68333,0,0,.91667],78:[0,.68333,0,0,.75],79:[0,.68333,0,0,.77778],80:[0,.68333,0,0,.68056],81:[.19444,.68333,0,0,.77778],82:[0,.68333,0,0,.73611],83:[0,.68333,0,0,.55556],84:[0,.68333,0,0,.72222],85:[0,.68333,0,0,.75],86:[0,.68333,.01389,0,.75],87:[0,.68333,.01389,0,1.02778],88:[0,.68333,0,0,.75],89:[0,.68333,.025,0,.75],90:[0,.68333,0,0,.61111],91:[.25,.75,0,0,.27778],92:[.25,.75,0,0,.5],93:[.25,.75,0,0,.27778],94:[0,.69444,0,0,.5],95:[.31,.12056,.02778,0,.5],97:[0,.43056,0,0,.5],98:[0,.69444,0,0,.55556],99:[0,.43056,0,0,.44445],100:[0,.69444,0,0,.55556],101:[0,.43056,0,0,.44445],102:[0,.69444,.07778,0,.30556],103:[.19444,.43056,.01389,0,.5],104:[0,.69444,0,0,.55556],105:[0,.66786,0,0,.27778],106:[.19444,.66786,0,0,.30556],107:[0,.69444,0,0,.52778],108:[0,.69444,0,0,.27778],109:[0,.43056,0,0,.83334],110:[0,.43056,0,0,.55556],111:[0,.43056,0,0,.5],112:[.19444,.43056,0,0,.55556],113:[.19444,.43056,0,0,.52778],114:[0,.43056,0,0,.39167],115:[0,.43056,0,0,.39445],116:[0,.61508,0,0,.38889],117:[0,.43056,0,0,.55556],118:[0,.43056,.01389,0,.52778],119:[0,.43056,.01389,0,.72222],120:[0,.43056,0,0,.52778],121:[.19444,.43056,.01389,0,.52778],122:[0,.43056,0,0,.44445],123:[.25,.75,0,0,.5],124:[.25,.75,0,0,.27778],125:[.25,.75,0,0,.5],126:[.35,.31786,0,0,.5],160:[0,0,0,0,.25],163:[0,.69444,0,0,.76909],167:[.19444,.69444,0,0,.44445],168:[0,.66786,0,0,.5],172:[0,.43056,0,0,.66667],176:[0,.69444,0,0,.75],177:[.08333,.58333,0,0,.77778],182:[.19444,.69444,0,0,.61111],184:[.17014,0,0,0,.44445],198:[0,.68333,0,0,.90278],215:[.08333,.58333,0,0,.77778],216:[.04861,.73194,0,0,.77778],223:[0,.69444,0,0,.5],230:[0,.43056,0,0,.72222],247:[.08333,.58333,0,0,.77778],248:[.09722,.52778,0,0,.5],305:[0,.43056,0,0,.27778],338:[0,.68333,0,0,1.01389],339:[0,.43056,0,0,.77778],567:[.19444,.43056,0,0,.30556],710:[0,.69444,0,0,.5],711:[0,.62847,0,0,.5],713:[0,.56778,0,0,.5],714:[0,.69444,0,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,0,0,.5],729:[0,.66786,0,0,.27778],730:[0,.69444,0,0,.75],732:[0,.66786,0,0,.5],733:[0,.69444,0,0,.5],915:[0,.68333,0,0,.625],916:[0,.68333,0,0,.83334],920:[0,.68333,0,0,.77778],923:[0,.68333,0,0,.69445],926:[0,.68333,0,0,.66667],928:[0,.68333,0,0,.75],931:[0,.68333,0,0,.72222],933:[0,.68333,0,0,.77778],934:[0,.68333,0,0,.72222],936:[0,.68333,0,0,.77778],937:[0,.68333,0,0,.72222],8211:[0,.43056,.02778,0,.5],8212:[0,.43056,.02778,0,1],8216:[0,.69444,0,0,.27778],8217:[0,.69444,0,0,.27778],8220:[0,.69444,0,0,.5],8221:[0,.69444,0,0,.5],8224:[.19444,.69444,0,0,.44445],8225:[.19444,.69444,0,0,.44445],8230:[0,.123,0,0,1.172],8242:[0,.55556,0,0,.275],8407:[0,.71444,.15382,0,.5],8463:[0,.68889,0,0,.54028],8465:[0,.69444,0,0,.72222],8467:[0,.69444,0,.11111,.41667],8472:[.19444,.43056,0,.11111,.63646],8476:[0,.69444,0,0,.72222],8501:[0,.69444,0,0,.61111],8592:[-.13313,.36687,0,0,1],8593:[.19444,.69444,0,0,.5],8594:[-.13313,.36687,0,0,1],8595:[.19444,.69444,0,0,.5],8596:[-.13313,.36687,0,0,1],8597:[.25,.75,0,0,.5],8598:[.19444,.69444,0,0,1],8599:[.19444,.69444,0,0,1],8600:[.19444,.69444,0,0,1],8601:[.19444,.69444,0,0,1],8614:[.011,.511,0,0,1],8617:[.011,.511,0,0,1.126],8618:[.011,.511,0,0,1.126],8636:[-.13313,.36687,0,0,1],8637:[-.13313,.36687,0,0,1],8640:[-.13313,.36687,0,0,1],8641:[-.13313,.36687,0,0,1],8652:[.011,.671,0,0,1],8656:[-.13313,.36687,0,0,1],8657:[.19444,.69444,0,0,.61111],8658:[-.13313,.36687,0,0,1],8659:[.19444,.69444,0,0,.61111],8660:[-.13313,.36687,0,0,1],8661:[.25,.75,0,0,.61111],8704:[0,.69444,0,0,.55556],8706:[0,.69444,.05556,.08334,.5309],8707:[0,.69444,0,0,.55556],8709:[.05556,.75,0,0,.5],8711:[0,.68333,0,0,.83334],8712:[.0391,.5391,0,0,.66667],8715:[.0391,.5391,0,0,.66667],8722:[.08333,.58333,0,0,.77778],8723:[.08333,.58333,0,0,.77778],8725:[.25,.75,0,0,.5],8726:[.25,.75,0,0,.5],8727:[-.03472,.46528,0,0,.5],8728:[-.05555,.44445,0,0,.5],8729:[-.05555,.44445,0,0,.5],8730:[.2,.8,0,0,.83334],8733:[0,.43056,0,0,.77778],8734:[0,.43056,0,0,1],8736:[0,.69224,0,0,.72222],8739:[.25,.75,0,0,.27778],8741:[.25,.75,0,0,.5],8743:[0,.55556,0,0,.66667],8744:[0,.55556,0,0,.66667],8745:[0,.55556,0,0,.66667],8746:[0,.55556,0,0,.66667],8747:[.19444,.69444,.11111,0,.41667],8764:[-.13313,.36687,0,0,.77778],8768:[.19444,.69444,0,0,.27778],8771:[-.03625,.46375,0,0,.77778],8773:[-.022,.589,0,0,.778],8776:[-.01688,.48312,0,0,.77778],8781:[-.03625,.46375,0,0,.77778],8784:[-.133,.673,0,0,.778],8801:[-.03625,.46375,0,0,.77778],8804:[.13597,.63597,0,0,.77778],8805:[.13597,.63597,0,0,.77778],8810:[.0391,.5391,0,0,1],8811:[.0391,.5391,0,0,1],8826:[.0391,.5391,0,0,.77778],8827:[.0391,.5391,0,0,.77778],8834:[.0391,.5391,0,0,.77778],8835:[.0391,.5391,0,0,.77778],8838:[.13597,.63597,0,0,.77778],8839:[.13597,.63597,0,0,.77778],8846:[0,.55556,0,0,.66667],8849:[.13597,.63597,0,0,.77778],8850:[.13597,.63597,0,0,.77778],8851:[0,.55556,0,0,.66667],8852:[0,.55556,0,0,.66667],8853:[.08333,.58333,0,0,.77778],8854:[.08333,.58333,0,0,.77778],8855:[.08333,.58333,0,0,.77778],8856:[.08333,.58333,0,0,.77778],8857:[.08333,.58333,0,0,.77778],8866:[0,.69444,0,0,.61111],8867:[0,.69444,0,0,.61111],8868:[0,.69444,0,0,.77778],8869:[0,.69444,0,0,.77778],8872:[.249,.75,0,0,.867],8900:[-.05555,.44445,0,0,.5],8901:[-.05555,.44445,0,0,.27778],8902:[-.03472,.46528,0,0,.5],8904:[.005,.505,0,0,.9],8942:[.03,.903,0,0,.278],8943:[-.19,.313,0,0,1.172],8945:[-.1,.823,0,0,1.282],8968:[.25,.75,0,0,.44445],8969:[.25,.75,0,0,.44445],8970:[.25,.75,0,0,.44445],8971:[.25,.75,0,0,.44445],8994:[-.14236,.35764,0,0,1],8995:[-.14236,.35764,0,0,1],9136:[.244,.744,0,0,.412],9137:[.244,.745,0,0,.412],9651:[.19444,.69444,0,0,.88889],9657:[-.03472,.46528,0,0,.5],9661:[.19444,.69444,0,0,.88889],9667:[-.03472,.46528,0,0,.5],9711:[.19444,.69444,0,0,1],9824:[.12963,.69444,0,0,.77778],9825:[.12963,.69444,0,0,.77778],9826:[.12963,.69444,0,0,.77778],9827:[.12963,.69444,0,0,.77778],9837:[0,.75,0,0,.38889],9838:[.19444,.69444,0,0,.38889],9839:[.19444,.69444,0,0,.38889],10216:[.25,.75,0,0,.38889],10217:[.25,.75,0,0,.38889],10222:[.244,.744,0,0,.412],10223:[.244,.745,0,0,.412],10229:[.011,.511,0,0,1.609],10230:[.011,.511,0,0,1.638],10231:[.011,.511,0,0,1.859],10232:[.024,.525,0,0,1.609],10233:[.024,.525,0,0,1.638],10234:[.024,.525,0,0,1.858],10236:[.011,.511,0,0,1.638],10815:[0,.68333,0,0,.75],10927:[.13597,.63597,0,0,.77778],10928:[.13597,.63597,0,0,.77778],57376:[.19444,.69444,0,0,0]},"Math-BoldItalic":{32:[0,0,0,0,.25],48:[0,.44444,0,0,.575],49:[0,.44444,0,0,.575],50:[0,.44444,0,0,.575],51:[.19444,.44444,0,0,.575],52:[.19444,.44444,0,0,.575],53:[.19444,.44444,0,0,.575],54:[0,.64444,0,0,.575],55:[.19444,.44444,0,0,.575],56:[0,.64444,0,0,.575],57:[.19444,.44444,0,0,.575],65:[0,.68611,0,0,.86944],66:[0,.68611,.04835,0,.8664],67:[0,.68611,.06979,0,.81694],68:[0,.68611,.03194,0,.93812],69:[0,.68611,.05451,0,.81007],70:[0,.68611,.15972,0,.68889],71:[0,.68611,0,0,.88673],72:[0,.68611,.08229,0,.98229],73:[0,.68611,.07778,0,.51111],74:[0,.68611,.10069,0,.63125],75:[0,.68611,.06979,0,.97118],76:[0,.68611,0,0,.75555],77:[0,.68611,.11424,0,1.14201],78:[0,.68611,.11424,0,.95034],79:[0,.68611,.03194,0,.83666],80:[0,.68611,.15972,0,.72309],81:[.19444,.68611,0,0,.86861],82:[0,.68611,.00421,0,.87235],83:[0,.68611,.05382,0,.69271],84:[0,.68611,.15972,0,.63663],85:[0,.68611,.11424,0,.80027],86:[0,.68611,.25555,0,.67778],87:[0,.68611,.15972,0,1.09305],88:[0,.68611,.07778,0,.94722],89:[0,.68611,.25555,0,.67458],90:[0,.68611,.06979,0,.77257],97:[0,.44444,0,0,.63287],98:[0,.69444,0,0,.52083],99:[0,.44444,0,0,.51342],100:[0,.69444,0,0,.60972],101:[0,.44444,0,0,.55361],102:[.19444,.69444,.11042,0,.56806],103:[.19444,.44444,.03704,0,.5449],104:[0,.69444,0,0,.66759],105:[0,.69326,0,0,.4048],106:[.19444,.69326,.0622,0,.47083],107:[0,.69444,.01852,0,.6037],108:[0,.69444,.0088,0,.34815],109:[0,.44444,0,0,1.0324],110:[0,.44444,0,0,.71296],111:[0,.44444,0,0,.58472],112:[.19444,.44444,0,0,.60092],113:[.19444,.44444,.03704,0,.54213],114:[0,.44444,.03194,0,.5287],115:[0,.44444,0,0,.53125],116:[0,.63492,0,0,.41528],117:[0,.44444,0,0,.68102],118:[0,.44444,.03704,0,.56666],119:[0,.44444,.02778,0,.83148],120:[0,.44444,0,0,.65903],121:[.19444,.44444,.03704,0,.59028],122:[0,.44444,.04213,0,.55509],160:[0,0,0,0,.25],915:[0,.68611,.15972,0,.65694],916:[0,.68611,0,0,.95833],920:[0,.68611,.03194,0,.86722],923:[0,.68611,0,0,.80555],926:[0,.68611,.07458,0,.84125],928:[0,.68611,.08229,0,.98229],931:[0,.68611,.05451,0,.88507],933:[0,.68611,.15972,0,.67083],934:[0,.68611,0,0,.76666],936:[0,.68611,.11653,0,.71402],937:[0,.68611,.04835,0,.8789],945:[0,.44444,0,0,.76064],946:[.19444,.69444,.03403,0,.65972],947:[.19444,.44444,.06389,0,.59003],948:[0,.69444,.03819,0,.52222],949:[0,.44444,0,0,.52882],950:[.19444,.69444,.06215,0,.50833],951:[.19444,.44444,.03704,0,.6],952:[0,.69444,.03194,0,.5618],953:[0,.44444,0,0,.41204],954:[0,.44444,0,0,.66759],955:[0,.69444,0,0,.67083],956:[.19444,.44444,0,0,.70787],957:[0,.44444,.06898,0,.57685],958:[.19444,.69444,.03021,0,.50833],959:[0,.44444,0,0,.58472],960:[0,.44444,.03704,0,.68241],961:[.19444,.44444,0,0,.6118],962:[.09722,.44444,.07917,0,.42361],963:[0,.44444,.03704,0,.68588],964:[0,.44444,.13472,0,.52083],965:[0,.44444,.03704,0,.63055],966:[.19444,.44444,0,0,.74722],967:[.19444,.44444,0,0,.71805],968:[.19444,.69444,.03704,0,.75833],969:[0,.44444,.03704,0,.71782],977:[0,.69444,0,0,.69155],981:[.19444,.69444,0,0,.7125],982:[0,.44444,.03194,0,.975],1009:[.19444,.44444,0,0,.6118],1013:[0,.44444,0,0,.48333],57649:[0,.44444,0,0,.39352],57911:[.19444,.44444,0,0,.43889]},"Math-Italic":{32:[0,0,0,0,.25],48:[0,.43056,0,0,.5],49:[0,.43056,0,0,.5],50:[0,.43056,0,0,.5],51:[.19444,.43056,0,0,.5],52:[.19444,.43056,0,0,.5],53:[.19444,.43056,0,0,.5],54:[0,.64444,0,0,.5],55:[.19444,.43056,0,0,.5],56:[0,.64444,0,0,.5],57:[.19444,.43056,0,0,.5],65:[0,.68333,0,.13889,.75],66:[0,.68333,.05017,.08334,.75851],67:[0,.68333,.07153,.08334,.71472],68:[0,.68333,.02778,.05556,.82792],69:[0,.68333,.05764,.08334,.7382],70:[0,.68333,.13889,.08334,.64306],71:[0,.68333,0,.08334,.78625],72:[0,.68333,.08125,.05556,.83125],73:[0,.68333,.07847,.11111,.43958],74:[0,.68333,.09618,.16667,.55451],75:[0,.68333,.07153,.05556,.84931],76:[0,.68333,0,.02778,.68056],77:[0,.68333,.10903,.08334,.97014],78:[0,.68333,.10903,.08334,.80347],79:[0,.68333,.02778,.08334,.76278],80:[0,.68333,.13889,.08334,.64201],81:[.19444,.68333,0,.08334,.79056],82:[0,.68333,.00773,.08334,.75929],83:[0,.68333,.05764,.08334,.6132],84:[0,.68333,.13889,.08334,.58438],85:[0,.68333,.10903,.02778,.68278],86:[0,.68333,.22222,0,.58333],87:[0,.68333,.13889,0,.94445],88:[0,.68333,.07847,.08334,.82847],89:[0,.68333,.22222,0,.58056],90:[0,.68333,.07153,.08334,.68264],97:[0,.43056,0,0,.52859],98:[0,.69444,0,0,.42917],99:[0,.43056,0,.05556,.43276],100:[0,.69444,0,.16667,.52049],101:[0,.43056,0,.05556,.46563],102:[.19444,.69444,.10764,.16667,.48959],103:[.19444,.43056,.03588,.02778,.47697],104:[0,.69444,0,0,.57616],105:[0,.65952,0,0,.34451],106:[.19444,.65952,.05724,0,.41181],107:[0,.69444,.03148,0,.5206],108:[0,.69444,.01968,.08334,.29838],109:[0,.43056,0,0,.87801],110:[0,.43056,0,0,.60023],111:[0,.43056,0,.05556,.48472],112:[.19444,.43056,0,.08334,.50313],113:[.19444,.43056,.03588,.08334,.44641],114:[0,.43056,.02778,.05556,.45116],115:[0,.43056,0,.05556,.46875],116:[0,.61508,0,.08334,.36111],117:[0,.43056,0,.02778,.57246],118:[0,.43056,.03588,.02778,.48472],119:[0,.43056,.02691,.08334,.71592],120:[0,.43056,0,.02778,.57153],121:[.19444,.43056,.03588,.05556,.49028],122:[0,.43056,.04398,.05556,.46505],160:[0,0,0,0,.25],915:[0,.68333,.13889,.08334,.61528],916:[0,.68333,0,.16667,.83334],920:[0,.68333,.02778,.08334,.76278],923:[0,.68333,0,.16667,.69445],926:[0,.68333,.07569,.08334,.74236],928:[0,.68333,.08125,.05556,.83125],931:[0,.68333,.05764,.08334,.77986],933:[0,.68333,.13889,.05556,.58333],934:[0,.68333,0,.08334,.66667],936:[0,.68333,.11,.05556,.61222],937:[0,.68333,.05017,.08334,.7724],945:[0,.43056,.0037,.02778,.6397],946:[.19444,.69444,.05278,.08334,.56563],947:[.19444,.43056,.05556,0,.51773],948:[0,.69444,.03785,.05556,.44444],949:[0,.43056,0,.08334,.46632],950:[.19444,.69444,.07378,.08334,.4375],951:[.19444,.43056,.03588,.05556,.49653],952:[0,.69444,.02778,.08334,.46944],953:[0,.43056,0,.05556,.35394],954:[0,.43056,0,0,.57616],955:[0,.69444,0,0,.58334],956:[.19444,.43056,0,.02778,.60255],957:[0,.43056,.06366,.02778,.49398],958:[.19444,.69444,.04601,.11111,.4375],959:[0,.43056,0,.05556,.48472],960:[0,.43056,.03588,0,.57003],961:[.19444,.43056,0,.08334,.51702],962:[.09722,.43056,.07986,.08334,.36285],963:[0,.43056,.03588,0,.57141],964:[0,.43056,.1132,.02778,.43715],965:[0,.43056,.03588,.02778,.54028],966:[.19444,.43056,0,.08334,.65417],967:[.19444,.43056,0,.05556,.62569],968:[.19444,.69444,.03588,.11111,.65139],969:[0,.43056,.03588,0,.62245],977:[0,.69444,0,.08334,.59144],981:[.19444,.69444,0,.08334,.59583],982:[0,.43056,.02778,0,.82813],1009:[.19444,.43056,0,.08334,.51702],1013:[0,.43056,0,.05556,.4059],57649:[0,.43056,0,.02778,.32246],57911:[.19444,.43056,0,.08334,.38403]},"SansSerif-Bold":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.36667],34:[0,.69444,0,0,.55834],35:[.19444,.69444,0,0,.91667],36:[.05556,.75,0,0,.55],37:[.05556,.75,0,0,1.02912],38:[0,.69444,0,0,.83056],39:[0,.69444,0,0,.30556],40:[.25,.75,0,0,.42778],41:[.25,.75,0,0,.42778],42:[0,.75,0,0,.55],43:[.11667,.61667,0,0,.85556],44:[.10556,.13056,0,0,.30556],45:[0,.45833,0,0,.36667],46:[0,.13056,0,0,.30556],47:[.25,.75,0,0,.55],48:[0,.69444,0,0,.55],49:[0,.69444,0,0,.55],50:[0,.69444,0,0,.55],51:[0,.69444,0,0,.55],52:[0,.69444,0,0,.55],53:[0,.69444,0,0,.55],54:[0,.69444,0,0,.55],55:[0,.69444,0,0,.55],56:[0,.69444,0,0,.55],57:[0,.69444,0,0,.55],58:[0,.45833,0,0,.30556],59:[.10556,.45833,0,0,.30556],61:[-.09375,.40625,0,0,.85556],63:[0,.69444,0,0,.51945],64:[0,.69444,0,0,.73334],65:[0,.69444,0,0,.73334],66:[0,.69444,0,0,.73334],67:[0,.69444,0,0,.70278],68:[0,.69444,0,0,.79445],69:[0,.69444,0,0,.64167],70:[0,.69444,0,0,.61111],71:[0,.69444,0,0,.73334],72:[0,.69444,0,0,.79445],73:[0,.69444,0,0,.33056],74:[0,.69444,0,0,.51945],75:[0,.69444,0,0,.76389],76:[0,.69444,0,0,.58056],77:[0,.69444,0,0,.97778],78:[0,.69444,0,0,.79445],79:[0,.69444,0,0,.79445],80:[0,.69444,0,0,.70278],81:[.10556,.69444,0,0,.79445],82:[0,.69444,0,0,.70278],83:[0,.69444,0,0,.61111],84:[0,.69444,0,0,.73334],85:[0,.69444,0,0,.76389],86:[0,.69444,.01528,0,.73334],87:[0,.69444,.01528,0,1.03889],88:[0,.69444,0,0,.73334],89:[0,.69444,.0275,0,.73334],90:[0,.69444,0,0,.67223],91:[.25,.75,0,0,.34306],93:[.25,.75,0,0,.34306],94:[0,.69444,0,0,.55],95:[.35,.10833,.03056,0,.55],97:[0,.45833,0,0,.525],98:[0,.69444,0,0,.56111],99:[0,.45833,0,0,.48889],100:[0,.69444,0,0,.56111],101:[0,.45833,0,0,.51111],102:[0,.69444,.07639,0,.33611],103:[.19444,.45833,.01528,0,.55],104:[0,.69444,0,0,.56111],105:[0,.69444,0,0,.25556],106:[.19444,.69444,0,0,.28611],107:[0,.69444,0,0,.53056],108:[0,.69444,0,0,.25556],109:[0,.45833,0,0,.86667],110:[0,.45833,0,0,.56111],111:[0,.45833,0,0,.55],112:[.19444,.45833,0,0,.56111],113:[.19444,.45833,0,0,.56111],114:[0,.45833,.01528,0,.37222],115:[0,.45833,0,0,.42167],116:[0,.58929,0,0,.40417],117:[0,.45833,0,0,.56111],118:[0,.45833,.01528,0,.5],119:[0,.45833,.01528,0,.74445],120:[0,.45833,0,0,.5],121:[.19444,.45833,.01528,0,.5],122:[0,.45833,0,0,.47639],126:[.35,.34444,0,0,.55],160:[0,0,0,0,.25],168:[0,.69444,0,0,.55],176:[0,.69444,0,0,.73334],180:[0,.69444,0,0,.55],184:[.17014,0,0,0,.48889],305:[0,.45833,0,0,.25556],567:[.19444,.45833,0,0,.28611],710:[0,.69444,0,0,.55],711:[0,.63542,0,0,.55],713:[0,.63778,0,0,.55],728:[0,.69444,0,0,.55],729:[0,.69444,0,0,.30556],730:[0,.69444,0,0,.73334],732:[0,.69444,0,0,.55],733:[0,.69444,0,0,.55],915:[0,.69444,0,0,.58056],916:[0,.69444,0,0,.91667],920:[0,.69444,0,0,.85556],923:[0,.69444,0,0,.67223],926:[0,.69444,0,0,.73334],928:[0,.69444,0,0,.79445],931:[0,.69444,0,0,.79445],933:[0,.69444,0,0,.85556],934:[0,.69444,0,0,.79445],936:[0,.69444,0,0,.85556],937:[0,.69444,0,0,.79445],8211:[0,.45833,.03056,0,.55],8212:[0,.45833,.03056,0,1.10001],8216:[0,.69444,0,0,.30556],8217:[0,.69444,0,0,.30556],8220:[0,.69444,0,0,.55834],8221:[0,.69444,0,0,.55834]},"SansSerif-Italic":{32:[0,0,0,0,.25],33:[0,.69444,.05733,0,.31945],34:[0,.69444,.00316,0,.5],35:[.19444,.69444,.05087,0,.83334],36:[.05556,.75,.11156,0,.5],37:[.05556,.75,.03126,0,.83334],38:[0,.69444,.03058,0,.75834],39:[0,.69444,.07816,0,.27778],40:[.25,.75,.13164,0,.38889],41:[.25,.75,.02536,0,.38889],42:[0,.75,.11775,0,.5],43:[.08333,.58333,.02536,0,.77778],44:[.125,.08333,0,0,.27778],45:[0,.44444,.01946,0,.33333],46:[0,.08333,0,0,.27778],47:[.25,.75,.13164,0,.5],48:[0,.65556,.11156,0,.5],49:[0,.65556,.11156,0,.5],50:[0,.65556,.11156,0,.5],51:[0,.65556,.11156,0,.5],52:[0,.65556,.11156,0,.5],53:[0,.65556,.11156,0,.5],54:[0,.65556,.11156,0,.5],55:[0,.65556,.11156,0,.5],56:[0,.65556,.11156,0,.5],57:[0,.65556,.11156,0,.5],58:[0,.44444,.02502,0,.27778],59:[.125,.44444,.02502,0,.27778],61:[-.13,.37,.05087,0,.77778],63:[0,.69444,.11809,0,.47222],64:[0,.69444,.07555,0,.66667],65:[0,.69444,0,0,.66667],66:[0,.69444,.08293,0,.66667],67:[0,.69444,.11983,0,.63889],68:[0,.69444,.07555,0,.72223],69:[0,.69444,.11983,0,.59722],70:[0,.69444,.13372,0,.56945],71:[0,.69444,.11983,0,.66667],72:[0,.69444,.08094,0,.70834],73:[0,.69444,.13372,0,.27778],74:[0,.69444,.08094,0,.47222],75:[0,.69444,.11983,0,.69445],76:[0,.69444,0,0,.54167],77:[0,.69444,.08094,0,.875],78:[0,.69444,.08094,0,.70834],79:[0,.69444,.07555,0,.73611],80:[0,.69444,.08293,0,.63889],81:[.125,.69444,.07555,0,.73611],82:[0,.69444,.08293,0,.64584],83:[0,.69444,.09205,0,.55556],84:[0,.69444,.13372,0,.68056],85:[0,.69444,.08094,0,.6875],86:[0,.69444,.1615,0,.66667],87:[0,.69444,.1615,0,.94445],88:[0,.69444,.13372,0,.66667],89:[0,.69444,.17261,0,.66667],90:[0,.69444,.11983,0,.61111],91:[.25,.75,.15942,0,.28889],93:[.25,.75,.08719,0,.28889],94:[0,.69444,.0799,0,.5],95:[.35,.09444,.08616,0,.5],97:[0,.44444,.00981,0,.48056],98:[0,.69444,.03057,0,.51667],99:[0,.44444,.08336,0,.44445],100:[0,.69444,.09483,0,.51667],101:[0,.44444,.06778,0,.44445],102:[0,.69444,.21705,0,.30556],103:[.19444,.44444,.10836,0,.5],104:[0,.69444,.01778,0,.51667],105:[0,.67937,.09718,0,.23889],106:[.19444,.67937,.09162,0,.26667],107:[0,.69444,.08336,0,.48889],108:[0,.69444,.09483,0,.23889],109:[0,.44444,.01778,0,.79445],110:[0,.44444,.01778,0,.51667],111:[0,.44444,.06613,0,.5],112:[.19444,.44444,.0389,0,.51667],113:[.19444,.44444,.04169,0,.51667],114:[0,.44444,.10836,0,.34167],115:[0,.44444,.0778,0,.38333],116:[0,.57143,.07225,0,.36111],117:[0,.44444,.04169,0,.51667],118:[0,.44444,.10836,0,.46111],119:[0,.44444,.10836,0,.68334],120:[0,.44444,.09169,0,.46111],121:[.19444,.44444,.10836,0,.46111],122:[0,.44444,.08752,0,.43472],126:[.35,.32659,.08826,0,.5],160:[0,0,0,0,.25],168:[0,.67937,.06385,0,.5],176:[0,.69444,0,0,.73752],184:[.17014,0,0,0,.44445],305:[0,.44444,.04169,0,.23889],567:[.19444,.44444,.04169,0,.26667],710:[0,.69444,.0799,0,.5],711:[0,.63194,.08432,0,.5],713:[0,.60889,.08776,0,.5],714:[0,.69444,.09205,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,.09483,0,.5],729:[0,.67937,.07774,0,.27778],730:[0,.69444,0,0,.73752],732:[0,.67659,.08826,0,.5],733:[0,.69444,.09205,0,.5],915:[0,.69444,.13372,0,.54167],916:[0,.69444,0,0,.83334],920:[0,.69444,.07555,0,.77778],923:[0,.69444,0,0,.61111],926:[0,.69444,.12816,0,.66667],928:[0,.69444,.08094,0,.70834],931:[0,.69444,.11983,0,.72222],933:[0,.69444,.09031,0,.77778],934:[0,.69444,.04603,0,.72222],936:[0,.69444,.09031,0,.77778],937:[0,.69444,.08293,0,.72222],8211:[0,.44444,.08616,0,.5],8212:[0,.44444,.08616,0,1],8216:[0,.69444,.07816,0,.27778],8217:[0,.69444,.07816,0,.27778],8220:[0,.69444,.14205,0,.5],8221:[0,.69444,.00316,0,.5]},"SansSerif-Regular":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.31945],34:[0,.69444,0,0,.5],35:[.19444,.69444,0,0,.83334],36:[.05556,.75,0,0,.5],37:[.05556,.75,0,0,.83334],38:[0,.69444,0,0,.75834],39:[0,.69444,0,0,.27778],40:[.25,.75,0,0,.38889],41:[.25,.75,0,0,.38889],42:[0,.75,0,0,.5],43:[.08333,.58333,0,0,.77778],44:[.125,.08333,0,0,.27778],45:[0,.44444,0,0,.33333],46:[0,.08333,0,0,.27778],47:[.25,.75,0,0,.5],48:[0,.65556,0,0,.5],49:[0,.65556,0,0,.5],50:[0,.65556,0,0,.5],51:[0,.65556,0,0,.5],52:[0,.65556,0,0,.5],53:[0,.65556,0,0,.5],54:[0,.65556,0,0,.5],55:[0,.65556,0,0,.5],56:[0,.65556,0,0,.5],57:[0,.65556,0,0,.5],58:[0,.44444,0,0,.27778],59:[.125,.44444,0,0,.27778],61:[-.13,.37,0,0,.77778],63:[0,.69444,0,0,.47222],64:[0,.69444,0,0,.66667],65:[0,.69444,0,0,.66667],66:[0,.69444,0,0,.66667],67:[0,.69444,0,0,.63889],68:[0,.69444,0,0,.72223],69:[0,.69444,0,0,.59722],70:[0,.69444,0,0,.56945],71:[0,.69444,0,0,.66667],72:[0,.69444,0,0,.70834],73:[0,.69444,0,0,.27778],74:[0,.69444,0,0,.47222],75:[0,.69444,0,0,.69445],76:[0,.69444,0,0,.54167],77:[0,.69444,0,0,.875],78:[0,.69444,0,0,.70834],79:[0,.69444,0,0,.73611],80:[0,.69444,0,0,.63889],81:[.125,.69444,0,0,.73611],82:[0,.69444,0,0,.64584],83:[0,.69444,0,0,.55556],84:[0,.69444,0,0,.68056],85:[0,.69444,0,0,.6875],86:[0,.69444,.01389,0,.66667],87:[0,.69444,.01389,0,.94445],88:[0,.69444,0,0,.66667],89:[0,.69444,.025,0,.66667],90:[0,.69444,0,0,.61111],91:[.25,.75,0,0,.28889],93:[.25,.75,0,0,.28889],94:[0,.69444,0,0,.5],95:[.35,.09444,.02778,0,.5],97:[0,.44444,0,0,.48056],98:[0,.69444,0,0,.51667],99:[0,.44444,0,0,.44445],100:[0,.69444,0,0,.51667],101:[0,.44444,0,0,.44445],102:[0,.69444,.06944,0,.30556],103:[.19444,.44444,.01389,0,.5],104:[0,.69444,0,0,.51667],105:[0,.67937,0,0,.23889],106:[.19444,.67937,0,0,.26667],107:[0,.69444,0,0,.48889],108:[0,.69444,0,0,.23889],109:[0,.44444,0,0,.79445],110:[0,.44444,0,0,.51667],111:[0,.44444,0,0,.5],112:[.19444,.44444,0,0,.51667],113:[.19444,.44444,0,0,.51667],114:[0,.44444,.01389,0,.34167],115:[0,.44444,0,0,.38333],116:[0,.57143,0,0,.36111],117:[0,.44444,0,0,.51667],118:[0,.44444,.01389,0,.46111],119:[0,.44444,.01389,0,.68334],120:[0,.44444,0,0,.46111],121:[.19444,.44444,.01389,0,.46111],122:[0,.44444,0,0,.43472],126:[.35,.32659,0,0,.5],160:[0,0,0,0,.25],168:[0,.67937,0,0,.5],176:[0,.69444,0,0,.66667],184:[.17014,0,0,0,.44445],305:[0,.44444,0,0,.23889],567:[.19444,.44444,0,0,.26667],710:[0,.69444,0,0,.5],711:[0,.63194,0,0,.5],713:[0,.60889,0,0,.5],714:[0,.69444,0,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,0,0,.5],729:[0,.67937,0,0,.27778],730:[0,.69444,0,0,.66667],732:[0,.67659,0,0,.5],733:[0,.69444,0,0,.5],915:[0,.69444,0,0,.54167],916:[0,.69444,0,0,.83334],920:[0,.69444,0,0,.77778],923:[0,.69444,0,0,.61111],926:[0,.69444,0,0,.66667],928:[0,.69444,0,0,.70834],931:[0,.69444,0,0,.72222],933:[0,.69444,0,0,.77778],934:[0,.69444,0,0,.72222],936:[0,.69444,0,0,.77778],937:[0,.69444,0,0,.72222],8211:[0,.44444,.02778,0,.5],8212:[0,.44444,.02778,0,1],8216:[0,.69444,0,0,.27778],8217:[0,.69444,0,0,.27778],8220:[0,.69444,0,0,.5],8221:[0,.69444,0,0,.5]},"Script-Regular":{32:[0,0,0,0,.25],65:[0,.7,.22925,0,.80253],66:[0,.7,.04087,0,.90757],67:[0,.7,.1689,0,.66619],68:[0,.7,.09371,0,.77443],69:[0,.7,.18583,0,.56162],70:[0,.7,.13634,0,.89544],71:[0,.7,.17322,0,.60961],72:[0,.7,.29694,0,.96919],73:[0,.7,.19189,0,.80907],74:[.27778,.7,.19189,0,1.05159],75:[0,.7,.31259,0,.91364],76:[0,.7,.19189,0,.87373],77:[0,.7,.15981,0,1.08031],78:[0,.7,.3525,0,.9015],79:[0,.7,.08078,0,.73787],80:[0,.7,.08078,0,1.01262],81:[0,.7,.03305,0,.88282],82:[0,.7,.06259,0,.85],83:[0,.7,.19189,0,.86767],84:[0,.7,.29087,0,.74697],85:[0,.7,.25815,0,.79996],86:[0,.7,.27523,0,.62204],87:[0,.7,.27523,0,.80532],88:[0,.7,.26006,0,.94445],89:[0,.7,.2939,0,.70961],90:[0,.7,.24037,0,.8212],160:[0,0,0,0,.25]},"Size1-Regular":{32:[0,0,0,0,.25],40:[.35001,.85,0,0,.45834],41:[.35001,.85,0,0,.45834],47:[.35001,.85,0,0,.57778],91:[.35001,.85,0,0,.41667],92:[.35001,.85,0,0,.57778],93:[.35001,.85,0,0,.41667],123:[.35001,.85,0,0,.58334],125:[.35001,.85,0,0,.58334],160:[0,0,0,0,.25],710:[0,.72222,0,0,.55556],732:[0,.72222,0,0,.55556],770:[0,.72222,0,0,.55556],771:[0,.72222,0,0,.55556],8214:[-99e-5,.601,0,0,.77778],8593:[1e-5,.6,0,0,.66667],8595:[1e-5,.6,0,0,.66667],8657:[1e-5,.6,0,0,.77778],8659:[1e-5,.6,0,0,.77778],8719:[.25001,.75,0,0,.94445],8720:[.25001,.75,0,0,.94445],8721:[.25001,.75,0,0,1.05556],8730:[.35001,.85,0,0,1],8739:[-.00599,.606,0,0,.33333],8741:[-.00599,.606,0,0,.55556],8747:[.30612,.805,.19445,0,.47222],8748:[.306,.805,.19445,0,.47222],8749:[.306,.805,.19445,0,.47222],8750:[.30612,.805,.19445,0,.47222],8896:[.25001,.75,0,0,.83334],8897:[.25001,.75,0,0,.83334],8898:[.25001,.75,0,0,.83334],8899:[.25001,.75,0,0,.83334],8968:[.35001,.85,0,0,.47222],8969:[.35001,.85,0,0,.47222],8970:[.35001,.85,0,0,.47222],8971:[.35001,.85,0,0,.47222],9168:[-99e-5,.601,0,0,.66667],10216:[.35001,.85,0,0,.47222],10217:[.35001,.85,0,0,.47222],10752:[.25001,.75,0,0,1.11111],10753:[.25001,.75,0,0,1.11111],10754:[.25001,.75,0,0,1.11111],10756:[.25001,.75,0,0,.83334],10758:[.25001,.75,0,0,.83334]},"Size2-Regular":{32:[0,0,0,0,.25],40:[.65002,1.15,0,0,.59722],41:[.65002,1.15,0,0,.59722],47:[.65002,1.15,0,0,.81111],91:[.65002,1.15,0,0,.47222],92:[.65002,1.15,0,0,.81111],93:[.65002,1.15,0,0,.47222],123:[.65002,1.15,0,0,.66667],125:[.65002,1.15,0,0,.66667],160:[0,0,0,0,.25],710:[0,.75,0,0,1],732:[0,.75,0,0,1],770:[0,.75,0,0,1],771:[0,.75,0,0,1],8719:[.55001,1.05,0,0,1.27778],8720:[.55001,1.05,0,0,1.27778],8721:[.55001,1.05,0,0,1.44445],8730:[.65002,1.15,0,0,1],8747:[.86225,1.36,.44445,0,.55556],8748:[.862,1.36,.44445,0,.55556],8749:[.862,1.36,.44445,0,.55556],8750:[.86225,1.36,.44445,0,.55556],8896:[.55001,1.05,0,0,1.11111],8897:[.55001,1.05,0,0,1.11111],8898:[.55001,1.05,0,0,1.11111],8899:[.55001,1.05,0,0,1.11111],8968:[.65002,1.15,0,0,.52778],8969:[.65002,1.15,0,0,.52778],8970:[.65002,1.15,0,0,.52778],8971:[.65002,1.15,0,0,.52778],10216:[.65002,1.15,0,0,.61111],10217:[.65002,1.15,0,0,.61111],10752:[.55001,1.05,0,0,1.51112],10753:[.55001,1.05,0,0,1.51112],10754:[.55001,1.05,0,0,1.51112],10756:[.55001,1.05,0,0,1.11111],10758:[.55001,1.05,0,0,1.11111]},"Size3-Regular":{32:[0,0,0,0,.25],40:[.95003,1.45,0,0,.73611],41:[.95003,1.45,0,0,.73611],47:[.95003,1.45,0,0,1.04445],91:[.95003,1.45,0,0,.52778],92:[.95003,1.45,0,0,1.04445],93:[.95003,1.45,0,0,.52778],123:[.95003,1.45,0,0,.75],125:[.95003,1.45,0,0,.75],160:[0,0,0,0,.25],710:[0,.75,0,0,1.44445],732:[0,.75,0,0,1.44445],770:[0,.75,0,0,1.44445],771:[0,.75,0,0,1.44445],8730:[.95003,1.45,0,0,1],8968:[.95003,1.45,0,0,.58334],8969:[.95003,1.45,0,0,.58334],8970:[.95003,1.45,0,0,.58334],8971:[.95003,1.45,0,0,.58334],10216:[.95003,1.45,0,0,.75],10217:[.95003,1.45,0,0,.75]},"Size4-Regular":{32:[0,0,0,0,.25],40:[1.25003,1.75,0,0,.79167],41:[1.25003,1.75,0,0,.79167],47:[1.25003,1.75,0,0,1.27778],91:[1.25003,1.75,0,0,.58334],92:[1.25003,1.75,0,0,1.27778],93:[1.25003,1.75,0,0,.58334],123:[1.25003,1.75,0,0,.80556],125:[1.25003,1.75,0,0,.80556],160:[0,0,0,0,.25],710:[0,.825,0,0,1.8889],732:[0,.825,0,0,1.8889],770:[0,.825,0,0,1.8889],771:[0,.825,0,0,1.8889],8730:[1.25003,1.75,0,0,1],8968:[1.25003,1.75,0,0,.63889],8969:[1.25003,1.75,0,0,.63889],8970:[1.25003,1.75,0,0,.63889],8971:[1.25003,1.75,0,0,.63889],9115:[.64502,1.155,0,0,.875],9116:[1e-5,.6,0,0,.875],9117:[.64502,1.155,0,0,.875],9118:[.64502,1.155,0,0,.875],9119:[1e-5,.6,0,0,.875],9120:[.64502,1.155,0,0,.875],9121:[.64502,1.155,0,0,.66667],9122:[-99e-5,.601,0,0,.66667],9123:[.64502,1.155,0,0,.66667],9124:[.64502,1.155,0,0,.66667],9125:[-99e-5,.601,0,0,.66667],9126:[.64502,1.155,0,0,.66667],9127:[1e-5,.9,0,0,.88889],9128:[.65002,1.15,0,0,.88889],9129:[.90001,0,0,0,.88889],9130:[0,.3,0,0,.88889],9131:[1e-5,.9,0,0,.88889],9132:[.65002,1.15,0,0,.88889],9133:[.90001,0,0,0,.88889],9143:[.88502,.915,0,0,1.05556],10216:[1.25003,1.75,0,0,.80556],10217:[1.25003,1.75,0,0,.80556],57344:[-.00499,.605,0,0,1.05556],57345:[-.00499,.605,0,0,1.05556],57680:[0,.12,0,0,.45],57681:[0,.12,0,0,.45],57682:[0,.12,0,0,.45],57683:[0,.12,0,0,.45]},"Typewriter-Regular":{32:[0,0,0,0,.525],33:[0,.61111,0,0,.525],34:[0,.61111,0,0,.525],35:[0,.61111,0,0,.525],36:[.08333,.69444,0,0,.525],37:[.08333,.69444,0,0,.525],38:[0,.61111,0,0,.525],39:[0,.61111,0,0,.525],40:[.08333,.69444,0,0,.525],41:[.08333,.69444,0,0,.525],42:[0,.52083,0,0,.525],43:[-.08056,.53055,0,0,.525],44:[.13889,.125,0,0,.525],45:[-.08056,.53055,0,0,.525],46:[0,.125,0,0,.525],47:[.08333,.69444,0,0,.525],48:[0,.61111,0,0,.525],49:[0,.61111,0,0,.525],50:[0,.61111,0,0,.525],51:[0,.61111,0,0,.525],52:[0,.61111,0,0,.525],53:[0,.61111,0,0,.525],54:[0,.61111,0,0,.525],55:[0,.61111,0,0,.525],56:[0,.61111,0,0,.525],57:[0,.61111,0,0,.525],58:[0,.43056,0,0,.525],59:[.13889,.43056,0,0,.525],60:[-.05556,.55556,0,0,.525],61:[-.19549,.41562,0,0,.525],62:[-.05556,.55556,0,0,.525],63:[0,.61111,0,0,.525],64:[0,.61111,0,0,.525],65:[0,.61111,0,0,.525],66:[0,.61111,0,0,.525],67:[0,.61111,0,0,.525],68:[0,.61111,0,0,.525],69:[0,.61111,0,0,.525],70:[0,.61111,0,0,.525],71:[0,.61111,0,0,.525],72:[0,.61111,0,0,.525],73:[0,.61111,0,0,.525],74:[0,.61111,0,0,.525],75:[0,.61111,0,0,.525],76:[0,.61111,0,0,.525],77:[0,.61111,0,0,.525],78:[0,.61111,0,0,.525],79:[0,.61111,0,0,.525],80:[0,.61111,0,0,.525],81:[.13889,.61111,0,0,.525],82:[0,.61111,0,0,.525],83:[0,.61111,0,0,.525],84:[0,.61111,0,0,.525],85:[0,.61111,0,0,.525],86:[0,.61111,0,0,.525],87:[0,.61111,0,0,.525],88:[0,.61111,0,0,.525],89:[0,.61111,0,0,.525],90:[0,.61111,0,0,.525],91:[.08333,.69444,0,0,.525],92:[.08333,.69444,0,0,.525],93:[.08333,.69444,0,0,.525],94:[0,.61111,0,0,.525],95:[.09514,0,0,0,.525],96:[0,.61111,0,0,.525],97:[0,.43056,0,0,.525],98:[0,.61111,0,0,.525],99:[0,.43056,0,0,.525],100:[0,.61111,0,0,.525],101:[0,.43056,0,0,.525],102:[0,.61111,0,0,.525],103:[.22222,.43056,0,0,.525],104:[0,.61111,0,0,.525],105:[0,.61111,0,0,.525],106:[.22222,.61111,0,0,.525],107:[0,.61111,0,0,.525],108:[0,.61111,0,0,.525],109:[0,.43056,0,0,.525],110:[0,.43056,0,0,.525],111:[0,.43056,0,0,.525],112:[.22222,.43056,0,0,.525],113:[.22222,.43056,0,0,.525],114:[0,.43056,0,0,.525],115:[0,.43056,0,0,.525],116:[0,.55358,0,0,.525],117:[0,.43056,0,0,.525],118:[0,.43056,0,0,.525],119:[0,.43056,0,0,.525],120:[0,.43056,0,0,.525],121:[.22222,.43056,0,0,.525],122:[0,.43056,0,0,.525],123:[.08333,.69444,0,0,.525],124:[.08333,.69444,0,0,.525],125:[.08333,.69444,0,0,.525],126:[0,.61111,0,0,.525],127:[0,.61111,0,0,.525],160:[0,0,0,0,.525],176:[0,.61111,0,0,.525],184:[.19445,0,0,0,.525],305:[0,.43056,0,0,.525],567:[.22222,.43056,0,0,.525],711:[0,.56597,0,0,.525],713:[0,.56555,0,0,.525],714:[0,.61111,0,0,.525],715:[0,.61111,0,0,.525],728:[0,.61111,0,0,.525],730:[0,.61111,0,0,.525],770:[0,.61111,0,0,.525],771:[0,.61111,0,0,.525],776:[0,.61111,0,0,.525],915:[0,.61111,0,0,.525],916:[0,.61111,0,0,.525],920:[0,.61111,0,0,.525],923:[0,.61111,0,0,.525],926:[0,.61111,0,0,.525],928:[0,.61111,0,0,.525],931:[0,.61111,0,0,.525],933:[0,.61111,0,0,.525],934:[0,.61111,0,0,.525],936:[0,.61111,0,0,.525],937:[0,.61111,0,0,.525],8216:[0,.61111,0,0,.525],8217:[0,.61111,0,0,.525],8242:[0,.61111,0,0,.525],9251:[.11111,.21944,0,0,.525]}},TO={slant:[.25,.25,.25],space:[0,0,0],stretch:[0,0,0],shrink:[0,0,0],xHeight:[.431,.431,.431],quad:[1,1.171,1.472],extraSpace:[0,0,0],num1:[.677,.732,.925],num2:[.394,.384,.387],num3:[.444,.471,.504],denom1:[.686,.752,1.025],denom2:[.345,.344,.532],sup1:[.413,.503,.504],sup2:[.363,.431,.404],sup3:[.289,.286,.294],sub1:[.15,.143,.2],sub2:[.247,.286,.4],supDrop:[.386,.353,.494],subDrop:[.05,.071,.1],delim1:[2.39,1.7,1.98],delim2:[1.01,1.157,1.42],axisHeight:[.25,.25,.25],defaultRuleThickness:[.04,.049,.049],bigOpSpacing1:[.111,.111,.111],bigOpSpacing2:[.166,.166,.166],bigOpSpacing3:[.2,.2,.2],bigOpSpacing4:[.6,.611,.611],bigOpSpacing5:[.1,.143,.143],sqrtRuleThickness:[.04,.04,.04],ptPerEm:[10,10,10],doubleRuleSep:[.2,.2,.2],arrayRuleWidth:[.04,.04,.04],fboxsep:[.3,.3,.3],fboxrule:[.04,.04,.04]},EO={Å:`A`,Ð:`D`,Þ:`o`,å:`a`,ð:`d`,þ:`o`,А:`A`,Б:`B`,В:`B`,Г:`F`,Д:`A`,Е:`E`,Ж:`K`,З:`3`,И:`N`,Й:`N`,К:`K`,Л:`N`,М:`M`,Н:`H`,О:`O`,П:`N`,Р:`P`,С:`C`,Т:`T`,У:`y`,Ф:`O`,Х:`X`,Ц:`U`,Ч:`h`,Ш:`W`,Щ:`W`,Ъ:`B`,Ы:`X`,Ь:`B`,Э:`3`,Ю:`X`,Я:`R`,а:`a`,б:`b`,в:`a`,г:`r`,д:`y`,е:`e`,ж:`m`,з:`e`,и:`n`,й:`n`,к:`n`,л:`n`,м:`m`,н:`n`,о:`o`,п:`n`,р:`p`,с:`c`,т:`o`,у:`y`,ф:`b`,х:`x`,ц:`n`,ч:`n`,ш:`w`,щ:`w`,ъ:`a`,ы:`m`,ь:`a`,э:`e`,ю:`m`,я:`r`};function DO(e,t){wO[e]=t}function OO(e,t,n){if(!wO[t])throw Error(`Font metrics not found for font: `+t+`.`);var r=e.charCodeAt(0),i=wO[t][r];if(!i&&e[0]in EO&&(r=EO[e[0]].charCodeAt(0),i=wO[t][r]),!i&&n===`text`&&VD(r)&&(i=wO[t][77]),i)return{depth:i[0],height:i[1],italic:i[2],skew:i[3],width:i[4]}}var kO={};function AO(e){var t=e>=5?0:e>=3?1:2;if(!kO[t]){var n=kO[t]={cssEmPerMu:TO.quad[t]/18};for(var r of Object.keys(TO))n[r]=TO[r][t]}return kO[t]}var jO={math:{},text:{}};function H(e,t,n,r,i,a){jO[e][i]={font:t,group:n,replace:r},a&&r&&(jO[e][r]=jO[e][i])}var U=`math`,W=`text`,G=`main`,K=`ams`,MO=`accent-token`,q=`bin`,NO=`close`,PO=`inner`,FO=`mathord`,IO=`op-token`,LO=`open`,RO=`punct`,J=`rel`,zO=`spacing`,Y=`textord`;H(U,G,J,`≡`,`\\equiv`,!0),H(U,G,J,`≺`,`\\prec`,!0),H(U,G,J,`≻`,`\\succ`,!0),H(U,G,J,`∼`,`\\sim`,!0),H(U,G,J,`⊥`,`\\perp`),H(U,G,J,`⪯`,`\\preceq`,!0),H(U,G,J,`⪰`,`\\succeq`,!0),H(U,G,J,`≃`,`\\simeq`,!0),H(U,G,J,`∣`,`\\mid`,!0),H(U,G,J,`≪`,`\\ll`,!0),H(U,G,J,`≫`,`\\gg`,!0),H(U,G,J,`≍`,`\\asymp`,!0),H(U,G,J,`∥`,`\\parallel`),H(U,G,J,`⋈`,`\\bowtie`,!0),H(U,G,J,`⌣`,`\\smile`,!0),H(U,G,J,`⊑`,`\\sqsubseteq`,!0),H(U,G,J,`⊒`,`\\sqsupseteq`,!0),H(U,G,J,`≐`,`\\doteq`,!0),H(U,G,J,`⌢`,`\\frown`,!0),H(U,G,J,`∋`,`\\ni`,!0),H(U,G,J,`∝`,`\\propto`,!0),H(U,G,J,`⊢`,`\\vdash`,!0),H(U,G,J,`⊣`,`\\dashv`,!0),H(U,G,J,`∋`,`\\owns`),H(U,G,RO,`.`,`\\ldotp`),H(U,G,RO,`⋅`,`\\cdotp`),H(U,G,RO,`⋅`,`·`),H(W,G,Y,`⋅`,`·`),H(U,G,Y,`#`,`\\#`),H(W,G,Y,`#`,`\\#`),H(U,G,Y,`&`,`\\&`),H(W,G,Y,`&`,`\\&`),H(U,G,Y,`ℵ`,`\\aleph`,!0),H(U,G,Y,`∀`,`\\forall`,!0),H(U,G,Y,`ℏ`,`\\hbar`,!0),H(U,G,Y,`∃`,`\\exists`,!0),H(U,G,Y,`∇`,`\\nabla`,!0),H(U,G,Y,`♭`,`\\flat`,!0),H(U,G,Y,`ℓ`,`\\ell`,!0),H(U,G,Y,`♮`,`\\natural`,!0),H(U,G,Y,`♣`,`\\clubsuit`,!0),H(U,G,Y,`℘`,`\\wp`,!0),H(U,G,Y,`♯`,`\\sharp`,!0),H(U,G,Y,`♢`,`\\diamondsuit`,!0),H(U,G,Y,`ℜ`,`\\Re`,!0),H(U,G,Y,`♡`,`\\heartsuit`,!0),H(U,G,Y,`ℑ`,`\\Im`,!0),H(U,G,Y,`♠`,`\\spadesuit`,!0),H(U,G,Y,`§`,`\\S`,!0),H(W,G,Y,`§`,`\\S`),H(U,G,Y,`¶`,`\\P`,!0),H(W,G,Y,`¶`,`\\P`),H(U,G,Y,`†`,`\\dag`),H(W,G,Y,`†`,`\\dag`),H(W,G,Y,`†`,`\\textdagger`),H(U,G,Y,`‡`,`\\ddag`),H(W,G,Y,`‡`,`\\ddag`),H(W,G,Y,`‡`,`\\textdaggerdbl`),H(U,G,NO,`⎱`,`\\rmoustache`,!0),H(U,G,LO,`⎰`,`\\lmoustache`,!0),H(U,G,NO,`⟯`,`\\rgroup`,!0),H(U,G,LO,`⟮`,`\\lgroup`,!0),H(U,G,q,`∓`,`\\mp`,!0),H(U,G,q,`⊖`,`\\ominus`,!0),H(U,G,q,`⊎`,`\\uplus`,!0),H(U,G,q,`⊓`,`\\sqcap`,!0),H(U,G,q,`∗`,`\\ast`),H(U,G,q,`⊔`,`\\sqcup`,!0),H(U,G,q,`◯`,`\\bigcirc`,!0),H(U,G,q,`∙`,`\\bullet`,!0),H(U,G,q,`‡`,`\\ddagger`),H(U,G,q,`≀`,`\\wr`,!0),H(U,G,q,`⨿`,`\\amalg`),H(U,G,q,`&`,`\\And`),H(U,G,J,`⟵`,`\\longleftarrow`,!0),H(U,G,J,`⇐`,`\\Leftarrow`,!0),H(U,G,J,`⟸`,`\\Longleftarrow`,!0),H(U,G,J,`⟶`,`\\longrightarrow`,!0),H(U,G,J,`⇒`,`\\Rightarrow`,!0),H(U,G,J,`⟹`,`\\Longrightarrow`,!0),H(U,G,J,`↔`,`\\leftrightarrow`,!0),H(U,G,J,`⟷`,`\\longleftrightarrow`,!0),H(U,G,J,`⇔`,`\\Leftrightarrow`,!0),H(U,G,J,`⟺`,`\\Longleftrightarrow`,!0),H(U,G,J,`↦`,`\\mapsto`,!0),H(U,G,J,`⟼`,`\\longmapsto`,!0),H(U,G,J,`↗`,`\\nearrow`,!0),H(U,G,J,`↩`,`\\hookleftarrow`,!0),H(U,G,J,`↪`,`\\hookrightarrow`,!0),H(U,G,J,`↘`,`\\searrow`,!0),H(U,G,J,`↼`,`\\leftharpoonup`,!0),H(U,G,J,`⇀`,`\\rightharpoonup`,!0),H(U,G,J,`↙`,`\\swarrow`,!0),H(U,G,J,`↽`,`\\leftharpoondown`,!0),H(U,G,J,`⇁`,`\\rightharpoondown`,!0),H(U,G,J,`↖`,`\\nwarrow`,!0),H(U,G,J,`⇌`,`\\rightleftharpoons`,!0),H(U,K,J,`≮`,`\\nless`,!0),H(U,K,J,``,`\\@nleqslant`),H(U,K,J,``,`\\@nleqq`),H(U,K,J,`⪇`,`\\lneq`,!0),H(U,K,J,`≨`,`\\lneqq`,!0),H(U,K,J,``,`\\@lvertneqq`),H(U,K,J,`⋦`,`\\lnsim`,!0),H(U,K,J,`⪉`,`\\lnapprox`,!0),H(U,K,J,`⊀`,`\\nprec`,!0),H(U,K,J,`⋠`,`\\npreceq`,!0),H(U,K,J,`⋨`,`\\precnsim`,!0),H(U,K,J,`⪹`,`\\precnapprox`,!0),H(U,K,J,`≁`,`\\nsim`,!0),H(U,K,J,``,`\\@nshortmid`),H(U,K,J,`∤`,`\\nmid`,!0),H(U,K,J,`⊬`,`\\nvdash`,!0),H(U,K,J,`⊭`,`\\nvDash`,!0),H(U,K,J,`⋪`,`\\ntriangleleft`),H(U,K,J,`⋬`,`\\ntrianglelefteq`,!0),H(U,K,J,`⊊`,`\\subsetneq`,!0),H(U,K,J,``,`\\@varsubsetneq`),H(U,K,J,`⫋`,`\\subsetneqq`,!0),H(U,K,J,``,`\\@varsubsetneqq`),H(U,K,J,`≯`,`\\ngtr`,!0),H(U,K,J,``,`\\@ngeqslant`),H(U,K,J,``,`\\@ngeqq`),H(U,K,J,`⪈`,`\\gneq`,!0),H(U,K,J,`≩`,`\\gneqq`,!0),H(U,K,J,``,`\\@gvertneqq`),H(U,K,J,`⋧`,`\\gnsim`,!0),H(U,K,J,`⪊`,`\\gnapprox`,!0),H(U,K,J,`⊁`,`\\nsucc`,!0),H(U,K,J,`⋡`,`\\nsucceq`,!0),H(U,K,J,`⋩`,`\\succnsim`,!0),H(U,K,J,`⪺`,`\\succnapprox`,!0),H(U,K,J,`≆`,`\\ncong`,!0),H(U,K,J,``,`\\@nshortparallel`),H(U,K,J,`∦`,`\\nparallel`,!0),H(U,K,J,`⊯`,`\\nVDash`,!0),H(U,K,J,`⋫`,`\\ntriangleright`),H(U,K,J,`⋭`,`\\ntrianglerighteq`,!0),H(U,K,J,``,`\\@nsupseteqq`),H(U,K,J,`⊋`,`\\supsetneq`,!0),H(U,K,J,``,`\\@varsupsetneq`),H(U,K,J,`⫌`,`\\supsetneqq`,!0),H(U,K,J,``,`\\@varsupsetneqq`),H(U,K,J,`⊮`,`\\nVdash`,!0),H(U,K,J,`⪵`,`\\precneqq`,!0),H(U,K,J,`⪶`,`\\succneqq`,!0),H(U,K,J,``,`\\@nsubseteqq`),H(U,K,q,`⊴`,`\\unlhd`),H(U,K,q,`⊵`,`\\unrhd`),H(U,K,J,`↚`,`\\nleftarrow`,!0),H(U,K,J,`↛`,`\\nrightarrow`,!0),H(U,K,J,`⇍`,`\\nLeftarrow`,!0),H(U,K,J,`⇏`,`\\nRightarrow`,!0),H(U,K,J,`↮`,`\\nleftrightarrow`,!0),H(U,K,J,`⇎`,`\\nLeftrightarrow`,!0),H(U,K,J,`△`,`\\vartriangle`),H(U,K,Y,`ℏ`,`\\hslash`),H(U,K,Y,`▽`,`\\triangledown`),H(U,K,Y,`◊`,`\\lozenge`),H(U,K,Y,`Ⓢ`,`\\circledS`),H(U,K,Y,`®`,`\\circledR`),H(W,K,Y,`®`,`\\circledR`),H(U,K,Y,`∡`,`\\measuredangle`,!0),H(U,K,Y,`∄`,`\\nexists`),H(U,K,Y,`℧`,`\\mho`),H(U,K,Y,`Ⅎ`,`\\Finv`,!0),H(U,K,Y,`⅁`,`\\Game`,!0),H(U,K,Y,`‵`,`\\backprime`),H(U,K,Y,`▲`,`\\blacktriangle`),H(U,K,Y,`▼`,`\\blacktriangledown`),H(U,K,Y,`■`,`\\blacksquare`),H(U,K,Y,`⧫`,`\\blacklozenge`),H(U,K,Y,`★`,`\\bigstar`),H(U,K,Y,`∢`,`\\sphericalangle`,!0),H(U,K,Y,`∁`,`\\complement`,!0),H(U,K,Y,`ð`,`\\eth`,!0),H(W,G,Y,`ð`,`ð`),H(U,K,Y,`╱`,`\\diagup`),H(U,K,Y,`╲`,`\\diagdown`),H(U,K,Y,`□`,`\\square`),H(U,K,Y,`□`,`\\Box`),H(U,K,Y,`◊`,`\\Diamond`),H(U,K,Y,`¥`,`\\yen`,!0),H(W,K,Y,`¥`,`\\yen`,!0),H(U,K,Y,`✓`,`\\checkmark`,!0),H(W,K,Y,`✓`,`\\checkmark`),H(U,K,Y,`ℶ`,`\\beth`,!0),H(U,K,Y,`ℸ`,`\\daleth`,!0),H(U,K,Y,`ℷ`,`\\gimel`,!0),H(U,K,Y,`ϝ`,`\\digamma`,!0),H(U,K,Y,`ϰ`,`\\varkappa`),H(U,K,LO,`┌`,`\\@ulcorner`,!0),H(U,K,NO,`┐`,`\\@urcorner`,!0),H(U,K,LO,`└`,`\\@llcorner`,!0),H(U,K,NO,`┘`,`\\@lrcorner`,!0),H(U,K,J,`≦`,`\\leqq`,!0),H(U,K,J,`⩽`,`\\leqslant`,!0),H(U,K,J,`⪕`,`\\eqslantless`,!0),H(U,K,J,`≲`,`\\lesssim`,!0),H(U,K,J,`⪅`,`\\lessapprox`,!0),H(U,K,J,`≊`,`\\approxeq`,!0),H(U,K,q,`⋖`,`\\lessdot`),H(U,K,J,`⋘`,`\\lll`,!0),H(U,K,J,`≶`,`\\lessgtr`,!0),H(U,K,J,`⋚`,`\\lesseqgtr`,!0),H(U,K,J,`⪋`,`\\lesseqqgtr`,!0),H(U,K,J,`≑`,`\\doteqdot`),H(U,K,J,`≓`,`\\risingdotseq`,!0),H(U,K,J,`≒`,`\\fallingdotseq`,!0),H(U,K,J,`∽`,`\\backsim`,!0),H(U,K,J,`⋍`,`\\backsimeq`,!0),H(U,K,J,`⫅`,`\\subseteqq`,!0),H(U,K,J,`⋐`,`\\Subset`,!0),H(U,K,J,`⊏`,`\\sqsubset`,!0),H(U,K,J,`≼`,`\\preccurlyeq`,!0),H(U,K,J,`⋞`,`\\curlyeqprec`,!0),H(U,K,J,`≾`,`\\precsim`,!0),H(U,K,J,`⪷`,`\\precapprox`,!0),H(U,K,J,`⊲`,`\\vartriangleleft`),H(U,K,J,`⊴`,`\\trianglelefteq`),H(U,K,J,`⊨`,`\\vDash`,!0),H(U,K,J,`⊪`,`\\Vvdash`,!0),H(U,K,J,`⌣`,`\\smallsmile`),H(U,K,J,`⌢`,`\\smallfrown`),H(U,K,J,`≏`,`\\bumpeq`,!0),H(U,K,J,`≎`,`\\Bumpeq`,!0),H(U,K,J,`≧`,`\\geqq`,!0),H(U,K,J,`⩾`,`\\geqslant`,!0),H(U,K,J,`⪖`,`\\eqslantgtr`,!0),H(U,K,J,`≳`,`\\gtrsim`,!0),H(U,K,J,`⪆`,`\\gtrapprox`,!0),H(U,K,q,`⋗`,`\\gtrdot`),H(U,K,J,`⋙`,`\\ggg`,!0),H(U,K,J,`≷`,`\\gtrless`,!0),H(U,K,J,`⋛`,`\\gtreqless`,!0),H(U,K,J,`⪌`,`\\gtreqqless`,!0),H(U,K,J,`≖`,`\\eqcirc`,!0),H(U,K,J,`≗`,`\\circeq`,!0),H(U,K,J,`≜`,`\\triangleq`,!0),H(U,K,J,`∼`,`\\thicksim`),H(U,K,J,`≈`,`\\thickapprox`),H(U,K,J,`⫆`,`\\supseteqq`,!0),H(U,K,J,`⋑`,`\\Supset`,!0),H(U,K,J,`⊐`,`\\sqsupset`,!0),H(U,K,J,`≽`,`\\succcurlyeq`,!0),H(U,K,J,`⋟`,`\\curlyeqsucc`,!0),H(U,K,J,`≿`,`\\succsim`,!0),H(U,K,J,`⪸`,`\\succapprox`,!0),H(U,K,J,`⊳`,`\\vartriangleright`),H(U,K,J,`⊵`,`\\trianglerighteq`),H(U,K,J,`⊩`,`\\Vdash`,!0),H(U,K,J,`∣`,`\\shortmid`),H(U,K,J,`∥`,`\\shortparallel`),H(U,K,J,`≬`,`\\between`,!0),H(U,K,J,`⋔`,`\\pitchfork`,!0),H(U,K,J,`∝`,`\\varpropto`),H(U,K,J,`◀`,`\\blacktriangleleft`),H(U,K,J,`∴`,`\\therefore`,!0),H(U,K,J,`∍`,`\\backepsilon`),H(U,K,J,`▶`,`\\blacktriangleright`),H(U,K,J,`∵`,`\\because`,!0),H(U,K,J,`⋘`,`\\llless`),H(U,K,J,`⋙`,`\\gggtr`),H(U,K,q,`⊲`,`\\lhd`),H(U,K,q,`⊳`,`\\rhd`),H(U,K,J,`≂`,`\\eqsim`,!0),H(U,G,J,`⋈`,`\\Join`),H(U,K,J,`≑`,`\\Doteq`,!0),H(U,K,q,`∔`,`\\dotplus`,!0),H(U,K,q,`∖`,`\\smallsetminus`),H(U,K,q,`⋒`,`\\Cap`,!0),H(U,K,q,`⋓`,`\\Cup`,!0),H(U,K,q,`⩞`,`\\doublebarwedge`,!0),H(U,K,q,`⊟`,`\\boxminus`,!0),H(U,K,q,`⊞`,`\\boxplus`,!0),H(U,K,q,`⋇`,`\\divideontimes`,!0),H(U,K,q,`⋉`,`\\ltimes`,!0),H(U,K,q,`⋊`,`\\rtimes`,!0),H(U,K,q,`⋋`,`\\leftthreetimes`,!0),H(U,K,q,`⋌`,`\\rightthreetimes`,!0),H(U,K,q,`⋏`,`\\curlywedge`,!0),H(U,K,q,`⋎`,`\\curlyvee`,!0),H(U,K,q,`⊝`,`\\circleddash`,!0),H(U,K,q,`⊛`,`\\circledast`,!0),H(U,K,q,`⋅`,`\\centerdot`),H(U,K,q,`⊺`,`\\intercal`,!0),H(U,K,q,`⋒`,`\\doublecap`),H(U,K,q,`⋓`,`\\doublecup`),H(U,K,q,`⊠`,`\\boxtimes`,!0),H(U,K,J,`⇢`,`\\dashrightarrow`,!0),H(U,K,J,`⇠`,`\\dashleftarrow`,!0),H(U,K,J,`⇇`,`\\leftleftarrows`,!0),H(U,K,J,`⇆`,`\\leftrightarrows`,!0),H(U,K,J,`⇚`,`\\Lleftarrow`,!0),H(U,K,J,`↞`,`\\twoheadleftarrow`,!0),H(U,K,J,`↢`,`\\leftarrowtail`,!0),H(U,K,J,`↫`,`\\looparrowleft`,!0),H(U,K,J,`⇋`,`\\leftrightharpoons`,!0),H(U,K,J,`↶`,`\\curvearrowleft`,!0),H(U,K,J,`↺`,`\\circlearrowleft`,!0),H(U,K,J,`↰`,`\\Lsh`,!0),H(U,K,J,`⇈`,`\\upuparrows`,!0),H(U,K,J,`↿`,`\\upharpoonleft`,!0),H(U,K,J,`⇃`,`\\downharpoonleft`,!0),H(U,G,J,`⊶`,`\\origof`,!0),H(U,G,J,`⊷`,`\\imageof`,!0),H(U,K,J,`⊸`,`\\multimap`,!0),H(U,K,J,`↭`,`\\leftrightsquigarrow`,!0),H(U,K,J,`⇉`,`\\rightrightarrows`,!0),H(U,K,J,`⇄`,`\\rightleftarrows`,!0),H(U,K,J,`↠`,`\\twoheadrightarrow`,!0),H(U,K,J,`↣`,`\\rightarrowtail`,!0),H(U,K,J,`↬`,`\\looparrowright`,!0),H(U,K,J,`↷`,`\\curvearrowright`,!0),H(U,K,J,`↻`,`\\circlearrowright`,!0),H(U,K,J,`↱`,`\\Rsh`,!0),H(U,K,J,`⇊`,`\\downdownarrows`,!0),H(U,K,J,`↾`,`\\upharpoonright`,!0),H(U,K,J,`⇂`,`\\downharpoonright`,!0),H(U,K,J,`⇝`,`\\rightsquigarrow`,!0),H(U,K,J,`⇝`,`\\leadsto`),H(U,K,J,`⇛`,`\\Rrightarrow`,!0),H(U,K,J,`↾`,`\\restriction`),H(U,G,Y,`‘`,"`"),H(U,G,Y,`$`,`\\$`),H(W,G,Y,`$`,`\\$`),H(W,G,Y,`$`,`\\textdollar`),H(U,G,Y,`%`,`\\%`),H(W,G,Y,`%`,`\\%`),H(U,G,Y,`_`,`\\_`),H(W,G,Y,`_`,`\\_`),H(W,G,Y,`_`,`\\textunderscore`),H(U,G,Y,`∠`,`\\angle`,!0),H(U,G,Y,`∞`,`\\infty`,!0),H(U,G,Y,`′`,`\\prime`),H(U,G,Y,`△`,`\\triangle`),H(U,G,Y,`Γ`,`\\Gamma`,!0),H(U,G,Y,`Δ`,`\\Delta`,!0),H(U,G,Y,`Θ`,`\\Theta`,!0),H(U,G,Y,`Λ`,`\\Lambda`,!0),H(U,G,Y,`Ξ`,`\\Xi`,!0),H(U,G,Y,`Π`,`\\Pi`,!0),H(U,G,Y,`Σ`,`\\Sigma`,!0),H(U,G,Y,`Υ`,`\\Upsilon`,!0),H(U,G,Y,`Φ`,`\\Phi`,!0),H(U,G,Y,`Ψ`,`\\Psi`,!0),H(U,G,Y,`Ω`,`\\Omega`,!0),H(U,G,Y,`A`,`Α`),H(U,G,Y,`B`,`Β`),H(U,G,Y,`E`,`Ε`),H(U,G,Y,`Z`,`Ζ`),H(U,G,Y,`H`,`Η`),H(U,G,Y,`I`,`Ι`),H(U,G,Y,`K`,`Κ`),H(U,G,Y,`M`,`Μ`),H(U,G,Y,`N`,`Ν`),H(U,G,Y,`O`,`Ο`),H(U,G,Y,`P`,`Ρ`),H(U,G,Y,`T`,`Τ`),H(U,G,Y,`X`,`Χ`),H(U,G,Y,`¬`,`\\neg`,!0),H(U,G,Y,`¬`,`\\lnot`),H(U,G,Y,`⊤`,`\\top`),H(U,G,Y,`⊥`,`\\bot`),H(U,G,Y,`∅`,`\\emptyset`),H(U,K,Y,`∅`,`\\varnothing`),H(U,G,FO,`α`,`\\alpha`,!0),H(U,G,FO,`β`,`\\beta`,!0),H(U,G,FO,`γ`,`\\gamma`,!0),H(U,G,FO,`δ`,`\\delta`,!0),H(U,G,FO,`ϵ`,`\\epsilon`,!0),H(U,G,FO,`ζ`,`\\zeta`,!0),H(U,G,FO,`η`,`\\eta`,!0),H(U,G,FO,`θ`,`\\theta`,!0),H(U,G,FO,`ι`,`\\iota`,!0),H(U,G,FO,`κ`,`\\kappa`,!0),H(U,G,FO,`λ`,`\\lambda`,!0),H(U,G,FO,`μ`,`\\mu`,!0),H(U,G,FO,`ν`,`\\nu`,!0),H(U,G,FO,`ξ`,`\\xi`,!0),H(U,G,FO,`ο`,`\\omicron`,!0),H(U,G,FO,`π`,`\\pi`,!0),H(U,G,FO,`ρ`,`\\rho`,!0),H(U,G,FO,`σ`,`\\sigma`,!0),H(U,G,FO,`τ`,`\\tau`,!0),H(U,G,FO,`υ`,`\\upsilon`,!0),H(U,G,FO,`ϕ`,`\\phi`,!0),H(U,G,FO,`χ`,`\\chi`,!0),H(U,G,FO,`ψ`,`\\psi`,!0),H(U,G,FO,`ω`,`\\omega`,!0),H(U,G,FO,`ε`,`\\varepsilon`,!0),H(U,G,FO,`ϑ`,`\\vartheta`,!0),H(U,G,FO,`ϖ`,`\\varpi`,!0),H(U,G,FO,`ϱ`,`\\varrho`,!0),H(U,G,FO,`ς`,`\\varsigma`,!0),H(U,G,FO,`φ`,`\\varphi`,!0),H(U,G,q,`∗`,`*`,!0),H(U,G,q,`+`,`+`),H(U,G,q,`−`,`-`,!0),H(U,G,q,`⋅`,`\\cdot`,!0),H(U,G,q,`∘`,`\\circ`,!0),H(U,G,q,`÷`,`\\div`,!0),H(U,G,q,`±`,`\\pm`,!0),H(U,G,q,`×`,`\\times`,!0),H(U,G,q,`∩`,`\\cap`,!0),H(U,G,q,`∪`,`\\cup`,!0),H(U,G,q,`∖`,`\\setminus`,!0),H(U,G,q,`∧`,`\\land`),H(U,G,q,`∨`,`\\lor`),H(U,G,q,`∧`,`\\wedge`,!0),H(U,G,q,`∨`,`\\vee`,!0),H(U,G,Y,`√`,`\\surd`),H(U,G,LO,`⟨`,`\\langle`,!0),H(U,G,LO,`∣`,`\\lvert`),H(U,G,LO,`∥`,`\\lVert`),H(U,G,NO,`?`,`?`),H(U,G,NO,`!`,`!`),H(U,G,NO,`⟩`,`\\rangle`,!0),H(U,G,NO,`∣`,`\\rvert`),H(U,G,NO,`∥`,`\\rVert`),H(U,G,J,`=`,`=`),H(U,G,J,`:`,`:`),H(U,G,J,`≈`,`\\approx`,!0),H(U,G,J,`≅`,`\\cong`,!0),H(U,G,J,`≥`,`\\ge`),H(U,G,J,`≥`,`\\geq`,!0),H(U,G,J,`←`,`\\gets`),H(U,G,J,`>`,`\\gt`,!0),H(U,G,J,`∈`,`\\in`,!0),H(U,G,J,``,`\\@not`),H(U,G,J,`⊂`,`\\subset`,!0),H(U,G,J,`⊃`,`\\supset`,!0),H(U,G,J,`⊆`,`\\subseteq`,!0),H(U,G,J,`⊇`,`\\supseteq`,!0),H(U,K,J,`⊈`,`\\nsubseteq`,!0),H(U,K,J,`⊉`,`\\nsupseteq`,!0),H(U,G,J,`⊨`,`\\models`),H(U,G,J,`←`,`\\leftarrow`,!0),H(U,G,J,`≤`,`\\le`),H(U,G,J,`≤`,`\\leq`,!0),H(U,G,J,`<`,`\\lt`,!0),H(U,G,J,`→`,`\\rightarrow`,!0),H(U,G,J,`→`,`\\to`),H(U,K,J,`≱`,`\\ngeq`,!0),H(U,K,J,`≰`,`\\nleq`,!0),H(U,G,zO,`\xA0`,`\\ `),H(U,G,zO,`\xA0`,`\\space`),H(U,G,zO,`\xA0`,`\\nobreakspace`),H(W,G,zO,`\xA0`,`\\ `),H(W,G,zO,`\xA0`,` `),H(W,G,zO,`\xA0`,`\\space`),H(W,G,zO,`\xA0`,`\\nobreakspace`),H(U,G,zO,``,`\\nobreak`),H(U,G,zO,``,`\\allowbreak`),H(U,G,RO,`,`,`,`),H(U,G,RO,`;`,`;`),H(U,K,q,`⊼`,`\\barwedge`,!0),H(U,K,q,`⊻`,`\\veebar`,!0),H(U,G,q,`⊙`,`\\odot`,!0),H(U,G,q,`⊕`,`\\oplus`,!0),H(U,G,q,`⊗`,`\\otimes`,!0),H(U,G,Y,`∂`,`\\partial`,!0),H(U,G,q,`⊘`,`\\oslash`,!0),H(U,K,q,`⊚`,`\\circledcirc`,!0),H(U,K,q,`⊡`,`\\boxdot`,!0),H(U,G,q,`△`,`\\bigtriangleup`),H(U,G,q,`▽`,`\\bigtriangledown`),H(U,G,q,`†`,`\\dagger`),H(U,G,q,`⋄`,`\\diamond`),H(U,G,q,`⋆`,`\\star`),H(U,G,q,`◃`,`\\triangleleft`),H(U,G,q,`▹`,`\\triangleright`),H(U,G,LO,`{`,`\\{`),H(W,G,Y,`{`,`\\{`),H(W,G,Y,`{`,`\\textbraceleft`),H(U,G,NO,`}`,`\\}`),H(W,G,Y,`}`,`\\}`),H(W,G,Y,`}`,`\\textbraceright`),H(U,G,LO,`{`,`\\lbrace`),H(U,G,NO,`}`,`\\rbrace`),H(U,G,LO,`[`,`\\lbrack`,!0),H(W,G,Y,`[`,`\\lbrack`,!0),H(U,G,NO,`]`,`\\rbrack`,!0),H(W,G,Y,`]`,`\\rbrack`,!0),H(U,G,LO,`(`,`\\lparen`,!0),H(U,G,NO,`)`,`\\rparen`,!0),H(W,G,Y,`<`,`\\textless`,!0),H(W,G,Y,`>`,`\\textgreater`,!0),H(U,G,LO,`⌊`,`\\lfloor`,!0),H(U,G,NO,`⌋`,`\\rfloor`,!0),H(U,G,LO,`⌈`,`\\lceil`,!0),H(U,G,NO,`⌉`,`\\rceil`,!0),H(U,G,Y,`\\`,`\\backslash`),H(U,G,Y,`∣`,`|`),H(U,G,Y,`∣`,`\\vert`),H(W,G,Y,`|`,`\\textbar`,!0),H(U,G,Y,`∥`,`\\|`),H(U,G,Y,`∥`,`\\Vert`),H(W,G,Y,`∥`,`\\textbardbl`),H(W,G,Y,`~`,`\\textasciitilde`),H(W,G,Y,`\\`,`\\textbackslash`),H(W,G,Y,`^`,`\\textasciicircum`),H(U,G,J,`↑`,`\\uparrow`,!0),H(U,G,J,`⇑`,`\\Uparrow`,!0),H(U,G,J,`↓`,`\\downarrow`,!0),H(U,G,J,`⇓`,`\\Downarrow`,!0),H(U,G,J,`↕`,`\\updownarrow`,!0),H(U,G,J,`⇕`,`\\Updownarrow`,!0),H(U,G,IO,`∐`,`\\coprod`),H(U,G,IO,`⋁`,`\\bigvee`),H(U,G,IO,`⋀`,`\\bigwedge`),H(U,G,IO,`⨄`,`\\biguplus`),H(U,G,IO,`⋂`,`\\bigcap`),H(U,G,IO,`⋃`,`\\bigcup`),H(U,G,IO,`∫`,`\\int`),H(U,G,IO,`∫`,`\\intop`),H(U,G,IO,`∬`,`\\iint`),H(U,G,IO,`∭`,`\\iiint`),H(U,G,IO,`∏`,`\\prod`),H(U,G,IO,`∑`,`\\sum`),H(U,G,IO,`⨂`,`\\bigotimes`),H(U,G,IO,`⨁`,`\\bigoplus`),H(U,G,IO,`⨀`,`\\bigodot`),H(U,G,IO,`∮`,`\\oint`),H(U,G,IO,`∯`,`\\oiint`),H(U,G,IO,`∰`,`\\oiiint`),H(U,G,IO,`⨆`,`\\bigsqcup`),H(U,G,IO,`∫`,`\\smallint`),H(W,G,PO,`…`,`\\textellipsis`),H(U,G,PO,`…`,`\\mathellipsis`),H(W,G,PO,`…`,`\\ldots`,!0),H(U,G,PO,`…`,`\\ldots`,!0),H(U,G,PO,`⋯`,`\\@cdots`,!0),H(U,G,PO,`⋱`,`\\ddots`,!0),H(U,G,Y,`⋮`,`\\varvdots`),H(W,G,Y,`⋮`,`\\varvdots`),H(U,G,MO,`ˊ`,`\\acute`),H(U,G,MO,`ˋ`,`\\grave`),H(U,G,MO,`¨`,`\\ddot`),H(U,G,MO,`~`,`\\tilde`),H(U,G,MO,`ˉ`,`\\bar`),H(U,G,MO,`˘`,`\\breve`),H(U,G,MO,`ˇ`,`\\check`),H(U,G,MO,`^`,`\\hat`),H(U,G,MO,`⃗`,`\\vec`),H(U,G,MO,`˙`,`\\dot`),H(U,G,MO,`˚`,`\\mathring`),H(U,G,FO,``,`\\@imath`),H(U,G,FO,``,`\\@jmath`),H(U,G,Y,`ı`,`ı`),H(U,G,Y,`ȷ`,`ȷ`),H(W,G,Y,`ı`,`\\i`,!0),H(W,G,Y,`ȷ`,`\\j`,!0),H(W,G,Y,`ß`,`\\ss`,!0),H(W,G,Y,`æ`,`\\ae`,!0),H(W,G,Y,`œ`,`\\oe`,!0),H(W,G,Y,`ø`,`\\o`,!0),H(W,G,Y,`Æ`,`\\AE`,!0),H(W,G,Y,`Œ`,`\\OE`,!0),H(W,G,Y,`Ø`,`\\O`,!0),H(W,G,MO,`ˊ`,`\\'`),H(W,G,MO,`ˋ`,"\\`"),H(W,G,MO,`ˆ`,`\\^`),H(W,G,MO,`˜`,`\\~`),H(W,G,MO,`ˉ`,`\\=`),H(W,G,MO,`˘`,`\\u`),H(W,G,MO,`˙`,`\\.`),H(W,G,MO,`¸`,`\\c`),H(W,G,MO,`˚`,`\\r`),H(W,G,MO,`ˇ`,`\\v`),H(W,G,MO,`¨`,`\\"`),H(W,G,MO,`˝`,`\\H`),H(W,G,MO,`◯`,`\\textcircled`);var BO={"--":!0,"---":!0,"``":!0,"''":!0};H(W,G,Y,`–`,`--`,!0),H(W,G,Y,`–`,`\\textendash`),H(W,G,Y,`—`,`---`,!0),H(W,G,Y,`—`,`\\textemdash`),H(W,G,Y,`‘`,"`",!0),H(W,G,Y,`‘`,`\\textquoteleft`),H(W,G,Y,`’`,`'`,!0),H(W,G,Y,`’`,`\\textquoteright`),H(W,G,Y,`“`,"``",!0),H(W,G,Y,`“`,`\\textquotedblleft`),H(W,G,Y,`”`,`''`,!0),H(W,G,Y,`”`,`\\textquotedblright`),H(U,G,Y,`°`,`\\degree`,!0),H(W,G,Y,`°`,`\\degree`),H(W,G,Y,`°`,`\\textdegree`,!0),H(U,G,Y,`£`,`\\pounds`),H(U,G,Y,`£`,`\\mathsterling`,!0),H(W,G,Y,`£`,`\\pounds`),H(W,G,Y,`£`,`\\textsterling`,!0),H(U,K,Y,`✠`,`\\maltese`),H(W,K,Y,`✠`,`\\maltese`);for(var VO=`0123456789/@."`,HO=0;HO<VO.length;HO++){var UO=VO.charAt(HO);H(U,G,Y,UO,UO)}for(var WO=`0123456789!@*()-=+";:?/.,`,GO=0;GO<WO.length;GO++){var KO=WO.charAt(GO);H(W,G,Y,KO,KO)}for(var qO=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz`,JO=0;JO<qO.length;JO++){var YO=qO.charAt(JO);H(U,G,FO,YO,YO),H(W,G,Y,YO,YO)}H(U,K,Y,`C`,`ℂ`),H(W,K,Y,`C`,`ℂ`),H(U,K,Y,`H`,`ℍ`),H(W,K,Y,`H`,`ℍ`),H(U,K,Y,`N`,`ℕ`),H(W,K,Y,`N`,`ℕ`),H(U,K,Y,`P`,`ℙ`),H(W,K,Y,`P`,`ℙ`),H(U,K,Y,`Q`,`ℚ`),H(W,K,Y,`Q`,`ℚ`),H(U,K,Y,`R`,`ℝ`),H(W,K,Y,`R`,`ℝ`),H(U,K,Y,`Z`,`ℤ`),H(W,K,Y,`Z`,`ℤ`),H(U,G,FO,`h`,`ℎ`),H(W,G,FO,`h`,`ℎ`);for(var XO,ZO=0;ZO<qO.length;ZO++){var QO=qO.charAt(ZO);XO=String.fromCharCode(55349,56320+ZO),H(U,G,FO,QO,XO),H(W,G,Y,QO,XO),XO=String.fromCharCode(55349,56372+ZO),H(U,G,FO,QO,XO),H(W,G,Y,QO,XO),XO=String.fromCharCode(55349,56424+ZO),H(U,G,FO,QO,XO),H(W,G,Y,QO,XO),XO=String.fromCharCode(55349,56580+ZO),H(U,G,FO,QO,XO),H(W,G,Y,QO,XO),XO=String.fromCharCode(55349,56684+ZO),H(U,G,FO,QO,XO),H(W,G,Y,QO,XO),XO=String.fromCharCode(55349,56736+ZO),H(U,G,FO,QO,XO),H(W,G,Y,QO,XO),XO=String.fromCharCode(55349,56788+ZO),H(U,G,FO,QO,XO),H(W,G,Y,QO,XO),XO=String.fromCharCode(55349,56840+ZO),H(U,G,FO,QO,XO),H(W,G,Y,QO,XO),XO=String.fromCharCode(55349,56944+ZO),H(U,G,FO,QO,XO),H(W,G,Y,QO,XO),ZO<26&&(XO=String.fromCharCode(55349,56632+ZO),H(U,G,FO,QO,XO),H(W,G,Y,QO,XO),XO=String.fromCharCode(55349,56476+ZO),H(U,G,FO,QO,XO),H(W,G,Y,QO,XO))}XO=String.fromCharCode(55349,56668),H(U,G,FO,`k`,XO),H(W,G,Y,`k`,XO);for(var $O=0;$O<10;$O++){var ek=$O.toString();XO=String.fromCharCode(55349,57294+$O),H(U,G,FO,ek,XO),H(W,G,Y,ek,XO),XO=String.fromCharCode(55349,57314+$O),H(U,G,FO,ek,XO),H(W,G,Y,ek,XO),XO=String.fromCharCode(55349,57324+$O),H(U,G,FO,ek,XO),H(W,G,Y,ek,XO),XO=String.fromCharCode(55349,57334+$O),H(U,G,FO,ek,XO),H(W,G,Y,ek,XO)}for(var tk=`ÐÞþ`,nk=0;nk<tk.length;nk++){var rk=tk.charAt(nk);H(U,G,FO,rk,rk),H(W,G,Y,rk,rk)}var ik={mathClass:`mathbf`,textClass:`textbf`,font:`Main-Bold`},ak={mathClass:`mathnormal`,textClass:`textit`,font:`Math-Italic`},ok={mathClass:`boldsymbol`,textClass:`boldsymbol`,font:`Main-BoldItalic`},sk={mathClass:`mathscr`,textClass:`textscr`,font:`Script-Regular`},ck={mathClass:``,textClass:``,font:``},lk={mathClass:`mathfrak`,textClass:`textfrak`,font:`Fraktur-Regular`},uk={mathClass:`mathbb`,textClass:`textbb`,font:`AMS-Regular`},dk={mathClass:`mathboldfrak`,textClass:`textboldfrak`,font:`Fraktur-Regular`},fk={mathClass:`mathsf`,textClass:`textsf`,font:`SansSerif-Regular`},pk={mathClass:`mathboldsf`,textClass:`textboldsf`,font:`SansSerif-Bold`},mk={mathClass:`mathitsf`,textClass:`textitsf`,font:`SansSerif-Italic`},hk={mathClass:`mathtt`,textClass:`texttt`,font:`Typewriter-Regular`},gk=[ik,ik,ak,ak,ok,ok,sk,ck,ck,ck,lk,lk,uk,uk,dk,dk,fk,fk,pk,pk,mk,mk,ck,ck,hk,hk],_k=[ik,ck,fk,pk,hk],vk=e=>{var t=e.charCodeAt(0),n=e.charCodeAt(1),r=(t-55296)*1024+(n-56320)+65536;if(119808<=r&&r<120484)return gk[Math.floor((r-119808)/26)];if(120782<=r&&r<=120831)return _k[Math.floor((r-120782)/10)];if(r===120485||r===120486)return gk[0];if(120486<r&&r<120782)return ck;throw new B(`Unsupported character: `+e)};function yk(e){var t=e.strict,n=e.errorCode,r=e.errorMsg,i=e.token,a=e.report,o=t;if(typeof t==`function`){if(a)o=t(n,r,i);else try{o=t(n,r,i)}catch{o=`error`}}switch(o){case!0:case`error`:if(a)throw new B(`LaTeX-incompatible input and strict mode is set to 'error': `+(r+` [`+n+`]`),i);return!0;case!1:case`ignore`:if(!a)return!1;break;default:if(typeof console<`u`&&console.warn(`LaTeX-incompatible input and strict mode is set to 'warn': `+(r+` [`+n+`]`)),!a)return!1}}var bk=function(e,t,n){if(jO[n][e]){var r=jO[n][e].replace;r&&(e=r)}return{value:e,metrics:OO(e,t,n)}},xk=function(e,t,n,r,i){var a=bk(e,t,n),o=a.metrics;e=a.value;var s;if(o){var c=o.italic;(n===`text`||r&&r.font===`mathit`)&&(c=0),s=new _O(e,o.height,o.depth,c,o.skew,o.width,i)}else yk({strict:r.strict,errorCode:`symbolNotInFont`,errorMsg:`No character metrics for '`+e+`' in style '`+t+`' and mode '`+n+`'`,report:!0}),s=new _O(e,0,0,0,0,0,i);s.maxFontSize=r.sizeMultiplier,r.style.isTight()&&s.classes.push(`mtight`);var l=r.getColor();return l&&(s.style.color=l),s},Sk=function(e,t,n,r){return r===void 0&&(r=[]),n.font===`boldsymbol`&&bk(e,`Main-Bold`,t).metrics?xk(e,`Main-Bold`,t,n,r.concat([`mathbf`])):e===`\\`||jO[t][e].font===`main`?xk(e,`Main-Regular`,t,n,r):xk(e,`AMS-Regular`,t,n,r.concat([`amsrm`]))},Ck=function(e,t,n){return n!==`textord`&&bk(e,`Math-BoldItalic`,t).metrics?{fontName:`Math-BoldItalic`,fontClass:`boldsymbol`}:{fontName:`Main-Bold`,fontClass:`mathbf`}},wk=function(e,t){var n=e.type===`mathord`?`mathord`:`textord`,r=e.mode,i=e.text,a=[`mord`],o=t.font,s=t.fontFamily,c=t.fontWeight,l=t.fontShape,u=r===`math`||r===`text`&&!!o,d=u?o:s,f=``,p=``;if(i.charCodeAt(0)===55349){var m=vk(i);f=m.font,p=m[r+`Class`]}if(f)return xk(i,f,r,t,a.concat(p));if(d){var h,g;if(d===`boldsymbol`){var _=Ck(i,r,n);h=_.fontName,g=[_.fontClass]}else u?(h=Lk[o].fontName,g=[o]):(h=Ik(s,c,l),g=[s,c,l]);if(bk(i,h,r).metrics)return xk(i,h,r,t,a.concat(g));if(Object.prototype.hasOwnProperty.call(BO,i)&&h.slice(0,10)===`Typewriter`){for(var v=[],y=0;y<i.length;y++)v.push(xk(i[y],h,r,t,a.concat(g)));return jk(v)}}if(n===`mathord`)return xk(i,`Math-Italic`,r,t,a.concat([`mathnormal`]));if(n===`textord`){var b=jO[r][i]&&jO[r][i].font;if(b===`ams`)return xk(i,Ik(`amsrm`,c,l),r,t,a.concat(`amsrm`,c,l));if(b===`main`||!b)return xk(i,Ik(`textrm`,c,l),r,t,a.concat(c,l));var x=Ik(b,c,l);return xk(i,x,r,t,a.concat(x,c,l))}throw Error(`unexpected type: `+n+` in makeOrd`)},Tk=(e,t)=>{if(sO(e.classes)!==sO(t.classes)||e.skew!==t.skew||e.maxFontSize!==t.maxFontSize||e.italic!==0&&e.hasClass(`mathnormal`))return!1;if(e.classes.length===1){var n=e.classes[0];if(n===`mbin`||n===`mord`)return!1}for(var r of Object.keys(e.style))if(e.style[r]!==t.style[r])return!1;for(var i of Object.keys(t.style))if(e.style[i]!==t.style[i])return!1;return!0},Ek=e=>{for(var t=0;t<e.length-1;t++){var n=e[t],r=e[t+1];n instanceof _O&&r instanceof _O&&Tk(n,r)&&(n.text+=r.text,n.height=Math.max(n.height,r.height),n.depth=Math.max(n.depth,r.depth),n.italic=r.italic,e.splice(t+1,1),t--)}return e},Dk=function(e){for(var t=0,n=0,r=0,i=0;i<e.children.length;i++){var a=e.children[i];a.height>t&&(t=a.height),a.depth>n&&(n=a.depth),a.maxFontSize>r&&(r=a.maxFontSize)}e.height=t,e.depth=n,e.maxFontSize=r},X=function(e,t,n,r){var i=new pO(e,t,n,r);return Dk(i),i},Ok=(e,t,n,r)=>new pO(e,t,n,r),kk=function(e,t,n){var r=X([e],[],t);return r.height=Math.max(n||t.fontMetrics().defaultRuleThickness,t.minRuleThickness),r.style.borderBottomWidth=V(r.height),r.maxFontSize=1,r},Ak=function(e,t,n,r){var i=new mO(e,t,n,r);return Dk(i),i},jk=function(e){var t=new nO(e);return Dk(t),t},Mk=function(e,t){return e instanceof nO?X([],[e],t):e},Nk=function(e){if(e.positionType===`individualShift`){for(var t=e.children,n=[t[0]],r=-t[0].shift-t[0].elem.depth,i=r,a=1;a<t.length;a++){var o=-t[a].shift-i-t[a].elem.depth,s=o-(t[a-1].elem.height+t[a-1].elem.depth);i+=o,n.push({type:`kern`,size:s}),n.push(t[a])}return{children:n,depth:r}}var c;if(e.positionType===`top`){for(var l=e.positionData,u=0;u<e.children.length;u++){var d=e.children[u];l-=d.type===`kern`?d.size:d.elem.height+d.elem.depth}c=l}else if(e.positionType===`bottom`)c=-e.positionData;else{var f=e.children[0];if(f.type!==`elem`)throw Error(`First child must have type "elem".`);if(e.positionType===`shift`)c=-f.elem.depth-e.positionData;else if(e.positionType===`firstBaseline`)c=-f.elem.depth;else throw Error(`Invalid positionType `+e.positionType+`.`)}return{children:e.children,depth:c}},Pk=function(e,t){for(var n=Nk(e),r=n.children,i=n.depth,a=0,o=0;o<r.length;o++){var s=r[o];if(s.type===`elem`){var c=s.elem;a=Math.max(a,c.maxFontSize,c.height)}}a+=2;var l=X([`pstrut`],[]);l.style.height=V(a);for(var u=[],d=i,f=i,p=i,m=0;m<r.length;m++){var h=r[m];if(h.type===`kern`)p+=h.size;else{var g=h.elem,_=h.wrapperClasses||[],v=h.wrapperStyle||{},y=X(_,[l,g],void 0,v);y.style.top=V(-a-p-g.depth),h.marginLeft&&(y.style.marginLeft=h.marginLeft),h.marginRight&&(y.style.marginRight=h.marginRight),u.push(y),p+=g.height+g.depth}d=Math.min(d,p),f=Math.max(f,p)}var b=X([`vlist`],u);b.style.height=V(f);var x;if(d<0){var S=X([`vlist`],[X([],[])]);S.style.height=V(-d),x=[X([`vlist-r`],[b,X([`vlist-s`],[new _O(`​`)])]),X([`vlist-r`],[S])]}else x=[X([`vlist-r`],[b])];var C=X([`vlist-t`],x);return x.length===2&&C.classes.push(`vlist-t2`),C.height=f,C.depth=-d,C},Fk=(e,t)=>{var n=X([`mspace`],[],t),r=oO(e,t);return n.style.marginRight=V(r),n},Ik=(e,t,n)=>{var r,i;switch(e){case`amsrm`:r=`AMS`;break;case`textrm`:r=`Main`;break;case`textsf`:r=`SansSerif`;break;case`texttt`:r=`Typewriter`;break;default:r=e}return i=t===`textbf`&&n===`textit`?`BoldItalic`:t===`textbf`?`Bold`:n===`textit`?`Italic`:`Regular`,r+`-`+i},Lk={mathbf:{variant:`bold`,fontName:`Main-Bold`},mathrm:{variant:`normal`,fontName:`Main-Regular`},textit:{variant:`italic`,fontName:`Main-Italic`},mathit:{variant:`italic`,fontName:`Main-Italic`},mathnormal:{variant:`italic`,fontName:`Math-Italic`},mathsfit:{variant:`sans-serif-italic`,fontName:`SansSerif-Italic`},mathbb:{variant:`double-struck`,fontName:`AMS-Regular`},mathcal:{variant:`script`,fontName:`Caligraphic-Regular`},mathfrak:{variant:`fraktur`,fontName:`Fraktur-Regular`},mathscr:{variant:`script`,fontName:`Script-Regular`},mathsf:{variant:`sans-serif`,fontName:`SansSerif-Regular`},mathtt:{variant:`monospace`,fontName:`Typewriter-Regular`}},Rk={vec:[`vec`,.471,.714],oiintSize1:[`oiintSize1`,.957,.499],oiintSize2:[`oiintSize2`,1.472,.659],oiiintSize1:[`oiiintSize1`,1.304,.499],oiiintSize2:[`oiiintSize2`,1.98,.659]},zk=function(e,t){var n=Rk[e],r=n[0],i=n[1],a=n[2],o=Ok([`katex-overlay`],[new vO([new yO(r)],{width:V(i),height:V(a),style:`width:`+V(i),viewBox:`0 0 `+1e3*i+` `+1e3*a,preserveAspectRatio:`xMinYMin`})],t);return o.height=a,o.style.height=V(a),o.style.width=V(i),o},Bk={number:3,unit:`mu`},Vk={number:4,unit:`mu`},Hk={number:5,unit:`mu`},Uk={mord:{mop:Bk,mbin:Vk,mrel:Hk,minner:Bk},mop:{mord:Bk,mop:Bk,mrel:Hk,minner:Bk},mbin:{mord:Vk,mop:Vk,mopen:Vk,minner:Vk},mrel:{mord:Hk,mop:Hk,mopen:Hk,minner:Hk},mopen:{},mclose:{mop:Bk,mbin:Vk,mrel:Hk,minner:Bk},mpunct:{mord:Bk,mop:Bk,mrel:Hk,mopen:Bk,mclose:Bk,mpunct:Bk,minner:Bk},minner:{mord:Bk,mop:Bk,mbin:Vk,mrel:Hk,mopen:Bk,mpunct:Bk,minner:Bk}},Wk={mord:{mop:Bk},mop:{mord:Bk,mop:Bk},mbin:{},mrel:{},mopen:{},mclose:{mop:Bk},mpunct:{},minner:{mop:Bk}},Gk={},Kk={},qk={};function Z(e){for(var t=e.type,n=e.names,r=e.htmlBuilder,i=e.mathmlBuilder,a=0;a<n.length;++a)Gk[n[a]]=e;t&&(r&&(Kk[t]=r),i&&(qk[t]=i))}function Jk(e){var t=e.type,n=e.htmlBuilder,r=e.mathmlBuilder;n&&(Kk[t]=n),r&&(qk[t]=r)}var Yk=function(e){return e.type===`ordgroup`&&e.body.length===1?e.body[0]:e},Xk=function(e){return e.type===`ordgroup`?e.body:[e]},Zk=new Set([`leftmost`,`mbin`,`mopen`,`mrel`,`mop`,`mpunct`]),Qk=new Set([`rightmost`,`mrel`,`mclose`,`mpunct`]),$k={display:LD.DISPLAY,text:LD.TEXT,script:LD.SCRIPT,scriptscript:LD.SCRIPTSCRIPT},eA={mord:`mord`,mop:`mop`,mbin:`mbin`,mrel:`mrel`,mopen:`mopen`,mclose:`mclose`,mpunct:`mpunct`,minner:`minner`},tA=function(e,t,n,r){r===void 0&&(r=[null,null]);for(var i=[],a=0;a<e.length;a++){var o=sA(e[a],t);if(o instanceof nO){var s=o.children;i.push(...s)}else i.push(o)}if(Ek(i),!n)return i;var c=t;if(e.length===1){var l=e[0];l.type===`sizing`?c=t.havingSize(l.size):l.type===`styling`&&(c=t.havingStyle($k[l.style]))}var u=X([r[0]||`leftmost`],[],t),d=X([r[1]||`rightmost`],[],t),f=n===`root`;return nA(i,(e,t)=>{var n=t.classes[0],r=e.classes[0];n===`mbin`&&Qk.has(r)?t.classes[0]=`mord`:r===`mbin`&&Zk.has(n)&&(e.classes[0]=`mord`)},{node:u},d,f),nA(i,(e,t)=>{var n=aA(t),r=aA(e),i=n&&r?e.hasClass(`mtight`)?Wk[n]?.[r]:Uk[n]?.[r]:null;if(i)return Fk(i,c)},{node:u},d,f),i},nA=function(e,t,n,r,i){r&&e.push(r);for(var a=0;a<e.length;a++){var o=e[a],s=rA(o);if(s){nA(s.children,t,n,null,i);continue}var c=!o.hasClass(`mspace`);if(c){var l=t(o,n.node);l&&(n.insertAfter?n.insertAfter(l):(e.unshift(l),a++))}c?n.node=o:i&&o.hasClass(`katex-newline`)&&(n.node=X([`leftmost`])),n.insertAfter=(t=>n=>{e.splice(t+1,0,n),a++})(a)}r&&e.pop()},rA=function(e){return e instanceof nO||e instanceof mO||e instanceof pO&&e.hasClass(`enclosing`)?e:null},iA=function(e,t){var n=rA(e);if(n){var r=n.children;if(r.length){if(t===`right`)return iA(r[r.length-1],`right`);if(t===`left`)return iA(r[0],`left`)}}return e},aA=function(e,t){return e?(t&&(e=iA(e,t)),eA[e.classes[0]]||null):null},oA=function(e,t){var n=[`nulldelimiter`].concat(e.baseSizingClasses());return X(t.concat(n))},sA=function(e,t,n){if(!e)return X();if(Kk[e.type]){var r=Kk[e.type](e,t);if(n&&t.size!==n.size){r=X(t.sizingClasses(n),[r],t);var i=t.sizeMultiplier/n.sizeMultiplier;r.height*=i,r.depth*=i}return r}throw new B(`Got group of unknown type: '`+e.type+`'`)};function cA(e,t){var n=X([`katex-base`],e,t),r=X([`katex-strut`]);return r.style.height=V(n.height+n.depth),n.depth&&(r.style.verticalAlign=V(-n.depth)),n.children.unshift(r),n}function lA(e,t){var n=null;e.length===1&&e[0].type===`tag`&&(n=e[0].tag,e=e[0].body);var r=tA(e,t,`root`),i;r.length===2&&r[1].hasClass(`katex-tag`)&&(i=r.pop());for(var a=[],o=[],s=0;s<r.length;s++)if(o.push(r[s]),r[s].hasClass(`mbin`)||r[s].hasClass(`mrel`)||r[s].hasClass(`allowbreak`)){for(var c=!1;s<r.length-1&&r[s+1].hasClass(`mspace`)&&!r[s+1].hasClass(`katex-newline`);)s++,o.push(r[s]),r[s].hasClass(`nobreak`)&&(c=!0);c||(a.push(cA(o,t)),o=[])}else r[s].hasClass(`katex-newline`)&&(o.pop(),o.length>0&&(a.push(cA(o,t)),o=[]),a.push(r[s]));o.length>0&&a.push(cA(o,t));var l;n?(l=cA(tA(n,t,!0),t),l.classes=[`katex-tag`],a.push(l)):i&&a.push(i);var u=X([`katex-html`],a);if(u.setAttribute(`aria-hidden`,`true`),l){var d=l.children[0];d.style.height=V(u.height+u.depth),u.depth&&(d.style.verticalAlign=V(-u.depth))}return u}function uA(e){return new nO(e)}var Q=class{constructor(e,t,n){this.type=void 0,this.attributes=void 0,this.children=void 0,this.classes=void 0,this.type=e,this.attributes={},this.children=t||[],this.classes=n||[]}setAttribute(e,t){this.attributes[e]=t}getAttribute(e){return this.attributes[e]}toNode(){var e=document.createElementNS(`http://www.w3.org/1998/Math/MathML`,this.type);for(var t of Object.entries(this.attributes)){var n=t[0],r=t[1];e.setAttribute(n,r)}this.classes.length>0&&(e.className=sO(this.classes));for(var i=0;i<this.children.length;i++)if(this.children[i]instanceof dA&&this.children[i+1]instanceof dA){for(var a=this.children[i].toText()+this.children[++i].toText();this.children[i+1]instanceof dA;)a+=this.children[++i].toText();e.appendChild(new dA(a).toNode())}else e.appendChild(this.children[i].toNode());return e}toMarkup(){var e=`<`+this.type;for(var t of Object.entries(this.attributes)){var n=t[0],r=t[1];e+=` `+n+`="`,e+=dD(r),e+=`"`}this.classes.length>0&&(e+=` class ="`+dD(sO(this.classes))+`"`),e+=`>`;for(var i=0;i<this.children.length;i++)e+=this.children[i].toMarkup();return e+=`</`+this.type+`>`,e}toText(){return this.children.map(e=>e.toText()).join(``)}},dA=class{constructor(e){this.text=void 0,this.text=e}toNode(){return document.createTextNode(this.text)}toMarkup(){return dD(this.toText())}toText(){return this.text}},fA=class{constructor(e){this.width=void 0,this.character=void 0,this.width=e,this.character=e>=.05555&&e<=.05556?` `:e>=.1666&&e<=.1667?` `:e>=.2222&&e<=.2223?` `:e>=.2777&&e<=.2778?`  `:e>=-.05556&&e<=-.05555?` ⁣`:e>=-.1667&&e<=-.1666?` ⁣`:e>=-.2223&&e<=-.2222?` ⁣`:e>=-.2778&&e<=-.2777?` ⁣`:null}toNode(){if(this.character)return document.createTextNode(this.character);var e=document.createElementNS(`http://www.w3.org/1998/Math/MathML`,`mspace`);return e.setAttribute(`width`,V(this.width)),e}toMarkup(){return this.character?`<mtext>`+this.character+`</mtext>`:`<mspace width="`+V(this.width)+`"/>`}toText(){return this.character?this.character:` `}},pA=new Set([`\\imath`,`\\jmath`]),mA=new Set([`mrow`,`mtable`]),hA=function(e,t,n){var r,i;return jO[t][e]&&jO[t][e].replace&&e.charCodeAt(0)!==55349&&(!Object.prototype.hasOwnProperty.call(BO,e)||(n==null||(r=n.fontFamily)==null?void 0:r.slice(4,6))!==`tt`&&(n==null||(i=n.font)==null?void 0:i.slice(4,6))!==`tt`)&&(e=jO[t][e].replace),new dA(e)},gA=function(e){return e.length===1?e[0]:new Q(`mrow`,e)},_A={mathit:`italic`,boldsymbol:e=>e.type===`textord`?`bold`:`bold-italic`,mathbf:`bold`,mathbb:`double-struck`,mathsfit:`sans-serif-italic`,mathfrak:`fraktur`,mathscr:`script`,mathcal:`script`,mathsf:`sans-serif`,mathtt:`monospace`},vA=(e,t)=>{if(e.mode===`text`){if(t.fontFamily===`texttt`)return`monospace`;if(t.fontFamily===`textsf`)return t.fontShape===`textit`&&t.fontWeight===`textbf`?`sans-serif-bold-italic`:t.fontShape===`textit`?`sans-serif-italic`:t.fontWeight===`textbf`?`bold-sans-serif`:`sans-serif`;if(t.fontShape===`textit`&&t.fontWeight===`textbf`)return`bold-italic`;if(t.fontShape===`textit`)return`italic`;if(t.fontWeight===`textbf`)return`bold`}var n=t.font;if(!n||n===`mathnormal`)return null;var r=e.mode,i=_A[n];if(i)return typeof i==`function`?i(e):i;var a=e.text;if(pA.has(a))return null;if(jO[r][a]){var o=jO[r][a].replace;o&&(a=o)}var s=Lk[n].fontName;return OO(a,s,r)?Lk[n].variant:null};function yA(e){if(!e)return!1;if(e.type===`mi`&&e.children.length===1){var t=e.children[0];return t instanceof dA&&t.text===`.`}if(e.type===`mo`&&e.children.length===1&&e.getAttribute(`separator`)===`true`&&e.getAttribute(`lspace`)===`0em`&&e.getAttribute(`rspace`)===`0em`){var n=e.children[0];return n instanceof dA&&n.text===`,`}return!1}var bA=function(e,t,n){if(e.length===1){var r=SA(e[0],t);return n&&r instanceof Q&&r.type===`mo`&&(r.setAttribute(`lspace`,`0em`),r.setAttribute(`rspace`,`0em`)),[r]}for(var i=[],a,o=0;o<e.length;o++){var s=SA(e[o],t);if(s instanceof Q&&a instanceof Q){if(s.type===`mtext`&&a.type===`mtext`&&s.getAttribute(`mathvariant`)===a.getAttribute(`mathvariant`)){a.children.push(...s.children);continue}if(s.type===`mn`&&a.type===`mn`){a.children.push(...s.children);continue}if(yA(s)&&a.type===`mn`){a.children.push(...s.children);continue}if(s.type===`mn`&&yA(a))s.children=[...a.children,...s.children],i.pop();else if((s.type===`msup`||s.type===`msub`)&&s.children.length>=1&&(a.type===`mn`||yA(a))){var c=s.children[0];c instanceof Q&&c.type===`mn`&&(c.children=[...a.children,...c.children],i.pop())}else if(a.type===`mi`&&a.children.length===1){var l=a.children[0];if(l instanceof dA&&l.text===`̸`&&(s.type===`mo`||s.type===`mi`||s.type===`mn`)){var u=s.children[0];u instanceof dA&&u.text.length>0&&(u.text=u.text.slice(0,1)+`̸`+u.text.slice(1),i.pop())}}}i.push(s),a=s}return i},xA=function(e,t,n){return gA(bA(e,t,n))},SA=function(e,t){if(!e)return new Q(`mrow`);if(qk[e.type])return qk[e.type](e,t);throw new B(`Got group of unknown type: '`+e.type+`'`)};function CA(e,t,n,r,i){var a=bA(e,n),o=a.length===1&&a[0]instanceof Q&&mA.has(a[0].type)?a[0]:new Q(`mrow`,a),s=new Q(`annotation`,[new dA(t)]);s.setAttribute(`encoding`,`application/x-tex`);var c=new Q(`math`,[new Q(`semantics`,[o,s])]);return c.setAttribute(`xmlns`,`http://www.w3.org/1998/Math/MathML`),r&&c.setAttribute(`display`,`block`),X([i?`katex`:`katex-mathml`],[c])}var wA=[[1,1,1],[2,1,1],[3,1,1],[4,2,1],[5,2,1],[6,3,1],[7,4,2],[8,6,3],[9,7,6],[10,8,7],[11,10,9]],TA=[.5,.6,.7,.8,.9,1,1.2,1.44,1.728,2.074,2.488],EA=function(e,t){return t.size<2?e:wA[e-1][t.size-1]},DA=class e{constructor(t){this.style=void 0,this.color=void 0,this.size=void 0,this.textSize=void 0,this.phantom=void 0,this.font=void 0,this.fontFamily=void 0,this.fontWeight=void 0,this.fontShape=void 0,this.sizeMultiplier=void 0,this.maxSize=void 0,this.minRuleThickness=void 0,this._fontMetrics=void 0,this.strict=void 0,this.style=t.style,this.color=t.color,this.size=t.size||e.BASESIZE,this.textSize=t.textSize||this.size,this.phantom=!!t.phantom,this.font=t.font||``,this.fontFamily=t.fontFamily||``,this.fontWeight=t.fontWeight||``,this.fontShape=t.fontShape||``,this.sizeMultiplier=TA[this.size-1],this.maxSize=t.maxSize,this.minRuleThickness=t.minRuleThickness,this.strict=t.strict,this._fontMetrics=void 0}extend(t){var n={style:this.style,size:this.size,textSize:this.textSize,color:this.color,phantom:this.phantom,font:this.font,fontFamily:this.fontFamily,fontWeight:this.fontWeight,fontShape:this.fontShape,maxSize:this.maxSize,minRuleThickness:this.minRuleThickness,strict:this.strict};return Object.assign(n,t),new e(n)}havingStyle(e){return this.style===e?this:this.extend({style:e,size:EA(this.textSize,e)})}havingCrampedStyle(){return this.havingStyle(this.style.cramp())}havingSize(e){return this.size===e&&this.textSize===e?this:this.extend({style:this.style.text(),size:e,textSize:e,sizeMultiplier:TA[e-1]})}havingBaseStyle(t){t||=this.style.text();var n=EA(e.BASESIZE,t);return this.size===n&&this.textSize===e.BASESIZE&&this.style===t?this:this.extend({style:t,size:n})}havingBaseSizing(){var e;switch(this.style.id){case 4:case 5:e=3;break;case 6:case 7:e=1;break;default:e=6}return this.extend({style:this.style.text(),size:e})}withColor(e){return this.extend({color:e})}withPhantom(){return this.extend({phantom:!0})}withFont(e){return this.extend({font:e})}withTextFontFamily(e){return this.extend({fontFamily:e,font:``})}withTextFontWeight(e){return this.extend({fontWeight:e,font:``})}withTextFontShape(e){return this.extend({fontShape:e,font:``})}sizingClasses(e){return e.size===this.size?[]:[`katex-sizing`,`reset-size`+e.size,`size`+this.size]}baseSizingClasses(){return this.size===e.BASESIZE?[]:[`katex-sizing`,`reset-size`+this.size,`size`+e.BASESIZE]}fontMetrics(){return this._fontMetrics||=AO(this.size),this._fontMetrics}getColor(){return this.phantom?`transparent`:this.color}};DA.BASESIZE=6;var OA=e=>new DA({style:e.displayMode?LD.DISPLAY:LD.TEXT,maxSize:e.maxSize,minRuleThickness:e.minRuleThickness,strict:e.strict}),kA=function(e,t){if(t.displayMode){var n=[`katex-display`];t.leqno&&n.push(`leqno`),t.fleqn&&n.push(`fleqn`),e=X(n,[e])}return e},AA=function(e,t,n){var r=OA(n),i;return n.output===`mathml`?CA(e,t,r,n.displayMode,!0):(i=n.output===`html`?X([`katex`],[lA(e,r)]):X([`katex`],[CA(e,t,r,n.displayMode,!1),lA(e,r)]),kA(i,n))},jA=function(e,t){return kA(X([`katex`],[lA(e,OA(t))]),t)},MA={widehat:`^`,widecheck:`ˇ`,widetilde:`~`,utilde:`~`,overleftarrow:`←`,underleftarrow:`←`,xleftarrow:`←`,overrightarrow:`→`,underrightarrow:`→`,xrightarrow:`→`,underbrace:`⏟`,overbrace:`⏞`,underbracket:`⎵`,overbracket:`⎴`,overgroup:`⏠`,undergroup:`⏡`,overleftrightarrow:`↔`,underleftrightarrow:`↔`,xleftrightarrow:`↔`,Overrightarrow:`⇒`,xRightarrow:`⇒`,overleftharpoon:`↼`,xleftharpoonup:`↼`,overrightharpoon:`⇀`,xrightharpoonup:`⇀`,xLeftarrow:`⇐`,xLeftrightarrow:`⇔`,xhookleftarrow:`↩`,xhookrightarrow:`↪`,xmapsto:`↦`,xrightharpoondown:`⇁`,xleftharpoondown:`↽`,xrightleftharpoons:`⇌`,xleftrightharpoons:`⇋`,xtwoheadleftarrow:`↞`,xtwoheadrightarrow:`↠`,xlongequal:`=`,xtofrom:`⇄`,xrightleftarrows:`⇄`,xrightequilibrium:`⇌`,xleftequilibrium:`⇋`,"\\cdrightarrow":`→`,"\\cdleftarrow":`←`,"\\cdlongequal":`=`},NA=function(e){var t=new Q(`mo`,[new dA(MA[e.replace(/^\\/,``)])]);return t.setAttribute(`stretchy`,`true`),t},PA={overrightarrow:[[`rightarrow`],.888,522,`xMaxYMin`],overleftarrow:[[`leftarrow`],.888,522,`xMinYMin`],underrightarrow:[[`rightarrow`],.888,522,`xMaxYMin`],underleftarrow:[[`leftarrow`],.888,522,`xMinYMin`],xrightarrow:[[`rightarrow`],1.469,522,`xMaxYMin`],"\\cdrightarrow":[[`rightarrow`],3,522,`xMaxYMin`],xleftarrow:[[`leftarrow`],1.469,522,`xMinYMin`],"\\cdleftarrow":[[`leftarrow`],3,522,`xMinYMin`],Overrightarrow:[[`doublerightarrow`],.888,560,`xMaxYMin`],xRightarrow:[[`doublerightarrow`],1.526,560,`xMaxYMin`],xLeftarrow:[[`doubleleftarrow`],1.526,560,`xMinYMin`],overleftharpoon:[[`leftharpoon`],.888,522,`xMinYMin`],xleftharpoonup:[[`leftharpoon`],.888,522,`xMinYMin`],xleftharpoondown:[[`leftharpoondown`],.888,522,`xMinYMin`],overrightharpoon:[[`rightharpoon`],.888,522,`xMaxYMin`],xrightharpoonup:[[`rightharpoon`],.888,522,`xMaxYMin`],xrightharpoondown:[[`rightharpoondown`],.888,522,`xMaxYMin`],xlongequal:[[`longequal`],.888,334,`xMinYMin`],"\\cdlongequal":[[`longequal`],3,334,`xMinYMin`],xtwoheadleftarrow:[[`twoheadleftarrow`],.888,334,`xMinYMin`],xtwoheadrightarrow:[[`twoheadrightarrow`],.888,334,`xMaxYMin`],overleftrightarrow:[[`leftarrow`,`rightarrow`],.888,522],overbrace:[[`leftbrace`,`midbrace`,`rightbrace`],1.6,548],underbrace:[[`leftbraceunder`,`midbraceunder`,`rightbraceunder`],1.6,548],underleftrightarrow:[[`leftarrow`,`rightarrow`],.888,522],xleftrightarrow:[[`leftarrow`,`rightarrow`],1.75,522],xLeftrightarrow:[[`doubleleftarrow`,`doublerightarrow`],1.75,560],xrightleftharpoons:[[`leftharpoondownplus`,`rightharpoonplus`],1.75,716],xleftrightharpoons:[[`leftharpoonplus`,`rightharpoondownplus`],1.75,716],xhookleftarrow:[[`leftarrow`,`righthook`],1.08,522],xhookrightarrow:[[`lefthook`,`rightarrow`],1.08,522],overlinesegment:[[`leftlinesegment`,`rightlinesegment`],.888,522],underlinesegment:[[`leftlinesegment`,`rightlinesegment`],.888,522],overbracket:[[`leftbracketover`,`rightbracketover`],1.6,440],underbracket:[[`leftbracketunder`,`rightbracketunder`],1.6,410],overgroup:[[`leftgroup`,`rightgroup`],.888,342],undergroup:[[`leftgroupunder`,`rightgroupunder`],.888,342],xmapsto:[[`leftmapsto`,`rightarrow`],1.5,522],xtofrom:[[`leftToFrom`,`rightToFrom`],1.75,528],xrightleftarrows:[[`baraboveleftarrow`,`rightarrowabovebar`],1.75,901],xrightequilibrium:[[`baraboveshortleftharpoon`,`rightharpoonaboveshortbar`],1.75,716],xleftequilibrium:[[`shortbaraboveleftharpoon`,`shortrightharpoonabovebar`],1.75,716]},FA=new Set([`widehat`,`widecheck`,`widetilde`,`utilde`]),IA=function(e,t){function n(){var n=4e5,r=e.label.slice(1);if(FA.has(r)&&`base`in e){var i=e.base.type===`ordgroup`?e.base.body.length:1,a,o,s;if(i>5)r===`widehat`||r===`widecheck`?(a=420,n=2364,s=.42,o=r+`4`):(a=312,n=2340,s=.34,o=`tilde4`);else{var c=[1,1,2,2,3,3][i];r===`widehat`||r===`widecheck`?(n=[0,1062,2364,2364,2364][c],a=[0,239,300,360,420][c],s=[0,.24,.3,.3,.36,.42][c],o=r+c):(n=[0,600,1033,2339,2340][c],a=[0,260,286,306,312][c],s=[0,.26,.286,.3,.306,.34][c],o=`tilde`+c)}return{span:Ok([],[new vO([new yO(o)],{width:`100%`,height:V(s),viewBox:`0 0 `+n+` `+a,preserveAspectRatio:`none`})],t),minWidth:0,height:s}}var l=[],u=PA[r];if(!u)throw Error(`No SVG data for "`+r+`".`);var d=u[0],f=u[1],p=u[2],m=p/1e3,h=d.length,g,_;if(h===1){if(u.length!==4)throw Error(`Expected 4-tuple for single-path SVG data "`+r+`".`);g=[`hide-tail`],_=[u[3]]}else if(h===2)g=[`halfarrow-left`,`halfarrow-right`],_=[`xMinYMin`,`xMaxYMin`];else if(h===3)g=[`brace-left`,`brace-center`,`brace-right`],_=[`xMinYMin`,`xMidYMin`,`xMaxYMin`];else throw Error(`Correct katexImagesData or update code here to support
395
+ `+h+` children.`);for(var v=0;v<h;v++){var y=new vO([new yO(d[v])],{width:`400em`,height:V(m),viewBox:`0 0 `+n+` `+p,preserveAspectRatio:_[v]+` slice`}),b=Ok([g[v]],[y],t);if(h===1)return{span:b,minWidth:f,height:m};b.style.height=V(m),l.push(b)}return{span:X([`katex-stretchy`],l,t),minWidth:f,height:m}}var r=n(),i=r.span,a=r.minWidth,o=r.height;return i.height=o,i.style.height=V(o),a>0&&(i.style.minWidth=V(a)),i},LA=function(e,t,n,r,i){var a,o=e.height+e.depth+n+r;if(/fbox|color|angl/.test(t)){if(a=X([`katex-stretchy`,t],[],i),t===`fbox`){var s=i.color&&i.getColor();s&&(a.style.borderColor=s)}}else{var c=[];/^[bx]cancel$/.test(t)&&c.push(new bO({x1:`0`,y1:`0`,x2:`100%`,y2:`100%`,"stroke-width":`0.046em`})),/^x?cancel$/.test(t)&&c.push(new bO({x1:`0`,y1:`100%`,x2:`100%`,y2:`0`,"stroke-width":`0.046em`})),a=Ok([],[new vO(c,{width:`100%`,height:V(o)})],i)}return a.height=o,a.style.height=V(o),a},RA=[`bin`,`close`,`inner`,`open`,`punct`,`rel`],zA=[`accent-token`,`mathord`,`op-token`,`spacing`,`textord`],BA=new Set(RA),VA=new Set(zA);function HA(e){return BA.has(e)}function UA(e,t){if(!e||e.type!==t)throw Error(`Expected node of type `+t+`, but got `+(e?`node of type `+e.type:String(e)));return e}function WA(e){var t=GA(e);if(!t)throw Error(`Expected node of symbol group type, but got `+(e?`node of type `+e.type:String(e)));return t}function GA(e){return e.type===`atom`||VA.has(e.type)?e:null}function KA(e,t,n){var r=``;for(var i of e.body)if(i.type===`textord`)r+=i.text;else if(n&&i.type===`spacing`&&i.text===` `)r+=` `;else throw new B(t,e);return r}var qA=e=>{if(e instanceof _O)return e;if(CO(e)&&e.children.length===1)return qA(e.children[0])},JA=(e,t)=>{var n,r,i;e&&e.type===`supsub`?(r=UA(e.base,`accent`),n=r.base,e.base=n,i=SO(sA(e,t)),e.base=r):(r=UA(e,`accent`),n=r.base);var a=sA(n,t.havingCrampedStyle()),o=r.isShifty&&mD(n),s=0;o&&(s=qA(a)?.skew??0);var c=r.label===`\\c`,l=c?a.height+a.depth:Math.min(a.height,t.fontMetrics().xHeight),u;if(r.isStretchy)u=IA(r,t),u=Pk({positionType:`firstBaseline`,children:[{type:`elem`,elem:a},{type:`elem`,elem:u,wrapperClasses:[`svg-align`],wrapperStyle:s>0?{width:`calc(100% - `+V(2*s)+`)`,marginLeft:V(2*s)}:void 0}]});else{var d,f;r.label===`\\vec`?(d=zk(`vec`,t),f=Rk.vec[1]):(d=wk({type:`textord`,mode:r.mode,text:r.label},t),d=xO(d),d.italic=0,f=d.width,c&&(l+=d.depth)),u=X([`accent-body`],[d]);var p=r.label===`\\textcircled`;p&&(u.classes.push(`accent-full`),l=a.height);var m=s;p||(m-=f/2),u.style.left=V(m),r.label===`\\textcircled`&&(u.style.top=`.2em`),u=Pk({positionType:`firstBaseline`,children:[{type:`elem`,elem:a},{type:`kern`,size:-l},{type:`elem`,elem:u}]})}var h=X([`mord`,`katex-accent`],[u],t);return i?(i.children[0]=h,i.height=Math.max(h.height,i.height),i.classes[0]=`mord`,i):h},YA=(e,t)=>{var n=e.isStretchy?NA(e.label):new Q(`mo`,[hA(e.label,e.mode)]),r=new Q(`mover`,[SA(e.base,t),n]);return r.setAttribute(`accent`,`true`),r},XA=new RegExp([`\\acute`,`\\grave`,`\\ddot`,`\\tilde`,`\\bar`,`\\breve`,`\\check`,`\\hat`,`\\vec`,`\\dot`,`\\mathring`].map(e=>`\\`+e).join(`|`));Z({type:`accent`,names:[`\\acute`,`\\grave`,`\\ddot`,`\\tilde`,`\\bar`,`\\breve`,`\\check`,`\\hat`,`\\vec`,`\\dot`,`\\mathring`,`\\widecheck`,`\\widehat`,`\\widetilde`,`\\overrightarrow`,`\\overleftarrow`,`\\Overrightarrow`,`\\overleftrightarrow`,`\\overgroup`,`\\overlinesegment`,`\\overleftharpoon`,`\\overrightharpoon`],numArgs:1,handler:(e,t)=>{var n=Yk(t[0]),r=!XA.test(e.funcName),i=!r||e.funcName===`\\widehat`||e.funcName===`\\widetilde`||e.funcName===`\\widecheck`;return{type:`accent`,mode:e.parser.mode,label:e.funcName,isStretchy:r,isShifty:i,base:n}},htmlBuilder:JA,mathmlBuilder:YA}),Z({type:`accent`,names:[`\\'`,"\\`",`\\^`,`\\~`,`\\=`,`\\u`,`\\.`,`\\"`,`\\c`,`\\r`,`\\H`,`\\v`,`\\textcircled`],numArgs:1,allowedInText:!0,allowedInMath:!0,argTypes:[`primitive`],handler:(e,t)=>{var n=t[0],r=e.parser.mode;return r===`math`&&(yk({strict:e.parser.settings.strict,errorCode:`mathVsTextAccents`,errorMsg:`LaTeX's accent `+e.funcName+` works only in text mode`,report:!0}),r=`text`),{type:`accent`,mode:r,label:e.funcName,isStretchy:!1,isShifty:!0,base:n}}}),Z({type:`accentUnder`,names:[`\\underleftarrow`,`\\underrightarrow`,`\\underleftrightarrow`,`\\undergroup`,`\\underlinesegment`,`\\utilde`],numArgs:1,handler:(e,t)=>{var n=e.parser,r=e.funcName,i=t[0];return{type:`accentUnder`,mode:n.mode,label:r,base:i}},htmlBuilder:(e,t)=>{var n=sA(e.base,t),r=IA(e,t),i=e.label===`\\utilde`?.12:0;return X([`mord`,`accentunder`],[Pk({positionType:`top`,positionData:n.height,children:[{type:`elem`,elem:r,wrapperClasses:[`svg-align`]},{type:`kern`,size:i},{type:`elem`,elem:n}]})],t)},mathmlBuilder:(e,t)=>{var n=NA(e.label),r=new Q(`munder`,[SA(e.base,t),n]);return r.setAttribute(`accentunder`,`true`),r}});var ZA=e=>{var t=new Q(`mpadded`,e?[e]:[]);return t.setAttribute(`width`,`+0.6em`),t.setAttribute(`lspace`,`0.3em`),t};Z({type:`xArrow`,names:[`\\xleftarrow`,`\\xrightarrow`,`\\xLeftarrow`,`\\xRightarrow`,`\\xleftrightarrow`,`\\xLeftrightarrow`,`\\xhookleftarrow`,`\\xhookrightarrow`,`\\xmapsto`,`\\xrightharpoondown`,`\\xrightharpoonup`,`\\xleftharpoondown`,`\\xleftharpoonup`,`\\xrightleftharpoons`,`\\xleftrightharpoons`,`\\xlongequal`,`\\xtwoheadrightarrow`,`\\xtwoheadleftarrow`,`\\xtofrom`,`\\xrightleftarrows`,`\\xrightequilibrium`,`\\xleftequilibrium`,`\\\\cdrightarrow`,`\\\\cdleftarrow`,`\\\\cdlongequal`],numArgs:1,numOptionalArgs:1,handler(e,t,n){var r=e.parser,i=e.funcName;return{type:`xArrow`,mode:r.mode,label:i,body:t[0],below:n[0]}},htmlBuilder(e,t){var n=t.style,r=t.havingStyle(n.sup()),i=Mk(sA(e.body,r,t),t),a=e.label.slice(0,2)===`\\x`?`x`:`cd`;i.classes.push(a+`-arrow-pad`);var o;e.below&&(r=t.havingStyle(n.sub()),o=Mk(sA(e.below,r,t),t),o.classes.push(a+`-arrow-pad`));var s=IA(e,t),c=-t.fontMetrics().axisHeight+.5*s.height,l=-t.fontMetrics().axisHeight-.5*s.height-.111;(i.depth>.25||e.label===`\\xleftequilibrium`)&&(l-=i.depth);var u;if(o){var d=-t.fontMetrics().axisHeight+o.height+.5*s.height+.111;u=Pk({positionType:`individualShift`,children:[{type:`elem`,elem:i,shift:l},{type:`elem`,elem:s,shift:c,wrapperClasses:[`svg-align`]},{type:`elem`,elem:o,shift:d}]})}else u=Pk({positionType:`individualShift`,children:[{type:`elem`,elem:i,shift:l},{type:`elem`,elem:s,shift:c,wrapperClasses:[`svg-align`]}]});return X([`mrel`,`x-arrow`],[u],t)},mathmlBuilder(e,t){var n=NA(e.label);n.setAttribute(`minsize`,e.label.charAt(0)===`x`?`1.75em`:`3.0em`);var r;if(e.body){var i=ZA(SA(e.body,t));r=e.below?new Q(`munderover`,[n,ZA(SA(e.below,t)),i]):new Q(`mover`,[n,i])}else e.below?r=new Q(`munder`,[n,ZA(SA(e.below,t))]):(r=ZA(),r=new Q(`mover`,[n,r]));return r}});function QA(e,t){var n=tA(e.body,t,!0);return X([e.mclass],n,t)}function $A(e,t){var n,r=bA(e.body,t);return e.mclass===`minner`?n=new Q(`mpadded`,r):e.mclass===`mord`?e.isCharacterBox?(n=r[0],n.type=`mi`):n=new Q(`mi`,r):(e.isCharacterBox?(n=r[0],n.type=`mo`):n=new Q(`mo`,r),e.mclass===`mbin`?(n.attributes.lspace=`0.22em`,n.attributes.rspace=`0.22em`):e.mclass===`mpunct`?(n.attributes.lspace=`0em`,n.attributes.rspace=`0.17em`):(e.mclass===`mopen`||e.mclass===`mclose`)&&(n.attributes.lspace=`0em`,n.attributes.rspace=`0em`)),n}Z({type:`mclass`,names:[`\\mathord`,`\\mathbin`,`\\mathrel`,`\\mathopen`,`\\mathclose`,`\\mathpunct`,`\\mathinner`],numArgs:1,primitive:!0,handler(e,t){var n=e.parser,r=e.funcName,i=t[0];return{type:`mclass`,mode:n.mode,mclass:`m`+r.slice(5),body:Xk(i),isCharacterBox:mD(i)}},htmlBuilder:QA,mathmlBuilder:$A});var ej=e=>{var t=e.type===`ordgroup`&&e.body.length?e.body[0]:e;return t.type===`atom`&&(t.family===`bin`||t.family===`rel`)?`m`+t.family:`mord`};Z({type:`mclass`,names:[`\\@binrel`],numArgs:2,handler(e,t){return{type:`mclass`,mode:e.parser.mode,mclass:ej(t[0]),body:Xk(t[1]),isCharacterBox:mD(t[1])}}}),Z({type:`mclass`,names:[`\\stackrel`,`\\overset`,`\\underset`],numArgs:2,handler(e,t){var n=e.parser,r=e.funcName,i=t[1],a=t[0],o=r===`\\stackrel`?`mrel`:ej(i),s={type:`op`,mode:i.mode,limits:!0,alwaysHandleSupSub:!0,parentIsSupSub:!1,symbol:!1,suppressBaseShift:r!==`\\stackrel`,body:Xk(i)},c=r===`\\underset`?{type:`supsub`,mode:a.mode,base:s,sub:a}:{type:`supsub`,mode:a.mode,base:s,sup:a};return{type:`mclass`,mode:n.mode,mclass:o,body:[c],isCharacterBox:mD(c)}}}),Z({type:`pmb`,names:[`\\pmb`],numArgs:1,allowedInText:!0,handler(e,t){return{type:`pmb`,mode:e.parser.mode,mclass:ej(t[0]),body:Xk(t[0])}},htmlBuilder(e,t){var n=tA(e.body,t,!0),r=X([e.mclass],n,t);return r.style.textShadow=`0.02em 0.01em 0.04px`,r},mathmlBuilder(e,t){var n=new Q(`mstyle`,bA(e.body,t));return n.setAttribute(`style`,`text-shadow: 0.02em 0.01em 0.04px`),n}});var tj={">":`\\\\cdrightarrow`,"<":`\\\\cdleftarrow`,"=":`\\\\cdlongequal`,A:`\\uparrow`,V:`\\downarrow`,"|":`\\Vert`,".":`no arrow`},nj=()=>({type:`styling`,body:[],mode:`math`,style:`display`,resetFont:!0}),rj=e=>e.type===`textord`&&e.text===`@`,ij=(e,t)=>(e.type===`mathord`||e.type===`atom`)&&e.text===t;function aj(e,t,n){var r=tj[e];switch(r){case`\\\\cdrightarrow`:case`\\\\cdleftarrow`:return n.callFunction(r,[t[0]],[t[1]]);case`\\uparrow`:case`\\downarrow`:var i=n.callFunction(`\\\\cdleft`,[t[0]],[]),a={type:`atom`,text:r,mode:`math`,family:`rel`},o={type:`ordgroup`,mode:`math`,body:[i,n.callFunction(`\\Big`,[a],[]),n.callFunction(`\\\\cdright`,[t[1]],[])]};return n.callFunction(`\\\\cdparent`,[o],[]);case`\\\\cdlongequal`:return n.callFunction(`\\\\cdlongequal`,[],[]);case`\\Vert`:return n.callFunction(`\\Big`,[{type:`textord`,text:`\\Vert`,mode:`math`}],[]);default:return{type:`textord`,text:` `,mode:`math`}}}function oj(e){var t=[];for(e.gullet.beginGroup(),e.gullet.macros.set(`\\cr`,`\\\\\\relax`),e.gullet.beginGroup();;){t.push(e.parseExpression(!1,`\\\\`)),e.gullet.endGroup(),e.gullet.beginGroup();var n=e.fetch().text;if(n===`&`||n===`\\\\`)e.consume();else if(n===`\\end`){t[t.length-1].length===0&&t.pop();break}else throw new B(`Expected \\\\ or \\cr or \\end`,e.nextToken)}for(var r=[],i=[r],a=0;a<t.length;a++){for(var o=t[a],s=nj(),c=0;c<o.length;c++)if(!rj(o[c]))s.body.push(o[c]);else{r.push(s),c+=1;var l=WA(o[c]).text,u=[,,];if(u[0]={type:`ordgroup`,mode:`math`,body:[]},u[1]={type:`ordgroup`,mode:`math`,body:[]},!`=|.`.includes(l)){if(`<>AV`.includes(l))for(var d=0;d<2;d++){for(var f=!0,p=c+1;p<o.length;p++){if(ij(o[p],l)){f=!1,c=p;break}if(rj(o[p]))throw new B(`Missing a `+l+` character to complete a CD arrow.`,o[p]);u[d].body.push(o[p])}if(f)throw new B(`Missing a `+l+` character to complete a CD arrow.`,o[c])}else throw new B(`Expected one of "<>AV=|." after @`,o[c])}var m={type:`styling`,body:[aj(l,u,e)],mode:`math`,style:`display`,resetFont:!0};r.push(m),s=nj()}a%2==0?r.push(s):r.shift(),r=[],i.push(r)}return e.gullet.endGroup(),e.gullet.endGroup(),{type:`array`,mode:`math`,body:i,arraystretch:1,addJot:!0,rowGaps:[null],cols:Array(i[0].length).fill({type:`align`,align:`c`,pregap:.25,postgap:.25}),colSeparationType:`CD`,hLinesBeforeRow:Array(i.length+1).fill([])}}Z({type:`cdlabel`,names:[`\\\\cdleft`,`\\\\cdright`],numArgs:1,handler(e,t){var n=e.parser,r=e.funcName;return{type:`cdlabel`,mode:n.mode,side:r.slice(4),label:t[0]}},htmlBuilder(e,t){var n=t.havingStyle(t.style.sup()),r=Mk(sA(e.label,n,t),t);return r.classes.push(`cd-label-`+e.side),r.style.bottom=V(.8-r.depth),r.height=0,r.depth=0,r},mathmlBuilder(e,t){var n=new Q(`mrow`,[SA(e.label,t)]);return n=new Q(`mpadded`,[n]),n.setAttribute(`width`,`0`),e.side===`left`&&n.setAttribute(`lspace`,`-1width`),n.setAttribute(`voffset`,`0.7em`),n=new Q(`mstyle`,[n]),n.setAttribute(`displaystyle`,`false`),n.setAttribute(`scriptlevel`,`1`),n}}),Z({type:`cdlabelparent`,names:[`\\\\cdparent`],numArgs:1,handler(e,t){return{type:`cdlabelparent`,mode:e.parser.mode,fragment:t[0]}},htmlBuilder(e,t){var n=Mk(sA(e.fragment,t),t);return n.classes.push(`cd-vert-arrow`),n},mathmlBuilder(e,t){return new Q(`mrow`,[SA(e.fragment,t)])}}),Z({type:`textord`,names:[`\\@char`],numArgs:1,allowedInText:!0,handler(e,t){var n=e.parser,r=KA(UA(t[0],`ordgroup`),`\\@char has non-numeric argument`),i=parseInt(r),a;if(isNaN(i))throw new B(`\\@char has non-numeric argument `+r);if(i<0||i>1114111)throw new B(`\\@char with invalid code point `+r);return i<=65535?a=String.fromCharCode(i):(i-=65536,a=String.fromCharCode((i>>10)+55296,(i&1023)+56320)),{type:`textord`,mode:n.mode,text:a}}}),Z({type:`color`,names:[`\\textcolor`],numArgs:2,allowedInText:!0,argTypes:[`color`,`original`],handler(e,t){var n=e.parser,r=UA(t[0],`color-token`).color,i=t[1];return{type:`color`,mode:n.mode,color:r,body:Xk(i)}},htmlBuilder:(e,t)=>jk(tA(e.body,t.withColor(e.color),!1)),mathmlBuilder:(e,t)=>{var n=new Q(`mstyle`,bA(e.body,t.withColor(e.color)));return n.setAttribute(`mathcolor`,e.color),n}}),Z({type:`color`,names:[`\\color`],numArgs:1,allowedInText:!0,argTypes:[`color`],handler(e,t){var n=e.parser,r=e.breakOnTokenText,i=UA(t[0],`color-token`).color;n.gullet.macros.set(`\\current@color`,i);var a=n.parseExpression(!0,r);return{type:`color`,mode:n.mode,color:i,body:a}}}),Z({type:`cr`,names:[`\\\\`],numArgs:0,numOptionalArgs:0,allowedInText:!0,handler(e){var t=e.parser,n=t.gullet.future().text===`[`?t.parseSizeGroup(!0):null,r=!t.settings.displayMode||!yk({strict:t.settings.strict,errorCode:`newLineInDisplayMode`,errorMsg:`In LaTeX, \\\\ or \\newline does nothing in display mode`,report:!1});return{type:`cr`,mode:t.mode,newLine:r,size:n&&UA(n,`size`).value}},htmlBuilder(e,t){var n=X([`mspace`],[],t);return e.newLine&&(n.classes.push(`katex-newline`),e.size&&(n.style.marginTop=V(oO(e.size,t)))),n},mathmlBuilder(e,t){var n=new Q(`mspace`);return e.newLine&&(n.setAttribute(`linebreak`,`newline`),e.size&&n.setAttribute(`height`,V(oO(e.size,t)))),n}});var sj={"\\global":`\\global`,"\\long":`\\\\globallong`,"\\\\globallong":`\\\\globallong`,"\\def":`\\gdef`,"\\gdef":`\\gdef`,"\\edef":`\\xdef`,"\\xdef":`\\xdef`,"\\let":`\\\\globallet`,"\\futurelet":`\\\\globalfuture`},cj=e=>{var t=e.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(t))throw new B(`Expected a control sequence`,e);return t},lj=e=>{var t=e.gullet.popToken();return t.text===`=`&&(t=e.gullet.popToken(),t.text===` `&&(t=e.gullet.popToken())),t},uj=(e,t,n,r)=>{var i=e.gullet.macros.get(n.text);i??=(n.noexpand=!0,{tokens:[n],numArgs:0,unexpandable:!e.gullet.isExpandable(n.text)}),e.gullet.macros.set(t,i,r)};Z({type:`internal`,names:[`\\global`,`\\long`,`\\\\globallong`],numArgs:0,allowedInText:!0,handler(e){var t=e.parser,n=e.funcName;t.consumeSpaces();var r=t.fetch();if(sj[r.text])return(n===`\\global`||n===`\\\\globallong`)&&(r.text=sj[r.text]),UA(t.parseFunction(),`internal`);throw new B(`Invalid token after macro prefix`,r)}}),Z({type:`internal`,names:[`\\def`,`\\gdef`,`\\edef`,`\\xdef`],numArgs:0,allowedInText:!0,primitive:!0,handler(e){var t=e.parser,n=e.funcName,r=t.gullet.popToken(),i=r.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(i))throw new B(`Expected a control sequence`,r);for(var a=0,o,s=[[]];t.gullet.future().text!==`{`;)if(r=t.gullet.popToken(),r.text===`#`){if(t.gullet.future().text===`{`){o=t.gullet.future(),s[a].push(`{`);break}if(r=t.gullet.popToken(),!/^[1-9]$/.test(r.text))throw new B(`Invalid argument number "`+r.text+`"`);if(parseInt(r.text)!==a+1)throw new B(`Argument number "`+r.text+`" out of order`);a++,s.push([])}else if(r.text===`EOF`)throw new B(`Expected a macro definition`);else s[a].push(r.text);var c=t.gullet.consumeArg().tokens;return o&&c.unshift(o),(n===`\\edef`||n===`\\xdef`)&&(c=t.gullet.expandTokens(c),c.reverse()),t.gullet.macros.set(i,{tokens:c,numArgs:a,delimiters:s},n===sj[n]),{type:`internal`,mode:t.mode}}}),Z({type:`internal`,names:[`\\let`,`\\\\globallet`],numArgs:0,allowedInText:!0,primitive:!0,handler(e){var t=e.parser,n=e.funcName,r=cj(t.gullet.popToken());return t.gullet.consumeSpaces(),uj(t,r,lj(t),n===`\\\\globallet`),{type:`internal`,mode:t.mode}}}),Z({type:`internal`,names:[`\\futurelet`,`\\\\globalfuture`],numArgs:0,allowedInText:!0,primitive:!0,handler(e){var t=e.parser,n=e.funcName,r=cj(t.gullet.popToken()),i=t.gullet.popToken(),a=t.gullet.popToken();return uj(t,r,a,n===`\\\\globalfuture`),t.gullet.pushToken(a),t.gullet.pushToken(i),{type:`internal`,mode:t.mode}}});var dj=function(e,t,n){var r=OO(jO.math[e]&&jO.math[e].replace||e,t,n);if(!r)throw Error(`Unsupported symbol `+e+` and font size `+t+`.`);return r},fj=function(e,t,n,r){var i=n.havingBaseStyle(t),a=X(r.concat(i.sizingClasses(n)),[e],n),o=i.sizeMultiplier/n.sizeMultiplier;return a.height*=o,a.depth*=o,a.maxFontSize=i.sizeMultiplier,a},pj=function(e,t,n){var r=t.havingBaseStyle(n),i=(1-t.sizeMultiplier/r.sizeMultiplier)*t.fontMetrics().axisHeight;e.classes.push(`delimcenter`),e.style.top=V(i),e.height-=i,e.depth+=i},mj=function(e,t,n,r,i,a){var o=fj(xk(e,`Main-Regular`,i,r),t,r,a);return n&&pj(o,r,t),o},hj=function(e,t,n,r){return xk(e,`Size`+t+`-Regular`,n,r)},gj=function(e,t,n,r,i,a){var o=hj(e,t,i,r),s=fj(X([`delimsizing`,`size`+t],[o],r),LD.TEXT,r,a);return n&&pj(s,r,LD.TEXT),s},_j=function(e,t,n,r){return{type:`elem`,elem:X([`delimsizinginner`,t===`Size1-Regular`?`delim-size1`:`delim-size4`],[X([],[xk(e,t,n,r)])])}},vj=function(e,t,n){var r=wO[`Size4-Regular`][e.charCodeAt(0)]?wO[`Size4-Regular`][e.charCodeAt(0)][4]:wO[`Size1-Regular`][e.charCodeAt(0)][4],i=Ok([],[new vO([new yO(`inner`,QD(e,Math.round(1e3*t)))],{width:V(r),height:V(t),style:`width:`+V(r),viewBox:`0 0 `+1e3*r+` `+Math.round(1e3*t),preserveAspectRatio:`xMinYMin`})],n);return i.height=t,i.style.height=V(t),i.style.width=V(r),{type:`elem`,elem:i}},yj=.008,bj={type:`kern`,size:-1*yj},xj=new Set([`|`,`\\lvert`,`\\rvert`,`\\vert`]),Sj=new Set([`\\|`,`\\lVert`,`\\rVert`,`\\Vert`]),Cj=function(e,t,n,r,i,a){var o,s,c,l,u=``,d=0;o=c=l=e,s=null;var f=`Size1-Regular`;e===`\\uparrow`?c=l=`⏐`:e===`\\Uparrow`?c=l=`‖`:e===`\\downarrow`?o=c=`⏐`:e===`\\Downarrow`?o=c=`‖`:e===`\\updownarrow`?(o=`\\uparrow`,c=`⏐`,l=`\\downarrow`):e===`\\Updownarrow`?(o=`\\Uparrow`,c=`‖`,l=`\\Downarrow`):xj.has(e)?(c=`∣`,u=`vert`,d=333):Sj.has(e)?(c=`∥`,u=`doublevert`,d=556):e===`[`||e===`\\lbrack`?(o=`⎡`,c=`⎢`,l=`⎣`,f=`Size4-Regular`,u=`lbrack`,d=667):e===`]`||e===`\\rbrack`?(o=`⎤`,c=`⎥`,l=`⎦`,f=`Size4-Regular`,u=`rbrack`,d=667):e===`\\lfloor`||e===`⌊`?(c=o=`⎢`,l=`⎣`,f=`Size4-Regular`,u=`lfloor`,d=667):e===`\\lceil`||e===`⌈`?(o=`⎡`,c=l=`⎢`,f=`Size4-Regular`,u=`lceil`,d=667):e===`\\rfloor`||e===`⌋`?(c=o=`⎥`,l=`⎦`,f=`Size4-Regular`,u=`rfloor`,d=667):e===`\\rceil`||e===`⌉`?(o=`⎤`,c=l=`⎥`,f=`Size4-Regular`,u=`rceil`,d=667):e===`(`||e===`\\lparen`?(o=`⎛`,c=`⎜`,l=`⎝`,f=`Size4-Regular`,u=`lparen`,d=875):e===`)`||e===`\\rparen`?(o=`⎞`,c=`⎟`,l=`⎠`,f=`Size4-Regular`,u=`rparen`,d=875):e===`\\{`||e===`\\lbrace`?(o=`⎧`,s=`⎨`,l=`⎩`,c=`⎪`,f=`Size4-Regular`):e===`\\}`||e===`\\rbrace`?(o=`⎫`,s=`⎬`,l=`⎭`,c=`⎪`,f=`Size4-Regular`):e===`\\lgroup`||e===`⟮`?(o=`⎧`,l=`⎩`,c=`⎪`,f=`Size4-Regular`):e===`\\rgroup`||e===`⟯`?(o=`⎫`,l=`⎭`,c=`⎪`,f=`Size4-Regular`):e===`\\lmoustache`||e===`⎰`?(o=`⎧`,l=`⎭`,c=`⎪`,f=`Size4-Regular`):(e===`\\rmoustache`||e===`⎱`)&&(o=`⎫`,l=`⎩`,c=`⎪`,f=`Size4-Regular`);var p=dj(o,f,i),m=p.height+p.depth,h=dj(c,f,i),g=h.height+h.depth,_=dj(l,f,i),v=_.height+_.depth,y=0,b=1;if(s!==null){var x=dj(s,f,i);y=x.height+x.depth,b=2}var S=m+v+y,C=S+Math.max(0,Math.ceil((t-S)/(b*g)))*b*g,w=r.fontMetrics().axisHeight;n&&(w*=r.sizeMultiplier);var T=C/2-w,E=[];if(u.length>0){var D=C-m-v,ee=Math.round(C*1e3),O=eO(u,Math.round(D*1e3)),te=new yO(u,O),ne=V(d/1e3),re=V(ee/1e3),ie=Ok([],[new vO([te],{width:ne,height:re,viewBox:`0 0 `+d+` `+ee})],r);ie.height=ee/1e3,ie.style.width=ne,ie.style.height=re,E.push({type:`elem`,elem:ie})}else{if(E.push(_j(l,f,i,r)),E.push(bj),s===null){var k=C-m-v+2*yj;E.push(vj(c,k,r))}else{var ae=(C-m-v-y)/2+2*yj;E.push(vj(c,ae,r)),E.push(bj),E.push(_j(s,f,i,r)),E.push(bj),E.push(vj(c,ae,r))}E.push(bj),E.push(_j(o,f,i,r))}var A=r.havingBaseStyle(LD.TEXT);return fj(X([`delimsizing`,`mult`],[Pk({positionType:`bottom`,positionData:T,children:E})],A),LD.TEXT,r,a)},wj=80,Tj=.08,Ej=function(e,t,n,r,i){return Ok([`hide-tail`],[new vO([new yO(e,ZD(e,r,n))],{width:`400em`,height:V(t),viewBox:`0 0 400000 `+n,preserveAspectRatio:`xMinYMin slice`})],i)},Dj=function(e,t){var n=t.havingBaseSizing(),r=Lj(`\\surd`,e*n.sizeMultiplier,Fj,n),i=n.sizeMultiplier,a=Math.max(0,t.minRuleThickness-t.fontMetrics().sqrtRuleThickness),o,s,c,l,u;return r.type===`small`?(l=1e3+1e3*a+wj,e<1?i=1:e<1.4&&(i=.7),s=(1+a+Tj)/i,c=(1+a)/i,o=Ej(`sqrtMain`,s,l,a,t),o.style.minWidth=`0.853em`,u=.833/i):r.type===`large`?(l=(1e3+wj)*jj[r.size],c=(jj[r.size]+a)/i,s=(jj[r.size]+a+Tj)/i,o=Ej(`sqrtSize`+r.size,s,l,a,t),o.style.minWidth=`1.02em`,u=1/i):(s=e+a+Tj,c=e+a,l=Math.floor(1e3*e+a)+wj,o=Ej(`sqrtTall`,s,l,a,t),o.style.minWidth=`0.742em`,u=1.056),o.height=c,o.style.height=V(s),{span:o,advanceWidth:u,ruleWidth:(t.fontMetrics().sqrtRuleThickness+a)*i}},Oj=new Set([`(`,`\\lparen`,`)`,`\\rparen`,`[`,`\\lbrack`,`]`,`\\rbrack`,`\\{`,`\\lbrace`,`\\}`,`\\rbrace`,`\\lfloor`,`\\rfloor`,`⌊`,`⌋`,`\\lceil`,`\\rceil`,`⌈`,`⌉`,`\\surd`]),kj=new Set([`\\uparrow`,`\\downarrow`,`\\updownarrow`,`\\Uparrow`,`\\Downarrow`,`\\Updownarrow`,`|`,`\\|`,`\\vert`,`\\Vert`,`\\lvert`,`\\rvert`,`\\lVert`,`\\rVert`,`\\lgroup`,`\\rgroup`,`⟮`,`⟯`,`\\lmoustache`,`\\rmoustache`,`⎰`,`⎱`]),Aj=new Set([`<`,`>`,`\\langle`,`\\rangle`,`/`,`\\backslash`,`\\lt`,`\\gt`]),jj=[0,1.2,1.8,2.4,3],Mj=function(e,t,n,r,i){if(e===`<`||e===`\\lt`||e===`⟨`?e=`\\langle`:(e===`>`||e===`\\gt`||e===`⟩`)&&(e=`\\rangle`),Oj.has(e)||Aj.has(e))return gj(e,t,!1,n,r,i);if(kj.has(e))return Cj(e,jj[t],!1,n,r,i);throw new B(`Illegal delimiter: '`+e+`'`)},Nj=[{type:`small`,style:LD.SCRIPTSCRIPT},{type:`small`,style:LD.SCRIPT},{type:`small`,style:LD.TEXT},{type:`large`,size:1},{type:`large`,size:2},{type:`large`,size:3},{type:`large`,size:4}],Pj=[{type:`small`,style:LD.SCRIPTSCRIPT},{type:`small`,style:LD.SCRIPT},{type:`small`,style:LD.TEXT},{type:`stack`}],Fj=[{type:`small`,style:LD.SCRIPTSCRIPT},{type:`small`,style:LD.SCRIPT},{type:`small`,style:LD.TEXT},{type:`large`,size:1},{type:`large`,size:2},{type:`large`,size:3},{type:`large`,size:4},{type:`stack`}],Ij=function(e){if(e.type===`small`)return`Main-Regular`;if(e.type===`large`)return`Size`+e.size+`-Regular`;if(e.type===`stack`)return`Size4-Regular`;var t=e.type;throw Error(`Add support for delim type '`+t+`' here.`)},Lj=function(e,t,n,r){for(var i=Math.min(2,3-r.style.size);i<n.length;i++){var a=n[i];if(a.type===`stack`)break;var o=dj(e,Ij(a),`math`),s=o.height+o.depth;if(a.type===`small`){var c=r.havingBaseStyle(a.style);s*=c.sizeMultiplier}if(s>t)return a}return n[n.length-1]},Rj=function(e,t,n,r,i,a){e===`<`||e===`\\lt`||e===`⟨`?e=`\\langle`:(e===`>`||e===`\\gt`||e===`⟩`)&&(e=`\\rangle`);var o=Aj.has(e)?Nj:Oj.has(e)?Fj:Pj,s=Lj(e,t,o,r);return s.type===`small`?mj(e,s.style,n,r,i,a):s.type===`large`?gj(e,s.size,n,r,i,a):Cj(e,t,n,r,i,a)},zj=function(e,t,n,r,i,a){var o=r.fontMetrics().axisHeight*r.sizeMultiplier,s=901,c=5/r.fontMetrics().ptPerEm,l=Math.max(t-o,n+o);return Rj(e,Math.max(l/500*s,2*l-c),!0,r,i,a)},Bj={"\\bigl":{mclass:`mopen`,size:1},"\\Bigl":{mclass:`mopen`,size:2},"\\biggl":{mclass:`mopen`,size:3},"\\Biggl":{mclass:`mopen`,size:4},"\\bigr":{mclass:`mclose`,size:1},"\\Bigr":{mclass:`mclose`,size:2},"\\biggr":{mclass:`mclose`,size:3},"\\Biggr":{mclass:`mclose`,size:4},"\\bigm":{mclass:`mrel`,size:1},"\\Bigm":{mclass:`mrel`,size:2},"\\biggm":{mclass:`mrel`,size:3},"\\Biggm":{mclass:`mrel`,size:4},"\\big":{mclass:`mord`,size:1},"\\Big":{mclass:`mord`,size:2},"\\bigg":{mclass:`mord`,size:3},"\\Bigg":{mclass:`mord`,size:4}},Vj=new Set(`(,\\lparen,),\\rparen,[,\\lbrack,],\\rbrack,\\{,\\lbrace,\\},\\rbrace,\\lfloor,\\rfloor,⌊,⌋,\\lceil,\\rceil,⌈,⌉,<,>,\\langle,⟨,\\rangle,⟩,\\lt,\\gt,\\lvert,\\rvert,\\lVert,\\rVert,\\lgroup,\\rgroup,⟮,⟯,\\lmoustache,\\rmoustache,⎰,⎱,/,\\backslash,|,\\vert,\\|,\\Vert,\\uparrow,\\Uparrow,\\downarrow,\\Downarrow,\\updownarrow,\\Updownarrow,.`.split(`,`));function Hj(e){return`isMiddle`in e}function Uj(e,t){var n=GA(e);if(n&&Vj.has(n.text))return n;throw n?new B(`Invalid delimiter '`+n.text+`' after '`+t.funcName+`'`,e):new B(`Invalid delimiter type '`+e.type+`'`,e)}Z({type:`delimsizing`,names:[`\\bigl`,`\\Bigl`,`\\biggl`,`\\Biggl`,`\\bigr`,`\\Bigr`,`\\biggr`,`\\Biggr`,`\\bigm`,`\\Bigm`,`\\biggm`,`\\Biggm`,`\\big`,`\\Big`,`\\bigg`,`\\Bigg`],numArgs:1,argTypes:[`primitive`],handler:(e,t)=>{var n=Uj(Yk(t[0]),e);return{type:`delimsizing`,mode:e.parser.mode,size:Bj[e.funcName].size,mclass:Bj[e.funcName].mclass,delim:n.text}},htmlBuilder:(e,t)=>e.delim===`.`?X([e.mclass]):Mj(e.delim,e.size,t,e.mode,[e.mclass]),mathmlBuilder:e=>{var t=[];e.delim!==`.`&&t.push(hA(e.delim,e.mode));var n=new Q(`mo`,t);e.mclass===`mopen`||e.mclass===`mclose`?n.setAttribute(`fence`,`true`):n.setAttribute(`fence`,`false`),n.setAttribute(`stretchy`,`true`);var r=V(jj[e.size]);return n.setAttribute(`minsize`,r),n.setAttribute(`maxsize`,r),n}});function Wj(e){if(!e.body)throw Error(`Bug: The leftright ParseNode wasn't fully parsed.`)}Z({type:`leftright-right`,names:[`\\right`],numArgs:1,primitive:!0,handler:(e,t)=>{var n=e.parser.gullet.macros.get(`\\current@color`);if(n&&typeof n!=`string`)throw new B(`\\current@color set to non-string in \\right`);return{type:`leftright-right`,mode:e.parser.mode,delim:Uj(t[0],e).text,color:n}}}),Z({type:`leftright`,names:[`\\left`],numArgs:1,primitive:!0,handler:(e,t)=>{var n=Uj(t[0],e),r=e.parser;++r.leftrightDepth;var i=r.parseExpression(!1);--r.leftrightDepth,r.expect(`\\right`,!1);var a=UA(r.parseFunction(),`leftright-right`);return{type:`leftright`,mode:r.mode,body:i,left:n.text,right:a.delim,rightColor:a.color}},htmlBuilder:(e,t)=>{Wj(e);for(var n=tA(e.body,t,!0,[`mopen`,`mclose`]),r=0,i=0,a=!1,o=0;o<n.length;o++){var s=n[o];Hj(s)?a=!0:(r=Math.max(n[o].height,r),i=Math.max(n[o].depth,i))}r*=t.sizeMultiplier,i*=t.sizeMultiplier;var c=e.left===`.`?oA(t,[`mopen`]):zj(e.left,r,i,t,e.mode,[`mopen`]);if(n.unshift(c),a)for(var l=1;l<n.length;l++){var u=n[l];if(Hj(u)){var d=u.isMiddle;n[l]=zj(d.delim,r,i,d.options,e.mode,[])}}var f;if(e.right===`.`)f=oA(t,[`mclose`]);else{var p=e.rightColor?t.withColor(e.rightColor):t;f=zj(e.right,r,i,p,e.mode,[`mclose`])}return n.push(f),X([`minner`],n,t)},mathmlBuilder:(e,t)=>{Wj(e);var n=bA(e.body,t);if(e.left!==`.`){var r=new Q(`mo`,[hA(e.left,e.mode)]);r.setAttribute(`fence`,`true`),n.unshift(r)}if(e.right!==`.`){var i=new Q(`mo`,[hA(e.right,e.mode)]);i.setAttribute(`fence`,`true`),e.rightColor&&i.setAttribute(`mathcolor`,e.rightColor),n.push(i)}return gA(n)}}),Z({type:`middle`,names:[`\\middle`],numArgs:1,primitive:!0,handler:(e,t)=>{var n=Uj(t[0],e);if(!e.parser.leftrightDepth)throw new B(`\\middle without preceding \\left`,n);return{type:`middle`,mode:e.parser.mode,delim:n.text}},htmlBuilder:(e,t)=>{var n;return e.delim===`.`?n=oA(t,[]):(n=Mj(e.delim,1,t,e.mode,[]),n.isMiddle={delim:e.delim,options:t}),n},mathmlBuilder:(e,t)=>{var n=new Q(`mo`,[e.delim===`\\vert`||e.delim===`|`?hA(`|`,`text`):hA(e.delim,e.mode)]);return n.setAttribute(`fence`,`true`),n.setAttribute(`lspace`,`0.05em`),n.setAttribute(`rspace`,`0.05em`),n}}),Z({type:`enclose`,names:[`\\colorbox`],numArgs:2,allowedInText:!0,argTypes:[`color`,`hbox`],handler(e,t,n){var r=e.parser,i=e.funcName,a=UA(t[0],`color-token`).color,o=t[1];return{type:`enclose`,mode:r.mode,label:i,backgroundColor:a,body:o}},htmlBuilder:(e,t)=>{var n=Mk(sA(e.body,t),t),r=e.label.slice(1),i=t.sizeMultiplier,a,o,s=mD(e.body);if(r===`sout`)a=X([`katex-stretchy`,`katex-sout`]),a.height=t.fontMetrics().defaultRuleThickness/i,o=-.5*t.fontMetrics().xHeight;else if(r===`phase`){var c=oO({number:.6,unit:`pt`},t),l=oO({number:.35,unit:`ex`},t),u=t.havingBaseSizing();i/=u.sizeMultiplier;var d=n.height+n.depth+c+l;n.style.paddingLeft=V(d/2+c);var f=Math.floor(1e3*d*i);a=Ok([`hide-tail`],[new vO([new yO(`phase`,YD(f))],{width:`400em`,height:V(f/1e3),viewBox:`0 0 400000 `+f,preserveAspectRatio:`xMinYMin slice`})],t),a.style.height=V(d),o=n.depth+c+l}else{/cancel/.test(r)?s||n.classes.push(`cancel-pad`):r===`angl`?n.classes.push(`anglpad`):n.classes.push(`boxpad`);var p,m,h=0;/box/.test(r)?(h=Math.max(t.fontMetrics().fboxrule,t.minRuleThickness),p=t.fontMetrics().fboxsep+(r===`colorbox`?0:h),m=p):r===`angl`?(h=Math.max(t.fontMetrics().defaultRuleThickness,t.minRuleThickness),p=4*h,m=Math.max(0,.25-n.depth)):(p=s?.2:0,m=p),a=LA(n,r,p,m,t),/fbox|boxed|fcolorbox/.test(r)?(a.style.borderStyle=`solid`,a.style.borderWidth=V(h)):r===`angl`&&h!==.049&&(a.style.borderTopWidth=V(h),a.style.borderRightWidth=V(h)),o=n.depth+m,e.backgroundColor&&(a.style.backgroundColor=e.backgroundColor,e.borderColor&&(a.style.borderColor=e.borderColor))}var g;if(e.backgroundColor)g=Pk({positionType:`individualShift`,children:[{type:`elem`,elem:a,shift:o},{type:`elem`,elem:n,shift:0}]});else{var _=/cancel|phase/.test(r)?[`svg-align`]:[];g=Pk({positionType:`individualShift`,children:[{type:`elem`,elem:n,shift:0},{type:`elem`,elem:a,shift:o,wrapperClasses:_}]})}return/cancel/.test(r)&&(g.height=n.height,g.depth=n.depth),/cancel/.test(r)&&!s?X([`mord`,`cancel-lap`],[g],t):X([`mord`],[g],t)},mathmlBuilder:(e,t)=>{var n,r=new Q(e.label.includes(`colorbox`)?`mpadded`:`menclose`,[SA(e.body,t)]);switch(e.label){case`\\cancel`:r.setAttribute(`notation`,`updiagonalstrike`);break;case`\\bcancel`:r.setAttribute(`notation`,`downdiagonalstrike`);break;case`\\phase`:r.setAttribute(`notation`,`phasorangle`);break;case`\\sout`:r.setAttribute(`notation`,`horizontalstrike`);break;case`\\fbox`:r.setAttribute(`notation`,`box`);break;case`\\angl`:r.setAttribute(`notation`,`actuarial`);break;case`\\fcolorbox`:case`\\colorbox`:if(n=t.fontMetrics().fboxsep*t.fontMetrics().ptPerEm,r.setAttribute(`width`,`+`+2*n+`pt`),r.setAttribute(`height`,`+`+2*n+`pt`),r.setAttribute(`lspace`,n+`pt`),r.setAttribute(`voffset`,n+`pt`),e.label===`\\fcolorbox`){var i=Math.max(t.fontMetrics().fboxrule,t.minRuleThickness);r.setAttribute(`style`,`border: `+V(i)+` solid `+e.borderColor)}break;case`\\xcancel`:r.setAttribute(`notation`,`updiagonalstrike downdiagonalstrike`)}return e.backgroundColor&&r.setAttribute(`mathbackground`,e.backgroundColor),r}}),Z({type:`enclose`,names:[`\\fcolorbox`],numArgs:3,allowedInText:!0,argTypes:[`color`,`color`,`hbox`],handler(e,t,n){var r=e.parser,i=e.funcName,a=UA(t[0],`color-token`).color,o=UA(t[1],`color-token`).color,s=t[2];return{type:`enclose`,mode:r.mode,label:i,backgroundColor:o,borderColor:a,body:s}}}),Z({type:`enclose`,names:[`\\fbox`],numArgs:1,argTypes:[`hbox`],allowedInText:!0,handler(e,t){return{type:`enclose`,mode:e.parser.mode,label:`\\fbox`,body:t[0]}}}),Z({type:`enclose`,names:[`\\cancel`,`\\bcancel`,`\\xcancel`,`\\phase`],numArgs:1,handler(e,t){var n=e.parser,r=e.funcName,i=t[0];return{type:`enclose`,mode:n.mode,label:r,body:i}}}),Z({type:`enclose`,names:[`\\sout`],numArgs:1,allowedInText:!0,handler(e,t){var n=e.parser,r=e.funcName;n.mode===`math`&&yk({strict:n.settings.strict,errorCode:`mathVsSout`,errorMsg:`LaTeX's \\sout works only in text mode`,report:!0});var i=t[0];return{type:`enclose`,mode:n.mode,label:r,body:i}}}),Z({type:`enclose`,names:[`\\angl`],numArgs:1,argTypes:[`hbox`],allowedInText:!1,handler(e,t){return{type:`enclose`,mode:e.parser.mode,label:`\\angl`,body:t[0]}}});var Gj={};function Kj(e){for(var t=e.type,n=e.names,r=e.props,i=e.handler,a=e.htmlBuilder,o=e.mathmlBuilder,s={type:t,numArgs:r.numArgs||0,allowedInText:!1,numOptionalArgs:0,handler:i},c=0;c<n.length;++c)Gj[n[c]]=s;a&&(Kk[t]=a),o&&(qk[t]=o)}var qj={};function $(e,t){qj[e]=t}var Jj=class e{constructor(e,t,n){this.lexer=void 0,this.start=void 0,this.end=void 0,this.lexer=e,this.start=t,this.end=n}static range(t,n){return n?!t||!t.loc||!n.loc||t.loc.lexer!==n.loc.lexer?null:new e(t.loc.lexer,t.loc.start,n.loc.end):t&&t.loc}},Yj=class e{constructor(e,t){this.text=void 0,this.loc=void 0,this.noexpand=void 0,this.treatAsRelax=void 0,this.text=e,this.loc=t}range(t,n){return new e(n,Jj.range(this,t))}};function Xj(e){var t=[];e.consumeSpaces();var n=e.fetch().text;for(n===`\\relax`&&(e.consume(),e.consumeSpaces(),n=e.fetch().text);n===`\\hline`||n===`\\hdashline`;)e.consume(),t.push(n===`\\hdashline`),e.consumeSpaces(),n=e.fetch().text;return t}var Zj=e=>{if(!e.parser.settings.displayMode)throw new B(`{`+e.envName+`} can be used only in display mode.`)},Qj=new Set([`gather`,`gather*`]);function $j(e){if(!e.includes(`ed`))return!e.includes(`*`)}function eM(e,t,n){var r=t.hskipBeforeAndAfter,i=t.addJot,a=t.cols,o=t.arraystretch,s=t.colSeparationType,c=t.autoTag,l=t.singleRow,u=t.emptySingleRow,d=t.maxNumCols,f=t.leqno;if(e.gullet.beginGroup(),l||e.gullet.macros.set(`\\cr`,`\\\\\\relax`),!o){var p=e.gullet.expandMacroAsText(`\\arraystretch`);if(p==null)o=1;else if(o=parseFloat(p),!o||o<0)throw new B(`Invalid \\arraystretch: `+p)}e.gullet.beginGroup();var m=[],h=[m],g=[],_=[],v=c==null?void 0:[];function y(){c&&e.gullet.macros.set(`\\@eqnsw`,`1`,!0)}function b(){v&&(e.gullet.macros.get(`\\df@tag`)?(v.push(e.subparse([new Yj(`\\df@tag`)])),e.gullet.macros.set(`\\df@tag`,void 0,!0)):v.push(!!c&&e.gullet.macros.get(`\\@eqnsw`)===`1`))}for(y(),_.push(Xj(e));;){var x=e.parseExpression(!1,l?`\\end`:`\\\\`);e.gullet.endGroup(),e.gullet.beginGroup();var S={type:`ordgroup`,mode:e.mode,body:x};n&&(S={type:`styling`,mode:e.mode,style:n,resetFont:!0,body:[S]}),m.push(S);var C=e.fetch().text;if(C===`&`){if(d&&m.length===d){if(l||s)throw new B(`Too many tab characters: &`,e.nextToken);yk({strict:e.settings.strict,errorCode:`textEnv`,errorMsg:`Too few columns specified in the {array} column argument.`,report:!0})}e.consume()}else if(C===`\\end`){b(),m.length===1&&S.type===`styling`&&S.body.length===1&&S.body[0].type===`ordgroup`&&S.body[0].body.length===0&&(h.length>1||!u)&&!Array.isArray(v?.[v.length-1])&&!(c&&v?.[v.length-1]===!0)&&h.pop(),_.length<h.length+1&&_.push([]);break}else if(C===`\\\\`){e.consume();var w=void 0;e.gullet.future().text!==` `&&(w=e.parseSizeGroup(!0)),g.push(w?w.value:null),b(),_.push(Xj(e)),m=[],h.push(m),y()}else throw new B(`Expected & or \\\\ or \\cr or \\end`,e.nextToken)}return e.gullet.endGroup(),e.gullet.endGroup(),{type:`array`,mode:e.mode,addJot:i,arraystretch:o,body:h,cols:a,rowGaps:g,hskipBeforeAndAfter:r,hLinesBeforeRow:_,colSeparationType:s,tags:v,leqno:f}}function tM(e){return e.slice(0,1)===`d`?`display`:`text`}var nM=function(e,t){var n,r,i=e.body.length,a=e.hLinesBeforeRow,o=0,s=Array(i),c=[],l=Math.max(t.fontMetrics().arrayRuleWidth,t.minRuleThickness),u=1/t.fontMetrics().ptPerEm,d=5*u;e.colSeparationType&&e.colSeparationType===`small`&&(d=.2778*(t.havingStyle(LD.SCRIPT).sizeMultiplier/t.sizeMultiplier));var f=e.colSeparationType===`CD`?oO({number:3,unit:`ex`},t):12*u,p=3*u,m=e.arraystretch*f,h=.7*m,g=.3*m,_=0;function v(e){for(var t=0;t<e.length;++t)t>0&&(_+=.25),c.push({pos:_,isDashed:e[t]})}for(v(a[0]),n=0;n<e.body.length;++n){var y=e.body[n],b=h,x=g;o<y.length&&(o=y.length);var S={cells:Array(y.length),height:0,depth:0,pos:0};for(r=0;r<y.length;++r){var C=sA(y[r],t);x<C.depth&&(x=C.depth),b<C.height&&(b=C.height),S.cells[r]=C}var w=e.rowGaps[n],T=0;w&&(T=oO(w,t),T>0&&(T+=g,x<T&&(x=T),T=0)),e.addJot&&n<e.body.length-1&&(x+=p),S.height=b,S.depth=x,_+=b,S.pos=_,_+=x+T,s[n]=S,v(a[n+1])}var E=_/2+t.fontMetrics().axisHeight,D=e.cols||[],ee=[],O,te,ne=[];if(e.tags&&e.tags.some(e=>e))for(n=0;n<i;++n){var re=s[n],ie=re.pos-E,k=e.tags[n],ae=void 0;ae=k===!0?X([`eqn-num`],[],t):k===!1?X([],[],t):X([],tA(k,t,!0),t),ae.depth=re.depth,ae.height=re.height,ne.push({type:`elem`,elem:ae,shift:ie})}for(r=0,te=0;r<o||te<D.length;++r,++te){for(var A=D[te],oe=!0;(se=A)?.type===`separator`;){var se;if(oe||(O=X([`arraycolsep`],[]),O.style.width=V(t.fontMetrics().doubleRuleSep),ee.push(O)),A.separator===`|`||A.separator===`:`){var ce=A.separator===`|`?`solid`:`dashed`,le=X([`vertical-separator`],[],t);le.style.height=V(_),le.style.borderRightWidth=V(l),le.style.borderRightStyle=ce,le.style.margin=`0 `+V(-l/2);var ue=_-E;ue&&(le.style.verticalAlign=V(-ue)),ee.push(le)}else throw new B(`Invalid separator type: `+A.separator);te++,A=D[te],oe=!1}if(!(r>=o)){var de=void 0;(r>0||e.hskipBeforeAndAfter)&&(de=A?.pregap??d,de!==0&&(O=X([`arraycolsep`],[]),O.style.width=V(de),ee.push(O)));var fe=[];for(n=0;n<i;++n){var pe=s[n],me=pe.cells[r];if(me){var he=pe.pos-E;me.depth=pe.depth,me.height=pe.height,fe.push({type:`elem`,elem:me,shift:he})}}var ge=Pk({positionType:`individualShift`,children:fe}),_e=X([`col-align-`+(A?.align||`c`)],[ge]);ee.push(_e),(r<o-1||e.hskipBeforeAndAfter)&&(de=A?.postgap??d,de!==0&&(O=X([`arraycolsep`],[]),O.style.width=V(de),ee.push(O)))}}var ve=X([`mtable`],ee);if(c.length>0){for(var ye=kk(`katex-hline`,t,l),j=kk(`katex-hdashline`,t,l),M=[{type:`elem`,elem:ve,shift:0}];c.length>0;){var be=c.pop(),xe=be.pos-E;be.isDashed?M.push({type:`elem`,elem:j,shift:xe}):M.push({type:`elem`,elem:ye,shift:xe})}ve=Pk({positionType:`individualShift`,children:M})}if(ne.length===0)return X([`mord`],[ve],t);var N=X([`katex-tag`],[Pk({positionType:`individualShift`,children:ne})],t);return jk([ve,N])},rM={c:`center `,l:`left `,r:`right `},iM=function(e,t){for(var n=[],r=new Q(`mtd`,[],[`mtr-glue`]),i=new Q(`mtd`,[],[`mml-eqn-num`]),a=0;a<e.body.length;a++){for(var o=e.body[a],s=[],c=0;c<o.length;c++)s.push(new Q(`mtd`,[SA(o[c],t)]));e.tags&&e.tags[a]&&(s.unshift(r),s.push(r),e.leqno?s.unshift(i):s.push(i)),n.push(new Q(`mtr`,s))}var l=new Q(`mtable`,n),u=e.arraystretch===.5?.1:.16+e.arraystretch-1+(e.addJot?.09:0);l.setAttribute(`rowspacing`,V(u));var d=``,f=``;if(e.cols&&e.cols.length>0){var p=e.cols,m=``,h=!1,g=0,_=p.length;p[0].type===`separator`&&(d+=`top `,g=1),p[p.length-1].type===`separator`&&(d+=`bottom `,--_);for(var v=g;v<_;v++){var y=p[v];y.type===`align`?(f+=rM[y.align],h&&(m+=`none `),h=!0):y.type===`separator`&&(h&&=(m+=y.separator===`|`?`solid `:`dashed `,!1))}l.setAttribute(`columnalign`,f.trim()),/[sd]/.test(m)&&l.setAttribute(`columnlines`,m.trim())}if(e.colSeparationType===`align`){for(var b=e.cols||[],x=``,S=1;S<b.length;S++)x+=S%2?`0em `:`1em `;l.setAttribute(`columnspacing`,x.trim())}else e.colSeparationType===`alignat`||e.colSeparationType===`gather`?l.setAttribute(`columnspacing`,`0em`):e.colSeparationType===`small`?l.setAttribute(`columnspacing`,`0.2778em`):e.colSeparationType===`CD`?l.setAttribute(`columnspacing`,`0.5em`):l.setAttribute(`columnspacing`,`1em`);var C=``,w=e.hLinesBeforeRow;d+=w[0].length>0?`left `:``,d+=w[w.length-1].length>0?`right `:``;for(var T=1;T<w.length-1;T++)C+=w[T].length===0?`none `:w[T][0]?`dashed `:`solid `;return/[sd]/.test(C)&&l.setAttribute(`rowlines`,C.trim()),d!==``&&(l=new Q(`menclose`,[l]),l.setAttribute(`notation`,d.trim())),e.arraystretch&&e.arraystretch<1&&(l=new Q(`mstyle`,[l]),l.setAttribute(`scriptlevel`,`1`)),l},aM=function(e,t){e.envName.includes(`ed`)||Zj(e);var n=[],r=e.envName===`split`,i=eM(e.parser,{cols:n,addJot:!0,autoTag:r?void 0:$j(e.envName),emptySingleRow:!0,colSeparationType:e.envName.includes(`at`)?`alignat`:`align`,maxNumCols:r?2:void 0,leqno:e.parser.settings.leqno},`display`),a=0,o=0,s={type:`ordgroup`,mode:e.mode,body:[]};if(t[0]&&t[0].type===`ordgroup`){var c=`Number of columns should be a positive integer`,l=KA(t[0],c);if(!/^[0-9]+$/.test(l)||Number(l)<1)throw new B(c,t[0]);a=Number(l),o=a*2}var u=!o;i.body.forEach(function(e){for(var t=1;t<e.length;t+=2)UA(UA(e[t],`styling`).body[0],`ordgroup`).body.unshift(s);if(u)o<e.length&&(o=e.length);else{var n=e.length/2;if(a<n)throw new B(`Too many math in a row: `+(`expected `+a+`, but got `+n),e[0])}});for(var d=0;d<o;++d){var f=`r`,p=0;d%2==1?f=`l`:d>0&&u&&(p=1),n[d]={type:`align`,align:f,pregap:p,postgap:0}}return i.colSeparationType=u?`align`:`alignat`,i};Kj({type:`array`,names:[`array`,`darray`],props:{numArgs:1},handler(e,t){var n=(GA(t[0])?[t[0]]:UA(t[0],`ordgroup`).body).map(function(e){var t=WA(e).text;if(`lcr`.includes(t))return{type:`align`,align:t};if(t===`|`)return{type:`separator`,separator:`|`};if(t===`:`)return{type:`separator`,separator:`:`};throw new B(`Unknown column alignment: `+t,e)}),r={cols:n,hskipBeforeAndAfter:!0,maxNumCols:n.length};return eM(e.parser,r,tM(e.envName))},htmlBuilder:nM,mathmlBuilder:iM}),Kj({type:`array`,names:[`matrix`,`pmatrix`,`bmatrix`,`Bmatrix`,`vmatrix`,`Vmatrix`,`matrix*`,`pmatrix*`,`bmatrix*`,`Bmatrix*`,`vmatrix*`,`Vmatrix*`],props:{numArgs:0},handler(e){var t={matrix:null,pmatrix:[`(`,`)`],bmatrix:[`[`,`]`],Bmatrix:[`\\{`,`\\}`],vmatrix:[`|`,`|`],Vmatrix:[`\\Vert`,`\\Vert`]}[e.envName.replace(`*`,``)],n=`c`,r={hskipBeforeAndAfter:!1,cols:[{type:`align`,align:n}]};if(e.envName.charAt(e.envName.length-1)===`*`){var i=e.parser;if(i.consumeSpaces(),i.fetch().text===`[`){if(i.consume(),i.consumeSpaces(),n=i.fetch().text,!`lcr`.includes(n))throw new B(`Expected l or c or r`,i.nextToken);i.consume(),i.consumeSpaces(),i.expect(`]`),i.consume(),r.cols=[{type:`align`,align:n}]}}var a=eM(e.parser,r,tM(e.envName)),o=Math.max(0,...a.body.map(e=>e.length));return a.cols=Array(o).fill({type:`align`,align:n}),t?{type:`leftright`,mode:e.mode,body:[a],left:t[0],right:t[1],rightColor:void 0}:a},htmlBuilder:nM,mathmlBuilder:iM}),Kj({type:`array`,names:[`smallmatrix`],props:{numArgs:0},handler(e){var t=eM(e.parser,{arraystretch:.5},`script`);return t.colSeparationType=`small`,t},htmlBuilder:nM,mathmlBuilder:iM}),Kj({type:`array`,names:[`subarray`],props:{numArgs:1},handler(e,t){var n=(GA(t[0])?[t[0]]:UA(t[0],`ordgroup`).body).map(function(e){var t=WA(e).text;if(`lc`.includes(t))return{type:`align`,align:t};throw new B(`Unknown column alignment: `+t,e)});if(n.length>1)throw new B(`{subarray} can contain only one column`);var r={cols:n,hskipBeforeAndAfter:!1,arraystretch:.5},i=eM(e.parser,r,`script`);if(i.body.length>0&&i.body[0].length>1)throw new B(`{subarray} can contain only one column`);return i},htmlBuilder:nM,mathmlBuilder:iM}),Kj({type:`array`,names:[`cases`,`dcases`,`rcases`,`drcases`],props:{numArgs:0},handler(e){var t=eM(e.parser,{arraystretch:1.2,cols:[{type:`align`,align:`l`,pregap:0,postgap:1},{type:`align`,align:`l`,pregap:0,postgap:0}]},tM(e.envName));return{type:`leftright`,mode:e.mode,body:[t],left:e.envName.includes(`r`)?`.`:`\\{`,right:e.envName.includes(`r`)?`\\}`:`.`,rightColor:void 0}},htmlBuilder:nM,mathmlBuilder:iM}),Kj({type:`array`,names:[`align`,`align*`,`aligned`,`split`],props:{numArgs:0},handler:aM,htmlBuilder:nM,mathmlBuilder:iM}),Kj({type:`array`,names:[`gathered`,`gather`,`gather*`],props:{numArgs:0},handler(e){Qj.has(e.envName)&&Zj(e);var t={cols:[{type:`align`,align:`c`}],addJot:!0,colSeparationType:`gather`,autoTag:$j(e.envName),emptySingleRow:!0,leqno:e.parser.settings.leqno};return eM(e.parser,t,`display`)},htmlBuilder:nM,mathmlBuilder:iM}),Kj({type:`array`,names:[`alignat`,`alignat*`,`alignedat`],props:{numArgs:1},handler:aM,htmlBuilder:nM,mathmlBuilder:iM}),Kj({type:`array`,names:[`equation`,`equation*`],props:{numArgs:0},handler(e){Zj(e);var t={autoTag:$j(e.envName),emptySingleRow:!0,singleRow:!0,maxNumCols:1,leqno:e.parser.settings.leqno};return eM(e.parser,t,`display`)},htmlBuilder:nM,mathmlBuilder:iM}),Kj({type:`array`,names:[`CD`],props:{numArgs:0},handler(e){return Zj(e),oj(e.parser)},htmlBuilder:nM,mathmlBuilder:iM}),$(`\\nonumber`,`\\gdef\\@eqnsw{0}`),$(`\\notag`,`\\nonumber`),Z({type:`text`,names:[`\\hline`,`\\hdashline`],numArgs:0,allowedInText:!0,allowedInMath:!0,handler(e,t){throw new B(e.funcName+` valid only within array environment`)}});var oM=Gj;Z({type:`environment`,names:[`\\begin`,`\\end`],numArgs:1,argTypes:[`text`],handler(e,t){var n=e.parser,r=e.funcName,i=t[0];if(i.type!==`ordgroup`)throw new B(`Invalid environment name`,i);var a=KA(i,`Environment name should contain only text characters and spaces`,!0);if(r===`\\begin`){if(!Object.prototype.hasOwnProperty.call(oM,a))throw new B(`No such environment: `+a,i);var o=oM[a],s=n.parseArguments(`\\begin{`+a+`}`,o),c=s.args,l=s.optArgs,u={mode:n.mode,envName:a,parser:n},d=o.handler(u,c,l);n.expect(`\\end`,!1);var f=n.nextToken,p=UA(n.parseFunction(),`environment`);if(p.name!==a)throw new B(`Mismatch: \\begin{`+a+`} matched by \\end{`+p.name+`}`,f);return d}return{type:`environment`,mode:n.mode,name:a,nameGroup:i}}});var sM=(e,t)=>{var n=e.font,r=t.withFont(n);return sA(e.body,r)},cM=(e,t)=>{var n=e.font,r=t.withFont(n);return SA(e.body,r)},lM={"\\Bbb":`\\mathbb`,"\\bold":`\\mathbf`,"\\frak":`\\mathfrak`};Z({type:`font`,names:[`\\mathrm`,`\\mathit`,`\\mathbf`,`\\mathnormal`,`\\mathsfit`,`\\mathbb`,`\\mathcal`,`\\mathfrak`,`\\mathscr`,`\\mathsf`,`\\mathtt`,`\\Bbb`,`\\bold`,`\\frak`],numArgs:1,allowedInArgument:!0,handler:(e,t)=>{var n=e.parser,r=e.funcName,i=Yk(t[0]),a=r in lM?lM[r]:r;return{type:`font`,mode:n.mode,font:a.slice(1),body:i}},htmlBuilder:sM,mathmlBuilder:cM}),Z({type:`mclass`,names:[`\\boldsymbol`,`\\bm`],numArgs:1,handler:(e,t)=>{var n=e.parser,r=t[0];return{type:`mclass`,mode:n.mode,mclass:ej(r),body:[{type:`font`,mode:n.mode,font:`boldsymbol`,body:r}],isCharacterBox:mD(r)}}}),Z({type:`font`,names:[`\\rm`,`\\sf`,`\\tt`,`\\bf`,`\\it`,`\\cal`],numArgs:0,allowedInText:!0,handler:(e,t)=>{var n=e.parser,r=e.funcName,i=e.breakOnTokenText,a=n.mode,o=n.parseExpression(!0,i);return{type:`font`,mode:a,font:`math`+r.slice(1),body:{type:`ordgroup`,mode:n.mode,body:o}}}});var uM=(e,t)=>{var n=t.style,r=n.fracNum(),i=n.fracDen(),a=t.havingStyle(r),o=sA(e.numer,a,t);if(e.continued){var s=8.5/t.fontMetrics().ptPerEm,c=3.5/t.fontMetrics().ptPerEm;o.height=o.height<s?s:o.height,o.depth=o.depth<c?c:o.depth}a=t.havingStyle(i);var l=sA(e.denom,a,t),u,d,f;e.hasBarLine?(e.barSize?(d=oO(e.barSize,t),u=kk(`frac-line`,t,d)):u=kk(`frac-line`,t),d=u.height,f=u.height):(u=null,d=0,f=t.fontMetrics().defaultRuleThickness);var p,m,h;n.size===LD.DISPLAY.size?(p=t.fontMetrics().num1,m=d>0?3*f:7*f,h=t.fontMetrics().denom1):(d>0?(p=t.fontMetrics().num2,m=f):(p=t.fontMetrics().num3,m=3*f),h=t.fontMetrics().denom2);var g;if(u){var _=t.fontMetrics().axisHeight;p-o.depth-(_+.5*d)<m&&(p+=m-(p-o.depth-(_+.5*d))),_-.5*d-(l.height-h)<m&&(h+=m-(_-.5*d-(l.height-h)));var v=-(_-.5*d);g=Pk({positionType:`individualShift`,children:[{type:`elem`,elem:l,shift:h},{type:`elem`,elem:u,shift:v},{type:`elem`,elem:o,shift:-p}]})}else{var y=p-o.depth-(l.height-h);y<m&&(p+=.5*(m-y),h+=.5*(m-y)),g=Pk({positionType:`individualShift`,children:[{type:`elem`,elem:l,shift:h},{type:`elem`,elem:o,shift:-p}]})}a=t.havingStyle(n),g.height*=a.sizeMultiplier/t.sizeMultiplier,g.depth*=a.sizeMultiplier/t.sizeMultiplier;var b=n.size===LD.DISPLAY.size?t.fontMetrics().delim1:n.size===LD.SCRIPTSCRIPT.size?t.havingStyle(LD.SCRIPT).fontMetrics().delim2:t.fontMetrics().delim2,x=e.leftDelim==null?oA(t,[`mopen`]):Rj(e.leftDelim,b,!0,t.havingStyle(n),e.mode,[`mopen`]),S=e.continued?X([]):e.rightDelim==null?oA(t,[`mclose`]):Rj(e.rightDelim,b,!0,t.havingStyle(n),e.mode,[`mclose`]);return X([`mord`].concat(a.sizingClasses(t)),[x,X([`mfrac`],[g]),S],t)},dM=(e,t)=>{var n=new Q(`mfrac`,[SA(e.numer,t),SA(e.denom,t)]);if(!e.hasBarLine)n.setAttribute(`linethickness`,`0px`);else if(e.barSize){var r=oO(e.barSize,t);n.setAttribute(`linethickness`,V(r))}if(e.leftDelim!=null||e.rightDelim!=null){var i=[];if(e.leftDelim!=null){var a=new Q(`mo`,[new dA(e.leftDelim.replace(`\\`,``))]);a.setAttribute(`fence`,`true`),i.push(a)}if(i.push(n),e.rightDelim!=null){var o=new Q(`mo`,[new dA(e.rightDelim.replace(`\\`,``))]);o.setAttribute(`fence`,`true`),i.push(o)}return gA(i)}return n},fM=(e,t)=>t?{type:`styling`,mode:e.mode,style:t,body:[e]}:e;Z({type:`genfrac`,names:[`\\cfrac`,`\\dfrac`,`\\frac`,`\\tfrac`,`\\dbinom`,`\\binom`,`\\tbinom`,`\\\\atopfrac`,`\\\\bracefrac`,`\\\\brackfrac`],numArgs:2,allowedInArgument:!0,handler:(e,t)=>{var n=e.parser,r=e.funcName,i=t[0],a=t[1],o,s=null,c=null;switch(r){case`\\cfrac`:case`\\dfrac`:case`\\frac`:case`\\tfrac`:o=!0;break;case`\\\\atopfrac`:o=!1;break;case`\\dbinom`:case`\\binom`:case`\\tbinom`:o=!1,s=`(`,c=`)`;break;case`\\\\bracefrac`:o=!1,s=`\\{`,c=`\\}`;break;case`\\\\brackfrac`:o=!1,s=`[`,c=`]`;break;default:throw Error(`Unrecognized genfrac command`)}var l=r===`\\cfrac`,u=null;return l||r.startsWith(`\\d`)?u=`display`:r.startsWith(`\\t`)&&(u=`text`),fM({type:`genfrac`,mode:n.mode,numer:i,denom:a,continued:l,hasBarLine:o,leftDelim:s,rightDelim:c,barSize:null},u)},htmlBuilder:uM,mathmlBuilder:dM}),Z({type:`infix`,names:[`\\over`,`\\choose`,`\\atop`,`\\brace`,`\\brack`],numArgs:0,infix:!0,handler(e){var t=e.parser,n=e.funcName,r=e.token,i;switch(n){case`\\over`:i=`\\frac`;break;case`\\choose`:i=`\\binom`;break;case`\\atop`:i=`\\\\atopfrac`;break;case`\\brace`:i=`\\\\bracefrac`;break;case`\\brack`:i=`\\\\brackfrac`;break;default:throw Error(`Unrecognized infix genfrac command`)}return{type:`infix`,mode:t.mode,replaceWith:i,token:r}}});var pM=[`display`,`text`,`script`,`scriptscript`],mM=function(e){var t=null;return e.length>0&&(t=e,t=t===`.`?null:t),t};Z({type:`genfrac`,names:[`\\genfrac`],numArgs:6,allowedInArgument:!0,argTypes:[`math`,`math`,`size`,`text`,`math`,`math`],handler(e,t){var n=e.parser,r=t[4],i=t[5],a=Yk(t[0]),o=a.type===`atom`&&a.family===`open`?mM(a.text):null,s=Yk(t[1]),c=s.type===`atom`&&s.family===`close`?mM(s.text):null,l=UA(t[2],`size`),u,d=null;l.isBlank?u=!0:(d=l.value,u=d.number>0);var f=null,p=t[3];if(p.type===`ordgroup`){if(p.body.length>0){var m=UA(p.body[0],`textord`);f=pM[Number(m.text)]}}else p=UA(p,`textord`),f=pM[Number(p.text)];return fM({type:`genfrac`,mode:n.mode,numer:r,denom:i,continued:!1,hasBarLine:u,barSize:d,leftDelim:o,rightDelim:c},f)}}),Z({type:`infix`,names:[`\\above`],numArgs:1,argTypes:[`size`],infix:!0,handler(e,t){var n=e.parser;e.funcName;var r=e.token;return{type:`infix`,mode:n.mode,replaceWith:`\\\\abovefrac`,size:UA(t[0],`size`).value,token:r}}}),Z({type:`genfrac`,names:[`\\\\abovefrac`],numArgs:3,argTypes:[`math`,`size`,`math`],handler:(e,t)=>{var n=e.parser;e.funcName;var r=t[0],i=UA(t[1],`infix`).size;if(!i)throw Error(`\\\\abovefrac expected size, but got `+String(i));var a=t[2],o=i.number>0;return{type:`genfrac`,mode:n.mode,numer:r,denom:a,continued:!1,hasBarLine:o,barSize:i,leftDelim:null,rightDelim:null}}});var hM=(e,t)=>{var n=t.style,r,i;e.type===`supsub`?(r=e.sup?sA(e.sup,t.havingStyle(n.sup()),t):sA(e.sub,t.havingStyle(n.sub()),t),i=UA(e.base,`horizBrace`)):i=UA(e,`horizBrace`);var a=sA(i.base,t.havingBaseStyle(LD.DISPLAY)),o=IA(i,t),s=i.isOver?Pk({positionType:`firstBaseline`,children:[{type:`elem`,elem:a},{type:`kern`,size:.1},{type:`elem`,elem:o,wrapperClasses:[`svg-align`]}]}):Pk({positionType:`bottom`,positionData:a.depth+.1+o.height,children:[{type:`elem`,elem:o,wrapperClasses:[`svg-align`]},{type:`kern`,size:.1},{type:`elem`,elem:a}]});if(r){var c=X([`minner`,i.isOver?`mover`:`munder`],[s],t);s=i.isOver?Pk({positionType:`firstBaseline`,children:[{type:`elem`,elem:c},{type:`kern`,size:.2},{type:`elem`,elem:r}]}):Pk({positionType:`bottom`,positionData:c.depth+.2+r.height+r.depth,children:[{type:`elem`,elem:r},{type:`kern`,size:.2},{type:`elem`,elem:c}]})}return X([`minner`,i.isOver?`mover`:`munder`],[s],t)};Z({type:`horizBrace`,names:[`\\overbrace`,`\\underbrace`,`\\overbracket`,`\\underbracket`],numArgs:1,handler(e,t){var n=e.parser,r=e.funcName;return{type:`horizBrace`,mode:n.mode,label:r,isOver:r.includes(`\\over`),base:t[0]}},htmlBuilder:hM,mathmlBuilder:(e,t)=>{var n=NA(e.label);return new Q(e.isOver?`mover`:`munder`,[SA(e.base,t),n])}}),Z({type:`href`,names:[`\\href`],numArgs:2,argTypes:[`url`,`original`],allowedInText:!0,handler:(e,t)=>{var n=e.parser,r=t[1],i=UA(t[0],`url`).url;return n.settings.isTrusted({command:`\\href`,url:i})?{type:`href`,mode:n.mode,href:i,body:Xk(r)}:n.formatUnsupportedCmd(`\\href`)},htmlBuilder:(e,t)=>{var n=tA(e.body,t,!1);return Ak(e.href,[],n,t)},mathmlBuilder:(e,t)=>{var n=xA(e.body,t);return n instanceof Q||(n=new Q(`mrow`,[n])),n.setAttribute(`href`,e.href),n}}),Z({type:`href`,names:[`\\url`],numArgs:1,argTypes:[`url`],allowedInText:!0,handler:(e,t)=>{var n=e.parser,r=UA(t[0],`url`).url;if(!n.settings.isTrusted({command:`\\url`,url:r}))return n.formatUnsupportedCmd(`\\url`);for(var i=[],a=0;a<r.length;a++){var o=r[a];o===`~`&&(o=`\\textasciitilde`),i.push({type:`textord`,mode:`text`,text:o})}var s={type:`text`,mode:n.mode,font:`\\texttt`,body:i};return{type:`href`,mode:n.mode,href:r,body:Xk(s)}}}),Z({type:`hbox`,names:[`\\hbox`],numArgs:1,argTypes:[`text`],allowedInText:!0,primitive:!0,handler(e,t){return{type:`hbox`,mode:e.parser.mode,body:Xk(t[0])}},htmlBuilder(e,t){return jk(tA(e.body,t.withFont(``),!1))},mathmlBuilder(e,t){return new Q(`mrow`,bA(e.body,t.withFont(``)))}}),Z({type:`html`,names:[`\\htmlClass`,`\\htmlId`,`\\htmlStyle`,`\\htmlData`],numArgs:2,argTypes:[`raw`,`original`],allowedInText:!0,handler:(e,t)=>{var n=e.parser,r=e.funcName;e.token;var i=UA(t[0],`raw`).string,a=t[1];n.settings.strict&&yk({strict:n.settings.strict,errorCode:`htmlExtension`,errorMsg:`HTML extension is disabled on strict mode`,report:!0});var o,s={};switch(r){case`\\htmlClass`:s.class=i,o={command:`\\htmlClass`,class:i};break;case`\\htmlId`:s.id=i,o={command:`\\htmlId`,id:i};break;case`\\htmlStyle`:s.style=i,o={command:`\\htmlStyle`,style:i};break;case`\\htmlData`:for(var c=`{,}`,l=[],u=``,d=0;d<i.length;d++)i.startsWith(c,d)?(u+=`,`,d+=c.length-1):i[d]===`,`?(l.push(u),u=``):u+=i[d];l.push(u);for(var f=0;f<l.length;f++){var p=l[f],m=p.indexOf(`=`);if(m<0)throw new B(`\\htmlData key/value '`+p+`' missing equals sign`);var h=p.slice(0,m),g=p.slice(m+1);s[`data-`+h.trim()]=g}o={command:`\\htmlData`,attributes:s};break;default:throw Error(`Unrecognized html command`)}return n.settings.isTrusted(o)?{type:`html`,mode:n.mode,attributes:s,body:Xk(a)}:n.formatUnsupportedCmd(r)},htmlBuilder:(e,t)=>{var n=tA(e.body,t,!1),r=[`enclosing`];e.attributes.class&&r.push(...e.attributes.class.trim().split(/\s+/));var i=X(r,n,t);for(var a of Object.entries(e.attributes)){var o=a[0],s=a[1];o!==`class`&&i.setAttribute(o,s)}return i},mathmlBuilder:(e,t)=>xA(e.body,t)}),Z({type:`htmlmathml`,names:[`\\html@mathml`],numArgs:2,allowedInArgument:!0,allowedInText:!0,handler:(e,t)=>({type:`htmlmathml`,mode:e.parser.mode,html:Xk(t[0]),mathml:Xk(t[1])}),htmlBuilder:(e,t)=>jk(tA(e.html,t,!1)),mathmlBuilder:(e,t)=>xA(e.mathml,t)});var gM=function(e){if(/^[-+]? *(\d+(\.\d*)?|\.\d+)$/.test(e))return{number:+e,unit:`bp`};var t=/([-+]?) *(\d+(?:\.\d*)?|\.\d+) *([a-z]{2})/.exec(e);if(!t)throw new B(`Invalid size: '`+e+`' in \\includegraphics`);var n={number:+(t[1]+t[2]),unit:t[3]};if(!aO(n))throw new B(`Invalid unit: '`+n.unit+`' in \\includegraphics.`);return n};Z({type:`includegraphics`,names:[`\\includegraphics`],numArgs:1,numOptionalArgs:1,argTypes:[`raw`,`url`],allowedInText:!1,handler:(e,t,n)=>{var r=e.parser,i={number:0,unit:`em`},a={number:.9,unit:`em`},o={number:0,unit:`em`},s=``;if(n[0])for(var c=UA(n[0],`raw`).string.split(`,`),l=0;l<c.length;l++){var u=c[l].split(`=`);if(u.length===2){var d=u[1].trim();switch(u[0].trim()){case`alt`:s=d;break;case`width`:i=gM(d);break;case`height`:a=gM(d);break;case`totalheight`:o=gM(d);break;default:throw new B(`Invalid key: '`+u[0]+`' in \\includegraphics.`)}}}var f=UA(t[0],`url`).url;return s===``&&(s=f,s=s.replace(/^.*[\\/]/,``),s=s.substring(0,s.lastIndexOf(`.`))),r.settings.isTrusted({command:`\\includegraphics`,url:f})?{type:`includegraphics`,mode:r.mode,alt:s,width:i,height:a,totalheight:o,src:f}:r.formatUnsupportedCmd(`\\includegraphics`)},htmlBuilder:(e,t)=>{var n=oO(e.height,t),r=0;e.totalheight.number>0&&(r=oO(e.totalheight,t)-n);var i=0;e.width.number>0&&(i=oO(e.width,t));var a={height:V(n+r)};i>0&&(a.width=V(i)),r>0&&(a.verticalAlign=V(-r));var o=new hO(e.src,e.alt,a);return o.height=n,o.depth=r,o},mathmlBuilder:(e,t)=>{var n=new Q(`mglyph`,[]);n.setAttribute(`alt`,e.alt);var r=oO(e.height,t),i=0;if(e.totalheight.number>0&&(i=oO(e.totalheight,t)-r,n.setAttribute(`valign`,V(-i))),n.setAttribute(`height`,V(r+i)),e.width.number>0){var a=oO(e.width,t);n.setAttribute(`width`,V(a))}return n.setAttribute(`src`,e.src),n}}),Z({type:`kern`,names:[`\\kern`,`\\mkern`,`\\hskip`,`\\mskip`],numArgs:1,argTypes:[`size`],primitive:!0,allowedInText:!0,handler(e,t){var n=e.parser,r=e.funcName,i=UA(t[0],`size`);if(n.settings.strict){var a=r[1]===`m`,o=i.value.unit===`mu`;a?(o||yk({strict:n.settings.strict,errorCode:`mathVsTextUnits`,errorMsg:`LaTeX's `+r+` supports only mu units, `+(`not `+i.value.unit+` units`),report:!0}),n.mode!==`math`&&yk({strict:n.settings.strict,errorCode:`mathVsTextUnits`,errorMsg:`LaTeX's `+r+` works only in math mode`,report:!0})):o&&yk({strict:n.settings.strict,errorCode:`mathVsTextUnits`,errorMsg:`LaTeX's `+r+` doesn't support mu units`,report:!0})}return{type:`kern`,mode:n.mode,dimension:i.value}},htmlBuilder(e,t){return Fk(e.dimension,t)},mathmlBuilder(e,t){return new fA(oO(e.dimension,t))}}),Z({type:`lap`,names:[`\\mathllap`,`\\mathrlap`,`\\mathclap`],numArgs:1,allowedInText:!0,handler:(e,t)=>{var n=e.parser,r=e.funcName,i=t[0];return{type:`lap`,mode:n.mode,alignment:r.slice(5),body:i}},htmlBuilder:(e,t)=>{var n;e.alignment===`clap`?(n=X([],[sA(e.body,t)]),n=X([`katex-inner`],[n],t)):n=X([`katex-inner`],[sA(e.body,t)]);var r=X([`katex-fix`],[]),i=X([e.alignment],[n,r],t),a=X([`katex-strut`]);return a.style.height=V(i.height+i.depth),i.depth&&(a.style.verticalAlign=V(-i.depth)),i.children.unshift(a),i=X([`katex-thinbox`],[i],t),X([`mord`,`katex-vbox`],[i],t)},mathmlBuilder:(e,t)=>{var n=new Q(`mpadded`,[SA(e.body,t)]);if(e.alignment!==`rlap`){var r=e.alignment===`llap`?`-1`:`-0.5`;n.setAttribute(`lspace`,r+`width`)}return n.setAttribute(`width`,`0px`),n}}),Z({type:`styling`,names:[`\\(`,`$`],numArgs:0,allowedInText:!0,allowedInMath:!1,handler(e,t){var n=e.funcName,r=e.parser,i=r.mode;r.switchMode(`math`);var a=n===`\\(`?`\\)`:`$`,o=r.parseExpression(!1,a);return r.expect(a),r.switchMode(i),{type:`styling`,mode:r.mode,style:`text`,resetFont:!0,body:o}}}),Z({type:`text`,names:[`\\)`,`\\]`],numArgs:0,allowedInText:!0,allowedInMath:!1,handler(e,t){throw new B(`Mismatched `+e.funcName)}});var _M=(e,t)=>{switch(t.style.size){case LD.DISPLAY.size:return e.display;case LD.TEXT.size:return e.text;case LD.SCRIPT.size:return e.script;case LD.SCRIPTSCRIPT.size:return e.scriptscript;default:return e.text}};Z({type:`mathchoice`,names:[`\\mathchoice`],numArgs:4,primitive:!0,handler:(e,t)=>({type:`mathchoice`,mode:e.parser.mode,display:Xk(t[0]),text:Xk(t[1]),script:Xk(t[2]),scriptscript:Xk(t[3])}),htmlBuilder:(e,t)=>jk(tA(_M(e,t),t,!1)),mathmlBuilder:(e,t)=>xA(_M(e,t),t)});var vM=(e,t,n,r,i,a,o)=>{e=X([],[e]);var s=n&&mD(n),c,l;if(t){var u=sA(t,r.havingStyle(i.sup()),r);l={elem:u,kern:Math.max(r.fontMetrics().bigOpSpacing1,r.fontMetrics().bigOpSpacing3-u.depth)}}if(n){var d=sA(n,r.havingStyle(i.sub()),r);c={elem:d,kern:Math.max(r.fontMetrics().bigOpSpacing2,r.fontMetrics().bigOpSpacing4-d.height)}}var f;if(l&&c)f=Pk({positionType:`bottom`,positionData:r.fontMetrics().bigOpSpacing5+c.elem.height+c.elem.depth+c.kern+e.depth+o,children:[{type:`kern`,size:r.fontMetrics().bigOpSpacing5},{type:`elem`,elem:c.elem,marginLeft:V(-a)},{type:`kern`,size:c.kern},{type:`elem`,elem:e},{type:`kern`,size:l.kern},{type:`elem`,elem:l.elem,marginLeft:V(a)},{type:`kern`,size:r.fontMetrics().bigOpSpacing5}]});else if(c)f=Pk({positionType:`top`,positionData:e.height-o,children:[{type:`kern`,size:r.fontMetrics().bigOpSpacing5},{type:`elem`,elem:c.elem,marginLeft:V(-a)},{type:`kern`,size:c.kern},{type:`elem`,elem:e}]});else if(l)f=Pk({positionType:`bottom`,positionData:e.depth+o,children:[{type:`elem`,elem:e},{type:`kern`,size:l.kern},{type:`elem`,elem:l.elem,marginLeft:V(a)},{type:`kern`,size:r.fontMetrics().bigOpSpacing5}]});else return e;var p=[f];if(c&&a!==0&&!s){var m=X([`mspace`],[],r);m.style.marginRight=V(a),p.unshift(m)}return X([`mop`,`op-limits`],p,r)},yM=new Set([`\\smallint`]),bM=(e,t)=>{var n,r,i=!1,a;e.type===`supsub`?(n=e.sup,r=e.sub,a=UA(e.base,`op`),i=!0):a=UA(e,`op`);var o=t.style,s=!1;o.size===LD.DISPLAY.size&&a.symbol&&!yM.has(a.name)&&(s=!0);var c,l;if(a.symbol){var u=s?`Size2-Regular`:`Size1-Regular`,d=``;if((a.name===`\\oiint`||a.name===`\\oiiint`)&&(d=a.name.slice(1),a.name=d===`oiint`?`\\iint`:`\\iiint`),c=xk(a.name,u,`math`,t,[`mop`,`op-symbol`,s?`large-op`:`small-op`]),l=c.italic,d.length>0){var f=zk(d+`Size`+(s?`2`:`1`),t);c=Pk({positionType:`individualShift`,children:[{type:`elem`,elem:c,shift:0},{type:`elem`,elem:f,shift:s?.08:0}]}),a.name=`\\`+d,c.classes.unshift(`mop`),c.italic=l}}else if(a.body){var p=tA(a.body,t,!0);p.length===1&&p[0]instanceof _O?(c=p[0],c.classes[0]=`mop`):c=X([`mop`],p,t)}else{for(var m=[],h=1;h<a.name.length;h++)m.push(Sk(a.name[h],a.mode,t));c=X([`mop`],m,t)}var g=0,_=0;return(c instanceof _O||a.name===`\\oiint`||a.name===`\\oiiint`)&&!a.suppressBaseShift&&(g=(c.height-c.depth)/2-t.fontMetrics().axisHeight,_=c.italic??0),i?vM(c,n,r,t,o,_,g):(g&&(c.style.position=`relative`,c.style.top=V(g)),c)},xM=(e,t)=>{var n;if(e.symbol)n=new Q(`mo`,[hA(e.name,e.mode)]),yM.has(e.name)&&n.setAttribute(`largeop`,`false`);else if(e.body)n=new Q(`mo`,bA(e.body,t));else{n=new Q(`mi`,[new dA(e.name.slice(1))]);var r=new Q(`mo`,[hA(`⁡`,`text`)]);n=e.parentIsSupSub?new Q(`mrow`,[n,r]):uA([n,r])}return n},SM={"∏":`\\prod`,"∐":`\\coprod`,"∑":`\\sum`,"⋀":`\\bigwedge`,"⋁":`\\bigvee`,"⋂":`\\bigcap`,"⋃":`\\bigcup`,"⨀":`\\bigodot`,"⨁":`\\bigoplus`,"⨂":`\\bigotimes`,"⨄":`\\biguplus`,"⨆":`\\bigsqcup`};Z({type:`op`,names:`\\coprod.\\bigvee.\\bigwedge.\\biguplus.\\bigcap.\\bigcup.\\intop.\\prod.\\sum.\\bigotimes.\\bigoplus.\\bigodot.\\bigsqcup.\\smallint.∏.∐.∑.⋀.⋁.⋂.⋃.⨀.⨁.⨂.⨄.⨆`.split(`.`),numArgs:0,handler:(e,t)=>{var n=e.parser,r=e.funcName;return r.length===1&&(r=SM[r]),{type:`op`,mode:n.mode,limits:!0,parentIsSupSub:!1,symbol:!0,name:r}},htmlBuilder:bM,mathmlBuilder:xM}),Z({type:`op`,names:[`\\mathop`],numArgs:1,primitive:!0,handler:(e,t)=>{var n=e.parser,r=t[0];return{type:`op`,mode:n.mode,limits:!1,parentIsSupSub:!1,symbol:!1,body:Xk(r)}}});var CM={"∫":`\\int`,"∬":`\\iint`,"∭":`\\iiint`,"∮":`\\oint`,"∯":`\\oiint`,"∰":`\\oiiint`};Z({type:`op`,names:`\\arcsin.\\arccos.\\arctan.\\arctg.\\arcctg.\\arg.\\ch.\\cos.\\cosec.\\cosh.\\cot.\\cotg.\\coth.\\csc.\\ctg.\\cth.\\deg.\\dim.\\exp.\\hom.\\ker.\\lg.\\ln.\\log.\\sec.\\sin.\\sinh.\\sh.\\tan.\\tanh.\\tg.\\th`.split(`.`),numArgs:0,handler(e){var t=e.parser,n=e.funcName;return{type:`op`,mode:t.mode,limits:!1,parentIsSupSub:!1,symbol:!1,name:n}}}),Z({type:`op`,names:[`\\det`,`\\gcd`,`\\inf`,`\\lim`,`\\max`,`\\min`,`\\Pr`,`\\sup`],numArgs:0,handler(e){var t=e.parser,n=e.funcName;return{type:`op`,mode:t.mode,limits:!0,parentIsSupSub:!1,symbol:!1,name:n}}}),Z({type:`op`,names:[`\\int`,`\\iint`,`\\iiint`,`\\oint`,`\\oiint`,`\\oiiint`,`∫`,`∬`,`∭`,`∮`,`∯`,`∰`],numArgs:0,allowedInArgument:!0,handler(e){var t=e.parser,n=e.funcName;return n.length===1&&(n=CM[n]),{type:`op`,mode:t.mode,limits:!1,parentIsSupSub:!1,symbol:!0,name:n}}});var wM=(e,t)=>{var n,r,i=!1,a;e.type===`supsub`?(n=e.sup,r=e.sub,a=UA(e.base,`operatorname`),i=!0):a=UA(e,`operatorname`);var o;if(a.body.length>0){for(var s=tA(a.body.map(e=>{var t=`text`in e?e.text:void 0;return typeof t==`string`?{type:`textord`,mode:e.mode,text:t}:e}),t.withFont(`mathrm`),!0),c=0;c<s.length;c++){var l=s[c];l instanceof _O&&(l.text=l.text.replace(/\u2212/,`-`).replace(/\u2217/,`*`))}o=X([`mop`],s,t)}else o=X([`mop`],[],t);return i?vM(o,n,r,t,t.style,0,0):o};Z({type:`operatorname`,names:[`\\operatorname@`,`\\operatornamewithlimits`],numArgs:1,handler:(e,t)=>{var n=e.parser,r=e.funcName,i=t[0];return{type:`operatorname`,mode:n.mode,body:Xk(i),alwaysHandleSupSub:r===`\\operatornamewithlimits`,limits:!1,parentIsSupSub:!1}},htmlBuilder:wM,mathmlBuilder:(e,t)=>{for(var n=bA(e.body,t.withFont(`mathrm`)),r=!0,i=0;i<n.length;i++){var a=n[i];if(!(a instanceof fA)){if(a instanceof Q)switch(a.type){case`mi`:case`mn`:case`mspace`:case`mtext`:break;case`mo`:var o=a.children[0];a.children.length===1&&o instanceof dA?o.text=o.text.replace(/\u2212/,`-`).replace(/\u2217/,`*`):r=!1;break;default:r=!1}else r=!1}}r&&(n=[new dA(n.map(e=>e.toText()).join(``))]);var s=new Q(`mi`,n);s.setAttribute(`mathvariant`,`normal`);var c=new Q(`mo`,[hA(`⁡`,`text`)]);return e.parentIsSupSub?new Q(`mrow`,[s,c]):uA([s,c])}}),$(`\\operatorname`,`\\@ifstar\\operatornamewithlimits\\operatorname@`),Jk({type:`ordgroup`,htmlBuilder(e,t){return e.semisimple?jk(tA(e.body,t,!1)):X([`mord`],tA(e.body,t,!0),t)},mathmlBuilder(e,t){return xA(e.body,t,!0)}}),Z({type:`overline`,names:[`\\overline`],numArgs:1,handler(e,t){var n=e.parser,r=t[0];return{type:`overline`,mode:n.mode,body:r}},htmlBuilder(e,t){var n=sA(e.body,t.havingCrampedStyle()),r=kk(`overline-line`,t),i=t.fontMetrics().defaultRuleThickness;return X([`mord`,`katex-overline`],[Pk({positionType:`firstBaseline`,children:[{type:`elem`,elem:n},{type:`kern`,size:3*i},{type:`elem`,elem:r},{type:`kern`,size:i}]})],t)},mathmlBuilder(e,t){var n=new Q(`mo`,[new dA(`‾`)]);n.setAttribute(`stretchy`,`true`);var r=new Q(`mover`,[SA(e.body,t),n]);return r.setAttribute(`accent`,`true`),r}}),Z({type:`phantom`,names:[`\\phantom`],numArgs:1,allowedInText:!0,handler:(e,t)=>{var n=e.parser,r=t[0];return{type:`phantom`,mode:n.mode,body:Xk(r)}},htmlBuilder:(e,t)=>jk(tA(e.body,t.withPhantom(),!1)),mathmlBuilder:(e,t)=>new Q(`mphantom`,bA(e.body,t))}),$(`\\hphantom`,`\\smash{\\phantom{#1}}`),Z({type:`vphantom`,names:[`\\vphantom`],numArgs:1,allowedInText:!0,handler:(e,t)=>{var n=e.parser,r=t[0];return{type:`vphantom`,mode:n.mode,body:r}},htmlBuilder:(e,t)=>X([`mord`,`rlap`],[X([`katex-inner`],[sA(e.body,t.withPhantom())]),X([`katex-fix`],[])],t),mathmlBuilder:(e,t)=>{var n=new Q(`mpadded`,[new Q(`mphantom`,bA(Xk(e.body),t))]);return n.setAttribute(`width`,`0px`),n}}),Z({type:`raisebox`,names:[`\\raisebox`],numArgs:2,argTypes:[`size`,`hbox`],allowedInText:!0,handler(e,t){var n=e.parser,r=UA(t[0],`size`).value,i=t[1];return{type:`raisebox`,mode:n.mode,dy:r,body:i}},htmlBuilder(e,t){var n=sA(e.body,t);return Pk({positionType:`shift`,positionData:-oO(e.dy,t),children:[{type:`elem`,elem:n}]})},mathmlBuilder(e,t){var n=new Q(`mpadded`,[SA(e.body,t)]),r=e.dy.number+e.dy.unit;return n.setAttribute(`voffset`,r),n}});var TM=(e,t)=>({type:`reflectbox`,mode:e.parser.mode,body:t[0]});Z({type:`reflectbox`,names:[`\\reflectbox`],numArgs:1,argTypes:[`hbox`],allowedInText:!0,handler:TM,htmlBuilder(e,t){return X([`mord`,`reflectbox`],[sA(e.body,t)],t)},mathmlBuilder(e,t){return SA(e.body,t)}}),Z({type:`reflectbox`,names:[`\\mathreflectbox`],numArgs:1,argTypes:[`math`],handler:TM}),Z({type:`internal`,names:[`\\relax`],numArgs:0,allowedInText:!0,allowedInArgument:!0,handler(e){return{type:`internal`,mode:e.parser.mode}}}),Z({type:`rule`,names:[`\\rule`],numArgs:2,numOptionalArgs:1,allowedInText:!0,allowedInMath:!0,argTypes:[`size`,`size`,`size`],handler(e,t,n){var r=e.parser,i=n[0],a=UA(t[0],`size`),o=UA(t[1],`size`);return{type:`rule`,mode:r.mode,shift:i&&UA(i,`size`).value,width:a.value,height:o.value}},htmlBuilder(e,t){var n=X([`mord`,`katex-rule`],[],t),r=oO(e.width,t),i=oO(e.height,t),a=e.shift?oO(e.shift,t):0;return n.style.borderRightWidth=V(r),n.style.borderTopWidth=V(i),n.style.bottom=V(a),n.width=r,n.height=i+a,n.depth=-a,n.maxFontSize=i*1.125*t.sizeMultiplier,n},mathmlBuilder(e,t){var n=oO(e.width,t),r=oO(e.height,t),i=e.shift?oO(e.shift,t):0,a=t.color&&t.getColor()||`black`,o=new Q(`mspace`);o.setAttribute(`mathbackground`,a),o.setAttribute(`width`,V(n)),o.setAttribute(`height`,V(r));var s=new Q(`mpadded`,[o]);return i>=0?s.setAttribute(`height`,V(i)):(s.setAttribute(`height`,V(i)),s.setAttribute(`depth`,V(-i))),s.setAttribute(`voffset`,V(i)),s}});function EM(e,t,n){for(var r=tA(e,t,!1),i=t.sizeMultiplier/n.sizeMultiplier,a=0;a<r.length;a++){var o=r[a].classes.indexOf(`katex-sizing`);o<0?Array.prototype.push.apply(r[a].classes,t.sizingClasses(n)):r[a].classes[o+1]===`reset-size`+t.size&&(r[a].classes[o+1]=`reset-size`+n.size),r[a].height*=i,r[a].depth*=i}return jk(r)}var DM=[`\\tiny`,`\\sixptsize`,`\\scriptsize`,`\\footnotesize`,`\\small`,`\\normalsize`,`\\large`,`\\Large`,`\\LARGE`,`\\huge`,`\\Huge`];Z({type:`sizing`,names:DM,numArgs:0,allowedInText:!0,handler:(e,t)=>{var n=e.breakOnTokenText,r=e.funcName,i=e.parser,a=i.parseExpression(!1,n);return{type:`sizing`,mode:i.mode,size:DM.indexOf(r)+1,body:a}},htmlBuilder:(e,t)=>{var n=t.havingSize(e.size);return EM(e.body,n,t)},mathmlBuilder:(e,t)=>{var n=t.havingSize(e.size),r=new Q(`mstyle`,bA(e.body,n));return r.setAttribute(`mathsize`,V(n.sizeMultiplier)),r}}),Z({type:`smash`,names:[`\\smash`],numArgs:1,numOptionalArgs:1,allowedInText:!0,handler:(e,t,n)=>{var r=e.parser,i=!1,a=!1,o=n[0]&&UA(n[0],`ordgroup`);if(o)for(var s,c=0;c<o.body.length;++c){var l=o.body[c];if(s=WA(l).text,s===`t`)i=!0;else if(s===`b`)a=!0;else{i=!1,a=!1;break}}else i=!0,a=!0;var u=t[0];return{type:`smash`,mode:r.mode,body:u,smashHeight:i,smashDepth:a}},htmlBuilder:(e,t)=>{var n=X([],[sA(e.body,t)]);if(!e.smashHeight&&!e.smashDepth)return n;if(e.smashHeight&&(n.height=0),e.smashDepth&&(n.depth=0),e.smashHeight&&e.smashDepth)return X([`mord`,`katex-smash`],[n],t);if(n.children)for(var r=0;r<n.children.length;r++)e.smashHeight&&(n.children[r].height=0),e.smashDepth&&(n.children[r].depth=0);return X([`mord`],[Pk({positionType:`firstBaseline`,children:[{type:`elem`,elem:n}]})],t)},mathmlBuilder:(e,t)=>{var n=new Q(`mpadded`,[SA(e.body,t)]);return e.smashHeight&&n.setAttribute(`height`,`0px`),e.smashDepth&&n.setAttribute(`depth`,`0px`),n}}),Z({type:`sqrt`,names:[`\\sqrt`],numArgs:1,numOptionalArgs:1,handler(e,t,n){var r=e.parser,i=n[0],a=t[0];return{type:`sqrt`,mode:r.mode,body:a,index:i}},htmlBuilder(e,t){var n=sA(e.body,t.havingCrampedStyle());n.height===0&&(n.height=t.fontMetrics().xHeight),n=Mk(n,t);var r=t.fontMetrics().defaultRuleThickness,i=r;t.style.id<LD.TEXT.id&&(i=t.fontMetrics().xHeight);var a=r+i/4,o=Dj(n.height+n.depth+a+r,t),s=o.span,c=o.ruleWidth,l=o.advanceWidth,u=s.height-c;u>n.height+n.depth+a&&(a=(a+u-n.height-n.depth)/2);var d=s.height-n.height-a-c;n.style.paddingLeft=V(l);var f=Pk({positionType:`firstBaseline`,children:[{type:`elem`,elem:n,wrapperClasses:[`svg-align`]},{type:`kern`,size:-(n.height+d)},{type:`elem`,elem:s},{type:`kern`,size:c}]});if(e.index){var p=t.havingStyle(LD.SCRIPTSCRIPT),m=sA(e.index,p,t);return X([`mord`,`sqrt`],[X([`katex-root`],[Pk({positionType:`shift`,positionData:-(.6*(f.height-f.depth)),children:[{type:`elem`,elem:m}]})]),f],t)}return X([`mord`,`sqrt`],[f],t)},mathmlBuilder(e,t){var n=e.body,r=e.index;return r?new Q(`mroot`,[SA(n,t),SA(r,t)]):new Q(`msqrt`,[SA(n,t)])}});var OM={display:LD.DISPLAY,text:LD.TEXT,script:LD.SCRIPT,scriptscript:LD.SCRIPTSCRIPT};function kM(e){return e in OM}Z({type:`styling`,names:[`\\displaystyle`,`\\textstyle`,`\\scriptstyle`,`\\scriptscriptstyle`],numArgs:0,allowedInText:!0,primitive:!0,handler(e,t){var n=e.breakOnTokenText,r=e.funcName,i=e.parser,a=i.parseExpression(!0,n),o=r.slice(1,r.length-5);if(!kM(o))throw Error(`Unknown style: `+o);return{type:`styling`,mode:i.mode,style:o,body:a}},htmlBuilder(e,t){var n=OM[e.style],r=t.havingStyle(n);return e.resetFont&&(r=r.withFont(``)),EM(e.body,r,t)},mathmlBuilder(e,t){var n=OM[e.style],r=t.havingStyle(n);e.resetFont&&(r=r.withFont(``));var i=new Q(`mstyle`,bA(e.body,r)),a={display:[`0`,`true`],text:[`0`,`false`],script:[`1`,`false`],scriptscript:[`2`,`false`]}[e.style];return i.setAttribute(`scriptlevel`,a[0]),i.setAttribute(`displaystyle`,a[1]),i}});var AM=function(e,t){var n=e.base;return n?n.type===`op`?n.limits&&(t.style.size===LD.DISPLAY.size||n.alwaysHandleSupSub)?bM:null:n.type===`operatorname`?n.alwaysHandleSupSub&&(t.style.size===LD.DISPLAY.size||n.limits)?wM:null:n.type===`accent`?mD(n.base)?JA:null:n.type===`horizBrace`&&!e.sub===n.isOver?hM:null:null};Jk({type:`supsub`,htmlBuilder(e,t){var n=AM(e,t);if(n)return n(e,t);var r=e.base,i=e.sup,a=e.sub,o=sA(r,t),s,c,l=t.fontMetrics(),u=0,d=0,f=r&&mD(r);if(i){var p=t.havingStyle(t.style.sup());s=sA(i,p,t),f||(u=o.height-p.fontMetrics().supDrop*p.sizeMultiplier/t.sizeMultiplier)}if(a){var m=t.havingStyle(t.style.sub());c=sA(a,m,t),f||(d=o.depth+m.fontMetrics().subDrop*m.sizeMultiplier/t.sizeMultiplier)}var h=t.style===LD.DISPLAY?l.sup1:t.style.cramped?l.sup3:l.sup2,g=t.sizeMultiplier,_=V(.5/l.ptPerEm/g),v=null;if(c){var y=e.base&&e.base.type===`op`&&e.base.name&&(e.base.name===`\\oiint`||e.base.name===`\\oiiint`);(o instanceof _O||y)&&(v=V(-(o.italic??0)))}var b;if(s&&c){u=Math.max(u,h,s.depth+.25*l.xHeight),d=Math.max(d,l.sub2);var x=4*l.defaultRuleThickness;if(u-s.depth-(c.height-d)<x){d=x-(u-s.depth)+c.height;var S=.8*l.xHeight-(u-s.depth);S>0&&(u+=S,d-=S)}b=Pk({positionType:`individualShift`,children:[{type:`elem`,elem:c,shift:d,marginRight:_,marginLeft:v},{type:`elem`,elem:s,shift:-u,marginRight:_}]})}else if(c)d=Math.max(d,l.sub1,c.height-.8*l.xHeight),b=Pk({positionType:`shift`,positionData:d,children:[{type:`elem`,elem:c,marginLeft:v,marginRight:_}]});else if(s)u=Math.max(u,h,s.depth+.25*l.xHeight),b=Pk({positionType:`shift`,positionData:-u,children:[{type:`elem`,elem:s,marginRight:_}]});else throw Error(`supsub must have either sup or sub.`);return X([aA(o,`right`)||`mord`],[o,X([`msupsub`],[b])],t)},mathmlBuilder(e,t){var n=!1,r,i;e.base&&e.base.type===`horizBrace`&&(i=!!e.sup,i===e.base.isOver&&(n=!0,r=e.base.isOver)),e.base&&(e.base.type===`op`||e.base.type===`operatorname`)&&(e.base.parentIsSupSub=!0);var a=[SA(e.base,t)];e.sub&&a.push(SA(e.sub,t)),e.sup&&a.push(SA(e.sup,t));var o;if(n)o=r?`mover`:`munder`;else if(!e.sub){var s=e.base;o=s&&s.type===`op`&&s.limits&&(t.style===LD.DISPLAY||s.alwaysHandleSupSub)||s&&s.type===`operatorname`&&s.alwaysHandleSupSub&&(s.limits||t.style===LD.DISPLAY)?`mover`:`msup`}else if(e.sup){var c=e.base;o=c&&c.type===`op`&&c.limits&&t.style===LD.DISPLAY||c&&c.type===`operatorname`&&c.alwaysHandleSupSub&&(t.style===LD.DISPLAY||c.limits)?`munderover`:`msubsup`}else{var l=e.base;o=l&&l.type===`op`&&l.limits&&(t.style===LD.DISPLAY||l.alwaysHandleSupSub)||l&&l.type===`operatorname`&&l.alwaysHandleSupSub&&(l.limits||t.style===LD.DISPLAY)?`munder`:`msub`}return new Q(o,a)}}),Jk({type:`atom`,htmlBuilder(e,t){return Sk(e.text,e.mode,t,[`m`+e.family])},mathmlBuilder(e,t){var n=new Q(`mo`,[hA(e.text,e.mode)]);if(e.family===`bin`){var r=vA(e,t);r===`bold-italic`&&n.setAttribute(`mathvariant`,r)}else e.family===`punct`?n.setAttribute(`separator`,`true`):(e.family===`open`||e.family===`close`)&&n.setAttribute(`stretchy`,`false`);return n}});var jM={mi:`italic`,mn:`normal`,mtext:`normal`};Jk({type:`mathord`,htmlBuilder(e,t){return wk(e,t)},mathmlBuilder(e,t){var n=new Q(`mi`,[hA(e.text,e.mode,t)]),r=vA(e,t)||`italic`;return r!==jM[n.type]&&n.setAttribute(`mathvariant`,r),n}}),Jk({type:`textord`,htmlBuilder(e,t){return wk(e,t)},mathmlBuilder(e,t){var n=hA(e.text,e.mode,t),r=vA(e,t)||`normal`,i=e.mode===`text`?new Q(`mtext`,[n]):/[0-9]/.test(e.text)?new Q(`mn`,[n]):e.text===`\\prime`?new Q(`mo`,[n]):new Q(`mi`,[n]);return r!==jM[i.type]&&i.setAttribute(`mathvariant`,r),i}});var MM=new Map([[`\\nobreak`,`nobreak`],[`\\allowbreak`,`allowbreak`]]),NM=new Map([[` `,{}],[`\\ `,{}],[`~`,{className:`nobreak`}],[`\\space`,{}],[`\\nobreakspace`,{className:`nobreak`}]]);Jk({type:`spacing`,htmlBuilder(e,t){var n=NM.get(e.text),r=MM.get(e.text);if(n){var i=n.className||``;if(e.mode===`text`){var a=wk(e,t);return a.classes.push(i),a}return X([`mspace`,i],[Sk(e.text,e.mode,t)],t)}if(r)return X([`mspace`,r],[],t);throw new B(`Unknown type of space "`+e.text+`"`)},mathmlBuilder(e,t){var n;if(NM.has(e.text))n=new Q(`mtext`,[new dA(`\xA0`)]);else if(MM.has(e.text))return new Q(`mspace`);else throw new B(`Unknown type of space "`+e.text+`"`);return n}});var PM=()=>{var e=new Q(`mtd`,[]);return e.setAttribute(`width`,`50%`),e};Jk({type:`tag`,mathmlBuilder(e,t){var n=new Q(`mtable`,[new Q(`mtr`,[PM(),new Q(`mtd`,[xA(e.body,t)]),PM(),new Q(`mtd`,[xA(e.tag,t)])])]);return n.setAttribute(`width`,`100%`),n}});var FM={"\\text":void 0,"\\textrm":`textrm`,"\\textsf":`textsf`,"\\texttt":`texttt`,"\\textnormal":`textrm`},IM={"\\textbf":`textbf`,"\\textmd":`textmd`},LM={"\\textit":`textit`,"\\textup":`textup`},RM=(e,t)=>{var n=e.font;return n?FM[n]?t.withTextFontFamily(FM[n]):IM[n]?t.withTextFontWeight(IM[n]):n===`\\emph`?t.fontShape===`textit`?t.withTextFontShape(`textup`):t.withTextFontShape(`textit`):t.withTextFontShape(LM[n]):t};Z({type:`text`,names:[`\\text`,`\\textrm`,`\\textsf`,`\\texttt`,`\\textnormal`,`\\textbf`,`\\textmd`,`\\textit`,`\\textup`,`\\emph`],numArgs:1,argTypes:[`text`],allowedInArgument:!0,allowedInText:!0,handler(e,t){var n=e.parser,r=e.funcName,i=t[0];return{type:`text`,mode:n.mode,body:Xk(i),font:r}},htmlBuilder(e,t){var n=RM(e,t);return X([`mord`,`text`],tA(e.body,n,!0),n)},mathmlBuilder(e,t){var n=RM(e,t);return xA(e.body,n)}}),Z({type:`underline`,names:[`\\underline`],numArgs:1,allowedInText:!0,handler(e,t){return{type:`underline`,mode:e.parser.mode,body:t[0]}},htmlBuilder(e,t){var n=sA(e.body,t),r=kk(`underline-line`,t),i=t.fontMetrics().defaultRuleThickness;return X([`mord`,`katex-underline`],[Pk({positionType:`top`,positionData:n.height,children:[{type:`kern`,size:i},{type:`elem`,elem:r},{type:`kern`,size:3*i},{type:`elem`,elem:n}]})],t)},mathmlBuilder(e,t){var n=new Q(`mo`,[new dA(`‾`)]);n.setAttribute(`stretchy`,`true`);var r=new Q(`munder`,[SA(e.body,t),n]);return r.setAttribute(`accentunder`,`true`),r}}),Z({type:`vcenter`,names:[`\\vcenter`],numArgs:1,argTypes:[`original`],allowedInText:!1,handler(e,t){return{type:`vcenter`,mode:e.parser.mode,body:t[0]}},htmlBuilder(e,t){var n=sA(e.body,t),r=t.fontMetrics().axisHeight;return Pk({positionType:`shift`,positionData:.5*(n.height-r-(n.depth+r)),children:[{type:`elem`,elem:n}]})},mathmlBuilder(e,t){return new Q(`mrow`,[new Q(`mpadded`,[SA(e.body,t)],[`vcenter`])])}}),Z({type:`verb`,names:[`\\verb`],numArgs:0,allowedInText:!0,handler(e,t,n){throw new B(`\\verb ended by end of line instead of matching delimiter`)},htmlBuilder(e,t){for(var n=zM(e),r=[],i=t.havingStyle(t.style.text()),a=0;a<n.length;a++){var o=n[a];o===`~`&&(o=`\\textasciitilde`),r.push(xk(o,`Typewriter-Regular`,e.mode,i,[`mord`,`texttt`]))}return X([`mord`,`text`].concat(i.sizingClasses(t)),Ek(r),i)},mathmlBuilder(e,t){var n=new Q(`mtext`,[new dA(zM(e))]);return n.setAttribute(`mathvariant`,`monospace`),n}});var zM=e=>e.body.replace(/ /g,e.star?`␣`:`\xA0`),BM=Gk,VM=`[ \r
396
+ ]`,HM=`\\\\[a-zA-Z@]+`,UM=`\\\\[^\ud800-\udfff]`,WM=`(`+HM+`)`+VM+`*`,GM=`\\\\(
397
397
  |[ \r ]+
398
- ?)[ \r ]*`,GM=`[̀-ͯ]`,KM=RegExp(GM+`+$`),qM=`(`+BM+`+)|`+(WM+`|`)+`([!-\\[\\]-‧‪-퟿豈-￿]`+(GM+`*`)+`|[\ud800-\udbff][\udc00-\udfff]`+(GM+`*`)+`|\\\\verb\\*([^]).*?\\4|\\\\verb([^*a-zA-Z]).*?\\5`+(`|`+UM)+(`|`+HM+`)`),JM=class{constructor(e,t){this.input=void 0,this.settings=void 0,this.tokenRegex=void 0,this.catcodes=void 0,this.input=e,this.settings=t,this.tokenRegex=new RegExp(qM,`g`),this.catcodes={"%":14,"~":13}}setCatcode(e,t){this.catcodes[e]=t}lex(){var e=this.input,t=this.tokenRegex.lastIndex;if(t===e.length)return new Jj(`EOF`,new qj(this,t,t));var n=this.tokenRegex.exec(e);if(n===null||n.index!==t)throw new B(`Unexpected character: '`+e[t]+`'`,new Jj(e[t],new qj(this,t,t+1)));var r=n[6]||n[3]||(n[2]?`\\ `:` `);if(this.catcodes[r]===14){var i=e.indexOf(`
399
- `,this.tokenRegex.lastIndex);return i===-1?(this.tokenRegex.lastIndex=e.length,vk({strict:this.settings.strict,errorCode:`commentAtEnd`,errorMsg:`% comment has no terminating newline; LaTeX would fail because of commenting the end of math mode (e.g. $)`,report:!0})):this.tokenRegex.lastIndex=i+1,this.lex()}return new Jj(r,new qj(this,t,this.tokenRegex.lastIndex))}},YM=class{constructor(e,t){e===void 0&&(e={}),t===void 0&&(t={}),this.current=void 0,this.builtins=void 0,this.undefStack=void 0,this.current=t,this.builtins=e,this.undefStack=[]}beginGroup(){this.undefStack.push({})}endGroup(){if(this.undefStack.length===0)throw new B(`Unbalanced namespace destruction: attempt to pop global namespace; please report this as a bug`);var e=this.undefStack.pop();for(var t of Object.keys(e))e[t]===void 0?delete this.current[t]:this.current[t]=e[t]}endGroups(){for(;this.undefStack.length>0;)this.endGroup()}has(e){return Object.prototype.hasOwnProperty.call(this.current,e)||Object.prototype.hasOwnProperty.call(this.builtins,e)}get(e){if(Object.prototype.hasOwnProperty.call(this.current,e))return this.current[e];if(Object.prototype.hasOwnProperty.call(this.builtins,e))return this.builtins[e]}set(e,t,n){if(n===void 0&&(n=!1),n){for(var r=0;r<this.undefStack.length;r++)delete this.undefStack[r][e];this.undefStack.length>0&&(this.undefStack[this.undefStack.length-1][e]=t)}else{var i=this.undefStack[this.undefStack.length-1];i&&!Object.prototype.hasOwnProperty.call(i,e)&&(i[e]=Object.prototype.hasOwnProperty.call(this.current,e)?this.current[e]:void 0)}t==null?delete this.current[e]:this.current[e]=t}},XM=Kj;$(`\\noexpand`,function(e){var t=e.popToken();return e.isExpandable(t.text)&&(t.noexpand=!0,t.treatAsRelax=!0),{tokens:[t],numArgs:0}}),$(`\\expandafter`,function(e){var t=e.popToken();return e.expandOnce(!0),{tokens:[t],numArgs:0}}),$(`\\@firstoftwo`,function(e){return{tokens:e.consumeArgs(2)[0],numArgs:0}}),$(`\\@secondoftwo`,function(e){return{tokens:e.consumeArgs(2)[1],numArgs:0}}),$(`\\@ifnextchar`,function(e){var t=e.consumeArgs(3);e.consumeSpaces();var n=e.future();return t[0].length===1&&t[0][0].text===n.text?{tokens:t[1],numArgs:0}:{tokens:t[2],numArgs:0}}),$(`\\@ifstar`,`\\@ifnextchar *{\\@firstoftwo{#1}}`),$(`\\TextOrMath`,function(e){var t=e.consumeArgs(2);return e.mode===`text`?{tokens:t[0],numArgs:0}:{tokens:t[1],numArgs:0}});var ZM={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,a:10,A:10,b:11,B:11,c:12,C:12,d:13,D:13,e:14,E:14,f:15,F:15};$(`\\char`,function(e){var t=e.popToken(),n,r=0;if(t.text===`'`)n=8,t=e.popToken();else if(t.text===`"`)n=16,t=e.popToken();else if(t.text==="`"){if(t=e.popToken(),t.text[0]===`\\`)r=t.text.charCodeAt(1);else if(t.text===`EOF`)throw new B("\\char` missing argument");else r=t.text.charCodeAt(0)}else n=10;if(n){if(r=ZM[t.text],r==null||r>=n)throw new B(`Invalid base-`+n+` digit `+t.text);for(var i;(i=ZM[e.future().text])!=null&&i<n;)r*=n,r+=i,e.popToken()}return`\\@char{`+r+`}`});var QM=(e,t,n,r)=>{var i=e.consumeArg().tokens;if(i.length!==1)throw new B(`\\newcommand's first argument must be a macro name`);var a=i[0].text,o=e.isDefined(a);if(o&&!t)throw new B(`\\newcommand{`+a+`} attempting to redefine `+(a+`; use \\renewcommand`));if(!o&&!n)throw new B(`\\renewcommand{`+a+`} when command `+a+` does not yet exist; use \\newcommand`);var s=0;if(i=e.consumeArg().tokens,i.length===1&&i[0].text===`[`){for(var c=``,l=e.expandNextToken();l.text!==`]`&&l.text!==`EOF`;)c+=l.text,l=e.expandNextToken();if(!c.match(/^\s*[0-9]+\s*$/))throw new B(`Invalid number of arguments: `+c);s=parseInt(c),i=e.consumeArg().tokens}return o&&r||e.macros.set(a,{tokens:i,numArgs:s}),``};$(`\\newcommand`,e=>QM(e,!1,!0,!1)),$(`\\renewcommand`,e=>QM(e,!0,!1,!1)),$(`\\providecommand`,e=>QM(e,!0,!0,!0)),$(`\\message`,e=>{var t=e.consumeArgs(1)[0];return console.log(t.reverse().map(e=>e.text).join(``)),``}),$(`\\errmessage`,e=>{var t=e.consumeArgs(1)[0];return console.error(t.reverse().map(e=>e.text).join(``)),``}),$(`\\show`,e=>{var t=e.popToken(),n=t.text;return console.log(t,e.macros.get(n),zM[n],AO.math[n],AO.text[n]),``}),$(`\\bgroup`,`{`),$(`\\egroup`,`}`),$(`~`,`\\nobreakspace`),$(`\\lq`,"`"),$(`\\rq`,`'`),$(`\\aa`,`\\r a`),$(`\\AA`,`\\r A`),$(`\\textcopyright`,"\\html@mathml{\\textcircled{c}}{\\char`©}"),$(`\\copyright`,`\\TextOrMath{\\textcopyright}{\\text{\\textcopyright}}`),$(`\\textregistered`,"\\html@mathml{\\textcircled{\\scriptsize R}}{\\char`®}"),$(`ℬ`,`\\mathscr{B}`),$(`ℰ`,`\\mathscr{E}`),$(`ℱ`,`\\mathscr{F}`),$(`ℋ`,`\\mathscr{H}`),$(`ℐ`,`\\mathscr{I}`),$(`ℒ`,`\\mathscr{L}`),$(`ℳ`,`\\mathscr{M}`),$(`ℛ`,`\\mathscr{R}`),$(`ℭ`,`\\mathfrak{C}`),$(`ℌ`,`\\mathfrak{H}`),$(`ℨ`,`\\mathfrak{Z}`),$(`\\Bbbk`,`\\Bbb{k}`),$(`\\llap`,`\\mathllap{\\textrm{#1}}`),$(`\\rlap`,`\\mathrlap{\\textrm{#1}}`),$(`\\clap`,`\\mathclap{\\textrm{#1}}`),$(`\\mathstrut`,`\\vphantom{(}`),$(`\\underbar`,`\\underline{\\text{#1}}`),$(`\\not`,`\\html@mathml{\\mathrel{\\mathrlap\\@not}\\nobreak}{\\char"338}`),$(`\\neq`,"\\html@mathml{\\mathrel{\\not=}}{\\mathrel{\\char`≠}}"),$(`\\ne`,`\\neq`),$(`≠`,`\\neq`),$(`\\notin`,"\\html@mathml{\\mathrel{{\\in}\\mathllap{/\\mskip1mu}}}{\\mathrel{\\char`∉}}"),$(`∉`,`\\notin`),$(`≘`,"\\html@mathml{\\mathrel{=\\kern{-1em}\\raisebox{0.4em}{$\\scriptsize\\frown$}}}{\\mathrel{\\char`≘}}"),$(`≙`,"\\html@mathml{\\stackrel{\\tiny\\wedge}{=}}{\\mathrel{\\char`≘}}"),$(`≚`,"\\html@mathml{\\stackrel{\\tiny\\vee}{=}}{\\mathrel{\\char`≚}}"),$(`≛`,"\\html@mathml{\\stackrel{\\scriptsize\\star}{=}}{\\mathrel{\\char`≛}}"),$(`≝`,"\\html@mathml{\\stackrel{\\tiny\\mathrm{def}}{=}}{\\mathrel{\\char`≝}}"),$(`≞`,"\\html@mathml{\\stackrel{\\tiny\\mathrm{m}}{=}}{\\mathrel{\\char`≞}}"),$(`≟`,"\\html@mathml{\\stackrel{\\tiny?}{=}}{\\mathrel{\\char`≟}}"),$(`⟂`,`\\perp`),$(`‼`,`\\mathclose{!\\mkern-0.8mu!}`),$(`∌`,`\\notni`),$(`⌜`,`\\ulcorner`),$(`⌝`,`\\urcorner`),$(`⌞`,`\\llcorner`),$(`⌟`,`\\lrcorner`),$(`©`,`\\copyright`),$(`®`,`\\textregistered`),$(`\\ulcorner`,`\\html@mathml{\\@ulcorner}{\\mathop{\\char"231c}}`),$(`\\urcorner`,`\\html@mathml{\\@urcorner}{\\mathop{\\char"231d}}`),$(`\\llcorner`,`\\html@mathml{\\@llcorner}{\\mathop{\\char"231e}}`),$(`\\lrcorner`,`\\html@mathml{\\@lrcorner}{\\mathop{\\char"231f}}`),$(`\\vdots`,`{\\varvdots\\rule{0pt}{15pt}}`),$(`⋮`,`\\vdots`),$(`\\varGamma`,`\\mathit{\\Gamma}`),$(`\\varDelta`,`\\mathit{\\Delta}`),$(`\\varTheta`,`\\mathit{\\Theta}`),$(`\\varLambda`,`\\mathit{\\Lambda}`),$(`\\varXi`,`\\mathit{\\Xi}`),$(`\\varPi`,`\\mathit{\\Pi}`),$(`\\varSigma`,`\\mathit{\\Sigma}`),$(`\\varUpsilon`,`\\mathit{\\Upsilon}`),$(`\\varPhi`,`\\mathit{\\Phi}`),$(`\\varPsi`,`\\mathit{\\Psi}`),$(`\\varOmega`,`\\mathit{\\Omega}`),$(`\\substack`,`\\begin{subarray}{c}#1\\end{subarray}`),$(`\\colon`,`\\nobreak\\mskip2mu\\mathpunct{}\\mathchoice{\\mkern-3mu}{\\mkern-3mu}{}{}{:}\\mskip6mu\\relax`),$(`\\boxed`,`\\fbox{$\\displaystyle{#1}$}`),$(`\\iff`,`\\DOTSB\\;\\Longleftrightarrow\\;`),$(`\\implies`,`\\DOTSB\\;\\Longrightarrow\\;`),$(`\\impliedby`,`\\DOTSB\\;\\Longleftarrow\\;`),$(`\\dddot`,`{\\overset{\\raisebox{-0.1ex}{\\normalsize ...}}{#1}}`),$(`\\ddddot`,`{\\overset{\\raisebox{-0.1ex}{\\normalsize ....}}{#1}}`);var $M={",":`\\dotsc`,"\\not":`\\dotsb`,"+":`\\dotsb`,"=":`\\dotsb`,"<":`\\dotsb`,">":`\\dotsb`,"-":`\\dotsb`,"*":`\\dotsb`,":":`\\dotsb`,"\\DOTSB":`\\dotsb`,"\\coprod":`\\dotsb`,"\\bigvee":`\\dotsb`,"\\bigwedge":`\\dotsb`,"\\biguplus":`\\dotsb`,"\\bigcap":`\\dotsb`,"\\bigcup":`\\dotsb`,"\\prod":`\\dotsb`,"\\sum":`\\dotsb`,"\\bigotimes":`\\dotsb`,"\\bigoplus":`\\dotsb`,"\\bigodot":`\\dotsb`,"\\bigsqcup":`\\dotsb`,"\\And":`\\dotsb`,"\\longrightarrow":`\\dotsb`,"\\Longrightarrow":`\\dotsb`,"\\longleftarrow":`\\dotsb`,"\\Longleftarrow":`\\dotsb`,"\\longleftrightarrow":`\\dotsb`,"\\Longleftrightarrow":`\\dotsb`,"\\mapsto":`\\dotsb`,"\\longmapsto":`\\dotsb`,"\\hookrightarrow":`\\dotsb`,"\\doteq":`\\dotsb`,"\\mathbin":`\\dotsb`,"\\mathrel":`\\dotsb`,"\\relbar":`\\dotsb`,"\\Relbar":`\\dotsb`,"\\xrightarrow":`\\dotsb`,"\\xleftarrow":`\\dotsb`,"\\DOTSI":`\\dotsi`,"\\int":`\\dotsi`,"\\oint":`\\dotsi`,"\\iint":`\\dotsi`,"\\iiint":`\\dotsi`,"\\iiiint":`\\dotsi`,"\\idotsint":`\\dotsi`,"\\DOTSX":`\\dotsx`},eN=new Set([`bin`,`rel`]);$(`\\dots`,function(e){var t=`\\dotso`,n=e.expandAfterFuture().text;return n in $M?t=$M[n]:(n.slice(0,4)===`\\not`||n in AO.math&&eN.has(AO.math[n].group))&&(t=`\\dotsb`),t});var tN={")":!0,"]":!0,"\\rbrack":!0,"\\}":!0,"\\rbrace":!0,"\\rangle":!0,"\\rceil":!0,"\\rfloor":!0,"\\rgroup":!0,"\\rmoustache":!0,"\\right":!0,"\\bigr":!0,"\\biggr":!0,"\\Bigr":!0,"\\Biggr":!0,$:!0,";":!0,".":!0,",":!0};$(`\\dotso`,function(e){return e.future().text in tN?`\\ldots\\,`:`\\ldots`}),$(`\\dotsc`,function(e){var t=e.future().text;return t in tN&&t!==`,`?`\\ldots\\,`:`\\ldots`}),$(`\\cdots`,function(e){return e.future().text in tN?`\\@cdots\\,`:`\\@cdots`}),$(`\\dotsb`,`\\cdots`),$(`\\dotsm`,`\\cdots`),$(`\\dotsi`,`\\!\\cdots`),$(`\\dotsx`,`\\ldots\\,`),$(`\\DOTSI`,`\\relax`),$(`\\DOTSB`,`\\relax`),$(`\\DOTSX`,`\\relax`),$(`\\tmspace`,`\\TextOrMath{\\kern#1#3}{\\mskip#1#2}\\relax`),$(`\\,`,`\\tmspace+{3mu}{.1667em}`),$(`\\thinspace`,`\\,`),$(`\\>`,`\\mskip{4mu}`),$(`\\:`,`\\tmspace+{4mu}{.2222em}`),$(`\\medspace`,`\\:`),$(`\\;`,`\\tmspace+{5mu}{.2777em}`),$(`\\thickspace`,`\\;`),$(`\\!`,`\\tmspace-{3mu}{.1667em}`),$(`\\negthinspace`,`\\!`),$(`\\negmedspace`,`\\tmspace-{4mu}{.2222em}`),$(`\\negthickspace`,`\\tmspace-{5mu}{.277em}`),$(`\\enspace`,`\\kern.5em `),$(`\\enskip`,`\\hskip.5em\\relax`),$(`\\quad`,`\\hskip1em\\relax`),$(`\\qquad`,`\\hskip2em\\relax`),$(`\\tag`,`\\@ifstar\\tag@literal\\tag@paren`),$(`\\tag@paren`,`\\tag@literal{({#1})}`),$(`\\tag@literal`,e=>{if(e.macros.get(`\\df@tag`))throw new B(`Multiple \\tag`);return`\\gdef\\df@tag{\\text{#1}}`}),$(`\\bmod`,`\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}\\mathbin{\\rm mod}\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}`),$(`\\pod`,`\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern8mu}{\\mkern8mu}{\\mkern8mu}(#1)`),$(`\\pmod`,`\\pod{{\\rm mod}\\mkern6mu#1}`),$(`\\mod`,`\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern12mu}{\\mkern12mu}{\\mkern12mu}{\\rm mod}\\,\\,#1`),$(`\\newline`,`\\\\\\relax`),$(`\\TeX`,`\\textrm{\\html@mathml{T\\kern-.1667em\\raisebox{-.5ex}{E}\\kern-.125emX}{TeX}}`);var nN=V(CO[`Main-Regular`][84][1]-.7*CO[`Main-Regular`][65][1]);$(`\\LaTeX`,`\\textrm{\\html@mathml{`+(`L\\kern-.36em\\raisebox{`+nN+`}{\\scriptstyle A}`)+`\\kern-.15em\\TeX}{LaTeX}}`),$(`\\KaTeX`,`\\textrm{\\html@mathml{`+(`K\\kern-.17em\\raisebox{`+nN+`}{\\scriptstyle A}`)+`\\kern-.15em\\TeX}{KaTeX}}`),$(`\\hspace`,`\\@ifstar\\@hspacer\\@hspace`),$(`\\@hspace`,`\\hskip #1\\relax`),$(`\\@hspacer`,`\\rule{0pt}{0pt}\\hskip #1\\relax`),$(`\\ordinarycolon`,`:`),$(`\\vcentcolon`,`\\mathrel{\\mathop\\ordinarycolon}`),$(`\\dblcolon`,`\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-.9mu}\\vcentcolon}}{\\mathop{\\char"2237}}`),$(`\\coloneqq`,`\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2254}}`),$(`\\Coloneqq`,`\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2237\\char"3d}}`),$(`\\coloneq`,`\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"3a\\char"2212}}`),$(`\\Coloneq`,`\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"2237\\char"2212}}`),$(`\\eqqcolon`,`\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2255}}`),$(`\\Eqqcolon`,`\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"3d\\char"2237}}`),$(`\\eqcolon`,`\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2239}}`),$(`\\Eqcolon`,`\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"2212\\char"2237}}`),$(`\\colonapprox`,`\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"3a\\char"2248}}`),$(`\\Colonapprox`,`\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"2237\\char"2248}}`),$(`\\colonsim`,`\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"3a\\char"223c}}`),$(`\\Colonsim`,`\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"2237\\char"223c}}`),$(`∷`,`\\dblcolon`),$(`∹`,`\\eqcolon`),$(`≔`,`\\coloneqq`),$(`≕`,`\\eqqcolon`),$(`⩴`,`\\Coloneqq`),$(`\\ratio`,`\\vcentcolon`),$(`\\coloncolon`,`\\dblcolon`),$(`\\colonequals`,`\\coloneqq`),$(`\\coloncolonequals`,`\\Coloneqq`),$(`\\equalscolon`,`\\eqqcolon`),$(`\\equalscoloncolon`,`\\Eqqcolon`),$(`\\colonminus`,`\\coloneq`),$(`\\coloncolonminus`,`\\Coloneq`),$(`\\minuscolon`,`\\eqcolon`),$(`\\minuscoloncolon`,`\\Eqcolon`),$(`\\coloncolonapprox`,`\\Colonapprox`),$(`\\coloncolonsim`,`\\Colonsim`),$(`\\simcolon`,`\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\vcentcolon}`),$(`\\simcoloncolon`,`\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\dblcolon}`),$(`\\approxcolon`,`\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\vcentcolon}`),$(`\\approxcoloncolon`,`\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\dblcolon}`),$(`\\notni`,"\\html@mathml{\\not\\ni}{\\mathrel{\\char`∌}}"),$(`\\limsup`,`\\DOTSB\\operatorname*{lim\\,sup}`),$(`\\liminf`,`\\DOTSB\\operatorname*{lim\\,inf}`),$(`\\injlim`,`\\DOTSB\\operatorname*{inj\\,lim}`),$(`\\projlim`,`\\DOTSB\\operatorname*{proj\\,lim}`),$(`\\varlimsup`,`\\DOTSB\\operatorname*{\\overline{lim}}`),$(`\\varliminf`,`\\DOTSB\\operatorname*{\\underline{lim}}`),$(`\\varinjlim`,`\\DOTSB\\operatorname*{\\underrightarrow{lim}}`),$(`\\varprojlim`,`\\DOTSB\\operatorname*{\\underleftarrow{lim}}`),$(`\\gvertneqq`,`\\html@mathml{\\@gvertneqq}{≩}`),$(`\\lvertneqq`,`\\html@mathml{\\@lvertneqq}{≨}`),$(`\\ngeqq`,`\\html@mathml{\\@ngeqq}{≱}`),$(`\\ngeqslant`,`\\html@mathml{\\@ngeqslant}{≱}`),$(`\\nleqq`,`\\html@mathml{\\@nleqq}{≰}`),$(`\\nleqslant`,`\\html@mathml{\\@nleqslant}{≰}`),$(`\\nshortmid`,`\\html@mathml{\\@nshortmid}{∤}`),$(`\\nshortparallel`,`\\html@mathml{\\@nshortparallel}{∦}`),$(`\\nsubseteqq`,`\\html@mathml{\\@nsubseteqq}{⊈}`),$(`\\nsupseteqq`,`\\html@mathml{\\@nsupseteqq}{⊉}`),$(`\\varsubsetneq`,`\\html@mathml{\\@varsubsetneq}{⊊}`),$(`\\varsubsetneqq`,`\\html@mathml{\\@varsubsetneqq}{⫋}`),$(`\\varsupsetneq`,`\\html@mathml{\\@varsupsetneq}{⊋}`),$(`\\varsupsetneqq`,`\\html@mathml{\\@varsupsetneqq}{⫌}`),$(`\\imath`,`\\html@mathml{\\@imath}{ı}`),$(`\\jmath`,`\\html@mathml{\\@jmath}{ȷ}`),$(`\\llbracket`,"\\html@mathml{\\mathopen{[\\mkern-3.2mu[}}{\\mathopen{\\char`⟦}}"),$(`\\rrbracket`,"\\html@mathml{\\mathclose{]\\mkern-3.2mu]}}{\\mathclose{\\char`⟧}}"),$(`⟦`,`\\llbracket`),$(`⟧`,`\\rrbracket`),$(`\\lBrace`,"\\html@mathml{\\mathopen{\\{\\mkern-3.2mu[}}{\\mathopen{\\char`⦃}}"),$(`\\rBrace`,"\\html@mathml{\\mathclose{]\\mkern-3.2mu\\}}}{\\mathclose{\\char`⦄}}"),$(`↤`,`\\mapsfrom`),$(`\\mapsfrom`,"\\html@mathml{\\mathrel{\\mathreflectbox{\\mapsto}}}{\\mathrel{\\char`↤}}"),$(`⦃`,`\\lBrace`),$(`⦄`,`\\rBrace`),$(`\\minuso`,"\\mathbin{\\html@mathml{{\\mathrlap{\\mathchoice{\\kern{0.145em}}{\\kern{0.145em}}{\\kern{0.1015em}}{\\kern{0.0725em}}\\circ}{-}}}{\\char`⦵}}"),$(`⦵`,`\\minuso`),$(`\\darr`,`\\downarrow`),$(`\\dArr`,`\\Downarrow`),$(`\\Darr`,`\\Downarrow`),$(`\\lang`,`\\langle`),$(`\\rang`,`\\rangle`),$(`\\uarr`,`\\uparrow`),$(`\\uArr`,`\\Uparrow`),$(`\\Uarr`,`\\Uparrow`),$(`\\N`,`\\mathbb{N}`),$(`\\R`,`\\mathbb{R}`),$(`\\Z`,`\\mathbb{Z}`),$(`\\alef`,`\\aleph`),$(`\\alefsym`,`\\aleph`),$(`\\Alpha`,`\\mathrm{A}`),$(`\\Beta`,`\\mathrm{B}`),$(`\\bull`,`\\bullet`),$(`\\Chi`,`\\mathrm{X}`),$(`\\clubs`,`\\clubsuit`),$(`\\cnums`,`\\mathbb{C}`),$(`\\Complex`,`\\mathbb{C}`),$(`\\Dagger`,`\\ddagger`),$(`\\diamonds`,`\\diamondsuit`),$(`\\empty`,`\\emptyset`),$(`\\Epsilon`,`\\mathrm{E}`),$(`\\Eta`,`\\mathrm{H}`),$(`\\exist`,`\\exists`),$(`\\harr`,`\\leftrightarrow`),$(`\\hArr`,`\\Leftrightarrow`),$(`\\Harr`,`\\Leftrightarrow`),$(`\\hearts`,`\\heartsuit`),$(`\\image`,`\\Im`),$(`\\infin`,`\\infty`),$(`\\Iota`,`\\mathrm{I}`),$(`\\isin`,`\\in`),$(`\\Kappa`,`\\mathrm{K}`),$(`\\larr`,`\\leftarrow`),$(`\\lArr`,`\\Leftarrow`),$(`\\Larr`,`\\Leftarrow`),$(`\\lrarr`,`\\leftrightarrow`),$(`\\lrArr`,`\\Leftrightarrow`),$(`\\Lrarr`,`\\Leftrightarrow`),$(`\\Mu`,`\\mathrm{M}`),$(`\\natnums`,`\\mathbb{N}`),$(`\\Nu`,`\\mathrm{N}`),$(`\\Omicron`,`\\mathrm{O}`),$(`\\plusmn`,`\\pm`),$(`\\rarr`,`\\rightarrow`),$(`\\rArr`,`\\Rightarrow`),$(`\\Rarr`,`\\Rightarrow`),$(`\\real`,`\\Re`),$(`\\reals`,`\\mathbb{R}`),$(`\\Reals`,`\\mathbb{R}`),$(`\\Rho`,`\\mathrm{P}`),$(`\\sdot`,`\\cdot`),$(`\\sect`,`\\S`),$(`\\spades`,`\\spadesuit`),$(`\\sub`,`\\subset`),$(`\\sube`,`\\subseteq`),$(`\\supe`,`\\supseteq`),$(`\\Tau`,`\\mathrm{T}`),$(`\\thetasym`,`\\vartheta`),$(`\\weierp`,`\\wp`),$(`\\Zeta`,`\\mathrm{Z}`),$(`\\argmin`,`\\DOTSB\\operatorname*{arg\\,min}`),$(`\\argmax`,`\\DOTSB\\operatorname*{arg\\,max}`),$(`\\plim`,`\\DOTSB\\mathop{\\operatorname{plim}}\\limits`),$(`\\bra`,`\\mathinner{\\langle{#1}|}`),$(`\\ket`,`\\mathinner{|{#1}\\rangle}`),$(`\\braket`,`\\mathinner{\\langle{#1}\\rangle}`),$(`\\Bra`,`\\left\\langle#1\\right|`),$(`\\Ket`,`\\left|#1\\right\\rangle`);var rN=e=>t=>{var n=t.consumeArg().tokens,r=t.consumeArg().tokens,i=t.consumeArg().tokens,a=t.consumeArg().tokens,o=t.macros.get(`|`),s=t.macros.get(`\\|`);t.macros.beginGroup();var c=t=>n=>{e&&(n.macros.set(`|`,o),i.length&&n.macros.set(`\\|`,s));var a=t;return!t&&i.length&&n.future().text===`|`&&(n.popToken(),a=!0),{tokens:a?i:r,numArgs:0}};t.macros.set(`|`,c(!1)),i.length&&t.macros.set(`\\|`,c(!0));var l=t.consumeArg().tokens,u=t.expandTokens([...a,...l,...n]);return t.macros.endGroup(),{tokens:u.reverse(),numArgs:0}};$(`\\bra@ket`,rN(!1)),$(`\\bra@set`,rN(!0)),$(`\\Braket`,`\\bra@ket{\\left\\langle}{\\,\\middle\\vert\\,}{\\,\\middle\\vert\\,}{\\right\\rangle}`),$(`\\Set`,`\\bra@set{\\left\\{\\:}{\\;\\middle\\vert\\;}{\\;\\middle\\Vert\\;}{\\:\\right\\}}`),$(`\\set`,`\\bra@set{\\{\\,}{\\mid}{}{\\,\\}}`),$(`\\angln`,`{\\angl n}`),$(`\\blue`,`\\textcolor{##6495ed}{#1}`),$(`\\orange`,`\\textcolor{##ffa500}{#1}`),$(`\\pink`,`\\textcolor{##ff00af}{#1}`),$(`\\red`,`\\textcolor{##df0030}{#1}`),$(`\\green`,`\\textcolor{##28ae7b}{#1}`),$(`\\gray`,`\\textcolor{gray}{#1}`),$(`\\purple`,`\\textcolor{##9d38bd}{#1}`),$(`\\blueA`,`\\textcolor{##ccfaff}{#1}`),$(`\\blueB`,`\\textcolor{##80f6ff}{#1}`),$(`\\blueC`,`\\textcolor{##63d9ea}{#1}`),$(`\\blueD`,`\\textcolor{##11accd}{#1}`),$(`\\blueE`,`\\textcolor{##0c7f99}{#1}`),$(`\\tealA`,`\\textcolor{##94fff5}{#1}`),$(`\\tealB`,`\\textcolor{##26edd5}{#1}`),$(`\\tealC`,`\\textcolor{##01d1c1}{#1}`),$(`\\tealD`,`\\textcolor{##01a995}{#1}`),$(`\\tealE`,`\\textcolor{##208170}{#1}`),$(`\\greenA`,`\\textcolor{##b6ffb0}{#1}`),$(`\\greenB`,`\\textcolor{##8af281}{#1}`),$(`\\greenC`,`\\textcolor{##74cf70}{#1}`),$(`\\greenD`,`\\textcolor{##1fab54}{#1}`),$(`\\greenE`,`\\textcolor{##0d923f}{#1}`),$(`\\goldA`,`\\textcolor{##ffd0a9}{#1}`),$(`\\goldB`,`\\textcolor{##ffbb71}{#1}`),$(`\\goldC`,`\\textcolor{##ff9c39}{#1}`),$(`\\goldD`,`\\textcolor{##e07d10}{#1}`),$(`\\goldE`,`\\textcolor{##a75a05}{#1}`),$(`\\redA`,`\\textcolor{##fca9a9}{#1}`),$(`\\redB`,`\\textcolor{##ff8482}{#1}`),$(`\\redC`,`\\textcolor{##f9685d}{#1}`),$(`\\redD`,`\\textcolor{##e84d39}{#1}`),$(`\\redE`,`\\textcolor{##bc2612}{#1}`),$(`\\maroonA`,`\\textcolor{##ffbde0}{#1}`),$(`\\maroonB`,`\\textcolor{##ff92c6}{#1}`),$(`\\maroonC`,`\\textcolor{##ed5fa6}{#1}`),$(`\\maroonD`,`\\textcolor{##ca337c}{#1}`),$(`\\maroonE`,`\\textcolor{##9e034e}{#1}`),$(`\\purpleA`,`\\textcolor{##ddd7ff}{#1}`),$(`\\purpleB`,`\\textcolor{##c6b9fc}{#1}`),$(`\\purpleC`,`\\textcolor{##aa87ff}{#1}`),$(`\\purpleD`,`\\textcolor{##7854ab}{#1}`),$(`\\purpleE`,`\\textcolor{##543b78}{#1}`),$(`\\mintA`,`\\textcolor{##f5f9e8}{#1}`),$(`\\mintB`,`\\textcolor{##edf2df}{#1}`),$(`\\mintC`,`\\textcolor{##e0e5cc}{#1}`),$(`\\grayA`,`\\textcolor{##f6f7f7}{#1}`),$(`\\grayB`,`\\textcolor{##f0f1f2}{#1}`),$(`\\grayC`,`\\textcolor{##e3e5e6}{#1}`),$(`\\grayD`,`\\textcolor{##d6d8da}{#1}`),$(`\\grayE`,`\\textcolor{##babec2}{#1}`),$(`\\grayF`,`\\textcolor{##888d93}{#1}`),$(`\\grayG`,`\\textcolor{##626569}{#1}`),$(`\\grayH`,`\\textcolor{##3b3e40}{#1}`),$(`\\grayI`,`\\textcolor{##21242c}{#1}`),$(`\\kaBlue`,`\\textcolor{##314453}{#1}`),$(`\\kaGreen`,`\\textcolor{##71B307}{#1}`);var iN={"^":!0,_:!0,"\\limits":!0,"\\nolimits":!0},aN=class{constructor(e,t,n){this.settings=void 0,this.expansionCount=void 0,this.lexer=void 0,this.macros=void 0,this.stack=void 0,this.mode=void 0,this.settings=t,this.expansionCount=0,this.feed(e),this.macros=new YM(XM,t.macros),this.mode=n,this.stack=[]}feed(e){this.lexer=new JM(e,this.settings)}switchMode(e){this.mode=e}beginGroup(){this.macros.beginGroup()}endGroup(){this.macros.endGroup()}endGroups(){this.macros.endGroups()}future(){return this.stack.length===0&&this.pushToken(this.lexer.lex()),this.stack[this.stack.length-1]}popToken(){return this.future(),this.stack.pop()}pushToken(e){this.stack.push(e)}pushTokens(e){this.stack.push(...e)}scanArgument(e){var t,n,r;if(e){if(this.consumeSpaces(),this.future().text!==`[`)return null;t=this.popToken();var i=this.consumeArg([`]`]);r=i.tokens,n=i.end}else{var a=this.consumeArg();r=a.tokens,t=a.start,n=a.end}return this.pushToken(new Jj(`EOF`,n.loc)),this.pushTokens(r),new Jj(``,qj.range(t,n))}consumeSpaces(){for(;this.future().text===` `;)this.stack.pop()}consumeArg(e){var t=[],n=e&&e.length>0;n||this.consumeSpaces();var r=this.future(),i,a=0,o=0;do{if(i=this.popToken(),t.push(i),i.text===`{`)++a;else if(i.text===`}`){if(--a,a===-1)throw new B(`Extra }`,i)}else if(i.text===`EOF`)throw new B(`Unexpected end of input in a macro argument, expected '`+(e&&n?e[o]:`}`)+`'`,i);if(e&&n){if((a===0||a===1&&e[o]===`{`)&&i.text===e[o]){if(++o,o===e.length){t.splice(-o,o);break}}else o=0}}while(a!==0||n);return r.text===`{`&&t[t.length-1].text===`}`&&(t.pop(),t.shift()),t.reverse(),{tokens:t,start:r,end:i}}consumeArgs(e,t){if(t){if(t.length!==e+1)throw new B(`The length of delimiters doesn't match the number of args!`);for(var n=t[0],r=0;r<n.length;r++){var i=this.popToken();if(n[r]!==i.text)throw new B(`Use of the macro doesn't match its definition`,i)}}for(var a=[],o=0;o<e;o++)a.push(this.consumeArg(t&&t[o+1]).tokens);return a}countExpansion(e){if(this.expansionCount+=e,this.expansionCount>this.settings.maxExpand)throw new B(`Too many expansions: infinite loop or need to increase maxExpand setting`)}expandOnce(e){var t=this.popToken(),n=t.text,r=t.noexpand?null:this._getExpansion(n);if(r==null||e&&r.unexpandable){if(e&&r==null&&n[0]===`\\`&&!this.isDefined(n))throw new B(`Undefined control sequence: `+n);return this.pushToken(t),!1}this.countExpansion(1);var i=r.tokens,a=this.consumeArgs(r.numArgs,r.delimiters);if(r.numArgs){i=i.slice();for(var o=i.length-1;o>=0;--o){var s=i[o];if(s.text===`#`){if(o===0)throw new B(`Incomplete placeholder at end of macro body`,s);if(s=i[--o],s.text===`#`)i.splice(o+1,1);else if(/^[1-9]$/.test(s.text))i.splice(o,2,...a[s.text-1]);else throw new B(`Not a valid argument number`,s)}}}return this.pushTokens(i),i.length}expandAfterFuture(){return this.expandOnce(),this.future()}expandNextToken(){for(;;)if(this.expandOnce()===!1){var e=this.stack.pop();return e.treatAsRelax&&(e.text=`\\relax`),e}}expandMacro(e){return this.macros.has(e)?this.expandTokens([new Jj(e)]):void 0}expandTokens(e){var t=[],n=this.stack.length;for(this.pushTokens(e);this.stack.length>n;)if(this.expandOnce(!0)===!1){var r=this.stack.pop();r.treatAsRelax&&=(r.noexpand=!1,!1),t.push(r)}return this.countExpansion(t.length),t}expandMacroAsText(e){var t=this.expandMacro(e);return t&&t.map(e=>e.text).join(``)}_getExpansion(e){var t=this.macros.get(e);if(t==null)return t;if(e.length===1){var n=this.lexer.catcodes[e];if(n!=null&&n!==13)return}var r=typeof t==`function`?t(this):t;if(typeof r==`string`){var i=0;if(r.includes(`#`))for(var a=r.replace(/##/g,``);a.includes(`#`+(i+1));)++i;for(var o=new JM(r,this.settings),s=[],c=o.lex();c.text!==`EOF`;)s.push(c),c=o.lex();return s.reverse(),{tokens:s,numArgs:i}}return r}isDefined(e){return this.macros.has(e)||Object.prototype.hasOwnProperty.call(zM,e)||Object.prototype.hasOwnProperty.call(AO.math,e)||Object.prototype.hasOwnProperty.call(AO.text,e)||Object.prototype.hasOwnProperty.call(iN,e)}isExpandable(e){var t=this.macros.get(e);return t==null?Object.prototype.hasOwnProperty.call(zM,e)&&!zM[e].primitive:typeof t==`string`||typeof t==`function`||!t.unexpandable}},oN=/^[₊₋₌₍₎₀₁₂₃₄₅₆₇₈₉ₐₑₕᵢⱼₖₗₘₙₒₚᵣₛₜᵤᵥₓᵦᵧᵨᵩᵪ]/,sN=Object.freeze({"₊":`+`,"₋":`-`,"₌":`=`,"₍":`(`,"₎":`)`,"₀":`0`,"₁":`1`,"₂":`2`,"₃":`3`,"₄":`4`,"₅":`5`,"₆":`6`,"₇":`7`,"₈":`8`,"₉":`9`,ₐ:`a`,ₑ:`e`,ₕ:`h`,ᵢ:`i`,ⱼ:`j`,ₖ:`k`,ₗ:`l`,ₘ:`m`,ₙ:`n`,ₒ:`o`,ₚ:`p`,ᵣ:`r`,ₛ:`s`,ₜ:`t`,ᵤ:`u`,ᵥ:`v`,ₓ:`x`,ᵦ:`β`,ᵧ:`γ`,ᵨ:`ρ`,ᵩ:`ϕ`,ᵪ:`χ`,"⁺":`+`,"⁻":`-`,"⁼":`=`,"⁽":`(`,"⁾":`)`,"⁰":`0`,"¹":`1`,"²":`2`,"³":`3`,"⁴":`4`,"⁵":`5`,"⁶":`6`,"⁷":`7`,"⁸":`8`,"⁹":`9`,ᴬ:`A`,ᴮ:`B`,ᴰ:`D`,ᴱ:`E`,ᴳ:`G`,ᴴ:`H`,ᴵ:`I`,ᴶ:`J`,ᴷ:`K`,ᴸ:`L`,ᴹ:`M`,ᴺ:`N`,ᴼ:`O`,ᴾ:`P`,ᴿ:`R`,ᵀ:`T`,ᵁ:`U`,ⱽ:`V`,ᵂ:`W`,ᵃ:`a`,ᵇ:`b`,ᶜ:`c`,ᵈ:`d`,ᵉ:`e`,ᶠ:`f`,ᵍ:`g`,ʰ:`h`,ⁱ:`i`,ʲ:`j`,ᵏ:`k`,ˡ:`l`,ᵐ:`m`,ⁿ:`n`,ᵒ:`o`,ᵖ:`p`,ʳ:`r`,ˢ:`s`,ᵗ:`t`,ᵘ:`u`,ᵛ:`v`,ʷ:`w`,ˣ:`x`,ʸ:`y`,ᶻ:`z`,ᵝ:`β`,ᵞ:`γ`,ᵟ:`δ`,ᵠ:`ϕ`,ᵡ:`χ`,ᶿ:`θ`}),cN={"́":{text:`\\'`,math:`\\acute`},"̀":{text:"\\`",math:`\\grave`},"̈":{text:`\\"`,math:`\\ddot`},"̃":{text:`\\~`,math:`\\tilde`},"̄":{text:`\\=`,math:`\\bar`},"̆":{text:`\\u`,math:`\\breve`},"̌":{text:`\\v`,math:`\\check`},"̂":{text:`\\^`,math:`\\hat`},"̇":{text:`\\.`,math:`\\dot`},"̊":{text:`\\r`,math:`\\mathring`},"̋":{text:`\\H`},"̧":{text:`\\c`}},lN={á:`á`,à:`à`,ä:`ä`,ǟ:`ǟ`,ã:`ã`,ā:`ā`,ă:`ă`,ắ:`ắ`,ằ:`ằ`,ẵ:`ẵ`,ǎ:`ǎ`,â:`â`,ấ:`ấ`,ầ:`ầ`,ẫ:`ẫ`,ȧ:`ȧ`,ǡ:`ǡ`,å:`å`,ǻ:`ǻ`,ḃ:`ḃ`,ć:`ć`,ḉ:`ḉ`,č:`č`,ĉ:`ĉ`,ċ:`ċ`,ç:`ç`,ď:`ď`,ḋ:`ḋ`,ḑ:`ḑ`,é:`é`,è:`è`,ë:`ë`,ẽ:`ẽ`,ē:`ē`,ḗ:`ḗ`,ḕ:`ḕ`,ĕ:`ĕ`,ḝ:`ḝ`,ě:`ě`,ê:`ê`,ế:`ế`,ề:`ề`,ễ:`ễ`,ė:`ė`,ȩ:`ȩ`,ḟ:`ḟ`,ǵ:`ǵ`,ḡ:`ḡ`,ğ:`ğ`,ǧ:`ǧ`,ĝ:`ĝ`,ġ:`ġ`,ģ:`ģ`,ḧ:`ḧ`,ȟ:`ȟ`,ĥ:`ĥ`,ḣ:`ḣ`,ḩ:`ḩ`,í:`í`,ì:`ì`,ï:`ï`,ḯ:`ḯ`,ĩ:`ĩ`,ī:`ī`,ĭ:`ĭ`,ǐ:`ǐ`,î:`î`,ǰ:`ǰ`,ĵ:`ĵ`,ḱ:`ḱ`,ǩ:`ǩ`,ķ:`ķ`,ĺ:`ĺ`,ľ:`ľ`,ļ:`ļ`,ḿ:`ḿ`,ṁ:`ṁ`,ń:`ń`,ǹ:`ǹ`,ñ:`ñ`,ň:`ň`,ṅ:`ṅ`,ņ:`ņ`,ó:`ó`,ò:`ò`,ö:`ö`,ȫ:`ȫ`,õ:`õ`,ṍ:`ṍ`,ṏ:`ṏ`,ȭ:`ȭ`,ō:`ō`,ṓ:`ṓ`,ṑ:`ṑ`,ŏ:`ŏ`,ǒ:`ǒ`,ô:`ô`,ố:`ố`,ồ:`ồ`,ỗ:`ỗ`,ȯ:`ȯ`,ȱ:`ȱ`,ő:`ő`,ṕ:`ṕ`,ṗ:`ṗ`,ŕ:`ŕ`,ř:`ř`,ṙ:`ṙ`,ŗ:`ŗ`,ś:`ś`,ṥ:`ṥ`,š:`š`,ṧ:`ṧ`,ŝ:`ŝ`,ṡ:`ṡ`,ş:`ş`,ẗ:`ẗ`,ť:`ť`,ṫ:`ṫ`,ţ:`ţ`,ú:`ú`,ù:`ù`,ü:`ü`,ǘ:`ǘ`,ǜ:`ǜ`,ǖ:`ǖ`,ǚ:`ǚ`,ũ:`ũ`,ṹ:`ṹ`,ū:`ū`,ṻ:`ṻ`,ŭ:`ŭ`,ǔ:`ǔ`,û:`û`,ů:`ů`,ű:`ű`,ṽ:`ṽ`,ẃ:`ẃ`,ẁ:`ẁ`,ẅ:`ẅ`,ŵ:`ŵ`,ẇ:`ẇ`,ẘ:`ẘ`,ẍ:`ẍ`,ẋ:`ẋ`,ý:`ý`,ỳ:`ỳ`,ÿ:`ÿ`,ỹ:`ỹ`,ȳ:`ȳ`,ŷ:`ŷ`,ẏ:`ẏ`,ẙ:`ẙ`,ź:`ź`,ž:`ž`,ẑ:`ẑ`,ż:`ż`,Á:`Á`,À:`À`,Ä:`Ä`,Ǟ:`Ǟ`,Ã:`Ã`,Ā:`Ā`,Ă:`Ă`,Ắ:`Ắ`,Ằ:`Ằ`,Ẵ:`Ẵ`,Ǎ:`Ǎ`,Â:`Â`,Ấ:`Ấ`,Ầ:`Ầ`,Ẫ:`Ẫ`,Ȧ:`Ȧ`,Ǡ:`Ǡ`,Å:`Å`,Ǻ:`Ǻ`,Ḃ:`Ḃ`,Ć:`Ć`,Ḉ:`Ḉ`,Č:`Č`,Ĉ:`Ĉ`,Ċ:`Ċ`,Ç:`Ç`,Ď:`Ď`,Ḋ:`Ḋ`,Ḑ:`Ḑ`,É:`É`,È:`È`,Ë:`Ë`,Ẽ:`Ẽ`,Ē:`Ē`,Ḗ:`Ḗ`,Ḕ:`Ḕ`,Ĕ:`Ĕ`,Ḝ:`Ḝ`,Ě:`Ě`,Ê:`Ê`,Ế:`Ế`,Ề:`Ề`,Ễ:`Ễ`,Ė:`Ė`,Ȩ:`Ȩ`,Ḟ:`Ḟ`,Ǵ:`Ǵ`,Ḡ:`Ḡ`,Ğ:`Ğ`,Ǧ:`Ǧ`,Ĝ:`Ĝ`,Ġ:`Ġ`,Ģ:`Ģ`,Ḧ:`Ḧ`,Ȟ:`Ȟ`,Ĥ:`Ĥ`,Ḣ:`Ḣ`,Ḩ:`Ḩ`,Í:`Í`,Ì:`Ì`,Ï:`Ï`,Ḯ:`Ḯ`,Ĩ:`Ĩ`,Ī:`Ī`,Ĭ:`Ĭ`,Ǐ:`Ǐ`,Î:`Î`,İ:`İ`,Ĵ:`Ĵ`,Ḱ:`Ḱ`,Ǩ:`Ǩ`,Ķ:`Ķ`,Ĺ:`Ĺ`,Ľ:`Ľ`,Ļ:`Ļ`,Ḿ:`Ḿ`,Ṁ:`Ṁ`,Ń:`Ń`,Ǹ:`Ǹ`,Ñ:`Ñ`,Ň:`Ň`,Ṅ:`Ṅ`,Ņ:`Ņ`,Ó:`Ó`,Ò:`Ò`,Ö:`Ö`,Ȫ:`Ȫ`,Õ:`Õ`,Ṍ:`Ṍ`,Ṏ:`Ṏ`,Ȭ:`Ȭ`,Ō:`Ō`,Ṓ:`Ṓ`,Ṑ:`Ṑ`,Ŏ:`Ŏ`,Ǒ:`Ǒ`,Ô:`Ô`,Ố:`Ố`,Ồ:`Ồ`,Ỗ:`Ỗ`,Ȯ:`Ȯ`,Ȱ:`Ȱ`,Ő:`Ő`,Ṕ:`Ṕ`,Ṗ:`Ṗ`,Ŕ:`Ŕ`,Ř:`Ř`,Ṙ:`Ṙ`,Ŗ:`Ŗ`,Ś:`Ś`,Ṥ:`Ṥ`,Š:`Š`,Ṧ:`Ṧ`,Ŝ:`Ŝ`,Ṡ:`Ṡ`,Ş:`Ş`,Ť:`Ť`,Ṫ:`Ṫ`,Ţ:`Ţ`,Ú:`Ú`,Ù:`Ù`,Ü:`Ü`,Ǘ:`Ǘ`,Ǜ:`Ǜ`,Ǖ:`Ǖ`,Ǚ:`Ǚ`,Ũ:`Ũ`,Ṹ:`Ṹ`,Ū:`Ū`,Ṻ:`Ṻ`,Ŭ:`Ŭ`,Ǔ:`Ǔ`,Û:`Û`,Ů:`Ů`,Ű:`Ű`,Ṽ:`Ṽ`,Ẃ:`Ẃ`,Ẁ:`Ẁ`,Ẅ:`Ẅ`,Ŵ:`Ŵ`,Ẇ:`Ẇ`,Ẍ:`Ẍ`,Ẋ:`Ẋ`,Ý:`Ý`,Ỳ:`Ỳ`,Ÿ:`Ÿ`,Ỹ:`Ỹ`,Ȳ:`Ȳ`,Ŷ:`Ŷ`,Ẏ:`Ẏ`,Ź:`Ź`,Ž:`Ž`,Ẑ:`Ẑ`,Ż:`Ż`,ά:`ά`,ὰ:`ὰ`,ᾱ:`ᾱ`,ᾰ:`ᾰ`,έ:`έ`,ὲ:`ὲ`,ή:`ή`,ὴ:`ὴ`,ί:`ί`,ὶ:`ὶ`,ϊ:`ϊ`,ΐ:`ΐ`,ῒ:`ῒ`,ῑ:`ῑ`,ῐ:`ῐ`,ό:`ό`,ὸ:`ὸ`,ύ:`ύ`,ὺ:`ὺ`,ϋ:`ϋ`,ΰ:`ΰ`,ῢ:`ῢ`,ῡ:`ῡ`,ῠ:`ῠ`,ώ:`ώ`,ὼ:`ὼ`,Ύ:`Ύ`,Ὺ:`Ὺ`,Ϋ:`Ϋ`,Ῡ:`Ῡ`,Ῠ:`Ῠ`,Ώ:`Ώ`,Ὼ:`Ὼ`},uN=class e{constructor(e,t){this.mode=void 0,this.gullet=void 0,this.settings=void 0,this.leftrightDepth=void 0,this.nextToken=void 0,this.mode=`math`,this.gullet=new aN(e,t,this.mode),this.settings=t,this.leftrightDepth=0,this.nextToken=null}expect(e,t){if(t===void 0&&(t=!0),this.fetch().text!==e)throw new B(`Expected '`+e+`', got '`+this.fetch().text+`'`,this.fetch());t&&this.consume()}consume(){this.nextToken=null}fetch(){return this.nextToken??=this.gullet.expandNextToken(),this.nextToken}switchMode(e){this.mode=e,this.gullet.switchMode(e)}parse(){this.settings.globalGroup||this.gullet.beginGroup(),this.settings.colorIsTextColor&&this.gullet.macros.set(`\\color`,`\\textcolor`);try{var e=this.parseExpression(!1);return this.expect(`EOF`),this.settings.globalGroup||this.gullet.endGroup(),e}finally{this.gullet.endGroups()}}subparse(e){var t=this.nextToken;this.consume(),this.gullet.pushToken(new Jj(`}`)),this.gullet.pushTokens(e);var n=this.parseExpression(!1);return this.expect(`}`),this.nextToken=t,n}parseExpression(t,n){for(var r=[];;){this.mode===`math`&&this.consumeSpaces();var i=this.fetch();if(e.endOfExpression.has(i.text)||n&&i.text===n||t&&zM[i.text]&&zM[i.text].infix)break;var a=this.parseAtom(n);if(!a)break;a.type!==`internal`&&r.push(a)}return this.mode===`text`&&this.formLigatures(r),this.handleInfixNodes(r)}handleInfixNodes(e){for(var t=-1,n,r=0;r<e.length;r++){var i=e[r];if(i.type===`infix`){if(t!==-1)throw new B(`only one infix operator per group`,i.token);t=r,n=i.replaceWith}}if(t!==-1&&n){var a,o,s=e.slice(0,t),c=e.slice(t+1);return a=s.length===1&&s[0].type===`ordgroup`?s[0]:{type:`ordgroup`,mode:this.mode,body:s},o=c.length===1&&c[0].type===`ordgroup`?c[0]:{type:`ordgroup`,mode:this.mode,body:c},[n===`\\\\abovefrac`?this.callFunction(n,[a,e[t],o],[]):this.callFunction(n,[a,o],[])]}return e}handleSupSubscript(e){var t=this.fetch(),n=t.text;this.consume(),this.consumeSpaces();var r;do r=this.parseGroup(e);while(r?.type===`internal`);if(!r)throw new B(`Expected group after '`+n+`'`,t);return r}formatUnsupportedCmd(e){for(var t=[],n=0;n<e.length;n++)t.push({type:`textord`,mode:`text`,text:e[n]});var r={type:`text`,mode:this.mode,body:t};return{type:`color`,mode:this.mode,color:this.settings.errorColor,body:[r]}}parseAtom(e){var t=this.parseGroup(`atom`,e);if(t?.type===`internal`||this.mode===`text`)return t;for(var n,r;;){this.consumeSpaces();var i=this.fetch();if(i.text===`\\limits`||i.text===`\\nolimits`){if(t&&t.type===`op`)t.limits=i.text===`\\limits`,t.alwaysHandleSupSub=!0;else if(t&&t.type===`operatorname`)t.alwaysHandleSupSub&&(t.limits=i.text===`\\limits`);else throw new B(`Limit controls must follow a math operator`,i);this.consume()}else if(i.text===`^`){if(n)throw new B(`Double superscript`,i);n=this.handleSupSubscript(`superscript`)}else if(i.text===`_`){if(r)throw new B(`Double subscript`,i);r=this.handleSupSubscript(`subscript`)}else if(i.text===`'`){if(n)throw new B(`Double superscript`,i);var a={type:`textord`,mode:this.mode,text:`\\prime`},o=[a];for(this.consume();this.fetch().text===`'`;)o.push(a),this.consume();this.fetch().text===`^`&&o.push(this.handleSupSubscript(`superscript`)),n={type:`ordgroup`,mode:this.mode,body:o}}else if(sN[i.text]){var s=oN.test(i.text),c=[];for(c.push(new Jj(sN[i.text])),this.consume();;){var l=this.fetch().text;if(!sN[l]||oN.test(l)!==s)break;c.unshift(new Jj(sN[l])),this.consume()}var u=this.subparse(c);s?r={type:`ordgroup`,mode:`math`,body:u}:n={type:`ordgroup`,mode:`math`,body:u}}else break}return n&&r?{type:`supsub`,mode:this.mode,base:t,sup:n,sub:r}:n?{type:`supsub`,mode:this.mode,base:t,sup:n}:r?{type:`supsub`,mode:this.mode,base:t,sub:r}:t}parseFunction(e,t){var n=this.fetch(),r=n.text,i=zM[r];if(!i)return null;if(this.consume(),t&&t!==`atom`&&!i.allowedInArgument)throw new B(`Got function '`+r+`' with no arguments`+(t?` as `+t:``),n);if(this.mode===`text`&&!i.allowedInText)throw new B(`Can't use function '`+r+`' in text mode`,n);if(this.mode===`math`&&i.allowedInMath===!1)throw new B(`Can't use function '`+r+`' in math mode`,n);var a=this.parseArguments(r,i),o=a.args,s=a.optArgs;return this.callFunction(r,o,s,n,e)}callFunction(e,t,n,r,i){var a={funcName:e,parser:this,token:r,breakOnTokenText:i},o=zM[e];if(o&&o.handler)return o.handler(a,t,n);throw new B(`No function handler for `+e)}parseArguments(e,t){var n=t.numOptionalArgs??0,r=t.numArgs+n;if(r===0)return{args:[],optArgs:[]};for(var i=[],a=[],o=0;o<r;o++){var s=t.argTypes?.[o],c=o<n;(`primitive`in t&&t.primitive&&s==null||t.type===`sqrt`&&o===1&&a[0]==null)&&(s=`primitive`);var l=this.parseGroupOfType(`argument to '`+e+`'`,s,c);if(c)a.push(l);else if(l!=null)i.push(l);else throw new B(`Null argument, please report this as a bug`)}return{args:i,optArgs:a}}parseGroupOfType(e,t,n){switch(t){case`color`:return this.parseColorGroup(n);case`size`:return this.parseSizeGroup(n);case`url`:return this.parseUrlGroup(n);case`math`:case`text`:return this.parseArgumentGroup(n,t);case`hbox`:var r=this.parseArgumentGroup(n,`text`);return r==null?null:{type:`styling`,mode:r.mode,body:[r],style:`text`,resetFont:!0};case`raw`:var i=this.parseStringGroup(n);return i==null?null:{type:`raw`,mode:`text`,string:i.text};case`primitive`:if(n)throw new B(`A primitive argument cannot be optional`);var a=this.parseGroup(e);if(a==null)throw new B(`Expected group as `+e,this.fetch());return a;case`original`:case void 0:return this.parseArgumentGroup(n);default:throw new B(`Unknown group type as `+e,this.fetch())}}consumeSpaces(){for(;this.fetch().text===` `;)this.consume()}parseStringGroup(e){var t=this.gullet.scanArgument(e);if(t==null)return null;for(var n=``,r;(r=this.fetch()).text!==`EOF`;)n+=r.text,this.consume();return this.consume(),t.text=n,t}parseRegexGroup(e,t){for(var n=this.fetch(),r=n,i=``,a;(a=this.fetch()).text!==`EOF`&&e.test(i+a.text);)r=a,i+=r.text,this.consume();if(i===``)throw new B(`Invalid `+t+`: '`+n.text+`'`,n);return n.range(r,i)}parseColorGroup(e){var t=this.parseStringGroup(e);if(t==null)return null;var n=/^(#[a-f0-9]{3,4}|#[a-f0-9]{6}|#[a-f0-9]{8}|[a-f0-9]{6}|[a-z]+)$/i.exec(t.text);if(!n)throw new B(`Invalid color: '`+t.text+`'`,t);var r=n[0];return/^[0-9a-f]{6}$/i.test(r)&&(r=`#`+r),{type:`color-token`,mode:this.mode,color:r}}parseSizeGroup(e){var t,n=!1;if(this.gullet.consumeSpaces(),t=!e&&this.gullet.future().text!==`{`?this.parseRegexGroup(/^[-+]? *(?:$|\d+|\d+\.\d*|\.\d*) *[a-z]{0,2} *$/,`size`):this.parseStringGroup(e),!t)return null;!e&&t.text.length===0&&(t.text=`0pt`,n=!0);var r=/([-+]?) *(\d+(?:\.\d*)?|\.\d+) *([a-z]{2})/.exec(t.text);if(!r)throw new B(`Invalid size: '`+t.text+`'`,t);var i={number:+(r[1]+r[2]),unit:r[3]};if(!iO(i))throw new B(`Invalid unit: '`+i.unit+`'`,t);return{type:`size`,mode:this.mode,value:i,isBlank:n}}parseUrlGroup(e){this.gullet.lexer.setCatcode(`%`,13),this.gullet.lexer.setCatcode(`~`,12);var t=this.parseStringGroup(e);if(this.gullet.lexer.setCatcode(`%`,14),this.gullet.lexer.setCatcode(`~`,13),t==null)return null;var n=t.text.replace(/\\([#$%&~_^{}])/g,`$1`);return{type:`url`,mode:this.mode,url:n}}parseArgumentGroup(e,t){var n=this.gullet.scanArgument(e);if(n==null)return null;var r=this.mode;t&&this.switchMode(t),this.gullet.beginGroup();var i=this.parseExpression(!1,`EOF`);this.expect(`EOF`),this.gullet.endGroup();var a={type:`ordgroup`,mode:this.mode,loc:n.loc,body:i};return t&&this.switchMode(r),a}parseGroup(e,t){var n=this.fetch(),r=n.text,i;if(r===`{`||r===`\\begingroup`){this.consume();var a=r===`{`?`}`:`\\endgroup`;this.gullet.beginGroup();var o=this.parseExpression(!1,a),s=this.fetch();this.expect(a),this.gullet.endGroup(),i={type:`ordgroup`,mode:this.mode,loc:qj.range(n,s),body:o,semisimple:r===`\\begingroup`||void 0}}else if(i=this.parseFunction(t,e)||this.parseSymbol(),i==null&&r[0]===`\\`&&!Object.prototype.hasOwnProperty.call(iN,r)){if(this.settings.throwOnError)throw new B(`Undefined control sequence: `+r,n);i=this.formatUnsupportedCmd(r),this.consume()}return i}formLigatures(e){for(var t=e.length-1,n=0;n<t;++n){var r=e[n];if(r.type===`textord`){var i=r.text,a=e[n+1];if(a&&a.type===`textord`){if(i===`-`&&a.text===`-`){var o=e[n+2];n+1<t&&o&&o.type===`textord`&&o.text===`-`?(e.splice(n,3,{type:`textord`,mode:`text`,loc:qj.range(r,o),text:`---`}),t-=2):(e.splice(n,2,{type:`textord`,mode:`text`,loc:qj.range(r,a),text:`--`}),--t)}(i===`'`||i==="`")&&a.text===i&&(e.splice(n,2,{type:`textord`,mode:`text`,loc:qj.range(r,a),text:i+i}),--t)}}}}parseSymbol(){var e=this.fetch(),t=e.text;if(/^\\verb[^a-zA-Z]/.test(t)){this.consume();var n=t.slice(5),r=n.charAt(0)===`*`;if(r&&(n=n.slice(1)),n.length<2||n.charAt(0)!==n.slice(-1))throw new B(`\\verb assertion failed --
400
- please report what input caused this bug`);return n=n.slice(1,-1),{type:`verb`,mode:`text`,body:n,star:r}}Object.prototype.hasOwnProperty.call(lN,t[0])&&!AO[this.mode][t[0]]&&(this.settings.strict&&this.mode===`math`&&vk({strict:this.settings.strict,errorCode:`unicodeTextInMathMode`,errorMsg:`Accented Unicode text character "`+t[0]+`" used in math mode`,report:!0,token:e}),t=lN[t[0]]+t.slice(1));var i=KM.exec(t);i&&(t=t.substring(0,i.index),t===`i`?t=`ı`:t===`j`&&(t=`ȷ`));var a;if(AO[this.mode][t]){this.settings.strict&&this.mode===`math`&&ek.includes(t)&&vk({strict:this.settings.strict,errorCode:`unicodeTextInMathMode`,errorMsg:`Latin-1/Unicode text character "`+t[0]+`" used in math mode`,report:!0,token:e});var o=AO[this.mode][t].group,s=qj.range(e);a=VA(o)?{type:`atom`,mode:this.mode,family:o,loc:s,text:t}:{type:o,mode:this.mode,loc:s,text:t}}else if(t.charCodeAt(0)>=128)this.settings.strict&&(BD(t.charCodeAt(0))?this.mode===`math`&&vk({strict:this.settings.strict,errorCode:`unicodeTextInMathMode`,errorMsg:`Unicode text character "`+t[0]+`" used in math mode`,report:!0,token:e}):vk({strict:this.settings.strict,errorCode:`unknownSymbol`,errorMsg:`Unrecognized Unicode character "`+t[0]+`"`+(` (`+t.charCodeAt(0)+`)`),report:!0,token:e})),a={type:`textord`,mode:`text`,loc:qj.range(e),text:t};else return null;if(this.consume(),i)for(var c=0;c<i[0].length;c++){var l=i[0][c];if(!cN[l])throw new B(`Unknown accent ' `+l+`'`,e);var u=cN[l][this.mode]||cN[l].text;if(!u)throw new B(`Accent `+l+` unsupported in `+this.mode+` mode`,e);a={type:`accent`,mode:this.mode,loc:qj.range(e),label:u,isStretchy:!1,isShifty:!0,base:a}}return a}};uN.endOfExpression=new Set([`}`,`\\endgroup`,`\\end`,`\\right`,`&`]);var dN=function(e,t){if(!(typeof e==`string`||e instanceof String))throw TypeError(`KaTeX can only parse string typed expression`);var n=new uN(e,t);delete n.gullet.macros.current[`\\df@tag`];var r=n.parse();if(delete n.gullet.macros.current[`\\current@color`],delete n.gullet.macros.current[`\\color`],n.gullet.macros.get(`\\df@tag`)){if(!t.displayMode)throw new B(`\\tag works only in display equations`);r=[{type:`tag`,mode:`text`,body:r,tag:n.subparse([new Jj(`\\df@tag`)])}]}return r},fN=function(e,t,n){t.textContent=``;var r=gN(e,n).toNode();t.appendChild(r)};typeof document<`u`&&document.compatMode!==`CSS1Compat`&&(typeof console<`u`&&console.warn(`Warning: KaTeX doesn't work in quirks mode. Make sure your website has a suitable doctype.`),fN=function(){throw new B(`KaTeX doesn't work in quirks mode.`)});var pN=function(e,t){return gN(e,t).toMarkup()},mN=function(e,t){return dN(e,new yD(t))},hN=function(e,t,n){if(n.throwOnError||!(e instanceof B))throw e;var r=X([`katex-error`],[new gO(t)]);return r.setAttribute(`title`,e.toString()),r.setAttribute(`style`,`color:`+n.errorColor),r},gN=function(e,t){var n=new yD(t);try{return kA(dN(e,n),e,n)}catch(t){return hN(t,e,n)}},_N={version:`0.19.0`,render:fN,renderToString:pN,ParseError:B,SETTINGS_SCHEMA:hD,__parse:mN,__renderToDomTree:gN,__renderToHTMLTree:function(e,t){var n=new yD(t);try{return AA(dN(e,n),n)}catch(t){return hN(t,e,n)}},__setFontMetrics:EO,__defineSymbol:H,__defineFunction:Z,__defineMacro:$,__domTree:{Span:fO,Anchor:pO,SymbolNode:gO,SvgNode:_O,PathNode:vO,LineNode:yO}},vN=/^ {0,3}(?:\$\$([\s\S]+?)\$\$|\\\[([\s\S]+?)\\\])[ \t]*(?:\n|$)/,yN=/^\$(?![\s$])((?:\\[^`\n]|[^\\$`\n])+?)(?<!\s)\$(?![\d$])/,bN=/(`+)[\s\S]*?\1(?!`)|(?<math>\$\$[^`]+?\$\$|\\\[[^`]+?\\\]|\\\([^`]+?\\\)|\$(?![\s$])(?:\\[^`\n]|[^\\$`\n])+?(?<!\s)\$(?![\d$]))|\\[^\n]/g,xN=new qE;function SN(e,t){let n=t.length-e.length,r=``,i=0;for(let a of e.matchAll(bN)){if(!a.groups?.math)continue;let e=n+a.index;r+=t.slice(i,e)+`a`.repeat(a[0].length),i=e+a[0].length}return r+t.slice(i)}function CN(e){return _N.renderToString(e.text,{displayMode:e.displayMode,throwOnError:!1,trust:!1,maxSize:20,maxExpand:1e3})}var wN=new $E({gfm:!0,breaks:!0},{tokenizer:{emStrong(e,t,n){if(/^[*_]/.test(e))return xN.emStrong.call(this,e,SN(e,t),n)},del(e,t,n){if(e.startsWith(`~`))return xN.del.call(this,e,SN(e,t),n)}},extensions:[{name:`blockMath`,level:`block`,start:e=>e.search(/^ {0,3}(?:\$\$|\\\[)/m),tokenizer(e){let t=vN.exec(e);if(t)return{type:`blockMath`,raw:t[0],text:(t[1]??t[2]).trim(),displayMode:!0}},renderer:CN},{name:`inlineMath`,level:`inline`,start:e=>e.search(/\$|\\[([]/),tokenizer(e){if(this.lexer.state.inRawBlock)return;let t=/^(?:\$\$([^`]+?)\$\$|\\\[([^`]+?)\\\])/.exec(e),n=t??/^\\\(([^`]+?)\\\)/.exec(e)??yN.exec(e);if(n)return{type:`inlineMath`,raw:n[0],text:(n[1]??n[2]).trim(),displayMode:!!t}},renderer:CN}]});lT.addHook(`uponSanitizeAttribute`,(e,t)=>{if(e.nodeName!==`IMG`||t.attrName!==`src`)return;let n=rD(t.attrValue);t.attrValue=iD(n)?`${n[0]}%3A${n.slice(2)}`:n});function TN(e,t=!1){let n=lT.sanitize(e,{ADD_FORBID_CONTENTS:[`annotation`],ADD_ATTR:[`target`,`rel`],FORBID_ATTR:t?[`target`,`rel`]:[]});return t?n.replace(/<a(?=[\s>])/gi,`<a target="_blank" rel="noopener noreferrer"`):n}var EN=/^\s*artifact:([A-Za-z0-9_-]+)\s*$/;function DN(e,t,n=!1){let r=[],i=[],a=()=>{if(i.length===0)return;let e=TN(wN.parser(i),n);e&&r.push({type:`html`,html:e}),i=[]};for(let n of wN.lexer(e)){let e=(n.type===`paragraph`?EN.exec(n.raw):null)?.[1];if(!e||!t.has(e)){i.push(n);continue}a(),r.push({type:`artifact`,artifactId:e})}return a(),r}var ON={markdown:C_,html:N_,react:y_};function kN({artifact:e,onOpen:t}){let n=ON[e.artifactType];return(0,R.jsxs)(`div`,{"data-artifact-reference":e.key,className:`bg-card my-3 flex min-w-0 items-center gap-3 rounded-lg border p-3 shadow-xs`,children:[(0,R.jsx)(`div`,{className:`bg-muted flex size-10 shrink-0 items-center justify-center rounded-md border`,children:(0,R.jsx)(n,{className:`text-muted-foreground size-4`,"aria-hidden":`true`})}),(0,R.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,R.jsx)(`div`,{className:`text-foreground truncate text-sm font-medium`,children:e.title}),(0,R.jsx)(`div`,{className:`text-muted-foreground mt-0.5 text-xs`,children:`Artifact`})]}),(0,R.jsx)(`button`,{type:`button`,className:`bg-background text-foreground hover:bg-muted shrink-0 rounded-md border px-3 py-1.5 text-sm font-medium transition`,onClick:t,"aria-label":`View ${e.title}`,children:`View`})]})}var AN=m(),jN=[{name:`TypeScript`,svg:`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 128 128"><path fill="#fff" d="M22.67 47h99.67v73.67H22.67z"/><path data-name="original" fill="#007acc" d="M1.5 63.91v62.5h125v-125H1.5zm100.73-5a15.56 15.56 0 017.82 4.5 20.58 20.58 0 013 4c0 .16-5.4 3.81-8.69 5.85-.12.08-.6-.44-1.13-1.23a7.09 7.09 0 00-5.87-3.53c-3.79-.26-6.23 1.73-6.21 5a4.58 4.58 0 00.54 2.34c.83 1.73 2.38 2.76 7.24 4.86 8.95 3.85 12.78 6.39 15.16 10 2.66 4 3.25 10.46 1.45 15.24-2 5.2-6.9 8.73-13.83 9.9a38.32 38.32 0 01-9.52-.1 23 23 0 01-12.72-6.63c-1.15-1.27-3.39-4.58-3.25-4.82a9.34 9.34 0 011.15-.73L82 101l3.59-2.08.75 1.11a16.78 16.78 0 004.74 4.54c4 2.1 9.46 1.81 12.16-.62a5.43 5.43 0 00.69-6.92c-1-1.39-3-2.56-8.59-5-6.45-2.78-9.23-4.5-11.77-7.24a16.48 16.48 0 01-3.43-6.25 25 25 0 01-.22-8c1.33-6.23 6-10.58 12.82-11.87a31.66 31.66 0 019.49.26zm-29.34 5.24v5.12H56.66v46.23H45.15V69.26H28.88v-5a49.19 49.19 0 01.12-5.17C29.08 59 39 59 51 59h21.83z"/></svg>`,languages:[`ts`,`tsx`,`typescript`]},{name:`JavaScript`,svg:`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 128 128"><path fill="#F0DB4F" d="M1.408 1.408h125.184v125.185H1.408z"/><path fill="#323330" d="M116.347 96.736c-.917-5.711-4.641-10.508-15.672-14.981-3.832-1.761-8.104-3.022-9.377-5.926-.452-1.69-.512-2.642-.226-3.665.821-3.32 4.784-4.355 7.925-3.403 2.023.678 3.938 2.237 5.093 4.724 5.402-3.498 5.391-3.475 9.163-5.879-1.381-2.141-2.118-3.129-3.022-4.045-3.249-3.629-7.676-5.498-14.756-5.355l-3.688.477c-3.534.893-6.902 2.748-8.877 5.235-5.926 6.724-4.236 18.492 2.975 23.335 7.104 5.332 17.54 6.545 18.873 11.531 1.297 6.104-4.486 8.08-10.234 7.378-4.236-.881-6.592-3.034-9.139-6.949-4.688 2.713-4.688 2.713-9.508 5.485 1.143 2.499 2.344 3.63 4.26 5.795 9.068 9.198 31.76 8.746 35.83-5.176.165-.478 1.261-3.666.38-8.581zM69.462 58.943H57.753l-.048 30.272c0 6.438.333 12.34-.714 14.149-1.713 3.558-6.152 3.117-8.175 2.427-2.059-1.012-3.106-2.451-4.319-4.485-.333-.584-.583-1.036-.667-1.071l-9.52 5.83c1.583 3.249 3.915 6.069 6.902 7.901 4.462 2.678 10.459 3.499 16.731 2.059 4.082-1.189 7.604-3.652 9.448-7.401 2.666-4.915 2.094-10.864 2.07-17.444.06-10.735.001-21.468.001-32.237z"/></svg>`,languages:[`js`,`jsx`,`javascript`]},{name:`Python`,svg:`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 128 128"><linearGradient id="python-original-a" gradientUnits="userSpaceOnUse" x1="70.252" y1="1237.476" x2="170.659" y2="1151.089" gradientTransform="matrix(.563 0 0 -.568 -29.215 707.817)"><stop offset="0" stop-color="#5A9FD4"/><stop offset="1" stop-color="#306998"/></linearGradient><linearGradient id="python-original-b" gradientUnits="userSpaceOnUse" x1="209.474" y1="1098.811" x2="173.62" y2="1149.537" gradientTransform="matrix(.563 0 0 -.568 -29.215 707.817)"><stop offset="0" stop-color="#FFD43B"/><stop offset="1" stop-color="#FFE873"/></linearGradient><path fill="url(#python-original-a)" d="M63.391 1.988c-4.222.02-8.252.379-11.8 1.007-10.45 1.846-12.346 5.71-12.346 12.837v9.411h24.693v3.137H29.977c-7.176 0-13.46 4.313-15.426 12.521-2.268 9.405-2.368 15.275 0 25.096 1.755 7.311 5.947 12.519 13.124 12.519h8.491V67.234c0-8.151 7.051-15.34 15.426-15.34h24.665c6.866 0 12.346-5.654 12.346-12.548V15.833c0-6.693-5.646-11.72-12.346-12.837-4.244-.706-8.645-1.027-12.866-1.008zM50.037 9.557c2.55 0 4.634 2.117 4.634 4.721 0 2.593-2.083 4.69-4.634 4.69-2.56 0-4.633-2.097-4.633-4.69-.001-2.604 2.073-4.721 4.633-4.721z" transform="translate(0 10.26)"/><path fill="url(#python-original-b)" d="M91.682 28.38v10.966c0 8.5-7.208 15.655-15.426 15.655H51.591c-6.756 0-12.346 5.783-12.346 12.549v23.515c0 6.691 5.818 10.628 12.346 12.547 7.816 2.297 15.312 2.713 24.665 0 6.216-1.801 12.346-5.423 12.346-12.547v-9.412H63.938v-3.138h37.012c7.176 0 9.852-5.005 12.348-12.519 2.578-7.735 2.467-15.174 0-25.096-1.774-7.145-5.161-12.521-12.348-12.521h-9.268zM77.809 87.927c2.561 0 4.634 2.097 4.634 4.692 0 2.602-2.074 4.719-4.634 4.719-2.55 0-4.633-2.117-4.633-4.719 0-2.595 2.083-4.692 4.633-4.692z" transform="translate(0 10.26)"/><radialGradient id="python-original-c" cx="1825.678" cy="444.45" r="26.743" gradientTransform="matrix(0 -.24 -1.055 0 532.979 557.576)" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#B8B8B8" stop-opacity=".498"/><stop offset="1" stop-color="#7F7F7F" stop-opacity="0"/></radialGradient><path opacity=".444" fill="url(#python-original-c)" d="M97.309 119.597c0 3.543-14.816 6.416-33.091 6.416-18.276 0-33.092-2.873-33.092-6.416 0-3.544 14.815-6.417 33.092-6.417 18.275 0 33.091 2.872 33.091 6.417z"/></svg>
398
+ ?)[ \r ]*`,KM=`[̀-ͯ]`,qM=RegExp(KM+`+$`),JM=`(`+VM+`+)|`+(GM+`|`)+`([!-\\[\\]-‧‪-퟿豈-￿]`+(KM+`*`)+`|[\ud800-\udbff][\udc00-\udfff]`+(KM+`*`)+`|\\\\verb\\*([^]).*?\\4|\\\\verb([^*a-zA-Z]).*?\\5`+(`|`+WM)+(`|`+UM+`)`),YM=class{constructor(e,t){this.input=void 0,this.settings=void 0,this.tokenRegex=void 0,this.catcodes=void 0,this.input=e,this.settings=t,this.tokenRegex=new RegExp(JM,`g`),this.catcodes={"%":14,"~":13}}setCatcode(e,t){this.catcodes[e]=t}lex(){var e=this.input,t=this.tokenRegex.lastIndex;if(t===e.length)return new Yj(`EOF`,new Jj(this,t,t));var n=this.tokenRegex.exec(e);if(n===null||n.index!==t)throw new B(`Unexpected character: '`+e[t]+`'`,new Yj(e[t],new Jj(this,t,t+1)));var r=n[6]||n[3]||(n[2]?`\\ `:` `);if(this.catcodes[r]===14){var i=e.indexOf(`
399
+ `,this.tokenRegex.lastIndex);return i===-1?(this.tokenRegex.lastIndex=e.length,yk({strict:this.settings.strict,errorCode:`commentAtEnd`,errorMsg:`% comment has no terminating newline; LaTeX would fail because of commenting the end of math mode (e.g. $)`,report:!0})):this.tokenRegex.lastIndex=i+1,this.lex()}return new Yj(r,new Jj(this,t,this.tokenRegex.lastIndex))}},XM=class{constructor(e,t){e===void 0&&(e={}),t===void 0&&(t={}),this.current=void 0,this.builtins=void 0,this.undefStack=void 0,this.current=t,this.builtins=e,this.undefStack=[]}beginGroup(){this.undefStack.push({})}endGroup(){if(this.undefStack.length===0)throw new B(`Unbalanced namespace destruction: attempt to pop global namespace; please report this as a bug`);var e=this.undefStack.pop();for(var t of Object.keys(e))e[t]===void 0?delete this.current[t]:this.current[t]=e[t]}endGroups(){for(;this.undefStack.length>0;)this.endGroup()}has(e){return Object.prototype.hasOwnProperty.call(this.current,e)||Object.prototype.hasOwnProperty.call(this.builtins,e)}get(e){if(Object.prototype.hasOwnProperty.call(this.current,e))return this.current[e];if(Object.prototype.hasOwnProperty.call(this.builtins,e))return this.builtins[e]}set(e,t,n){if(n===void 0&&(n=!1),n){for(var r=0;r<this.undefStack.length;r++)delete this.undefStack[r][e];this.undefStack.length>0&&(this.undefStack[this.undefStack.length-1][e]=t)}else{var i=this.undefStack[this.undefStack.length-1];i&&!Object.prototype.hasOwnProperty.call(i,e)&&(i[e]=Object.prototype.hasOwnProperty.call(this.current,e)?this.current[e]:void 0)}t==null?delete this.current[e]:this.current[e]=t}},ZM=qj;$(`\\noexpand`,function(e){var t=e.popToken();return e.isExpandable(t.text)&&(t.noexpand=!0,t.treatAsRelax=!0),{tokens:[t],numArgs:0}}),$(`\\expandafter`,function(e){var t=e.popToken();return e.expandOnce(!0),{tokens:[t],numArgs:0}}),$(`\\@firstoftwo`,function(e){return{tokens:e.consumeArgs(2)[0],numArgs:0}}),$(`\\@secondoftwo`,function(e){return{tokens:e.consumeArgs(2)[1],numArgs:0}}),$(`\\@ifnextchar`,function(e){var t=e.consumeArgs(3);e.consumeSpaces();var n=e.future();return t[0].length===1&&t[0][0].text===n.text?{tokens:t[1],numArgs:0}:{tokens:t[2],numArgs:0}}),$(`\\@ifstar`,`\\@ifnextchar *{\\@firstoftwo{#1}}`),$(`\\TextOrMath`,function(e){var t=e.consumeArgs(2);return e.mode===`text`?{tokens:t[0],numArgs:0}:{tokens:t[1],numArgs:0}});var QM={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,a:10,A:10,b:11,B:11,c:12,C:12,d:13,D:13,e:14,E:14,f:15,F:15};$(`\\char`,function(e){var t=e.popToken(),n,r=0;if(t.text===`'`)n=8,t=e.popToken();else if(t.text===`"`)n=16,t=e.popToken();else if(t.text==="`"){if(t=e.popToken(),t.text[0]===`\\`)r=t.text.charCodeAt(1);else if(t.text===`EOF`)throw new B("\\char` missing argument");else r=t.text.charCodeAt(0)}else n=10;if(n){if(r=QM[t.text],r==null||r>=n)throw new B(`Invalid base-`+n+` digit `+t.text);for(var i;(i=QM[e.future().text])!=null&&i<n;)r*=n,r+=i,e.popToken()}return`\\@char{`+r+`}`});var $M=(e,t,n,r)=>{var i=e.consumeArg().tokens;if(i.length!==1)throw new B(`\\newcommand's first argument must be a macro name`);var a=i[0].text,o=e.isDefined(a);if(o&&!t)throw new B(`\\newcommand{`+a+`} attempting to redefine `+(a+`; use \\renewcommand`));if(!o&&!n)throw new B(`\\renewcommand{`+a+`} when command `+a+` does not yet exist; use \\newcommand`);var s=0;if(i=e.consumeArg().tokens,i.length===1&&i[0].text===`[`){for(var c=``,l=e.expandNextToken();l.text!==`]`&&l.text!==`EOF`;)c+=l.text,l=e.expandNextToken();if(!c.match(/^\s*[0-9]+\s*$/))throw new B(`Invalid number of arguments: `+c);s=parseInt(c),i=e.consumeArg().tokens}return o&&r||e.macros.set(a,{tokens:i,numArgs:s}),``};$(`\\newcommand`,e=>$M(e,!1,!0,!1)),$(`\\renewcommand`,e=>$M(e,!0,!1,!1)),$(`\\providecommand`,e=>$M(e,!0,!0,!0)),$(`\\message`,e=>{var t=e.consumeArgs(1)[0];return console.log(t.reverse().map(e=>e.text).join(``)),``}),$(`\\errmessage`,e=>{var t=e.consumeArgs(1)[0];return console.error(t.reverse().map(e=>e.text).join(``)),``}),$(`\\show`,e=>{var t=e.popToken(),n=t.text;return console.log(t,e.macros.get(n),BM[n],jO.math[n],jO.text[n]),``}),$(`\\bgroup`,`{`),$(`\\egroup`,`}`),$(`~`,`\\nobreakspace`),$(`\\lq`,"`"),$(`\\rq`,`'`),$(`\\aa`,`\\r a`),$(`\\AA`,`\\r A`),$(`\\textcopyright`,"\\html@mathml{\\textcircled{c}}{\\char`©}"),$(`\\copyright`,`\\TextOrMath{\\textcopyright}{\\text{\\textcopyright}}`),$(`\\textregistered`,"\\html@mathml{\\textcircled{\\scriptsize R}}{\\char`®}"),$(`ℬ`,`\\mathscr{B}`),$(`ℰ`,`\\mathscr{E}`),$(`ℱ`,`\\mathscr{F}`),$(`ℋ`,`\\mathscr{H}`),$(`ℐ`,`\\mathscr{I}`),$(`ℒ`,`\\mathscr{L}`),$(`ℳ`,`\\mathscr{M}`),$(`ℛ`,`\\mathscr{R}`),$(`ℭ`,`\\mathfrak{C}`),$(`ℌ`,`\\mathfrak{H}`),$(`ℨ`,`\\mathfrak{Z}`),$(`\\Bbbk`,`\\Bbb{k}`),$(`\\llap`,`\\mathllap{\\textrm{#1}}`),$(`\\rlap`,`\\mathrlap{\\textrm{#1}}`),$(`\\clap`,`\\mathclap{\\textrm{#1}}`),$(`\\mathstrut`,`\\vphantom{(}`),$(`\\underbar`,`\\underline{\\text{#1}}`),$(`\\not`,`\\html@mathml{\\mathrel{\\mathrlap\\@not}\\nobreak}{\\char"338}`),$(`\\neq`,"\\html@mathml{\\mathrel{\\not=}}{\\mathrel{\\char`≠}}"),$(`\\ne`,`\\neq`),$(`≠`,`\\neq`),$(`\\notin`,"\\html@mathml{\\mathrel{{\\in}\\mathllap{/\\mskip1mu}}}{\\mathrel{\\char`∉}}"),$(`∉`,`\\notin`),$(`≘`,"\\html@mathml{\\mathrel{=\\kern{-1em}\\raisebox{0.4em}{$\\scriptsize\\frown$}}}{\\mathrel{\\char`≘}}"),$(`≙`,"\\html@mathml{\\stackrel{\\tiny\\wedge}{=}}{\\mathrel{\\char`≘}}"),$(`≚`,"\\html@mathml{\\stackrel{\\tiny\\vee}{=}}{\\mathrel{\\char`≚}}"),$(`≛`,"\\html@mathml{\\stackrel{\\scriptsize\\star}{=}}{\\mathrel{\\char`≛}}"),$(`≝`,"\\html@mathml{\\stackrel{\\tiny\\mathrm{def}}{=}}{\\mathrel{\\char`≝}}"),$(`≞`,"\\html@mathml{\\stackrel{\\tiny\\mathrm{m}}{=}}{\\mathrel{\\char`≞}}"),$(`≟`,"\\html@mathml{\\stackrel{\\tiny?}{=}}{\\mathrel{\\char`≟}}"),$(`⟂`,`\\perp`),$(`‼`,`\\mathclose{!\\mkern-0.8mu!}`),$(`∌`,`\\notni`),$(`⌜`,`\\ulcorner`),$(`⌝`,`\\urcorner`),$(`⌞`,`\\llcorner`),$(`⌟`,`\\lrcorner`),$(`©`,`\\copyright`),$(`®`,`\\textregistered`),$(`\\ulcorner`,`\\html@mathml{\\@ulcorner}{\\mathop{\\char"231c}}`),$(`\\urcorner`,`\\html@mathml{\\@urcorner}{\\mathop{\\char"231d}}`),$(`\\llcorner`,`\\html@mathml{\\@llcorner}{\\mathop{\\char"231e}}`),$(`\\lrcorner`,`\\html@mathml{\\@lrcorner}{\\mathop{\\char"231f}}`),$(`\\vdots`,`{\\varvdots\\rule{0pt}{15pt}}`),$(`⋮`,`\\vdots`),$(`\\varGamma`,`\\mathit{\\Gamma}`),$(`\\varDelta`,`\\mathit{\\Delta}`),$(`\\varTheta`,`\\mathit{\\Theta}`),$(`\\varLambda`,`\\mathit{\\Lambda}`),$(`\\varXi`,`\\mathit{\\Xi}`),$(`\\varPi`,`\\mathit{\\Pi}`),$(`\\varSigma`,`\\mathit{\\Sigma}`),$(`\\varUpsilon`,`\\mathit{\\Upsilon}`),$(`\\varPhi`,`\\mathit{\\Phi}`),$(`\\varPsi`,`\\mathit{\\Psi}`),$(`\\varOmega`,`\\mathit{\\Omega}`),$(`\\substack`,`\\begin{subarray}{c}#1\\end{subarray}`),$(`\\colon`,`\\nobreak\\mskip2mu\\mathpunct{}\\mathchoice{\\mkern-3mu}{\\mkern-3mu}{}{}{:}\\mskip6mu\\relax`),$(`\\boxed`,`\\fbox{$\\displaystyle{#1}$}`),$(`\\iff`,`\\DOTSB\\;\\Longleftrightarrow\\;`),$(`\\implies`,`\\DOTSB\\;\\Longrightarrow\\;`),$(`\\impliedby`,`\\DOTSB\\;\\Longleftarrow\\;`),$(`\\dddot`,`{\\overset{\\raisebox{-0.1ex}{\\normalsize ...}}{#1}}`),$(`\\ddddot`,`{\\overset{\\raisebox{-0.1ex}{\\normalsize ....}}{#1}}`);var eN={",":`\\dotsc`,"\\not":`\\dotsb`,"+":`\\dotsb`,"=":`\\dotsb`,"<":`\\dotsb`,">":`\\dotsb`,"-":`\\dotsb`,"*":`\\dotsb`,":":`\\dotsb`,"\\DOTSB":`\\dotsb`,"\\coprod":`\\dotsb`,"\\bigvee":`\\dotsb`,"\\bigwedge":`\\dotsb`,"\\biguplus":`\\dotsb`,"\\bigcap":`\\dotsb`,"\\bigcup":`\\dotsb`,"\\prod":`\\dotsb`,"\\sum":`\\dotsb`,"\\bigotimes":`\\dotsb`,"\\bigoplus":`\\dotsb`,"\\bigodot":`\\dotsb`,"\\bigsqcup":`\\dotsb`,"\\And":`\\dotsb`,"\\longrightarrow":`\\dotsb`,"\\Longrightarrow":`\\dotsb`,"\\longleftarrow":`\\dotsb`,"\\Longleftarrow":`\\dotsb`,"\\longleftrightarrow":`\\dotsb`,"\\Longleftrightarrow":`\\dotsb`,"\\mapsto":`\\dotsb`,"\\longmapsto":`\\dotsb`,"\\hookrightarrow":`\\dotsb`,"\\doteq":`\\dotsb`,"\\mathbin":`\\dotsb`,"\\mathrel":`\\dotsb`,"\\relbar":`\\dotsb`,"\\Relbar":`\\dotsb`,"\\xrightarrow":`\\dotsb`,"\\xleftarrow":`\\dotsb`,"\\DOTSI":`\\dotsi`,"\\int":`\\dotsi`,"\\oint":`\\dotsi`,"\\iint":`\\dotsi`,"\\iiint":`\\dotsi`,"\\iiiint":`\\dotsi`,"\\idotsint":`\\dotsi`,"\\DOTSX":`\\dotsx`},tN=new Set([`bin`,`rel`]);$(`\\dots`,function(e){var t=`\\dotso`,n=e.expandAfterFuture().text;return n in eN?t=eN[n]:(n.slice(0,4)===`\\not`||n in jO.math&&tN.has(jO.math[n].group))&&(t=`\\dotsb`),t});var nN={")":!0,"]":!0,"\\rbrack":!0,"\\}":!0,"\\rbrace":!0,"\\rangle":!0,"\\rceil":!0,"\\rfloor":!0,"\\rgroup":!0,"\\rmoustache":!0,"\\right":!0,"\\bigr":!0,"\\biggr":!0,"\\Bigr":!0,"\\Biggr":!0,$:!0,";":!0,".":!0,",":!0};$(`\\dotso`,function(e){return e.future().text in nN?`\\ldots\\,`:`\\ldots`}),$(`\\dotsc`,function(e){var t=e.future().text;return t in nN&&t!==`,`?`\\ldots\\,`:`\\ldots`}),$(`\\cdots`,function(e){return e.future().text in nN?`\\@cdots\\,`:`\\@cdots`}),$(`\\dotsb`,`\\cdots`),$(`\\dotsm`,`\\cdots`),$(`\\dotsi`,`\\!\\cdots`),$(`\\dotsx`,`\\ldots\\,`),$(`\\DOTSI`,`\\relax`),$(`\\DOTSB`,`\\relax`),$(`\\DOTSX`,`\\relax`),$(`\\tmspace`,`\\TextOrMath{\\kern#1#3}{\\mskip#1#2}\\relax`),$(`\\,`,`\\tmspace+{3mu}{.1667em}`),$(`\\thinspace`,`\\,`),$(`\\>`,`\\mskip{4mu}`),$(`\\:`,`\\tmspace+{4mu}{.2222em}`),$(`\\medspace`,`\\:`),$(`\\;`,`\\tmspace+{5mu}{.2777em}`),$(`\\thickspace`,`\\;`),$(`\\!`,`\\tmspace-{3mu}{.1667em}`),$(`\\negthinspace`,`\\!`),$(`\\negmedspace`,`\\tmspace-{4mu}{.2222em}`),$(`\\negthickspace`,`\\tmspace-{5mu}{.277em}`),$(`\\enspace`,`\\kern.5em `),$(`\\enskip`,`\\hskip.5em\\relax`),$(`\\quad`,`\\hskip1em\\relax`),$(`\\qquad`,`\\hskip2em\\relax`),$(`\\tag`,`\\@ifstar\\tag@literal\\tag@paren`),$(`\\tag@paren`,`\\tag@literal{({#1})}`),$(`\\tag@literal`,e=>{if(e.macros.get(`\\df@tag`))throw new B(`Multiple \\tag`);return`\\gdef\\df@tag{\\text{#1}}`}),$(`\\bmod`,`\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}\\mathbin{\\rm mod}\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}`),$(`\\pod`,`\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern8mu}{\\mkern8mu}{\\mkern8mu}(#1)`),$(`\\pmod`,`\\pod{{\\rm mod}\\mkern6mu#1}`),$(`\\mod`,`\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern12mu}{\\mkern12mu}{\\mkern12mu}{\\rm mod}\\,\\,#1`),$(`\\newline`,`\\\\\\relax`),$(`\\TeX`,`\\textrm{\\html@mathml{T\\kern-.1667em\\raisebox{-.5ex}{E}\\kern-.125emX}{TeX}}`);var rN=V(wO[`Main-Regular`][84][1]-.7*wO[`Main-Regular`][65][1]);$(`\\LaTeX`,`\\textrm{\\html@mathml{`+(`L\\kern-.36em\\raisebox{`+rN+`}{\\scriptstyle A}`)+`\\kern-.15em\\TeX}{LaTeX}}`),$(`\\KaTeX`,`\\textrm{\\html@mathml{`+(`K\\kern-.17em\\raisebox{`+rN+`}{\\scriptstyle A}`)+`\\kern-.15em\\TeX}{KaTeX}}`),$(`\\hspace`,`\\@ifstar\\@hspacer\\@hspace`),$(`\\@hspace`,`\\hskip #1\\relax`),$(`\\@hspacer`,`\\rule{0pt}{0pt}\\hskip #1\\relax`),$(`\\ordinarycolon`,`:`),$(`\\vcentcolon`,`\\mathrel{\\mathop\\ordinarycolon}`),$(`\\dblcolon`,`\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-.9mu}\\vcentcolon}}{\\mathop{\\char"2237}}`),$(`\\coloneqq`,`\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2254}}`),$(`\\Coloneqq`,`\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2237\\char"3d}}`),$(`\\coloneq`,`\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"3a\\char"2212}}`),$(`\\Coloneq`,`\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"2237\\char"2212}}`),$(`\\eqqcolon`,`\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2255}}`),$(`\\Eqqcolon`,`\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"3d\\char"2237}}`),$(`\\eqcolon`,`\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2239}}`),$(`\\Eqcolon`,`\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"2212\\char"2237}}`),$(`\\colonapprox`,`\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"3a\\char"2248}}`),$(`\\Colonapprox`,`\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"2237\\char"2248}}`),$(`\\colonsim`,`\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"3a\\char"223c}}`),$(`\\Colonsim`,`\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"2237\\char"223c}}`),$(`∷`,`\\dblcolon`),$(`∹`,`\\eqcolon`),$(`≔`,`\\coloneqq`),$(`≕`,`\\eqqcolon`),$(`⩴`,`\\Coloneqq`),$(`\\ratio`,`\\vcentcolon`),$(`\\coloncolon`,`\\dblcolon`),$(`\\colonequals`,`\\coloneqq`),$(`\\coloncolonequals`,`\\Coloneqq`),$(`\\equalscolon`,`\\eqqcolon`),$(`\\equalscoloncolon`,`\\Eqqcolon`),$(`\\colonminus`,`\\coloneq`),$(`\\coloncolonminus`,`\\Coloneq`),$(`\\minuscolon`,`\\eqcolon`),$(`\\minuscoloncolon`,`\\Eqcolon`),$(`\\coloncolonapprox`,`\\Colonapprox`),$(`\\coloncolonsim`,`\\Colonsim`),$(`\\simcolon`,`\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\vcentcolon}`),$(`\\simcoloncolon`,`\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\dblcolon}`),$(`\\approxcolon`,`\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\vcentcolon}`),$(`\\approxcoloncolon`,`\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\dblcolon}`),$(`\\notni`,"\\html@mathml{\\not\\ni}{\\mathrel{\\char`∌}}"),$(`\\limsup`,`\\DOTSB\\operatorname*{lim\\,sup}`),$(`\\liminf`,`\\DOTSB\\operatorname*{lim\\,inf}`),$(`\\injlim`,`\\DOTSB\\operatorname*{inj\\,lim}`),$(`\\projlim`,`\\DOTSB\\operatorname*{proj\\,lim}`),$(`\\varlimsup`,`\\DOTSB\\operatorname*{\\overline{lim}}`),$(`\\varliminf`,`\\DOTSB\\operatorname*{\\underline{lim}}`),$(`\\varinjlim`,`\\DOTSB\\operatorname*{\\underrightarrow{lim}}`),$(`\\varprojlim`,`\\DOTSB\\operatorname*{\\underleftarrow{lim}}`),$(`\\gvertneqq`,`\\html@mathml{\\@gvertneqq}{≩}`),$(`\\lvertneqq`,`\\html@mathml{\\@lvertneqq}{≨}`),$(`\\ngeqq`,`\\html@mathml{\\@ngeqq}{≱}`),$(`\\ngeqslant`,`\\html@mathml{\\@ngeqslant}{≱}`),$(`\\nleqq`,`\\html@mathml{\\@nleqq}{≰}`),$(`\\nleqslant`,`\\html@mathml{\\@nleqslant}{≰}`),$(`\\nshortmid`,`\\html@mathml{\\@nshortmid}{∤}`),$(`\\nshortparallel`,`\\html@mathml{\\@nshortparallel}{∦}`),$(`\\nsubseteqq`,`\\html@mathml{\\@nsubseteqq}{⊈}`),$(`\\nsupseteqq`,`\\html@mathml{\\@nsupseteqq}{⊉}`),$(`\\varsubsetneq`,`\\html@mathml{\\@varsubsetneq}{⊊}`),$(`\\varsubsetneqq`,`\\html@mathml{\\@varsubsetneqq}{⫋}`),$(`\\varsupsetneq`,`\\html@mathml{\\@varsupsetneq}{⊋}`),$(`\\varsupsetneqq`,`\\html@mathml{\\@varsupsetneqq}{⫌}`),$(`\\imath`,`\\html@mathml{\\@imath}{ı}`),$(`\\jmath`,`\\html@mathml{\\@jmath}{ȷ}`),$(`\\llbracket`,"\\html@mathml{\\mathopen{[\\mkern-3.2mu[}}{\\mathopen{\\char`⟦}}"),$(`\\rrbracket`,"\\html@mathml{\\mathclose{]\\mkern-3.2mu]}}{\\mathclose{\\char`⟧}}"),$(`⟦`,`\\llbracket`),$(`⟧`,`\\rrbracket`),$(`\\lBrace`,"\\html@mathml{\\mathopen{\\{\\mkern-3.2mu[}}{\\mathopen{\\char`⦃}}"),$(`\\rBrace`,"\\html@mathml{\\mathclose{]\\mkern-3.2mu\\}}}{\\mathclose{\\char`⦄}}"),$(`↤`,`\\mapsfrom`),$(`\\mapsfrom`,"\\html@mathml{\\mathrel{\\mathreflectbox{\\mapsto}}}{\\mathrel{\\char`↤}}"),$(`⦃`,`\\lBrace`),$(`⦄`,`\\rBrace`),$(`\\minuso`,"\\mathbin{\\html@mathml{{\\mathrlap{\\mathchoice{\\kern{0.145em}}{\\kern{0.145em}}{\\kern{0.1015em}}{\\kern{0.0725em}}\\circ}{-}}}{\\char`⦵}}"),$(`⦵`,`\\minuso`),$(`\\darr`,`\\downarrow`),$(`\\dArr`,`\\Downarrow`),$(`\\Darr`,`\\Downarrow`),$(`\\lang`,`\\langle`),$(`\\rang`,`\\rangle`),$(`\\uarr`,`\\uparrow`),$(`\\uArr`,`\\Uparrow`),$(`\\Uarr`,`\\Uparrow`),$(`\\N`,`\\mathbb{N}`),$(`\\R`,`\\mathbb{R}`),$(`\\Z`,`\\mathbb{Z}`),$(`\\alef`,`\\aleph`),$(`\\alefsym`,`\\aleph`),$(`\\Alpha`,`\\mathrm{A}`),$(`\\Beta`,`\\mathrm{B}`),$(`\\bull`,`\\bullet`),$(`\\Chi`,`\\mathrm{X}`),$(`\\clubs`,`\\clubsuit`),$(`\\cnums`,`\\mathbb{C}`),$(`\\Complex`,`\\mathbb{C}`),$(`\\Dagger`,`\\ddagger`),$(`\\diamonds`,`\\diamondsuit`),$(`\\empty`,`\\emptyset`),$(`\\Epsilon`,`\\mathrm{E}`),$(`\\Eta`,`\\mathrm{H}`),$(`\\exist`,`\\exists`),$(`\\harr`,`\\leftrightarrow`),$(`\\hArr`,`\\Leftrightarrow`),$(`\\Harr`,`\\Leftrightarrow`),$(`\\hearts`,`\\heartsuit`),$(`\\image`,`\\Im`),$(`\\infin`,`\\infty`),$(`\\Iota`,`\\mathrm{I}`),$(`\\isin`,`\\in`),$(`\\Kappa`,`\\mathrm{K}`),$(`\\larr`,`\\leftarrow`),$(`\\lArr`,`\\Leftarrow`),$(`\\Larr`,`\\Leftarrow`),$(`\\lrarr`,`\\leftrightarrow`),$(`\\lrArr`,`\\Leftrightarrow`),$(`\\Lrarr`,`\\Leftrightarrow`),$(`\\Mu`,`\\mathrm{M}`),$(`\\natnums`,`\\mathbb{N}`),$(`\\Nu`,`\\mathrm{N}`),$(`\\Omicron`,`\\mathrm{O}`),$(`\\plusmn`,`\\pm`),$(`\\rarr`,`\\rightarrow`),$(`\\rArr`,`\\Rightarrow`),$(`\\Rarr`,`\\Rightarrow`),$(`\\real`,`\\Re`),$(`\\reals`,`\\mathbb{R}`),$(`\\Reals`,`\\mathbb{R}`),$(`\\Rho`,`\\mathrm{P}`),$(`\\sdot`,`\\cdot`),$(`\\sect`,`\\S`),$(`\\spades`,`\\spadesuit`),$(`\\sub`,`\\subset`),$(`\\sube`,`\\subseteq`),$(`\\supe`,`\\supseteq`),$(`\\Tau`,`\\mathrm{T}`),$(`\\thetasym`,`\\vartheta`),$(`\\weierp`,`\\wp`),$(`\\Zeta`,`\\mathrm{Z}`),$(`\\argmin`,`\\DOTSB\\operatorname*{arg\\,min}`),$(`\\argmax`,`\\DOTSB\\operatorname*{arg\\,max}`),$(`\\plim`,`\\DOTSB\\mathop{\\operatorname{plim}}\\limits`),$(`\\bra`,`\\mathinner{\\langle{#1}|}`),$(`\\ket`,`\\mathinner{|{#1}\\rangle}`),$(`\\braket`,`\\mathinner{\\langle{#1}\\rangle}`),$(`\\Bra`,`\\left\\langle#1\\right|`),$(`\\Ket`,`\\left|#1\\right\\rangle`);var iN=e=>t=>{var n=t.consumeArg().tokens,r=t.consumeArg().tokens,i=t.consumeArg().tokens,a=t.consumeArg().tokens,o=t.macros.get(`|`),s=t.macros.get(`\\|`);t.macros.beginGroup();var c=t=>n=>{e&&(n.macros.set(`|`,o),i.length&&n.macros.set(`\\|`,s));var a=t;return!t&&i.length&&n.future().text===`|`&&(n.popToken(),a=!0),{tokens:a?i:r,numArgs:0}};t.macros.set(`|`,c(!1)),i.length&&t.macros.set(`\\|`,c(!0));var l=t.consumeArg().tokens,u=t.expandTokens([...a,...l,...n]);return t.macros.endGroup(),{tokens:u.reverse(),numArgs:0}};$(`\\bra@ket`,iN(!1)),$(`\\bra@set`,iN(!0)),$(`\\Braket`,`\\bra@ket{\\left\\langle}{\\,\\middle\\vert\\,}{\\,\\middle\\vert\\,}{\\right\\rangle}`),$(`\\Set`,`\\bra@set{\\left\\{\\:}{\\;\\middle\\vert\\;}{\\;\\middle\\Vert\\;}{\\:\\right\\}}`),$(`\\set`,`\\bra@set{\\{\\,}{\\mid}{}{\\,\\}}`),$(`\\angln`,`{\\angl n}`),$(`\\blue`,`\\textcolor{##6495ed}{#1}`),$(`\\orange`,`\\textcolor{##ffa500}{#1}`),$(`\\pink`,`\\textcolor{##ff00af}{#1}`),$(`\\red`,`\\textcolor{##df0030}{#1}`),$(`\\green`,`\\textcolor{##28ae7b}{#1}`),$(`\\gray`,`\\textcolor{gray}{#1}`),$(`\\purple`,`\\textcolor{##9d38bd}{#1}`),$(`\\blueA`,`\\textcolor{##ccfaff}{#1}`),$(`\\blueB`,`\\textcolor{##80f6ff}{#1}`),$(`\\blueC`,`\\textcolor{##63d9ea}{#1}`),$(`\\blueD`,`\\textcolor{##11accd}{#1}`),$(`\\blueE`,`\\textcolor{##0c7f99}{#1}`),$(`\\tealA`,`\\textcolor{##94fff5}{#1}`),$(`\\tealB`,`\\textcolor{##26edd5}{#1}`),$(`\\tealC`,`\\textcolor{##01d1c1}{#1}`),$(`\\tealD`,`\\textcolor{##01a995}{#1}`),$(`\\tealE`,`\\textcolor{##208170}{#1}`),$(`\\greenA`,`\\textcolor{##b6ffb0}{#1}`),$(`\\greenB`,`\\textcolor{##8af281}{#1}`),$(`\\greenC`,`\\textcolor{##74cf70}{#1}`),$(`\\greenD`,`\\textcolor{##1fab54}{#1}`),$(`\\greenE`,`\\textcolor{##0d923f}{#1}`),$(`\\goldA`,`\\textcolor{##ffd0a9}{#1}`),$(`\\goldB`,`\\textcolor{##ffbb71}{#1}`),$(`\\goldC`,`\\textcolor{##ff9c39}{#1}`),$(`\\goldD`,`\\textcolor{##e07d10}{#1}`),$(`\\goldE`,`\\textcolor{##a75a05}{#1}`),$(`\\redA`,`\\textcolor{##fca9a9}{#1}`),$(`\\redB`,`\\textcolor{##ff8482}{#1}`),$(`\\redC`,`\\textcolor{##f9685d}{#1}`),$(`\\redD`,`\\textcolor{##e84d39}{#1}`),$(`\\redE`,`\\textcolor{##bc2612}{#1}`),$(`\\maroonA`,`\\textcolor{##ffbde0}{#1}`),$(`\\maroonB`,`\\textcolor{##ff92c6}{#1}`),$(`\\maroonC`,`\\textcolor{##ed5fa6}{#1}`),$(`\\maroonD`,`\\textcolor{##ca337c}{#1}`),$(`\\maroonE`,`\\textcolor{##9e034e}{#1}`),$(`\\purpleA`,`\\textcolor{##ddd7ff}{#1}`),$(`\\purpleB`,`\\textcolor{##c6b9fc}{#1}`),$(`\\purpleC`,`\\textcolor{##aa87ff}{#1}`),$(`\\purpleD`,`\\textcolor{##7854ab}{#1}`),$(`\\purpleE`,`\\textcolor{##543b78}{#1}`),$(`\\mintA`,`\\textcolor{##f5f9e8}{#1}`),$(`\\mintB`,`\\textcolor{##edf2df}{#1}`),$(`\\mintC`,`\\textcolor{##e0e5cc}{#1}`),$(`\\grayA`,`\\textcolor{##f6f7f7}{#1}`),$(`\\grayB`,`\\textcolor{##f0f1f2}{#1}`),$(`\\grayC`,`\\textcolor{##e3e5e6}{#1}`),$(`\\grayD`,`\\textcolor{##d6d8da}{#1}`),$(`\\grayE`,`\\textcolor{##babec2}{#1}`),$(`\\grayF`,`\\textcolor{##888d93}{#1}`),$(`\\grayG`,`\\textcolor{##626569}{#1}`),$(`\\grayH`,`\\textcolor{##3b3e40}{#1}`),$(`\\grayI`,`\\textcolor{##21242c}{#1}`),$(`\\kaBlue`,`\\textcolor{##314453}{#1}`),$(`\\kaGreen`,`\\textcolor{##71B307}{#1}`);var aN={"^":!0,_:!0,"\\limits":!0,"\\nolimits":!0},oN=class{constructor(e,t,n){this.settings=void 0,this.expansionCount=void 0,this.lexer=void 0,this.macros=void 0,this.stack=void 0,this.mode=void 0,this.settings=t,this.expansionCount=0,this.feed(e),this.macros=new XM(ZM,t.macros),this.mode=n,this.stack=[]}feed(e){this.lexer=new YM(e,this.settings)}switchMode(e){this.mode=e}beginGroup(){this.macros.beginGroup()}endGroup(){this.macros.endGroup()}endGroups(){this.macros.endGroups()}future(){return this.stack.length===0&&this.pushToken(this.lexer.lex()),this.stack[this.stack.length-1]}popToken(){return this.future(),this.stack.pop()}pushToken(e){this.stack.push(e)}pushTokens(e){this.stack.push(...e)}scanArgument(e){var t,n,r;if(e){if(this.consumeSpaces(),this.future().text!==`[`)return null;t=this.popToken();var i=this.consumeArg([`]`]);r=i.tokens,n=i.end}else{var a=this.consumeArg();r=a.tokens,t=a.start,n=a.end}return this.pushToken(new Yj(`EOF`,n.loc)),this.pushTokens(r),new Yj(``,Jj.range(t,n))}consumeSpaces(){for(;this.future().text===` `;)this.stack.pop()}consumeArg(e){var t=[],n=e&&e.length>0;n||this.consumeSpaces();var r=this.future(),i,a=0,o=0;do{if(i=this.popToken(),t.push(i),i.text===`{`)++a;else if(i.text===`}`){if(--a,a===-1)throw new B(`Extra }`,i)}else if(i.text===`EOF`)throw new B(`Unexpected end of input in a macro argument, expected '`+(e&&n?e[o]:`}`)+`'`,i);if(e&&n){if((a===0||a===1&&e[o]===`{`)&&i.text===e[o]){if(++o,o===e.length){t.splice(-o,o);break}}else o=0}}while(a!==0||n);return r.text===`{`&&t[t.length-1].text===`}`&&(t.pop(),t.shift()),t.reverse(),{tokens:t,start:r,end:i}}consumeArgs(e,t){if(t){if(t.length!==e+1)throw new B(`The length of delimiters doesn't match the number of args!`);for(var n=t[0],r=0;r<n.length;r++){var i=this.popToken();if(n[r]!==i.text)throw new B(`Use of the macro doesn't match its definition`,i)}}for(var a=[],o=0;o<e;o++)a.push(this.consumeArg(t&&t[o+1]).tokens);return a}countExpansion(e){if(this.expansionCount+=e,this.expansionCount>this.settings.maxExpand)throw new B(`Too many expansions: infinite loop or need to increase maxExpand setting`)}expandOnce(e){var t=this.popToken(),n=t.text,r=t.noexpand?null:this._getExpansion(n);if(r==null||e&&r.unexpandable){if(e&&r==null&&n[0]===`\\`&&!this.isDefined(n))throw new B(`Undefined control sequence: `+n);return this.pushToken(t),!1}this.countExpansion(1);var i=r.tokens,a=this.consumeArgs(r.numArgs,r.delimiters);if(r.numArgs){i=i.slice();for(var o=i.length-1;o>=0;--o){var s=i[o];if(s.text===`#`){if(o===0)throw new B(`Incomplete placeholder at end of macro body`,s);if(s=i[--o],s.text===`#`)i.splice(o+1,1);else if(/^[1-9]$/.test(s.text))i.splice(o,2,...a[s.text-1]);else throw new B(`Not a valid argument number`,s)}}}return this.pushTokens(i),i.length}expandAfterFuture(){return this.expandOnce(),this.future()}expandNextToken(){for(;;)if(this.expandOnce()===!1){var e=this.stack.pop();return e.treatAsRelax&&(e.text=`\\relax`),e}}expandMacro(e){return this.macros.has(e)?this.expandTokens([new Yj(e)]):void 0}expandTokens(e){var t=[],n=this.stack.length;for(this.pushTokens(e);this.stack.length>n;)if(this.expandOnce(!0)===!1){var r=this.stack.pop();r.treatAsRelax&&=(r.noexpand=!1,!1),t.push(r)}return this.countExpansion(t.length),t}expandMacroAsText(e){var t=this.expandMacro(e);return t&&t.map(e=>e.text).join(``)}_getExpansion(e){var t=this.macros.get(e);if(t==null)return t;if(e.length===1){var n=this.lexer.catcodes[e];if(n!=null&&n!==13)return}var r=typeof t==`function`?t(this):t;if(typeof r==`string`){var i=0;if(r.includes(`#`))for(var a=r.replace(/##/g,``);a.includes(`#`+(i+1));)++i;for(var o=new YM(r,this.settings),s=[],c=o.lex();c.text!==`EOF`;)s.push(c),c=o.lex();return s.reverse(),{tokens:s,numArgs:i}}return r}isDefined(e){return this.macros.has(e)||Object.prototype.hasOwnProperty.call(BM,e)||Object.prototype.hasOwnProperty.call(jO.math,e)||Object.prototype.hasOwnProperty.call(jO.text,e)||Object.prototype.hasOwnProperty.call(aN,e)}isExpandable(e){var t=this.macros.get(e);return t==null?Object.prototype.hasOwnProperty.call(BM,e)&&!BM[e].primitive:typeof t==`string`||typeof t==`function`||!t.unexpandable}},sN=/^[₊₋₌₍₎₀₁₂₃₄₅₆₇₈₉ₐₑₕᵢⱼₖₗₘₙₒₚᵣₛₜᵤᵥₓᵦᵧᵨᵩᵪ]/,cN=Object.freeze({"₊":`+`,"₋":`-`,"₌":`=`,"₍":`(`,"₎":`)`,"₀":`0`,"₁":`1`,"₂":`2`,"₃":`3`,"₄":`4`,"₅":`5`,"₆":`6`,"₇":`7`,"₈":`8`,"₉":`9`,ₐ:`a`,ₑ:`e`,ₕ:`h`,ᵢ:`i`,ⱼ:`j`,ₖ:`k`,ₗ:`l`,ₘ:`m`,ₙ:`n`,ₒ:`o`,ₚ:`p`,ᵣ:`r`,ₛ:`s`,ₜ:`t`,ᵤ:`u`,ᵥ:`v`,ₓ:`x`,ᵦ:`β`,ᵧ:`γ`,ᵨ:`ρ`,ᵩ:`ϕ`,ᵪ:`χ`,"⁺":`+`,"⁻":`-`,"⁼":`=`,"⁽":`(`,"⁾":`)`,"⁰":`0`,"¹":`1`,"²":`2`,"³":`3`,"⁴":`4`,"⁵":`5`,"⁶":`6`,"⁷":`7`,"⁸":`8`,"⁹":`9`,ᴬ:`A`,ᴮ:`B`,ᴰ:`D`,ᴱ:`E`,ᴳ:`G`,ᴴ:`H`,ᴵ:`I`,ᴶ:`J`,ᴷ:`K`,ᴸ:`L`,ᴹ:`M`,ᴺ:`N`,ᴼ:`O`,ᴾ:`P`,ᴿ:`R`,ᵀ:`T`,ᵁ:`U`,ⱽ:`V`,ᵂ:`W`,ᵃ:`a`,ᵇ:`b`,ᶜ:`c`,ᵈ:`d`,ᵉ:`e`,ᶠ:`f`,ᵍ:`g`,ʰ:`h`,ⁱ:`i`,ʲ:`j`,ᵏ:`k`,ˡ:`l`,ᵐ:`m`,ⁿ:`n`,ᵒ:`o`,ᵖ:`p`,ʳ:`r`,ˢ:`s`,ᵗ:`t`,ᵘ:`u`,ᵛ:`v`,ʷ:`w`,ˣ:`x`,ʸ:`y`,ᶻ:`z`,ᵝ:`β`,ᵞ:`γ`,ᵟ:`δ`,ᵠ:`ϕ`,ᵡ:`χ`,ᶿ:`θ`}),lN={"́":{text:`\\'`,math:`\\acute`},"̀":{text:"\\`",math:`\\grave`},"̈":{text:`\\"`,math:`\\ddot`},"̃":{text:`\\~`,math:`\\tilde`},"̄":{text:`\\=`,math:`\\bar`},"̆":{text:`\\u`,math:`\\breve`},"̌":{text:`\\v`,math:`\\check`},"̂":{text:`\\^`,math:`\\hat`},"̇":{text:`\\.`,math:`\\dot`},"̊":{text:`\\r`,math:`\\mathring`},"̋":{text:`\\H`},"̧":{text:`\\c`}},uN={á:`á`,à:`à`,ä:`ä`,ǟ:`ǟ`,ã:`ã`,ā:`ā`,ă:`ă`,ắ:`ắ`,ằ:`ằ`,ẵ:`ẵ`,ǎ:`ǎ`,â:`â`,ấ:`ấ`,ầ:`ầ`,ẫ:`ẫ`,ȧ:`ȧ`,ǡ:`ǡ`,å:`å`,ǻ:`ǻ`,ḃ:`ḃ`,ć:`ć`,ḉ:`ḉ`,č:`č`,ĉ:`ĉ`,ċ:`ċ`,ç:`ç`,ď:`ď`,ḋ:`ḋ`,ḑ:`ḑ`,é:`é`,è:`è`,ë:`ë`,ẽ:`ẽ`,ē:`ē`,ḗ:`ḗ`,ḕ:`ḕ`,ĕ:`ĕ`,ḝ:`ḝ`,ě:`ě`,ê:`ê`,ế:`ế`,ề:`ề`,ễ:`ễ`,ė:`ė`,ȩ:`ȩ`,ḟ:`ḟ`,ǵ:`ǵ`,ḡ:`ḡ`,ğ:`ğ`,ǧ:`ǧ`,ĝ:`ĝ`,ġ:`ġ`,ģ:`ģ`,ḧ:`ḧ`,ȟ:`ȟ`,ĥ:`ĥ`,ḣ:`ḣ`,ḩ:`ḩ`,í:`í`,ì:`ì`,ï:`ï`,ḯ:`ḯ`,ĩ:`ĩ`,ī:`ī`,ĭ:`ĭ`,ǐ:`ǐ`,î:`î`,ǰ:`ǰ`,ĵ:`ĵ`,ḱ:`ḱ`,ǩ:`ǩ`,ķ:`ķ`,ĺ:`ĺ`,ľ:`ľ`,ļ:`ļ`,ḿ:`ḿ`,ṁ:`ṁ`,ń:`ń`,ǹ:`ǹ`,ñ:`ñ`,ň:`ň`,ṅ:`ṅ`,ņ:`ņ`,ó:`ó`,ò:`ò`,ö:`ö`,ȫ:`ȫ`,õ:`õ`,ṍ:`ṍ`,ṏ:`ṏ`,ȭ:`ȭ`,ō:`ō`,ṓ:`ṓ`,ṑ:`ṑ`,ŏ:`ŏ`,ǒ:`ǒ`,ô:`ô`,ố:`ố`,ồ:`ồ`,ỗ:`ỗ`,ȯ:`ȯ`,ȱ:`ȱ`,ő:`ő`,ṕ:`ṕ`,ṗ:`ṗ`,ŕ:`ŕ`,ř:`ř`,ṙ:`ṙ`,ŗ:`ŗ`,ś:`ś`,ṥ:`ṥ`,š:`š`,ṧ:`ṧ`,ŝ:`ŝ`,ṡ:`ṡ`,ş:`ş`,ẗ:`ẗ`,ť:`ť`,ṫ:`ṫ`,ţ:`ţ`,ú:`ú`,ù:`ù`,ü:`ü`,ǘ:`ǘ`,ǜ:`ǜ`,ǖ:`ǖ`,ǚ:`ǚ`,ũ:`ũ`,ṹ:`ṹ`,ū:`ū`,ṻ:`ṻ`,ŭ:`ŭ`,ǔ:`ǔ`,û:`û`,ů:`ů`,ű:`ű`,ṽ:`ṽ`,ẃ:`ẃ`,ẁ:`ẁ`,ẅ:`ẅ`,ŵ:`ŵ`,ẇ:`ẇ`,ẘ:`ẘ`,ẍ:`ẍ`,ẋ:`ẋ`,ý:`ý`,ỳ:`ỳ`,ÿ:`ÿ`,ỹ:`ỹ`,ȳ:`ȳ`,ŷ:`ŷ`,ẏ:`ẏ`,ẙ:`ẙ`,ź:`ź`,ž:`ž`,ẑ:`ẑ`,ż:`ż`,Á:`Á`,À:`À`,Ä:`Ä`,Ǟ:`Ǟ`,Ã:`Ã`,Ā:`Ā`,Ă:`Ă`,Ắ:`Ắ`,Ằ:`Ằ`,Ẵ:`Ẵ`,Ǎ:`Ǎ`,Â:`Â`,Ấ:`Ấ`,Ầ:`Ầ`,Ẫ:`Ẫ`,Ȧ:`Ȧ`,Ǡ:`Ǡ`,Å:`Å`,Ǻ:`Ǻ`,Ḃ:`Ḃ`,Ć:`Ć`,Ḉ:`Ḉ`,Č:`Č`,Ĉ:`Ĉ`,Ċ:`Ċ`,Ç:`Ç`,Ď:`Ď`,Ḋ:`Ḋ`,Ḑ:`Ḑ`,É:`É`,È:`È`,Ë:`Ë`,Ẽ:`Ẽ`,Ē:`Ē`,Ḗ:`Ḗ`,Ḕ:`Ḕ`,Ĕ:`Ĕ`,Ḝ:`Ḝ`,Ě:`Ě`,Ê:`Ê`,Ế:`Ế`,Ề:`Ề`,Ễ:`Ễ`,Ė:`Ė`,Ȩ:`Ȩ`,Ḟ:`Ḟ`,Ǵ:`Ǵ`,Ḡ:`Ḡ`,Ğ:`Ğ`,Ǧ:`Ǧ`,Ĝ:`Ĝ`,Ġ:`Ġ`,Ģ:`Ģ`,Ḧ:`Ḧ`,Ȟ:`Ȟ`,Ĥ:`Ĥ`,Ḣ:`Ḣ`,Ḩ:`Ḩ`,Í:`Í`,Ì:`Ì`,Ï:`Ï`,Ḯ:`Ḯ`,Ĩ:`Ĩ`,Ī:`Ī`,Ĭ:`Ĭ`,Ǐ:`Ǐ`,Î:`Î`,İ:`İ`,Ĵ:`Ĵ`,Ḱ:`Ḱ`,Ǩ:`Ǩ`,Ķ:`Ķ`,Ĺ:`Ĺ`,Ľ:`Ľ`,Ļ:`Ļ`,Ḿ:`Ḿ`,Ṁ:`Ṁ`,Ń:`Ń`,Ǹ:`Ǹ`,Ñ:`Ñ`,Ň:`Ň`,Ṅ:`Ṅ`,Ņ:`Ņ`,Ó:`Ó`,Ò:`Ò`,Ö:`Ö`,Ȫ:`Ȫ`,Õ:`Õ`,Ṍ:`Ṍ`,Ṏ:`Ṏ`,Ȭ:`Ȭ`,Ō:`Ō`,Ṓ:`Ṓ`,Ṑ:`Ṑ`,Ŏ:`Ŏ`,Ǒ:`Ǒ`,Ô:`Ô`,Ố:`Ố`,Ồ:`Ồ`,Ỗ:`Ỗ`,Ȯ:`Ȯ`,Ȱ:`Ȱ`,Ő:`Ő`,Ṕ:`Ṕ`,Ṗ:`Ṗ`,Ŕ:`Ŕ`,Ř:`Ř`,Ṙ:`Ṙ`,Ŗ:`Ŗ`,Ś:`Ś`,Ṥ:`Ṥ`,Š:`Š`,Ṧ:`Ṧ`,Ŝ:`Ŝ`,Ṡ:`Ṡ`,Ş:`Ş`,Ť:`Ť`,Ṫ:`Ṫ`,Ţ:`Ţ`,Ú:`Ú`,Ù:`Ù`,Ü:`Ü`,Ǘ:`Ǘ`,Ǜ:`Ǜ`,Ǖ:`Ǖ`,Ǚ:`Ǚ`,Ũ:`Ũ`,Ṹ:`Ṹ`,Ū:`Ū`,Ṻ:`Ṻ`,Ŭ:`Ŭ`,Ǔ:`Ǔ`,Û:`Û`,Ů:`Ů`,Ű:`Ű`,Ṽ:`Ṽ`,Ẃ:`Ẃ`,Ẁ:`Ẁ`,Ẅ:`Ẅ`,Ŵ:`Ŵ`,Ẇ:`Ẇ`,Ẍ:`Ẍ`,Ẋ:`Ẋ`,Ý:`Ý`,Ỳ:`Ỳ`,Ÿ:`Ÿ`,Ỹ:`Ỹ`,Ȳ:`Ȳ`,Ŷ:`Ŷ`,Ẏ:`Ẏ`,Ź:`Ź`,Ž:`Ž`,Ẑ:`Ẑ`,Ż:`Ż`,ά:`ά`,ὰ:`ὰ`,ᾱ:`ᾱ`,ᾰ:`ᾰ`,έ:`έ`,ὲ:`ὲ`,ή:`ή`,ὴ:`ὴ`,ί:`ί`,ὶ:`ὶ`,ϊ:`ϊ`,ΐ:`ΐ`,ῒ:`ῒ`,ῑ:`ῑ`,ῐ:`ῐ`,ό:`ό`,ὸ:`ὸ`,ύ:`ύ`,ὺ:`ὺ`,ϋ:`ϋ`,ΰ:`ΰ`,ῢ:`ῢ`,ῡ:`ῡ`,ῠ:`ῠ`,ώ:`ώ`,ὼ:`ὼ`,Ύ:`Ύ`,Ὺ:`Ὺ`,Ϋ:`Ϋ`,Ῡ:`Ῡ`,Ῠ:`Ῠ`,Ώ:`Ώ`,Ὼ:`Ὼ`},dN=class e{constructor(e,t){this.mode=void 0,this.gullet=void 0,this.settings=void 0,this.leftrightDepth=void 0,this.nextToken=void 0,this.mode=`math`,this.gullet=new oN(e,t,this.mode),this.settings=t,this.leftrightDepth=0,this.nextToken=null}expect(e,t){if(t===void 0&&(t=!0),this.fetch().text!==e)throw new B(`Expected '`+e+`', got '`+this.fetch().text+`'`,this.fetch());t&&this.consume()}consume(){this.nextToken=null}fetch(){return this.nextToken??=this.gullet.expandNextToken(),this.nextToken}switchMode(e){this.mode=e,this.gullet.switchMode(e)}parse(){this.settings.globalGroup||this.gullet.beginGroup(),this.settings.colorIsTextColor&&this.gullet.macros.set(`\\color`,`\\textcolor`);try{var e=this.parseExpression(!1);return this.expect(`EOF`),this.settings.globalGroup||this.gullet.endGroup(),e}finally{this.gullet.endGroups()}}subparse(e){var t=this.nextToken;this.consume(),this.gullet.pushToken(new Yj(`}`)),this.gullet.pushTokens(e);var n=this.parseExpression(!1);return this.expect(`}`),this.nextToken=t,n}parseExpression(t,n){for(var r=[];;){this.mode===`math`&&this.consumeSpaces();var i=this.fetch();if(e.endOfExpression.has(i.text)||n&&i.text===n||t&&BM[i.text]&&BM[i.text].infix)break;var a=this.parseAtom(n);if(!a)break;a.type!==`internal`&&r.push(a)}return this.mode===`text`&&this.formLigatures(r),this.handleInfixNodes(r)}handleInfixNodes(e){for(var t=-1,n,r=0;r<e.length;r++){var i=e[r];if(i.type===`infix`){if(t!==-1)throw new B(`only one infix operator per group`,i.token);t=r,n=i.replaceWith}}if(t!==-1&&n){var a,o,s=e.slice(0,t),c=e.slice(t+1);return a=s.length===1&&s[0].type===`ordgroup`?s[0]:{type:`ordgroup`,mode:this.mode,body:s},o=c.length===1&&c[0].type===`ordgroup`?c[0]:{type:`ordgroup`,mode:this.mode,body:c},[n===`\\\\abovefrac`?this.callFunction(n,[a,e[t],o],[]):this.callFunction(n,[a,o],[])]}return e}handleSupSubscript(e){var t=this.fetch(),n=t.text;this.consume(),this.consumeSpaces();var r;do r=this.parseGroup(e);while(r?.type===`internal`);if(!r)throw new B(`Expected group after '`+n+`'`,t);return r}formatUnsupportedCmd(e){for(var t=[],n=0;n<e.length;n++)t.push({type:`textord`,mode:`text`,text:e[n]});var r={type:`text`,mode:this.mode,body:t};return{type:`color`,mode:this.mode,color:this.settings.errorColor,body:[r]}}parseAtom(e){var t=this.parseGroup(`atom`,e);if(t?.type===`internal`||this.mode===`text`)return t;for(var n,r;;){this.consumeSpaces();var i=this.fetch();if(i.text===`\\limits`||i.text===`\\nolimits`){if(t&&t.type===`op`)t.limits=i.text===`\\limits`,t.alwaysHandleSupSub=!0;else if(t&&t.type===`operatorname`)t.alwaysHandleSupSub&&(t.limits=i.text===`\\limits`);else throw new B(`Limit controls must follow a math operator`,i);this.consume()}else if(i.text===`^`){if(n)throw new B(`Double superscript`,i);n=this.handleSupSubscript(`superscript`)}else if(i.text===`_`){if(r)throw new B(`Double subscript`,i);r=this.handleSupSubscript(`subscript`)}else if(i.text===`'`){if(n)throw new B(`Double superscript`,i);var a={type:`textord`,mode:this.mode,text:`\\prime`},o=[a];for(this.consume();this.fetch().text===`'`;)o.push(a),this.consume();this.fetch().text===`^`&&o.push(this.handleSupSubscript(`superscript`)),n={type:`ordgroup`,mode:this.mode,body:o}}else if(cN[i.text]){var s=sN.test(i.text),c=[];for(c.push(new Yj(cN[i.text])),this.consume();;){var l=this.fetch().text;if(!cN[l]||sN.test(l)!==s)break;c.unshift(new Yj(cN[l])),this.consume()}var u=this.subparse(c);s?r={type:`ordgroup`,mode:`math`,body:u}:n={type:`ordgroup`,mode:`math`,body:u}}else break}return n&&r?{type:`supsub`,mode:this.mode,base:t,sup:n,sub:r}:n?{type:`supsub`,mode:this.mode,base:t,sup:n}:r?{type:`supsub`,mode:this.mode,base:t,sub:r}:t}parseFunction(e,t){var n=this.fetch(),r=n.text,i=BM[r];if(!i)return null;if(this.consume(),t&&t!==`atom`&&!i.allowedInArgument)throw new B(`Got function '`+r+`' with no arguments`+(t?` as `+t:``),n);if(this.mode===`text`&&!i.allowedInText)throw new B(`Can't use function '`+r+`' in text mode`,n);if(this.mode===`math`&&i.allowedInMath===!1)throw new B(`Can't use function '`+r+`' in math mode`,n);var a=this.parseArguments(r,i),o=a.args,s=a.optArgs;return this.callFunction(r,o,s,n,e)}callFunction(e,t,n,r,i){var a={funcName:e,parser:this,token:r,breakOnTokenText:i},o=BM[e];if(o&&o.handler)return o.handler(a,t,n);throw new B(`No function handler for `+e)}parseArguments(e,t){var n=t.numOptionalArgs??0,r=t.numArgs+n;if(r===0)return{args:[],optArgs:[]};for(var i=[],a=[],o=0;o<r;o++){var s=t.argTypes?.[o],c=o<n;(`primitive`in t&&t.primitive&&s==null||t.type===`sqrt`&&o===1&&a[0]==null)&&(s=`primitive`);var l=this.parseGroupOfType(`argument to '`+e+`'`,s,c);if(c)a.push(l);else if(l!=null)i.push(l);else throw new B(`Null argument, please report this as a bug`)}return{args:i,optArgs:a}}parseGroupOfType(e,t,n){switch(t){case`color`:return this.parseColorGroup(n);case`size`:return this.parseSizeGroup(n);case`url`:return this.parseUrlGroup(n);case`math`:case`text`:return this.parseArgumentGroup(n,t);case`hbox`:var r=this.parseArgumentGroup(n,`text`);return r==null?null:{type:`styling`,mode:r.mode,body:[r],style:`text`,resetFont:!0};case`raw`:var i=this.parseStringGroup(n);return i==null?null:{type:`raw`,mode:`text`,string:i.text};case`primitive`:if(n)throw new B(`A primitive argument cannot be optional`);var a=this.parseGroup(e);if(a==null)throw new B(`Expected group as `+e,this.fetch());return a;case`original`:case void 0:return this.parseArgumentGroup(n);default:throw new B(`Unknown group type as `+e,this.fetch())}}consumeSpaces(){for(;this.fetch().text===` `;)this.consume()}parseStringGroup(e){var t=this.gullet.scanArgument(e);if(t==null)return null;for(var n=``,r;(r=this.fetch()).text!==`EOF`;)n+=r.text,this.consume();return this.consume(),t.text=n,t}parseRegexGroup(e,t){for(var n=this.fetch(),r=n,i=``,a;(a=this.fetch()).text!==`EOF`&&e.test(i+a.text);)r=a,i+=r.text,this.consume();if(i===``)throw new B(`Invalid `+t+`: '`+n.text+`'`,n);return n.range(r,i)}parseColorGroup(e){var t=this.parseStringGroup(e);if(t==null)return null;var n=/^(#[a-f0-9]{3,4}|#[a-f0-9]{6}|#[a-f0-9]{8}|[a-f0-9]{6}|[a-z]+)$/i.exec(t.text);if(!n)throw new B(`Invalid color: '`+t.text+`'`,t);var r=n[0];return/^[0-9a-f]{6}$/i.test(r)&&(r=`#`+r),{type:`color-token`,mode:this.mode,color:r}}parseSizeGroup(e){var t,n=!1;if(this.gullet.consumeSpaces(),t=!e&&this.gullet.future().text!==`{`?this.parseRegexGroup(/^[-+]? *(?:$|\d+|\d+\.\d*|\.\d*) *[a-z]{0,2} *$/,`size`):this.parseStringGroup(e),!t)return null;!e&&t.text.length===0&&(t.text=`0pt`,n=!0);var r=/([-+]?) *(\d+(?:\.\d*)?|\.\d+) *([a-z]{2})/.exec(t.text);if(!r)throw new B(`Invalid size: '`+t.text+`'`,t);var i={number:+(r[1]+r[2]),unit:r[3]};if(!aO(i))throw new B(`Invalid unit: '`+i.unit+`'`,t);return{type:`size`,mode:this.mode,value:i,isBlank:n}}parseUrlGroup(e){this.gullet.lexer.setCatcode(`%`,13),this.gullet.lexer.setCatcode(`~`,12);var t=this.parseStringGroup(e);if(this.gullet.lexer.setCatcode(`%`,14),this.gullet.lexer.setCatcode(`~`,13),t==null)return null;var n=t.text.replace(/\\([#$%&~_^{}])/g,`$1`);return{type:`url`,mode:this.mode,url:n}}parseArgumentGroup(e,t){var n=this.gullet.scanArgument(e);if(n==null)return null;var r=this.mode;t&&this.switchMode(t),this.gullet.beginGroup();var i=this.parseExpression(!1,`EOF`);this.expect(`EOF`),this.gullet.endGroup();var a={type:`ordgroup`,mode:this.mode,loc:n.loc,body:i};return t&&this.switchMode(r),a}parseGroup(e,t){var n=this.fetch(),r=n.text,i;if(r===`{`||r===`\\begingroup`){this.consume();var a=r===`{`?`}`:`\\endgroup`;this.gullet.beginGroup();var o=this.parseExpression(!1,a),s=this.fetch();this.expect(a),this.gullet.endGroup(),i={type:`ordgroup`,mode:this.mode,loc:Jj.range(n,s),body:o,semisimple:r===`\\begingroup`||void 0}}else if(i=this.parseFunction(t,e)||this.parseSymbol(),i==null&&r[0]===`\\`&&!Object.prototype.hasOwnProperty.call(aN,r)){if(this.settings.throwOnError)throw new B(`Undefined control sequence: `+r,n);i=this.formatUnsupportedCmd(r),this.consume()}return i}formLigatures(e){for(var t=e.length-1,n=0;n<t;++n){var r=e[n];if(r.type===`textord`){var i=r.text,a=e[n+1];if(a&&a.type===`textord`){if(i===`-`&&a.text===`-`){var o=e[n+2];n+1<t&&o&&o.type===`textord`&&o.text===`-`?(e.splice(n,3,{type:`textord`,mode:`text`,loc:Jj.range(r,o),text:`---`}),t-=2):(e.splice(n,2,{type:`textord`,mode:`text`,loc:Jj.range(r,a),text:`--`}),--t)}(i===`'`||i==="`")&&a.text===i&&(e.splice(n,2,{type:`textord`,mode:`text`,loc:Jj.range(r,a),text:i+i}),--t)}}}}parseSymbol(){var e=this.fetch(),t=e.text;if(/^\\verb[^a-zA-Z]/.test(t)){this.consume();var n=t.slice(5),r=n.charAt(0)===`*`;if(r&&(n=n.slice(1)),n.length<2||n.charAt(0)!==n.slice(-1))throw new B(`\\verb assertion failed --
400
+ please report what input caused this bug`);return n=n.slice(1,-1),{type:`verb`,mode:`text`,body:n,star:r}}Object.prototype.hasOwnProperty.call(uN,t[0])&&!jO[this.mode][t[0]]&&(this.settings.strict&&this.mode===`math`&&yk({strict:this.settings.strict,errorCode:`unicodeTextInMathMode`,errorMsg:`Accented Unicode text character "`+t[0]+`" used in math mode`,report:!0,token:e}),t=uN[t[0]]+t.slice(1));var i=qM.exec(t);i&&(t=t.substring(0,i.index),t===`i`?t=`ı`:t===`j`&&(t=`ȷ`));var a;if(jO[this.mode][t]){this.settings.strict&&this.mode===`math`&&tk.includes(t)&&yk({strict:this.settings.strict,errorCode:`unicodeTextInMathMode`,errorMsg:`Latin-1/Unicode text character "`+t[0]+`" used in math mode`,report:!0,token:e});var o=jO[this.mode][t].group,s=Jj.range(e);a=HA(o)?{type:`atom`,mode:this.mode,family:o,loc:s,text:t}:{type:o,mode:this.mode,loc:s,text:t}}else if(t.charCodeAt(0)>=128)this.settings.strict&&(VD(t.charCodeAt(0))?this.mode===`math`&&yk({strict:this.settings.strict,errorCode:`unicodeTextInMathMode`,errorMsg:`Unicode text character "`+t[0]+`" used in math mode`,report:!0,token:e}):yk({strict:this.settings.strict,errorCode:`unknownSymbol`,errorMsg:`Unrecognized Unicode character "`+t[0]+`"`+(` (`+t.charCodeAt(0)+`)`),report:!0,token:e})),a={type:`textord`,mode:`text`,loc:Jj.range(e),text:t};else return null;if(this.consume(),i)for(var c=0;c<i[0].length;c++){var l=i[0][c];if(!lN[l])throw new B(`Unknown accent ' `+l+`'`,e);var u=lN[l][this.mode]||lN[l].text;if(!u)throw new B(`Accent `+l+` unsupported in `+this.mode+` mode`,e);a={type:`accent`,mode:this.mode,loc:Jj.range(e),label:u,isStretchy:!1,isShifty:!0,base:a}}return a}};dN.endOfExpression=new Set([`}`,`\\endgroup`,`\\end`,`\\right`,`&`]);var fN=function(e,t){if(!(typeof e==`string`||e instanceof String))throw TypeError(`KaTeX can only parse string typed expression`);var n=new dN(e,t);delete n.gullet.macros.current[`\\df@tag`];var r=n.parse();if(delete n.gullet.macros.current[`\\current@color`],delete n.gullet.macros.current[`\\color`],n.gullet.macros.get(`\\df@tag`)){if(!t.displayMode)throw new B(`\\tag works only in display equations`);r=[{type:`tag`,mode:`text`,body:r,tag:n.subparse([new Yj(`\\df@tag`)])}]}return r},pN=function(e,t,n){t.textContent=``;var r=_N(e,n).toNode();t.appendChild(r)};typeof document<`u`&&document.compatMode!==`CSS1Compat`&&(typeof console<`u`&&console.warn(`Warning: KaTeX doesn't work in quirks mode. Make sure your website has a suitable doctype.`),pN=function(){throw new B(`KaTeX doesn't work in quirks mode.`)});var mN=function(e,t){return _N(e,t).toMarkup()},hN=function(e,t){return fN(e,new bD(t))},gN=function(e,t,n){if(n.throwOnError||!(e instanceof B))throw e;var r=X([`katex-error`],[new _O(t)]);return r.setAttribute(`title`,e.toString()),r.setAttribute(`style`,`color:`+n.errorColor),r},_N=function(e,t){var n=new bD(t);try{return AA(fN(e,n),e,n)}catch(t){return gN(t,e,n)}},vN={version:`0.19.0`,render:pN,renderToString:mN,ParseError:B,SETTINGS_SCHEMA:gD,__parse:hN,__renderToDomTree:_N,__renderToHTMLTree:function(e,t){var n=new bD(t);try{return jA(fN(e,n),n)}catch(t){return gN(t,e,n)}},__setFontMetrics:DO,__defineSymbol:H,__defineFunction:Z,__defineMacro:$,__domTree:{Span:pO,Anchor:mO,SymbolNode:_O,SvgNode:vO,PathNode:yO,LineNode:bO}},yN=/^ {0,3}(?:\$\$([\s\S]+?)\$\$|\\\[([\s\S]+?)\\\])[ \t]*(?:\n|$)/,bN=/^\$(?![\s$])((?:\\[^`\n]|[^\\$`\n])+?)(?<!\s)\$(?![\d$])/,xN=/(`+)[\s\S]*?\1(?!`)|(?<math>\$\$[^`]+?\$\$|\\\[[^`]+?\\\]|\\\([^`]+?\\\)|\$(?![\s$])(?:\\[^`\n]|[^\\$`\n])+?(?<!\s)\$(?![\d$]))|\\[^\n]/g,SN=new JE;function CN(e,t){let n=t.length-e.length,r=``,i=0;for(let a of e.matchAll(xN)){if(!a.groups?.math)continue;let e=n+a.index;r+=t.slice(i,e)+`a`.repeat(a[0].length),i=e+a[0].length}return r+t.slice(i)}function wN(e){return vN.renderToString(e.text,{displayMode:e.displayMode,throwOnError:!1,trust:!1,maxSize:20,maxExpand:1e3})}var TN=new eD({gfm:!0,breaks:!0},{tokenizer:{emStrong(e,t,n){if(/^[*_]/.test(e))return SN.emStrong.call(this,e,CN(e,t),n)},del(e,t,n){if(e.startsWith(`~`))return SN.del.call(this,e,CN(e,t),n)}},extensions:[{name:`blockMath`,level:`block`,start:e=>e.search(/^ {0,3}(?:\$\$|\\\[)/m),tokenizer(e){let t=yN.exec(e);if(t)return{type:`blockMath`,raw:t[0],text:(t[1]??t[2]).trim(),displayMode:!0}},renderer:wN},{name:`inlineMath`,level:`inline`,start:e=>e.search(/\$|\\[([]/),tokenizer(e){if(this.lexer.state.inRawBlock)return;let t=/^(?:\$\$([^`]+?)\$\$|\\\[([^`]+?)\\\])/.exec(e),n=t??/^\\\(([^`]+?)\\\)/.exec(e)??bN.exec(e);if(n)return{type:`inlineMath`,raw:n[0],text:(n[1]??n[2]).trim(),displayMode:!!t}},renderer:wN}]});uT.addHook(`uponSanitizeAttribute`,(e,t)=>{if(e.nodeName!==`IMG`||t.attrName!==`src`)return;let n=iD(t.attrValue);t.attrValue=aD(n)?`${n[0]}%3A${n.slice(2)}`:n});function EN(e,t=!1){let n=uT.sanitize(e,{ADD_FORBID_CONTENTS:[`annotation`],ADD_ATTR:[`target`,`rel`],FORBID_ATTR:t?[`target`,`rel`]:[]});return t?n.replace(/<a(?=[\s>])/gi,`<a target="_blank" rel="noopener noreferrer"`):n}var DN=/^\s*artifact:([A-Za-z0-9_-]+)\s*$/;function ON(e,t,n=!1){let r=[],i=[],a=()=>{if(i.length===0)return;let e=EN(TN.parser(i),n);e&&r.push({type:`html`,html:e}),i=[]};for(let n of TN.lexer(e)){let e=(n.type===`paragraph`?DN.exec(n.raw):null)?.[1];if(!e||!t.has(e)){i.push(n);continue}a(),r.push({type:`artifact`,artifactId:e})}return a(),r}var kN={markdown:C_,html:N_,react:y_};function AN({artifact:e,onOpen:t}){let n=kN[e.artifactType];return(0,R.jsxs)(`div`,{"data-artifact-reference":e.key,className:`bg-card my-3 flex min-w-0 items-center gap-3 rounded-lg border p-3 shadow-xs`,children:[(0,R.jsx)(`div`,{className:`bg-muted flex size-10 shrink-0 items-center justify-center rounded-md border`,children:(0,R.jsx)(n,{className:`text-muted-foreground size-4`,"aria-hidden":`true`})}),(0,R.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,R.jsx)(`div`,{className:`text-foreground truncate text-sm font-medium`,children:e.title}),(0,R.jsx)(`div`,{className:`text-muted-foreground mt-0.5 text-xs`,children:`Artifact`})]}),(0,R.jsx)(`button`,{type:`button`,className:`bg-background text-foreground hover:bg-muted shrink-0 rounded-md border px-3 py-1.5 text-sm font-medium transition`,onClick:t,"aria-label":`View ${e.title}`,children:`View`})]})}var jN=m(),MN=[{name:`TypeScript`,svg:`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 128 128"><path fill="#fff" d="M22.67 47h99.67v73.67H22.67z"/><path data-name="original" fill="#007acc" d="M1.5 63.91v62.5h125v-125H1.5zm100.73-5a15.56 15.56 0 017.82 4.5 20.58 20.58 0 013 4c0 .16-5.4 3.81-8.69 5.85-.12.08-.6-.44-1.13-1.23a7.09 7.09 0 00-5.87-3.53c-3.79-.26-6.23 1.73-6.21 5a4.58 4.58 0 00.54 2.34c.83 1.73 2.38 2.76 7.24 4.86 8.95 3.85 12.78 6.39 15.16 10 2.66 4 3.25 10.46 1.45 15.24-2 5.2-6.9 8.73-13.83 9.9a38.32 38.32 0 01-9.52-.1 23 23 0 01-12.72-6.63c-1.15-1.27-3.39-4.58-3.25-4.82a9.34 9.34 0 011.15-.73L82 101l3.59-2.08.75 1.11a16.78 16.78 0 004.74 4.54c4 2.1 9.46 1.81 12.16-.62a5.43 5.43 0 00.69-6.92c-1-1.39-3-2.56-8.59-5-6.45-2.78-9.23-4.5-11.77-7.24a16.48 16.48 0 01-3.43-6.25 25 25 0 01-.22-8c1.33-6.23 6-10.58 12.82-11.87a31.66 31.66 0 019.49.26zm-29.34 5.24v5.12H56.66v46.23H45.15V69.26H28.88v-5a49.19 49.19 0 01.12-5.17C29.08 59 39 59 51 59h21.83z"/></svg>`,languages:[`ts`,`tsx`,`typescript`]},{name:`JavaScript`,svg:`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 128 128"><path fill="#F0DB4F" d="M1.408 1.408h125.184v125.185H1.408z"/><path fill="#323330" d="M116.347 96.736c-.917-5.711-4.641-10.508-15.672-14.981-3.832-1.761-8.104-3.022-9.377-5.926-.452-1.69-.512-2.642-.226-3.665.821-3.32 4.784-4.355 7.925-3.403 2.023.678 3.938 2.237 5.093 4.724 5.402-3.498 5.391-3.475 9.163-5.879-1.381-2.141-2.118-3.129-3.022-4.045-3.249-3.629-7.676-5.498-14.756-5.355l-3.688.477c-3.534.893-6.902 2.748-8.877 5.235-5.926 6.724-4.236 18.492 2.975 23.335 7.104 5.332 17.54 6.545 18.873 11.531 1.297 6.104-4.486 8.08-10.234 7.378-4.236-.881-6.592-3.034-9.139-6.949-4.688 2.713-4.688 2.713-9.508 5.485 1.143 2.499 2.344 3.63 4.26 5.795 9.068 9.198 31.76 8.746 35.83-5.176.165-.478 1.261-3.666.38-8.581zM69.462 58.943H57.753l-.048 30.272c0 6.438.333 12.34-.714 14.149-1.713 3.558-6.152 3.117-8.175 2.427-2.059-1.012-3.106-2.451-4.319-4.485-.333-.584-.583-1.036-.667-1.071l-9.52 5.83c1.583 3.249 3.915 6.069 6.902 7.901 4.462 2.678 10.459 3.499 16.731 2.059 4.082-1.189 7.604-3.652 9.448-7.401 2.666-4.915 2.094-10.864 2.07-17.444.06-10.735.001-21.468.001-32.237z"/></svg>`,languages:[`js`,`jsx`,`javascript`]},{name:`Python`,svg:`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 128 128"><linearGradient id="python-original-a" gradientUnits="userSpaceOnUse" x1="70.252" y1="1237.476" x2="170.659" y2="1151.089" gradientTransform="matrix(.563 0 0 -.568 -29.215 707.817)"><stop offset="0" stop-color="#5A9FD4"/><stop offset="1" stop-color="#306998"/></linearGradient><linearGradient id="python-original-b" gradientUnits="userSpaceOnUse" x1="209.474" y1="1098.811" x2="173.62" y2="1149.537" gradientTransform="matrix(.563 0 0 -.568 -29.215 707.817)"><stop offset="0" stop-color="#FFD43B"/><stop offset="1" stop-color="#FFE873"/></linearGradient><path fill="url(#python-original-a)" d="M63.391 1.988c-4.222.02-8.252.379-11.8 1.007-10.45 1.846-12.346 5.71-12.346 12.837v9.411h24.693v3.137H29.977c-7.176 0-13.46 4.313-15.426 12.521-2.268 9.405-2.368 15.275 0 25.096 1.755 7.311 5.947 12.519 13.124 12.519h8.491V67.234c0-8.151 7.051-15.34 15.426-15.34h24.665c6.866 0 12.346-5.654 12.346-12.548V15.833c0-6.693-5.646-11.72-12.346-12.837-4.244-.706-8.645-1.027-12.866-1.008zM50.037 9.557c2.55 0 4.634 2.117 4.634 4.721 0 2.593-2.083 4.69-4.634 4.69-2.56 0-4.633-2.097-4.633-4.69-.001-2.604 2.073-4.721 4.633-4.721z" transform="translate(0 10.26)"/><path fill="url(#python-original-b)" d="M91.682 28.38v10.966c0 8.5-7.208 15.655-15.426 15.655H51.591c-6.756 0-12.346 5.783-12.346 12.549v23.515c0 6.691 5.818 10.628 12.346 12.547 7.816 2.297 15.312 2.713 24.665 0 6.216-1.801 12.346-5.423 12.346-12.547v-9.412H63.938v-3.138h37.012c7.176 0 9.852-5.005 12.348-12.519 2.578-7.735 2.467-15.174 0-25.096-1.774-7.145-5.161-12.521-12.348-12.521h-9.268zM77.809 87.927c2.561 0 4.634 2.097 4.634 4.692 0 2.602-2.074 4.719-4.634 4.719-2.55 0-4.633-2.117-4.633-4.719 0-2.595 2.083-4.692 4.633-4.692z" transform="translate(0 10.26)"/><radialGradient id="python-original-c" cx="1825.678" cy="444.45" r="26.743" gradientTransform="matrix(0 -.24 -1.055 0 532.979 557.576)" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#B8B8B8" stop-opacity=".498"/><stop offset="1" stop-color="#7F7F7F" stop-opacity="0"/></radialGradient><path opacity=".444" fill="url(#python-original-c)" d="M97.309 119.597c0 3.543-14.816 6.416-33.091 6.416-18.276 0-33.092-2.873-33.092-6.416 0-3.544 14.815-6.417 33.092-6.417 18.275 0 33.091 2.872 33.091 6.417z"/></svg>
401
401
  `,languages:[`py`,`python`]},{name:`Rust`,svg:`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 128 128"><path d="M62.96.242c-.232.135-1.203 1.528-2.16 3.097-2.4 3.94-2.426 3.942-5.65.55-2.098-2.208-2.605-2.612-3.28-2.607-.44.002-.995.152-1.235.332-.24.18-.916 1.612-1.504 3.183-1.346 3.6-1.41 3.715-2.156 3.86-.46.086-1.343-.407-3.463-1.929-1.565-1.125-3.1-2.045-3.411-2.045-1.291 0-1.655.706-2.27 4.4-.78 4.697-.754 4.681-4.988 2.758-1.71-.776-3.33-1.41-3.603-1.41-.274 0-.792.293-1.15.652-.652.652-.653.655-.475 4.246l.178 3.595-.68.364c-.602.322-1.017.283-3.684-.348-3.48-.822-4.216-.8-4.92.15l-.516.693.692 2.964c.38 1.63.745 3.2.814 3.487.067.287-.05.746-.26 1.02-.348.448-.717.49-3.94.44-5.452-.086-5.761.382-3.51 5.3.718 1.56 1.305 2.98 1.305 3.15 0 .898-.717 1.224-3.794 1.727-1.722.28-3.218.51-3.326.51-.107 0-.43.235-.717.522-.937.936-.671 1.816 1.453 4.814 2.646 3.735 2.642 3.75-1.73 5.421-4.971 1.902-5.072 2.37-1.287 5.96 3.525 3.344 3.53 3.295-.461 5.804C.208 62.8.162 62.846.085 63.876c-.093 1.253-.071 1.275 3.538 3.48 3.57 2.18 3.57 2.246.067 5.56C-.078 76.48.038 77 5.013 78.877c4.347 1.64 4.353 1.66 1.702 5.394-1.502 2.117-1.981 3-1.981 3.653 0 1.223.637 1.535 4.44 2.174 3.206.54 3.92.857 3.92 1.741 0 .182-.588 1.612-1.307 3.177-2.236 4.87-1.981 5.275 3.31 5.275 4.93 0 4.799-.15 3.737 4.294-.8 3.35-.813 3.992-.088 4.715.554.556 1.6.494 4.87-.289 2.499-.596 2.937-.637 3.516-.328l.66.354-.177 3.594c-.178 3.593-.177 3.595.475 4.248.358.36.884.652 1.165.652.282 0 1.903-.63 3.604-1.404 4.22-1.916 4.194-1.932 4.973 2.75.617 3.711.977 4.4 2.294 4.4.327 0 1.83-.88 3.34-1.958 2.654-1.893 3.342-2.19 4.049-1.74.182.115.89 1.67 1.572 3.455 1.003 2.625 1.37 3.31 1.929 3.576 1.062.51 1.72.1 4.218-2.62 3.016-3.286 3.14-3.27 5.602.72 2.72 4.406 3.424 4.396 6.212-.089 2.402-3.864 2.374-3.862 5.621-.47 2.157 2.25 2.616 2.61 3.343 2.61.464 0 1.019-.175 1.23-.388.214-.213.92-1.786 1.568-3.496.649-1.71 1.321-3.2 1.495-3.31.687-.436 1.398-.13 4.048 1.752 1.56 1.108 3.028 1.96 3.377 1.96 1.296 0 1.764-.92 2.302-4.535.46-3.082.554-3.378 1.16-3.685.596-.302.954-.2 3.75 1.07 1.701.77 3.323 1.402 3.604 1.402.282 0 .816-.302 1.184-.672l.672-.67-.184-3.448c-.177-3.29-.16-3.468.364-3.943.54-.488.596-.486 3.615.204 3.656.835 4.338.857 5.025.17.671-.67.664-.818-.254-4.69-1.03-4.346-1.168-4.19 3.78-4.19 3.374 0 3.75-.049 4.18-.523.718-.793.547-1.702-.896-4.779-.729-1.55-1.32-2.96-1.315-3.135.024-.914.743-1.227 4.065-1.767 2.033-.329 3.553-.71 3.829-.96.923-.833.584-1.918-1.523-4.873-2.642-3.703-2.63-3.738 1.599-5.297 5.064-1.866 5.209-2.488 1.419-6.09-3.51-3.335-3.512-3.317.333-5.677 4.648-2.853 4.655-3.496.082-6.335-3.933-2.44-3.93-2.406-.405-5.753 3.78-3.593 3.678-4.063-1.295-5.965-4.388-1.679-4.402-1.72-1.735-5.38 1.588-2.18 1.982-2.903 1.982-3.65 0-1.306-.586-1.598-4.436-2.22-3.216-.52-3.924-.835-3.924-1.75 0-.174.588-1.574 1.307-3.113 1.406-3.013 1.604-4.22.808-4.94-.428-.387-1-.443-4.067-.392-3.208.054-3.618.008-4.063-.439-.486-.488-.48-.557.278-3.725.931-3.88.935-3.975.17-4.694-.777-.73-1.262-.718-4.826.121-2.597.612-3.027.653-3.617.337l-.67-.36.185-3.582.186-3.58-.67-.67c-.369-.37-.891-.67-1.163-.67-.27 0-1.884.64-3.583 1.421-2.838 1.306-3.143 1.393-3.757 1.072-.612-.32-.714-.637-1.237-3.829-.603-3.693-.977-4.412-2.288-4.412-.311 0-1.853.925-3.426 2.055-2.584 1.856-2.93 2.032-3.574 1.807-.533-.186-.843-.59-1.221-1.599-.28-.742-.817-2.172-1.194-3.177-.762-2.028-1.187-2.482-2.328-2.482-.637 0-1.213.458-3.28 2.604-3.25 3.375-3.261 3.374-5.65-.545C66.073 1.78 65.075.382 64.81.24c-.597-.32-1.3-.32-1.85.002m2.96 11.798c2.83 2.014 1.326 6.75-2.144 6.75-3.368 0-5.064-4.057-2.66-6.36 1.358-1.3 3.304-1.459 4.805-.39m-3.558 12.507c1.855.705 2.616.282 6.852-3.8l3.182-3.07 1.347.18c4.225.56 12.627 4.25 17.455 7.666 4.436 3.14 10.332 9.534 12.845 13.93l.537.942-2.38 5.364c-1.31 2.95-2.382 5.673-2.382 6.053 0 .878.576 2.267 1.13 2.726.234.195 2.457 1.265 4.939 2.378l4.51 2.025.178 1.148c.23 1.495.26 5.167.052 6.21l-.163.816h-2.575c-2.987 0-2.756-.267-2.918 3.396-.118 2.656-.76 4.124-2.22 5.075-2.377 1.551-6.304 1.27-7.97-.57-.255-.284-.752-1.705-1.105-3.16-1.03-4.254-2.413-6.64-5.193-8.965-.878-.733-1.595-1.418-1.595-1.522 0-.102.965-.915 2.145-1.803 4.298-3.24 6.77-7.012 7.04-10.747.519-7.126-5.158-13.767-13.602-15.92-2.002-.51-2.857-.526-27.624-.526-14.057 0-25.56-.092-25.56-.204 0-.263 3.125-3.295 4.965-4.816 5.054-4.178 11.618-7.465 18.417-9.22l2.35-.61 3.34 3.387c1.839 1.863 3.64 3.5 4.003 3.637M20.3 46.34c1.539 1.008 2.17 3.54 1.26 5.062-1.405 2.356-4.966 2.455-6.373.178-2.046-3.309 1.895-7.349 5.113-5.24m90.672.13c4.026 2.454.906 8.493-3.404 6.586-2.877-1.273-2.97-5.206-.155-6.64 1.174-.6 2.523-.579 3.56.053M32.163 61.5v15.02h-13.28l-.526-2.285c-1.036-4.5-1.472-9.156-1.211-12.969l.182-2.679 4.565-2.047c2.864-1.283 4.706-2.262 4.943-2.625 1.038-1.584.94-2.715-.518-5.933l-.68-1.502h6.523V61.5M70.39 47.132c2.843.74 4.345 2.245 4.349 4.355.002 1.55-.765 2.52-2.67 3.38-1.348.61-1.562.625-10.063.708l-8.686.084v-8.92h7.782c6.078 0 8.112.086 9.288.393m-2.934 21.554c1.41.392 3.076 1.616 3.93 2.888.898 1.337 1.423 3.076 2.667 8.836 1.05 4.87 1.727 6.46 3.62 8.532 2.345 2.566 1.8 2.466 13.514 2.466 5.61 0 10.198.09 10.198.2 0 .197-3.863 4.764-4.03 4.764-.048 0-2.066-.422-4.484-.939-6.829-1.458-7.075-1.287-8.642 6.032l-1.008 4.702-.91.448c-1.518.75-6.453 2.292-9.01 2.82-4.228.87-8.828 1.162-12.871.821-6.893-.585-16.02-3.259-16.377-4.8-.075-.327-.535-2.443-1.018-4.704-.485-2.26-1.074-4.404-1.31-4.764-1.13-1.724-2.318-1.83-7.547-.674-1.98.44-3.708.796-3.84.796-.248 0-3.923-4.249-3.923-4.535 0-.09 8.728-.194 19.396-.23l19.395-.066.07-6.89c.05-4.865-.018-6.997-.23-7.25-.234-.284-1.485-.358-6.011-.358H53.32v-8.36l6.597.001c3.626.002 7.02.12 7.539.264M37.57 100.02c3.084 1.88 1.605 6.804-2.043 6.8-3.74 0-5.127-4.88-1.94-6.826 1.055-.643 2.908-.63 3.983.026m56.48.206c1.512 1.108 2.015 3.413 1.079 4.95-2.46 4.034-8.612.827-6.557-3.419 1.01-2.085 3.695-2.837 5.478-1.53"/></svg>
402
402
  `,languages:[`rs`,`rust`],monochrome:!0},{name:`Go`,svg:`<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 128 128"><defs><path id="go-original-a" d="M18.8 1h90.5v126H18.8z"/></defs><clipPath id="go-original-b"><use xlink:href="#go-original-a" overflow="visible"/></clipPath><path fill-rule="evenodd" clip-rule="evenodd" fill="#F6D2A2" d="M21.1 68.7c.2 3.5 3.7 1.9 5.3.8 1.5-1.1 2-.2 2.1-2.3.1-1.4.2-2.7.2-4.1-2.3-.2-4.8.3-6.7 1.7-.9.7-2.8 3-.9 3.9" clip-path="url(#go-original-b)"/><path d="M23 71.2c-.7 0-2-.3-2.2-2.3-.6-.4-.8-.9-.8-1.2-.1-1.2 1.2-2.6 1.9-3.1 1.6-1.2 3.7-1.8 5.9-1.8h1.3v.3c.1 1.1 0 2.2-.1 3.2 0 .3 0 .6-.1.9-.1 1.5-.4 1.7-1.1 2-.3.1-.6.2-1.1.6-.5.3-2.2 1.4-3.7 1.4zm4.8-7.8c-2.1 0-4 .6-5.5 1.7-.7.5-1.7 1.7-1.6 2.5 0 .3.2.6.6.8l.2.1v.2c.1 1.6.9 1.8 1.5 1.8 1 0 2.4-.7 3.3-1.3.6-.4 1-.5 1.3-.6.5-.2.6-.2.7-1.4 0-.3 0-.6.1-.9.1-.9.1-1.9.1-2.8-.3-.1-.5-.1-.7-.1z" clip-path="url(#go-original-b)"/><path fill-rule="evenodd" clip-rule="evenodd" fill="#C6B198" d="M21.1 68.7c.5-.2 1.1-.3 1.4-.8" clip-path="url(#go-original-b)"/><path d="M21.1 69c-.1 0-.3-.1-.3-.2-.1-.2 0-.4.2-.4.1 0 .2-.1.2-.1.4-.2.8-.3 1-.6.1-.1.3-.2.5-.1.1.1.2.3.1.5-.4.5-.9.7-1.3.8l-.2.1h-.2z" clip-path="url(#go-original-b)"/><path fill-rule="evenodd" clip-rule="evenodd" fill="#6AD7E5" d="M29.3 26.4c-13.6-3.8-3.5-21.1 7.4-14l-7.4 14z" clip-path="url(#go-original-b)"/><path d="M29.5 26.8l-.3-.1c-7-2-6.9-7-6.7-8.5.5-3.8 4.1-7.8 8.9-7.8 1.9 0 3.7.6 5.5 1.8l.3.2-7.7 14.4zm1.9-15.7c-4.5 0-7.8 3.7-8.3 7.2-.5 3.6 1.7 6.4 6 7.7l7.1-13.5c-1.5-.9-3.1-1.4-4.8-1.4z" clip-path="url(#go-original-b)"/><path fill-rule="evenodd" clip-rule="evenodd" fill="#6AD7E5" d="M89.6 11.1c10.7-7.5 20.5 9.5 8 13.8l-8-13.8z" clip-path="url(#go-original-b)"/><path d="M97.5 25.3L89.2 11l.3-.2c1.9-1.3 3.8-2 5.7-2 4.6 0 7.9 3.8 8.6 7.5.3 1.5.6 6.6-6 8.8l-.3.2zm-7.4-14l7.7 13.3c3.9-1.4 5.9-4.4 5.3-8-.6-3.4-3.7-6.9-7.9-6.9-1.7-.1-3.4.4-5.1 1.6z" clip-path="url(#go-original-b)"/><path fill-rule="evenodd" clip-rule="evenodd" fill="#F6D2A2" d="M92 112.3c2.7 1.7 7.7 6.8 3.6 9.3-3.9 3.6-6.1-4-9.6-5 1.5-2 3.4-3.9 6-4.3" clip-path="url(#go-original-b)"/><path d="M93.5 122.9c-1.6 0-3-1.6-4.2-3.1-1.1-1.2-2.2-2.5-3.4-2.9l-.5-.1.3-.4c1.2-1.7 3.2-3.9 6.2-4.4h.1l.1.1c1.7 1.1 5.4 4.2 5.3 7.1 0 1.1-.6 2-1.7 2.7-.7.7-1.4 1-2.2 1zm-7-6.5c1.2.5 2.2 1.8 3.2 2.9 1.2 1.5 2.4 2.8 3.7 2.8.6 0 1.2-.3 1.8-.9h.1c.9-.6 1.4-1.3 1.4-2.2 0-2.3-2.9-5.2-4.9-6.5-1.8.5-3.6 1.7-5.3 3.9zm9.1 5.5c-.1 0-.2-.1-.3-.2-.2-.4-.4-.9-.5-1.3-.3-.8-.6-1.6-1.2-2.2-.1-.1-.1-.3 0-.5.1-.1.3-.1.5 0 .7.7 1.1 1.6 1.4 2.5l.5 1.2c.1.2 0 .4-.1.5h-.3z" clip-path="url(#go-original-b)"/><path fill-rule="evenodd" clip-rule="evenodd" fill="#F6D2A2" d="M43.2 118.1c-3.2.5-5 3.4-7.7 4.9-2.5 1.5-3.5-.5-3.7-.9-.4-.2-.4.2-1-.4-2.3-3.7 2.4-6.4 4.9-8.2 3.5-.8 5.7 2.2 7.5 4.6" clip-path="url(#go-original-b)"/><path d="M33.8 123.8c-1.3 0-2-1.1-2.2-1.5h-.1c-.3 0-.5-.1-.9-.5v-.1c-2.2-3.5 1.6-6.2 4.1-8l.9-.6h.2c.4-.1.7-.1 1.1-.1 3 0 4.9 2.6 6.5 4.7l.5.7-.6.1c-1.9.3-3.3 1.5-4.7 2.7-.9.8-1.8 1.5-2.8 2.1-.8.3-1.4.5-2 .5zm-2.2-2.1c.1 0 .2 0 .4.1h.1l.1.1c.2.3.7 1.2 1.7 1.2.5 0 1-.2 1.5-.5 1-.5 1.9-1.3 2.7-2 1.3-1.1 2.7-2.3 4.5-2.8-1.5-2-3.3-4.2-5.8-4.2-.3 0-.6 0-.9.1l-.8.6c-2.6 1.8-5.8 4.1-3.9 7.1.1.2.2.3.4.3zm.2.7c-.2 0-.4-.2-.3-.4.1-1 .6-1.7 1.1-2.5.3-.4.5-.8.7-1.2.1-.2.3-.2.4-.2.2.1.2.3.2.4-.2.5-.5.9-.8 1.3-.5.7-.9 1.3-1 2.1 0 .4-.1.5-.3.5z" clip-path="url(#go-original-b)"/><path fill-rule="evenodd" clip-rule="evenodd" d="M29.9 21.7c-1.8-.9-3.1-2.2-2-4.3 1-1.9 2.9-1.7 4.7-.8l-2.7 5.1zm64.9-1.8c1.8-.9 3.1-2.2 2-4.3-1-1.9-2.9-1.7-4.7-.8l2.7 5.1z" clip-path="url(#go-original-b)"/><path fill-rule="evenodd" clip-rule="evenodd" fill="#F6D2A2" d="M107.1 68.2c-.2 3.5-3.7 1.9-5.3.8-1.5-1.1-2-.2-2.1-2.3-.1-1.4-.2-2.7-.2-4.1 2.3-.2 4.8.3 6.7 1.7 1 .8 2.8 3 .9 3.9" clip-path="url(#go-original-b)"/><path d="M105.3 70.7c-1.5 0-3.2-1.1-3.7-1.4-.5-.3-.8-.5-1.1-.6-.8-.3-1-.5-1.1-2 0-.3 0-.6-.1-.9-.1-1-.2-2.1-.1-3.2v-.3h1.3c2.2 0 4.3.6 5.9 1.8.7.5 2 1.9 1.9 3.1 0 .4-.2.9-.8 1.2-.2 2-1.5 2.3-2.2 2.3zM99.8 63c0 .9 0 1.9.1 2.8 0 .3 0 .6.1.9.1 1.2.2 1.2.7 1.4.3.1.7.3 1.3.6.9.6 2.3 1.3 3.3 1.3.6 0 1.4-.2 1.5-1.8V68l.2-.1c.4-.2.6-.4.6-.8.1-.8-.9-2-1.6-2.5-1.5-1.1-3.5-1.7-5.5-1.7-.2.1-.4.1-.7.1z" clip-path="url(#go-original-b)"/><path fill-rule="evenodd" clip-rule="evenodd" fill="#C6B198" d="M107.1 68.2c-.5-.2-1.1-.3-1.4-.8" clip-path="url(#go-original-b)"/><path d="M107.1 68.6h-.1l-.2-.1c-.5-.2-1-.3-1.3-.8-.1-.1-.1-.4.1-.5.1-.1.4-.1.5.1.2.3.6.4 1 .6.1 0 .2.1.2.1.2.1.3.3.2.4-.1.1-.3.2-.4.2z" clip-path="url(#go-original-b)"/><path fill-rule="evenodd" clip-rule="evenodd" fill="#6AD7E5" d="M62.8 4c13.6 0 26.3 1.9 33 15 6 14.6 3.8 30.4 4.8 45.9.8 13.3 2.5 28.6-3.6 40.9-6.5 12.9-22.7 16.2-36 15.7-10.5-.4-23.1-3.8-29.1-13.4-6.9-11.2-3.7-27.9-3.2-40.4.6-14.8-4-29.7.9-44.1C34.5 8.5 48.1 5.1 62.8 4" clip-path="url(#go-original-b)"/><path d="M63.3 121.9h-2.5c-4.1-.1-10.3-.8-16.4-3.3-5.9-2.4-10.2-5.8-13-10.3-5.6-9.1-4.6-21.6-3.7-32.7.2-2.8.4-5.4.5-7.9.2-5.2-.2-10.6-.7-15.7-.8-9.4-1.6-19.1 1.5-28.5 2.4-7 6.7-12 13.2-15.2 5.1-2.5 11.4-3.9 20.4-4.6C76 3.6 89.3 5.5 96 18.8c4.4 10.7 4.4 22.2 4.5 33.3 0 4.2 0 8.5.3 12.7.1 1.3.2 2.6.2 3.9.8 12.2 1.7 26-3.9 37.2-2.8 5.7-7.7 9.9-14.4 12.6-5.4 2.2-12.2 3.4-19.4 3.4zM62.8 4.3c-14.1 1.1-27.9 4.2-33 19.4-3.1 9.3-2.3 18.9-1.5 28.2.4 5.2.9 10.5.7 15.8-.1 2.5-.3 5.1-.5 7.9-.9 11-1.9 23.4 3.6 32.3 2.3 3.7 9.7 12.5 28.8 13.2h2.5c22.1 0 30.3-9.8 33.3-15.6 5.5-11 4.6-24.8 3.9-36.9-.1-1.3-.2-2.6-.2-3.9-.2-4.2-.3-8.5-.3-12.7-.1-11-.1-22.5-4.4-33.1C92.7 13 88.2 9 82 6.7c-6.4-2.1-13.6-2.4-19.2-2.4z" clip-path="url(#go-original-b)"/><path fill-rule="evenodd" clip-rule="evenodd" fill="#fff" d="M65.2 22.2c2.4 14.2 25.6 10.4 22.3-3.9-3-12.8-23.1-9.2-22.3 3.9" clip-path="url(#go-original-b)"/><path d="M76.2 31.5c-4.5 0-10.2-2.4-11.4-9.2-.2-3.2.8-6.1 2.9-8.3 2.3-2.5 5.8-3.9 9.4-3.9 4.2 0 9.2 2.2 10.6 8.3.8 3.4.2 6.4-1.7 8.8-2.1 2.6-5.8 4.3-9.8 4.3zm-10.7-9.3c.5 2.8 1.8 5 3.9 6.6 1.8 1.4 4.3 2.1 6.8 2.1 3.7 0 7.3-1.6 9.3-4.1 1.8-2.2 2.3-5.1 1.6-8.3-1.3-5.7-6-7.7-10-7.7-3.4 0-6.7 1.4-8.9 3.7-1.9 2-2.9 4.7-2.7 7.7z" clip-path="url(#go-original-b)"/><path fill-rule="evenodd" clip-rule="evenodd" fill="#fff" d="M37.5 24.5c3.2 12.3 22.9 9.2 22.2-3.2-.9-14.8-25.3-12-22.2 3.2" clip-path="url(#go-original-b)"/><path d="M48 32.7c-4.3 0-9.3-2.1-10.9-8.1-.7-3.5 0-6.7 2-9.1 2.2-2.7 5.8-4.3 9.7-4.3 5.2 0 10.7 3.1 11.1 10.1.2 2.9-.7 5.5-2.7 7.6-2.1 2.3-5.6 3.8-9.2 3.8zm.8-20.8c-3.7 0-7.1 1.5-9.2 4-1.9 2.3-2.5 5.2-1.8 8.5C39.2 30 44 32 48 32c3.4 0 6.7-1.3 8.8-3.6 1.8-1.9 2.7-4.4 2.5-7.1-.2-4.3-3.1-9.4-10.5-9.4z" clip-path="url(#go-original-b)"/><path fill-rule="evenodd" clip-rule="evenodd" fill="#fff" d="M68 39.2c0 1.8.4 3.9.1 5.9-.5.9-1.4 1-2.2 1.3-1.1-.2-2-.9-2.5-1.9-.3-2.2.1-4.4.2-6.6l4.4 1.3z" clip-path="url(#go-original-b)"/><path d="M65.9 46.8c-1.3-.2-2.3-1-2.8-2.1-.2-1.6-.1-3.1 0-4.6.1-.7.1-1.4.1-2.1v-.4l5.1 1.6v.2c0 .6.1 1.2.1 1.9.1 1.3.2 2.7 0 4v.1c-.4.8-1.1 1-1.8 1.3-.2-.1-.4 0-.7.1zm-2.2-2.4c.4.9 1.2 1.5 2.1 1.7.2-.1.4-.1.5-.2.6-.2 1.1-.4 1.4-.9.2-1.2.1-2.5 0-3.8 0-.6-.1-1.2-.1-1.7l-3.8-1.2c0 .6-.1 1.2-.1 1.7-.1 1.6-.2 3 0 4.4z" clip-path="url(#go-original-b)"/><path fill-rule="evenodd" clip-rule="evenodd" d="M46.3 22.5c0 2-1.5 3.6-3.3 3.6-1.8 0-3.3-1.6-3.3-3.6s1.5-3.6 3.3-3.6c1.8 0 3.3 1.6 3.3 3.6" clip-path="url(#go-original-b)"/><path fill-rule="evenodd" clip-rule="evenodd" fill="#fff" d="M45.2 23.3c0 .5-.4.9-.8.9s-.8-.4-.8-.9.4-.9.8-.9c.5 0 .8.4.8.9" clip-path="url(#go-original-b)"/><path fill-rule="evenodd" clip-rule="evenodd" d="M74.2 21.6c0 2-1.5 3.6-3.3 3.6-1.8 0-3.3-1.6-3.3-3.6s1.5-3.6 3.3-3.6c1.8 0 3.3 1.6 3.3 3.6" clip-path="url(#go-original-b)"/><path fill-rule="evenodd" clip-rule="evenodd" fill="#fff" d="M73.2 22.4c0 .5-.3.9-.8.9-.4 0-.8-.4-.8-.9s.3-.9.8-.9c.4 0 .8.4.8.9M58.4 39c-1.5 3.5.8 10.6 4.8 5.4-.3-2.2.1-4.4.2-6.6l-5 1.2z" clip-path="url(#go-original-b)"/><path d="M60.5 46.6c-.7 0-1.4-.4-1.9-1.2-1.1-1.6-1.3-4.6-.5-6.5l.1-.2 5.5-1.4v.4l-.1 2.2c-.1 1.5-.2 2.9 0 4.4v.1l-.1.1c-1 1.4-2 2.1-3 2.1zm-1.8-7.3c-.6 1.7-.4 4.4.5 5.7.4.6.8.9 1.3.9.7 0 1.5-.6 2.3-1.6-.2-1.5-.1-3 .1-4.4l.1-1.7-4.3 1.1z" clip-path="url(#go-original-b)"/><path fill-rule="evenodd" clip-rule="evenodd" fill="#F6D2A2" d="M58.9 32.2c-2.7.2-4.9 3.5-3.5 6 1.9 3.4 6-.3 8.6 0 3 .1 5.4 3.2 7.8.6 2.7-2.9-1.2-5.7-4.1-7l-8.8.4z" clip-path="url(#go-original-b)"/><path fill="#231F20" d="M69.7 40.2c-.9 0-1.8-.4-2.7-.8-.9-.4-1.9-.8-3-.8h-.3c-.8 0-1.7.3-2.7.7-1.1.4-2.2.7-3.2.7-1.2 0-2.1-.5-2.7-1.6-.7-1.2-.6-2.6.1-3.9.8-1.5 2.2-2.4 3.7-2.6l8.9-.4h.1c2.2.9 4.7 2.6 5.2 4.6.2 1-.1 2-.9 2.9-.8.9-1.6 1.2-2.5 1.2zM64.1 38c1.1 0 2.2.5 3.2.9.9.4 1.7.7 2.5.7.7 0 1.3-.3 1.9-.9.7-.7.9-1.5.8-2.3-.4-1.7-2.8-3.3-4.7-4.1l-8.7.4c-1.3.1-2.5 1-3.2 2.2-.6 1.1-.6 2.3-.1 3.3.5.9 1.1 1.3 2.1 1.3.9 0 1.9-.4 2.9-.7 1.1-.4 2-.7 3-.7 0-.2.1-.2.3-.1z" clip-path="url(#go-original-b)"/><path fill-rule="evenodd" clip-rule="evenodd" d="M58.6 32.1c-.2-4.7 8.8-5.3 9.8-1.4 1.1 4-9.4 4.9-9.8 1.4" clip-path="url(#go-original-b)"/></svg>
403
403
  `,languages:[`go`,`golang`]},{name:`C`,svg:`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 128 128"><path fill="#a9bacd" d="M125 50c-4-32-24-50-62-50C29 0 3 24 3 64c0 39 24 64 64 64 32 0 55-19 58-50H87c-2 11-8 20-20 20-21 0-24-16-24-33 0-23 8-35 22-35 13 0 20 7 22 20z" /></svg>
@@ -430,12 +430,12 @@ l0,-`+(t+144)+`c-2,-159.3,-10,-310.7,-24,-454c-53.3,-528,-210,-949.7,
430
430
  </svg>`,languages:[`yaml`,`yml`]},{name:`Markdown`,svg:`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 128 128"><path style="line-height:normal;font-variant-ligatures:normal;font-variant-position:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-alternates:normal;font-variant-east-asian:normal;font-feature-settings:normal;font-variation-settings:normal;text-indent:0;text-align:start;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:#000;text-transform:none;text-orientation:mixed;white-space:normal;shape-padding:0;shape-margin:0;inline-size:0;isolation:auto;mix-blend-mode:normal;solid-color:#000;solid-opacity:1" d="M11.95 24.348c-5.836 0-10.618 4.867-10.618 10.681v57.942c0 5.814 4.782 10.681 10.617 10.681h104.102c5.835 0 10.617-4.867 10.617-10.681V35.03c0-5.814-4.783-10.681-10.617-10.681H14.898l-.002-.002H11.95zm-.007 9.543h104.108c.625 0 1.076.423 1.076 1.14v57.94c0 .717-.453 1.14-1.076 1.14H11.949c-.623 0-1.076-.423-1.076-1.14V35.029c0-.715.451-1.135 1.07-1.138z" color="#000" font-weight="400" font-family="sans-serif" overflow="visible"/><path d="M20.721 84.1V43.9H32.42l11.697 14.78L55.81 43.9h11.696v40.2H55.81V61.044l-11.694 14.78-11.698-14.78V84.1H20.722zm73.104 0L76.28 64.591h11.697V43.9h11.698v20.69h11.698zm0 0"/></svg>
431
431
  `,languages:[`md`,`markdown`],monochrome:!0},{name:`Lua`,svg:`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 128 128"><path fill="#000080" d="M112.956.708c-7.912 0-14.335 6.424-14.335 14.336s6.424 14.335 14.335 14.335 14.335-6.41 14.335-14.335c0-7.912-6.424-14.336-14.335-14.336zM64 15.058c-27.02 0-48.956 21.935-48.956 48.955S36.979 112.97 64 112.97c27.02 0 48.956-21.935 48.956-48.956 0-27.02-21.936-48.956-48.956-48.956z"/><path fill="#fff" d="M84.285 29.392c-7.91 0-14.335 6.424-14.335 14.335s6.424 14.336 14.335 14.336 14.336-6.424 14.336-14.336-6.424-14.335-14.335-14.335zM30.773 56.36v32.119h19.961v-3.611H34.87V56.359Zm57.584 8.37c-3.354 0-6.126.975-7.668 2.692-1.055 1.19-1.488 2.516-1.582 4.801h3.705c.311-2.826 1.988-4.098 5.423-4.098 3.3 0 5.153 1.231 5.153 3.435v.974c0 1.542-.92 2.205-3.827 2.556-5.193.663-5.991.839-7.398 1.407-2.69 1.095-4.057 3.164-4.057 6.166 0 4.193 2.908 6.83 7.574 6.83 2.907 0 5.247-1.014 7.843-3.395.257 2.34 1.407 3.395 3.787 3.395.757 0 1.325-.081 2.515-.392v-2.773a2.917 2.917 0 0 1-.798.095c-1.284 0-1.988-.663-1.988-1.812V71.032c0-4.098-3.002-6.302-8.682-6.302zm-33.742.664V83.19c0 3.84 2.867 6.302 7.357 6.302 3.395 0 5.545-1.19 7.709-4.233v3.219h3.3V65.393h-3.652v13.09c0 4.72-2.475 7.804-6.302 7.804-2.907 0-4.76-1.772-4.76-4.544v-16.35Zm38.773 11.67v4.139c0 1.244-.365 1.988-1.46 3.002-1.502 1.366-3.3 2.07-5.464 2.07-2.867 0-4.544-1.367-4.544-3.706 0-2.42 1.636-3.665 5.558-4.233 3.881-.528 4.68-.703 5.91-1.271z"/><path fill="#808080" d="M61.733 0a64.06 64.06 0 0 0-5.57.436l.179 1.458a62.596 62.596 0 0 1 5.442-.426zm5.585.046-.075 1.468a62.432 62.432 0 0 1 5.433.52L72.88.578a63.91 63.91 0 0 0-5.561-.532Zm-16.665 1.31a63.301 63.301 0 0 0-5.409 1.398l.43 1.405a61.835 61.835 0 0 1 5.284-1.367Zm27.72.237-.33 1.431a62.536 62.536 0 0 1 5.262 1.455l.452-1.397a63.998 63.998 0 0 0-5.384-1.489ZM39.98 4.623a63.447 63.447 0 0 0-5.081 2.323l.668 1.308a61.98 61.98 0 0 1 4.964-2.27zm49.012.41-.573 1.353a62.539 62.539 0 0 1 4.929 2.346l.688-1.298a64.012 64.012 0 0 0-5.044-2.4ZM30.04 9.706a63.95 63.95 0 0 0-4.6 3.17l.886 1.173a62.484 62.484 0 0 1 4.494-3.098zm-8.906 6.728a64.247 64.247 0 0 0-3.983 3.918l1.075 1.001a62.774 62.774 0 0 1 3.891-3.827zm-7.61 8.165a64.04 64.04 0 0 0-3.247 4.546l1.231.8a62.571 62.571 0 0 1 3.172-4.44zm-6.086 9.357a63.459 63.459 0 0 0-2.408 5.042l1.352.574a61.99 61.99 0 0 1 2.352-4.925zm113.623.973-1.31.667a62.616 62.616 0 0 1 2.263 4.967l1.362-.55a64.073 64.073 0 0 0-2.315-5.083zM3.075 44.23a63.382 63.382 0 0 0-1.49 5.385l1.432.328a61.91 61.91 0 0 1 1.455-5.26Zm122.166 1.049-1.404.429a62.513 62.513 0 0 1 1.366 5.285l1.437-.306a63.983 63.983 0 0 0-1.399-5.409zM.574 55.108a64.093 64.093 0 0 0-.528 5.561l1.467.075a62.622 62.622 0 0 1 .516-5.434Zm126.988 1.088-1.458.179a62.465 62.465 0 0 1 .428 5.441l1.468-.05a63.916 63.916 0 0 0-.438-5.57zM1.468 66.205 0 66.255a64.082 64.082 0 0 0 .435 5.57l1.458-.179a62.61 62.61 0 0 1-.425-5.441Zm125.018 1.071a62.63 62.63 0 0 1-.518 5.434l1.455.203a64.16 64.16 0 0 0 .53-5.561zM2.79 77.031l-1.437.304a63.332 63.332 0 0 0 1.398 5.41l1.405-.43A61.864 61.864 0 0 1 2.79 77.03Zm122.188 1.046a61.966 61.966 0 0 1-1.457 5.26l1.397.454a63.43 63.43 0 0 0 1.492-5.384zM5.981 87.459l-1.362.551a63.434 63.434 0 0 0 2.323 5.082l1.307-.669a61.968 61.968 0 0 1-2.268-4.964Zm115.627.99a61.98 61.98 0 0 1-2.354 4.925l1.296.69a63.447 63.447 0 0 0 2.41-5.04zM10.944 97.17l-1.245.78a63.949 63.949 0 0 0 3.17 4.6l1.172-.885a62.481 62.481 0 0 1-3.097-4.495zm105.534.904a62.546 62.546 0 0 1-3.173 4.44l1.156.906a64.024 64.024 0 0 0 3.249-4.545zm-98.96 7.8-1.092.983a64.235 64.235 0 0 0 3.917 3.983l1.002-1.074a62.77 62.77 0 0 1-3.827-3.892zm92.24.79a62.76 62.76 0 0 1-3.893 3.826l.983 1.092a64.221 64.221 0 0 0 3.984-3.916zm-84.263 6.648-.906 1.157a64.026 64.026 0 0 0 4.546 3.248l.8-1.232a62.554 62.554 0 0 1-4.44-3.173zm76.16.654a62.475 62.475 0 0 1-4.495 3.096l.78 1.245a63.945 63.945 0 0 0 4.6-3.17zm-67.018 5.294-.691 1.296a63.45 63.45 0 0 0 5.04 2.409l.575-1.352a61.984 61.984 0 0 1-4.924-2.353zm57.775.496a61.956 61.956 0 0 1-4.964 2.268l.551 1.362a63.425 63.425 0 0 0 5.082-2.322zm-47.74 3.77-.453 1.396a63.419 63.419 0 0 0 5.385 1.49l.329-1.43a61.949 61.949 0 0 1-5.26-1.456zm37.632.322a62.05 62.05 0 0 1-5.284 1.365l.304 1.437a63.361 63.361 0 0 0 5.41-1.398zm-27.003 2.122-.203 1.455a64.093 64.093 0 0 0 5.561.529l.075-1.467a62.605 62.605 0 0 1-5.433-.517zm16.335.139a62.635 62.635 0 0 1-5.442.424l.05 1.468a64.114 64.114 0 0 0 5.57-.434z"/></svg>
432
432
  `,languages:[`lua`]},{name:`R`,svg:`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 128 128"><defs><linearGradient id="a" x1=".741" x2="590.86" y1="3.666" y2="593.79" gradientTransform="matrix(.2169 0 0 .14527 -.16 14.112)" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#cbced0"/><stop offset="1" stop-color="#84838b"/></linearGradient><linearGradient id="b" x1="301.03" x2="703.07" y1="151.4" y2="553.44" gradientTransform="matrix(.17572 0 0 .17931 -.16 14.112)" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#276dc3"/><stop offset="1" stop-color="#165caa"/></linearGradient></defs><path fill="url(#a)" fill-rule="evenodd" d="M64 100.38c-35.346 0-64-19.19-64-42.863 0-23.672 28.654-42.863 64-42.863s64 19.19 64 42.863c0 23.672-28.654 42.863-64 42.863zm9.796-68.967c-26.866 0-48.646 13.119-48.646 29.303 0 16.183 21.78 29.303 48.646 29.303s46.693-8.97 46.693-29.303c0-20.327-19.827-29.303-46.693-29.303z"/><path fill="url(#b)" fill-rule="evenodd" d="M97.469 81.033s3.874 1.169 6.124 2.308c.78.395 2.132 1.183 3.106 2.219a8.388 8.388 0 0 1 1.42 2.04l15.266 25.74-24.674.01-11.537-21.666s-2.363-4.06-3.817-5.237c-1.213-.982-1.73-1.331-2.929-1.331h-5.862l.004 28.219-21.833.009V41.26h43.844s19.97.36 19.97 19.359c0 18.999-19.082 20.413-19.082 20.413zm-9.497-24.137-13.218-.009-.006 12.258 13.224-.005s6.124-.019 6.124-6.235c0-6.34-6.124-6.009-6.124-6.009z"/></svg>
433
- `,languages:[`r`]},{name:`Scala`,svg:`<svg version="1.0" viewBox="0 0 128 128" xmlns="http://www.w3.org/2000/svg"><path d="M25 110.437V94.874h5.616c3.113 0 8.052-.203 11.03-.474l5.278-.406-7.038-1.894c-3.924-1.015-8.864-2.504-10.961-3.316L25 87.364V55.627h6.293c3.383 0 8.323-.203 10.894-.473l4.737-.406-8.323-2.233C34 51.366 29.128 49.809 27.639 49.2L25 47.982v-30.72l2.098-.473c1.15-.203 3.992-.406 6.293-.406 11.367 0 38.366-3.722 51.628-7.105 9.27-2.436 15.698-4.872 17.931-6.902 1.15-1.015 1.218-.406 1.218 14.548v15.63l-1.624 1.219-1.624 1.285 3.248 2.842v33.9l-1.624 1.218-1.624 1.286 3.248 2.842v33.9l-1.76 1.353c-1.894 1.489-9.202 3.993-17.524 6.09C71.892 121.737 40.157 126 29.33 126H25z" fill="#390d09"/><g fill="#de3423"><path d="M25 110.572V95.077l11.842-.474c12.315-.473 21.45-1.488 34.847-3.789 15.225-2.639 30.246-7.375 31.803-10.082.406-.677.676 4.534.676 14.616v15.698l-1.76 1.353c-1.894 1.489-9.202 3.993-17.524 6.09C71.892 121.737 40.157 126 29.33 126H25zM25 71.327V55.83l11.842-.406c13.127-.541 23.344-1.691 36.877-4.195 15.157-2.842 28.96-7.443 29.976-9.947.203-.473.406 6.09.406 14.616.067 13.533-.068 15.698-1.083 16.78-2.368 2.64-20.638 7.376-39.449 10.286-11.435 1.76-30.381 3.79-35.66 3.79H25zM25 32.352V17.195l2.098-.406c1.15-.203 3.992-.406 6.293-.406 11.367 0 38.366-3.722 51.628-7.105 9.27-2.436 15.698-4.872 17.931-6.902 1.15-1.015 1.218-.406 1.218 14.48 0 14.548-.067 15.63-1.285 16.714-1.827 1.691-14.345 5.548-24.09 7.51-15.765 3.113-41.951 6.429-50.883 6.429H25z"/></g></svg>`,languages:[`scala`]},{name:`Elixir`,svg:`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 128 128"><linearGradient id="elixir-original-a" gradientUnits="userSpaceOnUse" x1="835.592" y1="-36.546" x2="821.211" y2="553.414" gradientTransform="matrix(.1297 0 0 .2 -46.03 17.198)"><stop offset="0" stop-color="#d9d8dc"/><stop offset="1" stop-color="#fff" stop-opacity=".385"/></linearGradient><path fill-rule="evenodd" clip-rule="evenodd" fill="url(#elixir-original-a)" d="M64.4.5C36.7 13.9 1.9 83.4 30.9 113.9c26.8 33.5 85.4 1.3 68.4-40.5-21.5-36-35-37.9-34.9-72.9z"/><linearGradient id="elixir-original-b" gradientUnits="userSpaceOnUse" x1="942.357" y1="-40.593" x2="824.692" y2="472.243" gradientTransform="matrix(.1142 0 0 .2271 -47.053 17.229)"><stop offset="0" stop-color="#8d67af" stop-opacity=".672"/><stop offset="1" stop-color="#9f8daf"/></linearGradient><path fill-rule="evenodd" clip-rule="evenodd" fill="url(#elixir-original-b)" d="M64.4.2C36.8 13.6 1.9 82.9 31 113.5c10.7 12.4 28 16.5 37.7 9.1 26.4-18.8 7.4-53.1 10.4-78.5C68.1 33.9 64.2 11.3 64.4.2z"/><linearGradient id="elixir-original-c" gradientUnits="userSpaceOnUse" x1="924.646" y1="120.513" x2="924.646" y2="505.851" gradientTransform="matrix(.1227 0 0 .2115 -46.493 17.206)"><stop offset="0" stop-color="#26053d" stop-opacity=".762"/><stop offset="1" stop-color="#b7b4b4" stop-opacity=".278"/></linearGradient><path fill-rule="evenodd" clip-rule="evenodd" fill="url(#elixir-original-c)" d="M56.7 4.3c-22.3 15.9-28.2 75-24.1 94.2 8.2 48.1 75.2 28.3 69.6-16.5-6-29.2-48.8-39.2-45.5-77.7z"/><linearGradient id="elixir-original-d" gradientUnits="userSpaceOnUse" x1="428.034" y1="198.448" x2="607.325" y2="559.255" gradientTransform="matrix(.1848 0 0 .1404 -42.394 17.138)"><stop offset="0" stop-color="#91739f" stop-opacity=".46"/><stop offset="1" stop-color="#32054f" stop-opacity=".54"/></linearGradient><path fill-rule="evenodd" clip-rule="evenodd" fill="url(#elixir-original-d)" d="M78.8 49.8c10.4 13.4 12.7 22.6 6.8 27.9-27.7 19.4-61.3 7.4-54-37.3C22.1 63 4.5 96.8 43.3 101.6c20.8 3.6 54 2 58.9-16.1-.2-15.9-10.8-22.9-23.4-35.7z"/><linearGradient id="elixir-original-e" gradientUnits="userSpaceOnUse" x1="907.895" y1="540.636" x2="590.242" y2="201.281" gradientTransform="matrix(.1418 0 0 .1829 -45.23 17.18)"><stop offset="0" stop-color="#463d49" stop-opacity=".331"/><stop offset="1" stop-color="#340a50" stop-opacity=".821"/></linearGradient><path fill-rule="evenodd" clip-rule="evenodd" fill="url(#elixir-original-e)" d="M38.1 36.4c-2.9 21.2 35.1 77.9 58.3 71-17.7 35.6-56.9-21.2-64-41.7 1.5-11 2.2-16.4 5.7-29.3z"/><linearGradient id="elixir-original-f" gradientUnits="userSpaceOnUse" x1="1102.297" y1="100.542" x2="1008.071" y2="431.648" gradientTransform="matrix(.106 0 0 .2448 -47.595 17.242)"><stop offset="0" stop-color="#715383" stop-opacity=".145"/><stop offset="1" stop-color="#f4f4f4" stop-opacity=".234"/></linearGradient><path fill-rule="evenodd" clip-rule="evenodd" fill="url(#elixir-original-f)" d="M60.4 49.7c.8 7.9 3.9 20.5 0 28.8S38.7 102 43.6 115.3c11.4 24.8 37.1-4.4 36.9-19 1.1-11.8-6.6-38.7-1.8-52.5L76.5 41l-13.6-4c-2.2 3.2-3 7.5-2.5 12.7z"/><linearGradient id="elixir-original-g" gradientUnits="userSpaceOnUse" x1="1354.664" y1="140.06" x2="1059.233" y2="84.466" gradientTransform="matrix(.09173 0 0 .2828 -48.536 17.28)"><stop offset="0" stop-color="#a5a1a8" stop-opacity=".356"/><stop offset="1" stop-color="#370c50" stop-opacity=".582"/></linearGradient><path fill-rule="evenodd" clip-rule="evenodd" fill="url(#elixir-original-g)" d="M65.3 10.8C36 27.4 48 53.4 49.3 81.6l19.1-55.4c-1.4-5.7-2.3-9.5-3.1-15.4z"/><path fill-rule="evenodd" clip-rule="evenodd" fill="#330A4C" fill-opacity=".316" d="M68.3 26.1c-14.8 11.7-14.1 31.3-18.6 54 8.1-21.3 4.1-38.2 18.6-54z"/><path fill-rule="evenodd" clip-rule="evenodd" fill="#FFF" d="M45.8 119.7c8 1.1 12.1 2.2 12.5 3 .3 4.2-11.1 1.2-12.5-3z"/><path fill-rule="evenodd" clip-rule="evenodd" fill="#EDEDED" fill-opacity=".603" d="M49.8 10.8c-6.9 7.7-14.4 21.8-18.2 29.7-1 6.5-.5 15.7.6 23.5.9-18.2 7.5-39.2 17.6-53.2z"/></svg>`,languages:[`elixir`,`ex`]},{name:`Haskell`,svg:`<svg viewBox="0 0 128 128" xmlns="http://www.w3.org/2000/svg"><path fill="#463B63" d="M0 110.2L30.1 65 0 19.9h22.6L52.7 65l-30.1 45.1H0z"/><path fill="#5E5187" d="M30.1 110.2L60.2 65 30.1 19.9h22.6l60.2 90.3H90.4L71.5 81.9l-18.8 28.2H30.1z"/><path fill="#904F8C" d="M102.9 83.8l-10-15.1H128v15.1h-25.1zM87.8 61.3l-10-15.1H128v15.1H87.8z"/></svg>`,languages:[`haskell`,`hs`]},{name:`Perl`,svg:`<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 128 128"><path d="M121.172 62.878c0-34.048-26.473-61.648-59.135-61.648C29.379 1.23 2.9 28.83 2.9 62.878s26.478 61.651 59.136 61.651c32.662 0 59.135-27.603 59.135-61.651z" fill="#fff"/><path d="M53.34 127.516c-13.91-2.461-25.842-8.812-35.703-19.006C9.25 99.842 3.477 88.928.853 76.763c-1.137-5.256-1.137-20.287 0-25.54C2.629 43 6.075 34.835 10.776 27.714 13.89 23 23.004 13.888 27.716 10.773c7.123-4.7 15.293-8.15 23.514-9.921 5.253-1.137 20.286-1.137 25.543 0C89.58 3.617 100.225 9.4 109.41 18.585c9.187 9.186 14.97 19.828 17.739 32.639 1.133 5.252 1.133 20.283 0 25.54-2.769 12.806-8.552 23.448-17.739 32.634-9.038 9.041-19.55 14.812-32.147 17.65-4.467 1.009-19.238 1.297-23.923.468zm11.567-12.772c0-4.194-.062-4.497-.907-4.497-.838 0-.904.288-.869 3.897.043 4.264.343 5.572 1.211 5.284.401-.132.565-1.491.565-4.684zm-6.757 1.445c1.192-1.196 1.542-1.92 1.542-3.209 0-1.316-.16-1.635-.763-1.519-.417.078-.919.76-1.114 1.507-.194.748-1 1.904-1.783 2.57-1.418 1.196-1.472 2.192-.125 2.192.386 0 1.394-.697 2.243-1.541zm14.943 1.047c.167-.269-.339-1.036-1.122-1.698-.786-.666-1.589-1.822-1.783-2.57-.199-.747-.701-1.429-1.118-1.507-.6-.116-.76.203-.76 1.519 0 2.609 3.743 5.942 4.783 4.256zm-20.66-8.146c0-.261-.634-.822-1.41-1.246-5.054-2.769-10.985-7.176-14.28-10.61-6.433-6.71-9.33-13.388-9.4-21.678-.048-5.54.665-8.43 3.364-13.605 2.609-5.004 5.631-8.78 13.95-17.421 9.287-9.653 11.425-12.2 13.038-15.533 1.148-2.367 1.3-3.231 1.46-8.235.199-6.215-.18-10.506-.927-10.506-.339 0-.401 1.612-.21 5.234.623 11.592-1.53 15.19-14.892 24.881-9.202 6.674-13.424 10.3-16.613 14.264-4.518 5.61-6.52 10.466-7.018 17.05-1.207 15.868 8.848 29.629 26.59 36.385 3.914 1.487 6.348 1.881 6.348 1.02zm30.7-1.285c6.098-2.543 10.736-5.615 15.11-10.007 6.667-6.701 9.439-12.967 9.856-22.242.362-8.134-1.402-13.515-6.437-19.61-3.45-4.173-7.162-7.16-17.174-13.81-13.47-8.953-16.633-12.516-16.633-18.746 0-1.658.3-4.006.662-5.217.623-2.068.608-3.493-.02-1.862-.591 1.546-1.947.837-2.675-1.41l-.7-2.152.264 2.04c.942 7.242 1.06 10.276.642 16.615-.564 8.57-1.616 14.427-4.51 25.076-2.87 10.572-3.387 14.404-3.029 22.476.3 6.825 1.254 11.93 3.474 18.593 2.06 6.183 2.445 6.654 6.235 7.624 2.083.533 4.058 1.433 5.627 2.566 1.476 1.067 2.952 1.76 3.781 1.775.748.012 3.237-.755 5.526-1.709zm-1.371-3.076c-.565-.565-.3-1.048 1.912-3.493 6.97-7.694 10.094-15.641 10.183-25.906.063-6.993-1.483-11.627-6.2-18.593-2.13-3.15-9.634-11.008-13.263-13.893-2.66-2.114-5.398-5.72-5.885-7.76-.494-2.068.892-1.523 2.496.98.787 1.227 2.493 3.03 3.79 4.004 1.296.977 5.132 3.835 8.524 6.355 11.664 8.671 16.859 16.066 18.023 25.672.678 5.556-.397 11.3-3.107 16.634-2.812 5.525-7.937 11.545-12.326 14.477-2.703 1.803-3.556 2.115-4.147 1.523zm-22.837.584c.133-.343-1.036-2.535-2.593-4.875-4.128-6.191-5.924-9.606-7.598-14.454-1.414-4.085-1.492-4.641-1.504-10.883-.015-9.431 1.005-12.422 8.49-24.85 7.057-11.718 8.015-16.258 7.22-34.286-.288-6.46-.611-11.838-.72-11.95-.744-.744-.904 1.172-.627 7.67.545 12.94-.292 20.147-3.018 26.062-1.858 4.026-3.938 7.075-9.53 14.002-7.788 9.637-9.985 14.75-9.946 23.126.031 5.743.806 9.275 3.127 14.185 2.512 5.32 7.135 10.689 12.93 15.011 2.667 1.994 3.391 2.231 3.77 1.242z" fill="#212178"/></svg>`,languages:[`perl`,`pl`]}];function MN({language:e}){let t=e?.toLowerCase()||`text`,n=jN.find(e=>e.languages.includes(t));return(0,R.jsx)(`span`,{className:`markdown-code-language`,title:n?.name||e||`Plain text`,children:n?(0,R.jsx)(`span`,{className:n.monochrome?`markdown-code-language-icon monochrome`:`markdown-code-language-icon`,role:`img`,"aria-label":n.name,dangerouslySetInnerHTML:{__html:n.svg}}):t})}function NN({code:e,language:t,pre:n,target:r}){let[i,a]=(0,F.useState)({status:`idle`}),o=(0,F.useRef)(!1),s=(0,F.useRef)(void 0);(0,F.useEffect)(()=>(o.current=!1,()=>{o.current=!0,clearTimeout(s.current)}),[]);async function c(){let t=e;clearTimeout(s.current),a({status:`copying`});try{if(await navigator.clipboard.writeText(t),o.current)return;a({status:`copied`,code:t}),s.current=setTimeout(()=>a({status:`idle`}),2e3)}catch{o.current||a({status:`failed`})}}let l=i.status===`copied`&&i.code!==e,u=i.status===`failed`?`Retry copying code`:l?`Copy current code`:`Copy code`,d=i.status===`copied`?l?`Copied earlier`:`Copied`:i.status===`failed`?`Copy failed`:i.status===`copying`?`Copying`:`Copy`,[f,p]=(0,F.useState)(!1),m=f?`Disable line wrapping`:`Enable line wrapping`;return(0,F.useEffect)(()=>(n.classList.toggle(`markdown-code-wrap`,f),()=>n.classList.remove(`markdown-code-wrap`)),[n,f]),(0,AN.createPortal)((0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(MN,{language:t}),(0,R.jsxs)(`div`,{className:`markdown-code-actions`,children:[(0,R.jsx)(`button`,{type:`button`,className:`markdown-code-action`,"aria-label":m,"aria-pressed":f,title:m,onClick:()=>p(e=>!e),children:(0,R.jsx)(Tv,{size:16,"aria-hidden":`true`})}),(0,R.jsxs)(`button`,{type:`button`,className:`markdown-code-action`,"aria-label":u,title:d===`Copy`?u:`${d}. ${u}`,disabled:i.status===`copying`,onClick:()=>void c(),children:[i.status===`copied`&&!l?(0,R.jsx)(Ug,{size:16,"aria-hidden":`true`}):i.status===`failed`?(0,R.jsx)(Yg,{size:16,"aria-hidden":`true`}):(0,R.jsx)(r_,{size:16,"aria-hidden":`true`}),(0,R.jsx)(`span`,{className:`sr-only`,role:`status`,children:d})]})]})]}),r)}function PN(e){switch(e){case`image/jpeg`:return`jpg`;case`image/png`:return`png`;case`image/gif`:return`gif`;case`image/webp`:return`webp`;case`image/svg+xml`:return`svg`;case`image/avif`:return`avif`;case`image/bmp`:return`bmp`;default:return}}function FN(e){let t=e.name.trim()||`image`,n=PN(e.mediaType);if(!n)return t;let r=t.match(/\.([a-z0-9]{2,5})$/i);return r?(e.mediaType===`image/jpeg`?[`jpg`,`jpeg`]:[n]).includes(r[1].toLowerCase())?t:`${t.slice(0,-r[0].length)}.${n}`:`${t}.${n}`}async function IN(e){let t=await fetch(e.url,{referrerPolicy:`no-referrer`,credentials:new URL(e.url,window.location.href).pathname===`/api/workspace/image`?`include`:`same-origin`});if(!t.ok)throw Error(`Fetch failed with status ${t.status}`);return t.blob()}async function LN(e){if(e.type===`image/png`)return e;let t=await createImageBitmap(e);try{let e=document.createElement(`canvas`);e.width=t.width,e.height=t.height;let n=e.getContext(`2d`);if(!n)throw Error(`Canvas 2D context unavailable`);return n.drawImage(t,0,0),await new Promise((t,n)=>{e.toBlob(e=>e?t(e):n(Error(`PNG encoding failed`)),`image/png`)})}finally{t.close()}}var RN=`inline-flex size-9 items-center justify-center rounded-lg border border-white/15 bg-black/65 text-white shadow-lg backdrop-blur-sm transition hover:bg-black/80 focus-visible:ring-2 focus-visible:ring-white/50 focus-visible:outline-none aria-disabled:cursor-wait aria-disabled:opacity-60`;function zN({image:e,onClose:t}){let n=(0,F.useRef)(null),[r,i]=(0,F.useState)(!1),[a,o]=(0,F.useState)(!1),[s,c]=(0,F.useState)(!1),[l,u]=(0,F.useState)(null),[d,f]=(0,F.useState)(null),p=(0,F.useRef)(null),m=(0,F.useRef)(0),h=(0,F.useRef)(t);(0,F.useLayoutEffect)(()=>{h.current=t},[t]),(0,F.useEffect)(()=>{if(m.current+=1,!e)return;i(!1),o(!1),c(!1),u(null),f(null);let t=document.activeElement instanceof HTMLElement?document.activeElement:null,r=!1;queueMicrotask(()=>{r||n.current?.focus()});let a=document.body.style.overflow;document.body.style.overflow=`hidden`,document.fullscreenElement&&document.querySelector(`[data-artifact-screen-fullscreen]`)&&document.exitFullscreen?.().catch(()=>{});function s(e){if(e.key===`Escape`){e.preventDefault(),e.stopPropagation(),h.current();return}let t=n.current;if(e.key!==`Tab`||!t)return;let r=Array.from(t.querySelectorAll(`button:not([disabled]), a[href], [tabindex]:not([tabindex="-1"])`)).filter(e=>!e.hasAttribute(`hidden`));if(r.length===0){e.preventDefault(),t.focus();return}let i=r[0],a=r[r.length-1],o=document.activeElement;e.shiftKey&&(o===t||o===i||!t.contains(o))?(e.preventDefault(),a.focus()):!e.shiftKey&&(o===t||o===a||!t.contains(o))&&(e.preventDefault(),i.focus())}return window.addEventListener(`keydown`,s,!0),()=>{r=!0,window.removeEventListener(`keydown`,s,!0),document.body.style.overflow=a,p.current!==null&&(window.clearTimeout(p.current),p.current=null),t?.isConnected&&t.focus()}},[e]);async function g(e){if(a)return;let t=m.current;o(!0),u(null),f(null);try{if(!globalThis.ClipboardItem)throw Error(`Clipboard images unsupported`);let n=IN(e).then(LN);if(await navigator.clipboard.write([new ClipboardItem({"image/png":n})]),t!==m.current)return;i(!0),p.current!==null&&window.clearTimeout(p.current),p.current=window.setTimeout(()=>{i(!1),p.current=null},2e3)}catch{t===m.current&&(i(!1),u(`Could not copy the image to the clipboard.`))}finally{t===m.current&&o(!1)}}async function _(e){if(s)return;let t=m.current;c(!0),u(null),f(null);try{let n=await IN(e);if(t!==m.current)return;let r=URL.createObjectURL(n),i=document.createElement(`a`);i.href=r,i.download=FN({...e,mediaType:n.type||e.mediaType}),document.body.append(i);try{i.click()}finally{i.remove(),window.setTimeout(()=>URL.revokeObjectURL(r),1e4)}}catch{t===m.current&&f(`Could not download the image.`)}finally{t===m.current&&c(!1)}}if(!e)return null;let v=e;return(0,R.jsx)(`div`,{className:`bg-background/92 fixed inset-0 z-300 flex items-center justify-center px-3 py-4 sm:px-6 sm:py-12`,"data-image-viewer":``,role:`presentation`,onClick:e=>{e.target===e.currentTarget&&t()},children:(0,R.jsxs)(`div`,{ref:n,className:`relative inline-flex max-h-full max-w-full outline-none`,role:`dialog`,"aria-modal":`true`,"aria-label":`Image preview: ${v.name}`,tabIndex:-1,children:[(0,R.jsx)(`img`,{src:v.url,alt:v.name,referrerPolicy:`no-referrer`,className:`border-border block max-h-[calc(100dvh-2rem)] max-w-full rounded-2xl border object-contain sm:max-h-[calc(100dvh-6rem)]`}),(0,R.jsx)(`button`,{type:`button`,className:`${RN} absolute top-3 right-3`,"aria-label":`Close image preview`,onClick:t,children:(0,R.jsx)(Fv,{className:`size-4`,"aria-hidden":`true`})}),(0,R.jsx)(`div`,{className:`absolute right-3 bottom-3 flex items-center gap-2`,children:v.readActions===!1?(0,R.jsx)(`a`,{className:`${RN} w-auto px-3 text-sm`,href:v.url,target:`_blank`,rel:`noopener noreferrer`,referrerPolicy:`no-referrer`,children:`Open original image`}):(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(`button`,{type:`button`,className:RN,"aria-disabled":a,"aria-label":a?`Copying image`:r?`Image copied`:`Copy image`,title:a?`Copying image`:r?`Image copied`:`Copy image`,onClick:()=>void g(v),children:a?(0,R.jsx)(V_,{className:`size-4 animate-spin`,"aria-hidden":`true`}):r?(0,R.jsx)(Ug,{className:`size-4`,"aria-hidden":`true`}):(0,R.jsx)(r_,{className:`size-4`,"aria-hidden":`true`})}),(0,R.jsx)(`button`,{type:`button`,className:RN,"aria-disabled":s,"aria-label":s?`Downloading image`:`Download image`,title:s?`Downloading image`:`Download image`,onClick:()=>void _(v),children:s?(0,R.jsx)(V_,{className:`size-4 animate-spin`,"aria-hidden":`true`}):(0,R.jsx)(s_,{className:`size-4`,"aria-hidden":`true`})})]})}),(0,R.jsx)(`span`,{className:`sr-only`,"aria-live":`polite`,children:a?`Copying image`:r?`Image copied`:s?`Downloading image`:``}),l||d?(0,R.jsx)(`p`,{className:`border-border absolute right-3 bottom-14 max-w-[min(20rem,calc(100%-1.5rem))] rounded-lg border bg-black/80 px-3 py-2 text-xs text-amber-100 shadow-lg backdrop-blur-sm`,role:`alert`,children:l??d}):null]})})}function BN(e){let t=e.split(/[?#]/,1)[0];try{return decodeURIComponent(t)}catch{return t}}function VN(e,t){if(e=rD(e),/^(?:https?:|data:image\/|blob:|\/\/)/i.test(e))return e;if(!e||/^[a-z][a-z\d+.-]*:/i.test(e)&&!iD(e))return null;let n=BN(e),r=t?.documentPath?.replaceAll(`\\`,`/`),i=r?.slice(0,r.lastIndexOf(`/`)+1)??``,a=aD(n)?n:i+n,o=n.replace(/^(?:\.\/)+/,``),s=!r&&/^(?:parse_file|screenshot_url|scrape_url)\//.test(o)?t?.transcript:void 0;if(!aD(a)&&!t?.workspacePath&&!s)return null;let c=new URLSearchParams;s&&(c.set(`userId`,s.userId),c.set(`threadId`,s.threadId)),t?.workspacePath&&c.set(`workspacePath`,t.workspacePath),c.set(`path`,s?o:a);let l=jm(),u=`/api/workspace/image?${c}`;return l&&l!==globalThis.window?.location.origin?`${l}${u}`:u}function HN(e,t){let n=document.createElement(`template`);n.innerHTML=e;for(let e of n.content.querySelectorAll(`a[href]`)){let n=e.getAttribute(`href`)??``;if(/^[a-z][a-z\d+.-]*:/i.test(n)&&!/^https?:/i.test(n)&&!iD(n)||!/\.(?:avif|bmp|gif|jpe?g|png|svg|webp)$/i.test(BN(n)))continue;if(e.querySelector(`img`)){let r=VN(n,t);r&&e.setAttribute(`href`,r);continue}let r=document.createElement(`img`);r.setAttribute(`src`,n),r.alt=e.textContent||`Image`;let i=e.getAttribute(`title`);i&&(r.title=i),e.replaceWith(r)}for(let e of n.content.querySelectorAll(`img`)){let n=VN(e.getAttribute(`src`)??``,t);if(e.setAttribute(`loading`,`lazy`),e.setAttribute(`decoding`,`async`),e.setAttribute(`referrerpolicy`,`no-referrer`),e.removeAttribute(`srcset`),e.removeAttribute(`data-local-image-url`),n){e.src=n;let t=new URL(n,window.location.href);t.pathname===`/api/workspace/image`&&t.origin===jm()&&e.setAttribute(`data-local-image-url`,n)}else e.removeAttribute(`src`),e.alt=`${e.alt||`Image`} (unavailable)`;n&&n.startsWith(`${jm()}/api/workspace/image?`)&&(e.crossOrigin=`use-credentials`),!e.closest(`a`)&&n&&(e.tabIndex=0,e.setAttribute(`role`,`button`),e.setAttribute(`aria-label`,`View ${e.alt||`image`}`))}return n.innerHTML}var UN=new Map,WN=L().nullable(),GN=2e3,KN,qN;function JN(){UN.size&&!KN&&!qN&&(KN=setTimeout(YN,GN))}async function YN(){if(KN=void 0,document.visibilityState===`hidden`){JN();return}let e=new AbortController;qN=e;let t=[...UN.entries()];async function n(){for(;t.length&&!e.signal.aborted;){let n=t.shift();if(!n)return;let[r,i]=n;if(UN.get(r)!==i)continue;let a=new URL(r,window.location.href);a.searchParams.set(`revisionOnly`,`true`);try{let t=await fetch(a.href,{credentials:`include`,cache:`no-store`,signal:AbortSignal.any([e.signal,AbortSignal.timeout(5e3)])});if(!t.ok)continue;let n=WN.parse(await t.json());if(e.signal.aborted||UN.get(r)!==i||n===i.revision||(i.revision=n,n===null))continue;a.searchParams.delete(`revisionOnly`),a.searchParams.set(`revision`,n);for(let e of i.listeners)e(a.href)}catch{}}}try{await Promise.all(Array.from({length:Math.min(4,t.length)},()=>n()))}finally{qN===e&&(qN=void 0),JN()}}function XN(e,t){let n=UN.get(e);if(n||(n={listeners:new Set},UN.set(e,n)),n.listeners.add(t),n.revision){let r=new URL(e,window.location.href);r.searchParams.set(`revision`,n.revision),t(r.href)}return JN(),()=>{n.listeners.delete(t),n.listeners.size||UN.delete(e),UN.size||(clearTimeout(KN),KN=void 0,qN?.abort())}}var ZN=`modulepreload`,QN=function(e){return`/`+e},$N={},eP=function(e){return e.pathname.endsWith(`.css`)},tP=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e,i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}function s(e){return import.meta.resolve?new URL(import.meta.resolve(e)):new URL(e,import.meta.url)}r=o(t.map(t=>{t=QN(t,n);let r=s(t);if(r.href in $N)return;$N[r.href]=!0;let i=eP(r);if(e===void 0){e={all:new Set,styles:new Set};let t=document.getElementsByTagName(`link`);for(let n=t.length-1;n>=0;n--){let r=t[n];e.all.add(r.href),r.rel===`stylesheet`&&e.styles.add(r.href)}}if((i?e.styles:e.all).has(r.href))return;let o=document.createElement(`link`);if(o.rel=i?`stylesheet`:ZN,i||(o.as=`script`),o.crossOrigin=``,o.href=r.href,a&&o.setAttribute(`nonce`,a),document.head.appendChild(o),i)return new Promise((e,t)=>{o.addEventListener(`load`,e),o.addEventListener(`error`,()=>t(Error(`Unable to preload CSS for ${r}`)))})}).filter(e=>e!==void 0))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})};function nP({html:e,imageScope:t}){let n=t?.workspacePath,r=t?.documentPath,i=t?.transcript?.userId,a=t?.transcript?.threadId,o=(0,F.useMemo)(()=>HN(e,{workspacePath:n,documentPath:r,transcript:i&&a?{userId:i,threadId:a}:void 0}),[e,n,r,i,a]),s=(0,F.useRef)(null),[c,l]=(0,F.useState)(null);(0,F.useEffect)(()=>{let e=[...s.current?.querySelectorAll(`img[data-local-image-url]`)??[]].map(e=>{let t=e.getAttribute(`data-local-image-url`);if(!t)return()=>{};let n=e.alt;return XN(t,t=>{let r=e.src;e.classList.remove(`markdown-image-error`),e.alt=n,e.closest(`a`)||(e.tabIndex=0,e.setAttribute(`role`,`button`),e.setAttribute(`aria-label`,`View ${n||`image`}`)),e.src=t,l(e=>e?.url===r?{...e,url:t}:e)})});return()=>{for(let t of e)t()}},[o]);let[u,d]=(0,F.useState)({html:o,blocks:[]});(0,F.useEffect)(()=>{let e=s.current?.querySelectorAll(`pre > code`)??[];if(!e.length){d({html:o,blocks:[]});return}let t=new AbortController,n=[];for(let r of e){let e=r.parentElement;if(!e)continue;let i=document.createElement(`div`);i.className=`markdown-code-block`;let a=document.createElement(`div`);a.className=`markdown-code-header`,e.replaceWith(i),i.append(a,e);let o=r.textContent,s=[...r.classList].find(e=>e.startsWith(`language-`))?.slice(9).toLowerCase();n.push({target:a,wrapper:i,pre:e,code:o,language:s}),s&&(o.length>5e4||tP(async()=>{let{highlightCodeInWorker:e}=await import(`./code-highlighting-client-Kw4BuD-0.js`);return{highlightCodeInWorker:e}},[]).then(({highlightCodeInWorker:e})=>t.signal.aborted?null:e(o,s,t.signal)).then(e=>{if(!e||t.signal.aborted)return;let n=document.createDocumentFragment();for(let[t,r]of e.entries()){t>0&&n.append(`
434
- `);for(let e of r){let t=document.createElement(`span`);t.textContent=e.content;for(let[n,r]of Object.entries(e.htmlStyle??{}))t.style.setProperty(n,String(r));n.append(t)}}r.replaceChildren(n),r.classList.add(`shiki`)}).catch(()=>{}))}return d({html:o,blocks:n}),()=>{t.abort();for(let{wrapper:e,pre:t}of n)e.replaceWith(t)}},[o]);function f(e){if(!e.getAttribute(`src`)||e.closest(`a`)||e.classList.contains(`markdown-image-error`))return;let t=new URL(e.src),n=e.src.startsWith(`${jm()}/api/workspace/image?`);l({url:e.src,name:e.alt||`Image`,mediaType:``,readActions:n||!/^https?:$/.test(t.protocol)||t.origin===window.location.origin})}return(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(`div`,{ref:s,className:`chat-markdown-html`,onClick:e=>{e.target instanceof HTMLImageElement&&f(e.target)},onKeyDown:e=>{e.target instanceof HTMLImageElement&&(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),f(e.target))},onErrorCapture:e=>{if(!(e.target instanceof HTMLImageElement)||e.target.classList.contains(`markdown-image-error`))return;let t=e.target;t.classList.add(`markdown-image-error`),t.alt=`${t.alt||`Image`} (unavailable)`,t.removeAttribute(`role`),t.removeAttribute(`tabindex`),t.removeAttribute(`aria-label`)},dangerouslySetInnerHTML:{__html:o}}),u.blocks.map(({target:e,code:t,language:n,pre:r},i)=>(0,R.jsx)(NN,{target:e,code:t,language:n,pre:r},i)),c?(0,AN.createPortal)((0,R.jsx)(zN,{image:c,onClose:()=>l(null)}),document.body):null]})}var rP=new Set;function iP({content:e,className:t=``,artifacts:n=[],onOpenArtifact:r,openLinksInNewTab:i=!1,imageScope:a}){let o=(0,F.useMemo)(()=>new Map(n.map(e=>[e.key,e])),[n]),s=(0,F.useMemo)(()=>DN(e,r?new Set(o.keys()):rP,i),[e,r,o,i]);return(0,R.jsx)(`div`,{className:pb(`chat-markdown`,t),children:s.map((e,t)=>{if(e.type===`artifact`){let n=o.get(e.artifactId);return n&&r?(0,R.jsx)(kN,{artifact:n,onOpen:()=>r(e.artifactId)},`${e.type}-${t}`):null}return(0,R.jsx)(nP,{html:e.html,imageScope:a},`${e.type}-${t}`)})})}var aP=`border-border hover:border-border focus-visible:ring-ring/40 text-foreground inline-flex h-14 max-w-56 items-center gap-2 rounded-xl border px-3 py-2 text-xs transition focus-visible:ring-2 focus-visible:outline-none`;function oP({attachment:e,loadAttachment:t,onOpen:n}){let[r,i]=(0,F.useState)(null),[a,o]=(0,F.useState)(!1),[s,c]=(0,F.useState)(!1),l=(0,F.useRef)(0),u=(0,F.useRef)(t);(0,F.useLayoutEffect)(()=>{u.current=t},[t]);let d=r??e.url??null,f=_x(e.mediaType);(0,F.useEffect)(()=>{let e=r;return()=>xx(e??void 0)},[r]),(0,F.useEffect)(()=>{let t=e.storageId,n=e.mediaType;if(!Sx({mediaType:n,url:e.url}))return;let r=u.current;if(!r)return;let a=!1;return o(!1),r(t).then(e=>{if(a){xx(e??void 0);return}i(e),o(e==null)}).catch(()=>{a||o(!0)}),()=>{a=!0}},[e.storageId,e.mediaType,e.url]),(0,F.useEffect)(()=>()=>{l.current+=1},[]);async function p(){if(s)return;let n=d;if(n?.startsWith(`blob:`)){Cx(n,e.name);return}if(!t&&!n){o(!0);return}let r=l.current;c(!0),o(!1);try{let a=null;if(t)a=await t(e.storageId);else if(n){let e=await fetch(n);if(!e.ok)throw Error(`Download failed`);a=URL.createObjectURL(await e.blob())}if(r!==l.current){xx(a??void 0);return}if(!a){o(!0);return}i(a),Cx(a,e.name)}catch{r===l.current&&o(!0)}finally{r===l.current&&c(!1)}}return d&&f?(0,R.jsx)(`button`,{type:`button`,className:`border-border hover:border-border focus-visible:ring-ring/40 block size-14 cursor-zoom-in overflow-hidden rounded-xl border transition focus-visible:ring-2 focus-visible:outline-none`,"aria-label":`View ${e.name}`,title:e.name,onClick:()=>{n({url:d,name:e.name,mediaType:e.mediaType})},children:(0,R.jsx)(`img`,{src:d,alt:``,loading:`lazy`,className:`size-full object-cover`})}):f&&t&&!a?(0,R.jsx)(`span`,{className:`border-hairline bg-hover-fill inline-flex size-14 animate-pulse rounded-xl border`,"aria-label":`Loading ${e.name}`}):f?(0,R.jsx)(`span`,{className:`text-muted-foreground border-hairline bg-hover-fill inline-flex items-center rounded-xl border px-3 py-2 text-xs`,children:`${e.name} (unavailable)`}):s?(0,R.jsxs)(`span`,{className:`${aP} pointer-events-none animate-pulse`,"aria-label":`Downloading ${e.name}`,role:`status`,children:[(0,R.jsx)(C_,{className:`text-muted-foreground size-4 shrink-0`,"aria-hidden":`true`}),(0,R.jsx)(`span`,{className:`min-w-0 truncate`,children:e.name})]}):a?(0,R.jsxs)(`button`,{type:`button`,className:`${aP} cursor-pointer`,"aria-label":`Retry download of ${e.name}`,title:e.name,onClick:()=>{p()},children:[(0,R.jsx)(C_,{className:`text-muted-foreground size-4 shrink-0`,"aria-hidden":`true`}),(0,R.jsx)(`span`,{className:`min-w-0 truncate`,children:`${e.name} (unavailable)`})]}):t||d?(0,R.jsxs)(`button`,{type:`button`,className:`${aP} cursor-pointer`,"aria-label":`Download ${e.name}`,title:e.name,onClick:()=>{p()},children:[(0,R.jsx)(C_,{className:`text-muted-foreground size-4 shrink-0`,"aria-hidden":`true`}),(0,R.jsx)(`span`,{className:`min-w-0 truncate`,children:e.name})]}):(0,R.jsx)(`span`,{className:`text-muted-foreground border-hairline bg-hover-fill inline-flex items-center rounded-xl border px-3 py-2 text-xs`,children:`${e.name} (unavailable)`})}var sP=`user-bubble w-fit max-w-[33rem] rounded-xl border px-5 py-3.5 text-[15.5px] leading-7 text-foreground`;function cP({message:e,imageScope:t,copied:n,loadAttachment:r,onCopy:i,onOpenImage:a}){let o=e.attachments??[];return(0,R.jsxs)(`div`,{"data-message-id":e.id,"data-transcript-anchor":e.id,className:`flex flex-col items-end gap-1.5`,children:[o.length>0?(0,R.jsx)(`ul`,{className:`flex max-w-132 flex-wrap justify-end gap-2`,"aria-label":`Attached files`,children:o.map(e=>(0,R.jsx)(`li`,{children:(0,R.jsx)(oP,{attachment:{...e,url:null},loadAttachment:r,onOpen:a})},e.storageId))}):null,e.text||o.length===0?(0,R.jsx)(`div`,{className:sP,children:(0,R.jsx)(iP,{imageScope:t,content:e.text||` `,className:`text-foreground`,openLinksInNewTab:!0})}):null,e.text?(0,R.jsx)(`button`,{type:`button`,className:`text-muted-foreground hover:text-muted-foreground inline-flex size-6 items-center justify-center rounded-md transition`,"aria-label":n?`Copied`:`Copy message`,onClick:i,children:n?(0,R.jsx)(Ug,{className:`size-3.5`,"aria-hidden":`true`}):(0,R.jsx)(r_,{className:`size-3.5`,"aria-hidden":`true`})}):null]})}function lP(e){let[t,n]=(0,F.useState)(!1),[r,i]=(0,F.useState)(!1),a=(0,F.useRef)(e);return(0,F.useEffect)(()=>{e!==a.current&&(a.current=e,e?i(!1):n(!1))},[e]),{expanded:e?!r:t,toggle:(0,F.useCallback)(()=>{e?i(e=>!e):n(e=>!e)},[e])}}function uP({text:e,inProgress:t}){let n=lP(t),r=t?`Reasoning`:`Reasoned`;return(0,R.jsxs)(`div`,{className:`text-muted-foreground text-sm`,children:[(0,R.jsxs)(`button`,{type:`button`,className:`text-muted-foreground hover:text-muted-foreground inline-flex items-center gap-1.5 transition`,onClick:n.toggle,"aria-expanded":n.expanded,children:[(0,R.jsx)(Lg,{className:`size-3.5 shrink-0`,"aria-hidden":`true`}),(0,R.jsx)(`span`,{children:r}),(0,R.jsx)(qg,{className:`size-3.5 shrink-0 transition-transform ${n.expanded?`rotate-90`:``}`,"aria-hidden":`true`})]}),n.expanded?(0,R.jsx)(`div`,{className:`text-muted-foreground mt-1.5 text-[13px] leading-6 [overflow-wrap:anywhere] whitespace-pre-wrap`,children:e}):null]})}function dP(e){return e.split(`_`).map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(` `)}function fP(e){if(!fC(e))switch(e){case`apply_patch`:case`ask_question`:case`await_question`:case`poll_question`:case`read_skill`:case`scrape_url`:case`web_search`:return;case`spawn_subagent`:return`Delegated Tasks`;case`control_subagent`:return`Controlled Subagents`;case`poll_subagent`:return`Polled Subagents`;case`list_subagents`:return`Listed Subagents`;case`list_subagent_models`:return`Listed Subagent Models`;case`check_docs`:return`Checked Docs`;case`add_artifact`:case`create_artifact`:return`Created Artifact`;case`edit_artifact`:case`update_artifact`:return`Updated Artifact`;case`list_artifacts`:return`Listed Artifacts`;case`save_artifact`:return`Saved Artifact`;case`delete_artifact`:return`Deleted Artifact`;case`get_workspace_instructions`:return`Read Instructions`;case`mandate_charge`:return`Charged Card`;case`mandate_list`:return`Listed Mandates`;case`mandate_report`:return`Settled Charge`;case`mandate_setup`:return`Set Up Mandate`;case`mandate_status`:return`Checked Mandate`;case`parse_file`:return`Parsed File`;case`screenshot_url`:return`Captured Screenshot`;default:return dP(e)}}function pP(e){let t=$S(e)?pC(e.workdir):void 0;return t&&t.trim().length>0&&t!==`.`?` (cwd ${t})`:``}function mP(e,t){let n=$S(t)?t:void 0;switch(e){case`apply_patch`:return SP(t)??`Patch`;case`ask_question`:return pC(n?.question)??`Question`;case`await_question`:case`poll_question`:return`Waiting for answer`;case`spawn_subagent`:return pC(n?.prompt)??`Child agent`;case`control_subagent`:return n?.action===`send`?pC(n.prompt)??`Message child agent`:n?.action===`stop`?`Stop child agent`:n?.action===`answer_question`?`Answered question`:pC(n?.threadId)??`Child agent`;case`poll_subagent`:return pC(n?.threadId)??`Child agent`;case`list_subagents`:case`list_subagent_models`:return``;case`check_docs`:return pC(n?.query)??pC(n?.path)??`Docs`;case`add_artifact`:case`create_artifact`:case`edit_artifact`:case`save_artifact`:case`delete_artifact`:return bP(t);case`list_artifacts`:return`Artifacts`;case`exec_command`:case`exec_cmd`:{let e=pC(n?.cmd);return e?`${e}${pP(t)}`:`Command`}case`control_command`:case`control_cmd`:{let e=pC(n?.sessionId),t=e?`Session ${e}`:`Command session`;return n?.action===`terminate`?`Terminate ${t}`:`Write to ${t}`}case`poll_command`:case`poll_cmd`:case`write_stdin`:{let e=pC(n?.sessionId);return e?`Session ${e}`:`Command session`}case`get_workspace_instructions`:return`Workspace instructions`;case`mandate_charge`:return gP(n);case`mandate_list`:return`Standing mandates`;case`mandate_report`:return n?.outcome===`approved`?`Charge approved`:`Charge declined`;case`mandate_setup`:return hP(n);case`mandate_status`:return`Mandate status`;case`read_skill`:{let e=pC(n?.name);return e?`$${e}`:`Skill`}case`scrape_url`:case`screenshot_url`:return pC(n?.url)??`URL`;case`parse_file`:return pC(n?.path)??pC(n?.url)??`File`;case`update_artifact`:return pC(n?.title)??`Updated artifact`;case`web_search`:return pC(n?.query)??`Web search`;default:return dP(e)}}function hP(e){let t=pC(e?.merchantName)??`Any merchant`,n=pC(e?.amountCap),r=pC(e?.currency)??``,i=pC(e?.frequency)??``;return`${t}${n?` · ${n} ${r}`.trimEnd():``}${i&&i!==`one_time`?` ${i}`:``}`}function gP(e){let t=pC(e?.description)??`Charge`,n=pC(e?.amount),r=pC(e?.currency)??``;return n?`${t} · ${n} ${r}`.trimEnd():t}var _P=[`*** Add File: `,`*** Copy File: `,`*** Delete File: `,`*** Update File: `],vP=[`*** Copy to: `,`*** Move to: `];function yP(e){let t=e.lastIndexOf(` "b/`);if(t>=0)return e.slice(t+4).replace(/"$/,``);let n=e.lastIndexOf(` b/`);return n>=0?e.slice(n+3):null}function bP(e,t){let n=$S(e)?e:void 0,r=$S(t)?t:void 0;return pC(n?.path)??pC(n?.localPath)??pC(r?.localPath)??pC(r?.path)??pC(r?.title)??pC(n?.title)??pC(n?.artifactId)??`Artifact`}function xP(e){let t=Array.isArray(e)?e:$S(e)&&Array.isArray(e.artifacts)?e.artifacts:void 0;if(t===void 0)return`Artifacts`;let n=t.length;return n===1?`1 artifact`:`${n} artifacts`}function SP(e){let t=$S(e)?pC(e.patch):void 0;if(!t)return null;let n=[];for(let e of t.split(`
435
- `)){if(e.startsWith(`diff --git `)){let t=yP(e);t!==null&&n.push(t);continue}let t=_P.find(t=>e.startsWith(t));if(t){n.push(e.slice(t.length).trim());continue}let r=vP.find(t=>e.startsWith(t));r&&n.length>0&&(n[n.length-1]=e.slice(r.length).trim())}let r=[...new Set(n)];return r.length>0?r.join(`
436
- `):null}function CP(e){if(!$S(e)||!Array.isArray(e.changes))return null;let t=e.changes.flatMap(e=>{if(!$S(e))return[];let t=pC(e.path);return t?[t]:[]});return t.length===0?null:[...new Set(t)].join(`
437
- `)}function wP(e){return e.job?.kind===`apply_patch`?CP(e.job.result)??SP(e.job.payload):e.name===`apply_patch`?SP(e.input):null}function TP(e,t){if(e===`web_search`&&$S(t)&&Array.isArray(t.results)){let e=t.results.length;return` (${e} result${e===1?``:`s`})`}return``}function EP(e,t){let n=e.job?.kind??e.name;return dC(n)?DC(e,t)??mP(n,e.job?.payload??e.input):n===`list_artifacts`?xP(e.job?.result??e.output):n===`add_artifact`||n===`edit_artifact`||n===`save_artifact`||n===`delete_artifact`||n===`create_artifact`?bP(e.job?.payload??e.input,e.job?.result??e.output):e.job?wP(e)||mP(e.job.kind,e.job.payload)+TP(e.job.kind,e.job.result):mP(e.name,e.input)}function DP(e){switch(e){case`apply_patch`:return x_;case`ask_question`:return $g;case`await_question`:case`poll_question`:return F_;case`spawn_subagent`:case`control_subagent`:case`poll_subagent`:return Fg;case`list_subagents`:case`list_subagent_models`:return z_;case`check_docs`:return Ng;case`add_artifact`:case`create_artifact`:return y_;case`delete_artifact`:return Dv;case`save_artifact`:return av;case`exec_command`:case`exec_cmd`:return Cv;case`control_command`:case`control_cmd`:case`poll_command`:case`poll_cmd`:return _v;case`get_workspace_instructions`:return sv;case`mandate_charge`:return Zg;case`mandate_list`:return z_;case`mandate_report`:return jv;case`mandate_setup`:return a_;case`mandate_status`:return z_;case`read_skill`:return q_;case`scrape_url`:return N_;case`screenshot_url`:return zg;case`edit_artifact`:case`list_artifacts`:case`update_artifact`:case`parse_file`:return C_;case`web_search`:return lv;case`write_stdin`:return _v;default:return Nv}}function OP(e){return DP(e.job?.kind??e.name)}function kP({tools:e,inProgress:t,commands:n}){return(0,R.jsx)(`div`,{className:`text-muted-foreground space-y-1.5 text-[13px] leading-6`,children:e.map(e=>{let r=e.job?.kind??e.name,i=OP(e),a=EP(e,n),o=r===`apply_patch`?a.split(`
438
- `):[a],s=fP(r),c=AC(e,t),l=kC(e,t),u=l===`failed`?`text-destructive`:`text-amber-800 dark:text-amber-200`;return(0,R.jsxs)(`div`,{"data-tool-kind":r,className:`min-w-0 space-y-1.5`,children:[o.map((e,t)=>(0,R.jsxs)(`div`,{"data-tool-row":!0,"data-work-detail":!0,className:`flex min-w-0 items-start gap-1.5`,children:[(0,R.jsx)(i,{className:`mt-1 size-3.5 shrink-0`,"aria-hidden":`true`}),s?(0,R.jsxs)(`span`,{className:`shrink-0`,children:[s,e?`:`:``]}):null,e?(0,R.jsx)(`span`,{className:`min-w-0 truncate`,children:e}):null,c&&l&&t===o.length-1?(0,R.jsxs)(`span`,{className:`shrink-0 ${u}`,children:[`(`,l===`cancelled`?`stopped`:l,`)`]}):null]},t)),c&&l?(0,R.jsx)(`p`,{"data-work-detail":!0,className:`pl-5 text-xs leading-5 wrap-break-word whitespace-pre-wrap ${u}`,role:`status`,children:c}):null]},e.callId)})})}function AP({inProgress:e,startedAtMs:t,completedAtMs:n,children:r}){let[i,a]=(0,F.useState)(!1),o=lx(e),s=ux(t,e?o:n),c=`${e?`Working`:`Worked`}${s===void 0?``:` for ${ix(s)}`}`;return(0,R.jsxs)(`div`,{className:`text-muted-foreground text-sm`,children:[(0,R.jsxs)(`button`,{type:`button`,className:`text-muted-foreground hover:text-muted-foreground inline-flex items-center gap-1 transition`,onClick:()=>a(e=>!e),"aria-expanded":i,children:[(0,R.jsx)(`span`,{children:c}),(0,R.jsx)(qg,{className:`size-3.5 shrink-0 transition-transform ${i?`rotate-90`:``}`,"aria-hidden":`true`})]}),i?(0,R.jsx)(`div`,{className:`mt-1.5 space-y-2`,children:r}):null]})}function jP(e){return e.type===`tool-call`||e.type===`tool-result`?`${e.type}:${e.callId}`:`${e.type}:${e.turnId??``}:${e.id}`}var MP=class{load;changed;commit;parts=[];previousBefore;nextAfter;loading=!1;indexing=!1;stale=!1;error=!1;start={};initialized=!1;stopped=!1;refreshPending=!1;failedDirection;request;retry;constructor(e,t,n){this.load=e,this.changed=t,this.commit=n}stop(){this.stopped=!0,this.request?.abort(),clearTimeout(this.retry)}refresh(){if(this.loading){this.refreshPending=!0;return}return this.fetch()}more(e){if(!(!this.initialized||this.loading||this.error||this.indexing)&&(e===`older`?this.previousBefore:this.nextAfter)!==void 0)return this.fetch(e)}retryFailed(){if(!this.loading)return this.fetch(this.failedDirection)}async fetch(e){if(this.stopped)return;clearTimeout(this.retry);let t=new AbortController;this.request=t,this.loading=!0,this.indexing=!1,this.error=!1,this.failedDirection=e,this.changed();try{let n=e===`older`?{before:this.previousBefore}:e===`newer`?{after:this.nextAfter}:this.start,r=this.parts.length?jP(this.parts[this.parts.length-1]):void 0,i=[];for(;;){let a=await this.load(n,t.signal);if(t.signal.aborted)return;if(a.indexing||a.stale&&!a.parts.length||i.length&&a.revision<i[i.length-1].revision){this.stale=a.stale,this.indexing=!0,this.retry=setTimeout(()=>void this.fetch(e),500);return}if(n.after!==void 0&&a.nextAfter!==void 0&&a.nextAfter<=n.after||n.before!==void 0&&a.previousBefore!==void 0&&a.previousBefore>=n.before)throw Error(`Work detail cursor did not advance.`);if(i.push(a),e||!r||a.parts.some(e=>jP(e)===r)||a.nextAfter===void 0||this.nextAfter!==void 0&&a.nextAfter>=this.nextAfter)break;if(i.length>this.parts.length)throw Error(`Work detail range changed too much.`);n={after:a.nextAfter}}let a=i[0],o=i[i.length-1],s=i.flatMap(e=>e.parts);await this.commit(()=>{if(t.signal.aborted)return;let n=e===`older`?[...s,...this.parts]:e===`newer`?[...this.parts,...s]:s,r=new Map(s.map(e=>[jP(e),e]));this.parts=[...new Map(n.map(e=>[jP(e),r.get(jP(e))??e])).values()],e!==`newer`&&(this.previousBefore=a.previousBefore,this.start=a.previousBefore===void 0?{}:{after:a.previousBefore-1}),e!==`older`&&(this.nextAfter=o.nextAfter),this.initialized=!0,this.stale=i.some(e=>e.stale),this.changed()},e),!this.stopped&&this.stale&&(this.retry=setTimeout(()=>void this.refresh(),2e3))}catch{t.signal.aborted||(this.error=!0)}finally{this.loading=!1,this.stopped||(this.changed(),this.refreshPending&&(this.refreshPending=!1,this.refresh()))}}},NP=3,PP=2;function FP({row:e,load:t,inProgress:n,commands:r,viewport:i,beforeChange:a}){let[o,s]=(0,F.useState)(0),c=(0,F.useRef)(null),l=(0,F.useRef)(null),u=(0,F.useRef)(null),d=(0,F.useRef)(0),f=(0,F.useRef)(`newer`),p=(0,F.useRef)({older:0,newer:0}),m=(0,F.useRef)(t),h=(0,F.useRef)(e),g=(0,F.useRef)(n),_=(0,F.useRef)(a),v=(0,F.useRef)(i);(0,F.useLayoutEffect)(()=>{m.current=t,h.current=e,g.current=n,_.current=a,v.current=i});function y(e){let t=v.current;if(!t||!e)return 1/0;let n=t.getBoundingClientRect(),r=e.getBoundingClientRect();return r.bottom<n.top?n.top-r.bottom:r.top>n.bottom?r.top-n.bottom:0}let b=(0,F.useRef)(null);b.current||=new MP((e,t)=>m.current(h.current,e,t),()=>s(e=>e+1),async(e,t)=>{let n=p.current,r=t?y(t===`older`?l.current:u.current):void 0,i=_.current(g.current&&t!==`older`);(0,AN.flushSync)(e),i(),d.current=v.current?.scrollTop??0,t&&r!==void 0&&(n[t]=y(t===`older`?l.current:u.current)<=r+1?n[t]+1:0)});let x=b.current,S={parts:x.parts,loading:x.loading,indexing:x.indexing,error:x.error,stale:x.stale,previousBefore:x.previousBefore,nextAfter:x.nextAfter},C=jC(S.parts,[]),w=C.filter(e=>e.type===`tool`),T=OC(_C(C).filter(e=>e.type!==`text`),n),E=new Map([...r,...EC(w)]),D=(0,F.useRef)(null);D.current||=new NC;let ee=D.current.reconcileBlocks(e.id,T.settledBlocks);function O(){let e=p.current;if(!i||i.clientHeight<=0||x.loading||x.error||x.indexing)return;let t=f.current===`older`?[`older`,`newer`]:[`newer`,`older`];for(let n of t)if(!((n===`older`?x.previousBefore:x.nextAfter)===void 0||e[n]>=PP)&&!(y(n===`older`?l.current:u.current)>i.clientHeight*NP)){x.more(n);return}}let te=(0,F.useRef)(O);return(0,F.useLayoutEffect)(()=>{te.current=O}),(0,F.useLayoutEffect)(()=>{n&&(p.current.newer=0),x.refresh()},[x,n,e.revision]),(0,F.useEffect)(()=>()=>x.stop(),[x]),(0,F.useLayoutEffect)(()=>{te.current()},[o]),(0,F.useLayoutEffect)(()=>{let e=i,t=l.current,n=u.current;if(!e||!t||!n)return;let r=p.current;d.current=e.scrollTop;function a(){if(!e||e.scrollTop===d.current)return;let t=e.scrollTop<d.current?`older`:`newer`;d.current=e.scrollTop,f.current=t,r[t]=0,te.current()}let o=globalThis.IntersectionObserver?new IntersectionObserver(()=>te.current(),{root:e,rootMargin:`${e.clientHeight*NP}px 0px`}):void 0,s=globalThis.ResizeObserver?new ResizeObserver(()=>{r.older=0,r.newer=0,te.current()}):void 0;return o?.observe(t),o?.observe(n),c.current&&s?.observe(c.current),s?.observe(e),e.addEventListener(`scroll`,a),()=>{o?.disconnect(),s?.disconnect(),e.removeEventListener(`scroll`,a)}},[i]),(0,R.jsxs)(`div`,{ref:c,"aria-busy":S.loading||S.indexing,children:[(0,R.jsx)(`div`,{ref:l,"data-work-edge":`older`,className:`h-px`,"aria-hidden":`true`}),S.stale?(0,R.jsx)(`p`,{role:`status`,children:`Showing saved details while reconnecting.`}):null,(0,R.jsxs)(`div`,{className:`space-y-2`,children:[ee.map(({block:e,renderKey:t})=>(0,R.jsx)(`div`,{"data-work-detail":!0,children:e.type===`reasoning`?(0,R.jsx)(uP,{text:e.text,inProgress:!1}):(0,R.jsx)(kP,{tools:e.tools,inProgress:n,commands:E})},t)),T.runningTools.length>0?(0,R.jsx)(`div`,{"data-work-detail":!0,children:(0,R.jsx)(kP,{tools:T.runningTools,inProgress:n,commands:E})}):null]}),S.error?(0,R.jsxs)(`p`,{role:`status`,children:[`Could not load these details.`,` `,(0,R.jsx)(`button`,{className:`underline`,onClick:()=>{p.current.older=0,p.current.newer=0,x.retryFailed()},children:`Retry`})]}):(S.loading||S.indexing)&&S.parts.length===0?(0,R.jsx)(`p`,{role:`status`,children:`Loading details...`}):null,(0,R.jsx)(`div`,{ref:u,"data-work-edge":`newer`,className:`h-px`,"aria-hidden":`true`})]})}function IP(e){if((e.job?.kind??e.name)!==`mandate_setup`)return;let t=e.output;if(!$S(t))return;let n=pC(t.mandateId),r=pC(t.approvalUrl);if(n&&r)return{mandateId:n,approvalUrl:r}}function LP(e){let t=e.job?.payload??e.input;if(!$S(t))return;let n=pC(t.description)?.trim();if(n)return n;let r=pC(t.merchantName)?.trim();if(r)return r}function RP(e){return e.flatMap(e=>{let t=IP(e);return t?[{...t,label:LP(e)}]:[]})}var zP=28,BP=3,VP=3;function HP(e,t){return e===void 0?t:t===void 0?e:Math.min(e,t)}function UP(e,t){return e===void 0?t:t===void 0?e:Math.max(e,t)}function WP({userId:e,messages:t,actions:n,activeRunId:r,project:i,emptyStateMessage:a=i?`Start a thread and ask Sprocket to inspect code, edit files, or run project commands.`:`Add a project to begin.`,loadingOlder:o=!1,nextBefore:s,onLoadOlder:c,loadAttachment:l,loadSectionDetails:u,artifacts:d=[],onOpenArtifact:f}){let p=(0,F.useRef)(null),m=(0,F.useRef)(null),[h,g]=(0,F.useState)(null),_=(0,F.useRef)(!0),v=(0,F.useRef)(0),y=(0,F.useRef)(void 0),b=(0,F.useRef)(void 0),x=(0,F.useRef)(VP),[S,C]=(0,F.useState)(null),[w,T]=(0,F.useState)(null),E=(0,F.useRef)(null),[D,ee]=(0,F.useState)(()=>new Map),O=(0,F.useCallback)(e=>{e.size!==0&&ee(t=>[...e].every(([e,n])=>t.get(e)===n)?t:new Map([...t,...e]))},[]),te=(0,F.useMemo)(()=>EC([...jC([],n),...t.flatMap(e=>e.kind===`live`?jC(e.parts,[]):[])].filter(e=>e.type===`tool`)),[t,n]);(0,F.useLayoutEffect)(()=>O(te),[te,O]);let ne=(0,F.useMemo)(()=>new Map([...D,...te]),[D,te]),re=(0,F.useMemo)(()=>u?async(e,t,n)=>{let r=await u(e,t,n);if(!n.aborted){let e=jC(r.parts,[]).filter(e=>e.type===`tool`);O(EC(e))}return r}:void 0,[u,O]),ie=(0,F.useRef)(null);ie.current||=new NC;let k=ie.current;function ae(e){let t=n.filter(t=>t.runId===e.runId&&e.parts.some(e=>e.type===`tool-call`&&e.callId===t.callId)),i=jC(e.parts,t);return{timeline:i,sections:k.reconcile(e.id,bC(_C(i))),isStreaming:hC(e,r)}}function A(e,t,n){let{settledBlocks:r,runningTools:i}=OC(t.blocks,e.isStreaming),a=e.isStreaming&&(n===e.sections.length-1||i.length>0),o=e.sections[n+1];return{settledBlocks:r,lastBlock:t.blocks.at(-1),runningTools:i,workInProgress:a,approvals:r.flatMap(e=>e.type===`tool-group`?RP(e.tools):[]),timing:xC(t,{inProgress:a,endedAt:o?.type===`text`?o.startedAt??void 0:void 0})}}function oe(e,n){for(let r of t.slice(e+1))if(r.kind!==`approval`||r.runId!==n)return r.kind===`live`&&r.runId===n?ae(r):void 0}function se(e,n){for(let r=e-1;r>=0;--r){let e=t[r];if(e.kind!==`approval`||e.runId!==n)return e.kind===`work`&&e.runId===n&&!e.closed}return!1}function ce(e){let t=[...e.querySelectorAll(`[data-transcript-anchor], [data-work-detail]`)].filter(e=>!e.querySelector(`[data-work-detail]`)),n=e.getBoundingClientRect().top,r=0,i=t.length;for(;r<i;){let e=Math.floor((r+i)/2);t[e].getBoundingClientRect().bottom<=n?r=e+1:i=e}return t[r]}function le(e,t){e.scrollTop!==t&&(e.scrollTop=t),v.current=e.scrollTop}function ue(){let e=p.current;if(!e||!_.current)return;let t=Math.max(0,e.scrollHeight-e.clientHeight);if(e.scrollTop+1<Math.min(v.current,t)){_.current=!1;return}le(e,t)}function de(){let e=p.current;e&&s!==void 0&&s!==b.current&&!o&&c&&x.current>0&&e.clientHeight>0&&e.scrollTop<=e.clientHeight*BP&&(--x.current,b.current=s,c())}function fe(){_.current=!1,x.current=VP,de()}function pe(){let e=p.current;if(!e)return;if(e.scrollTop===v.current){de();return}let t=Math.max(0,e.scrollHeight-e.clientHeight),n=e.scrollTop<v.current,r=v.current>t&&Math.abs(e.scrollTop-t)<1;if(v.current=e.scrollTop,x.current=VP,!r){let r=t-e.scrollTop;_.current=!n&&r<=zP,n&&fe()}de()}function me(e){e.target instanceof Element&&e.target.closest(`input, textarea, button, [contenteditable="true"]`)||(e.key===`ArrowUp`||e.key===`PageUp`||e.key===`Home`||e.key===` `&&e.shiftKey)&&fe()}function he(e){e||(_.current=!1);let t=p.current,n=t&&!_.current?ce(t):void 0,r=n?.getBoundingClientRect().top,i=t?.scrollTop;return()=>{t&&t===p.current&&(_.current?ue():n?.isConnected&&r!==void 0&&t.scrollTop===i&&le(t,t.scrollTop+n.getBoundingClientRect().top-r))}}let ge=(0,F.useRef)(ue),_e=(0,F.useRef)(de);(0,F.useLayoutEffect)(()=>{ge.current=ue,_e.current=de}),(0,F.useLayoutEffect)(()=>{_e.current()},[t,s,o,h]),(0,F.useLayoutEffect)(()=>{let e=h,t=m.current;if(!e||!t||!globalThis.ResizeObserver)return;let n=new ResizeObserver(()=>{ge.current(),_e.current()});return n.observe(e),n.observe(t),()=>{n.disconnect()}},[h]);let ve=(0,F.useRef)(t),ye=(0,F.useRef)(n),j=(0,F.useRef)(null);if(ve.current!==t||ye.current!==n){ve.current=t,ye.current=n;let e=p.current,r=e&&!_.current?ce(e):void 0;j.current=e&&r?{anchor:r,offset:r.getBoundingClientRect().top,scrollTop:e.scrollTop,scrollHeight:e.scrollHeight}:null}(0,F.useLayoutEffect)(()=>{let e=p.current;if(!e)return;if(_.current){ge.current();return}let t=j.current;if(j.current=null,!t)return;let{anchor:n,offset:r,scrollTop:i,scrollHeight:a}=t;n.isConnected&&e.scrollTop===i?le(e,i+n.getBoundingClientRect().top-r):!n.isConnected&&e.scrollTop===i&&le(e,i+e.scrollHeight-a)},[t,n]);async function M(e,t){try{await navigator.clipboard.writeText(t),T(e),E.current!==null&&clearTimeout(E.current),E.current=setTimeout(()=>{T(t=>t===e?null:t),E.current=null},1500)}catch{T(null)}}(0,F.useLayoutEffect)(()=>()=>{E.current!==null&&clearTimeout(E.current)},[]),(0,F.useLayoutEffect)(()=>{k.retain(t.filter(e=>e.kind===`live`).map(e=>e.id))},[t,k]);let be=(0,F.useCallback)(e=>{p.current=e,g(e)},[]);function xe(e,t){return(0,R.jsxs)(R.Fragment,{children:[e.settledBlocks.map((n,r)=>{let i=`${n.type}-${n.type===`tool-group`?n.tools.map(e=>e.callId).join(`,`):n.id}-${r}`;if(n.type===`reasoning`){let t=e.workInProgress&&e.runningTools.length===0&&n===e.lastBlock;return(0,R.jsx)(uP,{text:n.text,inProgress:t},i)}return(0,R.jsx)(kP,{tools:n.tools,inProgress:t.isStreaming,commands:ne},i)}),e.runningTools.length>0?(0,R.jsx)(kP,{tools:e.runningTools,inProgress:t.isStreaming,commands:ne}):null]})}function N(t,n){let a={workspacePath:i?.workspacePath,transcript:e?{userId:e,threadId:t.threadId}:void 0};if(t.kind===`prompt`)return(0,R.jsx)(cP,{message:t,imageScope:a,copied:w===t.id,loadAttachment:l,onCopy:()=>void M(t.id,t.text??``),onOpenImage:C},t.id);if(t.kind===`work`){let e=t,i=e.closed?void 0:oe(n,e.runId),a=i?.sections[0],o=i&&a?.type===`work`?A(i,a,0):void 0,s=o?o.workInProgress:a?.type!==`text`&&e.runId===r&&(!e.closed||e.pendingTools>0),c=HP(e.startedAt,o?.timing.startedAtMs),l=UP(e.completedAt,o?.timing.completedAtMs??(a?.type===`text`?a.startedAt??void 0:void 0));return(0,R.jsx)(`div`,{"data-message-id":t.id,"data-transcript-anchor":t.id,"data-message-kind":`work`,children:(0,R.jsxs)(AP,{inProgress:s,startedAtMs:c,completedAtMs:l,children:[re?(0,R.jsx)(FP,{row:e,load:re,commands:ne,inProgress:s,viewport:h,beforeChange:he}):null,o&&i?xe(o,i):null]})},t.id)}if(t.kind===`approval`)return!t.mandateId||!t.approvalUrl?null:(0,R.jsx)(`div`,{"data-transcript-anchor":t.id,children:(0,R.jsx)(CS,{approval:{mandateId:t.mandateId,approvalUrl:t.approvalUrl}})},t.id);if(t.kind===`text`)return(0,R.jsx)(`div`,{"data-message-id":t.id,"data-transcript-anchor":t.id,"data-message-kind":`text`,children:(0,R.jsx)(iP,{imageScope:a,content:t.text||` `,className:`text-foreground`,artifacts:d,onOpenArtifact:f,openLinksInNewTab:!0})},t.id);if(t.kind!==`live`)return null;let o=ae(t),s=se(n,t.runId),c=o.timeline.some(e=>e.type===`text`||e.type===`reasoning`);return(0,R.jsx)(`div`,{"data-message-id":t.id,className:`w-full min-w-0`,role:o.isStreaming?`log`:void 0,"aria-live":o.isStreaming?`polite`:void 0,"aria-atomic":`false`,"aria-relevant":`additions text`,children:(0,R.jsxs)(`div`,{className:`space-y-3`,children:[!c&&(t.text||o.isStreaming&&o.timeline.length===0)?(0,R.jsx)(iP,{imageScope:a,content:t.text||`...`,className:`text-foreground`,artifacts:d,onOpenArtifact:f,openLinksInNewTab:!0}):null,o.sections.map((e,n)=>{if(e.type===`text`)return(0,R.jsx)(`div`,{"data-transcript-anchor":`${t.id}:${vC(e)}`,children:(0,R.jsx)(iP,{imageScope:a,content:e.text||` `,className:`text-foreground`,artifacts:d,onOpenArtifact:f,openLinksInNewTab:!0})},e.renderKey);let r=A(o,e,n);return r.settledBlocks.length===0&&!r.workInProgress&&r.runningTools.length===0?null:(0,R.jsxs)(`div`,{className:`space-y-3`,"data-transcript-anchor":`${t.id}:${e.renderKey}`,children:[s&&n===0?null:(0,R.jsx)(AP,{inProgress:r.workInProgress,startedAtMs:r.timing.startedAtMs,completedAtMs:r.timing.completedAtMs,children:xe(r,o)}),r.approvals.map(e=>(0,R.jsx)(CS,{approval:e},e.mandateId))]},e.renderKey)}),!o.isStreaming&&t.runStartedAt>0&&t.runCompletedAt!==void 0?(0,R.jsx)(`p`,{className:`text-muted-foreground text-sm`,children:`Worked for ${ix(Math.max(0,Math.floor((t.runCompletedAt-t.runStartedAt)/1e3)))}`}):null]})},t.id)}return(0,R.jsxs)(`div`,{className:`relative min-h-0 flex-1`,children:[(0,R.jsx)(`div`,{className:`hide-scrollbar h-full overflow-x-hidden overflow-y-auto`,role:`region`,"aria-label":`Conversation history`,tabIndex:0,ref:be,onScroll:pe,onWheel:e=>{e.deltaY<0&&fe()},onKeyDown:me,onTouchStart:e=>{y.current=e.touches[0]?.clientY},onTouchMove:e=>{let t=e.touches[0]?.clientY;t!==void 0&&y.current!==void 0&&t>y.current&&fe(),y.current=t},children:(0,R.jsx)(`div`,{ref:m,className:`mx-auto flex min-h-full w-full max-w-[48rem] flex-col px-4 py-8`,children:t.length===0?a?(0,R.jsx)(`div`,{className:`flex flex-1 items-center justify-center`,children:(0,R.jsx)(`div`,{className:`max-w-2xl text-center`,children:(0,R.jsx)(`p`,{className:`text-muted-foreground text-sm leading-7`,children:a})})}):null:(0,R.jsx)(`div`,{className:`transcript-messages space-y-8 pb-14`,children:t.map((e,t)=>N(e,t))})})}),(0,R.jsx)(`div`,{className:`transcript-fade pointer-events-none absolute inset-x-0 bottom-0 h-16`}),(0,R.jsx)(zN,{image:S,onClose:()=>C(null)})]})}function GP({title:e,onDelete:t,trigger:n,children:r}){let i=(0,F.useId)(),[a,o]=(0,F.useState)(null),[s,c]=(0,F.useState)(!1),[l,u]=(0,F.useState)(null),d=(0,F.useRef)(!1),f=(0,F.useRef)(null),p=(0,F.useRef)(null),m=(0,F.useCallback)(()=>{let e=f.current?.contains(document.activeElement);o(null),e&&p.current?.isConnected&&p.current.focus({preventScroll:!0})},[]);(0,F.useEffect)(()=>{if(!a)return;let e=f.current?.querySelector(`button`);e&&!e.disabled?e.focus():f.current?.focus()},[a,s]),(0,F.useEffect)(()=>{if(!a)return;function e(e){e.target instanceof Node&&(f.current?.contains(e.target)||n===`button`&&p.current?.contains(e.target)||m())}function t(e){e.key===`Escape`?(e.preventDefault(),e.stopImmediatePropagation(),m()):e.key===`Tab`&&m()}function r(){o(null)}return document.addEventListener(`mousedown`,e),window.addEventListener(`blur`,r),window.addEventListener(`keydown`,t,!0),window.addEventListener(`resize`,m),window.addEventListener(`scroll`,m,!0),()=>{document.removeEventListener(`mousedown`,e),window.removeEventListener(`blur`,r),window.removeEventListener(`keydown`,t,!0),window.removeEventListener(`resize`,m),window.removeEventListener(`scroll`,m,!0)}},[a,m,n]);function h(e,t,n){p.current=e,o({x:Math.max(8,Math.min(t,window.innerWidth-240)),y:Math.max(8,Math.min(n,window.innerHeight-140))})}function g(e){let t=e.getBoundingClientRect();h(e,t.right-224,t.bottom+4)}async function _(){if(t&&!d.current){d.current=!0,c(!0),u(null);try{await t(),m()}catch(e){u(e instanceof Error?e.message:`Unable to delete artifact.`)}finally{d.current=!1,c(!1)}}}return(0,R.jsxs)(`div`,{className:`contents`,onContextMenu:e=>{if(!t||n!==`context`)return;let r=e.currentTarget.querySelector(`button`);r&&(e.preventDefault(),e.stopPropagation(),h(r,e.clientX,e.clientY))},onKeyDown:e=>{if(!t||n!==`context`||!(e.key===`ContextMenu`||e.shiftKey&&e.key===`F10`))return;let r=e.currentTarget.querySelector(`button`);if(!r)return;e.preventDefault(),e.stopPropagation();let i=r.getBoundingClientRect();h(r,i.left,i.bottom)},children:[n===`context`?r:(0,R.jsx)(`button`,{type:`button`,"aria-label":`${e} actions`,title:`Artifact actions`,"aria-haspopup":`menu`,"aria-expanded":!!a,"aria-controls":a?i:void 0,className:`text-muted-foreground hover:bg-muted hover:text-foreground focus-visible:ring-ring shrink-0 rounded-md p-1.5 transition outline-none focus-visible:ring-2`,onClick:e=>{if(a){m();return}g(e.currentTarget)},onKeyDown:e=>{e.key===`ArrowDown`&&(e.preventDefault(),g(e.currentTarget))},children:(0,R.jsx)(l_,{className:`size-4`,"aria-hidden":`true`})}),l&&!a&&(0,AN.createPortal)((0,R.jsxs)(`div`,{role:`alert`,className:`bg-popover text-popover-foreground fixed right-4 bottom-4 z-250 w-80 max-w-[calc(100vw-2rem)] rounded-md border p-3 shadow-md`,children:[(0,R.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,R.jsx)(`p`,{className:`text-destructive text-sm font-medium`,children:`Artifact deletion failed`}),(0,R.jsx)(`button`,{type:`button`,"aria-label":`Dismiss deletion error`,className:`text-muted-foreground hover:text-foreground focus-visible:ring-ring rounded-sm p-1 outline-none focus-visible:ring-2`,onClick:()=>{u(null),p.current?.focus({preventScroll:!0})},children:(0,R.jsx)(Fv,{className:`size-3.5`,"aria-hidden":`true`})})]}),(0,R.jsxs)(`p`,{className:`mt-1 text-sm wrap-break-word`,children:[e,`: `,l]}),(0,R.jsx)(`p`,{className:`text-muted-foreground mt-2 text-xs`,children:`Open the artifact menu to try again.`})]}),document.body),a&&(0,AN.createPortal)((0,R.jsxs)(`div`,{id:i,ref:f,role:`menu`,tabIndex:-1,"aria-label":`${e} actions`,className:`bg-popover text-popover-foreground fixed z-250 w-56 rounded-md border p-1 shadow-md`,style:{left:a.x,top:a.y},children:[(0,R.jsxs)(`button`,{type:`button`,role:`menuitem`,disabled:s,className:`text-destructive hover:bg-muted focus:bg-muted flex w-full items-center gap-2 rounded-sm px-2 py-1.5 text-left text-sm outline-none disabled:opacity-50`,onClick:()=>void _(),children:[(0,R.jsx)(Dv,{className:`size-4`,"aria-hidden":`true`}),s?`Deleting…`:`Delete artifact`]}),l&&(0,R.jsx)(`p`,{role:`alert`,className:`px-2 py-1 text-xs`,children:l})]}),document.body)]})}zd([`markdown`,`html`,`react`]);function KP(e){return e.replace(/<\/(script)/gi,`<\\/$1`).replace(/<!--/g,`<\\!--`)}function qP(e,t){return`<!DOCTYPE html>
433
+ `,languages:[`r`]},{name:`Scala`,svg:`<svg version="1.0" viewBox="0 0 128 128" xmlns="http://www.w3.org/2000/svg"><path d="M25 110.437V94.874h5.616c3.113 0 8.052-.203 11.03-.474l5.278-.406-7.038-1.894c-3.924-1.015-8.864-2.504-10.961-3.316L25 87.364V55.627h6.293c3.383 0 8.323-.203 10.894-.473l4.737-.406-8.323-2.233C34 51.366 29.128 49.809 27.639 49.2L25 47.982v-30.72l2.098-.473c1.15-.203 3.992-.406 6.293-.406 11.367 0 38.366-3.722 51.628-7.105 9.27-2.436 15.698-4.872 17.931-6.902 1.15-1.015 1.218-.406 1.218 14.548v15.63l-1.624 1.219-1.624 1.285 3.248 2.842v33.9l-1.624 1.218-1.624 1.286 3.248 2.842v33.9l-1.76 1.353c-1.894 1.489-9.202 3.993-17.524 6.09C71.892 121.737 40.157 126 29.33 126H25z" fill="#390d09"/><g fill="#de3423"><path d="M25 110.572V95.077l11.842-.474c12.315-.473 21.45-1.488 34.847-3.789 15.225-2.639 30.246-7.375 31.803-10.082.406-.677.676 4.534.676 14.616v15.698l-1.76 1.353c-1.894 1.489-9.202 3.993-17.524 6.09C71.892 121.737 40.157 126 29.33 126H25zM25 71.327V55.83l11.842-.406c13.127-.541 23.344-1.691 36.877-4.195 15.157-2.842 28.96-7.443 29.976-9.947.203-.473.406 6.09.406 14.616.067 13.533-.068 15.698-1.083 16.78-2.368 2.64-20.638 7.376-39.449 10.286-11.435 1.76-30.381 3.79-35.66 3.79H25zM25 32.352V17.195l2.098-.406c1.15-.203 3.992-.406 6.293-.406 11.367 0 38.366-3.722 51.628-7.105 9.27-2.436 15.698-4.872 17.931-6.902 1.15-1.015 1.218-.406 1.218 14.48 0 14.548-.067 15.63-1.285 16.714-1.827 1.691-14.345 5.548-24.09 7.51-15.765 3.113-41.951 6.429-50.883 6.429H25z"/></g></svg>`,languages:[`scala`]},{name:`Elixir`,svg:`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 128 128"><linearGradient id="elixir-original-a" gradientUnits="userSpaceOnUse" x1="835.592" y1="-36.546" x2="821.211" y2="553.414" gradientTransform="matrix(.1297 0 0 .2 -46.03 17.198)"><stop offset="0" stop-color="#d9d8dc"/><stop offset="1" stop-color="#fff" stop-opacity=".385"/></linearGradient><path fill-rule="evenodd" clip-rule="evenodd" fill="url(#elixir-original-a)" d="M64.4.5C36.7 13.9 1.9 83.4 30.9 113.9c26.8 33.5 85.4 1.3 68.4-40.5-21.5-36-35-37.9-34.9-72.9z"/><linearGradient id="elixir-original-b" gradientUnits="userSpaceOnUse" x1="942.357" y1="-40.593" x2="824.692" y2="472.243" gradientTransform="matrix(.1142 0 0 .2271 -47.053 17.229)"><stop offset="0" stop-color="#8d67af" stop-opacity=".672"/><stop offset="1" stop-color="#9f8daf"/></linearGradient><path fill-rule="evenodd" clip-rule="evenodd" fill="url(#elixir-original-b)" d="M64.4.2C36.8 13.6 1.9 82.9 31 113.5c10.7 12.4 28 16.5 37.7 9.1 26.4-18.8 7.4-53.1 10.4-78.5C68.1 33.9 64.2 11.3 64.4.2z"/><linearGradient id="elixir-original-c" gradientUnits="userSpaceOnUse" x1="924.646" y1="120.513" x2="924.646" y2="505.851" gradientTransform="matrix(.1227 0 0 .2115 -46.493 17.206)"><stop offset="0" stop-color="#26053d" stop-opacity=".762"/><stop offset="1" stop-color="#b7b4b4" stop-opacity=".278"/></linearGradient><path fill-rule="evenodd" clip-rule="evenodd" fill="url(#elixir-original-c)" d="M56.7 4.3c-22.3 15.9-28.2 75-24.1 94.2 8.2 48.1 75.2 28.3 69.6-16.5-6-29.2-48.8-39.2-45.5-77.7z"/><linearGradient id="elixir-original-d" gradientUnits="userSpaceOnUse" x1="428.034" y1="198.448" x2="607.325" y2="559.255" gradientTransform="matrix(.1848 0 0 .1404 -42.394 17.138)"><stop offset="0" stop-color="#91739f" stop-opacity=".46"/><stop offset="1" stop-color="#32054f" stop-opacity=".54"/></linearGradient><path fill-rule="evenodd" clip-rule="evenodd" fill="url(#elixir-original-d)" d="M78.8 49.8c10.4 13.4 12.7 22.6 6.8 27.9-27.7 19.4-61.3 7.4-54-37.3C22.1 63 4.5 96.8 43.3 101.6c20.8 3.6 54 2 58.9-16.1-.2-15.9-10.8-22.9-23.4-35.7z"/><linearGradient id="elixir-original-e" gradientUnits="userSpaceOnUse" x1="907.895" y1="540.636" x2="590.242" y2="201.281" gradientTransform="matrix(.1418 0 0 .1829 -45.23 17.18)"><stop offset="0" stop-color="#463d49" stop-opacity=".331"/><stop offset="1" stop-color="#340a50" stop-opacity=".821"/></linearGradient><path fill-rule="evenodd" clip-rule="evenodd" fill="url(#elixir-original-e)" d="M38.1 36.4c-2.9 21.2 35.1 77.9 58.3 71-17.7 35.6-56.9-21.2-64-41.7 1.5-11 2.2-16.4 5.7-29.3z"/><linearGradient id="elixir-original-f" gradientUnits="userSpaceOnUse" x1="1102.297" y1="100.542" x2="1008.071" y2="431.648" gradientTransform="matrix(.106 0 0 .2448 -47.595 17.242)"><stop offset="0" stop-color="#715383" stop-opacity=".145"/><stop offset="1" stop-color="#f4f4f4" stop-opacity=".234"/></linearGradient><path fill-rule="evenodd" clip-rule="evenodd" fill="url(#elixir-original-f)" d="M60.4 49.7c.8 7.9 3.9 20.5 0 28.8S38.7 102 43.6 115.3c11.4 24.8 37.1-4.4 36.9-19 1.1-11.8-6.6-38.7-1.8-52.5L76.5 41l-13.6-4c-2.2 3.2-3 7.5-2.5 12.7z"/><linearGradient id="elixir-original-g" gradientUnits="userSpaceOnUse" x1="1354.664" y1="140.06" x2="1059.233" y2="84.466" gradientTransform="matrix(.09173 0 0 .2828 -48.536 17.28)"><stop offset="0" stop-color="#a5a1a8" stop-opacity=".356"/><stop offset="1" stop-color="#370c50" stop-opacity=".582"/></linearGradient><path fill-rule="evenodd" clip-rule="evenodd" fill="url(#elixir-original-g)" d="M65.3 10.8C36 27.4 48 53.4 49.3 81.6l19.1-55.4c-1.4-5.7-2.3-9.5-3.1-15.4z"/><path fill-rule="evenodd" clip-rule="evenodd" fill="#330A4C" fill-opacity=".316" d="M68.3 26.1c-14.8 11.7-14.1 31.3-18.6 54 8.1-21.3 4.1-38.2 18.6-54z"/><path fill-rule="evenodd" clip-rule="evenodd" fill="#FFF" d="M45.8 119.7c8 1.1 12.1 2.2 12.5 3 .3 4.2-11.1 1.2-12.5-3z"/><path fill-rule="evenodd" clip-rule="evenodd" fill="#EDEDED" fill-opacity=".603" d="M49.8 10.8c-6.9 7.7-14.4 21.8-18.2 29.7-1 6.5-.5 15.7.6 23.5.9-18.2 7.5-39.2 17.6-53.2z"/></svg>`,languages:[`elixir`,`ex`]},{name:`Haskell`,svg:`<svg viewBox="0 0 128 128" xmlns="http://www.w3.org/2000/svg"><path fill="#463B63" d="M0 110.2L30.1 65 0 19.9h22.6L52.7 65l-30.1 45.1H0z"/><path fill="#5E5187" d="M30.1 110.2L60.2 65 30.1 19.9h22.6l60.2 90.3H90.4L71.5 81.9l-18.8 28.2H30.1z"/><path fill="#904F8C" d="M102.9 83.8l-10-15.1H128v15.1h-25.1zM87.8 61.3l-10-15.1H128v15.1H87.8z"/></svg>`,languages:[`haskell`,`hs`]},{name:`Perl`,svg:`<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 128 128"><path d="M121.172 62.878c0-34.048-26.473-61.648-59.135-61.648C29.379 1.23 2.9 28.83 2.9 62.878s26.478 61.651 59.136 61.651c32.662 0 59.135-27.603 59.135-61.651z" fill="#fff"/><path d="M53.34 127.516c-13.91-2.461-25.842-8.812-35.703-19.006C9.25 99.842 3.477 88.928.853 76.763c-1.137-5.256-1.137-20.287 0-25.54C2.629 43 6.075 34.835 10.776 27.714 13.89 23 23.004 13.888 27.716 10.773c7.123-4.7 15.293-8.15 23.514-9.921 5.253-1.137 20.286-1.137 25.543 0C89.58 3.617 100.225 9.4 109.41 18.585c9.187 9.186 14.97 19.828 17.739 32.639 1.133 5.252 1.133 20.283 0 25.54-2.769 12.806-8.552 23.448-17.739 32.634-9.038 9.041-19.55 14.812-32.147 17.65-4.467 1.009-19.238 1.297-23.923.468zm11.567-12.772c0-4.194-.062-4.497-.907-4.497-.838 0-.904.288-.869 3.897.043 4.264.343 5.572 1.211 5.284.401-.132.565-1.491.565-4.684zm-6.757 1.445c1.192-1.196 1.542-1.92 1.542-3.209 0-1.316-.16-1.635-.763-1.519-.417.078-.919.76-1.114 1.507-.194.748-1 1.904-1.783 2.57-1.418 1.196-1.472 2.192-.125 2.192.386 0 1.394-.697 2.243-1.541zm14.943 1.047c.167-.269-.339-1.036-1.122-1.698-.786-.666-1.589-1.822-1.783-2.57-.199-.747-.701-1.429-1.118-1.507-.6-.116-.76.203-.76 1.519 0 2.609 3.743 5.942 4.783 4.256zm-20.66-8.146c0-.261-.634-.822-1.41-1.246-5.054-2.769-10.985-7.176-14.28-10.61-6.433-6.71-9.33-13.388-9.4-21.678-.048-5.54.665-8.43 3.364-13.605 2.609-5.004 5.631-8.78 13.95-17.421 9.287-9.653 11.425-12.2 13.038-15.533 1.148-2.367 1.3-3.231 1.46-8.235.199-6.215-.18-10.506-.927-10.506-.339 0-.401 1.612-.21 5.234.623 11.592-1.53 15.19-14.892 24.881-9.202 6.674-13.424 10.3-16.613 14.264-4.518 5.61-6.52 10.466-7.018 17.05-1.207 15.868 8.848 29.629 26.59 36.385 3.914 1.487 6.348 1.881 6.348 1.02zm30.7-1.285c6.098-2.543 10.736-5.615 15.11-10.007 6.667-6.701 9.439-12.967 9.856-22.242.362-8.134-1.402-13.515-6.437-19.61-3.45-4.173-7.162-7.16-17.174-13.81-13.47-8.953-16.633-12.516-16.633-18.746 0-1.658.3-4.006.662-5.217.623-2.068.608-3.493-.02-1.862-.591 1.546-1.947.837-2.675-1.41l-.7-2.152.264 2.04c.942 7.242 1.06 10.276.642 16.615-.564 8.57-1.616 14.427-4.51 25.076-2.87 10.572-3.387 14.404-3.029 22.476.3 6.825 1.254 11.93 3.474 18.593 2.06 6.183 2.445 6.654 6.235 7.624 2.083.533 4.058 1.433 5.627 2.566 1.476 1.067 2.952 1.76 3.781 1.775.748.012 3.237-.755 5.526-1.709zm-1.371-3.076c-.565-.565-.3-1.048 1.912-3.493 6.97-7.694 10.094-15.641 10.183-25.906.063-6.993-1.483-11.627-6.2-18.593-2.13-3.15-9.634-11.008-13.263-13.893-2.66-2.114-5.398-5.72-5.885-7.76-.494-2.068.892-1.523 2.496.98.787 1.227 2.493 3.03 3.79 4.004 1.296.977 5.132 3.835 8.524 6.355 11.664 8.671 16.859 16.066 18.023 25.672.678 5.556-.397 11.3-3.107 16.634-2.812 5.525-7.937 11.545-12.326 14.477-2.703 1.803-3.556 2.115-4.147 1.523zm-22.837.584c.133-.343-1.036-2.535-2.593-4.875-4.128-6.191-5.924-9.606-7.598-14.454-1.414-4.085-1.492-4.641-1.504-10.883-.015-9.431 1.005-12.422 8.49-24.85 7.057-11.718 8.015-16.258 7.22-34.286-.288-6.46-.611-11.838-.72-11.95-.744-.744-.904 1.172-.627 7.67.545 12.94-.292 20.147-3.018 26.062-1.858 4.026-3.938 7.075-9.53 14.002-7.788 9.637-9.985 14.75-9.946 23.126.031 5.743.806 9.275 3.127 14.185 2.512 5.32 7.135 10.689 12.93 15.011 2.667 1.994 3.391 2.231 3.77 1.242z" fill="#212178"/></svg>`,languages:[`perl`,`pl`]}];function NN({language:e}){let t=e?.toLowerCase()||`text`,n=MN.find(e=>e.languages.includes(t));return(0,R.jsx)(`span`,{className:`markdown-code-language`,title:n?.name||e||`Plain text`,children:n?(0,R.jsx)(`span`,{className:n.monochrome?`markdown-code-language-icon monochrome`:`markdown-code-language-icon`,role:`img`,"aria-label":n.name,dangerouslySetInnerHTML:{__html:n.svg}}):t})}function PN({code:e,language:t,pre:n,target:r}){let[i,a]=(0,F.useState)({status:`idle`}),o=(0,F.useRef)(!1),s=(0,F.useRef)(void 0);(0,F.useEffect)(()=>(o.current=!1,()=>{o.current=!0,clearTimeout(s.current)}),[]);async function c(){let t=e;clearTimeout(s.current),a({status:`copying`});try{if(await navigator.clipboard.writeText(t),o.current)return;a({status:`copied`,code:t}),s.current=setTimeout(()=>a({status:`idle`}),2e3)}catch{o.current||a({status:`failed`})}}let l=i.status===`copied`&&i.code!==e,u=i.status===`failed`?`Retry copying code`:l?`Copy current code`:`Copy code`,d=i.status===`copied`?l?`Copied earlier`:`Copied`:i.status===`failed`?`Copy failed`:i.status===`copying`?`Copying`:`Copy`,[f,p]=(0,F.useState)(!1),m=f?`Disable line wrapping`:`Enable line wrapping`;return(0,F.useEffect)(()=>(n.classList.toggle(`markdown-code-wrap`,f),()=>n.classList.remove(`markdown-code-wrap`)),[n,f]),(0,jN.createPortal)((0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(NN,{language:t}),(0,R.jsxs)(`div`,{className:`markdown-code-actions`,children:[(0,R.jsx)(`button`,{type:`button`,className:`markdown-code-action`,"aria-label":m,"aria-pressed":f,title:m,onClick:()=>p(e=>!e),children:(0,R.jsx)(Tv,{size:16,"aria-hidden":`true`})}),(0,R.jsxs)(`button`,{type:`button`,className:`markdown-code-action`,"aria-label":u,title:d===`Copy`?u:`${d}. ${u}`,disabled:i.status===`copying`,onClick:()=>void c(),children:[i.status===`copied`&&!l?(0,R.jsx)(Ug,{size:16,"aria-hidden":`true`}):i.status===`failed`?(0,R.jsx)(Yg,{size:16,"aria-hidden":`true`}):(0,R.jsx)(r_,{size:16,"aria-hidden":`true`}),(0,R.jsx)(`span`,{className:`sr-only`,role:`status`,children:d})]})]})]}),r)}function FN(e){switch(e){case`image/jpeg`:return`jpg`;case`image/png`:return`png`;case`image/gif`:return`gif`;case`image/webp`:return`webp`;case`image/svg+xml`:return`svg`;case`image/avif`:return`avif`;case`image/bmp`:return`bmp`;default:return}}function IN(e){let t=e.name.trim()||`image`,n=FN(e.mediaType);if(!n)return t;let r=t.match(/\.([a-z0-9]{2,5})$/i);return r?(e.mediaType===`image/jpeg`?[`jpg`,`jpeg`]:[n]).includes(r[1].toLowerCase())?t:`${t.slice(0,-r[0].length)}.${n}`:`${t}.${n}`}async function LN(e){let t=await fetch(e.url,{referrerPolicy:`no-referrer`,credentials:new URL(e.url,window.location.href).pathname===`/api/workspace/image`?`include`:`same-origin`});if(!t.ok)throw Error(`Fetch failed with status ${t.status}`);return t.blob()}async function RN(e){if(e.type===`image/png`)return e;let t=await createImageBitmap(e);try{let e=document.createElement(`canvas`);e.width=t.width,e.height=t.height;let n=e.getContext(`2d`);if(!n)throw Error(`Canvas 2D context unavailable`);return n.drawImage(t,0,0),await new Promise((t,n)=>{e.toBlob(e=>e?t(e):n(Error(`PNG encoding failed`)),`image/png`)})}finally{t.close()}}var zN=`inline-flex size-9 items-center justify-center rounded-lg border border-white/15 bg-black/65 text-white shadow-lg backdrop-blur-sm transition hover:bg-black/80 focus-visible:ring-2 focus-visible:ring-white/50 focus-visible:outline-none aria-disabled:cursor-wait aria-disabled:opacity-60`;function BN({image:e,onClose:t}){let n=(0,F.useRef)(null),[r,i]=(0,F.useState)(!1),[a,o]=(0,F.useState)(!1),[s,c]=(0,F.useState)(!1),[l,u]=(0,F.useState)(null),[d,f]=(0,F.useState)(null),p=(0,F.useRef)(null),m=(0,F.useRef)(0),h=(0,F.useRef)(t);(0,F.useLayoutEffect)(()=>{h.current=t},[t]),(0,F.useEffect)(()=>{if(m.current+=1,!e)return;i(!1),o(!1),c(!1),u(null),f(null);let t=document.activeElement instanceof HTMLElement?document.activeElement:null,r=!1;queueMicrotask(()=>{r||n.current?.focus()});let a=document.body.style.overflow;document.body.style.overflow=`hidden`,document.fullscreenElement&&document.querySelector(`[data-artifact-screen-fullscreen]`)&&document.exitFullscreen?.().catch(()=>{});function s(e){if(e.key===`Escape`){e.preventDefault(),e.stopPropagation(),h.current();return}let t=n.current;if(e.key!==`Tab`||!t)return;let r=Array.from(t.querySelectorAll(`button:not([disabled]), a[href], [tabindex]:not([tabindex="-1"])`)).filter(e=>!e.hasAttribute(`hidden`));if(r.length===0){e.preventDefault(),t.focus();return}let i=r[0],a=r[r.length-1],o=document.activeElement;e.shiftKey&&(o===t||o===i||!t.contains(o))?(e.preventDefault(),a.focus()):!e.shiftKey&&(o===t||o===a||!t.contains(o))&&(e.preventDefault(),i.focus())}return window.addEventListener(`keydown`,s,!0),()=>{r=!0,window.removeEventListener(`keydown`,s,!0),document.body.style.overflow=a,p.current!==null&&(window.clearTimeout(p.current),p.current=null),t?.isConnected&&t.focus()}},[e]);async function g(e){if(a)return;let t=m.current;o(!0),u(null),f(null);try{if(!globalThis.ClipboardItem)throw Error(`Clipboard images unsupported`);let n=LN(e).then(RN);if(await navigator.clipboard.write([new ClipboardItem({"image/png":n})]),t!==m.current)return;i(!0),p.current!==null&&window.clearTimeout(p.current),p.current=window.setTimeout(()=>{i(!1),p.current=null},2e3)}catch{t===m.current&&(i(!1),u(`Could not copy the image to the clipboard.`))}finally{t===m.current&&o(!1)}}async function _(e){if(s)return;let t=m.current;c(!0),u(null),f(null);try{let n=await LN(e);if(t!==m.current)return;let r=URL.createObjectURL(n),i=document.createElement(`a`);i.href=r,i.download=IN({...e,mediaType:n.type||e.mediaType}),document.body.append(i);try{i.click()}finally{i.remove(),window.setTimeout(()=>URL.revokeObjectURL(r),1e4)}}catch{t===m.current&&f(`Could not download the image.`)}finally{t===m.current&&c(!1)}}if(!e)return null;let v=e;return(0,R.jsx)(`div`,{className:`bg-background/92 fixed inset-0 z-300 flex items-center justify-center px-3 py-4 sm:px-6 sm:py-12`,"data-image-viewer":``,role:`presentation`,onClick:e=>{e.target===e.currentTarget&&t()},children:(0,R.jsxs)(`div`,{ref:n,className:`relative inline-flex max-h-full max-w-full outline-none`,role:`dialog`,"aria-modal":`true`,"aria-label":`Image preview: ${v.name}`,tabIndex:-1,children:[(0,R.jsx)(`img`,{src:v.url,alt:v.name,referrerPolicy:`no-referrer`,className:`border-border block max-h-[calc(100dvh-2rem)] max-w-full rounded-2xl border object-contain sm:max-h-[calc(100dvh-6rem)]`}),(0,R.jsx)(`button`,{type:`button`,className:`${zN} absolute top-3 right-3`,"aria-label":`Close image preview`,onClick:t,children:(0,R.jsx)(Fv,{className:`size-4`,"aria-hidden":`true`})}),(0,R.jsx)(`div`,{className:`absolute right-3 bottom-3 flex items-center gap-2`,children:v.readActions===!1?(0,R.jsx)(`a`,{className:`${zN} w-auto px-3 text-sm`,href:v.url,target:`_blank`,rel:`noopener noreferrer`,referrerPolicy:`no-referrer`,children:`Open original image`}):(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(`button`,{type:`button`,className:zN,"aria-disabled":a,"aria-label":a?`Copying image`:r?`Image copied`:`Copy image`,title:a?`Copying image`:r?`Image copied`:`Copy image`,onClick:()=>void g(v),children:a?(0,R.jsx)(V_,{className:`size-4 animate-spin`,"aria-hidden":`true`}):r?(0,R.jsx)(Ug,{className:`size-4`,"aria-hidden":`true`}):(0,R.jsx)(r_,{className:`size-4`,"aria-hidden":`true`})}),(0,R.jsx)(`button`,{type:`button`,className:zN,"aria-disabled":s,"aria-label":s?`Downloading image`:`Download image`,title:s?`Downloading image`:`Download image`,onClick:()=>void _(v),children:s?(0,R.jsx)(V_,{className:`size-4 animate-spin`,"aria-hidden":`true`}):(0,R.jsx)(s_,{className:`size-4`,"aria-hidden":`true`})})]})}),(0,R.jsx)(`span`,{className:`sr-only`,"aria-live":`polite`,children:a?`Copying image`:r?`Image copied`:s?`Downloading image`:``}),l||d?(0,R.jsx)(`p`,{className:`border-border absolute right-3 bottom-14 max-w-[min(20rem,calc(100%-1.5rem))] rounded-lg border bg-black/80 px-3 py-2 text-xs text-amber-100 shadow-lg backdrop-blur-sm`,role:`alert`,children:l??d}):null]})})}function VN(e){let t=e.split(/[?#]/,1)[0];try{return decodeURIComponent(t)}catch{return t}}function HN(e,t){if(e=iD(e),/^(?:https?:|data:image\/|blob:|\/\/)/i.test(e))return e;if(!e||/^[a-z][a-z\d+.-]*:/i.test(e)&&!aD(e))return null;let n=VN(e),r=t?.documentPath?.replaceAll(`\\`,`/`),i=r?.slice(0,r.lastIndexOf(`/`)+1)??``,a=oD(n)?n:i+n,o=n.replace(/^(?:\.\/)+/,``),s=!r&&/^(?:parse_file|screenshot_url|scrape_url)\//.test(o)?t?.transcript:void 0;if(!oD(a)&&!t?.workspacePath&&!s)return null;let c=new URLSearchParams;s&&(c.set(`userId`,s.userId),c.set(`threadId`,s.threadId)),t?.workspacePath&&c.set(`workspacePath`,t.workspacePath),c.set(`path`,s?o:a);let l=jm(),u=`/api/workspace/image?${c}`;return l&&l!==globalThis.window?.location.origin?`${l}${u}`:u}function UN(e,t){let n=document.createElement(`template`);n.innerHTML=e;for(let e of n.content.querySelectorAll(`a[href]`)){let n=e.getAttribute(`href`)??``;if(/^[a-z][a-z\d+.-]*:/i.test(n)&&!/^https?:/i.test(n)&&!aD(n)||!/\.(?:avif|bmp|gif|jpe?g|png|svg|webp)$/i.test(VN(n)))continue;if(e.querySelector(`img`)){let r=HN(n,t);r&&e.setAttribute(`href`,r);continue}let r=document.createElement(`img`);r.setAttribute(`src`,n),r.alt=e.textContent||`Image`;let i=e.getAttribute(`title`);i&&(r.title=i),e.replaceWith(r)}for(let e of n.content.querySelectorAll(`img`)){let n=HN(e.getAttribute(`src`)??``,t);if(e.setAttribute(`loading`,`lazy`),e.setAttribute(`decoding`,`async`),e.setAttribute(`referrerpolicy`,`no-referrer`),e.removeAttribute(`srcset`),e.removeAttribute(`data-local-image-url`),n){e.src=n;let t=new URL(n,window.location.href);t.pathname===`/api/workspace/image`&&t.origin===jm()&&e.setAttribute(`data-local-image-url`,n)}else e.removeAttribute(`src`),e.alt=`${e.alt||`Image`} (unavailable)`;n&&n.startsWith(`${jm()}/api/workspace/image?`)&&(e.crossOrigin=`use-credentials`),!e.closest(`a`)&&n&&(e.tabIndex=0,e.setAttribute(`role`,`button`),e.setAttribute(`aria-label`,`View ${e.alt||`image`}`))}return n.innerHTML}var WN=new Map,GN=L().nullable(),KN=2e3,qN,JN;function YN(){WN.size&&!qN&&!JN&&(qN=setTimeout(XN,KN))}async function XN(){if(qN=void 0,document.visibilityState===`hidden`){YN();return}let e=new AbortController;JN=e;let t=[...WN.entries()];async function n(){for(;t.length&&!e.signal.aborted;){let n=t.shift();if(!n)return;let[r,i]=n;if(WN.get(r)!==i)continue;let a=new URL(r,window.location.href);a.searchParams.set(`revisionOnly`,`true`);try{let t=await fetch(a.href,{credentials:`include`,cache:`no-store`,signal:AbortSignal.any([e.signal,AbortSignal.timeout(5e3)])});if(!t.ok)continue;let n=GN.parse(await t.json());if(e.signal.aborted||WN.get(r)!==i||n===i.revision||(i.revision=n,n===null))continue;a.searchParams.delete(`revisionOnly`),a.searchParams.set(`revision`,n);for(let e of i.listeners)e(a.href)}catch{}}}try{await Promise.all(Array.from({length:Math.min(4,t.length)},()=>n()))}finally{JN===e&&(JN=void 0),YN()}}function ZN(e,t){let n=WN.get(e);if(n||(n={listeners:new Set},WN.set(e,n)),n.listeners.add(t),n.revision){let r=new URL(e,window.location.href);r.searchParams.set(`revision`,n.revision),t(r.href)}return YN(),()=>{n.listeners.delete(t),n.listeners.size||WN.delete(e),WN.size||(clearTimeout(qN),qN=void 0,JN?.abort())}}var QN=`modulepreload`,$N=function(e){return`/`+e},eP={},tP=function(e){return e.pathname.endsWith(`.css`)},nP=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e,i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}function s(e){return import.meta.resolve?new URL(import.meta.resolve(e)):new URL(e,import.meta.url)}r=o(t.map(t=>{t=$N(t,n);let r=s(t);if(r.href in eP)return;eP[r.href]=!0;let i=tP(r);if(e===void 0){e={all:new Set,styles:new Set};let t=document.getElementsByTagName(`link`);for(let n=t.length-1;n>=0;n--){let r=t[n];e.all.add(r.href),r.rel===`stylesheet`&&e.styles.add(r.href)}}if((i?e.styles:e.all).has(r.href))return;let o=document.createElement(`link`);if(o.rel=i?`stylesheet`:QN,i||(o.as=`script`),o.crossOrigin=``,o.href=r.href,a&&o.setAttribute(`nonce`,a),document.head.appendChild(o),i)return new Promise((e,t)=>{o.addEventListener(`load`,e),o.addEventListener(`error`,()=>t(Error(`Unable to preload CSS for ${r}`)))})}).filter(e=>e!==void 0))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})};function rP({html:e,imageScope:t}){let n=t?.workspacePath,r=t?.documentPath,i=t?.transcript?.userId,a=t?.transcript?.threadId,o=(0,F.useMemo)(()=>UN(e,{workspacePath:n,documentPath:r,transcript:i&&a?{userId:i,threadId:a}:void 0}),[e,n,r,i,a]),s=(0,F.useRef)(null),[c,l]=(0,F.useState)(null);(0,F.useEffect)(()=>{let e=[...s.current?.querySelectorAll(`img[data-local-image-url]`)??[]].map(e=>{let t=e.getAttribute(`data-local-image-url`);if(!t)return()=>{};let n=e.alt;return ZN(t,t=>{let r=e.src;e.classList.remove(`markdown-image-error`),e.alt=n,e.closest(`a`)||(e.tabIndex=0,e.setAttribute(`role`,`button`),e.setAttribute(`aria-label`,`View ${n||`image`}`)),e.src=t,l(e=>e?.url===r?{...e,url:t}:e)})});return()=>{for(let t of e)t()}},[o]);let[u,d]=(0,F.useState)({html:o,blocks:[]});(0,F.useEffect)(()=>{let e=s.current?.querySelectorAll(`pre > code`)??[];if(!e.length){d({html:o,blocks:[]});return}let t=new AbortController,n=[];for(let r of e){let e=r.parentElement;if(!e)continue;let i=document.createElement(`div`);i.className=`markdown-code-block`;let a=document.createElement(`div`);a.className=`markdown-code-header`,e.replaceWith(i),i.append(a,e);let o=r.textContent,s=[...r.classList].find(e=>e.startsWith(`language-`))?.slice(9).toLowerCase();n.push({target:a,wrapper:i,pre:e,code:o,language:s}),s&&(o.length>5e4||nP(async()=>{let{highlightCodeInWorker:e}=await import(`./code-highlighting-client-Kw4BuD-0.js`);return{highlightCodeInWorker:e}},[]).then(({highlightCodeInWorker:e})=>t.signal.aborted?null:e(o,s,t.signal)).then(e=>{if(!e||t.signal.aborted)return;let n=document.createDocumentFragment();for(let[t,r]of e.entries()){t>0&&n.append(`
434
+ `);for(let e of r){let t=document.createElement(`span`);t.textContent=e.content;for(let[n,r]of Object.entries(e.htmlStyle??{}))t.style.setProperty(n,String(r));n.append(t)}}r.replaceChildren(n),r.classList.add(`shiki`)}).catch(()=>{}))}return d({html:o,blocks:n}),()=>{t.abort();for(let{wrapper:e,pre:t}of n)e.replaceWith(t)}},[o]);function f(e){if(!e.getAttribute(`src`)||e.closest(`a`)||e.classList.contains(`markdown-image-error`))return;let t=new URL(e.src),n=e.src.startsWith(`${jm()}/api/workspace/image?`);l({url:e.src,name:e.alt||`Image`,mediaType:``,readActions:n||!/^https?:$/.test(t.protocol)||t.origin===window.location.origin})}return(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(`div`,{ref:s,className:`chat-markdown-html`,onClick:e=>{e.target instanceof HTMLImageElement&&f(e.target)},onKeyDown:e=>{e.target instanceof HTMLImageElement&&(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),f(e.target))},onErrorCapture:e=>{if(!(e.target instanceof HTMLImageElement)||e.target.classList.contains(`markdown-image-error`))return;let t=e.target;t.classList.add(`markdown-image-error`),t.alt=`${t.alt||`Image`} (unavailable)`,t.removeAttribute(`role`),t.removeAttribute(`tabindex`),t.removeAttribute(`aria-label`)},dangerouslySetInnerHTML:{__html:o}}),u.blocks.map(({target:e,code:t,language:n,pre:r},i)=>(0,R.jsx)(PN,{target:e,code:t,language:n,pre:r},i)),c?(0,jN.createPortal)((0,R.jsx)(BN,{image:c,onClose:()=>l(null)}),document.body):null]})}var iP=new Set;function aP({content:e,className:t=``,artifacts:n=[],onOpenArtifact:r,openLinksInNewTab:i=!1,imageScope:a}){let o=(0,F.useMemo)(()=>new Map(n.map(e=>[e.key,e])),[n]),s=(0,F.useMemo)(()=>ON(e,r?new Set(o.keys()):iP,i),[e,r,o,i]);return(0,R.jsx)(`div`,{className:pb(`chat-markdown`,t),children:s.map((e,t)=>{if(e.type===`artifact`){let n=o.get(e.artifactId);return n&&r?(0,R.jsx)(AN,{artifact:n,onOpen:()=>r(e.artifactId)},`${e.type}-${t}`):null}return(0,R.jsx)(rP,{html:e.html,imageScope:a},`${e.type}-${t}`)})})}var oP=`border-border hover:border-border focus-visible:ring-ring/40 text-foreground inline-flex h-14 max-w-56 items-center gap-2 rounded-xl border px-3 py-2 text-xs transition focus-visible:ring-2 focus-visible:outline-none`;function sP({attachment:e,loadAttachment:t,onOpen:n}){let[r,i]=(0,F.useState)(null),[a,o]=(0,F.useState)(!1),[s,c]=(0,F.useState)(!1),l=(0,F.useRef)(0),u=(0,F.useRef)(t);(0,F.useLayoutEffect)(()=>{u.current=t},[t]);let d=r??e.url??null,f=_x(e.mediaType);(0,F.useEffect)(()=>{let e=r;return()=>xx(e??void 0)},[r]),(0,F.useEffect)(()=>{let t=e.storageId,n=e.mediaType;if(!Sx({mediaType:n,url:e.url}))return;let r=u.current;if(!r)return;let a=!1;return o(!1),r(t).then(e=>{if(a){xx(e??void 0);return}i(e),o(e==null)}).catch(()=>{a||o(!0)}),()=>{a=!0}},[e.storageId,e.mediaType,e.url]),(0,F.useEffect)(()=>()=>{l.current+=1},[]);async function p(){if(s)return;let n=d;if(n?.startsWith(`blob:`)){Cx(n,e.name);return}if(!t&&!n){o(!0);return}let r=l.current;c(!0),o(!1);try{let a=null;if(t)a=await t(e.storageId);else if(n){let e=await fetch(n);if(!e.ok)throw Error(`Download failed`);a=URL.createObjectURL(await e.blob())}if(r!==l.current){xx(a??void 0);return}if(!a){o(!0);return}i(a),Cx(a,e.name)}catch{r===l.current&&o(!0)}finally{r===l.current&&c(!1)}}return d&&f?(0,R.jsx)(`button`,{type:`button`,className:`border-border hover:border-border focus-visible:ring-ring/40 block size-14 cursor-zoom-in overflow-hidden rounded-xl border transition focus-visible:ring-2 focus-visible:outline-none`,"aria-label":`View ${e.name}`,title:e.name,onClick:()=>{n({url:d,name:e.name,mediaType:e.mediaType})},children:(0,R.jsx)(`img`,{src:d,alt:``,loading:`lazy`,className:`size-full object-cover`})}):f&&t&&!a?(0,R.jsx)(`span`,{className:`border-hairline bg-hover-fill inline-flex size-14 animate-pulse rounded-xl border`,"aria-label":`Loading ${e.name}`}):f?(0,R.jsx)(`span`,{className:`text-muted-foreground border-hairline bg-hover-fill inline-flex items-center rounded-xl border px-3 py-2 text-xs`,children:`${e.name} (unavailable)`}):s?(0,R.jsxs)(`span`,{className:`${oP} pointer-events-none animate-pulse`,"aria-label":`Downloading ${e.name}`,role:`status`,children:[(0,R.jsx)(C_,{className:`text-muted-foreground size-4 shrink-0`,"aria-hidden":`true`}),(0,R.jsx)(`span`,{className:`min-w-0 truncate`,children:e.name})]}):a?(0,R.jsxs)(`button`,{type:`button`,className:`${oP} cursor-pointer`,"aria-label":`Retry download of ${e.name}`,title:e.name,onClick:()=>{p()},children:[(0,R.jsx)(C_,{className:`text-muted-foreground size-4 shrink-0`,"aria-hidden":`true`}),(0,R.jsx)(`span`,{className:`min-w-0 truncate`,children:`${e.name} (unavailable)`})]}):t||d?(0,R.jsxs)(`button`,{type:`button`,className:`${oP} cursor-pointer`,"aria-label":`Download ${e.name}`,title:e.name,onClick:()=>{p()},children:[(0,R.jsx)(C_,{className:`text-muted-foreground size-4 shrink-0`,"aria-hidden":`true`}),(0,R.jsx)(`span`,{className:`min-w-0 truncate`,children:e.name})]}):(0,R.jsx)(`span`,{className:`text-muted-foreground border-hairline bg-hover-fill inline-flex items-center rounded-xl border px-3 py-2 text-xs`,children:`${e.name} (unavailable)`})}var cP=`user-bubble w-fit max-w-[33rem] rounded-xl border px-5 py-3.5 text-[15.5px] leading-7 text-foreground`;function lP({message:e,imageScope:t,copied:n,loadAttachment:r,onCopy:i,onOpenImage:a}){let o=e.attachments??[];return(0,R.jsxs)(`div`,{"data-message-id":e.id,"data-transcript-anchor":e.id,className:`flex flex-col items-end gap-1.5`,children:[o.length>0?(0,R.jsx)(`ul`,{className:`flex max-w-132 flex-wrap justify-end gap-2`,"aria-label":`Attached files`,children:o.map(e=>(0,R.jsx)(`li`,{children:(0,R.jsx)(sP,{attachment:{...e,url:null},loadAttachment:r,onOpen:a})},e.storageId))}):null,e.text||o.length===0?(0,R.jsx)(`div`,{className:cP,children:(0,R.jsx)(aP,{imageScope:t,content:e.text||` `,className:`text-foreground`,openLinksInNewTab:!0})}):null,e.text?(0,R.jsx)(`button`,{type:`button`,className:`text-muted-foreground hover:text-muted-foreground inline-flex size-6 items-center justify-center rounded-md transition`,"aria-label":n?`Copied`:`Copy message`,onClick:i,children:n?(0,R.jsx)(Ug,{className:`size-3.5`,"aria-hidden":`true`}):(0,R.jsx)(r_,{className:`size-3.5`,"aria-hidden":`true`})}):null]})}function uP(e){let[t,n]=(0,F.useState)(!1),[r,i]=(0,F.useState)(!1),a=(0,F.useRef)(e);return(0,F.useEffect)(()=>{e!==a.current&&(a.current=e,e?i(!1):n(!1))},[e]),{expanded:e?!r:t,toggle:(0,F.useCallback)(()=>{e?i(e=>!e):n(e=>!e)},[e])}}function dP({text:e,inProgress:t}){let n=uP(t),r=t?`Reasoning`:`Reasoned`;return(0,R.jsxs)(`div`,{className:`text-muted-foreground text-sm`,children:[(0,R.jsxs)(`button`,{type:`button`,className:`text-muted-foreground hover:text-muted-foreground inline-flex items-center gap-1.5 transition`,onClick:n.toggle,"aria-expanded":n.expanded,children:[(0,R.jsx)(Lg,{className:`size-3.5 shrink-0`,"aria-hidden":`true`}),(0,R.jsx)(`span`,{children:r}),(0,R.jsx)(qg,{className:`size-3.5 shrink-0 transition-transform ${n.expanded?`rotate-90`:``}`,"aria-hidden":`true`})]}),n.expanded?(0,R.jsx)(`div`,{className:`text-muted-foreground mt-1.5 text-[13px] leading-6 [overflow-wrap:anywhere] whitespace-pre-wrap`,children:e}):null]})}function fP(e){return e.split(`_`).map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(` `)}function pP(e){if(!pC(e))switch(e){case`apply_patch`:case`ask_question`:case`await_question`:case`poll_question`:case`read_skill`:case`scrape_url`:case`web_search`:return;case`spawn_subagent`:return`Delegated Tasks`;case`control_subagent`:return`Controlled Subagents`;case`poll_subagent`:return`Polled Subagents`;case`list_subagents`:return`Listed Subagents`;case`list_subagent_models`:return`Listed Subagent Models`;case`check_docs`:return`Checked Docs`;case`add_artifact`:case`create_artifact`:return`Created Artifact`;case`edit_artifact`:case`update_artifact`:return`Updated Artifact`;case`list_artifacts`:return`Listed Artifacts`;case`save_artifact`:return`Saved Artifact`;case`delete_artifact`:return`Deleted Artifact`;case`get_workspace_instructions`:return`Read Instructions`;case`mandate_charge`:return`Charged Card`;case`mandate_list`:return`Listed Mandates`;case`mandate_report`:return`Settled Charge`;case`mandate_setup`:return`Set Up Mandate`;case`mandate_status`:return`Checked Mandate`;case`parse_file`:return`Parsed File`;case`screenshot_url`:return`Captured Screenshot`;default:return fP(e)}}function mP(e){let t=eC(e)?mC(e.workdir):void 0;return t&&t.trim().length>0&&t!==`.`?` (cwd ${t})`:``}function hP(e,t){let n=eC(t)?t:void 0;switch(e){case`apply_patch`:return CP(t)??`Patch`;case`ask_question`:return mC(n?.question)??`Question`;case`await_question`:case`poll_question`:return`Waiting for answer`;case`spawn_subagent`:return mC(n?.prompt)??`Child agent`;case`control_subagent`:return n?.action===`send`?mC(n.prompt)??`Message child agent`:n?.action===`stop`?`Stop child agent`:n?.action===`answer_question`?`Answered question`:mC(n?.threadId)??`Child agent`;case`poll_subagent`:return mC(n?.threadId)??`Child agent`;case`list_subagents`:case`list_subagent_models`:return``;case`check_docs`:return mC(n?.query)??mC(n?.path)??`Docs`;case`add_artifact`:case`create_artifact`:case`edit_artifact`:case`save_artifact`:case`delete_artifact`:return xP(t);case`list_artifacts`:return`Artifacts`;case`exec_command`:case`exec_cmd`:{let e=mC(n?.cmd);return e?`${e}${mP(t)}`:`Command`}case`control_command`:case`control_cmd`:{let e=mC(n?.sessionId),t=e?`Session ${e}`:`Command session`;return n?.action===`terminate`?`Terminate ${t}`:`Write to ${t}`}case`poll_command`:case`poll_cmd`:case`write_stdin`:{let e=mC(n?.sessionId);return e?`Session ${e}`:`Command session`}case`get_workspace_instructions`:return`Workspace instructions`;case`mandate_charge`:return _P(n);case`mandate_list`:return`Standing mandates`;case`mandate_report`:return n?.outcome===`approved`?`Charge approved`:`Charge declined`;case`mandate_setup`:return gP(n);case`mandate_status`:return`Mandate status`;case`read_skill`:{let e=mC(n?.name);return e?`$${e}`:`Skill`}case`scrape_url`:case`screenshot_url`:return mC(n?.url)??`URL`;case`parse_file`:return mC(n?.path)??mC(n?.url)??`File`;case`update_artifact`:return mC(n?.title)??`Updated artifact`;case`web_search`:return mC(n?.query)??`Web search`;default:return fP(e)}}function gP(e){let t=mC(e?.merchantName)??`Any merchant`,n=mC(e?.amountCap),r=mC(e?.currency)??``,i=mC(e?.frequency)??``;return`${t}${n?` · ${n} ${r}`.trimEnd():``}${i&&i!==`one_time`?` ${i}`:``}`}function _P(e){let t=mC(e?.description)??`Charge`,n=mC(e?.amount),r=mC(e?.currency)??``;return n?`${t} · ${n} ${r}`.trimEnd():t}var vP=[`*** Add File: `,`*** Copy File: `,`*** Delete File: `,`*** Update File: `],yP=[`*** Copy to: `,`*** Move to: `];function bP(e){let t=e.lastIndexOf(` "b/`);if(t>=0)return e.slice(t+4).replace(/"$/,``);let n=e.lastIndexOf(` b/`);return n>=0?e.slice(n+3):null}function xP(e,t){let n=eC(e)?e:void 0,r=eC(t)?t:void 0;return mC(n?.path)??mC(n?.localPath)??mC(r?.localPath)??mC(r?.path)??mC(r?.title)??mC(n?.title)??mC(n?.artifactId)??`Artifact`}function SP(e){let t=Array.isArray(e)?e:eC(e)&&Array.isArray(e.artifacts)?e.artifacts:void 0;if(t===void 0)return`Artifacts`;let n=t.length;return n===1?`1 artifact`:`${n} artifacts`}function CP(e){let t=eC(e)?mC(e.patch):void 0;if(!t)return null;let n=[];for(let e of t.split(`
435
+ `)){if(e.startsWith(`diff --git `)){let t=bP(e);t!==null&&n.push(t);continue}let t=vP.find(t=>e.startsWith(t));if(t){n.push(e.slice(t.length).trim());continue}let r=yP.find(t=>e.startsWith(t));r&&n.length>0&&(n[n.length-1]=e.slice(r.length).trim())}let r=[...new Set(n)];return r.length>0?r.join(`
436
+ `):null}function wP(e){if(!eC(e)||!Array.isArray(e.changes))return null;let t=e.changes.flatMap(e=>{if(!eC(e))return[];let t=mC(e.path);return t?[t]:[]});return t.length===0?null:[...new Set(t)].join(`
437
+ `)}function TP(e){return e.job?.kind===`apply_patch`?wP(e.job.result)??CP(e.job.payload):e.name===`apply_patch`?CP(e.input):null}function EP(e,t){if(e===`web_search`&&eC(t)&&Array.isArray(t.results)){let e=t.results.length;return` (${e} result${e===1?``:`s`})`}return``}function DP(e,t){let n=e.job?.kind??e.name;return fC(n)?OC(e,t)??hP(n,e.job?.payload??e.input):n===`list_artifacts`?SP(e.job?.result??e.output):n===`add_artifact`||n===`edit_artifact`||n===`save_artifact`||n===`delete_artifact`||n===`create_artifact`?xP(e.job?.payload??e.input,e.job?.result??e.output):e.job?TP(e)||hP(e.job.kind,e.job.payload)+EP(e.job.kind,e.job.result):hP(e.name,e.input)}function OP(e){switch(e){case`apply_patch`:return x_;case`ask_question`:return $g;case`await_question`:case`poll_question`:return F_;case`spawn_subagent`:case`control_subagent`:case`poll_subagent`:return Fg;case`list_subagents`:case`list_subagent_models`:return z_;case`check_docs`:return Ng;case`add_artifact`:case`create_artifact`:return y_;case`delete_artifact`:return Dv;case`save_artifact`:return av;case`exec_command`:case`exec_cmd`:return Cv;case`control_command`:case`control_cmd`:case`poll_command`:case`poll_cmd`:return _v;case`get_workspace_instructions`:return sv;case`mandate_charge`:return Zg;case`mandate_list`:return z_;case`mandate_report`:return jv;case`mandate_setup`:return a_;case`mandate_status`:return z_;case`read_skill`:return q_;case`scrape_url`:return N_;case`screenshot_url`:return zg;case`edit_artifact`:case`list_artifacts`:case`update_artifact`:case`parse_file`:return C_;case`web_search`:return lv;case`write_stdin`:return _v;default:return Nv}}function kP(e){return OP(e.job?.kind??e.name)}function AP({tools:e,inProgress:t,commands:n}){return(0,R.jsx)(`div`,{className:`text-muted-foreground space-y-1.5 text-[13px] leading-6`,children:e.map(e=>{let r=e.job?.kind??e.name,i=kP(e),a=DP(e,n),o=r===`apply_patch`?a.split(`
438
+ `):[a],s=pP(r),c=jC(e,t),l=AC(e,t),u=l===`failed`?`text-destructive`:`text-amber-800 dark:text-amber-200`;return(0,R.jsxs)(`div`,{"data-tool-kind":r,className:`min-w-0 space-y-1.5`,children:[o.map((e,t)=>(0,R.jsxs)(`div`,{"data-tool-row":!0,"data-work-detail":!0,className:`flex min-w-0 items-start gap-1.5`,children:[(0,R.jsx)(i,{className:`mt-1 size-3.5 shrink-0`,"aria-hidden":`true`}),s?(0,R.jsxs)(`span`,{className:`shrink-0`,children:[s,e?`:`:``]}):null,e?(0,R.jsx)(`span`,{className:`min-w-0 truncate`,children:e}):null,c&&l&&t===o.length-1?(0,R.jsxs)(`span`,{className:`shrink-0 ${u}`,children:[`(`,l===`cancelled`?`stopped`:l,`)`]}):null]},t)),c&&l?(0,R.jsx)(`p`,{"data-work-detail":!0,className:`pl-5 text-xs leading-5 wrap-break-word whitespace-pre-wrap ${u}`,role:`status`,children:c}):null]},e.callId)})})}function jP({inProgress:e,startedAtMs:t,completedAtMs:n,children:r}){let[i,a]=(0,F.useState)(!1),o=lx(e),s=ux(t,e?o:n),c=`${e?`Working`:`Worked`}${s===void 0?``:` for ${ix(s)}`}`;return(0,R.jsxs)(`div`,{className:`text-muted-foreground text-sm`,children:[(0,R.jsxs)(`button`,{type:`button`,className:`text-muted-foreground hover:text-muted-foreground inline-flex items-center gap-1 transition`,onClick:()=>a(e=>!e),"aria-expanded":i,children:[(0,R.jsx)(`span`,{children:c}),(0,R.jsx)(qg,{className:`size-3.5 shrink-0 transition-transform ${i?`rotate-90`:``}`,"aria-hidden":`true`})]}),i?(0,R.jsx)(`div`,{className:`mt-1.5 space-y-2`,children:r}):null]})}function MP(e){return e.type===`tool-call`||e.type===`tool-result`?`${e.type}:${e.callId}`:`${e.type}:${e.turnId??``}:${e.id}`}var NP=class{load;changed;commit;parts=[];previousBefore;nextAfter;loading=!1;indexing=!1;stale=!1;error=!1;start={};initialized=!1;stopped=!1;refreshPending=!1;failedDirection;request;retry;constructor(e,t,n){this.load=e,this.changed=t,this.commit=n}stop(){this.stopped=!0,this.request?.abort(),clearTimeout(this.retry)}refresh(){if(this.loading){this.refreshPending=!0;return}return this.fetch()}more(e){if(!(!this.initialized||this.loading||this.error||this.indexing)&&(e===`older`?this.previousBefore:this.nextAfter)!==void 0)return this.fetch(e)}retryFailed(){if(!this.loading)return this.fetch(this.failedDirection)}async fetch(e){if(this.stopped)return;clearTimeout(this.retry);let t=new AbortController;this.request=t,this.loading=!0,this.indexing=!1,this.error=!1,this.failedDirection=e,this.changed();try{let n=e===`older`?{before:this.previousBefore}:e===`newer`?{after:this.nextAfter}:this.start,r=this.parts.length?MP(this.parts[this.parts.length-1]):void 0,i=[];for(;;){let a=await this.load(n,t.signal);if(t.signal.aborted)return;if(a.indexing||a.stale&&!a.parts.length||i.length&&a.revision<i[i.length-1].revision){this.stale=a.stale,this.indexing=!0,this.retry=setTimeout(()=>void this.fetch(e),500);return}if(n.after!==void 0&&a.nextAfter!==void 0&&a.nextAfter<=n.after||n.before!==void 0&&a.previousBefore!==void 0&&a.previousBefore>=n.before)throw Error(`Work detail cursor did not advance.`);if(i.push(a),e||!r||a.parts.some(e=>MP(e)===r)||a.nextAfter===void 0||this.nextAfter!==void 0&&a.nextAfter>=this.nextAfter)break;if(i.length>this.parts.length)throw Error(`Work detail range changed too much.`);n={after:a.nextAfter}}let a=i[0],o=i[i.length-1],s=i.flatMap(e=>e.parts);await this.commit(()=>{if(t.signal.aborted)return;let n=e===`older`?[...s,...this.parts]:e===`newer`?[...this.parts,...s]:s,r=new Map(s.map(e=>[MP(e),e]));this.parts=[...new Map(n.map(e=>[MP(e),r.get(MP(e))??e])).values()],e!==`newer`&&(this.previousBefore=a.previousBefore,this.start=a.previousBefore===void 0?{}:{after:a.previousBefore-1}),e!==`older`&&(this.nextAfter=o.nextAfter),this.initialized=!0,this.stale=i.some(e=>e.stale),this.changed()},e),!this.stopped&&this.stale&&(this.retry=setTimeout(()=>void this.refresh(),2e3))}catch{t.signal.aborted||(this.error=!0)}finally{this.loading=!1,this.stopped||(this.changed(),this.refreshPending&&(this.refreshPending=!1,this.refresh()))}}},PP=3,FP=2;function IP({row:e,load:t,inProgress:n,commands:r,viewport:i,beforeChange:a}){let[o,s]=(0,F.useState)(0),c=(0,F.useRef)(null),l=(0,F.useRef)(null),u=(0,F.useRef)(null),d=(0,F.useRef)(0),f=(0,F.useRef)(`newer`),p=(0,F.useRef)({older:0,newer:0}),m=(0,F.useRef)(t),h=(0,F.useRef)(e),g=(0,F.useRef)(n),_=(0,F.useRef)(a),v=(0,F.useRef)(i);(0,F.useLayoutEffect)(()=>{m.current=t,h.current=e,g.current=n,_.current=a,v.current=i});function y(e){let t=v.current;if(!t||!e)return 1/0;let n=t.getBoundingClientRect(),r=e.getBoundingClientRect();return r.bottom<n.top?n.top-r.bottom:r.top>n.bottom?r.top-n.bottom:0}let b=(0,F.useRef)(null);b.current||=new NP((e,t)=>m.current(h.current,e,t),()=>s(e=>e+1),async(e,t)=>{let n=p.current,r=t?y(t===`older`?l.current:u.current):void 0,i=_.current(g.current&&t!==`older`);(0,jN.flushSync)(e),i(),d.current=v.current?.scrollTop??0,t&&r!==void 0&&(n[t]=y(t===`older`?l.current:u.current)<=r+1?n[t]+1:0)});let x=b.current,S={parts:x.parts,loading:x.loading,indexing:x.indexing,error:x.error,stale:x.stale,previousBefore:x.previousBefore,nextAfter:x.nextAfter},C=MC(S.parts,[]),w=C.filter(e=>e.type===`tool`),T=kC(vC(C).filter(e=>e.type!==`text`),n),E=new Map([...r,...DC(w)]),D=(0,F.useRef)(null);D.current||=new PC;let ee=D.current.reconcileBlocks(e.id,T.settledBlocks);function O(){let e=p.current;if(!i||i.clientHeight<=0||x.loading||x.error||x.indexing)return;let t=f.current===`older`?[`older`,`newer`]:[`newer`,`older`];for(let n of t)if(!((n===`older`?x.previousBefore:x.nextAfter)===void 0||e[n]>=FP)&&!(y(n===`older`?l.current:u.current)>i.clientHeight*PP)){x.more(n);return}}let te=(0,F.useRef)(O);return(0,F.useLayoutEffect)(()=>{te.current=O}),(0,F.useLayoutEffect)(()=>{n&&(p.current.newer=0),x.refresh()},[x,n,e.revision]),(0,F.useEffect)(()=>()=>x.stop(),[x]),(0,F.useLayoutEffect)(()=>{te.current()},[o]),(0,F.useLayoutEffect)(()=>{let e=i,t=l.current,n=u.current;if(!e||!t||!n)return;let r=p.current;d.current=e.scrollTop;function a(){if(!e||e.scrollTop===d.current)return;let t=e.scrollTop<d.current?`older`:`newer`;d.current=e.scrollTop,f.current=t,r[t]=0,te.current()}let o=globalThis.IntersectionObserver?new IntersectionObserver(()=>te.current(),{root:e,rootMargin:`${e.clientHeight*PP}px 0px`}):void 0,s=globalThis.ResizeObserver?new ResizeObserver(()=>{r.older=0,r.newer=0,te.current()}):void 0;return o?.observe(t),o?.observe(n),c.current&&s?.observe(c.current),s?.observe(e),e.addEventListener(`scroll`,a),()=>{o?.disconnect(),s?.disconnect(),e.removeEventListener(`scroll`,a)}},[i]),(0,R.jsxs)(`div`,{ref:c,"aria-busy":S.loading||S.indexing,children:[(0,R.jsx)(`div`,{ref:l,"data-work-edge":`older`,className:`h-px`,"aria-hidden":`true`}),S.stale?(0,R.jsx)(`p`,{role:`status`,children:`Showing saved details while reconnecting.`}):null,(0,R.jsxs)(`div`,{className:`space-y-2`,children:[ee.map(({block:e,renderKey:t})=>(0,R.jsx)(`div`,{"data-work-detail":!0,children:e.type===`reasoning`?(0,R.jsx)(dP,{text:e.text,inProgress:!1}):(0,R.jsx)(AP,{tools:e.tools,inProgress:n,commands:E})},t)),T.runningTools.length>0?(0,R.jsx)(`div`,{"data-work-detail":!0,children:(0,R.jsx)(AP,{tools:T.runningTools,inProgress:n,commands:E})}):null]}),S.error?(0,R.jsxs)(`p`,{role:`status`,children:[`Could not load these details.`,` `,(0,R.jsx)(`button`,{className:`underline`,onClick:()=>{p.current.older=0,p.current.newer=0,x.retryFailed()},children:`Retry`})]}):(S.loading||S.indexing)&&S.parts.length===0?(0,R.jsx)(`p`,{role:`status`,children:`Loading details...`}):null,(0,R.jsx)(`div`,{ref:u,"data-work-edge":`newer`,className:`h-px`,"aria-hidden":`true`})]})}function LP(e){if((e.job?.kind??e.name)!==`mandate_setup`)return;let t=e.output;if(!eC(t))return;let n=mC(t.mandateId),r=mC(t.approvalUrl);if(n&&r)return{mandateId:n,approvalUrl:r}}function RP(e){let t=e.job?.payload??e.input;if(!eC(t))return;let n=mC(t.description)?.trim();if(n)return n;let r=mC(t.merchantName)?.trim();if(r)return r}function zP(e){return e.flatMap(e=>{let t=LP(e);return t?[{...t,label:RP(e)}]:[]})}var BP=28,VP=3,HP=3;function UP(e,t){return e===void 0?t:t===void 0?e:Math.min(e,t)}function WP(e,t){return e===void 0?t:t===void 0?e:Math.max(e,t)}function GP({userId:e,messages:t,actions:n,activeRunId:r,project:i,emptyStateMessage:a=i?`Start a thread and ask Sprocket to inspect code, edit files, or run project commands.`:`Add a project to begin.`,loadingOlder:o=!1,nextBefore:s,onLoadOlder:c,loadAttachment:l,loadSectionDetails:u,artifacts:d=[],onOpenArtifact:f}){let p=(0,F.useRef)(null),m=(0,F.useRef)(null),[h,g]=(0,F.useState)(null),_=(0,F.useRef)(!0),v=(0,F.useRef)(0),y=(0,F.useRef)(void 0),b=(0,F.useRef)(void 0),x=(0,F.useRef)(HP),[S,C]=(0,F.useState)(null),[w,T]=(0,F.useState)(null),E=(0,F.useRef)(null),[D,ee]=(0,F.useState)(()=>new Map),O=(0,F.useCallback)(e=>{e.size!==0&&ee(t=>[...e].every(([e,n])=>t.get(e)===n)?t:new Map([...t,...e]))},[]),te=(0,F.useMemo)(()=>DC([...MC([],n),...t.flatMap(e=>e.kind===`live`?MC(e.parts,[]):[])].filter(e=>e.type===`tool`)),[t,n]);(0,F.useLayoutEffect)(()=>O(te),[te,O]);let ne=(0,F.useMemo)(()=>new Map([...D,...te]),[D,te]),re=(0,F.useMemo)(()=>u?async(e,t,n)=>{let r=await u(e,t,n);if(!n.aborted){let e=MC(r.parts,[]).filter(e=>e.type===`tool`);O(DC(e))}return r}:void 0,[u,O]),ie=(0,F.useRef)(null);ie.current||=new PC;let k=ie.current;function ae(e){let t=n.filter(t=>t.runId===e.runId&&e.parts.some(e=>e.type===`tool-call`&&e.callId===t.callId)),i=MC(e.parts,t);return{timeline:i,sections:k.reconcile(e.id,xC(vC(i))),isStreaming:gC(e,r)}}function A(e,t,n){let{settledBlocks:r,runningTools:i}=kC(t.blocks,e.isStreaming),a=e.isStreaming&&(n===e.sections.length-1||i.length>0),o=e.sections[n+1];return{settledBlocks:r,lastBlock:t.blocks.at(-1),runningTools:i,workInProgress:a,approvals:r.flatMap(e=>e.type===`tool-group`?zP(e.tools):[]),timing:SC(t,{inProgress:a,endedAt:o?.type===`text`?o.startedAt??void 0:void 0})}}function oe(e,n){for(let r of t.slice(e+1))if(r.kind!==`approval`||r.runId!==n)return r.kind===`live`&&r.runId===n?ae(r):void 0}function se(e,n){for(let r=e-1;r>=0;--r){let e=t[r];if(e.kind!==`approval`||e.runId!==n)return e.kind===`work`&&e.runId===n&&!e.closed}return!1}function ce(e){let t=[...e.querySelectorAll(`[data-transcript-anchor], [data-work-detail]`)].filter(e=>!e.querySelector(`[data-work-detail]`)),n=e.getBoundingClientRect().top,r=0,i=t.length;for(;r<i;){let e=Math.floor((r+i)/2);t[e].getBoundingClientRect().bottom<=n?r=e+1:i=e}return t[r]}function le(e,t){e.scrollTop!==t&&(e.scrollTop=t),v.current=e.scrollTop}function ue(){let e=p.current;if(!e||!_.current)return;let t=Math.max(0,e.scrollHeight-e.clientHeight);if(e.scrollTop+1<Math.min(v.current,t)){_.current=!1;return}le(e,t)}function de(){let e=p.current;e&&s!==void 0&&s!==b.current&&!o&&c&&x.current>0&&e.clientHeight>0&&e.scrollTop<=e.clientHeight*VP&&(--x.current,b.current=s,c())}function fe(){_.current=!1,x.current=HP,de()}function pe(){let e=p.current;if(!e)return;if(e.scrollTop===v.current){de();return}let t=Math.max(0,e.scrollHeight-e.clientHeight),n=e.scrollTop<v.current,r=v.current>t&&Math.abs(e.scrollTop-t)<1;if(v.current=e.scrollTop,x.current=HP,!r){let r=t-e.scrollTop;_.current=!n&&r<=BP,n&&fe()}de()}function me(e){e.target instanceof Element&&e.target.closest(`input, textarea, button, [contenteditable="true"]`)||(e.key===`ArrowUp`||e.key===`PageUp`||e.key===`Home`||e.key===` `&&e.shiftKey)&&fe()}function he(e){e||(_.current=!1);let t=p.current,n=t&&!_.current?ce(t):void 0,r=n?.getBoundingClientRect().top,i=t?.scrollTop;return()=>{t&&t===p.current&&(_.current?ue():n?.isConnected&&r!==void 0&&t.scrollTop===i&&le(t,t.scrollTop+n.getBoundingClientRect().top-r))}}let ge=(0,F.useRef)(ue),_e=(0,F.useRef)(de);(0,F.useLayoutEffect)(()=>{ge.current=ue,_e.current=de}),(0,F.useLayoutEffect)(()=>{_e.current()},[t,s,o,h]),(0,F.useLayoutEffect)(()=>{let e=h,t=m.current;if(!e||!t||!globalThis.ResizeObserver)return;let n=new ResizeObserver(()=>{ge.current(),_e.current()});return n.observe(e),n.observe(t),()=>{n.disconnect()}},[h]);let ve=(0,F.useRef)(t),ye=(0,F.useRef)(n),j=(0,F.useRef)(null);if(ve.current!==t||ye.current!==n){ve.current=t,ye.current=n;let e=p.current,r=e&&!_.current?ce(e):void 0;j.current=e&&r?{anchor:r,offset:r.getBoundingClientRect().top,scrollTop:e.scrollTop,scrollHeight:e.scrollHeight}:null}(0,F.useLayoutEffect)(()=>{let e=p.current;if(!e)return;if(_.current){ge.current();return}let t=j.current;if(j.current=null,!t)return;let{anchor:n,offset:r,scrollTop:i,scrollHeight:a}=t;n.isConnected&&e.scrollTop===i?le(e,i+n.getBoundingClientRect().top-r):!n.isConnected&&e.scrollTop===i&&le(e,i+e.scrollHeight-a)},[t,n]);async function M(e,t){try{await navigator.clipboard.writeText(t),T(e),E.current!==null&&clearTimeout(E.current),E.current=setTimeout(()=>{T(t=>t===e?null:t),E.current=null},1500)}catch{T(null)}}(0,F.useLayoutEffect)(()=>()=>{E.current!==null&&clearTimeout(E.current)},[]),(0,F.useLayoutEffect)(()=>{k.retain(t.filter(e=>e.kind===`live`).map(e=>e.id))},[t,k]);let be=(0,F.useCallback)(e=>{p.current=e,g(e)},[]);function xe(e,t){return(0,R.jsxs)(R.Fragment,{children:[e.settledBlocks.map((n,r)=>{let i=`${n.type}-${n.type===`tool-group`?n.tools.map(e=>e.callId).join(`,`):n.id}-${r}`;if(n.type===`reasoning`){let t=e.workInProgress&&e.runningTools.length===0&&n===e.lastBlock;return(0,R.jsx)(dP,{text:n.text,inProgress:t},i)}return(0,R.jsx)(AP,{tools:n.tools,inProgress:t.isStreaming,commands:ne},i)}),e.runningTools.length>0?(0,R.jsx)(AP,{tools:e.runningTools,inProgress:t.isStreaming,commands:ne}):null]})}function N(t,n){let a={workspacePath:i?.workspacePath,transcript:e?{userId:e,threadId:t.threadId}:void 0};if(t.kind===`prompt`)return(0,R.jsx)(lP,{message:t,imageScope:a,copied:w===t.id,loadAttachment:l,onCopy:()=>void M(t.id,t.text??``),onOpenImage:C},t.id);if(t.kind===`work`){let e=t,i=e.closed?void 0:oe(n,e.runId),a=i?.sections[0],o=i&&a?.type===`work`?A(i,a,0):void 0,s=o?o.workInProgress:a?.type!==`text`&&e.runId===r&&(!e.closed||e.pendingTools>0),c=UP(e.startedAt,o?.timing.startedAtMs),l=WP(e.completedAt,o?.timing.completedAtMs??(a?.type===`text`?a.startedAt??void 0:void 0));return(0,R.jsx)(`div`,{"data-message-id":t.id,"data-transcript-anchor":t.id,"data-message-kind":`work`,children:(0,R.jsxs)(jP,{inProgress:s,startedAtMs:c,completedAtMs:l,children:[re?(0,R.jsx)(IP,{row:e,load:re,commands:ne,inProgress:s,viewport:h,beforeChange:he}):null,o&&i?xe(o,i):null]})},t.id)}if(t.kind===`approval`)return!t.mandateId||!t.approvalUrl?null:(0,R.jsx)(`div`,{"data-transcript-anchor":t.id,children:(0,R.jsx)(wS,{approval:{mandateId:t.mandateId,approvalUrl:t.approvalUrl}})},t.id);if(t.kind===`text`)return(0,R.jsx)(`div`,{"data-message-id":t.id,"data-transcript-anchor":t.id,"data-message-kind":`text`,children:(0,R.jsx)(aP,{imageScope:a,content:t.text||` `,className:`text-foreground`,artifacts:d,onOpenArtifact:f,openLinksInNewTab:!0})},t.id);if(t.kind!==`live`)return null;let o=ae(t),s=se(n,t.runId),c=o.timeline.some(e=>e.type===`text`||e.type===`reasoning`);return(0,R.jsx)(`div`,{"data-message-id":t.id,className:`w-full min-w-0`,role:o.isStreaming?`log`:void 0,"aria-live":o.isStreaming?`polite`:void 0,"aria-atomic":`false`,"aria-relevant":`additions text`,children:(0,R.jsxs)(`div`,{className:`space-y-3`,children:[!c&&(t.text||o.isStreaming&&o.timeline.length===0)?(0,R.jsx)(aP,{imageScope:a,content:t.text||`...`,className:`text-foreground`,artifacts:d,onOpenArtifact:f,openLinksInNewTab:!0}):null,o.sections.map((e,n)=>{if(e.type===`text`)return(0,R.jsx)(`div`,{"data-transcript-anchor":`${t.id}:${yC(e)}`,children:(0,R.jsx)(aP,{imageScope:a,content:e.text||` `,className:`text-foreground`,artifacts:d,onOpenArtifact:f,openLinksInNewTab:!0})},e.renderKey);let r=A(o,e,n);return r.settledBlocks.length===0&&!r.workInProgress&&r.runningTools.length===0?null:(0,R.jsxs)(`div`,{className:`space-y-3`,"data-transcript-anchor":`${t.id}:${e.renderKey}`,children:[s&&n===0?null:(0,R.jsx)(jP,{inProgress:r.workInProgress,startedAtMs:r.timing.startedAtMs,completedAtMs:r.timing.completedAtMs,children:xe(r,o)}),r.approvals.map(e=>(0,R.jsx)(wS,{approval:e},e.mandateId))]},e.renderKey)}),!o.isStreaming&&t.runStartedAt>0&&t.runCompletedAt!==void 0?(0,R.jsx)(`p`,{className:`text-muted-foreground text-sm`,children:`Worked for ${ix(Math.max(0,Math.floor((t.runCompletedAt-t.runStartedAt)/1e3)))}`}):null]})},t.id)}return(0,R.jsxs)(`div`,{className:`relative min-h-0 flex-1`,children:[(0,R.jsx)(`div`,{className:`hide-scrollbar h-full overflow-x-hidden overflow-y-auto`,role:`region`,"aria-label":`Conversation history`,tabIndex:0,ref:be,onScroll:pe,onWheel:e=>{e.deltaY<0&&fe()},onKeyDown:me,onTouchStart:e=>{y.current=e.touches[0]?.clientY},onTouchMove:e=>{let t=e.touches[0]?.clientY;t!==void 0&&y.current!==void 0&&t>y.current&&fe(),y.current=t},children:(0,R.jsx)(`div`,{ref:m,className:`mx-auto flex min-h-full w-full max-w-[48rem] flex-col px-4 py-8`,children:t.length===0?a?(0,R.jsx)(`div`,{className:`flex flex-1 items-center justify-center`,children:(0,R.jsx)(`div`,{className:`max-w-2xl text-center`,children:(0,R.jsx)(`p`,{className:`text-muted-foreground text-sm leading-7`,children:a})})}):null:(0,R.jsx)(`div`,{className:`transcript-messages space-y-8 pb-14`,children:t.map((e,t)=>N(e,t))})})}),(0,R.jsx)(`div`,{className:`transcript-fade pointer-events-none absolute inset-x-0 bottom-0 h-16`}),(0,R.jsx)(BN,{image:S,onClose:()=>C(null)})]})}function KP({title:e,onDelete:t,trigger:n,children:r}){let i=(0,F.useId)(),[a,o]=(0,F.useState)(null),[s,c]=(0,F.useState)(!1),[l,u]=(0,F.useState)(null),d=(0,F.useRef)(!1),f=(0,F.useRef)(null),p=(0,F.useRef)(null),m=(0,F.useCallback)(()=>{let e=f.current?.contains(document.activeElement);o(null),e&&p.current?.isConnected&&p.current.focus({preventScroll:!0})},[]);(0,F.useEffect)(()=>{if(!a)return;let e=f.current?.querySelector(`button`);e&&!e.disabled?e.focus():f.current?.focus()},[a,s]),(0,F.useEffect)(()=>{if(!a)return;function e(e){e.target instanceof Node&&(f.current?.contains(e.target)||n===`button`&&p.current?.contains(e.target)||m())}function t(e){e.key===`Escape`?(e.preventDefault(),e.stopImmediatePropagation(),m()):e.key===`Tab`&&m()}function r(){o(null)}return document.addEventListener(`mousedown`,e),window.addEventListener(`blur`,r),window.addEventListener(`keydown`,t,!0),window.addEventListener(`resize`,m),window.addEventListener(`scroll`,m,!0),()=>{document.removeEventListener(`mousedown`,e),window.removeEventListener(`blur`,r),window.removeEventListener(`keydown`,t,!0),window.removeEventListener(`resize`,m),window.removeEventListener(`scroll`,m,!0)}},[a,m,n]);function h(e,t,n){p.current=e,o({x:Math.max(8,Math.min(t,window.innerWidth-240)),y:Math.max(8,Math.min(n,window.innerHeight-140))})}function g(e){let t=e.getBoundingClientRect();h(e,t.right-224,t.bottom+4)}async function _(){if(t&&!d.current){d.current=!0,c(!0),u(null);try{await t(),m()}catch(e){u(e instanceof Error?e.message:`Unable to delete artifact.`)}finally{d.current=!1,c(!1)}}}return(0,R.jsxs)(`div`,{className:`contents`,onContextMenu:e=>{if(!t||n!==`context`)return;let r=e.currentTarget.querySelector(`button`);r&&(e.preventDefault(),e.stopPropagation(),h(r,e.clientX,e.clientY))},onKeyDown:e=>{if(!t||n!==`context`||!(e.key===`ContextMenu`||e.shiftKey&&e.key===`F10`))return;let r=e.currentTarget.querySelector(`button`);if(!r)return;e.preventDefault(),e.stopPropagation();let i=r.getBoundingClientRect();h(r,i.left,i.bottom)},children:[n===`context`?r:(0,R.jsx)(`button`,{type:`button`,"aria-label":`${e} actions`,title:`Artifact actions`,"aria-haspopup":`menu`,"aria-expanded":!!a,"aria-controls":a?i:void 0,className:`text-muted-foreground hover:bg-muted hover:text-foreground focus-visible:ring-ring shrink-0 rounded-md p-1.5 transition outline-none focus-visible:ring-2`,onClick:e=>{if(a){m();return}g(e.currentTarget)},onKeyDown:e=>{e.key===`ArrowDown`&&(e.preventDefault(),g(e.currentTarget))},children:(0,R.jsx)(l_,{className:`size-4`,"aria-hidden":`true`})}),l&&!a&&(0,jN.createPortal)((0,R.jsxs)(`div`,{role:`alert`,className:`bg-popover text-popover-foreground fixed right-4 bottom-4 z-250 w-80 max-w-[calc(100vw-2rem)] rounded-md border p-3 shadow-md`,children:[(0,R.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,R.jsx)(`p`,{className:`text-destructive text-sm font-medium`,children:`Artifact deletion failed`}),(0,R.jsx)(`button`,{type:`button`,"aria-label":`Dismiss deletion error`,className:`text-muted-foreground hover:text-foreground focus-visible:ring-ring rounded-sm p-1 outline-none focus-visible:ring-2`,onClick:()=>{u(null),p.current?.focus({preventScroll:!0})},children:(0,R.jsx)(Fv,{className:`size-3.5`,"aria-hidden":`true`})})]}),(0,R.jsxs)(`p`,{className:`mt-1 text-sm wrap-break-word`,children:[e,`: `,l]}),(0,R.jsx)(`p`,{className:`text-muted-foreground mt-2 text-xs`,children:`Open the artifact menu to try again.`})]}),document.body),a&&(0,jN.createPortal)((0,R.jsxs)(`div`,{id:i,ref:f,role:`menu`,tabIndex:-1,"aria-label":`${e} actions`,className:`bg-popover text-popover-foreground fixed z-250 w-56 rounded-md border p-1 shadow-md`,style:{left:a.x,top:a.y},children:[(0,R.jsxs)(`button`,{type:`button`,role:`menuitem`,disabled:s,className:`text-destructive hover:bg-muted focus:bg-muted flex w-full items-center gap-2 rounded-sm px-2 py-1.5 text-left text-sm outline-none disabled:opacity-50`,onClick:()=>void _(),children:[(0,R.jsx)(Dv,{className:`size-4`,"aria-hidden":`true`}),s?`Deleting…`:`Delete artifact`]}),l&&(0,R.jsx)(`p`,{role:`alert`,className:`px-2 py-1 text-xs`,children:l})]}),document.body)]})}zd([`markdown`,`html`,`react`]);function qP(e){return e.replace(/<\/(script)/gi,`<\\/$1`).replace(/<!--/g,`<\\!--`)}function JP(e,t){return`<!DOCTYPE html>
439
439
  <html lang="en">
440
440
  <head>
441
441
  <meta charset="utf-8" />
@@ -444,7 +444,7 @@ ${e}</head>
444
444
  <body>
445
445
  ${t}
446
446
  </body>
447
- </html>`}function JP(e){return qP(`<style>
447
+ </html>`}function YP(e){return JP(`<style>
448
448
  html, body, #root { margin: 0; min-height: 100%; }
449
449
  body { font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif; }
450
450
  #artifact-error { margin: 16px; padding: 12px; border: 1px solid #f87171; border-radius: 8px; color: #b91c1c; font: 13px/1.5 ui-monospace, monospace; white-space: pre-wrap; }
@@ -476,7 +476,7 @@ window.require = (name) => {
476
476
  };
477
477
  <\/script>
478
478
  <script type="text/babel" data-presets="react" data-plugins="transform-modules-commonjs">
479
- ${KP(e.trim())}
479
+ ${qP(e.trim())}
480
480
 
481
481
  const __root = document.getElementById('root');
482
482
  const __App = typeof App !== 'undefined' ? App : exports.default;
@@ -485,4 +485,4 @@ if (!__App) {
485
485
  } else {
486
486
  window.createRoot(__root).render(window.React.createElement(__App));
487
487
  }
488
- <\/script>`)}function YP(e){let t=e.trim();return/^<!DOCTYPE html>/i.test(t)||/^<html[\s>]/i.test(t)?t:qP(``,t)}function XP(e,t){return e===`react`?JP(t):e===`html`?YP(t):null}function ZP({title:e,artifactType:t,content:n,localPath:r,workspacePath:i,localError:a,variant:o=`card`,onOpenFullscreen:s,onBack:c,onDelete:l}){let u=(0,F.useMemo)(()=>XP(t,n),[t,n]),[d,f]=(0,F.useState)(!1),[p,m]=(0,F.useState)(!1),h=(0,F.useRef)(null);async function g(){try{await navigator.clipboard.writeText(n),m(!0),h.current!==null&&clearTimeout(h.current),h.current=setTimeout(()=>{m(!1),h.current=null},1500)}catch{m(!1)}}(0,F.useEffect)(()=>()=>{h.current!==null&&clearTimeout(h.current)},[]);function _(t){return(0,R.jsxs)(`div`,{className:`relative min-h-0 flex-1 border-t`,children:[u&&!d?(0,R.jsx)(`iframe`,{title:`${e} preview`,srcDoc:u,sandbox:`allow-scripts`,className:`block w-full bg-white ${t}`}):u?(0,R.jsx)(`pre`,{className:`h-full overflow-auto p-3 pr-10 text-[13px] leading-6`,children:(0,R.jsx)(`code`,{children:n})}):(0,R.jsx)(`div`,{className:`h-full overflow-auto p-3 pr-10`,children:(0,R.jsx)(iP,{content:n,className:`text-foreground text-sm`,imageScope:{workspacePath:i,documentPath:r}})}),(0,R.jsx)(`button`,{type:`button`,className:`bg-card text-muted-foreground hover:text-foreground absolute top-2 right-2 rounded-md border p-1 transition`,"aria-label":p?`Copied`:`Copy`,onClick:()=>void g(),children:p?(0,R.jsx)(Ug,{className:`size-3.5`,"aria-hidden":`true`}):(0,R.jsx)(r_,{className:`size-3.5`,"aria-hidden":`true`})})]})}return(0,R.jsxs)(`div`,{className:o===`full`?`bg-card flex min-h-0 flex-1 flex-col overflow-hidden rounded-lg border`:`bg-card rounded-lg border`,children:[(0,R.jsxs)(`div`,{className:`flex items-center gap-2 px-3 py-2`,children:[c?(0,R.jsx)(`button`,{type:`button`,className:`text-muted-foreground hover:text-foreground shrink-0 transition`,onClick:c,"aria-label":`Back to artifacts`,children:(0,R.jsx)(kg,{className:`size-4`,"aria-hidden":`true`})}):null,(0,R.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-0.5`,children:[(0,R.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,R.jsx)(`span`,{className:`text-foreground min-w-0 truncate text-sm font-medium`,children:e}),(0,R.jsx)(`span`,{className:`text-muted-foreground shrink-0 text-[11px]`,children:t})]}),r?(0,R.jsx)(`span`,{className:`text-muted-foreground min-w-0 truncate text-[11px]`,children:r}):null]}),u?(0,R.jsx)(`button`,{type:`button`,className:`text-muted-foreground hover:text-foreground inline-flex shrink-0 items-center gap-1 rounded-md border px-2 py-1 text-[11px] transition`,onClick:()=>f(e=>!e),"aria-label":d?`Show preview`:`Show source`,children:d?(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(__,{className:`size-3.5`,"aria-hidden":`true`}),`Preview`]}):(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(t_,{className:`size-3.5`,"aria-hidden":`true`}),`Source`]})}):null,s?(0,R.jsx)(`button`,{type:`button`,className:`text-muted-foreground hover:text-foreground shrink-0 transition`,onClick:s,"aria-label":`Open fullscreen`,title:`Open fullscreen`,children:(0,R.jsx)(j_,{className:`size-4`,"aria-hidden":`true`})}):null,l?(0,R.jsx)(GP,{title:e,trigger:`button`,onDelete:l}):null]}),a?(0,R.jsx)(`p`,{role:`alert`,className:`px-3 pb-2 text-[11px] text-amber-800 dark:text-amber-200`,children:a}):null,_(o===`full`?`h-full`:`h-64`)]})}var QP=`Browser sessions are not available yet.`,$P=async()=>{throw Error(QP)},eF=async()=>{throw Error(QP)};function tF(e){return`Closes by ${new Date(e).toLocaleString(void 0,{month:`short`,day:`numeric`,hour:`numeric`,minute:`2-digit`})}`}function nF(e,t){return e instanceof Error&&e.message||t}function rF({liveView:e,active:t}){let[n,r]=(0,F.useState)(null),[i,a]=(0,F.useState)(null),o=e?.threadId,s=e?.id,c=e?.providerSessionId??null,l=e?.humanControl===!0,u=e?.url??null,d=e?.interactiveUrl??null,f=l&&d!==null,p=f?d:u,m=e?.ended===!0,h=o!=null,g=n!==null||m||d==null&&!l,_=e==null?null:tF(e.expiresAt),v=(()=>{let e=[];return _&&e.push(_),l&&!f&&e.push(`Waiting for the interactive view`),e.join(` · `)||null})(),y=l?`You have control`:t?`The agent is browsing`:`Browser session`,b=i!==null&&i.recordId===s&&i.providerId===c?i.message:null;(0,F.useEffect)(()=>{a(null)},[s,c]);async function x(e){if(!(o==null||g)){r(`control`),a(null);try{await $P()}catch(t){a({recordId:s,providerId:c,message:nF(t,e?`Couldn’t take control.`:`Couldn’t give control back.`)})}finally{r(null)}}}async function S(){if(!(s==null||m||n!==null)){r(`stop`),a(null);try{await eF()}catch(e){a({recordId:s,providerId:c,message:nF(e,`Couldn’t stop the browser session.`)})}finally{r(null)}}}return(0,R.jsx)(`div`,{className:`flex min-h-0 flex-1 flex-col`,children:e&&!m?(0,R.jsxs)(R.Fragment,{children:[(0,R.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-2 gap-y-1 border-b px-3 py-1.5`,children:[(0,R.jsx)(`span`,{className:`relative flex size-2 shrink-0`,"aria-hidden":`true`,children:l?(0,R.jsx)(`span`,{className:`relative inline-flex size-2 rounded-full bg-amber-500`}):t?(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(`span`,{className:`absolute inline-flex h-full w-full animate-ping rounded-full bg-emerald-500 opacity-60`}),(0,R.jsx)(`span`,{className:`relative inline-flex size-2 rounded-full bg-emerald-500`})]}):(0,R.jsx)(`span`,{className:`bg-muted-foreground/40 relative inline-flex size-2 rounded-full`})}),(0,R.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,R.jsx)(`span`,{role:`status`,className:`text-muted-foreground text-xs`,children:y}),v?(0,R.jsx)(`p`,{className:`text-muted-foreground text-[10px]`,children:v}):null]}),h?(0,R.jsx)(`button`,{type:`button`,className:`text-foreground hover:bg-muted rounded-md px-2 py-0.5 text-xs font-medium transition disabled:pointer-events-none disabled:opacity-50`,disabled:g,"aria-busy":n===`control`,onClick:()=>{x(!l)},children:n===`control`?l?`Giving control back…`:`Taking control…`:l?`Give control back`:`Take control`}):null,u?(0,R.jsx)(`a`,{href:u,target:`_blank`,rel:`noopener noreferrer`,className:`text-muted-foreground hover:text-foreground rounded-md p-1 transition`,"aria-label":`Open watch-only live view in a new tab`,title:`Open watch-only live view in a new tab`,children:(0,R.jsx)(p_,{className:`size-3.5`,"aria-hidden":`true`})}):null,(0,R.jsx)(`button`,{type:`button`,className:`flex size-7 shrink-0 cursor-pointer items-center justify-center rounded-full bg-rose-500/90 text-white transition-all duration-150 hover:scale-105 hover:bg-rose-500 disabled:pointer-events-none disabled:opacity-60 disabled:hover:scale-100`,"aria-label":`Stop browser session`,title:`Stop browser session`,"aria-busy":n===`stop`,disabled:n!==null,onClick:()=>{S()},children:n===`stop`?(0,R.jsx)(V_,{className:`size-3.5 animate-spin`,"aria-hidden":`true`}):(0,R.jsx)(yv,{className:`size-3 fill-current`,"aria-hidden":`true`})})]}),b?(0,R.jsx)(`p`,{className:`text-destructive border-b px-3 py-1.5 text-xs`,role:`alert`,children:b}):null,p?(0,R.jsx)(`iframe`,{src:p,title:f?`Agent browser (interactive)`:`Agent browser`,className:`min-h-0 w-full flex-1 border-0`,allow:`clipboard-read; clipboard-write`},p):(0,R.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col items-center justify-center gap-2 p-6 text-center`,children:[(0,R.jsx)(V_,{className:`text-muted-foreground size-5 animate-spin`,"aria-hidden":`true`}),(0,R.jsx)(`p`,{className:`text-muted-foreground text-sm`,children:`Starting the live view…`}),(0,R.jsx)(`p`,{className:`text-muted-foreground text-xs`,children:`The agent is browsing in the meantime.`})]})]}):m||e===null?(0,R.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col items-center justify-center gap-2 p-6 text-center`,children:[(0,R.jsx)(N_,{className:`text-muted-foreground size-5`,"aria-hidden":`true`}),(0,R.jsx)(`p`,{className:`text-muted-foreground text-sm`,role:`status`,children:`${m?`Browser session ended.`:`No active browser session.`} When the agent browses again, a new session will appear here.`})]}):(0,R.jsx)(`div`,{className:`flex min-h-0 flex-1 items-center justify-center`,children:(0,R.jsx)(V_,{className:`text-muted-foreground size-5 animate-spin`,"aria-hidden":`true`})})})}var iF={markdown:C_,html:N_,react:y_},aF=[{id:`artifacts`,label:`Artifacts`},{id:`live`,label:`Live view`}];function oF({artifacts:e,workspacePath:t,onDeleteArtifact:n,selectedKey:r,tab:i,liveView:a,liveActive:o,expanded:s,stale:c=!1,error:l=null,onSelect:u,onBack:d,onTabChange:f,onOpenFullscreen:p,onToggleExpanded:m,onClose:h}){let g=e.find(e=>e.key===r)??null;function _(e){document.getElementById(`side-panel-tab-${e}`)?.focus()}function v(e){let t=aF.findIndex(e=>e.id===i),n=-1;e.key===`ArrowRight`?n=(t+1)%aF.length:e.key===`ArrowLeft`?n=(t-1+aF.length)%aF.length:e.key===`Home`?n=0:e.key===`End`&&(n=aF.length-1),n!==-1&&(e.preventDefault(),f(aF[n].id),_(aF[n].id))}return(0,F.useEffect)(()=>{if(!s)return;let e=e=>{e.key===`Escape`&&(document.fullscreenElement||document.querySelector(`[data-artifact-screen-fullscreen]`)||document.querySelector(`[data-image-viewer]`)||(e.preventDefault(),m()))};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[s,m]),(0,R.jsxs)(`aside`,{className:`bg-background flex h-full min-h-0 w-full flex-col ${s?``:`border-l`}`,children:[(0,R.jsxs)(`div`,{className:`flex items-center gap-1 border-b px-2 py-1.5`,children:[(0,R.jsx)(`div`,{role:`tablist`,"aria-label":`Side panel views`,className:`flex items-center gap-1`,children:aF.map(e=>(0,R.jsx)(`button`,{type:`button`,role:`tab`,id:`side-panel-tab-${e.id}`,"aria-controls":`side-panel-tabpanel`,"aria-selected":i===e.id,tabIndex:i===e.id?0:-1,className:`rounded-md px-2.5 py-1 text-xs font-medium transition ${i===e.id?`bg-muted text-foreground`:`text-muted-foreground hover:text-foreground`}`,onClick:()=>f(e.id),onKeyDown:v,children:(0,R.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[e.id===`live`&&o&&i!==`live`?(0,R.jsx)(`span`,{className:`size-1.5 animate-pulse rounded-full bg-emerald-500`,"aria-hidden":`true`}):null,e.label]})},e.id))}),(0,R.jsx)(`div`,{className:`flex-1`}),(0,R.jsx)(`button`,{type:`button`,className:`text-muted-foreground hover:text-foreground rounded-md p-1 transition`,onClick:m,"aria-label":s?`Exit full workspace`:`Expand to full workspace`,title:s?`Exit full workspace`:`Expand to full workspace`,"aria-pressed":s,children:s?(0,R.jsx)(pv,{className:`size-4`,"aria-hidden":`true`}):(0,R.jsx)(d_,{className:`size-4`,"aria-hidden":`true`})}),(0,R.jsx)(`button`,{type:`button`,className:`text-muted-foreground hover:text-foreground rounded-md p-1 transition`,onClick:h,"aria-label":`Close panel`,children:(0,R.jsx)(Fv,{className:`size-4`,"aria-hidden":`true`})})]}),(0,R.jsx)(`div`,{role:`tabpanel`,id:`side-panel-tabpanel`,"aria-labelledby":`side-panel-tab-${i}`,className:`flex min-h-0 flex-1 flex-col`,children:i===`live`?(0,R.jsx)(rF,{liveView:a,active:o}):(0,R.jsxs)(R.Fragment,{children:[l||c?(0,R.jsxs)(`div`,{className:`space-y-1 border-b px-3 py-2`,children:[l?(0,R.jsx)(`p`,{role:`alert`,className:`text-xs text-amber-800 dark:text-amber-200`,children:l}):null,c?(0,R.jsx)(`p`,{role:`status`,className:`text-muted-foreground text-xs`,children:`Showing last known artifacts while Sprocket reconnects.`}):null]}):null,g?(0,R.jsx)(`div`,{className:`flex min-h-0 flex-1 flex-col p-3`,children:(0,R.jsx)(ZP,{title:g.title,artifactType:g.artifactType,content:g.content,localPath:g.localPath,workspacePath:t,localError:g.localError,variant:`full`,onOpenFullscreen:()=>p(g.key),onBack:d,onDelete:n?()=>n(g.key):void 0})}):(0,R.jsx)(`div`,{className:`min-h-0 flex-1 space-y-0.5 overflow-y-auto p-2`,children:e.length===0?(0,R.jsx)(`p`,{className:`text-muted-foreground p-3 text-sm`,children:`No artifacts yet.`}):e.map(e=>{let t=iF[e.artifactType];return(0,R.jsxs)(`div`,{className:`group hover:bg-muted focus-within:bg-muted flex items-center gap-2 rounded-md px-2 py-1.5`,children:[(0,R.jsx)(GP,{trigger:`context`,title:e.title,onDelete:n?()=>n(e.key):void 0,children:(0,R.jsxs)(`button`,{type:`button`,className:`flex min-w-0 flex-1 items-center gap-2 text-left`,onClick:()=>u(e.key),children:[(0,R.jsx)(t,{className:`text-muted-foreground size-3.5 shrink-0`,"aria-hidden":`true`}),(0,R.jsxs)(`span`,{className:`flex min-w-0 flex-1 flex-col`,children:[(0,R.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2`,children:[(0,R.jsx)(`span`,{className:`text-foreground min-w-0 truncate text-sm`,children:e.title}),(0,R.jsx)(`span`,{className:`text-muted-foreground shrink-0 text-[11px]`,children:e.artifactType})]}),(0,R.jsx)(`span`,{className:`text-muted-foreground min-w-0 truncate text-[11px]`,children:e.localPath??`Stored in cloud`}),e.localError?(0,R.jsx)(`span`,{className:`text-[11px] text-amber-800 dark:text-amber-200`,children:e.localError}):null]})]})}),(0,R.jsx)(`button`,{type:`button`,className:`text-muted-foreground hover:text-foreground shrink-0 opacity-0 transition group-focus-within:opacity-100 group-hover:opacity-100 focus:opacity-100`,onClick:()=>p(e.key),"aria-label":`Open ${e.title} fullscreen`,title:`Open fullscreen`,children:(0,R.jsx)(j_,{className:`size-3.5`,"aria-hidden":`true`})})]},e.key)})})]})})]})}function sF({artifact:e,workspacePath:t,onClose:n}){let r=(0,F.useMemo)(()=>XP(e.artifactType,e.content),[e.artifactType,e.content]),i=(0,F.useRef)(null),[a,o]=(0,F.useState)(!1),s=(0,F.useRef)(n);return(0,F.useLayoutEffect)(()=>{s.current=n},[n]),(0,F.useEffect)(()=>{let e=i.current;if(!e)return;let t=!0,n=!!document.fullscreenElement,r=document.activeElement instanceof HTMLElement?document.activeElement:null,a=()=>{t&&(t=!1,s.current())},c=()=>{if(document.fullscreenElement){n=!0,o(!1);return}if(n){if(document.querySelector(`[data-image-viewer]`)){n=!1,o(!0);return}a()}},l=e=>{document.querySelector(`[data-image-viewer]`)||e.key===`Escape`&&(e.stopImmediatePropagation(),!(document.fullscreenElement||n)&&(e.preventDefault(),a()))};document.addEventListener(`fullscreenchange`,c),window.addEventListener(`keydown`,l,!0),queueMicrotask(()=>{t&&e.focus()});let u=window.setTimeout(()=>{t&&!document.fullscreenElement&&o(!0)},250);return()=>{t=!1,window.clearTimeout(u),document.removeEventListener(`fullscreenchange`,c),window.removeEventListener(`keydown`,l,!0),document.fullscreenElement&&document.exitFullscreen?.().catch(()=>{});let e=r;queueMicrotask(()=>{e?.isConnected&&e.focus()})}},[]),(0,R.jsxs)(`div`,{ref:i,"data-artifact-screen-fullscreen":``,className:`bg-background fixed inset-0 z-200 flex h-screen w-screen flex-col outline-none`,role:`dialog`,"aria-modal":`true`,"aria-label":`${e.title} fullscreen. Press Escape to exit.`,tabIndex:-1,children:[r?(0,R.jsx)(`iframe`,{title:`${e.title} preview`,srcDoc:r,sandbox:`allow-scripts`,className:`block h-full w-full flex-1 bg-white`}):(0,R.jsx)(`div`,{className:`min-h-0 flex-1 overflow-auto p-6`,children:(0,R.jsx)(iP,{content:e.content,className:`text-foreground text-sm`,imageScope:{workspacePath:t,documentPath:e.localPath}})}),a?(0,R.jsx)(`button`,{type:`button`,className:`bg-background/90 text-muted-foreground hover:text-foreground absolute top-3 right-3 z-10 rounded-md border p-2 transition`,onClick:n,"aria-label":`Exit fullscreen`,children:(0,R.jsx)(Fv,{className:`size-4`,"aria-hidden":`true`})}):null]})}var cF={artifacts:[],stale:!1,error:null};function lF(e){return[e.userId,e.repositoryKey,e.workspacePath].join(`\0`)}function uF(e){return{key:e._id,title:e.title,artifactType:e.type,content:e.content,localPath:e.localPath,localError:e.localError}}function dF(e){return!e.aborted&&e.generation===e.currentGeneration&&e.currentScopeKey===e.eventScopeKey}function fF(e){return{artifacts:e.artifacts,stale:e.stale,error:e.error??null}}function pF(e,t){let n=new Map(e.artifacts.map(e=>[e._id,e]));for(let r of t?.artifacts??[])(e.stale||n.has(r._id))&&(r.localPath||!n.has(r._id))&&n.set(r._id,r);return{artifacts:[...n.values()],stale:e.stale&&(!t||t.stale),error:t?.error??e.error}}function mF(e,t,n){let{userId:r,...i}=t,a=!1,o=0,s,c=[];async function l(t){try{let s=[],l=null,u;for(;;){let n=await e.query(Jp.artifacts.listArtifacts,{...i,cursor:l});if(a||o!==t)return;if(u!==void 0&&u!==n.revision)throw Error(`Artifact registry changed during loading; retrying.`);if(u=n.revision,s.push(...n.page.filter(e=>e.userId===r)),n.isDone)break;if(l===n.continueCursor)throw Error(`Artifact page cursor did not advance.`);l=n.continueCursor}c=s,n({artifacts:s,stale:!1,error:null})}catch(e){if(a||o!==t)return;n({artifacts:c,stale:!0,error:e instanceof Error?e.message:`Unable to load artifacts.`}),s=setTimeout(()=>{l(t)},2e3)}}let u=e.onUpdate(Jp.artifacts.getArtifactState,{repositoryKey:t.repositoryKey},()=>{clearTimeout(s),l(++o)},e=>{o++,clearTimeout(s),c=[],n({artifacts:[],stale:!0,error:e.message})});return()=>{a=!0,clearTimeout(s),u()}}var hF={open:!1,expanded:!1,tab:`artifacts`,selectedKey:null},gF=class{watchState={...cF};panel={...hF};fullscreenKey=null;#e=0;#t=null;#n=new Map;#r=null;#i=0;#a=new Set;getSnapshot=()=>this.#i;subscribe=e=>(this.#a.add(e),()=>{this.#a.delete(e)});get artifacts(){return this.watchState.artifacts.map(uF)}get fullscreenArtifact(){return this.artifacts.find(e=>e.key===this.fullscreenKey)??null}selectScope(e){let t=e?lF(e):null;t!==this.#r&&(this.#r&&this.#n.set(this.#r,this.panel),this.#r=t,this.fullscreenKey=null,this.panel={...t&&this.#n.get(t)||hF},this.#o())}watch(e){let t=++this.#e;if(this.watchState={...cF},this.#o(),!e.scope){this.#t=null;return}let n=lF(e.scope);this.#t=n;let r=new AbortController,i={artifacts:[],stale:!0,error:null},a=null,o=()=>{r.signal.aborted||t!==this.#e||(this.watchState=pF(i,a),this.#o())},s={userId:e.scope.userId,repositoryKey:e.scope.repositoryKey},c=e.cloudReady?mF(e.artifactClient,s,e=>{i=e,o()}):()=>{};return this.#s(e.localApi,e.scope.workspacePath,e.scope,{ac:r,generation:t,scopeKey:n,setLocal:e=>{a=e,o()}}),()=>{r.abort(),c()}}reset(){this.#n.clear(),this.#r=null,this.#t=null,this.panel={...hF},this.fullscreenKey=null,this.#o()}update(e){this.panel={...this.panel,...e},this.#o()}setFullscreenKey(e){this.fullscreenKey!==e&&(this.fullscreenKey=e,this.#o())}#o(){this.#i+=1;for(let e of this.#a)e()}async#s(e,t,n,r){if(e&&t)for(;!r.ac.signal.aborted;)await e.watchArtifacts(n,{signal:r.ac.signal,onEvent:e=>{dF({aborted:r.ac.signal.aborted,generation:r.generation,currentGeneration:this.#e,eventScopeKey:r.scopeKey,currentScopeKey:this.#t})&&r.setLocal(fF(e))}}).catch(()=>void 0),!r.ac.signal.aborted&&r.generation===this.#e&&this.#t===r.scopeKey&&r.setLocal(null),r.ac.signal.aborted||await new Promise(e=>setTimeout(e,1e3))}};function _F(){let[e]=(0,F.useState)(()=>new gF);return Wm(e),e}function vF(e){return{query:(t,n)=>e.query(t,n),onUpdate:(t,n,r,i)=>{let a=e.watchQuery(t,n),o=()=>{try{let e=a.localQueryResult();e!==void 0&&r(e)}catch(e){i(e instanceof Error?e:Error(String(e)))}};return o(),a.onUpdate(o)}}}function yF(e){return e.startsWith(`./`)||e.startsWith(`../`)||e.startsWith(`.\\`)||e.startsWith(`..\\`)||e.startsWith(`/`)||e.startsWith(`\\`)||e.startsWith(`~/`)||e===`~`||/^[a-zA-Z]:([\\/]|$)/.test(e)}function bF(e){if(e.endsWith(`/`)||e.endsWith(`\\`))return e;let t=e.lastIndexOf(`/`),n=e.lastIndexOf(`\\`),r=Math.max(t,n);return r<0?e:e.slice(0,r+1)}function xF(e){let t=bF(e);return e.slice(t.length)}function SF(e){return!e||TF(e)?e:`${e}${wF(e)}`}function CF(e){let t=e.trim();return t===`/`||t===`\\`||/^[a-zA-Z]:?$/.test(t)||/^[\\/][a-zA-Z]:?$/.test(t)}function wF(e){return e.includes(`\\`)||/^[a-zA-Z]:$/.test(e)?`\\`:`/`}function TF(e){return/[\\/]$/.test(e)}function EF(e){return e.replace(/[\\/]+$/,``)}function DF(e){if(!e.leaf)return;let t=e.browseEntries.find(t=>t.name!==`..`&&t.name===e.leaf);if(t)return t.fullPath;if(e.browseParentPath){let t=e.browseParentPath.split(/[/\\]/).filter(Boolean).at(-1);if(t&&t.toLowerCase()===e.leaf.toLowerCase())return e.browseParentPath}}function OF(e){let t=e.query.trim();return t?TF(t)?e.browseParentPath||EF(t):DF({leaf:xF(t),browseParentPath:e.browseParentPath,browseEntries:e.browseEntries})??t:``}function kF(e){let t=e.query.trim();if(!t||TF(t))return!1;let n=xF(t);return n?DF({leaf:n,browseParentPath:e.browseParentPath,browseEntries:e.browseEntries})===void 0:!1}function AF({open:e,desktopApi:t,mode:n=`add`,expectedDisplayName:r,recentProjectPaths:i=[],onClose:a,onSelect:o}){let[s,c]=(0,F.useState)(`~/`),[l,u]=(0,F.useState)([]),[d,f]=(0,F.useState)(``),[p,m]=(0,F.useState)(!1),[h,g]=(0,F.useState)(null),[_,v]=(0,F.useState)(!1),[y,b]=(0,F.useState)(!1),[x,S]=(0,F.useState)(null),[C,w]=(0,F.useState)(null),[T,E]=(0,F.useState)(!1),D=(0,F.useRef)(`~/`),ee=(0,F.useRef)(!1),O=(0,F.useRef)(null),te=(0,F.useRef)(null),ne=(0,F.useRef)(0),re=(0,F.useRef)(null),ie=(0,F.useRef)(!1),k=(0,F.useCallback)(e=>{D.current=e,c(e)},[]),ae=(0,F.useCallback)(e=>{ee.current=e,m(e)},[]),A=(0,F.useCallback)(async e=>{let n=++ne.current;re.current=e,v(!0);try{let r=await t.browseFilesystem({partialPath:e.trim().length>0?e:`~/`});if(n!==ne.current||e!==D.current)return;f(r.parentPath),u(r.entries),ae(r.volumeList===!0),w(e),S(null)}catch(t){if(n!==ne.current||e!==D.current)return;f(``),u([]),ae(!1),w(e),re.current=null,S(t instanceof Error?t.message:`Failed to browse directories.`)}finally{n===ne.current&&v(!1)}},[t,ae]),oe=xF(s).toLowerCase(),se=s===C,ce=se?d:``,le=se?l:[],ue=(0,F.useMemo)(()=>{if(!se)return[];if(p){let e=s.trim().replace(/^[\\/]+/,``).toLowerCase();return l.filter(t=>t.name.toLowerCase().startsWith(e)||t.fullPath.toLowerCase().startsWith(e))}let e=oe.startsWith(`.`);return l.filter(t=>t.name!==`..`&&t.name.toLowerCase().startsWith(oe)&&(e||!t.name.startsWith(`.`)))},[se,p,s,l,oe]),de=s.trim(),fe=OF({query:s,browseParentPath:ce,browseEntries:le}),pe=kF({query:s,browseParentPath:ce,browseEntries:le}),me=se&&!p&&!x&&fe.length>0&&(yF(de)||ce.length>0),he=n===`reconnect`?`Reconnect`:pe?`Create & add`:`Add`,ge=le.find(e=>e.name===`..`),_e=(0,F.useMemo)(()=>{if(ue.length>0)return ue;let e=xF(s).replace(/[\\/]+$/,``);if(!e||oe.length===0)return ue;let t=ce.split(/[/\\]/).filter(Boolean).at(-1);return t&&t.toLowerCase()===e.toLowerCase()?[{name:t,fullPath:ce}]:ue},[ue,s,oe,ce]),ve=_||!se?`Loading directories…`:p?`Select a drive.`:fe.length>0&&!pe?n===`reconnect`?`Press Ctrl+Enter to reconnect this directory.`:`Press Ctrl+Enter to add this directory.`:pe?n===`reconnect`?`Press Ctrl+Enter to create and reconnect this directory.`:`Press Ctrl+Enter to create and add this directory.`:`No matching directories in this path.`,ye=_e.findIndex(e=>e.fullPath===h),j=ye<0?void 0:_e[ye];(0,F.useEffect)(()=>{if(!e){E(!1);return}T||(E(!0),k(`~/`),g(null),S(null),ae(!1),w(null),A(`~/`))},[e,T,A,k,ae]),(0,F.useEffect)(()=>{T&&O.current?.focus()},[T]),(0,F.useEffect)(()=>{if(!e||!T)return;let t=s;if(t===re.current)return;let n=window.setTimeout(()=>{ee.current&&CF(t)||A(t)},180);return()=>{window.clearTimeout(n)}},[e,T,s,A]),(0,F.useEffect)(()=>{e&&!_&&_e.length!==0&&(_e.some(e=>e.fullPath===h)||g(_e[0]?.fullPath??null))},[e,_,_e,h]),(0,F.useEffect)(()=>{e&&ie.current&&(ie.current=!1,(te.current?.querySelector(`[aria-selected="true"]`))?.scrollIntoView?.({block:`nearest`}))},[e,h,_e]);function M(e){let t=SF(e.fullPath);k(t),g(null),A(t)}function be(e){let t=SF(e.workspacePath);k(t),g(e.workspacePath),A(t)}async function xe(){if(p)return;let e=fe;if(!e){S(`Enter a project directory path.`);return}b(!0),S(null);try{let n=await t.resolveWorkspacePath({workspacePath:e,createIfMissing:pe});await o({workspacePath:n.workspacePath,displayName:n.displayName,repositoryKey:n.repositoryKey}),a()}catch(e){S(e instanceof Error?e.message:`Failed to open the selected project.`)}finally{b(!1)}}function N(e){if(_e.length===0)return;let t=((ye<0?e===1?-1:0:ye)+e+_e.length)%_e.length;ie.current=!0,g(_e[t]?.fullPath??null)}function Se(){ge&&!_&&M(ge)}function Ce(e){return e.target instanceof HTMLInputElement?oe.length===0:!0}function we(e){if(!(e.defaultPrevented||e.nativeEvent.isComposing)){if(e.key===`Escape`){e.preventDefault(),a();return}if(e.key===`Enter`&&(e.ctrlKey||e.metaKey)&&me&&!y){e.preventDefault(),xe();return}if(!(e.ctrlKey||e.metaKey||e.altKey||e.shiftKey)&&!_){if(e.key===`ArrowDown`||e.key===`ArrowUp`){e.preventDefault(),N(e.key===`ArrowDown`?1:-1);return}if(e.key===`Enter`&&j){if(e.target instanceof Element&&e.target.closest(`[data-project-submit]`))return;e.preventDefault(),M(j);return}e.key===`Backspace`&&ge&&Ce(e)&&(e.preventDefault(),Se())}}}return e?(0,R.jsx)(`div`,{className:`bg-overlay fixed inset-0 z-50 flex items-start justify-center px-4 pt-[7vh] backdrop-blur-[2px]`,role:`presentation`,onClick:e=>{e.target===e.currentTarget&&a()},children:(0,R.jsxs)(`div`,{className:`border-border bg-popover text-foreground flex h-[min(34rem,80vh)] w-full max-w-3xl min-w-0 flex-col overflow-hidden rounded-[1.4rem] border shadow-2xl`,role:`dialog`,"aria-modal":`true`,"aria-label":n===`reconnect`?`Reconnect project`:`Add project`,tabIndex:-1,onKeyDown:we,children:[(0,R.jsxs)(`header`,{className:`flex-none px-4 pt-3 pb-2`,children:[(0,R.jsxs)(`div`,{className:`flex min-h-10 items-center gap-1.5`,children:[(0,R.jsx)(`button`,{type:`button`,className:`text-muted-foreground hover:text-foreground hover:bg-hover-fill flex size-8 shrink-0 items-center justify-center rounded-lg transition disabled:pointer-events-none disabled:opacity-30`,"aria-label":`Go to parent directory`,disabled:!ge||_,onClick:Se,children:(0,R.jsx)(kg,{className:`size-4`,strokeWidth:2})}),(0,R.jsx)(`input`,{className:`text-foreground placeholder:text-muted-foreground min-w-0 flex-1 bg-transparent py-2 text-base outline-none`,ref:O,value:s,onChange:e=>k(e.currentTarget.value),placeholder:`Enter a project path`,"aria-label":`Project directory path`,"aria-controls":`project-picker-directories`,"aria-activedescendant":ye<0?void 0:`project-picker-directory-${ye}`,"aria-autocomplete":`list`,"aria-expanded":`true`,role:`combobox`,autoComplete:`off`,spellCheck:!1}),_&&(0,R.jsx)(V_,{className:`text-muted-foreground pointer-events-none size-4 shrink-0 animate-spin`}),(0,R.jsxs)(`button`,{type:`button`,className:`border-border text-foreground bg-hover-fill hover:bg-hover-fill-strong flex shrink-0 items-center gap-1.5 rounded-lg border px-2.5 py-1 text-sm transition disabled:cursor-not-allowed disabled:opacity-40`,"data-project-submit":!0,disabled:!me||y,onClick:()=>{xe()},children:[(0,R.jsx)(`span`,{children:y?`Working…`:he}),!y&&(0,R.jsx)(`kbd`,{className:`text-muted-foreground font-sans text-xs`,children:`Ctrl Enter`})]})]}),n===`reconnect`&&r&&(0,R.jsxs)(`p`,{className:`text-muted-foreground px-9 pb-1 text-xs`,children:[`Reconnect `,(0,R.jsx)(`span`,{className:`text-muted-foreground`,children:r}),` to a local directory`]})]}),i.length>0&&(0,R.jsx)(`div`,{className:`border-hairline flex flex-wrap gap-1.5 border-b px-5 py-2`,children:i.map(e=>(0,R.jsx)(`button`,{type:`button`,className:`text-muted-foreground hover:text-foreground hover:bg-hover-fill rounded-md px-2 py-0.5 text-[11px] transition`,onClick:()=>{be(e)},children:e.displayName},e.workspacePath))}),(0,R.jsx)(`div`,{className:`text-muted-foreground flex-none px-6 pt-3 pb-1 text-sm`,children:`Directories`}),(0,R.jsx)(`div`,{id:`project-picker-directories`,className:`min-h-0 flex-1 overflow-y-auto px-2 pb-2`,ref:te,role:`listbox`,"aria-label":`Directories`,"aria-busy":_,children:_e.length===0?(0,R.jsx)(`p`,{className:`text-muted-foreground px-3 py-8 text-center text-sm`,children:ve}):_e.map((e,t)=>(0,R.jsxs)(`button`,{id:`project-picker-directory-${t}`,type:`button`,className:`flex min-h-10 w-full items-center gap-2.5 rounded-lg px-3 py-1.5 text-left text-base transition ${h===e.fullPath?`text-foreground bg-hover-fill-strong`:`text-muted-foreground hover:text-foreground hover:bg-hover-fill`}`,role:`option`,"aria-selected":h===e.fullPath,onClick:()=>{M(e)},onPointerMove:()=>{g(e.fullPath)},children:[(0,R.jsx)(k_,{className:`text-muted-foreground size-5 shrink-0`,strokeWidth:1.8}),(0,R.jsx)(`span`,{className:`truncate`,children:e.name})]},e.fullPath))}),x&&(0,R.jsx)(`p`,{className:`text-destructive border-t border-rose-500/20 bg-rose-500/10 px-3 py-2 text-sm`,children:x}),(0,R.jsx)(`footer`,{className:`text-muted-foreground border-hairline flex-none border-t px-5 py-3 text-sm`,children:(0,R.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-4 gap-y-2`,children:[(0,R.jsxs)(`span`,{className:`flex items-center gap-1.5`,children:[(0,R.jsx)(`kbd`,{className:`shortcut-key`,children:`↑`}),(0,R.jsx)(`kbd`,{className:`shortcut-key`,children:`↓`}),` Navigate`]}),(0,R.jsxs)(`span`,{className:`flex items-center gap-1.5`,children:[(0,R.jsx)(`kbd`,{className:`shortcut-key`,children:`Enter`}),` Select`]}),(0,R.jsxs)(`span`,{className:`flex items-center gap-1.5`,children:[(0,R.jsx)(`kbd`,{className:`shortcut-key`,children:`Backspace`}),` Back`]}),(0,R.jsxs)(`span`,{className:`flex items-center gap-1.5`,children:[(0,R.jsx)(`kbd`,{className:`shortcut-key`,children:`Esc`}),` Close`]})]})})]})}):null}function jF(e){return e.map(e=>P.literal(e))}var MF=P.union(...jF(Ob)),NF=P.union(...jF([`spikonado`,`openai`,`chatgpt`]));P.string(),P.union(P.literal(`monthly`),P.literal(`annual`)),P.union(P.literal(`test`),P.literal(`live`)),P.union(P.literal(`active`),P.literal(`on_hold`),P.literal(`cancelled`),P.literal(`expired`),P.literal(`failed`)),P.union(P.literal(`awaiting_payment`),P.literal(`pending`),P.literal(`succeeded`),P.literal(`failed`),P.literal(`expired`),P.literal(`unknown`));var PF=P.object({path:P.string(),directory:P.string(),contents:P.string(),truncated:P.boolean()}),FF=P.object({patch:P.string()}),IF=P.object({cmd:P.string(),workdir:P.optional(P.string()),shell:P.optional(P.string()),timeoutMs:P.optional(P.number()),yieldTimeMs:P.optional(P.number()),maxOutputChars:P.optional(P.number())}),LF=P.object({url:P.string()}),RF=LF.pick(`url`),zF=P.object({query:P.string(),numResults:P.optional(P.number())}),BF=P.object({sessionId:P.string(),chars:P.optional(P.string()),terminate:P.optional(P.boolean()),yieldTimeMs:P.optional(P.number())}),VF=P.object({sessionId:P.string(),action:P.union(P.literal(`write`),P.literal(`terminate`)),chars:P.optional(P.string()),yieldTimeMs:P.optional(P.number())}),HF=BF.pick(`sessionId`,`yieldTimeMs`),UF=P.union(P.literal(`markdown`),P.literal(`html`),P.literal(`react`)),WF=P.union(P.literal(`thread`),P.literal(`project`)),GF=P.object({scope:P.optional(WF)}),KF=P.object({artifactId:P.string()}),qF=P.object({title:P.string(),contentType:UF,content:P.string()}),JF=P.object({artifactId:P.string(),content:P.string()}),YF=P.object({name:P.string()}),XF=P.object({instruction:P.optional(P.string()),action:P.optional(P.object({selector:P.string(),description:P.string(),method:P.optional(P.string()),arguments:P.optional(P.array(P.string()))})),startUrl:P.optional(P.string())}),ZF=P.object({command:P.string(),enforce_saving:P.optional(P.boolean())}),QF=P.union(...jF([`one_time`,`weekly`,`monthly`,`yearly`])),$F=P.union(P.literal(`listed`),P.literal(`any`)),eI=P.union(...jF([`pending`,`active`,`paused`,`consumed`,`cancelled`,`expired`]));P.union(P.literal(`awaiting_result`),P.literal(`completed`),P.literal(`declined`),P.literal(`failed`));var tI=P.union(P.literal(`approved`),P.literal(`declined`)),nI=P.object({userEmail:P.optional(P.string()),merchantName:P.optional(P.string()),merchantUrl:P.optional(P.string()),countryCode:P.optional(P.string()),amountCap:P.string(),currency:P.string(),frequency:QF,scope:$F,description:P.string(),maxCharges:P.optional(P.number()),validUntil:P.optional(P.string())}),rI=P.object({mandateId:P.string()}),iI=P.object({mandateId:P.string(),amount:P.string(),currency:P.string(),description:P.string(),reference:P.optional(P.string())}),aI=P.object({chargeId:P.string(),outcome:tI,amountPaid:P.optional(P.string())}),oI=P.object({id:P.string(),label:P.string()}),sI=P.object({question:P.string(),options:P.array(oI),yieldTimeMs:P.optional(P.number()),timeoutMs:P.optional(P.union(P.number(),P.null()))}),cI=P.object({questionId:P.id(`agentQuestions`),yieldTimeMs:P.optional(P.number())}),lI=P.union(P.object({path:P.string()}),P.object({url:P.string()})),uI=P.object({threadId:P.optional(P.id(`threadRecords`)),prompt:P.string(),model:P.optional(P.string()),reasoning:P.optional(P.string()),fast:P.optional(P.boolean()),yieldTimeMs:P.optional(P.number()),timeoutMs:P.optional(P.number())}),dI=uI.partial().extend({threadId:P.id(`threadRecords`),action:P.union(P.literal(`send`),P.literal(`stop`),P.literal(`answer_question`)),questionId:P.optional(P.id(`agentQuestions`)),optionId:P.optional(P.string()),text:P.optional(P.string())}),fI=P.object({threadId:P.id(`threadRecords`),cursor:P.optional(P.string()),yieldTimeMs:P.optional(P.number())}),pI=P.object({parentThreadId:P.optional(P.id(`threadRecords`)),cursor:P.optional(P.string())}),mI=P.union(P.object({}),lI,uI,dI,fI,pI,FF,sI,cI,IF,YF,LF,RF,zF,BF,VF,HF,GF,KF,qF,JF,nI,rI,iI,aI);P.union(mI,XF,ZF);var hI=P.object({changes:P.array(P.object({path:P.string(),source:P.optional(P.string()),operation:P.union(P.literal(`created`),P.literal(`updated`),P.literal(`deleted`),P.literal(`renamed`),P.literal(`copied`))}))}),gI=P.object({command:P.string(),cwd:P.string(),output:P.string(),sessionId:P.optional(P.string()),exitCode:P.optional(P.number()),success:P.boolean(),running:P.boolean(),timedOut:P.boolean(),truncated:P.boolean(),error:P.optional(P.string())}),_I=P.object({output:P.string(),exitCode:P.optional(P.number()),success:P.boolean(),running:P.boolean(),timedOut:P.boolean(),completeLogPath:P.string(),eventsPath:P.string(),error:P.optional(P.string())}),vI=_I.extend({sessionId:P.optional(P.string())}),yI=_I.extend({command:P.string(),workdir:P.string()}),bI=P.object({url:P.string(),markdown:P.string(),truncated:P.optional(P.boolean()),summary:P.optional(P.string()),images:P.optional(P.array(P.string()))});P.union(P.object({url:P.string(),markdown:P.string(),summary:P.string(),images:P.array(P.string())}),P.object({url:P.string(),summary:P.string(),scrapeUrl:P.string()})),P.object({url:P.string(),screenshotUrl:P.string()});var xI=P.object({outputType:P.literal(`image`),url:P.string(),path:P.string(),mediaType:P.string(),byteSize:P.number(),width:P.number(),height:P.number()}),SI=P.object({results:P.array(P.object({title:P.optional(P.string()),url:P.string(),publishedDate:P.optional(P.string()),author:P.optional(P.string()),text:P.optional(P.string())}))}),CI=P.object({mandateId:P.id(`mandates`),approvalUrl:P.string(),expiresAt:P.string()}),wI=P.object({mandateId:P.id(`mandates`),pravaMandateId:P.optional(P.string()),status:eI,description:P.optional(P.string()),merchantName:P.optional(P.string()),amountCap:P.string(),remaining:P.optional(P.string()),currency:P.string(),frequency:QF,scope:$F,approvalUrl:P.optional(P.string()),validUntil:P.optional(P.string()),renewsAt:P.optional(P.string())}),TI=P.object({mandates:P.array(P.object({mandateId:P.optional(P.id(`mandates`)),pravaMandateId:P.string(),status:P.string(),description:P.optional(P.string()),merchantName:P.optional(P.string()),approvedAmount:P.string(),remaining:P.optional(P.string()),currency:P.string(),validUntil:P.optional(P.string()),renewsAt:P.optional(P.string())}))}),EI=P.object({chargeId:P.id(`mandateCharges`),transactionId:P.string(),token:P.optional(P.string()),dynamicCvv:P.optional(P.string()),expiryMonth:P.optional(P.string()),expiryYear:P.optional(P.string())}),DI=P.object({reported:P.boolean(),alreadyReported:P.optional(P.boolean()),inFlight:P.optional(P.boolean())}),OI=P.object({text:P.string(),truncated:P.boolean()}),kI=P.object({mediaType:P.literal(`image/png`),dataBase64:P.string(),byteLength:P.number(),truncated:P.boolean(),url:P.optional(P.string())}),AI=xI.omit(`url`).extend({mediaType:P.literal(`image/png`)}),jI=P.object({selector:P.string(),description:P.string(),method:P.optional(P.string()),arguments:P.optional(P.array(P.string()))}),MI=P.object({actions:P.array(jI),text:P.string(),truncated:P.boolean()}),NI=P.object({name:P.string(),description:P.string(),content:P.string(),dir:P.optional(P.string()),truncated:P.optional(P.boolean())}),PI=P.object({optionId:P.optional(P.string()),optionLabel:P.optional(P.string()),text:P.optional(P.string())}),FI=P.object({pending:P.boolean(),timedOut:P.boolean(),answer:P.optional(PI)}),II=FI.extend({questionId:P.id(`agentQuestions`),question:P.optional(P.string()),options:P.optional(P.array(oI))}),LI=P.union(P.literal(`queued`),P.literal(`running`),P.literal(`completed`),P.literal(`failed`),P.literal(`cancelled`));P.object({queued:P.number(),running:P.number(),completed:P.number(),failed:P.number(),cancelled:P.number()});var RI=P.object({model:P.string(),reasoning:MF,fast:P.boolean(),completionProvider:NF}),zI=P.object({questionId:P.id(`agentQuestions`),question:P.string(),options:P.array(oI)}),BI=P.union(P.object({type:P.literal(`prompt`),id:P.string(),text:P.string()}),P.object({type:P.literal(`text`),id:P.string(),text:P.string()}),P.object({type:P.literal(`patch`),id:P.string(),ok:P.boolean(),changes:P.array(P.object({operation:P.string(),path:P.string(),sourcePath:P.optional(P.string())}))})),VI=P.object({status:LI,lastError:P.optional(P.union(P.string(),P.null())),pendingQuestions:P.array(zI)}),HI=VI.extend({entries:P.array(BI),nextCursor:P.string(),hasMore:P.boolean()}),UI={threadId:P.id(`threadRecords`),settings:RI},WI=P.union(VI.extend(UI),HI.extend(UI)),GI={answer:P.optional(PI),alreadyAnswered:P.optional(P.literal(!0))},KI=P.union(WI,VI.extend(GI),HI.extend(GI)),qI=P.object({children:P.array(P.object({threadId:P.id(`threadRecords`),parentThreadId:P.id(`threadRecords`),title:P.optional(P.union(P.string(),P.null())),status:LI,lastError:P.optional(P.union(P.string(),P.null())),settings:RI})),nextCursor:P.union(P.string(),P.null()),hasMore:P.boolean()}),JI=P.object({defaultModelId:P.string(),defaultFast:P.boolean(),models:P.array(P.object({id:P.string(),label:P.string(),reasoningEfforts:P.array(P.string()),defaultReasoningEffort:P.string(),serviceTiers:P.array(P.string()),supportsImages:P.boolean()}))}),YI=P.object({artifactId:P.string(),revision:P.optional(P.number()),scope:P.optional(WF),title:P.optional(P.string()),contentType:P.optional(UF),version:P.optional(P.number())}),XI=P.object({artifacts:P.array(P.object({artifactId:P.string(),scope:P.optional(WF),repositoryKey:P.string(),threadId:P.optional(P.id(`threadRecords`)),type:UF,title:P.string(),revision:P.number(),createdAt:P.number(),updatedAt:P.number()}))}),ZI=P.union(P.object({type:P.literal(`path`),path:P.string()}),P.object({type:P.literal(`url`),url:P.string()})),QI=P.union(P.object({outputType:P.literal(`image`),mediaType:P.string(),path:P.string(),source:ZI,byteSize:P.number(),width:P.number(),height:P.number()}),P.object({outputType:P.literal(`text`),path:P.string(),source:ZI,format:P.string(),charCount:P.number(),preview:P.string(),truncated:P.boolean()}));P.union(P.string(),QI,P.array(PF),hI,II,FI,WI,KI,HI,qI,JI,vI,yI,gI,NI,bI,xI,SI,YI,XI,OI,kI,AI,MI,CI,wI,TI,EI,DI);var $I=[`cancelled`,`completed`,`failed`];P.union(...jF($I));function eL(e){return $I.some(t=>t===e)}var tL=P.union(P.literal(`apply_patch`),P.literal(`ask_question`),P.literal(`poll_question`),P.literal(`await_question`),P.literal(`exec_cmd`),P.literal(`exec_command`),P.literal(`get_workspace_instructions`),P.literal(`mandate_setup`),P.literal(`mandate_status`),P.literal(`mandate_list`),P.literal(`mandate_charge`),P.literal(`mandate_report`),P.literal(`read_skill`),P.literal(`parse_file`),P.literal(`scrape_url`),P.literal(`screenshot_url`),P.literal(`web_search`),P.literal(`write_stdin`),P.literal(`control_cmd`),P.literal(`control_command`),P.literal(`poll_cmd`),P.literal(`poll_command`),P.literal(`add_artifact`),P.literal(`list_artifacts`),P.literal(`list_subagent_models`),P.literal(`list_subagents`),P.literal(`edit_artifact`),P.literal(`delete_artifact`),P.literal(`save_artifact`),P.literal(`spawn_subagent`),P.literal(`control_subagent`),P.literal(`poll_subagent`)),nL=P.union(tL,P.literal(`browser_interact`),P.literal(`browser_screenshot`),P.literal(`browser_observe`),P.literal(`browser_act`),P.literal(`browser_extract`));P.union(nL,P.literal(`create_artifact`),P.literal(`update_artifact`)),P.union(P.literal(`pending`),P.literal(`answered`),P.literal(`timedOut`),P.literal(`cancelled`)),P.union(P.literal(`pending`),P.literal(`claimed`),P.literal(`completed`),P.literal(`failed`),P.literal(`cancelled`));var rL=P.optional(P.union(P.number(),P.null())),iL=P.object({type:P.literal(`text`),id:P.string(),text:P.string(),startedAt:rL,completedAt:rL,turnId:P.optional(P.string()),providerMetadata:P.optional(rC)}),aL=P.object({type:P.literal(`reasoning`),id:P.string(),text:P.string(),startedAt:rL,completedAt:rL,turnId:P.optional(P.string()),providerMetadata:P.optional(rC)}),oL=P.object({type:P.literal(`tool-call`),partId:P.optional(P.string()),callId:P.string(),name:P.string(),input:rC,turnId:P.optional(P.string()),startedAt:rL,completedAt:rL,providerMetadata:P.optional(rC)}),sL=P.union(...jF([`cancelled`,`failed`]));P.object({error:P.string(),status:sL});var cL=P.object({type:P.literal(`tool-result`),callId:P.string(),name:P.optional(P.string()),completedAt:rL,output:rC});P.union(iL,aL,oL,cL),P.union(P.literal(`prompt`),P.literal(`completion`),P.literal(`tool`));var lL=P.object({imageUploadId:P.optional(P.id(`imageUploads`)),name:P.string(),mediaType:P.string(),size:P.number(),storageId:P.id(`_storage`),url:P.optional(P.string())}),uL=P.union(iL,aL,oL);P.object({text:P.string(),imageUploads:P.array(lL)}),P.object({streamId:P.optional(P.string()),items:P.array(uL)});var dL=P.union(P.literal(`started`),P.literal(`completed`),P.literal(`failed`),P.literal(`cancelled`));P.object({jobId:P.optional(P.id(`executorJobs`)),toolInvocationId:P.optional(P.string()),callId:P.string(),name:P.string(),input:P.optional(rC),output:P.optional(rC),status:dL});var fL=P.union(P.literal(`system`),P.literal(`user`),P.literal(`assistant`)),pL=P.union(P.object({type:P.literal(`text`),text:P.string()}),P.object({type:P.literal(`image`),imageJson:P.string()})),mL=P.union(P.object({type:P.literal(`text`),text:P.string(),additionalParamsJson:P.optional(P.string())}),P.object({type:P.literal(`reasoning`),id:P.optional(P.string()),blocksJson:P.string()}),P.object({type:P.literal(`toolCall`),id:P.string(),callId:P.optional(P.string()),name:P.string(),argumentsJson:P.string(),signature:P.optional(P.string()),additionalParamsJson:P.optional(P.string())}),P.object({type:P.literal(`toolResult`),id:P.string(),callId:P.optional(P.string()),items:P.array(pL)}),P.object({type:P.literal(`image`),imageJson:P.string()}),P.object({type:P.literal(`audio`),audioJson:P.string()}),P.object({type:P.literal(`video`),videoJson:P.string()}),P.object({type:P.literal(`document`),documentJson:P.string()}));P.object({role:fL,assistantId:P.optional(P.string()),contents:P.array(mL)});function hL(e,t){return(t.lastMessageSentAt??0)-(e.lastMessageSentAt??0)||t.lastUsedAt-e.lastUsedAt||(e.workspacePath<t.workspacePath?-1:+(e.workspacePath>t.workspacePath))}function gL(e){return{repositoryKey:e.repositoryKey,displayName:e.displayName,workspacePath:e.workspacePath,localAttachmentAvailability:e.availability,localAttachmentError:e.unavailableReason}}function _L(e){let t=e.recoveredSubmission,n=e.latestRun;return(n===null||n.runId!==void 0&&n.runId===t?.continuationOfRunId||n.submissionId===t?.submissionId&&!eL(n.status))&&t?.prompt===e.prompt&&t.selectedModel===e.selectedModel&&t.reasoningEffort===e.reasoningEffort&&t.fastMode===e.fastMode&&(t.completionProvider??`spikonado`)===(e.completionProvider??`spikonado`)&&t.continuationOfRunId===e.continuationOfRunId&&hx(t.storageIds,e.storageIds)?t.submissionId:e.newSubmissionId}function vL(e,t){return e===`cancelled`?`cancelled`:e===`failed`?t===`The local agent stopped responding before this run finished.`?`crash`:`failed`:null}function yL(e){let t={userId:e.userId,prompt:e.prompt,storageIds:e.storageIds,selectedModel:e.selectedModel,reasoningEffort:e.reasoningEffort,fastMode:e.fastMode,submissionId:e.submissionId,workspacePath:e.workspacePath};return e.completionProvider&&(t.completionProvider=e.completionProvider),e.threadId&&(t.threadId=e.threadId),e.repositoryKey&&(t.repositoryKey=e.repositoryKey),e.continuationOfRunId&&(t.continuationOfRunId=e.continuationOfRunId),e.desktopApi.runAgent(t).then(({runId:t,threadId:n})=>{e.onStarted(t,n)}).catch(t=>{let n=t instanceof Error?t:Error(String(t));console.error(`Failed to run agent`,n),e.onError(n)})}function bL(e,t){return e.availability===t.availability?e.lastUsedAt===t.lastUsedAt?e.workspacePath<t.workspacePath:e.lastUsedAt<t.lastUsedAt:e.availability===`available`}function xL(e){let t=new Map;for(let n of e){let e=n.attachmentKey,r=t.get(e);(!r||bL(n,r))&&t.set(e,n)}return Object.fromEntries([...t.values()].map(e=>[e.workspacePath,e]))}function SL(e,t){let n=e[t.workspacePath];return n?.availability===`available`&&n.repositoryKey===t.repositoryKey?n:Object.values(e).find(e=>e.availability===`available`&&e.repositoryKey===t.repositoryKey)}function CL(e,t,n){let r=Object.fromEntries(Object.entries(e).filter(([e,r])=>e!==n&&e!==t.workspacePath&&r.attachmentKey!==t.attachmentKey));return r[t.workspacePath]=t,r}async function wL(e){return e?xL(await e.listProjectAttachments()):{}}async function TL(e){let t={workspacePath:e.workspacePath};return e.replaceWorkspacePath&&(t.replaceWorkspacePath=e.replaceWorkspacePath),await e.desktopApi.attachProject(t)}async function EL(e){if(e.desktopApi)try{let t=(await e.desktopApi.listProjectAttachments()).find(t=>t.workspacePath===e.workspacePath);if(!t||t.availability!==`available`)throw Error(t?.unavailableReason??`Workspace path is unavailable.`);await e.refreshDesktopProjectAttachments()}catch(t){throw await e.refreshDesktopProjectAttachments(),t}}var DL=class{dependencies;items=[];#e=new Set;constructor(e){this.dependencies=e}getSnapshot=()=>this.items;subscribe=e=>(this.#e.add(e),()=>{this.#e.delete(e)});add(e){for(let t of e){let e=crypto.randomUUID(),n=yx(t),r=vx(t.type);this.#t([...this.items,{localId:e,name:n,mediaType:r,size:t.size,previewUrl:_x(r)?URL.createObjectURL(t):void 0,status:`uploading`}]),this.#i(e,t,n)}}remove(e){let t=this.items.find(t=>t.localId===e);if(t&&(xx(t.previewUrl),this.#t(this.items.filter(t=>t.localId!==e)),t.storageId)){let{userId:e,threadId:n}=this.dependencies.getContext();this.#r({storageId:t.storageId,userId:e,threadId:n})}}clear(e){let t=this.dependencies.getContext(),n=e.userId===void 0?t.userId:e.userId,r=e.threadId===void 0?t.threadId:e.threadId;for(let t of this.items)xx(t.previewUrl),e.discard&&t.storageId&&this.#r({userId:n,threadId:r,storageId:t.storageId});this.#t([])}replace(e){this.#t(e.map(e=>({...e})))}snapshot(){return this.items.map(e=>({...e}))}#t(e){this.items=e;for(let e of this.#e)e()}#n(e,t){return this.items.some(t=>t.localId===e)?(this.#t(this.items.map(n=>n.localId===e?{...n,...t}:n)),!0):!1}#r(e){try{let t=this.dependencies.getContext(),n=e.api??t.api,r=e.userId??t.userId;if(!n||!r)return;n.discardTranscriptAttachment({userId:r,storageId:e.storageId,threadId:e.threadId??void 0}).catch(()=>{})}catch{return}}async#i(e,t,n){let{api:r,userId:i,threadId:a}=this.dependencies.getContext();try{if(!r)throw Error(this.dependencies.localServerRequiredMessage);if(!i)throw Error(`Sign in to attach files.`);let o=await r.uploadTranscriptAttachment({userId:i,name:n,file:t,threadId:a??void 0});if(`error`in o)throw Error(o.error);xx(this.items.find(t=>t.localId===e)?.previewUrl),this.#n(e,{status:`ready`,storageId:o.storageId,name:o.name,mediaType:o.mediaType,size:o.size,previewUrl:_x(o.mediaType)?o.url:void 0})||this.#r({api:r,userId:i,threadId:a,storageId:o.storageId})}catch(t){let n=t instanceof Error?t.message:`Upload failed.`;this.#n(e,{status:`error`,error:n}),this.dependencies.onError(n)}}};function OL(e){let t=(0,F.useRef)(e);(0,F.useLayoutEffect)(()=>{t.current=e},[e]);let[n]=(0,F.useState)(()=>new DL({getContext:()=>t.current.context,onError:e=>t.current.onError(e),localServerRequiredMessage:e.localServerRequiredMessage}));return Wm(n),n}var kL=P.union(P.literal(`idle`),P.literal(`queued`),P.literal(`running`),P.literal(`waiting_for_input`),P.literal(`cancellation_requested`),P.literal(`completed`),P.literal(`failed`),P.literal(`cancelled`)),AL=P.object({runId:P.id(`runs`),startedAt:P.number(),completedAt:P.optional(P.number()),lastError:P.optional(P.string()),executorFriendlyName:P.optional(P.string())});P.object({threadId:P.id(`threadRecords`),phase:kL,run:P.union(AL,P.null())});var jL=new Set([`queued`,`running`,`waiting_for_input`,`cancellation_requested`]);function ML(e){return jL.has(e)}function NL(e){return{threadId:e.threadId,repositoryKey:e.repositoryKey,title:e.title,selectedModel:e.selectedModel,completionProvider:e.completionProvider,reasoningEffort:e.reasoningEffort,fastMode:e.fastMode,lastMessageAt:e.lastMessageAt,threadStatus:e.threadStatus,status:e.status}}function PL(e){return NL({threadId:e._id,repositoryKey:e.repositoryKey,title:e.title??`New thread`,selectedModel:e.selectedModel,completionProvider:e.completionProvider,reasoningEffort:e.reasoningEffort,fastMode:e.fastMode??!1,lastMessageAt:e.lastMessageAt,threadStatus:e.archivedAt===void 0?`active`:`archived`,status:e.status??`completed`})}function FL(e,t){return t?e.find(e=>e.repositoryKey===t)??null:null}function IL(e,t){return t?e.find(e=>e.workspacePath===t)??null:null}function LL(e){return e.threadStatus!==`archived`}function RL(e,t){return t?e.find(e=>e.threadId===t)??null:null}function zL(e){return e.hasResolvedInitialSelection||!e.initialProjectLaunchResolved||e.hasPendingProjectLaunches||e.projectLaunchInFlight||!e.hasLoadedProjects||!e.signedInUserId?null:{workspacePath:e.projects[0]?.workspacePath??null}}function BL(e,t){return t&&(e?.threadId??e?._id)===t?e:null}function VL(e){let{pendingCreatedThreadId:t,threads:n}=e;return!t||RL(n,t)?null:t}function HL(e){return!e.threadId||e.threadId===e.pendingCreatedThreadId||e.hasLatestRunData}function UL(e,t){return!!(t&&e[t])}function WL(e,t,n){return{...e,[t]:n}}function GL(e,t,n){let r=e[t];if(!r||n!==void 0&&r.launchId!==n)return e;let i={...e};return delete i[t],i}function KL(e,t,n,r){return!!(t&&(t!==e.previousRunId||n!=null&&n!==e.previousClaimExpiresAt||r!=null&&r!==e.previousStartedAt))}function qL(e,t,n,r,i){let a=e[t];return!a||!KL(a,n,r,i)?e:GL(e,t,a.launchId)}function JL(e){let{threads:t,currentThreadId:n,currentWorkspacePath:r,draftWorkspacePath:i}=e;return r&&i===r?null:n||(t[0]?.threadId??null)}var YL=10;function XL(e){return[...new Set(e)].sort()}function ZL(e,t){let n=t({query:Jp.inbox.list,args:e.enabled&&e.sectionOpen&&e.repositoryKeys.length>0?{state:e.state,repositoryKeys:e.repositoryKeys}:`skip`,initialNumItems:YL});return{state:e.state,rows:n.data??[],loading:n.isLoading,canLoadMore:n.canLoadMore,error:n.error?.message,loadMore:()=>n.loadMore(YL)}}function QL(e,t=rr){let n={enabled:e.enabled,repositoryKeys:XL(e.repositoryKeys)};return{sections:[ZL({state:`unsettled`,sectionOpen:!0,...n},t),ZL({state:`settled`,sectionOpen:e.settledOpen,...n},t)]}}function $L(e,t,n){let r=e&&t.includes(e.repositoryKey)?e:null,i={rows:[],loading:!1,canLoadMore:!1,loadMore:()=>{}},a=r?.archivedAt===void 0?`unsettled`:`settled`;return tS(r?._id??null,n.find(e=>e.state===a)??i),r}function eR(e){return`${e.runId}:${e.streamId}`}function tR(e,t){let n=new Set(t.map(e=>e.runId));return e.filter(e=>!e.provisional||!n.has(e.runId))}var nR=class{fetchPage;changed;messages=[];nextBefore;loading=!0;loadingOlder=!1;windowVersion=0;stale=!1;error=null;stopped=!1;refreshing=!1;refreshPending=!1;olderPending=!1;retry;rows=new Map;persistedStreams=new Set;checkedStreams=new Set;overlays=[];revision=0;replicaId;changesCursor;constructor(e,t){this.fetchPage=e,this.changed=t}stop(){this.stopped=!0,clearTimeout(this.retry)}retryRefresh(e){clearTimeout(this.retry),this.retry=setTimeout(()=>{this.retry=void 0,this.refresh()},e)}retryOlder(e){this.olderPending=!0,this.retryRefresh(e)}unpersisted(e){return e.filter(e=>!this.persistedStreams.has(eR(e)))}visibleOverlays(e){return this.unpersisted(e).filter(e=>this.checkedStreams.has(eR(e)))}setOverlays(e){let t=new Set(this.overlays.map(eR));this.overlays=e;let n=new Set(e.map(eR));for(let e of this.checkedStreams)n.has(e)||this.checkedStreams.delete(e);e.some(e=>!t.has(eR(e)))&&this.refresh()}streamRequest(){let e=new Map;for(let t of this.unpersisted(this.overlays))if(e.set(eR(t),{runId:t.runId,streamId:t.streamId}),e.size===64)break;let t=[...e.values()];return t.length?{streams:t}:{}}async refresh(){if(this.stopped)return;if(this.refreshing){this.refreshPending=!0;return}this.refreshing=!0;let e=!1;clearTimeout(this.retry);try{do{this.refreshPending=!1;let t=this.streamRequest(),n=await this.fetchPage({limit:12,changesAfter:this.changesCursor,...t});if(this.stopped)return;if(this.replicaId!==n.replicaId&&(this.replicaId!==void 0&&(this.windowVersion+=1),this.rows.clear(),this.messages=[],this.persistedStreams.clear(),this.checkedStreams.clear(),this.changesCursor=void 0,this.nextBefore=void 0,this.revision=0,this.replicaId=n.replicaId,this.loading=!0,this.changed()),n.indexing){this.stale=n.stale,this.changed(),this.retryRefresh(500);break}if(n.stale?this.retryRefresh(2e3):(clearTimeout(this.retry),this.retry=void 0),n.revision<this.revision){this.stale=n.stale,this.retryRefresh(500),this.changed();break}let r=n.nextBefore??0,i=this.messages.at(-1)?.sequence;i!==void 0&&i<r&&(this.rows.clear(),this.windowVersion+=1);let a=this.messages[0]?.sequence,o=a!==void 0&&n.changes.some(e=>e.row!==null&&e.row.sequence<a&&!this.messages.some(t=>t.id===e.id));!this.rows.size||r===0||r<=(a??0)?this.nextBefore=n.nextBefore:this.nextBefore===void 0&&o&&(this.nextBefore=a);for(let e of this.rows.keys())e>=r&&this.rows.delete(e);this.commit(n);for(let e of t.streams??[])this.checkedStreams.add(eR(e));this.changesCursor=n.changesCursor,this.refreshPending||=n.moreChanges,this.refreshPending||=n.persistedStreams.length>0&&this.unpersisted(this.overlays).some(e=>!this.checkedStreams.has(eR(e))),e=!0,this.loading=!1,this.error=null,this.changed()}while(this.refreshPending&&!this.stopped)}catch{this.stopped||(this.stale=!0,this.loading=!1,this.error=this.messages.length?null:`Could not load conversation history.`,this.changed(),this.retryRefresh(2e3))}finally{this.refreshing=!1,e&&this.olderPending&&!this.stopped&&(this.olderPending=!1,this.loadOlder())}}async loadOlder(){if(this.stopped||this.loadingOlder)return;if(this.refreshing){this.olderPending=!0;return}if(this.nextBefore===void 0)return;let e=this.nextBefore,t=this.windowVersion;this.loadingOlder=!0,this.changed();try{let n=await this.fetchPage({before:e,limit:40,...this.streamRequest()});if(this.stopped||t!==this.windowVersion)return;if(this.replicaId!==n.replicaId){this.refresh();return}if(n.indexing){this.retryOlder(500);return}if(n.revision<this.revision){this.retryOlder(500);return}if(n.persistedStreams.some(e=>!this.persistedStreams.has(eR(e)))){this.olderPending=!0,this.refresh();return}if(n.nextBefore!==void 0&&n.nextBefore>=e)throw Error(`History cursor did not advance.`);if(this.nextBefore!==e){this.nextBefore!==void 0&&this.retryOlder(500);return}this.commit(n),this.nextBefore=n.nextBefore,n.stale&&this.retryRefresh(2e3)}catch{!this.stopped&&t===this.windowVersion&&(this.stale=!0,this.retryOlder(2e3))}finally{this.loadingOlder=!1,this.stopped||this.changed()}}commit(e){let t=new Map(this.messages.map(e=>[e.id,e])),n=this.rows.size?this.messages[0]?.sequence:void 0;for(let r of e.changes){let e=t.get(r.id);if(!e){r.row&&n!==void 0&&r.row.sequence>=n&&this.rows.set(r.row.sequence,r.row);continue}r.row?r.row.revision>e.revision&&this.rows.set(r.row.sequence,r.row):this.rows.delete(e.sequence)}for(let n of e.rows){let e=this.rows.get(n.sequence)??t.get(n.id);this.rows.set(n.sequence,e&&e.revision>=n.revision?e:n)}let r=[...this.rows.entries()].sort(([e],[t])=>e-t).map(([,e])=>e);(r.length!==this.messages.length||r.some((e,t)=>e!==this.messages[t]))&&(this.messages=r),this.stale=e.stale,this.revision=Math.max(this.revision,e.revision);for(let t of e.persistedStreams)this.persistedStreams.add(`${t.runId}:${t.streamId}`);for(;this.persistedStreams.size>256;){let e=this.persistedStreams.values().next().value;if(e===void 0)break;this.persistedStreams.delete(e)}}};function rR(e){return e.type===`tool-call`||e.type===`tool-result`?`${e.type}:${e.callId}`:`${e.type}:${e.turnId??``}:${e.id}`}function iR(e){let t=new Map;for(let n of e){let e=t.get(n.runId)?.parts??new Map;for(let t of n.parts)e.set(rR(t),t);t.set(n.runId,{live:n,parts:e})}return[...t.values()].map(({live:e,parts:t})=>{let n=[...t.values()];return{kind:`live`,id:`response:${e.runId}`,threadId:e.threadId,runId:e.runId,runStatus:e.runStatus,runStartedAt:e.runStartedAt,text:aC(n),parts:n}})}var aR=class{messages=[];nextBefore=null;windowVersion=0;stale=!1;threadId=null;loading=!1;error=null;loadingOlder=!1;liveCompletion=null;pendingCompletions=[];#e=0;#t=null;#n=null;#r=null;#i=0;#a=new Set;getSnapshot=()=>this.#i;subscribe=e=>(this.#a.add(e),()=>{this.#a.delete(e)});get overlays(){return[...this.pendingCompletions,...this.liveCompletion?[this.liveCompletion]:[]]}selectThread(e){this.#e+=1,this.#n?.abort(),this.#n=null,this.#r?.abort(),this.#r=null,this.#t?.stop(),this.#t=null,this.loadingOlder=!1,this.threadId=e,this.liveCompletion=null,this.pendingCompletions=[],this.error=null,this.messages=[],this.nextBefore=null,this.windowVersion=0,this.stale=!1,this.loading=e!==null,this.#o()}watchDisplay({api:e,userId:t,threadId:n,isCurrent:r}){let i=new AbortController;this.#n=i;let a=this.#e,o=new nR(r=>e.fetchTranscriptDisplay({userId:t,threadId:n,...r},i.signal),()=>{if(i.signal.aborted||a!==this.#e)return;this.messages=o.messages,this.nextBefore=o.nextBefore??null,this.windowVersion=o.windowVersion,this.stale=o.stale,this.loading=o.loading,this.loadingOlder=o.loadingOlder,this.error=o.error;let e=this.pendingCompletions.length;this.pendingCompletions=o.unpersisted(this.overlays).filter(e=>e!==this.liveCompletion),this.pendingCompletions.length>0&&this.pendingCompletions.length<e&&o.refresh(),this.#o()});return this.#t=o,o.refresh(),this.#s(e,t,n,o,i,r),()=>{i.abort(),o.stop(),this.#n===i&&(this.#n=null),this.#t===o&&(this.#t=null)}}watchLiveCompletion({api:e,userId:t,threadId:n,isCurrent:r}){let i=new AbortController;return this.#r=i,this.#c(e,t,n,i,r),()=>{i.abort(),this.#r===i&&(this.#r=null)}}syncOverlays(e){this.#t?.setOverlays(e)}visibleMessages(e){if(!e.threadId||!e.userId||this.threadId!==e.threadId)return[];let t=this.#t?.visibleOverlays(this.overlays)??[],n=iR(t.filter(t=>t.threadId===e.threadId));return[...tR(this.messages,t),...n.map(t=>t.runId===e.run?.runId?{...t,runStartedAt:e.run.startedAt,runCompletedAt:e.run.completedAt}:t)]}async loadOlder(){await this.#t?.loadOlder()}#o(){this.#i+=1;for(let e of this.#a)e()}async#s(e,t,n,r,i,a){for(;!i.signal.aborted;){try{await e.watchTranscript({userId:t,threadId:n},{signal:i.signal,onEvent:e=>{!i.signal.aborted&&a()&&(this.stale=e.stale,this.#o(),r.refresh())}})}catch{i.signal.aborted||(this.stale=!0,this.#o())}i.signal.aborted||await new Promise(e=>setTimeout(e,1e3))}}async#c(e,t,n,r,i){for(;!r.signal.aborted;){try{await e.watchLiveCompletion({userId:t,threadId:n},{signal:r.signal,onEvent:e=>{if(r.signal.aborted||!i())return;let t=this.liveCompletion;t&&(e.eventType===`cleared`||e.live.streamId!==t.streamId)&&(this.#t?.unpersisted([t]).length&&(this.pendingCompletions=[...this.pendingCompletions,t]),this.#t?.refresh()),this.liveCompletion=e.eventType===`updated`?e.live:null,this.#o()}})}catch{if(r.signal.aborted)return}await sR(400,r.signal)}}};function oR(){let[e]=(0,F.useState)(()=>new aR);return Wm(e),e}function sR(e,t){return t.aborted?Promise.resolve():new Promise(n=>{let r=setTimeout(n,e);t.addEventListener(`abort`,()=>{clearTimeout(r),n()},{once:!0})})}function cR(e,t){let n=qn({query:e,args:t});return n.status===`error`?{data:void 0,error:n.error}:n.status===`pending`?{data:void 0,error:null}:{data:n.data,error:null}}var lR=`Connect to a running Sprocket server to use this project.`,uR=3e4;function dR(e){let t=oS(e.signedInUserId),{currentThreadId:n,onSettledOpenChange:r}=e,i=sS({currentThreadId:e.currentThreadId,enabled:e.mutationsEnabled,expansion:t}),a=i[0]??null,o=qn({query:Jp.threads.getByThreadId,args:e.mutationsEnabled&&a?{threadId:a}:`skip`}),s=$L(o.status===`success`?o.data:null,e.repositoryKeys,e.sections),c=(0,F.useRef)(null);(0,F.useEffect)(()=>{if(!s||s.archivedAt===void 0){c.current=null;return}c.current!==n&&(c.current=n,r(!0))},[s,n,r]);let l=(0,F.useCallback)(({threadId:e,renderRows:n})=>(0,R.jsx)(fR,{expansion:t,threadId:e,renderRows:n,selectedPath:i}),[t,i]);return(0,R.jsx)(vS,{...e,expansion:t,resolveChildren:l})}function fR({expansion:e,threadId:t,renderRows:n,selectedPath:r}){let i=nS(t),a=r.indexOf(t);return tS(a>=0?r[a+1]??null:null,i),(0,F.useEffect)(()=>{e.registerChildren(t,i.rows)},[e,t,i.rows]),(0,R.jsxs)(R.Fragment,{children:[n(i.rows),(0,R.jsx)(pS,{section:i})]})}var pR={resolveDesktopApi:Vm,fetchGatewayModelCatalog:rx};function mR(e,t){return e?`thread:${e}`:t?`draft:${t}`:null}function hR(e,t){return`${e}\0${t}`}function gR({config:e,runtime:t=pR}){let n=(0,F.useRef)(e),r=(0,F.useRef)(t);r.current=t;let i=cr(),a=Gn(),o=Wm(Gm),s=Wm(Ym),c=Wm(Km),l=!!c,u=(0,F.useRef)(c),d=o.nativeSession===`loading`,f=o.nativeSession===`missing`||o.nativeSession===`mismatch`||o.nativeSession===`unavailable`,p=o.nativeSession===`missing`||o.nativeSession===`mismatch`,m=o.isReady&&!o.isLoading&&l&&(o.nativeSession===`notRequired`||o.nativeSession===`ready`)&&!i.isLoading&&i.isAuthenticated,h=l&&o.isReady&&!o.isLoading&&!s&&!i.isLoading&&!i.isAuthenticated||f,[g,_]=(0,F.useState)(!1);(0,F.useEffect)(()=>{let e=lg({retryPending:s,isAuthenticated:i.isAuthenticated,isLoading:i.isLoading,sawLoadingDuringRetry:g});g!==e.sawLoadingDuringRetry&&_(e.sawLoadingDuringRetry),e.clearPending&&Ym.set(!1)},[s,i.isAuthenticated,i.isLoading,g]);let v=Yn(Jp.providerCredentials.getMyConfiguration),y=Jn(Jp.artifacts.deleteArtifact),b=Jn(Jp.threads.rename),x=Jn(Jp.threads.settle),S=Jn(Jp.threads.unsettle),C=Jn(Jp.agentQuestions.answer),w=Jn(Jp.uiPreferences.setTheme),T=Jn(Jp.billing.ensureMySubscription),[E,D]=(0,F.useState)(void 0),[ee,O]=(0,F.useState)(null),[te,ne]=(0,F.useState)(!0),[re,ie]=(0,F.useState)(!1),[k,ae]=(0,F.useState)(!1),[A,oe]=(0,F.useState)(null),[se,ce]=(0,F.useState)(!1),[le,ue]=(0,F.useState)(null),[de,fe]=(0,F.useState)(!1),[pe,me]=(0,F.useState)(!1),[he,ge]=(0,F.useState)(null),_e=(0,F.useMemo)(()=>[`spikonado`,...re?[`openai`]:[],...k?[`chatgpt`]:[]],[re,k]);async function ve(){ne(!0);try{let e=n.current.env.PUBLIC_MODEL_GATEWAY_URL?.trim()??``;D(await r.current.fetchGatewayModelCatalog(e)),O(null)}catch{O(Jb),D(void 0)}finally{ne(!1)}}let ye=(0,F.useRef)(null),j=(0,F.useRef)(null),M=(0,F.useRef)(0);async function be(e){let t=M.current;fe(!0),me(!1),ge(null);try{let n=await v({});if(u.current!==e||t!==M.current)return;ie(n.openai),me(!0)}catch(n){if(u.current!==e||t!==M.current)return;ge(n instanceof Error&&DS(n)||`Couldn’t load provider settings.`)}finally{u.current===e&&t===M.current&&fe(!1)}}let xe=(0,F.useEffectEvent)(e=>{be(e)});(0,F.useEffect)(()=>{if(!m)return;let e=u.current;e&&ye.current!==e&&(ye.current=e,T({}).catch(()=>{}))},[m,c,T]),(0,F.useEffect)(()=>{if(!m)return;let e=u.current;e&&j.current!==e&&(j.current=e,xe(e))},[m,c]);let[N,Se]=(0,F.useState)(null),Ce=(0,F.useRef)(N),[we,Te]=(0,F.useState)(!1),Ee=(0,F.useRef)(null),De=(0,F.useRef)(0),Oe=(0,F.useEffectEvent)(e=>{kr(e)});(0,F.useEffect)(()=>{let e=c;if(!m||!e||!N){Ee.current=null,oe(null),ae(!1),ce(!1);return}if(Ee.current?.userId===e&&Ee.current.api===N)return;Ee.current={userId:e,api:N};let t=++De.current;return oe(null),ae(!1),ce(!0),ue(null),N.fetchChatGptStatus({userId:e}).then(n=>{t===De.current&&u.current===e&&Oe(n)}).catch(n=>{t===De.current&&u.current===e&&(oe(null),ae(!1),ue(n instanceof Error&&DS(n)||`Couldn’t load ChatGPT connection status.`))}).finally(()=>{t===De.current&&u.current===e&&ce(!1)}),()=>{De.current+=1,Ee.current=null}},[m,c,N]);let[ke,Ae]=(0,F.useState)(null),[je,Me]=(0,F.useState)(null),[Ne,Pe]=(0,F.useState)(null),[Fe,Ie]=(0,F.useState)(null),[Le,Re]=(0,F.useState)(kb),[ze,Be]=(0,F.useState)(`spikonado`),[Ve,He]=(0,F.useState)(Ab),[P,Ue]=(0,F.useState)(!1),[We,Ge]=(0,F.useState)(``),[Ke,qe]=(0,F.useState)(null),[Je,Ye]=(0,F.useState)(!1),[Xe,Ze]=(0,F.useState)(null),[Qe,$e]=(0,F.useState)(!1),[et,tt]=(0,F.useState)(null),[nt,rt]=(0,F.useState)({}),[it,at]=(0,F.useState)(!1),ot=(0,F.useRef)(0),[st,ct]=(0,F.useState)(null),[lt,ut]=(0,F.useState)({}),dt=(0,F.useRef)(lt),[ft,pt]=(0,F.useState)(!1),[mt,ht]=(0,F.useState)(null),[gt,_t]=(0,F.useState)(!1),[vt,yt]=(0,F.useState)(`add`),[bt,xt]=(0,F.useState)(void 0),[St,Ct]=(0,F.useState)(null),[wt,Tt]=(0,F.useState)(!1),[Et,Dt]=(0,F.useState)(`account`),[Ot,kt]=(0,F.useState)(!0),[At,jt]=(0,F.useState)(0),Mt=Ot||wt&&At>=768,[Nt,Pt]=(0,F.useState)([]),[Ft,It]=(0,F.useState)(!1),[Lt,Rt]=(0,F.useState)([]),[zt,Bt]=(0,F.useState)(!1),[Vt,Ht]=(0,F.useState)(null),Ut=(0,F.useRef)(new Map).current,Wt=(0,F.useRef)(new Map).current,Gt=(0,F.useRef)(new Map).current,Kt=(0,F.useRef)(new Map).current,qt=(0,F.useRef)(0),Jt=(0,F.useRef)(0),Yt=(0,F.useRef)(null),Xt=(0,F.useRef)(0),[Zt,Qt]=(0,F.useState)(!1),$t=(0,F.useRef)(void 0),[en,tn]=(0,F.useState)(null),nn=(0,F.useRef)(0),[rn,an]=(0,F.useState)(0),on=(0,F.useCallback)(()=>an(e=>e+1),[]),sn=(0,F.useCallback)((e,t)=>{Ut.get(e)===t&&(Ut.delete(e),on())},[on,Ut]),cn=(0,F.useCallback)((e,t,n)=>{Wt.set(hR(e,t),n),on()},[on,Wt]),ln=(0,F.useCallback)((e,t)=>{let n=hR(e,t);Wt.delete(n),Gt.delete(n),on()},[on,Wt,Gt]),un=OL({context:{api:N,userId:c,threadId:Ne},onError:tt,localServerRequiredMessage:lR}),dn=oR(),fn=_F(),pn=(0,F.useMemo)(()=>vF(a),[a]),mn=c&&i.isAuthenticated&&!i.isLoading?{}:`skip`,hn=cR(Jp.uiPreferences.getMine,mn),gn=Ne&&mn!==`skip`?{threadId:Ne}:`skip`,_n=cR(Jp.threads.getByThreadId,gn),vn=cR(Jp.chat.selectedThreadLifecycle,gn),yn={data:null,error:null},bn=cR(Jp.agentQuestions.headPendingForThread,gn),xn=hn.error??_n.error??vn.error??bn.error,[Sn,Cn]=(0,F.useState)(_b(null));(0,F.useEffect)(()=>{if(!m){$t.current=void 0,tn(null),nn.current+=1;return}let e=hn.data;if(e===void 0||en!==null||e===$t.current)return;$t.current=e;let t=_b(e?.theme);Cn(t),xb(t)},[m,hn.data,en]);async function wn(e){let t=Sn,n=++nn.current;tn(e),Cn(e),xb(e);try{await w({theme:e})}catch(e){if(n!==nn.current)return;Cn(t),xb(t),tt(e instanceof Error?e.message:`Failed to save theme preference.`)}finally{n===nn.current&&tn(null)}}let Tn=(0,F.useMemo)(()=>Object.values(lt).sort(hL),[lt]),En=(0,F.useMemo)(()=>Tn.map(gL),[Tn]),Dn=(0,F.useMemo)(()=>[...new Map(En.map(e=>[e.repositoryKey,e])).values()],[En]),On=(0,F.useMemo)(()=>Nt.length>0?Nt:Dn.map(e=>e.repositoryKey),[Nt,Dn]);(0,F.useEffect)(()=>{let e=new Set(Dn.map(e=>e.repositoryKey)),t=Nt.filter(t=>e.has(t));t.length!==Nt.length&&Pt(t)},[Dn,Nt]);let kn=QL({enabled:m,repositoryKeys:On,settledOpen:Ft}),An=BL(_n.data,Ne),jn=(0,F.useMemo)(()=>{let e=kn.sections.find(e=>e.state===`unsettled`)?.rows.map(PL)??[];return!An||e.some(e=>e.threadId===An._id)?e:[PL(An),...e]},[kn.sections,An]),Mn=BL(vn.data,Ne),Nn=Mn?.run??null,Pn=BL(bn.data,Ne);(0,F.useEffect)(()=>{let e=Ne;dn.threadId!==e&&dn.selectThread(e)},[Ne,dn]),(0,F.useEffect)(()=>{let e=Ne,t=N;if(!e||!t||!l)return;let n=u.current;if(n)return dn.watchDisplay({api:t,userId:n,threadId:e,isCurrent:()=>Fn.current===e})},[Ne,N,l,dn,c]),(0,F.useEffect)(()=>{let e=Ne,t=N;if(!e||!t||!l)return;let n=u.current;if(n)return dn.watchLiveCompletion({api:t,userId:n,threadId:e,isCurrent:()=>Fn.current===e})},[Ne,N,l,dn,c]);let Fn=(0,F.useRef)(Ne),In=(0,F.useRef)(ke),Ln=(0,F.useRef)(je),Rn=(0,F.useRef)(Fe);(0,F.useEffect)(()=>{dn.syncOverlays(dn.overlays)});let zn=dn.visibleMessages({threadId:Ne,userId:c,run:Nn}),Bn=(0,F.useMemo)(()=>ke?IL(En,ke):je?FL(En,je):null,[En,ke,je]),Vn=Bn?.workspacePath??ke,Hn=(0,F.useMemo)(()=>!Vn||!N?null:{workspacePath:Vn,search:(e,t)=>N.searchWorkspace({workspacePath:Vn,query:e},t)},[Vn,N]),Un=(0,F.useMemo)(()=>{let e=Bn?.workspacePath??null,t=N;return{workspacePath:e,load:async()=>{if(!t||!e)return[];let n=await t.listWorkspaceSkills({workspacePath:e});for(let e of n.warnings)console.warn(`sprocket skills: ${e}`);return n.skills}}},[Bn,N]),Wn=(0,F.useMemo)(()=>Bn?.repositoryKey?jn.filter(e=>e.repositoryKey===Bn.repositoryKey&&LL(e)).sort((e,t)=>t.lastMessageAt-e.lastMessageAt):[],[jn,Bn]),Kn=(0,F.useMemo)(()=>[],[]);(0,F.useEffect)(()=>{let e=c&&je?{userId:c,repositoryKey:je,workspacePath:ke??``}:null;fn.selectScope(e)},[fn,c,je,ke]),(0,F.useEffect)(()=>{let e=c&&je?{userId:c,repositoryKey:je,workspacePath:ke??``}:null;return fn.watch({localApi:N,artifactClient:pn,cloudReady:!i.isLoading&&i.isAuthenticated,scope:e})},[fn,c,je,ke,N,pn,i.isLoading,i.isAuthenticated]);let qn=je&&i.isAuthenticated&&!i.isLoading?async e=>{if(N&&c&&ke){await N.deleteArtifact({userId:c,repositoryKey:je,workspacePath:ke,artifactId:e});return}await y({artifactId:e,repositoryKey:je})}:void 0,Xn=mR(Ne,Vn),Zn=(()=>{let e=u.current;if(e&&Xn)return Gt.get(hR(e,Xn))})(),Qn=Mn?.phase===`queued`&&Zn!=null,$n=Mn!=null&&ML(Mn.phase)&&!Qn,er=Nn!=null&&($n&&Mn?.phase!==`cancellation_requested`||!$n&&Pn!=null),tr=UL(nt,Ne),nr=tr||$n?null:vL(Mn?.phase??`idle`,Mn?.run?.lastError),rr=HL({threadId:Ne,pendingCreatedThreadId:st,hasLatestRunData:!!Mn}),ir=!!(Xn&&Ut.has(Xn)),ar=(Ne&&dn.threadId===Ne?dn.error:null)??et??o.error??(xn?DS(xn):null),or=(nr===`failed`||nr===`crash`)&&!ir?Nn?.lastError??null:null,sr=!(!Vn||!Pn&&ze===`chatgpt`&&!k||Bn?.localAttachmentAvailability!==`available`||ir||Je||tr||($n||!rr)&&!Pn),lr=(0,F.useMemo)(()=>{let e=new Set,t=[];for(let n of Tn){if(n.availability!==`available`||e.has(n.workspacePath))continue;e.add(n.workspacePath);let r=n.workspacePath.split(/[/\\]/).filter(Boolean).at(-1)??n.workspacePath;t.push({workspacePath:n.workspacePath,displayName:r})}return t},[Tn]);function ur(e){dt.current=e,ut(e),pt(!0)}async function dr(e=Ce.current){let t=++Xt.current,n=In.current,r=ot.current,i=await wL(e);if(t!==Xt.current)return dt.current;if(ur(i),!n||r!==ot.current)return i;let a=i[n];if(!a&&e){let o=await e.resolveWorkspacePath({workspacePath:n});if(t!==Xt.current||r!==ot.current)return dt.current;a=SL(i,o)}if(!a)return i;let o=a.repositoryKey!==Ln.current;if(a.workspacePath!==n||o){let e=Rn.current===n;hr(),Ae(a.workspacePath),Me(a.repositoryKey),Ie(e?a.workspacePath:null),o&&(Pe(null),ct(null))}return i}async function fr(){let e=N,t=u.current;e&&t&&await e.endAccountSession({userId:t}).catch(()=>{}),await rg()}let pr=(0,F.useEffectEvent)((e,t)=>{e.startAccountSession({userId:t}).catch(n=>{Ce.current===e&&u.current===t&&tt(n instanceof Error?n.message:`Failed to register this Sprocket process.`)})});(0,F.useEffect)(()=>{N&&c&&m&&pr(N,c)},[N,c,m]);function mr(e,t=null,n=!1,r){let i=IL(En,e),a=r??i?.repositoryKey??null;Ae(e),Me(a),Pe(t),Ie(n?e:null),t!==st&&ct(null)}function hr(){return++ot.current}function gr(e,t=null,n=!1,r=!1,i){let a=hr();return r||tt(null),mr(e,t,n,i),a}async function _r(e,t,n=Ce.current){if(!n)throw Error(lR);let r=await TL({desktopApi:n,workspacePath:e,replaceWorkspacePath:t});return Xt.current+=1,ur(CL(dt.current,r,t)),r}function vr(e,t={}){let n=IL(En,e);if(!n){tt(`Choose a project first.`);return}let r=gr(e,t.threadId,t.draft);Er(n.workspacePath).catch(e=>{r===ot.current&&tt(e instanceof Error?e.message:`Failed to attach project.`)})}function yr(e=`add`,t=null){if(!N){tt(lR);return}yt(e),Ct(t);let n=e===`reconnect`&&t?IL(En,t):void 0;xt(n?.displayName),_t(!0),tt(null)}async function br(e){if(!N){tt(lR);return}let t=u.current;if(!t){tt(`User session is not ready.`);return}try{if(vt===`reconnect`&&St){await Sr(e,St,t);return}await xr(e,t)}catch(e){if(u.current!==t)return;throw tt(e instanceof Error?e.message:`Failed to attach project.`),e}}async function xr(e,t,n){await _r(e.workspacePath,void 0,n),u.current===t&&(gr(e.workspacePath,null,!0,!1,e.repositoryKey),tt(null))}async function Sr(e,t,n,r){let i=IL(En,t);if(await _r(e.workspacePath,t===e.workspacePath?void 0:t,r),u.current!==n)return;let a=i?.repositoryKey===e.repositoryKey?Fn.current:null;gr(e.workspacePath,a,!1,!1,e.repositoryKey),tt(null)}function Cr(e){let t=e?.trim();t&&Rt(e=>[...e,t])}async function wr(){let e=window.sprocketDesktopBridge;if(e?.takeWorkspaceLaunch)for(;;){let t=await e.takeWorkspaceLaunch();if(!t)return;Cr(t)}}async function Tr(e,t,n){let r=await t.resolveWorkspacePath({workspacePath:e});u.current===n&&await xr(r,n,t)}async function Er(e){await EL({desktopApi:N,refreshDesktopProjectAttachments:async()=>{await dr()},workspacePath:e})}function Dr(e){yr(`reconnect`,e)}function Or(e){M.current+=1,e.provider===`openai`&&ie(e.configured),me(!0),ge(null),!e.configured&&ze===e.provider&&Be(`spikonado`)}function kr(e){De.current+=1,ce(!1),oe(e),ue(e.error??null);let t=e.accounts.find(t=>t.connectionId===e.activeConnectionId)?.connected===!0;ae(t),!t&&ze===`chatgpt`&&Be(`spikonado`)}function Ar(e){vr(e,{draft:!0}),Mr()}function jr(){let e=IL(En,ke),t=(e?.localAttachmentAvailability===`available`?e:null)??En.find(e=>e.localAttachmentAvailability===`available`)??En[0];if(!t){yr(`add`);return}Ar(t.workspacePath),matchMedia(`(max-width: 767px)`).matches&&kt(!1)}async function Mr(){await Promise.resolve(),Vt?.querySelector(`textarea`)?.focus()}function Nr(e,t){vr(t,{threadId:e.threadId})}function Pr(e){let t=FL(En,e.repositoryKey);t&&(Nr(PL(e),t.workspacePath),matchMedia(`(max-width: 767px)`).matches&&kt(!1))}async function Fr(e,t){try{await b({threadId:e,title:t})}catch(e){throw tt(e instanceof Error?e.message:`Failed to rename thread.`),e}}async function Ir(){await dn.loadOlder()}async function Lr(e){let t=N,n=Ne,r=u.current;if(!t||!n||!r)return null;let i=await t.fetchTranscriptAttachment({userId:r,threadId:n,storageId:e});return i?URL.createObjectURL(i):null}async function Rr(e,t,n){let r=N,i=Ne,a=u.current;if(!r||!i||!a||e.threadId!==i)throw Error(`Thread is no longer selected.`);return await r.fetchTranscriptDisplayDetails({userId:a,threadId:i,rowId:e.id,...t},n)}async function zr(e,t){let n=u.current;try{let r={threadId:e._id};t===`settled`?await x(r):await S(r),u.current===n&&(t===`settled`&&Fn.current===e._id&&(Pe(null),Ie(In.current),hr()),tt(null))}catch(e){if(u.current!==n)return;throw tt(e instanceof Error?e.message:`Failed to update thread.`),e}}async function Br(){let e=Pn,t=Ne,n=u.current;if(!e||!t||!n||Je||!Ke&&!We.trim())return;Ye(!0),tt(null);let r=We,i=Ke,a=r.trim(),o=un.snapshot(),s=o.flatMap(e=>e.storageId?[e.storageId]:[]),c=Le,l=ze,d=Ve,f=P,p=null,m;Ge(``),qe(null);try{let n={threadId:t,questionId:e.questionId,optionId:i??void 0,text:a||void 0},r=await C(n);r.continuation&&(p=r.continuation.prompt,m=r.continuation.runId)}catch(a){u.current===n&&Fn.current===t&&Vr.current?.questionId===e.questionId&&(Ge(r),qe(i),tt(a instanceof Error?a.message:String(a)))}finally{u.current===n&&Ye(!1)}if(u.current===n){if(p!==null&&Fn.current!==t){cn(n,`thread:${t}`,{message:`Continuing from your answer when you return to this thread.`,prompt:p,attachments:o,storageIds:s,reasoningEffort:d,fastMode:f,selectedModel:c,completionProvider:l,continuationOfRunId:m,autoSubmit:!0});return}p!==null&&(Ze(m??null),Ge(p),await Hr({answeredQuestionId:e.questionId,continuationOfRunId:m},p))}}let Vr=(0,F.useRef)(Pn);async function Hr(e,t){let n=Vr.current;if(n){if(e?.answeredQuestionId&&n.questionId!==e.answeredQuestionId){tt(`Answer the new agent question before continuing.`);return}if(!e?.answeredQuestionId){await Br();return}}let r=t??We;if(ir||!r.trim()&&un.items.length===0)return;if(un.items.some(e=>e.status!==`ready`)){tt(`Wait for file uploads to finish, or remove failed files before sending.`);return}let i=Vn;if(!i){tt(`Choose a project first.`);return}if(!N){tt(lR);return}if(Ne&&!rr){tt(`Loading thread state before sending.`);return}if(!sr){tt($n||tr||ir?`Wait for the current agent launch or run to finish.`:Bn?.localAttachmentAvailability===`available`?`You need an active project before sending.`:`This project needs to be attached before sending.`);return}let a=Ne,o=je;if(!o){tt(`Choose a project first.`);return}let s=u.current;if(!s){tt(`User session is not ready.`);return}let c=()=>u.current===s,l=r.trim(),d=un.snapshot(),f=d.flatMap(e=>e.storageId?[e.storageId]:[]),p=Le,m=ze,h=Ve,g=P,_=e?.continuationOfRunId??Xe??void 0,v=a?Nn?.runId??null:null,y=a?`thread:${a}`:`draft:${i}`,b=y,x=b,S=hR(s,b),C=Gt.get(S),w=crypto.randomUUID(),T=_L({latestRun:!a||!Mn||Mn.phase===`idle`?null:{runId:Nn?.runId,status:ML(Mn.phase)?`queued`:`completed`,submissionId:Zn?.submissionId??``},newSubmissionId:w,prompt:l,storageIds:f,reasoningEffort:h,fastMode:g,completionProvider:m,continuationOfRunId:_,recoveredSubmission:C?{...C,selectedModel:C.selectedModel}:void 0,selectedModel:p}),E=T;ln(s,b);let D=null,ee=null,O=++Jt.current,te=hR(s,b);Kt.set(te,O);let ne=()=>Kt.get(te)===O,re=`Your session changed before the agent started. Return to this account and send the prompt again.`,ie=`This request is still preparing. Wait for it to finish before trying again.`,k=e=>{cn(s,x,{message:e,prompt:l,attachments:d,storageIds:f,reasoningEffort:h,fastMode:g,selectedModel:p,completionProvider:m,continuationOfRunId:_,autoSubmit:!1,submissionId:!a&&x===b?T:E})},ae=()=>{ln(s,x),c()&&tt(e=>e===ie?null:e)},A=window.setTimeout(()=>{if(Kt.get(te)!==O)return;k(ie);let e=D,t=ee;e&&t!==null&&rt(n=>GL(n,e,t)),sn(y,O),Kt.delete(te)},uR);Ge(``),tt(null),Ut.set(y,O),on();try{if(!a){let e=await N.resolveWorkspacePath({workspacePath:i});if(!ne())return;if(e.repositoryKey!==o){let t=await dr();if(!ne())return;let n=SL(t,e);if(!n)throw Error(`The repository changed and its project attachment is unavailable.`);i=n.workspacePath,o=n.repositoryKey,gr(i,null,!0,!0,o);let r=`draft:${i}`;r!==y&&(sn(y,O),Kt.delete(te),y=r,x=r,te=hR(s,r),Kt.set(te,O),Ut.set(y,O),on())}}let e=a;if(!ne())return;if(!c()){k(re);return}D=e,ae(),window.clearTimeout(A);let t=++qt.current;ee=t;let n={launchId:t,previousRunId:v};Nn?.startedAt&&(n.previousStartedAt=Nn.startedAt),e&&rt(t=>WL(t,e,n)),await yL({userId:s,desktopApi:N,onError:n=>{if(ne()&&c()){if(e){let n=GL(Wr.current,e,t);n!==Wr.current&&rt(n)}k(n instanceof Error?n.message:`Failed to start the local agent run.`)}},onStarted:(e,t)=>{c()&&dr().catch(()=>{}),ne()&&c()&&(D=t,Fn.current===a&&In.current===i&&(a||(ct(t),hr(),Pe(t),Ie(null)),un.clear({discard:!1}),Gr.current===_&&(Ze(null),$e(!1))))},threadId:e??void 0,repositoryKey:e?void 0:o,prompt:l,storageIds:f,selectedModel:p,completionProvider:m,submissionId:E,reasoningEffort:h,fastMode:g,workspacePath:i,continuationOfRunId:_})}catch(e){if(D&&ee!==null&&rt(GL(Wr.current,D,ee)),!ne())return;if(!c()){k(re);return}k(e instanceof Error?e.message:`Failed to send prompt.`),dr().catch(()=>{})}finally{window.clearTimeout(A),sn(y,O),ee===null&&Kt.get(te)===O&&Kt.delete(te)}}let Ur=(0,F.useRef)(Nn),Wr=(0,F.useRef)(nt),Gr=(0,F.useRef)(Xe);(0,F.useLayoutEffect)(()=>{n.current=e,u.current=c,Ce.current=N,Fn.current=Ne,In.current=ke,Ln.current=je,Rn.current=Fe,Vr.current=Pn,Ur.current=Nn,Wr.current=nt,Gr.current=Xe},[e,c,N,Ne,ke,je,Fe,Pn,Nn,nt,Xe]);async function Kr(){if(!er)return;let e=u.current,t=Ne,n=Nn?.runId;if(t&&n)try{await a.mutation(Jp.agentRuntime.requestCancellation,{runId:n})}catch(r){if(u.current!==e||Fn.current!==t||Ur.current?.runId!==n)return;tt(r instanceof Error?r.message:`Failed to stop run.`)}}async function qr(){if(!nr||!Nn||!Ne||!Vn||tr||ir)return;if(!N){tt(lR);return}let e=Ne,t=Vn,n=u.current;if(!t||!n)return;let r=Nn.runId,i=Nn.startedAt,a=++qt.current,o={launchId:a,previousRunId:r,previousStartedAt:i};rt(t=>WL(t,e,o));try{if(u.current!==n)throw Error(`User session is not ready.`);await yL({userId:n,desktopApi:N,onError:t=>{rt(t=>GL(t,e,a)),u.current===n&&Fn.current===e&&tt(t.message)},onStarted:()=>{},threadId:e,prompt:``,storageIds:[],selectedModel:Le,completionProvider:ze,reasoningEffort:Ve,fastMode:P,submissionId:crypto.randomUUID(),workspacePath:t,continuationOfRunId:r})}catch(t){if(rt(t=>GL(t,e,a)),u.current!==n||Fn.current!==e)return;tt(t instanceof Error?t.message:`Failed to continue the run.`)}}let Jr=(0,F.useEffectEvent)(e=>{let t=mt,n=Ne;ht(e),at(!1),Ae(null),Me(null),Pe(null),Ie(null),ct(null),rt({}),ye.current=null,j.current=null,ie(!1),ae(!1),oe(null),ce(!1),ue(null),Ee.current=null,me(!1),ge(null),Yt.current=null,hr(),Ge(``),Ye(!1),qe(null),Ze(null),$e(!1),un.clear({discard:!0,userId:t,threadId:n}),tt(null),Re(E?.defaultModelId??`gpt-5.6-sol`),Be(`spikonado`),He(E?.defaultReasoningEffort??`high`),Ue(!1),_t(!1),Ct(null),xt(void 0),fn.reset()});(0,F.useEffect)(()=>{mt!==c&&Jr(c)},[c,mt]),(0,F.useEffect)(()=>{if(!st)return;let e=VL({pendingCreatedThreadId:st,threads:jn});e!==st&&ct(e)},[st,jn]);let Yr=(0,F.useEffectEvent)((e,t,n)=>{Rt(e=>e.slice(1)),Qt(!0),at(!0),_t(!1),Tt(!1),tt(null),Tr(e,t,n).catch(e=>{u.current===n&&(at(!1),tt(e instanceof Error?e.message:`Failed to open the requested project.`))}).finally(()=>{Qt(!1)})});(0,F.useEffect)(()=>{let e=Lt[0];e&&!Zt&&m&&N&&c&&ft&&Yr(e,N,c)},[Lt,Zt,N,c,m,ft]),(0,F.useEffect)(()=>{let e=An,t=e?._id??null;t!==Yt.current&&(Yt.current=t,Ze(null),$e(!1),e&&(Re(e.selectedModel),Be(e.completionProvider??`spikonado`),He(e.reasoningEffort),Ue(e.fastMode??!1)))},[An]),(0,F.useEffect)(()=>{let e=c,t=mR(Ne,Vn);if(!e||!t)return;let n=hR(e,t),r=Wt.get(n);if(!r||r.autoSubmit&&We!==``&&We!==r.prompt)return;Wt.delete(n);let i=We===``;i&&Ge(r.prompt),un.items.length===0&&r.attachments?.length&&(i||We===r.prompt)&&un.replace(r.attachments),(We===r.prompt||i)&&(Ze(r.continuationOfRunId??null),$e(r.autoSubmit===!0&&r.continuationOfRunId!==void 0),r.submissionId&&(r.prompt||r.storageIds?.length)&&r.reasoningEffort&&r.selectedModel&&r.completionProvider&&Gt.set(n,{prompt:r.prompt,storageIds:r.storageIds??[],reasoningEffort:r.reasoningEffort,fastMode:r.fastMode??!1,selectedModel:r.selectedModel,completionProvider:r.completionProvider,submissionId:r.submissionId,continuationOfRunId:r.continuationOfRunId})),tt(r.message),on()},[c,Ne,Vn,We,un,Wt,Gt,rn,on]);let Xr=(0,F.useEffectEvent)(()=>{Hr()});(0,F.useEffect)(()=>{Qe&&Xe&&sr&&!Pn&&N&&We.trim()&&!un.items.some(e=>e.status!==`ready`)&&($e(!1),Xr())},[Qe,Xe,sr,Pn,N,We,un]);let Zr=(0,F.useEffectEvent)(e=>{if(at(!0),!e)return;let t=gr(e,null,!0,!0);Er(e).catch(e=>{t===ot.current&&tt(e instanceof Error?e.message:`Failed to attach project.`)}),Mr()});(0,F.useEffect)(()=>{let e=zL({hasResolvedInitialSelection:it,initialProjectLaunchResolved:zt,hasPendingProjectLaunches:Lt.length>0,projectLaunchInFlight:Zt,hasLoadedProjects:ft,signedInUserId:c,projects:En});e&&Zr(e.workspacePath)},[it,zt,Lt.length,Zt,ft,c,En]);let Qr=(0,F.useEffectEvent)(e=>{gr(e.workspacePath,Ne,Fe===e.workspacePath)});(0,F.useEffect)(()=>{let e=Ne?RL(jn,Ne):null,t=Bn?.repositoryKey===e?.repositoryKey?Bn:FL(En,e?.repositoryKey);t&&t.workspacePath!==ke&&Qr(t)},[jn,Bn,Ne,ke,En,Fe]);let $r=(0,F.useEffectEvent)((e,t)=>{gr(e,t,Fe===e,!0)});(0,F.useEffect)(()=>{let e=Wn;if(!it||!ke)return;let t=JL({threads:e,currentThreadId:Ne,currentWorkspacePath:ke,draftWorkspacePath:Fe});t!==Ne&&$r(ke,t)},[Wn,it,ke,Ne,Fe]),(0,F.useEffect)(()=>{let e=nt;Ne&&Nn?.runId&&(e=qL(e,Ne,Nn.runId,void 0,Nn.startedAt)),e!==nt&&rt(e)},[Ne,Nn,nt]);let ei=(0,F.useEffectEvent)(()=>{let e=window.sprocketDesktopBridge,n=e?.onWorkspaceLaunch?e.onWorkspaceLaunch(()=>{wr()}):void 0,r=Nm();return r&&(Cr(r),Pm()),e?.takeWorkspaceLaunch?wr().finally(()=>Bt(!0)):Bt(!0),t.resolveDesktopApi().then(async e=>{Se(e),await Rh(),Te(!0),dr(e).catch(e=>{tt(e instanceof Error?e.message:`Failed to load local project attachments.`)})}).catch(e=>{tt(e instanceof Error?e.message:`Failed to connect to the Sprocket server.`),Te(!0)}),n});(0,F.useEffect)(()=>{let e=matchMedia(`(max-width: 767px)`);kt(!e.matches),jt(window.innerWidth);let t=()=>jt(window.innerWidth);window.addEventListener(`resize`,t),ve();let n=ei();return()=>{n?.(),window.removeEventListener(`resize`,t)}},[]);async function ti(e){await Promise.resolve(),document.querySelector(e?`.inbox-sidebar-host button`:`.inbox-floating-controls button`)?.focus()}async function ni(){kt(!0),await ti(!0)}async function ri(){kt(!1),await ti(!1)}function ii(){Dt(`account`),Tt(!0)}async function ai(){ii(),At<768&&kt(!0),await ti(!0)}async function oi(){Tt(!1),Dt(`account`),await ti(Ot)}return we?N?m?(0,R.jsxs)(`div`,{className:`relative h-dvh overflow-hidden`,children:[(0,R.jsxs)(`div`,{className:pb(`app-workspace-shell inbox-layout`,!wt&&fn.panel.open&&!fn.panel.expanded?`pr-[20rem]`:``,!Mt&&`sidebar-hidden`,wt&&`settings-open`),inert:fn.fullscreenArtifact||fn.panel.open&&fn.panel.expanded?!0:void 0,children:[Ot&&(0,R.jsx)(`button`,{className:`fixed inset-0 z-[140] bg-black/40 md:hidden`,type:`button`,"aria-label":`Close sidebar`,onClick:()=>void ri()}),(0,R.jsx)(`div`,{className:`inbox-sidebar-host`,inert:!Mt,children:wt?(0,R.jsx)(US,{activePage:Et,theme:Sn,onThemeChange:e=>void wn(e),onBack:()=>void oi(),onNavigate:e=>{Dt(e),matchMedia(`(max-width: 767px)`).matches&&ri()}}):(0,R.jsx)(dR,{signedInUserId:c,repositoryKeys:On,sections:kn.sections,projects:Dn,models:E?.models??[],selectedProjects:Nt,currentThreadId:Ne,settledOpen:Ft,onSettledOpenChange:It,mutationsEnabled:m,theme:Sn,onThemeChange:e=>void wn(e),onClose:()=>void ri(),onFilter:e=>Pt(e),onSelect:Pr,onNew:jr,onAddProject:()=>yr(`add`),onSettings:ii,onChange:zr,onRename:(e,t)=>Fr(e._id,t)})}),!Mt&&(0,R.jsxs)(`div`,{className:`inbox-floating-controls`,children:[(0,R.jsx)(hb,{size:`sm`,class:`inbox-icon`,label:`Open sidebar`,onclick:()=>void ni()}),(0,R.jsx)(`button`,{className:`inbox-icon`,type:`button`,"aria-label":`Settings`,title:`Settings`,onClick:()=>void ai(),children:(0,R.jsx)(dv,{size:16})})]}),(0,R.jsxs)(`main`,{className:`relative flex h-full min-h-0 min-w-0 flex-col overflow-hidden`,inert:Ot&&At<768,children:[!wt&&!fn.panel.open&&(0,R.jsx)(`button`,{type:`button`,className:`text-muted-foreground hover:text-foreground hover:bg-muted absolute top-3 right-3 z-100 inline-flex items-center justify-center rounded-md p-2 transition`,onClick:()=>fn.update({open:!0}),"aria-label":`Open side panel`,children:(0,R.jsx)(Z_,{className:`size-4`,"aria-hidden":`true`})}),wt?Et===`usage`?(0,R.jsx)(ZS,{}):Et===`providers`&&c?(0,R.jsx)(RS,{userId:c,desktopApi:N,openAiConfigured:re,chatGptStatus:A,chatGptLoading:se,chatGptStatusError:le,loading:de,loadError:he,onChatGptStatusChange:kr,onConfigurationChange:Or}):Et===`payments`?(0,R.jsx)(LS,{}):(0,R.jsx)(SS,{user:o.user,onSignOut:()=>void fr()}):(0,R.jsxs)(R.Fragment,{children:[Ne&&(0,R.jsx)(WP,{userId:c??void 0,messages:zn,actions:Kn,activeRunId:$n?Nn?.runId??null:null,project:Bn,artifacts:fn.artifacts,onOpenArtifact:e=>{fn.update({open:!0,tab:`artifacts`,selectedKey:e})},loadingOlder:dn.loadingOlder,nextBefore:dn.nextBefore??void 0,emptyStateMessage:Ne&&(dn.loading||dn.threadId!==Ne)?`Loading conversation history...`:Bn?`Start a thread and ask Sprocket to inspect code, edit files, or run project commands.`:`Add a project to begin.`,onLoadOlder:()=>void Ir(),loadAttachment:Lr,loadSectionDetails:Rr},`${Ne}:${dn.windowVersion}`),(0,R.jsxs)(`div`,{className:Ne?`shrink-0`:`create-thread-screen`,children:[!Ne&&(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(qx,{projects:En,workspacePath:ke,onProject:Ar,onAddProject:()=>yr(`add`)}),Bn?.localAttachmentAvailability===`unavailable`&&(0,R.jsxs)(`p`,{className:`create-thread-message`,children:[`Project not connected here.`,` `,(0,R.jsx)(`button`,{type:`button`,onClick:()=>{ke&&Dr(ke)},children:`Connect a local folder`}),` `,`to start local work.`]})]}),!ee&&te&&!E?(0,R.jsx)(`div`,{className:`text-muted-foreground mb-3 text-sm`,children:`Loading models…`}):null,(0,R.jsx)(`div`,{ref:Ht,className:Ne?``:`create-thread-composer`,children:(0,R.jsx)(Gx,{notices:(0,R.jsx)(Kx,{error:ar,runError:or,reconnecting:!!(Ne&&dn.threadId===Ne&&dn.stale),catalogError:ee!==null,catalogLoading:te,onRetryCatalog:()=>void ve()}),prompt:We,onPromptChange:Ge,attachments:un.items,onAttachFiles:e=>un.add(e),onRemoveAttachment:e=>un.remove(e),modelCatalog:E,selectedModel:Le,onSelectedModelChange:Re,configuredProviders:_e,providersReady:pe,selectedCompletionProvider:ze,onSelectedCompletionProviderChange:Be,selectedReasoningEffort:Ve,onSelectedReasoningEffortChange:He,fastMode:P,onFastModeChange:Ue,pendingQuestion:Pn,showContinueWorking:nr!=null,onContinueWorking:()=>void qr(),runningCommands:Ne&&c&&N&&m?{api:N,scope:{userId:c,threadId:Ne}}:null,selectedQuestionOptionId:Ke,onSelectedQuestionOptionIdChange:qe,canSend:sr,isSubmitting:ir||tr||Je,isStarting:tr,isRunning:!tr&&er,runStartedAt:$n?Nn?.startedAt??null:null,projectSkills:Un,projectPaths:Hn,onSubmit:()=>void Hr(),onCancel:()=>void Kr()})})]})]})]})]}),!wt&&fn.panel.open&&(0,R.jsx)(`div`,{className:fn.panel.expanded?`bg-background fixed inset-0 z-50`:`absolute inset-y-0 right-0 z-40 w-[20rem]`,inert:fn.fullscreenArtifact?!0:void 0,children:(0,R.jsx)(oF,{workspacePath:N?Bn?.workspacePath:void 0,artifacts:fn.artifacts,onDeleteArtifact:qn,selectedKey:fn.panel.selectedKey,tab:fn.panel.tab,liveView:yn.data,liveActive:!1,expanded:fn.panel.expanded,stale:fn.watchState.stale,error:fn.watchState.error,onSelect:e=>fn.update({selectedKey:e}),onBack:()=>fn.update({selectedKey:null}),onTabChange:e=>fn.update({tab:e}),onOpenFullscreen:e=>{fn.setFullscreenKey(e),document.fullscreenElement||document.documentElement.requestFullscreen?.().catch(()=>{})},onToggleExpanded:()=>fn.update({expanded:!fn.panel.expanded}),onClose:()=>fn.update({open:!1,expanded:!1})})}),fn.fullscreenArtifact&&(0,R.jsx)(sF,{workspacePath:N?Bn?.workspacePath:void 0,artifact:fn.fullscreenArtifact,onClose:()=>fn.setFullscreenKey(null)}),N&&gt&&(0,R.jsx)(AF,{open:gt,desktopApi:N,mode:vt,expectedDisplayName:bt,recentProjectPaths:lr,onClose:()=>{_t(!1),Ct(null),xt(void 0)},onSelect:async e=>{try{await br(e)}catch{await dr()}}})]}):(0,R.jsxs)(`div`,{className:`bg-background h-screen overflow-hidden`,children:[(0,R.jsx)(wb,{authState:{isLoading:!o.isReady||o.isLoading||d||s||l&&i.isLoading,isConfigured:o.isConfigured,isAuthenticated:l,connectionFailed:h,error:o.error},overlayOpen:o.isWaitingForBrowserSignIn,onSignIn:()=>void tg(),onSignOut:()=>void fr(),onRetry:()=>void(p?tg():ug()),retryLabel:p?`Finish sign-in`:`Retry`,onSignUp:()=>void ng()}),(0,R.jsx)(Tb,{open:o.isWaitingForBrowserSignIn,signInUrl:o.browserSignInUrl,error:o.error,onCancel:Qh,onClearOpenError:$h})]}):(0,R.jsx)(Cb,{title:`Connect to Sprocket`,description:et??`Open Sprocket from the desktop app or CLI to continue.`}):(0,R.jsx)(Cb,{title:`Connecting to Sprocket…`,description:`Looking for a running Sprocket server on this machine.`,busy:!0})}function _R(){let{isReady:e}=Wm(Gm);return(0,F.useEffect)(()=>{document.title=`Signing In`},[]),(0,F.useEffect)(()=>{e&&window.location.replace(`/`)},[e]),(0,R.jsx)(Cb,{title:`Completing sign-in`,description:`Sprocket is finishing authentication and will return to your projects automatically.`})}var vR=class extends F.Component{state={failed:!1};static getDerivedStateFromError(){return{failed:!0}}render(){return this.state.failed?(0,R.jsx)(Cb,{title:`Unable to display Sprocket`,description:`Reload the app to try again.`,actions:(0,R.jsx)(`button`,{type:`button`,className:`text-foreground rounded-lg border border-[var(--hairline)] px-4 py-2 text-sm`,onClick:()=>window.location.reload(),children:`Reload`})}):this.props.children}},yR=document.getElementById(`root`);if(!yR)throw Error(`Missing application root.`);var bR=(0,fr.createRoot)(yR);async function xR(){try{let e=await hf(),t=e.env.PUBLIC_CONVEX_URL;if(!t)throw Error(`Sprocket is missing its Convex configuration.`);let n=new Un(t,{unsavedChangesWarning:!1});bR.render((0,R.jsx)(vR,{children:(0,R.jsx)(pg,{client:n,machine:e.machine,children:window.location.pathname===`/callback`?(0,R.jsx)(_R,{}):(0,R.jsx)(gR,{config:e})})}))}catch(e){bR.render((0,R.jsx)(Cb,{title:`Unable to connect`,description:e instanceof Error?e.message:`Failed to start Sprocket.`}))}}xR();
488
+ <\/script>`)}function XP(e){let t=e.trim();return/^<!DOCTYPE html>/i.test(t)||/^<html[\s>]/i.test(t)?t:JP(``,t)}function ZP(e,t){return e===`react`?YP(t):e===`html`?XP(t):null}function QP({title:e,artifactType:t,content:n,localPath:r,workspacePath:i,localError:a,variant:o=`card`,onOpenFullscreen:s,onBack:c,onDelete:l}){let u=(0,F.useMemo)(()=>ZP(t,n),[t,n]),[d,f]=(0,F.useState)(!1),[p,m]=(0,F.useState)(!1),h=(0,F.useRef)(null);async function g(){try{await navigator.clipboard.writeText(n),m(!0),h.current!==null&&clearTimeout(h.current),h.current=setTimeout(()=>{m(!1),h.current=null},1500)}catch{m(!1)}}(0,F.useEffect)(()=>()=>{h.current!==null&&clearTimeout(h.current)},[]);function _(t){return(0,R.jsxs)(`div`,{className:`relative min-h-0 flex-1 border-t`,children:[u&&!d?(0,R.jsx)(`iframe`,{title:`${e} preview`,srcDoc:u,sandbox:`allow-scripts`,className:`block w-full bg-white ${t}`}):u?(0,R.jsx)(`pre`,{className:`h-full overflow-auto p-3 pr-10 text-[13px] leading-6`,children:(0,R.jsx)(`code`,{children:n})}):(0,R.jsx)(`div`,{className:`h-full overflow-auto p-3 pr-10`,children:(0,R.jsx)(aP,{content:n,className:`text-foreground text-sm`,imageScope:{workspacePath:i,documentPath:r}})}),(0,R.jsx)(`button`,{type:`button`,className:`bg-card text-muted-foreground hover:text-foreground absolute top-2 right-2 rounded-md border p-1 transition`,"aria-label":p?`Copied`:`Copy`,onClick:()=>void g(),children:p?(0,R.jsx)(Ug,{className:`size-3.5`,"aria-hidden":`true`}):(0,R.jsx)(r_,{className:`size-3.5`,"aria-hidden":`true`})})]})}return(0,R.jsxs)(`div`,{className:o===`full`?`bg-card flex min-h-0 flex-1 flex-col overflow-hidden rounded-lg border`:`bg-card rounded-lg border`,children:[(0,R.jsxs)(`div`,{className:`flex items-center gap-2 px-3 py-2`,children:[c?(0,R.jsx)(`button`,{type:`button`,className:`text-muted-foreground hover:text-foreground shrink-0 transition`,onClick:c,"aria-label":`Back to artifacts`,children:(0,R.jsx)(kg,{className:`size-4`,"aria-hidden":`true`})}):null,(0,R.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-0.5`,children:[(0,R.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,R.jsx)(`span`,{className:`text-foreground min-w-0 truncate text-sm font-medium`,children:e}),(0,R.jsx)(`span`,{className:`text-muted-foreground shrink-0 text-[11px]`,children:t})]}),r?(0,R.jsx)(`span`,{className:`text-muted-foreground min-w-0 truncate text-[11px]`,children:r}):null]}),u?(0,R.jsx)(`button`,{type:`button`,className:`text-muted-foreground hover:text-foreground inline-flex shrink-0 items-center gap-1 rounded-md border px-2 py-1 text-[11px] transition`,onClick:()=>f(e=>!e),"aria-label":d?`Show preview`:`Show source`,children:d?(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(__,{className:`size-3.5`,"aria-hidden":`true`}),`Preview`]}):(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(t_,{className:`size-3.5`,"aria-hidden":`true`}),`Source`]})}):null,s?(0,R.jsx)(`button`,{type:`button`,className:`text-muted-foreground hover:text-foreground shrink-0 transition`,onClick:s,"aria-label":`Open fullscreen`,title:`Open fullscreen`,children:(0,R.jsx)(j_,{className:`size-4`,"aria-hidden":`true`})}):null,l?(0,R.jsx)(KP,{title:e,trigger:`button`,onDelete:l}):null]}),a?(0,R.jsx)(`p`,{role:`alert`,className:`px-3 pb-2 text-[11px] text-amber-800 dark:text-amber-200`,children:a}):null,_(o===`full`?`h-full`:`h-64`)]})}var $P=`Browser sessions are not available yet.`,eF=async()=>{throw Error($P)},tF=async()=>{throw Error($P)};function nF(e){return`Closes by ${new Date(e).toLocaleString(void 0,{month:`short`,day:`numeric`,hour:`numeric`,minute:`2-digit`})}`}function rF(e,t){return e instanceof Error&&e.message||t}function iF({liveView:e,active:t}){let[n,r]=(0,F.useState)(null),[i,a]=(0,F.useState)(null),o=e?.threadId,s=e?.id,c=e?.providerSessionId??null,l=e?.humanControl===!0,u=e?.url??null,d=e?.interactiveUrl??null,f=l&&d!==null,p=f?d:u,m=e?.ended===!0,h=o!=null,g=n!==null||m||d==null&&!l,_=e==null?null:nF(e.expiresAt),v=(()=>{let e=[];return _&&e.push(_),l&&!f&&e.push(`Waiting for the interactive view`),e.join(` · `)||null})(),y=l?`You have control`:t?`The agent is browsing`:`Browser session`,b=i!==null&&i.recordId===s&&i.providerId===c?i.message:null;(0,F.useEffect)(()=>{a(null)},[s,c]);async function x(e){if(!(o==null||g)){r(`control`),a(null);try{await eF()}catch(t){a({recordId:s,providerId:c,message:rF(t,e?`Couldn’t take control.`:`Couldn’t give control back.`)})}finally{r(null)}}}async function S(){if(!(s==null||m||n!==null)){r(`stop`),a(null);try{await tF()}catch(e){a({recordId:s,providerId:c,message:rF(e,`Couldn’t stop the browser session.`)})}finally{r(null)}}}return(0,R.jsx)(`div`,{className:`flex min-h-0 flex-1 flex-col`,children:e&&!m?(0,R.jsxs)(R.Fragment,{children:[(0,R.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-2 gap-y-1 border-b px-3 py-1.5`,children:[(0,R.jsx)(`span`,{className:`relative flex size-2 shrink-0`,"aria-hidden":`true`,children:l?(0,R.jsx)(`span`,{className:`relative inline-flex size-2 rounded-full bg-amber-500`}):t?(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(`span`,{className:`absolute inline-flex h-full w-full animate-ping rounded-full bg-emerald-500 opacity-60`}),(0,R.jsx)(`span`,{className:`relative inline-flex size-2 rounded-full bg-emerald-500`})]}):(0,R.jsx)(`span`,{className:`bg-muted-foreground/40 relative inline-flex size-2 rounded-full`})}),(0,R.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,R.jsx)(`span`,{role:`status`,className:`text-muted-foreground text-xs`,children:y}),v?(0,R.jsx)(`p`,{className:`text-muted-foreground text-[10px]`,children:v}):null]}),h?(0,R.jsx)(`button`,{type:`button`,className:`text-foreground hover:bg-muted rounded-md px-2 py-0.5 text-xs font-medium transition disabled:pointer-events-none disabled:opacity-50`,disabled:g,"aria-busy":n===`control`,onClick:()=>{x(!l)},children:n===`control`?l?`Giving control back…`:`Taking control…`:l?`Give control back`:`Take control`}):null,u?(0,R.jsx)(`a`,{href:u,target:`_blank`,rel:`noopener noreferrer`,className:`text-muted-foreground hover:text-foreground rounded-md p-1 transition`,"aria-label":`Open watch-only live view in a new tab`,title:`Open watch-only live view in a new tab`,children:(0,R.jsx)(p_,{className:`size-3.5`,"aria-hidden":`true`})}):null,(0,R.jsx)(`button`,{type:`button`,className:`flex size-7 shrink-0 cursor-pointer items-center justify-center rounded-full bg-rose-500/90 text-white transition-all duration-150 hover:scale-105 hover:bg-rose-500 disabled:pointer-events-none disabled:opacity-60 disabled:hover:scale-100`,"aria-label":`Stop browser session`,title:`Stop browser session`,"aria-busy":n===`stop`,disabled:n!==null,onClick:()=>{S()},children:n===`stop`?(0,R.jsx)(V_,{className:`size-3.5 animate-spin`,"aria-hidden":`true`}):(0,R.jsx)(yv,{className:`size-3 fill-current`,"aria-hidden":`true`})})]}),b?(0,R.jsx)(`p`,{className:`text-destructive border-b px-3 py-1.5 text-xs`,role:`alert`,children:b}):null,p?(0,R.jsx)(`iframe`,{src:p,title:f?`Agent browser (interactive)`:`Agent browser`,className:`min-h-0 w-full flex-1 border-0`,allow:`clipboard-read; clipboard-write`},p):(0,R.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col items-center justify-center gap-2 p-6 text-center`,children:[(0,R.jsx)(V_,{className:`text-muted-foreground size-5 animate-spin`,"aria-hidden":`true`}),(0,R.jsx)(`p`,{className:`text-muted-foreground text-sm`,children:`Starting the live view…`}),(0,R.jsx)(`p`,{className:`text-muted-foreground text-xs`,children:`The agent is browsing in the meantime.`})]})]}):m||e===null?(0,R.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col items-center justify-center gap-2 p-6 text-center`,children:[(0,R.jsx)(N_,{className:`text-muted-foreground size-5`,"aria-hidden":`true`}),(0,R.jsx)(`p`,{className:`text-muted-foreground text-sm`,role:`status`,children:`${m?`Browser session ended.`:`No active browser session.`} When the agent browses again, a new session will appear here.`})]}):(0,R.jsx)(`div`,{className:`flex min-h-0 flex-1 items-center justify-center`,children:(0,R.jsx)(V_,{className:`text-muted-foreground size-5 animate-spin`,"aria-hidden":`true`})})})}var aF={markdown:C_,html:N_,react:y_},oF=[{id:`artifacts`,label:`Artifacts`},{id:`live`,label:`Live view`}];function sF({artifacts:e,workspacePath:t,onDeleteArtifact:n,selectedKey:r,tab:i,liveView:a,liveActive:o,expanded:s,stale:c=!1,error:l=null,onSelect:u,onBack:d,onTabChange:f,onOpenFullscreen:p,onToggleExpanded:m,onClose:h}){let g=e.find(e=>e.key===r)??null;function _(e){document.getElementById(`side-panel-tab-${e}`)?.focus()}function v(e){let t=oF.findIndex(e=>e.id===i),n=-1;e.key===`ArrowRight`?n=(t+1)%oF.length:e.key===`ArrowLeft`?n=(t-1+oF.length)%oF.length:e.key===`Home`?n=0:e.key===`End`&&(n=oF.length-1),n!==-1&&(e.preventDefault(),f(oF[n].id),_(oF[n].id))}return(0,F.useEffect)(()=>{if(!s)return;let e=e=>{e.key===`Escape`&&(document.fullscreenElement||document.querySelector(`[data-artifact-screen-fullscreen]`)||document.querySelector(`[data-image-viewer]`)||(e.preventDefault(),m()))};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[s,m]),(0,R.jsxs)(`aside`,{className:`bg-background flex h-full min-h-0 w-full flex-col ${s?``:`border-l`}`,children:[(0,R.jsxs)(`div`,{className:`flex items-center gap-1 border-b px-2 py-1.5`,children:[(0,R.jsx)(`div`,{role:`tablist`,"aria-label":`Side panel views`,className:`flex items-center gap-1`,children:oF.map(e=>(0,R.jsx)(`button`,{type:`button`,role:`tab`,id:`side-panel-tab-${e.id}`,"aria-controls":`side-panel-tabpanel`,"aria-selected":i===e.id,tabIndex:i===e.id?0:-1,className:`rounded-md px-2.5 py-1 text-xs font-medium transition ${i===e.id?`bg-muted text-foreground`:`text-muted-foreground hover:text-foreground`}`,onClick:()=>f(e.id),onKeyDown:v,children:(0,R.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[e.id===`live`&&o&&i!==`live`?(0,R.jsx)(`span`,{className:`size-1.5 animate-pulse rounded-full bg-emerald-500`,"aria-hidden":`true`}):null,e.label]})},e.id))}),(0,R.jsx)(`div`,{className:`flex-1`}),(0,R.jsx)(`button`,{type:`button`,className:`text-muted-foreground hover:text-foreground rounded-md p-1 transition`,onClick:m,"aria-label":s?`Exit full workspace`:`Expand to full workspace`,title:s?`Exit full workspace`:`Expand to full workspace`,"aria-pressed":s,children:s?(0,R.jsx)(pv,{className:`size-4`,"aria-hidden":`true`}):(0,R.jsx)(d_,{className:`size-4`,"aria-hidden":`true`})}),(0,R.jsx)(`button`,{type:`button`,className:`text-muted-foreground hover:text-foreground rounded-md p-1 transition`,onClick:h,"aria-label":`Close panel`,children:(0,R.jsx)(Fv,{className:`size-4`,"aria-hidden":`true`})})]}),(0,R.jsx)(`div`,{role:`tabpanel`,id:`side-panel-tabpanel`,"aria-labelledby":`side-panel-tab-${i}`,className:`flex min-h-0 flex-1 flex-col`,children:i===`live`?(0,R.jsx)(iF,{liveView:a,active:o}):(0,R.jsxs)(R.Fragment,{children:[l||c?(0,R.jsxs)(`div`,{className:`space-y-1 border-b px-3 py-2`,children:[l?(0,R.jsx)(`p`,{role:`alert`,className:`text-xs text-amber-800 dark:text-amber-200`,children:l}):null,c?(0,R.jsx)(`p`,{role:`status`,className:`text-muted-foreground text-xs`,children:`Showing last known artifacts while Sprocket reconnects.`}):null]}):null,g?(0,R.jsx)(`div`,{className:`flex min-h-0 flex-1 flex-col p-3`,children:(0,R.jsx)(QP,{title:g.title,artifactType:g.artifactType,content:g.content,localPath:g.localPath,workspacePath:t,localError:g.localError,variant:`full`,onOpenFullscreen:()=>p(g.key),onBack:d,onDelete:n?()=>n(g.key):void 0})}):(0,R.jsx)(`div`,{className:`min-h-0 flex-1 space-y-0.5 overflow-y-auto p-2`,children:e.length===0?(0,R.jsx)(`p`,{className:`text-muted-foreground p-3 text-sm`,children:`No artifacts yet.`}):e.map(e=>{let t=aF[e.artifactType];return(0,R.jsxs)(`div`,{className:`group hover:bg-muted focus-within:bg-muted flex items-center gap-2 rounded-md px-2 py-1.5`,children:[(0,R.jsx)(KP,{trigger:`context`,title:e.title,onDelete:n?()=>n(e.key):void 0,children:(0,R.jsxs)(`button`,{type:`button`,className:`flex min-w-0 flex-1 items-center gap-2 text-left`,onClick:()=>u(e.key),children:[(0,R.jsx)(t,{className:`text-muted-foreground size-3.5 shrink-0`,"aria-hidden":`true`}),(0,R.jsxs)(`span`,{className:`flex min-w-0 flex-1 flex-col`,children:[(0,R.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2`,children:[(0,R.jsx)(`span`,{className:`text-foreground min-w-0 truncate text-sm`,children:e.title}),(0,R.jsx)(`span`,{className:`text-muted-foreground shrink-0 text-[11px]`,children:e.artifactType})]}),(0,R.jsx)(`span`,{className:`text-muted-foreground min-w-0 truncate text-[11px]`,children:e.localPath??`Stored in cloud`}),e.localError?(0,R.jsx)(`span`,{className:`text-[11px] text-amber-800 dark:text-amber-200`,children:e.localError}):null]})]})}),(0,R.jsx)(`button`,{type:`button`,className:`text-muted-foreground hover:text-foreground shrink-0 opacity-0 transition group-focus-within:opacity-100 group-hover:opacity-100 focus:opacity-100`,onClick:()=>p(e.key),"aria-label":`Open ${e.title} fullscreen`,title:`Open fullscreen`,children:(0,R.jsx)(j_,{className:`size-3.5`,"aria-hidden":`true`})})]},e.key)})})]})})]})}function cF({artifact:e,workspacePath:t,onClose:n}){let r=(0,F.useMemo)(()=>ZP(e.artifactType,e.content),[e.artifactType,e.content]),i=(0,F.useRef)(null),[a,o]=(0,F.useState)(!1),s=(0,F.useRef)(n);return(0,F.useLayoutEffect)(()=>{s.current=n},[n]),(0,F.useEffect)(()=>{let e=i.current;if(!e)return;let t=!0,n=!!document.fullscreenElement,r=document.activeElement instanceof HTMLElement?document.activeElement:null,a=()=>{t&&(t=!1,s.current())},c=()=>{if(document.fullscreenElement){n=!0,o(!1);return}if(n){if(document.querySelector(`[data-image-viewer]`)){n=!1,o(!0);return}a()}},l=e=>{document.querySelector(`[data-image-viewer]`)||e.key===`Escape`&&(e.stopImmediatePropagation(),!(document.fullscreenElement||n)&&(e.preventDefault(),a()))};document.addEventListener(`fullscreenchange`,c),window.addEventListener(`keydown`,l,!0),queueMicrotask(()=>{t&&e.focus()});let u=window.setTimeout(()=>{t&&!document.fullscreenElement&&o(!0)},250);return()=>{t=!1,window.clearTimeout(u),document.removeEventListener(`fullscreenchange`,c),window.removeEventListener(`keydown`,l,!0),document.fullscreenElement&&document.exitFullscreen?.().catch(()=>{});let e=r;queueMicrotask(()=>{e?.isConnected&&e.focus()})}},[]),(0,R.jsxs)(`div`,{ref:i,"data-artifact-screen-fullscreen":``,className:`bg-background fixed inset-0 z-200 flex h-screen w-screen flex-col outline-none`,role:`dialog`,"aria-modal":`true`,"aria-label":`${e.title} fullscreen. Press Escape to exit.`,tabIndex:-1,children:[r?(0,R.jsx)(`iframe`,{title:`${e.title} preview`,srcDoc:r,sandbox:`allow-scripts`,className:`block h-full w-full flex-1 bg-white`}):(0,R.jsx)(`div`,{className:`min-h-0 flex-1 overflow-auto p-6`,children:(0,R.jsx)(aP,{content:e.content,className:`text-foreground text-sm`,imageScope:{workspacePath:t,documentPath:e.localPath}})}),a?(0,R.jsx)(`button`,{type:`button`,className:`bg-background/90 text-muted-foreground hover:text-foreground absolute top-3 right-3 z-10 rounded-md border p-2 transition`,onClick:n,"aria-label":`Exit fullscreen`,children:(0,R.jsx)(Fv,{className:`size-4`,"aria-hidden":`true`})}):null]})}var lF={artifacts:[],stale:!1,error:null};function uF(e){return[e.userId,e.repositoryKey,e.workspacePath].join(`\0`)}function dF(e){return{key:e._id,title:e.title,artifactType:e.type,content:e.content,localPath:e.localPath,localError:e.localError}}function fF(e){return!e.aborted&&e.generation===e.currentGeneration&&e.currentScopeKey===e.eventScopeKey}function pF(e){return{artifacts:e.artifacts,stale:e.stale,error:e.error??null}}function mF(e,t){let n=new Map(e.artifacts.map(e=>[e._id,e]));for(let r of t?.artifacts??[])(e.stale||n.has(r._id))&&(r.localPath||!n.has(r._id))&&n.set(r._id,r);return{artifacts:[...n.values()],stale:e.stale&&(!t||t.stale),error:t?.error??e.error}}function hF(e,t,n){let{userId:r,...i}=t,a=!1,o=0,s,c=[];async function l(t){try{let s=[],l=null,u;for(;;){let n=await e.query(Jp.artifacts.listArtifacts,{...i,cursor:l});if(a||o!==t)return;if(u!==void 0&&u!==n.revision)throw Error(`Artifact registry changed during loading; retrying.`);if(u=n.revision,s.push(...n.page.filter(e=>e.userId===r)),n.isDone)break;if(l===n.continueCursor)throw Error(`Artifact page cursor did not advance.`);l=n.continueCursor}c=s,n({artifacts:s,stale:!1,error:null})}catch(e){if(a||o!==t)return;n({artifacts:c,stale:!0,error:e instanceof Error?e.message:`Unable to load artifacts.`}),s=setTimeout(()=>{l(t)},2e3)}}let u=e.onUpdate(Jp.artifacts.getArtifactState,{repositoryKey:t.repositoryKey},()=>{clearTimeout(s),l(++o)},e=>{o++,clearTimeout(s),c=[],n({artifacts:[],stale:!0,error:e.message})});return()=>{a=!0,clearTimeout(s),u()}}var gF={open:!1,expanded:!1,tab:`artifacts`,selectedKey:null},_F=class{watchState={...lF};panel={...gF};fullscreenKey=null;#e=0;#t=null;#n=new Map;#r=null;#i=0;#a=new Set;getSnapshot=()=>this.#i;subscribe=e=>(this.#a.add(e),()=>{this.#a.delete(e)});get artifacts(){return this.watchState.artifacts.map(dF)}get fullscreenArtifact(){return this.artifacts.find(e=>e.key===this.fullscreenKey)??null}selectScope(e){let t=e?uF(e):null;t!==this.#r&&(this.#r&&this.#n.set(this.#r,this.panel),this.#r=t,this.fullscreenKey=null,this.panel={...t&&this.#n.get(t)||gF},this.#o())}watch(e){let t=++this.#e;if(this.watchState={...lF},this.#o(),!e.scope){this.#t=null;return}let n=uF(e.scope);this.#t=n;let r=new AbortController,i={artifacts:[],stale:!0,error:null},a=null,o=()=>{r.signal.aborted||t!==this.#e||(this.watchState=mF(i,a),this.#o())},s={userId:e.scope.userId,repositoryKey:e.scope.repositoryKey},c=e.cloudReady?hF(e.artifactClient,s,e=>{i=e,o()}):()=>{};return this.#s(e.localApi,e.scope.workspacePath,e.scope,{ac:r,generation:t,scopeKey:n,setLocal:e=>{a=e,o()}}),()=>{r.abort(),c()}}reset(){this.#n.clear(),this.#r=null,this.#t=null,this.panel={...gF},this.fullscreenKey=null,this.#o()}update(e){this.panel={...this.panel,...e},this.#o()}setFullscreenKey(e){this.fullscreenKey!==e&&(this.fullscreenKey=e,this.#o())}#o(){this.#i+=1;for(let e of this.#a)e()}async#s(e,t,n,r){if(e&&t)for(;!r.ac.signal.aborted;)await e.watchArtifacts(n,{signal:r.ac.signal,onEvent:e=>{fF({aborted:r.ac.signal.aborted,generation:r.generation,currentGeneration:this.#e,eventScopeKey:r.scopeKey,currentScopeKey:this.#t})&&r.setLocal(pF(e))}}).catch(()=>void 0),!r.ac.signal.aborted&&r.generation===this.#e&&this.#t===r.scopeKey&&r.setLocal(null),r.ac.signal.aborted||await new Promise(e=>setTimeout(e,1e3))}};function vF(){let[e]=(0,F.useState)(()=>new _F);return Wm(e),e}function yF(e){return{query:(t,n)=>e.query(t,n),onUpdate:(t,n,r,i)=>{let a=e.watchQuery(t,n),o=()=>{try{let e=a.localQueryResult();e!==void 0&&r(e)}catch(e){i(e instanceof Error?e:Error(String(e)))}};return o(),a.onUpdate(o)}}}function bF(e){return e.startsWith(`./`)||e.startsWith(`../`)||e.startsWith(`.\\`)||e.startsWith(`..\\`)||e.startsWith(`/`)||e.startsWith(`\\`)||e.startsWith(`~/`)||e===`~`||/^[a-zA-Z]:([\\/]|$)/.test(e)}function xF(e){if(e.endsWith(`/`)||e.endsWith(`\\`))return e;let t=e.lastIndexOf(`/`),n=e.lastIndexOf(`\\`),r=Math.max(t,n);return r<0?e:e.slice(0,r+1)}function SF(e){let t=xF(e);return e.slice(t.length)}function CF(e){return!e||EF(e)?e:`${e}${TF(e)}`}function wF(e){let t=e.trim();return t===`/`||t===`\\`||/^[a-zA-Z]:?$/.test(t)||/^[\\/][a-zA-Z]:?$/.test(t)}function TF(e){return e.includes(`\\`)||/^[a-zA-Z]:$/.test(e)?`\\`:`/`}function EF(e){return/[\\/]$/.test(e)}function DF(e){return e.replace(/[\\/]+$/,``)}function OF(e){if(!e.leaf)return;let t=e.browseEntries.find(t=>t.name!==`..`&&t.name===e.leaf);if(t)return t.fullPath;if(e.browseParentPath){let t=e.browseParentPath.split(/[/\\]/).filter(Boolean).at(-1);if(t&&t.toLowerCase()===e.leaf.toLowerCase())return e.browseParentPath}}function kF(e){let t=e.query.trim();return t?EF(t)?e.browseParentPath||DF(t):OF({leaf:SF(t),browseParentPath:e.browseParentPath,browseEntries:e.browseEntries})??t:``}function AF(e){let t=e.query.trim();if(!t||EF(t))return!1;let n=SF(t);return n?OF({leaf:n,browseParentPath:e.browseParentPath,browseEntries:e.browseEntries})===void 0:!1}function jF({open:e,desktopApi:t,mode:n=`add`,expectedDisplayName:r,recentProjectPaths:i=[],onClose:a,onSelect:o}){let[s,c]=(0,F.useState)(`~/`),[l,u]=(0,F.useState)([]),[d,f]=(0,F.useState)(``),[p,m]=(0,F.useState)(!1),[h,g]=(0,F.useState)(null),[_,v]=(0,F.useState)(!1),[y,b]=(0,F.useState)(!1),[x,S]=(0,F.useState)(null),[C,w]=(0,F.useState)(null),[T,E]=(0,F.useState)(!1),D=(0,F.useRef)(`~/`),ee=(0,F.useRef)(!1),O=(0,F.useRef)(null),te=(0,F.useRef)(null),ne=(0,F.useRef)(0),re=(0,F.useRef)(null),ie=(0,F.useRef)(!1),k=(0,F.useCallback)(e=>{D.current=e,c(e)},[]),ae=(0,F.useCallback)(e=>{ee.current=e,m(e)},[]),A=(0,F.useCallback)(async e=>{let n=++ne.current;re.current=e,v(!0);try{let r=await t.browseFilesystem({partialPath:e.trim().length>0?e:`~/`});if(n!==ne.current||e!==D.current)return;f(r.parentPath),u(r.entries),ae(r.volumeList===!0),w(e),S(null)}catch(t){if(n!==ne.current||e!==D.current)return;f(``),u([]),ae(!1),w(e),re.current=null,S(t instanceof Error?t.message:`Failed to browse directories.`)}finally{n===ne.current&&v(!1)}},[t,ae]),oe=SF(s).toLowerCase(),se=s===C,ce=se?d:``,le=se?l:[],ue=(0,F.useMemo)(()=>{if(!se)return[];if(p){let e=s.trim().replace(/^[\\/]+/,``).toLowerCase();return l.filter(t=>t.name.toLowerCase().startsWith(e)||t.fullPath.toLowerCase().startsWith(e))}let e=oe.startsWith(`.`);return l.filter(t=>t.name!==`..`&&t.name.toLowerCase().startsWith(oe)&&(e||!t.name.startsWith(`.`)))},[se,p,s,l,oe]),de=s.trim(),fe=kF({query:s,browseParentPath:ce,browseEntries:le}),pe=AF({query:s,browseParentPath:ce,browseEntries:le}),me=se&&!p&&!x&&fe.length>0&&(bF(de)||ce.length>0),he=n===`reconnect`?`Reconnect`:pe?`Create & add`:`Add`,ge=le.find(e=>e.name===`..`),_e=(0,F.useMemo)(()=>{if(ue.length>0)return ue;let e=SF(s).replace(/[\\/]+$/,``);if(!e||oe.length===0)return ue;let t=ce.split(/[/\\]/).filter(Boolean).at(-1);return t&&t.toLowerCase()===e.toLowerCase()?[{name:t,fullPath:ce}]:ue},[ue,s,oe,ce]),ve=_||!se?`Loading directories…`:p?`Select a drive.`:fe.length>0&&!pe?n===`reconnect`?`Press Ctrl+Enter to reconnect this directory.`:`Press Ctrl+Enter to add this directory.`:pe?n===`reconnect`?`Press Ctrl+Enter to create and reconnect this directory.`:`Press Ctrl+Enter to create and add this directory.`:`No matching directories in this path.`,ye=_e.findIndex(e=>e.fullPath===h),j=ye<0?void 0:_e[ye];(0,F.useEffect)(()=>{if(!e){E(!1);return}T||(E(!0),k(`~/`),g(null),S(null),ae(!1),w(null),A(`~/`))},[e,T,A,k,ae]),(0,F.useEffect)(()=>{T&&O.current?.focus()},[T]),(0,F.useEffect)(()=>{if(!e||!T)return;let t=s;if(t===re.current)return;let n=window.setTimeout(()=>{ee.current&&wF(t)||A(t)},180);return()=>{window.clearTimeout(n)}},[e,T,s,A]),(0,F.useEffect)(()=>{e&&!_&&_e.length!==0&&(_e.some(e=>e.fullPath===h)||g(_e[0]?.fullPath??null))},[e,_,_e,h]),(0,F.useEffect)(()=>{e&&ie.current&&(ie.current=!1,(te.current?.querySelector(`[aria-selected="true"]`))?.scrollIntoView?.({block:`nearest`}))},[e,h,_e]);function M(e){let t=CF(e.fullPath);k(t),g(null),A(t)}function be(e){let t=CF(e.workspacePath);k(t),g(e.workspacePath),A(t)}async function xe(){if(p)return;let e=fe;if(!e){S(`Enter a project directory path.`);return}b(!0),S(null);try{let n=await t.resolveWorkspacePath({workspacePath:e,createIfMissing:pe});await o({workspacePath:n.workspacePath,displayName:n.displayName,repositoryKey:n.repositoryKey}),a()}catch(e){S(e instanceof Error?e.message:`Failed to open the selected project.`)}finally{b(!1)}}function N(e){if(_e.length===0)return;let t=((ye<0?e===1?-1:0:ye)+e+_e.length)%_e.length;ie.current=!0,g(_e[t]?.fullPath??null)}function Se(){ge&&!_&&M(ge)}function Ce(e){return e.target instanceof HTMLInputElement?oe.length===0:!0}function we(e){if(!(e.defaultPrevented||e.nativeEvent.isComposing)){if(e.key===`Escape`){e.preventDefault(),a();return}if(e.key===`Enter`&&(e.ctrlKey||e.metaKey)&&me&&!y){e.preventDefault(),xe();return}if(!(e.ctrlKey||e.metaKey||e.altKey||e.shiftKey)&&!_){if(e.key===`ArrowDown`||e.key===`ArrowUp`){e.preventDefault(),N(e.key===`ArrowDown`?1:-1);return}if(e.key===`Enter`&&j){if(e.target instanceof Element&&e.target.closest(`[data-project-submit]`))return;e.preventDefault(),M(j);return}e.key===`Backspace`&&ge&&Ce(e)&&(e.preventDefault(),Se())}}}return e?(0,R.jsx)(`div`,{className:`bg-overlay fixed inset-0 z-50 flex items-start justify-center px-4 pt-[7vh] backdrop-blur-[2px]`,role:`presentation`,onClick:e=>{e.target===e.currentTarget&&a()},children:(0,R.jsxs)(`div`,{className:`border-border bg-popover text-foreground flex h-[min(34rem,80vh)] w-full max-w-3xl min-w-0 flex-col overflow-hidden rounded-[1.4rem] border shadow-2xl`,role:`dialog`,"aria-modal":`true`,"aria-label":n===`reconnect`?`Reconnect project`:`Add project`,tabIndex:-1,onKeyDown:we,children:[(0,R.jsxs)(`header`,{className:`flex-none px-4 pt-3 pb-2`,children:[(0,R.jsxs)(`div`,{className:`flex min-h-10 items-center gap-1.5`,children:[(0,R.jsx)(`button`,{type:`button`,className:`text-muted-foreground hover:text-foreground hover:bg-hover-fill flex size-8 shrink-0 items-center justify-center rounded-lg transition disabled:pointer-events-none disabled:opacity-30`,"aria-label":`Go to parent directory`,disabled:!ge||_,onClick:Se,children:(0,R.jsx)(kg,{className:`size-4`,strokeWidth:2})}),(0,R.jsx)(`input`,{className:`text-foreground placeholder:text-muted-foreground min-w-0 flex-1 bg-transparent py-2 text-base outline-none`,ref:O,value:s,onChange:e=>k(e.currentTarget.value),placeholder:`Enter a project path`,"aria-label":`Project directory path`,"aria-controls":`project-picker-directories`,"aria-activedescendant":ye<0?void 0:`project-picker-directory-${ye}`,"aria-autocomplete":`list`,"aria-expanded":`true`,role:`combobox`,autoComplete:`off`,spellCheck:!1}),_&&(0,R.jsx)(V_,{className:`text-muted-foreground pointer-events-none size-4 shrink-0 animate-spin`}),(0,R.jsxs)(`button`,{type:`button`,className:`border-border text-foreground bg-hover-fill hover:bg-hover-fill-strong flex shrink-0 items-center gap-1.5 rounded-lg border px-2.5 py-1 text-sm transition disabled:cursor-not-allowed disabled:opacity-40`,"data-project-submit":!0,disabled:!me||y,onClick:()=>{xe()},children:[(0,R.jsx)(`span`,{children:y?`Working…`:he}),!y&&(0,R.jsx)(`kbd`,{className:`text-muted-foreground font-sans text-xs`,children:`Ctrl Enter`})]})]}),n===`reconnect`&&r&&(0,R.jsxs)(`p`,{className:`text-muted-foreground px-9 pb-1 text-xs`,children:[`Reconnect `,(0,R.jsx)(`span`,{className:`text-muted-foreground`,children:r}),` to a local directory`]})]}),i.length>0&&(0,R.jsx)(`div`,{className:`border-hairline flex flex-wrap gap-1.5 border-b px-5 py-2`,children:i.map(e=>(0,R.jsx)(`button`,{type:`button`,className:`text-muted-foreground hover:text-foreground hover:bg-hover-fill rounded-md px-2 py-0.5 text-[11px] transition`,onClick:()=>{be(e)},children:e.displayName},e.workspacePath))}),(0,R.jsx)(`div`,{className:`text-muted-foreground flex-none px-6 pt-3 pb-1 text-sm`,children:`Directories`}),(0,R.jsx)(`div`,{id:`project-picker-directories`,className:`min-h-0 flex-1 overflow-y-auto px-2 pb-2`,ref:te,role:`listbox`,"aria-label":`Directories`,"aria-busy":_,children:_e.length===0?(0,R.jsx)(`p`,{className:`text-muted-foreground px-3 py-8 text-center text-sm`,children:ve}):_e.map((e,t)=>(0,R.jsxs)(`button`,{id:`project-picker-directory-${t}`,type:`button`,className:`flex min-h-10 w-full items-center gap-2.5 rounded-lg px-3 py-1.5 text-left text-base transition ${h===e.fullPath?`text-foreground bg-hover-fill-strong`:`text-muted-foreground hover:text-foreground hover:bg-hover-fill`}`,role:`option`,"aria-selected":h===e.fullPath,onClick:()=>{M(e)},onPointerMove:()=>{g(e.fullPath)},children:[(0,R.jsx)(k_,{className:`text-muted-foreground size-5 shrink-0`,strokeWidth:1.8}),(0,R.jsx)(`span`,{className:`truncate`,children:e.name})]},e.fullPath))}),x&&(0,R.jsx)(`p`,{className:`text-destructive border-t border-rose-500/20 bg-rose-500/10 px-3 py-2 text-sm`,children:x}),(0,R.jsx)(`footer`,{className:`text-muted-foreground border-hairline flex-none border-t px-5 py-3 text-sm`,children:(0,R.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-4 gap-y-2`,children:[(0,R.jsxs)(`span`,{className:`flex items-center gap-1.5`,children:[(0,R.jsx)(`kbd`,{className:`shortcut-key`,children:`↑`}),(0,R.jsx)(`kbd`,{className:`shortcut-key`,children:`↓`}),` Navigate`]}),(0,R.jsxs)(`span`,{className:`flex items-center gap-1.5`,children:[(0,R.jsx)(`kbd`,{className:`shortcut-key`,children:`Enter`}),` Select`]}),(0,R.jsxs)(`span`,{className:`flex items-center gap-1.5`,children:[(0,R.jsx)(`kbd`,{className:`shortcut-key`,children:`Backspace`}),` Back`]}),(0,R.jsxs)(`span`,{className:`flex items-center gap-1.5`,children:[(0,R.jsx)(`kbd`,{className:`shortcut-key`,children:`Esc`}),` Close`]})]})})]})}):null}function MF(e){return e.map(e=>P.literal(e))}var NF=P.union(...MF(Ob)),PF=P.union(...MF([`spikonado`,`openai`,`chatgpt`]));P.string(),P.union(P.literal(`monthly`),P.literal(`annual`)),P.union(P.literal(`test`),P.literal(`live`)),P.union(P.literal(`active`),P.literal(`on_hold`),P.literal(`cancelled`),P.literal(`expired`),P.literal(`failed`)),P.union(P.literal(`awaiting_payment`),P.literal(`pending`),P.literal(`succeeded`),P.literal(`failed`),P.literal(`expired`),P.literal(`unknown`));var FF=P.object({path:P.string(),directory:P.string(),contents:P.string(),truncated:P.boolean()}),IF=P.object({patch:P.string()}),LF=P.object({cmd:P.string(),workdir:P.optional(P.string()),shell:P.optional(P.string()),timeoutMs:P.optional(P.number()),yieldTimeMs:P.optional(P.number()),maxOutputChars:P.optional(P.number())}),RF=P.object({url:P.string()}),zF=RF.pick(`url`),BF=P.object({query:P.string(),numResults:P.optional(P.number())}),VF=P.object({sessionId:P.string(),chars:P.optional(P.string()),terminate:P.optional(P.boolean()),yieldTimeMs:P.optional(P.number())}),HF=P.object({sessionId:P.string(),action:P.union(P.literal(`write`),P.literal(`terminate`)),chars:P.optional(P.string()),yieldTimeMs:P.optional(P.number())}),UF=VF.pick(`sessionId`,`yieldTimeMs`),WF=P.union(P.literal(`markdown`),P.literal(`html`),P.literal(`react`)),GF=P.union(P.literal(`thread`),P.literal(`project`)),KF=P.object({scope:P.optional(GF)}),qF=P.object({artifactId:P.string()}),JF=P.object({title:P.string(),contentType:WF,content:P.string()}),YF=P.object({artifactId:P.string(),content:P.string()}),XF=P.object({name:P.string()}),ZF=P.object({instruction:P.optional(P.string()),action:P.optional(P.object({selector:P.string(),description:P.string(),method:P.optional(P.string()),arguments:P.optional(P.array(P.string()))})),startUrl:P.optional(P.string())}),QF=P.object({command:P.string(),enforce_saving:P.optional(P.boolean())}),$F=P.union(...MF([`one_time`,`weekly`,`monthly`,`yearly`])),eI=P.union(P.literal(`listed`),P.literal(`any`)),tI=P.union(...MF([`pending`,`active`,`paused`,`consumed`,`cancelled`,`expired`]));P.union(P.literal(`awaiting_result`),P.literal(`completed`),P.literal(`declined`),P.literal(`failed`));var nI=P.union(P.literal(`approved`),P.literal(`declined`)),rI=P.object({userEmail:P.optional(P.string()),merchantName:P.optional(P.string()),merchantUrl:P.optional(P.string()),countryCode:P.optional(P.string()),amountCap:P.string(),currency:P.string(),frequency:$F,scope:eI,description:P.string(),maxCharges:P.optional(P.number()),validUntil:P.optional(P.string())}),iI=P.object({mandateId:P.string()}),aI=P.object({mandateId:P.string(),amount:P.string(),currency:P.string(),description:P.string(),reference:P.optional(P.string())}),oI=P.object({chargeId:P.string(),outcome:nI,amountPaid:P.optional(P.string())}),sI=P.object({id:P.string(),label:P.string()}),cI=P.object({question:P.string(),options:P.array(sI),yieldTimeMs:P.optional(P.number()),timeoutMs:P.optional(P.union(P.number(),P.null()))}),lI=P.object({questionId:P.id(`agentQuestions`),yieldTimeMs:P.optional(P.number())}),uI=P.union(P.object({path:P.string()}),P.object({url:P.string()})),dI=P.object({threadId:P.optional(P.id(`threadRecords`)),prompt:P.string(),model:P.optional(P.string()),reasoning:P.optional(P.string()),fast:P.optional(P.boolean()),yieldTimeMs:P.optional(P.number()),timeoutMs:P.optional(P.number())}),fI=dI.partial().extend({threadId:P.id(`threadRecords`),action:P.union(P.literal(`send`),P.literal(`stop`),P.literal(`answer_question`)),questionId:P.optional(P.id(`agentQuestions`)),optionId:P.optional(P.string()),text:P.optional(P.string())}),pI=P.object({threadId:P.id(`threadRecords`),cursor:P.optional(P.string()),yieldTimeMs:P.optional(P.number())}),mI=P.object({parentThreadId:P.optional(P.id(`threadRecords`)),cursor:P.optional(P.string())}),hI=P.union(P.object({}),uI,dI,fI,pI,mI,IF,cI,lI,LF,XF,RF,zF,BF,VF,HF,UF,KF,qF,JF,YF,rI,iI,aI,oI);P.union(hI,ZF,QF);var gI=P.object({changes:P.array(P.object({path:P.string(),source:P.optional(P.string()),operation:P.union(P.literal(`created`),P.literal(`updated`),P.literal(`deleted`),P.literal(`renamed`),P.literal(`copied`))}))}),_I=P.object({command:P.string(),cwd:P.string(),output:P.string(),sessionId:P.optional(P.string()),exitCode:P.optional(P.number()),success:P.boolean(),running:P.boolean(),timedOut:P.boolean(),truncated:P.boolean(),error:P.optional(P.string())}),vI=P.object({output:P.string(),exitCode:P.optional(P.number()),success:P.boolean(),running:P.boolean(),timedOut:P.boolean(),completeLogPath:P.string(),eventsPath:P.string(),error:P.optional(P.string())}),yI=vI.extend({sessionId:P.optional(P.string())}),bI=vI.extend({command:P.string(),workdir:P.string()}),xI=P.object({url:P.string(),markdown:P.string(),truncated:P.optional(P.boolean()),summary:P.optional(P.string()),images:P.optional(P.array(P.string()))});P.union(P.object({url:P.string(),markdown:P.string(),summary:P.string(),images:P.array(P.string())}),P.object({url:P.string(),summary:P.string(),scrapeUrl:P.string()})),P.object({url:P.string(),screenshotUrl:P.string()});var SI=P.object({outputType:P.literal(`image`),url:P.string(),path:P.string(),mediaType:P.string(),byteSize:P.number(),width:P.number(),height:P.number()}),CI=P.object({results:P.array(P.object({title:P.optional(P.string()),url:P.string(),publishedDate:P.optional(P.string()),author:P.optional(P.string()),text:P.optional(P.string())}))}),wI=P.object({mandateId:P.id(`mandates`),approvalUrl:P.string(),expiresAt:P.string()}),TI=P.object({mandateId:P.id(`mandates`),pravaMandateId:P.optional(P.string()),status:tI,description:P.optional(P.string()),merchantName:P.optional(P.string()),amountCap:P.string(),remaining:P.optional(P.string()),currency:P.string(),frequency:$F,scope:eI,approvalUrl:P.optional(P.string()),validUntil:P.optional(P.string()),renewsAt:P.optional(P.string())}),EI=P.object({mandates:P.array(P.object({mandateId:P.optional(P.id(`mandates`)),pravaMandateId:P.string(),status:P.string(),description:P.optional(P.string()),merchantName:P.optional(P.string()),approvedAmount:P.string(),remaining:P.optional(P.string()),currency:P.string(),validUntil:P.optional(P.string()),renewsAt:P.optional(P.string())}))}),DI=P.object({chargeId:P.id(`mandateCharges`),transactionId:P.string(),token:P.optional(P.string()),dynamicCvv:P.optional(P.string()),expiryMonth:P.optional(P.string()),expiryYear:P.optional(P.string())}),OI=P.object({reported:P.boolean(),alreadyReported:P.optional(P.boolean()),inFlight:P.optional(P.boolean())}),kI=P.object({text:P.string(),truncated:P.boolean()}),AI=P.object({mediaType:P.literal(`image/png`),dataBase64:P.string(),byteLength:P.number(),truncated:P.boolean(),url:P.optional(P.string())}),jI=SI.omit(`url`).extend({mediaType:P.literal(`image/png`)}),MI=P.object({selector:P.string(),description:P.string(),method:P.optional(P.string()),arguments:P.optional(P.array(P.string()))}),NI=P.object({actions:P.array(MI),text:P.string(),truncated:P.boolean()}),PI=P.object({name:P.string(),description:P.string(),content:P.string(),dir:P.optional(P.string()),truncated:P.optional(P.boolean())}),FI=P.object({optionId:P.optional(P.string()),optionLabel:P.optional(P.string()),text:P.optional(P.string())}),II=P.object({pending:P.boolean(),timedOut:P.boolean(),answer:P.optional(FI)}),LI=II.extend({questionId:P.id(`agentQuestions`),question:P.optional(P.string()),options:P.optional(P.array(sI))}),RI=P.union(P.literal(`queued`),P.literal(`running`),P.literal(`completed`),P.literal(`failed`),P.literal(`cancelled`));P.object({queued:P.number(),running:P.number(),completed:P.number(),failed:P.number(),cancelled:P.number()});var zI=P.object({model:P.string(),reasoning:NF,fast:P.boolean(),completionProvider:PF}),BI=P.object({questionId:P.id(`agentQuestions`),question:P.string(),options:P.array(sI)}),VI=P.union(P.object({type:P.literal(`prompt`),id:P.string(),text:P.string()}),P.object({type:P.literal(`text`),id:P.string(),text:P.string()}),P.object({type:P.literal(`patch`),id:P.string(),ok:P.boolean(),changes:P.array(P.object({operation:P.string(),path:P.string(),sourcePath:P.optional(P.string())}))})),HI=P.object({status:RI,lastError:P.optional(P.union(P.string(),P.null())),pendingQuestions:P.array(BI)}),UI=HI.extend({entries:P.array(VI),nextCursor:P.string(),hasMore:P.boolean()}),WI={threadId:P.id(`threadRecords`),settings:zI},GI=P.union(HI.extend(WI),UI.extend(WI)),KI={answer:P.optional(FI),alreadyAnswered:P.optional(P.literal(!0))},qI=P.union(GI,HI.extend(KI),UI.extend(KI)),JI=P.object({children:P.array(P.object({threadId:P.id(`threadRecords`),parentThreadId:P.id(`threadRecords`),title:P.optional(P.union(P.string(),P.null())),status:RI,lastError:P.optional(P.union(P.string(),P.null())),settings:zI})),nextCursor:P.union(P.string(),P.null()),hasMore:P.boolean()}),YI=P.object({defaultModelId:P.string(),defaultFast:P.boolean(),models:P.array(P.object({id:P.string(),label:P.string(),reasoningEfforts:P.array(P.string()),defaultReasoningEffort:P.string(),serviceTiers:P.array(P.string()),supportsImages:P.boolean()}))}),XI=P.object({artifactId:P.string(),revision:P.optional(P.number()),scope:P.optional(GF),title:P.optional(P.string()),contentType:P.optional(WF),version:P.optional(P.number())}),ZI=P.object({artifacts:P.array(P.object({artifactId:P.string(),scope:P.optional(GF),repositoryKey:P.string(),threadId:P.optional(P.id(`threadRecords`)),type:WF,title:P.string(),revision:P.number(),createdAt:P.number(),updatedAt:P.number()}))}),QI=P.union(P.object({type:P.literal(`path`),path:P.string()}),P.object({type:P.literal(`url`),url:P.string()})),$I=P.union(P.object({outputType:P.literal(`image`),mediaType:P.string(),path:P.string(),source:QI,byteSize:P.number(),width:P.number(),height:P.number()}),P.object({outputType:P.literal(`text`),path:P.string(),source:QI,format:P.string(),charCount:P.number(),preview:P.string(),truncated:P.boolean()}));P.union(P.string(),$I,P.array(FF),gI,LI,II,GI,qI,UI,JI,YI,yI,bI,_I,PI,xI,SI,CI,XI,ZI,kI,AI,jI,NI,wI,TI,EI,DI,OI);var eL=[`cancelled`,`completed`,`failed`];P.union(...MF(eL));function tL(e){return eL.some(t=>t===e)}var nL=P.union(P.literal(`apply_patch`),P.literal(`ask_question`),P.literal(`poll_question`),P.literal(`await_question`),P.literal(`exec_cmd`),P.literal(`exec_command`),P.literal(`get_workspace_instructions`),P.literal(`mandate_setup`),P.literal(`mandate_status`),P.literal(`mandate_list`),P.literal(`mandate_charge`),P.literal(`mandate_report`),P.literal(`read_skill`),P.literal(`parse_file`),P.literal(`scrape_url`),P.literal(`screenshot_url`),P.literal(`web_search`),P.literal(`write_stdin`),P.literal(`control_cmd`),P.literal(`control_command`),P.literal(`poll_cmd`),P.literal(`poll_command`),P.literal(`add_artifact`),P.literal(`list_artifacts`),P.literal(`list_subagent_models`),P.literal(`list_subagents`),P.literal(`edit_artifact`),P.literal(`delete_artifact`),P.literal(`save_artifact`),P.literal(`spawn_subagent`),P.literal(`control_subagent`),P.literal(`poll_subagent`)),rL=P.union(nL,P.literal(`browser_interact`),P.literal(`browser_screenshot`),P.literal(`browser_observe`),P.literal(`browser_act`),P.literal(`browser_extract`));P.union(rL,P.literal(`create_artifact`),P.literal(`update_artifact`)),P.union(P.literal(`pending`),P.literal(`answered`),P.literal(`timedOut`),P.literal(`cancelled`)),P.union(P.literal(`pending`),P.literal(`claimed`),P.literal(`completed`),P.literal(`failed`),P.literal(`cancelled`));var iL=P.optional(P.union(P.number(),P.null())),aL=P.object({type:P.literal(`text`),id:P.string(),text:P.string(),startedAt:iL,completedAt:iL,turnId:P.optional(P.string()),providerMetadata:P.optional(iC)}),oL=P.object({type:P.literal(`reasoning`),id:P.string(),text:P.string(),startedAt:iL,completedAt:iL,turnId:P.optional(P.string()),providerMetadata:P.optional(iC)}),sL=P.object({type:P.literal(`tool-call`),partId:P.optional(P.string()),callId:P.string(),name:P.string(),input:iC,turnId:P.optional(P.string()),startedAt:iL,completedAt:iL,providerMetadata:P.optional(iC)}),cL=P.union(...MF([`cancelled`,`failed`]));P.object({error:P.string(),status:cL});var lL=P.object({type:P.literal(`tool-result`),callId:P.string(),name:P.optional(P.string()),completedAt:iL,output:iC});P.union(aL,oL,sL,lL),P.union(P.literal(`prompt`),P.literal(`completion`),P.literal(`tool`));var uL=P.object({imageUploadId:P.optional(P.id(`imageUploads`)),name:P.string(),mediaType:P.string(),size:P.number(),storageId:P.id(`_storage`),url:P.optional(P.string())}),dL=P.union(aL,oL,sL);P.object({text:P.string(),imageUploads:P.array(uL)}),P.object({streamId:P.optional(P.string()),items:P.array(dL)});var fL=P.union(P.literal(`started`),P.literal(`completed`),P.literal(`failed`),P.literal(`cancelled`));P.object({jobId:P.optional(P.id(`executorJobs`)),toolInvocationId:P.optional(P.string()),callId:P.string(),name:P.string(),input:P.optional(iC),output:P.optional(iC),status:fL});var pL=P.union(P.literal(`system`),P.literal(`user`),P.literal(`assistant`)),mL=P.union(P.object({type:P.literal(`text`),text:P.string()}),P.object({type:P.literal(`image`),imageJson:P.string()})),hL=P.union(P.object({type:P.literal(`text`),text:P.string(),additionalParamsJson:P.optional(P.string())}),P.object({type:P.literal(`reasoning`),id:P.optional(P.string()),blocksJson:P.string()}),P.object({type:P.literal(`toolCall`),id:P.string(),callId:P.optional(P.string()),name:P.string(),argumentsJson:P.string(),signature:P.optional(P.string()),additionalParamsJson:P.optional(P.string())}),P.object({type:P.literal(`toolResult`),id:P.string(),callId:P.optional(P.string()),items:P.array(mL)}),P.object({type:P.literal(`image`),imageJson:P.string()}),P.object({type:P.literal(`audio`),audioJson:P.string()}),P.object({type:P.literal(`video`),videoJson:P.string()}),P.object({type:P.literal(`document`),documentJson:P.string()}));P.object({role:pL,assistantId:P.optional(P.string()),contents:P.array(hL)});function gL(e,t){return(t.lastMessageSentAt??0)-(e.lastMessageSentAt??0)||t.lastUsedAt-e.lastUsedAt||(e.workspacePath<t.workspacePath?-1:+(e.workspacePath>t.workspacePath))}function _L(e){return{repositoryKey:e.repositoryKey,displayName:e.displayName,workspacePath:e.workspacePath,localAttachmentAvailability:e.availability,localAttachmentError:e.unavailableReason}}function vL(e){let t=e.recoveredSubmission,n=e.latestRun;return(n===null||n.runId!==void 0&&n.runId===t?.continuationOfRunId||n.submissionId===t?.submissionId&&!tL(n.status))&&t?.prompt===e.prompt&&t.selectedModel===e.selectedModel&&t.reasoningEffort===e.reasoningEffort&&t.fastMode===e.fastMode&&(t.completionProvider??`spikonado`)===(e.completionProvider??`spikonado`)&&t.continuationOfRunId===e.continuationOfRunId&&hx(t.storageIds,e.storageIds)?t.submissionId:e.newSubmissionId}function yL(e,t){return e===`cancelled`?`cancelled`:e===`failed`?t===`The local agent stopped responding before this run finished.`?`crash`:`failed`:null}function bL(e){let t={userId:e.userId,prompt:e.prompt,storageIds:e.storageIds,selectedModel:e.selectedModel,reasoningEffort:e.reasoningEffort,fastMode:e.fastMode,submissionId:e.submissionId,workspacePath:e.workspacePath};return e.completionProvider&&(t.completionProvider=e.completionProvider),e.threadId&&(t.threadId=e.threadId),e.repositoryKey&&(t.repositoryKey=e.repositoryKey),e.continuationOfRunId&&(t.continuationOfRunId=e.continuationOfRunId),e.desktopApi.runAgent(t).then(({runId:t,threadId:n})=>{e.onStarted(t,n)}).catch(t=>{let n=t instanceof Error?t:Error(String(t));console.error(`Failed to run agent`,n),e.onError(n)})}function xL(e,t){return e.availability===t.availability?e.lastUsedAt===t.lastUsedAt?e.workspacePath<t.workspacePath:e.lastUsedAt<t.lastUsedAt:e.availability===`available`}function SL(e){let t=new Map;for(let n of e){let e=n.attachmentKey,r=t.get(e);(!r||xL(n,r))&&t.set(e,n)}return Object.fromEntries([...t.values()].map(e=>[e.workspacePath,e]))}function CL(e,t){let n=e[t.workspacePath];return n?.availability===`available`&&n.repositoryKey===t.repositoryKey?n:Object.values(e).find(e=>e.availability===`available`&&e.repositoryKey===t.repositoryKey)}function wL(e,t,n){let r=Object.fromEntries(Object.entries(e).filter(([e,r])=>e!==n&&e!==t.workspacePath&&r.attachmentKey!==t.attachmentKey));return r[t.workspacePath]=t,r}async function TL(e){return e?SL(await e.listProjectAttachments()):{}}async function EL(e){let t={workspacePath:e.workspacePath};return e.replaceWorkspacePath&&(t.replaceWorkspacePath=e.replaceWorkspacePath),await e.desktopApi.attachProject(t)}async function DL(e){if(e.desktopApi)try{let t=(await e.desktopApi.listProjectAttachments()).find(t=>t.workspacePath===e.workspacePath);if(!t||t.availability!==`available`)throw Error(t?.unavailableReason??`Workspace path is unavailable.`);await e.refreshDesktopProjectAttachments()}catch(t){throw await e.refreshDesktopProjectAttachments(),t}}var OL=class{dependencies;items=[];#e=new Set;constructor(e){this.dependencies=e}getSnapshot=()=>this.items;subscribe=e=>(this.#e.add(e),()=>{this.#e.delete(e)});add(e){for(let t of e){let e=crypto.randomUUID(),n=yx(t),r=vx(t.type);this.#t([...this.items,{localId:e,name:n,mediaType:r,size:t.size,previewUrl:_x(r)?URL.createObjectURL(t):void 0,status:`uploading`}]),this.#i(e,t,n)}}remove(e){let t=this.items.find(t=>t.localId===e);if(t&&(xx(t.previewUrl),this.#t(this.items.filter(t=>t.localId!==e)),t.storageId)){let{userId:e,threadId:n}=this.dependencies.getContext();this.#r({storageId:t.storageId,userId:e,threadId:n})}}clear(e){let t=this.dependencies.getContext(),n=e.userId===void 0?t.userId:e.userId,r=e.threadId===void 0?t.threadId:e.threadId;for(let t of this.items)xx(t.previewUrl),e.discard&&t.storageId&&this.#r({userId:n,threadId:r,storageId:t.storageId});this.#t([])}replace(e){this.#t(e.map(e=>({...e})))}snapshot(){return this.items.map(e=>({...e}))}#t(e){this.items=e;for(let e of this.#e)e()}#n(e,t){return this.items.some(t=>t.localId===e)?(this.#t(this.items.map(n=>n.localId===e?{...n,...t}:n)),!0):!1}#r(e){try{let t=this.dependencies.getContext(),n=e.api??t.api,r=e.userId??t.userId;if(!n||!r)return;n.discardTranscriptAttachment({userId:r,storageId:e.storageId,threadId:e.threadId??void 0}).catch(()=>{})}catch{return}}async#i(e,t,n){let{api:r,userId:i,threadId:a}=this.dependencies.getContext();try{if(!r)throw Error(this.dependencies.localServerRequiredMessage);if(!i)throw Error(`Sign in to attach files.`);let o=await r.uploadTranscriptAttachment({userId:i,name:n,file:t,threadId:a??void 0});if(`error`in o)throw Error(o.error);xx(this.items.find(t=>t.localId===e)?.previewUrl),this.#n(e,{status:`ready`,storageId:o.storageId,name:o.name,mediaType:o.mediaType,size:o.size,previewUrl:_x(o.mediaType)?o.url:void 0})||this.#r({api:r,userId:i,threadId:a,storageId:o.storageId})}catch(t){let n=t instanceof Error?t.message:`Upload failed.`;this.#n(e,{status:`error`,error:n}),this.dependencies.onError(n)}}};function kL(e){let t=(0,F.useRef)(e);(0,F.useLayoutEffect)(()=>{t.current=e},[e]);let[n]=(0,F.useState)(()=>new OL({getContext:()=>t.current.context,onError:e=>t.current.onError(e),localServerRequiredMessage:e.localServerRequiredMessage}));return Wm(n),n}var AL=P.union(P.literal(`idle`),P.literal(`queued`),P.literal(`running`),P.literal(`waiting_for_input`),P.literal(`cancellation_requested`),P.literal(`completed`),P.literal(`failed`),P.literal(`cancelled`)),jL=P.object({runId:P.id(`runs`),startedAt:P.number(),completedAt:P.optional(P.number()),lastError:P.optional(P.string()),executorFriendlyName:P.optional(P.string())});P.object({threadId:P.id(`threadRecords`),phase:AL,run:P.union(jL,P.null())});var ML=new Set([`queued`,`running`,`waiting_for_input`,`cancellation_requested`]);function NL(e){return ML.has(e)}function PL(e){return{threadId:e.threadId,repositoryKey:e.repositoryKey,title:e.title,selectedModel:e.selectedModel,completionProvider:e.completionProvider,reasoningEffort:e.reasoningEffort,fastMode:e.fastMode,lastMessageAt:e.lastMessageAt,threadStatus:e.threadStatus,status:e.status}}function FL(e){return PL({threadId:e._id,repositoryKey:e.repositoryKey,title:e.title??`New thread`,selectedModel:e.selectedModel,completionProvider:e.completionProvider,reasoningEffort:e.reasoningEffort,fastMode:e.fastMode??!1,lastMessageAt:e.lastMessageAt,threadStatus:e.archivedAt===void 0?`active`:`archived`,status:e.status??`completed`})}function IL(e,t){return t?e.find(e=>e.repositoryKey===t)??null:null}function LL(e,t){return t?e.find(e=>e.workspacePath===t)??null:null}function RL(e){return e.threadStatus!==`archived`}function zL(e,t){return t?e.find(e=>e.threadId===t)??null:null}function BL(e){return e.hasResolvedInitialSelection||!e.initialProjectLaunchResolved||e.hasPendingProjectLaunches||e.projectLaunchInFlight||!e.hasLoadedProjects||!e.signedInUserId?null:{workspacePath:e.projects[0]?.workspacePath??null}}function VL(e,t){return t&&(e?.threadId??e?._id)===t?e:null}function HL(e){let{pendingCreatedThreadId:t,threads:n}=e;return!t||zL(n,t)?null:t}function UL(e){return!e.threadId||e.threadId===e.pendingCreatedThreadId||e.hasLatestRunData}function WL(e,t){return!!(t&&e[t])}function GL(e,t,n){return{...e,[t]:n}}function KL(e,t,n){let r=e[t];if(!r||n!==void 0&&r.launchId!==n)return e;let i={...e};return delete i[t],i}function qL(e,t,n,r){return!!(t&&(t!==e.previousRunId||n!=null&&n!==e.previousClaimExpiresAt||r!=null&&r!==e.previousStartedAt))}function JL(e,t,n,r,i){let a=e[t];return!a||!qL(a,n,r,i)?e:KL(e,t,a.launchId)}function YL(e){let{threads:t,currentThreadId:n,currentWorkspacePath:r,draftWorkspacePath:i}=e;return r&&i===r?null:n||(t[0]?.threadId??null)}var XL=10;function ZL(e){return[...new Set(e)].sort()}function QL(e,t){let n=t({query:Jp.inbox.list,args:e.enabled&&e.sectionOpen&&e.repositoryKeys.length>0?{state:e.state,repositoryKeys:e.repositoryKeys}:`skip`,initialNumItems:XL});return{state:e.state,rows:n.data??[],loading:n.isLoading,canLoadMore:n.canLoadMore,error:n.error?.message,loadMore:()=>n.loadMore(XL)}}function $L(e,t=rr){let n={enabled:e.enabled,repositoryKeys:ZL(e.repositoryKeys)};return{sections:[QL({state:`unsettled`,sectionOpen:!0,...n},t),QL({state:`settled`,sectionOpen:e.settledOpen,...n},t)]}}function eR(e,t,n){let r=e&&t.includes(e.repositoryKey)?e:null,i={rows:[],loading:!1,canLoadMore:!1,loadMore:()=>{}},a=r?.archivedAt===void 0?`unsettled`:`settled`;return tS(r?._id??null,n.find(e=>e.state===a)??i),r}function tR(e){return`${e.runId}:${e.streamId}`}function nR(e,t){let n=new Set(t.map(e=>e.runId));return e.filter(e=>!e.provisional||!n.has(e.runId))}var rR=class{fetchPage;changed;messages=[];nextBefore;loading=!0;loadingOlder=!1;windowVersion=0;stale=!1;error=null;stopped=!1;refreshing=!1;refreshPending=!1;olderPending=!1;retry;rows=new Map;persistedStreams=new Set;checkedStreams=new Set;overlays=[];revision=0;replicaId;changesCursor;constructor(e,t){this.fetchPage=e,this.changed=t}stop(){this.stopped=!0,clearTimeout(this.retry)}retryRefresh(e){clearTimeout(this.retry),this.retry=setTimeout(()=>{this.retry=void 0,this.refresh()},e)}retryOlder(e){this.olderPending=!0,this.retryRefresh(e)}unpersisted(e){return e.filter(e=>!this.persistedStreams.has(tR(e)))}visibleOverlays(e){return this.unpersisted(e).filter(e=>this.checkedStreams.has(tR(e)))}setOverlays(e){let t=new Set(this.overlays.map(tR));this.overlays=e;let n=new Set(e.map(tR));for(let e of this.checkedStreams)n.has(e)||this.checkedStreams.delete(e);e.some(e=>!t.has(tR(e)))&&this.refresh()}streamRequest(){let e=new Map;for(let t of this.unpersisted(this.overlays))if(e.set(tR(t),{runId:t.runId,streamId:t.streamId}),e.size===64)break;let t=[...e.values()];return t.length?{streams:t}:{}}async refresh(){if(this.stopped)return;if(this.refreshing){this.refreshPending=!0;return}this.refreshing=!0;let e=!1;clearTimeout(this.retry);try{do{this.refreshPending=!1;let t=this.streamRequest(),n=await this.fetchPage({limit:12,changesAfter:this.changesCursor,...t});if(this.stopped)return;if(this.replicaId!==n.replicaId&&(this.replicaId!==void 0&&(this.windowVersion+=1),this.rows.clear(),this.messages=[],this.persistedStreams.clear(),this.checkedStreams.clear(),this.changesCursor=void 0,this.nextBefore=void 0,this.revision=0,this.replicaId=n.replicaId,this.loading=!0,this.changed()),n.indexing){this.stale=n.stale,this.changed(),this.retryRefresh(500);break}if(n.stale?this.retryRefresh(2e3):(clearTimeout(this.retry),this.retry=void 0),n.revision<this.revision){this.stale=n.stale,this.retryRefresh(500),this.changed();break}let r=n.nextBefore??0,i=this.messages.at(-1)?.sequence;i!==void 0&&i<r&&(this.rows.clear(),this.windowVersion+=1);let a=this.messages[0]?.sequence,o=a!==void 0&&n.changes.some(e=>e.row!==null&&e.row.sequence<a&&!this.messages.some(t=>t.id===e.id));!this.rows.size||r===0||r<=(a??0)?this.nextBefore=n.nextBefore:this.nextBefore===void 0&&o&&(this.nextBefore=a);for(let e of this.rows.keys())e>=r&&this.rows.delete(e);this.commit(n);for(let e of t.streams??[])this.checkedStreams.add(tR(e));this.changesCursor=n.changesCursor,this.refreshPending||=n.moreChanges,this.refreshPending||=n.persistedStreams.length>0&&this.unpersisted(this.overlays).some(e=>!this.checkedStreams.has(tR(e))),e=!0,this.loading=!1,this.error=null,this.changed()}while(this.refreshPending&&!this.stopped)}catch{this.stopped||(this.stale=!0,this.loading=!1,this.error=this.messages.length?null:`Could not load conversation history.`,this.changed(),this.retryRefresh(2e3))}finally{this.refreshing=!1,e&&this.olderPending&&!this.stopped&&(this.olderPending=!1,this.loadOlder())}}async loadOlder(){if(this.stopped||this.loadingOlder)return;if(this.refreshing){this.olderPending=!0;return}if(this.nextBefore===void 0)return;let e=this.nextBefore,t=this.windowVersion;this.loadingOlder=!0,this.changed();try{let n=await this.fetchPage({before:e,limit:40,...this.streamRequest()});if(this.stopped||t!==this.windowVersion)return;if(this.replicaId!==n.replicaId){this.refresh();return}if(n.indexing){this.retryOlder(500);return}if(n.revision<this.revision){this.retryOlder(500);return}if(n.persistedStreams.some(e=>!this.persistedStreams.has(tR(e)))){this.olderPending=!0,this.refresh();return}if(n.nextBefore!==void 0&&n.nextBefore>=e)throw Error(`History cursor did not advance.`);if(this.nextBefore!==e){this.nextBefore!==void 0&&this.retryOlder(500);return}this.commit(n),this.nextBefore=n.nextBefore,n.stale&&this.retryRefresh(2e3)}catch{!this.stopped&&t===this.windowVersion&&(this.stale=!0,this.retryOlder(2e3))}finally{this.loadingOlder=!1,this.stopped||this.changed()}}commit(e){let t=new Map(this.messages.map(e=>[e.id,e])),n=this.rows.size?this.messages[0]?.sequence:void 0;for(let r of e.changes){let e=t.get(r.id);if(!e){r.row&&n!==void 0&&r.row.sequence>=n&&this.rows.set(r.row.sequence,r.row);continue}r.row?r.row.revision>e.revision&&this.rows.set(r.row.sequence,r.row):this.rows.delete(e.sequence)}for(let n of e.rows){let e=this.rows.get(n.sequence)??t.get(n.id);this.rows.set(n.sequence,e&&e.revision>=n.revision?e:n)}let r=[...this.rows.entries()].sort(([e],[t])=>e-t).map(([,e])=>e);(r.length!==this.messages.length||r.some((e,t)=>e!==this.messages[t]))&&(this.messages=r),this.stale=e.stale,this.revision=Math.max(this.revision,e.revision);for(let t of e.persistedStreams)this.persistedStreams.add(`${t.runId}:${t.streamId}`);for(;this.persistedStreams.size>256;){let e=this.persistedStreams.values().next().value;if(e===void 0)break;this.persistedStreams.delete(e)}}};function iR(e){return e.type===`tool-call`||e.type===`tool-result`?`${e.type}:${e.callId}`:`${e.type}:${e.turnId??``}:${e.id}`}function aR(e){let t=new Map;for(let n of e){let e=t.get(n.runId)?.parts??new Map;for(let t of n.parts)e.set(iR(t),t);t.set(n.runId,{live:n,parts:e})}return[...t.values()].map(({live:e,parts:t})=>{let n=[...t.values()];return{kind:`live`,id:`response:${e.runId}`,threadId:e.threadId,runId:e.runId,runStatus:e.runStatus,runStartedAt:e.runStartedAt,text:oC(n),parts:n}})}var oR=class{messages=[];nextBefore=null;windowVersion=0;stale=!1;threadId=null;loading=!1;error=null;loadingOlder=!1;liveCompletion=null;pendingCompletions=[];#e=0;#t=null;#n=null;#r=null;#i=0;#a=new Set;getSnapshot=()=>this.#i;subscribe=e=>(this.#a.add(e),()=>{this.#a.delete(e)});get overlays(){return[...this.pendingCompletions,...this.liveCompletion?[this.liveCompletion]:[]]}selectThread(e){this.#e+=1,this.#n?.abort(),this.#n=null,this.#r?.abort(),this.#r=null,this.#t?.stop(),this.#t=null,this.loadingOlder=!1,this.threadId=e,this.liveCompletion=null,this.pendingCompletions=[],this.error=null,this.messages=[],this.nextBefore=null,this.windowVersion=0,this.stale=!1,this.loading=e!==null,this.#o()}watchDisplay({api:e,userId:t,threadId:n,isCurrent:r}){let i=new AbortController;this.#n=i;let a=this.#e,o=new rR(r=>e.fetchTranscriptDisplay({userId:t,threadId:n,...r},i.signal),()=>{if(i.signal.aborted||a!==this.#e)return;this.messages=o.messages,this.nextBefore=o.nextBefore??null,this.windowVersion=o.windowVersion,this.stale=o.stale,this.loading=o.loading,this.loadingOlder=o.loadingOlder,this.error=o.error;let e=this.pendingCompletions.length;this.pendingCompletions=o.unpersisted(this.overlays).filter(e=>e!==this.liveCompletion),this.pendingCompletions.length>0&&this.pendingCompletions.length<e&&o.refresh(),this.#o()});return this.#t=o,o.refresh(),this.#s(e,t,n,o,i,r),()=>{i.abort(),o.stop(),this.#n===i&&(this.#n=null),this.#t===o&&(this.#t=null)}}watchLiveCompletion({api:e,userId:t,threadId:n,isCurrent:r}){let i=new AbortController;return this.#r=i,this.#c(e,t,n,i,r),()=>{i.abort(),this.#r===i&&(this.#r=null)}}syncOverlays(e){this.#t?.setOverlays(e)}visibleMessages(e){if(!e.threadId||!e.userId||this.threadId!==e.threadId)return[];let t=this.#t?.visibleOverlays(this.overlays)??[],n=aR(t.filter(t=>t.threadId===e.threadId));return[...nR(this.messages,t),...n.map(t=>t.runId===e.run?.runId?{...t,runStartedAt:e.run.startedAt,runCompletedAt:e.run.completedAt}:t)]}async loadOlder(){await this.#t?.loadOlder()}#o(){this.#i+=1;for(let e of this.#a)e()}async#s(e,t,n,r,i,a){for(;!i.signal.aborted;){try{await e.watchTranscript({userId:t,threadId:n},{signal:i.signal,onEvent:e=>{!i.signal.aborted&&a()&&(this.stale=e.stale,this.#o(),r.refresh())}})}catch{i.signal.aborted||(this.stale=!0,this.#o())}i.signal.aborted||await new Promise(e=>setTimeout(e,1e3))}}async#c(e,t,n,r,i){for(;!r.signal.aborted;){try{await e.watchLiveCompletion({userId:t,threadId:n},{signal:r.signal,onEvent:e=>{if(r.signal.aborted||!i())return;let t=this.liveCompletion;t&&(e.eventType===`cleared`||e.live.streamId!==t.streamId)&&(this.#t?.unpersisted([t]).length&&(this.pendingCompletions=[...this.pendingCompletions,t]),this.#t?.refresh()),this.liveCompletion=e.eventType===`updated`?e.live:null,this.#o()}})}catch{if(r.signal.aborted)return}await cR(400,r.signal)}}};function sR(){let[e]=(0,F.useState)(()=>new oR);return Wm(e),e}function cR(e,t){return t.aborted?Promise.resolve():new Promise(n=>{let r=setTimeout(n,e);t.addEventListener(`abort`,()=>{clearTimeout(r),n()},{once:!0})})}function lR(e,t){let n=qn({query:e,args:t});return n.status===`error`?{data:void 0,error:n.error}:n.status===`pending`?{data:void 0,error:null}:{data:n.data,error:null}}var uR=`Connect to a running Sprocket server to use this project.`,dR=3e4;function fR(e){let t=oS(e.signedInUserId),{currentThreadId:n,onSettledOpenChange:r}=e,i=sS({currentThreadId:e.currentThreadId,enabled:e.mutationsEnabled,expansion:t}),a=i[0]??null,o=qn({query:Jp.threads.getByThreadId,args:e.mutationsEnabled&&a?{threadId:a}:`skip`}),s=eR(o.status===`success`?o.data:null,e.repositoryKeys,e.sections),c=(0,F.useRef)(null);(0,F.useEffect)(()=>{if(!s||s.archivedAt===void 0){c.current=null;return}c.current!==n&&(c.current=n,r(!0))},[s,n,r]);let l=(0,F.useCallback)(({threadId:e,renderRows:n})=>(0,R.jsx)(pR,{expansion:t,threadId:e,renderRows:n,selectedPath:i}),[t,i]);return(0,R.jsx)(vS,{...e,expansion:t,resolveChildren:l})}function pR({expansion:e,threadId:t,renderRows:n,selectedPath:r}){let i=nS(t),a=r.indexOf(t);return tS(a>=0?r[a+1]??null:null,i),(0,F.useEffect)(()=>{e.registerChildren(t,i.rows)},[e,t,i.rows]),(0,R.jsxs)(R.Fragment,{children:[n(i.rows),(0,R.jsx)(pS,{section:i})]})}var mR={resolveDesktopApi:Vm,fetchGatewayModelCatalog:rx};function hR(e,t){return e?`thread:${e}`:t?`draft:${t}`:null}function gR(e,t){return`${e}\0${t}`}function _R({config:e,runtime:t=mR}){let n=(0,F.useRef)(e),r=(0,F.useRef)(t);r.current=t;let i=cr(),a=Gn(),o=Wm(Gm),s=Wm(Ym),c=Wm(Km),l=!!c,u=(0,F.useRef)(c),d=o.nativeSession===`loading`,f=o.nativeSession===`missing`||o.nativeSession===`mismatch`||o.nativeSession===`unavailable`,p=o.nativeSession===`missing`||o.nativeSession===`mismatch`,m=o.isReady&&!o.isLoading&&l&&(o.nativeSession===`notRequired`||o.nativeSession===`ready`)&&!i.isLoading&&i.isAuthenticated,h=l&&o.isReady&&!o.isLoading&&!s&&!i.isLoading&&!i.isAuthenticated||f,[g,_]=(0,F.useState)(!1);(0,F.useEffect)(()=>{let e=lg({retryPending:s,isAuthenticated:i.isAuthenticated,isLoading:i.isLoading,sawLoadingDuringRetry:g});g!==e.sawLoadingDuringRetry&&_(e.sawLoadingDuringRetry),e.clearPending&&Ym.set(!1)},[s,i.isAuthenticated,i.isLoading,g]);let v=Yn(Jp.providerCredentials.getMyConfiguration),y=Jn(Jp.artifacts.deleteArtifact),b=Jn(Jp.threads.rename),x=Jn(Jp.threads.settle),S=Jn(Jp.threads.unsettle),C=Jn(Jp.agentQuestions.answer),w=Jn(Jp.uiPreferences.setTheme),T=Jn(Jp.billing.ensureMySubscription),[E,D]=(0,F.useState)(void 0),[ee,O]=(0,F.useState)(null),[te,ne]=(0,F.useState)(!0),[re,ie]=(0,F.useState)(!1),[k,ae]=(0,F.useState)(!1),[A,oe]=(0,F.useState)(null),[se,ce]=(0,F.useState)(!1),[le,ue]=(0,F.useState)(null),[de,fe]=(0,F.useState)(!1),[pe,me]=(0,F.useState)(!1),[he,ge]=(0,F.useState)(null),_e=(0,F.useMemo)(()=>[`spikonado`,...re?[`openai`]:[],...k?[`chatgpt`]:[]],[re,k]);async function ve(){ne(!0);try{let e=n.current.env.PUBLIC_MODEL_GATEWAY_URL?.trim()??``;D(await r.current.fetchGatewayModelCatalog(e)),O(null)}catch{O(Jb),D(void 0)}finally{ne(!1)}}let ye=(0,F.useRef)(null),j=(0,F.useRef)(null),M=(0,F.useRef)(0);async function be(e){let t=M.current;fe(!0),me(!1),ge(null);try{let n=await v({});if(u.current!==e||t!==M.current)return;ie(n.openai),me(!0)}catch(n){if(u.current!==e||t!==M.current)return;ge(n instanceof Error&&OS(n)||`Couldn’t load provider settings.`)}finally{u.current===e&&t===M.current&&fe(!1)}}let xe=(0,F.useEffectEvent)(e=>{be(e)});(0,F.useEffect)(()=>{if(!m)return;let e=u.current;e&&ye.current!==e&&(ye.current=e,T({}).catch(()=>{}))},[m,c,T]),(0,F.useEffect)(()=>{if(!m)return;let e=u.current;e&&j.current!==e&&(j.current=e,xe(e))},[m,c]);let[N,Se]=(0,F.useState)(null),Ce=(0,F.useRef)(N),[we,Te]=(0,F.useState)(!1),Ee=(0,F.useRef)(null),De=(0,F.useRef)(0),Oe=(0,F.useEffectEvent)(e=>{kr(e)});(0,F.useEffect)(()=>{let e=c;if(!m||!e||!N){Ee.current=null,oe(null),ae(!1),ce(!1);return}if(Ee.current?.userId===e&&Ee.current.api===N)return;Ee.current={userId:e,api:N};let t=++De.current;return oe(null),ae(!1),ce(!0),ue(null),N.fetchChatGptStatus({userId:e}).then(n=>{t===De.current&&u.current===e&&Oe(n)}).catch(n=>{t===De.current&&u.current===e&&(oe(null),ae(!1),ue(n instanceof Error&&OS(n)||`Couldn’t load ChatGPT connection status.`))}).finally(()=>{t===De.current&&u.current===e&&ce(!1)}),()=>{De.current+=1,Ee.current=null}},[m,c,N]);let[ke,Ae]=(0,F.useState)(null),[je,Me]=(0,F.useState)(null),[Ne,Pe]=(0,F.useState)(null),[Fe,Ie]=(0,F.useState)(null),[Le,Re]=(0,F.useState)(kb),[ze,Be]=(0,F.useState)(`spikonado`),[Ve,He]=(0,F.useState)(Ab),[P,Ue]=(0,F.useState)(!1),[We,Ge]=(0,F.useState)(``),[Ke,qe]=(0,F.useState)(null),[Je,Ye]=(0,F.useState)(!1),[Xe,Ze]=(0,F.useState)(null),[Qe,$e]=(0,F.useState)(!1),[et,tt]=(0,F.useState)(null),[nt,rt]=(0,F.useState)({}),[it,at]=(0,F.useState)(!1),ot=(0,F.useRef)(0),[st,ct]=(0,F.useState)(null),[lt,ut]=(0,F.useState)({}),dt=(0,F.useRef)(lt),[ft,pt]=(0,F.useState)(!1),[mt,ht]=(0,F.useState)(null),[gt,_t]=(0,F.useState)(!1),[vt,yt]=(0,F.useState)(`add`),[bt,xt]=(0,F.useState)(void 0),[St,Ct]=(0,F.useState)(null),[wt,Tt]=(0,F.useState)(!1),[Et,Dt]=(0,F.useState)(`general`),[Ot,kt]=(0,F.useState)(!0),[At,jt]=(0,F.useState)(0),Mt=Ot||wt&&At>=768,[Nt,Pt]=(0,F.useState)([]),[Ft,It]=(0,F.useState)(!1),[Lt,Rt]=(0,F.useState)([]),[zt,Bt]=(0,F.useState)(!1),[Vt,Ht]=(0,F.useState)(null),Ut=(0,F.useRef)(new Map).current,Wt=(0,F.useRef)(new Map).current,Gt=(0,F.useRef)(new Map).current,Kt=(0,F.useRef)(new Map).current,qt=(0,F.useRef)(0),Jt=(0,F.useRef)(0),Yt=(0,F.useRef)(null),Xt=(0,F.useRef)(0),[Zt,Qt]=(0,F.useState)(!1),$t=(0,F.useRef)(void 0),[en,tn]=(0,F.useState)(null),nn=(0,F.useRef)(0),[rn,an]=(0,F.useState)(0),on=(0,F.useCallback)(()=>an(e=>e+1),[]),sn=(0,F.useCallback)((e,t)=>{Ut.get(e)===t&&(Ut.delete(e),on())},[on,Ut]),cn=(0,F.useCallback)((e,t,n)=>{Wt.set(gR(e,t),n),on()},[on,Wt]),ln=(0,F.useCallback)((e,t)=>{let n=gR(e,t);Wt.delete(n),Gt.delete(n),on()},[on,Wt,Gt]),un=kL({context:{api:N,userId:c,threadId:Ne},onError:tt,localServerRequiredMessage:uR}),dn=sR(),fn=vF(),pn=(0,F.useMemo)(()=>yF(a),[a]),mn=c&&i.isAuthenticated&&!i.isLoading?{}:`skip`,hn=lR(Jp.uiPreferences.getMine,mn),gn=Ne&&mn!==`skip`?{threadId:Ne}:`skip`,_n=lR(Jp.threads.getByThreadId,gn),vn=lR(Jp.chat.selectedThreadLifecycle,gn),yn={data:null,error:null},bn=lR(Jp.agentQuestions.headPendingForThread,gn),xn=hn.error??_n.error??vn.error??bn.error,[Sn,Cn]=(0,F.useState)(_b(null));(0,F.useEffect)(()=>{if(!m){$t.current=void 0,tn(null),nn.current+=1;return}let e=hn.data;if(e===void 0||en!==null||e===$t.current)return;$t.current=e;let t=_b(e?.theme);Cn(t),xb(t)},[m,hn.data,en]);async function wn(e){let t=Sn,n=++nn.current;tn(e),Cn(e),xb(e);try{await w({theme:e})}catch(e){if(n!==nn.current)return;Cn(t),xb(t),tt(e instanceof Error?e.message:`Failed to save theme preference.`)}finally{n===nn.current&&tn(null)}}let Tn=(0,F.useMemo)(()=>Object.values(lt).sort(gL),[lt]),En=(0,F.useMemo)(()=>Tn.map(_L),[Tn]),Dn=(0,F.useMemo)(()=>[...new Map(En.map(e=>[e.repositoryKey,e])).values()],[En]),On=(0,F.useMemo)(()=>Nt.length>0?Nt:Dn.map(e=>e.repositoryKey),[Nt,Dn]);(0,F.useEffect)(()=>{let e=new Set(Dn.map(e=>e.repositoryKey)),t=Nt.filter(t=>e.has(t));t.length!==Nt.length&&Pt(t)},[Dn,Nt]);let kn=$L({enabled:m,repositoryKeys:On,settledOpen:Ft}),An=VL(_n.data,Ne),jn=(0,F.useMemo)(()=>{let e=kn.sections.find(e=>e.state===`unsettled`)?.rows.map(FL)??[];return!An||e.some(e=>e.threadId===An._id)?e:[FL(An),...e]},[kn.sections,An]),Mn=VL(vn.data,Ne),Nn=Mn?.run??null,Pn=VL(bn.data,Ne);(0,F.useEffect)(()=>{let e=Ne;dn.threadId!==e&&dn.selectThread(e)},[Ne,dn]),(0,F.useEffect)(()=>{let e=Ne,t=N;if(!e||!t||!l)return;let n=u.current;if(n)return dn.watchDisplay({api:t,userId:n,threadId:e,isCurrent:()=>Fn.current===e})},[Ne,N,l,dn,c]),(0,F.useEffect)(()=>{let e=Ne,t=N;if(!e||!t||!l)return;let n=u.current;if(n)return dn.watchLiveCompletion({api:t,userId:n,threadId:e,isCurrent:()=>Fn.current===e})},[Ne,N,l,dn,c]);let Fn=(0,F.useRef)(Ne),In=(0,F.useRef)(ke),Ln=(0,F.useRef)(je),Rn=(0,F.useRef)(Fe);(0,F.useEffect)(()=>{dn.syncOverlays(dn.overlays)});let zn=dn.visibleMessages({threadId:Ne,userId:c,run:Nn}),Bn=(0,F.useMemo)(()=>ke?LL(En,ke):je?IL(En,je):null,[En,ke,je]),Vn=Bn?.workspacePath??ke,Hn=(0,F.useMemo)(()=>!Vn||!N?null:{workspacePath:Vn,search:(e,t)=>N.searchWorkspace({workspacePath:Vn,query:e},t)},[Vn,N]),Un=(0,F.useMemo)(()=>{let e=Bn?.workspacePath??null,t=N;return{workspacePath:e,load:async()=>{if(!t||!e)return[];let n=await t.listWorkspaceSkills({workspacePath:e});for(let e of n.warnings)console.warn(`sprocket skills: ${e}`);return n.skills}}},[Bn,N]),Wn=(0,F.useMemo)(()=>Bn?.repositoryKey?jn.filter(e=>e.repositoryKey===Bn.repositoryKey&&RL(e)).sort((e,t)=>t.lastMessageAt-e.lastMessageAt):[],[jn,Bn]),Kn=(0,F.useMemo)(()=>[],[]);(0,F.useEffect)(()=>{let e=c&&je?{userId:c,repositoryKey:je,workspacePath:ke??``}:null;fn.selectScope(e)},[fn,c,je,ke]),(0,F.useEffect)(()=>{let e=c&&je?{userId:c,repositoryKey:je,workspacePath:ke??``}:null;return fn.watch({localApi:N,artifactClient:pn,cloudReady:!i.isLoading&&i.isAuthenticated,scope:e})},[fn,c,je,ke,N,pn,i.isLoading,i.isAuthenticated]);let qn=je&&i.isAuthenticated&&!i.isLoading?async e=>{if(N&&c&&ke){await N.deleteArtifact({userId:c,repositoryKey:je,workspacePath:ke,artifactId:e});return}await y({artifactId:e,repositoryKey:je})}:void 0,Xn=hR(Ne,Vn),Zn=(()=>{let e=u.current;if(e&&Xn)return Gt.get(gR(e,Xn))})(),Qn=Mn?.phase===`queued`&&Zn!=null,$n=Mn!=null&&NL(Mn.phase)&&!Qn,er=Nn!=null&&($n&&Mn?.phase!==`cancellation_requested`||!$n&&Pn!=null),tr=WL(nt,Ne),nr=tr||$n?null:yL(Mn?.phase??`idle`,Mn?.run?.lastError),rr=UL({threadId:Ne,pendingCreatedThreadId:st,hasLatestRunData:!!Mn}),ir=!!(Xn&&Ut.has(Xn)),ar=(Ne&&dn.threadId===Ne?dn.error:null)??et??o.error??(xn?OS(xn):null),or=(nr===`failed`||nr===`crash`)&&!ir?Nn?.lastError??null:null,sr=!(!Vn||!Pn&&ze===`chatgpt`&&!k||Bn?.localAttachmentAvailability!==`available`||ir||Je||tr||($n||!rr)&&!Pn),lr=(0,F.useMemo)(()=>{let e=new Set,t=[];for(let n of Tn){if(n.availability!==`available`||e.has(n.workspacePath))continue;e.add(n.workspacePath);let r=n.workspacePath.split(/[/\\]/).filter(Boolean).at(-1)??n.workspacePath;t.push({workspacePath:n.workspacePath,displayName:r})}return t},[Tn]);function ur(e){dt.current=e,ut(e),pt(!0)}async function dr(e=Ce.current){let t=++Xt.current,n=In.current,r=ot.current,i=await TL(e);if(t!==Xt.current)return dt.current;if(ur(i),!n||r!==ot.current)return i;let a=i[n];if(!a&&e){let o=await e.resolveWorkspacePath({workspacePath:n});if(t!==Xt.current||r!==ot.current)return dt.current;a=CL(i,o)}if(!a)return i;let o=a.repositoryKey!==Ln.current;if(a.workspacePath!==n||o){let e=Rn.current===n;hr(),Ae(a.workspacePath),Me(a.repositoryKey),Ie(e?a.workspacePath:null),o&&(Pe(null),ct(null))}return i}async function fr(){let e=N,t=u.current;e&&t&&await e.endAccountSession({userId:t}).catch(()=>{}),await rg()}let pr=(0,F.useEffectEvent)((e,t)=>{e.startAccountSession({userId:t}).catch(n=>{Ce.current===e&&u.current===t&&tt(n instanceof Error?n.message:`Failed to register this Sprocket process.`)})});(0,F.useEffect)(()=>{N&&c&&m&&pr(N,c)},[N,c,m]);function mr(e,t=null,n=!1,r){let i=LL(En,e),a=r??i?.repositoryKey??null;Ae(e),Me(a),Pe(t),Ie(n?e:null),t!==st&&ct(null)}function hr(){return++ot.current}function gr(e,t=null,n=!1,r=!1,i){let a=hr();return r||tt(null),mr(e,t,n,i),a}async function _r(e,t,n=Ce.current){if(!n)throw Error(uR);let r=await EL({desktopApi:n,workspacePath:e,replaceWorkspacePath:t});return Xt.current+=1,ur(wL(dt.current,r,t)),r}function vr(e,t={}){let n=LL(En,e);if(!n){tt(`Choose a project first.`);return}let r=gr(e,t.threadId,t.draft);Er(n.workspacePath).catch(e=>{r===ot.current&&tt(e instanceof Error?e.message:`Failed to attach project.`)})}function yr(e=`add`,t=null){if(!N){tt(uR);return}yt(e),Ct(t);let n=e===`reconnect`&&t?LL(En,t):void 0;xt(n?.displayName),_t(!0),tt(null)}async function br(e){if(!N){tt(uR);return}let t=u.current;if(!t){tt(`User session is not ready.`);return}try{if(vt===`reconnect`&&St){await Sr(e,St,t);return}await xr(e,t)}catch(e){if(u.current!==t)return;throw tt(e instanceof Error?e.message:`Failed to attach project.`),e}}async function xr(e,t,n){await _r(e.workspacePath,void 0,n),u.current===t&&(gr(e.workspacePath,null,!0,!1,e.repositoryKey),tt(null))}async function Sr(e,t,n,r){let i=LL(En,t);if(await _r(e.workspacePath,t===e.workspacePath?void 0:t,r),u.current!==n)return;let a=i?.repositoryKey===e.repositoryKey?Fn.current:null;gr(e.workspacePath,a,!1,!1,e.repositoryKey),tt(null)}function Cr(e){let t=e?.trim();t&&Rt(e=>[...e,t])}async function wr(){let e=window.sprocketDesktopBridge;if(e?.takeWorkspaceLaunch)for(;;){let t=await e.takeWorkspaceLaunch();if(!t)return;Cr(t)}}async function Tr(e,t,n){let r=await t.resolveWorkspacePath({workspacePath:e});u.current===n&&await xr(r,n,t)}async function Er(e){await DL({desktopApi:N,refreshDesktopProjectAttachments:async()=>{await dr()},workspacePath:e})}function Dr(e){yr(`reconnect`,e)}function Or(e){M.current+=1,e.provider===`openai`&&ie(e.configured),me(!0),ge(null),!e.configured&&ze===e.provider&&Be(`spikonado`)}function kr(e){De.current+=1,ce(!1),oe(e),ue(e.error??null);let t=e.accounts.find(t=>t.connectionId===e.activeConnectionId)?.connected===!0;ae(t),!t&&ze===`chatgpt`&&Be(`spikonado`)}function Ar(e){vr(e,{draft:!0}),Mr()}function jr(){let e=LL(En,ke),t=(e?.localAttachmentAvailability===`available`?e:null)??En.find(e=>e.localAttachmentAvailability===`available`)??En[0];if(!t){yr(`add`);return}Ar(t.workspacePath),matchMedia(`(max-width: 767px)`).matches&&kt(!1)}async function Mr(){await Promise.resolve(),Vt?.querySelector(`textarea`)?.focus()}function Nr(e,t){vr(t,{threadId:e.threadId})}function Pr(e){let t=IL(En,e.repositoryKey);t&&(Nr(FL(e),t.workspacePath),matchMedia(`(max-width: 767px)`).matches&&kt(!1))}async function Fr(e,t){try{await b({threadId:e,title:t})}catch(e){throw tt(e instanceof Error?e.message:`Failed to rename thread.`),e}}async function Ir(){await dn.loadOlder()}async function Lr(e){let t=N,n=Ne,r=u.current;if(!t||!n||!r)return null;let i=await t.fetchTranscriptAttachment({userId:r,threadId:n,storageId:e});return i?URL.createObjectURL(i):null}async function Rr(e,t,n){let r=N,i=Ne,a=u.current;if(!r||!i||!a||e.threadId!==i)throw Error(`Thread is no longer selected.`);return await r.fetchTranscriptDisplayDetails({userId:a,threadId:i,rowId:e.id,...t},n)}async function zr(e,t){let n=u.current;try{let r={threadId:e._id};t===`settled`?await x(r):await S(r),u.current===n&&(t===`settled`&&Fn.current===e._id&&(Pe(null),Ie(In.current),hr()),tt(null))}catch(e){if(u.current!==n)return;throw tt(e instanceof Error?e.message:`Failed to update thread.`),e}}async function Br(){let e=Pn,t=Ne,n=u.current;if(!e||!t||!n||Je||!Ke&&!We.trim())return;Ye(!0),tt(null);let r=We,i=Ke,a=r.trim(),o=un.snapshot(),s=o.flatMap(e=>e.storageId?[e.storageId]:[]),c=Le,l=ze,d=Ve,f=P,p=null,m;Ge(``),qe(null);try{let n={threadId:t,questionId:e.questionId,optionId:i??void 0,text:a||void 0},r=await C(n);r.continuation&&(p=r.continuation.prompt,m=r.continuation.runId)}catch(a){u.current===n&&Fn.current===t&&Vr.current?.questionId===e.questionId&&(Ge(r),qe(i),tt(a instanceof Error?a.message:String(a)))}finally{u.current===n&&Ye(!1)}if(u.current===n){if(p!==null&&Fn.current!==t){cn(n,`thread:${t}`,{message:`Continuing from your answer when you return to this thread.`,prompt:p,attachments:o,storageIds:s,reasoningEffort:d,fastMode:f,selectedModel:c,completionProvider:l,continuationOfRunId:m,autoSubmit:!0});return}p!==null&&(Ze(m??null),Ge(p),await Hr({answeredQuestionId:e.questionId,continuationOfRunId:m},p))}}let Vr=(0,F.useRef)(Pn);async function Hr(e,t){let n=Vr.current;if(n){if(e?.answeredQuestionId&&n.questionId!==e.answeredQuestionId){tt(`Answer the new agent question before continuing.`);return}if(!e?.answeredQuestionId){await Br();return}}let r=t??We;if(ir||!r.trim()&&un.items.length===0)return;if(un.items.some(e=>e.status!==`ready`)){tt(`Wait for file uploads to finish, or remove failed files before sending.`);return}let i=Vn;if(!i){tt(`Choose a project first.`);return}if(!N){tt(uR);return}if(Ne&&!rr){tt(`Loading thread state before sending.`);return}if(!sr){tt($n||tr||ir?`Wait for the current agent launch or run to finish.`:Bn?.localAttachmentAvailability===`available`?`You need an active project before sending.`:`This project needs to be attached before sending.`);return}let a=Ne,o=je;if(!o){tt(`Choose a project first.`);return}let s=u.current;if(!s){tt(`User session is not ready.`);return}let c=()=>u.current===s,l=r.trim(),d=un.snapshot(),f=d.flatMap(e=>e.storageId?[e.storageId]:[]),p=Le,m=ze,h=Ve,g=P,_=e?.continuationOfRunId??Xe??void 0,v=a?Nn?.runId??null:null,y=a?`thread:${a}`:`draft:${i}`,b=y,x=b,S=gR(s,b),C=Gt.get(S),w=crypto.randomUUID(),T=vL({latestRun:!a||!Mn||Mn.phase===`idle`?null:{runId:Nn?.runId,status:NL(Mn.phase)?`queued`:`completed`,submissionId:Zn?.submissionId??``},newSubmissionId:w,prompt:l,storageIds:f,reasoningEffort:h,fastMode:g,completionProvider:m,continuationOfRunId:_,recoveredSubmission:C?{...C,selectedModel:C.selectedModel}:void 0,selectedModel:p}),E=T;ln(s,b);let D=null,ee=null,O=++Jt.current,te=gR(s,b);Kt.set(te,O);let ne=()=>Kt.get(te)===O,re=`Your session changed before the agent started. Return to this account and send the prompt again.`,ie=`This request is still preparing. Wait for it to finish before trying again.`,k=e=>{cn(s,x,{message:e,prompt:l,attachments:d,storageIds:f,reasoningEffort:h,fastMode:g,selectedModel:p,completionProvider:m,continuationOfRunId:_,autoSubmit:!1,submissionId:!a&&x===b?T:E})},ae=()=>{ln(s,x),c()&&tt(e=>e===ie?null:e)},A=window.setTimeout(()=>{if(Kt.get(te)!==O)return;k(ie);let e=D,t=ee;e&&t!==null&&rt(n=>KL(n,e,t)),sn(y,O),Kt.delete(te)},dR);Ge(``),tt(null),Ut.set(y,O),on();try{if(!a){let e=await N.resolveWorkspacePath({workspacePath:i});if(!ne())return;if(e.repositoryKey!==o){let t=await dr();if(!ne())return;let n=CL(t,e);if(!n)throw Error(`The repository changed and its project attachment is unavailable.`);i=n.workspacePath,o=n.repositoryKey,gr(i,null,!0,!0,o);let r=`draft:${i}`;r!==y&&(sn(y,O),Kt.delete(te),y=r,x=r,te=gR(s,r),Kt.set(te,O),Ut.set(y,O),on())}}let e=a;if(!ne())return;if(!c()){k(re);return}D=e,ae(),window.clearTimeout(A);let t=++qt.current;ee=t;let n={launchId:t,previousRunId:v};Nn?.startedAt&&(n.previousStartedAt=Nn.startedAt),e&&rt(t=>GL(t,e,n)),await bL({userId:s,desktopApi:N,onError:n=>{if(ne()&&c()){if(e){let n=KL(Wr.current,e,t);n!==Wr.current&&rt(n)}k(n instanceof Error?n.message:`Failed to start the local agent run.`)}},onStarted:(e,t)=>{c()&&dr().catch(()=>{}),ne()&&c()&&(D=t,Fn.current===a&&In.current===i&&(a||(ct(t),hr(),Pe(t),Ie(null)),un.clear({discard:!1}),Gr.current===_&&(Ze(null),$e(!1))))},threadId:e??void 0,repositoryKey:e?void 0:o,prompt:l,storageIds:f,selectedModel:p,completionProvider:m,submissionId:E,reasoningEffort:h,fastMode:g,workspacePath:i,continuationOfRunId:_})}catch(e){if(D&&ee!==null&&rt(KL(Wr.current,D,ee)),!ne())return;if(!c()){k(re);return}k(e instanceof Error?e.message:`Failed to send prompt.`),dr().catch(()=>{})}finally{window.clearTimeout(A),sn(y,O),ee===null&&Kt.get(te)===O&&Kt.delete(te)}}let Ur=(0,F.useRef)(Nn),Wr=(0,F.useRef)(nt),Gr=(0,F.useRef)(Xe);(0,F.useLayoutEffect)(()=>{n.current=e,u.current=c,Ce.current=N,Fn.current=Ne,In.current=ke,Ln.current=je,Rn.current=Fe,Vr.current=Pn,Ur.current=Nn,Wr.current=nt,Gr.current=Xe},[e,c,N,Ne,ke,je,Fe,Pn,Nn,nt,Xe]);async function Kr(){if(!er)return;let e=u.current,t=Ne,n=Nn?.runId;if(t&&n)try{await a.mutation(Jp.agentRuntime.requestCancellation,{runId:n})}catch(r){if(u.current!==e||Fn.current!==t||Ur.current?.runId!==n)return;tt(r instanceof Error?r.message:`Failed to stop run.`)}}async function qr(){if(!nr||!Nn||!Ne||!Vn||tr||ir)return;if(!N){tt(uR);return}let e=Ne,t=Vn,n=u.current;if(!t||!n)return;let r=Nn.runId,i=Nn.startedAt,a=++qt.current,o={launchId:a,previousRunId:r,previousStartedAt:i};rt(t=>GL(t,e,o));try{if(u.current!==n)throw Error(`User session is not ready.`);await bL({userId:n,desktopApi:N,onError:t=>{rt(t=>KL(t,e,a)),u.current===n&&Fn.current===e&&tt(t.message)},onStarted:()=>{},threadId:e,prompt:``,storageIds:[],selectedModel:Le,completionProvider:ze,reasoningEffort:Ve,fastMode:P,submissionId:crypto.randomUUID(),workspacePath:t,continuationOfRunId:r})}catch(t){if(rt(t=>KL(t,e,a)),u.current!==n||Fn.current!==e)return;tt(t instanceof Error?t.message:`Failed to continue the run.`)}}let Jr=(0,F.useEffectEvent)(e=>{let t=mt,n=Ne;ht(e),at(!1),Ae(null),Me(null),Pe(null),Ie(null),ct(null),rt({}),ye.current=null,j.current=null,ie(!1),ae(!1),oe(null),ce(!1),ue(null),Ee.current=null,me(!1),ge(null),Yt.current=null,hr(),Ge(``),Ye(!1),qe(null),Ze(null),$e(!1),un.clear({discard:!0,userId:t,threadId:n}),tt(null),Re(E?.defaultModelId??`gpt-5.6-sol`),Be(`spikonado`),He(E?.defaultReasoningEffort??`high`),Ue(!1),_t(!1),Ct(null),xt(void 0),fn.reset()});(0,F.useEffect)(()=>{mt!==c&&Jr(c)},[c,mt]),(0,F.useEffect)(()=>{if(!st)return;let e=HL({pendingCreatedThreadId:st,threads:jn});e!==st&&ct(e)},[st,jn]);let Yr=(0,F.useEffectEvent)((e,t,n)=>{Rt(e=>e.slice(1)),Qt(!0),at(!0),_t(!1),Tt(!1),tt(null),Tr(e,t,n).catch(e=>{u.current===n&&(at(!1),tt(e instanceof Error?e.message:`Failed to open the requested project.`))}).finally(()=>{Qt(!1)})});(0,F.useEffect)(()=>{let e=Lt[0];e&&!Zt&&m&&N&&c&&ft&&Yr(e,N,c)},[Lt,Zt,N,c,m,ft]),(0,F.useEffect)(()=>{let e=An,t=e?._id??null;t!==Yt.current&&(Yt.current=t,Ze(null),$e(!1),e&&(Re(e.selectedModel),Be(e.completionProvider??`spikonado`),He(e.reasoningEffort),Ue(e.fastMode??!1)))},[An]),(0,F.useEffect)(()=>{let e=c,t=hR(Ne,Vn);if(!e||!t)return;let n=gR(e,t),r=Wt.get(n);if(!r||r.autoSubmit&&We!==``&&We!==r.prompt)return;Wt.delete(n);let i=We===``;i&&Ge(r.prompt),un.items.length===0&&r.attachments?.length&&(i||We===r.prompt)&&un.replace(r.attachments),(We===r.prompt||i)&&(Ze(r.continuationOfRunId??null),$e(r.autoSubmit===!0&&r.continuationOfRunId!==void 0),r.submissionId&&(r.prompt||r.storageIds?.length)&&r.reasoningEffort&&r.selectedModel&&r.completionProvider&&Gt.set(n,{prompt:r.prompt,storageIds:r.storageIds??[],reasoningEffort:r.reasoningEffort,fastMode:r.fastMode??!1,selectedModel:r.selectedModel,completionProvider:r.completionProvider,submissionId:r.submissionId,continuationOfRunId:r.continuationOfRunId})),tt(r.message),on()},[c,Ne,Vn,We,un,Wt,Gt,rn,on]);let Xr=(0,F.useEffectEvent)(()=>{Hr()});(0,F.useEffect)(()=>{Qe&&Xe&&sr&&!Pn&&N&&We.trim()&&!un.items.some(e=>e.status!==`ready`)&&($e(!1),Xr())},[Qe,Xe,sr,Pn,N,We,un]);let Zr=(0,F.useEffectEvent)(e=>{if(at(!0),!e)return;let t=gr(e,null,!0,!0);Er(e).catch(e=>{t===ot.current&&tt(e instanceof Error?e.message:`Failed to attach project.`)}),Mr()});(0,F.useEffect)(()=>{let e=BL({hasResolvedInitialSelection:it,initialProjectLaunchResolved:zt,hasPendingProjectLaunches:Lt.length>0,projectLaunchInFlight:Zt,hasLoadedProjects:ft,signedInUserId:c,projects:En});e&&Zr(e.workspacePath)},[it,zt,Lt.length,Zt,ft,c,En]);let Qr=(0,F.useEffectEvent)(e=>{gr(e.workspacePath,Ne,Fe===e.workspacePath)});(0,F.useEffect)(()=>{let e=Ne?zL(jn,Ne):null,t=Bn?.repositoryKey===e?.repositoryKey?Bn:IL(En,e?.repositoryKey);t&&t.workspacePath!==ke&&Qr(t)},[jn,Bn,Ne,ke,En,Fe]);let $r=(0,F.useEffectEvent)((e,t)=>{gr(e,t,Fe===e,!0)});(0,F.useEffect)(()=>{let e=Wn;if(!it||!ke)return;let t=YL({threads:e,currentThreadId:Ne,currentWorkspacePath:ke,draftWorkspacePath:Fe});t!==Ne&&$r(ke,t)},[Wn,it,ke,Ne,Fe]),(0,F.useEffect)(()=>{let e=nt;Ne&&Nn?.runId&&(e=JL(e,Ne,Nn.runId,void 0,Nn.startedAt)),e!==nt&&rt(e)},[Ne,Nn,nt]);let ei=(0,F.useEffectEvent)(()=>{let e=window.sprocketDesktopBridge,n=e?.onWorkspaceLaunch?e.onWorkspaceLaunch(()=>{wr()}):void 0,r=Nm();return r&&(Cr(r),Pm()),e?.takeWorkspaceLaunch?wr().finally(()=>Bt(!0)):Bt(!0),t.resolveDesktopApi().then(async e=>{Se(e),await Rh(),Te(!0),dr(e).catch(e=>{tt(e instanceof Error?e.message:`Failed to load local project attachments.`)})}).catch(e=>{tt(e instanceof Error?e.message:`Failed to connect to the Sprocket server.`),Te(!0)}),n});(0,F.useEffect)(()=>{let e=matchMedia(`(max-width: 767px)`);kt(!e.matches),jt(window.innerWidth);let t=()=>jt(window.innerWidth);window.addEventListener(`resize`,t),ve();let n=ei();return()=>{n?.(),window.removeEventListener(`resize`,t)}},[]);async function ti(e){await Promise.resolve(),document.querySelector(e?`.inbox-sidebar-host button`:`.inbox-floating-controls button`)?.focus()}async function ni(){kt(!0),await ti(!0)}async function ri(){kt(!1),await ti(!1)}function ii(){Dt(`general`),Tt(!0)}async function ai(){ii(),At<768&&kt(!0),await ti(!0)}async function oi(){Tt(!1),Dt(`general`),await ti(Ot)}return we?N?m?(0,R.jsxs)(`div`,{className:`relative h-dvh overflow-hidden`,children:[(0,R.jsxs)(`div`,{className:pb(`app-workspace-shell inbox-layout`,!wt&&fn.panel.open&&!fn.panel.expanded?`pr-[20rem]`:``,!Mt&&`sidebar-hidden`,wt&&`settings-open`),inert:fn.fullscreenArtifact||fn.panel.open&&fn.panel.expanded?!0:void 0,children:[Ot&&(0,R.jsx)(`button`,{className:`fixed inset-0 z-[140] bg-black/40 md:hidden`,type:`button`,"aria-label":`Close sidebar`,onClick:()=>void ri()}),(0,R.jsx)(`div`,{className:`inbox-sidebar-host`,inert:!Mt,children:wt?(0,R.jsx)(WS,{activePage:Et,theme:Sn,onThemeChange:e=>void wn(e),onBack:()=>void oi(),onNavigate:e=>{Dt(e),matchMedia(`(max-width: 767px)`).matches&&ri()}}):(0,R.jsx)(fR,{signedInUserId:c,repositoryKeys:On,sections:kn.sections,projects:Dn,models:E?.models??[],selectedProjects:Nt,currentThreadId:Ne,settledOpen:Ft,onSettledOpenChange:It,mutationsEnabled:m,theme:Sn,onThemeChange:e=>void wn(e),onClose:()=>void ri(),onFilter:e=>Pt(e),onSelect:Pr,onNew:jr,onAddProject:()=>yr(`add`),onSettings:ii,onChange:zr,onRename:(e,t)=>Fr(e._id,t)})}),!Mt&&(0,R.jsxs)(`div`,{className:`inbox-floating-controls`,children:[(0,R.jsx)(hb,{size:`sm`,class:`inbox-icon`,label:`Open sidebar`,onclick:()=>void ni()}),(0,R.jsx)(`button`,{className:`inbox-icon`,type:`button`,"aria-label":`Settings`,title:`Settings`,onClick:()=>void ai(),children:(0,R.jsx)(dv,{size:16})})]}),(0,R.jsxs)(`main`,{className:`relative flex h-full min-h-0 min-w-0 flex-col overflow-hidden`,inert:Ot&&At<768,children:[!wt&&!fn.panel.open&&(0,R.jsx)(`button`,{type:`button`,className:`text-muted-foreground hover:text-foreground hover:bg-muted absolute top-3 right-3 z-100 inline-flex items-center justify-center rounded-md p-2 transition`,onClick:()=>fn.update({open:!0}),"aria-label":`Open side panel`,children:(0,R.jsx)(Z_,{className:`size-4`,"aria-hidden":`true`})}),wt?Et===`general`?(0,R.jsx)(CS,{}):Et===`usage`?(0,R.jsx)(QS,{}):Et===`providers`&&c?(0,R.jsx)(zS,{userId:c,desktopApi:N,openAiConfigured:re,chatGptStatus:A,chatGptLoading:se,chatGptStatusError:le,loading:de,loadError:he,onChatGptStatusChange:kr,onConfigurationChange:Or}):Et===`payments`?(0,R.jsx)(RS,{}):(0,R.jsx)(SS,{user:o.user,onSignOut:()=>void fr()}):(0,R.jsxs)(R.Fragment,{children:[Ne&&(0,R.jsx)(GP,{userId:c??void 0,messages:zn,actions:Kn,activeRunId:$n?Nn?.runId??null:null,project:Bn,artifacts:fn.artifacts,onOpenArtifact:e=>{fn.update({open:!0,tab:`artifacts`,selectedKey:e})},loadingOlder:dn.loadingOlder,nextBefore:dn.nextBefore??void 0,emptyStateMessage:Ne&&(dn.loading||dn.threadId!==Ne)?`Loading conversation history...`:Bn?`Start a thread and ask Sprocket to inspect code, edit files, or run project commands.`:`Add a project to begin.`,onLoadOlder:()=>void Ir(),loadAttachment:Lr,loadSectionDetails:Rr},`${Ne}:${dn.windowVersion}`),(0,R.jsxs)(`div`,{className:Ne?`shrink-0`:`create-thread-screen`,children:[!Ne&&(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(qx,{projects:En,workspacePath:ke,onProject:Ar,onAddProject:()=>yr(`add`)}),Bn?.localAttachmentAvailability===`unavailable`&&(0,R.jsxs)(`p`,{className:`create-thread-message`,children:[`Project not connected here.`,` `,(0,R.jsx)(`button`,{type:`button`,onClick:()=>{ke&&Dr(ke)},children:`Connect a local folder`}),` `,`to start local work.`]})]}),!ee&&te&&!E?(0,R.jsx)(`div`,{className:`text-muted-foreground mb-3 text-sm`,children:`Loading models…`}):null,(0,R.jsx)(`div`,{ref:Ht,className:Ne?``:`create-thread-composer`,children:(0,R.jsx)(Gx,{notices:(0,R.jsx)(Kx,{error:ar,runError:or,reconnecting:!!(Ne&&dn.threadId===Ne&&dn.stale),catalogError:ee!==null,catalogLoading:te,onRetryCatalog:()=>void ve()}),prompt:We,onPromptChange:Ge,attachments:un.items,onAttachFiles:e=>un.add(e),onRemoveAttachment:e=>un.remove(e),modelCatalog:E,selectedModel:Le,onSelectedModelChange:Re,configuredProviders:_e,providersReady:pe,selectedCompletionProvider:ze,onSelectedCompletionProviderChange:Be,selectedReasoningEffort:Ve,onSelectedReasoningEffortChange:He,fastMode:P,onFastModeChange:Ue,pendingQuestion:Pn,showContinueWorking:nr!=null,onContinueWorking:()=>void qr(),runningCommands:Ne&&c&&N&&m?{api:N,scope:{userId:c,threadId:Ne}}:null,selectedQuestionOptionId:Ke,onSelectedQuestionOptionIdChange:qe,canSend:sr,isSubmitting:ir||tr||Je,isStarting:tr,isRunning:!tr&&er,runStartedAt:$n?Nn?.startedAt??null:null,projectSkills:Un,projectPaths:Hn,onSubmit:()=>void Hr(),onCancel:()=>void Kr()})})]})]})]})]}),!wt&&fn.panel.open&&(0,R.jsx)(`div`,{className:fn.panel.expanded?`bg-background fixed inset-0 z-50`:`absolute inset-y-0 right-0 z-40 w-[20rem]`,inert:fn.fullscreenArtifact?!0:void 0,children:(0,R.jsx)(sF,{workspacePath:N?Bn?.workspacePath:void 0,artifacts:fn.artifacts,onDeleteArtifact:qn,selectedKey:fn.panel.selectedKey,tab:fn.panel.tab,liveView:yn.data,liveActive:!1,expanded:fn.panel.expanded,stale:fn.watchState.stale,error:fn.watchState.error,onSelect:e=>fn.update({selectedKey:e}),onBack:()=>fn.update({selectedKey:null}),onTabChange:e=>fn.update({tab:e}),onOpenFullscreen:e=>{fn.setFullscreenKey(e),document.fullscreenElement||document.documentElement.requestFullscreen?.().catch(()=>{})},onToggleExpanded:()=>fn.update({expanded:!fn.panel.expanded}),onClose:()=>fn.update({open:!1,expanded:!1})})}),fn.fullscreenArtifact&&(0,R.jsx)(cF,{workspacePath:N?Bn?.workspacePath:void 0,artifact:fn.fullscreenArtifact,onClose:()=>fn.setFullscreenKey(null)}),N&&gt&&(0,R.jsx)(jF,{open:gt,desktopApi:N,mode:vt,expectedDisplayName:bt,recentProjectPaths:lr,onClose:()=>{_t(!1),Ct(null),xt(void 0)},onSelect:async e=>{try{await br(e)}catch{await dr()}}})]}):(0,R.jsxs)(`div`,{className:`bg-background h-screen overflow-hidden`,children:[(0,R.jsx)(wb,{authState:{isLoading:!o.isReady||o.isLoading||d||s||l&&i.isLoading,isConfigured:o.isConfigured,isAuthenticated:l,connectionFailed:h,error:o.error},overlayOpen:o.isWaitingForBrowserSignIn,onSignIn:()=>void tg(),onSignOut:()=>void fr(),onRetry:()=>void(p?tg():ug()),retryLabel:p?`Finish sign-in`:`Retry`,onSignUp:()=>void ng()}),(0,R.jsx)(Tb,{open:o.isWaitingForBrowserSignIn,signInUrl:o.browserSignInUrl,error:o.error,onCancel:Qh,onClearOpenError:$h})]}):(0,R.jsx)(Cb,{title:`Connect to Sprocket`,description:et??`Open Sprocket from the desktop app or CLI to continue.`}):(0,R.jsx)(Cb,{title:`Connecting to Sprocket…`,description:`Looking for a running Sprocket server on this machine.`,busy:!0})}function vR(){let{isReady:e}=Wm(Gm);return(0,F.useEffect)(()=>{document.title=`Signing In`},[]),(0,F.useEffect)(()=>{e&&window.location.replace(`/`)},[e]),(0,R.jsx)(Cb,{title:`Completing sign-in`,description:`Sprocket is finishing authentication and will return to your projects automatically.`})}var yR=class extends F.Component{state={failed:!1};static getDerivedStateFromError(){return{failed:!0}}render(){return this.state.failed?(0,R.jsx)(Cb,{title:`Unable to display Sprocket`,description:`Reload the app to try again.`,actions:(0,R.jsx)(`button`,{type:`button`,className:`text-foreground rounded-lg border border-[var(--hairline)] px-4 py-2 text-sm`,onClick:()=>window.location.reload(),children:`Reload`})}):this.props.children}},bR=document.getElementById(`root`);if(!bR)throw Error(`Missing application root.`);var xR=(0,fr.createRoot)(bR);async function SR(){try{let e=await hf(),t=e.env.PUBLIC_CONVEX_URL;if(!t)throw Error(`Sprocket is missing its Convex configuration.`);let n=new Un(t,{unsavedChangesWarning:!1});xR.render((0,R.jsx)(yR,{children:(0,R.jsx)(pg,{client:n,machine:e.machine,children:window.location.pathname===`/callback`?(0,R.jsx)(vR,{}):(0,R.jsx)(_R,{config:e})})}))}catch(e){xR.render((0,R.jsx)(Cb,{title:`Unable to connect`,description:e instanceof Error?e.message:`Failed to start Sprocket.`}))}}SR();