@usemosio/cli-darwin-arm64 1.0.0-next.2 → 1.0.0-next.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (38) hide show
  1. package/apps/studio/dist/assets/{Workspace-DsbQ04kb.js → Workspace-Dr-hVeFd.js} +1 -1
  2. package/apps/studio/dist/assets/{agent-panel-DUWPbpew.js → agent-panel-DMrVed-J.js} +1 -1
  3. package/apps/studio/dist/assets/{boundary-DuK3AiqM.js → boundary-DL9veUlN.js} +1 -1
  4. package/apps/studio/dist/assets/{index-DPLtb0kT.js → index-C6juWzGV.js} +82 -3
  5. package/apps/studio/dist/assets/{inspector3d-B8pkZTye.js → inspector3d-sqergHSP.js} +1 -1
  6. package/apps/studio/dist/index.html +1 -1
  7. package/bin/mosio +0 -0
  8. package/bin/mosio-agent +0 -0
  9. package/crates/mosio/src/adapters/mosio-three.js +1 -1
  10. package/crates/mosio/src/runtime.js +79 -0
  11. package/fixtures/cloudrun-gpu/audio/music.wav +0 -0
  12. package/fixtures/cloudrun-gpu/audio/vo.wav +0 -0
  13. package/fixtures/cloudrun-gpu/mosio.json +18 -0
  14. package/fixtures/cloudrun-gpu/scenes/cube.html +25 -0
  15. package/fixtures/direct-seek/mosio.json +4 -0
  16. package/fixtures/direct-seek/scenes/clock.html +9 -0
  17. package/fixtures/direct-seek/scenes/meta.html +11 -0
  18. package/fixtures/direct-seek/scenes/pure.html +11 -0
  19. package/fixtures/direct-seek/scenes/slow.html +11 -0
  20. package/fixtures/direct-seek-media/mosio.json +6 -0
  21. package/fixtures/direct-seek-media/scenes/pure.html +11 -0
  22. package/fixtures/gl-readback/mosio.json +16 -0
  23. package/fixtures/gl-readback/scenes/compositor.html +23 -0
  24. package/fixtures/gl-readback/scenes/readback.html +23 -0
  25. package/package.json +1 -1
  26. package/scripts/acceptance/direct-seek.sh +68 -0
  27. package/scripts/acceptance/frames.sh +7 -2
  28. package/scripts/check-error-codes.py +1 -1
  29. package/scripts/check-file-size.sh +0 -4
  30. package/scripts/gen-media-fixtures.sh +1 -0
  31. package/scripts/gl-readback-check.sh +26 -0
  32. package/scripts/platform-smoke.sh +16 -3
  33. package/scripts/user-journey.sh +68 -0
  34. package/skills/mosio-3d/SKILL.md +30 -2
  35. package/skills/mosio-engine/references/checks.md +1 -1
  36. package/skills/mosio-engine/references/project.md +12 -0
  37. package/skills/mosio-engine/references/timeline.md +1 -1
  38. package/skills/mosio-media/references/captions.md +4 -1
