clankie 0.2.2 → 0.2.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (40) hide show
  1. package/README.md +17 -16
  2. package/dist/cli.js +301862 -0
  3. package/dist/koffi-216xhpes.node +0 -0
  4. package/dist/koffi-2erktc37.node +0 -0
  5. package/dist/koffi-2rrez93a.node +0 -0
  6. package/dist/koffi-2wv0r22g.node +0 -0
  7. package/dist/koffi-3kae4xj3.node +0 -0
  8. package/dist/koffi-3rkr2zqv.node +0 -0
  9. package/dist/koffi-abxfktv9.node +0 -0
  10. package/dist/koffi-c67c0c5b.node +0 -0
  11. package/dist/koffi-cnf0q0dx.node +0 -0
  12. package/dist/koffi-df38sqz5.node +0 -0
  13. package/dist/koffi-gfbqb3a0.node +0 -0
  14. package/dist/koffi-kjemmmem.node +0 -0
  15. package/dist/koffi-kkrfq9yv.node +0 -0
  16. package/dist/koffi-mzaqwwqy.node +0 -0
  17. package/dist/koffi-q49fgkeq.node +0 -0
  18. package/dist/koffi-q54bk8bf.node +0 -0
  19. package/dist/koffi-x1790w0j.node +0 -0
  20. package/dist/koffi-yxvjwcj6.node +0 -0
  21. package/package.json +8 -7
  22. package/web-ui-dist/_shell.html +2 -2
  23. package/web-ui-dist/assets/{card-BUP-xovx.js → card-Ce8RCN8-.js} +1 -1
  24. package/web-ui-dist/assets/{extensions-DC620Nmx.js → extensions-D-3Wl_TA.js} +1 -1
  25. package/web-ui-dist/assets/{index-DurjG9O_.js → index-ClDMn-6f.js} +1 -1
  26. package/web-ui-dist/assets/{loader-circle-DbOtKfCA.js → loader-circle-CpT1_nns.js} +1 -1
  27. package/web-ui-dist/assets/{main-B2sRcuyZ.js → main-J9rrgTOF.js} +4 -4
  28. package/web-ui-dist/assets/{sessions._sessionId-BJazw9EJ.js → sessions._sessionId-D6gfJDaW.js} +2 -2
  29. package/web-ui-dist/assets/{settings-Bv8oeIho.js → settings-ZDTymG3K.js} +1 -1
  30. package/web-ui-dist/manifest.json +23 -23
  31. package/src/agent.ts +0 -118
  32. package/src/channels/channel.ts +0 -57
  33. package/src/channels/slack.ts +0 -376
  34. package/src/channels/web.ts +0 -1375
  35. package/src/cli.ts +0 -505
  36. package/src/config.ts +0 -261
  37. package/src/daemon.ts +0 -380
  38. package/src/extensions/workspace-jail.ts +0 -171
  39. package/src/service.ts +0 -374
  40. package/src/sessions.ts +0 -262
