slothquery 1.0.2__tar.gz → 1.0.4__tar.gz
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.
- {slothquery-1.0.2/backend/slothquery.egg-info → slothquery-1.0.4}/PKG-INFO +1 -1
- slothquery-1.0.2/backend/app/dist/assets/index-DKvMVJoY.js → slothquery-1.0.4/backend/app/dist/assets/index-C0PfxljE.js +1 -1
- {slothquery-1.0.2 → slothquery-1.0.4}/backend/app/dist/index.html +1 -1
- slothquery-1.0.4/backend/app/services/export_import.py +124 -0
- {slothquery-1.0.2 → slothquery-1.0.4/backend/slothquery.egg-info}/PKG-INFO +1 -1
- {slothquery-1.0.2 → slothquery-1.0.4}/backend/slothquery.egg-info/SOURCES.txt +1 -1
- {slothquery-1.0.2 → slothquery-1.0.4}/setup.py +1 -1
- slothquery-1.0.2/backend/app/services/export_import.py +0 -55
- {slothquery-1.0.2 → slothquery-1.0.4}/MANIFEST.in +0 -0
- {slothquery-1.0.2 → slothquery-1.0.4}/README.md +0 -0
- {slothquery-1.0.2 → slothquery-1.0.4}/backend/app/__init__.py +0 -0
- {slothquery-1.0.2 → slothquery-1.0.4}/backend/app/cli.py +0 -0
- {slothquery-1.0.2 → slothquery-1.0.4}/backend/app/database.py +0 -0
- {slothquery-1.0.2 → slothquery-1.0.4}/backend/app/dist/assets/index-BDTPNUTQ.css +0 -0
- {slothquery-1.0.2 → slothquery-1.0.4}/backend/app/dist/assets/logo-RBZv3XvP.png +0 -0
- {slothquery-1.0.2 → slothquery-1.0.4}/backend/app/main.py +0 -0
- {slothquery-1.0.2 → slothquery-1.0.4}/backend/app/models.py +0 -0
- {slothquery-1.0.2 → slothquery-1.0.4}/backend/app/routers/__init__.py +0 -0
- {slothquery-1.0.2 → slothquery-1.0.4}/backend/app/routers/core.py +0 -0
- {slothquery-1.0.2 → slothquery-1.0.4}/backend/app/schemas.py +0 -0
- {slothquery-1.0.2 → slothquery-1.0.4}/backend/app/services/__init__.py +0 -0
- {slothquery-1.0.2 → slothquery-1.0.4}/backend/app/services/chat.py +0 -0
- {slothquery-1.0.2 → slothquery-1.0.4}/backend/app/services/encryption.py +0 -0
- {slothquery-1.0.2 → slothquery-1.0.4}/backend/app/services/extraction.py +0 -0
- {slothquery-1.0.2 → slothquery-1.0.4}/backend/app/services/provider.py +0 -0
- {slothquery-1.0.2 → slothquery-1.0.4}/backend/app/services/retrieval.py +0 -0
- {slothquery-1.0.2 → slothquery-1.0.4}/backend/app/services/vector_store.py +0 -0
- {slothquery-1.0.2 → slothquery-1.0.4}/backend/slothquery.egg-info/dependency_links.txt +0 -0
- {slothquery-1.0.2 → slothquery-1.0.4}/backend/slothquery.egg-info/entry_points.txt +0 -0
- {slothquery-1.0.2 → slothquery-1.0.4}/backend/slothquery.egg-info/requires.txt +0 -0
- {slothquery-1.0.2 → slothquery-1.0.4}/backend/slothquery.egg-info/top_level.txt +0 -0
- {slothquery-1.0.2 → slothquery-1.0.4}/setup.cfg +0 -0
|
@@ -220,7 +220,7 @@ Error generating stack: `+i.message+`
|
|
|
220
220
|
*
|
|
221
221
|
* This source code is licensed under the ISC license.
|
|
222
222
|
* See the LICENSE file in the root directory of this source tree.
|
|
223
|
-
*/const Ev=me("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);function jv({activeView:e,setActiveView:t,chats:n,activeChatId:r,setActiveChatId:l,onCreateChat:i,onDeleteChat:s,toggleRightSidebar:o,isCollapsed:a,setIsCollapsed:u}){return a?c.jsxs("div",{className:"flex flex-col items-center justify-between border-r bg-slate-50 py-4 w-12 h-screen select-none transition-all duration-300 shrink-0",children:[c.jsxs("div",{className:"flex flex-col items-center gap-6 w-full",children:[c.jsx("button",{onClick:()=>u(!1),className:"p-1.5 rounded hover:bg-slate-200 text-slate-500",title:"Expand Sidebar",children:c.jsx(dv,{size:18})}),c.jsx("div",{className:"h-px bg-slate-200 w-8"}),c.jsx("button",{onClick:()=>{t("chat")},className:`p-2 rounded transition-colors ${e==="chat"?"bg-slate-200 text-slate-900 font-medium":"text-slate-600 hover:bg-slate-100"}`,title:"Chats",children:c.jsx(zd,{size:20})}),c.jsx("button",{onClick:()=>{t("studio")},className:`p-2 rounded transition-colors ${e==="studio"?"bg-slate-200 text-slate-900 font-medium":"text-slate-600 hover:bg-slate-100"}`,title:"Knowledge Studio",children:c.jsx(Rl,{size:20})}),c.jsx("button",{onClick:()=>{t("schema")},className:`p-2 rounded transition-colors ${e==="schema"?"bg-slate-200 text-slate-900 font-medium":"text-slate-600 hover:bg-slate-100"}`,title:"Schema & Playbooks",children:c.jsx(Ls,{size:20})})]}),c.jsx("button",{onClick:o,className:"p-2 rounded hover:bg-slate-200 text-slate-600",title:"Settings",children:c.jsx(uu,{size:20})})]}):c.jsxs("div",{className:"flex flex-col justify-between border-r bg-slate-50 w-64 h-screen select-none transition-all duration-300 relative shrink-0",children:[c.jsxs("div",{className:"flex flex-col overflow-y-auto flex-1 p-4 gap-4",children:[c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsx("h1",{className:"text-xl font-bold tracking-tight text-slate-900",children:"SlothQuery"}),c.jsx("button",{onClick:()=>u(!0),className:"p-1 rounded hover:bg-slate-200 text-slate-500",title:"Collapse Sidebar",children:c.jsx(fv,{size:16})})]}),c.jsx("div",{className:"h-px bg-slate-200 my-1"}),c.jsxs("div",{className:"flex flex-col gap-1",children:[c.jsxs("button",{onClick:()=>t("chat"),className:`flex items-center gap-2.5 px-3 py-2 text-sm rounded transition-colors ${e==="chat"?"bg-slate-200 text-slate-900 font-semibold":"text-slate-600 hover:bg-slate-100 hover:text-slate-900"}`,children:[c.jsx(zd,{size:16}),"Chats"]}),c.jsxs("button",{onClick:()=>t("studio"),className:`flex items-center gap-2.5 px-3 py-2 text-sm rounded transition-colors ${e==="studio"?"bg-slate-200 text-slate-900 font-semibold":"text-slate-600 hover:bg-slate-100 hover:text-slate-900"}`,children:[c.jsx(Rl,{size:16}),"Knowledge Studio"]}),c.jsxs("button",{onClick:()=>t("schema"),className:`flex items-center gap-2.5 px-3 py-2 text-sm rounded transition-colors ${e==="schema"?"bg-slate-200 text-slate-900 font-semibold":"text-slate-600 hover:bg-slate-100 hover:text-slate-900"}`,children:[c.jsx(Ls,{size:16}),"Schema Explorer"]})]}),c.jsx("div",{className:"h-px bg-slate-200 my-1"}),e==="chat"&&c.jsxs("div",{className:"flex flex-col gap-2 overflow-y-auto max-h-[40vh]",children:[c.jsxs("div",{className:"flex items-center justify-between px-1",children:[c.jsx("span",{className:"text-xs font-semibold uppercase tracking-wider text-slate-500",children:"Recent Chats"}),c.jsxs("button",{onClick:i,className:"flex items-center gap-1 text-xs text-slate-600 hover:text-slate-900 px-1 py-0.5 rounded hover:bg-slate-200 font-semibold",children:[c.jsx(Xr,{size:12})," New"]})]}),n.length===0?c.jsx("div",{className:"text-xs text-slate-400 italic px-2 py-4 text-center",children:"No chats created yet."}):c.jsx("div",{className:"flex flex-col gap-0.5",children:n.map(d=>c.jsxs("div",{className:`group flex items-center justify-between px-2.5 py-2 text-sm rounded cursor-pointer transition-colors ${r===d.id?"bg-slate-200 text-slate-900 font-semibold shadow-subtle":"text-slate-600 hover:bg-slate-100"}`,onClick:()=>l(d.id),children:[c.jsx("span",{className:"truncate flex-1 pr-2",children:d.title||"New Chat"}),c.jsx("button",{onClick:f=>{f.stopPropagation(),s(d.id)},className:"opacity-0 group-hover:opacity-100 p-0.5 hover:bg-slate-300 rounded text-slate-500 hover:text-slate-800 transition-opacity",children:c.jsx(Mr,{size:12})})]},d.id))})]})]}),c.jsx("div",{className:"p-4 border-t bg-slate-100/50",children:c.jsxs("button",{onClick:o,className:"flex items-center gap-2.5 w-full px-3 py-2 text-sm text-slate-600 hover:bg-slate-200 hover:text-slate-900 rounded transition-colors font-medium",children:[c.jsx(uu,{size:16}),"Settings & Configurations"]})})]})}const Dd=e=>{switch(e){case"openai":return"OpenAI API Key";case"anthropic":return"Anthropic API Key";case"google":return"Google Gemini API Key";case"groq":return"Groq API Key";case"openrouter":return"OpenRouter API Key";case"deepseek":return"DeepSeek API Key";default:return"API Key"}},_v=e=>{switch(e){case"openai":return"e.g. gpt-4o, gpt-4o-mini";case"anthropic":return"e.g. claude-3-5-sonnet-20241022";case"google":return"e.g. gemini-1.5-flash, gemini-1.5-pro";case"groq":return"e.g. llama-3.3-70b-versatile, mixtral-8x7b-32768";case"openrouter":return"e.g. google/gemma-2-9b-it:free";case"deepseek":return"e.g. deepseek-chat";default:return"e.g. model-name"}};function Tv({isOpen:e,onClose:t,providers:n,activeProviderId:r,onAddProvider:l,onSetActiveProvider:i,onDeleteProvider:s,onReindex:o,isReindexing:a}){const[u,d]=L.useState(!1),[f,p]=L.useState("openai"),[h,x]=L.useState(""),[v,S]=L.useState(""),[m,g]=L.useState(""),[y,E]=L.useState(!1),[T,b]=L.useState(!1),[_,I]=L.useState(null),[$,N]=L.useState(""),[z,U]=L.useState("");if(!e)return null;const ne=async()=>{var M,P;if(!v.trim()||!m.trim()){I({success:!1,message:"Model Name and API Key are required to test connection."});return}b(!0),I(null);try{await G.post("http://127.0.0.1:8000/api/providers/test",{provider_type:f,model_name:v,api_key:m}),I({success:!0,message:"Connection successful!"})}catch(B){I({success:!1,message:((P=(M=B.response)==null?void 0:M.data)==null?void 0:P.detail)||"Connection failed. Check your API key and model name."})}finally{b(!1)}},R=async M=>{var P,B;if(M.preventDefault(),!(!h.trim()||!v.trim()||!m.trim())){E(!0),I(null);try{await l({provider_type:f,profile_name:h,model_name:v,api_key:m}),x(""),S(""),g(""),d(!1)}catch(w){I({success:!1,message:((B=(P=w.response)==null?void 0:P.data)==null?void 0:B.detail)||"Failed to save provider config."})}finally{E(!1)}}},H=async()=>{try{window.open("http://127.0.0.1:8000/api/export","_blank")}catch(M){console.error("Export failed",M)}},J=async M=>{var w,Q,re;const P=(w=M.target.files)==null?void 0:w[0];if(!P)return;N("Importing..."),U("");const B=new FormData;B.append("file",P);try{await G.post("http://127.0.0.1:8000/api/import",B,{headers:{"Content-Type":"multipart/form-data"}}),N("Imported successfully! Rebuilding vector store..."),o()}catch(k){U(((re=(Q=k.response)==null?void 0:Q.data)==null?void 0:re.detail)||"Import failed"),N("")}};return c.jsxs("div",{className:"fixed right-0 top-0 z-40 bg-white border-l shadow-xl w-80 h-screen select-none flex flex-col justify-between transition-all duration-300",children:[c.jsxs("div",{className:"flex items-center justify-between p-4 border-b",children:[c.jsxs("h2",{className:"font-bold text-slate-850 text-sm flex items-center gap-1.5 text-slate-800",children:[c.jsx(gv,{size:16,className:"text-slate-700"})," Settings & Configs"]}),c.jsx("button",{onClick:t,className:"p-1 rounded hover:bg-slate-100 text-slate-500 hover:text-slate-800",children:c.jsx(Ev,{size:18})})]}),c.jsxs("div",{className:"flex-1 overflow-y-auto p-4 flex flex-col gap-6",children:[c.jsxs("div",{className:"flex flex-col gap-3",children:[c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsx("h3",{className:"text-[11px] font-bold uppercase tracking-wider text-slate-500 flex items-center gap-1.5",children:"LLM Profiles"}),c.jsxs("button",{onClick:()=>{d(!u),I(null)},className:"text-xs font-semibold text-blue-600 hover:text-blue-700 hover:underline flex items-center gap-1 px-1.5 py-0.5 rounded",children:[c.jsx(Xr,{size:12})," Add New"]})]}),u&&c.jsxs("form",{onSubmit:R,className:"p-3 border rounded-lg bg-slate-50 flex flex-col gap-2.5 shadow-subtle border-slate-200",children:[c.jsxs("div",{className:"flex flex-col gap-0.5",children:[c.jsx("label",{className:"text-[10px] font-bold text-slate-500",children:"Provider Type"}),c.jsxs("select",{value:f,onChange:M=>p(M.target.value),className:"text-xs border rounded p-1.5 bg-white text-slate-800 focus:outline-none focus:ring-1 focus:ring-slate-400",children:[c.jsx("option",{value:"openai",children:"OpenAI"}),c.jsx("option",{value:"anthropic",children:"Anthropic"}),c.jsx("option",{value:"google",children:"Google Gemini"}),c.jsx("option",{value:"groq",children:"Groq"}),c.jsx("option",{value:"openrouter",children:"OpenRouter"}),c.jsx("option",{value:"deepseek",children:"DeepSeek"})]})]}),c.jsxs("div",{className:"flex flex-col gap-0.5",children:[c.jsx("label",{className:"text-[10px] font-bold text-slate-500",children:"Profile Label / Name"}),c.jsx("input",{type:"text",value:h,onChange:M=>x(M.target.value),placeholder:"e.g. Work OpenRouter",className:"text-xs border rounded p-1.5 focus:outline-none focus:ring-1 focus:ring-slate-400 bg-white",required:!0})]}),c.jsxs("div",{className:"flex flex-col gap-0.5",children:[c.jsx("label",{className:"text-[10px] font-bold text-slate-500",children:"Model Name"}),c.jsx("input",{type:"text",value:v,onChange:M=>S(M.target.value),placeholder:_v(f),className:"text-xs border rounded p-1.5 focus:outline-none focus:ring-1 focus:ring-slate-400 bg-white font-mono",required:!0})]}),c.jsxs("div",{className:"flex flex-col gap-0.5",children:[c.jsx("label",{className:"text-[10px] font-bold text-slate-500",children:Dd(f)}),c.jsxs("div",{className:"relative",children:[c.jsx("input",{type:"password",value:m,onChange:M=>g(M.target.value),placeholder:`Enter ${Dd(f)}`,className:"text-xs border rounded p-1.5 w-full pr-7 focus:outline-none focus:ring-1 focus:ring-slate-400 bg-white",required:!0}),c.jsx(yv,{size:11,className:"absolute right-2 top-2.5 text-slate-400"})]})]}),_&&c.jsxs("div",{className:`p-2 rounded text-[10px] flex items-start gap-1.5 leading-normal max-w-full overflow-hidden ${_.success?"bg-emerald-50 text-emerald-800 border border-emerald-200":"bg-rose-50 text-rose-800 border border-rose-200"}`,children:[_.success?c.jsx(zs,{size:12,className:"shrink-0 mt-0.5 text-emerald-600"}):c.jsx(Cv,{size:12,className:"shrink-0 mt-0.5 text-rose-600"}),c.jsx("span",{className:"break-words break-all font-medium flex-1 min-w-0",children:_.message})]}),c.jsxs("div",{className:"flex justify-end gap-1.5 mt-1 border-t pt-2 border-slate-200",children:[c.jsx("button",{type:"button",onClick:()=>{d(!1),I(null)},className:"text-[10px] font-bold px-2.5 py-1.5 border rounded hover:bg-white text-slate-600",children:"Cancel"}),c.jsx("button",{type:"button",onClick:ne,disabled:T||y,className:"text-[10px] font-bold bg-white border border-slate-350 hover:bg-slate-100 text-slate-700 px-2.5 py-1.5 rounded disabled:opacity-50",children:T?"Testing...":"Test Connection"}),c.jsx("button",{type:"submit",disabled:y||T,className:"text-[10px] font-bold bg-blue-600 hover:bg-blue-700 text-white px-2.5 py-1.5 rounded disabled:opacity-50",children:y?"Saving...":"Save & Activate"})]})]}),c.jsx("div",{className:"max-h-56 overflow-y-auto flex flex-col gap-1.5 border border-slate-100 p-1 rounded-lg bg-slate-50/50",children:n.length===0?c.jsx("div",{className:"text-xs text-slate-400 italic py-6 text-center",children:"No profiles configured yet."}):n.map(M=>c.jsxs("div",{className:`flex items-center justify-between p-2.5 rounded-lg border text-xs cursor-pointer transition-colors ${M.is_active?"bg-white border-blue-500 font-medium shadow-subtle":"bg-white hover:bg-slate-50 border-slate-200"}`,onClick:()=>i(M.id),children:[c.jsxs("div",{className:"flex flex-col gap-0.5 truncate flex-1 pr-2",children:[c.jsx("span",{className:"truncate text-slate-800 font-semibold",children:M.profile_name}),c.jsxs("span",{className:"text-[9px] text-slate-500 uppercase tracking-tight font-mono",children:[M.provider_type," • ",M.model_name]})]}),c.jsxs("div",{className:"flex items-center gap-2",children:[M.is_active&&c.jsx("span",{className:"text-[9px] bg-blue-50 text-blue-700 border border-blue-200 px-1.5 py-0.5 rounded font-bold uppercase tracking-wider",children:"Active"}),c.jsx("button",{onClick:P=>{P.stopPropagation(),s(M.id)},className:"p-1 hover:bg-slate-100 rounded text-slate-400 hover:text-rose-600 transition-colors",children:c.jsx(Mr,{size:12})})]})]},M.id))})]}),c.jsx("div",{className:"h-px bg-slate-100"}),c.jsxs("div",{className:"flex flex-col gap-2.5",children:[c.jsxs("h3",{className:"text-xs font-semibold uppercase tracking-wider text-slate-500 flex items-center gap-1.5",children:[c.jsx(bv,{size:14})," Vector Store"]}),c.jsx("p",{className:"text-[10px] text-slate-500 leading-normal",children:"BGE embeddings (`BAAI/bge-small-en-v1.5`) are generated locally on SQLite modifications. If indices drift, trigger a full rebuild below."}),c.jsxs("button",{onClick:o,disabled:a,className:"flex items-center justify-center gap-2 w-full text-xs border p-2 rounded hover:bg-slate-50 text-slate-700 hover:text-slate-900 font-semibold shadow-subtle disabled:opacity-50",children:[c.jsx(vv,{size:12,className:a?"animate-spin":""}),a?"Reindexing...":"Re-index Knowledge Base"]})]}),c.jsx("div",{className:"h-px bg-slate-100"}),c.jsxs("div",{className:"flex flex-col gap-2.5",children:[c.jsxs("h3",{className:"text-xs font-semibold uppercase tracking-wider text-slate-500 flex items-center gap-1.5",children:[c.jsx(Id,{size:14})," Data Management"]}),c.jsx("p",{className:"text-[10px] text-slate-500 leading-normal",children:"Port your intelligence vaults, queries, and playbooks via `.slothkb` exports. Vector store will automatically rebuild on import."}),c.jsxs("div",{className:"grid grid-cols-2 gap-2 mt-1",children:[c.jsxs("button",{onClick:H,className:"flex items-center justify-center gap-1.5 border p-2 rounded hover:bg-slate-50 text-xs text-slate-700 hover:text-slate-900 font-semibold shadow-subtle",children:[c.jsx(Id,{size:12})," Export KB"]}),c.jsxs("label",{className:"flex items-center justify-center gap-1.5 border p-2 rounded hover:bg-slate-50 text-xs text-slate-700 hover:text-slate-900 font-semibold shadow-subtle cursor-pointer",children:[c.jsx(Nv,{size:12})," Import KB",c.jsx("input",{type:"file",accept:".slothkb",onChange:J,className:"hidden"})]})]}),$&&c.jsx("span",{className:"text-[10px] text-emerald-600 font-medium mt-1",children:$}),z&&c.jsx("span",{className:"text-[10px] text-rose-600 font-medium mt-1",children:z})]})]}),c.jsx("div",{className:"p-4 border-t bg-slate-50 flex items-center justify-center",children:c.jsx("span",{className:"text-[10px] text-slate-400 tracking-wider font-semibold",children:"SLOTHQUERY v1.0 — LOCAL ONLY"})})]})}function Pv(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const Rv=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Av=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Iv={};function Fd(e,t){return(Iv.jsx?Av:Rv).test(e)}const Lv=/[ \t\n\f\r]/g;function zv(e){return typeof e=="object"?e.type==="text"?Md(e.value):!1:Md(e)}function Md(e){return e.replace(Lv,"")===""}class ci{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}ci.prototype.normal={};ci.prototype.property={};ci.prototype.space=void 0;function yg(e,t){const n={},r={};for(const l of e)Object.assign(n,l.property),Object.assign(r,l.normal);return new ci(n,r,t)}function cu(e){return e.toLowerCase()}class xt{constructor(t,n){this.attribute=n,this.property=t}}xt.prototype.attribute="";xt.prototype.booleanish=!1;xt.prototype.boolean=!1;xt.prototype.commaOrSpaceSeparated=!1;xt.prototype.commaSeparated=!1;xt.prototype.defined=!1;xt.prototype.mustUseProperty=!1;xt.prototype.number=!1;xt.prototype.overloadedBoolean=!1;xt.prototype.property="";xt.prototype.spaceSeparated=!1;xt.prototype.space=void 0;let Ov=0;const le=dr(),Ie=dr(),fu=dr(),D=dr(),ye=dr(),tr=dr(),vt=dr();function dr(){return 2**++Ov}const du=Object.freeze(Object.defineProperty({__proto__:null,boolean:le,booleanish:Ie,commaOrSpaceSeparated:vt,commaSeparated:tr,number:D,overloadedBoolean:fu,spaceSeparated:ye},Symbol.toStringTag,{value:"Module"})),Go=Object.keys(du);class Cc extends xt{constructor(t,n,r,l){let i=-1;if(super(t,n),Bd(this,"space",l),typeof r=="number")for(;++i<Go.length;){const s=Go[i];Bd(this,Go[i],(r&du[s])===du[s])}}}Cc.prototype.defined=!0;function Bd(e,t,n){n&&(e[t]=n)}function nl(e){const t={},n={};for(const[r,l]of Object.entries(e.properties)){const i=new Cc(r,e.transform(e.attributes||{},r),l,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(i.mustUseProperty=!0),t[r]=i,n[cu(r)]=r,n[cu(i.attribute)]=r}return new ci(t,n,e.space)}const wg=nl({properties:{ariaActiveDescendant:null,ariaAtomic:Ie,ariaAutoComplete:null,ariaBusy:Ie,ariaChecked:Ie,ariaColCount:D,ariaColIndex:D,ariaColSpan:D,ariaControls:ye,ariaCurrent:null,ariaDescribedBy:ye,ariaDetails:null,ariaDisabled:Ie,ariaDropEffect:ye,ariaErrorMessage:null,ariaExpanded:Ie,ariaFlowTo:ye,ariaGrabbed:Ie,ariaHasPopup:null,ariaHidden:Ie,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:ye,ariaLevel:D,ariaLive:null,ariaModal:Ie,ariaMultiLine:Ie,ariaMultiSelectable:Ie,ariaOrientation:null,ariaOwns:ye,ariaPlaceholder:null,ariaPosInSet:D,ariaPressed:Ie,ariaReadOnly:Ie,ariaRelevant:null,ariaRequired:Ie,ariaRoleDescription:ye,ariaRowCount:D,ariaRowIndex:D,ariaRowSpan:D,ariaSelected:Ie,ariaSetSize:D,ariaSort:null,ariaValueMax:D,ariaValueMin:D,ariaValueNow:D,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function vg(e,t){return t in e?e[t]:t}function kg(e,t){return vg(e,t.toLowerCase())}const Dv=nl({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:tr,acceptCharset:ye,accessKey:ye,action:null,allow:null,allowFullScreen:le,allowPaymentRequest:le,allowUserMedia:le,alpha:le,alt:null,as:null,async:le,autoCapitalize:null,autoComplete:ye,autoFocus:le,autoPlay:le,blocking:ye,capture:null,charSet:null,checked:le,cite:null,className:ye,closedBy:null,colorSpace:null,cols:D,colSpan:D,command:null,commandFor:null,content:null,contentEditable:Ie,controls:le,controlsList:ye,coords:D|tr,crossOrigin:null,data:null,dateTime:null,decoding:null,default:le,defer:le,dir:null,dirName:null,disabled:le,download:fu,draggable:Ie,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:le,formTarget:null,headers:ye,height:D,hidden:fu,high:D,href:null,hrefLang:null,htmlFor:ye,httpEquiv:ye,id:null,imageSizes:null,imageSrcSet:null,inert:le,inputMode:null,integrity:null,is:null,isMap:le,itemId:null,itemProp:ye,itemRef:ye,itemScope:le,itemType:ye,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:le,low:D,manifest:null,max:null,maxLength:D,media:null,method:null,min:null,minLength:D,multiple:le,muted:le,name:null,nonce:null,noModule:le,noValidate:le,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:le,optimum:D,pattern:null,ping:ye,placeholder:null,playsInline:le,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:le,referrerPolicy:null,rel:ye,required:le,reversed:le,rows:D,rowSpan:D,sandbox:ye,scope:null,scoped:le,seamless:le,selected:le,shadowRootClonable:le,shadowRootCustomElementRegistry:le,shadowRootDelegatesFocus:le,shadowRootMode:null,shadowRootSerializable:le,shape:null,size:D,sizes:null,slot:null,span:D,spellCheck:Ie,src:null,srcDoc:null,srcLang:null,srcSet:null,start:D,step:null,style:null,tabIndex:D,target:null,title:null,translate:null,type:null,typeMustMatch:le,useMap:null,value:Ie,width:D,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:ye,axis:null,background:null,bgColor:null,border:D,borderColor:null,bottomMargin:D,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:le,declare:le,event:null,face:null,frame:null,frameBorder:null,hSpace:D,leftMargin:D,link:null,longDesc:null,lowSrc:null,marginHeight:D,marginWidth:D,noResize:le,noHref:le,noShade:le,noWrap:le,object:null,profile:null,prompt:null,rev:null,rightMargin:D,rules:null,scheme:null,scrolling:Ie,standby:null,summary:null,text:null,topMargin:D,valueType:null,version:null,vAlign:null,vLink:null,vSpace:D,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:le,disablePictureInPicture:le,disableRemotePlayback:le,exportParts:tr,part:ye,prefix:null,property:null,results:D,security:null,unselectable:null},space:"html",transform:kg}),Fv=nl({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",maskType:"mask-type",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:vt,accentHeight:D,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:D,amplitude:D,arabicForm:null,ascent:D,attributeName:null,attributeType:null,azimuth:D,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:D,by:null,calcMode:null,capHeight:D,className:ye,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:D,diffuseConstant:D,direction:null,display:null,dur:null,divisor:D,dominantBaseline:null,download:le,dx:null,dy:null,edgeMode:null,editable:null,elevation:D,enableBackground:null,end:null,event:null,exponent:D,externalResourcesRequired:null,fill:null,fillOpacity:D,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:tr,g2:tr,glyphName:tr,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:D,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:D,horizOriginX:D,horizOriginY:D,id:null,ideographic:D,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:D,k:D,k1:D,k2:D,k3:D,k4:D,kernelMatrix:vt,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:D,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskType:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:D,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:D,overlineThickness:D,paintOrder:null,panose1:null,path:null,pathLength:D,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:ye,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:D,pointsAtY:D,pointsAtZ:D,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:vt,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:vt,rev:vt,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:vt,requiredFeatures:vt,requiredFonts:vt,requiredFormats:vt,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:D,specularExponent:D,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:D,strikethroughThickness:D,string:null,stroke:null,strokeDashArray:vt,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:D,strokeOpacity:D,strokeWidth:null,style:null,surfaceScale:D,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:vt,tabIndex:D,tableValues:null,target:null,targetX:D,targetY:D,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:vt,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:D,underlineThickness:D,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:D,values:null,vAlphabetic:D,vMathematical:D,vectorEffect:null,vHanging:D,vIdeographic:D,version:null,vertAdvY:D,vertOriginX:D,vertOriginY:D,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:D,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:vg}),bg=nl({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()}}),Sg=nl({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:kg}),Cg=nl({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),Mv={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"},Bv=/[A-Z]/g,Ud=/-[a-z]/g,Uv=/^data[-\w.:]+$/i;function $v(e,t){const n=cu(t);let r=t,l=xt;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&Uv.test(t)){if(t.charAt(4)==="-"){const i=t.slice(5).replace(Ud,Vv);r="data"+i.charAt(0).toUpperCase()+i.slice(1)}else{const i=t.slice(4);if(!Ud.test(i)){let s=i.replace(Bv,Hv);s.charAt(0)!=="-"&&(s="-"+s),t="data"+s}}l=Cc}return new l(r,t)}function Hv(e){return"-"+e.toLowerCase()}function Vv(e){return e.charAt(1).toUpperCase()}const qv=yg([wg,Dv,bg,Sg,Cg],"html"),Nc=yg([wg,Fv,bg,Sg,Cg],"svg");function Wv(e){return e.join(" ").trim()}var Ec={},$d=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,Qv=/\n/g,Kv=/^\s*/,Xv=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,Yv=/^:\s*/,Gv=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,Jv=/^[;\s]*/,Zv=/^\s+|\s+$/g,ek=`
|
|
223
|
+
*/const Ev=me("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);function jv({activeView:e,setActiveView:t,chats:n,activeChatId:r,setActiveChatId:l,onCreateChat:i,onDeleteChat:s,toggleRightSidebar:o,isCollapsed:a,setIsCollapsed:u}){return a?c.jsxs("div",{className:"flex flex-col items-center justify-between border-r bg-slate-50 py-4 w-12 h-screen select-none transition-all duration-300 shrink-0",children:[c.jsxs("div",{className:"flex flex-col items-center gap-6 w-full",children:[c.jsx("button",{onClick:()=>u(!1),className:"p-1.5 rounded hover:bg-slate-200 text-slate-500",title:"Expand Sidebar",children:c.jsx(dv,{size:18})}),c.jsx("div",{className:"h-px bg-slate-200 w-8"}),c.jsx("button",{onClick:()=>{t("chat")},className:`p-2 rounded transition-colors ${e==="chat"?"bg-slate-200 text-slate-900 font-medium":"text-slate-600 hover:bg-slate-100"}`,title:"Chats",children:c.jsx(zd,{size:20})}),c.jsx("button",{onClick:()=>{t("studio")},className:`p-2 rounded transition-colors ${e==="studio"?"bg-slate-200 text-slate-900 font-medium":"text-slate-600 hover:bg-slate-100"}`,title:"Knowledge Studio",children:c.jsx(Rl,{size:20})}),c.jsx("button",{onClick:()=>{t("schema")},className:`p-2 rounded transition-colors ${e==="schema"?"bg-slate-200 text-slate-900 font-medium":"text-slate-600 hover:bg-slate-100"}`,title:"Schema & Playbooks",children:c.jsx(Ls,{size:20})})]}),c.jsx("button",{onClick:o,className:"p-2 rounded hover:bg-slate-200 text-slate-600",title:"Settings",children:c.jsx(uu,{size:20})})]}):c.jsxs("div",{className:"flex flex-col justify-between border-r bg-slate-50 w-64 h-screen select-none transition-all duration-300 relative shrink-0",children:[c.jsxs("div",{className:"flex flex-col overflow-y-auto flex-1 p-4 gap-4",children:[c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsx("h1",{className:"text-xl font-bold tracking-tight text-slate-900",children:"SlothQuery"}),c.jsx("button",{onClick:()=>u(!0),className:"p-1 rounded hover:bg-slate-200 text-slate-500",title:"Collapse Sidebar",children:c.jsx(fv,{size:16})})]}),c.jsx("div",{className:"h-px bg-slate-200 my-1"}),c.jsxs("div",{className:"flex flex-col gap-1",children:[c.jsxs("button",{onClick:()=>t("chat"),className:`flex items-center gap-2.5 px-3 py-2 text-sm rounded transition-colors ${e==="chat"?"bg-slate-200 text-slate-900 font-semibold":"text-slate-600 hover:bg-slate-100 hover:text-slate-900"}`,children:[c.jsx(zd,{size:16}),"Chats"]}),c.jsxs("button",{onClick:()=>t("studio"),className:`flex items-center gap-2.5 px-3 py-2 text-sm rounded transition-colors ${e==="studio"?"bg-slate-200 text-slate-900 font-semibold":"text-slate-600 hover:bg-slate-100 hover:text-slate-900"}`,children:[c.jsx(Rl,{size:16}),"Knowledge Studio"]}),c.jsxs("button",{onClick:()=>t("schema"),className:`flex items-center gap-2.5 px-3 py-2 text-sm rounded transition-colors ${e==="schema"?"bg-slate-200 text-slate-900 font-semibold":"text-slate-600 hover:bg-slate-100 hover:text-slate-900"}`,children:[c.jsx(Ls,{size:16}),"Schema Explorer"]})]}),c.jsx("div",{className:"h-px bg-slate-200 my-1"}),e==="chat"&&c.jsxs("div",{className:"flex flex-col gap-2 overflow-y-auto max-h-[40vh]",children:[c.jsxs("div",{className:"flex items-center justify-between px-1",children:[c.jsx("span",{className:"text-xs font-semibold uppercase tracking-wider text-slate-500",children:"Recent Chats"}),c.jsxs("button",{onClick:i,className:"flex items-center gap-1 text-xs text-slate-600 hover:text-slate-900 px-1 py-0.5 rounded hover:bg-slate-200 font-semibold",children:[c.jsx(Xr,{size:12})," New"]})]}),n.length===0?c.jsx("div",{className:"text-xs text-slate-400 italic px-2 py-4 text-center",children:"No chats created yet."}):c.jsx("div",{className:"flex flex-col gap-0.5",children:n.map(d=>c.jsxs("div",{className:`group flex items-center justify-between px-2.5 py-2 text-sm rounded cursor-pointer transition-colors ${r===d.id?"bg-slate-200 text-slate-900 font-semibold shadow-subtle":"text-slate-600 hover:bg-slate-100"}`,onClick:()=>l(d.id),children:[c.jsx("span",{className:"truncate flex-1 pr-2",children:d.title||"New Chat"}),c.jsx("button",{onClick:f=>{f.stopPropagation(),s(d.id)},className:"opacity-0 group-hover:opacity-100 p-0.5 hover:bg-slate-300 rounded text-slate-500 hover:text-slate-800 transition-opacity",children:c.jsx(Mr,{size:12})})]},d.id))})]})]}),c.jsx("div",{className:"p-4 border-t bg-slate-100/50",children:c.jsxs("button",{onClick:o,className:"flex items-center gap-2.5 w-full px-3 py-2 text-sm text-slate-600 hover:bg-slate-200 hover:text-slate-900 rounded transition-colors font-medium",children:[c.jsx(uu,{size:16}),"Settings & Configurations"]})})]})}const Dd=e=>{switch(e){case"openai":return"OpenAI API Key";case"anthropic":return"Anthropic API Key";case"google":return"Google Gemini API Key";case"groq":return"Groq API Key";case"openrouter":return"OpenRouter API Key";case"deepseek":return"DeepSeek API Key";default:return"API Key"}},_v=e=>{switch(e){case"openai":return"e.g. gpt-4o, gpt-4o-mini";case"anthropic":return"e.g. claude-3-5-sonnet-20241022";case"google":return"e.g. gemini-1.5-flash, gemini-1.5-pro";case"groq":return"e.g. llama-3.3-70b-versatile, mixtral-8x7b-32768";case"openrouter":return"e.g. google/gemma-2-9b-it:free";case"deepseek":return"e.g. deepseek-chat";default:return"e.g. model-name"}};function Tv({isOpen:e,onClose:t,providers:n,activeProviderId:r,onAddProvider:l,onSetActiveProvider:i,onDeleteProvider:s,onReindex:o,isReindexing:a}){const[u,d]=L.useState(!1),[f,p]=L.useState("openai"),[h,x]=L.useState(""),[v,S]=L.useState(""),[m,g]=L.useState(""),[y,E]=L.useState(!1),[T,b]=L.useState(!1),[_,I]=L.useState(null),[$,N]=L.useState(""),[z,U]=L.useState("");if(!e)return null;const ne=async()=>{var M,P;if(!v.trim()||!m.trim()){I({success:!1,message:"Model Name and API Key are required to test connection."});return}b(!0),I(null);try{await G.post("http://127.0.0.1:8000/api/providers/test",{provider_type:f,model_name:v,api_key:m}),I({success:!0,message:"Connection successful!"})}catch(B){I({success:!1,message:((P=(M=B.response)==null?void 0:M.data)==null?void 0:P.detail)||"Connection failed. Check your API key and model name."})}finally{b(!1)}},R=async M=>{var P,B;if(M.preventDefault(),!(!h.trim()||!v.trim()||!m.trim())){E(!0),I(null);try{await l({provider_type:f,profile_name:h,model_name:v,api_key:m}),x(""),S(""),g(""),d(!1)}catch(w){I({success:!1,message:((B=(P=w.response)==null?void 0:P.data)==null?void 0:B.detail)||"Failed to save provider config."})}finally{E(!1)}}},H=async()=>{try{window.open("http://127.0.0.1:8000/api/export","_blank")}catch(M){console.error("Export failed",M)}},J=async M=>{var w,Q,re;const P=(w=M.target.files)==null?void 0:w[0];if(!P)return;N("Importing..."),U("");const B=new FormData;B.append("file",P);try{await G.post("http://127.0.0.1:8000/api/import",B,{headers:{"Content-Type":"multipart/form-data"}}),N("Imported successfully! Rebuilding vector store..."),await o(),N("Import completed successfully!"),setTimeout(()=>{N("")},4e3)}catch(k){U(((re=(Q=k.response)==null?void 0:Q.data)==null?void 0:re.detail)||"Import failed"),N("")}};return c.jsxs("div",{className:"fixed right-0 top-0 z-40 bg-white border-l shadow-xl w-80 h-screen select-none flex flex-col justify-between transition-all duration-300",children:[c.jsxs("div",{className:"flex items-center justify-between p-4 border-b",children:[c.jsxs("h2",{className:"font-bold text-slate-850 text-sm flex items-center gap-1.5 text-slate-800",children:[c.jsx(gv,{size:16,className:"text-slate-700"})," Settings & Configs"]}),c.jsx("button",{onClick:t,className:"p-1 rounded hover:bg-slate-100 text-slate-500 hover:text-slate-800",children:c.jsx(Ev,{size:18})})]}),c.jsxs("div",{className:"flex-1 overflow-y-auto p-4 flex flex-col gap-6",children:[c.jsxs("div",{className:"flex flex-col gap-3",children:[c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsx("h3",{className:"text-[11px] font-bold uppercase tracking-wider text-slate-500 flex items-center gap-1.5",children:"LLM Profiles"}),c.jsxs("button",{onClick:()=>{d(!u),I(null)},className:"text-xs font-semibold text-blue-600 hover:text-blue-700 hover:underline flex items-center gap-1 px-1.5 py-0.5 rounded",children:[c.jsx(Xr,{size:12})," Add New"]})]}),u&&c.jsxs("form",{onSubmit:R,className:"p-3 border rounded-lg bg-slate-50 flex flex-col gap-2.5 shadow-subtle border-slate-200",children:[c.jsxs("div",{className:"flex flex-col gap-0.5",children:[c.jsx("label",{className:"text-[10px] font-bold text-slate-500",children:"Provider Type"}),c.jsxs("select",{value:f,onChange:M=>p(M.target.value),className:"text-xs border rounded p-1.5 bg-white text-slate-800 focus:outline-none focus:ring-1 focus:ring-slate-400",children:[c.jsx("option",{value:"openai",children:"OpenAI"}),c.jsx("option",{value:"anthropic",children:"Anthropic"}),c.jsx("option",{value:"google",children:"Google Gemini"}),c.jsx("option",{value:"groq",children:"Groq"}),c.jsx("option",{value:"openrouter",children:"OpenRouter"}),c.jsx("option",{value:"deepseek",children:"DeepSeek"})]})]}),c.jsxs("div",{className:"flex flex-col gap-0.5",children:[c.jsx("label",{className:"text-[10px] font-bold text-slate-500",children:"Profile Label / Name"}),c.jsx("input",{type:"text",value:h,onChange:M=>x(M.target.value),placeholder:"e.g. Work OpenRouter",className:"text-xs border rounded p-1.5 focus:outline-none focus:ring-1 focus:ring-slate-400 bg-white",required:!0})]}),c.jsxs("div",{className:"flex flex-col gap-0.5",children:[c.jsx("label",{className:"text-[10px] font-bold text-slate-500",children:"Model Name"}),c.jsx("input",{type:"text",value:v,onChange:M=>S(M.target.value),placeholder:_v(f),className:"text-xs border rounded p-1.5 focus:outline-none focus:ring-1 focus:ring-slate-400 bg-white font-mono",required:!0})]}),c.jsxs("div",{className:"flex flex-col gap-0.5",children:[c.jsx("label",{className:"text-[10px] font-bold text-slate-500",children:Dd(f)}),c.jsxs("div",{className:"relative",children:[c.jsx("input",{type:"password",value:m,onChange:M=>g(M.target.value),placeholder:`Enter ${Dd(f)}`,className:"text-xs border rounded p-1.5 w-full pr-7 focus:outline-none focus:ring-1 focus:ring-slate-400 bg-white",required:!0}),c.jsx(yv,{size:11,className:"absolute right-2 top-2.5 text-slate-400"})]})]}),_&&c.jsxs("div",{className:`p-2 rounded text-[10px] flex items-start gap-1.5 leading-normal max-w-full overflow-hidden ${_.success?"bg-emerald-50 text-emerald-800 border border-emerald-200":"bg-rose-50 text-rose-800 border border-rose-200"}`,children:[_.success?c.jsx(zs,{size:12,className:"shrink-0 mt-0.5 text-emerald-600"}):c.jsx(Cv,{size:12,className:"shrink-0 mt-0.5 text-rose-600"}),c.jsx("span",{className:"break-words break-all font-medium flex-1 min-w-0",children:_.message})]}),c.jsxs("div",{className:"flex justify-end gap-1.5 mt-1 border-t pt-2 border-slate-200",children:[c.jsx("button",{type:"button",onClick:()=>{d(!1),I(null)},className:"text-[10px] font-bold px-2.5 py-1.5 border rounded hover:bg-white text-slate-600",children:"Cancel"}),c.jsx("button",{type:"button",onClick:ne,disabled:T||y,className:"text-[10px] font-bold bg-white border border-slate-350 hover:bg-slate-100 text-slate-700 px-2.5 py-1.5 rounded disabled:opacity-50",children:T?"Testing...":"Test Connection"}),c.jsx("button",{type:"submit",disabled:y||T,className:"text-[10px] font-bold bg-blue-600 hover:bg-blue-700 text-white px-2.5 py-1.5 rounded disabled:opacity-50",children:y?"Saving...":"Save & Activate"})]})]}),c.jsx("div",{className:"max-h-56 overflow-y-auto flex flex-col gap-1.5 border border-slate-100 p-1 rounded-lg bg-slate-50/50",children:n.length===0?c.jsx("div",{className:"text-xs text-slate-400 italic py-6 text-center",children:"No profiles configured yet."}):n.map(M=>c.jsxs("div",{className:`flex items-center justify-between p-2.5 rounded-lg border text-xs cursor-pointer transition-colors ${M.is_active?"bg-white border-blue-500 font-medium shadow-subtle":"bg-white hover:bg-slate-50 border-slate-200"}`,onClick:()=>i(M.id),children:[c.jsxs("div",{className:"flex flex-col gap-0.5 truncate flex-1 pr-2",children:[c.jsx("span",{className:"truncate text-slate-800 font-semibold",children:M.profile_name}),c.jsxs("span",{className:"text-[9px] text-slate-500 uppercase tracking-tight font-mono",children:[M.provider_type," • ",M.model_name]})]}),c.jsxs("div",{className:"flex items-center gap-2",children:[M.is_active&&c.jsx("span",{className:"text-[9px] bg-blue-50 text-blue-700 border border-blue-200 px-1.5 py-0.5 rounded font-bold uppercase tracking-wider",children:"Active"}),c.jsx("button",{onClick:P=>{P.stopPropagation(),s(M.id)},className:"p-1 hover:bg-slate-100 rounded text-slate-400 hover:text-rose-600 transition-colors",children:c.jsx(Mr,{size:12})})]})]},M.id))})]}),c.jsx("div",{className:"h-px bg-slate-100"}),c.jsxs("div",{className:"flex flex-col gap-2.5",children:[c.jsxs("h3",{className:"text-xs font-semibold uppercase tracking-wider text-slate-500 flex items-center gap-1.5",children:[c.jsx(bv,{size:14})," Vector Store"]}),c.jsx("p",{className:"text-[10px] text-slate-500 leading-normal",children:"BGE embeddings (`BAAI/bge-small-en-v1.5`) are generated locally on SQLite modifications. If indices drift, trigger a full rebuild below."}),c.jsxs("button",{onClick:o,disabled:a,className:"flex items-center justify-center gap-2 w-full text-xs border p-2 rounded hover:bg-slate-50 text-slate-700 hover:text-slate-900 font-semibold shadow-subtle disabled:opacity-50",children:[c.jsx(vv,{size:12,className:a?"animate-spin":""}),a?"Reindexing...":"Re-index Knowledge Base"]})]}),c.jsx("div",{className:"h-px bg-slate-100"}),c.jsxs("div",{className:"flex flex-col gap-2.5",children:[c.jsxs("h3",{className:"text-xs font-semibold uppercase tracking-wider text-slate-500 flex items-center gap-1.5",children:[c.jsx(Id,{size:14})," Data Management"]}),c.jsx("p",{className:"text-[10px] text-slate-500 leading-normal",children:"Port your intelligence vaults, queries, and playbooks via `.slothkb` exports. Vector store will automatically rebuild on import."}),c.jsxs("div",{className:"grid grid-cols-2 gap-2 mt-1",children:[c.jsxs("button",{onClick:H,className:"flex items-center justify-center gap-1.5 border p-2 rounded hover:bg-slate-50 text-xs text-slate-700 hover:text-slate-900 font-semibold shadow-subtle",children:[c.jsx(Id,{size:12})," Export KB"]}),c.jsxs("label",{className:"flex items-center justify-center gap-1.5 border p-2 rounded hover:bg-slate-50 text-xs text-slate-700 hover:text-slate-900 font-semibold shadow-subtle cursor-pointer",children:[c.jsx(Nv,{size:12})," Import KB",c.jsx("input",{type:"file",accept:".slothkb",onChange:J,className:"hidden"})]})]}),$&&c.jsx("span",{className:"text-[10px] text-emerald-600 font-medium mt-1",children:$}),z&&c.jsx("span",{className:"text-[10px] text-rose-600 font-medium mt-1",children:z})]})]}),c.jsx("div",{className:"p-4 border-t bg-slate-50 flex items-center justify-center",children:c.jsx("span",{className:"text-[10px] text-slate-400 tracking-wider font-semibold",children:"SLOTHQUERY v1.0 — LOCAL ONLY"})})]})}function Pv(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const Rv=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Av=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Iv={};function Fd(e,t){return(Iv.jsx?Av:Rv).test(e)}const Lv=/[ \t\n\f\r]/g;function zv(e){return typeof e=="object"?e.type==="text"?Md(e.value):!1:Md(e)}function Md(e){return e.replace(Lv,"")===""}class ci{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}ci.prototype.normal={};ci.prototype.property={};ci.prototype.space=void 0;function yg(e,t){const n={},r={};for(const l of e)Object.assign(n,l.property),Object.assign(r,l.normal);return new ci(n,r,t)}function cu(e){return e.toLowerCase()}class xt{constructor(t,n){this.attribute=n,this.property=t}}xt.prototype.attribute="";xt.prototype.booleanish=!1;xt.prototype.boolean=!1;xt.prototype.commaOrSpaceSeparated=!1;xt.prototype.commaSeparated=!1;xt.prototype.defined=!1;xt.prototype.mustUseProperty=!1;xt.prototype.number=!1;xt.prototype.overloadedBoolean=!1;xt.prototype.property="";xt.prototype.spaceSeparated=!1;xt.prototype.space=void 0;let Ov=0;const le=dr(),Ie=dr(),fu=dr(),D=dr(),ye=dr(),tr=dr(),vt=dr();function dr(){return 2**++Ov}const du=Object.freeze(Object.defineProperty({__proto__:null,boolean:le,booleanish:Ie,commaOrSpaceSeparated:vt,commaSeparated:tr,number:D,overloadedBoolean:fu,spaceSeparated:ye},Symbol.toStringTag,{value:"Module"})),Go=Object.keys(du);class Cc extends xt{constructor(t,n,r,l){let i=-1;if(super(t,n),Bd(this,"space",l),typeof r=="number")for(;++i<Go.length;){const s=Go[i];Bd(this,Go[i],(r&du[s])===du[s])}}}Cc.prototype.defined=!0;function Bd(e,t,n){n&&(e[t]=n)}function nl(e){const t={},n={};for(const[r,l]of Object.entries(e.properties)){const i=new Cc(r,e.transform(e.attributes||{},r),l,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(i.mustUseProperty=!0),t[r]=i,n[cu(r)]=r,n[cu(i.attribute)]=r}return new ci(t,n,e.space)}const wg=nl({properties:{ariaActiveDescendant:null,ariaAtomic:Ie,ariaAutoComplete:null,ariaBusy:Ie,ariaChecked:Ie,ariaColCount:D,ariaColIndex:D,ariaColSpan:D,ariaControls:ye,ariaCurrent:null,ariaDescribedBy:ye,ariaDetails:null,ariaDisabled:Ie,ariaDropEffect:ye,ariaErrorMessage:null,ariaExpanded:Ie,ariaFlowTo:ye,ariaGrabbed:Ie,ariaHasPopup:null,ariaHidden:Ie,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:ye,ariaLevel:D,ariaLive:null,ariaModal:Ie,ariaMultiLine:Ie,ariaMultiSelectable:Ie,ariaOrientation:null,ariaOwns:ye,ariaPlaceholder:null,ariaPosInSet:D,ariaPressed:Ie,ariaReadOnly:Ie,ariaRelevant:null,ariaRequired:Ie,ariaRoleDescription:ye,ariaRowCount:D,ariaRowIndex:D,ariaRowSpan:D,ariaSelected:Ie,ariaSetSize:D,ariaSort:null,ariaValueMax:D,ariaValueMin:D,ariaValueNow:D,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function vg(e,t){return t in e?e[t]:t}function kg(e,t){return vg(e,t.toLowerCase())}const Dv=nl({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:tr,acceptCharset:ye,accessKey:ye,action:null,allow:null,allowFullScreen:le,allowPaymentRequest:le,allowUserMedia:le,alpha:le,alt:null,as:null,async:le,autoCapitalize:null,autoComplete:ye,autoFocus:le,autoPlay:le,blocking:ye,capture:null,charSet:null,checked:le,cite:null,className:ye,closedBy:null,colorSpace:null,cols:D,colSpan:D,command:null,commandFor:null,content:null,contentEditable:Ie,controls:le,controlsList:ye,coords:D|tr,crossOrigin:null,data:null,dateTime:null,decoding:null,default:le,defer:le,dir:null,dirName:null,disabled:le,download:fu,draggable:Ie,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:le,formTarget:null,headers:ye,height:D,hidden:fu,high:D,href:null,hrefLang:null,htmlFor:ye,httpEquiv:ye,id:null,imageSizes:null,imageSrcSet:null,inert:le,inputMode:null,integrity:null,is:null,isMap:le,itemId:null,itemProp:ye,itemRef:ye,itemScope:le,itemType:ye,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:le,low:D,manifest:null,max:null,maxLength:D,media:null,method:null,min:null,minLength:D,multiple:le,muted:le,name:null,nonce:null,noModule:le,noValidate:le,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:le,optimum:D,pattern:null,ping:ye,placeholder:null,playsInline:le,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:le,referrerPolicy:null,rel:ye,required:le,reversed:le,rows:D,rowSpan:D,sandbox:ye,scope:null,scoped:le,seamless:le,selected:le,shadowRootClonable:le,shadowRootCustomElementRegistry:le,shadowRootDelegatesFocus:le,shadowRootMode:null,shadowRootSerializable:le,shape:null,size:D,sizes:null,slot:null,span:D,spellCheck:Ie,src:null,srcDoc:null,srcLang:null,srcSet:null,start:D,step:null,style:null,tabIndex:D,target:null,title:null,translate:null,type:null,typeMustMatch:le,useMap:null,value:Ie,width:D,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:ye,axis:null,background:null,bgColor:null,border:D,borderColor:null,bottomMargin:D,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:le,declare:le,event:null,face:null,frame:null,frameBorder:null,hSpace:D,leftMargin:D,link:null,longDesc:null,lowSrc:null,marginHeight:D,marginWidth:D,noResize:le,noHref:le,noShade:le,noWrap:le,object:null,profile:null,prompt:null,rev:null,rightMargin:D,rules:null,scheme:null,scrolling:Ie,standby:null,summary:null,text:null,topMargin:D,valueType:null,version:null,vAlign:null,vLink:null,vSpace:D,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:le,disablePictureInPicture:le,disableRemotePlayback:le,exportParts:tr,part:ye,prefix:null,property:null,results:D,security:null,unselectable:null},space:"html",transform:kg}),Fv=nl({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",maskType:"mask-type",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:vt,accentHeight:D,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:D,amplitude:D,arabicForm:null,ascent:D,attributeName:null,attributeType:null,azimuth:D,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:D,by:null,calcMode:null,capHeight:D,className:ye,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:D,diffuseConstant:D,direction:null,display:null,dur:null,divisor:D,dominantBaseline:null,download:le,dx:null,dy:null,edgeMode:null,editable:null,elevation:D,enableBackground:null,end:null,event:null,exponent:D,externalResourcesRequired:null,fill:null,fillOpacity:D,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:tr,g2:tr,glyphName:tr,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:D,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:D,horizOriginX:D,horizOriginY:D,id:null,ideographic:D,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:D,k:D,k1:D,k2:D,k3:D,k4:D,kernelMatrix:vt,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:D,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskType:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:D,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:D,overlineThickness:D,paintOrder:null,panose1:null,path:null,pathLength:D,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:ye,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:D,pointsAtY:D,pointsAtZ:D,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:vt,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:vt,rev:vt,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:vt,requiredFeatures:vt,requiredFonts:vt,requiredFormats:vt,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:D,specularExponent:D,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:D,strikethroughThickness:D,string:null,stroke:null,strokeDashArray:vt,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:D,strokeOpacity:D,strokeWidth:null,style:null,surfaceScale:D,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:vt,tabIndex:D,tableValues:null,target:null,targetX:D,targetY:D,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:vt,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:D,underlineThickness:D,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:D,values:null,vAlphabetic:D,vMathematical:D,vectorEffect:null,vHanging:D,vIdeographic:D,version:null,vertAdvY:D,vertOriginX:D,vertOriginY:D,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:D,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:vg}),bg=nl({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()}}),Sg=nl({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:kg}),Cg=nl({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),Mv={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"},Bv=/[A-Z]/g,Ud=/-[a-z]/g,Uv=/^data[-\w.:]+$/i;function $v(e,t){const n=cu(t);let r=t,l=xt;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&Uv.test(t)){if(t.charAt(4)==="-"){const i=t.slice(5).replace(Ud,Vv);r="data"+i.charAt(0).toUpperCase()+i.slice(1)}else{const i=t.slice(4);if(!Ud.test(i)){let s=i.replace(Bv,Hv);s.charAt(0)!=="-"&&(s="-"+s),t="data"+s}}l=Cc}return new l(r,t)}function Hv(e){return"-"+e.toLowerCase()}function Vv(e){return e.charAt(1).toUpperCase()}const qv=yg([wg,Dv,bg,Sg,Cg],"html"),Nc=yg([wg,Fv,bg,Sg,Cg],"svg");function Wv(e){return e.join(" ").trim()}var Ec={},$d=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,Qv=/\n/g,Kv=/^\s*/,Xv=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,Yv=/^:\s*/,Gv=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,Jv=/^[;\s]*/,Zv=/^\s+|\s+$/g,ek=`
|
|
224
224
|
`,Hd="/",Vd="*",Qn="",tk="comment",nk="declaration";function rk(e,t){if(typeof e!="string")throw new TypeError("First argument must be a string");if(!e)return[];t=t||{};var n=1,r=1;function l(x){var v=x.match(Qv);v&&(n+=v.length);var S=x.lastIndexOf(ek);r=~S?x.length-S:r+x.length}function i(){var x={line:n,column:r};return function(v){return v.position=new s(x),u(),v}}function s(x){this.start=x,this.end={line:n,column:r},this.source=t.source}s.prototype.content=e;function o(x){var v=new Error(t.source+":"+n+":"+r+": "+x);if(v.reason=x,v.filename=t.source,v.line=n,v.column=r,v.source=e,!t.silent)throw v}function a(x){var v=x.exec(e);if(v){var S=v[0];return l(S),e=e.slice(S.length),v}}function u(){a(Kv)}function d(x){var v;for(x=x||[];v=f();)v!==!1&&x.push(v);return x}function f(){var x=i();if(!(Hd!=e.charAt(0)||Vd!=e.charAt(1))){for(var v=2;Qn!=e.charAt(v)&&(Vd!=e.charAt(v)||Hd!=e.charAt(v+1));)++v;if(v+=2,Qn===e.charAt(v-1))return o("End of comment missing");var S=e.slice(2,v-2);return r+=2,l(S),e=e.slice(v),r+=2,x({type:tk,comment:S})}}function p(){var x=i(),v=a(Xv);if(v){if(f(),!a(Yv))return o("property missing ':'");var S=a(Gv),m=x({type:nk,property:qd(v[0].replace($d,Qn)),value:S?qd(S[0].replace($d,Qn)):Qn});return a(Jv),m}}function h(){var x=[];d(x);for(var v;v=p();)v!==!1&&(x.push(v),d(x));return x}return u(),h()}function qd(e){return e?e.replace(Zv,Qn):Qn}var lk=rk,ik=ss&&ss.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Ec,"__esModule",{value:!0});Ec.default=ok;const sk=ik(lk);function ok(e,t){let n=null;if(!e||typeof e!="string")return n;const r=(0,sk.default)(e),l=typeof t=="function";return r.forEach(i=>{if(i.type!=="declaration")return;const{property:s,value:o}=i;l?t(s,o,i):o&&(n=n||{},n[s]=o)}),n}var io={};Object.defineProperty(io,"__esModule",{value:!0});io.camelCase=void 0;var ak=/^--[a-zA-Z0-9_-]+$/,uk=/-([a-z])/g,ck=/^[^-]+$/,fk=/^-(webkit|moz|ms|o|khtml)-/,dk=/^-(ms)-/,pk=function(e){return!e||ck.test(e)||ak.test(e)},hk=function(e,t){return t.toUpperCase()},Wd=function(e,t){return"".concat(t,"-")},mk=function(e,t){return t===void 0&&(t={}),pk(e)?e:(e=e.toLowerCase(),t.reactCompat?e=e.replace(dk,Wd):e=e.replace(fk,Wd),e.replace(uk,hk))};io.camelCase=mk;var gk=ss&&ss.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},xk=gk(Ec),yk=io;function pu(e,t){var n={};return!e||typeof e!="string"||(0,xk.default)(e,function(r,l){r&&l&&(n[(0,yk.camelCase)(r,t)]=l)}),n}pu.default=pu;var wk=pu;const vk=bu(wk),Ng=Eg("end"),jc=Eg("start");function Eg(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 kk(e){const t=jc(e),n=Ng(e);if(t&&n)return{start:t,end:n}}function Al(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?Qd(e.position):"start"in e||"end"in e?Qd(e):"line"in e||"column"in e?hu(e):""}function hu(e){return Kd(e&&e.line)+":"+Kd(e&&e.column)}function Qd(e){return hu(e&&e.start)+"-"+hu(e&&e.end)}function Kd(e){return e&&typeof e=="number"?e:1}class et extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let l="",i={},s=!1;if(n&&("line"in n&&"column"in n?i={place:n}:"start"in n&&"end"in n?i={place:n}:"type"in n?i={ancestors:[n],place:n.position}:i={...n}),typeof t=="string"?l=t:!i.cause&&t&&(s=!0,l=t.message,i.cause=t),!i.ruleId&&!i.source&&typeof r=="string"){const a=r.indexOf(":");a===-1?i.ruleId=r:(i.source=r.slice(0,a),i.ruleId=r.slice(a+1))}if(!i.place&&i.ancestors&&i.ancestors){const a=i.ancestors[i.ancestors.length-1];a&&(i.place=a.position)}const o=i.place&&"start"in i.place?i.place.start:i.place;this.ancestors=i.ancestors||void 0,this.cause=i.cause||void 0,this.column=o?o.column:void 0,this.fatal=void 0,this.file="",this.message=l,this.line=o?o.line:void 0,this.name=Al(i.place)||"1:1",this.place=i.place||void 0,this.reason=this.message,this.ruleId=i.ruleId||void 0,this.source=i.source||void 0,this.stack=s&&i.cause&&typeof i.cause.stack=="string"?i.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}et.prototype.file="";et.prototype.name="";et.prototype.reason="";et.prototype.message="";et.prototype.stack="";et.prototype.column=void 0;et.prototype.line=void 0;et.prototype.ancestors=void 0;et.prototype.cause=void 0;et.prototype.fatal=void 0;et.prototype.place=void 0;et.prototype.ruleId=void 0;et.prototype.source=void 0;const _c={}.hasOwnProperty,bk=new Map,Sk=/[A-Z]/g,Ck=new Set(["table","tbody","thead","tfoot","tr"]),Nk=new Set(["td","th"]),jg="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function Ek(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=Lk(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=Ik(n,t.jsx,t.jsxs)}const l={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"?Nc:qv,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},i=_g(l,e,void 0);return i&&typeof i!="string"?i:l.create(e,l.Fragment,{children:i||void 0},void 0)}function _g(e,t,n){if(t.type==="element")return jk(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return _k(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return Pk(e,t,n);if(t.type==="mdxjsEsm")return Tk(e,t);if(t.type==="root")return Rk(e,t,n);if(t.type==="text")return Ak(e,t)}function jk(e,t,n){const r=e.schema;let l=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(l=Nc,e.schema=l),e.ancestors.push(t);const i=Pg(e,t.tagName,!1),s=zk(e,t);let o=Pc(e,t);return Ck.has(t.tagName)&&(o=o.filter(function(a){return typeof a=="string"?!zv(a):!0})),Tg(e,s,i,t),Tc(s,o),e.ancestors.pop(),e.schema=r,e.create(t,i,s,n)}function _k(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)}Zl(e,t.position)}function Tk(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Zl(e,t.position)}function Pk(e,t,n){const r=e.schema;let l=r;t.name==="svg"&&r.space==="html"&&(l=Nc,e.schema=l),e.ancestors.push(t);const i=t.name===null?e.Fragment:Pg(e,t.name,!0),s=Ok(e,t),o=Pc(e,t);return Tg(e,s,i,t),Tc(s,o),e.ancestors.pop(),e.schema=r,e.create(t,i,s,n)}function Rk(e,t,n){const r={};return Tc(r,Pc(e,t)),e.create(t,e.Fragment,r,n)}function Ak(e,t){return t.value}function Tg(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function Tc(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function Ik(e,t,n){return r;function r(l,i,s,o){const u=Array.isArray(s.children)?n:t;return o?u(i,s,o):u(i,s)}}function Lk(e,t){return n;function n(r,l,i,s){const o=Array.isArray(i.children),a=jc(r);return t(l,i,s,o,{columnNumber:a?a.column-1:void 0,fileName:e,lineNumber:a?a.line:void 0},void 0)}}function zk(e,t){const n={};let r,l;for(l in t.properties)if(l!=="children"&&_c.call(t.properties,l)){const i=Dk(e,l,t.properties[l]);if(i){const[s,o]=i;e.tableCellAlignToStyle&&s==="align"&&typeof o=="string"&&Nk.has(t.tagName)?r=o:n[s]=o}}if(r){const i=n.style||(n.style={});i[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function Ok(e,t){const n={};for(const r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const i=r.data.estree.body[0];i.type;const s=i.expression;s.type;const o=s.properties[0];o.type,Object.assign(n,e.evaluater.evaluateExpression(o.argument))}else Zl(e,t.position);else{const l=r.name;let i;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const o=r.value.data.estree.body[0];o.type,i=e.evaluater.evaluateExpression(o.expression)}else Zl(e,t.position);else i=r.value===null?!0:r.value;n[l]=i}return n}function Pc(e,t){const n=[];let r=-1;const l=e.passKeys?new Map:bk;for(;++r<t.children.length;){const i=t.children[r];let s;if(e.passKeys){const a=i.type==="element"?i.tagName:i.type==="mdxJsxFlowElement"||i.type==="mdxJsxTextElement"?i.name:void 0;if(a){const u=l.get(a)||0;s=a+"-"+u,l.set(a,u+1)}}const o=_g(e,i,s);o!==void 0&&n.push(o)}return n}function Dk(e,t,n){const r=$v(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?Pv(n):Wv(n)),r.property==="style"){let l=typeof n=="object"?n:Fk(e,String(n));return e.stylePropertyNameCase==="css"&&(l=Mk(l)),["style",l]}return[e.elementAttributeNameCase==="react"&&r.space?Mv[r.property]||r.property:r.attribute,n]}}function Fk(e,t){try{return vk(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const r=n,l=new et("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:r,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw l.file=e.filePath||void 0,l.url=jg+"#cannot-parse-style-attribute",l}}function Pg(e,t,n){let r;if(!n)r={type:"Literal",value:t};else if(t.includes(".")){const l=t.split(".");let i=-1,s;for(;++i<l.length;){const o=Fd(l[i])?{type:"Identifier",name:l[i]}:{type:"Literal",value:l[i]};s=s?{type:"MemberExpression",object:s,property:o,computed:!!(i&&o.type==="Literal"),optional:!1}:o}r=s}else r=Fd(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const l=r.value;return _c.call(e.components,l)?e.components[l]:l}if(e.evaluater)return e.evaluater.evaluateExpression(r);Zl(e)}function Zl(e,t){const n=new et("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=jg+"#cannot-handle-mdx-estrees-without-createevaluater",n}function Mk(e){const t={};let n;for(n in e)_c.call(e,n)&&(t[Bk(n)]=e[n]);return t}function Bk(e){let t=e.replace(Sk,Uk);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function Uk(e){return"-"+e.toLowerCase()}const Jo={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"]},$k={};function Rc(e,t){const n=$k,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,l=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return Rg(e,r,l)}function Rg(e,t,n){if(Hk(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 Xd(e.children,t,n)}return Array.isArray(e)?Xd(e,t,n):""}function Xd(e,t,n){const r=[];let l=-1;for(;++l<e.length;)r[l]=Rg(e[l],t,n);return r.join("")}function Hk(e){return!!(e&&typeof e=="object")}const Yd=document.createElement("i");function Ac(e){const t="&"+e+";";Yd.innerHTML=t;const n=Yd.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function Ct(e,t,n,r){const l=e.length;let i=0,s;if(t<0?t=-t>l?0:l+t:t=t>l?l:t,n=n>0?n:0,r.length<1e4)s=Array.from(r),s.unshift(t,n),e.splice(...s);else for(n&&e.splice(t,n);i<r.length;)s=r.slice(i,i+1e4),s.unshift(t,0),e.splice(...s),i+=1e4,t+=1e4}function Rt(e,t){return e.length>0?(Ct(e,e.length,0,t),e):t}const Gd={}.hasOwnProperty;function Ag(e){const t={};let n=-1;for(;++n<e.length;)Vk(t,e[n]);return t}function Vk(e,t){let n;for(n in t){const l=(Gd.call(e,n)?e[n]:void 0)||(e[n]={}),i=t[n];let s;if(i)for(s in i){Gd.call(l,s)||(l[s]=[]);const o=i[s];qk(l[s],Array.isArray(o)?o:o?[o]:[])}}}function qk(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);Ct(e,0,0,r)}function Ig(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 Ht(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const it=Un(/[A-Za-z]/),Ge=Un(/[\dA-Za-z]/),Wk=Un(/[#-'*+\--9=?A-Z^-~]/);function Os(e){return e!==null&&(e<32||e===127)}const mu=Un(/\d/),Qk=Un(/[\dA-Fa-f]/),Kk=Un(/[!-/:-@[-`{-~]/);function Z(e){return e!==null&&e<-2}function we(e){return e!==null&&(e<0||e===32)}function ae(e){return e===-2||e===-1||e===32}const so=Un(new RegExp("\\p{P}|\\p{S}","u")),ur=Un(/\s/);function Un(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function rl(e){const t=[];let n=-1,r=0,l=0;for(;++n<e.length;){const i=e.charCodeAt(n);let s="";if(i===37&&Ge(e.charCodeAt(n+1))&&Ge(e.charCodeAt(n+2)))l=2;else if(i<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(i))||(s=String.fromCharCode(i));else if(i>55295&&i<57344){const o=e.charCodeAt(n+1);i<56320&&o>56319&&o<57344?(s=String.fromCharCode(i,o),l=1):s="�"}else s=String.fromCharCode(i);s&&(t.push(e.slice(r,n),encodeURIComponent(s)),r=n+l+1,s=""),l&&(n+=l,l=0)}return t.join("")+e.slice(r)}function ce(e,t,n,r){const l=r?r-1:Number.POSITIVE_INFINITY;let i=0;return s;function s(a){return ae(a)?(e.enter(n),o(a)):t(a)}function o(a){return ae(a)&&i++<l?(e.consume(a),o):(e.exit(n),t(a))}}const Xk={tokenize:Yk};function Yk(e){const t=e.attempt(this.parser.constructs.contentInitial,r,l);let n;return t;function r(o){if(o===null){e.consume(o);return}return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),ce(e,t,"linePrefix")}function l(o){return e.enter("paragraph"),i(o)}function i(o){const a=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=a),n=a,s(o)}function s(o){if(o===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(o);return}return Z(o)?(e.consume(o),e.exit("chunkText"),i):(e.consume(o),s)}}const Gk={tokenize:Jk},Jd={tokenize:Zk};function Jk(e){const t=this,n=[];let r=0,l,i,s;return o;function o(y){if(r<n.length){const E=n[r];return t.containerState=E[1],e.attempt(E[0].continuation,a,u)(y)}return u(y)}function a(y){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,l&&g();const E=t.events.length;let T=E,b;for(;T--;)if(t.events[T][0]==="exit"&&t.events[T][1].type==="chunkFlow"){b=t.events[T][1].end;break}m(r);let _=E;for(;_<t.events.length;)t.events[_][1].end={...b},_++;return Ct(t.events,T+1,0,t.events.slice(E)),t.events.length=_,u(y)}return o(y)}function u(y){if(r===n.length){if(!l)return p(y);if(l.currentConstruct&&l.currentConstruct.concrete)return x(y);t.interrupt=!!(l.currentConstruct&&!l._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(Jd,d,f)(y)}function d(y){return l&&g(),m(r),p(y)}function f(y){return t.parser.lazy[t.now().line]=r!==n.length,s=t.now().offset,x(y)}function p(y){return t.containerState={},e.attempt(Jd,h,x)(y)}function h(y){return r++,n.push([t.currentConstruct,t.containerState]),p(y)}function x(y){if(y===null){l&&g(),m(0),e.consume(y);return}return l=l||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:l,contentType:"flow",previous:i}),v(y)}function v(y){if(y===null){S(e.exit("chunkFlow"),!0),m(0),e.consume(y);return}return Z(y)?(e.consume(y),S(e.exit("chunkFlow")),r=0,t.interrupt=void 0,o):(e.consume(y),v)}function S(y,E){const T=t.sliceStream(y);if(E&&T.push(null),y.previous=i,i&&(i.next=y),i=y,l.defineSkip(y.start),l.write(T),t.parser.lazy[y.start.line]){let b=l.events.length;for(;b--;)if(l.events[b][1].start.offset<s&&(!l.events[b][1].end||l.events[b][1].end.offset>s))return;const _=t.events.length;let I=_,$,N;for(;I--;)if(t.events[I][0]==="exit"&&t.events[I][1].type==="chunkFlow"){if($){N=t.events[I][1].end;break}$=!0}for(m(r),b=_;b<t.events.length;)t.events[b][1].end={...N},b++;Ct(t.events,I+1,0,t.events.slice(_)),t.events.length=b}}function m(y){let E=n.length;for(;E-- >y;){const T=n[E];t.containerState=T[1],T[0].exit.call(t,e)}n.length=y}function g(){l.write([null]),i=void 0,l=void 0,t.containerState._closeFlow=void 0}}function Zk(e,t,n){return ce(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Yr(e){if(e===null||we(e)||ur(e))return 1;if(so(e))return 2}function oo(e,t,n){const r=[];let l=-1;for(;++l<e.length;){const i=e[l].resolveAll;i&&!r.includes(i)&&(t=i(t,n),r.push(i))}return t}const gu={name:"attention",resolveAll:eb,tokenize:tb};function eb(e,t){let n=-1,r,l,i,s,o,a,u,d;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;a=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 f={...e[r][1].end},p={...e[n][1].start};Zd(f,-a),Zd(p,a),s={type:a>1?"strongSequence":"emphasisSequence",start:f,end:{...e[r][1].end}},o={type:a>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:p},i={type:a>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[n][1].start}},l={type:a>1?"strong":"emphasis",start:{...s.start},end:{...o.end}},e[r][1].end={...s.start},e[n][1].start={...o.end},u=[],e[r][1].end.offset-e[r][1].start.offset&&(u=Rt(u,[["enter",e[r][1],t],["exit",e[r][1],t]])),u=Rt(u,[["enter",l,t],["enter",s,t],["exit",s,t],["enter",i,t]]),u=Rt(u,oo(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),u=Rt(u,[["exit",i,t],["enter",o,t],["exit",o,t],["exit",l,t]]),e[n][1].end.offset-e[n][1].start.offset?(d=2,u=Rt(u,[["enter",e[n][1],t],["exit",e[n][1],t]])):d=0,Ct(e,r-1,n-r+3,u),n=r+u.length-d-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function tb(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,l=Yr(r);let i;return s;function s(a){return i=a,e.enter("attentionSequence"),o(a)}function o(a){if(a===i)return e.consume(a),o;const u=e.exit("attentionSequence"),d=Yr(a),f=!d||d===2&&l||n.includes(a),p=!l||l===2&&d||n.includes(r);return u._open=!!(i===42?f:f&&(l||!p)),u._close=!!(i===42?p:p&&(d||!f)),t(a)}}function Zd(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const nb={name:"autolink",tokenize:rb};function rb(e,t,n){let r=0;return l;function l(h){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(h),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),i}function i(h){return it(h)?(e.consume(h),s):h===64?n(h):u(h)}function s(h){return h===43||h===45||h===46||Ge(h)?(r=1,o(h)):u(h)}function o(h){return h===58?(e.consume(h),r=0,a):(h===43||h===45||h===46||Ge(h))&&r++<32?(e.consume(h),o):(r=0,u(h))}function a(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||Os(h)?n(h):(e.consume(h),a)}function u(h){return h===64?(e.consume(h),d):Wk(h)?(e.consume(h),u):n(h)}function d(h){return Ge(h)?f(h):n(h)}function f(h){return h===46?(e.consume(h),r=0,d):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||Ge(h))&&r++<63){const x=h===45?p:f;return e.consume(h),x}return n(h)}}const fi={partial:!0,tokenize:lb};function lb(e,t,n){return r;function r(i){return ae(i)?ce(e,l,"linePrefix")(i):l(i)}function l(i){return i===null||Z(i)?t(i):n(i)}}const Lg={continuation:{tokenize:sb},exit:ob,name:"blockQuote",tokenize:ib};function ib(e,t,n){const r=this;return l;function l(s){if(s===62){const o=r.containerState;return o.open||(e.enter("blockQuote",{_container:!0}),o.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(s),e.exit("blockQuoteMarker"),i}return n(s)}function i(s){return ae(s)?(e.enter("blockQuotePrefixWhitespace"),e.consume(s),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(s))}}function sb(e,t,n){const r=this;return l;function l(s){return ae(s)?ce(e,i,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(s):i(s)}function i(s){return e.attempt(Lg,t,n)(s)}}function ob(e){e.exit("blockQuote")}const zg={name:"characterEscape",tokenize:ab};function ab(e,t,n){return r;function r(i){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(i),e.exit("escapeMarker"),l}function l(i){return Kk(i)?(e.enter("characterEscapeValue"),e.consume(i),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(i)}}const Og={name:"characterReference",tokenize:ub};function ub(e,t,n){const r=this;let l=0,i,s;return o;function o(f){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(f),e.exit("characterReferenceMarker"),a}function a(f){return f===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(f),e.exit("characterReferenceMarkerNumeric"),u):(e.enter("characterReferenceValue"),i=31,s=Ge,d(f))}function u(f){return f===88||f===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(f),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),i=6,s=Qk,d):(e.enter("characterReferenceValue"),i=7,s=mu,d(f))}function d(f){if(f===59&&l){const p=e.exit("characterReferenceValue");return s===Ge&&!Ac(r.sliceSerialize(p))?n(f):(e.enter("characterReferenceMarker"),e.consume(f),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return s(f)&&l++<i?(e.consume(f),d):n(f)}}const ep={partial:!0,tokenize:fb},tp={concrete:!0,name:"codeFenced",tokenize:cb};function cb(e,t,n){const r=this,l={partial:!0,tokenize:T};let i=0,s=0,o;return a;function a(b){return u(b)}function u(b){const _=r.events[r.events.length-1];return i=_&&_[1].type==="linePrefix"?_[2].sliceSerialize(_[1],!0).length:0,o=b,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),d(b)}function d(b){return b===o?(s++,e.consume(b),d):s<3?n(b):(e.exit("codeFencedFenceSequence"),ae(b)?ce(e,f,"whitespace")(b):f(b))}function f(b){return b===null||Z(b)?(e.exit("codeFencedFence"),r.interrupt?t(b):e.check(ep,v,E)(b)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),p(b))}function p(b){return b===null||Z(b)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),f(b)):ae(b)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),ce(e,h,"whitespace")(b)):b===96&&b===o?n(b):(e.consume(b),p)}function h(b){return b===null||Z(b)?f(b):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),x(b))}function x(b){return b===null||Z(b)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),f(b)):b===96&&b===o?n(b):(e.consume(b),x)}function v(b){return e.attempt(l,E,S)(b)}function S(b){return e.enter("lineEnding"),e.consume(b),e.exit("lineEnding"),m}function m(b){return i>0&&ae(b)?ce(e,g,"linePrefix",i+1)(b):g(b)}function g(b){return b===null||Z(b)?e.check(ep,v,E)(b):(e.enter("codeFlowValue"),y(b))}function y(b){return b===null||Z(b)?(e.exit("codeFlowValue"),g(b)):(e.consume(b),y)}function E(b){return e.exit("codeFenced"),t(b)}function T(b,_,I){let $=0;return N;function N(H){return b.enter("lineEnding"),b.consume(H),b.exit("lineEnding"),z}function z(H){return b.enter("codeFencedFence"),ae(H)?ce(b,U,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(H):U(H)}function U(H){return H===o?(b.enter("codeFencedFenceSequence"),ne(H)):I(H)}function ne(H){return H===o?($++,b.consume(H),ne):$>=s?(b.exit("codeFencedFenceSequence"),ae(H)?ce(b,R,"whitespace")(H):R(H)):I(H)}function R(H){return H===null||Z(H)?(b.exit("codeFencedFence"),_(H)):I(H)}}}function fb(e,t,n){const r=this;return l;function l(s){return s===null?n(s):(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),i)}function i(s){return r.parser.lazy[r.now().line]?n(s):t(s)}}const Zo={name:"codeIndented",tokenize:pb},db={partial:!0,tokenize:hb};function pb(e,t,n){const r=this;return l;function l(u){return e.enter("codeIndented"),ce(e,i,"linePrefix",5)(u)}function i(u){const d=r.events[r.events.length-1];return d&&d[1].type==="linePrefix"&&d[2].sliceSerialize(d[1],!0).length>=4?s(u):n(u)}function s(u){return u===null?a(u):Z(u)?e.attempt(db,s,a)(u):(e.enter("codeFlowValue"),o(u))}function o(u){return u===null||Z(u)?(e.exit("codeFlowValue"),s(u)):(e.consume(u),o)}function a(u){return e.exit("codeIndented"),t(u)}}function hb(e,t,n){const r=this;return l;function l(s){return r.parser.lazy[r.now().line]?n(s):Z(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),l):ce(e,i,"linePrefix",5)(s)}function i(s){const o=r.events[r.events.length-1];return o&&o[1].type==="linePrefix"&&o[2].sliceSerialize(o[1],!0).length>=4?t(s):Z(s)?l(s):n(s)}}const mb={name:"codeText",previous:xb,resolve:gb,tokenize:yb};function gb(e){let t=e.length-4,n=3,r,l;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;)l===void 0?r!==t&&e[r][1].type!=="lineEnding"&&(l=r):(r===t||e[r][1].type==="lineEnding")&&(e[l][1].type="codeTextData",r!==l+2&&(e[l][1].end=e[r-1][1].end,e.splice(l+2,r-l-2),t-=r-l-2,r=l+2),l=void 0);return e}function xb(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function yb(e,t,n){let r=0,l,i;return s;function s(f){return e.enter("codeText"),e.enter("codeTextSequence"),o(f)}function o(f){return f===96?(e.consume(f),r++,o):(e.exit("codeTextSequence"),a(f))}function a(f){return f===null?n(f):f===32?(e.enter("space"),e.consume(f),e.exit("space"),a):f===96?(i=e.enter("codeTextSequence"),l=0,d(f)):Z(f)?(e.enter("lineEnding"),e.consume(f),e.exit("lineEnding"),a):(e.enter("codeTextData"),u(f))}function u(f){return f===null||f===32||f===96||Z(f)?(e.exit("codeTextData"),a(f)):(e.consume(f),u)}function d(f){return f===96?(e.consume(f),l++,d):l===r?(e.exit("codeTextSequence"),e.exit("codeText"),t(f)):(i.type="codeTextData",u(f))}}class wb{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 l=n||0;this.setCursor(Math.trunc(t));const i=this.right.splice(this.right.length-l,Number.POSITIVE_INFINITY);return r&&gl(this.left,r),i.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),gl(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),gl(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);gl(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);gl(this.left,n.reverse())}}}function gl(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 Dg(e){const t={};let n=-1,r,l,i,s,o,a,u;const d=new wb(e);for(;++n<d.length;){for(;n in t;)n=t[n];if(r=d.get(n),n&&r[1].type==="chunkFlow"&&d.get(n-1)[1].type==="listItemPrefix"&&(a=r[1]._tokenizer.events,i=0,i<a.length&&a[i][1].type==="lineEndingBlank"&&(i+=2),i<a.length&&a[i][1].type==="content"))for(;++i<a.length&&a[i][1].type!=="content";)a[i][1].type==="chunkText"&&(a[i][1]._isInFirstContentOfListItem=!0,i++);if(r[0]==="enter")r[1].contentType&&(Object.assign(t,vb(d,n)),n=t[n],u=!0);else if(r[1]._container){for(i=n,l=void 0;i--;)if(s=d.get(i),s[1].type==="lineEnding"||s[1].type==="lineEndingBlank")s[0]==="enter"&&(l&&(d.get(l)[1].type="lineEndingBlank"),s[1].type="lineEnding",l=i);else if(!(s[1].type==="linePrefix"||s[1].type==="listItemIndent"))break;l&&(r[1].end={...d.get(l)[1].start},o=d.slice(l,n),o.unshift(r),d.splice(l,n-l+1,o))}}return Ct(e,0,Number.POSITIVE_INFINITY,d.slice(0)),!u}function vb(e,t){const n=e.get(t)[1],r=e.get(t)[2];let l=t-1;const i=[];let s=n._tokenizer;s||(s=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(s._contentTypeTextTrailing=!0));const o=s.events,a=[],u={};let d,f,p=-1,h=n,x=0,v=0;const S=[v];for(;h;){for(;e.get(++l)[1]!==h;);i.push(l),h._tokenizer||(d=r.sliceStream(h),h.next||d.push(null),f&&s.defineSkip(h.start),h._isInFirstContentOfListItem&&(s._gfmTasklistFirstContentOfListItem=!0),s.write(d),h._isInFirstContentOfListItem&&(s._gfmTasklistFirstContentOfListItem=void 0)),f=h,h=h.next}for(h=n;++p<o.length;)o[p][0]==="exit"&&o[p-1][0]==="enter"&&o[p][1].type===o[p-1][1].type&&o[p][1].start.line!==o[p][1].end.line&&(v=p+1,S.push(v),h._tokenizer=void 0,h.previous=void 0,h=h.next);for(s.events=[],h?(h._tokenizer=void 0,h.previous=void 0):S.pop(),p=S.length;p--;){const m=o.slice(S[p],S[p+1]),g=i.pop();a.push([g,g+m.length-1]),e.splice(g,2,m)}for(a.reverse(),p=-1;++p<a.length;)u[x+a[p][0]]=x+a[p][1],x+=a[p][1]-a[p][0]-1;return u}const kb={resolve:Sb,tokenize:Cb},bb={partial:!0,tokenize:Nb};function Sb(e){return Dg(e),e}function Cb(e,t){let n;return r;function r(o){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),l(o)}function l(o){return o===null?i(o):Z(o)?e.check(bb,s,i)(o):(e.consume(o),l)}function i(o){return e.exit("chunkContent"),e.exit("content"),t(o)}function s(o){return e.consume(o),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,l}}function Nb(e,t,n){const r=this;return l;function l(s){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),ce(e,i,"linePrefix")}function i(s){if(s===null||Z(s))return n(s);const o=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&o&&o[1].type==="linePrefix"&&o[2].sliceSerialize(o[1],!0).length>=4?t(s):e.interrupt(r.parser.constructs.flow,n,t)(s)}}function Fg(e,t,n,r,l,i,s,o,a){const u=a||Number.POSITIVE_INFINITY;let d=0;return f;function f(m){return m===60?(e.enter(r),e.enter(l),e.enter(i),e.consume(m),e.exit(i),p):m===null||m===32||m===41||Os(m)?n(m):(e.enter(r),e.enter(s),e.enter(o),e.enter("chunkString",{contentType:"string"}),v(m))}function p(m){return m===62?(e.enter(i),e.consume(m),e.exit(i),e.exit(l),e.exit(r),t):(e.enter(o),e.enter("chunkString",{contentType:"string"}),h(m))}function h(m){return m===62?(e.exit("chunkString"),e.exit(o),p(m)):m===null||m===60||Z(m)?n(m):(e.consume(m),m===92?x:h)}function x(m){return m===60||m===62||m===92?(e.consume(m),h):h(m)}function v(m){return!d&&(m===null||m===41||we(m))?(e.exit("chunkString"),e.exit(o),e.exit(s),e.exit(r),t(m)):d<u&&m===40?(e.consume(m),d++,v):m===41?(e.consume(m),d--,v):m===null||m===32||m===40||Os(m)?n(m):(e.consume(m),m===92?S:v)}function S(m){return m===40||m===41||m===92?(e.consume(m),v):v(m)}}function Mg(e,t,n,r,l,i){const s=this;let o=0,a;return u;function u(h){return e.enter(r),e.enter(l),e.consume(h),e.exit(l),e.enter(i),d}function d(h){return o>999||h===null||h===91||h===93&&!a||h===94&&!o&&"_hiddenFootnoteSupport"in s.parser.constructs?n(h):h===93?(e.exit(i),e.enter(l),e.consume(h),e.exit(l),e.exit(r),t):Z(h)?(e.enter("lineEnding"),e.consume(h),e.exit("lineEnding"),d):(e.enter("chunkString",{contentType:"string"}),f(h))}function f(h){return h===null||h===91||h===93||Z(h)||o++>999?(e.exit("chunkString"),d(h)):(e.consume(h),a||(a=!ae(h)),h===92?p:f)}function p(h){return h===91||h===92||h===93?(e.consume(h),o++,f):f(h)}}function Bg(e,t,n,r,l,i){let s;return o;function o(p){return p===34||p===39||p===40?(e.enter(r),e.enter(l),e.consume(p),e.exit(l),s=p===40?41:p,a):n(p)}function a(p){return p===s?(e.enter(l),e.consume(p),e.exit(l),e.exit(r),t):(e.enter(i),u(p))}function u(p){return p===s?(e.exit(i),a(s)):p===null?n(p):Z(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),ce(e,u,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),d(p))}function d(p){return p===s||p===null||Z(p)?(e.exit("chunkString"),u(p)):(e.consume(p),p===92?f:d)}function f(p){return p===s||p===92?(e.consume(p),d):d(p)}}function Il(e,t){let n;return r;function r(l){return Z(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),n=!0,r):ae(l)?ce(e,r,n?"linePrefix":"lineSuffix")(l):t(l)}}const Eb={name:"definition",tokenize:_b},jb={partial:!0,tokenize:Tb};function _b(e,t,n){const r=this;let l;return i;function i(h){return e.enter("definition"),s(h)}function s(h){return Mg.call(r,e,o,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(h)}function o(h){return l=Ht(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),h===58?(e.enter("definitionMarker"),e.consume(h),e.exit("definitionMarker"),a):n(h)}function a(h){return we(h)?Il(e,u)(h):u(h)}function u(h){return Fg(e,d,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(h)}function d(h){return e.attempt(jb,f,f)(h)}function f(h){return ae(h)?ce(e,p,"whitespace")(h):p(h)}function p(h){return h===null||Z(h)?(e.exit("definition"),r.parser.defined.push(l),t(h)):n(h)}}function Tb(e,t,n){return r;function r(o){return we(o)?Il(e,l)(o):n(o)}function l(o){return Bg(e,i,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(o)}function i(o){return ae(o)?ce(e,s,"whitespace")(o):s(o)}function s(o){return o===null||Z(o)?t(o):n(o)}}const Pb={name:"hardBreakEscape",tokenize:Rb};function Rb(e,t,n){return r;function r(i){return e.enter("hardBreakEscape"),e.consume(i),l}function l(i){return Z(i)?(e.exit("hardBreakEscape"),t(i)):n(i)}}const Ab={name:"headingAtx",resolve:Ib,tokenize:Lb};function Ib(e,t){let n=e.length-2,r=3,l,i;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&&(l={type:"atxHeadingText",start:e[r][1].start,end:e[n][1].end},i={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},Ct(e,r,n-r+1,[["enter",l,t],["enter",i,t],["exit",i,t],["exit",l,t]])),e}function Lb(e,t,n){let r=0;return l;function l(d){return e.enter("atxHeading"),i(d)}function i(d){return e.enter("atxHeadingSequence"),s(d)}function s(d){return d===35&&r++<6?(e.consume(d),s):d===null||we(d)?(e.exit("atxHeadingSequence"),o(d)):n(d)}function o(d){return d===35?(e.enter("atxHeadingSequence"),a(d)):d===null||Z(d)?(e.exit("atxHeading"),t(d)):ae(d)?ce(e,o,"whitespace")(d):(e.enter("atxHeadingText"),u(d))}function a(d){return d===35?(e.consume(d),a):(e.exit("atxHeadingSequence"),o(d))}function u(d){return d===null||d===35||we(d)?(e.exit("atxHeadingText"),o(d)):(e.consume(d),u)}}const zb=["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"],np=["pre","script","style","textarea"],Ob={concrete:!0,name:"htmlFlow",resolveTo:Mb,tokenize:Bb},Db={partial:!0,tokenize:$b},Fb={partial:!0,tokenize:Ub};function Mb(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 Bb(e,t,n){const r=this;let l,i,s,o,a;return u;function u(k){return d(k)}function d(k){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(k),f}function f(k){return k===33?(e.consume(k),p):k===47?(e.consume(k),i=!0,v):k===63?(e.consume(k),l=3,r.interrupt?t:w):it(k)?(e.consume(k),s=String.fromCharCode(k),S):n(k)}function p(k){return k===45?(e.consume(k),l=2,h):k===91?(e.consume(k),l=5,o=0,x):it(k)?(e.consume(k),l=4,r.interrupt?t:w):n(k)}function h(k){return k===45?(e.consume(k),r.interrupt?t:w):n(k)}function x(k){const fe="CDATA[";return k===fe.charCodeAt(o++)?(e.consume(k),o===fe.length?r.interrupt?t:U:x):n(k)}function v(k){return it(k)?(e.consume(k),s=String.fromCharCode(k),S):n(k)}function S(k){if(k===null||k===47||k===62||we(k)){const fe=k===47,Te=s.toLowerCase();return!fe&&!i&&np.includes(Te)?(l=1,r.interrupt?t(k):U(k)):zb.includes(s.toLowerCase())?(l=6,fe?(e.consume(k),m):r.interrupt?t(k):U(k)):(l=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(k):i?g(k):y(k))}return k===45||Ge(k)?(e.consume(k),s+=String.fromCharCode(k),S):n(k)}function m(k){return k===62?(e.consume(k),r.interrupt?t:U):n(k)}function g(k){return ae(k)?(e.consume(k),g):N(k)}function y(k){return k===47?(e.consume(k),N):k===58||k===95||it(k)?(e.consume(k),E):ae(k)?(e.consume(k),y):N(k)}function E(k){return k===45||k===46||k===58||k===95||Ge(k)?(e.consume(k),E):T(k)}function T(k){return k===61?(e.consume(k),b):ae(k)?(e.consume(k),T):y(k)}function b(k){return k===null||k===60||k===61||k===62||k===96?n(k):k===34||k===39?(e.consume(k),a=k,_):ae(k)?(e.consume(k),b):I(k)}function _(k){return k===a?(e.consume(k),a=null,$):k===null||Z(k)?n(k):(e.consume(k),_)}function I(k){return k===null||k===34||k===39||k===47||k===60||k===61||k===62||k===96||we(k)?T(k):(e.consume(k),I)}function $(k){return k===47||k===62||ae(k)?y(k):n(k)}function N(k){return k===62?(e.consume(k),z):n(k)}function z(k){return k===null||Z(k)?U(k):ae(k)?(e.consume(k),z):n(k)}function U(k){return k===45&&l===2?(e.consume(k),J):k===60&&l===1?(e.consume(k),M):k===62&&l===4?(e.consume(k),Q):k===63&&l===3?(e.consume(k),w):k===93&&l===5?(e.consume(k),B):Z(k)&&(l===6||l===7)?(e.exit("htmlFlowData"),e.check(Db,re,ne)(k)):k===null||Z(k)?(e.exit("htmlFlowData"),ne(k)):(e.consume(k),U)}function ne(k){return e.check(Fb,R,re)(k)}function R(k){return e.enter("lineEnding"),e.consume(k),e.exit("lineEnding"),H}function H(k){return k===null||Z(k)?ne(k):(e.enter("htmlFlowData"),U(k))}function J(k){return k===45?(e.consume(k),w):U(k)}function M(k){return k===47?(e.consume(k),s="",P):U(k)}function P(k){if(k===62){const fe=s.toLowerCase();return np.includes(fe)?(e.consume(k),Q):U(k)}return it(k)&&s.length<8?(e.consume(k),s+=String.fromCharCode(k),P):U(k)}function B(k){return k===93?(e.consume(k),w):U(k)}function w(k){return k===62?(e.consume(k),Q):k===45&&l===2?(e.consume(k),w):U(k)}function Q(k){return k===null||Z(k)?(e.exit("htmlFlowData"),re(k)):(e.consume(k),Q)}function re(k){return e.exit("htmlFlow"),t(k)}}function Ub(e,t,n){const r=this;return l;function l(s){return Z(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),i):n(s)}function i(s){return r.parser.lazy[r.now().line]?n(s):t(s)}}function $b(e,t,n){return r;function r(l){return e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),e.attempt(fi,t,n)}}const Hb={name:"htmlText",tokenize:Vb};function Vb(e,t,n){const r=this;let l,i,s;return o;function o(w){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(w),a}function a(w){return w===33?(e.consume(w),u):w===47?(e.consume(w),T):w===63?(e.consume(w),y):it(w)?(e.consume(w),I):n(w)}function u(w){return w===45?(e.consume(w),d):w===91?(e.consume(w),i=0,x):it(w)?(e.consume(w),g):n(w)}function d(w){return w===45?(e.consume(w),h):n(w)}function f(w){return w===null?n(w):w===45?(e.consume(w),p):Z(w)?(s=f,M(w)):(e.consume(w),f)}function p(w){return w===45?(e.consume(w),h):f(w)}function h(w){return w===62?J(w):w===45?p(w):f(w)}function x(w){const Q="CDATA[";return w===Q.charCodeAt(i++)?(e.consume(w),i===Q.length?v:x):n(w)}function v(w){return w===null?n(w):w===93?(e.consume(w),S):Z(w)?(s=v,M(w)):(e.consume(w),v)}function S(w){return w===93?(e.consume(w),m):v(w)}function m(w){return w===62?J(w):w===93?(e.consume(w),m):v(w)}function g(w){return w===null||w===62?J(w):Z(w)?(s=g,M(w)):(e.consume(w),g)}function y(w){return w===null?n(w):w===63?(e.consume(w),E):Z(w)?(s=y,M(w)):(e.consume(w),y)}function E(w){return w===62?J(w):y(w)}function T(w){return it(w)?(e.consume(w),b):n(w)}function b(w){return w===45||Ge(w)?(e.consume(w),b):_(w)}function _(w){return Z(w)?(s=_,M(w)):ae(w)?(e.consume(w),_):J(w)}function I(w){return w===45||Ge(w)?(e.consume(w),I):w===47||w===62||we(w)?$(w):n(w)}function $(w){return w===47?(e.consume(w),J):w===58||w===95||it(w)?(e.consume(w),N):Z(w)?(s=$,M(w)):ae(w)?(e.consume(w),$):J(w)}function N(w){return w===45||w===46||w===58||w===95||Ge(w)?(e.consume(w),N):z(w)}function z(w){return w===61?(e.consume(w),U):Z(w)?(s=z,M(w)):ae(w)?(e.consume(w),z):$(w)}function U(w){return w===null||w===60||w===61||w===62||w===96?n(w):w===34||w===39?(e.consume(w),l=w,ne):Z(w)?(s=U,M(w)):ae(w)?(e.consume(w),U):(e.consume(w),R)}function ne(w){return w===l?(e.consume(w),l=void 0,H):w===null?n(w):Z(w)?(s=ne,M(w)):(e.consume(w),ne)}function R(w){return w===null||w===34||w===39||w===60||w===61||w===96?n(w):w===47||w===62||we(w)?$(w):(e.consume(w),R)}function H(w){return w===47||w===62||we(w)?$(w):n(w)}function J(w){return w===62?(e.consume(w),e.exit("htmlTextData"),e.exit("htmlText"),t):n(w)}function M(w){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(w),e.exit("lineEnding"),P}function P(w){return ae(w)?ce(e,B,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(w):B(w)}function B(w){return e.enter("htmlTextData"),s(w)}}const Ic={name:"labelEnd",resolveAll:Kb,resolveTo:Xb,tokenize:Yb},qb={tokenize:Gb},Wb={tokenize:Jb},Qb={tokenize:Zb};function Kb(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 l=r.type==="labelImage"?4:2;r.type="data",t+=l}}return e.length!==n.length&&Ct(e,0,e.length,n),e}function Xb(e,t){let n=e.length,r=0,l,i,s,o;for(;n--;)if(l=e[n][1],i){if(l.type==="link"||l.type==="labelLink"&&l._inactive)break;e[n][0]==="enter"&&l.type==="labelLink"&&(l._inactive=!0)}else if(s){if(e[n][0]==="enter"&&(l.type==="labelImage"||l.type==="labelLink")&&!l._balanced&&(i=n,l.type!=="labelLink")){r=2;break}}else l.type==="labelEnd"&&(s=n);const a={type:e[i][1].type==="labelLink"?"link":"image",start:{...e[i][1].start},end:{...e[e.length-1][1].end}},u={type:"label",start:{...e[i][1].start},end:{...e[s][1].end}},d={type:"labelText",start:{...e[i+r+2][1].end},end:{...e[s-2][1].start}};return o=[["enter",a,t],["enter",u,t]],o=Rt(o,e.slice(i+1,i+r+3)),o=Rt(o,[["enter",d,t]]),o=Rt(o,oo(t.parser.constructs.insideSpan.null,e.slice(i+r+4,s-3),t)),o=Rt(o,[["exit",d,t],e[s-2],e[s-1],["exit",u,t]]),o=Rt(o,e.slice(s+1)),o=Rt(o,[["exit",a,t]]),Ct(e,i,e.length,o),e}function Yb(e,t,n){const r=this;let l=r.events.length,i,s;for(;l--;)if((r.events[l][1].type==="labelImage"||r.events[l][1].type==="labelLink")&&!r.events[l][1]._balanced){i=r.events[l][1];break}return o;function o(p){return i?i._inactive?f(p):(s=r.parser.defined.includes(Ht(r.sliceSerialize({start:i.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(p),e.exit("labelMarker"),e.exit("labelEnd"),a):n(p)}function a(p){return p===40?e.attempt(qb,d,s?d:f)(p):p===91?e.attempt(Wb,d,s?u:f)(p):s?d(p):f(p)}function u(p){return e.attempt(Qb,d,f)(p)}function d(p){return t(p)}function f(p){return i._balanced=!0,n(p)}}function Gb(e,t,n){return r;function r(f){return e.enter("resource"),e.enter("resourceMarker"),e.consume(f),e.exit("resourceMarker"),l}function l(f){return we(f)?Il(e,i)(f):i(f)}function i(f){return f===41?d(f):Fg(e,s,o,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(f)}function s(f){return we(f)?Il(e,a)(f):d(f)}function o(f){return n(f)}function a(f){return f===34||f===39||f===40?Bg(e,u,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(f):d(f)}function u(f){return we(f)?Il(e,d)(f):d(f)}function d(f){return f===41?(e.enter("resourceMarker"),e.consume(f),e.exit("resourceMarker"),e.exit("resource"),t):n(f)}}function Jb(e,t,n){const r=this;return l;function l(o){return Mg.call(r,e,i,s,"reference","referenceMarker","referenceString")(o)}function i(o){return r.parser.defined.includes(Ht(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(o):n(o)}function s(o){return n(o)}}function Zb(e,t,n){return r;function r(i){return e.enter("reference"),e.enter("referenceMarker"),e.consume(i),e.exit("referenceMarker"),l}function l(i){return i===93?(e.enter("referenceMarker"),e.consume(i),e.exit("referenceMarker"),e.exit("reference"),t):n(i)}}const eS={name:"labelStartImage",resolveAll:Ic.resolveAll,tokenize:tS};function tS(e,t,n){const r=this;return l;function l(o){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(o),e.exit("labelImageMarker"),i}function i(o){return o===91?(e.enter("labelMarker"),e.consume(o),e.exit("labelMarker"),e.exit("labelImage"),s):n(o)}function s(o){return o===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(o):t(o)}}const nS={name:"labelStartLink",resolveAll:Ic.resolveAll,tokenize:rS};function rS(e,t,n){const r=this;return l;function l(s){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(s),e.exit("labelMarker"),e.exit("labelLink"),i}function i(s){return s===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(s):t(s)}}const ea={name:"lineEnding",tokenize:lS};function lS(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),ce(e,t,"linePrefix")}}const ls={name:"thematicBreak",tokenize:iS};function iS(e,t,n){let r=0,l;return i;function i(u){return e.enter("thematicBreak"),s(u)}function s(u){return l=u,o(u)}function o(u){return u===l?(e.enter("thematicBreakSequence"),a(u)):r>=3&&(u===null||Z(u))?(e.exit("thematicBreak"),t(u)):n(u)}function a(u){return u===l?(e.consume(u),r++,a):(e.exit("thematicBreakSequence"),ae(u)?ce(e,o,"whitespace")(u):o(u))}}const ct={continuation:{tokenize:uS},exit:fS,name:"list",tokenize:aS},sS={partial:!0,tokenize:dS},oS={partial:!0,tokenize:cS};function aS(e,t,n){const r=this,l=r.events[r.events.length-1];let i=l&&l[1].type==="linePrefix"?l[2].sliceSerialize(l[1],!0).length:0,s=0;return o;function o(h){const x=r.containerState.type||(h===42||h===43||h===45?"listUnordered":"listOrdered");if(x==="listUnordered"?!r.containerState.marker||h===r.containerState.marker:mu(h)){if(r.containerState.type||(r.containerState.type=x,e.enter(x,{_container:!0})),x==="listUnordered")return e.enter("listItemPrefix"),h===42||h===45?e.check(ls,n,u)(h):u(h);if(!r.interrupt||h===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),a(h)}return n(h)}function a(h){return mu(h)&&++s<10?(e.consume(h),a):(!r.interrupt||s<2)&&(r.containerState.marker?h===r.containerState.marker:h===41||h===46)?(e.exit("listItemValue"),u(h)):n(h)}function u(h){return e.enter("listItemMarker"),e.consume(h),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||h,e.check(fi,r.interrupt?n:d,e.attempt(sS,p,f))}function d(h){return r.containerState.initialBlankLine=!0,i++,p(h)}function f(h){return ae(h)?(e.enter("listItemPrefixWhitespace"),e.consume(h),e.exit("listItemPrefixWhitespace"),p):n(h)}function p(h){return r.containerState.size=i+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(h)}}function uS(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(fi,l,i);function l(o){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,ce(e,t,"listItemIndent",r.containerState.size+1)(o)}function i(o){return r.containerState.furtherBlankLines||!ae(o)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,s(o)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(oS,t,s)(o))}function s(o){return r.containerState._closeFlow=!0,r.interrupt=void 0,ce(e,e.attempt(ct,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(o)}}function cS(e,t,n){const r=this;return ce(e,l,"listItemIndent",r.containerState.size+1);function l(i){const s=r.events[r.events.length-1];return s&&s[1].type==="listItemIndent"&&s[2].sliceSerialize(s[1],!0).length===r.containerState.size?t(i):n(i)}}function fS(e){e.exit(this.containerState.type)}function dS(e,t,n){const r=this;return ce(e,l,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function l(i){const s=r.events[r.events.length-1];return!ae(i)&&s&&s[1].type==="listItemPrefixWhitespace"?t(i):n(i)}}const rp={name:"setextUnderline",resolveTo:pS,tokenize:hS};function pS(e,t){let n=e.length,r,l,i;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){r=n;break}e[n][1].type==="paragraph"&&(l=n)}else e[n][1].type==="content"&&e.splice(n,1),!i&&e[n][1].type==="definition"&&(i=n);const s={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[l][1].type="setextHeadingText",i?(e.splice(l,0,["enter",s,t]),e.splice(i+1,0,["exit",e[r][1],t]),e[r][1].end={...e[i][1].end}):e[r][1]=s,e.push(["exit",s,t]),e}function hS(e,t,n){const r=this;let l;return i;function i(u){let d=r.events.length,f;for(;d--;)if(r.events[d][1].type!=="lineEnding"&&r.events[d][1].type!=="linePrefix"&&r.events[d][1].type!=="content"){f=r.events[d][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||f)?(e.enter("setextHeadingLine"),l=u,s(u)):n(u)}function s(u){return e.enter("setextHeadingLineSequence"),o(u)}function o(u){return u===l?(e.consume(u),o):(e.exit("setextHeadingLineSequence"),ae(u)?ce(e,a,"lineSuffix")(u):a(u))}function a(u){return u===null||Z(u)?(e.exit("setextHeadingLine"),t(u)):n(u)}}const mS={tokenize:gS};function gS(e){const t=this,n=e.attempt(fi,r,e.attempt(this.parser.constructs.flowInitial,l,ce(e,e.attempt(this.parser.constructs.flow,l,e.attempt(kb,l)),"linePrefix")));return n;function r(i){if(i===null){e.consume(i);return}return e.enter("lineEndingBlank"),e.consume(i),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function l(i){if(i===null){e.consume(i);return}return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const xS={resolveAll:$g()},yS=Ug("string"),wS=Ug("text");function Ug(e){return{resolveAll:$g(e==="text"?vS:void 0),tokenize:t};function t(n){const r=this,l=this.parser.constructs[e],i=n.attempt(l,s,o);return s;function s(d){return u(d)?i(d):o(d)}function o(d){if(d===null){n.consume(d);return}return n.enter("data"),n.consume(d),a}function a(d){return u(d)?(n.exit("data"),i(d)):(n.consume(d),a)}function u(d){if(d===null)return!0;const f=l[d];let p=-1;if(f)for(;++p<f.length;){const h=f[p];if(!h.previous||h.previous.call(r,r.previous))return!0}return!1}}}function $g(e){return t;function t(n,r){let l=-1,i;for(;++l<=n.length;)i===void 0?n[l]&&n[l][1].type==="data"&&(i=l,l++):(!n[l]||n[l][1].type!=="data")&&(l!==i+2&&(n[i][1].end=n[l-1][1].end,n.splice(i+2,l-i-2),l=i+2),i=void 0);return e?e(n,r):n}}function vS(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],l=t.sliceStream(r);let i=l.length,s=-1,o=0,a;for(;i--;){const u=l[i];if(typeof u=="string"){for(s=u.length;u.charCodeAt(s-1)===32;)o++,s--;if(s)break;s=-1}else if(u===-2)a=!0,o++;else if(u!==-1){i++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(o=0),o){const u={type:n===e.length||a||o<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:i?s:r.start._bufferIndex+s,_index:r.start._index+i,line:r.end.line,column:r.end.column-o,offset:r.end.offset-o},end:{...r.end}};r.end={...u.start},r.start.offset===r.end.offset?Object.assign(r,u):(e.splice(n,0,["enter",u,t],["exit",u,t]),n+=2)}n++}return e}const kS={42:ct,43:ct,45:ct,48:ct,49:ct,50:ct,51:ct,52:ct,53:ct,54:ct,55:ct,56:ct,57:ct,62:Lg},bS={91:Eb},SS={[-2]:Zo,[-1]:Zo,32:Zo},CS={35:Ab,42:ls,45:[rp,ls],60:Ob,61:rp,95:ls,96:tp,126:tp},NS={38:Og,92:zg},ES={[-5]:ea,[-4]:ea,[-3]:ea,33:eS,38:Og,42:gu,60:[nb,Hb],91:nS,92:[Pb,zg],93:Ic,95:gu,96:mb},jS={null:[gu,xS]},_S={null:[42,95]},TS={null:[]},PS=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:_S,contentInitial:bS,disable:TS,document:kS,flow:CS,flowInitial:SS,insideSpan:jS,string:NS,text:ES},Symbol.toStringTag,{value:"Module"}));function RS(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 l={},i=[];let s=[],o=[];const a={attempt:_(T),check:_(b),consume:g,enter:y,exit:E,interrupt:_(b,{interrupt:!0})},u={code:null,containerState:{},defineSkip:v,events:[],now:x,parser:e,previous:null,sliceSerialize:p,sliceStream:h,write:f};let d=t.tokenize.call(u,a);return t.resolveAll&&i.push(t),u;function f(z){return s=Rt(s,z),S(),s[s.length-1]!==null?[]:(I(t,0),u.events=oo(i,u.events,u),u.events)}function p(z,U){return IS(h(z),U)}function h(z){return AS(s,z)}function x(){const{_bufferIndex:z,_index:U,line:ne,column:R,offset:H}=r;return{_bufferIndex:z,_index:U,line:ne,column:R,offset:H}}function v(z){l[z.line]=z.column,N()}function S(){let z;for(;r._index<s.length;){const U=s[r._index];if(typeof U=="string")for(z=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===z&&r._bufferIndex<U.length;)m(U.charCodeAt(r._bufferIndex));else m(U)}}function m(z){d=d(z)}function g(z){Z(z)?(r.line++,r.column=1,r.offset+=z===-3?2:1,N()):z!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===s[r._index].length&&(r._bufferIndex=-1,r._index++)),u.previous=z}function y(z,U){const ne=U||{};return ne.type=z,ne.start=x(),u.events.push(["enter",ne,u]),o.push(ne),ne}function E(z){const U=o.pop();return U.end=x(),u.events.push(["exit",U,u]),U}function T(z,U){I(z,U.from)}function b(z,U){U.restore()}function _(z,U){return ne;function ne(R,H,J){let M,P,B,w;return Array.isArray(R)?re(R):"tokenize"in R?re([R]):Q(R);function Q(X){return V;function V(Y){const se=Y!==null&&X[Y],ge=Y!==null&&X.null,ke=[...Array.isArray(se)?se:se?[se]:[],...Array.isArray(ge)?ge:ge?[ge]:[]];return re(ke)(Y)}}function re(X){return M=X,P=0,X.length===0?J:k(X[P])}function k(X){return V;function V(Y){return w=$(),B=X,X.partial||(u.currentConstruct=X),X.name&&u.parser.constructs.disable.null.includes(X.name)?Te():X.tokenize.call(U?Object.assign(Object.create(u),U):u,a,fe,Te)(Y)}}function fe(X){return z(B,w),H}function Te(X){return w.restore(),++P<M.length?k(M[P]):J}}}function I(z,U){z.resolveAll&&!i.includes(z)&&i.push(z),z.resolve&&Ct(u.events,U,u.events.length-U,z.resolve(u.events.slice(U),u)),z.resolveTo&&(u.events=z.resolveTo(u.events,u))}function $(){const z=x(),U=u.previous,ne=u.currentConstruct,R=u.events.length,H=Array.from(o);return{from:R,restore:J};function J(){r=z,u.previous=U,u.currentConstruct=ne,u.events.length=R,o=H,N()}}function N(){r.line in l&&r.column<2&&(r.column=l[r.line],r.offset+=l[r.line]-1)}}function AS(e,t){const n=t.start._index,r=t.start._bufferIndex,l=t.end._index,i=t.end._bufferIndex;let s;if(n===l)s=[e[n].slice(r,i)];else{if(s=e.slice(n,l),r>-1){const o=s[0];typeof o=="string"?s[0]=o.slice(r):s.shift()}i>0&&s.push(e[l].slice(0,i))}return s}function IS(e,t){let n=-1;const r=[];let l;for(;++n<e.length;){const i=e[n];let s;if(typeof i=="string")s=i;else switch(i){case-5:{s="\r";break}case-4:{s=`
|
|
225
225
|
`;break}case-3:{s=`\r
|
|
226
226
|
`;break}case-2:{s=t?" ":" ";break}case-1:{if(!t&&l)continue;s=" ";break}default:s=String.fromCharCode(i)}l=i===-2,r.push(s)}return r.join("")}function LS(e){const r={constructs:Ag([PS,...(e||{}).extensions||[]]),content:l(Xk),defined:[],document:l(Gk),flow:l(mS),lazy:{},string:l(yS),text:l(wS)};return r;function l(i){return s;function s(o){return RS(r,i,o)}}}function zS(e){for(;!Dg(e););return e}const lp=/[\0\t\n\r]/g;function OS(){let e=1,t="",n=!0,r;return l;function l(i,s,o){const a=[];let u,d,f,p,h;for(i=t+(typeof i=="string"?i.toString():new TextDecoder(s||void 0).decode(i)),f=0,t="",n&&(i.charCodeAt(0)===65279&&f++,n=void 0);f<i.length;){if(lp.lastIndex=f,u=lp.exec(i),p=u&&u.index!==void 0?u.index:i.length,h=i.charCodeAt(p),!u){t=i.slice(f);break}if(h===10&&f===p&&r)a.push(-3),r=void 0;else switch(r&&(a.push(-5),r=void 0),f<p&&(a.push(i.slice(f,p)),e+=p-f),h){case 0:{a.push(65533),e++;break}case 9:{for(d=Math.ceil(e/4)*4,a.push(-2);e++<d;)a.push(-1);break}case 10:{a.push(-4),e=1;break}default:r=!0,e=1}f=p+1}return o&&(r&&a.push(-5),t&&a.push(t),a.push(null)),a}}const DS=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function FS(e){return e.replace(DS,MS)}function MS(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const l=n.charCodeAt(1),i=l===120||l===88;return Ig(n.slice(i?2:1),i?16:10)}return Ac(n)||e}const Hg={}.hasOwnProperty;function BS(e,t,n){return t&&typeof t=="object"&&(n=t,t=void 0),US(n)(zS(LS(n).document().write(OS()(e,t,!0))))}function US(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:i(nt),autolinkProtocol:$,autolinkEmail:$,atxHeading:i(tt),blockQuote:i(ge),characterEscape:$,characterReference:$,codeFenced:i(ke),codeFencedFenceInfo:s,codeFencedFenceMeta:s,codeIndented:i(ke,s),codeText:i(he,s),codeTextData:$,data:$,codeFlowValue:$,definition:i(Wt),definitionDestinationString:s,definitionLabelString:s,definitionTitleString:s,emphasis:i(_t),hardBreakEscape:i(te),hardBreakTrailing:i(te),htmlFlow:i(Fe,s),htmlFlowData:$,htmlText:i(Fe,s),htmlTextData:$,image:i(Ue),label:s,link:i(nt),listItem:i(pr),listItemValue:p,listOrdered:i(pn,f),listUnordered:i(pn),paragraph:i(en),reference:k,referenceString:s,resourceDestinationString:s,resourceTitleString:s,setextHeading:i(tt),strong:i(ll),thematicBreak:i(hi)},exit:{atxHeading:a(),atxHeadingSequence:T,autolink:a(),autolinkEmail:se,autolinkProtocol:Y,blockQuote:a(),characterEscapeValue:N,characterReferenceMarkerHexadecimal:Te,characterReferenceMarkerNumeric:Te,characterReferenceValue:X,characterReference:V,codeFenced:a(S),codeFencedFence:v,codeFencedFenceInfo:h,codeFencedFenceMeta:x,codeFlowValue:N,codeIndented:a(m),codeText:a(H),codeTextData:N,data:N,definition:a(),definitionDestinationString:E,definitionLabelString:g,definitionTitleString:y,emphasis:a(),hardBreakEscape:a(U),hardBreakTrailing:a(U),htmlFlow:a(ne),htmlFlowData:N,htmlText:a(R),htmlTextData:N,image:a(M),label:B,labelText:P,lineEnding:z,link:a(J),listItem:a(),listOrdered:a(),listUnordered:a(),paragraph:a(),referenceString:fe,resourceDestinationString:w,resourceTitleString:Q,resource:re,setextHeading:a(I),setextHeadingLineSequence:_,setextHeadingText:b,strong:a(),thematicBreak:a()}};Vg(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(A){let F={type:"root",children:[]};const ee={stack:[F],tokenStack:[],config:t,enter:o,exit:u,buffer:s,resume:d,data:n},ie=[];let de=-1;for(;++de<A.length;)if(A[de][1].type==="listOrdered"||A[de][1].type==="listUnordered")if(A[de][0]==="enter")ie.push(de);else{const We=ie.pop();de=l(A,We,de)}for(de=-1;++de<A.length;){const We=t[A[de][0]];Hg.call(We,A[de][1].type)&&We[A[de][1].type].call(Object.assign({sliceSerialize:A[de][2].sliceSerialize},ee),A[de][1])}if(ee.tokenStack.length>0){const We=ee.tokenStack[ee.tokenStack.length-1];(We[1]||ip).call(ee,void 0,We[0])}for(F.position={start:kn(A.length>0?A[0][1].start:{line:1,column:1,offset:0}),end:kn(A.length>0?A[A.length-2][1].end:{line:1,column:1,offset:0})},de=-1;++de<t.transforms.length;)F=t.transforms[de](F)||F;return F}function l(A,F,ee){let ie=F-1,de=-1,We=!1,yt,ut,hn,mn;for(;++ie<=ee;){const rt=A[ie];switch(rt[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{rt[0]==="enter"?de++:de--,mn=void 0;break}case"lineEndingBlank":{rt[0]==="enter"&&(yt&&!mn&&!de&&!hn&&(hn=ie),mn=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:mn=void 0}if(!de&&rt[0]==="enter"&&rt[1].type==="listItemPrefix"||de===-1&&rt[0]==="exit"&&(rt[1].type==="listUnordered"||rt[1].type==="listOrdered")){if(yt){let Ot=ie;for(ut=void 0;Ot--;){const wt=A[Ot];if(wt[1].type==="lineEnding"||wt[1].type==="lineEndingBlank"){if(wt[0]==="exit")continue;ut&&(A[ut][1].type="lineEndingBlank",We=!0),wt[1].type="lineEnding",ut=Ot}else if(!(wt[1].type==="linePrefix"||wt[1].type==="blockQuotePrefix"||wt[1].type==="blockQuotePrefixWhitespace"||wt[1].type==="blockQuoteMarker"||wt[1].type==="listItemIndent"))break}hn&&(!ut||hn<ut)&&(yt._spread=!0),yt.end=Object.assign({},ut?A[ut][1].start:rt[1].end),A.splice(ut||ie,0,["exit",yt,rt[2]]),ie++,ee++}if(rt[1].type==="listItemPrefix"){const Ot={type:"listItem",_spread:!1,start:Object.assign({},rt[1].start),end:void 0};yt=Ot,A.splice(ie,0,["enter",Ot,rt[2]]),ie++,ee++,hn=void 0,mn=!0}}}return A[F][1]._spread=We,ee}function i(A,F){return ee;function ee(ie){o.call(this,A(ie),ie),F&&F.call(this,ie)}}function s(){this.stack.push({type:"fragment",children:[]})}function o(A,F,ee){this.stack[this.stack.length-1].children.push(A),this.stack.push(A),this.tokenStack.push([F,ee||void 0]),A.position={start:kn(F.start),end:void 0}}function a(A){return F;function F(ee){A&&A.call(this,ee),u.call(this,ee)}}function u(A,F){const ee=this.stack.pop(),ie=this.tokenStack.pop();if(ie)ie[0].type!==A.type&&(F?F.call(this,A,ie[0]):(ie[1]||ip).call(this,A,ie[0]));else throw new Error("Cannot close `"+A.type+"` ("+Al({start:A.start,end:A.end})+"): it’s not open");ee.position.end=kn(A.end)}function d(){return Rc(this.stack.pop())}function f(){this.data.expectingFirstListItemValue=!0}function p(A){if(this.data.expectingFirstListItemValue){const F=this.stack[this.stack.length-2];F.start=Number.parseInt(this.sliceSerialize(A),10),this.data.expectingFirstListItemValue=void 0}}function h(){const A=this.resume(),F=this.stack[this.stack.length-1];F.lang=A}function x(){const A=this.resume(),F=this.stack[this.stack.length-1];F.meta=A}function v(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function S(){const A=this.resume(),F=this.stack[this.stack.length-1];F.value=A.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function m(){const A=this.resume(),F=this.stack[this.stack.length-1];F.value=A.replace(/(\r?\n|\r)$/g,"")}function g(A){const F=this.resume(),ee=this.stack[this.stack.length-1];ee.label=F,ee.identifier=Ht(this.sliceSerialize(A)).toLowerCase()}function y(){const A=this.resume(),F=this.stack[this.stack.length-1];F.title=A}function E(){const A=this.resume(),F=this.stack[this.stack.length-1];F.url=A}function T(A){const F=this.stack[this.stack.length-1];if(!F.depth){const ee=this.sliceSerialize(A).length;F.depth=ee}}function b(){this.data.setextHeadingSlurpLineEnding=!0}function _(A){const F=this.stack[this.stack.length-1];F.depth=this.sliceSerialize(A).codePointAt(0)===61?1:2}function I(){this.data.setextHeadingSlurpLineEnding=void 0}function $(A){const ee=this.stack[this.stack.length-1].children;let ie=ee[ee.length-1];(!ie||ie.type!=="text")&&(ie=pi(),ie.position={start:kn(A.start),end:void 0},ee.push(ie)),this.stack.push(ie)}function N(A){const F=this.stack.pop();F.value+=this.sliceSerialize(A),F.position.end=kn(A.end)}function z(A){const F=this.stack[this.stack.length-1];if(this.data.atHardBreak){const ee=F.children[F.children.length-1];ee.position.end=kn(A.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(F.type)&&($.call(this,A),N.call(this,A))}function U(){this.data.atHardBreak=!0}function ne(){const A=this.resume(),F=this.stack[this.stack.length-1];F.value=A}function R(){const A=this.resume(),F=this.stack[this.stack.length-1];F.value=A}function H(){const A=this.resume(),F=this.stack[this.stack.length-1];F.value=A}function J(){const A=this.stack[this.stack.length-1];if(this.data.inReference){const F=this.data.referenceType||"shortcut";A.type+="Reference",A.referenceType=F,delete A.url,delete A.title}else delete A.identifier,delete A.label;this.data.referenceType=void 0}function M(){const A=this.stack[this.stack.length-1];if(this.data.inReference){const F=this.data.referenceType||"shortcut";A.type+="Reference",A.referenceType=F,delete A.url,delete A.title}else delete A.identifier,delete A.label;this.data.referenceType=void 0}function P(A){const F=this.sliceSerialize(A),ee=this.stack[this.stack.length-2];ee.label=FS(F),ee.identifier=Ht(F).toLowerCase()}function B(){const A=this.stack[this.stack.length-1],F=this.resume(),ee=this.stack[this.stack.length-1];if(this.data.inReference=!0,ee.type==="link"){const ie=A.children;ee.children=ie}else ee.alt=F}function w(){const A=this.resume(),F=this.stack[this.stack.length-1];F.url=A}function Q(){const A=this.resume(),F=this.stack[this.stack.length-1];F.title=A}function re(){this.data.inReference=void 0}function k(){this.data.referenceType="collapsed"}function fe(A){const F=this.resume(),ee=this.stack[this.stack.length-1];ee.label=F,ee.identifier=Ht(this.sliceSerialize(A)).toLowerCase(),this.data.referenceType="full"}function Te(A){this.data.characterReferenceType=A.type}function X(A){const F=this.sliceSerialize(A),ee=this.data.characterReferenceType;let ie;ee?(ie=Ig(F,ee==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):ie=Ac(F);const de=this.stack[this.stack.length-1];de.value+=ie}function V(A){const F=this.stack.pop();F.position.end=kn(A.end)}function Y(A){N.call(this,A);const F=this.stack[this.stack.length-1];F.url=this.sliceSerialize(A)}function se(A){N.call(this,A);const F=this.stack[this.stack.length-1];F.url="mailto:"+this.sliceSerialize(A)}function ge(){return{type:"blockquote",children:[]}}function ke(){return{type:"code",lang:null,meta:null,value:""}}function he(){return{type:"inlineCode",value:""}}function Wt(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function _t(){return{type:"emphasis",children:[]}}function tt(){return{type:"heading",depth:0,children:[]}}function te(){return{type:"break"}}function Fe(){return{type:"html",value:""}}function Ue(){return{type:"image",title:null,url:"",alt:null}}function nt(){return{type:"link",title:null,url:"",children:[]}}function pn(A){return{type:"list",ordered:A.type==="listOrdered",start:null,spread:A._spread,children:[]}}function pr(A){return{type:"listItem",spread:A._spread,checked:null,children:[]}}function en(){return{type:"paragraph",children:[]}}function ll(){return{type:"strong",children:[]}}function pi(){return{type:"text",value:""}}function hi(){return{type:"thematicBreak"}}}function kn(e){return{line:e.line,column:e.column,offset:e.offset}}function Vg(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?Vg(e,r):$S(e,r)}}function $S(e,t){let n;for(n in t)if(Hg.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 ip(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+Al({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+Al({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+Al({start:t.start,end:t.end})+") is still open")}function HS(e){const t=this;t.parser=n;function n(r){return BS(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function VS(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 qS(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
|
|
6
6
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
7
7
|
<title>SlothQuery</title>
|
|
8
|
-
<script type="module" crossorigin src="/assets/index-
|
|
8
|
+
<script type="module" crossorigin src="/assets/index-C0PfxljE.js"></script>
|
|
9
9
|
<link rel="stylesheet" crossorigin href="/assets/index-BDTPNUTQ.css">
|
|
10
10
|
</head>
|
|
11
11
|
<body>
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
import os
|
|
2
|
+
import zipfile
|
|
3
|
+
import json
|
|
4
|
+
from datetime import datetime
|
|
5
|
+
from sqlalchemy.orm import Session
|
|
6
|
+
from .. import models
|
|
7
|
+
from .vector_store import index_query
|
|
8
|
+
|
|
9
|
+
def export_knowledge_base(db: Session, export_dir: str):
|
|
10
|
+
"""Exports SQLite content to a .slothkb zip file without embeddings."""
|
|
11
|
+
vaults = db.query(models.Vault).all()
|
|
12
|
+
queries = db.query(models.Query).all()
|
|
13
|
+
contexts = db.query(models.QueryContext).all()
|
|
14
|
+
playbooks = db.query(models.Playbook).all()
|
|
15
|
+
|
|
16
|
+
export_data = {
|
|
17
|
+
"vaults": [{"id": v.id, "name": v.name, "description": v.description, "created_at": str(v.created_at)} for v in vaults],
|
|
18
|
+
"queries": [{"id": q.id, "vault_id": q.vault_id, "title": q.title, "sql_query": q.sql_query, "sql_comments": q.sql_comments, "dialect": q.dialect} for q in queries],
|
|
19
|
+
"contexts": [{"query_id": c.query_id, "context_json": c.context_json, "approval_status": c.approval_status} for c in contexts],
|
|
20
|
+
"playbooks": [{"id": p.id, "vault_id": p.vault_id, "name": p.name, "playbook_type": p.playbook_type, "content": p.content} for p in playbooks]
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
os.makedirs(export_dir, exist_ok=True)
|
|
24
|
+
timestamp = datetime.now().strftime("%Y%m%d%H%M%S")
|
|
25
|
+
file_path = os.path.join(export_dir, f"slothquery_export_{timestamp}.slothkb")
|
|
26
|
+
|
|
27
|
+
with zipfile.ZipFile(file_path, 'w', zipfile.ZIP_DEFLATED) as zf:
|
|
28
|
+
zf.writestr("queries_and_contexts.json", json.dumps(export_data, indent=2))
|
|
29
|
+
|
|
30
|
+
return file_path
|
|
31
|
+
|
|
32
|
+
def import_knowledge_base(db: Session, slothkb_path: str):
|
|
33
|
+
"""Imports .slothkb file, populates SQLite, and regenerates BGE embeddings locally."""
|
|
34
|
+
with zipfile.ZipFile(slothkb_path, 'r') as zf:
|
|
35
|
+
with zf.open("queries_and_contexts.json") as f:
|
|
36
|
+
data = json.loads(f.read().decode("utf-8"))
|
|
37
|
+
|
|
38
|
+
# 1. Populate SQLite Database
|
|
39
|
+
# Import Vaults
|
|
40
|
+
for v_data in data.get("vaults", []):
|
|
41
|
+
existing_vault = db.query(models.Vault).filter(models.Vault.id == v_data["id"]).first()
|
|
42
|
+
if not existing_vault:
|
|
43
|
+
created_at = datetime.fromisoformat(v_data["created_at"]) if "created_at" in v_data else datetime.utcnow()
|
|
44
|
+
vault = models.Vault(
|
|
45
|
+
id=v_data["id"],
|
|
46
|
+
name=v_data["name"],
|
|
47
|
+
description=v_data.get("description", ""),
|
|
48
|
+
created_at=created_at
|
|
49
|
+
)
|
|
50
|
+
db.add(vault)
|
|
51
|
+
else:
|
|
52
|
+
existing_vault.name = v_data["name"]
|
|
53
|
+
existing_vault.description = v_data.get("description", "")
|
|
54
|
+
|
|
55
|
+
# Import Queries
|
|
56
|
+
for q_data in data.get("queries", []):
|
|
57
|
+
existing_query = db.query(models.Query).filter(models.Query.id == q_data["id"]).first()
|
|
58
|
+
if not existing_query:
|
|
59
|
+
query = models.Query(
|
|
60
|
+
id=q_data["id"],
|
|
61
|
+
vault_id=q_data["vault_id"],
|
|
62
|
+
title=q_data["title"],
|
|
63
|
+
sql_query=q_data["sql_query"],
|
|
64
|
+
sql_comments=q_data.get("sql_comments", ""),
|
|
65
|
+
dialect=q_data.get("dialect", "Snowflake")
|
|
66
|
+
)
|
|
67
|
+
db.add(query)
|
|
68
|
+
else:
|
|
69
|
+
existing_query.title = q_data["title"]
|
|
70
|
+
existing_query.sql_query = q_data["sql_query"]
|
|
71
|
+
existing_query.sql_comments = q_data.get("sql_comments", "")
|
|
72
|
+
existing_query.dialect = q_data.get("dialect", "Snowflake")
|
|
73
|
+
|
|
74
|
+
# Import Contexts
|
|
75
|
+
for c_data in data.get("contexts", []):
|
|
76
|
+
existing_context = db.query(models.QueryContext).filter(models.QueryContext.query_id == c_data["query_id"]).first()
|
|
77
|
+
if not existing_context:
|
|
78
|
+
context = models.QueryContext(
|
|
79
|
+
query_id=c_data["query_id"],
|
|
80
|
+
context_json=c_data["context_json"],
|
|
81
|
+
approval_status=c_data.get("approval_status", "approved")
|
|
82
|
+
)
|
|
83
|
+
db.add(context)
|
|
84
|
+
else:
|
|
85
|
+
existing_context.context_json = c_data["context_json"]
|
|
86
|
+
existing_context.approval_status = c_data.get("approval_status", "approved")
|
|
87
|
+
|
|
88
|
+
# Import Playbooks
|
|
89
|
+
for p_data in data.get("playbooks", []):
|
|
90
|
+
existing_playbook = db.query(models.Playbook).filter(models.Playbook.id == p_data["id"]).first()
|
|
91
|
+
if not existing_playbook:
|
|
92
|
+
playbook = models.Playbook(
|
|
93
|
+
id=p_data["id"],
|
|
94
|
+
vault_id=p_data["vault_id"],
|
|
95
|
+
name=p_data["name"],
|
|
96
|
+
playbook_type=p_data["playbook_type"],
|
|
97
|
+
content=p_data["content"]
|
|
98
|
+
)
|
|
99
|
+
db.add(playbook)
|
|
100
|
+
else:
|
|
101
|
+
existing_playbook.name = p_data["name"]
|
|
102
|
+
existing_playbook.playbook_type = p_data["playbook_type"]
|
|
103
|
+
existing_playbook.content = p_data["content"]
|
|
104
|
+
|
|
105
|
+
db.commit()
|
|
106
|
+
|
|
107
|
+
# 2. Iterate and trigger embedding regeneration
|
|
108
|
+
for q in data.get("queries", []):
|
|
109
|
+
# We need the context for this query
|
|
110
|
+
context = next((c for c in data.get("contexts", []) if c["query_id"] == q["id"]), None)
|
|
111
|
+
|
|
112
|
+
doc_text = q["sql_query"]
|
|
113
|
+
if context:
|
|
114
|
+
doc_text += "\n" + json.dumps(context["context_json"])
|
|
115
|
+
|
|
116
|
+
# Rebuild local embedding in ChromaDB
|
|
117
|
+
index_query(
|
|
118
|
+
vault_id=q["vault_id"],
|
|
119
|
+
query_id=q["id"],
|
|
120
|
+
document_text=doc_text,
|
|
121
|
+
metadata={"title": q["title"]}
|
|
122
|
+
)
|
|
123
|
+
|
|
124
|
+
return True
|
|
@@ -9,7 +9,7 @@ backend/app/models.py
|
|
|
9
9
|
backend/app/schemas.py
|
|
10
10
|
backend/app/dist/index.html
|
|
11
11
|
backend/app/dist/assets/index-BDTPNUTQ.css
|
|
12
|
-
backend/app/dist/assets/index-
|
|
12
|
+
backend/app/dist/assets/index-C0PfxljE.js
|
|
13
13
|
backend/app/dist/assets/logo-RBZv3XvP.png
|
|
14
14
|
backend/app/routers/__init__.py
|
|
15
15
|
backend/app/routers/core.py
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
import os
|
|
2
|
-
import zipfile
|
|
3
|
-
import json
|
|
4
|
-
from datetime import datetime
|
|
5
|
-
from sqlalchemy.orm import Session
|
|
6
|
-
from .. import models
|
|
7
|
-
from .vector_store import index_query
|
|
8
|
-
|
|
9
|
-
def export_knowledge_base(db: Session, export_dir: str):
|
|
10
|
-
"""Exports SQLite content to a .slothkb zip file without embeddings."""
|
|
11
|
-
vaults = db.query(models.Vault).all()
|
|
12
|
-
queries = db.query(models.Query).all()
|
|
13
|
-
contexts = db.query(models.QueryContext).all()
|
|
14
|
-
playbooks = db.query(models.Playbook).all()
|
|
15
|
-
|
|
16
|
-
export_data = {
|
|
17
|
-
"vaults": [{"id": v.id, "name": v.name, "description": v.description, "created_at": str(v.created_at)} for v in vaults],
|
|
18
|
-
"queries": [{"id": q.id, "vault_id": q.vault_id, "title": q.title, "sql_query": q.sql_query, "sql_comments": q.sql_comments, "dialect": q.dialect} for q in queries],
|
|
19
|
-
"contexts": [{"query_id": c.query_id, "context_json": c.context_json, "approval_status": c.approval_status} for c in contexts],
|
|
20
|
-
"playbooks": [{"id": p.id, "vault_id": p.vault_id, "name": p.name, "playbook_type": p.playbook_type, "content": p.content} for p in playbooks]
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
os.makedirs(export_dir, exist_ok=True)
|
|
24
|
-
timestamp = datetime.now().strftime("%Y%m%d%H%M%S")
|
|
25
|
-
file_path = os.path.join(export_dir, f"slothquery_export_{timestamp}.slothkb")
|
|
26
|
-
|
|
27
|
-
with zipfile.ZipFile(file_path, 'w', zipfile.ZIP_DEFLATED) as zf:
|
|
28
|
-
zf.writestr("queries_and_contexts.json", json.dumps(export_data, indent=2))
|
|
29
|
-
|
|
30
|
-
return file_path
|
|
31
|
-
|
|
32
|
-
def import_knowledge_base(db: Session, slothkb_path: str):
|
|
33
|
-
"""Imports .slothkb file and regenerates BGE embeddings locally."""
|
|
34
|
-
with zipfile.ZipFile(slothkb_path, 'r') as zf:
|
|
35
|
-
with zf.open("queries_and_contexts.json") as f:
|
|
36
|
-
data = json.loads(f.read().decode("utf-8"))
|
|
37
|
-
|
|
38
|
-
# Iterate and trigger embedding regeneration
|
|
39
|
-
for q in data.get("queries", []):
|
|
40
|
-
# We need the context for this query
|
|
41
|
-
context = next((c for c in data.get("contexts", []) if c["query_id"] == q["id"]), None)
|
|
42
|
-
|
|
43
|
-
doc_text = q["sql_query"]
|
|
44
|
-
if context:
|
|
45
|
-
doc_text += "\n" + json.dumps(context["context_json"])
|
|
46
|
-
|
|
47
|
-
# Rebuild local embedding in ChromaDB
|
|
48
|
-
index_query(
|
|
49
|
-
vault_id=q["vault_id"],
|
|
50
|
-
query_id=q["id"],
|
|
51
|
-
document_text=doc_text,
|
|
52
|
-
metadata={"title": q["title"]}
|
|
53
|
-
)
|
|
54
|
-
|
|
55
|
-
return True
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|