@@ -1,4 +1,4 @@
1
- import{P as e,Z as t,a as n,at as r,ct as i,it as a,ot as o,rt as s,st as c,t as l,tt as u,y as d}from"./feedback-x6ZumR_x.js";import{E as f,I as p,L as m,P as h,T as g,o as _,ot as v,s as y,st as b}from"./index-DPLtb0kT.js";import{n as x,t as S}from"./boundary-DuK3AiqM.js";var C=`mosio.agent.event/1`,w=e=>typeof e==`object`&&!!e&&!Array.isArray(e);function T(e){if(!w(e)||e.schema!==`mosio.agent.event/1`||typeof e.seq!=`number`||!Number.isInteger(e.seq)||e.seq<1||typeof e.id!=`string`||typeof e.kind!=`string`||typeof e.session_id!=`string`||typeof e.ts_ms!=`number`||e.turn_id!==void 0&&e.turn_id!==null&&typeof e.turn_id!=`string`)return null;let t=w(e.data)?e.data:{};return{schema:C,seq:e.seq,id:e.id,session_id:e.session_id,ts_ms:e.ts_ms,turn_id:e.turn_id??void 0,kind:e.kind,data:t}}function E(e,t){let n=Math.max(1,Math.round(t)),r=Math.floor(e/n),i=String(e%n).padStart(2,`0`),a=String(r%60).padStart(2,`0`);return r<60?`${a}:${i}`:`${Math.floor(r/60)}:${a}:${i}`}function D(e){return{sessionId:e,lastSeq:0,gap:!1,state:`idle`,turns:[],proposals:{},artifacts:{},permissions:{},usage:null,provider:null,lastError:null,notices:[],contextChips:[]}}var O=(e,t=``)=>typeof e==`string`?e:t,k=e=>typeof e==`number`&&Number.isFinite(e)?e:null,A=e=>Array.isArray(e)?e:[];function ee(e){let t=[];for(let n of A(e)){let e=n.content??n;typeof e?.text==`string`?t.push(e.text):n.type===`diff`&&typeof n.path==`string`&&t.push(`diff ${n.path}`)}return t.length?t.join(`
1
+ import{P as e,Z as t,a as n,at as r,ct as i,it as a,ot as o,rt as s,st as c,t as l,tt as u,y as d}from"./feedback-x6ZumR_x.js";import{E as f,I as p,L as m,P as h,T as g,o as _,ot as v,s as y,st as b}from"./index-C6juWzGV.js";import{n as x,t as S}from"./boundary-DL9veUlN.js";var C=`mosio.agent.event/1`,w=e=>typeof e==`object`&&!!e&&!Array.isArray(e);function T(e){if(!w(e)||e.schema!==`mosio.agent.event/1`||typeof e.seq!=`number`||!Number.isInteger(e.seq)||e.seq<1||typeof e.id!=`string`||typeof e.kind!=`string`||typeof e.session_id!=`string`||typeof e.ts_ms!=`number`||e.turn_id!==void 0&&e.turn_id!==null&&typeof e.turn_id!=`string`)return null;let t=w(e.data)?e.data:{};return{schema:C,seq:e.seq,id:e.id,session_id:e.session_id,ts_ms:e.ts_ms,turn_id:e.turn_id??void 0,kind:e.kind,data:t}}function E(e,t){let n=Math.max(1,Math.round(t)),r=Math.floor(e/n),i=String(e%n).padStart(2,`0`),a=String(r%60).padStart(2,`0`);return r<60?`${a}:${i}`:`${Math.floor(r/60)}:${a}:${i}`}function D(e){return{sessionId:e,lastSeq:0,gap:!1,state:`idle`,turns:[],proposals:{},artifacts:{},permissions:{},usage:null,provider:null,lastError:null,notices:[],contextChips:[]}}var O=(e,t=``)=>typeof e==`string`?e:t,k=e=>typeof e==`number`&&Number.isFinite(e)?e:null,A=e=>Array.isArray(e)?e:[];function ee(e){let t=[];for(let n of A(e)){let e=n.content??n;typeof e?.text==`string`?t.push(e.text):n.type===`diff`&&typeof n.path==`string`&&t.push(`diff ${n.path}`)}return t.length?t.join(`
2
2
  `):void 0}function j(e,t){if(t.turn_id){let n=e.turns.find(e=>e.id===t.turn_id);return n||(n={id:t.turn_id,user:null,items:[],tools:[],plan:null,startedMs:t.ts_ms},e.turns.push(n)),n}return e.turns[e.turns.length-1]??null}function M(e){return{...e,items:[...e.items],tools:[...e.tools]}}function te(e,t){if(t.session_id!==e.sessionId||t.seq<=e.lastSeq)return e;if(t.seq!==e.lastSeq+1&&e.lastSeq!==0)return{...e,gap:!0};let n={...e,lastSeq:t.seq,gap:!1,turns:e.turns.map(n=>n.id===t.turn_id||n===e.turns[e.turns.length-1]?M(n):n),proposals:e.proposals,artifacts:e.artifacts,permissions:e.permissions},r=t.data;switch(t.kind){case`session.state`:n.state=O(r.state,n.state);break;case`provider.ready`:{let e=r.capabilities??{};n.provider={name:O(e.agent_name,O(r.provider)),title:O(e.agent_title)||void 0,version:O(e.agent_version)||void 0,capabilities:e};break}case`context.updated`:n.contextChips=A(r.context??r.chips);break;case`turn.started`:{let e=j(n,t);e&&(e.user={text:O(r.text),chips:A(r.context),tsMs:t.ts_ms},e.startedMs=t.ts_ms),n.lastError=null;break}case`message.chunk`:{let e=j(n,t),i=r.role===`thought`?`thought`:r.role===`agent`?`agent`:null,a=O(r.text);if(!e||!i||!a)break;let o=e.items[e.items.length-1];o&&o.type===`text`&&o.role===i&&!e.sealed?e.items[e.items.length-1]={...o,text:o.text+a}:e.items.push({type:`text`,role:i,text:a}),e.sealed=!1;break}case`tool.call`:case`tool.update`:{let e=j(n,t),i=O(r.toolCallId);if(!e||!i)break;let a=e.tools.findIndex(e=>e.id===i&&e.source===`agent`),o=a>=0?e.tools[a]:void 0,s=O(r.status,o?.status??`pending`),c={id:i,source:`agent`,title:O(r.title,o?.title??i),kind:O(r.kind,o?.kind??`other`),status:s,text:ee(r.content)??o?.text,locations:A(r.locations).map(e=>O(e.path)).filter(Boolean),startedMs:o?.startedMs??t.ts_ms,endedMs:s===`completed`||s===`failed`?t.ts_ms:o?.endedMs};c.locations?.length||(c.locations=o?.locations),a>=0?e.tools[a]=c:(e.tools.push(c),e.sealed=!0);break}case`mosio.tool.started`:case`mosio.tool.finished`:{let e=j(n,t),i=O(r.call_id);if(!e||!i)break;let a=e.tools.findIndex(e=>e.id===i),o=r.ok!==!1,s=a>=0?{...e.tools[a],status:t.kind===`mosio.tool.finished`?o?`completed`:`failed`:`in_progress`,endedMs:t.kind===`mosio.tool.finished`?t.ts_ms:void 0,text:o?e.tools[a].text:O(r.error?.message)}:{id:i,source:`mosio`,tool:O(r.tool),title:O(r.tool).replace(/_/g,` `),kind:`other`,status:`in_progress`,startedMs:t.ts_ms};a>=0?e.tools[a]=s:e.tools.push(s);break}case`plan`:{let e=j(n,t);e&&Array.isArray(r.entries)&&(e.plan=A(r.entries));break}case`usage`:n.usage={used:k(r.used),size:k(r.size),cost:r.cost??null};break;case`permission.requested`:{let e=O(r.request_id);if(!e)break;n.permissions={...n.permissions,[e]:{requestId:e,source:O(r.source),class:O(r.class),key:O(r.key),details:r.details??{},options:A(r.options),requestedAtMs:k(r.requested_at_ms)??t.ts_ms,expiresAtMs:k(r.expires_at_ms)??t.ts_ms}},j(n,t)?.items.push({type:`permission`,requestId:e});break}case`permission.resolved`:{let e=O(r.request_id);if(e&&n.permissions[e])n.permissions={...n.permissions,[e]:{...n.permissions[e],outcome:O(r.outcome),by:O(r.by)}};else if(!e&&r.outcome===`denied`&&r.by===`policy`){let e=O(r.class,`action`).replace(/_/g,` `);j(n,t)?.items.push({type:`notice`,level:`warning`,text:`Mosio blocked a ${e} request (policy: never allowed).`})}break}case`proposal.created`:case`proposal.updated`:{let e=r;if(!e||typeof e.id!=`string`)break;let i=!n.proposals[e.id];n.proposals={...n.proposals,[e.id]:e},i&&j(n,t)?.items.push({type:`proposal`,id:e.id});break}case`artifact.created`:case`artifact.updated`:{let e=r;if(!e||typeof e.id!=`string`)break;let i=!n.artifacts[e.id];n.artifacts={...n.artifacts,[e.id]:e},i&&j(n,t)?.items.push({type:`artifact`,id:e.id});break}case`error`:{let e=r;n.lastError=e,j(n,t)?.items.push({type:`error`,error:e});break}case`notice`:{let e={level:O(r.level,`info`),text:O(r.text,O(r.message))};e.text&&(n.notices=[...n.notices,e].slice(-20),j(n,t)?.items.push({type:`notice`,...e}));break}case`provider.exited`:{let e={level:`warning`,text:O(r.reason,`The agent process stopped.`)};n.notices=[...n.notices,e].slice(-20);break}case`turn.ended`:{let e=j(n,t);e&&(e.endedMs=t.ts_ms,e.stopReason=O(r.stop_reason),r.usage&&typeof r.usage==`object`&&(e.usage=r.usage));break}}return n}function ne(e){let t={...e,tools:ie(e)};if(!t.tools.length)return null;let n=t.tools.filter(e=>e.kind===`read`||e.kind===`search`||/^(get|list|inspect|render_preview|plan|compare)/.test(e.tool??``)).length,r=t.tools.filter(e=>e.kind===`edit`||/^(propose|apply|create|update)/.test(e.tool??``)).length,i=t.tools.filter(e=>e.status===`failed`).length,a=[];n&&a.push(`Read ${n} ${n===1?`item`:`items`}`),r&&a.push(`${r} ${r===1?`change`:`changes`}`),!n&&!r&&a.push(`${t.tools.length} ${t.tools.length===1?`step`:`steps`}`),i&&a.push(`${i} failed`);let o=((t.endedMs??Math.max(...t.tools.map(e=>e.endedMs??e.startedMs)))-t.startedMs)/1e3;return o>0&&a.push(`${o.toFixed(1)} s`),a.join(` · `)}function re(e){let t=Object.values(e.permissions).some(e=>!e.outcome),n=Object.values(e.proposals).some(e=>e.status===`pending`||e.status===`conflict`);switch(e.state){case`starting`:return{text:`Starting`,tone:`muted`};case`running`:return{text:`Working`,tone:`blue`};case`awaiting_permission`:return{text:`Needs approval`,tone:`amber`};case`cancelling`:return{text:`Stopping`,tone:`muted`};case`interrupted`:return{text:`Interrupted`,tone:`red`};case`failed`:return{text:`Failed`,tone:`red`};case`closed`:return{text:`Closed`,tone:`muted`};default:return t?{text:`Needs approval`,tone:`amber`}:n?{text:`In review`,tone:`amber`}:{text:`Your turn`,tone:`blue`}}}function ie(e){let t=e.tools.filter(e=>e.source===`agent`);return t.length?t:e.tools}var ae=class extends Error{code;retryable;fix;details;status;constructor(e,t=0){super(e.message),this.code=e.code,this.retryable=e.retryable,this.fix=e.fix,this.details=e.details,this.status=t}};function oe(){let e=globalThis.crypto;return e&&`randomUUID`in e?`m_${e.randomUUID().replace(/-/g,``).slice(0,24)}`:`m_${Date.now().toString(36)}${Math.random().toString(36).slice(2,10)}`}var se=class{kind=`http`;base;token;f;WS;backoff;constructor(e){this.base=e.baseUrl.replace(/\/$/,``),this.token=e.token,this.f=e.fetch??globalThis.fetch.bind(globalThis),this.WS=e.WebSocket??globalThis.WebSocket,this.backoff=e.backoff??[250,5e3]}async req(e,t,n){let r=await this.f(`${this.base}${t}`,{method:e,headers:{Authorization:`Bearer ${this.token}`,...n===void 0?{}:{"Content-Type":`application/json`}},body:n===void 0?void 0:JSON.stringify(n)}),i=await r.json().catch(()=>({}));if(!r.ok)throw new ae(i.error??{code:`E_TRANSPORT`,message:`HTTP ${r.status}`,retryable:r.status>=500},r.status);return i}async providers(){return(await this.req(`GET`,`/api/providers`)).providers}async listSessions(){return(await this.req(`GET`,`/api/sessions`)).sessions}async createSession(e,t){return(await this.req(`POST`,`/api/sessions`,{provider:e,title:t})).session}async getSession(e){return(await this.req(`GET`,`/api/sessions/${encodeURIComponent(e)}`)).session}async forkSession(e,t){return(await this.req(`POST`,`/api/sessions/${encodeURIComponent(e)}/fork`,{at_seq:t})).session}async events(e,t=0){return(await this.req(`GET`,`/api/sessions/${encodeURIComponent(e)}/events?since=${t}`)).events.map(T).filter(e=>e!==null)}async prompt(e,t,n,r=oe()){return this.req(`POST`,`/api/sessions/${encodeURIComponent(e)}/prompt`,{text:t,context:n,client_msg_id:r})}async cancel(e){return(await this.req(`POST`,`/api/sessions/${encodeURIComponent(e)}/cancel`)).cancelled}async setContext(e,t){await this.req(`POST`,`/api/sessions/${encodeURIComponent(e)}/context`,t)}async answerPermission(e,t,n){await this.req(`POST`,`/api/sessions/${encodeURIComponent(e)}/permissions/${encodeURIComponent(t)}`,{option_id:n})}async rebase(e){return(await this.req(`POST`,`/api/sessions/${encodeURIComponent(e)}/rebase`)).base_revision}async decideProposal(e,t,n){return(await this.req(`POST`,`/api/proposals/${encodeURIComponent(e)}/${t}`,n?{proposal_digest:n}:void 0)).proposal}async editArtifact(e,t,n,r){return(await this.req(`PUT`,`/api/artifacts/${encodeURIComponent(e)}`,{base_version:t,data:n,note:r})).artifact}async decideArtifact(e,t,n={}){return(await this.req(`POST`,`/api/artifacts/${encodeURIComponent(e)}/${t}`,n)).artifact}async protocol(e,t=0){return(await this.req(`GET`,`/api/sessions/${encodeURIComponent(e)}/protocol?offset=${t}`)).messages}mediaUrl(e){return`${this.base}/api/files?path=${encodeURIComponent(e)}&token=${encodeURIComponent(this.token)}`}subscribe(e,t,n,r){let i=t,a=!1,o=null,s=0,c=null,l=t=>{t.seq<=i||(t.seq===i+1?(i=t.seq,n(t)):this.events(e,i).then(e=>e.forEach(l)))},u=()=>{if(a)return;r?.(s===0?`connecting`:`reconnecting`);let t=`${this.base.replace(/^http/,`ws`)}/api/sessions/${encodeURIComponent(e)}/stream?since=${i}&token=${encodeURIComponent(this.token)}`;o=new this.WS(t),o.onopen=()=>{s=0,r?.(`open`)},o.onmessage=e=>{let t;try{t=JSON.parse(String(e.data))}catch{return}let n=T(t);n&&l(n)},o.onclose=()=>{if(o=null,a)return;s+=1;let[e,t]=this.backoff;c=setTimeout(u,Math.min(t,e*2**Math.min(s,6))),r?.(`reconnecting`)},o.onerror=()=>o?.close()};return u(),{close:()=>{a=!0,c&&clearTimeout(c),o?.close(),r?.(`closed`)}}}},N=i(r(),1);function P(...e){return s(a(e))}function ce(e,t){return t.type===`reset`?D(t.id):te(e,t.e)}function le(e,t){let[n,r]=(0,N.useReducer)(ce,D(t??``)),[i,a]=(0,N.useState)(`connecting`),[o,s]=(0,N.useState)(null),c=(0,N.useRef)(0);c.current=n.lastSeq,(0,N.useEffect)(()=>{if(!t)return;r({type:`reset`,id:t});let n=e.subscribe(t,0,e=>r({type:`event`,e}),a);return()=>n.close()},[e,t]);let l=(0,N.useCallback)(async e=>{try{s(null),await e()}catch(e){s(e instanceof ae?e:new ae({code:`E_TRANSPORT`,message:String(e),retryable:!0}))}},[]);return{thread:n,connection:i,busy:[`starting`,`running`,`awaiting_permission`,`cancelling`].includes(n.state),error:o,send:(n,r)=>l(()=>e.prompt(t,n,r,oe())),cancel:()=>l(()=>e.cancel(t)),answerPermission:(n,r)=>l(()=>e.answerPermission(t,n,r)),clearError:()=>s(null)}}function ue(e,t=0){let[n,r]=(0,N.useState)([]),i=(0,N.useCallback)(()=>e.listSessions().then(r).catch(()=>r([])),[e]);return(0,N.useEffect)(()=>{i()},[i,t]),{sessions:n,reload:i}}var F=u(),I={stroke:`currentColor`,fill:`none`,strokeWidth:2,viewBox:`0 0 24 24`,strokeLinecap:`round`,strokeLinejoin:`round`,width:`100%`,height:`100%`,"aria-hidden":!0},de=e=>(0,F.jsxs)(`svg`,{...I,...e,children:[(0,F.jsx)(`polyline`,{points:`16 18 22 12 16 6`}),(0,F.jsx)(`polyline`,{points:`8 6 2 12 8 18`})]}),fe=e=>(0,F.jsx)(`svg`,{...I,...e,children:(0,F.jsx)(`polyline`,{points:`6 9 12 15 18 9`})}),pe=e=>(0,F.jsx)(`svg`,{...I,...e,children:(0,F.jsx)(`polyline`,{points:`9 18 15 12 9 6`})}),me=e=>(0,F.jsxs)(`svg`,{...I,...e,children:[(0,F.jsx)(`polyline`,{points:`11 17 6 12 11 7`}),(0,F.jsx)(`polyline`,{points:`18 17 13 12 18 7`})]}),he=e=>(0,F.jsxs)(`svg`,{...I,...e,children:[(0,F.jsx)(`line`,{x1:`12`,y1:`19`,x2:`12`,y2:`5`}),(0,F.jsx)(`polyline`,{points:`5 12 12 5 19 12`})]}),ge=e=>(0,F.jsxs)(`svg`,{...I,...e,children:[(0,F.jsx)(`path`,{d:`M10.29 3.86L1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z`}),(0,F.jsx)(`line`,{x1:`12`,y1:`9`,x2:`12`,y2:`13`}),(0,F.jsx)(`line`,{x1:`12`,y1:`17`,x2:`12.01`,y2:`17`})]}),_e=e=>(0,F.jsxs)(`svg`,{...I,...e,children:[(0,F.jsx)(`rect`,{x:`3`,y:`3`,width:`18`,height:`18`,rx:`2`,ry:`2`}),(0,F.jsx)(`line`,{x1:`3`,y1:`9`,x2:`21`,y2:`9`}),(0,F.jsx)(`line`,{x1:`9`,y1:`21`,x2:`9`,y2:`9`})]}),ve=e=>(0,F.jsx)(`svg`,{...I,...e,children:(0,F.jsx)(`rect`,{x:`5`,y:`5`,width:`14`,height:`14`,rx:`2`,ry:`2`,fill:`currentColor`,stroke:`none`})}),ye=e=>(0,F.jsx)(`svg`,{...I,...e,children:(0,F.jsx)(`polyline`,{points:`20 6 9 17 4 12`})}),be=e=>(0,F.jsxs)(`svg`,{...I,...e,children:[(0,F.jsx)(`line`,{x1:`12`,y1:`5`,x2:`12`,y2:`19`}),(0,F.jsx)(`line`,{x1:`5`,y1:`12`,x2:`19`,y2:`12`})]}),xe=e=>(0,F.jsxs)(`svg`,{...I,...e,children:[(0,F.jsx)(`polyline`,{points:`1 4 1 10 7 10`}),(0,F.jsx)(`path`,{d:`M3.51 15a9 9 0 1 0 2.13-9.36L1 10`})]}),Se=b(`inline-flex h-[30px] shrink-0 items-center justify-center rounded-lg font-sans text-xs leading-normal whitespace-nowrap transition-colors outline-none focus-visible:ring-2 focus-visible:ring-accent-blue-edge disabled:cursor-not-allowed disabled:opacity-50`,{variants:{variant:{primary:`bg-accent-blue px-3 font-semibold text-text-on-accent hover:brightness-110`,outline:`border border-border-strong px-3 font-medium text-text-primary hover:bg-surface-hover`,ghost:`px-2.5 font-normal text-text-secondary hover:text-text-primary`}},defaultVariants:{variant:`primary`}});function L({variant:e,className:t,...n}){return(0,F.jsx)(`button`,{type:`button`,className:P(Se({variant:e}),t),...n})}var Ce={blue:`border-accent-blue-edge`,amber:`border-accent-amber-edge`,strong:`border-border-strong`};function we({tone:e=`strong`,className:t,...n}){return(0,F.jsx)(`div`,{className:P(`flex min-h-0 min-w-0 flex-col overflow-clip rounded-xl border bg-surface-card`,Ce[e],t),...n})}function Te({title:e,kind:t,lead:n,className:r}){return(0,F.jsxs)(`div`,{className:P(`flex h-[38px] shrink-0 items-center gap-2 border-b border-border-default px-3`,r),children:[n,(0,F.jsx)(`span`,{className:`block min-w-0 flex-1 truncate font-sans text-[13px] font-medium leading-normal text-text-primary`,children:e}),t!=null&&(0,F.jsx)(`span`,{className:`block font-sans text-xs leading-normal text-accent-blue-text`,children:t})]})}function Ee({className:e,...t}){return(0,F.jsx)(`div`,{className:P(`flex flex-wrap items-center gap-2 px-2.5 pt-0 pb-2.5`,e),...t})}function De({tone:e}){let t={blue:`bg-accent-blue`,amber:`bg-accent-amber`,muted:`bg-text-secondary`,red:`bg-accent-amber`}[e];return(0,F.jsx)(`span`,{"aria-hidden":!0,className:P(`block size-1.5 shrink-0 rounded-full`,t)})}function Oe({label:e,onRemove:t}){return(0,F.jsxs)(`span`,{className:`flex h-[22px] max-w-full items-center gap-1 rounded-md bg-accent-blue-glow px-2`,children:[(0,F.jsx)(`span`,{className:`block truncate font-sans text-[11px] leading-normal text-accent-blue-text`,children:e}),t&&(0,F.jsx)(`button`,{type:`button`,"aria-label":`Remove ${e}`,onClick:t,className:`font-sans text-[11px] leading-none text-accent-blue-text/70 hover:text-accent-blue-text`,children:`×`})]})}function ke({children:e,...t}){return(0,F.jsx)(`button`,{type:`button`,className:`flex h-7 items-center rounded-full border border-border-strong px-2.5 font-sans text-xs leading-normal text-text-primary hover:bg-surface-hover`,...t,children:e})}var Ae={brief:`Brief`,creative_direction:`Direction`,script:`Script`,storyboard:`Storyboard`,reference_analysis:`Reference`,styleframes:`Styleframes`,asset_plan:`Assets`,scene_alternatives:`Refinement`,revision_proposal:`Proposal`,render_report:`Render`};function je({a:e}){return e.status===`approved`?(0,F.jsxs)(`span`,{className:`font-sans text-xs text-accent-blue-text`,children:[`Approved v`,e.approved_version]}):e.status===`rejected`?(0,F.jsx)(`span`,{className:`font-sans text-xs text-text-secondary`,children:`Rejected`}):(0,F.jsx)(`span`,{className:`font-sans text-xs text-accent-blue-text`,children:Ae[e.kind]??e.kind})}function Me({src:e,alt:t,selected:n,height:r,letter:i,onClick:a}){return(0,F.jsxs)(`button`,{type:`button`,onClick:a,"aria-pressed":n,"aria-label":t,className:P(`relative block w-full min-w-0 overflow-clip rounded-md bg-scene-ground`,r,n?`shadow-[0px_0px_0px_2px_var(--color-accent-blue)]`:`shadow-[0px_0px_0px_1px_var(--color-border-strong)]`),children:[e?(0,F.jsx)(`img`,{src:e,alt:``,className:`absolute inset-0 size-full object-cover`,loading:`lazy`,draggable:!1}):(0,F.jsx)(`span`,{className:`mosio-agent-hatch absolute inset-0 block`}),i&&(0,F.jsx)(`span`,{className:P(`absolute top-[5px] left-[5px] flex size-4 items-center justify-center rounded-full`,n?`bg-accent-blue`:`bg-surface-card`),children:(0,F.jsx)(`span`,{className:`font-sans text-[10px] leading-normal font-semibold text-text-on-accent`,children:i})})]})}function Ne({artifact:e,actions:t,mediaUrl:n}){let r=e.data,i=Array.isArray(r.options)?r.options:[],[a,o]=(0,N.useState)(null),s=a??e.selected??i[0]?.id??null,c=!/caption|placement|refine/i.test(e.title)&&i.every(e=>e.label.length<18),l=!c,u=i.find(e=>e.id===s),d=e.status===`approved`;return(0,F.jsxs)(we,{tone:c?`strong`:`blue`,"data-testid":`artifact-scene-alternatives`,"data-status":e.status,children:[(0,F.jsx)(Te,{title:e.title,kind:d?(0,F.jsx)(je,{a:e}):c?`Asset`:`Refinement`}),(0,F.jsx)(`div`,{className:`grid grid-cols-3 gap-2 p-2.5`,children:i.map((r,i)=>{let a=r.id===s;return(0,F.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-1.5`,children:[(0,F.jsx)(Me,{src:r.image?n(r.image.uri):``,alt:r.label,selected:a,height:c?`h-24`:`h-[150px]`,letter:l?String.fromCharCode(65+i):void 0,onClick:d?void 0:()=>{o(r.id),t.onSelectOption(e.id,r.id)}}),(0,F.jsx)(`span`,{className:P(`block font-sans text-xs leading-[1.3]`,a?`font-medium text-text-primary`:`text-text-secondary`),children:r.label})]},r.id)})}),!d&&u&&(0,F.jsxs)(Ee,{children:[(0,F.jsx)(L,{variant:`primary`,onClick:()=>t.onApproveArtifact(e.id,e.version),children:l?`Apply ${String.fromCharCode(65+i.indexOf(u))}`:`Use ${u.label.toLowerCase()}`}),t.onPreviewOption&&(0,F.jsx)(L,{variant:`ghost`,onClick:()=>t.onPreviewOption(e,u.id),children:`Preview in player`})]})]})}function Pe({title:e,meta:t,onOpen:n}){return(0,F.jsxs)(`button`,{type:`button`,onClick:n,className:`flex h-11 w-full items-center gap-2.5 rounded-xl border border-accent-blue-edge bg-accent-blue-glow px-3 text-left hover:brightness-125`,children:[(0,F.jsx)(`span`,{className:`block size-[15px] shrink-0 text-accent-blue-text`,children:(0,F.jsx)(_e,{})}),(0,F.jsxs)(`span`,{className:`flex min-w-0 flex-1 flex-col`,children:[(0,F.jsx)(`span`,{className:`block truncate font-sans text-[13px] leading-normal font-medium text-text-primary`,children:e}),(0,F.jsx)(`span`,{className:`block truncate font-sans text-xs leading-normal text-text-secondary`,children:t})]})]})}function Fe({artifact:e,actions:t,mediaUrl:n}){let r=e.data.frames??[],i=r.reduce((e,t)=>e+(t.duration_s??0),0),a=e.status!==`proposed`&&e.status!==`draft`;return t.onOpenArtifact?(0,F.jsx)(`div`,{"data-testid":`artifact-storyboard`,"data-status":e.status,children:(0,F.jsx)(Pe,{title:e.title,meta:`Open in workspace · ${r.length} frames${i?` · ${i.toFixed(1)} s`:``}${e.status===`approved`?` · approved`:e.status===`rejected`?` · changes requested`:` · v${e.version}`}`,onOpen:()=>t.onOpenArtifact(e)})}):(0,F.jsxs)(`div`,{className:`flex flex-col gap-2`,"data-testid":`artifact-storyboard`,"data-status":e.status,children:[(0,F.jsx)(Pe,{title:e.title,meta:`${r.length} frames${i?` · ${i.toFixed(1)} s`:``} · v${e.version}${e.status===`approved`?` · approved`:``}`}),(0,F.jsxs)(we,{tone:`strong`,children:[(0,F.jsx)(`div`,{className:`grid grid-cols-3 gap-2 p-2.5`,children:r.map((r,i)=>(0,F.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-1.5`,children:[(0,F.jsx)(Me,{src:r.image?n(r.image.uri):``,alt:r.title,selected:e.selected===r.id,height:`h-24`,onClick:()=>t.onSelectOption(e.id,r.id)}),(0,F.jsxs)(`span`,{className:`block truncate font-sans text-xs leading-normal font-medium text-text-primary`,children:[i+1,`. `,r.title]})]},r.id))}),!a&&(0,F.jsxs)(Ee,{children:[(0,F.jsx)(L,{variant:`primary`,onClick:()=>t.onApproveArtifact(e.id,e.version),children:`Approve storyboard`}),(0,F.jsx)(L,{variant:`ghost`,onClick:()=>t.onRejectArtifact(e.id),children:`Request changes`})]})]})]})}function Ie({k:e,v:t}){return t==null||t===``||Array.isArray(t)&&t.length===0?null:(0,F.jsxs)(`div`,{className:`flex flex-col gap-0.5 px-3`,children:[(0,F.jsx)(`span`,{className:`font-sans text-[11px] text-text-secondary`,children:e}),(0,F.jsx)(`span`,{className:`font-sans text-xs leading-[1.4] break-words whitespace-pre-wrap text-text-primary`,children:Array.isArray(t)?t.join(` · `):typeof t==`object`?JSON.stringify(t):String(t)})]})}function Le({a:e}){let t=e.data;switch(e.kind){case`brief`:{let e=t,n=e.format;return(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(Ie,{k:`Goal`,v:e.goal}),(0,F.jsx)(Ie,{k:`Audience`,v:e.audience}),(0,F.jsx)(Ie,{k:`Message`,v:e.message}),(0,F.jsx)(Ie,{k:`Call to action`,v:e.call_to_action}),(0,F.jsx)(Ie,{k:`Tone`,v:e.tone}),(0,F.jsx)(Ie,{k:`Format`,v:n?[n.width&&n.height?`${n.width}×${n.height}`:null,n.fps?`${n.fps} fps`:null,n.duration_s?`${n.duration_s} s`:null].filter(Boolean):null})]})}case`creative_direction`:return(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(Ie,{k:`Direction`,v:t.summary}),Array.isArray(t.palette)&&(0,F.jsx)(`div`,{className:`flex gap-1 px-3`,children:t.palette.map(e=>(0,F.jsx)(`span`,{title:e,className:`block size-5 rounded-md border border-border-strong`,style:{background:/^#[0-9a-fA-F]{3,8}$/.test(e)?e:`transparent`}},e))}),(0,F.jsx)(Ie,{k:`Motion`,v:t.motion})]});case`script`:return(0,F.jsx)(`ol`,{className:`flex flex-col gap-1 px-3`,children:(t.beats??[]).map((e,t)=>(0,F.jsxs)(`li`,{className:`font-sans text-xs leading-[1.4] text-text-primary`,children:[(0,F.jsxs)(`span`,{className:`text-text-secondary`,children:[t+1,`.`]}),` `,e.on_screen,e.voiceover&&(0,F.jsxs)(`span`,{className:`block text-text-secondary`,children:[`VO: `,e.voiceover]})]},e.id))});case`asset_plan`:return(0,F.jsx)(`div`,{className:`flex flex-col`,children:(t.assets??[]).map(e=>(0,F.jsxs)(`div`,{className:`flex min-h-[26px] items-center gap-2 px-3`,children:[(0,F.jsx)(`span`,{className:`flex-1 truncate font-sans text-xs text-text-primary`,children:e.description}),(0,F.jsx)(`span`,{className:`font-sans text-xs text-text-secondary`,children:e.status})]},e.id))});default:return(0,F.jsx)(F.Fragment,{children:Object.entries(t).slice(0,8).map(([e,t])=>(0,F.jsx)(Ie,{k:e.replace(/_/g,` `),v:t},e))})}}function Re({artifact:e,actions:t}){let n=e.status===`proposed`||e.status===`draft`;return(0,F.jsxs)(we,{tone:n?`blue`:`strong`,"data-testid":`artifact-${e.kind}`,"data-status":e.status,children:[(0,F.jsx)(Te,{title:e.title,kind:(0,F.jsx)(je,{a:e})}),(0,F.jsx)(`div`,{className:`flex flex-col gap-2 py-2.5`,children:(0,F.jsx)(Le,{a:e})}),n&&(0,F.jsxs)(Ee,{children:[(0,F.jsx)(L,{variant:`primary`,onClick:()=>t.onApproveArtifact(e.id,e.version),children:`Approve`}),t.onOpenArtifact&&(0,F.jsx)(L,{variant:`outline`,onClick:()=>t.onOpenArtifact(e),children:`Edit`}),(0,F.jsx)(L,{variant:`ghost`,onClick:()=>t.onRejectArtifact(e.id),children:`Reject`})]})]})}function ze({artifact:e,actions:t,mediaUrl:n}){switch(e.kind){case`scene_alternatives`:case`styleframes`:if(e.kind===`styleframes`){let r=(e.data.frames??[]).map(e=>({id:e.id,label:e.title,image:e.image}));return(0,F.jsx)(Ne,{artifact:{...e,data:{question:e.title,options:r}},actions:t,mediaUrl:n})}return(0,F.jsx)(Ne,{artifact:e,actions:t,mediaUrl:n});case`storyboard`:return(0,F.jsx)(Fe,{artifact:e,actions:t,mediaUrl:n});default:return(0,F.jsx)(Re,{artifact:e,actions:t})}}function Be(e,t){let n=t||{};return(e[e.length-1]===``?[...e,``]:e).join((n.padRight?` `:``)+`,`+(n.padLeft===!1?``:` `)).trim()}var Ve=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,He=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Ue={};function We(e,t){return((t||Ue).jsx?He:Ve).test(e)}var Ge=/[ \t\n\f\r]/g;function Ke(e){return typeof e==`object`?e.type===`text`&&qe(e.value):qe(e)}function qe(e){return e.replace(Ge,``)===``}var Je=class{constructor(e,t,n){this.normal=t,this.property=e,n&&(this.space=n)}};Je.prototype.normal={},Je.prototype.property={},Je.prototype.space=void 0;function Ye(e,t){let n={},r={};for(let t of e)Object.assign(n,t.property),Object.assign(r,t.normal);return new Je(n,r,t)}function Xe(e){return e.toLowerCase()}var R=class{constructor(e,t){this.attribute=t,this.property=e}};R.prototype.attribute=``,R.prototype.booleanish=!1,R.prototype.boolean=!1,R.prototype.commaOrSpaceSeparated=!1,R.prototype.commaSeparated=!1,R.prototype.defined=!1,R.prototype.mustUseProperty=!1,R.prototype.number=!1,R.prototype.overloadedBoolean=!1,R.prototype.property=``,R.prototype.spaceSeparated=!1,R.prototype.space=void 0;var Ze=c({boolean:()=>z,booleanish:()=>B,commaOrSpaceSeparated:()=>U,commaSeparated:()=>et,number:()=>V,overloadedBoolean:()=>$e,spaceSeparated:()=>H}),Qe=0,z=tt(),B=tt(),$e=tt(),V=tt(),H=tt(),et=tt(),U=tt();function tt(){return 2**++Qe}var nt=Object.keys(Ze),rt=class extends R{constructor(e,t,n,r){let i=-1;if(super(e,t),it(this,`space`,r),typeof n==`number`)for(;++i<nt.length;){let e=nt[i];it(this,nt[i],(n&Ze[e])===Ze[e])}}};rt.prototype.defined=!0;function it(e,t,n){n&&(e[t]=n)}function at(e){let t={},n={};for(let[r,i]of Object.entries(e.properties)){let a=new rt(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(a.mustUseProperty=!0),t[r]=a,n[Xe(r)]=r,n[Xe(a.attribute)]=r}return new Je(t,n,e.space)}var ot=at({properties:{ariaActiveDescendant:null,ariaAtomic:B,ariaAutoComplete:null,ariaBusy:B,ariaChecked:B,ariaColCount:V,ariaColIndex:V,ariaColSpan:V,ariaControls:H,ariaCurrent:null,ariaDescribedBy:H,ariaDetails:null,ariaDisabled:B,ariaDropEffect:H,ariaErrorMessage:null,ariaExpanded:B,ariaFlowTo:H,ariaGrabbed:B,ariaHasPopup:null,ariaHidden:B,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:H,ariaLevel:V,ariaLive:null,ariaModal:B,ariaMultiLine:B,ariaMultiSelectable:B,ariaOrientation:null,ariaOwns:H,ariaPlaceholder:null,ariaPosInSet:V,ariaPressed:B,ariaReadOnly:B,ariaRelevant:null,ariaRequired:B,ariaRoleDescription:H,ariaRowCount:V,ariaRowIndex:V,ariaRowSpan:V,ariaSelected:B,ariaSetSize:V,ariaSort:null,ariaValueMax:V,ariaValueMin:V,ariaValueNow:V,ariaValueText:null,role:null},transform(e,t){return t===`role`?t:`aria-`+t.slice(4).toLowerCase()}});function st(e,t){return t in e?e[t]:t}function ct(e,t){return st(e,t.toLowerCase())}var lt=at({attributes:{acceptcharset:`accept-charset`,classname:`class`,htmlfor:`for`,httpequiv:`http-equiv`},mustUseProperty:[`checked`,`multiple`,`muted`,`selected`],properties:{abbr:null,accept:et,acceptCharset:H,accessKey:H,action:null,allow:null,allowFullScreen:z,allowPaymentRequest:z,allowUserMedia:z,alpha:z,alt:null,as:null,async:z,autoCapitalize:null,autoComplete:H,autoFocus:z,autoPlay:z,blocking:H,capture:null,charSet:null,checked:z,cite:null,className:H,closedBy:null,colorSpace:null,cols:V,colSpan:V,command:null,commandFor:null,content:null,contentEditable:B,controls:z,controlsList:H,coords:V|et,crossOrigin:null,data:null,dateTime:null,decoding:null,default:z,defer:z,dir:null,dirName:null,disabled:z,download:$e,draggable:B,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:z,formTarget:null,headers:H,height:V,hidden:$e,high:V,href:null,hrefLang:null,htmlFor:H,httpEquiv:H,id:null,imageSizes:null,imageSrcSet:null,inert:z,inputMode:null,integrity:null,is:null,isMap:z,itemId:null,itemProp:H,itemRef:H,itemScope:z,itemType:H,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:z,low:V,manifest:null,max:null,maxLength:V,media:null,method:null,min:null,minLength:V,multiple:z,muted:z,name:null,nonce:null,noModule:z,noValidate:z,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:z,optimum:V,pattern:null,ping:H,placeholder:null,playsInline:z,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:z,referrerPolicy:null,rel:H,required:z,reversed:z,rows:V,rowSpan:V,sandbox:H,scope:null,scoped:z,seamless:z,selected:z,shadowRootClonable:z,shadowRootCustomElementRegistry:z,shadowRootDelegatesFocus:z,shadowRootMode:null,shadowRootSerializable:z,shape:null,size:V,sizes:null,slot:null,span:V,spellCheck:B,src:null,srcDoc:null,srcLang:null,srcSet:null,start:V,step:null,style:null,tabIndex:V,target:null,title:null,translate:null,type:null,typeMustMatch:z,useMap:null,value:B,width:V,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:H,axis:null,background:null,bgColor:null,border:V,borderColor:null,bottomMargin:V,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:z,declare:z,event:null,face:null,frame:null,frameBorder:null,hSpace:V,leftMargin:V,link:null,longDesc:null,lowSrc:null,marginHeight:V,marginWidth:V,noResize:z,noHref:z,noShade:z,noWrap:z,object:null,profile:null,prompt:null,rev:null,rightMargin:V,rules:null,scheme:null,scrolling:B,standby:null,summary:null,text:null,topMargin:V,valueType:null,version:null,vAlign:null,vLink:null,vSpace:V,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:z,disablePictureInPicture:z,disableRemotePlayback:z,exportParts:et,part:H,prefix:null,property:null,results:V,security:null,unselectable:null},space:`html`,transform:ct}),ut=at({attributes:{accentHeight:`accent-height`,alignmentBaseline:`alignment-baseline`,arabicForm:`arabic-form`,baselineShift:`baseline-shift`,capHeight:`cap-height`,className:`class`,clipPath:`clip-path`,clipRule:`clip-rule`,colorInterpolation:`color-interpolation`,colorInterpolationFilters:`color-interpolation-filters`,colorProfile:`color-profile`,colorRendering:`color-rendering`,crossOrigin:`crossorigin`,dataType:`datatype`,dominantBaseline:`dominant-baseline`,enableBackground:`enable-background`,fillOpacity:`fill-opacity`,fillRule:`fill-rule`,floodColor:`flood-color`,floodOpacity:`flood-opacity`,fontFamily:`font-family`,fontSize:`font-size`,fontSizeAdjust:`font-size-adjust`,fontStretch:`font-stretch`,fontStyle:`font-style`,fontVariant:`font-variant`,fontWeight:`font-weight`,glyphName:`glyph-name`,glyphOrientationHorizontal:`glyph-orientation-horizontal`,glyphOrientationVertical:`glyph-orientation-vertical`,hrefLang:`hreflang`,horizAdvX:`horiz-adv-x`,horizOriginX:`horiz-origin-x`,horizOriginY:`horiz-origin-y`,imageRendering:`image-rendering`,letterSpacing:`letter-spacing`,lightingColor:`lighting-color`,markerEnd:`marker-end`,markerMid:`marker-mid`,markerStart:`marker-start`,maskType:`mask-type`,navDown:`nav-down`,navDownLeft:`nav-down-left`,navDownRight:`nav-down-right`,navLeft:`nav-left`,navNext:`nav-next`,navPrev:`nav-prev`,navRight:`nav-right`,navUp:`nav-up`,navUpLeft:`nav-up-left`,navUpRight:`nav-up-right`,onAbort:`onabort`,onActivate:`onactivate`,onAfterPrint:`onafterprint`,onBeforePrint:`onbeforeprint`,onBegin:`onbegin`,onCancel:`oncancel`,onCanPlay:`oncanplay`,onCanPlayThrough:`oncanplaythrough`,onChange:`onchange`,onClick:`onclick`,onClose:`onclose`,onCopy:`oncopy`,onCueChange:`oncuechange`,onCut:`oncut`,onDblClick:`ondblclick`,onDrag:`ondrag`,onDragEnd:`ondragend`,onDragEnter:`ondragenter`,onDragExit:`ondragexit`,onDragLeave:`ondragleave`,onDragOver:`ondragover`,onDragStart:`ondragstart`,onDrop:`ondrop`,onDurationChange:`ondurationchange`,onEmptied:`onemptied`,onEnd:`onend`,onEnded:`onended`,onError:`onerror`,onFocus:`onfocus`,onFocusIn:`onfocusin`,onFocusOut:`onfocusout`,onHashChange:`onhashchange`,onInput:`oninput`,onInvalid:`oninvalid`,onKeyDown:`onkeydown`,onKeyPress:`onkeypress`,onKeyUp:`onkeyup`,onLoad:`onload`,onLoadedData:`onloadeddata`,onLoadedMetadata:`onloadedmetadata`,onLoadStart:`onloadstart`,onMessage:`onmessage`,onMouseDown:`onmousedown`,onMouseEnter:`onmouseenter`,onMouseLeave:`onmouseleave`,onMouseMove:`onmousemove`,onMouseOut:`onmouseout`,onMouseOver:`onmouseover`,onMouseUp:`onmouseup`,onMouseWheel:`onmousewheel`,onOffline:`onoffline`,onOnline:`ononline`,onPageHide:`onpagehide`,onPageShow:`onpageshow`,onPaste:`onpaste`,onPause:`onpause`,onPlay:`onplay`,onPlaying:`onplaying`,onPopState:`onpopstate`,onProgress:`onprogress`,onRateChange:`onratechange`,onRepeat:`onrepeat`,onReset:`onreset`,onResize:`onresize`,onScroll:`onscroll`,onSeeked:`onseeked`,onSeeking:`onseeking`,onSelect:`onselect`,onShow:`onshow`,onStalled:`onstalled`,onStorage:`onstorage`,onSubmit:`onsubmit`,onSuspend:`onsuspend`,onTimeUpdate:`ontimeupdate`,onToggle:`ontoggle`,onUnload:`onunload`,onVolumeChange:`onvolumechange`,onWaiting:`onwaiting`,onZoom:`onzoom`,overlinePosition:`overline-position`,overlineThickness:`overline-thickness`,paintOrder:`paint-order`,panose1:`panose-1`,pointerEvents:`pointer-events`,referrerPolicy:`referrerpolicy`,renderingIntent:`rendering-intent`,shapeRendering:`shape-rendering`,stopColor:`stop-color`,stopOpacity:`stop-opacity`,strikethroughPosition:`strikethrough-position`,strikethroughThickness:`strikethrough-thickness`,strokeDashArray:`stroke-dasharray`,strokeDashOffset:`stroke-dashoffset`,strokeLineCap:`stroke-linecap`,strokeLineJoin:`stroke-linejoin`,strokeMiterLimit:`stroke-miterlimit`,strokeOpacity:`stroke-opacity`,strokeWidth:`stroke-width`,tabIndex:`tabindex`,textAnchor:`text-anchor`,textDecoration:`text-decoration`,textRendering:`text-rendering`,transformOrigin:`transform-origin`,typeOf:`typeof`,underlinePosition:`underline-position`,underlineThickness:`underline-thickness`,unicodeBidi:`unicode-bidi`,unicodeRange:`unicode-range`,unitsPerEm:`units-per-em`,vAlphabetic:`v-alphabetic`,vHanging:`v-hanging`,vIdeographic:`v-ideographic`,vMathematical:`v-mathematical`,vectorEffect:`vector-effect`,vertAdvY:`vert-adv-y`,vertOriginX:`vert-origin-x`,vertOriginY:`vert-origin-y`,wordSpacing:`word-spacing`,writingMode:`writing-mode`,xHeight:`x-height`,playbackOrder:`playbackorder`,timelineBegin:`timelinebegin`},properties:{about:U,accentHeight:V,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:V,amplitude:V,arabicForm:null,ascent:V,attributeName:null,attributeType:null,azimuth:V,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:V,by:null,calcMode:null,capHeight:V,className:H,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:V,diffuseConstant:V,direction:null,display:null,dur:null,divisor:V,dominantBaseline:null,download:z,dx:null,dy:null,edgeMode:null,editable:null,elevation:V,enableBackground:null,end:null,event:null,exponent:V,externalResourcesRequired:null,fill:null,fillOpacity:V,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:et,g2:et,glyphName:et,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:V,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:V,horizOriginX:V,horizOriginY:V,id:null,ideographic:V,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:V,k:V,k1:V,k2:V,k3:V,k4:V,kernelMatrix:U,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:V,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskType:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:V,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:V,overlineThickness:V,paintOrder:null,panose1:null,path:null,pathLength:V,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:H,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:V,pointsAtY:V,pointsAtZ:V,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:U,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:U,rev:U,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:U,requiredFeatures:U,requiredFonts:U,requiredFormats:U,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:V,specularExponent:V,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:V,strikethroughThickness:V,string:null,stroke:null,strokeDashArray:U,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:V,strokeOpacity:V,strokeWidth:null,style:null,surfaceScale:V,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:U,tabIndex:V,tableValues:null,target:null,targetX:V,targetY:V,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:U,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:V,underlineThickness:V,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:V,values:null,vAlphabetic:V,vMathematical:V,vectorEffect:null,vHanging:V,vIdeographic:V,version:null,vertAdvY:V,vertOriginX:V,vertOriginY:V,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:V,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:`svg`,transform:st}),dt=at({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:`xlink`,transform(e,t){return`xlink:`+t.slice(5).toLowerCase()}}),ft=at({attributes:{xmlnsxlink:`xmlns:xlink`},properties:{xmlnsXLink:null,xmlns:null},space:`xmlns`,transform:ct}),pt=at({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:`xml`,transform(e,t){return`xml:`+t.slice(3).toLowerCase()}}),mt={classId:`classID`,dataType:`datatype`,itemId:`itemID`,strokeDashArray:`strokeDasharray`,strokeDashOffset:`strokeDashoffset`,strokeLineCap:`strokeLinecap`,strokeLineJoin:`strokeLinejoin`,strokeMiterLimit:`strokeMiterlimit`,typeOf:`typeof`,xLinkActuate:`xlinkActuate`,xLinkArcRole:`xlinkArcrole`,xLinkHref:`xlinkHref`,xLinkRole:`xlinkRole`,xLinkShow:`xlinkShow`,xLinkTitle:`xlinkTitle`,xLinkType:`xlinkType`,xmlnsXLink:`xmlnsXlink`},ht=/[A-Z]/g,gt=/-[a-z]/g,_t=/^data[-\w.:]+$/i;function vt(e,t){let n=Xe(t),r=t,i=R;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)===`data`&&_t.test(t)){if(t.charAt(4)===`-`){let e=t.slice(5).replace(gt,bt);r=`data`+e.charAt(0).toUpperCase()+e.slice(1)}else{let e=t.slice(4);if(!gt.test(e)){let n=e.replace(ht,yt);n.charAt(0)!==`-`&&(n=`-`+n),t=`data`+n}}i=rt}return new i(r,t)}function yt(e){return`-`+e.toLowerCase()}function bt(e){return e.charAt(1).toUpperCase()}var xt=Ye([ot,lt,dt,ft,pt],`html`),St=Ye([ot,ut,dt,ft,pt],`svg`);function Ct(e){return e.join(` `).trim()}var wt=/\/\*(?:[^*]|\*(?!\/))*\*\//g,Tt=/\n/g,Et=/^\s*/,Dt=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,Ot=/^:\s*/,kt=/^((?:'(?:\\.|[^'\\])*'|"(?:\\.|[^"\\])*"|url\((?:'(?:\\.|[^'\\])*'|"(?:\\.|[^"\\])*"|[^)]*)\)|[^};])+)/,At=/^[;\s]*/,jt=`
3
3
  `,Mt=`/`,Nt=`*`,Pt=``,Ft=`comment`,It=`declaration`;function Lt(e,t){if(typeof e!=`string`)throw TypeError(`First argument must be a string`);if(!e)return[];t||={};var n=1,r=1;function i(e){var t=e.match(Tt);t&&(n+=t.length);var i=e.lastIndexOf(jt);r=~i?e.length-i:r+e.length}function a(){var e={line:n,column:r};return function(t){return t.position=new o(e),l(),t}}function o(e){this.start=e,this.end={line:n,column:r},this.source=t.source}o.prototype.content=e;function s(i){var a=Error(t.source+`:`+n+`:`+r+`: `+i);if(a.reason=i,a.filename=t.source,a.line=n,a.column=r,a.source=e,!t.silent)throw a}function c(t){var n=t.exec(e);if(n){var r=n[0];return i(r),e=e.slice(r.length),n}}function l(){c(Et)}function u(e){for(var t;t=d();)e.push(t);return e}function d(){var t=a();if(Mt==e.charAt(0)&&Nt==e.charAt(1)){for(var n=2;Pt!=e.charAt(n)&&(Nt!=e.charAt(n)||Mt!=e.charAt(n+1));)++n;if(n+=2,Pt===e.charAt(n-1))return s(`End of comment missing`);var o=e.slice(2,n-2);return r+=2,i(o),e=e.slice(n),r+=2,t({type:Ft,comment:o})}}function f(){var e=a(),t=c(Dt);if(t){if(d(),!c(Ot))return s(`property missing ':'`);var n=c(kt),r=e({type:It,property:t[0].replace(wt,Pt).trim(),value:n?n[0].replace(wt,Pt).trim():Pt});return c(At),r}}function p(){var e=[];u(e);for(var t;t=f();)e.push(t),u(e);return e}return l(),p()}function Rt(e,t){let n=null;if(!e||typeof e!=`string`)return n;let r=Lt(e),i=typeof t==`function`;return r.forEach(e=>{if(e.type!==`declaration`)return;let{property:r,value:a}=e;i?t(r,a,e):a&&(n??={},n[r]=a)}),n}var zt=Vt(`end`),Bt=Vt(`start`);function Vt(e){return t;function t(t){let n=t&&t.position&&t.position[e]||{};if(typeof n.line==`number`&&n.line>0&&typeof n.column==`number`&&n.column>0)return{line:n.line,column:n.column,offset:typeof n.offset==`number`&&n.offset>-1?n.offset:void 0}}}function Ht(e){let t=Bt(e),n=zt(e);if(t&&n)return{start:t,end:n}}function Ut(e){return!e||typeof e!=`object`?``:`position`in e||`type`in e?Gt(e.position):`start`in e||`end`in e?Gt(e):`line`in e||`column`in e?Wt(e):``}function Wt(e){return Kt(e&&e.line)+`:`+Kt(e&&e.column)}function Gt(e){return Wt(e&&e.start)+`-`+Wt(e&&e.end)}function Kt(e){return e&&typeof e==`number`?e:1}var qt=class extends Error{constructor(e,t,n){super(),typeof t==`string`&&(n=t,t=void 0);let r=``,i={},a=!1;if(t&&(i=`line`in t&&`column`in t||`start`in t&&`end`in t?{place:t}:`type`in t?{ancestors:[t],place:t.position}:{...t}),typeof e==`string`?r=e:!i.cause&&e&&(a=!0,r=e.message,i.cause=e),!i.ruleId&&!i.source&&typeof n==`string`){let e=n.indexOf(`:`);e===-1?i.ruleId=n:(i.source=n.slice(0,e),i.ruleId=n.slice(e+1))}if(!i.place&&i.ancestors){let e=i.ancestors[i.ancestors.length-1];e&&(i.place=e.position)}let o=i.place&&`start`in i.place?i.place.start:i.place;this.ancestors=i.ancestors||void 0,this.cause=i.cause||void 0,this.column=o?o.column:void 0,this.fatal=void 0,this.file=``,this.message=r,this.line=o?o.line:void 0,this.name=Ut(i.place)||`1:1`,this.place=i.place||void 0,this.reason=this.message,this.ruleId=i.ruleId||void 0,this.source=i.source||void 0,this.stack=a&&i.cause&&typeof i.cause.stack==`string`?i.cause.stack:``,this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}};Object.defineProperties(qt.prototype,{file:{configurable:!0,enumerable:!0,value:``,writable:!0},name:{configurable:!0,enumerable:!0,value:``,writable:!0},reason:{configurable:!0,enumerable:!0,value:``,writable:!0},message:{configurable:!0,enumerable:!0,value:``,writable:!0},stack:{configurable:!0,enumerable:!0,value:``,writable:!0},column:{configurable:!0,enumerable:!0,writable:!0},line:{configurable:!0,enumerable:!0,writable:!0},ancestors:{configurable:!0,enumerable:!0,writable:!0},cause:{configurable:!0,enumerable:!0,writable:!0},fatal:{configurable:!0,enumerable:!0,writable:!0},place:{configurable:!0,enumerable:!0,writable:!0},ruleId:{configurable:!0,enumerable:!0,writable:!0},source:{configurable:!0,enumerable:!0,writable:!0}});var Jt={}.hasOwnProperty,Yt=new Map,Xt=/[A-Z]/g,Zt=/-([a-z])/g,Qt=new Set([`table`,`tbody`,`thead`,`tfoot`,`tr`]),$t=new Set([`td`,`th`]),en=`https://github.com/syntax-tree/hast-util-to-jsx-runtime`;function tn(e,t){if(!t||t.Fragment===void 0)throw TypeError("Expected `Fragment` in options");let n=t.filePath||void 0,r;if(t.development){if(typeof t.jsxDEV!=`function`)throw TypeError("Expected `jsxDEV` in options when `development: true`");r=pn(n,t.jsxDEV)}else{if(typeof t.jsx!=`function`)throw TypeError("Expected `jsx` in production options");if(typeof t.jsxs!=`function`)throw TypeError("Expected `jsxs` in production options");r=fn(n,t.jsx,t.jsxs)}let i={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||`react`,evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space===`svg`?St:xt,stylePropertyNameCase:t.stylePropertyNameCase||`dom`,tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},a=nn(i,e,void 0);return a&&typeof a!=`string`?a:i.create(e,i.Fragment,{children:a||void 0},void 0)}function nn(e,t,n){if(t.type===`element`)return rn(e,t,n);if(t.type===`mdxFlowExpression`||t.type===`mdxTextExpression`)return an(e,t);if(t.type===`mdxJsxFlowElement`||t.type===`mdxJsxTextElement`)return sn(e,t,n);if(t.type===`mdxjsEsm`)return on(e,t);if(t.type===`root`)return cn(e,t,n);if(t.type===`text`)return ln(e,t)}function rn(e,t,n){let r=e.schema,i=r;t.tagName.toLowerCase()===`svg`&&r.space===`html`&&(i=St,e.schema=i),e.ancestors.push(t);let a=yn(e,t.tagName,!1),o=mn(e,t),s=gn(e,t);return Qt.has(t.tagName)&&(s=s.filter(function(e){return typeof e!=`string`||!Ke(e)})),un(e,o,a,t),dn(o,s),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function an(e,t){if(t.data&&t.data.estree&&e.evaluater){let n=t.data.estree.body[0];return n.type,e.evaluater.evaluateExpression(n.expression)}bn(e,t.position)}function on(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);bn(e,t.position)}function sn(e,t,n){let r=e.schema,i=r;t.name===`svg`&&r.space===`html`&&(i=St,e.schema=i),e.ancestors.push(t);let a=t.name===null?e.Fragment:yn(e,t.name,!0),o=hn(e,t),s=gn(e,t);return un(e,o,a,t),dn(o,s),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function cn(e,t,n){let r={};return dn(r,gn(e,t)),e.create(t,e.Fragment,r,n)}function ln(e,t){return t.value}function un(e,t,n,r){typeof n!=`string`&&n!==e.Fragment&&e.passNode&&(t.node=r)}function dn(e,t){if(t.length>0){let n=t.length>1?t:t[0];n&&(e.children=n)}}function fn(e,t,n){return r;function r(e,r,i,a){let o=Array.isArray(i.children)?n:t;return a?o(r,i,a):o(r,i)}}function pn(e,t){return n;function n(n,r,i,a){let o=Array.isArray(i.children),s=Bt(n);return t(r,i,a,o,{columnNumber:s?s.column-1:void 0,fileName:e,lineNumber:s?s.line:void 0},void 0)}}function mn(e,t){let n={},r,i;for(i in t.properties)if(i!==`children`&&Jt.call(t.properties,i)){let a=_n(e,i,t.properties[i]);if(a){let[i,o]=a;e.tableCellAlignToStyle&&i===`align`&&typeof o==`string`&&$t.has(t.tagName)?r=o:n[i]=o}}if(r){let t=n.style||={};t[e.stylePropertyNameCase===`css`?`text-align`:`textAlign`]=r}return n}function hn(e,t){let n={};for(let r of t.attributes)if(r.type===`mdxJsxExpressionAttribute`){if(r.data&&r.data.estree&&e.evaluater){let t=r.data.estree.body[0];t.type;let i=t.expression;i.type;let a=i.properties[0];a.type,Object.assign(n,e.evaluater.evaluateExpression(a.argument))}else bn(e,t.position)}else{let{name:i}=r,a;if(r.value&&typeof r.value==`object`){if(r.value.data&&r.value.data.estree&&e.evaluater){let t=r.value.data.estree.body[0];t.type,a=e.evaluater.evaluateExpression(t.expression)}else bn(e,t.position)}else a=r.value===null||r.value;n[i]=a}return n}function gn(e,t){let n=[],r=-1,i=e.passKeys?new Map:Yt;for(;++r<t.children.length;){let a=t.children[r],o;if(e.passKeys){let e=a.type===`element`?a.tagName:a.type===`mdxJsxFlowElement`||a.type===`mdxJsxTextElement`?a.name:void 0;if(e){let t=i.get(e)||0;o=e+`-`+t,i.set(e,t+1)}}let s=nn(e,a,o);s!==void 0&&n.push(s)}return n}function _n(e,t,n){if(n==null||typeof n==`number`&&Number.isNaN(n))return;let r=vt(e.schema,t);return Array.isArray(n)&&(n=r.commaSeparated?Be(n):Ct(n)),r.property===`style`?[`style`,typeof n==`object`?e.stylePropertyNameCase===`dom`?n:xn(n):vn(e,String(n))]:[e.elementAttributeNameCase===`react`&&r.space?mt[r.property]||r.property:r.attribute,n]}function vn(e,t){let n={};try{Rt(t,function(t,r){if(t&&r){let i=t;i.slice(0,2)!==`--`&&(i=i.toLowerCase(),e.stylePropertyNameCase===`dom`&&(i.slice(0,4)===`-ms-`&&(i=i.slice(1)),i=i.replace(Zt,wn))),n[i]=r}})}catch(t){if(e.ignoreInvalidStyle)return{};let n=t,r=new qt("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:n,ruleId:`style`,source:`hast-util-to-jsx-runtime`});throw r.file=e.filePath||void 0,r.url=en+`#cannot-parse-style-attribute`,r}return n}function yn(e,t,n){let r;if(!n)r={type:`Literal`,value:t};else if(t.includes(`.`)){let e=t.split(`.`),n=-1,i;for(;++n<e.length;){let t=We(e[n])?{type:`Identifier`,name:e[n]}:{type:`Literal`,value:e[n]};i=i?{type:`MemberExpression`,object:i,property:t,computed:!!(n&&t.type===`Literal`),optional:!1}:t}r=i}else r=We(t)&&!/^[a-z]/.test(t)?{type:`Identifier`,name:t}:{type:`Literal`,value:t};if(r.type===`Literal`){let t=r.value;return Jt.call(e.components,t)?e.components[t]:t}if(e.evaluater)return e.evaluater.evaluateExpression(r);bn(e)}function bn(e,t){let n=new qt("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:`mdx-estree`,source:`hast-util-to-jsx-runtime`});throw n.file=e.filePath||void 0,n.url=en+`#cannot-handle-mdx-estrees-without-createevaluater`,n}function xn(e){let t={},n;for(n in e)Jt.call(e,n)&&(t[Sn(n)]=e[n]);return t}function Sn(e){if(e.slice(0,2)===`--`)return e;let t=e.replace(Xt,Cn);return t.slice(0,3)===`ms-`&&(t=`-`+t),t}function Cn(e){return`-`+e.toLowerCase()}function wn(e,t){return t.toUpperCase()}var Tn={action:[`form`],cite:[`blockquote`,`del`,`ins`,`q`],data:[`object`],formAction:[`button`,`input`],href:[`a`,`area`,`base`,`link`],icon:[`menuitem`],itemId:null,manifest:[`html`],ping:[`a`,`area`],poster:[`video`],src:[`audio`,`embed`,`iframe`,`img`,`input`,`script`,`source`,`track`,`video`]},En={};function Dn(e,t){let n=t||En;return On(e,typeof n.includeImageAlt!=`boolean`||n.includeImageAlt,typeof n.includeHtml!=`boolean`||n.includeHtml)}function On(e,t,n){if(An(e)){if(`value`in e)return e.type===`html`&&!n?``:e.value;if(t&&`alt`in e&&e.alt)return e.alt;if(`children`in e)return kn(e.children,t,n)}return Array.isArray(e)?kn(e,t,n):``}function kn(e,t,n){let r=[],i=-1;for(;++i<e.length;)r[i]=On(e[i],t,n);return r.join(``)}function An(e){return!!(e&&typeof e==`object`)}var jn=document.createElement(`i`);function Mn(e){let t=`&`+e+`;`;jn.innerHTML=t;let n=jn.textContent;return n.charCodeAt(n.length-1)===59&&e!==`semi`?!1:n!==t&&n}function W(e,t,n,r){let i=e.length,a=0,o;if(t=t<0?-t>i?0:i+t:t>i?i:t,n=n>0?n:0,r.length<1e4)o=Array.from(r),o.unshift(t,n),e.splice(...o);else for(n&&e.splice(t,n);a<r.length;)o=r.slice(a,a+1e4),o.unshift(t,0),e.splice(...o),a+=1e4,t+=1e4}function G(e,t){return e.length>0?(W(e,e.length,0,t),e):t}var Nn={}.hasOwnProperty;function Pn(e){let t={},n=-1;for(;++n<e.length;)Fn(t,e[n]);return t}function Fn(e,t){let n;for(n in t){let r=(Nn.call(e,n)?e[n]:void 0)||(e[n]={}),i=t[n],a;if(i)for(a in i){Nn.call(r,a)||(r[a]=[]);let e=i[a];In(r[a],Array.isArray(e)?e:e?[e]:[])}}}function In(e,t){let n=-1,r=[];for(;++n<t.length;)(t[n].add===`after`?e:r).push(t[n]);W(e,0,0,r)}function Ln(e,t){let n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)==65535||(n&65535)==65534||n>1114111?`�`:String.fromCodePoint(n)}function K(e){return e.replace(/[\t\n\r ]+/g,` `).replace(/^ | $/g,``).toLowerCase().toUpperCase()}var q=Gn(/[A-Za-z]/),J=Gn(/[\dA-Za-z]/),Rn=Gn(/[#-'*+\--9=?A-Z^-~]/);function zn(e){return e!==null&&(e<32||e===127)}var Bn=Gn(/\d/),Vn=Gn(/[\dA-Fa-f]/),Hn=Gn(/[!-/:-@[-`{-~]/);function Y(e){return e!==null&&e<-2}function X(e){return e!==null&&(e<0||e===32)}function Z(e){return e===-2||e===-1||e===32}var Un=Gn(/\p{P}|\p{S}/u),Wn=Gn(/\s/);function Gn(e){return t;function t(t){return t!==null&&t>-1&&e.test(String.fromCharCode(t))}}function Kn(e){let t=[],n=-1,r=0,i=0;for(;++n<e.length;){let a=e.charCodeAt(n),o=``;if(a===37&&J(e.charCodeAt(n+1))&&J(e.charCodeAt(n+2)))i=2;else if(a<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(a))||(o=String.fromCharCode(a));else if(a>55295&&a<57344){let t=e.charCodeAt(n+1);a<56320&&t>56319&&t<57344?(o=String.fromCharCode(a,t),i=1):o=`�`}else o=String.fromCharCode(a);o&&=(t.push(e.slice(r,n),encodeURIComponent(o)),r=n+i+1,``),i&&=(n+=i,0)}return t.join(``)+e.slice(r)}function Q(e,t,n,r){let i=r?r-1:1/0,a=0;return o;function o(r){return Z(r)?(e.enter(n),s(r)):t(r)}function s(r){return Z(r)&&a++<i?(e.consume(r),s):(e.exit(n),t(r))}}function qn(e,t,n,r,i,a){let o=0;return s;function s(t){return a>0&&Z(t)?(e.enter(r),c(t)):l(t)}function c(t){return Z(t)&&o<a?(e.consume(t),o++,c):(e.exit(r),l(t))}function l(e){return o>=i?t(e):n(e)}}var Jn={tokenize:Yn};function Yn(e){let t=e.attempt(this.parser.constructs.contentInitial,r,i),n;return t;function r(n){if(n===null)e.consume(n);else return e.enter(`lineEnding`),e.consume(n),e.exit(`lineEnding`),Q(e,t,`linePrefix`)}function i(t){return e.enter(`paragraph`),a(t)}function a(t){let r=e.enter(`chunkText`,{contentType:`text`,previous:n});return n&&(n.next=r),n=r,o(t)}function o(t){if(t===null)e.exit(`chunkText`),e.exit(`paragraph`),e.consume(t);else return Y(t)?(e.consume(t),e.exit(`chunkText`),a):(e.consume(t),o)}}var Xn=class{constructor(){this.index=new Map,this.map=[]}add(e,t,n){Zn(this,e,t,n,!1)}addBefore(e,t,n){Zn(this,e,t,n,!0)}consume(e){if(this.map.sort(function(e,t){return e[0]-t[0]}),this.map.length===0)return;let t=this.map.length,n=[];for(;t>0;)--t,n.push(e.slice(this.map[t][0]+this.map[t][1]),this.map[t][2]),e.length=this.map[t][0];n.push(e.slice()),e.length=0;let r=n.pop();for(;r;){for(let t of r)e.push(t);r=n.pop()}this.map.length=0,this.index.clear()}};function Zn(e,t,n,r,i){if(n===0&&r.length===0)return;let a=e.index.get(t);if(a){a[1]+=n,i?(r.push(...a[2]),a[2]=r):a[2].push(...r);return}let o=[t,n,r];e.map.push(o),e.index.set(t,o)}var Qn={tokenize:er},$n={tokenize:tr};function er(e){let t=this,n=[],r=0,i,a,o;return s;function s(i){if(r<n.length){let a=n[r];return t.containerState=a[1],e.attempt(a[0].continuation,c,l)(i)}return l(i)}function c(e){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&v();let n=t.events.length,a=n,o;for(;a--;)if(t.events[a][0]===`exit`&&t.events[a][1].type===`chunkFlow`){o=t.events[a][1].end;break}_(r);let s=n;for(;s<t.events.length;)t.events[s][1].end={...o},s++;let c=new Xn;return c.add(a+1,0,t.events.slice(n)),c.add(n,s-n,[]),c.consume(t.events),l(e)}return s(e)}function l(a){if(r===n.length){if(!i)return f(a);if(i.currentConstruct&&i.currentConstruct.concrete)return m(a);t.interrupt=!(!i.currentConstruct||i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check($n,u,d)(a)}function u(e){return i&&v(),_(r),f(e)}function d(e){return t.parser.lazy[t.now().line]=r!==n.length,o=t.now().offset,m(e)}function f(n){return t.containerState={},e.attempt($n,p,m)(n)}function p(e){return r++,n.push([t.currentConstruct,t.containerState]),f(e)}function m(n){if(n===null)i&&v(),_(0),e.consume(n);else return i||=t.parser.flow(t.now()),e.enter(`chunkFlow`,{_tokenizer:i,contentType:`flow`,previous:a}),h(n)}function h(n){if(n===null)g(e.exit(`chunkFlow`),!0),_(0),e.consume(n);else return Y(n)?(e.consume(n),g(e.exit(`chunkFlow`)),r=0,t.interrupt=void 0,s):(e.consume(n),h)}function g(e,n){let s=t.sliceStream(e);if(n&&s.push(null),e.previous=a,a&&(a.next=e),a=e,i.defineSkip(e.start),i.write(s),t.parser.lazy[e.start.line]){let e=i.events.length;for(;e--;)if(i.events[e][1].start.offset<o&&(!i.events[e][1].end||i.events[e][1].end.offset>o))return;let n=t.events.length,a=n,s,c;for(;a--;)if(t.events[a][0]===`exit`&&t.events[a][1].type===`chunkFlow`){if(s){c=t.events[a][1].end;break}s=!0}for(_(r),e=n;e<t.events.length;)t.events[e][1].end={...c},e++;let l=new Xn;l.add(a+1,0,t.events.slice(n)),l.add(n,e-n,[]),l.consume(t.events)}}function _(r){let i=n.length;for(;i-->r;){let r=n[i];t.containerState=r[1],r[0].exit.call(t,e)}n.length=r}function v(){i.write([null]),a=void 0,i=void 0,t.containerState._closeFlow=void 0}}function tr(e,t,n){return Q(e,e.attempt(this.parser.constructs.document,t,n),`linePrefix`,this.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)}function nr(e){if(e===null||X(e)||Wn(e))return 1;if(Un(e))return 2}function rr(e,t,n){let r=[],i=-1;for(;++i<e.length;){let a=e[i].resolveAll;a&&!r.includes(a)&&(t=a(t,n),r.push(a))}return t}var ir={name:`attention`,resolveAll:ar,tokenize:or};function ar(e,t){let n=-1,r;for(;++n<e.length;)if(e[n][0]===`enter`&&e[n][1].type===`attentionSequence`&&e[n][1]._close){let i=n;for(;i--;)if(e[i][0]===`exit`&&e[i][1].type===`attentionSequence`&&e[i][1]._open&&t.sliceSerialize(e[i][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[i][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[i][1].end.offset-e[i][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;let a=e[i][1].end.offset-e[i][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1,o={...e[i][1].end},s={...e[n][1].start};sr(o,-a),sr(s,a);let c={type:a>1?`strongSequence`:`emphasisSequence`,start:o,end:{...e[i][1].end}},l={type:a>1?`strongSequence`:`emphasisSequence`,start:{...e[n][1].start},end:s},u={type:a>1?`strongText`:`emphasisText`,start:{...e[i][1].end},end:{...e[n][1].start}},d={type:a>1?`strong`:`emphasis`,start:{...c.start},end:{...l.end}};e[i][1].end={...c.start},e[n][1].start={...l.end},r=[],e[i][1].end.offset-e[i][1].start.offset&&(r=G(r,[[`enter`,e[i][1],t],[`exit`,e[i][1],t]])),r=G(r,[[`enter`,d,t],[`enter`,c,t],[`exit`,c,t],[`enter`,u,t]]),r=G(r,rr(t.parser.constructs.insideSpan.null,e.slice(i+1,n),t)),r=G(r,[[`exit`,u,t],[`enter`,l,t],[`exit`,l,t],[`exit`,d,t]]);let f=0;e[n][1].end.offset-e[n][1].start.offset&&(f=2,r=G(r,[[`enter`,e[n][1],t],[`exit`,e[n][1],t]])),W(e,i-1,n-i+3,r),n=i+r.length-f-2;break}}for(n=-1;++n<e.length;)e[n][1].type===`attentionSequence`&&(e[n][1].type=`data`);return e}function or(e,t){let n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=nr(r),a;return o;function o(t){return a=t,e.enter(`attentionSequence`),s(t)}function s(o){if(o===a)return e.consume(o),s;let c=e.exit(`attentionSequence`),l=nr(o),u=!l||l===2&&i||n.includes(o)&&o!==42&&o!==95,d=!i||i===2&&l||n.includes(r)&&r!==42&&r!==95;return c._open=!!(a===42?u:u&&(i||!d)),c._close=!!(a===42?d:d&&(l||!u)),t(o)}}function sr(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}var cr={name:`autolink`,tokenize:lr};function lr(e,t,n){let r=0;return i;function i(t){return e.enter(`autolink`),e.enter(`autolinkMarker`),e.consume(t),e.exit(`autolinkMarker`),e.enter(`autolinkProtocol`),a}function a(t){return q(t)?(e.consume(t),o):t===64?n(t):l(t)}function o(e){return e===43||e===45||e===46||J(e)?(r=1,s(e)):l(e)}function s(t){return t===58?(e.consume(t),r=0,c):(t===43||t===45||t===46||J(t))&&r++<32?(e.consume(t),s):(r=0,l(t))}function c(r){return r===62?(e.exit(`autolinkProtocol`),e.enter(`autolinkMarker`),e.consume(r),e.exit(`autolinkMarker`),e.exit(`autolink`),t):r===null||r===32||r===60||zn(r)?n(r):(e.consume(r),c)}function l(t){return t===64?(e.consume(t),u):Rn(t)?(e.consume(t),l):n(t)}function u(e){return J(e)?d(e):n(e)}function d(n){return n===46?(e.consume(n),r=0,u):n===62?(e.exit(`autolinkProtocol`).type=`autolinkEmail`,e.enter(`autolinkMarker`),e.consume(n),e.exit(`autolinkMarker`),e.exit(`autolink`),t):f(n)}function f(t){if((t===45||J(t))&&r++<63){let n=t===45?f:d;return e.consume(t),n}return n(t)}}var ur={partial:!0,tokenize:dr};function dr(e,t,n){return r;function r(t){return Z(t)?Q(e,i,`linePrefix`)(t):i(t)}function i(e){return e===null||Y(e)?t(e):n(e)}}var fr={continuation:{tokenize:mr},exit:hr,name:`blockQuote`,tokenize:pr};function pr(e,t,n){let r=this;return i;function i(t){if(t===62){let n=r.containerState;return n.open||=(e.enter(`blockQuote`,{_container:!0}),!0),e.enter(`blockQuotePrefix`),e.enter(`blockQuoteMarker`),e.consume(t),e.exit(`blockQuoteMarker`),a}return n(t)}function a(n){return Z(n)?(e.enter(`blockQuotePrefixWhitespace`),e.consume(n),e.exit(`blockQuotePrefixWhitespace`),e.exit(`blockQuotePrefix`),t):(e.exit(`blockQuotePrefix`),t(n))}}function mr(e,t,n){let r=this;return i;function i(t){return Z(t)?Q(e,a,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):a(t)}function a(r){return e.attempt(fr,t,n)(r)}}function hr(e){e.exit(`blockQuote`)}var gr={name:`characterEscape`,tokenize:_r};function _r(e,t,n){return r;function r(t){return e.enter(`characterEscape`),e.enter(`escapeMarker`),e.consume(t),e.exit(`escapeMarker`),i}function i(r){return Hn(r)?(e.enter(`characterEscapeValue`),e.consume(r),e.exit(`characterEscapeValue`),e.exit(`characterEscape`),t):n(r)}}var vr={name:`characterReference`,tokenize:yr};function yr(e,t,n){let r=this,i=0,a,o;return s;function s(t){return e.enter(`characterReference`),e.enter(`characterReferenceMarker`),e.consume(t),e.exit(`characterReferenceMarker`),c}function c(t){return t===35?(e.enter(`characterReferenceMarkerNumeric`),e.consume(t),e.exit(`characterReferenceMarkerNumeric`),l):(e.enter(`characterReferenceValue`),a=31,o=J,u(t))}function l(t){return t===88||t===120?(e.enter(`characterReferenceMarkerHexadecimal`),e.consume(t),e.exit(`characterReferenceMarkerHexadecimal`),e.enter(`characterReferenceValue`),a=6,o=Vn,u):(e.enter(`characterReferenceValue`),a=7,o=Bn,u(t))}function u(s){if(s===59&&i){let i=e.exit(`characterReferenceValue`);return o===J&&!Mn(r.sliceSerialize(i))?n(s):(e.enter(`characterReferenceMarker`),e.consume(s),e.exit(`characterReferenceMarker`),e.exit(`characterReference`),t)}return o(s)&&i++<a?(e.consume(s),u):n(s)}}var br={partial:!0,tokenize:xr};function xr(e,t,n){let r=this;return i;function i(t){return t===null?n(t):(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),a)}function a(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}var Sr={concrete:!0,name:`codeFenced`,tokenize:Cr};function Cr(e,t,n){let r=this,i={partial:!0,tokenize:x},a=0,o=0,s;return c;function c(e){return l(e)}function l(t){let n=r.events[r.events.length-1];return a=n&&n[1].type===`linePrefix`?n[2].sliceSerialize(n[1],!0).length:0,s=t,e.enter(`codeFenced`),e.enter(`codeFencedFence`),e.enter(`codeFencedFenceSequence`),u(t)}function u(t){return t===s?(o++,e.consume(t),u):o<3?n(t):(e.exit(`codeFencedFenceSequence`),Z(t)?Q(e,d,`whitespace`)(t):d(t))}function d(n){return n===null||Y(n)?(e.exit(`codeFencedFence`),r.interrupt?t(n):e.check(br,h,b)(n)):(e.enter(`codeFencedFenceInfo`),e.enter(`chunkString`,{contentType:`string`}),f(n))}function f(t){return t===null||Y(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceInfo`),d(t)):Z(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceInfo`),Q(e,p,`whitespace`)(t)):t===96&&t===s?n(t):(e.consume(t),f)}function p(t){return t===null||Y(t)?d(t):(e.enter(`codeFencedFenceMeta`),e.enter(`chunkString`,{contentType:`string`}),m(t))}function m(t){return t===null||Y(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceMeta`),d(t)):t===96&&t===s?n(t):(e.consume(t),m)}function h(t){return e.attempt(i,b,g)(t)}function g(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),_}function _(t){return a>0&&Z(t)?Q(e,v,`linePrefix`,a+1)(t):v(t)}function v(t){return t===null||Y(t)?e.check(br,h,b)(t):(e.enter(`codeFlowValue`),y(t))}function y(t){return t===null||Y(t)?(e.exit(`codeFlowValue`),v(t)):(e.consume(t),y)}function b(n){return e.exit(`codeFenced`),t(n)}function x(e,t,n){let i=0;return a;function a(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),c}function c(t){return e.enter(`codeFencedFence`),Z(t)?Q(e,l,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):l(t)}function l(t){return t===s?(e.enter(`codeFencedFenceSequence`),u(t)):n(t)}function u(t){return t===s?(i++,e.consume(t),u):i>=o?(e.exit(`codeFencedFenceSequence`),Z(t)?Q(e,d,`whitespace`)(t):d(t)):n(t)}function d(r){return r===null||Y(r)?(e.exit(`codeFencedFence`),t(r)):n(r)}}}var wr={name:`codeIndented`,tokenize:Er},Tr={partial:!0,tokenize:Dr};function Er(e,t,n){return r;function r(t){return e.enter(`codeIndented`),qn(e,i,n,`linePrefix`,4,4)(t)}function i(t){return t===null?o(t):Y(t)?e.attempt(Tr,i,o)(t):(e.enter(`codeFlowValue`),a(t))}function a(t){return t===null||Y(t)?(e.exit(`codeFlowValue`),i(t)):(e.consume(t),a)}function o(n){return e.exit(`codeIndented`),t(n)}}function Dr(e,t,n){let r=this;return i;function i(o){return r.parser.lazy[r.now().line]?n(o):Y(o)?(e.enter(`lineEnding`),e.consume(o),e.exit(`lineEnding`),i):qn(e,t,a,`linePrefix`,4,4)(o)}function a(e){return Y(e)?i(e):n(e)}}var Or={name:`codeText`,previous:Ar,resolve:kr,tokenize:jr};function kr(e){let t=e.length-4,n=3,r,i;if((e[n][1].type===`lineEnding`||e[n][1].type===`space`)&&(e[t][1].type===`lineEnding`||e[t][1].type===`space`)){for(r=n;++r<t;)if(e[r][1].type===`codeTextData`){e[n][1].type=`codeTextPadding`,e[t][1].type=`codeTextPadding`,n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)i===void 0?r!==t&&e[r][1].type!==`lineEnding`&&(i=r):(r===t||e[r][1].type===`lineEnding`)&&(e[i][1].type=`codeTextData`,r!==i+2&&(e[i][1].end=e[r-1][1].end,e.splice(i+2,r-i-2),t-=r-i-2,r=i+2),i=void 0);return e}function Ar(e){return e!==96||this.events[this.events.length-1][1].type===`characterEscape`}function jr(e,t,n){let r=0,i,a;return o;function o(t){return e.enter(`codeText`),e.enter(`codeTextSequence`),s(t)}function s(t){return t===96?(e.consume(t),r++,s):(e.exit(`codeTextSequence`),c(t))}function c(t){return t===null?n(t):t===32?(e.enter(`space`),e.consume(t),e.exit(`space`),c):t===96?(a=e.enter(`codeTextSequence`),i=0,u(t)):Y(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),c):(e.enter(`codeTextData`),l(t))}function l(t){return t===null||t===32||t===96||Y(t)?(e.exit(`codeTextData`),c(t)):(e.consume(t),l)}function u(n){return n===96?(e.consume(n),i++,u):i===r?(e.exit(`codeTextSequence`),e.exit(`codeText`),t(n)):(a.type=`codeTextData`,l(n))}}var Mr=class{constructor(e){this.left=e?[...e]:[],this.right=[]}get(e){if(e<0||e>=this.left.length+this.right.length)throw RangeError("Cannot access index `"+e+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return e<this.left.length?this.left[e]:this.right[this.right.length-e+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(e,t){let n=t??1/0;return n<this.left.length?this.left.slice(e,n):e>this.left.length?this.right.slice(this.right.length-n+this.left.length,this.right.length-e+this.left.length).reverse():this.left.slice(e).concat(this.right.slice(this.right.length-n+this.left.length).reverse())}splice(e,t,n){let r=t||0;this.setCursor(Math.trunc(e));let i=this.right.splice(this.right.length-r,1/0);return n&&Nr(this.left,n),i.reverse()}pop(){return this.setCursor(1/0),this.left.pop()}push(e){this.setCursor(1/0),this.left.push(e)}pushMany(e){this.setCursor(1/0),Nr(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),Nr(this.right,e.reverse())}setCursor(e){if(!(e===this.left.length||e>this.left.length&&this.right.length===0||e<0&&this.left.length===0)){if(e<this.left.length){let t=this.left.splice(e,1/0);Nr(this.right,t.reverse())}else{let t=this.right.splice(this.left.length+this.right.length-e,1/0);Nr(this.left,t.reverse())}}}};function Nr(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function Pr(e){let t={},n=-1,r,i,a,o,s,c,l,u=new Mr(e);for(;++n<u.length;){for(;n in t;)n=t[n];if(r=u.get(n),n&&r[1].type===`chunkFlow`&&u.get(n-1)[1].type===`listItemPrefix`&&(c=r[1]._tokenizer.events,a=0,a<c.length&&c[a][1].type===`lineEndingBlank`&&(a+=2),a<c.length&&c[a][1].type===`content`))for(;++a<c.length&&c[a][1].type!==`content`;)c[a][1].type===`chunkText`&&(c[a][1]._isInFirstContentOfListItem=!0,a++);if(r[0]===`enter`)r[1].contentType&&(Object.assign(t,Fr(u,n)),n=t[n],l=!0);else if(r[1]._container){for(a=n,i=void 0;a--;)if(o=u.get(a),o[1].type===`lineEnding`||o[1].type===`lineEndingBlank`)o[0]===`enter`&&(i&&(u.get(i)[1].type=`lineEndingBlank`),o[1].type=`lineEnding`,i=a);else if(o[1].type!==`linePrefix`&&o[1].type!==`listItemIndent`)break;i&&(r[1].end={...u.get(i)[1].start},s=u.slice(i,n),s.unshift(r),u.splice(i,n-i+1,s))}}return W(e,0,1/0,u.slice(0)),!l}function Fr(e,t){let n=e.get(t)[1],r=e.get(t)[2],i=t-1,a=[],o=n._tokenizer;o||(o=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(o._contentTypeTextTrailing=!0));let s=o.events,c=[],l={},u,d,f=-1,p=n,m=0,h=0,g=[h];for(;p;){for(;e.get(++i)[1]!==p;);a.push(i),p._tokenizer||(u=r.sliceStream(p),p.next||u.push(null),d&&o.defineSkip(p.start),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=!0),o.write(u),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=void 0)),d=p,p=p.next}for(p=n;++f<s.length;)s[f][0]===`exit`&&s[f-1][0]===`enter`&&s[f][1].type===s[f-1][1].type&&s[f][1].start.line!==s[f][1].end.line&&(h=f+1,g.push(h),p._tokenizer=void 0,p.previous=void 0,p=p.next);for(o.events=[],p?(p._tokenizer=void 0,p.previous=void 0):g.pop(),f=g.length;f--;){let t=s.slice(g[f],g[f+1]),n=a.pop();c.push([n,n+t.length-1]),e.splice(n,2,t)}for(c.reverse(),f=-1;++f<c.length;)l[m+c[f][0]]=m+c[f][1],m+=c[f][1]-c[f][0]-1;return l}var Ir={resolve:Rr,tokenize:zr},Lr={partial:!0,tokenize:Br};function Rr(e){return Pr(e),e}function zr(e,t){let n;return r;function r(t){return e.enter(`content`),n=e.enter(`chunkContent`,{contentType:`content`}),i(t)}function i(t){return t===null?a(t):Y(t)?e.check(Lr,o,a)(t):(e.consume(t),i)}function a(n){return e.exit(`chunkContent`),e.exit(`content`),t(n)}function o(t){return e.consume(t),e.exit(`chunkContent`),n.next=e.enter(`chunkContent`,{contentType:`content`,previous:n}),n=n.next,i}}function Br(e,t,n){let r=this;return i;function i(t){return e.exit(`chunkContent`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),Q(e,a,`linePrefix`)}function a(i){if(i===null||Y(i))return n(i);let a=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes(`codeIndented`)&&a&&a[1].type===`linePrefix`&&a[2].sliceSerialize(a[1],!0).length>=4?t(i):e.interrupt(r.parser.constructs.flow,n,t)(i)}}function Vr(e,t,n,r,i,a,o,s,c){let l=c||1/0,u=0;return d;function d(t){return t===60?(e.enter(r),e.enter(i),e.enter(a),e.consume(t),e.exit(a),f):t===null||t===32||t===41||zn(t)?n(t):(e.enter(r),e.enter(o),e.enter(s),e.enter(`chunkString`,{contentType:`string`}),h(t))}function f(n){return n===62?(e.enter(a),e.consume(n),e.exit(a),e.exit(i),e.exit(r),t):(e.enter(s),e.enter(`chunkString`,{contentType:`string`}),p(n))}function p(t){return t===62?(e.exit(`chunkString`),e.exit(s),f(t)):t===null||t===60||Y(t)?n(t):(e.consume(t),t===92?m:p)}function m(t){return t===60||t===62||t===92?(e.consume(t),p):p(t)}function h(i){return!u&&(i===null||i===41||X(i))?(e.exit(`chunkString`),e.exit(s),e.exit(o),e.exit(r),t(i)):u<l&&i===40?(e.consume(i),u++,h):i===41?(e.consume(i),u--,h):i===null||i===32||i===40||zn(i)?n(i):(e.consume(i),i===92?g:h)}function g(t){return t===40||t===41||t===92?(e.consume(t),h):h(t)}}function Hr(e,t,n,r,i,a){let o=this,s=0,c;return l;function l(t){return e.enter(r),e.enter(i),e.consume(t),e.exit(i),e.enter(a),u}function u(l){return s>999||l===null||l===91||l===93&&!c||l===94&&!s&&`_hiddenFootnoteSupport`in o.parser.constructs?n(l):l===93?(e.exit(a),e.enter(i),e.consume(l),e.exit(i),e.exit(r),t):Y(l)?(e.enter(`lineEnding`),e.consume(l),e.exit(`lineEnding`),u):(e.enter(`chunkString`,{contentType:`string`}),d(l))}function d(t){return t===null||t===91||t===93||Y(t)||s++>999?(e.exit(`chunkString`),u(t)):(e.consume(t),c||=!Z(t),t===92?f:d)}function f(t){return t===91||t===92||t===93?(e.consume(t),s++,d):d(t)}}function Ur(e,t,n,r,i,a){let o;return s;function s(t){return t===34||t===39||t===40?(e.enter(r),e.enter(i),e.consume(t),e.exit(i),o=t===40?41:t,c):n(t)}function c(n){return n===o?(e.enter(i),e.consume(n),e.exit(i),e.exit(r),t):(e.enter(a),l(n))}function l(t){return t===o?(e.exit(a),c(o)):t===null?n(t):Y(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),Q(e,l,`linePrefix`)):(e.enter(`chunkString`,{contentType:`string`}),u(t))}function u(t){return t===o||t===null||Y(t)?(e.exit(`chunkString`),l(t)):(e.consume(t),t===92?d:u)}function d(t){return t===o||t===92?(e.consume(t),u):u(t)}}function Wr(e,t){let n;return r;function r(i){return Y(i)?(e.enter(`lineEnding`),e.consume(i),e.exit(`lineEnding`),n=!0,r):Z(i)?Q(e,r,n?`linePrefix`:`lineSuffix`)(i):t(i)}}var Gr={name:`definition`,tokenize:qr},Kr={partial:!0,tokenize:Jr};function qr(e,t,n){let r=this,i;return a;function a(t){return e.enter(`definition`),o(t)}function o(t){return Hr.call(r,e,s,n,`definitionLabel`,`definitionLabelMarker`,`definitionLabelString`)(t)}function s(t){return i=K(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),t===58?(e.enter(`definitionMarker`),e.consume(t),e.exit(`definitionMarker`),c):n(t)}function c(t){return X(t)?Wr(e,l)(t):l(t)}function l(t){return Vr(e,u,n,`definitionDestination`,`definitionDestinationLiteral`,`definitionDestinationLiteralMarker`,`definitionDestinationRaw`,`definitionDestinationString`)(t)}function u(t){return e.attempt(Kr,d,d)(t)}function d(t){return Z(t)?Q(e,f,`whitespace`)(t):f(t)}function f(a){return a===null||Y(a)?(e.exit(`definition`),r.parser.defined.push(i),t(a)):n(a)}}function Jr(e,t,n){return r;function r(t){return X(t)?Wr(e,i)(t):n(t)}function i(t){return Ur(e,a,n,`definitionTitle`,`definitionTitleMarker`,`definitionTitleString`)(t)}function a(t){return Z(t)?Q(e,o,`whitespace`)(t):o(t)}function o(e){return e===null||Y(e)?t(e):n(e)}}var Yr={name:`hardBreakEscape`,tokenize:Xr};function Xr(e,t,n){return r;function r(t){return e.enter(`hardBreakEscape`),e.consume(t),i}function i(r){return Y(r)?(e.exit(`hardBreakEscape`),t(r)):n(r)}}var Zr={name:`headingAtx`,resolve:Qr,tokenize:$r};function Qr(e,t){let n=e.length-2,r=3;if(e[r][1].type===`whitespace`&&(r+=2),n-2>r&&e[n][1].type===`whitespace`&&(n-=2),e[n][1].type===`atxHeadingSequence`&&(r===n-1||n-4>r&&e[n-2][1].type===`whitespace`)&&(n-=r+1===n?2:4),n>r){let i={type:`atxHeadingText`,start:e[r][1].start,end:e[n][1].end},a={type:`chunkText`,start:e[r][1].start,end:e[n][1].end,contentType:`text`};W(e,r,n-r+1,[[`enter`,i,t],[`enter`,a,t],[`exit`,a,t],[`exit`,i,t]])}return e}function $r(e,t,n){let r=0;return i;function i(t){return e.enter(`atxHeading`),a(t)}function a(t){return e.enter(`atxHeadingSequence`),o(t)}function o(t){return t===35&&r++<6?(e.consume(t),o):t===null||X(t)?(e.exit(`atxHeadingSequence`),s(t)):n(t)}function s(n){return n===35?(e.enter(`atxHeadingSequence`),c(n)):n===null||Y(n)?(e.exit(`atxHeading`),t(n)):Z(n)?Q(e,s,`whitespace`)(n):(e.enter(`atxHeadingText`),l(n))}function c(t){return t===35?(e.consume(t),c):(e.exit(`atxHeadingSequence`),s(t))}function l(t){return t===null||t===35||X(t)?(e.exit(`atxHeadingText`),s(t)):(e.consume(t),l)}}var ei=`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.h1.h2.h3.h4.h5.h6.head.header.hr.html.iframe.legend.li.link.main.menu.menuitem.nav.noframes.ol.optgroup.option.p.param.search.section.summary.table.tbody.td.tfoot.th.thead.title.tr.track.ul`.split(`.`),ti=[`pre`,`script`,`style`,`textarea`],ni={concrete:!0,name:`htmlFlow`,resolveTo:ii,tokenize:ai},ri={partial:!0,tokenize:oi};function ii(e){let t=e.length;for(;t--&&(e[t][0]!==`enter`||e[t][1].type!==`htmlFlow`););return t>1&&e[t-2][1].type===`linePrefix`&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function ai(e,t,n){let r=this,i,a,o,s,c;return l;function l(e){return u(e)}function u(t){return e.enter(`htmlFlow`),e.enter(`htmlFlowData`),e.consume(t),d}function d(s){return s===33?(e.consume(s),f):s===47?(e.consume(s),a=!0,h):s===63?(e.consume(s),i=3,r.interrupt?t:re):q(s)?(e.consume(s),o=String.fromCharCode(s),g):n(s)}function f(a){return a===45?(e.consume(a),i=2,p):a===91?(e.consume(a),i=5,s=0,m):q(a)?(e.consume(a),i=4,r.interrupt?t:re):n(a)}function p(i){return i===45?(e.consume(i),r.interrupt?t:re):n(i)}function m(i){return i===`CDATA[`.charCodeAt(s++)?(e.consume(i),s===6?r.interrupt?t:O:m):n(i)}function h(t){return q(t)?(e.consume(t),o=String.fromCharCode(t),g):n(t)}function g(s){if(s===null||s===47||s===62||X(s)){let c=s===47,l=o.toLowerCase();return!c&&!a&&ti.includes(l)?(i=1,r.interrupt?t(s):O(s)):ei.includes(o.toLowerCase())?(i=6,c?(e.consume(s),_):r.interrupt?t(s):O(s)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(s):a?v(s):y(s))}return s===45||J(s)?(e.consume(s),o+=String.fromCharCode(s),g):n(s)}function _(i){return i===62?(e.consume(i),r.interrupt?t:O):n(i)}function v(t){return Z(t)?(e.consume(t),v):E(t)}function y(t){return t===47?(e.consume(t),E):t===58||t===95||q(t)?(e.consume(t),b):Z(t)?(e.consume(t),y):E(t)}function b(t){return t===45||t===46||t===58||t===95||J(t)?(e.consume(t),b):x(t)}function x(t){return t===61?(e.consume(t),S):Z(t)?(e.consume(t),x):y(t)}function S(t){return t===null||t===60||t===61||t===62||t===96?n(t):t===34||t===39?(e.consume(t),c=t,C):Z(t)?(e.consume(t),S):w(t)}function C(t){return t===c?(e.consume(t),c=null,T):t===null||Y(t)?n(t):(e.consume(t),C)}function w(t){return t===null||t===34||t===39||t===47||t===60||t===61||t===62||t===96||X(t)?x(t):(e.consume(t),w)}function T(e){return e===47||e===62||Z(e)?y(e):n(e)}function E(t){return t===62?(e.consume(t),D):n(t)}function D(t){return t===null||Y(t)?O(t):Z(t)?(e.consume(t),D):n(t)}function O(t){return t===45&&i===2?(e.consume(t),j):t===60&&i===1?(e.consume(t),M):t===62&&i===4?(e.consume(t),ie):t===63&&i===3?(e.consume(t),re):t===93&&i===5?(e.consume(t),ne):Y(t)&&(i===6||i===7)?(e.exit(`htmlFlowData`),e.check(ri,ae,k)(t)):t===null||Y(t)?(e.exit(`htmlFlowData`),k(t)):(e.consume(t),O)}function k(t){return e.check(br,A,ae)(t)}function A(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),ee}function ee(t){return t===null||Y(t)?k(t):(e.enter(`htmlFlowData`),O(t))}function j(t){return t===45?(e.consume(t),re):O(t)}function M(t){return t===47?(e.consume(t),o=``,te):O(t)}function te(t){if(t===62){let n=o.toLowerCase();return ti.includes(n)?(e.consume(t),ie):O(t)}return q(t)&&o.length<8?(e.consume(t),o+=String.fromCharCode(t),te):O(t)}function ne(t){return t===93?(e.consume(t),re):O(t)}function re(t){return t===62?(e.consume(t),ie):t===45&&i===2?(e.consume(t),re):O(t)}function ie(t){return t===null||Y(t)?(e.exit(`htmlFlowData`),ae(t)):(e.consume(t),ie)}function ae(n){return e.exit(`htmlFlow`),t(n)}}function oi(e,t,n){return r;function r(r){return e.enter(`lineEnding`),e.consume(r),e.exit(`lineEnding`),e.attempt(ur,t,n)}}var si={name:`htmlText`,tokenize:ci};function ci(e,t,n){let r=this,i,a,o;return s;function s(t){return e.enter(`htmlText`),e.enter(`htmlTextData`),e.consume(t),c}function c(t){return t===33?(e.consume(t),l):t===47?(e.consume(t),x):t===63?(e.consume(t),y):q(t)?(e.consume(t),w):n(t)}function l(t){return t===45?(e.consume(t),u):t===91?(e.consume(t),a=0,m):q(t)?(e.consume(t),v):n(t)}function u(t){return t===45?(e.consume(t),p):n(t)}function d(t){return t===null?n(t):t===45?(e.consume(t),f):Y(t)?(o=d,M(t)):(e.consume(t),d)}function f(t){return t===45?(e.consume(t),p):d(t)}function p(e){return e===62?j(e):e===45?f(e):d(e)}function m(t){return t===`CDATA[`.charCodeAt(a++)?(e.consume(t),a===6?h:m):n(t)}function h(t){return t===null?n(t):t===93?(e.consume(t),g):Y(t)?(o=h,M(t)):(e.consume(t),h)}function g(t){return t===93?(e.consume(t),_):h(t)}function _(t){return t===62?j(t):t===93?(e.consume(t),_):h(t)}function v(t){return t===null||t===62?j(t):Y(t)?(o=v,M(t)):(e.consume(t),v)}function y(t){return t===null?n(t):t===63?(e.consume(t),b):Y(t)?(o=y,M(t)):(e.consume(t),y)}function b(e){return e===62?j(e):y(e)}function x(t){return q(t)?(e.consume(t),S):n(t)}function S(t){return t===45||J(t)?(e.consume(t),S):C(t)}function C(t){return Y(t)?(o=C,M(t)):Z(t)?(e.consume(t),C):j(t)}function w(t){return t===45||J(t)?(e.consume(t),w):t===47||t===62||X(t)?T(t):n(t)}function T(t){return t===47?(e.consume(t),j):t===58||t===95||q(t)?(e.consume(t),E):Y(t)?(o=T,M(t)):Z(t)?(e.consume(t),T):j(t)}function E(t){return t===45||t===46||t===58||t===95||J(t)?(e.consume(t),E):D(t)}function D(t){return t===61?(e.consume(t),O):Y(t)?(o=D,M(t)):Z(t)?(e.consume(t),D):T(t)}function O(t){return t===null||t===60||t===61||t===62||t===96?n(t):t===34||t===39?(e.consume(t),i=t,k):Y(t)?(o=O,M(t)):Z(t)?(e.consume(t),O):(e.consume(t),A)}function k(t){return t===i?(e.consume(t),i=void 0,ee):t===null?n(t):Y(t)?(o=k,M(t)):(e.consume(t),k)}function A(t){return t===null||t===34||t===39||t===60||t===61||t===96?n(t):t===47||t===62||X(t)?T(t):(e.consume(t),A)}function ee(e){return e===47||e===62||X(e)?T(e):n(e)}function j(r){return r===62?(e.consume(r),e.exit(`htmlTextData`),e.exit(`htmlText`),t):n(r)}function M(t){return e.exit(`htmlTextData`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),te}function te(t){return Z(t)?Q(e,ne,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):ne(t)}function ne(t){return e.enter(`htmlTextData`),o(t)}}var li={name:`labelEnd`,resolveAll:pi,resolveTo:mi,tokenize:hi},ui={tokenize:gi},di={tokenize:_i},fi={tokenize:vi};function pi(e){let t=-1,n=[];for(;++t<e.length;){let r=e[t][1];if(n.push(e[t]),r.type===`labelImage`||r.type===`labelLink`||r.type===`labelEnd`){let e=r.type===`labelImage`?4:2;r.type=`data`,t+=e}}return e.length!==n.length&&W(e,0,e.length,n),e}function mi(e,t){let n=e.length,r=0,i,a,o;for(;n--;){let t=e[n][1];if(i){if(t.type===`link`||t.type===`labelLink`&&t._inactive)break;e[n][0]===`enter`&&t.type===`labelLink`&&(t._inactive=!0)}else if(a){if(e[n][0]===`enter`&&(t.type===`labelImage`||t.type===`labelLink`)&&!t._balanced&&(i=n,t.type!==`labelLink`)){r=2;break}}else t.type===`labelEnd`&&(a=n)}let s={type:e[i][1].type===`labelLink`?`link`:`image`,start:{...e[i][1].start},end:{...e[e.length-1][1].end}},c={type:`label`,start:{...e[i][1].start},end:{...e[a][1].end}},l={type:`labelText`,start:{...e[i+r+2][1].end},end:{...e[a-2][1].start}};return o=[[`enter`,s,t],[`enter`,c,t]],o=G(o,e.slice(i+1,i+r+3)),o=G(o,[[`enter`,l,t]]),o=G(o,rr(t.parser.constructs.insideSpan.null,e.slice(i+r+4,a-3),t)),o=G(o,[[`exit`,l,t],e[a-2],e[a-1],[`exit`,c,t]]),o=G(o,e.slice(a+1)),o=G(o,[[`exit`,s,t]]),W(e,i,e.length,o),e}function hi(e,t,n){let r=this,i=r._labelStarts,a,o;if(i){for(;i.length>0&&i[i.length-1]._balanced;)i.pop();a=i[i.length-1]}return s;function s(t){return a?a._inactive?d(t):(o=r.parser.defined.includes(K(r.sliceSerialize({start:a.end,end:r.now()}))),e.enter(`labelEnd`),e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),e.exit(`labelEnd`),c):n(t)}function c(t){return t===40?e.attempt(ui,u,o?u:d)(t):t===91?e.attempt(di,u,o?l:d)(t):o?u(t):d(t)}function l(t){return e.attempt(fi,u,d)(t)}function u(e){return i.pop(),t(e)}function d(e){return a._balanced=!0,n(e)}}function gi(e,t,n){return r;function r(t){return e.enter(`resource`),e.enter(`resourceMarker`),e.consume(t),e.exit(`resourceMarker`),i}function i(t){return X(t)?Wr(e,a)(t):a(t)}function a(t){return t===41?u(t):Vr(e,o,s,`resourceDestination`,`resourceDestinationLiteral`,`resourceDestinationLiteralMarker`,`resourceDestinationRaw`,`resourceDestinationString`,32)(t)}function o(t){return X(t)?Wr(e,c)(t):u(t)}function s(e){return n(e)}function c(t){return t===34||t===39||t===40?Ur(e,l,n,`resourceTitle`,`resourceTitleMarker`,`resourceTitleString`)(t):u(t)}function l(t){return X(t)?Wr(e,u)(t):u(t)}function u(r){return r===41?(e.enter(`resourceMarker`),e.consume(r),e.exit(`resourceMarker`),e.exit(`resource`),t):n(r)}}function _i(e,t,n){let r=this;return i;function i(t){return Hr.call(r,e,a,o,`reference`,`referenceMarker`,`referenceString`)(t)}function a(e){return r.parser.defined.includes(K(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(e):n(e)}function o(e){return n(e)}}function vi(e,t,n){return r;function r(t){return e.enter(`reference`),e.enter(`referenceMarker`),e.consume(t),e.exit(`referenceMarker`),i}function i(r){return r===93?(e.enter(`referenceMarker`),e.consume(r),e.exit(`referenceMarker`),e.exit(`reference`),t):n(r)}}var yi={name:`labelStartImage`,resolveAll:li.resolveAll,tokenize:bi};function bi(e,t,n){let r=this,i;return a;function a(t){return e.enter(`labelImage`),e.enter(`labelImageMarker`),e.consume(t),e.exit(`labelImageMarker`),o}function o(t){return t===91?(e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),i=e.exit(`labelImage`),s):n(t)}function s(e){return e===94&&`_hiddenFootnoteSupport`in r.parser.constructs?n(e):(r._labelStarts=r._labelStarts||[],r._labelStarts.push(i),t(e))}}var xi={name:`labelStartLink`,resolveAll:li.resolveAll,tokenize:Si};function Si(e,t,n){let r=this,i;return a;function a(t){return e.enter(`labelLink`),e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),i=e.exit(`labelLink`),o}function o(e){return e===94&&`_hiddenFootnoteSupport`in r.parser.constructs?n(e):(r._labelStarts=r._labelStarts||[],r._labelStarts.push(i),t(e))}}var Ci={name:`lineEnding`,tokenize:wi};function wi(e,t){return n;function n(n){return e.enter(`lineEnding`),e.consume(n),e.exit(`lineEnding`),Q(e,t,`linePrefix`)}}var Ti={name:`thematicBreak`,tokenize:Ei};function Ei(e,t,n){let r=0,i;return a;function a(t){return e.enter(`thematicBreak`),o(t)}function o(e){return i=e,s(e)}function s(a){return a===i?(e.enter(`thematicBreakSequence`),c(a)):r>=3&&(a===null||Y(a))?(e.exit(`thematicBreak`),t(a)):n(a)}function c(t){return t===i?(e.consume(t),r++,c):(e.exit(`thematicBreakSequence`),Z(t)?Q(e,s,`whitespace`)(t):s(t))}}var $={continuation:{tokenize:Ai},exit:Mi,name:`list`,tokenize:ki},Di={partial:!0,tokenize:Ni},Oi={partial:!0,tokenize:ji};function ki(e,t,n){let r=this,i=r.events[r.events.length-1],a=i&&i[1].type===`linePrefix`?i[2].sliceSerialize(i[1],!0).length:0,o=0;return s;function s(t){let i=r.containerState.type||(t===42||t===43||t===45?`listUnordered`:`listOrdered`);if(i===`listUnordered`?!r.containerState.marker||t===r.containerState.marker:Bn(t)){if(r.containerState.type||(r.containerState.type=i,e.enter(i,{_container:!0})),i===`listUnordered`)return e.enter(`listItemPrefix`),t===42||t===45?e.check(Ti,n,l)(t):l(t);if(!r.interrupt||t===49)return e.enter(`listItemPrefix`),e.enter(`listItemValue`),c(t)}return n(t)}function c(t){return Bn(t)&&++o<10?(e.consume(t),c):(!r.interrupt||o<2)&&(r.containerState.marker?t===r.containerState.marker:t===41||t===46)?(e.exit(`listItemValue`),l(t)):n(t)}function l(t){return e.enter(`listItemMarker`),e.consume(t),e.exit(`listItemMarker`),r.containerState.marker=r.containerState.marker||t,e.check(ur,r.interrupt?n:u,e.attempt(Di,f,d))}function u(e){return r.containerState.initialBlankLine=!0,a++,f(e)}function d(t){return Z(t)?(e.enter(`listItemPrefixWhitespace`),e.consume(t),e.exit(`listItemPrefixWhitespace`),f):n(t)}function f(n){return r.containerState.size=a+r.sliceSerialize(e.exit(`listItemPrefix`),!0).length,t(n)}}function Ai(e,t,n){let r=this;return r.containerState._closeFlow=void 0,e.check(ur,i,a);function i(n){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,Q(e,t,`listItemIndent`,r.containerState.size+1)(n)}function a(n){return r.containerState.furtherBlankLines||!Z(n)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,o(n)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(Oi,t,o)(n))}function o(i){return r.containerState._closeFlow=!0,r.interrupt=void 0,Q(e,e.attempt($,t,n),`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(i)}}function ji(e,t,n){let r=this;return Q(e,i,`listItemIndent`,r.containerState.size+1);function i(e){let i=r.events[r.events.length-1];return i&&i[1].type===`listItemIndent`&&i[2].sliceSerialize(i[1],!0).length===r.containerState.size?t(e):n(e)}}function Mi(e){e.exit(this.containerState.type)}function Ni(e,t,n){let r=this;return Q(e,i,`listItemPrefixWhitespace`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:5);function i(e){let i=r.events[r.events.length-1];return!Z(e)&&i&&i[1].type===`listItemPrefixWhitespace`?t(e):n(e)}}var Pi={name:`setextUnderline`,resolveTo:Fi,tokenize:Ii};function Fi(e,t){let n=new Xn,r=e.length,i,a,o;for(;r--;)if(e[r][0]===`enter`){if(e[r][1].type===`content`){i=r;break}e[r][1].type===`paragraph`&&(a=r)}else e[r][1].type===`content`&&n.add(r,1,[]),!o&&e[r][1].type===`definition`&&(o=r);let s={type:`setextHeading`,start:{...e[i][1].start},end:{...e[e.length-1][1].end}};return e[a][1].type=`setextHeadingText`,o?(n.add(a,0,[[`enter`,s,t]]),n.add(o+1,0,[[`exit`,e[i][1],t]]),e[i][1].end={...e[o][1].end}):e[i][1]=s,n.add(e.length,0,[[`exit`,s,t]]),n.consume(e),e}function Ii(e,t,n){let r=this,i;return a;function a(t){let a=r.events.length,s;for(;a--;)if(r.events[a][1].type!==`lineEnding`&&r.events[a][1].type!==`linePrefix`&&r.events[a][1].type!==`content`){s=r.events[a][1].type===`paragraph`;break}return!r.parser.lazy[r.now().line]&&(r.interrupt||s)?(e.enter(`setextHeadingLine`),i=t,o(t)):n(t)}function o(t){return e.enter(`setextHeadingLineSequence`),s(t)}function s(t){return t===i?(e.consume(t),s):(e.exit(`setextHeadingLineSequence`),Z(t)?Q(e,c,`lineSuffix`)(t):c(t))}function c(r){return r===null||Y(r)?(e.exit(`setextHeadingLine`),t(r)):n(r)}}var Li={tokenize:Ri};function Ri(e){let t=this,n=e.attempt(ur,r,e.attempt(this.parser.constructs.flowInitial,i,Q(e,e.attempt(this.parser.constructs.flow,i,e.attempt(Ir,i)),`linePrefix`)));return n;function r(r){if(r===null)e.consume(r);else return e.enter(`lineEndingBlank`),e.consume(r),e.exit(`lineEndingBlank`),t.currentConstruct=void 0,n}function i(r){if(r===null)e.consume(r);else return e.enter(`lineEnding`),e.consume(r),e.exit(`lineEnding`),t.currentConstruct=void 0,n}}var zi={resolveAll:Ui()},Bi=Hi(`string`),Vi=Hi(`text`);function Hi(e){return{resolveAll:Ui(e===`text`?Wi:void 0),tokenize:t};function t(t){let n=this,r=this.parser.constructs[e],i=t.attempt(r,a,o);return a;function a(e){return c(e)?i(e):o(e)}function o(e){if(e===null)t.consume(e);else return t.enter(`data`),t.consume(e),s}function s(e){return c(e)?(t.exit(`data`),i(e)):(t.consume(e),s)}function c(e){if(e===null)return!0;let t=r[e],i=-1;if(t)for(;++i<t.length;){let e=t[i];if(!e.previous||e.previous.call(n,n.previous))return!0}return!1}}}function Ui(e){return t;function t(t,n){let r=-1,i;for(;++r<=t.length;)i===void 0?t[r]&&t[r][1].type===`data`&&(i=r,r++):t[r]&&t[r][1].type===`data`||(r!==i+2&&(t[i][1].end=t[r-1][1].end,t.splice(i+2,r-i-2),r=i+2),i=void 0);return e?e(t,n):t}}function Wi(e,t){let n=new Xn,r=0;for(;++r<=e.length;)if((r===e.length||e[r][1].type===`lineEnding`)&&e[r-1][1].type===`data`){let i=e[r-1][1],a=t.sliceStream(i),o=a.length,s=-1,c=0,l;for(;o--;){let e=a[o];if(typeof e==`string`){for(s=e.length;e.charCodeAt(s-1)===32;)c++,s--;if(s)break;s=-1}else if(e===-2)l=!0,c++;else if(e!==-1){o++;break}}if(t._contentTypeTextTrailing&&r===e.length&&(c=0),c){let a={type:r===e.length||l||c<2?`lineSuffix`:`hardBreakTrailing`,start:{_bufferIndex:o?s:i.start._bufferIndex+s,_index:i.start._index+o,line:i.end.line,column:i.end.column-c,offset:i.end.offset-c},end:{...i.end}};i.end={...a.start},i.start.offset===i.end.offset?Object.assign(i,a):n.add(r,0,[[`enter`,a,t],[`exit`,a,t]])}r++}return n.consume(e),e}var Gi=c({attentionMarkers:()=>$i,contentInitial:()=>qi,disable:()=>ea,document:()=>Ki,flow:()=>Yi,flowInitial:()=>Ji,insideSpan:()=>Qi,string:()=>Xi,text:()=>Zi}),Ki={42:$,43:$,45:$,48:$,49:$,50:$,51:$,52:$,53:$,54:$,55:$,56:$,57:$,62:fr},qi={91:Gr},Ji={[-2]:wr,[-1]:wr,32:wr},Yi={35:Zr,42:Ti,45:[Pi,Ti],60:ni,61:Pi,95:Ti,96:Sr,126:Sr},Xi={38:vr,92:gr},Zi={[-5]:Ci,[-4]:Ci,[-3]:Ci,33:yi,38:vr,42:ir,60:[cr,si],91:xi,92:[Yr,gr],93:li,95:ir,96:Or},Qi={null:[ir,zi]},$i={null:[42,95]},ea={null:[]};function ta(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0},i={},a=[],o=[],s=[],c={attempt:C(x),check:C(S),consume:v,enter:y,exit:b,interrupt:C(S,{interrupt:!0})},l={code:null,containerState:{},defineSkip:h,events:[],now:m,parser:e,previous:null,sliceSerialize:f,sliceStream:p,write:d},u=t.tokenize.call(l,c);return t.resolveAll&&a.push(t),l;function d(e){return o=G(o,e),g(),o[o.length-1]===null?(w(t,0),l.events=rr(a,l.events,l),l.events):[]}function f(e,t){return ra(p(e),t)}function p(e){return na(o,e)}function m(){let{_bufferIndex:e,_index:t,line:n,column:i,offset:a}=r;return{_bufferIndex:e,_index:t,line:n,column:i,offset:a}}function h(e){i[e.line]=e.column,E()}function g(){for(;r._index<o.length;){let e=o[r._index];if(typeof e==`string`){let t=r._index;for(r._bufferIndex<0&&(r._bufferIndex=0);r._index===t&&r._bufferIndex<e.length;)_(e.charCodeAt(r._bufferIndex))}else _(e)}}function _(e){u=u(e)}function v(e){Y(e)?(r.line++,r.column=1,r.offset+=e===-3?2:1,E()):e!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===o[r._index].length&&(r._bufferIndex=-1,r._index++)),l.previous=e}function y(e,t){let n=t||{};return n.type=e,n.start=m(),l.events.push([`enter`,n,l]),s.push(n),n}function b(e){let t=s.pop();return t.end=m(),l.events.push([`exit`,t,l]),t}function x(e,t){w(e,t.from)}function S(e,t){t.restore()}function C(e,t){return n;function n(n,r,i){let a,o,s,u;return Array.isArray(n)?f(n):`tokenize`in n?f([n]):d(n);function d(e){return t;function t(t){let n=t!==null&&e[t],r=t!==null&&e.null;return f([...Array.isArray(n)?n:n?[n]:[],...Array.isArray(r)?r:r?[r]:[]])(t)}}function f(e){return a=e,o=0,e.length===0?i:p(e[o])}function p(e){return n;function n(n){return u=T(),s=e,e.partial||(l.currentConstruct=e),e.name&&l.parser.constructs.disable.null.includes(e.name)?h(n):e.tokenize.call(t?Object.assign(Object.create(l),t):l,c,m,h)(n)}}function m(t){return e(s,u),r}function h(e){return u.restore(),++o<a.length?p(a[o]):i}}}function w(e,t){e.resolveAll&&!a.includes(e)&&a.push(e),e.resolve&&W(l.events,t,l.events.length-t,e.resolve(l.events.slice(t),l)),e.resolveTo&&(l.events=e.resolveTo(l.events,l))}function T(){let e=m(),t=l.previous,n=l.currentConstruct,i=l.events.length,a=Array.from(s);return{from:i,restore:o};function o(){r=e,l.previous=t,l.currentConstruct=n,l.events.length=i,s=a,E()}}function E(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function na(e,t){let n=t.start._index,r=t.start._bufferIndex,i=t.end._index,a=t.end._bufferIndex,o;if(n===i)o=[e[n].slice(r,a)];else{if(o=e.slice(n,i),r>-1){let e=o[0];typeof e==`string`?o[0]=e.slice(r):o.shift()}a>0&&o.push(e[i].slice(0,a))}return o}function ra(e,t){let n=-1,r=[],i;for(;++n<e.length;){let a=e[n],o;if(typeof a==`string`)o=a;else switch(a){case-5:o=`\r`;break;case-4:o=`
4
4
  `;break;case-3:o=`\r
@@ -1 +1 @@
1
- import{at as e,ct as t,nt as n,t as r,tt as i}from"./feedback-x6ZumR_x.js";import{G as a,ot as o}from"./index-DPLtb0kT.js";var s=i(),c={lg:`size-(--control-lg) rounded-lg`,md:`size-(--control-md) rounded-md`,sm:`size-(--control-sm) rounded-lg`};function l({icon:e,tone:t=`ghost`,size:r,tooltip:i=!0,shortcut:l,className:u,...d}){let f=(0,s.jsx)(o,{"data-slot":`icon-button`,variant:t===`outline`?`outline`:t,className:n(c[r??(t===`ghost`||t===`active`?`lg`:`sm`)],`px-0`,u),...d,children:e});return i?(0,s.jsx)(a,{label:d[`aria-label`],shortcut:l,children:f}):f}var u=t(e(),1),d=class extends u.Component{state={error:null};static getDerivedStateFromError(e){return{error:e}}componentDidCatch(e,t){console.warn(`[studio] ${this.props.name} slot failed`,e,t.componentStack)}componentDidUpdate(e){this.state.error&&e.resetKey!==this.props.resetKey&&this.setState({error:null})}render(){return this.state.error?(0,s.jsxs)(`div`,{className:`flex flex-col gap-3 p-3.5`,"data-testid":`slot-error-${this.props.name}`,children:[(0,s.jsxs)(r,{tone:`error`,children:[`The `,this.props.name,` panel stopped: `,String(this.state.error.message).slice(0,200)]}),(0,s.jsx)(o,{variant:`outline`,size:`sm`,onClick:()=>this.setState({error:null}),children:`Retry`})]}):this.props.children}};export{l as n,d as t};
1
+ import{at as e,ct as t,nt as n,t as r,tt as i}from"./feedback-x6ZumR_x.js";import{G as a,ot as o}from"./index-C6juWzGV.js";var s=i(),c={lg:`size-(--control-lg) rounded-lg`,md:`size-(--control-md) rounded-md`,sm:`size-(--control-sm) rounded-lg`};function l({icon:e,tone:t=`ghost`,size:r,tooltip:i=!0,shortcut:l,className:u,...d}){let f=(0,s.jsx)(o,{"data-slot":`icon-button`,variant:t===`outline`?`outline`:t,className:n(c[r??(t===`ghost`||t===`active`?`lg`:`sm`)],`px-0`,u),...d,children:e});return i?(0,s.jsx)(a,{label:d[`aria-label`],shortcut:l,children:f}):f}var u=t(e(),1),d=class extends u.Component{state={error:null};static getDerivedStateFromError(e){return{error:e}}componentDidCatch(e,t){console.warn(`[studio] ${this.props.name} slot failed`,e,t.componentStack)}componentDidUpdate(e){this.state.error&&e.resetKey!==this.props.resetKey&&this.setState({error:null})}render(){return this.state.error?(0,s.jsxs)(`div`,{className:`flex flex-col gap-3 p-3.5`,"data-testid":`slot-error-${this.props.name}`,children:[(0,s.jsxs)(r,{tone:`error`,children:[`The `,this.props.name,` panel stopped: `,String(this.state.error.message).slice(0,200)]}),(0,s.jsx)(o,{variant:`outline`,size:`sm`,onClick:()=>this.setState({error:null}),children:`Retry`})]}):this.props.children}};export{l as n,d as t};