markstream-react 0.0.3-beta.1 → 0.0.3-beta.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,155 +1,155 @@
1
- import e,{useMemo as n,useState as t,createContext as r,useContext as o,useRef as i,useEffect as l,useCallback as a,useLayoutEffect as s,useSyncExternalStore as c}from"react";import{getMarkdown as d,parseMarkdownToStructure as u}from"stream-markdown-parser";import{autoUpdate as m,computePosition as h,offset as p,flip as f,shift as g}from"@floating-ui/dom";import{createPortal as v}from"react-dom";var w,x,y,k={exports:{}},b={},j={};var M=(y||(y=1,"production"===process.env.NODE_ENV?k.exports=function(){if(w)return b;w=1;var n=e,t=/* @__PURE__ */Symbol.for("react.element"),r=/* @__PURE__ */Symbol.for("react.fragment"),o=Object.prototype.hasOwnProperty,i=n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,l={key:!0,ref:!0,__self:!0,__source:!0};function a(e,n,r){var a,s={},c=null,d=null;for(a in void 0!==r&&(c=""+r),void 0!==n.key&&(c=""+n.key),void 0!==n.ref&&(d=n.ref),n)o.call(n,a)&&!l.hasOwnProperty(a)&&(s[a]=n[a]);if(e&&e.defaultProps)for(a in n=e.defaultProps)void 0===s[a]&&(s[a]=n[a]);return{$$typeof:t,type:e,key:c,ref:d,props:s,_owner:i.current}}return b.Fragment=r,b.jsx=a,b.jsxs=a,b}():k.exports=(x||(x=1,"production"!==process.env.NODE_ENV&&function(){var n,t=e,r=/* @__PURE__ */Symbol.for("react.element"),o=/* @__PURE__ */Symbol.for("react.portal"),i=/* @__PURE__ */Symbol.for("react.fragment"),l=/* @__PURE__ */Symbol.for("react.strict_mode"),a=/* @__PURE__ */Symbol.for("react.profiler"),s=/* @__PURE__ */Symbol.for("react.provider"),c=/* @__PURE__ */Symbol.for("react.context"),d=/* @__PURE__ */Symbol.for("react.forward_ref"),u=/* @__PURE__ */Symbol.for("react.suspense"),m=/* @__PURE__ */Symbol.for("react.suspense_list"),h=/* @__PURE__ */Symbol.for("react.memo"),p=/* @__PURE__ */Symbol.for("react.lazy"),f=/* @__PURE__ */Symbol.for("react.offscreen"),g=Symbol.iterator,v=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function w(e){for(var n=arguments.length,t=new Array(n>1?n-1:0),r=1;r<n;r++)t[r-1]=arguments[r];!function(e,n,t){var r=v.ReactDebugCurrentFrame.getStackAddendum();""!==r&&(n+="%s",t=t.concat([r]));var o=t.map(function(e){return String(e)});o.unshift("Warning: "+n),Function.prototype.apply.call(console.error,console,o)}(0,e,t)}function x(e){return e.displayName||"Context"}function y(e){if(null==e)return null;if("number"==typeof e.tag&&w("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),"function"==typeof e)return e.displayName||e.name||null;if("string"==typeof e)return e;switch(e){case i:return"Fragment";case o:return"Portal";case a:return"Profiler";case l:return"StrictMode";case u:return"Suspense";case m:return"SuspenseList"}if("object"==typeof e)switch(e.$$typeof){case c:return x(e)+".Consumer";case s:return x(e._context)+".Provider";case d:return function(e,n,t){var r=e.displayName;if(r)return r;var o=n.displayName||n.name||"";return""!==o?t+"("+o+")":t}(e,e.render,"ForwardRef");case h:var n=e.displayName||null;return null!==n?n:y(e.type)||"Memo";case p:var t=e,r=t._payload,f=t._init;try{return y(f(r))}catch(g){return null}}return null}n=/* @__PURE__ */Symbol.for("react.module.reference");var k,b,M,N,C,S,B,E=Object.assign,T=0;function _(){}_.__reactDisabledLog=!0;var L,$=v.ReactCurrentDispatcher;function P(e,n,t){if(void 0===L)try{throw Error()}catch(o){var r=o.stack.trim().match(/\n( *(at )?)/);L=r&&r[1]||""}return"\n"+L+e}var R,D=!1,O="function"==typeof WeakMap?WeakMap:Map;function A(e,n){if(!e||D)return"";var t,r=R.get(e);if(void 0!==r)return r;D=!0;var o,i=Error.prepareStackTrace;Error.prepareStackTrace=void 0,o=$.current,$.current=null,function(){if(0===T){k=console.log,b=console.info,M=console.warn,N=console.error,C=console.group,S=console.groupCollapsed,B=console.groupEnd;var e={configurable:!0,enumerable:!0,value:_,writable:!0};Object.defineProperties(console,{info:e,log:e,warn:e,error:e,group:e,groupCollapsed:e,groupEnd:e})}T++}();try{if(n){var l=function(){throw Error()};if(Object.defineProperty(l.prototype,"props",{set:function(){throw Error()}}),"object"==typeof Reflect&&Reflect.construct){try{Reflect.construct(l,[])}catch(p){t=p}Reflect.construct(e,[],l)}else{try{l.call()}catch(p){t=p}e.call(l.prototype)}}else{try{throw Error()}catch(p){t=p}e()}}catch(f){if(f&&t&&"string"==typeof f.stack){for(var a=f.stack.split("\n"),s=t.stack.split("\n"),c=a.length-1,d=s.length-1;c>=1&&d>=0&&a[c]!==s[d];)d--;for(;c>=1&&d>=0;c--,d--)if(a[c]!==s[d]){if(1!==c||1!==d)do{if(c--,--d<0||a[c]!==s[d]){var u="\n"+a[c].replace(" at new "," at ");return e.displayName&&u.includes("<anonymous>")&&(u=u.replace("<anonymous>",e.displayName)),"function"==typeof e&&R.set(e,u),u}}while(c>=1&&d>=0);break}}}finally{D=!1,$.current=o,function(){if(0===--T){var e={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:E({},e,{value:k}),info:E({},e,{value:b}),warn:E({},e,{value:M}),error:E({},e,{value:N}),group:E({},e,{value:C}),groupCollapsed:E({},e,{value:S}),groupEnd:E({},e,{value:B})})}T<0&&w("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}(),Error.prepareStackTrace=i}var m=e?e.displayName||e.name:"",h=m?P(m):"";return"function"==typeof e&&R.set(e,h),h}function W(e,n,t){if(null==e)return"";if("function"==typeof e)return A(e,!(!(r=e.prototype)||!r.isReactComponent));var r;if("string"==typeof e)return P(e);switch(e){case u:return P("Suspense");case m:return P("SuspenseList")}if("object"==typeof e)switch(e.$$typeof){case d:return A(e.render,!1);case h:return W(e.type,n,t);case p:var o=e,i=o._payload,l=o._init;try{return W(l(i),n,t)}catch(a){}}return""}R=new O;var I=Object.prototype.hasOwnProperty,F={},z=v.ReactDebugCurrentFrame;function H(e){if(e){var n=e._owner,t=W(e.type,e._source,n?n.type:null);z.setExtraStackFrame(t)}else z.setExtraStackFrame(null)}var V=Array.isArray;function K(e){return V(e)}function X(e){return""+e}function U(e){if(function(e){try{return X(e),!1}catch(n){return!0}}(e))return w("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",function(e){return"function"==typeof Symbol&&Symbol.toStringTag&&e[Symbol.toStringTag]||e.constructor.name||"Object"}(e)),X(e)}var q,Y,Z,J=v.ReactCurrentOwner,G={key:!0,ref:!0,__self:!0,__source:!0},Q=v.ReactCurrentOwner,ee=v.ReactDebugCurrentFrame;function ne(e){if(e){var n=e._owner,t=W(e.type,e._source,n?n.type:null);ee.setExtraStackFrame(t)}else ee.setExtraStackFrame(null)}function te(e){return"object"==typeof e&&null!==e&&e.$$typeof===r}function re(){if(Q.current){var e=y(Q.current.type);if(e)return"\n\nCheck the render method of `"+e+"`."}return""}Z=!1;var oe={};function ie(e,n){if(e._store&&!e._store.validated&&null==e.key){e._store.validated=!0;var t=function(e){var n=re();if(!n){var t="string"==typeof e?e:e.displayName||e.name;t&&(n="\n\nCheck the top-level render call using <"+t+">.")}return n}(n);if(!oe[t]){oe[t]=!0;var r="";e&&e._owner&&e._owner!==Q.current&&(r=" It was passed a child from "+y(e._owner.type)+"."),ne(e),w('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',t,r),ne(null)}}}function le(e,n){if("object"==typeof e)if(K(e))for(var t=0;t<e.length;t++){var r=e[t];te(r)&&ie(r,n)}else if(te(e))e._store&&(e._store.validated=!0);else if(e){var o=function(e){if(null===e||"object"!=typeof e)return null;var n=g&&e[g]||e["@@iterator"];return"function"==typeof n?n:null}(e);if("function"==typeof o&&o!==e.entries)for(var i,l=o.call(e);!(i=l.next()).done;)te(i.value)&&ie(i.value,n)}}var ae={};function se(e,t,o,g,v,x){var k=function(e){return"string"==typeof e||"function"==typeof e||e===i||e===a||e===l||e===u||e===m||e===f||"object"==typeof e&&null!==e&&(e.$$typeof===p||e.$$typeof===h||e.$$typeof===s||e.$$typeof===c||e.$$typeof===d||e.$$typeof===n||void 0!==e.getModuleId)}(e);if(!k){var b,j="";(void 0===e||"object"==typeof e&&null!==e&&0===Object.keys(e).length)&&(j+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports."),j+=re(),null===e?b="null":K(e)?b="array":void 0!==e&&e.$$typeof===r?(b="<"+(y(e.type)||"Unknown")+" />",j=" Did you accidentally export a JSX literal instead of a component?"):b=typeof e,w("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",b,j)}var M=function(e,n,t,o,i){var l,a={},s=null,c=null;for(l in void 0!==t&&(U(t),s=""+t),function(e){if(I.call(e,"key")){var n=Object.getOwnPropertyDescriptor(e,"key").get;if(n&&n.isReactWarning)return!1}return void 0!==e.key}(n)&&(U(n.key),s=""+n.key),function(e){if(I.call(e,"ref")){var n=Object.getOwnPropertyDescriptor(e,"ref").get;if(n&&n.isReactWarning)return!1}return void 0!==e.ref}(n)&&(c=n.ref,function(e){"string"==typeof e.ref&&J.current}(n)),n)I.call(n,l)&&!G.hasOwnProperty(l)&&(a[l]=n[l]);if(e&&e.defaultProps){var d=e.defaultProps;for(l in d)void 0===a[l]&&(a[l]=d[l])}if(s||c){var u="function"==typeof e?e.displayName||e.name||"Unknown":e;s&&function(e,n){var t=function(){q||(q=!0,w("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",n))};t.isReactWarning=!0,Object.defineProperty(e,"key",{get:t,configurable:!0})}(a,u),c&&function(e,n){var t=function(){Y||(Y=!0,w("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",n))};t.isReactWarning=!0,Object.defineProperty(e,"ref",{get:t,configurable:!0})}(a,u)}return function(e,n,t,o,i,l,a){var s={$$typeof:r,type:e,key:n,ref:t,props:a,_owner:l,_store:{}};return Object.defineProperty(s._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(s,"_self",{configurable:!1,enumerable:!1,writable:!1,value:o}),Object.defineProperty(s,"_source",{configurable:!1,enumerable:!1,writable:!1,value:i}),Object.freeze&&(Object.freeze(s.props),Object.freeze(s)),s}(e,s,c,i,o,J.current,a)}(e,t,o,v,x);if(null==M)return M;if(k){var N=t.children;if(void 0!==N)if(g)if(K(N)){for(var C=0;C<N.length;C++)le(N[C],e);Object.freeze&&Object.freeze(N)}else w("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else le(N,e)}if(I.call(t,"key")){var S=y(e),B=Object.keys(t).filter(function(e){return"key"!==e}),E=B.length>0?"{key: someKey, "+B.join(": ..., ")+": ...}":"{key: someKey}";ae[S+E]||(w('A props object containing a "key" prop is being spread into JSX:\n let props = %s;\n <%s {...props} />\nReact keys must be passed directly to JSX without using spread:\n let props = %s;\n <%s key={someKey} {...props} />',E,S,B.length>0?"{"+B.join(": ..., ")+": ...}":"{}",S),ae[S+E]=!0)}return e===i?function(e){for(var n=Object.keys(e.props),t=0;t<n.length;t++){var r=n[t];if("children"!==r&&"key"!==r){ne(e),w("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",r),ne(null);break}}null!==e.ref&&(ne(e),w("Invalid attribute `ref` supplied to `React.Fragment`."),ne(null))}(M):function(e){var n,t=e.type;if(null!=t&&"string"!=typeof t){if("function"==typeof t)n=t.propTypes;else{if("object"!=typeof t||t.$$typeof!==d&&t.$$typeof!==h)return;n=t.propTypes}if(n){var r=y(t);!function(e,n,t,r,o){var i=Function.call.bind(I);for(var l in e)if(i(e,l)){var a=void 0;try{if("function"!=typeof e[l]){var s=Error((r||"React class")+": "+t+" type `"+l+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[l]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw s.name="Invariant Violation",s}a=e[l](n,l,r,t,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(c){a=c}!a||a instanceof Error||(H(o),w("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",r||"React class",t,l,typeof a),H(null)),a instanceof Error&&!(a.message in F)&&(F[a.message]=!0,H(o),w("Failed %s type: %s",t,a.message),H(null))}}(n,e.props,"prop",r,e)}else void 0===t.PropTypes||Z||(Z=!0,w("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",y(t)||"Unknown"));"function"!=typeof t.getDefaultProps||t.getDefaultProps.isReactClassApproved||w("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}(M),M}j.Fragment=i,j.jsx=function(e,n,t){return se(e,n,t,!1)},j.jsxs=function(e,n,t){return se(e,n,t,!0)}}()),j)),k.exports);const N=/* @__PURE__ */new Set(["image","table","code_block","html_block","blockquote","list","list_item","definition_list","footnote","footnote_reference","footnote_anchor","admonition","thematic_break","math_block","thinking","vmr_container"]);function C(e){if(Array.isArray(e)&&0!==e.length)return e.reduce((e,[n,t])=>n?(e["for"===n?"htmlFor":"class"===n?"className":n]=null==t||t,e):e,{})}function S(e,n,t,r){if(!Array.isArray(e)||0===e.length)return null;const o=[];for(let i=0;i<e.length;i++){const l=e[i];if(l){if("label_open"===l.type){const a=[];for(i++;i<e.length;){const n=e[i];if("label_close"===(null==n?void 0:n.type))break;n&&a.push(n),i++}const s=`${t}-label-${i}`;o.push(
2
- /* @__PURE__ */M.jsx("label",{...C(l.attrs),children:S(a,n,`${s}-child`,r)},s));continue}"label_close"!==l.type&&o.push(r(l,`${t}-${i}`,n))}}return o}function B(e,n,t,r){/* @__PURE__ */
3
- return M.jsx(M.Fragment,{children:S(e,n,`${t}-inline`,r)})}const E={note:"ℹ️",info:"ℹ️",tip:"💡",warning:"⚠️",danger:"❗",error:"⛔",caution:"⚠️"};function T(e){const{node:r,ctx:o,renderNode:i,indexKey:l,isDark:a}=e,s=String(r.kind||"note"),c=n(()=>r.title&&String(r.title).trim().length?String(r.title):s.charAt(0).toUpperCase()+s.slice(1),[s,r.title]),[d,u]=t(()=>{var e;return!!r.collapsible&&!(null==(e=r.open)||e)}),m=n(()=>`admonition-${Math.random().toString(36).slice(2,9)}`,[]);/* @__PURE__ */
1
+ import e,{useMemo as t,useState as n,createContext as r,useContext as o,useRef as i,useEffect as l,useCallback as a,useSyncExternalStore as s,useLayoutEffect as c}from"react";import{getMarkdown as d,parseMarkdownToStructure as u}from"stream-markdown-parser";import{autoUpdate as m,computePosition as h,offset as p,flip as f,shift as g}from"@floating-ui/dom";import{createPortal as v}from"react-dom";var w,x,y,b={exports:{}},k={},j={};var M=(y||(y=1,"production"===process.env.NODE_ENV?b.exports=function(){if(w)return k;w=1;var t=e,n=/* @__PURE__ */Symbol.for("react.element"),r=/* @__PURE__ */Symbol.for("react.fragment"),o=Object.prototype.hasOwnProperty,i=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,l={key:!0,ref:!0,__self:!0,__source:!0};function a(e,t,r){var a,s={},c=null,d=null;for(a in void 0!==r&&(c=""+r),void 0!==t.key&&(c=""+t.key),void 0!==t.ref&&(d=t.ref),t)o.call(t,a)&&!l.hasOwnProperty(a)&&(s[a]=t[a]);if(e&&e.defaultProps)for(a in t=e.defaultProps)void 0===s[a]&&(s[a]=t[a]);return{$$typeof:n,type:e,key:c,ref:d,props:s,_owner:i.current}}return k.Fragment=r,k.jsx=a,k.jsxs=a,k}():b.exports=(x||(x=1,"production"!==process.env.NODE_ENV&&function(){var t,n=e,r=/* @__PURE__ */Symbol.for("react.element"),o=/* @__PURE__ */Symbol.for("react.portal"),i=/* @__PURE__ */Symbol.for("react.fragment"),l=/* @__PURE__ */Symbol.for("react.strict_mode"),a=/* @__PURE__ */Symbol.for("react.profiler"),s=/* @__PURE__ */Symbol.for("react.provider"),c=/* @__PURE__ */Symbol.for("react.context"),d=/* @__PURE__ */Symbol.for("react.forward_ref"),u=/* @__PURE__ */Symbol.for("react.suspense"),m=/* @__PURE__ */Symbol.for("react.suspense_list"),h=/* @__PURE__ */Symbol.for("react.memo"),p=/* @__PURE__ */Symbol.for("react.lazy"),f=/* @__PURE__ */Symbol.for("react.offscreen"),g=Symbol.iterator,v=n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function w(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];!function(e,t,n){var r=v.ReactDebugCurrentFrame.getStackAddendum();""!==r&&(t+="%s",n=n.concat([r]));var o=n.map(function(e){return String(e)});o.unshift("Warning: "+t),Function.prototype.apply.call(console.error,console,o)}(0,e,n)}function x(e){return e.displayName||"Context"}function y(e){if(null==e)return null;if("number"==typeof e.tag&&w("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),"function"==typeof e)return e.displayName||e.name||null;if("string"==typeof e)return e;switch(e){case i:return"Fragment";case o:return"Portal";case a:return"Profiler";case l:return"StrictMode";case u:return"Suspense";case m:return"SuspenseList"}if("object"==typeof e)switch(e.$$typeof){case c:return x(e)+".Consumer";case s:return x(e._context)+".Provider";case d:return function(e,t,n){var r=e.displayName;if(r)return r;var o=t.displayName||t.name||"";return""!==o?n+"("+o+")":n}(e,e.render,"ForwardRef");case h:var t=e.displayName||null;return null!==t?t:y(e.type)||"Memo";case p:var n=e,r=n._payload,f=n._init;try{return y(f(r))}catch(g){return null}}return null}t=/* @__PURE__ */Symbol.for("react.module.reference");var b,k,M,N,C,S,B,E=Object.assign,_=0;function T(){}T.__reactDisabledLog=!0;var L,$=v.ReactCurrentDispatcher;function O(e,t,n){if(void 0===L)try{throw Error()}catch(o){var r=o.stack.trim().match(/\n( *(at )?)/);L=r&&r[1]||""}return"\n"+L+e}var P,R=!1,D="function"==typeof WeakMap?WeakMap:Map;function W(e,t){if(!e||R)return"";var n,r=P.get(e);if(void 0!==r)return r;R=!0;var o,i=Error.prepareStackTrace;Error.prepareStackTrace=void 0,o=$.current,$.current=null,function(){if(0===_){b=console.log,k=console.info,M=console.warn,N=console.error,C=console.group,S=console.groupCollapsed,B=console.groupEnd;var e={configurable:!0,enumerable:!0,value:T,writable:!0};Object.defineProperties(console,{info:e,log:e,warn:e,error:e,group:e,groupCollapsed:e,groupEnd:e})}_++}();try{if(t){var l=function(){throw Error()};if(Object.defineProperty(l.prototype,"props",{set:function(){throw Error()}}),"object"==typeof Reflect&&Reflect.construct){try{Reflect.construct(l,[])}catch(p){n=p}Reflect.construct(e,[],l)}else{try{l.call()}catch(p){n=p}e.call(l.prototype)}}else{try{throw Error()}catch(p){n=p}e()}}catch(f){if(f&&n&&"string"==typeof f.stack){for(var a=f.stack.split("\n"),s=n.stack.split("\n"),c=a.length-1,d=s.length-1;c>=1&&d>=0&&a[c]!==s[d];)d--;for(;c>=1&&d>=0;c--,d--)if(a[c]!==s[d]){if(1!==c||1!==d)do{if(c--,--d<0||a[c]!==s[d]){var u="\n"+a[c].replace(" at new "," at ");return e.displayName&&u.includes("<anonymous>")&&(u=u.replace("<anonymous>",e.displayName)),"function"==typeof e&&P.set(e,u),u}}while(c>=1&&d>=0);break}}}finally{R=!1,$.current=o,function(){if(0===--_){var e={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:E({},e,{value:b}),info:E({},e,{value:k}),warn:E({},e,{value:M}),error:E({},e,{value:N}),group:E({},e,{value:C}),groupCollapsed:E({},e,{value:S}),groupEnd:E({},e,{value:B})})}_<0&&w("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}(),Error.prepareStackTrace=i}var m=e?e.displayName||e.name:"",h=m?O(m):"";return"function"==typeof e&&P.set(e,h),h}function A(e,t,n){if(null==e)return"";if("function"==typeof e)return W(e,!(!(r=e.prototype)||!r.isReactComponent));var r;if("string"==typeof e)return O(e);switch(e){case u:return O("Suspense");case m:return O("SuspenseList")}if("object"==typeof e)switch(e.$$typeof){case d:return W(e.render,!1);case h:return A(e.type,t,n);case p:var o=e,i=o._payload,l=o._init;try{return A(l(i),t,n)}catch(a){}}return""}P=new D;var I=Object.prototype.hasOwnProperty,F={},z=v.ReactDebugCurrentFrame;function H(e){if(e){var t=e._owner,n=A(e.type,e._source,t?t.type:null);z.setExtraStackFrame(n)}else z.setExtraStackFrame(null)}var V=Array.isArray;function K(e){return V(e)}function X(e){return""+e}function q(e){if(function(e){try{return X(e),!1}catch(t){return!0}}(e))return w("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",function(e){return"function"==typeof Symbol&&Symbol.toStringTag&&e[Symbol.toStringTag]||e.constructor.name||"Object"}(e)),X(e)}var U,Y,Z,J=v.ReactCurrentOwner,G={key:!0,ref:!0,__self:!0,__source:!0},Q=v.ReactCurrentOwner,ee=v.ReactDebugCurrentFrame;function te(e){if(e){var t=e._owner,n=A(e.type,e._source,t?t.type:null);ee.setExtraStackFrame(n)}else ee.setExtraStackFrame(null)}function ne(e){return"object"==typeof e&&null!==e&&e.$$typeof===r}function re(){if(Q.current){var e=y(Q.current.type);if(e)return"\n\nCheck the render method of `"+e+"`."}return""}Z=!1;var oe={};function ie(e,t){if(e._store&&!e._store.validated&&null==e.key){e._store.validated=!0;var n=function(e){var t=re();if(!t){var n="string"==typeof e?e:e.displayName||e.name;n&&(t="\n\nCheck the top-level render call using <"+n+">.")}return t}(t);if(!oe[n]){oe[n]=!0;var r="";e&&e._owner&&e._owner!==Q.current&&(r=" It was passed a child from "+y(e._owner.type)+"."),te(e),w('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',n,r),te(null)}}}function le(e,t){if("object"==typeof e)if(K(e))for(var n=0;n<e.length;n++){var r=e[n];ne(r)&&ie(r,t)}else if(ne(e))e._store&&(e._store.validated=!0);else if(e){var o=function(e){if(null===e||"object"!=typeof e)return null;var t=g&&e[g]||e["@@iterator"];return"function"==typeof t?t:null}(e);if("function"==typeof o&&o!==e.entries)for(var i,l=o.call(e);!(i=l.next()).done;)ne(i.value)&&ie(i.value,t)}}var ae={};function se(e,n,o,g,v,x){var b=function(e){return"string"==typeof e||"function"==typeof e||e===i||e===a||e===l||e===u||e===m||e===f||"object"==typeof e&&null!==e&&(e.$$typeof===p||e.$$typeof===h||e.$$typeof===s||e.$$typeof===c||e.$$typeof===d||e.$$typeof===t||void 0!==e.getModuleId)}(e);if(!b){var k,j="";(void 0===e||"object"==typeof e&&null!==e&&0===Object.keys(e).length)&&(j+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports."),j+=re(),null===e?k="null":K(e)?k="array":void 0!==e&&e.$$typeof===r?(k="<"+(y(e.type)||"Unknown")+" />",j=" Did you accidentally export a JSX literal instead of a component?"):k=typeof e,w("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",k,j)}var M=function(e,t,n,o,i){var l,a={},s=null,c=null;for(l in void 0!==n&&(q(n),s=""+n),function(e){if(I.call(e,"key")){var t=Object.getOwnPropertyDescriptor(e,"key").get;if(t&&t.isReactWarning)return!1}return void 0!==e.key}(t)&&(q(t.key),s=""+t.key),function(e){if(I.call(e,"ref")){var t=Object.getOwnPropertyDescriptor(e,"ref").get;if(t&&t.isReactWarning)return!1}return void 0!==e.ref}(t)&&(c=t.ref,function(e){"string"==typeof e.ref&&J.current}(t)),t)I.call(t,l)&&!G.hasOwnProperty(l)&&(a[l]=t[l]);if(e&&e.defaultProps){var d=e.defaultProps;for(l in d)void 0===a[l]&&(a[l]=d[l])}if(s||c){var u="function"==typeof e?e.displayName||e.name||"Unknown":e;s&&function(e,t){var n=function(){U||(U=!0,w("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",t))};n.isReactWarning=!0,Object.defineProperty(e,"key",{get:n,configurable:!0})}(a,u),c&&function(e,t){var n=function(){Y||(Y=!0,w("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",t))};n.isReactWarning=!0,Object.defineProperty(e,"ref",{get:n,configurable:!0})}(a,u)}return function(e,t,n,o,i,l,a){var s={$$typeof:r,type:e,key:t,ref:n,props:a,_owner:l,_store:{}};return Object.defineProperty(s._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(s,"_self",{configurable:!1,enumerable:!1,writable:!1,value:o}),Object.defineProperty(s,"_source",{configurable:!1,enumerable:!1,writable:!1,value:i}),Object.freeze&&(Object.freeze(s.props),Object.freeze(s)),s}(e,s,c,i,o,J.current,a)}(e,n,o,v,x);if(null==M)return M;if(b){var N=n.children;if(void 0!==N)if(g)if(K(N)){for(var C=0;C<N.length;C++)le(N[C],e);Object.freeze&&Object.freeze(N)}else w("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else le(N,e)}if(I.call(n,"key")){var S=y(e),B=Object.keys(n).filter(function(e){return"key"!==e}),E=B.length>0?"{key: someKey, "+B.join(": ..., ")+": ...}":"{key: someKey}";ae[S+E]||(w('A props object containing a "key" prop is being spread into JSX:\n let props = %s;\n <%s {...props} />\nReact keys must be passed directly to JSX without using spread:\n let props = %s;\n <%s key={someKey} {...props} />',E,S,B.length>0?"{"+B.join(": ..., ")+": ...}":"{}",S),ae[S+E]=!0)}return e===i?function(e){for(var t=Object.keys(e.props),n=0;n<t.length;n++){var r=t[n];if("children"!==r&&"key"!==r){te(e),w("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",r),te(null);break}}null!==e.ref&&(te(e),w("Invalid attribute `ref` supplied to `React.Fragment`."),te(null))}(M):function(e){var t,n=e.type;if(null!=n&&"string"!=typeof n){if("function"==typeof n)t=n.propTypes;else{if("object"!=typeof n||n.$$typeof!==d&&n.$$typeof!==h)return;t=n.propTypes}if(t){var r=y(n);!function(e,t,n,r,o){var i=Function.call.bind(I);for(var l in e)if(i(e,l)){var a=void 0;try{if("function"!=typeof e[l]){var s=Error((r||"React class")+": "+n+" type `"+l+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[l]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw s.name="Invariant Violation",s}a=e[l](t,l,r,n,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(c){a=c}!a||a instanceof Error||(H(o),w("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",r||"React class",n,l,typeof a),H(null)),a instanceof Error&&!(a.message in F)&&(F[a.message]=!0,H(o),w("Failed %s type: %s",n,a.message),H(null))}}(t,e.props,"prop",r,e)}else void 0===n.PropTypes||Z||(Z=!0,w("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",y(n)||"Unknown"));"function"!=typeof n.getDefaultProps||n.getDefaultProps.isReactClassApproved||w("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}(M),M}j.Fragment=i,j.jsx=function(e,t,n){return se(e,t,n,!1)},j.jsxs=function(e,t,n){return se(e,t,n,!0)}}()),j)),b.exports);const N=/* @__PURE__ */new Set(["image","table","code_block","html_block","blockquote","list","list_item","definition_list","footnote","footnote_reference","footnote_anchor","admonition","thematic_break","math_block","thinking","vmr_container"]);function C(e){if(Array.isArray(e)&&0!==e.length)return e.reduce((e,[t,n])=>t?(e["for"===t?"htmlFor":"class"===t?"className":t]=null==n||n,e):e,{})}function S(e,t,n,r){if(!Array.isArray(e)||0===e.length)return null;const o=[];for(let i=0;i<e.length;i++){const l=e[i];if(l){if("label_open"===l.type){const a=[];for(i++;i<e.length;){const t=e[i];if("label_close"===(null==t?void 0:t.type))break;t&&a.push(t),i++}const s=`${n}-label-${i}`;o.push(
2
+ /* @__PURE__ */M.jsx("label",{...C(l.attrs),children:S(a,t,`${s}-child`,r)},s));continue}"label_close"!==l.type&&o.push(r(l,`${n}-${i}`,t))}}return o}function B(e,t,n,r){/* @__PURE__ */
3
+ return M.jsx(M.Fragment,{children:S(e,t,`${n}-inline`,r)})}const E={note:"ℹ️",info:"ℹ️",tip:"💡",warning:"⚠️",danger:"❗",error:"⛔",caution:"⚠️"};function _(e){const{node:r,ctx:o,renderNode:i,indexKey:l,isDark:a}=e,s=String(r.kind||"note"),c=t(()=>r.title&&String(r.title).trim().length?String(r.title):s.charAt(0).toUpperCase()+s.slice(1),[s,r.title]),[d,u]=n(()=>{var e;return!!r.collapsible&&!(null==(e=r.open)||e)}),m=t(()=>`admonition-${Math.random().toString(36).slice(2,9)}`,[]);/* @__PURE__ */
4
4
  return M.jsxs("div",{className:`admonition admonition-${s}${a?" is-dark":""}`,"data-index-key":l,children:[
5
5
  /* @__PURE__ */M.jsxs("div",{id:m,className:"admonition-header",children:[E[s]&&/* @__PURE__ */M.jsx("span",{className:"admonition-icon",children:E[s]}),
6
- /* @__PURE__ */M.jsx("span",{className:"admonition-title",children:c}),r.collapsible&&/* @__PURE__ */M.jsx("button",{type:"button",className:"admonition-toggle","aria-expanded":!d,"aria-controls":`${m}-content`,title:d?"Expand":"Collapse",onClick:()=>u(e=>!e),children:/* @__PURE__ */M.jsx("span",{children:d?"▶":"▼"})})]}),!d&&/* @__PURE__ */M.jsx("div",{id:`${m}-content`,className:"admonition-content","aria-labelledby":m,children:o&&i?S(r.children,o,String(null!=l?l:m),i):null})]})}const _=r(null);function L(e,n){const t="undefined"!=typeof window&&"undefined"!=typeof document,r=/* @__PURE__ */new Map;return(o,i)=>{var l,a;const s={current:!1};let c,d=!1;const u=new Promise(e=>{c=()=>{d||(d=!0,e())}}),m=()=>{for(const e of r.values())if(e.targets.has(o)){e.targets.delete(o);try{e.observer.unobserve(o)}catch{}}};if(!t||!n())return s.current=!0,c(),{isVisible:()=>!0,whenVisible:u,destroy:m};const h=((n,o)=>{var i,l;if(!t)return null;if("undefined"==typeof IntersectionObserver)return null;const a=null!=(i=e())?i:null,s=`${n}::${o}`,c=r.get(s);if(c&&c.root===a)return c;if(c){try{c.observer.disconnect()}catch{}r.delete(s)}const d=null!=(l=null==c?void 0:c.targets)?l:/* @__PURE__ */new Map,u=new IntersectionObserver(e=>{for(const n of e){const e=d.get(n.target);if(e&&(n.isIntersecting||n.intersectionRatio>0)){e.state.current=!0;try{e.resolve()}catch{}try{u.unobserve(n.target)}catch{}d.delete(n.target)}}},{root:a,rootMargin:n,threshold:o}),m={observer:u,root:a,rootMargin:n,threshold:o,targets:d};r.set(s,m);for(const e of d.keys())u.observe(e);return m})(null!=(l=null==i?void 0:i.rootMargin)?l:"300px",null!=(a=null==i?void 0:i.threshold)?a:0);return h?(h.targets.set(o,{resolve:c,state:s}),h.observer.observe(o),{isVisible:()=>s.current,whenVisible:u,destroy:m}):(s.current=!0,c(),{isVisible:()=>!0,whenVisible:u,destroy:m})}}const $=L(()=>null,()=>!0);function P({getRoot:e,enabled:t=!0,children:r}){const o=i(t);o.current=t;const l=i(e);l.current=e;const a=n(()=>L(()=>{var e,n;return null!=(n=null==(e=l.current)?void 0:e.call(l))?n:null},()=>o.current),[]);/* @__PURE__ */
7
- return M.jsx(_.Provider,{value:a,children:r})}function R(){var e;return null!=(e=o(_))?e:$}const D="__global__",O="__MARKSTREAM_REACT_CUSTOM_COMPONENTS_STORE__",A=(()=>{const e=globalThis;if(e[O])return e[O];const n={scopedComponents:{},revision:0,listeners:/* @__PURE__ */new Set};return e[O]=n,n})();function W(){A.revision++;for(const e of Array.from(A.listeners))try{e()}catch{}}function I(e){return A.listeners.add(e),()=>{A.listeners.delete(e)}}function F(){return A.revision}function z(e,n){"string"==typeof e?A.scopedComponents[e]={...n||{}}:A.scopedComponents[D]={...e},W()}function H(e){const n=A.scopedComponents[D]||{};if(!e)return n;const t=A.scopedComponents[e]||{};return n&&0!==Object.keys(n).length?t&&0!==Object.keys(t).length?{...n,...t}:n:t}function V(e){if(e===D)throw new Error("removeCustomComponents: cannot delete global mapping; call clearGlobalCustomComponents instead.");delete A.scopedComponents[e],W()}function K(){delete A.scopedComponents[D],W()}function X(e){const{node:n}=e;/* @__PURE__ */
8
- return M.jsx("span",{className:"checkbox-node",children:/* @__PURE__ */M.jsx("input",{type:"checkbox",checked:Boolean(n.checked),disabled:!0,className:"checkbox-input",readOnly:!0})})}const U={"common.copy":"Copy","common.copySuccess":"Copied","common.decrease":"Decrease","common.reset":"Reset","common.increase":"Increase","common.expand":"Expand","common.collapse":"Collapse","common.preview":"Preview","common.source":"Source","common.export":"Export","common.open":"Open","common.zoomIn":"Zoom in","common.zoomOut":"Zoom out","common.resetZoom":"Reset zoom","image.loadError":"Image failed to load","image.loading":"Loading image..."};function q(e){Object.assign(U,e)}function Y(){return{t:e=>{var n;return null!=(n=U[e])?n:function(e){return(e.split(".").pop()||e).replace(/[_-]/g," ").replace(/([A-Z])/g," $1").replace(/\s+/g," ").replace(/\b\w/g,e=>e.toUpperCase()).trim()}(e)}}}let Z=null,J=null,G=null,Q=null,ee=null,ne=null;function te(){Q&&(clearTimeout(Q),Q=null),ee&&(clearTimeout(ee),ee=null)}async function re(e){if(!Z||!J)return;const{x:n,y:t}=await h(J,Z,{placement:e,middleware:[p(8),f(),g({padding:8})],strategy:"fixed"});Z.style.transform=`translate3d(${Math.round(n)}px, ${Math.round(t)}px, 0)`}function oe(e,n,t="top",r=!1,o,i){if(!e||"undefined"==typeof document)return;if(Z||"undefined"==typeof document||(Z=document.createElement("div"),Z.className="ms-tooltip",Z.setAttribute("role","tooltip"),Z.dataset.visible="false",Z.style.position="fixed",Z.style.left="0px",Z.style.top="0px",Z.style.transform="translate3d(0,0,0)",document.body.appendChild(Z)),!Z)return;te();const l=async()=>{if(Z){J=e,Z.textContent=n,Z.dataset.placement=t,Z.dataset.dark=function(e){if("boolean"==typeof e)return e;if("undefined"!=typeof document)try{if(document.documentElement.classList.contains("dark"))return!0}catch{}if("undefined"!=typeof window&&"function"==typeof window.matchMedia)try{return window.matchMedia("(prefers-color-scheme: dark)").matches}catch{}return!1}(i)?"true":"false",Z.dataset.visible="false",ne=`tooltip-${Date.now()}-${Math.random().toString(36).slice(2)}`,Z.id=ne;try{e.setAttribute("aria-describedby",ne)}catch{}await re(t),Z.dataset.visible="true",null==G||G(),G=m(e,Z,()=>{re(t)})}};r?l():Q=setTimeout(l,80)}function ie(e=!1){if(!Z)return;te();const n=()=>{if(Z){if(Z.dataset.visible="false",J&&ne)try{J.removeAttribute("aria-describedby")}catch{}J=null,ne=null,G&&(G(),G=null)}};e?n():ee=setTimeout(n,120)}let le=null;function ae(e){le=null!=e?e:null}const se={"":"",javascript:"javascript",js:"javascript",mjs:"javascript",cjs:"javascript",typescript:"typescript",ts:"typescript",jsx:"jsx",tsx:"tsx",py:"python",rb:"ruby",sh:"shell",bash:"shell",zsh:"shell",shellscript:"shell",plaintext:"plain",text:"plain","c++":"cpp",md:"markdown"};function ce(e){var n;const t=function(e){if(!e)return"";const n=e.trim();if(!n)return"";const[t]=n.split(/\s+/),[r]=t.split(":");return r.toLowerCase()}(e);return null!=(n=se[t])?n:t}function de(e){const n=ce(e);if(!n)return"plaintext";switch(n){case"plain":return"plaintext";case"jsx":return"javascript";case"tsx":return"typescript";default:return n}}function ue(e){if(le){const n=le(e);if(null!=n&&""!==n)return n}switch(ce(e)){case"javascript":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <g fill="none" stroke="#e5c890" stroke-linecap="round" stroke-linejoin="round">\n <path d="M4.5 11c0 .828427.6715729 1.5 1.5 1.5.8284271 0 1.5-.671573 1.5-1.5V7.5M12.5 8.75C12.5 8.05964406 11.9627417 7.5 11.3 7.5L10.7 7.5C10.0372583 7.5 9.5 8.05964406 9.5 8.75 9.5 9.44035594 10.0372583 10 10.7 10L11.3 10C11.9627417 10 12.5 10.5596441 12.5 11.25 12.5 11.9403559 11.9627417 12.5 11.3 12.5L10.7 12.5C10.0372583 12.5 9.5 11.9403559 9.5 11.25" />\n <path d="m 4,1.5 h 8 c 1.385,0 2.5,1.115 2.5,2.5 v 8 c 0,1.385 -1.115,2.5 -2.5,2.5 H 4 C 2.615,14.5 1.5,13.385 1.5,12 V 4 C 1.5,2.615 2.615,1.5 4,1.5 Z" />\n </g>\n</svg>\n\n';case"typescript":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <g fill="none" stroke="#8caaee" stroke-linecap="round" stroke-linejoin="round">\n <path d="M4 1.5h8A2.5 2.5 0 0114.5 4v8a2.5 2.5 0 01-2.5 2.5H4A2.5 2.5 0 011.5 12V4A2.5 2.5 0 014 1.5" />\n <path d="M12.5 8.75c0-.69-.54-1.25-1.2-1.25h-.6c-.66 0-1.2.56-1.2 1.25S10.04 10 10.7 10h.6c.66 0 1.2.56 1.2 1.25s-.54 1.25-1.2 1.25h-.6c-.66 0-1.2-.56-1.2-1.25m-3-3.75v5M5 7.5h3" />\n </g>\n</svg>\n\n';case"jsx":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <g fill="none" stroke="#99d1db" stroke-linecap="round" stroke-linejoin="round">\n <path d="M8 10.8c4.14 0 7.5-1.25 7.5-2.8S12.14 5.2 8 5.2.5 6.45.5 8s3.36 2.8 7.5 2.8" />\n <path d="M5.52 9.4c2.07 3.5 4.86 5.72 6.23 4.95 1.37-.78.8-4.24-1.27-7.75C8.41 3.1 5.62.88 4.25 1.65c-1.37.78-.8 4.24 1.27 7.75" />\n <path d="M5.52 6.6c-2.07 3.5-2.64 6.97-1.27 7.75 1.37.77 4.16-1.45 6.23-4.95s2.64-6.97 1.27-7.75C10.38.88 7.59 3.1 5.52 6.6" />\n <path d="M8.5 8a.5.5 0 01-.5.5.5.5 0 01-.5-.5.5.5 0 01.5-.5.5.5 0 01.5.5" />\n </g>\n</svg>\n\n';case"tsx":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <g fill="none" stroke="#8caaee" stroke-linecap="round" stroke-linejoin="round">\n <path d="M8 11.3c4.14 0 7.5-1.28 7.5-2.86S12.14 5.58 8 5.58.5 6.86.5 8.44s3.36 2.87 7.5 2.87Z" />\n <path d="M5.52 9.87c2.07 3.6 4.86 5.86 6.23 5.07 1.37-.8.8-4.34-1.27-7.93S5.62 1.16 4.25 1.95s-.8 4.34 1.27 7.92" />\n <path d="M5.52 7.01c-2.07 3.59-2.64 7.14-1.27 7.93s4.16-1.48 6.23-5.07c2.07-3.58 2.64-7.13 1.27-7.92-1.37-.8-4.16 1.47-6.23 5.06" />\n <path d="M8.5 8.44a.5.5 0 01-.5.5.5.5 0 01-.5-.5.5.5 0 01.5-.5.5.5 0 01.5.5" />\n </g>\n</svg>\n\n';case"html":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <g fill="none" stroke-linecap="round" stroke-linejoin="round">\n <path stroke="#ef9f76" d="M1.5 1.5h13L13 13l-5 2-5-2z" />\n <path stroke="#c6d0f5" d="M11 4.5H5l.25 3h5.5l-.25 3-2.5 1-2.5-1-.08-1" />\n </g>\n</svg>\n\n';case"css":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <g fill="none" stroke="#ca9ee6" stroke-linecap="round" stroke-linejoin="round">\n <path d="m4 1.5h8c1.38 0 2.5 1.12 2.5 2.5v8c0 1.38-1.12 2.5-2.5 2.5h-8c-1.38 0-2.5-1.12-2.5-2.5v-8c0-1.38 1.12-2.5 2.5-2.5z" />\n <path stroke-width=".814" d="m 10.240861,11.529149 c 0,0.58011 0.437448,1.039154 0.96002,1.035371 l 0.451635,-0.0032 c 0.522572,-0.0036 0.949379,-0.451477 0.949379,-1.032848 0,-0.581372 -0.426807,-1.065638 -0.949379,-1.065638 l -0.451635,3.4e-5 c -0.522572,3.9e-5 -0.949379,-0.4855273 -0.949379,-1.0656374 0,-0.5801104 0.426807,-1.0378931 0.949379,-1.0378931 l 0.451635,2.825e-4 c 0.522572,3.267e-4 0.951743,0.4577827 0.951743,1.0378931 M 6.8003972,11.529149 c 0,0.58011 0.4374474,1.039154 0.9600196,1.035371 l 0.46464,-0.0032 c 0.5225722,-0.0035 0.9363738,-0.451477 0.9363738,-1.031587 0,-0.580111 -0.4090724,-1.065638 -0.9316446,-1.065638 l -0.4693692,3.4e-5 c -0.5225722,3.8e-5 -0.949379,-0.4855272 -0.949379,-1.0656373 0,-0.5801104 0.4268068,-1.0378931 0.949379,-1.0378931 h 0.4516348 c 0.5225722,0 0.9635665,0.4577827 0.9635665,1.0378931 M 3.4072246,11.529149 c 0,0.58011 0.4374474,1.051765 0.9600196,1.051765 H 4.818879 c 0.5225722,0 0.949379,-0.456521 0.949379,-1.037893 m 0.01129,-2.1312747 c 0,-0.5801103 -0.4374474,-1.037893 -0.9600196,-1.037893 L 4.3678939,8.3741358 C 3.8453217,8.3744624 3.4078743,8.8420074 3.4078743,9.4233788 v 2.1186642" />\n </g>\n</svg>\n\n';case"json":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <path fill="none" stroke="#e5c890" stroke-linecap="round" stroke-linejoin="round" d="M4.5 2.5H4c-.75 0-1.5.75-1.5 1.5v2c0 1.1-1 2-1.83 2 .83 0 1.83.9 1.83 2v2c0 .75.75 1.5 1.5 1.5h.5m7-11h.5c.75 0 1.5.75 1.5 1.5v2c0 1.1 1 2 1.83 2-.83 0-1.83.9-1.83 2v2c0 .74-.75 1.5-1.5 1.5h-.5m-6.5-3a.5.5 0 100-1 .5.5 0 000 1m3 0a.5.5 0 100-1 .5.5 0 000 1m3 0a.5.5 0 100-1 .5.5 0 000 1" />\n</svg>\n\n';case"python":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <g fill="none" stroke-linecap="round" stroke-linejoin="round">\n <path stroke="#8caaee" d="M8.5 5.5h-3m6 0V3c0-.8-.7-1.5-1.5-1.5H7c-.8 0-1.5.7-1.5 1.5v2.5H3c-.8 0-1.5.7-1.5 1.5v2c0 .8.7 1.5 1.48 1.5" />\n <path stroke="#e5c890" d="M10.5 10.5h-3m-3 0V13c0 .8.7 1.5 1.5 1.5h3c.8 0 1.5-.7 1.5-1.5v-2.5H13c.8 0 1.5-.7 1.5-1.5V7c0-.8-.7-1.5-1.48-1.5H11.5c0 1.5 0 2-1 2h-2" />\n <path stroke="#8caaee" d="M2.98 10.5H4.5c0-1.5 0-2 1-2h2M7.5 3.5v0" />\n <path stroke="#e5c890" d="m 8.5,12.5 v 0" />\n </g>\n</svg>\n\n';case"shell":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <g fill="none" stroke="#8caaee" stroke-linecap="round" stroke-linejoin="round">\n <path d="M2 15.5c-.7 0-1.5-.8-1.5-1.5V5c0-.7.8-1.5 1.5-1.5h9c.7 0 1.5.8 1.5 1.5v9c0 .7-.8 1.5-1.5 1.5z" />\n <path d="m1.2 3.8 3.04-2.5S5.17.5 5.7.5h8.4c.66 0 1.4.73 1.4 1.4v7.73a2.7 2.7 0 01-.7 1.75l-2.68 3.51M3 8.5l3 2-3 2m4 0h2" />\n </g>\n</svg>\n\n';case"markdown":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <path fill="none" stroke="#85c1dc" stroke-linecap="round" stroke-linejoin="round" d="m9.25 8.25 2.25 2.25 2.25-2.25M3.5 11V5.5l2.04 3 1.96-3V11m4-.5V5M1.65 2.5h12.7c.59 0 1.15.49 1.15 1v9c0 .51-.56 1-1.15 1H1.65c-.59 0-1.15-.49-1.15-1V3.58c0-.5.56-1.08 1.15-1.08" />\n</svg>\n\n';case"mermaid":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <path fill="none" stroke="#ca9ee6" stroke-linecap="round" stroke-linejoin="round" d="M1.5 2.5c0 6 2.25 5.75 4 7 .83.67 1.17 2 1 4h3c-.17-2 .17-3.33 1-4 1.75-1.25 4-1 4-7C12 2.5 10 3 8 7 6 3 4 2.5 1.5 2.5" />\n</svg>\n\n';case"svg":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <path fill="none" stroke="#ef9f76" stroke-linecap="round" stroke-linejoin="round" d="m4.54 10 6.92-4m-6.92 4a1.5 1.5 0 10-2.6 1.5 1.5 1.5 0 002.6-1.5M8 4v8m0-8a1.5 1.5 0 100-3 1.5 1.5 0 000 3M4.54 6l6.92 4M4.54 6a1.5 1.5 0 10-2.6-1.5A1.5 1.5 0 004.54 6M8 12a1.5 1.5 0 100 3 1.5 1.5 0 000-3m3.46-2a1.5 1.5 0 102.6 1.5 1.5 1.5 0 00-2.6-1.5m0-4a1.5 1.5 0 102.6-1.5 1.5 1.5 0 00-2.6 1.5" />\n</svg>\n\n';case"vue":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <g fill="none" stroke="#a6d189" stroke-linecap="round" stroke-linejoin="round">\n <path d="M1 1.5h5.44L8 4.56 9.56 1.5H15l-6.99 13z" />\n <path d="M12.05 1.73 8 9.28 3.95 1.73" />\n </g>\n</svg>\n\n';case"cpp":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <path fill="none" stroke="#8caaee" stroke-linecap="round" stroke-linejoin="round" d="m 2.5559121,12.951629 c 2.7459832,2.734744 7.1981158,2.734744 9.9441189,0 l -1.789955,-1.782586 c -1.7574201,1.750224 -4.606788,1.750224 -6.3642295,0 -1.7574416,-1.7502236 -1.7574416,-4.587893 0,-6.338097 1.7574415,-1.750224 4.6068094,-1.750224 6.3642295,0 l 0.894977,-0.8912929 0.894978,-0.891293 c -2.7460031,-2.73472867 -7.198136,-2.73472867 -9.9441191,0 -2.74598585,2.7347089 -2.74598585,7.1685599 2e-7,9.9032689 z" clip-rule="evenodd" />\n <path fill="none" stroke="#8caaee" stroke-linecap="round" stroke-linejoin="round" d="M7.5 6v4M5.513524 7.9999996H9.51304M13.486476 5.9999996v4M11.5 7.9999992h3.999516" />\n</svg>\n\n';case"plain":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <g fill="none" stroke="#c6d0f5" stroke-linecap="round" stroke-linejoin="round">\n <path d="M13.5 6.5v6a2 2 0 01-2 2h-7a2 2 0 01-2-2v-9c0-1.1.9-2 2-2h4.01" />\n <path d="m8.5 1.5 5 5h-4a1 1 0 01-1-1zm-3 10h5m-5-3h5m-5-3h1" />\n </g>\n</svg>\n\n';default:return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="16" height="16">\x3c!-- Icon from Lucide by Lucide Contributors - https://github.com/lucide-icons/lucide/blob/main/LICENSE --\x3e<g fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"><path d="m10 9l-3 3l3 3m4 0l3-3l-3-3"/><rect width="18" height="18" x="3" y="3" rx="2"/></g></svg>\n\n'}}const me={javascript:"JavaScript",typescript:"TypeScript",jsx:"JSX",tsx:"TSX",shell:"Shell",plain:"Text",text:"Text",markdown:"Markdown",json:"JSON",python:"Python",cpp:"C++",vue:"Vue",html:"HTML",css:"CSS",svg:"SVG",mermaid:"Mermaid"};function he(e){const t=n(()=>{const n=e.code||"",t=n.trim().toLowerCase();return t.startsWith("<!doctype")||t.startsWith("<html")||t.startsWith("<body")?n:`<!doctype html>\n<html lang="en">\n <head>\n <meta charset="utf-8" />\n <meta name="viewport" content="width=device-width, initial-scale=1" />\n <style>\n html, body {\n margin: 0;\n padding: 0;\n height: 100%;\n background-color: ${e.isDark?"#020617":"#ffffff"};\n color: ${e.isDark?"#e5e7eb":"#020617"};\n }\n body {\n font-family: system-ui, -apple-system, BlinkMacSystemFont, 'SF Pro Text', ui-sans-serif, sans-serif;\n }\n </style>\n </head>\n <body>\n ${n}\n </body>\n</html>`},[e.code,e.isDark]);return l(()=>{const n=n=>{var t;"Escape"!==n.key&&"Esc"!==n.key||null==(t=e.onClose)||t.call(e)};return"undefined"!=typeof window&&window.addEventListener("keydown",n),()=>{"undefined"!=typeof window&&window.removeEventListener("keydown",n)}},[e]),"undefined"==typeof document?null:v(
9
- /* @__PURE__ */M.jsx("div",{className:"html-preview-frame__backdrop"+(e.isDark?" html-preview-frame__backdrop--dark":""),onClick:()=>{var n;return null==(n=e.onClose)?void 0:n.call(e)},children:/* @__PURE__ */M.jsxs("div",{className:"html-preview-frame"+(e.isDark?" html-preview-frame--dark":""),onClick:e=>e.stopPropagation(),children:[
6
+ /* @__PURE__ */M.jsx("span",{className:"admonition-title",children:c}),r.collapsible&&/* @__PURE__ */M.jsx("button",{type:"button",className:"admonition-toggle","aria-expanded":!d,"aria-controls":`${m}-content`,title:d?"Expand":"Collapse",onClick:()=>u(e=>!e),children:/* @__PURE__ */M.jsx("span",{children:d?"▶":"▼"})})]}),!d&&/* @__PURE__ */M.jsx("div",{id:`${m}-content`,className:"admonition-content","aria-labelledby":m,children:o&&i?S(r.children,o,String(null!=l?l:m),i):null})]})}const T=r(null);function L(e,t){const n="undefined"!=typeof window&&"undefined"!=typeof document,r=/* @__PURE__ */new Map;return(o,i)=>{var l,a;const s={current:!1};let c,d=!1;const u=new Promise(e=>{c=()=>{d||(d=!0,e())}}),m=()=>{for(const e of r.values())if(e.targets.has(o)){e.targets.delete(o);try{e.observer.unobserve(o)}catch{}}};if(!n||!t())return s.current=!0,c(),{isVisible:()=>!0,whenVisible:u,destroy:m};const h=((t,o)=>{var i,l;if(!n)return null;if("undefined"==typeof IntersectionObserver)return null;const a=null!=(i=e())?i:null,s=`${t}::${o}`,c=r.get(s);if(c&&c.root===a)return c;if(c){try{c.observer.disconnect()}catch{}r.delete(s)}const d=null!=(l=null==c?void 0:c.targets)?l:/* @__PURE__ */new Map,u=new IntersectionObserver(e=>{for(const t of e){const e=d.get(t.target);if(e&&(t.isIntersecting||t.intersectionRatio>0)){e.state.current=!0;try{e.resolve()}catch{}try{u.unobserve(t.target)}catch{}d.delete(t.target)}}},{root:a,rootMargin:t,threshold:o}),m={observer:u,root:a,rootMargin:t,threshold:o,targets:d};r.set(s,m);for(const e of d.keys())u.observe(e);return m})(null!=(l=null==i?void 0:i.rootMargin)?l:"300px",null!=(a=null==i?void 0:i.threshold)?a:0);return h?(h.targets.set(o,{resolve:c,state:s}),h.observer.observe(o),{isVisible:()=>s.current,whenVisible:u,destroy:m}):(s.current=!0,c(),{isVisible:()=>!0,whenVisible:u,destroy:m})}}const $=L(()=>null,()=>!0);function O({getRoot:e,enabled:n=!0,children:r}){const o=i(n);o.current=n;const l=i(e);l.current=e;const a=t(()=>L(()=>{var e,t;return null!=(t=null==(e=l.current)?void 0:e.call(l))?t:null},()=>o.current),[]);/* @__PURE__ */
7
+ return M.jsx(T.Provider,{value:a,children:r})}function P(){var e;return null!=(e=o(T))?e:$}const R="__global__",D="__MARKSTREAM_REACT_CUSTOM_COMPONENTS_STORE__",W=(()=>{const e=globalThis;if(e[D])return e[D];const t={scopedComponents:{},revision:0,listeners:/* @__PURE__ */new Set};return e[D]=t,t})();function A(){W.revision++;for(const e of Array.from(W.listeners))try{e()}catch{}}function I(e){return W.listeners.add(e),()=>{W.listeners.delete(e)}}function F(){return W.revision}function z(e,t){"string"==typeof e?W.scopedComponents[e]={...t||{}}:W.scopedComponents[R]={...e},A()}function H(e){const t=W.scopedComponents[R]||{};if(!e)return t;const n=W.scopedComponents[e]||{};return t&&0!==Object.keys(t).length?n&&0!==Object.keys(n).length?{...t,...n}:t:n}function V(e){if(e===R)throw new Error("removeCustomComponents: cannot delete global mapping; call clearGlobalCustomComponents instead.");delete W.scopedComponents[e],A()}function K(){delete W.scopedComponents[R],A()}function X(e){const{node:t}=e;/* @__PURE__ */
8
+ return M.jsx("span",{className:"checkbox-node",children:/* @__PURE__ */M.jsx("input",{type:"checkbox",checked:Boolean(t.checked),disabled:!0,className:"checkbox-input",readOnly:!0})})}const q={"common.copy":"Copy","common.copySuccess":"Copied","common.decrease":"Decrease","common.reset":"Reset","common.increase":"Increase","common.expand":"Expand","common.collapse":"Collapse","common.preview":"Preview","common.source":"Source","common.export":"Export","common.open":"Open","common.zoomIn":"Zoom in","common.zoomOut":"Zoom out","common.resetZoom":"Reset zoom","image.loadError":"Image failed to load","image.loading":"Loading image..."};function U(e){Object.assign(q,e)}function Y(){return{t:e=>{var t;return null!=(t=q[e])?t:function(e){return(e.split(".").pop()||e).replace(/[_-]/g," ").replace(/([A-Z])/g," $1").replace(/\s+/g," ").replace(/\b\w/g,e=>e.toUpperCase()).trim()}(e)}}}let Z=null,J=null,G=null,Q=null,ee=null,te=null;function ne(){Q&&(clearTimeout(Q),Q=null),ee&&(clearTimeout(ee),ee=null)}async function re(e){if(!Z||!J)return;const{x:t,y:n}=await h(J,Z,{placement:e,middleware:[p(8),f(),g({padding:8})],strategy:"fixed"});Z.style.transform=`translate3d(${Math.round(t)}px, ${Math.round(n)}px, 0)`}function oe(e,t,n="top",r=!1,o,i){if(!e||"undefined"==typeof document)return;if(Z||"undefined"==typeof document||(Z=document.createElement("div"),Z.className="ms-tooltip",Z.setAttribute("role","tooltip"),Z.dataset.visible="false",Z.style.position="fixed",Z.style.left="0px",Z.style.top="0px",Z.style.transform="translate3d(0,0,0)",document.body.appendChild(Z)),!Z)return;ne();const l=async()=>{if(Z){J=e,Z.textContent=t,Z.dataset.placement=n,Z.dataset.dark=function(e){if("boolean"==typeof e)return e;if("undefined"!=typeof document)try{if(document.documentElement.classList.contains("dark"))return!0}catch{}if("undefined"!=typeof window&&"function"==typeof window.matchMedia)try{return window.matchMedia("(prefers-color-scheme: dark)").matches}catch{}return!1}(i)?"true":"false",Z.dataset.visible="false",te=`tooltip-${Date.now()}-${Math.random().toString(36).slice(2)}`,Z.id=te;try{e.setAttribute("aria-describedby",te)}catch{}await re(n),Z.dataset.visible="true",null==G||G(),G=m(e,Z,()=>{re(n)})}};r?l():Q=setTimeout(l,80)}function ie(e=!1){if(!Z)return;ne();const t=()=>{if(Z){if(Z.dataset.visible="false",J&&te)try{J.removeAttribute("aria-describedby")}catch{}J=null,te=null,G&&(G(),G=null)}};e?t():ee=setTimeout(t,120)}let le=null;function ae(e){le=null!=e?e:null}const se={"":"",javascript:"javascript",js:"javascript",mjs:"javascript",cjs:"javascript",typescript:"typescript",ts:"typescript",jsx:"jsx",tsx:"tsx",py:"python",rb:"ruby",sh:"shell",bash:"shell",zsh:"shell",shellscript:"shell",plaintext:"plain",text:"plain","c++":"cpp",md:"markdown"};function ce(e){var t;const n=function(e){if(!e)return"";const t=e.trim();if(!t)return"";const[n]=t.split(/\s+/),[r]=n.split(":");return r.toLowerCase()}(e);return null!=(t=se[n])?t:n}function de(e){const t=ce(e);if(!t)return"plaintext";switch(t){case"plain":return"plaintext";case"jsx":return"javascript";case"tsx":return"typescript";default:return t}}function ue(e){if(le){const t=le(e);if(null!=t&&""!==t)return t}switch(ce(e)){case"javascript":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <g fill="none" stroke="#e5c890" stroke-linecap="round" stroke-linejoin="round">\n <path d="M4.5 11c0 .828427.6715729 1.5 1.5 1.5.8284271 0 1.5-.671573 1.5-1.5V7.5M12.5 8.75C12.5 8.05964406 11.9627417 7.5 11.3 7.5L10.7 7.5C10.0372583 7.5 9.5 8.05964406 9.5 8.75 9.5 9.44035594 10.0372583 10 10.7 10L11.3 10C11.9627417 10 12.5 10.5596441 12.5 11.25 12.5 11.9403559 11.9627417 12.5 11.3 12.5L10.7 12.5C10.0372583 12.5 9.5 11.9403559 9.5 11.25" />\n <path d="m 4,1.5 h 8 c 1.385,0 2.5,1.115 2.5,2.5 v 8 c 0,1.385 -1.115,2.5 -2.5,2.5 H 4 C 2.615,14.5 1.5,13.385 1.5,12 V 4 C 1.5,2.615 2.615,1.5 4,1.5 Z" />\n </g>\n</svg>\n\n';case"typescript":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <g fill="none" stroke="#8caaee" stroke-linecap="round" stroke-linejoin="round">\n <path d="M4 1.5h8A2.5 2.5 0 0114.5 4v8a2.5 2.5 0 01-2.5 2.5H4A2.5 2.5 0 011.5 12V4A2.5 2.5 0 014 1.5" />\n <path d="M12.5 8.75c0-.69-.54-1.25-1.2-1.25h-.6c-.66 0-1.2.56-1.2 1.25S10.04 10 10.7 10h.6c.66 0 1.2.56 1.2 1.25s-.54 1.25-1.2 1.25h-.6c-.66 0-1.2-.56-1.2-1.25m-3-3.75v5M5 7.5h3" />\n </g>\n</svg>\n\n';case"jsx":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <g fill="none" stroke="#99d1db" stroke-linecap="round" stroke-linejoin="round">\n <path d="M8 10.8c4.14 0 7.5-1.25 7.5-2.8S12.14 5.2 8 5.2.5 6.45.5 8s3.36 2.8 7.5 2.8" />\n <path d="M5.52 9.4c2.07 3.5 4.86 5.72 6.23 4.95 1.37-.78.8-4.24-1.27-7.75C8.41 3.1 5.62.88 4.25 1.65c-1.37.78-.8 4.24 1.27 7.75" />\n <path d="M5.52 6.6c-2.07 3.5-2.64 6.97-1.27 7.75 1.37.77 4.16-1.45 6.23-4.95s2.64-6.97 1.27-7.75C10.38.88 7.59 3.1 5.52 6.6" />\n <path d="M8.5 8a.5.5 0 01-.5.5.5.5 0 01-.5-.5.5.5 0 01.5-.5.5.5 0 01.5.5" />\n </g>\n</svg>\n\n';case"tsx":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <g fill="none" stroke="#8caaee" stroke-linecap="round" stroke-linejoin="round">\n <path d="M8 11.3c4.14 0 7.5-1.28 7.5-2.86S12.14 5.58 8 5.58.5 6.86.5 8.44s3.36 2.87 7.5 2.87Z" />\n <path d="M5.52 9.87c2.07 3.6 4.86 5.86 6.23 5.07 1.37-.8.8-4.34-1.27-7.93S5.62 1.16 4.25 1.95s-.8 4.34 1.27 7.92" />\n <path d="M5.52 7.01c-2.07 3.59-2.64 7.14-1.27 7.93s4.16-1.48 6.23-5.07c2.07-3.58 2.64-7.13 1.27-7.92-1.37-.8-4.16 1.47-6.23 5.06" />\n <path d="M8.5 8.44a.5.5 0 01-.5.5.5.5 0 01-.5-.5.5.5 0 01.5-.5.5.5 0 01.5.5" />\n </g>\n</svg>\n\n';case"html":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <g fill="none" stroke-linecap="round" stroke-linejoin="round">\n <path stroke="#ef9f76" d="M1.5 1.5h13L13 13l-5 2-5-2z" />\n <path stroke="#c6d0f5" d="M11 4.5H5l.25 3h5.5l-.25 3-2.5 1-2.5-1-.08-1" />\n </g>\n</svg>\n\n';case"css":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <g fill="none" stroke="#ca9ee6" stroke-linecap="round" stroke-linejoin="round">\n <path d="m4 1.5h8c1.38 0 2.5 1.12 2.5 2.5v8c0 1.38-1.12 2.5-2.5 2.5h-8c-1.38 0-2.5-1.12-2.5-2.5v-8c0-1.38 1.12-2.5 2.5-2.5z" />\n <path stroke-width=".814" d="m 10.240861,11.529149 c 0,0.58011 0.437448,1.039154 0.96002,1.035371 l 0.451635,-0.0032 c 0.522572,-0.0036 0.949379,-0.451477 0.949379,-1.032848 0,-0.581372 -0.426807,-1.065638 -0.949379,-1.065638 l -0.451635,3.4e-5 c -0.522572,3.9e-5 -0.949379,-0.4855273 -0.949379,-1.0656374 0,-0.5801104 0.426807,-1.0378931 0.949379,-1.0378931 l 0.451635,2.825e-4 c 0.522572,3.267e-4 0.951743,0.4577827 0.951743,1.0378931 M 6.8003972,11.529149 c 0,0.58011 0.4374474,1.039154 0.9600196,1.035371 l 0.46464,-0.0032 c 0.5225722,-0.0035 0.9363738,-0.451477 0.9363738,-1.031587 0,-0.580111 -0.4090724,-1.065638 -0.9316446,-1.065638 l -0.4693692,3.4e-5 c -0.5225722,3.8e-5 -0.949379,-0.4855272 -0.949379,-1.0656373 0,-0.5801104 0.4268068,-1.0378931 0.949379,-1.0378931 h 0.4516348 c 0.5225722,0 0.9635665,0.4577827 0.9635665,1.0378931 M 3.4072246,11.529149 c 0,0.58011 0.4374474,1.051765 0.9600196,1.051765 H 4.818879 c 0.5225722,0 0.949379,-0.456521 0.949379,-1.037893 m 0.01129,-2.1312747 c 0,-0.5801103 -0.4374474,-1.037893 -0.9600196,-1.037893 L 4.3678939,8.3741358 C 3.8453217,8.3744624 3.4078743,8.8420074 3.4078743,9.4233788 v 2.1186642" />\n </g>\n</svg>\n\n';case"json":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <path fill="none" stroke="#e5c890" stroke-linecap="round" stroke-linejoin="round" d="M4.5 2.5H4c-.75 0-1.5.75-1.5 1.5v2c0 1.1-1 2-1.83 2 .83 0 1.83.9 1.83 2v2c0 .75.75 1.5 1.5 1.5h.5m7-11h.5c.75 0 1.5.75 1.5 1.5v2c0 1.1 1 2 1.83 2-.83 0-1.83.9-1.83 2v2c0 .74-.75 1.5-1.5 1.5h-.5m-6.5-3a.5.5 0 100-1 .5.5 0 000 1m3 0a.5.5 0 100-1 .5.5 0 000 1m3 0a.5.5 0 100-1 .5.5 0 000 1" />\n</svg>\n\n';case"python":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <g fill="none" stroke-linecap="round" stroke-linejoin="round">\n <path stroke="#8caaee" d="M8.5 5.5h-3m6 0V3c0-.8-.7-1.5-1.5-1.5H7c-.8 0-1.5.7-1.5 1.5v2.5H3c-.8 0-1.5.7-1.5 1.5v2c0 .8.7 1.5 1.48 1.5" />\n <path stroke="#e5c890" d="M10.5 10.5h-3m-3 0V13c0 .8.7 1.5 1.5 1.5h3c.8 0 1.5-.7 1.5-1.5v-2.5H13c.8 0 1.5-.7 1.5-1.5V7c0-.8-.7-1.5-1.48-1.5H11.5c0 1.5 0 2-1 2h-2" />\n <path stroke="#8caaee" d="M2.98 10.5H4.5c0-1.5 0-2 1-2h2M7.5 3.5v0" />\n <path stroke="#e5c890" d="m 8.5,12.5 v 0" />\n </g>\n</svg>\n\n';case"shell":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <g fill="none" stroke="#8caaee" stroke-linecap="round" stroke-linejoin="round">\n <path d="M2 15.5c-.7 0-1.5-.8-1.5-1.5V5c0-.7.8-1.5 1.5-1.5h9c.7 0 1.5.8 1.5 1.5v9c0 .7-.8 1.5-1.5 1.5z" />\n <path d="m1.2 3.8 3.04-2.5S5.17.5 5.7.5h8.4c.66 0 1.4.73 1.4 1.4v7.73a2.7 2.7 0 01-.7 1.75l-2.68 3.51M3 8.5l3 2-3 2m4 0h2" />\n </g>\n</svg>\n\n';case"markdown":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <path fill="none" stroke="#85c1dc" stroke-linecap="round" stroke-linejoin="round" d="m9.25 8.25 2.25 2.25 2.25-2.25M3.5 11V5.5l2.04 3 1.96-3V11m4-.5V5M1.65 2.5h12.7c.59 0 1.15.49 1.15 1v9c0 .51-.56 1-1.15 1H1.65c-.59 0-1.15-.49-1.15-1V3.58c0-.5.56-1.08 1.15-1.08" />\n</svg>\n\n';case"mermaid":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <path fill="none" stroke="#ca9ee6" stroke-linecap="round" stroke-linejoin="round" d="M1.5 2.5c0 6 2.25 5.75 4 7 .83.67 1.17 2 1 4h3c-.17-2 .17-3.33 1-4 1.75-1.25 4-1 4-7C12 2.5 10 3 8 7 6 3 4 2.5 1.5 2.5" />\n</svg>\n\n';case"svg":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <path fill="none" stroke="#ef9f76" stroke-linecap="round" stroke-linejoin="round" d="m4.54 10 6.92-4m-6.92 4a1.5 1.5 0 10-2.6 1.5 1.5 1.5 0 002.6-1.5M8 4v8m0-8a1.5 1.5 0 100-3 1.5 1.5 0 000 3M4.54 6l6.92 4M4.54 6a1.5 1.5 0 10-2.6-1.5A1.5 1.5 0 004.54 6M8 12a1.5 1.5 0 100 3 1.5 1.5 0 000-3m3.46-2a1.5 1.5 0 102.6 1.5 1.5 1.5 0 00-2.6-1.5m0-4a1.5 1.5 0 102.6-1.5 1.5 1.5 0 00-2.6 1.5" />\n</svg>\n\n';case"vue":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <g fill="none" stroke="#a6d189" stroke-linecap="round" stroke-linejoin="round">\n <path d="M1 1.5h5.44L8 4.56 9.56 1.5H15l-6.99 13z" />\n <path d="M12.05 1.73 8 9.28 3.95 1.73" />\n </g>\n</svg>\n\n';case"cpp":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <path fill="none" stroke="#8caaee" stroke-linecap="round" stroke-linejoin="round" d="m 2.5559121,12.951629 c 2.7459832,2.734744 7.1981158,2.734744 9.9441189,0 l -1.789955,-1.782586 c -1.7574201,1.750224 -4.606788,1.750224 -6.3642295,0 -1.7574416,-1.7502236 -1.7574416,-4.587893 0,-6.338097 1.7574415,-1.750224 4.6068094,-1.750224 6.3642295,0 l 0.894977,-0.8912929 0.894978,-0.891293 c -2.7460031,-2.73472867 -7.198136,-2.73472867 -9.9441191,0 -2.74598585,2.7347089 -2.74598585,7.1685599 2e-7,9.9032689 z" clip-rule="evenodd" />\n <path fill="none" stroke="#8caaee" stroke-linecap="round" stroke-linejoin="round" d="M7.5 6v4M5.513524 7.9999996H9.51304M13.486476 5.9999996v4M11.5 7.9999992h3.999516" />\n</svg>\n\n';case"plain":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <g fill="none" stroke="#c6d0f5" stroke-linecap="round" stroke-linejoin="round">\n <path d="M13.5 6.5v6a2 2 0 01-2 2h-7a2 2 0 01-2-2v-9c0-1.1.9-2 2-2h4.01" />\n <path d="m8.5 1.5 5 5h-4a1 1 0 01-1-1zm-3 10h5m-5-3h5m-5-3h1" />\n </g>\n</svg>\n\n';default:return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="16" height="16">\x3c!-- Icon from Lucide by Lucide Contributors - https://github.com/lucide-icons/lucide/blob/main/LICENSE --\x3e<g fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"><path d="m10 9l-3 3l3 3m4 0l3-3l-3-3"/><rect width="18" height="18" x="3" y="3" rx="2"/></g></svg>\n\n'}}const me={javascript:"JavaScript",typescript:"TypeScript",jsx:"JSX",tsx:"TSX",shell:"Shell",plain:"Text",text:"Text",markdown:"Markdown",json:"JSON",python:"Python",cpp:"C++",vue:"Vue",html:"HTML",css:"CSS",svg:"SVG",mermaid:"Mermaid"};function he(e){const n=t(()=>{const t=e.code||"",n=t.trim().toLowerCase();return n.startsWith("<!doctype")||n.startsWith("<html")||n.startsWith("<body")?t:`<!doctype html>\n<html lang="en">\n <head>\n <meta charset="utf-8" />\n <meta name="viewport" content="width=device-width, initial-scale=1" />\n <style>\n html, body {\n margin: 0;\n padding: 0;\n height: 100%;\n background-color: ${e.isDark?"#020617":"#ffffff"};\n color: ${e.isDark?"#e5e7eb":"#020617"};\n }\n body {\n font-family: system-ui, -apple-system, BlinkMacSystemFont, 'SF Pro Text', ui-sans-serif, sans-serif;\n }\n </style>\n </head>\n <body>\n ${t}\n </body>\n</html>`},[e.code,e.isDark]);return l(()=>{const t=t=>{var n;"Escape"!==t.key&&"Esc"!==t.key||null==(n=e.onClose)||n.call(e)};return"undefined"!=typeof window&&window.addEventListener("keydown",t),()=>{"undefined"!=typeof window&&window.removeEventListener("keydown",t)}},[e]),"undefined"==typeof document?null:v(
9
+ /* @__PURE__ */M.jsx("div",{className:"html-preview-frame__backdrop"+(e.isDark?" html-preview-frame__backdrop--dark":""),onClick:()=>{var t;return null==(t=e.onClose)?void 0:t.call(e)},children:/* @__PURE__ */M.jsxs("div",{className:"html-preview-frame"+(e.isDark?" html-preview-frame--dark":""),onClick:e=>e.stopPropagation(),children:[
10
10
  /* @__PURE__ */M.jsxs("div",{className:"html-preview-frame__header",children:[
11
11
  /* @__PURE__ */M.jsxs("div",{className:"html-preview-frame__title",children:[
12
12
  /* @__PURE__ */M.jsx("span",{className:"html-preview-frame__dot"}),
13
13
  /* @__PURE__ */M.jsx("span",{className:"html-preview-frame__label",children:e.title||"Preview"})]}),
14
- /* @__PURE__ */M.jsx("button",{type:"button",className:"html-preview-frame__close"+(e.isDark?" html-preview-frame__close--dark":""),onClick:()=>{var n;return null==(n=e.onClose)?void 0:n.call(e)},children:"×"})]}),
15
- /* @__PURE__ */M.jsx("iframe",{className:"html-preview-frame__iframe",sandbox:"allow-scripts allow-same-origin",srcDoc:t,title:e.title||"Preview"})]})}),document.body)}let pe=!1,fe=null,ge=!1;async function ve(){if(fe)return fe;if(ge)return null;try{return fe=await import("stream-monaco"),await async function(e){pe||(pe=!0,(null==e?void 0:e.preloadMonacoWorkers)&&await e.preloadMonacoWorkers())}(fe),fe}catch{return ge=!0,null}}let we=null,xe=!1,ye=null,ke=null,be=null,je=null,Me=null;function Ne(e,n){const t=function(e){if(null==e)return null;if("string"==typeof e)return e;if("object"==typeof e&&"name"in e)return String(e.name);try{return JSON.stringify(e)}catch{return String(e)}}(e);return t?(we!==n&&(we=n),xe||Me!==t?!ye||je!==t&&ke!==t?(be=e,je=t,ye||(xe=!0,ye=(async()=>{for(;null!=be&&null!=je;){const e=be,n=je;if(be=null,je=null,Me===n)continue;const t=we;if(!t)break;try{ke=n,await Promise.resolve(t(e)),Me=n}catch{}}})().finally(()=>{xe=!1,ye=null,ke=null}),ye)):ye:Promise.resolve()):Promise.resolve()}let Ce=null,Se=null,Be=null;const Ee=/* @__PURE__ */new Set;function Te(){for(const e of Array.from(Ee))try{e()}catch{}}function _e({node:e}){var t;const r=n(()=>function(e){var n;return String(null!=(n=String(null!=e?e:"").split(/\s+/g)[0])?n:"").toLowerCase().replace(/[^\w-]/g,"")||"plaintext"}(null==e?void 0:e.language),[e]),o=`language-${r}`,i=r?`Code block: ${r}`:"Code block";/* @__PURE__ */
16
- return M.jsx("pre",{className:o,"aria-busy":!0===(null==e?void 0:e.loading),"aria-label":i,"data-language":r,tabIndex:0,children:/* @__PURE__ */M.jsx("code",{translate:"no",children:String(null!=(t=null==e?void 0:e.code)?t:"")})})}const Le={isShowPreview:!0,loading:!0,stream:!0,enableFontSizeControl:!0,showHeader:!0,showCopyButton:!0,showExpandButton:!0,showPreviewButton:!0,showFontSizeButtons:!0};function $e(e){var r;const o={...Le,...e},{node:s,isDark:c,loading:d,stream:u,isShowPreview:m,enableFontSizeControl:h,darkTheme:p,lightTheme:f,monacoOptions:g,themes:v,minWidth:w,maxWidth:x,showHeader:y,showCopyButton:k,showExpandButton:b,showPreviewButton:j,showFontSizeButtons:N}=o,C=i(null),S=i(null),B=i(null),E=i(null),T=i(null),_=i(null),L=i(null),$=i(0),P=i(null),D=i(null),O=R(),A=i(g),W=i(v),I=i(g),[F,z]=t(!1),[H,V]=t(()=>"undefined"==typeof window),[K,X]=t(!1),[U,q]=t(!1),[Z,J]=t(!1),[G,Q]=t(()=>s.language||"plaintext"),[ee,ne]=t(()=>ce(s.language)),[te,re]=t(!1),[le,ae]=t(!1),[se,pe]=t(!1),[fe,ge]=t(!1),{t:we}=Y(),[xe,ye]=t(()=>{const e=Number(null==g?void 0:g.fontSize);return Number.isFinite(e)&&e>0?e:14}),[ke,be]=t(xe),je=a(()=>{var e,n;const t=null!=(n=null==(e=A.current)?void 0:e.MAX_HEIGHT)?n:500;if("number"==typeof t&&Number.isFinite(t))return Math.max(80,t);const r=String(t).match(/^(\d+(?:\.\d+)?)/),o=r?Number.parseFloat(r[1]):500;return Number.isFinite(o)?Math.max(80,o):500},[]),Me=a(e=>{var n,t,r,o;if(F)return;const i=C.current,l=B.current;if(!i||!l)return;const a="diff"===_.current?null==(n=l.getDiffEditorView)?void 0:n.call(l):null==(t=l.getEditorView)?void 0:t.call(l);if(!a)return;const s=je();try{null==(r=a.updateOptions)||r.call(a,{automaticLayout:e})}catch{}e?(i.style.maxHeight="none",i.style.overflow="visible"):(i.style.maxHeight=`${Math.ceil(s)}px`,i.style.overflow="auto");try{const n=Number((()=>{if("function"==typeof a.getContentHeight)return a.getContentHeight();if("diff"===_.current&&"function"==typeof a.getModifiedEditor){const e=a.getModifiedEditor();if(e&&"function"==typeof e.getContentHeight)return e.getContentHeight()}})());if(Number.isFinite(n)&&n>0){const t=e?n:Math.min(n,s);i.style.height=`${Math.ceil(Math.max(120,t))}px`}null==(o=a.layout)||o.call(a)}catch{}},[je,F]);l(()=>{A.current=g},[g]),l(()=>{ne(ce(s.language))},[s.language]);const $e=i(s);$e.current=s;const Pe=a(()=>{var e;$.current+=1;try{null==(e=E.current)||e.call(E)}catch{}T.current=null,_.current=null,L.current=null,J(!1),q(!1)},[]),Re=a(()=>{var e,n,t,r,o,i;const l=C.current,a=S.current;if(!l||!a)return;const s=null!=(e=l.querySelector(".monaco-editor"))?e:l;try{const e="undefined"!=typeof window&&window.getComputedStyle?window.getComputedStyle(s):null,l=String(null!=(n=null==e?void 0:e.getPropertyValue("--vscode-editor-foreground"))?n:"").trim()||String(null!=(t=null==e?void 0:e.color)?t:"").trim(),c=String(null!=(r=null==e?void 0:e.getPropertyValue("--vscode-editor-background"))?r:"").trim()||String(null!=(o=null==e?void 0:e.backgroundColor)?o:"").trim(),d=String(null!=(i=null==e?void 0:e.getPropertyValue("--vscode-editor-selectionBackground"))?i:"").trim();l&&a.style.setProperty("--vscode-editor-foreground",l),c&&a.style.setProperty("--vscode-editor-background",c),d&&a.style.setProperty("--vscode-editor-selectionBackground",d)}catch{}},[]);l(()=>()=>{var e,n,t;$.current+=1,null==(e=E.current)||e.call(E),E.current=null,T.current=null,_.current=null,L.current=null,P.current=null,null==(t=null==(n=D.current)?void 0:n.destroy)||t.call(n),D.current=null},[]),l(()=>{var e,n;if("undefined"==typeof window)return;if(H)return;const t=S.current;if(!t)return;null==(n=null==(e=D.current)?void 0:e.destroy)||n.call(e);const r=O(t,{rootMargin:"400px"});return D.current=r,r.isVisible()&&V(!0),r.whenVisible.then(()=>V(!0)),()=>{r.destroy(),D.current===r&&(D.current=null)}},[O,H]),l(()=>{let e=!0;return"undefined"==typeof window||(async()=>{var n,t;try{const r=await ve();if(!e)return;if(!r)return void z(!0);const o=r.useMonaco,i=r.detectLanguage;if("function"==typeof i&&(P.current=i),"function"!=typeof o)return void z(!0);const l=null!=(n=c?p:f)?n:Ce,a={...I.current||{}},s=o({wordWrap:"on",wrappingIndent:"same",themes:W.current,theme:l,...a,onThemeChange(){Re()}});B.current=s,"function"==typeof(t=s.setTheme)&&(Be=t,null!=Ce&&null!=Se&&Ne(Ce,Be).then(()=>Te()).catch(()=>{})),E.current="function"==typeof s.safeClean?()=>s.safeClean():"function"==typeof s.cleanupEditor?()=>s.cleanupEditor():null,X(!0)}catch{e&&z(!0)}})(),()=>{e=!1}},[]),l(()=>{var e;if(!s.language&&!ee&&P.current)try{const n=P.current(String(null!=(e=s.code)?e:""));n&&Q(n)}catch{}},[ee,s.code,s.language]);const De=n(()=>String(s.language||ee||G||"plaintext"),[ee,G,s.language]),Oe=n(()=>ce(De),[De]),Ae=n(()=>de(Oe),[Oe]),We=n(()=>ue(Oe),[Oe]),Ie=n(()=>!!m&&("html"===Oe||"svg"===Oe),[Oe,m]),Fe=n(()=>{const e=Oe;return e?me[e]||e.charAt(0).toUpperCase()+e.slice(1):me[""]||"Plain Text"},[Oe]),ze=n(()=>{var e,n,t;return s.diff?null!=(n=null!=(e=s.updatedCode)?e:s.code)?n:"":null!=(t=s.code)?t:""},[s.code,s.diff,s.updatedCode]),He=n(()=>{const e=e=>{if(null!=e)return"number"==typeof e?`${e}px`:String(e)},n={},t=e(w),r=e(x);return t&&(n.minWidth=t),r&&(n.maxWidth=r),n},[w,x]),Ve=!1===u&&d,Ke=n(()=>c?p:f,[p,c,f]);l(()=>{if(F)return;if(!U||!H)return;const e=B.current;(null==e?void 0:e.setTheme)&&Ke&&Ne(Ke,e.setTheme).then(Re).catch(()=>{})},[U,Ke,Re,F,H]),l(()=>{var e;if("undefined"!=typeof window)return e=()=>{Re()},Ee.add(e),()=>{Ee.delete(e)}},[Re]);const Xe=a(async()=>{var e,n;if(F)return null;if(!H)return null;if(se)return null;if(Ve)return null;const t=B.current,r=C.current;if(!t||!r||!t.createEditor)return null;const o=$e.current,i=o.diff?"diff":"single",l=L.current,a="diff"===i?Boolean(null==(e=t.getDiffEditorView)?void 0:e.call(t)):Boolean(null==(n=t.getEditorView)?void 0:n.call(t));if(_.current===i&&l===r&&a)return null;if(T.current)return T.current;$.current+=1;const s=$.current;q(!0);const c=(async()=>{var e,n,i,l,a,c,d,u,m,h;try{null==(e=E.current)||e.call(E),_.current=null,L.current=null,J(!1);const p=Ae;if(o.diff?"function"==typeof t.createDiffEditor?(_.current="diff",await t.createDiffEditor(r,String(null!=(n=o.originalCode)?n:""),String(null!=(i=o.updatedCode)?i:""),p)):(_.current="single",await t.createEditor(r,String(null!=(a=null!=(l=o.updatedCode)?l:o.code)?a:""),p)):(_.current="single",await t.createEditor(r,String(null!=(c=o.code)?c:""),p)),L.current=r,$.current!==s)return;const f=Number(null==(d=A.current)?void 0:d.fontSize);if(Number.isFinite(f)&&f>0){ye(f),be(f);try{const e="diff"===_.current?null==(u=t.getDiffEditorView)?void 0:u.call(t):null==(m=t.getEditorView)?void 0:m.call(t);null==(h=null==e?void 0:e.updateOptions)||h.call(e,{fontSize:f,automaticLayout:!1})}catch{}}Re(),le||se||Me(!1),J(!0)}catch{$.current===s&&z(!0)}})().finally(()=>{T.current===c&&(T.current=null)});return T.current=c,c},[Me,se,le,Ae,Ve,Re,F,H]);l(()=>{F||K&&H&&(se||Ve?Pe():Xe())},[se,Xe,K,Pe,Ve,F,H]),l(()=>{var e;if(F)return;if(!K)return;if(!H)return;if(se)return;if(Ve)return;const n=B.current;if(!n)return;const t=String(null!=(e=s.code)?e:"");(async()=>{var e,r;let o=ee;if(!o&&P.current)try{o=ce(P.current(t)),o&&ne(o)}catch{}const i=de(o||Oe);if(n.createEditor&&C.current){try{await Promise.resolve(Xe())}catch{}const e=T.current;if(e)try{await e}catch{}}try{s.diff&&n.updateDiff?await Promise.resolve(n.updateDiff(String(null!=(e=s.originalCode)?e:""),String(null!=(r=s.updatedCode)?r:""),i)):n.updateCode&&await Promise.resolve(n.updateCode(t,i))}catch{}le&&Me(!0)})()},[Me,Oe,ee,se,U,Xe,le,K,s.code,s.diff,s.originalCode,s.updatedCode,Ve,F,H]),l(()=>{if(F)return;if(!K)return;if(!H)return;if(se)return;if(Ve)return;if(!le&&d)return;const e="undefined"!=typeof window&&"function"==typeof window.requestAnimationFrame?window.requestAnimationFrame(()=>Me(le)):null;return null==e&&Me(le),()=>{null!=e&&"undefined"!=typeof window&&"function"==typeof window.cancelAnimationFrame&&window.cancelAnimationFrame(e)}},[Me,se,le,d,K,Ve,F,H]),l(()=>{var e,n,t;if(!h)return;if(F)return;const r=B.current;if(r){try{const o="diff"===_.current?null==(e=r.getDiffEditorView)?void 0:e.call(r):null==(n=r.getEditorView)?void 0:n.call(r);null==(t=null==o?void 0:o.updateOptions)||t.call(o,{fontSize:ke})}catch{}Me(le)}},[Me,h,le,ke,s.diff,F]);const Ue=a((e,n)=>{oe(e.currentTarget,n,"top",!1,(e.clientX,e.clientY),c)},[c]),qe=a(()=>{ie()},[]),Ye=a(async()=>{var e;try{"undefined"!=typeof navigator&&navigator.clipboard&&"function"==typeof navigator.clipboard.writeText&&await navigator.clipboard.writeText(String(ze)),re(!0),null==(e=o.onCopy)||e.call(o,String(ze)),setTimeout(()=>re(!1),1e3)}catch{}},[o,ze]),Ze=a(()=>{if(!Ie)return;const e="html"===Oe?"text/html":"image/svg+xml",n="html"===Oe?we("artifacts.htmlPreviewTitle")||"HTML Preview":we("artifacts.svgPreviewTitle")||"SVG Preview";"function"!=typeof o.onPreviewCode?"html"===Oe&&ge(e=>!e):o.onPreviewCode({node:s,artifactType:e,artifactTitle:n,id:`temp-${Oe}-${Date.now()}`})},[Oe,Ie,s,o,we]);return F?/* @__PURE__ */M.jsx(_e,{node:s}):/* @__PURE__ */M.jsxs("div",{ref:S,className:["code-block-container my-4 rounded-lg border overflow-hidden shadow-sm",c?"border-gray-700/30 bg-gray-900":"border-gray-200 bg-white",d?"is-rendering":"",c?"is-dark":""].join(" "),style:He,children:[y&&/* @__PURE__ */M.jsxs("div",{className:"code-block-header flex justify-between items-center px-4 py-2.5 border-b border-gray-400/5",style:{color:`var(--vscode-editor-foreground, ${c?"#e5e7eb":"#111827"})`,backgroundColor:`var(--vscode-editor-background, ${c?"#111827":"#ffffff"})`},children:[
14
+ /* @__PURE__ */M.jsx("button",{type:"button",className:"html-preview-frame__close"+(e.isDark?" html-preview-frame__close--dark":""),onClick:()=>{var t;return null==(t=e.onClose)?void 0:t.call(e)},children:"×"})]}),
15
+ /* @__PURE__ */M.jsx("iframe",{className:"html-preview-frame__iframe",sandbox:"allow-scripts allow-same-origin",srcDoc:n,title:e.title||"Preview"})]})}),document.body)}let pe=!1,fe=null,ge=!1;async function ve(){if(fe)return fe;if(ge)return null;try{return fe=await import("stream-monaco"),await async function(e){pe||(pe=!0,(null==e?void 0:e.preloadMonacoWorkers)&&await e.preloadMonacoWorkers())}(fe),fe}catch{return ge=!0,null}}let we=null,xe=!1,ye=null,be=null,ke=null,je=null,Me=null;function Ne(e,t){const n=function(e){if(null==e)return null;if("string"==typeof e)return e;if("object"==typeof e&&"name"in e)return String(e.name);try{return JSON.stringify(e)}catch{return String(e)}}(e);return n?(we!==t&&(we=t),xe||Me!==n?!ye||je!==n&&be!==n?(ke=e,je=n,ye||(xe=!0,ye=(async()=>{for(;null!=ke&&null!=je;){const e=ke,t=je;if(ke=null,je=null,Me===t)continue;const n=we;if(!n)break;try{be=t,await Promise.resolve(n(e)),Me=t}catch{}}})().finally(()=>{xe=!1,ye=null,be=null}),ye)):ye:Promise.resolve()):Promise.resolve()}let Ce=null,Se=null,Be=null;const Ee=/* @__PURE__ */new Set;function _e(){for(const e of Array.from(Ee))try{e()}catch{}}function Te({node:e}){var n;const r=t(()=>function(e){var t;return String(null!=(t=String(null!=e?e:"").split(/\s+/g)[0])?t:"").toLowerCase().replace(/[^\w-]/g,"")||"plaintext"}(null==e?void 0:e.language),[e]),o=`language-${r}`,i=r?`Code block: ${r}`:"Code block";/* @__PURE__ */
16
+ return M.jsx("pre",{className:o,"aria-busy":!0===(null==e?void 0:e.loading),"aria-label":i,"data-language":r,tabIndex:0,children:/* @__PURE__ */M.jsx("code",{translate:"no",children:String(null!=(n=null==e?void 0:e.code)?n:"")})})}const Le={isShowPreview:!0,loading:!0,stream:!0,enableFontSizeControl:!0,showHeader:!0,showCopyButton:!0,showExpandButton:!0,showPreviewButton:!0,showFontSizeButtons:!0};function $e(e){var r;const o={...Le,...e},{node:s,isDark:c,loading:d,stream:u,isShowPreview:m,enableFontSizeControl:h,darkTheme:p,lightTheme:f,monacoOptions:g,themes:v,minWidth:w,maxWidth:x,showHeader:y,showCopyButton:b,showExpandButton:k,showPreviewButton:j,showFontSizeButtons:N}=o,C=i(null),S=i(null),B=i(null),E=i(null),_=i(null),T=i(null),L=i(null),$=i(0),O=i(null),R=i(null),D=P(),W=i(g),A=i(v),I=i(g),[F,z]=n(!1),[H,V]=n(()=>"undefined"==typeof window),[K,X]=n(!1),[q,U]=n(!1),[Z,J]=n(!1),[G,Q]=n(()=>s.language||"plaintext"),[ee,te]=n(()=>ce(s.language)),[ne,re]=n(!1),[le,ae]=n(!1),[se,pe]=n(!1),[fe,ge]=n(!1),{t:we}=Y(),[xe,ye]=n(()=>{const e=Number(null==g?void 0:g.fontSize);return Number.isFinite(e)&&e>0?e:14}),[be,ke]=n(xe),je=a(()=>{var e,t;const n=null!=(t=null==(e=W.current)?void 0:e.MAX_HEIGHT)?t:500;if("number"==typeof n&&Number.isFinite(n))return Math.max(80,n);const r=String(n).match(/^(\d+(?:\.\d+)?)/),o=r?Number.parseFloat(r[1]):500;return Number.isFinite(o)?Math.max(80,o):500},[]),Me=a(e=>{var t,n,r,o;if(F)return;const i=C.current,l=B.current;if(!i||!l)return;const a="diff"===T.current?null==(t=l.getDiffEditorView)?void 0:t.call(l):null==(n=l.getEditorView)?void 0:n.call(l);if(!a)return;const s=je();try{null==(r=a.updateOptions)||r.call(a,{automaticLayout:e})}catch{}e?(i.style.maxHeight="none",i.style.overflow="visible"):(i.style.maxHeight=`${Math.ceil(s)}px`,i.style.overflow="auto");try{const t=Number((()=>{if("function"==typeof a.getContentHeight)return a.getContentHeight();if("diff"===T.current&&"function"==typeof a.getModifiedEditor){const e=a.getModifiedEditor();if(e&&"function"==typeof e.getContentHeight)return e.getContentHeight()}})());if(Number.isFinite(t)&&t>0){const n=e?t:Math.min(t,s);i.style.height=`${Math.ceil(Math.max(120,n))}px`}null==(o=a.layout)||o.call(a)}catch{}},[je,F]);l(()=>{W.current=g},[g]),l(()=>{te(ce(s.language))},[s.language]);const $e=i(s);$e.current=s;const Oe=a(()=>{var e;$.current+=1;try{null==(e=E.current)||e.call(E)}catch{}_.current=null,T.current=null,L.current=null,J(!1),U(!1)},[]),Pe=a(()=>{var e,t,n,r,o,i;const l=C.current,a=S.current;if(!l||!a)return;const s=null!=(e=l.querySelector(".monaco-editor"))?e:l;try{const e="undefined"!=typeof window&&window.getComputedStyle?window.getComputedStyle(s):null,l=String(null!=(t=null==e?void 0:e.getPropertyValue("--vscode-editor-foreground"))?t:"").trim()||String(null!=(n=null==e?void 0:e.color)?n:"").trim(),c=String(null!=(r=null==e?void 0:e.getPropertyValue("--vscode-editor-background"))?r:"").trim()||String(null!=(o=null==e?void 0:e.backgroundColor)?o:"").trim(),d=String(null!=(i=null==e?void 0:e.getPropertyValue("--vscode-editor-selectionBackground"))?i:"").trim();l&&a.style.setProperty("--vscode-editor-foreground",l),c&&a.style.setProperty("--vscode-editor-background",c),d&&a.style.setProperty("--vscode-editor-selectionBackground",d)}catch{}},[]);l(()=>()=>{var e,t,n;$.current+=1,null==(e=E.current)||e.call(E),E.current=null,_.current=null,T.current=null,L.current=null,O.current=null,null==(n=null==(t=R.current)?void 0:t.destroy)||n.call(t),R.current=null},[]),l(()=>{var e,t;if("undefined"==typeof window)return;if(H)return;const n=S.current;if(!n)return;null==(t=null==(e=R.current)?void 0:e.destroy)||t.call(e);const r=D(n,{rootMargin:"400px"});return R.current=r,r.isVisible()&&V(!0),r.whenVisible.then(()=>V(!0)),()=>{r.destroy(),R.current===r&&(R.current=null)}},[D,H]),l(()=>{let e=!0;return"undefined"==typeof window||(async()=>{var t,n;try{const r=await ve();if(!e)return;if(!r)return void z(!0);const o=r.useMonaco,i=r.detectLanguage;if("function"==typeof i&&(O.current=i),"function"!=typeof o)return void z(!0);const l=null!=(t=c?p:f)?t:Ce,a={...I.current||{}},s=o({wordWrap:"on",wrappingIndent:"same",themes:A.current,theme:l,...a,onThemeChange(){Pe()}});B.current=s,"function"==typeof(n=s.setTheme)&&(Be=n,null!=Ce&&null!=Se&&Ne(Ce,Be).then(()=>_e()).catch(()=>{})),E.current="function"==typeof s.safeClean?()=>s.safeClean():"function"==typeof s.cleanupEditor?()=>s.cleanupEditor():null,X(!0)}catch{e&&z(!0)}})(),()=>{e=!1}},[]),l(()=>{var e;if(!s.language&&!ee&&O.current)try{const t=O.current(String(null!=(e=s.code)?e:""));t&&Q(t)}catch{}},[ee,s.code,s.language]);const Re=t(()=>String(s.language||ee||G||"plaintext"),[ee,G,s.language]),De=t(()=>ce(Re),[Re]),We=t(()=>de(De),[De]),Ae=t(()=>ue(De),[De]),Ie=t(()=>!!m&&("html"===De||"svg"===De),[De,m]),Fe=t(()=>{const e=De;return e?me[e]||e.charAt(0).toUpperCase()+e.slice(1):me[""]||"Plain Text"},[De]),ze=t(()=>{var e,t,n;return s.diff?null!=(t=null!=(e=s.updatedCode)?e:s.code)?t:"":null!=(n=s.code)?n:""},[s.code,s.diff,s.updatedCode]),He=t(()=>{const e=e=>{if(null!=e)return"number"==typeof e?`${e}px`:String(e)},t={},n=e(w),r=e(x);return n&&(t.minWidth=n),r&&(t.maxWidth=r),t},[w,x]),Ve=!1===u&&d,Ke=t(()=>c?p:f,[p,c,f]);l(()=>{if(F)return;if(!q||!H)return;const e=B.current;(null==e?void 0:e.setTheme)&&Ke&&Ne(Ke,e.setTheme).then(Pe).catch(()=>{})},[q,Ke,Pe,F,H]),l(()=>{var e;if("undefined"!=typeof window)return e=()=>{Pe()},Ee.add(e),()=>{Ee.delete(e)}},[Pe]);const Xe=a(async()=>{var e,t;if(F)return null;if(!H)return null;if(se)return null;if(Ve)return null;const n=B.current,r=C.current;if(!n||!r||!n.createEditor)return null;const o=$e.current,i=o.diff?"diff":"single",l=L.current,a="diff"===i?Boolean(null==(e=n.getDiffEditorView)?void 0:e.call(n)):Boolean(null==(t=n.getEditorView)?void 0:t.call(n));if(T.current===i&&l===r&&a)return null;if(_.current)return _.current;$.current+=1;const s=$.current;U(!0);const c=(async()=>{var e,t,i,l,a,c,d,u,m,h;try{null==(e=E.current)||e.call(E),T.current=null,L.current=null,J(!1);const p=We;if(o.diff?"function"==typeof n.createDiffEditor?(T.current="diff",await n.createDiffEditor(r,String(null!=(t=o.originalCode)?t:""),String(null!=(i=o.updatedCode)?i:""),p)):(T.current="single",await n.createEditor(r,String(null!=(a=null!=(l=o.updatedCode)?l:o.code)?a:""),p)):(T.current="single",await n.createEditor(r,String(null!=(c=o.code)?c:""),p)),L.current=r,$.current!==s)return;const f=Number(null==(d=W.current)?void 0:d.fontSize);if(Number.isFinite(f)&&f>0){ye(f),ke(f);try{const e="diff"===T.current?null==(u=n.getDiffEditorView)?void 0:u.call(n):null==(m=n.getEditorView)?void 0:m.call(n);null==(h=null==e?void 0:e.updateOptions)||h.call(e,{fontSize:f,automaticLayout:!1})}catch{}}Pe(),le||se||Me(!1),J(!0)}catch{$.current===s&&z(!0)}})().finally(()=>{_.current===c&&(_.current=null)});return _.current=c,c},[Me,se,le,We,Ve,Pe,F,H]);l(()=>{F||K&&H&&(se||Ve?Oe():Xe())},[se,Xe,K,Oe,Ve,F,H]),l(()=>{var e;if(F)return;if(!K)return;if(!H)return;if(se)return;if(Ve)return;const t=B.current;if(!t)return;const n=String(null!=(e=s.code)?e:"");(async()=>{var e,r;let o=ee;if(!o&&O.current)try{o=ce(O.current(n)),o&&te(o)}catch{}const i=de(o||De);if(t.createEditor&&C.current){try{await Promise.resolve(Xe())}catch{}const e=_.current;if(e)try{await e}catch{}}try{s.diff&&t.updateDiff?await Promise.resolve(t.updateDiff(String(null!=(e=s.originalCode)?e:""),String(null!=(r=s.updatedCode)?r:""),i)):t.updateCode&&await Promise.resolve(t.updateCode(n,i))}catch{}le&&Me(!0)})()},[Me,De,ee,se,q,Xe,le,K,s.code,s.diff,s.originalCode,s.updatedCode,Ve,F,H]),l(()=>{if(F)return;if(!K)return;if(!H)return;if(se)return;if(Ve)return;if(!le&&d)return;const e="undefined"!=typeof window&&"function"==typeof window.requestAnimationFrame?window.requestAnimationFrame(()=>Me(le)):null;return null==e&&Me(le),()=>{null!=e&&"undefined"!=typeof window&&"function"==typeof window.cancelAnimationFrame&&window.cancelAnimationFrame(e)}},[Me,se,le,d,K,Ve,F,H]),l(()=>{var e,t,n;if(!h)return;if(F)return;const r=B.current;if(r){try{const o="diff"===T.current?null==(e=r.getDiffEditorView)?void 0:e.call(r):null==(t=r.getEditorView)?void 0:t.call(r);null==(n=null==o?void 0:o.updateOptions)||n.call(o,{fontSize:be})}catch{}Me(le)}},[Me,h,le,be,s.diff,F]);const qe=a((e,t)=>{oe(e.currentTarget,t,"top",!1,(e.clientX,e.clientY),c)},[c]),Ue=a(()=>{ie()},[]),Ye=a(async()=>{var e;try{"undefined"!=typeof navigator&&navigator.clipboard&&"function"==typeof navigator.clipboard.writeText&&await navigator.clipboard.writeText(String(ze)),re(!0),null==(e=o.onCopy)||e.call(o,String(ze)),setTimeout(()=>re(!1),1e3)}catch{}},[o,ze]),Ze=a(()=>{if(!Ie)return;const e="html"===De?"text/html":"image/svg+xml",t="html"===De?we("artifacts.htmlPreviewTitle")||"HTML Preview":we("artifacts.svgPreviewTitle")||"SVG Preview";"function"!=typeof o.onPreviewCode?"html"===De&&ge(e=>!e):o.onPreviewCode({node:s,artifactType:e,artifactTitle:t,id:`temp-${De}-${Date.now()}`})},[De,Ie,s,o,we]);return F?/* @__PURE__ */M.jsx(Te,{node:s}):/* @__PURE__ */M.jsxs("div",{ref:S,className:["code-block-container my-4 rounded-lg border overflow-hidden shadow-sm",c?"border-gray-700/30 bg-gray-900":"border-gray-200 bg-white",d?"is-rendering":"",c?"is-dark":""].join(" "),style:He,children:[y&&/* @__PURE__ */M.jsxs("div",{className:"code-block-header flex justify-between items-center px-4 py-2.5 border-b border-gray-400/5",style:{color:`var(--vscode-editor-foreground, ${c?"#e5e7eb":"#111827"})`,backgroundColor:`var(--vscode-editor-background, ${c?"#111827":"#ffffff"})`},children:[
17
17
  /* @__PURE__ */M.jsxs("div",{className:"flex items-center space-x-2 flex-1 overflow-hidden",children:[
18
- /* @__PURE__ */M.jsx("span",{className:"icon-slot h-4 w-4 flex-shrink-0",dangerouslySetInnerHTML:{__html:We}}),
18
+ /* @__PURE__ */M.jsx("span",{className:"icon-slot h-4 w-4 flex-shrink-0",dangerouslySetInnerHTML:{__html:Ae}}),
19
19
  /* @__PURE__ */M.jsx("span",{className:"text-sm font-medium font-mono truncate",children:Fe})]}),
20
20
  /* @__PURE__ */M.jsxs("div",{className:"flex items-center space-x-2",children:[
21
- /* @__PURE__ */M.jsx("button",{type:"button",className:"code-action-btn p-2 text-xs rounded-md transition-colors hover:bg-[var(--vscode-editor-selectionBackground)]","aria-pressed":se,onClick:()=>pe(e=>!e),onMouseEnter:e=>Ue(e,se?we("common.expand")||"Expand":we("common.collapse")||"Collapse"),onFocus:e=>Ue(e,se?we("common.expand")||"Expand":we("common.collapse")||"Collapse"),onMouseLeave:qe,onBlur:qe,children:/* @__PURE__ */M.jsx("svg",{style:{rotate:se?"0deg":"90deg"},xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink","aria-hidden":"true",role:"img",width:"1em",height:"1em",viewBox:"0 0 24 24",className:"w-3 h-3",children:/* @__PURE__ */M.jsx("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"m9 18l6-6l-6-6"})})}),N&&h&&/* @__PURE__ */M.jsxs(M.Fragment,{children:[
22
- /* @__PURE__ */M.jsx("button",{type:"button",className:"code-action-btn p-2 text-xs rounded-md transition-colors hover:bg-[var(--vscode-editor-selectionBackground)]",disabled:ke<=10,onClick:()=>be(e=>Math.max(10,e-1)),onMouseEnter:e=>Ue(e,we("common.decrease")||"Decrease"),onFocus:e=>Ue(e,we("common.decrease")||"Decrease"),onMouseLeave:qe,onBlur:qe,children:/* @__PURE__ */M.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink","aria-hidden":"true",role:"img",width:"1em",height:"1em",viewBox:"0 0 24 24",className:"w-3 h-3",children:/* @__PURE__ */M.jsx("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M5 12h14"})})}),
23
- /* @__PURE__ */M.jsx("button",{type:"button",className:"code-action-btn p-2 text-xs rounded-md transition-colors hover:bg-[var(--vscode-editor-selectionBackground)]",disabled:ke===xe,onClick:()=>be(xe),onMouseEnter:e=>Ue(e,we("common.reset")||"Reset"),onFocus:e=>Ue(e,we("common.reset")||"Reset"),onMouseLeave:qe,onBlur:qe,children:/* @__PURE__ */M.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink","aria-hidden":"true",role:"img",width:"1em",height:"1em",viewBox:"0 0 24 24",className:"w-3 h-3",children:/* @__PURE__ */M.jsxs("g",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",children:[
21
+ /* @__PURE__ */M.jsx("button",{type:"button",className:"code-action-btn p-2 text-xs rounded-md transition-colors hover:bg-[var(--vscode-editor-selectionBackground)]","aria-pressed":se,onClick:()=>pe(e=>!e),onMouseEnter:e=>qe(e,se?we("common.expand")||"Expand":we("common.collapse")||"Collapse"),onFocus:e=>qe(e,se?we("common.expand")||"Expand":we("common.collapse")||"Collapse"),onMouseLeave:Ue,onBlur:Ue,children:/* @__PURE__ */M.jsx("svg",{style:{rotate:se?"0deg":"90deg"},xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink","aria-hidden":"true",role:"img",width:"1em",height:"1em",viewBox:"0 0 24 24",className:"w-3 h-3",children:/* @__PURE__ */M.jsx("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"m9 18l6-6l-6-6"})})}),N&&h&&/* @__PURE__ */M.jsxs(M.Fragment,{children:[
22
+ /* @__PURE__ */M.jsx("button",{type:"button",className:"code-action-btn p-2 text-xs rounded-md transition-colors hover:bg-[var(--vscode-editor-selectionBackground)]",disabled:be<=10,onClick:()=>ke(e=>Math.max(10,e-1)),onMouseEnter:e=>qe(e,we("common.decrease")||"Decrease"),onFocus:e=>qe(e,we("common.decrease")||"Decrease"),onMouseLeave:Ue,onBlur:Ue,children:/* @__PURE__ */M.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink","aria-hidden":"true",role:"img",width:"1em",height:"1em",viewBox:"0 0 24 24",className:"w-3 h-3",children:/* @__PURE__ */M.jsx("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M5 12h14"})})}),
23
+ /* @__PURE__ */M.jsx("button",{type:"button",className:"code-action-btn p-2 text-xs rounded-md transition-colors hover:bg-[var(--vscode-editor-selectionBackground)]",disabled:be===xe,onClick:()=>ke(xe),onMouseEnter:e=>qe(e,we("common.reset")||"Reset"),onFocus:e=>qe(e,we("common.reset")||"Reset"),onMouseLeave:Ue,onBlur:Ue,children:/* @__PURE__ */M.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink","aria-hidden":"true",role:"img",width:"1em",height:"1em",viewBox:"0 0 24 24",className:"w-3 h-3",children:/* @__PURE__ */M.jsxs("g",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",children:[
24
24
  /* @__PURE__ */M.jsx("path",{d:"M3 12a9 9 0 1 0 9-9a9.75 9.75 0 0 0-6.74 2.74L3 8"}),
25
25
  /* @__PURE__ */M.jsx("path",{d:"M3 3v5h5"})]})})}),
26
- /* @__PURE__ */M.jsx("button",{type:"button",className:"code-action-btn p-2 text-xs rounded-md transition-colors hover:bg-[var(--vscode-editor-selectionBackground)]",disabled:ke>=36,onClick:()=>be(e=>Math.min(36,e+1)),onMouseEnter:e=>Ue(e,we("common.increase")||"Increase"),onFocus:e=>Ue(e,we("common.increase")||"Increase"),onMouseLeave:qe,onBlur:qe,children:/* @__PURE__ */M.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink","aria-hidden":"true",role:"img",width:"1em",height:"1em",viewBox:"0 0 24 24",className:"w-3 h-3",children:/* @__PURE__ */M.jsx("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M5 12h14m-7-7v14"})})})]}),k&&/* @__PURE__ */M.jsx("button",{type:"button",className:"code-action-btn p-2 text-xs rounded-md transition-colors hover:bg-[var(--vscode-editor-selectionBackground)]","aria-label":te?we("common.copied")||"Copied":we("common.copy")||"Copy",onClick:Ye,onMouseEnter:e=>Ue(e,te?we("common.copied")||"Copied":we("common.copy")||"Copy"),onFocus:e=>Ue(e,te?we("common.copied")||"Copied":we("common.copy")||"Copy"),onMouseLeave:qe,onBlur:qe,children:te?/* @__PURE__ */M.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink","aria-hidden":"true",role:"img",width:"1em",height:"1em",viewBox:"0 0 24 24",className:"w-3 h-3",children:/* @__PURE__ */M.jsx("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M20 6L9 17l-5-5"})}):/* @__PURE__ */M.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink","aria-hidden":"true",role:"img",width:"1em",height:"1em",viewBox:"0 0 24 24",className:"w-3 h-3",children:/* @__PURE__ */M.jsxs("g",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",children:[
26
+ /* @__PURE__ */M.jsx("button",{type:"button",className:"code-action-btn p-2 text-xs rounded-md transition-colors hover:bg-[var(--vscode-editor-selectionBackground)]",disabled:be>=36,onClick:()=>ke(e=>Math.min(36,e+1)),onMouseEnter:e=>qe(e,we("common.increase")||"Increase"),onFocus:e=>qe(e,we("common.increase")||"Increase"),onMouseLeave:Ue,onBlur:Ue,children:/* @__PURE__ */M.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink","aria-hidden":"true",role:"img",width:"1em",height:"1em",viewBox:"0 0 24 24",className:"w-3 h-3",children:/* @__PURE__ */M.jsx("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M5 12h14m-7-7v14"})})})]}),b&&/* @__PURE__ */M.jsx("button",{type:"button",className:"code-action-btn p-2 text-xs rounded-md transition-colors hover:bg-[var(--vscode-editor-selectionBackground)]","aria-label":ne?we("common.copied")||"Copied":we("common.copy")||"Copy",onClick:Ye,onMouseEnter:e=>qe(e,ne?we("common.copied")||"Copied":we("common.copy")||"Copy"),onFocus:e=>qe(e,ne?we("common.copied")||"Copied":we("common.copy")||"Copy"),onMouseLeave:Ue,onBlur:Ue,children:ne?/* @__PURE__ */M.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink","aria-hidden":"true",role:"img",width:"1em",height:"1em",viewBox:"0 0 24 24",className:"w-3 h-3",children:/* @__PURE__ */M.jsx("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M20 6L9 17l-5-5"})}):/* @__PURE__ */M.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink","aria-hidden":"true",role:"img",width:"1em",height:"1em",viewBox:"0 0 24 24",className:"w-3 h-3",children:/* @__PURE__ */M.jsxs("g",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",children:[
27
27
  /* @__PURE__ */M.jsx("rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2"}),
28
- /* @__PURE__ */M.jsx("path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2"})]})})}),b&&/* @__PURE__ */M.jsx("button",{type:"button",className:"code-action-btn p-2 text-xs rounded-md transition-colors hover:bg-[var(--vscode-editor-selectionBackground)]","aria-pressed":le,onClick:()=>ae(e=>!e),onMouseEnter:e=>Ue(e,le?we("common.collapse")||"Collapse":we("common.expand")||"Expand"),onFocus:e=>Ue(e,le?we("common.collapse")||"Collapse":we("common.expand")||"Expand"),onMouseLeave:qe,onBlur:qe,children:le?/* @__PURE__ */M.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink","aria-hidden":"true",role:"img",width:"1em",height:"1em",viewBox:"0 0 24 24",className:"w-3 h-3",children:/* @__PURE__ */M.jsx("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M15 3h6v6m0-6l-7 7M3 21l7-7m-1 7H3v-6"})}):/* @__PURE__ */M.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink","aria-hidden":"true",role:"img",width:"1em",height:"1em",viewBox:"0 0 24 24",className:"w-3 h-3",children:/* @__PURE__ */M.jsx("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"m14 10l7-7m-1 7h-6V4M3 21l7-7m-6 0h6v6"})})}),Ie&&j&&/* @__PURE__ */M.jsx("button",{type:"button",className:"code-action-btn p-2 text-xs rounded-md transition-colors hover:bg-[var(--vscode-editor-selectionBackground)]","aria-label":we("common.preview")||"Preview",onClick:Ze,onMouseEnter:e=>Ue(e,we("common.preview")||"Preview"),onFocus:e=>Ue(e,we("common.preview")||"Preview"),onMouseLeave:qe,onBlur:qe,children:/* @__PURE__ */M.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",children:/* @__PURE__ */M.jsxs("g",{fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd",children:[
28
+ /* @__PURE__ */M.jsx("path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2"})]})})}),k&&/* @__PURE__ */M.jsx("button",{type:"button",className:"code-action-btn p-2 text-xs rounded-md transition-colors hover:bg-[var(--vscode-editor-selectionBackground)]","aria-pressed":le,onClick:()=>ae(e=>!e),onMouseEnter:e=>qe(e,le?we("common.collapse")||"Collapse":we("common.expand")||"Expand"),onFocus:e=>qe(e,le?we("common.collapse")||"Collapse":we("common.expand")||"Expand"),onMouseLeave:Ue,onBlur:Ue,children:le?/* @__PURE__ */M.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink","aria-hidden":"true",role:"img",width:"1em",height:"1em",viewBox:"0 0 24 24",className:"w-3 h-3",children:/* @__PURE__ */M.jsx("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M15 3h6v6m0-6l-7 7M3 21l7-7m-1 7H3v-6"})}):/* @__PURE__ */M.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink","aria-hidden":"true",role:"img",width:"1em",height:"1em",viewBox:"0 0 24 24",className:"w-3 h-3",children:/* @__PURE__ */M.jsx("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"m14 10l7-7m-1 7h-6V4M3 21l7-7m-6 0h6v6"})})}),Ie&&j&&/* @__PURE__ */M.jsx("button",{type:"button",className:"code-action-btn p-2 text-xs rounded-md transition-colors hover:bg-[var(--vscode-editor-selectionBackground)]","aria-label":we("common.preview")||"Preview",onClick:Ze,onMouseEnter:e=>qe(e,we("common.preview")||"Preview"),onFocus:e=>qe(e,we("common.preview")||"Preview"),onMouseLeave:Ue,onBlur:Ue,children:/* @__PURE__ */M.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",children:/* @__PURE__ */M.jsxs("g",{fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd",children:[
29
29
  /* @__PURE__ */M.jsx("path",{d:"M23.628 7.41c-.12-1.172-.08-3.583-.9-4.233c-1.921-1.51-6.143-1.11-8.815-1.19c-3.481-.15-7.193.14-10.625.24a.34.34 0 0 0 0 .67c3.472-.05 7.074-.29 10.575-.09c2.471.15 6.653-.14 8.254 1.16c.4.33.41 2.732.49 3.582a42 42 0 0 1 .08 9.005a13.8 13.8 0 0 1-.45 3.001c-2.42 1.4-19.69 2.381-20.72.55a21 21 0 0 1-.65-4.632a41.5 41.5 0 0 1 .12-7.964c.08 0 7.334.33 12.586.24c2.331 0 4.682-.13 6.764-.21a.33.33 0 0 0 0-.66c-7.714-.16-12.897-.43-19.31.05c.11-1.38.48-3.922.38-4.002a.3.3 0 0 0-.42 0c-.37.41-.29 1.77-.36 2.251s-.14 1.07-.2 1.6a45 45 0 0 0-.36 8.645a21.8 21.8 0 0 0 .66 5.002c1.46 2.702 17.248 1.461 20.95.43c1.45-.4 1.69-.8 1.871-1.95c.575-3.809.602-7.68.08-11.496"}),
30
30
  /* @__PURE__ */M.jsx("path",{d:"M4.528 5.237a.84.84 0 0 0-.21-1c-.77-.41-1.71.39-1 1.1a.83.83 0 0 0 1.21-.1m2.632-.25c.14-.14.19-.84-.2-1c-.77-.41-1.71.39-1 1.09a.82.82 0 0 0 1.2-.09m2.88 0a.83.83 0 0 0-.21-1c-.77-.41-1.71.39-1 1.09a.82.82 0 0 0 1.21-.09m-4.29 8.735c0 .08.23 2.471.31 2.561a.371.371 0 0 0 .63-.14c0-.09 0 0 .15-1.72a10 10 0 0 0-.11-2.232a5.3 5.3 0 0 1-.26-1.37a.3.3 0 0 0-.54-.24a6.8 6.8 0 0 0-.2 2.33c-1.281-.38-1.121.13-1.131-.42a15 15 0 0 0-.19-1.93c-.16-.17-.36-.17-.51.14a20 20 0 0 0-.43 3.471c.04.773.18 1.536.42 2.272c.26.4.7.22.7-.1c0-.09-.16-.09 0-1.862c.06-1.18-.23-.3 1.16-.76m5.033-2.552c.32-.07.41-.28.39-.37c0-.55-3.322-.34-3.462-.24s-.2.18-.18.28s0 .11 0 .16a3.8 3.8 0 0 0 1.591.361v.82a15 15 0 0 0-.13 3.132c0 .2-.09.94.17 1.16a.34.34 0 0 0 .48 0c.125-.35.196-.718.21-1.09a8 8 0 0 0 .14-3.232c0-.13.05-.7-.1-.89a8 8 0 0 0 .89-.09m5.544-.181a.69.69 0 0 0-.89-.44a2.8 2.8 0 0 0-1.252 1.001a2.3 2.3 0 0 0-.41-.83a1 1 0 0 0-1.6.27a7 7 0 0 0-.35 2.07c0 .571 0 2.642.06 2.762c.14 1.09 1 .51.63.13a17.6 17.6 0 0 1 .38-3.962c.32-1.18.32.2.39.51s.11 1.081.73 1.081s.48-.93 1.401-1.78q.075 1.345 0 2.69a15 15 0 0 0 0 1.811a.34.34 0 0 0 .68 0q.112-.861.11-1.73a16.7 16.7 0 0 0 .12-3.582m1.441-.201c-.05.16-.3 3.002-.31 3.202a6.3 6.3 0 0 0 .21 1.741c.33 1 1.21 1.07 2.291.82a3.7 3.7 0 0 0 1.14-.23c.21-.22.10-.59-.41-.64q-.817.096-1.64.07c-.44-.07-.34 0-.67-4.442q.015-.185 0-.37a.316.316 0 0 0-.23-.38a.316.316 0 0 0-.38.23"})]})})})]})]}),
31
- /* @__PURE__ */M.jsxs("div",{className:"code-block-body"+(le?" code-block-body--expanded":""),children:[!se&&(!!u||!d)&&(F?/* @__PURE__ */M.jsx(_e,{node:s}):/* @__PURE__ */M.jsxs(M.Fragment,{children:[
31
+ /* @__PURE__ */M.jsxs("div",{className:`code-block-body${se?" code-block-body--collapsed":""}${le?" code-block-body--expanded":""}`,children:[!se&&(!!u||!d)&&(F?/* @__PURE__ */M.jsx(Te,{node:s}):/* @__PURE__ */M.jsxs(M.Fragment,{children:[
32
32
  /* @__PURE__ */M.jsx("div",{ref:C,className:"code-editor-container"+(u?"":" code-height-placeholder"),style:{visibility:Z?"visible":"hidden"},"aria-hidden":!Z}),!Z&&/* @__PURE__ */M.jsx("div",{style:{position:"absolute",inset:0,overflow:"auto",padding:"1rem"},children:/* @__PURE__ */M.jsx("pre",{className:"code-fallback-plain m-0","aria-busy":d,"aria-label":`Code block: ${Fe}`,tabIndex:0,children:/* @__PURE__ */M.jsx("code",{translate:"no",children:String(ze)})})})]})),!u&&d&&/* @__PURE__ */M.jsx("div",{className:"code-loading-placeholder",children:/* @__PURE__ */M.jsxs("div",{className:"loading-skeleton",children:[
33
33
  /* @__PURE__ */M.jsx("div",{className:"skeleton-line"}),
34
34
  /* @__PURE__ */M.jsx("div",{className:"skeleton-line"}),
35
- /* @__PURE__ */M.jsx("div",{className:"skeleton-line short"})]})})]}),fe&&!o.onPreviewCode&&Ie&&"html"===Oe&&/* @__PURE__ */M.jsx(he,{code:String(null!=(r=s.code)?r:""),isDark:c,onClose:()=>ge(!1)}),
36
- /* @__PURE__ */M.jsx("span",{className:"sr-only","aria-live":"polite",role:"status",children:te?we("common.copied")||"Copied":""})]})}function Pe(e){const{node:n,ctx:t,renderNode:r,indexKey:o}=e,i=Array.isArray(n.items)?n.items:[];/* @__PURE__ */
37
- return M.jsx("dl",{className:"definition-list","data-index-key":o,children:i.map((e,n)=>/* @__PURE__ */M.jsxs("div",{className:"mb-4",children:[
38
- /* @__PURE__ */M.jsx("dt",{className:"definition-term font-semibold",children:t&&r?B(e.term,t,`${String(null!=o?o:"definition")}-term-${n}`,r):null}),
39
- /* @__PURE__ */M.jsx("dd",{className:"definition-desc ml-4",children:t&&r?B(e.definition,t,`${String(null!=o?o:"definition")}-desc-${n}`,r):null})]},`${String(null!=o?o:"definition")}-${n}`))})}function Re(e){var n;const{node:t}=e;/* @__PURE__ */
40
- return M.jsx("span",{className:"emoji-node",children:null!=(n=t.name)?n:t.markup})}function De(e){/* @__PURE__ */
41
- return M.jsx("em",{className:"emphasis-node",children:e.children})}function Oe(e){const{node:n}=e,t=a(e=>{var t;if(e.preventDefault(),"undefined"==typeof document)return;const r=document.getElementById(`fnref-${String(null!=(t=n.id)?t:"")}`);r&&r.scrollIntoView({behavior:"smooth"})},[n.id]);/* @__PURE__ */
42
- return M.jsx("a",{className:"footnote-anchor text-sm text-[#0366d6] hover:underline cursor-pointer",href:`#fnref-${n.id}`,title:`Back to reference ${n.id}`,onClick:t,children:"↩︎"})}function Ae(e){const{node:n,ctx:t,renderNode:r,indexKey:o}=e;/* @__PURE__ */
43
- return M.jsx("div",{id:`footnote-${n.id}`,className:"footnote-node flex mt-2 mb-2 text-sm leading-relaxed border-t border-[#eaecef] pt-2",children:/* @__PURE__ */M.jsx("div",{className:"flex-1",children:t&&r?S(n.children,t,String(null!=o?o:`footnote-${n.id}`),r):null})})}function We(e){const{node:t}=e,r=n(()=>`#footnote-${t.id}`,[t.id]),o=a(e=>{if(e.preventDefault(),"undefined"==typeof document)return;const n=document.querySelector(r);n&&n.scrollIntoView({behavior:"smooth"})},[r]);/* @__PURE__ */
44
- return M.jsx("sup",{id:`fnref-${t.id}`,className:"footnote-reference",onClick:o,children:/* @__PURE__ */M.jsxs("a",{href:r,title:`View footnote ${t.id}`,className:"footnote-link cursor-pointer",children:["[",t.id,"]"]})})}function Ie(e){/* @__PURE__ */
45
- return M.jsx("br",{className:"hard-break"})}function Fe(e){var n,t,r="";if("string"==typeof e||"number"==typeof e)r+=e;else if("object"==typeof e)if(Array.isArray(e)){var o=e.length;for(n=0;n<o;n++)e[n]&&(t=Fe(e[n]))&&(r&&(r+=" "),r+=t)}else for(t in e)e[t]&&(r&&(r+=" "),r+=t);return r}function ze(){for(var e,n,t=0,r="",o=arguments.length;t<o;t++)(e=arguments[t])&&(n=Fe(e))&&(r&&(r+=" "),r+=n);return r}function He(e){const{node:n,ctx:t,renderNode:r,indexKey:o,children:i}=e,l=Math.min(6,Math.max(1,Number(n.level)||1)),a=`h${l}`;/* @__PURE__ */
46
- return M.jsx(a,{dir:"auto",className:ze("heading-node font-semibold",`heading-${l}`),children:null!=i?i:t&&r?S(n.children,t,String(null!=o?o:`heading-${l}`),r):null})}function Ve(e){/* @__PURE__ */
47
- return M.jsx("mark",{className:"highlight-node",children:e.children})}function Ke(e){const{node:r,placeholder:o}=e,a=R(),[s,c]=t(null),d=i(null),[u,m]=t(()=>"undefined"==typeof window),[h,p]=t(r.content),f=Boolean(r.loading);l(()=>{var e;if("undefined"==typeof window)return void m(!0);if(null==(e=d.current)||e.destroy(),d.current=null,!f)return m(!0),void p(r.content);if(!s)return void m(!1);const n=a(s,{rootMargin:"400px"});return d.current=n,n.isVisible()&&m(!0),n.whenVisible.then(()=>m(!0)).catch(()=>{}),()=>{n.destroy(),d.current=null}},[s,f,r.content,a]),l(()=>()=>{var e;null==(e=d.current)||e.destroy(),d.current=null},[]),l(()=>{f&&!u||p(r.content)},[f,r.content,u]);const g=n(()=>{var e;return C(null!=(e=r.attrs)?e:void 0)},[r.attrs]);/* @__PURE__ */
48
- return M.jsx("div",{ref:c,className:"html-block-node",...g,children:u?/* @__PURE__ */M.jsx("div",{dangerouslySetInnerHTML:{__html:null!=h?h:""}}):/* @__PURE__ */M.jsx("div",{className:"html-block-node__placeholder",children:null!=o?o:/* @__PURE__ */M.jsxs(M.Fragment,{children:[
35
+ /* @__PURE__ */M.jsx("div",{className:"skeleton-line short"})]})})]}),fe&&!o.onPreviewCode&&Ie&&"html"===De&&/* @__PURE__ */M.jsx(he,{code:String(null!=(r=s.code)?r:""),isDark:c,onClose:()=>ge(!1)}),
36
+ /* @__PURE__ */M.jsx("span",{className:"sr-only","aria-live":"polite",role:"status",children:ne?we("common.copied")||"Copied":""})]})}function Oe(e){const{node:t,ctx:n,renderNode:r,indexKey:o}=e,i=Array.isArray(t.items)?t.items:[];/* @__PURE__ */
37
+ return M.jsx("dl",{className:"definition-list","data-index-key":o,children:i.map((e,t)=>/* @__PURE__ */M.jsxs("div",{className:"mb-4",children:[
38
+ /* @__PURE__ */M.jsx("dt",{className:"definition-term font-semibold",children:n&&r?B(e.term,n,`${String(null!=o?o:"definition")}-term-${t}`,r):null}),
39
+ /* @__PURE__ */M.jsx("dd",{className:"definition-desc ml-4",children:n&&r?B(e.definition,n,`${String(null!=o?o:"definition")}-desc-${t}`,r):null})]},`${String(null!=o?o:"definition")}-${t}`))})}function Pe(e){var t;const{node:n}=e;/* @__PURE__ */
40
+ return M.jsx("span",{className:"emoji-node",children:null!=(t=n.name)?t:n.markup})}function Re(e){/* @__PURE__ */
41
+ return M.jsx("em",{className:"emphasis-node",children:e.children})}function De(e){const{node:t}=e,n=a(e=>{var n;if(e.preventDefault(),"undefined"==typeof document)return;const r=document.getElementById(`fnref-${String(null!=(n=t.id)?n:"")}`);r&&r.scrollIntoView({behavior:"smooth"})},[t.id]);/* @__PURE__ */
42
+ return M.jsx("a",{className:"footnote-anchor text-sm text-[#0366d6] hover:underline cursor-pointer",href:`#fnref-${t.id}`,title:`Back to reference ${t.id}`,onClick:n,children:"↩︎"})}function We(e){const{node:t,ctx:n,renderNode:r,indexKey:o}=e;/* @__PURE__ */
43
+ return M.jsx("div",{id:`footnote-${t.id}`,className:"footnote-node flex mt-2 mb-2 text-sm leading-relaxed border-t border-[#eaecef] pt-2",children:/* @__PURE__ */M.jsx("div",{className:"flex-1",children:n&&r?S(t.children,n,String(null!=o?o:`footnote-${t.id}`),r):null})})}function Ae(e){const{node:n}=e,r=t(()=>`#footnote-${n.id}`,[n.id]),o=a(e=>{if(e.preventDefault(),"undefined"==typeof document)return;const t=document.querySelector(r);t&&t.scrollIntoView({behavior:"smooth"})},[r]);/* @__PURE__ */
44
+ return M.jsx("sup",{id:`fnref-${n.id}`,className:"footnote-reference",onClick:o,children:/* @__PURE__ */M.jsxs("a",{href:r,title:`View footnote ${n.id}`,className:"footnote-link cursor-pointer",children:["[",n.id,"]"]})})}function Ie(e){/* @__PURE__ */
45
+ return M.jsx("br",{className:"hard-break"})}function Fe(e){var t,n,r="";if("string"==typeof e||"number"==typeof e)r+=e;else if("object"==typeof e)if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(n=Fe(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function ze(){for(var e,t,n=0,r="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=Fe(e))&&(r&&(r+=" "),r+=t);return r}function He(e){const{node:t,ctx:n,renderNode:r,indexKey:o,children:i}=e,l=Math.min(6,Math.max(1,Number(t.level)||1)),a=`h${l}`;/* @__PURE__ */
46
+ return M.jsx(a,{dir:"auto",className:ze("heading-node font-semibold",`heading-${l}`),children:null!=i?i:n&&r?S(t.children,n,String(null!=o?o:`heading-${l}`),r):null})}function Ve(e){/* @__PURE__ */
47
+ return M.jsx("mark",{className:"highlight-node",children:e.children})}const Ke=/* @__PURE__ */new Set(["onclick","onerror","onload","onmouseover","onmouseout","onmousedown","onmouseup","onkeydown","onkeyup","onfocus","onblur","onsubmit","onreset","onchange","onselect","ondblclick"]),Xe=/* @__PURE__ */new Set(["script"]),qe=/* @__PURE__ */new Set(["href","src","srcset","xlink:href","formaction"]);function Ue(e){const t=function(e){let t="";for(const n of e){const e=n.charCodeAt(0);e<=31||127===e||/\s/u.test(n)||(t+=n)}return t}(e).toLowerCase();return!(!t.startsWith("javascript:")&&!t.startsWith("vbscript:"))||!!t.startsWith("data:")&&!(t.startsWith("data:image/")||t.startsWith("data:video/")||t.startsWith("data:audio/"))}const Ye=/* @__PURE__ */new Set(["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","label","legend","li","link","main","map","mark","menu","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr"]),Ze=/* @__PURE__ */new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]);function Je(e){return e.startsWith("--")?e:e.replace(/-([a-z])/g,(e,t)=>t.toUpperCase())}function Ge(e){const t={...e};if(Object.prototype.hasOwnProperty.call(t,"class")&&(t.className=t.class,delete t.class),Object.prototype.hasOwnProperty.call(t,"for")&&(t.htmlFor=t.for,delete t.for),"string"==typeof t.style){const e=function(e){const t=e.trim();if(!t)return;const n={};for(const r of t.split(";")){const e=r.trim();if(!e)continue;const t=e.indexOf(":");if(-1===t)continue;const o=Je(e.slice(0,t).trim()),i=e.slice(t+1).trim();o&&(n[o]=i)}return Object.keys(n).length?n:void 0}(t.style);e?t.style=e:delete t.style}return t}function Qe(e){const t={};for(const[n,r]of Object.entries(e)){const e=n.toLowerCase();Ke.has(e)||qe.has(e)&&r&&Ue(r)||(t[n]=r)}return t}function et(e,t){const n=e.toLowerCase();return!Ye.has(n)&&(Object.prototype.hasOwnProperty.call(t,n)||Object.prototype.hasOwnProperty.call(t,e))}function tt(r){const{node:o,placeholder:a,customId:c}=r,d=P(),[u,m]=n(null),h=i(null),[p,f]=n(()=>"undefined"==typeof window),[g,v]=n(o.content),w=Boolean(o.loading),x=s(I,F,F),y=t(()=>{var e;return null!=(e=r.customComponents)?e:H(c)},[c,r.customComponents,x]);l(()=>{var e;if("undefined"==typeof window)return void f(!0);if(null==(e=h.current)||e.destroy(),h.current=null,!w)return f(!0),void v(o.content);if(!u)return void f(!1);const t=d(u,{rootMargin:"400px"});return h.current=t,t.isVisible()&&f(!0),t.whenVisible.then(()=>f(!0)).catch(()=>{}),()=>{t.destroy(),h.current=null}},[u,w,o.content,d]),l(()=>()=>{var e;null==(e=h.current)||e.destroy(),h.current=null},[]),l(()=>{w&&!p||v(o.content)},[w,o.content,p]);const b=t(()=>{var e;return C(null!=(e=o.attrs)?e:void 0)},[o.attrs]),k=t(()=>{var e;return function(e,t){const n=/<([a-z][a-z0-9-]*)\b[^>]*>/gi;let r;for(;null!==(r=n.exec(e));)if(et(r[1],t))return!0;return!1}(null!=(e=o.content)?e:"",y)},[y,o.content]),j=t(()=>k&&o.content?function(t,n){if(!t)return[];try{const r=function(e){var t,n,r;const o=[];let i=0;for(;i<e.length;){if(e.startsWith("\x3c!--",i)){const t=e.indexOf("--\x3e",i);if(-1!==t){i=t+3;continue}break}const l=e.indexOf("<",i);if(-1===l){i<e.length&&e.slice(i).trim()&&o.push({type:"text",content:e.slice(i)});break}if(l>i){const t=e.slice(i,l);t.trim()&&o.push({type:"text",content:t})}const a=e.indexOf(">",l);if(-1===a)break;const s=e.slice(l+1,a).trim(),c=s.startsWith("/"),d=s.endsWith("/");if(c)o.push({type:"tag_close",tagName:s.slice(1).trim()});else{const e=s.indexOf(" ");let i,l="";-1===e?i=d?s.slice(0,-1).trim():s.trim():(i=s.slice(0,e).trim(),l=s.slice(e+1));const a={};if(l){const e=/([^\s=]+)(?:=(?:"([^"]*)"|'([^']*)'|(\S*)))?/g;let o;for(;null!==(o=e.exec(l));){const e=o[1],i=null!=(r=null!=(n=null!=(t=o[2])?t:o[3])?n:o[4])?r:"";e&&!e.endsWith("/")&&(a[e]=i)}}o.push({type:d||Ze.has(i.toLowerCase())?"self_closing":"tag_open",tagName:i,attrs:a})}i=a+1}return o}(t),o=[],i=[];for(const t of r)if("text"===t.type){if(o.length>0&&o[o.length-1].blocked)continue;(o.length>0?o[o.length-1].children:i).push(t.content)}else if("self_closing"===t.type){if(Xe.has(t.tagName.toLowerCase()))continue;const r=Qe(t.attrs||{}),l=et(t.tagName,n)?n[t.tagName]||n[t.tagName.toLowerCase()]:void 0;l?(o.length>0?o[o.length-1].children:i).push(e.createElement(l,r)):(o.length>0?o[o.length-1].children:i).push(e.createElement(t.tagName,{...Ge(r),suppressHydrationWarning:!0}))}else if("tag_open"===t.type)o.push({tagName:t.tagName,children:[],attrs:t.attrs,blocked:Xe.has(t.tagName.toLowerCase())});else if("tag_close"===t.type){const t=o.pop();if(t){if(t.blocked)continue;const r=Qe(t.attrs||{}),l=et(t.tagName,n)?n[t.tagName]||n[t.tagName.toLowerCase()]:void 0,a=l?e.createElement(l,r,...t.children):e.createElement(t.tagName,{...Ge(r),suppressHydrationWarning:!0},...t.children);o.length>0?o[o.length-1].children.push(a):i.push(a)}}for(;o.length>0;){const t=o.pop();if(t.blocked)continue;const r=Qe(t.attrs||{}),l=et(t.tagName,n)?n[t.tagName]||n[t.tagName.toLowerCase()]:void 0,a=l?e.createElement(l,r,...t.children):e.createElement(t.tagName,{...Ge(r),suppressHydrationWarning:!0},...t.children);i.push(a)}return i}catch{return null}}(o.content,y):null,[y,o.content,k]);/* @__PURE__ */
48
+ return M.jsx("div",{ref:m,className:"html-block-node",...b,children:p?k&&j?/* @__PURE__ */M.jsx(M.Fragment,{children:j}):/* @__PURE__ */M.jsx("div",{dangerouslySetInnerHTML:{__html:null!=g?g:""}}):/* @__PURE__ */M.jsx("div",{className:"html-block-node__placeholder",children:null!=a?a:/* @__PURE__ */M.jsxs(M.Fragment,{children:[
49
49
  /* @__PURE__ */M.jsx("span",{className:"html-block-node__placeholder-bar"}),
50
50
  /* @__PURE__ */M.jsx("span",{className:"html-block-node__placeholder-bar w-4/5"}),
51
- /* @__PURE__ */M.jsx("span",{className:"html-block-node__placeholder-bar w-2/3"})]})})})}function Xe(e){var n;const{node:t}=e;return!t.loading||t.autoClosed?/* @__PURE__ */M.jsx("span",{className:"html-inline-node",dangerouslySetInnerHTML:{__html:null!=(n=t.content)?n:""}}):/* @__PURE__ */M.jsx("span",{className:"html-inline-node html-inline-node--loading",children:t.content})}const Ue={fallbackSrc:"",showCaption:!1,lazy:!0,svgMinHeight:"12rem",usePlaceholder:!0};function qe(e){var r,o,a,s,c,d;const u={...Ue,...e},m=R(),[h,p]=t(null),f=i(null),[g,v]=t(()=>"undefined"==typeof window||!1===u.lazy),[w,x]=t(!1),[y,k]=t(!1),[b,j]=t(!1);l(()=>{var e;if(!u.lazy)return;const n=h;if(null==(e=f.current)||e.destroy(),f.current=null,!n)return void v(!1);const t=m(n,{rootMargin:"400px"});return f.current=t,t.isVisible()&&v(!0),t.whenVisible.then(()=>v(!0)).catch(()=>{}),()=>{t.destroy(),f.current=null}},[h,m,u.lazy]),l(()=>()=>{var e;null==(e=f.current)||e.destroy(),f.current=null},[]);const N=n(()=>y&&u.fallbackSrc?u.fallbackSrc:u.node.src,[y,u.fallbackSrc,u.node.src]);l(()=>{x(!1),k(!1)},[N]),l(()=>{j(!1)},[u.node.src]);const C=n(()=>/\.svg(?:\?|$)/i.test(String(N)),[N]),S=!u.lazy||g,B=C?{minHeight:u.svgMinHeight,width:"100%"}:{minHeight:"6rem"};/* @__PURE__ */
51
+ /* @__PURE__ */M.jsx("span",{className:"html-block-node__placeholder-bar w-2/3"})]})})})}const nt=/* @__PURE__ */new Set(["onclick","onerror","onload","onmouseover","onmouseout","onmousedown","onmouseup","onkeydown","onkeyup","onfocus","onblur","onsubmit","onreset","onchange","onselect","ondblclick","ontouchstart","ontouchend","ontouchmove","ontouchcancel","onwheel","onscroll","oncopy","oncut","onpaste","oninput","oninvalid","onreset","onsearch","onsubmit"]),rt=/* @__PURE__ */new Set(["script"]),ot=/* @__PURE__ */new Set(["href","src","srcset","xlink:href","formaction"]),it=(()=>{try{return Boolean(!1)}catch{}return!1})();function lt(e){it&&console.warn(e)}function at(e){const t=function(e){let t="";for(const n of e){const e=n.charCodeAt(0);e<=31||127===e||/\s/u.test(n)||(t+=n)}return t}(e).toLowerCase();return!(!t.startsWith("javascript:")&&!t.startsWith("vbscript:"))||!!t.startsWith("data:")&&!(t.startsWith("data:image/")||t.startsWith("data:video/")||t.startsWith("data:audio/"))}const st=/* @__PURE__ */new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),ct=/* @__PURE__ */new Set(["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","label","legend","li","link","main","map","mark","menu","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr"]);function dt(e){return e.startsWith("--")?e:e.replace(/-([a-z])/g,(e,t)=>t.toUpperCase())}function ut(e,t){const n=e.toLowerCase();return!ct.has(n)&&(Object.prototype.hasOwnProperty.call(t,n)||Object.prototype.hasOwnProperty.call(t,e))}function mt(e,t){const n=t.toLowerCase();if(["checked","disabled","readonly","required","autofocus","multiple","hidden"].includes(n))return"true"===e||""===e||e===t;if(["value","min","max","step","width","height","size","maxlength"].includes(n)){const t=Number(e);if(""!==e&&!Number.isNaN(t))return t}return e}function ht(e){return e.trim().length>0}function pt(t,n,r,o){if(rt.has(t.toLowerCase()))return null;const i=function(e){const t={};for(const[n,r]of Object.entries(e)){const e=n.toLowerCase();nt.has(e)||ot.has(e)&&r&&at(r)||(t[n]=r)}return t}(n);if(ut(t,o)){const n=o[t]||o[t.toLowerCase()],l=function(e){const t={};for(const[n,r]of Object.entries(e))t[n]=mt(r,n);return t}(i);return e.createElement(n,l,...r)}return e.createElement(t,function(e){const t={...e};if(Object.prototype.hasOwnProperty.call(t,"class")&&(t.className=t.class,delete t.class),Object.prototype.hasOwnProperty.call(t,"for")&&(t.htmlFor=t.for,delete t.for),"string"==typeof t.style){const e=function(e){const t=e.trim();if(!t)return;const n={};for(const r of t.split(";")){const e=r.trim();if(!e)continue;const t=e.indexOf(":");if(-1===t)continue;const o=dt(e.slice(0,t).trim()),i=e.slice(t+1).trim();o&&(n[o]=i)}return Object.keys(n).length?n:void 0}(t.style);e?t.style=e:delete t.style}return t}(i),...r)}function ft(t){const{node:r,customId:o}=t,a=i(null),[s,c]=n(!1);l(()=>{c(!0)},[]);const d=H(o),u=e.useMemo(()=>{const e=r.content;if(!e)return{mode:"html",content:""};if(!function(e,t){const n=/<([a-z][a-z0-9-]*)\b[^>]*>/gi;let r;for(;null!==(r=n.exec(e));)if(ut(r[1],t))return!0;return!1}(e,d))return{mode:"html",content:e};const t=function(e,t){if(!e)return[];try{const n=function(e,t){const n=[],r=[];for(const o of e)if("text"===o.type)(n.length>0?n[n.length-1].children:r).push(o.content);else if("self_closing"===o.type){const e=pt(o.tagName,o.attrs||{},[],t),i=n.length>0?n[n.length-1].children:r;null!=e&&i.push(e)}else if("tag_open"===o.type)n.push({tagName:o.tagName,children:[],attrs:o.attrs});else if("tag_close"===o.type){const e=o.tagName.toLowerCase();let i=-1;for(let t=n.length-1;t>=0;t--)if(n[t].tagName.toLowerCase()===e){i=t;break}if(-1!==i)for(;n.length>i;){const o=n.pop(),l=pt(o.tagName,o.attrs||{},o.children,t);n.length>0?null!=l&&n[n.length-1].children.push(l):null!=l&&r.push(l),o.tagName.toLowerCase()!==e&&n.length>i&&lt(`Auto-closing unclosed tag: <${o.tagName}>`)}else lt(`Ignoring closing tag with no matching opening tag: </${o.tagName}>`)}for(;n.length>0;){const e=n.pop(),o=pt(e.tagName,e.attrs||{},e.children,t);null!=o&&r.push(o),lt(`Auto-closing unclosed tag: <${e.tagName}>`)}return r}(function(e){var t,n,r;const o=[];let i=0;for(;i<e.length;){if(e.startsWith("\x3c!--",i)){const t=e.indexOf("--\x3e",i);if(-1!==t){i=t+3;continue}break}const l=e.indexOf("<",i);if(-1===l){if(i<e.length){const t=e.slice(i);ht(t)&&o.push({type:"text",content:t})}break}if(l>i){const t=e.slice(i,l);ht(t)&&o.push({type:"text",content:t})}if(e.startsWith("![CDATA[",l+1)){const t=e.indexOf("]]>",l);if(-1!==t){o.push({type:"text",content:e.slice(l,t+3)}),i=t+3;continue}break}if(e.startsWith("!",l+1)){const t=e.indexOf(">",l);if(-1!==t){i=t+1;continue}break}const a=e.indexOf(">",l);if(-1===a)break;const s=e.slice(l+1,a).trim(),c=s.startsWith("/"),d=s.endsWith("/");if(c){const e=s.slice(1).trim();o.push({type:"tag_close",tagName:e})}else{const e=s.indexOf(" ");let i,l="";-1===e?i=d?s.slice(0,-1).trim():s.trim():(i=s.slice(0,e).trim(),l=s.slice(e+1));const a={};if(l){const e=/([^\s=]+)(?:=(?:"([^"]*)"|'([^']*)'|(\S*)))?/g;let o;for(;null!==(o=e.exec(l));){const e=o[1],i=null!=(r=null!=(n=null!=(t=o[2])?t:o[3])?n:o[4])?r:"";e&&!e.endsWith("/")&&(a[e]=i)}}o.push({type:d||st.has(i.toLowerCase())?"self_closing":"tag_open",tagName:i,attrs:a})}i=a+1}return o}(e),t);return n}catch(r){return n=r,it&&console.error("Failed to parse HTML to React nodes:",n),null}var n}(e,d);return null===t?{mode:"html",content:e}:{mode:"dynamic",nodes:t}},[r.content,d]);return l(()=>{var e;if(!s||!a.current||"html"!==u.mode)return;const t=a.current;t.innerHTML="";const n=document.createElement("template");n.innerHTML=null!=(e=r.content)?e:"",t.appendChild(n.content.cloneNode(!0))},[r.content,u.mode,s]),r.loading&&!r.autoClosed?/* @__PURE__ */M.jsx("span",{className:"html-inline-node html-inline-node--loading",children:r.content}):"dynamic"===u.mode?/* @__PURE__ */M.jsx("span",{className:"html-inline-node",style:{display:"inline"},children:u.nodes}):/* @__PURE__ */M.jsx("span",{ref:a,className:"html-inline-node",style:{display:"inline"}})}const gt={fallbackSrc:"",showCaption:!1,lazy:!0,svgMinHeight:"12rem",usePlaceholder:!0};function vt(e){var r,o,a,s,c,d;const u={...gt,...e},m=P(),[h,p]=n(null),f=i(null),[g,v]=n(()=>"undefined"==typeof window||!1===u.lazy),[w,x]=n(!1),[y,b]=n(!1),[k,j]=n(!1);l(()=>{var e;if(!u.lazy)return;const t=h;if(null==(e=f.current)||e.destroy(),f.current=null,!t)return void v(!1);const n=m(t,{rootMargin:"400px"});return f.current=n,n.isVisible()&&v(!0),n.whenVisible.then(()=>v(!0)).catch(()=>{}),()=>{n.destroy(),f.current=null}},[h,m,u.lazy]),l(()=>()=>{var e;null==(e=f.current)||e.destroy(),f.current=null},[]);const N=t(()=>y&&u.fallbackSrc?u.fallbackSrc:u.node.src,[y,u.fallbackSrc,u.node.src]);l(()=>{x(!1),b(!1)},[N]),l(()=>{j(!1)},[u.node.src]);const C=t(()=>/\.svg(?:\?|$)/i.test(String(N)),[N]),S=!u.lazy||g,B=C?{minHeight:u.svgMinHeight,width:"100%"}:{minHeight:"6rem"};/* @__PURE__ */
52
52
  return M.jsxs("figure",{ref:p,className:"image-node",children:[
53
53
  /* @__PURE__ */M.jsx("div",{className:"image-node__inner",children:u.node.loading||y||!S?y?/* @__PURE__ */M.jsxs("div",{className:"image-node__error",children:[
54
54
  /* @__PURE__ */M.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24","aria-hidden":"true",children:/* @__PURE__ */M.jsx("path",{fill:"currentColor",d:"M2 2h20v10h-2V4H4v9.586l5-5L14.414 14L13 15.414l-4-4l-5 5V20h8v2H2zm13.547 5a1 1 0 1 0 0 2a1 1 0 0 0 0-2m-3 1a3 3 0 1 1 6 0a3 3 0 0 1-6 0m3.625 6.757L19 17.586l2.828-2.829l1.415 1.415L20.414 19l2.829 2.828l-1.415 1.415L19 20.414l-2.828 2.829l-1.415-1.415L17.586 19l-2.829-2.828z"})}),
55
55
  /* @__PURE__ */M.jsx("span",{className:"image-node__placeholder-text",children:"Image failed to load"})]}):/* @__PURE__ */M.jsx("div",{className:"image-node__placeholder",style:B,children:u.usePlaceholder?/* @__PURE__ */M.jsxs(M.Fragment,{children:[
56
56
  /* @__PURE__ */M.jsx("span",{className:"image-node__spinner","aria-hidden":"true"}),
57
- /* @__PURE__ */M.jsx("span",{className:"image-node__placeholder-text",children:"Loading image..."})]}):/* @__PURE__ */M.jsx("span",{className:"image-node__placeholder-text",children:null!=(d=u.node.raw)?d:"Loading image…"})},"placeholder"):/* @__PURE__ */M.jsx("img",{src:N,alt:String(null!=(o=null!=(r=u.node.alt)?r:u.node.title)?o:""),title:String(null!=(s=null!=(a=u.node.title)?a:u.node.alt)?s:""),className:"image-node__img"+(w?" is-loaded":""),style:C?{minHeight:u.svgMinHeight,width:"100%",height:"auto",objectFit:"contain"}:void 0,loading:u.lazy?"lazy":"eager",decoding:"async",tabIndex:w?0:-1,"aria-label":null!=(c=u.node.alt)?c:"Preview image",onError:()=>{var e;u.fallbackSrc&&!b?(j(!0),k(!0)):(k(!0),null==(e=u.onError)||e.call(u,u.node.src))},onLoad:()=>{var e;x(!0),k(!1),null==(e=u.onLoad)||e.call(u,N)},onClick:e=>{var n;e.preventDefault(),w&&!y&&(null==(n=u.onClick)||n.call(u,[e,N]))}},"image")}),u.showCaption&&u.node.alt&&/* @__PURE__ */M.jsx("figcaption",{className:"image-node__caption",children:u.node.alt})]})}function Ye(e){const{node:n}=e;/* @__PURE__ */
58
- return M.jsx("code",{className:"inline-code inline text-[85%] px-1 py-0.5 rounded font-mono bg-secondary whitespace-normal break-words max-w-full",children:n.code})}function Ze(e){/* @__PURE__ */
59
- return M.jsx("ins",{className:"insert-node",children:e.children})}function Je(e){var t,r,o,i,l;const{node:s,ctx:c,renderNode:d,indexKey:u}=e,m=!1!==e.showTooltip,h=null!=(t=e.isDark)?t:null==c?void 0:c.isDark,p=n(()=>{var n,t,r,o,i,l;const a=void 0!==e.underlineBottom?"number"==typeof e.underlineBottom?`${e.underlineBottom}px`:String(e.underlineBottom):"-3px";return{"--link-color":null!=(n=e.color)?n:"#0366d6","--underline-height":`${null!=(t=e.underlineHeight)?t:2}px`,"--underline-bottom":a,"--underline-opacity":String(null!=(r=e.animationOpacity)?r:.9),"--underline-duration":`${null!=(o=e.animationDuration)?o:.8}s`,"--underline-timing":null!=(i=e.animationTiming)?i:"linear","--underline-iteration":"number"==typeof e.animationIteration?String(e.animationIteration):null!=(l=e.animationIteration)?l:"infinite"}},[e.animationDuration,e.animationIteration,e.animationOpacity,e.animationTiming,e.color,e.underlineBottom,e.underlineHeight]),f=String(null!=(o=null!=(r=s.title)?r:s.href)?o:""),g=a(e=>{m&&oe(e.currentTarget,String(s.title||s.href||s.text||""),"top",!1,(e.clientX,e.clientY),h)},[h,s.href,s.text,s.title,m]),v=a(()=>{m&&ie()},[m]);return s.loading?/* @__PURE__ */M.jsx("span",{className:"link-loading inline-flex items-baseline gap-1.5","aria-hidden":"false",style:p,children:/* @__PURE__ */M.jsxs("span",{className:"link-text-wrapper relative inline-flex",children:[
57
+ /* @__PURE__ */M.jsx("span",{className:"image-node__placeholder-text",children:"Loading image..."})]}):/* @__PURE__ */M.jsx("span",{className:"image-node__placeholder-text",children:null!=(d=u.node.raw)?d:"Loading image…"})},"placeholder"):/* @__PURE__ */M.jsx("img",{src:N,alt:String(null!=(o=null!=(r=u.node.alt)?r:u.node.title)?o:""),title:String(null!=(s=null!=(a=u.node.title)?a:u.node.alt)?s:""),className:"image-node__img"+(w?" is-loaded":""),style:C?{minHeight:u.svgMinHeight,width:"100%",height:"auto",objectFit:"contain"}:void 0,loading:u.lazy?"lazy":"eager",decoding:"async",tabIndex:w?0:-1,"aria-label":null!=(c=u.node.alt)?c:"Preview image",onError:()=>{var e;u.fallbackSrc&&!k?(j(!0),b(!0)):(b(!0),null==(e=u.onError)||e.call(u,u.node.src))},onLoad:()=>{var e;x(!0),b(!1),null==(e=u.onLoad)||e.call(u,N)},onClick:e=>{var t;e.preventDefault(),w&&!y&&(null==(t=u.onClick)||t.call(u,[e,N]))}},"image")}),u.showCaption&&u.node.alt&&/* @__PURE__ */M.jsx("figcaption",{className:"image-node__caption",children:u.node.alt})]})}function wt(e){const{node:t}=e;/* @__PURE__ */
58
+ return M.jsx("code",{className:"inline-code inline text-[85%] px-1 py-0.5 rounded font-mono bg-secondary whitespace-normal break-words max-w-full",children:t.code})}function xt(e){/* @__PURE__ */
59
+ return M.jsx("ins",{className:"insert-node",children:e.children})}function yt(e){var n,r,o,i,l;const{node:s,ctx:c,renderNode:d,indexKey:u}=e,m=!1!==e.showTooltip,h=null!=(n=e.isDark)?n:null==c?void 0:c.isDark,p=t(()=>{var t,n,r,o,i,l;const a=void 0!==e.underlineBottom?"number"==typeof e.underlineBottom?`${e.underlineBottom}px`:String(e.underlineBottom):"-3px";return{"--link-color":null!=(t=e.color)?t:"#0366d6","--underline-height":`${null!=(n=e.underlineHeight)?n:2}px`,"--underline-bottom":a,"--underline-opacity":String(null!=(r=e.animationOpacity)?r:.9),"--underline-duration":`${null!=(o=e.animationDuration)?o:.8}s`,"--underline-timing":null!=(i=e.animationTiming)?i:"linear","--underline-iteration":"number"==typeof e.animationIteration?String(e.animationIteration):null!=(l=e.animationIteration)?l:"infinite"}},[e.animationDuration,e.animationIteration,e.animationOpacity,e.animationTiming,e.color,e.underlineBottom,e.underlineHeight]),f=String(null!=(o=null!=(r=s.title)?r:s.href)?o:""),g=a(e=>{m&&oe(e.currentTarget,String(s.title||s.href||s.text||""),"top",!1,(e.clientX,e.clientY),h)},[h,s.href,s.text,s.title,m]),v=a(()=>{m&&ie()},[m]);return s.loading?/* @__PURE__ */M.jsx("span",{className:"link-loading inline-flex items-baseline gap-1.5","aria-hidden":"false",style:p,children:/* @__PURE__ */M.jsxs("span",{className:"link-text-wrapper relative inline-flex",children:[
60
60
  /* @__PURE__ */M.jsx("span",{className:"leading-[normal] link-text",children:/* @__PURE__ */M.jsx("span",{className:"leading-[normal] link-text",children:null!=(i=s.text)?i:""})}),
61
- /* @__PURE__ */M.jsx("span",{className:"underline-anim","aria-hidden":"true"})]})}):/* @__PURE__ */M.jsx("a",{className:"link-node",href:s.href,title:m?"":f,"aria-label":`Link: ${f}`,target:"_blank",rel:"noopener noreferrer",style:p,onMouseEnter:g,onMouseLeave:v,children:c&&d?S(s.children,c,String(null!=u?u:"link"),d):null!=(l=s.text)?l:null})}function Ge(e){const{node:n,ctx:t,renderNode:r,value:o,indexKey:i,children:l}=e,a=null==o?void 0:o;/* @__PURE__ */
62
- return M.jsx("li",{className:"list-item pl-1.5 my-2",dir:"auto",value:a,children:null!=l?l:t&&r?S(n.children,t,String(null!=i?i:"list-item"),r):null})}function Qe(e){var n;const{node:t,ctx:r,renderNode:o,indexKey:i}=e,l=t.ordered?"ol":"ul",a=t.ordered&&t.start?t.start:void 0;/* @__PURE__ */
63
- return M.jsx(l,{className:ze("list-node my-5 pl-[calc(13/8*1em)]",t.ordered?"list-decimal":"list-disc max-lg:my-[calc(4/3*1em)] max-lg:pl-[calc(14/9*1em)]"),start:a,children:null==(n=t.items)?void 0:n.map((e,n)=>{var l;/* @__PURE__ */
64
- return M.jsx(Ge,{node:e,value:t.ordered?(null!=(l=t.start)?l:1)+n:void 0,ctx:r,renderNode:o,indexKey:`${String(null!=i?i:"list")}-${n}`},`${String(null!=i?i:"list")}-${n}`)})})}let en=null,nn=null,tn=!1;const rn=/* @__PURE__ */new Map,on=/* @__PURE__ */new Map;let ln=5;const an=/* @__PURE__ */new Set;function sn(){if(rn.size<ln&&an.size){const e=Array.from(an);an.clear();for(const n of e)try{n()}catch{}}}function cn(e){en=e,nn=null,en.onmessage=e=>{const{id:n,html:t,error:r}=e.data,o=rn.get(n);if(o)if(rn.delete(n),clearTimeout(o.timeoutId),sn(),r)o.reject(new Error(r));else{const{content:n,displayMode:r}=e.data;if(n){const e=`${r?"d":"i"}:${n}`;if(on.set(e,t),on.size>200){const e=on.keys().next().value;on.delete(e)}}o.resolve(t)}},en.onerror=e=>{console.error("[katexWorkerClient] Worker error:",e);for(const[n,t]of rn.entries())clearTimeout(t.timeoutId),t.reject(new Error(`Worker error: ${e.message}`));rn.clear(),sn()}}function dn(){var e;en&&(null==(e=en.terminate)||e.call(en)),en=null,nn=null}function un(e){tn=!!e,en&&en.postMessage({type:"init",debug:tn})}const mn="WORKER_BUSY";async function hn(e,n=!0,t=2e3,r){if(performance.now(),nn)return Promise.reject(nn);const o=`${n?"d":"i"}:${e}`,i=on.get(o);if(i)return Promise.resolve(i);const l=en||(nn=new Error("[katexWorkerClient] No worker instance set. Please inject a Worker via setKaTeXWorker()."),nn.name="WORKER_INIT_ERROR",nn.code="WORKER_INIT_ERROR",null);if(!l)return Promise.reject(nn);if(rn.size>=ln){const e=new Error("Worker busy");return e.name="WorkerBusy",e.code=mn,e.busy=!0,e.inFlight=rn.size,e.max=ln,Promise.reject(e)}return new Promise((o,i)=>{if(null==r?void 0:r.aborted){const e=new Error("Aborted");return e.name="AbortError",void i(e)}const a=Math.random().toString(36).slice(2),s=setTimeout(()=>{rn.delete(a);const e=new Error("Worker render timed out");e.name="WorkerTimeout",e.code="WORKER_TIMEOUT",i(e),sn()},t),c=()=>{},d=()=>{rn.delete(a),clearTimeout(s),an.delete(c);const e=new Error("Aborted");e.name="AbortError",i(e),sn()};r&&r.addEventListener("abort",d,{once:!0}),rn.set(a,{resolve:e=>{r&&r.removeEventListener("abort",d),o(e)},reject:e=>{r&&r.removeEventListener("abort",d),i(e)},timeoutId:s});try{l.postMessage({id:a,content:e,displayMode:n,debug:tn})}catch(u){rn.delete(a),clearTimeout(s),r&&r.removeEventListener("abort",d),i(u),sn()}})}function pn(e,n,t){const r=`${n?"d":"i"}:${e}`;if(on.set(r,t),on.size>200){const e=on.keys().next().value;on.delete(e)}}function fn(){on.clear()}function gn(e){ln=Math.max(1,Math.floor(e)),sn()}function vn(e=1500,n){return rn.size<ln?Promise.resolve():new Promise((t,r)=>{if(null==n?void 0:n.aborted){const e=new Error("Aborted");return e.name="AbortError",void r(e)}let o=null;function i(){an.delete(l),null!=o&&clearTimeout(o),n&&n.removeEventListener("abort",a)}function l(){i(),t()}function a(){i();const e=new Error("Aborted");e.name="AbortError",r(e)}o=e>0?setTimeout(()=>{i(),r(new Error("Timeout waiting for worker slot"))},e):null,n&&n.addEventListener("abort",a,{once:!0}),an.add(l)})}const wn={timeout:2e3,waitTimeout:1500,backoffMs:30,maxRetries:1};function xn(e){null!=e.timeout&&(wn.timeout=Math.max(0,Math.floor(e.timeout))),null!=e.waitTimeout&&(wn.waitTimeout=Math.max(0,Math.floor(e.waitTimeout))),null!=e.backoffMs&&(wn.backoffMs=Math.max(0,Math.floor(e.backoffMs))),null!=e.maxRetries&&(wn.maxRetries=Math.max(0,Math.floor(e.maxRetries)))}function yn(){return{...wn}}async function kn(e,n=!0,t={}){var r,o,i,l;const a=null!=(r=t.timeout)?r:wn.timeout,s=null!=(o=t.waitTimeout)?o:wn.waitTimeout,c=null!=(i=t.backoffMs)?i:wn.backoffMs,d=null!=(l=t.maxRetries)?l:wn.maxRetries,u=t.signal;let m=0;for(;;){if(null==u?void 0:u.aborted){const e=new Error("Aborted");throw e.name="AbortError",e}try{return await hn(e,n,a,u)}catch(h){if((null==h?void 0:h.code)!==mn||m>=d)throw h;if(m++,await vn(s,u).catch(()=>{}),null==u?void 0:u.aborted){const e=new Error("Aborted");throw e.name="AbortError",e}c>0&&await new Promise(e=>setTimeout(e,c*m))}}}let bn=null,jn=!1;async function Mn(){if(bn)return bn;if(jn)return null;try{return bn=await import("katex"),await import("katex/contrib/mhchem"),bn}catch{return jn=!0,null}}function Nn({node:e}){const n=i(null),[r,o]=t(!0),a=i(0);return l(()=>{var t;let r=!1;const i=new AbortController,l=++a.current,s=null!=(t=e.content)?t:"";return s?(kn(s,!0,{timeout:3e3,waitTimeout:2e3,maxRetries:1,signal:i.signal}).then(e=>{r||l!==a.current||(n.current&&(n.current.innerHTML=e),o(!1))}).catch(async t=>{if(r||l!==a.current)return;if(!n.current)return;const i=(null==t?void 0:t.code)||(null==t?void 0:t.name);if("WORKER_INIT_ERROR"===i||(null==t?void 0:t.fallbackToRenderer)||i===mn||"WORKER_TIMEOUT"===i){const t=await Mn();if(t)try{const i=t.renderToString(s,{throwOnError:e.loading,displayMode:!0});return void(!r&&l===a.current&&n.current&&(n.current.innerHTML=i,o(!1),pn(s,!0,i)))}catch{}}e.loading||(n.current.textContent=e.raw,o(!1))}),()=>{r=!0,i.abort()}):(o(!1),()=>i.abort())},[e.content,e.loading,e.raw]),/* @__PURE__ */M.jsx("div",{className:"math-block text-center overflow-x-auto relative min-h-[40px]",children:/* @__PURE__ */M.jsx("div",{ref:n,className:r?"math-rendering":void 0})})}function Cn({node:e}){const n=i(null),r=i(null),[o,a]=t(!0),s=i(0);return l(()=>{var n;let t=!1;const o=new AbortController,i=++s.current,l=null!=(n=e.content)?n:"";return l?(kn(l,!1,{timeout:1500,waitTimeout:0,maxRetries:0,signal:o.signal}).then(e=>{t||i!==s.current||r.current&&(r.current.innerHTML=e,a(!1))}).catch(async n=>{if(t||i!==s.current)return;if(!r.current)return;const o=(null==n?void 0:n.code)||(null==n?void 0:n.name);if("WORKER_INIT_ERROR"===o||(null==n?void 0:n.fallbackToRenderer)||o===mn||"WORKER_TIMEOUT"===o){const n=await Mn();if(n)try{const o=n.renderToString(l,{throwOnError:e.loading,displayMode:!1});return void(!t&&i===s.current&&r.current&&(r.current.innerHTML=o,a(!1),pn(l,!1,o)))}catch{}}e.loading||(r.current.textContent=e.raw,a(!1))}),()=>{t=!0,o.abort()}):(a(!1),()=>o.abort())},[e.content,e.loading,e.raw]),/* @__PURE__ */M.jsxs("span",{ref:n,className:"math-inline-wrapper",children:[
61
+ /* @__PURE__ */M.jsx("span",{className:"underline-anim","aria-hidden":"true"})]})}):/* @__PURE__ */M.jsx("a",{className:"link-node",href:s.href,title:m?"":f,"aria-label":`Link: ${f}`,target:"_blank",rel:"noopener noreferrer",style:p,onMouseEnter:g,onMouseLeave:v,children:c&&d?S(s.children,c,String(null!=u?u:"link"),d):null!=(l=s.text)?l:null})}function bt(e){const{node:t,ctx:n,renderNode:r,value:o,indexKey:i,children:l}=e,a=null==o?void 0:o;/* @__PURE__ */
62
+ return M.jsx("li",{className:"list-item pl-1.5 my-2",dir:"auto",value:a,children:null!=l?l:n&&r?S(t.children,n,String(null!=i?i:"list-item"),r):null})}function kt(e){var t;const{node:n,ctx:r,renderNode:o,indexKey:i}=e,l=n.ordered?"ol":"ul",a=n.ordered&&n.start?n.start:void 0;/* @__PURE__ */
63
+ return M.jsx(l,{className:ze("list-node my-5 pl-[calc(13/8*1em)]",n.ordered?"list-decimal":"list-disc max-lg:my-[calc(4/3*1em)] max-lg:pl-[calc(14/9*1em)]"),start:a,children:null==(t=n.items)?void 0:t.map((e,t)=>{var l;/* @__PURE__ */
64
+ return M.jsx(bt,{node:e,value:n.ordered?(null!=(l=n.start)?l:1)+t:void 0,ctx:r,renderNode:o,indexKey:`${String(null!=i?i:"list")}-${t}`},`${String(null!=i?i:"list")}-${t}`)})})}let jt=null,Mt=null,Nt=!1;const Ct=/* @__PURE__ */new Map,St=/* @__PURE__ */new Map;let Bt=5;const Et=/* @__PURE__ */new Set;function _t(){if(Ct.size<Bt&&Et.size){const e=Array.from(Et);Et.clear();for(const t of e)try{t()}catch{}}}function Tt(e){jt=e,Mt=null,jt.onmessage=e=>{const{id:t,html:n,error:r}=e.data,o=Ct.get(t);if(o)if(Ct.delete(t),clearTimeout(o.timeoutId),_t(),r)o.reject(new Error(r));else{const{content:t,displayMode:r}=e.data;if(t){const e=`${r?"d":"i"}:${t}`;if(St.set(e,n),St.size>200){const e=St.keys().next().value;St.delete(e)}}o.resolve(n)}},jt.onerror=e=>{console.error("[katexWorkerClient] Worker error:",e);for(const[t,n]of Ct.entries())clearTimeout(n.timeoutId),n.reject(new Error(`Worker error: ${e.message}`));Ct.clear(),_t()}}function Lt(){var e;jt&&(null==(e=jt.terminate)||e.call(jt)),jt=null,Mt=null}function $t(e){Nt=!!e,jt&&jt.postMessage({type:"init",debug:Nt})}const Ot="WORKER_BUSY";async function Pt(e,t=!0,n=2e3,r){if(performance.now(),Mt)return Promise.reject(Mt);const o=`${t?"d":"i"}:${e}`,i=St.get(o);if(i)return Promise.resolve(i);const l=jt||(Mt=new Error("[katexWorkerClient] No worker instance set. Please inject a Worker via setKaTeXWorker()."),Mt.name="WORKER_INIT_ERROR",Mt.code="WORKER_INIT_ERROR",null);if(!l)return Promise.reject(Mt);if(Ct.size>=Bt){const e=new Error("Worker busy");return e.name="WorkerBusy",e.code=Ot,e.busy=!0,e.inFlight=Ct.size,e.max=Bt,Promise.reject(e)}return new Promise((o,i)=>{if(null==r?void 0:r.aborted){const e=new Error("Aborted");return e.name="AbortError",void i(e)}const a=Math.random().toString(36).slice(2),s=setTimeout(()=>{Ct.delete(a);const e=new Error("Worker render timed out");e.name="WorkerTimeout",e.code="WORKER_TIMEOUT",i(e),_t()},n),c=()=>{},d=()=>{Ct.delete(a),clearTimeout(s),Et.delete(c);const e=new Error("Aborted");e.name="AbortError",i(e),_t()};r&&r.addEventListener("abort",d,{once:!0}),Ct.set(a,{resolve:e=>{r&&r.removeEventListener("abort",d),o(e)},reject:e=>{r&&r.removeEventListener("abort",d),i(e)},timeoutId:s});try{l.postMessage({id:a,content:e,displayMode:t,debug:Nt})}catch(u){Ct.delete(a),clearTimeout(s),r&&r.removeEventListener("abort",d),i(u),_t()}})}function Rt(e,t,n){const r=`${t?"d":"i"}:${e}`;if(St.set(r,n),St.size>200){const e=St.keys().next().value;St.delete(e)}}function Dt(){St.clear()}function Wt(e){Bt=Math.max(1,Math.floor(e)),_t()}function At(e=1500,t){return Ct.size<Bt?Promise.resolve():new Promise((n,r)=>{if(null==t?void 0:t.aborted){const e=new Error("Aborted");return e.name="AbortError",void r(e)}let o=null;function i(){Et.delete(l),null!=o&&clearTimeout(o),t&&t.removeEventListener("abort",a)}function l(){i(),n()}function a(){i();const e=new Error("Aborted");e.name="AbortError",r(e)}o=e>0?setTimeout(()=>{i(),r(new Error("Timeout waiting for worker slot"))},e):null,t&&t.addEventListener("abort",a,{once:!0}),Et.add(l)})}const It={timeout:2e3,waitTimeout:1500,backoffMs:30,maxRetries:1};function Ft(e){null!=e.timeout&&(It.timeout=Math.max(0,Math.floor(e.timeout))),null!=e.waitTimeout&&(It.waitTimeout=Math.max(0,Math.floor(e.waitTimeout))),null!=e.backoffMs&&(It.backoffMs=Math.max(0,Math.floor(e.backoffMs))),null!=e.maxRetries&&(It.maxRetries=Math.max(0,Math.floor(e.maxRetries)))}function zt(){return{...It}}async function Ht(e,t=!0,n={}){var r,o,i,l;const a=null!=(r=n.timeout)?r:It.timeout,s=null!=(o=n.waitTimeout)?o:It.waitTimeout,c=null!=(i=n.backoffMs)?i:It.backoffMs,d=null!=(l=n.maxRetries)?l:It.maxRetries,u=n.signal;let m=0;for(;;){if(null==u?void 0:u.aborted){const e=new Error("Aborted");throw e.name="AbortError",e}try{return await Pt(e,t,a,u)}catch(h){if((null==h?void 0:h.code)!==Ot||m>=d)throw h;if(m++,await At(s,u).catch(()=>{}),null==u?void 0:u.aborted){const e=new Error("Aborted");throw e.name="AbortError",e}c>0&&await new Promise(e=>setTimeout(e,c*m))}}}let Vt=null,Kt=!1;async function Xt(){if(Vt)return Vt;if(Kt)return null;try{return Vt=await import("katex"),await import("katex/contrib/mhchem"),Vt}catch{return Kt=!0,null}}function qt({node:e}){const t=i(null),[r,o]=n(!0),a=i(0);return l(()=>{var n;let r=!1;const i=new AbortController,l=++a.current,s=null!=(n=e.content)?n:"";return s?(Ht(s,!0,{timeout:3e3,waitTimeout:2e3,maxRetries:1,signal:i.signal}).then(e=>{r||l!==a.current||(t.current&&(t.current.innerHTML=e),o(!1))}).catch(async n=>{if(r||l!==a.current)return;if(!t.current)return;const i=(null==n?void 0:n.code)||(null==n?void 0:n.name);if("WORKER_INIT_ERROR"===i||(null==n?void 0:n.fallbackToRenderer)||i===Ot||"WORKER_TIMEOUT"===i){const n=await Xt();if(n)try{const i=n.renderToString(s,{throwOnError:e.loading,displayMode:!0});return void(!r&&l===a.current&&t.current&&(t.current.innerHTML=i,o(!1),Rt(s,!0,i)))}catch{}}e.loading||(t.current.textContent=e.raw,o(!1))}),()=>{r=!0,i.abort()}):(o(!1),()=>i.abort())},[e.content,e.loading,e.raw]),/* @__PURE__ */M.jsx("div",{className:"math-block text-center overflow-x-auto relative min-h-[40px]",children:/* @__PURE__ */M.jsx("div",{ref:t,className:r?"math-rendering":void 0})})}function Ut({node:e}){const t=i(null),r=i(null),[o,a]=n(!0),s=i(0);return l(()=>{var t;let n=!1;const o=new AbortController,i=++s.current,l=null!=(t=e.content)?t:"";return l?(Ht(l,!1,{timeout:1500,waitTimeout:0,maxRetries:0,signal:o.signal}).then(e=>{n||i!==s.current||r.current&&(r.current.innerHTML=e,a(!1))}).catch(async t=>{if(n||i!==s.current)return;if(!r.current)return;const o=(null==t?void 0:t.code)||(null==t?void 0:t.name);if("WORKER_INIT_ERROR"===o||(null==t?void 0:t.fallbackToRenderer)||o===Ot||"WORKER_TIMEOUT"===o){const t=await Xt();if(t)try{const o=t.renderToString(l,{throwOnError:e.loading,displayMode:!1});return void(!n&&i===s.current&&r.current&&(r.current.innerHTML=o,a(!1),Rt(l,!1,o)))}catch{}}e.loading||(r.current.textContent=e.raw,a(!1))}),()=>{n=!0,o.abort()}):(a(!1),()=>o.abort())},[e.content,e.loading,e.raw]),/* @__PURE__ */M.jsxs("span",{ref:t,className:"math-inline-wrapper",children:[
65
65
  /* @__PURE__ */M.jsx("span",{ref:r,className:"math-inline"+(o?" math-inline--hidden":"")}),o&&/* @__PURE__ */M.jsxs("span",{className:"math-inline__loading",role:"status","aria-live":"polite",children:[
66
66
  /* @__PURE__ */M.jsx("span",{className:"math-inline__spinner","aria-hidden":"true"}),
67
- /* @__PURE__ */M.jsx("span",{className:"sr-only",children:"Loading"})]})]})}let Sn=null,Bn=null;const En=/* @__PURE__ */new Map;let Tn=5,_n=!1;function Ln(e){_n=!!e}function $n(e){Number.isFinite(e)&&e>0&&(Tn=Math.floor(e))}function Pn(){return{inFlight:En.size,max:Tn}}const Rn="WORKER_BUSY";function Dn(e){Sn=e,Bn=null;const n=e;Sn.onmessage=e=>{if(Sn!==n)return;const{id:t,ok:r,result:o,error:i}=e.data,l=En.get(t);l&&(!1===r||i?l.reject(new Error(i||"Unknown error")):l.resolve(o))},Sn.onerror=e=>{var t,r;if(Sn===n)if(0!==En.size){try{_n?console.error("[mermaidWorkerClient] Worker error:",(null==e?void 0:e.message)||e):null==(r=console.debug)||r.call(console,"[mermaidWorkerClient] Worker error:",(null==e?void 0:e.message)||e)}catch{}for(const[n,t]of En.entries())t.reject(new Error(`Worker error: ${e.message}`));En.clear()}else null==(t=console.debug)||t.call(console,"[mermaidWorkerClient] Worker error (no pending):",(null==e?void 0:e.message)||e)},Sn.onmessageerror=e=>{var t,r;if(Sn===n)if(0!==En.size){try{_n?console.error("[mermaidWorkerClient] Worker messageerror:",e):null==(r=console.debug)||r.call(console,"[mermaidWorkerClient] Worker messageerror:",e)}catch{}for(const[e,n]of En.entries())n.reject(new Error("Worker messageerror"));En.clear()}else null==(t=console.debug)||t.call(console,"[mermaidWorkerClient] Worker messageerror (no pending):",e)}}function On(){var e;if(Sn)try{for(const[e,n]of En.entries())n.reject(new Error("Worker cleared"));En.clear(),null==(e=Sn.terminate)||e.call(Sn)}catch{}Sn=null,Bn=null}function An(e,n,t=1400){if(Bn)return Promise.reject(Bn);const r=Sn||(Bn=new Error("[mermaidWorkerClient] No worker instance set. Please inject a Worker via setMermaidWorker()."),Bn.name="WORKER_INIT_ERROR",Bn.code="WORKER_INIT_ERROR",null);if(!r)return Promise.reject(Bn);if(En.size>=Tn){const e=new Error("Worker busy");return e.name="WorkerBusy",e.code=Rn,e.inFlight=En.size,e.max=Tn,Promise.reject(e)}return new Promise((o,i)=>{const l=Math.random().toString(36).slice(2);let a=!1,s=null;const c=()=>{a||(a=!0,null!=s&&clearTimeout(s),En.delete(l))},d={resolve:e=>{c(),o(e)},reject:e=>{c(),i(e)}};En.set(l,d);try{r.postMessage({id:l,action:e,payload:n})}catch(u){return En.delete(l),void i(u)}s=setTimeout(()=>{const e=new Error("Worker call timed out");e.name="WorkerTimeout",e.code="WORKER_TIMEOUT";const n=En.get(l);null==n||n.reject(e)},t)})}async function Wn(e,n,t=1400){return An("canParse",{code:e,theme:n},t)}async function In(e,n,t=2400){return An("findPrefix",{code:e,theme:n},t)}function Fn(){var e;null==(e=null==Sn?void 0:Sn.terminate)||e.call(Sn),Sn=null,Bn=null,En.clear()}let zn=null,Hn=!1,Vn=null,Kn=null;function Xn(e,n){var t;if(!e||!n)return;const r=function(e){var n,t;return`${String(null!=(n=null==e?void 0:e.securityLevel)?n:"loose")}|htmlLabels:${!1===(null==(t=null==e?void 0:e.flowchart)?void 0:t.htmlLabels)?"0":"1"}`}(n);if(Vn!==r)try{"function"==typeof e.initialize?e.initialize(n):(null==(t=e.mermaidAPI)?void 0:t.initialize)&&e.mermaidAPI.initialize(n),Vn=r}catch{}}const Un="undefined"!=typeof window?s:l,qn={USE_PROFILES:{svg:!0},FORBID_TAGS:["script"],FORBID_ATTR:[/^on/i],ADD_TAGS:["style"],ADD_ATTR:["style"],SAFE_FOR_TEMPLATES:!0},Yn=[/javascript:/i,/expression\s*\(/i,/url\s*\(\s*javascript:/i,/@import/i],Zn=/^(?:https?:|mailto:|tel:|#|\/|data:image\/(?:png|gif|jpe?g|webp);)/i;function Jn(e){if(!e)return"";const n=e.trim();return Zn.test(n)?n:""}function Gn(e){if(e)try{e.replaceChildren()}catch{e.innerHTML=""}}function Qn(e,n,t){if(!e)return"";if(t)return function(e,n){if(!e)return"";Gn(e);const t=function(e){if("undefined"==typeof window||"undefined"==typeof DOMParser)return null;if(!e)return null;const n=e.replace(/["']\s*javascript:/gi,"#").replace(/\bjavascript:/gi,"#").replace(/["']\s*vbscript:/gi,"#").replace(/\bvbscript:/gi,"#").replace(/\bdata:text\/html/gi,"#"),t=(new DOMParser).parseFromString(n,"image/svg+xml").documentElement;if(!t||"svg"!==t.nodeName.toLowerCase())return null;const r=t;return function(e){const n=/* @__PURE__ */new Set(["script"]),t=[e,...Array.from(e.querySelectorAll("*"))];for(const r of t){if(n.has(r.tagName.toLowerCase())){r.remove();continue}const e=Array.from(r.attributes);for(const n of e){const e=n.name;if(/^on/i.test(e))r.removeAttribute(e);else{if("style"===e&&n.value){const t=n.value;if(Yn.some(e=>e.test(t))){r.removeAttribute(e);continue}}if(("href"===e||"xlink:href"===e)&&n.value){const t=Jn(n.value);if(!t){r.removeAttribute(e);continue}t!==n.value&&r.setAttribute(e,t)}}}}}(r),r}(n);return t?(e.appendChild(t),e.innerHTML):""}(e,n);if(Gn(e),n)try{e.insertAdjacentHTML("afterbegin",n)}catch{e.innerHTML=n}return e.innerHTML}const et={maxHeight:"500px",loading:!0,workerTimeoutMs:1400,parseTimeoutMs:1800,renderTimeoutMs:2500,fullRenderTimeoutMs:4e3,showHeader:!0,showModeToggle:!0,showCopyButton:!0,showExportButton:!0,showFullscreenButton:!0,showCollapseButton:!0,showZoomControls:!0,enableWheelZoom:!1,isStrict:!1};function nt(e){var r,o,s,c,d,u,m,h,p;const f={...et,...e},{t:g}=Y(),w=n(()=>ue("mermaid"),[]),x=null!=(o=null==(r=f.node)?void 0:r.code)?o:"",y=n(()=>x.replace(/\]::([^:])/g,"]:::$1").replace(/:::subgraphNode$/gm,"::subgraphNode"),[x]),k=null!=(s=f.workerTimeoutMs)?s:et.workerTimeoutMs,b=null!=(c=f.parseTimeoutMs)?c:et.parseTimeoutMs,j=null!=(d=f.renderTimeoutMs)?d:et.renderTimeoutMs,N=null!=(u=f.fullRenderTimeoutMs)?u:et.fullRenderTimeoutMs,[C,S]=t(!1),[B,E]=t(!1),[T,_]=t(!1),[L,$]=t(!1),[P,D]=t(1),[O,A]=t({x:0,y:0}),[W,I]=t(!1),[F,z]=t(!1),[H,V]=t(!1),[K,X]=t(null),[U,q]=t(!1),[Z,J]=t(()=>null==f.maxHeight?"360px":f.maxHeight),[G,Q]=t("undefined"==typeof window),ee=i(null),ne=i(null),te=i(null),re=i(null),le=i(null),ae=i(null),se=i(null),ce=i({x:0,y:0}),de=i(0),me=i({}),he=i(""),pe=i(!1),fe=i(null),ge=i(!1),ve=i({zoom:1,translateX:0,translateY:0,containerHeight:Z||"360px"}),we=R(),xe=Boolean(null!=(h=null==(m=f.node)?void 0:m.loading)?h:f.loading),ye=f.isDark?"dark":"light",ke=Boolean(f.isStrict),be=n(()=>ke?{startOnLoad:!1,securityLevel:"strict",dompurifyConfig:qn,flowchart:{htmlLabels:!1}}:{startOnLoad:!1,securityLevel:"loose"},[ke]);l(()=>{ge.current=H},[H]),l(()=>{me.current={}},[ye,y,ke]),l(()=>{let e=!1;return(async()=>{const n=await async function(e){if(zn)return Xn(zn,e),zn;if(Kn){const n=await Kn;return n&&Xn(n,e),n}if(Hn)return null;try{Hn=!0,Kn=(async()=>{try{const n=await import("mermaid"),t=(null==n?void 0:n.default)||n;if(zn=(null==t?void 0:t.default)?t.default:(null==t?void 0:t.mermaidAPI)?t:(null==t?void 0:t.mermaid)?t.mermaid:t,!zn)throw new Error("Mermaid module did not export expected API");return Xn(zn,null!=e?e:{startOnLoad:!1,securityLevel:"loose"}),zn}catch(n){return console.warn("[markstream-react] Failed to load mermaid:",n),null}finally{Kn=null}})();const n=await Kn;return n&&Xn(n,e),n}catch{return null}}(be);e||(ee.current=n,S(Boolean(n)),pe.current||E(!n))})(),()=>{e=!0}},[be]),l(()=>{const e=ne.current;if(!e)return;const n=we(e,{rootMargin:"400px"});return fe.current=n,n.isVisible()&&Q(!0),n.whenVisible.then(()=>Q(!0)),()=>{n.destroy(),fe.current=null}},[we]),l(()=>{if("undefined"==typeof document)return;if(!U)return;const e=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=e}},[U]);const je=a(e=>{const n=ne.current,t=re.current;if(!n||!t)return;const r=t.querySelector("svg");if(!r)return;let o=0,i=0;const l=r.getAttribute("viewBox");if(l){const e=l.split(" ");4===e.length&&(o=Number.parseFloat(e[2]),i=Number.parseFloat(e[3]))}if(o&&i||!r.hasAttribute("width")||!r.hasAttribute("height")||(o=Number.parseFloat(r.getAttribute("width")||"0"),i=Number.parseFloat(r.getAttribute("height")||"0")),!o||!i||Number.isNaN(o)||Number.isNaN(i))try{const e=r.getBBox();o=e.width,i=e.height}catch{return}if(!(o>0&&i>0))return;const a=(null!=e?e:n.clientWidth)*(i/o),s=Number.isFinite(a)&&a>0?a:i;J(`${Math.min(s,i)}px`)},[]);l(()=>{if(!ne.current||"undefined"==typeof ResizeObserver)return;const e=new ResizeObserver(e=>{if(!e.length)return;const n=e[0].contentRect.width;!function(e){try{if("undefined"!=typeof globalThis&&"function"==typeof globalThis.requestAnimationFrame)return globalThis.requestAnimationFrame(e)}catch{}globalThis.setTimeout(e,0)}(()=>je(n))});return e.observe(ne.current),()=>e.disconnect()},[je]),l(()=>()=>{Fn()},[]);const Me=a(async(e,n,t)=>{var r;if(!ee.current||!re.current)return!1;z(!0);try{const o=`mermaid-${Date.now()}-${Math.random().toString(36).slice(2,9)}`,i=rt(e,n),l=await it(()=>ee.current.render(o,i),{timeoutMs:N,signal:t});if(!(null==l?void 0:l.svg))return!1;const a=Qn(re.current,l.svg,ke);return null==(r=l.bindFunctions)||r.call(l,re.current),je(),me.current[n]=a,V(!0),X(null),!0}catch(o){return xe||X(o instanceof Error?o.message:String(o)),!1}finally{z(!1)}},[N,xe,ke,je]),Ne=a(async(e,n,t)=>{var r;if(ee.current&&re.current){z(!0);try{const o=`mermaid-preview-${Date.now()}-${Math.random().toString(36).slice(2,9)}`,i=rt(ot(e)||e,n),l=await it(()=>ee.current.render(o,i),{timeoutMs:j,signal:t});(null==l?void 0:l.svg)&&(Qn(re.current,l.svg,ke),null==(r=l.bindFunctions)||r.call(l,re.current),je())}catch{}finally{z(!1)}}},[j,xe,ke,je]),Ce=a(async(e,n)=>{if(!e.trim())return Gn(re.current),V(!1),void(he.current="");const t=e.replace(/\s+/g,"");if(t===he.current&&ge.current)return;const r=++de.current;try{if(await async function(e,n,t){try{if(await Wn(e,n,t.workerTimeout))return!0}catch(l){if("AbortError"===(null==l?void 0:l.name))throw l}if(!t.mermaid)throw new Error("Mermaid not available");const r=rt(e,n),o=t.mermaid;if("function"==typeof o.parse)return await it(()=>o.parse(r),{timeoutMs:t.parseTimeout,signal:t.signal}),!0;const i=`mermaid-parse-${Math.random().toString(36).slice(2,9)}`;return await it(()=>o.render(i,r),{timeoutMs:t.parseTimeout,signal:t.signal}),!0}(e,ye,{workerTimeout:k,parseTimeout:b,mermaid:ee.current,signal:n}),(null==n?void 0:n.aborted)||de.current!==r)return;return void(await Me(e,ye,n)&&(he.current=t))}catch(o){if("AbortError"===(null==o?void 0:o.name))return}try{const t=await async function(e,n,t){try{const r=await In(e,n,t.workerTimeout);if(r)return r}catch(o){if("AbortError"===(null==o?void 0:o.name))throw o}return ot(e)}(e,ye,{workerTimeout:k,signal:n});if(!t||(null==n?void 0:n.aborted)||de.current!==r)return;await Ne(t,ye,n)}catch{}},[b,Me,Ne,ye,k]);l(()=>{if(!G||B||T)return;const e=new AbortController;return Ce(y,e.signal),()=>e.abort()},[y,T,Ce,B,G]);const Se=a((e,n)=>{e.clientX,e.clientY,oe(e.currentTarget,n,"top",!1,0,f.isDark)},[f.isDark]),Be=a(async()=>{var e,n;try{await(null==(e=navigator.clipboard)?void 0:e.writeText(y)),$(!0),null==(n=f.onCopy)||n.call(f,y),setTimeout(()=>$(!1),1e3)}catch{}},[y,f]),Ee=a(()=>{var e,n,t;const r=null!=(n=null==(e=re.current)?void 0:e.querySelector("svg"))?n:null;if(!r)return;const o=lt(r),i={payload:{type:"export"},defaultPrevented:!1,preventDefault(){this.defaultPrevented=!0},svgElement:r,svgString:o};null==(t=f.onExport)||t.call(f,i),i.defaultPrevented||function(e,n){const t=null!=n?n:lt(e),r=new Blob([t],{type:"image/svg+xml;charset=utf-8"}),o=URL.createObjectURL(r),i=document.createElement("a");i.href=o,i.download=`mermaid-${Date.now()}.svg`,document.body.appendChild(i),i.click(),document.body.removeChild(i),URL.revokeObjectURL(o)}(r,o)},[f]),Te=a(()=>{se.current=null,Gn(ae.current)},[]),_e=a(()=>{q(!1),Te()},[Te]),Le=a(()=>{var e,n,t;const r=null!=(n=null==(e=re.current)?void 0:e.querySelector("svg"))?n:null,o=r?lt(r):null,i={payload:{type:"open-modal"},defaultPrevented:!1,preventDefault(){this.defaultPrevented=!0},svgElement:r,svgString:o};null==(t=f.onOpenModal)||t.call(f,i),i.defaultPrevented||q(!0)},[f]);l(()=>{if(!U)return;if("undefined"==typeof window)return;const e=e=>{"Escape"===e.key&&_e()};try{window.addEventListener("keydown",e)}catch{}return()=>{try{window.removeEventListener("keydown",e)}catch{}}},[_e,U]),Un(()=>{if(!U)return;const e=ae.current,n=ne.current;if(!e||!n)return;const t=`translate(${O.x}px, ${O.y}px) scale(${P})`,r=n.cloneNode(!0);r.classList.add("fullscreen");const o=r.querySelector("[data-mermaid-wrapper]");o&&(se.current=o,o.style.transform=t),Gn(e),e.appendChild(r)},[U]),l(()=>{U&&se.current&&(se.current.style.transform=`translate(${O.x}px, ${O.y}px) scale(${P})`)},[U,O.x,O.y,P]);const $e=B||F||T,Pe=n(()=>f.isDark?"mermaid-action-btn p-2 text-xs rounded text-gray-400 hover:bg-gray-700 hover:text-gray-200":"mermaid-action-btn p-2 text-xs rounded text-gray-600 hover:bg-gray-200 hover:text-gray-700",[f.isDark]),Re=a(e=>{var n;const t={payload:{type:"toggle-mode",target:e},defaultPrevented:!1,preventDefault(){this.defaultPrevented=!0}};if(null==(n=f.onToggleMode)||n.call(f,e,t),!t.defaultPrevented)if(pe.current=!0,"preview"===e){E(!1);const e=ve.current;D(e.zoom),A({x:e.translateX,y:e.translateY}),J(e.containerHeight),ge.current&&me.current[ye]&&re.current?(re.current.innerHTML=me.current[ye],je()):Ce(y)}else ve.current={zoom:P,translateX:O.x,translateY:O.y,containerHeight:Z},E(!0)},[y,Z,Ce,f,ye,O.x,O.y,je,P]),De=a(e=>{if(!1===f.enableWheelZoom)return;if(!e.ctrlKey&&!e.metaKey)return;e.preventDefault();const n=ne.current;if(!n)return;const t=n.getBoundingClientRect(),r=e.clientX-t.left-O.x,o=e.clientY-t.top-O.y,i=.01*-e.deltaY,l=tt(P+i,.5,3);if(l===P)return;const a=l/P;A({x:O.x-r*(a-1),y:O.y-o*(a-1)}),D(l)},[O,P]),Oe=a((e,n)=>{I(!0),ce.current={x:e-O.x,y:n-O.y}},[O.x,O.y]),Ae=a((e,n)=>{W&&A({x:e-ce.current.x,y:n-ce.current.y})},[W]),We=a(()=>{I(!1)},[]),Ie=/* @__PURE__ */M.jsxs("div",{className:"relative",children:[f.showZoomControls&&/* @__PURE__ */M.jsx("div",{className:"absolute top-2 right-2 z-10 rounded-lg",children:/* @__PURE__ */M.jsxs("div",{className:"flex items-center gap-2 backdrop-blur rounded-lg",children:[
68
- /* @__PURE__ */M.jsx("button",{type:"button",className:ze("p-2 text-xs rounded transition-colors",f.isDark?"text-gray-400 hover:bg-gray-700":"text-gray-600 hover:bg-gray-200"),onMouseEnter:e=>Se(e,g("common.zoomIn")),onMouseLeave:()=>ie(),onClick:()=>D(tt(P+.1,.5,3)),children:"+"}),
69
- /* @__PURE__ */M.jsx("button",{type:"button",className:ze("p-2 text-xs rounded transition-colors",f.isDark?"text-gray-400 hover:bg-gray-700":"text-gray-600 hover:bg-gray-200"),onMouseEnter:e=>Se(e,g("common.zoomOut")),onMouseLeave:()=>ie(),onClick:()=>D(tt(P-.1,.5,3)),children:"−"}),
70
- /* @__PURE__ */M.jsxs("button",{type:"button",className:ze("p-2 text-xs rounded transition-colors",f.isDark?"text-gray-400 hover:bg-gray-700":"text-gray-600 hover:bg-gray-200"),onMouseEnter:e=>Se(e,g("common.resetZoom")),onMouseLeave:()=>ie(),onClick:()=>{D(1),A({x:0,y:0})},children:[Math.round(100*P),"%"]})]})}),
71
- /* @__PURE__ */M.jsxs("div",{ref:ne,className:ze("min-h-[360px] relative transition-all duration-100 overflow-hidden block",f.isDark?"bg-gray-900":"bg-gray-50"),style:{height:Z,maxHeight:null!=(p=f.maxHeight)?p:void 0},onWheel:De,onMouseDown:e=>{0===e.button&&(e.preventDefault(),Oe(e.clientX,e.clientY))},onMouseMove:e=>Ae(e.clientX,e.clientY),onMouseUp:We,onMouseLeave:We,onTouchStart:e=>{const n=e.touches[0];n&&Oe(n.clientX,n.clientY)},onTouchMove:e=>{const n=e.touches[0];n&&Ae(n.clientX,n.clientY)},onTouchEnd:We,children:[
72
- /* @__PURE__ */M.jsx("div",{ref:te,"data-mermaid-wrapper":!0,className:ze("absolute inset-0 cursor-grab",{"cursor-grabbing":W}),style:{transform:`translate(${O.x}px, ${O.y}px) scale(${P})`},children:/* @__PURE__ */M.jsx("div",{ref:re,className:"_mermaid w-full text-center flex items-center justify-center min-h-full"})}),(F||xe)&&/* @__PURE__ */M.jsxs("div",{className:"mermaid-loading",children:[
67
+ /* @__PURE__ */M.jsx("span",{className:"sr-only",children:"Loading"})]})]})}let Yt=null,Zt=null;const Jt=/* @__PURE__ */new Map;let Gt=5,Qt=!1;function en(e){Qt=!!e}function tn(e){Number.isFinite(e)&&e>0&&(Gt=Math.floor(e))}function nn(){return{inFlight:Jt.size,max:Gt}}const rn="WORKER_BUSY";function on(e){Yt=e,Zt=null;const t=e;Yt.onmessage=e=>{if(Yt!==t)return;const{id:n,ok:r,result:o,error:i}=e.data,l=Jt.get(n);l&&(!1===r||i?l.reject(new Error(i||"Unknown error")):l.resolve(o))},Yt.onerror=e=>{var n,r;if(Yt===t)if(0!==Jt.size){try{Qt?console.error("[mermaidWorkerClient] Worker error:",(null==e?void 0:e.message)||e):null==(r=console.debug)||r.call(console,"[mermaidWorkerClient] Worker error:",(null==e?void 0:e.message)||e)}catch{}for(const[t,n]of Jt.entries())n.reject(new Error(`Worker error: ${e.message}`));Jt.clear()}else null==(n=console.debug)||n.call(console,"[mermaidWorkerClient] Worker error (no pending):",(null==e?void 0:e.message)||e)},Yt.onmessageerror=e=>{var n,r;if(Yt===t)if(0!==Jt.size){try{Qt?console.error("[mermaidWorkerClient] Worker messageerror:",e):null==(r=console.debug)||r.call(console,"[mermaidWorkerClient] Worker messageerror:",e)}catch{}for(const[e,t]of Jt.entries())t.reject(new Error("Worker messageerror"));Jt.clear()}else null==(n=console.debug)||n.call(console,"[mermaidWorkerClient] Worker messageerror (no pending):",e)}}function ln(){var e;if(Yt)try{for(const[e,t]of Jt.entries())t.reject(new Error("Worker cleared"));Jt.clear(),null==(e=Yt.terminate)||e.call(Yt)}catch{}Yt=null,Zt=null}function an(e,t,n=1400){if(Zt)return Promise.reject(Zt);const r=Yt||(Zt=new Error("[mermaidWorkerClient] No worker instance set. Please inject a Worker via setMermaidWorker()."),Zt.name="WORKER_INIT_ERROR",Zt.code="WORKER_INIT_ERROR",null);if(!r)return Promise.reject(Zt);if(Jt.size>=Gt){const e=new Error("Worker busy");return e.name="WorkerBusy",e.code=rn,e.inFlight=Jt.size,e.max=Gt,Promise.reject(e)}return new Promise((o,i)=>{const l=Math.random().toString(36).slice(2);let a=!1,s=null;const c=()=>{a||(a=!0,null!=s&&clearTimeout(s),Jt.delete(l))},d={resolve:e=>{c(),o(e)},reject:e=>{c(),i(e)}};Jt.set(l,d);try{r.postMessage({id:l,action:e,payload:t})}catch(u){return Jt.delete(l),void i(u)}s=setTimeout(()=>{const e=new Error("Worker call timed out");e.name="WorkerTimeout",e.code="WORKER_TIMEOUT";const t=Jt.get(l);null==t||t.reject(e)},n)})}async function sn(e,t,n=1400){return an("canParse",{code:e,theme:t},n)}async function cn(e,t,n=2400){return an("findPrefix",{code:e,theme:t},n)}function dn(){var e;null==(e=null==Yt?void 0:Yt.terminate)||e.call(Yt),Yt=null,Zt=null,Jt.clear()}let un=null,mn=!1,hn=null,pn=null;function fn(e,t){var n;if(!e||!t)return;const r=function(e){var t,n;return`${String(null!=(t=null==e?void 0:e.securityLevel)?t:"loose")}|htmlLabels:${!1===(null==(n=null==e?void 0:e.flowchart)?void 0:n.htmlLabels)?"0":"1"}`}(t);if(hn!==r)try{"function"==typeof e.initialize?e.initialize(t):(null==(n=e.mermaidAPI)?void 0:n.initialize)&&e.mermaidAPI.initialize(t),hn=r}catch{}}const gn="undefined"!=typeof window?c:l,vn={USE_PROFILES:{svg:!0},FORBID_TAGS:["script"],FORBID_ATTR:[/^on/i],ADD_TAGS:["style"],ADD_ATTR:["style"],SAFE_FOR_TEMPLATES:!0},wn=[/javascript:/i,/expression\s*\(/i,/url\s*\(\s*javascript:/i,/@import/i],xn=/^(?:https?:|mailto:|tel:|#|\/|data:image\/(?:png|gif|jpe?g|webp);)/i;function yn(e){if(!e)return"";const t=e.trim();return xn.test(t)?t:""}function bn(e){if(e)try{e.replaceChildren()}catch{e.innerHTML=""}}function kn(e,t,n){if(!e)return"";if(n)return function(e,t){if(!e)return"";bn(e);const n=function(e){if("undefined"==typeof window||"undefined"==typeof DOMParser)return null;if(!e)return null;const t=e.replace(/["']\s*javascript:/gi,"#").replace(/\bjavascript:/gi,"#").replace(/["']\s*vbscript:/gi,"#").replace(/\bvbscript:/gi,"#").replace(/\bdata:text\/html/gi,"#"),n=(new DOMParser).parseFromString(t,"image/svg+xml").documentElement;if(!n||"svg"!==n.nodeName.toLowerCase())return null;const r=n;return function(e){const t=/* @__PURE__ */new Set(["script"]),n=[e,...Array.from(e.querySelectorAll("*"))];for(const r of n){if(t.has(r.tagName.toLowerCase())){r.remove();continue}const e=Array.from(r.attributes);for(const t of e){const e=t.name;if(/^on/i.test(e))r.removeAttribute(e);else{if("style"===e&&t.value){const n=t.value;if(wn.some(e=>e.test(n))){r.removeAttribute(e);continue}}if(("href"===e||"xlink:href"===e)&&t.value){const n=yn(t.value);if(!n){r.removeAttribute(e);continue}n!==t.value&&r.setAttribute(e,n)}}}}}(r),r}(t);return n?(e.appendChild(n),e.innerHTML):""}(e,t);if(bn(e),t)try{e.insertAdjacentHTML("afterbegin",t)}catch{e.innerHTML=t}return e.innerHTML}const jn={maxHeight:"500px",loading:!0,workerTimeoutMs:1400,parseTimeoutMs:1800,renderTimeoutMs:2500,fullRenderTimeoutMs:4e3,showHeader:!0,showModeToggle:!0,showCopyButton:!0,showExportButton:!0,showFullscreenButton:!0,showCollapseButton:!0,showZoomControls:!0,enableWheelZoom:!1,isStrict:!1};function Mn(e){var r,o,s,c,d,u,m,h,p;const f={...jn,...e},{t:g}=Y(),w=t(()=>ue("mermaid"),[]),x=null!=(o=null==(r=f.node)?void 0:r.code)?o:"",y=t(()=>x.replace(/\]::([^:])/g,"]:::$1").replace(/:::subgraphNode$/gm,"::subgraphNode"),[x]),b=null!=(s=f.workerTimeoutMs)?s:jn.workerTimeoutMs,k=null!=(c=f.parseTimeoutMs)?c:jn.parseTimeoutMs,j=null!=(d=f.renderTimeoutMs)?d:jn.renderTimeoutMs,N=null!=(u=f.fullRenderTimeoutMs)?u:jn.fullRenderTimeoutMs,[C,S]=n(!1),[B,E]=n(!1),[_,T]=n(!1),[L,$]=n(!1),[O,R]=n(1),[D,W]=n({x:0,y:0}),[A,I]=n(!1),[F,z]=n(!1),[H,V]=n(!1),[K,X]=n(null),[q,U]=n(!1),[Z,J]=n(()=>null==f.maxHeight?"360px":f.maxHeight),[G,Q]=n("undefined"==typeof window),ee=i(null),te=i(null),ne=i(null),re=i(null),le=i(null),ae=i(null),se=i(null),ce=i({x:0,y:0}),de=i(0),me=i({}),he=i(""),pe=i(!1),fe=i(null),ge=i(!1),ve=i({zoom:1,translateX:0,translateY:0,containerHeight:Z||"360px"}),we=P(),xe=Boolean(null!=(h=null==(m=f.node)?void 0:m.loading)?h:f.loading),ye=f.isDark?"dark":"light",be=Boolean(f.isStrict),ke=t(()=>be?{startOnLoad:!1,securityLevel:"strict",dompurifyConfig:vn,flowchart:{htmlLabels:!1}}:{startOnLoad:!1,securityLevel:"loose"},[be]);l(()=>{ge.current=H},[H]),l(()=>{me.current={}},[ye,y,be]),l(()=>{let e=!1;return(async()=>{const t=await async function(e){if(un)return fn(un,e),un;if(pn){const t=await pn;return t&&fn(t,e),t}if(mn)return null;try{mn=!0,pn=(async()=>{try{const t=await import("mermaid"),n=(null==t?void 0:t.default)||t;if(un=(null==n?void 0:n.default)?n.default:(null==n?void 0:n.mermaidAPI)?n:(null==n?void 0:n.mermaid)?n.mermaid:n,!un)throw new Error("Mermaid module did not export expected API");return fn(un,null!=e?e:{startOnLoad:!1,securityLevel:"loose"}),un}catch(t){return console.warn("[markstream-react] Failed to load mermaid:",t),null}finally{pn=null}})();const t=await pn;return t&&fn(t,e),t}catch{return null}}(ke);e||(ee.current=t,S(Boolean(t)),pe.current||E(!t))})(),()=>{e=!0}},[ke]),l(()=>{const e=te.current;if(!e)return;const t=we(e,{rootMargin:"400px"});return fe.current=t,t.isVisible()&&Q(!0),t.whenVisible.then(()=>Q(!0)),()=>{t.destroy(),fe.current=null}},[we]),l(()=>{if("undefined"==typeof document)return;if(!q)return;const e=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=e}},[q]);const je=a(e=>{const t=te.current,n=re.current;if(!t||!n)return;const r=n.querySelector("svg");if(!r)return;let o=0,i=0;const l=r.getAttribute("viewBox");if(l){const e=l.split(" ");4===e.length&&(o=Number.parseFloat(e[2]),i=Number.parseFloat(e[3]))}if(o&&i||!r.hasAttribute("width")||!r.hasAttribute("height")||(o=Number.parseFloat(r.getAttribute("width")||"0"),i=Number.parseFloat(r.getAttribute("height")||"0")),!o||!i||Number.isNaN(o)||Number.isNaN(i))try{const e=r.getBBox();o=e.width,i=e.height}catch{return}if(!(o>0&&i>0))return;const a=(null!=e?e:t.clientWidth)*(i/o),s=Number.isFinite(a)&&a>0?a:i;J(`${Math.min(s,i)}px`)},[]);l(()=>{if(!te.current||"undefined"==typeof ResizeObserver)return;const e=new ResizeObserver(e=>{if(!e.length)return;const t=e[0].contentRect.width;!function(e){try{if("undefined"!=typeof globalThis&&"function"==typeof globalThis.requestAnimationFrame)return globalThis.requestAnimationFrame(e)}catch{}globalThis.setTimeout(e,0)}(()=>je(t))});return e.observe(te.current),()=>e.disconnect()},[je]),l(()=>()=>{dn()},[]);const Me=a(async(e,t,n)=>{var r;if(!ee.current||!re.current)return!1;z(!0);try{const o=`mermaid-${Date.now()}-${Math.random().toString(36).slice(2,9)}`,i=Cn(e,t),l=await Bn(()=>ee.current.render(o,i),{timeoutMs:N,signal:n});if(!(null==l?void 0:l.svg))return!1;const a=kn(re.current,l.svg,be);return null==(r=l.bindFunctions)||r.call(l,re.current),je(),me.current[t]=a,V(!0),X(null),!0}catch(o){return xe||X(o instanceof Error?o.message:String(o)),!1}finally{z(!1)}},[N,xe,be,je]),Ne=a(async(e,t,n)=>{var r;if(ee.current&&re.current){z(!0);try{const o=`mermaid-preview-${Date.now()}-${Math.random().toString(36).slice(2,9)}`,i=Cn(Sn(e)||e,t),l=await Bn(()=>ee.current.render(o,i),{timeoutMs:j,signal:n});(null==l?void 0:l.svg)&&(kn(re.current,l.svg,be),null==(r=l.bindFunctions)||r.call(l,re.current),je())}catch{}finally{z(!1)}}},[j,xe,be,je]),Ce=a(async(e,t)=>{if(!e.trim())return bn(re.current),V(!1),void(he.current="");const n=e.replace(/\s+/g,"");if(n===he.current&&ge.current)return;const r=++de.current;try{if(await async function(e,t,n){try{if(await sn(e,t,n.workerTimeout))return!0}catch(l){if("AbortError"===(null==l?void 0:l.name))throw l}if(!n.mermaid)throw new Error("Mermaid not available");const r=Cn(e,t),o=n.mermaid;if("function"==typeof o.parse)return await Bn(()=>o.parse(r),{timeoutMs:n.parseTimeout,signal:n.signal}),!0;const i=`mermaid-parse-${Math.random().toString(36).slice(2,9)}`;return await Bn(()=>o.render(i,r),{timeoutMs:n.parseTimeout,signal:n.signal}),!0}(e,ye,{workerTimeout:b,parseTimeout:k,mermaid:ee.current,signal:t}),(null==t?void 0:t.aborted)||de.current!==r)return;return void(await Me(e,ye,t)&&(he.current=n))}catch(o){if("AbortError"===(null==o?void 0:o.name))return}try{const n=await async function(e,t,n){try{const r=await cn(e,t,n.workerTimeout);if(r)return r}catch(o){if("AbortError"===(null==o?void 0:o.name))throw o}return Sn(e)}(e,ye,{workerTimeout:b,signal:t});if(!n||(null==t?void 0:t.aborted)||de.current!==r)return;await Ne(n,ye,t)}catch{}},[k,Me,Ne,ye,b]);l(()=>{if(!G||B||_)return;const e=new AbortController;return Ce(y,e.signal),()=>e.abort()},[y,_,Ce,B,G]);const Se=a((e,t)=>{e.clientX,e.clientY,oe(e.currentTarget,t,"top",!1,0,f.isDark)},[f.isDark]),Be=a(async()=>{var e,t;try{await(null==(e=navigator.clipboard)?void 0:e.writeText(y)),$(!0),null==(t=f.onCopy)||t.call(f,y),setTimeout(()=>$(!1),1e3)}catch{}},[y,f]),Ee=a(()=>{var e,t,n;const r=null!=(t=null==(e=re.current)?void 0:e.querySelector("svg"))?t:null;if(!r)return;const o=En(r),i={payload:{type:"export"},defaultPrevented:!1,preventDefault(){this.defaultPrevented=!0},svgElement:r,svgString:o};null==(n=f.onExport)||n.call(f,i),i.defaultPrevented||function(e,t){const n=null!=t?t:En(e),r=new Blob([n],{type:"image/svg+xml;charset=utf-8"}),o=URL.createObjectURL(r),i=document.createElement("a");i.href=o,i.download=`mermaid-${Date.now()}.svg`,document.body.appendChild(i),i.click(),document.body.removeChild(i),URL.revokeObjectURL(o)}(r,o)},[f]),_e=a(()=>{se.current=null,bn(ae.current)},[]),Te=a(()=>{U(!1),_e()},[_e]),Le=a(()=>{var e,t,n;const r=null!=(t=null==(e=re.current)?void 0:e.querySelector("svg"))?t:null,o=r?En(r):null,i={payload:{type:"open-modal"},defaultPrevented:!1,preventDefault(){this.defaultPrevented=!0},svgElement:r,svgString:o};null==(n=f.onOpenModal)||n.call(f,i),i.defaultPrevented||U(!0)},[f]);l(()=>{if(!q)return;if("undefined"==typeof window)return;const e=e=>{"Escape"===e.key&&Te()};try{window.addEventListener("keydown",e)}catch{}return()=>{try{window.removeEventListener("keydown",e)}catch{}}},[Te,q]),gn(()=>{if(!q)return;const e=ae.current,t=te.current;if(!e||!t)return;const n=`translate(${D.x}px, ${D.y}px) scale(${O})`,r=t.cloneNode(!0);r.classList.add("fullscreen");const o=r.querySelector("[data-mermaid-wrapper]");o&&(se.current=o,o.style.transform=n),bn(e),e.appendChild(r)},[q]),l(()=>{q&&se.current&&(se.current.style.transform=`translate(${D.x}px, ${D.y}px) scale(${O})`)},[q,D.x,D.y,O]);const $e=B||F||_,Oe=t(()=>f.isDark?"mermaid-action-btn p-2 text-xs rounded text-gray-400 hover:bg-gray-700 hover:text-gray-200":"mermaid-action-btn p-2 text-xs rounded text-gray-600 hover:bg-gray-200 hover:text-gray-700",[f.isDark]),Pe=a(e=>{var t;const n={payload:{type:"toggle-mode",target:e},defaultPrevented:!1,preventDefault(){this.defaultPrevented=!0}};if(null==(t=f.onToggleMode)||t.call(f,e,n),!n.defaultPrevented)if(pe.current=!0,"preview"===e){E(!1);const e=ve.current;R(e.zoom),W({x:e.translateX,y:e.translateY}),J(e.containerHeight),ge.current&&me.current[ye]&&re.current?(re.current.innerHTML=me.current[ye],je()):Ce(y)}else ve.current={zoom:O,translateX:D.x,translateY:D.y,containerHeight:Z},E(!0)},[y,Z,Ce,f,ye,D.x,D.y,je,O]),Re=a(e=>{if(!1===f.enableWheelZoom)return;if(!e.ctrlKey&&!e.metaKey)return;e.preventDefault();const t=te.current;if(!t)return;const n=t.getBoundingClientRect(),r=e.clientX-n.left-D.x,o=e.clientY-n.top-D.y,i=.01*-e.deltaY,l=Nn(O+i,.5,3);if(l===O)return;const a=l/O;W({x:D.x-r*(a-1),y:D.y-o*(a-1)}),R(l)},[D,O]),De=a((e,t)=>{I(!0),ce.current={x:e-D.x,y:t-D.y}},[D.x,D.y]),We=a((e,t)=>{A&&W({x:e-ce.current.x,y:t-ce.current.y})},[A]),Ae=a(()=>{I(!1)},[]),Ie=/* @__PURE__ */M.jsxs("div",{className:"relative",children:[f.showZoomControls&&/* @__PURE__ */M.jsx("div",{className:"absolute top-2 right-2 z-10 rounded-lg",children:/* @__PURE__ */M.jsxs("div",{className:"flex items-center gap-2 backdrop-blur rounded-lg",children:[
68
+ /* @__PURE__ */M.jsx("button",{type:"button",className:ze("p-2 text-xs rounded transition-colors",f.isDark?"text-gray-400 hover:bg-gray-700":"text-gray-600 hover:bg-gray-200"),onMouseEnter:e=>Se(e,g("common.zoomIn")),onMouseLeave:()=>ie(),onClick:()=>R(Nn(O+.1,.5,3)),children:"+"}),
69
+ /* @__PURE__ */M.jsx("button",{type:"button",className:ze("p-2 text-xs rounded transition-colors",f.isDark?"text-gray-400 hover:bg-gray-700":"text-gray-600 hover:bg-gray-200"),onMouseEnter:e=>Se(e,g("common.zoomOut")),onMouseLeave:()=>ie(),onClick:()=>R(Nn(O-.1,.5,3)),children:"−"}),
70
+ /* @__PURE__ */M.jsxs("button",{type:"button",className:ze("p-2 text-xs rounded transition-colors",f.isDark?"text-gray-400 hover:bg-gray-700":"text-gray-600 hover:bg-gray-200"),onMouseEnter:e=>Se(e,g("common.resetZoom")),onMouseLeave:()=>ie(),onClick:()=>{R(1),W({x:0,y:0})},children:[Math.round(100*O),"%"]})]})}),
71
+ /* @__PURE__ */M.jsxs("div",{ref:te,className:ze("min-h-[360px] relative transition-all duration-100 overflow-hidden block",f.isDark?"bg-gray-900":"bg-gray-50"),style:{height:Z,maxHeight:null!=(p=f.maxHeight)?p:void 0},onWheel:Re,onMouseDown:e=>{0===e.button&&(e.preventDefault(),De(e.clientX,e.clientY))},onMouseMove:e=>We(e.clientX,e.clientY),onMouseUp:Ae,onMouseLeave:Ae,onTouchStart:e=>{const t=e.touches[0];t&&De(t.clientX,t.clientY)},onTouchMove:e=>{const t=e.touches[0];t&&We(t.clientX,t.clientY)},onTouchEnd:Ae,children:[
72
+ /* @__PURE__ */M.jsx("div",{ref:ne,"data-mermaid-wrapper":!0,className:ze("absolute inset-0 cursor-grab",{"cursor-grabbing":A}),style:{transform:`translate(${D.x}px, ${D.y}px) scale(${O})`},children:/* @__PURE__ */M.jsx("div",{ref:re,className:"_mermaid w-full text-center flex items-center justify-center min-h-full"})}),(F||xe)&&/* @__PURE__ */M.jsxs("div",{className:"mermaid-loading",children:[
73
73
  /* @__PURE__ */M.jsx("span",{className:"mermaid-spinner"}),
74
74
  /* @__PURE__ */M.jsx("span",{children:"Rendering diagram…"})]})]})]}),Fe=f.showHeader&&/* @__PURE__ */M.jsxs("div",{className:ze("mermaid-block-header flex justify-between items-center px-4 py-2.5 border-b",f.isDark?"bg-gray-800 border-gray-700/30":"bg-gray-50 border-gray-200"),children:[
75
75
  /* @__PURE__ */M.jsxs("div",{className:"flex items-center space-x-2 overflow-hidden",children:[
76
76
  /* @__PURE__ */M.jsx("span",{className:"icon-slot h-4 w-4 flex-shrink-0",dangerouslySetInnerHTML:{__html:w}}),
77
77
  /* @__PURE__ */M.jsx("span",{className:ze("text-sm font-medium font-mono truncate",f.isDark?"text-gray-400":"text-gray-600"),children:"Mermaid"})]}),f.showModeToggle&&C&&/* @__PURE__ */M.jsxs("div",{className:ze("flex items-center space-x-1 rounded-md p-0.5",f.isDark?"bg-gray-700":"bg-gray-100"),children:[
78
- /* @__PURE__ */M.jsx("button",{type:"button",className:ze("px-2.5 py-1 text-xs rounded transition-colors",B?f.isDark?"text-gray-400 hover:text-gray-200":"text-gray-500 hover:text-gray-700":f.isDark?"bg-gray-600 text-gray-200 shadow-sm":"bg-white text-gray-700 shadow-sm"),onClick:()=>Re("preview"),onMouseEnter:e=>Se(e,g("common.preview")),onFocus:e=>Se(e,g("common.preview")),onMouseLeave:()=>ie(),onBlur:()=>ie(),children:/* @__PURE__ */M.jsxs("div",{className:"flex items-center space-x-1",children:[
78
+ /* @__PURE__ */M.jsx("button",{type:"button",className:ze("px-2.5 py-1 text-xs rounded transition-colors",B?f.isDark?"text-gray-400 hover:text-gray-200":"text-gray-500 hover:text-gray-700":f.isDark?"bg-gray-600 text-gray-200 shadow-sm":"bg-white text-gray-700 shadow-sm"),onClick:()=>Pe("preview"),onMouseEnter:e=>Se(e,g("common.preview")),onFocus:e=>Se(e,g("common.preview")),onMouseLeave:()=>ie(),onBlur:()=>ie(),children:/* @__PURE__ */M.jsxs("div",{className:"flex items-center space-x-1",children:[
79
79
  /* @__PURE__ */M.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink","aria-hidden":"true",role:"img",width:"1em",height:"1em",viewBox:"0 0 24 24",className:"w-3 h-3",children:/* @__PURE__ */M.jsxs("g",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",children:[
80
80
  /* @__PURE__ */M.jsx("path",{d:"M2.062 12.348a1 1 0 0 1 0-.696a10.75 10.75 0 0 1 19.876 0a1 1 0 0 1 0 .696a10.75 10.75 0 0 1-19.876 0"}),
81
81
  /* @__PURE__ */M.jsx("circle",{cx:"12",cy:"12",r:"3"})]})}),
82
82
  /* @__PURE__ */M.jsx("span",{children:g("common.preview")})]})}),
83
- /* @__PURE__ */M.jsx("button",{type:"button",className:ze("px-2.5 py-1 text-xs rounded transition-colors",B?f.isDark?"bg-gray-600 text-gray-200 shadow-sm":"bg-white text-gray-700 shadow-sm":f.isDark?"text-gray-400 hover:text-gray-200":"text-gray-500 hover:text-gray-700"),onClick:()=>Re("source"),onMouseEnter:e=>Se(e,g("common.source")),onFocus:e=>Se(e,g("common.source")),onMouseLeave:()=>ie(),onBlur:()=>ie(),children:/* @__PURE__ */M.jsxs("div",{className:"flex items-center space-x-1",children:[
83
+ /* @__PURE__ */M.jsx("button",{type:"button",className:ze("px-2.5 py-1 text-xs rounded transition-colors",B?f.isDark?"bg-gray-600 text-gray-200 shadow-sm":"bg-white text-gray-700 shadow-sm":f.isDark?"text-gray-400 hover:text-gray-200":"text-gray-500 hover:text-gray-700"),onClick:()=>Pe("source"),onMouseEnter:e=>Se(e,g("common.source")),onFocus:e=>Se(e,g("common.source")),onMouseLeave:()=>ie(),onBlur:()=>ie(),children:/* @__PURE__ */M.jsxs("div",{className:"flex items-center space-x-1",children:[
84
84
  /* @__PURE__ */M.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink","aria-hidden":"true",role:"img",width:"1em",height:"1em",viewBox:"0 0 24 24",className:"w-3 h-3",children:/* @__PURE__ */M.jsx("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"m16 18l6-6l-6-6M8 6l-6 6l6 6"})}),
85
85
  /* @__PURE__ */M.jsx("span",{children:g("common.source")})]})})]}),
86
- /* @__PURE__ */M.jsxs("div",{className:"flex items-center space-x-1",children:[f.showCollapseButton&&/* @__PURE__ */M.jsx("button",{type:"button",className:Pe,"aria-pressed":T,onClick:()=>_(e=>!e),onMouseEnter:e=>Se(e,g(T?"common.expand":"common.collapse")),onFocus:e=>Se(e,g(T?"common.expand":"common.collapse")),onMouseLeave:()=>ie(),onBlur:()=>ie(),children:/* @__PURE__ */M.jsx("svg",{style:{rotate:T?"0deg":"90deg"},xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink","aria-hidden":"true",role:"img",width:"1em",height:"1em",viewBox:"0 0 24 24",className:"w-3 h-3",children:/* @__PURE__ */M.jsx("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"m9 18l6-6l-6-6"})})}),f.showCopyButton&&/* @__PURE__ */M.jsx("button",{type:"button",className:Pe,onClick:Be,onMouseEnter:e=>Se(e,g(L?"common.copySuccess":"common.copy")),onFocus:e=>Se(e,g(L?"common.copySuccess":"common.copy")),onMouseLeave:()=>ie(),onBlur:()=>ie(),children:L?/* @__PURE__ */M.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink","aria-hidden":"true",role:"img",width:"1em",height:"1em",viewBox:"0 0 24 24",className:"w-3 h-3",children:/* @__PURE__ */M.jsx("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M20 6L9 17l-5-5"})}):/* @__PURE__ */M.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink","aria-hidden":"true",role:"img",width:"1em",height:"1em",viewBox:"0 0 24 24",className:"w-3 h-3",children:/* @__PURE__ */M.jsxs("g",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",children:[
86
+ /* @__PURE__ */M.jsxs("div",{className:"flex items-center space-x-1",children:[f.showCollapseButton&&/* @__PURE__ */M.jsx("button",{type:"button",className:Oe,"aria-pressed":_,onClick:()=>T(e=>!e),onMouseEnter:e=>Se(e,g(_?"common.expand":"common.collapse")),onFocus:e=>Se(e,g(_?"common.expand":"common.collapse")),onMouseLeave:()=>ie(),onBlur:()=>ie(),children:/* @__PURE__ */M.jsx("svg",{style:{rotate:_?"0deg":"90deg"},xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink","aria-hidden":"true",role:"img",width:"1em",height:"1em",viewBox:"0 0 24 24",className:"w-3 h-3",children:/* @__PURE__ */M.jsx("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"m9 18l6-6l-6-6"})})}),f.showCopyButton&&/* @__PURE__ */M.jsx("button",{type:"button",className:Oe,onClick:Be,onMouseEnter:e=>Se(e,g(L?"common.copySuccess":"common.copy")),onFocus:e=>Se(e,g(L?"common.copySuccess":"common.copy")),onMouseLeave:()=>ie(),onBlur:()=>ie(),children:L?/* @__PURE__ */M.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink","aria-hidden":"true",role:"img",width:"1em",height:"1em",viewBox:"0 0 24 24",className:"w-3 h-3",children:/* @__PURE__ */M.jsx("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M20 6L9 17l-5-5"})}):/* @__PURE__ */M.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink","aria-hidden":"true",role:"img",width:"1em",height:"1em",viewBox:"0 0 24 24",className:"w-3 h-3",children:/* @__PURE__ */M.jsxs("g",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",children:[
87
87
  /* @__PURE__ */M.jsx("rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2"}),
88
- /* @__PURE__ */M.jsx("path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2"})]})})}),f.showExportButton&&C&&/* @__PURE__ */M.jsx("button",{type:"button",className:ze(Pe,$e?"opacity-50 cursor-not-allowed":""),disabled:$e,onClick:Ee,onMouseEnter:e=>Se(e,g("common.export")),onFocus:e=>Se(e,g("common.export")),onMouseLeave:()=>ie(),onBlur:()=>ie(),children:/* @__PURE__ */M.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink","aria-hidden":"true",role:"img",width:"1em",height:"1em",viewBox:"0 0 24 24",className:"w-3 h-3",children:/* @__PURE__ */M.jsxs("g",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",children:[
88
+ /* @__PURE__ */M.jsx("path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2"})]})})}),f.showExportButton&&C&&/* @__PURE__ */M.jsx("button",{type:"button",className:ze(Oe,$e?"opacity-50 cursor-not-allowed":""),disabled:$e,onClick:Ee,onMouseEnter:e=>Se(e,g("common.export")),onFocus:e=>Se(e,g("common.export")),onMouseLeave:()=>ie(),onBlur:()=>ie(),children:/* @__PURE__ */M.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink","aria-hidden":"true",role:"img",width:"1em",height:"1em",viewBox:"0 0 24 24",className:"w-3 h-3",children:/* @__PURE__ */M.jsxs("g",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",children:[
89
89
  /* @__PURE__ */M.jsx("path",{d:"M12 15V3m9 12v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}),
90
- /* @__PURE__ */M.jsx("path",{d:"m7 10l5 5l5-5"})]})})}),f.showFullscreenButton&&C&&/* @__PURE__ */M.jsx("button",{type:"button",className:ze(Pe,$e?"opacity-50 cursor-not-allowed":""),disabled:$e,onClick:U?_e:Le,onMouseEnter:e=>Se(e,g(U?"common.minimize":"common.open")),onFocus:e=>Se(e,g(U?"common.minimize":"common.open")),onMouseLeave:()=>ie(),onBlur:()=>ie(),children:U?/* @__PURE__ */M.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink","aria-hidden":"true",role:"img",width:"1em",height:"1em",viewBox:"0 0 24 24",className:"w-3 h-3",children:/* @__PURE__ */M.jsx("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"m14 10l7-7m-1 7h-6V4M3 21l7-7m-6 0h6v6"})}):/* @__PURE__ */M.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink","aria-hidden":"true",role:"img",width:"1em",height:"1em",viewBox:"0 0 24 24",className:"w-3 h-3",children:/* @__PURE__ */M.jsx("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M15 3h6v6m0-6l-7 7M3 21l7-7m-1 7H3v-6"})})})]})]}),He=/* @__PURE__ */M.jsxs("div",{children:[B?/* @__PURE__ */M.jsx("div",{className:ze("p-4",f.isDark?"bg-gray-900 text-gray-300":"bg-gray-50 text-gray-700"),children:/* @__PURE__ */M.jsx("pre",{className:"text-sm font-mono whitespace-pre-wrap",children:y})}):Ie,K&&/* @__PURE__ */M.jsx("div",{className:"mermaid-error",children:K})]});/* @__PURE__ */
90
+ /* @__PURE__ */M.jsx("path",{d:"m7 10l5 5l5-5"})]})})}),f.showFullscreenButton&&C&&/* @__PURE__ */M.jsx("button",{type:"button",className:ze(Oe,$e?"opacity-50 cursor-not-allowed":""),disabled:$e,onClick:q?Te:Le,onMouseEnter:e=>Se(e,g(q?"common.minimize":"common.open")),onFocus:e=>Se(e,g(q?"common.minimize":"common.open")),onMouseLeave:()=>ie(),onBlur:()=>ie(),children:q?/* @__PURE__ */M.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink","aria-hidden":"true",role:"img",width:"1em",height:"1em",viewBox:"0 0 24 24",className:"w-3 h-3",children:/* @__PURE__ */M.jsx("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"m14 10l7-7m-1 7h-6V4M3 21l7-7m-6 0h6v6"})}):/* @__PURE__ */M.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink","aria-hidden":"true",role:"img",width:"1em",height:"1em",viewBox:"0 0 24 24",className:"w-3 h-3",children:/* @__PURE__ */M.jsx("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M15 3h6v6m0-6l-7 7M3 21l7-7m-1 7H3v-6"})})})]})]}),He=/* @__PURE__ */M.jsxs("div",{children:[B?/* @__PURE__ */M.jsx("div",{className:ze("p-4",f.isDark?"bg-gray-900 text-gray-300":"bg-gray-50 text-gray-700"),children:/* @__PURE__ */M.jsx("pre",{className:"text-sm font-mono whitespace-pre-wrap",children:y})}):Ie,K&&/* @__PURE__ */M.jsx("div",{className:"mermaid-error",children:K})]});/* @__PURE__ */
91
91
  return M.jsxs(M.Fragment,{children:[
92
- /* @__PURE__ */M.jsxs("div",{className:ze("my-4 rounded-lg border overflow-hidden shadow-sm mermaid-block",f.isDark?"border-gray-700/30":"border-gray-200",{"is-rendering":xe}),children:[Fe,!T&&/* @__PURE__ */M.jsx("div",{ref:le,children:He})]}),U&&"undefined"!=typeof document&&v(
93
- /* @__PURE__ */M.jsx("div",{className:"mermaid-modal-overlay",onClick:()=>_e(),children:/* @__PURE__ */M.jsxs("div",{className:ze("mermaid-modal-panel",{"is-dark":f.isDark}),role:"dialog","aria-modal":"true",onClick:e=>e.stopPropagation(),children:[
92
+ /* @__PURE__ */M.jsxs("div",{className:ze("my-4 rounded-lg border overflow-hidden shadow-sm mermaid-block",f.isDark?"border-gray-700/30":"border-gray-200",{"is-rendering":xe}),children:[Fe,!_&&/* @__PURE__ */M.jsx("div",{ref:le,children:He})]}),q&&"undefined"!=typeof document&&v(
93
+ /* @__PURE__ */M.jsx("div",{className:"mermaid-modal-overlay",onClick:()=>Te(),children:/* @__PURE__ */M.jsxs("div",{className:ze("mermaid-modal-panel",{"is-dark":f.isDark}),role:"dialog","aria-modal":"true",onClick:e=>e.stopPropagation(),children:[
94
94
  /* @__PURE__ */M.jsxs("div",{className:"mermaid-modal-header",children:[
95
95
  /* @__PURE__ */M.jsx("span",{className:"mermaid-modal-title",children:"Mermaid Preview"}),
96
- /* @__PURE__ */M.jsx("button",{type:"button",className:"mermaid-modal-close",onClick:_e,children:"Close"})]}),
97
- /* @__PURE__ */M.jsx("div",{className:"mermaid-modal-body",children:/* @__PURE__ */M.jsx("div",{ref:ae,className:"mermaid-modal-content"})})]})}),document.body)]})}function tt(e,n,t){return Math.min(Math.max(e,n),t)}function rt(e,n){return e.trimStart().startsWith("%%{")?e:`%%{init: {"theme": "${"dark"===n?"dark":"default"}"}}%%\n${e}`}function ot(e){const n=e.split("\n");for(;n.length>0;){const e=n[n.length-1].trimEnd();if(""!==e){if(!(/^[-=~>|<\s]+$/.test(e.trim())||/(?:--|==|~~|->|<-|-\||-\)|-x|o-|\|-|\.-)\s*$/.test(e)||/[-|><]$/.test(e)||/(?:graph|flowchart|sequenceDiagram|classDiagram|stateDiagram|erDiagram|gantt)\s*$/i.test(e)))break;n.pop()}else n.pop()}return n.join("\n")}async function it(e,n={}){const{timeoutMs:t,signal:r}=n;return(null==r?void 0:r.aborted)?Promise.reject(new DOMException("Aborted","AbortError")):new Promise((n,o)=>{let i=!1,l=null;function a(){i||(i=!0,s(),o(new DOMException("Aborted","AbortError")))}function s(){null!=l&&clearTimeout(l),r&&r.removeEventListener("abort",a)}r&&r.addEventListener("abort",a,{once:!0}),t&&t>0&&(l=setTimeout(()=>{i||(i=!0,s(),o(new Error("Operation timed out")))},t)),e().then(e=>{i||(i=!0,s(),n(e))}).catch(e=>{i||(i=!0,s(),o(e))})})}function lt(e){return(new XMLSerializer).serializeToString(e)}function at(e){const{node:n}=e;/* @__PURE__ */
98
- return M.jsxs("div",{className:"unknown-node text-sm text-gray-500 italic",children:["Unsupported node type:"," ",String(null==n?void 0:n.type)]})}function st(n){var t;const{node:r,ctx:o,renderNode:i,indexKey:l,children:a}=n;if(!o||!i)/* @__PURE__ */
99
- return M.jsx("p",{dir:"auto",className:"paragraph-node",children:a});const s=null!=(t=r.children)?t:[],c=[],d=[],u=()=>{if(!d.length)return;const e=c.length;c.push(
100
- /* @__PURE__ */M.jsx("p",{dir:"auto",className:"paragraph-node",children:S(d.slice(),o,`${String(null!=l?l:"paragraph")}-${e}`,i)},`${String(null!=l?l:"paragraph")}-inline-${e}`)),d.length=0};return s.forEach((n,t)=>{N.has(n.type)?(u(),c.push(
101
- /* @__PURE__ */M.jsx(e.Fragment,{children:i(n,`${String(null!=l?l:"paragraph")}-block-${t}`,o)},`${String(null!=l?l:"paragraph")}-block-${t}`))):d.push(n)}),u(),c.length?/* @__PURE__ */M.jsx(M.Fragment,{children:c}):/* @__PURE__ */M.jsx("p",{dir:"auto",className:"paragraph-node",children:S(s,o,String(null!=l?l:"paragraph"),i)})}function ct(e){const{node:n}=e,t=a(t=>{var r;null==(r=e.onClick)||r.call(e,t,n.id,e.messageId,e.threadId)},[n.id,e]);/* @__PURE__ */
102
- return M.jsx("span",{className:"reference-node cursor-pointer bg-accent text-xs rounded-md px-1.5 mx-0.5 hover:bg-secondary",role:"button",tabIndex:0,onClick:t,onMouseEnter:t=>{var r;null==(r=e.onMouseEnter)||r.call(e,t,n.id,e.messageId,e.threadId)},onMouseLeave:t=>{var r;null==(r=e.onMouseLeave)||r.call(e,t,n.id,e.messageId,e.threadId)},onKeyDown:e=>{"Enter"!==e.key&&" "!==e.key||t(e)},children:n.id})}function dt(e){/* @__PURE__ */
103
- return M.jsx("s",{className:"strikethrough-node",children:e.children})}function ut(e){/* @__PURE__ */
104
- return M.jsx("strong",{className:"strong-node",children:e.children})}function mt(e){/* @__PURE__ */
105
- return M.jsx("sub",{className:"subscript-node",children:e.children})}function ht(e){/* @__PURE__ */
106
- return M.jsx("sup",{className:"superscript-node",children:e.children})}function pt(e){var n;const{node:t,ctx:r,renderNode:o,indexKey:i}=e,l=Array.isArray(null==(n=null==t?void 0:t.header)?void 0:n.cells)?t.header.cells:[],a=Boolean(null==t?void 0:t.loading),s=Array.isArray(null==t?void 0:t.rows)?t.rows:[],c=e=>"right"===e?"text-right":"center"===e?"text-center":"text-left";/* @__PURE__ */
96
+ /* @__PURE__ */M.jsx("button",{type:"button",className:"mermaid-modal-close",onClick:Te,children:"Close"})]}),
97
+ /* @__PURE__ */M.jsx("div",{className:"mermaid-modal-body",children:/* @__PURE__ */M.jsx("div",{ref:ae,className:"mermaid-modal-content"})})]})}),document.body)]})}function Nn(e,t,n){return Math.min(Math.max(e,t),n)}function Cn(e,t){return e.trimStart().startsWith("%%{")?e:`%%{init: {"theme": "${"dark"===t?"dark":"default"}"}}%%\n${e}`}function Sn(e){const t=e.split("\n");for(;t.length>0;){const e=t[t.length-1].trimEnd();if(""!==e){if(!(/^[-=~>|<\s]+$/.test(e.trim())||/(?:--|==|~~|->|<-|-\||-\)|-x|o-|\|-|\.-)\s*$/.test(e)||/[-|><]$/.test(e)||/(?:graph|flowchart|sequenceDiagram|classDiagram|stateDiagram|erDiagram|gantt)\s*$/i.test(e)))break;t.pop()}else t.pop()}return t.join("\n")}async function Bn(e,t={}){const{timeoutMs:n,signal:r}=t;return(null==r?void 0:r.aborted)?Promise.reject(new DOMException("Aborted","AbortError")):new Promise((t,o)=>{let i=!1,l=null;function a(){i||(i=!0,s(),o(new DOMException("Aborted","AbortError")))}function s(){null!=l&&clearTimeout(l),r&&r.removeEventListener("abort",a)}r&&r.addEventListener("abort",a,{once:!0}),n&&n>0&&(l=setTimeout(()=>{i||(i=!0,s(),o(new Error("Operation timed out")))},n)),e().then(e=>{i||(i=!0,s(),t(e))}).catch(e=>{i||(i=!0,s(),o(e))})})}function En(e){return(new XMLSerializer).serializeToString(e)}function _n(e){const{node:t}=e;/* @__PURE__ */
98
+ return M.jsxs("div",{className:"unknown-node text-sm text-gray-500 italic",children:["Unsupported node type:"," ",String(null==t?void 0:t.type)]})}function Tn(t){var n;const{node:r,ctx:o,renderNode:i,indexKey:l,children:a}=t;if(!o||!i)/* @__PURE__ */
99
+ return M.jsx("p",{dir:"auto",className:"paragraph-node",children:a});const s=null!=(n=r.children)?n:[],c=[],d=[],u=()=>{if(!d.length)return;const e=c.length;c.push(
100
+ /* @__PURE__ */M.jsx("p",{dir:"auto",className:"paragraph-node",children:S(d.slice(),o,`${String(null!=l?l:"paragraph")}-${e}`,i)},`${String(null!=l?l:"paragraph")}-inline-${e}`)),d.length=0};return s.forEach((t,n)=>{N.has(t.type)?(u(),c.push(
101
+ /* @__PURE__ */M.jsx(e.Fragment,{children:i(t,`${String(null!=l?l:"paragraph")}-block-${n}`,o)},`${String(null!=l?l:"paragraph")}-block-${n}`))):d.push(t)}),u(),c.length?/* @__PURE__ */M.jsx(M.Fragment,{children:c}):/* @__PURE__ */M.jsx("p",{dir:"auto",className:"paragraph-node",children:S(s,o,String(null!=l?l:"paragraph"),i)})}function Ln(e){const{node:t}=e,n=a(n=>{var r;null==(r=e.onClick)||r.call(e,n,t.id,e.messageId,e.threadId)},[t.id,e]);/* @__PURE__ */
102
+ return M.jsx("span",{className:"reference-node cursor-pointer bg-accent text-xs rounded-md px-1.5 mx-0.5 hover:bg-secondary",role:"button",tabIndex:0,onClick:n,onMouseEnter:n=>{var r;null==(r=e.onMouseEnter)||r.call(e,n,t.id,e.messageId,e.threadId)},onMouseLeave:n=>{var r;null==(r=e.onMouseLeave)||r.call(e,n,t.id,e.messageId,e.threadId)},onKeyDown:e=>{"Enter"!==e.key&&" "!==e.key||n(e)},children:t.id})}function $n(e){/* @__PURE__ */
103
+ return M.jsx("s",{className:"strikethrough-node",children:e.children})}function On(e){/* @__PURE__ */
104
+ return M.jsx("strong",{className:"strong-node",children:e.children})}function Pn(e){/* @__PURE__ */
105
+ return M.jsx("sub",{className:"subscript-node",children:e.children})}function Rn(e){/* @__PURE__ */
106
+ return M.jsx("sup",{className:"superscript-node",children:e.children})}function Dn(e){var t;const{node:n,ctx:r,renderNode:o,indexKey:i}=e,l=Array.isArray(null==(t=null==n?void 0:n.header)?void 0:t.cells)?n.header.cells:[],a=Boolean(null==n?void 0:n.loading),s=Array.isArray(null==n?void 0:n.rows)?n.rows:[],c=e=>"right"===e?"text-right":"center"===e?"text-center":"text-left";/* @__PURE__ */
107
107
  return M.jsxs("div",{className:"table-node-wrapper","data-index-key":i,children:[
108
108
  /* @__PURE__ */M.jsxs("table",{className:ze("my-8 text-sm table-node",a&&"table-node--loading"),"aria-busy":a,children:[
109
- /* @__PURE__ */M.jsx("thead",{className:"border-[var(--table-border,#cbd5e1)]",children:/* @__PURE__ */M.jsx("tr",{className:"border-b",children:l.map((e,n)=>/* @__PURE__ */M.jsx("th",{className:ze("font-semibold p-[calc(4/7*1em)]",c(e.align)),dir:"auto",children:r&&o?B(e.children,r,`${String(null!=i?i:"table")}-th-${n}`,o):null},`header-${n}`))})}),
110
- /* @__PURE__ */M.jsx("tbody",{children:s.map((e,n)=>{var t;/* @__PURE__ */
111
- return M.jsx("tr",{className:ze("border-[var(--table-border,#cbd5e1)]",n<s.length-1&&"border-b"),children:null==(t=e.cells)?void 0:t.map((e,t)=>/* @__PURE__ */M.jsx("td",{className:ze("p-[calc(4/7*1em)]",c(e.align)),dir:"auto",children:r&&o?B(e.children,r,`${String(null!=i?i:"table")}-row-${n}-${t}`,o):null},`cell-${n}-${t}`))},`row-${n}`)})})]}),a&&/* @__PURE__ */M.jsxs("div",{className:"table-node__loading",role:"status","aria-live":"polite",children:[
109
+ /* @__PURE__ */M.jsx("thead",{className:"border-[var(--table-border,#cbd5e1)]",children:/* @__PURE__ */M.jsx("tr",{className:"border-b",children:l.map((e,t)=>/* @__PURE__ */M.jsx("th",{className:ze("font-semibold p-[calc(4/7*1em)]",c(e.align)),dir:"auto",children:r&&o?B(e.children,r,`${String(null!=i?i:"table")}-th-${t}`,o):null},`header-${t}`))})}),
110
+ /* @__PURE__ */M.jsx("tbody",{children:s.map((e,t)=>{var n;/* @__PURE__ */
111
+ return M.jsx("tr",{className:ze("border-[var(--table-border,#cbd5e1)]",t<s.length-1&&"border-b"),children:null==(n=e.cells)?void 0:n.map((e,n)=>/* @__PURE__ */M.jsx("td",{className:ze("p-[calc(4/7*1em)]",c(e.align)),dir:"auto",children:r&&o?B(e.children,r,`${String(null!=i?i:"table")}-row-${t}-${n}`,o):null},`cell-${t}-${n}`))},`row-${t}`)})})]}),a&&/* @__PURE__ */M.jsxs("div",{className:"table-node__loading",role:"status","aria-live":"polite",children:[
112
112
  /* @__PURE__ */M.jsx("span",{className:"table-node__spinner","aria-hidden":"true"}),
113
- /* @__PURE__ */M.jsx("span",{className:"sr-only",children:"Loading"})]})]})}function ft(e){const{node:n,children:t}=e;/* @__PURE__ */
114
- return M.jsx("span",{className:ze("text-node whitespace-pre-wrap break-words",n.center&&"text-node-center"),children:null!=t?t:n.content})}function gt(){/* @__PURE__ */
115
- return M.jsx("hr",{className:"hr-node thematic-break"})}function vt(t){const{node:r,ctx:o,renderNode:i,indexKey:l}=t,a=`vmr-container vmr-container-${r.name}`,s=n(()=>{if(r.attrs)return Array.isArray(r.attrs)?C(r.attrs):r.attrs},[r.attrs]);/* @__PURE__ */
116
- return M.jsx("div",{className:a,...s,children:o&&i&&Array.isArray(r.children)?r.children.map((n,t)=>/* @__PURE__ */M.jsx(e.Fragment,{children:i(n,`${String(null!=l?l:"vmr-container")}-${t}`,o)},`${String(null!=l?l:"vmr-container")}-${t}`)):null})}function wt(e,n){const t=String(null!=e?e:"");if(!n)return t;const r=new RegExp(String.raw`^\s*<\s*${n}(?:\s[^>]*)?>\s*`,"i"),o=new RegExp(String.raw`\s*<\s*\/\s*${n}\s*>\s*$`,"i");return t.replace(r,"").replace(o,"")}function xt(n,t,r){var o,i;const l=H(r.customId),a=l[n.type];if(a)return e.createElement(a,{key:t,node:n,customId:r.customId,isDark:r.isDark,ctx:r,renderNode:xt,indexKey:t,typewriter:r.typewriter});if("html_block"===n.type||"html_inline"===n.type){const i=String(null!=(o=n.tag)?o:"").trim().toLowerCase()||function(e){const n=String(null!=e?e:"").match(/^\s*<\s*([A-Z][\w:-]*)/i);return n?n[1].toLowerCase():""}(n.content),a=i?l[i]:null;if(a){const o={...n,type:i,tag:i,content:wt(n.content,i)};return e.createElement(a,{key:t,node:o,customId:r.customId,isDark:r.isDark,ctx:r,renderNode:xt,indexKey:t,typewriter:r.typewriter})}}switch(n.type){case"text":/* @__PURE__ */
117
- return M.jsx(ft,{node:n,typewriter:r.typewriter},t);case"text_special":/* @__PURE__ */
118
- return M.jsx(ft,{node:{type:"text",content:null!=(i=n.content)?i:"",center:n.center},typewriter:r.typewriter},t);case"paragraph":/* @__PURE__ */
119
- return M.jsx(st,{node:n,ctx:r,renderNode:xt,indexKey:t,typewriter:r.typewriter},t);case"heading":/* @__PURE__ */
120
- return M.jsx(He,{node:n,ctx:r,renderNode:xt,indexKey:t,typewriter:r.typewriter},t);case"blockquote":/* @__PURE__ */
121
- return M.jsx(Ct,{node:n,ctx:r,renderNode:xt,indexKey:t,typewriter:r.typewriter},t);case"list":/* @__PURE__ */
122
- return M.jsx(Qe,{node:n,ctx:r,renderNode:xt,indexKey:t,typewriter:r.typewriter},t);case"list_item":/* @__PURE__ */
123
- return M.jsx(Ge,{node:n,ctx:r,renderNode:xt,indexKey:t,typewriter:r.typewriter},t);case"table":/* @__PURE__ */
124
- return M.jsx(pt,{node:n,ctx:r,renderNode:xt,indexKey:t,typewriter:r.typewriter},t);case"definition_list":/* @__PURE__ */
125
- return M.jsx(Pe,{node:n,ctx:r,renderNode:xt,indexKey:t,typewriter:r.typewriter},t);case"footnote":/* @__PURE__ */
126
- return M.jsx(Ae,{node:n,ctx:r,renderNode:xt,indexKey:t,typewriter:r.typewriter},t);case"footnote_reference":/* @__PURE__ */
127
- return M.jsx(We,{node:n},t);case"footnote_anchor":/* @__PURE__ */
128
- return M.jsx(Oe,{node:n},t);case"admonition":/* @__PURE__ */
129
- return M.jsx(T,{node:n,ctx:r,renderNode:xt,indexKey:t,isDark:r.isDark,typewriter:r.typewriter},t);case"hardbreak":/* @__PURE__ */
130
- return M.jsx(Ie,{node:n,typewriter:r.typewriter},t);case"link":/* @__PURE__ */
131
- return M.jsx(Je,{node:n,ctx:r,renderNode:xt,indexKey:t,isDark:r.isDark,typewriter:r.typewriter},t);case"image":/* @__PURE__ */
132
- return M.jsx(qe,{node:n},t);case"inline_code":/* @__PURE__ */
133
- return M.jsx(Ye,{node:n,typewriter:r.typewriter},t);case"code_block":return function(n,t,r){var o,i,l,a;const s=ce(String(n.language||""));if("mermaid"===s){const o=H(r.customId).mermaid;if(o)return e.createElement(o,{key:t,node:n,isDark:r.isDark});if(!r.renderCodeBlocksAsPre)/* @__PURE__ */
134
- return M.jsx(nt,{node:n,isDark:r.isDark,loading:Boolean(n.loading)},t)}return r.renderCodeBlocksAsPre||"mermaid"===s?/* @__PURE__ */M.jsx(_e,{node:n},t):/* @__PURE__ */M.jsx($e,{node:n,loading:Boolean(n.loading),stream:r.codeBlockStream,monacoOptions:null==(o=r.codeBlockThemes)?void 0:o.monacoOptions,themes:null==(i=r.codeBlockThemes)?void 0:i.themes,minWidth:null==(l=r.codeBlockThemes)?void 0:l.minWidth,maxWidth:null==(a=r.codeBlockThemes)?void 0:a.maxWidth,isDark:r.isDark,onCopy:r.events.onCopy,...r.codeBlockProps||{}},t)}(n,t,r);case"strong":/* @__PURE__ */
135
- return M.jsx(ut,{node:n,children:S(n.children,r,`${String(t)}-strong`,xt)},t);case"emphasis":/* @__PURE__ */
136
- return M.jsx(De,{node:n,children:S(n.children,r,`${String(t)}-em`,xt)},t);case"strikethrough":/* @__PURE__ */
137
- return M.jsx(dt,{node:n,children:S(n.children,r,`${String(t)}-strike`,xt)},t);case"highlight":/* @__PURE__ */
138
- return M.jsx(Ve,{node:n,children:S(n.children,r,`${String(t)}-highlight`,xt)},t);case"insert":/* @__PURE__ */
139
- return M.jsx(Ze,{node:n,children:S(n.children,r,`${String(t)}-insert`,xt)},t);case"subscript":/* @__PURE__ */
140
- return M.jsx(mt,{node:n,children:S(n.children,r,`${String(t)}-sub`,xt)},t);case"superscript":/* @__PURE__ */
141
- return M.jsx(ht,{node:n,children:S(n.children,r,`${String(t)}-sup`,xt)},t);case"checkbox":case"checkbox_input":/* @__PURE__ */
142
- return M.jsx(X,{node:n,typewriter:r.typewriter},t);case"emoji":/* @__PURE__ */
143
- return M.jsx(Re,{node:n,typewriter:r.typewriter},t);case"thematic_break":/* @__PURE__ */
144
- return M.jsx(gt,{},t);case"math_inline":/* @__PURE__ */
145
- return M.jsx(Cn,{node:n},t);case"math_block":/* @__PURE__ */
146
- return M.jsx(Nn,{node:n},t);case"reference":/* @__PURE__ */
147
- return M.jsx(ct,{node:n,ctx:r,typewriter:r.typewriter},t);case"html_block":case"html_inline":return"html_block"===n.type?/* @__PURE__ */M.jsx(Ke,{node:n,typewriter:r.typewriter},t):/* @__PURE__ */M.jsx(Xe,{node:n,typewriter:r.typewriter},t);case"vmr_container":/* @__PURE__ */
148
- return M.jsx(vt,{node:n,ctx:r,renderNode:xt,indexKey:t,typewriter:r.typewriter},t);case"label_open":case"label_close":return null;default:/* @__PURE__ */
149
- return M.jsx(at,{node:n},t)}}const yt={codeBlockStream:!0,typewriter:!0,batchRendering:!0,initialRenderBatchSize:40,renderBatchSize:80,renderBatchDelay:16,renderBatchBudgetMs:6,renderBatchIdleTimeoutMs:120,deferNodesUntilVisible:!0,maxLiveNodes:320,liveNodeBuffer:60},kt=d();function bt(e){const n=String(null!=e?e:"").trim();if(!n)return"";const t=n.match(/^[<\s/]*([A-Z][\w-]*)/i);return t?t[1].toLowerCase():""}function jt(e){return/^[a-z][a-z0-9-]*$/.test(e)}const Mt=e.memo(({props:e,parsedNodes:r,renderCtx:o,indexPrefix:s,containerRef:c})=>{var d,u,m,h,p,f,g;const v=R(),w="undefined"!=typeof window,x="undefined"!=typeof window&&"function"==typeof window.requestIdleCallback,y=Math.max(0,Math.trunc(null!=(d=e.renderBatchSize)?d:80)),k=Math.max(0,Math.trunc(null!=(u=e.initialRenderBatchSize)?u:y||r.length)),b=!1!==e.batchRendering&&y>0&&w,j=Math.max(0,null!=(m=e.liveNodeBuffer)?m:60),N=Math.max(1,null!=(h=e.maxLiveNodes)?h:320),C=(null!=(p=e.maxLiveNodes)?p:0)>0&&r.length>N,S=!1!==e.viewportPriority,B=b&&(null!=(f=e.maxLiveNodes)?f:0)<=0,E=n(()=>{var n;return!1!==e.deferNodesUntilVisible&&!((null!=(n=e.maxLiveNodes)?n:0)<=0)&&!C&&!(r.length>900)&&S},[r.length,e.deferNodesUntilVisible,e.maxLiveNodes,S,C]),[T,_]=t(()=>B?Math.min(r.length,k):r.length),L=i(T);l(()=>{L.current=T},[T]);const $=B?T:r.length,[P,D]=t(0),[O,A]=t({start:0,end:r.length}),W=i(/* @__PURE__ */new Map),[I,F]=t(0),z=i({}),H=i(/* @__PURE__ */new Map),V=i(/* @__PURE__ */new Map),K=i(/* @__PURE__ */new Set),X=i(T),U=i(null),q=i(null),Y=i(null),Z=i(!1),J=i(null),G=i(Math.max(1,y||1)),Q=i(r.length),ee=i({key:e.indexKey,total:r.length}),ne=i({batchSize:y,initial:k,delay:null!=(g=e.renderBatchDelay)?g:16,enabled:B}),te=E||C,re=n(()=>{const e=W.current;if(!e.size)return 32;let n=0;for(const t of e.values())n+=t;return Math.max(16,n/e.size)},[I]),oe=n(()=>{if(!C)return r.map((e,n)=>({node:e,index:n}));const e=r.length,n=Math.max(0,Math.min(O.start,e)),t=Math.max(n,Math.min(O.end,e));return r.slice(n,t).map((e,t)=>({node:e,index:n+t}))},[r,O,C]),ie=n(()=>{if(!C)return r.length;const e=Math.max(O.end+j,k),n=Math.min(r.length,e);return Math.max(T,n)},[r.length,C,O.end,j,k,T]);Q.current=ie;const le=a((e,n)=>{var t;if(e>=n)return 0;const r=W.current;let o=0;for(let i=e;i<n;i++)o+=null!=(t=r.get(i))?t:re;return o},[re]),ae=C?le(0,Math.min(O.start,r.length)):0,se=C?le(Math.min(O.end,r.length),r.length):0,ce=a(()=>{null!=U.current&&"function"==typeof cancelAnimationFrame&&(cancelAnimationFrame(U.current),U.current=null),null!=q.current&&(window.clearTimeout(q.current),q.current=null),null!=Y.current&&"function"==typeof window.cancelIdleCallback&&(window.cancelIdleCallback(Y.current),Y.current=null),Z.current=!1,J.current=null},[]),de=a(n=>{var t;if(!B)return;const r=Math.max(2,null!=(t=e.renderBatchBudgetMs)?t:6),o=Math.max(1,y||1),i=Math.max(1,Math.floor(o/4));n>1.2*r?G.current=Math.max(i,Math.floor(.7*G.current)):n<.5*r&&G.current<o&&(G.current=Math.min(o,Math.ceil(1.2*G.current)))},[B,e.renderBatchBudgetMs,y]),ue=a((n,t={})=>{var r,o;if(!B)return;const i=Q.current;if(L.current>=i)return;const l=Math.max(1,n),a=e=>{const n="undefined"!=typeof performance?performance.now():Date.now();_(n=>{const t=Math.min(Q.current,n+Math.max(1,e));return L.current=t,t});const t="undefined"!=typeof performance?performance.now():Date.now();de(t-n)},s=()=>{const e=Math.max(1,Math.round(G.current));ue(e)},c=n=>{var t;U.current=null,q.current=null,Y.current=null,Z.current=!1;const r=J.current;if(J.current=null,a(null!=r?r:l),L.current>=Q.current)return;if(!n)return void s();const o=Math.max(2,null!=(t=e.renderBatchBudgetMs)?t:6);for(;L.current<Q.current&&!(("function"==typeof n.timeRemaining?n.timeRemaining():0)<=.5*o);)a(Math.max(1,Math.round(G.current)));L.current<Q.current&&s()};if(!w||t.immediate)return void c();const d=Math.max(0,null!=(r=e.renderBatchDelay)?r:16);if(J.current=null!=J.current?Math.max(J.current,l):l,!Z.current){if(Z.current=!0,x){const n=Math.max(0,null!=(o=e.renderBatchIdleTimeoutMs)?o:120);return void(Y.current=window.requestIdleCallback(e=>c(e),{timeout:n}))}"function"==typeof requestAnimationFrame?U.current=requestAnimationFrame(()=>{0!==d?q.current=window.setTimeout(()=>c(),d):c()}):q.current=window.setTimeout(()=>c(),d)}},[de,x,B,w,e.renderBatchDelay,e.renderBatchBudgetMs,e.renderBatchIdleTimeoutMs]);l(()=>{var n;const t=e.indexKey,o=r.length,i=ee.current,l=void 0!==t?t!==i.key:o!==i.total;ee.current={key:t,total:o};const a=ne.current,s=null!=(n=e.renderBatchDelay)?n:16,c=a.batchSize!==y||a.initial!==k||a.delay!==s||a.enabled!==B;if(ne.current={batchSize:y,initial:k,delay:s,enabled:B},(l||c||!B)&&ce(),(l||c)&&(G.current=Math.max(1,y||1),K.current.clear()),!o)return L.current=0,void _(0);const d=Q.current;if(!B)return L.current=d,void _(d);if(l||c){const e=Math.min(d,k);return L.current=e,_(e),void(e<d&&ue(Math.max(1,k),{immediate:!w}))}const u=Math.min(L.current,d);u!==L.current&&(L.current=u,_(u)),L.current<d&&ue(Math.max(1,y||1))},[ce,B,w,r.length,e.indexKey,e.renderBatchDelay,y,k,ue]),l(()=>{if(!C)return void A({start:0,end:r.length});const e=r.length;if(!e)return void A({start:0,end:0});const n=Math.max(0,Math.min(P,e-1));let t=Math.max(0,n-j),o=Math.min(e,n+j+1);const i=o-t;if(i>N){const e=i-N;t+=Math.ceil(e/2),o-=Math.floor(e/2)}else if(i<N){const n=N-i;t=Math.max(0,t-Math.ceil(n/2)),o=Math.min(e,o+Math.floor(n/2))}A({start:t,end:o})},[P,j,N,r.length,C]),l(()=>()=>{ce();for(const e of H.current.values())e.destroy();H.current.clear()},[ce]);const me=a(e=>{for(const[n,t]of H.current.entries())n>=e&&(t.destroy(),H.current.delete(n),delete z.current[n],V.current.delete(n))},[]);l(()=>{me($)},[me,$]),l(()=>{const e=r.length;let n=!1;for(const t of Array.from(W.current.keys()))t>=e&&(W.current.delete(t),n=!0);n&&F(e=>e+1);for(const t of Object.keys(z.current))Number(t)>=e&&delete z.current[t];for(const t of Array.from(K.current))t>=e&&K.current.delete(t)},[r.length]);const he=a((e,n)=>{E&&n&&(z.current[e]=!0),n&&C&&D(n=>e>n?e:n)},[E,C]),pe=a(e=>{const n=H.current.get(e);n&&(n.destroy(),H.current.delete(e))},[]),fe=a((e,n)=>{const t=V.current;if(n?t.set(e,n):t.delete(e),!te||!n)return pe(e),E&&!n&&delete z.current[e],void(n&&he(e,!0));if(e<k&&!C)return pe(e),void he(e,!0);pe(e);const r=v(n,{rootMargin:"400px"});H.current.set(e,r),r.isVisible()&&he(e,!0),r.whenVisible.then(()=>he(e,!0)).catch(()=>{})},[E,pe,he,v,k,te,C]),ge=a((e,n)=>{if(!n)return void(W.current.has(e)&&(W.current.delete(e),F(e=>e+1)));const t=()=>{const t=n.offsetHeight;t&&W.current.get(e)!==t&&(W.current.set(e,t),F(e=>e+1))};"function"==typeof queueMicrotask?queueMicrotask(t):Promise.resolve().then(t)},[]),ve=a(e=>!(B&&e>=L.current)&&(!E||e<k||!0===z.current[e]),[E,B,k]),we=a(e=>n=>{if(!e)return;const t=n.target;(null==t?void 0:t.closest("[data-node-index]"))&&e(n)},[]);l(()=>{for(const[e,n]of V.current.entries())n&&fe(e,n)},[fe]),l(()=>{C&&T>X.current&&D(T-1),X.current=T},[T,C]);const xe=C?/* @__PURE__ */M.jsx("div",{className:"node-spacer",style:{height:`${ae}px`},"aria-hidden":"true"}):null,ye=C?/* @__PURE__ */M.jsx("div",{className:"node-spacer",style:{height:`${se}px`},"aria-hidden":"true"}):null;/* @__PURE__ */
150
- return M.jsxs("div",{ref:c,className:`markstream-vue markdown-renderer${e.isDark?" dark":""}${C?" virtualized":""}`,onClick:e.onClick,onMouseOver:we(e.onMouseOver),onMouseOut:we(e.onMouseOut),children:[xe,oe.map(({node:n,index:t})=>{var r;const i=ve(t),l=null!=(r=W.current.get(t))?r:re,a=!1!==e.typewriter&&"code_block"!==n.type&&!K.current.has(t)&&i;return a&&K.current.add(t),/* @__PURE__ */M.jsx("div",{ref:e=>fe(t,e),className:"node-slot","data-node-index":t,"data-node-type":n.type,children:i?/* @__PURE__ */M.jsx("div",{ref:e=>ge(t,e),className:"node-content"+(a?" typewriter-node":""),children:xt(n,`${s}-${t}`,o)}):/* @__PURE__ */M.jsx("div",{className:"node-placeholder",style:{height:`${l}px`}})},`${s}-${t}`)}),ye]})},function(e,n){if(e.parsedNodes!==n.parsedNodes)return!1;if(e.renderCtx!==n.renderCtx)return!1;if(e.indexPrefix!==n.indexPrefix)return!1;if(e.containerRef!==n.containerRef)return!1;const t=e.props,r=n.props;return t.isDark===r.isDark&&t.typewriter===r.typewriter&&t.batchRendering===r.batchRendering&&t.initialRenderBatchSize===r.initialRenderBatchSize&&t.renderBatchSize===r.renderBatchSize&&t.renderBatchDelay===r.renderBatchDelay&&t.renderBatchBudgetMs===r.renderBatchBudgetMs&&t.renderBatchIdleTimeoutMs===r.renderBatchIdleTimeoutMs&&t.deferNodesUntilVisible===r.deferNodesUntilVisible&&t.maxLiveNodes===r.maxLiveNodes&&t.liveNodeBuffer===r.liveNodeBuffer&&t.viewportPriority===r.viewportPriority&&t.indexKey===r.indexKey&&t.onClick===r.onClick&&t.onMouseOver===r.onMouseOver&&t.onMouseOut===r.onMouseOut}),Nt=e=>{const t={...yt,...e},r=i(null),o=i(null),a=c(I,F,F),s=n(()=>t.customId?`renderer-${t.customId}`:`renderer-${Date.now()}-${Math.random().toString(36).slice(2)}`,[t.customId]),m=n(()=>{const e=H(t.customId);return Object.keys(e).map(String).map(e=>e.trim().toLowerCase()).filter(jt)},[t.customId,a]),h=n(()=>{var e,n,r;const o=null!=(n=(null!=(e=t.parseOptions)?e:{}).customHtmlTags)?n:[],i=[...null!=(r=t.customHtmlTags)?r:[],...Array.isArray(o)?o:[],...m].map(bt).filter(Boolean);return Array.from(new Set(i))},[t.customId,t.customHtmlTags,t.parseOptions,m,a]),p=n(()=>{const e=h;return e&&0!==e.length?d(s,{customHtmlTags:e}):d(s)},[s,h]),f=n(()=>{const e=p;return t.customMarkdownIt?t.customMarkdownIt(e):e},[p,t.customMarkdownIt]),g=n(()=>{var e,n;const r=null!=(e=t.parseOptions)?e:{},o=null!=(n=t.final)?n:r.final,i=h;return i.length?{...r,final:o,customHtmlTags:i}:null==o?r:{...r,final:o}},[h,t.final,t.parseOptions]),v=n(()=>{var e,n;const r=Boolean(t.debugPerformance)&&"undefined"!=typeof console&&"undefined"!=typeof performance,o=r?performance.now():0;let i=[];return Array.isArray(t.nodes)&&t.nodes.length?i=t.nodes.map(e=>({...e})):t.content&&(i=u(t.content,null!=f?f:kt,g)),r&&console.info("[markstream-react][perf] parse(sync)",{ms:Math.round(performance.now()-o),nodes:i.length,contentLength:null!=(n=null==(e=t.content)?void 0:e.length)?n:0}),i},[t.content,t.debugPerformance,t.nodes,g,f,t.customId,a,h]);if(l(()=>{var e,n;if("undefined"==typeof window)return;if(t.renderCodeBlocksAsPre)return;if(!v.some(e=>{var n;return"code_block"===(null==e?void 0:e.type)&&"mermaid"!==ce(String(null!=(n=null==e?void 0:e.language)?n:""))}))return;const r=null!=(e=window.requestIdleCallback)?e:(e,n)=>{var t;return window.setTimeout(()=>e({didTimeout:!0,timeRemaining:()=>0}),null!=(t=null==n?void 0:n.timeout)?t:600)},o=null!=(n=window.cancelIdleCallback)?n:e=>window.clearTimeout(e),i=r(()=>{ve()},{timeout:900});return()=>o(i)},[v,t.renderCodeBlocksAsPre]),"undefined"!=typeof window&&!t.renderCodeBlocksAsPre){const e=t.isDark?t.codeBlockDarkTheme:t.codeBlockLightTheme,n="string"==typeof e?e:"object"==typeof e&&e&&"name"in e?String(e.name):null;n&&o.current!==n&&(o.current=n,function(e){if(null==e)return;const n=function(e){if(null==e)return null;if("string"==typeof e)return e;if("object"==typeof e&&"name"in e)return String(e.name);try{return JSON.stringify(e)}catch{return String(e)}}(e);n&&Se!==n&&(Ce=e,Se=n,Be&&Ne(Ce,Be).then(()=>Te()).catch(()=>{}))}(e))}const w=n(()=>null!=t.indexKey?String(t.indexKey):"markdown-renderer",[t.indexKey]),x=n(()=>({customId:t.customId,isDark:t.isDark,indexKey:w,typewriter:t.typewriter,renderCodeBlocksAsPre:t.renderCodeBlocksAsPre,codeBlockStream:t.codeBlockStream,codeBlockProps:t.codeBlockProps,codeBlockThemes:{themes:t.themes,monacoOptions:t.codeBlockMonacoOptions,minWidth:t.codeBlockMinWidth,maxWidth:t.codeBlockMaxWidth},events:{onCopy:t.onCopy,onHandleArtifactClick:t.onHandleArtifactClick}}),[t.customId,t.isDark,w,t.typewriter,t.renderCodeBlocksAsPre,t.codeBlockStream,t.codeBlockProps,t.themes,t.codeBlockMonacoOptions,t.codeBlockMinWidth,t.codeBlockMaxWidth,t.onCopy,t.onHandleArtifactClick]);/* @__PURE__ */
151
- return M.jsx(P,{getRoot:()=>r.current,enabled:!1!==t.viewportPriority,children:/* @__PURE__ */M.jsx(Mt,{props:t,parsedNodes:v,renderCtx:x,indexPrefix:w,containerRef:r})})};function Ct(e){var n,t,r,o,i,l;const{node:a,ctx:s,renderNode:c,indexKey:d,children:u}=e;/* @__PURE__ */
152
- return M.jsx("blockquote",{className:"blockquote-node",dir:"auto",cite:a.cite,children:null!=u?u:s&&c?/* @__PURE__ */M.jsx(Nt,{nodes:a.children||[],indexKey:`blockquote-${String(null!=d?d:"blockquote")}`,customId:s.customId,isDark:s.isDark,typewriter:s.typewriter,viewportPriority:!0,codeBlockStream:s.codeBlockStream,renderCodeBlocksAsPre:s.renderCodeBlocksAsPre,codeBlockProps:s.codeBlockProps,themes:null==(n=s.codeBlockThemes)?void 0:n.themes,codeBlockDarkTheme:null==(t=s.codeBlockThemes)?void 0:t.darkTheme,codeBlockLightTheme:null==(r=s.codeBlockThemes)?void 0:r.lightTheme,codeBlockMonacoOptions:null==(o=s.codeBlockThemes)?void 0:o.monacoOptions,codeBlockMinWidth:null==(i=s.codeBlockThemes)?void 0:i.minWidth,codeBlockMaxWidth:null==(l=s.codeBlockThemes)?void 0:l.maxWidth,onCopy:s.events.onCopy,onHandleArtifactClick:s.events.onHandleArtifactClick}):null})}function St(e){const r={loading:!0,stream:!0,darkTheme:"vitesse-dark",lightTheme:"vitesse-light",isDark:!1,isShowPreview:!0,enableFontSizeControl:!0,showHeader:!0,showCopyButton:!0,showExpandButton:!0,showPreviewButton:!0,showFontSizeButtons:!0,...e},o=n(()=>{var e;return String(null!=(e=r.node.language)?e:"")},[r.node.language]),s=n(()=>function(e){var n;const[t]=String(null!=e?e:"").split(":");return(null!=(n=null==t?void 0:t.trim().toLowerCase())?n:"")||"plaintext"}(o),[o]),c=n(()=>ce(o),[o]),d=n(()=>{const e=me[c]||c;return e?e.charAt(0).toUpperCase()+e.slice(1):"Text"},[c]),u=n(()=>ue(c),[c]),{t:m}=Y(),h=n(()=>!!r.isShowPreview&&("html"===c||"svg"===c),[c,r.isShowPreview]),p=n(()=>{const e={},n=e=>{if(null!=e)return"number"==typeof e?`${e}px`:String(e)},t=n(r.minWidth),o=n(r.maxWidth);return t&&(e.minWidth=t),o&&(e.maxWidth=o),e},[r.maxWidth,r.minWidth]),[f,g]=t(!1),[v,w]=t(!1),[x,y]=t(!1),[k,b]=t(""),[j,N]=t(!1),[C,S]=t(14),[B,E]=t(C),T=i(null),_=i(null),L=i(null),$=i(null),P=i(!1),R=a(()=>r.isDark?r.darkTheme:r.lightTheme,[r.darkTheme,r.isDark,r.lightTheme]),D=a(e=>{if(!e)return b(""),void N(!1);var n;b(`<pre class="shiki shiki-fallback"><code>${n=e,n.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}</code></pre>`),N(!1)},[]),O=a(()=>{b(""),N(!0)},[]),A=a(async()=>{if(!$.current&&!P.current){P.current=!0;try{const e=await import("stream-markdown");$.current=e.createShikiStreamRenderer}catch{}}},[]),W=a(async()=>{if(await A(),T.current&&_.current)if(!L.current&&$.current&&(L.current=$.current(_.current,{theme:R(),themes:r.themes}),N(!0)),L.current)if(!1===r.stream&&r.loading)D(r.node.code);else{D(r.node.code);try{await L.current.updateCode(r.node.code,s),O()}catch{}}else D(r.node.code);else D(r.node.code)},[O,A,R,s,r.loading,r.node.code,r.stream,r.themes,D]);l(()=>(W(),()=>{var e;null==(e=L.current)||e.dispose(),L.current=null}),[W]),l(()=>{L.current&&L.current.setTheme(R())},[R]),l(()=>{L.current&&(!1===r.stream&&r.loading||(D(r.node.code),Promise.resolve(L.current.updateCode(r.node.code,s)).then(()=>O()).catch(()=>{})))},[O,s,r.loading,r.node.code,r.stream,D]);const I=a((e,n)=>{oe(e.currentTarget,n,"top",!1,(e.clientX,e.clientY),r.isDark)},[r.isDark]),F=a(()=>ie(),[]),z=a(async()=>{var e;try{"undefined"!=typeof navigator&&navigator.clipboard&&"function"==typeof navigator.clipboard.writeText&&await navigator.clipboard.writeText(r.node.code),g(!0),null==(e=r.onCopy)||e.call(r,r.node.code),setTimeout(()=>g(!1),1e3)}catch{}},[r]),H=a(()=>{var e;if(!h)return;const n="html"===s?"text/html":"image/svg+xml",t="html"===s?"HTML Preview":"SVG Preview";null==(e=r.onPreviewCode)||e.call(r,{type:n,content:r.node.code,title:t})},[h,s,r]),V=n(()=>({fontSize:`${B}px`}),[B]);return l(()=>{S(14),E(14)},[]),/* @__PURE__ */M.jsxs("div",{className:["code-block-container my-4 rounded-lg border overflow-hidden shadow-sm",r.isDark?"border-gray-700/30 bg-gray-900 is-dark":"border-gray-200 bg-white"].join(" "),style:p,children:[r.showHeader&&/* @__PURE__ */M.jsxs("div",{className:"code-block-header flex justify-between items-center px-4 py-2.5 border-b border-gray-400/5",style:{color:"var(--vscode-editor-foreground)",backgroundColor:"var(--vscode-editor-background)"},children:[
113
+ /* @__PURE__ */M.jsx("span",{className:"sr-only",children:"Loading"})]})]})}function Wn(e){const{node:t,children:n}=e;/* @__PURE__ */
114
+ return M.jsx("span",{className:ze("text-node whitespace-pre-wrap break-words",t.center&&"text-node-center"),children:null!=n?n:t.content})}function An(){/* @__PURE__ */
115
+ return M.jsx("hr",{className:"hr-node thematic-break"})}function In(n){const{node:r,ctx:o,renderNode:i,indexKey:l}=n,a=`vmr-container vmr-container-${r.name}`,s=t(()=>{if(r.attrs)return Array.isArray(r.attrs)?C(r.attrs):r.attrs},[r.attrs]);/* @__PURE__ */
116
+ return M.jsx("div",{className:a,...s,children:o&&i&&Array.isArray(r.children)?r.children.map((t,n)=>/* @__PURE__ */M.jsx(e.Fragment,{children:i(t,`${String(null!=l?l:"vmr-container")}-${n}`,o)},`${String(null!=l?l:"vmr-container")}-${n}`)):null})}function Fn(e,t){const n=String(null!=e?e:"");if(!t)return n;const r=new RegExp(String.raw`^\s*<\s*${t}(?:\s[^>]*)?>\s*`,"i"),o=new RegExp(String.raw`\s*<\s*\/\s*${t}\s*>\s*$`,"i");return n.replace(r,"").replace(o,"")}function zn(t,n,r){var o,i;const l=H(r.customId),a=l[t.type];if(a)return e.createElement(a,{key:n,node:t,customId:r.customId,isDark:r.isDark,ctx:r,renderNode:zn,indexKey:n,typewriter:r.typewriter});if("html_block"===t.type||"html_inline"===t.type){const i=String(null!=(o=t.tag)?o:"").trim().toLowerCase()||function(e){const t=String(null!=e?e:"").match(/^\s*<\s*([A-Z][\w:-]*)/i);return t?t[1].toLowerCase():""}(t.content),a=i?l[i]:null;if(a){const o={...t,type:i,tag:i,content:Fn(t.content,i)};return e.createElement(a,{key:n,node:o,customId:r.customId,isDark:r.isDark,ctx:r,renderNode:zn,indexKey:n,typewriter:r.typewriter})}}switch(t.type){case"text":/* @__PURE__ */
117
+ return M.jsx(Wn,{node:t,typewriter:r.typewriter},n);case"text_special":/* @__PURE__ */
118
+ return M.jsx(Wn,{node:{type:"text",content:null!=(i=t.content)?i:"",center:t.center},typewriter:r.typewriter},n);case"paragraph":/* @__PURE__ */
119
+ return M.jsx(Tn,{node:t,ctx:r,renderNode:zn,indexKey:n,typewriter:r.typewriter},n);case"heading":/* @__PURE__ */
120
+ return M.jsx(He,{node:t,ctx:r,renderNode:zn,indexKey:n,typewriter:r.typewriter},n);case"blockquote":/* @__PURE__ */
121
+ return M.jsx(Yn,{node:t,ctx:r,renderNode:zn,indexKey:n,typewriter:r.typewriter},n);case"list":/* @__PURE__ */
122
+ return M.jsx(kt,{node:t,ctx:r,renderNode:zn,indexKey:n,typewriter:r.typewriter},n);case"list_item":/* @__PURE__ */
123
+ return M.jsx(bt,{node:t,ctx:r,renderNode:zn,indexKey:n,typewriter:r.typewriter},n);case"table":/* @__PURE__ */
124
+ return M.jsx(Dn,{node:t,ctx:r,renderNode:zn,indexKey:n,typewriter:r.typewriter},n);case"definition_list":/* @__PURE__ */
125
+ return M.jsx(Oe,{node:t,ctx:r,renderNode:zn,indexKey:n,typewriter:r.typewriter},n);case"footnote":/* @__PURE__ */
126
+ return M.jsx(We,{node:t,ctx:r,renderNode:zn,indexKey:n,typewriter:r.typewriter},n);case"footnote_reference":/* @__PURE__ */
127
+ return M.jsx(Ae,{node:t},n);case"footnote_anchor":/* @__PURE__ */
128
+ return M.jsx(De,{node:t},n);case"admonition":/* @__PURE__ */
129
+ return M.jsx(_,{node:t,ctx:r,renderNode:zn,indexKey:n,isDark:r.isDark,typewriter:r.typewriter},n);case"hardbreak":/* @__PURE__ */
130
+ return M.jsx(Ie,{node:t,typewriter:r.typewriter},n);case"link":/* @__PURE__ */
131
+ return M.jsx(yt,{node:t,ctx:r,renderNode:zn,indexKey:n,isDark:r.isDark,typewriter:r.typewriter},n);case"image":/* @__PURE__ */
132
+ return M.jsx(vt,{node:t},n);case"inline_code":/* @__PURE__ */
133
+ return M.jsx(wt,{node:t,typewriter:r.typewriter},n);case"code_block":return function(t,n,r){var o,i,l,a;const s=ce(String(t.language||""));if("mermaid"===s){const o=H(r.customId).mermaid;if(o)return e.createElement(o,{key:n,node:t,isDark:r.isDark});if(!r.renderCodeBlocksAsPre)/* @__PURE__ */
134
+ return M.jsx(Mn,{node:t,isDark:r.isDark,loading:Boolean(t.loading)},n)}return r.renderCodeBlocksAsPre||"mermaid"===s?/* @__PURE__ */M.jsx(Te,{node:t},n):/* @__PURE__ */M.jsx($e,{node:t,loading:Boolean(t.loading),stream:r.codeBlockStream,monacoOptions:null==(o=r.codeBlockThemes)?void 0:o.monacoOptions,themes:null==(i=r.codeBlockThemes)?void 0:i.themes,minWidth:null==(l=r.codeBlockThemes)?void 0:l.minWidth,maxWidth:null==(a=r.codeBlockThemes)?void 0:a.maxWidth,isDark:r.isDark,onCopy:r.events.onCopy,...r.codeBlockProps||{}},n)}(t,n,r);case"strong":/* @__PURE__ */
135
+ return M.jsx(On,{node:t,children:S(t.children,r,`${String(n)}-strong`,zn)},n);case"emphasis":/* @__PURE__ */
136
+ return M.jsx(Re,{node:t,children:S(t.children,r,`${String(n)}-em`,zn)},n);case"strikethrough":/* @__PURE__ */
137
+ return M.jsx($n,{node:t,children:S(t.children,r,`${String(n)}-strike`,zn)},n);case"highlight":/* @__PURE__ */
138
+ return M.jsx(Ve,{node:t,children:S(t.children,r,`${String(n)}-highlight`,zn)},n);case"insert":/* @__PURE__ */
139
+ return M.jsx(xt,{node:t,children:S(t.children,r,`${String(n)}-insert`,zn)},n);case"subscript":/* @__PURE__ */
140
+ return M.jsx(Pn,{node:t,children:S(t.children,r,`${String(n)}-sub`,zn)},n);case"superscript":/* @__PURE__ */
141
+ return M.jsx(Rn,{node:t,children:S(t.children,r,`${String(n)}-sup`,zn)},n);case"checkbox":case"checkbox_input":/* @__PURE__ */
142
+ return M.jsx(X,{node:t,typewriter:r.typewriter},n);case"emoji":/* @__PURE__ */
143
+ return M.jsx(Pe,{node:t,typewriter:r.typewriter},n);case"thematic_break":/* @__PURE__ */
144
+ return M.jsx(An,{},n);case"math_inline":/* @__PURE__ */
145
+ return M.jsx(Ut,{node:t},n);case"math_block":/* @__PURE__ */
146
+ return M.jsx(qt,{node:t},n);case"reference":/* @__PURE__ */
147
+ return M.jsx(Ln,{node:t,ctx:r,typewriter:r.typewriter},n);case"html_block":case"html_inline":return"html_block"===t.type?/* @__PURE__ */M.jsx(tt,{node:t,typewriter:r.typewriter,customId:r.customId},n):/* @__PURE__ */M.jsx(ft,{node:t,typewriter:r.typewriter,customId:r.customId},n);case"vmr_container":/* @__PURE__ */
148
+ return M.jsx(In,{node:t,ctx:r,renderNode:zn,indexKey:n,typewriter:r.typewriter},n);case"label_open":case"label_close":return null;default:/* @__PURE__ */
149
+ return M.jsx(_n,{node:t},n)}}const Hn={codeBlockStream:!0,typewriter:!0,batchRendering:!0,initialRenderBatchSize:40,renderBatchSize:80,renderBatchDelay:16,renderBatchBudgetMs:6,renderBatchIdleTimeoutMs:120,deferNodesUntilVisible:!0,maxLiveNodes:320,liveNodeBuffer:60},Vn=d();function Kn(e){const t=String(null!=e?e:"").trim();if(!t)return"";const n=t.match(/^[<\s/]*([A-Z][\w-]*)/i);return n?n[1].toLowerCase():""}function Xn(e){return/^[a-z][a-z0-9-]*$/.test(e)}const qn=e.memo(({props:e,parsedNodes:r,renderCtx:o,indexPrefix:s,containerRef:c})=>{var d,u,m,h,p,f,g;const v=P(),w="undefined"!=typeof window,x="undefined"!=typeof window&&"function"==typeof window.requestIdleCallback,y=Math.max(0,Math.trunc(null!=(d=e.renderBatchSize)?d:80)),b=Math.max(0,Math.trunc(null!=(u=e.initialRenderBatchSize)?u:y||r.length)),k=!1!==e.batchRendering&&y>0&&w,j=Math.max(0,null!=(m=e.liveNodeBuffer)?m:60),N=Math.max(1,null!=(h=e.maxLiveNodes)?h:320),C=(null!=(p=e.maxLiveNodes)?p:0)>0&&r.length>N,S=!1!==e.viewportPriority,B=k&&(null!=(f=e.maxLiveNodes)?f:0)<=0,E=t(()=>{var t;return!1!==e.deferNodesUntilVisible&&!((null!=(t=e.maxLiveNodes)?t:0)<=0)&&!C&&!(r.length>900)&&S},[r.length,e.deferNodesUntilVisible,e.maxLiveNodes,S,C]),[_,T]=n(()=>B?Math.min(r.length,b):r.length),L=i(_);l(()=>{L.current=_},[_]);const $=B?_:r.length,[O,R]=n(0),[D,W]=n({start:0,end:r.length}),A=i(/* @__PURE__ */new Map),[I,F]=n(0),z=i({}),H=i(/* @__PURE__ */new Map),V=i(/* @__PURE__ */new Map),K=i(/* @__PURE__ */new Set),X=i(_),q=i(null),U=i(null),Y=i(null),Z=i(!1),J=i(null),G=i(Math.max(1,y||1)),Q=i(r.length),ee=i({key:e.indexKey,total:r.length}),te=i({batchSize:y,initial:b,delay:null!=(g=e.renderBatchDelay)?g:16,enabled:B}),ne=E||C,re=t(()=>{const e=A.current;if(!e.size)return 32;let t=0;for(const n of e.values())t+=n;return Math.max(16,t/e.size)},[I]),oe=t(()=>{if(!C)return r.map((e,t)=>({node:e,index:t}));const e=r.length,t=Math.max(0,Math.min(D.start,e)),n=Math.max(t,Math.min(D.end,e));return r.slice(t,n).map((e,n)=>({node:e,index:t+n}))},[r,D,C]),ie=t(()=>{if(!C)return r.length;const e=Math.max(D.end+j,b),t=Math.min(r.length,e);return Math.max(_,t)},[r.length,C,D.end,j,b,_]);Q.current=ie;const le=a((e,t)=>{var n;if(e>=t)return 0;const r=A.current;let o=0;for(let i=e;i<t;i++)o+=null!=(n=r.get(i))?n:re;return o},[re]),ae=C?le(0,Math.min(D.start,r.length)):0,se=C?le(Math.min(D.end,r.length),r.length):0,ce=a(()=>{null!=q.current&&"function"==typeof cancelAnimationFrame&&(cancelAnimationFrame(q.current),q.current=null),null!=U.current&&(window.clearTimeout(U.current),U.current=null),null!=Y.current&&"function"==typeof window.cancelIdleCallback&&(window.cancelIdleCallback(Y.current),Y.current=null),Z.current=!1,J.current=null},[]),de=a(t=>{var n;if(!B)return;const r=Math.max(2,null!=(n=e.renderBatchBudgetMs)?n:6),o=Math.max(1,y||1),i=Math.max(1,Math.floor(o/4));t>1.2*r?G.current=Math.max(i,Math.floor(.7*G.current)):t<.5*r&&G.current<o&&(G.current=Math.min(o,Math.ceil(1.2*G.current)))},[B,e.renderBatchBudgetMs,y]),ue=a((t,n={})=>{var r,o;if(!B)return;const i=Q.current;if(L.current>=i)return;const l=Math.max(1,t),a=e=>{const t="undefined"!=typeof performance?performance.now():Date.now();T(t=>{const n=Math.min(Q.current,t+Math.max(1,e));return L.current=n,n});const n="undefined"!=typeof performance?performance.now():Date.now();de(n-t)},s=()=>{const e=Math.max(1,Math.round(G.current));ue(e)},c=t=>{var n;q.current=null,U.current=null,Y.current=null,Z.current=!1;const r=J.current;if(J.current=null,a(null!=r?r:l),L.current>=Q.current)return;if(!t)return void s();const o=Math.max(2,null!=(n=e.renderBatchBudgetMs)?n:6);for(;L.current<Q.current&&!(("function"==typeof t.timeRemaining?t.timeRemaining():0)<=.5*o);)a(Math.max(1,Math.round(G.current)));L.current<Q.current&&s()};if(!w||n.immediate)return void c();const d=Math.max(0,null!=(r=e.renderBatchDelay)?r:16);if(J.current=null!=J.current?Math.max(J.current,l):l,!Z.current){if(Z.current=!0,x){const t=Math.max(0,null!=(o=e.renderBatchIdleTimeoutMs)?o:120);return void(Y.current=window.requestIdleCallback(e=>c(e),{timeout:t}))}"function"==typeof requestAnimationFrame?q.current=requestAnimationFrame(()=>{0!==d?U.current=window.setTimeout(()=>c(),d):c()}):U.current=window.setTimeout(()=>c(),d)}},[de,x,B,w,e.renderBatchDelay,e.renderBatchBudgetMs,e.renderBatchIdleTimeoutMs]);l(()=>{var t;const n=e.indexKey,o=r.length,i=ee.current,l=void 0!==n?n!==i.key:o!==i.total;ee.current={key:n,total:o};const a=te.current,s=null!=(t=e.renderBatchDelay)?t:16,c=a.batchSize!==y||a.initial!==b||a.delay!==s||a.enabled!==B;if(te.current={batchSize:y,initial:b,delay:s,enabled:B},(l||c||!B)&&ce(),(l||c)&&(G.current=Math.max(1,y||1),K.current.clear()),!o)return L.current=0,void T(0);const d=Q.current;if(!B)return L.current=d,void T(d);if(l||c){const e=Math.min(d,b);return L.current=e,T(e),void(e<d&&ue(Math.max(1,b),{immediate:!w}))}const u=Math.min(L.current,d);u!==L.current&&(L.current=u,T(u)),L.current<d&&ue(Math.max(1,y||1))},[ce,B,w,r.length,e.indexKey,e.renderBatchDelay,y,b,ue]),l(()=>{if(!C)return void W({start:0,end:r.length});const e=r.length;if(!e)return void W({start:0,end:0});const t=Math.max(0,Math.min(O,e-1));let n=Math.max(0,t-j),o=Math.min(e,t+j+1);const i=o-n;if(i>N){const e=i-N;n+=Math.ceil(e/2),o-=Math.floor(e/2)}else if(i<N){const t=N-i;n=Math.max(0,n-Math.ceil(t/2)),o=Math.min(e,o+Math.floor(t/2))}W({start:n,end:o})},[O,j,N,r.length,C]),l(()=>()=>{ce();for(const e of H.current.values())e.destroy();H.current.clear()},[ce]);const me=a(e=>{for(const[t,n]of H.current.entries())t>=e&&(n.destroy(),H.current.delete(t),delete z.current[t],V.current.delete(t))},[]);l(()=>{me($)},[me,$]),l(()=>{const e=r.length;let t=!1;for(const n of Array.from(A.current.keys()))n>=e&&(A.current.delete(n),t=!0);t&&F(e=>e+1);for(const n of Object.keys(z.current))Number(n)>=e&&delete z.current[n];for(const n of Array.from(K.current))n>=e&&K.current.delete(n)},[r.length]);const he=a((e,t)=>{E&&t&&(z.current[e]=!0),t&&C&&R(t=>e>t?e:t)},[E,C]),pe=a(e=>{const t=H.current.get(e);t&&(t.destroy(),H.current.delete(e))},[]),fe=a((e,t)=>{const n=V.current;if(t?n.set(e,t):n.delete(e),!ne||!t)return pe(e),E&&!t&&delete z.current[e],void(t&&he(e,!0));if(e<b&&!C)return pe(e),void he(e,!0);pe(e);const r=v(t,{rootMargin:"400px"});H.current.set(e,r),r.isVisible()&&he(e,!0),r.whenVisible.then(()=>he(e,!0)).catch(()=>{})},[E,pe,he,v,b,ne,C]),ge=a((e,t)=>{if(!t)return void(A.current.has(e)&&(A.current.delete(e),F(e=>e+1)));const n=()=>{const n=t.offsetHeight;n&&A.current.get(e)!==n&&(A.current.set(e,n),F(e=>e+1))};"function"==typeof queueMicrotask?queueMicrotask(n):Promise.resolve().then(n)},[]),ve=a(e=>!(B&&e>=L.current)&&(!E||e<b||!0===z.current[e]),[E,B,b]),we=a(e=>t=>{if(!e)return;const n=t.target;(null==n?void 0:n.closest("[data-node-index]"))&&e(t)},[]);l(()=>{for(const[e,t]of V.current.entries())t&&fe(e,t)},[fe]),l(()=>{C&&_>X.current&&R(_-1),X.current=_},[_,C]);const xe=C?/* @__PURE__ */M.jsx("div",{className:"node-spacer",style:{height:`${ae}px`},"aria-hidden":"true"}):null,ye=C?/* @__PURE__ */M.jsx("div",{className:"node-spacer",style:{height:`${se}px`},"aria-hidden":"true"}):null;/* @__PURE__ */
150
+ return M.jsxs("div",{ref:c,className:`markstream-vue markdown-renderer${e.isDark?" dark":""}${C?" virtualized":""}`,onClick:e.onClick,onMouseOver:we(e.onMouseOver),onMouseOut:we(e.onMouseOut),children:[xe,oe.map(({node:t,index:n})=>{var r;const i=ve(n),l=null!=(r=A.current.get(n))?r:re,a=!1!==e.typewriter&&"code_block"!==t.type&&!K.current.has(n)&&i;return a&&K.current.add(n),/* @__PURE__ */M.jsx("div",{ref:e=>fe(n,e),className:"node-slot","data-node-index":n,"data-node-type":t.type,children:i?/* @__PURE__ */M.jsx("div",{ref:e=>ge(n,e),className:"node-content"+(a?" typewriter-node":""),children:zn(t,`${s}-${n}`,o)}):/* @__PURE__ */M.jsx("div",{className:"node-placeholder",style:{height:`${l}px`}})},`${s}-${n}`)}),ye]})},function(e,t){if(e.parsedNodes!==t.parsedNodes)return!1;if(e.renderCtx!==t.renderCtx)return!1;if(e.indexPrefix!==t.indexPrefix)return!1;if(e.containerRef!==t.containerRef)return!1;const n=e.props,r=t.props;return n.isDark===r.isDark&&n.typewriter===r.typewriter&&n.batchRendering===r.batchRendering&&n.initialRenderBatchSize===r.initialRenderBatchSize&&n.renderBatchSize===r.renderBatchSize&&n.renderBatchDelay===r.renderBatchDelay&&n.renderBatchBudgetMs===r.renderBatchBudgetMs&&n.renderBatchIdleTimeoutMs===r.renderBatchIdleTimeoutMs&&n.deferNodesUntilVisible===r.deferNodesUntilVisible&&n.maxLiveNodes===r.maxLiveNodes&&n.liveNodeBuffer===r.liveNodeBuffer&&n.viewportPriority===r.viewportPriority&&n.indexKey===r.indexKey&&n.onClick===r.onClick&&n.onMouseOver===r.onMouseOver&&n.onMouseOut===r.onMouseOut}),Un=e=>{const n={...Hn,...e},r=i(null),o=i(null),a=s(I,F,F),c=t(()=>n.customId?`renderer-${n.customId}`:`renderer-${Date.now()}-${Math.random().toString(36).slice(2)}`,[n.customId]),m=t(()=>{const e=H(n.customId);return Object.keys(e).map(String).map(e=>e.trim().toLowerCase()).filter(Xn)},[n.customId,a]),h=t(()=>{var e,t,r;const o=null!=(t=(null!=(e=n.parseOptions)?e:{}).customHtmlTags)?t:[],i=[...null!=(r=n.customHtmlTags)?r:[],...Array.isArray(o)?o:[],...m].map(Kn).filter(Boolean);return Array.from(new Set(i))},[n.customId,n.customHtmlTags,n.parseOptions,m,a]),p=t(()=>{const e=h;return e&&0!==e.length?d(c,{customHtmlTags:e}):d(c)},[c,h]),f=t(()=>{const e=p;return n.customMarkdownIt?n.customMarkdownIt(e):e},[p,n.customMarkdownIt]),g=t(()=>{var e,t;const r=null!=(e=n.parseOptions)?e:{},o=null!=(t=n.final)?t:r.final,i=h;return i.length?{...r,final:o,customHtmlTags:i}:null==o?r:{...r,final:o}},[h,n.final,n.parseOptions]),v=t(()=>{var e,t;const r=Boolean(n.debugPerformance)&&"undefined"!=typeof console&&"undefined"!=typeof performance,o=r?performance.now():0;let i=[];return Array.isArray(n.nodes)&&n.nodes.length?i=n.nodes.map(e=>({...e})):n.content&&(i=u(n.content,null!=f?f:Vn,g)),r&&console.info("[markstream-react][perf] parse(sync)",{ms:Math.round(performance.now()-o),nodes:i.length,contentLength:null!=(t=null==(e=n.content)?void 0:e.length)?t:0}),i},[n.content,n.debugPerformance,n.nodes,g,f,n.customId,a,h]);if(l(()=>{var e,t;if("undefined"==typeof window)return;if(n.renderCodeBlocksAsPre)return;if(!v.some(e=>{var t;return"code_block"===(null==e?void 0:e.type)&&"mermaid"!==ce(String(null!=(t=null==e?void 0:e.language)?t:""))}))return;const r=null!=(e=window.requestIdleCallback)?e:(e,t)=>{var n;return window.setTimeout(()=>e({didTimeout:!0,timeRemaining:()=>0}),null!=(n=null==t?void 0:t.timeout)?n:600)},o=null!=(t=window.cancelIdleCallback)?t:e=>window.clearTimeout(e),i=r(()=>{ve()},{timeout:900});return()=>o(i)},[v,n.renderCodeBlocksAsPre]),"undefined"!=typeof window&&!n.renderCodeBlocksAsPre){const e=n.isDark?n.codeBlockDarkTheme:n.codeBlockLightTheme,t="string"==typeof e?e:"object"==typeof e&&e&&"name"in e?String(e.name):null;t&&o.current!==t&&(o.current=t,function(e){if(null==e)return;const t=function(e){if(null==e)return null;if("string"==typeof e)return e;if("object"==typeof e&&"name"in e)return String(e.name);try{return JSON.stringify(e)}catch{return String(e)}}(e);t&&Se!==t&&(Ce=e,Se=t,Be&&Ne(Ce,Be).then(()=>_e()).catch(()=>{}))}(e))}const w=t(()=>null!=n.indexKey?String(n.indexKey):"markdown-renderer",[n.indexKey]),x=t(()=>({customId:n.customId,isDark:n.isDark,indexKey:w,typewriter:n.typewriter,renderCodeBlocksAsPre:n.renderCodeBlocksAsPre,codeBlockStream:n.codeBlockStream,codeBlockProps:n.codeBlockProps,codeBlockThemes:{themes:n.themes,monacoOptions:n.codeBlockMonacoOptions,minWidth:n.codeBlockMinWidth,maxWidth:n.codeBlockMaxWidth},events:{onCopy:n.onCopy,onHandleArtifactClick:n.onHandleArtifactClick}}),[n.customId,n.isDark,w,n.typewriter,n.renderCodeBlocksAsPre,n.codeBlockStream,n.codeBlockProps,n.themes,n.codeBlockMonacoOptions,n.codeBlockMinWidth,n.codeBlockMaxWidth,n.onCopy,n.onHandleArtifactClick]);/* @__PURE__ */
151
+ return M.jsx(O,{getRoot:()=>r.current,enabled:!1!==n.viewportPriority,children:/* @__PURE__ */M.jsx(qn,{props:n,parsedNodes:v,renderCtx:x,indexPrefix:w,containerRef:r})})};function Yn(e){var t,n,r,o,i,l;const{node:a,ctx:s,renderNode:c,indexKey:d,children:u}=e;/* @__PURE__ */
152
+ return M.jsx("blockquote",{className:"blockquote-node",dir:"auto",cite:a.cite,children:null!=u?u:s&&c?/* @__PURE__ */M.jsx(Un,{nodes:a.children||[],indexKey:`blockquote-${String(null!=d?d:"blockquote")}`,customId:s.customId,isDark:s.isDark,typewriter:s.typewriter,viewportPriority:!0,codeBlockStream:s.codeBlockStream,renderCodeBlocksAsPre:s.renderCodeBlocksAsPre,codeBlockProps:s.codeBlockProps,themes:null==(t=s.codeBlockThemes)?void 0:t.themes,codeBlockDarkTheme:null==(n=s.codeBlockThemes)?void 0:n.darkTheme,codeBlockLightTheme:null==(r=s.codeBlockThemes)?void 0:r.lightTheme,codeBlockMonacoOptions:null==(o=s.codeBlockThemes)?void 0:o.monacoOptions,codeBlockMinWidth:null==(i=s.codeBlockThemes)?void 0:i.minWidth,codeBlockMaxWidth:null==(l=s.codeBlockThemes)?void 0:l.maxWidth,onCopy:s.events.onCopy,onHandleArtifactClick:s.events.onHandleArtifactClick}):null})}function Zn(e){const r={loading:!0,stream:!0,darkTheme:"vitesse-dark",lightTheme:"vitesse-light",isDark:!1,isShowPreview:!0,enableFontSizeControl:!0,showHeader:!0,showCopyButton:!0,showExpandButton:!0,showPreviewButton:!0,showFontSizeButtons:!0,...e},o=t(()=>{var e;return String(null!=(e=r.node.language)?e:"")},[r.node.language]),s=t(()=>function(e){var t;const[n]=String(null!=e?e:"").split(":");return(null!=(t=null==n?void 0:n.trim().toLowerCase())?t:"")||"plaintext"}(o),[o]),c=t(()=>ce(o),[o]),d=t(()=>{const e=me[c]||c;return e?e.charAt(0).toUpperCase()+e.slice(1):"Text"},[c]),u=t(()=>ue(c),[c]),{t:m}=Y(),h=t(()=>!!r.isShowPreview&&("html"===c||"svg"===c),[c,r.isShowPreview]),p=t(()=>{const e={},t=e=>{if(null!=e)return"number"==typeof e?`${e}px`:String(e)},n=t(r.minWidth),o=t(r.maxWidth);return n&&(e.minWidth=n),o&&(e.maxWidth=o),e},[r.maxWidth,r.minWidth]),[f,g]=n(!1),[v,w]=n(!1),[x,y]=n(!1),[b,k]=n(""),[j,N]=n(!1),[C,S]=n(14),[B,E]=n(C),_=i(null),T=i(null),L=i(null),$=i(null),O=i(!1),P=a(()=>r.isDark?r.darkTheme:r.lightTheme,[r.darkTheme,r.isDark,r.lightTheme]),R=a(e=>{if(!e)return k(""),void N(!1);var t;k(`<pre class="shiki shiki-fallback"><code>${t=e,t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}</code></pre>`),N(!1)},[]),D=a(()=>{k(""),N(!0)},[]),W=a(async()=>{if(!$.current&&!O.current){O.current=!0;try{const e=await import("stream-markdown");$.current=e.createShikiStreamRenderer}catch{}}},[]),A=a(async()=>{if(await W(),_.current&&T.current)if(!L.current&&$.current&&(L.current=$.current(T.current,{theme:P(),themes:r.themes}),N(!0)),L.current)if(!1===r.stream&&r.loading)R(r.node.code);else{R(r.node.code);try{await L.current.updateCode(r.node.code,s),D()}catch{}}else R(r.node.code);else R(r.node.code)},[D,W,P,s,r.loading,r.node.code,r.stream,r.themes,R]);l(()=>(A(),()=>{var e;null==(e=L.current)||e.dispose(),L.current=null}),[A]),l(()=>{L.current&&L.current.setTheme(P())},[P]),l(()=>{L.current&&(!1===r.stream&&r.loading||(R(r.node.code),Promise.resolve(L.current.updateCode(r.node.code,s)).then(()=>D()).catch(()=>{})))},[D,s,r.loading,r.node.code,r.stream,R]);const I=a((e,t)=>{oe(e.currentTarget,t,"top",!1,(e.clientX,e.clientY),r.isDark)},[r.isDark]),F=a(()=>ie(),[]),z=a(async()=>{var e;try{"undefined"!=typeof navigator&&navigator.clipboard&&"function"==typeof navigator.clipboard.writeText&&await navigator.clipboard.writeText(r.node.code),g(!0),null==(e=r.onCopy)||e.call(r,r.node.code),setTimeout(()=>g(!1),1e3)}catch{}},[r]),H=a(()=>{var e;if(!h)return;const t="html"===s?"text/html":"image/svg+xml",n="html"===s?"HTML Preview":"SVG Preview";null==(e=r.onPreviewCode)||e.call(r,{type:t,content:r.node.code,title:n})},[h,s,r]),V=t(()=>({fontSize:`${B}px`}),[B]);return l(()=>{S(14),E(14)},[]),/* @__PURE__ */M.jsxs("div",{className:["code-block-container my-4 rounded-lg border overflow-hidden shadow-sm",r.isDark?"border-gray-700/30 bg-gray-900 is-dark":"border-gray-200 bg-white"].join(" "),style:p,children:[r.showHeader&&/* @__PURE__ */M.jsxs("div",{className:"code-block-header flex justify-between items-center px-4 py-2.5 border-b border-gray-400/5",style:{color:"var(--vscode-editor-foreground)",backgroundColor:"var(--vscode-editor-background)"},children:[
153
153
  /* @__PURE__ */M.jsxs("div",{className:"flex items-center space-x-2",children:[
154
154
  /* @__PURE__ */M.jsx("span",{className:"icon-slot h-4 w-4 flex-shrink-0",dangerouslySetInnerHTML:{__html:u}}),
155
155
  /* @__PURE__ */M.jsx("span",{className:"text-sm font-medium font-mono",children:d})]}),
@@ -163,10 +163,10 @@ return M.jsx("blockquote",{className:"blockquote-node",dir:"auto",cite:a.cite,ch
163
163
  /* @__PURE__ */M.jsx("rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2"}),
164
164
  /* @__PURE__ */M.jsx("path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2"})]})})}),r.showExpandButton&&/* @__PURE__ */M.jsx("button",{type:"button",className:"code-action-btn p-2 text-xs rounded-md transition-colors hover:bg-[var(--vscode-editor-selectionBackground)]","aria-pressed":v,onClick:()=>w(e=>!e),onMouseEnter:e=>I(e,v?m("common.collapse")||"Collapse":m("common.expand")||"Expand"),onFocus:e=>I(e,v?m("common.collapse")||"Collapse":m("common.expand")||"Expand"),onMouseLeave:F,onBlur:F,children:v?/* @__PURE__ */M.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink","aria-hidden":"true",role:"img",width:"1em",height:"1em",viewBox:"0 0 24 24",className:"w-3 h-3",children:/* @__PURE__ */M.jsx("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M15 3h6v6m0-6l-7 7M3 21l7-7m-1 7H3v-6"})}):/* @__PURE__ */M.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink","aria-hidden":"true",role:"img",width:"1em",height:"1em",viewBox:"0 0 24 24",className:"w-3 h-3",children:/* @__PURE__ */M.jsx("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"m14 10l7-7m-1 7h-6V4M3 21l7-7m-6 0h6v6"})})}),h&&r.showPreviewButton&&/* @__PURE__ */M.jsx("button",{type:"button",className:"code-action-btn p-2 text-xs rounded-md transition-colors hover:bg-[var(--vscode-editor-selectionBackground)]","aria-label":m("common.preview")||"Preview",onClick:H,onMouseEnter:e=>I(e,m("common.preview")||"Preview"),onFocus:e=>I(e,m("common.preview")||"Preview"),onMouseLeave:F,onBlur:F,children:/* @__PURE__ */M.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink","aria-hidden":"true",role:"img",width:"1em",height:"1em",viewBox:"0 0 24 24",className:"w-3 h-3",children:/* @__PURE__ */M.jsxs("g",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",children:[
165
165
  /* @__PURE__ */M.jsx("path",{d:"M2.062 12.348a1 1 0 0 1 0-.696a10.75 10.75 0 0 1 19.876 0a1 1 0 0 1 0 .696a10.75 10.75 0 0 1-19.876 0"}),
166
- /* @__PURE__ */M.jsx("circle",{cx:"12",cy:"12",r:"3"})]})})})]})]}),!x&&(!!r.stream||!r.loading)&&/* @__PURE__ */M.jsxs("div",{ref:T,className:"code-block-content",style:{...V,maxHeight:v?"none":"500px",overflow:v?"visible":"auto"},children:[
167
- /* @__PURE__ */M.jsx("div",{ref:_,className:"code-block-render"}),!j&&k&&/* @__PURE__ */M.jsx("div",{className:"code-fallback-plain",dangerouslySetInnerHTML:{__html:k}})]}),!r.stream&&r.loading&&/* @__PURE__ */M.jsx("div",{className:"code-loading-placeholder",children:/* @__PURE__ */M.jsxs("div",{className:"loading-skeleton",children:[
166
+ /* @__PURE__ */M.jsx("circle",{cx:"12",cy:"12",r:"3"})]})})})]})]}),!x&&(!!r.stream||!r.loading)&&/* @__PURE__ */M.jsxs("div",{ref:_,className:"code-block-content",style:{...V,maxHeight:v?"none":"500px",overflow:v?"visible":"auto"},children:[
167
+ /* @__PURE__ */M.jsx("div",{ref:T,className:"code-block-render"}),!j&&b&&/* @__PURE__ */M.jsx("div",{className:"code-fallback-plain",dangerouslySetInnerHTML:{__html:b}})]}),!r.stream&&r.loading&&/* @__PURE__ */M.jsx("div",{className:"code-loading-placeholder",children:/* @__PURE__ */M.jsxs("div",{className:"loading-skeleton",children:[
168
168
  /* @__PURE__ */M.jsx("div",{className:"skeleton-line"}),
169
169
  /* @__PURE__ */M.jsx("div",{className:"skeleton-line"}),
170
170
  /* @__PURE__ */M.jsx("div",{className:"skeleton-line short"})]})}),
171
- /* @__PURE__ */M.jsx("span",{className:"sr-only","aria-live":"polite",role:"status",children:f?m("common.copied")||"Copied":""})]})}function Bt(e){var r;const o=i(null),[a,s]=t(!1),[c,d]=t({transform:"translate3d(0px, 0px, 0px)",left:"0px",top:"0px"}),u=n(()=>function(e){if("boolean"==typeof e)return e;if("undefined"!=typeof document)try{if(document.documentElement.classList.contains("dark"))return!0}catch{}if("undefined"!=typeof window&&"function"==typeof window.matchMedia)try{return window.matchMedia("(prefers-color-scheme: dark)").matches}catch{}return!1}(e.isDark),[e.isDark]);return l(()=>{if(!e.visible)return void s(!1);if(!e.anchorEl||!o.current)return void s(!0);let n=null,t=!1;const r=async()=>{var n,r;if(!e.anchorEl||!o.current)return;const{x:i,y:l}=await h(e.anchorEl,o.current,{placement:null!=(n=e.placement)?n:"top",middleware:[p(null!=(r=e.offset)?r:8),f(),g({padding:8})],strategy:"fixed"});t||d({position:"fixed",left:"0px",top:"0px",transform:`translate3d(${Math.round(i)}px, ${Math.round(l)}px, 0)`})};return r().then(()=>{t||s(!0)}),n=m(e.anchorEl,o.current,r),()=>{t=!0,null==n||n()}},[e.anchorEl,e.offset,e.placement,e.visible]),"undefined"==typeof document?null:e.visible&&a?v(
172
- /* @__PURE__ */M.jsx("div",{id:null!=(r=e.id)?r:void 0,ref:o,style:c,className:["ms-tooltip z-[9999] inline-block text-base py-2 px-3 rounded-md shadow-md whitespace-nowrap pointer-events-none border tooltip-element",u?"bg-gray-900 text-white border-gray-700 is-dark":"bg-white text-gray-900 border-gray-200"].join(" "),role:"tooltip",children:e.content}),document.body):null}export{T as AdmonitionNode,Ct as BlockquoteNode,X as CheckboxNode,$e as CodeBlockNode,Pe as DefinitionListNode,Re as EmojiNode,De as EmphasisNode,at as FallbackComponent,Oe as FootnoteAnchorNode,Ae as FootnoteNode,We as FootnoteReferenceNode,Ie as HardBreakNode,He as HeadingNode,Ve as HighlightNode,Ke as HtmlBlockNode,Xe as HtmlInlineNode,he as HtmlPreviewFrame,qe as ImageNode,Ye as InlineCodeNode,Ze as InsertNode,Je as LinkNode,Ge as ListItemNode,Qe as ListNode,Rn as MERMAID_WORKER_BUSY_CODE,St as MarkdownCodeBlockNode,Nn as MathBlockNode,Cn as MathInlineNode,nt as MermaidBlockNode,Nt as NodeRenderer,st as ParagraphNode,_e as PreCodeNode,$e as ReactCodeBlockNode,ct as ReferenceNode,dt as StrikethroughNode,ut as StrongNode,mt as SubscriptNode,ht as SuperscriptNode,pt as TableNode,ft as TextNode,gt as ThematicBreakNode,Bt as Tooltip,vt as VmrContainerNode,mn as WORKER_BUSY_CODE,Wn as canParseOffthread,K as clearGlobalCustomComponents,fn as clearKaTeXCache,dn as clearKaTeXWorker,On as clearMermaidWorker,In as findPrefixOffthread,H as getCustomNodeComponents,yn as getKaTeXBackpressureDefaults,ue as getLanguageIcon,Pn as getMermaidWorkerLoad,me as languageMap,ce as normalizeLanguageIdentifier,V as removeCustomComponents,hn as renderKaTeXInWorker,kn as renderKaTeXWithBackpressure,xt as renderNode,de as resolveMonacoLanguageId,z as setCustomComponents,q as setDefaultI18nMap,xn as setKaTeXBackpressureDefaults,pn as setKaTeXCache,gn as setKaTeXConcurrencyLimit,cn as setKaTeXWorker,un as setKaTeXWorkerDebug,ae as setLanguageIconResolver,Dn as setMermaidWorker,Ln as setMermaidWorkerClientDebug,$n as setMermaidWorkerMaxConcurrency,Fn as terminateWorker,Y as useSafeI18n,vn as waitForKaTeXWorkerSlot};
171
+ /* @__PURE__ */M.jsx("span",{className:"sr-only","aria-live":"polite",role:"status",children:f?m("common.copied")||"Copied":""})]})}function Jn(e){var r;const o=i(null),[a,s]=n(!1),[c,d]=n({transform:"translate3d(0px, 0px, 0px)",left:"0px",top:"0px"}),u=t(()=>function(e){if("boolean"==typeof e)return e;if("undefined"!=typeof document)try{if(document.documentElement.classList.contains("dark"))return!0}catch{}if("undefined"!=typeof window&&"function"==typeof window.matchMedia)try{return window.matchMedia("(prefers-color-scheme: dark)").matches}catch{}return!1}(e.isDark),[e.isDark]);return l(()=>{if(!e.visible)return void s(!1);if(!e.anchorEl||!o.current)return void s(!0);let t=null,n=!1;const r=async()=>{var t,r;if(!e.anchorEl||!o.current)return;const{x:i,y:l}=await h(e.anchorEl,o.current,{placement:null!=(t=e.placement)?t:"top",middleware:[p(null!=(r=e.offset)?r:8),f(),g({padding:8})],strategy:"fixed"});n||d({position:"fixed",left:"0px",top:"0px",transform:`translate3d(${Math.round(i)}px, ${Math.round(l)}px, 0)`})};return r().then(()=>{n||s(!0)}),t=m(e.anchorEl,o.current,r),()=>{n=!0,null==t||t()}},[e.anchorEl,e.offset,e.placement,e.visible]),"undefined"==typeof document?null:e.visible&&a?v(
172
+ /* @__PURE__ */M.jsx("div",{id:null!=(r=e.id)?r:void 0,ref:o,style:c,className:["ms-tooltip z-[9999] inline-block text-base py-2 px-3 rounded-md shadow-md whitespace-nowrap pointer-events-none border tooltip-element",u?"bg-gray-900 text-white border-gray-700 is-dark":"bg-white text-gray-900 border-gray-200"].join(" "),role:"tooltip",children:e.content}),document.body):null}export{_ as AdmonitionNode,Yn as BlockquoteNode,X as CheckboxNode,$e as CodeBlockNode,Oe as DefinitionListNode,Pe as EmojiNode,Re as EmphasisNode,_n as FallbackComponent,De as FootnoteAnchorNode,We as FootnoteNode,Ae as FootnoteReferenceNode,Ie as HardBreakNode,He as HeadingNode,Ve as HighlightNode,tt as HtmlBlockNode,ft as HtmlInlineNode,he as HtmlPreviewFrame,vt as ImageNode,wt as InlineCodeNode,xt as InsertNode,yt as LinkNode,bt as ListItemNode,kt as ListNode,rn as MERMAID_WORKER_BUSY_CODE,Zn as MarkdownCodeBlockNode,qt as MathBlockNode,Ut as MathInlineNode,Mn as MermaidBlockNode,Un as NodeRenderer,Tn as ParagraphNode,Te as PreCodeNode,$e as ReactCodeBlockNode,Ln as ReferenceNode,$n as StrikethroughNode,On as StrongNode,Pn as SubscriptNode,Rn as SuperscriptNode,Dn as TableNode,Wn as TextNode,An as ThematicBreakNode,Jn as Tooltip,In as VmrContainerNode,Ot as WORKER_BUSY_CODE,sn as canParseOffthread,K as clearGlobalCustomComponents,Dt as clearKaTeXCache,Lt as clearKaTeXWorker,ln as clearMermaidWorker,cn as findPrefixOffthread,H as getCustomNodeComponents,zt as getKaTeXBackpressureDefaults,ue as getLanguageIcon,nn as getMermaidWorkerLoad,me as languageMap,ce as normalizeLanguageIdentifier,V as removeCustomComponents,Pt as renderKaTeXInWorker,Ht as renderKaTeXWithBackpressure,zn as renderNode,de as resolveMonacoLanguageId,z as setCustomComponents,U as setDefaultI18nMap,Ft as setKaTeXBackpressureDefaults,Rt as setKaTeXCache,Wt as setKaTeXConcurrencyLimit,Tt as setKaTeXWorker,$t as setKaTeXWorkerDebug,ae as setLanguageIconResolver,on as setMermaidWorker,en as setMermaidWorkerClientDebug,tn as setMermaidWorkerMaxConcurrency,dn as terminateWorker,Y as useSafeI18n,At as waitForKaTeXWorkerSlot};