@@ -1,5 +1,5 @@
1
- import{c as Ie,j as C,B as un,X as zi,f as Ye,m as Fe,V as Yn,r as X,W as Li,Y as Mi,Z as Fi,_ as Ni,$ as kt,a0 as tn,a1 as bt,a2 as wt,a3 as St,a4 as Ct,p as cn,a5 as Ri,a6 as _i,a7 as ji,a8 as xr,a9 as Oi,aa as Bi,U as $i,q as Hi,w as Ui,L as Vi,A as qi}from"./main-B2sRcuyZ.js";import{L as Wi}from"./loader-circle-DbOtKfCA.js";const Gi=[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]],Xi=Ie("bot",Gi);const Yi=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],vt=Ie("check",Yi);const Qi=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],Ki=Ie("chevron-down",Qi);const Ji=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}]],Zi=Ie("file",Ji);const el=[["path",{d:"m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551",key:"1miecu"}]],nl=Ie("paperclip",el);const tl=[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]],rl=Ie("send",tl);const il=[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]],ll=Ie("user",il);function ol({attachments:e,onRemove:t}){return e.length===0?null:C.jsx("div",{className:"flex flex-wrap gap-2 pb-2",children:e.map(n=>{const r=n.mimeType.startsWith("image/");return C.jsxs("div",{className:Ye("group relative flex items-center gap-2 rounded-lg border border-border bg-muted px-3 py-2","hover:bg-muted/80 transition-colors"),children:[r&&n.preview?C.jsx("div",{className:"relative h-12 w-12 shrink-0 overflow-hidden rounded",children:C.jsx("img",{src:n.preview,alt:n.file.name,className:"h-full w-full object-cover"})}):C.jsx("div",{className:"flex h-12 w-12 shrink-0 items-center justify-center rounded bg-background",children:C.jsx(Zi,{className:"h-6 w-6 text-muted-foreground"})}),C.jsxs("div",{className:"flex-1 min-w-0",children:[C.jsx("p",{className:"text-sm font-medium truncate",children:n.file.name}),C.jsx("p",{className:"text-xs text-muted-foreground",children:al(n.file.size)})]}),C.jsxs(un,{type:"button",variant:"ghost",size:"icon-xs",onClick:()=>t(n.id),className:"shrink-0",title:"Remove attachment",children:[C.jsx(zi,{className:"h-3 w-3"}),C.jsxs("span",{className:"sr-only",children:["Remove ",n.file.name]})]})]},n.id)})})}function al(e){if(e===0)return"0 B";const t=1024,n=["B","KB","MB","GB"],r=Math.floor(Math.log(e)/Math.log(t));return`${Math.round(e/t**r*100)/100} ${n[r]}`}function bn(e){return{anthropic:"Anthropic",openai:"OpenAI",google:"Google","amazon-bedrock":"Amazon Bedrock",openrouter:"OpenRouter","vercel-ai-gateway":"Vercel AI Gateway",xai:"xAI",mistral:"Mistral",groq:"Groq",huggingface:"Hugging Face","google-vertex":"Google Vertex AI","google-antigravity":"Google Antigravity","google-gemini-cli":"Google Gemini CLI","azure-openai-responses":"Azure OpenAI","github-copilot":"GitHub Copilot",cerebras:"Cerebras",opencode:"OpenCode",zai:"Z.ai",minimax:"MiniMax","minimax-cn":"MiniMax (CN)","kimi-coding":"Kimi"}[e]||e.split("-").map(n=>n.charAt(0).toUpperCase()+n.slice(1)).join(" ")}function Et(e){const t=e.replace(/\s+\((EU|US|Global|latest|free|exacto|thinking|Antigravity)\)$/i,"").trim(),n=t.match(/\s+([\d.]+)$/);if(n){const r=n[1],i=parseFloat(r);if(!isNaN(i))return{family:t.substring(0,t.length-n[0].length).trim(),version:i}}return{family:t,version:null}}function sl(e){const t=new Map;for(const i of e){const{family:o}=Et(i.name);t.has(o)||t.set(o,[]),t.get(o).push(i)}const n=[],r=[];for(const[i,o]of t){if(o.length===1){n.push(o[0]);continue}const l=o.map(s=>({model:s,...Et(s.name)})),a=l.filter(s=>s.version===null),u=l.filter(s=>s.version!==null);if(u.length===0)n.push(...o);else{const s=Math.max(...u.map(p=>p.version)),f=u.filter(p=>p.version===s),c=u.filter(p=>p.version!==s);n.push(...f.map(p=>p.model)),n.push(...a.map(p=>p.model)),r.push(...c.map(p=>p.model))}}return{latest:n,older:r}}function ul(e){const t=new Map;for(const n of e)t.has(n.provider)||t.set(n.provider,[]),t.get(n.provider).push(n);for(const[n,r]of t)r.sort((i,o)=>i.name.localeCompare(o.name));return t}function cl(){const{sessionId:e,model:t,availableModels:n,thinkingLevel:r,isStreaming:i}=Fe(Yn,k=>({sessionId:k.sessionId,model:k.model,availableModels:k.availableModels,thinkingLevel:k.thinkingLevel,isStreaming:k.isStreaming})),[o,l]=X.useState(!1),{latestModels:a,olderModels:u,shouldShowSubmenu:s}=X.useMemo(()=>{if(n.length===0)return{latestModels:[],olderModels:[],shouldShowSubmenu:!1};if(n.length<=10)return{latestModels:[...n].sort((E,v)=>E.name.localeCompare(v.name)),olderModels:[],shouldShowSubmenu:!1};const{latest:k,older:S}=sl(n);return k.sort((x,E)=>x.name.localeCompare(E.name)),{latestModels:k,olderModels:S,shouldShowSubmenu:S.length>0}},[n]),f=X.useMemo(()=>ul(u),[u]),c=async(k,S)=>{if(!e){console.log("[ModelSelector] No sessionId");return}console.log("[ModelSelector] Changing model:",{provider:k,modelId:S,sessionId:e});const x=cn.getClient();if(x)try{const E=await x.setModel(e,k,S);console.log("[ModelSelector] Model changed successfully:",E),_i(E),l(!1)}catch(E){console.error("[ModelSelector] Failed to set model:",E)}else console.error("[ModelSelector] No client available")},p=async k=>{if(!e)return;const S=cn.getClient();if(S)try{await S.setThinkingLevel(e,k),Ri(k)}catch(x){console.error("Failed to set thinking level:",x)}},h=[{value:"off",label:"Off"},{value:"minimal",label:"Minimal"},{value:"low",label:"Low"},{value:"medium",label:"Medium"},{value:"high",label:"High"},{value:"xhigh",label:"XHigh"}];if(!t)return null;const g=k=>{const S=t.provider===k.provider&&t.id===k.id;return C.jsxs(Ct,{onClick:()=>c(k.provider,k.id),className:"flex items-start gap-2 py-2",children:[C.jsx("div",{className:"flex h-5 w-5 items-center justify-center shrink-0",children:S&&C.jsx(vt,{className:"h-4 w-4"})}),C.jsxs("div",{className:"flex-1 min-w-0",children:[C.jsx("div",{className:"font-medium",children:k.name}),C.jsx("div",{className:"text-xs text-muted-foreground line-clamp-2",children:fl(k)})]})]},`${k.provider}/${k.id}`)};return C.jsxs(Li,{open:o,onOpenChange:l,children:[C.jsxs(Mi,{type:"button",disabled:i||!e,className:Ye("flex flex-col items-start gap-0.5 rounded-lg border border-border bg-background px-3 py-1.5 text-sm transition-colors","hover:bg-muted disabled:cursor-not-allowed disabled:opacity-50","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring"),children:[C.jsxs("div",{className:"flex items-center gap-1.5 w-full",children:[C.jsx("span",{className:"font-medium",children:t.name}),C.jsx(Ki,{className:"h-4 w-4 text-muted-foreground ml-auto"})]}),r!=="medium"&&C.jsxs("span",{className:"text-xs text-muted-foreground",children:["thinking: ",r]})]}),C.jsxs(Fi,{align:"end",className:"w-80",children:[C.jsx(Ni,{children:C.jsx(kt,{children:"Select Model"})}),C.jsx(tn,{}),C.jsx("div",{className:"max-h-96 overflow-y-auto",children:a.map(g)}),s&&C.jsxs(C.Fragment,{children:[C.jsx(tn,{}),C.jsxs(bt,{children:[C.jsx(wt,{children:C.jsx("span",{children:"Other models"})}),C.jsx(St,{className:"w-80 max-h-96 overflow-y-auto",children:Array.from(f.entries()).sort(([k],[S])=>bn(k).localeCompare(bn(S))).map(([k,S])=>C.jsxs("div",{children:[C.jsx(kt,{className:"sticky top-0 bg-popover z-10",children:bn(k)}),S.map(g),C.jsx(tn,{className:"my-1"})]},k))})]})]}),C.jsx(tn,{}),C.jsxs(bt,{children:[C.jsx(wt,{children:C.jsx("span",{children:"Thinking Level"})}),C.jsx(St,{children:h.map(k=>C.jsxs(Ct,{onClick:()=>p(k.value),className:"flex items-center gap-2",children:[C.jsx("div",{className:"flex h-5 w-5 items-center justify-center shrink-0",children:r===k.value&&C.jsx(vt,{className:"h-4 w-4"})}),C.jsx("span",{children:k.label})]},k.value))})]})]})]})}function fl(e){const t=e.name.toLowerCase();return t.includes("opus")?"Most capable for ambitious work":t.includes("sonnet")?"Most efficient for everyday tasks":t.includes("haiku")?"Fastest for quick answers":t.includes("gpt-4")?"Advanced reasoning and analysis":t.includes("gpt-3.5")?"Fast and efficient":t.includes("gemini")?"Google's multimodal AI":t.includes("claude")?"Anthropic's AI assistant":`${e.provider}/${e.id}`}function hl({className:e,...t}){return C.jsx("textarea",{"data-slot":"textarea",className:Ye("border-input dark:bg-input/30 focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 disabled:bg-input/50 dark:disabled:bg-input/80 rounded-lg border bg-transparent px-2.5 py-2 text-base transition-colors focus-visible:ring-3 aria-invalid:ring-3 md:text-sm placeholder:text-muted-foreground flex field-sizing-content min-h-16 w-full outline-none disabled:cursor-not-allowed disabled:opacity-50",e),...t})}const It=10*1024*1024,At=20*1024*1024;function pl(){const{sessionId:e,isStreaming:t}=Fe(Yn,T=>({sessionId:T.sessionId,isStreaming:T.isStreaming})),[n,r]=X.useState(""),[i,o]=X.useState([]),[l,a]=X.useState(!1),u=X.useRef(null),s=X.useRef(null),f=X.useCallback(T=>new Promise((b,L)=>{const _=new FileReader;_.onload=()=>{const y=_.result.split(",")[1];b(y)},_.onerror=L,_.readAsDataURL(T)}),[]),c=X.useCallback(T=>T.type.startsWith("image/")?new Promise(b=>{const L=new FileReader;L.onload=()=>b(L.result),L.onerror=()=>b(void 0),L.readAsDataURL(T)}):Promise.resolve(void 0),[]),p=X.useCallback(async T=>{const b=Array.from(T),L=i.reduce((M,y)=>M+y.file.size,0),_=b.reduce((M,y)=>M+y.size,0);if(L+_>At){alert(`Total attachment size cannot exceed ${At/1024/1024}MB`);return}for(const M of b){if(M.size>It){alert(`File "${M.name}" is too large. Maximum size is ${It/1024/1024}MB`);continue}try{const y=await f(M),P=await c(M),z={id:`${Date.now()}-${Math.random().toString(36).slice(2)}`,file:M,preview:P,base64:y,mimeType:M.type};o(U=>[...U,z])}catch(y){console.error(`Failed to process file "${M.name}":`,y),alert(`Failed to process file "${M.name}"`)}}},[i,f,c]),h=X.useCallback(T=>{const b=T.target.files;b&&b.length>0&&p(b),s.current&&(s.current.value="")},[p]),g=X.useCallback(T=>{T.preventDefault(),T.stopPropagation(),a(!0)},[]),k=X.useCallback(T=>{T.preventDefault(),T.stopPropagation(),a(!1)},[]),S=X.useCallback(T=>{T.preventDefault(),T.stopPropagation(),a(!1);const b=T.dataTransfer.files;b.length>0&&p(b)},[p]),x=X.useCallback(T=>{const b=T.clipboardData.items,L=[];for(const _ of Array.from(b))if(_.kind==="file"){const M=_.getAsFile();M&&L.push(M)}L.length>0&&(T.preventDefault(),p(L))},[p]),E=X.useCallback(T=>{o(b=>b.filter(L=>L.id!==T))},[]),v=async()=>{if(!n.trim()&&i.length===0||!e||t)return;const T=n.trim(),b=[...i];r(""),o([]);const L=b.filter(P=>P.mimeType.startsWith("image/")).map(P=>({type:"image",data:P.base64,mimeType:P.mimeType})),_=b.filter(P=>!P.mimeType.startsWith("image/")),M=cn.getClient();if(!M){console.error("No client available");return}let y=T;try{for(const P of _)try{const z=await M.uploadAttachment(e,P.file.name,P.base64,P.mimeType);y+=`
2
- [Attached: ${z.fileName}]`}catch(z){console.error(`Failed to upload ${P.file.name}:`,z)}ji(y||"[Image attachments]"),await M.prompt(e,y,L.length>0?L:void 0)}catch(P){console.error("Failed to send message:",P)}u.current?.focus()},R=T=>{T.key==="Enter"&&(T.ctrlKey||T.metaKey)&&(T.preventDefault(),v())};return C.jsx("div",{className:"border-t border-border bg-card p-4",onDragOver:g,onDragLeave:k,onDrop:S,children:C.jsxs("div",{className:"flex flex-col gap-2",children:[C.jsx(ol,{attachments:i,onRemove:E}),C.jsxs("div",{className:"relative",children:[C.jsx(hl,{ref:u,id:"chat-input",name:"message",value:n,onChange:T=>r(T.target.value),onKeyDown:R,onPaste:x,placeholder:"Send a message... (Ctrl+Enter to send)",className:"min-h-[80px] resize-none",disabled:!e||t}),l&&C.jsx("div",{className:"absolute inset-0 flex items-center justify-center rounded-lg border-2 border-dashed border-primary bg-background/80 backdrop-blur-sm",children:C.jsx("p",{className:"text-sm font-medium text-primary",children:"Drop files here"})})]}),C.jsxs("div",{className:"flex items-center justify-between gap-2",children:[C.jsxs("div",{className:"flex items-center gap-2",children:[C.jsx("input",{ref:s,type:"file",multiple:!0,onChange:h,className:"hidden",accept:"image/*,application/pdf,text/*"}),C.jsxs(un,{type:"button",variant:"ghost",size:"icon-sm",disabled:!e||t,onClick:()=>s.current?.click(),title:"Attach files",children:[C.jsx(nl,{className:"h-4 w-4"}),C.jsx("span",{className:"sr-only",children:"Attach files"})]}),C.jsxs("p",{className:"text-xs text-muted-foreground",children:[C.jsx("kbd",{className:"rounded bg-muted px-1.5 py-0.5",children:"Ctrl+Enter"})," to send"]})]}),C.jsxs("div",{className:"flex items-center gap-2",children:[C.jsx(cl,{}),C.jsxs(un,{onClick:v,disabled:!n.trim()&&i.length===0||!e||t,size:"icon",children:[C.jsx(rl,{className:"h-4 w-4"}),C.jsx("span",{className:"sr-only",children:"Send message"})]})]})]})]})})}function ml(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const dl=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,gl=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,xl={};function Tt(e,t){return(xl.jsx?gl:dl).test(e)}const yl=/[ \t\n\f\r]/g;function kl(e){return typeof e=="object"?e.type==="text"?Pt(e.value):!1:Pt(e)}function Pt(e){return e.replace(yl,"")===""}class Je{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}Je.prototype.normal={};Je.prototype.property={};Je.prototype.space=void 0;function yr(e,t){const n={},r={};for(const i of e)Object.assign(n,i.property),Object.assign(r,i.normal);return new Je(n,r,t)}function jn(e){return e.toLowerCase()}class te{constructor(t,n){this.attribute=n,this.property=t}}te.prototype.attribute="";te.prototype.booleanish=!1;te.prototype.boolean=!1;te.prototype.commaOrSpaceSeparated=!1;te.prototype.commaSeparated=!1;te.prototype.defined=!1;te.prototype.mustUseProperty=!1;te.prototype.number=!1;te.prototype.overloadedBoolean=!1;te.prototype.property="";te.prototype.spaceSeparated=!1;te.prototype.space=void 0;let bl=0;const O=Ae(),Y=Ae(),On=Ae(),I=Ae(),G=Ae(),Ne=Ae(),ie=Ae();function Ae(){return 2**++bl}const Bn=Object.freeze(Object.defineProperty({__proto__:null,boolean:O,booleanish:Y,commaOrSpaceSeparated:ie,commaSeparated:Ne,number:I,overloadedBoolean:On,spaceSeparated:G},Symbol.toStringTag,{value:"Module"})),wn=Object.keys(Bn);class Qn extends te{constructor(t,n,r,i){let o=-1;if(super(t,n),Dt(this,"space",i),typeof r=="number")for(;++o<wn.length;){const l=wn[o];Dt(this,wn[o],(r&Bn[l])===Bn[l])}}}Qn.prototype.defined=!0;function Dt(e,t,n){n&&(e[t]=n)}function _e(e){const t={},n={};for(const[r,i]of Object.entries(e.properties)){const o=new Qn(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(o.mustUseProperty=!0),t[r]=o,n[jn(r)]=r,n[jn(o.attribute)]=r}return new Je(t,n,e.space)}const kr=_e({properties:{ariaActiveDescendant:null,ariaAtomic:Y,ariaAutoComplete:null,ariaBusy:Y,ariaChecked:Y,ariaColCount:I,ariaColIndex:I,ariaColSpan:I,ariaControls:G,ariaCurrent:null,ariaDescribedBy:G,ariaDetails:null,ariaDisabled:Y,ariaDropEffect:G,ariaErrorMessage:null,ariaExpanded:Y,ariaFlowTo:G,ariaGrabbed:Y,ariaHasPopup:null,ariaHidden:Y,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:G,ariaLevel:I,ariaLive:null,ariaModal:Y,ariaMultiLine:Y,ariaMultiSelectable:Y,ariaOrientation:null,ariaOwns:G,ariaPlaceholder:null,ariaPosInSet:I,ariaPressed:Y,ariaReadOnly:Y,ariaRelevant:null,ariaRequired:Y,ariaRoleDescription:G,ariaRowCount:I,ariaRowIndex:I,ariaRowSpan:I,ariaSelected:Y,ariaSetSize:I,ariaSort:null,ariaValueMax:I,ariaValueMin:I,ariaValueNow:I,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function br(e,t){return t in e?e[t]:t}function wr(e,t){return br(e,t.toLowerCase())}const wl=_e({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Ne,acceptCharset:G,accessKey:G,action:null,allow:null,allowFullScreen:O,allowPaymentRequest:O,allowUserMedia:O,alt:null,as:null,async:O,autoCapitalize:null,autoComplete:G,autoFocus:O,autoPlay:O,blocking:G,capture:null,charSet:null,checked:O,cite:null,className:G,cols:I,colSpan:null,content:null,contentEditable:Y,controls:O,controlsList:G,coords:I|Ne,crossOrigin:null,data:null,dateTime:null,decoding:null,default:O,defer:O,dir:null,dirName:null,disabled:O,download:On,draggable:Y,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:O,formTarget:null,headers:G,height:I,hidden:On,high:I,href:null,hrefLang:null,htmlFor:G,httpEquiv:G,id:null,imageSizes:null,imageSrcSet:null,inert:O,inputMode:null,integrity:null,is:null,isMap:O,itemId:null,itemProp:G,itemRef:G,itemScope:O,itemType:G,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:O,low:I,manifest:null,max:null,maxLength:I,media:null,method:null,min:null,minLength:I,multiple:O,muted:O,name:null,nonce:null,noModule:O,noValidate:O,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:O,optimum:I,pattern:null,ping:G,placeholder:null,playsInline:O,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:O,referrerPolicy:null,rel:G,required:O,reversed:O,rows:I,rowSpan:I,sandbox:G,scope:null,scoped:O,seamless:O,selected:O,shadowRootClonable:O,shadowRootDelegatesFocus:O,shadowRootMode:null,shape:null,size:I,sizes:null,slot:null,span:I,spellCheck:Y,src:null,srcDoc:null,srcLang:null,srcSet:null,start:I,step:null,style:null,tabIndex:I,target:null,title:null,translate:null,type:null,typeMustMatch:O,useMap:null,value:Y,width:I,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:G,axis:null,background:null,bgColor:null,border:I,borderColor:null,bottomMargin:I,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:O,declare:O,event:null,face:null,frame:null,frameBorder:null,hSpace:I,leftMargin:I,link:null,longDesc:null,lowSrc:null,marginHeight:I,marginWidth:I,noResize:O,noHref:O,noShade:O,noWrap:O,object:null,profile:null,prompt:null,rev:null,rightMargin:I,rules:null,scheme:null,scrolling:Y,standby:null,summary:null,text:null,topMargin:I,valueType:null,version:null,vAlign:null,vLink:null,vSpace:I,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:O,disableRemotePlayback:O,prefix:null,property:null,results:I,security:null,unselectable:null},space:"html",transform:wr}),Sl=_e({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",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:ie,accentHeight:I,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:I,amplitude:I,arabicForm:null,ascent:I,attributeName:null,attributeType:null,azimuth:I,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:I,by:null,calcMode:null,capHeight:I,className:G,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:I,diffuseConstant:I,direction:null,display:null,dur:null,divisor:I,dominantBaseline:null,download:O,dx:null,dy:null,edgeMode:null,editable:null,elevation:I,enableBackground:null,end:null,event:null,exponent:I,externalResourcesRequired:null,fill:null,fillOpacity:I,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:Ne,g2:Ne,glyphName:Ne,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:I,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:I,horizOriginX:I,horizOriginY:I,id:null,ideographic:I,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:I,k:I,k1:I,k2:I,k3:I,k4:I,kernelMatrix:ie,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:I,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:I,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:I,overlineThickness:I,paintOrder:null,panose1:null,path:null,pathLength:I,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:G,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:I,pointsAtY:I,pointsAtZ:I,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:ie,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:ie,rev:ie,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:ie,requiredFeatures:ie,requiredFonts:ie,requiredFormats:ie,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:I,specularExponent:I,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:I,strikethroughThickness:I,string:null,stroke:null,strokeDashArray:ie,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:I,strokeOpacity:I,strokeWidth:null,style:null,surfaceScale:I,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:ie,tabIndex:I,tableValues:null,target:null,targetX:I,targetY:I,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:ie,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:I,underlineThickness:I,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:I,values:null,vAlphabetic:I,vMathematical:I,vectorEffect:null,vHanging:I,vIdeographic:I,version:null,vertAdvY:I,vertOriginX:I,vertOriginY:I,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:I,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:br}),Sr=_e({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()}}),Cr=_e({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:wr}),vr=_e({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),Cl={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"},vl=/[A-Z]/g,zt=/-[a-z]/g,El=/^data[-\w.:]+$/i;function Il(e,t){const n=jn(t);let r=t,i=te;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&El.test(t)){if(t.charAt(4)==="-"){const o=t.slice(5).replace(zt,Tl);r="data"+o.charAt(0).toUpperCase()+o.slice(1)}else{const o=t.slice(4);if(!zt.test(o)){let l=o.replace(vl,Al);l.charAt(0)!=="-"&&(l="-"+l),t="data"+l}}i=Qn}return new i(r,t)}function Al(e){return"-"+e.toLowerCase()}function Tl(e){return e.charAt(1).toUpperCase()}const Pl=yr([kr,wl,Sr,Cr,vr],"html"),Kn=yr([kr,Sl,Sr,Cr,vr],"svg");function Dl(e){return e.join(" ").trim()}var ze={},Sn,Lt;function zl(){if(Lt)return Sn;Lt=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,n=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,i=/^:\s*/,o=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,l=/^[;\s]*/,a=/^\s+|\s+$/g,u=`
1
+ import{c as Ie,j as C,B as un,X as zi,f as Ye,m as Fe,V as Yn,r as X,W as Li,Y as Mi,Z as Fi,_ as Ni,$ as kt,a0 as tn,a1 as bt,a2 as wt,a3 as St,a4 as Ct,p as cn,a5 as Ri,a6 as _i,a7 as ji,a8 as xr,a9 as Oi,aa as Bi,U as $i,q as Hi,w as Ui,L as Vi,A as qi}from"./main-J9rrgTOF.js";import{L as Wi}from"./loader-circle-CpT1_nns.js";const Gi=[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]],Xi=Ie("bot",Gi);const Yi=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],vt=Ie("check",Yi);const Qi=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],Ki=Ie("chevron-down",Qi);const Ji=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}]],Zi=Ie("file",Ji);const el=[["path",{d:"m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551",key:"1miecu"}]],nl=Ie("paperclip",el);const tl=[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]],rl=Ie("send",tl);const il=[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]],ll=Ie("user",il);function ol({attachments:e,onRemove:t}){return e.length===0?null:C.jsx("div",{className:"flex flex-wrap gap-2 pb-2",children:e.map(n=>{const r=n.mimeType.startsWith("image/");return C.jsxs("div",{className:Ye("group relative flex items-center gap-2 rounded-lg border border-border bg-muted px-3 py-2","hover:bg-muted/80 transition-colors"),children:[r&&n.preview?C.jsx("div",{className:"relative h-12 w-12 shrink-0 overflow-hidden rounded",children:C.jsx("img",{src:n.preview,alt:n.file.name,className:"h-full w-full object-cover"})}):C.jsx("div",{className:"flex h-12 w-12 shrink-0 items-center justify-center rounded bg-background",children:C.jsx(Zi,{className:"h-6 w-6 text-muted-foreground"})}),C.jsxs("div",{className:"flex-1 min-w-0",children:[C.jsx("p",{className:"text-sm font-medium truncate",children:n.file.name}),C.jsx("p",{className:"text-xs text-muted-foreground",children:al(n.file.size)})]}),C.jsxs(un,{type:"button",variant:"ghost",size:"icon-xs",onClick:()=>t(n.id),className:"shrink-0",title:"Remove attachment",children:[C.jsx(zi,{className:"h-3 w-3"}),C.jsxs("span",{className:"sr-only",children:["Remove ",n.file.name]})]})]},n.id)})})}function al(e){if(e===0)return"0 B";const t=1024,n=["B","KB","MB","GB"],r=Math.floor(Math.log(e)/Math.log(t));return`${Math.round(e/t**r*100)/100} ${n[r]}`}function bn(e){return{anthropic:"Anthropic",openai:"OpenAI",google:"Google","amazon-bedrock":"Amazon Bedrock",openrouter:"OpenRouter","vercel-ai-gateway":"Vercel AI Gateway",xai:"xAI",mistral:"Mistral",groq:"Groq",huggingface:"Hugging Face","google-vertex":"Google Vertex AI","google-antigravity":"Google Antigravity","google-gemini-cli":"Google Gemini CLI","azure-openai-responses":"Azure OpenAI","github-copilot":"GitHub Copilot",cerebras:"Cerebras",opencode:"OpenCode",zai:"Z.ai",minimax:"MiniMax","minimax-cn":"MiniMax (CN)","kimi-coding":"Kimi"}[e]||e.split("-").map(n=>n.charAt(0).toUpperCase()+n.slice(1)).join(" ")}function Et(e){const t=e.replace(/\s+\((EU|US|Global|latest|free|exacto|thinking|Antigravity)\)$/i,"").trim(),n=t.match(/\s+([\d.]+)$/);if(n){const r=n[1],i=parseFloat(r);if(!isNaN(i))return{family:t.substring(0,t.length-n[0].length).trim(),version:i}}return{family:t,version:null}}function sl(e){const t=new Map;for(const i of e){const{family:o}=Et(i.name);t.has(o)||t.set(o,[]),t.get(o).push(i)}const n=[],r=[];for(const[i,o]of t){if(o.length===1){n.push(o[0]);continue}const l=o.map(s=>({model:s,...Et(s.name)})),a=l.filter(s=>s.version===null),u=l.filter(s=>s.version!==null);if(u.length===0)n.push(...o);else{const s=Math.max(...u.map(p=>p.version)),f=u.filter(p=>p.version===s),c=u.filter(p=>p.version!==s);n.push(...f.map(p=>p.model)),n.push(...a.map(p=>p.model)),r.push(...c.map(p=>p.model))}}return{latest:n,older:r}}function ul(e){const t=new Map;for(const n of e)t.has(n.provider)||t.set(n.provider,[]),t.get(n.provider).push(n);for(const[n,r]of t)r.sort((i,o)=>i.name.localeCompare(o.name));return t}function cl(){const{sessionId:e,model:t,availableModels:n,thinkingLevel:r,isStreaming:i}=Fe(Yn,k=>({sessionId:k.sessionId,model:k.model,availableModels:k.availableModels,thinkingLevel:k.thinkingLevel,isStreaming:k.isStreaming})),[o,l]=X.useState(!1),{latestModels:a,olderModels:u,shouldShowSubmenu:s}=X.useMemo(()=>{if(n.length===0)return{latestModels:[],olderModels:[],shouldShowSubmenu:!1};if(n.length<=10)return{latestModels:[...n].sort((E,v)=>E.name.localeCompare(v.name)),olderModels:[],shouldShowSubmenu:!1};const{latest:k,older:S}=sl(n);return k.sort((x,E)=>x.name.localeCompare(E.name)),{latestModels:k,olderModels:S,shouldShowSubmenu:S.length>0}},[n]),f=X.useMemo(()=>ul(u),[u]),c=async(k,S)=>{if(!e){console.log("[ModelSelector] No sessionId");return}console.log("[ModelSelector] Changing model:",{provider:k,modelId:S,sessionId:e});const x=cn.getClient();if(x)try{const E=await x.setModel(e,k,S);console.log("[ModelSelector] Model changed successfully:",E),_i(E),l(!1)}catch(E){console.error("[ModelSelector] Failed to set model:",E)}else console.error("[ModelSelector] No client available")},p=async k=>{if(!e)return;const S=cn.getClient();if(S)try{await S.setThinkingLevel(e,k),Ri(k)}catch(x){console.error("Failed to set thinking level:",x)}},h=[{value:"off",label:"Off"},{value:"minimal",label:"Minimal"},{value:"low",label:"Low"},{value:"medium",label:"Medium"},{value:"high",label:"High"},{value:"xhigh",label:"XHigh"}];if(!t)return null;const g=k=>{const S=t.provider===k.provider&&t.id===k.id;return C.jsxs(Ct,{onClick:()=>c(k.provider,k.id),className:"flex items-start gap-2 py-2",children:[C.jsx("div",{className:"flex h-5 w-5 items-center justify-center shrink-0",children:S&&C.jsx(vt,{className:"h-4 w-4"})}),C.jsxs("div",{className:"flex-1 min-w-0",children:[C.jsx("div",{className:"font-medium",children:k.name}),C.jsx("div",{className:"text-xs text-muted-foreground line-clamp-2",children:fl(k)})]})]},`${k.provider}/${k.id}`)};return C.jsxs(Li,{open:o,onOpenChange:l,children:[C.jsxs(Mi,{type:"button",disabled:i||!e,className:Ye("flex flex-col items-start gap-0.5 rounded-lg border border-border bg-background px-3 py-1.5 text-sm transition-colors","hover:bg-muted disabled:cursor-not-allowed disabled:opacity-50","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring"),children:[C.jsxs("div",{className:"flex items-center gap-1.5 w-full",children:[C.jsx("span",{className:"font-medium",children:t.name}),C.jsx(Ki,{className:"h-4 w-4 text-muted-foreground ml-auto"})]}),r!=="medium"&&C.jsxs("span",{className:"text-xs text-muted-foreground",children:["thinking: ",r]})]}),C.jsxs(Fi,{align:"end",className:"w-80",children:[C.jsx(Ni,{children:C.jsx(kt,{children:"Select Model"})}),C.jsx(tn,{}),C.jsx("div",{className:"max-h-96 overflow-y-auto",children:a.map(g)}),s&&C.jsxs(C.Fragment,{children:[C.jsx(tn,{}),C.jsxs(bt,{children:[C.jsx(wt,{children:C.jsx("span",{children:"Other models"})}),C.jsx(St,{className:"w-80 max-h-96 overflow-y-auto",children:Array.from(f.entries()).sort(([k],[S])=>bn(k).localeCompare(bn(S))).map(([k,S])=>C.jsxs("div",{children:[C.jsx(kt,{className:"sticky top-0 bg-popover z-10",children:bn(k)}),S.map(g),C.jsx(tn,{className:"my-1"})]},k))})]})]}),C.jsx(tn,{}),C.jsxs(bt,{children:[C.jsx(wt,{children:C.jsx("span",{children:"Thinking Level"})}),C.jsx(St,{children:h.map(k=>C.jsxs(Ct,{onClick:()=>p(k.value),className:"flex items-center gap-2",children:[C.jsx("div",{className:"flex h-5 w-5 items-center justify-center shrink-0",children:r===k.value&&C.jsx(vt,{className:"h-4 w-4"})}),C.jsx("span",{children:k.label})]},k.value))})]})]})]})}function fl(e){const t=e.name.toLowerCase();return t.includes("opus")?"Most capable for ambitious work":t.includes("sonnet")?"Most efficient for everyday tasks":t.includes("haiku")?"Fastest for quick answers":t.includes("gpt-4")?"Advanced reasoning and analysis":t.includes("gpt-3.5")?"Fast and efficient":t.includes("gemini")?"Google's multimodal AI":t.includes("claude")?"Anthropic's AI assistant":`${e.provider}/${e.id}`}function hl({className:e,...t}){return C.jsx("textarea",{"data-slot":"textarea",className:Ye("border-input dark:bg-input/30 focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 disabled:bg-input/50 dark:disabled:bg-input/80 rounded-lg border bg-transparent px-2.5 py-2 text-base transition-colors focus-visible:ring-3 aria-invalid:ring-3 md:text-sm placeholder:text-muted-foreground flex field-sizing-content min-h-16 w-full outline-none disabled:cursor-not-allowed disabled:opacity-50",e),...t})}const It=10*1024*1024,At=20*1024*1024;function pl(){const{sessionId:e,isStreaming:t}=Fe(Yn,T=>({sessionId:T.sessionId,isStreaming:T.isStreaming})),[n,r]=X.useState(""),[i,o]=X.useState([]),[l,a]=X.useState(!1),u=X.useRef(null),s=X.useRef(null),f=X.useCallback(T=>new Promise((b,L)=>{const _=new FileReader;_.onload=()=>{const y=_.result.split(",")[1];b(y)},_.onerror=L,_.readAsDataURL(T)}),[]),c=X.useCallback(T=>T.type.startsWith("image/")?new Promise(b=>{const L=new FileReader;L.onload=()=>b(L.result),L.onerror=()=>b(void 0),L.readAsDataURL(T)}):Promise.resolve(void 0),[]),p=X.useCallback(async T=>{const b=Array.from(T),L=i.reduce((M,y)=>M+y.file.size,0),_=b.reduce((M,y)=>M+y.size,0);if(L+_>At){alert(`Total attachment size cannot exceed ${At/1024/1024}MB`);return}for(const M of b){if(M.size>It){alert(`File "${M.name}" is too large. Maximum size is ${It/1024/1024}MB`);continue}try{const y=await f(M),P=await c(M),z={id:`${Date.now()}-${Math.random().toString(36).slice(2)}`,file:M,preview:P,base64:y,mimeType:M.type};o(U=>[...U,z])}catch(y){console.error(`Failed to process file "${M.name}":`,y),alert(`Failed to process file "${M.name}"`)}}},[i,f,c]),h=X.useCallback(T=>{const b=T.target.files;b&&b.length>0&&p(b),s.current&&(s.current.value="")},[p]),g=X.useCallback(T=>{T.preventDefault(),T.stopPropagation(),a(!0)},[]),k=X.useCallback(T=>{T.preventDefault(),T.stopPropagation(),a(!1)},[]),S=X.useCallback(T=>{T.preventDefault(),T.stopPropagation(),a(!1);const b=T.dataTransfer.files;b.length>0&&p(b)},[p]),x=X.useCallback(T=>{const b=T.clipboardData.items,L=[];for(const _ of Array.from(b))if(_.kind==="file"){const M=_.getAsFile();M&&L.push(M)}L.length>0&&(T.preventDefault(),p(L))},[p]),E=X.useCallback(T=>{o(b=>b.filter(L=>L.id!==T))},[]),v=async()=>{if(!n.trim()&&i.length===0||!e||t)return;const T=n.trim(),b=[...i];r(""),o([]);const L=b.filter(P=>P.mimeType.startsWith("image/")).map(P=>({type:"image",data:P.base64,mimeType:P.mimeType})),_=b.filter(P=>!P.mimeType.startsWith("image/")),M=cn.getClient();if(!M){console.error("No client available");return}let y=T;try{for(const P of _)try{const z=await M.uploadAttachment(e,P.file.name,P.base64,P.mimeType);y+=`
2
+ [Attached: ${z.fileName}]`}catch(z){console.error(`Failed to upload ${P.file.name}:`,z)}ji(y||"[Image attachments]"),await M.prompt(e,y,L.length>0?L:void 0)}catch(P){console.error("Failed to send message:",P)}u.current?.focus()},R=T=>{T.key==="Enter"&&(T.ctrlKey||T.metaKey)&&(T.preventDefault(),v())};return C.jsx("div",{className:"border-t border-border bg-card p-4",onDragOver:g,onDragLeave:k,onDrop:S,children:C.jsxs("div",{className:"flex flex-col gap-2",children:[C.jsx(ol,{attachments:i,onRemove:E}),C.jsxs("div",{className:"relative",children:[C.jsx(hl,{ref:u,id:"chat-input",name:"message",value:n,onChange:T=>r(T.target.value),onKeyDown:R,onPaste:x,placeholder:"Send a message... (Ctrl+Enter to send)",className:"min-h-[80px] resize-none",disabled:!e||t}),l&&C.jsx("div",{className:"absolute inset-0 flex items-center justify-center rounded-lg border-2 border-dashed border-primary bg-background/80 backdrop-blur-sm",children:C.jsx("p",{className:"text-sm font-medium text-primary",children:"Drop files here"})})]}),C.jsxs("div",{className:"flex items-center justify-between gap-2",children:[C.jsxs("div",{className:"flex items-center gap-2",children:[C.jsx("input",{ref:s,type:"file",multiple:!0,onChange:h,className:"hidden",accept:"image/*,application/pdf,text/*"}),C.jsxs(un,{type:"button",variant:"ghost",size:"icon-sm",disabled:!e||t,onClick:()=>s.current?.click(),title:"Attach files",children:[C.jsx(nl,{className:"h-4 w-4"}),C.jsx("span",{className:"sr-only",children:"Attach files"})]}),C.jsxs("p",{className:"text-xs text-muted-foreground",children:[C.jsx("kbd",{className:"rounded bg-muted px-1.5 py-0.5",children:"Ctrl+Enter"})," ","to send"]})]}),C.jsxs("div",{className:"flex items-center gap-2",children:[C.jsx(cl,{}),C.jsxs(un,{onClick:v,disabled:!n.trim()&&i.length===0||!e||t,size:"icon",children:[C.jsx(rl,{className:"h-4 w-4"}),C.jsx("span",{className:"sr-only",children:"Send message"})]})]})]})]})})}function ml(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const dl=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,gl=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,xl={};function Tt(e,t){return(xl.jsx?gl:dl).test(e)}const yl=/[ \t\n\f\r]/g;function kl(e){return typeof e=="object"?e.type==="text"?Pt(e.value):!1:Pt(e)}function Pt(e){return e.replace(yl,"")===""}class Je{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}Je.prototype.normal={};Je.prototype.property={};Je.prototype.space=void 0;function yr(e,t){const n={},r={};for(const i of e)Object.assign(n,i.property),Object.assign(r,i.normal);return new Je(n,r,t)}function jn(e){return e.toLowerCase()}class te{constructor(t,n){this.attribute=n,this.property=t}}te.prototype.attribute="";te.prototype.booleanish=!1;te.prototype.boolean=!1;te.prototype.commaOrSpaceSeparated=!1;te.prototype.commaSeparated=!1;te.prototype.defined=!1;te.prototype.mustUseProperty=!1;te.prototype.number=!1;te.prototype.overloadedBoolean=!1;te.prototype.property="";te.prototype.spaceSeparated=!1;te.prototype.space=void 0;let bl=0;const O=Ae(),Y=Ae(),On=Ae(),I=Ae(),G=Ae(),Ne=Ae(),ie=Ae();function Ae(){return 2**++bl}const Bn=Object.freeze(Object.defineProperty({__proto__:null,boolean:O,booleanish:Y,commaOrSpaceSeparated:ie,commaSeparated:Ne,number:I,overloadedBoolean:On,spaceSeparated:G},Symbol.toStringTag,{value:"Module"})),wn=Object.keys(Bn);class Qn extends te{constructor(t,n,r,i){let o=-1;if(super(t,n),Dt(this,"space",i),typeof r=="number")for(;++o<wn.length;){const l=wn[o];Dt(this,wn[o],(r&Bn[l])===Bn[l])}}}Qn.prototype.defined=!0;function Dt(e,t,n){n&&(e[t]=n)}function _e(e){const t={},n={};for(const[r,i]of Object.entries(e.properties)){const o=new Qn(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(o.mustUseProperty=!0),t[r]=o,n[jn(r)]=r,n[jn(o.attribute)]=r}return new Je(t,n,e.space)}const kr=_e({properties:{ariaActiveDescendant:null,ariaAtomic:Y,ariaAutoComplete:null,ariaBusy:Y,ariaChecked:Y,ariaColCount:I,ariaColIndex:I,ariaColSpan:I,ariaControls:G,ariaCurrent:null,ariaDescribedBy:G,ariaDetails:null,ariaDisabled:Y,ariaDropEffect:G,ariaErrorMessage:null,ariaExpanded:Y,ariaFlowTo:G,ariaGrabbed:Y,ariaHasPopup:null,ariaHidden:Y,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:G,ariaLevel:I,ariaLive:null,ariaModal:Y,ariaMultiLine:Y,ariaMultiSelectable:Y,ariaOrientation:null,ariaOwns:G,ariaPlaceholder:null,ariaPosInSet:I,ariaPressed:Y,ariaReadOnly:Y,ariaRelevant:null,ariaRequired:Y,ariaRoleDescription:G,ariaRowCount:I,ariaRowIndex:I,ariaRowSpan:I,ariaSelected:Y,ariaSetSize:I,ariaSort:null,ariaValueMax:I,ariaValueMin:I,ariaValueNow:I,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function br(e,t){return t in e?e[t]:t}function wr(e,t){return br(e,t.toLowerCase())}const wl=_e({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Ne,acceptCharset:G,accessKey:G,action:null,allow:null,allowFullScreen:O,allowPaymentRequest:O,allowUserMedia:O,alt:null,as:null,async:O,autoCapitalize:null,autoComplete:G,autoFocus:O,autoPlay:O,blocking:G,capture:null,charSet:null,checked:O,cite:null,className:G,cols:I,colSpan:null,content:null,contentEditable:Y,controls:O,controlsList:G,coords:I|Ne,crossOrigin:null,data:null,dateTime:null,decoding:null,default:O,defer:O,dir:null,dirName:null,disabled:O,download:On,draggable:Y,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:O,formTarget:null,headers:G,height:I,hidden:On,high:I,href:null,hrefLang:null,htmlFor:G,httpEquiv:G,id:null,imageSizes:null,imageSrcSet:null,inert:O,inputMode:null,integrity:null,is:null,isMap:O,itemId:null,itemProp:G,itemRef:G,itemScope:O,itemType:G,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:O,low:I,manifest:null,max:null,maxLength:I,media:null,method:null,min:null,minLength:I,multiple:O,muted:O,name:null,nonce:null,noModule:O,noValidate:O,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:O,optimum:I,pattern:null,ping:G,placeholder:null,playsInline:O,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:O,referrerPolicy:null,rel:G,required:O,reversed:O,rows:I,rowSpan:I,sandbox:G,scope:null,scoped:O,seamless:O,selected:O,shadowRootClonable:O,shadowRootDelegatesFocus:O,shadowRootMode:null,shape:null,size:I,sizes:null,slot:null,span:I,spellCheck:Y,src:null,srcDoc:null,srcLang:null,srcSet:null,start:I,step:null,style:null,tabIndex:I,target:null,title:null,translate:null,type:null,typeMustMatch:O,useMap:null,value:Y,width:I,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:G,axis:null,background:null,bgColor:null,border:I,borderColor:null,bottomMargin:I,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:O,declare:O,event:null,face:null,frame:null,frameBorder:null,hSpace:I,leftMargin:I,link:null,longDesc:null,lowSrc:null,marginHeight:I,marginWidth:I,noResize:O,noHref:O,noShade:O,noWrap:O,object:null,profile:null,prompt:null,rev:null,rightMargin:I,rules:null,scheme:null,scrolling:Y,standby:null,summary:null,text:null,topMargin:I,valueType:null,version:null,vAlign:null,vLink:null,vSpace:I,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:O,disableRemotePlayback:O,prefix:null,property:null,results:I,security:null,unselectable:null},space:"html",transform:wr}),Sl=_e({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",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:ie,accentHeight:I,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:I,amplitude:I,arabicForm:null,ascent:I,attributeName:null,attributeType:null,azimuth:I,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:I,by:null,calcMode:null,capHeight:I,className:G,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:I,diffuseConstant:I,direction:null,display:null,dur:null,divisor:I,dominantBaseline:null,download:O,dx:null,dy:null,edgeMode:null,editable:null,elevation:I,enableBackground:null,end:null,event:null,exponent:I,externalResourcesRequired:null,fill:null,fillOpacity:I,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:Ne,g2:Ne,glyphName:Ne,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:I,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:I,horizOriginX:I,horizOriginY:I,id:null,ideographic:I,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:I,k:I,k1:I,k2:I,k3:I,k4:I,kernelMatrix:ie,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:I,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:I,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:I,overlineThickness:I,paintOrder:null,panose1:null,path:null,pathLength:I,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:G,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:I,pointsAtY:I,pointsAtZ:I,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:ie,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:ie,rev:ie,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:ie,requiredFeatures:ie,requiredFonts:ie,requiredFormats:ie,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:I,specularExponent:I,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:I,strikethroughThickness:I,string:null,stroke:null,strokeDashArray:ie,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:I,strokeOpacity:I,strokeWidth:null,style:null,surfaceScale:I,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:ie,tabIndex:I,tableValues:null,target:null,targetX:I,targetY:I,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:ie,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:I,underlineThickness:I,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:I,values:null,vAlphabetic:I,vMathematical:I,vectorEffect:null,vHanging:I,vIdeographic:I,version:null,vertAdvY:I,vertOriginX:I,vertOriginY:I,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:I,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:br}),Sr=_e({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()}}),Cr=_e({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:wr}),vr=_e({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),Cl={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"},vl=/[A-Z]/g,zt=/-[a-z]/g,El=/^data[-\w.:]+$/i;function Il(e,t){const n=jn(t);let r=t,i=te;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&El.test(t)){if(t.charAt(4)==="-"){const o=t.slice(5).replace(zt,Tl);r="data"+o.charAt(0).toUpperCase()+o.slice(1)}else{const o=t.slice(4);if(!zt.test(o)){let l=o.replace(vl,Al);l.charAt(0)!=="-"&&(l="-"+l),t="data"+l}}i=Qn}return new i(r,t)}function Al(e){return"-"+e.toLowerCase()}function Tl(e){return e.charAt(1).toUpperCase()}const Pl=yr([kr,wl,Sr,Cr,vr],"html"),Kn=yr([kr,Sl,Sr,Cr,vr],"svg");function Dl(e){return e.join(" ").trim()}var ze={},Sn,Lt;function zl(){if(Lt)return Sn;Lt=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,n=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,i=/^:\s*/,o=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,l=/^[;\s]*/,a=/^\s+|\s+$/g,u=`
3
3
  `,s="/",f="*",c="",p="comment",h="declaration";function g(S,x){if(typeof S!="string")throw new TypeError("First argument must be a string");if(!S)return[];x=x||{};var E=1,v=1;function R(N){var D=N.match(t);D&&(E+=D.length);var V=N.lastIndexOf(u);v=~V?N.length-V:v+N.length}function T(){var N={line:E,column:v};return function(D){return D.position=new b(N),M(),D}}function b(N){this.start=N,this.end={line:E,column:v},this.source=x.source}b.prototype.content=S;function L(N){var D=new Error(x.source+":"+E+":"+v+": "+N);if(D.reason=N,D.filename=x.source,D.line=E,D.column=v,D.source=S,!x.silent)throw D}function _(N){var D=N.exec(S);if(D){var V=D[0];return R(V),S=S.slice(V.length),D}}function M(){_(n)}function y(N){var D;for(N=N||[];D=P();)D!==!1&&N.push(D);return N}function P(){var N=T();if(!(s!=S.charAt(0)||f!=S.charAt(1))){for(var D=2;c!=S.charAt(D)&&(f!=S.charAt(D)||s!=S.charAt(D+1));)++D;if(D+=2,c===S.charAt(D-1))return L("End of comment missing");var V=S.slice(2,D-2);return v+=2,R(V),S=S.slice(D),v+=2,N({type:p,comment:V})}}function z(){var N=T(),D=_(r);if(D){if(P(),!_(i))return L("property missing ':'");var V=_(o),Q=N({type:h,property:k(D[0].replace(e,c)),value:V?k(V[0].replace(e,c)):c});return _(l),Q}}function U(){var N=[];y(N);for(var D;D=z();)D!==!1&&(N.push(D),y(N));return N}return M(),U()}function k(S){return S?S.replace(a,c):c}return Sn=g,Sn}var Mt;function Ll(){if(Mt)return ze;Mt=1;var e=ze&&ze.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(ze,"__esModule",{value:!0}),ze.default=n;const t=e(zl());function n(r,i){let o=null;if(!r||typeof r!="string")return o;const l=(0,t.default)(r),a=typeof i=="function";return l.forEach(u=>{if(u.type!=="declaration")return;const{property:s,value:f}=u;a?i(s,f,u):f&&(o=o||{},o[s]=f)}),o}return ze}var He={},Ft;function Ml(){if(Ft)return He;Ft=1,Object.defineProperty(He,"__esModule",{value:!0}),He.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,t=/-([a-z])/g,n=/^[^-]+$/,r=/^-(webkit|moz|ms|o|khtml)-/,i=/^-(ms)-/,o=function(s){return!s||n.test(s)||e.test(s)},l=function(s,f){return f.toUpperCase()},a=function(s,f){return"".concat(f,"-")},u=function(s,f){return f===void 0&&(f={}),o(s)?s:(s=s.toLowerCase(),f.reactCompat?s=s.replace(i,a):s=s.replace(r,a),s.replace(t,l))};return He.camelCase=u,He}var Ue,Nt;function Fl(){if(Nt)return Ue;Nt=1;var e=Ue&&Ue.__importDefault||function(i){return i&&i.__esModule?i:{default:i}},t=e(Ll()),n=Ml();function r(i,o){var l={};return!i||typeof i!="string"||(0,t.default)(i,function(a,u){a&&u&&(l[(0,n.camelCase)(a,o)]=u)}),l}return r.default=r,Ue=r,Ue}var Nl=Fl();const Rl=xr(Nl),Er=Ir("end"),Jn=Ir("start");function Ir(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 _l(e){const t=Jn(e),n=Er(e);if(t&&n)return{start:t,end:n}}function We(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?Rt(e.position):"start"in e||"end"in e?Rt(e):"line"in e||"column"in e?$n(e):""}function $n(e){return _t(e&&e.line)+":"+_t(e&&e.column)}function Rt(e){return $n(e&&e.start)+"-"+$n(e&&e.end)}function _t(e){return e&&typeof e=="number"?e:1}class Z extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let i="",o={},l=!1;if(n&&("line"in n&&"column"in n?o={place:n}:"start"in n&&"end"in n?o={place:n}:"type"in n?o={ancestors:[n],place:n.position}:o={...n}),typeof t=="string"?i=t:!o.cause&&t&&(l=!0,i=t.message,o.cause=t),!o.ruleId&&!o.source&&typeof r=="string"){const u=r.indexOf(":");u===-1?o.ruleId=r:(o.source=r.slice(0,u),o.ruleId=r.slice(u+1))}if(!o.place&&o.ancestors&&o.ancestors){const u=o.ancestors[o.ancestors.length-1];u&&(o.place=u.position)}const a=o.place&&"start"in o.place?o.place.start:o.place;this.ancestors=o.ancestors||void 0,this.cause=o.cause||void 0,this.column=a?a.column:void 0,this.fatal=void 0,this.file="",this.message=i,this.line=a?a.line:void 0,this.name=We(o.place)||"1:1",this.place=o.place||void 0,this.reason=this.message,this.ruleId=o.ruleId||void 0,this.source=o.source||void 0,this.stack=l&&o.cause&&typeof o.cause.stack=="string"?o.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}Z.prototype.file="";Z.prototype.name="";Z.prototype.reason="";Z.prototype.message="";Z.prototype.stack="";Z.prototype.column=void 0;Z.prototype.line=void 0;Z.prototype.ancestors=void 0;Z.prototype.cause=void 0;Z.prototype.fatal=void 0;Z.prototype.place=void 0;Z.prototype.ruleId=void 0;Z.prototype.source=void 0;const Zn={}.hasOwnProperty,jl=new Map,Ol=/[A-Z]/g,Bl=new Set(["table","tbody","thead","tfoot","tr"]),$l=new Set(["td","th"]),Ar="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function Hl(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=Ql(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=Yl(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"?Kn:Pl,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},o=Tr(i,e,void 0);return o&&typeof o!="string"?o:i.create(e,i.Fragment,{children:o||void 0},void 0)}function Tr(e,t,n){if(t.type==="element")return Ul(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return Vl(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return Wl(e,t,n);if(t.type==="mdxjsEsm")return ql(e,t);if(t.type==="root")return Gl(e,t,n);if(t.type==="text")return Xl(e,t)}function Ul(e,t,n){const r=e.schema;let i=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(i=Kn,e.schema=i),e.ancestors.push(t);const o=Dr(e,t.tagName,!1),l=Kl(e,t);let a=nt(e,t);return Bl.has(t.tagName)&&(a=a.filter(function(u){return typeof u=="string"?!kl(u):!0})),Pr(e,l,o,t),et(l,a),e.ancestors.pop(),e.schema=r,e.create(t,o,l,n)}function Vl(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)}Qe(e,t.position)}function ql(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Qe(e,t.position)}function Wl(e,t,n){const r=e.schema;let i=r;t.name==="svg"&&r.space==="html"&&(i=Kn,e.schema=i),e.ancestors.push(t);const o=t.name===null?e.Fragment:Dr(e,t.name,!0),l=Jl(e,t),a=nt(e,t);return Pr(e,l,o,t),et(l,a),e.ancestors.pop(),e.schema=r,e.create(t,o,l,n)}function Gl(e,t,n){const r={};return et(r,nt(e,t)),e.create(t,e.Fragment,r,n)}function Xl(e,t){return t.value}function Pr(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function et(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function Yl(e,t,n){return r;function r(i,o,l,a){const s=Array.isArray(l.children)?n:t;return a?s(o,l,a):s(o,l)}}function Ql(e,t){return n;function n(r,i,o,l){const a=Array.isArray(o.children),u=Jn(r);return t(i,o,l,a,{columnNumber:u?u.column-1:void 0,fileName:e,lineNumber:u?u.line:void 0},void 0)}}function Kl(e,t){const n={};let r,i;for(i in t.properties)if(i!=="children"&&Zn.call(t.properties,i)){const o=Zl(e,i,t.properties[i]);if(o){const[l,a]=o;e.tableCellAlignToStyle&&l==="align"&&typeof a=="string"&&$l.has(t.tagName)?r=a:n[l]=a}}if(r){const o=n.style||(n.style={});o[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function Jl(e,t){const n={};for(const r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const o=r.data.estree.body[0];o.type;const l=o.expression;l.type;const a=l.properties[0];a.type,Object.assign(n,e.evaluater.evaluateExpression(a.argument))}else Qe(e,t.position);else{const i=r.name;let o;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const a=r.value.data.estree.body[0];a.type,o=e.evaluater.evaluateExpression(a.expression)}else Qe(e,t.position);else o=r.value===null?!0:r.value;n[i]=o}return n}function nt(e,t){const n=[];let r=-1;const i=e.passKeys?new Map:jl;for(;++r<t.children.length;){const o=t.children[r];let l;if(e.passKeys){const u=o.type==="element"?o.tagName:o.type==="mdxJsxFlowElement"||o.type==="mdxJsxTextElement"?o.name:void 0;if(u){const s=i.get(u)||0;l=u+"-"+s,i.set(u,s+1)}}const a=Tr(e,o,l);a!==void 0&&n.push(a)}return n}function Zl(e,t,n){const r=Il(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?ml(n):Dl(n)),r.property==="style"){let i=typeof n=="object"?n:eo(e,String(n));return e.stylePropertyNameCase==="css"&&(i=no(i)),["style",i]}return[e.elementAttributeNameCase==="react"&&r.space?Cl[r.property]||r.property:r.attribute,n]}}function eo(e,t){try{return Rl(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const r=n,i=new Z("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=Ar+"#cannot-parse-style-attribute",i}}function Dr(e,t,n){let r;if(!n)r={type:"Literal",value:t};else if(t.includes(".")){const i=t.split(".");let o=-1,l;for(;++o<i.length;){const a=Tt(i[o])?{type:"Identifier",name:i[o]}:{type:"Literal",value:i[o]};l=l?{type:"MemberExpression",object:l,property:a,computed:!!(o&&a.type==="Literal"),optional:!1}:a}r=l}else r=Tt(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const i=r.value;return Zn.call(e.components,i)?e.components[i]:i}if(e.evaluater)return e.evaluater.evaluateExpression(r);Qe(e)}function Qe(e,t){const n=new Z("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=Ar+"#cannot-handle-mdx-estrees-without-createevaluater",n}function no(e){const t={};let n;for(n in e)Zn.call(e,n)&&(t[to(n)]=e[n]);return t}function to(e){let t=e.replace(Ol,ro);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function ro(e){return"-"+e.toLowerCase()}const Cn={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"]},io={};function tt(e,t){const n=io,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,i=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return zr(e,r,i)}function zr(e,t,n){if(lo(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 jt(e.children,t,n)}return Array.isArray(e)?jt(e,t,n):""}function jt(e,t,n){const r=[];let i=-1;for(;++i<e.length;)r[i]=zr(e[i],t,n);return r.join("")}function lo(e){return!!(e&&typeof e=="object")}const Ot=document.createElement("i");function rt(e){const t="&"+e+";";Ot.innerHTML=t;const n=Ot.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function le(e,t,n,r){const i=e.length;let o=0,l;if(t<0?t=-t>i?0:i+t:t=t>i?i:t,n=n>0?n:0,r.length<1e4)l=Array.from(r),l.unshift(t,n),e.splice(...l);else for(n&&e.splice(t,n);o<r.length;)l=r.slice(o,o+1e4),l.unshift(t,0),e.splice(...l),o+=1e4,t+=1e4}function oe(e,t){return e.length>0?(le(e,e.length,0,t),e):t}const Bt={}.hasOwnProperty;function Lr(e){const t={};let n=-1;for(;++n<e.length;)oo(t,e[n]);return t}function oo(e,t){let n;for(n in t){const i=(Bt.call(e,n)?e[n]:void 0)||(e[n]={}),o=t[n];let l;if(o)for(l in o){Bt.call(i,l)||(i[l]=[]);const a=o[l];ao(i[l],Array.isArray(a)?a:a?[a]:[])}}}function ao(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);le(e,0,0,r)}function Mr(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 fe(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const ee=we(/[A-Za-z]/),J=we(/[\dA-Za-z]/),so=we(/[#-'*+\--9=?A-Z^-~]/);function fn(e){return e!==null&&(e<32||e===127)}const Hn=we(/\d/),uo=we(/[\dA-Fa-f]/),co=we(/[!-/:-@[-`{-~]/);function F(e){return e!==null&&e<-2}function W(e){return e!==null&&(e<0||e===32)}function B(e){return e===-2||e===-1||e===32}const dn=we(new RegExp("\\p{P}|\\p{S}","u")),Ee=we(/\s/);function we(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function je(e){const t=[];let n=-1,r=0,i=0;for(;++n<e.length;){const o=e.charCodeAt(n);let l="";if(o===37&&J(e.charCodeAt(n+1))&&J(e.charCodeAt(n+2)))i=2;else if(o<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(o))||(l=String.fromCharCode(o));else if(o>55295&&o<57344){const a=e.charCodeAt(n+1);o<56320&&a>56319&&a<57344?(l=String.fromCharCode(o,a),i=1):l="�"}else l=String.fromCharCode(o);l&&(t.push(e.slice(r,n),encodeURIComponent(l)),r=n+i+1,l=""),i&&(n+=i,i=0)}return t.join("")+e.slice(r)}function H(e,t,n,r){const i=r?r-1:Number.POSITIVE_INFINITY;let o=0;return l;function l(u){return B(u)?(e.enter(n),a(u)):t(u)}function a(u){return B(u)&&o++<i?(e.consume(u),a):(e.exit(n),t(u))}}const fo={tokenize:ho};function ho(e){const t=e.attempt(this.parser.constructs.contentInitial,r,i);let n;return t;function r(a){if(a===null){e.consume(a);return}return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),H(e,t,"linePrefix")}function i(a){return e.enter("paragraph"),o(a)}function o(a){const u=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=u),n=u,l(a)}function l(a){if(a===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(a);return}return F(a)?(e.consume(a),e.exit("chunkText"),o):(e.consume(a),l)}}const po={tokenize:mo},$t={tokenize:go};function mo(e){const t=this,n=[];let r=0,i,o,l;return a;function a(v){if(r<n.length){const R=n[r];return t.containerState=R[1],e.attempt(R[0].continuation,u,s)(v)}return s(v)}function u(v){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&E();const R=t.events.length;let T=R,b;for(;T--;)if(t.events[T][0]==="exit"&&t.events[T][1].type==="chunkFlow"){b=t.events[T][1].end;break}x(r);let L=R;for(;L<t.events.length;)t.events[L][1].end={...b},L++;return le(t.events,T+1,0,t.events.slice(R)),t.events.length=L,s(v)}return a(v)}function s(v){if(r===n.length){if(!i)return p(v);if(i.currentConstruct&&i.currentConstruct.concrete)return g(v);t.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check($t,f,c)(v)}function f(v){return i&&E(),x(r),p(v)}function c(v){return t.parser.lazy[t.now().line]=r!==n.length,l=t.now().offset,g(v)}function p(v){return t.containerState={},e.attempt($t,h,g)(v)}function h(v){return r++,n.push([t.currentConstruct,t.containerState]),p(v)}function g(v){if(v===null){i&&E(),x(0),e.consume(v);return}return i=i||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:i,contentType:"flow",previous:o}),k(v)}function k(v){if(v===null){S(e.exit("chunkFlow"),!0),x(0),e.consume(v);return}return F(v)?(e.consume(v),S(e.exit("chunkFlow")),r=0,t.interrupt=void 0,a):(e.consume(v),k)}function S(v,R){const T=t.sliceStream(v);if(R&&T.push(null),v.previous=o,o&&(o.next=v),o=v,i.defineSkip(v.start),i.write(T),t.parser.lazy[v.start.line]){let b=i.events.length;for(;b--;)if(i.events[b][1].start.offset<l&&(!i.events[b][1].end||i.events[b][1].end.offset>l))return;const L=t.events.length;let _=L,M,y;for(;_--;)if(t.events[_][0]==="exit"&&t.events[_][1].type==="chunkFlow"){if(M){y=t.events[_][1].end;break}M=!0}for(x(r),b=L;b<t.events.length;)t.events[b][1].end={...y},b++;le(t.events,_+1,0,t.events.slice(L)),t.events.length=b}}function x(v){let R=n.length;for(;R-- >v;){const T=n[R];t.containerState=T[1],T[0].exit.call(t,e)}n.length=v}function E(){i.write([null]),o=void 0,i=void 0,t.containerState._closeFlow=void 0}}function go(e,t,n){return H(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Re(e){if(e===null||W(e)||Ee(e))return 1;if(dn(e))return 2}function gn(e,t,n){const r=[];let i=-1;for(;++i<e.length;){const o=e[i].resolveAll;o&&!r.includes(o)&&(t=o(t,n),r.push(o))}return t}const Un={name:"attention",resolveAll:xo,tokenize:yo};function xo(e,t){let n=-1,r,i,o,l,a,u,s,f;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;u=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},p={...e[n][1].start};Ht(c,-u),Ht(p,u),l={type:u>1?"strongSequence":"emphasisSequence",start:c,end:{...e[r][1].end}},a={type:u>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:p},o={type:u>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[n][1].start}},i={type:u>1?"strong":"emphasis",start:{...l.start},end:{...a.end}},e[r][1].end={...l.start},e[n][1].start={...a.end},s=[],e[r][1].end.offset-e[r][1].start.offset&&(s=oe(s,[["enter",e[r][1],t],["exit",e[r][1],t]])),s=oe(s,[["enter",i,t],["enter",l,t],["exit",l,t],["enter",o,t]]),s=oe(s,gn(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),s=oe(s,[["exit",o,t],["enter",a,t],["exit",a,t],["exit",i,t]]),e[n][1].end.offset-e[n][1].start.offset?(f=2,s=oe(s,[["enter",e[n][1],t],["exit",e[n][1],t]])):f=0,le(e,r-1,n-r+3,s),n=r+s.length-f-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function yo(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=Re(r);let o;return l;function l(u){return o=u,e.enter("attentionSequence"),a(u)}function a(u){if(u===o)return e.consume(u),a;const s=e.exit("attentionSequence"),f=Re(u),c=!f||f===2&&i||n.includes(u),p=!i||i===2&&f||n.includes(r);return s._open=!!(o===42?c:c&&(i||!p)),s._close=!!(o===42?p:p&&(f||!c)),t(u)}}function Ht(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const ko={name:"autolink",tokenize:bo};function bo(e,t,n){let r=0;return i;function i(h){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(h),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),o}function o(h){return ee(h)?(e.consume(h),l):h===64?n(h):s(h)}function l(h){return h===43||h===45||h===46||J(h)?(r=1,a(h)):s(h)}function a(h){return h===58?(e.consume(h),r=0,u):(h===43||h===45||h===46||J(h))&&r++<32?(e.consume(h),a):(r=0,s(h))}function u(h){return h===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(h),e.exit("autolinkMarker"),e.exit("autolink"),t):h===null||h===32||h===60||fn(h)?n(h):(e.consume(h),u)}function s(h){return h===64?(e.consume(h),f):so(h)?(e.consume(h),s):n(h)}function f(h){return J(h)?c(h):n(h)}function c(h){return h===46?(e.consume(h),r=0,f):h===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(h),e.exit("autolinkMarker"),e.exit("autolink"),t):p(h)}function p(h){if((h===45||J(h))&&r++<63){const g=h===45?p:c;return e.consume(h),g}return n(h)}}const Ze={partial:!0,tokenize:wo};function wo(e,t,n){return r;function r(o){return B(o)?H(e,i,"linePrefix")(o):i(o)}function i(o){return o===null||F(o)?t(o):n(o)}}const Fr={continuation:{tokenize:Co},exit:vo,name:"blockQuote",tokenize:So};function So(e,t,n){const r=this;return i;function i(l){if(l===62){const a=r.containerState;return a.open||(e.enter("blockQuote",{_container:!0}),a.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(l),e.exit("blockQuoteMarker"),o}return n(l)}function o(l){return B(l)?(e.enter("blockQuotePrefixWhitespace"),e.consume(l),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(l))}}function Co(e,t,n){const r=this;return i;function i(l){return B(l)?H(e,o,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(l):o(l)}function o(l){return e.attempt(Fr,t,n)(l)}}function vo(e){e.exit("blockQuote")}const Nr={name:"characterEscape",tokenize:Eo};function Eo(e,t,n){return r;function r(o){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(o),e.exit("escapeMarker"),i}function i(o){return co(o)?(e.enter("characterEscapeValue"),e.consume(o),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(o)}}const Rr={name:"characterReference",tokenize:Io};function Io(e,t,n){const r=this;let i=0,o,l;return a;function a(c){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(c),e.exit("characterReferenceMarker"),u}function u(c){return c===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(c),e.exit("characterReferenceMarkerNumeric"),s):(e.enter("characterReferenceValue"),o=31,l=J,f(c))}function s(c){return c===88||c===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(c),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),o=6,l=uo,f):(e.enter("characterReferenceValue"),o=7,l=Hn,f(c))}function f(c){if(c===59&&i){const p=e.exit("characterReferenceValue");return l===J&&!rt(r.sliceSerialize(p))?n(c):(e.enter("characterReferenceMarker"),e.consume(c),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return l(c)&&i++<o?(e.consume(c),f):n(c)}}const Ut={partial:!0,tokenize:To},Vt={concrete:!0,name:"codeFenced",tokenize:Ao};function Ao(e,t,n){const r=this,i={partial:!0,tokenize:T};let o=0,l=0,a;return u;function u(b){return s(b)}function s(b){const L=r.events[r.events.length-1];return o=L&&L[1].type==="linePrefix"?L[2].sliceSerialize(L[1],!0).length:0,a=b,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),f(b)}function f(b){return b===a?(l++,e.consume(b),f):l<3?n(b):(e.exit("codeFencedFenceSequence"),B(b)?H(e,c,"whitespace")(b):c(b))}function c(b){return b===null||F(b)?(e.exit("codeFencedFence"),r.interrupt?t(b):e.check(Ut,k,R)(b)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),p(b))}function p(b){return b===null||F(b)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),c(b)):B(b)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),H(e,h,"whitespace")(b)):b===96&&b===a?n(b):(e.consume(b),p)}function h(b){return b===null||F(b)?c(b):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),g(b))}function g(b){return b===null||F(b)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),c(b)):b===96&&b===a?n(b):(e.consume(b),g)}function k(b){return e.attempt(i,R,S)(b)}function S(b){return e.enter("lineEnding"),e.consume(b),e.exit("lineEnding"),x}function x(b){return o>0&&B(b)?H(e,E,"linePrefix",o+1)(b):E(b)}function E(b){return b===null||F(b)?e.check(Ut,k,R)(b):(e.enter("codeFlowValue"),v(b))}function v(b){return b===null||F(b)?(e.exit("codeFlowValue"),E(b)):(e.consume(b),v)}function R(b){return e.exit("codeFenced"),t(b)}function T(b,L,_){let M=0;return y;function y(D){return b.enter("lineEnding"),b.consume(D),b.exit("lineEnding"),P}function P(D){return b.enter("codeFencedFence"),B(D)?H(b,z,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(D):z(D)}function z(D){return D===a?(b.enter("codeFencedFenceSequence"),U(D)):_(D)}function U(D){return D===a?(M++,b.consume(D),U):M>=l?(b.exit("codeFencedFenceSequence"),B(D)?H(b,N,"whitespace")(D):N(D)):_(D)}function N(D){return D===null||F(D)?(b.exit("codeFencedFence"),L(D)):_(D)}}}function To(e,t,n){const r=this;return i;function i(l){return l===null?n(l):(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),o)}function o(l){return r.parser.lazy[r.now().line]?n(l):t(l)}}const vn={name:"codeIndented",tokenize:Do},Po={partial:!0,tokenize:zo};function Do(e,t,n){const r=this;return i;function i(s){return e.enter("codeIndented"),H(e,o,"linePrefix",5)(s)}function o(s){const f=r.events[r.events.length-1];return f&&f[1].type==="linePrefix"&&f[2].sliceSerialize(f[1],!0).length>=4?l(s):n(s)}function l(s){return s===null?u(s):F(s)?e.attempt(Po,l,u)(s):(e.enter("codeFlowValue"),a(s))}function a(s){return s===null||F(s)?(e.exit("codeFlowValue"),l(s)):(e.consume(s),a)}function u(s){return e.exit("codeIndented"),t(s)}}function zo(e,t,n){const r=this;return i;function i(l){return r.parser.lazy[r.now().line]?n(l):F(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),i):H(e,o,"linePrefix",5)(l)}function o(l){const a=r.events[r.events.length-1];return a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?t(l):F(l)?i(l):n(l)}}const Lo={name:"codeText",previous:Fo,resolve:Mo,tokenize:No};function Mo(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 Fo(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function No(e,t,n){let r=0,i,o;return l;function l(c){return e.enter("codeText"),e.enter("codeTextSequence"),a(c)}function a(c){return c===96?(e.consume(c),r++,a):(e.exit("codeTextSequence"),u(c))}function u(c){return c===null?n(c):c===32?(e.enter("space"),e.consume(c),e.exit("space"),u):c===96?(o=e.enter("codeTextSequence"),i=0,f(c)):F(c)?(e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),u):(e.enter("codeTextData"),s(c))}function s(c){return c===null||c===32||c===96||F(c)?(e.exit("codeTextData"),u(c)):(e.consume(c),s)}function f(c){return c===96?(e.consume(c),i++,f):i===r?(e.exit("codeTextSequence"),e.exit("codeText"),t(c)):(o.type="codeTextData",s(c))}}class Ro{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 o=this.right.splice(this.right.length-i,Number.POSITIVE_INFINITY);return r&&Ve(this.left,r),o.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),Ve(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),Ve(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);Ve(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);Ve(this.left,n.reverse())}}}function Ve(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 _r(e){const t={};let n=-1,r,i,o,l,a,u,s;const f=new Ro(e);for(;++n<f.length;){for(;n in t;)n=t[n];if(r=f.get(n),n&&r[1].type==="chunkFlow"&&f.get(n-1)[1].type==="listItemPrefix"&&(u=r[1]._tokenizer.events,o=0,o<u.length&&u[o][1].type==="lineEndingBlank"&&(o+=2),o<u.length&&u[o][1].type==="content"))for(;++o<u.length&&u[o][1].type!=="content";)u[o][1].type==="chunkText"&&(u[o][1]._isInFirstContentOfListItem=!0,o++);if(r[0]==="enter")r[1].contentType&&(Object.assign(t,_o(f,n)),n=t[n],s=!0);else if(r[1]._container){for(o=n,i=void 0;o--;)if(l=f.get(o),l[1].type==="lineEnding"||l[1].type==="lineEndingBlank")l[0]==="enter"&&(i&&(f.get(i)[1].type="lineEndingBlank"),l[1].type="lineEnding",i=o);else if(!(l[1].type==="linePrefix"||l[1].type==="listItemIndent"))break;i&&(r[1].end={...f.get(i)[1].start},a=f.slice(i,n),a.unshift(r),f.splice(i,n-i+1,a))}}return le(e,0,Number.POSITIVE_INFINITY,f.slice(0)),!s}function _o(e,t){const n=e.get(t)[1],r=e.get(t)[2];let i=t-1;const o=[];let l=n._tokenizer;l||(l=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(l._contentTypeTextTrailing=!0));const a=l.events,u=[],s={};let f,c,p=-1,h=n,g=0,k=0;const S=[k];for(;h;){for(;e.get(++i)[1]!==h;);o.push(i),h._tokenizer||(f=r.sliceStream(h),h.next||f.push(null),c&&l.defineSkip(h.start),h._isInFirstContentOfListItem&&(l._gfmTasklistFirstContentOfListItem=!0),l.write(f),h._isInFirstContentOfListItem&&(l._gfmTasklistFirstContentOfListItem=void 0)),c=h,h=h.next}for(h=n;++p<a.length;)a[p][0]==="exit"&&a[p-1][0]==="enter"&&a[p][1].type===a[p-1][1].type&&a[p][1].start.line!==a[p][1].end.line&&(k=p+1,S.push(k),h._tokenizer=void 0,h.previous=void 0,h=h.next);for(l.events=[],h?(h._tokenizer=void 0,h.previous=void 0):S.pop(),p=S.length;p--;){const x=a.slice(S[p],S[p+1]),E=o.pop();u.push([E,E+x.length-1]),e.splice(E,2,x)}for(u.reverse(),p=-1;++p<u.length;)s[g+u[p][0]]=g+u[p][1],g+=u[p][1]-u[p][0]-1;return s}const jo={resolve:Bo,tokenize:$o},Oo={partial:!0,tokenize:Ho};function Bo(e){return _r(e),e}function $o(e,t){let n;return r;function r(a){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),i(a)}function i(a){return a===null?o(a):F(a)?e.check(Oo,l,o)(a):(e.consume(a),i)}function o(a){return e.exit("chunkContent"),e.exit("content"),t(a)}function l(a){return e.consume(a),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,i}}function Ho(e,t,n){const r=this;return i;function i(l){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),H(e,o,"linePrefix")}function o(l){if(l===null||F(l))return n(l);const a=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?t(l):e.interrupt(r.parser.constructs.flow,n,t)(l)}}function jr(e,t,n,r,i,o,l,a,u){const s=u||Number.POSITIVE_INFINITY;let f=0;return c;function c(x){return x===60?(e.enter(r),e.enter(i),e.enter(o),e.consume(x),e.exit(o),p):x===null||x===32||x===41||fn(x)?n(x):(e.enter(r),e.enter(l),e.enter(a),e.enter("chunkString",{contentType:"string"}),k(x))}function p(x){return x===62?(e.enter(o),e.consume(x),e.exit(o),e.exit(i),e.exit(r),t):(e.enter(a),e.enter("chunkString",{contentType:"string"}),h(x))}function h(x){return x===62?(e.exit("chunkString"),e.exit(a),p(x)):x===null||x===60||F(x)?n(x):(e.consume(x),x===92?g:h)}function g(x){return x===60||x===62||x===92?(e.consume(x),h):h(x)}function k(x){return!f&&(x===null||x===41||W(x))?(e.exit("chunkString"),e.exit(a),e.exit(l),e.exit(r),t(x)):f<s&&x===40?(e.consume(x),f++,k):x===41?(e.consume(x),f--,k):x===null||x===32||x===40||fn(x)?n(x):(e.consume(x),x===92?S:k)}function S(x){return x===40||x===41||x===92?(e.consume(x),k):k(x)}}function Or(e,t,n,r,i,o){const l=this;let a=0,u;return s;function s(h){return e.enter(r),e.enter(i),e.consume(h),e.exit(i),e.enter(o),f}function f(h){return a>999||h===null||h===91||h===93&&!u||h===94&&!a&&"_hiddenFootnoteSupport"in l.parser.constructs?n(h):h===93?(e.exit(o),e.enter(i),e.consume(h),e.exit(i),e.exit(r),t):F(h)?(e.enter("lineEnding"),e.consume(h),e.exit("lineEnding"),f):(e.enter("chunkString",{contentType:"string"}),c(h))}function c(h){return h===null||h===91||h===93||F(h)||a++>999?(e.exit("chunkString"),f(h)):(e.consume(h),u||(u=!B(h)),h===92?p:c)}function p(h){return h===91||h===92||h===93?(e.consume(h),a++,c):c(h)}}function Br(e,t,n,r,i,o){let l;return a;function a(p){return p===34||p===39||p===40?(e.enter(r),e.enter(i),e.consume(p),e.exit(i),l=p===40?41:p,u):n(p)}function u(p){return p===l?(e.enter(i),e.consume(p),e.exit(i),e.exit(r),t):(e.enter(o),s(p))}function s(p){return p===l?(e.exit(o),u(l)):p===null?n(p):F(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),H(e,s,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),f(p))}function f(p){return p===l||p===null||F(p)?(e.exit("chunkString"),s(p)):(e.consume(p),p===92?c:f)}function c(p){return p===l||p===92?(e.consume(p),f):f(p)}}function Ge(e,t){let n;return r;function r(i){return F(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n=!0,r):B(i)?H(e,r,n?"linePrefix":"lineSuffix")(i):t(i)}}const Uo={name:"definition",tokenize:qo},Vo={partial:!0,tokenize:Wo};function qo(e,t,n){const r=this;let i;return o;function o(h){return e.enter("definition"),l(h)}function l(h){return Or.call(r,e,a,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(h)}function a(h){return i=fe(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),h===58?(e.enter("definitionMarker"),e.consume(h),e.exit("definitionMarker"),u):n(h)}function u(h){return W(h)?Ge(e,s)(h):s(h)}function s(h){return jr(e,f,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(h)}function f(h){return e.attempt(Vo,c,c)(h)}function c(h){return B(h)?H(e,p,"whitespace")(h):p(h)}function p(h){return h===null||F(h)?(e.exit("definition"),r.parser.defined.push(i),t(h)):n(h)}}function Wo(e,t,n){return r;function r(a){return W(a)?Ge(e,i)(a):n(a)}function i(a){return Br(e,o,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(a)}function o(a){return B(a)?H(e,l,"whitespace")(a):l(a)}function l(a){return a===null||F(a)?t(a):n(a)}}const Go={name:"hardBreakEscape",tokenize:Xo};function Xo(e,t,n){return r;function r(o){return e.enter("hardBreakEscape"),e.consume(o),i}function i(o){return F(o)?(e.exit("hardBreakEscape"),t(o)):n(o)}}const Yo={name:"headingAtx",resolve:Qo,tokenize:Ko};function Qo(e,t){let n=e.length-2,r=3,i,o;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},o={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},le(e,r,n-r+1,[["enter",i,t],["enter",o,t],["exit",o,t],["exit",i,t]])),e}function Ko(e,t,n){let r=0;return i;function i(f){return e.enter("atxHeading"),o(f)}function o(f){return e.enter("atxHeadingSequence"),l(f)}function l(f){return f===35&&r++<6?(e.consume(f),l):f===null||W(f)?(e.exit("atxHeadingSequence"),a(f)):n(f)}function a(f){return f===35?(e.enter("atxHeadingSequence"),u(f)):f===null||F(f)?(e.exit("atxHeading"),t(f)):B(f)?H(e,a,"whitespace")(f):(e.enter("atxHeadingText"),s(f))}function u(f){return f===35?(e.consume(f),u):(e.exit("atxHeadingSequence"),a(f))}function s(f){return f===null||f===35||W(f)?(e.exit("atxHeadingText"),a(f)):(e.consume(f),s)}}const Jo=["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"],qt=["pre","script","style","textarea"],Zo={concrete:!0,name:"htmlFlow",resolveTo:ta,tokenize:ra},ea={partial:!0,tokenize:la},na={partial:!0,tokenize:ia};function ta(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 ra(e,t,n){const r=this;let i,o,l,a,u;return s;function s(d){return f(d)}function f(d){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(d),c}function c(d){return d===33?(e.consume(d),p):d===47?(e.consume(d),o=!0,k):d===63?(e.consume(d),i=3,r.interrupt?t:m):ee(d)?(e.consume(d),l=String.fromCharCode(d),S):n(d)}function p(d){return d===45?(e.consume(d),i=2,h):d===91?(e.consume(d),i=5,a=0,g):ee(d)?(e.consume(d),i=4,r.interrupt?t:m):n(d)}function h(d){return d===45?(e.consume(d),r.interrupt?t:m):n(d)}function g(d){const ue="CDATA[";return d===ue.charCodeAt(a++)?(e.consume(d),a===ue.length?r.interrupt?t:z:g):n(d)}function k(d){return ee(d)?(e.consume(d),l=String.fromCharCode(d),S):n(d)}function S(d){if(d===null||d===47||d===62||W(d)){const ue=d===47,Se=l.toLowerCase();return!ue&&!o&&qt.includes(Se)?(i=1,r.interrupt?t(d):z(d)):Jo.includes(l.toLowerCase())?(i=6,ue?(e.consume(d),x):r.interrupt?t(d):z(d)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(d):o?E(d):v(d))}return d===45||J(d)?(e.consume(d),l+=String.fromCharCode(d),S):n(d)}function x(d){return d===62?(e.consume(d),r.interrupt?t:z):n(d)}function E(d){return B(d)?(e.consume(d),E):y(d)}function v(d){return d===47?(e.consume(d),y):d===58||d===95||ee(d)?(e.consume(d),R):B(d)?(e.consume(d),v):y(d)}function R(d){return d===45||d===46||d===58||d===95||J(d)?(e.consume(d),R):T(d)}function T(d){return d===61?(e.consume(d),b):B(d)?(e.consume(d),T):v(d)}function b(d){return d===null||d===60||d===61||d===62||d===96?n(d):d===34||d===39?(e.consume(d),u=d,L):B(d)?(e.consume(d),b):_(d)}function L(d){return d===u?(e.consume(d),u=null,M):d===null||F(d)?n(d):(e.consume(d),L)}function _(d){return d===null||d===34||d===39||d===47||d===60||d===61||d===62||d===96||W(d)?T(d):(e.consume(d),_)}function M(d){return d===47||d===62||B(d)?v(d):n(d)}function y(d){return d===62?(e.consume(d),P):n(d)}function P(d){return d===null||F(d)?z(d):B(d)?(e.consume(d),P):n(d)}function z(d){return d===45&&i===2?(e.consume(d),V):d===60&&i===1?(e.consume(d),Q):d===62&&i===4?(e.consume(d),se):d===63&&i===3?(e.consume(d),m):d===93&&i===5?(e.consume(d),me):F(d)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(ea,de,U)(d)):d===null||F(d)?(e.exit("htmlFlowData"),U(d)):(e.consume(d),z)}function U(d){return e.check(na,N,de)(d)}function N(d){return e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),D}function D(d){return d===null||F(d)?U(d):(e.enter("htmlFlowData"),z(d))}function V(d){return d===45?(e.consume(d),m):z(d)}function Q(d){return d===47?(e.consume(d),l="",ae):z(d)}function ae(d){if(d===62){const ue=l.toLowerCase();return qt.includes(ue)?(e.consume(d),se):z(d)}return ee(d)&&l.length<8?(e.consume(d),l+=String.fromCharCode(d),ae):z(d)}function me(d){return d===93?(e.consume(d),m):z(d)}function m(d){return d===62?(e.consume(d),se):d===45&&i===2?(e.consume(d),m):z(d)}function se(d){return d===null||F(d)?(e.exit("htmlFlowData"),de(d)):(e.consume(d),se)}function de(d){return e.exit("htmlFlow"),t(d)}}function ia(e,t,n){const r=this;return i;function i(l){return F(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),o):n(l)}function o(l){return r.parser.lazy[r.now().line]?n(l):t(l)}}function la(e,t,n){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(Ze,t,n)}}const oa={name:"htmlText",tokenize:aa};function aa(e,t,n){const r=this;let i,o,l;return a;function a(m){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(m),u}function u(m){return m===33?(e.consume(m),s):m===47?(e.consume(m),T):m===63?(e.consume(m),v):ee(m)?(e.consume(m),_):n(m)}function s(m){return m===45?(e.consume(m),f):m===91?(e.consume(m),o=0,g):ee(m)?(e.consume(m),E):n(m)}function f(m){return m===45?(e.consume(m),h):n(m)}function c(m){return m===null?n(m):m===45?(e.consume(m),p):F(m)?(l=c,Q(m)):(e.consume(m),c)}function p(m){return m===45?(e.consume(m),h):c(m)}function h(m){return m===62?V(m):m===45?p(m):c(m)}function g(m){const se="CDATA[";return m===se.charCodeAt(o++)?(e.consume(m),o===se.length?k:g):n(m)}function k(m){return m===null?n(m):m===93?(e.consume(m),S):F(m)?(l=k,Q(m)):(e.consume(m),k)}function S(m){return m===93?(e.consume(m),x):k(m)}function x(m){return m===62?V(m):m===93?(e.consume(m),x):k(m)}function E(m){return m===null||m===62?V(m):F(m)?(l=E,Q(m)):(e.consume(m),E)}function v(m){return m===null?n(m):m===63?(e.consume(m),R):F(m)?(l=v,Q(m)):(e.consume(m),v)}function R(m){return m===62?V(m):v(m)}function T(m){return ee(m)?(e.consume(m),b):n(m)}function b(m){return m===45||J(m)?(e.consume(m),b):L(m)}function L(m){return F(m)?(l=L,Q(m)):B(m)?(e.consume(m),L):V(m)}function _(m){return m===45||J(m)?(e.consume(m),_):m===47||m===62||W(m)?M(m):n(m)}function M(m){return m===47?(e.consume(m),V):m===58||m===95||ee(m)?(e.consume(m),y):F(m)?(l=M,Q(m)):B(m)?(e.consume(m),M):V(m)}function y(m){return m===45||m===46||m===58||m===95||J(m)?(e.consume(m),y):P(m)}function P(m){return m===61?(e.consume(m),z):F(m)?(l=P,Q(m)):B(m)?(e.consume(m),P):M(m)}function z(m){return m===null||m===60||m===61||m===62||m===96?n(m):m===34||m===39?(e.consume(m),i=m,U):F(m)?(l=z,Q(m)):B(m)?(e.consume(m),z):(e.consume(m),N)}function U(m){return m===i?(e.consume(m),i=void 0,D):m===null?n(m):F(m)?(l=U,Q(m)):(e.consume(m),U)}function N(m){return m===null||m===34||m===39||m===60||m===61||m===96?n(m):m===47||m===62||W(m)?M(m):(e.consume(m),N)}function D(m){return m===47||m===62||W(m)?M(m):n(m)}function V(m){return m===62?(e.consume(m),e.exit("htmlTextData"),e.exit("htmlText"),t):n(m)}function Q(m){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(m),e.exit("lineEnding"),ae}function ae(m){return B(m)?H(e,me,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(m):me(m)}function me(m){return e.enter("htmlTextData"),l(m)}}const it={name:"labelEnd",resolveAll:fa,resolveTo:ha,tokenize:pa},sa={tokenize:ma},ua={tokenize:da},ca={tokenize:ga};function fa(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&&le(e,0,e.length,n),e}function ha(e,t){let n=e.length,r=0,i,o,l,a;for(;n--;)if(i=e[n][1],o){if(i.type==="link"||i.type==="labelLink"&&i._inactive)break;e[n][0]==="enter"&&i.type==="labelLink"&&(i._inactive=!0)}else if(l){if(e[n][0]==="enter"&&(i.type==="labelImage"||i.type==="labelLink")&&!i._balanced&&(o=n,i.type!=="labelLink")){r=2;break}}else i.type==="labelEnd"&&(l=n);const u={type:e[o][1].type==="labelLink"?"link":"image",start:{...e[o][1].start},end:{...e[e.length-1][1].end}},s={type:"label",start:{...e[o][1].start},end:{...e[l][1].end}},f={type:"labelText",start:{...e[o+r+2][1].end},end:{...e[l-2][1].start}};return a=[["enter",u,t],["enter",s,t]],a=oe(a,e.slice(o+1,o+r+3)),a=oe(a,[["enter",f,t]]),a=oe(a,gn(t.parser.constructs.insideSpan.null,e.slice(o+r+4,l-3),t)),a=oe(a,[["exit",f,t],e[l-2],e[l-1],["exit",s,t]]),a=oe(a,e.slice(l+1)),a=oe(a,[["exit",u,t]]),le(e,o,e.length,a),e}function pa(e,t,n){const r=this;let i=r.events.length,o,l;for(;i--;)if((r.events[i][1].type==="labelImage"||r.events[i][1].type==="labelLink")&&!r.events[i][1]._balanced){o=r.events[i][1];break}return a;function a(p){return o?o._inactive?c(p):(l=r.parser.defined.includes(fe(r.sliceSerialize({start:o.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(p),e.exit("labelMarker"),e.exit("labelEnd"),u):n(p)}function u(p){return p===40?e.attempt(sa,f,l?f:c)(p):p===91?e.attempt(ua,f,l?s:c)(p):l?f(p):c(p)}function s(p){return e.attempt(ca,f,c)(p)}function f(p){return t(p)}function c(p){return o._balanced=!0,n(p)}}function ma(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 W(c)?Ge(e,o)(c):o(c)}function o(c){return c===41?f(c):jr(e,l,a,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(c)}function l(c){return W(c)?Ge(e,u)(c):f(c)}function a(c){return n(c)}function u(c){return c===34||c===39||c===40?Br(e,s,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(c):f(c)}function s(c){return W(c)?Ge(e,f)(c):f(c)}function f(c){return c===41?(e.enter("resourceMarker"),e.consume(c),e.exit("resourceMarker"),e.exit("resource"),t):n(c)}}function da(e,t,n){const r=this;return i;function i(a){return Or.call(r,e,o,l,"reference","referenceMarker","referenceString")(a)}function o(a){return r.parser.defined.includes(fe(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(a):n(a)}function l(a){return n(a)}}function ga(e,t,n){return r;function r(o){return e.enter("reference"),e.enter("referenceMarker"),e.consume(o),e.exit("referenceMarker"),i}function i(o){return o===93?(e.enter("referenceMarker"),e.consume(o),e.exit("referenceMarker"),e.exit("reference"),t):n(o)}}const xa={name:"labelStartImage",resolveAll:it.resolveAll,tokenize:ya};function ya(e,t,n){const r=this;return i;function i(a){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(a),e.exit("labelImageMarker"),o}function o(a){return a===91?(e.enter("labelMarker"),e.consume(a),e.exit("labelMarker"),e.exit("labelImage"),l):n(a)}function l(a){return a===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(a):t(a)}}const ka={name:"labelStartLink",resolveAll:it.resolveAll,tokenize:ba};function ba(e,t,n){const r=this;return i;function i(l){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(l),e.exit("labelMarker"),e.exit("labelLink"),o}function o(l){return l===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(l):t(l)}}const En={name:"lineEnding",tokenize:wa};function wa(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),H(e,t,"linePrefix")}}const sn={name:"thematicBreak",tokenize:Sa};function Sa(e,t,n){let r=0,i;return o;function o(s){return e.enter("thematicBreak"),l(s)}function l(s){return i=s,a(s)}function a(s){return s===i?(e.enter("thematicBreakSequence"),u(s)):r>=3&&(s===null||F(s))?(e.exit("thematicBreak"),t(s)):n(s)}function u(s){return s===i?(e.consume(s),r++,u):(e.exit("thematicBreakSequence"),B(s)?H(e,a,"whitespace")(s):a(s))}}const ne={continuation:{tokenize:Ia},exit:Ta,name:"list",tokenize:Ea},Ca={partial:!0,tokenize:Pa},va={partial:!0,tokenize:Aa};function Ea(e,t,n){const r=this,i=r.events[r.events.length-1];let o=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,l=0;return a;function a(h){const g=r.containerState.type||(h===42||h===43||h===45?"listUnordered":"listOrdered");if(g==="listUnordered"?!r.containerState.marker||h===r.containerState.marker:Hn(h)){if(r.containerState.type||(r.containerState.type=g,e.enter(g,{_container:!0})),g==="listUnordered")return e.enter("listItemPrefix"),h===42||h===45?e.check(sn,n,s)(h):s(h);if(!r.interrupt||h===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),u(h)}return n(h)}function u(h){return Hn(h)&&++l<10?(e.consume(h),u):(!r.interrupt||l<2)&&(r.containerState.marker?h===r.containerState.marker:h===41||h===46)?(e.exit("listItemValue"),s(h)):n(h)}function s(h){return e.enter("listItemMarker"),e.consume(h),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||h,e.check(Ze,r.interrupt?n:f,e.attempt(Ca,p,c))}function f(h){return r.containerState.initialBlankLine=!0,o++,p(h)}function c(h){return B(h)?(e.enter("listItemPrefixWhitespace"),e.consume(h),e.exit("listItemPrefixWhitespace"),p):n(h)}function p(h){return r.containerState.size=o+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(h)}}function Ia(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(Ze,i,o);function i(a){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,H(e,t,"listItemIndent",r.containerState.size+1)(a)}function o(a){return r.containerState.furtherBlankLines||!B(a)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,l(a)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(va,t,l)(a))}function l(a){return r.containerState._closeFlow=!0,r.interrupt=void 0,H(e,e.attempt(ne,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a)}}function Aa(e,t,n){const r=this;return H(e,i,"listItemIndent",r.containerState.size+1);function i(o){const l=r.events[r.events.length-1];return l&&l[1].type==="listItemIndent"&&l[2].sliceSerialize(l[1],!0).length===r.containerState.size?t(o):n(o)}}function Ta(e){e.exit(this.containerState.type)}function Pa(e,t,n){const r=this;return H(e,i,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(o){const l=r.events[r.events.length-1];return!B(o)&&l&&l[1].type==="listItemPrefixWhitespace"?t(o):n(o)}}const Wt={name:"setextUnderline",resolveTo:Da,tokenize:za};function Da(e,t){let n=e.length,r,i,o;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),!o&&e[n][1].type==="definition"&&(o=n);const l={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type="setextHeadingText",o?(e.splice(i,0,["enter",l,t]),e.splice(o+1,0,["exit",e[r][1],t]),e[r][1].end={...e[o][1].end}):e[r][1]=l,e.push(["exit",l,t]),e}function za(e,t,n){const r=this;let i;return o;function o(s){let f=r.events.length,c;for(;f--;)if(r.events[f][1].type!=="lineEnding"&&r.events[f][1].type!=="linePrefix"&&r.events[f][1].type!=="content"){c=r.events[f][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||c)?(e.enter("setextHeadingLine"),i=s,l(s)):n(s)}function l(s){return e.enter("setextHeadingLineSequence"),a(s)}function a(s){return s===i?(e.consume(s),a):(e.exit("setextHeadingLineSequence"),B(s)?H(e,u,"lineSuffix")(s):u(s))}function u(s){return s===null||F(s)?(e.exit("setextHeadingLine"),t(s)):n(s)}}const La={tokenize:Ma};function Ma(e){const t=this,n=e.attempt(Ze,r,e.attempt(this.parser.constructs.flowInitial,i,H(e,e.attempt(this.parser.constructs.flow,i,e.attempt(jo,i)),"linePrefix")));return n;function r(o){if(o===null){e.consume(o);return}return e.enter("lineEndingBlank"),e.consume(o),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function i(o){if(o===null){e.consume(o);return}return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const Fa={resolveAll:Hr()},Na=$r("string"),Ra=$r("text");function $r(e){return{resolveAll:Hr(e==="text"?_a:void 0),tokenize:t};function t(n){const r=this,i=this.parser.constructs[e],o=n.attempt(i,l,a);return l;function l(f){return s(f)?o(f):a(f)}function a(f){if(f===null){n.consume(f);return}return n.enter("data"),n.consume(f),u}function u(f){return s(f)?(n.exit("data"),o(f)):(n.consume(f),u)}function s(f){if(f===null)return!0;const c=i[f];let p=-1;if(c)for(;++p<c.length;){const h=c[p];if(!h.previous||h.previous.call(r,r.previous))return!0}return!1}}}function Hr(e){return t;function t(n,r){let i=-1,o;for(;++i<=n.length;)o===void 0?n[i]&&n[i][1].type==="data"&&(o=i,i++):(!n[i]||n[i][1].type!=="data")&&(i!==o+2&&(n[o][1].end=n[i-1][1].end,n.splice(o+2,i-o-2),i=o+2),o=void 0);return e?e(n,r):n}}function _a(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 o=i.length,l=-1,a=0,u;for(;o--;){const s=i[o];if(typeof s=="string"){for(l=s.length;s.charCodeAt(l-1)===32;)a++,l--;if(l)break;l=-1}else if(s===-2)u=!0,a++;else if(s!==-1){o++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(a=0),a){const s={type:n===e.length||u||a<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:o?l:r.start._bufferIndex+l,_index:r.start._index+o,line:r.end.line,column:r.end.column-a,offset:r.end.offset-a},end:{...r.end}};r.end={...s.start},r.start.offset===r.end.offset?Object.assign(r,s):(e.splice(n,0,["enter",s,t],["exit",s,t]),n+=2)}n++}return e}const ja={42:ne,43:ne,45:ne,48:ne,49:ne,50:ne,51:ne,52:ne,53:ne,54:ne,55:ne,56:ne,57:ne,62:Fr},Oa={91:Uo},Ba={[-2]:vn,[-1]:vn,32:vn},$a={35:Yo,42:sn,45:[Wt,sn],60:Zo,61:Wt,95:sn,96:Vt,126:Vt},Ha={38:Rr,92:Nr},Ua={[-5]:En,[-4]:En,[-3]:En,33:xa,38:Rr,42:Un,60:[ko,oa],91:ka,92:[Go,Nr],93:it,95:Un,96:Lo},Va={null:[Un,Fa]},qa={null:[42,95]},Wa={null:[]},Ga=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:qa,contentInitial:Oa,disable:Wa,document:ja,flow:$a,flowInitial:Ba,insideSpan:Va,string:Ha,text:Ua},Symbol.toStringTag,{value:"Module"}));function Xa(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={},o=[];let l=[],a=[];const u={attempt:L(T),check:L(b),consume:E,enter:v,exit:R,interrupt:L(b,{interrupt:!0})},s={code:null,containerState:{},defineSkip:k,events:[],now:g,parser:e,previous:null,sliceSerialize:p,sliceStream:h,write:c};let f=t.tokenize.call(s,u);return t.resolveAll&&o.push(t),s;function c(P){return l=oe(l,P),S(),l[l.length-1]!==null?[]:(_(t,0),s.events=gn(o,s.events,s),s.events)}function p(P,z){return Qa(h(P),z)}function h(P){return Ya(l,P)}function g(){const{_bufferIndex:P,_index:z,line:U,column:N,offset:D}=r;return{_bufferIndex:P,_index:z,line:U,column:N,offset:D}}function k(P){i[P.line]=P.column,y()}function S(){let P;for(;r._index<l.length;){const z=l[r._index];if(typeof z=="string")for(P=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===P&&r._bufferIndex<z.length;)x(z.charCodeAt(r._bufferIndex));else x(z)}}function x(P){f=f(P)}function E(P){F(P)?(r.line++,r.column=1,r.offset+=P===-3?2:1,y()):P!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===l[r._index].length&&(r._bufferIndex=-1,r._index++)),s.previous=P}function v(P,z){const U=z||{};return U.type=P,U.start=g(),s.events.push(["enter",U,s]),a.push(U),U}function R(P){const z=a.pop();return z.end=g(),s.events.push(["exit",z,s]),z}function T(P,z){_(P,z.from)}function b(P,z){z.restore()}function L(P,z){return U;function U(N,D,V){let Q,ae,me,m;return Array.isArray(N)?de(N):"tokenize"in N?de([N]):se(N);function se(K){return Oe;function Oe(ke){const Te=ke!==null&&K[ke],Pe=ke!==null&&K.null,nn=[...Array.isArray(Te)?Te:Te?[Te]:[],...Array.isArray(Pe)?Pe:Pe?[Pe]:[]];return de(nn)(ke)}}function de(K){return Q=K,ae=0,K.length===0?V:d(K[ae])}function d(K){return Oe;function Oe(ke){return m=M(),me=K,K.partial||(s.currentConstruct=K),K.name&&s.parser.constructs.disable.null.includes(K.name)?Se():K.tokenize.call(z?Object.assign(Object.create(s),z):s,u,ue,Se)(ke)}}function ue(K){return P(me,m),D}function Se(K){return m.restore(),++ae<Q.length?d(Q[ae]):V}}}function _(P,z){P.resolveAll&&!o.includes(P)&&o.push(P),P.resolve&&le(s.events,z,s.events.length-z,P.resolve(s.events.slice(z),s)),P.resolveTo&&(s.events=P.resolveTo(s.events,s))}function M(){const P=g(),z=s.previous,U=s.currentConstruct,N=s.events.length,D=Array.from(a);return{from:N,restore:V};function V(){r=P,s.previous=z,s.currentConstruct=U,s.events.length=N,a=D,y()}}function y(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function Ya(e,t){const n=t.start._index,r=t.start._bufferIndex,i=t.end._index,o=t.end._bufferIndex;let l;if(n===i)l=[e[n].slice(r,o)];else{if(l=e.slice(n,i),r>-1){const a=l[0];typeof a=="string"?l[0]=a.slice(r):l.shift()}o>0&&l.push(e[i].slice(0,o))}return l}function Qa(e,t){let n=-1;const r=[];let i;for(;++n<e.length;){const o=e[n];let l;if(typeof o=="string")l=o;else switch(o){case-5:{l="\r";break}case-4:{l=`
4
4
  `;break}case-3:{l=`\r
5
5
  `;break}case-2:{l=t?" ":" ";break}case-1:{if(!t&&i)continue;l=" ";break}default:l=String.fromCharCode(o)}i=o===-2,r.push(l)}return r.join("")}function Ka(e){const r={constructs:Lr([Ga,...(e||{}).extensions||[]]),content:i(fo),defined:[],document:i(po),flow:i(La),lazy:{},string:i(Na),text:i(Ra)};return r;function i(o){return l;function l(a){return Xa(r,o,a)}}}function Ja(e){for(;!_r(e););return e}const Gt=/[\0\t\n\r]/g;function Za(){let e=1,t="",n=!0,r;return i;function i(o,l,a){const u=[];let s,f,c,p,h;for(o=t+(typeof o=="string"?o.toString():new TextDecoder(l||void 0).decode(o)),c=0,t="",n&&(o.charCodeAt(0)===65279&&c++,n=void 0);c<o.length;){if(Gt.lastIndex=c,s=Gt.exec(o),p=s&&s.index!==void 0?s.index:o.length,h=o.charCodeAt(p),!s){t=o.slice(c);break}if(h===10&&c===p&&r)u.push(-3),r=void 0;else switch(r&&(u.push(-5),r=void 0),c<p&&(u.push(o.slice(c,p)),e+=p-c),h){case 0:{u.push(65533),e++;break}case 9:{for(f=Math.ceil(e/4)*4,u.push(-2);e++<f;)u.push(-1);break}case 10:{u.push(-4),e=1;break}default:r=!0,e=1}c=p+1}return a&&(r&&u.push(-5),t&&u.push(t),u.push(null)),u}}const es=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function ns(e){return e.replace(es,ts)}function ts(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const i=n.charCodeAt(1),o=i===120||i===88;return Mr(n.slice(o?2:1),o?16:10)}return rt(n)||e}const Ur={}.hasOwnProperty;function rs(e,t,n){return t&&typeof t=="object"&&(n=t,t=void 0),is(n)(Ja(Ka(n).document().write(Za()(e,t,!0))))}function is(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:o(xt),autolinkProtocol:M,autolinkEmail:M,atxHeading:o(mt),blockQuote:o(Pe),characterEscape:M,characterReference:M,codeFenced:o(nn),codeFencedFenceInfo:l,codeFencedFenceMeta:l,codeIndented:o(nn,l),codeText:o(Si,l),codeTextData:M,data:M,codeFlowValue:M,definition:o(Ci),definitionDestinationString:l,definitionLabelString:l,definitionTitleString:l,emphasis:o(vi),hardBreakEscape:o(dt),hardBreakTrailing:o(dt),htmlFlow:o(gt,l),htmlFlowData:M,htmlText:o(gt,l),htmlTextData:M,image:o(Ei),label:l,link:o(xt),listItem:o(Ii),listItemValue:p,listOrdered:o(yt,c),listUnordered:o(yt),paragraph:o(Ai),reference:d,referenceString:l,resourceDestinationString:l,resourceTitleString:l,setextHeading:o(mt),strong:o(Ti),thematicBreak:o(Di)},exit:{atxHeading:u(),atxHeadingSequence:T,autolink:u(),autolinkEmail:Te,autolinkProtocol:ke,blockQuote:u(),characterEscapeValue:y,characterReferenceMarkerHexadecimal:Se,characterReferenceMarkerNumeric:Se,characterReferenceValue:K,characterReference:Oe,codeFenced:u(S),codeFencedFence:k,codeFencedFenceInfo:h,codeFencedFenceMeta:g,codeFlowValue:y,codeIndented:u(x),codeText:u(D),codeTextData:y,data:y,definition:u(),definitionDestinationString:R,definitionLabelString:E,definitionTitleString:v,emphasis:u(),hardBreakEscape:u(z),hardBreakTrailing:u(z),htmlFlow:u(U),htmlFlowData:y,htmlText:u(N),htmlTextData:y,image:u(Q),label:me,labelText:ae,lineEnding:P,link:u(V),listItem:u(),listOrdered:u(),listUnordered:u(),paragraph:u(),referenceString:ue,resourceDestinationString:m,resourceTitleString:se,resource:de,setextHeading:u(_),setextHeadingLineSequence:L,setextHeadingText:b,strong:u(),thematicBreak:u()}};Vr(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(w){let A={type:"root",children:[]};const j={stack:[A],tokenStack:[],config:t,enter:a,exit:s,buffer:l,resume:f,data:n},$=[];let q=-1;for(;++q<w.length;)if(w[q][1].type==="listOrdered"||w[q][1].type==="listUnordered")if(w[q][0]==="enter")$.push(q);else{const ce=$.pop();q=i(w,ce,q)}for(q=-1;++q<w.length;){const ce=t[w[q][0]];Ur.call(ce,w[q][1].type)&&ce[w[q][1].type].call(Object.assign({sliceSerialize:w[q][2].sliceSerialize},j),w[q][1])}if(j.tokenStack.length>0){const ce=j.tokenStack[j.tokenStack.length-1];(ce[1]||Xt).call(j,void 0,ce[0])}for(A.position={start:be(w.length>0?w[0][1].start:{line:1,column:1,offset:0}),end:be(w.length>0?w[w.length-2][1].end:{line:1,column:1,offset:0})},q=-1;++q<t.transforms.length;)A=t.transforms[q](A)||A;return A}function i(w,A,j){let $=A-1,q=-1,ce=!1,Ce,ge,Be,$e;for(;++$<=j;){const re=w[$];switch(re[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{re[0]==="enter"?q++:q--,$e=void 0;break}case"lineEndingBlank":{re[0]==="enter"&&(Ce&&!$e&&!q&&!Be&&(Be=$),$e=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:$e=void 0}if(!q&&re[0]==="enter"&&re[1].type==="listItemPrefix"||q===-1&&re[0]==="exit"&&(re[1].type==="listUnordered"||re[1].type==="listOrdered")){if(Ce){let De=$;for(ge=void 0;De--;){const xe=w[De];if(xe[1].type==="lineEnding"||xe[1].type==="lineEndingBlank"){if(xe[0]==="exit")continue;ge&&(w[ge][1].type="lineEndingBlank",ce=!0),xe[1].type="lineEnding",ge=De}else if(!(xe[1].type==="linePrefix"||xe[1].type==="blockQuotePrefix"||xe[1].type==="blockQuotePrefixWhitespace"||xe[1].type==="blockQuoteMarker"||xe[1].type==="listItemIndent"))break}Be&&(!ge||Be<ge)&&(Ce._spread=!0),Ce.end=Object.assign({},ge?w[ge][1].start:re[1].end),w.splice(ge||$,0,["exit",Ce,re[2]]),$++,j++}if(re[1].type==="listItemPrefix"){const De={type:"listItem",_spread:!1,start:Object.assign({},re[1].start),end:void 0};Ce=De,w.splice($,0,["enter",De,re[2]]),$++,j++,Be=void 0,$e=!0}}}return w[A][1]._spread=ce,j}function o(w,A){return j;function j($){a.call(this,w($),$),A&&A.call(this,$)}}function l(){this.stack.push({type:"fragment",children:[]})}function a(w,A,j){this.stack[this.stack.length-1].children.push(w),this.stack.push(w),this.tokenStack.push([A,j||void 0]),w.position={start:be(A.start),end:void 0}}function u(w){return A;function A(j){w&&w.call(this,j),s.call(this,j)}}function s(w,A){const j=this.stack.pop(),$=this.tokenStack.pop();if($)$[0].type!==w.type&&(A?A.call(this,w,$[0]):($[1]||Xt).call(this,w,$[0]));else throw new Error("Cannot close `"+w.type+"` ("+We({start:w.start,end:w.end})+"): it’s not open");j.position.end=be(w.end)}function f(){return tt(this.stack.pop())}function c(){this.data.expectingFirstListItemValue=!0}function p(w){if(this.data.expectingFirstListItemValue){const A=this.stack[this.stack.length-2];A.start=Number.parseInt(this.sliceSerialize(w),10),this.data.expectingFirstListItemValue=void 0}}function h(){const w=this.resume(),A=this.stack[this.stack.length-1];A.lang=w}function g(){const w=this.resume(),A=this.stack[this.stack.length-1];A.meta=w}function k(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function S(){const w=this.resume(),A=this.stack[this.stack.length-1];A.value=w.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function x(){const w=this.resume(),A=this.stack[this.stack.length-1];A.value=w.replace(/(\r?\n|\r)$/g,"")}function E(w){const A=this.resume(),j=this.stack[this.stack.length-1];j.label=A,j.identifier=fe(this.sliceSerialize(w)).toLowerCase()}function v(){const w=this.resume(),A=this.stack[this.stack.length-1];A.title=w}function R(){const w=this.resume(),A=this.stack[this.stack.length-1];A.url=w}function T(w){const A=this.stack[this.stack.length-1];if(!A.depth){const j=this.sliceSerialize(w).length;A.depth=j}}function b(){this.data.setextHeadingSlurpLineEnding=!0}function L(w){const A=this.stack[this.stack.length-1];A.depth=this.sliceSerialize(w).codePointAt(0)===61?1:2}function _(){this.data.setextHeadingSlurpLineEnding=void 0}function M(w){const j=this.stack[this.stack.length-1].children;let $=j[j.length-1];(!$||$.type!=="text")&&($=Pi(),$.position={start:be(w.start),end:void 0},j.push($)),this.stack.push($)}function y(w){const A=this.stack.pop();A.value+=this.sliceSerialize(w),A.position.end=be(w.end)}function P(w){const A=this.stack[this.stack.length-1];if(this.data.atHardBreak){const j=A.children[A.children.length-1];j.position.end=be(w.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(A.type)&&(M.call(this,w),y.call(this,w))}function z(){this.data.atHardBreak=!0}function U(){const w=this.resume(),A=this.stack[this.stack.length-1];A.value=w}function N(){const w=this.resume(),A=this.stack[this.stack.length-1];A.value=w}function D(){const w=this.resume(),A=this.stack[this.stack.length-1];A.value=w}function V(){const w=this.stack[this.stack.length-1];if(this.data.inReference){const A=this.data.referenceType||"shortcut";w.type+="Reference",w.referenceType=A,delete w.url,delete w.title}else delete w.identifier,delete w.label;this.data.referenceType=void 0}function Q(){const w=this.stack[this.stack.length-1];if(this.data.inReference){const A=this.data.referenceType||"shortcut";w.type+="Reference",w.referenceType=A,delete w.url,delete w.title}else delete w.identifier,delete w.label;this.data.referenceType=void 0}function ae(w){const A=this.sliceSerialize(w),j=this.stack[this.stack.length-2];j.label=ns(A),j.identifier=fe(A).toLowerCase()}function me(){const w=this.stack[this.stack.length-1],A=this.resume(),j=this.stack[this.stack.length-1];if(this.data.inReference=!0,j.type==="link"){const $=w.children;j.children=$}else j.alt=A}function m(){const w=this.resume(),A=this.stack[this.stack.length-1];A.url=w}function se(){const w=this.resume(),A=this.stack[this.stack.length-1];A.title=w}function de(){this.data.inReference=void 0}function d(){this.data.referenceType="collapsed"}function ue(w){const A=this.resume(),j=this.stack[this.stack.length-1];j.label=A,j.identifier=fe(this.sliceSerialize(w)).toLowerCase(),this.data.referenceType="full"}function Se(w){this.data.characterReferenceType=w.type}function K(w){const A=this.sliceSerialize(w),j=this.data.characterReferenceType;let $;j?($=Mr(A,j==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):$=rt(A);const q=this.stack[this.stack.length-1];q.value+=$}function Oe(w){const A=this.stack.pop();A.position.end=be(w.end)}function ke(w){y.call(this,w);const A=this.stack[this.stack.length-1];A.url=this.sliceSerialize(w)}function Te(w){y.call(this,w);const A=this.stack[this.stack.length-1];A.url="mailto:"+this.sliceSerialize(w)}function Pe(){return{type:"blockquote",children:[]}}function nn(){return{type:"code",lang:null,meta:null,value:""}}function Si(){return{type:"inlineCode",value:""}}function Ci(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function vi(){return{type:"emphasis",children:[]}}function mt(){return{type:"heading",depth:0,children:[]}}function dt(){return{type:"break"}}function gt(){return{type:"html",value:""}}function Ei(){return{type:"image",title:null,url:"",alt:null}}function xt(){return{type:"link",title:null,url:"",children:[]}}function yt(w){return{type:"list",ordered:w.type==="listOrdered",start:null,spread:w._spread,children:[]}}function Ii(w){return{type:"listItem",spread:w._spread,checked:null,children:[]}}function Ai(){return{type:"paragraph",children:[]}}function Ti(){return{type:"strong",children:[]}}function Pi(){return{type:"text",value:""}}function Di(){return{type:"thematicBreak"}}}function be(e){return{line:e.line,column:e.column,offset:e.offset}}function Vr(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?Vr(e,r):ls(e,r)}}function ls(e,t){let n;for(n in t)if(Ur.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 Xt(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+We({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+We({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+We({start:t.start,end:t.end})+") is still open")}function os(e){const t=this;t.parser=n;function n(r){return rs(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function as(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 ss(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
@@ -1 +1 @@
1
- import{c as k,u as R,a as E,D as K,b as O,r as d,j as e,d as B,e as $,f as y,g as q,h as V,B as u,i as U,k as H,l as W,m as L,n as _,o as X,p as f,q as G,s as P,t as J,v as z,w as Q,x as Y,y as Z,z as ee}from"./main-B2sRcuyZ.js";import{C as te,F as C,a as A,I as b,b as S,c as D,d as F,e as M,f as I}from"./card-BUP-xovx.js";import{L as N}from"./loader-circle-DbOtKfCA.js";const se=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],ae=k("circle-check",se);const ne=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]],T=k("circle-x",ne);const oe=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]],ie=k("external-link",oe);const re=[["path",{d:"M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z",key:"1s6t7t"}],["circle",{cx:"16.5",cy:"7.5",r:".5",fill:"currentColor",key:"w0ekpg"}]],le=k("key-round",re);const ce=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}]],de=k("shield",ce);function ue(t){const{children:a,open:s,defaultOpen:r=!1,onOpenChange:o,onOpenChangeComplete:i,actionsRef:l,handle:m,triggerId:p,defaultTriggerId:j=null}=t,v=R(),x=!!v,h=E(()=>m?.store??new K({open:r,openProp:s,activeTriggerId:j,triggerIdProp:p,modal:!0,disablePointerDismissal:!0,nested:x,role:"alertdialog"})).current;h.useControlledProp("openProp",s),h.useControlledProp("triggerIdProp",p),h.useSyncedValue("nested",x),h.useContextCallback("onOpenChange",o),h.useContextCallback("onOpenChangeComplete",i);const w=h.useState("payload");O({store:h,actionsRef:l,parentContext:v?.store.context});const n=d.useMemo(()=>({store:h}),[h]);return e.jsx(B.Provider,{value:n,children:typeof a=="function"?a({payload:w}):a})}function me({...t}){return e.jsx(ue,{"data-slot":"alert-dialog",...t})}function xe({...t}){return e.jsx(H,{"data-slot":"alert-dialog-portal",...t})}function he({className:t,...a}){return e.jsx(W,{"data-slot":"alert-dialog-overlay",className:y("data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 bg-black/10 duration-100 supports-backdrop-filter:backdrop-blur-xs fixed inset-0 isolate z-50",t),...a})}function ge({className:t,size:a="default",...s}){return e.jsxs(xe,{children:[e.jsx(he,{}),e.jsx($,{"data-slot":"alert-dialog-content","data-size":a,className:y("data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 data-closed:zoom-out-95 data-open:zoom-in-95 bg-background ring-foreground/10 gap-4 rounded-xl p-4 ring-1 duration-100 data-[size=default]:max-w-xs data-[size=sm]:max-w-xs data-[size=default]:sm:max-w-sm group/alert-dialog-content fixed top-1/2 left-1/2 z-50 grid w-full -translate-x-1/2 -translate-y-1/2 outline-none",t),...s})]})}function pe({className:t,...a}){return e.jsx("div",{"data-slot":"alert-dialog-header",className:y("grid grid-rows-[auto_1fr] place-items-center gap-1.5 text-center has-data-[slot=alert-dialog-media]:grid-rows-[auto_auto_1fr] has-data-[slot=alert-dialog-media]:gap-x-4 sm:group-data-[size=default]/alert-dialog-content:place-items-start sm:group-data-[size=default]/alert-dialog-content:text-left sm:group-data-[size=default]/alert-dialog-content:has-data-[slot=alert-dialog-media]:grid-rows-[auto_1fr]",t),...a})}function je({className:t,...a}){return e.jsx("div",{"data-slot":"alert-dialog-footer",className:y("bg-muted/50 -mx-4 -mb-4 rounded-b-xl border-t p-4 flex flex-col-reverse gap-2 group-data-[size=sm]/alert-dialog-content:grid group-data-[size=sm]/alert-dialog-content:grid-cols-2 sm:flex-row sm:justify-end",t),...a})}function fe({className:t,...a}){return e.jsx(q,{"data-slot":"alert-dialog-title",className:y("text-base font-medium sm:group-data-[size=default]/alert-dialog-content:group-has-data-[slot=alert-dialog-media]/alert-dialog-content:col-start-2",t),...a})}function ye({className:t,...a}){return e.jsx(V,{"data-slot":"alert-dialog-description",className:y("text-muted-foreground *:[a]:hover:text-foreground text-sm text-balance md:text-pretty *:[a]:underline *:[a]:underline-offset-3",t),...a})}function ve({className:t,...a}){return e.jsx(u,{"data-slot":"alert-dialog-action",className:y(t),...a})}function Ne({className:t,variant:a="outline",size:s="default",...r}){return e.jsx(U,{"data-slot":"alert-dialog-cancel",className:y(t),render:e.jsx(u,{variant:a,size:s}),...r})}function Ce({open:t,onOpenChange:a}){const{loginFlow:s}=L(_,i=>({loginFlow:i.loginFlow}));if(d.useEffect(()=>{!t&&s&&X()},[t,s]),d.useEffect(()=>{if(t&&s?.status==="complete"&&s.success===!0){const i=setTimeout(()=>{a(!1)},1500);return()=>clearTimeout(i)}},[t,s,a]),!s)return null;const r=()=>{s.loginFlowId&&s.status!=="complete"&&s.status!=="error"&&f.getClient()?.authLoginCancel(s.loginFlowId),a(!1)},o=()=>{a(!1)};return e.jsx(me,{open:t,onOpenChange:a,children:e.jsxs(ge,{children:[e.jsxs(pe,{children:[e.jsx(fe,{children:s.status==="complete"&&s.success?"Login Successful":s.status==="error"?"Login Failed":`Sign in to ${s.providerId}`}),e.jsx(ye,{children:e.jsx(be,{flow:s})})]}),e.jsx(je,{children:s.status==="complete"||s.status==="error"?e.jsx(ve,{onClick:o,children:"Close"}):e.jsx(Ne,{onClick:r,children:"Cancel"})})]})})}function be({flow:t}){const a=f.getClient(),s=d.useRef(null),r=i=>{t.loginFlowId&&a&&a.authLoginInput(t.loginFlowId,i)},o=i=>{t.loginFlowId&&a&&a.authLoginInput(t.loginFlowId,i)};return d.useEffect(()=>{t.status==="waiting_url"&&t.url&&s.current!==t.url&&(s.current=t.url,window.open(t.url,"_blank"))},[t.status,t.url]),t.status==="idle"?e.jsxs("div",{className:"flex items-center gap-3 py-4",children:[e.jsx(N,{className:"h-5 w-5 animate-spin text-muted-foreground"}),e.jsx("span",{className:"text-sm",children:"Starting login..."})]}):t.status==="waiting_url"&&t.url?e.jsxs("div",{className:"space-y-4 py-4",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(N,{className:"h-5 w-5 animate-spin text-muted-foreground"}),e.jsx("span",{className:"text-sm",children:"Complete the authentication in your browser..."})]}),t.instructions&&e.jsx("p",{className:"text-xs text-muted-foreground rounded-md bg-muted p-2",children:t.instructions}),e.jsxs(u,{onClick:()=>window.open(t.url,"_blank"),className:"w-full",variant:"outline",size:"sm",children:[e.jsx(ie,{className:"mr-2 h-4 w-4"}),"Open in Browser"]}),t.showManualInput&&e.jsx(ke,{onSubmit:r}),t.progressMessage&&e.jsxs("div",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[e.jsx(N,{className:"h-3 w-3 animate-spin"}),e.jsx("span",{children:t.progressMessage})]})]}):t.status==="waiting_input"&&t.promptMessage?e.jsx("div",{className:"py-4",children:e.jsx(Ae,{message:t.promptMessage,placeholder:t.promptPlaceholder,onSubmit:o})}):t.status==="in_progress"?e.jsxs("div",{className:"flex items-center gap-3 py-4",children:[e.jsx(N,{className:"h-5 w-5 animate-spin text-muted-foreground"}),e.jsx("span",{className:"text-sm",children:t.progressMessage||"Completing authentication..."})]}):t.status==="complete"&&t.success?e.jsxs("div",{className:"flex items-center gap-3 py-4 text-green-600",children:[e.jsx(te,{className:"h-5 w-5"}),e.jsxs("span",{className:"text-sm",children:["Successfully authenticated with ",t.providerId]})]}):t.status==="error"||t.status==="complete"&&!t.success?e.jsxs("div",{className:"space-y-2 py-4",children:[e.jsxs("div",{className:"flex items-center gap-3 text-destructive",children:[e.jsx(T,{className:"h-5 w-5"}),e.jsx("span",{className:"text-sm font-medium",children:"Authentication failed"})]}),t.error&&e.jsx("p",{className:"text-xs text-muted-foreground rounded-md bg-muted p-2",children:t.error})]}):null}function ke({onSubmit:t}){const a=s=>{s.preventDefault();const o=new FormData(s.currentTarget).get("code");o?.trim()&&t(o.trim())};return e.jsx("form",{onSubmit:a,className:"space-y-2",children:e.jsxs(C,{children:[e.jsx(A,{htmlFor:"manual-code",children:"Or paste the authorization code/URL here:"}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(b,{id:"manual-code",name:"code",type:"text",placeholder:"Paste code or redirect URL",className:"flex-1"}),e.jsx(u,{type:"submit",size:"sm",children:"Submit"})]})]})})}function Ae({message:t,placeholder:a,onSubmit:s}){const r=o=>{o.preventDefault();const l=new FormData(o.currentTarget).get("prompt-value");l?.trim()&&s(l.trim())};return e.jsxs("form",{onSubmit:r,className:"space-y-3",children:[e.jsx("p",{className:"text-sm",children:t}),e.jsx(C,{children:e.jsxs("div",{className:"flex gap-2",children:[e.jsx(b,{id:"prompt-value",name:"prompt-value",type:"text",placeholder:a||"Enter value",className:"flex-1",autoFocus:!0}),e.jsx(u,{type:"submit",size:"sm",children:"Submit"})]})})]})}function Le(){const{settings:t,status:a}=L(G,x=>({settings:x.settings,status:x.status})),[s,r]=d.useState(t.url),[o,i]=d.useState(t.authToken),l=a==="connected",m=a==="connecting",p=()=>{P({url:s,authToken:o})},j=()=>{P({url:s,authToken:o}),f.connect()},v=()=>{f.disconnect()};return e.jsx("div",{className:"h-full overflow-y-auto",children:e.jsxs("div",{className:"container max-w-2xl py-8 px-4",children:[e.jsxs(S,{children:[e.jsxs(D,{children:[e.jsx(F,{children:"Connection Settings"}),e.jsx(M,{children:"Configure the WebSocket connection to your clankie instance"})]}),e.jsxs(I,{className:"space-y-4",children:[e.jsxs(C,{children:[e.jsx(A,{htmlFor:"ws-url",children:"WebSocket URL"}),e.jsx(b,{id:"ws-url",type:"text",placeholder:"ws://localhost:3100",value:s,onChange:x=>r(x.target.value),disabled:l})]}),e.jsxs(C,{children:[e.jsx(A,{htmlFor:"auth-token",children:"Auth Token"}),e.jsx(b,{id:"auth-token",type:"password",placeholder:"Enter your authentication token",value:o,onChange:x=>i(x.target.value),disabled:l}),e.jsxs("p",{className:"text-xs text-muted-foreground mt-1",children:["Set with:"," ",e.jsx("code",{className:"rounded bg-muted px-1 py-0.5",children:'clankie config set channels.web.authToken "your-token"'})]})]}),e.jsx("div",{className:"flex gap-2 pt-2",children:l?e.jsx(u,{variant:"destructive",onClick:v,children:"Disconnect"}):e.jsxs(e.Fragment,{children:[e.jsx(u,{onClick:j,disabled:m||!o,children:m?"Connecting...":"Connect"}),e.jsx(u,{variant:"outline",onClick:p,disabled:m,children:"Save"})]})}),!o&&e.jsxs("div",{className:"rounded-md border border-destructive/50 bg-destructive/10 p-3 text-sm text-destructive",children:[e.jsx("p",{className:"font-medium",children:"Auth token required"}),e.jsx("p",{className:"text-xs mt-1",children:"Configure the token in clankie and enter it above to connect."})]})]})]}),e.jsxs(S,{className:"mt-4",children:[e.jsx(D,{children:e.jsx(F,{children:"Setup Instructions"})}),e.jsxs(I,{className:"space-y-3 text-sm",children:[e.jsxs("div",{children:[e.jsx("p",{className:"font-medium",children:"1. Enable the web channel in clankie"}),e.jsxs("code",{className:"block mt-1 rounded bg-muted p-2 text-xs",children:['clankie config set channels.web.authToken "your-secret-token"',e.jsx("br",{}),"clankie config set channels.web.port 3100"]})]}),e.jsxs("div",{children:[e.jsx("p",{className:"font-medium",children:"2. Start the clankie daemon"}),e.jsx("code",{className:"block mt-1 rounded bg-muted p-2 text-xs",children:"clankie start"})]}),e.jsxs("div",{children:[e.jsx("p",{className:"font-medium",children:"3. Enter the token above and connect"}),e.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"The web-ui will connect to ws://localhost:3100 by default"})]})]})]}),l&&e.jsx(we,{})]})})}function we(){const{providers:t,isLoadingProviders:a,loginFlow:s}=L(_,n=>({providers:n.providers,isLoadingProviders:n.isLoadingProviders,loginFlow:n.loginFlow})),[r,o]=d.useState(!1),[i,l]=d.useState(null),[m,p]=d.useState(""),j=d.useCallback(async()=>{const n=f.getClient();if(n){J(!0);try{const{providers:c}=await n.getAuthProviders();z(c)}catch(c){console.error("Failed to load auth providers:",c),z([])}}},[]);d.useEffect(()=>{j()},[j]),d.useEffect(()=>{if(s?.status==="complete"&&s.success===!0){j();const{activeSessionId:n}=Q.state;if(n){const c=f.getClient();c&&c.getAvailableModels(n).then(({models:g})=>{Y(g),console.log("[settings] Refreshed available models after OAuth login")}).catch(g=>{console.error("[settings] Failed to refresh available models:",g)})}}},[s?.status,s?.success,j]);const v=async n=>{const c=f.getClient();if(c)try{const{loginFlowId:g}=await c.authLogin(n);ee(g,n),o(!0)}catch(g){console.error("Failed to start login:",g)}},x=n=>{l(n),p("")},h=async n=>{const c=f.getClient();if(!(!c||!m.trim()))try{await c.authSetApiKey(n,m.trim()),l(null),p(""),await j()}catch(g){console.error("Failed to save API key:",g)}},w=async n=>{const c=f.getClient();if(c)try{await c.authLogout(n),await j()}catch(g){console.error("Failed to logout:",g)}};return e.jsxs(e.Fragment,{children:[e.jsxs(S,{className:"mt-4",children:[e.jsxs(D,{children:[e.jsx(F,{children:"AI Provider Authentication"}),e.jsx(M,{children:"Configure authentication for AI providers (OpenAI, Anthropic, etc.)"})]}),e.jsx(I,{children:a?e.jsx("div",{className:"flex items-center justify-center py-8",children:e.jsx(N,{className:"h-6 w-6 animate-spin text-muted-foreground"})}):t.length===0?e.jsx("p",{className:"text-sm text-muted-foreground py-4",children:"No providers available."}):e.jsx("div",{className:"space-y-3",children:t.map(n=>e.jsx(Se,{provider:n,isEditing:i===n.id,apiKeyValue:m,onApiKeyChange:p,onLogin:()=>n.type==="oauth"?v(n.id):x(n.id),onSaveApiKey:()=>h(n.id),onCancelApiKey:()=>l(null),onLogout:()=>w(n.id)},n.id))})})]}),e.jsx(Ce,{open:r,onOpenChange:o})]})}function Se({provider:t,isEditing:a,apiKeyValue:s,onApiKeyChange:r,onLogin:o,onSaveApiKey:i,onCancelApiKey:l,onLogout:m}){return e.jsx("div",{className:"rounded-lg border p-4",children:e.jsxs("div",{className:"flex items-start justify-between gap-4",children:[e.jsxs("div",{className:"flex-1",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[e.jsx("h4",{className:"font-medium",children:t.name}),e.jsx(Z,{variant:t.type==="oauth"?"default":"secondary",className:"text-xs",children:t.type==="oauth"?e.jsxs(e.Fragment,{children:[e.jsx(de,{className:"h-3 w-3 mr-1"}),"OAuth"]}):e.jsxs(e.Fragment,{children:[e.jsx(le,{className:"h-3 w-3 mr-1"}),"API Key"]})}),t.hasAuth?e.jsx(ae,{className:"h-4 w-4 text-green-600"}):e.jsx(T,{className:"h-4 w-4 text-muted-foreground"})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:t.hasAuth?"Authenticated":"Not configured"}),a&&t.type==="apikey"&&e.jsxs("div",{className:"mt-3 space-y-2",children:[e.jsxs(C,{children:[e.jsx(A,{htmlFor:`api-key-${t.id}`,children:"API Key"}),e.jsx(b,{id:`api-key-${t.id}`,type:"password",placeholder:"Enter API key",value:s,onChange:p=>r(p.target.value),autoFocus:!0})]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(u,{size:"sm",onClick:i,disabled:!s.trim(),children:"Save"}),e.jsx(u,{size:"sm",variant:"outline",onClick:l,children:"Cancel"})]})]})]}),!a&&e.jsx("div",{className:"flex gap-2",children:t.hasAuth?e.jsx(u,{size:"sm",variant:"outline",onClick:m,children:"Logout"}):e.jsx(u,{size:"sm",onClick:o,children:"Login"})})]})})}export{Le as component};
1
+ import{c as k,u as R,a as E,D as K,b as O,r as d,j as e,d as B,e as $,f as y,g as q,h as V,B as u,i as U,k as H,l as W,m as L,n as _,o as X,p as f,q as G,s as P,t as J,v as z,w as Q,x as Y,y as Z,z as ee}from"./main-J9rrgTOF.js";import{C as te,F as C,a as A,I as b,b as S,c as D,d as F,e as M,f as I}from"./card-Ce8RCN8-.js";import{L as N}from"./loader-circle-CpT1_nns.js";const se=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],ae=k("circle-check",se);const ne=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]],T=k("circle-x",ne);const oe=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]],ie=k("external-link",oe);const re=[["path",{d:"M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z",key:"1s6t7t"}],["circle",{cx:"16.5",cy:"7.5",r:".5",fill:"currentColor",key:"w0ekpg"}]],le=k("key-round",re);const ce=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}]],de=k("shield",ce);function ue(t){const{children:a,open:s,defaultOpen:r=!1,onOpenChange:o,onOpenChangeComplete:i,actionsRef:l,handle:m,triggerId:p,defaultTriggerId:j=null}=t,v=R(),x=!!v,h=E(()=>m?.store??new K({open:r,openProp:s,activeTriggerId:j,triggerIdProp:p,modal:!0,disablePointerDismissal:!0,nested:x,role:"alertdialog"})).current;h.useControlledProp("openProp",s),h.useControlledProp("triggerIdProp",p),h.useSyncedValue("nested",x),h.useContextCallback("onOpenChange",o),h.useContextCallback("onOpenChangeComplete",i);const w=h.useState("payload");O({store:h,actionsRef:l,parentContext:v?.store.context});const n=d.useMemo(()=>({store:h}),[h]);return e.jsx(B.Provider,{value:n,children:typeof a=="function"?a({payload:w}):a})}function me({...t}){return e.jsx(ue,{"data-slot":"alert-dialog",...t})}function xe({...t}){return e.jsx(H,{"data-slot":"alert-dialog-portal",...t})}function he({className:t,...a}){return e.jsx(W,{"data-slot":"alert-dialog-overlay",className:y("data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 bg-black/10 duration-100 supports-backdrop-filter:backdrop-blur-xs fixed inset-0 isolate z-50",t),...a})}function ge({className:t,size:a="default",...s}){return e.jsxs(xe,{children:[e.jsx(he,{}),e.jsx($,{"data-slot":"alert-dialog-content","data-size":a,className:y("data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 data-closed:zoom-out-95 data-open:zoom-in-95 bg-background ring-foreground/10 gap-4 rounded-xl p-4 ring-1 duration-100 data-[size=default]:max-w-xs data-[size=sm]:max-w-xs data-[size=default]:sm:max-w-sm group/alert-dialog-content fixed top-1/2 left-1/2 z-50 grid w-full -translate-x-1/2 -translate-y-1/2 outline-none",t),...s})]})}function pe({className:t,...a}){return e.jsx("div",{"data-slot":"alert-dialog-header",className:y("grid grid-rows-[auto_1fr] place-items-center gap-1.5 text-center has-data-[slot=alert-dialog-media]:grid-rows-[auto_auto_1fr] has-data-[slot=alert-dialog-media]:gap-x-4 sm:group-data-[size=default]/alert-dialog-content:place-items-start sm:group-data-[size=default]/alert-dialog-content:text-left sm:group-data-[size=default]/alert-dialog-content:has-data-[slot=alert-dialog-media]:grid-rows-[auto_1fr]",t),...a})}function je({className:t,...a}){return e.jsx("div",{"data-slot":"alert-dialog-footer",className:y("bg-muted/50 -mx-4 -mb-4 rounded-b-xl border-t p-4 flex flex-col-reverse gap-2 group-data-[size=sm]/alert-dialog-content:grid group-data-[size=sm]/alert-dialog-content:grid-cols-2 sm:flex-row sm:justify-end",t),...a})}function fe({className:t,...a}){return e.jsx(q,{"data-slot":"alert-dialog-title",className:y("text-base font-medium sm:group-data-[size=default]/alert-dialog-content:group-has-data-[slot=alert-dialog-media]/alert-dialog-content:col-start-2",t),...a})}function ye({className:t,...a}){return e.jsx(V,{"data-slot":"alert-dialog-description",className:y("text-muted-foreground *:[a]:hover:text-foreground text-sm text-balance md:text-pretty *:[a]:underline *:[a]:underline-offset-3",t),...a})}function ve({className:t,...a}){return e.jsx(u,{"data-slot":"alert-dialog-action",className:y(t),...a})}function Ne({className:t,variant:a="outline",size:s="default",...r}){return e.jsx(U,{"data-slot":"alert-dialog-cancel",className:y(t),render:e.jsx(u,{variant:a,size:s}),...r})}function Ce({open:t,onOpenChange:a}){const{loginFlow:s}=L(_,i=>({loginFlow:i.loginFlow}));if(d.useEffect(()=>{!t&&s&&X()},[t,s]),d.useEffect(()=>{if(t&&s?.status==="complete"&&s.success===!0){const i=setTimeout(()=>{a(!1)},1500);return()=>clearTimeout(i)}},[t,s,a]),!s)return null;const r=()=>{s.loginFlowId&&s.status!=="complete"&&s.status!=="error"&&f.getClient()?.authLoginCancel(s.loginFlowId),a(!1)},o=()=>{a(!1)};return e.jsx(me,{open:t,onOpenChange:a,children:e.jsxs(ge,{children:[e.jsxs(pe,{children:[e.jsx(fe,{children:s.status==="complete"&&s.success?"Login Successful":s.status==="error"?"Login Failed":`Sign in to ${s.providerId}`}),e.jsx(ye,{children:e.jsx(be,{flow:s})})]}),e.jsx(je,{children:s.status==="complete"||s.status==="error"?e.jsx(ve,{onClick:o,children:"Close"}):e.jsx(Ne,{onClick:r,children:"Cancel"})})]})})}function be({flow:t}){const a=f.getClient(),s=d.useRef(null),r=i=>{t.loginFlowId&&a&&a.authLoginInput(t.loginFlowId,i)},o=i=>{t.loginFlowId&&a&&a.authLoginInput(t.loginFlowId,i)};return d.useEffect(()=>{t.status==="waiting_url"&&t.url&&s.current!==t.url&&(s.current=t.url,window.open(t.url,"_blank"))},[t.status,t.url]),t.status==="idle"?e.jsxs("div",{className:"flex items-center gap-3 py-4",children:[e.jsx(N,{className:"h-5 w-5 animate-spin text-muted-foreground"}),e.jsx("span",{className:"text-sm",children:"Starting login..."})]}):t.status==="waiting_url"&&t.url?e.jsxs("div",{className:"space-y-4 py-4",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(N,{className:"h-5 w-5 animate-spin text-muted-foreground"}),e.jsx("span",{className:"text-sm",children:"Complete the authentication in your browser..."})]}),t.instructions&&e.jsx("p",{className:"text-xs text-muted-foreground rounded-md bg-muted p-2",children:t.instructions}),e.jsxs(u,{onClick:()=>window.open(t.url,"_blank"),className:"w-full",variant:"outline",size:"sm",children:[e.jsx(ie,{className:"mr-2 h-4 w-4"}),"Open in Browser"]}),t.showManualInput&&e.jsx(ke,{onSubmit:r}),t.progressMessage&&e.jsxs("div",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[e.jsx(N,{className:"h-3 w-3 animate-spin"}),e.jsx("span",{children:t.progressMessage})]})]}):t.status==="waiting_input"&&t.promptMessage?e.jsx("div",{className:"py-4",children:e.jsx(Ae,{message:t.promptMessage,placeholder:t.promptPlaceholder,onSubmit:o})}):t.status==="in_progress"?e.jsxs("div",{className:"flex items-center gap-3 py-4",children:[e.jsx(N,{className:"h-5 w-5 animate-spin text-muted-foreground"}),e.jsx("span",{className:"text-sm",children:t.progressMessage||"Completing authentication..."})]}):t.status==="complete"&&t.success?e.jsxs("div",{className:"flex items-center gap-3 py-4 text-green-600",children:[e.jsx(te,{className:"h-5 w-5"}),e.jsxs("span",{className:"text-sm",children:["Successfully authenticated with ",t.providerId]})]}):t.status==="error"||t.status==="complete"&&!t.success?e.jsxs("div",{className:"space-y-2 py-4",children:[e.jsxs("div",{className:"flex items-center gap-3 text-destructive",children:[e.jsx(T,{className:"h-5 w-5"}),e.jsx("span",{className:"text-sm font-medium",children:"Authentication failed"})]}),t.error&&e.jsx("p",{className:"text-xs text-muted-foreground rounded-md bg-muted p-2",children:t.error})]}):null}function ke({onSubmit:t}){const a=s=>{s.preventDefault();const o=new FormData(s.currentTarget).get("code");o?.trim()&&t(o.trim())};return e.jsx("form",{onSubmit:a,className:"space-y-2",children:e.jsxs(C,{children:[e.jsx(A,{htmlFor:"manual-code",children:"Or paste the authorization code/URL here:"}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(b,{id:"manual-code",name:"code",type:"text",placeholder:"Paste code or redirect URL",className:"flex-1"}),e.jsx(u,{type:"submit",size:"sm",children:"Submit"})]})]})})}function Ae({message:t,placeholder:a,onSubmit:s}){const r=o=>{o.preventDefault();const l=new FormData(o.currentTarget).get("prompt-value");l?.trim()&&s(l.trim())};return e.jsxs("form",{onSubmit:r,className:"space-y-3",children:[e.jsx("p",{className:"text-sm",children:t}),e.jsx(C,{children:e.jsxs("div",{className:"flex gap-2",children:[e.jsx(b,{id:"prompt-value",name:"prompt-value",type:"text",placeholder:a||"Enter value",className:"flex-1",autoFocus:!0}),e.jsx(u,{type:"submit",size:"sm",children:"Submit"})]})})]})}function Le(){const{settings:t,status:a}=L(G,x=>({settings:x.settings,status:x.status})),[s,r]=d.useState(t.url),[o,i]=d.useState(t.authToken),l=a==="connected",m=a==="connecting",p=()=>{P({url:s,authToken:o})},j=()=>{P({url:s,authToken:o}),f.connect()},v=()=>{f.disconnect()};return e.jsx("div",{className:"h-full overflow-y-auto",children:e.jsxs("div",{className:"container max-w-2xl py-8 px-4",children:[e.jsxs(S,{children:[e.jsxs(D,{children:[e.jsx(F,{children:"Connection Settings"}),e.jsx(M,{children:"Configure the WebSocket connection to your clankie instance"})]}),e.jsxs(I,{className:"space-y-4",children:[e.jsxs(C,{children:[e.jsx(A,{htmlFor:"ws-url",children:"WebSocket URL"}),e.jsx(b,{id:"ws-url",type:"text",placeholder:"ws://localhost:3100",value:s,onChange:x=>r(x.target.value),disabled:l})]}),e.jsxs(C,{children:[e.jsx(A,{htmlFor:"auth-token",children:"Auth Token"}),e.jsx(b,{id:"auth-token",type:"password",placeholder:"Enter your authentication token",value:o,onChange:x=>i(x.target.value),disabled:l}),e.jsxs("p",{className:"text-xs text-muted-foreground mt-1",children:["Set with:"," ",e.jsx("code",{className:"rounded bg-muted px-1 py-0.5",children:'clankie config set channels.web.authToken "your-token"'})]})]}),e.jsx("div",{className:"flex gap-2 pt-2",children:l?e.jsx(u,{variant:"destructive",onClick:v,children:"Disconnect"}):e.jsxs(e.Fragment,{children:[e.jsx(u,{onClick:j,disabled:m||!o,children:m?"Connecting...":"Connect"}),e.jsx(u,{variant:"outline",onClick:p,disabled:m,children:"Save"})]})}),!o&&e.jsxs("div",{className:"rounded-md border border-destructive/50 bg-destructive/10 p-3 text-sm text-destructive",children:[e.jsx("p",{className:"font-medium",children:"Auth token required"}),e.jsx("p",{className:"text-xs mt-1",children:"Configure the token in clankie and enter it above to connect."})]})]})]}),e.jsxs(S,{className:"mt-4",children:[e.jsx(D,{children:e.jsx(F,{children:"Setup Instructions"})}),e.jsxs(I,{className:"space-y-3 text-sm",children:[e.jsxs("div",{children:[e.jsx("p",{className:"font-medium",children:"1. Enable the web channel in clankie"}),e.jsxs("code",{className:"block mt-1 rounded bg-muted p-2 text-xs",children:['clankie config set channels.web.authToken "your-secret-token"',e.jsx("br",{}),"clankie config set channels.web.port 3100"]})]}),e.jsxs("div",{children:[e.jsx("p",{className:"font-medium",children:"2. Start the clankie daemon"}),e.jsx("code",{className:"block mt-1 rounded bg-muted p-2 text-xs",children:"clankie start"})]}),e.jsxs("div",{children:[e.jsx("p",{className:"font-medium",children:"3. Enter the token above and connect"}),e.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"The web-ui will connect to ws://localhost:3100 by default"})]})]})]}),l&&e.jsx(we,{})]})})}function we(){const{providers:t,isLoadingProviders:a,loginFlow:s}=L(_,n=>({providers:n.providers,isLoadingProviders:n.isLoadingProviders,loginFlow:n.loginFlow})),[r,o]=d.useState(!1),[i,l]=d.useState(null),[m,p]=d.useState(""),j=d.useCallback(async()=>{const n=f.getClient();if(n){J(!0);try{const{providers:c}=await n.getAuthProviders();z(c)}catch(c){console.error("Failed to load auth providers:",c),z([])}}},[]);d.useEffect(()=>{j()},[j]),d.useEffect(()=>{if(s?.status==="complete"&&s.success===!0){j();const{activeSessionId:n}=Q.state;if(n){const c=f.getClient();c&&c.getAvailableModels(n).then(({models:g})=>{Y(g),console.log("[settings] Refreshed available models after OAuth login")}).catch(g=>{console.error("[settings] Failed to refresh available models:",g)})}}},[s?.status,s?.success,j]);const v=async n=>{const c=f.getClient();if(c)try{const{loginFlowId:g}=await c.authLogin(n);ee(g,n),o(!0)}catch(g){console.error("Failed to start login:",g)}},x=n=>{l(n),p("")},h=async n=>{const c=f.getClient();if(!(!c||!m.trim()))try{await c.authSetApiKey(n,m.trim()),l(null),p(""),await j()}catch(g){console.error("Failed to save API key:",g)}},w=async n=>{const c=f.getClient();if(c)try{await c.authLogout(n),await j()}catch(g){console.error("Failed to logout:",g)}};return e.jsxs(e.Fragment,{children:[e.jsxs(S,{className:"mt-4",children:[e.jsxs(D,{children:[e.jsx(F,{children:"AI Provider Authentication"}),e.jsx(M,{children:"Configure authentication for AI providers (OpenAI, Anthropic, etc.)"})]}),e.jsx(I,{children:a?e.jsx("div",{className:"flex items-center justify-center py-8",children:e.jsx(N,{className:"h-6 w-6 animate-spin text-muted-foreground"})}):t.length===0?e.jsx("p",{className:"text-sm text-muted-foreground py-4",children:"No providers available."}):e.jsx("div",{className:"space-y-3",children:t.map(n=>e.jsx(Se,{provider:n,isEditing:i===n.id,apiKeyValue:m,onApiKeyChange:p,onLogin:()=>n.type==="oauth"?v(n.id):x(n.id),onSaveApiKey:()=>h(n.id),onCancelApiKey:()=>l(null),onLogout:()=>w(n.id)},n.id))})})]}),e.jsx(Ce,{open:r,onOpenChange:o})]})}function Se({provider:t,isEditing:a,apiKeyValue:s,onApiKeyChange:r,onLogin:o,onSaveApiKey:i,onCancelApiKey:l,onLogout:m}){return e.jsx("div",{className:"rounded-lg border p-4",children:e.jsxs("div",{className:"flex items-start justify-between gap-4",children:[e.jsxs("div",{className:"flex-1",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[e.jsx("h4",{className:"font-medium",children:t.name}),e.jsx(Z,{variant:t.type==="oauth"?"default":"secondary",className:"text-xs",children:t.type==="oauth"?e.jsxs(e.Fragment,{children:[e.jsx(de,{className:"h-3 w-3 mr-1"}),"OAuth"]}):e.jsxs(e.Fragment,{children:[e.jsx(le,{className:"h-3 w-3 mr-1"}),"API Key"]})}),t.hasAuth?e.jsx(ae,{className:"h-4 w-4 text-green-600"}):e.jsx(T,{className:"h-4 w-4 text-muted-foreground"})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:t.hasAuth?"Authenticated":"Not configured"}),a&&t.type==="apikey"&&e.jsxs("div",{className:"mt-3 space-y-2",children:[e.jsxs(C,{children:[e.jsx(A,{htmlFor:`api-key-${t.id}`,children:"API Key"}),e.jsx(b,{id:`api-key-${t.id}`,type:"password",placeholder:"Enter API key",value:s,onChange:p=>r(p.target.value),autoFocus:!0})]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(u,{size:"sm",onClick:i,disabled:!s.trim(),children:"Save"}),e.jsx(u,{size:"sm",variant:"outline",onClick:l,children:"Cancel"})]})]})]}),!a&&e.jsx("div",{className:"flex gap-2",children:t.hasAuth?e.jsx(u,{size:"sm",variant:"outline",onClick:m,children:"Logout"}):e.jsx(u,{size:"sm",onClick:o,children:"Login"})})]})})}export{Le as component};
@@ -1,25 +1,25 @@
1
1
  {
2
- "short_name": "TanStack App",
3
- "name": "Create TanStack App Sample",
4
- "icons": [
5
- {
6
- "src": "favicon.ico",
7
- "sizes": "64x64 32x32 24x24 16x16",
8
- "type": "image/x-icon"
9
- },
10
- {
11
- "src": "logo192.png",
12
- "type": "image/png",
13
- "sizes": "192x192"
14
- },
15
- {
16
- "src": "logo512.png",
17
- "type": "image/png",
18
- "sizes": "512x512"
19
- }
20
- ],
21
- "start_url": ".",
22
- "display": "standalone",
23
- "theme_color": "#000000",
24
- "background_color": "#ffffff"
2
+ "short_name": "TanStack App",
3
+ "name": "Create TanStack App Sample",
4
+ "icons": [
5
+ {
6
+ "src": "favicon.ico",
7
+ "sizes": "64x64 32x32 24x24 16x16",
8
+ "type": "image/x-icon"
9
+ },
10
+ {
11
+ "src": "logo192.png",
12
+ "type": "image/png",
13
+ "sizes": "192x192"
14
+ },
15
+ {
16
+ "src": "logo512.png",
17
+ "type": "image/png",
18
+ "sizes": "512x512"
19
+ }
20
+ ],
21
+ "start_url": ".",
22
+ "display": "standalone",
23
+ "theme_color": "#000000",
24
+ "background_color": "#ffffff"
25
25
  }