@loxia-labs/loxia-autopilot-one 1.0.18 → 1.0.19
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/README.md +2 -2
- package/bin/cli.js +1 -1
- package/bin/loxia-terminal-v2.js +1 -1
- package/bin/loxia-terminal.js +1 -1
- package/bin/start-with-terminal.js +1 -1
- package/package.json +1 -1
- package/scripts/install-scanners.js +1 -1
- package/src/analyzers/CSSAnalyzer.js +1 -1
- package/src/analyzers/ConfigValidator.js +1 -1
- package/src/analyzers/ESLintAnalyzer.js +1 -1
- package/src/analyzers/JavaScriptAnalyzer.js +1 -1
- package/src/analyzers/PrettierFormatter.js +1 -1
- package/src/analyzers/PythonAnalyzer.js +1 -1
- package/src/analyzers/SecurityAnalyzer.js +1 -1
- package/src/analyzers/TypeScriptAnalyzer.js +1 -1
- package/src/analyzers/codeCloneDetector/analyzer.js +1 -1
- package/src/analyzers/codeCloneDetector/detector.js +1 -1
- package/src/analyzers/codeCloneDetector/index.js +1 -1
- package/src/analyzers/codeCloneDetector/parser.js +1 -1
- package/src/analyzers/codeCloneDetector/reporter.js +1 -1
- package/src/analyzers/codeCloneDetector/scanner.js +1 -1
- package/src/core/agentPool.js +1 -1
- package/src/core/agentScheduler.js +1 -1
- package/src/core/contextManager.js +1 -1
- package/src/core/messageProcessor.js +1 -1
- package/src/core/orchestrator.js +1 -1
- package/src/core/stateManager.js +1 -1
- package/src/index.js +1 -1
- package/src/interfaces/cli.js +1 -1
- package/src/interfaces/terminal/__tests__/smoke/advancedFeatures.test.js +1 -1
- package/src/interfaces/terminal/__tests__/smoke/agentControl.test.js +1 -1
- package/src/interfaces/terminal/__tests__/smoke/agents.test.js +1 -1
- package/src/interfaces/terminal/__tests__/smoke/components.test.js +1 -1
- package/src/interfaces/terminal/__tests__/smoke/connection.test.js +1 -1
- package/src/interfaces/terminal/__tests__/smoke/enhancements.test.js +1 -1
- package/src/interfaces/terminal/__tests__/smoke/imports.test.js +1 -1
- package/src/interfaces/terminal/__tests__/smoke/messages.test.js +1 -1
- package/src/interfaces/terminal/__tests__/smoke/tools.test.js +1 -1
- package/src/interfaces/terminal/api/apiClient.js +1 -1
- package/src/interfaces/terminal/api/messageRouter.js +1 -1
- package/src/interfaces/terminal/api/session.js +1 -1
- package/src/interfaces/terminal/api/websocket.js +1 -1
- package/src/interfaces/terminal/components/AgentCreator.js +1 -1
- package/src/interfaces/terminal/components/AgentEditor.js +1 -1
- package/src/interfaces/terminal/components/AgentSwitcher.js +1 -1
- package/src/interfaces/terminal/components/ErrorBoundary.js +1 -1
- package/src/interfaces/terminal/components/ErrorPanel.js +1 -1
- package/src/interfaces/terminal/components/Header.js +1 -1
- package/src/interfaces/terminal/components/HelpPanel.js +1 -1
- package/src/interfaces/terminal/components/InputBox.js +1 -1
- package/src/interfaces/terminal/components/Layout.js +1 -1
- package/src/interfaces/terminal/components/LoadingSpinner.js +1 -1
- package/src/interfaces/terminal/components/MessageList.js +1 -1
- package/src/interfaces/terminal/components/MultilineTextInput.js +1 -1
- package/src/interfaces/terminal/components/SearchPanel.js +1 -1
- package/src/interfaces/terminal/components/SettingsPanel.js +1 -1
- package/src/interfaces/terminal/components/StatusBar.js +1 -1
- package/src/interfaces/terminal/components/TextInput.js +1 -1
- package/src/interfaces/terminal/config/agentEditorConstants.js +1 -1
- package/src/interfaces/terminal/config/constants.js +1 -1
- package/src/interfaces/terminal/index.js +1 -1
- package/src/interfaces/terminal/state/useAgentControl.js +1 -1
- package/src/interfaces/terminal/state/useAgents.js +1 -1
- package/src/interfaces/terminal/state/useConnection.js +1 -1
- package/src/interfaces/terminal/state/useMessages.js +1 -1
- package/src/interfaces/terminal/state/useTools.js +1 -1
- package/src/interfaces/terminal/utils/debugLogger.js +1 -1
- package/src/interfaces/terminal/utils/settingsStorage.js +1 -1
- package/src/interfaces/terminal/utils/theme.js +1 -1
- package/src/interfaces/webServer.js +1 -1
- package/src/modules/fileExplorer/controller.js +1 -1
- package/src/modules/fileExplorer/index.js +1 -1
- package/src/modules/fileExplorer/middleware.js +1 -1
- package/src/modules/fileExplorer/routes.js +1 -1
- package/src/services/agentActivityService.js +1 -1
- package/src/services/aiService.js +1 -1
- package/src/services/apiKeyManager.js +1 -1
- package/src/services/benchmarkService.js +1 -1
- package/src/services/budgetService.js +1 -1
- package/src/services/contextInjectionService.js +1 -1
- package/src/services/conversationCompactionService.js +1 -1
- package/src/services/errorHandler.js +1 -1
- package/src/services/fileAttachmentService.js +1 -1
- package/src/services/modelRouterService.js +1 -1
- package/src/services/modelsService.js +1 -1
- package/src/services/qualityInspector.js +1 -1
- package/src/services/tokenCountingService.js +1 -1
- package/src/tools/agentCommunicationTool.js +1 -1
- package/src/tools/agentDelayTool.js +1 -1
- package/src/tools/asyncToolManager.js +1 -1
- package/src/tools/baseTool.js +1 -1
- package/src/tools/browserTool.js +1 -1
- package/src/tools/cloneDetectionTool.js +1 -1
- package/src/tools/dependencyResolverTool.js +1 -1
- package/src/tools/fileContentReplaceTool.js +1 -1
- package/src/tools/fileSystemTool.js +1 -1
- package/src/tools/fileTreeTool.js +1 -1
- package/src/tools/imageTool.js +1 -1
- package/src/tools/importAnalyzerTool.js +1 -1
- package/src/tools/jobDoneTool.js +1 -1
- package/src/tools/seekTool.js +1 -1
- package/src/tools/staticAnalysisTool.js +1 -1
- package/src/tools/taskManagerTool.js +1 -1
- package/src/tools/terminalTool.js +1 -1
- package/src/tools/webTool.js +1 -1
- package/src/types/agent.js +1 -1
- package/src/types/contextReference.js +1 -1
- package/src/types/conversation.js +1 -1
- package/src/types/toolCommand.js +1 -1
- package/src/utilities/attachmentValidator.js +1 -1
- package/src/utilities/configManager.js +1 -1
- package/src/utilities/constants.js +1 -1
- package/src/utilities/directoryAccessManager.js +1 -1
- package/src/utilities/fileProcessor.js +1 -1
- package/src/utilities/logger.js +1 -1
- package/src/utilities/tagParser.js +1 -1
- package/src/utilities/toolConstants.js +1 -1
- package/src/utilities/userDataDir.js +1 -1
- package/web-ui/build/index.html +1 -1
- package/web-ui/build/static/{index-DL2-PyNX.js → index-CcwO7jS4.js} +8 -8
|
@@ -256,7 +256,7 @@ to {
|
|
|
256
256
|
*
|
|
257
257
|
* This source code is licensed under the MIT license found in the
|
|
258
258
|
* LICENSE file in the root directory of this source tree.
|
|
259
|
-
*/var Bs=f,BO=UO;function $O(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var zO=typeof Object.is=="function"?Object.is:$O,GO=BO.useSyncExternalStore,qO=Bs.useRef,HO=Bs.useEffect,VO=Bs.useMemo,WO=Bs.useDebugValue;K1.useSyncExternalStoreWithSelector=function(e,t,r,n,a){var i=qO(null);if(i.current===null){var s={hasValue:!1,value:null};i.current=s}else s=i.current;i=VO(function(){function u(g){if(!c){if(c=!0,d=g,g=n(g),a!==void 0&&s.hasValue){var x=s.value;if(a(x,g))return p=x}return p=g}if(x=p,zO(d,g))return x;var v=n(g);return a!==void 0&&a(x,v)?(d=g,x):(d=g,p=v)}var c=!1,d,p,m=r===void 0?null:r;return[function(){return u(t())},m===null?void 0:function(){return u(m())}]},[t,r,n,a]);var l=GO(e,i[0],i[1]);return HO(function(){s.hasValue=!0,s.value=l},[l]),WO(l),l};Y1.exports=K1;var YO=Y1.exports;const KO=Ai(YO),Q1={},{useDebugValue:ZO}=ct,{useSyncExternalStoreWithSelector:XO}=KO;let Uy=!1;const QO=e=>e;function JO(e,t=QO,r){(Q1?"production":void 0)!=="production"&&r&&!Uy&&(console.warn("[DEPRECATED] Use `createWithEqualityFn` instead of `create` or use `useStoreWithEqualityFn` instead of `useStore`. They can be imported from 'zustand/traditional'. https://github.com/pmndrs/zustand/discussions/1937"),Uy=!0);const n=XO(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,r);return ZO(n),n}const By=e=>{(Q1?"production":void 0)!=="production"&&typeof e!="function"&&console.warn("[DEPRECATED] Passing a vanilla store will be unsupported in a future version. Instead use `import { useStore } from 'zustand'`.");const t=typeof e=="function"?RO(e):e,r=(n,a)=>JO(t,n,a);return Object.assign(r,t),r},J1=e=>e?By(e):By,eL=e=>(t,r,n)=>{const a=n.subscribe;return n.subscribe=(s,l,u)=>{let c=s;if(l){const d=(u==null?void 0:u.equalityFn)||Object.is;let p=s(n.getState());c=m=>{const g=s(m);if(!d(p,g)){const x=p;l(p=g,x)}},u!=null&&u.fireImmediately&&l(p,p)}return a(c)},e(t,r,n)},eA=eL,tL="http://localhost:8080/api";class rL{async request(t,r={}){const n=`${tL}${t}`,a={headers:{"Content-Type":"application/json",...r.headers},...r};a.body&&typeof a.body=="object"&&(a.body=JSON.stringify(a.body));try{const i=await fetch(n,a);if(!i.ok)throw new Error(`HTTP ${i.status}: ${i.statusText}`);const s=await i.json();return console.log(`API Success: ${a.method||"GET"} ${n}`,s),s}catch(i){throw console.error(`API request failed: ${a.method||"GET"} ${n}`,i),i.name==="SyntaxError"&&console.error("Response was not valid JSON"),i}}async createSession(t=null){return this.request("/sessions",{method:"POST",body:{projectDir:t}})}async orchestratorRequest(t,r,n,a=null){return this.request("/orchestrator",{method:"POST",body:{sessionId:t,action:r,payload:n,projectDir:a}})}async createAgent(t,r,n=null){return this.orchestratorRequest(t,"create_agent",r,n)}async updateAgent(t,r,n,a=null){return this.orchestratorRequest(t,"update_agent",{agentId:r,updates:n},a)}async sendMessage(t,r,n=null){const a={...r,sessionId:t};return this.orchestratorRequest(t,"send_message",a,n)}async listAgents(t,r=null){return this.orchestratorRequest(t,"list_agents",{},r)}async getStatus(t,r=null){return this.orchestratorRequest(t,"get_session_state",{},r)}async pauseAgent(t,r,n=null){return this.orchestratorRequest(t,"pause_agent",r,n)}async resumeAgent(t,r,n=null){return this.orchestratorRequest(t,"resume_agent",r,n)}async switchModel(t,r,n=null){return this.orchestratorRequest(t,"switch_model",r,n)}async getAgentStatus(t,r,n=null){return this.orchestratorRequest(t,"get_agent_status",r,n)}async getAgentConversations(t,r,n=null){return this.orchestratorRequest(t,"get_agent_conversations",{agentId:r},n)}async deleteAgent(t,r,n=null){return this.orchestratorRequest(t,"delete_agent",r,n)}async unloadAgent(t,r,n=null){return this.orchestratorRequest(t,"unload_agent",r,n)}async getFiles(t=".",r=null){const n=new URLSearchParams({path:t});return r&&n.append("projectDir",r),this.request(`/files?${n}`)}async uploadFile(t,r,n=null){return this.request("/files/upload",{method:"POST",body:{fileName:t,content:r,projectDir:n}})}async openDirectory(t){return this.request("/file-explorer/open",{method:"POST",body:{path:t}})}async getSystemInfo(){return this.request("/file-explorer/cwd")}async getAvailableModels(t=null){var i;const r={},a=(i=JSON.parse(localStorage.getItem("loxia-settings")||"{}").apiKeys)==null?void 0:i.loxiaBackend;return a&&a.trim()&&(r.Authorization=`Bearer ${a}`),this.request("/llm/models",{headers:r})}async getTools(){return this.request("/tools")}async setAgentMode(t,r,n=!1,a=null){return this.request(`/agents/${t}/mode`,{method:"POST",body:{mode:r,lockMode:n,sessionId:a}})}async getAgentMode(t){return this.request(`/agents/${t}/mode`)}async stopAgentExecution(t){return this.request(`/agents/${t}/stop`,{method:"POST"})}async clearConversation(t){return this.request(`/agents/${t}/clear`,{method:"POST"})}async setApiKeys(t,r){return this.request("/keys",{method:"POST",body:{sessionId:t,...r}})}async getApiKeyStatus(t){return this.request(`/keys/${t}`)}async removeApiKeys(t){return this.request(`/keys/${t}`,{method:"DELETE"})}async health(){return this.request("/health")}}const xe=new rL,vr=J1(eA((e,t)=>({models:[],loading:!1,error:null,lastFetched:null,apiKeyStatuses:{},fetchModels:async()=>{e({loading:!0,error:null});try{const r=await xe.getAvailableModels();if(r.success!==!1){const n=r.models||[];return e({models:n,loading:!1,lastFetched:new Date().toISOString()}),n}else throw new Error(r.error||"Failed to fetch models")}catch(r){throw console.error("Failed to fetch models:",r),e({error:r.message,loading:!1,models:[]}),r}},getModelsByCategory:()=>{const{models:r,apiKeyStatuses:n}=t(),a=l=>{const u=JSON.parse(localStorage.getItem("loxia-settings")||"{}");return u.apiKeys&&u.apiKeys[l]&&u.apiKeys[l].trim().length>0},i=[],s=[];return r.forEach(l=>{const u={id:`${l.name}-platform`,modelName:l.name,platformProvided:!0,displayName:`${t().formatModelName(l.name)} (Platform)`,description:t().getModelDescription(l),provider:l.category,available:!0,pricing:l.pricing,features:{supportsVision:l.supportsVision||!1,supportsSystem:l.supportsSystem||!1,maxTokens:l.maxTokens||4096}};i.push(u);const c=t().getProviderKey(l.category);if(c){const d={id:`${l.name}-direct`,modelName:l.name,platformProvided:!1,displayName:`${t().formatModelName(l.name)} (Direct)`,description:`Direct ${l.category} API access`,provider:l.category,available:a(c),requiresKey:c,pricing:l.pricing,features:u.features};s.push(d)}}),{platform:{title:"Loxia Platform Models",description:"Managed models available through your Loxia subscription",badge:"Platform",models:i},direct:{title:"Direct Provider Access",description:"Use your personal API keys (configure in Settings)",badge:"Personal",models:s}}},formatModelName:r=>({"anthropic-sonnet":"Claude Sonnet","anthropic-opus":"Claude Opus","anthropic-haiku":"Claude Haiku","gpt-4":"GPT-4","gpt-4-mini":"GPT-4 Mini","deepseek-r1":"DeepSeek R1","phi-4":"Phi-4"})[r]||r,getModelDescription:r=>({"anthropic-sonnet":"Best balance of intelligence and speed","anthropic-opus":"Most capable, best for complex tasks","anthropic-haiku":"Fastest, good for simple tasks","gpt-4":"OpenAI's most capable model","gpt-4-mini":"Smaller, faster version of GPT-4","deepseek-r1":"Advanced reasoning model","phi-4":"Microsoft's efficient model"})[r.name]||`${r.category} model with ${r.maxTokens||4096} max tokens`,getProviderKey:r=>({anthropic:"anthropic",openai:"openai",azure:"azure",deepseek:"deepseek",phi:"phi",microsoft:"phi"})[r==null?void 0:r.toLowerCase()],refreshIfStale:async()=>{const{lastFetched:r,fetchModels:n}=t(),a=new Date(Date.now()-5*60*1e3);if(!r||new Date(r)<a)try{await n()}catch(i){console.warn("Failed to refresh models:",i.message)}},updateApiKeyStatus:(r,n)=>{e(a=>({apiKeyStatuses:{...a.apiKeyStatuses,[r]:n}}))},isModelAvailable:r=>{const n=t().getModelsByCategory(),a=n.platform.models.find(s=>s.id===r);if(a)return a.available;const i=n.direct.models.find(s=>s.id===r);return i?i.available:!1},clearError:()=>{e({error:null})}})));vr.getState().fetchModels().catch(console.error);const Jm={LOXIA_ANTHROPIC_SONNET:"loxia-anthropic-sonnet"},ie={CODING_ASSISTANT:"coding-assistant",DATA_ANALYST:"data-analyst",CREATIVE_WRITER:"creative-writer",SYSTEM_ADMIN:"system-admin",SECURITY_ARCHITECT:"security-architect",CUSTOM:"custom"},Yn={[ie.CODING_ASSISTANT]:{name:"Coding Assistant",description:"General-purpose coding and development assistant",prompt:`
|
|
259
|
+
*/var Bs=f,BO=UO;function $O(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var zO=typeof Object.is=="function"?Object.is:$O,GO=BO.useSyncExternalStore,qO=Bs.useRef,HO=Bs.useEffect,VO=Bs.useMemo,WO=Bs.useDebugValue;K1.useSyncExternalStoreWithSelector=function(e,t,r,n,a){var i=qO(null);if(i.current===null){var s={hasValue:!1,value:null};i.current=s}else s=i.current;i=VO(function(){function u(g){if(!c){if(c=!0,d=g,g=n(g),a!==void 0&&s.hasValue){var x=s.value;if(a(x,g))return p=x}return p=g}if(x=p,zO(d,g))return x;var v=n(g);return a!==void 0&&a(x,v)?(d=g,x):(d=g,p=v)}var c=!1,d,p,m=r===void 0?null:r;return[function(){return u(t())},m===null?void 0:function(){return u(m())}]},[t,r,n,a]);var l=GO(e,i[0],i[1]);return HO(function(){s.hasValue=!0,s.value=l},[l]),WO(l),l};Y1.exports=K1;var YO=Y1.exports;const KO=Ai(YO),Q1={},{useDebugValue:ZO}=ct,{useSyncExternalStoreWithSelector:XO}=KO;let Uy=!1;const QO=e=>e;function JO(e,t=QO,r){(Q1?"production":void 0)!=="production"&&r&&!Uy&&(console.warn("[DEPRECATED] Use `createWithEqualityFn` instead of `create` or use `useStoreWithEqualityFn` instead of `useStore`. They can be imported from 'zustand/traditional'. https://github.com/pmndrs/zustand/discussions/1937"),Uy=!0);const n=XO(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,r);return ZO(n),n}const By=e=>{(Q1?"production":void 0)!=="production"&&typeof e!="function"&&console.warn("[DEPRECATED] Passing a vanilla store will be unsupported in a future version. Instead use `import { useStore } from 'zustand'`.");const t=typeof e=="function"?RO(e):e,r=(n,a)=>JO(t,n,a);return Object.assign(r,t),r},J1=e=>e?By(e):By,eL=e=>(t,r,n)=>{const a=n.subscribe;return n.subscribe=(s,l,u)=>{let c=s;if(l){const d=(u==null?void 0:u.equalityFn)||Object.is;let p=s(n.getState());c=m=>{const g=s(m);if(!d(p,g)){const x=p;l(p=g,x)}},u!=null&&u.fireImmediately&&l(p,p)}return a(c)},e(t,r,n)},eA=eL,tL="http://localhost:8080/api";class rL{async request(t,r={}){const n=`${tL}${t}`,a={headers:{"Content-Type":"application/json",...r.headers},...r};a.body&&typeof a.body=="object"&&(a.body=JSON.stringify(a.body));try{const i=await fetch(n,a);if(!i.ok)throw new Error(`HTTP ${i.status}: ${i.statusText}`);const s=await i.json();return console.log(`API Success: ${a.method||"GET"} ${n}`,s),s}catch(i){throw console.error(`API request failed: ${a.method||"GET"} ${n}`,i),i.name==="SyntaxError"&&console.error("Response was not valid JSON"),i}}async createSession(t=null){return this.request("/sessions",{method:"POST",body:{projectDir:t}})}async orchestratorRequest(t,r,n,a=null){return this.request("/orchestrator",{method:"POST",body:{sessionId:t,action:r,payload:n,projectDir:a}})}async createAgent(t,r,n=null){return this.orchestratorRequest(t,"create_agent",r,n)}async updateAgent(t,r,n,a=null){return this.orchestratorRequest(t,"update_agent",{agentId:r,updates:n},a)}async sendMessage(t,r,n=null){const a={...r,sessionId:t};return this.orchestratorRequest(t,"send_message",a,n)}async listAgents(t,r=null){return this.orchestratorRequest(t,"list_agents",{},r)}async getStatus(t,r=null){return this.orchestratorRequest(t,"get_session_state",{},r)}async pauseAgent(t,r,n=null){return this.orchestratorRequest(t,"pause_agent",r,n)}async resumeAgent(t,r,n=null){return this.orchestratorRequest(t,"resume_agent",r,n)}async switchModel(t,r,n=null){return this.orchestratorRequest(t,"switch_model",r,n)}async getAgentStatus(t,r,n=null){return this.orchestratorRequest(t,"get_agent_status",r,n)}async getAgentConversations(t,r,n=null){return this.orchestratorRequest(t,"get_agent_conversations",{agentId:r},n)}async deleteAgent(t,r,n=null){return this.orchestratorRequest(t,"delete_agent",r,n)}async unloadAgent(t,r,n=null){return this.orchestratorRequest(t,"unload_agent",r,n)}async getFiles(t=".",r=null){const n=new URLSearchParams({path:t});return r&&n.append("projectDir",r),this.request(`/files?${n}`)}async uploadFile(t,r,n=null){return this.request("/files/upload",{method:"POST",body:{fileName:t,content:r,projectDir:n}})}async openDirectory(t){return this.request("/file-explorer/open",{method:"POST",body:{path:t}})}async getSystemInfo(){return this.request("/file-explorer/cwd")}async getAvailableModels(t=null){var i;const r={},a=(i=JSON.parse(localStorage.getItem("loxia-settings")||"{}").apiKeys)==null?void 0:i.loxiaBackend;return a&&a.trim()&&(r.Authorization=`Bearer ${a}`),this.request("/llm/models",{headers:r})}async getTools(){return this.request("/tools")}async setAgentMode(t,r,n=!1,a=null){return this.request(`/agents/${t}/mode`,{method:"POST",body:{mode:r,lockMode:n,sessionId:a}})}async getAgentMode(t){return this.request(`/agents/${t}/mode`)}async stopAgentExecution(t){return this.request(`/agents/${t}/stop`,{method:"POST"})}async clearConversation(t){return this.request(`/agents/${t}/clear`,{method:"POST"})}async setApiKeys(t,r){return this.request("/keys",{method:"POST",body:{sessionId:t,...r}})}async getApiKeyStatus(t){return this.request(`/keys/${t}`)}async removeApiKeys(t){return this.request(`/keys/${t}`,{method:"DELETE"})}async health(){return this.request("/health")}async checkForUpdates(t){var n;const r="https://registry.npmjs.org/@loxia-labs/loxia-autopilot-one";try{const a=await fetch(r,{headers:{Accept:"application/json"}});if(!a.ok)throw new Error(`Failed to fetch version info: ${a.status}`);const s=(n=(await a.json())["dist-tags"])==null?void 0:n.latest;if(!s)throw new Error("Could not determine latest version");const l=t===s,u=!l&&this._isNewerVersion(s,t);return{success:!0,currentVersion:t,latestVersion:s,isUpToDate:l,updateAvailable:u,updateCommand:"npm i -g @loxia-labs/loxia-autopilot-one@latest",checkedAt:new Date().toISOString()}}catch(a){return console.error("Version check failed:",a),{success:!1,currentVersion:t,latestVersion:null,isUpToDate:null,updateAvailable:!1,error:a.message,checkedAt:new Date().toISOString()}}}_isNewerVersion(t,r){const n=t.replace(/^v/,"").split(".").map(Number),a=r.replace(/^v/,"").split(".").map(Number);for(let i=0;i<Math.max(n.length,a.length);i++){const s=n[i]||0,l=a[i]||0;if(s>l)return!0;if(s<l)return!1}return!1}}const xe=new rL,vr=J1(eA((e,t)=>({models:[],loading:!1,error:null,lastFetched:null,apiKeyStatuses:{},fetchModels:async()=>{e({loading:!0,error:null});try{const r=await xe.getAvailableModels();if(r.success!==!1){const n=r.models||[];return e({models:n,loading:!1,lastFetched:new Date().toISOString()}),n}else throw new Error(r.error||"Failed to fetch models")}catch(r){throw console.error("Failed to fetch models:",r),e({error:r.message,loading:!1,models:[]}),r}},getModelsByCategory:()=>{const{models:r,apiKeyStatuses:n}=t(),a=l=>{const u=JSON.parse(localStorage.getItem("loxia-settings")||"{}");return u.apiKeys&&u.apiKeys[l]&&u.apiKeys[l].trim().length>0},i=[],s=[];return r.forEach(l=>{const u={id:`${l.name}-platform`,modelName:l.name,platformProvided:!0,displayName:`${t().formatModelName(l.name)} (Platform)`,description:t().getModelDescription(l),provider:l.category,available:!0,pricing:l.pricing,features:{supportsVision:l.supportsVision||!1,supportsSystem:l.supportsSystem||!1,maxTokens:l.maxTokens||4096}};i.push(u);const c=t().getProviderKey(l.category);if(c){const d={id:`${l.name}-direct`,modelName:l.name,platformProvided:!1,displayName:`${t().formatModelName(l.name)} (Direct)`,description:`Direct ${l.category} API access`,provider:l.category,available:a(c),requiresKey:c,pricing:l.pricing,features:u.features};s.push(d)}}),{platform:{title:"Loxia Platform Models",description:"Managed models available through your Loxia subscription",badge:"Platform",models:i},direct:{title:"Direct Provider Access",description:"Use your personal API keys (configure in Settings)",badge:"Personal",models:s}}},formatModelName:r=>({"anthropic-sonnet":"Claude Sonnet","anthropic-opus":"Claude Opus","anthropic-haiku":"Claude Haiku","gpt-4":"GPT-4","gpt-4-mini":"GPT-4 Mini","deepseek-r1":"DeepSeek R1","phi-4":"Phi-4"})[r]||r,getModelDescription:r=>({"anthropic-sonnet":"Best balance of intelligence and speed","anthropic-opus":"Most capable, best for complex tasks","anthropic-haiku":"Fastest, good for simple tasks","gpt-4":"OpenAI's most capable model","gpt-4-mini":"Smaller, faster version of GPT-4","deepseek-r1":"Advanced reasoning model","phi-4":"Microsoft's efficient model"})[r.name]||`${r.category} model with ${r.maxTokens||4096} max tokens`,getProviderKey:r=>({anthropic:"anthropic",openai:"openai",azure:"azure",deepseek:"deepseek",phi:"phi",microsoft:"phi"})[r==null?void 0:r.toLowerCase()],refreshIfStale:async()=>{const{lastFetched:r,fetchModels:n}=t(),a=new Date(Date.now()-5*60*1e3);if(!r||new Date(r)<a)try{await n()}catch(i){console.warn("Failed to refresh models:",i.message)}},updateApiKeyStatus:(r,n)=>{e(a=>({apiKeyStatuses:{...a.apiKeyStatuses,[r]:n}}))},isModelAvailable:r=>{const n=t().getModelsByCategory(),a=n.platform.models.find(s=>s.id===r);if(a)return a.available;const i=n.direct.models.find(s=>s.id===r);return i?i.available:!1},clearError:()=>{e({error:null})}})));vr.getState().fetchModels().catch(console.error);const Jm={LOXIA_ANTHROPIC_SONNET:"loxia-anthropic-sonnet"},ie={CODING_ASSISTANT:"coding-assistant",DATA_ANALYST:"data-analyst",CREATIVE_WRITER:"creative-writer",SYSTEM_ADMIN:"system-admin",SECURITY_ARCHITECT:"security-architect",CUSTOM:"custom"},Yn={[ie.CODING_ASSISTANT]:{name:"Coding Assistant",description:"General-purpose coding and development assistant",prompt:`
|
|
260
260
|
You are a highly skilled software developer and engineer.
|
|
261
261
|
ONCE YOU RECEIVE A TASK, FOLLOW THESE PRINCIPLES METICULOUSLY:
|
|
262
262
|
1. Create and maintain a tasklist to support these phases of development:
|
|
@@ -295,7 +295,7 @@ When analyzing code or systems:
|
|
|
295
295
|
Always maintain a tasklist for complex security assessments.
|
|
296
296
|
Use available security scanning tools (static analysis, clone detection) proactively.
|
|
297
297
|
Provide severity ratings (Critical, High, Medium, Low) for identified issues.
|
|
298
|
-
Include both the vulnerability explanation and the recommended fix.`},[ie.CUSTOM]:{name:"Custom Agent",description:"Define your own system prompt",prompt:""}},oo={CHAT:"chat",AGENT:"agent"},We=J1(eA((e,t)=>({initialized:!1,loading:!1,error:null,sessionId:null,projectDir:null,agents:[],currentAgent:null,messages:[],agentMessages:new Map,isTyping:!1,agentTypingStatus:new Map,agentCommunications:[],sidebarOpen:!0,darkMode:!1,connected:!1,connectionId:null,agentCompactionStatus:new Map,agentHistoryLoaded:new Set,versionInfo:{currentVersion:"1.0.18",latestVersion:null,isUpToDate:null,updateAvailable:!1,updateCommand:"npm i -g @loxia-labs/loxia-autopilot-one@latest",lastChecked:null,checking:!1,error:null},initialize:async()=>{const r=t();if(r.initialized&&r.sessionId){console.log("App already initialized with session:",r.sessionId);return}e({loading:!0,error:null});try{const n=await xe.createSession();if(!n.success)throw new Error("Failed to create session");const{session:a}=n,i=await xe.getStatus(a.id);e({initialized:!0,sessionId:a.id,projectDir:a.projectDir,agents:i.success?i.data.agents:[],loading:!1}),await t().restoreConversationHistory();const s=localStorage.getItem("loxia-dark-mode")==="true";e({darkMode:s}),s&&document.documentElement.classList.add("dark"),await t().restoreApiKeysFromStorage()}catch(n){console.error("Initialization failed:",n),e({error:n.message,loading:!1,initialized:!1})}},createAgent:async(r,n=Jm.LOXIA_ANTHROPIC_SONNET,a=null,i={})=>{const{sessionId:s,projectDir:l}=t();if(!s)throw new Error("No active session");e({loading:!0});try{const u=t().getModelConfigById(n);if(!u)throw new Error(`Unknown model: ${n}`);const c=a||`You are ${r}, an AI assistant in the Loxia Autopilot One system. You can help with coding, analysis, and various tasks using the available tools.`,d=await xe.createAgent(s,{name:r,systemPrompt:c,model:u.modelName,platformProvided:u.platformProvided,dynamicModelRouting:i.dynamicModelRouting||!1,capabilities:i.capabilities||[],directoryAccess:i.directoryAccess||null},l);if(!d.success)throw new Error(d.error);const p=d.data;return e(m=>{let g=m.agentMessages;return m.currentAgent&&(g=new Map(m.agentMessages).set(m.currentAgent.id,m.messages)),{agents:[...m.agents,p],currentAgent:p,messages:[],agentMessages:g,loading:!1}}),p}catch(u){throw e({error:u.message,loading:!1}),u}},switchAgent:async r=>{var x,v;const{agents:n,agentMessages:a,agentTypingStatus:i,agentHistoryLoaded:s,currentAgent:l,sessionId:u,projectDir:c}=t();let d=a;if(l&&l.id!==r){const N=t().messages;d=new Map(a).set(l.id,N),e(h=>({agentMessages:d}))}const p=i.get(r)||!1;let m=d.get(r)||[];if(!s.has(r)&&u)try{const N=await xe.getAgentConversations(u,r,c);N.success&&((v=(x=N.data.conversations)==null?void 0:x.full)!=null&&v.messages)&&(m=N.data.conversations.full.messages,d=new Map(d).set(r,m));const h=new Set(s);h.add(r),e({agentMessages:d,agentHistoryLoaded:h})}catch(N){console.warn("Failed to fetch agent conversations from backend:",N);const h=new Set(s);h.add(r),e({agentHistoryLoaded:h})}const g=n.find(N=>N.id===r);g&&e({currentAgent:g,messages:m,isTyping:p}),xe.getAgentStatus(u,{agentId:r},c).then(N=>{var h;if(N.success&&N.data){const y=N.data,b=t();if(((h=b.currentAgent)==null?void 0:h.id)!==r)return;const E=b.agents.find(S=>S.id===r);if(!E)return;if(y.mode!==E.mode||y.modeState!==E.modeState||y.status!==E.status||y.currentModel!==E.currentModel){const S={...E,mode:y.mode||E.mode,modeState:y.modeState||E.modeState,status:y.status||E.status,currentModel:y.currentModel||E.currentModel,lastActivity:y.lastActivity||E.lastActivity};e(T=>{var R;return{agents:T.agents.map(_=>_.id===r?S:_),currentAgent:((R=T.currentAgent)==null?void 0:R.id)===r?S:T.currentAgent}})}}}).catch(N=>{console.warn("Background agent status fetch failed:",N)})},sendMessage:async(r,n=[])=>{var d;const{sessionId:a,currentAgent:i,projectDir:s}=t();if(!a||!i)throw new Error("No active session or agent");const l=i.id,u=p=>{e(m=>{var x;const g=new Map(m.agentTypingStatus);return g.set(l,p),{agentTypingStatus:g,isTyping:((x=m.currentAgent)==null?void 0:x.id)===l?p:m.isTyping}})},c={id:`msg-${Date.now()}`,role:"user",content:r,timestamp:new Date().toISOString(),contextReferences:n};e(p=>{const m=new Map(p.agentTypingStatus);return m.set(l,!0),{messages:[...p.messages,c],agentTypingStatus:m,isTyping:!0}});try{const p=await xe.sendMessage(a,{agentId:i.id,message:r,mode:"chat",contextReferences:n},s);if(!p.success)throw new Error(p.error||"API request failed");if(!p.data)throw console.error("Response data is undefined:",p),new Error("Invalid response: missing data");if(((d=p.data.data)==null?void 0:d.status)==="queued"){console.log("Message queued for processing, waiting for WebSocket response");return}if(!p.data.data||!p.data.data.message||!p.data.data.message.content){console.log("No AI response in HTTP reply, waiting for WebSocket");return}const m={id:p.data.data.message.id||`msg-${Date.now()}`,role:"assistant",content:p.data.data.message.content||"",timestamp:p.data.data.message.timestamp||new Date().toISOString(),toolResults:p.data.data.toolResults||[],agentRedirects:p.data.data.agentRedirects||[],tokenUsage:p.data.data.message.tokenUsage||null},g=p.data.data.currentModel;return e(x=>{const v=new Map(x.agentTypingStatus);v.set(l,!1);const N={messages:[...x.messages,m],agentTypingStatus:v,isTyping:!1};return g&&x.currentAgent&&g!==x.currentAgent.currentModel&&(N.currentAgent={...x.currentAgent,currentModel:g},N.agents=x.agents.map(h=>h.id===x.currentAgent.id?{...h,currentModel:g}:h)),N}),m}catch(p){throw u(!1),e({error:p.message}),p}},updateAgent:async(r,n)=>{const{sessionId:a,projectDir:i,agents:s}=t();if(!a)throw new Error("No active session");console.log("updateAgent called:",{agentId:r,updates:n,currentAgentsCount:s.length}),e({loading:!0});try{const l=await xe.updateAgent(a,r,n,i);if(!l.success)throw new Error(l.error);const u=l.data;return console.log("Agent update response:",u),e(c=>{var m;const d=c.agents.map(g=>g.id===r?u:g),p=((m=c.currentAgent)==null?void 0:m.id)===r?u:c.currentAgent;return console.log("State after agent update:",{beforeCount:c.agents.length,afterCount:d.length,updatedAgentId:r,agentIds:d.map(g=>g.id)}),{agents:d,currentAgent:p,loading:!1}}),u}catch(l){throw console.error("updateAgent error:",l),e({error:l.message,loading:!1}),l}},pauseAgent:async(r,n=60,a="Manual pause")=>{const{sessionId:i,projectDir:s}=t();try{const l=await xe.pauseAgent(i,{agentId:r,duration:n,reason:a},s);if(!l.success)throw new Error(l.error);return e(u=>({agents:u.agents.map(c=>c.id===r?{...c,status:"paused",pausedUntil:l.data.pausedUntil}:c)})),l.data}catch(l){throw e({error:l.message}),l}},resumeAgent:async r=>{const{sessionId:n,projectDir:a}=t();try{const i=await xe.resumeAgent(n,{agentId:r},a);if(!i.success)throw new Error(i.error);return e(s=>({agents:s.agents.map(l=>l.id===r?{...l,status:"active",pausedUntil:null}:l)})),i.data}catch(i){throw e({error:i.message}),i}},deleteAgent:async r=>{const{sessionId:n,projectDir:a,currentAgent:i}=t();try{const s=await xe.deleteAgent(n,{agentId:r},a);if(!s.success)throw new Error(s.error);return e(l=>{const u=l.agents.filter(p=>p.id!==r),c=new Map(l.agentMessages);c.delete(r);const d={agents:u,agentMessages:c};return i&&i.id===r&&(d.currentAgent=null,d.messages=[]),d}),s.data||s}catch(s){throw e({error:s.message}),s}},unloadAgent:async r=>{const{sessionId:n,projectDir:a,currentAgent:i}=t();try{const s=await xe.unloadAgent(n,{agentId:r},a);if(!s.success)throw new Error(s.error);return e(l=>{const u=l.agents.filter(m=>m.id!==r),c=new Map(l.agentMessages);c.delete(r);const d=new Set(l.agentHistoryLoaded);d.delete(r);const p={agents:u,agentMessages:c,agentHistoryLoaded:d};return i&&i.id===r&&(p.currentAgent=null,p.messages=[]),p}),s.data||s}catch(s){throw e({error:s.message}),s}},refreshAgents:async()=>{const{sessionId:r,projectDir:n}=t();try{const a=await xe.listAgents(r,n);a.success&&e({agents:a.data})}catch(a){console.error("Failed to refresh agents:",a)}},toggleSidebar:()=>{e(r=>({sidebarOpen:!r.sidebarOpen}))},toggleDarkMode:()=>{e(r=>{const n=!r.darkMode;return localStorage.setItem("loxia-dark-mode",n.toString()),n?document.documentElement.classList.add("dark"):document.documentElement.classList.remove("dark"),{darkMode:n}})},setDarkMode:r=>{localStorage.setItem("loxia-dark-mode",r.toString()),r?document.documentElement.classList.add("dark"):document.documentElement.classList.remove("dark"),e({darkMode:r})},setWebSocketConnection:(r,n=null)=>{e({connected:r,connectionId:n})},handleAutonomousUpdate:r=>{var d,p,m;const n=r.agentId,a=r.type||(r.message?"message_added":"unknown"),{currentAgent:i,agents:s,agentMessages:l}=t();console.log("🔍 handleAutonomousUpdate called:",{incomingAgentId:n,currentAgentId:i==null?void 0:i.id,updateType:a,hasMessage:!!r.message,agentMatch:(i==null?void 0:i.id)===n,isCurrentlyVisible:(i==null?void 0:i.id)===n});const u=s.find(g=>g.id===n);u||console.warn("⚠️ Received message for unknown agent:",n);const c=(i==null?void 0:i.id)===n;switch(console.log("✅ Processing autonomous update:",{agentId:n,type:a,isCurrentlyVisible:c,agentMode:u==null?void 0:u.mode}),a){case"execution_started":console.log("🤖 Autonomous execution started:",r);break;case"iteration_started":console.log(`🔄 Iteration ${r.iteration} started`);break;case"message_added":if(r.message){console.log("🔍 Message being added:",{agentId:n,isCurrentlyVisible:c,id:r.message.id,role:r.message.role,contentLength:(d=r.message.content)==null?void 0:d.length,contentPreview:(p=r.message.content)==null?void 0:p.substring(0,100),hasToolResults:!!r.message.toolResults,toolResultsCount:((m=r.message.toolResults)==null?void 0:m.length)||0,timestamp:new Date().toISOString()});const g={...r.message,role:r.message.role,content:r.message.content,timestamp:r.message.timestamp,toolResults:r.message.toolResults,toolExecutions:r.message.toolExecutions,hasToolExecutions:r.message.hasToolExecutions,tokenUsage:r.message.tokenUsage,iteration:r.message.iteration,autonomous:r.message.autonomous};e(x=>{var N,h,y;const v={};if(c){const b=[...x.messages,g];v.messages=b,console.log("✅ Added to visible messages - new count:",b.length),g.role==="assistant"&&(v.isTyping=!1)}else{const b=x.agentMessages.get(n)||[],E=new Map(x.agentMessages);E.set(n,[...b,g]),v.agentMessages=E,console.log("✅ Added to agentMessages Map for agent:",n,"- new count:",b.length+1)}if(g.role==="assistant"){const b=new Map(x.agentTypingStatus);b.set(n,!1),v.agentTypingStatus=b}return r.agentCurrentModel&&n&&(console.log("🔄 Updating agent model from WebSocket:",{agentId:n,newModel:r.agentCurrentModel,currentAgentId:(N=x.currentAgent)==null?void 0:N.id,currentModel:(h=x.currentAgent)==null?void 0:h.currentModel}),v.agents=x.agents.map(b=>b.id===n?{...b,currentModel:r.agentCurrentModel}:b),((y=x.currentAgent)==null?void 0:y.id)===n&&(v.currentAgent={...x.currentAgent,currentModel:r.agentCurrentModel})),v})}break;case"execution_completed":console.log("✅ Autonomous execution completed:",r),e(g=>{var x;return{agents:g.agents.map(v=>v.id===n?{...v,modeState:"idle"}:v),currentAgent:((x=g.currentAgent)==null?void 0:x.id)===n?{...g.currentAgent,modeState:"idle"}:g.currentAgent}});break;case"execution_stopped":console.log("🛑 Autonomous execution stopped:",r),e(g=>{var x,v;return console.log("🛑 Updating agent state for stop:",{agentId:n,currentAgentId:(x=g.currentAgent)==null?void 0:x.id,newModeState:r.modeState||"stopped"}),{agents:g.agents.map(N=>N.id===n?{...N,modeState:r.modeState||"stopped"}:N),currentAgent:((v=g.currentAgent)==null?void 0:v.id)===n?{...g.currentAgent,modeState:r.modeState||"stopped"}:g.currentAgent}});break;case"execution_max_iterations":console.log("⚠️ Max iterations reached:",r),e(g=>{var x;return{agents:g.agents.map(v=>v.id===n?{...v,modeState:"idle"}:v),currentAgent:((x=g.currentAgent)==null?void 0:x.id)===n?{...g.currentAgent,modeState:"idle"}:g.currentAgent}});break;default:console.log("Unknown autonomous update type:",a,r)}},handleWebSocketMessage:r=>{var s,l,u,c,d,p,m;if(!r||typeof r!="object"){console.log("Invalid WebSocket message format:",r);return}const{type:n,data:a,action:i}=r;if(n==="autonomous_update"&&console.log("📨 Received autonomous_update WebSocket message:",{type:n,agentId:a==null?void 0:a.agentId,updateType:a==null?void 0:a.type,hasMessage:!!(a!=null&&a.message),messageDetails:a!=null&&a.message?{id:a.message.id,role:a.message.role,contentLength:(s=a.message.content)==null?void 0:s.length,hasToolResults:!!a.message.toolResults,autonomous:a.message.autonomous}:void 0,fullData:a}),n&&a)switch(n){case"message_added":console.log("📩 Received message_added:",a),t().handleAutonomousUpdate(a);break;case"autonomous_update":t().handleAutonomousUpdate(a);break;case"orchestrator_response":a.action==="list_agents"&&e({agents:((l=a.response)==null?void 0:l.data)||[]});break;case"agent_status_update":a.agentId&&e(g=>({agents:g.agents.map(x=>x.id===a.agentId?{...x,...a.updates||{}}:x)}));break;case"tool_execution_update":console.log("Tool execution update:",a);break;case"compaction_event":if(console.log("📦 Compaction event:",a),a.type==="compaction_models_exhausted"&&(console.warn("⚠️ All compaction models exhausted:",a),K.error(a.message||"Conversation compaction failed: All AI models are currently unavailable. Using simplified compaction.",{duration:6e3})),a.agentId){const g={status:a.status,timestamp:a.timestamp||new Date().toISOString(),stats:{originalTokens:a.originalTokens,compactedTokens:a.compactedTokens,reductionPercent:a.reductionPercent,strategy:a.strategy,executionTime:a.executionTime,currentTokens:a.currentTokens,contextWindow:a.contextWindow,targetTokens:a.targetTokens,model:a.model},error:a.error,modelsExhausted:a.type==="compaction_models_exhausted"};e(x=>{const v=new Map(x.agentCompactionStatus);return v.set(a.agentId,g),{agentCompactionStatus:v}})}break;case"imageGenerated":if(console.log("🖼️ Image generated:",a),a.success&&a.agentId){const g={id:`image-${a.jobId||Date.now()}`,role:"assistant",content:`Image generated: ${a.prompt}`,timestamp:a.timestamp||new Date().toISOString(),imageUrl:a.imageUrl,type:"image-result",autonomous:!0};a.agentId===((u=t().currentAgent)==null?void 0:u.id)&&e(x=>({messages:[...x.messages,g]}))}else if(!a.success){console.error("❌ Image generation failed:",a.error);const g={id:`image-error-${a.jobId||Date.now()}`,role:"system",content:`Image generation failed: ${a.error||"Unknown error"}`,timestamp:a.timestamp||new Date().toISOString(),type:"error"};a.agentId===((c=t().currentAgent)==null?void 0:c.id)&&e(x=>({messages:[...x.messages,g]}))}break;case"agent_mode_changed":a.agentId&&e(g=>{var v,N;const x=new Map(g.agentTypingStatus);return a.mode==="chat"&&x.set(a.agentId,!1),{agents:g.agents.map(h=>h.id===a.agentId?{...h,mode:a.mode,modeState:a.modeState||h.modeState}:h),currentAgent:((v=g.currentAgent)==null?void 0:v.id)===a.agentId?{...g.currentAgent,mode:a.mode,modeState:a.modeState||g.currentAgent.modeState}:g.currentAgent,agentTypingStatus:x,isTyping:((N=g.currentAgent)==null?void 0:N.id)===a.agentId&&a.mode==="chat"?!1:g.isTyping}});break;case"autonomous_update":t().handleAutonomousUpdate(a);break;case"agent_execution_stopped":a.agentId&&e(g=>{var x;return{agents:g.agents.map(v=>v.id===a.agentId?{...v,modeState:"stopped"}:v),currentAgent:((x=g.currentAgent)==null?void 0:x.id)===a.agentId?{...g.currentAgent,modeState:"stopped"}:g.currentAgent}});break;default:console.log("Unknown WebSocket message type:",n,a)}else if(n==="imageGenerated"){if(console.log("🖼️ Image generated:",r),r.success&&r.agentId){let g=`Image generated: ${r.prompt}`;r.isTemporary&&(g+=`
|
|
298
|
+
Include both the vulnerability explanation and the recommended fix.`},[ie.CUSTOM]:{name:"Custom Agent",description:"Define your own system prompt",prompt:""}},oo={CHAT:"chat",AGENT:"agent"},We=J1(eA((e,t)=>({initialized:!1,loading:!1,error:null,sessionId:null,projectDir:null,agents:[],currentAgent:null,messages:[],agentMessages:new Map,isTyping:!1,agentTypingStatus:new Map,agentCommunications:[],sidebarOpen:!0,darkMode:!1,connected:!1,connectionId:null,agentCompactionStatus:new Map,agentHistoryLoaded:new Set,versionInfo:{currentVersion:"1.0.19",latestVersion:null,isUpToDate:null,updateAvailable:!1,updateCommand:"npm i -g @loxia-labs/loxia-autopilot-one@latest",lastChecked:null,checking:!1,error:null},initialize:async()=>{const r=t();if(r.initialized&&r.sessionId){console.log("App already initialized with session:",r.sessionId);return}e({loading:!0,error:null});try{const n=await xe.createSession();if(!n.success)throw new Error("Failed to create session");const{session:a}=n,i=await xe.getStatus(a.id);e({initialized:!0,sessionId:a.id,projectDir:a.projectDir,agents:i.success?i.data.agents:[],loading:!1}),await t().restoreConversationHistory();const s=localStorage.getItem("loxia-dark-mode")==="true";e({darkMode:s}),s&&document.documentElement.classList.add("dark"),await t().restoreApiKeysFromStorage()}catch(n){console.error("Initialization failed:",n),e({error:n.message,loading:!1,initialized:!1})}},createAgent:async(r,n=Jm.LOXIA_ANTHROPIC_SONNET,a=null,i={})=>{const{sessionId:s,projectDir:l}=t();if(!s)throw new Error("No active session");e({loading:!0});try{const u=t().getModelConfigById(n);if(!u)throw new Error(`Unknown model: ${n}`);const c=a||`You are ${r}, an AI assistant in the Loxia Autopilot One system. You can help with coding, analysis, and various tasks using the available tools.`,d=await xe.createAgent(s,{name:r,systemPrompt:c,model:u.modelName,platformProvided:u.platformProvided,dynamicModelRouting:i.dynamicModelRouting||!1,capabilities:i.capabilities||[],directoryAccess:i.directoryAccess||null},l);if(!d.success)throw new Error(d.error);const p=d.data;return e(m=>{let g=m.agentMessages;return m.currentAgent&&(g=new Map(m.agentMessages).set(m.currentAgent.id,m.messages)),{agents:[...m.agents,p],currentAgent:p,messages:[],agentMessages:g,loading:!1}}),p}catch(u){throw e({error:u.message,loading:!1}),u}},switchAgent:async r=>{var x,v;const{agents:n,agentMessages:a,agentTypingStatus:i,agentHistoryLoaded:s,currentAgent:l,sessionId:u,projectDir:c}=t();let d=a;if(l&&l.id!==r){const N=t().messages;d=new Map(a).set(l.id,N),e(h=>({agentMessages:d}))}const p=i.get(r)||!1;let m=d.get(r)||[];if(!s.has(r)&&u)try{const N=await xe.getAgentConversations(u,r,c);N.success&&((v=(x=N.data.conversations)==null?void 0:x.full)!=null&&v.messages)&&(m=N.data.conversations.full.messages,d=new Map(d).set(r,m));const h=new Set(s);h.add(r),e({agentMessages:d,agentHistoryLoaded:h})}catch(N){console.warn("Failed to fetch agent conversations from backend:",N);const h=new Set(s);h.add(r),e({agentHistoryLoaded:h})}const g=n.find(N=>N.id===r);g&&e({currentAgent:g,messages:m,isTyping:p}),xe.getAgentStatus(u,{agentId:r},c).then(N=>{var h;if(N.success&&N.data){const y=N.data,b=t();if(((h=b.currentAgent)==null?void 0:h.id)!==r)return;const E=b.agents.find(S=>S.id===r);if(!E)return;if(y.mode!==E.mode||y.modeState!==E.modeState||y.status!==E.status||y.currentModel!==E.currentModel){const S={...E,mode:y.mode||E.mode,modeState:y.modeState||E.modeState,status:y.status||E.status,currentModel:y.currentModel||E.currentModel,lastActivity:y.lastActivity||E.lastActivity};e(T=>{var R;return{agents:T.agents.map(_=>_.id===r?S:_),currentAgent:((R=T.currentAgent)==null?void 0:R.id)===r?S:T.currentAgent}})}}}).catch(N=>{console.warn("Background agent status fetch failed:",N)})},sendMessage:async(r,n=[])=>{var d;const{sessionId:a,currentAgent:i,projectDir:s}=t();if(!a||!i)throw new Error("No active session or agent");const l=i.id,u=p=>{e(m=>{var x;const g=new Map(m.agentTypingStatus);return g.set(l,p),{agentTypingStatus:g,isTyping:((x=m.currentAgent)==null?void 0:x.id)===l?p:m.isTyping}})},c={id:`msg-${Date.now()}`,role:"user",content:r,timestamp:new Date().toISOString(),contextReferences:n};e(p=>{const m=new Map(p.agentTypingStatus);return m.set(l,!0),{messages:[...p.messages,c],agentTypingStatus:m,isTyping:!0}});try{const p=await xe.sendMessage(a,{agentId:i.id,message:r,mode:"chat",contextReferences:n},s);if(!p.success)throw new Error(p.error||"API request failed");if(!p.data)throw console.error("Response data is undefined:",p),new Error("Invalid response: missing data");if(((d=p.data.data)==null?void 0:d.status)==="queued"){console.log("Message queued for processing, waiting for WebSocket response");return}if(!p.data.data||!p.data.data.message||!p.data.data.message.content){console.log("No AI response in HTTP reply, waiting for WebSocket");return}const m={id:p.data.data.message.id||`msg-${Date.now()}`,role:"assistant",content:p.data.data.message.content||"",timestamp:p.data.data.message.timestamp||new Date().toISOString(),toolResults:p.data.data.toolResults||[],agentRedirects:p.data.data.agentRedirects||[],tokenUsage:p.data.data.message.tokenUsage||null},g=p.data.data.currentModel;return e(x=>{const v=new Map(x.agentTypingStatus);v.set(l,!1);const N={messages:[...x.messages,m],agentTypingStatus:v,isTyping:!1};return g&&x.currentAgent&&g!==x.currentAgent.currentModel&&(N.currentAgent={...x.currentAgent,currentModel:g},N.agents=x.agents.map(h=>h.id===x.currentAgent.id?{...h,currentModel:g}:h)),N}),m}catch(p){throw u(!1),e({error:p.message}),p}},updateAgent:async(r,n)=>{const{sessionId:a,projectDir:i,agents:s}=t();if(!a)throw new Error("No active session");console.log("updateAgent called:",{agentId:r,updates:n,currentAgentsCount:s.length}),e({loading:!0});try{const l=await xe.updateAgent(a,r,n,i);if(!l.success)throw new Error(l.error);const u=l.data;return console.log("Agent update response:",u),e(c=>{var m;const d=c.agents.map(g=>g.id===r?u:g),p=((m=c.currentAgent)==null?void 0:m.id)===r?u:c.currentAgent;return console.log("State after agent update:",{beforeCount:c.agents.length,afterCount:d.length,updatedAgentId:r,agentIds:d.map(g=>g.id)}),{agents:d,currentAgent:p,loading:!1}}),u}catch(l){throw console.error("updateAgent error:",l),e({error:l.message,loading:!1}),l}},pauseAgent:async(r,n=60,a="Manual pause")=>{const{sessionId:i,projectDir:s}=t();try{const l=await xe.pauseAgent(i,{agentId:r,duration:n,reason:a},s);if(!l.success)throw new Error(l.error);return e(u=>({agents:u.agents.map(c=>c.id===r?{...c,status:"paused",pausedUntil:l.data.pausedUntil}:c)})),l.data}catch(l){throw e({error:l.message}),l}},resumeAgent:async r=>{const{sessionId:n,projectDir:a}=t();try{const i=await xe.resumeAgent(n,{agentId:r},a);if(!i.success)throw new Error(i.error);return e(s=>({agents:s.agents.map(l=>l.id===r?{...l,status:"active",pausedUntil:null}:l)})),i.data}catch(i){throw e({error:i.message}),i}},deleteAgent:async r=>{const{sessionId:n,projectDir:a,currentAgent:i}=t();try{const s=await xe.deleteAgent(n,{agentId:r},a);if(!s.success)throw new Error(s.error);return e(l=>{const u=l.agents.filter(p=>p.id!==r),c=new Map(l.agentMessages);c.delete(r);const d={agents:u,agentMessages:c};return i&&i.id===r&&(d.currentAgent=null,d.messages=[]),d}),s.data||s}catch(s){throw e({error:s.message}),s}},unloadAgent:async r=>{const{sessionId:n,projectDir:a,currentAgent:i}=t();try{const s=await xe.unloadAgent(n,{agentId:r},a);if(!s.success)throw new Error(s.error);return e(l=>{const u=l.agents.filter(m=>m.id!==r),c=new Map(l.agentMessages);c.delete(r);const d=new Set(l.agentHistoryLoaded);d.delete(r);const p={agents:u,agentMessages:c,agentHistoryLoaded:d};return i&&i.id===r&&(p.currentAgent=null,p.messages=[]),p}),s.data||s}catch(s){throw e({error:s.message}),s}},refreshAgents:async()=>{const{sessionId:r,projectDir:n}=t();try{const a=await xe.listAgents(r,n);a.success&&e({agents:a.data})}catch(a){console.error("Failed to refresh agents:",a)}},toggleSidebar:()=>{e(r=>({sidebarOpen:!r.sidebarOpen}))},toggleDarkMode:()=>{e(r=>{const n=!r.darkMode;return localStorage.setItem("loxia-dark-mode",n.toString()),n?document.documentElement.classList.add("dark"):document.documentElement.classList.remove("dark"),{darkMode:n}})},setDarkMode:r=>{localStorage.setItem("loxia-dark-mode",r.toString()),r?document.documentElement.classList.add("dark"):document.documentElement.classList.remove("dark"),e({darkMode:r})},setWebSocketConnection:(r,n=null)=>{e({connected:r,connectionId:n})},handleAutonomousUpdate:r=>{var d,p,m;const n=r.agentId,a=r.type||(r.message?"message_added":"unknown"),{currentAgent:i,agents:s,agentMessages:l}=t();console.log("🔍 handleAutonomousUpdate called:",{incomingAgentId:n,currentAgentId:i==null?void 0:i.id,updateType:a,hasMessage:!!r.message,agentMatch:(i==null?void 0:i.id)===n,isCurrentlyVisible:(i==null?void 0:i.id)===n});const u=s.find(g=>g.id===n);u||console.warn("⚠️ Received message for unknown agent:",n);const c=(i==null?void 0:i.id)===n;switch(console.log("✅ Processing autonomous update:",{agentId:n,type:a,isCurrentlyVisible:c,agentMode:u==null?void 0:u.mode}),a){case"execution_started":console.log("🤖 Autonomous execution started:",r);break;case"iteration_started":console.log(`🔄 Iteration ${r.iteration} started`);break;case"message_added":if(r.message){console.log("🔍 Message being added:",{agentId:n,isCurrentlyVisible:c,id:r.message.id,role:r.message.role,contentLength:(d=r.message.content)==null?void 0:d.length,contentPreview:(p=r.message.content)==null?void 0:p.substring(0,100),hasToolResults:!!r.message.toolResults,toolResultsCount:((m=r.message.toolResults)==null?void 0:m.length)||0,timestamp:new Date().toISOString()});const g={...r.message,role:r.message.role,content:r.message.content,timestamp:r.message.timestamp,toolResults:r.message.toolResults,toolExecutions:r.message.toolExecutions,hasToolExecutions:r.message.hasToolExecutions,tokenUsage:r.message.tokenUsage,iteration:r.message.iteration,autonomous:r.message.autonomous};e(x=>{var N,h,y;const v={};if(c){const b=[...x.messages,g];v.messages=b,console.log("✅ Added to visible messages - new count:",b.length),g.role==="assistant"&&(v.isTyping=!1)}else{const b=x.agentMessages.get(n)||[],E=new Map(x.agentMessages);E.set(n,[...b,g]),v.agentMessages=E,console.log("✅ Added to agentMessages Map for agent:",n,"- new count:",b.length+1)}if(g.role==="assistant"){const b=new Map(x.agentTypingStatus);b.set(n,!1),v.agentTypingStatus=b}return r.agentCurrentModel&&n&&(console.log("🔄 Updating agent model from WebSocket:",{agentId:n,newModel:r.agentCurrentModel,currentAgentId:(N=x.currentAgent)==null?void 0:N.id,currentModel:(h=x.currentAgent)==null?void 0:h.currentModel}),v.agents=x.agents.map(b=>b.id===n?{...b,currentModel:r.agentCurrentModel}:b),((y=x.currentAgent)==null?void 0:y.id)===n&&(v.currentAgent={...x.currentAgent,currentModel:r.agentCurrentModel})),v})}break;case"execution_completed":console.log("✅ Autonomous execution completed:",r),e(g=>{var x;return{agents:g.agents.map(v=>v.id===n?{...v,modeState:"idle"}:v),currentAgent:((x=g.currentAgent)==null?void 0:x.id)===n?{...g.currentAgent,modeState:"idle"}:g.currentAgent}});break;case"execution_stopped":console.log("🛑 Autonomous execution stopped:",r),e(g=>{var x,v;return console.log("🛑 Updating agent state for stop:",{agentId:n,currentAgentId:(x=g.currentAgent)==null?void 0:x.id,newModeState:r.modeState||"stopped"}),{agents:g.agents.map(N=>N.id===n?{...N,modeState:r.modeState||"stopped"}:N),currentAgent:((v=g.currentAgent)==null?void 0:v.id)===n?{...g.currentAgent,modeState:r.modeState||"stopped"}:g.currentAgent}});break;case"execution_max_iterations":console.log("⚠️ Max iterations reached:",r),e(g=>{var x;return{agents:g.agents.map(v=>v.id===n?{...v,modeState:"idle"}:v),currentAgent:((x=g.currentAgent)==null?void 0:x.id)===n?{...g.currentAgent,modeState:"idle"}:g.currentAgent}});break;default:console.log("Unknown autonomous update type:",a,r)}},handleWebSocketMessage:r=>{var s,l,u,c,d,p,m;if(!r||typeof r!="object"){console.log("Invalid WebSocket message format:",r);return}const{type:n,data:a,action:i}=r;if(n==="autonomous_update"&&console.log("📨 Received autonomous_update WebSocket message:",{type:n,agentId:a==null?void 0:a.agentId,updateType:a==null?void 0:a.type,hasMessage:!!(a!=null&&a.message),messageDetails:a!=null&&a.message?{id:a.message.id,role:a.message.role,contentLength:(s=a.message.content)==null?void 0:s.length,hasToolResults:!!a.message.toolResults,autonomous:a.message.autonomous}:void 0,fullData:a}),n&&a)switch(n){case"message_added":console.log("📩 Received message_added:",a),t().handleAutonomousUpdate(a);break;case"autonomous_update":t().handleAutonomousUpdate(a);break;case"orchestrator_response":a.action==="list_agents"&&e({agents:((l=a.response)==null?void 0:l.data)||[]});break;case"agent_status_update":a.agentId&&e(g=>({agents:g.agents.map(x=>x.id===a.agentId?{...x,...a.updates||{}}:x)}));break;case"tool_execution_update":console.log("Tool execution update:",a);break;case"compaction_event":if(console.log("📦 Compaction event:",a),a.type==="compaction_models_exhausted"&&(console.warn("⚠️ All compaction models exhausted:",a),K.error(a.message||"Conversation compaction failed: All AI models are currently unavailable. Using simplified compaction.",{duration:6e3})),a.agentId){const g={status:a.status,timestamp:a.timestamp||new Date().toISOString(),stats:{originalTokens:a.originalTokens,compactedTokens:a.compactedTokens,reductionPercent:a.reductionPercent,strategy:a.strategy,executionTime:a.executionTime,currentTokens:a.currentTokens,contextWindow:a.contextWindow,targetTokens:a.targetTokens,model:a.model},error:a.error,modelsExhausted:a.type==="compaction_models_exhausted"};e(x=>{const v=new Map(x.agentCompactionStatus);return v.set(a.agentId,g),{agentCompactionStatus:v}})}break;case"imageGenerated":if(console.log("🖼️ Image generated:",a),a.success&&a.agentId){const g={id:`image-${a.jobId||Date.now()}`,role:"assistant",content:`Image generated: ${a.prompt}`,timestamp:a.timestamp||new Date().toISOString(),imageUrl:a.imageUrl,type:"image-result",autonomous:!0};a.agentId===((u=t().currentAgent)==null?void 0:u.id)&&e(x=>({messages:[...x.messages,g]}))}else if(!a.success){console.error("❌ Image generation failed:",a.error);const g={id:`image-error-${a.jobId||Date.now()}`,role:"system",content:`Image generation failed: ${a.error||"Unknown error"}`,timestamp:a.timestamp||new Date().toISOString(),type:"error"};a.agentId===((c=t().currentAgent)==null?void 0:c.id)&&e(x=>({messages:[...x.messages,g]}))}break;case"agent_mode_changed":a.agentId&&e(g=>{var v,N;const x=new Map(g.agentTypingStatus);return a.mode==="chat"&&x.set(a.agentId,!1),{agents:g.agents.map(h=>h.id===a.agentId?{...h,mode:a.mode,modeState:a.modeState||h.modeState}:h),currentAgent:((v=g.currentAgent)==null?void 0:v.id)===a.agentId?{...g.currentAgent,mode:a.mode,modeState:a.modeState||g.currentAgent.modeState}:g.currentAgent,agentTypingStatus:x,isTyping:((N=g.currentAgent)==null?void 0:N.id)===a.agentId&&a.mode==="chat"?!1:g.isTyping}});break;case"autonomous_update":t().handleAutonomousUpdate(a);break;case"agent_execution_stopped":a.agentId&&e(g=>{var x;return{agents:g.agents.map(v=>v.id===a.agentId?{...v,modeState:"stopped"}:v),currentAgent:((x=g.currentAgent)==null?void 0:x.id)===a.agentId?{...g.currentAgent,modeState:"stopped"}:g.currentAgent}});break;default:console.log("Unknown WebSocket message type:",n,a)}else if(n==="imageGenerated"){if(console.log("🖼️ Image generated:",r),r.success&&r.agentId){let g=`Image generated: ${r.prompt}`;r.isTemporary&&(g+=`
|
|
299
299
|
|
|
300
300
|
⚠️ **Warning:** Image is using a temporary URL (expires in ~1 hour). Failed to save to disk.`,r.downloadError&&(g+=`
|
|
301
301
|
**Error:** ${r.downloadError}`));const x={id:`image-${r.jobId||Date.now()}`,role:"assistant",content:g,timestamp:r.timestamp||new Date().toISOString(),imageUrl:r.imageUrl,type:"image-result",autonomous:!0,isTemporary:r.isTemporary||!1,savedToDisk:r.savedToDisk!==!1};r.agentId===((d=t().currentAgent)==null?void 0:d.id)&&e(v=>({messages:[...v.messages,x]}))}else if(!r.success){console.error("❌ Image generation failed:",r.error);const g={id:`image-error-${r.jobId||Date.now()}`,role:"system",content:`Image generation failed: ${r.error||"Unknown error"}`,timestamp:r.timestamp||new Date().toISOString(),type:"error"};r.agentId===((p=t().currentAgent)==null?void 0:p.id)&&e(x=>({messages:[...x.messages,g]}))}}else if(n&&["message_added","iteration_started","execution_started","execution_completed","execution_stopped","execution_max_iterations"].includes(n))console.log("🔄 Processing direct autonomous update:",n,r),t().handleAutonomousUpdate(r);else if(i)switch(i){case"session_created":console.log("Session created:",r);break;case"agent_updated":r.agentId&&r.agent&&(console.log("Agent updated via WebSocket:",r.agentId),e(x=>{var h;const v=x.agents.map(y=>y.id===r.agentId?{...y,...r.agent}:y),N=((h=x.currentAgent)==null?void 0:h.id)===r.agentId?{...x.currentAgent,...r.agent}:x.currentAgent;return console.log("Agents after update:",v.length,"agents"),{agents:v,currentAgent:N}}));break;case"agent-communication":const g=r.data;if(g){const x={id:`agent-comm-${g.messageId}`,role:"system",content:`📨 **Agent Communication**
|
|
@@ -303,19 +303,19 @@ Include both the vulnerability explanation and the recommended fix.`},[ie.CUSTOM
|
|
|
303
303
|
**To:** ${g.recipients.map(v=>v.name).join(", ")}
|
|
304
304
|
**Subject:** ${g.subject}
|
|
305
305
|
**Message:** ${g.content}`,timestamp:g.timestamp,metadata:{type:"agent-communication",eventType:g.eventType,priority:g.priority,requiresReply:g.requiresReply,conversationId:g.conversationId,depth:((m=g.metadata)==null?void 0:m.depth)||0}};e(v=>({messages:[...v.messages,x]})),e(v=>({agentCommunications:[...v.agentCommunications||[],g]}))}break;default:console.log("Unknown WebSocket action:",i,r)}else console.log("WebSocket message (no type/action):",r)},clearError:()=>{e({error:null})},clearMessages:async()=>{const{currentAgent:r}=t();if(!r){e({messages:[],agentMessages:new Map});return}try{const n=await xe.clearConversation(r.id);console.log("✅ Conversation cleared on backend:",n),e(a=>({messages:[],agentMessages:new Map(a.agentMessages).set(r.id,[])}))}catch(n){throw console.error("Failed to clear conversation:",n),e(a=>({messages:[],agentMessages:new Map(a.agentMessages).set(r.id,[])})),n}},clearAllMessages:()=>{e({messages:[],agentMessages:new Map})},restoreConversationHistory:async()=>{var r,n;try{const{sessionId:a,agents:i,projectDir:s}=t();if(!a||!i||i.length===0)return;const l=new Map;for(const c of i)try{const d=await xe.getAgentConversations(a,c.id,s);d.success&&((n=(r=d.data.conversations)==null?void 0:r.full)!=null&&n.messages)&&l.set(c.id,d.data.conversations.full.messages)}catch(d){console.warn(`Failed to restore conversations for agent ${c.id}:`,d)}e(c=>({agentMessages:l}));const u=localStorage.getItem("loxia-current-agent");if(u){const c=i.find(d=>d.id===u);if(c){const d=l.get(u)||[];e({currentAgent:c,messages:d})}}console.log("Conversation history restored for",i.length,"agents")}catch(a){console.error("Failed to restore conversation history:",a)}},getAgentById:r=>{const{agents:n}=t();return n.find(a=>a.id===r)},getAgentStatus:r=>{if(!r)return"unknown";if(r.status==="paused"&&r.pausedUntil){const n=new Date(r.pausedUntil);if(new Date<n)return"paused"}return r.status||"idle"},updateSettings:async r=>{try{const{sessionId:n}=t();if(localStorage.setItem("loxia-settings",JSON.stringify(r)),r.theme){const a=r.theme==="dark"||r.theme==="system"&&window.matchMedia("(prefers-color-scheme: dark)").matches;e({darkMode:a}),a?document.documentElement.classList.add("dark"):document.documentElement.classList.remove("dark")}return r.apiKeys&&n&&await xe.setApiKeys(n,{loxiaApiKey:r.apiKeys.loxiaBackend,vendorKeys:{anthropic:r.apiKeys.anthropic,openai:r.apiKeys.openai,azure:r.apiKeys.azure,deepseek:r.apiKeys.deepseek,microsoft:r.apiKeys.phi}}),{success:!0}}catch(n){throw console.error("Failed to update settings:",n),n}},restoreApiKeysFromStorage:async()=>{try{const{sessionId:r}=t();if(!r){console.log("No session ID available for API key restoration");return}const n=localStorage.getItem("loxia-settings");if(!n){console.log("No saved settings found in localStorage");return}const a=JSON.parse(n);if(!a.apiKeys){console.log("No API keys found in saved settings");return}if(!Object.values(a.apiKeys).some(s=>s&&s.trim())){console.log("No valid API keys found in saved settings");return}console.log("Auto-restoring API keys from localStorage...",{sessionId:r,hasLoxiaKey:!!a.apiKeys.loxiaBackend,vendorKeys:Object.keys(a.apiKeys).filter(s=>s!=="loxiaBackend"&&a.apiKeys[s])}),await xe.setApiKeys(r,{loxiaApiKey:a.apiKeys.loxiaBackend,vendorKeys:{anthropic:a.apiKeys.anthropic,openai:a.apiKeys.openai,azure:a.apiKeys.azure,deepseek:a.apiKeys.deepseek,microsoft:a.apiKeys.phi}}),console.log("✅ API keys auto-restored successfully")}catch(r){console.error("Failed to auto-restore API keys from localStorage:",r)}},checkForUpdates:async()=>{const{versionInfo:r}=t();e({versionInfo:{...r,checking:!0,error:null}});try{const n=await xe.checkForUpdates(r.currentVersion);return e({versionInfo:{...r,latestVersion:n.latestVersion,isUpToDate:n.isUpToDate,updateAvailable:n.updateAvailable,updateCommand:n.updateCommand||r.updateCommand,lastChecked:n.checkedAt,checking:!1,error:n.success?null:n.error}}),n}catch(n){return console.error("Version check failed:",n),e({versionInfo:{...r,checking:!1,error:n.message}}),{success:!1,error:n.message}}},exportData:async()=>{try{const{agents:r,agentMessages:n,sessionId:a,versionInfo:i}=t(),s=JSON.parse(localStorage.getItem("loxia-settings")||"{}");return{version:i.currentVersion,exportDate:new Date().toISOString(),agents:r,conversations:Object.fromEntries(n),settings:{...s,apiKeys:void 0},sessionId:a}}catch(r){throw console.error("Failed to export data:",r),r}},importData:async r=>{try{if(r.agents&&e({agents:r.agents}),r.conversations){const n=new Map(Object.entries(r.conversations));e({agentMessages:n})}return r.settings&&localStorage.setItem("loxia-settings",JSON.stringify(r.settings)),{success:!0}}catch(n){throw console.error("Failed to import data:",n),n}},clearAllData:async()=>{try{return e({agents:[],currentAgent:null,messages:[],agentMessages:new Map,sessionId:null}),localStorage.removeItem("loxia-settings"),localStorage.removeItem("loxia-current-agent"),localStorage.removeItem("loxia-session-id"),localStorage.removeItem("loxia-dark-mode"),{success:!0}}catch(r){throw console.error("Failed to clear data:",r),r}},getModelConfigById:r=>{const n=vr.getState().getModelsByCategory(),a=n.platform.models.find(s=>s.id===r);if(a)return{modelName:a.modelName,platformProvided:a.platformProvided,displayName:a.displayName};const i=n.direct.models.find(s=>s.id===r);return i?{modelName:i.modelName,platformProvided:i.platformProvided,displayName:i.displayName}:null}})));We.subscribe(e=>e.currentAgent,e=>{e&&localStorage.setItem("loxia-current-agent",e.id)});We.subscribe(e=>e.sessionId,e=>{e&&localStorage.setItem("loxia-session-id",e)});const fs="loxia-analytics-consent",we={NONE:"none",BASIC:"basic",FULL:"full"};let _o=[],tA=!1;const nL=e=>(_o.push(e),()=>{_o=_o.filter(t=>t!==e)}),aL=()=>tA,_a=e=>{tA=e,_o.forEach(t=>t())},so=()=>{try{const e=localStorage.getItem(fs);if(e){const t=JSON.parse(e);return{level:t.level||we.NONE,timestamp:t.timestamp||null,hasConsented:t.hasConsented||!1}}}catch(e){console.error("Failed to parse stored consent:",e)}return{level:we.NONE,timestamp:null,hasConsented:!1}},iL=e=>{try{localStorage.setItem(fs,JSON.stringify({level:e,timestamp:new Date().toISOString(),hasConsented:!0}))}catch(t){console.error("Failed to save consent:",t)}};function rA(){const[e,t]=f.useState(()=>so()),r=f.useSyncExternalStore(nL,aL);f.useEffect(()=>{so().hasConsented||_a(!0)},[]),f.useEffect(()=>{const l=c=>{c.key===fs&&t(so())},u=()=>{t(so())};return window.addEventListener("storage",l),window.addEventListener("consent-updated",u),()=>{window.removeEventListener("storage",l),window.removeEventListener("consent-updated",u)}},[]);const n=f.useCallback(l=>{iL(l);const u={level:l,timestamp:new Date().toISOString(),hasConsented:!0};t(u),_a(!1),window.dispatchEvent(new CustomEvent("consent-updated"))},[]),a=f.useCallback(()=>{_a(!0)},[]),i=f.useCallback(()=>{_a(!1)},[]),s=f.useCallback(()=>{localStorage.removeItem(fs),t({level:we.NONE,timestamp:null,hasConsented:!1}),_a(!0)},[]);return{consentLevel:e.level,hasConsented:e.hasConsented,consentTimestamp:e.timestamp,showConsentDialog:r,updateConsent:n,openConsentDialog:a,closeConsentDialog:i,resetConsent:s,isBasicOrHigher:e.level===we.BASIC||e.level===we.FULL,isFullConsent:e.level===we.FULL}}const nA="loxia-settings",aA="loxia-analytics-consent",Lr={PRIVACY_CONSENT:"privacy_consent",API_KEY_MISSING:"api_key_missing"};let Oo=[],wh=!1;const oL=e=>(Oo.push(e),()=>{Oo=Oo.filter(t=>t!==e)}),sL=()=>wh,Oa=e=>{wh=e,Oo.forEach(t=>t())},iA=()=>{try{const e=localStorage.getItem(aA);if(e)return JSON.parse(e).hasConsented===!0}catch(e){console.error("Failed to check consent:",e)}return!1},oA=()=>{var e;try{const t=localStorage.getItem(nA);if(t){const n=(e=JSON.parse(t).apiKeys)==null?void 0:e.loxiaBackend;return n&&n.trim().length>0}}catch(t){console.error("Failed to check API key:",t)}return!1},$y=()=>{const e=[];return iA()||e.push({type:Lr.PRIVACY_CONSENT,title:"Privacy & Analytics",description:"Choose your analytics preferences",priority:1}),oA()||e.push({type:Lr.API_KEY_MISSING,title:"API Key Required",description:"Configure your Loxia API key to use the system",priority:2}),e.sort((t,r)=>t.priority-r.priority)};function sA(){const[e,t]=f.useState(()=>$y()),r=f.useSyncExternalStore(oL,sL),n=f.useCallback(()=>{const l=$y();return t(l),l},[]);f.useEffect(()=>{n().length>0&&Oa(!0)},[n]),f.useEffect(()=>{const l=d=>{(d.key===nA||d.key===aA)&&n()},u=()=>{n().length===0&&wh&&Oa(!1)},c=()=>{n()};return window.addEventListener("storage",l),window.addEventListener("consent-updated",u),window.addEventListener("settings-updated",u),window.addEventListener("apikey-updated",u),window.addEventListener("attention-modal-opened",c),()=>{window.removeEventListener("storage",l),window.removeEventListener("consent-updated",u),window.removeEventListener("settings-updated",u),window.removeEventListener("apikey-updated",u),window.removeEventListener("attention-modal-opened",c)}},[n]);const a=f.useCallback(()=>{n(),Oa(!0),window.dispatchEvent(new CustomEvent("attention-modal-opened"))},[n]),i=f.useCallback((l=!1)=>{const u=n();(l||u.length===0)&&Oa(!1)},[n]),s=f.useCallback(l=>{l===Lr.PRIVACY_CONSENT?window.dispatchEvent(new CustomEvent("consent-updated")):l===Lr.API_KEY_MISSING&&window.dispatchEvent(new CustomEvent("apikey-updated")),n().length===0&&Oa(!1)},[n]);return{issues:e,hasIssues:e.length>0,showModal:r,hasPrivacyConsent:iA(),hasApiKey:oA(),openModal:a,closeModal:i,resolveIssue:s,refreshIssues:n}}function lL({title:e,titleId:t,...r},n){return f.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":t},r),e?f.createElement("title",{id:t},e):null,f.createElement("path",{fillRule:"evenodd",d:"M2.25 12c0-5.385 4.365-9.75 9.75-9.75s9.75 4.365 9.75 9.75-4.365 9.75-9.75 9.75S2.25 17.385 2.25 12Zm13.36-1.814a.75.75 0 1 0-1.22-.872l-3.236 4.53L9.53 12.22a.75.75 0 0 0-1.06 1.06l2.25 2.25a.75.75 0 0 0 1.14-.094l3.75-5.25Z",clipRule:"evenodd"}))}const Nh=f.forwardRef(lL);function uL({title:e,titleId:t,...r},n){return f.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":t},r),e?f.createElement("title",{id:t},e):null,f.createElement("path",{fillRule:"evenodd",d:"M12 2.25c-5.385 0-9.75 4.365-9.75 9.75s4.365 9.75 9.75 9.75 9.75-4.365 9.75-9.75S17.385 2.25 12 2.25ZM12.75 6a.75.75 0 0 0-1.5 0v6c0 .414.336.75.75.75h4.5a.75.75 0 0 0 0-1.5h-3.75V6Z",clipRule:"evenodd"}))}const cL=f.forwardRef(uL);function dL({title:e,titleId:t,...r},n){return f.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":t},r),e?f.createElement("title",{id:t},e):null,f.createElement("path",{fillRule:"evenodd",d:"M2.25 12c0-5.385 4.365-9.75 9.75-9.75s9.75 4.365 9.75 9.75-4.365 9.75-9.75 9.75S2.25 17.385 2.25 12ZM12 8.25a.75.75 0 0 1 .75.75v3.75a.75.75 0 0 1-1.5 0V9a.75.75 0 0 1 .75-.75Zm0 8.25a.75.75 0 1 0 0-1.5.75.75 0 0 0 0 1.5Z",clipRule:"evenodd"}))}const pL=f.forwardRef(dL);function gL({title:e,titleId:t,...r},n){return f.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":t},r),e?f.createElement("title",{id:t},e):null,f.createElement("path",{fillRule:"evenodd",d:"M2.25 12c0-5.385 4.365-9.75 9.75-9.75s9.75 4.365 9.75 9.75-4.365 9.75-9.75 9.75S2.25 17.385 2.25 12ZM9 8.25a.75.75 0 0 0-.75.75v6c0 .414.336.75.75.75h.75a.75.75 0 0 0 .75-.75V9a.75.75 0 0 0-.75-.75H9Zm5.25 0a.75.75 0 0 0-.75.75v6c0 .414.336.75.75.75H15a.75.75 0 0 0 .75-.75V9a.75.75 0 0 0-.75-.75h-.75Z",clipRule:"evenodd"}))}const mL=f.forwardRef(gL);function za({agent:e,size:t="md",className:r=""}){if(!e)return null;const a=(()=>{if(e.status==="paused"&&e.pausedUntil){const d=new Date(e.pausedUntil);if(new Date<d)return"paused"}return e.status||"idle"})(),i={active:{icon:Nh,color:"text-agent-active",bgColor:"bg-agent-active/10",label:"Active"},paused:{icon:mL,color:"text-agent-paused",bgColor:"bg-agent-paused/10",label:"Paused"},error:{icon:pL,color:"text-agent-error",bgColor:"bg-agent-error/10",label:"Error"},idle:{icon:cL,color:"text-agent-idle",bgColor:"bg-agent-idle/10",label:"Idle"}},s=i[a]||i.idle,l=s.icon,u={xs:{icon:"w-3 h-3",container:"px-1.5 py-0.5 text-xs"},sm:{icon:"w-4 h-4",container:"px-2 py-1 text-xs"},md:{icon:"w-5 h-5",container:"px-2 py-1 text-sm"},lg:{icon:"w-6 h-6",container:"px-3 py-1.5 text-sm"}},c=u[t]||u.md;return o.jsxs("div",{className:`agent-status-indicator agent-status-${a} ${c.container} ${r}`,children:[o.jsx(l,{className:`${c.icon} ${s.color} mr-1`}),o.jsx("span",{className:"font-medium",children:s.label}),a==="paused"&&e.pausedUntil&&o.jsxs("span",{className:"ml-1 opacity-75",children:["(",new Date(e.pausedUntil).toLocaleTimeString(),")"]})]})}function fL({children:e}){const t=Li(),[r,n]=f.useState(!1),{sidebarOpen:a,toggleSidebar:i,darkMode:s,toggleDarkMode:l,currentAgent:u,connected:c,agents:d,error:p,clearError:m,switchAgent:g}=We(),{hasApiKey:x,openModal:v}=sA(),N=[{name:"Chat",href:"/",icon:ra},{name:"Agents",href:"/agents",icon:jt},{name:"Settings",href:"/settings",icon:Ps}];return o.jsxs("div",{className:"min-h-screen bg-gray-50 dark:bg-gray-900",children:[o.jsxs("div",{className:`fixed inset-y-0 left-0 z-50 w-64 bg-white dark:bg-gray-800 border-r border-gray-200 dark:border-gray-700 transform transition-transform duration-300 ease-in-out ${a?"translate-x-0":"-translate-x-full"}`,children:[o.jsxs("div",{className:"flex items-center justify-between h-16 px-4 border-b border-gray-200 dark:border-gray-700",children:[o.jsxs("div",{className:"flex items-center",children:[o.jsx("img",{src:"/logo.png",alt:"Logo",className:"w-8 h-8 object-contain"}),o.jsx("h1",{className:"ml-2 text-lg font-semibold text-gray-900 dark:text-gray-100",children:"Loxia Autopilot"})]}),o.jsx("button",{onClick:i,className:"p-1 rounded-md hover:bg-gray-100 dark:hover:bg-gray-700",children:o.jsx(At,{className:"w-5 h-5 text-gray-500 dark:text-gray-400"})})]}),o.jsxs("div",{className:"px-4 py-2 border-b border-gray-200 dark:border-gray-700",children:[o.jsxs("div",{className:"flex items-center text-sm",children:[o.jsx(wO,{className:`w-4 h-4 mr-2 ${c?"text-green-500":"text-red-500"}`}),o.jsx("span",{className:c?"text-green-600 dark:text-green-400":"text-red-600 dark:text-red-400",children:c?"Connected":"Disconnected"})]}),!x&&o.jsxs("button",{onClick:v,className:"flex items-center text-sm mt-2 w-full text-left group",children:[o.jsx(kh,{className:"w-4 h-4 mr-2 text-amber-500"}),o.jsx("span",{className:"text-amber-600 dark:text-amber-400 group-hover:underline",children:"API Key Missing"})]})]}),u&&o.jsxs("div",{className:"px-4 py-3 border-b border-gray-200 dark:border-gray-700",children:[o.jsx("div",{className:"text-xs font-medium text-gray-500 dark:text-gray-400 uppercase tracking-wide",children:"Current Agent"}),o.jsxs("div",{className:"mt-1 flex items-center",children:[o.jsx(za,{agent:u,size:"sm"}),o.jsxs("div",{className:"ml-2 flex-1",children:[o.jsx("div",{className:"text-sm font-medium text-gray-900 dark:text-gray-100",children:u.name}),o.jsxs("div",{className:"text-xs text-gray-500 dark:text-gray-400 flex items-center",children:[o.jsx("span",{className:"font-mono",children:u.currentModel}),u.dynamicModelRouting&&o.jsx("span",{className:"ml-1.5 px-1 py-0.5 text-xs bg-blue-100 text-blue-700 dark:bg-blue-900/30 dark:text-blue-300 rounded text-xs font-medium",children:"AUTO"})]})]})]})]}),o.jsx("nav",{className:"flex-1 px-4 py-4 space-y-1",children:N.map(h=>{const y=t.pathname===h.href;return o.jsxs(Ry,{to:h.href,className:`sidebar-item ${y?"sidebar-item-active":"sidebar-item-inactive"}`,children:[o.jsx(h.icon,{className:"w-5 h-5 mr-3"}),h.name]},h.name)})}),d.length>0&&o.jsxs("div",{className:"px-4 py-3 border-t border-gray-200 dark:border-gray-700",children:[o.jsxs("div",{className:"text-xs font-medium text-gray-500 dark:text-gray-400 uppercase tracking-wide mb-2",children:["Agents (",d.length,")"]}),o.jsxs("div",{className:"space-y-1 max-h-32 overflow-y-auto",children:[d.filter(h=>h).slice(0,5).map(h=>o.jsxs("button",{onClick:()=>g(h.id),className:`w-full text-left flex items-center text-sm p-1 rounded hover:bg-gray-100 dark:hover:bg-gray-700 transition-colors ${(u==null?void 0:u.id)===h.id?"bg-loxia-50 dark:bg-loxia-900/20":""}`,children:[o.jsx(za,{agent:h,size:"xs"}),o.jsx("span",{className:"ml-2 text-gray-600 dark:text-gray-300 truncate",children:h.name}),(u==null?void 0:u.id)===h.id&&o.jsx("div",{className:"ml-auto w-1.5 h-1.5 rounded-full bg-loxia-500"})]},h.id)),d.length>5&&o.jsxs("div",{className:"text-xs text-gray-500 dark:text-gray-400",children:["+",d.length-5," more..."]})]})]}),o.jsx("div",{className:"px-4 py-4 border-t border-gray-200 dark:border-gray-700",children:o.jsxs("button",{onClick:l,className:"flex items-center w-full px-3 py-2 text-sm font-medium text-gray-600 dark:text-gray-300 rounded-md hover:bg-gray-100 dark:hover:bg-gray-700",children:[s?o.jsx(W1,{className:"w-5 h-5 mr-3"}):o.jsx(H1,{className:"w-5 h-5 mr-3"}),s?"Light Mode":"Dark Mode"]})})]}),o.jsxs("div",{className:`transition-all duration-300 ease-in-out ${a?"ml-64":"ml-0"}`,children:[o.jsxs("div",{className:"h-16 bg-white dark:bg-gray-800 border-b border-gray-200 dark:border-gray-700 flex items-center px-4",children:[!a&&o.jsx("button",{onClick:i,className:"p-2 rounded-md hover:bg-gray-100 dark:hover:bg-gray-700 mr-4",children:o.jsx(s2,{className:"w-5 h-5 text-gray-500 dark:text-gray-400"})}),o.jsx("div",{className:"flex-1",children:o.jsxs("div",{className:"relative",children:[o.jsxs("button",{onClick:()=>n(!r),className:"flex items-center px-3 py-2 rounded-lg hover:bg-gray-100 dark:hover:bg-gray-700 transition-colors",children:[u?o.jsxs(o.Fragment,{children:[o.jsx(za,{agent:u,size:"sm"}),o.jsx("span",{className:"ml-2 font-medium text-gray-900 dark:text-gray-100",children:u.name}),o.jsxs("span",{className:"ml-1 text-xs text-gray-500 dark:text-gray-400",children:["(",u.model,")"]})]}):o.jsxs(o.Fragment,{children:[o.jsx(jt,{className:"w-5 h-5 text-gray-400"}),o.jsx("span",{className:"ml-2 text-gray-500 dark:text-gray-400",children:"Select Agent"})]}),o.jsx(Nt,{className:"w-4 h-4 ml-2 text-gray-400"})]}),r&&o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"fixed inset-0 z-10",onClick:()=>n(!1)}),o.jsx("div",{className:"absolute top-full left-0 z-20 mt-1 w-80 bg-white dark:bg-gray-800 rounded-lg shadow-lg border border-gray-200 dark:border-gray-700",children:o.jsxs("div",{className:"p-2",children:[o.jsxs("div",{className:"text-xs font-medium text-gray-500 dark:text-gray-400 uppercase tracking-wide px-3 py-2",children:["Available Agents (",d.length,")"]}),d.length===0?o.jsx("div",{className:"px-3 py-2 text-sm text-gray-500 dark:text-gray-400",children:"No agents created yet"}):o.jsx("div",{className:"max-h-64 overflow-y-auto",children:d.filter(h=>h).map(h=>o.jsx("button",{onClick:()=>{g(h.id),n(!1)},className:`w-full text-left px-3 py-2 rounded-md hover:bg-gray-100 dark:hover:bg-gray-700 transition-colors ${(u==null?void 0:u.id)===h.id?"bg-loxia-50 dark:bg-loxia-900/20":""}`,children:o.jsxs("div",{className:"flex items-center",children:[o.jsx(za,{agent:h,size:"sm"}),o.jsxs("div",{className:"ml-2 flex-1",children:[o.jsx("div",{className:"text-sm font-medium text-gray-900 dark:text-gray-100",children:h.name}),o.jsxs("div",{className:"text-xs text-gray-500 dark:text-gray-400",children:[h.model," • ",h.status]})]}),(u==null?void 0:u.id)===h.id&&o.jsx("div",{className:"w-2 h-2 rounded-full bg-loxia-500"})]})},h.id))}),o.jsx("div",{className:"border-t border-gray-200 dark:border-gray-700 mt-2 pt-2",children:o.jsxs(Ry,{to:"/agents",onClick:()=>n(!1),className:"flex items-center px-3 py-2 text-sm text-loxia-600 dark:text-loxia-400 hover:bg-gray-100 dark:hover:bg-gray-700 rounded-md transition-colors",children:[o.jsx(Wr,{className:"w-4 h-4 mr-2"}),"Create New Agent"]})})]})})]})]})}),o.jsxs("div",{className:"flex items-center",children:[o.jsx("div",{className:`w-2 h-2 rounded-full ${c?"bg-green-500":"bg-red-500"}`}),o.jsx("span",{className:"ml-2 text-sm text-gray-500 dark:text-gray-400",children:c?"Live":"Offline"})]})]}),p&&o.jsx("div",{className:"bg-red-50 dark:bg-red-900/20 border-b border-red-200 dark:border-red-800",children:o.jsx("div",{className:"px-4 py-3",children:o.jsxs("div",{className:"flex items-center",children:[o.jsx(xr,{className:"w-5 h-5 text-red-400 mr-3"}),o.jsx("div",{className:"flex-1",children:o.jsx("p",{className:"text-sm text-red-800 dark:text-red-200",children:p})}),o.jsx("button",{onClick:m,className:"text-red-400 hover:text-red-600 dark:hover:text-red-300",children:o.jsx(At,{className:"w-5 h-5"})})]})})}),o.jsx("main",{className:"flex-1",children:e})]}),a&&o.jsx("div",{className:"fixed inset-0 z-40 bg-black bg-opacity-50 lg:hidden",onClick:i})]})}const hL=()=>{const[e,t]=f.useState(!1),[r,n]=f.useState(""),[a,i]=f.useState(!1),[s,l]=f.useState(null),u=f.useRef(null),c=f.useRef(null);f.useEffect(()=>{const x=window.SpeechRecognition||window.webkitSpeechRecognition;if(x){i(!0),u.current=new x;const v=u.current;v.continuous=!0,v.interimResults=!0,v.lang="en-US",v.onresult=N=>{let h="",y="";for(let b=N.resultIndex;b<N.results.length;b++){const E=N.results[b][0].transcript;N.results[b].isFinal?h+=E+" ":y+=E}n(h+y),c.current&&clearTimeout(c.current),c.current=setTimeout(()=>{u.current&&e&&p()},3e3)},v.onerror=N=>{console.error("Speech recognition error:",N.error);let h="Speech recognition failed";switch(N.error){case"no-speech":h="No speech detected. Please try again.";break;case"audio-capture":h="Microphone not available. Please check your microphone.";break;case"not-allowed":h="Microphone access denied. Please allow microphone access.";break;case"network":h="Network error occurred during speech recognition.";break;case"service-not-allowed":h="Speech recognition service not available.";break;default:h=`Speech recognition error: ${N.error}`}l(h),t(!1)},v.onend=()=>{t(!1),c.current&&clearTimeout(c.current)},v.onstart=()=>{l(null),t(!0)}}else i(!1),l("Speech recognition is not supported in this browser. Please use Chrome, Edge, or Safari.");return()=>{u.current&&u.current.abort(),c.current&&clearTimeout(c.current)}},[]);const d=f.useCallback(()=>{if(!a||!u.current){l("Speech recognition is not supported");return}if(!e)try{n(""),l(null),u.current.start()}catch(x){console.error("Failed to start speech recognition:",x),l("Failed to start speech recognition. Please try again.")}},[a,e]),p=f.useCallback(()=>{u.current&&e&&u.current.stop(),c.current&&clearTimeout(c.current)},[e]),m=f.useCallback(()=>{n(""),l(null)},[]),g=f.useCallback(()=>{e?p():d()},[e,d,p]);return{isSupported:a,isListening:e,transcript:r,error:s,startListening:d,stopListening:p,resetTranscript:m,toggleListening:g}},bL="http://localhost:8080/api",yL=3e3;function xL(e,t=!0){const[r,n]=f.useState({isActive:!1,reason:null,details:null,loading:!1,error:null}),a=f.useRef(null),i=f.useRef(!0),s=f.useCallback(async()=>{if(!e||!t){n(u=>({...u,isActive:!1,loading:!1}));return}try{const c=await(await fetch(`${bL}/agents/${e}/activity`)).json();if(!i.current)return;c.success?n({isActive:c.isActive,reason:c.reason,details:c.details,loading:!1,error:null}):n(d=>({...d,loading:!1,error:c.error||"Failed to fetch activity status"}))}catch(u){if(!i.current)return;n(c=>({...c,isActive:!1,loading:!1,error:u.message}))}},[e,t]);f.useEffect(()=>{i.current=!0;const u=async()=>{!i.current||!t||(await s(),i.current&&t&&(a.current=setTimeout(u,yL)))};return t&&e?(n(c=>({...c,loading:!0})),u()):n({isActive:!1,reason:null,details:null,loading:!1,error:null}),()=>{i.current=!1,a.current&&(clearTimeout(a.current),a.current=null)}},[e,t,s]);const l=f.useCallback(()=>{t&&e&&s()},[t,e,s]);return{...r,refresh:l}}function lA({priority:e}){const t={high:{bg:"bg-red-100 dark:bg-red-900/30",text:"text-red-600 dark:text-red-400",label:"High"},normal:{bg:"bg-gray-100 dark:bg-gray-700",text:"text-gray-600 dark:text-gray-400",label:"Normal"},low:{bg:"bg-slate-100 dark:bg-slate-800",text:"text-slate-500 dark:text-slate-400",label:"Low"}},r=t[e]||t.normal;return e==="normal"?null:o.jsx("span",{className:`px-1.5 py-0.5 text-[10px] font-medium rounded ${r.bg} ${r.text}`,children:r.label})}function Ah({name:e,size:t="md"}){const r=(e||"A").split(/[-\s]/).map(s=>s[0]).join("").toUpperCase().slice(0,2),n={sm:"w-6 h-6 text-[10px]",md:"w-8 h-8 text-xs",lg:"w-10 h-10 text-sm"},a=["bg-blue-500","bg-emerald-500","bg-purple-500","bg-amber-500","bg-rose-500","bg-cyan-500"],i=(e||"").length%a.length;return o.jsx("div",{className:`${n[t]} ${a[i]} rounded-full flex items-center justify-center text-white font-semibold flex-shrink-0`,children:r})}function Tl({message:e,isReply:t=!1}){var s,l;const[r,n]=f.useState(!1),a=((s=e.attachments)==null?void 0:s.length)>0,i=e.status==="unread"||e.requiresReply;return o.jsxs("div",{className:`border-b border-gray-100 dark:border-gray-800 last:border-b-0 ${i?"bg-blue-50/50 dark:bg-blue-900/10":""}`,children:[o.jsxs("button",{onClick:()=>n(!r),className:"w-full flex items-center gap-3 px-4 py-3 hover:bg-gray-50 dark:hover:bg-gray-800/50 transition-colors text-left",children:[o.jsx("div",{className:"w-2 flex-shrink-0",children:i&&o.jsx("div",{className:"w-2 h-2 rounded-full bg-blue-500"})}),o.jsx(Ah,{name:e.senderName,size:"sm"}),o.jsx("div",{className:"w-32 flex-shrink-0 truncate",children:o.jsx("span",{className:`text-sm ${i?"font-semibold text-gray-900 dark:text-white":"text-gray-600 dark:text-gray-400"}`,children:e.senderName||"Unknown"})}),o.jsxs("div",{className:"flex-1 min-w-0 flex items-center gap-2",children:[t&&o.jsx(Vm,{className:"w-3.5 h-3.5 text-gray-400 flex-shrink-0"}),o.jsx("span",{className:`truncate ${i?"font-medium text-gray-900 dark:text-white":"text-gray-700 dark:text-gray-300"}`,children:e.subject}),o.jsx("span",{className:"text-gray-400 dark:text-gray-500 mx-1",children:"—"}),o.jsxs("span",{className:"text-gray-500 dark:text-gray-400 truncate text-sm",children:[(e.content||"").slice(0,60),"..."]})]}),o.jsxs("div",{className:"flex items-center gap-2 flex-shrink-0",children:[a&&o.jsx(yn,{className:"w-4 h-4 text-gray-400"}),o.jsx(lA,{priority:e.priority}),e.requiresReply&&o.jsx("span",{className:"px-1.5 py-0.5 text-[10px] font-medium rounded bg-amber-100 dark:bg-amber-900/30 text-amber-600 dark:text-amber-400",children:"Reply needed"})]}),o.jsx("span",{className:"text-xs text-gray-400 flex-shrink-0 w-16 text-right",children:uA(e.timestamp)}),r?o.jsx(Nt,{className:"w-4 h-4 text-gray-400 flex-shrink-0"}):o.jsx(Wt,{className:"w-4 h-4 text-gray-400 flex-shrink-0"})]}),r&&o.jsxs("div",{className:"px-4 pb-4 pt-1 ml-12",children:[((l=e.recipients)==null?void 0:l.length)>0&&o.jsxs("div",{className:"flex items-center gap-2 text-xs text-gray-500 mb-2",children:[o.jsx("span",{children:"To:"}),e.recipients.map((u,c)=>o.jsx("span",{className:"bg-gray-100 dark:bg-gray-700 px-2 py-0.5 rounded",children:typeof u=="string"?u:u.name||u.id},c))]}),o.jsx("div",{className:"text-sm text-gray-700 dark:text-gray-300 whitespace-pre-wrap bg-white dark:bg-gray-900 rounded-lg p-3 border border-gray-100 dark:border-gray-700",children:e.content}),a&&o.jsx("div",{className:"mt-2 flex flex-wrap gap-2",children:e.attachments.map((u,c)=>o.jsxs("div",{className:"flex items-center gap-1.5 px-2 py-1 bg-gray-100 dark:bg-gray-700 rounded text-xs text-gray-600 dark:text-gray-300",children:[o.jsx(yn,{className:"w-3.5 h-3.5"}),o.jsx("span",{children:u.name||`Attachment ${c+1}`})]},c))}),o.jsxs("div",{className:"mt-2 text-[10px] text-gray-400 font-mono",children:["ID: ",e.id||e.messageId]})]})]})}function vL({agent:e}){var t,r;return o.jsxs("div",{className:"flex items-center gap-3 px-4 py-2.5 hover:bg-gray-50 dark:hover:bg-gray-800/50 border-b border-gray-100 dark:border-gray-800 last:border-b-0",children:[o.jsx(Ah,{name:e.name}),o.jsxs("div",{className:"flex-1 min-w-0",children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx("span",{className:"text-sm font-medium text-gray-900 dark:text-white truncate",children:e.name}),o.jsx("span",{className:`w-2 h-2 rounded-full flex-shrink-0 ${e.status==="active"?"bg-emerald-500":e.status==="busy"?"bg-amber-500":"bg-gray-400"}`})]}),o.jsxs("div",{className:"text-xs text-gray-500 truncate",children:[e.type||"Agent"," • ",e.activeConversations||0," active conversations"]})]}),o.jsxs("div",{className:"text-right text-xs text-gray-400 flex-shrink-0",children:[o.jsxs("div",{children:[((t=e.messageStats)==null?void 0:t.sent)||0," sent"]}),o.jsxs("div",{children:[((r=e.messageStats)==null?void 0:r.received)||0," received"]})]})]})}function EL({result:e}){var t;return o.jsxs("div",{className:"flex items-start gap-3 px-4 py-3 bg-emerald-50 dark:bg-emerald-900/20 rounded-lg border border-emerald-200 dark:border-emerald-800",children:[o.jsx("div",{className:"w-8 h-8 rounded-full bg-emerald-500 flex items-center justify-center flex-shrink-0",children:o.jsx(Us,{className:"w-4 h-4 text-white"})}),o.jsxs("div",{className:"flex-1 min-w-0",children:[o.jsx("div",{className:"text-sm font-medium text-emerald-800 dark:text-emerald-200",children:"Message sent"}),o.jsxs("div",{className:"text-xs text-emerald-600 dark:text-emerald-400 mt-0.5",children:["To: ",((t=e.recipients)==null?void 0:t.join(", "))||"Unknown"]}),o.jsx("div",{className:"text-[10px] text-emerald-500 dark:text-emerald-500 mt-1 font-mono",children:e.messageId})]}),o.jsx(Mt,{className:"w-5 h-5 text-emerald-500 flex-shrink-0"})]})}function SL({result:e}){return o.jsxs("div",{className:"flex items-start gap-3 px-4 py-3 bg-amber-50 dark:bg-amber-900/20 rounded-lg border border-amber-200 dark:border-amber-800",children:[o.jsx("div",{className:"w-8 h-8 rounded-full bg-amber-500 flex items-center justify-center flex-shrink-0",children:o.jsx(yr,{className:"w-4 h-4 text-white"})}),o.jsxs("div",{className:"flex-1",children:[o.jsx("div",{className:"text-sm font-medium text-amber-800 dark:text-amber-200",children:"Message delayed"}),o.jsx("div",{className:"text-xs text-amber-600 dark:text-amber-400 mt-0.5",children:e.message}),o.jsxs("div",{className:"text-xs text-amber-500 mt-1",children:["Waiting ",e.delaySeconds,"s before sending"]})]})]})}function kL({result:e}){return o.jsxs("div",{className:"flex items-center gap-3 px-4 py-3 bg-gray-50 dark:bg-gray-800/50 rounded-lg border border-gray-200 dark:border-gray-700",children:[o.jsx(At,{className:"w-5 h-5 text-gray-500"}),o.jsxs("div",{className:"flex-1",children:[o.jsx("div",{className:"text-sm font-medium text-gray-700 dark:text-gray-300",children:"Conversation ended"}),e.reason&&o.jsx("div",{className:"text-xs text-gray-500 mt-0.5",children:e.reason})]})]})}function uA(e){if(!e)return"";const t=new Date(e),r=new Date;return t.toDateString()===r.toDateString()?t.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"}):t.toLocaleDateString([],{month:"short",day:"numeric"})}function wL(e){if(!e)return null;if(e.actions&&Array.isArray(e.actions)&&e.actions.length>0){const t=e.actions[0];return{type:t.type||t.action,...t}}if(e.parameters){const t=e.parameters;return{type:t.type||t.action,...t}}if(e.type||e.action)return{type:e.type||e.action,...e};if(e.success!==void 0){if(e.agents)return{type:"get-available-agents",...e};if(e.messageId&&e.recipients)return{type:"send-message-result",...e};if(e.delayed)return{type:"delayed",...e};if(e.messages)return{type:"inbox",...e};if(e.status==="ended")return{type:"ended",...e};if(e.conversationId)return{type:"send-message-result",...e}}return null}function NL({toolId:e,rawContent:t,innerContent:r,parsedData:n}){var s,l,u,c;const a=f.useMemo(()=>wL(n),[n]);if(!a)return o.jsxs("div",{className:"flex items-center gap-2 py-1.5 px-3 my-1 rounded-md bg-gray-50 dark:bg-gray-800/50 text-sm text-gray-500",children:[o.jsx(Km,{className:"w-4 h-4"}),o.jsx("span",{children:"Agent communication"})]});const i=(l=(s=a.type)==null?void 0:s.toLowerCase())==null?void 0:l.replace(/_/g,"-");return o.jsxs("div",{className:"my-2 rounded-lg border border-gray-200 dark:border-gray-700 overflow-hidden bg-white dark:bg-gray-900",children:[o.jsxs("div",{className:"flex items-center gap-2 px-3 py-2 bg-gray-50 dark:bg-gray-800 border-b border-gray-200 dark:border-gray-700",children:[i==="get-available-agents"&&o.jsxs(o.Fragment,{children:[o.jsx(Fy,{className:"w-4 h-4 text-blue-500"}),o.jsx("span",{className:"text-sm font-medium text-gray-700 dark:text-gray-300",children:"Available Agents"}),o.jsxs("span",{className:"text-xs text-gray-500 ml-auto",children:[((u=a.agents)==null?void 0:u.length)||0," online"]})]}),i==="send-message"&&o.jsxs(o.Fragment,{children:[o.jsx(Us,{className:"w-4 h-4 text-emerald-500"}),o.jsx("span",{className:"text-sm font-medium text-gray-700 dark:text-gray-300",children:"Compose Message"})]}),i==="send-message-result"&&o.jsxs(o.Fragment,{children:[o.jsx(Mt,{className:"w-4 h-4 text-emerald-500"}),o.jsx("span",{className:"text-sm font-medium text-gray-700 dark:text-gray-300",children:"Message Sent"})]}),i==="reply-to-message"&&o.jsxs(o.Fragment,{children:[o.jsx(Vm,{className:"w-4 h-4 text-blue-500"}),o.jsx("span",{className:"text-sm font-medium text-gray-700 dark:text-gray-300",children:"Reply"})]}),(i==="get-unreplied-messages"||i==="inbox")&&o.jsxs(o.Fragment,{children:[o.jsx(X2,{className:"w-4 h-4 text-amber-500"}),o.jsx("span",{className:"text-sm font-medium text-gray-700 dark:text-gray-300",children:"Inbox"}),o.jsxs("span",{className:"text-xs text-gray-500 ml-auto",children:[((c=a.messages)==null?void 0:c.length)||a.total||0," pending"]})]}),i==="delayed"&&o.jsxs(o.Fragment,{children:[o.jsx(yr,{className:"w-4 h-4 text-amber-500"}),o.jsx("span",{className:"text-sm font-medium text-gray-700 dark:text-gray-300",children:"Delayed"})]}),(i==="mark-conversation-ended"||i==="ended")&&o.jsxs(o.Fragment,{children:[o.jsx(At,{className:"w-4 h-4 text-gray-500"}),o.jsx("span",{className:"text-sm font-medium text-gray-700 dark:text-gray-300",children:"Conversation Ended"})]}),!["get-available-agents","send-message","send-message-result","reply-to-message","get-unreplied-messages","inbox","delayed","mark-conversation-ended","ended"].includes(i)&&o.jsxs(o.Fragment,{children:[o.jsx(Km,{className:"w-4 h-4 text-blue-500"}),o.jsx("span",{className:"text-sm font-medium text-gray-700 dark:text-gray-300",children:i?i.replace(/-/g," ").replace(/\b\w/g,d=>d.toUpperCase()):"Communication"})]})]}),o.jsxs("div",{className:"divide-y divide-gray-100 dark:divide-gray-800",children:[i==="get-available-agents"&&a.agents&&(a.agents.length>0?a.agents.map((d,p)=>o.jsx(vL,{agent:d},d.id||p)):o.jsxs("div",{className:"px-4 py-8 text-center text-gray-500",children:[o.jsx(Fy,{className:"w-8 h-8 mx-auto mb-2 opacity-50"}),o.jsx("div",{className:"text-sm",children:"No other agents available"})]})),i==="send-message"&&o.jsx("div",{className:"p-4",children:o.jsx(Tl,{message:{senderName:"You",subject:a.subject,content:a.message,recipients:a.recipients||[a.recipient],priority:a.priority,requiresReply:a.requiresReply||a["requires-reply"],attachments:a.attachments,timestamp:new Date().toISOString()}})}),i==="send-message-result"&&o.jsx("div",{className:"p-3",children:o.jsx(EL,{result:a})}),i==="reply-to-message"&&o.jsxs("div",{className:"p-4",children:[o.jsxs("div",{className:"text-xs text-gray-500 mb-2 flex items-center gap-1",children:[o.jsx(Vm,{className:"w-3 h-3"}),"Replying to: ",a.messageId||a["message-id"]]}),o.jsx("div",{className:"bg-gray-50 dark:bg-gray-800 rounded-lg p-3 text-sm text-gray-700 dark:text-gray-300",children:a.message})]}),(i==="get-unreplied-messages"||i==="inbox")&&a.messages&&(a.messages.length>0?a.messages.map((d,p)=>o.jsx(Tl,{message:d},d.messageId||p)):o.jsxs("div",{className:"px-4 py-8 text-center text-gray-500",children:[o.jsx(P2,{className:"w-8 h-8 mx-auto mb-2 opacity-50"}),o.jsx("div",{className:"text-sm",children:"Inbox is empty"})]})),i==="delayed"&&o.jsx("div",{className:"p-3",children:o.jsx(SL,{result:a})}),(i==="mark-conversation-ended"||i==="ended")&&o.jsx("div",{className:"p-3",children:o.jsx(kL,{result:a})}),!["get-available-agents","send-message","send-message-result","reply-to-message","get-unreplied-messages","inbox","delayed","mark-conversation-ended","ended"].includes(i)&&o.jsx("div",{className:"p-4",children:a.subject||a.message||a.content?o.jsx(Tl,{message:{senderName:a.senderName||a.sender||"Agent",subject:a.subject||"Message",content:a.message||a.content||"",recipients:a.recipients||(a.recipient?[a.recipient]:[]),priority:a.priority||"normal",requiresReply:a.requiresReply||a["requires-reply"],attachments:a.attachments,timestamp:a.timestamp||new Date().toISOString(),id:a.messageId||a.id}}):o.jsx("div",{className:"space-y-2 text-sm",children:Object.entries(a).filter(([d])=>d!=="type"&&d!=="action").map(([d,p])=>o.jsxs("div",{className:"flex",children:[o.jsxs("span",{className:"text-gray-500 w-32 flex-shrink-0",children:[d,":"]}),o.jsx("span",{className:"text-gray-700 dark:text-gray-300",children:typeof p=="object"?JSON.stringify(p):String(p)})]},d))})})]})]})}function AL({message:e,isOutgoing:t=!1}){var i;const r=((i=e.sender)==null?void 0:i.name)||e.senderName||"Unknown Agent",a=(e.recipients||[]).map(s=>typeof s=="string"?s:s.name||s.id).join(", ");return o.jsxs("div",{className:"my-2 rounded-lg border border-gray-200 dark:border-gray-700 overflow-hidden bg-white dark:bg-gray-900",children:[o.jsxs("div",{className:`flex items-center gap-2 px-3 py-2 border-b border-gray-200 dark:border-gray-700 ${t?"bg-blue-50 dark:bg-blue-900/20":"bg-emerald-50 dark:bg-emerald-900/20"}`,children:[t?o.jsx(Us,{className:"w-4 h-4 text-blue-500"}):o.jsx(Km,{className:"w-4 h-4 text-emerald-500"}),o.jsx("span",{className:`text-sm font-medium ${t?"text-blue-700 dark:text-blue-300":"text-emerald-700 dark:text-emerald-300"}`,children:t?"Sent Message":"Received Message"}),o.jsx(lA,{priority:e.priority}),e.requiresReply&&o.jsx("span",{className:"px-1.5 py-0.5 text-[10px] font-medium rounded bg-amber-100 dark:bg-amber-900/30 text-amber-600 dark:text-amber-400 ml-auto",children:"Reply needed"}),o.jsx("span",{className:"text-xs text-gray-400 ml-auto",children:uA(e.timestamp)})]}),o.jsxs("div",{className:"p-4",children:[o.jsxs("div",{className:"flex items-center gap-4 mb-3 text-sm",children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(Ah,{name:r,size:"sm"}),o.jsxs("div",{children:[o.jsx("span",{className:"text-gray-500",children:"From:"}),o.jsx("span",{className:"ml-1 font-medium text-gray-800 dark:text-gray-200",children:r})]})]}),a&&o.jsxs("div",{children:[o.jsx("span",{className:"text-gray-500",children:"To:"}),o.jsx("span",{className:"ml-1 text-gray-700 dark:text-gray-300",children:a})]})]}),e.subject&&o.jsx("div",{className:"mb-2 font-medium text-gray-900 dark:text-white",children:e.subject}),o.jsx("div",{className:"text-sm text-gray-700 dark:text-gray-300 whitespace-pre-wrap bg-gray-50 dark:bg-gray-800 rounded-lg p-3 border border-gray-100 dark:border-gray-700",children:e.content||e.message}),e.hasAttachments&&e.attachmentCount>0&&o.jsxs("div",{className:"mt-2 flex items-center gap-1 text-xs text-gray-500",children:[o.jsx(yn,{className:"w-3.5 h-3.5"}),o.jsxs("span",{children:[e.attachmentCount," attachment",e.attachmentCount!==1?"s":""]})]}),e.conversationId&&o.jsxs("div",{className:"mt-2 text-[10px] text-gray-400 font-mono",children:["Conversation: ",e.conversationId.slice(-12)]})]})]})}function TL(e,t){const r={};return(e[e.length-1]===""?[...e,""]:e).join((r.padRight?" ":"")+","+(r.padLeft===!1?"":" ")).trim()}const CL=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,RL=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,IL={};function zy(e,t){return(IL.jsx?RL:CL).test(e)}const _L=/[ \t\n\f\r]/g;function OL(e){return typeof e=="object"?e.type==="text"?Gy(e.value):!1:Gy(e)}function Gy(e){return e.replace(_L,"")===""}let Mi=class{constructor(t,r,n){this.normal=r,this.property=t,n&&(this.space=n)}};Mi.prototype.normal={};Mi.prototype.property={};Mi.prototype.space=void 0;function cA(e,t){const r={},n={};for(const a of e)Object.assign(r,a.property),Object.assign(n,a.normal);return new Mi(r,n,t)}function ef(e){return e.toLowerCase()}let ht=class{constructor(t,r){this.attribute=r,this.property=t}};ht.prototype.attribute="";ht.prototype.booleanish=!1;ht.prototype.boolean=!1;ht.prototype.commaOrSpaceSeparated=!1;ht.prototype.commaSeparated=!1;ht.prototype.defined=!1;ht.prototype.mustUseProperty=!1;ht.prototype.number=!1;ht.prototype.overloadedBoolean=!1;ht.prototype.property="";ht.prototype.spaceSeparated=!1;ht.prototype.space=void 0;let LL=0;const re=wn(),Le=wn(),tf=wn(),q=wn(),me=wn(),aa=wn(),xt=wn();function wn(){return 2**++LL}const rf=Object.freeze(Object.defineProperty({__proto__:null,boolean:re,booleanish:Le,commaOrSpaceSeparated:xt,commaSeparated:aa,number:q,overloadedBoolean:tf,spaceSeparated:me},Symbol.toStringTag,{value:"Module"})),Cl=Object.keys(rf);let Th=class extends ht{constructor(t,r,n,a){let i=-1;if(super(t,r),qy(this,"space",a),typeof n=="number")for(;++i<Cl.length;){const s=Cl[i];qy(this,Cl[i],(n&rf[s])===rf[s])}}};Th.prototype.defined=!0;function qy(e,t,r){r&&(e[t]=r)}function xa(e){const t={},r={};for(const[n,a]of Object.entries(e.properties)){const i=new Th(n,e.transform(e.attributes||{},n),a,e.space);e.mustUseProperty&&e.mustUseProperty.includes(n)&&(i.mustUseProperty=!0),t[n]=i,r[ef(n)]=n,r[ef(i.attribute)]=n}return new Mi(t,r,e.space)}const dA=xa({properties:{ariaActiveDescendant:null,ariaAtomic:Le,ariaAutoComplete:null,ariaBusy:Le,ariaChecked:Le,ariaColCount:q,ariaColIndex:q,ariaColSpan:q,ariaControls:me,ariaCurrent:null,ariaDescribedBy:me,ariaDetails:null,ariaDisabled:Le,ariaDropEffect:me,ariaErrorMessage:null,ariaExpanded:Le,ariaFlowTo:me,ariaGrabbed:Le,ariaHasPopup:null,ariaHidden:Le,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:me,ariaLevel:q,ariaLive:null,ariaModal:Le,ariaMultiLine:Le,ariaMultiSelectable:Le,ariaOrientation:null,ariaOwns:me,ariaPlaceholder:null,ariaPosInSet:q,ariaPressed:Le,ariaReadOnly:Le,ariaRelevant:null,ariaRequired:Le,ariaRoleDescription:me,ariaRowCount:q,ariaRowIndex:q,ariaRowSpan:q,ariaSelected:Le,ariaSetSize:q,ariaSort:null,ariaValueMax:q,ariaValueMin:q,ariaValueNow:q,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function pA(e,t){return t in e?e[t]:t}function gA(e,t){return pA(e,t.toLowerCase())}const DL=xa({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:aa,acceptCharset:me,accessKey:me,action:null,allow:null,allowFullScreen:re,allowPaymentRequest:re,allowUserMedia:re,alt:null,as:null,async:re,autoCapitalize:null,autoComplete:me,autoFocus:re,autoPlay:re,blocking:me,capture:null,charSet:null,checked:re,cite:null,className:me,cols:q,colSpan:null,content:null,contentEditable:Le,controls:re,controlsList:me,coords:q|aa,crossOrigin:null,data:null,dateTime:null,decoding:null,default:re,defer:re,dir:null,dirName:null,disabled:re,download:tf,draggable:Le,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:re,formTarget:null,headers:me,height:q,hidden:tf,high:q,href:null,hrefLang:null,htmlFor:me,httpEquiv:me,id:null,imageSizes:null,imageSrcSet:null,inert:re,inputMode:null,integrity:null,is:null,isMap:re,itemId:null,itemProp:me,itemRef:me,itemScope:re,itemType:me,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:re,low:q,manifest:null,max:null,maxLength:q,media:null,method:null,min:null,minLength:q,multiple:re,muted:re,name:null,nonce:null,noModule:re,noValidate:re,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:re,optimum:q,pattern:null,ping:me,placeholder:null,playsInline:re,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:re,referrerPolicy:null,rel:me,required:re,reversed:re,rows:q,rowSpan:q,sandbox:me,scope:null,scoped:re,seamless:re,selected:re,shadowRootClonable:re,shadowRootDelegatesFocus:re,shadowRootMode:null,shape:null,size:q,sizes:null,slot:null,span:q,spellCheck:Le,src:null,srcDoc:null,srcLang:null,srcSet:null,start:q,step:null,style:null,tabIndex:q,target:null,title:null,translate:null,type:null,typeMustMatch:re,useMap:null,value:Le,width:q,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:me,axis:null,background:null,bgColor:null,border:q,borderColor:null,bottomMargin:q,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:re,declare:re,event:null,face:null,frame:null,frameBorder:null,hSpace:q,leftMargin:q,link:null,longDesc:null,lowSrc:null,marginHeight:q,marginWidth:q,noResize:re,noHref:re,noShade:re,noWrap:re,object:null,profile:null,prompt:null,rev:null,rightMargin:q,rules:null,scheme:null,scrolling:Le,standby:null,summary:null,text:null,topMargin:q,valueType:null,version:null,vAlign:null,vLink:null,vSpace:q,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:re,disableRemotePlayback:re,prefix:null,property:null,results:q,security:null,unselectable:null},space:"html",transform:gA}),ML=xa({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:xt,accentHeight:q,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:q,amplitude:q,arabicForm:null,ascent:q,attributeName:null,attributeType:null,azimuth:q,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:q,by:null,calcMode:null,capHeight:q,className:me,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:q,diffuseConstant:q,direction:null,display:null,dur:null,divisor:q,dominantBaseline:null,download:re,dx:null,dy:null,edgeMode:null,editable:null,elevation:q,enableBackground:null,end:null,event:null,exponent:q,externalResourcesRequired:null,fill:null,fillOpacity:q,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:aa,g2:aa,glyphName:aa,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:q,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:q,horizOriginX:q,horizOriginY:q,id:null,ideographic:q,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:q,k:q,k1:q,k2:q,k3:q,k4:q,kernelMatrix:xt,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:q,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:q,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:q,overlineThickness:q,paintOrder:null,panose1:null,path:null,pathLength:q,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:me,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:q,pointsAtY:q,pointsAtZ:q,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:xt,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:xt,rev:xt,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:xt,requiredFeatures:xt,requiredFonts:xt,requiredFormats:xt,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:q,specularExponent:q,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:q,strikethroughThickness:q,string:null,stroke:null,strokeDashArray:xt,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:q,strokeOpacity:q,strokeWidth:null,style:null,surfaceScale:q,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:xt,tabIndex:q,tableValues:null,target:null,targetX:q,targetY:q,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:xt,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:q,underlineThickness:q,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:q,values:null,vAlphabetic:q,vMathematical:q,vectorEffect:null,vHanging:q,vIdeographic:q,version:null,vertAdvY:q,vertOriginX:q,vertOriginY:q,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:q,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:pA}),mA=xa({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()}}),fA=xa({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:gA}),hA=xa({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),jL={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},FL=/[A-Z]/g,Hy=/-[a-z]/g,PL=/^data[-\w.:]+$/i;function UL(e,t){const r=ef(t);let n=t,a=ht;if(r in e.normal)return e.property[e.normal[r]];if(r.length>4&&r.slice(0,4)==="data"&&PL.test(t)){if(t.charAt(4)==="-"){const i=t.slice(5).replace(Hy,$L);n="data"+i.charAt(0).toUpperCase()+i.slice(1)}else{const i=t.slice(4);if(!Hy.test(i)){let s=i.replace(FL,BL);s.charAt(0)!=="-"&&(s="-"+s),t="data"+s}}a=Th}return new a(n,t)}function BL(e){return"-"+e.toLowerCase()}function $L(e){return e.charAt(1).toUpperCase()}const zL=cA([dA,DL,mA,fA,hA],"html"),Ch=cA([dA,ML,mA,fA,hA],"svg");function GL(e){return e.join(" ").trim()}var Rh={},Vy=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,qL=/\n/g,HL=/^\s*/,VL=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,WL=/^:\s*/,YL=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,KL=/^[;\s]*/,ZL=/^\s+|\s+$/g,XL=`
|
|
306
|
-
`,Wy="/",Yy="*",sn="",QL="comment",JL="declaration";function eD(e,t){if(typeof e!="string")throw new TypeError("First argument must be a string");if(!e)return[];t=t||{};var r=1,n=1;function a(x){var v=x.match(qL);v&&(r+=v.length);var N=x.lastIndexOf(XL);n=~N?x.length-N:n+x.length}function i(){var x={line:r,column:n};return function(v){return v.position=new s(x),c(),v}}function s(x){this.start=x,this.end={line:r,column:n},this.source=t.source}s.prototype.content=e;function l(x){var v=new Error(t.source+":"+r+":"+n+": "+x);if(v.reason=x,v.filename=t.source,v.line=r,v.column=n,v.source=e,!t.silent)throw v}function u(x){var v=x.exec(e);if(v){var N=v[0];return a(N),e=e.slice(N.length),v}}function c(){u(HL)}function d(x){var v;for(x=x||[];v=p();)v!==!1&&x.push(v);return x}function p(){var x=i();if(!(Wy!=e.charAt(0)||Yy!=e.charAt(1))){for(var v=2;sn!=e.charAt(v)&&(Yy!=e.charAt(v)||Wy!=e.charAt(v+1));)++v;if(v+=2,sn===e.charAt(v-1))return l("End of comment missing");var N=e.slice(2,v-2);return n+=2,a(N),e=e.slice(v),n+=2,x({type:QL,comment:N})}}function m(){var x=i(),v=u(VL);if(v){if(p(),!u(WL))return l("property missing ':'");var N=u(YL),h=x({type:JL,property:Ky(v[0].replace(Vy,sn)),value:N?Ky(N[0].replace(Vy,sn)):sn});return u(KL),h}}function g(){var x=[];d(x);for(var v;v=m();)v!==!1&&(x.push(v),d(x));return x}return c(),g()}function Ky(e){return e?e.replace(ZL,sn):sn}var tD=eD,rD=qr&&qr.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Rh,"__esModule",{value:!0});Rh.default=aD;const nD=rD(tD);function aD(e,t){let r=null;if(!e||typeof e!="string")return r;const n=(0,nD.default)(e),a=typeof t=="function";return n.forEach(i=>{if(i.type!=="declaration")return;const{property:s,value:l}=i;a?t(s,l,i):l&&(r=r||{},r[s]=l)}),r}var $s={};Object.defineProperty($s,"__esModule",{value:!0});$s.camelCase=void 0;var iD=/^--[a-zA-Z0-9_-]+$/,oD=/-([a-z])/g,sD=/^[^-]+$/,lD=/^-(webkit|moz|ms|o|khtml)-/,uD=/^-(ms)-/,cD=function(e){return!e||sD.test(e)||iD.test(e)},dD=function(e,t){return t.toUpperCase()},Zy=function(e,t){return"".concat(t,"-")},pD=function(e,t){return t===void 0&&(t={}),cD(e)?e:(e=e.toLowerCase(),t.reactCompat?e=e.replace(uD,Zy):e=e.replace(lD,Zy),e.replace(oD,dD))};$s.camelCase=pD;var gD=qr&&qr.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},mD=gD(Rh),fD=$s;function nf(e,t){var r={};return!e||typeof e!="string"||(0,mD.default)(e,function(n,a){n&&a&&(r[(0,fD.camelCase)(n,t)]=a)}),r}nf.default=nf;var hD=nf;const bD=Ai(hD),bA=yA("end"),Ih=yA("start");function yA(e){return t;function t(r){const n=r&&r.position&&r.position[e]||{};if(typeof n.line=="number"&&n.line>0&&typeof n.column=="number"&&n.column>0)return{line:n.line,column:n.column,offset:typeof n.offset=="number"&&n.offset>-1?n.offset:void 0}}}function yD(e){const t=Ih(e),r=bA(e);if(t&&r)return{start:t,end:r}}function ei(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?Xy(e.position):"start"in e||"end"in e?Xy(e):"line"in e||"column"in e?af(e):""}function af(e){return Qy(e&&e.line)+":"+Qy(e&&e.column)}function Xy(e){return af(e&&e.start)+"-"+af(e&&e.end)}function Qy(e){return e&&typeof e=="number"?e:1}class Qe extends Error{constructor(t,r,n){super(),typeof r=="string"&&(n=r,r=void 0);let a="",i={},s=!1;if(r&&("line"in r&&"column"in r?i={place:r}:"start"in r&&"end"in r?i={place:r}:"type"in r?i={ancestors:[r],place:r.position}:i={...r}),typeof t=="string"?a=t:!i.cause&&t&&(s=!0,a=t.message,i.cause=t),!i.ruleId&&!i.source&&typeof n=="string"){const u=n.indexOf(":");u===-1?i.ruleId=n:(i.source=n.slice(0,u),i.ruleId=n.slice(u+1))}if(!i.place&&i.ancestors&&i.ancestors){const u=i.ancestors[i.ancestors.length-1];u&&(i.place=u.position)}const l=i.place&&"start"in i.place?i.place.start:i.place;this.ancestors=i.ancestors||void 0,this.cause=i.cause||void 0,this.column=l?l.column:void 0,this.fatal=void 0,this.file="",this.message=a,this.line=l?l.line:void 0,this.name=ei(i.place)||"1:1",this.place=i.place||void 0,this.reason=this.message,this.ruleId=i.ruleId||void 0,this.source=i.source||void 0,this.stack=s&&i.cause&&typeof i.cause.stack=="string"?i.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}Qe.prototype.file="";Qe.prototype.name="";Qe.prototype.reason="";Qe.prototype.message="";Qe.prototype.stack="";Qe.prototype.column=void 0;Qe.prototype.line=void 0;Qe.prototype.ancestors=void 0;Qe.prototype.cause=void 0;Qe.prototype.fatal=void 0;Qe.prototype.place=void 0;Qe.prototype.ruleId=void 0;Qe.prototype.source=void 0;const _h={}.hasOwnProperty,xD=new Map,vD=/[A-Z]/g,ED=new Set(["table","tbody","thead","tfoot","tr"]),SD=new Set(["td","th"]),xA="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function kD(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const r=t.filePath||void 0;let n;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");n=_D(r,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");n=ID(r,t.jsx,t.jsxs)}const a={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:n,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:r,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?Ch:zL,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},i=vA(a,e,void 0);return i&&typeof i!="string"?i:a.create(e,a.Fragment,{children:i||void 0},void 0)}function vA(e,t,r){if(t.type==="element")return wD(e,t,r);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return ND(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return TD(e,t,r);if(t.type==="mdxjsEsm")return AD(e,t);if(t.type==="root")return CD(e,t,r);if(t.type==="text")return RD(e,t)}function wD(e,t,r){const n=e.schema;let a=n;t.tagName.toLowerCase()==="svg"&&n.space==="html"&&(a=Ch,e.schema=a),e.ancestors.push(t);const i=SA(e,t.tagName,!1),s=OD(e,t);let l=Lh(e,t);return ED.has(t.tagName)&&(l=l.filter(function(u){return typeof u=="string"?!OL(u):!0})),EA(e,s,i,t),Oh(s,l),e.ancestors.pop(),e.schema=n,e.create(t,i,s,r)}function ND(e,t){if(t.data&&t.data.estree&&e.evaluater){const n=t.data.estree.body[0];return n.type,e.evaluater.evaluateExpression(n.expression)}wi(e,t.position)}function AD(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);wi(e,t.position)}function TD(e,t,r){const n=e.schema;let a=n;t.name==="svg"&&n.space==="html"&&(a=Ch,e.schema=a),e.ancestors.push(t);const i=t.name===null?e.Fragment:SA(e,t.name,!0),s=LD(e,t),l=Lh(e,t);return EA(e,s,i,t),Oh(s,l),e.ancestors.pop(),e.schema=n,e.create(t,i,s,r)}function CD(e,t,r){const n={};return Oh(n,Lh(e,t)),e.create(t,e.Fragment,n,r)}function RD(e,t){return t.value}function EA(e,t,r,n){typeof r!="string"&&r!==e.Fragment&&e.passNode&&(t.node=n)}function Oh(e,t){if(t.length>0){const r=t.length>1?t:t[0];r&&(e.children=r)}}function ID(e,t,r){return n;function n(a,i,s,l){const c=Array.isArray(s.children)?r:t;return l?c(i,s,l):c(i,s)}}function _D(e,t){return r;function r(n,a,i,s){const l=Array.isArray(i.children),u=Ih(n);return t(a,i,s,l,{columnNumber:u?u.column-1:void 0,fileName:e,lineNumber:u?u.line:void 0},void 0)}}function OD(e,t){const r={};let n,a;for(a in t.properties)if(a!=="children"&&_h.call(t.properties,a)){const i=DD(e,a,t.properties[a]);if(i){const[s,l]=i;e.tableCellAlignToStyle&&s==="align"&&typeof l=="string"&&SD.has(t.tagName)?n=l:r[s]=l}}if(n){const i=r.style||(r.style={});i[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=n}return r}function LD(e,t){const r={};for(const n of t.attributes)if(n.type==="mdxJsxExpressionAttribute")if(n.data&&n.data.estree&&e.evaluater){const i=n.data.estree.body[0];i.type;const s=i.expression;s.type;const l=s.properties[0];l.type,Object.assign(r,e.evaluater.evaluateExpression(l.argument))}else wi(e,t.position);else{const a=n.name;let i;if(n.value&&typeof n.value=="object")if(n.value.data&&n.value.data.estree&&e.evaluater){const l=n.value.data.estree.body[0];l.type,i=e.evaluater.evaluateExpression(l.expression)}else wi(e,t.position);else i=n.value===null?!0:n.value;r[a]=i}return r}function Lh(e,t){const r=[];let n=-1;const a=e.passKeys?new Map:xD;for(;++n<t.children.length;){const i=t.children[n];let s;if(e.passKeys){const u=i.type==="element"?i.tagName:i.type==="mdxJsxFlowElement"||i.type==="mdxJsxTextElement"?i.name:void 0;if(u){const c=a.get(u)||0;s=u+"-"+c,a.set(u,c+1)}}const l=vA(e,i,s);l!==void 0&&r.push(l)}return r}function DD(e,t,r){const n=UL(e.schema,t);if(!(r==null||typeof r=="number"&&Number.isNaN(r))){if(Array.isArray(r)&&(r=n.commaSeparated?TL(r):GL(r)),n.property==="style"){let a=typeof r=="object"?r:MD(e,String(r));return e.stylePropertyNameCase==="css"&&(a=jD(a)),["style",a]}return[e.elementAttributeNameCase==="react"&&n.space?jL[n.property]||n.property:n.attribute,r]}}function MD(e,t){try{return bD(t,{reactCompat:!0})}catch(r){if(e.ignoreInvalidStyle)return{};const n=r,a=new Qe("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:n,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw a.file=e.filePath||void 0,a.url=xA+"#cannot-parse-style-attribute",a}}function SA(e,t,r){let n;if(!r)n={type:"Literal",value:t};else if(t.includes(".")){const a=t.split(".");let i=-1,s;for(;++i<a.length;){const l=zy(a[i])?{type:"Identifier",name:a[i]}:{type:"Literal",value:a[i]};s=s?{type:"MemberExpression",object:s,property:l,computed:!!(i&&l.type==="Literal"),optional:!1}:l}n=s}else n=zy(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(n.type==="Literal"){const a=n.value;return _h.call(e.components,a)?e.components[a]:a}if(e.evaluater)return e.evaluater.evaluateExpression(n);wi(e)}function wi(e,t){const r=new Qe("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw r.file=e.filePath||void 0,r.url=xA+"#cannot-handle-mdx-estrees-without-createevaluater",r}function jD(e){const t={};let r;for(r in e)_h.call(e,r)&&(t[FD(r)]=e[r]);return t}function FD(e){let t=e.replace(vD,PD);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function PD(e){return"-"+e.toLowerCase()}const Rl={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]},UD={};function BD(e,t){const r=UD,n=typeof r.includeImageAlt=="boolean"?r.includeImageAlt:!0,a=typeof r.includeHtml=="boolean"?r.includeHtml:!0;return kA(e,n,a)}function kA(e,t,r){if($D(e)){if("value"in e)return e.type==="html"&&!r?"":e.value;if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return Jy(e.children,t,r)}return Array.isArray(e)?Jy(e,t,r):""}function Jy(e,t,r){const n=[];let a=-1;for(;++a<e.length;)n[a]=kA(e[a],t,r);return n.join("")}function $D(e){return!!(e&&typeof e=="object")}const e0=document.createElement("i");function Dh(e){const t="&"+e+";";e0.innerHTML=t;const r=e0.textContent;return r.charCodeAt(r.length-1)===59&&e!=="semi"||r===t?!1:r}function nr(e,t,r,n){const a=e.length;let i=0,s;if(t<0?t=-t>a?0:a+t:t=t>a?a:t,r=r>0?r:0,n.length<1e4)s=Array.from(n),s.unshift(t,r),e.splice(...s);else for(r&&e.splice(t,r);i<n.length;)s=n.slice(i,i+1e4),s.unshift(t,0),e.splice(...s),i+=1e4,t+=1e4}function Ot(e,t){return e.length>0?(nr(e,e.length,0,t),e):t}const t0={}.hasOwnProperty;function zD(e){const t={};let r=-1;for(;++r<e.length;)GD(t,e[r]);return t}function GD(e,t){let r;for(r in t){const a=(t0.call(e,r)?e[r]:void 0)||(e[r]={}),i=t[r];let s;if(i)for(s in i){t0.call(a,s)||(a[s]=[]);const l=i[s];qD(a[s],Array.isArray(l)?l:l?[l]:[])}}}function qD(e,t){let r=-1;const n=[];for(;++r<t.length;)(t[r].add==="after"?e:n).push(t[r]);nr(e,0,0,n)}function wA(e,t){const r=Number.parseInt(e,t);return r<9||r===11||r>13&&r<32||r>126&&r<160||r>55295&&r<57344||r>64975&&r<65008||(r&65535)===65535||(r&65535)===65534||r>1114111?"�":String.fromCodePoint(r)}function ia(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const Jt=Jr(/[A-Za-z]/),St=Jr(/[\dA-Za-z]/),HD=Jr(/[#-'*+\--9=?A-Z^-~]/);function of(e){return e!==null&&(e<32||e===127)}const sf=Jr(/\d/),VD=Jr(/[\dA-Fa-f]/),WD=Jr(/[!-/:-@[-`{-~]/);function ee(e){return e!==null&&e<-2}function ft(e){return e!==null&&(e<0||e===32)}function ce(e){return e===-2||e===-1||e===32}const YD=Jr(new RegExp("\\p{P}|\\p{S}","u")),KD=Jr(/\s/);function Jr(e){return t;function t(r){return r!==null&&r>-1&&e.test(String.fromCharCode(r))}}function va(e){const t=[];let r=-1,n=0,a=0;for(;++r<e.length;){const i=e.charCodeAt(r);let s="";if(i===37&&St(e.charCodeAt(r+1))&&St(e.charCodeAt(r+2)))a=2;else if(i<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(i))||(s=String.fromCharCode(i));else if(i>55295&&i<57344){const l=e.charCodeAt(r+1);i<56320&&l>56319&&l<57344?(s=String.fromCharCode(i,l),a=1):s="�"}else s=String.fromCharCode(i);s&&(t.push(e.slice(n,r),encodeURIComponent(s)),n=r+a+1,s=""),a&&(r+=a,a=0)}return t.join("")+e.slice(n)}function he(e,t,r,n){const a=n?n-1:Number.POSITIVE_INFINITY;let i=0;return s;function s(u){return ce(u)?(e.enter(r),l(u)):t(u)}function l(u){return ce(u)&&i++<a?(e.consume(u),l):(e.exit(r),t(u))}}const ZD={tokenize:XD};function XD(e){const t=e.attempt(this.parser.constructs.contentInitial,n,a);let r;return t;function n(l){if(l===null){e.consume(l);return}return e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),he(e,t,"linePrefix")}function a(l){return e.enter("paragraph"),i(l)}function i(l){const u=e.enter("chunkText",{contentType:"text",previous:r});return r&&(r.next=u),r=u,s(l)}function s(l){if(l===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(l);return}return ee(l)?(e.consume(l),e.exit("chunkText"),i):(e.consume(l),s)}}const QD={tokenize:JD},r0={tokenize:e5};function JD(e){const t=this,r=[];let n=0,a,i,s;return l;function l(b){if(n<r.length){const E=r[n];return t.containerState=E[1],e.attempt(E[0].continuation,u,c)(b)}return c(b)}function u(b){if(n++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,a&&y();const E=t.events.length;let w=E,S;for(;w--;)if(t.events[w][0]==="exit"&&t.events[w][1].type==="chunkFlow"){S=t.events[w][1].end;break}h(n);let T=E;for(;T<t.events.length;)t.events[T][1].end={...S},T++;return nr(t.events,w+1,0,t.events.slice(E)),t.events.length=T,c(b)}return l(b)}function c(b){if(n===r.length){if(!a)return m(b);if(a.currentConstruct&&a.currentConstruct.concrete)return x(b);t.interrupt=!!(a.currentConstruct&&!a._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(r0,d,p)(b)}function d(b){return a&&y(),h(n),m(b)}function p(b){return t.parser.lazy[t.now().line]=n!==r.length,s=t.now().offset,x(b)}function m(b){return t.containerState={},e.attempt(r0,g,x)(b)}function g(b){return n++,r.push([t.currentConstruct,t.containerState]),m(b)}function x(b){if(b===null){a&&y(),h(0),e.consume(b);return}return a=a||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:a,contentType:"flow",previous:i}),v(b)}function v(b){if(b===null){N(e.exit("chunkFlow"),!0),h(0),e.consume(b);return}return ee(b)?(e.consume(b),N(e.exit("chunkFlow")),n=0,t.interrupt=void 0,l):(e.consume(b),v)}function N(b,E){const w=t.sliceStream(b);if(E&&w.push(null),b.previous=i,i&&(i.next=b),i=b,a.defineSkip(b.start),a.write(w),t.parser.lazy[b.start.line]){let S=a.events.length;for(;S--;)if(a.events[S][1].start.offset<s&&(!a.events[S][1].end||a.events[S][1].end.offset>s))return;const T=t.events.length;let R=T,_,M;for(;R--;)if(t.events[R][0]==="exit"&&t.events[R][1].type==="chunkFlow"){if(_){M=t.events[R][1].end;break}_=!0}for(h(n),S=T;S<t.events.length;)t.events[S][1].end={...M},S++;nr(t.events,R+1,0,t.events.slice(T)),t.events.length=S}}function h(b){let E=r.length;for(;E-- >b;){const w=r[E];t.containerState=w[1],w[0].exit.call(t,e)}r.length=b}function y(){a.write([null]),i=void 0,a=void 0,t.containerState._closeFlow=void 0}}function e5(e,t,r){return he(e,e.attempt(this.parser.constructs.document,t,r),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function n0(e){if(e===null||ft(e)||KD(e))return 1;if(YD(e))return 2}function Mh(e,t,r){const n=[];let a=-1;for(;++a<e.length;){const i=e[a].resolveAll;i&&!n.includes(i)&&(t=i(t,r),n.push(i))}return t}const lf={name:"attention",resolveAll:t5,tokenize:r5};function t5(e,t){let r=-1,n,a,i,s,l,u,c,d;for(;++r<e.length;)if(e[r][0]==="enter"&&e[r][1].type==="attentionSequence"&&e[r][1]._close){for(n=r;n--;)if(e[n][0]==="exit"&&e[n][1].type==="attentionSequence"&&e[n][1]._open&&t.sliceSerialize(e[n][1]).charCodeAt(0)===t.sliceSerialize(e[r][1]).charCodeAt(0)){if((e[n][1]._close||e[r][1]._open)&&(e[r][1].end.offset-e[r][1].start.offset)%3&&!((e[n][1].end.offset-e[n][1].start.offset+e[r][1].end.offset-e[r][1].start.offset)%3))continue;u=e[n][1].end.offset-e[n][1].start.offset>1&&e[r][1].end.offset-e[r][1].start.offset>1?2:1;const p={...e[n][1].end},m={...e[r][1].start};a0(p,-u),a0(m,u),s={type:u>1?"strongSequence":"emphasisSequence",start:p,end:{...e[n][1].end}},l={type:u>1?"strongSequence":"emphasisSequence",start:{...e[r][1].start},end:m},i={type:u>1?"strongText":"emphasisText",start:{...e[n][1].end},end:{...e[r][1].start}},a={type:u>1?"strong":"emphasis",start:{...s.start},end:{...l.end}},e[n][1].end={...s.start},e[r][1].start={...l.end},c=[],e[n][1].end.offset-e[n][1].start.offset&&(c=Ot(c,[["enter",e[n][1],t],["exit",e[n][1],t]])),c=Ot(c,[["enter",a,t],["enter",s,t],["exit",s,t],["enter",i,t]]),c=Ot(c,Mh(t.parser.constructs.insideSpan.null,e.slice(n+1,r),t)),c=Ot(c,[["exit",i,t],["enter",l,t],["exit",l,t],["exit",a,t]]),e[r][1].end.offset-e[r][1].start.offset?(d=2,c=Ot(c,[["enter",e[r][1],t],["exit",e[r][1],t]])):d=0,nr(e,n-1,r-n+3,c),r=n+c.length-d-2;break}}for(r=-1;++r<e.length;)e[r][1].type==="attentionSequence"&&(e[r][1].type="data");return e}function r5(e,t){const r=this.parser.constructs.attentionMarkers.null,n=this.previous,a=n0(n);let i;return s;function s(u){return i=u,e.enter("attentionSequence"),l(u)}function l(u){if(u===i)return e.consume(u),l;const c=e.exit("attentionSequence"),d=n0(u),p=!d||d===2&&a||r.includes(u),m=!a||a===2&&d||r.includes(n);return c._open=!!(i===42?p:p&&(a||!m)),c._close=!!(i===42?m:m&&(d||!p)),t(u)}}function a0(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const n5={name:"autolink",tokenize:a5};function a5(e,t,r){let n=0;return a;function a(g){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(g),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),i}function i(g){return Jt(g)?(e.consume(g),s):g===64?r(g):c(g)}function s(g){return g===43||g===45||g===46||St(g)?(n=1,l(g)):c(g)}function l(g){return g===58?(e.consume(g),n=0,u):(g===43||g===45||g===46||St(g))&&n++<32?(e.consume(g),l):(n=0,c(g))}function u(g){return g===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(g),e.exit("autolinkMarker"),e.exit("autolink"),t):g===null||g===32||g===60||of(g)?r(g):(e.consume(g),u)}function c(g){return g===64?(e.consume(g),d):HD(g)?(e.consume(g),c):r(g)}function d(g){return St(g)?p(g):r(g)}function p(g){return g===46?(e.consume(g),n=0,d):g===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(g),e.exit("autolinkMarker"),e.exit("autolink"),t):m(g)}function m(g){if((g===45||St(g))&&n++<63){const x=g===45?m:p;return e.consume(g),x}return r(g)}}const zs={partial:!0,tokenize:i5};function i5(e,t,r){return n;function n(i){return ce(i)?he(e,a,"linePrefix")(i):a(i)}function a(i){return i===null||ee(i)?t(i):r(i)}}const NA={continuation:{tokenize:s5},exit:l5,name:"blockQuote",tokenize:o5};function o5(e,t,r){const n=this;return a;function a(s){if(s===62){const l=n.containerState;return l.open||(e.enter("blockQuote",{_container:!0}),l.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(s),e.exit("blockQuoteMarker"),i}return r(s)}function i(s){return ce(s)?(e.enter("blockQuotePrefixWhitespace"),e.consume(s),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(s))}}function s5(e,t,r){const n=this;return a;function a(s){return ce(s)?he(e,i,"linePrefix",n.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(s):i(s)}function i(s){return e.attempt(NA,t,r)(s)}}function l5(e){e.exit("blockQuote")}const AA={name:"characterEscape",tokenize:u5};function u5(e,t,r){return n;function n(i){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(i),e.exit("escapeMarker"),a}function a(i){return WD(i)?(e.enter("characterEscapeValue"),e.consume(i),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):r(i)}}const TA={name:"characterReference",tokenize:c5};function c5(e,t,r){const n=this;let a=0,i,s;return l;function l(p){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(p),e.exit("characterReferenceMarker"),u}function u(p){return p===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(p),e.exit("characterReferenceMarkerNumeric"),c):(e.enter("characterReferenceValue"),i=31,s=St,d(p))}function c(p){return p===88||p===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(p),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),i=6,s=VD,d):(e.enter("characterReferenceValue"),i=7,s=sf,d(p))}function d(p){if(p===59&&a){const m=e.exit("characterReferenceValue");return s===St&&!Dh(n.sliceSerialize(m))?r(p):(e.enter("characterReferenceMarker"),e.consume(p),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return s(p)&&a++<i?(e.consume(p),d):r(p)}}const i0={partial:!0,tokenize:p5},o0={concrete:!0,name:"codeFenced",tokenize:d5};function d5(e,t,r){const n=this,a={partial:!0,tokenize:w};let i=0,s=0,l;return u;function u(S){return c(S)}function c(S){const T=n.events[n.events.length-1];return i=T&&T[1].type==="linePrefix"?T[2].sliceSerialize(T[1],!0).length:0,l=S,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),d(S)}function d(S){return S===l?(s++,e.consume(S),d):s<3?r(S):(e.exit("codeFencedFenceSequence"),ce(S)?he(e,p,"whitespace")(S):p(S))}function p(S){return S===null||ee(S)?(e.exit("codeFencedFence"),n.interrupt?t(S):e.check(i0,v,E)(S)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),m(S))}function m(S){return S===null||ee(S)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),p(S)):ce(S)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),he(e,g,"whitespace")(S)):S===96&&S===l?r(S):(e.consume(S),m)}function g(S){return S===null||ee(S)?p(S):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),x(S))}function x(S){return S===null||ee(S)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),p(S)):S===96&&S===l?r(S):(e.consume(S),x)}function v(S){return e.attempt(a,E,N)(S)}function N(S){return e.enter("lineEnding"),e.consume(S),e.exit("lineEnding"),h}function h(S){return i>0&&ce(S)?he(e,y,"linePrefix",i+1)(S):y(S)}function y(S){return S===null||ee(S)?e.check(i0,v,E)(S):(e.enter("codeFlowValue"),b(S))}function b(S){return S===null||ee(S)?(e.exit("codeFlowValue"),y(S)):(e.consume(S),b)}function E(S){return e.exit("codeFenced"),t(S)}function w(S,T,R){let _=0;return M;function M(B){return S.enter("lineEnding"),S.consume(B),S.exit("lineEnding"),F}function F(B){return S.enter("codeFencedFence"),ce(B)?he(S,L,"linePrefix",n.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(B):L(B)}function L(B){return B===l?(S.enter("codeFencedFenceSequence"),O(B)):R(B)}function O(B){return B===l?(_++,S.consume(B),O):_>=s?(S.exit("codeFencedFenceSequence"),ce(B)?he(S,P,"whitespace")(B):P(B)):R(B)}function P(B){return B===null||ee(B)?(S.exit("codeFencedFence"),T(B)):R(B)}}}function p5(e,t,r){const n=this;return a;function a(s){return s===null?r(s):(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),i)}function i(s){return n.parser.lazy[n.now().line]?r(s):t(s)}}const Il={name:"codeIndented",tokenize:m5},g5={partial:!0,tokenize:f5};function m5(e,t,r){const n=this;return a;function a(c){return e.enter("codeIndented"),he(e,i,"linePrefix",5)(c)}function i(c){const d=n.events[n.events.length-1];return d&&d[1].type==="linePrefix"&&d[2].sliceSerialize(d[1],!0).length>=4?s(c):r(c)}function s(c){return c===null?u(c):ee(c)?e.attempt(g5,s,u)(c):(e.enter("codeFlowValue"),l(c))}function l(c){return c===null||ee(c)?(e.exit("codeFlowValue"),s(c)):(e.consume(c),l)}function u(c){return e.exit("codeIndented"),t(c)}}function f5(e,t,r){const n=this;return a;function a(s){return n.parser.lazy[n.now().line]?r(s):ee(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),a):he(e,i,"linePrefix",5)(s)}function i(s){const l=n.events[n.events.length-1];return l&&l[1].type==="linePrefix"&&l[2].sliceSerialize(l[1],!0).length>=4?t(s):ee(s)?a(s):r(s)}}const h5={name:"codeText",previous:y5,resolve:b5,tokenize:x5};function b5(e){let t=e.length-4,r=3,n,a;if((e[r][1].type==="lineEnding"||e[r][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(n=r;++n<t;)if(e[n][1].type==="codeTextData"){e[r][1].type="codeTextPadding",e[t][1].type="codeTextPadding",r+=2,t-=2;break}}for(n=r-1,t++;++n<=t;)a===void 0?n!==t&&e[n][1].type!=="lineEnding"&&(a=n):(n===t||e[n][1].type==="lineEnding")&&(e[a][1].type="codeTextData",n!==a+2&&(e[a][1].end=e[n-1][1].end,e.splice(a+2,n-a-2),t-=n-a-2,n=a+2),a=void 0);return e}function y5(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function x5(e,t,r){let n=0,a,i;return s;function s(p){return e.enter("codeText"),e.enter("codeTextSequence"),l(p)}function l(p){return p===96?(e.consume(p),n++,l):(e.exit("codeTextSequence"),u(p))}function u(p){return p===null?r(p):p===32?(e.enter("space"),e.consume(p),e.exit("space"),u):p===96?(i=e.enter("codeTextSequence"),a=0,d(p)):ee(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),u):(e.enter("codeTextData"),c(p))}function c(p){return p===null||p===32||p===96||ee(p)?(e.exit("codeTextData"),u(p)):(e.consume(p),c)}function d(p){return p===96?(e.consume(p),a++,d):a===n?(e.exit("codeTextSequence"),e.exit("codeText"),t(p)):(i.type="codeTextData",c(p))}}class v5{constructor(t){this.left=t?[...t]:[],this.right=[]}get(t){if(t<0||t>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return t<this.left.length?this.left[t]:this.right[this.right.length-t+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(t,r){const n=r??Number.POSITIVE_INFINITY;return n<this.left.length?this.left.slice(t,n):t>this.left.length?this.right.slice(this.right.length-n+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-n+this.left.length).reverse())}splice(t,r,n){const a=r||0;this.setCursor(Math.trunc(t));const i=this.right.splice(this.right.length-a,Number.POSITIVE_INFINITY);return n&&La(this.left,n),i.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),La(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),La(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t<this.left.length){const r=this.left.splice(t,Number.POSITIVE_INFINITY);La(this.right,r.reverse())}else{const r=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);La(this.left,r.reverse())}}}function La(e,t){let r=0;if(t.length<1e4)e.push(...t);else for(;r<t.length;)e.push(...t.slice(r,r+1e4)),r+=1e4}function CA(e){const t={};let r=-1,n,a,i,s,l,u,c;const d=new v5(e);for(;++r<d.length;){for(;r in t;)r=t[r];if(n=d.get(r),r&&n[1].type==="chunkFlow"&&d.get(r-1)[1].type==="listItemPrefix"&&(u=n[1]._tokenizer.events,i=0,i<u.length&&u[i][1].type==="lineEndingBlank"&&(i+=2),i<u.length&&u[i][1].type==="content"))for(;++i<u.length&&u[i][1].type!=="content";)u[i][1].type==="chunkText"&&(u[i][1]._isInFirstContentOfListItem=!0,i++);if(n[0]==="enter")n[1].contentType&&(Object.assign(t,E5(d,r)),r=t[r],c=!0);else if(n[1]._container){for(i=r,a=void 0;i--;)if(s=d.get(i),s[1].type==="lineEnding"||s[1].type==="lineEndingBlank")s[0]==="enter"&&(a&&(d.get(a)[1].type="lineEndingBlank"),s[1].type="lineEnding",a=i);else if(!(s[1].type==="linePrefix"||s[1].type==="listItemIndent"))break;a&&(n[1].end={...d.get(a)[1].start},l=d.slice(a,r),l.unshift(n),d.splice(a,r-a+1,l))}}return nr(e,0,Number.POSITIVE_INFINITY,d.slice(0)),!c}function E5(e,t){const r=e.get(t)[1],n=e.get(t)[2];let a=t-1;const i=[];let s=r._tokenizer;s||(s=n.parser[r.contentType](r.start),r._contentTypeTextTrailing&&(s._contentTypeTextTrailing=!0));const l=s.events,u=[],c={};let d,p,m=-1,g=r,x=0,v=0;const N=[v];for(;g;){for(;e.get(++a)[1]!==g;);i.push(a),g._tokenizer||(d=n.sliceStream(g),g.next||d.push(null),p&&s.defineSkip(g.start),g._isInFirstContentOfListItem&&(s._gfmTasklistFirstContentOfListItem=!0),s.write(d),g._isInFirstContentOfListItem&&(s._gfmTasklistFirstContentOfListItem=void 0)),p=g,g=g.next}for(g=r;++m<l.length;)l[m][0]==="exit"&&l[m-1][0]==="enter"&&l[m][1].type===l[m-1][1].type&&l[m][1].start.line!==l[m][1].end.line&&(v=m+1,N.push(v),g._tokenizer=void 0,g.previous=void 0,g=g.next);for(s.events=[],g?(g._tokenizer=void 0,g.previous=void 0):N.pop(),m=N.length;m--;){const h=l.slice(N[m],N[m+1]),y=i.pop();u.push([y,y+h.length-1]),e.splice(y,2,h)}for(u.reverse(),m=-1;++m<u.length;)c[x+u[m][0]]=x+u[m][1],x+=u[m][1]-u[m][0]-1;return c}const S5={resolve:w5,tokenize:N5},k5={partial:!0,tokenize:A5};function w5(e){return CA(e),e}function N5(e,t){let r;return n;function n(l){return e.enter("content"),r=e.enter("chunkContent",{contentType:"content"}),a(l)}function a(l){return l===null?i(l):ee(l)?e.check(k5,s,i)(l):(e.consume(l),a)}function i(l){return e.exit("chunkContent"),e.exit("content"),t(l)}function s(l){return e.consume(l),e.exit("chunkContent"),r.next=e.enter("chunkContent",{contentType:"content",previous:r}),r=r.next,a}}function A5(e,t,r){const n=this;return a;function a(s){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),he(e,i,"linePrefix")}function i(s){if(s===null||ee(s))return r(s);const l=n.events[n.events.length-1];return!n.parser.constructs.disable.null.includes("codeIndented")&&l&&l[1].type==="linePrefix"&&l[2].sliceSerialize(l[1],!0).length>=4?t(s):e.interrupt(n.parser.constructs.flow,r,t)(s)}}function RA(e,t,r,n,a,i,s,l,u){const c=u||Number.POSITIVE_INFINITY;let d=0;return p;function p(h){return h===60?(e.enter(n),e.enter(a),e.enter(i),e.consume(h),e.exit(i),m):h===null||h===32||h===41||of(h)?r(h):(e.enter(n),e.enter(s),e.enter(l),e.enter("chunkString",{contentType:"string"}),v(h))}function m(h){return h===62?(e.enter(i),e.consume(h),e.exit(i),e.exit(a),e.exit(n),t):(e.enter(l),e.enter("chunkString",{contentType:"string"}),g(h))}function g(h){return h===62?(e.exit("chunkString"),e.exit(l),m(h)):h===null||h===60||ee(h)?r(h):(e.consume(h),h===92?x:g)}function x(h){return h===60||h===62||h===92?(e.consume(h),g):g(h)}function v(h){return!d&&(h===null||h===41||ft(h))?(e.exit("chunkString"),e.exit(l),e.exit(s),e.exit(n),t(h)):d<c&&h===40?(e.consume(h),d++,v):h===41?(e.consume(h),d--,v):h===null||h===32||h===40||of(h)?r(h):(e.consume(h),h===92?N:v)}function N(h){return h===40||h===41||h===92?(e.consume(h),v):v(h)}}function IA(e,t,r,n,a,i){const s=this;let l=0,u;return c;function c(g){return e.enter(n),e.enter(a),e.consume(g),e.exit(a),e.enter(i),d}function d(g){return l>999||g===null||g===91||g===93&&!u||g===94&&!l&&"_hiddenFootnoteSupport"in s.parser.constructs?r(g):g===93?(e.exit(i),e.enter(a),e.consume(g),e.exit(a),e.exit(n),t):ee(g)?(e.enter("lineEnding"),e.consume(g),e.exit("lineEnding"),d):(e.enter("chunkString",{contentType:"string"}),p(g))}function p(g){return g===null||g===91||g===93||ee(g)||l++>999?(e.exit("chunkString"),d(g)):(e.consume(g),u||(u=!ce(g)),g===92?m:p)}function m(g){return g===91||g===92||g===93?(e.consume(g),l++,p):p(g)}}function _A(e,t,r,n,a,i){let s;return l;function l(m){return m===34||m===39||m===40?(e.enter(n),e.enter(a),e.consume(m),e.exit(a),s=m===40?41:m,u):r(m)}function u(m){return m===s?(e.enter(a),e.consume(m),e.exit(a),e.exit(n),t):(e.enter(i),c(m))}function c(m){return m===s?(e.exit(i),u(s)):m===null?r(m):ee(m)?(e.enter("lineEnding"),e.consume(m),e.exit("lineEnding"),he(e,c,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),d(m))}function d(m){return m===s||m===null||ee(m)?(e.exit("chunkString"),c(m)):(e.consume(m),m===92?p:d)}function p(m){return m===s||m===92?(e.consume(m),d):d(m)}}function ti(e,t){let r;return n;function n(a){return ee(a)?(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),r=!0,n):ce(a)?he(e,n,r?"linePrefix":"lineSuffix")(a):t(a)}}const T5={name:"definition",tokenize:R5},C5={partial:!0,tokenize:I5};function R5(e,t,r){const n=this;let a;return i;function i(g){return e.enter("definition"),s(g)}function s(g){return IA.call(n,e,l,r,"definitionLabel","definitionLabelMarker","definitionLabelString")(g)}function l(g){return a=ia(n.sliceSerialize(n.events[n.events.length-1][1]).slice(1,-1)),g===58?(e.enter("definitionMarker"),e.consume(g),e.exit("definitionMarker"),u):r(g)}function u(g){return ft(g)?ti(e,c)(g):c(g)}function c(g){return RA(e,d,r,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(g)}function d(g){return e.attempt(C5,p,p)(g)}function p(g){return ce(g)?he(e,m,"whitespace")(g):m(g)}function m(g){return g===null||ee(g)?(e.exit("definition"),n.parser.defined.push(a),t(g)):r(g)}}function I5(e,t,r){return n;function n(l){return ft(l)?ti(e,a)(l):r(l)}function a(l){return _A(e,i,r,"definitionTitle","definitionTitleMarker","definitionTitleString")(l)}function i(l){return ce(l)?he(e,s,"whitespace")(l):s(l)}function s(l){return l===null||ee(l)?t(l):r(l)}}const _5={name:"hardBreakEscape",tokenize:O5};function O5(e,t,r){return n;function n(i){return e.enter("hardBreakEscape"),e.consume(i),a}function a(i){return ee(i)?(e.exit("hardBreakEscape"),t(i)):r(i)}}const L5={name:"headingAtx",resolve:D5,tokenize:M5};function D5(e,t){let r=e.length-2,n=3,a,i;return e[n][1].type==="whitespace"&&(n+=2),r-2>n&&e[r][1].type==="whitespace"&&(r-=2),e[r][1].type==="atxHeadingSequence"&&(n===r-1||r-4>n&&e[r-2][1].type==="whitespace")&&(r-=n+1===r?2:4),r>n&&(a={type:"atxHeadingText",start:e[n][1].start,end:e[r][1].end},i={type:"chunkText",start:e[n][1].start,end:e[r][1].end,contentType:"text"},nr(e,n,r-n+1,[["enter",a,t],["enter",i,t],["exit",i,t],["exit",a,t]])),e}function M5(e,t,r){let n=0;return a;function a(d){return e.enter("atxHeading"),i(d)}function i(d){return e.enter("atxHeadingSequence"),s(d)}function s(d){return d===35&&n++<6?(e.consume(d),s):d===null||ft(d)?(e.exit("atxHeadingSequence"),l(d)):r(d)}function l(d){return d===35?(e.enter("atxHeadingSequence"),u(d)):d===null||ee(d)?(e.exit("atxHeading"),t(d)):ce(d)?he(e,l,"whitespace")(d):(e.enter("atxHeadingText"),c(d))}function u(d){return d===35?(e.consume(d),u):(e.exit("atxHeadingSequence"),l(d))}function c(d){return d===null||d===35||ft(d)?(e.exit("atxHeadingText"),l(d)):(e.consume(d),c)}}const j5=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],s0=["pre","script","style","textarea"],F5={concrete:!0,name:"htmlFlow",resolveTo:B5,tokenize:$5},P5={partial:!0,tokenize:G5},U5={partial:!0,tokenize:z5};function B5(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function $5(e,t,r){const n=this;let a,i,s,l,u;return c;function c(A){return d(A)}function d(A){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(A),p}function p(A){return A===33?(e.consume(A),m):A===47?(e.consume(A),i=!0,v):A===63?(e.consume(A),a=3,n.interrupt?t:k):Jt(A)?(e.consume(A),s=String.fromCharCode(A),N):r(A)}function m(A){return A===45?(e.consume(A),a=2,g):A===91?(e.consume(A),a=5,l=0,x):Jt(A)?(e.consume(A),a=4,n.interrupt?t:k):r(A)}function g(A){return A===45?(e.consume(A),n.interrupt?t:k):r(A)}function x(A){const H="CDATA[";return A===H.charCodeAt(l++)?(e.consume(A),l===H.length?n.interrupt?t:L:x):r(A)}function v(A){return Jt(A)?(e.consume(A),s=String.fromCharCode(A),N):r(A)}function N(A){if(A===null||A===47||A===62||ft(A)){const H=A===47,ne=s.toLowerCase();return!H&&!i&&s0.includes(ne)?(a=1,n.interrupt?t(A):L(A)):j5.includes(s.toLowerCase())?(a=6,H?(e.consume(A),h):n.interrupt?t(A):L(A)):(a=7,n.interrupt&&!n.parser.lazy[n.now().line]?r(A):i?y(A):b(A))}return A===45||St(A)?(e.consume(A),s+=String.fromCharCode(A),N):r(A)}function h(A){return A===62?(e.consume(A),n.interrupt?t:L):r(A)}function y(A){return ce(A)?(e.consume(A),y):M(A)}function b(A){return A===47?(e.consume(A),M):A===58||A===95||Jt(A)?(e.consume(A),E):ce(A)?(e.consume(A),b):M(A)}function E(A){return A===45||A===46||A===58||A===95||St(A)?(e.consume(A),E):w(A)}function w(A){return A===61?(e.consume(A),S):ce(A)?(e.consume(A),w):b(A)}function S(A){return A===null||A===60||A===61||A===62||A===96?r(A):A===34||A===39?(e.consume(A),u=A,T):ce(A)?(e.consume(A),S):R(A)}function T(A){return A===u?(e.consume(A),u=null,_):A===null||ee(A)?r(A):(e.consume(A),T)}function R(A){return A===null||A===34||A===39||A===47||A===60||A===61||A===62||A===96||ft(A)?w(A):(e.consume(A),R)}function _(A){return A===47||A===62||ce(A)?b(A):r(A)}function M(A){return A===62?(e.consume(A),F):r(A)}function F(A){return A===null||ee(A)?L(A):ce(A)?(e.consume(A),F):r(A)}function L(A){return A===45&&a===2?(e.consume(A),z):A===60&&a===1?(e.consume(A),W):A===62&&a===4?(e.consume(A),$):A===63&&a===3?(e.consume(A),k):A===93&&a===5?(e.consume(A),D):ee(A)&&(a===6||a===7)?(e.exit("htmlFlowData"),e.check(P5,I,O)(A)):A===null||ee(A)?(e.exit("htmlFlowData"),O(A)):(e.consume(A),L)}function O(A){return e.check(U5,P,I)(A)}function P(A){return e.enter("lineEnding"),e.consume(A),e.exit("lineEnding"),B}function B(A){return A===null||ee(A)?O(A):(e.enter("htmlFlowData"),L(A))}function z(A){return A===45?(e.consume(A),k):L(A)}function W(A){return A===47?(e.consume(A),s="",j):L(A)}function j(A){if(A===62){const H=s.toLowerCase();return s0.includes(H)?(e.consume(A),$):L(A)}return Jt(A)&&s.length<8?(e.consume(A),s+=String.fromCharCode(A),j):L(A)}function D(A){return A===93?(e.consume(A),k):L(A)}function k(A){return A===62?(e.consume(A),$):A===45&&a===2?(e.consume(A),k):L(A)}function $(A){return A===null||ee(A)?(e.exit("htmlFlowData"),I(A)):(e.consume(A),$)}function I(A){return e.exit("htmlFlow"),t(A)}}function z5(e,t,r){const n=this;return a;function a(s){return ee(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),i):r(s)}function i(s){return n.parser.lazy[n.now().line]?r(s):t(s)}}function G5(e,t,r){return n;function n(a){return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),e.attempt(zs,t,r)}}const q5={name:"htmlText",tokenize:H5};function H5(e,t,r){const n=this;let a,i,s;return l;function l(k){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(k),u}function u(k){return k===33?(e.consume(k),c):k===47?(e.consume(k),w):k===63?(e.consume(k),b):Jt(k)?(e.consume(k),R):r(k)}function c(k){return k===45?(e.consume(k),d):k===91?(e.consume(k),i=0,x):Jt(k)?(e.consume(k),y):r(k)}function d(k){return k===45?(e.consume(k),g):r(k)}function p(k){return k===null?r(k):k===45?(e.consume(k),m):ee(k)?(s=p,W(k)):(e.consume(k),p)}function m(k){return k===45?(e.consume(k),g):p(k)}function g(k){return k===62?z(k):k===45?m(k):p(k)}function x(k){const $="CDATA[";return k===$.charCodeAt(i++)?(e.consume(k),i===$.length?v:x):r(k)}function v(k){return k===null?r(k):k===93?(e.consume(k),N):ee(k)?(s=v,W(k)):(e.consume(k),v)}function N(k){return k===93?(e.consume(k),h):v(k)}function h(k){return k===62?z(k):k===93?(e.consume(k),h):v(k)}function y(k){return k===null||k===62?z(k):ee(k)?(s=y,W(k)):(e.consume(k),y)}function b(k){return k===null?r(k):k===63?(e.consume(k),E):ee(k)?(s=b,W(k)):(e.consume(k),b)}function E(k){return k===62?z(k):b(k)}function w(k){return Jt(k)?(e.consume(k),S):r(k)}function S(k){return k===45||St(k)?(e.consume(k),S):T(k)}function T(k){return ee(k)?(s=T,W(k)):ce(k)?(e.consume(k),T):z(k)}function R(k){return k===45||St(k)?(e.consume(k),R):k===47||k===62||ft(k)?_(k):r(k)}function _(k){return k===47?(e.consume(k),z):k===58||k===95||Jt(k)?(e.consume(k),M):ee(k)?(s=_,W(k)):ce(k)?(e.consume(k),_):z(k)}function M(k){return k===45||k===46||k===58||k===95||St(k)?(e.consume(k),M):F(k)}function F(k){return k===61?(e.consume(k),L):ee(k)?(s=F,W(k)):ce(k)?(e.consume(k),F):_(k)}function L(k){return k===null||k===60||k===61||k===62||k===96?r(k):k===34||k===39?(e.consume(k),a=k,O):ee(k)?(s=L,W(k)):ce(k)?(e.consume(k),L):(e.consume(k),P)}function O(k){return k===a?(e.consume(k),a=void 0,B):k===null?r(k):ee(k)?(s=O,W(k)):(e.consume(k),O)}function P(k){return k===null||k===34||k===39||k===60||k===61||k===96?r(k):k===47||k===62||ft(k)?_(k):(e.consume(k),P)}function B(k){return k===47||k===62||ft(k)?_(k):r(k)}function z(k){return k===62?(e.consume(k),e.exit("htmlTextData"),e.exit("htmlText"),t):r(k)}function W(k){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(k),e.exit("lineEnding"),j}function j(k){return ce(k)?he(e,D,"linePrefix",n.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(k):D(k)}function D(k){return e.enter("htmlTextData"),s(k)}}const jh={name:"labelEnd",resolveAll:K5,resolveTo:Z5,tokenize:X5},V5={tokenize:Q5},W5={tokenize:J5},Y5={tokenize:eM};function K5(e){let t=-1;const r=[];for(;++t<e.length;){const n=e[t][1];if(r.push(e[t]),n.type==="labelImage"||n.type==="labelLink"||n.type==="labelEnd"){const a=n.type==="labelImage"?4:2;n.type="data",t+=a}}return e.length!==r.length&&nr(e,0,e.length,r),e}function Z5(e,t){let r=e.length,n=0,a,i,s,l;for(;r--;)if(a=e[r][1],i){if(a.type==="link"||a.type==="labelLink"&&a._inactive)break;e[r][0]==="enter"&&a.type==="labelLink"&&(a._inactive=!0)}else if(s){if(e[r][0]==="enter"&&(a.type==="labelImage"||a.type==="labelLink")&&!a._balanced&&(i=r,a.type!=="labelLink")){n=2;break}}else a.type==="labelEnd"&&(s=r);const u={type:e[i][1].type==="labelLink"?"link":"image",start:{...e[i][1].start},end:{...e[e.length-1][1].end}},c={type:"label",start:{...e[i][1].start},end:{...e[s][1].end}},d={type:"labelText",start:{...e[i+n+2][1].end},end:{...e[s-2][1].start}};return l=[["enter",u,t],["enter",c,t]],l=Ot(l,e.slice(i+1,i+n+3)),l=Ot(l,[["enter",d,t]]),l=Ot(l,Mh(t.parser.constructs.insideSpan.null,e.slice(i+n+4,s-3),t)),l=Ot(l,[["exit",d,t],e[s-2],e[s-1],["exit",c,t]]),l=Ot(l,e.slice(s+1)),l=Ot(l,[["exit",u,t]]),nr(e,i,e.length,l),e}function X5(e,t,r){const n=this;let a=n.events.length,i,s;for(;a--;)if((n.events[a][1].type==="labelImage"||n.events[a][1].type==="labelLink")&&!n.events[a][1]._balanced){i=n.events[a][1];break}return l;function l(m){return i?i._inactive?p(m):(s=n.parser.defined.includes(ia(n.sliceSerialize({start:i.end,end:n.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(m),e.exit("labelMarker"),e.exit("labelEnd"),u):r(m)}function u(m){return m===40?e.attempt(V5,d,s?d:p)(m):m===91?e.attempt(W5,d,s?c:p)(m):s?d(m):p(m)}function c(m){return e.attempt(Y5,d,p)(m)}function d(m){return t(m)}function p(m){return i._balanced=!0,r(m)}}function Q5(e,t,r){return n;function n(p){return e.enter("resource"),e.enter("resourceMarker"),e.consume(p),e.exit("resourceMarker"),a}function a(p){return ft(p)?ti(e,i)(p):i(p)}function i(p){return p===41?d(p):RA(e,s,l,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(p)}function s(p){return ft(p)?ti(e,u)(p):d(p)}function l(p){return r(p)}function u(p){return p===34||p===39||p===40?_A(e,c,r,"resourceTitle","resourceTitleMarker","resourceTitleString")(p):d(p)}function c(p){return ft(p)?ti(e,d)(p):d(p)}function d(p){return p===41?(e.enter("resourceMarker"),e.consume(p),e.exit("resourceMarker"),e.exit("resource"),t):r(p)}}function J5(e,t,r){const n=this;return a;function a(l){return IA.call(n,e,i,s,"reference","referenceMarker","referenceString")(l)}function i(l){return n.parser.defined.includes(ia(n.sliceSerialize(n.events[n.events.length-1][1]).slice(1,-1)))?t(l):r(l)}function s(l){return r(l)}}function eM(e,t,r){return n;function n(i){return e.enter("reference"),e.enter("referenceMarker"),e.consume(i),e.exit("referenceMarker"),a}function a(i){return i===93?(e.enter("referenceMarker"),e.consume(i),e.exit("referenceMarker"),e.exit("reference"),t):r(i)}}const tM={name:"labelStartImage",resolveAll:jh.resolveAll,tokenize:rM};function rM(e,t,r){const n=this;return a;function a(l){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(l),e.exit("labelImageMarker"),i}function i(l){return l===91?(e.enter("labelMarker"),e.consume(l),e.exit("labelMarker"),e.exit("labelImage"),s):r(l)}function s(l){return l===94&&"_hiddenFootnoteSupport"in n.parser.constructs?r(l):t(l)}}const nM={name:"labelStartLink",resolveAll:jh.resolveAll,tokenize:aM};function aM(e,t,r){const n=this;return a;function a(s){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(s),e.exit("labelMarker"),e.exit("labelLink"),i}function i(s){return s===94&&"_hiddenFootnoteSupport"in n.parser.constructs?r(s):t(s)}}const _l={name:"lineEnding",tokenize:iM};function iM(e,t){return r;function r(n){return e.enter("lineEnding"),e.consume(n),e.exit("lineEnding"),he(e,t,"linePrefix")}}const Lo={name:"thematicBreak",tokenize:oM};function oM(e,t,r){let n=0,a;return i;function i(c){return e.enter("thematicBreak"),s(c)}function s(c){return a=c,l(c)}function l(c){return c===a?(e.enter("thematicBreakSequence"),u(c)):n>=3&&(c===null||ee(c))?(e.exit("thematicBreak"),t(c)):r(c)}function u(c){return c===a?(e.consume(c),n++,u):(e.exit("thematicBreakSequence"),ce(c)?he(e,l,"whitespace")(c):l(c))}}const lt={continuation:{tokenize:cM},exit:pM,name:"list",tokenize:uM},sM={partial:!0,tokenize:gM},lM={partial:!0,tokenize:dM};function uM(e,t,r){const n=this,a=n.events[n.events.length-1];let i=a&&a[1].type==="linePrefix"?a[2].sliceSerialize(a[1],!0).length:0,s=0;return l;function l(g){const x=n.containerState.type||(g===42||g===43||g===45?"listUnordered":"listOrdered");if(x==="listUnordered"?!n.containerState.marker||g===n.containerState.marker:sf(g)){if(n.containerState.type||(n.containerState.type=x,e.enter(x,{_container:!0})),x==="listUnordered")return e.enter("listItemPrefix"),g===42||g===45?e.check(Lo,r,c)(g):c(g);if(!n.interrupt||g===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),u(g)}return r(g)}function u(g){return sf(g)&&++s<10?(e.consume(g),u):(!n.interrupt||s<2)&&(n.containerState.marker?g===n.containerState.marker:g===41||g===46)?(e.exit("listItemValue"),c(g)):r(g)}function c(g){return e.enter("listItemMarker"),e.consume(g),e.exit("listItemMarker"),n.containerState.marker=n.containerState.marker||g,e.check(zs,n.interrupt?r:d,e.attempt(sM,m,p))}function d(g){return n.containerState.initialBlankLine=!0,i++,m(g)}function p(g){return ce(g)?(e.enter("listItemPrefixWhitespace"),e.consume(g),e.exit("listItemPrefixWhitespace"),m):r(g)}function m(g){return n.containerState.size=i+n.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(g)}}function cM(e,t,r){const n=this;return n.containerState._closeFlow=void 0,e.check(zs,a,i);function a(l){return n.containerState.furtherBlankLines=n.containerState.furtherBlankLines||n.containerState.initialBlankLine,he(e,t,"listItemIndent",n.containerState.size+1)(l)}function i(l){return n.containerState.furtherBlankLines||!ce(l)?(n.containerState.furtherBlankLines=void 0,n.containerState.initialBlankLine=void 0,s(l)):(n.containerState.furtherBlankLines=void 0,n.containerState.initialBlankLine=void 0,e.attempt(lM,t,s)(l))}function s(l){return n.containerState._closeFlow=!0,n.interrupt=void 0,he(e,e.attempt(lt,t,r),"linePrefix",n.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(l)}}function dM(e,t,r){const n=this;return he(e,a,"listItemIndent",n.containerState.size+1);function a(i){const s=n.events[n.events.length-1];return s&&s[1].type==="listItemIndent"&&s[2].sliceSerialize(s[1],!0).length===n.containerState.size?t(i):r(i)}}function pM(e){e.exit(this.containerState.type)}function gM(e,t,r){const n=this;return he(e,a,"listItemPrefixWhitespace",n.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function a(i){const s=n.events[n.events.length-1];return!ce(i)&&s&&s[1].type==="listItemPrefixWhitespace"?t(i):r(i)}}const l0={name:"setextUnderline",resolveTo:mM,tokenize:fM};function mM(e,t){let r=e.length,n,a,i;for(;r--;)if(e[r][0]==="enter"){if(e[r][1].type==="content"){n=r;break}e[r][1].type==="paragraph"&&(a=r)}else e[r][1].type==="content"&&e.splice(r,1),!i&&e[r][1].type==="definition"&&(i=r);const s={type:"setextHeading",start:{...e[n][1].start},end:{...e[e.length-1][1].end}};return e[a][1].type="setextHeadingText",i?(e.splice(a,0,["enter",s,t]),e.splice(i+1,0,["exit",e[n][1],t]),e[n][1].end={...e[i][1].end}):e[n][1]=s,e.push(["exit",s,t]),e}function fM(e,t,r){const n=this;let a;return i;function i(c){let d=n.events.length,p;for(;d--;)if(n.events[d][1].type!=="lineEnding"&&n.events[d][1].type!=="linePrefix"&&n.events[d][1].type!=="content"){p=n.events[d][1].type==="paragraph";break}return!n.parser.lazy[n.now().line]&&(n.interrupt||p)?(e.enter("setextHeadingLine"),a=c,s(c)):r(c)}function s(c){return e.enter("setextHeadingLineSequence"),l(c)}function l(c){return c===a?(e.consume(c),l):(e.exit("setextHeadingLineSequence"),ce(c)?he(e,u,"lineSuffix")(c):u(c))}function u(c){return c===null||ee(c)?(e.exit("setextHeadingLine"),t(c)):r(c)}}const hM={tokenize:bM};function bM(e){const t=this,r=e.attempt(zs,n,e.attempt(this.parser.constructs.flowInitial,a,he(e,e.attempt(this.parser.constructs.flow,a,e.attempt(S5,a)),"linePrefix")));return r;function n(i){if(i===null){e.consume(i);return}return e.enter("lineEndingBlank"),e.consume(i),e.exit("lineEndingBlank"),t.currentConstruct=void 0,r}function a(i){if(i===null){e.consume(i);return}return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),t.currentConstruct=void 0,r}}const yM={resolveAll:LA()},xM=OA("string"),vM=OA("text");function OA(e){return{resolveAll:LA(e==="text"?EM:void 0),tokenize:t};function t(r){const n=this,a=this.parser.constructs[e],i=r.attempt(a,s,l);return s;function s(d){return c(d)?i(d):l(d)}function l(d){if(d===null){r.consume(d);return}return r.enter("data"),r.consume(d),u}function u(d){return c(d)?(r.exit("data"),i(d)):(r.consume(d),u)}function c(d){if(d===null)return!0;const p=a[d];let m=-1;if(p)for(;++m<p.length;){const g=p[m];if(!g.previous||g.previous.call(n,n.previous))return!0}return!1}}}function LA(e){return t;function t(r,n){let a=-1,i;for(;++a<=r.length;)i===void 0?r[a]&&r[a][1].type==="data"&&(i=a,a++):(!r[a]||r[a][1].type!=="data")&&(a!==i+2&&(r[i][1].end=r[a-1][1].end,r.splice(i+2,a-i-2),a=i+2),i=void 0);return e?e(r,n):r}}function EM(e,t){let r=0;for(;++r<=e.length;)if((r===e.length||e[r][1].type==="lineEnding")&&e[r-1][1].type==="data"){const n=e[r-1][1],a=t.sliceStream(n);let i=a.length,s=-1,l=0,u;for(;i--;){const c=a[i];if(typeof c=="string"){for(s=c.length;c.charCodeAt(s-1)===32;)l++,s--;if(s)break;s=-1}else if(c===-2)u=!0,l++;else if(c!==-1){i++;break}}if(t._contentTypeTextTrailing&&r===e.length&&(l=0),l){const c={type:r===e.length||u||l<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:i?s:n.start._bufferIndex+s,_index:n.start._index+i,line:n.end.line,column:n.end.column-l,offset:n.end.offset-l},end:{...n.end}};n.end={...c.start},n.start.offset===n.end.offset?Object.assign(n,c):(e.splice(r,0,["enter",c,t],["exit",c,t]),r+=2)}r++}return e}const SM={42:lt,43:lt,45:lt,48:lt,49:lt,50:lt,51:lt,52:lt,53:lt,54:lt,55:lt,56:lt,57:lt,62:NA},kM={91:T5},wM={[-2]:Il,[-1]:Il,32:Il},NM={35:L5,42:Lo,45:[l0,Lo],60:F5,61:l0,95:Lo,96:o0,126:o0},AM={38:TA,92:AA},TM={[-5]:_l,[-4]:_l,[-3]:_l,33:tM,38:TA,42:lf,60:[n5,q5],91:nM,92:[_5,AA],93:jh,95:lf,96:h5},CM={null:[lf,yM]},RM={null:[42,95]},IM={null:[]},_M=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:RM,contentInitial:kM,disable:IM,document:SM,flow:NM,flowInitial:wM,insideSpan:CM,string:AM,text:TM},Symbol.toStringTag,{value:"Module"}));function OM(e,t,r){let n={_bufferIndex:-1,_index:0,line:r&&r.line||1,column:r&&r.column||1,offset:r&&r.offset||0};const a={},i=[];let s=[],l=[];const u={attempt:T(w),check:T(S),consume:y,enter:b,exit:E,interrupt:T(S,{interrupt:!0})},c={code:null,containerState:{},defineSkip:v,events:[],now:x,parser:e,previous:null,sliceSerialize:m,sliceStream:g,write:p};let d=t.tokenize.call(c,u);return t.resolveAll&&i.push(t),c;function p(F){return s=Ot(s,F),N(),s[s.length-1]!==null?[]:(R(t,0),c.events=Mh(i,c.events,c),c.events)}function m(F,L){return DM(g(F),L)}function g(F){return LM(s,F)}function x(){const{_bufferIndex:F,_index:L,line:O,column:P,offset:B}=n;return{_bufferIndex:F,_index:L,line:O,column:P,offset:B}}function v(F){a[F.line]=F.column,M()}function N(){let F;for(;n._index<s.length;){const L=s[n._index];if(typeof L=="string")for(F=n._index,n._bufferIndex<0&&(n._bufferIndex=0);n._index===F&&n._bufferIndex<L.length;)h(L.charCodeAt(n._bufferIndex));else h(L)}}function h(F){d=d(F)}function y(F){ee(F)?(n.line++,n.column=1,n.offset+=F===-3?2:1,M()):F!==-1&&(n.column++,n.offset++),n._bufferIndex<0?n._index++:(n._bufferIndex++,n._bufferIndex===s[n._index].length&&(n._bufferIndex=-1,n._index++)),c.previous=F}function b(F,L){const O=L||{};return O.type=F,O.start=x(),c.events.push(["enter",O,c]),l.push(O),O}function E(F){const L=l.pop();return L.end=x(),c.events.push(["exit",L,c]),L}function w(F,L){R(F,L.from)}function S(F,L){L.restore()}function T(F,L){return O;function O(P,B,z){let W,j,D,k;return Array.isArray(P)?I(P):"tokenize"in P?I([P]):$(P);function $(Q){return de;function de(ge){const Ee=ge!==null&&Q[ge],_e=ge!==null&&Q.null,Be=[...Array.isArray(Ee)?Ee:Ee?[Ee]:[],...Array.isArray(_e)?_e:_e?[_e]:[]];return I(Be)(ge)}}function I(Q){return W=Q,j=0,Q.length===0?z:A(Q[j])}function A(Q){return de;function de(ge){return k=_(),D=Q,Q.partial||(c.currentConstruct=Q),Q.name&&c.parser.constructs.disable.null.includes(Q.name)?ne():Q.tokenize.call(L?Object.assign(Object.create(c),L):c,u,H,ne)(ge)}}function H(Q){return F(D,k),B}function ne(Q){return k.restore(),++j<W.length?A(W[j]):z}}}function R(F,L){F.resolveAll&&!i.includes(F)&&i.push(F),F.resolve&&nr(c.events,L,c.events.length-L,F.resolve(c.events.slice(L),c)),F.resolveTo&&(c.events=F.resolveTo(c.events,c))}function _(){const F=x(),L=c.previous,O=c.currentConstruct,P=c.events.length,B=Array.from(l);return{from:P,restore:z};function z(){n=F,c.previous=L,c.currentConstruct=O,c.events.length=P,l=B,M()}}function M(){n.line in a&&n.column<2&&(n.column=a[n.line],n.offset+=a[n.line]-1)}}function LM(e,t){const r=t.start._index,n=t.start._bufferIndex,a=t.end._index,i=t.end._bufferIndex;let s;if(r===a)s=[e[r].slice(n,i)];else{if(s=e.slice(r,a),n>-1){const l=s[0];typeof l=="string"?s[0]=l.slice(n):s.shift()}i>0&&s.push(e[a].slice(0,i))}return s}function DM(e,t){let r=-1;const n=[];let a;for(;++r<e.length;){const i=e[r];let s;if(typeof i=="string")s=i;else switch(i){case-5:{s="\r";break}case-4:{s=`
|
|
306
|
+
`,Wy="/",Yy="*",sn="",QL="comment",JL="declaration";function eD(e,t){if(typeof e!="string")throw new TypeError("First argument must be a string");if(!e)return[];t=t||{};var r=1,n=1;function a(x){var v=x.match(qL);v&&(r+=v.length);var N=x.lastIndexOf(XL);n=~N?x.length-N:n+x.length}function i(){var x={line:r,column:n};return function(v){return v.position=new s(x),c(),v}}function s(x){this.start=x,this.end={line:r,column:n},this.source=t.source}s.prototype.content=e;function l(x){var v=new Error(t.source+":"+r+":"+n+": "+x);if(v.reason=x,v.filename=t.source,v.line=r,v.column=n,v.source=e,!t.silent)throw v}function u(x){var v=x.exec(e);if(v){var N=v[0];return a(N),e=e.slice(N.length),v}}function c(){u(HL)}function d(x){var v;for(x=x||[];v=p();)v!==!1&&x.push(v);return x}function p(){var x=i();if(!(Wy!=e.charAt(0)||Yy!=e.charAt(1))){for(var v=2;sn!=e.charAt(v)&&(Yy!=e.charAt(v)||Wy!=e.charAt(v+1));)++v;if(v+=2,sn===e.charAt(v-1))return l("End of comment missing");var N=e.slice(2,v-2);return n+=2,a(N),e=e.slice(v),n+=2,x({type:QL,comment:N})}}function m(){var x=i(),v=u(VL);if(v){if(p(),!u(WL))return l("property missing ':'");var N=u(YL),h=x({type:JL,property:Ky(v[0].replace(Vy,sn)),value:N?Ky(N[0].replace(Vy,sn)):sn});return u(KL),h}}function g(){var x=[];d(x);for(var v;v=m();)v!==!1&&(x.push(v),d(x));return x}return c(),g()}function Ky(e){return e?e.replace(ZL,sn):sn}var tD=eD,rD=qr&&qr.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Rh,"__esModule",{value:!0});Rh.default=aD;const nD=rD(tD);function aD(e,t){let r=null;if(!e||typeof e!="string")return r;const n=(0,nD.default)(e),a=typeof t=="function";return n.forEach(i=>{if(i.type!=="declaration")return;const{property:s,value:l}=i;a?t(s,l,i):l&&(r=r||{},r[s]=l)}),r}var $s={};Object.defineProperty($s,"__esModule",{value:!0});$s.camelCase=void 0;var iD=/^--[a-zA-Z0-9_-]+$/,oD=/-([a-z])/g,sD=/^[^-]+$/,lD=/^-(webkit|moz|ms|o|khtml)-/,uD=/^-(ms)-/,cD=function(e){return!e||sD.test(e)||iD.test(e)},dD=function(e,t){return t.toUpperCase()},Zy=function(e,t){return"".concat(t,"-")},pD=function(e,t){return t===void 0&&(t={}),cD(e)?e:(e=e.toLowerCase(),t.reactCompat?e=e.replace(uD,Zy):e=e.replace(lD,Zy),e.replace(oD,dD))};$s.camelCase=pD;var gD=qr&&qr.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},mD=gD(Rh),fD=$s;function nf(e,t){var r={};return!e||typeof e!="string"||(0,mD.default)(e,function(n,a){n&&a&&(r[(0,fD.camelCase)(n,t)]=a)}),r}nf.default=nf;var hD=nf;const bD=Ai(hD),bA=yA("end"),Ih=yA("start");function yA(e){return t;function t(r){const n=r&&r.position&&r.position[e]||{};if(typeof n.line=="number"&&n.line>0&&typeof n.column=="number"&&n.column>0)return{line:n.line,column:n.column,offset:typeof n.offset=="number"&&n.offset>-1?n.offset:void 0}}}function yD(e){const t=Ih(e),r=bA(e);if(t&&r)return{start:t,end:r}}function ei(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?Xy(e.position):"start"in e||"end"in e?Xy(e):"line"in e||"column"in e?af(e):""}function af(e){return Qy(e&&e.line)+":"+Qy(e&&e.column)}function Xy(e){return af(e&&e.start)+"-"+af(e&&e.end)}function Qy(e){return e&&typeof e=="number"?e:1}class Qe extends Error{constructor(t,r,n){super(),typeof r=="string"&&(n=r,r=void 0);let a="",i={},s=!1;if(r&&("line"in r&&"column"in r?i={place:r}:"start"in r&&"end"in r?i={place:r}:"type"in r?i={ancestors:[r],place:r.position}:i={...r}),typeof t=="string"?a=t:!i.cause&&t&&(s=!0,a=t.message,i.cause=t),!i.ruleId&&!i.source&&typeof n=="string"){const u=n.indexOf(":");u===-1?i.ruleId=n:(i.source=n.slice(0,u),i.ruleId=n.slice(u+1))}if(!i.place&&i.ancestors&&i.ancestors){const u=i.ancestors[i.ancestors.length-1];u&&(i.place=u.position)}const l=i.place&&"start"in i.place?i.place.start:i.place;this.ancestors=i.ancestors||void 0,this.cause=i.cause||void 0,this.column=l?l.column:void 0,this.fatal=void 0,this.file="",this.message=a,this.line=l?l.line:void 0,this.name=ei(i.place)||"1:1",this.place=i.place||void 0,this.reason=this.message,this.ruleId=i.ruleId||void 0,this.source=i.source||void 0,this.stack=s&&i.cause&&typeof i.cause.stack=="string"?i.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}Qe.prototype.file="";Qe.prototype.name="";Qe.prototype.reason="";Qe.prototype.message="";Qe.prototype.stack="";Qe.prototype.column=void 0;Qe.prototype.line=void 0;Qe.prototype.ancestors=void 0;Qe.prototype.cause=void 0;Qe.prototype.fatal=void 0;Qe.prototype.place=void 0;Qe.prototype.ruleId=void 0;Qe.prototype.source=void 0;const _h={}.hasOwnProperty,xD=new Map,vD=/[A-Z]/g,ED=new Set(["table","tbody","thead","tfoot","tr"]),SD=new Set(["td","th"]),xA="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function kD(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const r=t.filePath||void 0;let n;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");n=_D(r,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");n=ID(r,t.jsx,t.jsxs)}const a={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:n,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:r,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?Ch:zL,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},i=vA(a,e,void 0);return i&&typeof i!="string"?i:a.create(e,a.Fragment,{children:i||void 0},void 0)}function vA(e,t,r){if(t.type==="element")return wD(e,t,r);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return ND(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return TD(e,t,r);if(t.type==="mdxjsEsm")return AD(e,t);if(t.type==="root")return CD(e,t,r);if(t.type==="text")return RD(e,t)}function wD(e,t,r){const n=e.schema;let a=n;t.tagName.toLowerCase()==="svg"&&n.space==="html"&&(a=Ch,e.schema=a),e.ancestors.push(t);const i=SA(e,t.tagName,!1),s=OD(e,t);let l=Lh(e,t);return ED.has(t.tagName)&&(l=l.filter(function(u){return typeof u=="string"?!OL(u):!0})),EA(e,s,i,t),Oh(s,l),e.ancestors.pop(),e.schema=n,e.create(t,i,s,r)}function ND(e,t){if(t.data&&t.data.estree&&e.evaluater){const n=t.data.estree.body[0];return n.type,e.evaluater.evaluateExpression(n.expression)}wi(e,t.position)}function AD(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);wi(e,t.position)}function TD(e,t,r){const n=e.schema;let a=n;t.name==="svg"&&n.space==="html"&&(a=Ch,e.schema=a),e.ancestors.push(t);const i=t.name===null?e.Fragment:SA(e,t.name,!0),s=LD(e,t),l=Lh(e,t);return EA(e,s,i,t),Oh(s,l),e.ancestors.pop(),e.schema=n,e.create(t,i,s,r)}function CD(e,t,r){const n={};return Oh(n,Lh(e,t)),e.create(t,e.Fragment,n,r)}function RD(e,t){return t.value}function EA(e,t,r,n){typeof r!="string"&&r!==e.Fragment&&e.passNode&&(t.node=n)}function Oh(e,t){if(t.length>0){const r=t.length>1?t:t[0];r&&(e.children=r)}}function ID(e,t,r){return n;function n(a,i,s,l){const c=Array.isArray(s.children)?r:t;return l?c(i,s,l):c(i,s)}}function _D(e,t){return r;function r(n,a,i,s){const l=Array.isArray(i.children),u=Ih(n);return t(a,i,s,l,{columnNumber:u?u.column-1:void 0,fileName:e,lineNumber:u?u.line:void 0},void 0)}}function OD(e,t){const r={};let n,a;for(a in t.properties)if(a!=="children"&&_h.call(t.properties,a)){const i=DD(e,a,t.properties[a]);if(i){const[s,l]=i;e.tableCellAlignToStyle&&s==="align"&&typeof l=="string"&&SD.has(t.tagName)?n=l:r[s]=l}}if(n){const i=r.style||(r.style={});i[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=n}return r}function LD(e,t){const r={};for(const n of t.attributes)if(n.type==="mdxJsxExpressionAttribute")if(n.data&&n.data.estree&&e.evaluater){const i=n.data.estree.body[0];i.type;const s=i.expression;s.type;const l=s.properties[0];l.type,Object.assign(r,e.evaluater.evaluateExpression(l.argument))}else wi(e,t.position);else{const a=n.name;let i;if(n.value&&typeof n.value=="object")if(n.value.data&&n.value.data.estree&&e.evaluater){const l=n.value.data.estree.body[0];l.type,i=e.evaluater.evaluateExpression(l.expression)}else wi(e,t.position);else i=n.value===null?!0:n.value;r[a]=i}return r}function Lh(e,t){const r=[];let n=-1;const a=e.passKeys?new Map:xD;for(;++n<t.children.length;){const i=t.children[n];let s;if(e.passKeys){const u=i.type==="element"?i.tagName:i.type==="mdxJsxFlowElement"||i.type==="mdxJsxTextElement"?i.name:void 0;if(u){const c=a.get(u)||0;s=u+"-"+c,a.set(u,c+1)}}const l=vA(e,i,s);l!==void 0&&r.push(l)}return r}function DD(e,t,r){const n=UL(e.schema,t);if(!(r==null||typeof r=="number"&&Number.isNaN(r))){if(Array.isArray(r)&&(r=n.commaSeparated?TL(r):GL(r)),n.property==="style"){let a=typeof r=="object"?r:MD(e,String(r));return e.stylePropertyNameCase==="css"&&(a=jD(a)),["style",a]}return[e.elementAttributeNameCase==="react"&&n.space?jL[n.property]||n.property:n.attribute,r]}}function MD(e,t){try{return bD(t,{reactCompat:!0})}catch(r){if(e.ignoreInvalidStyle)return{};const n=r,a=new Qe("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:n,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw a.file=e.filePath||void 0,a.url=xA+"#cannot-parse-style-attribute",a}}function SA(e,t,r){let n;if(!r)n={type:"Literal",value:t};else if(t.includes(".")){const a=t.split(".");let i=-1,s;for(;++i<a.length;){const l=zy(a[i])?{type:"Identifier",name:a[i]}:{type:"Literal",value:a[i]};s=s?{type:"MemberExpression",object:s,property:l,computed:!!(i&&l.type==="Literal"),optional:!1}:l}n=s}else n=zy(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(n.type==="Literal"){const a=n.value;return _h.call(e.components,a)?e.components[a]:a}if(e.evaluater)return e.evaluater.evaluateExpression(n);wi(e)}function wi(e,t){const r=new Qe("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw r.file=e.filePath||void 0,r.url=xA+"#cannot-handle-mdx-estrees-without-createevaluater",r}function jD(e){const t={};let r;for(r in e)_h.call(e,r)&&(t[FD(r)]=e[r]);return t}function FD(e){let t=e.replace(vD,PD);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function PD(e){return"-"+e.toLowerCase()}const Rl={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]},UD={};function BD(e,t){const r=UD,n=typeof r.includeImageAlt=="boolean"?r.includeImageAlt:!0,a=typeof r.includeHtml=="boolean"?r.includeHtml:!0;return kA(e,n,a)}function kA(e,t,r){if($D(e)){if("value"in e)return e.type==="html"&&!r?"":e.value;if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return Jy(e.children,t,r)}return Array.isArray(e)?Jy(e,t,r):""}function Jy(e,t,r){const n=[];let a=-1;for(;++a<e.length;)n[a]=kA(e[a],t,r);return n.join("")}function $D(e){return!!(e&&typeof e=="object")}const e0=document.createElement("i");function Dh(e){const t="&"+e+";";e0.innerHTML=t;const r=e0.textContent;return r.charCodeAt(r.length-1)===59&&e!=="semi"||r===t?!1:r}function nr(e,t,r,n){const a=e.length;let i=0,s;if(t<0?t=-t>a?0:a+t:t=t>a?a:t,r=r>0?r:0,n.length<1e4)s=Array.from(n),s.unshift(t,r),e.splice(...s);else for(r&&e.splice(t,r);i<n.length;)s=n.slice(i,i+1e4),s.unshift(t,0),e.splice(...s),i+=1e4,t+=1e4}function Ot(e,t){return e.length>0?(nr(e,e.length,0,t),e):t}const t0={}.hasOwnProperty;function zD(e){const t={};let r=-1;for(;++r<e.length;)GD(t,e[r]);return t}function GD(e,t){let r;for(r in t){const a=(t0.call(e,r)?e[r]:void 0)||(e[r]={}),i=t[r];let s;if(i)for(s in i){t0.call(a,s)||(a[s]=[]);const l=i[s];qD(a[s],Array.isArray(l)?l:l?[l]:[])}}}function qD(e,t){let r=-1;const n=[];for(;++r<t.length;)(t[r].add==="after"?e:n).push(t[r]);nr(e,0,0,n)}function wA(e,t){const r=Number.parseInt(e,t);return r<9||r===11||r>13&&r<32||r>126&&r<160||r>55295&&r<57344||r>64975&&r<65008||(r&65535)===65535||(r&65535)===65534||r>1114111?"�":String.fromCodePoint(r)}function ia(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const Jt=Jr(/[A-Za-z]/),St=Jr(/[\dA-Za-z]/),HD=Jr(/[#-'*+\--9=?A-Z^-~]/);function of(e){return e!==null&&(e<32||e===127)}const sf=Jr(/\d/),VD=Jr(/[\dA-Fa-f]/),WD=Jr(/[!-/:-@[-`{-~]/);function ee(e){return e!==null&&e<-2}function ft(e){return e!==null&&(e<0||e===32)}function ce(e){return e===-2||e===-1||e===32}const YD=Jr(new RegExp("\\p{P}|\\p{S}","u")),KD=Jr(/\s/);function Jr(e){return t;function t(r){return r!==null&&r>-1&&e.test(String.fromCharCode(r))}}function va(e){const t=[];let r=-1,n=0,a=0;for(;++r<e.length;){const i=e.charCodeAt(r);let s="";if(i===37&&St(e.charCodeAt(r+1))&&St(e.charCodeAt(r+2)))a=2;else if(i<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(i))||(s=String.fromCharCode(i));else if(i>55295&&i<57344){const l=e.charCodeAt(r+1);i<56320&&l>56319&&l<57344?(s=String.fromCharCode(i,l),a=1):s="�"}else s=String.fromCharCode(i);s&&(t.push(e.slice(n,r),encodeURIComponent(s)),n=r+a+1,s=""),a&&(r+=a,a=0)}return t.join("")+e.slice(n)}function he(e,t,r,n){const a=n?n-1:Number.POSITIVE_INFINITY;let i=0;return s;function s(u){return ce(u)?(e.enter(r),l(u)):t(u)}function l(u){return ce(u)&&i++<a?(e.consume(u),l):(e.exit(r),t(u))}}const ZD={tokenize:XD};function XD(e){const t=e.attempt(this.parser.constructs.contentInitial,n,a);let r;return t;function n(l){if(l===null){e.consume(l);return}return e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),he(e,t,"linePrefix")}function a(l){return e.enter("paragraph"),i(l)}function i(l){const u=e.enter("chunkText",{contentType:"text",previous:r});return r&&(r.next=u),r=u,s(l)}function s(l){if(l===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(l);return}return ee(l)?(e.consume(l),e.exit("chunkText"),i):(e.consume(l),s)}}const QD={tokenize:JD},r0={tokenize:eM};function JD(e){const t=this,r=[];let n=0,a,i,s;return l;function l(b){if(n<r.length){const E=r[n];return t.containerState=E[1],e.attempt(E[0].continuation,u,c)(b)}return c(b)}function u(b){if(n++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,a&&y();const E=t.events.length;let w=E,S;for(;w--;)if(t.events[w][0]==="exit"&&t.events[w][1].type==="chunkFlow"){S=t.events[w][1].end;break}h(n);let T=E;for(;T<t.events.length;)t.events[T][1].end={...S},T++;return nr(t.events,w+1,0,t.events.slice(E)),t.events.length=T,c(b)}return l(b)}function c(b){if(n===r.length){if(!a)return m(b);if(a.currentConstruct&&a.currentConstruct.concrete)return x(b);t.interrupt=!!(a.currentConstruct&&!a._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(r0,d,p)(b)}function d(b){return a&&y(),h(n),m(b)}function p(b){return t.parser.lazy[t.now().line]=n!==r.length,s=t.now().offset,x(b)}function m(b){return t.containerState={},e.attempt(r0,g,x)(b)}function g(b){return n++,r.push([t.currentConstruct,t.containerState]),m(b)}function x(b){if(b===null){a&&y(),h(0),e.consume(b);return}return a=a||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:a,contentType:"flow",previous:i}),v(b)}function v(b){if(b===null){N(e.exit("chunkFlow"),!0),h(0),e.consume(b);return}return ee(b)?(e.consume(b),N(e.exit("chunkFlow")),n=0,t.interrupt=void 0,l):(e.consume(b),v)}function N(b,E){const w=t.sliceStream(b);if(E&&w.push(null),b.previous=i,i&&(i.next=b),i=b,a.defineSkip(b.start),a.write(w),t.parser.lazy[b.start.line]){let S=a.events.length;for(;S--;)if(a.events[S][1].start.offset<s&&(!a.events[S][1].end||a.events[S][1].end.offset>s))return;const T=t.events.length;let R=T,_,M;for(;R--;)if(t.events[R][0]==="exit"&&t.events[R][1].type==="chunkFlow"){if(_){M=t.events[R][1].end;break}_=!0}for(h(n),S=T;S<t.events.length;)t.events[S][1].end={...M},S++;nr(t.events,R+1,0,t.events.slice(T)),t.events.length=S}}function h(b){let E=r.length;for(;E-- >b;){const w=r[E];t.containerState=w[1],w[0].exit.call(t,e)}r.length=b}function y(){a.write([null]),i=void 0,a=void 0,t.containerState._closeFlow=void 0}}function eM(e,t,r){return he(e,e.attempt(this.parser.constructs.document,t,r),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function n0(e){if(e===null||ft(e)||KD(e))return 1;if(YD(e))return 2}function Mh(e,t,r){const n=[];let a=-1;for(;++a<e.length;){const i=e[a].resolveAll;i&&!n.includes(i)&&(t=i(t,r),n.push(i))}return t}const lf={name:"attention",resolveAll:tM,tokenize:rM};function tM(e,t){let r=-1,n,a,i,s,l,u,c,d;for(;++r<e.length;)if(e[r][0]==="enter"&&e[r][1].type==="attentionSequence"&&e[r][1]._close){for(n=r;n--;)if(e[n][0]==="exit"&&e[n][1].type==="attentionSequence"&&e[n][1]._open&&t.sliceSerialize(e[n][1]).charCodeAt(0)===t.sliceSerialize(e[r][1]).charCodeAt(0)){if((e[n][1]._close||e[r][1]._open)&&(e[r][1].end.offset-e[r][1].start.offset)%3&&!((e[n][1].end.offset-e[n][1].start.offset+e[r][1].end.offset-e[r][1].start.offset)%3))continue;u=e[n][1].end.offset-e[n][1].start.offset>1&&e[r][1].end.offset-e[r][1].start.offset>1?2:1;const p={...e[n][1].end},m={...e[r][1].start};a0(p,-u),a0(m,u),s={type:u>1?"strongSequence":"emphasisSequence",start:p,end:{...e[n][1].end}},l={type:u>1?"strongSequence":"emphasisSequence",start:{...e[r][1].start},end:m},i={type:u>1?"strongText":"emphasisText",start:{...e[n][1].end},end:{...e[r][1].start}},a={type:u>1?"strong":"emphasis",start:{...s.start},end:{...l.end}},e[n][1].end={...s.start},e[r][1].start={...l.end},c=[],e[n][1].end.offset-e[n][1].start.offset&&(c=Ot(c,[["enter",e[n][1],t],["exit",e[n][1],t]])),c=Ot(c,[["enter",a,t],["enter",s,t],["exit",s,t],["enter",i,t]]),c=Ot(c,Mh(t.parser.constructs.insideSpan.null,e.slice(n+1,r),t)),c=Ot(c,[["exit",i,t],["enter",l,t],["exit",l,t],["exit",a,t]]),e[r][1].end.offset-e[r][1].start.offset?(d=2,c=Ot(c,[["enter",e[r][1],t],["exit",e[r][1],t]])):d=0,nr(e,n-1,r-n+3,c),r=n+c.length-d-2;break}}for(r=-1;++r<e.length;)e[r][1].type==="attentionSequence"&&(e[r][1].type="data");return e}function rM(e,t){const r=this.parser.constructs.attentionMarkers.null,n=this.previous,a=n0(n);let i;return s;function s(u){return i=u,e.enter("attentionSequence"),l(u)}function l(u){if(u===i)return e.consume(u),l;const c=e.exit("attentionSequence"),d=n0(u),p=!d||d===2&&a||r.includes(u),m=!a||a===2&&d||r.includes(n);return c._open=!!(i===42?p:p&&(a||!m)),c._close=!!(i===42?m:m&&(d||!p)),t(u)}}function a0(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const nM={name:"autolink",tokenize:aM};function aM(e,t,r){let n=0;return a;function a(g){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(g),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),i}function i(g){return Jt(g)?(e.consume(g),s):g===64?r(g):c(g)}function s(g){return g===43||g===45||g===46||St(g)?(n=1,l(g)):c(g)}function l(g){return g===58?(e.consume(g),n=0,u):(g===43||g===45||g===46||St(g))&&n++<32?(e.consume(g),l):(n=0,c(g))}function u(g){return g===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(g),e.exit("autolinkMarker"),e.exit("autolink"),t):g===null||g===32||g===60||of(g)?r(g):(e.consume(g),u)}function c(g){return g===64?(e.consume(g),d):HD(g)?(e.consume(g),c):r(g)}function d(g){return St(g)?p(g):r(g)}function p(g){return g===46?(e.consume(g),n=0,d):g===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(g),e.exit("autolinkMarker"),e.exit("autolink"),t):m(g)}function m(g){if((g===45||St(g))&&n++<63){const x=g===45?m:p;return e.consume(g),x}return r(g)}}const zs={partial:!0,tokenize:iM};function iM(e,t,r){return n;function n(i){return ce(i)?he(e,a,"linePrefix")(i):a(i)}function a(i){return i===null||ee(i)?t(i):r(i)}}const NA={continuation:{tokenize:sM},exit:lM,name:"blockQuote",tokenize:oM};function oM(e,t,r){const n=this;return a;function a(s){if(s===62){const l=n.containerState;return l.open||(e.enter("blockQuote",{_container:!0}),l.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(s),e.exit("blockQuoteMarker"),i}return r(s)}function i(s){return ce(s)?(e.enter("blockQuotePrefixWhitespace"),e.consume(s),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(s))}}function sM(e,t,r){const n=this;return a;function a(s){return ce(s)?he(e,i,"linePrefix",n.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(s):i(s)}function i(s){return e.attempt(NA,t,r)(s)}}function lM(e){e.exit("blockQuote")}const AA={name:"characterEscape",tokenize:uM};function uM(e,t,r){return n;function n(i){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(i),e.exit("escapeMarker"),a}function a(i){return WD(i)?(e.enter("characterEscapeValue"),e.consume(i),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):r(i)}}const TA={name:"characterReference",tokenize:cM};function cM(e,t,r){const n=this;let a=0,i,s;return l;function l(p){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(p),e.exit("characterReferenceMarker"),u}function u(p){return p===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(p),e.exit("characterReferenceMarkerNumeric"),c):(e.enter("characterReferenceValue"),i=31,s=St,d(p))}function c(p){return p===88||p===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(p),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),i=6,s=VD,d):(e.enter("characterReferenceValue"),i=7,s=sf,d(p))}function d(p){if(p===59&&a){const m=e.exit("characterReferenceValue");return s===St&&!Dh(n.sliceSerialize(m))?r(p):(e.enter("characterReferenceMarker"),e.consume(p),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return s(p)&&a++<i?(e.consume(p),d):r(p)}}const i0={partial:!0,tokenize:pM},o0={concrete:!0,name:"codeFenced",tokenize:dM};function dM(e,t,r){const n=this,a={partial:!0,tokenize:w};let i=0,s=0,l;return u;function u(S){return c(S)}function c(S){const T=n.events[n.events.length-1];return i=T&&T[1].type==="linePrefix"?T[2].sliceSerialize(T[1],!0).length:0,l=S,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),d(S)}function d(S){return S===l?(s++,e.consume(S),d):s<3?r(S):(e.exit("codeFencedFenceSequence"),ce(S)?he(e,p,"whitespace")(S):p(S))}function p(S){return S===null||ee(S)?(e.exit("codeFencedFence"),n.interrupt?t(S):e.check(i0,v,E)(S)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),m(S))}function m(S){return S===null||ee(S)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),p(S)):ce(S)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),he(e,g,"whitespace")(S)):S===96&&S===l?r(S):(e.consume(S),m)}function g(S){return S===null||ee(S)?p(S):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),x(S))}function x(S){return S===null||ee(S)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),p(S)):S===96&&S===l?r(S):(e.consume(S),x)}function v(S){return e.attempt(a,E,N)(S)}function N(S){return e.enter("lineEnding"),e.consume(S),e.exit("lineEnding"),h}function h(S){return i>0&&ce(S)?he(e,y,"linePrefix",i+1)(S):y(S)}function y(S){return S===null||ee(S)?e.check(i0,v,E)(S):(e.enter("codeFlowValue"),b(S))}function b(S){return S===null||ee(S)?(e.exit("codeFlowValue"),y(S)):(e.consume(S),b)}function E(S){return e.exit("codeFenced"),t(S)}function w(S,T,R){let _=0;return M;function M(B){return S.enter("lineEnding"),S.consume(B),S.exit("lineEnding"),F}function F(B){return S.enter("codeFencedFence"),ce(B)?he(S,L,"linePrefix",n.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(B):L(B)}function L(B){return B===l?(S.enter("codeFencedFenceSequence"),O(B)):R(B)}function O(B){return B===l?(_++,S.consume(B),O):_>=s?(S.exit("codeFencedFenceSequence"),ce(B)?he(S,P,"whitespace")(B):P(B)):R(B)}function P(B){return B===null||ee(B)?(S.exit("codeFencedFence"),T(B)):R(B)}}}function pM(e,t,r){const n=this;return a;function a(s){return s===null?r(s):(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),i)}function i(s){return n.parser.lazy[n.now().line]?r(s):t(s)}}const Il={name:"codeIndented",tokenize:mM},gM={partial:!0,tokenize:fM};function mM(e,t,r){const n=this;return a;function a(c){return e.enter("codeIndented"),he(e,i,"linePrefix",5)(c)}function i(c){const d=n.events[n.events.length-1];return d&&d[1].type==="linePrefix"&&d[2].sliceSerialize(d[1],!0).length>=4?s(c):r(c)}function s(c){return c===null?u(c):ee(c)?e.attempt(gM,s,u)(c):(e.enter("codeFlowValue"),l(c))}function l(c){return c===null||ee(c)?(e.exit("codeFlowValue"),s(c)):(e.consume(c),l)}function u(c){return e.exit("codeIndented"),t(c)}}function fM(e,t,r){const n=this;return a;function a(s){return n.parser.lazy[n.now().line]?r(s):ee(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),a):he(e,i,"linePrefix",5)(s)}function i(s){const l=n.events[n.events.length-1];return l&&l[1].type==="linePrefix"&&l[2].sliceSerialize(l[1],!0).length>=4?t(s):ee(s)?a(s):r(s)}}const hM={name:"codeText",previous:yM,resolve:bM,tokenize:xM};function bM(e){let t=e.length-4,r=3,n,a;if((e[r][1].type==="lineEnding"||e[r][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(n=r;++n<t;)if(e[n][1].type==="codeTextData"){e[r][1].type="codeTextPadding",e[t][1].type="codeTextPadding",r+=2,t-=2;break}}for(n=r-1,t++;++n<=t;)a===void 0?n!==t&&e[n][1].type!=="lineEnding"&&(a=n):(n===t||e[n][1].type==="lineEnding")&&(e[a][1].type="codeTextData",n!==a+2&&(e[a][1].end=e[n-1][1].end,e.splice(a+2,n-a-2),t-=n-a-2,n=a+2),a=void 0);return e}function yM(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function xM(e,t,r){let n=0,a,i;return s;function s(p){return e.enter("codeText"),e.enter("codeTextSequence"),l(p)}function l(p){return p===96?(e.consume(p),n++,l):(e.exit("codeTextSequence"),u(p))}function u(p){return p===null?r(p):p===32?(e.enter("space"),e.consume(p),e.exit("space"),u):p===96?(i=e.enter("codeTextSequence"),a=0,d(p)):ee(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),u):(e.enter("codeTextData"),c(p))}function c(p){return p===null||p===32||p===96||ee(p)?(e.exit("codeTextData"),u(p)):(e.consume(p),c)}function d(p){return p===96?(e.consume(p),a++,d):a===n?(e.exit("codeTextSequence"),e.exit("codeText"),t(p)):(i.type="codeTextData",c(p))}}class vM{constructor(t){this.left=t?[...t]:[],this.right=[]}get(t){if(t<0||t>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return t<this.left.length?this.left[t]:this.right[this.right.length-t+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(t,r){const n=r??Number.POSITIVE_INFINITY;return n<this.left.length?this.left.slice(t,n):t>this.left.length?this.right.slice(this.right.length-n+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-n+this.left.length).reverse())}splice(t,r,n){const a=r||0;this.setCursor(Math.trunc(t));const i=this.right.splice(this.right.length-a,Number.POSITIVE_INFINITY);return n&&La(this.left,n),i.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),La(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),La(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t<this.left.length){const r=this.left.splice(t,Number.POSITIVE_INFINITY);La(this.right,r.reverse())}else{const r=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);La(this.left,r.reverse())}}}function La(e,t){let r=0;if(t.length<1e4)e.push(...t);else for(;r<t.length;)e.push(...t.slice(r,r+1e4)),r+=1e4}function CA(e){const t={};let r=-1,n,a,i,s,l,u,c;const d=new vM(e);for(;++r<d.length;){for(;r in t;)r=t[r];if(n=d.get(r),r&&n[1].type==="chunkFlow"&&d.get(r-1)[1].type==="listItemPrefix"&&(u=n[1]._tokenizer.events,i=0,i<u.length&&u[i][1].type==="lineEndingBlank"&&(i+=2),i<u.length&&u[i][1].type==="content"))for(;++i<u.length&&u[i][1].type!=="content";)u[i][1].type==="chunkText"&&(u[i][1]._isInFirstContentOfListItem=!0,i++);if(n[0]==="enter")n[1].contentType&&(Object.assign(t,EM(d,r)),r=t[r],c=!0);else if(n[1]._container){for(i=r,a=void 0;i--;)if(s=d.get(i),s[1].type==="lineEnding"||s[1].type==="lineEndingBlank")s[0]==="enter"&&(a&&(d.get(a)[1].type="lineEndingBlank"),s[1].type="lineEnding",a=i);else if(!(s[1].type==="linePrefix"||s[1].type==="listItemIndent"))break;a&&(n[1].end={...d.get(a)[1].start},l=d.slice(a,r),l.unshift(n),d.splice(a,r-a+1,l))}}return nr(e,0,Number.POSITIVE_INFINITY,d.slice(0)),!c}function EM(e,t){const r=e.get(t)[1],n=e.get(t)[2];let a=t-1;const i=[];let s=r._tokenizer;s||(s=n.parser[r.contentType](r.start),r._contentTypeTextTrailing&&(s._contentTypeTextTrailing=!0));const l=s.events,u=[],c={};let d,p,m=-1,g=r,x=0,v=0;const N=[v];for(;g;){for(;e.get(++a)[1]!==g;);i.push(a),g._tokenizer||(d=n.sliceStream(g),g.next||d.push(null),p&&s.defineSkip(g.start),g._isInFirstContentOfListItem&&(s._gfmTasklistFirstContentOfListItem=!0),s.write(d),g._isInFirstContentOfListItem&&(s._gfmTasklistFirstContentOfListItem=void 0)),p=g,g=g.next}for(g=r;++m<l.length;)l[m][0]==="exit"&&l[m-1][0]==="enter"&&l[m][1].type===l[m-1][1].type&&l[m][1].start.line!==l[m][1].end.line&&(v=m+1,N.push(v),g._tokenizer=void 0,g.previous=void 0,g=g.next);for(s.events=[],g?(g._tokenizer=void 0,g.previous=void 0):N.pop(),m=N.length;m--;){const h=l.slice(N[m],N[m+1]),y=i.pop();u.push([y,y+h.length-1]),e.splice(y,2,h)}for(u.reverse(),m=-1;++m<u.length;)c[x+u[m][0]]=x+u[m][1],x+=u[m][1]-u[m][0]-1;return c}const SM={resolve:wM,tokenize:NM},kM={partial:!0,tokenize:AM};function wM(e){return CA(e),e}function NM(e,t){let r;return n;function n(l){return e.enter("content"),r=e.enter("chunkContent",{contentType:"content"}),a(l)}function a(l){return l===null?i(l):ee(l)?e.check(kM,s,i)(l):(e.consume(l),a)}function i(l){return e.exit("chunkContent"),e.exit("content"),t(l)}function s(l){return e.consume(l),e.exit("chunkContent"),r.next=e.enter("chunkContent",{contentType:"content",previous:r}),r=r.next,a}}function AM(e,t,r){const n=this;return a;function a(s){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),he(e,i,"linePrefix")}function i(s){if(s===null||ee(s))return r(s);const l=n.events[n.events.length-1];return!n.parser.constructs.disable.null.includes("codeIndented")&&l&&l[1].type==="linePrefix"&&l[2].sliceSerialize(l[1],!0).length>=4?t(s):e.interrupt(n.parser.constructs.flow,r,t)(s)}}function RA(e,t,r,n,a,i,s,l,u){const c=u||Number.POSITIVE_INFINITY;let d=0;return p;function p(h){return h===60?(e.enter(n),e.enter(a),e.enter(i),e.consume(h),e.exit(i),m):h===null||h===32||h===41||of(h)?r(h):(e.enter(n),e.enter(s),e.enter(l),e.enter("chunkString",{contentType:"string"}),v(h))}function m(h){return h===62?(e.enter(i),e.consume(h),e.exit(i),e.exit(a),e.exit(n),t):(e.enter(l),e.enter("chunkString",{contentType:"string"}),g(h))}function g(h){return h===62?(e.exit("chunkString"),e.exit(l),m(h)):h===null||h===60||ee(h)?r(h):(e.consume(h),h===92?x:g)}function x(h){return h===60||h===62||h===92?(e.consume(h),g):g(h)}function v(h){return!d&&(h===null||h===41||ft(h))?(e.exit("chunkString"),e.exit(l),e.exit(s),e.exit(n),t(h)):d<c&&h===40?(e.consume(h),d++,v):h===41?(e.consume(h),d--,v):h===null||h===32||h===40||of(h)?r(h):(e.consume(h),h===92?N:v)}function N(h){return h===40||h===41||h===92?(e.consume(h),v):v(h)}}function IA(e,t,r,n,a,i){const s=this;let l=0,u;return c;function c(g){return e.enter(n),e.enter(a),e.consume(g),e.exit(a),e.enter(i),d}function d(g){return l>999||g===null||g===91||g===93&&!u||g===94&&!l&&"_hiddenFootnoteSupport"in s.parser.constructs?r(g):g===93?(e.exit(i),e.enter(a),e.consume(g),e.exit(a),e.exit(n),t):ee(g)?(e.enter("lineEnding"),e.consume(g),e.exit("lineEnding"),d):(e.enter("chunkString",{contentType:"string"}),p(g))}function p(g){return g===null||g===91||g===93||ee(g)||l++>999?(e.exit("chunkString"),d(g)):(e.consume(g),u||(u=!ce(g)),g===92?m:p)}function m(g){return g===91||g===92||g===93?(e.consume(g),l++,p):p(g)}}function _A(e,t,r,n,a,i){let s;return l;function l(m){return m===34||m===39||m===40?(e.enter(n),e.enter(a),e.consume(m),e.exit(a),s=m===40?41:m,u):r(m)}function u(m){return m===s?(e.enter(a),e.consume(m),e.exit(a),e.exit(n),t):(e.enter(i),c(m))}function c(m){return m===s?(e.exit(i),u(s)):m===null?r(m):ee(m)?(e.enter("lineEnding"),e.consume(m),e.exit("lineEnding"),he(e,c,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),d(m))}function d(m){return m===s||m===null||ee(m)?(e.exit("chunkString"),c(m)):(e.consume(m),m===92?p:d)}function p(m){return m===s||m===92?(e.consume(m),d):d(m)}}function ti(e,t){let r;return n;function n(a){return ee(a)?(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),r=!0,n):ce(a)?he(e,n,r?"linePrefix":"lineSuffix")(a):t(a)}}const TM={name:"definition",tokenize:RM},CM={partial:!0,tokenize:IM};function RM(e,t,r){const n=this;let a;return i;function i(g){return e.enter("definition"),s(g)}function s(g){return IA.call(n,e,l,r,"definitionLabel","definitionLabelMarker","definitionLabelString")(g)}function l(g){return a=ia(n.sliceSerialize(n.events[n.events.length-1][1]).slice(1,-1)),g===58?(e.enter("definitionMarker"),e.consume(g),e.exit("definitionMarker"),u):r(g)}function u(g){return ft(g)?ti(e,c)(g):c(g)}function c(g){return RA(e,d,r,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(g)}function d(g){return e.attempt(CM,p,p)(g)}function p(g){return ce(g)?he(e,m,"whitespace")(g):m(g)}function m(g){return g===null||ee(g)?(e.exit("definition"),n.parser.defined.push(a),t(g)):r(g)}}function IM(e,t,r){return n;function n(l){return ft(l)?ti(e,a)(l):r(l)}function a(l){return _A(e,i,r,"definitionTitle","definitionTitleMarker","definitionTitleString")(l)}function i(l){return ce(l)?he(e,s,"whitespace")(l):s(l)}function s(l){return l===null||ee(l)?t(l):r(l)}}const _M={name:"hardBreakEscape",tokenize:OM};function OM(e,t,r){return n;function n(i){return e.enter("hardBreakEscape"),e.consume(i),a}function a(i){return ee(i)?(e.exit("hardBreakEscape"),t(i)):r(i)}}const LM={name:"headingAtx",resolve:DM,tokenize:MM};function DM(e,t){let r=e.length-2,n=3,a,i;return e[n][1].type==="whitespace"&&(n+=2),r-2>n&&e[r][1].type==="whitespace"&&(r-=2),e[r][1].type==="atxHeadingSequence"&&(n===r-1||r-4>n&&e[r-2][1].type==="whitespace")&&(r-=n+1===r?2:4),r>n&&(a={type:"atxHeadingText",start:e[n][1].start,end:e[r][1].end},i={type:"chunkText",start:e[n][1].start,end:e[r][1].end,contentType:"text"},nr(e,n,r-n+1,[["enter",a,t],["enter",i,t],["exit",i,t],["exit",a,t]])),e}function MM(e,t,r){let n=0;return a;function a(d){return e.enter("atxHeading"),i(d)}function i(d){return e.enter("atxHeadingSequence"),s(d)}function s(d){return d===35&&n++<6?(e.consume(d),s):d===null||ft(d)?(e.exit("atxHeadingSequence"),l(d)):r(d)}function l(d){return d===35?(e.enter("atxHeadingSequence"),u(d)):d===null||ee(d)?(e.exit("atxHeading"),t(d)):ce(d)?he(e,l,"whitespace")(d):(e.enter("atxHeadingText"),c(d))}function u(d){return d===35?(e.consume(d),u):(e.exit("atxHeadingSequence"),l(d))}function c(d){return d===null||d===35||ft(d)?(e.exit("atxHeadingText"),l(d)):(e.consume(d),c)}}const jM=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],s0=["pre","script","style","textarea"],FM={concrete:!0,name:"htmlFlow",resolveTo:BM,tokenize:$M},PM={partial:!0,tokenize:GM},UM={partial:!0,tokenize:zM};function BM(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function $M(e,t,r){const n=this;let a,i,s,l,u;return c;function c(A){return d(A)}function d(A){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(A),p}function p(A){return A===33?(e.consume(A),m):A===47?(e.consume(A),i=!0,v):A===63?(e.consume(A),a=3,n.interrupt?t:k):Jt(A)?(e.consume(A),s=String.fromCharCode(A),N):r(A)}function m(A){return A===45?(e.consume(A),a=2,g):A===91?(e.consume(A),a=5,l=0,x):Jt(A)?(e.consume(A),a=4,n.interrupt?t:k):r(A)}function g(A){return A===45?(e.consume(A),n.interrupt?t:k):r(A)}function x(A){const H="CDATA[";return A===H.charCodeAt(l++)?(e.consume(A),l===H.length?n.interrupt?t:L:x):r(A)}function v(A){return Jt(A)?(e.consume(A),s=String.fromCharCode(A),N):r(A)}function N(A){if(A===null||A===47||A===62||ft(A)){const H=A===47,ne=s.toLowerCase();return!H&&!i&&s0.includes(ne)?(a=1,n.interrupt?t(A):L(A)):jM.includes(s.toLowerCase())?(a=6,H?(e.consume(A),h):n.interrupt?t(A):L(A)):(a=7,n.interrupt&&!n.parser.lazy[n.now().line]?r(A):i?y(A):b(A))}return A===45||St(A)?(e.consume(A),s+=String.fromCharCode(A),N):r(A)}function h(A){return A===62?(e.consume(A),n.interrupt?t:L):r(A)}function y(A){return ce(A)?(e.consume(A),y):M(A)}function b(A){return A===47?(e.consume(A),M):A===58||A===95||Jt(A)?(e.consume(A),E):ce(A)?(e.consume(A),b):M(A)}function E(A){return A===45||A===46||A===58||A===95||St(A)?(e.consume(A),E):w(A)}function w(A){return A===61?(e.consume(A),S):ce(A)?(e.consume(A),w):b(A)}function S(A){return A===null||A===60||A===61||A===62||A===96?r(A):A===34||A===39?(e.consume(A),u=A,T):ce(A)?(e.consume(A),S):R(A)}function T(A){return A===u?(e.consume(A),u=null,_):A===null||ee(A)?r(A):(e.consume(A),T)}function R(A){return A===null||A===34||A===39||A===47||A===60||A===61||A===62||A===96||ft(A)?w(A):(e.consume(A),R)}function _(A){return A===47||A===62||ce(A)?b(A):r(A)}function M(A){return A===62?(e.consume(A),F):r(A)}function F(A){return A===null||ee(A)?L(A):ce(A)?(e.consume(A),F):r(A)}function L(A){return A===45&&a===2?(e.consume(A),z):A===60&&a===1?(e.consume(A),W):A===62&&a===4?(e.consume(A),$):A===63&&a===3?(e.consume(A),k):A===93&&a===5?(e.consume(A),D):ee(A)&&(a===6||a===7)?(e.exit("htmlFlowData"),e.check(PM,I,O)(A)):A===null||ee(A)?(e.exit("htmlFlowData"),O(A)):(e.consume(A),L)}function O(A){return e.check(UM,P,I)(A)}function P(A){return e.enter("lineEnding"),e.consume(A),e.exit("lineEnding"),B}function B(A){return A===null||ee(A)?O(A):(e.enter("htmlFlowData"),L(A))}function z(A){return A===45?(e.consume(A),k):L(A)}function W(A){return A===47?(e.consume(A),s="",j):L(A)}function j(A){if(A===62){const H=s.toLowerCase();return s0.includes(H)?(e.consume(A),$):L(A)}return Jt(A)&&s.length<8?(e.consume(A),s+=String.fromCharCode(A),j):L(A)}function D(A){return A===93?(e.consume(A),k):L(A)}function k(A){return A===62?(e.consume(A),$):A===45&&a===2?(e.consume(A),k):L(A)}function $(A){return A===null||ee(A)?(e.exit("htmlFlowData"),I(A)):(e.consume(A),$)}function I(A){return e.exit("htmlFlow"),t(A)}}function zM(e,t,r){const n=this;return a;function a(s){return ee(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),i):r(s)}function i(s){return n.parser.lazy[n.now().line]?r(s):t(s)}}function GM(e,t,r){return n;function n(a){return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),e.attempt(zs,t,r)}}const qM={name:"htmlText",tokenize:HM};function HM(e,t,r){const n=this;let a,i,s;return l;function l(k){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(k),u}function u(k){return k===33?(e.consume(k),c):k===47?(e.consume(k),w):k===63?(e.consume(k),b):Jt(k)?(e.consume(k),R):r(k)}function c(k){return k===45?(e.consume(k),d):k===91?(e.consume(k),i=0,x):Jt(k)?(e.consume(k),y):r(k)}function d(k){return k===45?(e.consume(k),g):r(k)}function p(k){return k===null?r(k):k===45?(e.consume(k),m):ee(k)?(s=p,W(k)):(e.consume(k),p)}function m(k){return k===45?(e.consume(k),g):p(k)}function g(k){return k===62?z(k):k===45?m(k):p(k)}function x(k){const $="CDATA[";return k===$.charCodeAt(i++)?(e.consume(k),i===$.length?v:x):r(k)}function v(k){return k===null?r(k):k===93?(e.consume(k),N):ee(k)?(s=v,W(k)):(e.consume(k),v)}function N(k){return k===93?(e.consume(k),h):v(k)}function h(k){return k===62?z(k):k===93?(e.consume(k),h):v(k)}function y(k){return k===null||k===62?z(k):ee(k)?(s=y,W(k)):(e.consume(k),y)}function b(k){return k===null?r(k):k===63?(e.consume(k),E):ee(k)?(s=b,W(k)):(e.consume(k),b)}function E(k){return k===62?z(k):b(k)}function w(k){return Jt(k)?(e.consume(k),S):r(k)}function S(k){return k===45||St(k)?(e.consume(k),S):T(k)}function T(k){return ee(k)?(s=T,W(k)):ce(k)?(e.consume(k),T):z(k)}function R(k){return k===45||St(k)?(e.consume(k),R):k===47||k===62||ft(k)?_(k):r(k)}function _(k){return k===47?(e.consume(k),z):k===58||k===95||Jt(k)?(e.consume(k),M):ee(k)?(s=_,W(k)):ce(k)?(e.consume(k),_):z(k)}function M(k){return k===45||k===46||k===58||k===95||St(k)?(e.consume(k),M):F(k)}function F(k){return k===61?(e.consume(k),L):ee(k)?(s=F,W(k)):ce(k)?(e.consume(k),F):_(k)}function L(k){return k===null||k===60||k===61||k===62||k===96?r(k):k===34||k===39?(e.consume(k),a=k,O):ee(k)?(s=L,W(k)):ce(k)?(e.consume(k),L):(e.consume(k),P)}function O(k){return k===a?(e.consume(k),a=void 0,B):k===null?r(k):ee(k)?(s=O,W(k)):(e.consume(k),O)}function P(k){return k===null||k===34||k===39||k===60||k===61||k===96?r(k):k===47||k===62||ft(k)?_(k):(e.consume(k),P)}function B(k){return k===47||k===62||ft(k)?_(k):r(k)}function z(k){return k===62?(e.consume(k),e.exit("htmlTextData"),e.exit("htmlText"),t):r(k)}function W(k){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(k),e.exit("lineEnding"),j}function j(k){return ce(k)?he(e,D,"linePrefix",n.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(k):D(k)}function D(k){return e.enter("htmlTextData"),s(k)}}const jh={name:"labelEnd",resolveAll:KM,resolveTo:ZM,tokenize:XM},VM={tokenize:QM},WM={tokenize:JM},YM={tokenize:e5};function KM(e){let t=-1;const r=[];for(;++t<e.length;){const n=e[t][1];if(r.push(e[t]),n.type==="labelImage"||n.type==="labelLink"||n.type==="labelEnd"){const a=n.type==="labelImage"?4:2;n.type="data",t+=a}}return e.length!==r.length&&nr(e,0,e.length,r),e}function ZM(e,t){let r=e.length,n=0,a,i,s,l;for(;r--;)if(a=e[r][1],i){if(a.type==="link"||a.type==="labelLink"&&a._inactive)break;e[r][0]==="enter"&&a.type==="labelLink"&&(a._inactive=!0)}else if(s){if(e[r][0]==="enter"&&(a.type==="labelImage"||a.type==="labelLink")&&!a._balanced&&(i=r,a.type!=="labelLink")){n=2;break}}else a.type==="labelEnd"&&(s=r);const u={type:e[i][1].type==="labelLink"?"link":"image",start:{...e[i][1].start},end:{...e[e.length-1][1].end}},c={type:"label",start:{...e[i][1].start},end:{...e[s][1].end}},d={type:"labelText",start:{...e[i+n+2][1].end},end:{...e[s-2][1].start}};return l=[["enter",u,t],["enter",c,t]],l=Ot(l,e.slice(i+1,i+n+3)),l=Ot(l,[["enter",d,t]]),l=Ot(l,Mh(t.parser.constructs.insideSpan.null,e.slice(i+n+4,s-3),t)),l=Ot(l,[["exit",d,t],e[s-2],e[s-1],["exit",c,t]]),l=Ot(l,e.slice(s+1)),l=Ot(l,[["exit",u,t]]),nr(e,i,e.length,l),e}function XM(e,t,r){const n=this;let a=n.events.length,i,s;for(;a--;)if((n.events[a][1].type==="labelImage"||n.events[a][1].type==="labelLink")&&!n.events[a][1]._balanced){i=n.events[a][1];break}return l;function l(m){return i?i._inactive?p(m):(s=n.parser.defined.includes(ia(n.sliceSerialize({start:i.end,end:n.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(m),e.exit("labelMarker"),e.exit("labelEnd"),u):r(m)}function u(m){return m===40?e.attempt(VM,d,s?d:p)(m):m===91?e.attempt(WM,d,s?c:p)(m):s?d(m):p(m)}function c(m){return e.attempt(YM,d,p)(m)}function d(m){return t(m)}function p(m){return i._balanced=!0,r(m)}}function QM(e,t,r){return n;function n(p){return e.enter("resource"),e.enter("resourceMarker"),e.consume(p),e.exit("resourceMarker"),a}function a(p){return ft(p)?ti(e,i)(p):i(p)}function i(p){return p===41?d(p):RA(e,s,l,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(p)}function s(p){return ft(p)?ti(e,u)(p):d(p)}function l(p){return r(p)}function u(p){return p===34||p===39||p===40?_A(e,c,r,"resourceTitle","resourceTitleMarker","resourceTitleString")(p):d(p)}function c(p){return ft(p)?ti(e,d)(p):d(p)}function d(p){return p===41?(e.enter("resourceMarker"),e.consume(p),e.exit("resourceMarker"),e.exit("resource"),t):r(p)}}function JM(e,t,r){const n=this;return a;function a(l){return IA.call(n,e,i,s,"reference","referenceMarker","referenceString")(l)}function i(l){return n.parser.defined.includes(ia(n.sliceSerialize(n.events[n.events.length-1][1]).slice(1,-1)))?t(l):r(l)}function s(l){return r(l)}}function e5(e,t,r){return n;function n(i){return e.enter("reference"),e.enter("referenceMarker"),e.consume(i),e.exit("referenceMarker"),a}function a(i){return i===93?(e.enter("referenceMarker"),e.consume(i),e.exit("referenceMarker"),e.exit("reference"),t):r(i)}}const t5={name:"labelStartImage",resolveAll:jh.resolveAll,tokenize:r5};function r5(e,t,r){const n=this;return a;function a(l){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(l),e.exit("labelImageMarker"),i}function i(l){return l===91?(e.enter("labelMarker"),e.consume(l),e.exit("labelMarker"),e.exit("labelImage"),s):r(l)}function s(l){return l===94&&"_hiddenFootnoteSupport"in n.parser.constructs?r(l):t(l)}}const n5={name:"labelStartLink",resolveAll:jh.resolveAll,tokenize:a5};function a5(e,t,r){const n=this;return a;function a(s){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(s),e.exit("labelMarker"),e.exit("labelLink"),i}function i(s){return s===94&&"_hiddenFootnoteSupport"in n.parser.constructs?r(s):t(s)}}const _l={name:"lineEnding",tokenize:i5};function i5(e,t){return r;function r(n){return e.enter("lineEnding"),e.consume(n),e.exit("lineEnding"),he(e,t,"linePrefix")}}const Lo={name:"thematicBreak",tokenize:o5};function o5(e,t,r){let n=0,a;return i;function i(c){return e.enter("thematicBreak"),s(c)}function s(c){return a=c,l(c)}function l(c){return c===a?(e.enter("thematicBreakSequence"),u(c)):n>=3&&(c===null||ee(c))?(e.exit("thematicBreak"),t(c)):r(c)}function u(c){return c===a?(e.consume(c),n++,u):(e.exit("thematicBreakSequence"),ce(c)?he(e,l,"whitespace")(c):l(c))}}const lt={continuation:{tokenize:c5},exit:p5,name:"list",tokenize:u5},s5={partial:!0,tokenize:g5},l5={partial:!0,tokenize:d5};function u5(e,t,r){const n=this,a=n.events[n.events.length-1];let i=a&&a[1].type==="linePrefix"?a[2].sliceSerialize(a[1],!0).length:0,s=0;return l;function l(g){const x=n.containerState.type||(g===42||g===43||g===45?"listUnordered":"listOrdered");if(x==="listUnordered"?!n.containerState.marker||g===n.containerState.marker:sf(g)){if(n.containerState.type||(n.containerState.type=x,e.enter(x,{_container:!0})),x==="listUnordered")return e.enter("listItemPrefix"),g===42||g===45?e.check(Lo,r,c)(g):c(g);if(!n.interrupt||g===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),u(g)}return r(g)}function u(g){return sf(g)&&++s<10?(e.consume(g),u):(!n.interrupt||s<2)&&(n.containerState.marker?g===n.containerState.marker:g===41||g===46)?(e.exit("listItemValue"),c(g)):r(g)}function c(g){return e.enter("listItemMarker"),e.consume(g),e.exit("listItemMarker"),n.containerState.marker=n.containerState.marker||g,e.check(zs,n.interrupt?r:d,e.attempt(s5,m,p))}function d(g){return n.containerState.initialBlankLine=!0,i++,m(g)}function p(g){return ce(g)?(e.enter("listItemPrefixWhitespace"),e.consume(g),e.exit("listItemPrefixWhitespace"),m):r(g)}function m(g){return n.containerState.size=i+n.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(g)}}function c5(e,t,r){const n=this;return n.containerState._closeFlow=void 0,e.check(zs,a,i);function a(l){return n.containerState.furtherBlankLines=n.containerState.furtherBlankLines||n.containerState.initialBlankLine,he(e,t,"listItemIndent",n.containerState.size+1)(l)}function i(l){return n.containerState.furtherBlankLines||!ce(l)?(n.containerState.furtherBlankLines=void 0,n.containerState.initialBlankLine=void 0,s(l)):(n.containerState.furtherBlankLines=void 0,n.containerState.initialBlankLine=void 0,e.attempt(l5,t,s)(l))}function s(l){return n.containerState._closeFlow=!0,n.interrupt=void 0,he(e,e.attempt(lt,t,r),"linePrefix",n.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(l)}}function d5(e,t,r){const n=this;return he(e,a,"listItemIndent",n.containerState.size+1);function a(i){const s=n.events[n.events.length-1];return s&&s[1].type==="listItemIndent"&&s[2].sliceSerialize(s[1],!0).length===n.containerState.size?t(i):r(i)}}function p5(e){e.exit(this.containerState.type)}function g5(e,t,r){const n=this;return he(e,a,"listItemPrefixWhitespace",n.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function a(i){const s=n.events[n.events.length-1];return!ce(i)&&s&&s[1].type==="listItemPrefixWhitespace"?t(i):r(i)}}const l0={name:"setextUnderline",resolveTo:m5,tokenize:f5};function m5(e,t){let r=e.length,n,a,i;for(;r--;)if(e[r][0]==="enter"){if(e[r][1].type==="content"){n=r;break}e[r][1].type==="paragraph"&&(a=r)}else e[r][1].type==="content"&&e.splice(r,1),!i&&e[r][1].type==="definition"&&(i=r);const s={type:"setextHeading",start:{...e[n][1].start},end:{...e[e.length-1][1].end}};return e[a][1].type="setextHeadingText",i?(e.splice(a,0,["enter",s,t]),e.splice(i+1,0,["exit",e[n][1],t]),e[n][1].end={...e[i][1].end}):e[n][1]=s,e.push(["exit",s,t]),e}function f5(e,t,r){const n=this;let a;return i;function i(c){let d=n.events.length,p;for(;d--;)if(n.events[d][1].type!=="lineEnding"&&n.events[d][1].type!=="linePrefix"&&n.events[d][1].type!=="content"){p=n.events[d][1].type==="paragraph";break}return!n.parser.lazy[n.now().line]&&(n.interrupt||p)?(e.enter("setextHeadingLine"),a=c,s(c)):r(c)}function s(c){return e.enter("setextHeadingLineSequence"),l(c)}function l(c){return c===a?(e.consume(c),l):(e.exit("setextHeadingLineSequence"),ce(c)?he(e,u,"lineSuffix")(c):u(c))}function u(c){return c===null||ee(c)?(e.exit("setextHeadingLine"),t(c)):r(c)}}const h5={tokenize:b5};function b5(e){const t=this,r=e.attempt(zs,n,e.attempt(this.parser.constructs.flowInitial,a,he(e,e.attempt(this.parser.constructs.flow,a,e.attempt(SM,a)),"linePrefix")));return r;function n(i){if(i===null){e.consume(i);return}return e.enter("lineEndingBlank"),e.consume(i),e.exit("lineEndingBlank"),t.currentConstruct=void 0,r}function a(i){if(i===null){e.consume(i);return}return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),t.currentConstruct=void 0,r}}const y5={resolveAll:LA()},x5=OA("string"),v5=OA("text");function OA(e){return{resolveAll:LA(e==="text"?E5:void 0),tokenize:t};function t(r){const n=this,a=this.parser.constructs[e],i=r.attempt(a,s,l);return s;function s(d){return c(d)?i(d):l(d)}function l(d){if(d===null){r.consume(d);return}return r.enter("data"),r.consume(d),u}function u(d){return c(d)?(r.exit("data"),i(d)):(r.consume(d),u)}function c(d){if(d===null)return!0;const p=a[d];let m=-1;if(p)for(;++m<p.length;){const g=p[m];if(!g.previous||g.previous.call(n,n.previous))return!0}return!1}}}function LA(e){return t;function t(r,n){let a=-1,i;for(;++a<=r.length;)i===void 0?r[a]&&r[a][1].type==="data"&&(i=a,a++):(!r[a]||r[a][1].type!=="data")&&(a!==i+2&&(r[i][1].end=r[a-1][1].end,r.splice(i+2,a-i-2),a=i+2),i=void 0);return e?e(r,n):r}}function E5(e,t){let r=0;for(;++r<=e.length;)if((r===e.length||e[r][1].type==="lineEnding")&&e[r-1][1].type==="data"){const n=e[r-1][1],a=t.sliceStream(n);let i=a.length,s=-1,l=0,u;for(;i--;){const c=a[i];if(typeof c=="string"){for(s=c.length;c.charCodeAt(s-1)===32;)l++,s--;if(s)break;s=-1}else if(c===-2)u=!0,l++;else if(c!==-1){i++;break}}if(t._contentTypeTextTrailing&&r===e.length&&(l=0),l){const c={type:r===e.length||u||l<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:i?s:n.start._bufferIndex+s,_index:n.start._index+i,line:n.end.line,column:n.end.column-l,offset:n.end.offset-l},end:{...n.end}};n.end={...c.start},n.start.offset===n.end.offset?Object.assign(n,c):(e.splice(r,0,["enter",c,t],["exit",c,t]),r+=2)}r++}return e}const S5={42:lt,43:lt,45:lt,48:lt,49:lt,50:lt,51:lt,52:lt,53:lt,54:lt,55:lt,56:lt,57:lt,62:NA},k5={91:TM},w5={[-2]:Il,[-1]:Il,32:Il},N5={35:LM,42:Lo,45:[l0,Lo],60:FM,61:l0,95:Lo,96:o0,126:o0},A5={38:TA,92:AA},T5={[-5]:_l,[-4]:_l,[-3]:_l,33:t5,38:TA,42:lf,60:[nM,qM],91:n5,92:[_M,AA],93:jh,95:lf,96:hM},C5={null:[lf,y5]},R5={null:[42,95]},I5={null:[]},_5=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:R5,contentInitial:k5,disable:I5,document:S5,flow:N5,flowInitial:w5,insideSpan:C5,string:A5,text:T5},Symbol.toStringTag,{value:"Module"}));function O5(e,t,r){let n={_bufferIndex:-1,_index:0,line:r&&r.line||1,column:r&&r.column||1,offset:r&&r.offset||0};const a={},i=[];let s=[],l=[];const u={attempt:T(w),check:T(S),consume:y,enter:b,exit:E,interrupt:T(S,{interrupt:!0})},c={code:null,containerState:{},defineSkip:v,events:[],now:x,parser:e,previous:null,sliceSerialize:m,sliceStream:g,write:p};let d=t.tokenize.call(c,u);return t.resolveAll&&i.push(t),c;function p(F){return s=Ot(s,F),N(),s[s.length-1]!==null?[]:(R(t,0),c.events=Mh(i,c.events,c),c.events)}function m(F,L){return D5(g(F),L)}function g(F){return L5(s,F)}function x(){const{_bufferIndex:F,_index:L,line:O,column:P,offset:B}=n;return{_bufferIndex:F,_index:L,line:O,column:P,offset:B}}function v(F){a[F.line]=F.column,M()}function N(){let F;for(;n._index<s.length;){const L=s[n._index];if(typeof L=="string")for(F=n._index,n._bufferIndex<0&&(n._bufferIndex=0);n._index===F&&n._bufferIndex<L.length;)h(L.charCodeAt(n._bufferIndex));else h(L)}}function h(F){d=d(F)}function y(F){ee(F)?(n.line++,n.column=1,n.offset+=F===-3?2:1,M()):F!==-1&&(n.column++,n.offset++),n._bufferIndex<0?n._index++:(n._bufferIndex++,n._bufferIndex===s[n._index].length&&(n._bufferIndex=-1,n._index++)),c.previous=F}function b(F,L){const O=L||{};return O.type=F,O.start=x(),c.events.push(["enter",O,c]),l.push(O),O}function E(F){const L=l.pop();return L.end=x(),c.events.push(["exit",L,c]),L}function w(F,L){R(F,L.from)}function S(F,L){L.restore()}function T(F,L){return O;function O(P,B,z){let W,j,D,k;return Array.isArray(P)?I(P):"tokenize"in P?I([P]):$(P);function $(Q){return de;function de(ge){const Ee=ge!==null&&Q[ge],_e=ge!==null&&Q.null,Be=[...Array.isArray(Ee)?Ee:Ee?[Ee]:[],...Array.isArray(_e)?_e:_e?[_e]:[]];return I(Be)(ge)}}function I(Q){return W=Q,j=0,Q.length===0?z:A(Q[j])}function A(Q){return de;function de(ge){return k=_(),D=Q,Q.partial||(c.currentConstruct=Q),Q.name&&c.parser.constructs.disable.null.includes(Q.name)?ne():Q.tokenize.call(L?Object.assign(Object.create(c),L):c,u,H,ne)(ge)}}function H(Q){return F(D,k),B}function ne(Q){return k.restore(),++j<W.length?A(W[j]):z}}}function R(F,L){F.resolveAll&&!i.includes(F)&&i.push(F),F.resolve&&nr(c.events,L,c.events.length-L,F.resolve(c.events.slice(L),c)),F.resolveTo&&(c.events=F.resolveTo(c.events,c))}function _(){const F=x(),L=c.previous,O=c.currentConstruct,P=c.events.length,B=Array.from(l);return{from:P,restore:z};function z(){n=F,c.previous=L,c.currentConstruct=O,c.events.length=P,l=B,M()}}function M(){n.line in a&&n.column<2&&(n.column=a[n.line],n.offset+=a[n.line]-1)}}function L5(e,t){const r=t.start._index,n=t.start._bufferIndex,a=t.end._index,i=t.end._bufferIndex;let s;if(r===a)s=[e[r].slice(n,i)];else{if(s=e.slice(r,a),n>-1){const l=s[0];typeof l=="string"?s[0]=l.slice(n):s.shift()}i>0&&s.push(e[a].slice(0,i))}return s}function D5(e,t){let r=-1;const n=[];let a;for(;++r<e.length;){const i=e[r];let s;if(typeof i=="string")s=i;else switch(i){case-5:{s="\r";break}case-4:{s=`
|
|
307
307
|
`;break}case-3:{s=`\r
|
|
308
|
-
`;break}case-2:{s=t?" ":" ";break}case-1:{if(!t&&a)continue;s=" ";break}default:s=String.fromCharCode(i)}a=i===-2,n.push(s)}return n.join("")}function MM(e){const n={constructs:zD([_M,...(e||{}).extensions||[]]),content:a(ZD),defined:[],document:a(QD),flow:a(hM),lazy:{},string:a(xM),text:a(vM)};return n;function a(i){return s;function s(l){return OM(n,i,l)}}}function jM(e){for(;!CA(e););return e}const u0=/[\0\t\n\r]/g;function FM(){let e=1,t="",r=!0,n;return a;function a(i,s,l){const u=[];let c,d,p,m,g;for(i=t+(typeof i=="string"?i.toString():new TextDecoder(s||void 0).decode(i)),p=0,t="",r&&(i.charCodeAt(0)===65279&&p++,r=void 0);p<i.length;){if(u0.lastIndex=p,c=u0.exec(i),m=c&&c.index!==void 0?c.index:i.length,g=i.charCodeAt(m),!c){t=i.slice(p);break}if(g===10&&p===m&&n)u.push(-3),n=void 0;else switch(n&&(u.push(-5),n=void 0),p<m&&(u.push(i.slice(p,m)),e+=m-p),g){case 0:{u.push(65533),e++;break}case 9:{for(d=Math.ceil(e/4)*4,u.push(-2);e++<d;)u.push(-1);break}case 10:{u.push(-4),e=1;break}default:n=!0,e=1}p=m+1}return l&&(n&&u.push(-5),t&&u.push(t),u.push(null)),u}}const PM=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function UM(e){return e.replace(PM,BM)}function BM(e,t,r){if(t)return t;if(r.charCodeAt(0)===35){const a=r.charCodeAt(1),i=a===120||a===88;return wA(r.slice(i?2:1),i?16:10)}return Dh(r)||e}const DA={}.hasOwnProperty;function $M(e,t,r){return typeof t!="string"&&(r=t,t=void 0),zM(r)(jM(MM(r).document().write(FM()(e,t,!0))))}function zM(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:i(Bi),autolinkProtocol:_,autolinkEmail:_,atxHeading:i(Cn),blockQuote:i(_e),characterEscape:_,characterReference:_,codeFenced:i(Be),codeFencedFenceInfo:s,codeFencedFenceMeta:s,codeIndented:i(Be,s),codeText:i(Tn,s),codeTextData:_,data:_,codeFlowValue:_,definition:i(Re),definitionDestinationString:s,definitionLabelString:s,definitionTitleString:s,emphasis:i(ir),hardBreakEscape:i(tn),hardBreakTrailing:i(tn),htmlFlow:i(Ui,s),htmlFlowData:_,htmlText:i(Ui,s),htmlTextData:_,image:i(Xs),label:s,link:i(Bi),listItem:i($i),listItemValue:m,listOrdered:i(Sa,p),listUnordered:i(Sa),paragraph:i(X),reference:A,referenceString:s,resourceDestinationString:s,resourceTitleString:s,setextHeading:i(Cn),strong:i(se),thematicBreak:i(Je)},exit:{atxHeading:u(),atxHeadingSequence:w,autolink:u(),autolinkEmail:Ee,autolinkProtocol:ge,blockQuote:u(),characterEscapeValue:M,characterReferenceMarkerHexadecimal:ne,characterReferenceMarkerNumeric:ne,characterReferenceValue:Q,characterReference:de,codeFenced:u(N),codeFencedFence:v,codeFencedFenceInfo:g,codeFencedFenceMeta:x,codeFlowValue:M,codeIndented:u(h),codeText:u(B),codeTextData:M,data:M,definition:u(),definitionDestinationString:E,definitionLabelString:y,definitionTitleString:b,emphasis:u(),hardBreakEscape:u(L),hardBreakTrailing:u(L),htmlFlow:u(O),htmlFlowData:M,htmlText:u(P),htmlTextData:M,image:u(W),label:D,labelText:j,lineEnding:F,link:u(z),listItem:u(),listOrdered:u(),listUnordered:u(),paragraph:u(),referenceString:H,resourceDestinationString:k,resourceTitleString:$,resource:I,setextHeading:u(R),setextHeadingLineSequence:T,setextHeadingText:S,strong:u(),thematicBreak:u()}};MA(t,(e||{}).mdastExtensions||[]);const r={};return n;function n(U){let V={type:"root",children:[]};const J={stack:[V],tokenStack:[],config:t,enter:l,exit:c,buffer:s,resume:d,data:r},te=[];let le=-1;for(;++le<U.length;)if(U[le][1].type==="listOrdered"||U[le][1].type==="listUnordered")if(U[le][0]==="enter")te.push(le);else{const et=te.pop();le=a(U,et,le)}for(le=-1;++le<U.length;){const et=t[U[le][0]];DA.call(et,U[le][1].type)&&et[U[le][1].type].call(Object.assign({sliceSerialize:U[le][2].sliceSerialize},J),U[le][1])}if(J.tokenStack.length>0){const et=J.tokenStack[J.tokenStack.length-1];(et[1]||c0).call(J,void 0,et[0])}for(V.position={start:kr(U.length>0?U[0][1].start:{line:1,column:1,offset:0}),end:kr(U.length>0?U[U.length-2][1].end:{line:1,column:1,offset:0})},le=-1;++le<t.transforms.length;)V=t.transforms[le](V)||V;return V}function a(U,V,J){let te=V-1,le=-1,et=!1,Ge,ot,Rn,rn;for(;++te<=J;){const yt=U[te];switch(yt[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{yt[0]==="enter"?le++:le--,rn=void 0;break}case"lineEndingBlank":{yt[0]==="enter"&&(Ge&&!rn&&!le&&!Rn&&(Rn=te),rn=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:rn=void 0}if(!le&&yt[0]==="enter"&&yt[1].type==="listItemPrefix"||le===-1&&yt[0]==="exit"&&(yt[1].type==="listUnordered"||yt[1].type==="listOrdered")){if(Ge){let In=te;for(ot=void 0;In--;){const or=U[In];if(or[1].type==="lineEnding"||or[1].type==="lineEndingBlank"){if(or[0]==="exit")continue;ot&&(U[ot][1].type="lineEndingBlank",et=!0),or[1].type="lineEnding",ot=In}else if(!(or[1].type==="linePrefix"||or[1].type==="blockQuotePrefix"||or[1].type==="blockQuotePrefixWhitespace"||or[1].type==="blockQuoteMarker"||or[1].type==="listItemIndent"))break}Rn&&(!ot||Rn<ot)&&(Ge._spread=!0),Ge.end=Object.assign({},ot?U[ot][1].start:yt[1].end),U.splice(ot||te,0,["exit",Ge,yt[2]]),te++,J++}if(yt[1].type==="listItemPrefix"){const In={type:"listItem",_spread:!1,start:Object.assign({},yt[1].start),end:void 0};Ge=In,U.splice(te,0,["enter",In,yt[2]]),te++,J++,Rn=void 0,rn=!0}}}return U[V][1]._spread=et,J}function i(U,V){return J;function J(te){l.call(this,U(te),te),V&&V.call(this,te)}}function s(){this.stack.push({type:"fragment",children:[]})}function l(U,V,J){this.stack[this.stack.length-1].children.push(U),this.stack.push(U),this.tokenStack.push([V,J||void 0]),U.position={start:kr(V.start),end:void 0}}function u(U){return V;function V(J){U&&U.call(this,J),c.call(this,J)}}function c(U,V){const J=this.stack.pop(),te=this.tokenStack.pop();if(te)te[0].type!==U.type&&(V?V.call(this,U,te[0]):(te[1]||c0).call(this,U,te[0]));else throw new Error("Cannot close `"+U.type+"` ("+ei({start:U.start,end:U.end})+"): it’s not open");J.position.end=kr(U.end)}function d(){return BD(this.stack.pop())}function p(){this.data.expectingFirstListItemValue=!0}function m(U){if(this.data.expectingFirstListItemValue){const V=this.stack[this.stack.length-2];V.start=Number.parseInt(this.sliceSerialize(U),10),this.data.expectingFirstListItemValue=void 0}}function g(){const U=this.resume(),V=this.stack[this.stack.length-1];V.lang=U}function x(){const U=this.resume(),V=this.stack[this.stack.length-1];V.meta=U}function v(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function N(){const U=this.resume(),V=this.stack[this.stack.length-1];V.value=U.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function h(){const U=this.resume(),V=this.stack[this.stack.length-1];V.value=U.replace(/(\r?\n|\r)$/g,"")}function y(U){const V=this.resume(),J=this.stack[this.stack.length-1];J.label=V,J.identifier=ia(this.sliceSerialize(U)).toLowerCase()}function b(){const U=this.resume(),V=this.stack[this.stack.length-1];V.title=U}function E(){const U=this.resume(),V=this.stack[this.stack.length-1];V.url=U}function w(U){const V=this.stack[this.stack.length-1];if(!V.depth){const J=this.sliceSerialize(U).length;V.depth=J}}function S(){this.data.setextHeadingSlurpLineEnding=!0}function T(U){const V=this.stack[this.stack.length-1];V.depth=this.sliceSerialize(U).codePointAt(0)===61?1:2}function R(){this.data.setextHeadingSlurpLineEnding=void 0}function _(U){const J=this.stack[this.stack.length-1].children;let te=J[J.length-1];(!te||te.type!=="text")&&(te=Se(),te.position={start:kr(U.start),end:void 0},J.push(te)),this.stack.push(te)}function M(U){const V=this.stack.pop();V.value+=this.sliceSerialize(U),V.position.end=kr(U.end)}function F(U){const V=this.stack[this.stack.length-1];if(this.data.atHardBreak){const J=V.children[V.children.length-1];J.position.end=kr(U.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(V.type)&&(_.call(this,U),M.call(this,U))}function L(){this.data.atHardBreak=!0}function O(){const U=this.resume(),V=this.stack[this.stack.length-1];V.value=U}function P(){const U=this.resume(),V=this.stack[this.stack.length-1];V.value=U}function B(){const U=this.resume(),V=this.stack[this.stack.length-1];V.value=U}function z(){const U=this.stack[this.stack.length-1];if(this.data.inReference){const V=this.data.referenceType||"shortcut";U.type+="Reference",U.referenceType=V,delete U.url,delete U.title}else delete U.identifier,delete U.label;this.data.referenceType=void 0}function W(){const U=this.stack[this.stack.length-1];if(this.data.inReference){const V=this.data.referenceType||"shortcut";U.type+="Reference",U.referenceType=V,delete U.url,delete U.title}else delete U.identifier,delete U.label;this.data.referenceType=void 0}function j(U){const V=this.sliceSerialize(U),J=this.stack[this.stack.length-2];J.label=UM(V),J.identifier=ia(V).toLowerCase()}function D(){const U=this.stack[this.stack.length-1],V=this.resume(),J=this.stack[this.stack.length-1];if(this.data.inReference=!0,J.type==="link"){const te=U.children;J.children=te}else J.alt=V}function k(){const U=this.resume(),V=this.stack[this.stack.length-1];V.url=U}function $(){const U=this.resume(),V=this.stack[this.stack.length-1];V.title=U}function I(){this.data.inReference=void 0}function A(){this.data.referenceType="collapsed"}function H(U){const V=this.resume(),J=this.stack[this.stack.length-1];J.label=V,J.identifier=ia(this.sliceSerialize(U)).toLowerCase(),this.data.referenceType="full"}function ne(U){this.data.characterReferenceType=U.type}function Q(U){const V=this.sliceSerialize(U),J=this.data.characterReferenceType;let te;J?(te=wA(V,J==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):te=Dh(V);const le=this.stack[this.stack.length-1];le.value+=te}function de(U){const V=this.stack.pop();V.position.end=kr(U.end)}function ge(U){M.call(this,U);const V=this.stack[this.stack.length-1];V.url=this.sliceSerialize(U)}function Ee(U){M.call(this,U);const V=this.stack[this.stack.length-1];V.url="mailto:"+this.sliceSerialize(U)}function _e(){return{type:"blockquote",children:[]}}function Be(){return{type:"code",lang:null,meta:null,value:""}}function Tn(){return{type:"inlineCode",value:""}}function Re(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function ir(){return{type:"emphasis",children:[]}}function Cn(){return{type:"heading",depth:0,children:[]}}function tn(){return{type:"break"}}function Ui(){return{type:"html",value:""}}function Xs(){return{type:"image",title:null,url:"",alt:null}}function Bi(){return{type:"link",title:null,url:"",children:[]}}function Sa(U){return{type:"list",ordered:U.type==="listOrdered",start:null,spread:U._spread,children:[]}}function $i(U){return{type:"listItem",spread:U._spread,checked:null,children:[]}}function X(){return{type:"paragraph",children:[]}}function se(){return{type:"strong",children:[]}}function Se(){return{type:"text",value:""}}function Je(){return{type:"thematicBreak"}}}function kr(e){return{line:e.line,column:e.column,offset:e.offset}}function MA(e,t){let r=-1;for(;++r<t.length;){const n=t[r];Array.isArray(n)?MA(e,n):GM(e,n)}}function GM(e,t){let r;for(r in t)if(DA.call(t,r))switch(r){case"canContainEols":{const n=t[r];n&&e[r].push(...n);break}case"transforms":{const n=t[r];n&&e[r].push(...n);break}case"enter":case"exit":{const n=t[r];n&&Object.assign(e[r],n);break}}}function c0(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+ei({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+ei({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+ei({start:t.start,end:t.end})+") is still open")}function qM(e){const t=this;t.parser=r;function r(n){return $M(n,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function HM(e,t){const r={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,r),e.applyData(t,r)}function VM(e,t){const r={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,r),[e.applyData(t,r),{type:"text",value:`
|
|
309
|
-
`}]}function
|
|
310
|
-
`:"",n={},a=t.lang?t.lang.split(/\s+/):[];a.length>0&&(n.className=["language-"+a[0]]);let i={type:"element",tagName:"code",properties:n,children:[{type:"text",value:r}]};return t.meta&&(i.data={meta:t.meta}),e.patch(t,i),i=e.applyData(t,i),i={type:"element",tagName:"pre",properties:{},children:[i]},e.patch(t,i),i}function
|
|
308
|
+
`;break}case-2:{s=t?" ":" ";break}case-1:{if(!t&&a)continue;s=" ";break}default:s=String.fromCharCode(i)}a=i===-2,n.push(s)}return n.join("")}function M5(e){const n={constructs:zD([_5,...(e||{}).extensions||[]]),content:a(ZD),defined:[],document:a(QD),flow:a(h5),lazy:{},string:a(x5),text:a(v5)};return n;function a(i){return s;function s(l){return O5(n,i,l)}}}function j5(e){for(;!CA(e););return e}const u0=/[\0\t\n\r]/g;function F5(){let e=1,t="",r=!0,n;return a;function a(i,s,l){const u=[];let c,d,p,m,g;for(i=t+(typeof i=="string"?i.toString():new TextDecoder(s||void 0).decode(i)),p=0,t="",r&&(i.charCodeAt(0)===65279&&p++,r=void 0);p<i.length;){if(u0.lastIndex=p,c=u0.exec(i),m=c&&c.index!==void 0?c.index:i.length,g=i.charCodeAt(m),!c){t=i.slice(p);break}if(g===10&&p===m&&n)u.push(-3),n=void 0;else switch(n&&(u.push(-5),n=void 0),p<m&&(u.push(i.slice(p,m)),e+=m-p),g){case 0:{u.push(65533),e++;break}case 9:{for(d=Math.ceil(e/4)*4,u.push(-2);e++<d;)u.push(-1);break}case 10:{u.push(-4),e=1;break}default:n=!0,e=1}p=m+1}return l&&(n&&u.push(-5),t&&u.push(t),u.push(null)),u}}const P5=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function U5(e){return e.replace(P5,B5)}function B5(e,t,r){if(t)return t;if(r.charCodeAt(0)===35){const a=r.charCodeAt(1),i=a===120||a===88;return wA(r.slice(i?2:1),i?16:10)}return Dh(r)||e}const DA={}.hasOwnProperty;function $5(e,t,r){return typeof t!="string"&&(r=t,t=void 0),z5(r)(j5(M5(r).document().write(F5()(e,t,!0))))}function z5(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:i(Bi),autolinkProtocol:_,autolinkEmail:_,atxHeading:i(Cn),blockQuote:i(_e),characterEscape:_,characterReference:_,codeFenced:i(Be),codeFencedFenceInfo:s,codeFencedFenceMeta:s,codeIndented:i(Be,s),codeText:i(Tn,s),codeTextData:_,data:_,codeFlowValue:_,definition:i(Re),definitionDestinationString:s,definitionLabelString:s,definitionTitleString:s,emphasis:i(ir),hardBreakEscape:i(tn),hardBreakTrailing:i(tn),htmlFlow:i(Ui,s),htmlFlowData:_,htmlText:i(Ui,s),htmlTextData:_,image:i(Xs),label:s,link:i(Bi),listItem:i($i),listItemValue:m,listOrdered:i(Sa,p),listUnordered:i(Sa),paragraph:i(X),reference:A,referenceString:s,resourceDestinationString:s,resourceTitleString:s,setextHeading:i(Cn),strong:i(se),thematicBreak:i(Je)},exit:{atxHeading:u(),atxHeadingSequence:w,autolink:u(),autolinkEmail:Ee,autolinkProtocol:ge,blockQuote:u(),characterEscapeValue:M,characterReferenceMarkerHexadecimal:ne,characterReferenceMarkerNumeric:ne,characterReferenceValue:Q,characterReference:de,codeFenced:u(N),codeFencedFence:v,codeFencedFenceInfo:g,codeFencedFenceMeta:x,codeFlowValue:M,codeIndented:u(h),codeText:u(B),codeTextData:M,data:M,definition:u(),definitionDestinationString:E,definitionLabelString:y,definitionTitleString:b,emphasis:u(),hardBreakEscape:u(L),hardBreakTrailing:u(L),htmlFlow:u(O),htmlFlowData:M,htmlText:u(P),htmlTextData:M,image:u(W),label:D,labelText:j,lineEnding:F,link:u(z),listItem:u(),listOrdered:u(),listUnordered:u(),paragraph:u(),referenceString:H,resourceDestinationString:k,resourceTitleString:$,resource:I,setextHeading:u(R),setextHeadingLineSequence:T,setextHeadingText:S,strong:u(),thematicBreak:u()}};MA(t,(e||{}).mdastExtensions||[]);const r={};return n;function n(U){let V={type:"root",children:[]};const J={stack:[V],tokenStack:[],config:t,enter:l,exit:c,buffer:s,resume:d,data:r},te=[];let le=-1;for(;++le<U.length;)if(U[le][1].type==="listOrdered"||U[le][1].type==="listUnordered")if(U[le][0]==="enter")te.push(le);else{const et=te.pop();le=a(U,et,le)}for(le=-1;++le<U.length;){const et=t[U[le][0]];DA.call(et,U[le][1].type)&&et[U[le][1].type].call(Object.assign({sliceSerialize:U[le][2].sliceSerialize},J),U[le][1])}if(J.tokenStack.length>0){const et=J.tokenStack[J.tokenStack.length-1];(et[1]||c0).call(J,void 0,et[0])}for(V.position={start:kr(U.length>0?U[0][1].start:{line:1,column:1,offset:0}),end:kr(U.length>0?U[U.length-2][1].end:{line:1,column:1,offset:0})},le=-1;++le<t.transforms.length;)V=t.transforms[le](V)||V;return V}function a(U,V,J){let te=V-1,le=-1,et=!1,Ge,ot,Rn,rn;for(;++te<=J;){const yt=U[te];switch(yt[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{yt[0]==="enter"?le++:le--,rn=void 0;break}case"lineEndingBlank":{yt[0]==="enter"&&(Ge&&!rn&&!le&&!Rn&&(Rn=te),rn=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:rn=void 0}if(!le&&yt[0]==="enter"&&yt[1].type==="listItemPrefix"||le===-1&&yt[0]==="exit"&&(yt[1].type==="listUnordered"||yt[1].type==="listOrdered")){if(Ge){let In=te;for(ot=void 0;In--;){const or=U[In];if(or[1].type==="lineEnding"||or[1].type==="lineEndingBlank"){if(or[0]==="exit")continue;ot&&(U[ot][1].type="lineEndingBlank",et=!0),or[1].type="lineEnding",ot=In}else if(!(or[1].type==="linePrefix"||or[1].type==="blockQuotePrefix"||or[1].type==="blockQuotePrefixWhitespace"||or[1].type==="blockQuoteMarker"||or[1].type==="listItemIndent"))break}Rn&&(!ot||Rn<ot)&&(Ge._spread=!0),Ge.end=Object.assign({},ot?U[ot][1].start:yt[1].end),U.splice(ot||te,0,["exit",Ge,yt[2]]),te++,J++}if(yt[1].type==="listItemPrefix"){const In={type:"listItem",_spread:!1,start:Object.assign({},yt[1].start),end:void 0};Ge=In,U.splice(te,0,["enter",In,yt[2]]),te++,J++,Rn=void 0,rn=!0}}}return U[V][1]._spread=et,J}function i(U,V){return J;function J(te){l.call(this,U(te),te),V&&V.call(this,te)}}function s(){this.stack.push({type:"fragment",children:[]})}function l(U,V,J){this.stack[this.stack.length-1].children.push(U),this.stack.push(U),this.tokenStack.push([V,J||void 0]),U.position={start:kr(V.start),end:void 0}}function u(U){return V;function V(J){U&&U.call(this,J),c.call(this,J)}}function c(U,V){const J=this.stack.pop(),te=this.tokenStack.pop();if(te)te[0].type!==U.type&&(V?V.call(this,U,te[0]):(te[1]||c0).call(this,U,te[0]));else throw new Error("Cannot close `"+U.type+"` ("+ei({start:U.start,end:U.end})+"): it’s not open");J.position.end=kr(U.end)}function d(){return BD(this.stack.pop())}function p(){this.data.expectingFirstListItemValue=!0}function m(U){if(this.data.expectingFirstListItemValue){const V=this.stack[this.stack.length-2];V.start=Number.parseInt(this.sliceSerialize(U),10),this.data.expectingFirstListItemValue=void 0}}function g(){const U=this.resume(),V=this.stack[this.stack.length-1];V.lang=U}function x(){const U=this.resume(),V=this.stack[this.stack.length-1];V.meta=U}function v(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function N(){const U=this.resume(),V=this.stack[this.stack.length-1];V.value=U.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function h(){const U=this.resume(),V=this.stack[this.stack.length-1];V.value=U.replace(/(\r?\n|\r)$/g,"")}function y(U){const V=this.resume(),J=this.stack[this.stack.length-1];J.label=V,J.identifier=ia(this.sliceSerialize(U)).toLowerCase()}function b(){const U=this.resume(),V=this.stack[this.stack.length-1];V.title=U}function E(){const U=this.resume(),V=this.stack[this.stack.length-1];V.url=U}function w(U){const V=this.stack[this.stack.length-1];if(!V.depth){const J=this.sliceSerialize(U).length;V.depth=J}}function S(){this.data.setextHeadingSlurpLineEnding=!0}function T(U){const V=this.stack[this.stack.length-1];V.depth=this.sliceSerialize(U).codePointAt(0)===61?1:2}function R(){this.data.setextHeadingSlurpLineEnding=void 0}function _(U){const J=this.stack[this.stack.length-1].children;let te=J[J.length-1];(!te||te.type!=="text")&&(te=Se(),te.position={start:kr(U.start),end:void 0},J.push(te)),this.stack.push(te)}function M(U){const V=this.stack.pop();V.value+=this.sliceSerialize(U),V.position.end=kr(U.end)}function F(U){const V=this.stack[this.stack.length-1];if(this.data.atHardBreak){const J=V.children[V.children.length-1];J.position.end=kr(U.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(V.type)&&(_.call(this,U),M.call(this,U))}function L(){this.data.atHardBreak=!0}function O(){const U=this.resume(),V=this.stack[this.stack.length-1];V.value=U}function P(){const U=this.resume(),V=this.stack[this.stack.length-1];V.value=U}function B(){const U=this.resume(),V=this.stack[this.stack.length-1];V.value=U}function z(){const U=this.stack[this.stack.length-1];if(this.data.inReference){const V=this.data.referenceType||"shortcut";U.type+="Reference",U.referenceType=V,delete U.url,delete U.title}else delete U.identifier,delete U.label;this.data.referenceType=void 0}function W(){const U=this.stack[this.stack.length-1];if(this.data.inReference){const V=this.data.referenceType||"shortcut";U.type+="Reference",U.referenceType=V,delete U.url,delete U.title}else delete U.identifier,delete U.label;this.data.referenceType=void 0}function j(U){const V=this.sliceSerialize(U),J=this.stack[this.stack.length-2];J.label=U5(V),J.identifier=ia(V).toLowerCase()}function D(){const U=this.stack[this.stack.length-1],V=this.resume(),J=this.stack[this.stack.length-1];if(this.data.inReference=!0,J.type==="link"){const te=U.children;J.children=te}else J.alt=V}function k(){const U=this.resume(),V=this.stack[this.stack.length-1];V.url=U}function $(){const U=this.resume(),V=this.stack[this.stack.length-1];V.title=U}function I(){this.data.inReference=void 0}function A(){this.data.referenceType="collapsed"}function H(U){const V=this.resume(),J=this.stack[this.stack.length-1];J.label=V,J.identifier=ia(this.sliceSerialize(U)).toLowerCase(),this.data.referenceType="full"}function ne(U){this.data.characterReferenceType=U.type}function Q(U){const V=this.sliceSerialize(U),J=this.data.characterReferenceType;let te;J?(te=wA(V,J==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):te=Dh(V);const le=this.stack[this.stack.length-1];le.value+=te}function de(U){const V=this.stack.pop();V.position.end=kr(U.end)}function ge(U){M.call(this,U);const V=this.stack[this.stack.length-1];V.url=this.sliceSerialize(U)}function Ee(U){M.call(this,U);const V=this.stack[this.stack.length-1];V.url="mailto:"+this.sliceSerialize(U)}function _e(){return{type:"blockquote",children:[]}}function Be(){return{type:"code",lang:null,meta:null,value:""}}function Tn(){return{type:"inlineCode",value:""}}function Re(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function ir(){return{type:"emphasis",children:[]}}function Cn(){return{type:"heading",depth:0,children:[]}}function tn(){return{type:"break"}}function Ui(){return{type:"html",value:""}}function Xs(){return{type:"image",title:null,url:"",alt:null}}function Bi(){return{type:"link",title:null,url:"",children:[]}}function Sa(U){return{type:"list",ordered:U.type==="listOrdered",start:null,spread:U._spread,children:[]}}function $i(U){return{type:"listItem",spread:U._spread,checked:null,children:[]}}function X(){return{type:"paragraph",children:[]}}function se(){return{type:"strong",children:[]}}function Se(){return{type:"text",value:""}}function Je(){return{type:"thematicBreak"}}}function kr(e){return{line:e.line,column:e.column,offset:e.offset}}function MA(e,t){let r=-1;for(;++r<t.length;){const n=t[r];Array.isArray(n)?MA(e,n):G5(e,n)}}function G5(e,t){let r;for(r in t)if(DA.call(t,r))switch(r){case"canContainEols":{const n=t[r];n&&e[r].push(...n);break}case"transforms":{const n=t[r];n&&e[r].push(...n);break}case"enter":case"exit":{const n=t[r];n&&Object.assign(e[r],n);break}}}function c0(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+ei({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+ei({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+ei({start:t.start,end:t.end})+") is still open")}function q5(e){const t=this;t.parser=r;function r(n){return $5(n,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function H5(e,t){const r={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,r),e.applyData(t,r)}function V5(e,t){const r={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,r),[e.applyData(t,r),{type:"text",value:`
|
|
309
|
+
`}]}function W5(e,t){const r=t.value?t.value+`
|
|
310
|
+
`:"",n={},a=t.lang?t.lang.split(/\s+/):[];a.length>0&&(n.className=["language-"+a[0]]);let i={type:"element",tagName:"code",properties:n,children:[{type:"text",value:r}]};return t.meta&&(i.data={meta:t.meta}),e.patch(t,i),i=e.applyData(t,i),i={type:"element",tagName:"pre",properties:{},children:[i]},e.patch(t,i),i}function Y5(e,t){const r={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function K5(e,t){const r={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function Z5(e,t){const r=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=String(t.identifier).toUpperCase(),a=va(n.toLowerCase()),i=e.footnoteOrder.indexOf(n);let s,l=e.footnoteCounts.get(n);l===void 0?(l=0,e.footnoteOrder.push(n),s=e.footnoteOrder.length):s=i+1,l+=1,e.footnoteCounts.set(n,l);const u={type:"element",tagName:"a",properties:{href:"#"+r+"fn-"+a,id:r+"fnref-"+a+(l>1?"-"+l:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(s)}]};e.patch(t,u);const c={type:"element",tagName:"sup",properties:{},children:[u]};return e.patch(t,c),e.applyData(t,c)}function X5(e,t){const r={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function Q5(e,t){if(e.options.allowDangerousHtml){const r={type:"raw",value:t.value};return e.patch(t,r),e.applyData(t,r)}}function jA(e,t){const r=t.referenceType;let n="]";if(r==="collapsed"?n+="[]":r==="full"&&(n+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return[{type:"text",value:"!["+t.alt+n}];const a=e.all(t),i=a[0];i&&i.type==="text"?i.value="["+i.value:a.unshift({type:"text",value:"["});const s=a[a.length-1];return s&&s.type==="text"?s.value+=n:a.push({type:"text",value:n}),a}function J5(e,t){const r=String(t.identifier).toUpperCase(),n=e.definitionById.get(r);if(!n)return jA(e,t);const a={src:va(n.url||""),alt:t.alt};n.title!==null&&n.title!==void 0&&(a.title=n.title);const i={type:"element",tagName:"img",properties:a,children:[]};return e.patch(t,i),e.applyData(t,i)}function ej(e,t){const r={src:va(t.url)};t.alt!==null&&t.alt!==void 0&&(r.alt=t.alt),t.title!==null&&t.title!==void 0&&(r.title=t.title);const n={type:"element",tagName:"img",properties:r,children:[]};return e.patch(t,n),e.applyData(t,n)}function tj(e,t){const r={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,r);const n={type:"element",tagName:"code",properties:{},children:[r]};return e.patch(t,n),e.applyData(t,n)}function rj(e,t){const r=String(t.identifier).toUpperCase(),n=e.definitionById.get(r);if(!n)return jA(e,t);const a={href:va(n.url||"")};n.title!==null&&n.title!==void 0&&(a.title=n.title);const i={type:"element",tagName:"a",properties:a,children:e.all(t)};return e.patch(t,i),e.applyData(t,i)}function nj(e,t){const r={href:va(t.url)};t.title!==null&&t.title!==void 0&&(r.title=t.title);const n={type:"element",tagName:"a",properties:r,children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function aj(e,t,r){const n=e.all(t),a=r?ij(r):FA(t),i={},s=[];if(typeof t.checked=="boolean"){const d=n[0];let p;d&&d.type==="element"&&d.tagName==="p"?p=d:(p={type:"element",tagName:"p",properties:{},children:[]},n.unshift(p)),p.children.length>0&&p.children.unshift({type:"text",value:" "}),p.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),i.className=["task-list-item"]}let l=-1;for(;++l<n.length;){const d=n[l];(a||l!==0||d.type!=="element"||d.tagName!=="p")&&s.push({type:"text",value:`
|
|
311
311
|
`}),d.type==="element"&&d.tagName==="p"&&!a?s.push(...d.children):s.push(d)}const u=n[n.length-1];u&&(a||u.type!=="element"||u.tagName!=="p")&&s.push({type:"text",value:`
|
|
312
|
-
`});const c={type:"element",tagName:"li",properties:i,children:s};return e.patch(t,c),e.applyData(t,c)}function ij(e){let t=!1;if(e.type==="list"){t=e.spread||!1;const r=e.children;let n=-1;for(;!t&&++n<r.length;)t=FA(r[n])}return t}function FA(e){const t=e.spread;return t??e.children.length>1}function oj(e,t){const r={},n=e.all(t);let a=-1;for(typeof t.start=="number"&&t.start!==1&&(r.start=t.start);++a<n.length;){const s=n[a];if(s.type==="element"&&s.tagName==="li"&&s.properties&&Array.isArray(s.properties.className)&&s.properties.className.includes("task-list-item")){r.className=["contains-task-list"];break}}const i={type:"element",tagName:t.ordered?"ol":"ul",properties:r,children:e.wrap(n,!0)};return e.patch(t,i),e.applyData(t,i)}function sj(e,t){const r={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function lj(e,t){const r={type:"root",children:e.wrap(e.all(t))};return e.patch(t,r),e.applyData(t,r)}function uj(e,t){const r={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function cj(e,t){const r=e.all(t),n=r.shift(),a=[];if(n){const s={type:"element",tagName:"thead",properties:{},children:e.wrap([n],!0)};e.patch(t.children[0],s),a.push(s)}if(r.length>0){const s={type:"element",tagName:"tbody",properties:{},children:e.wrap(r,!0)},l=Ih(t.children[1]),u=bA(t.children[t.children.length-1]);l&&u&&(s.position={start:l,end:u}),a.push(s)}const i={type:"element",tagName:"table",properties:{},children:e.wrap(a,!0)};return e.patch(t,i),e.applyData(t,i)}function dj(e,t,r){const n=r?r.children:void 0,i=(n?n.indexOf(t):1)===0?"th":"td",s=r&&r.type==="table"?r.align:void 0,l=s?s.length:t.children.length;let u=-1;const c=[];for(;++u<l;){const p=t.children[u],m={},g=s?s[u]:void 0;g&&(m.align=g);let x={type:"element",tagName:i,properties:m,children:[]};p&&(x.children=e.all(p),e.patch(p,x),x=e.applyData(p,x)),c.push(x)}const d={type:"element",tagName:"tr",properties:{},children:e.wrap(c,!0)};return e.patch(t,d),e.applyData(t,d)}function pj(e,t){const r={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}const d0=9,p0=32;function gj(e){const t=String(e),r=/\r?\n|\r/g;let n=r.exec(t),a=0;const i=[];for(;n;)i.push(g0(t.slice(a,n.index),a>0,!0),n[0]),a=n.index+n[0].length,n=r.exec(t);return i.push(g0(t.slice(a),a>0,!1)),i.join("")}function g0(e,t,r){let n=0,a=e.length;if(t){let i=e.codePointAt(n);for(;i===d0||i===p0;)n++,i=e.codePointAt(n)}if(r){let i=e.codePointAt(a-1);for(;i===d0||i===p0;)a--,i=e.codePointAt(a-1)}return a>n?e.slice(n,a):""}function mj(e,t){const r={type:"text",value:gj(String(t.value))};return e.patch(t,r),e.applyData(t,r)}function fj(e,t){const r={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,r),e.applyData(t,r)}const hj={blockquote:
|
|
312
|
+
`});const c={type:"element",tagName:"li",properties:i,children:s};return e.patch(t,c),e.applyData(t,c)}function ij(e){let t=!1;if(e.type==="list"){t=e.spread||!1;const r=e.children;let n=-1;for(;!t&&++n<r.length;)t=FA(r[n])}return t}function FA(e){const t=e.spread;return t??e.children.length>1}function oj(e,t){const r={},n=e.all(t);let a=-1;for(typeof t.start=="number"&&t.start!==1&&(r.start=t.start);++a<n.length;){const s=n[a];if(s.type==="element"&&s.tagName==="li"&&s.properties&&Array.isArray(s.properties.className)&&s.properties.className.includes("task-list-item")){r.className=["contains-task-list"];break}}const i={type:"element",tagName:t.ordered?"ol":"ul",properties:r,children:e.wrap(n,!0)};return e.patch(t,i),e.applyData(t,i)}function sj(e,t){const r={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function lj(e,t){const r={type:"root",children:e.wrap(e.all(t))};return e.patch(t,r),e.applyData(t,r)}function uj(e,t){const r={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function cj(e,t){const r=e.all(t),n=r.shift(),a=[];if(n){const s={type:"element",tagName:"thead",properties:{},children:e.wrap([n],!0)};e.patch(t.children[0],s),a.push(s)}if(r.length>0){const s={type:"element",tagName:"tbody",properties:{},children:e.wrap(r,!0)},l=Ih(t.children[1]),u=bA(t.children[t.children.length-1]);l&&u&&(s.position={start:l,end:u}),a.push(s)}const i={type:"element",tagName:"table",properties:{},children:e.wrap(a,!0)};return e.patch(t,i),e.applyData(t,i)}function dj(e,t,r){const n=r?r.children:void 0,i=(n?n.indexOf(t):1)===0?"th":"td",s=r&&r.type==="table"?r.align:void 0,l=s?s.length:t.children.length;let u=-1;const c=[];for(;++u<l;){const p=t.children[u],m={},g=s?s[u]:void 0;g&&(m.align=g);let x={type:"element",tagName:i,properties:m,children:[]};p&&(x.children=e.all(p),e.patch(p,x),x=e.applyData(p,x)),c.push(x)}const d={type:"element",tagName:"tr",properties:{},children:e.wrap(c,!0)};return e.patch(t,d),e.applyData(t,d)}function pj(e,t){const r={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}const d0=9,p0=32;function gj(e){const t=String(e),r=/\r?\n|\r/g;let n=r.exec(t),a=0;const i=[];for(;n;)i.push(g0(t.slice(a,n.index),a>0,!0),n[0]),a=n.index+n[0].length,n=r.exec(t);return i.push(g0(t.slice(a),a>0,!1)),i.join("")}function g0(e,t,r){let n=0,a=e.length;if(t){let i=e.codePointAt(n);for(;i===d0||i===p0;)n++,i=e.codePointAt(n)}if(r){let i=e.codePointAt(a-1);for(;i===d0||i===p0;)a--,i=e.codePointAt(a-1)}return a>n?e.slice(n,a):""}function mj(e,t){const r={type:"text",value:gj(String(t.value))};return e.patch(t,r),e.applyData(t,r)}function fj(e,t){const r={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,r),e.applyData(t,r)}const hj={blockquote:H5,break:V5,code:W5,delete:Y5,emphasis:K5,footnoteReference:Z5,heading:X5,html:Q5,imageReference:J5,image:ej,inlineCode:tj,linkReference:rj,link:nj,listItem:aj,list:oj,paragraph:sj,root:lj,strong:uj,table:cj,tableCell:pj,tableRow:dj,text:mj,thematicBreak:fj,toml:lo,yaml:lo,definition:lo,footnoteDefinition:lo};function lo(){}const PA=-1,Gs=0,ri=1,hs=2,Fh=3,Ph=4,Uh=5,Bh=6,UA=7,BA=8,m0=typeof self=="object"?self:globalThis,bj=(e,t)=>{const r=(a,i)=>(e.set(i,a),a),n=a=>{if(e.has(a))return e.get(a);const[i,s]=t[a];switch(i){case Gs:case PA:return r(s,a);case ri:{const l=r([],a);for(const u of s)l.push(n(u));return l}case hs:{const l=r({},a);for(const[u,c]of s)l[n(u)]=n(c);return l}case Fh:return r(new Date(s),a);case Ph:{const{source:l,flags:u}=s;return r(new RegExp(l,u),a)}case Uh:{const l=r(new Map,a);for(const[u,c]of s)l.set(n(u),n(c));return l}case Bh:{const l=r(new Set,a);for(const u of s)l.add(n(u));return l}case UA:{const{name:l,message:u}=s;return r(new m0[l](u),a)}case BA:return r(BigInt(s),a);case"BigInt":return r(Object(BigInt(s)),a);case"ArrayBuffer":return r(new Uint8Array(s).buffer,s);case"DataView":{const{buffer:l}=new Uint8Array(s);return r(new DataView(l),s)}}return r(new m0[i](s),a)};return n},f0=e=>bj(new Map,e)(0),On="",{toString:yj}={},{keys:xj}=Object,Da=e=>{const t=typeof e;if(t!=="object"||!e)return[Gs,t];const r=yj.call(e).slice(8,-1);switch(r){case"Array":return[ri,On];case"Object":return[hs,On];case"Date":return[Fh,On];case"RegExp":return[Ph,On];case"Map":return[Uh,On];case"Set":return[Bh,On];case"DataView":return[ri,r]}return r.includes("Array")?[ri,r]:r.includes("Error")?[UA,r]:[hs,r]},uo=([e,t])=>e===Gs&&(t==="function"||t==="symbol"),vj=(e,t,r,n)=>{const a=(s,l)=>{const u=n.push(s)-1;return r.set(l,u),u},i=s=>{if(r.has(s))return r.get(s);let[l,u]=Da(s);switch(l){case Gs:{let d=s;switch(u){case"bigint":l=BA,d=s.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+u);d=null;break;case"undefined":return a([PA],s)}return a([l,d],s)}case ri:{if(u){let m=s;return u==="DataView"?m=new Uint8Array(s.buffer):u==="ArrayBuffer"&&(m=new Uint8Array(s)),a([u,[...m]],s)}const d=[],p=a([l,d],s);for(const m of s)d.push(i(m));return p}case hs:{if(u)switch(u){case"BigInt":return a([u,s.toString()],s);case"Boolean":case"Number":case"String":return a([u,s.valueOf()],s)}if(t&&"toJSON"in s)return i(s.toJSON());const d=[],p=a([l,d],s);for(const m of xj(s))(e||!uo(Da(s[m])))&&d.push([i(m),i(s[m])]);return p}case Fh:return a([l,s.toISOString()],s);case Ph:{const{source:d,flags:p}=s;return a([l,{source:d,flags:p}],s)}case Uh:{const d=[],p=a([l,d],s);for(const[m,g]of s)(e||!(uo(Da(m))||uo(Da(g))))&&d.push([i(m),i(g)]);return p}case Bh:{const d=[],p=a([l,d],s);for(const m of s)(e||!uo(Da(m)))&&d.push(i(m));return p}}const{message:c}=s;return a([l,{name:u,message:c}],s)};return i},h0=(e,{json:t,lossy:r}={})=>{const n=[];return vj(!(t||r),!!t,new Map,n)(e),n},bs=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?f0(h0(e,t)):structuredClone(e):(e,t)=>f0(h0(e,t));function Ej(e,t){const r=[{type:"text",value:"↩"}];return t>1&&r.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),r}function Sj(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function kj(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=e.options.footnoteBackContent||Ej,n=e.options.footnoteBackLabel||Sj,a=e.options.footnoteLabel||"Footnotes",i=e.options.footnoteLabelTagName||"h2",s=e.options.footnoteLabelProperties||{className:["sr-only"]},l=[];let u=-1;for(;++u<e.footnoteOrder.length;){const c=e.footnoteById.get(e.footnoteOrder[u]);if(!c)continue;const d=e.all(c),p=String(c.identifier).toUpperCase(),m=va(p.toLowerCase());let g=0;const x=[],v=e.footnoteCounts.get(p);for(;v!==void 0&&++g<=v;){x.length>0&&x.push({type:"text",value:" "});let y=typeof r=="string"?r:r(u,g);typeof y=="string"&&(y={type:"text",value:y}),x.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+m+(g>1?"-"+g:""),dataFootnoteBackref:"",ariaLabel:typeof n=="string"?n:n(u,g),className:["data-footnote-backref"]},children:Array.isArray(y)?y:[y]})}const N=d[d.length-1];if(N&&N.type==="element"&&N.tagName==="p"){const y=N.children[N.children.length-1];y&&y.type==="text"?y.value+=" ":N.children.push({type:"text",value:" "}),N.children.push(...x)}else d.push(...x);const h={type:"element",tagName:"li",properties:{id:t+"fn-"+m},children:e.wrap(d,!0)};e.patch(c,h),l.push(h)}if(l.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:i,properties:{...bs(s),id:"footnote-label"},children:[{type:"text",value:a}]},{type:"text",value:`
|
|
313
313
|
`},{type:"element",tagName:"ol",properties:{},children:e.wrap(l,!0)},{type:"text",value:`
|
|
314
314
|
`}]}}const $A=function(e){if(e==null)return Tj;if(typeof e=="function")return qs(e);if(typeof e=="object")return Array.isArray(e)?wj(e):Nj(e);if(typeof e=="string")return Aj(e);throw new Error("Expected function, string, or object as test")};function wj(e){const t=[];let r=-1;for(;++r<e.length;)t[r]=$A(e[r]);return qs(n);function n(...a){let i=-1;for(;++i<t.length;)if(t[i].apply(this,a))return!0;return!1}}function Nj(e){const t=e;return qs(r);function r(n){const a=n;let i;for(i in e)if(a[i]!==t[i])return!1;return!0}}function Aj(e){return qs(t);function t(r){return r&&r.type===e}}function qs(e){return t;function t(r,n,a){return!!(Cj(r)&&e.call(this,r,typeof n=="number"?n:void 0,a||void 0))}}function Tj(){return!0}function Cj(e){return e!==null&&typeof e=="object"&&"type"in e}const zA=[],Rj=!0,b0=!1,Ij="skip";function _j(e,t,r,n){let a;typeof t=="function"&&typeof r!="function"?(n=r,r=t):a=t;const i=$A(a),s=n?-1:1;l(e,void 0,[])();function l(u,c,d){const p=u&&typeof u=="object"?u:{};if(typeof p.type=="string"){const g=typeof p.tagName=="string"?p.tagName:typeof p.name=="string"?p.name:void 0;Object.defineProperty(m,"name",{value:"node ("+(u.type+(g?"<"+g+">":""))+")"})}return m;function m(){let g=zA,x,v,N;if((!t||i(u,c,d[d.length-1]||void 0))&&(g=Oj(r(u,d)),g[0]===b0))return g;if("children"in u&&u.children){const h=u;if(h.children&&g[0]!==Ij)for(v=(n?h.children.length:-1)+s,N=d.concat(h);v>-1&&v<h.children.length;){const y=h.children[v];if(x=l(y,v,N)(),x[0]===b0)return x;v=typeof x[1]=="number"?x[1]:v+s}}return g}}}function Oj(e){return Array.isArray(e)?e:typeof e=="number"?[Rj,e]:e==null?zA:[e]}function GA(e,t,r,n){let a,i,s;typeof t=="function"&&typeof r!="function"?(i=void 0,s=t,a=r):(i=t,s=r,a=n),_j(e,i,l,a);function l(u,c){const d=c[c.length-1],p=d?d.children.indexOf(u):void 0;return s(u,p,d)}}const uf={}.hasOwnProperty,Lj={};function Dj(e,t){const r=t||Lj,n=new Map,a=new Map,i=new Map,s={...hj,...r.handlers},l={all:c,applyData:jj,definitionById:n,footnoteById:a,footnoteCounts:i,footnoteOrder:[],handlers:s,one:u,options:r,patch:Mj,wrap:Pj};return GA(e,function(d){if(d.type==="definition"||d.type==="footnoteDefinition"){const p=d.type==="definition"?n:a,m=String(d.identifier).toUpperCase();p.has(m)||p.set(m,d)}}),l;function u(d,p){const m=d.type,g=l.handlers[m];if(uf.call(l.handlers,m)&&g)return g(l,d,p);if(l.options.passThrough&&l.options.passThrough.includes(m)){if("children"in d){const{children:v,...N}=d,h=bs(N);return h.children=l.all(d),h}return bs(d)}return(l.options.unknownHandler||Fj)(l,d,p)}function c(d){const p=[];if("children"in d){const m=d.children;let g=-1;for(;++g<m.length;){const x=l.one(m[g],d);if(x){if(g&&m[g-1].type==="break"&&(!Array.isArray(x)&&x.type==="text"&&(x.value=y0(x.value)),!Array.isArray(x)&&x.type==="element")){const v=x.children[0];v&&v.type==="text"&&(v.value=y0(v.value))}Array.isArray(x)?p.push(...x):p.push(x)}}}return p}}function Mj(e,t){e.position&&(t.position=yD(e))}function jj(e,t){let r=t;if(e&&e.data){const n=e.data.hName,a=e.data.hChildren,i=e.data.hProperties;if(typeof n=="string")if(r.type==="element")r.tagName=n;else{const s="children"in r?r.children:[r];r={type:"element",tagName:n,properties:{},children:s}}r.type==="element"&&i&&Object.assign(r.properties,bs(i)),"children"in r&&r.children&&a!==null&&a!==void 0&&(r.children=a)}return r}function Fj(e,t){const r=t.data||{},n="value"in t&&!(uf.call(r,"hProperties")||uf.call(r,"hChildren"))?{type:"text",value:t.value}:{type:"element",tagName:"div",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Pj(e,t){const r=[];let n=-1;for(t&&r.push({type:"text",value:`
|
|
315
315
|
`});++n<e.length;)n&&r.push({type:"text",value:`
|
|
316
316
|
`}),r.push(e[n]);return t&&e.length>0&&r.push({type:"text",value:`
|
|
317
317
|
`}),r}function y0(e){let t=0,r=e.charCodeAt(t);for(;r===9||r===32;)t++,r=e.charCodeAt(t);return e.slice(t)}function x0(e,t){const r=Dj(e,t),n=r.one(e,void 0),a=kj(r),i=Array.isArray(n)?{type:"root",children:n}:n||{type:"root",children:[]};return a&&i.children.push({type:"text",value:`
|
|
318
|
-
`},a),i}function Uj(e,t){return e&&"run"in e?async function(r,n){const a=x0(r,{file:n,...t});await e.run(a,n)}:function(r,n){return x0(r,{file:n,...e||t})}}function v0(e){if(e)throw e}var Do=Object.prototype.hasOwnProperty,qA=Object.prototype.toString,E0=Object.defineProperty,S0=Object.getOwnPropertyDescriptor,k0=function(t){return typeof Array.isArray=="function"?Array.isArray(t):qA.call(t)==="[object Array]"},w0=function(t){if(!t||qA.call(t)!=="[object Object]")return!1;var r=Do.call(t,"constructor"),n=t.constructor&&t.constructor.prototype&&Do.call(t.constructor.prototype,"isPrototypeOf");if(t.constructor&&!r&&!n)return!1;var a;for(a in t);return typeof a>"u"||Do.call(t,a)},N0=function(t,r){E0&&r.name==="__proto__"?E0(t,r.name,{enumerable:!0,configurable:!0,value:r.newValue,writable:!0}):t[r.name]=r.newValue},A0=function(t,r){if(r==="__proto__")if(Do.call(t,r)){if(S0)return S0(t,r).value}else return;return t[r]},Bj=function e(){var t,r,n,a,i,s,l=arguments[0],u=1,c=arguments.length,d=!1;for(typeof l=="boolean"&&(d=l,l=arguments[1]||{},u=2),(l==null||typeof l!="object"&&typeof l!="function")&&(l={});u<c;++u)if(t=arguments[u],t!=null)for(r in t)n=A0(l,r),a=A0(t,r),l!==a&&(d&&a&&(w0(a)||(i=k0(a)))?(i?(i=!1,s=n&&k0(n)?n:[]):s=n&&w0(n)?n:{},N0(l,{name:r,newValue:e(d,s,a)})):typeof a<"u"&&N0(l,{name:r,newValue:a}));return l};const Ol=Ai(Bj);function cf(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function $j(){const e=[],t={run:r,use:n};return t;function r(...a){let i=-1;const s=a.pop();if(typeof s!="function")throw new TypeError("Expected function as last argument, not "+s);l(null,...a);function l(u,...c){const d=e[++i];let p=-1;if(u){s(u);return}for(;++p<a.length;)(c[p]===null||c[p]===void 0)&&(c[p]=a[p]);a=c,d?zj(d,l)(...c):s(null,...c)}}function n(a){if(typeof a!="function")throw new TypeError("Expected `middelware` to be a function, not "+a);return e.push(a),t}}function zj(e,t){let r;return n;function n(...s){const l=e.length>s.length;let u;l&&s.push(a);try{u=e.apply(this,s)}catch(c){const d=c;if(l&&r)throw d;return a(d)}l||(u&&u.then&&typeof u.then=="function"?u.then(i,a):u instanceof Error?a(u):i(u))}function a(s,...l){r||(r=!0,t(s,...l))}function i(s){a(null,s)}}const Xt={basename:Gj,dirname:qj,extname:Hj,join:Vj,sep:"/"};function Gj(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');ji(e);let r=0,n=-1,a=e.length,i;if(t===void 0||t.length===0||t.length>e.length){for(;a--;)if(e.codePointAt(a)===47){if(i){r=a+1;break}}else n<0&&(i=!0,n=a+1);return n<0?"":e.slice(r,n)}if(t===e)return"";let s=-1,l=t.length-1;for(;a--;)if(e.codePointAt(a)===47){if(i){r=a+1;break}}else s<0&&(i=!0,s=a+1),l>-1&&(e.codePointAt(a)===t.codePointAt(l--)?l<0&&(n=a):(l=-1,n=s));return r===n?n=s:n<0&&(n=e.length),e.slice(r,n)}function qj(e){if(ji(e),e.length===0)return".";let t=-1,r=e.length,n;for(;--r;)if(e.codePointAt(r)===47){if(n){t=r;break}}else n||(n=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function Hj(e){ji(e);let t=e.length,r=-1,n=0,a=-1,i=0,s;for(;t--;){const l=e.codePointAt(t);if(l===47){if(s){n=t+1;break}continue}r<0&&(s=!0,r=t+1),l===46?a<0?a=t:i!==1&&(i=1):a>-1&&(i=-1)}return a<0||r<0||i===0||i===1&&a===r-1&&a===n+1?"":e.slice(a,r)}function Vj(...e){let t=-1,r;for(;++t<e.length;)ji(e[t]),e[t]&&(r=r===void 0?e[t]:r+"/"+e[t]);return r===void 0?".":Wj(r)}function Wj(e){ji(e);const t=e.codePointAt(0)===47;let r=Yj(e,!t);return r.length===0&&!t&&(r="."),r.length>0&&e.codePointAt(e.length-1)===47&&(r+="/"),t?"/"+r:r}function Yj(e,t){let r="",n=0,a=-1,i=0,s=-1,l,u;for(;++s<=e.length;){if(s<e.length)l=e.codePointAt(s);else{if(l===47)break;l=47}if(l===47){if(!(a===s-1||i===1))if(a!==s-1&&i===2){if(r.length<2||n!==2||r.codePointAt(r.length-1)!==46||r.codePointAt(r.length-2)!==46){if(r.length>2){if(u=r.lastIndexOf("/"),u!==r.length-1){u<0?(r="",n=0):(r=r.slice(0,u),n=r.length-1-r.lastIndexOf("/")),a=s,i=0;continue}}else if(r.length>0){r="",n=0,a=s,i=0;continue}}t&&(r=r.length>0?r+"/..":"..",n=2)}else r.length>0?r+="/"+e.slice(a+1,s):r=e.slice(a+1,s),n=s-a-1;a=s,i=0}else l===46&&i>-1?i++:i=-1}return r}function ji(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const Kj={cwd:Zj};function Zj(){return"/"}function df(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function Xj(e){if(typeof e=="string")e=new URL(e);else if(!df(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){const t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return Qj(e)}function Qj(e){if(e.hostname!==""){const n=new TypeError('File URL host must be "localhost" or empty on darwin');throw n.code="ERR_INVALID_FILE_URL_HOST",n}const t=e.pathname;let r=-1;for(;++r<t.length;)if(t.codePointAt(r)===37&&t.codePointAt(r+1)===50){const n=t.codePointAt(r+2);if(n===70||n===102){const a=new TypeError("File URL path must not include encoded / characters");throw a.code="ERR_INVALID_FILE_URL_PATH",a}}return decodeURIComponent(t)}const Ll=["history","path","basename","stem","extname","dirname"];class HA{constructor(t){let r;t?df(t)?r={path:t}:typeof t=="string"||Jj(t)?r={value:t}:r=t:r={},this.cwd="cwd"in r?"":Kj.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let n=-1;for(;++n<Ll.length;){const i=Ll[n];i in r&&r[i]!==void 0&&r[i]!==null&&(this[i]=i==="history"?[...r[i]]:r[i])}let a;for(a in r)Ll.includes(a)||(this[a]=r[a])}get basename(){return typeof this.path=="string"?Xt.basename(this.path):void 0}set basename(t){Ml(t,"basename"),Dl(t,"basename"),this.path=Xt.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?Xt.dirname(this.path):void 0}set dirname(t){T0(this.basename,"dirname"),this.path=Xt.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?Xt.extname(this.path):void 0}set extname(t){if(Dl(t,"extname"),T0(this.dirname,"extname"),t){if(t.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(t.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=Xt.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){df(t)&&(t=Xj(t)),Ml(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?Xt.basename(this.path,this.extname):void 0}set stem(t){Ml(t,"stem"),Dl(t,"stem"),this.path=Xt.join(this.dirname||"",t+(this.extname||""))}fail(t,r,n){const a=this.message(t,r,n);throw a.fatal=!0,a}info(t,r,n){const a=this.message(t,r,n);return a.fatal=void 0,a}message(t,r,n){const a=new Qe(t,r,n);return this.path&&(a.name=this.path+":"+a.name,a.file=this.path),a.fatal=!1,this.messages.push(a),a}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}}function Dl(e,t){if(e&&e.includes(Xt.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+Xt.sep+"`")}function Ml(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function T0(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function Jj(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const eF=function(e){const n=this.constructor.prototype,a=n[e],i=function(){return a.apply(i,arguments)};return Object.setPrototypeOf(i,n),i},tF={}.hasOwnProperty;class $h extends eF{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=$j()}copy(){const t=new $h;let r=-1;for(;++r<this.attachers.length;){const n=this.attachers[r];t.use(...n)}return t.data(Ol(!0,{},this.namespace)),t}data(t,r){return typeof t=="string"?arguments.length===2?(Pl("data",this.frozen),this.namespace[t]=r,this):tF.call(this.namespace,t)&&this.namespace[t]||void 0:t?(Pl("data",this.frozen),this.namespace=t,this):this.namespace}freeze(){if(this.frozen)return this;const t=this;for(;++this.freezeIndex<this.attachers.length;){const[r,...n]=this.attachers[this.freezeIndex];if(n[0]===!1)continue;n[0]===!0&&(n[0]=void 0);const a=r.call(t,...n);typeof a=="function"&&this.transformers.use(a)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();const r=co(t),n=this.parser||this.Parser;return jl("parse",n),n(String(r),r)}process(t,r){const n=this;return this.freeze(),jl("process",this.parser||this.Parser),Fl("process",this.compiler||this.Compiler),r?a(void 0,r):new Promise(a);function a(i,s){const l=co(t),u=n.parse(l);n.run(u,l,function(d,p,m){if(d||!p||!m)return c(d);const g=p,x=n.stringify(g,m);aF(x)?m.value=x:m.result=x,c(d,m)});function c(d,p){d||!p?s(d):i?i(p):r(void 0,p)}}}processSync(t){let r=!1,n;return this.freeze(),jl("processSync",this.parser||this.Parser),Fl("processSync",this.compiler||this.Compiler),this.process(t,a),R0("processSync","process",r),n;function a(i,s){r=!0,v0(i),n=s}}run(t,r,n){C0(t),this.freeze();const a=this.transformers;return!n&&typeof r=="function"&&(n=r,r=void 0),n?i(void 0,n):new Promise(i);function i(s,l){const u=co(r);a.run(t,u,c);function c(d,p,m){const g=p||t;d?l(d):s?s(g):n(void 0,g,m)}}}runSync(t,r){let n=!1,a;return this.run(t,r,i),R0("runSync","run",n),a;function i(s,l){v0(s),a=l,n=!0}}stringify(t,r){this.freeze();const n=co(r),a=this.compiler||this.Compiler;return Fl("stringify",a),C0(t),a(t,n)}use(t,...r){const n=this.attachers,a=this.namespace;if(Pl("use",this.frozen),t!=null)if(typeof t=="function")u(t,r);else if(typeof t=="object")Array.isArray(t)?l(t):s(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function i(c){if(typeof c=="function")u(c,[]);else if(typeof c=="object")if(Array.isArray(c)){const[d,...p]=c;u(d,p)}else s(c);else throw new TypeError("Expected usable value, not `"+c+"`")}function s(c){if(!("plugins"in c)&&!("settings"in c))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");l(c.plugins),c.settings&&(a.settings=Ol(!0,a.settings,c.settings))}function l(c){let d=-1;if(c!=null)if(Array.isArray(c))for(;++d<c.length;){const p=c[d];i(p)}else throw new TypeError("Expected a list of plugins, not `"+c+"`")}function u(c,d){let p=-1,m=-1;for(;++p<n.length;)if(n[p][0]===c){m=p;break}if(m===-1)n.push([c,...d]);else if(d.length>0){let[g,...x]=d;const v=n[m][1];cf(v)&&cf(g)&&(g=Ol(!0,v,g)),n[m]=[c,g,...x]}}}}const rF=new $h().freeze();function jl(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function Fl(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function Pl(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function C0(e){if(!cf(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function R0(e,t,r){if(!r)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function co(e){return nF(e)?e:new HA(e)}function nF(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function aF(e){return typeof e=="string"||iF(e)}function iF(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const oF="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",I0=[],_0={allowDangerousHtml:!0},sF=/^(https?|ircs?|mailto|xmpp)$/i,lF=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function uF(e){const t=cF(e),r=dF(e);return pF(t.runSync(t.parse(r),r),e)}function cF(e){const t=e.rehypePlugins||I0,r=e.remarkPlugins||I0,n=e.remarkRehypeOptions?{...e.remarkRehypeOptions,..._0}:_0;return rF().use(qM).use(r).use(Uj,n).use(t)}function dF(e){const t=e.children||"",r=new HA;return typeof t=="string"&&(r.value=t),r}function pF(e,t){const r=t.allowedElements,n=t.allowElement,a=t.components,i=t.disallowedElements,s=t.skipHtml,l=t.unwrapDisallowed,u=t.urlTransform||gF;for(const d of lF)Object.hasOwn(t,d.from)&&(""+d.from+(d.to?"use `"+d.to+"` instead":"remove it")+oF+d.id,void 0);return t.className&&(e={type:"element",tagName:"div",properties:{className:t.className},children:e.type==="root"?e.children:[e]}),GA(e,c),kD(e,{Fragment:o.Fragment,components:a,ignoreInvalidStyle:!0,jsx:o.jsx,jsxs:o.jsxs,passKeys:!0,passNode:!0});function c(d,p,m){if(d.type==="raw"&&m&&typeof p=="number")return s?m.children.splice(p,1):m.children[p]={type:"text",value:d.value},p;if(d.type==="element"){let g;for(g in Rl)if(Object.hasOwn(Rl,g)&&Object.hasOwn(d.properties,g)){const x=d.properties[g],v=Rl[g];(v===null||v.includes(d.tagName))&&(d.properties[g]=u(String(x||""),g,d))}}if(d.type==="element"){let g=r?!r.includes(d.tagName):i?i.includes(d.tagName):!1;if(!g&&n&&typeof p=="number"&&(g=!n(d,p,m)),g&&m&&typeof p=="number")return l&&d.children?m.children.splice(p,1,...d.children):m.children.splice(p,1),p}}}function gF(e){const t=e.indexOf(":"),r=e.indexOf("?"),n=e.indexOf("#"),a=e.indexOf("/");return t===-1||a!==-1&&t>a||r!==-1&&t>r||n!==-1&&t>n||sF.test(e.slice(0,t))?e:""}function mF(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}function fF(e,t){if(e==null)return{};var r,n,a=mF(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}function pf(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function hF(e){if(Array.isArray(e))return pf(e)}function bF(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function yF(e,t){if(e){if(typeof e=="string")return pf(e,t);var r={}.toString.call(e).slice(8,-1);return r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set"?Array.from(e):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?pf(e,t):void 0}}function xF(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
318
|
+
`},a),i}function Uj(e,t){return e&&"run"in e?async function(r,n){const a=x0(r,{file:n,...t});await e.run(a,n)}:function(r,n){return x0(r,{file:n,...e||t})}}function v0(e){if(e)throw e}var Do=Object.prototype.hasOwnProperty,qA=Object.prototype.toString,E0=Object.defineProperty,S0=Object.getOwnPropertyDescriptor,k0=function(t){return typeof Array.isArray=="function"?Array.isArray(t):qA.call(t)==="[object Array]"},w0=function(t){if(!t||qA.call(t)!=="[object Object]")return!1;var r=Do.call(t,"constructor"),n=t.constructor&&t.constructor.prototype&&Do.call(t.constructor.prototype,"isPrototypeOf");if(t.constructor&&!r&&!n)return!1;var a;for(a in t);return typeof a>"u"||Do.call(t,a)},N0=function(t,r){E0&&r.name==="__proto__"?E0(t,r.name,{enumerable:!0,configurable:!0,value:r.newValue,writable:!0}):t[r.name]=r.newValue},A0=function(t,r){if(r==="__proto__")if(Do.call(t,r)){if(S0)return S0(t,r).value}else return;return t[r]},Bj=function e(){var t,r,n,a,i,s,l=arguments[0],u=1,c=arguments.length,d=!1;for(typeof l=="boolean"&&(d=l,l=arguments[1]||{},u=2),(l==null||typeof l!="object"&&typeof l!="function")&&(l={});u<c;++u)if(t=arguments[u],t!=null)for(r in t)n=A0(l,r),a=A0(t,r),l!==a&&(d&&a&&(w0(a)||(i=k0(a)))?(i?(i=!1,s=n&&k0(n)?n:[]):s=n&&w0(n)?n:{},N0(l,{name:r,newValue:e(d,s,a)})):typeof a<"u"&&N0(l,{name:r,newValue:a}));return l};const Ol=Ai(Bj);function cf(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function $j(){const e=[],t={run:r,use:n};return t;function r(...a){let i=-1;const s=a.pop();if(typeof s!="function")throw new TypeError("Expected function as last argument, not "+s);l(null,...a);function l(u,...c){const d=e[++i];let p=-1;if(u){s(u);return}for(;++p<a.length;)(c[p]===null||c[p]===void 0)&&(c[p]=a[p]);a=c,d?zj(d,l)(...c):s(null,...c)}}function n(a){if(typeof a!="function")throw new TypeError("Expected `middelware` to be a function, not "+a);return e.push(a),t}}function zj(e,t){let r;return n;function n(...s){const l=e.length>s.length;let u;l&&s.push(a);try{u=e.apply(this,s)}catch(c){const d=c;if(l&&r)throw d;return a(d)}l||(u&&u.then&&typeof u.then=="function"?u.then(i,a):u instanceof Error?a(u):i(u))}function a(s,...l){r||(r=!0,t(s,...l))}function i(s){a(null,s)}}const Xt={basename:Gj,dirname:qj,extname:Hj,join:Vj,sep:"/"};function Gj(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');ji(e);let r=0,n=-1,a=e.length,i;if(t===void 0||t.length===0||t.length>e.length){for(;a--;)if(e.codePointAt(a)===47){if(i){r=a+1;break}}else n<0&&(i=!0,n=a+1);return n<0?"":e.slice(r,n)}if(t===e)return"";let s=-1,l=t.length-1;for(;a--;)if(e.codePointAt(a)===47){if(i){r=a+1;break}}else s<0&&(i=!0,s=a+1),l>-1&&(e.codePointAt(a)===t.codePointAt(l--)?l<0&&(n=a):(l=-1,n=s));return r===n?n=s:n<0&&(n=e.length),e.slice(r,n)}function qj(e){if(ji(e),e.length===0)return".";let t=-1,r=e.length,n;for(;--r;)if(e.codePointAt(r)===47){if(n){t=r;break}}else n||(n=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function Hj(e){ji(e);let t=e.length,r=-1,n=0,a=-1,i=0,s;for(;t--;){const l=e.codePointAt(t);if(l===47){if(s){n=t+1;break}continue}r<0&&(s=!0,r=t+1),l===46?a<0?a=t:i!==1&&(i=1):a>-1&&(i=-1)}return a<0||r<0||i===0||i===1&&a===r-1&&a===n+1?"":e.slice(a,r)}function Vj(...e){let t=-1,r;for(;++t<e.length;)ji(e[t]),e[t]&&(r=r===void 0?e[t]:r+"/"+e[t]);return r===void 0?".":Wj(r)}function Wj(e){ji(e);const t=e.codePointAt(0)===47;let r=Yj(e,!t);return r.length===0&&!t&&(r="."),r.length>0&&e.codePointAt(e.length-1)===47&&(r+="/"),t?"/"+r:r}function Yj(e,t){let r="",n=0,a=-1,i=0,s=-1,l,u;for(;++s<=e.length;){if(s<e.length)l=e.codePointAt(s);else{if(l===47)break;l=47}if(l===47){if(!(a===s-1||i===1))if(a!==s-1&&i===2){if(r.length<2||n!==2||r.codePointAt(r.length-1)!==46||r.codePointAt(r.length-2)!==46){if(r.length>2){if(u=r.lastIndexOf("/"),u!==r.length-1){u<0?(r="",n=0):(r=r.slice(0,u),n=r.length-1-r.lastIndexOf("/")),a=s,i=0;continue}}else if(r.length>0){r="",n=0,a=s,i=0;continue}}t&&(r=r.length>0?r+"/..":"..",n=2)}else r.length>0?r+="/"+e.slice(a+1,s):r=e.slice(a+1,s),n=s-a-1;a=s,i=0}else l===46&&i>-1?i++:i=-1}return r}function ji(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const Kj={cwd:Zj};function Zj(){return"/"}function df(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function Xj(e){if(typeof e=="string")e=new URL(e);else if(!df(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){const t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return Qj(e)}function Qj(e){if(e.hostname!==""){const n=new TypeError('File URL host must be "localhost" or empty on darwin');throw n.code="ERR_INVALID_FILE_URL_HOST",n}const t=e.pathname;let r=-1;for(;++r<t.length;)if(t.codePointAt(r)===37&&t.codePointAt(r+1)===50){const n=t.codePointAt(r+2);if(n===70||n===102){const a=new TypeError("File URL path must not include encoded / characters");throw a.code="ERR_INVALID_FILE_URL_PATH",a}}return decodeURIComponent(t)}const Ll=["history","path","basename","stem","extname","dirname"];class HA{constructor(t){let r;t?df(t)?r={path:t}:typeof t=="string"||Jj(t)?r={value:t}:r=t:r={},this.cwd="cwd"in r?"":Kj.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let n=-1;for(;++n<Ll.length;){const i=Ll[n];i in r&&r[i]!==void 0&&r[i]!==null&&(this[i]=i==="history"?[...r[i]]:r[i])}let a;for(a in r)Ll.includes(a)||(this[a]=r[a])}get basename(){return typeof this.path=="string"?Xt.basename(this.path):void 0}set basename(t){Ml(t,"basename"),Dl(t,"basename"),this.path=Xt.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?Xt.dirname(this.path):void 0}set dirname(t){T0(this.basename,"dirname"),this.path=Xt.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?Xt.extname(this.path):void 0}set extname(t){if(Dl(t,"extname"),T0(this.dirname,"extname"),t){if(t.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(t.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=Xt.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){df(t)&&(t=Xj(t)),Ml(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?Xt.basename(this.path,this.extname):void 0}set stem(t){Ml(t,"stem"),Dl(t,"stem"),this.path=Xt.join(this.dirname||"",t+(this.extname||""))}fail(t,r,n){const a=this.message(t,r,n);throw a.fatal=!0,a}info(t,r,n){const a=this.message(t,r,n);return a.fatal=void 0,a}message(t,r,n){const a=new Qe(t,r,n);return this.path&&(a.name=this.path+":"+a.name,a.file=this.path),a.fatal=!1,this.messages.push(a),a}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}}function Dl(e,t){if(e&&e.includes(Xt.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+Xt.sep+"`")}function Ml(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function T0(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function Jj(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const eF=function(e){const n=this.constructor.prototype,a=n[e],i=function(){return a.apply(i,arguments)};return Object.setPrototypeOf(i,n),i},tF={}.hasOwnProperty;class $h extends eF{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=$j()}copy(){const t=new $h;let r=-1;for(;++r<this.attachers.length;){const n=this.attachers[r];t.use(...n)}return t.data(Ol(!0,{},this.namespace)),t}data(t,r){return typeof t=="string"?arguments.length===2?(Pl("data",this.frozen),this.namespace[t]=r,this):tF.call(this.namespace,t)&&this.namespace[t]||void 0:t?(Pl("data",this.frozen),this.namespace=t,this):this.namespace}freeze(){if(this.frozen)return this;const t=this;for(;++this.freezeIndex<this.attachers.length;){const[r,...n]=this.attachers[this.freezeIndex];if(n[0]===!1)continue;n[0]===!0&&(n[0]=void 0);const a=r.call(t,...n);typeof a=="function"&&this.transformers.use(a)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();const r=co(t),n=this.parser||this.Parser;return jl("parse",n),n(String(r),r)}process(t,r){const n=this;return this.freeze(),jl("process",this.parser||this.Parser),Fl("process",this.compiler||this.Compiler),r?a(void 0,r):new Promise(a);function a(i,s){const l=co(t),u=n.parse(l);n.run(u,l,function(d,p,m){if(d||!p||!m)return c(d);const g=p,x=n.stringify(g,m);aF(x)?m.value=x:m.result=x,c(d,m)});function c(d,p){d||!p?s(d):i?i(p):r(void 0,p)}}}processSync(t){let r=!1,n;return this.freeze(),jl("processSync",this.parser||this.Parser),Fl("processSync",this.compiler||this.Compiler),this.process(t,a),R0("processSync","process",r),n;function a(i,s){r=!0,v0(i),n=s}}run(t,r,n){C0(t),this.freeze();const a=this.transformers;return!n&&typeof r=="function"&&(n=r,r=void 0),n?i(void 0,n):new Promise(i);function i(s,l){const u=co(r);a.run(t,u,c);function c(d,p,m){const g=p||t;d?l(d):s?s(g):n(void 0,g,m)}}}runSync(t,r){let n=!1,a;return this.run(t,r,i),R0("runSync","run",n),a;function i(s,l){v0(s),a=l,n=!0}}stringify(t,r){this.freeze();const n=co(r),a=this.compiler||this.Compiler;return Fl("stringify",a),C0(t),a(t,n)}use(t,...r){const n=this.attachers,a=this.namespace;if(Pl("use",this.frozen),t!=null)if(typeof t=="function")u(t,r);else if(typeof t=="object")Array.isArray(t)?l(t):s(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function i(c){if(typeof c=="function")u(c,[]);else if(typeof c=="object")if(Array.isArray(c)){const[d,...p]=c;u(d,p)}else s(c);else throw new TypeError("Expected usable value, not `"+c+"`")}function s(c){if(!("plugins"in c)&&!("settings"in c))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");l(c.plugins),c.settings&&(a.settings=Ol(!0,a.settings,c.settings))}function l(c){let d=-1;if(c!=null)if(Array.isArray(c))for(;++d<c.length;){const p=c[d];i(p)}else throw new TypeError("Expected a list of plugins, not `"+c+"`")}function u(c,d){let p=-1,m=-1;for(;++p<n.length;)if(n[p][0]===c){m=p;break}if(m===-1)n.push([c,...d]);else if(d.length>0){let[g,...x]=d;const v=n[m][1];cf(v)&&cf(g)&&(g=Ol(!0,v,g)),n[m]=[c,g,...x]}}}}const rF=new $h().freeze();function jl(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function Fl(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function Pl(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function C0(e){if(!cf(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function R0(e,t,r){if(!r)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function co(e){return nF(e)?e:new HA(e)}function nF(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function aF(e){return typeof e=="string"||iF(e)}function iF(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const oF="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",I0=[],_0={allowDangerousHtml:!0},sF=/^(https?|ircs?|mailto|xmpp)$/i,lF=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function uF(e){const t=cF(e),r=dF(e);return pF(t.runSync(t.parse(r),r),e)}function cF(e){const t=e.rehypePlugins||I0,r=e.remarkPlugins||I0,n=e.remarkRehypeOptions?{...e.remarkRehypeOptions,..._0}:_0;return rF().use(q5).use(r).use(Uj,n).use(t)}function dF(e){const t=e.children||"",r=new HA;return typeof t=="string"&&(r.value=t),r}function pF(e,t){const r=t.allowedElements,n=t.allowElement,a=t.components,i=t.disallowedElements,s=t.skipHtml,l=t.unwrapDisallowed,u=t.urlTransform||gF;for(const d of lF)Object.hasOwn(t,d.from)&&(""+d.from+(d.to?"use `"+d.to+"` instead":"remove it")+oF+d.id,void 0);return t.className&&(e={type:"element",tagName:"div",properties:{className:t.className},children:e.type==="root"?e.children:[e]}),GA(e,c),kD(e,{Fragment:o.Fragment,components:a,ignoreInvalidStyle:!0,jsx:o.jsx,jsxs:o.jsxs,passKeys:!0,passNode:!0});function c(d,p,m){if(d.type==="raw"&&m&&typeof p=="number")return s?m.children.splice(p,1):m.children[p]={type:"text",value:d.value},p;if(d.type==="element"){let g;for(g in Rl)if(Object.hasOwn(Rl,g)&&Object.hasOwn(d.properties,g)){const x=d.properties[g],v=Rl[g];(v===null||v.includes(d.tagName))&&(d.properties[g]=u(String(x||""),g,d))}}if(d.type==="element"){let g=r?!r.includes(d.tagName):i?i.includes(d.tagName):!1;if(!g&&n&&typeof p=="number"&&(g=!n(d,p,m)),g&&m&&typeof p=="number")return l&&d.children?m.children.splice(p,1,...d.children):m.children.splice(p,1),p}}}function gF(e){const t=e.indexOf(":"),r=e.indexOf("?"),n=e.indexOf("#"),a=e.indexOf("/");return t===-1||a!==-1&&t>a||r!==-1&&t>r||n!==-1&&t>n||sF.test(e.slice(0,t))?e:""}function mF(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}function fF(e,t){if(e==null)return{};var r,n,a=mF(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}function pf(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function hF(e){if(Array.isArray(e))return pf(e)}function bF(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function yF(e,t){if(e){if(typeof e=="string")return pf(e,t);var r={}.toString.call(e).slice(8,-1);return r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set"?Array.from(e):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?pf(e,t):void 0}}function xF(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
319
319
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function gf(e){return hF(e)||bF(e)||yF(e)||xF()}function Ni(e){"@babel/helpers - typeof";return Ni=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ni(e)}function vF(e,t){if(Ni(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Ni(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function EF(e){var t=vF(e,"string");return Ni(t)=="symbol"?t:t+""}function VA(e,t,r){return(t=EF(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function mf(){return mf=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},mf.apply(null,arguments)}function O0(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function Kn(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?O0(Object(r),!0).forEach(function(n){VA(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):O0(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function SF(e){var t=e.length;if(t===0||t===1)return e;if(t===2)return[e[0],e[1],"".concat(e[0],".").concat(e[1]),"".concat(e[1],".").concat(e[0])];if(t===3)return[e[0],e[1],e[2],"".concat(e[0],".").concat(e[1]),"".concat(e[0],".").concat(e[2]),"".concat(e[1],".").concat(e[0]),"".concat(e[1],".").concat(e[2]),"".concat(e[2],".").concat(e[0]),"".concat(e[2],".").concat(e[1]),"".concat(e[0],".").concat(e[1],".").concat(e[2]),"".concat(e[0],".").concat(e[2],".").concat(e[1]),"".concat(e[1],".").concat(e[0],".").concat(e[2]),"".concat(e[1],".").concat(e[2],".").concat(e[0]),"".concat(e[2],".").concat(e[0],".").concat(e[1]),"".concat(e[2],".").concat(e[1],".").concat(e[0])];if(t>=4)return[e[0],e[1],e[2],e[3],"".concat(e[0],".").concat(e[1]),"".concat(e[0],".").concat(e[2]),"".concat(e[0],".").concat(e[3]),"".concat(e[1],".").concat(e[0]),"".concat(e[1],".").concat(e[2]),"".concat(e[1],".").concat(e[3]),"".concat(e[2],".").concat(e[0]),"".concat(e[2],".").concat(e[1]),"".concat(e[2],".").concat(e[3]),"".concat(e[3],".").concat(e[0]),"".concat(e[3],".").concat(e[1]),"".concat(e[3],".").concat(e[2]),"".concat(e[0],".").concat(e[1],".").concat(e[2]),"".concat(e[0],".").concat(e[1],".").concat(e[3]),"".concat(e[0],".").concat(e[2],".").concat(e[1]),"".concat(e[0],".").concat(e[2],".").concat(e[3]),"".concat(e[0],".").concat(e[3],".").concat(e[1]),"".concat(e[0],".").concat(e[3],".").concat(e[2]),"".concat(e[1],".").concat(e[0],".").concat(e[2]),"".concat(e[1],".").concat(e[0],".").concat(e[3]),"".concat(e[1],".").concat(e[2],".").concat(e[0]),"".concat(e[1],".").concat(e[2],".").concat(e[3]),"".concat(e[1],".").concat(e[3],".").concat(e[0]),"".concat(e[1],".").concat(e[3],".").concat(e[2]),"".concat(e[2],".").concat(e[0],".").concat(e[1]),"".concat(e[2],".").concat(e[0],".").concat(e[3]),"".concat(e[2],".").concat(e[1],".").concat(e[0]),"".concat(e[2],".").concat(e[1],".").concat(e[3]),"".concat(e[2],".").concat(e[3],".").concat(e[0]),"".concat(e[2],".").concat(e[3],".").concat(e[1]),"".concat(e[3],".").concat(e[0],".").concat(e[1]),"".concat(e[3],".").concat(e[0],".").concat(e[2]),"".concat(e[3],".").concat(e[1],".").concat(e[0]),"".concat(e[3],".").concat(e[1],".").concat(e[2]),"".concat(e[3],".").concat(e[2],".").concat(e[0]),"".concat(e[3],".").concat(e[2],".").concat(e[1]),"".concat(e[0],".").concat(e[1],".").concat(e[2],".").concat(e[3]),"".concat(e[0],".").concat(e[1],".").concat(e[3],".").concat(e[2]),"".concat(e[0],".").concat(e[2],".").concat(e[1],".").concat(e[3]),"".concat(e[0],".").concat(e[2],".").concat(e[3],".").concat(e[1]),"".concat(e[0],".").concat(e[3],".").concat(e[1],".").concat(e[2]),"".concat(e[0],".").concat(e[3],".").concat(e[2],".").concat(e[1]),"".concat(e[1],".").concat(e[0],".").concat(e[2],".").concat(e[3]),"".concat(e[1],".").concat(e[0],".").concat(e[3],".").concat(e[2]),"".concat(e[1],".").concat(e[2],".").concat(e[0],".").concat(e[3]),"".concat(e[1],".").concat(e[2],".").concat(e[3],".").concat(e[0]),"".concat(e[1],".").concat(e[3],".").concat(e[0],".").concat(e[2]),"".concat(e[1],".").concat(e[3],".").concat(e[2],".").concat(e[0]),"".concat(e[2],".").concat(e[0],".").concat(e[1],".").concat(e[3]),"".concat(e[2],".").concat(e[0],".").concat(e[3],".").concat(e[1]),"".concat(e[2],".").concat(e[1],".").concat(e[0],".").concat(e[3]),"".concat(e[2],".").concat(e[1],".").concat(e[3],".").concat(e[0]),"".concat(e[2],".").concat(e[3],".").concat(e[0],".").concat(e[1]),"".concat(e[2],".").concat(e[3],".").concat(e[1],".").concat(e[0]),"".concat(e[3],".").concat(e[0],".").concat(e[1],".").concat(e[2]),"".concat(e[3],".").concat(e[0],".").concat(e[2],".").concat(e[1]),"".concat(e[3],".").concat(e[1],".").concat(e[0],".").concat(e[2]),"".concat(e[3],".").concat(e[1],".").concat(e[2],".").concat(e[0]),"".concat(e[3],".").concat(e[2],".").concat(e[0],".").concat(e[1]),"".concat(e[3],".").concat(e[2],".").concat(e[1],".").concat(e[0])]}var Ul={};function kF(e){if(e.length===0||e.length===1)return e;var t=e.join(".");return Ul[t]||(Ul[t]=SF(e)),Ul[t]}function wF(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=arguments.length>2?arguments[2]:void 0,n=e.filter(function(i){return i!=="token"}),a=kF(n);return a.reduce(function(i,s){return Kn(Kn({},i),r[s])},t)}function L0(e){return e.join(" ")}function NF(e,t){var r=0;return function(n){return r+=1,n.map(function(a,i){return WA({node:a,stylesheet:e,useInlineStyles:t,key:"code-segment-".concat(r,"-").concat(i)})})}}function WA(e){var t=e.node,r=e.stylesheet,n=e.style,a=n===void 0?{}:n,i=e.useInlineStyles,s=e.key,l=t.properties,u=t.type,c=t.tagName,d=t.value;if(u==="text")return d;if(c){var p=NF(r,i),m;if(!i)m=Kn(Kn({},l),{},{className:L0(l.className)});else{var g=Object.keys(r).reduce(function(h,y){return y.split(".").forEach(function(b){h.includes(b)||h.push(b)}),h},[]),x=l.className&&l.className.includes("token")?["token"]:[],v=l.className&&x.concat(l.className.filter(function(h){return!g.includes(h)}));m=Kn(Kn({},l),{},{className:L0(v)||void 0,style:wF(l.className,Object.assign({},l.style,a),r)})}var N=p(t.children);return ct.createElement(c,mf({key:s},m),N)}}const AF=function(e,t){var r=e.listLanguages();return r.indexOf(t)!==-1};var TF=["language","children","style","customStyle","codeTagProps","useInlineStyles","showLineNumbers","showInlineLineNumbers","startingLineNumber","lineNumberContainerStyle","lineNumberStyle","wrapLines","wrapLongLines","lineProps","renderer","PreTag","CodeTag","code","astGenerator"];function D0(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function Dr(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?D0(Object(r),!0).forEach(function(n){VA(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):D0(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}var CF=/\n/g;function RF(e){return e.match(CF)}function IF(e){var t=e.lines,r=e.startingLineNumber,n=e.style;return t.map(function(a,i){var s=i+r;return ct.createElement("span",{key:"line-".concat(i),className:"react-syntax-highlighter-line-number",style:typeof n=="function"?n(s):n},"".concat(s,`
|
|
320
320
|
`))})}function _F(e){var t=e.codeString,r=e.codeStyle,n=e.containerStyle,a=n===void 0?{float:"left",paddingRight:"10px"}:n,i=e.numberStyle,s=i===void 0?{}:i,l=e.startingLineNumber;return ct.createElement("code",{style:Object.assign({},r,a)},IF({lines:t.replace(/\n$/,"").split(`
|
|
321
321
|
`),style:s,startingLineNumber:l}))}function OF(e){return"".concat(e.toString().length,".25em")}function YA(e,t){return{type:"element",tagName:"span",properties:{key:"line-number--".concat(e),className:["comment","linenumber","react-syntax-highlighter-line-number"],style:t},children:[{type:"text",value:e}]}}function KA(e,t,r){var n={display:"inline-block",minWidth:OF(r),paddingRight:"1em",textAlign:"right",userSelect:"none"},a=typeof e=="function"?e(t):e,i=Dr(Dr({},n),a);return i}function Mo(e){var t=e.children,r=e.lineNumber,n=e.lineNumberStyle,a=e.largestLineNumber,i=e.showInlineLineNumbers,s=e.lineProps,l=s===void 0?{}:s,u=e.className,c=u===void 0?[]:u,d=e.showLineNumbers,p=e.wrapLongLines,m=e.wrapLines,g=m===void 0?!1:m,x=g?Dr({},typeof l=="function"?l(r):l):{};if(x.className=x.className?[].concat(gf(x.className.trim().split(/\s+/)),gf(c)):c,r&&i){var v=KA(n,r,a);t.unshift(YA(r,v))}return p&d&&(x.style=Dr({display:"flex"},x.style)),{type:"element",tagName:"span",properties:x,children:t}}function ZA(e){for(var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[],n=0;n<e.length;n++){var a=e[n];if(a.type==="text")r.push(Mo({children:[a],className:gf(new Set(t))}));else if(a.children){var i=t.concat(a.properties.className);ZA(a.children,i).forEach(function(s){return r.push(s)})}}return r}function LF(e,t,r,n,a,i,s,l,u){var c,d=ZA(e.value),p=[],m=-1,g=0;function x(w,S){var T=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[];return Mo({children:w,lineNumber:S,lineNumberStyle:l,largestLineNumber:s,showInlineLineNumbers:a,lineProps:r,className:T,showLineNumbers:n,wrapLongLines:u,wrapLines:t})}function v(w,S){if(n&&S&&a){var T=KA(l,S,s);w.unshift(YA(S,T))}return w}function N(w,S){var T=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[];return t||T.length>0?x(w,S,T):v(w,S)}for(var h=function(){var S=d[g],T=S.children[0].value,R=RF(T);if(R){var _=T.split(`
|