markstream-react 0.0.3-beta.4 → 0.0.3-beta.5
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.css +1 -1
- package/dist/index.js +205 -172
- package/dist/index.tailwind.css +1 -1
- package/dist/tailwind.ts +1 -1
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -1,172 +1,205 @@
|
|
|
1
|
-
import e,{useMemo as t,useState as n,useContext as r,createContext 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 w}from"react-dom";var v,x,y,b={exports:{}},k={},j={};var M=(y||(y=1,"production"===process.env.NODE_ENV?b.exports=function(){if(v)return k;v=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,w=n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function v(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=w.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&&v("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,$=w.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&&v("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=w.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 v("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=w.ReactCurrentOwner,G={key:!0,ref:!0,__self:!0,__source:!0},Q=w.ReactCurrentOwner,ee=w.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),v('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,w,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,v("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,v("%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,v("%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,w,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 v("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]||(v('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),v("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),v("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),v("%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),v("Failed %s type: %s",n,a.message),H(null))}}(t,e.props,"prop",r,e)}else void 0===n.PropTypes||Z||(Z=!0,v("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",y(n)||"Unknown"));"function"!=typeof n.getDefaultProps||n.getDefaultProps.isReactClassApproved||v("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__ */
|
|
3
|
-
return
|
|
4
|
-
return
|
|
5
|
-
/* @__PURE__ */
|
|
6
|
-
/* @__PURE__ */
|
|
7
|
-
return
|
|
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:w(
|
|
9
|
-
/* @__PURE__ */
|
|
10
|
-
/* @__PURE__ */
|
|
11
|
-
/* @__PURE__ */
|
|
12
|
-
/* @__PURE__ */
|
|
13
|
-
/* @__PURE__ */
|
|
14
|
-
/* @__PURE__ */
|
|
15
|
-
/* @__PURE__ */
|
|
16
|
-
return
|
|
17
|
-
/* @__PURE__ */
|
|
18
|
-
/* @__PURE__ */
|
|
19
|
-
/* @__PURE__ */
|
|
20
|
-
/* @__PURE__ */
|
|
21
|
-
/* @__PURE__ */
|
|
22
|
-
/* @__PURE__ */
|
|
23
|
-
/* @__PURE__ */
|
|
24
|
-
/* @__PURE__ */
|
|
25
|
-
/* @__PURE__ */
|
|
26
|
-
/* @__PURE__ */
|
|
27
|
-
/* @__PURE__ */
|
|
28
|
-
/* @__PURE__ */
|
|
29
|
-
/* @__PURE__ */
|
|
30
|
-
/* @__PURE__ */
|
|
31
|
-
/* @__PURE__ */
|
|
32
|
-
/* @__PURE__ */
|
|
33
|
-
/* @__PURE__ */
|
|
34
|
-
/* @__PURE__ */
|
|
35
|
-
/* @__PURE__ */
|
|
36
|
-
/* @__PURE__ */
|
|
37
|
-
return
|
|
38
|
-
/* @__PURE__ */
|
|
39
|
-
/* @__PURE__ */
|
|
40
|
-
return
|
|
41
|
-
return
|
|
42
|
-
return
|
|
43
|
-
return
|
|
44
|
-
return
|
|
45
|
-
return
|
|
46
|
-
return
|
|
47
|
-
return
|
|
48
|
-
return
|
|
49
|
-
/* @__PURE__ */
|
|
50
|
-
/* @__PURE__ */
|
|
51
|
-
/* @__PURE__ */
|
|
52
|
-
return
|
|
53
|
-
/* @__PURE__ */
|
|
54
|
-
/* @__PURE__ */
|
|
55
|
-
/* @__PURE__ */
|
|
56
|
-
/* @__PURE__ */
|
|
57
|
-
/* @__PURE__ */
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
/* @__PURE__ */
|
|
61
|
-
/* @__PURE__ */
|
|
62
|
-
|
|
63
|
-
return
|
|
64
|
-
|
|
65
|
-
/* @__PURE__ */
|
|
66
|
-
/* @__PURE__ */
|
|
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,wn={USE_PROFILES:{svg:!0},FORBID_TAGS:["script"],FORBID_ATTR:[/^on/i],ADD_TAGS:["style"],ADD_ATTR:["style"],SAFE_FOR_TEMPLATES:!0},vn=[/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(vn.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(),v=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),we=i({zoom:1,translateX:0,translateY:0,containerHeight:Z||"360px"}),ve=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:wn,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=ve(e,{rootMargin:"400px"});return fe.current=t,t.isVisible()&&Q(!0),t.whenVisible.then(()=>Q(!0)),()=>{t.destroy(),fe.current=null}},[ve]),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=we.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 we.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__ */
|
|
69
|
-
/* @__PURE__ */
|
|
70
|
-
/* @__PURE__ */
|
|
71
|
-
/* @__PURE__ */
|
|
72
|
-
/* @__PURE__ */
|
|
73
|
-
/* @__PURE__ */
|
|
74
|
-
/* @__PURE__ */
|
|
75
|
-
/* @__PURE__ */
|
|
76
|
-
/* @__PURE__ */
|
|
77
|
-
/* @__PURE__ */
|
|
78
|
-
/* @__PURE__ */
|
|
79
|
-
/* @__PURE__ */
|
|
80
|
-
/* @__PURE__ */
|
|
81
|
-
/* @__PURE__ */
|
|
82
|
-
/* @__PURE__ */
|
|
83
|
-
/* @__PURE__ */
|
|
84
|
-
/* @__PURE__ */
|
|
85
|
-
/* @__PURE__ */
|
|
86
|
-
/* @__PURE__ */
|
|
87
|
-
/* @__PURE__ */
|
|
88
|
-
/* @__PURE__ */
|
|
89
|
-
/* @__PURE__ */
|
|
90
|
-
/* @__PURE__ */
|
|
91
|
-
return
|
|
92
|
-
|
|
93
|
-
/* @__PURE__ */
|
|
94
|
-
/* @__PURE__ */
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
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__ */
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
/* @__PURE__ */
|
|
109
|
-
/* @__PURE__ */
|
|
110
|
-
/* @__PURE__ */
|
|
111
|
-
|
|
112
|
-
/* @__PURE__ */
|
|
113
|
-
/* @__PURE__ */
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
return
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
return
|
|
132
|
-
return
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
return
|
|
136
|
-
return
|
|
137
|
-
return
|
|
138
|
-
return
|
|
139
|
-
return
|
|
140
|
-
return
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
return
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
return
|
|
148
|
-
return
|
|
149
|
-
return
|
|
150
|
-
return
|
|
151
|
-
return
|
|
152
|
-
return
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
1
|
+
import e,{useMemo as t,useState as n,useContext as r,createContext as o,useRef as i,useEffect as s,useCallback as a,useSyncExternalStore as l,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 x}from"react-dom";var w,v,y,k={exports:{}},b={},j={};var C=(y||(y=1,"production"===process.env.NODE_ENV?k.exports=function(){if(w)return b;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,s={key:!0,ref:!0,__self:!0,__source:!0};function a(e,t,r){var a,l={},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)&&!s.hasOwnProperty(a)&&(l[a]=t[a]);if(e&&e.defaultProps)for(a in t=e.defaultProps)void 0===l[a]&&(l[a]=t[a]);return{$$typeof:n,type:e,key:c,ref:d,props:l,_owner:i.current}}return b.Fragment=r,b.jsx=a,b.jsxs=a,b}():k.exports=(v||(v=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"),s=/* @__PURE__ */Symbol.for("react.strict_mode"),a=/* @__PURE__ */Symbol.for("react.profiler"),l=/* @__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,x=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=x.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 v(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 s:return"StrictMode";case u:return"Suspense";case m:return"SuspenseList"}if("object"==typeof e)switch(e.$$typeof){case c:return v(e)+".Consumer";case l:return v(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 k,b,C,M,N,S,L,B=Object.assign,E=0;function T(){}T.__reactDisabledLog=!0;var _,$=x.ReactCurrentDispatcher;function D(e,t,n){if(void 0===_)try{throw Error()}catch(o){var r=o.stack.trim().match(/\n( *(at )?)/);_=r&&r[1]||""}return"\n"+_+e}var O,P=!1,R="function"==typeof WeakMap?WeakMap:Map;function W(e,t){if(!e||P)return"";var n,r=O.get(e);if(void 0!==r)return r;P=!0;var o,i=Error.prepareStackTrace;Error.prepareStackTrace=void 0,o=$.current,$.current=null,function(){if(0===E){k=console.log,b=console.info,C=console.warn,M=console.error,N=console.group,S=console.groupCollapsed,L=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})}E++}();try{if(t){var s=function(){throw Error()};if(Object.defineProperty(s.prototype,"props",{set:function(){throw Error()}}),"object"==typeof Reflect&&Reflect.construct){try{Reflect.construct(s,[])}catch(p){n=p}Reflect.construct(e,[],s)}else{try{s.call()}catch(p){n=p}e.call(s.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"),l=n.stack.split("\n"),c=a.length-1,d=l.length-1;c>=1&&d>=0&&a[c]!==l[d];)d--;for(;c>=1&&d>=0;c--,d--)if(a[c]!==l[d]){if(1!==c||1!==d)do{if(c--,--d<0||a[c]!==l[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&&O.set(e,u),u}}while(c>=1&&d>=0);break}}}finally{P=!1,$.current=o,function(){if(0===--E){var e={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:B({},e,{value:k}),info:B({},e,{value:b}),warn:B({},e,{value:C}),error:B({},e,{value:M}),group:B({},e,{value:N}),groupCollapsed:B({},e,{value:S}),groupEnd:B({},e,{value:L})})}E<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?D(m):"";return"function"==typeof e&&O.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 D(e);switch(e){case u:return D("Suspense");case m:return D("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,s=o._init;try{return A(s(i),t,n)}catch(a){}}return""}O=new R;var I=Object.prototype.hasOwnProperty,F={},z=x.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 U(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 q,Y,Z,J=x.ReactCurrentOwner,G={key:!0,ref:!0,__self:!0,__source:!0},Q=x.ReactCurrentOwner,ee=x.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 se(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,s=o.call(e);!(i=s.next()).done;)ne(i.value)&&ie(i.value,t)}}var ae={};function le(e,n,o,g,x,v){var k=function(e){return"string"==typeof e||"function"==typeof e||e===i||e===a||e===s||e===u||e===m||e===f||"object"==typeof e&&null!==e&&(e.$$typeof===p||e.$$typeof===h||e.$$typeof===l||e.$$typeof===c||e.$$typeof===d||e.$$typeof===t||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 C=function(e,t,n,o,i){var s,a={},l=null,c=null;for(s in void 0!==n&&(U(n),l=""+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)&&(U(t.key),l=""+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,s)&&!G.hasOwnProperty(s)&&(a[s]=t[s]);if(e&&e.defaultProps){var d=e.defaultProps;for(s in d)void 0===a[s]&&(a[s]=d[s])}if(l||c){var u="function"==typeof e?e.displayName||e.name||"Unknown":e;l&&function(e,t){var n=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)",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,s,a){var l={$$typeof:r,type:e,key:t,ref:n,props:a,_owner:s,_store:{}};return Object.defineProperty(l._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(l,"_self",{configurable:!1,enumerable:!1,writable:!1,value:o}),Object.defineProperty(l,"_source",{configurable:!1,enumerable:!1,writable:!1,value:i}),Object.freeze&&(Object.freeze(l.props),Object.freeze(l)),l}(e,l,c,i,o,J.current,a)}(e,n,o,x,v);if(null==C)return C;if(k){var M=n.children;if(void 0!==M)if(g)if(K(M)){for(var N=0;N<M.length;N++)se(M[N],e);Object.freeze&&Object.freeze(M)}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 se(M,e)}if(I.call(n,"key")){var S=y(e),L=Object.keys(n).filter(function(e){return"key"!==e}),B=L.length>0?"{key: someKey, "+L.join(": ..., ")+": ...}":"{key: someKey}";ae[S+B]||(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} />',B,S,L.length>0?"{"+L.join(": ..., ")+": ...}":"{}",S),ae[S+B]=!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))}(C):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 s in e)if(i(e,s)){var a=void 0;try{if("function"!=typeof e[s]){var l=Error((r||"React class")+": "+n+" type `"+s+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[s]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw l.name="Invariant Violation",l}a=e[s](t,s,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,s,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.")}}(C),C}j.Fragment=i,j.jsx=function(e,t,n){return le(e,t,n,!1)},j.jsxs=function(e,t,n){return le(e,t,n,!0)}}()),j)),k.exports);const M=/* @__PURE__ */new Set(["image","table","code_block","html_block","html_inline","blockquote","list","list_item","definition_list","footnote","footnote_reference","footnote_anchor","admonition","thematic_break","math_block","thinking","vmr_container"]);function N(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 s=e[i];if(s){if("label_open"===s.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 l=`${n}-label-${i}`;o.push(
|
|
2
|
+
/* @__PURE__ */C.jsx("label",{...N(s.attrs),children:S(a,t,`${l}-child`,r)},l));continue}"label_close"!==s.type&&o.push(r(s,`${n}-${i}`,t))}}return o}function L(e,t,n,r){/* @__PURE__ */
|
|
3
|
+
return C.jsx(C.Fragment,{children:S(e,t,`${n}-inline`,r)})}const B={note:"ℹ️",info:"ℹ️",tip:"💡",warning:"⚠️",danger:"❗",error:"⛔",caution:"⚠️"};function E(e){const{node:r,ctx:o,renderNode:i,indexKey:s,isDark:a}=e,l=String(r.kind||"note"),c=t(()=>r.title&&String(r.title).trim().length?String(r.title):l.charAt(0).toUpperCase()+l.slice(1),[l,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
|
+
return C.jsxs("div",{className:`admonition admonition-${l}${a?" is-dark":""}`,"data-index-key":s,children:[
|
|
5
|
+
/* @__PURE__ */C.jsxs("div",{id:m,className:"admonition-header",children:[B[l]&&/* @__PURE__ */C.jsx("span",{className:"admonition-icon",children:B[l]}),
|
|
6
|
+
/* @__PURE__ */C.jsx("span",{className:"admonition-title",children:c}),r.collapsible&&/* @__PURE__ */C.jsx("button",{type:"button",className:"admonition-toggle","aria-expanded":!d,"aria-controls":`${m}-content`,title:d?"Expand":"Collapse",onClick:()=>u(e=>!e),children:/* @__PURE__ */C.jsx("span",{children:d?"▶":"▼"})})]}),!d&&/* @__PURE__ */C.jsx("div",{id:`${m}-content`,className:"admonition-content","aria-labelledby":m,children:o&&i?S(r.children,o,String(null!=s?s:m),i):null})]})}const T=o(null);function _(e,t){const n="undefined"!=typeof window&&"undefined"!=typeof document,r=/* @__PURE__ */new Map;return(o,i)=>{var s,a;const l={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 l.current=!0,c(),{isVisible:()=>!0,whenVisible:u,destroy:m};const h=((t,o)=>{var i,s;if(!n)return null;if("undefined"==typeof IntersectionObserver)return null;const a=null!=(i=e())?i:null,l=`${t}::${o}`,c=r.get(l);if(c&&c.root===a)return c;if(c){try{c.observer.disconnect()}catch{}r.delete(l)}const d=null!=(s=null==c?void 0:c.targets)?s:/* @__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(l,m);for(const e of d.keys())u.observe(e);return m})(null!=(s=null==i?void 0:i.rootMargin)?s:"300px",null!=(a=null==i?void 0:i.threshold)?a:0);return h?(h.targets.set(o,{resolve:c,state:l}),h.observer.observe(o),{isVisible:()=>l.current,whenVisible:u,destroy:m}):(l.current=!0,c(),{isVisible:()=>!0,whenVisible:u,destroy:m})}}const $=_(()=>null,()=>!0);function D({getRoot:e,enabled:n=!0,children:r}){const o=i(n);o.current=n;const s=i(e);s.current=e;const a=t(()=>_(()=>{var e,t;return null!=(t=null==(e=s.current)?void 0:e.call(s))?t:null},()=>o.current),[]);/* @__PURE__ */
|
|
7
|
+
return C.jsx(T.Provider,{value:a,children:r})}function O(){var e;return null!=(e=r(T))?e:$}const P="__global__",R="__MARKSTREAM_REACT_CUSTOM_COMPONENTS_STORE__",W=(()=>{const e=globalThis;if(e[R])return e[R];const t={scopedComponents:{},revision:0,listeners:/* @__PURE__ */new Set};return e[R]=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[P]={...e},A()}function H(e){const t=W.scopedComponents[P]||{};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===P)throw new Error("removeCustomComponents: cannot delete global mapping; call clearGlobalCustomComponents instead.");delete W.scopedComponents[e],A()}function K(){delete W.scopedComponents[P],A()}function X(e){const{node:t}=e;/* @__PURE__ */
|
|
8
|
+
return C.jsx("span",{className:"checkbox-node",children:/* @__PURE__ */C.jsx("input",{type:"checkbox",checked:Boolean(t.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 t;return null!=(t=U[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 s=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?s():Q=setTimeout(s,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 se=null;function ae(e){se=null!=e?e:null}const le={"":"",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=le[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(se){const t=se(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 s(()=>{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:x(
|
|
9
|
+
/* @__PURE__ */C.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__ */C.jsxs("div",{className:"html-preview-frame"+(e.isDark?" html-preview-frame--dark":""),onClick:e=>e.stopPropagation(),children:[
|
|
10
|
+
/* @__PURE__ */C.jsxs("div",{className:"html-preview-frame__header",children:[
|
|
11
|
+
/* @__PURE__ */C.jsxs("div",{className:"html-preview-frame__title",children:[
|
|
12
|
+
/* @__PURE__ */C.jsx("span",{className:"html-preview-frame__dot"}),
|
|
13
|
+
/* @__PURE__ */C.jsx("span",{className:"html-preview-frame__label",children:e.title||"Preview"})]}),
|
|
14
|
+
/* @__PURE__ */C.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__ */C.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 xe(){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,ve=!1,ye=null,ke=null,be=null,je=null,Ce=null;const Me=/* @__PURE__ */new WeakMap;let Ne=0;function Se(e,t){const n=function(e){if(null==e)return null;if("string"==typeof e)return e;if("object"==typeof e&&e&&"name"in e)return String(e.name);if("object"==typeof e){const t=Me.get(e);if(t)return t;try{const t=JSON.stringify(e);if(t)return Me.set(e,t),t}catch{}const n="__theme_"+ ++Ne;return Me.set(e,n),n}return String(e)}(e);return n?(we!==t&&(we=t),ve||Ce!==n?!ye||je!==n&&ke!==n?(be=e,je=n,ye||(ve=!0,ye=(async()=>{for(;null!=be&&null!=je;){const e=be,t=je;if(be=null,je=null,Ce===t)continue;const n=we;if(!n)break;try{ke=t,await Promise.resolve(n(e)),Ce=t}catch{}}})().finally(()=>{ve=!1,ye=null,ke=null}),ye)):ye:Promise.resolve()):Promise.resolve()}let Le=null,Be=null,Ee=null;const Te=/* @__PURE__ */new Set,_e=/* @__PURE__ */new WeakMap;let $e=0;function De(){for(const e of Array.from(Te))try{e()}catch{}}function Oe({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 C.jsx("pre",{className:o,"aria-busy":!0===(null==e?void 0:e.loading),"aria-label":i,"data-language":r,tabIndex:0,children:/* @__PURE__ */C.jsx("code",{translate:"no",children:String(null!=(n=null==e?void 0:e.code)?n:"")})})}const Pe={isShowPreview:!0,loading:!0,stream:!0,enableFontSizeControl:!0,showHeader:!0,showCopyButton:!0,showExpandButton:!0,showPreviewButton:!0,showFontSizeButtons:!0};function Re(e){var r;const o={...Pe,...e},{node:l,isDark:c,loading:d,stream:u,isShowPreview:m,enableFontSizeControl:h,darkTheme:p,lightTheme:f,monacoOptions:g,themes:x,minWidth:w,maxWidth:v,showHeader:y,showCopyButton:k,showExpandButton:b,showPreviewButton:j,showFontSizeButtons:M}=o,N=i(null),S=i(null),L=i(null),B=i(null),E=i(null),T=i(null),_=i(null),$=i(0),D=i(null),P=i(null),R=O(),W=i(g),A=i(x),I=i(g),[F,z]=n(!1),[H,V]=n(()=>"undefined"==typeof window),[K,X]=n(!1),[U,q]=n(!1),[Z,J]=n(!1),[G,Q]=n(()=>l.language||"plaintext"),[ee,te]=n(()=>ce(l.language)),[ne,re]=n(!1),[se,ae]=n(!1),[le,pe]=n(!1),[fe,ge]=n(!1),{t:we}=Y(),[ve,ye]=n(()=>{const e=Number(null==g?void 0:g.fontSize);return Number.isFinite(e)&&e>0?e:14}),[ke,be]=n(ve),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},[]),Ce=a(e=>{var t,n,r,o;if(F)return;const i=N.current,s=L.current;if(!i||!s)return;const a="diff"===T.current?null==(t=s.getDiffEditorView)?void 0:t.call(s):null==(n=s.getEditorView)?void 0:n.call(s);if(!a)return;const l=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(l)}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,l);i.style.height=`${Math.ceil(Math.max(120,n))}px`}null==(o=a.layout)||o.call(a)}catch{}},[je,F]);s(()=>{W.current=g},[g]),s(()=>{te(ce(l.language))},[l.language]);const Me=i(l);Me.current=l;const Ne=a(()=>{var e;$.current+=1;try{null==(e=B.current)||e.call(B)}catch{}E.current=null,T.current=null,_.current=null,J(!1),q(!1)},[]),_e=a(()=>{var e,t,n,r,o,i;const s=N.current,a=S.current;if(!s||!a)return;const l=null!=(e=s.querySelector(".monaco-editor"))?e:s;try{const e="undefined"!=typeof window&&window.getComputedStyle?window.getComputedStyle(l):null,s=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();s&&a.style.setProperty("--vscode-editor-foreground",s),c&&a.style.setProperty("--vscode-editor-background",c),d&&a.style.setProperty("--vscode-editor-selectionBackground",d)}catch{}},[]);s(()=>()=>{var e,t,n;$.current+=1,null==(e=B.current)||e.call(B),B.current=null,E.current=null,T.current=null,_.current=null,D.current=null,null==(n=null==(t=P.current)?void 0:t.destroy)||n.call(t),P.current=null},[]),s(()=>{var e,t;if("undefined"==typeof window)return;if(H)return;const n=S.current;if(!n)return;null==(t=null==(e=P.current)?void 0:e.destroy)||t.call(e);const r=R(n,{rootMargin:"400px"});return P.current=r,r.isVisible()&&V(!0),r.whenVisible.then(()=>V(!0)),()=>{r.destroy(),P.current===r&&(P.current=null)}},[R,H]),s(()=>{let e=!0;return"undefined"==typeof window||(async()=>{var t,n;try{const r=await xe();if(!e)return;if(!r)return void z(!0);const o=r.useMonaco,i=r.detectLanguage;if("function"==typeof i&&(D.current=i),"function"!=typeof o)return void z(!0);const s=null!=(t=c?p:f)?t:Le,a={...I.current||{}},l=o({wordWrap:"on",wrappingIndent:"same",themes:A.current,theme:s,...a,onThemeChange(){_e()}});L.current=l,"function"==typeof(n=l.setTheme)&&(Ee=n,null!=Le&&null!=Be&&Se(Le,Ee).then(()=>De()).catch(()=>{})),B.current="function"==typeof l.safeClean?()=>l.safeClean():"function"==typeof l.cleanupEditor?()=>l.cleanupEditor():null,X(!0)}catch{e&&z(!0)}})(),()=>{e=!1}},[]),s(()=>{var e;if(!l.language&&!ee&&D.current)try{const t=D.current(String(null!=(e=l.code)?e:""));t&&Q(t)}catch{}},[ee,l.code,l.language]);const $e=t(()=>String(l.language||ee||G||"plaintext"),[ee,G,l.language]),Re=t(()=>ce($e),[$e]),We=t(()=>de(Re),[Re]),Ae=t(()=>ue(Re),[Re]),Ie=t(()=>!!m&&("html"===Re||"svg"===Re),[Re,m]),Fe=t(()=>{const e=Re;return e?me[e]||e.charAt(0).toUpperCase()+e.slice(1):me[""]||"Plain Text"},[Re]),ze=t(()=>{var e,t,n;return l.diff?null!=(t=null!=(e=l.updatedCode)?e:l.code)?t:"":null!=(n=l.code)?n:""},[l.code,l.diff,l.updatedCode]),He=t(()=>{const e=e=>{if(null!=e)return"number"==typeof e?`${e}px`:String(e)},t={},n=e(w),r=e(v);return n&&(t.minWidth=n),r&&(t.maxWidth=r),t},[w,v]),Ve=!1===u&&d,Ke=t(()=>c?p:f,[p,c,f]);s(()=>{if(F)return;if(!U||!H)return;const e=L.current;(null==e?void 0:e.setTheme)&&Ke&&Se(Ke,e.setTheme).then(_e).catch(()=>{})},[U,Ke,_e,F,H]),s(()=>{var e;if("undefined"!=typeof window)return e=()=>{_e()},Te.add(e),()=>{Te.delete(e)}},[_e]);const Xe=a(async()=>{var e,t;if(F)return null;if(!H)return null;if(le)return null;if(Ve)return null;const n=L.current,r=N.current;if(!n||!r||!n.createEditor)return null;const o=Me.current,i=o.diff?"diff":"single",s=_.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&&s===r&&a)return null;if(E.current)return E.current;$.current+=1;const l=$.current;q(!0);const c=(async()=>{var e,t,i,s,a,c,d,u,m,h;try{null==(e=B.current)||e.call(B),T.current=null,_.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!=(s=o.updatedCode)?s:o.code)?a:""),p)):(T.current="single",await n.createEditor(r,String(null!=(c=o.code)?c:""),p)),_.current=r,$.current!==l)return;const f=Number(null==(d=W.current)?void 0:d.fontSize);if(Number.isFinite(f)&&f>0){ye(f),be(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{}}_e(),se||le||Ce(!1),J(!0)}catch{$.current===l&&z(!0)}})().finally(()=>{E.current===c&&(E.current=null)});return E.current=c,c},[Ce,le,se,We,Ve,_e,F,H]);s(()=>{F||K&&H&&(le||Ve?Ne():Xe())},[le,Xe,K,Ne,Ve,F,H]),s(()=>{var e;if(F)return;if(!K)return;if(!H)return;if(le)return;if(Ve)return;const t=L.current;if(!t)return;const n=String(null!=(e=l.code)?e:"");(async()=>{var e,r;let o=ee;if(!o&&D.current)try{o=ce(D.current(n)),o&&te(o)}catch{}const i=de(o||Re);if(t.createEditor&&N.current){try{await Promise.resolve(Xe())}catch{}const e=E.current;if(e)try{await e}catch{}}try{l.diff&&t.updateDiff?await Promise.resolve(t.updateDiff(String(null!=(e=l.originalCode)?e:""),String(null!=(r=l.updatedCode)?r:""),i)):t.updateCode&&await Promise.resolve(t.updateCode(n,i))}catch{}se&&Ce(!0)})()},[Ce,Re,ee,le,U,Xe,se,K,l.code,l.diff,l.originalCode,l.updatedCode,Ve,F,H]),s(()=>{if(F)return;if(!K)return;if(!H)return;if(le)return;if(Ve)return;if(!se&&d)return;const e="undefined"!=typeof window&&"function"==typeof window.requestAnimationFrame?window.requestAnimationFrame(()=>Ce(se)):null;return null==e&&Ce(se),()=>{null!=e&&"undefined"!=typeof window&&"function"==typeof window.cancelAnimationFrame&&window.cancelAnimationFrame(e)}},[Ce,le,se,d,K,Ve,F,H]),s(()=>{var e,t,n;if(!h)return;if(F)return;const r=L.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:ke})}catch{}Ce(se)}},[Ce,h,se,ke,l.diff,F]);const Ue=a((e,t)=>{oe(e.currentTarget,t,"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"===Re?"text/html":"image/svg+xml",t="html"===Re?we("artifacts.htmlPreviewTitle")||"HTML Preview":we("artifacts.svgPreviewTitle")||"SVG Preview";"function"!=typeof o.onPreviewCode?"html"===Re&&ge(e=>!e):o.onPreviewCode({node:l,artifactType:e,artifactTitle:t,id:`temp-${Re}-${Date.now()}`})},[Re,Ie,l,o,we]);return F?/* @__PURE__ */C.jsx(Oe,{node:l}):/* @__PURE__ */C.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__ */C.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
|
+
/* @__PURE__ */C.jsxs("div",{className:"flex items-center space-x-2 flex-1 overflow-hidden",children:[
|
|
18
|
+
/* @__PURE__ */C.jsx("span",{className:"icon-slot h-4 w-4 flex-shrink-0",dangerouslySetInnerHTML:{__html:Ae}}),
|
|
19
|
+
/* @__PURE__ */C.jsx("span",{className:"text-sm font-medium font-mono truncate",children:Fe})]}),
|
|
20
|
+
/* @__PURE__ */C.jsxs("div",{className:"flex items-center space-x-2",children:[
|
|
21
|
+
/* @__PURE__ */C.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:()=>pe(e=>!e),onMouseEnter:e=>Ue(e,le?we("common.expand")||"Expand":we("common.collapse")||"Collapse"),onFocus:e=>Ue(e,le?we("common.expand")||"Expand":we("common.collapse")||"Collapse"),onMouseLeave:qe,onBlur:qe,children:/* @__PURE__ */C.jsx("svg",{style:{rotate:le?"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__ */C.jsx("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"m9 18l6-6l-6-6"})})}),M&&h&&/* @__PURE__ */C.jsxs(C.Fragment,{children:[
|
|
22
|
+
/* @__PURE__ */C.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__ */C.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__ */C.jsx("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M5 12h14"})})}),
|
|
23
|
+
/* @__PURE__ */C.jsx("button",{type:"button",className:"code-action-btn p-2 text-xs rounded-md transition-colors hover:bg-[var(--vscode-editor-selectionBackground)]",disabled:ke===ve,onClick:()=>be(ve),onMouseEnter:e=>Ue(e,we("common.reset")||"Reset"),onFocus:e=>Ue(e,we("common.reset")||"Reset"),onMouseLeave:qe,onBlur:qe,children:/* @__PURE__ */C.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__ */C.jsxs("g",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",children:[
|
|
24
|
+
/* @__PURE__ */C.jsx("path",{d:"M3 12a9 9 0 1 0 9-9a9.75 9.75 0 0 0-6.74 2.74L3 8"}),
|
|
25
|
+
/* @__PURE__ */C.jsx("path",{d:"M3 3v5h5"})]})})}),
|
|
26
|
+
/* @__PURE__ */C.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__ */C.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__ */C.jsx("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M5 12h14m-7-7v14"})})})]}),k&&/* @__PURE__ */C.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=>Ue(e,ne?we("common.copied")||"Copied":we("common.copy")||"Copy"),onFocus:e=>Ue(e,ne?we("common.copied")||"Copied":we("common.copy")||"Copy"),onMouseLeave:qe,onBlur:qe,children:ne?/* @__PURE__ */C.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__ */C.jsx("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M20 6L9 17l-5-5"})}):/* @__PURE__ */C.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__ */C.jsxs("g",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",children:[
|
|
27
|
+
/* @__PURE__ */C.jsx("rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2"}),
|
|
28
|
+
/* @__PURE__ */C.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__ */C.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:()=>ae(e=>!e),onMouseEnter:e=>Ue(e,se?we("common.collapse")||"Collapse":we("common.expand")||"Expand"),onFocus:e=>Ue(e,se?we("common.collapse")||"Collapse":we("common.expand")||"Expand"),onMouseLeave:qe,onBlur:qe,children:se?/* @__PURE__ */C.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__ */C.jsx("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M15 3h6v6m0-6l-7 7M3 21l7-7m-1 7H3v-6"})}):/* @__PURE__ */C.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__ */C.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__ */C.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__ */C.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",children:/* @__PURE__ */C.jsxs("g",{fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd",children:[
|
|
29
|
+
/* @__PURE__ */C.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
|
+
/* @__PURE__ */C.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__ */C.jsxs("div",{className:`code-block-body${le?" code-block-body--collapsed":""}${se?" code-block-body--expanded":""}`,children:[!le&&(!!u||!d)&&(F?/* @__PURE__ */C.jsx(Oe,{node:l}):/* @__PURE__ */C.jsxs(C.Fragment,{children:[
|
|
32
|
+
/* @__PURE__ */C.jsx("div",{ref:N,className:"code-editor-container"+(u?"":" code-height-placeholder"),style:{visibility:Z?"visible":"hidden"},"aria-hidden":!Z}),!Z&&/* @__PURE__ */C.jsx("div",{style:{position:"absolute",inset:0,overflow:"auto",padding:"1rem"},children:/* @__PURE__ */C.jsx("pre",{className:"code-fallback-plain m-0","aria-busy":d,"aria-label":`Code block: ${Fe}`,tabIndex:0,children:/* @__PURE__ */C.jsx("code",{translate:"no",children:String(ze)})})})]})),!u&&d&&/* @__PURE__ */C.jsx("div",{className:"code-loading-placeholder",children:/* @__PURE__ */C.jsxs("div",{className:"loading-skeleton",children:[
|
|
33
|
+
/* @__PURE__ */C.jsx("div",{className:"skeleton-line"}),
|
|
34
|
+
/* @__PURE__ */C.jsx("div",{className:"skeleton-line"}),
|
|
35
|
+
/* @__PURE__ */C.jsx("div",{className:"skeleton-line short"})]})})]}),fe&&!o.onPreviewCode&&Ie&&"html"===Re&&/* @__PURE__ */C.jsx(he,{code:String(null!=(r=l.code)?r:""),isDark:c,onClose:()=>ge(!1)}),
|
|
36
|
+
/* @__PURE__ */C.jsx("span",{className:"sr-only","aria-live":"polite",role:"status",children:ne?we("common.copied")||"Copied":""})]})}function We(e){const{node:t,ctx:n,renderNode:r,indexKey:o}=e,i=Array.isArray(t.items)?t.items:[];/* @__PURE__ */
|
|
37
|
+
return C.jsx("dl",{className:"definition-list","data-index-key":o,children:i.map((e,t)=>/* @__PURE__ */C.jsxs("div",{className:"mb-4",children:[
|
|
38
|
+
/* @__PURE__ */C.jsx("dt",{className:"definition-term font-semibold",children:n&&r?L(e.term,n,`${String(null!=o?o:"definition")}-term-${t}`,r):null}),
|
|
39
|
+
/* @__PURE__ */C.jsx("dd",{className:"definition-desc ml-4",children:n&&r?L(e.definition,n,`${String(null!=o?o:"definition")}-desc-${t}`,r):null})]},`${String(null!=o?o:"definition")}-${t}`))})}function Ae(e){var t;const{node:n}=e;/* @__PURE__ */
|
|
40
|
+
return C.jsx("span",{className:"emoji-node",children:null!=(t=n.name)?t:n.markup})}function Ie(e){/* @__PURE__ */
|
|
41
|
+
return C.jsx("em",{className:"emphasis-node",children:e.children})}function Fe(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 C.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 ze(e){const{node:t,ctx:n,renderNode:r,indexKey:o}=e;/* @__PURE__ */
|
|
43
|
+
return C.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__ */C.jsx("div",{className:"flex-1",children:n&&r?S(t.children,n,String(null!=o?o:`footnote-${t.id}`),r):null})})}function He(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 C.jsx("sup",{id:`fnref-${n.id}`,className:"footnote-reference",onClick:o,children:/* @__PURE__ */C.jsxs("a",{href:r,title:`View footnote ${n.id}`,className:"footnote-link cursor-pointer",children:["[",n.id,"]"]})})}function Ve(e){/* @__PURE__ */
|
|
45
|
+
return C.jsx("br",{className:"hard-break"})}function Ke(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=Ke(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function Xe(){for(var e,t,n=0,r="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=Ke(e))&&(r&&(r+=" "),r+=t);return r}function Ue(e){const{node:t,ctx:n,renderNode:r,indexKey:o,children:i}=e,s=Math.min(6,Math.max(1,Number(t.level)||1)),a=`h${s}`;/* @__PURE__ */
|
|
46
|
+
return C.jsx(a,{dir:"auto",className:Xe("heading-node font-semibold",`heading-${s}`),children:null!=i?i:n&&r?S(t.children,n,String(null!=o?o:`heading-${s}`),r):null})}function qe(e){/* @__PURE__ */
|
|
47
|
+
return C.jsx("mark",{className:"highlight-node",children:e.children})}const Ye=/* @__PURE__ */new Set(["onclick","onerror","onload","onmouseover","onmouseout","onmousedown","onmouseup","onkeydown","onkeyup","onfocus","onblur","onsubmit","onreset","onchange","onselect","ondblclick"]),Ze=/* @__PURE__ */new Set(["script"]),Je=/* @__PURE__ */new Set(["href","src","srcset","xlink:href","formaction"]);function Ge(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 Qe=/* @__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"]),et=/* @__PURE__ */new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]);function tt(e){return e.startsWith("--")?e:e.replace(/-([a-z])/g,(e,t)=>t.toUpperCase())}function nt(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=tt(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 rt(e){const t={};for(const[n,r]of Object.entries(e)){const e=n.toLowerCase();Ye.has(e)||Je.has(e)&&r&&Ge(r)||(t[n]=r)}return t}function ot(e,t){const n=e.toLowerCase();return!Qe.has(n)&&(Object.prototype.hasOwnProperty.call(t,n)||Object.prototype.hasOwnProperty.call(t,e))}function it(r){const{node:o,placeholder:a,customId:c}=r,d=O(),[u,m]=n(null),h=i(null),[p,f]=n(()=>"undefined"==typeof window),[g,x]=n(o.content),w=Boolean(o.loading),v=l(I,F,F),y=t(()=>{var e;return null!=(e=r.customComponents)?e:H(c)},[c,r.customComponents,v]);s(()=>{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 x(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]),s(()=>()=>{var e;null==(e=h.current)||e.destroy(),h.current=null},[]),s(()=>{w&&!p||x(o.content)},[w,o.content,p]);const k=t(()=>{var e;return N(null!=(e=o.attrs)?e:void 0)},[o.attrs]),b=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(ot(r[1],t))return!0;return!1}(null!=(e=o.content)?e:"",y)},[y,o.content]),j=t(()=>b&&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 s=e.indexOf("<",i);if(-1===s){i<e.length&&e.slice(i).trim()&&o.push({type:"text",content:e.slice(i)});break}if(s>i){const t=e.slice(i,s);t.trim()&&o.push({type:"text",content:t})}const a=e.indexOf(">",s);if(-1===a)break;const l=e.slice(s+1,a).trim(),c=l.startsWith("/"),d=l.endsWith("/");if(c)o.push({type:"tag_close",tagName:l.slice(1).trim()});else{const e=l.indexOf(" ");let i,s="";-1===e?i=d?l.slice(0,-1).trim():l.trim():(i=l.slice(0,e).trim(),s=l.slice(e+1));const a={};if(s){const e=/([^\s=]+)(?:=(?:"([^"]*)"|'([^']*)'|(\S*)))?/g;let o;for(;null!==(o=e.exec(s));){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||et.has(i.toLowerCase())?"self_closing":"tag_open",tagName:i,attrs:a})}i=a+1}return o}(t);let o=0;const i=[],s=[];for(const t of r)if("text"===t.type){if(i.length>0&&i[i.length-1].blocked)continue;(i.length>0?i[i.length-1].children:s).push(t.content)}else if("self_closing"===t.type){if(Ze.has(t.tagName.toLowerCase()))continue;const r=rt(t.attrs||{}),a=r.key,l=null!=a&&""!==a?a:"ms-html-"+o++,c=ot(t.tagName,n)?n[t.tagName]||n[t.tagName.toLowerCase()]:void 0;c?(i.length>0?i[i.length-1].children:s).push(e.createElement(c,{...r,key:l})):(i.length>0?i[i.length-1].children:s).push(e.createElement(t.tagName,{...nt(r),key:l,suppressHydrationWarning:!0}))}else if("tag_open"===t.type)i.push({tagName:t.tagName,children:[],attrs:t.attrs,blocked:Ze.has(t.tagName.toLowerCase())});else if("tag_close"===t.type){const t=i.pop();if(t){if(t.blocked)continue;const r=rt(t.attrs||{}),a=r.key,l=null!=a&&""!==a?a:"ms-html-"+o++,c=ot(t.tagName,n)?n[t.tagName]||n[t.tagName.toLowerCase()]:void 0,d=c?e.createElement(c,{...r,key:l},...t.children):e.createElement(t.tagName,{...nt(r),key:l,suppressHydrationWarning:!0},...t.children);i.length>0?i[i.length-1].children.push(d):s.push(d)}}for(;i.length>0;){const t=i.pop();if(t.blocked)continue;const r=rt(t.attrs||{}),a=r.key,l=null!=a&&""!==a?a:"ms-html-"+o++,c=ot(t.tagName,n)?n[t.tagName]||n[t.tagName.toLowerCase()]:void 0,d=c?e.createElement(c,{...r,key:l},...t.children):e.createElement(t.tagName,{...nt(r),key:l,suppressHydrationWarning:!0},...t.children);s.push(d)}return s}catch{return null}}(o.content,y):null,[y,o.content,b]);/* @__PURE__ */
|
|
48
|
+
return C.jsx("div",{ref:m,className:"html-block-node",...k,children:p?b&&j?/* @__PURE__ */C.jsx(C.Fragment,{children:j}):/* @__PURE__ */C.jsx("div",{dangerouslySetInnerHTML:{__html:null!=g?g:""}}):/* @__PURE__ */C.jsx("div",{className:"html-block-node__placeholder",children:null!=a?a:/* @__PURE__ */C.jsxs(C.Fragment,{children:[
|
|
49
|
+
/* @__PURE__ */C.jsx("span",{className:"html-block-node__placeholder-bar"}),
|
|
50
|
+
/* @__PURE__ */C.jsx("span",{className:"html-block-node__placeholder-bar w-4/5"}),
|
|
51
|
+
/* @__PURE__ */C.jsx("span",{className:"html-block-node__placeholder-bar w-2/3"})]})})})}const st=/* @__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"]),at=/* @__PURE__ */new Set(["script"]),lt=/* @__PURE__ */new Set(["href","src","srcset","xlink:href","formaction"]),ct=(()=>{try{return Boolean(!1)}catch{}return!1})();function dt(e){ct&&console.warn(e)}function ut(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 mt=/* @__PURE__ */new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),ht=/* @__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 pt(e){return e.startsWith("--")?e:e.replace(/-([a-z])/g,(e,t)=>t.toUpperCase())}function ft(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=pt(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 gt(e,t){const n=e.toLowerCase();return!ht.has(n)&&(Object.prototype.hasOwnProperty.call(t,n)||Object.prototype.hasOwnProperty.call(t,e))}function xt(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 wt(e){return e.trim().length>0}function vt(t,n,r,o,i){if(at.has(t.toLowerCase()))return null;const s=function(e){const t={};for(const[n,r]of Object.entries(e)){const e=n.toLowerCase();st.has(e)||lt.has(e)&&r&&ut(r)||(t[n]=r)}return t}(n),a=s.key,l=null!=a&&""!==a?a:i;if(gt(t,o)){const n=o[t]||o[t.toLowerCase()],i=function(e){const t={};for(const[n,r]of Object.entries(e))t[n]=xt(r,n);return t}(s);return e.createElement(n,{...i,key:l},...r)}return e.createElement(t,{...ft(s),key:l},...r)}function yt(t){const{node:r,customId:o}=t,a=i(null),[l,c]=n(!1);s(()=>{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(gt(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){let n=0;const r=[],o=[];for(const i of e)if("text"===i.type)(r.length>0?r[r.length-1].children:o).push(i.content);else if("self_closing"===i.type){const e=vt(i.tagName,i.attrs||{},[],t,"ms-html-"+n++),s=r.length>0?r[r.length-1].children:o;null!=e&&s.push(e)}else if("tag_open"===i.type)r.push({tagName:i.tagName,children:[],attrs:i.attrs});else if("tag_close"===i.type){const e=i.tagName.toLowerCase();let s=-1;for(let t=r.length-1;t>=0;t--)if(r[t].tagName.toLowerCase()===e){s=t;break}if(-1!==s)for(;r.length>s;){const i=r.pop(),a=vt(i.tagName,i.attrs||{},i.children,t,"ms-html-"+n++);r.length>0?null!=a&&r[r.length-1].children.push(a):null!=a&&o.push(a),i.tagName.toLowerCase()!==e&&r.length>s&&dt(`Auto-closing unclosed tag: <${i.tagName}>`)}else dt(`Ignoring closing tag with no matching opening tag: </${i.tagName}>`)}for(;r.length>0;){const e=r.pop(),i=vt(e.tagName,e.attrs||{},e.children,t,"ms-html-"+n++);null!=i&&o.push(i),dt(`Auto-closing unclosed tag: <${e.tagName}>`)}return o}(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 s=e.indexOf("<",i);if(-1===s){if(i<e.length){const t=e.slice(i);wt(t)&&o.push({type:"text",content:t})}break}if(s>i){const t=e.slice(i,s);wt(t)&&o.push({type:"text",content:t})}if(e.startsWith("![CDATA[",s+1)){const t=e.indexOf("]]>",s);if(-1!==t){o.push({type:"text",content:e.slice(s,t+3)}),i=t+3;continue}break}if(e.startsWith("!",s+1)){const t=e.indexOf(">",s);if(-1!==t){i=t+1;continue}break}const a=e.indexOf(">",s);if(-1===a)break;const l=e.slice(s+1,a).trim(),c=l.startsWith("/"),d=l.endsWith("/");if(c){const e=l.slice(1).trim();o.push({type:"tag_close",tagName:e})}else{const e=l.indexOf(" ");let i,s="";-1===e?i=d?l.slice(0,-1).trim():l.trim():(i=l.slice(0,e).trim(),s=l.slice(e+1));const a={};if(s){const e=/([^\s=]+)(?:=(?:"([^"]*)"|'([^']*)'|(\S*)))?/g;let o;for(;null!==(o=e.exec(s));){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||mt.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,ct&&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 s(()=>{var e;if(!l||!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,l]),r.loading&&!r.autoClosed?/* @__PURE__ */C.jsx("span",{className:"html-inline-node html-inline-node--loading",children:r.content}):"dynamic"===u.mode?/* @__PURE__ */C.jsx("span",{className:"html-inline-node",style:{display:"inline"},children:u.nodes}):/* @__PURE__ */C.jsx("span",{ref:a,className:"html-inline-node",style:{display:"inline"}})}const kt={fallbackSrc:"",showCaption:!1,lazy:!0,svgMinHeight:"12rem",usePlaceholder:!0};function bt(e){var r,o,a,l,c,d;const u={...kt,...e},m=O(),[h,p]=n(null),f=i(null),[g,x]=n(()=>"undefined"==typeof window||!1===u.lazy),[w,v]=n(!1),[y,k]=n(!1),[b,j]=n(!1);s(()=>{var e;if(!u.lazy)return;const t=h;if(null==(e=f.current)||e.destroy(),f.current=null,!t)return void x(!1);const n=m(t,{rootMargin:"400px"});return f.current=n,n.isVisible()&&x(!0),n.whenVisible.then(()=>x(!0)).catch(()=>{}),()=>{n.destroy(),f.current=null}},[h,m,u.lazy]),s(()=>()=>{var e;null==(e=f.current)||e.destroy(),f.current=null},[]);const M=t(()=>y&&u.fallbackSrc?u.fallbackSrc:u.node.src,[y,u.fallbackSrc,u.node.src]);s(()=>{v(!1),k(!1)},[M]),s(()=>{j(!1)},[u.node.src]);const N=t(()=>/\.svg(?:\?|$)/i.test(String(M)),[M]),S=!u.lazy||g,L=N?{minHeight:u.svgMinHeight,width:"100%"}:{minHeight:"6rem"};/* @__PURE__ */
|
|
52
|
+
return C.jsxs("figure",{ref:p,className:"image-node",children:[
|
|
53
|
+
/* @__PURE__ */C.jsx("div",{className:"image-node__inner",children:u.node.loading||y||!S?y?/* @__PURE__ */C.jsxs("div",{className:"image-node__error",children:[
|
|
54
|
+
/* @__PURE__ */C.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24","aria-hidden":"true",children:/* @__PURE__ */C.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
|
+
/* @__PURE__ */C.jsx("span",{className:"image-node__placeholder-text",children:"Image failed to load"})]}):/* @__PURE__ */C.jsx("div",{className:"image-node__placeholder",style:L,children:u.usePlaceholder?/* @__PURE__ */C.jsxs(C.Fragment,{children:[
|
|
56
|
+
/* @__PURE__ */C.jsx("span",{className:"image-node__spinner","aria-hidden":"true"}),
|
|
57
|
+
/* @__PURE__ */C.jsx("span",{className:"image-node__placeholder-text",children:"Loading image..."})]}):/* @__PURE__ */C.jsx("span",{className:"image-node__placeholder-text",children:null!=(d=u.node.raw)?d:"Loading image…"})},"placeholder"):/* @__PURE__ */C.jsx("img",{src:M,alt:String(null!=(o=null!=(r=u.node.alt)?r:u.node.title)?o:""),title:String(null!=(l=null!=(a=u.node.title)?a:u.node.alt)?l:""),className:"image-node__img"+(w?" is-loaded":""),style:N?{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;v(!0),k(!1),null==(e=u.onLoad)||e.call(u,M)},onClick:e=>{var t;e.preventDefault(),w&&!y&&(null==(t=u.onClick)||t.call(u,[e,M]))}},"image")}),u.showCaption&&u.node.alt&&/* @__PURE__ */C.jsx("figcaption",{className:"image-node__caption",children:u.node.alt})]})}let jt=null,Ct=null;const Mt=/* @__PURE__ */C.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 291 300",fill:"none",className:"w-4 h-4 flex-shrink-0",xmlns:"http://www.w3.org/2000/svg",children:/* @__PURE__ */C.jsxs("g",{children:[
|
|
58
|
+
/* @__PURE__ */C.jsx("path",{d:"M140.904 239.376C128.83 239.683 119.675 239.299 115.448 243.843C110.902 248.07 111.288 257.227 110.979 269.302C111.118 274.675 111.118 279.478 111.472 283.52C111.662 285.638 111.95 287.547 112.406 289.224C112.411 289.243 112.416 289.259 112.422 289.28C112.462 289.419 112.496 289.558 112.539 289.691C113.168 291.787 114.088 293.491 115.446 294.758C116.662 296.064 118.283 296.963 120.264 297.69C120.36 297.614 120.464 297.646 120.555 297.675C120.56 297.68 120.56 297.68 120.566 297.68C120.848 297.768 121.142 297.846 121.443 297.923C121.454 297.923 121.464 297.928 121.478 297.934C122.875 298.272 124.424 298.507 126.11 298.678C126.326 298.696 126.542 298.718 126.763 298.739C130.79 299.086 135.558 299.088 140.904 299.222C152.974 298.912 162.128 299.302 166.36 294.758C170.904 290.526 170.515 281.371 170.824 269.302C170.515 257.227 170.907 248.07 166.36 243.843C162.131 239.299 152.974 239.683 140.904 239.376Z",fill:"#FF6376"}),
|
|
59
|
+
/* @__PURE__ */C.jsx("path",{d:"M21.2155 128.398C12.6555 128.616 6.16484 128.339 3.16751 131.56C-0.0538222 134.56 0.218178 141.054 -0.000488281 149.608C0.218178 158.168 -0.0538222 164.659 3.16751 167.656C6.16484 170.878 12.6555 170.606 21.2155 170.824C25.0262 170.726 28.4288 170.726 31.2955 170.475C32.7968 170.342 34.1488 170.136 35.3382 169.814C35.3542 169.811 35.3648 169.806 35.3782 169.803C35.4768 169.774 35.5755 169.747 35.6688 169.718C37.1568 169.272 38.3648 168.622 39.2635 167.656C40.1915 166.795 40.8262 165.646 41.2715 164.243C41.2875 164.174 41.3115 164.102 41.3328 164.035C41.3328 164.035 41.3355 164.032 41.3355 164.027C41.3968 163.827 41.4529 163.622 41.5062 163.406C41.5062 163.398 41.5115 163.392 41.5142 163.382C41.7542 162.392 41.9222 161.294 42.0422 160.096C42.0555 159.944 42.0715 159.792 42.0848 159.635C42.3328 156.779 42.3328 153.398 42.4262 149.608C42.2075 141.054 42.4848 134.56 39.2635 131.56C36.2635 128.339 29.7728 128.616 21.2155 128.398Z",fill:"#FFCCCC"}),
|
|
60
|
+
/* @__PURE__ */C.jsx("path",{d:"M81.0595 184.171C70.8568 184.433 63.1208 184.102 59.5475 187.942C55.7075 191.518 56.0328 199.254 55.7742 209.454C56.0328 219.657 55.7075 227.393 59.5475 230.963C63.1208 234.803 70.8568 234.478 81.0595 234.739C85.6008 234.622 89.6595 234.622 93.0728 234.323C94.8648 234.163 96.4755 233.921 97.8942 233.534C97.9102 233.529 97.9235 233.526 97.9422 233.521C98.0568 233.486 98.1742 233.457 98.2888 233.422C100.06 232.889 101.5 232.113 102.569 230.963C103.676 229.937 104.433 228.566 104.964 226.894C104.985 226.811 105.012 226.726 105.036 226.646C105.041 226.643 105.041 226.643 105.041 226.638C105.116 226.401 105.18 226.153 105.244 225.897C105.244 225.889 105.249 225.881 105.254 225.867C105.54 224.689 105.74 223.379 105.881 221.953C105.9 221.771 105.916 221.59 105.934 221.403C106.228 218.001 106.228 213.969 106.342 209.454C106.081 199.254 106.412 191.518 102.572 187.942C98.9955 184.102 91.2568 184.433 81.0595 184.171Z",fill:"#FF939F"}),
|
|
61
|
+
/* @__PURE__ */C.jsx("path",{d:"M260.591 151.87C215.652 151.87 203.02 164.523 203.02 209.462H198.476C198.476 164.523 185.836 151.881 140.895 151.881V147.337C185.836 147.337 198.487 134.705 198.487 89.7659H203.02C203.02 134.705 215.652 147.337 260.591 147.337V151.87ZM286.052 124.158C281.82 119.614 272.66 120.001 260.591 119.689C248.521 119.385 239.361 119.771 235.129 115.227C230.585 110.995 230.983 101.846 230.671 89.7659C230.513 83.7312 230.535 78.4272 230.023 74.1019C229.513 69.7659 228.481 66.4219 226.209 64.3046C221.967 59.7606 212.817 60.1472 200.748 59.8459C188.681 60.1472 179.519 59.7606 175.287 64.3046C170.753 68.5366 171.129 77.6966 170.828 89.7659C170.516 101.835 170.9 110.995 166.356 115.227C162.124 119.771 152.985 119.374 140.905 119.689C138.873 119.739 136.924 119.771 135.071 119.811C119.313 118.697 106.337 112.318 106.337 89.7659C106.212 84.6699 106.233 80.1792 105.807 76.5206C105.367 72.8726 104.492 70.0379 102.575 68.2566C99.0013 64.4112 91.2573 64.7446 81.0653 64.4832C70.86 64.7446 63.1186 64.4112 59.5533 68.2566C55.708 71.8299 56.0306 79.5632 55.7693 89.7659C56.0306 99.9686 55.708 107.702 59.5533 111.278C63.1186 115.113 70.86 114.79 81.0653 115.049C103.617 115.049 109.996 128.035 111.1 143.803C111.068 145.659 111.028 147.587 110.975 149.619C111.121 154.987 111.121 159.79 111.476 163.835C111.663 165.95 111.945 167.857 112.404 169.534C112.412 169.555 112.412 169.566 112.423 169.598C112.465 169.734 112.497 169.867 112.537 170.003C113.164 172.099 114.092 173.809 115.447 175.07C116.665 176.371 118.281 177.278 120.271 177.905C120.364 177.934 120.46 177.955 120.564 177.987C120.855 178.081 121.145 178.153 121.439 178.238C121.46 178.238 121.471 178.238 121.479 178.249C122.876 178.582 124.42 178.822 126.108 178.987C126.327 179.009 126.545 179.03 126.764 179.051C130.788 179.395 135.559 179.395 140.905 179.529C152.975 179.843 162.124 179.457 166.356 184.001C170.9 188.233 170.516 197.371 170.828 209.451C171.129 221.529 170.743 230.681 175.287 234.91C179.519 239.454 188.681 239.07 200.748 239.371C206.127 239.235 210.921 239.235 214.975 238.881C217.079 238.694 218.985 238.403 220.676 237.955C220.695 237.945 220.705 237.934 220.727 237.934C220.873 237.891 220.999 237.859 221.135 237.819C223.228 237.193 224.937 236.265 226.209 234.91C227.511 233.691 228.409 232.065 229.044 230.097C229.065 230.003 229.095 229.899 229.127 229.803V229.793C229.22 229.513 229.295 229.222 229.367 228.918C229.367 228.897 229.377 228.897 229.377 228.878C229.721 227.481 229.951 225.937 230.127 224.249C230.137 224.03 230.169 223.811 230.191 223.593C230.535 219.571 230.535 214.798 230.671 209.451C230.972 197.371 230.585 188.233 235.129 184.001C239.361 179.457 248.511 179.843 260.591 179.529C272.66 179.227 281.82 179.614 286.052 175.07C290.596 170.838 290.209 161.689 290.511 149.619C290.209 137.539 290.596 128.379 286.052 124.158Z",fill:"#FF356A"}),
|
|
62
|
+
/* @__PURE__ */C.jsx("path",{d:"M112.405 49.848C112.411 49.8694 112.416 49.8827 112.421 49.904C112.461 50.0427 112.499 50.1814 112.539 50.3147C113.171 52.4134 114.088 54.1147 115.448 55.384C116.661 56.6907 118.283 57.5894 120.264 58.2134C120.36 58.24 120.464 58.2694 120.555 58.3014C120.56 58.3067 120.56 58.3067 120.565 58.3067C120.848 58.3947 121.141 58.4694 121.443 58.5467C121.453 58.5467 121.464 58.552 121.48 58.5574C122.875 58.896 124.424 59.1334 126.112 59.3014C126.325 59.3227 126.541 59.3414 126.763 59.3627C130.789 59.712 135.56 59.712 140.904 59.8454C152.973 59.5387 162.128 59.928 166.36 55.384C170.907 51.152 170.515 41.9947 170.824 29.9254C170.517 17.8507 170.907 8.69602 166.363 4.46935C162.131 -0.0746511 152.973 0.309349 140.904 1.52588e-05C128.829 0.309349 119.675 -0.0746511 115.448 4.46935C110.904 8.69602 111.288 17.8507 110.979 29.9254C111.117 35.3014 111.117 40.1014 111.472 44.144C111.661 46.2614 111.949 48.1707 112.405 49.848Z",fill:"#FF6376"})]})}),Nt={maxHeight:"500px",loading:!0,showHeader:!0,showCopyButton:!0,showCollapseButton:!0,showModeToggle:!0,showExportButton:!0,showFullscreenButton:!0,showZoomControls:!0};function St(e){const t={...Nt,...e},{t:r}=Y(),[o,l]=n(!1),[c,d]=n(!1),[u,m]=n(!1),[h,p]=n("360px"),[f,g]=n(!1),[w,v]=n(1),[y,k]=n({x:0,y:0}),[b,j]=n(!1),M=i(null),N=i(null),S=i(null),L=i({x:0,y:0}),B=i(null),E=t.node.code,T=a(async()=>{var e,n;try{await(null==(e=navigator.clipboard)?void 0:e.writeText(E)),l(!0),null==(n=t.onCopy)||n.call(t,E),setTimeout(()=>l(!1),1e3)}catch{}},[E,t]),_=a(async()=>{var e,t;if(!M.current)return;const n=M.current;try{const r=await async function(){return Ct||jt||(jt=import("@antv/infographic").then(e=>{const t=e&&e.default?e.default:e;let n=t;return"function"==typeof t&&t.prototype&&t.prototype.render?n=t:e.Infographic?n=e.Infographic:t&&t.Infographic&&(n=t.Infographic),Ct=n,n}).catch(e=>(console.warn("Failed to load @antv/infographic",e),null)),jt)}();if(!r)return void console.warn("Infographic library failed to load.");B.current&&(null==(t=(e=B.current).destroy)||t.call(e),B.current=null),n.innerHTML="";const o=new r({container:n,width:"100%",height:"100%"});B.current=o,o.render(E),setTimeout(()=>{if(n){const e=n.scrollHeight;e>0&&p(`${Math.min(e,800)}px`)}},0)}catch(r){console.error("Failed to render infographic:",r),n.innerHTML=`<div class="text-red-500 p-4">Failed to render infographic: ${r instanceof Error?r.message:"Unknown error"}</div>`}},[E]);s(()=>{u||c||_()},[E,u,c,_]),s(()=>()=>{var e,t;B.current&&(null==(t=(e=B.current).destroy)||t.call(e),B.current=null)},[]);const $=a(()=>{g(!1),N.current&&(N.current.innerHTML=""),S.current=null,document.body.style.overflow=""},[]),D=a(()=>{g(!0),document.body.style.overflow="hidden"},[]);s(()=>{if(!f)return;const e=e=>{"Escape"===e.key&&$()};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[f,$]),s(()=>{f&&setTimeout(()=>{if(M.current&&N.current){N.current.innerHTML="";const e=document.createElement("div");Object.assign(e.style,{transition:"transform 0.1s ease",transformOrigin:"center center",width:"100%",height:"100%",display:"flex",alignItems:"center",justifyContent:"center"});const t=M.current.cloneNode(!0);t.classList.add("fullscreen"),t.style.height="auto",e.appendChild(t),N.current.appendChild(e),S.current=e,e.style.transform=`translate(${y.x}px, ${y.y}px) scale(${w})`}},0)},[f]),s(()=>{f&&S.current&&(S.current.style.transform=`translate(${y.x}px, ${y.y}px) scale(${w})`)},[f,y,w]);const O=a(()=>{var e;const t=null==(e=M.current)?void 0:e.querySelector("svg");if(!t)return;const n=(new XMLSerializer).serializeToString(t),r=new Blob([n],{type:"image/svg+xml;charset=utf-8"}),o=URL.createObjectURL(r),i=document.createElement("a");i.href=o,i.download=`infographic-${Date.now()}.svg`,document.body.appendChild(i),i.click(),document.body.removeChild(i),URL.revokeObjectURL(o)},[]),P=e=>{j(!0);const t="touches"in e?e.touches[0].clientX:e.clientX,n="touches"in e?e.touches[0].clientY:e.clientY;L.current={x:t-y.x,y:n-y.y}},R=e=>{if(!b)return;const t="touches"in e?e.touches[0].clientX:e.clientX,n="touches"in e?e.touches[0].clientY:e.clientY;k({x:t-L.current.x,y:n-L.current.y})},W=()=>j(!1),A=t.isDark?"p-2 text-xs rounded text-gray-400 hover:bg-gray-700 hover:text-gray-200":"p-2 text-xs rounded text-gray-600 hover:bg-gray-200 hover:text-gray-700",I=u||c;/* @__PURE__ */
|
|
63
|
+
return C.jsxs(C.Fragment,{children:[
|
|
64
|
+
/* @__PURE__ */C.jsxs("div",{className:Xe("my-4 rounded-lg border overflow-hidden shadow-sm",t.isDark?"border-gray-700/30":"border-gray-200",{"is-rendering":t.loading}),children:[t.showHeader&&/* @__PURE__ */C.jsxs("div",{className:Xe("flex justify-between items-center px-4 py-2.5 border-b",t.isDark?"bg-gray-800 border-gray-700/30":"bg-gray-50 border-gray-200"),children:[
|
|
65
|
+
/* @__PURE__ */C.jsxs("div",{className:"flex items-center gap-x-2 overflow-hidden",children:[Mt,
|
|
66
|
+
/* @__PURE__ */C.jsx("span",{className:Xe("text-sm font-medium font-mono truncate",t.isDark?"text-gray-400":"text-gray-600"),children:"Infographic"})]}),t.showModeToggle&&/* @__PURE__ */C.jsxs("div",{className:Xe("flex items-center gap-x-1 rounded-md p-0.5",t.isDark?"bg-gray-700":"bg-gray-100"),children:[
|
|
67
|
+
/* @__PURE__ */C.jsx("button",{className:Xe("px-2.5 py-1 text-xs rounded transition-colors",u?t.isDark?"text-gray-400 hover:text-gray-200":"text-gray-500 hover:text-gray-700":t.isDark?"bg-gray-600 text-gray-200 shadow-sm":"bg-white text-gray-700 shadow-sm"),onClick:()=>m(!1),onMouseEnter:e=>oe(e.currentTarget,r("common.preview")||"Preview","top",!1,0,t.isDark),onMouseLeave:()=>ie(),children:/* @__PURE__ */C.jsxs("div",{className:"flex items-center gap-x-1",children:[
|
|
68
|
+
/* @__PURE__ */C.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",className:"w-3 h-3",children:/* @__PURE__ */C.jsxs("g",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",children:[
|
|
69
|
+
/* @__PURE__ */C.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"}),
|
|
70
|
+
/* @__PURE__ */C.jsx("circle",{cx:"12",cy:"12",r:"3"})]})}),
|
|
71
|
+
/* @__PURE__ */C.jsx("span",{children:r("common.preview")||"Preview"})]})}),
|
|
72
|
+
/* @__PURE__ */C.jsx("button",{className:Xe("px-2.5 py-1 text-xs rounded transition-colors",u?t.isDark?"bg-gray-600 text-gray-200 shadow-sm":"bg-white text-gray-700 shadow-sm":t.isDark?"text-gray-400 hover:text-gray-200":"text-gray-500 hover:text-gray-700"),onClick:()=>m(!0),onMouseEnter:e=>oe(e.currentTarget,r("common.source")||"Source","top",!1,0,t.isDark),onMouseLeave:()=>ie(),children:/* @__PURE__ */C.jsxs("div",{className:"flex items-center gap-x-1",children:[
|
|
73
|
+
/* @__PURE__ */C.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",className:"w-3 h-3",children:/* @__PURE__ */C.jsx("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"m16 18l6-6l-6-6M8 6l-6 6l6 6"})}),
|
|
74
|
+
/* @__PURE__ */C.jsx("span",{children:r("common.source")||"Source"})]})})]}),
|
|
75
|
+
/* @__PURE__ */C.jsxs("div",{className:"flex items-center gap-x-1",children:[t.showCollapseButton&&/* @__PURE__ */C.jsx("button",{className:A,onClick:()=>d(!c),onMouseEnter:e=>oe(e.currentTarget,c?r("common.expand")||"Expand":r("common.collapse")||"Collapse","top",!1,0,t.isDark),onMouseLeave:()=>ie(),children:/* @__PURE__ */C.jsx("svg",{style:{rotate:c?"0deg":"90deg"},xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",className:"w-3 h-3",children:/* @__PURE__ */C.jsx("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"m9 18l6-6l-6-6"})})}),t.showCopyButton&&/* @__PURE__ */C.jsx("button",{className:A,onClick:T,onMouseEnter:e=>oe(e.currentTarget,o?r("common.copied")||"Copied":r("common.copy")||"Copy","top",!1,0,t.isDark),onMouseLeave:()=>ie(),children:o?/* @__PURE__ */C.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",className:"w-3 h-3",children:/* @__PURE__ */C.jsx("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M20 6L9 17l-5-5"})}):/* @__PURE__ */C.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",className:"w-3 h-3",children:/* @__PURE__ */C.jsxs("g",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",children:[
|
|
76
|
+
/* @__PURE__ */C.jsx("rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2"}),
|
|
77
|
+
/* @__PURE__ */C.jsx("path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2"})]})})}),t.showExportButton&&/* @__PURE__ */C.jsx("button",{className:Xe(A,I&&"opacity-50 cursor-not-allowed"),disabled:I,onClick:O,onMouseEnter:e=>oe(e.currentTarget,r("common.export")||"Export","top",!1,0,t.isDark),onMouseLeave:()=>ie(),children:/* @__PURE__ */C.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",className:"w-3 h-3",children:/* @__PURE__ */C.jsxs("g",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",children:[
|
|
78
|
+
/* @__PURE__ */C.jsx("path",{d:"M12 15V3m9 12v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}),
|
|
79
|
+
/* @__PURE__ */C.jsx("path",{d:"m7 10l5 5l5-5"})]})})}),t.showFullscreenButton&&/* @__PURE__ */C.jsx("button",{className:Xe(A,I&&"opacity-50 cursor-not-allowed"),disabled:I,onClick:D,onMouseEnter:e=>oe(e.currentTarget,f?r("common.minimize")||"Minimize":r("common.open")||"Open","top",!1,0,t.isDark),onMouseLeave:()=>ie(),children:f?/* @__PURE__ */C.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"0.75rem",height:"0.75rem",viewBox:"0 0 24 24",children:/* @__PURE__ */C.jsx("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"m14 10l7-7m-1 7h-6V4M3 21l7-7m-6 0h6v6"})}):/* @__PURE__ */C.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"0.75rem",height:"0.75rem",viewBox:"0 0 24 24",children:/* @__PURE__ */C.jsx("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M15 3h6v6m0-6l-7 7M3 21l7-7m-1 7H3v-6"})})})]})]}),!c&&/* @__PURE__ */C.jsx("div",{children:u?/* @__PURE__ */C.jsx("div",{className:Xe("p-4",t.isDark?"bg-gray-900":"bg-gray-50"),children:/* @__PURE__ */C.jsx("pre",{className:Xe("text-sm font-mono whitespace-pre-wrap",t.isDark?"text-gray-300":"text-gray-700"),children:E})}):/* @__PURE__ */C.jsxs("div",{className:"relative",children:[t.showZoomControls&&/* @__PURE__ */C.jsx("div",{className:"absolute top-2 right-2 z-10 rounded-lg",children:/* @__PURE__ */C.jsxs("div",{className:"flex items-center gap-2 backdrop-blur rounded-lg",children:[
|
|
80
|
+
/* @__PURE__ */C.jsx("button",{className:Xe("p-2 text-xs rounded transition-colors",t.isDark?"text-gray-400 hover:bg-gray-700":"text-gray-600 hover:bg-gray-200"),onClick:()=>v(Math.min(w+.1,3)),children:"+"}),
|
|
81
|
+
/* @__PURE__ */C.jsx("button",{className:Xe("p-2 text-xs rounded transition-colors",t.isDark?"text-gray-400 hover:bg-gray-700":"text-gray-600 hover:bg-gray-200"),onClick:()=>v(Math.max(w-.1,.5)),children:"-"}),
|
|
82
|
+
/* @__PURE__ */C.jsxs("button",{className:Xe("p-2 text-xs rounded transition-colors",t.isDark?"text-gray-400 hover:bg-gray-700":"text-gray-600 hover:bg-gray-200"),onClick:()=>{v(1),k({x:0,y:0})},children:[Math.round(100*w),"%"]})]})}),
|
|
83
|
+
/* @__PURE__ */C.jsx("div",{className:Xe("min-h-[360px] relative transition-all duration-100 overflow-hidden block",t.isDark?"bg-gray-900":"bg-gray-50"),style:{height:h},onMouseDown:P,onMouseMove:R,onMouseUp:W,onMouseLeave:W,onTouchStart:P,onTouchMove:R,onTouchEnd:W,children:/* @__PURE__ */C.jsx("div",{className:Xe("absolute inset-0 cursor-grab",b&&"cursor-grabbing"),style:{transform:`translate(${y.x}px, ${y.y}px) scale(${w})`},children:/* @__PURE__ */C.jsx("div",{ref:M,className:"w-full text-center flex items-center justify-center min-h-full"})})})]})})]}),f&&"undefined"!=typeof document&&x(
|
|
84
|
+
/* @__PURE__ */C.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/70 p-4",onClick:$,role:"dialog","aria-modal":"true",children:/* @__PURE__ */C.jsxs("div",{className:Xe("dialog-panel relative w-full h-full max-w-full max-h-full rounded shadow-lg overflow-hidden",t.isDark?"bg-gray-900":"bg-white"),onClick:e=>e.stopPropagation(),children:[
|
|
85
|
+
/* @__PURE__ */C.jsxs("div",{className:"absolute top-6 right-6 z-50 flex items-center gap-2",children:[
|
|
86
|
+
/* @__PURE__ */C.jsx("button",{className:Xe("p-2 text-xs rounded transition-colors",t.isDark?"text-gray-400 hover:bg-gray-700":"text-gray-600 hover:bg-gray-200"),onClick:()=>v(Math.min(w+.1,3)),children:"+"}),
|
|
87
|
+
/* @__PURE__ */C.jsx("button",{className:Xe("p-2 text-xs rounded transition-colors",t.isDark?"text-gray-400 hover:bg-gray-700":"text-gray-600 hover:bg-gray-200"),onClick:()=>v(Math.max(w-.1,.5)),children:"-"}),
|
|
88
|
+
/* @__PURE__ */C.jsxs("button",{className:Xe("p-2 text-xs rounded transition-colors",t.isDark?"text-gray-400 hover:bg-gray-700":"text-gray-600 hover:bg-gray-200"),onClick:()=>{v(1),k({x:0,y:0})},children:[Math.round(100*w),"%"]}),
|
|
89
|
+
/* @__PURE__ */C.jsx("button",{className:Xe("inline-flex items-center justify-center p-2 rounded transition-colors",t.isDark?"text-gray-400 hover:bg-gray-700":"text-gray-600 hover:bg-gray-200"),onClick:$,children:"X"})]}),
|
|
90
|
+
/* @__PURE__ */C.jsx("div",{ref:N,className:Xe("w-full h-full flex items-center justify-center p-4 overflow-hidden",!b&&"cursor-grab",b&&"cursor-grabbing"),onMouseDown:P,onMouseMove:R,onMouseUp:W,onMouseLeave:W,onTouchStart:P,onTouchMove:R,onTouchEnd:W})]})}),document.body)]})}function Lt(e){const{node:t}=e;/* @__PURE__ */
|
|
91
|
+
return C.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 Bt(e){/* @__PURE__ */
|
|
92
|
+
return C.jsx("ins",{className:"insert-node",children:e.children})}function Et(e){var n,r,o,i,s;const{node:l,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,s;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!=(s=e.animationIteration)?s:"infinite"}},[e.animationDuration,e.animationIteration,e.animationOpacity,e.animationTiming,e.color,e.underlineBottom,e.underlineHeight]),f=String(null!=(o=null!=(r=l.title)?r:l.href)?o:""),g=a(e=>{m&&oe(e.currentTarget,String(l.title||l.href||l.text||""),"top",!1,(e.clientX,e.clientY),h)},[h,l.href,l.text,l.title,m]),x=a(()=>{m&&ie()},[m]);return l.loading?/* @__PURE__ */C.jsx("span",{className:"link-loading inline-flex items-baseline gap-1.5","aria-hidden":"false",style:p,children:/* @__PURE__ */C.jsxs("span",{className:"link-text-wrapper relative inline-flex",children:[
|
|
93
|
+
/* @__PURE__ */C.jsx("span",{className:"leading-[normal] link-text",children:/* @__PURE__ */C.jsx("span",{className:"leading-[normal] link-text",children:null!=(i=l.text)?i:""})}),
|
|
94
|
+
/* @__PURE__ */C.jsx("span",{className:"underline-anim","aria-hidden":"true"})]})}):/* @__PURE__ */C.jsx("a",{className:"link-node",href:l.href,title:m?"":f,"aria-label":`Link: ${f}`,target:"_blank",rel:"noopener noreferrer",style:p,onMouseEnter:g,onMouseLeave:x,children:c&&d?S(l.children,c,String(null!=u?u:"link"),d):null!=(s=l.text)?s:null})}function Tt(e){const{node:t,ctx:n,renderNode:r,value:o,indexKey:i,children:s}=e,a=null==o?void 0:o;/* @__PURE__ */
|
|
95
|
+
return C.jsx("li",{className:"list-item pl-1.5 my-2",dir:"auto",value:a,children:null!=s?s:n&&r?S(t.children,n,String(null!=i?i:"list-item"),r):null})}function _t(e){var t;const{node:n,ctx:r,renderNode:o,indexKey:i}=e,s=n.ordered?"ol":"ul",a=n.ordered&&n.start?n.start:void 0;/* @__PURE__ */
|
|
96
|
+
return C.jsx(s,{className:Xe("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 s;/* @__PURE__ */
|
|
97
|
+
return C.jsx(Tt,{node:e,value:n.ordered?(null!=(s=n.start)?s:1)+t:void 0,ctx:r,renderNode:o,indexKey:`${String(null!=i?i:"list")}-${t}`},`${String(null!=i?i:"list")}-${t}`)})})}let $t=null,Dt=null,Ot=!1;const Pt=/* @__PURE__ */new Map,Rt=/* @__PURE__ */new Map;let Wt=5;const At=/* @__PURE__ */new Set;function It(){if(Pt.size<Wt&&At.size){const e=Array.from(At);At.clear();for(const t of e)try{t()}catch{}}}function Ft(e){$t=e,Dt=null,$t.onmessage=e=>{const{id:t,html:n,error:r}=e.data,o=Pt.get(t);if(o)if(Pt.delete(t),clearTimeout(o.timeoutId),It(),r)o.reject(new Error(r));else{const{content:t,displayMode:r}=e.data;if(t){const e=`${r?"d":"i"}:${t}`;if(Rt.set(e,n),Rt.size>200){const e=Rt.keys().next().value;Rt.delete(e)}}o.resolve(n)}},$t.onerror=e=>{console.error("[katexWorkerClient] Worker error:",e);for(const[t,n]of Pt.entries())clearTimeout(n.timeoutId),n.reject(new Error(`Worker error: ${e.message}`));Pt.clear(),It()}}function zt(){var e;$t&&(null==(e=$t.terminate)||e.call($t)),$t=null,Dt=null}function Ht(e){Ot=!!e,$t&&$t.postMessage({type:"init",debug:Ot})}const Vt="WORKER_BUSY";async function Kt(e,t=!0,n=2e3,r){if(performance.now(),Dt)return Promise.reject(Dt);const o=`${t?"d":"i"}:${e}`,i=Rt.get(o);if(i)return Promise.resolve(i);const s=$t||(Dt=new Error("[katexWorkerClient] No worker instance set. Please inject a Worker via setKaTeXWorker()."),Dt.name="WORKER_INIT_ERROR",Dt.code="WORKER_INIT_ERROR",null);if(!s)return Promise.reject(Dt);if(Pt.size>=Wt){const e=new Error("Worker busy");return e.name="WorkerBusy",e.code=Vt,e.busy=!0,e.inFlight=Pt.size,e.max=Wt,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),l=setTimeout(()=>{Pt.delete(a);const e=new Error("Worker render timed out");e.name="WorkerTimeout",e.code="WORKER_TIMEOUT",i(e),It()},n),c=()=>{},d=()=>{Pt.delete(a),clearTimeout(l),At.delete(c);const e=new Error("Aborted");e.name="AbortError",i(e),It()};r&&r.addEventListener("abort",d,{once:!0}),Pt.set(a,{resolve:e=>{r&&r.removeEventListener("abort",d),o(e)},reject:e=>{r&&r.removeEventListener("abort",d),i(e)},timeoutId:l});try{s.postMessage({id:a,content:e,displayMode:t,debug:Ot})}catch(u){Pt.delete(a),clearTimeout(l),r&&r.removeEventListener("abort",d),i(u),It()}})}function Xt(e,t,n){const r=`${t?"d":"i"}:${e}`;if(Rt.set(r,n),Rt.size>200){const e=Rt.keys().next().value;Rt.delete(e)}}function Ut(){Rt.clear()}function qt(e){Wt=Math.max(1,Math.floor(e)),It()}function Yt(e=1500,t){return Pt.size<Wt?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(){At.delete(s),null!=o&&clearTimeout(o),t&&t.removeEventListener("abort",a)}function s(){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}),At.add(s)})}const Zt={timeout:2e3,waitTimeout:1500,backoffMs:30,maxRetries:1};function Jt(e){null!=e.timeout&&(Zt.timeout=Math.max(0,Math.floor(e.timeout))),null!=e.waitTimeout&&(Zt.waitTimeout=Math.max(0,Math.floor(e.waitTimeout))),null!=e.backoffMs&&(Zt.backoffMs=Math.max(0,Math.floor(e.backoffMs))),null!=e.maxRetries&&(Zt.maxRetries=Math.max(0,Math.floor(e.maxRetries)))}function Gt(){return{...Zt}}async function Qt(e,t=!0,n={}){var r,o,i,s;const a=null!=(r=n.timeout)?r:Zt.timeout,l=null!=(o=n.waitTimeout)?o:Zt.waitTimeout,c=null!=(i=n.backoffMs)?i:Zt.backoffMs,d=null!=(s=n.maxRetries)?s:Zt.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 Kt(e,t,a,u)}catch(h){if((null==h?void 0:h.code)!==Vt||m>=d)throw h;if(m++,await Yt(l,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 en=null,tn=!1;async function nn(){if(en)return en;if(tn)return null;try{return en=await import("katex"),await import("katex/contrib/mhchem"),en}catch{return tn=!0,null}}function rn({node:e}){const t=i(null),[r,o]=n(!0),a=i(0);return s(()=>{var n;let r=!1;const i=new AbortController,s=++a.current,l=null!=(n=e.content)?n:"";return l?(Qt(l,!0,{timeout:3e3,waitTimeout:2e3,maxRetries:1,signal:i.signal}).then(e=>{r||s!==a.current||(t.current&&(t.current.innerHTML=e),o(!1))}).catch(async n=>{if(r||s!==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===Vt||"WORKER_TIMEOUT"===i){const n=await nn();if(n)try{const i=n.renderToString(l,{throwOnError:e.loading,displayMode:!0});return void(!r&&s===a.current&&t.current&&(t.current.innerHTML=i,o(!1),Xt(l,!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__ */C.jsx("div",{className:"math-block text-center overflow-x-auto relative min-h-[40px]",children:/* @__PURE__ */C.jsx("div",{ref:t,className:r?"math-rendering":void 0})})}function on({node:e}){const t=i(null),r=i(null),[o,a]=n(!0),l=i(0);return s(()=>{var t;let n=!1;const o=new AbortController,i=++l.current,s=null!=(t=e.content)?t:"";return s?(Qt(s,!1,{timeout:1500,waitTimeout:0,maxRetries:0,signal:o.signal}).then(e=>{n||i!==l.current||r.current&&(r.current.innerHTML=e,a(!1))}).catch(async t=>{if(n||i!==l.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===Vt||"WORKER_TIMEOUT"===o){const t=await nn();if(t)try{const o=t.renderToString(s,{throwOnError:e.loading,displayMode:!1});return void(!n&&i===l.current&&r.current&&(r.current.innerHTML=o,a(!1),Xt(s,!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__ */C.jsxs("span",{ref:t,className:"math-inline-wrapper",children:[
|
|
98
|
+
/* @__PURE__ */C.jsx("span",{ref:r,className:"math-inline"+(o?" math-inline--hidden":"")}),o&&/* @__PURE__ */C.jsxs("span",{className:"math-inline__loading",role:"status","aria-live":"polite",children:[
|
|
99
|
+
/* @__PURE__ */C.jsx("span",{className:"math-inline__spinner","aria-hidden":"true"}),
|
|
100
|
+
/* @__PURE__ */C.jsx("span",{className:"sr-only",children:"Loading"})]})]})}let sn=null,an=null;const ln=/* @__PURE__ */new Map;let cn=5,dn=!1;function un(e){dn=!!e}function mn(e){Number.isFinite(e)&&e>0&&(cn=Math.floor(e))}function hn(){return{inFlight:ln.size,max:cn}}const pn="WORKER_BUSY";function fn(e){sn=e,an=null;const t=e;sn.onmessage=e=>{if(sn!==t)return;const{id:n,ok:r,result:o,error:i}=e.data,s=ln.get(n);s&&(!1===r||i?s.reject(new Error(i||"Unknown error")):s.resolve(o))},sn.onerror=e=>{var n,r;if(sn===t)if(0!==ln.size){try{dn?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 ln.entries())n.reject(new Error(`Worker error: ${e.message}`));ln.clear()}else null==(n=console.debug)||n.call(console,"[mermaidWorkerClient] Worker error (no pending):",(null==e?void 0:e.message)||e)},sn.onmessageerror=e=>{var n,r;if(sn===t)if(0!==ln.size){try{dn?console.error("[mermaidWorkerClient] Worker messageerror:",e):null==(r=console.debug)||r.call(console,"[mermaidWorkerClient] Worker messageerror:",e)}catch{}for(const[e,t]of ln.entries())t.reject(new Error("Worker messageerror"));ln.clear()}else null==(n=console.debug)||n.call(console,"[mermaidWorkerClient] Worker messageerror (no pending):",e)}}function gn(){var e;if(sn)try{for(const[e,t]of ln.entries())t.reject(new Error("Worker cleared"));ln.clear(),null==(e=sn.terminate)||e.call(sn)}catch{}sn=null,an=null}function xn(e,t,n=1400){if(an)return Promise.reject(an);const r=sn||(an=new Error("[mermaidWorkerClient] No worker instance set. Please inject a Worker via setMermaidWorker()."),an.name="WORKER_INIT_ERROR",an.code="WORKER_INIT_ERROR",null);if(!r)return Promise.reject(an);if(ln.size>=cn){const e=new Error("Worker busy");return e.name="WorkerBusy",e.code=pn,e.inFlight=ln.size,e.max=cn,Promise.reject(e)}return new Promise((o,i)=>{const s=Math.random().toString(36).slice(2);let a=!1,l=null;const c=()=>{a||(a=!0,null!=l&&clearTimeout(l),ln.delete(s))},d={resolve:e=>{c(),o(e)},reject:e=>{c(),i(e)}};ln.set(s,d);try{r.postMessage({id:s,action:e,payload:t})}catch(u){return ln.delete(s),void i(u)}l=setTimeout(()=>{const e=new Error("Worker call timed out");e.name="WorkerTimeout",e.code="WORKER_TIMEOUT";const t=ln.get(s);null==t||t.reject(e)},n)})}async function wn(e,t,n=1400){return xn("canParse",{code:e,theme:t},n)}async function vn(e,t,n=2400){return xn("findPrefix",{code:e,theme:t},n)}function yn(){var e;null==(e=null==sn?void 0:sn.terminate)||e.call(sn),sn=null,an=null,ln.clear()}let kn=null,bn=!1,jn=null,Cn=null;function Mn(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(jn!==r)try{"function"==typeof e.initialize?e.initialize(t):(null==(n=e.mermaidAPI)?void 0:n.initialize)&&e.mermaidAPI.initialize(t),jn=r}catch{}}const Nn="undefined"!=typeof window?c:s,Sn={USE_PROFILES:{svg:!0},FORBID_TAGS:["script"],FORBID_ATTR:[/^on/i],ADD_TAGS:["style"],ADD_ATTR:["style"],SAFE_FOR_TEMPLATES:!0},Ln=[/javascript:/i,/expression\s*\(/i,/url\s*\(\s*javascript:/i,/@import/i],Bn=/^(?:https?:|mailto:|tel:|#|\/|data:image\/(?:png|gif|jpe?g|webp);)/i;function En(e){if(!e)return"";const t=e.trim();return Bn.test(t)?t:""}function Tn(e){if(e)try{e.replaceChildren()}catch{e.innerHTML=""}}function _n(e,t,n){if(!e)return"";if(n)return function(e,t){if(!e)return"";Tn(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(Ln.some(e=>e.test(n))){r.removeAttribute(e);continue}}if(("href"===e||"xlink:href"===e)&&t.value){const n=En(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(Tn(e),t)try{e.insertAdjacentHTML("afterbegin",t)}catch{e.innerHTML=t}return e.innerHTML}const $n={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 Dn(e){var r,o,l,c,d,u,m,h,p;const f={...$n,...e},{t:g}=Y(),w=t(()=>ue("mermaid"),[]),v=null!=(o=null==(r=f.node)?void 0:r.code)?o:"",y=t(()=>v.replace(/\]::([^:])/g,"]:::$1").replace(/:::subgraphNode$/gm,"::subgraphNode"),[v]),k=null!=(l=f.workerTimeoutMs)?l:$n.workerTimeoutMs,b=null!=(c=f.parseTimeoutMs)?c:$n.parseTimeoutMs,j=null!=(d=f.renderTimeoutMs)?d:$n.renderTimeoutMs,M=null!=(u=f.fullRenderTimeoutMs)?u:$n.fullRenderTimeoutMs,[N,S]=n(!1),[L,B]=n(!1),[E,T]=n(!1),[_,$]=n(!1),[D,P]=n(1),[R,W]=n({x:0,y:0}),[A,I]=n(!1),[F,z]=n(!1),[H,V]=n(!1),[K,X]=n(null),[U,q]=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),se=i(null),ae=i(null),le=i(null),ce=i({x:0,y:0}),de=i(0),me=i({}),he=i(""),pe=i(!1),fe=i(null),ge=i(!1),xe=i({zoom:1,translateX:0,translateY:0,containerHeight:Z||"360px"}),we=O(),ve=Boolean(null!=(h=null==(m=f.node)?void 0:m.loading)?h:f.loading),ye=f.isDark?"dark":"light",ke=Boolean(f.isStrict),be=t(()=>ke?{startOnLoad:!1,securityLevel:"strict",dompurifyConfig:Sn,flowchart:{htmlLabels:!1}}:{startOnLoad:!1,securityLevel:"loose"},[ke]);s(()=>{ge.current=H},[H]),s(()=>{me.current={}},[ye,y,ke]),s(()=>{let e=!1;return(async()=>{const t=await async function(e){if(kn)return Mn(kn,e),kn;if(Cn){const t=await Cn;return t&&Mn(t,e),t}if(bn)return null;try{bn=!0,Cn=(async()=>{try{const t=await import("mermaid"),n=(null==t?void 0:t.default)||t;if(kn=(null==n?void 0:n.default)?n.default:(null==n?void 0:n.mermaidAPI)?n:(null==n?void 0:n.mermaid)?n.mermaid:n,!kn)throw new Error("Mermaid module did not export expected API");return Mn(kn,null!=e?e:{startOnLoad:!1,securityLevel:"loose"}),kn}catch(t){return console.warn("[markstream-react] Failed to load mermaid:",t),null}finally{Cn=null}})();const t=await Cn;return t&&Mn(t,e),t}catch{return null}}(be);e||(ee.current=t,S(Boolean(t)),pe.current||B(!t))})(),()=>{e=!0}},[be]),s(()=>{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]),s(()=>{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 t=te.current,n=re.current;if(!t||!n)return;const r=n.querySelector("svg");if(!r)return;let o=0,i=0;const s=r.getAttribute("viewBox");if(s){const e=s.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),l=Number.isFinite(a)&&a>0?a:i;J(`${Math.min(l,i)}px`)},[]);s(()=>{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]),s(()=>()=>{yn()},[]);const Ce=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=Pn(e,t),s=await Wn(()=>ee.current.render(o,i),{timeoutMs:M,signal:n});if(!(null==s?void 0:s.svg))return!1;const a=_n(re.current,s.svg,ke);return null==(r=s.bindFunctions)||r.call(s,re.current),je(),me.current[t]=a,V(!0),X(null),!0}catch(o){return ve||X(o instanceof Error?o.message:String(o)),!1}finally{z(!1)}},[M,ve,ke,je]),Me=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=Pn(Rn(e)||e,t),s=await Wn(()=>ee.current.render(o,i),{timeoutMs:j,signal:n});(null==s?void 0:s.svg)&&(_n(re.current,s.svg,ke),null==(r=s.bindFunctions)||r.call(s,re.current),je())}catch{}finally{z(!1)}}},[j,ve,ke,je]),Ne=a(async(e,t)=>{if(!e.trim())return Tn(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 wn(e,t,n.workerTimeout))return!0}catch(s){if("AbortError"===(null==s?void 0:s.name))throw s}if(!n.mermaid)throw new Error("Mermaid not available");const r=Pn(e,t),o=n.mermaid;if("function"==typeof o.parse)return await Wn(()=>o.parse(r),{timeoutMs:n.parseTimeout,signal:n.signal}),!0;const i=`mermaid-parse-${Math.random().toString(36).slice(2,9)}`;return await Wn(()=>o.render(i,r),{timeoutMs:n.parseTimeout,signal:n.signal}),!0}(e,ye,{workerTimeout:k,parseTimeout:b,mermaid:ee.current,signal:t}),(null==t?void 0:t.aborted)||de.current!==r)return;return void(await Ce(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 vn(e,t,n.workerTimeout);if(r)return r}catch(o){if("AbortError"===(null==o?void 0:o.name))throw o}return Rn(e)}(e,ye,{workerTimeout:k,signal:t});if(!n||(null==t?void 0:t.aborted)||de.current!==r)return;await Me(n,ye,t)}catch{}},[b,Ce,Me,ye,k]);s(()=>{if(!G||L||E)return;const e=new AbortController;return Ne(y,e.signal),()=>e.abort()},[y,E,Ne,L,G]);const Se=a((e,t)=>{e.clientX,e.clientY,oe(e.currentTarget,t,"top",!1,0,f.isDark)},[f.isDark]),Le=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]),Be=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=An(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:An(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]),Ee=a(()=>{le.current=null,Tn(ae.current)},[]),Te=a(()=>{q(!1),Ee()},[Ee]),_e=a(()=>{var e,t,n;const r=null!=(t=null==(e=re.current)?void 0:e.querySelector("svg"))?t:null,o=r?An(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||q(!0)},[f]);s(()=>{if(!U)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,U]),Nn(()=>{if(!U)return;const e=ae.current,t=te.current;if(!e||!t)return;const n=`translate(${R.x}px, ${R.y}px) scale(${D})`,r=t.cloneNode(!0);r.classList.add("fullscreen");const o=r.querySelector("[data-mermaid-wrapper]");o&&(le.current=o,o.style.transform=n),Tn(e),e.appendChild(r)},[U]),s(()=>{U&&le.current&&(le.current.style.transform=`translate(${R.x}px, ${R.y}px) scale(${D})`)},[U,R.x,R.y,D]);const $e=L||F||E,De=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]),Oe=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){B(!1);const e=xe.current;P(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()):Ne(y)}else xe.current={zoom:D,translateX:R.x,translateY:R.y,containerHeight:Z},B(!0)},[y,Z,Ne,f,ye,R.x,R.y,je,D]),Pe=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-R.x,o=e.clientY-n.top-R.y,i=.01*-e.deltaY,s=On(D+i,.5,3);if(s===D)return;const a=s/D;W({x:R.x-r*(a-1),y:R.y-o*(a-1)}),P(s)},[R,D]),Re=a((e,t)=>{I(!0),ce.current={x:e-R.x,y:t-R.y}},[R.x,R.y]),We=a((e,t)=>{A&&W({x:e-ce.current.x,y:t-ce.current.y})},[A]),Ae=a(()=>{I(!1)},[]),Ie=/* @__PURE__ */C.jsxs("div",{className:"relative",children:[f.showZoomControls&&/* @__PURE__ */C.jsx("div",{className:"absolute top-2 right-2 z-10 rounded-lg",children:/* @__PURE__ */C.jsxs("div",{className:"flex items-center gap-2 backdrop-blur rounded-lg",children:[
|
|
101
|
+
/* @__PURE__ */C.jsx("button",{type:"button",className:Xe("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:()=>P(On(D+.1,.5,3)),children:"+"}),
|
|
102
|
+
/* @__PURE__ */C.jsx("button",{type:"button",className:Xe("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:()=>P(On(D-.1,.5,3)),children:"−"}),
|
|
103
|
+
/* @__PURE__ */C.jsxs("button",{type:"button",className:Xe("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:()=>{P(1),W({x:0,y:0})},children:[Math.round(100*D),"%"]})]})}),
|
|
104
|
+
/* @__PURE__ */C.jsxs("div",{ref:te,className:Xe("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:Pe,onMouseDown:e=>{0===e.button&&(e.preventDefault(),Re(e.clientX,e.clientY))},onMouseMove:e=>We(e.clientX,e.clientY),onMouseUp:Ae,onMouseLeave:Ae,onTouchStart:e=>{const t=e.touches[0];t&&Re(t.clientX,t.clientY)},onTouchMove:e=>{const t=e.touches[0];t&&We(t.clientX,t.clientY)},onTouchEnd:Ae,children:[
|
|
105
|
+
/* @__PURE__ */C.jsx("div",{ref:ne,"data-mermaid-wrapper":!0,className:Xe("absolute inset-0 cursor-grab",{"cursor-grabbing":A}),style:{transform:`translate(${R.x}px, ${R.y}px) scale(${D})`},children:/* @__PURE__ */C.jsx("div",{ref:re,className:"_mermaid w-full text-center flex items-center justify-center min-h-full"})}),(F||ve)&&/* @__PURE__ */C.jsxs("div",{className:"mermaid-loading",children:[
|
|
106
|
+
/* @__PURE__ */C.jsx("span",{className:"mermaid-spinner"}),
|
|
107
|
+
/* @__PURE__ */C.jsx("span",{children:"Rendering diagram…"})]})]})]}),Fe=f.showHeader&&/* @__PURE__ */C.jsxs("div",{className:Xe("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:[
|
|
108
|
+
/* @__PURE__ */C.jsxs("div",{className:"flex items-center space-x-2 overflow-hidden",children:[
|
|
109
|
+
/* @__PURE__ */C.jsx("span",{className:"icon-slot h-4 w-4 flex-shrink-0",dangerouslySetInnerHTML:{__html:w}}),
|
|
110
|
+
/* @__PURE__ */C.jsx("span",{className:Xe("text-sm font-medium font-mono truncate",f.isDark?"text-gray-400":"text-gray-600"),children:"Mermaid"})]}),f.showModeToggle&&N&&/* @__PURE__ */C.jsxs("div",{className:Xe("flex items-center space-x-1 rounded-md p-0.5",f.isDark?"bg-gray-700":"bg-gray-100"),children:[
|
|
111
|
+
/* @__PURE__ */C.jsx("button",{type:"button",className:Xe("px-2.5 py-1 text-xs rounded transition-colors",L?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:()=>Oe("preview"),onMouseEnter:e=>Se(e,g("common.preview")),onFocus:e=>Se(e,g("common.preview")),onMouseLeave:()=>ie(),onBlur:()=>ie(),children:/* @__PURE__ */C.jsxs("div",{className:"flex items-center space-x-1",children:[
|
|
112
|
+
/* @__PURE__ */C.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__ */C.jsxs("g",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",children:[
|
|
113
|
+
/* @__PURE__ */C.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"}),
|
|
114
|
+
/* @__PURE__ */C.jsx("circle",{cx:"12",cy:"12",r:"3"})]})}),
|
|
115
|
+
/* @__PURE__ */C.jsx("span",{children:g("common.preview")})]})}),
|
|
116
|
+
/* @__PURE__ */C.jsx("button",{type:"button",className:Xe("px-2.5 py-1 text-xs rounded transition-colors",L?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:()=>Oe("source"),onMouseEnter:e=>Se(e,g("common.source")),onFocus:e=>Se(e,g("common.source")),onMouseLeave:()=>ie(),onBlur:()=>ie(),children:/* @__PURE__ */C.jsxs("div",{className:"flex items-center space-x-1",children:[
|
|
117
|
+
/* @__PURE__ */C.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__ */C.jsx("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"m16 18l6-6l-6-6M8 6l-6 6l6 6"})}),
|
|
118
|
+
/* @__PURE__ */C.jsx("span",{children:g("common.source")})]})})]}),
|
|
119
|
+
/* @__PURE__ */C.jsxs("div",{className:"flex items-center space-x-1",children:[f.showCollapseButton&&/* @__PURE__ */C.jsx("button",{type:"button",className:De,"aria-pressed":E,onClick:()=>T(e=>!e),onMouseEnter:e=>Se(e,g(E?"common.expand":"common.collapse")),onFocus:e=>Se(e,g(E?"common.expand":"common.collapse")),onMouseLeave:()=>ie(),onBlur:()=>ie(),children:/* @__PURE__ */C.jsx("svg",{style:{rotate:E?"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__ */C.jsx("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"m9 18l6-6l-6-6"})})}),f.showCopyButton&&/* @__PURE__ */C.jsx("button",{type:"button",className:De,onClick:Le,onMouseEnter:e=>Se(e,g(_?"common.copySuccess":"common.copy")),onFocus:e=>Se(e,g(_?"common.copySuccess":"common.copy")),onMouseLeave:()=>ie(),onBlur:()=>ie(),children:_?/* @__PURE__ */C.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__ */C.jsx("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M20 6L9 17l-5-5"})}):/* @__PURE__ */C.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__ */C.jsxs("g",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",children:[
|
|
120
|
+
/* @__PURE__ */C.jsx("rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2"}),
|
|
121
|
+
/* @__PURE__ */C.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&&N&&/* @__PURE__ */C.jsx("button",{type:"button",className:Xe(De,$e?"opacity-50 cursor-not-allowed":""),disabled:$e,onClick:Be,onMouseEnter:e=>Se(e,g("common.export")),onFocus:e=>Se(e,g("common.export")),onMouseLeave:()=>ie(),onBlur:()=>ie(),children:/* @__PURE__ */C.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__ */C.jsxs("g",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",children:[
|
|
122
|
+
/* @__PURE__ */C.jsx("path",{d:"M12 15V3m9 12v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}),
|
|
123
|
+
/* @__PURE__ */C.jsx("path",{d:"m7 10l5 5l5-5"})]})})}),f.showFullscreenButton&&N&&/* @__PURE__ */C.jsx("button",{type:"button",className:Xe(De,$e?"opacity-50 cursor-not-allowed":""),disabled:$e,onClick:U?Te:_e,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__ */C.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__ */C.jsx("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"m14 10l7-7m-1 7h-6V4M3 21l7-7m-6 0h6v6"})}):/* @__PURE__ */C.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__ */C.jsx("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M15 3h6v6m0-6l-7 7M3 21l7-7m-1 7H3v-6"})})})]})]}),ze=/* @__PURE__ */C.jsxs("div",{children:[L?/* @__PURE__ */C.jsx("div",{className:Xe("p-4",f.isDark?"bg-gray-900 text-gray-300":"bg-gray-50 text-gray-700"),children:/* @__PURE__ */C.jsx("pre",{className:"text-sm font-mono whitespace-pre-wrap",children:y})}):Ie,K&&/* @__PURE__ */C.jsx("div",{className:"mermaid-error",children:K})]});/* @__PURE__ */
|
|
124
|
+
return C.jsxs(C.Fragment,{children:[
|
|
125
|
+
/* @__PURE__ */C.jsxs("div",{className:Xe("my-4 rounded-lg border overflow-hidden shadow-sm mermaid-block",f.isDark?"border-gray-700/30":"border-gray-200",{"is-rendering":ve}),children:[Fe,!E&&/* @__PURE__ */C.jsx("div",{ref:se,children:ze})]}),U&&"undefined"!=typeof document&&x(
|
|
126
|
+
/* @__PURE__ */C.jsx("div",{className:"mermaid-modal-overlay",onClick:()=>Te(),children:/* @__PURE__ */C.jsxs("div",{className:Xe("mermaid-modal-panel",{"is-dark":f.isDark}),role:"dialog","aria-modal":"true",onClick:e=>e.stopPropagation(),children:[
|
|
127
|
+
/* @__PURE__ */C.jsxs("div",{className:"mermaid-modal-header",children:[
|
|
128
|
+
/* @__PURE__ */C.jsx("span",{className:"mermaid-modal-title",children:"Mermaid Preview"}),
|
|
129
|
+
/* @__PURE__ */C.jsx("button",{type:"button",className:"mermaid-modal-close",onClick:Te,children:"Close"})]}),
|
|
130
|
+
/* @__PURE__ */C.jsx("div",{className:"mermaid-modal-body",children:/* @__PURE__ */C.jsx("div",{ref:ae,className:"mermaid-modal-content"})})]})}),document.body)]})}function On(e,t,n){return Math.min(Math.max(e,t),n)}function Pn(e,t){return e.trimStart().startsWith("%%{")?e:`%%{init: {"theme": "${"dark"===t?"dark":"default"}"}}%%\n${e}`}function Rn(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 Wn(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,s=null;function a(){i||(i=!0,l(),o(new DOMException("Aborted","AbortError")))}function l(){null!=s&&clearTimeout(s),r&&r.removeEventListener("abort",a)}r&&r.addEventListener("abort",a,{once:!0}),n&&n>0&&(s=setTimeout(()=>{i||(i=!0,l(),o(new Error("Operation timed out")))},n)),e().then(e=>{i||(i=!0,l(),t(e))}).catch(e=>{i||(i=!0,l(),o(e))})})}function An(e){return(new XMLSerializer).serializeToString(e)}function In(e){const{node:t}=e;/* @__PURE__ */
|
|
131
|
+
return C.jsxs("div",{className:"unknown-node text-sm text-gray-500 italic",children:["Unsupported node type:"," ",String(null==t?void 0:t.type)]})}function Fn(t){var n;const{node:r,ctx:o,renderNode:i,indexKey:s,children:a}=t;if(!o||!i)/* @__PURE__ */
|
|
132
|
+
return C.jsx("p",{dir:"auto",className:"paragraph-node",children:a});const l=null!=(n=r.children)?n:[],c=[],d=[],u=()=>{if(!d.length)return;const e=c.length;c.push(
|
|
133
|
+
/* @__PURE__ */C.jsx("p",{dir:"auto",className:"paragraph-node",children:S(d.slice(),o,`${String(null!=s?s:"paragraph")}-${e}`,i)},`${String(null!=s?s:"paragraph")}-inline-${e}`)),d.length=0};return l.forEach((t,n)=>{M.has(t.type)?(u(),c.push(
|
|
134
|
+
/* @__PURE__ */C.jsx(e.Fragment,{children:i(t,`${String(null!=s?s:"paragraph")}-block-${n}`,o)},`${String(null!=s?s:"paragraph")}-block-${n}`))):d.push(t)}),u(),c.length?/* @__PURE__ */C.jsx(C.Fragment,{children:c}):/* @__PURE__ */C.jsx("p",{dir:"auto",className:"paragraph-node",children:S(l,o,String(null!=s?s:"paragraph"),i)})}function zn(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__ */
|
|
135
|
+
return C.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 Hn(e){/* @__PURE__ */
|
|
136
|
+
return C.jsx("s",{className:"strikethrough-node",children:e.children})}function Vn(e){/* @__PURE__ */
|
|
137
|
+
return C.jsx("strong",{className:"strong-node",children:e.children})}function Kn(e){/* @__PURE__ */
|
|
138
|
+
return C.jsx("sub",{className:"subscript-node",children:e.children})}function Xn(e){/* @__PURE__ */
|
|
139
|
+
return C.jsx("sup",{className:"superscript-node",children:e.children})}function Un(e){var t;const{node:n,ctx:r,renderNode:o,indexKey:i}=e,s=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),l=Array.isArray(null==n?void 0:n.rows)?n.rows:[],c=e=>"right"===e?"text-right":"center"===e?"text-center":"text-left";/* @__PURE__ */
|
|
140
|
+
return C.jsxs("div",{className:"table-node-wrapper","data-index-key":i,children:[
|
|
141
|
+
/* @__PURE__ */C.jsxs("table",{className:Xe("my-8 text-sm table-node",a&&"table-node--loading"),"aria-busy":a,children:[
|
|
142
|
+
/* @__PURE__ */C.jsx("thead",{className:"border-[var(--table-border,#cbd5e1)]",children:/* @__PURE__ */C.jsx("tr",{className:"border-b",children:s.map((e,t)=>/* @__PURE__ */C.jsx("th",{className:Xe("font-semibold p-[calc(4/7*1em)]",c(e.align)),dir:"auto",children:r&&o?L(e.children,r,`${String(null!=i?i:"table")}-th-${t}`,o):null},`header-${t}`))})}),
|
|
143
|
+
/* @__PURE__ */C.jsx("tbody",{children:l.map((e,t)=>{var n;/* @__PURE__ */
|
|
144
|
+
return C.jsx("tr",{className:Xe("border-[var(--table-border,#cbd5e1)]",t<l.length-1&&"border-b"),children:null==(n=e.cells)?void 0:n.map((e,n)=>/* @__PURE__ */C.jsx("td",{className:Xe("p-[calc(4/7*1em)]",c(e.align)),dir:"auto",children:r&&o?L(e.children,r,`${String(null!=i?i:"table")}-row-${t}-${n}`,o):null},`cell-${t}-${n}`))},`row-${t}`)})})]}),a&&/* @__PURE__ */C.jsxs("div",{className:"table-node__loading",role:"status","aria-live":"polite",children:[
|
|
145
|
+
/* @__PURE__ */C.jsx("span",{className:"table-node__spinner","aria-hidden":"true"}),
|
|
146
|
+
/* @__PURE__ */C.jsx("span",{className:"sr-only",children:"Loading"})]})]})}function qn(e){const{node:t,children:n}=e;/* @__PURE__ */
|
|
147
|
+
return C.jsx("span",{className:Xe("text-node whitespace-pre-wrap break-words",t.center&&"text-node-center"),children:null!=n?n:t.content})}function Yn(){/* @__PURE__ */
|
|
148
|
+
return C.jsx("hr",{className:"hr-node thematic-break"})}function Zn(n){const{node:r,ctx:o,renderNode:i,indexKey:s}=n,a=`vmr-container vmr-container-${r.name}`,l=t(()=>{if(r.attrs)return Array.isArray(r.attrs)?N(r.attrs):r.attrs},[r.attrs]);/* @__PURE__ */
|
|
149
|
+
return C.jsx("div",{className:a,...l,children:o&&i&&Array.isArray(r.children)?r.children.map((t,n)=>/* @__PURE__ */C.jsx(e.Fragment,{children:i(t,`${String(null!=s?s:"vmr-container")}-${n}`,o)},`${String(null!=s?s:"vmr-container")}-${n}`)):null})}function Jn(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 Gn(t,n,r){var o,i;const s=H(r.customId),a=s[t.type];if(a)return e.createElement(a,{key:n,node:t,customId:r.customId,isDark:r.isDark,ctx:r,renderNode:Gn,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?s[i]:null;if(a){const o={...t,type:i,tag:i,content:Jn(t.content,i)};return e.createElement(a,{key:n,node:o,customId:r.customId,isDark:r.isDark,ctx:r,renderNode:Gn,indexKey:n,typewriter:r.typewriter})}}switch(t.type){case"text":/* @__PURE__ */
|
|
150
|
+
return C.jsx(qn,{node:t,typewriter:r.typewriter},n);case"text_special":/* @__PURE__ */
|
|
151
|
+
return C.jsx(qn,{node:{type:"text",content:null!=(i=t.content)?i:"",center:t.center},typewriter:r.typewriter},n);case"paragraph":/* @__PURE__ */
|
|
152
|
+
return C.jsx(Fn,{node:t,ctx:r,renderNode:Gn,indexKey:n,typewriter:r.typewriter},n);case"heading":/* @__PURE__ */
|
|
153
|
+
return C.jsx(Ue,{node:t,ctx:r,renderNode:Gn,indexKey:n,typewriter:r.typewriter},n);case"blockquote":/* @__PURE__ */
|
|
154
|
+
return C.jsx(ir,{node:t,ctx:r,renderNode:Gn,indexKey:n,typewriter:r.typewriter},n);case"list":/* @__PURE__ */
|
|
155
|
+
return C.jsx(_t,{node:t,ctx:r,renderNode:Gn,indexKey:n,typewriter:r.typewriter},n);case"list_item":/* @__PURE__ */
|
|
156
|
+
return C.jsx(Tt,{node:t,ctx:r,renderNode:Gn,indexKey:n,typewriter:r.typewriter},n);case"table":/* @__PURE__ */
|
|
157
|
+
return C.jsx(Un,{node:t,ctx:r,renderNode:Gn,indexKey:n,typewriter:r.typewriter},n);case"definition_list":/* @__PURE__ */
|
|
158
|
+
return C.jsx(We,{node:t,ctx:r,renderNode:Gn,indexKey:n,typewriter:r.typewriter},n);case"footnote":/* @__PURE__ */
|
|
159
|
+
return C.jsx(ze,{node:t,ctx:r,renderNode:Gn,indexKey:n,typewriter:r.typewriter},n);case"footnote_reference":/* @__PURE__ */
|
|
160
|
+
return C.jsx(He,{node:t},n);case"footnote_anchor":/* @__PURE__ */
|
|
161
|
+
return C.jsx(Fe,{node:t},n);case"admonition":/* @__PURE__ */
|
|
162
|
+
return C.jsx(E,{node:t,ctx:r,renderNode:Gn,indexKey:n,isDark:r.isDark,typewriter:r.typewriter},n);case"hardbreak":/* @__PURE__ */
|
|
163
|
+
return C.jsx(Ve,{node:t,typewriter:r.typewriter},n);case"link":/* @__PURE__ */
|
|
164
|
+
return C.jsx(Et,{node:t,ctx:r,renderNode:Gn,indexKey:n,isDark:r.isDark,typewriter:r.typewriter},n);case"image":/* @__PURE__ */
|
|
165
|
+
return C.jsx(bt,{node:t},n);case"inline_code":/* @__PURE__ */
|
|
166
|
+
return C.jsx(Lt,{node:t,typewriter:r.typewriter},n);case"code_block":return function(t,n,r){var o,i,s,a;const l=ce(String(t.language||""));if("mermaid"===l){const o=H(r.customId).mermaid;if(o)return e.createElement(o,{key:n,node:t,isDark:r.isDark});if(!r.renderCodeBlocksAsPre)/* @__PURE__ */
|
|
167
|
+
return C.jsx(Dn,{node:t,isDark:r.isDark,loading:Boolean(t.loading)},n)}if("infographic"===l){const o=H(r.customId).infographic;return o?e.createElement(o,{key:n,node:t,isDark:r.isDark}):/* @__PURE__ */C.jsx(St,{node:t,isDark:r.isDark,loading:Boolean(t.loading)},n)}return r.renderCodeBlocksAsPre||"mermaid"===l?/* @__PURE__ */C.jsx(Oe,{node:t},n):/* @__PURE__ */C.jsx(Re,{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==(s=r.codeBlockThemes)?void 0:s.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__ */
|
|
168
|
+
return C.jsx(Vn,{node:t,children:S(t.children,r,`${String(n)}-strong`,Gn)},n);case"emphasis":/* @__PURE__ */
|
|
169
|
+
return C.jsx(Ie,{node:t,children:S(t.children,r,`${String(n)}-em`,Gn)},n);case"strikethrough":/* @__PURE__ */
|
|
170
|
+
return C.jsx(Hn,{node:t,children:S(t.children,r,`${String(n)}-strike`,Gn)},n);case"highlight":/* @__PURE__ */
|
|
171
|
+
return C.jsx(qe,{node:t,children:S(t.children,r,`${String(n)}-highlight`,Gn)},n);case"insert":/* @__PURE__ */
|
|
172
|
+
return C.jsx(Bt,{node:t,children:S(t.children,r,`${String(n)}-insert`,Gn)},n);case"subscript":/* @__PURE__ */
|
|
173
|
+
return C.jsx(Kn,{node:t,children:S(t.children,r,`${String(n)}-sub`,Gn)},n);case"superscript":/* @__PURE__ */
|
|
174
|
+
return C.jsx(Xn,{node:t,children:S(t.children,r,`${String(n)}-sup`,Gn)},n);case"checkbox":case"checkbox_input":/* @__PURE__ */
|
|
175
|
+
return C.jsx(X,{node:t,typewriter:r.typewriter},n);case"emoji":/* @__PURE__ */
|
|
176
|
+
return C.jsx(Ae,{node:t,typewriter:r.typewriter},n);case"thematic_break":/* @__PURE__ */
|
|
177
|
+
return C.jsx(Yn,{},n);case"math_inline":/* @__PURE__ */
|
|
178
|
+
return C.jsx(on,{node:t},n);case"math_block":/* @__PURE__ */
|
|
179
|
+
return C.jsx(rn,{node:t},n);case"reference":/* @__PURE__ */
|
|
180
|
+
return C.jsx(zn,{node:t,ctx:r,typewriter:r.typewriter},n);case"html_block":case"html_inline":return"html_block"===t.type?/* @__PURE__ */C.jsx(it,{node:t,typewriter:r.typewriter,customId:r.customId},n):/* @__PURE__ */C.jsx(yt,{node:t,typewriter:r.typewriter,customId:r.customId},n);case"vmr_container":/* @__PURE__ */
|
|
181
|
+
return C.jsx(Zn,{node:t,ctx:r,renderNode:Gn,indexKey:n,typewriter:r.typewriter},n);case"label_open":case"label_close":return null;default:/* @__PURE__ */
|
|
182
|
+
return C.jsx(In,{node:t},n)}}const Qn={codeBlockStream:!0,typewriter:!0,batchRendering:!0,initialRenderBatchSize:40,renderBatchSize:80,renderBatchDelay:16,renderBatchBudgetMs:6,renderBatchIdleTimeoutMs:120,deferNodesUntilVisible:!0,maxLiveNodes:320,liveNodeBuffer:60},er=d();function tr(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 nr(e){return/^[a-z][a-z0-9-]*$/.test(e)}const rr=e.memo(({props:e,parsedNodes:r,renderCtx:o,indexPrefix:l,containerRef:c})=>{var d,u,m,h,p,f,g;const x=O(),w="undefined"!=typeof window,v="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),M=Math.max(1,null!=(h=e.maxLiveNodes)?h:320),N=(null!=(p=e.maxLiveNodes)?p:0)>0&&r.length>M,S=!1!==e.viewportPriority,L=b&&(null!=(f=e.maxLiveNodes)?f:0)<=0,B=t(()=>{var t;return!1!==e.deferNodesUntilVisible&&!((null!=(t=e.maxLiveNodes)?t:0)<=0)&&!N&&!(r.length>900)&&S},[r.length,e.deferNodesUntilVisible,e.maxLiveNodes,S,N]),[E,T]=n(()=>L?Math.min(r.length,k):r.length),_=i(E);s(()=>{_.current=E},[E]);const $=L?E:r.length,[D,P]=n(0),[R,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(E),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}),te=i({batchSize:y,initial:k,delay:null!=(g=e.renderBatchDelay)?g:16,enabled:L}),ne=B||N,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(!N)return r.map((e,t)=>({node:e,index:t}));const e=r.length,t=Math.max(0,Math.min(R.start,e)),n=Math.max(t,Math.min(R.end,e));return r.slice(t,n).map((e,n)=>({node:e,index:t+n}))},[r,R,N]),ie=t(()=>{if(!N)return r.length;const e=Math.max(R.end+j,k),t=Math.min(r.length,e);return Math.max(E,t)},[r.length,N,R.end,j,k,E]);Q.current=ie;const se=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=N?se(0,Math.min(R.start,r.length)):0,le=N?se(Math.min(R.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(t=>{var n;if(!L)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)))},[L,e.renderBatchBudgetMs,y]),ue=a((t,n={})=>{var r,o;if(!L)return;const i=Q.current;if(_.current>=i)return;const s=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 _.current=n,n});const n="undefined"!=typeof performance?performance.now():Date.now();de(n-t)},l=()=>{const e=Math.max(1,Math.round(G.current));ue(e)},c=t=>{var n;U.current=null,q.current=null,Y.current=null,Z.current=!1;const r=J.current;if(J.current=null,a(null!=r?r:s),_.current>=Q.current)return;if(!t)return void l();const o=Math.max(2,null!=(n=e.renderBatchBudgetMs)?n:6);for(;_.current<Q.current&&!(("function"==typeof t.timeRemaining?t.timeRemaining():0)<=.5*o);)a(Math.max(1,Math.round(G.current)));_.current<Q.current&&l()};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,s):s,!Z.current){if(Z.current=!0,v){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?U.current=requestAnimationFrame(()=>{0!==d?q.current=window.setTimeout(()=>c(),d):c()}):q.current=window.setTimeout(()=>c(),d)}},[de,v,L,w,e.renderBatchDelay,e.renderBatchBudgetMs,e.renderBatchIdleTimeoutMs]);s(()=>{var t;const n=e.indexKey,o=r.length,i=ee.current,s=void 0!==n?n!==i.key:o!==i.total;ee.current={key:n,total:o};const a=te.current,l=null!=(t=e.renderBatchDelay)?t:16,c=a.batchSize!==y||a.initial!==k||a.delay!==l||a.enabled!==L;if(te.current={batchSize:y,initial:k,delay:l,enabled:L},(s||c||!L)&&ce(),(s||c)&&(G.current=Math.max(1,y||1),K.current.clear()),!o)return _.current=0,void T(0);const d=Q.current;if(!L)return _.current=d,void T(d);if(s||c){const e=Math.min(d,k);return _.current=e,T(e),void(e<d&&ue(Math.max(1,k),{immediate:!w}))}const u=Math.min(_.current,d);u!==_.current&&(_.current=u,T(u)),_.current<d&&ue(Math.max(1,y||1))},[ce,L,w,r.length,e.indexKey,e.renderBatchDelay,y,k,ue]),s(()=>{if(!N)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(D,e-1));let n=Math.max(0,t-j),o=Math.min(e,t+j+1);const i=o-n;if(i>M){const e=i-M;n+=Math.ceil(e/2),o-=Math.floor(e/2)}else if(i<M){const t=M-i;n=Math.max(0,n-Math.ceil(t/2)),o=Math.min(e,o+Math.floor(t/2))}W({start:n,end:o})},[D,j,M,r.length,N]),s(()=>()=>{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))},[]);s(()=>{me($)},[me,$]),s(()=>{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)=>{B&&t&&(z.current[e]=!0),t&&N&&P(t=>e>t?e:t)},[B,N]),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),B&&!t&&delete z.current[e],void(t&&he(e,!0));if(e<k&&!N)return pe(e),void he(e,!0);pe(e);const r=x(t,{rootMargin:"400px"});H.current.set(e,r),r.isVisible()&&he(e,!0),r.whenVisible.then(()=>he(e,!0)).catch(()=>{})},[B,pe,he,x,k,ne,N]),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)},[]),xe=a(e=>!(L&&e>=_.current)&&(!B||e<k||!0===z.current[e]),[B,L,k]),we=a(e=>t=>{if(!e)return;const n=t.target;(null==n?void 0:n.closest("[data-node-index]"))&&e(t)},[]);s(()=>{for(const[e,t]of V.current.entries())t&&fe(e,t)},[fe]),s(()=>{N&&E>X.current&&P(E-1),X.current=E},[E,N]);const ve=N?/* @__PURE__ */C.jsx("div",{className:"node-spacer",style:{height:`${ae}px`},"aria-hidden":"true"}):null,ye=N?/* @__PURE__ */C.jsx("div",{className:"node-spacer",style:{height:`${le}px`},"aria-hidden":"true"}):null;/* @__PURE__ */
|
|
183
|
+
return C.jsxs("div",{ref:c,className:`markstream-react markdown-renderer${e.isDark?" dark":""}${N?" virtualized":""}`,onClick:e.onClick,onMouseOver:we(e.onMouseOver),onMouseOut:we(e.onMouseOut),children:[ve,oe.map(({node:t,index:n})=>{var r;const i=xe(n),s=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__ */C.jsx("div",{ref:e=>fe(n,e),className:"node-slot","data-node-index":n,"data-node-type":t.type,children:i?/* @__PURE__ */C.jsx("div",{ref:e=>ge(n,e),className:"node-content"+(a?" typewriter-node":""),children:Gn(t,`${l}-${n}`,o)}):/* @__PURE__ */C.jsx("div",{className:"node-placeholder",style:{height:`${s}px`}})},`${l}-${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}),or=e=>{const n={...Qn,...e},r=i(null),o=i(null),a=l(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(nr)},[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(tr).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]),x=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:er,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(s(()=>{var e,t;if("undefined"==typeof window)return;if(n.renderCodeBlocksAsPre)return;if(!x.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(()=>{xe()},{timeout:900});return()=>o(i)},[x,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&&e&&"name"in e)return String(e.name);if("object"==typeof e){const t=_e.get(e);if(t)return t;try{const t=JSON.stringify(e);if(t)return _e.set(e,t),t}catch{}const n="__theme_"+ ++$e;return _e.set(e,n),n}return String(e)}(e);t&&Be!==t&&(Le=e,Be=t,Ee&&Se(Le,Ee).then(()=>De()).catch(()=>{}))}(e))}const w=t(()=>null!=n.indexKey?String(n.indexKey):"markdown-renderer",[n.indexKey]),v=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__ */
|
|
184
|
+
return C.jsx(D,{getRoot:()=>r.current,enabled:!1!==n.viewportPriority,children:/* @__PURE__ */C.jsx(rr,{props:n,parsedNodes:x,renderCtx:v,indexPrefix:w,containerRef:r})})};function ir(e){var t,n,r,o,i,s;const{node:a,ctx:l,renderNode:c,indexKey:d,children:u}=e;/* @__PURE__ */
|
|
185
|
+
return C.jsx("blockquote",{className:"blockquote-node",dir:"auto",cite:a.cite,children:null!=u?u:l&&c?/* @__PURE__ */C.jsx(or,{nodes:a.children||[],indexKey:`blockquote-${String(null!=d?d:"blockquote")}`,customId:l.customId,isDark:l.isDark,typewriter:l.typewriter,viewportPriority:!0,codeBlockStream:l.codeBlockStream,renderCodeBlocksAsPre:l.renderCodeBlocksAsPre,codeBlockProps:l.codeBlockProps,themes:null==(t=l.codeBlockThemes)?void 0:t.themes,codeBlockDarkTheme:null==(n=l.codeBlockThemes)?void 0:n.darkTheme,codeBlockLightTheme:null==(r=l.codeBlockThemes)?void 0:r.lightTheme,codeBlockMonacoOptions:null==(o=l.codeBlockThemes)?void 0:o.monacoOptions,codeBlockMinWidth:null==(i=l.codeBlockThemes)?void 0:i.minWidth,codeBlockMaxWidth:null==(s=l.codeBlockThemes)?void 0:s.maxWidth,onCopy:l.events.onCopy,onHandleArtifactClick:l.events.onHandleArtifactClick}):null})}function sr(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]),l=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),[x,w]=n(!1),[v,y]=n(!1),[k,b]=n(""),[j,M]=n(!1),[N,S]=n(14),[L,B]=n(N),E=i(null),T=i(null),_=i(null),$=i(null),D=i(!1),O=a(()=>r.isDark?r.darkTheme:r.lightTheme,[r.darkTheme,r.isDark,r.lightTheme]),P=a(e=>{if(!e)return b(""),void M(!1);var t;b(`<pre class="shiki shiki-fallback"><code>${t=e,t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}</code></pre>`),M(!1)},[]),R=a(()=>{b(""),M(!0)},[]),W=a(async()=>{if(!$.current&&!D.current){D.current=!0;try{const e=await import("stream-markdown");$.current=e.createShikiStreamRenderer}catch{}}},[]),A=a(async()=>{if(await W(),E.current&&T.current)if(!_.current&&$.current&&(_.current=$.current(T.current,{theme:O(),themes:r.themes}),M(!0)),_.current)if(!1===r.stream&&r.loading)P(r.node.code);else{P(r.node.code);try{await _.current.updateCode(r.node.code,l),R()}catch{}}else P(r.node.code);else P(r.node.code)},[R,W,O,l,r.loading,r.node.code,r.stream,r.themes,P]);s(()=>(A(),()=>{var e;null==(e=_.current)||e.dispose(),_.current=null}),[A]),s(()=>{_.current&&_.current.setTheme(O())},[O]),s(()=>{_.current&&(!1===r.stream&&r.loading||(P(r.node.code),Promise.resolve(_.current.updateCode(r.node.code,l)).then(()=>R()).catch(()=>{})))},[R,l,r.loading,r.node.code,r.stream,P]);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"===l?"text/html":"image/svg+xml",n="html"===l?"HTML Preview":"SVG Preview";null==(e=r.onPreviewCode)||e.call(r,{type:t,content:r.node.code,title:n})},[h,l,r]),V=t(()=>({fontSize:`${L}px`}),[L]);return s(()=>{S(14),B(14)},[]),/* @__PURE__ */C.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__ */C.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:[
|
|
186
|
+
/* @__PURE__ */C.jsxs("div",{className:"flex items-center space-x-2",children:[
|
|
187
|
+
/* @__PURE__ */C.jsx("span",{className:"icon-slot h-4 w-4 flex-shrink-0",dangerouslySetInnerHTML:{__html:u}}),
|
|
188
|
+
/* @__PURE__ */C.jsx("span",{className:"text-sm font-medium font-mono",children:d})]}),
|
|
189
|
+
/* @__PURE__ */C.jsxs("div",{className:"flex items-center space-x-2",children:[
|
|
190
|
+
/* @__PURE__ */C.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:()=>y(e=>!e),onMouseEnter:e=>I(e,v?m("common.expand")||"Expand":m("common.collapse")||"Collapse"),onFocus:e=>I(e,v?m("common.expand")||"Expand":m("common.collapse")||"Collapse"),onMouseLeave:F,onBlur:F,children:/* @__PURE__ */C.jsx("svg",{style:{rotate:v?"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__ */C.jsx("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"m9 18l6-6l-6-6"})})}),r.showFontSizeButtons&&r.enableFontSizeControl&&/* @__PURE__ */C.jsxs(C.Fragment,{children:[
|
|
191
|
+
/* @__PURE__ */C.jsx("button",{type:"button",className:"code-action-btn p-2 text-xs rounded-md transition-colors hover:bg-[var(--vscode-editor-selectionBackground)]",disabled:L<=10,onClick:()=>B(e=>Math.max(10,e-1)),onMouseEnter:e=>I(e,m("common.decrease")||"Decrease"),onFocus:e=>I(e,m("common.decrease")||"Decrease"),onMouseLeave:F,onBlur:F,children:/* @__PURE__ */C.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__ */C.jsx("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M5 12h14"})})}),
|
|
192
|
+
/* @__PURE__ */C.jsx("button",{type:"button",className:"code-action-btn p-2 text-xs rounded-md transition-colors hover:bg-[var(--vscode-editor-selectionBackground)]",disabled:L===N,onClick:()=>B(N),onMouseEnter:e=>I(e,m("common.reset")||"Reset"),onFocus:e=>I(e,m("common.reset")||"Reset"),onMouseLeave:F,onBlur:F,children:/* @__PURE__ */C.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__ */C.jsxs("g",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",children:[
|
|
193
|
+
/* @__PURE__ */C.jsx("path",{d:"M3 12a9 9 0 1 0 9-9a9.75 9.75 0 0 0-6.74 2.74L3 8"}),
|
|
194
|
+
/* @__PURE__ */C.jsx("path",{d:"M3 3v5h5"})]})})}),
|
|
195
|
+
/* @__PURE__ */C.jsx("button",{type:"button",className:"code-action-btn p-2 text-xs rounded-md transition-colors hover:bg-[var(--vscode-editor-selectionBackground)]",disabled:L>=36,onClick:()=>B(e=>Math.min(36,e+1)),onMouseEnter:e=>I(e,m("common.increase")||"Increase"),onFocus:e=>I(e,m("common.increase")||"Increase"),onMouseLeave:F,onBlur:F,children:/* @__PURE__ */C.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__ */C.jsx("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M5 12h14m-7-7v14"})})})]}),r.showCopyButton&&/* @__PURE__ */C.jsx("button",{type:"button",className:"code-action-btn p-2 text-xs rounded-md transition-colors hover:bg-[var(--vscode-editor-selectionBackground)]","aria-label":f?m("common.copied")||"Copied":m("common.copy")||"Copy",onClick:z,onMouseEnter:e=>I(e,f?m("common.copied")||"Copied":m("common.copy")||"Copy"),onFocus:e=>I(e,f?m("common.copied")||"Copied":m("common.copy")||"Copy"),onMouseLeave:F,onBlur:F,children:f?/* @__PURE__ */C.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__ */C.jsx("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M20 6L9 17l-5-5"})}):/* @__PURE__ */C.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__ */C.jsxs("g",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",children:[
|
|
196
|
+
/* @__PURE__ */C.jsx("rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2"}),
|
|
197
|
+
/* @__PURE__ */C.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__ */C.jsx("button",{type:"button",className:"code-action-btn p-2 text-xs rounded-md transition-colors hover:bg-[var(--vscode-editor-selectionBackground)]","aria-pressed":x,onClick:()=>w(e=>!e),onMouseEnter:e=>I(e,x?m("common.collapse")||"Collapse":m("common.expand")||"Expand"),onFocus:e=>I(e,x?m("common.collapse")||"Collapse":m("common.expand")||"Expand"),onMouseLeave:F,onBlur:F,children:x?/* @__PURE__ */C.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__ */C.jsx("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M15 3h6v6m0-6l-7 7M3 21l7-7m-1 7H3v-6"})}):/* @__PURE__ */C.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__ */C.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__ */C.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__ */C.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__ */C.jsxs("g",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",children:[
|
|
198
|
+
/* @__PURE__ */C.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"}),
|
|
199
|
+
/* @__PURE__ */C.jsx("circle",{cx:"12",cy:"12",r:"3"})]})})})]})]}),!v&&(!!r.stream||!r.loading)&&/* @__PURE__ */C.jsxs("div",{ref:E,className:"code-block-content",style:{...V,maxHeight:x?"none":"500px",overflow:x?"visible":"auto"},children:[
|
|
200
|
+
/* @__PURE__ */C.jsx("div",{ref:T,className:"code-block-render"}),!j&&k&&/* @__PURE__ */C.jsx("div",{className:"code-fallback-plain",dangerouslySetInnerHTML:{__html:k}})]}),!r.stream&&r.loading&&/* @__PURE__ */C.jsx("div",{className:"code-loading-placeholder",children:/* @__PURE__ */C.jsxs("div",{className:"loading-skeleton",children:[
|
|
201
|
+
/* @__PURE__ */C.jsx("div",{className:"skeleton-line"}),
|
|
202
|
+
/* @__PURE__ */C.jsx("div",{className:"skeleton-line"}),
|
|
203
|
+
/* @__PURE__ */C.jsx("div",{className:"skeleton-line short"})]})}),
|
|
204
|
+
/* @__PURE__ */C.jsx("span",{className:"sr-only","aria-live":"polite",role:"status",children:f?m("common.copied")||"Copied":""})]})}function ar(e){var r;const o=i(null),[a,l]=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 s(()=>{if(!e.visible)return void l(!1);if(!e.anchorEl||!o.current)return void l(!0);let t=null,n=!1;const r=async()=>{var t,r;if(!e.anchorEl||!o.current)return;const{x:i,y:s}=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(s)}px, 0)`})};return r().then(()=>{n||l(!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?x(
|
|
205
|
+
/* @__PURE__ */C.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{E as AdmonitionNode,ir as BlockquoteNode,X as CheckboxNode,Re as CodeBlockNode,We as DefinitionListNode,Ae as EmojiNode,Ie as EmphasisNode,In as FallbackComponent,Fe as FootnoteAnchorNode,ze as FootnoteNode,He as FootnoteReferenceNode,Ve as HardBreakNode,Ue as HeadingNode,qe as HighlightNode,it as HtmlBlockNode,yt as HtmlInlineNode,he as HtmlPreviewFrame,bt as ImageNode,St as InfographicBlockNode,Lt as InlineCodeNode,Bt as InsertNode,Et as LinkNode,Tt as ListItemNode,_t as ListNode,pn as MERMAID_WORKER_BUSY_CODE,sr as MarkdownCodeBlockNode,rn as MathBlockNode,on as MathInlineNode,Dn as MermaidBlockNode,or as NodeRenderer,Fn as ParagraphNode,Oe as PreCodeNode,Re as ReactCodeBlockNode,zn as ReferenceNode,Hn as StrikethroughNode,Vn as StrongNode,Kn as SubscriptNode,Xn as SuperscriptNode,Un as TableNode,qn as TextNode,Yn as ThematicBreakNode,ar as Tooltip,Zn as VmrContainerNode,Vt as WORKER_BUSY_CODE,wn as canParseOffthread,K as clearGlobalCustomComponents,Ut as clearKaTeXCache,zt as clearKaTeXWorker,gn as clearMermaidWorker,vn as findPrefixOffthread,H as getCustomNodeComponents,Gt as getKaTeXBackpressureDefaults,ue as getLanguageIcon,hn as getMermaidWorkerLoad,me as languageMap,ce as normalizeLanguageIdentifier,V as removeCustomComponents,Kt as renderKaTeXInWorker,Qt as renderKaTeXWithBackpressure,Gn as renderNode,de as resolveMonacoLanguageId,z as setCustomComponents,q as setDefaultI18nMap,Jt as setKaTeXBackpressureDefaults,Xt as setKaTeXCache,qt as setKaTeXConcurrencyLimit,Ft as setKaTeXWorker,Ht as setKaTeXWorkerDebug,ae as setLanguageIconResolver,fn as setMermaidWorker,un as setMermaidWorkerClientDebug,mn as setMermaidWorkerMaxConcurrency,yn as terminateWorker,Y as useSafeI18n,Yt as waitForKaTeXWorkerSlot};
|