super-agent-sdk 1.0.13 → 1.0.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/widget.cjs CHANGED
@@ -1,33 +1,33 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const k=require("react"),ga=require("react-dom/client"),d=require("react/jsx-runtime"),Oe=require("./nosUploader-KkzFK5EW.cjs");function Mr(e){const{sdk:t,sessionId:n,onSessionCreated:r,onStreamStart:i,onStreamEnd:s,onError:a,onMessageSend:o}=e,[l,u]=k.useState([]),[p,c]=k.useState("ready"),[h,f]=k.useState(null),g=k.useRef(null),w=k.useRef(!1),S=k.useRef(null),b=k.useRef(n),E=k.useRef(!0),C=k.useRef(null);b.current=n,E.current=l.length===0,k.useEffect(()=>{var _;const R=C.current;!R||R===n||((_=g.current)==null||_.abort(),g.current=null,S.current&&(clearTimeout(S.current),S.current=null),w.current=!1,C.current=null,c("ready"))},[n]);const T=k.useCallback((R,_)=>{if(w.current)return;w.current=!0,o==null||o(R);const x={id:`user_${Date.now()}`,role:"user",parts:[...(_??[]).map(A=>({type:"attachment",attachment:A})),{type:"text",content:R}],timestamp:Date.now()},I=`assistant_${Date.now()}`,M={id:I,role:"assistant",parts:[],timestamp:Date.now()},$=E.current;u(A=>[...A,x,M]),c("submitted"),f(null);const P=A=>{let V="",j="",O=[],U=!1;C.current=A;const m=()=>{const B=[...O];if(V){const K=B.findIndex(y=>y.type==="thinking");K>=0?B[K]={type:"thinking",content:V}:B.unshift({type:"thinking",content:V})}if(j){const K=B[B.length-1];(K==null?void 0:K.type)==="text"?B[B.length-1]={type:"text",content:j}:B.push({type:"text",content:j})}u(K=>K.map(y=>y.id===I?{...y,parts:B}:y))};g.current=t.chat({sessionId:A,message:R,attachments:_&&_.length>0?_:void 0,stream:!0,onMessage:B=>{if(C.current===A){switch(U||(U=!0,c("streaming")),B.type){case"thinking":V+=B.content;break;case"ai":j+=B.content;break;case"tool_call":j&&(O.push({type:"text",content:j}),j=""),O.push({type:"tool_call",toolName:B.toolName,toolCallId:B.toolCallId,args:B.args??"{}"});break;case"tool_result":j&&(O.push({type:"text",content:j}),j=""),O.push({type:"tool_result",toolName:B.toolName??"",toolCallId:B.toolCallId,content:B.content,artifacts:B.artifacts,renderMode:B.renderMode,html:B.html});break;case"interrupt":j&&(O.push({type:"text",content:j}),j=""),B.interrupt&&O.push({type:"interrupt",interrupt:B.interrupt,resolved:!1}),m(),w.current=!1,g.current=null,C.current=null;return;case"stop":B.content&&(j=B.content),m();return}m()}},onDone:B=>{C.current===A&&(j||O.length>0||V)&&m();const K=()=>{S.current&&(clearTimeout(S.current),S.current=null),s==null||s(B.sessionId||A),c("ready"),w.current=!1,g.current=null,C.current=null};if($){const y=R.slice(0,30),le=B.sessionId||A;t.renameConversation(le,y).catch(()=>{}).finally(K)}else K()},onError:B=>{C.current===A&&(O.push({type:"error",content:B.message}),m()),S.current&&(clearTimeout(S.current),S.current=null),f(B),c("error"),a==null||a(B),w.current=!1,g.current=null,C.current=null}}),i==null||i(A)};b.current?P(b.current):t.createSession().then(A=>{if(b.current){w.current=!1,c("ready");return}b.current=A,r==null||r(A),P(A)}).catch(A=>{f(A instanceof Error?A:new Error(String(A))),c("error"),a==null||a(A instanceof Error?A:new Error(String(A))),w.current=!1})},[t,r,i,s,a,o]),L=k.useCallback(()=>{const R=b.current;R&&(S.current&&clearTimeout(S.current),S.current=setTimeout(()=>{var _;S.current=null,(_=g.current)==null||_.abort(),g.current=null,w.current=!1,C.current=null,c("ready")},8e3),t.stopGeneration(R).catch(()=>{}))},[t]),v=k.useCallback(()=>{if(w.current)return;const R=l.findLastIndex(I=>I.role==="user");if(R<0)return;const _=l[R].parts.filter(I=>I.type==="text").map(I=>I.content).join(""),x=l[R].parts.filter(I=>I.type==="attachment").map(I=>I.attachment);u(I=>I.slice(0,R)),T(_,x.length>0?x:void 0)},[l,T]),N=k.useCallback((R,_)=>{u(j=>j.map(O=>({...O,parts:O.parts.map(U=>U.type==="interrupt"&&U.interrupt.interruptId===R?{...U,resolved:!0,response:_}:U)})));const x=b.current;if(!x)return;w.current=!0,C.current=x;const I=new AbortController;g.current=I;let M=0;u(j=>j.length>0&&j[j.length-1].role==="assistant"?(M=j[j.length-1].parts.length,j):(M=0,[...j,{id:`assistant_${Date.now()}`,role:"assistant",parts:[],timestamp:Date.now()}])),c("streaming");let $="",P="",A=[];const V=()=>{const j=[...A];if($){const O=j.findIndex(U=>U.type==="thinking");O>=0?j[O]={type:"thinking",content:$}:j.unshift({type:"thinking",content:$})}if(P){const O=j[j.length-1];(O==null?void 0:O.type)==="text"?j[j.length-1]={type:"text",content:P}:j.push({type:"text",content:P})}u(O=>{const U=O.findLastIndex(m=>m.role==="assistant");return U<0?O:O.map((m,B)=>B===U?{...m,parts:[...m.parts.slice(0,M),...j]}:m)})};t.respondInterrupt(R,x,_,j=>{if(C.current===x){switch(j.type){case"thinking":$+=j.content;break;case"ai":P+=j.content;break;case"tool_call":P&&(A.push({type:"text",content:P}),P=""),A.push({type:"tool_call",toolName:j.toolName,toolCallId:j.toolCallId,args:j.args??"{}"});break;case"tool_result":P&&(A.push({type:"text",content:P}),P=""),A.push({type:"tool_result",toolName:j.toolName??"",toolCallId:j.toolCallId,content:j.content,artifacts:j.artifacts,renderMode:j.renderMode,html:j.html});break;case"interrupt":P&&(A.push({type:"text",content:P}),P=""),j.interrupt&&A.push({type:"interrupt",interrupt:j.interrupt,resolved:!1}),w.current=!1,g.current=null,C.current=null;break;case"done":s==null||s(x),c("ready"),w.current=!1,g.current=null,C.current=null;break}V()}},j=>{C.current===x&&(A.push({type:"error",content:j.message}),V()),f(j),c("error"),w.current=!1,g.current=null,C.current=null,a==null||a(j)},I.signal).catch(j=>{C.current===x&&(a==null||a(j instanceof Error?j:new Error(String(j))),c("error"),w.current=!1,g.current=null,C.current=null)})},[t,a,s]);return{messages:l,status:p,error:h,sendMessage:T,stop:L,regenerate:v,setMessages:u,respondToInterrupt:N}}const Rr="sa_active_conversation",Pt=20;function Mn(e){try{return localStorage.getItem(`${Rr}_${e}`)}catch{return null}}function ma(e,t){try{const n=`${Rr}_${e}`;t?localStorage.setItem(n,t):localStorage.removeItem(n)}catch{}}function Pr(e){const{sdk:t,onConversationChange:n}=e,r=t.botId,[i,s]=k.useState([]),[a,o]=k.useState(()=>Mn(r)),[l,u]=k.useState(!1),[p,c]=k.useState(!0),h=k.useRef(!0),f=k.useRef(1),g=k.useRef(!1);k.useEffect(()=>()=>{h.current=!1},[]);const w=k.useCallback(N=>{o(N),ma(r,N),N&&(n==null||n(N))},[r,n]),S=k.useCallback(async()=>{if(!g.current){g.current=!0,u(!0);try{f.current=1;const N=await t.listConversations({page:1,size:Pt});if(!h.current)return;s(N.items),c(N.items.length<N.total);const R=Mn(r);R&&!N.items.find(_=>_.sessionId===R)&&w(null)}catch{}finally{g.current=!1,h.current&&u(!1)}}},[t,w]),b=k.useCallback(async()=>{if(!(g.current||!p)){g.current=!0,u(!0);try{const N=f.current+1,R=await t.listConversations({page:N,size:Pt});if(!h.current)return;f.current=N,s(x=>{const I=new Set(x.map($=>$.sessionId)),M=R.items.filter($=>!I.has($.sessionId));return[...x,...M]});const _=f.current*Pt;c(_<R.total)}catch{}finally{g.current=!1,h.current&&u(!1)}}},[t,p]),E=k.useCallback(async N=>(w(N),await t.getMessages(N)),[t,w]),C=k.useCallback(async()=>{try{const N=await t.createSession(),R=new Date().toISOString();s(_=>[{sessionId:N,botId:0,title:"新对话",createTime:R,updateTime:R},..._]),w(N)}catch{w(null)}},[t,w]),T=k.useCallback(async N=>{s(R=>R.filter(_=>_.sessionId!==N)),a===N&&w(null);try{await t.deleteConversation(N)}catch{}},[t,a,w]),L=k.useCallback(async(N,R)=>{await t.renameConversation(N,R),s(_=>_.map(x=>x.sessionId===N?{...x,title:R}:x))},[t]),{enabled:v=!0}=e;return k.useEffect(()=>{v&&S()},[v,S]),{conversations:i,activeConversationId:a,loading:l,hasMore:p,loadConversations:S,loadMore:b,switchConversation:E,newConversation:C,deleteConversation:T,renameConversation:L,setActiveConversationId:w}}function Fr(e){return!e&&e!==0?"":e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/1024/1024).toFixed(1)} MB`}function _r(e){return e==="pdf"?"PDF":e==="docx"?"DOC":e==="html"?"HTM":e.slice(0,3).toUpperCase()||"FILE"}function Or(e){if(!e)return[];const t=[];for(const n of e)n.type==="file"&&n.data&&t.push({id:n.data.id??"",type:n.data.fileType??n.data.type??"",filename:n.data.name??n.data.filename??"",url:n.data.url??"",mime:n.data.mime,size:n.data.size,summary:n.data.summary});return t}async function kt(e){try{const t=await fetch(e.url);if(!t.ok)throw new Error(`HTTP ${t.status}`);const n=await t.blob(),r=URL.createObjectURL(n),i=document.createElement("a");i.href=r,i.download=e.filename,document.body.appendChild(i),i.click(),i.remove(),setTimeout(()=>URL.revokeObjectURL(r),4e3)}catch{const t=document.createElement("a");t.href=e.url,t.download=e.filename,t.target="_blank",document.body.appendChild(t),t.click(),t.remove()}}const Br=k.createContext(null);function ke(){const e=k.useContext(Br);if(!e)throw new Error("useChatContext must be used within ChatProvider");return e}function Jt({sdk:e,hooks:t,attachmentUploader:n,nosUpload:r,children:i}){const[s,a]=k.useState(!1),[o,l]=k.useState(!1),[u,p]=k.useState(null),[c,h]=k.useState(null),[f,g]=k.useState(!1),[w,S]=k.useState(!1);k.useEffect(()=>{e.getToken().then(()=>{g(!0)}).catch(()=>{g(!0)})},[e]);const b=Pr({sdk:e,onConversationChange:t==null?void 0:t.onConversationChange,enabled:f}),E=Mr({sdk:e,sessionId:b.activeConversationId,onSessionCreated:j=>{b.setActiveConversationId(j)},onStreamStart:t==null?void 0:t.onStreamStart,onStreamEnd:j=>{var O;(O=t==null?void 0:t.onStreamEnd)==null||O.call(t,j),b.loadConversations()},onError:t==null?void 0:t.onError,onMessageSend:t==null?void 0:t.onMessageSend}),C=k.useCallback(j=>{if(j.type==="link"){window.open(j.url,j.target??"_blank","noopener");return}h(j)},[]),T=k.useCallback(()=>h(null),[]),L=k.useCallback(async j=>{S(!0);try{const O=await b.switchConversation(j);E.setMessages(O)}finally{S(!1)}},[b,E]),v=k.useCallback(async()=>{E.setMessages([]),await b.newConversation()},[b,E]),N=k.useCallback(async j=>{b.activeConversationId===j&&E.setMessages([]),await b.deleteConversation(j)},[b,E]);k.useEffect(()=>{b.activeConversationId&&E.messages.length===0&&(S(!0),e.getMessages(b.activeConversationId).then(j=>{E.setMessages(j)}).catch(()=>{}).finally(()=>S(!1)))},[]);const R=k.useCallback(()=>{a(j=>!j)},[]),_=k.useCallback(j=>{a(j)},[]),x=k.useCallback(()=>{l(j=>!j),p(j=>null)},[]),I=k.useCallback(j=>{p(j),l(!0)},[]),M=k.useMemo(()=>{const j=new Set,O=[];for(const U of E.messages)for(const m of U.parts)if(m.type==="tool_result"&&m.artifacts)for(const B of Or(m.artifacts)){const K=B.id||`${B.url}:${B.filename}`;j.has(K)||(j.add(K),O.push(B))}return O},[E.messages]),$=k.useCallback(async()=>{const j=b.activeConversationId;if(!j)return null;try{const O=await e.getMessages(j);E.setMessages(O);const U=O.findLast(m=>m.role==="assistant");return(U==null?void 0:U.id)??null}catch{return null}},[e,b.activeConversationId,E]),P=k.useCallback((j,O,U)=>{if(/^\d+$/.test(j)){e.feedback(j,O,U).catch(()=>{});return}$().then(m=>{m&&e.feedback(m,O,U).catch(()=>{})})},[e,$]),A=k.useCallback(j=>{if(/^\d+$/.test(j)){e.cancelFeedback(j).catch(()=>{});return}$().then(O=>{O&&e.cancelFeedback(O).catch(()=>{})})},[e,$]),V=k.useMemo(()=>({sdk:e,status:E.status,error:E.error,messages:E.messages,conversations:b.conversations,activeConversationId:b.activeConversationId,isThreadListOpen:s,isArtifactDrawerOpen:o,allArtifacts:M,activePreviewArtifact:u,activePanel:c,hasMore:b.hasMore,conversationsLoading:b.loading,messagesLoading:w,sendMessage:E.sendMessage,attachmentUploader:n??null,nosUpload:r??null,stop:E.stop,regenerate:E.regenerate,switchConversation:L,newConversation:v,deleteConversation:N,renameConversation:b.renameConversation,loadMoreConversations:b.loadMore,toggleThreadList:R,setThreadListOpen:_,toggleArtifactDrawer:x,openArtifactPreview:I,openPanel:C,closePanel:T,feedback:P,cancelFeedback:A,respondToInterrupt:E.respondToInterrupt}),[e,E.status,E.error,E.messages,E.sendMessage,E.stop,E.regenerate,E.respondToInterrupt,n,r,b.conversations,b.activeConversationId,b.renameConversation,b.hasMore,b.loadMore,b.loading,s,o,M,u,c,w,L,v,N,R,_,x,I,C,T,P,A]);return d.jsx(Br.Provider,{value:V,children:i})}const re="https://ehr-web.netease.com/ehr-web/erh-super-agent",ae={recently:`${re}/recently.svg`,home:`${re}/home.svg`,mergeWindow:`${re}/merge_window.svg`,spiltWindow:`${re}/spilt_window.svg`,close:`${re}/close.svg`,message:`${re}/message.svg`,messageCreate:`${re}/message_create.svg`,customerService:`${re}/customer_service.svg`,sendSolid:`${re}/send_solid.svg`,capabilityIcons:[`${re}/icon1.png`,`${re}/icon2.png`,`${re}/icon3.png`],triggerLogo:`${re}/HRlogo.png`,logo:`${re}/HRlogo2.png`,assistantAvatarGenerating:`${re}/profile0.gif`,assistantAvatar:`${re}/profile1.png`},ie={TRIGGER_SIZE:56,TRIGGER_RIGHT:20,TRIGGER_BOTTOM:80,DEFAULT_WIDTH:400,DEFAULT_HEIGHT:648,MIN_WIDTH:360,MAX_WIDTH:800,MAX_HEIGHT_RATIO:.95};function xa({defaultWidth:e=ie.DEFAULT_WIDTH,defaultHeight:t=ie.DEFAULT_HEIGHT,sidebarWidth:n=0}={}){const[r,i]=k.useState(e),[s,a]=k.useState({x:0,y:0}),[o,l]=k.useState(!1),[u,p]=k.useState(!1),[c,h]=k.useState(null),[f,g]=k.useState(()=>typeof window>"u"?{width:0,height:0}:{width:window.innerWidth,height:window.innerHeight}),w=k.useRef(!1),S=k.useRef(0),b=k.useRef(r),E=k.useRef(!1),C=k.useRef({x:0,y:0}),T=k.useRef({x:0,y:0}),L=k.useRef(!1),v=k.useRef(null);k.useEffect(()=>{const P=()=>g({width:window.innerWidth,height:window.innerHeight});return window.addEventListener("resize",P),()=>window.removeEventListener("resize",P)},[]),k.useEffect(()=>()=>{var P;(P=v.current)==null||P.call(v)},[]);const N=Math.floor(f.height*ie.MAX_HEIGHT_RATIO),R=Math.min(c||t,N),_=r+n;k.useEffect(()=>{if(!o){const P=f.width-_-20,A=f.height-R-20;a(V=>V.x===P&&V.y===A?V:{x:P,y:A})}},[o,_,R,f]);const x=k.useCallback(P=>{if(u||P.target.closest("button, input, textarea"))return;E.current=!0,L.current=!1,C.current={x:P.clientX,y:P.clientY},T.current={...s};const A=O=>{if(!E.current)return;const U=O.clientX-C.current.x,m=O.clientY-C.current.y;(Math.abs(U)>3||Math.abs(m)>3)&&(L.current=!0),L.current&&(l(!0),a({x:Math.max(-200,Math.min(T.current.x+U,window.innerWidth-100)),y:Math.max(0,Math.min(T.current.y+m,window.innerHeight-48))}))},V=()=>{E.current=!1,j()},j=()=>{document.removeEventListener("mousemove",A),document.removeEventListener("mouseup",V),v.current=null};document.addEventListener("mousemove",A),document.addEventListener("mouseup",V),v.current=j},[u,s]),I=k.useCallback(P=>{P.preventDefault(),P.stopPropagation(),w.current=!0,S.current=P.clientX,b.current=r;const A=s.x+r,V=s.y,j=m=>{if(!w.current)return;const B=m.clientX-S.current;let K=b.current-B;if(K>ie.MAX_WIDTH){w.current=!1,p(!0),U();return}K=Math.max(ie.MIN_WIDTH,K),i(K),a({x:A-K,y:V})},O=()=>{w.current=!1,U()},U=()=>{document.removeEventListener("mousemove",j),document.removeEventListener("mouseup",O),v.current=null};document.addEventListener("mousemove",j),document.addEventListener("mouseup",O),v.current=U},[r,s]),M=k.useCallback(()=>{u&&i(e),p(P=>!P)},[u,e]),$=k.useCallback(()=>{p(!1),i(e),l(!1),h(null)},[e]);return{width:r,position:s,hasCustomPosition:o,isMaximized:u,lockedHeight:c,viewport:f,defaultHeight:t,totalWidth:_,windowHeight:R,startWindowDrag:x,startResize:I,toggleMaximize:M,setIsMaximized:p,setLockedHeight:h,setHasCustomPosition:l,reset:$}}function ba(e){const{enabled:t,contentSelector:n,defaultHeight:r,onHeightChange:i}=e,s=k.useRef(null);return k.useEffect(()=>{if(!t||!s.current)return;const o=s.current.querySelector(n);if(!o)return;const l=()=>{const c=s.current;if(!c)return;const h=c.querySelector(n);if(!h)return;const f=c.offsetHeight-h.clientHeight,g=h.scrollHeight+f,w=Math.floor(window.innerHeight*ie.MAX_HEIGHT_RATIO),S=Math.max(r,Math.min(g,w));i(b=>b===S?b:S)};l();const u=new ResizeObserver(()=>l());Array.from(o.children).forEach(c=>u.observe(c));const p=new MutationObserver(()=>{Array.from(o.children).forEach(c=>u.observe(c)),l()});return p.observe(o,{childList:!0,subtree:!0,characterData:!0}),()=>{u.disconnect(),p.disconnect()}},[t,n,r,i]),s}function wa(e,t){const n=ie.TRIGGER_SIZE;return{x:Math.max(8,Math.min(e,window.innerWidth-n-8)),y:Math.max(8,Math.min(t,window.innerHeight-n-8))}}function $r({isOpen:e,onClick:t,triggerLogo:n}){const[r,i]=k.useState(null),s=k.useRef(!1),a=k.useRef(!1),o=k.useRef({x:0,y:0}),l=k.useRef({x:0,y:0}),u=k.useRef(null);k.useEffect(()=>()=>{var f;(f=u.current)==null||f.call(u)},[]);const p=k.useCallback(f=>{if(f.button!==0)return;s.current=!0,a.current=!1,o.current={x:f.clientX,y:f.clientY};const g=f.currentTarget.getBoundingClientRect();l.current={x:g.left,y:g.top};const w=b=>{if(!s.current)return;const E=b.clientX-o.current.x,C=b.clientY-o.current.y;(Math.abs(E)>4||Math.abs(C)>4)&&(a.current=!0),a.current&&i(wa(l.current.x+E,l.current.y+C))},S=()=>{s.current=!1,document.removeEventListener("mousemove",w),document.removeEventListener("mouseup",S),u.current=null};document.addEventListener("mousemove",w),document.addEventListener("mouseup",S),u.current=S},[]),c=k.useCallback(()=>{if(a.current){a.current=!1;return}t()},[t]),h=r?{left:r.x,top:r.y,width:ie.TRIGGER_SIZE,height:ie.TRIGGER_SIZE}:{right:ie.TRIGGER_RIGHT,bottom:ie.TRIGGER_BOTTOM,width:ie.TRIGGER_SIZE,height:ie.TRIGGER_SIZE};return d.jsx("button",{type:"button",className:`fixed z-[10000] flex items-center justify-center border-none bg-transparent p-0 transition-transform duration-200 ease-out hover:scale-[1.08] active:scale-95 ${e?"pointer-events-none scale-50 opacity-0":"opacity-100"}`,style:h,onMouseDown:p,onClick:c,"aria-label":"打开 AI 助手",title:"AI 助手",children:d.jsx("img",{src:n||ae.triggerLogo,alt:"AI 助手",className:"block h-full w-full",draggable:!1})})}function nt({tooltip:e,onClick:t,children:n}){return d.jsx("button",{type:"button",className:"sa-tip relative flex h-7 w-7 items-center justify-center rounded-md text-[#666] transition-colors hover:bg-white active:bg-[#F5F5F5]","data-tooltip":e,"aria-label":e,onClick:t,children:n})}function Hr({onClose:e,onToggleThreadList:t,isMaximized:n=!1,onToggleMaximize:r,showHome:i=!1,onHome:s,showClose:a=!0,artifactCount:o=0,onToggleArtifactDrawer:l}){return d.jsxs("div",{className:"relative z-20 flex h-9 shrink-0 select-none items-center justify-between px-[15px]",children:[d.jsxs("div",{className:"flex items-center gap-3",children:[d.jsx(nt,{tooltip:"历史记录",onClick:t,children:d.jsx("img",{src:ae.recently,alt:"",width:20,height:20})}),i&&s&&d.jsx(nt,{tooltip:"回到首页",onClick:s,children:d.jsx("img",{src:ae.home,alt:"",width:20,height:20})})]}),d.jsxs("div",{className:"flex items-center gap-2.5",children:[o>0&&l&&d.jsx(nt,{tooltip:"会话产物",onClick:l,children:d.jsxs("span",{className:"relative flex items-center gap-1",children:[d.jsxs("svg",{width:16,height:16,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[d.jsx("path",{d:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"}),d.jsx("polyline",{points:"14 2 14 8 20 8"})]}),o>0&&d.jsx("span",{className:"absolute -right-2 -top-1.5 min-w-[14px] rounded-full bg-[var(--sa-primary)] px-0.5 text-center text-[9px] font-medium leading-[14px] text-white",children:o>99?"99+":o})]})}),r&&d.jsx(nt,{tooltip:n?"小窗":"大窗",onClick:r,children:d.jsx("img",{src:n?ae.spiltWindow:ae.mergeWindow,alt:"",width:20,height:20})}),a&&d.jsx(nt,{tooltip:"关闭",onClick:e,children:d.jsx("img",{src:ae.close,alt:"",width:20,height:20})})]})]})}const rt=e=>String(e).padStart(2,"0");function ya(e){if(!e)return"";const t=new Date(e);return isNaN(t.getTime())?"":`${t.getFullYear()}-${rt(t.getMonth()+1)}-${rt(t.getDate())} ${rt(t.getHours())}:${rt(t.getMinutes())}:${rt(t.getSeconds())}`}function Ur(e){const t=new Date,n=new Date(t.getFullYear(),t.getMonth(),t.getDate()).getTime(),r=n-6*864e5,i=[],s=[],a=[];for(const l of e){const u=new Date(l.updateTime).getTime();u>=n?i.push(l):u>=r?s.push(l):a.push(l)}const o=[];return i.length&&o.push({label:"今天",items:i}),s.length&&o.push({label:"最近 7 天",items:s}),a.length&&o.push({label:"更早",items:a}),o}function Zt({width:e}){const{conversations:t,activeConversationId:n,switchConversation:r,newConversation:i,deleteConversation:s,renameConversation:a,hasMore:o,loadMoreConversations:l,conversationsLoading:u}=ke(),[p,c]=k.useState(null),[h,f]=k.useState(""),[g,w]=k.useState(null),S=k.useRef(null),b=k.useCallback((L,v)=>{c(L),f(v??"")},[]),E=k.useCallback(L=>{h.trim()&&a(L,h.trim()),c(null)},[h,a]),C=k.useCallback(()=>{const L=S.current;!L||!o||L.scrollHeight-L.scrollTop-L.clientHeight<50&&l()},[o,l]),T=k.useMemo(()=>Ur(t),[t]);return d.jsxs("div",{className:"relative z-[5] flex h-full shrink-0 flex-col overflow-visible border-r border-[#ECECEC] bg-[#FAFAFA] p-3 animate-sa-history-in",style:{width:e??200},children:[d.jsxs("button",{type:"button",className:"sa-new-chat mb-4 flex h-8 w-full shrink-0 items-center justify-center gap-2 rounded-md text-[14px] font-medium transition-colors",onClick:i,children:[d.jsx("img",{src:ae.messageCreate,alt:"",width:18,height:18}),d.jsx("span",{className:"sa-new-chat-text whitespace-nowrap",children:"新建对话"})]}),d.jsxs("div",{className:"px-1 pb-2.5",children:[d.jsx("div",{className:"mb-1 text-[14px] font-semibold text-[#333]",children:"历史对话"}),d.jsx("div",{className:"text-[11px] text-[#999]",children:"展示最近的会话记录"})]}),d.jsxs("div",{ref:S,className:"flex-1 overflow-y-auto",onScroll:C,children:[u&&t.length===0&&d.jsx("div",{className:"px-0.5 py-2 text-[12px] text-[#999]",children:"加载中..."}),!u&&t.length===0&&d.jsx("div",{className:"px-0.5 py-2 text-[12px] text-[#999]",children:"暂无记录"}),T.map(L=>d.jsxs("div",{className:"mb-1",children:[d.jsx("div",{className:"px-1 pb-1 pt-2 text-[11px] text-[#A0A0A0]",children:L.label}),L.items.map(v=>d.jsx("div",{className:`group relative mb-0.5 flex h-8 w-full cursor-pointer items-center gap-1 rounded-md px-0.5 text-[13px] transition-colors ${v.sessionId===n?"bg-[#E8F1FE]":"hover:bg-[#E8F1FE]"}`,onClick:()=>{p!==v.sessionId&&r(v.sessionId)},onMouseEnter:N=>{if(p===v.sessionId)return;const R=N.currentTarget.getBoundingClientRect();w({text:v.title||"新会话",x:R.right+8,y:R.top+R.height/2})},onMouseLeave:()=>w(null),children:p===v.sessionId?d.jsx("input",{className:"w-full rounded border border-[var(--sa-primary)] bg-white px-1.5 py-0.5 text-[12px] outline-none",value:h,onChange:N=>f(N.target.value),onBlur:()=>E(v.sessionId),onKeyDown:N=>{N.key==="Enter"&&E(v.sessionId),N.key==="Escape"&&c(null)},onClick:N=>N.stopPropagation(),autoFocus:!0}):d.jsxs(d.Fragment,{children:[d.jsx("img",{src:ae.message,alt:"",width:16,height:16,className:"shrink-0 opacity-60"}),d.jsx("span",{className:"flex-1 overflow-hidden text-ellipsis whitespace-nowrap text-left text-[#333]",children:v.title||"新会话"}),d.jsxs("span",{className:"hidden shrink-0 items-center gap-0.5 group-hover:flex",children:[d.jsx("button",{type:"button",className:"flex h-5 w-5 items-center justify-center rounded text-[#999] hover:bg-white/70 hover:text-[var(--sa-primary)]",onClick:N=>{N.stopPropagation(),b(v.sessionId,v.title)},title:"重命名",children:d.jsx("svg",{width:12,height:12,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:d.jsx("path",{d:"M17 3a2.85 2.83 0 1 1 4 4L7.5 20.5 2 22l1.5-5.5Z"})})}),d.jsx("button",{type:"button",className:"flex h-5 w-5 items-center justify-center rounded text-[#999] hover:bg-white/70 hover:text-[#ef4444]",onClick:N=>{N.stopPropagation(),s(v.sessionId)},title:"删除",children:d.jsx("svg",{width:12,height:12,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:d.jsx("path",{d:"M3 6h18M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"})})})]})]})},v.sessionId))]},L.label)),u&&t.length>0&&d.jsx("div",{className:"px-0.5 py-2 text-[12px] text-[#999]",children:o?"加载更多...":"加载中..."}),!u&&o&&d.jsx("div",{className:"px-0.5 py-2 text-center text-[11px] text-[#C0C0C0]",children:"向下滚动加载更多"})]}),g&&d.jsx("div",{className:"pointer-events-none fixed z-[10001] whitespace-nowrap rounded border border-[#E8E8E8] bg-white px-2.5 py-1.5 text-[12px] leading-[1.4] text-[#333] shadow-[0_2px_8px_rgba(0,0,0,0.12)]",style:{left:g.x,top:g.y,transform:"translateY(-50%)"},children:g.text})]})}function Vr(e){const t=k.useRef(null),n=k.useRef(!1),r=k.useRef(0),i=k.useCallback(()=>{const a=t.current;if(!a)return;const{scrollTop:o,scrollHeight:l,clientHeight:u}=a,p=l-o-u<40;o<r.current&&!p&&(n.current=!0),p&&(n.current=!1),r.current=o},[]);k.useEffect(()=>{const a=t.current;if(a)return a.addEventListener("scroll",i,{passive:!0}),()=>a.removeEventListener("scroll",i)},[i]),k.useEffect(()=>{if(n.current)return;const a=t.current;a&&requestAnimationFrame(()=>{a.scrollTop=a.scrollHeight})},e);const s=k.useCallback(()=>{n.current=!1;const a=t.current;a&&(a.scrollTop=a.scrollHeight)},[]);return{containerRef:t,scrollToBottom:s}}function ka(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const va=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Ca=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Sa={};function Rn(e,t){return(Sa.jsx?Ca:va).test(e)}const Ea=/[ \t\n\f\r]/g;function ja(e){return typeof e=="object"?e.type==="text"?Pn(e.value):!1:Pn(e)}function Pn(e){return e.replace(Ea,"")===""}class pt{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}pt.prototype.normal={};pt.prototype.property={};pt.prototype.space=void 0;function qr(e,t){const n={},r={};for(const i of e)Object.assign(n,i.property),Object.assign(r,i.normal);return new pt(n,r,t)}function en(e){return e.toLowerCase()}class pe{constructor(t,n){this.attribute=n,this.property=t}}pe.prototype.attribute="";pe.prototype.booleanish=!1;pe.prototype.boolean=!1;pe.prototype.commaOrSpaceSeparated=!1;pe.prototype.commaSeparated=!1;pe.prototype.defined=!1;pe.prototype.mustUseProperty=!1;pe.prototype.number=!1;pe.prototype.overloadedBoolean=!1;pe.prototype.property="";pe.prototype.spaceSeparated=!1;pe.prototype.space=void 0;let Ia=0;const W=$e(),te=$e(),tn=$e(),D=$e(),Z=$e(),_e=$e(),fe=$e();function $e(){return 2**++Ia}const nn=Object.freeze(Object.defineProperty({__proto__:null,boolean:W,booleanish:te,commaOrSpaceSeparated:fe,commaSeparated:_e,number:D,overloadedBoolean:tn,spaceSeparated:Z},Symbol.toStringTag,{value:"Module"})),Ft=Object.keys(nn);class fn extends pe{constructor(t,n,r,i){let s=-1;if(super(t,n),Fn(this,"space",i),typeof r=="number")for(;++s<Ft.length;){const a=Ft[s];Fn(this,Ft[s],(r&nn[a])===nn[a])}}}fn.prototype.defined=!0;function Fn(e,t,n){n&&(e[t]=n)}function Ge(e){const t={},n={};for(const[r,i]of Object.entries(e.properties)){const s=new fn(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(s.mustUseProperty=!0),t[r]=s,n[en(r)]=r,n[en(s.attribute)]=r}return new pt(t,n,e.space)}const Wr=Ge({properties:{ariaActiveDescendant:null,ariaAtomic:te,ariaAutoComplete:null,ariaBusy:te,ariaChecked:te,ariaColCount:D,ariaColIndex:D,ariaColSpan:D,ariaControls:Z,ariaCurrent:null,ariaDescribedBy:Z,ariaDetails:null,ariaDisabled:te,ariaDropEffect:Z,ariaErrorMessage:null,ariaExpanded:te,ariaFlowTo:Z,ariaGrabbed:te,ariaHasPopup:null,ariaHidden:te,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:Z,ariaLevel:D,ariaLive:null,ariaModal:te,ariaMultiLine:te,ariaMultiSelectable:te,ariaOrientation:null,ariaOwns:Z,ariaPlaceholder:null,ariaPosInSet:D,ariaPressed:te,ariaReadOnly:te,ariaRelevant:null,ariaRequired:te,ariaRoleDescription:Z,ariaRowCount:D,ariaRowIndex:D,ariaRowSpan:D,ariaSelected:te,ariaSetSize:D,ariaSort:null,ariaValueMax:D,ariaValueMin:D,ariaValueNow:D,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function Yr(e,t){return t in e?e[t]:t}function Gr(e,t){return Yr(e,t.toLowerCase())}const za=Ge({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:_e,acceptCharset:Z,accessKey:Z,action:null,allow:null,allowFullScreen:W,allowPaymentRequest:W,allowUserMedia:W,alpha:W,alt:null,as:null,async:W,autoCapitalize:null,autoComplete:Z,autoFocus:W,autoPlay:W,blocking:Z,capture:null,charSet:null,checked:W,cite:null,className:Z,closedBy:null,colorSpace:null,cols:D,colSpan:D,command:null,commandFor:null,content:null,contentEditable:te,controls:W,controlsList:Z,coords:D|_e,crossOrigin:null,data:null,dateTime:null,decoding:null,default:W,defer:W,dir:null,dirName:null,disabled:W,download:tn,draggable:te,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:W,formTarget:null,headers:Z,height:D,hidden:tn,high:D,href:null,hrefLang:null,htmlFor:Z,httpEquiv:Z,id:null,imageSizes:null,imageSrcSet:null,inert:W,inputMode:null,integrity:null,is:null,isMap:W,itemId:null,itemProp:Z,itemRef:Z,itemScope:W,itemType:Z,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:W,low:D,manifest:null,max:null,maxLength:D,media:null,method:null,min:null,minLength:D,multiple:W,muted:W,name:null,nonce:null,noModule:W,noValidate:W,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:W,optimum:D,pattern:null,ping:Z,placeholder:null,playsInline:W,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:W,referrerPolicy:null,rel:Z,required:W,reversed:W,rows:D,rowSpan:D,sandbox:Z,scope:null,scoped:W,seamless:W,selected:W,shadowRootClonable:W,shadowRootCustomElementRegistry:W,shadowRootDelegatesFocus:W,shadowRootMode:null,shadowRootSerializable:W,shape:null,size:D,sizes:null,slot:null,span:D,spellCheck:te,src:null,srcDoc:null,srcLang:null,srcSet:null,start:D,step:null,style:null,tabIndex:D,target:null,title:null,translate:null,type:null,typeMustMatch:W,useMap:null,value:te,width:D,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:Z,axis:null,background:null,bgColor:null,border:D,borderColor:null,bottomMargin:D,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:W,declare:W,event:null,face:null,frame:null,frameBorder:null,hSpace:D,leftMargin:D,link:null,longDesc:null,lowSrc:null,marginHeight:D,marginWidth:D,noResize:W,noHref:W,noShade:W,noWrap:W,object:null,profile:null,prompt:null,rev:null,rightMargin:D,rules:null,scheme:null,scrolling:te,standby:null,summary:null,text:null,topMargin:D,valueType:null,version:null,vAlign:null,vLink:null,vSpace:D,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:W,disablePictureInPicture:W,disableRemotePlayback:W,exportParts:_e,part:Z,prefix:null,property:null,results:D,security:null,unselectable:null},space:"html",transform:Gr}),Ta=Ge({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:fe,accentHeight:D,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:D,amplitude:D,arabicForm:null,ascent:D,attributeName:null,attributeType:null,azimuth:D,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:D,by:null,calcMode:null,capHeight:D,className:Z,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:D,diffuseConstant:D,direction:null,display:null,dur:null,divisor:D,dominantBaseline:null,download:W,dx:null,dy:null,edgeMode:null,editable:null,elevation:D,enableBackground:null,end:null,event:null,exponent:D,externalResourcesRequired:null,fill:null,fillOpacity:D,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:_e,g2:_e,glyphName:_e,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:D,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:D,horizOriginX:D,horizOriginY:D,id:null,ideographic:D,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:D,k:D,k1:D,k2:D,k3:D,k4:D,kernelMatrix:fe,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:D,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:D,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:D,overlineThickness:D,paintOrder:null,panose1:null,path:null,pathLength:D,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:Z,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:D,pointsAtY:D,pointsAtZ:D,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:fe,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:fe,rev:fe,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:fe,requiredFeatures:fe,requiredFonts:fe,requiredFormats:fe,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:D,specularExponent:D,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:D,strikethroughThickness:D,string:null,stroke:null,strokeDashArray:fe,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:D,strokeOpacity:D,strokeWidth:null,style:null,surfaceScale:D,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:fe,tabIndex:D,tableValues:null,target:null,targetX:D,targetY:D,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:fe,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:D,underlineThickness:D,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:D,values:null,vAlphabetic:D,vMathematical:D,vectorEffect:null,vHanging:D,vIdeographic:D,version:null,vertAdvY:D,vertOriginX:D,vertOriginY:D,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:D,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:Yr}),Xr=Ge({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()}}),Kr=Ge({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:Gr}),Qr=Ge({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),Aa={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"},Na=/[A-Z]/g,_n=/-[a-z]/g,Da=/^data[-\w.:]+$/i;function La(e,t){const n=en(t);let r=t,i=pe;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&Da.test(t)){if(t.charAt(4)==="-"){const s=t.slice(5).replace(_n,Ra);r="data"+s.charAt(0).toUpperCase()+s.slice(1)}else{const s=t.slice(4);if(!_n.test(s)){let a=s.replace(Na,Ma);a.charAt(0)!=="-"&&(a="-"+a),t="data"+a}}i=fn}return new i(r,t)}function Ma(e){return"-"+e.toLowerCase()}function Ra(e){return e.charAt(1).toUpperCase()}const Pa=qr([Wr,za,Xr,Kr,Qr],"html"),hn=qr([Wr,Ta,Xr,Kr,Qr],"svg");function Fa(e){return e.join(" ").trim()}var gn={},On=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,_a=/\n/g,Oa=/^\s*/,Ba=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,$a=/^:\s*/,Ha=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,Ua=/^[;\s]*/,Va=/^\s+|\s+$/g,qa=`
2
- `,Bn="/",$n="*",Fe="",Wa="comment",Ya="declaration";function Ga(e,t){if(typeof e!="string")throw new TypeError("First argument must be a string");if(!e)return[];t=t||{};var n=1,r=1;function i(g){var w=g.match(_a);w&&(n+=w.length);var S=g.lastIndexOf(qa);r=~S?g.length-S:r+g.length}function s(){var g={line:n,column:r};return function(w){return w.position=new a(g),u(),w}}function a(g){this.start=g,this.end={line:n,column:r},this.source=t.source}a.prototype.content=e;function o(g){var w=new Error(t.source+":"+n+":"+r+": "+g);if(w.reason=g,w.filename=t.source,w.line=n,w.column=r,w.source=e,!t.silent)throw w}function l(g){var w=g.exec(e);if(w){var S=w[0];return i(S),e=e.slice(S.length),w}}function u(){l(Oa)}function p(g){var w;for(g=g||[];w=c();)w!==!1&&g.push(w);return g}function c(){var g=s();if(!(Bn!=e.charAt(0)||$n!=e.charAt(1))){for(var w=2;Fe!=e.charAt(w)&&($n!=e.charAt(w)||Bn!=e.charAt(w+1));)++w;if(w+=2,Fe===e.charAt(w-1))return o("End of comment missing");var S=e.slice(2,w-2);return r+=2,i(S),e=e.slice(w),r+=2,g({type:Wa,comment:S})}}function h(){var g=s(),w=l(Ba);if(w){if(c(),!l($a))return o("property missing ':'");var S=l(Ha),b=g({type:Ya,property:Hn(w[0].replace(On,Fe)),value:S?Hn(S[0].replace(On,Fe)):Fe});return l(Ua),b}}function f(){var g=[];p(g);for(var w;w=h();)w!==!1&&(g.push(w),p(g));return g}return u(),f()}function Hn(e){return e?e.replace(Va,Fe):Fe}var Xa=Ga,Ka=Oe.commonjsGlobal&&Oe.commonjsGlobal.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(gn,"__esModule",{value:!0});gn.default=Ja;const Qa=Ka(Xa);function Ja(e,t){let n=null;if(!e||typeof e!="string")return n;const r=(0,Qa.default)(e),i=typeof t=="function";return r.forEach(s=>{if(s.type!=="declaration")return;const{property:a,value:o}=s;i?t(a,o,s):o&&(n=n||{},n[a]=o)}),n}var jt={};Object.defineProperty(jt,"__esModule",{value:!0});jt.camelCase=void 0;var Za=/^--[a-zA-Z0-9_-]+$/,es=/-([a-z])/g,ts=/^[^-]+$/,ns=/^-(webkit|moz|ms|o|khtml)-/,rs=/^-(ms)-/,is=function(e){return!e||ts.test(e)||Za.test(e)},as=function(e,t){return t.toUpperCase()},Un=function(e,t){return"".concat(t,"-")},ss=function(e,t){return t===void 0&&(t={}),is(e)?e:(e=e.toLowerCase(),t.reactCompat?e=e.replace(rs,Un):e=e.replace(ns,Un),e.replace(es,as))};jt.camelCase=ss;var os=Oe.commonjsGlobal&&Oe.commonjsGlobal.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},ls=os(gn),us=jt;function rn(e,t){var n={};return!e||typeof e!="string"||(0,ls.default)(e,function(r,i){r&&i&&(n[(0,us.camelCase)(r,t)]=i)}),n}rn.default=rn;var cs=rn;const ps=Oe.getDefaultExportFromCjs(cs),Jr=Zr("end"),mn=Zr("start");function Zr(e){return t;function t(n){const r=n&&n.position&&n.position[e]||{};if(typeof r.line=="number"&&r.line>0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function ds(e){const t=mn(e),n=Jr(e);if(t&&n)return{start:t,end:n}}function st(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?Vn(e.position):"start"in e||"end"in e?Vn(e):"line"in e||"column"in e?an(e):""}function an(e){return qn(e&&e.line)+":"+qn(e&&e.column)}function Vn(e){return an(e&&e.start)+"-"+an(e&&e.end)}function qn(e){return e&&typeof e=="number"?e:1}class oe extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let i="",s={},a=!1;if(n&&("line"in n&&"column"in n?s={place:n}:"start"in n&&"end"in n?s={place:n}:"type"in n?s={ancestors:[n],place:n.position}:s={...n}),typeof t=="string"?i=t:!s.cause&&t&&(a=!0,i=t.message,s.cause=t),!s.ruleId&&!s.source&&typeof r=="string"){const l=r.indexOf(":");l===-1?s.ruleId=r:(s.source=r.slice(0,l),s.ruleId=r.slice(l+1))}if(!s.place&&s.ancestors&&s.ancestors){const l=s.ancestors[s.ancestors.length-1];l&&(s.place=l.position)}const o=s.place&&"start"in s.place?s.place.start:s.place;this.ancestors=s.ancestors||void 0,this.cause=s.cause||void 0,this.column=o?o.column:void 0,this.fatal=void 0,this.file="",this.message=i,this.line=o?o.line:void 0,this.name=st(s.place)||"1:1",this.place=s.place||void 0,this.reason=this.message,this.ruleId=s.ruleId||void 0,this.source=s.source||void 0,this.stack=a&&s.cause&&typeof s.cause.stack=="string"?s.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}oe.prototype.file="";oe.prototype.name="";oe.prototype.reason="";oe.prototype.message="";oe.prototype.stack="";oe.prototype.column=void 0;oe.prototype.line=void 0;oe.prototype.ancestors=void 0;oe.prototype.cause=void 0;oe.prototype.fatal=void 0;oe.prototype.place=void 0;oe.prototype.ruleId=void 0;oe.prototype.source=void 0;const xn={}.hasOwnProperty,fs=new Map,hs=/[A-Z]/g,gs=new Set(["table","tbody","thead","tfoot","tr"]),ms=new Set(["td","th"]),ei="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function xs(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let r;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=Es(n,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=Ss(n,t.jsx,t.jsxs)}const 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"?hn:Pa,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},s=ti(i,e,void 0);return s&&typeof s!="string"?s:i.create(e,i.Fragment,{children:s||void 0},void 0)}function ti(e,t,n){if(t.type==="element")return bs(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return ws(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return ks(e,t,n);if(t.type==="mdxjsEsm")return ys(e,t);if(t.type==="root")return vs(e,t,n);if(t.type==="text")return Cs(e,t)}function bs(e,t,n){const r=e.schema;let i=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(i=hn,e.schema=i),e.ancestors.push(t);const s=ri(e,t.tagName,!1),a=js(e,t);let o=wn(e,t);return gs.has(t.tagName)&&(o=o.filter(function(l){return typeof l=="string"?!ja(l):!0})),ni(e,a,s,t),bn(a,o),e.ancestors.pop(),e.schema=r,e.create(t,s,a,n)}function ws(e,t){if(t.data&&t.data.estree&&e.evaluater){const r=t.data.estree.body[0];return r.type,e.evaluater.evaluateExpression(r.expression)}ut(e,t.position)}function ys(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);ut(e,t.position)}function ks(e,t,n){const r=e.schema;let i=r;t.name==="svg"&&r.space==="html"&&(i=hn,e.schema=i),e.ancestors.push(t);const s=t.name===null?e.Fragment:ri(e,t.name,!0),a=Is(e,t),o=wn(e,t);return ni(e,a,s,t),bn(a,o),e.ancestors.pop(),e.schema=r,e.create(t,s,a,n)}function vs(e,t,n){const r={};return bn(r,wn(e,t)),e.create(t,e.Fragment,r,n)}function Cs(e,t){return t.value}function ni(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function bn(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function Ss(e,t,n){return r;function r(i,s,a,o){const u=Array.isArray(a.children)?n:t;return o?u(s,a,o):u(s,a)}}function Es(e,t){return n;function n(r,i,s,a){const o=Array.isArray(s.children),l=mn(r);return t(i,s,a,o,{columnNumber:l?l.column-1:void 0,fileName:e,lineNumber:l?l.line:void 0},void 0)}}function js(e,t){const n={};let r,i;for(i in t.properties)if(i!=="children"&&xn.call(t.properties,i)){const s=zs(e,i,t.properties[i]);if(s){const[a,o]=s;e.tableCellAlignToStyle&&a==="align"&&typeof o=="string"&&ms.has(t.tagName)?r=o:n[a]=o}}if(r){const s=n.style||(n.style={});s[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function Is(e,t){const n={};for(const r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const s=r.data.estree.body[0];s.type;const a=s.expression;a.type;const o=a.properties[0];o.type,Object.assign(n,e.evaluater.evaluateExpression(o.argument))}else ut(e,t.position);else{const i=r.name;let s;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const o=r.value.data.estree.body[0];o.type,s=e.evaluater.evaluateExpression(o.expression)}else ut(e,t.position);else s=r.value===null?!0:r.value;n[i]=s}return n}function wn(e,t){const n=[];let r=-1;const i=e.passKeys?new Map:fs;for(;++r<t.children.length;){const s=t.children[r];let a;if(e.passKeys){const l=s.type==="element"?s.tagName:s.type==="mdxJsxFlowElement"||s.type==="mdxJsxTextElement"?s.name:void 0;if(l){const u=i.get(l)||0;a=l+"-"+u,i.set(l,u+1)}}const o=ti(e,s,a);o!==void 0&&n.push(o)}return n}function zs(e,t,n){const r=La(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?ka(n):Fa(n)),r.property==="style"){let i=typeof n=="object"?n:Ts(e,String(n));return e.stylePropertyNameCase==="css"&&(i=As(i)),["style",i]}return[e.elementAttributeNameCase==="react"&&r.space?Aa[r.property]||r.property:r.attribute,n]}}function Ts(e,t){try{return ps(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const r=n,i=new oe("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:r,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw i.file=e.filePath||void 0,i.url=ei+"#cannot-parse-style-attribute",i}}function ri(e,t,n){let r;if(!n)r={type:"Literal",value:t};else if(t.includes(".")){const i=t.split(".");let s=-1,a;for(;++s<i.length;){const o=Rn(i[s])?{type:"Identifier",name:i[s]}:{type:"Literal",value:i[s]};a=a?{type:"MemberExpression",object:a,property:o,computed:!!(s&&o.type==="Literal"),optional:!1}:o}r=a}else r=Rn(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const i=r.value;return xn.call(e.components,i)?e.components[i]:i}if(e.evaluater)return e.evaluater.evaluateExpression(r);ut(e)}function ut(e,t){const n=new oe("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=ei+"#cannot-handle-mdx-estrees-without-createevaluater",n}function As(e){const t={};let n;for(n in e)xn.call(e,n)&&(t[Ns(n)]=e[n]);return t}function Ns(e){let t=e.replace(hs,Ds);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function Ds(e){return"-"+e.toLowerCase()}const _t={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"]},Ls={};function yn(e,t){const n=Ls,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,i=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return ii(e,r,i)}function ii(e,t,n){if(Ms(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 Wn(e.children,t,n)}return Array.isArray(e)?Wn(e,t,n):""}function Wn(e,t,n){const r=[];let i=-1;for(;++i<e.length;)r[i]=ii(e[i],t,n);return r.join("")}function Ms(e){return!!(e&&typeof e=="object")}const Yn=document.createElement("i");function kn(e){const t="&"+e+";";Yn.innerHTML=t;const n=Yn.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function he(e,t,n,r){const i=e.length;let s=0,a;if(t<0?t=-t>i?0:i+t:t=t>i?i:t,n=n>0?n:0,r.length<1e4)a=Array.from(r),a.unshift(t,n),e.splice(...a);else for(n&&e.splice(t,n);s<r.length;)a=r.slice(s,s+1e4),a.unshift(t,0),e.splice(...a),s+=1e4,t+=1e4}function xe(e,t){return e.length>0?(he(e,e.length,0,t),e):t}const Gn={}.hasOwnProperty;function ai(e){const t={};let n=-1;for(;++n<e.length;)Rs(t,e[n]);return t}function Rs(e,t){let n;for(n in t){const i=(Gn.call(e,n)?e[n]:void 0)||(e[n]={}),s=t[n];let a;if(s)for(a in s){Gn.call(i,a)||(i[a]=[]);const o=s[a];Ps(i[a],Array.isArray(o)?o:o?[o]:[])}}}function Ps(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);he(e,0,0,r)}function si(e,t){const 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 we(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const ue=De(/[A-Za-z]/),se=De(/[\dA-Za-z]/),Fs=De(/[#-'*+\--9=?A-Z^-~]/);function vt(e){return e!==null&&(e<32||e===127)}const sn=De(/\d/),_s=De(/[\dA-Fa-f]/),Os=De(/[!-/:-@[-`{-~]/);function H(e){return e!==null&&e<-2}function ee(e){return e!==null&&(e<0||e===32)}function G(e){return e===-2||e===-1||e===32}const It=De(new RegExp("\\p{P}|\\p{S}","u")),Be=De(/\s/);function De(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function Xe(e){const t=[];let n=-1,r=0,i=0;for(;++n<e.length;){const s=e.charCodeAt(n);let a="";if(s===37&&se(e.charCodeAt(n+1))&&se(e.charCodeAt(n+2)))i=2;else if(s<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(s))||(a=String.fromCharCode(s));else if(s>55295&&s<57344){const o=e.charCodeAt(n+1);s<56320&&o>56319&&o<57344?(a=String.fromCharCode(s,o),i=1):a="�"}else a=String.fromCharCode(s);a&&(t.push(e.slice(r,n),encodeURIComponent(a)),r=n+i+1,a=""),i&&(n+=i,i=0)}return t.join("")+e.slice(r)}function Q(e,t,n,r){const i=r?r-1:Number.POSITIVE_INFINITY;let s=0;return a;function a(l){return G(l)?(e.enter(n),o(l)):t(l)}function o(l){return G(l)&&s++<i?(e.consume(l),o):(e.exit(n),t(l))}}const Bs={tokenize:$s};function $s(e){const t=e.attempt(this.parser.constructs.contentInitial,r,i);let n;return t;function r(o){if(o===null){e.consume(o);return}return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),Q(e,t,"linePrefix")}function i(o){return e.enter("paragraph"),s(o)}function s(o){const l=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=l),n=l,a(o)}function a(o){if(o===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(o);return}return H(o)?(e.consume(o),e.exit("chunkText"),s):(e.consume(o),a)}}const Hs={tokenize:Us},Xn={tokenize:Vs};function Us(e){const t=this,n=[];let r=0,i,s,a;return o;function o(C){if(r<n.length){const T=n[r];return t.containerState=T[1],e.attempt(T[0].continuation,l,u)(C)}return u(C)}function l(C){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&E();const T=t.events.length;let L=T,v;for(;L--;)if(t.events[L][0]==="exit"&&t.events[L][1].type==="chunkFlow"){v=t.events[L][1].end;break}b(r);let N=T;for(;N<t.events.length;)t.events[N][1].end={...v},N++;return he(t.events,L+1,0,t.events.slice(T)),t.events.length=N,u(C)}return o(C)}function u(C){if(r===n.length){if(!i)return h(C);if(i.currentConstruct&&i.currentConstruct.concrete)return g(C);t.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(Xn,p,c)(C)}function p(C){return i&&E(),b(r),h(C)}function c(C){return t.parser.lazy[t.now().line]=r!==n.length,a=t.now().offset,g(C)}function h(C){return t.containerState={},e.attempt(Xn,f,g)(C)}function f(C){return r++,n.push([t.currentConstruct,t.containerState]),h(C)}function g(C){if(C===null){i&&E(),b(0),e.consume(C);return}return i=i||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:i,contentType:"flow",previous:s}),w(C)}function w(C){if(C===null){S(e.exit("chunkFlow"),!0),b(0),e.consume(C);return}return H(C)?(e.consume(C),S(e.exit("chunkFlow")),r=0,t.interrupt=void 0,o):(e.consume(C),w)}function S(C,T){const L=t.sliceStream(C);if(T&&L.push(null),C.previous=s,s&&(s.next=C),s=C,i.defineSkip(C.start),i.write(L),t.parser.lazy[C.start.line]){let v=i.events.length;for(;v--;)if(i.events[v][1].start.offset<a&&(!i.events[v][1].end||i.events[v][1].end.offset>a))return;const N=t.events.length;let R=N,_,x;for(;R--;)if(t.events[R][0]==="exit"&&t.events[R][1].type==="chunkFlow"){if(_){x=t.events[R][1].end;break}_=!0}for(b(r),v=N;v<t.events.length;)t.events[v][1].end={...x},v++;he(t.events,R+1,0,t.events.slice(N)),t.events.length=v}}function b(C){let T=n.length;for(;T-- >C;){const L=n[T];t.containerState=L[1],L[0].exit.call(t,e)}n.length=C}function E(){i.write([null]),s=void 0,i=void 0,t.containerState._closeFlow=void 0}}function Vs(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 Ye(e){if(e===null||ee(e)||Be(e))return 1;if(It(e))return 2}function zt(e,t,n){const r=[];let i=-1;for(;++i<e.length;){const s=e[i].resolveAll;s&&!r.includes(s)&&(t=s(t,n),r.push(s))}return t}const on={name:"attention",resolveAll:qs,tokenize:Ws};function qs(e,t){let n=-1,r,i,s,a,o,l,u,p;for(;++n<e.length;)if(e[n][0]==="enter"&&e[n][1].type==="attentionSequence"&&e[n][1]._close){for(r=n;r--;)if(e[r][0]==="exit"&&e[r][1].type==="attentionSequence"&&e[r][1]._open&&t.sliceSerialize(e[r][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[r][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;l=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const c={...e[r][1].end},h={...e[n][1].start};Kn(c,-l),Kn(h,l),a={type:l>1?"strongSequence":"emphasisSequence",start:c,end:{...e[r][1].end}},o={type:l>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:h},s={type:l>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[n][1].start}},i={type:l>1?"strong":"emphasis",start:{...a.start},end:{...o.end}},e[r][1].end={...a.start},e[n][1].start={...o.end},u=[],e[r][1].end.offset-e[r][1].start.offset&&(u=xe(u,[["enter",e[r][1],t],["exit",e[r][1],t]])),u=xe(u,[["enter",i,t],["enter",a,t],["exit",a,t],["enter",s,t]]),u=xe(u,zt(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),u=xe(u,[["exit",s,t],["enter",o,t],["exit",o,t],["exit",i,t]]),e[n][1].end.offset-e[n][1].start.offset?(p=2,u=xe(u,[["enter",e[n][1],t],["exit",e[n][1],t]])):p=0,he(e,r-1,n-r+3,u),n=r+u.length-p-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function Ws(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=Ye(r);let s;return a;function a(l){return s=l,e.enter("attentionSequence"),o(l)}function o(l){if(l===s)return e.consume(l),o;const u=e.exit("attentionSequence"),p=Ye(l),c=!p||p===2&&i||n.includes(l),h=!i||i===2&&p||n.includes(r);return u._open=!!(s===42?c:c&&(i||!h)),u._close=!!(s===42?h:h&&(p||!c)),t(l)}}function Kn(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const Ys={name:"autolink",tokenize:Gs};function Gs(e,t,n){let r=0;return i;function i(f){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(f),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),s}function s(f){return ue(f)?(e.consume(f),a):f===64?n(f):u(f)}function a(f){return f===43||f===45||f===46||se(f)?(r=1,o(f)):u(f)}function o(f){return f===58?(e.consume(f),r=0,l):(f===43||f===45||f===46||se(f))&&r++<32?(e.consume(f),o):(r=0,u(f))}function l(f){return f===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(f),e.exit("autolinkMarker"),e.exit("autolink"),t):f===null||f===32||f===60||vt(f)?n(f):(e.consume(f),l)}function u(f){return f===64?(e.consume(f),p):Fs(f)?(e.consume(f),u):n(f)}function p(f){return se(f)?c(f):n(f)}function c(f){return f===46?(e.consume(f),r=0,p):f===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(f),e.exit("autolinkMarker"),e.exit("autolink"),t):h(f)}function h(f){if((f===45||se(f))&&r++<63){const g=f===45?h:c;return e.consume(f),g}return n(f)}}const dt={partial:!0,tokenize:Xs};function Xs(e,t,n){return r;function r(s){return G(s)?Q(e,i,"linePrefix")(s):i(s)}function i(s){return s===null||H(s)?t(s):n(s)}}const oi={continuation:{tokenize:Qs},exit:Js,name:"blockQuote",tokenize:Ks};function Ks(e,t,n){const r=this;return i;function i(a){if(a===62){const o=r.containerState;return o.open||(e.enter("blockQuote",{_container:!0}),o.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(a),e.exit("blockQuoteMarker"),s}return n(a)}function s(a){return G(a)?(e.enter("blockQuotePrefixWhitespace"),e.consume(a),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(a))}}function Qs(e,t,n){const r=this;return i;function i(a){return G(a)?Q(e,s,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a):s(a)}function s(a){return e.attempt(oi,t,n)(a)}}function Js(e){e.exit("blockQuote")}const li={name:"characterEscape",tokenize:Zs};function Zs(e,t,n){return r;function r(s){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(s),e.exit("escapeMarker"),i}function i(s){return Os(s)?(e.enter("characterEscapeValue"),e.consume(s),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(s)}}const ui={name:"characterReference",tokenize:eo};function eo(e,t,n){const r=this;let i=0,s,a;return o;function o(c){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(c),e.exit("characterReferenceMarker"),l}function l(c){return c===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(c),e.exit("characterReferenceMarkerNumeric"),u):(e.enter("characterReferenceValue"),s=31,a=se,p(c))}function u(c){return c===88||c===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(c),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),s=6,a=_s,p):(e.enter("characterReferenceValue"),s=7,a=sn,p(c))}function p(c){if(c===59&&i){const h=e.exit("characterReferenceValue");return a===se&&!kn(r.sliceSerialize(h))?n(c):(e.enter("characterReferenceMarker"),e.consume(c),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return a(c)&&i++<s?(e.consume(c),p):n(c)}}const Qn={partial:!0,tokenize:no},Jn={concrete:!0,name:"codeFenced",tokenize:to};function to(e,t,n){const r=this,i={partial:!0,tokenize:L};let s=0,a=0,o;return l;function l(v){return u(v)}function u(v){const N=r.events[r.events.length-1];return s=N&&N[1].type==="linePrefix"?N[2].sliceSerialize(N[1],!0).length:0,o=v,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),p(v)}function p(v){return v===o?(a++,e.consume(v),p):a<3?n(v):(e.exit("codeFencedFenceSequence"),G(v)?Q(e,c,"whitespace")(v):c(v))}function c(v){return v===null||H(v)?(e.exit("codeFencedFence"),r.interrupt?t(v):e.check(Qn,w,T)(v)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),h(v))}function h(v){return v===null||H(v)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),c(v)):G(v)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),Q(e,f,"whitespace")(v)):v===96&&v===o?n(v):(e.consume(v),h)}function f(v){return v===null||H(v)?c(v):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),g(v))}function g(v){return v===null||H(v)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),c(v)):v===96&&v===o?n(v):(e.consume(v),g)}function w(v){return e.attempt(i,T,S)(v)}function S(v){return e.enter("lineEnding"),e.consume(v),e.exit("lineEnding"),b}function b(v){return s>0&&G(v)?Q(e,E,"linePrefix",s+1)(v):E(v)}function E(v){return v===null||H(v)?e.check(Qn,w,T)(v):(e.enter("codeFlowValue"),C(v))}function C(v){return v===null||H(v)?(e.exit("codeFlowValue"),E(v)):(e.consume(v),C)}function T(v){return e.exit("codeFenced"),t(v)}function L(v,N,R){let _=0;return x;function x(A){return v.enter("lineEnding"),v.consume(A),v.exit("lineEnding"),I}function I(A){return v.enter("codeFencedFence"),G(A)?Q(v,M,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(A):M(A)}function M(A){return A===o?(v.enter("codeFencedFenceSequence"),$(A)):R(A)}function $(A){return A===o?(_++,v.consume(A),$):_>=a?(v.exit("codeFencedFenceSequence"),G(A)?Q(v,P,"whitespace")(A):P(A)):R(A)}function P(A){return A===null||H(A)?(v.exit("codeFencedFence"),N(A)):R(A)}}}function no(e,t,n){const r=this;return i;function i(a){return a===null?n(a):(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),s)}function s(a){return r.parser.lazy[r.now().line]?n(a):t(a)}}const Ot={name:"codeIndented",tokenize:io},ro={partial:!0,tokenize:ao};function io(e,t,n){const r=this;return i;function i(u){return e.enter("codeIndented"),Q(e,s,"linePrefix",5)(u)}function s(u){const p=r.events[r.events.length-1];return p&&p[1].type==="linePrefix"&&p[2].sliceSerialize(p[1],!0).length>=4?a(u):n(u)}function a(u){return u===null?l(u):H(u)?e.attempt(ro,a,l)(u):(e.enter("codeFlowValue"),o(u))}function o(u){return u===null||H(u)?(e.exit("codeFlowValue"),a(u)):(e.consume(u),o)}function l(u){return e.exit("codeIndented"),t(u)}}function ao(e,t,n){const r=this;return i;function i(a){return r.parser.lazy[r.now().line]?n(a):H(a)?(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),i):Q(e,s,"linePrefix",5)(a)}function s(a){const o=r.events[r.events.length-1];return o&&o[1].type==="linePrefix"&&o[2].sliceSerialize(o[1],!0).length>=4?t(a):H(a)?i(a):n(a)}}const so={name:"codeText",previous:lo,resolve:oo,tokenize:uo};function oo(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 lo(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function uo(e,t,n){let r=0,i,s;return a;function a(c){return e.enter("codeText"),e.enter("codeTextSequence"),o(c)}function o(c){return c===96?(e.consume(c),r++,o):(e.exit("codeTextSequence"),l(c))}function l(c){return c===null?n(c):c===32?(e.enter("space"),e.consume(c),e.exit("space"),l):c===96?(s=e.enter("codeTextSequence"),i=0,p(c)):H(c)?(e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),l):(e.enter("codeTextData"),u(c))}function u(c){return c===null||c===32||c===96||H(c)?(e.exit("codeTextData"),l(c)):(e.consume(c),u)}function p(c){return c===96?(e.consume(c),i++,p):i===r?(e.exit("codeTextSequence"),e.exit("codeText"),t(c)):(s.type="codeTextData",u(c))}}class co{constructor(t){this.left=t?[...t]:[],this.right=[]}get(t){if(t<0||t>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return t<this.left.length?this.left[t]:this.right[this.right.length-t+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(t,n){const r=n??Number.POSITIVE_INFINITY;return r<this.left.length?this.left.slice(t,r):t>this.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(t,n,r){const i=n||0;this.setCursor(Math.trunc(t));const s=this.right.splice(this.right.length-i,Number.POSITIVE_INFINITY);return r&&it(this.left,r),s.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),it(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),it(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t<this.left.length){const n=this.left.splice(t,Number.POSITIVE_INFINITY);it(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);it(this.left,n.reverse())}}}function it(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 ci(e){const t={};let n=-1,r,i,s,a,o,l,u;const p=new co(e);for(;++n<p.length;){for(;n in t;)n=t[n];if(r=p.get(n),n&&r[1].type==="chunkFlow"&&p.get(n-1)[1].type==="listItemPrefix"&&(l=r[1]._tokenizer.events,s=0,s<l.length&&l[s][1].type==="lineEndingBlank"&&(s+=2),s<l.length&&l[s][1].type==="content"))for(;++s<l.length&&l[s][1].type!=="content";)l[s][1].type==="chunkText"&&(l[s][1]._isInFirstContentOfListItem=!0,s++);if(r[0]==="enter")r[1].contentType&&(Object.assign(t,po(p,n)),n=t[n],u=!0);else if(r[1]._container){for(s=n,i=void 0;s--;)if(a=p.get(s),a[1].type==="lineEnding"||a[1].type==="lineEndingBlank")a[0]==="enter"&&(i&&(p.get(i)[1].type="lineEndingBlank"),a[1].type="lineEnding",i=s);else if(!(a[1].type==="linePrefix"||a[1].type==="listItemIndent"))break;i&&(r[1].end={...p.get(i)[1].start},o=p.slice(i,n),o.unshift(r),p.splice(i,n-i+1,o))}}return he(e,0,Number.POSITIVE_INFINITY,p.slice(0)),!u}function po(e,t){const n=e.get(t)[1],r=e.get(t)[2];let i=t-1;const s=[];let a=n._tokenizer;a||(a=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(a._contentTypeTextTrailing=!0));const o=a.events,l=[],u={};let p,c,h=-1,f=n,g=0,w=0;const S=[w];for(;f;){for(;e.get(++i)[1]!==f;);s.push(i),f._tokenizer||(p=r.sliceStream(f),f.next||p.push(null),c&&a.defineSkip(f.start),f._isInFirstContentOfListItem&&(a._gfmTasklistFirstContentOfListItem=!0),a.write(p),f._isInFirstContentOfListItem&&(a._gfmTasklistFirstContentOfListItem=void 0)),c=f,f=f.next}for(f=n;++h<o.length;)o[h][0]==="exit"&&o[h-1][0]==="enter"&&o[h][1].type===o[h-1][1].type&&o[h][1].start.line!==o[h][1].end.line&&(w=h+1,S.push(w),f._tokenizer=void 0,f.previous=void 0,f=f.next);for(a.events=[],f?(f._tokenizer=void 0,f.previous=void 0):S.pop(),h=S.length;h--;){const b=o.slice(S[h],S[h+1]),E=s.pop();l.push([E,E+b.length-1]),e.splice(E,2,b)}for(l.reverse(),h=-1;++h<l.length;)u[g+l[h][0]]=g+l[h][1],g+=l[h][1]-l[h][0]-1;return u}const fo={resolve:go,tokenize:mo},ho={partial:!0,tokenize:xo};function go(e){return ci(e),e}function mo(e,t){let n;return r;function r(o){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),i(o)}function i(o){return o===null?s(o):H(o)?e.check(ho,a,s)(o):(e.consume(o),i)}function s(o){return e.exit("chunkContent"),e.exit("content"),t(o)}function a(o){return e.consume(o),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,i}}function xo(e,t,n){const r=this;return i;function i(a){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),Q(e,s,"linePrefix")}function s(a){if(a===null||H(a))return n(a);const o=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&o&&o[1].type==="linePrefix"&&o[2].sliceSerialize(o[1],!0).length>=4?t(a):e.interrupt(r.parser.constructs.flow,n,t)(a)}}function pi(e,t,n,r,i,s,a,o,l){const u=l||Number.POSITIVE_INFINITY;let p=0;return c;function c(b){return b===60?(e.enter(r),e.enter(i),e.enter(s),e.consume(b),e.exit(s),h):b===null||b===32||b===41||vt(b)?n(b):(e.enter(r),e.enter(a),e.enter(o),e.enter("chunkString",{contentType:"string"}),w(b))}function h(b){return b===62?(e.enter(s),e.consume(b),e.exit(s),e.exit(i),e.exit(r),t):(e.enter(o),e.enter("chunkString",{contentType:"string"}),f(b))}function f(b){return b===62?(e.exit("chunkString"),e.exit(o),h(b)):b===null||b===60||H(b)?n(b):(e.consume(b),b===92?g:f)}function g(b){return b===60||b===62||b===92?(e.consume(b),f):f(b)}function w(b){return!p&&(b===null||b===41||ee(b))?(e.exit("chunkString"),e.exit(o),e.exit(a),e.exit(r),t(b)):p<u&&b===40?(e.consume(b),p++,w):b===41?(e.consume(b),p--,w):b===null||b===32||b===40||vt(b)?n(b):(e.consume(b),b===92?S:w)}function S(b){return b===40||b===41||b===92?(e.consume(b),w):w(b)}}function di(e,t,n,r,i,s){const a=this;let o=0,l;return u;function u(f){return e.enter(r),e.enter(i),e.consume(f),e.exit(i),e.enter(s),p}function p(f){return o>999||f===null||f===91||f===93&&!l||f===94&&!o&&"_hiddenFootnoteSupport"in a.parser.constructs?n(f):f===93?(e.exit(s),e.enter(i),e.consume(f),e.exit(i),e.exit(r),t):H(f)?(e.enter("lineEnding"),e.consume(f),e.exit("lineEnding"),p):(e.enter("chunkString",{contentType:"string"}),c(f))}function c(f){return f===null||f===91||f===93||H(f)||o++>999?(e.exit("chunkString"),p(f)):(e.consume(f),l||(l=!G(f)),f===92?h:c)}function h(f){return f===91||f===92||f===93?(e.consume(f),o++,c):c(f)}}function fi(e,t,n,r,i,s){let a;return o;function o(h){return h===34||h===39||h===40?(e.enter(r),e.enter(i),e.consume(h),e.exit(i),a=h===40?41:h,l):n(h)}function l(h){return h===a?(e.enter(i),e.consume(h),e.exit(i),e.exit(r),t):(e.enter(s),u(h))}function u(h){return h===a?(e.exit(s),l(a)):h===null?n(h):H(h)?(e.enter("lineEnding"),e.consume(h),e.exit("lineEnding"),Q(e,u,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),p(h))}function p(h){return h===a||h===null||H(h)?(e.exit("chunkString"),u(h)):(e.consume(h),h===92?c:p)}function c(h){return h===a||h===92?(e.consume(h),p):p(h)}}function ot(e,t){let n;return r;function r(i){return H(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n=!0,r):G(i)?Q(e,r,n?"linePrefix":"lineSuffix")(i):t(i)}}const bo={name:"definition",tokenize:yo},wo={partial:!0,tokenize:ko};function yo(e,t,n){const r=this;let i;return s;function s(f){return e.enter("definition"),a(f)}function a(f){return di.call(r,e,o,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(f)}function o(f){return i=we(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),f===58?(e.enter("definitionMarker"),e.consume(f),e.exit("definitionMarker"),l):n(f)}function l(f){return ee(f)?ot(e,u)(f):u(f)}function u(f){return pi(e,p,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(f)}function p(f){return e.attempt(wo,c,c)(f)}function c(f){return G(f)?Q(e,h,"whitespace")(f):h(f)}function h(f){return f===null||H(f)?(e.exit("definition"),r.parser.defined.push(i),t(f)):n(f)}}function ko(e,t,n){return r;function r(o){return ee(o)?ot(e,i)(o):n(o)}function i(o){return fi(e,s,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(o)}function s(o){return G(o)?Q(e,a,"whitespace")(o):a(o)}function a(o){return o===null||H(o)?t(o):n(o)}}const vo={name:"hardBreakEscape",tokenize:Co};function Co(e,t,n){return r;function r(s){return e.enter("hardBreakEscape"),e.consume(s),i}function i(s){return H(s)?(e.exit("hardBreakEscape"),t(s)):n(s)}}const So={name:"headingAtx",resolve:Eo,tokenize:jo};function Eo(e,t){let n=e.length-2,r=3,i,s;return 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&&(i={type:"atxHeadingText",start:e[r][1].start,end:e[n][1].end},s={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},he(e,r,n-r+1,[["enter",i,t],["enter",s,t],["exit",s,t],["exit",i,t]])),e}function jo(e,t,n){let r=0;return i;function i(p){return e.enter("atxHeading"),s(p)}function s(p){return e.enter("atxHeadingSequence"),a(p)}function a(p){return p===35&&r++<6?(e.consume(p),a):p===null||ee(p)?(e.exit("atxHeadingSequence"),o(p)):n(p)}function o(p){return p===35?(e.enter("atxHeadingSequence"),l(p)):p===null||H(p)?(e.exit("atxHeading"),t(p)):G(p)?Q(e,o,"whitespace")(p):(e.enter("atxHeadingText"),u(p))}function l(p){return p===35?(e.consume(p),l):(e.exit("atxHeadingSequence"),o(p))}function u(p){return p===null||p===35||ee(p)?(e.exit("atxHeadingText"),o(p)):(e.consume(p),u)}}const Io=["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"],Zn=["pre","script","style","textarea"],zo={concrete:!0,name:"htmlFlow",resolveTo:No,tokenize:Do},To={partial:!0,tokenize:Mo},Ao={partial:!0,tokenize:Lo};function No(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 Do(e,t,n){const r=this;let i,s,a,o,l;return u;function u(y){return p(y)}function p(y){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(y),c}function c(y){return y===33?(e.consume(y),h):y===47?(e.consume(y),s=!0,w):y===63?(e.consume(y),i=3,r.interrupt?t:m):ue(y)?(e.consume(y),a=String.fromCharCode(y),S):n(y)}function h(y){return y===45?(e.consume(y),i=2,f):y===91?(e.consume(y),i=5,o=0,g):ue(y)?(e.consume(y),i=4,r.interrupt?t:m):n(y)}function f(y){return y===45?(e.consume(y),r.interrupt?t:m):n(y)}function g(y){const le="CDATA[";return y===le.charCodeAt(o++)?(e.consume(y),o===le.length?r.interrupt?t:M:g):n(y)}function w(y){return ue(y)?(e.consume(y),a=String.fromCharCode(y),S):n(y)}function S(y){if(y===null||y===47||y===62||ee(y)){const le=y===47,Ce=a.toLowerCase();return!le&&!s&&Zn.includes(Ce)?(i=1,r.interrupt?t(y):M(y)):Io.includes(a.toLowerCase())?(i=6,le?(e.consume(y),b):r.interrupt?t(y):M(y)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(y):s?E(y):C(y))}return y===45||se(y)?(e.consume(y),a+=String.fromCharCode(y),S):n(y)}function b(y){return y===62?(e.consume(y),r.interrupt?t:M):n(y)}function E(y){return G(y)?(e.consume(y),E):x(y)}function C(y){return y===47?(e.consume(y),x):y===58||y===95||ue(y)?(e.consume(y),T):G(y)?(e.consume(y),C):x(y)}function T(y){return y===45||y===46||y===58||y===95||se(y)?(e.consume(y),T):L(y)}function L(y){return y===61?(e.consume(y),v):G(y)?(e.consume(y),L):C(y)}function v(y){return y===null||y===60||y===61||y===62||y===96?n(y):y===34||y===39?(e.consume(y),l=y,N):G(y)?(e.consume(y),v):R(y)}function N(y){return y===l?(e.consume(y),l=null,_):y===null||H(y)?n(y):(e.consume(y),N)}function R(y){return y===null||y===34||y===39||y===47||y===60||y===61||y===62||y===96||ee(y)?L(y):(e.consume(y),R)}function _(y){return y===47||y===62||G(y)?C(y):n(y)}function x(y){return y===62?(e.consume(y),I):n(y)}function I(y){return y===null||H(y)?M(y):G(y)?(e.consume(y),I):n(y)}function M(y){return y===45&&i===2?(e.consume(y),V):y===60&&i===1?(e.consume(y),j):y===62&&i===4?(e.consume(y),B):y===63&&i===3?(e.consume(y),m):y===93&&i===5?(e.consume(y),U):H(y)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(To,K,$)(y)):y===null||H(y)?(e.exit("htmlFlowData"),$(y)):(e.consume(y),M)}function $(y){return e.check(Ao,P,K)(y)}function P(y){return e.enter("lineEnding"),e.consume(y),e.exit("lineEnding"),A}function A(y){return y===null||H(y)?$(y):(e.enter("htmlFlowData"),M(y))}function V(y){return y===45?(e.consume(y),m):M(y)}function j(y){return y===47?(e.consume(y),a="",O):M(y)}function O(y){if(y===62){const le=a.toLowerCase();return Zn.includes(le)?(e.consume(y),B):M(y)}return ue(y)&&a.length<8?(e.consume(y),a+=String.fromCharCode(y),O):M(y)}function U(y){return y===93?(e.consume(y),m):M(y)}function m(y){return y===62?(e.consume(y),B):y===45&&i===2?(e.consume(y),m):M(y)}function B(y){return y===null||H(y)?(e.exit("htmlFlowData"),K(y)):(e.consume(y),B)}function K(y){return e.exit("htmlFlow"),t(y)}}function Lo(e,t,n){const r=this;return i;function i(a){return H(a)?(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),s):n(a)}function s(a){return r.parser.lazy[r.now().line]?n(a):t(a)}}function Mo(e,t,n){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(dt,t,n)}}const Ro={name:"htmlText",tokenize:Po};function Po(e,t,n){const r=this;let i,s,a;return o;function o(m){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(m),l}function l(m){return m===33?(e.consume(m),u):m===47?(e.consume(m),L):m===63?(e.consume(m),C):ue(m)?(e.consume(m),R):n(m)}function u(m){return m===45?(e.consume(m),p):m===91?(e.consume(m),s=0,g):ue(m)?(e.consume(m),E):n(m)}function p(m){return m===45?(e.consume(m),f):n(m)}function c(m){return m===null?n(m):m===45?(e.consume(m),h):H(m)?(a=c,j(m)):(e.consume(m),c)}function h(m){return m===45?(e.consume(m),f):c(m)}function f(m){return m===62?V(m):m===45?h(m):c(m)}function g(m){const B="CDATA[";return m===B.charCodeAt(s++)?(e.consume(m),s===B.length?w:g):n(m)}function w(m){return m===null?n(m):m===93?(e.consume(m),S):H(m)?(a=w,j(m)):(e.consume(m),w)}function S(m){return m===93?(e.consume(m),b):w(m)}function b(m){return m===62?V(m):m===93?(e.consume(m),b):w(m)}function E(m){return m===null||m===62?V(m):H(m)?(a=E,j(m)):(e.consume(m),E)}function C(m){return m===null?n(m):m===63?(e.consume(m),T):H(m)?(a=C,j(m)):(e.consume(m),C)}function T(m){return m===62?V(m):C(m)}function L(m){return ue(m)?(e.consume(m),v):n(m)}function v(m){return m===45||se(m)?(e.consume(m),v):N(m)}function N(m){return H(m)?(a=N,j(m)):G(m)?(e.consume(m),N):V(m)}function R(m){return m===45||se(m)?(e.consume(m),R):m===47||m===62||ee(m)?_(m):n(m)}function _(m){return m===47?(e.consume(m),V):m===58||m===95||ue(m)?(e.consume(m),x):H(m)?(a=_,j(m)):G(m)?(e.consume(m),_):V(m)}function x(m){return m===45||m===46||m===58||m===95||se(m)?(e.consume(m),x):I(m)}function I(m){return m===61?(e.consume(m),M):H(m)?(a=I,j(m)):G(m)?(e.consume(m),I):_(m)}function M(m){return m===null||m===60||m===61||m===62||m===96?n(m):m===34||m===39?(e.consume(m),i=m,$):H(m)?(a=M,j(m)):G(m)?(e.consume(m),M):(e.consume(m),P)}function $(m){return m===i?(e.consume(m),i=void 0,A):m===null?n(m):H(m)?(a=$,j(m)):(e.consume(m),$)}function P(m){return m===null||m===34||m===39||m===60||m===61||m===96?n(m):m===47||m===62||ee(m)?_(m):(e.consume(m),P)}function A(m){return m===47||m===62||ee(m)?_(m):n(m)}function V(m){return m===62?(e.consume(m),e.exit("htmlTextData"),e.exit("htmlText"),t):n(m)}function j(m){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(m),e.exit("lineEnding"),O}function O(m){return G(m)?Q(e,U,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(m):U(m)}function U(m){return e.enter("htmlTextData"),a(m)}}const vn={name:"labelEnd",resolveAll:Bo,resolveTo:$o,tokenize:Ho},Fo={tokenize:Uo},_o={tokenize:Vo},Oo={tokenize:qo};function Bo(e){let t=-1;const n=[];for(;++t<e.length;){const r=e[t][1];if(n.push(e[t]),r.type==="labelImage"||r.type==="labelLink"||r.type==="labelEnd"){const i=r.type==="labelImage"?4:2;r.type="data",t+=i}}return e.length!==n.length&&he(e,0,e.length,n),e}function $o(e,t){let n=e.length,r=0,i,s,a,o;for(;n--;)if(i=e[n][1],s){if(i.type==="link"||i.type==="labelLink"&&i._inactive)break;e[n][0]==="enter"&&i.type==="labelLink"&&(i._inactive=!0)}else if(a){if(e[n][0]==="enter"&&(i.type==="labelImage"||i.type==="labelLink")&&!i._balanced&&(s=n,i.type!=="labelLink")){r=2;break}}else i.type==="labelEnd"&&(a=n);const l={type:e[s][1].type==="labelLink"?"link":"image",start:{...e[s][1].start},end:{...e[e.length-1][1].end}},u={type:"label",start:{...e[s][1].start},end:{...e[a][1].end}},p={type:"labelText",start:{...e[s+r+2][1].end},end:{...e[a-2][1].start}};return o=[["enter",l,t],["enter",u,t]],o=xe(o,e.slice(s+1,s+r+3)),o=xe(o,[["enter",p,t]]),o=xe(o,zt(t.parser.constructs.insideSpan.null,e.slice(s+r+4,a-3),t)),o=xe(o,[["exit",p,t],e[a-2],e[a-1],["exit",u,t]]),o=xe(o,e.slice(a+1)),o=xe(o,[["exit",l,t]]),he(e,s,e.length,o),e}function Ho(e,t,n){const r=this;let i=r.events.length,s,a;for(;i--;)if((r.events[i][1].type==="labelImage"||r.events[i][1].type==="labelLink")&&!r.events[i][1]._balanced){s=r.events[i][1];break}return o;function o(h){return s?s._inactive?c(h):(a=r.parser.defined.includes(we(r.sliceSerialize({start:s.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(h),e.exit("labelMarker"),e.exit("labelEnd"),l):n(h)}function l(h){return h===40?e.attempt(Fo,p,a?p:c)(h):h===91?e.attempt(_o,p,a?u:c)(h):a?p(h):c(h)}function u(h){return e.attempt(Oo,p,c)(h)}function p(h){return t(h)}function c(h){return s._balanced=!0,n(h)}}function Uo(e,t,n){return r;function r(c){return e.enter("resource"),e.enter("resourceMarker"),e.consume(c),e.exit("resourceMarker"),i}function i(c){return ee(c)?ot(e,s)(c):s(c)}function s(c){return c===41?p(c):pi(e,a,o,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(c)}function a(c){return ee(c)?ot(e,l)(c):p(c)}function o(c){return n(c)}function l(c){return c===34||c===39||c===40?fi(e,u,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(c):p(c)}function u(c){return ee(c)?ot(e,p)(c):p(c)}function p(c){return c===41?(e.enter("resourceMarker"),e.consume(c),e.exit("resourceMarker"),e.exit("resource"),t):n(c)}}function Vo(e,t,n){const r=this;return i;function i(o){return di.call(r,e,s,a,"reference","referenceMarker","referenceString")(o)}function s(o){return r.parser.defined.includes(we(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(o):n(o)}function a(o){return n(o)}}function qo(e,t,n){return r;function r(s){return e.enter("reference"),e.enter("referenceMarker"),e.consume(s),e.exit("referenceMarker"),i}function i(s){return s===93?(e.enter("referenceMarker"),e.consume(s),e.exit("referenceMarker"),e.exit("reference"),t):n(s)}}const Wo={name:"labelStartImage",resolveAll:vn.resolveAll,tokenize:Yo};function Yo(e,t,n){const r=this;return i;function i(o){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(o),e.exit("labelImageMarker"),s}function s(o){return o===91?(e.enter("labelMarker"),e.consume(o),e.exit("labelMarker"),e.exit("labelImage"),a):n(o)}function a(o){return o===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(o):t(o)}}const Go={name:"labelStartLink",resolveAll:vn.resolveAll,tokenize:Xo};function Xo(e,t,n){const r=this;return i;function i(a){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(a),e.exit("labelMarker"),e.exit("labelLink"),s}function s(a){return a===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(a):t(a)}}const Bt={name:"lineEnding",tokenize:Ko};function Ko(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),Q(e,t,"linePrefix")}}const wt={name:"thematicBreak",tokenize:Qo};function Qo(e,t,n){let r=0,i;return s;function s(u){return e.enter("thematicBreak"),a(u)}function a(u){return i=u,o(u)}function o(u){return u===i?(e.enter("thematicBreakSequence"),l(u)):r>=3&&(u===null||H(u))?(e.exit("thematicBreak"),t(u)):n(u)}function l(u){return u===i?(e.consume(u),r++,l):(e.exit("thematicBreakSequence"),G(u)?Q(e,o,"whitespace")(u):o(u))}}const ce={continuation:{tokenize:tl},exit:rl,name:"list",tokenize:el},Jo={partial:!0,tokenize:il},Zo={partial:!0,tokenize:nl};function el(e,t,n){const r=this,i=r.events[r.events.length-1];let s=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,a=0;return o;function o(f){const g=r.containerState.type||(f===42||f===43||f===45?"listUnordered":"listOrdered");if(g==="listUnordered"?!r.containerState.marker||f===r.containerState.marker:sn(f)){if(r.containerState.type||(r.containerState.type=g,e.enter(g,{_container:!0})),g==="listUnordered")return e.enter("listItemPrefix"),f===42||f===45?e.check(wt,n,u)(f):u(f);if(!r.interrupt||f===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),l(f)}return n(f)}function l(f){return sn(f)&&++a<10?(e.consume(f),l):(!r.interrupt||a<2)&&(r.containerState.marker?f===r.containerState.marker:f===41||f===46)?(e.exit("listItemValue"),u(f)):n(f)}function u(f){return e.enter("listItemMarker"),e.consume(f),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||f,e.check(dt,r.interrupt?n:p,e.attempt(Jo,h,c))}function p(f){return r.containerState.initialBlankLine=!0,s++,h(f)}function c(f){return G(f)?(e.enter("listItemPrefixWhitespace"),e.consume(f),e.exit("listItemPrefixWhitespace"),h):n(f)}function h(f){return r.containerState.size=s+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(f)}}function tl(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(dt,i,s);function i(o){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,Q(e,t,"listItemIndent",r.containerState.size+1)(o)}function s(o){return r.containerState.furtherBlankLines||!G(o)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,a(o)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(Zo,t,a)(o))}function a(o){return r.containerState._closeFlow=!0,r.interrupt=void 0,Q(e,e.attempt(ce,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(o)}}function nl(e,t,n){const r=this;return Q(e,i,"listItemIndent",r.containerState.size+1);function i(s){const a=r.events[r.events.length-1];return a&&a[1].type==="listItemIndent"&&a[2].sliceSerialize(a[1],!0).length===r.containerState.size?t(s):n(s)}}function rl(e){e.exit(this.containerState.type)}function il(e,t,n){const r=this;return Q(e,i,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(s){const a=r.events[r.events.length-1];return!G(s)&&a&&a[1].type==="listItemPrefixWhitespace"?t(s):n(s)}}const er={name:"setextUnderline",resolveTo:al,tokenize:sl};function al(e,t){let n=e.length,r,i,s;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){r=n;break}e[n][1].type==="paragraph"&&(i=n)}else e[n][1].type==="content"&&e.splice(n,1),!s&&e[n][1].type==="definition"&&(s=n);const a={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type="setextHeadingText",s?(e.splice(i,0,["enter",a,t]),e.splice(s+1,0,["exit",e[r][1],t]),e[r][1].end={...e[s][1].end}):e[r][1]=a,e.push(["exit",a,t]),e}function sl(e,t,n){const r=this;let i;return s;function s(u){let p=r.events.length,c;for(;p--;)if(r.events[p][1].type!=="lineEnding"&&r.events[p][1].type!=="linePrefix"&&r.events[p][1].type!=="content"){c=r.events[p][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||c)?(e.enter("setextHeadingLine"),i=u,a(u)):n(u)}function a(u){return e.enter("setextHeadingLineSequence"),o(u)}function o(u){return u===i?(e.consume(u),o):(e.exit("setextHeadingLineSequence"),G(u)?Q(e,l,"lineSuffix")(u):l(u))}function l(u){return u===null||H(u)?(e.exit("setextHeadingLine"),t(u)):n(u)}}const ol={tokenize:ll};function ll(e){const t=this,n=e.attempt(dt,r,e.attempt(this.parser.constructs.flowInitial,i,Q(e,e.attempt(this.parser.constructs.flow,i,e.attempt(fo,i)),"linePrefix")));return n;function r(s){if(s===null){e.consume(s);return}return e.enter("lineEndingBlank"),e.consume(s),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function i(s){if(s===null){e.consume(s);return}return e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const ul={resolveAll:gi()},cl=hi("string"),pl=hi("text");function hi(e){return{resolveAll:gi(e==="text"?dl:void 0),tokenize:t};function t(n){const r=this,i=this.parser.constructs[e],s=n.attempt(i,a,o);return a;function a(p){return u(p)?s(p):o(p)}function o(p){if(p===null){n.consume(p);return}return n.enter("data"),n.consume(p),l}function l(p){return u(p)?(n.exit("data"),s(p)):(n.consume(p),l)}function u(p){if(p===null)return!0;const c=i[p];let h=-1;if(c)for(;++h<c.length;){const f=c[h];if(!f.previous||f.previous.call(r,r.previous))return!0}return!1}}}function gi(e){return t;function t(n,r){let i=-1,s;for(;++i<=n.length;)s===void 0?n[i]&&n[i][1].type==="data"&&(s=i,i++):(!n[i]||n[i][1].type!=="data")&&(i!==s+2&&(n[s][1].end=n[i-1][1].end,n.splice(s+2,i-s-2),i=s+2),s=void 0);return e?e(n,r):n}}function dl(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type==="lineEnding")&&e[n-1][1].type==="data"){const r=e[n-1][1],i=t.sliceStream(r);let s=i.length,a=-1,o=0,l;for(;s--;){const u=i[s];if(typeof u=="string"){for(a=u.length;u.charCodeAt(a-1)===32;)o++,a--;if(a)break;a=-1}else if(u===-2)l=!0,o++;else if(u!==-1){s++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(o=0),o){const u={type:n===e.length||l||o<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:s?a:r.start._bufferIndex+a,_index:r.start._index+s,line:r.end.line,column:r.end.column-o,offset:r.end.offset-o},end:{...r.end}};r.end={...u.start},r.start.offset===r.end.offset?Object.assign(r,u):(e.splice(n,0,["enter",u,t],["exit",u,t]),n+=2)}n++}return e}const fl={42:ce,43:ce,45:ce,48:ce,49:ce,50:ce,51:ce,52:ce,53:ce,54:ce,55:ce,56:ce,57:ce,62:oi},hl={91:bo},gl={[-2]:Ot,[-1]:Ot,32:Ot},ml={35:So,42:wt,45:[er,wt],60:zo,61:er,95:wt,96:Jn,126:Jn},xl={38:ui,92:li},bl={[-5]:Bt,[-4]:Bt,[-3]:Bt,33:Wo,38:ui,42:on,60:[Ys,Ro],91:Go,92:[vo,li],93:vn,95:on,96:so},wl={null:[on,ul]},yl={null:[42,95]},kl={null:[]},vl=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:yl,contentInitial:hl,disable:kl,document:fl,flow:ml,flowInitial:gl,insideSpan:wl,string:xl,text:bl},Symbol.toStringTag,{value:"Module"}));function Cl(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const i={},s=[];let a=[],o=[];const l={attempt:N(L),check:N(v),consume:E,enter:C,exit:T,interrupt:N(v,{interrupt:!0})},u={code:null,containerState:{},defineSkip:w,events:[],now:g,parser:e,previous:null,sliceSerialize:h,sliceStream:f,write:c};let p=t.tokenize.call(u,l);return t.resolveAll&&s.push(t),u;function c(I){return a=xe(a,I),S(),a[a.length-1]!==null?[]:(R(t,0),u.events=zt(s,u.events,u),u.events)}function h(I,M){return El(f(I),M)}function f(I){return Sl(a,I)}function g(){const{_bufferIndex:I,_index:M,line:$,column:P,offset:A}=r;return{_bufferIndex:I,_index:M,line:$,column:P,offset:A}}function w(I){i[I.line]=I.column,x()}function S(){let I;for(;r._index<a.length;){const M=a[r._index];if(typeof M=="string")for(I=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===I&&r._bufferIndex<M.length;)b(M.charCodeAt(r._bufferIndex));else b(M)}}function b(I){p=p(I)}function E(I){H(I)?(r.line++,r.column=1,r.offset+=I===-3?2:1,x()):I!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===a[r._index].length&&(r._bufferIndex=-1,r._index++)),u.previous=I}function C(I,M){const $=M||{};return $.type=I,$.start=g(),u.events.push(["enter",$,u]),o.push($),$}function T(I){const M=o.pop();return M.end=g(),u.events.push(["exit",M,u]),M}function L(I,M){R(I,M.from)}function v(I,M){M.restore()}function N(I,M){return $;function $(P,A,V){let j,O,U,m;return Array.isArray(P)?K(P):"tokenize"in P?K([P]):B(P);function B(ne){return Te;function Te(ge){const Se=ge!==null&&ne[ge],Ee=ge!==null&&ne.null,Ae=[...Array.isArray(Se)?Se:Se?[Se]:[],...Array.isArray(Ee)?Ee:Ee?[Ee]:[]];return K(Ae)(ge)}}function K(ne){return j=ne,O=0,ne.length===0?V:y(ne[O])}function y(ne){return Te;function Te(ge){return m=_(),U=ne,ne.partial||(u.currentConstruct=ne),ne.name&&u.parser.constructs.disable.null.includes(ne.name)?Ce():ne.tokenize.call(M?Object.assign(Object.create(u),M):u,l,le,Ce)(ge)}}function le(ne){return I(U,m),A}function Ce(ne){return m.restore(),++O<j.length?y(j[O]):V}}}function R(I,M){I.resolveAll&&!s.includes(I)&&s.push(I),I.resolve&&he(u.events,M,u.events.length-M,I.resolve(u.events.slice(M),u)),I.resolveTo&&(u.events=I.resolveTo(u.events,u))}function _(){const I=g(),M=u.previous,$=u.currentConstruct,P=u.events.length,A=Array.from(o);return{from:P,restore:V};function V(){r=I,u.previous=M,u.currentConstruct=$,u.events.length=P,o=A,x()}}function x(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function Sl(e,t){const n=t.start._index,r=t.start._bufferIndex,i=t.end._index,s=t.end._bufferIndex;let a;if(n===i)a=[e[n].slice(r,s)];else{if(a=e.slice(n,i),r>-1){const o=a[0];typeof o=="string"?a[0]=o.slice(r):a.shift()}s>0&&a.push(e[i].slice(0,s))}return a}function El(e,t){let n=-1;const r=[];let i;for(;++n<e.length;){const s=e[n];let a;if(typeof s=="string")a=s;else switch(s){case-5:{a="\r";break}case-4:{a=`
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const k=require("react"),ga=require("react-dom/client"),d=require("react/jsx-runtime"),Oe=require("./nosUploader-KkzFK5EW.cjs");function Mr(e){const{sdk:t,sessionId:n,onSessionCreated:r,onStreamStart:i,onStreamEnd:s,onError:a,onMessageSend:o}=e,[l,u]=k.useState([]),[p,c]=k.useState("ready"),[h,f]=k.useState(null),g=k.useRef(new Map),y=k.useRef(new Map),C=k.useRef(n),w=k.useRef(!0),E=k.useRef(l);C.current=n,w.current=l.length===0,E.current=l;const S=k.useCallback((j,T)=>{if(j===C.current)u(M=>{const F=y.current.get(j)??M,_=T(F);return y.current.set(j,_),_});else{const M=y.current.get(j)??[];y.current.set(j,T(M))}},[]),z=k.useCallback((j,T)=>{const M=g.current.get(j);M!=null&&M.stopTimer&&(clearTimeout(M.stopTimer),M.stopTimer=null),g.current.delete(j),y.current.delete(j),j===C.current&&c(T)},[]);k.useEffect(()=>{const j=n?g.current.get(n):void 0;c(j!=null&&j.busy?"streaming":"ready")},[n]);const A=k.useCallback((j,T)=>{var x;const M=C.current;if(M&&((x=g.current.get(M))!=null&&x.busy))return;o==null||o(j);const F={id:`user_${Date.now()}`,role:"user",parts:[...(T??[]).map(B=>({type:"attachment",attachment:B})),{type:"text",content:j}],timestamp:Date.now()},_=`assistant_${Date.now()}`,H={id:_,role:"assistant",parts:[],timestamp:Date.now()},X=w.current,D=E.current;u(B=>[...B,F,H]),M&&y.current.set(M,[...D,F,H]),c("submitted"),f(null);const U=B=>{let P="",m="",Z=[],se=!1;y.current.has(B)||y.current.set(B,[...D,F,H]);const re={abortController:null,busy:!0,stopTimer:null};g.current.set(B,re);const he=()=>{const q=[...Z];if(P){const ie=q.findIndex(oe=>oe.type==="thinking");ie>=0?q[ie]={type:"thinking",content:P}:q.unshift({type:"thinking",content:P})}if(m){const ie=q[q.length-1];(ie==null?void 0:ie.type)==="text"?q[q.length-1]={type:"text",content:m}:q.push({type:"text",content:m})}S(B,ie=>ie.map(oe=>oe.id===_?{...oe,parts:q}:oe))};re.abortController=t.chat({sessionId:B,message:j,attachments:T&&T.length>0?T:void 0,stream:!0,onMessage:q=>{switch(se||(se=!0,B===C.current&&c("streaming")),q.type){case"thinking":P+=q.content;break;case"ai":m+=q.content;break;case"tool_call":m&&(Z.push({type:"text",content:m}),m=""),Z.push({type:"tool_call",toolName:q.toolName,toolCallId:q.toolCallId,args:q.args??"{}"});break;case"tool_result":m&&(Z.push({type:"text",content:m}),m=""),Z.push({type:"tool_result",toolName:q.toolName??"",toolCallId:q.toolCallId,content:q.content,artifacts:q.artifacts,renderMode:q.renderMode,html:q.html});break;case"interrupt":m&&(Z.push({type:"text",content:m}),m=""),q.interrupt&&Z.push({type:"interrupt",interrupt:q.interrupt,resolved:!1}),he(),z(B,"ready");return;case"stop":q.content&&(m=q.content),he();return}he()},onDone:q=>{(m||Z.length>0||P)&&he();const ie=()=>{z(B,"ready"),s==null||s(q.sessionId||B)};if(X){const oe=j.slice(0,30),Se=q.sessionId||B;t.renameConversation(Se,oe).catch(()=>{}).finally(ie)}else ie()},onError:q=>{Z.push({type:"error",content:q.message}),he(),B===C.current&&(f(q),c("error")),a==null||a(q),z(B,"error")}}),i==null||i(B)};M?U(M):t.createSession().then(B=>{C.current==null&&(C.current=B,r==null||r(B)),U(B)}).catch(B=>{C.current==null&&(f(B instanceof Error?B:new Error(String(B))),c("error")),a==null||a(B instanceof Error?B:new Error(String(B)))})},[t,r,i,s,a,o,S,z]),v=k.useCallback(()=>{const j=C.current;if(!j)return;const T=g.current.get(j);T!=null&&T.busy&&(T.stopTimer&&clearTimeout(T.stopTimer),T.stopTimer=setTimeout(()=>{var M;T.stopTimer=null,(M=T.abortController)==null||M.abort(),z(j,"ready")},8e3),t.stopGeneration(j).catch(()=>{}))},[t,z]),N=k.useCallback(()=>{var _;const j=C.current;if(j&&((_=g.current.get(j))!=null&&_.busy))return;const T=l.findLastIndex(H=>H.role==="user");if(T<0)return;const M=l[T].parts.filter(H=>H.type==="text").map(H=>H.content).join(""),F=l[T].parts.filter(H=>H.type==="attachment").map(H=>H.attachment);u(H=>H.slice(0,T)),A(M,F.length>0?F:void 0)},[l,A]),O=k.useCallback((j,T)=>{var B;const M=C.current;if(!M||(B=g.current.get(M))!=null&&B.busy)return;S(M,P=>P.map(m=>({...m,parts:m.parts.map(Z=>Z.type==="interrupt"&&Z.interrupt.interruptId===j?{...Z,resolved:!0,response:T}:Z)})));const F={abortController:null,busy:!0,stopTimer:null};g.current.set(M,F);const _=new AbortController;F.abortController=_;let H=0;S(M,P=>P.length>0&&P[P.length-1].role==="assistant"?(H=P[P.length-1].parts.length,P):(H=0,[...P,{id:`assistant_${Date.now()}`,role:"assistant",parts:[],timestamp:Date.now()}])),c("streaming");let X="",D="",U=[];const x=()=>{const P=[...U];if(X){const m=P.findIndex(Z=>Z.type==="thinking");m>=0?P[m]={type:"thinking",content:X}:P.unshift({type:"thinking",content:X})}if(D){const m=P[P.length-1];(m==null?void 0:m.type)==="text"?P[P.length-1]={type:"text",content:D}:P.push({type:"text",content:D})}S(M,m=>{const Z=m.findLastIndex(se=>se.role==="assistant");return Z<0?m:m.map((se,re)=>re===Z?{...se,parts:[...se.parts.slice(0,H),...P]}:se)})};t.respondInterrupt(j,M,T,P=>{let m=!1;switch(P.type){case"thinking":X+=P.content;break;case"ai":D+=P.content;break;case"tool_call":D&&(U.push({type:"text",content:D}),D=""),U.push({type:"tool_call",toolName:P.toolName,toolCallId:P.toolCallId,args:P.args??"{}"});break;case"tool_result":D&&(U.push({type:"text",content:D}),D=""),U.push({type:"tool_result",toolName:P.toolName??"",toolCallId:P.toolCallId,content:P.content,artifacts:P.artifacts,renderMode:P.renderMode,html:P.html});break;case"interrupt":D&&(U.push({type:"text",content:D}),D=""),P.interrupt&&U.push({type:"interrupt",interrupt:P.interrupt,resolved:!1}),m=!0;break;case"stop":P.content&&(D=P.content),s==null||s(M),m=!0;break;case"done":s==null||s(M),m=!0;break}x(),m&&z(M,"ready")},P=>{U.push({type:"error",content:P.message}),x(),M===C.current&&(f(P),c("error")),a==null||a(P),z(M,"error")},_.signal).catch(P=>{if((P==null?void 0:P.name)==="AbortError"){z(M,"ready");return}M===C.current&&(f(P instanceof Error?P:new Error(String(P))),c("error")),a==null||a(P instanceof Error?P:new Error(String(P))),z(M,"error")})},[t,a,s,S,z]),$=k.useCallback((j,T)=>{C.current=j;const M=T??y.current.get(j)??[];y.current.set(j,M),u(M)},[]),b=k.useCallback(j=>g.current.has(j)?y.current.get(j)??null:null,[]);return{messages:l,status:p,error:h,sendMessage:A,stop:v,regenerate:N,setMessages:u,showSession:$,getLiveMessages:b,respondToInterrupt:O}}const Rr="sa_active_conversation",Pt=20;function Mn(e){try{return localStorage.getItem(`${Rr}_${e}`)}catch{return null}}function ma(e,t){try{const n=`${Rr}_${e}`;t?localStorage.setItem(n,t):localStorage.removeItem(n)}catch{}}function Pr(e){const{sdk:t,onConversationChange:n}=e,r=t.botId,[i,s]=k.useState([]),[a,o]=k.useState(()=>Mn(r)),[l,u]=k.useState(!1),[p,c]=k.useState(!0),h=k.useRef(!0),f=k.useRef(1),g=k.useRef(!1);k.useEffect(()=>()=>{h.current=!1},[]);const y=k.useCallback(N=>{o(N),ma(r,N),N&&(n==null||n(N))},[r,n]),C=k.useCallback(async()=>{if(!g.current){g.current=!0,u(!0);try{f.current=1;const N=await t.listConversations({page:1,size:Pt});if(!h.current)return;s(N.items),c(N.items.length<N.total);const O=Mn(r);O&&!N.items.find($=>$.sessionId===O)&&y(null)}catch{}finally{g.current=!1,h.current&&u(!1)}}},[t,y]),w=k.useCallback(async()=>{if(!(g.current||!p)){g.current=!0,u(!0);try{const N=f.current+1,O=await t.listConversations({page:N,size:Pt});if(!h.current)return;f.current=N,s(b=>{const j=new Set(b.map(M=>M.sessionId)),T=O.items.filter(M=>!j.has(M.sessionId));return[...b,...T]});const $=f.current*Pt;c($<O.total)}catch{}finally{g.current=!1,h.current&&u(!1)}}},[t,p]),E=k.useCallback(async(N,O)=>(y(N),(O==null?void 0:O.fetchHistory)===!1?[]:await t.getMessages(N)),[t,y]),S=k.useCallback(async()=>{try{const N=await t.createSession(),O=new Date().toISOString();s($=>[{sessionId:N,botId:0,title:"新对话",createTime:O,updateTime:O},...$]),y(N)}catch{y(null)}},[t,y]),z=k.useCallback(async N=>{s(O=>O.filter($=>$.sessionId!==N)),a===N&&y(null);try{await t.deleteConversation(N)}catch{}},[t,a,y]),A=k.useCallback(async(N,O)=>{await t.renameConversation(N,O),s($=>$.map(b=>b.sessionId===N?{...b,title:O}:b))},[t]),{enabled:v=!0}=e;return k.useEffect(()=>{v&&C()},[v,C]),{conversations:i,activeConversationId:a,loading:l,hasMore:p,loadConversations:C,loadMore:w,switchConversation:E,newConversation:S,deleteConversation:z,renameConversation:A,setActiveConversationId:y}}function Fr(e){return!e&&e!==0?"":e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/1024/1024).toFixed(1)} MB`}function _r(e){return e==="pdf"?"PDF":e==="docx"?"DOC":e==="html"?"HTM":e.slice(0,3).toUpperCase()||"FILE"}function Or(e){if(!e)return[];const t=[];for(const n of e)n.type==="file"&&n.data&&t.push({id:n.data.id??"",type:n.data.fileType??n.data.type??"",filename:n.data.name??n.data.filename??"",url:n.data.url??"",mime:n.data.mime,size:n.data.size,summary:n.data.summary});return t}async function kt(e){try{const t=await fetch(e.url);if(!t.ok)throw new Error(`HTTP ${t.status}`);const n=await t.blob(),r=URL.createObjectURL(n),i=document.createElement("a");i.href=r,i.download=e.filename,document.body.appendChild(i),i.click(),i.remove(),setTimeout(()=>URL.revokeObjectURL(r),4e3)}catch{const t=document.createElement("a");t.href=e.url,t.download=e.filename,t.target="_blank",document.body.appendChild(t),t.click(),t.remove()}}const Br=k.createContext(null);function je(){const e=k.useContext(Br);if(!e)throw new Error("useChatContext must be used within ChatProvider");return e}function Jt({sdk:e,hooks:t,attachmentUploader:n,nosUpload:r,children:i}){const[s,a]=k.useState(!1),[o,l]=k.useState(!1),[u,p]=k.useState(null),[c,h]=k.useState(null),[f,g]=k.useState(!1),[y,C]=k.useState(!1);k.useEffect(()=>{e.getToken().then(()=>{g(!0)}).catch(()=>{g(!0)})},[e]);const w=Pr({sdk:e,onConversationChange:t==null?void 0:t.onConversationChange,enabled:f}),E=Mr({sdk:e,sessionId:w.activeConversationId,onSessionCreated:D=>{w.setActiveConversationId(D)},onStreamStart:t==null?void 0:t.onStreamStart,onStreamEnd:D=>{var U;(U=t==null?void 0:t.onStreamEnd)==null||U.call(t,D),w.loadConversations()},onError:t==null?void 0:t.onError,onMessageSend:t==null?void 0:t.onMessageSend}),S=k.useCallback(D=>{if(D.type==="link"){window.open(D.url,D.target??"_blank","noopener");return}h(D)},[]),z=k.useCallback(()=>h(null),[]),A=k.useRef(0),v=k.useCallback(async D=>{const U=++A.current;if(E.getLiveMessages(D)){await w.switchConversation(D,{fetchHistory:!1}),E.showSession(D),C(!1);return}C(!0);try{const x=await w.switchConversation(D);if(A.current!==U)return;E.showSession(D,x)}finally{A.current===U&&C(!1)}},[w,E]),N=k.useCallback(async()=>{E.setMessages([]),await w.newConversation()},[w,E]),O=k.useCallback(async D=>{w.activeConversationId===D&&E.setMessages([]),await w.deleteConversation(D)},[w,E]);k.useEffect(()=>{w.activeConversationId&&E.messages.length===0&&(C(!0),e.getMessages(w.activeConversationId).then(D=>{E.setMessages(D)}).catch(()=>{}).finally(()=>C(!1)))},[]);const $=k.useCallback(()=>{a(D=>!D)},[]),b=k.useCallback(D=>{a(D)},[]),j=k.useCallback(()=>{l(D=>!D),p(D=>null)},[]),T=k.useCallback(D=>{p(D),l(!0)},[]),M=k.useMemo(()=>{const D=new Set,U=[];for(const x of E.messages)for(const B of x.parts)if(B.type==="tool_result"&&B.artifacts)for(const P of Or(B.artifacts)){const m=P.id||`${P.url}:${P.filename}`;D.has(m)||(D.add(m),U.push(P))}return U},[E.messages]),F=k.useCallback(async()=>{const D=w.activeConversationId;if(!D)return null;try{const U=await e.getMessages(D);E.setMessages(U);const x=U.findLast(B=>B.role==="assistant");return(x==null?void 0:x.id)??null}catch{return null}},[e,w.activeConversationId,E]),_=k.useCallback((D,U,x)=>{if(/^\d+$/.test(D)){e.feedback(D,U,x).catch(()=>{});return}F().then(B=>{B&&e.feedback(B,U,x).catch(()=>{})})},[e,F]),H=k.useCallback(D=>{if(/^\d+$/.test(D)){e.cancelFeedback(D).catch(()=>{});return}F().then(U=>{U&&e.cancelFeedback(U).catch(()=>{})})},[e,F]),X=k.useMemo(()=>({sdk:e,status:E.status,error:E.error,messages:E.messages,conversations:w.conversations,activeConversationId:w.activeConversationId,isThreadListOpen:s,isArtifactDrawerOpen:o,allArtifacts:M,activePreviewArtifact:u,activePanel:c,hasMore:w.hasMore,conversationsLoading:w.loading,messagesLoading:y,sendMessage:E.sendMessage,attachmentUploader:n??null,nosUpload:r??null,stop:E.stop,regenerate:E.regenerate,switchConversation:v,newConversation:N,deleteConversation:O,renameConversation:w.renameConversation,loadMoreConversations:w.loadMore,toggleThreadList:$,setThreadListOpen:b,toggleArtifactDrawer:j,openArtifactPreview:T,openPanel:S,closePanel:z,feedback:_,cancelFeedback:H,respondToInterrupt:E.respondToInterrupt}),[e,E.status,E.error,E.messages,E.sendMessage,E.stop,E.regenerate,E.respondToInterrupt,n,r,w.conversations,w.activeConversationId,w.renameConversation,w.hasMore,w.loadMore,w.loading,s,o,M,u,c,y,v,N,O,$,b,j,T,S,z,_,H]);return d.jsx(Br.Provider,{value:X,children:i})}const le="https://ehr-web.netease.com/ehr-web/erh-super-agent",ce={recently:`${le}/recently.svg`,home:`${le}/home.svg`,mergeWindow:`${le}/merge_window.svg`,spiltWindow:`${le}/spilt_window.svg`,close:`${le}/close.svg`,message:`${le}/message.svg`,messageCreate:`${le}/message_create.svg`,customerService:`${le}/customer_service.svg`,sendSolid:`${le}/send_solid.svg`,capabilityIcons:[`${le}/icon1.png`,`${le}/icon2.png`,`${le}/icon3.png`],triggerLogo:`${le}/HRlogo.png`,logo:`${le}/HRlogo2.png`,assistantAvatarGenerating:`${le}/profile0.gif`,assistantAvatar:`${le}/profile1.png`},ue={TRIGGER_SIZE:56,TRIGGER_RIGHT:20,TRIGGER_BOTTOM:80,DEFAULT_WIDTH:400,DEFAULT_HEIGHT:648,MIN_WIDTH:360,MAX_WIDTH:800,MAX_HEIGHT_RATIO:.95};function xa({defaultWidth:e=ue.DEFAULT_WIDTH,defaultHeight:t=ue.DEFAULT_HEIGHT,sidebarWidth:n=0}={}){const[r,i]=k.useState(e),[s,a]=k.useState({x:0,y:0}),[o,l]=k.useState(!1),[u,p]=k.useState(!1),[c,h]=k.useState(null),[f,g]=k.useState(()=>typeof window>"u"?{width:0,height:0}:{width:window.innerWidth,height:window.innerHeight}),y=k.useRef(!1),C=k.useRef(0),w=k.useRef(r),E=k.useRef(!1),S=k.useRef({x:0,y:0}),z=k.useRef({x:0,y:0}),A=k.useRef(!1),v=k.useRef(null);k.useEffect(()=>{const F=()=>g({width:window.innerWidth,height:window.innerHeight});return window.addEventListener("resize",F),()=>window.removeEventListener("resize",F)},[]),k.useEffect(()=>()=>{var F;(F=v.current)==null||F.call(v)},[]);const N=Math.floor(f.height*ue.MAX_HEIGHT_RATIO),O=Math.min(c||t,N),$=r+n;k.useEffect(()=>{if(!o){const F=f.width-$-20,_=f.height-O-20;a(H=>H.x===F&&H.y===_?H:{x:F,y:_})}},[o,$,O,f]);const b=k.useCallback(F=>{if(u||F.target.closest("button, input, textarea"))return;E.current=!0,A.current=!1,S.current={x:F.clientX,y:F.clientY},z.current={...s};const _=D=>{if(!E.current)return;const U=D.clientX-S.current.x,x=D.clientY-S.current.y;(Math.abs(U)>3||Math.abs(x)>3)&&(A.current=!0),A.current&&(l(!0),a({x:Math.max(-200,Math.min(z.current.x+U,window.innerWidth-100)),y:Math.max(0,Math.min(z.current.y+x,window.innerHeight-48))}))},H=()=>{E.current=!1,X()},X=()=>{document.removeEventListener("mousemove",_),document.removeEventListener("mouseup",H),v.current=null};document.addEventListener("mousemove",_),document.addEventListener("mouseup",H),v.current=X},[u,s]),j=k.useCallback(F=>{F.preventDefault(),F.stopPropagation(),y.current=!0,C.current=F.clientX,w.current=r;const _=s.x+r,H=s.y,X=x=>{if(!y.current)return;const B=x.clientX-C.current;let P=w.current-B;if(P>ue.MAX_WIDTH){y.current=!1,p(!0),U();return}P=Math.max(ue.MIN_WIDTH,P),i(P),a({x:_-P,y:H})},D=()=>{y.current=!1,U()},U=()=>{document.removeEventListener("mousemove",X),document.removeEventListener("mouseup",D),v.current=null};document.addEventListener("mousemove",X),document.addEventListener("mouseup",D),v.current=U},[r,s]),T=k.useCallback(()=>{u&&i(e),p(F=>!F)},[u,e]),M=k.useCallback(()=>{p(!1),i(e),l(!1),h(null)},[e]);return{width:r,position:s,hasCustomPosition:o,isMaximized:u,lockedHeight:c,viewport:f,defaultHeight:t,totalWidth:$,windowHeight:O,startWindowDrag:b,startResize:j,toggleMaximize:T,setIsMaximized:p,setLockedHeight:h,setHasCustomPosition:l,reset:M}}function ba(e){const{enabled:t,contentSelector:n,defaultHeight:r,onHeightChange:i}=e,s=k.useRef(null);return k.useEffect(()=>{if(!t||!s.current)return;const o=s.current.querySelector(n);if(!o)return;const l=()=>{const c=s.current;if(!c)return;const h=c.querySelector(n);if(!h)return;const f=c.offsetHeight-h.clientHeight,g=h.scrollHeight+f,y=Math.floor(window.innerHeight*ue.MAX_HEIGHT_RATIO),C=Math.max(r,Math.min(g,y));i(w=>w===C?w:C)};l();const u=new ResizeObserver(()=>l());Array.from(o.children).forEach(c=>u.observe(c));const p=new MutationObserver(()=>{Array.from(o.children).forEach(c=>u.observe(c)),l()});return p.observe(o,{childList:!0,subtree:!0,characterData:!0}),()=>{u.disconnect(),p.disconnect()}},[t,n,r,i]),s}function wa(e,t){const n=ue.TRIGGER_SIZE;return{x:Math.max(8,Math.min(e,window.innerWidth-n-8)),y:Math.max(8,Math.min(t,window.innerHeight-n-8))}}function $r({isOpen:e,onClick:t,triggerLogo:n}){const[r,i]=k.useState(null),s=k.useRef(!1),a=k.useRef(!1),o=k.useRef({x:0,y:0}),l=k.useRef({x:0,y:0}),u=k.useRef(null);k.useEffect(()=>()=>{var f;(f=u.current)==null||f.call(u)},[]);const p=k.useCallback(f=>{if(f.button!==0)return;s.current=!0,a.current=!1,o.current={x:f.clientX,y:f.clientY};const g=f.currentTarget.getBoundingClientRect();l.current={x:g.left,y:g.top};const y=w=>{if(!s.current)return;const E=w.clientX-o.current.x,S=w.clientY-o.current.y;(Math.abs(E)>4||Math.abs(S)>4)&&(a.current=!0),a.current&&i(wa(l.current.x+E,l.current.y+S))},C=()=>{s.current=!1,document.removeEventListener("mousemove",y),document.removeEventListener("mouseup",C),u.current=null};document.addEventListener("mousemove",y),document.addEventListener("mouseup",C),u.current=C},[]),c=k.useCallback(()=>{if(a.current){a.current=!1;return}t()},[t]),h=r?{left:r.x,top:r.y,width:ue.TRIGGER_SIZE,height:ue.TRIGGER_SIZE}:{right:ue.TRIGGER_RIGHT,bottom:ue.TRIGGER_BOTTOM,width:ue.TRIGGER_SIZE,height:ue.TRIGGER_SIZE};return d.jsx("button",{type:"button",className:`fixed z-[10000] flex items-center justify-center border-none bg-transparent p-0 transition-transform duration-200 ease-out hover:scale-[1.08] active:scale-95 ${e?"pointer-events-none scale-50 opacity-0":"opacity-100"}`,style:h,onMouseDown:p,onClick:c,"aria-label":"打开 AI 助手",title:"AI 助手",children:d.jsx("img",{src:n||ce.triggerLogo,alt:"AI 助手",className:"block h-full w-full",draggable:!1})})}function nt({tooltip:e,onClick:t,children:n}){return d.jsx("button",{type:"button",className:"sa-tip relative flex h-7 w-7 items-center justify-center rounded-md text-[#666] transition-colors hover:bg-white active:bg-[#F5F5F5]","data-tooltip":e,"aria-label":e,onClick:t,children:n})}function Hr({onClose:e,onToggleThreadList:t,isMaximized:n=!1,onToggleMaximize:r,showHome:i=!1,onHome:s,showClose:a=!0,artifactCount:o=0,onToggleArtifactDrawer:l}){return d.jsxs("div",{className:"relative z-20 flex h-9 shrink-0 select-none items-center justify-between px-[15px]",children:[d.jsxs("div",{className:"flex items-center gap-3",children:[d.jsx(nt,{tooltip:"历史记录",onClick:t,children:d.jsx("img",{src:ce.recently,alt:"",width:20,height:20})}),i&&s&&d.jsx(nt,{tooltip:"回到首页",onClick:s,children:d.jsx("img",{src:ce.home,alt:"",width:20,height:20})})]}),d.jsxs("div",{className:"flex items-center gap-2.5",children:[o>0&&l&&d.jsx(nt,{tooltip:"会话产物",onClick:l,children:d.jsxs("span",{className:"relative flex items-center gap-1",children:[d.jsxs("svg",{width:16,height:16,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[d.jsx("path",{d:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"}),d.jsx("polyline",{points:"14 2 14 8 20 8"})]}),o>0&&d.jsx("span",{className:"absolute -right-2 -top-1.5 min-w-[14px] rounded-full bg-[var(--sa-primary)] px-0.5 text-center text-[9px] font-medium leading-[14px] text-white",children:o>99?"99+":o})]})}),r&&d.jsx(nt,{tooltip:n?"小窗":"大窗",onClick:r,children:d.jsx("img",{src:n?ce.spiltWindow:ce.mergeWindow,alt:"",width:20,height:20})}),a&&d.jsx(nt,{tooltip:"关闭",onClick:e,children:d.jsx("img",{src:ce.close,alt:"",width:20,height:20})})]})]})}const rt=e=>String(e).padStart(2,"0");function ya(e){if(!e)return"";const t=new Date(e);return isNaN(t.getTime())?"":`${t.getFullYear()}-${rt(t.getMonth()+1)}-${rt(t.getDate())} ${rt(t.getHours())}:${rt(t.getMinutes())}:${rt(t.getSeconds())}`}function Ur(e){const t=new Date,n=new Date(t.getFullYear(),t.getMonth(),t.getDate()).getTime(),r=n-6*864e5,i=[],s=[],a=[];for(const l of e){const u=new Date(l.updateTime).getTime();u>=n?i.push(l):u>=r?s.push(l):a.push(l)}const o=[];return i.length&&o.push({label:"今天",items:i}),s.length&&o.push({label:"最近 7 天",items:s}),a.length&&o.push({label:"更早",items:a}),o}function Zt({width:e}){const{conversations:t,activeConversationId:n,switchConversation:r,newConversation:i,deleteConversation:s,renameConversation:a,hasMore:o,loadMoreConversations:l,conversationsLoading:u}=je(),[p,c]=k.useState(null),[h,f]=k.useState(""),[g,y]=k.useState(null),C=k.useRef(null),w=k.useCallback((A,v)=>{c(A),f(v??"")},[]),E=k.useCallback(A=>{h.trim()&&a(A,h.trim()),c(null)},[h,a]),S=k.useCallback(()=>{const A=C.current;!A||!o||A.scrollHeight-A.scrollTop-A.clientHeight<50&&l()},[o,l]),z=k.useMemo(()=>Ur(t),[t]);return d.jsxs("div",{className:"relative z-[5] flex h-full shrink-0 flex-col overflow-visible border-r border-[#ECECEC] bg-[#FAFAFA] p-3 animate-sa-history-in",style:{width:e??200},children:[d.jsxs("button",{type:"button",className:"sa-new-chat mb-4 flex h-8 w-full shrink-0 items-center justify-center gap-2 rounded-md text-[14px] font-medium transition-colors",onClick:i,children:[d.jsx("img",{src:ce.messageCreate,alt:"",width:18,height:18}),d.jsx("span",{className:"sa-new-chat-text whitespace-nowrap",children:"新建对话"})]}),d.jsxs("div",{className:"px-1 pb-2.5",children:[d.jsx("div",{className:"mb-1 text-[14px] font-semibold text-[#333]",children:"历史对话"}),d.jsx("div",{className:"text-[11px] text-[#999]",children:"展示最近的会话记录"})]}),d.jsxs("div",{ref:C,className:"flex-1 overflow-y-auto",onScroll:S,children:[u&&t.length===0&&d.jsx("div",{className:"px-0.5 py-2 text-[12px] text-[#999]",children:"加载中..."}),!u&&t.length===0&&d.jsx("div",{className:"px-0.5 py-2 text-[12px] text-[#999]",children:"暂无记录"}),z.map(A=>d.jsxs("div",{className:"mb-1",children:[d.jsx("div",{className:"px-1 pb-1 pt-2 text-[11px] text-[#A0A0A0]",children:A.label}),A.items.map(v=>d.jsx("div",{className:`group relative mb-0.5 flex h-8 w-full cursor-pointer items-center gap-1 rounded-md px-0.5 text-[13px] transition-colors ${v.sessionId===n?"bg-[#E8F1FE]":"hover:bg-[#E8F1FE]"}`,onClick:()=>{p!==v.sessionId&&r(v.sessionId)},onMouseEnter:N=>{if(p===v.sessionId)return;const O=N.currentTarget.getBoundingClientRect();y({text:v.title||"新会话",x:O.right+8,y:O.top+O.height/2})},onMouseLeave:()=>y(null),children:p===v.sessionId?d.jsx("input",{className:"w-full rounded border border-[var(--sa-primary)] bg-white px-1.5 py-0.5 text-[12px] outline-none",value:h,onChange:N=>f(N.target.value),onBlur:()=>E(v.sessionId),onKeyDown:N=>{N.key==="Enter"&&E(v.sessionId),N.key==="Escape"&&c(null)},onClick:N=>N.stopPropagation(),autoFocus:!0}):d.jsxs(d.Fragment,{children:[d.jsx("img",{src:ce.message,alt:"",width:16,height:16,className:"shrink-0 opacity-60"}),d.jsx("span",{className:"flex-1 overflow-hidden text-ellipsis whitespace-nowrap text-left text-[#333]",children:v.title||"新会话"}),d.jsxs("span",{className:"hidden shrink-0 items-center gap-0.5 group-hover:flex",children:[d.jsx("button",{type:"button",className:"flex h-5 w-5 items-center justify-center rounded text-[#999] hover:bg-white/70 hover:text-[var(--sa-primary)]",onClick:N=>{N.stopPropagation(),w(v.sessionId,v.title)},title:"重命名",children:d.jsx("svg",{width:12,height:12,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:d.jsx("path",{d:"M17 3a2.85 2.83 0 1 1 4 4L7.5 20.5 2 22l1.5-5.5Z"})})}),d.jsx("button",{type:"button",className:"flex h-5 w-5 items-center justify-center rounded text-[#999] hover:bg-white/70 hover:text-[#ef4444]",onClick:N=>{N.stopPropagation(),s(v.sessionId)},title:"删除",children:d.jsx("svg",{width:12,height:12,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:d.jsx("path",{d:"M3 6h18M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"})})})]})]})},v.sessionId))]},A.label)),u&&t.length>0&&d.jsx("div",{className:"px-0.5 py-2 text-[12px] text-[#999]",children:o?"加载更多...":"加载中..."}),!u&&o&&d.jsx("div",{className:"px-0.5 py-2 text-center text-[11px] text-[#C0C0C0]",children:"向下滚动加载更多"})]}),g&&d.jsx("div",{className:"pointer-events-none fixed z-[10001] whitespace-nowrap rounded border border-[#E8E8E8] bg-white px-2.5 py-1.5 text-[12px] leading-[1.4] text-[#333] shadow-[0_2px_8px_rgba(0,0,0,0.12)]",style:{left:g.x,top:g.y,transform:"translateY(-50%)"},children:g.text})]})}function Vr(e){const t=k.useRef(null),n=k.useRef(!1),r=k.useRef(0),i=k.useCallback(()=>{const a=t.current;if(!a)return;const{scrollTop:o,scrollHeight:l,clientHeight:u}=a,p=l-o-u<40;o<r.current&&!p&&(n.current=!0),p&&(n.current=!1),r.current=o},[]);k.useEffect(()=>{const a=t.current;if(a)return a.addEventListener("scroll",i,{passive:!0}),()=>a.removeEventListener("scroll",i)},[i]),k.useEffect(()=>{if(n.current)return;const a=t.current;a&&requestAnimationFrame(()=>{a.scrollTop=a.scrollHeight})},e);const s=k.useCallback(()=>{n.current=!1;const a=t.current;a&&(a.scrollTop=a.scrollHeight)},[]);return{containerRef:t,scrollToBottom:s}}function ka(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const va=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Ca=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Sa={};function Rn(e,t){return(Sa.jsx?Ca:va).test(e)}const Ea=/[ \t\n\f\r]/g;function ja(e){return typeof e=="object"?e.type==="text"?Pn(e.value):!1:Pn(e)}function Pn(e){return e.replace(Ea,"")===""}class pt{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}pt.prototype.normal={};pt.prototype.property={};pt.prototype.space=void 0;function qr(e,t){const n={},r={};for(const i of e)Object.assign(n,i.property),Object.assign(r,i.normal);return new pt(n,r,t)}function en(e){return e.toLowerCase()}class me{constructor(t,n){this.attribute=n,this.property=t}}me.prototype.attribute="";me.prototype.booleanish=!1;me.prototype.boolean=!1;me.prototype.commaOrSpaceSeparated=!1;me.prototype.commaSeparated=!1;me.prototype.defined=!1;me.prototype.mustUseProperty=!1;me.prototype.number=!1;me.prototype.overloadedBoolean=!1;me.prototype.property="";me.prototype.spaceSeparated=!1;me.prototype.space=void 0;let Ia=0;const Y=$e(),ae=$e(),tn=$e(),L=$e(),te=$e(),_e=$e(),be=$e();function $e(){return 2**++Ia}const nn=Object.freeze(Object.defineProperty({__proto__:null,boolean:Y,booleanish:ae,commaOrSpaceSeparated:be,commaSeparated:_e,number:L,overloadedBoolean:tn,spaceSeparated:te},Symbol.toStringTag,{value:"Module"})),Ft=Object.keys(nn);class fn extends me{constructor(t,n,r,i){let s=-1;if(super(t,n),Fn(this,"space",i),typeof r=="number")for(;++s<Ft.length;){const a=Ft[s];Fn(this,Ft[s],(r&nn[a])===nn[a])}}}fn.prototype.defined=!0;function Fn(e,t,n){n&&(e[t]=n)}function Ge(e){const t={},n={};for(const[r,i]of Object.entries(e.properties)){const s=new fn(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(s.mustUseProperty=!0),t[r]=s,n[en(r)]=r,n[en(s.attribute)]=r}return new pt(t,n,e.space)}const Wr=Ge({properties:{ariaActiveDescendant:null,ariaAtomic:ae,ariaAutoComplete:null,ariaBusy:ae,ariaChecked:ae,ariaColCount:L,ariaColIndex:L,ariaColSpan:L,ariaControls:te,ariaCurrent:null,ariaDescribedBy:te,ariaDetails:null,ariaDisabled:ae,ariaDropEffect:te,ariaErrorMessage:null,ariaExpanded:ae,ariaFlowTo:te,ariaGrabbed:ae,ariaHasPopup:null,ariaHidden:ae,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:te,ariaLevel:L,ariaLive:null,ariaModal:ae,ariaMultiLine:ae,ariaMultiSelectable:ae,ariaOrientation:null,ariaOwns:te,ariaPlaceholder:null,ariaPosInSet:L,ariaPressed:ae,ariaReadOnly:ae,ariaRelevant:null,ariaRequired:ae,ariaRoleDescription:te,ariaRowCount:L,ariaRowIndex:L,ariaRowSpan:L,ariaSelected:ae,ariaSetSize:L,ariaSort:null,ariaValueMax:L,ariaValueMin:L,ariaValueNow:L,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function Yr(e,t){return t in e?e[t]:t}function Gr(e,t){return Yr(e,t.toLowerCase())}const Ta=Ge({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:_e,acceptCharset:te,accessKey:te,action:null,allow:null,allowFullScreen:Y,allowPaymentRequest:Y,allowUserMedia:Y,alpha:Y,alt:null,as:null,async:Y,autoCapitalize:null,autoComplete:te,autoFocus:Y,autoPlay:Y,blocking:te,capture:null,charSet:null,checked:Y,cite:null,className:te,closedBy:null,colorSpace:null,cols:L,colSpan:L,command:null,commandFor:null,content:null,contentEditable:ae,controls:Y,controlsList:te,coords:L|_e,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Y,defer:Y,dir:null,dirName:null,disabled:Y,download:tn,draggable:ae,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Y,formTarget:null,headers:te,height:L,hidden:tn,high:L,href:null,hrefLang:null,htmlFor:te,httpEquiv:te,id:null,imageSizes:null,imageSrcSet:null,inert:Y,inputMode:null,integrity:null,is:null,isMap:Y,itemId:null,itemProp:te,itemRef:te,itemScope:Y,itemType:te,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Y,low:L,manifest:null,max:null,maxLength:L,media:null,method:null,min:null,minLength:L,multiple:Y,muted:Y,name:null,nonce:null,noModule:Y,noValidate:Y,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:Y,optimum:L,pattern:null,ping:te,placeholder:null,playsInline:Y,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Y,referrerPolicy:null,rel:te,required:Y,reversed:Y,rows:L,rowSpan:L,sandbox:te,scope:null,scoped:Y,seamless:Y,selected:Y,shadowRootClonable:Y,shadowRootCustomElementRegistry:Y,shadowRootDelegatesFocus:Y,shadowRootMode:null,shadowRootSerializable:Y,shape:null,size:L,sizes:null,slot:null,span:L,spellCheck:ae,src:null,srcDoc:null,srcLang:null,srcSet:null,start:L,step:null,style:null,tabIndex:L,target:null,title:null,translate:null,type:null,typeMustMatch:Y,useMap:null,value:ae,width:L,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:te,axis:null,background:null,bgColor:null,border:L,borderColor:null,bottomMargin:L,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:Y,declare:Y,event:null,face:null,frame:null,frameBorder:null,hSpace:L,leftMargin:L,link:null,longDesc:null,lowSrc:null,marginHeight:L,marginWidth:L,noResize:Y,noHref:Y,noShade:Y,noWrap:Y,object:null,profile:null,prompt:null,rev:null,rightMargin:L,rules:null,scheme:null,scrolling:ae,standby:null,summary:null,text:null,topMargin:L,valueType:null,version:null,vAlign:null,vLink:null,vSpace:L,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:Y,disablePictureInPicture:Y,disableRemotePlayback:Y,exportParts:_e,part:te,prefix:null,property:null,results:L,security:null,unselectable:null},space:"html",transform:Gr}),za=Ge({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:be,accentHeight:L,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:L,amplitude:L,arabicForm:null,ascent:L,attributeName:null,attributeType:null,azimuth:L,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:L,by:null,calcMode:null,capHeight:L,className:te,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:L,diffuseConstant:L,direction:null,display:null,dur:null,divisor:L,dominantBaseline:null,download:Y,dx:null,dy:null,edgeMode:null,editable:null,elevation:L,enableBackground:null,end:null,event:null,exponent:L,externalResourcesRequired:null,fill:null,fillOpacity:L,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:_e,g2:_e,glyphName:_e,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:L,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:L,horizOriginX:L,horizOriginY:L,id:null,ideographic:L,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:L,k:L,k1:L,k2:L,k3:L,k4:L,kernelMatrix:be,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:L,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:L,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:L,overlineThickness:L,paintOrder:null,panose1:null,path:null,pathLength:L,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:te,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:L,pointsAtY:L,pointsAtZ:L,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:be,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:be,rev:be,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:be,requiredFeatures:be,requiredFonts:be,requiredFormats:be,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:L,specularExponent:L,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:L,strikethroughThickness:L,string:null,stroke:null,strokeDashArray:be,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:L,strokeOpacity:L,strokeWidth:null,style:null,surfaceScale:L,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:be,tabIndex:L,tableValues:null,target:null,targetX:L,targetY:L,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:be,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:L,underlineThickness:L,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:L,values:null,vAlphabetic:L,vMathematical:L,vectorEffect:null,vHanging:L,vIdeographic:L,version:null,vertAdvY:L,vertOriginX:L,vertOriginY:L,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:L,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:Yr}),Xr=Ge({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()}}),Kr=Ge({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:Gr}),Qr=Ge({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),Aa={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"},Na=/[A-Z]/g,_n=/-[a-z]/g,Da=/^data[-\w.:]+$/i;function La(e,t){const n=en(t);let r=t,i=me;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&Da.test(t)){if(t.charAt(4)==="-"){const s=t.slice(5).replace(_n,Ra);r="data"+s.charAt(0).toUpperCase()+s.slice(1)}else{const s=t.slice(4);if(!_n.test(s)){let a=s.replace(Na,Ma);a.charAt(0)!=="-"&&(a="-"+a),t="data"+a}}i=fn}return new i(r,t)}function Ma(e){return"-"+e.toLowerCase()}function Ra(e){return e.charAt(1).toUpperCase()}const Pa=qr([Wr,Ta,Xr,Kr,Qr],"html"),hn=qr([Wr,za,Xr,Kr,Qr],"svg");function Fa(e){return e.join(" ").trim()}var gn={},On=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,_a=/\n/g,Oa=/^\s*/,Ba=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,$a=/^:\s*/,Ha=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,Ua=/^[;\s]*/,Va=/^\s+|\s+$/g,qa=`
2
+ `,Bn="/",$n="*",Fe="",Wa="comment",Ya="declaration";function Ga(e,t){if(typeof e!="string")throw new TypeError("First argument must be a string");if(!e)return[];t=t||{};var n=1,r=1;function i(g){var y=g.match(_a);y&&(n+=y.length);var C=g.lastIndexOf(qa);r=~C?g.length-C:r+g.length}function s(){var g={line:n,column:r};return function(y){return y.position=new a(g),u(),y}}function a(g){this.start=g,this.end={line:n,column:r},this.source=t.source}a.prototype.content=e;function o(g){var y=new Error(t.source+":"+n+":"+r+": "+g);if(y.reason=g,y.filename=t.source,y.line=n,y.column=r,y.source=e,!t.silent)throw y}function l(g){var y=g.exec(e);if(y){var C=y[0];return i(C),e=e.slice(C.length),y}}function u(){l(Oa)}function p(g){var y;for(g=g||[];y=c();)y!==!1&&g.push(y);return g}function c(){var g=s();if(!(Bn!=e.charAt(0)||$n!=e.charAt(1))){for(var y=2;Fe!=e.charAt(y)&&($n!=e.charAt(y)||Bn!=e.charAt(y+1));)++y;if(y+=2,Fe===e.charAt(y-1))return o("End of comment missing");var C=e.slice(2,y-2);return r+=2,i(C),e=e.slice(y),r+=2,g({type:Wa,comment:C})}}function h(){var g=s(),y=l(Ba);if(y){if(c(),!l($a))return o("property missing ':'");var C=l(Ha),w=g({type:Ya,property:Hn(y[0].replace(On,Fe)),value:C?Hn(C[0].replace(On,Fe)):Fe});return l(Ua),w}}function f(){var g=[];p(g);for(var y;y=h();)y!==!1&&(g.push(y),p(g));return g}return u(),f()}function Hn(e){return e?e.replace(Va,Fe):Fe}var Xa=Ga,Ka=Oe.commonjsGlobal&&Oe.commonjsGlobal.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(gn,"__esModule",{value:!0});gn.default=Ja;const Qa=Ka(Xa);function Ja(e,t){let n=null;if(!e||typeof e!="string")return n;const r=(0,Qa.default)(e),i=typeof t=="function";return r.forEach(s=>{if(s.type!=="declaration")return;const{property:a,value:o}=s;i?t(a,o,s):o&&(n=n||{},n[a]=o)}),n}var jt={};Object.defineProperty(jt,"__esModule",{value:!0});jt.camelCase=void 0;var Za=/^--[a-zA-Z0-9_-]+$/,es=/-([a-z])/g,ts=/^[^-]+$/,ns=/^-(webkit|moz|ms|o|khtml)-/,rs=/^-(ms)-/,is=function(e){return!e||ts.test(e)||Za.test(e)},as=function(e,t){return t.toUpperCase()},Un=function(e,t){return"".concat(t,"-")},ss=function(e,t){return t===void 0&&(t={}),is(e)?e:(e=e.toLowerCase(),t.reactCompat?e=e.replace(rs,Un):e=e.replace(ns,Un),e.replace(es,as))};jt.camelCase=ss;var os=Oe.commonjsGlobal&&Oe.commonjsGlobal.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},ls=os(gn),us=jt;function rn(e,t){var n={};return!e||typeof e!="string"||(0,ls.default)(e,function(r,i){r&&i&&(n[(0,us.camelCase)(r,t)]=i)}),n}rn.default=rn;var cs=rn;const ps=Oe.getDefaultExportFromCjs(cs),Jr=Zr("end"),mn=Zr("start");function Zr(e){return t;function t(n){const r=n&&n.position&&n.position[e]||{};if(typeof r.line=="number"&&r.line>0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function ds(e){const t=mn(e),n=Jr(e);if(t&&n)return{start:t,end:n}}function st(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?Vn(e.position):"start"in e||"end"in e?Vn(e):"line"in e||"column"in e?an(e):""}function an(e){return qn(e&&e.line)+":"+qn(e&&e.column)}function Vn(e){return an(e&&e.start)+"-"+an(e&&e.end)}function qn(e){return e&&typeof e=="number"?e:1}class de extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let i="",s={},a=!1;if(n&&("line"in n&&"column"in n?s={place:n}:"start"in n&&"end"in n?s={place:n}:"type"in n?s={ancestors:[n],place:n.position}:s={...n}),typeof t=="string"?i=t:!s.cause&&t&&(a=!0,i=t.message,s.cause=t),!s.ruleId&&!s.source&&typeof r=="string"){const l=r.indexOf(":");l===-1?s.ruleId=r:(s.source=r.slice(0,l),s.ruleId=r.slice(l+1))}if(!s.place&&s.ancestors&&s.ancestors){const l=s.ancestors[s.ancestors.length-1];l&&(s.place=l.position)}const o=s.place&&"start"in s.place?s.place.start:s.place;this.ancestors=s.ancestors||void 0,this.cause=s.cause||void 0,this.column=o?o.column:void 0,this.fatal=void 0,this.file="",this.message=i,this.line=o?o.line:void 0,this.name=st(s.place)||"1:1",this.place=s.place||void 0,this.reason=this.message,this.ruleId=s.ruleId||void 0,this.source=s.source||void 0,this.stack=a&&s.cause&&typeof s.cause.stack=="string"?s.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}de.prototype.file="";de.prototype.name="";de.prototype.reason="";de.prototype.message="";de.prototype.stack="";de.prototype.column=void 0;de.prototype.line=void 0;de.prototype.ancestors=void 0;de.prototype.cause=void 0;de.prototype.fatal=void 0;de.prototype.place=void 0;de.prototype.ruleId=void 0;de.prototype.source=void 0;const xn={}.hasOwnProperty,fs=new Map,hs=/[A-Z]/g,gs=new Set(["table","tbody","thead","tfoot","tr"]),ms=new Set(["td","th"]),ei="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function xs(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let r;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=Es(n,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=Ss(n,t.jsx,t.jsxs)}const 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"?hn:Pa,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},s=ti(i,e,void 0);return s&&typeof s!="string"?s:i.create(e,i.Fragment,{children:s||void 0},void 0)}function ti(e,t,n){if(t.type==="element")return bs(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return ws(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return ks(e,t,n);if(t.type==="mdxjsEsm")return ys(e,t);if(t.type==="root")return vs(e,t,n);if(t.type==="text")return Cs(e,t)}function bs(e,t,n){const r=e.schema;let i=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(i=hn,e.schema=i),e.ancestors.push(t);const s=ri(e,t.tagName,!1),a=js(e,t);let o=wn(e,t);return gs.has(t.tagName)&&(o=o.filter(function(l){return typeof l=="string"?!ja(l):!0})),ni(e,a,s,t),bn(a,o),e.ancestors.pop(),e.schema=r,e.create(t,s,a,n)}function ws(e,t){if(t.data&&t.data.estree&&e.evaluater){const r=t.data.estree.body[0];return r.type,e.evaluater.evaluateExpression(r.expression)}ut(e,t.position)}function ys(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);ut(e,t.position)}function ks(e,t,n){const r=e.schema;let i=r;t.name==="svg"&&r.space==="html"&&(i=hn,e.schema=i),e.ancestors.push(t);const s=t.name===null?e.Fragment:ri(e,t.name,!0),a=Is(e,t),o=wn(e,t);return ni(e,a,s,t),bn(a,o),e.ancestors.pop(),e.schema=r,e.create(t,s,a,n)}function vs(e,t,n){const r={};return bn(r,wn(e,t)),e.create(t,e.Fragment,r,n)}function Cs(e,t){return t.value}function ni(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function bn(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function Ss(e,t,n){return r;function r(i,s,a,o){const u=Array.isArray(a.children)?n:t;return o?u(s,a,o):u(s,a)}}function Es(e,t){return n;function n(r,i,s,a){const o=Array.isArray(s.children),l=mn(r);return t(i,s,a,o,{columnNumber:l?l.column-1:void 0,fileName:e,lineNumber:l?l.line:void 0},void 0)}}function js(e,t){const n={};let r,i;for(i in t.properties)if(i!=="children"&&xn.call(t.properties,i)){const s=Ts(e,i,t.properties[i]);if(s){const[a,o]=s;e.tableCellAlignToStyle&&a==="align"&&typeof o=="string"&&ms.has(t.tagName)?r=o:n[a]=o}}if(r){const s=n.style||(n.style={});s[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function Is(e,t){const n={};for(const r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const s=r.data.estree.body[0];s.type;const a=s.expression;a.type;const o=a.properties[0];o.type,Object.assign(n,e.evaluater.evaluateExpression(o.argument))}else ut(e,t.position);else{const i=r.name;let s;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const o=r.value.data.estree.body[0];o.type,s=e.evaluater.evaluateExpression(o.expression)}else ut(e,t.position);else s=r.value===null?!0:r.value;n[i]=s}return n}function wn(e,t){const n=[];let r=-1;const i=e.passKeys?new Map:fs;for(;++r<t.children.length;){const s=t.children[r];let a;if(e.passKeys){const l=s.type==="element"?s.tagName:s.type==="mdxJsxFlowElement"||s.type==="mdxJsxTextElement"?s.name:void 0;if(l){const u=i.get(l)||0;a=l+"-"+u,i.set(l,u+1)}}const o=ti(e,s,a);o!==void 0&&n.push(o)}return n}function Ts(e,t,n){const r=La(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?ka(n):Fa(n)),r.property==="style"){let i=typeof n=="object"?n:zs(e,String(n));return e.stylePropertyNameCase==="css"&&(i=As(i)),["style",i]}return[e.elementAttributeNameCase==="react"&&r.space?Aa[r.property]||r.property:r.attribute,n]}}function zs(e,t){try{return ps(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const r=n,i=new de("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:r,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw i.file=e.filePath||void 0,i.url=ei+"#cannot-parse-style-attribute",i}}function ri(e,t,n){let r;if(!n)r={type:"Literal",value:t};else if(t.includes(".")){const i=t.split(".");let s=-1,a;for(;++s<i.length;){const o=Rn(i[s])?{type:"Identifier",name:i[s]}:{type:"Literal",value:i[s]};a=a?{type:"MemberExpression",object:a,property:o,computed:!!(s&&o.type==="Literal"),optional:!1}:o}r=a}else r=Rn(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const i=r.value;return xn.call(e.components,i)?e.components[i]:i}if(e.evaluater)return e.evaluater.evaluateExpression(r);ut(e)}function ut(e,t){const n=new de("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=ei+"#cannot-handle-mdx-estrees-without-createevaluater",n}function As(e){const t={};let n;for(n in e)xn.call(e,n)&&(t[Ns(n)]=e[n]);return t}function Ns(e){let t=e.replace(hs,Ds);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function Ds(e){return"-"+e.toLowerCase()}const _t={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"]},Ls={};function yn(e,t){const n=Ls,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,i=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return ii(e,r,i)}function ii(e,t,n){if(Ms(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 Wn(e.children,t,n)}return Array.isArray(e)?Wn(e,t,n):""}function Wn(e,t,n){const r=[];let i=-1;for(;++i<e.length;)r[i]=ii(e[i],t,n);return r.join("")}function Ms(e){return!!(e&&typeof e=="object")}const Yn=document.createElement("i");function kn(e){const t="&"+e+";";Yn.innerHTML=t;const n=Yn.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function we(e,t,n,r){const i=e.length;let s=0,a;if(t<0?t=-t>i?0:i+t:t=t>i?i:t,n=n>0?n:0,r.length<1e4)a=Array.from(r),a.unshift(t,n),e.splice(...a);else for(n&&e.splice(t,n);s<r.length;)a=r.slice(s,s+1e4),a.unshift(t,0),e.splice(...a),s+=1e4,t+=1e4}function ke(e,t){return e.length>0?(we(e,e.length,0,t),e):t}const Gn={}.hasOwnProperty;function ai(e){const t={};let n=-1;for(;++n<e.length;)Rs(t,e[n]);return t}function Rs(e,t){let n;for(n in t){const i=(Gn.call(e,n)?e[n]:void 0)||(e[n]={}),s=t[n];let a;if(s)for(a in s){Gn.call(i,a)||(i[a]=[]);const o=s[a];Ps(i[a],Array.isArray(o)?o:o?[o]:[])}}}function Ps(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);we(e,0,0,r)}function si(e,t){const 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 Ce(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const fe=De(/[A-Za-z]/),pe=De(/[\dA-Za-z]/),Fs=De(/[#-'*+\--9=?A-Z^-~]/);function vt(e){return e!==null&&(e<32||e===127)}const sn=De(/\d/),_s=De(/[\dA-Fa-f]/),Os=De(/[!-/:-@[-`{-~]/);function V(e){return e!==null&&e<-2}function ne(e){return e!==null&&(e<0||e===32)}function K(e){return e===-2||e===-1||e===32}const It=De(new RegExp("\\p{P}|\\p{S}","u")),Be=De(/\s/);function De(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function Xe(e){const t=[];let n=-1,r=0,i=0;for(;++n<e.length;){const s=e.charCodeAt(n);let a="";if(s===37&&pe(e.charCodeAt(n+1))&&pe(e.charCodeAt(n+2)))i=2;else if(s<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(s))||(a=String.fromCharCode(s));else if(s>55295&&s<57344){const o=e.charCodeAt(n+1);s<56320&&o>56319&&o<57344?(a=String.fromCharCode(s,o),i=1):a="�"}else a=String.fromCharCode(s);a&&(t.push(e.slice(r,n),encodeURIComponent(a)),r=n+i+1,a=""),i&&(n+=i,i=0)}return t.join("")+e.slice(r)}function J(e,t,n,r){const i=r?r-1:Number.POSITIVE_INFINITY;let s=0;return a;function a(l){return K(l)?(e.enter(n),o(l)):t(l)}function o(l){return K(l)&&s++<i?(e.consume(l),o):(e.exit(n),t(l))}}const Bs={tokenize:$s};function $s(e){const t=e.attempt(this.parser.constructs.contentInitial,r,i);let n;return t;function r(o){if(o===null){e.consume(o);return}return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),J(e,t,"linePrefix")}function i(o){return e.enter("paragraph"),s(o)}function s(o){const l=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=l),n=l,a(o)}function a(o){if(o===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(o);return}return V(o)?(e.consume(o),e.exit("chunkText"),s):(e.consume(o),a)}}const Hs={tokenize:Us},Xn={tokenize:Vs};function Us(e){const t=this,n=[];let r=0,i,s,a;return o;function o(S){if(r<n.length){const z=n[r];return t.containerState=z[1],e.attempt(z[0].continuation,l,u)(S)}return u(S)}function l(S){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&E();const z=t.events.length;let A=z,v;for(;A--;)if(t.events[A][0]==="exit"&&t.events[A][1].type==="chunkFlow"){v=t.events[A][1].end;break}w(r);let N=z;for(;N<t.events.length;)t.events[N][1].end={...v},N++;return we(t.events,A+1,0,t.events.slice(z)),t.events.length=N,u(S)}return o(S)}function u(S){if(r===n.length){if(!i)return h(S);if(i.currentConstruct&&i.currentConstruct.concrete)return g(S);t.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(Xn,p,c)(S)}function p(S){return i&&E(),w(r),h(S)}function c(S){return t.parser.lazy[t.now().line]=r!==n.length,a=t.now().offset,g(S)}function h(S){return t.containerState={},e.attempt(Xn,f,g)(S)}function f(S){return r++,n.push([t.currentConstruct,t.containerState]),h(S)}function g(S){if(S===null){i&&E(),w(0),e.consume(S);return}return i=i||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:i,contentType:"flow",previous:s}),y(S)}function y(S){if(S===null){C(e.exit("chunkFlow"),!0),w(0),e.consume(S);return}return V(S)?(e.consume(S),C(e.exit("chunkFlow")),r=0,t.interrupt=void 0,o):(e.consume(S),y)}function C(S,z){const A=t.sliceStream(S);if(z&&A.push(null),S.previous=s,s&&(s.next=S),s=S,i.defineSkip(S.start),i.write(A),t.parser.lazy[S.start.line]){let v=i.events.length;for(;v--;)if(i.events[v][1].start.offset<a&&(!i.events[v][1].end||i.events[v][1].end.offset>a))return;const N=t.events.length;let O=N,$,b;for(;O--;)if(t.events[O][0]==="exit"&&t.events[O][1].type==="chunkFlow"){if($){b=t.events[O][1].end;break}$=!0}for(w(r),v=N;v<t.events.length;)t.events[v][1].end={...b},v++;we(t.events,O+1,0,t.events.slice(N)),t.events.length=v}}function w(S){let z=n.length;for(;z-- >S;){const A=n[z];t.containerState=A[1],A[0].exit.call(t,e)}n.length=S}function E(){i.write([null]),s=void 0,i=void 0,t.containerState._closeFlow=void 0}}function Vs(e,t,n){return J(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Ye(e){if(e===null||ne(e)||Be(e))return 1;if(It(e))return 2}function Tt(e,t,n){const r=[];let i=-1;for(;++i<e.length;){const s=e[i].resolveAll;s&&!r.includes(s)&&(t=s(t,n),r.push(s))}return t}const on={name:"attention",resolveAll:qs,tokenize:Ws};function qs(e,t){let n=-1,r,i,s,a,o,l,u,p;for(;++n<e.length;)if(e[n][0]==="enter"&&e[n][1].type==="attentionSequence"&&e[n][1]._close){for(r=n;r--;)if(e[r][0]==="exit"&&e[r][1].type==="attentionSequence"&&e[r][1]._open&&t.sliceSerialize(e[r][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[r][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;l=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const c={...e[r][1].end},h={...e[n][1].start};Kn(c,-l),Kn(h,l),a={type:l>1?"strongSequence":"emphasisSequence",start:c,end:{...e[r][1].end}},o={type:l>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:h},s={type:l>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[n][1].start}},i={type:l>1?"strong":"emphasis",start:{...a.start},end:{...o.end}},e[r][1].end={...a.start},e[n][1].start={...o.end},u=[],e[r][1].end.offset-e[r][1].start.offset&&(u=ke(u,[["enter",e[r][1],t],["exit",e[r][1],t]])),u=ke(u,[["enter",i,t],["enter",a,t],["exit",a,t],["enter",s,t]]),u=ke(u,Tt(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),u=ke(u,[["exit",s,t],["enter",o,t],["exit",o,t],["exit",i,t]]),e[n][1].end.offset-e[n][1].start.offset?(p=2,u=ke(u,[["enter",e[n][1],t],["exit",e[n][1],t]])):p=0,we(e,r-1,n-r+3,u),n=r+u.length-p-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function Ws(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=Ye(r);let s;return a;function a(l){return s=l,e.enter("attentionSequence"),o(l)}function o(l){if(l===s)return e.consume(l),o;const u=e.exit("attentionSequence"),p=Ye(l),c=!p||p===2&&i||n.includes(l),h=!i||i===2&&p||n.includes(r);return u._open=!!(s===42?c:c&&(i||!h)),u._close=!!(s===42?h:h&&(p||!c)),t(l)}}function Kn(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const Ys={name:"autolink",tokenize:Gs};function Gs(e,t,n){let r=0;return i;function i(f){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(f),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),s}function s(f){return fe(f)?(e.consume(f),a):f===64?n(f):u(f)}function a(f){return f===43||f===45||f===46||pe(f)?(r=1,o(f)):u(f)}function o(f){return f===58?(e.consume(f),r=0,l):(f===43||f===45||f===46||pe(f))&&r++<32?(e.consume(f),o):(r=0,u(f))}function l(f){return f===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(f),e.exit("autolinkMarker"),e.exit("autolink"),t):f===null||f===32||f===60||vt(f)?n(f):(e.consume(f),l)}function u(f){return f===64?(e.consume(f),p):Fs(f)?(e.consume(f),u):n(f)}function p(f){return pe(f)?c(f):n(f)}function c(f){return f===46?(e.consume(f),r=0,p):f===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(f),e.exit("autolinkMarker"),e.exit("autolink"),t):h(f)}function h(f){if((f===45||pe(f))&&r++<63){const g=f===45?h:c;return e.consume(f),g}return n(f)}}const dt={partial:!0,tokenize:Xs};function Xs(e,t,n){return r;function r(s){return K(s)?J(e,i,"linePrefix")(s):i(s)}function i(s){return s===null||V(s)?t(s):n(s)}}const oi={continuation:{tokenize:Qs},exit:Js,name:"blockQuote",tokenize:Ks};function Ks(e,t,n){const r=this;return i;function i(a){if(a===62){const o=r.containerState;return o.open||(e.enter("blockQuote",{_container:!0}),o.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(a),e.exit("blockQuoteMarker"),s}return n(a)}function s(a){return K(a)?(e.enter("blockQuotePrefixWhitespace"),e.consume(a),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(a))}}function Qs(e,t,n){const r=this;return i;function i(a){return K(a)?J(e,s,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a):s(a)}function s(a){return e.attempt(oi,t,n)(a)}}function Js(e){e.exit("blockQuote")}const li={name:"characterEscape",tokenize:Zs};function Zs(e,t,n){return r;function r(s){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(s),e.exit("escapeMarker"),i}function i(s){return Os(s)?(e.enter("characterEscapeValue"),e.consume(s),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(s)}}const ui={name:"characterReference",tokenize:eo};function eo(e,t,n){const r=this;let i=0,s,a;return o;function o(c){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(c),e.exit("characterReferenceMarker"),l}function l(c){return c===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(c),e.exit("characterReferenceMarkerNumeric"),u):(e.enter("characterReferenceValue"),s=31,a=pe,p(c))}function u(c){return c===88||c===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(c),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),s=6,a=_s,p):(e.enter("characterReferenceValue"),s=7,a=sn,p(c))}function p(c){if(c===59&&i){const h=e.exit("characterReferenceValue");return a===pe&&!kn(r.sliceSerialize(h))?n(c):(e.enter("characterReferenceMarker"),e.consume(c),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return a(c)&&i++<s?(e.consume(c),p):n(c)}}const Qn={partial:!0,tokenize:no},Jn={concrete:!0,name:"codeFenced",tokenize:to};function to(e,t,n){const r=this,i={partial:!0,tokenize:A};let s=0,a=0,o;return l;function l(v){return u(v)}function u(v){const N=r.events[r.events.length-1];return s=N&&N[1].type==="linePrefix"?N[2].sliceSerialize(N[1],!0).length:0,o=v,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),p(v)}function p(v){return v===o?(a++,e.consume(v),p):a<3?n(v):(e.exit("codeFencedFenceSequence"),K(v)?J(e,c,"whitespace")(v):c(v))}function c(v){return v===null||V(v)?(e.exit("codeFencedFence"),r.interrupt?t(v):e.check(Qn,y,z)(v)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),h(v))}function h(v){return v===null||V(v)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),c(v)):K(v)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),J(e,f,"whitespace")(v)):v===96&&v===o?n(v):(e.consume(v),h)}function f(v){return v===null||V(v)?c(v):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),g(v))}function g(v){return v===null||V(v)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),c(v)):v===96&&v===o?n(v):(e.consume(v),g)}function y(v){return e.attempt(i,z,C)(v)}function C(v){return e.enter("lineEnding"),e.consume(v),e.exit("lineEnding"),w}function w(v){return s>0&&K(v)?J(e,E,"linePrefix",s+1)(v):E(v)}function E(v){return v===null||V(v)?e.check(Qn,y,z)(v):(e.enter("codeFlowValue"),S(v))}function S(v){return v===null||V(v)?(e.exit("codeFlowValue"),E(v)):(e.consume(v),S)}function z(v){return e.exit("codeFenced"),t(v)}function A(v,N,O){let $=0;return b;function b(_){return v.enter("lineEnding"),v.consume(_),v.exit("lineEnding"),j}function j(_){return v.enter("codeFencedFence"),K(_)?J(v,T,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(_):T(_)}function T(_){return _===o?(v.enter("codeFencedFenceSequence"),M(_)):O(_)}function M(_){return _===o?($++,v.consume(_),M):$>=a?(v.exit("codeFencedFenceSequence"),K(_)?J(v,F,"whitespace")(_):F(_)):O(_)}function F(_){return _===null||V(_)?(v.exit("codeFencedFence"),N(_)):O(_)}}}function no(e,t,n){const r=this;return i;function i(a){return a===null?n(a):(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),s)}function s(a){return r.parser.lazy[r.now().line]?n(a):t(a)}}const Ot={name:"codeIndented",tokenize:io},ro={partial:!0,tokenize:ao};function io(e,t,n){const r=this;return i;function i(u){return e.enter("codeIndented"),J(e,s,"linePrefix",5)(u)}function s(u){const p=r.events[r.events.length-1];return p&&p[1].type==="linePrefix"&&p[2].sliceSerialize(p[1],!0).length>=4?a(u):n(u)}function a(u){return u===null?l(u):V(u)?e.attempt(ro,a,l)(u):(e.enter("codeFlowValue"),o(u))}function o(u){return u===null||V(u)?(e.exit("codeFlowValue"),a(u)):(e.consume(u),o)}function l(u){return e.exit("codeIndented"),t(u)}}function ao(e,t,n){const r=this;return i;function i(a){return r.parser.lazy[r.now().line]?n(a):V(a)?(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),i):J(e,s,"linePrefix",5)(a)}function s(a){const o=r.events[r.events.length-1];return o&&o[1].type==="linePrefix"&&o[2].sliceSerialize(o[1],!0).length>=4?t(a):V(a)?i(a):n(a)}}const so={name:"codeText",previous:lo,resolve:oo,tokenize:uo};function oo(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 lo(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function uo(e,t,n){let r=0,i,s;return a;function a(c){return e.enter("codeText"),e.enter("codeTextSequence"),o(c)}function o(c){return c===96?(e.consume(c),r++,o):(e.exit("codeTextSequence"),l(c))}function l(c){return c===null?n(c):c===32?(e.enter("space"),e.consume(c),e.exit("space"),l):c===96?(s=e.enter("codeTextSequence"),i=0,p(c)):V(c)?(e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),l):(e.enter("codeTextData"),u(c))}function u(c){return c===null||c===32||c===96||V(c)?(e.exit("codeTextData"),l(c)):(e.consume(c),u)}function p(c){return c===96?(e.consume(c),i++,p):i===r?(e.exit("codeTextSequence"),e.exit("codeText"),t(c)):(s.type="codeTextData",u(c))}}class co{constructor(t){this.left=t?[...t]:[],this.right=[]}get(t){if(t<0||t>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return t<this.left.length?this.left[t]:this.right[this.right.length-t+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(t,n){const r=n??Number.POSITIVE_INFINITY;return r<this.left.length?this.left.slice(t,r):t>this.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(t,n,r){const i=n||0;this.setCursor(Math.trunc(t));const s=this.right.splice(this.right.length-i,Number.POSITIVE_INFINITY);return r&&it(this.left,r),s.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),it(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),it(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t<this.left.length){const n=this.left.splice(t,Number.POSITIVE_INFINITY);it(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);it(this.left,n.reverse())}}}function it(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 ci(e){const t={};let n=-1,r,i,s,a,o,l,u;const p=new co(e);for(;++n<p.length;){for(;n in t;)n=t[n];if(r=p.get(n),n&&r[1].type==="chunkFlow"&&p.get(n-1)[1].type==="listItemPrefix"&&(l=r[1]._tokenizer.events,s=0,s<l.length&&l[s][1].type==="lineEndingBlank"&&(s+=2),s<l.length&&l[s][1].type==="content"))for(;++s<l.length&&l[s][1].type!=="content";)l[s][1].type==="chunkText"&&(l[s][1]._isInFirstContentOfListItem=!0,s++);if(r[0]==="enter")r[1].contentType&&(Object.assign(t,po(p,n)),n=t[n],u=!0);else if(r[1]._container){for(s=n,i=void 0;s--;)if(a=p.get(s),a[1].type==="lineEnding"||a[1].type==="lineEndingBlank")a[0]==="enter"&&(i&&(p.get(i)[1].type="lineEndingBlank"),a[1].type="lineEnding",i=s);else if(!(a[1].type==="linePrefix"||a[1].type==="listItemIndent"))break;i&&(r[1].end={...p.get(i)[1].start},o=p.slice(i,n),o.unshift(r),p.splice(i,n-i+1,o))}}return we(e,0,Number.POSITIVE_INFINITY,p.slice(0)),!u}function po(e,t){const n=e.get(t)[1],r=e.get(t)[2];let i=t-1;const s=[];let a=n._tokenizer;a||(a=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(a._contentTypeTextTrailing=!0));const o=a.events,l=[],u={};let p,c,h=-1,f=n,g=0,y=0;const C=[y];for(;f;){for(;e.get(++i)[1]!==f;);s.push(i),f._tokenizer||(p=r.sliceStream(f),f.next||p.push(null),c&&a.defineSkip(f.start),f._isInFirstContentOfListItem&&(a._gfmTasklistFirstContentOfListItem=!0),a.write(p),f._isInFirstContentOfListItem&&(a._gfmTasklistFirstContentOfListItem=void 0)),c=f,f=f.next}for(f=n;++h<o.length;)o[h][0]==="exit"&&o[h-1][0]==="enter"&&o[h][1].type===o[h-1][1].type&&o[h][1].start.line!==o[h][1].end.line&&(y=h+1,C.push(y),f._tokenizer=void 0,f.previous=void 0,f=f.next);for(a.events=[],f?(f._tokenizer=void 0,f.previous=void 0):C.pop(),h=C.length;h--;){const w=o.slice(C[h],C[h+1]),E=s.pop();l.push([E,E+w.length-1]),e.splice(E,2,w)}for(l.reverse(),h=-1;++h<l.length;)u[g+l[h][0]]=g+l[h][1],g+=l[h][1]-l[h][0]-1;return u}const fo={resolve:go,tokenize:mo},ho={partial:!0,tokenize:xo};function go(e){return ci(e),e}function mo(e,t){let n;return r;function r(o){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),i(o)}function i(o){return o===null?s(o):V(o)?e.check(ho,a,s)(o):(e.consume(o),i)}function s(o){return e.exit("chunkContent"),e.exit("content"),t(o)}function a(o){return e.consume(o),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,i}}function xo(e,t,n){const r=this;return i;function i(a){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),J(e,s,"linePrefix")}function s(a){if(a===null||V(a))return n(a);const o=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&o&&o[1].type==="linePrefix"&&o[2].sliceSerialize(o[1],!0).length>=4?t(a):e.interrupt(r.parser.constructs.flow,n,t)(a)}}function pi(e,t,n,r,i,s,a,o,l){const u=l||Number.POSITIVE_INFINITY;let p=0;return c;function c(w){return w===60?(e.enter(r),e.enter(i),e.enter(s),e.consume(w),e.exit(s),h):w===null||w===32||w===41||vt(w)?n(w):(e.enter(r),e.enter(a),e.enter(o),e.enter("chunkString",{contentType:"string"}),y(w))}function h(w){return w===62?(e.enter(s),e.consume(w),e.exit(s),e.exit(i),e.exit(r),t):(e.enter(o),e.enter("chunkString",{contentType:"string"}),f(w))}function f(w){return w===62?(e.exit("chunkString"),e.exit(o),h(w)):w===null||w===60||V(w)?n(w):(e.consume(w),w===92?g:f)}function g(w){return w===60||w===62||w===92?(e.consume(w),f):f(w)}function y(w){return!p&&(w===null||w===41||ne(w))?(e.exit("chunkString"),e.exit(o),e.exit(a),e.exit(r),t(w)):p<u&&w===40?(e.consume(w),p++,y):w===41?(e.consume(w),p--,y):w===null||w===32||w===40||vt(w)?n(w):(e.consume(w),w===92?C:y)}function C(w){return w===40||w===41||w===92?(e.consume(w),y):y(w)}}function di(e,t,n,r,i,s){const a=this;let o=0,l;return u;function u(f){return e.enter(r),e.enter(i),e.consume(f),e.exit(i),e.enter(s),p}function p(f){return o>999||f===null||f===91||f===93&&!l||f===94&&!o&&"_hiddenFootnoteSupport"in a.parser.constructs?n(f):f===93?(e.exit(s),e.enter(i),e.consume(f),e.exit(i),e.exit(r),t):V(f)?(e.enter("lineEnding"),e.consume(f),e.exit("lineEnding"),p):(e.enter("chunkString",{contentType:"string"}),c(f))}function c(f){return f===null||f===91||f===93||V(f)||o++>999?(e.exit("chunkString"),p(f)):(e.consume(f),l||(l=!K(f)),f===92?h:c)}function h(f){return f===91||f===92||f===93?(e.consume(f),o++,c):c(f)}}function fi(e,t,n,r,i,s){let a;return o;function o(h){return h===34||h===39||h===40?(e.enter(r),e.enter(i),e.consume(h),e.exit(i),a=h===40?41:h,l):n(h)}function l(h){return h===a?(e.enter(i),e.consume(h),e.exit(i),e.exit(r),t):(e.enter(s),u(h))}function u(h){return h===a?(e.exit(s),l(a)):h===null?n(h):V(h)?(e.enter("lineEnding"),e.consume(h),e.exit("lineEnding"),J(e,u,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),p(h))}function p(h){return h===a||h===null||V(h)?(e.exit("chunkString"),u(h)):(e.consume(h),h===92?c:p)}function c(h){return h===a||h===92?(e.consume(h),p):p(h)}}function ot(e,t){let n;return r;function r(i){return V(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n=!0,r):K(i)?J(e,r,n?"linePrefix":"lineSuffix")(i):t(i)}}const bo={name:"definition",tokenize:yo},wo={partial:!0,tokenize:ko};function yo(e,t,n){const r=this;let i;return s;function s(f){return e.enter("definition"),a(f)}function a(f){return di.call(r,e,o,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(f)}function o(f){return i=Ce(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),f===58?(e.enter("definitionMarker"),e.consume(f),e.exit("definitionMarker"),l):n(f)}function l(f){return ne(f)?ot(e,u)(f):u(f)}function u(f){return pi(e,p,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(f)}function p(f){return e.attempt(wo,c,c)(f)}function c(f){return K(f)?J(e,h,"whitespace")(f):h(f)}function h(f){return f===null||V(f)?(e.exit("definition"),r.parser.defined.push(i),t(f)):n(f)}}function ko(e,t,n){return r;function r(o){return ne(o)?ot(e,i)(o):n(o)}function i(o){return fi(e,s,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(o)}function s(o){return K(o)?J(e,a,"whitespace")(o):a(o)}function a(o){return o===null||V(o)?t(o):n(o)}}const vo={name:"hardBreakEscape",tokenize:Co};function Co(e,t,n){return r;function r(s){return e.enter("hardBreakEscape"),e.consume(s),i}function i(s){return V(s)?(e.exit("hardBreakEscape"),t(s)):n(s)}}const So={name:"headingAtx",resolve:Eo,tokenize:jo};function Eo(e,t){let n=e.length-2,r=3,i,s;return 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&&(i={type:"atxHeadingText",start:e[r][1].start,end:e[n][1].end},s={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},we(e,r,n-r+1,[["enter",i,t],["enter",s,t],["exit",s,t],["exit",i,t]])),e}function jo(e,t,n){let r=0;return i;function i(p){return e.enter("atxHeading"),s(p)}function s(p){return e.enter("atxHeadingSequence"),a(p)}function a(p){return p===35&&r++<6?(e.consume(p),a):p===null||ne(p)?(e.exit("atxHeadingSequence"),o(p)):n(p)}function o(p){return p===35?(e.enter("atxHeadingSequence"),l(p)):p===null||V(p)?(e.exit("atxHeading"),t(p)):K(p)?J(e,o,"whitespace")(p):(e.enter("atxHeadingText"),u(p))}function l(p){return p===35?(e.consume(p),l):(e.exit("atxHeadingSequence"),o(p))}function u(p){return p===null||p===35||ne(p)?(e.exit("atxHeadingText"),o(p)):(e.consume(p),u)}}const Io=["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"],Zn=["pre","script","style","textarea"],To={concrete:!0,name:"htmlFlow",resolveTo:No,tokenize:Do},zo={partial:!0,tokenize:Mo},Ao={partial:!0,tokenize:Lo};function No(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 Do(e,t,n){const r=this;let i,s,a,o,l;return u;function u(m){return p(m)}function p(m){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(m),c}function c(m){return m===33?(e.consume(m),h):m===47?(e.consume(m),s=!0,y):m===63?(e.consume(m),i=3,r.interrupt?t:x):fe(m)?(e.consume(m),a=String.fromCharCode(m),C):n(m)}function h(m){return m===45?(e.consume(m),i=2,f):m===91?(e.consume(m),i=5,o=0,g):fe(m)?(e.consume(m),i=4,r.interrupt?t:x):n(m)}function f(m){return m===45?(e.consume(m),r.interrupt?t:x):n(m)}function g(m){const Z="CDATA[";return m===Z.charCodeAt(o++)?(e.consume(m),o===Z.length?r.interrupt?t:T:g):n(m)}function y(m){return fe(m)?(e.consume(m),a=String.fromCharCode(m),C):n(m)}function C(m){if(m===null||m===47||m===62||ne(m)){const Z=m===47,se=a.toLowerCase();return!Z&&!s&&Zn.includes(se)?(i=1,r.interrupt?t(m):T(m)):Io.includes(a.toLowerCase())?(i=6,Z?(e.consume(m),w):r.interrupt?t(m):T(m)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(m):s?E(m):S(m))}return m===45||pe(m)?(e.consume(m),a+=String.fromCharCode(m),C):n(m)}function w(m){return m===62?(e.consume(m),r.interrupt?t:T):n(m)}function E(m){return K(m)?(e.consume(m),E):b(m)}function S(m){return m===47?(e.consume(m),b):m===58||m===95||fe(m)?(e.consume(m),z):K(m)?(e.consume(m),S):b(m)}function z(m){return m===45||m===46||m===58||m===95||pe(m)?(e.consume(m),z):A(m)}function A(m){return m===61?(e.consume(m),v):K(m)?(e.consume(m),A):S(m)}function v(m){return m===null||m===60||m===61||m===62||m===96?n(m):m===34||m===39?(e.consume(m),l=m,N):K(m)?(e.consume(m),v):O(m)}function N(m){return m===l?(e.consume(m),l=null,$):m===null||V(m)?n(m):(e.consume(m),N)}function O(m){return m===null||m===34||m===39||m===47||m===60||m===61||m===62||m===96||ne(m)?A(m):(e.consume(m),O)}function $(m){return m===47||m===62||K(m)?S(m):n(m)}function b(m){return m===62?(e.consume(m),j):n(m)}function j(m){return m===null||V(m)?T(m):K(m)?(e.consume(m),j):n(m)}function T(m){return m===45&&i===2?(e.consume(m),H):m===60&&i===1?(e.consume(m),X):m===62&&i===4?(e.consume(m),B):m===63&&i===3?(e.consume(m),x):m===93&&i===5?(e.consume(m),U):V(m)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(zo,P,M)(m)):m===null||V(m)?(e.exit("htmlFlowData"),M(m)):(e.consume(m),T)}function M(m){return e.check(Ao,F,P)(m)}function F(m){return e.enter("lineEnding"),e.consume(m),e.exit("lineEnding"),_}function _(m){return m===null||V(m)?M(m):(e.enter("htmlFlowData"),T(m))}function H(m){return m===45?(e.consume(m),x):T(m)}function X(m){return m===47?(e.consume(m),a="",D):T(m)}function D(m){if(m===62){const Z=a.toLowerCase();return Zn.includes(Z)?(e.consume(m),B):T(m)}return fe(m)&&a.length<8?(e.consume(m),a+=String.fromCharCode(m),D):T(m)}function U(m){return m===93?(e.consume(m),x):T(m)}function x(m){return m===62?(e.consume(m),B):m===45&&i===2?(e.consume(m),x):T(m)}function B(m){return m===null||V(m)?(e.exit("htmlFlowData"),P(m)):(e.consume(m),B)}function P(m){return e.exit("htmlFlow"),t(m)}}function Lo(e,t,n){const r=this;return i;function i(a){return V(a)?(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),s):n(a)}function s(a){return r.parser.lazy[r.now().line]?n(a):t(a)}}function Mo(e,t,n){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(dt,t,n)}}const Ro={name:"htmlText",tokenize:Po};function Po(e,t,n){const r=this;let i,s,a;return o;function o(x){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(x),l}function l(x){return x===33?(e.consume(x),u):x===47?(e.consume(x),A):x===63?(e.consume(x),S):fe(x)?(e.consume(x),O):n(x)}function u(x){return x===45?(e.consume(x),p):x===91?(e.consume(x),s=0,g):fe(x)?(e.consume(x),E):n(x)}function p(x){return x===45?(e.consume(x),f):n(x)}function c(x){return x===null?n(x):x===45?(e.consume(x),h):V(x)?(a=c,X(x)):(e.consume(x),c)}function h(x){return x===45?(e.consume(x),f):c(x)}function f(x){return x===62?H(x):x===45?h(x):c(x)}function g(x){const B="CDATA[";return x===B.charCodeAt(s++)?(e.consume(x),s===B.length?y:g):n(x)}function y(x){return x===null?n(x):x===93?(e.consume(x),C):V(x)?(a=y,X(x)):(e.consume(x),y)}function C(x){return x===93?(e.consume(x),w):y(x)}function w(x){return x===62?H(x):x===93?(e.consume(x),w):y(x)}function E(x){return x===null||x===62?H(x):V(x)?(a=E,X(x)):(e.consume(x),E)}function S(x){return x===null?n(x):x===63?(e.consume(x),z):V(x)?(a=S,X(x)):(e.consume(x),S)}function z(x){return x===62?H(x):S(x)}function A(x){return fe(x)?(e.consume(x),v):n(x)}function v(x){return x===45||pe(x)?(e.consume(x),v):N(x)}function N(x){return V(x)?(a=N,X(x)):K(x)?(e.consume(x),N):H(x)}function O(x){return x===45||pe(x)?(e.consume(x),O):x===47||x===62||ne(x)?$(x):n(x)}function $(x){return x===47?(e.consume(x),H):x===58||x===95||fe(x)?(e.consume(x),b):V(x)?(a=$,X(x)):K(x)?(e.consume(x),$):H(x)}function b(x){return x===45||x===46||x===58||x===95||pe(x)?(e.consume(x),b):j(x)}function j(x){return x===61?(e.consume(x),T):V(x)?(a=j,X(x)):K(x)?(e.consume(x),j):$(x)}function T(x){return x===null||x===60||x===61||x===62||x===96?n(x):x===34||x===39?(e.consume(x),i=x,M):V(x)?(a=T,X(x)):K(x)?(e.consume(x),T):(e.consume(x),F)}function M(x){return x===i?(e.consume(x),i=void 0,_):x===null?n(x):V(x)?(a=M,X(x)):(e.consume(x),M)}function F(x){return x===null||x===34||x===39||x===60||x===61||x===96?n(x):x===47||x===62||ne(x)?$(x):(e.consume(x),F)}function _(x){return x===47||x===62||ne(x)?$(x):n(x)}function H(x){return x===62?(e.consume(x),e.exit("htmlTextData"),e.exit("htmlText"),t):n(x)}function X(x){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(x),e.exit("lineEnding"),D}function D(x){return K(x)?J(e,U,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(x):U(x)}function U(x){return e.enter("htmlTextData"),a(x)}}const vn={name:"labelEnd",resolveAll:Bo,resolveTo:$o,tokenize:Ho},Fo={tokenize:Uo},_o={tokenize:Vo},Oo={tokenize:qo};function Bo(e){let t=-1;const n=[];for(;++t<e.length;){const r=e[t][1];if(n.push(e[t]),r.type==="labelImage"||r.type==="labelLink"||r.type==="labelEnd"){const i=r.type==="labelImage"?4:2;r.type="data",t+=i}}return e.length!==n.length&&we(e,0,e.length,n),e}function $o(e,t){let n=e.length,r=0,i,s,a,o;for(;n--;)if(i=e[n][1],s){if(i.type==="link"||i.type==="labelLink"&&i._inactive)break;e[n][0]==="enter"&&i.type==="labelLink"&&(i._inactive=!0)}else if(a){if(e[n][0]==="enter"&&(i.type==="labelImage"||i.type==="labelLink")&&!i._balanced&&(s=n,i.type!=="labelLink")){r=2;break}}else i.type==="labelEnd"&&(a=n);const l={type:e[s][1].type==="labelLink"?"link":"image",start:{...e[s][1].start},end:{...e[e.length-1][1].end}},u={type:"label",start:{...e[s][1].start},end:{...e[a][1].end}},p={type:"labelText",start:{...e[s+r+2][1].end},end:{...e[a-2][1].start}};return o=[["enter",l,t],["enter",u,t]],o=ke(o,e.slice(s+1,s+r+3)),o=ke(o,[["enter",p,t]]),o=ke(o,Tt(t.parser.constructs.insideSpan.null,e.slice(s+r+4,a-3),t)),o=ke(o,[["exit",p,t],e[a-2],e[a-1],["exit",u,t]]),o=ke(o,e.slice(a+1)),o=ke(o,[["exit",l,t]]),we(e,s,e.length,o),e}function Ho(e,t,n){const r=this;let i=r.events.length,s,a;for(;i--;)if((r.events[i][1].type==="labelImage"||r.events[i][1].type==="labelLink")&&!r.events[i][1]._balanced){s=r.events[i][1];break}return o;function o(h){return s?s._inactive?c(h):(a=r.parser.defined.includes(Ce(r.sliceSerialize({start:s.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(h),e.exit("labelMarker"),e.exit("labelEnd"),l):n(h)}function l(h){return h===40?e.attempt(Fo,p,a?p:c)(h):h===91?e.attempt(_o,p,a?u:c)(h):a?p(h):c(h)}function u(h){return e.attempt(Oo,p,c)(h)}function p(h){return t(h)}function c(h){return s._balanced=!0,n(h)}}function Uo(e,t,n){return r;function r(c){return e.enter("resource"),e.enter("resourceMarker"),e.consume(c),e.exit("resourceMarker"),i}function i(c){return ne(c)?ot(e,s)(c):s(c)}function s(c){return c===41?p(c):pi(e,a,o,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(c)}function a(c){return ne(c)?ot(e,l)(c):p(c)}function o(c){return n(c)}function l(c){return c===34||c===39||c===40?fi(e,u,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(c):p(c)}function u(c){return ne(c)?ot(e,p)(c):p(c)}function p(c){return c===41?(e.enter("resourceMarker"),e.consume(c),e.exit("resourceMarker"),e.exit("resource"),t):n(c)}}function Vo(e,t,n){const r=this;return i;function i(o){return di.call(r,e,s,a,"reference","referenceMarker","referenceString")(o)}function s(o){return r.parser.defined.includes(Ce(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(o):n(o)}function a(o){return n(o)}}function qo(e,t,n){return r;function r(s){return e.enter("reference"),e.enter("referenceMarker"),e.consume(s),e.exit("referenceMarker"),i}function i(s){return s===93?(e.enter("referenceMarker"),e.consume(s),e.exit("referenceMarker"),e.exit("reference"),t):n(s)}}const Wo={name:"labelStartImage",resolveAll:vn.resolveAll,tokenize:Yo};function Yo(e,t,n){const r=this;return i;function i(o){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(o),e.exit("labelImageMarker"),s}function s(o){return o===91?(e.enter("labelMarker"),e.consume(o),e.exit("labelMarker"),e.exit("labelImage"),a):n(o)}function a(o){return o===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(o):t(o)}}const Go={name:"labelStartLink",resolveAll:vn.resolveAll,tokenize:Xo};function Xo(e,t,n){const r=this;return i;function i(a){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(a),e.exit("labelMarker"),e.exit("labelLink"),s}function s(a){return a===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(a):t(a)}}const Bt={name:"lineEnding",tokenize:Ko};function Ko(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),J(e,t,"linePrefix")}}const wt={name:"thematicBreak",tokenize:Qo};function Qo(e,t,n){let r=0,i;return s;function s(u){return e.enter("thematicBreak"),a(u)}function a(u){return i=u,o(u)}function o(u){return u===i?(e.enter("thematicBreakSequence"),l(u)):r>=3&&(u===null||V(u))?(e.exit("thematicBreak"),t(u)):n(u)}function l(u){return u===i?(e.consume(u),r++,l):(e.exit("thematicBreakSequence"),K(u)?J(e,o,"whitespace")(u):o(u))}}const ge={continuation:{tokenize:tl},exit:rl,name:"list",tokenize:el},Jo={partial:!0,tokenize:il},Zo={partial:!0,tokenize:nl};function el(e,t,n){const r=this,i=r.events[r.events.length-1];let s=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,a=0;return o;function o(f){const g=r.containerState.type||(f===42||f===43||f===45?"listUnordered":"listOrdered");if(g==="listUnordered"?!r.containerState.marker||f===r.containerState.marker:sn(f)){if(r.containerState.type||(r.containerState.type=g,e.enter(g,{_container:!0})),g==="listUnordered")return e.enter("listItemPrefix"),f===42||f===45?e.check(wt,n,u)(f):u(f);if(!r.interrupt||f===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),l(f)}return n(f)}function l(f){return sn(f)&&++a<10?(e.consume(f),l):(!r.interrupt||a<2)&&(r.containerState.marker?f===r.containerState.marker:f===41||f===46)?(e.exit("listItemValue"),u(f)):n(f)}function u(f){return e.enter("listItemMarker"),e.consume(f),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||f,e.check(dt,r.interrupt?n:p,e.attempt(Jo,h,c))}function p(f){return r.containerState.initialBlankLine=!0,s++,h(f)}function c(f){return K(f)?(e.enter("listItemPrefixWhitespace"),e.consume(f),e.exit("listItemPrefixWhitespace"),h):n(f)}function h(f){return r.containerState.size=s+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(f)}}function tl(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(dt,i,s);function i(o){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,J(e,t,"listItemIndent",r.containerState.size+1)(o)}function s(o){return r.containerState.furtherBlankLines||!K(o)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,a(o)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(Zo,t,a)(o))}function a(o){return r.containerState._closeFlow=!0,r.interrupt=void 0,J(e,e.attempt(ge,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(o)}}function nl(e,t,n){const r=this;return J(e,i,"listItemIndent",r.containerState.size+1);function i(s){const a=r.events[r.events.length-1];return a&&a[1].type==="listItemIndent"&&a[2].sliceSerialize(a[1],!0).length===r.containerState.size?t(s):n(s)}}function rl(e){e.exit(this.containerState.type)}function il(e,t,n){const r=this;return J(e,i,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(s){const a=r.events[r.events.length-1];return!K(s)&&a&&a[1].type==="listItemPrefixWhitespace"?t(s):n(s)}}const er={name:"setextUnderline",resolveTo:al,tokenize:sl};function al(e,t){let n=e.length,r,i,s;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){r=n;break}e[n][1].type==="paragraph"&&(i=n)}else e[n][1].type==="content"&&e.splice(n,1),!s&&e[n][1].type==="definition"&&(s=n);const a={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type="setextHeadingText",s?(e.splice(i,0,["enter",a,t]),e.splice(s+1,0,["exit",e[r][1],t]),e[r][1].end={...e[s][1].end}):e[r][1]=a,e.push(["exit",a,t]),e}function sl(e,t,n){const r=this;let i;return s;function s(u){let p=r.events.length,c;for(;p--;)if(r.events[p][1].type!=="lineEnding"&&r.events[p][1].type!=="linePrefix"&&r.events[p][1].type!=="content"){c=r.events[p][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||c)?(e.enter("setextHeadingLine"),i=u,a(u)):n(u)}function a(u){return e.enter("setextHeadingLineSequence"),o(u)}function o(u){return u===i?(e.consume(u),o):(e.exit("setextHeadingLineSequence"),K(u)?J(e,l,"lineSuffix")(u):l(u))}function l(u){return u===null||V(u)?(e.exit("setextHeadingLine"),t(u)):n(u)}}const ol={tokenize:ll};function ll(e){const t=this,n=e.attempt(dt,r,e.attempt(this.parser.constructs.flowInitial,i,J(e,e.attempt(this.parser.constructs.flow,i,e.attempt(fo,i)),"linePrefix")));return n;function r(s){if(s===null){e.consume(s);return}return e.enter("lineEndingBlank"),e.consume(s),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function i(s){if(s===null){e.consume(s);return}return e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const ul={resolveAll:gi()},cl=hi("string"),pl=hi("text");function hi(e){return{resolveAll:gi(e==="text"?dl:void 0),tokenize:t};function t(n){const r=this,i=this.parser.constructs[e],s=n.attempt(i,a,o);return a;function a(p){return u(p)?s(p):o(p)}function o(p){if(p===null){n.consume(p);return}return n.enter("data"),n.consume(p),l}function l(p){return u(p)?(n.exit("data"),s(p)):(n.consume(p),l)}function u(p){if(p===null)return!0;const c=i[p];let h=-1;if(c)for(;++h<c.length;){const f=c[h];if(!f.previous||f.previous.call(r,r.previous))return!0}return!1}}}function gi(e){return t;function t(n,r){let i=-1,s;for(;++i<=n.length;)s===void 0?n[i]&&n[i][1].type==="data"&&(s=i,i++):(!n[i]||n[i][1].type!=="data")&&(i!==s+2&&(n[s][1].end=n[i-1][1].end,n.splice(s+2,i-s-2),i=s+2),s=void 0);return e?e(n,r):n}}function dl(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type==="lineEnding")&&e[n-1][1].type==="data"){const r=e[n-1][1],i=t.sliceStream(r);let s=i.length,a=-1,o=0,l;for(;s--;){const u=i[s];if(typeof u=="string"){for(a=u.length;u.charCodeAt(a-1)===32;)o++,a--;if(a)break;a=-1}else if(u===-2)l=!0,o++;else if(u!==-1){s++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(o=0),o){const u={type:n===e.length||l||o<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:s?a:r.start._bufferIndex+a,_index:r.start._index+s,line:r.end.line,column:r.end.column-o,offset:r.end.offset-o},end:{...r.end}};r.end={...u.start},r.start.offset===r.end.offset?Object.assign(r,u):(e.splice(n,0,["enter",u,t],["exit",u,t]),n+=2)}n++}return e}const fl={42:ge,43:ge,45:ge,48:ge,49:ge,50:ge,51:ge,52:ge,53:ge,54:ge,55:ge,56:ge,57:ge,62:oi},hl={91:bo},gl={[-2]:Ot,[-1]:Ot,32:Ot},ml={35:So,42:wt,45:[er,wt],60:To,61:er,95:wt,96:Jn,126:Jn},xl={38:ui,92:li},bl={[-5]:Bt,[-4]:Bt,[-3]:Bt,33:Wo,38:ui,42:on,60:[Ys,Ro],91:Go,92:[vo,li],93:vn,95:on,96:so},wl={null:[on,ul]},yl={null:[42,95]},kl={null:[]},vl=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:yl,contentInitial:hl,disable:kl,document:fl,flow:ml,flowInitial:gl,insideSpan:wl,string:xl,text:bl},Symbol.toStringTag,{value:"Module"}));function Cl(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const i={},s=[];let a=[],o=[];const l={attempt:N(A),check:N(v),consume:E,enter:S,exit:z,interrupt:N(v,{interrupt:!0})},u={code:null,containerState:{},defineSkip:y,events:[],now:g,parser:e,previous:null,sliceSerialize:h,sliceStream:f,write:c};let p=t.tokenize.call(u,l);return t.resolveAll&&s.push(t),u;function c(j){return a=ke(a,j),C(),a[a.length-1]!==null?[]:(O(t,0),u.events=Tt(s,u.events,u),u.events)}function h(j,T){return El(f(j),T)}function f(j){return Sl(a,j)}function g(){const{_bufferIndex:j,_index:T,line:M,column:F,offset:_}=r;return{_bufferIndex:j,_index:T,line:M,column:F,offset:_}}function y(j){i[j.line]=j.column,b()}function C(){let j;for(;r._index<a.length;){const T=a[r._index];if(typeof T=="string")for(j=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===j&&r._bufferIndex<T.length;)w(T.charCodeAt(r._bufferIndex));else w(T)}}function w(j){p=p(j)}function E(j){V(j)?(r.line++,r.column=1,r.offset+=j===-3?2:1,b()):j!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===a[r._index].length&&(r._bufferIndex=-1,r._index++)),u.previous=j}function S(j,T){const M=T||{};return M.type=j,M.start=g(),u.events.push(["enter",M,u]),o.push(M),M}function z(j){const T=o.pop();return T.end=g(),u.events.push(["exit",T,u]),T}function A(j,T){O(j,T.from)}function v(j,T){T.restore()}function N(j,T){return M;function M(F,_,H){let X,D,U,x;return Array.isArray(F)?P(F):"tokenize"in F?P([F]):B(F);function B(re){return he;function he(q){const ie=q!==null&&re[q],oe=q!==null&&re.null,Se=[...Array.isArray(ie)?ie:ie?[ie]:[],...Array.isArray(oe)?oe:oe?[oe]:[]];return P(Se)(q)}}function P(re){return X=re,D=0,re.length===0?H:m(re[D])}function m(re){return he;function he(q){return x=$(),U=re,re.partial||(u.currentConstruct=re),re.name&&u.parser.constructs.disable.null.includes(re.name)?se():re.tokenize.call(T?Object.assign(Object.create(u),T):u,l,Z,se)(q)}}function Z(re){return j(U,x),_}function se(re){return x.restore(),++D<X.length?m(X[D]):H}}}function O(j,T){j.resolveAll&&!s.includes(j)&&s.push(j),j.resolve&&we(u.events,T,u.events.length-T,j.resolve(u.events.slice(T),u)),j.resolveTo&&(u.events=j.resolveTo(u.events,u))}function $(){const j=g(),T=u.previous,M=u.currentConstruct,F=u.events.length,_=Array.from(o);return{from:F,restore:H};function H(){r=j,u.previous=T,u.currentConstruct=M,u.events.length=F,o=_,b()}}function b(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function Sl(e,t){const n=t.start._index,r=t.start._bufferIndex,i=t.end._index,s=t.end._bufferIndex;let a;if(n===i)a=[e[n].slice(r,s)];else{if(a=e.slice(n,i),r>-1){const o=a[0];typeof o=="string"?a[0]=o.slice(r):a.shift()}s>0&&a.push(e[i].slice(0,s))}return a}function El(e,t){let n=-1;const r=[];let i;for(;++n<e.length;){const s=e[n];let a;if(typeof s=="string")a=s;else switch(s){case-5:{a="\r";break}case-4:{a=`
3
3
  `;break}case-3:{a=`\r
4
- `;break}case-2:{a=t?" ":" ";break}case-1:{if(!t&&i)continue;a=" ";break}default:a=String.fromCharCode(s)}i=s===-2,r.push(a)}return r.join("")}function jl(e){const r={constructs:ai([vl,...(e||{}).extensions||[]]),content:i(Bs),defined:[],document:i(Hs),flow:i(ol),lazy:{},string:i(cl),text:i(pl)};return r;function i(s){return a;function a(o){return Cl(r,s,o)}}}function Il(e){for(;!ci(e););return e}const tr=/[\0\t\n\r]/g;function zl(){let e=1,t="",n=!0,r;return i;function i(s,a,o){const l=[];let u,p,c,h,f;for(s=t+(typeof s=="string"?s.toString():new TextDecoder(a||void 0).decode(s)),c=0,t="",n&&(s.charCodeAt(0)===65279&&c++,n=void 0);c<s.length;){if(tr.lastIndex=c,u=tr.exec(s),h=u&&u.index!==void 0?u.index:s.length,f=s.charCodeAt(h),!u){t=s.slice(c);break}if(f===10&&c===h&&r)l.push(-3),r=void 0;else switch(r&&(l.push(-5),r=void 0),c<h&&(l.push(s.slice(c,h)),e+=h-c),f){case 0:{l.push(65533),e++;break}case 9:{for(p=Math.ceil(e/4)*4,l.push(-2);e++<p;)l.push(-1);break}case 10:{l.push(-4),e=1;break}default:r=!0,e=1}c=h+1}return o&&(r&&l.push(-5),t&&l.push(t),l.push(null)),l}}const Tl=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function Al(e){return e.replace(Tl,Nl)}function Nl(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const i=n.charCodeAt(1),s=i===120||i===88;return si(n.slice(s?2:1),s?16:10)}return kn(n)||e}const mi={}.hasOwnProperty;function Dl(e,t,n){return t&&typeof t=="object"&&(n=t,t=void 0),Ll(n)(Il(jl(n).document().write(zl()(e,t,!0))))}function Ll(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:s(Je),autolinkProtocol:_,autolinkEmail:_,atxHeading:s(Ke),blockQuote:s(Ee),characterEscape:_,characterReference:_,codeFenced:s(Ae),codeFencedFenceInfo:a,codeFencedFenceMeta:a,codeIndented:s(Ae,a),codeText:s(He,a),codeTextData:_,data:_,codeFlowValue:_,definition:s(Ue),definitionDestinationString:a,definitionLabelString:a,definitionTitleString:a,emphasis:s(Dt),hardBreakEscape:s(Qe),hardBreakTrailing:s(Qe),htmlFlow:s(Le,a),htmlFlowData:_,htmlText:s(Le,a),htmlTextData:_,image:s(Lt),label:a,link:s(Je),listItem:s(me),listItemValue:h,listOrdered:s(Ze,c),listUnordered:s(Ze),paragraph:s(ht),reference:y,referenceString:a,resourceDestinationString:a,resourceTitleString:a,setextHeading:s(Ke),strong:s(Mt),thematicBreak:s(Rt)},exit:{atxHeading:l(),atxHeadingSequence:L,autolink:l(),autolinkEmail:Se,autolinkProtocol:ge,blockQuote:l(),characterEscapeValue:x,characterReferenceMarkerHexadecimal:Ce,characterReferenceMarkerNumeric:Ce,characterReferenceValue:ne,characterReference:Te,codeFenced:l(S),codeFencedFence:w,codeFencedFenceInfo:f,codeFencedFenceMeta:g,codeFlowValue:x,codeIndented:l(b),codeText:l(A),codeTextData:x,data:x,definition:l(),definitionDestinationString:T,definitionLabelString:E,definitionTitleString:C,emphasis:l(),hardBreakEscape:l(M),hardBreakTrailing:l(M),htmlFlow:l($),htmlFlowData:x,htmlText:l(P),htmlTextData:x,image:l(j),label:U,labelText:O,lineEnding:I,link:l(V),listItem:l(),listOrdered:l(),listUnordered:l(),paragraph:l(),referenceString:le,resourceDestinationString:m,resourceTitleString:B,resource:K,setextHeading:l(R),setextHeadingLineSequence:N,setextHeadingText:v,strong:l(),thematicBreak:l()}};xi(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(z){let F={type:"root",children:[]};const q={stack:[F],tokenStack:[],config:t,enter:o,exit:u,buffer:a,resume:p,data:n},Y=[];let J=-1;for(;++J<z.length;)if(z[J][1].type==="listOrdered"||z[J][1].type==="listUnordered")if(z[J][0]==="enter")Y.push(J);else{const be=Y.pop();J=i(z,be,J)}for(J=-1;++J<z.length;){const be=t[z[J][0]];mi.call(be,z[J][1].type)&&be[z[J][1].type].call(Object.assign({sliceSerialize:z[J][2].sliceSerialize},q),z[J][1])}if(q.tokenStack.length>0){const be=q.tokenStack[q.tokenStack.length-1];(be[1]||nr).call(q,void 0,be[0])}for(F.position={start:Ne(z.length>0?z[0][1].start:{line:1,column:1,offset:0}),end:Ne(z.length>0?z[z.length-2][1].end:{line:1,column:1,offset:0})},J=-1;++J<t.transforms.length;)F=t.transforms[J](F)||F;return F}function i(z,F,q){let Y=F-1,J=-1,be=!1,Me,je,et,tt;for(;++Y<=q;){const de=z[Y];switch(de[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{de[0]==="enter"?J++:J--,tt=void 0;break}case"lineEndingBlank":{de[0]==="enter"&&(Me&&!tt&&!J&&!et&&(et=Y),tt=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:tt=void 0}if(!J&&de[0]==="enter"&&de[1].type==="listItemPrefix"||J===-1&&de[0]==="exit"&&(de[1].type==="listUnordered"||de[1].type==="listOrdered")){if(Me){let qe=Y;for(je=void 0;qe--;){const Ie=z[qe];if(Ie[1].type==="lineEnding"||Ie[1].type==="lineEndingBlank"){if(Ie[0]==="exit")continue;je&&(z[je][1].type="lineEndingBlank",be=!0),Ie[1].type="lineEnding",je=qe}else if(!(Ie[1].type==="linePrefix"||Ie[1].type==="blockQuotePrefix"||Ie[1].type==="blockQuotePrefixWhitespace"||Ie[1].type==="blockQuoteMarker"||Ie[1].type==="listItemIndent"))break}et&&(!je||et<je)&&(Me._spread=!0),Me.end=Object.assign({},je?z[je][1].start:de[1].end),z.splice(je||Y,0,["exit",Me,de[2]]),Y++,q++}if(de[1].type==="listItemPrefix"){const qe={type:"listItem",_spread:!1,start:Object.assign({},de[1].start),end:void 0};Me=qe,z.splice(Y,0,["enter",qe,de[2]]),Y++,q++,et=void 0,tt=!0}}}return z[F][1]._spread=be,q}function s(z,F){return q;function q(Y){o.call(this,z(Y),Y),F&&F.call(this,Y)}}function a(){this.stack.push({type:"fragment",children:[]})}function o(z,F,q){this.stack[this.stack.length-1].children.push(z),this.stack.push(z),this.tokenStack.push([F,q||void 0]),z.position={start:Ne(F.start),end:void 0}}function l(z){return F;function F(q){z&&z.call(this,q),u.call(this,q)}}function u(z,F){const q=this.stack.pop(),Y=this.tokenStack.pop();if(Y)Y[0].type!==z.type&&(F?F.call(this,z,Y[0]):(Y[1]||nr).call(this,z,Y[0]));else throw new Error("Cannot close `"+z.type+"` ("+st({start:z.start,end:z.end})+"): it’s not open");q.position.end=Ne(z.end)}function p(){return yn(this.stack.pop())}function c(){this.data.expectingFirstListItemValue=!0}function h(z){if(this.data.expectingFirstListItemValue){const F=this.stack[this.stack.length-2];F.start=Number.parseInt(this.sliceSerialize(z),10),this.data.expectingFirstListItemValue=void 0}}function f(){const z=this.resume(),F=this.stack[this.stack.length-1];F.lang=z}function g(){const z=this.resume(),F=this.stack[this.stack.length-1];F.meta=z}function w(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function S(){const z=this.resume(),F=this.stack[this.stack.length-1];F.value=z.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function b(){const z=this.resume(),F=this.stack[this.stack.length-1];F.value=z.replace(/(\r?\n|\r)$/g,"")}function E(z){const F=this.resume(),q=this.stack[this.stack.length-1];q.label=F,q.identifier=we(this.sliceSerialize(z)).toLowerCase()}function C(){const z=this.resume(),F=this.stack[this.stack.length-1];F.title=z}function T(){const z=this.resume(),F=this.stack[this.stack.length-1];F.url=z}function L(z){const F=this.stack[this.stack.length-1];if(!F.depth){const q=this.sliceSerialize(z).length;F.depth=q}}function v(){this.data.setextHeadingSlurpLineEnding=!0}function N(z){const F=this.stack[this.stack.length-1];F.depth=this.sliceSerialize(z).codePointAt(0)===61?1:2}function R(){this.data.setextHeadingSlurpLineEnding=void 0}function _(z){const q=this.stack[this.stack.length-1].children;let Y=q[q.length-1];(!Y||Y.type!=="text")&&(Y=Ve(),Y.position={start:Ne(z.start),end:void 0},q.push(Y)),this.stack.push(Y)}function x(z){const F=this.stack.pop();F.value+=this.sliceSerialize(z),F.position.end=Ne(z.end)}function I(z){const F=this.stack[this.stack.length-1];if(this.data.atHardBreak){const q=F.children[F.children.length-1];q.position.end=Ne(z.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(F.type)&&(_.call(this,z),x.call(this,z))}function M(){this.data.atHardBreak=!0}function $(){const z=this.resume(),F=this.stack[this.stack.length-1];F.value=z}function P(){const z=this.resume(),F=this.stack[this.stack.length-1];F.value=z}function A(){const z=this.resume(),F=this.stack[this.stack.length-1];F.value=z}function V(){const z=this.stack[this.stack.length-1];if(this.data.inReference){const F=this.data.referenceType||"shortcut";z.type+="Reference",z.referenceType=F,delete z.url,delete z.title}else delete z.identifier,delete z.label;this.data.referenceType=void 0}function j(){const z=this.stack[this.stack.length-1];if(this.data.inReference){const F=this.data.referenceType||"shortcut";z.type+="Reference",z.referenceType=F,delete z.url,delete z.title}else delete z.identifier,delete z.label;this.data.referenceType=void 0}function O(z){const F=this.sliceSerialize(z),q=this.stack[this.stack.length-2];q.label=Al(F),q.identifier=we(F).toLowerCase()}function U(){const z=this.stack[this.stack.length-1],F=this.resume(),q=this.stack[this.stack.length-1];if(this.data.inReference=!0,q.type==="link"){const Y=z.children;q.children=Y}else q.alt=F}function m(){const z=this.resume(),F=this.stack[this.stack.length-1];F.url=z}function B(){const z=this.resume(),F=this.stack[this.stack.length-1];F.title=z}function K(){this.data.inReference=void 0}function y(){this.data.referenceType="collapsed"}function le(z){const F=this.resume(),q=this.stack[this.stack.length-1];q.label=F,q.identifier=we(this.sliceSerialize(z)).toLowerCase(),this.data.referenceType="full"}function Ce(z){this.data.characterReferenceType=z.type}function ne(z){const F=this.sliceSerialize(z),q=this.data.characterReferenceType;let Y;q?(Y=si(F,q==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):Y=kn(F);const J=this.stack[this.stack.length-1];J.value+=Y}function Te(z){const F=this.stack.pop();F.position.end=Ne(z.end)}function ge(z){x.call(this,z);const F=this.stack[this.stack.length-1];F.url=this.sliceSerialize(z)}function Se(z){x.call(this,z);const F=this.stack[this.stack.length-1];F.url="mailto:"+this.sliceSerialize(z)}function Ee(){return{type:"blockquote",children:[]}}function Ae(){return{type:"code",lang:null,meta:null,value:""}}function He(){return{type:"inlineCode",value:""}}function Ue(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function Dt(){return{type:"emphasis",children:[]}}function Ke(){return{type:"heading",depth:0,children:[]}}function Qe(){return{type:"break"}}function Le(){return{type:"html",value:""}}function Lt(){return{type:"image",title:null,url:"",alt:null}}function Je(){return{type:"link",title:null,url:"",children:[]}}function Ze(z){return{type:"list",ordered:z.type==="listOrdered",start:null,spread:z._spread,children:[]}}function me(z){return{type:"listItem",spread:z._spread,checked:null,children:[]}}function ht(){return{type:"paragraph",children:[]}}function Mt(){return{type:"strong",children:[]}}function Ve(){return{type:"text",value:""}}function Rt(){return{type:"thematicBreak"}}}function Ne(e){return{line:e.line,column:e.column,offset:e.offset}}function xi(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?xi(e,r):Ml(e,r)}}function Ml(e,t){let n;for(n in t)if(mi.call(t,n))switch(n){case"canContainEols":{const r=t[n];r&&e[n].push(...r);break}case"transforms":{const r=t[n];r&&e[n].push(...r);break}case"enter":case"exit":{const r=t[n];r&&Object.assign(e[n],r);break}}}function nr(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+st({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+st({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+st({start:t.start,end:t.end})+") is still open")}function Rl(e){const t=this;t.parser=n;function n(r){return Dl(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function Pl(e,t){const n={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function Fl(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
4
+ `;break}case-2:{a=t?" ":" ";break}case-1:{if(!t&&i)continue;a=" ";break}default:a=String.fromCharCode(s)}i=s===-2,r.push(a)}return r.join("")}function jl(e){const r={constructs:ai([vl,...(e||{}).extensions||[]]),content:i(Bs),defined:[],document:i(Hs),flow:i(ol),lazy:{},string:i(cl),text:i(pl)};return r;function i(s){return a;function a(o){return Cl(r,s,o)}}}function Il(e){for(;!ci(e););return e}const tr=/[\0\t\n\r]/g;function Tl(){let e=1,t="",n=!0,r;return i;function i(s,a,o){const l=[];let u,p,c,h,f;for(s=t+(typeof s=="string"?s.toString():new TextDecoder(a||void 0).decode(s)),c=0,t="",n&&(s.charCodeAt(0)===65279&&c++,n=void 0);c<s.length;){if(tr.lastIndex=c,u=tr.exec(s),h=u&&u.index!==void 0?u.index:s.length,f=s.charCodeAt(h),!u){t=s.slice(c);break}if(f===10&&c===h&&r)l.push(-3),r=void 0;else switch(r&&(l.push(-5),r=void 0),c<h&&(l.push(s.slice(c,h)),e+=h-c),f){case 0:{l.push(65533),e++;break}case 9:{for(p=Math.ceil(e/4)*4,l.push(-2);e++<p;)l.push(-1);break}case 10:{l.push(-4),e=1;break}default:r=!0,e=1}c=h+1}return o&&(r&&l.push(-5),t&&l.push(t),l.push(null)),l}}const zl=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function Al(e){return e.replace(zl,Nl)}function Nl(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const i=n.charCodeAt(1),s=i===120||i===88;return si(n.slice(s?2:1),s?16:10)}return kn(n)||e}const mi={}.hasOwnProperty;function Dl(e,t,n){return t&&typeof t=="object"&&(n=t,t=void 0),Ll(n)(Il(jl(n).document().write(Tl()(e,t,!0))))}function Ll(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:s(Je),autolinkProtocol:$,autolinkEmail:$,atxHeading:s(Ke),blockQuote:s(oe),characterEscape:$,characterReference:$,codeFenced:s(Se),codeFencedFenceInfo:a,codeFencedFenceMeta:a,codeIndented:s(Se,a),codeText:s(He,a),codeTextData:$,data:$,codeFlowValue:$,definition:s(Ue),definitionDestinationString:a,definitionLabelString:a,definitionTitleString:a,emphasis:s(Dt),hardBreakEscape:s(Qe),hardBreakTrailing:s(Qe),htmlFlow:s(Le,a),htmlFlowData:$,htmlText:s(Le,a),htmlTextData:$,image:s(Lt),label:a,link:s(Je),listItem:s(ye),listItemValue:h,listOrdered:s(Ze,c),listUnordered:s(Ze),paragraph:s(ht),reference:m,referenceString:a,resourceDestinationString:a,resourceTitleString:a,setextHeading:s(Ke),strong:s(Mt),thematicBreak:s(Rt)},exit:{atxHeading:l(),atxHeadingSequence:A,autolink:l(),autolinkEmail:ie,autolinkProtocol:q,blockQuote:l(),characterEscapeValue:b,characterReferenceMarkerHexadecimal:se,characterReferenceMarkerNumeric:se,characterReferenceValue:re,characterReference:he,codeFenced:l(C),codeFencedFence:y,codeFencedFenceInfo:f,codeFencedFenceMeta:g,codeFlowValue:b,codeIndented:l(w),codeText:l(_),codeTextData:b,data:b,definition:l(),definitionDestinationString:z,definitionLabelString:E,definitionTitleString:S,emphasis:l(),hardBreakEscape:l(T),hardBreakTrailing:l(T),htmlFlow:l(M),htmlFlowData:b,htmlText:l(F),htmlTextData:b,image:l(X),label:U,labelText:D,lineEnding:j,link:l(H),listItem:l(),listOrdered:l(),listUnordered:l(),paragraph:l(),referenceString:Z,resourceDestinationString:x,resourceTitleString:B,resource:P,setextHeading:l(O),setextHeadingLineSequence:N,setextHeadingText:v,strong:l(),thematicBreak:l()}};xi(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(I){let R={type:"root",children:[]};const W={stack:[R],tokenStack:[],config:t,enter:o,exit:u,buffer:a,resume:p,data:n},G=[];let ee=-1;for(;++ee<I.length;)if(I[ee][1].type==="listOrdered"||I[ee][1].type==="listUnordered")if(I[ee][0]==="enter")G.push(ee);else{const ve=G.pop();ee=i(I,ve,ee)}for(ee=-1;++ee<I.length;){const ve=t[I[ee][0]];mi.call(ve,I[ee][1].type)&&ve[I[ee][1].type].call(Object.assign({sliceSerialize:I[ee][2].sliceSerialize},W),I[ee][1])}if(W.tokenStack.length>0){const ve=W.tokenStack[W.tokenStack.length-1];(ve[1]||nr).call(W,void 0,ve[0])}for(R.position={start:Ne(I.length>0?I[0][1].start:{line:1,column:1,offset:0}),end:Ne(I.length>0?I[I.length-2][1].end:{line:1,column:1,offset:0})},ee=-1;++ee<t.transforms.length;)R=t.transforms[ee](R)||R;return R}function i(I,R,W){let G=R-1,ee=-1,ve=!1,Me,Te,et,tt;for(;++G<=W;){const xe=I[G];switch(xe[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{xe[0]==="enter"?ee++:ee--,tt=void 0;break}case"lineEndingBlank":{xe[0]==="enter"&&(Me&&!tt&&!ee&&!et&&(et=G),tt=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:tt=void 0}if(!ee&&xe[0]==="enter"&&xe[1].type==="listItemPrefix"||ee===-1&&xe[0]==="exit"&&(xe[1].type==="listUnordered"||xe[1].type==="listOrdered")){if(Me){let qe=G;for(Te=void 0;qe--;){const ze=I[qe];if(ze[1].type==="lineEnding"||ze[1].type==="lineEndingBlank"){if(ze[0]==="exit")continue;Te&&(I[Te][1].type="lineEndingBlank",ve=!0),ze[1].type="lineEnding",Te=qe}else if(!(ze[1].type==="linePrefix"||ze[1].type==="blockQuotePrefix"||ze[1].type==="blockQuotePrefixWhitespace"||ze[1].type==="blockQuoteMarker"||ze[1].type==="listItemIndent"))break}et&&(!Te||et<Te)&&(Me._spread=!0),Me.end=Object.assign({},Te?I[Te][1].start:xe[1].end),I.splice(Te||G,0,["exit",Me,xe[2]]),G++,W++}if(xe[1].type==="listItemPrefix"){const qe={type:"listItem",_spread:!1,start:Object.assign({},xe[1].start),end:void 0};Me=qe,I.splice(G,0,["enter",qe,xe[2]]),G++,W++,et=void 0,tt=!0}}}return I[R][1]._spread=ve,W}function s(I,R){return W;function W(G){o.call(this,I(G),G),R&&R.call(this,G)}}function a(){this.stack.push({type:"fragment",children:[]})}function o(I,R,W){this.stack[this.stack.length-1].children.push(I),this.stack.push(I),this.tokenStack.push([R,W||void 0]),I.position={start:Ne(R.start),end:void 0}}function l(I){return R;function R(W){I&&I.call(this,W),u.call(this,W)}}function u(I,R){const W=this.stack.pop(),G=this.tokenStack.pop();if(G)G[0].type!==I.type&&(R?R.call(this,I,G[0]):(G[1]||nr).call(this,I,G[0]));else throw new Error("Cannot close `"+I.type+"` ("+st({start:I.start,end:I.end})+"): it’s not open");W.position.end=Ne(I.end)}function p(){return yn(this.stack.pop())}function c(){this.data.expectingFirstListItemValue=!0}function h(I){if(this.data.expectingFirstListItemValue){const R=this.stack[this.stack.length-2];R.start=Number.parseInt(this.sliceSerialize(I),10),this.data.expectingFirstListItemValue=void 0}}function f(){const I=this.resume(),R=this.stack[this.stack.length-1];R.lang=I}function g(){const I=this.resume(),R=this.stack[this.stack.length-1];R.meta=I}function y(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function C(){const I=this.resume(),R=this.stack[this.stack.length-1];R.value=I.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function w(){const I=this.resume(),R=this.stack[this.stack.length-1];R.value=I.replace(/(\r?\n|\r)$/g,"")}function E(I){const R=this.resume(),W=this.stack[this.stack.length-1];W.label=R,W.identifier=Ce(this.sliceSerialize(I)).toLowerCase()}function S(){const I=this.resume(),R=this.stack[this.stack.length-1];R.title=I}function z(){const I=this.resume(),R=this.stack[this.stack.length-1];R.url=I}function A(I){const R=this.stack[this.stack.length-1];if(!R.depth){const W=this.sliceSerialize(I).length;R.depth=W}}function v(){this.data.setextHeadingSlurpLineEnding=!0}function N(I){const R=this.stack[this.stack.length-1];R.depth=this.sliceSerialize(I).codePointAt(0)===61?1:2}function O(){this.data.setextHeadingSlurpLineEnding=void 0}function $(I){const W=this.stack[this.stack.length-1].children;let G=W[W.length-1];(!G||G.type!=="text")&&(G=Ve(),G.position={start:Ne(I.start),end:void 0},W.push(G)),this.stack.push(G)}function b(I){const R=this.stack.pop();R.value+=this.sliceSerialize(I),R.position.end=Ne(I.end)}function j(I){const R=this.stack[this.stack.length-1];if(this.data.atHardBreak){const W=R.children[R.children.length-1];W.position.end=Ne(I.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(R.type)&&($.call(this,I),b.call(this,I))}function T(){this.data.atHardBreak=!0}function M(){const I=this.resume(),R=this.stack[this.stack.length-1];R.value=I}function F(){const I=this.resume(),R=this.stack[this.stack.length-1];R.value=I}function _(){const I=this.resume(),R=this.stack[this.stack.length-1];R.value=I}function H(){const I=this.stack[this.stack.length-1];if(this.data.inReference){const R=this.data.referenceType||"shortcut";I.type+="Reference",I.referenceType=R,delete I.url,delete I.title}else delete I.identifier,delete I.label;this.data.referenceType=void 0}function X(){const I=this.stack[this.stack.length-1];if(this.data.inReference){const R=this.data.referenceType||"shortcut";I.type+="Reference",I.referenceType=R,delete I.url,delete I.title}else delete I.identifier,delete I.label;this.data.referenceType=void 0}function D(I){const R=this.sliceSerialize(I),W=this.stack[this.stack.length-2];W.label=Al(R),W.identifier=Ce(R).toLowerCase()}function U(){const I=this.stack[this.stack.length-1],R=this.resume(),W=this.stack[this.stack.length-1];if(this.data.inReference=!0,W.type==="link"){const G=I.children;W.children=G}else W.alt=R}function x(){const I=this.resume(),R=this.stack[this.stack.length-1];R.url=I}function B(){const I=this.resume(),R=this.stack[this.stack.length-1];R.title=I}function P(){this.data.inReference=void 0}function m(){this.data.referenceType="collapsed"}function Z(I){const R=this.resume(),W=this.stack[this.stack.length-1];W.label=R,W.identifier=Ce(this.sliceSerialize(I)).toLowerCase(),this.data.referenceType="full"}function se(I){this.data.characterReferenceType=I.type}function re(I){const R=this.sliceSerialize(I),W=this.data.characterReferenceType;let G;W?(G=si(R,W==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):G=kn(R);const ee=this.stack[this.stack.length-1];ee.value+=G}function he(I){const R=this.stack.pop();R.position.end=Ne(I.end)}function q(I){b.call(this,I);const R=this.stack[this.stack.length-1];R.url=this.sliceSerialize(I)}function ie(I){b.call(this,I);const R=this.stack[this.stack.length-1];R.url="mailto:"+this.sliceSerialize(I)}function oe(){return{type:"blockquote",children:[]}}function Se(){return{type:"code",lang:null,meta:null,value:""}}function He(){return{type:"inlineCode",value:""}}function Ue(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function Dt(){return{type:"emphasis",children:[]}}function Ke(){return{type:"heading",depth:0,children:[]}}function Qe(){return{type:"break"}}function Le(){return{type:"html",value:""}}function Lt(){return{type:"image",title:null,url:"",alt:null}}function Je(){return{type:"link",title:null,url:"",children:[]}}function Ze(I){return{type:"list",ordered:I.type==="listOrdered",start:null,spread:I._spread,children:[]}}function ye(I){return{type:"listItem",spread:I._spread,checked:null,children:[]}}function ht(){return{type:"paragraph",children:[]}}function Mt(){return{type:"strong",children:[]}}function Ve(){return{type:"text",value:""}}function Rt(){return{type:"thematicBreak"}}}function Ne(e){return{line:e.line,column:e.column,offset:e.offset}}function xi(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?xi(e,r):Ml(e,r)}}function Ml(e,t){let n;for(n in t)if(mi.call(t,n))switch(n){case"canContainEols":{const r=t[n];r&&e[n].push(...r);break}case"transforms":{const r=t[n];r&&e[n].push(...r);break}case"enter":case"exit":{const r=t[n];r&&Object.assign(e[n],r);break}}}function nr(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+st({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+st({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+st({start:t.start,end:t.end})+") is still open")}function Rl(e){const t=this;t.parser=n;function n(r){return Dl(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function Pl(e,t){const n={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function Fl(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
5
5
  `}]}function _l(e,t){const n=t.value?t.value+`
6
6
  `:"",r={},i=t.lang?t.lang.split(/\s+/):[];i.length>0&&(r.className=["language-"+i[0]]);let s={type:"element",tagName:"code",properties:r,children:[{type:"text",value:n}]};return t.meta&&(s.data={meta:t.meta}),e.patch(t,s),s=e.applyData(t,s),s={type:"element",tagName:"pre",properties:{},children:[s]},e.patch(t,s),s}function Ol(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Bl(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function $l(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),i=Xe(r.toLowerCase()),s=e.footnoteOrder.indexOf(r);let a,o=e.footnoteCounts.get(r);o===void 0?(o=0,e.footnoteOrder.push(r),a=e.footnoteOrder.length):a=s+1,o+=1,e.footnoteCounts.set(r,o);const l={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+i,id:n+"fnref-"+i+(o>1?"-"+o:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(a)}]};e.patch(t,l);const u={type:"element",tagName:"sup",properties:{},children:[l]};return e.patch(t,u),e.applyData(t,u)}function Hl(e,t){const n={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Ul(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function bi(e,t){const n=t.referenceType;let r="]";if(n==="collapsed"?r+="[]":n==="full"&&(r+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return[{type:"text",value:"!["+t.alt+r}];const i=e.all(t),s=i[0];s&&s.type==="text"?s.value="["+s.value:i.unshift({type:"text",value:"["});const a=i[i.length-1];return a&&a.type==="text"?a.value+=r:i.push({type:"text",value:r}),i}function Vl(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return bi(e,t);const i={src:Xe(r.url||""),alt:t.alt};r.title!==null&&r.title!==void 0&&(i.title=r.title);const s={type:"element",tagName:"img",properties:i,children:[]};return e.patch(t,s),e.applyData(t,s)}function ql(e,t){const n={src:Xe(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)}function Wl(e,t){const n={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,n);const r={type:"element",tagName:"code",properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)}function Yl(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return bi(e,t);const i={href:Xe(r.url||"")};r.title!==null&&r.title!==void 0&&(i.title=r.title);const s={type:"element",tagName:"a",properties:i,children:e.all(t)};return e.patch(t,s),e.applyData(t,s)}function Gl(e,t){const n={href:Xe(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function Xl(e,t,n){const r=e.all(t),i=n?Kl(n):wi(t),s={},a=[];if(typeof t.checked=="boolean"){const p=r[0];let c;p&&p.type==="element"&&p.tagName==="p"?c=p:(c={type:"element",tagName:"p",properties:{},children:[]},r.unshift(c)),c.children.length>0&&c.children.unshift({type:"text",value:" "}),c.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),s.className=["task-list-item"]}let o=-1;for(;++o<r.length;){const p=r[o];(i||o!==0||p.type!=="element"||p.tagName!=="p")&&a.push({type:"text",value:`
7
7
  `}),p.type==="element"&&p.tagName==="p"&&!i?a.push(...p.children):a.push(p)}const l=r[r.length-1];l&&(i||l.type!=="element"||l.tagName!=="p")&&a.push({type:"text",value:`
8
- `});const u={type:"element",tagName:"li",properties:s,children:a};return e.patch(t,u),e.applyData(t,u)}function Kl(e){let t=!1;if(e.type==="list"){t=e.spread||!1;const n=e.children;let r=-1;for(;!t&&++r<n.length;)t=wi(n[r])}return t}function wi(e){const t=e.spread;return t??e.children.length>1}function Ql(e,t){const n={},r=e.all(t);let i=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++i<r.length;){const a=r[i];if(a.type==="element"&&a.tagName==="li"&&a.properties&&Array.isArray(a.properties.className)&&a.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}const s={type:"element",tagName:t.ordered?"ol":"ul",properties:n,children:e.wrap(r,!0)};return e.patch(t,s),e.applyData(t,s)}function Jl(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Zl(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function eu(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function tu(e,t){const n=e.all(t),r=n.shift(),i=[];if(r){const a={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],a),i.push(a)}if(n.length>0){const a={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},o=mn(t.children[1]),l=Jr(t.children[t.children.length-1]);o&&l&&(a.position={start:o,end:l}),i.push(a)}const s={type:"element",tagName:"table",properties:{},children:e.wrap(i,!0)};return e.patch(t,s),e.applyData(t,s)}function nu(e,t,n){const r=n?n.children:void 0,s=(r?r.indexOf(t):1)===0?"th":"td",a=n&&n.type==="table"?n.align:void 0,o=a?a.length:t.children.length;let l=-1;const u=[];for(;++l<o;){const c=t.children[l],h={},f=a?a[l]:void 0;f&&(h.align=f);let g={type:"element",tagName:s,properties:h,children:[]};c&&(g.children=e.all(c),e.patch(c,g),g=e.applyData(c,g)),u.push(g)}const p={type:"element",tagName:"tr",properties:{},children:e.wrap(u,!0)};return e.patch(t,p),e.applyData(t,p)}function ru(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const rr=9,ir=32;function iu(e){const t=String(e),n=/\r?\n|\r/g;let r=n.exec(t),i=0;const s=[];for(;r;)s.push(ar(t.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return s.push(ar(t.slice(i),i>0,!1)),s.join("")}function ar(e,t,n){let r=0,i=e.length;if(t){let s=e.codePointAt(r);for(;s===rr||s===ir;)r++,s=e.codePointAt(r)}if(n){let s=e.codePointAt(i-1);for(;s===rr||s===ir;)i--,s=e.codePointAt(i-1)}return i>r?e.slice(r,i):""}function au(e,t){const n={type:"text",value:iu(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function su(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const ou={blockquote:Pl,break:Fl,code:_l,delete:Ol,emphasis:Bl,footnoteReference:$l,heading:Hl,html:Ul,imageReference:Vl,image:ql,inlineCode:Wl,linkReference:Yl,link:Gl,listItem:Xl,list:Ql,paragraph:Jl,root:Zl,strong:eu,table:tu,tableCell:ru,tableRow:nu,text:au,thematicBreak:su,toml:gt,yaml:gt,definition:gt,footnoteDefinition:gt};function gt(){}const yi=-1,Tt=0,lt=1,Ct=2,Cn=3,Sn=4,En=5,jn=6,ki=7,vi=8,{defineProperty:lu}=Object,Ci=typeof self=="object"?self:globalThis,sr=(e,t)=>{switch(e){case"Function":case"SharedWorker":case"Worker":case"eval":case"setInterval":case"setTimeout":throw new TypeError("unable to deserialize "+e)}return new Ci[e](t)},uu=(e,t)=>{const n=(i,s)=>(e.set(s,i),i),r=i=>{if(e.has(i))return e.get(i);const[s,a]=t[i];switch(s){case Tt:case yi:return n(a,i);case lt:{const o=n([],i);for(const l of a)o.push(r(l));return o}case Ct:{const o=n({},i);for(const[l,u]of a){const p=r(l),c=r(u);p==="__proto__"?lu(o,p,{value:c,configurable:!0,enumerable:!0,writable:!0}):o[p]=c}return o}case Cn:return n(new Date(a),i);case Sn:{const{source:o,flags:l}=a;return n(new RegExp(o,l),i)}case En:{const o=n(new Map,i);for(const[l,u]of a)o.set(r(l),r(u));return o}case jn:{const o=n(new Set,i);for(const l of a)o.add(r(l));return o}case ki:{const{name:o,message:l}=a;return n(typeof Ci[o]=="function"?sr(o,l):new Error(l),i)}case vi:return n(BigInt(a),i);case"BigInt":return n(Object(BigInt(a)),i);case"ArrayBuffer":return n(new Uint8Array(a).buffer,a);case"DataView":{const{buffer:o}=new Uint8Array(a);return n(new DataView(o),a)}case"-0":return-0}return n(sr(s,a),i)};return r},or=e=>uu(new Map,e)(0),Pe="",{toString:cu}={},{keys:pu,is:du}=Object,at=e=>{const t=typeof e;if(t!=="object"||!e)return[Tt,t];const n=cu.call(e).slice(8,-1);switch(n){case"Array":return[lt,Pe];case"Object":return[Ct,Pe];case"Date":return[Cn,Pe];case"RegExp":return[Sn,Pe];case"Map":return[En,Pe];case"Set":return[jn,Pe];case"DataView":return[lt,n]}return n.includes("Array")?[lt,n]:e instanceof Error?[ki,e.name||"Error"]:[Ct,n]},mt=([e,t])=>e===Tt&&(t==="function"||t==="symbol"),fu=(e,t,n,r)=>{const i=(a,o)=>{const l=r.push(a)-1;return n.set(o,l),l},s=a=>{if(n.has(a))return n.get(a);let[o,l]=at(a);switch(o){case Tt:{let p=a;switch(l){case"bigint":o=vi,p=a.toString();break;case"number":if(!a&&du(a,-0))return r.push(["-0"])-1;break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+l);p=null;break;case"undefined":return i([yi],a)}return i([o,p],a)}case lt:{if(l){let h=a;return l==="DataView"?h=new Uint8Array(a.buffer):l==="ArrayBuffer"&&(h=new Uint8Array(a)),i([l,[...h]],a)}const p=[],c=i([o,p],a);for(const h of a)p.push(s(h));return c}case Ct:{if(l)switch(l){case"BigInt":return i([l,a.toString()],a);case"Boolean":case"Number":case"String":return i([l,a.valueOf()],a)}if(t&&"toJSON"in a)return s(a.toJSON());const p=[],c=i([o,p],a);for(const h of pu(a))(e||!mt(at(a[h])))&&p.push([s(h),s(a[h])]);return c}case Cn:return i([o,isNaN(a.getTime())?Pe:a.toISOString()],a);case Sn:{const{source:p,flags:c}=a;return i([o,{source:p,flags:c}],a)}case En:{const p=[],c=i([o,p],a);for(const[h,f]of a)(e||!(mt(at(h))||mt(at(f))))&&p.push([s(h),s(f)]);return c}case jn:{const p=[],c=i([o,p],a);for(const h of a)(e||!mt(at(h)))&&p.push(s(h));return c}}const{message:u}=a;return i([o,{name:l,message:u}],a)};return s},lr=(e,{json:t,lossy:n}={})=>{const r=[];return fu(!(t||n),!!t,new Map,r)(e),r},St=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?or(lr(e,t)):structuredClone(e):(e,t)=>or(lr(e,t));function hu(e,t){const n=[{type:"text",value:"↩"}];return t>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),n}function gu(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function mu(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||hu,r=e.options.footnoteBackLabel||gu,i=e.options.footnoteLabel||"Footnotes",s=e.options.footnoteLabelTagName||"h2",a=e.options.footnoteLabelProperties||{className:["sr-only"]},o=[];let l=-1;for(;++l<e.footnoteOrder.length;){const u=e.footnoteById.get(e.footnoteOrder[l]);if(!u)continue;const p=e.all(u),c=String(u.identifier).toUpperCase(),h=Xe(c.toLowerCase());let f=0;const g=[],w=e.footnoteCounts.get(c);for(;w!==void 0&&++f<=w;){g.length>0&&g.push({type:"text",value:" "});let E=typeof n=="string"?n:n(l,f);typeof E=="string"&&(E={type:"text",value:E}),g.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+h+(f>1?"-"+f:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(l,f),className:["data-footnote-backref"]},children:Array.isArray(E)?E:[E]})}const S=p[p.length-1];if(S&&S.type==="element"&&S.tagName==="p"){const E=S.children[S.children.length-1];E&&E.type==="text"?E.value+=" ":S.children.push({type:"text",value:" "}),S.children.push(...g)}else p.push(...g);const b={type:"element",tagName:"li",properties:{id:t+"fn-"+h},children:e.wrap(p,!0)};e.patch(u,b),o.push(b)}if(o.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:s,properties:{...St(a),id:"footnote-label"},children:[{type:"text",value:i}]},{type:"text",value:`
8
+ `});const u={type:"element",tagName:"li",properties:s,children:a};return e.patch(t,u),e.applyData(t,u)}function Kl(e){let t=!1;if(e.type==="list"){t=e.spread||!1;const n=e.children;let r=-1;for(;!t&&++r<n.length;)t=wi(n[r])}return t}function wi(e){const t=e.spread;return t??e.children.length>1}function Ql(e,t){const n={},r=e.all(t);let i=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++i<r.length;){const a=r[i];if(a.type==="element"&&a.tagName==="li"&&a.properties&&Array.isArray(a.properties.className)&&a.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}const s={type:"element",tagName:t.ordered?"ol":"ul",properties:n,children:e.wrap(r,!0)};return e.patch(t,s),e.applyData(t,s)}function Jl(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Zl(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function eu(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function tu(e,t){const n=e.all(t),r=n.shift(),i=[];if(r){const a={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],a),i.push(a)}if(n.length>0){const a={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},o=mn(t.children[1]),l=Jr(t.children[t.children.length-1]);o&&l&&(a.position={start:o,end:l}),i.push(a)}const s={type:"element",tagName:"table",properties:{},children:e.wrap(i,!0)};return e.patch(t,s),e.applyData(t,s)}function nu(e,t,n){const r=n?n.children:void 0,s=(r?r.indexOf(t):1)===0?"th":"td",a=n&&n.type==="table"?n.align:void 0,o=a?a.length:t.children.length;let l=-1;const u=[];for(;++l<o;){const c=t.children[l],h={},f=a?a[l]:void 0;f&&(h.align=f);let g={type:"element",tagName:s,properties:h,children:[]};c&&(g.children=e.all(c),e.patch(c,g),g=e.applyData(c,g)),u.push(g)}const p={type:"element",tagName:"tr",properties:{},children:e.wrap(u,!0)};return e.patch(t,p),e.applyData(t,p)}function ru(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const rr=9,ir=32;function iu(e){const t=String(e),n=/\r?\n|\r/g;let r=n.exec(t),i=0;const s=[];for(;r;)s.push(ar(t.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return s.push(ar(t.slice(i),i>0,!1)),s.join("")}function ar(e,t,n){let r=0,i=e.length;if(t){let s=e.codePointAt(r);for(;s===rr||s===ir;)r++,s=e.codePointAt(r)}if(n){let s=e.codePointAt(i-1);for(;s===rr||s===ir;)i--,s=e.codePointAt(i-1)}return i>r?e.slice(r,i):""}function au(e,t){const n={type:"text",value:iu(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function su(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const ou={blockquote:Pl,break:Fl,code:_l,delete:Ol,emphasis:Bl,footnoteReference:$l,heading:Hl,html:Ul,imageReference:Vl,image:ql,inlineCode:Wl,linkReference:Yl,link:Gl,listItem:Xl,list:Ql,paragraph:Jl,root:Zl,strong:eu,table:tu,tableCell:ru,tableRow:nu,text:au,thematicBreak:su,toml:gt,yaml:gt,definition:gt,footnoteDefinition:gt};function gt(){}const yi=-1,zt=0,lt=1,Ct=2,Cn=3,Sn=4,En=5,jn=6,ki=7,vi=8,{defineProperty:lu}=Object,Ci=typeof self=="object"?self:globalThis,sr=(e,t)=>{switch(e){case"Function":case"SharedWorker":case"Worker":case"eval":case"setInterval":case"setTimeout":throw new TypeError("unable to deserialize "+e)}return new Ci[e](t)},uu=(e,t)=>{const n=(i,s)=>(e.set(s,i),i),r=i=>{if(e.has(i))return e.get(i);const[s,a]=t[i];switch(s){case zt:case yi:return n(a,i);case lt:{const o=n([],i);for(const l of a)o.push(r(l));return o}case Ct:{const o=n({},i);for(const[l,u]of a){const p=r(l),c=r(u);p==="__proto__"?lu(o,p,{value:c,configurable:!0,enumerable:!0,writable:!0}):o[p]=c}return o}case Cn:return n(new Date(a),i);case Sn:{const{source:o,flags:l}=a;return n(new RegExp(o,l),i)}case En:{const o=n(new Map,i);for(const[l,u]of a)o.set(r(l),r(u));return o}case jn:{const o=n(new Set,i);for(const l of a)o.add(r(l));return o}case ki:{const{name:o,message:l}=a;return n(typeof Ci[o]=="function"?sr(o,l):new Error(l),i)}case vi:return n(BigInt(a),i);case"BigInt":return n(Object(BigInt(a)),i);case"ArrayBuffer":return n(new Uint8Array(a).buffer,a);case"DataView":{const{buffer:o}=new Uint8Array(a);return n(new DataView(o),a)}case"-0":return-0}return n(sr(s,a),i)};return r},or=e=>uu(new Map,e)(0),Pe="",{toString:cu}={},{keys:pu,is:du}=Object,at=e=>{const t=typeof e;if(t!=="object"||!e)return[zt,t];const n=cu.call(e).slice(8,-1);switch(n){case"Array":return[lt,Pe];case"Object":return[Ct,Pe];case"Date":return[Cn,Pe];case"RegExp":return[Sn,Pe];case"Map":return[En,Pe];case"Set":return[jn,Pe];case"DataView":return[lt,n]}return n.includes("Array")?[lt,n]:e instanceof Error?[ki,e.name||"Error"]:[Ct,n]},mt=([e,t])=>e===zt&&(t==="function"||t==="symbol"),fu=(e,t,n,r)=>{const i=(a,o)=>{const l=r.push(a)-1;return n.set(o,l),l},s=a=>{if(n.has(a))return n.get(a);let[o,l]=at(a);switch(o){case zt:{let p=a;switch(l){case"bigint":o=vi,p=a.toString();break;case"number":if(!a&&du(a,-0))return r.push(["-0"])-1;break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+l);p=null;break;case"undefined":return i([yi],a)}return i([o,p],a)}case lt:{if(l){let h=a;return l==="DataView"?h=new Uint8Array(a.buffer):l==="ArrayBuffer"&&(h=new Uint8Array(a)),i([l,[...h]],a)}const p=[],c=i([o,p],a);for(const h of a)p.push(s(h));return c}case Ct:{if(l)switch(l){case"BigInt":return i([l,a.toString()],a);case"Boolean":case"Number":case"String":return i([l,a.valueOf()],a)}if(t&&"toJSON"in a)return s(a.toJSON());const p=[],c=i([o,p],a);for(const h of pu(a))(e||!mt(at(a[h])))&&p.push([s(h),s(a[h])]);return c}case Cn:return i([o,isNaN(a.getTime())?Pe:a.toISOString()],a);case Sn:{const{source:p,flags:c}=a;return i([o,{source:p,flags:c}],a)}case En:{const p=[],c=i([o,p],a);for(const[h,f]of a)(e||!(mt(at(h))||mt(at(f))))&&p.push([s(h),s(f)]);return c}case jn:{const p=[],c=i([o,p],a);for(const h of a)(e||!mt(at(h)))&&p.push(s(h));return c}}const{message:u}=a;return i([o,{name:l,message:u}],a)};return s},lr=(e,{json:t,lossy:n}={})=>{const r=[];return fu(!(t||n),!!t,new Map,r)(e),r},St=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?or(lr(e,t)):structuredClone(e):(e,t)=>or(lr(e,t));function hu(e,t){const n=[{type:"text",value:"↩"}];return t>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),n}function gu(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function mu(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||hu,r=e.options.footnoteBackLabel||gu,i=e.options.footnoteLabel||"Footnotes",s=e.options.footnoteLabelTagName||"h2",a=e.options.footnoteLabelProperties||{className:["sr-only"]},o=[];let l=-1;for(;++l<e.footnoteOrder.length;){const u=e.footnoteById.get(e.footnoteOrder[l]);if(!u)continue;const p=e.all(u),c=String(u.identifier).toUpperCase(),h=Xe(c.toLowerCase());let f=0;const g=[],y=e.footnoteCounts.get(c);for(;y!==void 0&&++f<=y;){g.length>0&&g.push({type:"text",value:" "});let E=typeof n=="string"?n:n(l,f);typeof E=="string"&&(E={type:"text",value:E}),g.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+h+(f>1?"-"+f:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(l,f),className:["data-footnote-backref"]},children:Array.isArray(E)?E:[E]})}const C=p[p.length-1];if(C&&C.type==="element"&&C.tagName==="p"){const E=C.children[C.children.length-1];E&&E.type==="text"?E.value+=" ":C.children.push({type:"text",value:" "}),C.children.push(...g)}else p.push(...g);const w={type:"element",tagName:"li",properties:{id:t+"fn-"+h},children:e.wrap(p,!0)};e.patch(u,w),o.push(w)}if(o.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:s,properties:{...St(a),id:"footnote-label"},children:[{type:"text",value:i}]},{type:"text",value:`
9
9
  `},{type:"element",tagName:"ol",properties:{},children:e.wrap(o,!0)},{type:"text",value:`
10
- `}]}}const At=function(e){if(e==null)return yu;if(typeof e=="function")return Nt(e);if(typeof e=="object")return Array.isArray(e)?xu(e):bu(e);if(typeof e=="string")return wu(e);throw new Error("Expected function, string, or object as test")};function xu(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=At(e[n]);return Nt(r);function r(...i){let s=-1;for(;++s<t.length;)if(t[s].apply(this,i))return!0;return!1}}function bu(e){const t=e;return Nt(n);function n(r){const i=r;let s;for(s in e)if(i[s]!==t[s])return!1;return!0}}function wu(e){return Nt(t);function t(n){return n&&n.type===e}}function Nt(e){return t;function t(n,r,i){return!!(ku(n)&&e.call(this,n,typeof r=="number"?r:void 0,i||void 0))}}function yu(){return!0}function ku(e){return e!==null&&typeof e=="object"&&"type"in e}const Si=[],vu=!0,ln=!1,Cu="skip";function Ei(e,t,n,r){let i;typeof t=="function"&&typeof n!="function"?(r=n,n=t):i=t;const s=At(i),a=r?-1:1;o(e,void 0,[])();function o(l,u,p){const c=l&&typeof l=="object"?l:{};if(typeof c.type=="string"){const f=typeof c.tagName=="string"?c.tagName:typeof c.name=="string"?c.name:void 0;Object.defineProperty(h,"name",{value:"node ("+(l.type+(f?"<"+f+">":""))+")"})}return h;function h(){let f=Si,g,w,S;if((!t||s(l,u,p[p.length-1]||void 0))&&(f=Su(n(l,p)),f[0]===ln))return f;if("children"in l&&l.children){const b=l;if(b.children&&f[0]!==Cu)for(w=(r?b.children.length:-1)+a,S=p.concat(b);w>-1&&w<b.children.length;){const E=b.children[w];if(g=o(E,w,S)(),g[0]===ln)return g;w=typeof g[1]=="number"?g[1]:w+a}}return f}}}function Su(e){return Array.isArray(e)?e:typeof e=="number"?[vu,e]:e==null?Si:[e]}function In(e,t,n,r){let i,s,a;typeof t=="function"&&typeof n!="function"?(s=void 0,a=t,i=n):(s=t,a=n,i=r),Ei(e,s,o,i);function o(l,u){const p=u[u.length-1],c=p?p.children.indexOf(l):void 0;return a(l,c,p)}}const un={}.hasOwnProperty,Eu={};function ju(e,t){const n=t||Eu,r=new Map,i=new Map,s=new Map,a={...ou,...n.handlers},o={all:u,applyData:zu,definitionById:r,footnoteById:i,footnoteCounts:s,footnoteOrder:[],handlers:a,one:l,options:n,patch:Iu,wrap:Au};return In(e,function(p){if(p.type==="definition"||p.type==="footnoteDefinition"){const c=p.type==="definition"?r:i,h=String(p.identifier).toUpperCase();c.has(h)||c.set(h,p)}}),o;function l(p,c){const h=p.type,f=o.handlers[h];if(un.call(o.handlers,h)&&f)return f(o,p,c);if(o.options.passThrough&&o.options.passThrough.includes(h)){if("children"in p){const{children:w,...S}=p,b=St(S);return b.children=o.all(p),b}return St(p)}return(o.options.unknownHandler||Tu)(o,p,c)}function u(p){const c=[];if("children"in p){const h=p.children;let f=-1;for(;++f<h.length;){const g=o.one(h[f],p);if(g){if(f&&h[f-1].type==="break"&&(!Array.isArray(g)&&g.type==="text"&&(g.value=ur(g.value)),!Array.isArray(g)&&g.type==="element")){const w=g.children[0];w&&w.type==="text"&&(w.value=ur(w.value))}Array.isArray(g)?c.push(...g):c.push(g)}}}return c}}function Iu(e,t){e.position&&(t.position=ds(e))}function zu(e,t){let n=t;if(e&&e.data){const r=e.data.hName,i=e.data.hChildren,s=e.data.hProperties;if(typeof r=="string")if(n.type==="element")n.tagName=r;else{const a="children"in n?n.children:[n];n={type:"element",tagName:r,properties:{},children:a}}n.type==="element"&&s&&Object.assign(n.properties,St(s)),"children"in n&&n.children&&i!==null&&i!==void 0&&(n.children=i)}return n}function Tu(e,t){const n=t.data||{},r="value"in t&&!(un.call(n,"hProperties")||un.call(n,"hChildren"))?{type:"text",value:t.value}:{type:"element",tagName:"div",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function Au(e,t){const n=[];let r=-1;for(t&&n.push({type:"text",value:`
10
+ `}]}}const At=function(e){if(e==null)return yu;if(typeof e=="function")return Nt(e);if(typeof e=="object")return Array.isArray(e)?xu(e):bu(e);if(typeof e=="string")return wu(e);throw new Error("Expected function, string, or object as test")};function xu(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=At(e[n]);return Nt(r);function r(...i){let s=-1;for(;++s<t.length;)if(t[s].apply(this,i))return!0;return!1}}function bu(e){const t=e;return Nt(n);function n(r){const i=r;let s;for(s in e)if(i[s]!==t[s])return!1;return!0}}function wu(e){return Nt(t);function t(n){return n&&n.type===e}}function Nt(e){return t;function t(n,r,i){return!!(ku(n)&&e.call(this,n,typeof r=="number"?r:void 0,i||void 0))}}function yu(){return!0}function ku(e){return e!==null&&typeof e=="object"&&"type"in e}const Si=[],vu=!0,ln=!1,Cu="skip";function Ei(e,t,n,r){let i;typeof t=="function"&&typeof n!="function"?(r=n,n=t):i=t;const s=At(i),a=r?-1:1;o(e,void 0,[])();function o(l,u,p){const c=l&&typeof l=="object"?l:{};if(typeof c.type=="string"){const f=typeof c.tagName=="string"?c.tagName:typeof c.name=="string"?c.name:void 0;Object.defineProperty(h,"name",{value:"node ("+(l.type+(f?"<"+f+">":""))+")"})}return h;function h(){let f=Si,g,y,C;if((!t||s(l,u,p[p.length-1]||void 0))&&(f=Su(n(l,p)),f[0]===ln))return f;if("children"in l&&l.children){const w=l;if(w.children&&f[0]!==Cu)for(y=(r?w.children.length:-1)+a,C=p.concat(w);y>-1&&y<w.children.length;){const E=w.children[y];if(g=o(E,y,C)(),g[0]===ln)return g;y=typeof g[1]=="number"?g[1]:y+a}}return f}}}function Su(e){return Array.isArray(e)?e:typeof e=="number"?[vu,e]:e==null?Si:[e]}function In(e,t,n,r){let i,s,a;typeof t=="function"&&typeof n!="function"?(s=void 0,a=t,i=n):(s=t,a=n,i=r),Ei(e,s,o,i);function o(l,u){const p=u[u.length-1],c=p?p.children.indexOf(l):void 0;return a(l,c,p)}}const un={}.hasOwnProperty,Eu={};function ju(e,t){const n=t||Eu,r=new Map,i=new Map,s=new Map,a={...ou,...n.handlers},o={all:u,applyData:Tu,definitionById:r,footnoteById:i,footnoteCounts:s,footnoteOrder:[],handlers:a,one:l,options:n,patch:Iu,wrap:Au};return In(e,function(p){if(p.type==="definition"||p.type==="footnoteDefinition"){const c=p.type==="definition"?r:i,h=String(p.identifier).toUpperCase();c.has(h)||c.set(h,p)}}),o;function l(p,c){const h=p.type,f=o.handlers[h];if(un.call(o.handlers,h)&&f)return f(o,p,c);if(o.options.passThrough&&o.options.passThrough.includes(h)){if("children"in p){const{children:y,...C}=p,w=St(C);return w.children=o.all(p),w}return St(p)}return(o.options.unknownHandler||zu)(o,p,c)}function u(p){const c=[];if("children"in p){const h=p.children;let f=-1;for(;++f<h.length;){const g=o.one(h[f],p);if(g){if(f&&h[f-1].type==="break"&&(!Array.isArray(g)&&g.type==="text"&&(g.value=ur(g.value)),!Array.isArray(g)&&g.type==="element")){const y=g.children[0];y&&y.type==="text"&&(y.value=ur(y.value))}Array.isArray(g)?c.push(...g):c.push(g)}}}return c}}function Iu(e,t){e.position&&(t.position=ds(e))}function Tu(e,t){let n=t;if(e&&e.data){const r=e.data.hName,i=e.data.hChildren,s=e.data.hProperties;if(typeof r=="string")if(n.type==="element")n.tagName=r;else{const a="children"in n?n.children:[n];n={type:"element",tagName:r,properties:{},children:a}}n.type==="element"&&s&&Object.assign(n.properties,St(s)),"children"in n&&n.children&&i!==null&&i!==void 0&&(n.children=i)}return n}function zu(e,t){const n=t.data||{},r="value"in t&&!(un.call(n,"hProperties")||un.call(n,"hChildren"))?{type:"text",value:t.value}:{type:"element",tagName:"div",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function Au(e,t){const n=[];let r=-1;for(t&&n.push({type:"text",value:`
11
11
  `});++r<e.length;)r&&n.push({type:"text",value:`
12
12
  `}),n.push(e[r]);return t&&e.length>0&&n.push({type:"text",value:`
13
13
  `}),n}function ur(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function cr(e,t){const n=ju(e,t),r=n.one(e,void 0),i=mu(n),s=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return i&&s.children.push({type:"text",value:`
14
- `},i),s}function Nu(e,t){return e&&"run"in e?async function(n,r){const i=cr(n,{file:r,...t});await e.run(i,r)}:function(n,r){return cr(n,{file:r,...e||t})}}function pr(e){if(e)throw e}var yt=Object.prototype.hasOwnProperty,ji=Object.prototype.toString,dr=Object.defineProperty,fr=Object.getOwnPropertyDescriptor,hr=function(t){return typeof Array.isArray=="function"?Array.isArray(t):ji.call(t)==="[object Array]"},gr=function(t){if(!t||ji.call(t)!=="[object Object]")return!1;var n=yt.call(t,"constructor"),r=t.constructor&&t.constructor.prototype&&yt.call(t.constructor.prototype,"isPrototypeOf");if(t.constructor&&!n&&!r)return!1;var i;for(i in t);return typeof i>"u"||yt.call(t,i)},mr=function(t,n){dr&&n.name==="__proto__"?dr(t,n.name,{enumerable:!0,configurable:!0,value:n.newValue,writable:!0}):t[n.name]=n.newValue},xr=function(t,n){if(n==="__proto__")if(yt.call(t,n)){if(fr)return fr(t,n).value}else return;return t[n]},Du=function e(){var t,n,r,i,s,a,o=arguments[0],l=1,u=arguments.length,p=!1;for(typeof o=="boolean"&&(p=o,o=arguments[1]||{},l=2),(o==null||typeof o!="object"&&typeof o!="function")&&(o={});l<u;++l)if(t=arguments[l],t!=null)for(n in t)r=xr(o,n),i=xr(t,n),o!==i&&(p&&i&&(gr(i)||(s=hr(i)))?(s?(s=!1,a=r&&hr(r)?r:[]):a=r&&gr(r)?r:{},mr(o,{name:n,newValue:e(p,a,i)})):typeof i<"u"&&mr(o,{name:n,newValue:i}));return o};const $t=Oe.getDefaultExportFromCjs(Du);function cn(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function Lu(){const e=[],t={run:n,use:r};return t;function n(...i){let s=-1;const a=i.pop();if(typeof a!="function")throw new TypeError("Expected function as last argument, not "+a);o(null,...i);function o(l,...u){const p=e[++s];let c=-1;if(l){a(l);return}for(;++c<i.length;)(u[c]===null||u[c]===void 0)&&(u[c]=i[c]);i=u,p?Mu(p,o)(...u):a(null,...u)}}function r(i){if(typeof i!="function")throw new TypeError("Expected `middelware` to be a function, not "+i);return e.push(i),t}}function Mu(e,t){let n;return r;function r(...a){const o=e.length>a.length;let l;o&&a.push(i);try{l=e.apply(this,a)}catch(u){const p=u;if(o&&n)throw p;return i(p)}o||(l&&l.then&&typeof l.then=="function"?l.then(s,i):l instanceof Error?i(l):s(l))}function i(a,...o){n||(n=!0,t(a,...o))}function s(a){i(null,a)}}const ye={basename:Ru,dirname:Pu,extname:Fu,join:_u,sep:"/"};function Ru(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');ft(e);let n=0,r=-1,i=e.length,s;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(s){n=i+1;break}}else r<0&&(s=!0,r=i+1);return r<0?"":e.slice(n,r)}if(t===e)return"";let a=-1,o=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(s){n=i+1;break}}else a<0&&(s=!0,a=i+1),o>-1&&(e.codePointAt(i)===t.codePointAt(o--)?o<0&&(r=i):(o=-1,r=a));return n===r?r=a:r<0&&(r=e.length),e.slice(n,r)}function Pu(e){if(ft(e),e.length===0)return".";let t=-1,n=e.length,r;for(;--n;)if(e.codePointAt(n)===47){if(r){t=n;break}}else r||(r=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function Fu(e){ft(e);let t=e.length,n=-1,r=0,i=-1,s=0,a;for(;t--;){const o=e.codePointAt(t);if(o===47){if(a){r=t+1;break}continue}n<0&&(a=!0,n=t+1),o===46?i<0?i=t:s!==1&&(s=1):i>-1&&(s=-1)}return i<0||n<0||s===0||s===1&&i===n-1&&i===r+1?"":e.slice(i,n)}function _u(...e){let t=-1,n;for(;++t<e.length;)ft(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":Ou(n)}function Ou(e){ft(e);const t=e.codePointAt(0)===47;let n=Bu(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function Bu(e,t){let n="",r=0,i=-1,s=0,a=-1,o,l;for(;++a<=e.length;){if(a<e.length)o=e.codePointAt(a);else{if(o===47)break;o=47}if(o===47){if(!(i===a-1||s===1))if(i!==a-1&&s===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(l=n.lastIndexOf("/"),l!==n.length-1){l<0?(n="",r=0):(n=n.slice(0,l),r=n.length-1-n.lastIndexOf("/")),i=a,s=0;continue}}else if(n.length>0){n="",r=0,i=a,s=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(i+1,a):n=e.slice(i+1,a),r=a-i-1;i=a,s=0}else o===46&&s>-1?s++:s=-1}return n}function ft(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const $u={cwd:Hu};function Hu(){return"/"}function pn(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function Uu(e){if(typeof e=="string")e=new URL(e);else if(!pn(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){const t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return Vu(e)}function Vu(e){if(e.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const t=e.pathname;let n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){const r=t.codePointAt(n+2);if(r===70||r===102){const i=new TypeError("File URL path must not include encoded / characters");throw i.code="ERR_INVALID_FILE_URL_PATH",i}}return decodeURIComponent(t)}const Ht=["history","path","basename","stem","extname","dirname"];class Ii{constructor(t){let n;t?pn(t)?n={path:t}:typeof t=="string"||qu(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":$u.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<Ht.length;){const s=Ht[r];s in n&&n[s]!==void 0&&n[s]!==null&&(this[s]=s==="history"?[...n[s]]:n[s])}let i;for(i in n)Ht.includes(i)||(this[i]=n[i])}get basename(){return typeof this.path=="string"?ye.basename(this.path):void 0}set basename(t){Vt(t,"basename"),Ut(t,"basename"),this.path=ye.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?ye.dirname(this.path):void 0}set dirname(t){br(this.basename,"dirname"),this.path=ye.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?ye.extname(this.path):void 0}set extname(t){if(Ut(t,"extname"),br(this.dirname,"extname"),t){if(t.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(t.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=ye.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){pn(t)&&(t=Uu(t)),Vt(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?ye.basename(this.path,this.extname):void 0}set stem(t){Vt(t,"stem"),Ut(t,"stem"),this.path=ye.join(this.dirname||"",t+(this.extname||""))}fail(t,n,r){const i=this.message(t,n,r);throw i.fatal=!0,i}info(t,n,r){const i=this.message(t,n,r);return i.fatal=void 0,i}message(t,n,r){const i=new oe(t,n,r);return this.path&&(i.name=this.path+":"+i.name,i.file=this.path),i.fatal=!1,this.messages.push(i),i}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}}function Ut(e,t){if(e&&e.includes(ye.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+ye.sep+"`")}function Vt(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function br(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function qu(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const Wu=function(e){const r=this.constructor.prototype,i=r[e],s=function(){return i.apply(s,arguments)};return Object.setPrototypeOf(s,r),s},Yu={}.hasOwnProperty;class zn extends Wu{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=Lu()}copy(){const t=new zn;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];t.use(...r)}return t.data($t(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(Yt("data",this.frozen),this.namespace[t]=n,this):Yu.call(this.namespace,t)&&this.namespace[t]||void 0:t?(Yt("data",this.frozen),this.namespace=t,this):this.namespace}freeze(){if(this.frozen)return this;const t=this;for(;++this.freezeIndex<this.attachers.length;){const[n,...r]=this.attachers[this.freezeIndex];if(r[0]===!1)continue;r[0]===!0&&(r[0]=void 0);const i=n.call(t,...r);typeof i=="function"&&this.transformers.use(i)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();const n=xt(t),r=this.parser||this.Parser;return qt("parse",r),r(String(n),n)}process(t,n){const r=this;return this.freeze(),qt("process",this.parser||this.Parser),Wt("process",this.compiler||this.Compiler),n?i(void 0,n):new Promise(i);function i(s,a){const o=xt(t),l=r.parse(o);r.run(l,o,function(p,c,h){if(p||!c||!h)return u(p);const f=c,g=r.stringify(f,h);Ku(g)?h.value=g:h.result=g,u(p,h)});function u(p,c){p||!c?a(p):s?s(c):n(void 0,c)}}}processSync(t){let n=!1,r;return this.freeze(),qt("processSync",this.parser||this.Parser),Wt("processSync",this.compiler||this.Compiler),this.process(t,i),yr("processSync","process",n),r;function i(s,a){n=!0,pr(s),r=a}}run(t,n,r){wr(t),this.freeze();const i=this.transformers;return!r&&typeof n=="function"&&(r=n,n=void 0),r?s(void 0,r):new Promise(s);function s(a,o){const l=xt(n);i.run(t,l,u);function u(p,c,h){const f=c||t;p?o(p):a?a(f):r(void 0,f,h)}}}runSync(t,n){let r=!1,i;return this.run(t,n,s),yr("runSync","run",r),i;function s(a,o){pr(a),i=o,r=!0}}stringify(t,n){this.freeze();const r=xt(n),i=this.compiler||this.Compiler;return Wt("stringify",i),wr(t),i(t,r)}use(t,...n){const r=this.attachers,i=this.namespace;if(Yt("use",this.frozen),t!=null)if(typeof t=="function")l(t,n);else if(typeof t=="object")Array.isArray(t)?o(t):a(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function s(u){if(typeof u=="function")l(u,[]);else if(typeof u=="object")if(Array.isArray(u)){const[p,...c]=u;l(p,c)}else a(u);else throw new TypeError("Expected usable value, not `"+u+"`")}function a(u){if(!("plugins"in u)&&!("settings"in u))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");o(u.plugins),u.settings&&(i.settings=$t(!0,i.settings,u.settings))}function o(u){let p=-1;if(u!=null)if(Array.isArray(u))for(;++p<u.length;){const c=u[p];s(c)}else throw new TypeError("Expected a list of plugins, not `"+u+"`")}function l(u,p){let c=-1,h=-1;for(;++c<r.length;)if(r[c][0]===u){h=c;break}if(h===-1)r.push([u,...p]);else if(p.length>0){let[f,...g]=p;const w=r[h][1];cn(w)&&cn(f)&&(f=$t(!0,w,f)),r[h]=[u,f,...g]}}}}const Gu=new zn().freeze();function qt(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function Wt(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function Yt(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function wr(e){if(!cn(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function yr(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function xt(e){return Xu(e)?e:new Ii(e)}function Xu(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function Ku(e){return typeof e=="string"||Qu(e)}function Qu(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const Ju="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",kr=[],vr={allowDangerousHtml:!0},Zu=/^(https?|ircs?|mailto|xmpp)$/i,ec=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"className",id:"remove-classname"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function tc(e){const t=nc(e),n=rc(e);return ic(t.runSync(t.parse(n),n),e)}function nc(e){const t=e.rehypePlugins||kr,n=e.remarkPlugins||kr,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...vr}:vr;return Gu().use(Rl).use(n).use(Nu,r).use(t)}function rc(e){const t=e.children||"",n=new Ii;return typeof t=="string"&&(n.value=t),n}function ic(e,t){const n=t.allowedElements,r=t.allowElement,i=t.components,s=t.disallowedElements,a=t.skipHtml,o=t.unwrapDisallowed,l=t.urlTransform||ac;for(const p of ec)Object.hasOwn(t,p.from)&&(""+p.from+(p.to?"use `"+p.to+"` instead":"remove it")+Ju+p.id,void 0);return In(e,u),xs(e,{Fragment:d.Fragment,components:i,ignoreInvalidStyle:!0,jsx:d.jsx,jsxs:d.jsxs,passKeys:!0,passNode:!0});function u(p,c,h){if(p.type==="raw"&&h&&typeof c=="number")return a?h.children.splice(c,1):h.children[c]={type:"text",value:p.value},c;if(p.type==="element"){let f;for(f in _t)if(Object.hasOwn(_t,f)&&Object.hasOwn(p.properties,f)){const g=p.properties[f],w=_t[f];(w===null||w.includes(p.tagName))&&(p.properties[f]=l(String(g||""),f,p))}}if(p.type==="element"){let f=n?!n.includes(p.tagName):s?s.includes(p.tagName):!1;if(!f&&r&&typeof c=="number"&&(f=!r(p,c,h)),f&&h&&typeof c=="number")return o&&p.children?h.children.splice(c,1,...p.children):h.children.splice(c,1),c}}}function ac(e){const t=e.indexOf(":"),n=e.indexOf("?"),r=e.indexOf("#"),i=e.indexOf("/");return t===-1||i!==-1&&t>i||n!==-1&&t>n||r!==-1&&t>r||Zu.test(e.slice(0,t))?e:""}function Cr(e,t){const n=String(e);if(typeof t!="string")throw new TypeError("Expected character");let r=0,i=n.indexOf(t);for(;i!==-1;)r++,i=n.indexOf(t,i+t.length);return r}function sc(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function oc(e,t,n){const i=At((n||{}).ignore||[]),s=lc(t);let a=-1;for(;++a<s.length;)Ei(e,"text",o);function o(u,p){let c=-1,h;for(;++c<p.length;){const f=p[c],g=h?h.children:void 0;if(i(f,g?g.indexOf(f):void 0,h))return;h=f}if(h)return l(u,p)}function l(u,p){const c=p[p.length-1],h=s[a][0],f=s[a][1];let g=0;const S=c.children.indexOf(u);let b=!1,E=[];h.lastIndex=0;let C=h.exec(u.value);for(;C;){const T=C.index,L={index:C.index,input:C.input,stack:[...p,u]};let v=f(...C,L);if(typeof v=="string"&&(v=v.length>0?{type:"text",value:v}:void 0),v===!1?h.lastIndex=T+1:(g!==T&&E.push({type:"text",value:u.value.slice(g,T)}),Array.isArray(v)?E.push(...v):v&&E.push(v),g=T+C[0].length,b=!0),!h.global)break;C=h.exec(u.value)}return b?(g<u.value.length&&E.push({type:"text",value:u.value.slice(g)}),c.children.splice(S,1,...E)):E=[u],S+E.length}}function lc(e){const t=[];if(!Array.isArray(e))throw new TypeError("Expected find and replace tuple or list of tuples");const n=!e[0]||Array.isArray(e[0])?e:[e];let r=-1;for(;++r<n.length;){const i=n[r];t.push([uc(i[0]),cc(i[1])])}return t}function uc(e){return typeof e=="string"?new RegExp(sc(e),"g"):e}function cc(e){return typeof e=="function"?e:function(){return e}}const Gt="phrasing",Xt=["autolink","link","image","label"];function pc(){return{transforms:[bc],enter:{literalAutolink:fc,literalAutolinkEmail:Kt,literalAutolinkHttp:Kt,literalAutolinkWww:Kt},exit:{literalAutolink:xc,literalAutolinkEmail:mc,literalAutolinkHttp:hc,literalAutolinkWww:gc}}}function dc(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:Gt,notInConstruct:Xt},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:Gt,notInConstruct:Xt},{character:":",before:"[ps]",after:"\\/",inConstruct:Gt,notInConstruct:Xt}]}}function fc(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function Kt(e){this.config.enter.autolinkProtocol.call(this,e)}function hc(e){this.config.exit.autolinkProtocol.call(this,e)}function gc(e){this.config.exit.data.call(this,e);const t=this.stack[this.stack.length-1];t.type,t.url="http://"+this.sliceSerialize(e)}function mc(e){this.config.exit.autolinkEmail.call(this,e)}function xc(e){this.exit(e)}function bc(e){oc(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,wc],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),yc]],{ignore:["link","linkReference"]})}function wc(e,t,n,r,i){let s="";if(!zi(i)||(/^w/i.test(t)&&(n=t+n,t="",s="http://"),!kc(n)))return!1;const a=vc(n+r);if(!a[0])return!1;const o={type:"link",title:null,url:s+t+a[0],children:[{type:"text",value:t+a[0]}]};return a[1]?[o,{type:"text",value:a[1]}]:o}function yc(e,t,n,r){return!zi(r,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function kc(e){const t=e.split(".");return!(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[a-zA-Z\d]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[a-zA-Z\d]/.test(t[t.length-2])))}function vc(e){const t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(")");const i=Cr(e,"(");let s=Cr(e,")");for(;r!==-1&&i>s;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(")"),s++;return[e,n]}function zi(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||Be(n)||It(n))&&(!t||n!==47)}Ti.peek=Nc;function Cc(){this.buffer()}function Sc(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function Ec(){this.buffer()}function jc(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function Ic(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=we(this.sliceSerialize(e)).toLowerCase(),n.label=t}function zc(e){this.exit(e)}function Tc(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=we(this.sliceSerialize(e)).toLowerCase(),n.label=t}function Ac(e){this.exit(e)}function Nc(){return"["}function Ti(e,t,n,r){const i=n.createTracker(r);let s=i.move("[^");const a=n.enter("footnoteReference"),o=n.enter("reference");return s+=i.move(n.safe(n.associationId(e),{after:"]",before:s})),o(),a(),s+=i.move("]"),s}function Dc(){return{enter:{gfmFootnoteCallString:Cc,gfmFootnoteCall:Sc,gfmFootnoteDefinitionLabelString:Ec,gfmFootnoteDefinition:jc},exit:{gfmFootnoteCallString:Ic,gfmFootnoteCall:zc,gfmFootnoteDefinitionLabelString:Tc,gfmFootnoteDefinition:Ac}}}function Lc(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:Ti},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(r,i,s,a){const o=s.createTracker(a);let l=o.move("[^");const u=s.enter("footnoteDefinition"),p=s.enter("label");return l+=o.move(s.safe(s.associationId(r),{before:l,after:"]"})),p(),l+=o.move("]:"),r.children&&r.children.length>0&&(o.shift(4),l+=o.move((t?`
15
- `:" ")+s.indentLines(s.containerFlow(r,o.current()),t?Ai:Mc))),u(),l}}function Mc(e,t,n){return t===0?e:Ai(e,t,n)}function Ai(e,t,n){return(n?"":" ")+e}const Rc=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];Ni.peek=Bc;function Pc(){return{canContainEols:["delete"],enter:{strikethrough:_c},exit:{strikethrough:Oc}}}function Fc(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:Rc}],handlers:{delete:Ni}}}function _c(e){this.enter({type:"delete",children:[]},e)}function Oc(e){this.exit(e)}function Ni(e,t,n,r){const i=n.createTracker(r),s=n.enter("strikethrough");let a=i.move("~~");return a+=n.containerPhrasing(e,{...i.current(),before:a,after:"~"}),a+=i.move("~~"),s(),a}function Bc(){return"~"}function $c(e){return e.length}function Hc(e,t){const n=t||{},r=(n.align||[]).concat(),i=n.stringLength||$c,s=[],a=[],o=[],l=[];let u=0,p=-1;for(;++p<e.length;){const w=[],S=[];let b=-1;for(e[p].length>u&&(u=e[p].length);++b<e[p].length;){const E=Uc(e[p][b]);if(n.alignDelimiters!==!1){const C=i(E);S[b]=C,(l[b]===void 0||C>l[b])&&(l[b]=C)}w.push(E)}a[p]=w,o[p]=S}let c=-1;if(typeof r=="object"&&"length"in r)for(;++c<u;)s[c]=Sr(r[c]);else{const w=Sr(r);for(;++c<u;)s[c]=w}c=-1;const h=[],f=[];for(;++c<u;){const w=s[c];let S="",b="";w===99?(S=":",b=":"):w===108?S=":":w===114&&(b=":");let E=n.alignDelimiters===!1?1:Math.max(1,l[c]-S.length-b.length);const C=S+"-".repeat(E)+b;n.alignDelimiters!==!1&&(E=S.length+E+b.length,E>l[c]&&(l[c]=E),f[c]=E),h[c]=C}a.splice(1,0,h),o.splice(1,0,f),p=-1;const g=[];for(;++p<a.length;){const w=a[p],S=o[p];c=-1;const b=[];for(;++c<u;){const E=w[c]||"";let C="",T="";if(n.alignDelimiters!==!1){const L=l[c]-(S[c]||0),v=s[c];v===114?C=" ".repeat(L):v===99?L%2?(C=" ".repeat(L/2+.5),T=" ".repeat(L/2-.5)):(C=" ".repeat(L/2),T=C):T=" ".repeat(L)}n.delimiterStart!==!1&&!c&&b.push("|"),n.padding!==!1&&!(n.alignDelimiters===!1&&E==="")&&(n.delimiterStart!==!1||c)&&b.push(" "),n.alignDelimiters!==!1&&b.push(C),b.push(E),n.alignDelimiters!==!1&&b.push(T),n.padding!==!1&&b.push(" "),(n.delimiterEnd!==!1||c!==u-1)&&b.push("|")}g.push(n.delimiterEnd===!1?b.join("").replace(/ +$/,""):b.join(""))}return g.join(`
14
+ `},i),s}function Nu(e,t){return e&&"run"in e?async function(n,r){const i=cr(n,{file:r,...t});await e.run(i,r)}:function(n,r){return cr(n,{file:r,...e||t})}}function pr(e){if(e)throw e}var yt=Object.prototype.hasOwnProperty,ji=Object.prototype.toString,dr=Object.defineProperty,fr=Object.getOwnPropertyDescriptor,hr=function(t){return typeof Array.isArray=="function"?Array.isArray(t):ji.call(t)==="[object Array]"},gr=function(t){if(!t||ji.call(t)!=="[object Object]")return!1;var n=yt.call(t,"constructor"),r=t.constructor&&t.constructor.prototype&&yt.call(t.constructor.prototype,"isPrototypeOf");if(t.constructor&&!n&&!r)return!1;var i;for(i in t);return typeof i>"u"||yt.call(t,i)},mr=function(t,n){dr&&n.name==="__proto__"?dr(t,n.name,{enumerable:!0,configurable:!0,value:n.newValue,writable:!0}):t[n.name]=n.newValue},xr=function(t,n){if(n==="__proto__")if(yt.call(t,n)){if(fr)return fr(t,n).value}else return;return t[n]},Du=function e(){var t,n,r,i,s,a,o=arguments[0],l=1,u=arguments.length,p=!1;for(typeof o=="boolean"&&(p=o,o=arguments[1]||{},l=2),(o==null||typeof o!="object"&&typeof o!="function")&&(o={});l<u;++l)if(t=arguments[l],t!=null)for(n in t)r=xr(o,n),i=xr(t,n),o!==i&&(p&&i&&(gr(i)||(s=hr(i)))?(s?(s=!1,a=r&&hr(r)?r:[]):a=r&&gr(r)?r:{},mr(o,{name:n,newValue:e(p,a,i)})):typeof i<"u"&&mr(o,{name:n,newValue:i}));return o};const $t=Oe.getDefaultExportFromCjs(Du);function cn(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function Lu(){const e=[],t={run:n,use:r};return t;function n(...i){let s=-1;const a=i.pop();if(typeof a!="function")throw new TypeError("Expected function as last argument, not "+a);o(null,...i);function o(l,...u){const p=e[++s];let c=-1;if(l){a(l);return}for(;++c<i.length;)(u[c]===null||u[c]===void 0)&&(u[c]=i[c]);i=u,p?Mu(p,o)(...u):a(null,...u)}}function r(i){if(typeof i!="function")throw new TypeError("Expected `middelware` to be a function, not "+i);return e.push(i),t}}function Mu(e,t){let n;return r;function r(...a){const o=e.length>a.length;let l;o&&a.push(i);try{l=e.apply(this,a)}catch(u){const p=u;if(o&&n)throw p;return i(p)}o||(l&&l.then&&typeof l.then=="function"?l.then(s,i):l instanceof Error?i(l):s(l))}function i(a,...o){n||(n=!0,t(a,...o))}function s(a){i(null,a)}}const Ee={basename:Ru,dirname:Pu,extname:Fu,join:_u,sep:"/"};function Ru(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');ft(e);let n=0,r=-1,i=e.length,s;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(s){n=i+1;break}}else r<0&&(s=!0,r=i+1);return r<0?"":e.slice(n,r)}if(t===e)return"";let a=-1,o=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(s){n=i+1;break}}else a<0&&(s=!0,a=i+1),o>-1&&(e.codePointAt(i)===t.codePointAt(o--)?o<0&&(r=i):(o=-1,r=a));return n===r?r=a:r<0&&(r=e.length),e.slice(n,r)}function Pu(e){if(ft(e),e.length===0)return".";let t=-1,n=e.length,r;for(;--n;)if(e.codePointAt(n)===47){if(r){t=n;break}}else r||(r=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function Fu(e){ft(e);let t=e.length,n=-1,r=0,i=-1,s=0,a;for(;t--;){const o=e.codePointAt(t);if(o===47){if(a){r=t+1;break}continue}n<0&&(a=!0,n=t+1),o===46?i<0?i=t:s!==1&&(s=1):i>-1&&(s=-1)}return i<0||n<0||s===0||s===1&&i===n-1&&i===r+1?"":e.slice(i,n)}function _u(...e){let t=-1,n;for(;++t<e.length;)ft(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":Ou(n)}function Ou(e){ft(e);const t=e.codePointAt(0)===47;let n=Bu(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function Bu(e,t){let n="",r=0,i=-1,s=0,a=-1,o,l;for(;++a<=e.length;){if(a<e.length)o=e.codePointAt(a);else{if(o===47)break;o=47}if(o===47){if(!(i===a-1||s===1))if(i!==a-1&&s===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(l=n.lastIndexOf("/"),l!==n.length-1){l<0?(n="",r=0):(n=n.slice(0,l),r=n.length-1-n.lastIndexOf("/")),i=a,s=0;continue}}else if(n.length>0){n="",r=0,i=a,s=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(i+1,a):n=e.slice(i+1,a),r=a-i-1;i=a,s=0}else o===46&&s>-1?s++:s=-1}return n}function ft(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const $u={cwd:Hu};function Hu(){return"/"}function pn(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function Uu(e){if(typeof e=="string")e=new URL(e);else if(!pn(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){const t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return Vu(e)}function Vu(e){if(e.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const t=e.pathname;let n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){const r=t.codePointAt(n+2);if(r===70||r===102){const i=new TypeError("File URL path must not include encoded / characters");throw i.code="ERR_INVALID_FILE_URL_PATH",i}}return decodeURIComponent(t)}const Ht=["history","path","basename","stem","extname","dirname"];class Ii{constructor(t){let n;t?pn(t)?n={path:t}:typeof t=="string"||qu(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":$u.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<Ht.length;){const s=Ht[r];s in n&&n[s]!==void 0&&n[s]!==null&&(this[s]=s==="history"?[...n[s]]:n[s])}let i;for(i in n)Ht.includes(i)||(this[i]=n[i])}get basename(){return typeof this.path=="string"?Ee.basename(this.path):void 0}set basename(t){Vt(t,"basename"),Ut(t,"basename"),this.path=Ee.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?Ee.dirname(this.path):void 0}set dirname(t){br(this.basename,"dirname"),this.path=Ee.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?Ee.extname(this.path):void 0}set extname(t){if(Ut(t,"extname"),br(this.dirname,"extname"),t){if(t.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(t.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=Ee.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){pn(t)&&(t=Uu(t)),Vt(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?Ee.basename(this.path,this.extname):void 0}set stem(t){Vt(t,"stem"),Ut(t,"stem"),this.path=Ee.join(this.dirname||"",t+(this.extname||""))}fail(t,n,r){const i=this.message(t,n,r);throw i.fatal=!0,i}info(t,n,r){const i=this.message(t,n,r);return i.fatal=void 0,i}message(t,n,r){const i=new de(t,n,r);return this.path&&(i.name=this.path+":"+i.name,i.file=this.path),i.fatal=!1,this.messages.push(i),i}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}}function Ut(e,t){if(e&&e.includes(Ee.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+Ee.sep+"`")}function Vt(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function br(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function qu(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const Wu=function(e){const r=this.constructor.prototype,i=r[e],s=function(){return i.apply(s,arguments)};return Object.setPrototypeOf(s,r),s},Yu={}.hasOwnProperty;class Tn extends Wu{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=Lu()}copy(){const t=new Tn;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];t.use(...r)}return t.data($t(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(Yt("data",this.frozen),this.namespace[t]=n,this):Yu.call(this.namespace,t)&&this.namespace[t]||void 0:t?(Yt("data",this.frozen),this.namespace=t,this):this.namespace}freeze(){if(this.frozen)return this;const t=this;for(;++this.freezeIndex<this.attachers.length;){const[n,...r]=this.attachers[this.freezeIndex];if(r[0]===!1)continue;r[0]===!0&&(r[0]=void 0);const i=n.call(t,...r);typeof i=="function"&&this.transformers.use(i)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();const n=xt(t),r=this.parser||this.Parser;return qt("parse",r),r(String(n),n)}process(t,n){const r=this;return this.freeze(),qt("process",this.parser||this.Parser),Wt("process",this.compiler||this.Compiler),n?i(void 0,n):new Promise(i);function i(s,a){const o=xt(t),l=r.parse(o);r.run(l,o,function(p,c,h){if(p||!c||!h)return u(p);const f=c,g=r.stringify(f,h);Ku(g)?h.value=g:h.result=g,u(p,h)});function u(p,c){p||!c?a(p):s?s(c):n(void 0,c)}}}processSync(t){let n=!1,r;return this.freeze(),qt("processSync",this.parser||this.Parser),Wt("processSync",this.compiler||this.Compiler),this.process(t,i),yr("processSync","process",n),r;function i(s,a){n=!0,pr(s),r=a}}run(t,n,r){wr(t),this.freeze();const i=this.transformers;return!r&&typeof n=="function"&&(r=n,n=void 0),r?s(void 0,r):new Promise(s);function s(a,o){const l=xt(n);i.run(t,l,u);function u(p,c,h){const f=c||t;p?o(p):a?a(f):r(void 0,f,h)}}}runSync(t,n){let r=!1,i;return this.run(t,n,s),yr("runSync","run",r),i;function s(a,o){pr(a),i=o,r=!0}}stringify(t,n){this.freeze();const r=xt(n),i=this.compiler||this.Compiler;return Wt("stringify",i),wr(t),i(t,r)}use(t,...n){const r=this.attachers,i=this.namespace;if(Yt("use",this.frozen),t!=null)if(typeof t=="function")l(t,n);else if(typeof t=="object")Array.isArray(t)?o(t):a(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function s(u){if(typeof u=="function")l(u,[]);else if(typeof u=="object")if(Array.isArray(u)){const[p,...c]=u;l(p,c)}else a(u);else throw new TypeError("Expected usable value, not `"+u+"`")}function a(u){if(!("plugins"in u)&&!("settings"in u))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");o(u.plugins),u.settings&&(i.settings=$t(!0,i.settings,u.settings))}function o(u){let p=-1;if(u!=null)if(Array.isArray(u))for(;++p<u.length;){const c=u[p];s(c)}else throw new TypeError("Expected a list of plugins, not `"+u+"`")}function l(u,p){let c=-1,h=-1;for(;++c<r.length;)if(r[c][0]===u){h=c;break}if(h===-1)r.push([u,...p]);else if(p.length>0){let[f,...g]=p;const y=r[h][1];cn(y)&&cn(f)&&(f=$t(!0,y,f)),r[h]=[u,f,...g]}}}}const Gu=new Tn().freeze();function qt(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function Wt(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function Yt(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function wr(e){if(!cn(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function yr(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function xt(e){return Xu(e)?e:new Ii(e)}function Xu(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function Ku(e){return typeof e=="string"||Qu(e)}function Qu(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const Ju="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",kr=[],vr={allowDangerousHtml:!0},Zu=/^(https?|ircs?|mailto|xmpp)$/i,ec=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"className",id:"remove-classname"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function tc(e){const t=nc(e),n=rc(e);return ic(t.runSync(t.parse(n),n),e)}function nc(e){const t=e.rehypePlugins||kr,n=e.remarkPlugins||kr,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...vr}:vr;return Gu().use(Rl).use(n).use(Nu,r).use(t)}function rc(e){const t=e.children||"",n=new Ii;return typeof t=="string"&&(n.value=t),n}function ic(e,t){const n=t.allowedElements,r=t.allowElement,i=t.components,s=t.disallowedElements,a=t.skipHtml,o=t.unwrapDisallowed,l=t.urlTransform||ac;for(const p of ec)Object.hasOwn(t,p.from)&&(""+p.from+(p.to?"use `"+p.to+"` instead":"remove it")+Ju+p.id,void 0);return In(e,u),xs(e,{Fragment:d.Fragment,components:i,ignoreInvalidStyle:!0,jsx:d.jsx,jsxs:d.jsxs,passKeys:!0,passNode:!0});function u(p,c,h){if(p.type==="raw"&&h&&typeof c=="number")return a?h.children.splice(c,1):h.children[c]={type:"text",value:p.value},c;if(p.type==="element"){let f;for(f in _t)if(Object.hasOwn(_t,f)&&Object.hasOwn(p.properties,f)){const g=p.properties[f],y=_t[f];(y===null||y.includes(p.tagName))&&(p.properties[f]=l(String(g||""),f,p))}}if(p.type==="element"){let f=n?!n.includes(p.tagName):s?s.includes(p.tagName):!1;if(!f&&r&&typeof c=="number"&&(f=!r(p,c,h)),f&&h&&typeof c=="number")return o&&p.children?h.children.splice(c,1,...p.children):h.children.splice(c,1),c}}}function ac(e){const t=e.indexOf(":"),n=e.indexOf("?"),r=e.indexOf("#"),i=e.indexOf("/");return t===-1||i!==-1&&t>i||n!==-1&&t>n||r!==-1&&t>r||Zu.test(e.slice(0,t))?e:""}function Cr(e,t){const n=String(e);if(typeof t!="string")throw new TypeError("Expected character");let r=0,i=n.indexOf(t);for(;i!==-1;)r++,i=n.indexOf(t,i+t.length);return r}function sc(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function oc(e,t,n){const i=At((n||{}).ignore||[]),s=lc(t);let a=-1;for(;++a<s.length;)Ei(e,"text",o);function o(u,p){let c=-1,h;for(;++c<p.length;){const f=p[c],g=h?h.children:void 0;if(i(f,g?g.indexOf(f):void 0,h))return;h=f}if(h)return l(u,p)}function l(u,p){const c=p[p.length-1],h=s[a][0],f=s[a][1];let g=0;const C=c.children.indexOf(u);let w=!1,E=[];h.lastIndex=0;let S=h.exec(u.value);for(;S;){const z=S.index,A={index:S.index,input:S.input,stack:[...p,u]};let v=f(...S,A);if(typeof v=="string"&&(v=v.length>0?{type:"text",value:v}:void 0),v===!1?h.lastIndex=z+1:(g!==z&&E.push({type:"text",value:u.value.slice(g,z)}),Array.isArray(v)?E.push(...v):v&&E.push(v),g=z+S[0].length,w=!0),!h.global)break;S=h.exec(u.value)}return w?(g<u.value.length&&E.push({type:"text",value:u.value.slice(g)}),c.children.splice(C,1,...E)):E=[u],C+E.length}}function lc(e){const t=[];if(!Array.isArray(e))throw new TypeError("Expected find and replace tuple or list of tuples");const n=!e[0]||Array.isArray(e[0])?e:[e];let r=-1;for(;++r<n.length;){const i=n[r];t.push([uc(i[0]),cc(i[1])])}return t}function uc(e){return typeof e=="string"?new RegExp(sc(e),"g"):e}function cc(e){return typeof e=="function"?e:function(){return e}}const Gt="phrasing",Xt=["autolink","link","image","label"];function pc(){return{transforms:[bc],enter:{literalAutolink:fc,literalAutolinkEmail:Kt,literalAutolinkHttp:Kt,literalAutolinkWww:Kt},exit:{literalAutolink:xc,literalAutolinkEmail:mc,literalAutolinkHttp:hc,literalAutolinkWww:gc}}}function dc(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:Gt,notInConstruct:Xt},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:Gt,notInConstruct:Xt},{character:":",before:"[ps]",after:"\\/",inConstruct:Gt,notInConstruct:Xt}]}}function fc(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function Kt(e){this.config.enter.autolinkProtocol.call(this,e)}function hc(e){this.config.exit.autolinkProtocol.call(this,e)}function gc(e){this.config.exit.data.call(this,e);const t=this.stack[this.stack.length-1];t.type,t.url="http://"+this.sliceSerialize(e)}function mc(e){this.config.exit.autolinkEmail.call(this,e)}function xc(e){this.exit(e)}function bc(e){oc(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,wc],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),yc]],{ignore:["link","linkReference"]})}function wc(e,t,n,r,i){let s="";if(!Ti(i)||(/^w/i.test(t)&&(n=t+n,t="",s="http://"),!kc(n)))return!1;const a=vc(n+r);if(!a[0])return!1;const o={type:"link",title:null,url:s+t+a[0],children:[{type:"text",value:t+a[0]}]};return a[1]?[o,{type:"text",value:a[1]}]:o}function yc(e,t,n,r){return!Ti(r,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function kc(e){const t=e.split(".");return!(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[a-zA-Z\d]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[a-zA-Z\d]/.test(t[t.length-2])))}function vc(e){const t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(")");const i=Cr(e,"(");let s=Cr(e,")");for(;r!==-1&&i>s;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(")"),s++;return[e,n]}function Ti(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||Be(n)||It(n))&&(!t||n!==47)}zi.peek=Nc;function Cc(){this.buffer()}function Sc(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function Ec(){this.buffer()}function jc(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function Ic(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Ce(this.sliceSerialize(e)).toLowerCase(),n.label=t}function Tc(e){this.exit(e)}function zc(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Ce(this.sliceSerialize(e)).toLowerCase(),n.label=t}function Ac(e){this.exit(e)}function Nc(){return"["}function zi(e,t,n,r){const i=n.createTracker(r);let s=i.move("[^");const a=n.enter("footnoteReference"),o=n.enter("reference");return s+=i.move(n.safe(n.associationId(e),{after:"]",before:s})),o(),a(),s+=i.move("]"),s}function Dc(){return{enter:{gfmFootnoteCallString:Cc,gfmFootnoteCall:Sc,gfmFootnoteDefinitionLabelString:Ec,gfmFootnoteDefinition:jc},exit:{gfmFootnoteCallString:Ic,gfmFootnoteCall:Tc,gfmFootnoteDefinitionLabelString:zc,gfmFootnoteDefinition:Ac}}}function Lc(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:zi},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(r,i,s,a){const o=s.createTracker(a);let l=o.move("[^");const u=s.enter("footnoteDefinition"),p=s.enter("label");return l+=o.move(s.safe(s.associationId(r),{before:l,after:"]"})),p(),l+=o.move("]:"),r.children&&r.children.length>0&&(o.shift(4),l+=o.move((t?`
15
+ `:" ")+s.indentLines(s.containerFlow(r,o.current()),t?Ai:Mc))),u(),l}}function Mc(e,t,n){return t===0?e:Ai(e,t,n)}function Ai(e,t,n){return(n?"":" ")+e}const Rc=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];Ni.peek=Bc;function Pc(){return{canContainEols:["delete"],enter:{strikethrough:_c},exit:{strikethrough:Oc}}}function Fc(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:Rc}],handlers:{delete:Ni}}}function _c(e){this.enter({type:"delete",children:[]},e)}function Oc(e){this.exit(e)}function Ni(e,t,n,r){const i=n.createTracker(r),s=n.enter("strikethrough");let a=i.move("~~");return a+=n.containerPhrasing(e,{...i.current(),before:a,after:"~"}),a+=i.move("~~"),s(),a}function Bc(){return"~"}function $c(e){return e.length}function Hc(e,t){const n=t||{},r=(n.align||[]).concat(),i=n.stringLength||$c,s=[],a=[],o=[],l=[];let u=0,p=-1;for(;++p<e.length;){const y=[],C=[];let w=-1;for(e[p].length>u&&(u=e[p].length);++w<e[p].length;){const E=Uc(e[p][w]);if(n.alignDelimiters!==!1){const S=i(E);C[w]=S,(l[w]===void 0||S>l[w])&&(l[w]=S)}y.push(E)}a[p]=y,o[p]=C}let c=-1;if(typeof r=="object"&&"length"in r)for(;++c<u;)s[c]=Sr(r[c]);else{const y=Sr(r);for(;++c<u;)s[c]=y}c=-1;const h=[],f=[];for(;++c<u;){const y=s[c];let C="",w="";y===99?(C=":",w=":"):y===108?C=":":y===114&&(w=":");let E=n.alignDelimiters===!1?1:Math.max(1,l[c]-C.length-w.length);const S=C+"-".repeat(E)+w;n.alignDelimiters!==!1&&(E=C.length+E+w.length,E>l[c]&&(l[c]=E),f[c]=E),h[c]=S}a.splice(1,0,h),o.splice(1,0,f),p=-1;const g=[];for(;++p<a.length;){const y=a[p],C=o[p];c=-1;const w=[];for(;++c<u;){const E=y[c]||"";let S="",z="";if(n.alignDelimiters!==!1){const A=l[c]-(C[c]||0),v=s[c];v===114?S=" ".repeat(A):v===99?A%2?(S=" ".repeat(A/2+.5),z=" ".repeat(A/2-.5)):(S=" ".repeat(A/2),z=S):z=" ".repeat(A)}n.delimiterStart!==!1&&!c&&w.push("|"),n.padding!==!1&&!(n.alignDelimiters===!1&&E==="")&&(n.delimiterStart!==!1||c)&&w.push(" "),n.alignDelimiters!==!1&&w.push(S),w.push(E),n.alignDelimiters!==!1&&w.push(z),n.padding!==!1&&w.push(" "),(n.delimiterEnd!==!1||c!==u-1)&&w.push("|")}g.push(n.delimiterEnd===!1?w.join("").replace(/ +$/,""):w.join(""))}return g.join(`
16
16
  `)}function Uc(e){return e==null?"":String(e)}function Sr(e){const t=typeof e=="string"?e.codePointAt(0):0;return t===67||t===99?99:t===76||t===108?108:t===82||t===114?114:0}function Vc(e,t,n,r){const i=n.enter("blockquote"),s=n.createTracker(r);s.move("> "),s.shift(2);const a=n.indentLines(n.containerFlow(e,s.current()),qc);return i(),a}function qc(e,t,n){return">"+(n?"":" ")+e}function Wc(e,t){return Er(e,t.inConstruct,!0)&&!Er(e,t.notInConstruct,!1)}function Er(e,t,n){if(typeof t=="string"&&(t=[t]),!t||t.length===0)return n;let r=-1;for(;++r<t.length;)if(e.includes(t[r]))return!0;return!1}function jr(e,t,n,r){let i=-1;for(;++i<n.unsafe.length;)if(n.unsafe[i].character===`
17
17
  `&&Wc(n.stack,n.unsafe[i]))return/[ \t]/.test(r.before)?"":" ";return`\\
18
18
  `}function Yc(e,t){const n=String(e);let r=n.indexOf(t),i=r,s=0,a=0;if(typeof t!="string")throw new TypeError("Expected substring");for(;r!==-1;)r===i?++s>a&&(a=s):s=1,i=r+t.length,r=n.indexOf(t,i);return a}function Gc(e,t){return!!(t.options.fences===!1&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}function Xc(e){const t=e.options.fence||"`";if(t!=="`"&&t!=="~")throw new Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}function Kc(e,t,n,r){const i=Xc(n),s=e.value||"",a=i==="`"?"GraveAccent":"Tilde";if(Gc(e,n)){const c=n.enter("codeIndented"),h=n.indentLines(s,Qc);return c(),h}const o=n.createTracker(r),l=i.repeat(Math.max(Yc(s,i)+1,3)),u=n.enter("codeFenced");let p=o.move(l);if(e.lang){const c=n.enter(`codeFencedLang${a}`);p+=o.move(n.safe(e.lang,{before:p,after:" ",encode:["`"],...o.current()})),c()}if(e.lang&&e.meta){const c=n.enter(`codeFencedMeta${a}`);p+=o.move(" "),p+=o.move(n.safe(e.meta,{before:p,after:`
19
19
  `,encode:["`"],...o.current()})),c()}return p+=o.move(`
20
20
  `),s&&(p+=o.move(s+`
21
- `)),p+=o.move(l),u(),p}function Qc(e,t,n){return(n?"":" ")+e}function Tn(e){const t=e.options.quote||'"';if(t!=='"'&&t!=="'")throw new Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function Jc(e,t,n,r){const i=Tn(n),s=i==='"'?"Quote":"Apostrophe",a=n.enter("definition");let o=n.enter("label");const l=n.createTracker(r);let u=l.move("[");return u+=l.move(n.safe(n.associationId(e),{before:u,after:"]",...l.current()})),u+=l.move("]: "),o(),!e.url||/[\0- \u007F]/.test(e.url)?(o=n.enter("destinationLiteral"),u+=l.move("<"),u+=l.move(n.safe(e.url,{before:u,after:">",...l.current()})),u+=l.move(">")):(o=n.enter("destinationRaw"),u+=l.move(n.safe(e.url,{before:u,after:e.title?" ":`
21
+ `)),p+=o.move(l),u(),p}function Qc(e,t,n){return(n?"":" ")+e}function zn(e){const t=e.options.quote||'"';if(t!=='"'&&t!=="'")throw new Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function Jc(e,t,n,r){const i=zn(n),s=i==='"'?"Quote":"Apostrophe",a=n.enter("definition");let o=n.enter("label");const l=n.createTracker(r);let u=l.move("[");return u+=l.move(n.safe(n.associationId(e),{before:u,after:"]",...l.current()})),u+=l.move("]: "),o(),!e.url||/[\0- \u007F]/.test(e.url)?(o=n.enter("destinationLiteral"),u+=l.move("<"),u+=l.move(n.safe(e.url,{before:u,after:">",...l.current()})),u+=l.move(">")):(o=n.enter("destinationRaw"),u+=l.move(n.safe(e.url,{before:u,after:e.title?" ":`
22
22
  `,...l.current()}))),o(),e.title&&(o=n.enter(`title${s}`),u+=l.move(" "+i),u+=l.move(n.safe(e.title,{before:u,after:i,...l.current()})),u+=l.move(i),o()),a(),u}function Zc(e){const t=e.options.emphasis||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}function ct(e){return"&#x"+e.toString(16).toUpperCase()+";"}function Et(e,t,n){const r=Ye(e),i=Ye(t);return r===void 0?i===void 0?n==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:r===1?i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}Di.peek=ep;function Di(e,t,n,r){const i=Zc(n),s=n.enter("emphasis"),a=n.createTracker(r),o=a.move(i);let l=a.move(n.containerPhrasing(e,{after:i,before:o,...a.current()}));const u=l.charCodeAt(0),p=Et(r.before.charCodeAt(r.before.length-1),u,i);p.inside&&(l=ct(u)+l.slice(1));const c=l.charCodeAt(l.length-1),h=Et(r.after.charCodeAt(0),c,i);h.inside&&(l=l.slice(0,-1)+ct(c));const f=a.move(i);return s(),n.attentionEncodeSurroundingInfo={after:h.outside,before:p.outside},o+l+f}function ep(e,t,n){return n.options.emphasis||"*"}function tp(e,t){let n=!1;return In(e,function(r){if("value"in r&&/\r?\n|\r/.test(r.value)||r.type==="break")return n=!0,ln}),!!((!e.depth||e.depth<3)&&yn(e)&&(t.options.setext||n))}function np(e,t,n,r){const i=Math.max(Math.min(6,e.depth||1),1),s=n.createTracker(r);if(tp(e,n)){const p=n.enter("headingSetext"),c=n.enter("phrasing"),h=n.containerPhrasing(e,{...s.current(),before:`
23
23
  `,after:`
24
24
  `});return c(),p(),h+`
25
25
  `+(i===1?"=":"-").repeat(h.length-(Math.max(h.lastIndexOf("\r"),h.lastIndexOf(`
26
26
  `))+1))}const a="#".repeat(i),o=n.enter("headingAtx"),l=n.enter("phrasing");s.move(a+" ");let u=n.containerPhrasing(e,{before:"# ",after:`
27
- `,...s.current()});return/^[\t ]/.test(u)&&(u=ct(u.charCodeAt(0))+u.slice(1)),u=u?a+" "+u:a,n.options.closeAtx&&(u+=" "+a),l(),o(),u}Li.peek=rp;function Li(e){return e.value||""}function rp(){return"<"}Mi.peek=ip;function Mi(e,t,n,r){const i=Tn(n),s=i==='"'?"Quote":"Apostrophe",a=n.enter("image");let o=n.enter("label");const l=n.createTracker(r);let u=l.move("![");return u+=l.move(n.safe(e.alt,{before:u,after:"]",...l.current()})),u+=l.move("]("),o(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(o=n.enter("destinationLiteral"),u+=l.move("<"),u+=l.move(n.safe(e.url,{before:u,after:">",...l.current()})),u+=l.move(">")):(o=n.enter("destinationRaw"),u+=l.move(n.safe(e.url,{before:u,after:e.title?" ":")",...l.current()}))),o(),e.title&&(o=n.enter(`title${s}`),u+=l.move(" "+i),u+=l.move(n.safe(e.title,{before:u,after:i,...l.current()})),u+=l.move(i),o()),u+=l.move(")"),a(),u}function ip(){return"!"}Ri.peek=ap;function Ri(e,t,n,r){const i=e.referenceType,s=n.enter("imageReference");let a=n.enter("label");const o=n.createTracker(r);let l=o.move("![");const u=n.safe(e.alt,{before:l,after:"]",...o.current()});l+=o.move(u+"]["),a();const p=n.stack;n.stack=[],a=n.enter("reference");const c=n.safe(n.associationId(e),{before:l,after:"]",...o.current()});return a(),n.stack=p,s(),i==="full"||!u||u!==c?l+=o.move(c+"]"):i==="shortcut"?l=l.slice(0,-1):l+=o.move("]"),l}function ap(){return"!"}Pi.peek=sp;function Pi(e,t,n){let r=e.value||"",i="`",s=-1;for(;new RegExp("(^|[^`])"+i+"([^`]|$)").test(r);)i+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=" "+r+" ");++s<n.unsafe.length;){const a=n.unsafe[s],o=n.compilePattern(a);let l;if(a.atBreak)for(;l=o.exec(r);){let u=l.index;r.charCodeAt(u)===10&&r.charCodeAt(u-1)===13&&u--,r=r.slice(0,u)+" "+r.slice(l.index+1)}}return i+r+i}function sp(){return"`"}function Fi(e,t){const n=yn(e);return!!(!t.options.resourceLink&&e.url&&!e.title&&e.children&&e.children.length===1&&e.children[0].type==="text"&&(n===e.url||"mailto:"+n===e.url)&&/^[a-z][a-z+.-]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}_i.peek=op;function _i(e,t,n,r){const i=Tn(n),s=i==='"'?"Quote":"Apostrophe",a=n.createTracker(r);let o,l;if(Fi(e,n)){const p=n.stack;n.stack=[],o=n.enter("autolink");let c=a.move("<");return c+=a.move(n.containerPhrasing(e,{before:c,after:">",...a.current()})),c+=a.move(">"),o(),n.stack=p,c}o=n.enter("link"),l=n.enter("label");let u=a.move("[");return u+=a.move(n.containerPhrasing(e,{before:u,after:"](",...a.current()})),u+=a.move("]("),l(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(l=n.enter("destinationLiteral"),u+=a.move("<"),u+=a.move(n.safe(e.url,{before:u,after:">",...a.current()})),u+=a.move(">")):(l=n.enter("destinationRaw"),u+=a.move(n.safe(e.url,{before:u,after:e.title?" ":")",...a.current()}))),l(),e.title&&(l=n.enter(`title${s}`),u+=a.move(" "+i),u+=a.move(n.safe(e.title,{before:u,after:i,...a.current()})),u+=a.move(i),l()),u+=a.move(")"),o(),u}function op(e,t,n){return Fi(e,n)?"<":"["}Oi.peek=lp;function Oi(e,t,n,r){const i=e.referenceType,s=n.enter("linkReference");let a=n.enter("label");const o=n.createTracker(r);let l=o.move("[");const u=n.containerPhrasing(e,{before:l,after:"]",...o.current()});l+=o.move(u+"]["),a();const p=n.stack;n.stack=[],a=n.enter("reference");const c=n.safe(n.associationId(e),{before:l,after:"]",...o.current()});return a(),n.stack=p,s(),i==="full"||!u||u!==c?l+=o.move(c+"]"):i==="shortcut"?l=l.slice(0,-1):l+=o.move("]"),l}function lp(){return"["}function An(e){const t=e.options.bullet||"*";if(t!=="*"&&t!=="+"&&t!=="-")throw new Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function up(e){const t=An(e),n=e.options.bulletOther;if(!n)return t==="*"?"-":"*";if(n!=="*"&&n!=="+"&&n!=="-")throw new Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw new Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}function cp(e){const t=e.options.bulletOrdered||".";if(t!=="."&&t!==")")throw new Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function Bi(e){const t=e.options.rule||"*";if(t!=="*"&&t!=="-"&&t!=="_")throw new Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function pp(e,t,n,r){const i=n.enter("list"),s=n.bulletCurrent;let a=e.ordered?cp(n):An(n);const o=e.ordered?a==="."?")":".":up(n);let l=t&&n.bulletLastUsed?a===n.bulletLastUsed:!1;if(!e.ordered){const p=e.children?e.children[0]:void 0;if((a==="*"||a==="-")&&p&&(!p.children||!p.children[0])&&n.stack[n.stack.length-1]==="list"&&n.stack[n.stack.length-2]==="listItem"&&n.stack[n.stack.length-3]==="list"&&n.stack[n.stack.length-4]==="listItem"&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(l=!0),Bi(n)===a&&p){let c=-1;for(;++c<e.children.length;){const h=e.children[c];if(h&&h.type==="listItem"&&h.children&&h.children[0]&&h.children[0].type==="thematicBreak"){l=!0;break}}}}l&&(a=o),n.bulletCurrent=a;const u=n.containerFlow(e,r);return n.bulletLastUsed=a,n.bulletCurrent=s,i(),u}function dp(e){const t=e.options.listItemIndent||"one";if(t!=="tab"&&t!=="one"&&t!=="mixed")throw new Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}function fp(e,t,n,r){const i=dp(n);let s=n.bulletCurrent||An(n);t&&t.type==="list"&&t.ordered&&(s=(typeof t.start=="number"&&t.start>-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+s);let a=s.length+1;(i==="tab"||i==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(a=Math.ceil(a/4)*4);const o=n.createTracker(r);o.move(s+" ".repeat(a-s.length)),o.shift(a);const l=n.enter("listItem"),u=n.indentLines(n.containerFlow(e,o.current()),p);return l(),u;function p(c,h,f){return h?(f?"":" ".repeat(a))+c:(f?s:s+" ".repeat(a-s.length))+c}}function hp(e,t,n,r){const i=n.enter("paragraph"),s=n.enter("phrasing"),a=n.containerPhrasing(e,r);return s(),i(),a}const gp=At(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function mp(e,t,n,r){return(e.children.some(function(a){return gp(a)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}function xp(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}$i.peek=bp;function $i(e,t,n,r){const i=xp(n),s=n.enter("strong"),a=n.createTracker(r),o=a.move(i+i);let l=a.move(n.containerPhrasing(e,{after:i,before:o,...a.current()}));const u=l.charCodeAt(0),p=Et(r.before.charCodeAt(r.before.length-1),u,i);p.inside&&(l=ct(u)+l.slice(1));const c=l.charCodeAt(l.length-1),h=Et(r.after.charCodeAt(0),c,i);h.inside&&(l=l.slice(0,-1)+ct(c));const f=a.move(i+i);return s(),n.attentionEncodeSurroundingInfo={after:h.outside,before:p.outside},o+l+f}function bp(e,t,n){return n.options.strong||"*"}function wp(e,t,n,r){return n.safe(e.value,r)}function yp(e){const t=e.options.ruleRepetition||3;if(t<3)throw new Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function kp(e,t,n){const r=(Bi(n)+(n.options.ruleSpaces?" ":"")).repeat(yp(n));return n.options.ruleSpaces?r.slice(0,-1):r}const Hi={blockquote:Vc,break:jr,code:Kc,definition:Jc,emphasis:Di,hardBreak:jr,heading:np,html:Li,image:Mi,imageReference:Ri,inlineCode:Pi,link:_i,linkReference:Oi,list:pp,listItem:fp,paragraph:hp,root:mp,strong:$i,text:wp,thematicBreak:kp};function vp(){return{enter:{table:Cp,tableData:Ir,tableHeader:Ir,tableRow:Ep},exit:{codeText:jp,table:Sp,tableData:Qt,tableHeader:Qt,tableRow:Qt}}}function Cp(e){const t=e._align;this.enter({type:"table",align:t.map(function(n){return n==="none"?null:n}),children:[]},e),this.data.inTable=!0}function Sp(e){this.exit(e),this.data.inTable=void 0}function Ep(e){this.enter({type:"tableRow",children:[]},e)}function Qt(e){this.exit(e)}function Ir(e){this.enter({type:"tableCell",children:[]},e)}function jp(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,Ip));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function Ip(e,t){return t==="|"?t:e}function zp(e){const t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,i=t.stringLength,s=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
28
- `,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:h,table:a,tableCell:l,tableRow:o}};function a(f,g,w,S){return u(p(f,w,S),f.align)}function o(f,g,w,S){const b=c(f,w,S),E=u([b]);return E.slice(0,E.indexOf(`
29
- `))}function l(f,g,w,S){const b=w.enter("tableCell"),E=w.enter("phrasing"),C=w.containerPhrasing(f,{...S,before:s,after:s});return E(),b(),C}function u(f,g){return Hc(f,{align:g,alignDelimiters:r,padding:n,stringLength:i})}function p(f,g,w){const S=f.children;let b=-1;const E=[],C=g.enter("table");for(;++b<S.length;)E[b]=c(S[b],g,w);return C(),E}function c(f,g,w){const S=f.children;let b=-1;const E=[],C=g.enter("tableRow");for(;++b<S.length;)E[b]=l(S[b],f,g,w);return C(),E}function h(f,g,w){let S=Hi.inlineCode(f,g,w);return w.stack.includes("tableCell")&&(S=S.replace(/\|/g,"\\$&")),S}}function Tp(){return{exit:{taskListCheckValueChecked:zr,taskListCheckValueUnchecked:zr,paragraph:Np}}}function Ap(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:Dp}}}function zr(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function Np(e){const t=this.stack[this.stack.length-2];if(t&&t.type==="listItem"&&typeof t.checked=="boolean"){const n=this.stack[this.stack.length-1];n.type;const r=n.children[0];if(r&&r.type==="text"){const i=t.children;let s=-1,a;for(;++s<i.length;){const o=i[s];if(o.type==="paragraph"){a=o;break}}a===n&&(r.value=r.value.slice(1),r.value.length===0?n.children.shift():n.position&&r.position&&typeof r.position.start.offset=="number"&&(r.position.start.column++,r.position.start.offset++,n.position.start=Object.assign({},r.position.start)))}}this.exit(e)}function Dp(e,t,n,r){const i=e.children[0],s=typeof e.checked=="boolean"&&i&&i.type==="paragraph",a="["+(e.checked?"x":" ")+"] ",o=n.createTracker(r);s&&o.move(a);let l=Hi.listItem(e,t,n,{...r,...o.current()});return s&&(l=l.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,u)),l;function u(p){return p+a}}function Lp(){return[pc(),Dc(),Pc(),vp(),Tp()]}function Mp(e){return{extensions:[dc(),Lc(e),Fc(),zp(e),Ap()]}}const Rp={tokenize:$p,partial:!0},Ui={tokenize:Hp,partial:!0},Vi={tokenize:Up,partial:!0},qi={tokenize:Vp,partial:!0},Pp={tokenize:qp,partial:!0},Wi={name:"wwwAutolink",tokenize:Op,previous:Gi},Yi={name:"protocolAutolink",tokenize:Bp,previous:Xi},ze={name:"emailAutolink",tokenize:_p,previous:Ki},ve={};function Fp(){return{text:ve}}let Re=48;for(;Re<123;)ve[Re]=ze,Re++,Re===58?Re=65:Re===91&&(Re=97);ve[43]=ze;ve[45]=ze;ve[46]=ze;ve[95]=ze;ve[72]=[ze,Yi];ve[104]=[ze,Yi];ve[87]=[ze,Wi];ve[119]=[ze,Wi];function _p(e,t,n){const r=this;let i,s;return a;function a(c){return!dn(c)||!Ki.call(r,r.previous)||Nn(r.events)?n(c):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),o(c))}function o(c){return dn(c)?(e.consume(c),o):c===64?(e.consume(c),l):n(c)}function l(c){return c===46?e.check(Pp,p,u)(c):c===45||c===95||se(c)?(s=!0,e.consume(c),l):p(c)}function u(c){return e.consume(c),i=!0,l}function p(c){return s&&i&&ue(r.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(c)):n(c)}}function Op(e,t,n){const r=this;return i;function i(a){return a!==87&&a!==119||!Gi.call(r,r.previous)||Nn(r.events)?n(a):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(Rp,e.attempt(Ui,e.attempt(Vi,s),n),n)(a))}function s(a){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(a)}}function Bp(e,t,n){const r=this;let i="",s=!1;return a;function a(c){return(c===72||c===104)&&Xi.call(r,r.previous)&&!Nn(r.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),i+=String.fromCodePoint(c),e.consume(c),o):n(c)}function o(c){if(ue(c)&&i.length<5)return i+=String.fromCodePoint(c),e.consume(c),o;if(c===58){const h=i.toLowerCase();if(h==="http"||h==="https")return e.consume(c),l}return n(c)}function l(c){return c===47?(e.consume(c),s?u:(s=!0,l)):n(c)}function u(c){return c===null||vt(c)||ee(c)||Be(c)||It(c)?n(c):e.attempt(Ui,e.attempt(Vi,p),n)(c)}function p(c){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(c)}}function $p(e,t,n){let r=0;return i;function i(a){return(a===87||a===119)&&r<3?(r++,e.consume(a),i):a===46&&r===3?(e.consume(a),s):n(a)}function s(a){return a===null?n(a):t(a)}}function Hp(e,t,n){let r,i,s;return a;function a(u){return u===46||u===95?e.check(qi,l,o)(u):u===null||ee(u)||Be(u)||u!==45&&It(u)?l(u):(s=!0,e.consume(u),a)}function o(u){return u===95?r=!0:(i=r,r=void 0),e.consume(u),a}function l(u){return i||r||!s?n(u):t(u)}}function Up(e,t){let n=0,r=0;return i;function i(a){return a===40?(n++,e.consume(a),i):a===41&&r<n?s(a):a===33||a===34||a===38||a===39||a===41||a===42||a===44||a===46||a===58||a===59||a===60||a===63||a===93||a===95||a===126?e.check(qi,t,s)(a):a===null||ee(a)||Be(a)?t(a):(e.consume(a),i)}function s(a){return a===41&&r++,e.consume(a),i}}function Vp(e,t,n){return r;function r(o){return o===33||o===34||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===63||o===95||o===126?(e.consume(o),r):o===38?(e.consume(o),s):o===93?(e.consume(o),i):o===60||o===null||ee(o)||Be(o)?t(o):n(o)}function i(o){return o===null||o===40||o===91||ee(o)||Be(o)?t(o):r(o)}function s(o){return ue(o)?a(o):n(o)}function a(o){return o===59?(e.consume(o),r):ue(o)?(e.consume(o),a):n(o)}}function qp(e,t,n){return r;function r(s){return e.consume(s),i}function i(s){return se(s)?n(s):t(s)}}function Gi(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||ee(e)}function Xi(e){return!ue(e)}function Ki(e){return!(e===47||dn(e))}function dn(e){return e===43||e===45||e===46||e===95||se(e)}function Nn(e){let t=e.length,n=!1;for(;t--;){const r=e[t][1];if((r.type==="labelLink"||r.type==="labelImage")&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}const Wp={tokenize:ed,partial:!0};function Yp(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:Qp,continuation:{tokenize:Jp},exit:Zp}},text:{91:{name:"gfmFootnoteCall",tokenize:Kp},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:Gp,resolveTo:Xp}}}}function Gp(e,t,n){const r=this;let i=r.events.length;const s=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let a;for(;i--;){const l=r.events[i][1];if(l.type==="labelImage"){a=l;break}if(l.type==="gfmFootnoteCall"||l.type==="labelLink"||l.type==="label"||l.type==="image"||l.type==="link")break}return o;function o(l){if(!a||!a._balanced)return n(l);const u=we(r.sliceSerialize({start:a.end,end:r.now()}));return u.codePointAt(0)!==94||!s.includes(u.slice(1))?n(l):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(l),e.exit("gfmFootnoteCallLabelMarker"),t(l))}}function Xp(e,t){let n=e.length;for(;n--;)if(e[n][1].type==="labelImage"&&e[n][0]==="enter"){e[n][1];break}e[n+1][1].type="data",e[n+3][1].type="gfmFootnoteCallLabelMarker";const r={type:"gfmFootnoteCall",start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},i={type:"gfmFootnoteCallMarker",start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};i.end.column++,i.end.offset++,i.end._bufferIndex++;const s={type:"gfmFootnoteCallString",start:Object.assign({},i.end),end:Object.assign({},e[e.length-1][1].start)},a={type:"chunkString",contentType:"string",start:Object.assign({},s.start),end:Object.assign({},s.end)},o=[e[n+1],e[n+2],["enter",r,t],e[n+3],e[n+4],["enter",i,t],["exit",i,t],["enter",s,t],["enter",a,t],["exit",a,t],["exit",s,t],e[e.length-2],e[e.length-1],["exit",r,t]];return e.splice(n,e.length-n+1,...o),e}function Kp(e,t,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let s=0,a;return o;function o(c){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(c),e.exit("gfmFootnoteCallLabelMarker"),l}function l(c){return c!==94?n(c):(e.enter("gfmFootnoteCallMarker"),e.consume(c),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",u)}function u(c){if(s>999||c===93&&!a||c===null||c===91||ee(c))return n(c);if(c===93){e.exit("chunkString");const h=e.exit("gfmFootnoteCallString");return i.includes(we(r.sliceSerialize(h)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(c),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(c)}return ee(c)||(a=!0),s++,e.consume(c),c===92?p:u}function p(c){return c===91||c===92||c===93?(e.consume(c),s++,u):u(c)}}function Qp(e,t,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let s,a=0,o;return l;function l(g){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(g),e.exit("gfmFootnoteDefinitionLabelMarker"),u}function u(g){return g===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(g),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",p):n(g)}function p(g){if(a>999||g===93&&!o||g===null||g===91||ee(g))return n(g);if(g===93){e.exit("chunkString");const w=e.exit("gfmFootnoteDefinitionLabelString");return s=we(r.sliceSerialize(w)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(g),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),h}return ee(g)||(o=!0),a++,e.consume(g),g===92?c:p}function c(g){return g===91||g===92||g===93?(e.consume(g),a++,p):p(g)}function h(g){return g===58?(e.enter("definitionMarker"),e.consume(g),e.exit("definitionMarker"),i.includes(s)||i.push(s),Q(e,f,"gfmFootnoteDefinitionWhitespace")):n(g)}function f(g){return t(g)}}function Jp(e,t,n){return e.check(dt,t,e.attempt(Wp,t,n))}function Zp(e){e.exit("gfmFootnoteDefinition")}function ed(e,t,n){const r=this;return Q(e,i,"gfmFootnoteDefinitionIndent",5);function i(s){const a=r.events[r.events.length-1];return a&&a[1].type==="gfmFootnoteDefinitionIndent"&&a[2].sliceSerialize(a[1],!0).length===4?t(s):n(s)}}function td(e){let n=(e||{}).singleTilde;const r={name:"strikethrough",tokenize:s,resolveAll:i};return n==null&&(n=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function i(a,o){let l=-1;for(;++l<a.length;)if(a[l][0]==="enter"&&a[l][1].type==="strikethroughSequenceTemporary"&&a[l][1]._close){let u=l;for(;u--;)if(a[u][0]==="exit"&&a[u][1].type==="strikethroughSequenceTemporary"&&a[u][1]._open&&a[l][1].end.offset-a[l][1].start.offset===a[u][1].end.offset-a[u][1].start.offset){a[l][1].type="strikethroughSequence",a[u][1].type="strikethroughSequence";const p={type:"strikethrough",start:Object.assign({},a[u][1].start),end:Object.assign({},a[l][1].end)},c={type:"strikethroughText",start:Object.assign({},a[u][1].end),end:Object.assign({},a[l][1].start)},h=[["enter",p,o],["enter",a[u][1],o],["exit",a[u][1],o],["enter",c,o]],f=o.parser.constructs.insideSpan.null;f&&he(h,h.length,0,zt(f,a.slice(u+1,l),o)),he(h,h.length,0,[["exit",c,o],["enter",a[l][1],o],["exit",a[l][1],o],["exit",p,o]]),he(a,u-1,l-u+3,h),l=u+h.length-2;break}}for(l=-1;++l<a.length;)a[l][1].type==="strikethroughSequenceTemporary"&&(a[l][1].type="data");return a}function s(a,o,l){const u=this.previous,p=this.events;let c=0;return h;function h(g){return u===126&&p[p.length-1][1].type!=="characterEscape"?l(g):(a.enter("strikethroughSequenceTemporary"),f(g))}function f(g){const w=Ye(u);if(g===126)return c>1?l(g):(a.consume(g),c++,f);if(c<2&&!n)return l(g);const S=a.exit("strikethroughSequenceTemporary"),b=Ye(g);return S._open=!b||b===2&&!!w,S._close=!w||w===2&&!!b,o(g)}}}class nd{constructor(){this.map=[]}add(t,n,r){rd(this,t,n,r)}consume(t){if(this.map.sort(function(s,a){return s[0]-a[0]}),this.map.length===0)return;let n=this.map.length;const r=[];for(;n>0;)n-=1,r.push(t.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),t.length=this.map[n][0];r.push(t.slice()),t.length=0;let i=r.pop();for(;i;){for(const s of i)t.push(s);i=r.pop()}this.map.length=0}}function rd(e,t,n,r){let i=0;if(!(n===0&&r.length===0)){for(;i<e.map.length;){if(e.map[i][0]===t){e.map[i][1]+=n,e.map[i][2].push(...r);return}i+=1}e.map.push([t,n,r])}}function id(e,t){let n=!1;const r=[];for(;t<e.length;){const i=e[t];if(n){if(i[0]==="enter")i[1].type==="tableContent"&&r.push(e[t+1][1].type==="tableDelimiterMarker"?"left":"none");else if(i[1].type==="tableContent"){if(e[t-1][1].type==="tableDelimiterMarker"){const s=r.length-1;r[s]=r[s]==="left"?"center":"right"}}else if(i[1].type==="tableDelimiterRow")break}else i[0]==="enter"&&i[1].type==="tableDelimiterRow"&&(n=!0);t+=1}return r}function ad(){return{flow:{null:{name:"table",tokenize:sd,resolveAll:od}}}}function sd(e,t,n){const r=this;let i=0,s=0,a;return o;function o(x){let I=r.events.length-1;for(;I>-1;){const P=r.events[I][1].type;if(P==="lineEnding"||P==="linePrefix")I--;else break}const M=I>-1?r.events[I][1].type:null,$=M==="tableHead"||M==="tableRow"?v:l;return $===v&&r.parser.lazy[r.now().line]?n(x):$(x)}function l(x){return e.enter("tableHead"),e.enter("tableRow"),u(x)}function u(x){return x===124||(a=!0,s+=1),p(x)}function p(x){return x===null?n(x):H(x)?s>1?(s=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(x),e.exit("lineEnding"),f):n(x):G(x)?Q(e,p,"whitespace")(x):(s+=1,a&&(a=!1,i+=1),x===124?(e.enter("tableCellDivider"),e.consume(x),e.exit("tableCellDivider"),a=!0,p):(e.enter("data"),c(x)))}function c(x){return x===null||x===124||ee(x)?(e.exit("data"),p(x)):(e.consume(x),x===92?h:c)}function h(x){return x===92||x===124?(e.consume(x),c):c(x)}function f(x){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(x):(e.enter("tableDelimiterRow"),a=!1,G(x)?Q(e,g,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(x):g(x))}function g(x){return x===45||x===58?S(x):x===124?(a=!0,e.enter("tableCellDivider"),e.consume(x),e.exit("tableCellDivider"),w):L(x)}function w(x){return G(x)?Q(e,S,"whitespace")(x):S(x)}function S(x){return x===58?(s+=1,a=!0,e.enter("tableDelimiterMarker"),e.consume(x),e.exit("tableDelimiterMarker"),b):x===45?(s+=1,b(x)):x===null||H(x)?T(x):L(x)}function b(x){return x===45?(e.enter("tableDelimiterFiller"),E(x)):L(x)}function E(x){return x===45?(e.consume(x),E):x===58?(a=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(x),e.exit("tableDelimiterMarker"),C):(e.exit("tableDelimiterFiller"),C(x))}function C(x){return G(x)?Q(e,T,"whitespace")(x):T(x)}function T(x){return x===124?g(x):x===null||H(x)?!a||i!==s?L(x):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(x)):L(x)}function L(x){return n(x)}function v(x){return e.enter("tableRow"),N(x)}function N(x){return x===124?(e.enter("tableCellDivider"),e.consume(x),e.exit("tableCellDivider"),N):x===null||H(x)?(e.exit("tableRow"),t(x)):G(x)?Q(e,N,"whitespace")(x):(e.enter("data"),R(x))}function R(x){return x===null||x===124||ee(x)?(e.exit("data"),N(x)):(e.consume(x),x===92?_:R)}function _(x){return x===92||x===124?(e.consume(x),R):R(x)}}function od(e,t){let n=-1,r=!0,i=0,s=[0,0,0,0],a=[0,0,0,0],o=!1,l=0,u,p,c;const h=new nd;for(;++n<e.length;){const f=e[n],g=f[1];f[0]==="enter"?g.type==="tableHead"?(o=!1,l!==0&&(Tr(h,t,l,u,p),p=void 0,l=0),u={type:"table",start:Object.assign({},g.start),end:Object.assign({},g.end)},h.add(n,0,[["enter",u,t]])):g.type==="tableRow"||g.type==="tableDelimiterRow"?(r=!0,c=void 0,s=[0,0,0,0],a=[0,n+1,0,0],o&&(o=!1,p={type:"tableBody",start:Object.assign({},g.start),end:Object.assign({},g.end)},h.add(n,0,[["enter",p,t]])),i=g.type==="tableDelimiterRow"?2:p?3:1):i&&(g.type==="data"||g.type==="tableDelimiterMarker"||g.type==="tableDelimiterFiller")?(r=!1,a[2]===0&&(s[1]!==0&&(a[0]=a[1],c=bt(h,t,s,i,void 0,c),s=[0,0,0,0]),a[2]=n)):g.type==="tableCellDivider"&&(r?r=!1:(s[1]!==0&&(a[0]=a[1],c=bt(h,t,s,i,void 0,c)),s=a,a=[s[1],n,0,0])):g.type==="tableHead"?(o=!0,l=n):g.type==="tableRow"||g.type==="tableDelimiterRow"?(l=n,s[1]!==0?(a[0]=a[1],c=bt(h,t,s,i,n,c)):a[1]!==0&&(c=bt(h,t,a,i,n,c)),i=0):i&&(g.type==="data"||g.type==="tableDelimiterMarker"||g.type==="tableDelimiterFiller")&&(a[3]=n)}for(l!==0&&Tr(h,t,l,u,p),h.consume(t.events),n=-1;++n<t.events.length;){const f=t.events[n];f[0]==="enter"&&f[1].type==="table"&&(f[1]._align=id(t.events,n))}return e}function bt(e,t,n,r,i,s){const a=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",o="tableContent";n[0]!==0&&(s.end=Object.assign({},We(t.events,n[0])),e.add(n[0],0,[["exit",s,t]]));const l=We(t.events,n[1]);if(s={type:a,start:Object.assign({},l),end:Object.assign({},l)},e.add(n[1],0,[["enter",s,t]]),n[2]!==0){const u=We(t.events,n[2]),p=We(t.events,n[3]),c={type:o,start:Object.assign({},u),end:Object.assign({},p)};if(e.add(n[2],0,[["enter",c,t]]),r!==2){const h=t.events[n[2]],f=t.events[n[3]];if(h[1].end=Object.assign({},f[1].end),h[1].type="chunkText",h[1].contentType="text",n[3]>n[2]+1){const g=n[2]+1,w=n[3]-n[2]-1;e.add(g,w,[])}}e.add(n[3]+1,0,[["exit",c,t]])}return i!==void 0&&(s.end=Object.assign({},We(t.events,i)),e.add(i,0,[["exit",s,t]]),s=void 0),s}function Tr(e,t,n,r,i){const s=[],a=We(t.events,n);i&&(i.end=Object.assign({},a),s.push(["exit",i,t])),r.end=Object.assign({},a),s.push(["exit",r,t]),e.add(n+1,0,s)}function We(e,t){const n=e[t],r=n[0]==="enter"?"start":"end";return n[1][r]}const ld={name:"tasklistCheck",tokenize:cd};function ud(){return{text:{91:ld}}}function cd(e,t,n){const r=this;return i;function i(l){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(l):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(l),e.exit("taskListCheckMarker"),s)}function s(l){return ee(l)?(e.enter("taskListCheckValueUnchecked"),e.consume(l),e.exit("taskListCheckValueUnchecked"),a):l===88||l===120?(e.enter("taskListCheckValueChecked"),e.consume(l),e.exit("taskListCheckValueChecked"),a):n(l)}function a(l){return l===93?(e.enter("taskListCheckMarker"),e.consume(l),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),o):n(l)}function o(l){return H(l)?t(l):G(l)?e.check({tokenize:pd},t,n)(l):n(l)}}function pd(e,t,n){return Q(e,r,"whitespace");function r(i){return i===null?n(i):t(i)}}function dd(e){return ai([Fp(),Yp(),td(e),ad(),ud()])}const fd={};function hd(e){const t=this,n=e||fd,r=t.data(),i=r.micromarkExtensions||(r.micromarkExtensions=[]),s=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),a=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);i.push(dd(n)),s.push(Lp()),a.push(Mp(n))}function Qi({content:e}){return d.jsx("div",{className:"sa-text-part",children:d.jsx(tc,{remarkPlugins:[hd],children:e})})}const gd="https://at.alicdn.com/t/c/font_5210396_pffyg5g21kn.js";let Ar=!1;function Ji(e=gd){if(Ar||typeof document>"u")return;Ar=!0;const t=e.split("?")[0].split("/").pop();if(t&&document.querySelector(`script[src*="${t}"]`))return;const n=document.createElement("script");n.src=e,document.head.appendChild(n)}Ji();function X({name:e,size:t=16,color:n="currentColor",className:r,style:i}){return d.jsx("svg",{className:r,style:{width:t,height:t,fill:n,verticalAlign:"middle",...i},"aria-hidden":"true",children:d.jsx("use",{href:`#icon-${e}`})})}function Zi({content:e}){const[t,n]=k.useState(!1);return d.jsxs("div",{className:"sa-thinking-part",onClick:()=>n(!t),children:[d.jsxs("div",{className:"sa-thinking-header",children:[d.jsx("span",{className:"sa-thinking-icon",children:d.jsx(X,{name:"brain",size:14})}),d.jsx("span",{className:"sa-thinking-label",children:"思考过程"}),d.jsx("span",{className:`sa-thinking-arrow ${t?"expanded":""}`,children:d.jsx(X,{name:"chevron-right",size:12})})]}),t&&d.jsx("div",{className:"sa-thinking-content",children:e})]})}function ea({toolName:e,toolCallId:t,args:n}){const[r,i]=k.useState(!1),[s,a]=k.useState(!1);let o=n;try{o=JSON.stringify(JSON.parse(n),null,2)}catch{}const l=k.useCallback(()=>{var u;(u=navigator.clipboard)==null||u.writeText(o).then(()=>{a(!0),setTimeout(()=>a(!1),2e3)}).catch(()=>{})},[o]);return d.jsxs("div",{className:"sa-tool-call-part",children:[d.jsxs("div",{className:"sa-tool-call-header",onClick:()=>i(!r),children:[d.jsx("span",{className:"sa-tool-icon",children:d.jsx(X,{name:"zap",size:14})}),d.jsxs("span",{className:"sa-tool-name",children:["调用工具: ",e]}),d.jsx("span",{className:`sa-thinking-arrow ${r?"expanded":""}`,children:d.jsx(X,{name:"chevron-right",size:12})})]}),r&&d.jsxs(d.Fragment,{children:[d.jsx("pre",{className:"sa-tool-args",children:o}),d.jsx("div",{className:"sa-tool-result-actions",children:d.jsxs("button",{className:"sa-action-btn",onClick:l,title:"复制",children:[d.jsx(X,{name:s?"circle-check":"copy",size:14})," ",s?"已复制":"复制"]})})]})]})}function Nr({text:e}){const[t,n]=k.useState(!1),r=()=>{var i;(i=navigator.clipboard)==null||i.writeText(e).then(()=>{n(!0),setTimeout(()=>n(!1),2e3)}).catch(()=>{})};return d.jsxs("button",{className:"sa-action-btn",onClick:r,title:"复制",children:[d.jsx(X,{name:t?"circle-check":"copy",size:14})," ",t?"已复制":"复制"]})}function md({html:e}){const[t,n]=k.useState(null);return k.useEffect(()=>{let r=!1;return Promise.resolve().then(()=>require("./purify.es-Dsdnkgrg.cjs")).then(i=>{r||n(i.default.sanitize(e,{FORCE_BODY:!0,ADD_ATTR:["target"]}))}),()=>{r=!0}},[e]),t===null?null:d.jsx("div",{className:"sa-tool-result-html-scroll",children:d.jsx("div",{className:"sa-tool-result-html sa-text-part",dangerouslySetInnerHTML:{__html:t}})})}function ta({toolName:e,content:t,artifacts:n,renderMode:r,html:i,artifactPreview:s}){const{openArtifactPreview:a}=ke(),o=Or(n);return d.jsxs("div",{className:"sa-tool-result-part",children:[d.jsxs("div",{className:"sa-tool-result-header",children:[d.jsx("span",{className:"sa-tool-icon",children:d.jsx(X,{name:"circle-check",size:14,color:"#10b981"})}),d.jsx("span",{className:"sa-tool-result-label",children:e||"工具返回"})]}),r==="html"&&i?d.jsxs(d.Fragment,{children:[d.jsx(md,{html:i}),d.jsx("div",{className:"sa-tool-result-actions",children:d.jsx(Nr,{text:i})})]}):t?d.jsxs(d.Fragment,{children:[d.jsx("pre",{className:"sa-tool-result-content",children:t}),d.jsx("div",{className:"sa-tool-result-actions",children:d.jsx(Nr,{text:t})})]}):d.jsx("pre",{className:"sa-tool-result-content",children:"—"}),o.length>0&&d.jsx("ul",{className:"sa-artifact-file-list",role:"list",children:o.map((l,u)=>d.jsxs("li",{className:"sa-artifact-file-card",onClick:s?()=>a(l):void 0,onKeyDown:s?p=>{(p.key==="Enter"||p.key===" ")&&(p.preventDefault(),a(l))}:void 0,tabIndex:s?0:void 0,role:s?"button":void 0,"aria-label":s?`预览 ${l.filename}`:void 0,style:s?{cursor:"pointer"}:void 0,children:[d.jsx("div",{className:"sa-artifact-file-icon",children:d.jsx("span",{className:"sa-artifact-chip-type",children:_r(l.type)})}),d.jsxs("div",{className:"sa-artifact-file-info",children:[d.jsx("span",{className:"sa-artifact-file-name",children:l.filename}),l.size!=null&&d.jsx("span",{className:"sa-artifact-file-size",children:Fr(l.size)})]}),s&&d.jsx("button",{className:"sa-artifact-file-download",title:"下载","aria-label":`下载 ${l.filename}`,onClick:p=>{p.stopPropagation(),kt(l)},children:d.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:d.jsx("path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4M7 10l5 5 5-5M12 15V3"})})})]},l.id||`art-${u}`))})]})}function na({content:e,onRetry:t}){return d.jsxs("div",{className:"sa-error-part",children:[d.jsxs("div",{className:"sa-error-content",children:[d.jsx("span",{className:"sa-error-icon",children:d.jsx(X,{name:"triangle-alert",size:14})}),d.jsx("span",{children:e||"发生错误"})]}),t&&d.jsx("button",{className:"sa-error-retry",onClick:t,children:"重试"})]})}function ra(e){return e==null||Number.isNaN(e)?"":e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/1024/1024).toFixed(1)} MB`}function xd({attachment:e}){const t=d.jsxs(d.Fragment,{children:[d.jsx(X,{name:"file-text",size:14,color:"#6366f1"}),d.jsx("span",{className:"sa-attachment-chip-name",children:e.filename}),e.size!=null&&d.jsx("span",{className:"sa-attachment-chip-size",children:ra(e.size)})]});return e.url?d.jsx("a",{className:"sa-attachment-chip",href:e.url,target:"_blank",rel:"noreferrer",download:e.filename,title:`下载 ${e.filename}`,children:t}):d.jsx("span",{className:"sa-attachment-chip",title:e.filename,children:t})}function bd({interrupt:e,onRespond:t,disabled:n,answeredAction:r}){var o,l;const i=e.options,s=(typeof(i==null?void 0:i[0])=="string"?i[0]:(o=i==null?void 0:i[0])==null?void 0:o.label)||"确认",a=(typeof(i==null?void 0:i[1])=="string"?i[1]:(l=i==null?void 0:i[1])==null?void 0:l.label)||"取消";return d.jsxs("div",{className:"sa-interrupt-card",children:[d.jsxs("div",{className:"sa-interrupt-content",children:[d.jsx(X,{name:"circle-alert",size:16,color:"#f59e0b"}),d.jsx("span",{children:e.content})]}),d.jsxs("div",{className:"sa-interrupt-actions",children:[d.jsxs("button",{className:`sa-interrupt-btn sa-interrupt-btn-primary ${r==="confirm"?"sa-interrupt-btn-answered":""}`,disabled:n,onClick:()=>t({action:"confirm"}),children:[d.jsx(X,{name:"check",size:14})," ",s]}),d.jsxs("button",{className:`sa-interrupt-btn sa-interrupt-btn-secondary ${r==="cancel"?"sa-interrupt-btn-answered":""}`,disabled:n,onClick:()=>t({action:"cancel"}),children:[d.jsx(X,{name:"x",size:14})," ",a]})]}),n&&d.jsx("div",{className:"sa-interrupt-submitted",children:"已提交"})]})}function wd({interrupt:e,onRespond:t,disabled:n,answeredAction:r}){var u,p,c,h;const i=e.options,s=(typeof(i==null?void 0:i[0])=="string"?i[0]:(u=i==null?void 0:i[0])==null?void 0:u.label)||"批准",a=(typeof(i==null?void 0:i[1])=="string"?i[1]:(p=i==null?void 0:i[1])==null?void 0:p.label)||"拒绝",o=(typeof(i==null?void 0:i[2])=="string"?i[2]:(c=i==null?void 0:i[2])==null?void 0:c.label)||"跳过",l=((h=e.metadata)==null?void 0:h.showSkip)!==!1;return d.jsxs("div",{className:"sa-interrupt-card",children:[d.jsxs("div",{className:"sa-interrupt-content",children:[d.jsx(X,{name:"circle-alert",size:16,color:"#f59e0b"}),d.jsx("span",{children:e.content})]}),d.jsxs("div",{className:"sa-interrupt-actions",children:[d.jsxs("button",{className:`sa-interrupt-btn sa-interrupt-btn-primary ${r==="approve"?"sa-interrupt-btn-answered":""}`,disabled:n,onClick:()=>t({action:"approve"}),children:[d.jsx(X,{name:"check",size:14})," ",s]}),d.jsxs("button",{className:`sa-interrupt-btn sa-interrupt-btn-danger ${r==="reject"?"sa-interrupt-btn-answered":""}`,disabled:n,onClick:()=>t({action:"reject"}),children:[d.jsx(X,{name:"x",size:14})," ",a]}),l&&d.jsxs("button",{className:`sa-interrupt-btn sa-interrupt-btn-secondary ${r==="skip"?"sa-interrupt-btn-answered":""}`,disabled:n,onClick:()=>t({action:"skip"}),children:[d.jsx(X,{name:"chevron-right",size:14})," ",o]})]}),n&&d.jsx("div",{className:"sa-interrupt-submitted",children:"已提交"})]})}function yd(e){return typeof e=="string"?{value:e,label:e}:e}function kd({interrupt:e,onRespond:t,disabled:n,initialValue:r}){const i=(e.options??[]).map(yd);return d.jsxs("div",{className:"sa-interrupt-card",children:[d.jsxs("div",{className:"sa-interrupt-content",children:[d.jsx(X,{name:"list",size:16,color:"#6366f1"}),d.jsx("span",{children:e.content})]}),d.jsx("div",{className:"sa-interrupt-options",children:i.map(s=>{const a=r===s.value;return d.jsxs("button",{className:`sa-interrupt-option ${s.danger?"sa-interrupt-option-danger":""} ${a?"sa-interrupt-option-selected":""}`,disabled:n,onClick:()=>t({action:"select",value:s.value}),children:[d.jsx(X,{name:a?"circle-check":"circle",size:14}),s.icon&&d.jsx(X,{name:s.icon,size:14}),d.jsx("span",{children:s.label}),s.description&&d.jsx("span",{className:"sa-interrupt-option-desc",children:s.description})]},s.value)})}),n&&d.jsx("div",{className:"sa-interrupt-submitted",children:"已提交"})]})}function vd(e){return typeof e=="string"?{value:e,label:e}:e}function Cd({interrupt:e,onRespond:t,disabled:n,initialValue:r}){const i=(e.options??[]).map(vd),[s,a]=k.useState(()=>new Set(Array.isArray(r)?r:[])),o=l=>{n||a(u=>{const p=new Set(u);return p.has(l)?p.delete(l):p.add(l),p})};return d.jsxs("div",{className:"sa-interrupt-card",children:[d.jsxs("div",{className:"sa-interrupt-content",children:[d.jsx(X,{name:"list-checks",size:16,color:"#6366f1"}),d.jsx("span",{children:e.content})]}),d.jsx("div",{className:"sa-interrupt-options",children:i.map(l=>d.jsxs("button",{className:`sa-interrupt-option ${s.has(l.value)?"sa-interrupt-option-selected":""}`,disabled:n,onClick:()=>o(l.value),children:[d.jsx(X,{name:s.has(l.value)?"square-check":"square",size:14}),d.jsx("span",{children:l.label})]},l.value))}),!n&&d.jsx("div",{className:"sa-interrupt-actions",children:d.jsxs("button",{className:"sa-interrupt-btn sa-interrupt-btn-primary",disabled:s.size===0,onClick:()=>t({action:"submit",value:Array.from(s)}),children:[d.jsx(X,{name:"check",size:14})," 确认 (",s.size,")"]})}),n&&d.jsx("div",{className:"sa-interrupt-submitted",children:"已提交"})]})}function Sd({interrupt:e,onRespond:t,disabled:n,initialValue:r}){const[i,s]=k.useState(r??""),a=e.inputType??"text",o=a==="textarea",l=()=>{n||e.required&&!i.trim()||t({action:"submit",value:i.trim()})};return d.jsxs("div",{className:"sa-interrupt-card",children:[d.jsxs("div",{className:"sa-interrupt-content",children:[d.jsx(X,{name:"text-cursor-input",size:16,color:"#6366f1"}),d.jsx("span",{children:e.content})]}),d.jsx("div",{className:"sa-interrupt-input-area",children:o?d.jsx("textarea",{className:"sa-interrupt-textarea",value:i,onChange:u=>s(u.target.value),placeholder:e.placeholder,maxLength:e.maxLength,rows:3,disabled:n}):d.jsx("input",{className:"sa-interrupt-input",type:a,value:i,onChange:u=>s(u.target.value),placeholder:e.placeholder,maxLength:e.maxLength,onKeyDown:u=>u.key==="Enter"&&l(),disabled:n})}),!n&&d.jsx("div",{className:"sa-interrupt-actions",children:d.jsxs("button",{className:"sa-interrupt-btn sa-interrupt-btn-primary",disabled:e.required?!i.trim():!1,onClick:l,children:[d.jsx(X,{name:"check",size:14})," 提交"]})}),n&&d.jsx("div",{className:"sa-interrupt-submitted",children:"已提交"})]})}function Ed({interrupt:e,onRespond:t,disabled:n,initialValue:r}){const i=e.fields??[],[s,a]=k.useState(()=>{const p={};for(const c of i)p[c.name]=(r==null?void 0:r[c.name])??c.defaultValue??"";return p}),o=(p,c)=>{n||a(h=>({...h,[p]:c}))},l=!n&&i.every(p=>!p.required||s[p.name]),u=()=>{l&&t({action:"submit",value:s})};return d.jsxs("div",{className:"sa-interrupt-card",children:[d.jsxs("div",{className:"sa-interrupt-content",children:[d.jsx(X,{name:"file-text",size:16,color:"#6366f1"}),d.jsx("span",{children:e.content})]}),d.jsx("div",{className:"sa-interrupt-form",children:i.map(p=>d.jsxs("div",{className:"sa-interrupt-form-field",children:[d.jsxs("label",{className:"sa-interrupt-form-label",children:[p.label,p.required&&d.jsx("span",{className:"sa-interrupt-form-required",children:"*"})]}),jd(p,s[p.name],c=>o(p.name,c),n)]},p.name))}),!n&&d.jsxs("div",{className:"sa-interrupt-actions",children:[d.jsxs("button",{className:"sa-interrupt-btn sa-interrupt-btn-primary",disabled:!l,onClick:u,children:[d.jsx(X,{name:"check",size:14})," 提交"]}),d.jsx("button",{className:"sa-interrupt-btn sa-interrupt-btn-secondary",onClick:()=>t({action:"cancel"}),children:"取消"})]}),n&&d.jsx("div",{className:"sa-interrupt-submitted",children:"已提交"})]})}function Dr(e){return typeof e=="string"?{value:e,label:e}:e}function jd(e,t,n,r){switch(e.type){case"textarea":return d.jsx("textarea",{className:"sa-interrupt-textarea",value:t,onChange:i=>n(i.target.value),placeholder:e.placeholder,rows:3,disabled:r});case"select":{const i=(e.options??[]).map(Dr);return d.jsxs("select",{className:"sa-interrupt-select",value:t,onChange:s=>n(s.target.value),disabled:r,children:[d.jsx("option",{value:"",children:"请选择"}),i.map(s=>d.jsx("option",{value:s.value,children:s.label},s.value))]})}case"multiSelect":{const i=(e.options??[]).map(Dr),s=Array.isArray(t)?t:[],a=o=>{r||n(s.includes(o)?s.filter(l=>l!==o):[...s,o])};return d.jsx("div",{className:"sa-interrupt-options",children:i.map(o=>d.jsx("button",{type:"button",className:`sa-interrupt-option ${s.includes(o.value)?"sa-interrupt-option-selected":""}`,disabled:r,onClick:()=>a(o.value),children:o.label},o.value))})}case"password":return d.jsx("input",{className:"sa-interrupt-input",type:"password",value:t,onChange:i=>n(i.target.value),placeholder:e.placeholder,disabled:r});default:return d.jsx("input",{className:"sa-interrupt-input",type:e.type==="number"?"number":e.type==="date"?"date":"text",value:t,onChange:i=>n(i.target.value),placeholder:e.placeholder,disabled:r})}}function ia({interrupt:e,resolved:t,response:n,onRespond:r}){const i=t,s=n==null?void 0:n.value;switch(e.interruptType){case"confirm":return d.jsx(bd,{interrupt:e,onRespond:r,disabled:i,answeredAction:n==null?void 0:n.action});case"approve":return d.jsx(wd,{interrupt:e,onRespond:r,disabled:i,answeredAction:n==null?void 0:n.action});case"select":return d.jsx(kd,{interrupt:e,onRespond:r,disabled:i,initialValue:s});case"multiSelect":return d.jsx(Cd,{interrupt:e,onRespond:r,disabled:i,initialValue:s});case"input":return d.jsx(Sd,{interrupt:e,onRespond:r,disabled:i,initialValue:s});case"form":return d.jsx(Ed,{interrupt:e,onRespond:r,disabled:i,initialValue:s});default:return d.jsxs("div",{className:"sa-interrupt-unknown",children:["未知的交互类型: ",e.interruptType]})}}const Id=[{value:1,label:"事实错误"},{value:2,label:"逻辑问题"},{value:3,label:"不相关"},{value:4,label:"信息过时"},{value:5,label:"冗长啰嗦"},{value:6,label:"难以理解"}];function aa({message:e,onCopy:t,onRegenerate:n,onFeedback:r}){const{status:i,cancelFeedback:s}=ke(),[a,o]=k.useState(null),[l,u]=k.useState(!1),[p,c]=k.useState(!1),h=k.useRef(null),f=k.useCallback(()=>{t(),u(!0),setTimeout(()=>u(!1),2e3)},[t]),g=k.useCallback(()=>{a==="like"?(o(null),s(e.id)):(o("like"),c(!1),r==null||r(e.id,"like"))},[a,e.id,r,s]),w=k.useCallback(()=>{a==="dislike"?(o(null),c(!1),s(e.id)):c(!0)},[a,e.id,s]),S=k.useCallback((E,C)=>{o("dislike"),c(!1),r==null||r(e.id,"dislike",{reason:E,remark:(C==null?void 0:C.trim())||void 0})},[e.id,r]),b=k.useCallback(()=>{c(!1)},[]);return k.useEffect(()=>{if(!p)return;const E=T=>{h.current&&!h.current.contains(T.target)&&c(!1)},C=T=>{T.key==="Escape"&&c(!1)};return document.addEventListener("mousedown",E),document.addEventListener("keydown",C),()=>{document.removeEventListener("mousedown",E),document.removeEventListener("keydown",C)}},[p]),i!=="ready"&&i!=="error"?null:d.jsxs("div",{className:"sa-action-bar",children:[d.jsxs("button",{className:"sa-action-btn",onClick:f,title:"复制",children:[d.jsx(X,{name:l?"circle-check":"copy",size:14})," ",l?"已复制":"复制"]}),n&&d.jsxs("button",{className:"sa-action-btn",onClick:n,title:"重新生成",children:[d.jsx(X,{name:"refresh-cw",size:14})," 重新生成"]}),r&&d.jsxs(d.Fragment,{children:[d.jsx("span",{className:"sa-action-divider"}),d.jsx("button",{className:`sa-action-btn ${a==="like"?"sa-action-btn-active":""}`,onClick:g,title:"有用","aria-label":"点赞",children:d.jsx(X,{name:"thumbs-up",size:14})}),d.jsx("button",{className:`sa-action-btn ${a==="dislike"?"sa-action-btn-active":""}`,onClick:w,title:"无用","aria-label":"踩","aria-expanded":p,"aria-haspopup":"dialog",children:d.jsx(X,{name:"thumbs-down",size:14})})]}),p&&d.jsx("div",{ref:h,children:d.jsx(zd,{onSubmit:S,onCancel:b})})]})}function zd({onSubmit:e,onCancel:t}){const[n,r]=k.useState(void 0),[i,s]=k.useState("");return d.jsxs("div",{className:"sa-dislike-panel",children:[d.jsx("div",{className:"sa-dislike-panel-title",children:"请选择不满意的原因(可选)"}),d.jsx("div",{className:"sa-dislike-reasons",children:Id.map(a=>d.jsx("button",{className:`sa-dislike-reason-btn ${n===a.value?"active":""}`,onClick:()=>r(n===a.value?void 0:a.value),children:a.label},a.value))}),d.jsx("textarea",{className:"sa-dislike-remark",placeholder:"补充描述(选填,≤500 字)",maxLength:500,value:i,onChange:a=>s(a.target.value),rows:2}),d.jsxs("div",{className:"sa-dislike-actions",children:[d.jsx("button",{className:"sa-dislike-submit",onClick:()=>e(n,i||void 0),children:"提交"}),d.jsx("button",{className:"sa-dislike-cancel",onClick:t,children:"取消"})]})]})}const Td=/^(https?:\/\/|data:|blob:|\/\/|\/|\.\/|\.\.\/)/;function Lr({src:e,alt:t}){return e?Td.test(e)?d.jsx("img",{src:e,alt:t??"",className:"sa-msg-avatar",draggable:!1}):d.jsx("span",{className:"sa-msg-avatar sa-msg-avatar-text",children:e}):null}function sa({message:e,isStreaming:t,isLast:n,slots:r,avatar:i,artifactPreview:s,showTimestamp:a}){const{regenerate:o,feedback:l,respondToInterrupt:u}=ke(),p=k.useCallback(()=>{var L;const T=e.parts.filter(v=>v.type==="text").map(v=>v.content).join(`
30
- `);(L=navigator.clipboard)==null||L.writeText(T).catch(()=>{})},[e]),c=e.role==="user",h=r.Message;if(h)return d.jsx(h,{message:e,isStreaming:t,isLast:n,avatar:i,slots:r,onCopy:p,onRegenerate:o,onFeedback:l,showTimestamp:a});const f=r.TextPart??Qi,g=r.ThinkingPart??Zi,w=r.ToolCallPart??ea,S=r.ToolResultPart??ta,b=r.ErrorPart??na,E=r.ActionBar??aa,C=!c&&e.parts.some(T=>T.type==="text"&&T.content);return d.jsxs("div",{className:`sa-message ${c?"sa-message-user":"sa-message-assistant"}`,children:[!c&&d.jsx(Lr,{src:(i==null?void 0:i.assistant)||(t&&n?ae.assistantAvatarGenerating:ae.assistantAvatar),alt:"AI"}),d.jsxs("div",{className:"sa-message-content",children:[a&&d.jsx("span",{className:`sa-message-time ${c?"sa-message-time-right":""}`,children:ya(e.timestamp)}),d.jsxs("div",{className:"sa-message-body",children:[e.parts.map((T,L)=>{switch(T.type){case"text":return d.jsx(f,{content:T.content},L);case"attachment":return d.jsx(xd,{attachment:T.attachment},L);case"thinking":return d.jsx(g,{content:T.content},L);case"tool_call":return d.jsx(w,{toolName:T.toolName,toolCallId:T.toolCallId,args:T.args},L);case"tool_result":return d.jsx(S,{toolName:T.toolName,toolCallId:T.toolCallId,content:T.content,artifacts:T.artifacts,renderMode:T.renderMode,html:T.html,artifactPreview:s},L);case"error":return d.jsx(b,{content:T.content,onRetry:o},L);case"interrupt":return d.jsx(ia,{interrupt:T.interrupt,resolved:T.resolved??!1,response:T.response,onRespond:v=>u(T.interrupt.interruptId,v)},L);default:return null}}),t&&n&&!c&&!C&&d.jsx("span",{className:"sa-thinking-indicator",children:"思考中…"}),!c&&!t&&C&&d.jsx(E,{message:e,onCopy:p,onRegenerate:n?o:void 0,onFeedback:l})]})]}),c&&(i==null?void 0:i.user)&&d.jsx(Lr,{src:i.user,alt:"用户"})]})}function oa({message:e,suggestedPrompts:t,onPromptClick:n,capabilities:r,quickLinks:i,logo:s,openPanel:a}){const o=l=>{if(l.onClick){l.onClick();return}const u=l.action;if(!u){l.prompt&&n(l.prompt);return}a==null||a(u.type==="link"?u:{...u,title:u.title??l.label})};return d.jsxs("div",{className:"flex flex-col gap-8 py-2",children:[d.jsxs("div",{className:"flex flex-col items-center gap-1 opacity-0 animate-sa-home-fade-in",children:[d.jsx("img",{src:s||ae.logo,alt:"AI 助手",className:"block max-w-16 shrink-0 animate-sa-logo-float",draggable:!1}),d.jsx("h3",{className:"sa-shimmer-text m-0 mb-1 text-[18px] font-bold leading-[1.3] text-[#333] animate-sa-title-shimmer",children:e||"你好!有什么可以帮你的?"})]}),r&&r.length>0&&d.jsx("div",{className:"flex flex-col items-start gap-4 opacity-0 animate-sa-home-fade-in",style:{animationDelay:"150ms"},children:r.map(l=>d.jsxs("div",{className:"inline-flex w-full max-w-full min-w-0 items-center gap-[7px]",children:[l.icon&&d.jsx("img",{src:l.icon,alt:"",className:"h-[18px] w-[18px] shrink-0 object-contain",draggable:!1}),d.jsx("span",{className:"shrink-0 text-[14px] leading-[1.4] text-[#333]",children:l.label}),l.desc&&d.jsxs(d.Fragment,{children:[d.jsx("span",{className:"h-[13px] w-px shrink-0 bg-[#DCDCDC]"}),d.jsx("span",{className:"min-w-0 overflow-hidden text-ellipsis whitespace-nowrap text-[14px] leading-[1.4] text-[#9A9A9A]",children:l.desc})]})]},l.label))}),t&&t.length>0&&d.jsx("div",{className:"flex flex-col items-start gap-3",children:t.map((l,u)=>d.jsxs("button",{type:"button",className:"sa-chip inline-flex h-7 items-center gap-1 rounded-md px-3 text-[14px] leading-none text-[#333] opacity-0 transition-colors animate-sa-chip-in",style:{animationDelay:`${300+u*130}ms`},onClick:()=>n(l),children:[d.jsx("span",{className:"sa-chip-text overflow-hidden text-ellipsis whitespace-nowrap",children:l}),d.jsx("svg",{width:13,height:13,viewBox:"0 0 14 14",fill:"none",className:"shrink-0 text-[#9A9A9A]","aria-hidden":"true",children:d.jsx("path",{d:"M5 3L9 7L5 11",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})]},`${l}-${u}`))}),i&&i.length>0&&d.jsxs("div",{className:"opacity-0 animate-sa-home-fade-in",style:{animationDelay:"420ms"},children:[d.jsx("div",{className:"mb-3 text-[14px] leading-none text-[#A0A0A0]",children:"快速查看"}),d.jsx("div",{className:"flex flex-wrap items-center gap-[22px]",children:i.map(l=>d.jsxs("button",{type:"button",className:"inline-flex items-center gap-[7px] rounded-md px-1 py-1 transition-colors hover:bg-[#F5F5F5]",onClick:()=>o(l),children:[l.icon&&d.jsx("span",{className:"flex h-[18px] w-[18px] shrink-0 items-center justify-center opacity-70",children:d.jsx("img",{src:l.icon,alt:"",width:18,height:18,draggable:!1})}),d.jsx("span",{className:"text-[14px] leading-none text-[#333] transition-colors hover:text-[#1881F0]",children:l.label})]},l.label))})]})]})}function Dn({slots:e,welcomeMessage:t,suggestedPrompts:n,avatar:r,artifactPreview:i,capabilities:s,quickLinks:a,logo:o,showTimestamp:l}){const{messages:u,status:p,sendMessage:c,openPanel:h}=ke(),{containerRef:f}=Vr([u]),g=p==="streaming",w=e.WelcomeScreen??oa,S=e.AppendContainer;return u.length===0?d.jsxs("div",{className:"sa-thread",ref:f,children:[d.jsx(w,{message:t,suggestedPrompts:n,onPromptClick:c,capabilities:s,quickLinks:a,logo:o,openPanel:h}),S&&d.jsx(S,{openPanel:h})]}):d.jsx("div",{className:"sa-thread",ref:f,children:u.map((b,E)=>d.jsx(sa,{message:b,isStreaming:g,isLast:E===u.length-1,slots:e,avatar:r,artifactPreview:i,showTimestamp:l},b.id))})}function Ad({items:e,activeIndex:t,onSelect:n}){const r=k.useRef(null);return k.useEffect(()=>{var s;const i=(s=r.current)==null?void 0:s.children[t];i==null||i.scrollIntoView({block:"nearest"})},[t]),e.length===0?d.jsx("div",{className:"sa-slash-menu",children:d.jsx("div",{className:"sa-slash-menu-empty",children:"没有匹配的技能"})}):d.jsx("div",{className:"sa-slash-menu",ref:r,children:e.map((i,s)=>d.jsxs("div",{className:`sa-slash-menu-item${s===t?" sa-slash-menu-item--active":""}`,onMouseDown:a=>{a.preventDefault(),n(i)},children:[d.jsxs("span",{className:"sa-slash-menu-item-name",children:["/",i.name]}),(i.displayName||i.description)&&d.jsx("span",{className:"sa-slash-menu-item-desc",children:i.displayName||i.description})]},i.code))})}function Nd({sdk:e,input:t,onSelect:n}){const[r,i]=k.useState([]),[s,a]=k.useState(!1),[o,l]=k.useState(0),u=k.useRef(!1);k.useEffect(()=>{u.current||(u.current=!0,e.listSkills().then(i).catch(()=>i([])))},[e]);const p=/^\/\S*$/.test(t);k.useEffect(()=>{a(p)},[p]),k.useEffect(()=>{p&&l(0)},[t,p]);const c=t.startsWith("/")?t.slice(1).toLowerCase():"",h=k.useMemo(()=>r.filter(C=>!c||C.code.toLowerCase().includes(c)||C.name.toLowerCase().includes(c)||C.displayName&&C.displayName.toLowerCase().includes(c)),[r,c]),f=k.useRef(s),g=k.useRef(h),w=k.useRef(o),S=k.useRef(n);f.current=s,g.current=h,w.current=o,S.current=n;const b=k.useCallback(C=>{if(!f.current||g.current.length===0)return!1;switch(C.key){case"ArrowDown":return C.preventDefault(),l(T=>(T+1)%g.current.length),!0;case"ArrowUp":return C.preventDefault(),l(T=>(T-1+g.current.length)%g.current.length),!0;case"Enter":case"Tab":return C.preventDefault(),S.current(g.current[w.current]),a(!1),!0;case"Escape":return C.preventDefault(),a(!1),!0;default:return!1}},[]),E=k.useCallback(()=>a(!1),[]);return{isOpen:s,items:h,activeIndex:o,handleKeyDown:b,close:E}}const Dd=10;function Ld({size:e=16}){return d.jsx("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:d.jsx("path",{d:"M21.44 11.05l-9.19 9.19a6 6 0 0 1-8.49-8.49l9.19-9.19a4 4 0 0 1 5.66 5.66l-9.2 9.19a2 2 0 0 1-2.83-2.83l8.49-8.48"})})}function Ln(){const{status:e,sendMessage:t,stop:n,sdk:r,attachmentUploader:i,nosUpload:s}=ke(),[a,o]=k.useState(""),[l,u]=k.useState([]),p=k.useRef(null),c=k.useRef(null),h=!!i||!!s,f=e==="streaming"||e==="submitted",g=l.filter(x=>x.attachment),w=l.some(x=>!x.attachment&&x.status==="uploading"),S=!!a.trim()||l.length>0||f,b=!f&&!w&&(a.trim().length>0||g.length>0),E=k.useCallback(x=>{o(`/${x.name} `),setTimeout(()=>{const I=p.current;I&&(I.focus(),I.selectionStart=I.selectionEnd=I.value.length)},0)},[]),C=Nd({sdk:r,input:a,onSelect:E}),T=k.useCallback(x=>{const I=Array.from(x.target.files??[]);if(x.target.value="",!h||I.length===0)return;const M=Dd-l.length,$=I.slice(0,Math.max(0,M));if($.length===0)return;const P=$.map(A=>({key:`${A.name}_${A.size}_${Date.now()}_${Math.random().toString(36).slice(2,6)}`,file:A,status:"uploading"}));u(A=>[...A,...P]);for(const{key:A,file:V}of P)(i||Oe.createNosUploader({baseURL:s.baseURL,headers:s.headers,trunkSize:s.trunkSize,onProgress:O=>u(U=>U.map(m=>m.key===A?{...m,percent:O}:m))}))(V).then(O=>{u(U=>U.map(m=>m.key===A?{...m,attachment:{...O,filename:O.filename||V.name,size:O.size??V.size,mime:O.mime??V.type}}:m))}).catch(O=>{u(U=>U.map(m=>m.key===A?{...m,status:"error",errorMsg:O instanceof Error?O.message:String(O)}:m))})},[i,s,l]),L=k.useCallback(x=>{u(I=>I.filter(M=>M.key!==x))},[]),v=k.useCallback(()=>{if(!b)return;const x=a.trim(),I=g.map(M=>M.attachment);t(x,I.length>0?I:void 0),o(""),u([]),p.current&&(p.current.style.height="auto")},[b,a,g,t]),N=k.useCallback(x=>{C.handleKeyDown(x)||x.key==="Enter"&&!x.shiftKey&&(x.preventDefault(),v())},[v,C.handleKeyDown]),R=k.useCallback(x=>{o(x.target.value);const I=x.target;I.style.height="auto",I.style.height=Math.min(I.scrollHeight,90)+"px"},[]),_=k.useCallback(()=>{var x;f||(x=p.current)==null||x.focus()},[f]);return d.jsxs("div",{className:"relative z-[2] shrink-0 px-[15px] pb-2.5",children:[C.isOpen&&d.jsx(Ad,{items:C.items,activeIndex:C.activeIndex,onSelect:E}),l.length>0&&d.jsx("div",{className:"sa-attachment-tray mb-1.5",onClick:x=>x.stopPropagation(),children:l.map(x=>d.jsxs("span",{className:`sa-attachment-tray-chip ${x.status==="error"?"sa-attachment-tray-chip-error":""}`,title:x.status==="error"?`上传失败:${x.errorMsg??""}`:x.file.name,children:[d.jsx(X,{name:"file-text",size:13,color:x.status==="error"?"#ef4444":"#6366f1"}),d.jsx("span",{className:"sa-attachment-tray-chip-name",children:x.file.name}),d.jsx("span",{className:"sa-attachment-tray-chip-size",children:x.attachment?ra(x.file.size):x.status==="error"?"失败":x.percent!=null?`${Math.min(99,Math.round(x.percent))}%`:"上传中…"}),d.jsx("button",{type:"button",className:"sa-attachment-tray-chip-remove","aria-label":`移除附件 ${x.file.name}`,onClick:()=>L(x.key),children:"✕"})]},x.key))}),d.jsxs("form",{className:`sa-input-form relative flex min-h-[70px] cursor-text items-start gap-2 rounded-[5px] p-2 ${S?"sa-input-form-active":""}`,onClick:_,onSubmit:x=>{x.preventDefault(),v()},children:[h&&!f&&d.jsx("button",{type:"button",className:"sa-attach-btn absolute bottom-[8px] left-[8px]","aria-label":"添加附件",title:"添加附件",onClick:()=>{var x;return(x=c.current)==null?void 0:x.click()},children:d.jsx(Ld,{size:15})}),d.jsx("input",{ref:c,type:"file",multiple:!0,className:"hidden",onChange:T,"aria-label":"选择附件"}),d.jsx("div",{className:"flex min-w-0 flex-1 flex-col",children:d.jsx("div",{className:"flex items-end",children:d.jsx("textarea",{ref:p,className:`sa-input-field min-h-[34px] flex-1 resize-none border-none bg-transparent p-0 text-[14px] leading-[1.5] text-[#333] outline-none placeholder:text-[#B8B8B8] ${h?"pl-[4px]":""}`,value:a,onChange:R,onKeyDown:N,placeholder:"请输入你想要了解的关键词",rows:1,disabled:f})})}),f?d.jsx("button",{type:"button",className:"sa-send-btn sa-send-btn-active","aria-label":"停止生成",title:"停止生成",onClick:n,children:d.jsx("span",{className:"sa-stop-icon"})}):d.jsx("button",{type:"submit",className:`sa-send-btn ${b?"sa-send-btn-active":""}`,"aria-label":"发送",title:"发送",disabled:!b,children:d.jsx("img",{src:ae.sendSolid,alt:"发送",width:14,height:14,draggable:!1})})]}),d.jsx("div",{className:"mt-3 text-center text-[11px] leading-none text-[#B8B8B8]",children:"所有内容均由AI生成仅供参考"})]})}function Md({artifact:e}){const[t,n]=k.useState(null),[r,i]=k.useState(!0),[s,a]=k.useState(null);return k.useEffect(()=>{let o=!1;i(!0),a(null),n(null);async function l(){try{if(e.type==="pdf"){o||i(!1);return}if(e.type==="html"){const u=await fetch(e.url);if(!u.ok)throw new Error(`HTTP ${u.status}`);const p=await u.text(),c=(await Promise.resolve().then(()=>require("./purify.es-Dsdnkgrg.cjs"))).default;o||(n(c.sanitize(p,{FORCE_BODY:!0,ADD_ATTR:["target"]})),i(!1));return}if(e.type==="docx"){const u=await fetch(e.url);if(!u.ok)throw new Error(`HTTP ${u.status}`);const p=await u.arrayBuffer(),h=await(await Promise.resolve().then(()=>require("./mammoth.browser-BX8glWVC.cjs")).then(g=>g.mammoth_browser)).convertToHtml({arrayBuffer:p}),f=(await Promise.resolve().then(()=>require("./purify.es-Dsdnkgrg.cjs"))).default;o||(n(f.sanitize(h.value,{FORCE_BODY:!0,ADD_ATTR:["target"]})),i(!1));return}o||(i(!1),a(`不支持预览「${e.type}」类型`))}catch(u){o||(i(!1),a(u instanceof Error?u.message:"加载失败"))}}return l(),()=>{o=!0}},[e]),r?d.jsx("div",{className:"sa-drawer-preview-loading",children:"加载中"}):s?d.jsxs("div",{className:"sa-drawer-preview-error",children:[s,d.jsx("button",{className:"sa-drawer-btn-sm",onClick:()=>void kt(e),children:"下载查看"})]}):e.type==="pdf"?d.jsx("iframe",{src:e.url,title:e.filename,className:"sa-drawer-preview-iframe",sandbox:"allow-scripts"}):t!==null?d.jsx("div",{className:"sa-drawer-preview-html-scroll",children:d.jsx("div",{className:"sa-drawer-preview-html sa-text-part",dangerouslySetInnerHTML:{__html:t}})}):null}function Rd({artifacts:e,initialArtifact:t,onClose:n}){const[r,i]=k.useState(t?{mode:"preview",artifact:t}:{mode:"list"}),[s,a]=k.useState(!1),o=k.useRef(null),[l,u]=k.useState(340),p=k.useRef(null);k.useEffect(()=>{t&&(o.current&&(clearTimeout(o.current),o.current=null,a(!1)),i({mode:"preview",artifact:t}))},[t]);const c=k.useCallback(()=>{a(!0),o.current=setTimeout(()=>{o.current=null,n()},240)},[n]);k.useEffect(()=>()=>{var w;o.current&&clearTimeout(o.current),(w=p.current)==null||w.call(p)},[]);const h=k.useCallback(w=>{i({mode:"preview",artifact:w})},[]),f=k.useCallback(()=>{i({mode:"list"})},[]);k.useEffect(()=>{const w=S=>{S.key==="Escape"&&c()};return document.addEventListener("keydown",w),()=>document.removeEventListener("keydown",w)},[c]);const g=k.useCallback(w=>{w.preventDefault();const S=w.clientX,b=l,E=T=>{const L=S-T.clientX;u(Math.max(240,Math.min(window.innerWidth*.7,b+L)))},C=()=>{document.removeEventListener("mousemove",E),document.removeEventListener("mouseup",C),document.body.style.cursor="",document.body.style.userSelect="",p.current=null};document.body.style.cursor="col-resize",document.body.style.userSelect="none",document.addEventListener("mousemove",E),document.addEventListener("mouseup",C),p.current=C},[l]);return d.jsxs("div",{className:`sa-artifact-drawer ${s?"sa-drawer-closing":""}`,style:{width:l},children:[d.jsx("div",{className:"sa-drawer-resize-handle",onMouseDown:g}),d.jsxs("div",{className:"sa-artifact-drawer-header",children:[r.mode==="preview"?d.jsxs(d.Fragment,{children:[d.jsx("button",{className:"sa-drawer-btn",onClick:f,title:"返回列表","aria-label":"返回列表",children:d.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:d.jsx("path",{d:"M15 18l-6-6 6-6"})})}),d.jsx("span",{className:"sa-artifact-drawer-title",children:r.artifact.filename})]}):d.jsxs(d.Fragment,{children:[d.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",style:{flexShrink:0},children:[d.jsx("path",{d:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"}),d.jsx("polyline",{points:"14 2 14 8 20 8"})]}),d.jsx("span",{className:"sa-artifact-drawer-title",children:"会话产物"})]}),d.jsx("div",{style:{flex:1}}),r.mode==="preview"&&d.jsx("button",{className:"sa-drawer-btn",onClick:()=>void kt(r.artifact),title:"下载","aria-label":"下载",children:d.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:d.jsx("path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4M7 10l5 5 5-5M12 15V3"})})}),d.jsx("button",{className:"sa-drawer-btn",onClick:c,title:"关闭","aria-label":"关闭",children:d.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:d.jsx("path",{d:"M18 6L6 18M6 6l12 12"})})})]}),d.jsx("div",{className:"sa-artifact-drawer-body",children:r.mode==="list"?e.length===0?d.jsx("div",{className:"sa-drawer-empty",children:"暂无产物"}):d.jsx("ul",{className:"sa-drawer-file-list",role:"list",children:e.map((w,S)=>d.jsxs("li",{className:"sa-drawer-file-card",onClick:()=>h(w),onKeyDown:b=>{(b.key==="Enter"||b.key===" ")&&(b.preventDefault(),h(w))},tabIndex:0,role:"button","aria-label":`预览 ${w.filename}`,children:[d.jsx("div",{className:"sa-drawer-file-icon",children:d.jsx("span",{className:"sa-artifact-chip-type",children:_r(w.type)})}),d.jsxs("div",{className:"sa-drawer-file-info",children:[d.jsx("span",{className:"sa-drawer-file-name",children:w.filename}),d.jsx("span",{className:"sa-drawer-file-size",children:Fr(w.size)})]}),d.jsx("button",{className:"sa-drawer-btn",title:"下载","aria-label":`下载 ${w.filename}`,onClick:b=>{b.stopPropagation(),kt(w)},children:d.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:d.jsx("path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4M7 10l5 5 5-5M12 15V3"})})})]},w.id||`artifact-${S}`))}):d.jsx("div",{className:"sa-drawer-view-enter",children:d.jsx(Md,{artifact:r.artifact})})})]})}function la({page:e,onBack:t,centered:n}){k.useEffect(()=>{const i=s=>{s.key==="Escape"&&t()};return document.addEventListener("keydown",i),()=>document.removeEventListener("keydown",i)},[t]);const r=k.isValidElement(e.component)?k.cloneElement(e.component,{close:t}):k.createElement(e.component,{close:t});return d.jsxs("div",{className:`sa-page-overlay ${n?"sa-page-overlay-centered":""}`,children:[d.jsxs("div",{className:"sa-page-overlay-bar",children:[d.jsx("button",{className:"sa-drawer-btn",onClick:t,title:"返回","aria-label":"返回",children:d.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:d.jsx("path",{d:"M15 18l-6-6 6-6"})})}),e.title&&d.jsx("span",{className:"sa-page-overlay-title",children:e.title})]}),d.jsx("div",{className:"sa-page-overlay-body",children:r})]})}const Pd="mx-auto w-full max-w-[800px]";function ua({contentClassName:e,centered:t,composerClassName:n,thread:r,composer:i,artifactPreview:s}){const{activePanel:a,closePanel:o,messagesLoading:l,isArtifactDrawerOpen:u,allArtifacts:p,activePreviewArtifact:c,toggleArtifactDrawer:h}=ke();if(a)return d.jsx(la,{page:a,onBack:o,centered:t});const f=t?Pd:"";return d.jsxs(d.Fragment,{children:[d.jsxs("div",{className:`${e} ${f}`,children:[l?d.jsxs("div",{className:"sa-messages-loading",children:[d.jsx("span",{className:"sa-loading-spinner"}),"加载对话..."]}):r,s&&u&&d.jsx(Rd,{artifacts:p,initialArtifact:c,onClose:h})]}),n?d.jsx("div",{className:`${n} ${f}`,children:i}):i]})}function Fd({isOpen:e,onClose:t,title:n,slots:r,welcomeMessage:i,suggestedPrompts:s,avatar:a,artifactPreview:o,capabilities:l,quickLinks:u,logo:p,defaultWidth:c,defaultHeight:h,showTimestamp:f}){const{status:g,sendMessage:w,stop:S,toggleThreadList:b,setThreadListOpen:E,isThreadListOpen:C,toggleArtifactDrawer:T,allArtifacts:L,activePanel:v,closePanel:N,messages:R,messagesLoading:_,conversations:x,activeConversationId:I,switchConversation:M,newConversation:$,deleteConversation:P,renameConversation:A,hasMore:V,loadMoreConversations:j}=ke(),{width:O,position:U,hasCustomPosition:m,isMaximized:B,totalWidth:K,windowHeight:y,startWindowDrag:le,startResize:Ce,toggleMaximize:ne,reset:Te,setLockedHeight:ge}=xa({defaultWidth:c??ie.DEFAULT_WIDTH,defaultHeight:h??ie.DEFAULT_HEIGHT,sidebarWidth:0}),Se=k.useRef(null),Ee=k.useRef(null),Ae=!_&&R.length===0,He=!_&&R.length>0,Ue=!!v;k.useEffect(()=>{e||(Te(),N())},[e,Te,N]),k.useEffect(()=>{E(B?Se.current??!0:Ee.current??!1)},[B,E]),k.useEffect(()=>{He||ge(null)},[He,ge]);const Dt=ba({enabled:e&&He&&!B&&!Ue,contentSelector:".sa-panel-content",defaultHeight:h??ie.DEFAULT_HEIGHT,onHeightChange:ge});if(!e)return null;const Ke=r.Header,Qe=r.Composer,Le=r.ThreadList,Lt=()=>{const Y=!C;b(),B?Se.current=Y:Ee.current=Y},Je=200,Ze=C&&!B,me="var(--sa-radius, 16px)",ht=Ze?`0px ${me} ${me} 0px`:`${me} ${me} ${me} ${me}`,Mt=m?U.x:window.innerWidth-K-20,Ve=Math.min(Je,Math.max(0,Mt-1)),Rt=m?{width:`${K}px`,height:`${y}px`,left:`${U.x}px`,top:`${U.y}px`}:{width:`${K}px`,height:`${y}px`,right:"20px",bottom:"20px"},z={title:n,onClose:t,onToggleThreadList:Lt,isMaximized:B,onToggleMaximize:ne,showHome:He&&!Ue,onHome:$,artifactCount:Ue||!o?0:L.length,onToggleArtifactDrawer:Ue||!o?void 0:T},F={conversations:x,activeSessionId:I,onSwitch:M,onNew:$,onDelete:P,onRename:A,hasMore:V,onLoadMore:j},q=d.jsxs("div",{className:`relative flex min-w-0 flex-col bg-white ${B?"flex-1":"h-full shrink-0"}`,style:B?void 0:{width:`${O}px`,borderRadius:ht,overflow:"hidden"},children:[Ae&&d.jsxs(d.Fragment,{children:[d.jsx("div",{className:"sa-home-gradient pointer-events-none absolute inset-x-0 top-0 z-0 h-[238px] opacity-10"}),d.jsx("div",{className:"sa-home-gradient-fade pointer-events-none absolute inset-x-0 top-0 z-[1] h-[238px]"})]}),d.jsx("div",{className:`relative z-20 ${Ae||B?"":"bg-white"} ${B?"cursor-default":"cursor-grab active:cursor-grabbing"}`,onMouseDown:B?void 0:le,children:Ke?d.jsx(Ke,{...z}):d.jsx(Hr,{...z})}),d.jsx(ua,{contentClassName:`sa-panel-content relative z-[2] ${Ae?"sa-home-view":""}`,centered:B,composerClassName:"shrink-0",artifactPreview:o,thread:d.jsx(Dn,{slots:r,welcomeMessage:i,suggestedPrompts:s,avatar:a,artifactPreview:o,capabilities:l,quickLinks:u,logo:p,showTimestamp:f}),composer:Qe?d.jsx(Qe,{status:g,onSend:w,onStop:S}):d.jsx(Ln,{})})]});return B?d.jsx("div",{className:"fixed inset-0 z-[var(--sa-z-index,9999)] flex animate-sa-fade-in flex-col justify-end bg-black/30",children:d.jsxs("div",{className:"flex h-[calc(100%_-_48px)] w-full animate-sa-slide-up-full flex-row overflow-hidden bg-[#F5F5F5] shadow-[0_-12px_48px_rgba(0,0,0,0.25)]",style:{borderRadius:"var(--sa-radius, 16px) var(--sa-radius, 16px) 0px 0px"},children:[C&&(Le?d.jsx(Le,{...F}):d.jsx(Zt,{width:220})),q]})}):d.jsxs("div",{ref:Dt,className:"fixed z-[var(--sa-z-index,9999)] flex animate-sa-window-in flex-row overflow-visible border border-[#DADADA] bg-white shadow-[0_12px_36px_rgba(0,0,0,0.18)]",style:{...Rt,borderRadius:ht},children:[d.jsx("div",{className:"sa-resize-handle absolute bottom-0 left-[-3px] top-0 z-20 w-[6px] cursor-col-resize",onMouseDown:Y=>Ce(Y)}),Ze&&(Le?d.jsx("div",{className:"absolute -top-px -bottom-px -left-px z-10 overflow-hidden border border-r-0 border-[#DADADA] bg-[#FAFAFA] shadow-[0_12px_36px_rgba(0,0,0,0.18)]",style:{width:Ve,transform:`translateX(-${Ve}px)`,borderRadius:`${me} 0px 0px ${me}`},children:d.jsx(Le,{...F})}):d.jsx("div",{className:"absolute -top-px -bottom-px -left-px z-10 overflow-hidden border border-r-0 border-[#DADADA] bg-[#FAFAFA] shadow-[0_12px_36px_rgba(0,0,0,0.18)]",style:{width:Ve,transform:`translateX(-${Ve}px)`,borderRadius:`${me} 0px 0px ${me}`},children:d.jsx(Zt,{width:Je})})),q]})}const _d=()=>{};function Od({conversations:e,activeSessionId:t,onSwitch:n,onNew:r,onDelete:i,onRename:s,isCollapsed:a,onToggleCollapse:o,hasMore:l,onLoadMore:u,conversationsLoading:p}){const[c,h]=k.useState(null),[f,g]=k.useState(null),[w,S]=k.useState(""),[b,E]=k.useState(null),C=k.useRef(null);k.useEffect(()=>()=>{C.current&&clearTimeout(C.current)},[]);const T=k.useCallback((x,I)=>{I.stopPropagation(),c===x?(i(x),h(null)):(h(x),C.current&&clearTimeout(C.current),C.current=setTimeout(()=>h(null),3e3))},[c,i]),L=k.useCallback((x,I,M)=>{M.stopPropagation(),g(x),S(I??"")},[]),v=k.useCallback(x=>{w.trim()&&s(x,w.trim()),g(null)},[w,s]),N=k.useRef(null),R=k.useCallback(()=>{const x=N.current;!x||!l||!u||x.scrollHeight-x.scrollTop-x.clientHeight<50&&u()},[l,u]),_=k.useMemo(()=>Ur(e),[e]);return a?d.jsxs("div",{className:"flex w-12 shrink-0 flex-col items-center gap-1 border-r border-[#ECECEC] bg-[#FAFAFA] py-3",children:[d.jsx("button",{type:"button",className:"sa-tip relative flex h-7 w-7 items-center justify-center rounded-md text-[#666] transition-colors hover:bg-white","data-tooltip":"展开",onClick:o,children:d.jsx(X,{name:"panel-left",size:18})}),d.jsx("button",{type:"button",className:"sa-tip relative flex h-7 w-7 items-center justify-center rounded-md text-[#666] transition-colors hover:bg-white","data-tooltip":"新建对话",onClick:()=>{r(),o()},children:d.jsx("img",{src:ae.messageCreate,alt:"",width:18,height:18})})]}):d.jsxs("div",{className:"relative flex w-[220px] shrink-0 flex-col border-r border-[#ECECEC] bg-[#FAFAFA] p-3",children:[d.jsxs("div",{className:"mb-4 flex shrink-0 items-center gap-1.5",children:[d.jsxs("button",{type:"button",className:"sa-new-chat flex h-8 flex-1 items-center justify-center gap-2 rounded-md text-[14px] font-medium transition-colors",onClick:r,children:[d.jsx("img",{src:ae.messageCreate,alt:"",width:18,height:18}),d.jsx("span",{className:"sa-new-chat-text whitespace-nowrap",children:"新建对话"})]}),d.jsx("button",{type:"button",className:"sa-tip relative flex h-7 w-7 shrink-0 items-center justify-center rounded-md text-[#666] transition-colors hover:bg-white","data-tooltip":"收起侧边栏",onClick:o,children:d.jsx(X,{name:"panel-left-close",size:16})})]}),d.jsxs("div",{className:"px-1 pb-2.5",children:[d.jsx("div",{className:"mb-1 text-[14px] font-semibold text-[#333]",children:"历史对话"}),d.jsx("div",{className:"text-[11px] text-[#999]",children:"展示最近的会话记录"})]}),d.jsxs("div",{ref:N,className:"flex-1 overflow-y-auto",onScroll:R,children:[p&&e.length===0&&d.jsx("div",{className:"px-0.5 py-2 text-[12px] text-[#999]",children:"加载中..."}),!p&&e.length===0&&d.jsx("div",{className:"px-0.5 py-2 text-[12px] text-[#999]",children:"暂无记录"}),_.map(x=>d.jsxs("div",{className:"mb-1",children:[d.jsx("div",{className:"px-1 pb-1 pt-2 text-[11px] text-[#A0A0A0]",children:x.label}),x.items.map(I=>{const M=I.sessionId===t,$=c===I.sessionId;return d.jsx("div",{className:`group relative mb-0.5 flex h-8 w-full cursor-pointer items-center gap-1 rounded-md px-0.5 text-[13px] transition-colors ${M?"bg-[#E8F1FE]":"hover:bg-[#E8F1FE]"}`,onClick:()=>{f!==I.sessionId&&n(I.sessionId)},onMouseEnter:P=>{if(f===I.sessionId)return;const A=P.currentTarget.getBoundingClientRect();E({text:I.title||"新会话",x:A.right+8,y:A.top+A.height/2})},onMouseLeave:()=>E(null),children:f===I.sessionId?d.jsx("input",{className:"w-full rounded border border-[var(--sa-primary)] bg-white px-1.5 py-0.5 text-[12px] outline-none",value:w,onChange:P=>S(P.target.value),onBlur:()=>v(I.sessionId),onKeyDown:P=>{P.key==="Enter"&&v(I.sessionId),P.key==="Escape"&&g(null)},onClick:P=>P.stopPropagation(),autoFocus:!0}):d.jsxs(d.Fragment,{children:[d.jsx("img",{src:ae.message,alt:"",width:16,height:16,className:"shrink-0 opacity-60"}),d.jsx("span",{className:"flex-1 overflow-hidden text-ellipsis whitespace-nowrap text-left text-[#333]",children:I.title||"新会话"}),d.jsxs("span",{className:"hidden shrink-0 items-center gap-0.5 group-hover:flex",children:[d.jsx("button",{type:"button",className:"flex h-5 w-5 items-center justify-center rounded text-[#999] hover:bg-white/70 hover:text-[var(--sa-primary)]",onClick:P=>L(I.sessionId,I.title,P),title:"重命名",children:d.jsx(X,{name:"pen",size:12})}),d.jsx("button",{type:"button",className:`flex h-5 w-5 items-center justify-center rounded ${$?"bg-[#fee2e2] text-[#ef4444]":"text-[#999] hover:bg-white/70 hover:text-[#ef4444]"}`,onClick:P=>T(I.sessionId,P),title:$?"确认删除":"删除",children:d.jsx(X,{name:$?"x":"trash2",size:12})})]})]})},I.sessionId)})]},x.label)),l&&d.jsx("div",{className:"px-0.5 py-2 text-center text-[11px] text-[#C0C0C0]",children:"向下滚动加载更多"})]}),b&&d.jsx("div",{className:"pointer-events-none fixed z-[10001] whitespace-nowrap rounded border border-[#E8E8E8] bg-white px-2.5 py-1.5 text-[12px] leading-[1.4] text-[#333] shadow-[0_2px_8px_rgba(0,0,0,0.12)]",style:{left:b.x,top:b.y,transform:"translateY(-50%)"},children:b.text})]})}function ca({title:e,slots:t,welcomeMessage:n,suggestedPrompts:r,capabilities:i,quickLinks:s,logo:a,sidebarDefaultOpen:o=!0,onClose:l,avatar:u,artifactPreview:p,showTimestamp:c}){const{status:h,sendMessage:f,stop:g,conversations:w,activeConversationId:S,switchConversation:b,newConversation:E,deleteConversation:C,renameConversation:T,toggleArtifactDrawer:L,allArtifacts:v,activePanel:N,closePanel:R,hasMore:_,loadMoreConversations:x,conversationsLoading:I}=ke(),[M,$]=k.useState(o),P=k.useCallback(()=>$(U=>!U),[]),A=!!N;k.useEffect(()=>()=>R(),[R]);const V=t.ThreadList,j=t.Composer,O=t.Header;return d.jsxs("div",{className:"sa-fullpage",children:[V?d.jsx("div",{className:`sa-fp-sidebar-wrapper ${M?"":"sa-fp-sidebar-wrapper-collapsed"}`,children:d.jsx(V,{conversations:w,activeSessionId:S,onSwitch:b,onNew:E,onDelete:C,onRename:T,hasMore:_,onLoadMore:x})}):d.jsx(Od,{conversations:w,activeSessionId:S,onSwitch:b,onNew:E,onDelete:C,onRename:T,isCollapsed:!M,onToggleCollapse:P,hasMore:_,onLoadMore:x,conversationsLoading:I}),d.jsxs("div",{className:"sa-fp-main",children:[O?d.jsx(O,{title:e,onClose:l??_d,onToggleThreadList:P,artifactCount:A||!p?0:v.length,onToggleArtifactDrawer:A||!p?void 0:L}):d.jsxs("div",{className:"sa-fp-header",children:[d.jsx("div",{className:"sa-fp-header-title",children:e}),d.jsx("div",{className:"sa-fp-header-actions",children:!A&&p&&v.length>0&&d.jsxs("button",{className:"sa-fp-header-btn sa-header-btn-artifact",onClick:L,title:"会话产物",children:[d.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[d.jsx("path",{d:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"}),d.jsx("polyline",{points:"14 2 14 8 20 8"})]}),d.jsx("span",{children:"产物"})]})})]}),d.jsx(ua,{contentClassName:"sa-fp-content-row",artifactPreview:p,thread:d.jsx(Dn,{slots:t,welcomeMessage:n,suggestedPrompts:r,capabilities:i,quickLinks:s,logo:a,avatar:u,artifactPreview:p,showTimestamp:c}),composer:j?d.jsx(j,{status:h,onSend:f,onStop:g}):d.jsx(Ln,{})})]})]})}function pa(e){const{sdk:t,mode:n="floating",slots:r={},hooks:i={},welcomeMessage:s,suggestedPrompts:a,title:o="AI Assistant",initialOpen:l=!1,onOpenChange:u,sidebarDefaultOpen:p,avatar:c,artifactPreview:h,capabilities:f,quickLinks:g,logo:w,triggerLogo:S,theme:b,showTimestamp:E,attachmentUploader:C,nosUpload:T}=e,[L,v]=k.useState(l);k.useEffect(()=>{v(l)},[l]);const N=k.useCallback(()=>{var I,M;const x=!L;v(x),u==null||u(x),x?(I=i.onOpen)==null||I.call(i):(M=i.onClose)==null||M.call(i)},[L,i,u]),R=k.useCallback(()=>{var x;v(!1),u==null||u(!1),(x=i.onClose)==null||x.call(i)},[i,u]),_=r.Trigger??$r;return n==="fullpage"?L?d.jsx(Jt,{sdk:t,hooks:i,attachmentUploader:C,nosUpload:T,children:d.jsx(ca,{title:o,slots:r,welcomeMessage:s,suggestedPrompts:a,capabilities:f,quickLinks:g,logo:w,sidebarDefaultOpen:p,onClose:R,avatar:c,artifactPreview:h,showTimestamp:E})}):null:d.jsxs(Jt,{sdk:t,hooks:i,attachmentUploader:C,nosUpload:T,children:[d.jsx(_,{isOpen:L,onClick:N,triggerLogo:S}),d.jsx(Fd,{isOpen:L,onClose:R,title:o,slots:r,welcomeMessage:s,suggestedPrompts:a,avatar:c,artifactPreview:h,capabilities:f,quickLinks:g,logo:w,defaultWidth:b==null?void 0:b.panelWidth,defaultHeight:b==null?void 0:b.panelHeight,showTimestamp:E})]})}const da=`
27
+ `,...s.current()});return/^[\t ]/.test(u)&&(u=ct(u.charCodeAt(0))+u.slice(1)),u=u?a+" "+u:a,n.options.closeAtx&&(u+=" "+a),l(),o(),u}Li.peek=rp;function Li(e){return e.value||""}function rp(){return"<"}Mi.peek=ip;function Mi(e,t,n,r){const i=zn(n),s=i==='"'?"Quote":"Apostrophe",a=n.enter("image");let o=n.enter("label");const l=n.createTracker(r);let u=l.move("![");return u+=l.move(n.safe(e.alt,{before:u,after:"]",...l.current()})),u+=l.move("]("),o(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(o=n.enter("destinationLiteral"),u+=l.move("<"),u+=l.move(n.safe(e.url,{before:u,after:">",...l.current()})),u+=l.move(">")):(o=n.enter("destinationRaw"),u+=l.move(n.safe(e.url,{before:u,after:e.title?" ":")",...l.current()}))),o(),e.title&&(o=n.enter(`title${s}`),u+=l.move(" "+i),u+=l.move(n.safe(e.title,{before:u,after:i,...l.current()})),u+=l.move(i),o()),u+=l.move(")"),a(),u}function ip(){return"!"}Ri.peek=ap;function Ri(e,t,n,r){const i=e.referenceType,s=n.enter("imageReference");let a=n.enter("label");const o=n.createTracker(r);let l=o.move("![");const u=n.safe(e.alt,{before:l,after:"]",...o.current()});l+=o.move(u+"]["),a();const p=n.stack;n.stack=[],a=n.enter("reference");const c=n.safe(n.associationId(e),{before:l,after:"]",...o.current()});return a(),n.stack=p,s(),i==="full"||!u||u!==c?l+=o.move(c+"]"):i==="shortcut"?l=l.slice(0,-1):l+=o.move("]"),l}function ap(){return"!"}Pi.peek=sp;function Pi(e,t,n){let r=e.value||"",i="`",s=-1;for(;new RegExp("(^|[^`])"+i+"([^`]|$)").test(r);)i+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=" "+r+" ");++s<n.unsafe.length;){const a=n.unsafe[s],o=n.compilePattern(a);let l;if(a.atBreak)for(;l=o.exec(r);){let u=l.index;r.charCodeAt(u)===10&&r.charCodeAt(u-1)===13&&u--,r=r.slice(0,u)+" "+r.slice(l.index+1)}}return i+r+i}function sp(){return"`"}function Fi(e,t){const n=yn(e);return!!(!t.options.resourceLink&&e.url&&!e.title&&e.children&&e.children.length===1&&e.children[0].type==="text"&&(n===e.url||"mailto:"+n===e.url)&&/^[a-z][a-z+.-]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}_i.peek=op;function _i(e,t,n,r){const i=zn(n),s=i==='"'?"Quote":"Apostrophe",a=n.createTracker(r);let o,l;if(Fi(e,n)){const p=n.stack;n.stack=[],o=n.enter("autolink");let c=a.move("<");return c+=a.move(n.containerPhrasing(e,{before:c,after:">",...a.current()})),c+=a.move(">"),o(),n.stack=p,c}o=n.enter("link"),l=n.enter("label");let u=a.move("[");return u+=a.move(n.containerPhrasing(e,{before:u,after:"](",...a.current()})),u+=a.move("]("),l(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(l=n.enter("destinationLiteral"),u+=a.move("<"),u+=a.move(n.safe(e.url,{before:u,after:">",...a.current()})),u+=a.move(">")):(l=n.enter("destinationRaw"),u+=a.move(n.safe(e.url,{before:u,after:e.title?" ":")",...a.current()}))),l(),e.title&&(l=n.enter(`title${s}`),u+=a.move(" "+i),u+=a.move(n.safe(e.title,{before:u,after:i,...a.current()})),u+=a.move(i),l()),u+=a.move(")"),o(),u}function op(e,t,n){return Fi(e,n)?"<":"["}Oi.peek=lp;function Oi(e,t,n,r){const i=e.referenceType,s=n.enter("linkReference");let a=n.enter("label");const o=n.createTracker(r);let l=o.move("[");const u=n.containerPhrasing(e,{before:l,after:"]",...o.current()});l+=o.move(u+"]["),a();const p=n.stack;n.stack=[],a=n.enter("reference");const c=n.safe(n.associationId(e),{before:l,after:"]",...o.current()});return a(),n.stack=p,s(),i==="full"||!u||u!==c?l+=o.move(c+"]"):i==="shortcut"?l=l.slice(0,-1):l+=o.move("]"),l}function lp(){return"["}function An(e){const t=e.options.bullet||"*";if(t!=="*"&&t!=="+"&&t!=="-")throw new Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function up(e){const t=An(e),n=e.options.bulletOther;if(!n)return t==="*"?"-":"*";if(n!=="*"&&n!=="+"&&n!=="-")throw new Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw new Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}function cp(e){const t=e.options.bulletOrdered||".";if(t!=="."&&t!==")")throw new Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function Bi(e){const t=e.options.rule||"*";if(t!=="*"&&t!=="-"&&t!=="_")throw new Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function pp(e,t,n,r){const i=n.enter("list"),s=n.bulletCurrent;let a=e.ordered?cp(n):An(n);const o=e.ordered?a==="."?")":".":up(n);let l=t&&n.bulletLastUsed?a===n.bulletLastUsed:!1;if(!e.ordered){const p=e.children?e.children[0]:void 0;if((a==="*"||a==="-")&&p&&(!p.children||!p.children[0])&&n.stack[n.stack.length-1]==="list"&&n.stack[n.stack.length-2]==="listItem"&&n.stack[n.stack.length-3]==="list"&&n.stack[n.stack.length-4]==="listItem"&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(l=!0),Bi(n)===a&&p){let c=-1;for(;++c<e.children.length;){const h=e.children[c];if(h&&h.type==="listItem"&&h.children&&h.children[0]&&h.children[0].type==="thematicBreak"){l=!0;break}}}}l&&(a=o),n.bulletCurrent=a;const u=n.containerFlow(e,r);return n.bulletLastUsed=a,n.bulletCurrent=s,i(),u}function dp(e){const t=e.options.listItemIndent||"one";if(t!=="tab"&&t!=="one"&&t!=="mixed")throw new Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}function fp(e,t,n,r){const i=dp(n);let s=n.bulletCurrent||An(n);t&&t.type==="list"&&t.ordered&&(s=(typeof t.start=="number"&&t.start>-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+s);let a=s.length+1;(i==="tab"||i==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(a=Math.ceil(a/4)*4);const o=n.createTracker(r);o.move(s+" ".repeat(a-s.length)),o.shift(a);const l=n.enter("listItem"),u=n.indentLines(n.containerFlow(e,o.current()),p);return l(),u;function p(c,h,f){return h?(f?"":" ".repeat(a))+c:(f?s:s+" ".repeat(a-s.length))+c}}function hp(e,t,n,r){const i=n.enter("paragraph"),s=n.enter("phrasing"),a=n.containerPhrasing(e,r);return s(),i(),a}const gp=At(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function mp(e,t,n,r){return(e.children.some(function(a){return gp(a)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}function xp(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}$i.peek=bp;function $i(e,t,n,r){const i=xp(n),s=n.enter("strong"),a=n.createTracker(r),o=a.move(i+i);let l=a.move(n.containerPhrasing(e,{after:i,before:o,...a.current()}));const u=l.charCodeAt(0),p=Et(r.before.charCodeAt(r.before.length-1),u,i);p.inside&&(l=ct(u)+l.slice(1));const c=l.charCodeAt(l.length-1),h=Et(r.after.charCodeAt(0),c,i);h.inside&&(l=l.slice(0,-1)+ct(c));const f=a.move(i+i);return s(),n.attentionEncodeSurroundingInfo={after:h.outside,before:p.outside},o+l+f}function bp(e,t,n){return n.options.strong||"*"}function wp(e,t,n,r){return n.safe(e.value,r)}function yp(e){const t=e.options.ruleRepetition||3;if(t<3)throw new Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function kp(e,t,n){const r=(Bi(n)+(n.options.ruleSpaces?" ":"")).repeat(yp(n));return n.options.ruleSpaces?r.slice(0,-1):r}const Hi={blockquote:Vc,break:jr,code:Kc,definition:Jc,emphasis:Di,hardBreak:jr,heading:np,html:Li,image:Mi,imageReference:Ri,inlineCode:Pi,link:_i,linkReference:Oi,list:pp,listItem:fp,paragraph:hp,root:mp,strong:$i,text:wp,thematicBreak:kp};function vp(){return{enter:{table:Cp,tableData:Ir,tableHeader:Ir,tableRow:Ep},exit:{codeText:jp,table:Sp,tableData:Qt,tableHeader:Qt,tableRow:Qt}}}function Cp(e){const t=e._align;this.enter({type:"table",align:t.map(function(n){return n==="none"?null:n}),children:[]},e),this.data.inTable=!0}function Sp(e){this.exit(e),this.data.inTable=void 0}function Ep(e){this.enter({type:"tableRow",children:[]},e)}function Qt(e){this.exit(e)}function Ir(e){this.enter({type:"tableCell",children:[]},e)}function jp(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,Ip));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function Ip(e,t){return t==="|"?t:e}function Tp(e){const t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,i=t.stringLength,s=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
28
+ `,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:h,table:a,tableCell:l,tableRow:o}};function a(f,g,y,C){return u(p(f,y,C),f.align)}function o(f,g,y,C){const w=c(f,y,C),E=u([w]);return E.slice(0,E.indexOf(`
29
+ `))}function l(f,g,y,C){const w=y.enter("tableCell"),E=y.enter("phrasing"),S=y.containerPhrasing(f,{...C,before:s,after:s});return E(),w(),S}function u(f,g){return Hc(f,{align:g,alignDelimiters:r,padding:n,stringLength:i})}function p(f,g,y){const C=f.children;let w=-1;const E=[],S=g.enter("table");for(;++w<C.length;)E[w]=c(C[w],g,y);return S(),E}function c(f,g,y){const C=f.children;let w=-1;const E=[],S=g.enter("tableRow");for(;++w<C.length;)E[w]=l(C[w],f,g,y);return S(),E}function h(f,g,y){let C=Hi.inlineCode(f,g,y);return y.stack.includes("tableCell")&&(C=C.replace(/\|/g,"\\$&")),C}}function zp(){return{exit:{taskListCheckValueChecked:Tr,taskListCheckValueUnchecked:Tr,paragraph:Np}}}function Ap(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:Dp}}}function Tr(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function Np(e){const t=this.stack[this.stack.length-2];if(t&&t.type==="listItem"&&typeof t.checked=="boolean"){const n=this.stack[this.stack.length-1];n.type;const r=n.children[0];if(r&&r.type==="text"){const i=t.children;let s=-1,a;for(;++s<i.length;){const o=i[s];if(o.type==="paragraph"){a=o;break}}a===n&&(r.value=r.value.slice(1),r.value.length===0?n.children.shift():n.position&&r.position&&typeof r.position.start.offset=="number"&&(r.position.start.column++,r.position.start.offset++,n.position.start=Object.assign({},r.position.start)))}}this.exit(e)}function Dp(e,t,n,r){const i=e.children[0],s=typeof e.checked=="boolean"&&i&&i.type==="paragraph",a="["+(e.checked?"x":" ")+"] ",o=n.createTracker(r);s&&o.move(a);let l=Hi.listItem(e,t,n,{...r,...o.current()});return s&&(l=l.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,u)),l;function u(p){return p+a}}function Lp(){return[pc(),Dc(),Pc(),vp(),zp()]}function Mp(e){return{extensions:[dc(),Lc(e),Fc(),Tp(e),Ap()]}}const Rp={tokenize:$p,partial:!0},Ui={tokenize:Hp,partial:!0},Vi={tokenize:Up,partial:!0},qi={tokenize:Vp,partial:!0},Pp={tokenize:qp,partial:!0},Wi={name:"wwwAutolink",tokenize:Op,previous:Gi},Yi={name:"protocolAutolink",tokenize:Bp,previous:Xi},Ae={name:"emailAutolink",tokenize:_p,previous:Ki},Ie={};function Fp(){return{text:Ie}}let Re=48;for(;Re<123;)Ie[Re]=Ae,Re++,Re===58?Re=65:Re===91&&(Re=97);Ie[43]=Ae;Ie[45]=Ae;Ie[46]=Ae;Ie[95]=Ae;Ie[72]=[Ae,Yi];Ie[104]=[Ae,Yi];Ie[87]=[Ae,Wi];Ie[119]=[Ae,Wi];function _p(e,t,n){const r=this;let i,s;return a;function a(c){return!dn(c)||!Ki.call(r,r.previous)||Nn(r.events)?n(c):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),o(c))}function o(c){return dn(c)?(e.consume(c),o):c===64?(e.consume(c),l):n(c)}function l(c){return c===46?e.check(Pp,p,u)(c):c===45||c===95||pe(c)?(s=!0,e.consume(c),l):p(c)}function u(c){return e.consume(c),i=!0,l}function p(c){return s&&i&&fe(r.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(c)):n(c)}}function Op(e,t,n){const r=this;return i;function i(a){return a!==87&&a!==119||!Gi.call(r,r.previous)||Nn(r.events)?n(a):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(Rp,e.attempt(Ui,e.attempt(Vi,s),n),n)(a))}function s(a){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(a)}}function Bp(e,t,n){const r=this;let i="",s=!1;return a;function a(c){return(c===72||c===104)&&Xi.call(r,r.previous)&&!Nn(r.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),i+=String.fromCodePoint(c),e.consume(c),o):n(c)}function o(c){if(fe(c)&&i.length<5)return i+=String.fromCodePoint(c),e.consume(c),o;if(c===58){const h=i.toLowerCase();if(h==="http"||h==="https")return e.consume(c),l}return n(c)}function l(c){return c===47?(e.consume(c),s?u:(s=!0,l)):n(c)}function u(c){return c===null||vt(c)||ne(c)||Be(c)||It(c)?n(c):e.attempt(Ui,e.attempt(Vi,p),n)(c)}function p(c){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(c)}}function $p(e,t,n){let r=0;return i;function i(a){return(a===87||a===119)&&r<3?(r++,e.consume(a),i):a===46&&r===3?(e.consume(a),s):n(a)}function s(a){return a===null?n(a):t(a)}}function Hp(e,t,n){let r,i,s;return a;function a(u){return u===46||u===95?e.check(qi,l,o)(u):u===null||ne(u)||Be(u)||u!==45&&It(u)?l(u):(s=!0,e.consume(u),a)}function o(u){return u===95?r=!0:(i=r,r=void 0),e.consume(u),a}function l(u){return i||r||!s?n(u):t(u)}}function Up(e,t){let n=0,r=0;return i;function i(a){return a===40?(n++,e.consume(a),i):a===41&&r<n?s(a):a===33||a===34||a===38||a===39||a===41||a===42||a===44||a===46||a===58||a===59||a===60||a===63||a===93||a===95||a===126?e.check(qi,t,s)(a):a===null||ne(a)||Be(a)?t(a):(e.consume(a),i)}function s(a){return a===41&&r++,e.consume(a),i}}function Vp(e,t,n){return r;function r(o){return o===33||o===34||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===63||o===95||o===126?(e.consume(o),r):o===38?(e.consume(o),s):o===93?(e.consume(o),i):o===60||o===null||ne(o)||Be(o)?t(o):n(o)}function i(o){return o===null||o===40||o===91||ne(o)||Be(o)?t(o):r(o)}function s(o){return fe(o)?a(o):n(o)}function a(o){return o===59?(e.consume(o),r):fe(o)?(e.consume(o),a):n(o)}}function qp(e,t,n){return r;function r(s){return e.consume(s),i}function i(s){return pe(s)?n(s):t(s)}}function Gi(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||ne(e)}function Xi(e){return!fe(e)}function Ki(e){return!(e===47||dn(e))}function dn(e){return e===43||e===45||e===46||e===95||pe(e)}function Nn(e){let t=e.length,n=!1;for(;t--;){const r=e[t][1];if((r.type==="labelLink"||r.type==="labelImage")&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}const Wp={tokenize:ed,partial:!0};function Yp(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:Qp,continuation:{tokenize:Jp},exit:Zp}},text:{91:{name:"gfmFootnoteCall",tokenize:Kp},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:Gp,resolveTo:Xp}}}}function Gp(e,t,n){const r=this;let i=r.events.length;const s=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let a;for(;i--;){const l=r.events[i][1];if(l.type==="labelImage"){a=l;break}if(l.type==="gfmFootnoteCall"||l.type==="labelLink"||l.type==="label"||l.type==="image"||l.type==="link")break}return o;function o(l){if(!a||!a._balanced)return n(l);const u=Ce(r.sliceSerialize({start:a.end,end:r.now()}));return u.codePointAt(0)!==94||!s.includes(u.slice(1))?n(l):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(l),e.exit("gfmFootnoteCallLabelMarker"),t(l))}}function Xp(e,t){let n=e.length;for(;n--;)if(e[n][1].type==="labelImage"&&e[n][0]==="enter"){e[n][1];break}e[n+1][1].type="data",e[n+3][1].type="gfmFootnoteCallLabelMarker";const r={type:"gfmFootnoteCall",start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},i={type:"gfmFootnoteCallMarker",start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};i.end.column++,i.end.offset++,i.end._bufferIndex++;const s={type:"gfmFootnoteCallString",start:Object.assign({},i.end),end:Object.assign({},e[e.length-1][1].start)},a={type:"chunkString",contentType:"string",start:Object.assign({},s.start),end:Object.assign({},s.end)},o=[e[n+1],e[n+2],["enter",r,t],e[n+3],e[n+4],["enter",i,t],["exit",i,t],["enter",s,t],["enter",a,t],["exit",a,t],["exit",s,t],e[e.length-2],e[e.length-1],["exit",r,t]];return e.splice(n,e.length-n+1,...o),e}function Kp(e,t,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let s=0,a;return o;function o(c){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(c),e.exit("gfmFootnoteCallLabelMarker"),l}function l(c){return c!==94?n(c):(e.enter("gfmFootnoteCallMarker"),e.consume(c),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",u)}function u(c){if(s>999||c===93&&!a||c===null||c===91||ne(c))return n(c);if(c===93){e.exit("chunkString");const h=e.exit("gfmFootnoteCallString");return i.includes(Ce(r.sliceSerialize(h)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(c),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(c)}return ne(c)||(a=!0),s++,e.consume(c),c===92?p:u}function p(c){return c===91||c===92||c===93?(e.consume(c),s++,u):u(c)}}function Qp(e,t,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let s,a=0,o;return l;function l(g){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(g),e.exit("gfmFootnoteDefinitionLabelMarker"),u}function u(g){return g===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(g),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",p):n(g)}function p(g){if(a>999||g===93&&!o||g===null||g===91||ne(g))return n(g);if(g===93){e.exit("chunkString");const y=e.exit("gfmFootnoteDefinitionLabelString");return s=Ce(r.sliceSerialize(y)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(g),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),h}return ne(g)||(o=!0),a++,e.consume(g),g===92?c:p}function c(g){return g===91||g===92||g===93?(e.consume(g),a++,p):p(g)}function h(g){return g===58?(e.enter("definitionMarker"),e.consume(g),e.exit("definitionMarker"),i.includes(s)||i.push(s),J(e,f,"gfmFootnoteDefinitionWhitespace")):n(g)}function f(g){return t(g)}}function Jp(e,t,n){return e.check(dt,t,e.attempt(Wp,t,n))}function Zp(e){e.exit("gfmFootnoteDefinition")}function ed(e,t,n){const r=this;return J(e,i,"gfmFootnoteDefinitionIndent",5);function i(s){const a=r.events[r.events.length-1];return a&&a[1].type==="gfmFootnoteDefinitionIndent"&&a[2].sliceSerialize(a[1],!0).length===4?t(s):n(s)}}function td(e){let n=(e||{}).singleTilde;const r={name:"strikethrough",tokenize:s,resolveAll:i};return n==null&&(n=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function i(a,o){let l=-1;for(;++l<a.length;)if(a[l][0]==="enter"&&a[l][1].type==="strikethroughSequenceTemporary"&&a[l][1]._close){let u=l;for(;u--;)if(a[u][0]==="exit"&&a[u][1].type==="strikethroughSequenceTemporary"&&a[u][1]._open&&a[l][1].end.offset-a[l][1].start.offset===a[u][1].end.offset-a[u][1].start.offset){a[l][1].type="strikethroughSequence",a[u][1].type="strikethroughSequence";const p={type:"strikethrough",start:Object.assign({},a[u][1].start),end:Object.assign({},a[l][1].end)},c={type:"strikethroughText",start:Object.assign({},a[u][1].end),end:Object.assign({},a[l][1].start)},h=[["enter",p,o],["enter",a[u][1],o],["exit",a[u][1],o],["enter",c,o]],f=o.parser.constructs.insideSpan.null;f&&we(h,h.length,0,Tt(f,a.slice(u+1,l),o)),we(h,h.length,0,[["exit",c,o],["enter",a[l][1],o],["exit",a[l][1],o],["exit",p,o]]),we(a,u-1,l-u+3,h),l=u+h.length-2;break}}for(l=-1;++l<a.length;)a[l][1].type==="strikethroughSequenceTemporary"&&(a[l][1].type="data");return a}function s(a,o,l){const u=this.previous,p=this.events;let c=0;return h;function h(g){return u===126&&p[p.length-1][1].type!=="characterEscape"?l(g):(a.enter("strikethroughSequenceTemporary"),f(g))}function f(g){const y=Ye(u);if(g===126)return c>1?l(g):(a.consume(g),c++,f);if(c<2&&!n)return l(g);const C=a.exit("strikethroughSequenceTemporary"),w=Ye(g);return C._open=!w||w===2&&!!y,C._close=!y||y===2&&!!w,o(g)}}}class nd{constructor(){this.map=[]}add(t,n,r){rd(this,t,n,r)}consume(t){if(this.map.sort(function(s,a){return s[0]-a[0]}),this.map.length===0)return;let n=this.map.length;const r=[];for(;n>0;)n-=1,r.push(t.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),t.length=this.map[n][0];r.push(t.slice()),t.length=0;let i=r.pop();for(;i;){for(const s of i)t.push(s);i=r.pop()}this.map.length=0}}function rd(e,t,n,r){let i=0;if(!(n===0&&r.length===0)){for(;i<e.map.length;){if(e.map[i][0]===t){e.map[i][1]+=n,e.map[i][2].push(...r);return}i+=1}e.map.push([t,n,r])}}function id(e,t){let n=!1;const r=[];for(;t<e.length;){const i=e[t];if(n){if(i[0]==="enter")i[1].type==="tableContent"&&r.push(e[t+1][1].type==="tableDelimiterMarker"?"left":"none");else if(i[1].type==="tableContent"){if(e[t-1][1].type==="tableDelimiterMarker"){const s=r.length-1;r[s]=r[s]==="left"?"center":"right"}}else if(i[1].type==="tableDelimiterRow")break}else i[0]==="enter"&&i[1].type==="tableDelimiterRow"&&(n=!0);t+=1}return r}function ad(){return{flow:{null:{name:"table",tokenize:sd,resolveAll:od}}}}function sd(e,t,n){const r=this;let i=0,s=0,a;return o;function o(b){let j=r.events.length-1;for(;j>-1;){const F=r.events[j][1].type;if(F==="lineEnding"||F==="linePrefix")j--;else break}const T=j>-1?r.events[j][1].type:null,M=T==="tableHead"||T==="tableRow"?v:l;return M===v&&r.parser.lazy[r.now().line]?n(b):M(b)}function l(b){return e.enter("tableHead"),e.enter("tableRow"),u(b)}function u(b){return b===124||(a=!0,s+=1),p(b)}function p(b){return b===null?n(b):V(b)?s>1?(s=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(b),e.exit("lineEnding"),f):n(b):K(b)?J(e,p,"whitespace")(b):(s+=1,a&&(a=!1,i+=1),b===124?(e.enter("tableCellDivider"),e.consume(b),e.exit("tableCellDivider"),a=!0,p):(e.enter("data"),c(b)))}function c(b){return b===null||b===124||ne(b)?(e.exit("data"),p(b)):(e.consume(b),b===92?h:c)}function h(b){return b===92||b===124?(e.consume(b),c):c(b)}function f(b){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(b):(e.enter("tableDelimiterRow"),a=!1,K(b)?J(e,g,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(b):g(b))}function g(b){return b===45||b===58?C(b):b===124?(a=!0,e.enter("tableCellDivider"),e.consume(b),e.exit("tableCellDivider"),y):A(b)}function y(b){return K(b)?J(e,C,"whitespace")(b):C(b)}function C(b){return b===58?(s+=1,a=!0,e.enter("tableDelimiterMarker"),e.consume(b),e.exit("tableDelimiterMarker"),w):b===45?(s+=1,w(b)):b===null||V(b)?z(b):A(b)}function w(b){return b===45?(e.enter("tableDelimiterFiller"),E(b)):A(b)}function E(b){return b===45?(e.consume(b),E):b===58?(a=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(b),e.exit("tableDelimiterMarker"),S):(e.exit("tableDelimiterFiller"),S(b))}function S(b){return K(b)?J(e,z,"whitespace")(b):z(b)}function z(b){return b===124?g(b):b===null||V(b)?!a||i!==s?A(b):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(b)):A(b)}function A(b){return n(b)}function v(b){return e.enter("tableRow"),N(b)}function N(b){return b===124?(e.enter("tableCellDivider"),e.consume(b),e.exit("tableCellDivider"),N):b===null||V(b)?(e.exit("tableRow"),t(b)):K(b)?J(e,N,"whitespace")(b):(e.enter("data"),O(b))}function O(b){return b===null||b===124||ne(b)?(e.exit("data"),N(b)):(e.consume(b),b===92?$:O)}function $(b){return b===92||b===124?(e.consume(b),O):O(b)}}function od(e,t){let n=-1,r=!0,i=0,s=[0,0,0,0],a=[0,0,0,0],o=!1,l=0,u,p,c;const h=new nd;for(;++n<e.length;){const f=e[n],g=f[1];f[0]==="enter"?g.type==="tableHead"?(o=!1,l!==0&&(zr(h,t,l,u,p),p=void 0,l=0),u={type:"table",start:Object.assign({},g.start),end:Object.assign({},g.end)},h.add(n,0,[["enter",u,t]])):g.type==="tableRow"||g.type==="tableDelimiterRow"?(r=!0,c=void 0,s=[0,0,0,0],a=[0,n+1,0,0],o&&(o=!1,p={type:"tableBody",start:Object.assign({},g.start),end:Object.assign({},g.end)},h.add(n,0,[["enter",p,t]])),i=g.type==="tableDelimiterRow"?2:p?3:1):i&&(g.type==="data"||g.type==="tableDelimiterMarker"||g.type==="tableDelimiterFiller")?(r=!1,a[2]===0&&(s[1]!==0&&(a[0]=a[1],c=bt(h,t,s,i,void 0,c),s=[0,0,0,0]),a[2]=n)):g.type==="tableCellDivider"&&(r?r=!1:(s[1]!==0&&(a[0]=a[1],c=bt(h,t,s,i,void 0,c)),s=a,a=[s[1],n,0,0])):g.type==="tableHead"?(o=!0,l=n):g.type==="tableRow"||g.type==="tableDelimiterRow"?(l=n,s[1]!==0?(a[0]=a[1],c=bt(h,t,s,i,n,c)):a[1]!==0&&(c=bt(h,t,a,i,n,c)),i=0):i&&(g.type==="data"||g.type==="tableDelimiterMarker"||g.type==="tableDelimiterFiller")&&(a[3]=n)}for(l!==0&&zr(h,t,l,u,p),h.consume(t.events),n=-1;++n<t.events.length;){const f=t.events[n];f[0]==="enter"&&f[1].type==="table"&&(f[1]._align=id(t.events,n))}return e}function bt(e,t,n,r,i,s){const a=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",o="tableContent";n[0]!==0&&(s.end=Object.assign({},We(t.events,n[0])),e.add(n[0],0,[["exit",s,t]]));const l=We(t.events,n[1]);if(s={type:a,start:Object.assign({},l),end:Object.assign({},l)},e.add(n[1],0,[["enter",s,t]]),n[2]!==0){const u=We(t.events,n[2]),p=We(t.events,n[3]),c={type:o,start:Object.assign({},u),end:Object.assign({},p)};if(e.add(n[2],0,[["enter",c,t]]),r!==2){const h=t.events[n[2]],f=t.events[n[3]];if(h[1].end=Object.assign({},f[1].end),h[1].type="chunkText",h[1].contentType="text",n[3]>n[2]+1){const g=n[2]+1,y=n[3]-n[2]-1;e.add(g,y,[])}}e.add(n[3]+1,0,[["exit",c,t]])}return i!==void 0&&(s.end=Object.assign({},We(t.events,i)),e.add(i,0,[["exit",s,t]]),s=void 0),s}function zr(e,t,n,r,i){const s=[],a=We(t.events,n);i&&(i.end=Object.assign({},a),s.push(["exit",i,t])),r.end=Object.assign({},a),s.push(["exit",r,t]),e.add(n+1,0,s)}function We(e,t){const n=e[t],r=n[0]==="enter"?"start":"end";return n[1][r]}const ld={name:"tasklistCheck",tokenize:cd};function ud(){return{text:{91:ld}}}function cd(e,t,n){const r=this;return i;function i(l){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(l):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(l),e.exit("taskListCheckMarker"),s)}function s(l){return ne(l)?(e.enter("taskListCheckValueUnchecked"),e.consume(l),e.exit("taskListCheckValueUnchecked"),a):l===88||l===120?(e.enter("taskListCheckValueChecked"),e.consume(l),e.exit("taskListCheckValueChecked"),a):n(l)}function a(l){return l===93?(e.enter("taskListCheckMarker"),e.consume(l),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),o):n(l)}function o(l){return V(l)?t(l):K(l)?e.check({tokenize:pd},t,n)(l):n(l)}}function pd(e,t,n){return J(e,r,"whitespace");function r(i){return i===null?n(i):t(i)}}function dd(e){return ai([Fp(),Yp(),td(e),ad(),ud()])}const fd={};function hd(e){const t=this,n=e||fd,r=t.data(),i=r.micromarkExtensions||(r.micromarkExtensions=[]),s=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),a=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);i.push(dd(n)),s.push(Lp()),a.push(Mp(n))}function Qi({content:e}){return d.jsx("div",{className:"sa-text-part",children:d.jsx(tc,{remarkPlugins:[hd],children:e})})}const gd="https://at.alicdn.com/t/c/font_5210396_pffyg5g21kn.js";let Ar=!1;function Ji(e=gd){if(Ar||typeof document>"u")return;Ar=!0;const t=e.split("?")[0].split("/").pop();if(t&&document.querySelector(`script[src*="${t}"]`))return;const n=document.createElement("script");n.src=e,document.head.appendChild(n)}Ji();function Q({name:e,size:t=16,color:n="currentColor",className:r,style:i}){return d.jsx("svg",{className:r,style:{width:t,height:t,fill:n,verticalAlign:"middle",...i},"aria-hidden":"true",children:d.jsx("use",{href:`#icon-${e}`})})}function Zi({content:e}){const[t,n]=k.useState(!1);return d.jsxs("div",{className:"sa-thinking-part",onClick:()=>n(!t),children:[d.jsxs("div",{className:"sa-thinking-header",children:[d.jsx("span",{className:"sa-thinking-icon",children:d.jsx(Q,{name:"brain",size:14})}),d.jsx("span",{className:"sa-thinking-label",children:"思考过程"}),d.jsx("span",{className:`sa-thinking-arrow ${t?"expanded":""}`,children:d.jsx(Q,{name:"chevron-right",size:12})})]}),t&&d.jsx("div",{className:"sa-thinking-content",children:e})]})}function ea({toolName:e,toolCallId:t,args:n}){const[r,i]=k.useState(!1),[s,a]=k.useState(!1);let o=n;try{o=JSON.stringify(JSON.parse(n),null,2)}catch{}const l=k.useCallback(()=>{var u;(u=navigator.clipboard)==null||u.writeText(o).then(()=>{a(!0),setTimeout(()=>a(!1),2e3)}).catch(()=>{})},[o]);return d.jsxs("div",{className:"sa-tool-call-part",children:[d.jsxs("div",{className:"sa-tool-call-header",onClick:()=>i(!r),children:[d.jsx("span",{className:"sa-tool-icon",children:d.jsx(Q,{name:"zap",size:14})}),d.jsxs("span",{className:"sa-tool-name",children:["调用工具: ",e]}),d.jsx("span",{className:`sa-thinking-arrow ${r?"expanded":""}`,children:d.jsx(Q,{name:"chevron-right",size:12})})]}),r&&d.jsxs(d.Fragment,{children:[d.jsx("pre",{className:"sa-tool-args",children:o}),d.jsx("div",{className:"sa-tool-result-actions",children:d.jsxs("button",{className:"sa-action-btn",onClick:l,title:"复制",children:[d.jsx(Q,{name:s?"circle-check":"copy",size:14})," ",s?"已复制":"复制"]})})]})]})}function Nr({text:e}){const[t,n]=k.useState(!1),r=()=>{var i;(i=navigator.clipboard)==null||i.writeText(e).then(()=>{n(!0),setTimeout(()=>n(!1),2e3)}).catch(()=>{})};return d.jsxs("button",{className:"sa-action-btn",onClick:r,title:"复制",children:[d.jsx(Q,{name:t?"circle-check":"copy",size:14})," ",t?"已复制":"复制"]})}function md({html:e}){const[t,n]=k.useState(null);return k.useEffect(()=>{let r=!1;return Promise.resolve().then(()=>require("./purify.es-Dsdnkgrg.cjs")).then(i=>{r||n(i.default.sanitize(e,{FORCE_BODY:!0,ADD_ATTR:["target"]}))}),()=>{r=!0}},[e]),t===null?null:d.jsx("div",{className:"sa-tool-result-html-scroll",children:d.jsx("div",{className:"sa-tool-result-html sa-text-part",dangerouslySetInnerHTML:{__html:t}})})}function ta({toolName:e,content:t,artifacts:n,renderMode:r,html:i,artifactPreview:s}){const{openArtifactPreview:a}=je(),o=Or(n);return d.jsxs("div",{className:"sa-tool-result-part",children:[d.jsxs("div",{className:"sa-tool-result-header",children:[d.jsx("span",{className:"sa-tool-icon",children:d.jsx(Q,{name:"circle-check",size:14,color:"#10b981"})}),d.jsx("span",{className:"sa-tool-result-label",children:e||"工具返回"})]}),r==="html"&&i?d.jsxs(d.Fragment,{children:[d.jsx(md,{html:i}),d.jsx("div",{className:"sa-tool-result-actions",children:d.jsx(Nr,{text:i})})]}):t?d.jsxs(d.Fragment,{children:[d.jsx("pre",{className:"sa-tool-result-content",children:t}),d.jsx("div",{className:"sa-tool-result-actions",children:d.jsx(Nr,{text:t})})]}):d.jsx("pre",{className:"sa-tool-result-content",children:"—"}),o.length>0&&d.jsx("ul",{className:"sa-artifact-file-list",role:"list",children:o.map((l,u)=>d.jsxs("li",{className:"sa-artifact-file-card",onClick:s?()=>a(l):void 0,onKeyDown:s?p=>{(p.key==="Enter"||p.key===" ")&&(p.preventDefault(),a(l))}:void 0,tabIndex:s?0:void 0,role:s?"button":void 0,"aria-label":s?`预览 ${l.filename}`:void 0,style:s?{cursor:"pointer"}:void 0,children:[d.jsx("div",{className:"sa-artifact-file-icon",children:d.jsx("span",{className:"sa-artifact-chip-type",children:_r(l.type)})}),d.jsxs("div",{className:"sa-artifact-file-info",children:[d.jsx("span",{className:"sa-artifact-file-name",children:l.filename}),l.size!=null&&d.jsx("span",{className:"sa-artifact-file-size",children:Fr(l.size)})]}),s&&d.jsx("button",{className:"sa-artifact-file-download",title:"下载","aria-label":`下载 ${l.filename}`,onClick:p=>{p.stopPropagation(),kt(l)},children:d.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:d.jsx("path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4M7 10l5 5 5-5M12 15V3"})})})]},l.id||`art-${u}`))})]})}function na({content:e,onRetry:t}){return d.jsxs("div",{className:"sa-error-part",children:[d.jsxs("div",{className:"sa-error-content",children:[d.jsx("span",{className:"sa-error-icon",children:d.jsx(Q,{name:"triangle-alert",size:14})}),d.jsx("span",{children:e||"发生错误"})]}),t&&d.jsx("button",{className:"sa-error-retry",onClick:t,children:"重试"})]})}function ra(e){return e==null||Number.isNaN(e)?"":e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/1024/1024).toFixed(1)} MB`}function xd({attachment:e}){const t=d.jsxs(d.Fragment,{children:[d.jsx(Q,{name:"file-text",size:14,color:"#6366f1"}),d.jsx("span",{className:"sa-attachment-chip-name",children:e.filename}),e.size!=null&&d.jsx("span",{className:"sa-attachment-chip-size",children:ra(e.size)})]});return e.url?d.jsx("a",{className:"sa-attachment-chip",href:e.url,target:"_blank",rel:"noreferrer",download:e.filename,title:`下载 ${e.filename}`,children:t}):d.jsx("span",{className:"sa-attachment-chip",title:e.filename,children:t})}function bd({interrupt:e,onRespond:t,disabled:n,answeredAction:r}){var o,l;const i=e.options,s=(typeof(i==null?void 0:i[0])=="string"?i[0]:(o=i==null?void 0:i[0])==null?void 0:o.label)||"确认",a=(typeof(i==null?void 0:i[1])=="string"?i[1]:(l=i==null?void 0:i[1])==null?void 0:l.label)||"取消";return d.jsxs("div",{className:"sa-interrupt-card",children:[d.jsxs("div",{className:"sa-interrupt-content",children:[d.jsx(Q,{name:"circle-alert",size:16,color:"#f59e0b"}),d.jsx("span",{children:e.content})]}),d.jsxs("div",{className:"sa-interrupt-actions",children:[d.jsxs("button",{className:`sa-interrupt-btn sa-interrupt-btn-primary ${r==="confirm"?"sa-interrupt-btn-answered":""}`,disabled:n,onClick:()=>t({action:"confirm"}),children:[d.jsx(Q,{name:"check",size:14})," ",s]}),d.jsxs("button",{className:`sa-interrupt-btn sa-interrupt-btn-secondary ${r==="cancel"?"sa-interrupt-btn-answered":""}`,disabled:n,onClick:()=>t({action:"cancel"}),children:[d.jsx(Q,{name:"x",size:14})," ",a]})]}),n&&d.jsx("div",{className:"sa-interrupt-submitted",children:"已提交"})]})}function wd({interrupt:e,onRespond:t,disabled:n,answeredAction:r}){var u,p,c,h;const i=e.options,s=(typeof(i==null?void 0:i[0])=="string"?i[0]:(u=i==null?void 0:i[0])==null?void 0:u.label)||"批准",a=(typeof(i==null?void 0:i[1])=="string"?i[1]:(p=i==null?void 0:i[1])==null?void 0:p.label)||"拒绝",o=(typeof(i==null?void 0:i[2])=="string"?i[2]:(c=i==null?void 0:i[2])==null?void 0:c.label)||"跳过",l=((h=e.metadata)==null?void 0:h.showSkip)!==!1;return d.jsxs("div",{className:"sa-interrupt-card",children:[d.jsxs("div",{className:"sa-interrupt-content",children:[d.jsx(Q,{name:"circle-alert",size:16,color:"#f59e0b"}),d.jsx("span",{children:e.content})]}),d.jsxs("div",{className:"sa-interrupt-actions",children:[d.jsxs("button",{className:`sa-interrupt-btn sa-interrupt-btn-primary ${r==="approve"?"sa-interrupt-btn-answered":""}`,disabled:n,onClick:()=>t({action:"approve"}),children:[d.jsx(Q,{name:"check",size:14})," ",s]}),d.jsxs("button",{className:`sa-interrupt-btn sa-interrupt-btn-danger ${r==="reject"?"sa-interrupt-btn-answered":""}`,disabled:n,onClick:()=>t({action:"reject"}),children:[d.jsx(Q,{name:"x",size:14})," ",a]}),l&&d.jsxs("button",{className:`sa-interrupt-btn sa-interrupt-btn-secondary ${r==="skip"?"sa-interrupt-btn-answered":""}`,disabled:n,onClick:()=>t({action:"skip"}),children:[d.jsx(Q,{name:"chevron-right",size:14})," ",o]})]}),n&&d.jsx("div",{className:"sa-interrupt-submitted",children:"已提交"})]})}function yd(e){return typeof e=="string"?{value:e,label:e}:e}function kd({interrupt:e,onRespond:t,disabled:n,initialValue:r}){const i=(e.options??[]).map(yd);return d.jsxs("div",{className:"sa-interrupt-card",children:[d.jsxs("div",{className:"sa-interrupt-content",children:[d.jsx(Q,{name:"list",size:16,color:"#6366f1"}),d.jsx("span",{children:e.content})]}),d.jsx("div",{className:"sa-interrupt-options",children:i.map(s=>{const a=r===s.value;return d.jsxs("button",{className:`sa-interrupt-option ${s.danger?"sa-interrupt-option-danger":""} ${a?"sa-interrupt-option-selected":""}`,disabled:n,onClick:()=>t({action:"select",value:s.value}),children:[d.jsx(Q,{name:a?"circle-check":"circle",size:14}),s.icon&&d.jsx(Q,{name:s.icon,size:14}),d.jsx("span",{children:s.label}),s.description&&d.jsx("span",{className:"sa-interrupt-option-desc",children:s.description})]},s.value)})}),n&&d.jsx("div",{className:"sa-interrupt-submitted",children:"已提交"})]})}function vd(e){return typeof e=="string"?{value:e,label:e}:e}function Cd({interrupt:e,onRespond:t,disabled:n,initialValue:r}){const i=(e.options??[]).map(vd),[s,a]=k.useState(()=>new Set(Array.isArray(r)?r:[])),o=l=>{n||a(u=>{const p=new Set(u);return p.has(l)?p.delete(l):p.add(l),p})};return d.jsxs("div",{className:"sa-interrupt-card",children:[d.jsxs("div",{className:"sa-interrupt-content",children:[d.jsx(Q,{name:"list-checks",size:16,color:"#6366f1"}),d.jsx("span",{children:e.content})]}),d.jsx("div",{className:"sa-interrupt-options",children:i.map(l=>d.jsxs("button",{className:`sa-interrupt-option ${s.has(l.value)?"sa-interrupt-option-selected":""}`,disabled:n,onClick:()=>o(l.value),children:[d.jsx(Q,{name:s.has(l.value)?"square-check":"square",size:14}),d.jsx("span",{children:l.label})]},l.value))}),!n&&d.jsx("div",{className:"sa-interrupt-actions",children:d.jsxs("button",{className:"sa-interrupt-btn sa-interrupt-btn-primary",disabled:s.size===0,onClick:()=>t({action:"submit",value:Array.from(s)}),children:[d.jsx(Q,{name:"check",size:14})," 确认 (",s.size,")"]})}),n&&d.jsx("div",{className:"sa-interrupt-submitted",children:"已提交"})]})}function Sd({interrupt:e,onRespond:t,disabled:n,initialValue:r}){const[i,s]=k.useState(r??""),a=e.inputType??"text",o=a==="textarea",l=()=>{n||e.required&&!i.trim()||t({action:"submit",value:i.trim()})};return d.jsxs("div",{className:"sa-interrupt-card",children:[d.jsxs("div",{className:"sa-interrupt-content",children:[d.jsx(Q,{name:"text-cursor-input",size:16,color:"#6366f1"}),d.jsx("span",{children:e.content})]}),d.jsx("div",{className:"sa-interrupt-input-area",children:o?d.jsx("textarea",{className:"sa-interrupt-textarea",value:i,onChange:u=>s(u.target.value),placeholder:e.placeholder,maxLength:e.maxLength,rows:3,disabled:n}):d.jsx("input",{className:"sa-interrupt-input",type:a,value:i,onChange:u=>s(u.target.value),placeholder:e.placeholder,maxLength:e.maxLength,onKeyDown:u=>u.key==="Enter"&&l(),disabled:n})}),!n&&d.jsx("div",{className:"sa-interrupt-actions",children:d.jsxs("button",{className:"sa-interrupt-btn sa-interrupt-btn-primary",disabled:e.required?!i.trim():!1,onClick:l,children:[d.jsx(Q,{name:"check",size:14})," 提交"]})}),n&&d.jsx("div",{className:"sa-interrupt-submitted",children:"已提交"})]})}function Ed({interrupt:e,onRespond:t,disabled:n,initialValue:r}){const i=e.fields??[],[s,a]=k.useState(()=>{const p={};for(const c of i)p[c.name]=(r==null?void 0:r[c.name])??c.defaultValue??"";return p}),o=(p,c)=>{n||a(h=>({...h,[p]:c}))},l=!n&&i.every(p=>!p.required||s[p.name]),u=()=>{l&&t({action:"submit",value:s})};return d.jsxs("div",{className:"sa-interrupt-card",children:[d.jsxs("div",{className:"sa-interrupt-content",children:[d.jsx(Q,{name:"file-text",size:16,color:"#6366f1"}),d.jsx("span",{children:e.content})]}),d.jsx("div",{className:"sa-interrupt-form",children:i.map(p=>d.jsxs("div",{className:"sa-interrupt-form-field",children:[d.jsxs("label",{className:"sa-interrupt-form-label",children:[p.label,p.required&&d.jsx("span",{className:"sa-interrupt-form-required",children:"*"})]}),jd(p,s[p.name],c=>o(p.name,c),n)]},p.name))}),!n&&d.jsxs("div",{className:"sa-interrupt-actions",children:[d.jsxs("button",{className:"sa-interrupt-btn sa-interrupt-btn-primary",disabled:!l,onClick:u,children:[d.jsx(Q,{name:"check",size:14})," 提交"]}),d.jsx("button",{className:"sa-interrupt-btn sa-interrupt-btn-secondary",onClick:()=>t({action:"cancel"}),children:"取消"})]}),n&&d.jsx("div",{className:"sa-interrupt-submitted",children:"已提交"})]})}function Dr(e){return typeof e=="string"?{value:e,label:e}:e}function jd(e,t,n,r){switch(e.type){case"textarea":return d.jsx("textarea",{className:"sa-interrupt-textarea",value:t,onChange:i=>n(i.target.value),placeholder:e.placeholder,rows:3,disabled:r});case"select":{const i=(e.options??[]).map(Dr);return d.jsxs("select",{className:"sa-interrupt-select",value:t,onChange:s=>n(s.target.value),disabled:r,children:[d.jsx("option",{value:"",children:"请选择"}),i.map(s=>d.jsx("option",{value:s.value,children:s.label},s.value))]})}case"multiSelect":{const i=(e.options??[]).map(Dr),s=Array.isArray(t)?t:[],a=o=>{r||n(s.includes(o)?s.filter(l=>l!==o):[...s,o])};return d.jsx("div",{className:"sa-interrupt-options",children:i.map(o=>d.jsx("button",{type:"button",className:`sa-interrupt-option ${s.includes(o.value)?"sa-interrupt-option-selected":""}`,disabled:r,onClick:()=>a(o.value),children:o.label},o.value))})}case"password":return d.jsx("input",{className:"sa-interrupt-input",type:"password",value:t,onChange:i=>n(i.target.value),placeholder:e.placeholder,disabled:r});default:return d.jsx("input",{className:"sa-interrupt-input",type:e.type==="number"?"number":e.type==="date"?"date":"text",value:t,onChange:i=>n(i.target.value),placeholder:e.placeholder,disabled:r})}}function ia({interrupt:e,resolved:t,response:n,onRespond:r}){const i=t,s=n==null?void 0:n.value;switch(e.interruptType){case"confirm":return d.jsx(bd,{interrupt:e,onRespond:r,disabled:i,answeredAction:n==null?void 0:n.action});case"approve":return d.jsx(wd,{interrupt:e,onRespond:r,disabled:i,answeredAction:n==null?void 0:n.action});case"select":return d.jsx(kd,{interrupt:e,onRespond:r,disabled:i,initialValue:s});case"multiSelect":return d.jsx(Cd,{interrupt:e,onRespond:r,disabled:i,initialValue:s});case"input":return d.jsx(Sd,{interrupt:e,onRespond:r,disabled:i,initialValue:s});case"form":return d.jsx(Ed,{interrupt:e,onRespond:r,disabled:i,initialValue:s});default:return d.jsxs("div",{className:"sa-interrupt-unknown",children:["未知的交互类型: ",e.interruptType]})}}const Id=[{value:1,label:"事实错误"},{value:2,label:"逻辑问题"},{value:3,label:"不相关"},{value:4,label:"信息过时"},{value:5,label:"冗长啰嗦"},{value:6,label:"难以理解"}];function aa({message:e,onCopy:t,onRegenerate:n,onFeedback:r}){const{status:i,cancelFeedback:s}=je(),[a,o]=k.useState(null),[l,u]=k.useState(!1),[p,c]=k.useState(!1),h=k.useRef(null),f=k.useCallback(()=>{t(),u(!0),setTimeout(()=>u(!1),2e3)},[t]),g=k.useCallback(()=>{a==="like"?(o(null),s(e.id)):(o("like"),c(!1),r==null||r(e.id,"like"))},[a,e.id,r,s]),y=k.useCallback(()=>{a==="dislike"?(o(null),c(!1),s(e.id)):c(!0)},[a,e.id,s]),C=k.useCallback((E,S)=>{o("dislike"),c(!1),r==null||r(e.id,"dislike",{reason:E,remark:(S==null?void 0:S.trim())||void 0})},[e.id,r]),w=k.useCallback(()=>{c(!1)},[]);return k.useEffect(()=>{if(!p)return;const E=z=>{h.current&&!h.current.contains(z.target)&&c(!1)},S=z=>{z.key==="Escape"&&c(!1)};return document.addEventListener("mousedown",E),document.addEventListener("keydown",S),()=>{document.removeEventListener("mousedown",E),document.removeEventListener("keydown",S)}},[p]),i!=="ready"&&i!=="error"?null:d.jsxs("div",{className:"sa-action-bar",children:[d.jsxs("button",{className:"sa-action-btn",onClick:f,title:"复制",children:[d.jsx(Q,{name:l?"circle-check":"copy",size:14})," ",l?"已复制":"复制"]}),n&&d.jsxs("button",{className:"sa-action-btn",onClick:n,title:"重新生成",children:[d.jsx(Q,{name:"refresh-cw",size:14})," 重新生成"]}),r&&d.jsxs(d.Fragment,{children:[d.jsx("span",{className:"sa-action-divider"}),d.jsx("button",{className:`sa-action-btn ${a==="like"?"sa-action-btn-active":""}`,onClick:g,title:"有用","aria-label":"点赞",children:d.jsx(Q,{name:"thumbs-up",size:14})}),d.jsx("button",{className:`sa-action-btn ${a==="dislike"?"sa-action-btn-active":""}`,onClick:y,title:"无用","aria-label":"踩","aria-expanded":p,"aria-haspopup":"dialog",children:d.jsx(Q,{name:"thumbs-down",size:14})})]}),p&&d.jsx("div",{ref:h,children:d.jsx(Td,{onSubmit:C,onCancel:w})})]})}function Td({onSubmit:e,onCancel:t}){const[n,r]=k.useState(void 0),[i,s]=k.useState("");return d.jsxs("div",{className:"sa-dislike-panel",children:[d.jsx("div",{className:"sa-dislike-panel-title",children:"请选择不满意的原因(可选)"}),d.jsx("div",{className:"sa-dislike-reasons",children:Id.map(a=>d.jsx("button",{className:`sa-dislike-reason-btn ${n===a.value?"active":""}`,onClick:()=>r(n===a.value?void 0:a.value),children:a.label},a.value))}),d.jsx("textarea",{className:"sa-dislike-remark",placeholder:"补充描述(选填,≤500 字)",maxLength:500,value:i,onChange:a=>s(a.target.value),rows:2}),d.jsxs("div",{className:"sa-dislike-actions",children:[d.jsx("button",{className:"sa-dislike-submit",onClick:()=>e(n,i||void 0),children:"提交"}),d.jsx("button",{className:"sa-dislike-cancel",onClick:t,children:"取消"})]})]})}const zd=/^(https?:\/\/|data:|blob:|\/\/|\/|\.\/|\.\.\/)/;function Lr({src:e,alt:t}){return e?zd.test(e)?d.jsx("img",{src:e,alt:t??"",className:"sa-msg-avatar",draggable:!1}):d.jsx("span",{className:"sa-msg-avatar sa-msg-avatar-text",children:e}):null}function sa({message:e,isStreaming:t,isLast:n,slots:r,avatar:i,artifactPreview:s,showTimestamp:a}){const{regenerate:o,feedback:l,respondToInterrupt:u}=je(),p=k.useCallback(()=>{var A;const z=e.parts.filter(v=>v.type==="text").map(v=>v.content).join(`
30
+ `);(A=navigator.clipboard)==null||A.writeText(z).catch(()=>{})},[e]),c=e.role==="user",h=r.Message;if(h)return d.jsx(h,{message:e,isStreaming:t,isLast:n,avatar:i,slots:r,onCopy:p,onRegenerate:o,onFeedback:l,showTimestamp:a});const f=r.TextPart??Qi,g=r.ThinkingPart??Zi,y=r.ToolCallPart??ea,C=r.ToolResultPart??ta,w=r.ErrorPart??na,E=r.ActionBar??aa,S=!c&&e.parts.some(z=>z.type==="text"&&z.content);return d.jsxs("div",{className:`sa-message ${c?"sa-message-user":"sa-message-assistant"}`,children:[!c&&d.jsx(Lr,{src:(i==null?void 0:i.assistant)||(t&&n?ce.assistantAvatarGenerating:ce.assistantAvatar),alt:"AI"}),d.jsxs("div",{className:"sa-message-content",children:[a&&d.jsx("span",{className:`sa-message-time ${c?"sa-message-time-right":""}`,children:ya(e.timestamp)}),d.jsxs("div",{className:"sa-message-body",children:[e.parts.map((z,A)=>{switch(z.type){case"text":return d.jsx(f,{content:z.content},A);case"attachment":return d.jsx(xd,{attachment:z.attachment},A);case"thinking":return d.jsx(g,{content:z.content},A);case"tool_call":return d.jsx(y,{toolName:z.toolName,toolCallId:z.toolCallId,args:z.args},A);case"tool_result":return d.jsx(C,{toolName:z.toolName,toolCallId:z.toolCallId,content:z.content,artifacts:z.artifacts,renderMode:z.renderMode,html:z.html,artifactPreview:s},A);case"error":return d.jsx(w,{content:z.content,onRetry:o},A);case"interrupt":return d.jsx(ia,{interrupt:z.interrupt,resolved:z.resolved??!1,response:z.response,onRespond:v=>u(z.interrupt.interruptId,v)},A);default:return null}}),t&&n&&!c&&!S&&d.jsx("span",{className:"sa-thinking-indicator",children:"思考中…"}),!c&&!t&&S&&d.jsx(E,{message:e,onCopy:p,onRegenerate:n?o:void 0,onFeedback:l})]})]}),c&&(i==null?void 0:i.user)&&d.jsx(Lr,{src:i.user,alt:"用户"})]})}function oa({message:e,suggestedPrompts:t,onPromptClick:n,capabilities:r,quickLinks:i,logo:s,openPanel:a}){const o=l=>{if(l.onClick){l.onClick();return}const u=l.action;if(!u){l.prompt&&n(l.prompt);return}a==null||a(u.type==="link"?u:{...u,title:u.title??l.label})};return d.jsxs("div",{className:"flex flex-col gap-8 py-2",children:[d.jsxs("div",{className:"flex flex-col items-center gap-1 opacity-0 animate-sa-home-fade-in",children:[d.jsx("img",{src:s||ce.logo,alt:"AI 助手",className:"block max-w-16 shrink-0 animate-sa-logo-float",draggable:!1}),d.jsx("h3",{className:"sa-shimmer-text m-0 mb-1 text-[18px] font-bold leading-[1.3] text-[#333] animate-sa-title-shimmer",children:e||"你好!有什么可以帮你的?"})]}),r&&r.length>0&&d.jsx("div",{className:"flex flex-col items-start gap-4 opacity-0 animate-sa-home-fade-in",style:{animationDelay:"150ms"},children:r.map(l=>d.jsxs("div",{className:"inline-flex w-full max-w-full min-w-0 items-center gap-[7px]",children:[l.icon&&d.jsx("img",{src:l.icon,alt:"",className:"h-[18px] w-[18px] shrink-0 object-contain",draggable:!1}),d.jsx("span",{className:"shrink-0 text-[14px] leading-[1.4] text-[#333]",children:l.label}),l.desc&&d.jsxs(d.Fragment,{children:[d.jsx("span",{className:"h-[13px] w-px shrink-0 bg-[#DCDCDC]"}),d.jsx("span",{className:"min-w-0 overflow-hidden text-ellipsis whitespace-nowrap text-[14px] leading-[1.4] text-[#9A9A9A]",children:l.desc})]})]},l.label))}),t&&t.length>0&&d.jsx("div",{className:"flex flex-col items-start gap-3",children:t.map((l,u)=>d.jsxs("button",{type:"button",className:"sa-chip inline-flex h-7 items-center gap-1 rounded-md px-3 text-[14px] leading-none text-[#333] opacity-0 transition-colors animate-sa-chip-in",style:{animationDelay:`${300+u*130}ms`},onClick:()=>n(l),children:[d.jsx("span",{className:"sa-chip-text overflow-hidden text-ellipsis whitespace-nowrap",children:l}),d.jsx("svg",{width:13,height:13,viewBox:"0 0 14 14",fill:"none",className:"shrink-0 text-[#9A9A9A]","aria-hidden":"true",children:d.jsx("path",{d:"M5 3L9 7L5 11",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})]},`${l}-${u}`))}),i&&i.length>0&&d.jsxs("div",{className:"opacity-0 animate-sa-home-fade-in",style:{animationDelay:"420ms"},children:[d.jsx("div",{className:"mb-3 text-[14px] leading-none text-[#A0A0A0]",children:"快速查看"}),d.jsx("div",{className:"flex flex-wrap items-center gap-[22px]",children:i.map(l=>d.jsxs("button",{type:"button",className:"inline-flex items-center gap-[7px] rounded-md px-1 py-1 transition-colors hover:bg-[#F5F5F5]",onClick:()=>o(l),children:[l.icon&&d.jsx("span",{className:"flex h-[18px] w-[18px] shrink-0 items-center justify-center opacity-70",children:d.jsx("img",{src:l.icon,alt:"",width:18,height:18,draggable:!1})}),d.jsx("span",{className:"text-[14px] leading-none text-[#333] transition-colors hover:text-[#1881F0]",children:l.label})]},l.label))})]})]})}function Dn({slots:e,welcomeMessage:t,suggestedPrompts:n,avatar:r,artifactPreview:i,capabilities:s,quickLinks:a,logo:o,showTimestamp:l}){const{messages:u,status:p,sendMessage:c,openPanel:h}=je(),{containerRef:f}=Vr([u]),g=p==="streaming",y=e.WelcomeScreen??oa,C=e.AppendContainer;return u.length===0?d.jsxs("div",{className:"sa-thread",ref:f,children:[d.jsx(y,{message:t,suggestedPrompts:n,onPromptClick:c,capabilities:s,quickLinks:a,logo:o,openPanel:h}),C&&d.jsx(C,{openPanel:h})]}):d.jsx("div",{className:"sa-thread",ref:f,children:u.map((w,E)=>d.jsx(sa,{message:w,isStreaming:g,isLast:E===u.length-1,slots:e,avatar:r,artifactPreview:i,showTimestamp:l},w.id))})}function Ad({items:e,activeIndex:t,onSelect:n}){const r=k.useRef(null);return k.useEffect(()=>{var s;const i=(s=r.current)==null?void 0:s.children[t];i==null||i.scrollIntoView({block:"nearest"})},[t]),e.length===0?d.jsx("div",{className:"sa-slash-menu",children:d.jsx("div",{className:"sa-slash-menu-empty",children:"没有匹配的技能"})}):d.jsx("div",{className:"sa-slash-menu",ref:r,children:e.map((i,s)=>d.jsxs("div",{className:`sa-slash-menu-item${s===t?" sa-slash-menu-item--active":""}`,onMouseDown:a=>{a.preventDefault(),n(i)},children:[d.jsxs("span",{className:"sa-slash-menu-item-name",children:["/",i.name]}),(i.displayName||i.description)&&d.jsx("span",{className:"sa-slash-menu-item-desc",children:i.displayName||i.description})]},i.code))})}function Nd({sdk:e,input:t,onSelect:n}){const[r,i]=k.useState([]),[s,a]=k.useState(!1),[o,l]=k.useState(0),u=k.useRef(!1);k.useEffect(()=>{u.current||(u.current=!0,e.listSkills().then(i).catch(()=>i([])))},[e]);const p=/^\/\S*$/.test(t);k.useEffect(()=>{a(p)},[p]),k.useEffect(()=>{p&&l(0)},[t,p]);const c=t.startsWith("/")?t.slice(1).toLowerCase():"",h=k.useMemo(()=>r.filter(S=>!c||S.code.toLowerCase().includes(c)||S.name.toLowerCase().includes(c)||S.displayName&&S.displayName.toLowerCase().includes(c)),[r,c]),f=k.useRef(s),g=k.useRef(h),y=k.useRef(o),C=k.useRef(n);f.current=s,g.current=h,y.current=o,C.current=n;const w=k.useCallback(S=>{if(!f.current||g.current.length===0)return!1;switch(S.key){case"ArrowDown":return S.preventDefault(),l(z=>(z+1)%g.current.length),!0;case"ArrowUp":return S.preventDefault(),l(z=>(z-1+g.current.length)%g.current.length),!0;case"Enter":case"Tab":return S.preventDefault(),C.current(g.current[y.current]),a(!1),!0;case"Escape":return S.preventDefault(),a(!1),!0;default:return!1}},[]),E=k.useCallback(()=>a(!1),[]);return{isOpen:s,items:h,activeIndex:o,handleKeyDown:w,close:E}}const Dd=10;function Ld({size:e=16}){return d.jsx("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:d.jsx("path",{d:"M21.44 11.05l-9.19 9.19a6 6 0 0 1-8.49-8.49l9.19-9.19a4 4 0 0 1 5.66 5.66l-9.2 9.19a2 2 0 0 1-2.83-2.83l8.49-8.48"})})}function Ln(){const{status:e,sendMessage:t,stop:n,sdk:r,attachmentUploader:i,nosUpload:s}=je(),[a,o]=k.useState(""),[l,u]=k.useState([]),p=k.useRef(null),c=k.useRef(null),h=!!i||!!s,f=e==="streaming"||e==="submitted",g=l.filter(b=>b.attachment),y=l.some(b=>!b.attachment&&b.status==="uploading"),C=!!a.trim()||l.length>0||f,w=!f&&!y&&(a.trim().length>0||g.length>0),E=k.useCallback(b=>{o(`/${b.name} `),setTimeout(()=>{const j=p.current;j&&(j.focus(),j.selectionStart=j.selectionEnd=j.value.length)},0)},[]),S=Nd({sdk:r,input:a,onSelect:E}),z=k.useCallback(b=>{const j=Array.from(b.target.files??[]);if(b.target.value="",!h||j.length===0)return;const T=Dd-l.length,M=j.slice(0,Math.max(0,T));if(M.length===0)return;const F=M.map(_=>({key:`${_.name}_${_.size}_${Date.now()}_${Math.random().toString(36).slice(2,6)}`,file:_,status:"uploading"}));u(_=>[..._,...F]);for(const{key:_,file:H}of F)(i||Oe.createNosUploader({baseURL:s.baseURL,headers:s.headers,trunkSize:s.trunkSize,onProgress:D=>u(U=>U.map(x=>x.key===_?{...x,percent:D}:x))}))(H).then(D=>{u(U=>U.map(x=>x.key===_?{...x,attachment:{...D,filename:D.filename||H.name,size:D.size??H.size,mime:D.mime??H.type}}:x))}).catch(D=>{u(U=>U.map(x=>x.key===_?{...x,status:"error",errorMsg:D instanceof Error?D.message:String(D)}:x))})},[i,s,l]),A=k.useCallback(b=>{u(j=>j.filter(T=>T.key!==b))},[]),v=k.useCallback(()=>{if(!w)return;const b=a.trim(),j=g.map(T=>T.attachment);t(b,j.length>0?j:void 0),o(""),u([]),p.current&&(p.current.style.height="auto")},[w,a,g,t]),N=k.useCallback(b=>{S.handleKeyDown(b)||b.key==="Enter"&&!b.shiftKey&&(b.preventDefault(),v())},[v,S.handleKeyDown]),O=k.useCallback(b=>{o(b.target.value);const j=b.target;j.style.height="auto",j.style.height=Math.min(j.scrollHeight,90)+"px"},[]),$=k.useCallback(()=>{var b;f||(b=p.current)==null||b.focus()},[f]);return d.jsxs("div",{className:"relative z-[2] shrink-0 px-[15px] pb-2.5",children:[S.isOpen&&d.jsx(Ad,{items:S.items,activeIndex:S.activeIndex,onSelect:E}),l.length>0&&d.jsx("div",{className:"sa-attachment-tray mb-1.5",onClick:b=>b.stopPropagation(),children:l.map(b=>d.jsxs("span",{className:`sa-attachment-tray-chip ${b.status==="error"?"sa-attachment-tray-chip-error":""}`,title:b.status==="error"?`上传失败:${b.errorMsg??""}`:b.file.name,children:[d.jsx(Q,{name:"file-text",size:13,color:b.status==="error"?"#ef4444":"#6366f1"}),d.jsx("span",{className:"sa-attachment-tray-chip-name",children:b.file.name}),d.jsx("span",{className:"sa-attachment-tray-chip-size",children:b.attachment?ra(b.file.size):b.status==="error"?"失败":b.percent!=null?`${Math.min(99,Math.round(b.percent))}%`:"上传中…"}),d.jsx("button",{type:"button",className:"sa-attachment-tray-chip-remove","aria-label":`移除附件 ${b.file.name}`,onClick:()=>A(b.key),children:"✕"})]},b.key))}),d.jsxs("form",{className:`sa-input-form relative flex min-h-[70px] cursor-text items-start gap-2 rounded-[5px] p-2 ${C?"sa-input-form-active":""}`,onClick:$,onSubmit:b=>{b.preventDefault(),v()},children:[h&&!f&&d.jsx("button",{type:"button",className:"sa-attach-btn absolute bottom-[8px] left-[8px]","aria-label":"添加附件",title:"添加附件",onClick:()=>{var b;return(b=c.current)==null?void 0:b.click()},children:d.jsx(Ld,{size:15})}),d.jsx("input",{ref:c,type:"file",multiple:!0,className:"hidden",onChange:z,"aria-label":"选择附件"}),d.jsx("div",{className:"flex min-w-0 flex-1 flex-col",children:d.jsx("div",{className:"flex items-end",children:d.jsx("textarea",{ref:p,className:`sa-input-field min-h-[34px] flex-1 resize-none border-none bg-transparent p-0 text-[14px] leading-[1.5] text-[#333] outline-none placeholder:text-[#B8B8B8] ${h?"pl-[4px]":""}`,value:a,onChange:O,onKeyDown:N,placeholder:"请输入你想要了解的关键词",rows:1,disabled:f})})}),f?d.jsx("button",{type:"button",className:"sa-send-btn sa-send-btn-active","aria-label":"停止生成",title:"停止生成",onClick:n,children:d.jsx("span",{className:"sa-stop-icon"})}):d.jsx("button",{type:"submit",className:`sa-send-btn ${w?"sa-send-btn-active":""}`,"aria-label":"发送",title:"发送",disabled:!w,children:d.jsx("img",{src:ce.sendSolid,alt:"发送",width:14,height:14,draggable:!1})})]}),d.jsx("div",{className:"mt-3 text-center text-[11px] leading-none text-[#B8B8B8]",children:"所有内容均由AI生成仅供参考"})]})}function Md({artifact:e}){const[t,n]=k.useState(null),[r,i]=k.useState(!0),[s,a]=k.useState(null);return k.useEffect(()=>{let o=!1;i(!0),a(null),n(null);async function l(){try{if(e.type==="pdf"){o||i(!1);return}if(e.type==="html"){const u=await fetch(e.url);if(!u.ok)throw new Error(`HTTP ${u.status}`);const p=await u.text(),c=(await Promise.resolve().then(()=>require("./purify.es-Dsdnkgrg.cjs"))).default;o||(n(c.sanitize(p,{FORCE_BODY:!0,ADD_ATTR:["target"]})),i(!1));return}if(e.type==="docx"){const u=await fetch(e.url);if(!u.ok)throw new Error(`HTTP ${u.status}`);const p=await u.arrayBuffer(),h=await(await Promise.resolve().then(()=>require("./mammoth.browser-BX8glWVC.cjs")).then(g=>g.mammoth_browser)).convertToHtml({arrayBuffer:p}),f=(await Promise.resolve().then(()=>require("./purify.es-Dsdnkgrg.cjs"))).default;o||(n(f.sanitize(h.value,{FORCE_BODY:!0,ADD_ATTR:["target"]})),i(!1));return}o||(i(!1),a(`不支持预览「${e.type}」类型`))}catch(u){o||(i(!1),a(u instanceof Error?u.message:"加载失败"))}}return l(),()=>{o=!0}},[e]),r?d.jsx("div",{className:"sa-drawer-preview-loading",children:"加载中"}):s?d.jsxs("div",{className:"sa-drawer-preview-error",children:[s,d.jsx("button",{className:"sa-drawer-btn-sm",onClick:()=>void kt(e),children:"下载查看"})]}):e.type==="pdf"?d.jsx("iframe",{src:e.url,title:e.filename,className:"sa-drawer-preview-iframe",sandbox:"allow-scripts"}):t!==null?d.jsx("div",{className:"sa-drawer-preview-html-scroll",children:d.jsx("div",{className:"sa-drawer-preview-html sa-text-part",dangerouslySetInnerHTML:{__html:t}})}):null}function Rd({artifacts:e,initialArtifact:t,onClose:n}){const[r,i]=k.useState(t?{mode:"preview",artifact:t}:{mode:"list"}),[s,a]=k.useState(!1),o=k.useRef(null),[l,u]=k.useState(340),p=k.useRef(null);k.useEffect(()=>{t&&(o.current&&(clearTimeout(o.current),o.current=null,a(!1)),i({mode:"preview",artifact:t}))},[t]);const c=k.useCallback(()=>{a(!0),o.current=setTimeout(()=>{o.current=null,n()},240)},[n]);k.useEffect(()=>()=>{var y;o.current&&clearTimeout(o.current),(y=p.current)==null||y.call(p)},[]);const h=k.useCallback(y=>{i({mode:"preview",artifact:y})},[]),f=k.useCallback(()=>{i({mode:"list"})},[]);k.useEffect(()=>{const y=C=>{C.key==="Escape"&&c()};return document.addEventListener("keydown",y),()=>document.removeEventListener("keydown",y)},[c]);const g=k.useCallback(y=>{y.preventDefault();const C=y.clientX,w=l,E=z=>{const A=C-z.clientX;u(Math.max(240,Math.min(window.innerWidth*.7,w+A)))},S=()=>{document.removeEventListener("mousemove",E),document.removeEventListener("mouseup",S),document.body.style.cursor="",document.body.style.userSelect="",p.current=null};document.body.style.cursor="col-resize",document.body.style.userSelect="none",document.addEventListener("mousemove",E),document.addEventListener("mouseup",S),p.current=S},[l]);return d.jsxs("div",{className:`sa-artifact-drawer ${s?"sa-drawer-closing":""}`,style:{width:l},children:[d.jsx("div",{className:"sa-drawer-resize-handle",onMouseDown:g}),d.jsxs("div",{className:"sa-artifact-drawer-header",children:[r.mode==="preview"?d.jsxs(d.Fragment,{children:[d.jsx("button",{className:"sa-drawer-btn",onClick:f,title:"返回列表","aria-label":"返回列表",children:d.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:d.jsx("path",{d:"M15 18l-6-6 6-6"})})}),d.jsx("span",{className:"sa-artifact-drawer-title",children:r.artifact.filename})]}):d.jsxs(d.Fragment,{children:[d.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",style:{flexShrink:0},children:[d.jsx("path",{d:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"}),d.jsx("polyline",{points:"14 2 14 8 20 8"})]}),d.jsx("span",{className:"sa-artifact-drawer-title",children:"会话产物"})]}),d.jsx("div",{style:{flex:1}}),r.mode==="preview"&&d.jsx("button",{className:"sa-drawer-btn",onClick:()=>void kt(r.artifact),title:"下载","aria-label":"下载",children:d.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:d.jsx("path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4M7 10l5 5 5-5M12 15V3"})})}),d.jsx("button",{className:"sa-drawer-btn",onClick:c,title:"关闭","aria-label":"关闭",children:d.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:d.jsx("path",{d:"M18 6L6 18M6 6l12 12"})})})]}),d.jsx("div",{className:"sa-artifact-drawer-body",children:r.mode==="list"?e.length===0?d.jsx("div",{className:"sa-drawer-empty",children:"暂无产物"}):d.jsx("ul",{className:"sa-drawer-file-list",role:"list",children:e.map((y,C)=>d.jsxs("li",{className:"sa-drawer-file-card",onClick:()=>h(y),onKeyDown:w=>{(w.key==="Enter"||w.key===" ")&&(w.preventDefault(),h(y))},tabIndex:0,role:"button","aria-label":`预览 ${y.filename}`,children:[d.jsx("div",{className:"sa-drawer-file-icon",children:d.jsx("span",{className:"sa-artifact-chip-type",children:_r(y.type)})}),d.jsxs("div",{className:"sa-drawer-file-info",children:[d.jsx("span",{className:"sa-drawer-file-name",children:y.filename}),d.jsx("span",{className:"sa-drawer-file-size",children:Fr(y.size)})]}),d.jsx("button",{className:"sa-drawer-btn",title:"下载","aria-label":`下载 ${y.filename}`,onClick:w=>{w.stopPropagation(),kt(y)},children:d.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:d.jsx("path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4M7 10l5 5 5-5M12 15V3"})})})]},y.id||`artifact-${C}`))}):d.jsx("div",{className:"sa-drawer-view-enter",children:d.jsx(Md,{artifact:r.artifact})})})]})}function la({page:e,onBack:t,centered:n}){k.useEffect(()=>{const i=s=>{s.key==="Escape"&&t()};return document.addEventListener("keydown",i),()=>document.removeEventListener("keydown",i)},[t]);const r=k.isValidElement(e.component)?k.cloneElement(e.component,{close:t}):k.createElement(e.component,{close:t});return d.jsxs("div",{className:`sa-page-overlay ${n?"sa-page-overlay-centered":""}`,children:[d.jsxs("div",{className:"sa-page-overlay-bar",children:[d.jsx("button",{className:"sa-drawer-btn",onClick:t,title:"返回","aria-label":"返回",children:d.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:d.jsx("path",{d:"M15 18l-6-6 6-6"})})}),e.title&&d.jsx("span",{className:"sa-page-overlay-title",children:e.title})]}),d.jsx("div",{className:"sa-page-overlay-body",children:r})]})}const Pd="mx-auto w-full max-w-[800px]";function ua({contentClassName:e,centered:t,composerClassName:n,thread:r,composer:i,artifactPreview:s}){const{activePanel:a,closePanel:o,messagesLoading:l,isArtifactDrawerOpen:u,allArtifacts:p,activePreviewArtifact:c,toggleArtifactDrawer:h}=je();if(a)return d.jsx(la,{page:a,onBack:o,centered:t});const f=t?Pd:"";return d.jsxs(d.Fragment,{children:[d.jsxs("div",{className:`${e} ${f}`,children:[l?d.jsxs("div",{className:"sa-messages-loading",children:[d.jsx("span",{className:"sa-loading-spinner"}),"加载对话..."]}):r,s&&u&&d.jsx(Rd,{artifacts:p,initialArtifact:c,onClose:h})]}),n?d.jsx("div",{className:`${n} ${f}`,children:i}):i]})}function Fd({isOpen:e,onClose:t,title:n,slots:r,welcomeMessage:i,suggestedPrompts:s,avatar:a,artifactPreview:o,capabilities:l,quickLinks:u,logo:p,defaultWidth:c,defaultHeight:h,showTimestamp:f}){const{status:g,sendMessage:y,stop:C,toggleThreadList:w,setThreadListOpen:E,isThreadListOpen:S,toggleArtifactDrawer:z,allArtifacts:A,activePanel:v,closePanel:N,messages:O,messagesLoading:$,conversations:b,activeConversationId:j,switchConversation:T,newConversation:M,deleteConversation:F,renameConversation:_,hasMore:H,loadMoreConversations:X}=je(),{width:D,position:U,hasCustomPosition:x,isMaximized:B,totalWidth:P,windowHeight:m,startWindowDrag:Z,startResize:se,toggleMaximize:re,reset:he,setLockedHeight:q}=xa({defaultWidth:c??ue.DEFAULT_WIDTH,defaultHeight:h??ue.DEFAULT_HEIGHT,sidebarWidth:0}),ie=k.useRef(null),oe=k.useRef(null),Se=!$&&O.length===0,He=!$&&O.length>0,Ue=!!v;k.useEffect(()=>{e||(he(),N())},[e,he,N]),k.useEffect(()=>{E(B?ie.current??!0:oe.current??!1)},[B,E]),k.useEffect(()=>{He||q(null)},[He,q]);const Dt=ba({enabled:e&&He&&!B&&!Ue,contentSelector:".sa-panel-content",defaultHeight:h??ue.DEFAULT_HEIGHT,onHeightChange:q});if(!e)return null;const Ke=r.Header,Qe=r.Composer,Le=r.ThreadList,Lt=()=>{const G=!S;w(),B?ie.current=G:oe.current=G},Je=200,Ze=S&&!B,ye="var(--sa-radius, 16px)",ht=Ze?`0px ${ye} ${ye} 0px`:`${ye} ${ye} ${ye} ${ye}`,Mt=x?U.x:window.innerWidth-P-20,Ve=Math.min(Je,Math.max(0,Mt-1)),Rt=x?{width:`${P}px`,height:`${m}px`,left:`${U.x}px`,top:`${U.y}px`}:{width:`${P}px`,height:`${m}px`,right:"20px",bottom:"20px"},I={title:n,onClose:t,onToggleThreadList:Lt,isMaximized:B,onToggleMaximize:re,showHome:He&&!Ue,onHome:M,artifactCount:Ue||!o?0:A.length,onToggleArtifactDrawer:Ue||!o?void 0:z},R={conversations:b,activeSessionId:j,onSwitch:T,onNew:M,onDelete:F,onRename:_,hasMore:H,onLoadMore:X},W=d.jsxs("div",{className:`relative flex min-w-0 flex-col bg-white ${B?"flex-1":"h-full shrink-0"}`,style:B?void 0:{width:`${D}px`,borderRadius:ht,overflow:"hidden"},children:[Se&&d.jsxs(d.Fragment,{children:[d.jsx("div",{className:"sa-home-gradient pointer-events-none absolute inset-x-0 top-0 z-0 h-[238px] opacity-10"}),d.jsx("div",{className:"sa-home-gradient-fade pointer-events-none absolute inset-x-0 top-0 z-[1] h-[238px]"})]}),d.jsx("div",{className:`relative z-20 ${Se||B?"":"bg-white"} ${B?"cursor-default":"cursor-grab active:cursor-grabbing"}`,onMouseDown:B?void 0:Z,children:Ke?d.jsx(Ke,{...I}):d.jsx(Hr,{...I})}),d.jsx(ua,{contentClassName:`sa-panel-content relative z-[2] ${Se?"sa-home-view":""}`,centered:B,composerClassName:"shrink-0",artifactPreview:o,thread:d.jsx(Dn,{slots:r,welcomeMessage:i,suggestedPrompts:s,avatar:a,artifactPreview:o,capabilities:l,quickLinks:u,logo:p,showTimestamp:f}),composer:Qe?d.jsx(Qe,{status:g,onSend:y,onStop:C}):d.jsx(Ln,{})})]});return B?d.jsx("div",{className:"fixed inset-0 z-[var(--sa-z-index,9999)] flex animate-sa-fade-in flex-col justify-end bg-black/30",children:d.jsxs("div",{className:"flex h-[calc(100%_-_48px)] w-full animate-sa-slide-up-full flex-row overflow-hidden bg-[#F5F5F5] shadow-[0_-12px_48px_rgba(0,0,0,0.25)]",style:{borderRadius:"var(--sa-radius, 16px) var(--sa-radius, 16px) 0px 0px"},children:[S&&(Le?d.jsx(Le,{...R}):d.jsx(Zt,{width:220})),W]})}):d.jsxs("div",{ref:Dt,className:"fixed z-[var(--sa-z-index,9999)] flex animate-sa-window-in flex-row overflow-visible border border-[#DADADA] bg-white shadow-[0_12px_36px_rgba(0,0,0,0.18)]",style:{...Rt,borderRadius:ht},children:[d.jsx("div",{className:"sa-resize-handle absolute bottom-0 left-[-3px] top-0 z-20 w-[6px] cursor-col-resize",onMouseDown:G=>se(G)}),Ze&&(Le?d.jsx("div",{className:"absolute -top-px -bottom-px -left-px z-10 overflow-hidden border border-r-0 border-[#DADADA] bg-[#FAFAFA] shadow-[0_12px_36px_rgba(0,0,0,0.18)]",style:{width:Ve,transform:`translateX(-${Ve}px)`,borderRadius:`${ye} 0px 0px ${ye}`},children:d.jsx(Le,{...R})}):d.jsx("div",{className:"absolute -top-px -bottom-px -left-px z-10 overflow-hidden border border-r-0 border-[#DADADA] bg-[#FAFAFA] shadow-[0_12px_36px_rgba(0,0,0,0.18)]",style:{width:Ve,transform:`translateX(-${Ve}px)`,borderRadius:`${ye} 0px 0px ${ye}`},children:d.jsx(Zt,{width:Je})})),W]})}const _d=()=>{};function Od({conversations:e,activeSessionId:t,onSwitch:n,onNew:r,onDelete:i,onRename:s,isCollapsed:a,onToggleCollapse:o,hasMore:l,onLoadMore:u,conversationsLoading:p}){const[c,h]=k.useState(null),[f,g]=k.useState(null),[y,C]=k.useState(""),[w,E]=k.useState(null),S=k.useRef(null);k.useEffect(()=>()=>{S.current&&clearTimeout(S.current)},[]);const z=k.useCallback((b,j)=>{j.stopPropagation(),c===b?(i(b),h(null)):(h(b),S.current&&clearTimeout(S.current),S.current=setTimeout(()=>h(null),3e3))},[c,i]),A=k.useCallback((b,j,T)=>{T.stopPropagation(),g(b),C(j??"")},[]),v=k.useCallback(b=>{y.trim()&&s(b,y.trim()),g(null)},[y,s]),N=k.useRef(null),O=k.useCallback(()=>{const b=N.current;!b||!l||!u||b.scrollHeight-b.scrollTop-b.clientHeight<50&&u()},[l,u]),$=k.useMemo(()=>Ur(e),[e]);return a?d.jsxs("div",{className:"flex w-12 shrink-0 flex-col items-center gap-1 border-r border-[#ECECEC] bg-[#FAFAFA] py-3",children:[d.jsx("button",{type:"button",className:"sa-tip relative flex h-7 w-7 items-center justify-center rounded-md text-[#666] transition-colors hover:bg-white","data-tooltip":"展开",onClick:o,children:d.jsx(Q,{name:"panel-left",size:18})}),d.jsx("button",{type:"button",className:"sa-tip relative flex h-7 w-7 items-center justify-center rounded-md text-[#666] transition-colors hover:bg-white","data-tooltip":"新建对话",onClick:()=>{r(),o()},children:d.jsx("img",{src:ce.messageCreate,alt:"",width:18,height:18})})]}):d.jsxs("div",{className:"relative flex w-[220px] shrink-0 flex-col border-r border-[#ECECEC] bg-[#FAFAFA] p-3",children:[d.jsxs("div",{className:"mb-4 flex shrink-0 items-center gap-1.5",children:[d.jsxs("button",{type:"button",className:"sa-new-chat flex h-8 flex-1 items-center justify-center gap-2 rounded-md text-[14px] font-medium transition-colors",onClick:r,children:[d.jsx("img",{src:ce.messageCreate,alt:"",width:18,height:18}),d.jsx("span",{className:"sa-new-chat-text whitespace-nowrap",children:"新建对话"})]}),d.jsx("button",{type:"button",className:"sa-tip relative flex h-7 w-7 shrink-0 items-center justify-center rounded-md text-[#666] transition-colors hover:bg-white","data-tooltip":"收起侧边栏",onClick:o,children:d.jsx(Q,{name:"panel-left-close",size:16})})]}),d.jsxs("div",{className:"px-1 pb-2.5",children:[d.jsx("div",{className:"mb-1 text-[14px] font-semibold text-[#333]",children:"历史对话"}),d.jsx("div",{className:"text-[11px] text-[#999]",children:"展示最近的会话记录"})]}),d.jsxs("div",{ref:N,className:"flex-1 overflow-y-auto",onScroll:O,children:[p&&e.length===0&&d.jsx("div",{className:"px-0.5 py-2 text-[12px] text-[#999]",children:"加载中..."}),!p&&e.length===0&&d.jsx("div",{className:"px-0.5 py-2 text-[12px] text-[#999]",children:"暂无记录"}),$.map(b=>d.jsxs("div",{className:"mb-1",children:[d.jsx("div",{className:"px-1 pb-1 pt-2 text-[11px] text-[#A0A0A0]",children:b.label}),b.items.map(j=>{const T=j.sessionId===t,M=c===j.sessionId;return d.jsx("div",{className:`group relative mb-0.5 flex h-8 w-full cursor-pointer items-center gap-1 rounded-md px-0.5 text-[13px] transition-colors ${T?"bg-[#E8F1FE]":"hover:bg-[#E8F1FE]"}`,onClick:()=>{f!==j.sessionId&&n(j.sessionId)},onMouseEnter:F=>{if(f===j.sessionId)return;const _=F.currentTarget.getBoundingClientRect();E({text:j.title||"新会话",x:_.right+8,y:_.top+_.height/2})},onMouseLeave:()=>E(null),children:f===j.sessionId?d.jsx("input",{className:"w-full rounded border border-[var(--sa-primary)] bg-white px-1.5 py-0.5 text-[12px] outline-none",value:y,onChange:F=>C(F.target.value),onBlur:()=>v(j.sessionId),onKeyDown:F=>{F.key==="Enter"&&v(j.sessionId),F.key==="Escape"&&g(null)},onClick:F=>F.stopPropagation(),autoFocus:!0}):d.jsxs(d.Fragment,{children:[d.jsx("img",{src:ce.message,alt:"",width:16,height:16,className:"shrink-0 opacity-60"}),d.jsx("span",{className:"flex-1 overflow-hidden text-ellipsis whitespace-nowrap text-left text-[#333]",children:j.title||"新会话"}),d.jsxs("span",{className:"hidden shrink-0 items-center gap-0.5 group-hover:flex",children:[d.jsx("button",{type:"button",className:"flex h-5 w-5 items-center justify-center rounded text-[#999] hover:bg-white/70 hover:text-[var(--sa-primary)]",onClick:F=>A(j.sessionId,j.title,F),title:"重命名",children:d.jsx(Q,{name:"pen",size:12})}),d.jsx("button",{type:"button",className:`flex h-5 w-5 items-center justify-center rounded ${M?"bg-[#fee2e2] text-[#ef4444]":"text-[#999] hover:bg-white/70 hover:text-[#ef4444]"}`,onClick:F=>z(j.sessionId,F),title:M?"确认删除":"删除",children:d.jsx(Q,{name:M?"x":"trash2",size:12})})]})]})},j.sessionId)})]},b.label)),l&&d.jsx("div",{className:"px-0.5 py-2 text-center text-[11px] text-[#C0C0C0]",children:"向下滚动加载更多"})]}),w&&d.jsx("div",{className:"pointer-events-none fixed z-[10001] whitespace-nowrap rounded border border-[#E8E8E8] bg-white px-2.5 py-1.5 text-[12px] leading-[1.4] text-[#333] shadow-[0_2px_8px_rgba(0,0,0,0.12)]",style:{left:w.x,top:w.y,transform:"translateY(-50%)"},children:w.text})]})}function ca({title:e,slots:t,welcomeMessage:n,suggestedPrompts:r,capabilities:i,quickLinks:s,logo:a,sidebarDefaultOpen:o=!0,onClose:l,avatar:u,artifactPreview:p,showTimestamp:c}){const{status:h,sendMessage:f,stop:g,conversations:y,activeConversationId:C,switchConversation:w,newConversation:E,deleteConversation:S,renameConversation:z,toggleArtifactDrawer:A,allArtifacts:v,activePanel:N,closePanel:O,hasMore:$,loadMoreConversations:b,conversationsLoading:j}=je(),[T,M]=k.useState(o),F=k.useCallback(()=>M(U=>!U),[]),_=!!N;k.useEffect(()=>()=>O(),[O]);const H=t.ThreadList,X=t.Composer,D=t.Header;return d.jsxs("div",{className:"sa-fullpage",children:[H?d.jsx("div",{className:`sa-fp-sidebar-wrapper ${T?"":"sa-fp-sidebar-wrapper-collapsed"}`,children:d.jsx(H,{conversations:y,activeSessionId:C,onSwitch:w,onNew:E,onDelete:S,onRename:z,hasMore:$,onLoadMore:b})}):d.jsx(Od,{conversations:y,activeSessionId:C,onSwitch:w,onNew:E,onDelete:S,onRename:z,isCollapsed:!T,onToggleCollapse:F,hasMore:$,onLoadMore:b,conversationsLoading:j}),d.jsxs("div",{className:"sa-fp-main",children:[D?d.jsx(D,{title:e,onClose:l??_d,onToggleThreadList:F,artifactCount:_||!p?0:v.length,onToggleArtifactDrawer:_||!p?void 0:A}):d.jsxs("div",{className:"sa-fp-header",children:[d.jsx("div",{className:"sa-fp-header-title",children:e}),d.jsx("div",{className:"sa-fp-header-actions",children:!_&&p&&v.length>0&&d.jsxs("button",{className:"sa-fp-header-btn sa-header-btn-artifact",onClick:A,title:"会话产物",children:[d.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[d.jsx("path",{d:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"}),d.jsx("polyline",{points:"14 2 14 8 20 8"})]}),d.jsx("span",{children:"产物"})]})})]}),d.jsx(ua,{contentClassName:"sa-fp-content-row",artifactPreview:p,thread:d.jsx(Dn,{slots:t,welcomeMessage:n,suggestedPrompts:r,capabilities:i,quickLinks:s,logo:a,avatar:u,artifactPreview:p,showTimestamp:c}),composer:X?d.jsx(X,{status:h,onSend:f,onStop:g}):d.jsx(Ln,{})})]})]})}function pa(e){const{sdk:t,mode:n="floating",slots:r={},hooks:i={},welcomeMessage:s,suggestedPrompts:a,title:o="AI Assistant",initialOpen:l=!1,onOpenChange:u,sidebarDefaultOpen:p,avatar:c,artifactPreview:h,capabilities:f,quickLinks:g,logo:y,triggerLogo:C,theme:w,showTimestamp:E,attachmentUploader:S,nosUpload:z}=e,[A,v]=k.useState(l);k.useEffect(()=>{v(l)},[l]);const N=k.useCallback(()=>{var j,T;const b=!A;v(b),u==null||u(b),b?(j=i.onOpen)==null||j.call(i):(T=i.onClose)==null||T.call(i)},[A,i,u]),O=k.useCallback(()=>{var b;v(!1),u==null||u(!1),(b=i.onClose)==null||b.call(i)},[i,u]),$=r.Trigger??$r;return n==="fullpage"?A?d.jsx(Jt,{sdk:t,hooks:i,attachmentUploader:S,nosUpload:z,children:d.jsx(ca,{title:o,slots:r,welcomeMessage:s,suggestedPrompts:a,capabilities:f,quickLinks:g,logo:y,sidebarDefaultOpen:p,onClose:O,avatar:c,artifactPreview:h,showTimestamp:E})}):null:d.jsxs(Jt,{sdk:t,hooks:i,attachmentUploader:S,nosUpload:z,children:[d.jsx($,{isOpen:A,onClick:N,triggerLogo:C}),d.jsx(Fd,{isOpen:A,onClose:O,title:o,slots:r,welcomeMessage:s,suggestedPrompts:a,avatar:c,artifactPreview:h,capabilities:f,quickLinks:g,logo:y,defaultWidth:w==null?void 0:w.panelWidth,defaultHeight:w==null?void 0:w.panelHeight,showTimestamp:E})]})}const da=`
31
31
  [data-super-agent-widget] {
32
32
  --sa-primary-dark: color-mix(in srgb, var(--sa-primary) 82%, #000);
33
33
  --sa-primary-light: color-mix(in srgb, var(--sa-primary) 10%, #fff);
@@ -1269,5 +1269,5 @@
1269
1269
  from { opacity: 0; transform: translateY(10px); }
1270
1270
  to { opacity: 1; transform: translateY(0); }
1271
1271
  }
1272
- `,Bd='[data-super-agent-widget] .pointer-events-none{pointer-events:none}[data-super-agent-widget] .collapse{visibility:collapse}[data-super-agent-widget] .fixed{position:fixed}[data-super-agent-widget] .absolute{position:absolute}[data-super-agent-widget] .relative{position:relative}[data-super-agent-widget] .inset-0{top:0;right:0;bottom:0;left:0}[data-super-agent-widget] .inset-x-0{left:0;right:0}[data-super-agent-widget] .-bottom-px{bottom:-1px}[data-super-agent-widget] .-left-px{left:-1px}[data-super-agent-widget] .-right-2{right:-.5rem}[data-super-agent-widget] .-top-1\\.5{top:-.375rem}[data-super-agent-widget] .-top-px{top:-1px}[data-super-agent-widget] .bottom-0{bottom:0}[data-super-agent-widget] .bottom-\\[8px\\]{bottom:8px}[data-super-agent-widget] .left-\\[-3px\\]{left:-3px}[data-super-agent-widget] .left-\\[8px\\]{left:8px}[data-super-agent-widget] .top-0{top:0}[data-super-agent-widget] .z-0{z-index:0}[data-super-agent-widget] .z-10{z-index:10}[data-super-agent-widget] .z-20{z-index:20}[data-super-agent-widget] .z-\\[10000\\]{z-index:10000}[data-super-agent-widget] .z-\\[10001\\]{z-index:10001}[data-super-agent-widget] .z-\\[1\\]{z-index:1}[data-super-agent-widget] .z-\\[2\\]{z-index:2}[data-super-agent-widget] .z-\\[5\\]{z-index:5}[data-super-agent-widget] .z-\\[var\\(--sa-z-index\\,9999\\)\\]{z-index:var(--sa-z-index,9999)}[data-super-agent-widget] .m-0{margin:0}[data-super-agent-widget] .mx-auto{margin-left:auto;margin-right:auto}[data-super-agent-widget] .mb-0\\.5{margin-bottom:.125rem}[data-super-agent-widget] .mb-1{margin-bottom:.25rem}[data-super-agent-widget] .mb-1\\.5{margin-bottom:.375rem}[data-super-agent-widget] .mb-3{margin-bottom:.75rem}[data-super-agent-widget] .mb-4{margin-bottom:1rem}[data-super-agent-widget] .mt-3{margin-top:.75rem}[data-super-agent-widget] .block{display:block}[data-super-agent-widget] .inline{display:inline}[data-super-agent-widget] .flex{display:flex}[data-super-agent-widget] .inline-flex{display:inline-flex}[data-super-agent-widget] .table{display:table}[data-super-agent-widget] .hidden{display:none}[data-super-agent-widget] .h-5{height:1.25rem}[data-super-agent-widget] .h-7{height:1.75rem}[data-super-agent-widget] .h-8{height:2rem}[data-super-agent-widget] .h-9{height:2.25rem}[data-super-agent-widget] .h-\\[13px\\]{height:13px}[data-super-agent-widget] .h-\\[18px\\]{height:18px}[data-super-agent-widget] .h-\\[238px\\]{height:238px}[data-super-agent-widget] .h-\\[calc\\(100\\%_-_48px\\)\\]{height:calc(100% - 48px)}[data-super-agent-widget] .h-full{height:100%}[data-super-agent-widget] .min-h-\\[34px\\]{min-height:34px}[data-super-agent-widget] .min-h-\\[70px\\]{min-height:70px}[data-super-agent-widget] .w-12{width:3rem}[data-super-agent-widget] .w-5{width:1.25rem}[data-super-agent-widget] .w-7{width:1.75rem}[data-super-agent-widget] .w-\\[18px\\]{width:18px}[data-super-agent-widget] .w-\\[220px\\]{width:220px}[data-super-agent-widget] .w-\\[6px\\]{width:6px}[data-super-agent-widget] .w-full{width:100%}[data-super-agent-widget] .w-px{width:1px}[data-super-agent-widget] .min-w-0{min-width:0px}[data-super-agent-widget] .min-w-\\[14px\\]{min-width:14px}[data-super-agent-widget] .max-w-16{max-width:4rem}[data-super-agent-widget] .max-w-\\[800px\\]{max-width:800px}[data-super-agent-widget] .max-w-full{max-width:100%}[data-super-agent-widget] .flex-1{flex:1 1 0%}[data-super-agent-widget] .flex-shrink{flex-shrink:1}[data-super-agent-widget] .shrink-0{flex-shrink:0}[data-super-agent-widget] .border-collapse{border-collapse:collapse}[data-super-agent-widget] .scale-50{--tw-scale-x: .5;--tw-scale-y: .5;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}[data-super-agent-widget] .transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}[data-super-agent-widget] .cursor-col-resize{cursor:col-resize}[data-super-agent-widget] .cursor-default{cursor:default}[data-super-agent-widget] .cursor-grab{cursor:grab}[data-super-agent-widget] .cursor-pointer{cursor:pointer}[data-super-agent-widget] .cursor-text{cursor:text}[data-super-agent-widget] .select-none{-webkit-user-select:none;-moz-user-select:none;user-select:none}[data-super-agent-widget] .resize-none{resize:none}[data-super-agent-widget] .resize{resize:both}[data-super-agent-widget] .flex-row{flex-direction:row}[data-super-agent-widget] .flex-col{flex-direction:column}[data-super-agent-widget] .flex-wrap{flex-wrap:wrap}[data-super-agent-widget] .items-start{align-items:flex-start}[data-super-agent-widget] .items-end{align-items:flex-end}[data-super-agent-widget] .items-center{align-items:center}[data-super-agent-widget] .justify-end{justify-content:flex-end}[data-super-agent-widget] .justify-center{justify-content:center}[data-super-agent-widget] .justify-between{justify-content:space-between}[data-super-agent-widget] .gap-0\\.5{gap:.125rem}[data-super-agent-widget] .gap-1{gap:.25rem}[data-super-agent-widget] .gap-1\\.5{gap:.375rem}[data-super-agent-widget] .gap-2{gap:.5rem}[data-super-agent-widget] .gap-2\\.5{gap:.625rem}[data-super-agent-widget] .gap-3{gap:.75rem}[data-super-agent-widget] .gap-4{gap:1rem}[data-super-agent-widget] .gap-8{gap:2rem}[data-super-agent-widget] .gap-\\[22px\\]{gap:22px}[data-super-agent-widget] .gap-\\[7px\\]{gap:7px}[data-super-agent-widget] .overflow-hidden{overflow:hidden}[data-super-agent-widget] .overflow-visible{overflow:visible}[data-super-agent-widget] .overflow-y-auto{overflow-y:auto}[data-super-agent-widget] .text-ellipsis{text-overflow:ellipsis}[data-super-agent-widget] .whitespace-nowrap{white-space:nowrap}[data-super-agent-widget] .rounded{border-radius:.25rem}[data-super-agent-widget] .rounded-\\[5px\\]{border-radius:5px}[data-super-agent-widget] .rounded-full{border-radius:9999px}[data-super-agent-widget] .rounded-md{border-radius:.375rem}[data-super-agent-widget] .border{border-width:1px}[data-super-agent-widget] .border-r{border-right-width:1px}[data-super-agent-widget] .border-r-0{border-right-width:0px}[data-super-agent-widget] .border-none{border-style:none}[data-super-agent-widget] .border-\\[\\#DADADA\\]{--tw-border-opacity: 1;border-color:rgb(218 218 218 / var(--tw-border-opacity, 1))}[data-super-agent-widget] .border-\\[\\#E8E8E8\\]{--tw-border-opacity: 1;border-color:rgb(232 232 232 / var(--tw-border-opacity, 1))}[data-super-agent-widget] .border-\\[\\#ECECEC\\]{--tw-border-opacity: 1;border-color:rgb(236 236 236 / var(--tw-border-opacity, 1))}[data-super-agent-widget] .border-\\[var\\(--sa-primary\\)\\]{border-color:var(--sa-primary)}[data-super-agent-widget] .bg-\\[\\#DCDCDC\\]{--tw-bg-opacity: 1;background-color:rgb(220 220 220 / var(--tw-bg-opacity, 1))}[data-super-agent-widget] .bg-\\[\\#E8F1FE\\]{--tw-bg-opacity: 1;background-color:rgb(232 241 254 / var(--tw-bg-opacity, 1))}[data-super-agent-widget] .bg-\\[\\#F5F5F5\\]{--tw-bg-opacity: 1;background-color:rgb(245 245 245 / var(--tw-bg-opacity, 1))}[data-super-agent-widget] .bg-\\[\\#FAFAFA\\]{--tw-bg-opacity: 1;background-color:rgb(250 250 250 / var(--tw-bg-opacity, 1))}[data-super-agent-widget] .bg-\\[\\#fee2e2\\]{--tw-bg-opacity: 1;background-color:rgb(254 226 226 / var(--tw-bg-opacity, 1))}[data-super-agent-widget] .bg-\\[var\\(--sa-primary\\)\\]{background-color:var(--sa-primary)}[data-super-agent-widget] .bg-black\\/30{background-color:#0000004d}[data-super-agent-widget] .bg-transparent{background-color:transparent}[data-super-agent-widget] .bg-white{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1))}[data-super-agent-widget] .object-contain{-o-object-fit:contain;object-fit:contain}[data-super-agent-widget] .p-0{padding:0}[data-super-agent-widget] .p-2{padding:.5rem}[data-super-agent-widget] .p-3{padding:.75rem}[data-super-agent-widget] .px-0\\.5{padding-left:.125rem;padding-right:.125rem}[data-super-agent-widget] .px-1{padding-left:.25rem;padding-right:.25rem}[data-super-agent-widget] .px-1\\.5{padding-left:.375rem;padding-right:.375rem}[data-super-agent-widget] .px-2\\.5{padding-left:.625rem;padding-right:.625rem}[data-super-agent-widget] .px-3{padding-left:.75rem;padding-right:.75rem}[data-super-agent-widget] .px-\\[15px\\]{padding-left:15px;padding-right:15px}[data-super-agent-widget] .py-0\\.5{padding-top:.125rem;padding-bottom:.125rem}[data-super-agent-widget] .py-1{padding-top:.25rem;padding-bottom:.25rem}[data-super-agent-widget] .py-1\\.5{padding-top:.375rem;padding-bottom:.375rem}[data-super-agent-widget] .py-2{padding-top:.5rem;padding-bottom:.5rem}[data-super-agent-widget] .py-3{padding-top:.75rem;padding-bottom:.75rem}[data-super-agent-widget] .pb-1{padding-bottom:.25rem}[data-super-agent-widget] .pb-2\\.5{padding-bottom:.625rem}[data-super-agent-widget] .pl-\\[4px\\]{padding-left:4px}[data-super-agent-widget] .pt-2{padding-top:.5rem}[data-super-agent-widget] .text-left{text-align:left}[data-super-agent-widget] .text-center{text-align:center}[data-super-agent-widget] .text-\\[11px\\]{font-size:11px}[data-super-agent-widget] .text-\\[12px\\]{font-size:12px}[data-super-agent-widget] .text-\\[13px\\]{font-size:13px}[data-super-agent-widget] .text-\\[14px\\]{font-size:14px}[data-super-agent-widget] .text-\\[18px\\]{font-size:18px}[data-super-agent-widget] .text-\\[9px\\]{font-size:9px}[data-super-agent-widget] .font-bold{font-weight:700}[data-super-agent-widget] .font-medium{font-weight:500}[data-super-agent-widget] .font-semibold{font-weight:600}[data-super-agent-widget] .italic{font-style:italic}[data-super-agent-widget] .leading-\\[1\\.3\\]{line-height:1.3}[data-super-agent-widget] .leading-\\[1\\.4\\]{line-height:1.4}[data-super-agent-widget] .leading-\\[1\\.5\\]{line-height:1.5}[data-super-agent-widget] .leading-\\[14px\\]{line-height:14px}[data-super-agent-widget] .leading-none{line-height:1}[data-super-agent-widget] .text-\\[\\#333\\]{--tw-text-opacity: 1;color:rgb(51 51 51 / var(--tw-text-opacity, 1))}[data-super-agent-widget] .text-\\[\\#666\\]{--tw-text-opacity: 1;color:rgb(102 102 102 / var(--tw-text-opacity, 1))}[data-super-agent-widget] .text-\\[\\#999\\]{--tw-text-opacity: 1;color:rgb(153 153 153 / var(--tw-text-opacity, 1))}[data-super-agent-widget] .text-\\[\\#9A9A9A\\]{--tw-text-opacity: 1;color:rgb(154 154 154 / var(--tw-text-opacity, 1))}[data-super-agent-widget] .text-\\[\\#A0A0A0\\]{--tw-text-opacity: 1;color:rgb(160 160 160 / var(--tw-text-opacity, 1))}[data-super-agent-widget] .text-\\[\\#B8B8B8\\]{--tw-text-opacity: 1;color:rgb(184 184 184 / var(--tw-text-opacity, 1))}[data-super-agent-widget] .text-\\[\\#C0C0C0\\]{--tw-text-opacity: 1;color:rgb(192 192 192 / var(--tw-text-opacity, 1))}[data-super-agent-widget] .text-\\[\\#ef4444\\]{--tw-text-opacity: 1;color:rgb(239 68 68 / var(--tw-text-opacity, 1))}[data-super-agent-widget] .text-white{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}[data-super-agent-widget] .underline{text-decoration-line:underline}[data-super-agent-widget] .antialiased{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}[data-super-agent-widget] .opacity-0{opacity:0}[data-super-agent-widget] .opacity-10{opacity:.1}[data-super-agent-widget] .opacity-100{opacity:1}[data-super-agent-widget] .opacity-60{opacity:.6}[data-super-agent-widget] .opacity-70{opacity:.7}[data-super-agent-widget] .shadow-\\[0_-12px_48px_rgba\\(0\\,0\\,0\\,0\\.25\\)\\]{--tw-shadow: 0 -12px 48px rgba(0,0,0,.25);--tw-shadow-colored: 0 -12px 48px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}[data-super-agent-widget] .shadow-\\[0_12px_36px_rgba\\(0\\,0\\,0\\,0\\.18\\)\\]{--tw-shadow: 0 12px 36px rgba(0,0,0,.18);--tw-shadow-colored: 0 12px 36px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}[data-super-agent-widget] .shadow-\\[0_2px_8px_rgba\\(0\\,0\\,0\\,0\\.12\\)\\]{--tw-shadow: 0 2px 8px rgba(0,0,0,.12);--tw-shadow-colored: 0 2px 8px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}[data-super-agent-widget] .outline-none{outline:2px solid transparent;outline-offset:2px}[data-super-agent-widget] .outline{outline-style:solid}[data-super-agent-widget] .blur{--tw-blur: blur(8px);filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}[data-super-agent-widget] .filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}[data-super-agent-widget] .transition{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}[data-super-agent-widget] .transition-colors{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}[data-super-agent-widget] .transition-transform{transition-property:transform;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}[data-super-agent-widget] .duration-200{transition-duration:.2s}[data-super-agent-widget] .ease-in-out{transition-timing-function:cubic-bezier(.4,0,.2,1)}[data-super-agent-widget] .ease-out{transition-timing-function:cubic-bezier(0,0,.2,1)}@keyframes sa-window-in{0%{opacity:0;transform:translateY(20px) scale(.95)}to{opacity:1;transform:translateY(0) scale(1)}}@keyframes sa-slide-up-full{0%{transform:translateY(100%)}to{transform:translateY(0)}}@keyframes sa-home-fade-in{0%{opacity:0;transform:translateY(6px)}to{opacity:1;transform:translateY(0)}}@keyframes sa-chip-in{0%{opacity:0;transform:translateY(8px)}to{opacity:1;transform:translateY(0)}}@keyframes sa-logo-float{0%,to{transform:translateY(0)}50%{transform:translateY(-3px)}}@keyframes sa-title-shimmer{0%{background-position:100% 0}to{background-position:-100% 0}}@keyframes sa-history-in{0%{opacity:0;transform:translate(-10px)}to{opacity:1;transform:translate(0)}}[data-super-agent-widget] .animate-sa-window-in{animation:sa-window-in .3s cubic-bezier(.16,1,.3,1)}[data-super-agent-widget] .animate-sa-slide-up-full{animation:sa-slide-up-full .3s cubic-bezier(.16,1,.3,1)}[data-super-agent-widget] .animate-sa-fade-in{animation:sa-fade-in .2s ease}[data-super-agent-widget] .animate-sa-home-fade-in{animation:sa-home-fade-in .4s ease forwards}[data-super-agent-widget] .animate-sa-chip-in{animation:sa-chip-in .4s cubic-bezier(.22,1,.36,1) forwards}[data-super-agent-widget] .animate-sa-logo-float{animation:sa-logo-float 3s ease-in-out infinite}[data-super-agent-widget] .animate-sa-title-shimmer{animation:sa-title-shimmer 2.5s ease forwards}[data-super-agent-widget] .animate-sa-history-in{animation:sa-history-in .2s ease}[data-super-agent-widget] .sa-tip{position:relative}[data-super-agent-widget] .sa-tip:before,[data-super-agent-widget] .sa-tip:after{position:absolute;top:100%;left:50%;pointer-events:none;opacity:0;transition:opacity .15s ease;z-index:100}[data-super-agent-widget] .sa-tip:before{content:attr(data-tooltip);transform:translate(-50%);margin-top:6px;padding:4px 8px;background:#fff;color:#333;font-size:12px;line-height:1.4;white-space:nowrap;border-radius:4px;box-shadow:0 2px 8px #0000001f;border:1px solid #e8e8e8}[data-super-agent-widget] .sa-tip:after{content:"";transform:translate(-50%);margin-top:2px;border:4px solid transparent;border-bottom-color:#fff;filter:drop-shadow(0 -1px 1px rgba(0,0,0,.06))}[data-super-agent-widget] .sa-tip:hover:before,[data-super-agent-widget] .sa-tip:hover:after{opacity:1}[data-super-agent-widget] .sa-chip{background:linear-gradient(#fff,#fff) padding-box,linear-gradient(#e0e0e0,#e0e0e0) border-box;border:1px solid transparent}[data-super-agent-widget] .sa-chip:hover{background:linear-gradient(#fff,#fff) padding-box,linear-gradient(110deg,#03b5ff,#285cff 47%,#ff28a7) border-box}[data-super-agent-widget] .sa-chip:hover .sa-chip-text{background:linear-gradient(110deg,#03b5ff,#285cff 47%,#ff28a7);-webkit-background-clip:text;background-clip:text;-webkit-text-fill-color:transparent}[data-super-agent-widget] .sa-shimmer-text{background:linear-gradient(90deg,#333,#333 35%,#00d4ff 40%,#1881f0,#2b52ee,#d116ea,#ff2e7e 56%,#333 61%,#333);background-size:300% 100%;background-position:100% 0;-webkit-background-clip:text;background-clip:text;-webkit-text-fill-color:transparent}[data-super-agent-widget] .sa-new-chat{background:linear-gradient(258deg,#ff2e7e1a -4%,#d116ea1a 16%,#2b52ee1a 53%,#1881f01a 81%,#00d4ff1a 106%)}[data-super-agent-widget] .sa-new-chat:hover{background:linear-gradient(258deg,#ff2e7e29 -4%,#d116ea29 16%,#2b52ee29 53%,#1881f029 81%,#00d4ff29 106%)}[data-super-agent-widget] .sa-new-chat .sa-new-chat-text{background:linear-gradient(110deg,#03b5ff,#285cff 47%,#ff28a7);-webkit-background-clip:text;background-clip:text;-webkit-text-fill-color:transparent}[data-super-agent-widget] .sa-home-gradient{background:linear-gradient(239deg,#ff2e7e -3%,#d116ea 17%,#2b52ee 54%,#1881f0 82%,#00d4ff 107%)}[data-super-agent-widget] .sa-home-gradient-fade{background:linear-gradient(180deg,#fff0,#fff)}[data-super-agent-widget] .sa-home-view .sa-thread{background:transparent}[data-super-agent-widget] .sa-resize-handle:hover{background:color-mix(in srgb,var(--sa-primary) 30%,transparent)}[data-super-agent-widget] .sa-input-form{border:1px solid transparent;background-color:#fff;background-image:linear-gradient(#fff,#fff),linear-gradient(110deg,#03b5ff80,#285cff80 47%,#ff28a780);background-origin:border-box;background-clip:padding-box,border-box;transition:background .15s ease}[data-super-agent-widget] .sa-input-form-active,[data-super-agent-widget] .sa-input-form:focus-within{background-image:linear-gradient(#fff,#fff),linear-gradient(110deg,#03b5ff,#285cff 47%,#ff28a7)}[data-super-agent-widget] .sa-send-btn{display:flex;align-items:center;justify-content:center;width:24px;height:24px;border:none;border-radius:9999px;background:linear-gradient(110deg,#03b5ff80,#285cff80 47%,#ff28a780);cursor:pointer;flex-shrink:0;align-self:flex-end;transition:background .15s ease,opacity .15s ease}[data-super-agent-widget] .sa-send-btn-active,[data-super-agent-widget] .sa-input-form:focus-within .sa-send-btn{background:linear-gradient(110deg,#03b5ff,#285cff 47%,#ff28a7)}[data-super-agent-widget] .sa-send-btn:hover{opacity:.9}[data-super-agent-widget] .sa-send-btn:active{opacity:.7}[data-super-agent-widget] .sa-send-btn img{display:block;width:14px;height:14px;filter:brightness(0) invert(1)}[data-super-agent-widget] .sa-stop-icon{display:block;width:8px;height:8px;border-radius:2px;background:#fff}[data-super-agent-widget] .sa-attach-btn{display:flex;align-items:center;justify-content:center;width:24px;height:24px;border:none;border-radius:9999px;background:linear-gradient(110deg,#03b5ff80,#285cff80 47%,#ff28a780);color:#fff;cursor:pointer;flex-shrink:0;align-self:flex-end;transition:background .15s ease,opacity .15s ease}[data-super-agent-widget] .sa-attach-btn:hover{background:linear-gradient(110deg,#03b5ff,#285cff 47%,#ff28a7);opacity:.9}[data-super-agent-widget] .sa-attach-btn:active{opacity:.7}[data-super-agent-widget] .sa-attachment-tray{display:flex;flex-wrap:wrap;gap:6px;padding:2px 0}[data-super-agent-widget] .sa-attachment-tray-chip{display:inline-flex;align-items:center;gap:4px;max-width:220px;padding:4px 8px;border:1px solid rgba(40,92,255,.25);border-radius:6px;background:#285cff0d;font-size:12px;line-height:1;color:#333}[data-super-agent-widget] .sa-attachment-tray-chip-error{border-color:#ef444459;background:#ef44440f}[data-super-agent-widget] .sa-attachment-tray-chip-name{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-weight:500}[data-super-agent-widget] .sa-attachment-tray-chip-size{color:#b8b8b8;flex-shrink:0}[data-super-agent-widget] .sa-attachment-tray-chip-remove{display:flex;align-items:center;justify-content:center;width:14px;height:14px;border:none;border-radius:9999px;background:transparent;color:#b8b8b8;font-size:10px;line-height:1;cursor:pointer;flex-shrink:0;padding:0}[data-super-agent-widget] .sa-attachment-tray-chip-remove:hover{background:#00000014;color:#666}[data-super-agent-widget] .sa-attachment-chip{display:inline-flex;align-items:center;gap:4px;max-width:240px;margin:2px 0;padding:5px 10px;border-radius:8px;background:#ffffff59;font-size:12px;line-height:1;color:inherit}[data-super-agent-widget] .sa-attachment-chip-name{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-weight:500}[data-super-agent-widget] .sa-attachment-chip-size{color:#00000073;flex-shrink:0}[data-super-agent-widget] .placeholder\\:text-\\[\\#B8B8B8\\]::-moz-placeholder{--tw-text-opacity: 1;color:rgb(184 184 184 / var(--tw-text-opacity, 1))}[data-super-agent-widget] .placeholder\\:text-\\[\\#B8B8B8\\]::placeholder{--tw-text-opacity: 1;color:rgb(184 184 184 / var(--tw-text-opacity, 1))}[data-super-agent-widget] .hover\\:scale-\\[1\\.08\\]:hover{--tw-scale-x: 1.08;--tw-scale-y: 1.08;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}[data-super-agent-widget] .hover\\:bg-\\[\\#E8F1FE\\]:hover{--tw-bg-opacity: 1;background-color:rgb(232 241 254 / var(--tw-bg-opacity, 1))}[data-super-agent-widget] .hover\\:bg-\\[\\#F5F5F5\\]:hover{--tw-bg-opacity: 1;background-color:rgb(245 245 245 / var(--tw-bg-opacity, 1))}[data-super-agent-widget] .hover\\:bg-white:hover{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1))}[data-super-agent-widget] .hover\\:bg-white\\/70:hover{background-color:#ffffffb3}[data-super-agent-widget] .hover\\:text-\\[\\#1881F0\\]:hover{--tw-text-opacity: 1;color:rgb(24 129 240 / var(--tw-text-opacity, 1))}[data-super-agent-widget] .hover\\:text-\\[\\#ef4444\\]:hover{--tw-text-opacity: 1;color:rgb(239 68 68 / var(--tw-text-opacity, 1))}[data-super-agent-widget] .hover\\:text-\\[var\\(--sa-primary\\)\\]:hover{color:var(--sa-primary)}[data-super-agent-widget] .active\\:scale-95:active{--tw-scale-x: .95;--tw-scale-y: .95;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}[data-super-agent-widget] .active\\:cursor-grabbing:active{cursor:grabbing}[data-super-agent-widget] .active\\:bg-\\[\\#F5F5F5\\]:active{--tw-bg-opacity: 1;background-color:rgb(245 245 245 / var(--tw-bg-opacity, 1))}[data-super-agent-widget] :is(.group:hover .group-hover\\:flex){display:flex}',fa={primaryColor:"#6366f1",backgroundColor:"#ffffff",fontFamily:"system-ui, -apple-system, sans-serif",borderRadius:16,panelWidth:400,panelHeight:648,zIndex:9999};function $d(e,t){const n=parseInt(e.slice(1,3),16),r=parseInt(e.slice(3,5),16),i=parseInt(e.slice(5,7),16),s=1-t;return`#${Math.round(n*s).toString(16).padStart(2,"0")}${Math.round(r*s).toString(16).padStart(2,"0")}${Math.round(i*s).toString(16).padStart(2,"0")}`}function Hd(e,t){const n=parseInt(e.slice(1,3),16),r=parseInt(e.slice(3,5),16),i=parseInt(e.slice(5,7),16);return`#${Math.round(n+(255-n)*t).toString(16).padStart(2,"0")}${Math.round(r+(255-r)*t).toString(16).padStart(2,"0")}${Math.round(i+(255-i)*t).toString(16).padStart(2,"0")}`}function ha(e){const t={...fa,...e},n=t.primaryColor,r=t.backgroundColor;return[`--sa-primary: ${n}`,`--sa-bg: ${r}`,`--sa-font: ${t.fontFamily}`,`--sa-radius: ${t.borderRadius}px`,`--sa-panel-width: ${t.panelWidth}px`,`--sa-panel-height: ${t.panelHeight}px`,`--sa-z-index: ${t.zIndex}`,`--sa-primary-dark: ${$d(n,.15)}`,`--sa-primary-light: ${Hd(n,.9)}`,`--sa-surface: ${r}`,"--sa-border: #e5e7eb","--sa-hover: #f4f4f5","--sa-text: #374151","--sa-text-muted: #9ca3af","--sa-text-light: #6b7280"].join("; ")}function Ud(e,t){const n=typeof e=="string"?document.querySelector(e):e;if(!n)throw new Error(`Target element not found: ${e}`);const r=document.createElement("div");r.setAttribute("data-super-agent-widget","");const i=ha(t.theme??{});if(r.setAttribute("style",`${i}; height: 100%;`),n.appendChild(r),!document.getElementById("sa-widget-styles")){const l=document.createElement("style");l.id="sa-widget-styles",l.textContent=`${da}
1273
- ${Bd}`,document.head.appendChild(l)}let s=ga.createRoot(r),a=!1;const o=l=>{s&&s.render(k.createElement(pa,{...t,initialOpen:l??a,onOpenChange:u=>{a=u}}))};return o(!1),{open(){a=!0,o(!0)},close(){a=!1,o(!1)},destroy(){s&&(s.unmount(),s=null),r.remove()}}}exports.ASSETS=ae;exports.ActionBar=aa;exports.ChatProvider=Jt;exports.ChatWidget=pa;exports.Composer=Ln;exports.ErrorPart=na;exports.FullpageLayout=ca;exports.Header=Hr;exports.Icon=X;exports.InterruptCard=ia;exports.Message=sa;exports.PageOverlay=la;exports.TextPart=Qi;exports.ThinkingPart=Zi;exports.Thread=Dn;exports.ThreadList=Zt;exports.ToolCallPart=ea;exports.ToolResultPart=ta;exports.Trigger=$r;exports.WelcomeScreen=oa;exports.defaultTheme=fa;exports.ensureIconFont=Ji;exports.mount=Ud;exports.themeToCSSVars=ha;exports.useAutoScroll=Vr;exports.useChat=Mr;exports.useChatContext=ke;exports.useConversations=Pr;exports.widgetStyles=da;
1272
+ `,Bd='[data-super-agent-widget] .pointer-events-none{pointer-events:none}[data-super-agent-widget] .visible{visibility:visible}[data-super-agent-widget] .collapse{visibility:collapse}[data-super-agent-widget] .fixed{position:fixed}[data-super-agent-widget] .absolute{position:absolute}[data-super-agent-widget] .relative{position:relative}[data-super-agent-widget] .inset-0{top:0;right:0;bottom:0;left:0}[data-super-agent-widget] .inset-x-0{left:0;right:0}[data-super-agent-widget] .-bottom-px{bottom:-1px}[data-super-agent-widget] .-left-px{left:-1px}[data-super-agent-widget] .-right-2{right:-.5rem}[data-super-agent-widget] .-top-1\\.5{top:-.375rem}[data-super-agent-widget] .-top-px{top:-1px}[data-super-agent-widget] .bottom-0{bottom:0}[data-super-agent-widget] .bottom-\\[8px\\]{bottom:8px}[data-super-agent-widget] .left-\\[-3px\\]{left:-3px}[data-super-agent-widget] .left-\\[8px\\]{left:8px}[data-super-agent-widget] .top-0{top:0}[data-super-agent-widget] .z-0{z-index:0}[data-super-agent-widget] .z-10{z-index:10}[data-super-agent-widget] .z-20{z-index:20}[data-super-agent-widget] .z-\\[10000\\]{z-index:10000}[data-super-agent-widget] .z-\\[10001\\]{z-index:10001}[data-super-agent-widget] .z-\\[1\\]{z-index:1}[data-super-agent-widget] .z-\\[2\\]{z-index:2}[data-super-agent-widget] .z-\\[5\\]{z-index:5}[data-super-agent-widget] .z-\\[var\\(--sa-z-index\\,9999\\)\\]{z-index:var(--sa-z-index,9999)}[data-super-agent-widget] .m-0{margin:0}[data-super-agent-widget] .mx-auto{margin-left:auto;margin-right:auto}[data-super-agent-widget] .mb-0\\.5{margin-bottom:.125rem}[data-super-agent-widget] .mb-1{margin-bottom:.25rem}[data-super-agent-widget] .mb-1\\.5{margin-bottom:.375rem}[data-super-agent-widget] .mb-3{margin-bottom:.75rem}[data-super-agent-widget] .mb-4{margin-bottom:1rem}[data-super-agent-widget] .mt-3{margin-top:.75rem}[data-super-agent-widget] .block{display:block}[data-super-agent-widget] .inline{display:inline}[data-super-agent-widget] .flex{display:flex}[data-super-agent-widget] .inline-flex{display:inline-flex}[data-super-agent-widget] .table{display:table}[data-super-agent-widget] .hidden{display:none}[data-super-agent-widget] .h-5{height:1.25rem}[data-super-agent-widget] .h-7{height:1.75rem}[data-super-agent-widget] .h-8{height:2rem}[data-super-agent-widget] .h-9{height:2.25rem}[data-super-agent-widget] .h-\\[13px\\]{height:13px}[data-super-agent-widget] .h-\\[18px\\]{height:18px}[data-super-agent-widget] .h-\\[238px\\]{height:238px}[data-super-agent-widget] .h-\\[calc\\(100\\%_-_48px\\)\\]{height:calc(100% - 48px)}[data-super-agent-widget] .h-full{height:100%}[data-super-agent-widget] .min-h-\\[34px\\]{min-height:34px}[data-super-agent-widget] .min-h-\\[70px\\]{min-height:70px}[data-super-agent-widget] .w-12{width:3rem}[data-super-agent-widget] .w-5{width:1.25rem}[data-super-agent-widget] .w-7{width:1.75rem}[data-super-agent-widget] .w-\\[18px\\]{width:18px}[data-super-agent-widget] .w-\\[220px\\]{width:220px}[data-super-agent-widget] .w-\\[6px\\]{width:6px}[data-super-agent-widget] .w-full{width:100%}[data-super-agent-widget] .w-px{width:1px}[data-super-agent-widget] .min-w-0{min-width:0px}[data-super-agent-widget] .min-w-\\[14px\\]{min-width:14px}[data-super-agent-widget] .max-w-16{max-width:4rem}[data-super-agent-widget] .max-w-\\[800px\\]{max-width:800px}[data-super-agent-widget] .max-w-full{max-width:100%}[data-super-agent-widget] .flex-1{flex:1 1 0%}[data-super-agent-widget] .flex-shrink{flex-shrink:1}[data-super-agent-widget] .shrink-0{flex-shrink:0}[data-super-agent-widget] .border-collapse{border-collapse:collapse}[data-super-agent-widget] .scale-50{--tw-scale-x: .5;--tw-scale-y: .5;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}[data-super-agent-widget] .transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}[data-super-agent-widget] .cursor-col-resize{cursor:col-resize}[data-super-agent-widget] .cursor-default{cursor:default}[data-super-agent-widget] .cursor-grab{cursor:grab}[data-super-agent-widget] .cursor-pointer{cursor:pointer}[data-super-agent-widget] .cursor-text{cursor:text}[data-super-agent-widget] .select-none{-webkit-user-select:none;-moz-user-select:none;user-select:none}[data-super-agent-widget] .resize-none{resize:none}[data-super-agent-widget] .resize{resize:both}[data-super-agent-widget] .flex-row{flex-direction:row}[data-super-agent-widget] .flex-col{flex-direction:column}[data-super-agent-widget] .flex-wrap{flex-wrap:wrap}[data-super-agent-widget] .items-start{align-items:flex-start}[data-super-agent-widget] .items-end{align-items:flex-end}[data-super-agent-widget] .items-center{align-items:center}[data-super-agent-widget] .justify-end{justify-content:flex-end}[data-super-agent-widget] .justify-center{justify-content:center}[data-super-agent-widget] .justify-between{justify-content:space-between}[data-super-agent-widget] .gap-0\\.5{gap:.125rem}[data-super-agent-widget] .gap-1{gap:.25rem}[data-super-agent-widget] .gap-1\\.5{gap:.375rem}[data-super-agent-widget] .gap-2{gap:.5rem}[data-super-agent-widget] .gap-2\\.5{gap:.625rem}[data-super-agent-widget] .gap-3{gap:.75rem}[data-super-agent-widget] .gap-4{gap:1rem}[data-super-agent-widget] .gap-8{gap:2rem}[data-super-agent-widget] .gap-\\[22px\\]{gap:22px}[data-super-agent-widget] .gap-\\[7px\\]{gap:7px}[data-super-agent-widget] .overflow-hidden{overflow:hidden}[data-super-agent-widget] .overflow-visible{overflow:visible}[data-super-agent-widget] .overflow-y-auto{overflow-y:auto}[data-super-agent-widget] .text-ellipsis{text-overflow:ellipsis}[data-super-agent-widget] .whitespace-nowrap{white-space:nowrap}[data-super-agent-widget] .rounded{border-radius:.25rem}[data-super-agent-widget] .rounded-\\[5px\\]{border-radius:5px}[data-super-agent-widget] .rounded-full{border-radius:9999px}[data-super-agent-widget] .rounded-md{border-radius:.375rem}[data-super-agent-widget] .border{border-width:1px}[data-super-agent-widget] .border-r{border-right-width:1px}[data-super-agent-widget] .border-r-0{border-right-width:0px}[data-super-agent-widget] .border-none{border-style:none}[data-super-agent-widget] .border-\\[\\#DADADA\\]{--tw-border-opacity: 1;border-color:rgb(218 218 218 / var(--tw-border-opacity, 1))}[data-super-agent-widget] .border-\\[\\#E8E8E8\\]{--tw-border-opacity: 1;border-color:rgb(232 232 232 / var(--tw-border-opacity, 1))}[data-super-agent-widget] .border-\\[\\#ECECEC\\]{--tw-border-opacity: 1;border-color:rgb(236 236 236 / var(--tw-border-opacity, 1))}[data-super-agent-widget] .border-\\[var\\(--sa-primary\\)\\]{border-color:var(--sa-primary)}[data-super-agent-widget] .bg-\\[\\#DCDCDC\\]{--tw-bg-opacity: 1;background-color:rgb(220 220 220 / var(--tw-bg-opacity, 1))}[data-super-agent-widget] .bg-\\[\\#E8F1FE\\]{--tw-bg-opacity: 1;background-color:rgb(232 241 254 / var(--tw-bg-opacity, 1))}[data-super-agent-widget] .bg-\\[\\#F5F5F5\\]{--tw-bg-opacity: 1;background-color:rgb(245 245 245 / var(--tw-bg-opacity, 1))}[data-super-agent-widget] .bg-\\[\\#FAFAFA\\]{--tw-bg-opacity: 1;background-color:rgb(250 250 250 / var(--tw-bg-opacity, 1))}[data-super-agent-widget] .bg-\\[\\#fee2e2\\]{--tw-bg-opacity: 1;background-color:rgb(254 226 226 / var(--tw-bg-opacity, 1))}[data-super-agent-widget] .bg-\\[var\\(--sa-primary\\)\\]{background-color:var(--sa-primary)}[data-super-agent-widget] .bg-black\\/30{background-color:#0000004d}[data-super-agent-widget] .bg-transparent{background-color:transparent}[data-super-agent-widget] .bg-white{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1))}[data-super-agent-widget] .object-contain{-o-object-fit:contain;object-fit:contain}[data-super-agent-widget] .p-0{padding:0}[data-super-agent-widget] .p-2{padding:.5rem}[data-super-agent-widget] .p-3{padding:.75rem}[data-super-agent-widget] .px-0\\.5{padding-left:.125rem;padding-right:.125rem}[data-super-agent-widget] .px-1{padding-left:.25rem;padding-right:.25rem}[data-super-agent-widget] .px-1\\.5{padding-left:.375rem;padding-right:.375rem}[data-super-agent-widget] .px-2\\.5{padding-left:.625rem;padding-right:.625rem}[data-super-agent-widget] .px-3{padding-left:.75rem;padding-right:.75rem}[data-super-agent-widget] .px-\\[15px\\]{padding-left:15px;padding-right:15px}[data-super-agent-widget] .py-0\\.5{padding-top:.125rem;padding-bottom:.125rem}[data-super-agent-widget] .py-1{padding-top:.25rem;padding-bottom:.25rem}[data-super-agent-widget] .py-1\\.5{padding-top:.375rem;padding-bottom:.375rem}[data-super-agent-widget] .py-2{padding-top:.5rem;padding-bottom:.5rem}[data-super-agent-widget] .py-3{padding-top:.75rem;padding-bottom:.75rem}[data-super-agent-widget] .pb-1{padding-bottom:.25rem}[data-super-agent-widget] .pb-2\\.5{padding-bottom:.625rem}[data-super-agent-widget] .pl-\\[4px\\]{padding-left:4px}[data-super-agent-widget] .pt-2{padding-top:.5rem}[data-super-agent-widget] .text-left{text-align:left}[data-super-agent-widget] .text-center{text-align:center}[data-super-agent-widget] .text-\\[11px\\]{font-size:11px}[data-super-agent-widget] .text-\\[12px\\]{font-size:12px}[data-super-agent-widget] .text-\\[13px\\]{font-size:13px}[data-super-agent-widget] .text-\\[14px\\]{font-size:14px}[data-super-agent-widget] .text-\\[18px\\]{font-size:18px}[data-super-agent-widget] .text-\\[9px\\]{font-size:9px}[data-super-agent-widget] .font-bold{font-weight:700}[data-super-agent-widget] .font-medium{font-weight:500}[data-super-agent-widget] .font-semibold{font-weight:600}[data-super-agent-widget] .italic{font-style:italic}[data-super-agent-widget] .leading-\\[1\\.3\\]{line-height:1.3}[data-super-agent-widget] .leading-\\[1\\.4\\]{line-height:1.4}[data-super-agent-widget] .leading-\\[1\\.5\\]{line-height:1.5}[data-super-agent-widget] .leading-\\[14px\\]{line-height:14px}[data-super-agent-widget] .leading-none{line-height:1}[data-super-agent-widget] .text-\\[\\#333\\]{--tw-text-opacity: 1;color:rgb(51 51 51 / var(--tw-text-opacity, 1))}[data-super-agent-widget] .text-\\[\\#666\\]{--tw-text-opacity: 1;color:rgb(102 102 102 / var(--tw-text-opacity, 1))}[data-super-agent-widget] .text-\\[\\#999\\]{--tw-text-opacity: 1;color:rgb(153 153 153 / var(--tw-text-opacity, 1))}[data-super-agent-widget] .text-\\[\\#9A9A9A\\]{--tw-text-opacity: 1;color:rgb(154 154 154 / var(--tw-text-opacity, 1))}[data-super-agent-widget] .text-\\[\\#A0A0A0\\]{--tw-text-opacity: 1;color:rgb(160 160 160 / var(--tw-text-opacity, 1))}[data-super-agent-widget] .text-\\[\\#B8B8B8\\]{--tw-text-opacity: 1;color:rgb(184 184 184 / var(--tw-text-opacity, 1))}[data-super-agent-widget] .text-\\[\\#C0C0C0\\]{--tw-text-opacity: 1;color:rgb(192 192 192 / var(--tw-text-opacity, 1))}[data-super-agent-widget] .text-\\[\\#ef4444\\]{--tw-text-opacity: 1;color:rgb(239 68 68 / var(--tw-text-opacity, 1))}[data-super-agent-widget] .text-white{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}[data-super-agent-widget] .underline{text-decoration-line:underline}[data-super-agent-widget] .antialiased{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}[data-super-agent-widget] .opacity-0{opacity:0}[data-super-agent-widget] .opacity-10{opacity:.1}[data-super-agent-widget] .opacity-100{opacity:1}[data-super-agent-widget] .opacity-60{opacity:.6}[data-super-agent-widget] .opacity-70{opacity:.7}[data-super-agent-widget] .shadow-\\[0_-12px_48px_rgba\\(0\\,0\\,0\\,0\\.25\\)\\]{--tw-shadow: 0 -12px 48px rgba(0,0,0,.25);--tw-shadow-colored: 0 -12px 48px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}[data-super-agent-widget] .shadow-\\[0_12px_36px_rgba\\(0\\,0\\,0\\,0\\.18\\)\\]{--tw-shadow: 0 12px 36px rgba(0,0,0,.18);--tw-shadow-colored: 0 12px 36px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}[data-super-agent-widget] .shadow-\\[0_2px_8px_rgba\\(0\\,0\\,0\\,0\\.12\\)\\]{--tw-shadow: 0 2px 8px rgba(0,0,0,.12);--tw-shadow-colored: 0 2px 8px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}[data-super-agent-widget] .outline-none{outline:2px solid transparent;outline-offset:2px}[data-super-agent-widget] .outline{outline-style:solid}[data-super-agent-widget] .blur{--tw-blur: blur(8px);filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}[data-super-agent-widget] .filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}[data-super-agent-widget] .transition{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}[data-super-agent-widget] .transition-colors{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}[data-super-agent-widget] .transition-transform{transition-property:transform;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}[data-super-agent-widget] .duration-200{transition-duration:.2s}[data-super-agent-widget] .ease-in-out{transition-timing-function:cubic-bezier(.4,0,.2,1)}[data-super-agent-widget] .ease-out{transition-timing-function:cubic-bezier(0,0,.2,1)}@keyframes sa-window-in{0%{opacity:0;transform:translateY(20px) scale(.95)}to{opacity:1;transform:translateY(0) scale(1)}}@keyframes sa-slide-up-full{0%{transform:translateY(100%)}to{transform:translateY(0)}}@keyframes sa-home-fade-in{0%{opacity:0;transform:translateY(6px)}to{opacity:1;transform:translateY(0)}}@keyframes sa-chip-in{0%{opacity:0;transform:translateY(8px)}to{opacity:1;transform:translateY(0)}}@keyframes sa-logo-float{0%,to{transform:translateY(0)}50%{transform:translateY(-3px)}}@keyframes sa-title-shimmer{0%{background-position:100% 0}to{background-position:-100% 0}}@keyframes sa-history-in{0%{opacity:0;transform:translate(-10px)}to{opacity:1;transform:translate(0)}}[data-super-agent-widget] .animate-sa-window-in{animation:sa-window-in .3s cubic-bezier(.16,1,.3,1)}[data-super-agent-widget] .animate-sa-slide-up-full{animation:sa-slide-up-full .3s cubic-bezier(.16,1,.3,1)}[data-super-agent-widget] .animate-sa-fade-in{animation:sa-fade-in .2s ease}[data-super-agent-widget] .animate-sa-home-fade-in{animation:sa-home-fade-in .4s ease forwards}[data-super-agent-widget] .animate-sa-chip-in{animation:sa-chip-in .4s cubic-bezier(.22,1,.36,1) forwards}[data-super-agent-widget] .animate-sa-logo-float{animation:sa-logo-float 3s ease-in-out infinite}[data-super-agent-widget] .animate-sa-title-shimmer{animation:sa-title-shimmer 2.5s ease forwards}[data-super-agent-widget] .animate-sa-history-in{animation:sa-history-in .2s ease}[data-super-agent-widget] .sa-tip{position:relative}[data-super-agent-widget] .sa-tip:before,[data-super-agent-widget] .sa-tip:after{position:absolute;top:100%;left:50%;pointer-events:none;opacity:0;transition:opacity .15s ease;z-index:100}[data-super-agent-widget] .sa-tip:before{content:attr(data-tooltip);transform:translate(-50%);margin-top:6px;padding:4px 8px;background:#fff;color:#333;font-size:12px;line-height:1.4;white-space:nowrap;border-radius:4px;box-shadow:0 2px 8px #0000001f;border:1px solid #e8e8e8}[data-super-agent-widget] .sa-tip:after{content:"";transform:translate(-50%);margin-top:2px;border:4px solid transparent;border-bottom-color:#fff;filter:drop-shadow(0 -1px 1px rgba(0,0,0,.06))}[data-super-agent-widget] .sa-tip:hover:before,[data-super-agent-widget] .sa-tip:hover:after{opacity:1}[data-super-agent-widget] .sa-chip{background:linear-gradient(#fff,#fff) padding-box,linear-gradient(#e0e0e0,#e0e0e0) border-box;border:1px solid transparent}[data-super-agent-widget] .sa-chip:hover{background:linear-gradient(#fff,#fff) padding-box,linear-gradient(110deg,#03b5ff,#285cff 47%,#ff28a7) border-box}[data-super-agent-widget] .sa-chip:hover .sa-chip-text{background:linear-gradient(110deg,#03b5ff,#285cff 47%,#ff28a7);-webkit-background-clip:text;background-clip:text;-webkit-text-fill-color:transparent}[data-super-agent-widget] .sa-shimmer-text{background:linear-gradient(90deg,#333,#333 35%,#00d4ff 40%,#1881f0,#2b52ee,#d116ea,#ff2e7e 56%,#333 61%,#333);background-size:300% 100%;background-position:100% 0;-webkit-background-clip:text;background-clip:text;-webkit-text-fill-color:transparent}[data-super-agent-widget] .sa-new-chat{background:linear-gradient(258deg,#ff2e7e1a -4%,#d116ea1a 16%,#2b52ee1a 53%,#1881f01a 81%,#00d4ff1a 106%)}[data-super-agent-widget] .sa-new-chat:hover{background:linear-gradient(258deg,#ff2e7e29 -4%,#d116ea29 16%,#2b52ee29 53%,#1881f029 81%,#00d4ff29 106%)}[data-super-agent-widget] .sa-new-chat .sa-new-chat-text{background:linear-gradient(110deg,#03b5ff,#285cff 47%,#ff28a7);-webkit-background-clip:text;background-clip:text;-webkit-text-fill-color:transparent}[data-super-agent-widget] .sa-home-gradient{background:linear-gradient(239deg,#ff2e7e -3%,#d116ea 17%,#2b52ee 54%,#1881f0 82%,#00d4ff 107%)}[data-super-agent-widget] .sa-home-gradient-fade{background:linear-gradient(180deg,#fff0,#fff)}[data-super-agent-widget] .sa-home-view .sa-thread{background:transparent}[data-super-agent-widget] .sa-resize-handle:hover{background:color-mix(in srgb,var(--sa-primary) 30%,transparent)}[data-super-agent-widget] .sa-input-form{border:1px solid transparent;background-color:#fff;background-image:linear-gradient(#fff,#fff),linear-gradient(110deg,#03b5ff80,#285cff80 47%,#ff28a780);background-origin:border-box;background-clip:padding-box,border-box;transition:background .15s ease}[data-super-agent-widget] .sa-input-form-active,[data-super-agent-widget] .sa-input-form:focus-within{background-image:linear-gradient(#fff,#fff),linear-gradient(110deg,#03b5ff,#285cff 47%,#ff28a7)}[data-super-agent-widget] .sa-send-btn{display:flex;align-items:center;justify-content:center;width:24px;height:24px;border:none;border-radius:9999px;background:linear-gradient(110deg,#03b5ff80,#285cff80 47%,#ff28a780);cursor:pointer;flex-shrink:0;align-self:flex-end;transition:background .15s ease,opacity .15s ease}[data-super-agent-widget] .sa-send-btn-active,[data-super-agent-widget] .sa-input-form:focus-within .sa-send-btn{background:linear-gradient(110deg,#03b5ff,#285cff 47%,#ff28a7)}[data-super-agent-widget] .sa-send-btn:hover{opacity:.9}[data-super-agent-widget] .sa-send-btn:active{opacity:.7}[data-super-agent-widget] .sa-send-btn img{display:block;width:14px;height:14px;filter:brightness(0) invert(1)}[data-super-agent-widget] .sa-stop-icon{display:block;width:8px;height:8px;border-radius:2px;background:#fff}[data-super-agent-widget] .sa-attach-btn{display:flex;align-items:center;justify-content:center;width:24px;height:24px;border:none;border-radius:9999px;background:linear-gradient(110deg,#03b5ff80,#285cff80 47%,#ff28a780);color:#fff;cursor:pointer;flex-shrink:0;align-self:flex-end;transition:background .15s ease,opacity .15s ease}[data-super-agent-widget] .sa-attach-btn:hover{background:linear-gradient(110deg,#03b5ff,#285cff 47%,#ff28a7);opacity:.9}[data-super-agent-widget] .sa-attach-btn:active{opacity:.7}[data-super-agent-widget] .sa-attachment-tray{display:flex;flex-wrap:wrap;gap:6px;padding:2px 0}[data-super-agent-widget] .sa-attachment-tray-chip{display:inline-flex;align-items:center;gap:4px;max-width:220px;padding:4px 8px;border:1px solid rgba(40,92,255,.25);border-radius:6px;background:#285cff0d;font-size:12px;line-height:1;color:#333}[data-super-agent-widget] .sa-attachment-tray-chip-error{border-color:#ef444459;background:#ef44440f}[data-super-agent-widget] .sa-attachment-tray-chip-name{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-weight:500}[data-super-agent-widget] .sa-attachment-tray-chip-size{color:#b8b8b8;flex-shrink:0}[data-super-agent-widget] .sa-attachment-tray-chip-remove{display:flex;align-items:center;justify-content:center;width:14px;height:14px;border:none;border-radius:9999px;background:transparent;color:#b8b8b8;font-size:10px;line-height:1;cursor:pointer;flex-shrink:0;padding:0}[data-super-agent-widget] .sa-attachment-tray-chip-remove:hover{background:#00000014;color:#666}[data-super-agent-widget] .sa-attachment-chip{display:inline-flex;align-items:center;gap:4px;max-width:240px;margin:2px 0;padding:5px 10px;border-radius:8px;background:#ffffff59;font-size:12px;line-height:1;color:inherit}[data-super-agent-widget] .sa-attachment-chip-name{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-weight:500}[data-super-agent-widget] .sa-attachment-chip-size{color:#00000073;flex-shrink:0}[data-super-agent-widget] .placeholder\\:text-\\[\\#B8B8B8\\]::-moz-placeholder{--tw-text-opacity: 1;color:rgb(184 184 184 / var(--tw-text-opacity, 1))}[data-super-agent-widget] .placeholder\\:text-\\[\\#B8B8B8\\]::placeholder{--tw-text-opacity: 1;color:rgb(184 184 184 / var(--tw-text-opacity, 1))}[data-super-agent-widget] .hover\\:scale-\\[1\\.08\\]:hover{--tw-scale-x: 1.08;--tw-scale-y: 1.08;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}[data-super-agent-widget] .hover\\:bg-\\[\\#E8F1FE\\]:hover{--tw-bg-opacity: 1;background-color:rgb(232 241 254 / var(--tw-bg-opacity, 1))}[data-super-agent-widget] .hover\\:bg-\\[\\#F5F5F5\\]:hover{--tw-bg-opacity: 1;background-color:rgb(245 245 245 / var(--tw-bg-opacity, 1))}[data-super-agent-widget] .hover\\:bg-white:hover{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1))}[data-super-agent-widget] .hover\\:bg-white\\/70:hover{background-color:#ffffffb3}[data-super-agent-widget] .hover\\:text-\\[\\#1881F0\\]:hover{--tw-text-opacity: 1;color:rgb(24 129 240 / var(--tw-text-opacity, 1))}[data-super-agent-widget] .hover\\:text-\\[\\#ef4444\\]:hover{--tw-text-opacity: 1;color:rgb(239 68 68 / var(--tw-text-opacity, 1))}[data-super-agent-widget] .hover\\:text-\\[var\\(--sa-primary\\)\\]:hover{color:var(--sa-primary)}[data-super-agent-widget] .active\\:scale-95:active{--tw-scale-x: .95;--tw-scale-y: .95;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}[data-super-agent-widget] .active\\:cursor-grabbing:active{cursor:grabbing}[data-super-agent-widget] .active\\:bg-\\[\\#F5F5F5\\]:active{--tw-bg-opacity: 1;background-color:rgb(245 245 245 / var(--tw-bg-opacity, 1))}[data-super-agent-widget] :is(.group:hover .group-hover\\:flex){display:flex}',fa={primaryColor:"#6366f1",backgroundColor:"#ffffff",fontFamily:"system-ui, -apple-system, sans-serif",borderRadius:16,panelWidth:400,panelHeight:648,zIndex:9999};function $d(e,t){const n=parseInt(e.slice(1,3),16),r=parseInt(e.slice(3,5),16),i=parseInt(e.slice(5,7),16),s=1-t;return`#${Math.round(n*s).toString(16).padStart(2,"0")}${Math.round(r*s).toString(16).padStart(2,"0")}${Math.round(i*s).toString(16).padStart(2,"0")}`}function Hd(e,t){const n=parseInt(e.slice(1,3),16),r=parseInt(e.slice(3,5),16),i=parseInt(e.slice(5,7),16);return`#${Math.round(n+(255-n)*t).toString(16).padStart(2,"0")}${Math.round(r+(255-r)*t).toString(16).padStart(2,"0")}${Math.round(i+(255-i)*t).toString(16).padStart(2,"0")}`}function ha(e){const t={...fa,...e},n=t.primaryColor,r=t.backgroundColor;return[`--sa-primary: ${n}`,`--sa-bg: ${r}`,`--sa-font: ${t.fontFamily}`,`--sa-radius: ${t.borderRadius}px`,`--sa-panel-width: ${t.panelWidth}px`,`--sa-panel-height: ${t.panelHeight}px`,`--sa-z-index: ${t.zIndex}`,`--sa-primary-dark: ${$d(n,.15)}`,`--sa-primary-light: ${Hd(n,.9)}`,`--sa-surface: ${r}`,"--sa-border: #e5e7eb","--sa-hover: #f4f4f5","--sa-text: #374151","--sa-text-muted: #9ca3af","--sa-text-light: #6b7280"].join("; ")}function Ud(e,t){const n=typeof e=="string"?document.querySelector(e):e;if(!n)throw new Error(`Target element not found: ${e}`);const r=document.createElement("div");r.setAttribute("data-super-agent-widget","");const i=ha(t.theme??{});if(r.setAttribute("style",`${i}; height: 100%;`),n.appendChild(r),!document.getElementById("sa-widget-styles")){const l=document.createElement("style");l.id="sa-widget-styles",l.textContent=`${da}
1273
+ ${Bd}`,document.head.appendChild(l)}let s=ga.createRoot(r),a=!1;const o=l=>{s&&s.render(k.createElement(pa,{...t,initialOpen:l??a,onOpenChange:u=>{a=u}}))};return o(!1),{open(){a=!0,o(!0)},close(){a=!1,o(!1)},destroy(){s&&(s.unmount(),s=null),r.remove()}}}exports.ASSETS=ce;exports.ActionBar=aa;exports.ChatProvider=Jt;exports.ChatWidget=pa;exports.Composer=Ln;exports.ErrorPart=na;exports.FullpageLayout=ca;exports.Header=Hr;exports.Icon=Q;exports.InterruptCard=ia;exports.Message=sa;exports.PageOverlay=la;exports.TextPart=Qi;exports.ThinkingPart=Zi;exports.Thread=Dn;exports.ThreadList=Zt;exports.ToolCallPart=ea;exports.ToolResultPart=ta;exports.Trigger=$r;exports.WelcomeScreen=oa;exports.defaultTheme=fa;exports.ensureIconFont=Ji;exports.mount=Ud;exports.themeToCSSVars=ha;exports.useAutoScroll=Vr;exports.useChat=Mr;exports.useChatContext=je;exports.useConversations=Pr;exports.widgetStyles=da;