diff --git a/_pagefind/fragment/en_8028dad.pf_fragment b/_pagefind/fragment/en_8028dad.pf_fragment
deleted file mode 100644
index 3be3e34e..00000000
Binary files a/_pagefind/fragment/en_8028dad.pf_fragment and /dev/null differ
diff --git a/_pagefind/fragment/en_afb43dd.pf_fragment b/_pagefind/fragment/en_afb43dd.pf_fragment
new file mode 100644
index 00000000..73a50fe1
Binary files /dev/null and b/_pagefind/fragment/en_afb43dd.pf_fragment differ
diff --git a/_pagefind/index/en_5c79efa.pf_index b/_pagefind/index/en_5c79efa.pf_index
deleted file mode 100644
index c92563c2..00000000
Binary files a/_pagefind/index/en_5c79efa.pf_index and /dev/null differ
diff --git a/_pagefind/index/en_b4cb7a4.pf_index b/_pagefind/index/en_b4cb7a4.pf_index
new file mode 100644
index 00000000..a7b4a262
Binary files /dev/null and b/_pagefind/index/en_b4cb7a4.pf_index differ
diff --git a/_pagefind/index/en_d7bcddd.pf_index b/_pagefind/index/en_d7bcddd.pf_index
new file mode 100644
index 00000000..8d0a37ac
Binary files /dev/null and b/_pagefind/index/en_d7bcddd.pf_index differ
diff --git a/_pagefind/index/en_ebcef13.pf_index b/_pagefind/index/en_ebcef13.pf_index
deleted file mode 100644
index 4fc13805..00000000
Binary files a/_pagefind/index/en_ebcef13.pf_index and /dev/null differ
diff --git a/_pagefind/pagefind-entry.json b/_pagefind/pagefind-entry.json
index 9465d178..fdf6653b 100644
--- a/_pagefind/pagefind-entry.json
+++ b/_pagefind/pagefind-entry.json
@@ -1 +1 @@
-{"version":"1.5.2","languages":{"en":{"hash":"en_828355c1b8","wasm":"en","page_count":21}},"include_characters":["_","‿","⁀","⁔","︳","︴","﹍","﹎","﹏","_"]}
\ No newline at end of file
+{"version":"1.5.2","languages":{"en":{"hash":"en_7b0944d1d2","wasm":"en","page_count":21}},"include_characters":["_","‿","⁀","⁔","︳","︴","﹍","﹎","﹏","_"]}
\ No newline at end of file
diff --git a/_pagefind/pagefind.en_7b0944d1d2.pf_meta b/_pagefind/pagefind.en_7b0944d1d2.pf_meta
new file mode 100644
index 00000000..2846b3a0
Binary files /dev/null and b/_pagefind/pagefind.en_7b0944d1d2.pf_meta differ
diff --git a/_pagefind/pagefind.en_828355c1b8.pf_meta b/_pagefind/pagefind.en_828355c1b8.pf_meta
deleted file mode 100644
index c041e60f..00000000
Binary files a/_pagefind/pagefind.en_828355c1b8.pf_meta and /dev/null differ
diff --git a/advanced/json-output/index.html b/advanced/json-output/index.html
index 64ace359..a5919a4c 100644
--- a/advanced/json-output/index.html
+++ b/advanced/json-output/index.html
@@ -7,7 +7,7 @@
-
+
diff --git a/advanced/subagents/index.html b/advanced/subagents/index.html
index 06aa2c5f..6d4c6ab2 100644
--- a/advanced/subagents/index.html
+++ b/advanced/subagents/index.html
@@ -7,7 +7,7 @@
-
+
diff --git a/advanced/testing/index.html b/advanced/testing/index.html
index cd83a011..5993d4a1 100644
--- a/advanced/testing/index.html
+++ b/advanced/testing/index.html
@@ -7,7 +7,7 @@
-
+
diff --git a/assets/commands-CjvM1xle.js b/assets/commands-UPFOPOAU.js
similarity index 87%
rename from assets/commands-CjvM1xle.js
rename to assets/commands-UPFOPOAU.js
index 38d99cce..cb356108 100644
--- a/assets/commands-CjvM1xle.js
+++ b/assets/commands-UPFOPOAU.js
@@ -144,6 +144,20 @@ const e={frontmatter:{title:"Commands",description:"Complete reference for all K
Model continues from the interruption point with the new guidance
Example: While the model is writing code, press Ctrl+X s and type "Use async/await instead" to change the implementation approach.
+ Image attachments
+Attach images to your next prompt straight from the clipboard:
+
+Copy an image (e.g. a screenshot) to the system clipboard, then press Ctrl+V in the input to attach it.
+Press Ctrl+U to clear all pending image attachments.
+Attachments are sent alongside your text when you submit, and cleared afterward.
+
+When a terminal supports color, Kit renders a small low-resolution thumbnail preview of each pending image directly in the input, below the [N image(s) attached] indicator, so you can confirm the right image was attached before sending.
+The preview is drawn with Unicode half-block characters and ordinary terminal colors — not a graphics protocol — so it renders correctly inside terminal multiplexers like tmux and zellij . Thumbnails are capped to a small cell box for a glanceable, low-res look.
+
+Best fidelity needs a truecolor terminal (COLORTERM=truecolor); Kit degrades to 256-color where truecolor is unavailable.
+On terminals with neither, the preview is skipped and the [N image(s) attached] text indicator is shown alone.
+
+You can also attach image files by referencing them with @path/to/image.png — binary files are auto-detected by MIME type. See Quick Start for the @ attachment syntax.
Prompt templates
Creating templates
Templates use YAML frontmatter for metadata and support argument placeholders:
@@ -198,7 +212,7 @@ const e={frontmatter:{title:"Commands",description:"Complete reference for all K
ACP server
Run Kit as an ACP (Agent Client Protocol) agent server. ACP-compatible clients communicate with Kit over JSON-RPC 2.0 on stdin/stdout.
kit acp # Start as ACP agent
-kit acp --debug # With debug logging to stderr `,headings:[{depth:2,text:"Authentication",id:"authentication"},{depth:2,text:"Model database",id:"model-database"},{depth:2,text:"Extension management",id:"extension-management"},{depth:3,text:"Installing extensions from git",id:"installing-extensions-from-git"},{depth:2,text:"Skills",id:"skills"},{depth:2,text:"Interactive slash commands",id:"interactive-slash-commands"},{depth:3,text:"Prompt history",id:"prompt-history"},{depth:3,text:"Cancelling operations",id:"cancelling-operations"},{depth:3,text:"External editor",id:"external-editor"},{depth:3,text:"Mid-turn steering",id:"mid-turn-steering"},{depth:2,text:"Prompt templates",id:"prompt-templates"},{depth:3,text:"Creating templates",id:"creating-templates"},{depth:3,text:"Using templates",id:"using-templates"},{depth:3,text:"Argument placeholders",id:"argument-placeholders"},{depth:3,text:"CLI flags",id:"cli-flags"},{depth:2,text:"ACP server",id:"acp-server"}],raw:`
+kit acp --debug # With debug logging to stderr `,headings:[{depth:2,text:"Authentication",id:"authentication"},{depth:2,text:"Model database",id:"model-database"},{depth:2,text:"Extension management",id:"extension-management"},{depth:3,text:"Installing extensions from git",id:"installing-extensions-from-git"},{depth:2,text:"Skills",id:"skills"},{depth:2,text:"Interactive slash commands",id:"interactive-slash-commands"},{depth:3,text:"Prompt history",id:"prompt-history"},{depth:3,text:"Cancelling operations",id:"cancelling-operations"},{depth:3,text:"External editor",id:"external-editor"},{depth:3,text:"Mid-turn steering",id:"mid-turn-steering"},{depth:3,text:"Image attachments",id:"image-attachments"},{depth:2,text:"Prompt templates",id:"prompt-templates"},{depth:3,text:"Creating templates",id:"creating-templates"},{depth:3,text:"Using templates",id:"using-templates"},{depth:3,text:"Argument placeholders",id:"argument-placeholders"},{depth:3,text:"CLI flags",id:"cli-flags"},{depth:2,text:"ACP server",id:"acp-server"}],raw:`
# Commands
## Authentication
@@ -306,6 +320,23 @@ Press **Ctrl+X s** during streaming to inject a system-level instruction mid-tur
Example: While the model is writing code, press Ctrl+X s and type "Use async/await instead" to change the implementation approach.
+### Image attachments
+
+Attach images to your next prompt straight from the clipboard:
+
+- Copy an image (e.g. a screenshot) to the system clipboard, then press **Ctrl+V** in the input to attach it.
+- Press **Ctrl+U** to clear all pending image attachments.
+- Attachments are sent alongside your text when you submit, and cleared afterward.
+
+When a terminal supports color, Kit renders a small low-resolution **thumbnail preview** of each pending image directly in the input, below the \`[N image(s) attached]\` indicator, so you can confirm the right image was attached before sending.
+
+The preview is drawn with Unicode half-block characters and ordinary terminal colors — not a graphics protocol — so it renders correctly inside terminal multiplexers like **tmux** and **zellij**. Thumbnails are capped to a small cell box for a glanceable, low-res look.
+
+- Best fidelity needs a **truecolor** terminal (\`COLORTERM=truecolor\`); Kit degrades to 256-color where truecolor is unavailable.
+- On terminals with neither, the preview is skipped and the \`[N image(s) attached]\` text indicator is shown alone.
+
+You can also attach image files by referencing them with \`@path/to/image.png\` — binary files are auto-detected by MIME type. See [Quick Start](/quick-start) for the \`@\` attachment syntax.
+
## Prompt templates
### Creating templates
diff --git a/assets/index-Caxbfw96.js b/assets/index-Bb5NSVzf.js
similarity index 83%
rename from assets/index-Caxbfw96.js
rename to assets/index-Bb5NSVzf.js
index 74f40c5e..55c78935 100644
--- a/assets/index-Caxbfw96.js
+++ b/assets/index-Bb5NSVzf.js
@@ -1,4 +1,4 @@
-(function(){const h=document.createElement("link").relList;if(h&&h.supports&&h.supports("modulepreload"))return;for(const v of document.querySelectorAll('link[rel="modulepreload"]'))c(v);new MutationObserver(v=>{for(const E of v)if(E.type==="childList")for(const M of E.addedNodes)M.tagName==="LINK"&&M.rel==="modulepreload"&&c(M)}).observe(document,{childList:!0,subtree:!0});function d(v){const E={};return v.integrity&&(E.integrity=v.integrity),v.referrerPolicy&&(E.referrerPolicy=v.referrerPolicy),v.crossOrigin==="use-credentials"?E.credentials="include":v.crossOrigin==="anonymous"?E.credentials="omit":E.credentials="same-origin",E}function c(v){if(v.ep)return;v.ep=!0;const E=d(v);fetch(v.href,E)}})();function Ch(u){return u&&u.__esModule&&Object.prototype.hasOwnProperty.call(u,"default")?u.default:u}var Lu={exports:{}},ii={};/**
+(function(){const p=document.createElement("link").relList;if(p&&p.supports&&p.supports("modulepreload"))return;for(const v of document.querySelectorAll('link[rel="modulepreload"]'))c(v);new MutationObserver(v=>{for(const E of v)if(E.type==="childList")for(const M of E.addedNodes)M.tagName==="LINK"&&M.rel==="modulepreload"&&c(M)}).observe(document,{childList:!0,subtree:!0});function d(v){const E={};return v.integrity&&(E.integrity=v.integrity),v.referrerPolicy&&(E.referrerPolicy=v.referrerPolicy),v.crossOrigin==="use-credentials"?E.credentials="include":v.crossOrigin==="anonymous"?E.credentials="omit":E.credentials="same-origin",E}function c(v){if(v.ep)return;v.ep=!0;const E=d(v);fetch(v.href,E)}})();function Cp(u){return u&&u.__esModule&&Object.prototype.hasOwnProperty.call(u,"default")?u.default:u}var Lu={exports:{}},ii={};/**
* @license React
* react-jsx-runtime.production.js
*
@@ -6,7 +6,7 @@
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
- */var Yd;function Ah(){if(Yd)return ii;Yd=1;var u=Symbol.for("react.transitional.element"),h=Symbol.for("react.fragment");function d(c,v,E){var M=null;if(E!==void 0&&(M=""+E),v.key!==void 0&&(M=""+v.key),"key"in v){E={};for(var O in v)O!=="key"&&(E[O]=v[O])}else E=v;return v=E.ref,{$$typeof:u,type:c,key:M,ref:v!==void 0?v:null,props:E}}return ii.Fragment=h,ii.jsx=d,ii.jsxs=d,ii}var Kd;function jh(){return Kd||(Kd=1,Lu.exports=Ah()),Lu.exports}var s=jh(),Gu={exports:{}},ot={};/**
+ */var Yd;function jp(){if(Yd)return ii;Yd=1;var u=Symbol.for("react.transitional.element"),p=Symbol.for("react.fragment");function d(c,v,E){var M=null;if(E!==void 0&&(M=""+E),v.key!==void 0&&(M=""+v.key),"key"in v){E={};for(var O in v)O!=="key"&&(E[O]=v[O])}else E=v;return v=E.ref,{$$typeof:u,type:c,key:M,ref:v!==void 0?v:null,props:E}}return ii.Fragment=p,ii.jsx=d,ii.jsxs=d,ii}var Kd;function Ap(){return Kd||(Kd=1,Lu.exports=jp()),Lu.exports}var s=Ap(),Gu={exports:{}},ot={};/**
* @license React
* react.production.js
*
@@ -14,7 +14,7 @@
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
- */var Xd;function Mh(){if(Xd)return ot;Xd=1;var u=Symbol.for("react.transitional.element"),h=Symbol.for("react.portal"),d=Symbol.for("react.fragment"),c=Symbol.for("react.strict_mode"),v=Symbol.for("react.profiler"),E=Symbol.for("react.consumer"),M=Symbol.for("react.context"),O=Symbol.for("react.forward_ref"),C=Symbol.for("react.suspense"),y=Symbol.for("react.memo"),G=Symbol.for("react.lazy"),R=Symbol.for("react.activity"),K=Symbol.iterator;function nt(m){return m===null||typeof m!="object"?null:(m=K&&m[K]||m["@@iterator"],typeof m=="function"?m:null)}var xt={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Dt=Object.assign,jt={};function W(m,_,N){this.props=m,this.context=_,this.refs=jt,this.updater=N||xt}W.prototype.isReactComponent={},W.prototype.setState=function(m,_){if(typeof m!="object"&&typeof m!="function"&&m!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,m,_,"setState")},W.prototype.forceUpdate=function(m){this.updater.enqueueForceUpdate(this,m,"forceUpdate")};function I(){}I.prototype=W.prototype;function ct(m,_,N){this.props=m,this.context=_,this.refs=jt,this.updater=N||xt}var Q=ct.prototype=new I;Q.constructor=ct,Dt(Q,W.prototype),Q.isPureReactComponent=!0;var Y=Array.isArray;function H(){}var U={H:null,A:null,T:null,S:null},at=Object.prototype.hasOwnProperty;function lt(m,_,N){var L=N.ref;return{$$typeof:u,type:m,key:_,ref:L!==void 0?L:null,props:N}}function P(m,_){return lt(m.type,_,m.props)}function mt(m){return typeof m=="object"&&m!==null&&m.$$typeof===u}function tt(m){var _={"=":"=0",":":"=2"};return"$"+m.replace(/[=:]/g,function(N){return _[N]})}var Mt=/\/+/g;function $t(m,_){return typeof m=="object"&&m!==null&&m.key!=null?tt(""+m.key):_.toString(36)}function ft(m){switch(m.status){case"fulfilled":return m.value;case"rejected":throw m.reason;default:switch(typeof m.status=="string"?m.then(H,H):(m.status="pending",m.then(function(_){m.status==="pending"&&(m.status="fulfilled",m.value=_)},function(_){m.status==="pending"&&(m.status="rejected",m.reason=_)})),m.status){case"fulfilled":return m.value;case"rejected":throw m.reason}}throw m}function A(m,_,N,L,it){var rt=typeof m;(rt==="undefined"||rt==="boolean")&&(m=null);var Et=!1;if(m===null)Et=!0;else switch(rt){case"bigint":case"string":case"number":Et=!0;break;case"object":switch(m.$$typeof){case u:case h:Et=!0;break;case G:return Et=m._init,A(Et(m._payload),_,N,L,it)}}if(Et)return it=it(m),Et=L===""?"."+$t(m,0):L,Y(it)?(N="",Et!=null&&(N=Et.replace(Mt,"$&/")+"/"),A(it,_,N,"",function(Ze){return Ze})):it!=null&&(mt(it)&&(it=P(it,N+(it.key==null||m&&m.key===it.key?"":(""+it.key).replace(Mt,"$&/")+"/")+Et)),_.push(it)),1;Et=0;var It=L===""?".":L+":";if(Y(m))for(var Ut=0;Ut>>1,Tt=A[J];if(0>>1;Jv(N,Z))Lv(it,N)?(A[J]=it,A[L]=Z,J=L):(A[J]=N,A[_]=Z,J=_);else if(Lv(it,Z))A[J]=it,A[L]=Z,J=L;else break t}}return B}function v(A,B){var Z=A.sortIndex-B.sortIndex;return Z!==0?Z:A.id-B.id}if(u.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var E=performance;u.unstable_now=function(){return E.now()}}else{var M=Date,O=M.now();u.unstable_now=function(){return M.now()-O}}var C=[],y=[],G=1,R=null,K=3,nt=!1,xt=!1,Dt=!1,jt=!1,W=typeof setTimeout=="function"?setTimeout:null,I=typeof clearTimeout=="function"?clearTimeout:null,ct=typeof setImmediate<"u"?setImmediate:null;function Q(A){for(var B=d(y);B!==null;){if(B.callback===null)c(y);else if(B.startTime<=A)c(y),B.sortIndex=B.expirationTime,h(C,B);else break;B=d(y)}}function Y(A){if(Dt=!1,Q(A),!xt)if(d(C)!==null)xt=!0,H||(H=!0,tt());else{var B=d(y);B!==null&&ft(Y,B.startTime-A)}}var H=!1,U=-1,at=5,lt=-1;function P(){return jt?!0:!(u.unstable_now()-ltA&&P());){var J=R.callback;if(typeof J=="function"){R.callback=null,K=R.priorityLevel;var Tt=J(R.expirationTime<=A);if(A=u.unstable_now(),typeof Tt=="function"){R.callback=Tt,Q(A),B=!0;break e}R===d(C)&&c(C),Q(A)}else c(C);R=d(C)}if(R!==null)B=!0;else{var m=d(y);m!==null&&ft(Y,m.startTime-A),B=!1}}break t}finally{R=null,K=Z,nt=!1}B=void 0}}finally{B?tt():H=!1}}}var tt;if(typeof ct=="function")tt=function(){ct(mt)};else if(typeof MessageChannel<"u"){var Mt=new MessageChannel,$t=Mt.port2;Mt.port1.onmessage=mt,tt=function(){$t.postMessage(null)}}else tt=function(){W(mt,0)};function ft(A,B){U=W(function(){A(u.unstable_now())},B)}u.unstable_IdlePriority=5,u.unstable_ImmediatePriority=1,u.unstable_LowPriority=4,u.unstable_NormalPriority=3,u.unstable_Profiling=null,u.unstable_UserBlockingPriority=2,u.unstable_cancelCallback=function(A){A.callback=null},u.unstable_forceFrameRate=function(A){0>A||125J?(A.sortIndex=Z,h(y,A),d(C)===null&&A===d(y)&&(Dt?(I(U),U=-1):Dt=!0,ft(Y,Z-J))):(A.sortIndex=Tt,h(C,A),xt||nt||(xt=!0,H||(H=!0,tt()))),A},u.unstable_shouldYield=P,u.unstable_wrapCallback=function(A){var B=K;return function(){var Z=K;K=B;try{return A.apply(this,arguments)}finally{K=Z}}}})(Xu)),Xu}var Zd;function _h(){return Zd||(Zd=1,Ku.exports=kh()),Ku.exports}var Qu={exports:{}},re={};/**
+ */var Vd;function kp(){return Vd||(Vd=1,(function(u){function p(j,B){var Z=j.length;j.push(B);t:for(;0>>1,Tt=j[J];if(0>>1;Jv(N,Z))Lv(it,N)?(j[J]=it,j[L]=Z,J=L):(j[J]=N,j[_]=Z,J=_);else if(Lv(it,Z))j[J]=it,j[L]=Z,J=L;else break t}}return B}function v(j,B){var Z=j.sortIndex-B.sortIndex;return Z!==0?Z:j.id-B.id}if(u.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var E=performance;u.unstable_now=function(){return E.now()}}else{var M=Date,O=M.now();u.unstable_now=function(){return M.now()-O}}var C=[],y=[],G=1,R=null,K=3,nt=!1,xt=!1,Dt=!1,At=!1,W=typeof setTimeout=="function"?setTimeout:null,I=typeof clearTimeout=="function"?clearTimeout:null,ct=typeof setImmediate<"u"?setImmediate:null;function Q(j){for(var B=d(y);B!==null;){if(B.callback===null)c(y);else if(B.startTime<=j)c(y),B.sortIndex=B.expirationTime,p(C,B);else break;B=d(y)}}function Y(j){if(Dt=!1,Q(j),!xt)if(d(C)!==null)xt=!0,H||(H=!0,tt());else{var B=d(y);B!==null&&ft(Y,B.startTime-j)}}var H=!1,U=-1,at=5,lt=-1;function P(){return At?!0:!(u.unstable_now()-ltj&&P());){var J=R.callback;if(typeof J=="function"){R.callback=null,K=R.priorityLevel;var Tt=J(R.expirationTime<=j);if(j=u.unstable_now(),typeof Tt=="function"){R.callback=Tt,Q(j),B=!0;break e}R===d(C)&&c(C),Q(j)}else c(C);R=d(C)}if(R!==null)B=!0;else{var m=d(y);m!==null&&ft(Y,m.startTime-j),B=!1}}break t}finally{R=null,K=Z,nt=!1}B=void 0}}finally{B?tt():H=!1}}}var tt;if(typeof ct=="function")tt=function(){ct(mt)};else if(typeof MessageChannel<"u"){var Mt=new MessageChannel,$t=Mt.port2;Mt.port1.onmessage=mt,tt=function(){$t.postMessage(null)}}else tt=function(){W(mt,0)};function ft(j,B){U=W(function(){j(u.unstable_now())},B)}u.unstable_IdlePriority=5,u.unstable_ImmediatePriority=1,u.unstable_LowPriority=4,u.unstable_NormalPriority=3,u.unstable_Profiling=null,u.unstable_UserBlockingPriority=2,u.unstable_cancelCallback=function(j){j.callback=null},u.unstable_forceFrameRate=function(j){0>j||125J?(j.sortIndex=Z,p(y,j),d(C)===null&&j===d(y)&&(Dt?(I(U),U=-1):Dt=!0,ft(Y,Z-J))):(j.sortIndex=Tt,p(C,j),xt||nt||(xt=!0,H||(H=!0,tt()))),j},u.unstable_shouldYield=P,u.unstable_wrapCallback=function(j){var B=K;return function(){var Z=K;K=B;try{return j.apply(this,arguments)}finally{K=Z}}}})(Xu)),Xu}var Zd;function _p(){return Zd||(Zd=1,Ku.exports=kp()),Ku.exports}var Qu={exports:{}},re={};/**
* @license React
* react-dom.production.js
*
@@ -30,7 +30,7 @@
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
- */var Jd;function Dh(){if(Jd)return re;Jd=1;var u=$u();function h(C){var y="https://react.dev/errors/"+C;if(1"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(u)}catch(h){console.error(h)}}return u(),Qu.exports=Dh(),Qu.exports}/**
+ */var Jd;function Dp(){if(Jd)return re;Jd=1;var u=$u();function p(C){var y="https://react.dev/errors/"+C;if(1"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(u)}catch(p){console.error(p)}}return u(),Qu.exports=Dp(),Qu.exports}/**
* @license React
* react-dom-client.production.js
*
@@ -38,24 +38,24 @@
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
- */var Fd;function Rh(){if(Fd)return oi;Fd=1;var u=_h(),h=$u(),d=Oh();function c(t){var e="https://react.dev/errors/"+t;if(1Tt||(t.current=J[Tt],J[Tt]=null,Tt--)}function N(t,e){Tt++,J[Tt]=t.current,t.current=e}var L=m(null),it=m(null),rt=m(null),Et=m(null);function It(t,e){switch(N(rt,e),N(it,t),N(L,null),e.nodeType){case 9:case 11:t=(t=e.documentElement)&&(t=t.namespaceURI)?fd(t):0;break;default:if(t=e.tagName,e=e.namespaceURI)e=fd(e),t=dd(e,t);else switch(t){case"svg":t=1;break;case"math":t=2;break;default:t=0}}_(L),N(L,t)}function Ut(){_(L),_(it),_(rt)}function Ze(t){t.memoizedState!==null&&N(Et,t);var e=L.current,n=dd(e,t.type);e!==n&&(N(it,t),N(L,n))}function pa(t){it.current===t&&(_(L),_(it)),Et.current===t&&(_(Et),ei._currentValue=Z)}var ha,rl;function Je(t){if(ha===void 0)try{throw Error()}catch(n){var e=n.stack.trim().match(/\n( *(at )?)/);ha=e&&e[1]||"",rl=-1Tt||(t.current=J[Tt],J[Tt]=null,Tt--)}function N(t,e){Tt++,J[Tt]=t.current,t.current=e}var L=m(null),it=m(null),rt=m(null),Et=m(null);function It(t,e){switch(N(rt,e),N(it,t),N(L,null),e.nodeType){case 9:case 11:t=(t=e.documentElement)&&(t=t.namespaceURI)?fd(t):0;break;default:if(t=e.tagName,e=e.namespaceURI)e=fd(e),t=dd(e,t);else switch(t){case"svg":t=1;break;case"math":t=2;break;default:t=0}}_(L),N(L,t)}function Ut(){_(L),_(it),_(rt)}function Ze(t){t.memoizedState!==null&&N(Et,t);var e=L.current,n=dd(e,t.type);e!==n&&(N(it,t),N(L,n))}function ha(t){it.current===t&&(_(L),_(it)),Et.current===t&&(_(Et),ei._currentValue=Z)}var pa,rl;function Je(t){if(pa===void 0)try{throw Error()}catch(n){var e=n.stack.trim().match(/\n( *(at )?)/);pa=e&&e[1]||"",rl=-1)":-1l||f[a]!==S[l]){var j=`
-`+f[a].replace(" at new "," at ");return t.displayName&&j.includes("")&&(j=j.replace("",t.displayName)),j}while(1<=a&&0<=l);break}}}finally{cl=!1,Error.prepareStackTrace=n}return(n=t?t.displayName||t.name:"")?Je(n):""}function Do(t,e){switch(t.tag){case 26:case 27:case 5:return Je(t.type);case 16:return Je("Lazy");case 13:return t.child!==e&&e!==null?Je("Suspense Fallback"):Je("Suspense");case 19:return Je("SuspenseList");case 0:case 15:return ga(t.type,!1);case 11:return ga(t.type.render,!1);case 1:return ga(t.type,!0);case 31:return Je("Activity");default:return""}}function We(t){try{var e="",n=null;do e+=Do(t,n),n=t,t=t.return;while(t);return e}catch(a){return`
+`);for(l=a=0;al||f[a]!==S[l]){var A=`
+`+f[a].replace(" at new "," at ");return t.displayName&&A.includes("")&&(A=A.replace("",t.displayName)),A}while(1<=a&&0<=l);break}}}finally{cl=!1,Error.prepareStackTrace=n}return(n=t?t.displayName||t.name:"")?Je(n):""}function Do(t,e){switch(t.tag){case 26:case 27:case 5:return Je(t.type);case 16:return Je("Lazy");case 13:return t.child!==e&&e!==null?Je("Suspense Fallback"):Je("Suspense");case 19:return Je("SuspenseList");case 0:case 15:return ga(t.type,!1);case 11:return ga(t.type.render,!1);case 1:return ga(t.type,!0);case 31:return Je("Activity");default:return""}}function We(t){try{var e="",n=null;do e+=Do(t,n),n=t,t=t.return;while(t);return e}catch(a){return`
Error generating stack: `+a.message+`
-`+a.stack}}var Fn=Object.prototype.hasOwnProperty,fl=u.unstable_scheduleCallback,va=u.unstable_cancelCallback,Oo=u.unstable_shouldYield,si=u.unstable_requestPaint,se=u.unstable_now,ui=u.unstable_getCurrentPriorityLevel,te=u.unstable_ImmediatePriority,ya=u.unstable_UserBlockingPriority,xn=u.unstable_NormalPriority,Sn=u.unstable_LowPriority,ri=u.unstable_IdlePriority,Pu=u.log,ba=u.unstable_setDisableYieldValue,ye=null,ue=null;function je(t){if(typeof Pu=="function"&&ba(t),ue&&typeof ue.setStrictMode=="function")try{ue.setStrictMode(ye,t)}catch{}}var ee=Math.clz32?Math.clz32:Sa,ci=Math.log,xa=Math.LN2;function Sa(t){return t>>>=0,t===0?32:31-(ci(t)/xa|0)|0}var Fe=256,$e=262144,Ie=4194304;function Pe(t){var e=t&42;if(e!==0)return e;switch(t&-t){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return t&261888;case 262144:case 524288:case 1048576:case 2097152:return t&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return t&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return t}}function Ta(t,e,n){var a=t.pendingLanes;if(a===0)return 0;var l=0,i=t.suspendedLanes,o=t.pingedLanes;t=t.warmLanes;var r=a&134217727;return r!==0?(a=r&~i,a!==0?l=Pe(a):(o&=r,o!==0?l=Pe(o):n||(n=r&~t,n!==0&&(l=Pe(n))))):(r=a&~i,r!==0?l=Pe(r):o!==0?l=Pe(o):n||(n=a&~t,n!==0&&(l=Pe(n)))),l===0?0:e!==0&&e!==l&&(e&i)===0&&(i=l&-l,n=e&-e,i>=n||i===32&&(n&4194048)!==0)?e:l}function Tn(t,e){return(t.pendingLanes&~(t.suspendedLanes&~t.pingedLanes)&e)===0}function Ne(t,e){switch(t){case 1:case 2:case 4:case 8:case 64:return e+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Ea(){var t=Ie;return Ie<<=1,(Ie&62914560)===0&&(Ie=4194304),t}function za(t){for(var e=[],n=0;31>n;n++)e.push(t);return e}function En(t,e){t.pendingLanes|=e,e!==268435456&&(t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0)}function fi(t,e,n,a,l,i){var o=t.pendingLanes;t.pendingLanes=n,t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0,t.expiredLanes&=n,t.entangledLanes&=n,t.errorRecoveryDisabledLanes&=n,t.shellSuspendCounter=0;var r=t.entanglements,f=t.expirationTimes,S=t.hiddenUpdates;for(n=o&~n;0"u")return null;try{return t.activeElement||t.body}catch{return t.body}}var bm=/[\n"\\]/g;function ke(t){return t.replace(bm,function(e){return"\\"+e.charCodeAt(0).toString(16)+" "})}function wo(t,e,n,a,l,i,o,r){t.name="",o!=null&&typeof o!="function"&&typeof o!="symbol"&&typeof o!="boolean"?t.type=o:t.removeAttribute("type"),e!=null?o==="number"?(e===0&&t.value===""||t.value!=e)&&(t.value=""+Me(e)):t.value!==""+Me(e)&&(t.value=""+Me(e)):o!=="submit"&&o!=="reset"||t.removeAttribute("value"),e!=null?Bo(t,o,Me(e)):n!=null?Bo(t,o,Me(n)):a!=null&&t.removeAttribute("value"),l==null&&i!=null&&(t.defaultChecked=!!i),l!=null&&(t.checked=l&&typeof l!="function"&&typeof l!="symbol"),r!=null&&typeof r!="function"&&typeof r!="symbol"&&typeof r!="boolean"?t.name=""+Me(r):t.removeAttribute("name")}function lr(t,e,n,a,l,i,o,r){if(i!=null&&typeof i!="function"&&typeof i!="symbol"&&typeof i!="boolean"&&(t.type=i),e!=null||n!=null){if(!(i!=="submit"&&i!=="reset"||e!=null)){Ro(t);return}n=n!=null?""+Me(n):"",e=e!=null?""+Me(e):n,r||e===t.value||(t.value=e),t.defaultValue=e}a=a??l,a=typeof a!="function"&&typeof a!="symbol"&&!!a,t.checked=r?t.checked:!!a,t.defaultChecked=!!a,o!=null&&typeof o!="function"&&typeof o!="symbol"&&typeof o!="boolean"&&(t.name=o),Ro(t)}function Bo(t,e,n){e==="number"&&vi(t.ownerDocument)===t||t.defaultValue===""+n||(t.defaultValue=""+n)}function ka(t,e,n,a){if(t=t.options,e){e={};for(var l=0;l"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Lo=!1;if(an)try{var bl={};Object.defineProperty(bl,"passive",{get:function(){Lo=!0}}),window.addEventListener("test",bl,bl),window.removeEventListener("test",bl,bl)}catch{Lo=!1}var Cn=null,Go=null,bi=null;function fr(){if(bi)return bi;var t,e=Go,n=e.length,a,l="value"in Cn?Cn.value:Cn.textContent,i=l.length;for(t=0;t=Tl),vr=" ",yr=!1;function br(t,e){switch(t){case"keyup":return Zm.indexOf(e.keyCode)!==-1;case"keydown":return e.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function xr(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var Ra=!1;function Wm(t,e){switch(t){case"compositionend":return xr(e);case"keypress":return e.which!==32?null:(yr=!0,vr);case"textInput":return t=e.data,t===vr&&yr?null:t;default:return null}}function Fm(t,e){if(Ra)return t==="compositionend"||!Vo&&br(t,e)?(t=fr(),bi=Go=Cn=null,Ra=!1,t):null;switch(t){case"paste":return null;case"keypress":if(!(e.ctrlKey||e.altKey||e.metaKey)||e.ctrlKey&&e.altKey){if(e.char&&1=e)return{node:n,offset:e-t};t=a}t:{for(;n;){if(n.nextSibling){n=n.nextSibling;break t}n=n.parentNode}n=void 0}n=Mr(n)}}function _r(t,e){return t&&e?t===e?!0:t&&t.nodeType===3?!1:e&&e.nodeType===3?_r(t,e.parentNode):"contains"in t?t.contains(e):t.compareDocumentPosition?!!(t.compareDocumentPosition(e)&16):!1:!1}function Dr(t){t=t!=null&&t.ownerDocument!=null&&t.ownerDocument.defaultView!=null?t.ownerDocument.defaultView:window;for(var e=vi(t.document);e instanceof t.HTMLIFrameElement;){try{var n=typeof e.contentWindow.location.href=="string"}catch{n=!1}if(n)t=e.contentWindow;else break;e=vi(t.document)}return e}function Wo(t){var e=t&&t.nodeName&&t.nodeName.toLowerCase();return e&&(e==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||e==="textarea"||t.contentEditable==="true")}var lp=an&&"documentMode"in document&&11>=document.documentMode,wa=null,Fo=null,Al=null,$o=!1;function Or(t,e,n){var a=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;$o||wa==null||wa!==vi(a)||(a=wa,"selectionStart"in a&&Wo(a)?a={start:a.selectionStart,end:a.selectionEnd}:(a=(a.ownerDocument&&a.ownerDocument.defaultView||window).getSelection(),a={anchorNode:a.anchorNode,anchorOffset:a.anchorOffset,focusNode:a.focusNode,focusOffset:a.focusOffset}),Al&&Cl(Al,a)||(Al=a,a=mo(Fo,"onSelect"),0>=o,l-=o,Ke=1<<32-ee(e)+l|n<ut?(vt=V,V=null):vt=V.sibling;var Ct=T(g,V,x[ut],k);if(Ct===null){V===null&&(V=vt);break}t&&V&&Ct.alternate===null&&e(g,V),p=i(Ct,p,ut),zt===null?F=Ct:zt.sibling=Ct,zt=Ct,V=vt}if(ut===x.length)return n(g,V),bt&&on(g,ut),F;if(V===null){for(;utut?(vt=V,V=null):vt=V.sibling;var Zn=T(g,V,Ct.value,k);if(Zn===null){V===null&&(V=vt);break}t&&V&&Zn.alternate===null&&e(g,V),p=i(Zn,p,ut),zt===null?F=Zn:zt.sibling=Zn,zt=Zn,V=vt}if(Ct.done)return n(g,V),bt&&on(g,ut),F;if(V===null){for(;!Ct.done;ut++,Ct=x.next())Ct=D(g,Ct.value,k),Ct!==null&&(p=i(Ct,p,ut),zt===null?F=Ct:zt.sibling=Ct,zt=Ct);return bt&&on(g,ut),F}for(V=a(V);!Ct.done;ut++,Ct=x.next())Ct=z(V,g,ut,Ct.value,k),Ct!==null&&(t&&Ct.alternate!==null&&V.delete(Ct.key===null?ut:Ct.key),p=i(Ct,p,ut),zt===null?F=Ct:zt.sibling=Ct,zt=Ct);return t&&V.forEach(function(zh){return e(g,zh)}),bt&&on(g,ut),F}function wt(g,p,x,k){if(typeof x=="object"&&x!==null&&x.type===Dt&&x.key===null&&(x=x.props.children),typeof x=="object"&&x!==null){switch(x.$$typeof){case nt:t:{for(var F=x.key;p!==null;){if(p.key===F){if(F=x.type,F===Dt){if(p.tag===7){n(g,p.sibling),k=l(p,x.props.children),k.return=g,g=k;break t}}else if(p.elementType===F||typeof F=="object"&&F!==null&&F.$$typeof===at&&sa(F)===p.type){n(g,p.sibling),k=l(p,x.props),Ol(k,x),k.return=g,g=k;break t}n(g,p);break}else e(g,p);p=p.sibling}x.type===Dt?(k=na(x.props.children,g.mode,k,x.key),k.return=g,g=k):(k=ki(x.type,x.key,x.props,null,g.mode,k),Ol(k,x),k.return=g,g=k)}return o(g);case xt:t:{for(F=x.key;p!==null;){if(p.key===F)if(p.tag===4&&p.stateNode.containerInfo===x.containerInfo&&p.stateNode.implementation===x.implementation){n(g,p.sibling),k=l(p,x.children||[]),k.return=g,g=k;break t}else{n(g,p);break}else e(g,p);p=p.sibling}k=ls(x,g.mode,k),k.return=g,g=k}return o(g);case at:return x=sa(x),wt(g,p,x,k)}if(ft(x))return X(g,p,x,k);if(tt(x)){if(F=tt(x),typeof F!="function")throw Error(c(150));return x=F.call(x),$(g,p,x,k)}if(typeof x.then=="function")return wt(g,p,Ui(x),k);if(x.$$typeof===ct)return wt(g,p,Oi(g,x),k);Hi(g,x)}return typeof x=="string"&&x!==""||typeof x=="number"||typeof x=="bigint"?(x=""+x,p!==null&&p.tag===6?(n(g,p.sibling),k=l(p,x),k.return=g,g=k):(n(g,p),k=as(x,g.mode,k),k.return=g,g=k),o(g)):n(g,p)}return function(g,p,x,k){try{Dl=0;var F=wt(g,p,x,k);return Qa=null,F}catch(V){if(V===Xa||V===wi)throw V;var zt=xe(29,V,null,g.mode);return zt.lanes=k,zt.return=g,zt}finally{}}}var ra=ec(!0),nc=ec(!1),_n=!1;function gs(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function vs(t,e){t=t.updateQueue,e.updateQueue===t&&(e.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,callbacks:null})}function Dn(t){return{lane:t,tag:0,payload:null,callback:null,next:null}}function On(t,e,n){var a=t.updateQueue;if(a===null)return null;if(a=a.shared,(At&2)!==0){var l=a.pending;return l===null?e.next=e:(e.next=l.next,l.next=e),a.pending=e,e=Mi(t),qr(t,null,n),e}return ji(t,a,e,n),Mi(t)}function Rl(t,e,n){if(e=e.updateQueue,e!==null&&(e=e.shared,(n&4194048)!==0)){var a=e.lanes;a&=t.pendingLanes,n|=a,e.lanes=n,ml(t,n)}}function ys(t,e){var n=t.updateQueue,a=t.alternate;if(a!==null&&(a=a.updateQueue,n===a)){var l=null,i=null;if(n=n.firstBaseUpdate,n!==null){do{var o={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};i===null?l=i=o:i=i.next=o,n=n.next}while(n!==null);i===null?l=i=e:i=i.next=e}else l=i=e;n={baseState:a.baseState,firstBaseUpdate:l,lastBaseUpdate:i,shared:a.shared,callbacks:a.callbacks},t.updateQueue=n;return}t=n.lastBaseUpdate,t===null?n.firstBaseUpdate=e:t.next=e,n.lastBaseUpdate=e}var bs=!1;function wl(){if(bs){var t=Ka;if(t!==null)throw t}}function Bl(t,e,n,a){bs=!1;var l=t.updateQueue;_n=!1;var i=l.firstBaseUpdate,o=l.lastBaseUpdate,r=l.shared.pending;if(r!==null){l.shared.pending=null;var f=r,S=f.next;f.next=null,o===null?i=S:o.next=S,o=f;var j=t.alternate;j!==null&&(j=j.updateQueue,r=j.lastBaseUpdate,r!==o&&(r===null?j.firstBaseUpdate=S:r.next=S,j.lastBaseUpdate=f))}if(i!==null){var D=l.baseState;o=0,j=S=f=null,r=i;do{var T=r.lane&-536870913,z=T!==r.lane;if(z?(gt&T)===T:(a&T)===T){T!==0&&T===Ya&&(bs=!0),j!==null&&(j=j.next={lane:0,tag:r.tag,payload:r.payload,callback:null,next:null});t:{var X=t,$=r;T=e;var wt=n;switch($.tag){case 1:if(X=$.payload,typeof X=="function"){D=X.call(wt,D,T);break t}D=X;break t;case 3:X.flags=X.flags&-65537|128;case 0:if(X=$.payload,T=typeof X=="function"?X.call(wt,D,T):X,T==null)break t;D=R({},D,T);break t;case 2:_n=!0}}T=r.callback,T!==null&&(t.flags|=64,z&&(t.flags|=8192),z=l.callbacks,z===null?l.callbacks=[T]:z.push(T))}else z={lane:T,tag:r.tag,payload:r.payload,callback:r.callback,next:null},j===null?(S=j=z,f=D):j=j.next=z,o|=T;if(r=r.next,r===null){if(r=l.shared.pending,r===null)break;z=r,r=z.next,z.next=null,l.lastBaseUpdate=z,l.shared.pending=null}}while(!0);j===null&&(f=D),l.baseState=f,l.firstBaseUpdate=S,l.lastBaseUpdate=j,i===null&&(l.shared.lanes=0),Hn|=o,t.lanes=o,t.memoizedState=D}}function ac(t,e){if(typeof t!="function")throw Error(c(191,t));t.call(e)}function lc(t,e){var n=t.callbacks;if(n!==null)for(t.callbacks=null,t=0;ti?i:8;var o=A.T,r={};A.T=r,Ns(t,!1,e,n);try{var f=l(),S=A.S;if(S!==null&&S(r,f),f!==null&&typeof f=="object"&&typeof f.then=="function"){var j=mp(f,a);Nl(t,e,j,Ce(t))}else Nl(t,e,a,Ce(t))}catch(D){Nl(t,e,{then:function(){},status:"rejected",reason:D},Ce())}finally{B.p=i,o!==null&&r.types!==null&&(o.types=r.types),A.T=o}}function bp(){}function Us(t,e,n,a){if(t.tag!==5)throw Error(c(476));var l=Uc(t).queue;Bc(t,l,e,Z,n===null?bp:function(){return Hc(t),n(a)})}function Uc(t){var e=t.memoizedState;if(e!==null)return e;e={memoizedState:Z,baseState:Z,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:cn,lastRenderedState:Z},next:null};var n={};return e.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:cn,lastRenderedState:n},next:null},t.memoizedState=e,t=t.alternate,t!==null&&(t.memoizedState=e),e}function Hc(t){var e=Uc(t);e.next===null&&(e=t.alternate.memoizedState),Nl(t,e.next.queue,{},Ce())}function Hs(){return le(ei)}function Nc(){return Xt().memoizedState}function qc(){return Xt().memoizedState}function xp(t){for(var e=t.return;e!==null;){switch(e.tag){case 24:case 3:var n=Ce();t=Dn(n);var a=On(e,t,n);a!==null&&(ve(a,e,n),Rl(a,e,n)),e={cache:ds()},t.payload=e;return}e=e.return}}function Sp(t,e,n){var a=Ce();n={lane:a,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},Zi(t)?Gc(e,n):(n=es(t,e,n,a),n!==null&&(ve(n,t,a),Yc(n,e,a)))}function Lc(t,e,n){var a=Ce();Nl(t,e,n,a)}function Nl(t,e,n,a){var l={lane:a,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(Zi(t))Gc(e,l);else{var i=t.alternate;if(t.lanes===0&&(i===null||i.lanes===0)&&(i=e.lastRenderedReducer,i!==null))try{var o=e.lastRenderedState,r=i(o,n);if(l.hasEagerState=!0,l.eagerState=r,be(r,o))return ji(t,e,l,0),Bt===null&&Ai(),!1}catch{}finally{}if(n=es(t,e,l,a),n!==null)return ve(n,t,a),Yc(n,e,a),!0}return!1}function Ns(t,e,n,a){if(a={lane:2,revertLane:gu(),gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null},Zi(t)){if(e)throw Error(c(479))}else e=es(t,n,a,2),e!==null&&ve(e,t,2)}function Zi(t){var e=t.alternate;return t===st||e!==null&&e===st}function Gc(t,e){Za=Li=!0;var n=t.pending;n===null?e.next=e:(e.next=n.next,n.next=e),t.pending=e}function Yc(t,e,n){if((n&4194048)!==0){var a=e.lanes;a&=t.pendingLanes,n|=a,e.lanes=n,ml(t,n)}}var ql={readContext:le,use:Ki,useCallback:Gt,useContext:Gt,useEffect:Gt,useImperativeHandle:Gt,useLayoutEffect:Gt,useInsertionEffect:Gt,useMemo:Gt,useReducer:Gt,useRef:Gt,useState:Gt,useDebugValue:Gt,useDeferredValue:Gt,useTransition:Gt,useSyncExternalStore:Gt,useId:Gt,useHostTransitionStatus:Gt,useFormState:Gt,useActionState:Gt,useOptimistic:Gt,useMemoCache:Gt,useCacheRefresh:Gt};ql.useEffectEvent=Gt;var Kc={readContext:le,use:Ki,useCallback:function(t,e){return fe().memoizedState=[t,e===void 0?null:e],t},useContext:le,useEffect:Ac,useImperativeHandle:function(t,e,n){n=n!=null?n.concat([t]):null,Qi(4194308,4,_c.bind(null,e,t),n)},useLayoutEffect:function(t,e){return Qi(4194308,4,t,e)},useInsertionEffect:function(t,e){Qi(4,2,t,e)},useMemo:function(t,e){var n=fe();e=e===void 0?null:e;var a=t();if(ca){je(!0);try{t()}finally{je(!1)}}return n.memoizedState=[a,e],a},useReducer:function(t,e,n){var a=fe();if(n!==void 0){var l=n(e);if(ca){je(!0);try{n(e)}finally{je(!1)}}}else l=e;return a.memoizedState=a.baseState=l,t={pending:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:l},a.queue=t,t=t.dispatch=Sp.bind(null,st,t),[a.memoizedState,t]},useRef:function(t){var e=fe();return t={current:t},e.memoizedState=t},useState:function(t){t=Ds(t);var e=t.queue,n=Lc.bind(null,st,e);return e.dispatch=n,[t.memoizedState,n]},useDebugValue:ws,useDeferredValue:function(t,e){var n=fe();return Bs(n,t,e)},useTransition:function(){var t=Ds(!1);return t=Bc.bind(null,st,t.queue,!0,!1),fe().memoizedState=t,[!1,t]},useSyncExternalStore:function(t,e,n){var a=st,l=fe();if(bt){if(n===void 0)throw Error(c(407));n=n()}else{if(n=e(),Bt===null)throw Error(c(349));(gt&127)!==0||cc(a,e,n)}l.memoizedState=n;var i={value:n,getSnapshot:e};return l.queue=i,Ac(dc.bind(null,a,i,t),[t]),a.flags|=2048,Wa(9,{destroy:void 0},fc.bind(null,a,i,n,e),null),n},useId:function(){var t=fe(),e=Bt.identifierPrefix;if(bt){var n=Xe,a=Ke;n=(a&~(1<<32-ee(a)-1)).toString(32)+n,e="_"+e+"R_"+n,n=Gi++,0<\/script>",i=i.removeChild(i.firstChild);break;case"select":i=typeof a.is=="string"?o.createElement("select",{is:a.is}):o.createElement("select"),a.multiple?i.multiple=!0:a.size&&(i.size=a.size);break;default:i=typeof a.is=="string"?o.createElement(l,{is:a.is}):o.createElement(l)}}i[Qt]=e,i[ne]=a;t:for(o=e.child;o!==null;){if(o.tag===5||o.tag===6)i.appendChild(o.stateNode);else if(o.tag!==4&&o.tag!==27&&o.child!==null){o.child.return=o,o=o.child;continue}if(o===e)break t;for(;o.sibling===null;){if(o.return===null||o.return===e)break t;o=o.return}o.sibling.return=o.return,o=o.sibling}e.stateNode=i;t:switch(oe(i,l,a),l){case"button":case"input":case"select":case"textarea":a=!!a.autoFocus;break t;case"img":a=!0;break t;default:a=!1}a&&dn(e)}}return Nt(e),Is(e,e.type,t===null?null:t.memoizedProps,e.pendingProps,n),null;case 6:if(t&&e.stateNode!=null)t.memoizedProps!==a&&dn(e);else{if(typeof a!="string"&&e.stateNode===null)throw Error(c(166));if(t=rt.current,La(e)){if(t=e.stateNode,n=e.memoizedProps,a=null,l=ae,l!==null)switch(l.tag){case 27:case 5:a=l.memoizedProps}t[Qt]=e,t=!!(t.nodeValue===n||a!==null&&a.suppressHydrationWarning===!0||rd(t.nodeValue,n)),t||Mn(e,!0)}else t=po(t).createTextNode(a),t[Qt]=e,e.stateNode=t}return Nt(e),null;case 31:if(n=e.memoizedState,t===null||t.memoizedState!==null){if(a=La(e),n!==null){if(t===null){if(!a)throw Error(c(318));if(t=e.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(c(557));t[Qt]=e}else aa(),(e.flags&128)===0&&(e.memoizedState=null),e.flags|=4;Nt(e),t=!1}else n=us(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=n),t=!0;if(!t)return e.flags&256?(Te(e),e):(Te(e),null);if((e.flags&128)!==0)throw Error(c(558))}return Nt(e),null;case 13:if(a=e.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(l=La(e),a!==null&&a.dehydrated!==null){if(t===null){if(!l)throw Error(c(318));if(l=e.memoizedState,l=l!==null?l.dehydrated:null,!l)throw Error(c(317));l[Qt]=e}else aa(),(e.flags&128)===0&&(e.memoizedState=null),e.flags|=4;Nt(e),l=!1}else l=us(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=l),l=!0;if(!l)return e.flags&256?(Te(e),e):(Te(e),null)}return Te(e),(e.flags&128)!==0?(e.lanes=n,e):(n=a!==null,t=t!==null&&t.memoizedState!==null,n&&(a=e.child,l=null,a.alternate!==null&&a.alternate.memoizedState!==null&&a.alternate.memoizedState.cachePool!==null&&(l=a.alternate.memoizedState.cachePool.pool),i=null,a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(i=a.memoizedState.cachePool.pool),i!==l&&(a.flags|=2048)),n!==t&&n&&(e.child.flags|=8192),Ii(e,e.updateQueue),Nt(e),null);case 4:return Ut(),t===null&&xu(e.stateNode.containerInfo),Nt(e),null;case 10:return un(e.type),Nt(e),null;case 19:if(_(Kt),a=e.memoizedState,a===null)return Nt(e),null;if(l=(e.flags&128)!==0,i=a.rendering,i===null)if(l)Gl(a,!1);else{if(Yt!==0||t!==null&&(t.flags&128)!==0)for(t=e.child;t!==null;){if(i=qi(t),i!==null){for(e.flags|=128,Gl(a,!1),t=i.updateQueue,e.updateQueue=t,Ii(e,t),e.subtreeFlags=0,t=n,n=e.child;n!==null;)Lr(n,t),n=n.sibling;return N(Kt,Kt.current&1|2),bt&&on(e,a.treeForkCount),e.child}t=t.sibling}a.tail!==null&&se()>ao&&(e.flags|=128,l=!0,Gl(a,!1),e.lanes=4194304)}else{if(!l)if(t=qi(i),t!==null){if(e.flags|=128,l=!0,t=t.updateQueue,e.updateQueue=t,Ii(e,t),Gl(a,!0),a.tail===null&&a.tailMode==="hidden"&&!i.alternate&&!bt)return Nt(e),null}else 2*se()-a.renderingStartTime>ao&&n!==536870912&&(e.flags|=128,l=!0,Gl(a,!1),e.lanes=4194304);a.isBackwards?(i.sibling=e.child,e.child=i):(t=a.last,t!==null?t.sibling=i:e.child=i,a.last=i)}return a.tail!==null?(t=a.tail,a.rendering=t,a.tail=t.sibling,a.renderingStartTime=se(),t.sibling=null,n=Kt.current,N(Kt,l?n&1|2:n&1),bt&&on(e,a.treeForkCount),t):(Nt(e),null);case 22:case 23:return Te(e),Ss(),a=e.memoizedState!==null,t!==null?t.memoizedState!==null!==a&&(e.flags|=8192):a&&(e.flags|=8192),a?(n&536870912)!==0&&(e.flags&128)===0&&(Nt(e),e.subtreeFlags&6&&(e.flags|=8192)):Nt(e),n=e.updateQueue,n!==null&&Ii(e,n.retryQueue),n=null,t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(n=t.memoizedState.cachePool.pool),a=null,e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(a=e.memoizedState.cachePool.pool),a!==n&&(e.flags|=2048),t!==null&&_(oa),null;case 24:return n=null,t!==null&&(n=t.memoizedState.cache),e.memoizedState.cache!==n&&(e.flags|=2048),un(Vt),Nt(e),null;case 25:return null;case 30:return null}throw Error(c(156,e.tag))}function Ap(t,e){switch(os(e),e.tag){case 1:return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 3:return un(Vt),Ut(),t=e.flags,(t&65536)!==0&&(t&128)===0?(e.flags=t&-65537|128,e):null;case 26:case 27:case 5:return pa(e),null;case 31:if(e.memoizedState!==null){if(Te(e),e.alternate===null)throw Error(c(340));aa()}return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 13:if(Te(e),t=e.memoizedState,t!==null&&t.dehydrated!==null){if(e.alternate===null)throw Error(c(340));aa()}return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 19:return _(Kt),null;case 4:return Ut(),null;case 10:return un(e.type),null;case 22:case 23:return Te(e),Ss(),t!==null&&_(oa),t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 24:return un(Vt),null;case 25:return null;default:return null}}function pf(t,e){switch(os(e),e.tag){case 3:un(Vt),Ut();break;case 26:case 27:case 5:pa(e);break;case 4:Ut();break;case 31:e.memoizedState!==null&&Te(e);break;case 13:Te(e);break;case 19:_(Kt);break;case 10:un(e.type);break;case 22:case 23:Te(e),Ss(),t!==null&&_(oa);break;case 24:un(Vt)}}function Yl(t,e){try{var n=e.updateQueue,a=n!==null?n.lastEffect:null;if(a!==null){var l=a.next;n=l;do{if((n.tag&t)===t){a=void 0;var i=n.create,o=n.inst;a=i(),o.destroy=a}n=n.next}while(n!==l)}}catch(r){_t(e,e.return,r)}}function Bn(t,e,n){try{var a=e.updateQueue,l=a!==null?a.lastEffect:null;if(l!==null){var i=l.next;a=i;do{if((a.tag&t)===t){var o=a.inst,r=o.destroy;if(r!==void 0){o.destroy=void 0,l=e;var f=n,S=r;try{S()}catch(j){_t(l,f,j)}}}a=a.next}while(a!==i)}}catch(j){_t(e,e.return,j)}}function hf(t){var e=t.updateQueue;if(e!==null){var n=t.stateNode;try{lc(e,n)}catch(a){_t(t,t.return,a)}}}function gf(t,e,n){n.props=fa(t.type,t.memoizedProps),n.state=t.memoizedState;try{n.componentWillUnmount()}catch(a){_t(t,e,a)}}function Kl(t,e){try{var n=t.ref;if(n!==null){switch(t.tag){case 26:case 27:case 5:var a=t.stateNode;break;case 30:a=t.stateNode;break;default:a=t.stateNode}typeof n=="function"?t.refCleanup=n(a):n.current=a}}catch(l){_t(t,e,l)}}function Qe(t,e){var n=t.ref,a=t.refCleanup;if(n!==null)if(typeof a=="function")try{a()}catch(l){_t(t,e,l)}finally{t.refCleanup=null,t=t.alternate,t!=null&&(t.refCleanup=null)}else if(typeof n=="function")try{n(null)}catch(l){_t(t,e,l)}else n.current=null}function vf(t){var e=t.type,n=t.memoizedProps,a=t.stateNode;try{t:switch(e){case"button":case"input":case"select":case"textarea":n.autoFocus&&a.focus();break t;case"img":n.src?a.src=n.src:n.srcSet&&(a.srcset=n.srcSet)}}catch(l){_t(t,t.return,l)}}function Ps(t,e,n){try{var a=t.stateNode;Jp(a,t.type,n,e),a[ne]=e}catch(l){_t(t,t.return,l)}}function yf(t){return t.tag===5||t.tag===3||t.tag===26||t.tag===27&&Yn(t.type)||t.tag===4}function tu(t){t:for(;;){for(;t.sibling===null;){if(t.return===null||yf(t.return))return null;t=t.return}for(t.sibling.return=t.return,t=t.sibling;t.tag!==5&&t.tag!==6&&t.tag!==18;){if(t.tag===27&&Yn(t.type)||t.flags&2||t.child===null||t.tag===4)continue t;t.child.return=t,t=t.child}if(!(t.flags&2))return t.stateNode}}function eu(t,e,n){var a=t.tag;if(a===5||a===6)t=t.stateNode,e?(n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n).insertBefore(t,e):(e=n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n,e.appendChild(t),n=n._reactRootContainer,n!=null||e.onclick!==null||(e.onclick=nn));else if(a!==4&&(a===27&&Yn(t.type)&&(n=t.stateNode,e=null),t=t.child,t!==null))for(eu(t,e,n),t=t.sibling;t!==null;)eu(t,e,n),t=t.sibling}function Pi(t,e,n){var a=t.tag;if(a===5||a===6)t=t.stateNode,e?n.insertBefore(t,e):n.appendChild(t);else if(a!==4&&(a===27&&Yn(t.type)&&(n=t.stateNode),t=t.child,t!==null))for(Pi(t,e,n),t=t.sibling;t!==null;)Pi(t,e,n),t=t.sibling}function bf(t){var e=t.stateNode,n=t.memoizedProps;try{for(var a=t.type,l=e.attributes;l.length;)e.removeAttributeNode(l[0]);oe(e,a,n),e[Qt]=t,e[ne]=n}catch(i){_t(t,t.return,i)}}var mn=!1,Wt=!1,nu=!1,xf=typeof WeakSet=="function"?WeakSet:Set,Pt=null;function jp(t,e){if(t=t.containerInfo,Eu=So,t=Dr(t),Wo(t)){if("selectionStart"in t)var n={start:t.selectionStart,end:t.selectionEnd};else t:{n=(n=t.ownerDocument)&&n.defaultView||window;var a=n.getSelection&&n.getSelection();if(a&&a.rangeCount!==0){n=a.anchorNode;var l=a.anchorOffset,i=a.focusNode;a=a.focusOffset;try{n.nodeType,i.nodeType}catch{n=null;break t}var o=0,r=-1,f=-1,S=0,j=0,D=t,T=null;e:for(;;){for(var z;D!==n||l!==0&&D.nodeType!==3||(r=o+l),D!==i||a!==0&&D.nodeType!==3||(f=o+a),D.nodeType===3&&(o+=D.nodeValue.length),(z=D.firstChild)!==null;)T=D,D=z;for(;;){if(D===t)break e;if(T===n&&++S===l&&(r=o),T===i&&++j===a&&(f=o),(z=D.nextSibling)!==null)break;D=T,T=D.parentNode}D=z}n=r===-1||f===-1?null:{start:r,end:f}}else n=null}n=n||{start:0,end:0}}else n=null;for(zu={focusedElem:t,selectionRange:n},So=!1,Pt=e;Pt!==null;)if(e=Pt,t=e.child,(e.subtreeFlags&1028)!==0&&t!==null)t.return=e,Pt=t;else for(;Pt!==null;){switch(e=Pt,i=e.alternate,t=e.flags,e.tag){case 0:if((t&4)!==0&&(t=e.updateQueue,t=t!==null?t.events:null,t!==null))for(n=0;n title"))),oe(i,a,n),i[Qt]=t,yt(i),a=i;break t;case"link":var o=Ad("link","href",l).get(a+(n.href||""));if(o){for(var r=0;rwt&&(o=wt,wt=$,$=o);var g=kr(r,$),p=kr(r,wt);if(g&&p&&(z.rangeCount!==1||z.anchorNode!==g.node||z.anchorOffset!==g.offset||z.focusNode!==p.node||z.focusOffset!==p.offset)){var x=D.createRange();x.setStart(g.node,g.offset),z.removeAllRanges(),$>wt?(z.addRange(x),z.extend(p.node,p.offset)):(x.setEnd(p.node,p.offset),z.addRange(x))}}}}for(D=[],z=r;z=z.parentNode;)z.nodeType===1&&D.push({element:z,left:z.scrollLeft,top:z.scrollTop});for(typeof r.focus=="function"&&r.focus(),r=0;rn?32:n,A.T=null,n=ru,ru=null;var i=qn,o=yn;if(Ft=0,tl=qn=null,yn=0,(At&6)!==0)throw Error(c(331));var r=At;if(At|=4,Df(i.current),Mf(i,i.current,o,n),At=r,Wl(0,!1),ue&&typeof ue.onPostCommitFiberRoot=="function")try{ue.onPostCommitFiberRoot(ye,i)}catch{}return!0}finally{B.p=l,A.T=a,Wf(t,e)}}function $f(t,e,n){e=De(n,e),e=Ys(t.stateNode,e,2),t=On(t,e,2),t!==null&&(En(t,2),Ve(t))}function _t(t,e,n){if(t.tag===3)$f(t,t,n);else for(;e!==null;){if(e.tag===3){$f(e,t,n);break}else if(e.tag===1){var a=e.stateNode;if(typeof e.type.getDerivedStateFromError=="function"||typeof a.componentDidCatch=="function"&&(Nn===null||!Nn.has(a))){t=De(n,t),n=$c(2),a=On(e,n,2),a!==null&&(Ic(n,a,e,t),En(a,2),Ve(a));break}}e=e.return}}function mu(t,e,n){var a=t.pingCache;if(a===null){a=t.pingCache=new _p;var l=new Set;a.set(e,l)}else l=a.get(e),l===void 0&&(l=new Set,a.set(e,l));l.has(n)||(iu=!0,l.add(n),t=Bp.bind(null,t,e,n),e.then(t,t))}function Bp(t,e,n){var a=t.pingCache;a!==null&&a.delete(e),t.pingedLanes|=t.suspendedLanes&n,t.warmLanes&=~n,Bt===t&&(gt&n)===n&&(Yt===4||Yt===3&&(gt&62914560)===gt&&300>se()-no?(At&2)===0&&el(t,0):ou|=n,Pa===gt&&(Pa=0)),Ve(t)}function If(t,e){e===0&&(e=Ea()),t=ea(t,e),t!==null&&(En(t,e),Ve(t))}function Up(t){var e=t.memoizedState,n=0;e!==null&&(n=e.retryLane),If(t,n)}function Hp(t,e){var n=0;switch(t.tag){case 31:case 13:var a=t.stateNode,l=t.memoizedState;l!==null&&(n=l.retryLane);break;case 19:a=t.stateNode;break;case 22:a=t.stateNode._retryCache;break;default:throw Error(c(314))}a!==null&&a.delete(e),If(t,n)}function Np(t,e){return fl(t,e)}var ro=null,al=null,pu=!1,co=!1,hu=!1,Gn=0;function Ve(t){t!==al&&t.next===null&&(al===null?ro=al=t:al=al.next=t),co=!0,pu||(pu=!0,Lp())}function Wl(t,e){if(!hu&&co){hu=!0;do for(var n=!1,a=ro;a!==null;){if(t!==0){var l=a.pendingLanes;if(l===0)var i=0;else{var o=a.suspendedLanes,r=a.pingedLanes;i=(1<<31-ee(42|t)+1)-1,i&=l&~(o&~r),i=i&201326741?i&201326741|1:i?i|2:0}i!==0&&(n=!0,nd(a,i))}else i=gt,i=Ta(a,a===Bt?i:0,a.cancelPendingCommit!==null||a.timeoutHandle!==-1),(i&3)===0||Tn(a,i)||(n=!0,nd(a,i));a=a.next}while(n);hu=!1}}function qp(){Pf()}function Pf(){co=pu=!1;var t=0;Gn!==0&&Fp()&&(t=Gn);for(var e=se(),n=null,a=ro;a!==null;){var l=a.next,i=td(a,e);i===0?(a.next=null,n===null?ro=l:n.next=l,l===null&&(al=n)):(n=a,(t!==0||(i&3)!==0)&&(co=!0)),a=l}Ft!==0&&Ft!==5||Wl(t),Gn!==0&&(Gn=0)}function td(t,e){for(var n=t.suspendedLanes,a=t.pingedLanes,l=t.expirationTimes,i=t.pendingLanes&-62914561;0r)break;var j=f.transferSize,D=f.initiatorType;j&&cd(D)&&(f=f.responseEnd,o+=j*(f"u"?null:document;function Td(t,e,n){var a=ll;if(a&&typeof e=="string"&&e){var l=ke(e);l='link[rel="'+t+'"][href="'+l+'"]',typeof n=="string"&&(l+='[crossorigin="'+n+'"]'),Sd.has(l)||(Sd.add(l),t={rel:t,crossOrigin:n,href:e},a.querySelector(l)===null&&(e=a.createElement("link"),oe(e,"link",t),yt(e),a.head.appendChild(e)))}}function ih(t){bn.D(t),Td("dns-prefetch",t,null)}function oh(t,e){bn.C(t,e),Td("preconnect",t,e)}function sh(t,e,n){bn.L(t,e,n);var a=ll;if(a&&t&&e){var l='link[rel="preload"][as="'+ke(e)+'"]';e==="image"&&n&&n.imageSrcSet?(l+='[imagesrcset="'+ke(n.imageSrcSet)+'"]',typeof n.imageSizes=="string"&&(l+='[imagesizes="'+ke(n.imageSizes)+'"]')):l+='[href="'+ke(t)+'"]';var i=l;switch(e){case"style":i=il(t);break;case"script":i=ol(t)}He.has(i)||(t=R({rel:"preload",href:e==="image"&&n&&n.imageSrcSet?void 0:t,as:e},n),He.set(i,t),a.querySelector(l)!==null||e==="style"&&a.querySelector(Pl(i))||e==="script"&&a.querySelector(ti(i))||(e=a.createElement("link"),oe(e,"link",t),yt(e),a.head.appendChild(e)))}}function uh(t,e){bn.m(t,e);var n=ll;if(n&&t){var a=e&&typeof e.as=="string"?e.as:"script",l='link[rel="modulepreload"][as="'+ke(a)+'"][href="'+ke(t)+'"]',i=l;switch(a){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":i=ol(t)}if(!He.has(i)&&(t=R({rel:"modulepreload",href:t},e),He.set(i,t),n.querySelector(l)===null)){switch(a){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(n.querySelector(ti(i)))return}a=n.createElement("link"),oe(a,"link",t),yt(a),n.head.appendChild(a)}}}function rh(t,e,n){bn.S(t,e,n);var a=ll;if(a&&t){var l=St(a).hoistableStyles,i=il(t);e=e||"default";var o=l.get(i);if(!o){var r={loading:0,preload:null};if(o=a.querySelector(Pl(i)))r.loading=5;else{t=R({rel:"stylesheet",href:t,"data-precedence":e},n),(n=He.get(i))&&Du(t,n);var f=o=a.createElement("link");yt(f),oe(f,"link",t),f._p=new Promise(function(S,j){f.onload=S,f.onerror=j}),f.addEventListener("load",function(){r.loading|=1}),f.addEventListener("error",function(){r.loading|=2}),r.loading|=4,go(o,e,a)}o={type:"stylesheet",instance:o,count:1,state:r},l.set(i,o)}}}function ch(t,e){bn.X(t,e);var n=ll;if(n&&t){var a=St(n).hoistableScripts,l=ol(t),i=a.get(l);i||(i=n.querySelector(ti(l)),i||(t=R({src:t,async:!0},e),(e=He.get(l))&&Ou(t,e),i=n.createElement("script"),yt(i),oe(i,"link",t),n.head.appendChild(i)),i={type:"script",instance:i,count:1,state:null},a.set(l,i))}}function fh(t,e){bn.M(t,e);var n=ll;if(n&&t){var a=St(n).hoistableScripts,l=ol(t),i=a.get(l);i||(i=n.querySelector(ti(l)),i||(t=R({src:t,async:!0,type:"module"},e),(e=He.get(l))&&Ou(t,e),i=n.createElement("script"),yt(i),oe(i,"link",t),n.head.appendChild(i)),i={type:"script",instance:i,count:1,state:null},a.set(l,i))}}function Ed(t,e,n,a){var l=(l=rt.current)?ho(l):null;if(!l)throw Error(c(446));switch(t){case"meta":case"title":return null;case"style":return typeof n.precedence=="string"&&typeof n.href=="string"?(e=il(n.href),n=St(l).hoistableStyles,a=n.get(e),a||(a={type:"style",instance:null,count:0,state:null},n.set(e,a)),a):{type:"void",instance:null,count:0,state:null};case"link":if(n.rel==="stylesheet"&&typeof n.href=="string"&&typeof n.precedence=="string"){t=il(n.href);var i=St(l).hoistableStyles,o=i.get(t);if(o||(l=l.ownerDocument||l,o={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},i.set(t,o),(i=l.querySelector(Pl(t)))&&!i._p&&(o.instance=i,o.state.loading=5),He.has(t)||(n={rel:"preload",as:"style",href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},He.set(t,n),i||dh(l,t,n,o.state))),e&&a===null)throw Error(c(528,""));return o}if(e&&a!==null)throw Error(c(529,""));return null;case"script":return e=n.async,n=n.src,typeof n=="string"&&e&&typeof e!="function"&&typeof e!="symbol"?(e=ol(n),n=St(l).hoistableScripts,a=n.get(e),a||(a={type:"script",instance:null,count:0,state:null},n.set(e,a)),a):{type:"void",instance:null,count:0,state:null};default:throw Error(c(444,t))}}function il(t){return'href="'+ke(t)+'"'}function Pl(t){return'link[rel="stylesheet"]['+t+"]"}function zd(t){return R({},t,{"data-precedence":t.precedence,precedence:null})}function dh(t,e,n,a){t.querySelector('link[rel="preload"][as="style"]['+e+"]")?a.loading=1:(e=t.createElement("link"),a.preload=e,e.addEventListener("load",function(){return a.loading|=1}),e.addEventListener("error",function(){return a.loading|=2}),oe(e,"link",n),yt(e),t.head.appendChild(e))}function ol(t){return'[src="'+ke(t)+'"]'}function ti(t){return"script[async]"+t}function Cd(t,e,n){if(e.count++,e.instance===null)switch(e.type){case"style":var a=t.querySelector('style[data-href~="'+ke(n.href)+'"]');if(a)return e.instance=a,yt(a),a;var l=R({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return a=(t.ownerDocument||t).createElement("style"),yt(a),oe(a,"style",l),go(a,n.precedence,t),e.instance=a;case"stylesheet":l=il(n.href);var i=t.querySelector(Pl(l));if(i)return e.state.loading|=4,e.instance=i,yt(i),i;a=zd(n),(l=He.get(l))&&Du(a,l),i=(t.ownerDocument||t).createElement("link"),yt(i);var o=i;return o._p=new Promise(function(r,f){o.onload=r,o.onerror=f}),oe(i,"link",a),e.state.loading|=4,go(i,n.precedence,t),e.instance=i;case"script":return i=ol(n.src),(l=t.querySelector(ti(i)))?(e.instance=l,yt(l),l):(a=n,(l=He.get(i))&&(a=R({},n),Ou(a,l)),t=t.ownerDocument||t,l=t.createElement("script"),yt(l),oe(l,"link",a),t.head.appendChild(l),e.instance=l);case"void":return null;default:throw Error(c(443,e.type))}else e.type==="stylesheet"&&(e.state.loading&4)===0&&(a=e.instance,e.state.loading|=4,go(a,n.precedence,t));return e.instance}function go(t,e,n){for(var a=n.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),l=a.length?a[a.length-1]:null,i=l,o=0;o title"):null)}function mh(t,e,n){if(n===1||e.itemProp!=null)return!1;switch(t){case"meta":case"title":return!0;case"style":if(typeof e.precedence!="string"||typeof e.href!="string"||e.href==="")break;return!0;case"link":if(typeof e.rel!="string"||typeof e.href!="string"||e.href===""||e.onLoad||e.onError)break;switch(e.rel){case"stylesheet":return t=e.disabled,typeof e.precedence=="string"&&t==null;default:return!0}case"script":if(e.async&&typeof e.async!="function"&&typeof e.async!="symbol"&&!e.onLoad&&!e.onError&&e.src&&typeof e.src=="string")return!0}return!1}function Md(t){return!(t.type==="stylesheet"&&(t.state.loading&3)===0)}function ph(t,e,n,a){if(n.type==="stylesheet"&&(typeof a.media!="string"||matchMedia(a.media).matches!==!1)&&(n.state.loading&4)===0){if(n.instance===null){var l=il(a.href),i=e.querySelector(Pl(l));if(i){e=i._p,e!==null&&typeof e=="object"&&typeof e.then=="function"&&(t.count++,t=yo.bind(t),e.then(t,t)),n.state.loading|=4,n.instance=i,yt(i);return}i=e.ownerDocument||e,a=zd(a),(l=He.get(l))&&Du(a,l),i=i.createElement("link"),yt(i);var o=i;o._p=new Promise(function(r,f){o.onload=r,o.onerror=f}),oe(i,"link",a),n.instance=i}t.stylesheets===null&&(t.stylesheets=new Map),t.stylesheets.set(n,e),(e=n.state.preload)&&(n.state.loading&3)===0&&(t.count++,n=yo.bind(t),e.addEventListener("load",n),e.addEventListener("error",n))}}var Ru=0;function hh(t,e){return t.stylesheets&&t.count===0&&xo(t,t.stylesheets),0Ru?50:800)+e);return t.unsuspend=n,function(){t.unsuspend=null,clearTimeout(a),clearTimeout(l)}}:null}function yo(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)xo(this,this.stylesheets);else if(this.unsuspend){var t=this.unsuspend;this.unsuspend=null,t()}}}var bo=null;function xo(t,e){t.stylesheets=null,t.unsuspend!==null&&(t.count++,bo=new Map,e.forEach(gh,t),bo=null,yo.call(t))}function gh(t,e){if(!(e.state.loading&4)){var n=bo.get(t);if(n)var a=n.get(null);else{n=new Map,bo.set(t,n);for(var l=t.querySelectorAll("link[data-precedence],style[data-precedence]"),i=0;i"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(u)}catch(h){console.error(h)}}return u(),Yu.exports=Rh(),Yu.exports}var Bh=wh();const Uh="modulepreload",Hh=function(u){return"/"+u},Id={},Lt=function(h,d,c){let v=Promise.resolve();if(d&&d.length>0){let M=function(y){return Promise.all(y.map(G=>Promise.resolve(G).then(R=>({status:"fulfilled",value:R}),R=>({status:"rejected",reason:R}))))};document.getElementsByTagName("link");const O=document.querySelector("meta[property=csp-nonce]"),C=(O==null?void 0:O.nonce)||(O==null?void 0:O.getAttribute("nonce"));v=M(d.map(y=>{if(y=Hh(y),y in Id)return;Id[y]=!0;const G=y.endsWith(".css"),R=G?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${y}"]${R}`))return;const K=document.createElement("link");if(K.rel=G?"stylesheet":Uh,G||(K.as="script"),K.crossOrigin="",K.href=y,C&&K.setAttribute("nonce",C),document.head.appendChild(K),G)return new Promise((nt,xt)=>{K.addEventListener("load",nt),K.addEventListener("error",()=>xt(new Error(`Unable to preload CSS for ${y}`)))})}))}function E(M){const O=new Event("vite:preloadError",{cancelable:!0});if(O.payload=M,window.dispatchEvent(O),!O.defaultPrevented)throw M}return v.then(M=>{for(const O of M||[])O.status==="rejected"&&E(O.reason);return h().catch(E)})},Mo={amber:{dark:{bg:"#09090b",sf:"#111114",sfH:"#18181c",bd:"#1e1e24",tx:"#e4e4e7",tx2:"#a1a1aa",txM:"#919199",ac:"#e8a845",acD:"rgba(232,168,69,0.12)",acT:"#fbbf24",cdBg:"#0c0c0f",cdTx:"#c4c4cc",sbBg:"#0c0c0e",hdBg:"rgba(9,9,11,0.85)"},light:{bg:"#fafaf9",sf:"#ffffff",sfH:"#f5f5f4",bd:"#e7e5e4",tx:"#1c1917",tx2:"#57534e",txM:"#706b66",ac:"#96640a",acD:"rgba(150,100,10,0.08)",acT:"#7a5208",cdBg:"#f5f3f0",cdTx:"#2c2520",sbBg:"#f5f5f3",hdBg:"rgba(250,250,249,0.85)"},fonts:{heading:"Instrument Serif",body:"DM Sans",code:"JetBrains Mono"}},editorial:{dark:{bg:"#080c1f",sf:"#0e1333",sfH:"#141940",bd:"#1a2050",tx:"#e8e6f0",tx2:"#b5b1c8",txM:"#9490ae",ac:"#ff6b4a",acD:"rgba(255,107,74,0.1)",acT:"#ff8a70",cdBg:"#0a0e27",cdTx:"#b8b4cc",sbBg:"#0a0e27",hdBg:"rgba(8,12,31,0.9)"},light:{bg:"#f6f4f0",sf:"#ffffff",sfH:"#eeece6",bd:"#ddd9d0",tx:"#1a1716",tx2:"#4a443e",txM:"#706960",ac:"#b83d22",acD:"rgba(184,61,34,0.07)",acT:"#9c3019",cdBg:"#edeae4",cdTx:"#3a3530",sbBg:"#f0ede8",hdBg:"rgba(246,244,240,0.92)"},fonts:{heading:"Cormorant Garamond",body:"Bricolage Grotesque",code:"Fira Code"}},cipher:{dark:{bg:"#050508",sf:"#0c0c12",sfH:"#12121a",bd:"#1a1a25",tx:"#d4ff00",tx2:"#8a90a0",txM:"#6a7080",ac:"#6666ff",acD:"rgba(102,102,255,0.10)",acT:"#8080ff",cdBg:"#08080e",cdTx:"#b0c870",sbBg:"#08080d",hdBg:"rgba(5,5,8,0.88)"},light:{bg:"#f0f2f5",sf:"#ffffff",sfH:"#e8eaef",bd:"#d0d4db",tx:"#0f1219",tx2:"#4a5060",txM:"#6a7080",ac:"#2020cc",acD:"rgba(32,32,204,0.08)",acT:"#1a1aa8",cdBg:"#e6e9ef",cdTx:"#2a3520",sbBg:"#ebedf2",hdBg:"rgba(240,242,245,0.90)"},fonts:{heading:"Bodoni Moda",body:"Space Grotesk",code:"Source Code Pro"}},mint:{dark:{bg:"#0d1117",sf:"#161b22",sfH:"#1c2129",bd:"#21262d",tx:"#e6edf3",tx2:"#8b949e",txM:"#6e7681",ac:"#0ea371",acD:"rgba(14,163,113,0.10)",acT:"#2dd4a0",cdBg:"#0a0e14",cdTx:"#adbac7",sbBg:"#0d1117",hdBg:"rgba(13,17,23,0.88)"},light:{bg:"#ffffff",sf:"#f6f8fa",sfH:"#eef1f5",bd:"#d8dee4",tx:"#1f2328",tx2:"#59636e",txM:"#6e7681",ac:"#0a7b53",acD:"rgba(10,123,83,0.07)",acT:"#087a50",cdBg:"#f0f3f6",cdTx:"#24292f",sbBg:"#f6f8fa",hdBg:"rgba(255,255,255,0.90)"},fonts:{heading:"Inter",body:"Inter",code:"Fira Code"}}},Nh=()=>s.jsx("svg",{width:22,height:22,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:s.jsx("path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"})}),qh=()=>s.jsx("svg",{width:18,height:18,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:s.jsx("path",{d:"M18 6L6 18M6 6l12 12"})}),Lh=()=>s.jsx("svg",{width:16,height:16,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:s.jsx("path",{d:"M22 2L11 13M22 2l-7 20-4-9-9-4z"})});function um(u){let h="You are a helpful documentation assistant. Answer questions accurately based on the documentation provided below. If the answer isn't in the documentation, say so clearly. Keep answers concise and reference specific sections when possible.";if(u){const d=u.length>1e5?u.slice(0,1e5)+`
+`+a.stack}}var Fn=Object.prototype.hasOwnProperty,fl=u.unstable_scheduleCallback,va=u.unstable_cancelCallback,Oo=u.unstable_shouldYield,si=u.unstable_requestPaint,se=u.unstable_now,ui=u.unstable_getCurrentPriorityLevel,te=u.unstable_ImmediatePriority,ya=u.unstable_UserBlockingPriority,xn=u.unstable_NormalPriority,Sn=u.unstable_LowPriority,ri=u.unstable_IdlePriority,Pu=u.log,ba=u.unstable_setDisableYieldValue,ye=null,ue=null;function Ae(t){if(typeof Pu=="function"&&ba(t),ue&&typeof ue.setStrictMode=="function")try{ue.setStrictMode(ye,t)}catch{}}var ee=Math.clz32?Math.clz32:Sa,ci=Math.log,xa=Math.LN2;function Sa(t){return t>>>=0,t===0?32:31-(ci(t)/xa|0)|0}var Fe=256,$e=262144,Ie=4194304;function Pe(t){var e=t&42;if(e!==0)return e;switch(t&-t){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return t&261888;case 262144:case 524288:case 1048576:case 2097152:return t&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return t&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return t}}function Ta(t,e,n){var a=t.pendingLanes;if(a===0)return 0;var l=0,i=t.suspendedLanes,o=t.pingedLanes;t=t.warmLanes;var r=a&134217727;return r!==0?(a=r&~i,a!==0?l=Pe(a):(o&=r,o!==0?l=Pe(o):n||(n=r&~t,n!==0&&(l=Pe(n))))):(r=a&~i,r!==0?l=Pe(r):o!==0?l=Pe(o):n||(n=a&~t,n!==0&&(l=Pe(n)))),l===0?0:e!==0&&e!==l&&(e&i)===0&&(i=l&-l,n=e&-e,i>=n||i===32&&(n&4194048)!==0)?e:l}function Tn(t,e){return(t.pendingLanes&~(t.suspendedLanes&~t.pingedLanes)&e)===0}function Ne(t,e){switch(t){case 1:case 2:case 4:case 8:case 64:return e+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Ea(){var t=Ie;return Ie<<=1,(Ie&62914560)===0&&(Ie=4194304),t}function za(t){for(var e=[],n=0;31>n;n++)e.push(t);return e}function En(t,e){t.pendingLanes|=e,e!==268435456&&(t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0)}function fi(t,e,n,a,l,i){var o=t.pendingLanes;t.pendingLanes=n,t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0,t.expiredLanes&=n,t.entangledLanes&=n,t.errorRecoveryDisabledLanes&=n,t.shellSuspendCounter=0;var r=t.entanglements,f=t.expirationTimes,S=t.hiddenUpdates;for(n=o&~n;0"u")return null;try{return t.activeElement||t.body}catch{return t.body}}var bm=/[\n"\\]/g;function ke(t){return t.replace(bm,function(e){return"\\"+e.charCodeAt(0).toString(16)+" "})}function wo(t,e,n,a,l,i,o,r){t.name="",o!=null&&typeof o!="function"&&typeof o!="symbol"&&typeof o!="boolean"?t.type=o:t.removeAttribute("type"),e!=null?o==="number"?(e===0&&t.value===""||t.value!=e)&&(t.value=""+Me(e)):t.value!==""+Me(e)&&(t.value=""+Me(e)):o!=="submit"&&o!=="reset"||t.removeAttribute("value"),e!=null?Bo(t,o,Me(e)):n!=null?Bo(t,o,Me(n)):a!=null&&t.removeAttribute("value"),l==null&&i!=null&&(t.defaultChecked=!!i),l!=null&&(t.checked=l&&typeof l!="function"&&typeof l!="symbol"),r!=null&&typeof r!="function"&&typeof r!="symbol"&&typeof r!="boolean"?t.name=""+Me(r):t.removeAttribute("name")}function lr(t,e,n,a,l,i,o,r){if(i!=null&&typeof i!="function"&&typeof i!="symbol"&&typeof i!="boolean"&&(t.type=i),e!=null||n!=null){if(!(i!=="submit"&&i!=="reset"||e!=null)){Ro(t);return}n=n!=null?""+Me(n):"",e=e!=null?""+Me(e):n,r||e===t.value||(t.value=e),t.defaultValue=e}a=a??l,a=typeof a!="function"&&typeof a!="symbol"&&!!a,t.checked=r?t.checked:!!a,t.defaultChecked=!!a,o!=null&&typeof o!="function"&&typeof o!="symbol"&&typeof o!="boolean"&&(t.name=o),Ro(t)}function Bo(t,e,n){e==="number"&&vi(t.ownerDocument)===t||t.defaultValue===""+n||(t.defaultValue=""+n)}function ka(t,e,n,a){if(t=t.options,e){e={};for(var l=0;l"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Lo=!1;if(an)try{var bl={};Object.defineProperty(bl,"passive",{get:function(){Lo=!0}}),window.addEventListener("test",bl,bl),window.removeEventListener("test",bl,bl)}catch{Lo=!1}var Cn=null,Go=null,bi=null;function fr(){if(bi)return bi;var t,e=Go,n=e.length,a,l="value"in Cn?Cn.value:Cn.textContent,i=l.length;for(t=0;t=Tl),vr=" ",yr=!1;function br(t,e){switch(t){case"keyup":return Zm.indexOf(e.keyCode)!==-1;case"keydown":return e.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function xr(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var Ra=!1;function Wm(t,e){switch(t){case"compositionend":return xr(e);case"keypress":return e.which!==32?null:(yr=!0,vr);case"textInput":return t=e.data,t===vr&&yr?null:t;default:return null}}function Fm(t,e){if(Ra)return t==="compositionend"||!Vo&&br(t,e)?(t=fr(),bi=Go=Cn=null,Ra=!1,t):null;switch(t){case"paste":return null;case"keypress":if(!(e.ctrlKey||e.altKey||e.metaKey)||e.ctrlKey&&e.altKey){if(e.char&&1=e)return{node:n,offset:e-t};t=a}t:{for(;n;){if(n.nextSibling){n=n.nextSibling;break t}n=n.parentNode}n=void 0}n=Mr(n)}}function _r(t,e){return t&&e?t===e?!0:t&&t.nodeType===3?!1:e&&e.nodeType===3?_r(t,e.parentNode):"contains"in t?t.contains(e):t.compareDocumentPosition?!!(t.compareDocumentPosition(e)&16):!1:!1}function Dr(t){t=t!=null&&t.ownerDocument!=null&&t.ownerDocument.defaultView!=null?t.ownerDocument.defaultView:window;for(var e=vi(t.document);e instanceof t.HTMLIFrameElement;){try{var n=typeof e.contentWindow.location.href=="string"}catch{n=!1}if(n)t=e.contentWindow;else break;e=vi(t.document)}return e}function Wo(t){var e=t&&t.nodeName&&t.nodeName.toLowerCase();return e&&(e==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||e==="textarea"||t.contentEditable==="true")}var lh=an&&"documentMode"in document&&11>=document.documentMode,wa=null,Fo=null,jl=null,$o=!1;function Or(t,e,n){var a=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;$o||wa==null||wa!==vi(a)||(a=wa,"selectionStart"in a&&Wo(a)?a={start:a.selectionStart,end:a.selectionEnd}:(a=(a.ownerDocument&&a.ownerDocument.defaultView||window).getSelection(),a={anchorNode:a.anchorNode,anchorOffset:a.anchorOffset,focusNode:a.focusNode,focusOffset:a.focusOffset}),jl&&Cl(jl,a)||(jl=a,a=mo(Fo,"onSelect"),0>=o,l-=o,Ke=1<<32-ee(e)+l|n<ut?(vt=V,V=null):vt=V.sibling;var Ct=T(g,V,x[ut],k);if(Ct===null){V===null&&(V=vt);break}t&&V&&Ct.alternate===null&&e(g,V),h=i(Ct,h,ut),zt===null?F=Ct:zt.sibling=Ct,zt=Ct,V=vt}if(ut===x.length)return n(g,V),bt&&on(g,ut),F;if(V===null){for(;utut?(vt=V,V=null):vt=V.sibling;var Zn=T(g,V,Ct.value,k);if(Zn===null){V===null&&(V=vt);break}t&&V&&Zn.alternate===null&&e(g,V),h=i(Zn,h,ut),zt===null?F=Zn:zt.sibling=Zn,zt=Zn,V=vt}if(Ct.done)return n(g,V),bt&&on(g,ut),F;if(V===null){for(;!Ct.done;ut++,Ct=x.next())Ct=D(g,Ct.value,k),Ct!==null&&(h=i(Ct,h,ut),zt===null?F=Ct:zt.sibling=Ct,zt=Ct);return bt&&on(g,ut),F}for(V=a(V);!Ct.done;ut++,Ct=x.next())Ct=z(V,g,ut,Ct.value,k),Ct!==null&&(t&&Ct.alternate!==null&&V.delete(Ct.key===null?ut:Ct.key),h=i(Ct,h,ut),zt===null?F=Ct:zt.sibling=Ct,zt=Ct);return t&&V.forEach(function(zp){return e(g,zp)}),bt&&on(g,ut),F}function wt(g,h,x,k){if(typeof x=="object"&&x!==null&&x.type===Dt&&x.key===null&&(x=x.props.children),typeof x=="object"&&x!==null){switch(x.$$typeof){case nt:t:{for(var F=x.key;h!==null;){if(h.key===F){if(F=x.type,F===Dt){if(h.tag===7){n(g,h.sibling),k=l(h,x.props.children),k.return=g,g=k;break t}}else if(h.elementType===F||typeof F=="object"&&F!==null&&F.$$typeof===at&&sa(F)===h.type){n(g,h.sibling),k=l(h,x.props),Ol(k,x),k.return=g,g=k;break t}n(g,h);break}else e(g,h);h=h.sibling}x.type===Dt?(k=na(x.props.children,g.mode,k,x.key),k.return=g,g=k):(k=ki(x.type,x.key,x.props,null,g.mode,k),Ol(k,x),k.return=g,g=k)}return o(g);case xt:t:{for(F=x.key;h!==null;){if(h.key===F)if(h.tag===4&&h.stateNode.containerInfo===x.containerInfo&&h.stateNode.implementation===x.implementation){n(g,h.sibling),k=l(h,x.children||[]),k.return=g,g=k;break t}else{n(g,h);break}else e(g,h);h=h.sibling}k=ls(x,g.mode,k),k.return=g,g=k}return o(g);case at:return x=sa(x),wt(g,h,x,k)}if(ft(x))return X(g,h,x,k);if(tt(x)){if(F=tt(x),typeof F!="function")throw Error(c(150));return x=F.call(x),$(g,h,x,k)}if(typeof x.then=="function")return wt(g,h,Ui(x),k);if(x.$$typeof===ct)return wt(g,h,Oi(g,x),k);Hi(g,x)}return typeof x=="string"&&x!==""||typeof x=="number"||typeof x=="bigint"?(x=""+x,h!==null&&h.tag===6?(n(g,h.sibling),k=l(h,x),k.return=g,g=k):(n(g,h),k=as(x,g.mode,k),k.return=g,g=k),o(g)):n(g,h)}return function(g,h,x,k){try{Dl=0;var F=wt(g,h,x,k);return Qa=null,F}catch(V){if(V===Xa||V===wi)throw V;var zt=xe(29,V,null,g.mode);return zt.lanes=k,zt.return=g,zt}finally{}}}var ra=ec(!0),nc=ec(!1),_n=!1;function gs(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function vs(t,e){t=t.updateQueue,e.updateQueue===t&&(e.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,callbacks:null})}function Dn(t){return{lane:t,tag:0,payload:null,callback:null,next:null}}function On(t,e,n){var a=t.updateQueue;if(a===null)return null;if(a=a.shared,(jt&2)!==0){var l=a.pending;return l===null?e.next=e:(e.next=l.next,l.next=e),a.pending=e,e=Mi(t),qr(t,null,n),e}return Ai(t,a,e,n),Mi(t)}function Rl(t,e,n){if(e=e.updateQueue,e!==null&&(e=e.shared,(n&4194048)!==0)){var a=e.lanes;a&=t.pendingLanes,n|=a,e.lanes=n,ml(t,n)}}function ys(t,e){var n=t.updateQueue,a=t.alternate;if(a!==null&&(a=a.updateQueue,n===a)){var l=null,i=null;if(n=n.firstBaseUpdate,n!==null){do{var o={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};i===null?l=i=o:i=i.next=o,n=n.next}while(n!==null);i===null?l=i=e:i=i.next=e}else l=i=e;n={baseState:a.baseState,firstBaseUpdate:l,lastBaseUpdate:i,shared:a.shared,callbacks:a.callbacks},t.updateQueue=n;return}t=n.lastBaseUpdate,t===null?n.firstBaseUpdate=e:t.next=e,n.lastBaseUpdate=e}var bs=!1;function wl(){if(bs){var t=Ka;if(t!==null)throw t}}function Bl(t,e,n,a){bs=!1;var l=t.updateQueue;_n=!1;var i=l.firstBaseUpdate,o=l.lastBaseUpdate,r=l.shared.pending;if(r!==null){l.shared.pending=null;var f=r,S=f.next;f.next=null,o===null?i=S:o.next=S,o=f;var A=t.alternate;A!==null&&(A=A.updateQueue,r=A.lastBaseUpdate,r!==o&&(r===null?A.firstBaseUpdate=S:r.next=S,A.lastBaseUpdate=f))}if(i!==null){var D=l.baseState;o=0,A=S=f=null,r=i;do{var T=r.lane&-536870913,z=T!==r.lane;if(z?(gt&T)===T:(a&T)===T){T!==0&&T===Ya&&(bs=!0),A!==null&&(A=A.next={lane:0,tag:r.tag,payload:r.payload,callback:null,next:null});t:{var X=t,$=r;T=e;var wt=n;switch($.tag){case 1:if(X=$.payload,typeof X=="function"){D=X.call(wt,D,T);break t}D=X;break t;case 3:X.flags=X.flags&-65537|128;case 0:if(X=$.payload,T=typeof X=="function"?X.call(wt,D,T):X,T==null)break t;D=R({},D,T);break t;case 2:_n=!0}}T=r.callback,T!==null&&(t.flags|=64,z&&(t.flags|=8192),z=l.callbacks,z===null?l.callbacks=[T]:z.push(T))}else z={lane:T,tag:r.tag,payload:r.payload,callback:r.callback,next:null},A===null?(S=A=z,f=D):A=A.next=z,o|=T;if(r=r.next,r===null){if(r=l.shared.pending,r===null)break;z=r,r=z.next,z.next=null,l.lastBaseUpdate=z,l.shared.pending=null}}while(!0);A===null&&(f=D),l.baseState=f,l.firstBaseUpdate=S,l.lastBaseUpdate=A,i===null&&(l.shared.lanes=0),Hn|=o,t.lanes=o,t.memoizedState=D}}function ac(t,e){if(typeof t!="function")throw Error(c(191,t));t.call(e)}function lc(t,e){var n=t.callbacks;if(n!==null)for(t.callbacks=null,t=0;ti?i:8;var o=j.T,r={};j.T=r,Ns(t,!1,e,n);try{var f=l(),S=j.S;if(S!==null&&S(r,f),f!==null&&typeof f=="object"&&typeof f.then=="function"){var A=mh(f,a);Nl(t,e,A,Ce(t))}else Nl(t,e,a,Ce(t))}catch(D){Nl(t,e,{then:function(){},status:"rejected",reason:D},Ce())}finally{B.p=i,o!==null&&r.types!==null&&(o.types=r.types),j.T=o}}function bh(){}function Us(t,e,n,a){if(t.tag!==5)throw Error(c(476));var l=Uc(t).queue;Bc(t,l,e,Z,n===null?bh:function(){return Hc(t),n(a)})}function Uc(t){var e=t.memoizedState;if(e!==null)return e;e={memoizedState:Z,baseState:Z,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:cn,lastRenderedState:Z},next:null};var n={};return e.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:cn,lastRenderedState:n},next:null},t.memoizedState=e,t=t.alternate,t!==null&&(t.memoizedState=e),e}function Hc(t){var e=Uc(t);e.next===null&&(e=t.alternate.memoizedState),Nl(t,e.next.queue,{},Ce())}function Hs(){return le(ei)}function Nc(){return Xt().memoizedState}function qc(){return Xt().memoizedState}function xh(t){for(var e=t.return;e!==null;){switch(e.tag){case 24:case 3:var n=Ce();t=Dn(n);var a=On(e,t,n);a!==null&&(ve(a,e,n),Rl(a,e,n)),e={cache:ds()},t.payload=e;return}e=e.return}}function Sh(t,e,n){var a=Ce();n={lane:a,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},Zi(t)?Gc(e,n):(n=es(t,e,n,a),n!==null&&(ve(n,t,a),Yc(n,e,a)))}function Lc(t,e,n){var a=Ce();Nl(t,e,n,a)}function Nl(t,e,n,a){var l={lane:a,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(Zi(t))Gc(e,l);else{var i=t.alternate;if(t.lanes===0&&(i===null||i.lanes===0)&&(i=e.lastRenderedReducer,i!==null))try{var o=e.lastRenderedState,r=i(o,n);if(l.hasEagerState=!0,l.eagerState=r,be(r,o))return Ai(t,e,l,0),Bt===null&&ji(),!1}catch{}finally{}if(n=es(t,e,l,a),n!==null)return ve(n,t,a),Yc(n,e,a),!0}return!1}function Ns(t,e,n,a){if(a={lane:2,revertLane:gu(),gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null},Zi(t)){if(e)throw Error(c(479))}else e=es(t,n,a,2),e!==null&&ve(e,t,2)}function Zi(t){var e=t.alternate;return t===st||e!==null&&e===st}function Gc(t,e){Za=Li=!0;var n=t.pending;n===null?e.next=e:(e.next=n.next,n.next=e),t.pending=e}function Yc(t,e,n){if((n&4194048)!==0){var a=e.lanes;a&=t.pendingLanes,n|=a,e.lanes=n,ml(t,n)}}var ql={readContext:le,use:Ki,useCallback:Gt,useContext:Gt,useEffect:Gt,useImperativeHandle:Gt,useLayoutEffect:Gt,useInsertionEffect:Gt,useMemo:Gt,useReducer:Gt,useRef:Gt,useState:Gt,useDebugValue:Gt,useDeferredValue:Gt,useTransition:Gt,useSyncExternalStore:Gt,useId:Gt,useHostTransitionStatus:Gt,useFormState:Gt,useActionState:Gt,useOptimistic:Gt,useMemoCache:Gt,useCacheRefresh:Gt};ql.useEffectEvent=Gt;var Kc={readContext:le,use:Ki,useCallback:function(t,e){return fe().memoizedState=[t,e===void 0?null:e],t},useContext:le,useEffect:jc,useImperativeHandle:function(t,e,n){n=n!=null?n.concat([t]):null,Qi(4194308,4,_c.bind(null,e,t),n)},useLayoutEffect:function(t,e){return Qi(4194308,4,t,e)},useInsertionEffect:function(t,e){Qi(4,2,t,e)},useMemo:function(t,e){var n=fe();e=e===void 0?null:e;var a=t();if(ca){Ae(!0);try{t()}finally{Ae(!1)}}return n.memoizedState=[a,e],a},useReducer:function(t,e,n){var a=fe();if(n!==void 0){var l=n(e);if(ca){Ae(!0);try{n(e)}finally{Ae(!1)}}}else l=e;return a.memoizedState=a.baseState=l,t={pending:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:l},a.queue=t,t=t.dispatch=Sh.bind(null,st,t),[a.memoizedState,t]},useRef:function(t){var e=fe();return t={current:t},e.memoizedState=t},useState:function(t){t=Ds(t);var e=t.queue,n=Lc.bind(null,st,e);return e.dispatch=n,[t.memoizedState,n]},useDebugValue:ws,useDeferredValue:function(t,e){var n=fe();return Bs(n,t,e)},useTransition:function(){var t=Ds(!1);return t=Bc.bind(null,st,t.queue,!0,!1),fe().memoizedState=t,[!1,t]},useSyncExternalStore:function(t,e,n){var a=st,l=fe();if(bt){if(n===void 0)throw Error(c(407));n=n()}else{if(n=e(),Bt===null)throw Error(c(349));(gt&127)!==0||cc(a,e,n)}l.memoizedState=n;var i={value:n,getSnapshot:e};return l.queue=i,jc(dc.bind(null,a,i,t),[t]),a.flags|=2048,Wa(9,{destroy:void 0},fc.bind(null,a,i,n,e),null),n},useId:function(){var t=fe(),e=Bt.identifierPrefix;if(bt){var n=Xe,a=Ke;n=(a&~(1<<32-ee(a)-1)).toString(32)+n,e="_"+e+"R_"+n,n=Gi++,0<\/script>",i=i.removeChild(i.firstChild);break;case"select":i=typeof a.is=="string"?o.createElement("select",{is:a.is}):o.createElement("select"),a.multiple?i.multiple=!0:a.size&&(i.size=a.size);break;default:i=typeof a.is=="string"?o.createElement(l,{is:a.is}):o.createElement(l)}}i[Qt]=e,i[ne]=a;t:for(o=e.child;o!==null;){if(o.tag===5||o.tag===6)i.appendChild(o.stateNode);else if(o.tag!==4&&o.tag!==27&&o.child!==null){o.child.return=o,o=o.child;continue}if(o===e)break t;for(;o.sibling===null;){if(o.return===null||o.return===e)break t;o=o.return}o.sibling.return=o.return,o=o.sibling}e.stateNode=i;t:switch(oe(i,l,a),l){case"button":case"input":case"select":case"textarea":a=!!a.autoFocus;break t;case"img":a=!0;break t;default:a=!1}a&&dn(e)}}return Nt(e),Is(e,e.type,t===null?null:t.memoizedProps,e.pendingProps,n),null;case 6:if(t&&e.stateNode!=null)t.memoizedProps!==a&&dn(e);else{if(typeof a!="string"&&e.stateNode===null)throw Error(c(166));if(t=rt.current,La(e)){if(t=e.stateNode,n=e.memoizedProps,a=null,l=ae,l!==null)switch(l.tag){case 27:case 5:a=l.memoizedProps}t[Qt]=e,t=!!(t.nodeValue===n||a!==null&&a.suppressHydrationWarning===!0||rd(t.nodeValue,n)),t||Mn(e,!0)}else t=ho(t).createTextNode(a),t[Qt]=e,e.stateNode=t}return Nt(e),null;case 31:if(n=e.memoizedState,t===null||t.memoizedState!==null){if(a=La(e),n!==null){if(t===null){if(!a)throw Error(c(318));if(t=e.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(c(557));t[Qt]=e}else aa(),(e.flags&128)===0&&(e.memoizedState=null),e.flags|=4;Nt(e),t=!1}else n=us(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=n),t=!0;if(!t)return e.flags&256?(Te(e),e):(Te(e),null);if((e.flags&128)!==0)throw Error(c(558))}return Nt(e),null;case 13:if(a=e.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(l=La(e),a!==null&&a.dehydrated!==null){if(t===null){if(!l)throw Error(c(318));if(l=e.memoizedState,l=l!==null?l.dehydrated:null,!l)throw Error(c(317));l[Qt]=e}else aa(),(e.flags&128)===0&&(e.memoizedState=null),e.flags|=4;Nt(e),l=!1}else l=us(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=l),l=!0;if(!l)return e.flags&256?(Te(e),e):(Te(e),null)}return Te(e),(e.flags&128)!==0?(e.lanes=n,e):(n=a!==null,t=t!==null&&t.memoizedState!==null,n&&(a=e.child,l=null,a.alternate!==null&&a.alternate.memoizedState!==null&&a.alternate.memoizedState.cachePool!==null&&(l=a.alternate.memoizedState.cachePool.pool),i=null,a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(i=a.memoizedState.cachePool.pool),i!==l&&(a.flags|=2048)),n!==t&&n&&(e.child.flags|=8192),Ii(e,e.updateQueue),Nt(e),null);case 4:return Ut(),t===null&&xu(e.stateNode.containerInfo),Nt(e),null;case 10:return un(e.type),Nt(e),null;case 19:if(_(Kt),a=e.memoizedState,a===null)return Nt(e),null;if(l=(e.flags&128)!==0,i=a.rendering,i===null)if(l)Gl(a,!1);else{if(Yt!==0||t!==null&&(t.flags&128)!==0)for(t=e.child;t!==null;){if(i=qi(t),i!==null){for(e.flags|=128,Gl(a,!1),t=i.updateQueue,e.updateQueue=t,Ii(e,t),e.subtreeFlags=0,t=n,n=e.child;n!==null;)Lr(n,t),n=n.sibling;return N(Kt,Kt.current&1|2),bt&&on(e,a.treeForkCount),e.child}t=t.sibling}a.tail!==null&&se()>ao&&(e.flags|=128,l=!0,Gl(a,!1),e.lanes=4194304)}else{if(!l)if(t=qi(i),t!==null){if(e.flags|=128,l=!0,t=t.updateQueue,e.updateQueue=t,Ii(e,t),Gl(a,!0),a.tail===null&&a.tailMode==="hidden"&&!i.alternate&&!bt)return Nt(e),null}else 2*se()-a.renderingStartTime>ao&&n!==536870912&&(e.flags|=128,l=!0,Gl(a,!1),e.lanes=4194304);a.isBackwards?(i.sibling=e.child,e.child=i):(t=a.last,t!==null?t.sibling=i:e.child=i,a.last=i)}return a.tail!==null?(t=a.tail,a.rendering=t,a.tail=t.sibling,a.renderingStartTime=se(),t.sibling=null,n=Kt.current,N(Kt,l?n&1|2:n&1),bt&&on(e,a.treeForkCount),t):(Nt(e),null);case 22:case 23:return Te(e),Ss(),a=e.memoizedState!==null,t!==null?t.memoizedState!==null!==a&&(e.flags|=8192):a&&(e.flags|=8192),a?(n&536870912)!==0&&(e.flags&128)===0&&(Nt(e),e.subtreeFlags&6&&(e.flags|=8192)):Nt(e),n=e.updateQueue,n!==null&&Ii(e,n.retryQueue),n=null,t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(n=t.memoizedState.cachePool.pool),a=null,e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(a=e.memoizedState.cachePool.pool),a!==n&&(e.flags|=2048),t!==null&&_(oa),null;case 24:return n=null,t!==null&&(n=t.memoizedState.cache),e.memoizedState.cache!==n&&(e.flags|=2048),un(Vt),Nt(e),null;case 25:return null;case 30:return null}throw Error(c(156,e.tag))}function jh(t,e){switch(os(e),e.tag){case 1:return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 3:return un(Vt),Ut(),t=e.flags,(t&65536)!==0&&(t&128)===0?(e.flags=t&-65537|128,e):null;case 26:case 27:case 5:return ha(e),null;case 31:if(e.memoizedState!==null){if(Te(e),e.alternate===null)throw Error(c(340));aa()}return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 13:if(Te(e),t=e.memoizedState,t!==null&&t.dehydrated!==null){if(e.alternate===null)throw Error(c(340));aa()}return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 19:return _(Kt),null;case 4:return Ut(),null;case 10:return un(e.type),null;case 22:case 23:return Te(e),Ss(),t!==null&&_(oa),t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 24:return un(Vt),null;case 25:return null;default:return null}}function hf(t,e){switch(os(e),e.tag){case 3:un(Vt),Ut();break;case 26:case 27:case 5:ha(e);break;case 4:Ut();break;case 31:e.memoizedState!==null&&Te(e);break;case 13:Te(e);break;case 19:_(Kt);break;case 10:un(e.type);break;case 22:case 23:Te(e),Ss(),t!==null&&_(oa);break;case 24:un(Vt)}}function Yl(t,e){try{var n=e.updateQueue,a=n!==null?n.lastEffect:null;if(a!==null){var l=a.next;n=l;do{if((n.tag&t)===t){a=void 0;var i=n.create,o=n.inst;a=i(),o.destroy=a}n=n.next}while(n!==l)}}catch(r){_t(e,e.return,r)}}function Bn(t,e,n){try{var a=e.updateQueue,l=a!==null?a.lastEffect:null;if(l!==null){var i=l.next;a=i;do{if((a.tag&t)===t){var o=a.inst,r=o.destroy;if(r!==void 0){o.destroy=void 0,l=e;var f=n,S=r;try{S()}catch(A){_t(l,f,A)}}}a=a.next}while(a!==i)}}catch(A){_t(e,e.return,A)}}function pf(t){var e=t.updateQueue;if(e!==null){var n=t.stateNode;try{lc(e,n)}catch(a){_t(t,t.return,a)}}}function gf(t,e,n){n.props=fa(t.type,t.memoizedProps),n.state=t.memoizedState;try{n.componentWillUnmount()}catch(a){_t(t,e,a)}}function Kl(t,e){try{var n=t.ref;if(n!==null){switch(t.tag){case 26:case 27:case 5:var a=t.stateNode;break;case 30:a=t.stateNode;break;default:a=t.stateNode}typeof n=="function"?t.refCleanup=n(a):n.current=a}}catch(l){_t(t,e,l)}}function Qe(t,e){var n=t.ref,a=t.refCleanup;if(n!==null)if(typeof a=="function")try{a()}catch(l){_t(t,e,l)}finally{t.refCleanup=null,t=t.alternate,t!=null&&(t.refCleanup=null)}else if(typeof n=="function")try{n(null)}catch(l){_t(t,e,l)}else n.current=null}function vf(t){var e=t.type,n=t.memoizedProps,a=t.stateNode;try{t:switch(e){case"button":case"input":case"select":case"textarea":n.autoFocus&&a.focus();break t;case"img":n.src?a.src=n.src:n.srcSet&&(a.srcset=n.srcSet)}}catch(l){_t(t,t.return,l)}}function Ps(t,e,n){try{var a=t.stateNode;Jh(a,t.type,n,e),a[ne]=e}catch(l){_t(t,t.return,l)}}function yf(t){return t.tag===5||t.tag===3||t.tag===26||t.tag===27&&Yn(t.type)||t.tag===4}function tu(t){t:for(;;){for(;t.sibling===null;){if(t.return===null||yf(t.return))return null;t=t.return}for(t.sibling.return=t.return,t=t.sibling;t.tag!==5&&t.tag!==6&&t.tag!==18;){if(t.tag===27&&Yn(t.type)||t.flags&2||t.child===null||t.tag===4)continue t;t.child.return=t,t=t.child}if(!(t.flags&2))return t.stateNode}}function eu(t,e,n){var a=t.tag;if(a===5||a===6)t=t.stateNode,e?(n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n).insertBefore(t,e):(e=n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n,e.appendChild(t),n=n._reactRootContainer,n!=null||e.onclick!==null||(e.onclick=nn));else if(a!==4&&(a===27&&Yn(t.type)&&(n=t.stateNode,e=null),t=t.child,t!==null))for(eu(t,e,n),t=t.sibling;t!==null;)eu(t,e,n),t=t.sibling}function Pi(t,e,n){var a=t.tag;if(a===5||a===6)t=t.stateNode,e?n.insertBefore(t,e):n.appendChild(t);else if(a!==4&&(a===27&&Yn(t.type)&&(n=t.stateNode),t=t.child,t!==null))for(Pi(t,e,n),t=t.sibling;t!==null;)Pi(t,e,n),t=t.sibling}function bf(t){var e=t.stateNode,n=t.memoizedProps;try{for(var a=t.type,l=e.attributes;l.length;)e.removeAttributeNode(l[0]);oe(e,a,n),e[Qt]=t,e[ne]=n}catch(i){_t(t,t.return,i)}}var mn=!1,Wt=!1,nu=!1,xf=typeof WeakSet=="function"?WeakSet:Set,Pt=null;function Ah(t,e){if(t=t.containerInfo,Eu=So,t=Dr(t),Wo(t)){if("selectionStart"in t)var n={start:t.selectionStart,end:t.selectionEnd};else t:{n=(n=t.ownerDocument)&&n.defaultView||window;var a=n.getSelection&&n.getSelection();if(a&&a.rangeCount!==0){n=a.anchorNode;var l=a.anchorOffset,i=a.focusNode;a=a.focusOffset;try{n.nodeType,i.nodeType}catch{n=null;break t}var o=0,r=-1,f=-1,S=0,A=0,D=t,T=null;e:for(;;){for(var z;D!==n||l!==0&&D.nodeType!==3||(r=o+l),D!==i||a!==0&&D.nodeType!==3||(f=o+a),D.nodeType===3&&(o+=D.nodeValue.length),(z=D.firstChild)!==null;)T=D,D=z;for(;;){if(D===t)break e;if(T===n&&++S===l&&(r=o),T===i&&++A===a&&(f=o),(z=D.nextSibling)!==null)break;D=T,T=D.parentNode}D=z}n=r===-1||f===-1?null:{start:r,end:f}}else n=null}n=n||{start:0,end:0}}else n=null;for(zu={focusedElem:t,selectionRange:n},So=!1,Pt=e;Pt!==null;)if(e=Pt,t=e.child,(e.subtreeFlags&1028)!==0&&t!==null)t.return=e,Pt=t;else for(;Pt!==null;){switch(e=Pt,i=e.alternate,t=e.flags,e.tag){case 0:if((t&4)!==0&&(t=e.updateQueue,t=t!==null?t.events:null,t!==null))for(n=0;n title"))),oe(i,a,n),i[Qt]=t,yt(i),a=i;break t;case"link":var o=jd("link","href",l).get(a+(n.href||""));if(o){for(var r=0;rwt&&(o=wt,wt=$,$=o);var g=kr(r,$),h=kr(r,wt);if(g&&h&&(z.rangeCount!==1||z.anchorNode!==g.node||z.anchorOffset!==g.offset||z.focusNode!==h.node||z.focusOffset!==h.offset)){var x=D.createRange();x.setStart(g.node,g.offset),z.removeAllRanges(),$>wt?(z.addRange(x),z.extend(h.node,h.offset)):(x.setEnd(h.node,h.offset),z.addRange(x))}}}}for(D=[],z=r;z=z.parentNode;)z.nodeType===1&&D.push({element:z,left:z.scrollLeft,top:z.scrollTop});for(typeof r.focus=="function"&&r.focus(),r=0;rn?32:n,j.T=null,n=ru,ru=null;var i=qn,o=yn;if(Ft=0,tl=qn=null,yn=0,(jt&6)!==0)throw Error(c(331));var r=jt;if(jt|=4,Df(i.current),Mf(i,i.current,o,n),jt=r,Wl(0,!1),ue&&typeof ue.onPostCommitFiberRoot=="function")try{ue.onPostCommitFiberRoot(ye,i)}catch{}return!0}finally{B.p=l,j.T=a,Wf(t,e)}}function $f(t,e,n){e=De(n,e),e=Ys(t.stateNode,e,2),t=On(t,e,2),t!==null&&(En(t,2),Ve(t))}function _t(t,e,n){if(t.tag===3)$f(t,t,n);else for(;e!==null;){if(e.tag===3){$f(e,t,n);break}else if(e.tag===1){var a=e.stateNode;if(typeof e.type.getDerivedStateFromError=="function"||typeof a.componentDidCatch=="function"&&(Nn===null||!Nn.has(a))){t=De(n,t),n=$c(2),a=On(e,n,2),a!==null&&(Ic(n,a,e,t),En(a,2),Ve(a));break}}e=e.return}}function mu(t,e,n){var a=t.pingCache;if(a===null){a=t.pingCache=new _h;var l=new Set;a.set(e,l)}else l=a.get(e),l===void 0&&(l=new Set,a.set(e,l));l.has(n)||(iu=!0,l.add(n),t=Bh.bind(null,t,e,n),e.then(t,t))}function Bh(t,e,n){var a=t.pingCache;a!==null&&a.delete(e),t.pingedLanes|=t.suspendedLanes&n,t.warmLanes&=~n,Bt===t&&(gt&n)===n&&(Yt===4||Yt===3&&(gt&62914560)===gt&&300>se()-no?(jt&2)===0&&el(t,0):ou|=n,Pa===gt&&(Pa=0)),Ve(t)}function If(t,e){e===0&&(e=Ea()),t=ea(t,e),t!==null&&(En(t,e),Ve(t))}function Uh(t){var e=t.memoizedState,n=0;e!==null&&(n=e.retryLane),If(t,n)}function Hh(t,e){var n=0;switch(t.tag){case 31:case 13:var a=t.stateNode,l=t.memoizedState;l!==null&&(n=l.retryLane);break;case 19:a=t.stateNode;break;case 22:a=t.stateNode._retryCache;break;default:throw Error(c(314))}a!==null&&a.delete(e),If(t,n)}function Nh(t,e){return fl(t,e)}var ro=null,al=null,hu=!1,co=!1,pu=!1,Gn=0;function Ve(t){t!==al&&t.next===null&&(al===null?ro=al=t:al=al.next=t),co=!0,hu||(hu=!0,Lh())}function Wl(t,e){if(!pu&&co){pu=!0;do for(var n=!1,a=ro;a!==null;){if(t!==0){var l=a.pendingLanes;if(l===0)var i=0;else{var o=a.suspendedLanes,r=a.pingedLanes;i=(1<<31-ee(42|t)+1)-1,i&=l&~(o&~r),i=i&201326741?i&201326741|1:i?i|2:0}i!==0&&(n=!0,nd(a,i))}else i=gt,i=Ta(a,a===Bt?i:0,a.cancelPendingCommit!==null||a.timeoutHandle!==-1),(i&3)===0||Tn(a,i)||(n=!0,nd(a,i));a=a.next}while(n);pu=!1}}function qh(){Pf()}function Pf(){co=hu=!1;var t=0;Gn!==0&&Fh()&&(t=Gn);for(var e=se(),n=null,a=ro;a!==null;){var l=a.next,i=td(a,e);i===0?(a.next=null,n===null?ro=l:n.next=l,l===null&&(al=n)):(n=a,(t!==0||(i&3)!==0)&&(co=!0)),a=l}Ft!==0&&Ft!==5||Wl(t),Gn!==0&&(Gn=0)}function td(t,e){for(var n=t.suspendedLanes,a=t.pingedLanes,l=t.expirationTimes,i=t.pendingLanes&-62914561;0r)break;var A=f.transferSize,D=f.initiatorType;A&&cd(D)&&(f=f.responseEnd,o+=A*(f"u"?null:document;function Td(t,e,n){var a=ll;if(a&&typeof e=="string"&&e){var l=ke(e);l='link[rel="'+t+'"][href="'+l+'"]',typeof n=="string"&&(l+='[crossorigin="'+n+'"]'),Sd.has(l)||(Sd.add(l),t={rel:t,crossOrigin:n,href:e},a.querySelector(l)===null&&(e=a.createElement("link"),oe(e,"link",t),yt(e),a.head.appendChild(e)))}}function ip(t){bn.D(t),Td("dns-prefetch",t,null)}function op(t,e){bn.C(t,e),Td("preconnect",t,e)}function sp(t,e,n){bn.L(t,e,n);var a=ll;if(a&&t&&e){var l='link[rel="preload"][as="'+ke(e)+'"]';e==="image"&&n&&n.imageSrcSet?(l+='[imagesrcset="'+ke(n.imageSrcSet)+'"]',typeof n.imageSizes=="string"&&(l+='[imagesizes="'+ke(n.imageSizes)+'"]')):l+='[href="'+ke(t)+'"]';var i=l;switch(e){case"style":i=il(t);break;case"script":i=ol(t)}He.has(i)||(t=R({rel:"preload",href:e==="image"&&n&&n.imageSrcSet?void 0:t,as:e},n),He.set(i,t),a.querySelector(l)!==null||e==="style"&&a.querySelector(Pl(i))||e==="script"&&a.querySelector(ti(i))||(e=a.createElement("link"),oe(e,"link",t),yt(e),a.head.appendChild(e)))}}function up(t,e){bn.m(t,e);var n=ll;if(n&&t){var a=e&&typeof e.as=="string"?e.as:"script",l='link[rel="modulepreload"][as="'+ke(a)+'"][href="'+ke(t)+'"]',i=l;switch(a){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":i=ol(t)}if(!He.has(i)&&(t=R({rel:"modulepreload",href:t},e),He.set(i,t),n.querySelector(l)===null)){switch(a){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(n.querySelector(ti(i)))return}a=n.createElement("link"),oe(a,"link",t),yt(a),n.head.appendChild(a)}}}function rp(t,e,n){bn.S(t,e,n);var a=ll;if(a&&t){var l=St(a).hoistableStyles,i=il(t);e=e||"default";var o=l.get(i);if(!o){var r={loading:0,preload:null};if(o=a.querySelector(Pl(i)))r.loading=5;else{t=R({rel:"stylesheet",href:t,"data-precedence":e},n),(n=He.get(i))&&Du(t,n);var f=o=a.createElement("link");yt(f),oe(f,"link",t),f._p=new Promise(function(S,A){f.onload=S,f.onerror=A}),f.addEventListener("load",function(){r.loading|=1}),f.addEventListener("error",function(){r.loading|=2}),r.loading|=4,go(o,e,a)}o={type:"stylesheet",instance:o,count:1,state:r},l.set(i,o)}}}function cp(t,e){bn.X(t,e);var n=ll;if(n&&t){var a=St(n).hoistableScripts,l=ol(t),i=a.get(l);i||(i=n.querySelector(ti(l)),i||(t=R({src:t,async:!0},e),(e=He.get(l))&&Ou(t,e),i=n.createElement("script"),yt(i),oe(i,"link",t),n.head.appendChild(i)),i={type:"script",instance:i,count:1,state:null},a.set(l,i))}}function fp(t,e){bn.M(t,e);var n=ll;if(n&&t){var a=St(n).hoistableScripts,l=ol(t),i=a.get(l);i||(i=n.querySelector(ti(l)),i||(t=R({src:t,async:!0,type:"module"},e),(e=He.get(l))&&Ou(t,e),i=n.createElement("script"),yt(i),oe(i,"link",t),n.head.appendChild(i)),i={type:"script",instance:i,count:1,state:null},a.set(l,i))}}function Ed(t,e,n,a){var l=(l=rt.current)?po(l):null;if(!l)throw Error(c(446));switch(t){case"meta":case"title":return null;case"style":return typeof n.precedence=="string"&&typeof n.href=="string"?(e=il(n.href),n=St(l).hoistableStyles,a=n.get(e),a||(a={type:"style",instance:null,count:0,state:null},n.set(e,a)),a):{type:"void",instance:null,count:0,state:null};case"link":if(n.rel==="stylesheet"&&typeof n.href=="string"&&typeof n.precedence=="string"){t=il(n.href);var i=St(l).hoistableStyles,o=i.get(t);if(o||(l=l.ownerDocument||l,o={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},i.set(t,o),(i=l.querySelector(Pl(t)))&&!i._p&&(o.instance=i,o.state.loading=5),He.has(t)||(n={rel:"preload",as:"style",href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},He.set(t,n),i||dp(l,t,n,o.state))),e&&a===null)throw Error(c(528,""));return o}if(e&&a!==null)throw Error(c(529,""));return null;case"script":return e=n.async,n=n.src,typeof n=="string"&&e&&typeof e!="function"&&typeof e!="symbol"?(e=ol(n),n=St(l).hoistableScripts,a=n.get(e),a||(a={type:"script",instance:null,count:0,state:null},n.set(e,a)),a):{type:"void",instance:null,count:0,state:null};default:throw Error(c(444,t))}}function il(t){return'href="'+ke(t)+'"'}function Pl(t){return'link[rel="stylesheet"]['+t+"]"}function zd(t){return R({},t,{"data-precedence":t.precedence,precedence:null})}function dp(t,e,n,a){t.querySelector('link[rel="preload"][as="style"]['+e+"]")?a.loading=1:(e=t.createElement("link"),a.preload=e,e.addEventListener("load",function(){return a.loading|=1}),e.addEventListener("error",function(){return a.loading|=2}),oe(e,"link",n),yt(e),t.head.appendChild(e))}function ol(t){return'[src="'+ke(t)+'"]'}function ti(t){return"script[async]"+t}function Cd(t,e,n){if(e.count++,e.instance===null)switch(e.type){case"style":var a=t.querySelector('style[data-href~="'+ke(n.href)+'"]');if(a)return e.instance=a,yt(a),a;var l=R({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return a=(t.ownerDocument||t).createElement("style"),yt(a),oe(a,"style",l),go(a,n.precedence,t),e.instance=a;case"stylesheet":l=il(n.href);var i=t.querySelector(Pl(l));if(i)return e.state.loading|=4,e.instance=i,yt(i),i;a=zd(n),(l=He.get(l))&&Du(a,l),i=(t.ownerDocument||t).createElement("link"),yt(i);var o=i;return o._p=new Promise(function(r,f){o.onload=r,o.onerror=f}),oe(i,"link",a),e.state.loading|=4,go(i,n.precedence,t),e.instance=i;case"script":return i=ol(n.src),(l=t.querySelector(ti(i)))?(e.instance=l,yt(l),l):(a=n,(l=He.get(i))&&(a=R({},n),Ou(a,l)),t=t.ownerDocument||t,l=t.createElement("script"),yt(l),oe(l,"link",a),t.head.appendChild(l),e.instance=l);case"void":return null;default:throw Error(c(443,e.type))}else e.type==="stylesheet"&&(e.state.loading&4)===0&&(a=e.instance,e.state.loading|=4,go(a,n.precedence,t));return e.instance}function go(t,e,n){for(var a=n.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),l=a.length?a[a.length-1]:null,i=l,o=0;o title"):null)}function mp(t,e,n){if(n===1||e.itemProp!=null)return!1;switch(t){case"meta":case"title":return!0;case"style":if(typeof e.precedence!="string"||typeof e.href!="string"||e.href==="")break;return!0;case"link":if(typeof e.rel!="string"||typeof e.href!="string"||e.href===""||e.onLoad||e.onError)break;switch(e.rel){case"stylesheet":return t=e.disabled,typeof e.precedence=="string"&&t==null;default:return!0}case"script":if(e.async&&typeof e.async!="function"&&typeof e.async!="symbol"&&!e.onLoad&&!e.onError&&e.src&&typeof e.src=="string")return!0}return!1}function Md(t){return!(t.type==="stylesheet"&&(t.state.loading&3)===0)}function hp(t,e,n,a){if(n.type==="stylesheet"&&(typeof a.media!="string"||matchMedia(a.media).matches!==!1)&&(n.state.loading&4)===0){if(n.instance===null){var l=il(a.href),i=e.querySelector(Pl(l));if(i){e=i._p,e!==null&&typeof e=="object"&&typeof e.then=="function"&&(t.count++,t=yo.bind(t),e.then(t,t)),n.state.loading|=4,n.instance=i,yt(i);return}i=e.ownerDocument||e,a=zd(a),(l=He.get(l))&&Du(a,l),i=i.createElement("link"),yt(i);var o=i;o._p=new Promise(function(r,f){o.onload=r,o.onerror=f}),oe(i,"link",a),n.instance=i}t.stylesheets===null&&(t.stylesheets=new Map),t.stylesheets.set(n,e),(e=n.state.preload)&&(n.state.loading&3)===0&&(t.count++,n=yo.bind(t),e.addEventListener("load",n),e.addEventListener("error",n))}}var Ru=0;function pp(t,e){return t.stylesheets&&t.count===0&&xo(t,t.stylesheets),0Ru?50:800)+e);return t.unsuspend=n,function(){t.unsuspend=null,clearTimeout(a),clearTimeout(l)}}:null}function yo(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)xo(this,this.stylesheets);else if(this.unsuspend){var t=this.unsuspend;this.unsuspend=null,t()}}}var bo=null;function xo(t,e){t.stylesheets=null,t.unsuspend!==null&&(t.count++,bo=new Map,e.forEach(gp,t),bo=null,yo.call(t))}function gp(t,e){if(!(e.state.loading&4)){var n=bo.get(t);if(n)var a=n.get(null);else{n=new Map,bo.set(t,n);for(var l=t.querySelectorAll("link[data-precedence],style[data-precedence]"),i=0;i"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(u)}catch(p){console.error(p)}}return u(),Yu.exports=Rp(),Yu.exports}var Bp=wp();const Up="modulepreload",Hp=function(u){return"/"+u},Id={},Lt=function(p,d,c){let v=Promise.resolve();if(d&&d.length>0){let M=function(y){return Promise.all(y.map(G=>Promise.resolve(G).then(R=>({status:"fulfilled",value:R}),R=>({status:"rejected",reason:R}))))};document.getElementsByTagName("link");const O=document.querySelector("meta[property=csp-nonce]"),C=(O==null?void 0:O.nonce)||(O==null?void 0:O.getAttribute("nonce"));v=M(d.map(y=>{if(y=Hp(y),y in Id)return;Id[y]=!0;const G=y.endsWith(".css"),R=G?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${y}"]${R}`))return;const K=document.createElement("link");if(K.rel=G?"stylesheet":Up,G||(K.as="script"),K.crossOrigin="",K.href=y,C&&K.setAttribute("nonce",C),document.head.appendChild(K),G)return new Promise((nt,xt)=>{K.addEventListener("load",nt),K.addEventListener("error",()=>xt(new Error(`Unable to preload CSS for ${y}`)))})}))}function E(M){const O=new Event("vite:preloadError",{cancelable:!0});if(O.payload=M,window.dispatchEvent(O),!O.defaultPrevented)throw M}return v.then(M=>{for(const O of M||[])O.status==="rejected"&&E(O.reason);return p().catch(E)})},Mo={amber:{dark:{bg:"#09090b",sf:"#111114",sfH:"#18181c",bd:"#1e1e24",tx:"#e4e4e7",tx2:"#a1a1aa",txM:"#919199",ac:"#e8a845",acD:"rgba(232,168,69,0.12)",acT:"#fbbf24",cdBg:"#0c0c0f",cdTx:"#c4c4cc",sbBg:"#0c0c0e",hdBg:"rgba(9,9,11,0.85)"},light:{bg:"#fafaf9",sf:"#ffffff",sfH:"#f5f5f4",bd:"#e7e5e4",tx:"#1c1917",tx2:"#57534e",txM:"#706b66",ac:"#96640a",acD:"rgba(150,100,10,0.08)",acT:"#7a5208",cdBg:"#f5f3f0",cdTx:"#2c2520",sbBg:"#f5f5f3",hdBg:"rgba(250,250,249,0.85)"},fonts:{heading:"Instrument Serif",body:"DM Sans",code:"JetBrains Mono"}},editorial:{dark:{bg:"#080c1f",sf:"#0e1333",sfH:"#141940",bd:"#1a2050",tx:"#e8e6f0",tx2:"#b5b1c8",txM:"#9490ae",ac:"#ff6b4a",acD:"rgba(255,107,74,0.1)",acT:"#ff8a70",cdBg:"#0a0e27",cdTx:"#b8b4cc",sbBg:"#0a0e27",hdBg:"rgba(8,12,31,0.9)"},light:{bg:"#f6f4f0",sf:"#ffffff",sfH:"#eeece6",bd:"#ddd9d0",tx:"#1a1716",tx2:"#4a443e",txM:"#706960",ac:"#b83d22",acD:"rgba(184,61,34,0.07)",acT:"#9c3019",cdBg:"#edeae4",cdTx:"#3a3530",sbBg:"#f0ede8",hdBg:"rgba(246,244,240,0.92)"},fonts:{heading:"Cormorant Garamond",body:"Bricolage Grotesque",code:"Fira Code"}},cipher:{dark:{bg:"#050508",sf:"#0c0c12",sfH:"#12121a",bd:"#1a1a25",tx:"#d4ff00",tx2:"#8a90a0",txM:"#6a7080",ac:"#6666ff",acD:"rgba(102,102,255,0.10)",acT:"#8080ff",cdBg:"#08080e",cdTx:"#b0c870",sbBg:"#08080d",hdBg:"rgba(5,5,8,0.88)"},light:{bg:"#f0f2f5",sf:"#ffffff",sfH:"#e8eaef",bd:"#d0d4db",tx:"#0f1219",tx2:"#4a5060",txM:"#6a7080",ac:"#2020cc",acD:"rgba(32,32,204,0.08)",acT:"#1a1aa8",cdBg:"#e6e9ef",cdTx:"#2a3520",sbBg:"#ebedf2",hdBg:"rgba(240,242,245,0.90)"},fonts:{heading:"Bodoni Moda",body:"Space Grotesk",code:"Source Code Pro"}},mint:{dark:{bg:"#0d1117",sf:"#161b22",sfH:"#1c2129",bd:"#21262d",tx:"#e6edf3",tx2:"#8b949e",txM:"#6e7681",ac:"#0ea371",acD:"rgba(14,163,113,0.10)",acT:"#2dd4a0",cdBg:"#0a0e14",cdTx:"#adbac7",sbBg:"#0d1117",hdBg:"rgba(13,17,23,0.88)"},light:{bg:"#ffffff",sf:"#f6f8fa",sfH:"#eef1f5",bd:"#d8dee4",tx:"#1f2328",tx2:"#59636e",txM:"#6e7681",ac:"#0a7b53",acD:"rgba(10,123,83,0.07)",acT:"#087a50",cdBg:"#f0f3f6",cdTx:"#24292f",sbBg:"#f6f8fa",hdBg:"rgba(255,255,255,0.90)"},fonts:{heading:"Inter",body:"Inter",code:"Fira Code"}}},Np=()=>s.jsx("svg",{width:22,height:22,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:s.jsx("path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"})}),qp=()=>s.jsx("svg",{width:18,height:18,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:s.jsx("path",{d:"M18 6L6 18M6 6l12 12"})}),Lp=()=>s.jsx("svg",{width:16,height:16,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:s.jsx("path",{d:"M22 2L11 13M22 2l-7 20-4-9-9-4z"})});function um(u){let p="You are a helpful documentation assistant. Answer questions accurately based on the documentation provided below. If the answer isn't in the documentation, say so clearly. Keep answers concise and reference specific sections when possible.";if(u){const d=u.length>1e5?u.slice(0,1e5)+`
-[Documentation truncated...]`:u;h+=`
+[Documentation truncated...]`:u;p+=`
Documentation:
-${d}`}return h}async function Gh(u,h,d,c){var M,O,C;const v=await fetch("https://api.openai.com/v1/chat/completions",{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${h}`},body:JSON.stringify({model:d,messages:[{role:"system",content:um(c)},...u.map(y=>({role:y.role,content:y.content}))]})});if(!v.ok){const y=await v.text();throw new Error(`OpenAI API error (${v.status}): ${y}`)}return((C=(O=(M=(await v.json()).choices)==null?void 0:M[0])==null?void 0:O.message)==null?void 0:C.content)||"No response."}async function Yh(u,h,d,c){var M,O;const v=await fetch("https://api.anthropic.com/v1/messages",{method:"POST",headers:{"Content-Type":"application/json","x-api-key":h,"anthropic-version":"2023-06-01","anthropic-dangerous-direct-browser-access":"true"},body:JSON.stringify({model:d,max_tokens:1024,system:um(c),messages:u.map(C=>({role:C.role,content:C.content}))})});if(!v.ok){const C=await v.text();throw new Error(`Anthropic API error (${v.status}): ${C}`)}return((O=(M=(await v.json()).content)==null?void 0:M[0])==null?void 0:O.text)||"No response."}function Kh(u){return u==="openai"?"gpt-4o-mini":"claude-sonnet-4-20250514"}function Xh({provider:u,model:h,apiKey:d,context:c}){const[v,E]=w.useState(!1),[M,O]=w.useState([]),[C,y]=w.useState(""),[G,R]=w.useState(!1),[K,nt]=w.useState(null),xt=w.useRef(null),Dt=w.useRef(null),jt=d||(typeof window<"u"?window.__TOME_AI_API_KEY__:void 0),W=h||Kh(u);w.useEffect(()=>{var Q;(Q=xt.current)==null||Q.scrollIntoView({behavior:"smooth"})},[M]),w.useEffect(()=>{v&&setTimeout(()=>{var Q;return(Q=Dt.current)==null?void 0:Q.focus()},100)},[v]);const I=w.useCallback(async()=>{const Q=C.trim();if(!Q||G||!jt)return;const Y={role:"user",content:Q},H=[...M,Y];O(H),y(""),R(!0),nt(null);try{let U;u==="openai"?U=await Gh(H,jt,W,c):U=await Yh(H,jt,W,c),O(at=>[...at,{role:"assistant",content:U}])}catch(U){nt(U instanceof Error?U.message:"Failed to get response")}finally{R(!1)}},[C,G,M,u,jt,W,c]),ct=w.useCallback(Q=>{Q.key==="Enter"&&!Q.shiftKey&&(Q.preventDefault(),I())},[I]);return v?s.jsxs("div",{"data-testid":"ai-chat-panel",style:{position:"fixed",bottom:24,right:24,zIndex:900,width:380,maxWidth:"calc(100vw - 48px)",height:520,maxHeight:"calc(100vh - 48px)",background:"var(--sf)",border:"1px solid var(--bd)",borderRadius:12,boxShadow:"0 16px 64px rgba(0,0,0,0.3)",display:"flex",flexDirection:"column",overflow:"hidden",fontFamily:"var(--font-body)"},children:[s.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"12px 16px",borderBottom:"1px solid var(--bd)",flexShrink:0},children:[s.jsx("span",{style:{fontSize:14,fontWeight:600,color:"var(--tx)"},children:"Ask AI"}),s.jsx("button",{"data-testid":"ai-chat-close",onClick:()=>E(!1),"aria-label":"Close AI chat",style:{background:"none",border:"none",color:"var(--txM)",cursor:"pointer",display:"flex",padding:4},children:s.jsx(qh,{})})]}),s.jsxs("div",{style:{flex:1,overflow:"auto",padding:"12px 16px"},children:[!jt&&s.jsxs("div",{"data-testid":"ai-chat-no-key",style:{textAlign:"center",color:"var(--txM)",fontSize:13,padding:"24px 8px",lineHeight:1.6},children:[s.jsx("p",{style:{marginBottom:8,fontWeight:500,color:"var(--tx)"},children:"AI not configured"}),s.jsxs("p",{style:{marginBottom:8},children:["To enable AI chat, set the ",s.jsx("code",{style:{fontFamily:"var(--font-code)",fontSize:"0.88em",background:"var(--cdBg)",padding:"0.15em 0.4em",borderRadius:4},children:"apiKeyEnv"})," in ",s.jsx("code",{style:{fontFamily:"var(--font-code)",fontSize:"0.88em",background:"var(--cdBg)",padding:"0.15em 0.4em",borderRadius:4},children:"tome.config.js"})," and provide the environment variable at build time."]}),s.jsxs("p",{style:{fontSize:11.5,color:"var(--txM)"},children:["Example: ",s.jsx("code",{style:{fontFamily:"var(--font-code)",fontSize:"0.88em",background:"var(--cdBg)",padding:"0.15em 0.4em",borderRadius:4},children:"TOME_AI_KEY=sk-... tome build"})]})]}),M.map((Q,Y)=>s.jsx("div",{"data-testid":`ai-chat-message-${Q.role}`,style:{marginBottom:12,display:"flex",justifyContent:Q.role==="user"?"flex-end":"flex-start"},children:s.jsx("div",{style:{maxWidth:"85%",padding:"8px 12px",borderRadius:10,fontSize:13,lineHeight:1.55,whiteSpace:"pre-wrap",wordBreak:"break-word",background:Q.role==="user"?"var(--ac)":"var(--cdBg)",color:Q.role==="user"?"#fff":"var(--tx)"},children:Q.content})},Y)),G&&s.jsx("div",{"data-testid":"ai-chat-loading",style:{display:"flex",justifyContent:"flex-start",marginBottom:12},children:s.jsx("div",{style:{padding:"8px 12px",borderRadius:10,fontSize:13,background:"var(--cdBg)",color:"var(--txM)"},children:"Thinking..."})}),K&&s.jsx("div",{"data-testid":"ai-chat-error",style:{padding:"8px 12px",borderRadius:8,fontSize:12,background:"rgba(220,50,50,0.1)",color:"#d44",marginBottom:12},children:K}),s.jsx("div",{ref:xt})]}),s.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,padding:"10px 12px",borderTop:"1px solid var(--bd)",flexShrink:0},children:[s.jsx("input",{ref:Dt,"data-testid":"ai-chat-input",value:C,onChange:Q=>y(Q.target.value),onKeyDown:ct,placeholder:jt?"Ask a question...":"API key required",disabled:!jt,style:{flex:1,background:"var(--cdBg)",border:"1px solid var(--bd)",borderRadius:8,padding:"8px 12px",color:"var(--tx)",fontSize:13,fontFamily:"var(--font-body)",outline:"none"}}),s.jsx("button",{"data-testid":"ai-chat-send",onClick:I,disabled:!jt||!C.trim()||G,"aria-label":"Send message",style:{width:34,height:34,borderRadius:8,background:jt&&C.trim()?"var(--ac)":"var(--cdBg)",color:jt&&C.trim()?"#fff":"var(--txM)",border:"none",cursor:jt&&C.trim()?"pointer":"default",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0},children:s.jsx(Lh,{})})]})]}):s.jsx("button",{"data-testid":"ai-chat-button",onClick:()=>E(!0),"aria-label":"Open AI chat",style:{position:"fixed",bottom:24,right:24,zIndex:900,width:48,height:48,borderRadius:"50%",background:"var(--ac)",color:"#fff",border:"none",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",boxShadow:"0 4px 16px rgba(0,0,0,0.25)",transition:"transform 0.15s"},children:s.jsx(Nh,{})})}function Qh(u){const h=/^#([0-9a-f]{6})$/i.exec(u.trim());if(!h)return null;const d=parseInt(h[1],16);return[d>>16&255,d>>8&255,d&255]}function Vh(u,h){const d=Qh(u);if(!d)return null;const[c,v,E]=d,M=`rgba(${c},${v},${E},${h?.12:.08})`,O=h?1.15:.85,C=Math.min(255,Math.round(c*O)),y=Math.min(255,Math.round(v*O)),G=Math.min(255,Math.round(E*O)),R=`rgb(${C},${y},${G})`;return{ac:u,acD:M,acT:R}}const Ae=({d:u,size:h=16})=>s.jsx("svg",{width:h,height:h,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:s.jsx("path",{d:u})}),rm=()=>s.jsx(Ae,{d:"M11 19a8 8 0 1 0 0-16 8 8 0 0 0 0 16ZM21 21l-4.3-4.3"}),Pd=()=>s.jsx(Ae,{d:"M9 18l6-6-6-6",size:14}),Vu=()=>s.jsx(Ae,{d:"M6 9l6 6 6-6",size:14}),Zh=()=>s.jsx(Ae,{d:"M3 12h18M3 6h18M3 18h18",size:20}),Jh=()=>s.jsx(Ae,{d:"M18 6L6 18M6 6l12 12",size:18}),tm=()=>s.jsx(Ae,{d:"M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z"}),em=()=>s.jsx(Ae,{d:"M12 8a4 4 0 1 0 0 8 4 4 0 0 0 0-8Zm0-4a1 1 0 0 1 1-1v-1a1 1 0 0 1-2 0v1a1 1 0 0 1 1 1Zm0 16a1 1 0 0 1 1 1v1a1 1 0 0 1-2 0v-1a1 1 0 0 1 1-1ZM4 12a1 1 0 0 1-1 1H2a1 1 0 0 1 0-2h1a1 1 0 0 1 1 1Zm18-1h-1a1 1 0 0 1 0 2h1a1 1 0 0 1 0-2ZM6.34 6.34a1 1 0 0 1-1.41 0l-.71-.71a1 1 0 0 1 1.41-1.41l.71.71a1 1 0 0 1 0 1.41Zm12.73-2.12-.71.71a1 1 0 0 1-1.41-1.41l.71-.71a1 1 0 1 1 1.41 1.41ZM6.34 17.66l-.71.71a1 1 0 0 1-1.41-1.41l.71-.71a1 1 0 0 1 1.41 1.41Zm12.73 2.12-.71-.71a1 1 0 0 1 1.41-1.41l.71.71a1 1 0 0 1-1.41 1.41Z"}),nm=()=>s.jsx(Ae,{d:"M19 12H5M12 19l-7-7 7-7",size:14}),am=()=>s.jsx(Ae,{d:"M5 12h14M12 5l7 7-7 7",size:14}),Wh=()=>s.jsx(Ae,{d:"M17 3a2.83 2.83 0 1 1 4 4L7.5 20.5 2 22l1.5-5.5Z",size:13});function Fh(u){const h=new Date(u),c=new Date().getTime()-h.getTime();if(isNaN(c))return"";const v=Math.floor(c/1e3),E=Math.floor(v/60),M=Math.floor(E/60),O=Math.floor(M/24),C=Math.floor(O/30),y=Math.floor(O/365);return v<60?"just now":E<60?`${E} minute${E===1?"":"s"} ago`:M<24?`${M} hour${M===1?"":"s"} ago`:O<30?`${O} day${O===1?"":"s"} ago`:C<12?`${C} month${C===1?"":"s"} ago`:y>=1?`${y} year${y===1?"":"s"} ago`:h.toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"})}let ul=null;const $h="/_pagefind/pagefind.js";async function Ih(){if(ul)return ul;try{return ul=await import($h),await ul.init(),ul}catch{return null}}let ko=null;function Ph(){return ko||(ko=Lt(()=>import("./theme-BIHI7g3E.js"),[]).catch(()=>null),ko)}function t0({appId:u,apiKey:h,indexName:d,onNavigate:c,onClose:v,basePath:E=""}){const[M,O]=w.useState(null),[C,y]=w.useState(!1);w.useEffect(()=>{Ph().then(R=>{R&&R.DocSearch?O(()=>R.DocSearch):R&&R.default?O(()=>R.default):y(!0)})},[]);const G=w.useCallback(R=>{try{let nt=new URL(R,"http://localhost").pathname;if(E){const xt=E.replace(/\/$/,"");nt.startsWith(xt)&&(nt=nt.slice(xt.length))}return nt.replace(/^\//,"").replace(/\/index\.html$/,"").replace(/\.html$/,"")||"index"}catch{return"index"}},[E]);return C?s.jsx("div",{onClick:v,style:{position:"fixed",inset:0,zIndex:1e3,background:"rgba(0,0,0,0.55)",backdropFilter:"blur(6px)",display:"flex",alignItems:"flex-start",justifyContent:"center",paddingTop:"12vh"},children:s.jsx("div",{onClick:R=>R.stopPropagation(),style:{background:"var(--sf)",border:"1px solid var(--bd)",borderRadius:12,width:"100%",maxWidth:520,boxShadow:"0 24px 80px rgba(0,0,0,0.4)",padding:"32px 18px",textAlign:"center",color:"var(--txM)",fontSize:14},children:"Algolia DocSearch is not available. Install @docsearch/react to enable it."})}):M?s.jsx("div",{"data-testid":"algolia-search-modal",children:s.jsx(M,{appId:u,apiKey:h,indexName:d,navigator:{navigate({itemUrl:R}){const K=G(R);c(K)}},hitComponent:({hit:R,children:K})=>s.jsx("a",{href:R.url,onClick:nt=>{nt.preventDefault();const xt=G(R.url);c(xt)},children:K})})}):s.jsx("div",{onClick:v,style:{position:"fixed",inset:0,zIndex:1e3,background:"rgba(0,0,0,0.55)",backdropFilter:"blur(6px)",display:"flex",alignItems:"flex-start",justifyContent:"center",paddingTop:"12vh"},children:s.jsx("div",{style:{background:"var(--sf)",border:"1px solid var(--bd)",borderRadius:12,width:"100%",maxWidth:520,boxShadow:"0 24px 80px rgba(0,0,0,0.4)",padding:"32px 18px",textAlign:"center",color:"var(--txM)",fontSize:14},children:"Loading search..."})})}const e0=()=>s.jsx(Ae,{d:"M12 8v4l3 3m6-3a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z",size:14}),n0=()=>s.jsx(Ae,{d:"M12 21a9 9 0 1 0 0-18 9 9 0 0 0 0 18ZM3.6 9h16.8M3.6 15h16.8M12 3a15 15 0 0 1 4 9 15 15 0 0 1-4 9 15 15 0 0 1-4-9 15 15 0 0 1 4-9Z",size:14}),a0=()=>s.jsx(Ae,{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6M15 3h6v6M10 14L21 3",size:11}),l0={github:"M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.013 8.013 0 0016 8c0-4.42-3.58-8-8-8z",twitter:"M12.6.75h2.454l-5.36 6.142L16 15.25h-4.937l-3.867-5.07-4.425 5.07H.316l5.733-6.57L0 .75h5.063l3.495 4.633L12.601.75Zm-.86 13.028h1.36L4.323 2.145H2.865l8.875 11.633Z",discord:"M13.545 2.907a13.227 13.227 0 00-3.257-1.011.05.05 0 00-.052.025c-.141.25-.297.577-.406.833a12.19 12.19 0 00-3.658 0 8.258 8.258 0 00-.412-.833.051.051 0 00-.052-.025c-1.125.194-2.22.534-3.257 1.011a.041.041 0 00-.021.018C.356 6.024-.213 9.047.066 12.032c.001.014.01.028.021.037a13.276 13.276 0 003.995 2.02.05.05 0 00.056-.019c.308-.42.582-.863.818-1.329a.05.05 0 00-.028-.07 8.735 8.735 0 01-1.248-.595.05.05 0 01-.005-.083c.084-.063.168-.129.248-.195a.05.05 0 01.051-.007c2.619 1.196 5.454 1.196 8.041 0a.052.052 0 01.053.007c.08.066.164.132.248.195a.051.051 0 01-.004.085c-.399.232-.813.431-1.249.594a.05.05 0 00-.03.07c.24.465.515.909.817 1.329a.05.05 0 00.056.019 13.235 13.235 0 004.001-2.02.049.049 0 00.021-.037c.334-3.451-.559-6.449-2.366-9.106a.034.034 0 00-.02-.019z",linkedin:"M0 1.146C0 .513.526 0 1.175 0h13.65C15.474 0 16 .513 16 1.146v13.708c0 .633-.526 1.146-1.175 1.146H1.175C.526 16 0 15.487 0 14.854V1.146zm4.943 12.248V6.169H2.542v7.225h2.401zm-1.2-8.212c.837 0 1.358-.554 1.358-1.248-.015-.709-.52-1.248-1.342-1.248-.822 0-1.359.54-1.359 1.248 0 .694.521 1.248 1.327 1.248h.016zm4.908 8.212V9.359c0-.216.016-.432.08-.586.173-.431.568-.878 1.232-.878.869 0 1.216.662 1.216 1.634v3.865h2.401V9.25c0-2.22-1.184-3.252-2.764-3.252-1.274 0-1.845.7-2.165 1.193v.025h-.016a5.54 5.54 0 01.016-.025V6.169h-2.4c.03.678 0 7.225 0 7.225h2.4z",youtube:"M8.051 1.999h.089c.822.003 4.987.033 6.11.335a2.01 2.01 0 011.415 1.42c.101.38.172.883.22 1.402l.01.104.022.26.008.104c.065.914.073 1.77.074 1.957v.075c-.001.194-.01 1.108-.082 2.06l-.008.105-.009.104c-.05.572-.124 1.14-.235 1.558a2.007 2.007 0 01-1.415 1.42c-1.16.312-5.569.334-6.18.335h-.142c-.309 0-1.587-.006-2.927-.052l-.17-.006-.087-.004-.171-.007-.171-.007c-1.11-.049-2.167-.128-2.654-.26a2.007 2.007 0 01-1.415-1.419c-.111-.417-.185-.986-.235-1.558L.09 9.82l-.008-.104A31.4 31.4 0 010 7.68v-.123c.002-.215.01-.958.064-1.778l.007-.103.003-.052.008-.104.022-.26.01-.104c.048-.519.119-1.023.22-1.402a2.007 2.007 0 011.415-1.42c.487-.13 1.544-.21 2.654-.26l.17-.007.172-.006.086-.003.171-.007A99.788 99.788 0 017.858 2h.193zM6.4 5.209v4.818l4.157-2.408L6.4 5.209z",mastodon:"M11.19 12.195c2.016-.24 3.77-1.475 3.99-2.603.348-1.778.32-4.339.32-4.339 0-3.47-2.286-4.488-2.286-4.488C12.062.238 10.083.017 8.027 0h-.05C5.92.017 3.942.238 2.79.765 2.79.765.504 1.783.504 5.253c-.005.995-.01 2.19.013 3.44.075 4.21.56 8.354 3.383 9.386 1.302.476 2.418.576 3.317.507 1.628-.125 2.541-.8 2.541-.8l-.054-1.182s-1.163.366-2.47.322c-1.293-.044-2.658-.138-2.867-1.716a3.23 3.23 0 01-.028-.465s1.27.31 2.879.384c.984.045 1.905-.058 2.842-.17zM13 8.59V5.319c0-.67-.17-1.2-.507-1.592-.348-.4-.806-.605-1.373-.605-.656 0-1.154.252-1.486.756L9.2 4.595l-.434-.717c-.332-.504-.83-.756-1.486-.756-.567 0-1.025.204-1.373.605-.338.392-.507.923-.507 1.592V8.59h1.69V5.468c0-.67.285-1.012.855-1.012.63 0 .946.404.946 1.204V7.11h1.682V5.66c0-.8.316-1.204.946-1.204.57 0 .855.342.855 1.012V8.59H13z",bluesky:"M3.468 1.948C5.303 3.325 7.276 6.118 8 7.616c.724-1.498 2.697-4.29 4.532-5.668C13.855 1.013 16 .638 16 3.14c0 .5-.286 4.2-.454 4.8-.585 2.093-2.716 2.628-4.544 2.305 3.195.564 4.007 2.433 2.25 4.302-3.337 3.548-4.8-1.244-5.252-2.547 0 0-.116-.334-.166-.334h.332C8.166 11.666 8.05 12 8.05 12c-.452 1.303-1.916 6.095-5.252 2.547-1.756-1.869-.946-3.738 2.25-4.302-1.829.323-3.96-.212-4.544-2.305C.336 7.34.05 3.64.05 3.14.05.638 2.195 1.013 3.468 1.948z"},i0=({platform:u,customIcon:h})=>{const d=u==="custom"&&h?h:l0[u];return d?s.jsx("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"currentColor",children:s.jsx("path",{d})}):null},o0={Added:"#22c55e",Changed:"#3b82f6",Deprecated:"#f59e0b",Removed:"#ef4444",Fixed:"#8b5cf6",Security:"#f97316"};function s0({entries:u}){const[h,d]=w.useState(u.length<=5),c=h?u:u.slice(0,5);return s.jsxs("div",{"data-testid":"changelog-timeline",style:{position:"relative"},children:[s.jsx("div",{style:{position:"absolute",left:15,top:8,bottom:8,width:2,background:"var(--bd)"}}),c.map((v,E)=>s.jsxs("div",{"data-testid":`changelog-entry-${v.version}`,style:{position:"relative",paddingLeft:44,paddingBottom:E{const O=o0[M.type]||"#6b7280";return s.jsxs("div",{style:{marginBottom:16},children:[s.jsxs("div",{style:{display:"inline-flex",alignItems:"center",gap:6,marginBottom:8},children:[s.jsx("span",{style:{display:"inline-block",width:8,height:8,borderRadius:"50%",background:O}}),s.jsx("span",{style:{fontSize:12,fontWeight:600,textTransform:"uppercase",letterSpacing:".06em",color:O,fontFamily:"var(--font-code, monospace)"},children:M.type})]}),s.jsx("ul",{style:{margin:0,paddingLeft:18,listStyleType:"disc",color:"var(--tx2)"},children:M.items.map((C,y)=>s.jsx("li",{style:{fontSize:14,lineHeight:1.7,color:"var(--tx2)",marginBottom:2},children:C},y))})]},M.type)})]},v.version)),!h&&u.length>5&&s.jsx("div",{style:{textAlign:"center",marginTop:24},children:s.jsxs("button",{"data-testid":"changelog-show-more",onClick:()=>d(!0),style:{background:"none",border:"1px solid var(--bd)",borderRadius:2,padding:"8px 20px",color:"var(--tx2)",fontSize:13,fontFamily:"var(--font-body, inherit)",cursor:"pointer"},children:["Show all ",u.length," releases"]})})]})}function u0(u,h,d){if(h==="index")return[];for(const c of u)if(c.pages.find(E=>E.id===h)){const E=[],M=c.pages[0];return E.push({label:c.section,href:M?M.urlPath:null}),E.push({label:d,href:null}),E}return[]}function r0({config:u,navigation:h,currentPageId:d,pageHtml:c,pageComponent:v,mdxComponents:E,pageTitle:M,pageDescription:O,headings:C,tocEnabled:y=!0,editUrl:G,lastUpdated:R,changelogEntries:K,apiManifest:nt,apiBaseUrl:xt,apiPlayground:Dt,apiAuth:jt,ApiReferenceComponent:W,onNavigate:I,allPages:ct,versioning:Q,currentVersion:Y,i18n:H,currentLocale:U,docContext:at,basePath:lt="",isDraft:P,dir:mt,overrides:tt}){var za,En,fi,dl,ml,pl,Ca,Aa,hl,gl,qe,Qt,ne,tn,ja,di,mi,vl,zn;const Mt=U||(H==null?void 0:H.defaultLocale)||"en",$t=mt||((za=H==null?void 0:H.localeDirs)==null?void 0:za[Mt])||"ltr",ft=$t==="rtl",A=((En=u.theme)==null?void 0:En.mode)||"auto",[B,Z]=w.useState(()=>{var b;return A==="dark"?!0:A==="light"?!1:((b=window.matchMedia)==null?void 0:b.call(window,"(prefers-color-scheme: dark)").matches)??!1}),[J,Tt]=w.useState(()=>typeof window<"u"&&window.innerWidth<768),[m,_]=w.useState(()=>typeof window<"u"&&window.innerWidth>=768),[N,L]=w.useState(!1),[it,rt]=w.useState(!1),[Et,It]=w.useState(!1),[Ut,Ze]=w.useState(null),[pa,ha]=w.useState({}),[rl,Je]=w.useState(()=>{var b;if(!((b=u.banner)!=null&&b.text))return!0;try{const q=Array.from(u.banner.text).reduce((et,dt)=>(et<<5)-et+dt.charCodeAt(0)|0,0).toString(36);return localStorage.getItem("tome-banner-dismissed")===q}catch{return!1}}),cl=Q&&Y&&Y!==Q.current,[ga,Do]=w.useState(h.map(b=>b.section)),We=w.useRef(null),Fn=w.useRef(null),fl=w.useRef(""),[va,Oo]=w.useState(()=>typeof window<"u"&&window.innerWidth>1100),si=((fi=u.theme)==null?void 0:fi.preset)||"amber",se=((dl=Mo[si])==null?void 0:dl[B?"dark":"light"])||Mo.amber.dark,ui=(ml=u.theme)!=null&&ml.accent?Vh(u.theme.accent,B):null,te=ui?{...se,...ui}:se,ya=((pl=Mo[si])==null?void 0:pl.fonts)||Mo.amber.fonts,xn={heading:((Aa=(Ca=u.theme)==null?void 0:Ca.fonts)==null?void 0:Aa.heading)||ya.heading,body:((gl=(hl=u.theme)==null?void 0:hl.fonts)==null?void 0:gl.body)||ya.body,code:((Qt=(qe=u.theme)==null?void 0:qe.fonts)==null?void 0:Qt.code)||ya.code};w.useEffect(()=>{if(A!=="auto")return;const b=window.matchMedia("(prefers-color-scheme: dark)"),q=et=>Z(et.matches);return b.addEventListener("change",q),()=>b.removeEventListener("change",q)},[A]),w.useEffect(()=>{document.documentElement.classList.toggle("dark",B)},[B]),w.useEffect(()=>{const b=()=>{const q=window.innerWidth;Oo(q>1100),Tt(q<768)};return b(),window.addEventListener("resize",b),()=>window.removeEventListener("resize",b)},[]),w.useEffect(()=>{if(J&&m)return document.body.style.overflow="hidden",()=>{document.body.style.overflow=""}},[J,m]),w.useEffect(()=>{var b;(b=We.current)==null||b.scrollTo(0,0)},[d]),w.useEffect(()=>{const b=We.current;if(!b)return;const q=et=>{const dt=et.target;dt.tagName==="IMG"&&dt.closest(".tome-content")&&Ze(dt.src)};return b.addEventListener("click",q),()=>b.removeEventListener("click",q)},[]),w.useEffect(()=>{const b=We.current;if(!b)return;const q=et=>{const dt=et.target.closest("a");if(!dt)return;const St=dt.getAttribute("href");if(!St||St.startsWith("http://")||St.startsWith("https://")||St.startsWith("mailto:")||St.startsWith("tel:")||St.startsWith("//")||St.startsWith("#"))return;et.preventDefault();let yt=St.replace(/^\.\//,"").replace(/^\//,"").replace(/\.mdx?$/,"").replace(/\/$/,"");if(lt){const ce=lt.replace(/^\//,"").replace(/\/$/,"");ce&&yt.startsWith(ce+"/")?yt=yt.slice(ce.length+1):ce&&yt===ce&&(yt="index")}yt||(yt="index"),I(yt)};return b.addEventListener("click",q),()=>b.removeEventListener("click",q)},[I,lt]),w.useEffect(()=>{if(!Ut)return;const b=q=>{q.key==="Escape"&&Ze(null)};return window.addEventListener("keydown",b),()=>window.removeEventListener("keydown",b)},[Ut]);const Sn=u.toc,ri=(Sn==null?void 0:Sn.depth)??3,ba=(Sn==null?void 0:Sn.enabled)!==!1&&y,ye=C.filter(b=>b.depth<=ri),[ue,je]=w.useState("");w.useEffect(()=>{if(!ba||ye.length<2)return;const b=We.current;if(!b)return;const q=setTimeout(()=>{const et=[];for(const St of ye){const yt=b.querySelector(`#${CSS.escape(St.id)}`);yt&&et.push(yt)}if(et.length===0)return;const dt=new IntersectionObserver(St=>{const yt=St.filter(ce=>ce.isIntersecting).sort((ce,pi)=>ce.boundingClientRect.top-pi.boundingClientRect.top);yt.length>0&&je(yt[0].target.id)},{root:b,rootMargin:"0px 0px -80% 0px",threshold:0});for(const St of et)dt.observe(St);ee.current=dt},100);return()=>{var et;clearTimeout(q),(et=ee.current)==null||et.disconnect(),ee.current=null}},[d,ba,ye.map(b=>b.id).join(",")]);const ee=w.useRef(null);w.useEffect(()=>{je("")},[d]),w.useLayoutEffect(()=>{if(!Fn.current||!c)return;const b=c.replace(/]*>[\s\S]*?<\/h1>\s*/,"");Fn.current.innerHTML=b,fl.current=b},[c,d]);const ci=w.useCallback((b,q)=>{b.preventDefault();const et=We.current;if(!et)return;const dt=et.querySelector(`#${CSS.escape(q)}`);dt&&(dt.scrollIntoView({behavior:"smooth",block:"start"}),je(q))},[]);w.useEffect(()=>{const b=q=>{(q.metaKey||q.ctrlKey)&&q.key==="k"&&(q.preventDefault(),L(!0)),q.key==="Escape"&&L(!1)};return window.addEventListener("keydown",b),()=>window.removeEventListener("keydown",b)},[]);const xa=h.flatMap(b=>b.pages),Sa=xa.findIndex(b=>b.id===d),Fe=Sa>0?xa[Sa-1]:null,$e=SaDo(q=>q.includes(b)?q.filter(et=>et!==b):[...q,b]),Ta={"--bg":te.bg,"--sf":te.sf,"--sfH":te.sfH,"--bd":te.bd,"--tx":te.tx,"--tx2":te.tx2,"--txM":te.txM,"--ac":te.ac,"--acD":te.acD,"--acT":te.acT,"--cdBg":te.cdBg,"--cdTx":te.cdTx,"--sbBg":te.sbBg,"--hdBg":te.hdBg,"--font-heading":`"${xn.heading}", serif`,"--font-body":`"${xn.body}", sans-serif`,"--font-code":`"${xn.code}", monospace`},Tn=v,Ne=(ne=u.banner)==null?void 0:ne.link,Ea=Ne?Ne.startsWith("#")||lt&&Ne.startsWith(lt+"/"):!1;return s.jsxs("div",{dir:$t,className:"tome-grain",style:{...Ta,color:"var(--tx)",background:"var(--bg)",fontFamily:"var(--font-body)",height:"100vh",overflow:"clip"},children:[((tn=u.banner)==null?void 0:tn.text)&&!rl&&s.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",gap:12,background:"var(--ac)",color:"#fff",padding:"8px 16px",fontSize:13,fontFamily:"var(--font-body)",fontWeight:500,textAlign:"center",width:"100vw",boxSizing:"border-box"},children:[u.banner.link?s.jsx("a",{href:Ea&&Ne.startsWith("#")?lt+"/"+Ne.slice(1):Ne,...Ea?{}:{target:"_blank",rel:"noopener noreferrer"},style:{color:"#fff",textDecoration:"underline"},onClick:Ea?b=>{b.preventDefault();const q=lt.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),et=Ne.startsWith("#")?Ne.slice(1):Ne.replace(new RegExp("^"+q+"/?"),"");I(et||"index")}:void 0,children:u.banner.text}):s.jsx("span",{children:u.banner.text}),u.banner.dismissible!==!1&&s.jsx("button",{onClick:()=>{Je(!0);try{const b=Array.from(u.banner.text).reduce((q,et)=>(q<<5)-q+et.charCodeAt(0)|0,0).toString(36);localStorage.setItem("tome-banner-dismissed",b)}catch{}},"aria-label":"Dismiss banner",style:{background:"none",border:"none",color:"#fff",cursor:"pointer",fontSize:16,lineHeight:1,padding:0,opacity:.8},children:"×"})]}),N&&((ja=u.search)==null?void 0:ja.provider)==="algolia"&&u.search.appId&&u.search.apiKey&&u.search.indexName?s.jsx(t0,{appId:u.search.appId,apiKey:u.search.apiKey,indexName:u.search.indexName,onNavigate:b=>{I(b),L(!1)},onClose:()=>L(!1),basePath:lt}):N?s.jsx(c0,{allPages:ct,onNavigate:b=>{I(b),L(!1)},onClose:()=>L(!1),mobile:J}):null,s.jsxs("div",{style:{display:"flex",flexDirection:ft?"row-reverse":"row",flex:1,height:(di=u.banner)!=null&&di.text&&!rl?"calc(100vh - 32px)":"100vh"},children:[J&&m&&s.jsx("div",{onClick:()=>_(!1),style:{position:"fixed",inset:0,zIndex:200,background:"rgba(0,0,0,0.4)",backdropFilter:"blur(2px)"}}),tt!=null&&tt.Sidebar?s.jsx(tt.Sidebar,{config:u,navigation:h,currentPageId:d,onNavigate:I,mobile:J,sbOpen:m,setSbOpen:_,versioning:Q,currentVersion:Y}):s.jsxs("aside",{style:{width:m?270:0,minWidth:m?270:0,background:"var(--sbBg)",[ft?"borderLeft":"borderRight"]:"1px solid var(--bd)",display:"flex",flexDirection:"column",transition:"width .2s, min-width .2s",overflow:"hidden",...J?{position:"fixed",top:0,[ft?"right":"left"]:0,bottom:0,zIndex:201}:{}},children:[s.jsxs("a",{href:"/",style:{padding:"18px 20px",display:"flex",alignItems:"baseline",gap:6,borderBottom:"1px solid var(--bd)",textDecoration:"none",color:"inherit"},children:[s.jsx("span",{style:{fontFamily:"var(--font-heading)",fontSize:22,fontWeight:700,fontStyle:"italic"},children:u.name}),s.jsx("span",{style:{width:5,height:5,borderRadius:"50%",background:"var(--ac)",display:"inline-block"}})]}),s.jsx("div",{style:{padding:"12px 14px"},children:s.jsxs("button",{onClick:()=>{L(!0),J&&_(!1)},style:{display:"flex",alignItems:"center",gap:8,width:"100%",background:"var(--cdBg)",border:"1px solid var(--bd)",borderRadius:2,padding:"8px 12px",cursor:"pointer",color:"var(--txM)",fontSize:12.5,fontFamily:"var(--font-body)"},children:[s.jsx(rm,{}),s.jsx("span",{style:{flex:1,textAlign:ft?"right":"left"},children:"Search..."}),s.jsx("kbd",{style:{fontFamily:"var(--font-code)",fontSize:9,background:"var(--sf)",border:"1px solid var(--bd)",borderRadius:2,padding:"2px 6px"},children:"⌘K"})]})}),s.jsx("nav",{style:{flex:1,overflow:"auto",padding:"4px 10px 20px"},children:h.map(b=>s.jsxs("div",{style:{marginBottom:8},children:[s.jsxs("button",{onClick:()=>Pe(b.section),style:{display:"flex",alignItems:"center",gap:6,width:"100%",background:"none",border:"none",padding:"8px 10px",cursor:"pointer",borderRadius:2,color:"var(--txM)",fontSize:10,fontWeight:600,textTransform:"uppercase",letterSpacing:".1em",fontFamily:"var(--font-code)"},children:[ga.includes(b.section)?s.jsx(Vu,{}):s.jsx(Pd,{}),b.section]}),ga.includes(b.section)&&s.jsx("div",{style:{[ft?"marginRight":"marginLeft"]:8,[ft?"borderRight":"borderLeft"]:"1px solid var(--bd)",[ft?"paddingRight":"paddingLeft"]:0},children:b.pages.map(q=>{const et=d===q.id;return s.jsxs("button",{onClick:()=>{I(q.id),J&&_(!1)},style:{display:"flex",alignItems:"center",gap:10,width:"100%",textAlign:ft?"right":"left",background:"none",border:"none",borderRadius:0,[ft?"borderRight":"borderLeft"]:et?"2px solid var(--ac)":"2px solid transparent",padding:"7px 14px",cursor:"pointer",color:et?"var(--ac)":"var(--tx2)",fontSize:13,fontWeight:et?500:400,fontFamily:"var(--font-body)",transition:"all .12s"},children:[q.title,q.badge&&(()=>{const dt={default:{bg:"var(--sf)",text:"var(--tx2)"},info:{bg:"rgba(59,130,246,0.15)",text:"rgb(59,130,246)"},success:{bg:"rgba(34,197,94,0.15)",text:"rgb(34,197,94)"},warning:{bg:"rgba(234,179,8,0.15)",text:"rgb(202,138,4)"},danger:{bg:"rgba(239,68,68,0.15)",text:"rgb(239,68,68)"}},St=dt[q.badge.variant||"default"]||dt.default;return s.jsx("span",{style:{fontSize:10,fontWeight:600,padding:"2px 6px",borderRadius:4,marginLeft:6,whiteSpace:"nowrap",background:St.bg,color:St.text},children:q.badge.text})})()]},q.id)})})]},b.section))}),Q&&J&&s.jsx("div",{style:{padding:"8px 16px",borderTop:"1px solid var(--bd)",display:"flex",gap:6},children:Q.versions.map(b=>s.jsxs("button",{onClick:()=>{const q=b===Q.current?"index":`${b}/index`;I(q)},style:{flex:1,padding:"3px 0",textAlign:"center",background:b===(Y||Q.current)?"var(--acD)":"var(--sf)",border:"1px solid var(--bd)",borderRadius:2,cursor:"pointer",color:b===(Y||Q.current)?"var(--ac)":"var(--tx2)",fontSize:11,fontFamily:"var(--font-code)",fontWeight:b===Q.current?600:400},children:[b,b===Q.current?" (latest)":""]},b))}),s.jsxs("div",{style:{padding:"12px 16px",borderTop:"1px solid var(--bd)",display:"flex",alignItems:"center",justifyContent:"space-between"},children:[A==="auto"?s.jsx("button",{"aria-label":B?"Switch to light mode":"Switch to dark mode",onClick:()=>Z(b=>!b),style:{background:"none",border:"none",color:"var(--txM)",cursor:"pointer",display:"flex"},children:B?s.jsx(em,{}):s.jsx(tm,{})}):s.jsx("div",{}),s.jsxs("span",{style:{fontSize:11,color:"var(--txM)",letterSpacing:.2},children:["Built with ","♡"," by Tome"]}),s.jsx("span",{style:{fontFamily:"var(--font-code)",fontSize:10,color:"var(--txM)"},children:"v0.5.0"})]})]}),s.jsxs("div",{style:{flex:1,display:"flex",flexDirection:"column",overflow:"hidden"},children:[tt!=null&&tt.Header?s.jsx(tt.Header,{config:u,navigation:h,currentPageId:d,onNavigate:I,mobile:J,sbOpen:m,setSbOpen:_,isDark:B,setDark:Z,versioning:Q,currentVersion:Y,i18n:H,currentLocale:U,onSearchOpen:()=>L(!0),basePath:lt}):s.jsxs("header",{style:{display:"flex",alignItems:"center",gap:J?8:12,padding:J?"8px 12px":"10px 24px",borderBottom:"1px solid var(--bd)",background:"var(--hdBg)",backdropFilter:"blur(12px)",maxWidth:"100vw",overflow:"visible",position:"relative",zIndex:200},children:[s.jsx("button",{"aria-label":m?"Close sidebar":"Open sidebar",onClick:()=>_(!m),style:{background:"none",border:"none",color:"var(--txM)",cursor:"pointer",display:"flex"},children:m?s.jsx(Jh,{}):s.jsx(Zh,{})}),J?s.jsx("span",{style:{fontSize:13,color:"var(--ac)",fontFamily:"var(--font-code)",flex:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:((mi=h.flatMap(b=>b.pages).find(b=>b.id===d))==null?void 0:mi.title)||""}):s.jsx("div",{style:{display:"flex",alignItems:"center",gap:8,fontFamily:"var(--font-code)",fontSize:11,color:"var(--txM)",letterSpacing:".03em",flex:1},children:h.map(b=>{const q=b.pages.find(et=>et.id===d);return q?s.jsxs("span",{style:{display:"flex",alignItems:"center",gap:8},children:[s.jsx("span",{children:b.section}),s.jsx(Pd,{}),s.jsx("span",{style:{color:"var(--ac)"},children:q.title})]},b.section):null})}),u.topNav&&u.topNav.length>0&&!J&&s.jsxs("div",{style:{display:"flex",alignItems:"center",gap:12},children:[u.topNav.map(b=>{const q=b.href.startsWith("#")||lt&&b.href.startsWith(lt+"/"),et=!q;return s.jsxs("a",{href:q&&b.href.startsWith("#")?lt+"/"+b.href.slice(1):b.href,...et?{target:"_blank",rel:"noopener noreferrer"}:{},onClick:q?dt=>{dt.preventDefault();const St=b.href.startsWith("#")?b.href.slice(1):b.href.replace(new RegExp("^"+lt.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")+"/?"),"");I(St)}:void 0,style:{display:"flex",alignItems:"center",gap:4,color:"var(--txM)",textDecoration:"none",fontSize:12,fontFamily:"var(--font-body)",fontWeight:500,transition:"color .15s"},onMouseOver:dt=>dt.currentTarget.style.color="var(--ac)",onMouseOut:dt=>dt.currentTarget.style.color="var(--txM)",children:[b.label,et&&s.jsx(a0,{})]},b.label)}),s.jsx("span",{style:{width:1,height:16,background:"var(--bd)"}})]}),u.socialLinks&&u.socialLinks.length>0&&!J&&s.jsx("div",{style:{display:"flex",alignItems:"center",gap:8},children:u.socialLinks.map(b=>s.jsx("a",{href:b.url,target:"_blank",rel:"noopener noreferrer","aria-label":b.label||b.platform,"data-testid":`social-link-${b.platform}`,style:{display:"flex",alignItems:"center",justifyContent:"center",color:"var(--tx2)",cursor:"pointer",transition:"color .15s"},onMouseOver:q=>q.currentTarget.style.color="var(--tx)",onMouseOut:q=>q.currentTarget.style.color="var(--tx2)",children:s.jsx(i0,{platform:b.platform,customIcon:b.icon})},b.url))}),J&&A==="auto"&&s.jsx("button",{"aria-label":B?"Switch to light mode":"Switch to dark mode",onClick:()=>Z(b=>!b),style:{background:"none",border:"none",color:"var(--txM)",cursor:"pointer",display:"flex",flexShrink:0},children:B?s.jsx(em,{}):s.jsx(tm,{})}),Q&&!J&&s.jsxs("div",{style:{position:"relative"},children:[s.jsxs("button",{"data-testid":"version-switcher",onClick:()=>rt(b=>!b),style:{display:"flex",alignItems:"center",gap:6,background:"var(--sf)",border:"1px solid var(--bd)",borderRadius:2,padding:"5px 10px",cursor:"pointer",color:"var(--tx2)",fontSize:12,fontFamily:"var(--font-code)"},children:[s.jsx(e0,{}),Y||Q.current,s.jsx(Vu,{})]}),it&&s.jsx("div",{"data-testid":"version-dropdown",style:{position:"absolute",top:"100%",right:0,marginTop:4,background:"var(--sf)",border:"1px solid var(--bd)",borderRadius:2,boxShadow:"0 8px 32px rgba(0,0,0,0.2)",overflow:"hidden",zIndex:100,minWidth:120},children:Q.versions.map(b=>s.jsxs("button",{onClick:()=>{rt(!1);const q=b===Q.current?"index":`${b}/index`;I(q)},style:{display:"block",width:"100%",textAlign:"left",background:b===(Y||Q.current)?"var(--acD)":"none",border:"none",padding:"8px 14px",cursor:"pointer",color:b===(Y||Q.current)?"var(--ac)":"var(--tx2)",fontSize:12,fontFamily:"var(--font-code)",fontWeight:b===Q.current?600:400},children:[b,b===Q.current?" (latest)":""]},b))})]}),H&&H.locales.length>1&&!J&&s.jsxs("div",{style:{position:"relative"},children:[s.jsxs("button",{"data-testid":"language-switcher",onClick:()=>It(b=>!b),style:{display:"flex",alignItems:"center",gap:6,background:"var(--sf)",border:"1px solid var(--bd)",borderRadius:2,padding:"5px 10px",cursor:"pointer",color:"var(--tx2)",fontSize:12,fontFamily:"var(--font-body)"},children:[s.jsx(n0,{}),((vl=H.localeNames)==null?void 0:vl[U||H.defaultLocale])||U||H.defaultLocale,s.jsx(Vu,{})]}),Et&&s.jsx("div",{"data-testid":"language-dropdown",style:{position:"absolute",top:"100%",right:0,marginTop:4,background:"var(--sf)",border:"1px solid var(--bd)",borderRadius:2,boxShadow:"0 8px 32px rgba(0,0,0,0.2)",overflow:"hidden",zIndex:100,minWidth:120},children:H.locales.map(b=>{var ce;const q=b===(U||H.defaultLocale),et=((ce=H.localeNames)==null?void 0:ce[b])||b,dt=U||H.defaultLocale;let St=d;dt!==H.defaultLocale&&d.startsWith(`${dt}/`)&&(St=d.slice(dt.length+1));const yt=b===H.defaultLocale?St:`${b}/${St}`;return s.jsx("button",{onClick:()=>{It(!1),I(yt)},style:{display:"block",width:"100%",textAlign:"left",background:q?"var(--acD)":"none",border:"none",padding:"8px 14px",cursor:"pointer",color:q?"var(--ac)":"var(--tx2)",fontSize:12,fontFamily:"var(--font-body)",fontWeight:q?600:400},children:et},b)})})]})]}),cl&&s.jsxs("div",{"data-testid":"old-version-banner",style:{display:"flex",alignItems:"center",justifyContent:"center",gap:8,background:"var(--acD)",borderBottom:"1px solid var(--bd)",padding:"8px 24px",fontSize:13,color:"var(--tx2)"},children:[s.jsxs("span",{children:["You're viewing docs for ",Y,"."]}),s.jsx("button",{onClick:()=>{I("index")},style:{background:"none",border:"none",color:"var(--ac)",cursor:"pointer",fontWeight:600,fontSize:13,fontFamily:"var(--font-body)",textDecoration:"underline"},children:"Switch to latest."})]}),s.jsxs("div",{ref:We,style:{flex:1,overflow:"auto",display:"flex"},children:[s.jsxs("main",{style:{flex:1,maxWidth:J?"100%":nt?1100:760,padding:J?"24px 16px 60px":"40px 48px 80px",margin:"0 auto",minWidth:0},children:[Ie.length>0&&s.jsx("nav",{"aria-label":"Breadcrumbs","data-testid":"breadcrumbs",style:{display:"flex",alignItems:"center",gap:6,fontSize:13,color:"var(--tx2)",marginBottom:8},children:Ie.map((b,q)=>s.jsxs(sm.Fragment,{children:[q>0&&s.jsx("span",{style:{color:"var(--tx2)",opacity:.5},children:"›"}),q{et.preventDefault();const dt=h.flatMap(St=>St.pages).find(St=>St.urlPath===b.href);dt&&I(dt.id)},style:{color:"var(--tx2)",textDecoration:"none",cursor:"pointer"},children:b.label}):s.jsx("span",{style:q===Ie.length-1?{color:"var(--tx)"}:void 0,children:b.label})]},q))}),s.jsx("h1",{style:{fontFamily:"var(--font-heading)",fontSize:J?26:38,fontWeight:400,fontStyle:"italic",lineHeight:1.15,marginBottom:8},children:M}),P&&s.jsx("div",{"data-testid":"draft-banner",style:{background:"#fef3c7",color:"#92400e",padding:"8px 16px",borderRadius:6,fontSize:13,marginBottom:16},children:"Draft — This page is only visible in development"}),O&&s.jsx("p",{style:{fontSize:16,color:"var(--tx2)",lineHeight:1.6,marginBottom:32},children:O}),s.jsx("div",{style:{borderTop:"1px solid var(--bd)",paddingTop:28},children:nt&&W?s.jsx(W,{manifest:nt,baseUrl:xt,showPlayground:Dt,playgroundAuth:jt}):K&&K.length>0?s.jsx(s0,{entries:K}):Tn?s.jsx("div",{className:"tome-content",children:s.jsx(Tn,{components:E||{}})}):s.jsx("div",{className:"tome-content",ref:Fn},d)}),tt!=null&&tt.PageFooter?s.jsx(tt.PageFooter,{editUrl:G,lastUpdated:R,currentPageId:d,prev:Fe,next:$e,onNavigate:I,mobile:J}):s.jsxs(s.Fragment,{children:[(G||R)&&s.jsxs("div",{style:{marginTop:40,display:"flex",flexDirection:J?"column":"row",alignItems:J?"flex-start":"center",justifyContent:"space-between",gap:J?8:16},children:[G&&s.jsx("div",{"data-testid":"edit-page-link",children:s.jsxs("a",{href:G,target:"_blank",rel:"noopener noreferrer",style:{display:"inline-flex",alignItems:"center",gap:6,color:"var(--txM)",textDecoration:"none",fontSize:13,fontFamily:"var(--font-body)",transition:"color .15s"},onMouseOver:b=>b.currentTarget.style.color="var(--ac)",onMouseOut:b=>b.currentTarget.style.color="var(--txM)",children:[s.jsx(Wh,{})," Edit this page on GitHub"]})}),R&&s.jsxs("div",{"data-testid":"last-updated",style:{fontSize:12,color:"var(--txM)",fontFamily:"var(--font-body)"},children:["Last updated ",Fh(R)]})]}),s.jsx("div",{style:{display:"flex",alignItems:"center",gap:12,marginTop:24,padding:"12px 0"},children:pa[d]?s.jsx("span",{style:{fontSize:13,color:"var(--txM)",fontFamily:"var(--font-body)"},children:"Thanks for your feedback!"}):s.jsxs(s.Fragment,{children:[s.jsx("span",{style:{fontSize:13,color:"var(--txM)",fontFamily:"var(--font-body)"},children:"Was this helpful?"}),s.jsx("button",{onClick:()=>{ha(b=>({...b,[d]:!0}));try{localStorage.setItem(`tome-feedback-${d}`,"up")}catch{}},style:{background:"none",border:"1px solid var(--bd)",borderRadius:2,padding:"4px 10px",cursor:"pointer",fontSize:13,color:"var(--txM)",transition:"border-color .15s"},children:"👍"}),s.jsx("button",{onClick:()=>{ha(b=>({...b,[d]:!0}));try{localStorage.setItem(`tome-feedback-${d}`,"down")}catch{}},style:{background:"none",border:"1px solid var(--bd)",borderRadius:2,padding:"4px 10px",cursor:"pointer",fontSize:13,color:"var(--txM)",transition:"border-color .15s"},children:"👎"})]})}),s.jsxs("div",{style:{display:"flex",flexDirection:J?"column":"row",justifyContent:"space-between",marginTop:16,paddingTop:24,borderTop:"1px solid var(--bd)",gap:J?12:16},children:[Fe?s.jsxs("button",{onClick:()=>I(Fe.id),style:{display:"flex",alignItems:"center",gap:8,background:"none",border:"1px solid var(--bd)",borderRadius:2,padding:"10px 16px",cursor:"pointer",color:"var(--tx2)",fontSize:13,fontFamily:"var(--font-body)",transition:"border-color .15s, color .15s"},children:[ft?s.jsx(am,{}):s.jsx(nm,{})," ",Fe.title]}):s.jsx("div",{}),$e?s.jsxs("button",{onClick:()=>I($e.id),style:{display:"flex",alignItems:"center",gap:8,background:"none",border:"1px solid var(--bd)",borderRadius:2,padding:"10px 16px",cursor:"pointer",color:"var(--tx2)",fontSize:13,fontFamily:"var(--font-body)",transition:"border-color .15s, color .15s"},children:[$e.title," ",ft?s.jsx(nm,{}):s.jsx(am,{})]}):s.jsx("div",{})]})]})]}),tt!=null&&tt.Toc?ba&&ye.length>=2&&va&&s.jsx(tt.Toc,{headings:ye,activeHeadingId:ue,onScrollToHeading:ci}):ba&&ye.length>=2&&va&&s.jsxs("aside",{"data-testid":"toc-sidebar",style:{width:200,padding:ft?"40px 0 40px 16px":"40px 16px 40px 0",position:"sticky",top:0,alignSelf:"flex-start",flexShrink:0},children:[s.jsx("div",{style:{fontSize:10,fontWeight:600,textTransform:"uppercase",letterSpacing:".1em",color:"var(--txM)",marginBottom:12,fontFamily:"var(--font-code)"},children:"On this page"}),s.jsx("nav",{"aria-label":"Table of contents",style:{[ft?"borderRight":"borderLeft"]:"1px solid var(--bd)",[ft?"paddingRight":"paddingLeft"]:0},children:ye.map((b,q)=>{const et=ue===b.id;return s.jsx("a",{href:`#${b.id}`,onClick:dt=>ci(dt,b.id),"data-testid":`toc-link-${b.id}`,style:{display:"block",fontSize:12,color:et?"var(--ac)":"var(--txM)",fontWeight:et?500:400,textDecoration:"none",padding:"4px 12px",[ft?"paddingRight":"paddingLeft"]:12+(b.depth-2)*12,lineHeight:1.4,transition:"color .15s, font-weight .15s",[ft?"borderRight":"borderLeft"]:et?"2px solid var(--ac)":"2px solid transparent",[ft?"marginRight":"marginLeft"]:-1},children:b.text},q)})})]})]})]})]}),(tt==null?void 0:tt.Footer)&&s.jsx(tt.Footer,{config:u,navigation:h,currentPageId:d,onNavigate:I}),((zn=u.ai)==null?void 0:zn.enabled)&&s.jsx(Xh,{provider:u.ai.provider||"anthropic",model:u.ai.model,apiKey:typeof __TOME_AI_API_KEY__<"u"&&__TOME_AI_API_KEY__?__TOME_AI_API_KEY__:void 0,context:(at==null?void 0:at.map(b=>`## ${b.title}
+${d}`}return p}async function Gp(u,p,d,c){var M,O,C;const v=await fetch("https://api.openai.com/v1/chat/completions",{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${p}`},body:JSON.stringify({model:d,messages:[{role:"system",content:um(c)},...u.map(y=>({role:y.role,content:y.content}))]})});if(!v.ok){const y=await v.text();throw new Error(`OpenAI API error (${v.status}): ${y}`)}return((C=(O=(M=(await v.json()).choices)==null?void 0:M[0])==null?void 0:O.message)==null?void 0:C.content)||"No response."}async function Yp(u,p,d,c){var M,O;const v=await fetch("https://api.anthropic.com/v1/messages",{method:"POST",headers:{"Content-Type":"application/json","x-api-key":p,"anthropic-version":"2023-06-01","anthropic-dangerous-direct-browser-access":"true"},body:JSON.stringify({model:d,max_tokens:1024,system:um(c),messages:u.map(C=>({role:C.role,content:C.content}))})});if(!v.ok){const C=await v.text();throw new Error(`Anthropic API error (${v.status}): ${C}`)}return((O=(M=(await v.json()).content)==null?void 0:M[0])==null?void 0:O.text)||"No response."}function Kp(u){return u==="openai"?"gpt-4o-mini":"claude-sonnet-4-20250514"}function Xp({provider:u,model:p,apiKey:d,context:c}){const[v,E]=w.useState(!1),[M,O]=w.useState([]),[C,y]=w.useState(""),[G,R]=w.useState(!1),[K,nt]=w.useState(null),xt=w.useRef(null),Dt=w.useRef(null),At=d||(typeof window<"u"?window.__TOME_AI_API_KEY__:void 0),W=p||Kp(u);w.useEffect(()=>{var Q;(Q=xt.current)==null||Q.scrollIntoView({behavior:"smooth"})},[M]),w.useEffect(()=>{v&&setTimeout(()=>{var Q;return(Q=Dt.current)==null?void 0:Q.focus()},100)},[v]);const I=w.useCallback(async()=>{const Q=C.trim();if(!Q||G||!At)return;const Y={role:"user",content:Q},H=[...M,Y];O(H),y(""),R(!0),nt(null);try{let U;u==="openai"?U=await Gp(H,At,W,c):U=await Yp(H,At,W,c),O(at=>[...at,{role:"assistant",content:U}])}catch(U){nt(U instanceof Error?U.message:"Failed to get response")}finally{R(!1)}},[C,G,M,u,At,W,c]),ct=w.useCallback(Q=>{Q.key==="Enter"&&!Q.shiftKey&&(Q.preventDefault(),I())},[I]);return v?s.jsxs("div",{"data-testid":"ai-chat-panel",style:{position:"fixed",bottom:24,right:24,zIndex:900,width:380,maxWidth:"calc(100vw - 48px)",height:520,maxHeight:"calc(100vh - 48px)",background:"var(--sf)",border:"1px solid var(--bd)",borderRadius:12,boxShadow:"0 16px 64px rgba(0,0,0,0.3)",display:"flex",flexDirection:"column",overflow:"hidden",fontFamily:"var(--font-body)"},children:[s.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"12px 16px",borderBottom:"1px solid var(--bd)",flexShrink:0},children:[s.jsx("span",{style:{fontSize:14,fontWeight:600,color:"var(--tx)"},children:"Ask AI"}),s.jsx("button",{"data-testid":"ai-chat-close",onClick:()=>E(!1),"aria-label":"Close AI chat",style:{background:"none",border:"none",color:"var(--txM)",cursor:"pointer",display:"flex",padding:4},children:s.jsx(qp,{})})]}),s.jsxs("div",{style:{flex:1,overflow:"auto",padding:"12px 16px"},children:[!At&&s.jsxs("div",{"data-testid":"ai-chat-no-key",style:{textAlign:"center",color:"var(--txM)",fontSize:13,padding:"24px 8px",lineHeight:1.6},children:[s.jsx("p",{style:{marginBottom:8,fontWeight:500,color:"var(--tx)"},children:"AI not configured"}),s.jsxs("p",{style:{marginBottom:8},children:["To enable AI chat, set the ",s.jsx("code",{style:{fontFamily:"var(--font-code)",fontSize:"0.88em",background:"var(--cdBg)",padding:"0.15em 0.4em",borderRadius:4},children:"apiKeyEnv"})," in ",s.jsx("code",{style:{fontFamily:"var(--font-code)",fontSize:"0.88em",background:"var(--cdBg)",padding:"0.15em 0.4em",borderRadius:4},children:"tome.config.js"})," and provide the environment variable at build time."]}),s.jsxs("p",{style:{fontSize:11.5,color:"var(--txM)"},children:["Example: ",s.jsx("code",{style:{fontFamily:"var(--font-code)",fontSize:"0.88em",background:"var(--cdBg)",padding:"0.15em 0.4em",borderRadius:4},children:"TOME_AI_KEY=sk-... tome build"})]})]}),M.map((Q,Y)=>s.jsx("div",{"data-testid":`ai-chat-message-${Q.role}`,style:{marginBottom:12,display:"flex",justifyContent:Q.role==="user"?"flex-end":"flex-start"},children:s.jsx("div",{style:{maxWidth:"85%",padding:"8px 12px",borderRadius:10,fontSize:13,lineHeight:1.55,whiteSpace:"pre-wrap",wordBreak:"break-word",background:Q.role==="user"?"var(--ac)":"var(--cdBg)",color:Q.role==="user"?"#fff":"var(--tx)"},children:Q.content})},Y)),G&&s.jsx("div",{"data-testid":"ai-chat-loading",style:{display:"flex",justifyContent:"flex-start",marginBottom:12},children:s.jsx("div",{style:{padding:"8px 12px",borderRadius:10,fontSize:13,background:"var(--cdBg)",color:"var(--txM)"},children:"Thinking..."})}),K&&s.jsx("div",{"data-testid":"ai-chat-error",style:{padding:"8px 12px",borderRadius:8,fontSize:12,background:"rgba(220,50,50,0.1)",color:"#d44",marginBottom:12},children:K}),s.jsx("div",{ref:xt})]}),s.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,padding:"10px 12px",borderTop:"1px solid var(--bd)",flexShrink:0},children:[s.jsx("input",{ref:Dt,"data-testid":"ai-chat-input",value:C,onChange:Q=>y(Q.target.value),onKeyDown:ct,placeholder:At?"Ask a question...":"API key required",disabled:!At,style:{flex:1,background:"var(--cdBg)",border:"1px solid var(--bd)",borderRadius:8,padding:"8px 12px",color:"var(--tx)",fontSize:13,fontFamily:"var(--font-body)",outline:"none"}}),s.jsx("button",{"data-testid":"ai-chat-send",onClick:I,disabled:!At||!C.trim()||G,"aria-label":"Send message",style:{width:34,height:34,borderRadius:8,background:At&&C.trim()?"var(--ac)":"var(--cdBg)",color:At&&C.trim()?"#fff":"var(--txM)",border:"none",cursor:At&&C.trim()?"pointer":"default",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0},children:s.jsx(Lp,{})})]})]}):s.jsx("button",{"data-testid":"ai-chat-button",onClick:()=>E(!0),"aria-label":"Open AI chat",style:{position:"fixed",bottom:24,right:24,zIndex:900,width:48,height:48,borderRadius:"50%",background:"var(--ac)",color:"#fff",border:"none",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",boxShadow:"0 4px 16px rgba(0,0,0,0.25)",transition:"transform 0.15s"},children:s.jsx(Np,{})})}function Qp(u){const p=/^#([0-9a-f]{6})$/i.exec(u.trim());if(!p)return null;const d=parseInt(p[1],16);return[d>>16&255,d>>8&255,d&255]}function Vp(u,p){const d=Qp(u);if(!d)return null;const[c,v,E]=d,M=`rgba(${c},${v},${E},${p?.12:.08})`,O=p?1.15:.85,C=Math.min(255,Math.round(c*O)),y=Math.min(255,Math.round(v*O)),G=Math.min(255,Math.round(E*O)),R=`rgb(${C},${y},${G})`;return{ac:u,acD:M,acT:R}}const je=({d:u,size:p=16})=>s.jsx("svg",{width:p,height:p,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:s.jsx("path",{d:u})}),rm=()=>s.jsx(je,{d:"M11 19a8 8 0 1 0 0-16 8 8 0 0 0 0 16ZM21 21l-4.3-4.3"}),Pd=()=>s.jsx(je,{d:"M9 18l6-6-6-6",size:14}),Vu=()=>s.jsx(je,{d:"M6 9l6 6 6-6",size:14}),Zp=()=>s.jsx(je,{d:"M3 12h18M3 6h18M3 18h18",size:20}),Jp=()=>s.jsx(je,{d:"M18 6L6 18M6 6l12 12",size:18}),tm=()=>s.jsx(je,{d:"M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z"}),em=()=>s.jsx(je,{d:"M12 8a4 4 0 1 0 0 8 4 4 0 0 0 0-8Zm0-4a1 1 0 0 1 1-1v-1a1 1 0 0 1-2 0v1a1 1 0 0 1 1 1Zm0 16a1 1 0 0 1 1 1v1a1 1 0 0 1-2 0v-1a1 1 0 0 1 1-1ZM4 12a1 1 0 0 1-1 1H2a1 1 0 0 1 0-2h1a1 1 0 0 1 1 1Zm18-1h-1a1 1 0 0 1 0 2h1a1 1 0 0 1 0-2ZM6.34 6.34a1 1 0 0 1-1.41 0l-.71-.71a1 1 0 0 1 1.41-1.41l.71.71a1 1 0 0 1 0 1.41Zm12.73-2.12-.71.71a1 1 0 0 1-1.41-1.41l.71-.71a1 1 0 1 1 1.41 1.41ZM6.34 17.66l-.71.71a1 1 0 0 1-1.41-1.41l.71-.71a1 1 0 0 1 1.41 1.41Zm12.73 2.12-.71-.71a1 1 0 0 1 1.41-1.41l.71.71a1 1 0 0 1-1.41 1.41Z"}),nm=()=>s.jsx(je,{d:"M19 12H5M12 19l-7-7 7-7",size:14}),am=()=>s.jsx(je,{d:"M5 12h14M12 5l7 7-7 7",size:14}),Wp=()=>s.jsx(je,{d:"M17 3a2.83 2.83 0 1 1 4 4L7.5 20.5 2 22l1.5-5.5Z",size:13});function Fp(u){const p=new Date(u),c=new Date().getTime()-p.getTime();if(isNaN(c))return"";const v=Math.floor(c/1e3),E=Math.floor(v/60),M=Math.floor(E/60),O=Math.floor(M/24),C=Math.floor(O/30),y=Math.floor(O/365);return v<60?"just now":E<60?`${E} minute${E===1?"":"s"} ago`:M<24?`${M} hour${M===1?"":"s"} ago`:O<30?`${O} day${O===1?"":"s"} ago`:C<12?`${C} month${C===1?"":"s"} ago`:y>=1?`${y} year${y===1?"":"s"} ago`:p.toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"})}let ul=null;const $p="/_pagefind/pagefind.js";async function Ip(){if(ul)return ul;try{return ul=await import($p),await ul.init(),ul}catch{return null}}let ko=null;function Pp(){return ko||(ko=Lt(()=>import("./theme-BIHI7g3E.js"),[]).catch(()=>null),ko)}function t0({appId:u,apiKey:p,indexName:d,onNavigate:c,onClose:v,basePath:E=""}){const[M,O]=w.useState(null),[C,y]=w.useState(!1);w.useEffect(()=>{Pp().then(R=>{R&&R.DocSearch?O(()=>R.DocSearch):R&&R.default?O(()=>R.default):y(!0)})},[]);const G=w.useCallback(R=>{try{let nt=new URL(R,"http://localhost").pathname;if(E){const xt=E.replace(/\/$/,"");nt.startsWith(xt)&&(nt=nt.slice(xt.length))}return nt.replace(/^\//,"").replace(/\/index\.html$/,"").replace(/\.html$/,"")||"index"}catch{return"index"}},[E]);return C?s.jsx("div",{onClick:v,style:{position:"fixed",inset:0,zIndex:1e3,background:"rgba(0,0,0,0.55)",backdropFilter:"blur(6px)",display:"flex",alignItems:"flex-start",justifyContent:"center",paddingTop:"12vh"},children:s.jsx("div",{onClick:R=>R.stopPropagation(),style:{background:"var(--sf)",border:"1px solid var(--bd)",borderRadius:12,width:"100%",maxWidth:520,boxShadow:"0 24px 80px rgba(0,0,0,0.4)",padding:"32px 18px",textAlign:"center",color:"var(--txM)",fontSize:14},children:"Algolia DocSearch is not available. Install @docsearch/react to enable it."})}):M?s.jsx("div",{"data-testid":"algolia-search-modal",children:s.jsx(M,{appId:u,apiKey:p,indexName:d,navigator:{navigate({itemUrl:R}){const K=G(R);c(K)}},hitComponent:({hit:R,children:K})=>s.jsx("a",{href:R.url,onClick:nt=>{nt.preventDefault();const xt=G(R.url);c(xt)},children:K})})}):s.jsx("div",{onClick:v,style:{position:"fixed",inset:0,zIndex:1e3,background:"rgba(0,0,0,0.55)",backdropFilter:"blur(6px)",display:"flex",alignItems:"flex-start",justifyContent:"center",paddingTop:"12vh"},children:s.jsx("div",{style:{background:"var(--sf)",border:"1px solid var(--bd)",borderRadius:12,width:"100%",maxWidth:520,boxShadow:"0 24px 80px rgba(0,0,0,0.4)",padding:"32px 18px",textAlign:"center",color:"var(--txM)",fontSize:14},children:"Loading search..."})})}const e0=()=>s.jsx(je,{d:"M12 8v4l3 3m6-3a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z",size:14}),n0=()=>s.jsx(je,{d:"M12 21a9 9 0 1 0 0-18 9 9 0 0 0 0 18ZM3.6 9h16.8M3.6 15h16.8M12 3a15 15 0 0 1 4 9 15 15 0 0 1-4 9 15 15 0 0 1-4-9 15 15 0 0 1 4-9Z",size:14}),a0=()=>s.jsx(je,{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6M15 3h6v6M10 14L21 3",size:11}),l0={github:"M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.013 8.013 0 0016 8c0-4.42-3.58-8-8-8z",twitter:"M12.6.75h2.454l-5.36 6.142L16 15.25h-4.937l-3.867-5.07-4.425 5.07H.316l5.733-6.57L0 .75h5.063l3.495 4.633L12.601.75Zm-.86 13.028h1.36L4.323 2.145H2.865l8.875 11.633Z",discord:"M13.545 2.907a13.227 13.227 0 00-3.257-1.011.05.05 0 00-.052.025c-.141.25-.297.577-.406.833a12.19 12.19 0 00-3.658 0 8.258 8.258 0 00-.412-.833.051.051 0 00-.052-.025c-1.125.194-2.22.534-3.257 1.011a.041.041 0 00-.021.018C.356 6.024-.213 9.047.066 12.032c.001.014.01.028.021.037a13.276 13.276 0 003.995 2.02.05.05 0 00.056-.019c.308-.42.582-.863.818-1.329a.05.05 0 00-.028-.07 8.735 8.735 0 01-1.248-.595.05.05 0 01-.005-.083c.084-.063.168-.129.248-.195a.05.05 0 01.051-.007c2.619 1.196 5.454 1.196 8.041 0a.052.052 0 01.053.007c.08.066.164.132.248.195a.051.051 0 01-.004.085c-.399.232-.813.431-1.249.594a.05.05 0 00-.03.07c.24.465.515.909.817 1.329a.05.05 0 00.056.019 13.235 13.235 0 004.001-2.02.049.049 0 00.021-.037c.334-3.451-.559-6.449-2.366-9.106a.034.034 0 00-.02-.019z",linkedin:"M0 1.146C0 .513.526 0 1.175 0h13.65C15.474 0 16 .513 16 1.146v13.708c0 .633-.526 1.146-1.175 1.146H1.175C.526 16 0 15.487 0 14.854V1.146zm4.943 12.248V6.169H2.542v7.225h2.401zm-1.2-8.212c.837 0 1.358-.554 1.358-1.248-.015-.709-.52-1.248-1.342-1.248-.822 0-1.359.54-1.359 1.248 0 .694.521 1.248 1.327 1.248h.016zm4.908 8.212V9.359c0-.216.016-.432.08-.586.173-.431.568-.878 1.232-.878.869 0 1.216.662 1.216 1.634v3.865h2.401V9.25c0-2.22-1.184-3.252-2.764-3.252-1.274 0-1.845.7-2.165 1.193v.025h-.016a5.54 5.54 0 01.016-.025V6.169h-2.4c.03.678 0 7.225 0 7.225h2.4z",youtube:"M8.051 1.999h.089c.822.003 4.987.033 6.11.335a2.01 2.01 0 011.415 1.42c.101.38.172.883.22 1.402l.01.104.022.26.008.104c.065.914.073 1.77.074 1.957v.075c-.001.194-.01 1.108-.082 2.06l-.008.105-.009.104c-.05.572-.124 1.14-.235 1.558a2.007 2.007 0 01-1.415 1.42c-1.16.312-5.569.334-6.18.335h-.142c-.309 0-1.587-.006-2.927-.052l-.17-.006-.087-.004-.171-.007-.171-.007c-1.11-.049-2.167-.128-2.654-.26a2.007 2.007 0 01-1.415-1.419c-.111-.417-.185-.986-.235-1.558L.09 9.82l-.008-.104A31.4 31.4 0 010 7.68v-.123c.002-.215.01-.958.064-1.778l.007-.103.003-.052.008-.104.022-.26.01-.104c.048-.519.119-1.023.22-1.402a2.007 2.007 0 011.415-1.42c.487-.13 1.544-.21 2.654-.26l.17-.007.172-.006.086-.003.171-.007A99.788 99.788 0 017.858 2h.193zM6.4 5.209v4.818l4.157-2.408L6.4 5.209z",mastodon:"M11.19 12.195c2.016-.24 3.77-1.475 3.99-2.603.348-1.778.32-4.339.32-4.339 0-3.47-2.286-4.488-2.286-4.488C12.062.238 10.083.017 8.027 0h-.05C5.92.017 3.942.238 2.79.765 2.79.765.504 1.783.504 5.253c-.005.995-.01 2.19.013 3.44.075 4.21.56 8.354 3.383 9.386 1.302.476 2.418.576 3.317.507 1.628-.125 2.541-.8 2.541-.8l-.054-1.182s-1.163.366-2.47.322c-1.293-.044-2.658-.138-2.867-1.716a3.23 3.23 0 01-.028-.465s1.27.31 2.879.384c.984.045 1.905-.058 2.842-.17zM13 8.59V5.319c0-.67-.17-1.2-.507-1.592-.348-.4-.806-.605-1.373-.605-.656 0-1.154.252-1.486.756L9.2 4.595l-.434-.717c-.332-.504-.83-.756-1.486-.756-.567 0-1.025.204-1.373.605-.338.392-.507.923-.507 1.592V8.59h1.69V5.468c0-.67.285-1.012.855-1.012.63 0 .946.404.946 1.204V7.11h1.682V5.66c0-.8.316-1.204.946-1.204.57 0 .855.342.855 1.012V8.59H13z",bluesky:"M3.468 1.948C5.303 3.325 7.276 6.118 8 7.616c.724-1.498 2.697-4.29 4.532-5.668C13.855 1.013 16 .638 16 3.14c0 .5-.286 4.2-.454 4.8-.585 2.093-2.716 2.628-4.544 2.305 3.195.564 4.007 2.433 2.25 4.302-3.337 3.548-4.8-1.244-5.252-2.547 0 0-.116-.334-.166-.334h.332C8.166 11.666 8.05 12 8.05 12c-.452 1.303-1.916 6.095-5.252 2.547-1.756-1.869-.946-3.738 2.25-4.302-1.829.323-3.96-.212-4.544-2.305C.336 7.34.05 3.64.05 3.14.05.638 2.195 1.013 3.468 1.948z"},i0=({platform:u,customIcon:p})=>{const d=u==="custom"&&p?p:l0[u];return d?s.jsx("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"currentColor",children:s.jsx("path",{d})}):null},o0={Added:"#22c55e",Changed:"#3b82f6",Deprecated:"#f59e0b",Removed:"#ef4444",Fixed:"#8b5cf6",Security:"#f97316"};function s0({entries:u}){const[p,d]=w.useState(u.length<=5),c=p?u:u.slice(0,5);return s.jsxs("div",{"data-testid":"changelog-timeline",style:{position:"relative"},children:[s.jsx("div",{style:{position:"absolute",left:15,top:8,bottom:8,width:2,background:"var(--bd)"}}),c.map((v,E)=>s.jsxs("div",{"data-testid":`changelog-entry-${v.version}`,style:{position:"relative",paddingLeft:44,paddingBottom:E{const O=o0[M.type]||"#6b7280";return s.jsxs("div",{style:{marginBottom:16},children:[s.jsxs("div",{style:{display:"inline-flex",alignItems:"center",gap:6,marginBottom:8},children:[s.jsx("span",{style:{display:"inline-block",width:8,height:8,borderRadius:"50%",background:O}}),s.jsx("span",{style:{fontSize:12,fontWeight:600,textTransform:"uppercase",letterSpacing:".06em",color:O,fontFamily:"var(--font-code, monospace)"},children:M.type})]}),s.jsx("ul",{style:{margin:0,paddingLeft:18,listStyleType:"disc",color:"var(--tx2)"},children:M.items.map((C,y)=>s.jsx("li",{style:{fontSize:14,lineHeight:1.7,color:"var(--tx2)",marginBottom:2},children:C},y))})]},M.type)})]},v.version)),!p&&u.length>5&&s.jsx("div",{style:{textAlign:"center",marginTop:24},children:s.jsxs("button",{"data-testid":"changelog-show-more",onClick:()=>d(!0),style:{background:"none",border:"1px solid var(--bd)",borderRadius:2,padding:"8px 20px",color:"var(--tx2)",fontSize:13,fontFamily:"var(--font-body, inherit)",cursor:"pointer"},children:["Show all ",u.length," releases"]})})]})}function u0(u,p,d){if(p==="index")return[];for(const c of u)if(c.pages.find(E=>E.id===p)){const E=[],M=c.pages[0];return E.push({label:c.section,href:M?M.urlPath:null}),E.push({label:d,href:null}),E}return[]}function r0({config:u,navigation:p,currentPageId:d,pageHtml:c,pageComponent:v,mdxComponents:E,pageTitle:M,pageDescription:O,headings:C,tocEnabled:y=!0,editUrl:G,lastUpdated:R,changelogEntries:K,apiManifest:nt,apiBaseUrl:xt,apiPlayground:Dt,apiAuth:At,ApiReferenceComponent:W,onNavigate:I,allPages:ct,versioning:Q,currentVersion:Y,i18n:H,currentLocale:U,docContext:at,basePath:lt="",isDraft:P,dir:mt,overrides:tt}){var za,En,fi,dl,ml,hl,Ca,ja,pl,gl,qe,Qt,ne,tn,Aa,di,mi,vl,zn;const Mt=U||(H==null?void 0:H.defaultLocale)||"en",$t=mt||((za=H==null?void 0:H.localeDirs)==null?void 0:za[Mt])||"ltr",ft=$t==="rtl",j=((En=u.theme)==null?void 0:En.mode)||"auto",[B,Z]=w.useState(()=>{var b;return j==="dark"?!0:j==="light"?!1:((b=window.matchMedia)==null?void 0:b.call(window,"(prefers-color-scheme: dark)").matches)??!1}),[J,Tt]=w.useState(()=>typeof window<"u"&&window.innerWidth<768),[m,_]=w.useState(()=>typeof window<"u"&&window.innerWidth>=768),[N,L]=w.useState(!1),[it,rt]=w.useState(!1),[Et,It]=w.useState(!1),[Ut,Ze]=w.useState(null),[ha,pa]=w.useState({}),[rl,Je]=w.useState(()=>{var b;if(!((b=u.banner)!=null&&b.text))return!0;try{const q=Array.from(u.banner.text).reduce((et,dt)=>(et<<5)-et+dt.charCodeAt(0)|0,0).toString(36);return localStorage.getItem("tome-banner-dismissed")===q}catch{return!1}}),cl=Q&&Y&&Y!==Q.current,[ga,Do]=w.useState(p.map(b=>b.section)),We=w.useRef(null),Fn=w.useRef(null),fl=w.useRef(""),[va,Oo]=w.useState(()=>typeof window<"u"&&window.innerWidth>1100),si=((fi=u.theme)==null?void 0:fi.preset)||"amber",se=((dl=Mo[si])==null?void 0:dl[B?"dark":"light"])||Mo.amber.dark,ui=(ml=u.theme)!=null&&ml.accent?Vp(u.theme.accent,B):null,te=ui?{...se,...ui}:se,ya=((hl=Mo[si])==null?void 0:hl.fonts)||Mo.amber.fonts,xn={heading:((ja=(Ca=u.theme)==null?void 0:Ca.fonts)==null?void 0:ja.heading)||ya.heading,body:((gl=(pl=u.theme)==null?void 0:pl.fonts)==null?void 0:gl.body)||ya.body,code:((Qt=(qe=u.theme)==null?void 0:qe.fonts)==null?void 0:Qt.code)||ya.code};w.useEffect(()=>{if(j!=="auto")return;const b=window.matchMedia("(prefers-color-scheme: dark)"),q=et=>Z(et.matches);return b.addEventListener("change",q),()=>b.removeEventListener("change",q)},[j]),w.useEffect(()=>{document.documentElement.classList.toggle("dark",B)},[B]),w.useEffect(()=>{const b=()=>{const q=window.innerWidth;Oo(q>1100),Tt(q<768)};return b(),window.addEventListener("resize",b),()=>window.removeEventListener("resize",b)},[]),w.useEffect(()=>{if(J&&m)return document.body.style.overflow="hidden",()=>{document.body.style.overflow=""}},[J,m]),w.useEffect(()=>{var b;(b=We.current)==null||b.scrollTo(0,0)},[d]),w.useEffect(()=>{const b=We.current;if(!b)return;const q=et=>{const dt=et.target;dt.tagName==="IMG"&&dt.closest(".tome-content")&&Ze(dt.src)};return b.addEventListener("click",q),()=>b.removeEventListener("click",q)},[]),w.useEffect(()=>{const b=We.current;if(!b)return;const q=et=>{const dt=et.target.closest("a");if(!dt)return;const St=dt.getAttribute("href");if(!St||St.startsWith("http://")||St.startsWith("https://")||St.startsWith("mailto:")||St.startsWith("tel:")||St.startsWith("//")||St.startsWith("#"))return;et.preventDefault();let yt=St.replace(/^\.\//,"").replace(/^\//,"").replace(/\.mdx?$/,"").replace(/\/$/,"");if(lt){const ce=lt.replace(/^\//,"").replace(/\/$/,"");ce&&yt.startsWith(ce+"/")?yt=yt.slice(ce.length+1):ce&&yt===ce&&(yt="index")}yt||(yt="index"),I(yt)};return b.addEventListener("click",q),()=>b.removeEventListener("click",q)},[I,lt]),w.useEffect(()=>{if(!Ut)return;const b=q=>{q.key==="Escape"&&Ze(null)};return window.addEventListener("keydown",b),()=>window.removeEventListener("keydown",b)},[Ut]);const Sn=u.toc,ri=(Sn==null?void 0:Sn.depth)??3,ba=(Sn==null?void 0:Sn.enabled)!==!1&&y,ye=C.filter(b=>b.depth<=ri),[ue,Ae]=w.useState("");w.useEffect(()=>{if(!ba||ye.length<2)return;const b=We.current;if(!b)return;const q=setTimeout(()=>{const et=[];for(const St of ye){const yt=b.querySelector(`#${CSS.escape(St.id)}`);yt&&et.push(yt)}if(et.length===0)return;const dt=new IntersectionObserver(St=>{const yt=St.filter(ce=>ce.isIntersecting).sort((ce,hi)=>ce.boundingClientRect.top-hi.boundingClientRect.top);yt.length>0&&Ae(yt[0].target.id)},{root:b,rootMargin:"0px 0px -80% 0px",threshold:0});for(const St of et)dt.observe(St);ee.current=dt},100);return()=>{var et;clearTimeout(q),(et=ee.current)==null||et.disconnect(),ee.current=null}},[d,ba,ye.map(b=>b.id).join(",")]);const ee=w.useRef(null);w.useEffect(()=>{Ae("")},[d]),w.useLayoutEffect(()=>{if(!Fn.current||!c)return;const b=c.replace(/]*>[\s\S]*?<\/h1>\s*/,"");Fn.current.innerHTML=b,fl.current=b},[c,d]);const ci=w.useCallback((b,q)=>{b.preventDefault();const et=We.current;if(!et)return;const dt=et.querySelector(`#${CSS.escape(q)}`);dt&&(dt.scrollIntoView({behavior:"smooth",block:"start"}),Ae(q))},[]);w.useEffect(()=>{const b=q=>{(q.metaKey||q.ctrlKey)&&q.key==="k"&&(q.preventDefault(),L(!0)),q.key==="Escape"&&L(!1)};return window.addEventListener("keydown",b),()=>window.removeEventListener("keydown",b)},[]);const xa=p.flatMap(b=>b.pages),Sa=xa.findIndex(b=>b.id===d),Fe=Sa>0?xa[Sa-1]:null,$e=SaDo(q=>q.includes(b)?q.filter(et=>et!==b):[...q,b]),Ta={"--bg":te.bg,"--sf":te.sf,"--sfH":te.sfH,"--bd":te.bd,"--tx":te.tx,"--tx2":te.tx2,"--txM":te.txM,"--ac":te.ac,"--acD":te.acD,"--acT":te.acT,"--cdBg":te.cdBg,"--cdTx":te.cdTx,"--sbBg":te.sbBg,"--hdBg":te.hdBg,"--font-heading":`"${xn.heading}", serif`,"--font-body":`"${xn.body}", sans-serif`,"--font-code":`"${xn.code}", monospace`},Tn=v,Ne=(ne=u.banner)==null?void 0:ne.link,Ea=Ne?Ne.startsWith("#")||lt&&Ne.startsWith(lt+"/"):!1;return s.jsxs("div",{dir:$t,className:"tome-grain",style:{...Ta,color:"var(--tx)",background:"var(--bg)",fontFamily:"var(--font-body)",height:"100vh",overflow:"clip"},children:[((tn=u.banner)==null?void 0:tn.text)&&!rl&&s.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",gap:12,background:"var(--ac)",color:"#fff",padding:"8px 16px",fontSize:13,fontFamily:"var(--font-body)",fontWeight:500,textAlign:"center",width:"100vw",boxSizing:"border-box"},children:[u.banner.link?s.jsx("a",{href:Ea&&Ne.startsWith("#")?lt+"/"+Ne.slice(1):Ne,...Ea?{}:{target:"_blank",rel:"noopener noreferrer"},style:{color:"#fff",textDecoration:"underline"},onClick:Ea?b=>{b.preventDefault();const q=lt.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),et=Ne.startsWith("#")?Ne.slice(1):Ne.replace(new RegExp("^"+q+"/?"),"");I(et||"index")}:void 0,children:u.banner.text}):s.jsx("span",{children:u.banner.text}),u.banner.dismissible!==!1&&s.jsx("button",{onClick:()=>{Je(!0);try{const b=Array.from(u.banner.text).reduce((q,et)=>(q<<5)-q+et.charCodeAt(0)|0,0).toString(36);localStorage.setItem("tome-banner-dismissed",b)}catch{}},"aria-label":"Dismiss banner",style:{background:"none",border:"none",color:"#fff",cursor:"pointer",fontSize:16,lineHeight:1,padding:0,opacity:.8},children:"×"})]}),N&&((Aa=u.search)==null?void 0:Aa.provider)==="algolia"&&u.search.appId&&u.search.apiKey&&u.search.indexName?s.jsx(t0,{appId:u.search.appId,apiKey:u.search.apiKey,indexName:u.search.indexName,onNavigate:b=>{I(b),L(!1)},onClose:()=>L(!1),basePath:lt}):N?s.jsx(c0,{allPages:ct,onNavigate:b=>{I(b),L(!1)},onClose:()=>L(!1),mobile:J}):null,s.jsxs("div",{style:{display:"flex",flexDirection:ft?"row-reverse":"row",flex:1,height:(di=u.banner)!=null&&di.text&&!rl?"calc(100vh - 32px)":"100vh"},children:[J&&m&&s.jsx("div",{onClick:()=>_(!1),style:{position:"fixed",inset:0,zIndex:200,background:"rgba(0,0,0,0.4)",backdropFilter:"blur(2px)"}}),tt!=null&&tt.Sidebar?s.jsx(tt.Sidebar,{config:u,navigation:p,currentPageId:d,onNavigate:I,mobile:J,sbOpen:m,setSbOpen:_,versioning:Q,currentVersion:Y}):s.jsxs("aside",{style:{width:m?270:0,minWidth:m?270:0,background:"var(--sbBg)",[ft?"borderLeft":"borderRight"]:"1px solid var(--bd)",display:"flex",flexDirection:"column",transition:"width .2s, min-width .2s",overflow:"hidden",...J?{position:"fixed",top:0,[ft?"right":"left"]:0,bottom:0,zIndex:201}:{}},children:[s.jsxs("a",{href:"/",style:{padding:"18px 20px",display:"flex",alignItems:"baseline",gap:6,borderBottom:"1px solid var(--bd)",textDecoration:"none",color:"inherit"},children:[s.jsx("span",{style:{fontFamily:"var(--font-heading)",fontSize:22,fontWeight:700,fontStyle:"italic"},children:u.name}),s.jsx("span",{style:{width:5,height:5,borderRadius:"50%",background:"var(--ac)",display:"inline-block"}})]}),s.jsx("div",{style:{padding:"12px 14px"},children:s.jsxs("button",{onClick:()=>{L(!0),J&&_(!1)},style:{display:"flex",alignItems:"center",gap:8,width:"100%",background:"var(--cdBg)",border:"1px solid var(--bd)",borderRadius:2,padding:"8px 12px",cursor:"pointer",color:"var(--txM)",fontSize:12.5,fontFamily:"var(--font-body)"},children:[s.jsx(rm,{}),s.jsx("span",{style:{flex:1,textAlign:ft?"right":"left"},children:"Search..."}),s.jsx("kbd",{style:{fontFamily:"var(--font-code)",fontSize:9,background:"var(--sf)",border:"1px solid var(--bd)",borderRadius:2,padding:"2px 6px"},children:"⌘K"})]})}),s.jsx("nav",{style:{flex:1,overflow:"auto",padding:"4px 10px 20px"},children:p.map(b=>s.jsxs("div",{style:{marginBottom:8},children:[s.jsxs("button",{onClick:()=>Pe(b.section),style:{display:"flex",alignItems:"center",gap:6,width:"100%",background:"none",border:"none",padding:"8px 10px",cursor:"pointer",borderRadius:2,color:"var(--txM)",fontSize:10,fontWeight:600,textTransform:"uppercase",letterSpacing:".1em",fontFamily:"var(--font-code)"},children:[ga.includes(b.section)?s.jsx(Vu,{}):s.jsx(Pd,{}),b.section]}),ga.includes(b.section)&&s.jsx("div",{style:{[ft?"marginRight":"marginLeft"]:8,[ft?"borderRight":"borderLeft"]:"1px solid var(--bd)",[ft?"paddingRight":"paddingLeft"]:0},children:b.pages.map(q=>{const et=d===q.id;return s.jsxs("button",{onClick:()=>{I(q.id),J&&_(!1)},style:{display:"flex",alignItems:"center",gap:10,width:"100%",textAlign:ft?"right":"left",background:"none",border:"none",borderRadius:0,[ft?"borderRight":"borderLeft"]:et?"2px solid var(--ac)":"2px solid transparent",padding:"7px 14px",cursor:"pointer",color:et?"var(--ac)":"var(--tx2)",fontSize:13,fontWeight:et?500:400,fontFamily:"var(--font-body)",transition:"all .12s"},children:[q.title,q.badge&&(()=>{const dt={default:{bg:"var(--sf)",text:"var(--tx2)"},info:{bg:"rgba(59,130,246,0.15)",text:"rgb(59,130,246)"},success:{bg:"rgba(34,197,94,0.15)",text:"rgb(34,197,94)"},warning:{bg:"rgba(234,179,8,0.15)",text:"rgb(202,138,4)"},danger:{bg:"rgba(239,68,68,0.15)",text:"rgb(239,68,68)"}},St=dt[q.badge.variant||"default"]||dt.default;return s.jsx("span",{style:{fontSize:10,fontWeight:600,padding:"2px 6px",borderRadius:4,marginLeft:6,whiteSpace:"nowrap",background:St.bg,color:St.text},children:q.badge.text})})()]},q.id)})})]},b.section))}),Q&&J&&s.jsx("div",{style:{padding:"8px 16px",borderTop:"1px solid var(--bd)",display:"flex",gap:6},children:Q.versions.map(b=>s.jsxs("button",{onClick:()=>{const q=b===Q.current?"index":`${b}/index`;I(q)},style:{flex:1,padding:"3px 0",textAlign:"center",background:b===(Y||Q.current)?"var(--acD)":"var(--sf)",border:"1px solid var(--bd)",borderRadius:2,cursor:"pointer",color:b===(Y||Q.current)?"var(--ac)":"var(--tx2)",fontSize:11,fontFamily:"var(--font-code)",fontWeight:b===Q.current?600:400},children:[b,b===Q.current?" (latest)":""]},b))}),s.jsxs("div",{style:{padding:"12px 16px",borderTop:"1px solid var(--bd)",display:"flex",alignItems:"center",justifyContent:"space-between"},children:[j==="auto"?s.jsx("button",{"aria-label":B?"Switch to light mode":"Switch to dark mode",onClick:()=>Z(b=>!b),style:{background:"none",border:"none",color:"var(--txM)",cursor:"pointer",display:"flex"},children:B?s.jsx(em,{}):s.jsx(tm,{})}):s.jsx("div",{}),s.jsxs("span",{style:{fontSize:11,color:"var(--txM)",letterSpacing:.2},children:["Built with ","♡"," by Tome"]}),s.jsx("span",{style:{fontFamily:"var(--font-code)",fontSize:10,color:"var(--txM)"},children:"v0.5.0"})]})]}),s.jsxs("div",{style:{flex:1,display:"flex",flexDirection:"column",overflow:"hidden"},children:[tt!=null&&tt.Header?s.jsx(tt.Header,{config:u,navigation:p,currentPageId:d,onNavigate:I,mobile:J,sbOpen:m,setSbOpen:_,isDark:B,setDark:Z,versioning:Q,currentVersion:Y,i18n:H,currentLocale:U,onSearchOpen:()=>L(!0),basePath:lt}):s.jsxs("header",{style:{display:"flex",alignItems:"center",gap:J?8:12,padding:J?"8px 12px":"10px 24px",borderBottom:"1px solid var(--bd)",background:"var(--hdBg)",backdropFilter:"blur(12px)",maxWidth:"100vw",overflow:"visible",position:"relative",zIndex:200},children:[s.jsx("button",{"aria-label":m?"Close sidebar":"Open sidebar",onClick:()=>_(!m),style:{background:"none",border:"none",color:"var(--txM)",cursor:"pointer",display:"flex"},children:m?s.jsx(Jp,{}):s.jsx(Zp,{})}),J?s.jsx("span",{style:{fontSize:13,color:"var(--ac)",fontFamily:"var(--font-code)",flex:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:((mi=p.flatMap(b=>b.pages).find(b=>b.id===d))==null?void 0:mi.title)||""}):s.jsx("div",{style:{display:"flex",alignItems:"center",gap:8,fontFamily:"var(--font-code)",fontSize:11,color:"var(--txM)",letterSpacing:".03em",flex:1},children:p.map(b=>{const q=b.pages.find(et=>et.id===d);return q?s.jsxs("span",{style:{display:"flex",alignItems:"center",gap:8},children:[s.jsx("span",{children:b.section}),s.jsx(Pd,{}),s.jsx("span",{style:{color:"var(--ac)"},children:q.title})]},b.section):null})}),u.topNav&&u.topNav.length>0&&!J&&s.jsxs("div",{style:{display:"flex",alignItems:"center",gap:12},children:[u.topNav.map(b=>{const q=b.href.startsWith("#")||lt&&b.href.startsWith(lt+"/"),et=!q;return s.jsxs("a",{href:q&&b.href.startsWith("#")?lt+"/"+b.href.slice(1):b.href,...et?{target:"_blank",rel:"noopener noreferrer"}:{},onClick:q?dt=>{dt.preventDefault();const St=b.href.startsWith("#")?b.href.slice(1):b.href.replace(new RegExp("^"+lt.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")+"/?"),"");I(St)}:void 0,style:{display:"flex",alignItems:"center",gap:4,color:"var(--txM)",textDecoration:"none",fontSize:12,fontFamily:"var(--font-body)",fontWeight:500,transition:"color .15s"},onMouseOver:dt=>dt.currentTarget.style.color="var(--ac)",onMouseOut:dt=>dt.currentTarget.style.color="var(--txM)",children:[b.label,et&&s.jsx(a0,{})]},b.label)}),s.jsx("span",{style:{width:1,height:16,background:"var(--bd)"}})]}),u.socialLinks&&u.socialLinks.length>0&&!J&&s.jsx("div",{style:{display:"flex",alignItems:"center",gap:8},children:u.socialLinks.map(b=>s.jsx("a",{href:b.url,target:"_blank",rel:"noopener noreferrer","aria-label":b.label||b.platform,"data-testid":`social-link-${b.platform}`,style:{display:"flex",alignItems:"center",justifyContent:"center",color:"var(--tx2)",cursor:"pointer",transition:"color .15s"},onMouseOver:q=>q.currentTarget.style.color="var(--tx)",onMouseOut:q=>q.currentTarget.style.color="var(--tx2)",children:s.jsx(i0,{platform:b.platform,customIcon:b.icon})},b.url))}),J&&j==="auto"&&s.jsx("button",{"aria-label":B?"Switch to light mode":"Switch to dark mode",onClick:()=>Z(b=>!b),style:{background:"none",border:"none",color:"var(--txM)",cursor:"pointer",display:"flex",flexShrink:0},children:B?s.jsx(em,{}):s.jsx(tm,{})}),Q&&!J&&s.jsxs("div",{style:{position:"relative"},children:[s.jsxs("button",{"data-testid":"version-switcher",onClick:()=>rt(b=>!b),style:{display:"flex",alignItems:"center",gap:6,background:"var(--sf)",border:"1px solid var(--bd)",borderRadius:2,padding:"5px 10px",cursor:"pointer",color:"var(--tx2)",fontSize:12,fontFamily:"var(--font-code)"},children:[s.jsx(e0,{}),Y||Q.current,s.jsx(Vu,{})]}),it&&s.jsx("div",{"data-testid":"version-dropdown",style:{position:"absolute",top:"100%",right:0,marginTop:4,background:"var(--sf)",border:"1px solid var(--bd)",borderRadius:2,boxShadow:"0 8px 32px rgba(0,0,0,0.2)",overflow:"hidden",zIndex:100,minWidth:120},children:Q.versions.map(b=>s.jsxs("button",{onClick:()=>{rt(!1);const q=b===Q.current?"index":`${b}/index`;I(q)},style:{display:"block",width:"100%",textAlign:"left",background:b===(Y||Q.current)?"var(--acD)":"none",border:"none",padding:"8px 14px",cursor:"pointer",color:b===(Y||Q.current)?"var(--ac)":"var(--tx2)",fontSize:12,fontFamily:"var(--font-code)",fontWeight:b===Q.current?600:400},children:[b,b===Q.current?" (latest)":""]},b))})]}),H&&H.locales.length>1&&!J&&s.jsxs("div",{style:{position:"relative"},children:[s.jsxs("button",{"data-testid":"language-switcher",onClick:()=>It(b=>!b),style:{display:"flex",alignItems:"center",gap:6,background:"var(--sf)",border:"1px solid var(--bd)",borderRadius:2,padding:"5px 10px",cursor:"pointer",color:"var(--tx2)",fontSize:12,fontFamily:"var(--font-body)"},children:[s.jsx(n0,{}),((vl=H.localeNames)==null?void 0:vl[U||H.defaultLocale])||U||H.defaultLocale,s.jsx(Vu,{})]}),Et&&s.jsx("div",{"data-testid":"language-dropdown",style:{position:"absolute",top:"100%",right:0,marginTop:4,background:"var(--sf)",border:"1px solid var(--bd)",borderRadius:2,boxShadow:"0 8px 32px rgba(0,0,0,0.2)",overflow:"hidden",zIndex:100,minWidth:120},children:H.locales.map(b=>{var ce;const q=b===(U||H.defaultLocale),et=((ce=H.localeNames)==null?void 0:ce[b])||b,dt=U||H.defaultLocale;let St=d;dt!==H.defaultLocale&&d.startsWith(`${dt}/`)&&(St=d.slice(dt.length+1));const yt=b===H.defaultLocale?St:`${b}/${St}`;return s.jsx("button",{onClick:()=>{It(!1),I(yt)},style:{display:"block",width:"100%",textAlign:"left",background:q?"var(--acD)":"none",border:"none",padding:"8px 14px",cursor:"pointer",color:q?"var(--ac)":"var(--tx2)",fontSize:12,fontFamily:"var(--font-body)",fontWeight:q?600:400},children:et},b)})})]})]}),cl&&s.jsxs("div",{"data-testid":"old-version-banner",style:{display:"flex",alignItems:"center",justifyContent:"center",gap:8,background:"var(--acD)",borderBottom:"1px solid var(--bd)",padding:"8px 24px",fontSize:13,color:"var(--tx2)"},children:[s.jsxs("span",{children:["You're viewing docs for ",Y,"."]}),s.jsx("button",{onClick:()=>{I("index")},style:{background:"none",border:"none",color:"var(--ac)",cursor:"pointer",fontWeight:600,fontSize:13,fontFamily:"var(--font-body)",textDecoration:"underline"},children:"Switch to latest."})]}),s.jsxs("div",{ref:We,style:{flex:1,overflow:"auto",display:"flex"},children:[s.jsxs("main",{style:{flex:1,maxWidth:J?"100%":nt?1100:760,padding:J?"24px 16px 60px":"40px 48px 80px",margin:"0 auto",minWidth:0},children:[Ie.length>0&&s.jsx("nav",{"aria-label":"Breadcrumbs","data-testid":"breadcrumbs",style:{display:"flex",alignItems:"center",gap:6,fontSize:13,color:"var(--tx2)",marginBottom:8},children:Ie.map((b,q)=>s.jsxs(sm.Fragment,{children:[q>0&&s.jsx("span",{style:{color:"var(--tx2)",opacity:.5},children:"›"}),q{et.preventDefault();const dt=p.flatMap(St=>St.pages).find(St=>St.urlPath===b.href);dt&&I(dt.id)},style:{color:"var(--tx2)",textDecoration:"none",cursor:"pointer"},children:b.label}):s.jsx("span",{style:q===Ie.length-1?{color:"var(--tx)"}:void 0,children:b.label})]},q))}),s.jsx("h1",{style:{fontFamily:"var(--font-heading)",fontSize:J?26:38,fontWeight:400,fontStyle:"italic",lineHeight:1.15,marginBottom:8},children:M}),P&&s.jsx("div",{"data-testid":"draft-banner",style:{background:"#fef3c7",color:"#92400e",padding:"8px 16px",borderRadius:6,fontSize:13,marginBottom:16},children:"Draft — This page is only visible in development"}),O&&s.jsx("p",{style:{fontSize:16,color:"var(--tx2)",lineHeight:1.6,marginBottom:32},children:O}),s.jsx("div",{style:{borderTop:"1px solid var(--bd)",paddingTop:28},children:nt&&W?s.jsx(W,{manifest:nt,baseUrl:xt,showPlayground:Dt,playgroundAuth:At}):K&&K.length>0?s.jsx(s0,{entries:K}):Tn?s.jsx("div",{className:"tome-content",children:s.jsx(Tn,{components:E||{}})}):s.jsx("div",{className:"tome-content",ref:Fn},d)}),tt!=null&&tt.PageFooter?s.jsx(tt.PageFooter,{editUrl:G,lastUpdated:R,currentPageId:d,prev:Fe,next:$e,onNavigate:I,mobile:J}):s.jsxs(s.Fragment,{children:[(G||R)&&s.jsxs("div",{style:{marginTop:40,display:"flex",flexDirection:J?"column":"row",alignItems:J?"flex-start":"center",justifyContent:"space-between",gap:J?8:16},children:[G&&s.jsx("div",{"data-testid":"edit-page-link",children:s.jsxs("a",{href:G,target:"_blank",rel:"noopener noreferrer",style:{display:"inline-flex",alignItems:"center",gap:6,color:"var(--txM)",textDecoration:"none",fontSize:13,fontFamily:"var(--font-body)",transition:"color .15s"},onMouseOver:b=>b.currentTarget.style.color="var(--ac)",onMouseOut:b=>b.currentTarget.style.color="var(--txM)",children:[s.jsx(Wp,{})," Edit this page on GitHub"]})}),R&&s.jsxs("div",{"data-testid":"last-updated",style:{fontSize:12,color:"var(--txM)",fontFamily:"var(--font-body)"},children:["Last updated ",Fp(R)]})]}),s.jsx("div",{style:{display:"flex",alignItems:"center",gap:12,marginTop:24,padding:"12px 0"},children:ha[d]?s.jsx("span",{style:{fontSize:13,color:"var(--txM)",fontFamily:"var(--font-body)"},children:"Thanks for your feedback!"}):s.jsxs(s.Fragment,{children:[s.jsx("span",{style:{fontSize:13,color:"var(--txM)",fontFamily:"var(--font-body)"},children:"Was this helpful?"}),s.jsx("button",{onClick:()=>{pa(b=>({...b,[d]:!0}));try{localStorage.setItem(`tome-feedback-${d}`,"up")}catch{}},style:{background:"none",border:"1px solid var(--bd)",borderRadius:2,padding:"4px 10px",cursor:"pointer",fontSize:13,color:"var(--txM)",transition:"border-color .15s"},children:"👍"}),s.jsx("button",{onClick:()=>{pa(b=>({...b,[d]:!0}));try{localStorage.setItem(`tome-feedback-${d}`,"down")}catch{}},style:{background:"none",border:"1px solid var(--bd)",borderRadius:2,padding:"4px 10px",cursor:"pointer",fontSize:13,color:"var(--txM)",transition:"border-color .15s"},children:"👎"})]})}),s.jsxs("div",{style:{display:"flex",flexDirection:J?"column":"row",justifyContent:"space-between",marginTop:16,paddingTop:24,borderTop:"1px solid var(--bd)",gap:J?12:16},children:[Fe?s.jsxs("button",{onClick:()=>I(Fe.id),style:{display:"flex",alignItems:"center",gap:8,background:"none",border:"1px solid var(--bd)",borderRadius:2,padding:"10px 16px",cursor:"pointer",color:"var(--tx2)",fontSize:13,fontFamily:"var(--font-body)",transition:"border-color .15s, color .15s"},children:[ft?s.jsx(am,{}):s.jsx(nm,{})," ",Fe.title]}):s.jsx("div",{}),$e?s.jsxs("button",{onClick:()=>I($e.id),style:{display:"flex",alignItems:"center",gap:8,background:"none",border:"1px solid var(--bd)",borderRadius:2,padding:"10px 16px",cursor:"pointer",color:"var(--tx2)",fontSize:13,fontFamily:"var(--font-body)",transition:"border-color .15s, color .15s"},children:[$e.title," ",ft?s.jsx(nm,{}):s.jsx(am,{})]}):s.jsx("div",{})]})]})]}),tt!=null&&tt.Toc?ba&&ye.length>=2&&va&&s.jsx(tt.Toc,{headings:ye,activeHeadingId:ue,onScrollToHeading:ci}):ba&&ye.length>=2&&va&&s.jsxs("aside",{"data-testid":"toc-sidebar",style:{width:200,padding:ft?"40px 0 40px 16px":"40px 16px 40px 0",position:"sticky",top:0,alignSelf:"flex-start",flexShrink:0},children:[s.jsx("div",{style:{fontSize:10,fontWeight:600,textTransform:"uppercase",letterSpacing:".1em",color:"var(--txM)",marginBottom:12,fontFamily:"var(--font-code)"},children:"On this page"}),s.jsx("nav",{"aria-label":"Table of contents",style:{[ft?"borderRight":"borderLeft"]:"1px solid var(--bd)",[ft?"paddingRight":"paddingLeft"]:0},children:ye.map((b,q)=>{const et=ue===b.id;return s.jsx("a",{href:`#${b.id}`,onClick:dt=>ci(dt,b.id),"data-testid":`toc-link-${b.id}`,style:{display:"block",fontSize:12,color:et?"var(--ac)":"var(--txM)",fontWeight:et?500:400,textDecoration:"none",padding:"4px 12px",[ft?"paddingRight":"paddingLeft"]:12+(b.depth-2)*12,lineHeight:1.4,transition:"color .15s, font-weight .15s",[ft?"borderRight":"borderLeft"]:et?"2px solid var(--ac)":"2px solid transparent",[ft?"marginRight":"marginLeft"]:-1},children:b.text},q)})})]})]})]})]}),(tt==null?void 0:tt.Footer)&&s.jsx(tt.Footer,{config:u,navigation:p,currentPageId:d,onNavigate:I}),((zn=u.ai)==null?void 0:zn.enabled)&&s.jsx(Xp,{provider:u.ai.provider||"anthropic",model:u.ai.model,apiKey:typeof __TOME_AI_API_KEY__<"u"&&__TOME_AI_API_KEY__?__TOME_AI_API_KEY__:void 0,context:(at==null?void 0:at.map(b=>`## ${b.title}
${b.content}`).join(`
`))??ct.map(b=>`- ${b.title}${b.description?": "+b.description:""}`).join(`
-`)}),Ut&&s.jsx("div",{onClick:()=>Ze(null),style:{position:"fixed",inset:0,zIndex:9999,display:"flex",alignItems:"center",justifyContent:"center",background:"rgba(0,0,0,0.7)",backdropFilter:"blur(8px)",cursor:"zoom-out"},children:s.jsx("img",{src:Ut,alt:"",style:{maxWidth:"90vw",maxHeight:"90vh",objectFit:"contain",borderRadius:4,boxShadow:"0 16px 64px rgba(0,0,0,0.4)"}})})]})}function c0({allPages:u,onNavigate:h,onClose:d,mobile:c}){const[v,E]=w.useState(""),[M,O]=w.useState([]),[C,y]=w.useState(0),[G,R]=w.useState(null),K=w.useRef(null),nt=w.useRef(void 0);w.useEffect(()=>{Ih().then(W=>R(!!W)),setTimeout(()=>{var W;return(W=K.current)==null?void 0:W.focus()},50)},[]);const xt=w.useCallback(W=>{if(!W.trim())return[];const I=W.toLowerCase();return u.filter(ct=>ct.title.toLowerCase().includes(I)||(ct.description||"").toLowerCase().includes(I)).slice(0,8).map(ct=>({id:ct.id,title:ct.title,excerpt:ct.description}))},[u]),Dt=w.useCallback(async W=>{var ct;if(!W.trim()){O([]),y(0);return}const I=ul;if(I)try{const Q=await I.search(W),Y=[];for(const H of Q.results.slice(0,8)){const U=await H.data(),lt=(U.url||"").replace(/^\//,"").replace(/\/index\.html$/,"").replace(/\.html$/,"")||"index";Y.push({id:lt,title:((ct=U.meta)==null?void 0:ct.title)||lt,excerpt:U.excerpt||void 0})}O(Y),y(0);return}catch{}O(xt(W)),y(0)},[xt]);w.useEffect(()=>(nt.current&&clearTimeout(nt.current),nt.current=setTimeout(()=>Dt(v),120),()=>{nt.current&&clearTimeout(nt.current)}),[v,Dt]);const jt=w.useCallback(W=>{W.key==="ArrowDown"?(W.preventDefault(),y(I=>Math.min(I+1,M.length-1))):W.key==="ArrowUp"?(W.preventDefault(),y(I=>Math.max(I-1,0))):W.key==="Enter"&&M.length>0&&(W.preventDefault(),h(M[C].id))},[M,C,h]);return s.jsx("div",{onClick:d,style:{position:"fixed",inset:0,zIndex:1e3,background:"rgba(0,0,0,0.55)",backdropFilter:"blur(6px)",display:"flex",alignItems:c?"stretch":"flex-start",justifyContent:"center",paddingTop:c?0:"12vh"},children:s.jsxs("div",{onClick:W=>W.stopPropagation(),style:{background:"var(--sf)",border:c?"none":"1px solid var(--bd)",borderRadius:c?0:2,width:"100%",maxWidth:c?"100%":520,boxShadow:c?"none":"0 24px 80px rgba(0,0,0,0.4)",overflow:"hidden",display:"flex",flexDirection:"column",...c?{height:"100%"}:{}},children:[s.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10,padding:"14px 18px",borderBottom:"1px solid var(--bd)"},children:[s.jsx(rm,{}),s.jsx("input",{ref:K,value:v,onChange:W=>E(W.target.value),onKeyDown:jt,placeholder:"Search documentation...",style:{flex:1,background:"none",border:"none",outline:"none",color:"var(--tx)",fontSize:15,fontFamily:"var(--font-body)"}}),s.jsx("kbd",{style:{fontFamily:"var(--font-code)",fontSize:10,color:"var(--txM)",background:"var(--cdBg)",padding:"2px 6px",borderRadius:2,border:"1px solid var(--bd)"},children:"ESC"})]}),M.length>0&&s.jsx("div",{style:{padding:6,maxHeight:c?"none":360,overflow:"auto",flex:c?1:void 0},children:M.map((W,I)=>s.jsxs("button",{onClick:()=>h(W.id),style:{display:"block",width:"100%",textAlign:"left",background:I===C?"var(--acD)":"none",border:"none",borderRadius:2,padding:"10px 14px",cursor:"pointer",color:"var(--tx)",fontFamily:"var(--font-body)"},onMouseEnter:()=>y(I),children:[s.jsx("div",{style:{fontWeight:500,fontSize:14,marginBottom:2},children:W.title}),W.excerpt&&s.jsx("div",{style:{fontSize:12,color:"var(--txM)",lineHeight:1.3},dangerouslySetInnerHTML:{__html:W.excerpt}})]},W.id+I))}),v&&!M.length&&s.jsx("div",{style:{padding:"32px 18px",textAlign:"center",color:"var(--txM)",fontSize:14},children:"No results found"}),G===!1&&v&&M.length>0&&s.jsx("div",{style:{padding:"6px 18px 10px",fontSize:11,color:"var(--txM)",textAlign:"center"},children:"Showing title matches. Build your site for full-text search."})]})})}function cm(u,h,d){let c=u;h&&c.startsWith(h)&&(c=c.slice(h.length));const v=c.replace(/^\//,"").replace(/\/index\.html$/,"").replace(/\.html$/,"").replace(/\/$/,"")||"index";return d.find(M=>M.id===v)?v:null}function f0(u,h,d){const c=d.find(v=>v.id===u);return c?h+c.urlPath:h+"/"+u}class d0 extends Error{constructor(h){super(`Page not found: ${h}`),this.code="PAGE_NOT_FOUND",this.name="PageNotFoundError"}}class m0 extends Error{constructor(h,d){super(`Failed to load page: ${h}`),this.code="PAGE_LOAD_ERROR",this.name="PageLoadError",d&&(this.cause=d)}}function p0(u,h){if(!u||!h)return;const{repo:d,branch:c="main",dir:v=""}=u,E=v?`${v.replace(/\/$/,"")}/`:"";return`https://github.com/${d}/edit/${c}/${E}${h}`}function h0(u,h,d,c,v){var O;const E=v(u,c,d);if(E)return E;const M=h.startsWith("#")?h.slice(1):h;return M&&d.some(C=>C.id===M)?M:((O=d[0])==null?void 0:O.id)||"index"}async function fm(u,h,d){const c=h.find(E=>E.id===u);let v;try{v=await d(u)}catch(E){throw new m0(u,E)}if(c!=null&&c.isMdx&&v.meta)return{isMdx:!0,component:v.default,frontmatter:v.meta.frontmatter,headings:v.meta.headings};if(!v.default)throw new d0(u);return v.isApiReference&&v.apiManifest?{isMdx:!1,isApiReference:!0,...v.default,apiManifest:v.apiManifest}:v.isChangelog&&v.changelogEntries?{isMdx:!1,...v.default,changelogEntries:v.changelogEntries}:{isMdx:!1,...v.default}}function g0(u,h){return(u==null?void 0:u.version)||void 0}const Jn={name:"Kit",logo:"/logo.jpg",favicon:"/logo.jpg",baseUrl:"https://go-kit.dev",theme:{preset:"cipher",accent:"#e03030",mode:"dark",fonts:{heading:"Space Grotesk",body:"Space Grotesk",code:"Source Code Pro"}},navigation:[{group:"Getting Started",pages:["index","installation","quick-start"]},{group:"Configuration",pages:["configuration","providers","themes"]},{group:"CLI Reference",pages:["cli/flags","cli/commands"]},{group:"Extensions",pages:["extensions/overview","extensions/capabilities","extensions/examples","extensions/loading","extensions/testing"]},{group:"Sessions",pages:["sessions"]},{group:"Go SDK",pages:["sdk/overview","sdk/options","sdk/callbacks","sdk/sessions"]},{group:"Advanced",pages:["advanced/subagents","advanced/json-output","advanced/testing"]},{group:"Development",pages:["development"]}],search:{provider:"local"},toc:{enabled:!0,depth:3},math:!1,strictLinks:!1,lastUpdated:!0,redirects:[],socialLinks:[{platform:"github",url:"https://github.com/mark3labs/kit"},{platform:"discord",url:"https://discord.gg/RqSS2NQVsY"}]},Wn=[{id:"advanced/json-output",filePath:"advanced/json-output.md",urlPath:"/advanced/json-output",frontmatter:{title:"JSON Output",description:"Machine-readable JSON output for scripting and automation.",hidden:!1,draft:!1},isMdx:!1,lastUpdated:"2026-06-02T15:21:48+03:00"},{id:"advanced/subagents",filePath:"advanced/subagents.md",urlPath:"/advanced/subagents",frontmatter:{title:"Subagents",description:"Multi-agent orchestration with Kit subagents.",hidden:!1,draft:!1},isMdx:!1,lastUpdated:"2026-06-02T15:21:48+03:00"},{id:"advanced/testing",filePath:"advanced/testing.md",urlPath:"/advanced/testing",frontmatter:{title:"Testing with tmux",description:"Test Kit's TUI non-interactively using tmux.",hidden:!1,draft:!1},isMdx:!1,lastUpdated:"2026-06-02T15:21:48+03:00"},{id:"cli/commands",filePath:"cli/commands.md",urlPath:"/cli/commands",frontmatter:{title:"Commands",description:"Complete reference for all Kit CLI subcommands.",hidden:!1,draft:!1},isMdx:!1,lastUpdated:"2026-06-02T15:21:48+03:00"},{id:"cli/flags",filePath:"cli/flags.md",urlPath:"/cli/flags",frontmatter:{title:"Global Flags",description:"Complete reference for all Kit CLI flags.",hidden:!1,draft:!1},isMdx:!1,lastUpdated:"2026-06-02T15:21:48+03:00"},{id:"configuration",filePath:"configuration.md",urlPath:"/configuration",frontmatter:{title:"Configuration",description:"Configure Kit using config files, environment variables, and CLI flags.",hidden:!1,draft:!1},isMdx:!1,lastUpdated:"2026-06-02T15:21:48+03:00"},{id:"development",filePath:"development.md",urlPath:"/development",frontmatter:{title:"Development",description:"Build, test, and contribute to Kit.",hidden:!1,draft:!1},isMdx:!1,lastUpdated:"2026-06-02T15:21:48+03:00"},{id:"extensions/capabilities",filePath:"extensions/capabilities.md",urlPath:"/extensions/capabilities",frontmatter:{title:"Capabilities",description:"All extension capabilities — lifecycle events, tools, commands, widgets, and more.",hidden:!1,draft:!1},isMdx:!1,lastUpdated:"2026-06-02T15:21:48+03:00"},{id:"extensions/examples",filePath:"extensions/examples.md",urlPath:"/extensions/examples",frontmatter:{title:"Examples",description:"Catalog of example extensions included with Kit.",hidden:!1,draft:!1},isMdx:!1,lastUpdated:"2026-06-02T15:21:48+03:00"},{id:"extensions/loading",filePath:"extensions/loading.md",urlPath:"/extensions/loading",frontmatter:{title:"Loading Extensions",description:"How Kit discovers and loads extensions.",hidden:!1,draft:!1},isMdx:!1,lastUpdated:"2026-06-02T15:21:48+03:00"},{id:"extensions/overview",filePath:"extensions/overview.md",urlPath:"/extensions/overview",frontmatter:{title:"Extension System",description:"Overview of Kit's Go-based extension system.",hidden:!1,draft:!1},isMdx:!1,lastUpdated:"2026-06-02T15:21:48+03:00"},{id:"extensions/testing",filePath:"extensions/testing.md",urlPath:"/extensions/testing",frontmatter:{title:"Testing Extensions",description:"Write unit tests for your Kit extensions using the test package.",hidden:!1,draft:!1},isMdx:!1,lastUpdated:"2026-06-02T15:21:48+03:00"},{id:"index",filePath:"index.md",urlPath:"/",frontmatter:{title:"Kit",description:"Kit is a powerful, extensible AI coding agent CLI with multi-provider support, built-in tools, and a rich extension system.",hidden:!1,draft:!1},isMdx:!1,lastUpdated:"2026-06-02T15:21:48+03:00"},{id:"installation",filePath:"installation.md",urlPath:"/installation",frontmatter:{title:"Installation",description:"Install Kit using npm, bun, pnpm, Go, or build from source.",hidden:!1,draft:!1},isMdx:!1,lastUpdated:"2026-06-02T15:21:48+03:00"},{id:"providers",filePath:"providers.md",urlPath:"/providers",frontmatter:{title:"Providers",description:"Supported LLM providers and model configuration.",hidden:!1,draft:!1},isMdx:!1,lastUpdated:"2026-06-02T15:21:48+03:00"},{id:"quick-start",filePath:"quick-start.md",urlPath:"/quick-start",frontmatter:{title:"Quick Start",description:"Get up and running with Kit in minutes.",hidden:!1,draft:!1},isMdx:!1,lastUpdated:"2026-06-02T15:21:48+03:00"},{id:"sdk/callbacks",filePath:"sdk/callbacks.md",urlPath:"/sdk/callbacks",frontmatter:{title:"Callbacks",description:"Monitor tool calls and streaming output with the Kit Go SDK.",hidden:!1,draft:!1},isMdx:!1,lastUpdated:"2026-06-02T15:21:48+03:00"},{id:"sdk/options",filePath:"sdk/options.md",urlPath:"/sdk/options",frontmatter:{title:"SDK Options",description:"Configuration options for the Kit Go SDK.",hidden:!1,draft:!1},isMdx:!1,lastUpdated:"2026-06-02T15:21:48+03:00"},{id:"sdk/overview",filePath:"sdk/overview.md",urlPath:"/sdk/overview",frontmatter:{title:"Go SDK",description:"Embed Kit in your Go applications.",hidden:!1,draft:!1},isMdx:!1,lastUpdated:"2026-06-02T15:21:48+03:00"},{id:"sdk/sessions",filePath:"sdk/sessions.md",urlPath:"/sdk/sessions",frontmatter:{title:"SDK Sessions",description:"Session management in the Kit Go SDK.",hidden:!1,draft:!1},isMdx:!1,lastUpdated:"2026-06-02T15:21:48+03:00"},{id:"sessions",filePath:"sessions.md",urlPath:"/sessions",frontmatter:{title:"Session Management",description:"How Kit persists and manages conversation sessions.",hidden:!1,draft:!1},isMdx:!1,lastUpdated:"2026-06-02T15:21:48+03:00"},{id:"themes",filePath:"themes.md",urlPath:"/themes",frontmatter:{title:"Themes",description:"Customize Kit's appearance with built-in themes, custom theme files, and the extension theme API.",hidden:!1,draft:!1},isMdx:!1,lastUpdated:"2026-06-02T15:21:48+03:00"}],v0=[{section:"Getting Started",pages:[{title:"Kit",id:"index",urlPath:"/"},{title:"Installation",id:"installation",urlPath:"/installation"},{title:"Quick Start",id:"quick-start",urlPath:"/quick-start"}]},{section:"Configuration",pages:[{title:"Configuration",id:"configuration",urlPath:"/configuration"},{title:"Providers",id:"providers",urlPath:"/providers"},{title:"Themes",id:"themes",urlPath:"/themes"}]},{section:"CLI Reference",pages:[{title:"Global Flags",id:"cli/flags",urlPath:"/cli/flags"},{title:"Commands",id:"cli/commands",urlPath:"/cli/commands"}]},{section:"Extensions",pages:[{title:"Extension System",id:"extensions/overview",urlPath:"/extensions/overview"},{title:"Capabilities",id:"extensions/capabilities",urlPath:"/extensions/capabilities"},{title:"Examples",id:"extensions/examples",urlPath:"/extensions/examples"},{title:"Loading Extensions",id:"extensions/loading",urlPath:"/extensions/loading"},{title:"Testing Extensions",id:"extensions/testing",urlPath:"/extensions/testing"}]},{section:"Sessions",pages:[{title:"Session Management",id:"sessions",urlPath:"/sessions"}]},{section:"Go SDK",pages:[{title:"Go SDK",id:"sdk/overview",urlPath:"/sdk/overview"},{title:"SDK Options",id:"sdk/options",urlPath:"/sdk/options"},{title:"Callbacks",id:"sdk/callbacks",urlPath:"/sdk/callbacks"},{title:"SDK Sessions",id:"sdk/sessions",urlPath:"/sdk/sessions"}]},{section:"Advanced",pages:[{title:"Subagents",id:"advanced/subagents",urlPath:"/advanced/subagents"},{title:"JSON Output",id:"advanced/json-output",urlPath:"/advanced/json-output"},{title:"Testing with tmux",id:"advanced/testing",urlPath:"/advanced/testing"}]},{section:"Development",pages:[{title:"Development",id:"development",urlPath:"/development"}]}],Zu=null,y0={"advanced/json-output":()=>Lt(()=>import("./json-output-BiSiIPM0.js"),[]),"advanced/subagents":()=>Lt(()=>import("./subagents-lghAXYlk.js"),[]),"advanced/testing":()=>Lt(()=>import("./testing-COLNxuKj.js"),[]),"cli/commands":()=>Lt(()=>import("./commands-CjvM1xle.js"),[]),"cli/flags":()=>Lt(()=>import("./flags-DBc7n5J6.js"),[]),configuration:()=>Lt(()=>import("./configuration-BOyO9N_c.js"),[]),development:()=>Lt(()=>import("./development-E-EC7CAm.js"),[]),"extensions/capabilities":()=>Lt(()=>import("./capabilities-VpEmfPck.js"),[]),"extensions/examples":()=>Lt(()=>import("./examples-Dd5WMq-L.js"),[]),"extensions/loading":()=>Lt(()=>import("./loading-CfdMbwrl.js"),[]),"extensions/overview":()=>Lt(()=>import("./overview-BRtZenVZ.js"),[]),"extensions/testing":()=>Lt(()=>import("./testing-BjX63Hnw.js"),[]),index:()=>Lt(()=>import("./index-DjkHYQxg.js"),[]),installation:()=>Lt(()=>import("./installation-CkjlJXwY.js"),[]),providers:()=>Lt(()=>import("./providers-BpTDMUOj.js"),[]),"quick-start":()=>Lt(()=>import("./quick-start-YzNijQyU.js"),[]),"sdk/callbacks":()=>Lt(()=>import("./callbacks-DurHXbkP.js"),[]),"sdk/options":()=>Lt(()=>import("./options-C2ZyqtaF.js"),[]),"sdk/overview":()=>Lt(()=>import("./overview-C9sBcRua.js"),[]),"sdk/sessions":()=>Lt(()=>import("./sessions-CeADaXnR.js"),[]),sessions:()=>Lt(()=>import("./sessions-BR7Y7dXm.js"),[]),themes:()=>Lt(()=>import("./themes-Chyvu6J4.js"),[])};function dm(u){const h=y0[u];if(!h)throw new Error("Unknown page: "+u);return h()}const b0=[{id:"advanced/json-output",title:"JSON Output",content:`
+`)}),Ut&&s.jsx("div",{onClick:()=>Ze(null),style:{position:"fixed",inset:0,zIndex:9999,display:"flex",alignItems:"center",justifyContent:"center",background:"rgba(0,0,0,0.7)",backdropFilter:"blur(8px)",cursor:"zoom-out"},children:s.jsx("img",{src:Ut,alt:"",style:{maxWidth:"90vw",maxHeight:"90vh",objectFit:"contain",borderRadius:4,boxShadow:"0 16px 64px rgba(0,0,0,0.4)"}})})]})}function c0({allPages:u,onNavigate:p,onClose:d,mobile:c}){const[v,E]=w.useState(""),[M,O]=w.useState([]),[C,y]=w.useState(0),[G,R]=w.useState(null),K=w.useRef(null),nt=w.useRef(void 0);w.useEffect(()=>{Ip().then(W=>R(!!W)),setTimeout(()=>{var W;return(W=K.current)==null?void 0:W.focus()},50)},[]);const xt=w.useCallback(W=>{if(!W.trim())return[];const I=W.toLowerCase();return u.filter(ct=>ct.title.toLowerCase().includes(I)||(ct.description||"").toLowerCase().includes(I)).slice(0,8).map(ct=>({id:ct.id,title:ct.title,excerpt:ct.description}))},[u]),Dt=w.useCallback(async W=>{var ct;if(!W.trim()){O([]),y(0);return}const I=ul;if(I)try{const Q=await I.search(W),Y=[];for(const H of Q.results.slice(0,8)){const U=await H.data(),lt=(U.url||"").replace(/^\//,"").replace(/\/index\.html$/,"").replace(/\.html$/,"")||"index";Y.push({id:lt,title:((ct=U.meta)==null?void 0:ct.title)||lt,excerpt:U.excerpt||void 0})}O(Y),y(0);return}catch{}O(xt(W)),y(0)},[xt]);w.useEffect(()=>(nt.current&&clearTimeout(nt.current),nt.current=setTimeout(()=>Dt(v),120),()=>{nt.current&&clearTimeout(nt.current)}),[v,Dt]);const At=w.useCallback(W=>{W.key==="ArrowDown"?(W.preventDefault(),y(I=>Math.min(I+1,M.length-1))):W.key==="ArrowUp"?(W.preventDefault(),y(I=>Math.max(I-1,0))):W.key==="Enter"&&M.length>0&&(W.preventDefault(),p(M[C].id))},[M,C,p]);return s.jsx("div",{onClick:d,style:{position:"fixed",inset:0,zIndex:1e3,background:"rgba(0,0,0,0.55)",backdropFilter:"blur(6px)",display:"flex",alignItems:c?"stretch":"flex-start",justifyContent:"center",paddingTop:c?0:"12vh"},children:s.jsxs("div",{onClick:W=>W.stopPropagation(),style:{background:"var(--sf)",border:c?"none":"1px solid var(--bd)",borderRadius:c?0:2,width:"100%",maxWidth:c?"100%":520,boxShadow:c?"none":"0 24px 80px rgba(0,0,0,0.4)",overflow:"hidden",display:"flex",flexDirection:"column",...c?{height:"100%"}:{}},children:[s.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10,padding:"14px 18px",borderBottom:"1px solid var(--bd)"},children:[s.jsx(rm,{}),s.jsx("input",{ref:K,value:v,onChange:W=>E(W.target.value),onKeyDown:At,placeholder:"Search documentation...",style:{flex:1,background:"none",border:"none",outline:"none",color:"var(--tx)",fontSize:15,fontFamily:"var(--font-body)"}}),s.jsx("kbd",{style:{fontFamily:"var(--font-code)",fontSize:10,color:"var(--txM)",background:"var(--cdBg)",padding:"2px 6px",borderRadius:2,border:"1px solid var(--bd)"},children:"ESC"})]}),M.length>0&&s.jsx("div",{style:{padding:6,maxHeight:c?"none":360,overflow:"auto",flex:c?1:void 0},children:M.map((W,I)=>s.jsxs("button",{onClick:()=>p(W.id),style:{display:"block",width:"100%",textAlign:"left",background:I===C?"var(--acD)":"none",border:"none",borderRadius:2,padding:"10px 14px",cursor:"pointer",color:"var(--tx)",fontFamily:"var(--font-body)"},onMouseEnter:()=>y(I),children:[s.jsx("div",{style:{fontWeight:500,fontSize:14,marginBottom:2},children:W.title}),W.excerpt&&s.jsx("div",{style:{fontSize:12,color:"var(--txM)",lineHeight:1.3},dangerouslySetInnerHTML:{__html:W.excerpt}})]},W.id+I))}),v&&!M.length&&s.jsx("div",{style:{padding:"32px 18px",textAlign:"center",color:"var(--txM)",fontSize:14},children:"No results found"}),G===!1&&v&&M.length>0&&s.jsx("div",{style:{padding:"6px 18px 10px",fontSize:11,color:"var(--txM)",textAlign:"center"},children:"Showing title matches. Build your site for full-text search."})]})})}function cm(u,p,d){let c=u;p&&c.startsWith(p)&&(c=c.slice(p.length));const v=c.replace(/^\//,"").replace(/\/index\.html$/,"").replace(/\.html$/,"").replace(/\/$/,"")||"index";return d.find(M=>M.id===v)?v:null}function f0(u,p,d){const c=d.find(v=>v.id===u);return c?p+c.urlPath:p+"/"+u}class d0 extends Error{constructor(p){super(`Page not found: ${p}`),this.code="PAGE_NOT_FOUND",this.name="PageNotFoundError"}}class m0 extends Error{constructor(p,d){super(`Failed to load page: ${p}`),this.code="PAGE_LOAD_ERROR",this.name="PageLoadError",d&&(this.cause=d)}}function h0(u,p){if(!u||!p)return;const{repo:d,branch:c="main",dir:v=""}=u,E=v?`${v.replace(/\/$/,"")}/`:"";return`https://github.com/${d}/edit/${c}/${E}${p}`}function p0(u,p,d,c,v){var O;const E=v(u,c,d);if(E)return E;const M=p.startsWith("#")?p.slice(1):p;return M&&d.some(C=>C.id===M)?M:((O=d[0])==null?void 0:O.id)||"index"}async function fm(u,p,d){const c=p.find(E=>E.id===u);let v;try{v=await d(u)}catch(E){throw new m0(u,E)}if(c!=null&&c.isMdx&&v.meta)return{isMdx:!0,component:v.default,frontmatter:v.meta.frontmatter,headings:v.meta.headings};if(!v.default)throw new d0(u);return v.isApiReference&&v.apiManifest?{isMdx:!1,isApiReference:!0,...v.default,apiManifest:v.apiManifest}:v.isChangelog&&v.changelogEntries?{isMdx:!1,...v.default,changelogEntries:v.changelogEntries}:{isMdx:!1,...v.default}}function g0(u,p){return(u==null?void 0:u.version)||void 0}const Jn={name:"Kit",logo:"/logo.jpg",favicon:"/logo.jpg",baseUrl:"https://go-kit.dev",theme:{preset:"cipher",accent:"#e03030",mode:"dark",fonts:{heading:"Space Grotesk",body:"Space Grotesk",code:"Source Code Pro"}},navigation:[{group:"Getting Started",pages:["index","installation","quick-start"]},{group:"Configuration",pages:["configuration","providers","themes"]},{group:"CLI Reference",pages:["cli/flags","cli/commands"]},{group:"Extensions",pages:["extensions/overview","extensions/capabilities","extensions/examples","extensions/loading","extensions/testing"]},{group:"Sessions",pages:["sessions"]},{group:"Go SDK",pages:["sdk/overview","sdk/options","sdk/callbacks","sdk/sessions"]},{group:"Advanced",pages:["advanced/subagents","advanced/json-output","advanced/testing"]},{group:"Development",pages:["development"]}],search:{provider:"local"},toc:{enabled:!0,depth:3},math:!1,strictLinks:!1,lastUpdated:!0,redirects:[],socialLinks:[{platform:"github",url:"https://github.com/mark3labs/kit"},{platform:"discord",url:"https://discord.gg/RqSS2NQVsY"}]},Wn=[{id:"advanced/json-output",filePath:"advanced/json-output.md",urlPath:"/advanced/json-output",frontmatter:{title:"JSON Output",description:"Machine-readable JSON output for scripting and automation.",hidden:!1,draft:!1},isMdx:!1,lastUpdated:"2026-06-04T14:36:39+03:00"},{id:"advanced/subagents",filePath:"advanced/subagents.md",urlPath:"/advanced/subagents",frontmatter:{title:"Subagents",description:"Multi-agent orchestration with Kit subagents.",hidden:!1,draft:!1},isMdx:!1,lastUpdated:"2026-06-04T14:36:39+03:00"},{id:"advanced/testing",filePath:"advanced/testing.md",urlPath:"/advanced/testing",frontmatter:{title:"Testing with tmux",description:"Test Kit's TUI non-interactively using tmux.",hidden:!1,draft:!1},isMdx:!1,lastUpdated:"2026-06-04T14:36:39+03:00"},{id:"cli/commands",filePath:"cli/commands.md",urlPath:"/cli/commands",frontmatter:{title:"Commands",description:"Complete reference for all Kit CLI subcommands.",hidden:!1,draft:!1},isMdx:!1,lastUpdated:"2026-06-04T14:36:39+03:00"},{id:"cli/flags",filePath:"cli/flags.md",urlPath:"/cli/flags",frontmatter:{title:"Global Flags",description:"Complete reference for all Kit CLI flags.",hidden:!1,draft:!1},isMdx:!1,lastUpdated:"2026-06-04T14:36:39+03:00"},{id:"configuration",filePath:"configuration.md",urlPath:"/configuration",frontmatter:{title:"Configuration",description:"Configure Kit using config files, environment variables, and CLI flags.",hidden:!1,draft:!1},isMdx:!1,lastUpdated:"2026-06-04T14:36:39+03:00"},{id:"development",filePath:"development.md",urlPath:"/development",frontmatter:{title:"Development",description:"Build, test, and contribute to Kit.",hidden:!1,draft:!1},isMdx:!1,lastUpdated:"2026-06-04T14:36:39+03:00"},{id:"extensions/capabilities",filePath:"extensions/capabilities.md",urlPath:"/extensions/capabilities",frontmatter:{title:"Capabilities",description:"All extension capabilities — lifecycle events, tools, commands, widgets, and more.",hidden:!1,draft:!1},isMdx:!1,lastUpdated:"2026-06-04T14:36:39+03:00"},{id:"extensions/examples",filePath:"extensions/examples.md",urlPath:"/extensions/examples",frontmatter:{title:"Examples",description:"Catalog of example extensions included with Kit.",hidden:!1,draft:!1},isMdx:!1,lastUpdated:"2026-06-04T14:36:39+03:00"},{id:"extensions/loading",filePath:"extensions/loading.md",urlPath:"/extensions/loading",frontmatter:{title:"Loading Extensions",description:"How Kit discovers and loads extensions.",hidden:!1,draft:!1},isMdx:!1,lastUpdated:"2026-06-04T14:36:39+03:00"},{id:"extensions/overview",filePath:"extensions/overview.md",urlPath:"/extensions/overview",frontmatter:{title:"Extension System",description:"Overview of Kit's Go-based extension system.",hidden:!1,draft:!1},isMdx:!1,lastUpdated:"2026-06-04T14:36:39+03:00"},{id:"extensions/testing",filePath:"extensions/testing.md",urlPath:"/extensions/testing",frontmatter:{title:"Testing Extensions",description:"Write unit tests for your Kit extensions using the test package.",hidden:!1,draft:!1},isMdx:!1,lastUpdated:"2026-06-04T14:36:39+03:00"},{id:"index",filePath:"index.md",urlPath:"/",frontmatter:{title:"Kit",description:"Kit is a powerful, extensible AI coding agent CLI with multi-provider support, built-in tools, and a rich extension system.",hidden:!1,draft:!1},isMdx:!1,lastUpdated:"2026-06-04T14:36:39+03:00"},{id:"installation",filePath:"installation.md",urlPath:"/installation",frontmatter:{title:"Installation",description:"Install Kit using npm, bun, pnpm, Go, or build from source.",hidden:!1,draft:!1},isMdx:!1,lastUpdated:"2026-06-04T14:36:39+03:00"},{id:"providers",filePath:"providers.md",urlPath:"/providers",frontmatter:{title:"Providers",description:"Supported LLM providers and model configuration.",hidden:!1,draft:!1},isMdx:!1,lastUpdated:"2026-06-04T14:36:39+03:00"},{id:"quick-start",filePath:"quick-start.md",urlPath:"/quick-start",frontmatter:{title:"Quick Start",description:"Get up and running with Kit in minutes.",hidden:!1,draft:!1},isMdx:!1,lastUpdated:"2026-06-04T14:36:39+03:00"},{id:"sdk/callbacks",filePath:"sdk/callbacks.md",urlPath:"/sdk/callbacks",frontmatter:{title:"Callbacks",description:"Monitor tool calls and streaming output with the Kit Go SDK.",hidden:!1,draft:!1},isMdx:!1,lastUpdated:"2026-06-04T14:36:39+03:00"},{id:"sdk/options",filePath:"sdk/options.md",urlPath:"/sdk/options",frontmatter:{title:"SDK Options",description:"Configuration options for the Kit Go SDK.",hidden:!1,draft:!1},isMdx:!1,lastUpdated:"2026-06-04T14:36:39+03:00"},{id:"sdk/overview",filePath:"sdk/overview.md",urlPath:"/sdk/overview",frontmatter:{title:"Go SDK",description:"Embed Kit in your Go applications.",hidden:!1,draft:!1},isMdx:!1,lastUpdated:"2026-06-04T14:36:39+03:00"},{id:"sdk/sessions",filePath:"sdk/sessions.md",urlPath:"/sdk/sessions",frontmatter:{title:"SDK Sessions",description:"Session management in the Kit Go SDK.",hidden:!1,draft:!1},isMdx:!1,lastUpdated:"2026-06-04T14:36:39+03:00"},{id:"sessions",filePath:"sessions.md",urlPath:"/sessions",frontmatter:{title:"Session Management",description:"How Kit persists and manages conversation sessions.",hidden:!1,draft:!1},isMdx:!1,lastUpdated:"2026-06-04T14:36:39+03:00"},{id:"themes",filePath:"themes.md",urlPath:"/themes",frontmatter:{title:"Themes",description:"Customize Kit's appearance with built-in themes, custom theme files, and the extension theme API.",hidden:!1,draft:!1},isMdx:!1,lastUpdated:"2026-06-04T14:36:39+03:00"}],v0=[{section:"Getting Started",pages:[{title:"Kit",id:"index",urlPath:"/"},{title:"Installation",id:"installation",urlPath:"/installation"},{title:"Quick Start",id:"quick-start",urlPath:"/quick-start"}]},{section:"Configuration",pages:[{title:"Configuration",id:"configuration",urlPath:"/configuration"},{title:"Providers",id:"providers",urlPath:"/providers"},{title:"Themes",id:"themes",urlPath:"/themes"}]},{section:"CLI Reference",pages:[{title:"Global Flags",id:"cli/flags",urlPath:"/cli/flags"},{title:"Commands",id:"cli/commands",urlPath:"/cli/commands"}]},{section:"Extensions",pages:[{title:"Extension System",id:"extensions/overview",urlPath:"/extensions/overview"},{title:"Capabilities",id:"extensions/capabilities",urlPath:"/extensions/capabilities"},{title:"Examples",id:"extensions/examples",urlPath:"/extensions/examples"},{title:"Loading Extensions",id:"extensions/loading",urlPath:"/extensions/loading"},{title:"Testing Extensions",id:"extensions/testing",urlPath:"/extensions/testing"}]},{section:"Sessions",pages:[{title:"Session Management",id:"sessions",urlPath:"/sessions"}]},{section:"Go SDK",pages:[{title:"Go SDK",id:"sdk/overview",urlPath:"/sdk/overview"},{title:"SDK Options",id:"sdk/options",urlPath:"/sdk/options"},{title:"Callbacks",id:"sdk/callbacks",urlPath:"/sdk/callbacks"},{title:"SDK Sessions",id:"sdk/sessions",urlPath:"/sdk/sessions"}]},{section:"Advanced",pages:[{title:"Subagents",id:"advanced/subagents",urlPath:"/advanced/subagents"},{title:"JSON Output",id:"advanced/json-output",urlPath:"/advanced/json-output"},{title:"Testing with tmux",id:"advanced/testing",urlPath:"/advanced/testing"}]},{section:"Development",pages:[{title:"Development",id:"development",urlPath:"/development"}]}],Zu=null,y0={"advanced/json-output":()=>Lt(()=>import("./json-output-BiSiIPM0.js"),[]),"advanced/subagents":()=>Lt(()=>import("./subagents-lghAXYlk.js"),[]),"advanced/testing":()=>Lt(()=>import("./testing-COLNxuKj.js"),[]),"cli/commands":()=>Lt(()=>import("./commands-UPFOPOAU.js"),[]),"cli/flags":()=>Lt(()=>import("./flags-DBc7n5J6.js"),[]),configuration:()=>Lt(()=>import("./configuration-BOyO9N_c.js"),[]),development:()=>Lt(()=>import("./development-E-EC7CAm.js"),[]),"extensions/capabilities":()=>Lt(()=>import("./capabilities-VpEmfPck.js"),[]),"extensions/examples":()=>Lt(()=>import("./examples-Dd5WMq-L.js"),[]),"extensions/loading":()=>Lt(()=>import("./loading-CfdMbwrl.js"),[]),"extensions/overview":()=>Lt(()=>import("./overview-BRtZenVZ.js"),[]),"extensions/testing":()=>Lt(()=>import("./testing-BjX63Hnw.js"),[]),index:()=>Lt(()=>import("./index-DjkHYQxg.js"),[]),installation:()=>Lt(()=>import("./installation-CkjlJXwY.js"),[]),providers:()=>Lt(()=>import("./providers-BpTDMUOj.js"),[]),"quick-start":()=>Lt(()=>import("./quick-start-YzNijQyU.js"),[]),"sdk/callbacks":()=>Lt(()=>import("./callbacks-DurHXbkP.js"),[]),"sdk/options":()=>Lt(()=>import("./options-C2ZyqtaF.js"),[]),"sdk/overview":()=>Lt(()=>import("./overview-C9sBcRua.js"),[]),"sdk/sessions":()=>Lt(()=>import("./sessions-CeADaXnR.js"),[]),sessions:()=>Lt(()=>import("./sessions-BR7Y7dXm.js"),[]),themes:()=>Lt(()=>import("./themes-Chyvu6J4.js"),[])};function dm(u){const p=y0[u];if(!p)throw new Error("Unknown page: "+u);return p()}const b0=[{id:"advanced/json-output",title:"JSON Output",content:`
# JSON Output
Use the \`--json\` flag to get structured output for scripting and automation:
@@ -491,6 +491,23 @@ Press **Ctrl+X s** during streaming to inject a system-level instruction mid-tur
Example: While the model is writing code, press Ctrl+X s and type "Use async/await instead" to change the implementation approach.
+### Image attachments
+
+Attach images to your next prompt straight from the clipboard:
+
+- Copy an image (e.g. a screenshot) to the system clipboard, then press **Ctrl+V** in the input to attach it.
+- Press **Ctrl+U** to clear all pending image attachments.
+- Attachments are sent alongside your text when you submit, and cleared afterward.
+
+When a terminal supports color, Kit renders a small low-resolution **thumbnail preview** of each pending image directly in the input, below the \`[N image(s) attached]\` indicator, so you can confirm the right image was attached before sending.
+
+The preview is drawn with Unicode half-block characters and ordinary terminal colors — not a graphics protocol — so it renders correctly inside terminal multiplexers like **tmux** and **zellij**. Thumbnails are capped to a small cell box for a glanceable, low-res look.
+
+- Best fidelity needs a **truecolor** terminal (\`COLORTERM=truecolor\`); Kit degrades to 256-color where truecolor is unavailable.
+- On terminals with neither, the preview is skipped and the \`[N image(s) attached]\` text indicator is shown alone.
+
+You can also attach image files by referencing them with \`@path/to/image.png\` — binary files are auto-detected by MIME type. See [Quick Start](/quick-start) for the \`@\` attachment syntax.
+
## Prompt templates
### Creating templates
@@ -1081,18 +1098,18 @@ available := ctx.CheckModelAvailable("anthropic/claude-sonnet-4") // bool
provider := ctx.GetCurrentProvider() // "anthropic"
modelID := ctx.GetCurrentModelID() // "claude-sonnet-4"
\`\`\`
-`},{id:"extensions/examples",title:"Examples",content:"\n# Extension Examples\n\nKit ships with a rich set of example extensions in the `examples/extensions/` directory. These serve as both documentation and starting points for your own extensions.\n\n## UI and display\n\n| Extension | Description |\n|-----------|-------------|\n| [`minimal.go`](https://github.com/mark3labs/kit/blob/master/examples/extensions/minimal.go) | Clean UI with custom footer |\n| [`branded-output.go`](https://github.com/mark3labs/kit/blob/master/examples/extensions/branded-output.go) | Branded output rendering |\n| [`header-footer-demo.go`](https://github.com/mark3labs/kit/blob/master/examples/extensions/header-footer-demo.go) | Custom headers and footers |\n| [`widget-status.go`](https://github.com/mark3labs/kit/blob/master/examples/extensions/widget-status.go) | Persistent status widgets |\n| [`overlay-demo.go`](https://github.com/mark3labs/kit/blob/master/examples/extensions/overlay-demo.go) | Modal dialogs |\n| [`tool-renderer-demo.go`](https://github.com/mark3labs/kit/blob/master/examples/extensions/tool-renderer-demo.go) | Custom tool call rendering |\n| [`custom-editor-demo.go`](https://github.com/mark3labs/kit/blob/master/examples/extensions/custom-editor-demo.go) | Vim-like modal editor |\n| [`pirate.go`](https://github.com/mark3labs/kit/blob/master/examples/extensions/pirate.go) | Pirate-themed personality |\n\n## Workflow and automation\n\n| Extension | Description |\n|-----------|-------------|\n| [`auto-commit.go`](https://github.com/mark3labs/kit/blob/master/examples/extensions/auto-commit.go) | Auto-commit changes on shutdown |\n| [`plan-mode.go`](https://github.com/mark3labs/kit/blob/master/examples/extensions/plan-mode.go) | Read-only planning mode |\n| [`permission-gate.go`](https://github.com/mark3labs/kit/blob/master/examples/extensions/permission-gate.go) | Permission gating for destructive tools |\n| [`confirm-destructive.go`](https://github.com/mark3labs/kit/blob/master/examples/extensions/confirm-destructive.go) | Confirm destructive operations |\n| [`protected-paths.go`](https://github.com/mark3labs/kit/blob/master/examples/extensions/protected-paths.go) | Path protection for sensitive files |\n| [`project-rules.go`](https://github.com/mark3labs/kit/blob/master/examples/extensions/project-rules.go) | Project-specific rules injection |\n| [`compact-notify.go`](https://github.com/mark3labs/kit/blob/master/examples/extensions/compact-notify.go) | Notification on conversation compaction |\n\n## Interactive features\n\n| Extension | Description |\n|-----------|-------------|\n| [`prompt-demo.go`](https://github.com/mark3labs/kit/blob/master/examples/extensions/prompt-demo.go) | Interactive prompts (select/confirm/input) |\n| [`bookmark.go`](https://github.com/mark3labs/kit/blob/master/examples/extensions/bookmark.go) | Bookmark conversations |\n| [`inline-bash.go`](https://github.com/mark3labs/kit/blob/master/examples/extensions/inline-bash.go) | Inline bash execution |\n| [`interactive-shell.go`](https://github.com/mark3labs/kit/blob/master/examples/extensions/interactive-shell.go) | Interactive shell integration |\n| [`notify.go`](https://github.com/mark3labs/kit/blob/master/examples/extensions/notify.go) | Desktop notifications |\n\n## Agent and context\n\n| Extension | Description |\n|-----------|-------------|\n| [`tool-logger.go`](https://github.com/mark3labs/kit/blob/master/examples/extensions/tool-logger.go) | Log all tool calls |\n| [`context-inject.go`](https://github.com/mark3labs/kit/blob/master/examples/extensions/context-inject.go) | Inject context into conversations |\n| [`summarize.go`](https://github.com/mark3labs/kit/blob/master/examples/extensions/summarize.go) | Conversation summarization |\n| [`lsp-diagnostics.go`](https://github.com/mark3labs/kit/blob/master/examples/extensions/lsp-diagnostics.go) | LSP diagnostic integration |\n\n## Bridged SDK APIs\n\nThese examples demonstrate the new bridged SDK APIs that give extensions access to internal Kit capabilities:\n\n| Extension | Description |\n|-----------|-------------|\n| [`bridge-demo.go`](https://github.com/mark3labs/kit/blob/master/examples/extensions/bridge_demo.go) | Comprehensive demo of all bridged APIs — tree navigation, skill loading, template parsing, and model resolution |\n| [`conversation-manager.go`](https://github.com/mark3labs/kit/blob/master/examples/extensions/conversation-manager.go) | Tree navigation (`GetTreeNode`, `GetCurrentBranch`, `NavigateTo`), branch summarization (`SummarizeBranch`), and fresh context loops (`CollapseBranch`) |\n| [`prompt-templates.go`](https://github.com/mark3labs/kit/blob/master/examples/extensions/prompt-templates.go) | Frontmatter-driven templates with model fallback chains (`ResolveModelChain`), skill injection (`InjectSkillAsContext`), and template parsing (`ParseTemplate`, `RenderTemplate`) |\n\n## Themes\n\n| Extension | Description |\n|-----------|-------------|\n| [`neon-theme.go`](https://github.com/mark3labs/kit/blob/master/examples/extensions/neon-theme.go) | Custom theme registration and switching |\n\n## Multi-agent\n\n| Extension | Description |\n|-----------|-------------|\n| [`ki"}],x0={};function S0(u){return u>=200&&u<300?"#22c55e":u>=400&&u<500?"#f59e0b":u>=500?"#ef4444":"#6b7280"}function T0(u,h,d,c){let v=h;for(const[M,O]of Object.entries(d))v=v.replace(`{${M}}`,encodeURIComponent(O));const E=new URL(v,u);for(const[M,O]of Object.entries(c))O&&E.searchParams.set(M,O);return E.toString()}function E0(u){return u==="bearer"?"Authorization":"X-API-Key"}const Fu={width:"100%",padding:"6px 10px",border:"1px solid var(--bd)",borderRadius:4,background:"var(--bg)",color:"var(--tx)",fontSize:13,fontFamily:"var(--font-code, monospace)",boxSizing:"border-box"};function Ju({param:u,value:h,onChange:d}){return s.jsxs("div",{style:{marginBottom:10},children:[s.jsxs("label",{style:{display:"block",fontSize:12,fontWeight:600,marginBottom:3,color:"var(--tx)"},children:[u.name,u.required&&s.jsx("span",{style:{color:"#ef4444",marginLeft:2},children:"*"}),s.jsxs("span",{style:{fontWeight:400,color:"var(--txM)",marginLeft:6,fontSize:11},children:[u.in," · ",u.type]})]}),s.jsx("input",{"data-testid":`param-input-${u.name}`,style:Fu,placeholder:u.description||u.name,value:h,onChange:c=>d(c.target.value)})]})}function z0({endpoint:u,baseUrl:h,auth:d}){var lt;const[c,v]=w.useState(!1),[E,M]=w.useState({}),[O,C]=w.useState((lt=u.requestBody)!=null&<.schema?JSON.stringify(u.requestBody.schema,null,2):""),[y,G]=w.useState(""),[R,K]=w.useState(!1),[nt,xt]=w.useState(null),[Dt,jt]=w.useState(null),[W,I]=w.useState(!1),ct=(P,mt)=>M(tt=>({...tt,[P]:mt})),Q=u.parameters.filter(P=>P.in==="path"),Y=u.parameters.filter(P=>P.in==="query"),H=u.parameters.filter(P=>P.in==="header"),U=u.requestBody!=null,at=async()=>{K(!0),xt(null),jt(null);const P={};for(const Mt of Q)P[Mt.name]=E[Mt.name]||"";const mt={};for(const Mt of Y)E[Mt.name]&&(mt[Mt.name]=E[Mt.name]);const tt={};for(const Mt of H)E[Mt.name]&&(tt[Mt.name]=E[Mt.name]);if(U&&(tt["Content-Type"]="application/json"),d&&y){const Mt=d.header||E0(d.type);tt[Mt]=d.type==="bearer"?`Bearer ${y}`:y}try{const Mt=T0(h,u.path,P,mt),$t=Date.now(),ft=await fetch(Mt,{method:u.method.toUpperCase(),headers:tt,body:U&&O?O:void 0}),A=Date.now()-$t,B={};ft.headers.forEach((Tt,m)=>{B[m]=Tt});let Z;if((ft.headers.get("content-type")||"").includes("json")){const Tt=await ft.json();Z=JSON.stringify(Tt,null,2)}else Z=await ft.text();xt({status:ft.status,statusText:ft.statusText,headers:B,body:Z,time:A})}catch(Mt){jt(Mt instanceof Error?Mt.message:"Network error")}finally{K(!1)}};return s.jsxs("div",{"data-testid":"api-playground",style:{border:"1px solid var(--bd)",borderRadius:6,overflow:"hidden",marginTop:8},children:[s.jsxs("button",{"data-testid":"playground-toggle",onClick:()=>v(!c),style:{display:"flex",alignItems:"center",gap:8,width:"100%",padding:"10px 14px",background:"var(--sf)",border:"none",cursor:"pointer",fontFamily:"inherit",fontSize:13,fontWeight:600,color:"var(--ac)"},children:[s.jsx("span",{style:{fontSize:14},children:c?"▼":"▶"}),"Try it out"]}),c&&s.jsxs("div",{style:{padding:"14px 16px",borderTop:"1px solid var(--bd)"},children:[d&&s.jsxs("div",{style:{marginBottom:12},children:[s.jsx("label",{style:{display:"block",fontSize:12,fontWeight:600,marginBottom:3,color:"var(--tx)"},children:d.type==="bearer"?"Bearer Token":"API Key"}),s.jsx("input",{"data-testid":"auth-input",type:"password",style:Fu,placeholder:d.type==="bearer"?"Enter bearer token":"Enter API key",value:y,onChange:P=>G(P.target.value)})]}),Q.length>0&&s.jsxs("div",{style:{marginBottom:4},children:[s.jsx("div",{style:{fontSize:11,fontWeight:700,textTransform:"uppercase",color:"var(--txM)",marginBottom:6,letterSpacing:"0.05em"},children:"Path Parameters"}),Q.map(P=>s.jsx(Ju,{param:P,value:E[P.name]||"",onChange:mt=>ct(P.name,mt)},P.name))]}),Y.length>0&&s.jsxs("div",{style:{marginBottom:4},children:[s.jsx("div",{style:{fontSize:11,fontWeight:700,textTransform:"uppercase",color:"var(--txM)",marginBottom:6,letterSpacing:"0.05em"},children:"Query Parameters"}),Y.map(P=>s.jsx(Ju,{param:P,value:E[P.name]||"",onChange:mt=>ct(P.name,mt)},P.name))]}),H.length>0&&s.jsxs("div",{style:{marginBottom:4},children:[s.jsx("div",{style:{fontSize:11,fontWeight:700,textTransform:"uppercase",color:"var(--txM)",marginBottom:6,letterSpacing:"0.05em"},children:"Header Parameters"}),H.map(P=>s.jsx(Ju,{param:P,value:E[P.name]||"",onChange:mt=>ct(P.name,mt)},P.name))]}),U&&s.jsxs("div",{style:{marginBottom:12},children:[s.jsx("label",{style:{display:"block",fontSize:12,fontWeight:600,marginBottom:3,color:"var(--tx)"},children:"Request Body"}),s.jsx("textarea",{"data-testid":"request-body",style:{...Fu,minHeight:100,resize:"vertical",lineHeight:1.5},value:O,onChange:P=>C(P.target.value)})]}),s.jsx("button",{"data-testid":"send-request",onClick:at,disabled:R,style:{padding:"8px 20px",borderRadius:4,border:"none",background:"var(--ac)",color:"#fff",fontWeight:600,fontSize:13,cursor:R?"wait":"pointer",opacity:R?.7:1,fontFamily:"inherit"},children:R?"Sending...":"Send Request"}),Dt&&s.jsx("div",{"data-testid":"playground-error",style:{marginTop:12,padding:"10px 14px",borderRadius:4,background:"#ef444418",border:"1px solid #ef444444",color:"#ef4444",fontSize:13},children:Dt}),nt&&s.jsxs("div",{"data-testid":"playground-response",style:{marginTop:12},children:[s.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10,marginBottom:8},children:[s.jsxs("span",{"data-testid":"response-status",style:{padding:"2px 10px",borderRadius:4,fontSize:13,fontWeight:700,fontFamily:"var(--font-code, monospace)",color:"#fff",background:S0(nt.status)},children:[nt.status," ",nt.statusText]}),s.jsxs("span",{style:{fontSize:12,color:"var(--txM)"},children:[nt.time,"ms"]})]}),s.jsxs("button",{"data-testid":"toggle-headers",onClick:()=>I(!W),style:{display:"flex",alignItems:"center",gap:4,background:"none",border:"none",cursor:"pointer",fontSize:12,color:"var(--txM)",padding:"4px 0",fontFamily:"inherit",marginBottom:4},children:[s.jsx("span",{style:{transform:W?"rotate(90deg)":"rotate(0)",transition:"transform 0.15s"},children:"▶"}),"Response Headers"]}),W&&s.jsx("pre",{style:{background:"var(--sf)",padding:10,borderRadius:4,fontSize:11,fontFamily:"var(--font-code, monospace)",overflow:"auto",lineHeight:1.5,marginBottom:8,color:"var(--tx2)",margin:"0 0 8px 0"},children:Object.entries(nt.headers).map(([P,mt])=>`${P}: ${mt}`).join(`
-`)}),s.jsx("pre",{"data-testid":"response-body",style:{background:"var(--cdBg)",color:"var(--cdTx)",padding:14,borderRadius:6,fontSize:12,fontFamily:"var(--font-code, monospace)",overflow:"auto",lineHeight:1.6,margin:0,maxHeight:400},children:nt.body})]})]})]})}function mm({samples:u}){var c;const[h,d]=w.useState(0);return u.length===0?null:s.jsxs("div",{"data-testid":"code-samples",style:{border:"1px solid var(--bd)",borderRadius:8,overflow:"hidden"},children:[s.jsx("div",{style:{display:"flex",borderBottom:"1px solid var(--bd)",background:"var(--sf)",overflowX:"auto",WebkitOverflowScrolling:"touch"},children:u.map((v,E)=>s.jsx("button",{onClick:()=>d(E),style:{padding:"8px 16px",fontSize:13,fontWeight:500,background:E===h?"var(--cdBg)":"transparent",color:E===h?"var(--tx)":"var(--tx2)",border:"none",borderBottom:E===h?"2px solid var(--ac)":"2px solid transparent",cursor:"pointer",fontFamily:"var(--font-body)",whiteSpace:"nowrap"},children:v.label},v.language))}),s.jsx("pre",{style:{margin:0,padding:16,background:"var(--cdBg)",overflow:"auto"},children:s.jsx("code",{style:{fontSize:13,fontFamily:"var(--font-code)"},children:(c=u[h])==null?void 0:c.code})})]})}const pm={get:"#22c55e",post:"#3b82f6",put:"#f59e0b",delete:"#ef4444",patch:"#a78bfa",head:"#6b7280",options:"#6b7280"};function C0({method:u}){const h=pm[u.toLowerCase()]||"#6b7280";return s.jsx("span",{"data-testid":"method-badge",style:{display:"inline-block",padding:"2px 8px",borderRadius:4,fontSize:11,fontWeight:700,fontFamily:"var(--font-code, monospace)",textTransform:"uppercase",color:"#fff",background:h,letterSpacing:"0.05em"},children:u.toUpperCase()})}function A0({parameters:u}){return u.length===0?null:s.jsx("div",{style:{overflowX:"auto",marginBottom:16},children:s.jsxs("table",{style:{width:"100%",borderCollapse:"collapse",fontSize:13,lineHeight:1.5},children:[s.jsx("thead",{children:s.jsxs("tr",{style:{borderBottom:"2px solid var(--bd)",textAlign:"left"},children:[s.jsx("th",{style:{padding:"8px 12px",fontWeight:600,color:"var(--tx)"},children:"Name"}),s.jsx("th",{style:{padding:"8px 12px",fontWeight:600,color:"var(--tx)"},children:"Type"}),s.jsx("th",{style:{padding:"8px 12px",fontWeight:600,color:"var(--tx)"},children:"In"}),s.jsx("th",{style:{padding:"8px 12px",fontWeight:600,color:"var(--tx)"},children:"Required"}),s.jsx("th",{style:{padding:"8px 12px",fontWeight:600,color:"var(--tx)"},children:"Description"})]})}),s.jsx("tbody",{children:u.map((h,d)=>s.jsxs("tr",{style:{borderBottom:"1px solid var(--bd)"},children:[s.jsx("td",{style:{padding:"8px 12px",fontFamily:"var(--font-code, monospace)",fontWeight:500,color:h.in==="path"?"var(--ac)":"var(--tx)"},children:h.name}),s.jsx("td",{style:{padding:"8px 12px",fontFamily:"var(--font-code, monospace)",color:"var(--tx2)"},children:h.type}),s.jsx("td",{style:{padding:"8px 12px",color:"var(--txM)"},children:s.jsx("span",{style:{padding:"1px 6px",borderRadius:3,fontSize:11,background:h.in==="path"?"var(--ac)22":"var(--sf)",color:h.in==="path"?"var(--ac)":"var(--txM)"},children:h.in})}),s.jsx("td",{style:{padding:"8px 12px"},children:h.required?s.jsx("span",{"data-testid":"required-badge",style:{padding:"1px 6px",borderRadius:3,fontSize:11,fontWeight:600,background:"#ef444422",color:"#ef4444"},children:"required"}):s.jsx("span",{style:{color:"var(--txM)",fontSize:12},children:"optional"})}),s.jsx("td",{style:{padding:"8px 12px",color:"var(--tx2)"},children:h.description||"—"})]},`${h.name}-${d}`))})]})})}function j0({requestBody:u}){return s.jsxs("div",{style:{marginBottom:16},children:[s.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,marginBottom:8},children:[s.jsx("span",{style:{padding:"2px 8px",borderRadius:4,fontSize:11,fontFamily:"var(--font-code, monospace)",background:"var(--sf)",color:"var(--tx2)"},children:u.contentType}),u.required&&s.jsx("span",{style:{padding:"1px 6px",borderRadius:3,fontSize:11,fontWeight:600,background:"#ef444422",color:"#ef4444"},children:"required"})]}),u.description&&s.jsx("p",{style:{fontSize:13,color:"var(--tx2)",marginBottom:8,marginTop:0},children:u.description}),u.schema&&s.jsx("pre",{style:{background:"var(--cdBg)",color:"var(--cdTx)",padding:16,borderRadius:6,fontSize:12,fontFamily:"var(--font-code, monospace)",overflow:"auto",lineHeight:1.6,margin:0},children:JSON.stringify(u.schema,null,2)})]})}function M0(u){return u.startsWith("2")?"#22c55e":u.startsWith("4")?"#f59e0b":u.startsWith("5")?"#ef4444":"#6b7280"}function k0({responses:u}){return u.length===0?null:s.jsx("div",{style:{marginBottom:16},children:u.map((h,d)=>{const c=M0(h.statusCode);return s.jsxs("div",{style:{border:"1px solid var(--bd)",borderRadius:6,marginBottom:8,overflow:"hidden"},children:[s.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,padding:"10px 14px",background:"var(--sf)"},children:[s.jsx("span",{"data-testid":"status-badge",style:{padding:"2px 8px",borderRadius:4,fontSize:12,fontWeight:700,fontFamily:"var(--font-code, monospace)",color:"#fff",background:c},children:h.statusCode}),s.jsx("span",{style:{fontSize:13,color:"var(--tx2)"},children:h.description})]}),h.schema&&s.jsx("pre",{style:{background:"var(--cdBg)",color:"var(--cdTx)",padding:14,fontSize:12,fontFamily:"var(--font-code, monospace)",overflow:"auto",lineHeight:1.6,margin:0,borderTop:"1px solid var(--bd)"},children:JSON.stringify(h.schema,null,2)})]},`${h.statusCode}-${d}`)})})}function _0(u,h){const d=h+u.path,c=[`curl -X ${u.method.toUpperCase()} "${d}"`],v=u.parameters.filter(E=>E.in==="header");for(const E of v)c.push(` -H "${E.name}: "`);return u.requestBody&&(c.push(` -H "Content-Type: ${u.requestBody.contentType}"`),u.requestBody.schema&&c.push(` -d '${JSON.stringify(u.requestBody.schema,null,2)}'`)),c.join(` \\
-`)}function D0(u,h){var M;const d=h+u.path,c=[];c.push(` method: "${u.method.toUpperCase()}",`);const v={},E=u.parameters.filter(O=>O.in==="header");for(const O of E)v[O.name]="";return u.requestBody&&(v["Content-Type"]=u.requestBody.contentType),Object.keys(v).length>0&&c.push(` headers: ${JSON.stringify(v,null,4).replace(/\n/g,`
+`},{id:"extensions/examples",title:"Examples",content:"\n# Extension Examples\n\nKit ships with a rich set of example extensions in the `examples/extensions/` directory. These serve as both documentation and starting points for your own extensions.\n\n## UI and display\n\n| Extension | Description |\n|-----------|-------------|\n| [`minimal.go`](https://github.com/mark3labs/kit/blob/master/examples/extensions/minimal.go) | Clean UI with custom footer |\n| [`branded-output.go`](https://github.com/mark3labs/kit/blob/master/examples/extensions/branded-output.go) | Branded output rendering |\n| [`header-footer-demo.go`](https://github.com/mark3labs/kit/blob/master/examples/extensions/header-footer-demo.go) | Custom headers and footers |\n| [`widget-status.go`](https://github.com/mark3labs/kit/blob/master/examples/extensions/widget-status.go) | Persistent status widgets |\n| [`overlay-demo.go`](https://github.com/mark3labs/kit/blob/master/examples/extensions/overlay-demo.go) | Modal dialogs |\n| [`tool-renderer-demo.go`](https://github.com/mark3labs/kit/blob/master/examples/extensions/tool-renderer-demo.go) | Custom tool call rendering |\n| [`custom-editor-demo.go`](https://github.com/mark3labs/kit/blob/master/examples/extensions/custom-editor-demo.go) | Vim-like modal editor |\n| [`pirate.go`](https://github.com/mark3labs/kit/blob/master/examples/extensions/pirate.go) | Pirate-themed personality |\n\n## Workflow and automation\n\n| Extension | Description |\n|-----------|-------------|\n| [`auto-commit.go`](https://github.com/mark3labs/kit/blob/master/examples/extensions/auto-commit.go) | Auto-commit changes on shutdown |\n| [`plan-mode.go`](https://github.com/mark3labs/kit/blob/master/examples/extensions/plan-mode.go) | Read-only planning mode |\n| [`permission-gate.go`](https://github.com/mark3labs/kit/blob/master/examples/extensions/permission-gate.go) | Permission gating for destructive tools |\n| [`confirm-destructive.go`](https://github.com/mark3labs/kit/blob/master/examples/extensions/confirm-destructive.go) | Confirm destructive operations |\n| [`protected-paths.go`](https://github.com/mark3labs/kit/blob/master/examples/extensions/protected-paths.go) | Path protection for sensitive files |\n| [`project-rules.go`](https://github.com/mark3labs/kit/blob/master/examples/extensions/project-rules.go) | Project-specific rules injection |\n| [`compact-notify.go`](https://github.com/mark3labs/kit/blob/master/examples/extensions/compact-notify.go) | Notification on conversation compaction |\n\n## Interactive features\n\n| Extension | Description |\n|-----------|-------------|\n| [`prompt-demo.go`](https://github.com/mark3labs/kit/blob/master/examples/extensions/prompt-demo.go) | Interactive prompts (select/confirm/input) |\n| [`bookmark.go`](https://github.com/mark3labs/kit/blob/master/examples/extensions/bookmark.go) | Bookmark conversations |\n| [`inline-bash.go`](https://github.com/mark3labs/kit/blob/master/examples/extensions/inline-bash.go) | Inline bash execution |\n| [`interactive-shell.go`](https://github.com/mark3labs/kit/blob/master/examples/extensions/interactive-shell.go) | Interactive shell integration |\n| [`notify.go`](https://github.com/mark3labs/kit/blob/master/examples/extensions/notify.go) | Desktop notifications |\n\n## Agent and context\n\n| Extension | Description |\n|-----------|-------------|\n| [`tool-logger.go`](https://github.com/mark3labs/kit/blob/master/examples/extensions/tool-logger.go) | Log all tool calls |\n| [`context-inject.go`](https://github.com/mark3labs/kit/blob/master/examples/extensions/context-inject.go) | Inject context into conversations |\n| [`summarize.go`](https://github.com/mark3labs/kit/blob/master/examples/extensions/summarize.go) | Conversation summarization |\n| [`lsp-diagnostics.go`](https://github.com/mark3labs/kit/blob/master/examples/extensions/lsp-diagnostics.go) | LSP dia"}],x0={};function S0(u){return u>=200&&u<300?"#22c55e":u>=400&&u<500?"#f59e0b":u>=500?"#ef4444":"#6b7280"}function T0(u,p,d,c){let v=p;for(const[M,O]of Object.entries(d))v=v.replace(`{${M}}`,encodeURIComponent(O));const E=new URL(v,u);for(const[M,O]of Object.entries(c))O&&E.searchParams.set(M,O);return E.toString()}function E0(u){return u==="bearer"?"Authorization":"X-API-Key"}const Fu={width:"100%",padding:"6px 10px",border:"1px solid var(--bd)",borderRadius:4,background:"var(--bg)",color:"var(--tx)",fontSize:13,fontFamily:"var(--font-code, monospace)",boxSizing:"border-box"};function Ju({param:u,value:p,onChange:d}){return s.jsxs("div",{style:{marginBottom:10},children:[s.jsxs("label",{style:{display:"block",fontSize:12,fontWeight:600,marginBottom:3,color:"var(--tx)"},children:[u.name,u.required&&s.jsx("span",{style:{color:"#ef4444",marginLeft:2},children:"*"}),s.jsxs("span",{style:{fontWeight:400,color:"var(--txM)",marginLeft:6,fontSize:11},children:[u.in," · ",u.type]})]}),s.jsx("input",{"data-testid":`param-input-${u.name}`,style:Fu,placeholder:u.description||u.name,value:p,onChange:c=>d(c.target.value)})]})}function z0({endpoint:u,baseUrl:p,auth:d}){var lt;const[c,v]=w.useState(!1),[E,M]=w.useState({}),[O,C]=w.useState((lt=u.requestBody)!=null&<.schema?JSON.stringify(u.requestBody.schema,null,2):""),[y,G]=w.useState(""),[R,K]=w.useState(!1),[nt,xt]=w.useState(null),[Dt,At]=w.useState(null),[W,I]=w.useState(!1),ct=(P,mt)=>M(tt=>({...tt,[P]:mt})),Q=u.parameters.filter(P=>P.in==="path"),Y=u.parameters.filter(P=>P.in==="query"),H=u.parameters.filter(P=>P.in==="header"),U=u.requestBody!=null,at=async()=>{K(!0),xt(null),At(null);const P={};for(const Mt of Q)P[Mt.name]=E[Mt.name]||"";const mt={};for(const Mt of Y)E[Mt.name]&&(mt[Mt.name]=E[Mt.name]);const tt={};for(const Mt of H)E[Mt.name]&&(tt[Mt.name]=E[Mt.name]);if(U&&(tt["Content-Type"]="application/json"),d&&y){const Mt=d.header||E0(d.type);tt[Mt]=d.type==="bearer"?`Bearer ${y}`:y}try{const Mt=T0(p,u.path,P,mt),$t=Date.now(),ft=await fetch(Mt,{method:u.method.toUpperCase(),headers:tt,body:U&&O?O:void 0}),j=Date.now()-$t,B={};ft.headers.forEach((Tt,m)=>{B[m]=Tt});let Z;if((ft.headers.get("content-type")||"").includes("json")){const Tt=await ft.json();Z=JSON.stringify(Tt,null,2)}else Z=await ft.text();xt({status:ft.status,statusText:ft.statusText,headers:B,body:Z,time:j})}catch(Mt){At(Mt instanceof Error?Mt.message:"Network error")}finally{K(!1)}};return s.jsxs("div",{"data-testid":"api-playground",style:{border:"1px solid var(--bd)",borderRadius:6,overflow:"hidden",marginTop:8},children:[s.jsxs("button",{"data-testid":"playground-toggle",onClick:()=>v(!c),style:{display:"flex",alignItems:"center",gap:8,width:"100%",padding:"10px 14px",background:"var(--sf)",border:"none",cursor:"pointer",fontFamily:"inherit",fontSize:13,fontWeight:600,color:"var(--ac)"},children:[s.jsx("span",{style:{fontSize:14},children:c?"▼":"▶"}),"Try it out"]}),c&&s.jsxs("div",{style:{padding:"14px 16px",borderTop:"1px solid var(--bd)"},children:[d&&s.jsxs("div",{style:{marginBottom:12},children:[s.jsx("label",{style:{display:"block",fontSize:12,fontWeight:600,marginBottom:3,color:"var(--tx)"},children:d.type==="bearer"?"Bearer Token":"API Key"}),s.jsx("input",{"data-testid":"auth-input",type:"password",style:Fu,placeholder:d.type==="bearer"?"Enter bearer token":"Enter API key",value:y,onChange:P=>G(P.target.value)})]}),Q.length>0&&s.jsxs("div",{style:{marginBottom:4},children:[s.jsx("div",{style:{fontSize:11,fontWeight:700,textTransform:"uppercase",color:"var(--txM)",marginBottom:6,letterSpacing:"0.05em"},children:"Path Parameters"}),Q.map(P=>s.jsx(Ju,{param:P,value:E[P.name]||"",onChange:mt=>ct(P.name,mt)},P.name))]}),Y.length>0&&s.jsxs("div",{style:{marginBottom:4},children:[s.jsx("div",{style:{fontSize:11,fontWeight:700,textTransform:"uppercase",color:"var(--txM)",marginBottom:6,letterSpacing:"0.05em"},children:"Query Parameters"}),Y.map(P=>s.jsx(Ju,{param:P,value:E[P.name]||"",onChange:mt=>ct(P.name,mt)},P.name))]}),H.length>0&&s.jsxs("div",{style:{marginBottom:4},children:[s.jsx("div",{style:{fontSize:11,fontWeight:700,textTransform:"uppercase",color:"var(--txM)",marginBottom:6,letterSpacing:"0.05em"},children:"Header Parameters"}),H.map(P=>s.jsx(Ju,{param:P,value:E[P.name]||"",onChange:mt=>ct(P.name,mt)},P.name))]}),U&&s.jsxs("div",{style:{marginBottom:12},children:[s.jsx("label",{style:{display:"block",fontSize:12,fontWeight:600,marginBottom:3,color:"var(--tx)"},children:"Request Body"}),s.jsx("textarea",{"data-testid":"request-body",style:{...Fu,minHeight:100,resize:"vertical",lineHeight:1.5},value:O,onChange:P=>C(P.target.value)})]}),s.jsx("button",{"data-testid":"send-request",onClick:at,disabled:R,style:{padding:"8px 20px",borderRadius:4,border:"none",background:"var(--ac)",color:"#fff",fontWeight:600,fontSize:13,cursor:R?"wait":"pointer",opacity:R?.7:1,fontFamily:"inherit"},children:R?"Sending...":"Send Request"}),Dt&&s.jsx("div",{"data-testid":"playground-error",style:{marginTop:12,padding:"10px 14px",borderRadius:4,background:"#ef444418",border:"1px solid #ef444444",color:"#ef4444",fontSize:13},children:Dt}),nt&&s.jsxs("div",{"data-testid":"playground-response",style:{marginTop:12},children:[s.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10,marginBottom:8},children:[s.jsxs("span",{"data-testid":"response-status",style:{padding:"2px 10px",borderRadius:4,fontSize:13,fontWeight:700,fontFamily:"var(--font-code, monospace)",color:"#fff",background:S0(nt.status)},children:[nt.status," ",nt.statusText]}),s.jsxs("span",{style:{fontSize:12,color:"var(--txM)"},children:[nt.time,"ms"]})]}),s.jsxs("button",{"data-testid":"toggle-headers",onClick:()=>I(!W),style:{display:"flex",alignItems:"center",gap:4,background:"none",border:"none",cursor:"pointer",fontSize:12,color:"var(--txM)",padding:"4px 0",fontFamily:"inherit",marginBottom:4},children:[s.jsx("span",{style:{transform:W?"rotate(90deg)":"rotate(0)",transition:"transform 0.15s"},children:"▶"}),"Response Headers"]}),W&&s.jsx("pre",{style:{background:"var(--sf)",padding:10,borderRadius:4,fontSize:11,fontFamily:"var(--font-code, monospace)",overflow:"auto",lineHeight:1.5,marginBottom:8,color:"var(--tx2)",margin:"0 0 8px 0"},children:Object.entries(nt.headers).map(([P,mt])=>`${P}: ${mt}`).join(`
+`)}),s.jsx("pre",{"data-testid":"response-body",style:{background:"var(--cdBg)",color:"var(--cdTx)",padding:14,borderRadius:6,fontSize:12,fontFamily:"var(--font-code, monospace)",overflow:"auto",lineHeight:1.6,margin:0,maxHeight:400},children:nt.body})]})]})]})}function mm({samples:u}){var c;const[p,d]=w.useState(0);return u.length===0?null:s.jsxs("div",{"data-testid":"code-samples",style:{border:"1px solid var(--bd)",borderRadius:8,overflow:"hidden"},children:[s.jsx("div",{style:{display:"flex",borderBottom:"1px solid var(--bd)",background:"var(--sf)",overflowX:"auto",WebkitOverflowScrolling:"touch"},children:u.map((v,E)=>s.jsx("button",{onClick:()=>d(E),style:{padding:"8px 16px",fontSize:13,fontWeight:500,background:E===p?"var(--cdBg)":"transparent",color:E===p?"var(--tx)":"var(--tx2)",border:"none",borderBottom:E===p?"2px solid var(--ac)":"2px solid transparent",cursor:"pointer",fontFamily:"var(--font-body)",whiteSpace:"nowrap"},children:v.label},v.language))}),s.jsx("pre",{style:{margin:0,padding:16,background:"var(--cdBg)",overflow:"auto"},children:s.jsx("code",{style:{fontSize:13,fontFamily:"var(--font-code)"},children:(c=u[p])==null?void 0:c.code})})]})}const hm={get:"#22c55e",post:"#3b82f6",put:"#f59e0b",delete:"#ef4444",patch:"#a78bfa",head:"#6b7280",options:"#6b7280"};function C0({method:u}){const p=hm[u.toLowerCase()]||"#6b7280";return s.jsx("span",{"data-testid":"method-badge",style:{display:"inline-block",padding:"2px 8px",borderRadius:4,fontSize:11,fontWeight:700,fontFamily:"var(--font-code, monospace)",textTransform:"uppercase",color:"#fff",background:p,letterSpacing:"0.05em"},children:u.toUpperCase()})}function j0({parameters:u}){return u.length===0?null:s.jsx("div",{style:{overflowX:"auto",marginBottom:16},children:s.jsxs("table",{style:{width:"100%",borderCollapse:"collapse",fontSize:13,lineHeight:1.5},children:[s.jsx("thead",{children:s.jsxs("tr",{style:{borderBottom:"2px solid var(--bd)",textAlign:"left"},children:[s.jsx("th",{style:{padding:"8px 12px",fontWeight:600,color:"var(--tx)"},children:"Name"}),s.jsx("th",{style:{padding:"8px 12px",fontWeight:600,color:"var(--tx)"},children:"Type"}),s.jsx("th",{style:{padding:"8px 12px",fontWeight:600,color:"var(--tx)"},children:"In"}),s.jsx("th",{style:{padding:"8px 12px",fontWeight:600,color:"var(--tx)"},children:"Required"}),s.jsx("th",{style:{padding:"8px 12px",fontWeight:600,color:"var(--tx)"},children:"Description"})]})}),s.jsx("tbody",{children:u.map((p,d)=>s.jsxs("tr",{style:{borderBottom:"1px solid var(--bd)"},children:[s.jsx("td",{style:{padding:"8px 12px",fontFamily:"var(--font-code, monospace)",fontWeight:500,color:p.in==="path"?"var(--ac)":"var(--tx)"},children:p.name}),s.jsx("td",{style:{padding:"8px 12px",fontFamily:"var(--font-code, monospace)",color:"var(--tx2)"},children:p.type}),s.jsx("td",{style:{padding:"8px 12px",color:"var(--txM)"},children:s.jsx("span",{style:{padding:"1px 6px",borderRadius:3,fontSize:11,background:p.in==="path"?"var(--ac)22":"var(--sf)",color:p.in==="path"?"var(--ac)":"var(--txM)"},children:p.in})}),s.jsx("td",{style:{padding:"8px 12px"},children:p.required?s.jsx("span",{"data-testid":"required-badge",style:{padding:"1px 6px",borderRadius:3,fontSize:11,fontWeight:600,background:"#ef444422",color:"#ef4444"},children:"required"}):s.jsx("span",{style:{color:"var(--txM)",fontSize:12},children:"optional"})}),s.jsx("td",{style:{padding:"8px 12px",color:"var(--tx2)"},children:p.description||"—"})]},`${p.name}-${d}`))})]})})}function A0({requestBody:u}){return s.jsxs("div",{style:{marginBottom:16},children:[s.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,marginBottom:8},children:[s.jsx("span",{style:{padding:"2px 8px",borderRadius:4,fontSize:11,fontFamily:"var(--font-code, monospace)",background:"var(--sf)",color:"var(--tx2)"},children:u.contentType}),u.required&&s.jsx("span",{style:{padding:"1px 6px",borderRadius:3,fontSize:11,fontWeight:600,background:"#ef444422",color:"#ef4444"},children:"required"})]}),u.description&&s.jsx("p",{style:{fontSize:13,color:"var(--tx2)",marginBottom:8,marginTop:0},children:u.description}),u.schema&&s.jsx("pre",{style:{background:"var(--cdBg)",color:"var(--cdTx)",padding:16,borderRadius:6,fontSize:12,fontFamily:"var(--font-code, monospace)",overflow:"auto",lineHeight:1.6,margin:0},children:JSON.stringify(u.schema,null,2)})]})}function M0(u){return u.startsWith("2")?"#22c55e":u.startsWith("4")?"#f59e0b":u.startsWith("5")?"#ef4444":"#6b7280"}function k0({responses:u}){return u.length===0?null:s.jsx("div",{style:{marginBottom:16},children:u.map((p,d)=>{const c=M0(p.statusCode);return s.jsxs("div",{style:{border:"1px solid var(--bd)",borderRadius:6,marginBottom:8,overflow:"hidden"},children:[s.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,padding:"10px 14px",background:"var(--sf)"},children:[s.jsx("span",{"data-testid":"status-badge",style:{padding:"2px 8px",borderRadius:4,fontSize:12,fontWeight:700,fontFamily:"var(--font-code, monospace)",color:"#fff",background:c},children:p.statusCode}),s.jsx("span",{style:{fontSize:13,color:"var(--tx2)"},children:p.description})]}),p.schema&&s.jsx("pre",{style:{background:"var(--cdBg)",color:"var(--cdTx)",padding:14,fontSize:12,fontFamily:"var(--font-code, monospace)",overflow:"auto",lineHeight:1.6,margin:0,borderTop:"1px solid var(--bd)"},children:JSON.stringify(p.schema,null,2)})]},`${p.statusCode}-${d}`)})})}function _0(u,p){const d=p+u.path,c=[`curl -X ${u.method.toUpperCase()} "${d}"`],v=u.parameters.filter(E=>E.in==="header");for(const E of v)c.push(` -H "${E.name}: "`);return u.requestBody&&(c.push(` -H "Content-Type: ${u.requestBody.contentType}"`),u.requestBody.schema&&c.push(` -d '${JSON.stringify(u.requestBody.schema,null,2)}'`)),c.join(` \\
+`)}function D0(u,p){var M;const d=p+u.path,c=[];c.push(` method: "${u.method.toUpperCase()}",`);const v={},E=u.parameters.filter(O=>O.in==="header");for(const O of E)v[O.name]="";return u.requestBody&&(v["Content-Type"]=u.requestBody.contentType),Object.keys(v).length>0&&c.push(` headers: ${JSON.stringify(v,null,4).replace(/\n/g,`
`)},`),(M=u.requestBody)!=null&&M.schema&&c.push(` body: JSON.stringify(${JSON.stringify(u.requestBody.schema,null,4).replace(/\n/g,`
`)}),`),`fetch("${d}", {
${c.join(`
`)}
-});`}function O0(u,h){var O,C;const d=h+u.path,c=["import requests",""],v={},E=u.parameters.filter(y=>y.in==="header");for(const y of E)v[y.name]="";u.requestBody&&(v["Content-Type"]=u.requestBody.contentType),Object.keys(v).length>0&&(c.push(`headers = ${JSON.stringify(v,null,4)}`),c.push("")),(O=u.requestBody)!=null&&O.schema&&(c.push(`data = ${JSON.stringify(u.requestBody.schema,null,4)}`),c.push(""));const M=[`"${d}"`];return Object.keys(v).length>0&&M.push("headers=headers"),(C=u.requestBody)!=null&&C.schema&&M.push("json=data"),c.push(`response = requests.${u.method}(${M.join(", ")})`),c.push("print(response.json())"),c.join(`
-`)}function R0(u,h){var E,M;const d=h+u.path,c=["package main","","import (",' "fmt"',' "net/http"'];(E=u.requestBody)!=null&&E.schema&&c.push(' "bytes"',' "encoding/json"'),c.push(' "io"',")",""),c.push("func main() {"),(M=u.requestBody)!=null&&M.schema?(c.push(` body, _ := json.Marshal(${JSON.stringify(u.requestBody.schema)})`),c.push(` req, _ := http.NewRequest("${u.method.toUpperCase()}", "${d}", bytes.NewBuffer(body))`)):c.push(` req, _ := http.NewRequest("${u.method.toUpperCase()}", "${d}", nil)`);const v=u.parameters.filter(O=>O.in==="header");for(const O of v)c.push(` req.Header.Set("${O.name}", "")`);return u.requestBody&&c.push(` req.Header.Set("Content-Type", "${u.requestBody.contentType}")`),c.push(" resp, _ := http.DefaultClient.Do(req)"),c.push(" defer resp.Body.Close()"),c.push(" data, _ := io.ReadAll(resp.Body)"),c.push(" fmt.Println(string(data))"),c.push("}"),c.join(`
-`)}function w0(u,h){var E;const d=h+u.path,c=["import java.net.http.*;","import java.net.URI;","","var client = HttpClient.newHttpClient();"];(E=u.requestBody)!=null&&E.schema?(c.push(`var body = ${JSON.stringify(JSON.stringify(u.requestBody.schema))};`),c.push("var request = HttpRequest.newBuilder()"),c.push(` .uri(URI.create("${d}"))`),c.push(` .method("${u.method.toUpperCase()}", HttpRequest.BodyPublishers.ofString(body))`)):(c.push("var request = HttpRequest.newBuilder()"),c.push(` .uri(URI.create("${d}"))`),c.push(` .method("${u.method.toUpperCase()}", HttpRequest.BodyPublishers.noBody())`));const v=u.parameters.filter(M=>M.in==="header");for(const M of v)c.push(` .header("${M.name}", "")`);return u.requestBody&&c.push(` .header("Content-Type", "${u.requestBody.contentType}")`),c.push(" .build();"),c.push(""),c.push("var response = client.send(request, HttpResponse.BodyHandlers.ofString());"),c.push("System.out.println(response.body());"),c.join(`
-`)}function B0(u,h){var E;const d=h+u.path,c=["using var client = new HttpClient();","",`var request = new HttpRequestMessage(HttpMethod.${u.method.charAt(0).toUpperCase()+u.method.slice(1)}, "${d}");`],v=u.parameters.filter(M=>M.in==="header");for(const M of v)c.push(`request.Headers.Add("${M.name}", "");`);return(E=u.requestBody)!=null&&E.schema&&(c.push("request.Content = new StringContent("),c.push(` ${JSON.stringify(JSON.stringify(u.requestBody.schema))},`),c.push(" System.Text.Encoding.UTF8,"),c.push(` "${u.requestBody.contentType}");`)),c.push(""),c.push("var response = await client.SendAsync(request);"),c.push("var body = await response.Content.ReadAsStringAsync();"),c.push("Console.WriteLine(body);"),c.join(`
-`)}function U0({endpoint:u,baseUrl:h="https://api.example.com"}){const[d,c]=w.useState(0),v=["cURL","JavaScript","Python","Go","Java","C#"],E=[_0(u,h),D0(u,h),O0(u,h),R0(u,h),w0(u,h),B0(u,h)];return s.jsxs("div",{style:{marginBottom:16},children:[s.jsx("div",{style:{display:"flex",gap:0,borderBottom:"1px solid var(--bd)",overflowX:"auto",WebkitOverflowScrolling:"touch"},children:v.map((M,O)=>s.jsx("button",{onClick:()=>c(O),style:{padding:"6px 14px",background:"none",border:"none",borderBottom:d===O?"2px solid var(--ac)":"2px solid transparent",color:d===O?"var(--ac)":"var(--txM)",fontWeight:d===O?600:400,fontSize:12,cursor:"pointer",fontFamily:"inherit",whiteSpace:"nowrap"},children:M},M))}),s.jsx("pre",{style:{background:"var(--cdBg)",color:"var(--cdTx)",padding:16,borderRadius:"0 0 6px 6px",fontSize:12,fontFamily:"var(--font-code, monospace)",overflow:"auto",lineHeight:1.6,margin:0},children:E[d]})]})}function H0({endpoint:u,baseUrl:h,defaultExpanded:d=!1,showPlayground:c,playgroundAuth:v}){const[E,M]=w.useState(d),O=(u.operationId||`${u.method}-${u.path}`).toLowerCase().replace(/[^a-z0-9]+/g,"-"),C=u.parameters.length>0||u.requestBody!=null||u.responses.length>0;return s.jsxs("div",{id:O,style:{border:"1px solid var(--bd)",borderRadius:8,marginBottom:12,overflow:"hidden",scrollMarginTop:24},children:[s.jsxs("button",{onClick:()=>C&&M(!E),style:{display:"flex",alignItems:"center",gap:10,width:"100%",padding:"14px 18px",background:"var(--sf)",border:"none",cursor:C?"pointer":"default",textAlign:"left",fontFamily:"inherit",color:"var(--tx)"},children:[s.jsx(C0,{method:u.method}),s.jsx("span",{style:{fontFamily:"var(--font-code, monospace)",fontSize:14,fontWeight:500},children:u.path}),u.deprecated&&s.jsx("span",{"data-testid":"deprecated-badge",style:{padding:"1px 6px",borderRadius:3,fontSize:10,fontWeight:700,background:"#f59e0b33",color:"#f59e0b",textTransform:"uppercase",letterSpacing:"0.05em"},children:"Deprecated"}),u.tags.map(y=>s.jsx("span",{style:{padding:"1px 6px",borderRadius:3,fontSize:10,background:"var(--bd)",color:"var(--txM)"},children:y},y)),s.jsx("span",{style:{flex:1}}),u.summary&&s.jsx("span",{style:{fontSize:13,color:"var(--tx2)",marginRight:8},children:u.summary}),C&&s.jsx("span",{style:{transform:E?"rotate(180deg)":"rotate(0)",transition:"transform 0.2s",fontSize:12,color:"var(--txM)"},children:"▾"})]}),E&&s.jsxs("div",{style:{padding:"16px 18px",borderTop:"1px solid var(--bd)"},children:[u.description&&s.jsx("p",{style:{fontSize:14,color:"var(--tx2)",lineHeight:1.65,marginTop:0,marginBottom:16},children:u.description}),u.parameters.length>0&&s.jsxs("div",{style:{marginBottom:16},children:[s.jsx("h4",{style:{fontSize:13,fontWeight:600,marginBottom:8,color:"var(--tx)"},children:"Parameters"}),s.jsx(A0,{parameters:u.parameters})]}),u.requestBody&&s.jsxs("div",{style:{marginBottom:16},children:[s.jsx("h4",{style:{fontSize:13,fontWeight:600,marginBottom:8,color:"var(--tx)"},children:"Request Body"}),s.jsx(j0,{requestBody:u.requestBody})]}),u.responses.length>0&&s.jsxs("div",{style:{marginBottom:16},children:[s.jsx("h4",{style:{fontSize:13,fontWeight:600,marginBottom:8,color:"var(--tx)"},children:"Responses"}),s.jsx(k0,{responses:u.responses})]}),s.jsxs("div",{children:[s.jsx("h4",{style:{fontSize:13,fontWeight:600,marginBottom:8,color:"var(--tx)"},children:"Code Examples"}),u.codeSamples&&u.codeSamples.length>0?s.jsx(mm,{samples:u.codeSamples}):s.jsx(U0,{endpoint:u,baseUrl:h})]}),c&&s.jsx("div",{style:{marginTop:16},children:s.jsx(z0,{endpoint:u,baseUrl:h||"https://api.example.com",auth:v})})]})]})}function N0({manifest:u,baseUrl:h,showPlayground:d,playgroundAuth:c}){const v=h||(u.servers.length>0?u.servers[0].url:"https://api.example.com"),E=new Map;for(const C of u.endpoints){const y=C.tags.length>0?C.tags[0]:"Other";E.has(y)||E.set(y,[]),E.get(y).push(C)}const M=[];for(const C of u.tags)E.has(C.name)&&M.push(C.name);for(const C of E.keys())M.includes(C)||M.push(C);const O=new Map;for(const C of u.tags)O.set(C.name,C.description);return s.jsxs("div",{style:{display:"flex",gap:32},children:[s.jsxs("nav",{"data-testid":"api-toc",style:{width:200,flexShrink:0,position:"sticky",top:24,alignSelf:"flex-start",maxHeight:"calc(100vh - 48px)",overflowY:"auto"},children:[s.jsx("div",{style:{fontSize:11,fontWeight:700,textTransform:"uppercase",color:"var(--txM)",marginBottom:12,letterSpacing:"0.05em"},children:"Endpoints"}),M.map(C=>{const y=C.toLowerCase().replace(/\s+/g,"-");return s.jsxs("div",{style:{marginBottom:14},children:[s.jsx("a",{href:`#${y}`,onClick:G=>{var R;G.preventDefault(),(R=document.getElementById(y))==null||R.scrollIntoView({behavior:"smooth",block:"start"})},style:{display:"block",fontSize:13,fontWeight:600,color:"var(--tx)",textDecoration:"none",marginBottom:4},children:C}),(E.get(C)||[]).map(G=>{const R=(G.operationId||`${G.method}-${G.path}`).toLowerCase().replace(/[^a-z0-9]+/g,"-");return s.jsxs("a",{href:`#${R}`,onClick:K=>{var nt;K.preventDefault(),(nt=document.getElementById(R))==null||nt.scrollIntoView({behavior:"smooth",block:"start"})},style:{display:"flex",alignItems:"center",gap:6,fontSize:12,color:"var(--tx2)",textDecoration:"none",padding:"3px 0"},children:[s.jsx("span",{style:{fontSize:9,fontWeight:700,fontFamily:"var(--font-code, monospace)",color:pm[G.method]||"#6b7280",width:36,textTransform:"uppercase"},children:G.method}),s.jsx("span",{style:{fontFamily:"var(--font-code, monospace)"},children:G.path})]},`${G.method}-${G.path}`)})]},C)})]}),s.jsxs("div",{style:{flex:1,minWidth:0},children:[s.jsxs("div",{style:{marginBottom:32},children:[s.jsx("h1",{style:{fontSize:28,fontWeight:700,marginBottom:4},children:u.title}),s.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,marginBottom:8},children:[s.jsxs("span",{style:{padding:"2px 8px",borderRadius:4,fontSize:11,fontWeight:600,background:"var(--sf)",color:"var(--txM)"},children:["v",u.version]}),u.servers.length>0&&s.jsx("span",{style:{fontSize:12,fontFamily:"var(--font-code, monospace)",color:"var(--tx2)"},children:u.servers[0].url})]}),u.description&&s.jsx("p",{style:{fontSize:14,color:"var(--tx2)",lineHeight:1.65,marginTop:0},children:u.description})]}),M.map(C=>s.jsxs("section",{id:C.toLowerCase().replace(/\s+/g,"-"),"data-testid":"tag-section",style:{marginBottom:40},children:[s.jsx("h2",{style:{fontSize:20,fontWeight:700,marginBottom:4},children:C}),O.get(C)&&s.jsx("p",{style:{fontSize:14,color:"var(--tx2)",lineHeight:1.65,marginTop:0,marginBottom:16},children:O.get(C)}),(E.get(C)||[]).map(y=>s.jsx(H0,{endpoint:y,baseUrl:v,showPlayground:d,playgroundAuth:c},`${y.method}-${y.path}`))]},C))]})]})}function q0({href:u,title:h,description:d,icon:c,external:v}){const E=v??u.startsWith("http");return s.jsxs("a",{href:u,target:E?"_blank":void 0,rel:E?"noopener noreferrer":void 0,style:{display:"block",padding:"16px 20px",border:"1px solid var(--bd)",borderRadius:8,textDecoration:"none",color:"inherit",background:"var(--sf)",transition:"border-color 0.15s, background 0.15s",cursor:"pointer"},onMouseEnter:M=>{M.currentTarget.style.borderColor="var(--ac)",M.currentTarget.style.background="var(--sfH)"},onMouseLeave:M=>{M.currentTarget.style.borderColor="var(--bd)",M.currentTarget.style.background="var(--sf)"},children:[s.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[c&&s.jsx("span",{style:{fontSize:18},children:c}),s.jsx("span",{style:{fontWeight:600,fontSize:15,color:"var(--tx)"},children:h}),s.jsx("span",{style:{marginLeft:"auto",color:"var(--tx2)",fontSize:14},children:E?"↗":"→"})]}),d&&s.jsx("p",{style:{margin:"6px 0 0",fontSize:13,color:"var(--tx2)",lineHeight:1.5},children:d})]})}function L0({columns:u=2,children:h}){return s.jsx("div",{style:{display:"grid",gridTemplateColumns:`repeat(${u}, 1fr)`,gap:12,marginTop:16,marginBottom:16},children:h})}const G0={Added:"#22c55e",Changed:"#3b82f6",Deprecated:"#f59e0b",Removed:"#ef4444",Fixed:"#8b5cf6",Security:"#f97316"};function lm(u){return G0[u]||"#6b7280"}function Y0({entries:u,initialLimit:h}){const[d,c]=w.useState(!h),v=d?u:u.slice(0,h||u.length);return u.length===0?s.jsx("div",{"data-testid":"changelog-empty",style:{padding:"40px 0",textAlign:"center",color:"var(--txM)",fontSize:14},children:"No changelog entries found."}):s.jsxs("div",{"data-testid":"changelog-timeline",style:{position:"relative"},children:[s.jsx("div",{style:{position:"absolute",left:15,top:8,bottom:8,width:2,background:"var(--bd)"}}),v.map((E,M)=>s.jsxs("div",{"data-testid":`changelog-entry-${E.version}`,style:{position:"relative",paddingLeft:44,paddingBottom:Ms.jsxs("div",{style:{marginBottom:16},children:[s.jsxs("div",{style:{display:"inline-flex",alignItems:"center",gap:6,marginBottom:8},children:[s.jsx("span",{style:{display:"inline-block",width:8,height:8,borderRadius:"50%",background:lm(O.type)}}),s.jsx("span",{style:{fontSize:12,fontWeight:600,textTransform:"uppercase",letterSpacing:".06em",color:lm(O.type),fontFamily:"var(--font-code, monospace)"},children:O.type})]}),s.jsx("ul",{style:{margin:0,paddingLeft:18,listStyleType:"disc",color:"var(--tx2)"},children:O.items.map((C,y)=>s.jsx("li",{style:{fontSize:14,lineHeight:1.7,color:"var(--tx2)",marginBottom:2},children:C},y))})]},O.type))]},E.version)),!d&&u.length>(h||0)&&s.jsx("div",{style:{textAlign:"center",marginTop:24},children:s.jsxs("button",{"data-testid":"changelog-show-more",onClick:()=>c(!0),style:{background:"none",border:"1px solid var(--bd)",borderRadius:2,padding:"8px 20px",color:"var(--tx2)",fontSize:13,fontFamily:"var(--font-body, inherit)",cursor:"pointer",transition:"border-color .15s, color .15s"},children:["Show all ",u.length," releases"]})})]})}const im={info:{color:"#3b82f6",label:"INFO"},warning:{color:"#f59e0b",label:"WARNING"},tip:{color:"var(--ac, #a78bfa)",label:"TIP"},danger:{color:"#ef4444",label:"DANGER"}};function K0({type:u="info",title:h,children:d}){const c=im[u]||im.info;return s.jsxs("div",{style:{borderLeft:`3px solid ${c.color}`,background:`${c.color}11`,borderRadius:"0 2px 2px 0",padding:"14px 18px",marginBottom:20},children:[h?s.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,marginBottom:4},children:[s.jsx("span",{style:{fontWeight:700,fontSize:10,letterSpacing:".08em",color:c.color,fontFamily:"var(--font-code, monospace)"},children:c.label}),s.jsx("span",{style:{fontWeight:600,fontSize:13,color:c.color},children:h})]}):s.jsx("div",{style:{marginBottom:4},children:s.jsx("span",{style:{fontWeight:700,fontSize:10,letterSpacing:".08em",color:c.color,fontFamily:"var(--font-code, monospace)"},children:c.label})}),s.jsx("div",{style:{fontSize:14,lineHeight:1.65,color:"var(--tx2)"},children:d})]})}function X0({items:u,children:h}){const[d,c]=w.useState(0);return s.jsxs("div",{style:{marginBottom:20},children:[s.jsx("div",{style:{display:"flex",gap:0,borderBottom:"1px solid var(--bd)"},children:u.map((v,E)=>s.jsx("button",{onClick:()=>c(E),style:{padding:"8px 16px",background:"none",border:"none",borderBottom:d===E?"2px solid var(--ac)":"2px solid transparent",color:d===E?"var(--ac)":"var(--txM)",fontWeight:d===E?600:400,fontSize:13,cursor:"pointer",fontFamily:"inherit"},children:v},E))}),s.jsx("div",{style:{padding:"16px 0"},children:h[d]})]})}function Q0({title:u,icon:h,href:d,children:c}){const v=s.jsxs("div",{style:{border:"1px solid var(--bd)",borderRadius:2,padding:"20px",transition:"border-color 0.15s",cursor:d?"pointer":"default"},children:[h&&s.jsx("span",{style:{fontSize:24,marginBottom:8,display:"block"},children:h}),s.jsx("div",{style:{fontWeight:600,fontSize:14,marginBottom:4},children:u}),c&&s.jsx("div",{style:{fontSize:13,color:"var(--txM)",lineHeight:1.5},children:c})]});return d?s.jsx("a",{href:d,style:{textDecoration:"none",color:"inherit"},children:v}):v}function V0({cols:u=2,children:h}){return s.jsx("div",{style:{display:"grid",gridTemplateColumns:`repeat(${u}, 1fr)`,gap:12,marginBottom:20},children:h})}function Z0({children:u}){return s.jsx("div",{style:{paddingLeft:24,borderLeft:"2px solid var(--bd)",marginBottom:20},children:sm.Children.map(u,(h,d)=>s.jsxs("div",{style:{position:"relative",paddingBottom:20},children:[s.jsx("div",{style:{position:"absolute",left:-33,top:0,width:20,height:20,borderRadius:"50%",background:"var(--ac)",color:"#fff",display:"flex",alignItems:"center",justifyContent:"center",fontSize:11,fontWeight:700},children:d+1}),s.jsx("div",{style:{paddingLeft:8},children:h})]}))})}function J0({title:u,children:h}){const[d,c]=w.useState(!1);return s.jsxs("div",{style:{border:"1px solid var(--bd)",borderRadius:2,marginBottom:8,overflow:"hidden"},children:[s.jsxs("button",{onClick:()=>c(!d),style:{display:"flex",alignItems:"center",justifyContent:"space-between",width:"100%",padding:"12px 16px",background:"var(--sf)",border:"none",cursor:"pointer",fontWeight:500,fontSize:14,color:"var(--tx)",fontFamily:"inherit"},children:[u,s.jsx("span",{style:{transform:d?"rotate(180deg)":"rotate(0)",transition:"transform 0.2s"},children:"▾"})]}),d&&s.jsx("div",{style:{padding:"12px 16px",borderTop:"1px solid var(--bd)",fontSize:14,color:"var(--tx2)",lineHeight:1.65},children:h})]})}const W0={install:{npm:"npm install",yarn:"yarn add",pnpm:"pnpm add",bun:"bun add"},"install -D":{npm:"npm install -D",yarn:"yarn add -D",pnpm:"pnpm add -D",bun:"bun add -d"},uninstall:{npm:"npm uninstall",yarn:"yarn remove",pnpm:"pnpm remove",bun:"bun remove"},run:{npm:"npm run",yarn:"yarn",pnpm:"pnpm",bun:"bun run"},exec:{npm:"npx",yarn:"yarn dlx",pnpm:"pnpm dlx",bun:"bunx"},init:{npm:"npm init",yarn:"yarn init",pnpm:"pnpm init",bun:"bun init"},create:{npm:"npm create",yarn:"yarn create",pnpm:"pnpm create",bun:"bun create"}};function F0(u,h){for(const[d,c]of Object.entries(W0))if(u.startsWith(d+" ")||u===d){const v=u.slice(d.length);return(c[h]||d)+v}return`${h} ${u}`}function $0({command:u}){const[h,d]=w.useState(0),[c,v]=w.useState(!1),E=["npm","yarn","pnpm","bun"],M=F0(u,E[h]);return s.jsxs("div",{style:{border:"1px solid var(--bd)",borderRadius:2,marginBottom:16,overflow:"hidden"},children:[s.jsx("div",{style:{display:"flex",borderBottom:"1px solid var(--bd)",background:"var(--sf)",overflowX:"auto"},children:E.map((O,C)=>s.jsx("button",{onClick:()=>{d(C),v(!1)},style:{padding:"8px 14px",background:"none",border:"none",cursor:"pointer",fontSize:12,fontFamily:"var(--font-code)",fontWeight:C===h?600:400,color:C===h?"var(--ac)":"var(--txM)",borderBottom:C===h?"2px solid var(--ac)":"2px solid transparent",whiteSpace:"nowrap"},children:O},O))}),s.jsxs("div",{style:{display:"flex",alignItems:"center",padding:"10px 14px",background:"var(--cdBg)",gap:8},children:[s.jsx("code",{style:{flex:1,fontFamily:"var(--font-code)",fontSize:13,color:"var(--cdTx)",whiteSpace:"pre",overflowX:"auto"},children:M}),s.jsx("button",{onClick:()=>{var O;(O=navigator.clipboard)==null||O.writeText(M),v(!0),setTimeout(()=>v(!1),2e3)},style:{background:"none",border:"none",cursor:"pointer",color:"var(--txM)",fontSize:12,fontFamily:"var(--font-code)",flexShrink:0},children:c?"✓":"Copy"})]})]})}function I0({name:u,fields:h}){return s.jsxs("div",{style:{marginBottom:16},children:[u&&s.jsx("h4",{style:{fontFamily:"var(--font-code)",fontSize:15,marginBottom:8,color:"var(--tx)"},children:u}),s.jsx("div",{style:{overflowX:"auto",WebkitOverflowScrolling:"touch"},children:s.jsxs("table",{style:{width:"100%",borderCollapse:"collapse",fontSize:13,fontFamily:"var(--font-body)"},children:[s.jsx("thead",{children:s.jsx("tr",{style:{borderBottom:"2px solid var(--bd)"},children:["Property","Type","Required","Default","Description"].map(d=>s.jsx("th",{style:{textAlign:"left",padding:"8px 10px",color:"var(--txM)",fontWeight:600,fontSize:11,textTransform:"uppercase",letterSpacing:".05em",whiteSpace:"nowrap"},children:d},d))})}),s.jsx("tbody",{children:h.map(d=>s.jsxs("tr",{style:{borderBottom:"1px solid var(--bd)"},children:[s.jsx("td",{style:{padding:"8px 10px",fontFamily:"var(--font-code)",fontWeight:500,color:"var(--tx)"},children:d.name}),s.jsx("td",{style:{padding:"8px 10px",fontFamily:"var(--font-code)",fontSize:12,color:"var(--ac)"},children:d.type}),s.jsx("td",{style:{padding:"8px 10px"},children:d.required&&s.jsx("span",{style:{fontSize:10,fontWeight:600,color:"#e04040",background:"rgba(224,64,64,0.1)",padding:"2px 6px",borderRadius:2},children:"required"})}),s.jsx("td",{style:{padding:"8px 10px",fontFamily:"var(--font-code)",fontSize:12,color:"var(--txM)"},children:d.default||"—"}),s.jsx("td",{style:{padding:"8px 10px",color:"var(--tx2)"},children:d.description||""})]},d.name))})]})})]})}function P0({name:u}){return s.jsxs("div",{style:{display:"flex",alignItems:"center",gap:6,padding:"3px 0",fontFamily:"var(--font-code)",fontSize:13,color:"var(--tx2)"},children:[s.jsx("span",{style:{opacity:.6},children:"📄"})," ",u]})}function tg({name:u,defaultOpen:h,children:d}){const[c,v]=w.useState(h??!1);return s.jsxs("div",{children:[s.jsxs("button",{onClick:()=>v(!c),style:{display:"flex",alignItems:"center",gap:6,padding:"3px 0",background:"none",border:"none",cursor:"pointer",fontFamily:"var(--font-code)",fontSize:13,color:"var(--tx)",fontWeight:500},children:[s.jsx("span",{children:c?"📂":"📁"})," ",u]}),c&&s.jsx("div",{style:{paddingLeft:18,borderLeft:"1px solid var(--bd)",marginLeft:8},children:d})]})}function Iu({children:u}){return s.jsx("div",{style:{border:"1px solid var(--bd)",borderRadius:2,padding:"12px 16px",background:"var(--cdBg)",marginBottom:16},children:u})}Iu.File=P0;Iu.Folder=tg;const eg={Callout:K0,Tabs:X0,Card:Q0,CardGroup:V0,Steps:Z0,Accordion:J0,ChangelogTimeline:Y0,PackageManager:$0,TypeTable:I0,FileTree:Iu,CodeSamples:mm,LinkCard:q0,CardGrid:L0},ng=`
+});`}function O0(u,p){var O,C;const d=p+u.path,c=["import requests",""],v={},E=u.parameters.filter(y=>y.in==="header");for(const y of E)v[y.name]="";u.requestBody&&(v["Content-Type"]=u.requestBody.contentType),Object.keys(v).length>0&&(c.push(`headers = ${JSON.stringify(v,null,4)}`),c.push("")),(O=u.requestBody)!=null&&O.schema&&(c.push(`data = ${JSON.stringify(u.requestBody.schema,null,4)}`),c.push(""));const M=[`"${d}"`];return Object.keys(v).length>0&&M.push("headers=headers"),(C=u.requestBody)!=null&&C.schema&&M.push("json=data"),c.push(`response = requests.${u.method}(${M.join(", ")})`),c.push("print(response.json())"),c.join(`
+`)}function R0(u,p){var E,M;const d=p+u.path,c=["package main","","import (",' "fmt"',' "net/http"'];(E=u.requestBody)!=null&&E.schema&&c.push(' "bytes"',' "encoding/json"'),c.push(' "io"',")",""),c.push("func main() {"),(M=u.requestBody)!=null&&M.schema?(c.push(` body, _ := json.Marshal(${JSON.stringify(u.requestBody.schema)})`),c.push(` req, _ := http.NewRequest("${u.method.toUpperCase()}", "${d}", bytes.NewBuffer(body))`)):c.push(` req, _ := http.NewRequest("${u.method.toUpperCase()}", "${d}", nil)`);const v=u.parameters.filter(O=>O.in==="header");for(const O of v)c.push(` req.Header.Set("${O.name}", "")`);return u.requestBody&&c.push(` req.Header.Set("Content-Type", "${u.requestBody.contentType}")`),c.push(" resp, _ := http.DefaultClient.Do(req)"),c.push(" defer resp.Body.Close()"),c.push(" data, _ := io.ReadAll(resp.Body)"),c.push(" fmt.Println(string(data))"),c.push("}"),c.join(`
+`)}function w0(u,p){var E;const d=p+u.path,c=["import java.net.http.*;","import java.net.URI;","","var client = HttpClient.newHttpClient();"];(E=u.requestBody)!=null&&E.schema?(c.push(`var body = ${JSON.stringify(JSON.stringify(u.requestBody.schema))};`),c.push("var request = HttpRequest.newBuilder()"),c.push(` .uri(URI.create("${d}"))`),c.push(` .method("${u.method.toUpperCase()}", HttpRequest.BodyPublishers.ofString(body))`)):(c.push("var request = HttpRequest.newBuilder()"),c.push(` .uri(URI.create("${d}"))`),c.push(` .method("${u.method.toUpperCase()}", HttpRequest.BodyPublishers.noBody())`));const v=u.parameters.filter(M=>M.in==="header");for(const M of v)c.push(` .header("${M.name}", "")`);return u.requestBody&&c.push(` .header("Content-Type", "${u.requestBody.contentType}")`),c.push(" .build();"),c.push(""),c.push("var response = client.send(request, HttpResponse.BodyHandlers.ofString());"),c.push("System.out.println(response.body());"),c.join(`
+`)}function B0(u,p){var E;const d=p+u.path,c=["using var client = new HttpClient();","",`var request = new HttpRequestMessage(HttpMethod.${u.method.charAt(0).toUpperCase()+u.method.slice(1)}, "${d}");`],v=u.parameters.filter(M=>M.in==="header");for(const M of v)c.push(`request.Headers.Add("${M.name}", "");`);return(E=u.requestBody)!=null&&E.schema&&(c.push("request.Content = new StringContent("),c.push(` ${JSON.stringify(JSON.stringify(u.requestBody.schema))},`),c.push(" System.Text.Encoding.UTF8,"),c.push(` "${u.requestBody.contentType}");`)),c.push(""),c.push("var response = await client.SendAsync(request);"),c.push("var body = await response.Content.ReadAsStringAsync();"),c.push("Console.WriteLine(body);"),c.join(`
+`)}function U0({endpoint:u,baseUrl:p="https://api.example.com"}){const[d,c]=w.useState(0),v=["cURL","JavaScript","Python","Go","Java","C#"],E=[_0(u,p),D0(u,p),O0(u,p),R0(u,p),w0(u,p),B0(u,p)];return s.jsxs("div",{style:{marginBottom:16},children:[s.jsx("div",{style:{display:"flex",gap:0,borderBottom:"1px solid var(--bd)",overflowX:"auto",WebkitOverflowScrolling:"touch"},children:v.map((M,O)=>s.jsx("button",{onClick:()=>c(O),style:{padding:"6px 14px",background:"none",border:"none",borderBottom:d===O?"2px solid var(--ac)":"2px solid transparent",color:d===O?"var(--ac)":"var(--txM)",fontWeight:d===O?600:400,fontSize:12,cursor:"pointer",fontFamily:"inherit",whiteSpace:"nowrap"},children:M},M))}),s.jsx("pre",{style:{background:"var(--cdBg)",color:"var(--cdTx)",padding:16,borderRadius:"0 0 6px 6px",fontSize:12,fontFamily:"var(--font-code, monospace)",overflow:"auto",lineHeight:1.6,margin:0},children:E[d]})]})}function H0({endpoint:u,baseUrl:p,defaultExpanded:d=!1,showPlayground:c,playgroundAuth:v}){const[E,M]=w.useState(d),O=(u.operationId||`${u.method}-${u.path}`).toLowerCase().replace(/[^a-z0-9]+/g,"-"),C=u.parameters.length>0||u.requestBody!=null||u.responses.length>0;return s.jsxs("div",{id:O,style:{border:"1px solid var(--bd)",borderRadius:8,marginBottom:12,overflow:"hidden",scrollMarginTop:24},children:[s.jsxs("button",{onClick:()=>C&&M(!E),style:{display:"flex",alignItems:"center",gap:10,width:"100%",padding:"14px 18px",background:"var(--sf)",border:"none",cursor:C?"pointer":"default",textAlign:"left",fontFamily:"inherit",color:"var(--tx)"},children:[s.jsx(C0,{method:u.method}),s.jsx("span",{style:{fontFamily:"var(--font-code, monospace)",fontSize:14,fontWeight:500},children:u.path}),u.deprecated&&s.jsx("span",{"data-testid":"deprecated-badge",style:{padding:"1px 6px",borderRadius:3,fontSize:10,fontWeight:700,background:"#f59e0b33",color:"#f59e0b",textTransform:"uppercase",letterSpacing:"0.05em"},children:"Deprecated"}),u.tags.map(y=>s.jsx("span",{style:{padding:"1px 6px",borderRadius:3,fontSize:10,background:"var(--bd)",color:"var(--txM)"},children:y},y)),s.jsx("span",{style:{flex:1}}),u.summary&&s.jsx("span",{style:{fontSize:13,color:"var(--tx2)",marginRight:8},children:u.summary}),C&&s.jsx("span",{style:{transform:E?"rotate(180deg)":"rotate(0)",transition:"transform 0.2s",fontSize:12,color:"var(--txM)"},children:"▾"})]}),E&&s.jsxs("div",{style:{padding:"16px 18px",borderTop:"1px solid var(--bd)"},children:[u.description&&s.jsx("p",{style:{fontSize:14,color:"var(--tx2)",lineHeight:1.65,marginTop:0,marginBottom:16},children:u.description}),u.parameters.length>0&&s.jsxs("div",{style:{marginBottom:16},children:[s.jsx("h4",{style:{fontSize:13,fontWeight:600,marginBottom:8,color:"var(--tx)"},children:"Parameters"}),s.jsx(j0,{parameters:u.parameters})]}),u.requestBody&&s.jsxs("div",{style:{marginBottom:16},children:[s.jsx("h4",{style:{fontSize:13,fontWeight:600,marginBottom:8,color:"var(--tx)"},children:"Request Body"}),s.jsx(A0,{requestBody:u.requestBody})]}),u.responses.length>0&&s.jsxs("div",{style:{marginBottom:16},children:[s.jsx("h4",{style:{fontSize:13,fontWeight:600,marginBottom:8,color:"var(--tx)"},children:"Responses"}),s.jsx(k0,{responses:u.responses})]}),s.jsxs("div",{children:[s.jsx("h4",{style:{fontSize:13,fontWeight:600,marginBottom:8,color:"var(--tx)"},children:"Code Examples"}),u.codeSamples&&u.codeSamples.length>0?s.jsx(mm,{samples:u.codeSamples}):s.jsx(U0,{endpoint:u,baseUrl:p})]}),c&&s.jsx("div",{style:{marginTop:16},children:s.jsx(z0,{endpoint:u,baseUrl:p||"https://api.example.com",auth:v})})]})]})}function N0({manifest:u,baseUrl:p,showPlayground:d,playgroundAuth:c}){const v=p||(u.servers.length>0?u.servers[0].url:"https://api.example.com"),E=new Map;for(const C of u.endpoints){const y=C.tags.length>0?C.tags[0]:"Other";E.has(y)||E.set(y,[]),E.get(y).push(C)}const M=[];for(const C of u.tags)E.has(C.name)&&M.push(C.name);for(const C of E.keys())M.includes(C)||M.push(C);const O=new Map;for(const C of u.tags)O.set(C.name,C.description);return s.jsxs("div",{style:{display:"flex",gap:32},children:[s.jsxs("nav",{"data-testid":"api-toc",style:{width:200,flexShrink:0,position:"sticky",top:24,alignSelf:"flex-start",maxHeight:"calc(100vh - 48px)",overflowY:"auto"},children:[s.jsx("div",{style:{fontSize:11,fontWeight:700,textTransform:"uppercase",color:"var(--txM)",marginBottom:12,letterSpacing:"0.05em"},children:"Endpoints"}),M.map(C=>{const y=C.toLowerCase().replace(/\s+/g,"-");return s.jsxs("div",{style:{marginBottom:14},children:[s.jsx("a",{href:`#${y}`,onClick:G=>{var R;G.preventDefault(),(R=document.getElementById(y))==null||R.scrollIntoView({behavior:"smooth",block:"start"})},style:{display:"block",fontSize:13,fontWeight:600,color:"var(--tx)",textDecoration:"none",marginBottom:4},children:C}),(E.get(C)||[]).map(G=>{const R=(G.operationId||`${G.method}-${G.path}`).toLowerCase().replace(/[^a-z0-9]+/g,"-");return s.jsxs("a",{href:`#${R}`,onClick:K=>{var nt;K.preventDefault(),(nt=document.getElementById(R))==null||nt.scrollIntoView({behavior:"smooth",block:"start"})},style:{display:"flex",alignItems:"center",gap:6,fontSize:12,color:"var(--tx2)",textDecoration:"none",padding:"3px 0"},children:[s.jsx("span",{style:{fontSize:9,fontWeight:700,fontFamily:"var(--font-code, monospace)",color:hm[G.method]||"#6b7280",width:36,textTransform:"uppercase"},children:G.method}),s.jsx("span",{style:{fontFamily:"var(--font-code, monospace)"},children:G.path})]},`${G.method}-${G.path}`)})]},C)})]}),s.jsxs("div",{style:{flex:1,minWidth:0},children:[s.jsxs("div",{style:{marginBottom:32},children:[s.jsx("h1",{style:{fontSize:28,fontWeight:700,marginBottom:4},children:u.title}),s.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,marginBottom:8},children:[s.jsxs("span",{style:{padding:"2px 8px",borderRadius:4,fontSize:11,fontWeight:600,background:"var(--sf)",color:"var(--txM)"},children:["v",u.version]}),u.servers.length>0&&s.jsx("span",{style:{fontSize:12,fontFamily:"var(--font-code, monospace)",color:"var(--tx2)"},children:u.servers[0].url})]}),u.description&&s.jsx("p",{style:{fontSize:14,color:"var(--tx2)",lineHeight:1.65,marginTop:0},children:u.description})]}),M.map(C=>s.jsxs("section",{id:C.toLowerCase().replace(/\s+/g,"-"),"data-testid":"tag-section",style:{marginBottom:40},children:[s.jsx("h2",{style:{fontSize:20,fontWeight:700,marginBottom:4},children:C}),O.get(C)&&s.jsx("p",{style:{fontSize:14,color:"var(--tx2)",lineHeight:1.65,marginTop:0,marginBottom:16},children:O.get(C)}),(E.get(C)||[]).map(y=>s.jsx(H0,{endpoint:y,baseUrl:v,showPlayground:d,playgroundAuth:c},`${y.method}-${y.path}`))]},C))]})]})}function q0({href:u,title:p,description:d,icon:c,external:v}){const E=v??u.startsWith("http");return s.jsxs("a",{href:u,target:E?"_blank":void 0,rel:E?"noopener noreferrer":void 0,style:{display:"block",padding:"16px 20px",border:"1px solid var(--bd)",borderRadius:8,textDecoration:"none",color:"inherit",background:"var(--sf)",transition:"border-color 0.15s, background 0.15s",cursor:"pointer"},onMouseEnter:M=>{M.currentTarget.style.borderColor="var(--ac)",M.currentTarget.style.background="var(--sfH)"},onMouseLeave:M=>{M.currentTarget.style.borderColor="var(--bd)",M.currentTarget.style.background="var(--sf)"},children:[s.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[c&&s.jsx("span",{style:{fontSize:18},children:c}),s.jsx("span",{style:{fontWeight:600,fontSize:15,color:"var(--tx)"},children:p}),s.jsx("span",{style:{marginLeft:"auto",color:"var(--tx2)",fontSize:14},children:E?"↗":"→"})]}),d&&s.jsx("p",{style:{margin:"6px 0 0",fontSize:13,color:"var(--tx2)",lineHeight:1.5},children:d})]})}function L0({columns:u=2,children:p}){return s.jsx("div",{style:{display:"grid",gridTemplateColumns:`repeat(${u}, 1fr)`,gap:12,marginTop:16,marginBottom:16},children:p})}const G0={Added:"#22c55e",Changed:"#3b82f6",Deprecated:"#f59e0b",Removed:"#ef4444",Fixed:"#8b5cf6",Security:"#f97316"};function lm(u){return G0[u]||"#6b7280"}function Y0({entries:u,initialLimit:p}){const[d,c]=w.useState(!p),v=d?u:u.slice(0,p||u.length);return u.length===0?s.jsx("div",{"data-testid":"changelog-empty",style:{padding:"40px 0",textAlign:"center",color:"var(--txM)",fontSize:14},children:"No changelog entries found."}):s.jsxs("div",{"data-testid":"changelog-timeline",style:{position:"relative"},children:[s.jsx("div",{style:{position:"absolute",left:15,top:8,bottom:8,width:2,background:"var(--bd)"}}),v.map((E,M)=>s.jsxs("div",{"data-testid":`changelog-entry-${E.version}`,style:{position:"relative",paddingLeft:44,paddingBottom:Ms.jsxs("div",{style:{marginBottom:16},children:[s.jsxs("div",{style:{display:"inline-flex",alignItems:"center",gap:6,marginBottom:8},children:[s.jsx("span",{style:{display:"inline-block",width:8,height:8,borderRadius:"50%",background:lm(O.type)}}),s.jsx("span",{style:{fontSize:12,fontWeight:600,textTransform:"uppercase",letterSpacing:".06em",color:lm(O.type),fontFamily:"var(--font-code, monospace)"},children:O.type})]}),s.jsx("ul",{style:{margin:0,paddingLeft:18,listStyleType:"disc",color:"var(--tx2)"},children:O.items.map((C,y)=>s.jsx("li",{style:{fontSize:14,lineHeight:1.7,color:"var(--tx2)",marginBottom:2},children:C},y))})]},O.type))]},E.version)),!d&&u.length>(p||0)&&s.jsx("div",{style:{textAlign:"center",marginTop:24},children:s.jsxs("button",{"data-testid":"changelog-show-more",onClick:()=>c(!0),style:{background:"none",border:"1px solid var(--bd)",borderRadius:2,padding:"8px 20px",color:"var(--tx2)",fontSize:13,fontFamily:"var(--font-body, inherit)",cursor:"pointer",transition:"border-color .15s, color .15s"},children:["Show all ",u.length," releases"]})})]})}const im={info:{color:"#3b82f6",label:"INFO"},warning:{color:"#f59e0b",label:"WARNING"},tip:{color:"var(--ac, #a78bfa)",label:"TIP"},danger:{color:"#ef4444",label:"DANGER"}};function K0({type:u="info",title:p,children:d}){const c=im[u]||im.info;return s.jsxs("div",{style:{borderLeft:`3px solid ${c.color}`,background:`${c.color}11`,borderRadius:"0 2px 2px 0",padding:"14px 18px",marginBottom:20},children:[p?s.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,marginBottom:4},children:[s.jsx("span",{style:{fontWeight:700,fontSize:10,letterSpacing:".08em",color:c.color,fontFamily:"var(--font-code, monospace)"},children:c.label}),s.jsx("span",{style:{fontWeight:600,fontSize:13,color:c.color},children:p})]}):s.jsx("div",{style:{marginBottom:4},children:s.jsx("span",{style:{fontWeight:700,fontSize:10,letterSpacing:".08em",color:c.color,fontFamily:"var(--font-code, monospace)"},children:c.label})}),s.jsx("div",{style:{fontSize:14,lineHeight:1.65,color:"var(--tx2)"},children:d})]})}function X0({items:u,children:p}){const[d,c]=w.useState(0);return s.jsxs("div",{style:{marginBottom:20},children:[s.jsx("div",{style:{display:"flex",gap:0,borderBottom:"1px solid var(--bd)"},children:u.map((v,E)=>s.jsx("button",{onClick:()=>c(E),style:{padding:"8px 16px",background:"none",border:"none",borderBottom:d===E?"2px solid var(--ac)":"2px solid transparent",color:d===E?"var(--ac)":"var(--txM)",fontWeight:d===E?600:400,fontSize:13,cursor:"pointer",fontFamily:"inherit"},children:v},E))}),s.jsx("div",{style:{padding:"16px 0"},children:p[d]})]})}function Q0({title:u,icon:p,href:d,children:c}){const v=s.jsxs("div",{style:{border:"1px solid var(--bd)",borderRadius:2,padding:"20px",transition:"border-color 0.15s",cursor:d?"pointer":"default"},children:[p&&s.jsx("span",{style:{fontSize:24,marginBottom:8,display:"block"},children:p}),s.jsx("div",{style:{fontWeight:600,fontSize:14,marginBottom:4},children:u}),c&&s.jsx("div",{style:{fontSize:13,color:"var(--txM)",lineHeight:1.5},children:c})]});return d?s.jsx("a",{href:d,style:{textDecoration:"none",color:"inherit"},children:v}):v}function V0({cols:u=2,children:p}){return s.jsx("div",{style:{display:"grid",gridTemplateColumns:`repeat(${u}, 1fr)`,gap:12,marginBottom:20},children:p})}function Z0({children:u}){return s.jsx("div",{style:{paddingLeft:24,borderLeft:"2px solid var(--bd)",marginBottom:20},children:sm.Children.map(u,(p,d)=>s.jsxs("div",{style:{position:"relative",paddingBottom:20},children:[s.jsx("div",{style:{position:"absolute",left:-33,top:0,width:20,height:20,borderRadius:"50%",background:"var(--ac)",color:"#fff",display:"flex",alignItems:"center",justifyContent:"center",fontSize:11,fontWeight:700},children:d+1}),s.jsx("div",{style:{paddingLeft:8},children:p})]}))})}function J0({title:u,children:p}){const[d,c]=w.useState(!1);return s.jsxs("div",{style:{border:"1px solid var(--bd)",borderRadius:2,marginBottom:8,overflow:"hidden"},children:[s.jsxs("button",{onClick:()=>c(!d),style:{display:"flex",alignItems:"center",justifyContent:"space-between",width:"100%",padding:"12px 16px",background:"var(--sf)",border:"none",cursor:"pointer",fontWeight:500,fontSize:14,color:"var(--tx)",fontFamily:"inherit"},children:[u,s.jsx("span",{style:{transform:d?"rotate(180deg)":"rotate(0)",transition:"transform 0.2s"},children:"▾"})]}),d&&s.jsx("div",{style:{padding:"12px 16px",borderTop:"1px solid var(--bd)",fontSize:14,color:"var(--tx2)",lineHeight:1.65},children:p})]})}const W0={install:{npm:"npm install",yarn:"yarn add",pnpm:"pnpm add",bun:"bun add"},"install -D":{npm:"npm install -D",yarn:"yarn add -D",pnpm:"pnpm add -D",bun:"bun add -d"},uninstall:{npm:"npm uninstall",yarn:"yarn remove",pnpm:"pnpm remove",bun:"bun remove"},run:{npm:"npm run",yarn:"yarn",pnpm:"pnpm",bun:"bun run"},exec:{npm:"npx",yarn:"yarn dlx",pnpm:"pnpm dlx",bun:"bunx"},init:{npm:"npm init",yarn:"yarn init",pnpm:"pnpm init",bun:"bun init"},create:{npm:"npm create",yarn:"yarn create",pnpm:"pnpm create",bun:"bun create"}};function F0(u,p){for(const[d,c]of Object.entries(W0))if(u.startsWith(d+" ")||u===d){const v=u.slice(d.length);return(c[p]||d)+v}return`${p} ${u}`}function $0({command:u}){const[p,d]=w.useState(0),[c,v]=w.useState(!1),E=["npm","yarn","pnpm","bun"],M=F0(u,E[p]);return s.jsxs("div",{style:{border:"1px solid var(--bd)",borderRadius:2,marginBottom:16,overflow:"hidden"},children:[s.jsx("div",{style:{display:"flex",borderBottom:"1px solid var(--bd)",background:"var(--sf)",overflowX:"auto"},children:E.map((O,C)=>s.jsx("button",{onClick:()=>{d(C),v(!1)},style:{padding:"8px 14px",background:"none",border:"none",cursor:"pointer",fontSize:12,fontFamily:"var(--font-code)",fontWeight:C===p?600:400,color:C===p?"var(--ac)":"var(--txM)",borderBottom:C===p?"2px solid var(--ac)":"2px solid transparent",whiteSpace:"nowrap"},children:O},O))}),s.jsxs("div",{style:{display:"flex",alignItems:"center",padding:"10px 14px",background:"var(--cdBg)",gap:8},children:[s.jsx("code",{style:{flex:1,fontFamily:"var(--font-code)",fontSize:13,color:"var(--cdTx)",whiteSpace:"pre",overflowX:"auto"},children:M}),s.jsx("button",{onClick:()=>{var O;(O=navigator.clipboard)==null||O.writeText(M),v(!0),setTimeout(()=>v(!1),2e3)},style:{background:"none",border:"none",cursor:"pointer",color:"var(--txM)",fontSize:12,fontFamily:"var(--font-code)",flexShrink:0},children:c?"✓":"Copy"})]})]})}function I0({name:u,fields:p}){return s.jsxs("div",{style:{marginBottom:16},children:[u&&s.jsx("h4",{style:{fontFamily:"var(--font-code)",fontSize:15,marginBottom:8,color:"var(--tx)"},children:u}),s.jsx("div",{style:{overflowX:"auto",WebkitOverflowScrolling:"touch"},children:s.jsxs("table",{style:{width:"100%",borderCollapse:"collapse",fontSize:13,fontFamily:"var(--font-body)"},children:[s.jsx("thead",{children:s.jsx("tr",{style:{borderBottom:"2px solid var(--bd)"},children:["Property","Type","Required","Default","Description"].map(d=>s.jsx("th",{style:{textAlign:"left",padding:"8px 10px",color:"var(--txM)",fontWeight:600,fontSize:11,textTransform:"uppercase",letterSpacing:".05em",whiteSpace:"nowrap"},children:d},d))})}),s.jsx("tbody",{children:p.map(d=>s.jsxs("tr",{style:{borderBottom:"1px solid var(--bd)"},children:[s.jsx("td",{style:{padding:"8px 10px",fontFamily:"var(--font-code)",fontWeight:500,color:"var(--tx)"},children:d.name}),s.jsx("td",{style:{padding:"8px 10px",fontFamily:"var(--font-code)",fontSize:12,color:"var(--ac)"},children:d.type}),s.jsx("td",{style:{padding:"8px 10px"},children:d.required&&s.jsx("span",{style:{fontSize:10,fontWeight:600,color:"#e04040",background:"rgba(224,64,64,0.1)",padding:"2px 6px",borderRadius:2},children:"required"})}),s.jsx("td",{style:{padding:"8px 10px",fontFamily:"var(--font-code)",fontSize:12,color:"var(--txM)"},children:d.default||"—"}),s.jsx("td",{style:{padding:"8px 10px",color:"var(--tx2)"},children:d.description||""})]},d.name))})]})})]})}function P0({name:u}){return s.jsxs("div",{style:{display:"flex",alignItems:"center",gap:6,padding:"3px 0",fontFamily:"var(--font-code)",fontSize:13,color:"var(--tx2)"},children:[s.jsx("span",{style:{opacity:.6},children:"📄"})," ",u]})}function tg({name:u,defaultOpen:p,children:d}){const[c,v]=w.useState(p??!1);return s.jsxs("div",{children:[s.jsxs("button",{onClick:()=>v(!c),style:{display:"flex",alignItems:"center",gap:6,padding:"3px 0",background:"none",border:"none",cursor:"pointer",fontFamily:"var(--font-code)",fontSize:13,color:"var(--tx)",fontWeight:500},children:[s.jsx("span",{children:c?"📂":"📁"})," ",u]}),c&&s.jsx("div",{style:{paddingLeft:18,borderLeft:"1px solid var(--bd)",marginLeft:8},children:d})]})}function Iu({children:u}){return s.jsx("div",{style:{border:"1px solid var(--bd)",borderRadius:2,padding:"12px 16px",background:"var(--cdBg)",marginBottom:16},children:u})}Iu.File=P0;Iu.Folder=tg;const eg={Callout:K0,Tabs:X0,Card:Q0,CardGroup:V0,Steps:Z0,Accordion:J0,ChangelogTimeline:Y0,PackageManager:$0,TypeTable:I0,FileTree:Iu,CodeSamples:mm,LinkCard:q0,CardGrid:L0},ng=`
@import url('https://fonts.googleapis.com/css2?family=Instrument+Serif:ital@0;1&family=DM+Sans:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500;600&family=Bricolage+Grotesque:wght@300;400;500;600;700&family=Cormorant+Garamond:ital,wght@0,300;0,400;0,600;0,700;1,300;1,400;1,700&family=Fira+Code:wght@400;500;600&family=Bodoni+Moda:ital,wght@0,400;0,700;0,900;1,400&family=Space+Grotesk:wght@400;500;600;700&family=Source+Code+Pro:wght@400;500;600&family=Inter:wght@300;400;500;600;700&display=swap');
html, body { margin: 0; padding: 0; height: 100%; overflow: clip; }
@@ -1308,4 +1325,4 @@ ${c.join(`
border-color: var(--bd);
box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}
-`,_o=(Jn.basePath||"/").replace(/\/$/,"");function ag(u){return cm(u,_o,Wn)}function Wu(u){return f0(u,_o,Wn)}const hm=h0(window.location.pathname,window.location.hash,Wn,_o,cm),lg=fm(hm,Wn,dm);function ig(){var W,I,ct,Q;const[u,h]=w.useState(hm),[d,c]=w.useState(null),[v,E]=w.useState(!0),M=w.useRef(0),O=w.useCallback(async(Y,H)=>{const U=++M.current;E(!0);let at;try{at=await fm(Y,Wn,dm)}catch(P){if(M.current!==U)return;console.error(`[tome] Navigation failed for page: ${Y}`,P),at=null}if(M.current!==U)return;const lt=Wu(Y);if(H!=null&&H.replace?window.history.replaceState(null,"",lt):window.history.pushState(null,"",lt),h(Y),c(at),E(!1),!(H!=null&&H.skipScroll)){const P=window.location.hash.slice(1);P?requestAnimationFrame(()=>{const mt=document.getElementById(P);mt&&mt.scrollIntoView({behavior:"smooth",block:"start"})}):window.scrollTo(0,0)}},[]);w.useEffect(()=>{const Y=window.location.hash.slice(1);if(Y&&Wn.some(H=>H.id===Y)){const H=Wu(Y);window.history.replaceState(null,"",H),O(Y,{replace:!0})}else{const H=Wu(u);window.history.replaceState(null,"",H),lg.then(U=>{c(U),E(!1)})}},[]),w.useEffect(()=>{const Y=()=>{const H=ag(window.location.pathname);H&&H!==u&&O(H,{replace:!0,skipScroll:!0})};return window.addEventListener("popstate",Y),()=>window.removeEventListener("popstate",Y)},[u,O]);const C=w.useRef(null),[y,G]=w.useState(()=>{var H,U;if(typeof document>"u")return"light";if(document.documentElement.classList.contains("dark"))return"dark";const Y=((H=Jn.theme)==null?void 0:H.mode)||"auto";return Y==="dark"?"dark":Y==="light"?"light":(U=window.matchMedia)!=null&&U.call(window,"(prefers-color-scheme: dark)").matches?"dark":"light"});w.useEffect(()=>{const Y=new MutationObserver(()=>{const H=document.documentElement.classList.contains("dark");G(H?"dark":"light")});return Y.observe(document.documentElement,{attributes:!0,attributeFilter:["class"]}),()=>Y.disconnect()},[]),w.useEffect(()=>{const Y=document.querySelectorAll(".tome-mermaid[data-mermaid]");if(Y.length===0)return;let H=!1;const U="https://cdn.jsdelivr.net/npm/mermaid@11/dist/mermaid.esm.min.mjs";return(async()=>{try{C.current||(C.current=(await import(U)).default);const at=C.current;if(H)return;const lt=y==="dark",P=getComputedStyle(document.documentElement).getPropertyValue("--font-body").trim()||"sans-serif";at.initialize({startOnLoad:!1,theme:lt?"dark":"default",fontFamily:P,flowchart:{padding:15,nodeSpacing:30,rankSpacing:40}});for(let mt=0;mt{lt.textContent="Failed to load diagram renderer",lt.style.cssText="padding:16px;color:var(--txM);font-size:13px;border:1px dashed var(--bd);border-radius:2px;text-align:center;"})}})(),()=>{H=!0}},[d,v,y]),w.useEffect(()=>{if(v)return;const Y=document.querySelectorAll(".tome-content pre"),H=[];return Y.forEach(U=>{if(U.querySelector(".tome-copy-btn"))return;const at=document.createElement("button");at.className="tome-copy-btn",at.textContent="Copy",at.addEventListener("click",async()=>{const lt=U.querySelector("code");if(lt)try{await navigator.clipboard.writeText(lt.textContent||""),at.textContent="Copied!",setTimeout(()=>{at.textContent="Copy"},2e3)}catch{at.textContent="Failed",setTimeout(()=>{at.textContent="Copy"},2e3)}}),U.appendChild(at),H.push(at)}),()=>{H.forEach(U=>U.remove())}},[d,v]);const R=Wn.map(Y=>({id:Y.id,title:Y.frontmatter.title,description:Y.frontmatter.description})),K=Wn.find(Y=>Y.id===u),nt=g0(K),xt=p0(Jn.editLink,K==null?void 0:K.filePath),Dt=(K==null?void 0:K.locale)||(Zu==null?void 0:Zu.defaultLocale)||"en",jt="ltr";return w.useEffect(()=>{const Y=document.querySelectorAll(".tome-math[data-math]").length>0;if(!Jn.math&&!Y)return;const H="tome-katex-css";if(document.getElementById(H))return;const U=document.createElement("link");U.id=H,U.rel="stylesheet",U.href="https://cdn.jsdelivr.net/npm/katex@0.16.11/dist/katex.min.css",U.crossOrigin="anonymous",document.head.appendChild(U)},[d,v]),w.useEffect(()=>{const Y=document.querySelectorAll(".tome-math[data-math]");if(Y.length===0)return;let H=!1;const U="https://cdn.jsdelivr.net/npm/katex@0.16.11/dist/katex.mjs";return(async()=>{try{const at=(await import(U)).default;if(H)return;for(const lt of Y){const P=lt.getAttribute("data-math");if(P)try{const mt=atob(P),tt=lt.classList.contains("tome-math-block");at.render(mt,lt,{displayMode:tt,throwOnError:!1})}catch(mt){console.warn("[tome] KaTeX render failed:",mt)}}}catch(at){console.warn("[tome] Failed to load KaTeX from CDN:",at)}})(),()=>{H=!0}},[d,v]),s.jsxs(s.Fragment,{children:[s.jsx("style",{children:ng}),s.jsx(r0,{config:Jn,navigation:v0,currentPageId:u,pageHtml:d!=null&&d.isMdx?void 0:v?"":(d==null?void 0:d.html)||"Page not found
",pageComponent:d!=null&&d.isMdx?d.component:void 0,mdxComponents:eg,pageTitle:(d==null?void 0:d.frontmatter.title)||(v?"":"Not Found"),pageDescription:d==null?void 0:d.frontmatter.description,headings:(d==null?void 0:d.headings)||[],tocEnabled:(d==null?void 0:d.frontmatter.toc)!==!1,editUrl:xt,lastUpdated:K==null?void 0:K.lastUpdated,changelogEntries:d!=null&&d.isMdx||d==null?void 0:d.changelogEntries,apiManifest:!(d!=null&&d.isMdx)&&(d!=null&&d.isApiReference)?d.apiManifest:void 0,apiBaseUrl:(W=Jn.api)==null?void 0:W.baseUrl,apiPlayground:(I=Jn.api)==null?void 0:I.playground,apiAuth:(ct=Jn.api)==null?void 0:ct.auth,ApiReferenceComponent:N0,onNavigate:O,allPages:R,docContext:b0,versioning:void 0,currentVersion:nt,basePath:_o,isDraft:((Q=K==null?void 0:K.frontmatter)==null?void 0:Q.draft)===!0,dir:jt,i18n:void 0,currentLocale:Dt,overrides:x0})]})}const om=document.getElementById("tome-root");om&&Bh.createRoot(om).render(s.jsx(ig,{}));
+`,_o=(Jn.basePath||"/").replace(/\/$/,"");function ag(u){return cm(u,_o,Wn)}function Wu(u){return f0(u,_o,Wn)}const pm=p0(window.location.pathname,window.location.hash,Wn,_o,cm),lg=fm(pm,Wn,dm);function ig(){var W,I,ct,Q;const[u,p]=w.useState(pm),[d,c]=w.useState(null),[v,E]=w.useState(!0),M=w.useRef(0),O=w.useCallback(async(Y,H)=>{const U=++M.current;E(!0);let at;try{at=await fm(Y,Wn,dm)}catch(P){if(M.current!==U)return;console.error(`[tome] Navigation failed for page: ${Y}`,P),at=null}if(M.current!==U)return;const lt=Wu(Y);if(H!=null&&H.replace?window.history.replaceState(null,"",lt):window.history.pushState(null,"",lt),p(Y),c(at),E(!1),!(H!=null&&H.skipScroll)){const P=window.location.hash.slice(1);P?requestAnimationFrame(()=>{const mt=document.getElementById(P);mt&&mt.scrollIntoView({behavior:"smooth",block:"start"})}):window.scrollTo(0,0)}},[]);w.useEffect(()=>{const Y=window.location.hash.slice(1);if(Y&&Wn.some(H=>H.id===Y)){const H=Wu(Y);window.history.replaceState(null,"",H),O(Y,{replace:!0})}else{const H=Wu(u);window.history.replaceState(null,"",H),lg.then(U=>{c(U),E(!1)})}},[]),w.useEffect(()=>{const Y=()=>{const H=ag(window.location.pathname);H&&H!==u&&O(H,{replace:!0,skipScroll:!0})};return window.addEventListener("popstate",Y),()=>window.removeEventListener("popstate",Y)},[u,O]);const C=w.useRef(null),[y,G]=w.useState(()=>{var H,U;if(typeof document>"u")return"light";if(document.documentElement.classList.contains("dark"))return"dark";const Y=((H=Jn.theme)==null?void 0:H.mode)||"auto";return Y==="dark"?"dark":Y==="light"?"light":(U=window.matchMedia)!=null&&U.call(window,"(prefers-color-scheme: dark)").matches?"dark":"light"});w.useEffect(()=>{const Y=new MutationObserver(()=>{const H=document.documentElement.classList.contains("dark");G(H?"dark":"light")});return Y.observe(document.documentElement,{attributes:!0,attributeFilter:["class"]}),()=>Y.disconnect()},[]),w.useEffect(()=>{const Y=document.querySelectorAll(".tome-mermaid[data-mermaid]");if(Y.length===0)return;let H=!1;const U="https://cdn.jsdelivr.net/npm/mermaid@11/dist/mermaid.esm.min.mjs";return(async()=>{try{C.current||(C.current=(await import(U)).default);const at=C.current;if(H)return;const lt=y==="dark",P=getComputedStyle(document.documentElement).getPropertyValue("--font-body").trim()||"sans-serif";at.initialize({startOnLoad:!1,theme:lt?"dark":"default",fontFamily:P,flowchart:{padding:15,nodeSpacing:30,rankSpacing:40}});for(let mt=0;mt{lt.textContent="Failed to load diagram renderer",lt.style.cssText="padding:16px;color:var(--txM);font-size:13px;border:1px dashed var(--bd);border-radius:2px;text-align:center;"})}})(),()=>{H=!0}},[d,v,y]),w.useEffect(()=>{if(v)return;const Y=document.querySelectorAll(".tome-content pre"),H=[];return Y.forEach(U=>{if(U.querySelector(".tome-copy-btn"))return;const at=document.createElement("button");at.className="tome-copy-btn",at.textContent="Copy",at.addEventListener("click",async()=>{const lt=U.querySelector("code");if(lt)try{await navigator.clipboard.writeText(lt.textContent||""),at.textContent="Copied!",setTimeout(()=>{at.textContent="Copy"},2e3)}catch{at.textContent="Failed",setTimeout(()=>{at.textContent="Copy"},2e3)}}),U.appendChild(at),H.push(at)}),()=>{H.forEach(U=>U.remove())}},[d,v]);const R=Wn.map(Y=>({id:Y.id,title:Y.frontmatter.title,description:Y.frontmatter.description})),K=Wn.find(Y=>Y.id===u),nt=g0(K),xt=h0(Jn.editLink,K==null?void 0:K.filePath),Dt=(K==null?void 0:K.locale)||(Zu==null?void 0:Zu.defaultLocale)||"en",At="ltr";return w.useEffect(()=>{const Y=document.querySelectorAll(".tome-math[data-math]").length>0;if(!Jn.math&&!Y)return;const H="tome-katex-css";if(document.getElementById(H))return;const U=document.createElement("link");U.id=H,U.rel="stylesheet",U.href="https://cdn.jsdelivr.net/npm/katex@0.16.11/dist/katex.min.css",U.crossOrigin="anonymous",document.head.appendChild(U)},[d,v]),w.useEffect(()=>{const Y=document.querySelectorAll(".tome-math[data-math]");if(Y.length===0)return;let H=!1;const U="https://cdn.jsdelivr.net/npm/katex@0.16.11/dist/katex.mjs";return(async()=>{try{const at=(await import(U)).default;if(H)return;for(const lt of Y){const P=lt.getAttribute("data-math");if(P)try{const mt=atob(P),tt=lt.classList.contains("tome-math-block");at.render(mt,lt,{displayMode:tt,throwOnError:!1})}catch(mt){console.warn("[tome] KaTeX render failed:",mt)}}}catch(at){console.warn("[tome] Failed to load KaTeX from CDN:",at)}})(),()=>{H=!0}},[d,v]),s.jsxs(s.Fragment,{children:[s.jsx("style",{children:ng}),s.jsx(r0,{config:Jn,navigation:v0,currentPageId:u,pageHtml:d!=null&&d.isMdx?void 0:v?"":(d==null?void 0:d.html)||"Page not found
",pageComponent:d!=null&&d.isMdx?d.component:void 0,mdxComponents:eg,pageTitle:(d==null?void 0:d.frontmatter.title)||(v?"":"Not Found"),pageDescription:d==null?void 0:d.frontmatter.description,headings:(d==null?void 0:d.headings)||[],tocEnabled:(d==null?void 0:d.frontmatter.toc)!==!1,editUrl:xt,lastUpdated:K==null?void 0:K.lastUpdated,changelogEntries:d!=null&&d.isMdx||d==null?void 0:d.changelogEntries,apiManifest:!(d!=null&&d.isMdx)&&(d!=null&&d.isApiReference)?d.apiManifest:void 0,apiBaseUrl:(W=Jn.api)==null?void 0:W.baseUrl,apiPlayground:(I=Jn.api)==null?void 0:I.playground,apiAuth:(ct=Jn.api)==null?void 0:ct.auth,ApiReferenceComponent:N0,onNavigate:O,allPages:R,docContext:b0,versioning:void 0,currentVersion:nt,basePath:_o,isDraft:((Q=K==null?void 0:K.frontmatter)==null?void 0:Q.draft)===!0,dir:At,i18n:void 0,currentLocale:Dt,overrides:x0})]})}const om=document.getElementById("tome-root");om&&Bp.createRoot(om).render(s.jsx(ig,{}));
diff --git a/cli/commands/index.html b/cli/commands/index.html
index 5d4f155a..6896e11b 100644
--- a/cli/commands/index.html
+++ b/cli/commands/index.html
@@ -7,7 +7,7 @@
-
+
@@ -120,6 +120,23 @@ Press **Ctrl+X s** during streaming to inject a system-level instruction mid-tur
Example: While the model is writing code, press Ctrl+X s and type "Use async/await instead" to change the implementation approach.
+### Image attachments
+
+Attach images to your next prompt straight from the clipboard:
+
+- Copy an image (e.g. a screenshot) to the system clipboard, then press **Ctrl+V** in the input to attach it.
+- Press **Ctrl+U** to clear all pending image attachments.
+- Attachments are sent alongside your text when you submit, and cleared afterward.
+
+When a terminal supports color, Kit renders a small low-resolution **thumbnail preview** of each pending image directly in the input, below the `[N image(s) attached]` indicator, so you can confirm the right image was attached before sending.
+
+The preview is drawn with Unicode half-block characters and ordinary terminal colors — not a graphics protocol — so it renders correctly inside terminal multiplexers like **tmux** and **zellij**. Thumbnails are capped to a small cell box for a glanceable, low-res look.
+
+- Best fidelity needs a **truecolor** terminal (`COLORTERM=truecolor`); Kit degrades to 256-color where truecolor is unavailable.
+- On terminals with neither, the preview is skipped and the `[N image(s) attached]` text indicator is shown alone.
+
+You can also attach image files by referencing them with `@path/to/image.png` — binary files are auto-detected by MIME type. See [Quick Start](/quick-start) for the `@` attachment syntax.
+
## Prompt templates
### Creating templates
diff --git a/cli/flags/index.html b/cli/flags/index.html
index c69f375e..16a8ddf2 100644
--- a/cli/flags/index.html
+++ b/cli/flags/index.html
@@ -7,7 +7,7 @@
-
+
diff --git a/configuration/index.html b/configuration/index.html
index a48e7f48..567c3386 100644
--- a/configuration/index.html
+++ b/configuration/index.html
@@ -7,7 +7,7 @@
-
+
diff --git a/development/index.html b/development/index.html
index f23e8185..709b9051 100644
--- a/development/index.html
+++ b/development/index.html
@@ -7,7 +7,7 @@
-
+
diff --git a/extensions/capabilities/index.html b/extensions/capabilities/index.html
index 8adc1d16..5f0ff727 100644
--- a/extensions/capabilities/index.html
+++ b/extensions/capabilities/index.html
@@ -7,7 +7,7 @@
-
+
diff --git a/extensions/examples/index.html b/extensions/examples/index.html
index bd4123a5..7cfd1499 100644
--- a/extensions/examples/index.html
+++ b/extensions/examples/index.html
@@ -7,7 +7,7 @@
-
+
diff --git a/extensions/loading/index.html b/extensions/loading/index.html
index d268b140..e8949036 100644
--- a/extensions/loading/index.html
+++ b/extensions/loading/index.html
@@ -7,7 +7,7 @@
-
+
diff --git a/extensions/overview/index.html b/extensions/overview/index.html
index 695aa2d8..6272417d 100644
--- a/extensions/overview/index.html
+++ b/extensions/overview/index.html
@@ -7,7 +7,7 @@
-
+
diff --git a/extensions/testing/index.html b/extensions/testing/index.html
index 217d7ecd..61ae6343 100644
--- a/extensions/testing/index.html
+++ b/extensions/testing/index.html
@@ -7,7 +7,7 @@
-
+
diff --git a/index.html b/index.html
index ddd14aa3..0b13a6a6 100644
--- a/index.html
+++ b/index.html
@@ -15,7 +15,7 @@
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #333; border-radius: 3px; }
-
+
diff --git a/installation/index.html b/installation/index.html
index 995da841..23f4a1a0 100644
--- a/installation/index.html
+++ b/installation/index.html
@@ -7,7 +7,7 @@
-
+
diff --git a/llms-full.txt b/llms-full.txt
index 2dd42948..b1fac6a9 100644
--- a/llms-full.txt
+++ b/llms-full.txt
@@ -451,6 +451,23 @@ Press **Ctrl+X s** during streaming to inject a system-level instruction mid-tur
Example: While the model is writing code, press Ctrl+X s and type "Use async/await instead" to change the implementation approach.
+### Image attachments
+
+Attach images to your next prompt straight from the clipboard:
+
+- Copy an image (e.g. a screenshot) to the system clipboard, then press **Ctrl+V** in the input to attach it.
+- Press **Ctrl+U** to clear all pending image attachments.
+- Attachments are sent alongside your text when you submit, and cleared afterward.
+
+When a terminal supports color, Kit renders a small low-resolution **thumbnail preview** of each pending image directly in the input, below the `[N image(s) attached]` indicator, so you can confirm the right image was attached before sending.
+
+The preview is drawn with Unicode half-block characters and ordinary terminal colors — not a graphics protocol — so it renders correctly inside terminal multiplexers like **tmux** and **zellij**. Thumbnails are capped to a small cell box for a glanceable, low-res look.
+
+- Best fidelity needs a **truecolor** terminal (`COLORTERM=truecolor`); Kit degrades to 256-color where truecolor is unavailable.
+- On terminals with neither, the preview is skipped and the `[N image(s) attached]` text indicator is shown alone.
+
+You can also attach image files by referencing them with `@path/to/image.png` — binary files are auto-detected by MIME type. See [Quick Start](/quick-start) for the `@` attachment syntax.
+
## Prompt templates
### Creating templates
diff --git a/mcp.json b/mcp.json
index 40d24390..0ffba460 100644
--- a/mcp.json
+++ b/mcp.json
@@ -61,6 +61,7 @@
"Cancelling operations",
"External editor",
"Mid-turn steering",
+ "Image attachments",
"Prompt templates",
"Creating templates",
"Using templates",
@@ -69,7 +70,7 @@
"ACP server"
],
"tags": [],
- "content": "\n# Commands\n\n## Authentication\n\nFor OAuth-enabled providers like Anthropic.\n\n```bash\nkit auth login [provider] # Start OAuth flow (e.g., anthropic)\nkit auth login [provider] --set-default # Set provider's default model as system default\nkit auth logout [provider] # Remove credentials for provider\nkit auth status # Check authentication status\n```\n\n## Model database\n\nManage the local model database that maps provider names to API configurations.\n\n```bash\nkit models [provider] # List available models (optionally filter by provider)\nkit models --all # Show all providers (not just LLM-compatible)\nkit update-models [source] # Update model database\n```\n\nThe `update-models` command accepts an optional source argument:\n- *(none)* — update from [models.dev](https://models.dev)\n- A URL — fetch from a custom endpoint\n- A file path — load from a local file\n- `embedded` — reset to the bundled database\n\n## Extension management\n\n```bash\nkit extensions list # List discovered extensions\nkit extensions validate # Validate extension files\nkit extensions init # Generate example extension template\n```\n\n### Installing extensions from git\n\n```bash\nkit install # Install extensions from git repositories\nkit install -l # Install to project-local .kit/git/ directory\nkit install -u # Update an already-installed package\nkit install --uninstall # Remove an installed package\nkit install --all # Install all extensions without prompting\n```\n\n## Skills\n\n```bash\nkit skill # Install the Kit extensions skill via skills.sh\n```\n\n## Interactive slash commands\n\nThese commands are available inside the Kit TUI during an interactive session:\n\n| Command | Description |\n|---------|-------------|\n| `/help` | Show available commands |\n| `/tools` | List available MCP tools |\n| `/servers` | Show connected MCP servers |\n| `/model [name]` | Switch model or open model selector |\n| `/theme [name]` | Switch color theme or list available themes |\n| `/thinking [level]` | Set thinking level (off, none, minimal, low, medium, high) |\n| `/compact [focus]` | Summarize older messages to free context |\n| `/clear` | Clear conversation |\n| `/clear-queue` | Clear queued messages |\n| `/usage` | Show token usage |\n| `/reset-usage` | Reset usage statistics |\n| `/tree` | Navigate session tree |\n| `/fork` | Fork to new session from an earlier message |\n| `/new` | Start a new session (creates new session file) |\n| `/name [name]` | Set or show session display name |\n| `/resume` | Open session picker to switch sessions (alias: `/r`) |\n| `/session` | Show session info |\n| `/export [path]` | Export session as JSONL (default: auto-generated path) |\n| `/import ` | Import a session from a JSONL file |\n| `/share` | Upload session to GitHub Gist and get a shareable viewer URL |\n| `/quit` | Exit Kit |\n\n### Prompt history\n\nUse **↑** and **↓** arrow keys to navigate through previously submitted prompts. Kit keeps the last 100 entries. Consecutive duplicates are skipped.\n\n### Cancelling operations\n\nPress **ESC twice** to cancel the current operation:\n- During a tool call: rolls back the entire turn to maintain API message pairing\n- During streaming: stops the response generation\n\nThis ensures that `tool_use` and `tool_result` messages are always sent to the API as matched pairs, avoiding errors from orphaned tool calls.\n\n### External editor\n\nPress **Ctrl+X e** to open your `$VISUAL` or `$EDITOR` in a temporary file pre-populated with the current input text. On save and quit, the edited content replaces the input textarea. On error exit (e.g., `:cq` in Vim), the original input is preserved.\n\n### Mid-turn steering\n\nPress **Ctrl+X s** during streaming to inject a system-level instruction mid-turn. This allows you to steer the conversation direction without waiting for the model to finish:\n\n- Works during streaming output\n- Sends a steering instruction as a system message\n- Model continues from the interruption point with the new guidance\n\nExample: While the model is writing code, press Ctrl+X s and type \"Use async/await instead\" to change the implementation approach.\n\n## Prompt templates\n\n### Creating templates\n\nTemplates use YAML frontmatter for metadata and support argument placeholders:\n\n```markdown\n---\ndescription: Review code for issues\n---\nReview the following code for bugs and security issues.\nFocus on $1 specifically.\n```\n\nSave to `~/.kit/prompts/review.md` or `.kit/prompts/review.md`.\n\n### Using templates\n\nTemplates appear as slash commands:\n\n```\n/review error handling\n```\n\n### Argument placeholders\n\n| Placeholder | Description |\n|-------------|-------------|\n| `$1`, `$2`, etc. | Individual arguments by position |\n| `$@`, `$ARGUMENTS` | All arguments joined with spaces (zero or more) |\n| `$+` | All arguments joined with spaces (one or more required) |\n| `${@:N}` | Arguments from position N onwards |\n| `${@:N:L}` | L arguments starting at position N |\n\nPlaceholders inside fenced code blocks (`` ``` ``) and inline code spans are ignored, so documentation examples won't be substituted.\n\n### CLI flags\n\n```bash\n# Load a specific template by name\nkit --prompt-template review\n\n# Disable template loading\nkit --no-prompt-templates\n```\n\n## ACP server\n\nRun Kit as an [ACP (Agent Client Protocol)](https://agentclientprotocol.com) agent server. ACP-compatible clients communicate with Kit over JSON-RPC 2.0 on stdin/stdout.\n\n```bash\nkit acp # Start as ACP agent\nkit acp --debug # With debug logging to stderr\n```\n"
+ "content": "\n# Commands\n\n## Authentication\n\nFor OAuth-enabled providers like Anthropic.\n\n```bash\nkit auth login [provider] # Start OAuth flow (e.g., anthropic)\nkit auth login [provider] --set-default # Set provider's default model as system default\nkit auth logout [provider] # Remove credentials for provider\nkit auth status # Check authentication status\n```\n\n## Model database\n\nManage the local model database that maps provider names to API configurations.\n\n```bash\nkit models [provider] # List available models (optionally filter by provider)\nkit models --all # Show all providers (not just LLM-compatible)\nkit update-models [source] # Update model database\n```\n\nThe `update-models` command accepts an optional source argument:\n- *(none)* — update from [models.dev](https://models.dev)\n- A URL — fetch from a custom endpoint\n- A file path — load from a local file\n- `embedded` — reset to the bundled database\n\n## Extension management\n\n```bash\nkit extensions list # List discovered extensions\nkit extensions validate # Validate extension files\nkit extensions init # Generate example extension template\n```\n\n### Installing extensions from git\n\n```bash\nkit install # Install extensions from git repositories\nkit install -l # Install to project-local .kit/git/ directory\nkit install -u # Update an already-installed package\nkit install --uninstall # Remove an installed package\nkit install --all # Install all extensions without prompting\n```\n\n## Skills\n\n```bash\nkit skill # Install the Kit extensions skill via skills.sh\n```\n\n## Interactive slash commands\n\nThese commands are available inside the Kit TUI during an interactive session:\n\n| Command | Description |\n|---------|-------------|\n| `/help` | Show available commands |\n| `/tools` | List available MCP tools |\n| `/servers` | Show connected MCP servers |\n| `/model [name]` | Switch model or open model selector |\n| `/theme [name]` | Switch color theme or list available themes |\n| `/thinking [level]` | Set thinking level (off, none, minimal, low, medium, high) |\n| `/compact [focus]` | Summarize older messages to free context |\n| `/clear` | Clear conversation |\n| `/clear-queue` | Clear queued messages |\n| `/usage` | Show token usage |\n| `/reset-usage` | Reset usage statistics |\n| `/tree` | Navigate session tree |\n| `/fork` | Fork to new session from an earlier message |\n| `/new` | Start a new session (creates new session file) |\n| `/name [name]` | Set or show session display name |\n| `/resume` | Open session picker to switch sessions (alias: `/r`) |\n| `/session` | Show session info |\n| `/export [path]` | Export session as JSONL (default: auto-generated path) |\n| `/import ` | Import a session from a JSONL file |\n| `/share` | Upload session to GitHub Gist and get a shareable viewer URL |\n| `/quit` | Exit Kit |\n\n### Prompt history\n\nUse **↑** and **↓** arrow keys to navigate through previously submitted prompts. Kit keeps the last 100 entries. Consecutive duplicates are skipped.\n\n### Cancelling operations\n\nPress **ESC twice** to cancel the current operation:\n- During a tool call: rolls back the entire turn to maintain API message pairing\n- During streaming: stops the response generation\n\nThis ensures that `tool_use` and `tool_result` messages are always sent to the API as matched pairs, avoiding errors from orphaned tool calls.\n\n### External editor\n\nPress **Ctrl+X e** to open your `$VISUAL` or `$EDITOR` in a temporary file pre-populated with the current input text. On save and quit, the edited content replaces the input textarea. On error exit (e.g., `:cq` in Vim), the original input is preserved.\n\n### Mid-turn steering\n\nPress **Ctrl+X s** during streaming to inject a system-level instruction mid-turn. This allows you to steer the conversation direction without waiting for the model to finish:\n\n- Works during streaming output\n- Sends a steering instruction as a system message\n- Model continues from the interruption point with the new guidance\n\nExample: While the model is writing code, press Ctrl+X s and type \"Use async/await instead\" to change the implementation approach.\n\n### Image attachments\n\nAttach images to your next prompt straight from the clipboard:\n\n- Copy an image (e.g. a screenshot) to the system clipboard, then press **Ctrl+V** in the input to attach it.\n- Press **Ctrl+U** to clear all pending image attachments.\n- Attachments are sent alongside your text when you submit, and cleared afterward.\n\nWhen a terminal supports color, Kit renders a small low-resolution **thumbnail preview** of each pending image directly in the input, below the `[N image(s) attached]` indicator, so you can confirm the right image was attached before sending.\n\nThe preview is drawn with Unicode half-block characters and ordinary terminal colors — not a graphics protocol — so it renders correctly inside terminal multiplexers like **tmux** and **zellij**. Thumbnails are capped to a small cell box for a glanceable, low-res look.\n\n- Best fidelity needs a **truecolor** terminal (`COLORTERM=truecolor`); Kit degrades to 256-color where truecolor is unavailable.\n- On terminals with neither, the preview is skipped and the `[N image(s) attached]` text indicator is shown alone.\n\nYou can also attach image files by referencing them with `@path/to/image.png` — binary files are auto-detected by MIME type. See [Quick Start](/quick-start) for the `@` attachment syntax.\n\n## Prompt templates\n\n### Creating templates\n\nTemplates use YAML frontmatter for metadata and support argument placeholders:\n\n```markdown\n---\ndescription: Review code for issues\n---\nReview the following code for bugs and security issues.\nFocus on $1 specifically.\n```\n\nSave to `~/.kit/prompts/review.md` or `.kit/prompts/review.md`.\n\n### Using templates\n\nTemplates appear as slash commands:\n\n```\n/review error handling\n```\n\n### Argument placeholders\n\n| Placeholder | Description |\n|-------------|-------------|\n| `$1`, `$2`, etc. | Individual arguments by position |\n| `$@`, `$ARGUMENTS` | All arguments joined with spaces (zero or more) |\n| `$+` | All arguments joined with spaces (one or more required) |\n| `${@:N}` | Arguments from position N onwards |\n| `${@:N:L}` | L arguments starting at position N |\n\nPlaceholders inside fenced code blocks (`` ``` ``) and inline code spans are ignored, so documentation examples won't be substituted.\n\n### CLI flags\n\n```bash\n# Load a specific template by name\nkit --prompt-template review\n\n# Disable template loading\nkit --no-prompt-templates\n```\n\n## ACP server\n\nRun Kit as an [ACP (Agent Client Protocol)](https://agentclientprotocol.com) agent server. ACP-compatible clients communicate with Kit over JSON-RPC 2.0 on stdin/stdout.\n\n```bash\nkit acp # Start as ACP agent\nkit acp --debug # With debug logging to stderr\n```\n"
},
{
"url": "/cli/flags",
diff --git a/providers/index.html b/providers/index.html
index ee9a14e2..75c23a25 100644
--- a/providers/index.html
+++ b/providers/index.html
@@ -7,7 +7,7 @@
-
+
diff --git a/quick-start/index.html b/quick-start/index.html
index c4fbb64e..cc8cc000 100644
--- a/quick-start/index.html
+++ b/quick-start/index.html
@@ -7,7 +7,7 @@
-
+
diff --git a/sdk/callbacks/index.html b/sdk/callbacks/index.html
index 727ba553..de6c3778 100644
--- a/sdk/callbacks/index.html
+++ b/sdk/callbacks/index.html
@@ -7,7 +7,7 @@
-
+
diff --git a/sdk/options/index.html b/sdk/options/index.html
index 237ac008..c293a052 100644
--- a/sdk/options/index.html
+++ b/sdk/options/index.html
@@ -7,7 +7,7 @@
-
+
diff --git a/sdk/overview/index.html b/sdk/overview/index.html
index 5c068c59..17fa6c80 100644
--- a/sdk/overview/index.html
+++ b/sdk/overview/index.html
@@ -7,7 +7,7 @@
-
+
diff --git a/sdk/sessions/index.html b/sdk/sessions/index.html
index 939fcd2a..37d6618c 100644
--- a/sdk/sessions/index.html
+++ b/sdk/sessions/index.html
@@ -7,7 +7,7 @@
-
+
diff --git a/search.json b/search.json
index 53017093..74cd59cd 100644
--- a/search.json
+++ b/search.json
@@ -68,6 +68,7 @@
"Cancelling operations",
"External editor",
"Mid-turn steering",
+ "Image attachments",
"Prompt templates",
"Creating templates",
"Using templates",
@@ -76,7 +77,7 @@
"ACP server"
],
"tags": [],
- "wordCount": 857
+ "wordCount": 1053
},
{
"id": "cli/flags",
diff --git a/sessions/index.html b/sessions/index.html
index bdb5e344..027702c2 100644
--- a/sessions/index.html
+++ b/sessions/index.html
@@ -7,7 +7,7 @@
-
+
diff --git a/themes/index.html b/themes/index.html
index 8714a528..0e275f5e 100644
--- a/themes/index.html
+++ b/themes/index.html
@@ -7,7 +7,7 @@
-
+