qwen-audio-agent 2.0.1 → 2.2.0
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 +21 -10
- package/README_ZH.md +19 -10
- package/THIRD_PARTY_NOTICES.md +1 -1
- package/cli/package.json +1 -1
- package/cli/src/arguments.mjs +4 -1
- package/cli/src/config-command.mjs +36 -6
- package/cli/src/gateway-service.mjs +7 -1
- package/cli/src/launcher.mjs +13 -0
- package/config/frontend-agent/LIVE_PROMPT.md +64 -0
- package/config/frontend-agent/PROMPT.md +29 -26
- package/desktop/src/i18n.mjs +6 -1
- package/desktop/src/settings-config.mjs +32 -40
- package/desktop/src/settings-store.mjs +19 -28
- package/docs/architecture/deep-dive.md +103 -66
- package/docs/architecture/deep-dive.zh.md +73 -50
- package/docs/backends/configuration.md +4 -4
- package/docs/backends/configuration.zh.md +4 -4
- package/docs/backends/overview.md +3 -0
- package/docs/backends/overview.zh.md +3 -0
- package/docs/configuration/backend.md +15 -1
- package/docs/configuration/backend.zh.md +15 -1
- package/docs/configuration/frontend.md +78 -28
- package/docs/configuration/frontend.zh.md +76 -28
- package/docs/configuration.md +1 -1
- package/docs/configuration.zh.md +1 -1
- package/docs/contract.md +24 -2
- package/docs/contract.zh.md +20 -2
- package/docs/extensions.md +14 -0
- package/docs/extensions.zh.md +11 -0
- package/docs/gateway-protocol.md +26 -0
- package/docs/gateway-protocol.zh.md +22 -0
- package/docs/gateway-webrtc-client.md +3 -3
- package/docs/gateway-webrtc-client.zh.md +3 -3
- package/docs/getting-started/install.md +4 -1
- package/docs/getting-started/install.zh.md +4 -1
- package/docs/getting-started/mobile.md +8 -2
- package/docs/getting-started/mobile.zh.md +5 -0
- package/docs/getting-started/quickstart.md +2 -2
- package/docs/getting-started/quickstart.zh.md +2 -2
- package/docs/getting-started/webui.md +2 -0
- package/docs/getting-started/webui.zh.md +2 -0
- package/docs/guides/knowledge.md +8 -5
- package/docs/guides/knowledge.zh.md +4 -3
- package/docs/guides/tasks.md +63 -2
- package/docs/guides/tasks.zh.md +45 -1
- package/docs/guides/web-search.md +32 -1
- package/docs/guides/web-search.zh.md +28 -1
- package/docs/operations/troubleshooting.md +30 -0
- package/docs/operations/troubleshooting.zh.md +26 -0
- package/docs/reference/backend-adapter-sdk.md +33 -2
- package/docs/reference/backend-adapter-sdk.zh.md +29 -2
- package/docs/reference/cli.md +3 -3
- package/docs/reference/cli.zh.md +3 -3
- package/docs/scenarios/lightrag.md +2 -2
- package/docs/scenarios/lightrag.zh.md +2 -2
- package/docs/scenarios/x-omni.md +5 -2
- package/docs/scenarios/x-omni.zh.md +5 -2
- package/docs/voice-agent-architecture-presentation.zh.md +34 -37
- package/docs/voice-frontends/custom-provider.md +22 -4
- package/docs/voice-frontends/custom-provider.zh.md +22 -4
- package/docs/voice-frontends/google-live.md +14 -8
- package/docs/voice-frontends/google-live.zh.md +13 -8
- package/docs/voice-frontends/gpt-live-1.md +149 -0
- package/docs/voice-frontends/gpt-live-1.zh.md +114 -0
- package/docs/voice-frontends/minicpm-o.md +8 -4
- package/docs/voice-frontends/minicpm-o.zh.md +7 -4
- package/docs/voice-frontends/{gpt-live.md → openai-realtime.md} +19 -10
- package/docs/voice-frontends/{gpt-live.zh.md → openai-realtime.zh.md} +18 -10
- package/docs/voice-frontends/qwen-audio-live.md +164 -0
- package/docs/voice-frontends/qwen-audio-live.zh.md +122 -0
- package/docs/voice-frontends/qwen-audio-realtime.md +41 -15
- package/docs/voice-frontends/qwen-audio-realtime.zh.md +34 -12
- package/docs/voice-frontends/qwen-omni-realtime.md +12 -9
- package/docs/voice-frontends/qwen-omni-realtime.zh.md +12 -9
- package/docs/voice-frontends/speech-to-speech.md +8 -4
- package/docs/voice-frontends/speech-to-speech.zh.md +7 -3
- package/docs/voice-frontends/stepfun.md +7 -4
- package/docs/voice-frontends/stepfun.zh.md +7 -4
- package/examples/webrtc/start.mjs +2 -1
- package/package.json +34 -16
- package/scripts/audit-dependencies.mjs +3 -25
- package/scripts/electron-smoke.mjs +5 -5
- package/scripts/patch-build-node-gyp.mjs +63 -0
- package/scripts/prepare-build.mjs +2 -0
- package/scripts/release-check +2 -2
- package/scripts/runtime/claude-code-acp.mjs +5 -5
- package/scripts/verify-package.mjs +3 -0
- package/server/package.json +5 -5
- package/server/src/app/gateway-application.mjs +3 -0
- package/server/src/app/gateway-http-routes.mjs +3 -0
- package/server/src/app/session-conversation-history.mjs +9 -1
- package/server/src/backend/adapters/a2a/backend-adapter.mjs +32 -26
- package/server/src/backend/adapters/acp/backend-adapter.mjs +703 -251
- package/server/src/backend/adapters/acp/coordinator-contract.mjs +2 -13
- package/server/src/backend/adapters/acp/coordinator-instructions.mjs +29 -8
- package/server/src/backend/adapters/acp/coordinator-queue.mjs +58 -0
- package/server/src/backend/adapters/acp/drivers/codex.mjs +1 -1
- package/server/src/backend/adapters/acp/drivers/openclaw.mjs +1 -2
- package/server/src/backend/adapters/acp/input-broker.mjs +2 -0
- package/server/src/backend/adapters/acp/process-client.mjs +111 -16
- package/server/src/backend/adapters/acp/session-configuration.mjs +2 -19
- package/server/src/backend/adapters/acp/session-registry.mjs +9 -0
- package/server/src/backend/adapters/acp/session-tools.mjs +1 -1
- package/server/src/backend/adapters/acp/turn-updates.mjs +188 -0
- package/server/src/backend/adapters/acp/work-continuation.mjs +48 -0
- package/server/src/backend/adapters/agent-client.mjs +24 -1
- package/server/src/backend/adapters/llm/backend-adapter.mjs +393 -0
- package/server/src/backend/adapters/muse/backend-adapter.mjs +2 -0
- package/server/src/backend/availability.mjs +12 -3
- package/server/src/backend/backend-adapter-sdk.mjs +3 -0
- package/server/src/backend/backend-port.mjs +13 -0
- package/server/src/backend/backend-work-runtime.mjs +23 -0
- package/server/src/client/client-command-runtime.mjs +14 -0
- package/server/src/conversation/conversation-sync.mjs +26 -2
- package/server/src/conversation/frontend-agent-context.mjs +18 -5
- package/server/src/conversation/frontend-notes.mjs +7 -5
- package/server/src/conversation/task-result-projector.mjs +1 -1
- package/server/src/core/backend-events.mjs +4 -0
- package/server/src/core/citation.mjs +8 -2
- package/server/src/core/config.mjs +46 -54
- package/server/src/core/gateway-protocol.mjs +4 -1
- package/server/src/core/request-security.mjs +7 -1
- package/server/src/core/work-conversation-context.mjs +138 -0
- package/server/src/core/work-input-request.mjs +1 -0
- package/server/src/frontend/frontend-tools.mjs +20 -7
- package/server/src/frontend/retrieval/providers/bing.mjs +23 -12
- package/server/src/frontend/retrieval/providers/factory.mjs +18 -1
- package/server/src/frontend/retrieval/providers/mcp.mjs +30 -11
- package/server/src/frontend/retrieval/providers/so360.mjs +23 -12
- package/server/src/frontend/tools/agent-task-runtime.mjs +119 -99
- package/server/src/frontend/tools/features/agent-task-tools.mjs +23 -42
- package/server/src/frontend/tools/frontend-tool-context.mjs +2 -2
- package/server/src/frontend/tools/spawn-thinking-tool.mjs +2 -2
- package/server/src/frontend/tools/tool-call-handler.mjs +166 -86
- package/server/src/knowledge/providers/local/library.mjs +26 -6
- package/server/src/knowledge/providers/local/provider.mjs +25 -6
- package/server/src/memory/providers/markdown/context-store.mjs +24 -11
- package/server/src/orchestration/session-task-coordinator.mjs +13 -3
- package/server/src/orchestration/task-operations.mjs +54 -12
- package/server/src/orchestration/task-updates.mjs +82 -0
- package/server/src/task/reminder-scheduler.mjs +5 -1
- package/server/src/task/task-manager.mjs +72 -15
- package/server/src/task/task-recovery.mjs +12 -2
- package/server/src/task/task-scheduler.mjs +5 -5
- package/server/src/task/task-state.mjs +13 -0
- package/server/src/transport/gateway-client-transport.mjs +35 -0
- package/server/src/transport/webrtc/protocol.mjs +1 -1
- package/server/src/voice/announcement/announcement-manager.mjs +3 -0
- package/server/src/voice/audio-stream-diagnostics.mjs +139 -0
- package/server/src/voice/native-delegation-runtime.mjs +360 -0
- package/server/src/voice/providers/dashscope-live.mjs +93 -0
- package/server/src/voice/providers/dashscope.mjs +45 -33
- package/server/src/voice/providers/doubao-seeduplex-protocol.mjs +54 -0
- package/server/src/voice/providers/doubao-seeduplex.mjs +16 -11
- package/server/src/voice/providers/ga-protocol.mjs +7 -2
- package/server/src/voice/providers/google-live-protocol.mjs +124 -34
- package/server/src/voice/providers/google-live.mjs +20 -14
- package/server/src/voice/providers/gpt-live-1-protocol.mjs +597 -0
- package/server/src/voice/providers/gpt-live-1.mjs +3 -0
- package/server/src/voice/providers/gpt-live-client-context.mjs +182 -0
- package/server/src/voice/providers/minicpm-o.mjs +9 -7
- package/server/src/voice/providers/openai-live.mjs +150 -0
- package/server/src/voice/providers/{gpt-live.mjs → openai-realtime.mjs} +23 -19
- package/server/src/voice/providers/provider-registry.mjs +11 -1
- package/server/src/voice/providers/qwen-live-protocol.mjs +399 -0
- package/server/src/voice/providers/registry.mjs +47 -12
- package/server/src/voice/providers/runtime-configuration.mjs +34 -0
- package/server/src/voice/providers/s2s.mjs +9 -7
- package/server/src/voice/providers/stepfun.mjs +14 -11
- package/server/src/voice/realtime-input-runtime.mjs +58 -20
- package/server/src/voice/realtime-presentation-runtime.mjs +111 -27
- package/server/src/voice/realtime-provider-session.mjs +59 -14
- package/server/src/voice/realtime-provider.mjs +358 -45
- package/server/src/voice/realtime-session-runtime.mjs +282 -35
- package/server/src/voice/realtime-task-presentation.mjs +8 -2
- package/server/src/voice/realtime-turn-state.mjs +33 -2
- package/shared/backend/catalog.mjs +26 -2
- package/shared/backend/install.mjs +3 -1
- package/shared/backend/setup.mjs +43 -0
- package/shared/gateway/client-sdk.mjs +21 -6
- package/shared/gateway/setup.mjs +13 -1
- package/shared/gateway/websocket-auth.mjs +2 -1
- package/shared/protocol/gateway-client-protocol.mjs +14 -0
- package/shared/protocol/gateway-events.mjs +39 -1
- package/shared/realtime-legacy-environment.mjs +81 -0
- package/shared/realtime-model-catalog.mjs +68 -194
- package/shared/realtime-models/README.md +33 -0
- package/shared/realtime-models/dashscope.mjs +57 -0
- package/shared/realtime-models/google.mjs +10 -0
- package/shared/realtime-models/openai.mjs +24 -0
- package/shared/realtime-models/profile.mjs +38 -0
- package/shared/realtime-models/stepfun.mjs +10 -0
- package/shared/realtime-models/volcengine.mjs +12 -0
- package/shared/realtime-provider-catalog.mjs +23 -11
- package/shared/realtime-provider-definitions.mjs +168 -235
- package/shared/runtime-environment.mjs +23 -30
- package/shared/skill-library.mjs +49 -13
- package/shared/web-search-configuration.mjs +25 -2
- package/tui/package.json +2 -2
- package/tui/src/index.mjs +14 -9
- package/tui/src/runtime-configuration.mjs +2 -0
- package/tui/src/terminal-commands.mjs +40 -0
- package/tui/src/text-cli.mjs +10 -1
- package/web/dist/assets/index-Bc2Q04J9.css +1 -0
- package/web/dist/assets/index-bY4DFXKT.js +96 -0
- package/web/dist/index.html +2 -2
- package/web/dist/assets/index-BRaiI-dW.js +0 -91
- package/web/dist/assets/index-D9k8R2JY.css +0 -1
|
@@ -1,91 +0,0 @@
|
|
|
1
|
-
(function(){const n=document.createElement("link").relList;if(n&&n.supports&&n.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))l(o);new MutationObserver(o=>{for(const s of o)if(s.type==="childList")for(const c of s.addedNodes)c.tagName==="LINK"&&c.rel==="modulepreload"&&l(c)}).observe(document,{childList:!0,subtree:!0});function r(o){const s={};return o.integrity&&(s.integrity=o.integrity),o.referrerPolicy&&(s.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?s.credentials="include":o.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function l(o){if(o.ep)return;o.ep=!0;const s=r(o);fetch(o.href,s)}})();function Yb(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var mf={exports:{}},Gl={};var Vg;function m_(){if(Vg)return Gl;Vg=1;var e=Symbol.for("react.transitional.element"),n=Symbol.for("react.fragment");function r(l,o,s){var c=null;if(s!==void 0&&(c=""+s),o.key!==void 0&&(c=""+o.key),"key"in o){s={};for(var d in o)d!=="key"&&(s[d]=o[d])}else s=o;return o=s.ref,{$$typeof:e,type:l,key:c,ref:o!==void 0?o:null,props:s}}return Gl.Fragment=n,Gl.jsx=r,Gl.jsxs=r,Gl}var $g;function g_(){return $g||($g=1,mf.exports=m_()),mf.exports}var O=g_(),gf={exports:{}},qe={};var Yg;function y_(){if(Yg)return qe;Yg=1;var e=Symbol.for("react.transitional.element"),n=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),l=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),s=Symbol.for("react.consumer"),c=Symbol.for("react.context"),d=Symbol.for("react.forward_ref"),m=Symbol.for("react.suspense"),p=Symbol.for("react.memo"),y=Symbol.for("react.lazy"),g=Symbol.for("react.activity"),S=Symbol.iterator;function v(z){return z===null||typeof z!="object"?null:(z=S&&z[S]||z["@@iterator"],typeof z=="function"?z:null)}var _={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},N=Object.assign,M={};function A(z,F,T){this.props=z,this.context=F,this.refs=M,this.updater=T||_}A.prototype.isReactComponent={},A.prototype.setState=function(z,F){if(typeof z!="object"&&typeof z!="function"&&z!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,z,F,"setState")},A.prototype.forceUpdate=function(z){this.updater.enqueueForceUpdate(this,z,"forceUpdate")};function V(){}V.prototype=A.prototype;function j(z,F,T){this.props=z,this.context=F,this.refs=M,this.updater=T||_}var ae=j.prototype=new V;ae.constructor=j,N(ae,A.prototype),ae.isPureReactComponent=!0;var ue=Array.isArray;function D(){}var $={H:null,A:null,T:null,S:null},re=Object.prototype.hasOwnProperty;function de(z,F,T){var he=T.ref;return{$$typeof:e,type:z,key:F,ref:he!==void 0?he:null,props:T}}function U(z,F){return de(z.type,F,z.props)}function te(z){return typeof z=="object"&&z!==null&&z.$$typeof===e}function ne(z){var F={"=":"=0",":":"=2"};return"$"+z.replace(/[=:]/g,function(T){return F[T]})}var Ae=/\/+/g;function Se(z,F){return typeof z=="object"&&z!==null&&z.key!=null?ne(""+z.key):F.toString(36)}function oe(z){switch(z.status){case"fulfilled":return z.value;case"rejected":throw z.reason;default:switch(typeof z.status=="string"?z.then(D,D):(z.status="pending",z.then(function(F){z.status==="pending"&&(z.status="fulfilled",z.value=F)},function(F){z.status==="pending"&&(z.status="rejected",z.reason=F)})),z.status){case"fulfilled":return z.value;case"rejected":throw z.reason}}throw z}function H(z,F,T,he,_e){var Te=typeof z;(Te==="undefined"||Te==="boolean")&&(z=null);var Ze=!1;if(z===null)Ze=!0;else switch(Te){case"bigint":case"string":case"number":Ze=!0;break;case"object":switch(z.$$typeof){case e:case n:Ze=!0;break;case y:return Ze=z._init,H(Ze(z._payload),F,T,he,_e)}}if(Ze)return _e=_e(z),Ze=he===""?"."+Se(z,0):he,ue(_e)?(T="",Ze!=null&&(T=Ze.replace(Ae,"$&/")+"/"),H(_e,F,T,"",function(dn){return dn})):_e!=null&&(te(_e)&&(_e=U(_e,T+(_e.key==null||z&&z.key===_e.key?"":(""+_e.key).replace(Ae,"$&/")+"/")+Ze)),F.push(_e)),1;Ze=0;var ut=he===""?".":he+":";if(ue(z))for(var Le=0;Le<z.length;Le++)he=z[Le],Te=ut+Se(he,Le),Ze+=H(he,F,T,Te,_e);else if(Le=v(z),typeof Le=="function")for(z=Le.call(z),Le=0;!(he=z.next()).done;)he=he.value,Te=ut+Se(he,Le++),Ze+=H(he,F,T,Te,_e);else if(Te==="object"){if(typeof z.then=="function")return H(oe(z),F,T,he,_e);throw F=String(z),Error("Objects are not valid as a React child (found: "+(F==="[object Object]"?"object with keys {"+Object.keys(z).join(", ")+"}":F)+"). If you meant to render a collection of children, use an array instead.")}return Ze}function le(z,F,T){if(z==null)return z;var he=[],_e=0;return H(z,he,"","",function(Te){return F.call(T,Te,_e++)}),he}function ve(z){if(z._status===-1){var F=z._result;F=F(),F.then(function(T){(z._status===0||z._status===-1)&&(z._status=1,z._result=T)},function(T){(z._status===0||z._status===-1)&&(z._status=2,z._result=T)}),z._status===-1&&(z._status=0,z._result=F)}if(z._status===1)return z._result.default;throw z._result}var Pe=typeof reportError=="function"?reportError:function(z){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var F=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof z=="object"&&z!==null&&typeof z.message=="string"?String(z.message):String(z),error:z});if(!window.dispatchEvent(F))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",z);return}console.error(z)},w={map:le,forEach:function(z,F,T){le(z,function(){F.apply(this,arguments)},T)},count:function(z){var F=0;return le(z,function(){F++}),F},toArray:function(z){return le(z,function(F){return F})||[]},only:function(z){if(!te(z))throw Error("React.Children.only expected to receive a single React element child.");return z}};return qe.Activity=g,qe.Children=w,qe.Component=A,qe.Fragment=r,qe.Profiler=o,qe.PureComponent=j,qe.StrictMode=l,qe.Suspense=m,qe.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=$,qe.__COMPILER_RUNTIME={__proto__:null,c:function(z){return $.H.useMemoCache(z)}},qe.cache=function(z){return function(){return z.apply(null,arguments)}},qe.cacheSignal=function(){return null},qe.cloneElement=function(z,F,T){if(z==null)throw Error("The argument must be a React element, but you passed "+z+".");var he=N({},z.props),_e=z.key;if(F!=null)for(Te in F.key!==void 0&&(_e=""+F.key),F)!re.call(F,Te)||Te==="key"||Te==="__self"||Te==="__source"||Te==="ref"&&F.ref===void 0||(he[Te]=F[Te]);var Te=arguments.length-2;if(Te===1)he.children=T;else if(1<Te){for(var Ze=Array(Te),ut=0;ut<Te;ut++)Ze[ut]=arguments[ut+2];he.children=Ze}return de(z.type,_e,he)},qe.createContext=function(z){return z={$$typeof:c,_currentValue:z,_currentValue2:z,_threadCount:0,Provider:null,Consumer:null},z.Provider=z,z.Consumer={$$typeof:s,_context:z},z},qe.createElement=function(z,F,T){var he,_e={},Te=null;if(F!=null)for(he in F.key!==void 0&&(Te=""+F.key),F)re.call(F,he)&&he!=="key"&&he!=="__self"&&he!=="__source"&&(_e[he]=F[he]);var Ze=arguments.length-2;if(Ze===1)_e.children=T;else if(1<Ze){for(var ut=Array(Ze),Le=0;Le<Ze;Le++)ut[Le]=arguments[Le+2];_e.children=ut}if(z&&z.defaultProps)for(he in Ze=z.defaultProps,Ze)_e[he]===void 0&&(_e[he]=Ze[he]);return de(z,Te,_e)},qe.createRef=function(){return{current:null}},qe.forwardRef=function(z){return{$$typeof:d,render:z}},qe.isValidElement=te,qe.lazy=function(z){return{$$typeof:y,_payload:{_status:-1,_result:z},_init:ve}},qe.memo=function(z,F){return{$$typeof:p,type:z,compare:F===void 0?null:F}},qe.startTransition=function(z){var F=$.T,T={};$.T=T;try{var he=z(),_e=$.S;_e!==null&&_e(T,he),typeof he=="object"&&he!==null&&typeof he.then=="function"&&he.then(D,Pe)}catch(Te){Pe(Te)}finally{F!==null&&T.types!==null&&(F.types=T.types),$.T=F}},qe.unstable_useCacheRefresh=function(){return $.H.useCacheRefresh()},qe.use=function(z){return $.H.use(z)},qe.useActionState=function(z,F,T){return $.H.useActionState(z,F,T)},qe.useCallback=function(z,F){return $.H.useCallback(z,F)},qe.useContext=function(z){return $.H.useContext(z)},qe.useDebugValue=function(){},qe.useDeferredValue=function(z,F){return $.H.useDeferredValue(z,F)},qe.useEffect=function(z,F){return $.H.useEffect(z,F)},qe.useEffectEvent=function(z){return $.H.useEffectEvent(z)},qe.useId=function(){return $.H.useId()},qe.useImperativeHandle=function(z,F,T){return $.H.useImperativeHandle(z,F,T)},qe.useInsertionEffect=function(z,F){return $.H.useInsertionEffect(z,F)},qe.useLayoutEffect=function(z,F){return $.H.useLayoutEffect(z,F)},qe.useMemo=function(z,F){return $.H.useMemo(z,F)},qe.useOptimistic=function(z,F){return $.H.useOptimistic(z,F)},qe.useReducer=function(z,F,T){return $.H.useReducer(z,F,T)},qe.useRef=function(z){return $.H.useRef(z)},qe.useState=function(z){return $.H.useState(z)},qe.useSyncExternalStore=function(z,F,T){return $.H.useSyncExternalStore(z,F,T)},qe.useTransition=function(){return $.H.useTransition()},qe.version="19.2.8",qe}var Fg;function Td(){return Fg||(Fg=1,gf.exports=y_()),gf.exports}var I=Td(),yf={exports:{}},Vl={},bf={exports:{}},Sf={};var Kg;function b_(){return Kg||(Kg=1,(function(e){function n(H,le){var ve=H.length;H.push(le);e:for(;0<ve;){var Pe=ve-1>>>1,w=H[Pe];if(0<o(w,le))H[Pe]=le,H[ve]=w,ve=Pe;else break e}}function r(H){return H.length===0?null:H[0]}function l(H){if(H.length===0)return null;var le=H[0],ve=H.pop();if(ve!==le){H[0]=ve;e:for(var Pe=0,w=H.length,z=w>>>1;Pe<z;){var F=2*(Pe+1)-1,T=H[F],he=F+1,_e=H[he];if(0>o(T,ve))he<w&&0>o(_e,T)?(H[Pe]=_e,H[he]=ve,Pe=he):(H[Pe]=T,H[F]=ve,Pe=F);else if(he<w&&0>o(_e,ve))H[Pe]=_e,H[he]=ve,Pe=he;else break e}}return le}function o(H,le){var ve=H.sortIndex-le.sortIndex;return ve!==0?ve:H.id-le.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var s=performance;e.unstable_now=function(){return s.now()}}else{var c=Date,d=c.now();e.unstable_now=function(){return c.now()-d}}var m=[],p=[],y=1,g=null,S=3,v=!1,_=!1,N=!1,M=!1,A=typeof setTimeout=="function"?setTimeout:null,V=typeof clearTimeout=="function"?clearTimeout:null,j=typeof setImmediate<"u"?setImmediate:null;function ae(H){for(var le=r(p);le!==null;){if(le.callback===null)l(p);else if(le.startTime<=H)l(p),le.sortIndex=le.expirationTime,n(m,le);else break;le=r(p)}}function ue(H){if(N=!1,ae(H),!_)if(r(m)!==null)_=!0,D||(D=!0,ne());else{var le=r(p);le!==null&&oe(ue,le.startTime-H)}}var D=!1,$=-1,re=5,de=-1;function U(){return M?!0:!(e.unstable_now()-de<re)}function te(){if(M=!1,D){var H=e.unstable_now();de=H;var le=!0;try{e:{_=!1,N&&(N=!1,V($),$=-1),v=!0;var ve=S;try{t:{for(ae(H),g=r(m);g!==null&&!(g.expirationTime>H&&U());){var Pe=g.callback;if(typeof Pe=="function"){g.callback=null,S=g.priorityLevel;var w=Pe(g.expirationTime<=H);if(H=e.unstable_now(),typeof w=="function"){g.callback=w,ae(H),le=!0;break t}g===r(m)&&l(m),ae(H)}else l(m);g=r(m)}if(g!==null)le=!0;else{var z=r(p);z!==null&&oe(ue,z.startTime-H),le=!1}}break e}finally{g=null,S=ve,v=!1}le=void 0}}finally{le?ne():D=!1}}}var ne;if(typeof j=="function")ne=function(){j(te)};else if(typeof MessageChannel<"u"){var Ae=new MessageChannel,Se=Ae.port2;Ae.port1.onmessage=te,ne=function(){Se.postMessage(null)}}else ne=function(){A(te,0)};function oe(H,le){$=A(function(){H(e.unstable_now())},le)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(H){H.callback=null},e.unstable_forceFrameRate=function(H){0>H||125<H?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):re=0<H?Math.floor(1e3/H):5},e.unstable_getCurrentPriorityLevel=function(){return S},e.unstable_next=function(H){switch(S){case 1:case 2:case 3:var le=3;break;default:le=S}var ve=S;S=le;try{return H()}finally{S=ve}},e.unstable_requestPaint=function(){M=!0},e.unstable_runWithPriority=function(H,le){switch(H){case 1:case 2:case 3:case 4:case 5:break;default:H=3}var ve=S;S=H;try{return le()}finally{S=ve}},e.unstable_scheduleCallback=function(H,le,ve){var Pe=e.unstable_now();switch(typeof ve=="object"&&ve!==null?(ve=ve.delay,ve=typeof ve=="number"&&0<ve?Pe+ve:Pe):ve=Pe,H){case 1:var w=-1;break;case 2:w=250;break;case 5:w=1073741823;break;case 4:w=1e4;break;default:w=5e3}return w=ve+w,H={id:y++,callback:le,priorityLevel:H,startTime:ve,expirationTime:w,sortIndex:-1},ve>Pe?(H.sortIndex=ve,n(p,H),r(m)===null&&H===r(p)&&(N?(V($),$=-1):N=!0,oe(ue,ve-Pe))):(H.sortIndex=w,n(m,H),_||v||(_=!0,D||(D=!0,ne()))),H},e.unstable_shouldYield=U,e.unstable_wrapCallback=function(H){var le=S;return function(){var ve=S;S=le;try{return H.apply(this,arguments)}finally{S=ve}}}})(Sf)),Sf}var Xg;function S_(){return Xg||(Xg=1,bf.exports=b_()),bf.exports}var vf={exports:{}},Tn={};var Qg;function v_(){if(Qg)return Tn;Qg=1;var e=Td();function n(m){var p="https://react.dev/errors/"+m;if(1<arguments.length){p+="?args[]="+encodeURIComponent(arguments[1]);for(var y=2;y<arguments.length;y++)p+="&args[]="+encodeURIComponent(arguments[y])}return"Minified React error #"+m+"; visit "+p+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function r(){}var l={d:{f:r,r:function(){throw Error(n(522))},D:r,C:r,L:r,m:r,X:r,S:r,M:r},p:0,findDOMNode:null},o=Symbol.for("react.portal");function s(m,p,y){var g=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:o,key:g==null?null:""+g,children:m,containerInfo:p,implementation:y}}var c=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function d(m,p){if(m==="font")return"";if(typeof p=="string")return p==="use-credentials"?p:""}return Tn.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=l,Tn.createPortal=function(m,p){var y=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!p||p.nodeType!==1&&p.nodeType!==9&&p.nodeType!==11)throw Error(n(299));return s(m,p,null,y)},Tn.flushSync=function(m){var p=c.T,y=l.p;try{if(c.T=null,l.p=2,m)return m()}finally{c.T=p,l.p=y,l.d.f()}},Tn.preconnect=function(m,p){typeof m=="string"&&(p?(p=p.crossOrigin,p=typeof p=="string"?p==="use-credentials"?p:"":void 0):p=null,l.d.C(m,p))},Tn.prefetchDNS=function(m){typeof m=="string"&&l.d.D(m)},Tn.preinit=function(m,p){if(typeof m=="string"&&p&&typeof p.as=="string"){var y=p.as,g=d(y,p.crossOrigin),S=typeof p.integrity=="string"?p.integrity:void 0,v=typeof p.fetchPriority=="string"?p.fetchPriority:void 0;y==="style"?l.d.S(m,typeof p.precedence=="string"?p.precedence:void 0,{crossOrigin:g,integrity:S,fetchPriority:v}):y==="script"&&l.d.X(m,{crossOrigin:g,integrity:S,fetchPriority:v,nonce:typeof p.nonce=="string"?p.nonce:void 0})}},Tn.preinitModule=function(m,p){if(typeof m=="string")if(typeof p=="object"&&p!==null){if(p.as==null||p.as==="script"){var y=d(p.as,p.crossOrigin);l.d.M(m,{crossOrigin:y,integrity:typeof p.integrity=="string"?p.integrity:void 0,nonce:typeof p.nonce=="string"?p.nonce:void 0})}}else p==null&&l.d.M(m)},Tn.preload=function(m,p){if(typeof m=="string"&&typeof p=="object"&&p!==null&&typeof p.as=="string"){var y=p.as,g=d(y,p.crossOrigin);l.d.L(m,y,{crossOrigin:g,integrity:typeof p.integrity=="string"?p.integrity:void 0,nonce:typeof p.nonce=="string"?p.nonce:void 0,type:typeof p.type=="string"?p.type:void 0,fetchPriority:typeof p.fetchPriority=="string"?p.fetchPriority:void 0,referrerPolicy:typeof p.referrerPolicy=="string"?p.referrerPolicy:void 0,imageSrcSet:typeof p.imageSrcSet=="string"?p.imageSrcSet:void 0,imageSizes:typeof p.imageSizes=="string"?p.imageSizes:void 0,media:typeof p.media=="string"?p.media:void 0})}},Tn.preloadModule=function(m,p){if(typeof m=="string")if(p){var y=d(p.as,p.crossOrigin);l.d.m(m,{as:typeof p.as=="string"&&p.as!=="script"?p.as:void 0,crossOrigin:y,integrity:typeof p.integrity=="string"?p.integrity:void 0})}else l.d.m(m)},Tn.requestFormReset=function(m){l.d.r(m)},Tn.unstable_batchedUpdates=function(m,p){return m(p)},Tn.useFormState=function(m,p,y){return c.H.useFormState(m,p,y)},Tn.useFormStatus=function(){return c.H.useHostTransitionStatus()},Tn.version="19.2.8",Tn}var Jg;function Fb(){if(Jg)return vf.exports;Jg=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(n){console.error(n)}}return e(),vf.exports=v_(),vf.exports}var Wg;function E_(){if(Wg)return Vl;Wg=1;var e=S_(),n=Td(),r=Fb();function l(t){var i="https://react.dev/errors/"+t;if(1<arguments.length){i+="?args[]="+encodeURIComponent(arguments[1]);for(var a=2;a<arguments.length;a++)i+="&args[]="+encodeURIComponent(arguments[a])}return"Minified React error #"+t+"; visit "+i+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function o(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)}function s(t){var i=t,a=t;if(t.alternate)for(;i.return;)i=i.return;else{t=i;do i=t,(i.flags&4098)!==0&&(a=i.return),t=i.return;while(t)}return i.tag===3?a:null}function c(t){if(t.tag===13){var i=t.memoizedState;if(i===null&&(t=t.alternate,t!==null&&(i=t.memoizedState)),i!==null)return i.dehydrated}return null}function d(t){if(t.tag===31){var i=t.memoizedState;if(i===null&&(t=t.alternate,t!==null&&(i=t.memoizedState)),i!==null)return i.dehydrated}return null}function m(t){if(s(t)!==t)throw Error(l(188))}function p(t){var i=t.alternate;if(!i){if(i=s(t),i===null)throw Error(l(188));return i!==t?null:t}for(var a=t,u=i;;){var f=a.return;if(f===null)break;var h=f.alternate;if(h===null){if(u=f.return,u!==null){a=u;continue}break}if(f.child===h.child){for(h=f.child;h;){if(h===a)return m(f),t;if(h===u)return m(f),i;h=h.sibling}throw Error(l(188))}if(a.return!==u.return)a=f,u=h;else{for(var b=!1,E=f.child;E;){if(E===a){b=!0,a=f,u=h;break}if(E===u){b=!0,u=f,a=h;break}E=E.sibling}if(!b){for(E=h.child;E;){if(E===a){b=!0,a=h,u=f;break}if(E===u){b=!0,u=h,a=f;break}E=E.sibling}if(!b)throw Error(l(189))}}if(a.alternate!==u)throw Error(l(190))}if(a.tag!==3)throw Error(l(188));return a.stateNode.current===a?t:i}function y(t){var i=t.tag;if(i===5||i===26||i===27||i===6)return t;for(t=t.child;t!==null;){if(i=y(t),i!==null)return i;t=t.sibling}return null}var g=Object.assign,S=Symbol.for("react.element"),v=Symbol.for("react.transitional.element"),_=Symbol.for("react.portal"),N=Symbol.for("react.fragment"),M=Symbol.for("react.strict_mode"),A=Symbol.for("react.profiler"),V=Symbol.for("react.consumer"),j=Symbol.for("react.context"),ae=Symbol.for("react.forward_ref"),ue=Symbol.for("react.suspense"),D=Symbol.for("react.suspense_list"),$=Symbol.for("react.memo"),re=Symbol.for("react.lazy"),de=Symbol.for("react.activity"),U=Symbol.for("react.memo_cache_sentinel"),te=Symbol.iterator;function ne(t){return t===null||typeof t!="object"?null:(t=te&&t[te]||t["@@iterator"],typeof t=="function"?t:null)}var Ae=Symbol.for("react.client.reference");function Se(t){if(t==null)return null;if(typeof t=="function")return t.$$typeof===Ae?null:t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case N:return"Fragment";case A:return"Profiler";case M:return"StrictMode";case ue:return"Suspense";case D:return"SuspenseList";case de:return"Activity"}if(typeof t=="object")switch(t.$$typeof){case _:return"Portal";case j:return t.displayName||"Context";case V:return(t._context.displayName||"Context")+".Consumer";case ae:var i=t.render;return t=t.displayName,t||(t=i.displayName||i.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case $:return i=t.displayName||null,i!==null?i:Se(t.type)||"Memo";case re:i=t._payload,t=t._init;try{return Se(t(i))}catch{}}return null}var oe=Array.isArray,H=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,le=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ve={pending:!1,data:null,method:null,action:null},Pe=[],w=-1;function z(t){return{current:t}}function F(t){0>w||(t.current=Pe[w],Pe[w]=null,w--)}function T(t,i){w++,Pe[w]=t.current,t.current=i}var he=z(null),_e=z(null),Te=z(null),Ze=z(null);function ut(t,i){switch(T(Te,i),T(_e,t),T(he,null),i.nodeType){case 9:case 11:t=(t=i.documentElement)&&(t=t.namespaceURI)?pg(t):0;break;default:if(t=i.tagName,i=i.namespaceURI)i=pg(i),t=mg(i,t);else switch(t){case"svg":t=1;break;case"math":t=2;break;default:t=0}}F(he),T(he,t)}function Le(){F(he),F(_e),F(Te)}function dn(t){t.memoizedState!==null&&T(Ze,t);var i=he.current,a=mg(i,t.type);i!==a&&(T(_e,t),T(he,a))}function yt(t){_e.current===t&&(F(he),F(_e)),Ze.current===t&&(F(Ze),ql._currentValue=ve)}var En,On;function _n(t){if(En===void 0)try{throw Error()}catch(a){var i=a.stack.trim().match(/\n( *(at )?)/);En=i&&i[1]||"",On=-1<a.stack.indexOf(`
|
|
2
|
-
at`)?" (<anonymous>)":-1<a.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
3
|
-
`+En+t+On}var un=!1;function bi(t,i){if(!t||un)return"";un=!0;var a=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var u={DetermineComponentFrameRoot:function(){try{if(i){var W=function(){throw Error()};if(Object.defineProperty(W.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(W,[])}catch(G){var P=G}Reflect.construct(t,[],W)}else{try{W.call()}catch(G){P=G}t.call(W.prototype)}}else{try{throw Error()}catch(G){P=G}(W=t())&&typeof W.catch=="function"&&W.catch(function(){})}}catch(G){if(G&&P&&typeof G.stack=="string")return[G.stack,P.stack]}return[null,null]}};u.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var f=Object.getOwnPropertyDescriptor(u.DetermineComponentFrameRoot,"name");f&&f.configurable&&Object.defineProperty(u.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var h=u.DetermineComponentFrameRoot(),b=h[0],E=h[1];if(b&&E){var x=b.split(`
|
|
4
|
-
`),q=E.split(`
|
|
5
|
-
`);for(f=u=0;u<x.length&&!x[u].includes("DetermineComponentFrameRoot");)u++;for(;f<q.length&&!q[f].includes("DetermineComponentFrameRoot");)f++;if(u===x.length||f===q.length)for(u=x.length-1,f=q.length-1;1<=u&&0<=f&&x[u]!==q[f];)f--;for(;1<=u&&0<=f;u--,f--)if(x[u]!==q[f]){if(u!==1||f!==1)do if(u--,f--,0>f||x[u]!==q[f]){var X=`
|
|
6
|
-
`+x[u].replace(" at new "," at ");return t.displayName&&X.includes("<anonymous>")&&(X=X.replace("<anonymous>",t.displayName)),X}while(1<=u&&0<=f);break}}}finally{un=!1,Error.prepareStackTrace=a}return(a=t?t.displayName||t.name:"")?_n(a):""}function hn(t,i){switch(t.tag){case 26:case 27:case 5:return _n(t.type);case 16:return _n("Lazy");case 13:return t.child!==i&&i!==null?_n("Suspense Fallback"):_n("Suspense");case 19:return _n("SuspenseList");case 0:case 15:return bi(t.type,!1);case 11:return bi(t.type.render,!1);case 1:return bi(t.type,!0);case 31:return _n("Activity");default:return""}}function Tt(t){try{var i="",a=null;do i+=hn(t,a),a=t,t=t.return;while(t);return i}catch(u){return`
|
|
7
|
-
Error generating stack: `+u.message+`
|
|
8
|
-
`+u.stack}}var on=Object.prototype.hasOwnProperty,Yt=e.unstable_scheduleCallback,At=e.unstable_cancelCallback,pn=e.unstable_shouldYield,Vn=e.unstable_requestPaint,Rt=e.unstable_now,st=e.unstable_getCurrentPriorityLevel,K=e.unstable_ImmediatePriority,se=e.unstable_UserBlockingPriority,ze=e.unstable_NormalPriority,je=e.unstable_LowPriority,$e=e.unstable_IdlePriority,ct=e.log,Pt=e.unstable_setDisableYieldValue,xt=null,Ot=null;function Ct(t){if(typeof ct=="function"&&Pt(t),Ot&&typeof Ot.setStrictMode=="function")try{Ot.setStrictMode(xt,t)}catch{}}var Ye=Math.clz32?Math.clz32:sa,Dn=Math.log,Zt=Math.LN2;function sa(t){return t>>>=0,t===0?32:31-(Dn(t)/Zt|0)|0}var ir=256,rr=262144,rn=4194304;function $n(t){var i=t&42;if(i!==0)return i;switch(t&-t){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return t&261888;case 262144:case 524288:case 1048576:case 2097152:return t&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return t&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return t}}function ar(t,i,a){var u=t.pendingLanes;if(u===0)return 0;var f=0,h=t.suspendedLanes,b=t.pingedLanes;t=t.warmLanes;var E=u&134217727;return E!==0?(u=E&~h,u!==0?f=$n(u):(b&=E,b!==0?f=$n(b):a||(a=E&~t,a!==0&&(f=$n(a))))):(E=u&~h,E!==0?f=$n(E):b!==0?f=$n(b):a||(a=u&~t,a!==0&&(f=$n(a)))),f===0?0:i!==0&&i!==f&&(i&h)===0&&(h=f&-f,a=i&-i,h>=a||h===32&&(a&4194048)!==0)?i:f}function Ai(t,i){return(t.pendingLanes&~(t.suspendedLanes&~t.pingedLanes)&i)===0}function Fe(t,i){switch(t){case 1:case 2:case 4:case 8:case 64:return i+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return i+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Li(){var t=rn;return rn<<=1,(rn&62914560)===0&&(rn=4194304),t}function Ui(t){for(var i=[],a=0;31>a;a++)i.push(t);return i}function lr(t,i){t.pendingLanes|=i,i!==268435456&&(t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0)}function qr(t,i,a,u,f,h){var b=t.pendingLanes;t.pendingLanes=a,t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0,t.expiredLanes&=a,t.entangledLanes&=a,t.errorRecoveryDisabledLanes&=a,t.shellSuspendCounter=0;var E=t.entanglements,x=t.expirationTimes,q=t.hiddenUpdates;for(a=b&~a;0<a;){var X=31-Ye(a),W=1<<X;E[X]=0,x[X]=-1;var P=q[X];if(P!==null)for(q[X]=null,X=0;X<P.length;X++){var G=P[X];G!==null&&(G.lane&=-536870913)}a&=~W}u!==0&&ee(t,u,0),h!==0&&f===0&&t.tag!==0&&(t.suspendedLanes|=h&~(b&~i))}function ee(t,i,a){t.pendingLanes|=i,t.suspendedLanes&=~i;var u=31-Ye(i);t.entangledLanes|=i,t.entanglements[u]=t.entanglements[u]|1073741824|a&261930}function be(t,i){var a=t.entangledLanes|=i;for(t=t.entanglements;a;){var u=31-Ye(a),f=1<<u;f&i|t[u]&i&&(t[u]|=i),a&=~f}}function pe(t,i){var a=i&-i;return a=(a&42)!==0?1:fe(a),(a&(t.suspendedLanes|i))!==0?0:a}function fe(t){switch(t){case 2:t=1;break;case 8:t=4;break;case 32:t=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:t=128;break;case 268435456:t=134217728;break;default:t=0}return t}function Ie(t){return t&=-t,2<t?8<t?(t&134217727)!==0?32:268435456:8:2}function bt(){var t=le.p;return t!==0?t:(t=window.event,t===void 0?32:jg(t.type))}function Ue(t,i){var a=le.p;try{return le.p=t,i()}finally{le.p=a}}var Ne=Math.random().toString(36).slice(2),Ke="__reactFiber$"+Ne,kt="__reactProps$"+Ne,sn="__reactContainer$"+Ne,Xt="__reactEvents$"+Ne,xi="__reactListeners$"+Ne,ur="__reactHandles$"+Ne,or="__reactResources$"+Ne,ii="__reactMarker$"+Ne;function Oi(t){delete t[Ke],delete t[kt],delete t[Xt],delete t[xi],delete t[ur]}function Mn(t){var i=t[Ke];if(i)return i;for(var a=t.parentNode;a;){if(i=a[sn]||a[Ke]){if(a=i.alternate,i.child!==null||a!==null&&a.child!==null)for(t=_g(t);t!==null;){if(a=t[Ke])return a;t=_g(t)}return i}t=a,a=t.parentNode}return null}function ri(t){if(t=t[Ke]||t[sn]){var i=t.tag;if(i===5||i===6||i===13||i===31||i===26||i===27||i===3)return t}return null}function Yn(t){var i=t.tag;if(i===5||i===26||i===27||i===6)return t.stateNode;throw Error(l(33))}function Si(t){var i=t[or];return i||(i=t[or]={hoistableStyles:new Map,hoistableScripts:new Map}),i}function wt(t){t[ii]=!0}var k=new Set,ye={};function Z(t,i){me(t,i),me(t+"Capture",i)}function me(t,i){for(ye[t]=i,t=0;t<i.length;t++)k.add(i[t])}var ge=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),an={},cn={};function Lt(t){return on.call(cn,t)?!0:on.call(an,t)?!1:ge.test(t)?cn[t]=!0:(an[t]=!0,!1)}function vi(t,i,a){if(Lt(i))if(a===null)t.removeAttribute(i);else{switch(typeof a){case"undefined":case"function":case"symbol":t.removeAttribute(i);return;case"boolean":var u=i.toLowerCase().slice(0,5);if(u!=="data-"&&u!=="aria-"){t.removeAttribute(i);return}}t.setAttribute(i,""+a)}}function ca(t,i,a){if(a===null)t.removeAttribute(i);else{switch(typeof a){case"undefined":case"function":case"symbol":case"boolean":t.removeAttribute(i);return}t.setAttribute(i,""+a)}}function ji(t,i,a,u){if(u===null)t.removeAttribute(a);else{switch(typeof u){case"undefined":case"function":case"symbol":case"boolean":t.removeAttribute(a);return}t.setAttributeNS(i,a,""+u)}}function ai(t){switch(typeof t){case"bigint":case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function lh(t){var i=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(i==="checkbox"||i==="radio")}function ov(t,i,a){var u=Object.getOwnPropertyDescriptor(t.constructor.prototype,i);if(!t.hasOwnProperty(i)&&typeof u<"u"&&typeof u.get=="function"&&typeof u.set=="function"){var f=u.get,h=u.set;return Object.defineProperty(t,i,{configurable:!0,get:function(){return f.call(this)},set:function(b){a=""+b,h.call(this,b)}}),Object.defineProperty(t,i,{enumerable:u.enumerable}),{getValue:function(){return a},setValue:function(b){a=""+b},stopTracking:function(){t._valueTracker=null,delete t[i]}}}}function us(t){if(!t._valueTracker){var i=lh(t)?"checked":"value";t._valueTracker=ov(t,i,""+t[i])}}function uh(t){if(!t)return!1;var i=t._valueTracker;if(!i)return!0;var a=i.getValue(),u="";return t&&(u=lh(t)?t.checked?"true":"false":t.value),t=u,t!==a?(i.setValue(t),!0):!1}function fu(t){if(t=t||(typeof document<"u"?document:void 0),typeof t>"u")return null;try{return t.activeElement||t.body}catch{return t.body}}var sv=/[\n"\\]/g;function li(t){return t.replace(sv,function(i){return"\\"+i.charCodeAt(0).toString(16)+" "})}function os(t,i,a,u,f,h,b,E){t.name="",b!=null&&typeof b!="function"&&typeof b!="symbol"&&typeof b!="boolean"?t.type=b:t.removeAttribute("type"),i!=null?b==="number"?(i===0&&t.value===""||t.value!=i)&&(t.value=""+ai(i)):t.value!==""+ai(i)&&(t.value=""+ai(i)):b!=="submit"&&b!=="reset"||t.removeAttribute("value"),i!=null?ss(t,b,ai(i)):a!=null?ss(t,b,ai(a)):u!=null&&t.removeAttribute("value"),f==null&&h!=null&&(t.defaultChecked=!!h),f!=null&&(t.checked=f&&typeof f!="function"&&typeof f!="symbol"),E!=null&&typeof E!="function"&&typeof E!="symbol"&&typeof E!="boolean"?t.name=""+ai(E):t.removeAttribute("name")}function oh(t,i,a,u,f,h,b,E){if(h!=null&&typeof h!="function"&&typeof h!="symbol"&&typeof h!="boolean"&&(t.type=h),i!=null||a!=null){if(!(h!=="submit"&&h!=="reset"||i!=null)){us(t);return}a=a!=null?""+ai(a):"",i=i!=null?""+ai(i):a,E||i===t.value||(t.value=i),t.defaultValue=i}u=u??f,u=typeof u!="function"&&typeof u!="symbol"&&!!u,t.checked=E?t.checked:!!u,t.defaultChecked=!!u,b!=null&&typeof b!="function"&&typeof b!="symbol"&&typeof b!="boolean"&&(t.name=b),us(t)}function ss(t,i,a){i==="number"&&fu(t.ownerDocument)===t||t.defaultValue===""+a||(t.defaultValue=""+a)}function fa(t,i,a,u){if(t=t.options,i){i={};for(var f=0;f<a.length;f++)i["$"+a[f]]=!0;for(a=0;a<t.length;a++)f=i.hasOwnProperty("$"+t[a].value),t[a].selected!==f&&(t[a].selected=f),f&&u&&(t[a].defaultSelected=!0)}else{for(a=""+ai(a),i=null,f=0;f<t.length;f++){if(t[f].value===a){t[f].selected=!0,u&&(t[f].defaultSelected=!0);return}i!==null||t[f].disabled||(i=t[f])}i!==null&&(i.selected=!0)}}function sh(t,i,a){if(i!=null&&(i=""+ai(i),i!==t.value&&(t.value=i),a==null)){t.defaultValue!==i&&(t.defaultValue=i);return}t.defaultValue=a!=null?""+ai(a):""}function ch(t,i,a,u){if(i==null){if(u!=null){if(a!=null)throw Error(l(92));if(oe(u)){if(1<u.length)throw Error(l(93));u=u[0]}a=u}a==null&&(a=""),i=a}a=ai(i),t.defaultValue=a,u=t.textContent,u===a&&u!==""&&u!==null&&(t.value=u),us(t)}function da(t,i){if(i){var a=t.firstChild;if(a&&a===t.lastChild&&a.nodeType===3){a.nodeValue=i;return}}t.textContent=i}var cv=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function fh(t,i,a){var u=i.indexOf("--")===0;a==null||typeof a=="boolean"||a===""?u?t.setProperty(i,""):i==="float"?t.cssFloat="":t[i]="":u?t.setProperty(i,a):typeof a!="number"||a===0||cv.has(i)?i==="float"?t.cssFloat=a:t[i]=(""+a).trim():t[i]=a+"px"}function dh(t,i,a){if(i!=null&&typeof i!="object")throw Error(l(62));if(t=t.style,a!=null){for(var u in a)!a.hasOwnProperty(u)||i!=null&&i.hasOwnProperty(u)||(u.indexOf("--")===0?t.setProperty(u,""):u==="float"?t.cssFloat="":t[u]="");for(var f in i)u=i[f],i.hasOwnProperty(f)&&a[f]!==u&&fh(t,f,u)}else for(var h in i)i.hasOwnProperty(h)&&fh(t,h,i[h])}function cs(t){if(t.indexOf("-")===-1)return!1;switch(t){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var fv=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["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"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["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"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["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"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),dv=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function du(t){return dv.test(""+t)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":t}function Bi(){}var fs=null;function ds(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var ha=null,pa=null;function hh(t){var i=ri(t);if(i&&(t=i.stateNode)){var a=t[kt]||null;e:switch(t=i.stateNode,i.type){case"input":if(os(t,a.value,a.defaultValue,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name),i=a.name,a.type==="radio"&&i!=null){for(a=t;a.parentNode;)a=a.parentNode;for(a=a.querySelectorAll('input[name="'+li(""+i)+'"][type="radio"]'),i=0;i<a.length;i++){var u=a[i];if(u!==t&&u.form===t.form){var f=u[kt]||null;if(!f)throw Error(l(90));os(u,f.value,f.defaultValue,f.defaultValue,f.checked,f.defaultChecked,f.type,f.name)}}for(i=0;i<a.length;i++)u=a[i],u.form===t.form&&uh(u)}break e;case"textarea":sh(t,a.value,a.defaultValue);break e;case"select":i=a.value,i!=null&&fa(t,!!a.multiple,i,!1)}}}var hs=!1;function ph(t,i,a){if(hs)return t(i,a);hs=!0;try{var u=t(i);return u}finally{if(hs=!1,(ha!==null||pa!==null)&&(Wu(),ha&&(i=ha,t=pa,pa=ha=null,hh(i),t)))for(i=0;i<t.length;i++)hh(t[i])}}function il(t,i){var a=t.stateNode;if(a===null)return null;var u=a[kt]||null;if(u===null)return null;a=u[i];e:switch(i){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(u=!u.disabled)||(t=t.type,u=!(t==="button"||t==="input"||t==="select"||t==="textarea")),t=!u;break e;default:t=!1}if(t)return null;if(a&&typeof a!="function")throw Error(l(231,i,typeof a));return a}var qi=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),ps=!1;if(qi)try{var rl={};Object.defineProperty(rl,"passive",{get:function(){ps=!0}}),window.addEventListener("test",rl,rl),window.removeEventListener("test",rl,rl)}catch{ps=!1}var sr=null,ms=null,hu=null;function mh(){if(hu)return hu;var t,i=ms,a=i.length,u,f="value"in sr?sr.value:sr.textContent,h=f.length;for(t=0;t<a&&i[t]===f[t];t++);var b=a-t;for(u=1;u<=b&&i[a-u]===f[h-u];u++);return hu=f.slice(t,1<u?1-u:void 0)}function pu(t){var i=t.keyCode;return"charCode"in t?(t=t.charCode,t===0&&i===13&&(t=13)):t=i,t===10&&(t=13),32<=t||t===13?t:0}function mu(){return!0}function gh(){return!1}function In(t){function i(a,u,f,h,b){this._reactName=a,this._targetInst=f,this.type=u,this.nativeEvent=h,this.target=b,this.currentTarget=null;for(var E in t)t.hasOwnProperty(E)&&(a=t[E],this[E]=a?a(h):h[E]);return this.isDefaultPrevented=(h.defaultPrevented!=null?h.defaultPrevented:h.returnValue===!1)?mu:gh,this.isPropagationStopped=gh,this}return g(i.prototype,{preventDefault:function(){this.defaultPrevented=!0;var a=this.nativeEvent;a&&(a.preventDefault?a.preventDefault():typeof a.returnValue!="unknown"&&(a.returnValue=!1),this.isDefaultPrevented=mu)},stopPropagation:function(){var a=this.nativeEvent;a&&(a.stopPropagation?a.stopPropagation():typeof a.cancelBubble!="unknown"&&(a.cancelBubble=!0),this.isPropagationStopped=mu)},persist:function(){},isPersistent:mu}),i}var Hr={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(t){return t.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},gu=In(Hr),al=g({},Hr,{view:0,detail:0}),hv=In(al),gs,ys,ll,yu=g({},al,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Ss,button:0,buttons:0,relatedTarget:function(t){return t.relatedTarget===void 0?t.fromElement===t.srcElement?t.toElement:t.fromElement:t.relatedTarget},movementX:function(t){return"movementX"in t?t.movementX:(t!==ll&&(ll&&t.type==="mousemove"?(gs=t.screenX-ll.screenX,ys=t.screenY-ll.screenY):ys=gs=0,ll=t),gs)},movementY:function(t){return"movementY"in t?t.movementY:ys}}),yh=In(yu),pv=g({},yu,{dataTransfer:0}),mv=In(pv),gv=g({},al,{relatedTarget:0}),bs=In(gv),yv=g({},Hr,{animationName:0,elapsedTime:0,pseudoElement:0}),bv=In(yv),Sv=g({},Hr,{clipboardData:function(t){return"clipboardData"in t?t.clipboardData:window.clipboardData}}),vv=In(Sv),Ev=g({},Hr,{data:0}),bh=In(Ev),_v={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Tv={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},kv={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function wv(t){var i=this.nativeEvent;return i.getModifierState?i.getModifierState(t):(t=kv[t])?!!i[t]:!1}function Ss(){return wv}var Av=g({},al,{key:function(t){if(t.key){var i=_v[t.key]||t.key;if(i!=="Unidentified")return i}return t.type==="keypress"?(t=pu(t),t===13?"Enter":String.fromCharCode(t)):t.type==="keydown"||t.type==="keyup"?Tv[t.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Ss,charCode:function(t){return t.type==="keypress"?pu(t):0},keyCode:function(t){return t.type==="keydown"||t.type==="keyup"?t.keyCode:0},which:function(t){return t.type==="keypress"?pu(t):t.type==="keydown"||t.type==="keyup"?t.keyCode:0}}),xv=In(Av),Ov=g({},yu,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Sh=In(Ov),Cv=g({},al,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Ss}),zv=In(Cv),Nv=g({},Hr,{propertyName:0,elapsedTime:0,pseudoElement:0}),Rv=In(Nv),Dv=g({},yu,{deltaX:function(t){return"deltaX"in t?t.deltaX:"wheelDeltaX"in t?-t.wheelDeltaX:0},deltaY:function(t){return"deltaY"in t?t.deltaY:"wheelDeltaY"in t?-t.wheelDeltaY:"wheelDelta"in t?-t.wheelDelta:0},deltaZ:0,deltaMode:0}),Mv=In(Dv),Iv=g({},Hr,{newState:0,oldState:0}),Lv=In(Iv),Uv=[9,13,27,32],vs=qi&&"CompositionEvent"in window,ul=null;qi&&"documentMode"in document&&(ul=document.documentMode);var jv=qi&&"TextEvent"in window&&!ul,vh=qi&&(!vs||ul&&8<ul&&11>=ul),Eh=" ",_h=!1;function Th(t,i){switch(t){case"keyup":return Uv.indexOf(i.keyCode)!==-1;case"keydown":return i.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function kh(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var ma=!1;function Bv(t,i){switch(t){case"compositionend":return kh(i);case"keypress":return i.which!==32?null:(_h=!0,Eh);case"textInput":return t=i.data,t===Eh&&_h?null:t;default:return null}}function qv(t,i){if(ma)return t==="compositionend"||!vs&&Th(t,i)?(t=mh(),hu=ms=sr=null,ma=!1,t):null;switch(t){case"paste":return null;case"keypress":if(!(i.ctrlKey||i.altKey||i.metaKey)||i.ctrlKey&&i.altKey){if(i.char&&1<i.char.length)return i.char;if(i.which)return String.fromCharCode(i.which)}return null;case"compositionend":return vh&&i.locale!=="ko"?null:i.data;default:return null}}var Hv={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function wh(t){var i=t&&t.nodeName&&t.nodeName.toLowerCase();return i==="input"?!!Hv[t.type]:i==="textarea"}function Ah(t,i,a,u){ha?pa?pa.push(u):pa=[u]:ha=u,i=lo(i,"onChange"),0<i.length&&(a=new gu("onChange","change",null,a,u),t.push({event:a,listeners:i}))}var ol=null,sl=null;function Pv(t){og(t,0)}function bu(t){var i=Yn(t);if(uh(i))return t}function xh(t,i){if(t==="change")return i}var Oh=!1;if(qi){var Es;if(qi){var _s="oninput"in document;if(!_s){var Ch=document.createElement("div");Ch.setAttribute("oninput","return;"),_s=typeof Ch.oninput=="function"}Es=_s}else Es=!1;Oh=Es&&(!document.documentMode||9<document.documentMode)}function zh(){ol&&(ol.detachEvent("onpropertychange",Nh),sl=ol=null)}function Nh(t){if(t.propertyName==="value"&&bu(sl)){var i=[];Ah(i,sl,t,ds(t)),ph(Pv,i)}}function Zv(t,i,a){t==="focusin"?(zh(),ol=i,sl=a,ol.attachEvent("onpropertychange",Nh)):t==="focusout"&&zh()}function Gv(t){if(t==="selectionchange"||t==="keyup"||t==="keydown")return bu(sl)}function Vv(t,i){if(t==="click")return bu(i)}function $v(t,i){if(t==="input"||t==="change")return bu(i)}function Yv(t,i){return t===i&&(t!==0||1/t===1/i)||t!==t&&i!==i}var Fn=typeof Object.is=="function"?Object.is:Yv;function cl(t,i){if(Fn(t,i))return!0;if(typeof t!="object"||t===null||typeof i!="object"||i===null)return!1;var a=Object.keys(t),u=Object.keys(i);if(a.length!==u.length)return!1;for(u=0;u<a.length;u++){var f=a[u];if(!on.call(i,f)||!Fn(t[f],i[f]))return!1}return!0}function Rh(t){for(;t&&t.firstChild;)t=t.firstChild;return t}function Dh(t,i){var a=Rh(t);t=0;for(var u;a;){if(a.nodeType===3){if(u=t+a.textContent.length,t<=i&&u>=i)return{node:a,offset:i-t};t=u}e:{for(;a;){if(a.nextSibling){a=a.nextSibling;break e}a=a.parentNode}a=void 0}a=Rh(a)}}function Mh(t,i){return t&&i?t===i?!0:t&&t.nodeType===3?!1:i&&i.nodeType===3?Mh(t,i.parentNode):"contains"in t?t.contains(i):t.compareDocumentPosition?!!(t.compareDocumentPosition(i)&16):!1:!1}function Ih(t){t=t!=null&&t.ownerDocument!=null&&t.ownerDocument.defaultView!=null?t.ownerDocument.defaultView:window;for(var i=fu(t.document);i instanceof t.HTMLIFrameElement;){try{var a=typeof i.contentWindow.location.href=="string"}catch{a=!1}if(a)t=i.contentWindow;else break;i=fu(t.document)}return i}function Ts(t){var i=t&&t.nodeName&&t.nodeName.toLowerCase();return i&&(i==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||i==="textarea"||t.contentEditable==="true")}var Fv=qi&&"documentMode"in document&&11>=document.documentMode,ga=null,ks=null,fl=null,ws=!1;function Lh(t,i,a){var u=a.window===a?a.document:a.nodeType===9?a:a.ownerDocument;ws||ga==null||ga!==fu(u)||(u=ga,"selectionStart"in u&&Ts(u)?u={start:u.selectionStart,end:u.selectionEnd}:(u=(u.ownerDocument&&u.ownerDocument.defaultView||window).getSelection(),u={anchorNode:u.anchorNode,anchorOffset:u.anchorOffset,focusNode:u.focusNode,focusOffset:u.focusOffset}),fl&&cl(fl,u)||(fl=u,u=lo(ks,"onSelect"),0<u.length&&(i=new gu("onSelect","select",null,i,a),t.push({event:i,listeners:u}),i.target=ga)))}function Pr(t,i){var a={};return a[t.toLowerCase()]=i.toLowerCase(),a["Webkit"+t]="webkit"+i,a["Moz"+t]="moz"+i,a}var ya={animationend:Pr("Animation","AnimationEnd"),animationiteration:Pr("Animation","AnimationIteration"),animationstart:Pr("Animation","AnimationStart"),transitionrun:Pr("Transition","TransitionRun"),transitionstart:Pr("Transition","TransitionStart"),transitioncancel:Pr("Transition","TransitionCancel"),transitionend:Pr("Transition","TransitionEnd")},As={},Uh={};qi&&(Uh=document.createElement("div").style,"AnimationEvent"in window||(delete ya.animationend.animation,delete ya.animationiteration.animation,delete ya.animationstart.animation),"TransitionEvent"in window||delete ya.transitionend.transition);function Zr(t){if(As[t])return As[t];if(!ya[t])return t;var i=ya[t],a;for(a in i)if(i.hasOwnProperty(a)&&a in Uh)return As[t]=i[a];return t}var jh=Zr("animationend"),Bh=Zr("animationiteration"),qh=Zr("animationstart"),Kv=Zr("transitionrun"),Xv=Zr("transitionstart"),Qv=Zr("transitioncancel"),Hh=Zr("transitionend"),Ph=new Map,xs="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");xs.push("scrollEnd");function Ei(t,i){Ph.set(t,i),Z(i,[t])}var Su=typeof reportError=="function"?reportError:function(t){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var i=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof t=="object"&&t!==null&&typeof t.message=="string"?String(t.message):String(t),error:t});if(!window.dispatchEvent(i))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",t);return}console.error(t)},ui=[],ba=0,Os=0;function vu(){for(var t=ba,i=Os=ba=0;i<t;){var a=ui[i];ui[i++]=null;var u=ui[i];ui[i++]=null;var f=ui[i];ui[i++]=null;var h=ui[i];if(ui[i++]=null,u!==null&&f!==null){var b=u.pending;b===null?f.next=f:(f.next=b.next,b.next=f),u.pending=f}h!==0&&Zh(a,f,h)}}function Eu(t,i,a,u){ui[ba++]=t,ui[ba++]=i,ui[ba++]=a,ui[ba++]=u,Os|=u,t.lanes|=u,t=t.alternate,t!==null&&(t.lanes|=u)}function Cs(t,i,a,u){return Eu(t,i,a,u),_u(t)}function Gr(t,i){return Eu(t,null,null,i),_u(t)}function Zh(t,i,a){t.lanes|=a;var u=t.alternate;u!==null&&(u.lanes|=a);for(var f=!1,h=t.return;h!==null;)h.childLanes|=a,u=h.alternate,u!==null&&(u.childLanes|=a),h.tag===22&&(t=h.stateNode,t===null||t._visibility&1||(f=!0)),t=h,h=h.return;return t.tag===3?(h=t.stateNode,f&&i!==null&&(f=31-Ye(a),t=h.hiddenUpdates,u=t[f],u===null?t[f]=[i]:u.push(i),i.lane=a|536870912),h):null}function _u(t){if(50<Dl)throw Dl=0,jc=null,Error(l(185));for(var i=t.return;i!==null;)t=i,i=t.return;return t.tag===3?t.stateNode:null}var Sa={};function Jv(t,i,a,u){this.tag=t,this.key=a,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=i,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=u,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Kn(t,i,a,u){return new Jv(t,i,a,u)}function zs(t){return t=t.prototype,!(!t||!t.isReactComponent)}function Hi(t,i){var a=t.alternate;return a===null?(a=Kn(t.tag,i,t.key,t.mode),a.elementType=t.elementType,a.type=t.type,a.stateNode=t.stateNode,a.alternate=t,t.alternate=a):(a.pendingProps=i,a.type=t.type,a.flags=0,a.subtreeFlags=0,a.deletions=null),a.flags=t.flags&65011712,a.childLanes=t.childLanes,a.lanes=t.lanes,a.child=t.child,a.memoizedProps=t.memoizedProps,a.memoizedState=t.memoizedState,a.updateQueue=t.updateQueue,i=t.dependencies,a.dependencies=i===null?null:{lanes:i.lanes,firstContext:i.firstContext},a.sibling=t.sibling,a.index=t.index,a.ref=t.ref,a.refCleanup=t.refCleanup,a}function Gh(t,i){t.flags&=65011714;var a=t.alternate;return a===null?(t.childLanes=0,t.lanes=i,t.child=null,t.subtreeFlags=0,t.memoizedProps=null,t.memoizedState=null,t.updateQueue=null,t.dependencies=null,t.stateNode=null):(t.childLanes=a.childLanes,t.lanes=a.lanes,t.child=a.child,t.subtreeFlags=0,t.deletions=null,t.memoizedProps=a.memoizedProps,t.memoizedState=a.memoizedState,t.updateQueue=a.updateQueue,t.type=a.type,i=a.dependencies,t.dependencies=i===null?null:{lanes:i.lanes,firstContext:i.firstContext}),t}function Tu(t,i,a,u,f,h){var b=0;if(u=t,typeof t=="function")zs(t)&&(b=1);else if(typeof t=="string")b=i_(t,a,he.current)?26:t==="html"||t==="head"||t==="body"?27:5;else e:switch(t){case de:return t=Kn(31,a,i,f),t.elementType=de,t.lanes=h,t;case N:return Vr(a.children,f,h,i);case M:b=8,f|=24;break;case A:return t=Kn(12,a,i,f|2),t.elementType=A,t.lanes=h,t;case ue:return t=Kn(13,a,i,f),t.elementType=ue,t.lanes=h,t;case D:return t=Kn(19,a,i,f),t.elementType=D,t.lanes=h,t;default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case j:b=10;break e;case V:b=9;break e;case ae:b=11;break e;case $:b=14;break e;case re:b=16,u=null;break e}b=29,a=Error(l(130,t===null?"null":typeof t,"")),u=null}return i=Kn(b,a,i,f),i.elementType=t,i.type=u,i.lanes=h,i}function Vr(t,i,a,u){return t=Kn(7,t,u,i),t.lanes=a,t}function Ns(t,i,a){return t=Kn(6,t,null,i),t.lanes=a,t}function Vh(t){var i=Kn(18,null,null,0);return i.stateNode=t,i}function Rs(t,i,a){return i=Kn(4,t.children!==null?t.children:[],t.key,i),i.lanes=a,i.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},i}var $h=new WeakMap;function oi(t,i){if(typeof t=="object"&&t!==null){var a=$h.get(t);return a!==void 0?a:(i={value:t,source:i,stack:Tt(i)},$h.set(t,i),i)}return{value:t,source:i,stack:Tt(i)}}var va=[],Ea=0,ku=null,dl=0,si=[],ci=0,cr=null,Ci=1,zi="";function Pi(t,i){va[Ea++]=dl,va[Ea++]=ku,ku=t,dl=i}function Yh(t,i,a){si[ci++]=Ci,si[ci++]=zi,si[ci++]=cr,cr=t;var u=Ci;t=zi;var f=32-Ye(u)-1;u&=~(1<<f),a+=1;var h=32-Ye(i)+f;if(30<h){var b=f-f%5;h=(u&(1<<b)-1).toString(32),u>>=b,f-=b,Ci=1<<32-Ye(i)+f|a<<f|u,zi=h+t}else Ci=1<<h|a<<f|u,zi=t}function Ds(t){t.return!==null&&(Pi(t,1),Yh(t,1,0))}function Ms(t){for(;t===ku;)ku=va[--Ea],va[Ea]=null,dl=va[--Ea],va[Ea]=null;for(;t===cr;)cr=si[--ci],si[ci]=null,zi=si[--ci],si[ci]=null,Ci=si[--ci],si[ci]=null}function Fh(t,i){si[ci++]=Ci,si[ci++]=zi,si[ci++]=cr,Ci=i.id,zi=i.overflow,cr=t}var mn=null,zt=null,tt=!1,fr=null,fi=!1,Is=Error(l(519));function dr(t){var i=Error(l(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw hl(oi(i,t)),Is}function Kh(t){var i=t.stateNode,a=t.type,u=t.memoizedProps;switch(i[Ke]=t,i[kt]=u,a){case"dialog":Qe("cancel",i),Qe("close",i);break;case"iframe":case"object":case"embed":Qe("load",i);break;case"video":case"audio":for(a=0;a<Il.length;a++)Qe(Il[a],i);break;case"source":Qe("error",i);break;case"img":case"image":case"link":Qe("error",i),Qe("load",i);break;case"details":Qe("toggle",i);break;case"input":Qe("invalid",i),oh(i,u.value,u.defaultValue,u.checked,u.defaultChecked,u.type,u.name,!0);break;case"select":Qe("invalid",i);break;case"textarea":Qe("invalid",i),ch(i,u.value,u.defaultValue,u.children)}a=u.children,typeof a!="string"&&typeof a!="number"&&typeof a!="bigint"||i.textContent===""+a||u.suppressHydrationWarning===!0||dg(i.textContent,a)?(u.popover!=null&&(Qe("beforetoggle",i),Qe("toggle",i)),u.onScroll!=null&&Qe("scroll",i),u.onScrollEnd!=null&&Qe("scrollend",i),u.onClick!=null&&(i.onclick=Bi),i=!0):i=!1,i||dr(t,!0)}function Xh(t){for(mn=t.return;mn;)switch(mn.tag){case 5:case 31:case 13:fi=!1;return;case 27:case 3:fi=!0;return;default:mn=mn.return}}function _a(t){if(t!==mn)return!1;if(!tt)return Xh(t),tt=!0,!1;var i=t.tag,a;if((a=i!==3&&i!==27)&&((a=i===5)&&(a=t.type,a=!(a!=="form"&&a!=="button")||Wc(t.type,t.memoizedProps)),a=!a),a&&zt&&dr(t),Xh(t),i===13){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(l(317));zt=Eg(t)}else if(i===31){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(l(317));zt=Eg(t)}else i===27?(i=zt,Ar(t.type)?(t=af,af=null,zt=t):zt=i):zt=mn?hi(t.stateNode.nextSibling):null;return!0}function $r(){zt=mn=null,tt=!1}function Ls(){var t=fr;return t!==null&&(Bn===null?Bn=t:Bn.push.apply(Bn,t),fr=null),t}function hl(t){fr===null?fr=[t]:fr.push(t)}var Us=z(null),Yr=null,Zi=null;function hr(t,i,a){T(Us,i._currentValue),i._currentValue=a}function Gi(t){t._currentValue=Us.current,F(Us)}function js(t,i,a){for(;t!==null;){var u=t.alternate;if((t.childLanes&i)!==i?(t.childLanes|=i,u!==null&&(u.childLanes|=i)):u!==null&&(u.childLanes&i)!==i&&(u.childLanes|=i),t===a)break;t=t.return}}function Bs(t,i,a,u){var f=t.child;for(f!==null&&(f.return=t);f!==null;){var h=f.dependencies;if(h!==null){var b=f.child;h=h.firstContext;e:for(;h!==null;){var E=h;h=f;for(var x=0;x<i.length;x++)if(E.context===i[x]){h.lanes|=a,E=h.alternate,E!==null&&(E.lanes|=a),js(h.return,a,t),u||(b=null);break e}h=E.next}}else if(f.tag===18){if(b=f.return,b===null)throw Error(l(341));b.lanes|=a,h=b.alternate,h!==null&&(h.lanes|=a),js(b,a,t),b=null}else b=f.child;if(b!==null)b.return=f;else for(b=f;b!==null;){if(b===t){b=null;break}if(f=b.sibling,f!==null){f.return=b.return,b=f;break}b=b.return}f=b}}function Ta(t,i,a,u){t=null;for(var f=i,h=!1;f!==null;){if(!h){if((f.flags&524288)!==0)h=!0;else if((f.flags&262144)!==0)break}if(f.tag===10){var b=f.alternate;if(b===null)throw Error(l(387));if(b=b.memoizedProps,b!==null){var E=f.type;Fn(f.pendingProps.value,b.value)||(t!==null?t.push(E):t=[E])}}else if(f===Ze.current){if(b=f.alternate,b===null)throw Error(l(387));b.memoizedState.memoizedState!==f.memoizedState.memoizedState&&(t!==null?t.push(ql):t=[ql])}f=f.return}t!==null&&Bs(i,t,a,u),i.flags|=262144}function wu(t){for(t=t.firstContext;t!==null;){if(!Fn(t.context._currentValue,t.memoizedValue))return!0;t=t.next}return!1}function Fr(t){Yr=t,Zi=null,t=t.dependencies,t!==null&&(t.firstContext=null)}function gn(t){return Qh(Yr,t)}function Au(t,i){return Yr===null&&Fr(t),Qh(t,i)}function Qh(t,i){var a=i._currentValue;if(i={context:i,memoizedValue:a,next:null},Zi===null){if(t===null)throw Error(l(308));Zi=i,t.dependencies={lanes:0,firstContext:i},t.flags|=524288}else Zi=Zi.next=i;return a}var Wv=typeof AbortController<"u"?AbortController:function(){var t=[],i=this.signal={aborted:!1,addEventListener:function(a,u){t.push(u)}};this.abort=function(){i.aborted=!0,t.forEach(function(a){return a()})}},eE=e.unstable_scheduleCallback,tE=e.unstable_NormalPriority,Qt={$$typeof:j,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function qs(){return{controller:new Wv,data:new Map,refCount:0}}function pl(t){t.refCount--,t.refCount===0&&eE(tE,function(){t.controller.abort()})}var ml=null,Hs=0,ka=0,wa=null;function nE(t,i){if(ml===null){var a=ml=[];Hs=0,ka=Gc(),wa={status:"pending",value:void 0,then:function(u){a.push(u)}}}return Hs++,i.then(Jh,Jh),i}function Jh(){if(--Hs===0&&ml!==null){wa!==null&&(wa.status="fulfilled");var t=ml;ml=null,ka=0,wa=null;for(var i=0;i<t.length;i++)(0,t[i])()}}function iE(t,i){var a=[],u={status:"pending",value:null,reason:null,then:function(f){a.push(f)}};return t.then(function(){u.status="fulfilled",u.value=i;for(var f=0;f<a.length;f++)(0,a[f])(i)},function(f){for(u.status="rejected",u.reason=f,f=0;f<a.length;f++)(0,a[f])(void 0)}),u}var Wh=H.S;H.S=function(t,i){Lm=Rt(),typeof i=="object"&&i!==null&&typeof i.then=="function"&&nE(t,i),Wh!==null&&Wh(t,i)};var Kr=z(null);function Ps(){var t=Kr.current;return t!==null?t:St.pooledCache}function xu(t,i){i===null?T(Kr,Kr.current):T(Kr,i.pool)}function ep(){var t=Ps();return t===null?null:{parent:Qt._currentValue,pool:t}}var Aa=Error(l(460)),Zs=Error(l(474)),Ou=Error(l(542)),Cu={then:function(){}};function tp(t){return t=t.status,t==="fulfilled"||t==="rejected"}function np(t,i,a){switch(a=t[a],a===void 0?t.push(i):a!==i&&(i.then(Bi,Bi),i=a),i.status){case"fulfilled":return i.value;case"rejected":throw t=i.reason,rp(t),t;default:if(typeof i.status=="string")i.then(Bi,Bi);else{if(t=St,t!==null&&100<t.shellSuspendCounter)throw Error(l(482));t=i,t.status="pending",t.then(function(u){if(i.status==="pending"){var f=i;f.status="fulfilled",f.value=u}},function(u){if(i.status==="pending"){var f=i;f.status="rejected",f.reason=u}})}switch(i.status){case"fulfilled":return i.value;case"rejected":throw t=i.reason,rp(t),t}throw Qr=i,Aa}}function Xr(t){try{var i=t._init;return i(t._payload)}catch(a){throw a!==null&&typeof a=="object"&&typeof a.then=="function"?(Qr=a,Aa):a}}var Qr=null;function ip(){if(Qr===null)throw Error(l(459));var t=Qr;return Qr=null,t}function rp(t){if(t===Aa||t===Ou)throw Error(l(483))}var xa=null,gl=0;function zu(t){var i=gl;return gl+=1,xa===null&&(xa=[]),np(xa,t,i)}function yl(t,i){i=i.props.ref,t.ref=i!==void 0?i:null}function Nu(t,i){throw i.$$typeof===S?Error(l(525)):(t=Object.prototype.toString.call(i),Error(l(31,t==="[object Object]"?"object with keys {"+Object.keys(i).join(", ")+"}":t)))}function ap(t){function i(L,R){if(t){var B=L.deletions;B===null?(L.deletions=[R],L.flags|=16):B.push(R)}}function a(L,R){if(!t)return null;for(;R!==null;)i(L,R),R=R.sibling;return null}function u(L){for(var R=new Map;L!==null;)L.key!==null?R.set(L.key,L):R.set(L.index,L),L=L.sibling;return R}function f(L,R){return L=Hi(L,R),L.index=0,L.sibling=null,L}function h(L,R,B){return L.index=B,t?(B=L.alternate,B!==null?(B=B.index,B<R?(L.flags|=67108866,R):B):(L.flags|=67108866,R)):(L.flags|=1048576,R)}function b(L){return t&&L.alternate===null&&(L.flags|=67108866),L}function E(L,R,B,J){return R===null||R.tag!==6?(R=Ns(B,L.mode,J),R.return=L,R):(R=f(R,B),R.return=L,R)}function x(L,R,B,J){var Oe=B.type;return Oe===N?X(L,R,B.props.children,J,B.key):R!==null&&(R.elementType===Oe||typeof Oe=="object"&&Oe!==null&&Oe.$$typeof===re&&Xr(Oe)===R.type)?(R=f(R,B.props),yl(R,B),R.return=L,R):(R=Tu(B.type,B.key,B.props,null,L.mode,J),yl(R,B),R.return=L,R)}function q(L,R,B,J){return R===null||R.tag!==4||R.stateNode.containerInfo!==B.containerInfo||R.stateNode.implementation!==B.implementation?(R=Rs(B,L.mode,J),R.return=L,R):(R=f(R,B.children||[]),R.return=L,R)}function X(L,R,B,J,Oe){return R===null||R.tag!==7?(R=Vr(B,L.mode,J,Oe),R.return=L,R):(R=f(R,B),R.return=L,R)}function W(L,R,B){if(typeof R=="string"&&R!==""||typeof R=="number"||typeof R=="bigint")return R=Ns(""+R,L.mode,B),R.return=L,R;if(typeof R=="object"&&R!==null){switch(R.$$typeof){case v:return B=Tu(R.type,R.key,R.props,null,L.mode,B),yl(B,R),B.return=L,B;case _:return R=Rs(R,L.mode,B),R.return=L,R;case re:return R=Xr(R),W(L,R,B)}if(oe(R)||ne(R))return R=Vr(R,L.mode,B,null),R.return=L,R;if(typeof R.then=="function")return W(L,zu(R),B);if(R.$$typeof===j)return W(L,Au(L,R),B);Nu(L,R)}return null}function P(L,R,B,J){var Oe=R!==null?R.key:null;if(typeof B=="string"&&B!==""||typeof B=="number"||typeof B=="bigint")return Oe!==null?null:E(L,R,""+B,J);if(typeof B=="object"&&B!==null){switch(B.$$typeof){case v:return B.key===Oe?x(L,R,B,J):null;case _:return B.key===Oe?q(L,R,B,J):null;case re:return B=Xr(B),P(L,R,B,J)}if(oe(B)||ne(B))return Oe!==null?null:X(L,R,B,J,null);if(typeof B.then=="function")return P(L,R,zu(B),J);if(B.$$typeof===j)return P(L,R,Au(L,B),J);Nu(L,B)}return null}function G(L,R,B,J,Oe){if(typeof J=="string"&&J!==""||typeof J=="number"||typeof J=="bigint")return L=L.get(B)||null,E(R,L,""+J,Oe);if(typeof J=="object"&&J!==null){switch(J.$$typeof){case v:return L=L.get(J.key===null?B:J.key)||null,x(R,L,J,Oe);case _:return L=L.get(J.key===null?B:J.key)||null,q(R,L,J,Oe);case re:return J=Xr(J),G(L,R,B,J,Oe)}if(oe(J)||ne(J))return L=L.get(B)||null,X(R,L,J,Oe,null);if(typeof J.then=="function")return G(L,R,B,zu(J),Oe);if(J.$$typeof===j)return G(L,R,B,Au(R,J),Oe);Nu(R,J)}return null}function Ee(L,R,B,J){for(var Oe=null,rt=null,we=R,Ve=R=0,et=null;we!==null&&Ve<B.length;Ve++){we.index>Ve?(et=we,we=null):et=we.sibling;var at=P(L,we,B[Ve],J);if(at===null){we===null&&(we=et);break}t&&we&&at.alternate===null&&i(L,we),R=h(at,R,Ve),rt===null?Oe=at:rt.sibling=at,rt=at,we=et}if(Ve===B.length)return a(L,we),tt&&Pi(L,Ve),Oe;if(we===null){for(;Ve<B.length;Ve++)we=W(L,B[Ve],J),we!==null&&(R=h(we,R,Ve),rt===null?Oe=we:rt.sibling=we,rt=we);return tt&&Pi(L,Ve),Oe}for(we=u(we);Ve<B.length;Ve++)et=G(we,L,Ve,B[Ve],J),et!==null&&(t&&et.alternate!==null&&we.delete(et.key===null?Ve:et.key),R=h(et,R,Ve),rt===null?Oe=et:rt.sibling=et,rt=et);return t&&we.forEach(function(Nr){return i(L,Nr)}),tt&&Pi(L,Ve),Oe}function De(L,R,B,J){if(B==null)throw Error(l(151));for(var Oe=null,rt=null,we=R,Ve=R=0,et=null,at=B.next();we!==null&&!at.done;Ve++,at=B.next()){we.index>Ve?(et=we,we=null):et=we.sibling;var Nr=P(L,we,at.value,J);if(Nr===null){we===null&&(we=et);break}t&&we&&Nr.alternate===null&&i(L,we),R=h(Nr,R,Ve),rt===null?Oe=Nr:rt.sibling=Nr,rt=Nr,we=et}if(at.done)return a(L,we),tt&&Pi(L,Ve),Oe;if(we===null){for(;!at.done;Ve++,at=B.next())at=W(L,at.value,J),at!==null&&(R=h(at,R,Ve),rt===null?Oe=at:rt.sibling=at,rt=at);return tt&&Pi(L,Ve),Oe}for(we=u(we);!at.done;Ve++,at=B.next())at=G(we,L,Ve,at.value,J),at!==null&&(t&&at.alternate!==null&&we.delete(at.key===null?Ve:at.key),R=h(at,R,Ve),rt===null?Oe=at:rt.sibling=at,rt=at);return t&&we.forEach(function(p_){return i(L,p_)}),tt&&Pi(L,Ve),Oe}function gt(L,R,B,J){if(typeof B=="object"&&B!==null&&B.type===N&&B.key===null&&(B=B.props.children),typeof B=="object"&&B!==null){switch(B.$$typeof){case v:e:{for(var Oe=B.key;R!==null;){if(R.key===Oe){if(Oe=B.type,Oe===N){if(R.tag===7){a(L,R.sibling),J=f(R,B.props.children),J.return=L,L=J;break e}}else if(R.elementType===Oe||typeof Oe=="object"&&Oe!==null&&Oe.$$typeof===re&&Xr(Oe)===R.type){a(L,R.sibling),J=f(R,B.props),yl(J,B),J.return=L,L=J;break e}a(L,R);break}else i(L,R);R=R.sibling}B.type===N?(J=Vr(B.props.children,L.mode,J,B.key),J.return=L,L=J):(J=Tu(B.type,B.key,B.props,null,L.mode,J),yl(J,B),J.return=L,L=J)}return b(L);case _:e:{for(Oe=B.key;R!==null;){if(R.key===Oe)if(R.tag===4&&R.stateNode.containerInfo===B.containerInfo&&R.stateNode.implementation===B.implementation){a(L,R.sibling),J=f(R,B.children||[]),J.return=L,L=J;break e}else{a(L,R);break}else i(L,R);R=R.sibling}J=Rs(B,L.mode,J),J.return=L,L=J}return b(L);case re:return B=Xr(B),gt(L,R,B,J)}if(oe(B))return Ee(L,R,B,J);if(ne(B)){if(Oe=ne(B),typeof Oe!="function")throw Error(l(150));return B=Oe.call(B),De(L,R,B,J)}if(typeof B.then=="function")return gt(L,R,zu(B),J);if(B.$$typeof===j)return gt(L,R,Au(L,B),J);Nu(L,B)}return typeof B=="string"&&B!==""||typeof B=="number"||typeof B=="bigint"?(B=""+B,R!==null&&R.tag===6?(a(L,R.sibling),J=f(R,B),J.return=L,L=J):(a(L,R),J=Ns(B,L.mode,J),J.return=L,L=J),b(L)):a(L,R)}return function(L,R,B,J){try{gl=0;var Oe=gt(L,R,B,J);return xa=null,Oe}catch(we){if(we===Aa||we===Ou)throw we;var rt=Kn(29,we,null,L.mode);return rt.lanes=J,rt.return=L,rt}}}var Jr=ap(!0),lp=ap(!1),pr=!1;function Gs(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Vs(t,i){t=t.updateQueue,i.updateQueue===t&&(i.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,callbacks:null})}function mr(t){return{lane:t,tag:0,payload:null,callback:null,next:null}}function gr(t,i,a){var u=t.updateQueue;if(u===null)return null;if(u=u.shared,(ot&2)!==0){var f=u.pending;return f===null?i.next=i:(i.next=f.next,f.next=i),u.pending=i,i=_u(t),Zh(t,null,a),i}return Eu(t,u,i,a),_u(t)}function bl(t,i,a){if(i=i.updateQueue,i!==null&&(i=i.shared,(a&4194048)!==0)){var u=i.lanes;u&=t.pendingLanes,a|=u,i.lanes=a,be(t,a)}}function $s(t,i){var a=t.updateQueue,u=t.alternate;if(u!==null&&(u=u.updateQueue,a===u)){var f=null,h=null;if(a=a.firstBaseUpdate,a!==null){do{var b={lane:a.lane,tag:a.tag,payload:a.payload,callback:null,next:null};h===null?f=h=b:h=h.next=b,a=a.next}while(a!==null);h===null?f=h=i:h=h.next=i}else f=h=i;a={baseState:u.baseState,firstBaseUpdate:f,lastBaseUpdate:h,shared:u.shared,callbacks:u.callbacks},t.updateQueue=a;return}t=a.lastBaseUpdate,t===null?a.firstBaseUpdate=i:t.next=i,a.lastBaseUpdate=i}var Ys=!1;function Sl(){if(Ys){var t=wa;if(t!==null)throw t}}function vl(t,i,a,u){Ys=!1;var f=t.updateQueue;pr=!1;var h=f.firstBaseUpdate,b=f.lastBaseUpdate,E=f.shared.pending;if(E!==null){f.shared.pending=null;var x=E,q=x.next;x.next=null,b===null?h=q:b.next=q,b=x;var X=t.alternate;X!==null&&(X=X.updateQueue,E=X.lastBaseUpdate,E!==b&&(E===null?X.firstBaseUpdate=q:E.next=q,X.lastBaseUpdate=x))}if(h!==null){var W=f.baseState;b=0,X=q=x=null,E=h;do{var P=E.lane&-536870913,G=P!==E.lane;if(G?(We&P)===P:(u&P)===P){P!==0&&P===ka&&(Ys=!0),X!==null&&(X=X.next={lane:0,tag:E.tag,payload:E.payload,callback:null,next:null});e:{var Ee=t,De=E;P=i;var gt=a;switch(De.tag){case 1:if(Ee=De.payload,typeof Ee=="function"){W=Ee.call(gt,W,P);break e}W=Ee;break e;case 3:Ee.flags=Ee.flags&-65537|128;case 0:if(Ee=De.payload,P=typeof Ee=="function"?Ee.call(gt,W,P):Ee,P==null)break e;W=g({},W,P);break e;case 2:pr=!0}}P=E.callback,P!==null&&(t.flags|=64,G&&(t.flags|=8192),G=f.callbacks,G===null?f.callbacks=[P]:G.push(P))}else G={lane:P,tag:E.tag,payload:E.payload,callback:E.callback,next:null},X===null?(q=X=G,x=W):X=X.next=G,b|=P;if(E=E.next,E===null){if(E=f.shared.pending,E===null)break;G=E,E=G.next,G.next=null,f.lastBaseUpdate=G,f.shared.pending=null}}while(!0);X===null&&(x=W),f.baseState=x,f.firstBaseUpdate=q,f.lastBaseUpdate=X,h===null&&(f.shared.lanes=0),Er|=b,t.lanes=b,t.memoizedState=W}}function up(t,i){if(typeof t!="function")throw Error(l(191,t));t.call(i)}function op(t,i){var a=t.callbacks;if(a!==null)for(t.callbacks=null,t=0;t<a.length;t++)up(a[t],i)}var Oa=z(null),Ru=z(0);function sp(t,i){t=Wi,T(Ru,t),T(Oa,i),Wi=t|i.baseLanes}function Fs(){T(Ru,Wi),T(Oa,Oa.current)}function Ks(){Wi=Ru.current,F(Oa),F(Ru)}var Xn=z(null),di=null;function yr(t){var i=t.alternate;T(Ft,Ft.current&1),T(Xn,t),di===null&&(i===null||Oa.current!==null||i.memoizedState!==null)&&(di=t)}function Xs(t){T(Ft,Ft.current),T(Xn,t),di===null&&(di=t)}function cp(t){t.tag===22?(T(Ft,Ft.current),T(Xn,t),di===null&&(di=t)):br()}function br(){T(Ft,Ft.current),T(Xn,Xn.current)}function Qn(t){F(Xn),di===t&&(di=null),F(Ft)}var Ft=z(0);function Du(t){for(var i=t;i!==null;){if(i.tag===13){var a=i.memoizedState;if(a!==null&&(a=a.dehydrated,a===null||nf(a)||rf(a)))return i}else if(i.tag===19&&(i.memoizedProps.revealOrder==="forwards"||i.memoizedProps.revealOrder==="backwards"||i.memoizedProps.revealOrder==="unstable_legacy-backwards"||i.memoizedProps.revealOrder==="together")){if((i.flags&128)!==0)return i}else if(i.child!==null){i.child.return=i,i=i.child;continue}if(i===t)break;for(;i.sibling===null;){if(i.return===null||i.return===t)return null;i=i.return}i.sibling.return=i.return,i=i.sibling}return null}var Vi=0,Ge=null,pt=null,Jt=null,Mu=!1,Ca=!1,Wr=!1,Iu=0,El=0,za=null,rE=0;function Gt(){throw Error(l(321))}function Qs(t,i){if(i===null)return!1;for(var a=0;a<i.length&&a<t.length;a++)if(!Fn(t[a],i[a]))return!1;return!0}function Js(t,i,a,u,f,h){return Vi=h,Ge=i,i.memoizedState=null,i.updateQueue=null,i.lanes=0,H.H=t===null||t.memoizedState===null?Yp:hc,Wr=!1,h=a(u,f),Wr=!1,Ca&&(h=dp(i,a,u,f)),fp(t),h}function fp(t){H.H=kl;var i=pt!==null&&pt.next!==null;if(Vi=0,Jt=pt=Ge=null,Mu=!1,El=0,za=null,i)throw Error(l(300));t===null||Wt||(t=t.dependencies,t!==null&&wu(t)&&(Wt=!0))}function dp(t,i,a,u){Ge=t;var f=0;do{if(Ca&&(za=null),El=0,Ca=!1,25<=f)throw Error(l(301));if(f+=1,Jt=pt=null,t.updateQueue!=null){var h=t.updateQueue;h.lastEffect=null,h.events=null,h.stores=null,h.memoCache!=null&&(h.memoCache.index=0)}H.H=Fp,h=i(a,u)}while(Ca);return h}function aE(){var t=H.H,i=t.useState()[0];return i=typeof i.then=="function"?_l(i):i,t=t.useState()[0],(pt!==null?pt.memoizedState:null)!==t&&(Ge.flags|=1024),i}function Ws(){var t=Iu!==0;return Iu=0,t}function ec(t,i,a){i.updateQueue=t.updateQueue,i.flags&=-2053,t.lanes&=~a}function tc(t){if(Mu){for(t=t.memoizedState;t!==null;){var i=t.queue;i!==null&&(i.pending=null),t=t.next}Mu=!1}Vi=0,Jt=pt=Ge=null,Ca=!1,El=Iu=0,za=null}function Cn(){var t={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Jt===null?Ge.memoizedState=Jt=t:Jt=Jt.next=t,Jt}function Kt(){if(pt===null){var t=Ge.alternate;t=t!==null?t.memoizedState:null}else t=pt.next;var i=Jt===null?Ge.memoizedState:Jt.next;if(i!==null)Jt=i,pt=t;else{if(t===null)throw Ge.alternate===null?Error(l(467)):Error(l(310));pt=t,t={memoizedState:pt.memoizedState,baseState:pt.baseState,baseQueue:pt.baseQueue,queue:pt.queue,next:null},Jt===null?Ge.memoizedState=Jt=t:Jt=Jt.next=t}return Jt}function Lu(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function _l(t){var i=El;return El+=1,za===null&&(za=[]),t=np(za,t,i),i=Ge,(Jt===null?i.memoizedState:Jt.next)===null&&(i=i.alternate,H.H=i===null||i.memoizedState===null?Yp:hc),t}function Uu(t){if(t!==null&&typeof t=="object"){if(typeof t.then=="function")return _l(t);if(t.$$typeof===j)return gn(t)}throw Error(l(438,String(t)))}function nc(t){var i=null,a=Ge.updateQueue;if(a!==null&&(i=a.memoCache),i==null){var u=Ge.alternate;u!==null&&(u=u.updateQueue,u!==null&&(u=u.memoCache,u!=null&&(i={data:u.data.map(function(f){return f.slice()}),index:0})))}if(i==null&&(i={data:[],index:0}),a===null&&(a=Lu(),Ge.updateQueue=a),a.memoCache=i,a=i.data[i.index],a===void 0)for(a=i.data[i.index]=Array(t),u=0;u<t;u++)a[u]=U;return i.index++,a}function $i(t,i){return typeof i=="function"?i(t):i}function ju(t){var i=Kt();return ic(i,pt,t)}function ic(t,i,a){var u=t.queue;if(u===null)throw Error(l(311));u.lastRenderedReducer=a;var f=t.baseQueue,h=u.pending;if(h!==null){if(f!==null){var b=f.next;f.next=h.next,h.next=b}i.baseQueue=f=h,u.pending=null}if(h=t.baseState,f===null)t.memoizedState=h;else{i=f.next;var E=b=null,x=null,q=i,X=!1;do{var W=q.lane&-536870913;if(W!==q.lane?(We&W)===W:(Vi&W)===W){var P=q.revertLane;if(P===0)x!==null&&(x=x.next={lane:0,revertLane:0,gesture:null,action:q.action,hasEagerState:q.hasEagerState,eagerState:q.eagerState,next:null}),W===ka&&(X=!0);else if((Vi&P)===P){q=q.next,P===ka&&(X=!0);continue}else W={lane:0,revertLane:q.revertLane,gesture:null,action:q.action,hasEagerState:q.hasEagerState,eagerState:q.eagerState,next:null},x===null?(E=x=W,b=h):x=x.next=W,Ge.lanes|=P,Er|=P;W=q.action,Wr&&a(h,W),h=q.hasEagerState?q.eagerState:a(h,W)}else P={lane:W,revertLane:q.revertLane,gesture:q.gesture,action:q.action,hasEagerState:q.hasEagerState,eagerState:q.eagerState,next:null},x===null?(E=x=P,b=h):x=x.next=P,Ge.lanes|=W,Er|=W;q=q.next}while(q!==null&&q!==i);if(x===null?b=h:x.next=E,!Fn(h,t.memoizedState)&&(Wt=!0,X&&(a=wa,a!==null)))throw a;t.memoizedState=h,t.baseState=b,t.baseQueue=x,u.lastRenderedState=h}return f===null&&(u.lanes=0),[t.memoizedState,u.dispatch]}function rc(t){var i=Kt(),a=i.queue;if(a===null)throw Error(l(311));a.lastRenderedReducer=t;var u=a.dispatch,f=a.pending,h=i.memoizedState;if(f!==null){a.pending=null;var b=f=f.next;do h=t(h,b.action),b=b.next;while(b!==f);Fn(h,i.memoizedState)||(Wt=!0),i.memoizedState=h,i.baseQueue===null&&(i.baseState=h),a.lastRenderedState=h}return[h,u]}function hp(t,i,a){var u=Ge,f=Kt(),h=tt;if(h){if(a===void 0)throw Error(l(407));a=a()}else a=i();var b=!Fn((pt||f).memoizedState,a);if(b&&(f.memoizedState=a,Wt=!0),f=f.queue,uc(gp.bind(null,u,f,t),[t]),f.getSnapshot!==i||b||Jt!==null&&Jt.memoizedState.tag&1){if(u.flags|=2048,Na(9,{destroy:void 0},mp.bind(null,u,f,a,i),null),St===null)throw Error(l(349));h||(Vi&127)!==0||pp(u,i,a)}return a}function pp(t,i,a){t.flags|=16384,t={getSnapshot:i,value:a},i=Ge.updateQueue,i===null?(i=Lu(),Ge.updateQueue=i,i.stores=[t]):(a=i.stores,a===null?i.stores=[t]:a.push(t))}function mp(t,i,a,u){i.value=a,i.getSnapshot=u,yp(i)&&bp(t)}function gp(t,i,a){return a(function(){yp(i)&&bp(t)})}function yp(t){var i=t.getSnapshot;t=t.value;try{var a=i();return!Fn(t,a)}catch{return!0}}function bp(t){var i=Gr(t,2);i!==null&&qn(i,t,2)}function ac(t){var i=Cn();if(typeof t=="function"){var a=t;if(t=a(),Wr){Ct(!0);try{a()}finally{Ct(!1)}}}return i.memoizedState=i.baseState=t,i.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:$i,lastRenderedState:t},i}function Sp(t,i,a,u){return t.baseState=a,ic(t,pt,typeof u=="function"?u:$i)}function lE(t,i,a,u,f){if(Hu(t))throw Error(l(485));if(t=i.action,t!==null){var h={payload:f,action:t,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(b){h.listeners.push(b)}};H.T!==null?a(!0):h.isTransition=!1,u(h),a=i.pending,a===null?(h.next=i.pending=h,vp(i,h)):(h.next=a.next,i.pending=a.next=h)}}function vp(t,i){var a=i.action,u=i.payload,f=t.state;if(i.isTransition){var h=H.T,b={};H.T=b;try{var E=a(f,u),x=H.S;x!==null&&x(b,E),Ep(t,i,E)}catch(q){lc(t,i,q)}finally{h!==null&&b.types!==null&&(h.types=b.types),H.T=h}}else try{h=a(f,u),Ep(t,i,h)}catch(q){lc(t,i,q)}}function Ep(t,i,a){a!==null&&typeof a=="object"&&typeof a.then=="function"?a.then(function(u){_p(t,i,u)},function(u){return lc(t,i,u)}):_p(t,i,a)}function _p(t,i,a){i.status="fulfilled",i.value=a,Tp(i),t.state=a,i=t.pending,i!==null&&(a=i.next,a===i?t.pending=null:(a=a.next,i.next=a,vp(t,a)))}function lc(t,i,a){var u=t.pending;if(t.pending=null,u!==null){u=u.next;do i.status="rejected",i.reason=a,Tp(i),i=i.next;while(i!==u)}t.action=null}function Tp(t){t=t.listeners;for(var i=0;i<t.length;i++)(0,t[i])()}function kp(t,i){return i}function wp(t,i){if(tt){var a=St.formState;if(a!==null){e:{var u=Ge;if(tt){if(zt){t:{for(var f=zt,h=fi;f.nodeType!==8;){if(!h){f=null;break t}if(f=hi(f.nextSibling),f===null){f=null;break t}}h=f.data,f=h==="F!"||h==="F"?f:null}if(f){zt=hi(f.nextSibling),u=f.data==="F!";break e}}dr(u)}u=!1}u&&(i=a[0])}}return a=Cn(),a.memoizedState=a.baseState=i,u={pending:null,lanes:0,dispatch:null,lastRenderedReducer:kp,lastRenderedState:i},a.queue=u,a=Gp.bind(null,Ge,u),u.dispatch=a,u=ac(!1),h=dc.bind(null,Ge,!1,u.queue),u=Cn(),f={state:i,dispatch:null,action:t,pending:null},u.queue=f,a=lE.bind(null,Ge,f,h,a),f.dispatch=a,u.memoizedState=t,[i,a,!1]}function Ap(t){var i=Kt();return xp(i,pt,t)}function xp(t,i,a){if(i=ic(t,i,kp)[0],t=ju($i)[0],typeof i=="object"&&i!==null&&typeof i.then=="function")try{var u=_l(i)}catch(b){throw b===Aa?Ou:b}else u=i;i=Kt();var f=i.queue,h=f.dispatch;return a!==i.memoizedState&&(Ge.flags|=2048,Na(9,{destroy:void 0},uE.bind(null,f,a),null)),[u,h,t]}function uE(t,i){t.action=i}function Op(t){var i=Kt(),a=pt;if(a!==null)return xp(i,a,t);Kt(),i=i.memoizedState,a=Kt();var u=a.queue.dispatch;return a.memoizedState=t,[i,u,!1]}function Na(t,i,a,u){return t={tag:t,create:a,deps:u,inst:i,next:null},i=Ge.updateQueue,i===null&&(i=Lu(),Ge.updateQueue=i),a=i.lastEffect,a===null?i.lastEffect=t.next=t:(u=a.next,a.next=t,t.next=u,i.lastEffect=t),t}function Cp(){return Kt().memoizedState}function Bu(t,i,a,u){var f=Cn();Ge.flags|=t,f.memoizedState=Na(1|i,{destroy:void 0},a,u===void 0?null:u)}function qu(t,i,a,u){var f=Kt();u=u===void 0?null:u;var h=f.memoizedState.inst;pt!==null&&u!==null&&Qs(u,pt.memoizedState.deps)?f.memoizedState=Na(i,h,a,u):(Ge.flags|=t,f.memoizedState=Na(1|i,h,a,u))}function zp(t,i){Bu(8390656,8,t,i)}function uc(t,i){qu(2048,8,t,i)}function oE(t){Ge.flags|=4;var i=Ge.updateQueue;if(i===null)i=Lu(),Ge.updateQueue=i,i.events=[t];else{var a=i.events;a===null?i.events=[t]:a.push(t)}}function Np(t){var i=Kt().memoizedState;return oE({ref:i,nextImpl:t}),function(){if((ot&2)!==0)throw Error(l(440));return i.impl.apply(void 0,arguments)}}function Rp(t,i){return qu(4,2,t,i)}function Dp(t,i){return qu(4,4,t,i)}function Mp(t,i){if(typeof i=="function"){t=t();var a=i(t);return function(){typeof a=="function"?a():i(null)}}if(i!=null)return t=t(),i.current=t,function(){i.current=null}}function Ip(t,i,a){a=a!=null?a.concat([t]):null,qu(4,4,Mp.bind(null,i,t),a)}function oc(){}function Lp(t,i){var a=Kt();i=i===void 0?null:i;var u=a.memoizedState;return i!==null&&Qs(i,u[1])?u[0]:(a.memoizedState=[t,i],t)}function Up(t,i){var a=Kt();i=i===void 0?null:i;var u=a.memoizedState;if(i!==null&&Qs(i,u[1]))return u[0];if(u=t(),Wr){Ct(!0);try{t()}finally{Ct(!1)}}return a.memoizedState=[u,i],u}function sc(t,i,a){return a===void 0||(Vi&1073741824)!==0&&(We&261930)===0?t.memoizedState=i:(t.memoizedState=a,t=jm(),Ge.lanes|=t,Er|=t,a)}function jp(t,i,a,u){return Fn(a,i)?a:Oa.current!==null?(t=sc(t,a,u),Fn(t,i)||(Wt=!0),t):(Vi&42)===0||(Vi&1073741824)!==0&&(We&261930)===0?(Wt=!0,t.memoizedState=a):(t=jm(),Ge.lanes|=t,Er|=t,i)}function Bp(t,i,a,u,f){var h=le.p;le.p=h!==0&&8>h?h:8;var b=H.T,E={};H.T=E,dc(t,!1,i,a);try{var x=f(),q=H.S;if(q!==null&&q(E,x),x!==null&&typeof x=="object"&&typeof x.then=="function"){var X=iE(x,u);Tl(t,i,X,ei(t))}else Tl(t,i,u,ei(t))}catch(W){Tl(t,i,{then:function(){},status:"rejected",reason:W},ei())}finally{le.p=h,b!==null&&E.types!==null&&(b.types=E.types),H.T=b}}function sE(){}function cc(t,i,a,u){if(t.tag!==5)throw Error(l(476));var f=qp(t).queue;Bp(t,f,i,ve,a===null?sE:function(){return Hp(t),a(u)})}function qp(t){var i=t.memoizedState;if(i!==null)return i;i={memoizedState:ve,baseState:ve,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:$i,lastRenderedState:ve},next:null};var a={};return i.next={memoizedState:a,baseState:a,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:$i,lastRenderedState:a},next:null},t.memoizedState=i,t=t.alternate,t!==null&&(t.memoizedState=i),i}function Hp(t){var i=qp(t);i.next===null&&(i=t.alternate.memoizedState),Tl(t,i.next.queue,{},ei())}function fc(){return gn(ql)}function Pp(){return Kt().memoizedState}function Zp(){return Kt().memoizedState}function cE(t){for(var i=t.return;i!==null;){switch(i.tag){case 24:case 3:var a=ei();t=mr(a);var u=gr(i,t,a);u!==null&&(qn(u,i,a),bl(u,i,a)),i={cache:qs()},t.payload=i;return}i=i.return}}function fE(t,i,a){var u=ei();a={lane:u,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null},Hu(t)?Vp(i,a):(a=Cs(t,i,a,u),a!==null&&(qn(a,t,u),$p(a,i,u)))}function Gp(t,i,a){var u=ei();Tl(t,i,a,u)}function Tl(t,i,a,u){var f={lane:u,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null};if(Hu(t))Vp(i,f);else{var h=t.alternate;if(t.lanes===0&&(h===null||h.lanes===0)&&(h=i.lastRenderedReducer,h!==null))try{var b=i.lastRenderedState,E=h(b,a);if(f.hasEagerState=!0,f.eagerState=E,Fn(E,b))return Eu(t,i,f,0),St===null&&vu(),!1}catch{}if(a=Cs(t,i,f,u),a!==null)return qn(a,t,u),$p(a,i,u),!0}return!1}function dc(t,i,a,u){if(u={lane:2,revertLane:Gc(),gesture:null,action:u,hasEagerState:!1,eagerState:null,next:null},Hu(t)){if(i)throw Error(l(479))}else i=Cs(t,a,u,2),i!==null&&qn(i,t,2)}function Hu(t){var i=t.alternate;return t===Ge||i!==null&&i===Ge}function Vp(t,i){Ca=Mu=!0;var a=t.pending;a===null?i.next=i:(i.next=a.next,a.next=i),t.pending=i}function $p(t,i,a){if((a&4194048)!==0){var u=i.lanes;u&=t.pendingLanes,a|=u,i.lanes=a,be(t,a)}}var kl={readContext:gn,use:Uu,useCallback:Gt,useContext:Gt,useEffect:Gt,useImperativeHandle:Gt,useLayoutEffect:Gt,useInsertionEffect:Gt,useMemo:Gt,useReducer:Gt,useRef:Gt,useState:Gt,useDebugValue:Gt,useDeferredValue:Gt,useTransition:Gt,useSyncExternalStore:Gt,useId:Gt,useHostTransitionStatus:Gt,useFormState:Gt,useActionState:Gt,useOptimistic:Gt,useMemoCache:Gt,useCacheRefresh:Gt};kl.useEffectEvent=Gt;var Yp={readContext:gn,use:Uu,useCallback:function(t,i){return Cn().memoizedState=[t,i===void 0?null:i],t},useContext:gn,useEffect:zp,useImperativeHandle:function(t,i,a){a=a!=null?a.concat([t]):null,Bu(4194308,4,Mp.bind(null,i,t),a)},useLayoutEffect:function(t,i){return Bu(4194308,4,t,i)},useInsertionEffect:function(t,i){Bu(4,2,t,i)},useMemo:function(t,i){var a=Cn();i=i===void 0?null:i;var u=t();if(Wr){Ct(!0);try{t()}finally{Ct(!1)}}return a.memoizedState=[u,i],u},useReducer:function(t,i,a){var u=Cn();if(a!==void 0){var f=a(i);if(Wr){Ct(!0);try{a(i)}finally{Ct(!1)}}}else f=i;return u.memoizedState=u.baseState=f,t={pending:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:f},u.queue=t,t=t.dispatch=fE.bind(null,Ge,t),[u.memoizedState,t]},useRef:function(t){var i=Cn();return t={current:t},i.memoizedState=t},useState:function(t){t=ac(t);var i=t.queue,a=Gp.bind(null,Ge,i);return i.dispatch=a,[t.memoizedState,a]},useDebugValue:oc,useDeferredValue:function(t,i){var a=Cn();return sc(a,t,i)},useTransition:function(){var t=ac(!1);return t=Bp.bind(null,Ge,t.queue,!0,!1),Cn().memoizedState=t,[!1,t]},useSyncExternalStore:function(t,i,a){var u=Ge,f=Cn();if(tt){if(a===void 0)throw Error(l(407));a=a()}else{if(a=i(),St===null)throw Error(l(349));(We&127)!==0||pp(u,i,a)}f.memoizedState=a;var h={value:a,getSnapshot:i};return f.queue=h,zp(gp.bind(null,u,h,t),[t]),u.flags|=2048,Na(9,{destroy:void 0},mp.bind(null,u,h,a,i),null),a},useId:function(){var t=Cn(),i=St.identifierPrefix;if(tt){var a=zi,u=Ci;a=(u&~(1<<32-Ye(u)-1)).toString(32)+a,i="_"+i+"R_"+a,a=Iu++,0<a&&(i+="H"+a.toString(32)),i+="_"}else a=rE++,i="_"+i+"r_"+a.toString(32)+"_";return t.memoizedState=i},useHostTransitionStatus:fc,useFormState:wp,useActionState:wp,useOptimistic:function(t){var i=Cn();i.memoizedState=i.baseState=t;var a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return i.queue=a,i=dc.bind(null,Ge,!0,a),a.dispatch=i,[t,i]},useMemoCache:nc,useCacheRefresh:function(){return Cn().memoizedState=cE.bind(null,Ge)},useEffectEvent:function(t){var i=Cn(),a={impl:t};return i.memoizedState=a,function(){if((ot&2)!==0)throw Error(l(440));return a.impl.apply(void 0,arguments)}}},hc={readContext:gn,use:Uu,useCallback:Lp,useContext:gn,useEffect:uc,useImperativeHandle:Ip,useInsertionEffect:Rp,useLayoutEffect:Dp,useMemo:Up,useReducer:ju,useRef:Cp,useState:function(){return ju($i)},useDebugValue:oc,useDeferredValue:function(t,i){var a=Kt();return jp(a,pt.memoizedState,t,i)},useTransition:function(){var t=ju($i)[0],i=Kt().memoizedState;return[typeof t=="boolean"?t:_l(t),i]},useSyncExternalStore:hp,useId:Pp,useHostTransitionStatus:fc,useFormState:Ap,useActionState:Ap,useOptimistic:function(t,i){var a=Kt();return Sp(a,pt,t,i)},useMemoCache:nc,useCacheRefresh:Zp};hc.useEffectEvent=Np;var Fp={readContext:gn,use:Uu,useCallback:Lp,useContext:gn,useEffect:uc,useImperativeHandle:Ip,useInsertionEffect:Rp,useLayoutEffect:Dp,useMemo:Up,useReducer:rc,useRef:Cp,useState:function(){return rc($i)},useDebugValue:oc,useDeferredValue:function(t,i){var a=Kt();return pt===null?sc(a,t,i):jp(a,pt.memoizedState,t,i)},useTransition:function(){var t=rc($i)[0],i=Kt().memoizedState;return[typeof t=="boolean"?t:_l(t),i]},useSyncExternalStore:hp,useId:Pp,useHostTransitionStatus:fc,useFormState:Op,useActionState:Op,useOptimistic:function(t,i){var a=Kt();return pt!==null?Sp(a,pt,t,i):(a.baseState=t,[t,a.queue.dispatch])},useMemoCache:nc,useCacheRefresh:Zp};Fp.useEffectEvent=Np;function pc(t,i,a,u){i=t.memoizedState,a=a(u,i),a=a==null?i:g({},i,a),t.memoizedState=a,t.lanes===0&&(t.updateQueue.baseState=a)}var mc={enqueueSetState:function(t,i,a){t=t._reactInternals;var u=ei(),f=mr(u);f.payload=i,a!=null&&(f.callback=a),i=gr(t,f,u),i!==null&&(qn(i,t,u),bl(i,t,u))},enqueueReplaceState:function(t,i,a){t=t._reactInternals;var u=ei(),f=mr(u);f.tag=1,f.payload=i,a!=null&&(f.callback=a),i=gr(t,f,u),i!==null&&(qn(i,t,u),bl(i,t,u))},enqueueForceUpdate:function(t,i){t=t._reactInternals;var a=ei(),u=mr(a);u.tag=2,i!=null&&(u.callback=i),i=gr(t,u,a),i!==null&&(qn(i,t,a),bl(i,t,a))}};function Kp(t,i,a,u,f,h,b){return t=t.stateNode,typeof t.shouldComponentUpdate=="function"?t.shouldComponentUpdate(u,h,b):i.prototype&&i.prototype.isPureReactComponent?!cl(a,u)||!cl(f,h):!0}function Xp(t,i,a,u){t=i.state,typeof i.componentWillReceiveProps=="function"&&i.componentWillReceiveProps(a,u),typeof i.UNSAFE_componentWillReceiveProps=="function"&&i.UNSAFE_componentWillReceiveProps(a,u),i.state!==t&&mc.enqueueReplaceState(i,i.state,null)}function ea(t,i){var a=i;if("ref"in i){a={};for(var u in i)u!=="ref"&&(a[u]=i[u])}if(t=t.defaultProps){a===i&&(a=g({},a));for(var f in t)a[f]===void 0&&(a[f]=t[f])}return a}function Qp(t){Su(t)}function Jp(t){console.error(t)}function Wp(t){Su(t)}function Pu(t,i){try{var a=t.onUncaughtError;a(i.value,{componentStack:i.stack})}catch(u){setTimeout(function(){throw u})}}function em(t,i,a){try{var u=t.onCaughtError;u(a.value,{componentStack:a.stack,errorBoundary:i.tag===1?i.stateNode:null})}catch(f){setTimeout(function(){throw f})}}function gc(t,i,a){return a=mr(a),a.tag=3,a.payload={element:null},a.callback=function(){Pu(t,i)},a}function tm(t){return t=mr(t),t.tag=3,t}function nm(t,i,a,u){var f=a.type.getDerivedStateFromError;if(typeof f=="function"){var h=u.value;t.payload=function(){return f(h)},t.callback=function(){em(i,a,u)}}var b=a.stateNode;b!==null&&typeof b.componentDidCatch=="function"&&(t.callback=function(){em(i,a,u),typeof f!="function"&&(_r===null?_r=new Set([this]):_r.add(this));var E=u.stack;this.componentDidCatch(u.value,{componentStack:E!==null?E:""})})}function dE(t,i,a,u,f){if(a.flags|=32768,u!==null&&typeof u=="object"&&typeof u.then=="function"){if(i=a.alternate,i!==null&&Ta(i,a,f,!0),a=Xn.current,a!==null){switch(a.tag){case 31:case 13:return di===null?eo():a.alternate===null&&Vt===0&&(Vt=3),a.flags&=-257,a.flags|=65536,a.lanes=f,u===Cu?a.flags|=16384:(i=a.updateQueue,i===null?a.updateQueue=new Set([u]):i.add(u),Hc(t,u,f)),!1;case 22:return a.flags|=65536,u===Cu?a.flags|=16384:(i=a.updateQueue,i===null?(i={transitions:null,markerInstances:null,retryQueue:new Set([u])},a.updateQueue=i):(a=i.retryQueue,a===null?i.retryQueue=new Set([u]):a.add(u)),Hc(t,u,f)),!1}throw Error(l(435,a.tag))}return Hc(t,u,f),eo(),!1}if(tt)return i=Xn.current,i!==null?((i.flags&65536)===0&&(i.flags|=256),i.flags|=65536,i.lanes=f,u!==Is&&(t=Error(l(422),{cause:u}),hl(oi(t,a)))):(u!==Is&&(i=Error(l(423),{cause:u}),hl(oi(i,a))),t=t.current.alternate,t.flags|=65536,f&=-f,t.lanes|=f,u=oi(u,a),f=gc(t.stateNode,u,f),$s(t,f),Vt!==4&&(Vt=2)),!1;var h=Error(l(520),{cause:u});if(h=oi(h,a),Rl===null?Rl=[h]:Rl.push(h),Vt!==4&&(Vt=2),i===null)return!0;u=oi(u,a),a=i;do{switch(a.tag){case 3:return a.flags|=65536,t=f&-f,a.lanes|=t,t=gc(a.stateNode,u,t),$s(a,t),!1;case 1:if(i=a.type,h=a.stateNode,(a.flags&128)===0&&(typeof i.getDerivedStateFromError=="function"||h!==null&&typeof h.componentDidCatch=="function"&&(_r===null||!_r.has(h))))return a.flags|=65536,f&=-f,a.lanes|=f,f=tm(f),nm(f,t,a,u),$s(a,f),!1}a=a.return}while(a!==null);return!1}var yc=Error(l(461)),Wt=!1;function yn(t,i,a,u){i.child=t===null?lp(i,null,a,u):Jr(i,t.child,a,u)}function im(t,i,a,u,f){a=a.render;var h=i.ref;if("ref"in u){var b={};for(var E in u)E!=="ref"&&(b[E]=u[E])}else b=u;return Fr(i),u=Js(t,i,a,b,h,f),E=Ws(),t!==null&&!Wt?(ec(t,i,f),Yi(t,i,f)):(tt&&E&&Ds(i),i.flags|=1,yn(t,i,u,f),i.child)}function rm(t,i,a,u,f){if(t===null){var h=a.type;return typeof h=="function"&&!zs(h)&&h.defaultProps===void 0&&a.compare===null?(i.tag=15,i.type=h,am(t,i,h,u,f)):(t=Tu(a.type,null,u,i,i.mode,f),t.ref=i.ref,t.return=i,i.child=t)}if(h=t.child,!wc(t,f)){var b=h.memoizedProps;if(a=a.compare,a=a!==null?a:cl,a(b,u)&&t.ref===i.ref)return Yi(t,i,f)}return i.flags|=1,t=Hi(h,u),t.ref=i.ref,t.return=i,i.child=t}function am(t,i,a,u,f){if(t!==null){var h=t.memoizedProps;if(cl(h,u)&&t.ref===i.ref)if(Wt=!1,i.pendingProps=u=h,wc(t,f))(t.flags&131072)!==0&&(Wt=!0);else return i.lanes=t.lanes,Yi(t,i,f)}return bc(t,i,a,u,f)}function lm(t,i,a,u){var f=u.children,h=t!==null?t.memoizedState:null;if(t===null&&i.stateNode===null&&(i.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),u.mode==="hidden"){if((i.flags&128)!==0){if(h=h!==null?h.baseLanes|a:a,t!==null){for(u=i.child=t.child,f=0;u!==null;)f=f|u.lanes|u.childLanes,u=u.sibling;u=f&~h}else u=0,i.child=null;return um(t,i,h,a,u)}if((a&536870912)!==0)i.memoizedState={baseLanes:0,cachePool:null},t!==null&&xu(i,h!==null?h.cachePool:null),h!==null?sp(i,h):Fs(),cp(i);else return u=i.lanes=536870912,um(t,i,h!==null?h.baseLanes|a:a,a,u)}else h!==null?(xu(i,h.cachePool),sp(i,h),br(),i.memoizedState=null):(t!==null&&xu(i,null),Fs(),br());return yn(t,i,f,a),i.child}function wl(t,i){return t!==null&&t.tag===22||i.stateNode!==null||(i.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),i.sibling}function um(t,i,a,u,f){var h=Ps();return h=h===null?null:{parent:Qt._currentValue,pool:h},i.memoizedState={baseLanes:a,cachePool:h},t!==null&&xu(i,null),Fs(),cp(i),t!==null&&Ta(t,i,u,!0),i.childLanes=f,null}function Zu(t,i){return i=Vu({mode:i.mode,children:i.children},t.mode),i.ref=t.ref,t.child=i,i.return=t,i}function om(t,i,a){return Jr(i,t.child,null,a),t=Zu(i,i.pendingProps),t.flags|=2,Qn(i),i.memoizedState=null,t}function hE(t,i,a){var u=i.pendingProps,f=(i.flags&128)!==0;if(i.flags&=-129,t===null){if(tt){if(u.mode==="hidden")return t=Zu(i,u),i.lanes=536870912,wl(null,t);if(Xs(i),(t=zt)?(t=vg(t,fi),t=t!==null&&t.data==="&"?t:null,t!==null&&(i.memoizedState={dehydrated:t,treeContext:cr!==null?{id:Ci,overflow:zi}:null,retryLane:536870912,hydrationErrors:null},a=Vh(t),a.return=i,i.child=a,mn=i,zt=null)):t=null,t===null)throw dr(i);return i.lanes=536870912,null}return Zu(i,u)}var h=t.memoizedState;if(h!==null){var b=h.dehydrated;if(Xs(i),f)if(i.flags&256)i.flags&=-257,i=om(t,i,a);else if(i.memoizedState!==null)i.child=t.child,i.flags|=128,i=null;else throw Error(l(558));else if(Wt||Ta(t,i,a,!1),f=(a&t.childLanes)!==0,Wt||f){if(u=St,u!==null&&(b=pe(u,a),b!==0&&b!==h.retryLane))throw h.retryLane=b,Gr(t,b),qn(u,t,b),yc;eo(),i=om(t,i,a)}else t=h.treeContext,zt=hi(b.nextSibling),mn=i,tt=!0,fr=null,fi=!1,t!==null&&Fh(i,t),i=Zu(i,u),i.flags|=4096;return i}return t=Hi(t.child,{mode:u.mode,children:u.children}),t.ref=i.ref,i.child=t,t.return=i,t}function Gu(t,i){var a=i.ref;if(a===null)t!==null&&t.ref!==null&&(i.flags|=4194816);else{if(typeof a!="function"&&typeof a!="object")throw Error(l(284));(t===null||t.ref!==a)&&(i.flags|=4194816)}}function bc(t,i,a,u,f){return Fr(i),a=Js(t,i,a,u,void 0,f),u=Ws(),t!==null&&!Wt?(ec(t,i,f),Yi(t,i,f)):(tt&&u&&Ds(i),i.flags|=1,yn(t,i,a,f),i.child)}function sm(t,i,a,u,f,h){return Fr(i),i.updateQueue=null,a=dp(i,u,a,f),fp(t),u=Ws(),t!==null&&!Wt?(ec(t,i,h),Yi(t,i,h)):(tt&&u&&Ds(i),i.flags|=1,yn(t,i,a,h),i.child)}function cm(t,i,a,u,f){if(Fr(i),i.stateNode===null){var h=Sa,b=a.contextType;typeof b=="object"&&b!==null&&(h=gn(b)),h=new a(u,h),i.memoizedState=h.state!==null&&h.state!==void 0?h.state:null,h.updater=mc,i.stateNode=h,h._reactInternals=i,h=i.stateNode,h.props=u,h.state=i.memoizedState,h.refs={},Gs(i),b=a.contextType,h.context=typeof b=="object"&&b!==null?gn(b):Sa,h.state=i.memoizedState,b=a.getDerivedStateFromProps,typeof b=="function"&&(pc(i,a,b,u),h.state=i.memoizedState),typeof a.getDerivedStateFromProps=="function"||typeof h.getSnapshotBeforeUpdate=="function"||typeof h.UNSAFE_componentWillMount!="function"&&typeof h.componentWillMount!="function"||(b=h.state,typeof h.componentWillMount=="function"&&h.componentWillMount(),typeof h.UNSAFE_componentWillMount=="function"&&h.UNSAFE_componentWillMount(),b!==h.state&&mc.enqueueReplaceState(h,h.state,null),vl(i,u,h,f),Sl(),h.state=i.memoizedState),typeof h.componentDidMount=="function"&&(i.flags|=4194308),u=!0}else if(t===null){h=i.stateNode;var E=i.memoizedProps,x=ea(a,E);h.props=x;var q=h.context,X=a.contextType;b=Sa,typeof X=="object"&&X!==null&&(b=gn(X));var W=a.getDerivedStateFromProps;X=typeof W=="function"||typeof h.getSnapshotBeforeUpdate=="function",E=i.pendingProps!==E,X||typeof h.UNSAFE_componentWillReceiveProps!="function"&&typeof h.componentWillReceiveProps!="function"||(E||q!==b)&&Xp(i,h,u,b),pr=!1;var P=i.memoizedState;h.state=P,vl(i,u,h,f),Sl(),q=i.memoizedState,E||P!==q||pr?(typeof W=="function"&&(pc(i,a,W,u),q=i.memoizedState),(x=pr||Kp(i,a,x,u,P,q,b))?(X||typeof h.UNSAFE_componentWillMount!="function"&&typeof h.componentWillMount!="function"||(typeof h.componentWillMount=="function"&&h.componentWillMount(),typeof h.UNSAFE_componentWillMount=="function"&&h.UNSAFE_componentWillMount()),typeof h.componentDidMount=="function"&&(i.flags|=4194308)):(typeof h.componentDidMount=="function"&&(i.flags|=4194308),i.memoizedProps=u,i.memoizedState=q),h.props=u,h.state=q,h.context=b,u=x):(typeof h.componentDidMount=="function"&&(i.flags|=4194308),u=!1)}else{h=i.stateNode,Vs(t,i),b=i.memoizedProps,X=ea(a,b),h.props=X,W=i.pendingProps,P=h.context,q=a.contextType,x=Sa,typeof q=="object"&&q!==null&&(x=gn(q)),E=a.getDerivedStateFromProps,(q=typeof E=="function"||typeof h.getSnapshotBeforeUpdate=="function")||typeof h.UNSAFE_componentWillReceiveProps!="function"&&typeof h.componentWillReceiveProps!="function"||(b!==W||P!==x)&&Xp(i,h,u,x),pr=!1,P=i.memoizedState,h.state=P,vl(i,u,h,f),Sl();var G=i.memoizedState;b!==W||P!==G||pr||t!==null&&t.dependencies!==null&&wu(t.dependencies)?(typeof E=="function"&&(pc(i,a,E,u),G=i.memoizedState),(X=pr||Kp(i,a,X,u,P,G,x)||t!==null&&t.dependencies!==null&&wu(t.dependencies))?(q||typeof h.UNSAFE_componentWillUpdate!="function"&&typeof h.componentWillUpdate!="function"||(typeof h.componentWillUpdate=="function"&&h.componentWillUpdate(u,G,x),typeof h.UNSAFE_componentWillUpdate=="function"&&h.UNSAFE_componentWillUpdate(u,G,x)),typeof h.componentDidUpdate=="function"&&(i.flags|=4),typeof h.getSnapshotBeforeUpdate=="function"&&(i.flags|=1024)):(typeof h.componentDidUpdate!="function"||b===t.memoizedProps&&P===t.memoizedState||(i.flags|=4),typeof h.getSnapshotBeforeUpdate!="function"||b===t.memoizedProps&&P===t.memoizedState||(i.flags|=1024),i.memoizedProps=u,i.memoizedState=G),h.props=u,h.state=G,h.context=x,u=X):(typeof h.componentDidUpdate!="function"||b===t.memoizedProps&&P===t.memoizedState||(i.flags|=4),typeof h.getSnapshotBeforeUpdate!="function"||b===t.memoizedProps&&P===t.memoizedState||(i.flags|=1024),u=!1)}return h=u,Gu(t,i),u=(i.flags&128)!==0,h||u?(h=i.stateNode,a=u&&typeof a.getDerivedStateFromError!="function"?null:h.render(),i.flags|=1,t!==null&&u?(i.child=Jr(i,t.child,null,f),i.child=Jr(i,null,a,f)):yn(t,i,a,f),i.memoizedState=h.state,t=i.child):t=Yi(t,i,f),t}function fm(t,i,a,u){return $r(),i.flags|=256,yn(t,i,a,u),i.child}var Sc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function vc(t){return{baseLanes:t,cachePool:ep()}}function Ec(t,i,a){return t=t!==null?t.childLanes&~a:0,i&&(t|=Wn),t}function dm(t,i,a){var u=i.pendingProps,f=!1,h=(i.flags&128)!==0,b;if((b=h)||(b=t!==null&&t.memoizedState===null?!1:(Ft.current&2)!==0),b&&(f=!0,i.flags&=-129),b=(i.flags&32)!==0,i.flags&=-33,t===null){if(tt){if(f?yr(i):br(),(t=zt)?(t=vg(t,fi),t=t!==null&&t.data!=="&"?t:null,t!==null&&(i.memoizedState={dehydrated:t,treeContext:cr!==null?{id:Ci,overflow:zi}:null,retryLane:536870912,hydrationErrors:null},a=Vh(t),a.return=i,i.child=a,mn=i,zt=null)):t=null,t===null)throw dr(i);return rf(t)?i.lanes=32:i.lanes=536870912,null}var E=u.children;return u=u.fallback,f?(br(),f=i.mode,E=Vu({mode:"hidden",children:E},f),u=Vr(u,f,a,null),E.return=i,u.return=i,E.sibling=u,i.child=E,u=i.child,u.memoizedState=vc(a),u.childLanes=Ec(t,b,a),i.memoizedState=Sc,wl(null,u)):(yr(i),_c(i,E))}var x=t.memoizedState;if(x!==null&&(E=x.dehydrated,E!==null)){if(h)i.flags&256?(yr(i),i.flags&=-257,i=Tc(t,i,a)):i.memoizedState!==null?(br(),i.child=t.child,i.flags|=128,i=null):(br(),E=u.fallback,f=i.mode,u=Vu({mode:"visible",children:u.children},f),E=Vr(E,f,a,null),E.flags|=2,u.return=i,E.return=i,u.sibling=E,i.child=u,Jr(i,t.child,null,a),u=i.child,u.memoizedState=vc(a),u.childLanes=Ec(t,b,a),i.memoizedState=Sc,i=wl(null,u));else if(yr(i),rf(E)){if(b=E.nextSibling&&E.nextSibling.dataset,b)var q=b.dgst;b=q,u=Error(l(419)),u.stack="",u.digest=b,hl({value:u,source:null,stack:null}),i=Tc(t,i,a)}else if(Wt||Ta(t,i,a,!1),b=(a&t.childLanes)!==0,Wt||b){if(b=St,b!==null&&(u=pe(b,a),u!==0&&u!==x.retryLane))throw x.retryLane=u,Gr(t,u),qn(b,t,u),yc;nf(E)||eo(),i=Tc(t,i,a)}else nf(E)?(i.flags|=192,i.child=t.child,i=null):(t=x.treeContext,zt=hi(E.nextSibling),mn=i,tt=!0,fr=null,fi=!1,t!==null&&Fh(i,t),i=_c(i,u.children),i.flags|=4096);return i}return f?(br(),E=u.fallback,f=i.mode,x=t.child,q=x.sibling,u=Hi(x,{mode:"hidden",children:u.children}),u.subtreeFlags=x.subtreeFlags&65011712,q!==null?E=Hi(q,E):(E=Vr(E,f,a,null),E.flags|=2),E.return=i,u.return=i,u.sibling=E,i.child=u,wl(null,u),u=i.child,E=t.child.memoizedState,E===null?E=vc(a):(f=E.cachePool,f!==null?(x=Qt._currentValue,f=f.parent!==x?{parent:x,pool:x}:f):f=ep(),E={baseLanes:E.baseLanes|a,cachePool:f}),u.memoizedState=E,u.childLanes=Ec(t,b,a),i.memoizedState=Sc,wl(t.child,u)):(yr(i),a=t.child,t=a.sibling,a=Hi(a,{mode:"visible",children:u.children}),a.return=i,a.sibling=null,t!==null&&(b=i.deletions,b===null?(i.deletions=[t],i.flags|=16):b.push(t)),i.child=a,i.memoizedState=null,a)}function _c(t,i){return i=Vu({mode:"visible",children:i},t.mode),i.return=t,t.child=i}function Vu(t,i){return t=Kn(22,t,null,i),t.lanes=0,t}function Tc(t,i,a){return Jr(i,t.child,null,a),t=_c(i,i.pendingProps.children),t.flags|=2,i.memoizedState=null,t}function hm(t,i,a){t.lanes|=i;var u=t.alternate;u!==null&&(u.lanes|=i),js(t.return,i,a)}function kc(t,i,a,u,f,h){var b=t.memoizedState;b===null?t.memoizedState={isBackwards:i,rendering:null,renderingStartTime:0,last:u,tail:a,tailMode:f,treeForkCount:h}:(b.isBackwards=i,b.rendering=null,b.renderingStartTime=0,b.last=u,b.tail=a,b.tailMode=f,b.treeForkCount=h)}function pm(t,i,a){var u=i.pendingProps,f=u.revealOrder,h=u.tail;u=u.children;var b=Ft.current,E=(b&2)!==0;if(E?(b=b&1|2,i.flags|=128):b&=1,T(Ft,b),yn(t,i,u,a),u=tt?dl:0,!E&&t!==null&&(t.flags&128)!==0)e:for(t=i.child;t!==null;){if(t.tag===13)t.memoizedState!==null&&hm(t,a,i);else if(t.tag===19)hm(t,a,i);else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===i)break e;for(;t.sibling===null;){if(t.return===null||t.return===i)break e;t=t.return}t.sibling.return=t.return,t=t.sibling}switch(f){case"forwards":for(a=i.child,f=null;a!==null;)t=a.alternate,t!==null&&Du(t)===null&&(f=a),a=a.sibling;a=f,a===null?(f=i.child,i.child=null):(f=a.sibling,a.sibling=null),kc(i,!1,f,a,h,u);break;case"backwards":case"unstable_legacy-backwards":for(a=null,f=i.child,i.child=null;f!==null;){if(t=f.alternate,t!==null&&Du(t)===null){i.child=f;break}t=f.sibling,f.sibling=a,a=f,f=t}kc(i,!0,a,null,h,u);break;case"together":kc(i,!1,null,null,void 0,u);break;default:i.memoizedState=null}return i.child}function Yi(t,i,a){if(t!==null&&(i.dependencies=t.dependencies),Er|=i.lanes,(a&i.childLanes)===0)if(t!==null){if(Ta(t,i,a,!1),(a&i.childLanes)===0)return null}else return null;if(t!==null&&i.child!==t.child)throw Error(l(153));if(i.child!==null){for(t=i.child,a=Hi(t,t.pendingProps),i.child=a,a.return=i;t.sibling!==null;)t=t.sibling,a=a.sibling=Hi(t,t.pendingProps),a.return=i;a.sibling=null}return i.child}function wc(t,i){return(t.lanes&i)!==0?!0:(t=t.dependencies,!!(t!==null&&wu(t)))}function pE(t,i,a){switch(i.tag){case 3:ut(i,i.stateNode.containerInfo),hr(i,Qt,t.memoizedState.cache),$r();break;case 27:case 5:dn(i);break;case 4:ut(i,i.stateNode.containerInfo);break;case 10:hr(i,i.type,i.memoizedProps.value);break;case 31:if(i.memoizedState!==null)return i.flags|=128,Xs(i),null;break;case 13:var u=i.memoizedState;if(u!==null)return u.dehydrated!==null?(yr(i),i.flags|=128,null):(a&i.child.childLanes)!==0?dm(t,i,a):(yr(i),t=Yi(t,i,a),t!==null?t.sibling:null);yr(i);break;case 19:var f=(t.flags&128)!==0;if(u=(a&i.childLanes)!==0,u||(Ta(t,i,a,!1),u=(a&i.childLanes)!==0),f){if(u)return pm(t,i,a);i.flags|=128}if(f=i.memoizedState,f!==null&&(f.rendering=null,f.tail=null,f.lastEffect=null),T(Ft,Ft.current),u)break;return null;case 22:return i.lanes=0,lm(t,i,a,i.pendingProps);case 24:hr(i,Qt,t.memoizedState.cache)}return Yi(t,i,a)}function mm(t,i,a){if(t!==null)if(t.memoizedProps!==i.pendingProps)Wt=!0;else{if(!wc(t,a)&&(i.flags&128)===0)return Wt=!1,pE(t,i,a);Wt=(t.flags&131072)!==0}else Wt=!1,tt&&(i.flags&1048576)!==0&&Yh(i,dl,i.index);switch(i.lanes=0,i.tag){case 16:e:{var u=i.pendingProps;if(t=Xr(i.elementType),i.type=t,typeof t=="function")zs(t)?(u=ea(t,u),i.tag=1,i=cm(null,i,t,u,a)):(i.tag=0,i=bc(null,i,t,u,a));else{if(t!=null){var f=t.$$typeof;if(f===ae){i.tag=11,i=im(null,i,t,u,a);break e}else if(f===$){i.tag=14,i=rm(null,i,t,u,a);break e}}throw i=Se(t)||t,Error(l(306,i,""))}}return i;case 0:return bc(t,i,i.type,i.pendingProps,a);case 1:return u=i.type,f=ea(u,i.pendingProps),cm(t,i,u,f,a);case 3:e:{if(ut(i,i.stateNode.containerInfo),t===null)throw Error(l(387));u=i.pendingProps;var h=i.memoizedState;f=h.element,Vs(t,i),vl(i,u,null,a);var b=i.memoizedState;if(u=b.cache,hr(i,Qt,u),u!==h.cache&&Bs(i,[Qt],a,!0),Sl(),u=b.element,h.isDehydrated)if(h={element:u,isDehydrated:!1,cache:b.cache},i.updateQueue.baseState=h,i.memoizedState=h,i.flags&256){i=fm(t,i,u,a);break e}else if(u!==f){f=oi(Error(l(424)),i),hl(f),i=fm(t,i,u,a);break e}else for(t=i.stateNode.containerInfo,t.nodeType===9?t=t.body:t=t.nodeName==="HTML"?t.ownerDocument.body:t,zt=hi(t.firstChild),mn=i,tt=!0,fr=null,fi=!0,a=lp(i,null,u,a),i.child=a;a;)a.flags=a.flags&-3|4096,a=a.sibling;else{if($r(),u===f){i=Yi(t,i,a);break e}yn(t,i,u,a)}i=i.child}return i;case 26:return Gu(t,i),t===null?(a=Ag(i.type,null,i.pendingProps,null))?i.memoizedState=a:tt||(a=i.type,t=i.pendingProps,u=uo(Te.current).createElement(a),u[Ke]=i,u[kt]=t,bn(u,a,t),wt(u),i.stateNode=u):i.memoizedState=Ag(i.type,t.memoizedProps,i.pendingProps,t.memoizedState),null;case 27:return dn(i),t===null&&tt&&(u=i.stateNode=Tg(i.type,i.pendingProps,Te.current),mn=i,fi=!0,f=zt,Ar(i.type)?(af=f,zt=hi(u.firstChild)):zt=f),yn(t,i,i.pendingProps.children,a),Gu(t,i),t===null&&(i.flags|=4194304),i.child;case 5:return t===null&&tt&&((f=u=zt)&&(u=GE(u,i.type,i.pendingProps,fi),u!==null?(i.stateNode=u,mn=i,zt=hi(u.firstChild),fi=!1,f=!0):f=!1),f||dr(i)),dn(i),f=i.type,h=i.pendingProps,b=t!==null?t.memoizedProps:null,u=h.children,Wc(f,h)?u=null:b!==null&&Wc(f,b)&&(i.flags|=32),i.memoizedState!==null&&(f=Js(t,i,aE,null,null,a),ql._currentValue=f),Gu(t,i),yn(t,i,u,a),i.child;case 6:return t===null&&tt&&((t=a=zt)&&(a=VE(a,i.pendingProps,fi),a!==null?(i.stateNode=a,mn=i,zt=null,t=!0):t=!1),t||dr(i)),null;case 13:return dm(t,i,a);case 4:return ut(i,i.stateNode.containerInfo),u=i.pendingProps,t===null?i.child=Jr(i,null,u,a):yn(t,i,u,a),i.child;case 11:return im(t,i,i.type,i.pendingProps,a);case 7:return yn(t,i,i.pendingProps,a),i.child;case 8:return yn(t,i,i.pendingProps.children,a),i.child;case 12:return yn(t,i,i.pendingProps.children,a),i.child;case 10:return u=i.pendingProps,hr(i,i.type,u.value),yn(t,i,u.children,a),i.child;case 9:return f=i.type._context,u=i.pendingProps.children,Fr(i),f=gn(f),u=u(f),i.flags|=1,yn(t,i,u,a),i.child;case 14:return rm(t,i,i.type,i.pendingProps,a);case 15:return am(t,i,i.type,i.pendingProps,a);case 19:return pm(t,i,a);case 31:return hE(t,i,a);case 22:return lm(t,i,a,i.pendingProps);case 24:return Fr(i),u=gn(Qt),t===null?(f=Ps(),f===null&&(f=St,h=qs(),f.pooledCache=h,h.refCount++,h!==null&&(f.pooledCacheLanes|=a),f=h),i.memoizedState={parent:u,cache:f},Gs(i),hr(i,Qt,f)):((t.lanes&a)!==0&&(Vs(t,i),vl(i,null,null,a),Sl()),f=t.memoizedState,h=i.memoizedState,f.parent!==u?(f={parent:u,cache:u},i.memoizedState=f,i.lanes===0&&(i.memoizedState=i.updateQueue.baseState=f),hr(i,Qt,u)):(u=h.cache,hr(i,Qt,u),u!==f.cache&&Bs(i,[Qt],a,!0))),yn(t,i,i.pendingProps.children,a),i.child;case 29:throw i.pendingProps}throw Error(l(156,i.tag))}function Fi(t){t.flags|=4}function Ac(t,i,a,u,f){if((i=(t.mode&32)!==0)&&(i=!1),i){if(t.flags|=16777216,(f&335544128)===f)if(t.stateNode.complete)t.flags|=8192;else if(Pm())t.flags|=8192;else throw Qr=Cu,Zs}else t.flags&=-16777217}function gm(t,i){if(i.type!=="stylesheet"||(i.state.loading&4)!==0)t.flags&=-16777217;else if(t.flags|=16777216,!Ng(i))if(Pm())t.flags|=8192;else throw Qr=Cu,Zs}function $u(t,i){i!==null&&(t.flags|=4),t.flags&16384&&(i=t.tag!==22?Li():536870912,t.lanes|=i,Ia|=i)}function Al(t,i){if(!tt)switch(t.tailMode){case"hidden":i=t.tail;for(var a=null;i!==null;)i.alternate!==null&&(a=i),i=i.sibling;a===null?t.tail=null:a.sibling=null;break;case"collapsed":a=t.tail;for(var u=null;a!==null;)a.alternate!==null&&(u=a),a=a.sibling;u===null?i||t.tail===null?t.tail=null:t.tail.sibling=null:u.sibling=null}}function Nt(t){var i=t.alternate!==null&&t.alternate.child===t.child,a=0,u=0;if(i)for(var f=t.child;f!==null;)a|=f.lanes|f.childLanes,u|=f.subtreeFlags&65011712,u|=f.flags&65011712,f.return=t,f=f.sibling;else for(f=t.child;f!==null;)a|=f.lanes|f.childLanes,u|=f.subtreeFlags,u|=f.flags,f.return=t,f=f.sibling;return t.subtreeFlags|=u,t.childLanes=a,i}function mE(t,i,a){var u=i.pendingProps;switch(Ms(i),i.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Nt(i),null;case 1:return Nt(i),null;case 3:return a=i.stateNode,u=null,t!==null&&(u=t.memoizedState.cache),i.memoizedState.cache!==u&&(i.flags|=2048),Gi(Qt),Le(),a.pendingContext&&(a.context=a.pendingContext,a.pendingContext=null),(t===null||t.child===null)&&(_a(i)?Fi(i):t===null||t.memoizedState.isDehydrated&&(i.flags&256)===0||(i.flags|=1024,Ls())),Nt(i),null;case 26:var f=i.type,h=i.memoizedState;return t===null?(Fi(i),h!==null?(Nt(i),gm(i,h)):(Nt(i),Ac(i,f,null,u,a))):h?h!==t.memoizedState?(Fi(i),Nt(i),gm(i,h)):(Nt(i),i.flags&=-16777217):(t=t.memoizedProps,t!==u&&Fi(i),Nt(i),Ac(i,f,t,u,a)),null;case 27:if(yt(i),a=Te.current,f=i.type,t!==null&&i.stateNode!=null)t.memoizedProps!==u&&Fi(i);else{if(!u){if(i.stateNode===null)throw Error(l(166));return Nt(i),null}t=he.current,_a(i)?Kh(i):(t=Tg(f,u,a),i.stateNode=t,Fi(i))}return Nt(i),null;case 5:if(yt(i),f=i.type,t!==null&&i.stateNode!=null)t.memoizedProps!==u&&Fi(i);else{if(!u){if(i.stateNode===null)throw Error(l(166));return Nt(i),null}if(h=he.current,_a(i))Kh(i);else{var b=uo(Te.current);switch(h){case 1:h=b.createElementNS("http://www.w3.org/2000/svg",f);break;case 2:h=b.createElementNS("http://www.w3.org/1998/Math/MathML",f);break;default:switch(f){case"svg":h=b.createElementNS("http://www.w3.org/2000/svg",f);break;case"math":h=b.createElementNS("http://www.w3.org/1998/Math/MathML",f);break;case"script":h=b.createElement("div"),h.innerHTML="<script><\/script>",h=h.removeChild(h.firstChild);break;case"select":h=typeof u.is=="string"?b.createElement("select",{is:u.is}):b.createElement("select"),u.multiple?h.multiple=!0:u.size&&(h.size=u.size);break;default:h=typeof u.is=="string"?b.createElement(f,{is:u.is}):b.createElement(f)}}h[Ke]=i,h[kt]=u;e:for(b=i.child;b!==null;){if(b.tag===5||b.tag===6)h.appendChild(b.stateNode);else if(b.tag!==4&&b.tag!==27&&b.child!==null){b.child.return=b,b=b.child;continue}if(b===i)break e;for(;b.sibling===null;){if(b.return===null||b.return===i)break e;b=b.return}b.sibling.return=b.return,b=b.sibling}i.stateNode=h;e:switch(bn(h,f,u),f){case"button":case"input":case"select":case"textarea":u=!!u.autoFocus;break e;case"img":u=!0;break e;default:u=!1}u&&Fi(i)}}return Nt(i),Ac(i,i.type,t===null?null:t.memoizedProps,i.pendingProps,a),null;case 6:if(t&&i.stateNode!=null)t.memoizedProps!==u&&Fi(i);else{if(typeof u!="string"&&i.stateNode===null)throw Error(l(166));if(t=Te.current,_a(i)){if(t=i.stateNode,a=i.memoizedProps,u=null,f=mn,f!==null)switch(f.tag){case 27:case 5:u=f.memoizedProps}t[Ke]=i,t=!!(t.nodeValue===a||u!==null&&u.suppressHydrationWarning===!0||dg(t.nodeValue,a)),t||dr(i,!0)}else t=uo(t).createTextNode(u),t[Ke]=i,i.stateNode=t}return Nt(i),null;case 31:if(a=i.memoizedState,t===null||t.memoizedState!==null){if(u=_a(i),a!==null){if(t===null){if(!u)throw Error(l(318));if(t=i.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(l(557));t[Ke]=i}else $r(),(i.flags&128)===0&&(i.memoizedState=null),i.flags|=4;Nt(i),t=!1}else a=Ls(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=a),t=!0;if(!t)return i.flags&256?(Qn(i),i):(Qn(i),null);if((i.flags&128)!==0)throw Error(l(558))}return Nt(i),null;case 13:if(u=i.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(f=_a(i),u!==null&&u.dehydrated!==null){if(t===null){if(!f)throw Error(l(318));if(f=i.memoizedState,f=f!==null?f.dehydrated:null,!f)throw Error(l(317));f[Ke]=i}else $r(),(i.flags&128)===0&&(i.memoizedState=null),i.flags|=4;Nt(i),f=!1}else f=Ls(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=f),f=!0;if(!f)return i.flags&256?(Qn(i),i):(Qn(i),null)}return Qn(i),(i.flags&128)!==0?(i.lanes=a,i):(a=u!==null,t=t!==null&&t.memoizedState!==null,a&&(u=i.child,f=null,u.alternate!==null&&u.alternate.memoizedState!==null&&u.alternate.memoizedState.cachePool!==null&&(f=u.alternate.memoizedState.cachePool.pool),h=null,u.memoizedState!==null&&u.memoizedState.cachePool!==null&&(h=u.memoizedState.cachePool.pool),h!==f&&(u.flags|=2048)),a!==t&&a&&(i.child.flags|=8192),$u(i,i.updateQueue),Nt(i),null);case 4:return Le(),t===null&&Fc(i.stateNode.containerInfo),Nt(i),null;case 10:return Gi(i.type),Nt(i),null;case 19:if(F(Ft),u=i.memoizedState,u===null)return Nt(i),null;if(f=(i.flags&128)!==0,h=u.rendering,h===null)if(f)Al(u,!1);else{if(Vt!==0||t!==null&&(t.flags&128)!==0)for(t=i.child;t!==null;){if(h=Du(t),h!==null){for(i.flags|=128,Al(u,!1),t=h.updateQueue,i.updateQueue=t,$u(i,t),i.subtreeFlags=0,t=a,a=i.child;a!==null;)Gh(a,t),a=a.sibling;return T(Ft,Ft.current&1|2),tt&&Pi(i,u.treeForkCount),i.child}t=t.sibling}u.tail!==null&&Rt()>Qu&&(i.flags|=128,f=!0,Al(u,!1),i.lanes=4194304)}else{if(!f)if(t=Du(h),t!==null){if(i.flags|=128,f=!0,t=t.updateQueue,i.updateQueue=t,$u(i,t),Al(u,!0),u.tail===null&&u.tailMode==="hidden"&&!h.alternate&&!tt)return Nt(i),null}else 2*Rt()-u.renderingStartTime>Qu&&a!==536870912&&(i.flags|=128,f=!0,Al(u,!1),i.lanes=4194304);u.isBackwards?(h.sibling=i.child,i.child=h):(t=u.last,t!==null?t.sibling=h:i.child=h,u.last=h)}return u.tail!==null?(t=u.tail,u.rendering=t,u.tail=t.sibling,u.renderingStartTime=Rt(),t.sibling=null,a=Ft.current,T(Ft,f?a&1|2:a&1),tt&&Pi(i,u.treeForkCount),t):(Nt(i),null);case 22:case 23:return Qn(i),Ks(),u=i.memoizedState!==null,t!==null?t.memoizedState!==null!==u&&(i.flags|=8192):u&&(i.flags|=8192),u?(a&536870912)!==0&&(i.flags&128)===0&&(Nt(i),i.subtreeFlags&6&&(i.flags|=8192)):Nt(i),a=i.updateQueue,a!==null&&$u(i,a.retryQueue),a=null,t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(a=t.memoizedState.cachePool.pool),u=null,i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(u=i.memoizedState.cachePool.pool),u!==a&&(i.flags|=2048),t!==null&&F(Kr),null;case 24:return a=null,t!==null&&(a=t.memoizedState.cache),i.memoizedState.cache!==a&&(i.flags|=2048),Gi(Qt),Nt(i),null;case 25:return null;case 30:return null}throw Error(l(156,i.tag))}function gE(t,i){switch(Ms(i),i.tag){case 1:return t=i.flags,t&65536?(i.flags=t&-65537|128,i):null;case 3:return Gi(Qt),Le(),t=i.flags,(t&65536)!==0&&(t&128)===0?(i.flags=t&-65537|128,i):null;case 26:case 27:case 5:return yt(i),null;case 31:if(i.memoizedState!==null){if(Qn(i),i.alternate===null)throw Error(l(340));$r()}return t=i.flags,t&65536?(i.flags=t&-65537|128,i):null;case 13:if(Qn(i),t=i.memoizedState,t!==null&&t.dehydrated!==null){if(i.alternate===null)throw Error(l(340));$r()}return t=i.flags,t&65536?(i.flags=t&-65537|128,i):null;case 19:return F(Ft),null;case 4:return Le(),null;case 10:return Gi(i.type),null;case 22:case 23:return Qn(i),Ks(),t!==null&&F(Kr),t=i.flags,t&65536?(i.flags=t&-65537|128,i):null;case 24:return Gi(Qt),null;case 25:return null;default:return null}}function ym(t,i){switch(Ms(i),i.tag){case 3:Gi(Qt),Le();break;case 26:case 27:case 5:yt(i);break;case 4:Le();break;case 31:i.memoizedState!==null&&Qn(i);break;case 13:Qn(i);break;case 19:F(Ft);break;case 10:Gi(i.type);break;case 22:case 23:Qn(i),Ks(),t!==null&&F(Kr);break;case 24:Gi(Qt)}}function xl(t,i){try{var a=i.updateQueue,u=a!==null?a.lastEffect:null;if(u!==null){var f=u.next;a=f;do{if((a.tag&t)===t){u=void 0;var h=a.create,b=a.inst;u=h(),b.destroy=u}a=a.next}while(a!==f)}}catch(E){dt(i,i.return,E)}}function Sr(t,i,a){try{var u=i.updateQueue,f=u!==null?u.lastEffect:null;if(f!==null){var h=f.next;u=h;do{if((u.tag&t)===t){var b=u.inst,E=b.destroy;if(E!==void 0){b.destroy=void 0,f=i;var x=a,q=E;try{q()}catch(X){dt(f,x,X)}}}u=u.next}while(u!==h)}}catch(X){dt(i,i.return,X)}}function bm(t){var i=t.updateQueue;if(i!==null){var a=t.stateNode;try{op(i,a)}catch(u){dt(t,t.return,u)}}}function Sm(t,i,a){a.props=ea(t.type,t.memoizedProps),a.state=t.memoizedState;try{a.componentWillUnmount()}catch(u){dt(t,i,u)}}function Ol(t,i){try{var a=t.ref;if(a!==null){switch(t.tag){case 26:case 27:case 5:var u=t.stateNode;break;case 30:u=t.stateNode;break;default:u=t.stateNode}typeof a=="function"?t.refCleanup=a(u):a.current=u}}catch(f){dt(t,i,f)}}function Ni(t,i){var a=t.ref,u=t.refCleanup;if(a!==null)if(typeof u=="function")try{u()}catch(f){dt(t,i,f)}finally{t.refCleanup=null,t=t.alternate,t!=null&&(t.refCleanup=null)}else if(typeof a=="function")try{a(null)}catch(f){dt(t,i,f)}else a.current=null}function vm(t){var i=t.type,a=t.memoizedProps,u=t.stateNode;try{e:switch(i){case"button":case"input":case"select":case"textarea":a.autoFocus&&u.focus();break e;case"img":a.src?u.src=a.src:a.srcSet&&(u.srcset=a.srcSet)}}catch(f){dt(t,t.return,f)}}function xc(t,i,a){try{var u=t.stateNode;jE(u,t.type,a,i),u[kt]=i}catch(f){dt(t,t.return,f)}}function Em(t){return t.tag===5||t.tag===3||t.tag===26||t.tag===27&&Ar(t.type)||t.tag===4}function Oc(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||Em(t.return))return null;t=t.return}for(t.sibling.return=t.return,t=t.sibling;t.tag!==5&&t.tag!==6&&t.tag!==18;){if(t.tag===27&&Ar(t.type)||t.flags&2||t.child===null||t.tag===4)continue e;t.child.return=t,t=t.child}if(!(t.flags&2))return t.stateNode}}function Cc(t,i,a){var u=t.tag;if(u===5||u===6)t=t.stateNode,i?(a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a).insertBefore(t,i):(i=a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a,i.appendChild(t),a=a._reactRootContainer,a!=null||i.onclick!==null||(i.onclick=Bi));else if(u!==4&&(u===27&&Ar(t.type)&&(a=t.stateNode,i=null),t=t.child,t!==null))for(Cc(t,i,a),t=t.sibling;t!==null;)Cc(t,i,a),t=t.sibling}function Yu(t,i,a){var u=t.tag;if(u===5||u===6)t=t.stateNode,i?a.insertBefore(t,i):a.appendChild(t);else if(u!==4&&(u===27&&Ar(t.type)&&(a=t.stateNode),t=t.child,t!==null))for(Yu(t,i,a),t=t.sibling;t!==null;)Yu(t,i,a),t=t.sibling}function _m(t){var i=t.stateNode,a=t.memoizedProps;try{for(var u=t.type,f=i.attributes;f.length;)i.removeAttributeNode(f[0]);bn(i,u,a),i[Ke]=t,i[kt]=a}catch(h){dt(t,t.return,h)}}var Ki=!1,en=!1,zc=!1,Tm=typeof WeakSet=="function"?WeakSet:Set,fn=null;function yE(t,i){if(t=t.containerInfo,Qc=mo,t=Ih(t),Ts(t)){if("selectionStart"in t)var a={start:t.selectionStart,end:t.selectionEnd};else e:{a=(a=t.ownerDocument)&&a.defaultView||window;var u=a.getSelection&&a.getSelection();if(u&&u.rangeCount!==0){a=u.anchorNode;var f=u.anchorOffset,h=u.focusNode;u=u.focusOffset;try{a.nodeType,h.nodeType}catch{a=null;break e}var b=0,E=-1,x=-1,q=0,X=0,W=t,P=null;t:for(;;){for(var G;W!==a||f!==0&&W.nodeType!==3||(E=b+f),W!==h||u!==0&&W.nodeType!==3||(x=b+u),W.nodeType===3&&(b+=W.nodeValue.length),(G=W.firstChild)!==null;)P=W,W=G;for(;;){if(W===t)break t;if(P===a&&++q===f&&(E=b),P===h&&++X===u&&(x=b),(G=W.nextSibling)!==null)break;W=P,P=W.parentNode}W=G}a=E===-1||x===-1?null:{start:E,end:x}}else a=null}a=a||{start:0,end:0}}else a=null;for(Jc={focusedElem:t,selectionRange:a},mo=!1,fn=i;fn!==null;)if(i=fn,t=i.child,(i.subtreeFlags&1028)!==0&&t!==null)t.return=i,fn=t;else for(;fn!==null;){switch(i=fn,h=i.alternate,t=i.flags,i.tag){case 0:if((t&4)!==0&&(t=i.updateQueue,t=t!==null?t.events:null,t!==null))for(a=0;a<t.length;a++)f=t[a],f.ref.impl=f.nextImpl;break;case 11:case 15:break;case 1:if((t&1024)!==0&&h!==null){t=void 0,a=i,f=h.memoizedProps,h=h.memoizedState,u=a.stateNode;try{var Ee=ea(a.type,f);t=u.getSnapshotBeforeUpdate(Ee,h),u.__reactInternalSnapshotBeforeUpdate=t}catch(De){dt(a,a.return,De)}}break;case 3:if((t&1024)!==0){if(t=i.stateNode.containerInfo,a=t.nodeType,a===9)tf(t);else if(a===1)switch(t.nodeName){case"HEAD":case"HTML":case"BODY":tf(t);break;default:t.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((t&1024)!==0)throw Error(l(163))}if(t=i.sibling,t!==null){t.return=i.return,fn=t;break}fn=i.return}}function km(t,i,a){var u=a.flags;switch(a.tag){case 0:case 11:case 15:Qi(t,a),u&4&&xl(5,a);break;case 1:if(Qi(t,a),u&4)if(t=a.stateNode,i===null)try{t.componentDidMount()}catch(b){dt(a,a.return,b)}else{var f=ea(a.type,i.memoizedProps);i=i.memoizedState;try{t.componentDidUpdate(f,i,t.__reactInternalSnapshotBeforeUpdate)}catch(b){dt(a,a.return,b)}}u&64&&bm(a),u&512&&Ol(a,a.return);break;case 3:if(Qi(t,a),u&64&&(t=a.updateQueue,t!==null)){if(i=null,a.child!==null)switch(a.child.tag){case 27:case 5:i=a.child.stateNode;break;case 1:i=a.child.stateNode}try{op(t,i)}catch(b){dt(a,a.return,b)}}break;case 27:i===null&&u&4&&_m(a);case 26:case 5:Qi(t,a),i===null&&u&4&&vm(a),u&512&&Ol(a,a.return);break;case 12:Qi(t,a);break;case 31:Qi(t,a),u&4&&xm(t,a);break;case 13:Qi(t,a),u&4&&Om(t,a),u&64&&(t=a.memoizedState,t!==null&&(t=t.dehydrated,t!==null&&(a=AE.bind(null,a),$E(t,a))));break;case 22:if(u=a.memoizedState!==null||Ki,!u){i=i!==null&&i.memoizedState!==null||en,f=Ki;var h=en;Ki=u,(en=i)&&!h?Ji(t,a,(a.subtreeFlags&8772)!==0):Qi(t,a),Ki=f,en=h}break;case 30:break;default:Qi(t,a)}}function wm(t){var i=t.alternate;i!==null&&(t.alternate=null,wm(i)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(i=t.stateNode,i!==null&&Oi(i)),t.stateNode=null,t.return=null,t.dependencies=null,t.memoizedProps=null,t.memoizedState=null,t.pendingProps=null,t.stateNode=null,t.updateQueue=null}var Dt=null,Ln=!1;function Xi(t,i,a){for(a=a.child;a!==null;)Am(t,i,a),a=a.sibling}function Am(t,i,a){if(Ot&&typeof Ot.onCommitFiberUnmount=="function")try{Ot.onCommitFiberUnmount(xt,a)}catch{}switch(a.tag){case 26:en||Ni(a,i),Xi(t,i,a),a.memoizedState?a.memoizedState.count--:a.stateNode&&(a=a.stateNode,a.parentNode.removeChild(a));break;case 27:en||Ni(a,i);var u=Dt,f=Ln;Ar(a.type)&&(Dt=a.stateNode,Ln=!1),Xi(t,i,a),Ul(a.stateNode),Dt=u,Ln=f;break;case 5:en||Ni(a,i);case 6:if(u=Dt,f=Ln,Dt=null,Xi(t,i,a),Dt=u,Ln=f,Dt!==null)if(Ln)try{(Dt.nodeType===9?Dt.body:Dt.nodeName==="HTML"?Dt.ownerDocument.body:Dt).removeChild(a.stateNode)}catch(h){dt(a,i,h)}else try{Dt.removeChild(a.stateNode)}catch(h){dt(a,i,h)}break;case 18:Dt!==null&&(Ln?(t=Dt,bg(t.nodeType===9?t.body:t.nodeName==="HTML"?t.ownerDocument.body:t,a.stateNode),Za(t)):bg(Dt,a.stateNode));break;case 4:u=Dt,f=Ln,Dt=a.stateNode.containerInfo,Ln=!0,Xi(t,i,a),Dt=u,Ln=f;break;case 0:case 11:case 14:case 15:Sr(2,a,i),en||Sr(4,a,i),Xi(t,i,a);break;case 1:en||(Ni(a,i),u=a.stateNode,typeof u.componentWillUnmount=="function"&&Sm(a,i,u)),Xi(t,i,a);break;case 21:Xi(t,i,a);break;case 22:en=(u=en)||a.memoizedState!==null,Xi(t,i,a),en=u;break;default:Xi(t,i,a)}}function xm(t,i){if(i.memoizedState===null&&(t=i.alternate,t!==null&&(t=t.memoizedState,t!==null))){t=t.dehydrated;try{Za(t)}catch(a){dt(i,i.return,a)}}}function Om(t,i){if(i.memoizedState===null&&(t=i.alternate,t!==null&&(t=t.memoizedState,t!==null&&(t=t.dehydrated,t!==null))))try{Za(t)}catch(a){dt(i,i.return,a)}}function bE(t){switch(t.tag){case 31:case 13:case 19:var i=t.stateNode;return i===null&&(i=t.stateNode=new Tm),i;case 22:return t=t.stateNode,i=t._retryCache,i===null&&(i=t._retryCache=new Tm),i;default:throw Error(l(435,t.tag))}}function Fu(t,i){var a=bE(t);i.forEach(function(u){if(!a.has(u)){a.add(u);var f=xE.bind(null,t,u);u.then(f,f)}})}function Un(t,i){var a=i.deletions;if(a!==null)for(var u=0;u<a.length;u++){var f=a[u],h=t,b=i,E=b;e:for(;E!==null;){switch(E.tag){case 27:if(Ar(E.type)){Dt=E.stateNode,Ln=!1;break e}break;case 5:Dt=E.stateNode,Ln=!1;break e;case 3:case 4:Dt=E.stateNode.containerInfo,Ln=!0;break e}E=E.return}if(Dt===null)throw Error(l(160));Am(h,b,f),Dt=null,Ln=!1,h=f.alternate,h!==null&&(h.return=null),f.return=null}if(i.subtreeFlags&13886)for(i=i.child;i!==null;)Cm(i,t),i=i.sibling}var _i=null;function Cm(t,i){var a=t.alternate,u=t.flags;switch(t.tag){case 0:case 11:case 14:case 15:Un(i,t),jn(t),u&4&&(Sr(3,t,t.return),xl(3,t),Sr(5,t,t.return));break;case 1:Un(i,t),jn(t),u&512&&(en||a===null||Ni(a,a.return)),u&64&&Ki&&(t=t.updateQueue,t!==null&&(u=t.callbacks,u!==null&&(a=t.shared.hiddenCallbacks,t.shared.hiddenCallbacks=a===null?u:a.concat(u))));break;case 26:var f=_i;if(Un(i,t),jn(t),u&512&&(en||a===null||Ni(a,a.return)),u&4){var h=a!==null?a.memoizedState:null;if(u=t.memoizedState,a===null)if(u===null)if(t.stateNode===null){e:{u=t.type,a=t.memoizedProps,f=f.ownerDocument||f;t:switch(u){case"title":h=f.getElementsByTagName("title")[0],(!h||h[ii]||h[Ke]||h.namespaceURI==="http://www.w3.org/2000/svg"||h.hasAttribute("itemprop"))&&(h=f.createElement(u),f.head.insertBefore(h,f.querySelector("head > title"))),bn(h,u,a),h[Ke]=t,wt(h),u=h;break e;case"link":var b=Cg("link","href",f).get(u+(a.href||""));if(b){for(var E=0;E<b.length;E++)if(h=b[E],h.getAttribute("href")===(a.href==null||a.href===""?null:a.href)&&h.getAttribute("rel")===(a.rel==null?null:a.rel)&&h.getAttribute("title")===(a.title==null?null:a.title)&&h.getAttribute("crossorigin")===(a.crossOrigin==null?null:a.crossOrigin)){b.splice(E,1);break t}}h=f.createElement(u),bn(h,u,a),f.head.appendChild(h);break;case"meta":if(b=Cg("meta","content",f).get(u+(a.content||""))){for(E=0;E<b.length;E++)if(h=b[E],h.getAttribute("content")===(a.content==null?null:""+a.content)&&h.getAttribute("name")===(a.name==null?null:a.name)&&h.getAttribute("property")===(a.property==null?null:a.property)&&h.getAttribute("http-equiv")===(a.httpEquiv==null?null:a.httpEquiv)&&h.getAttribute("charset")===(a.charSet==null?null:a.charSet)){b.splice(E,1);break t}}h=f.createElement(u),bn(h,u,a),f.head.appendChild(h);break;default:throw Error(l(468,u))}h[Ke]=t,wt(h),u=h}t.stateNode=u}else zg(f,t.type,t.stateNode);else t.stateNode=Og(f,u,t.memoizedProps);else h!==u?(h===null?a.stateNode!==null&&(a=a.stateNode,a.parentNode.removeChild(a)):h.count--,u===null?zg(f,t.type,t.stateNode):Og(f,u,t.memoizedProps)):u===null&&t.stateNode!==null&&xc(t,t.memoizedProps,a.memoizedProps)}break;case 27:Un(i,t),jn(t),u&512&&(en||a===null||Ni(a,a.return)),a!==null&&u&4&&xc(t,t.memoizedProps,a.memoizedProps);break;case 5:if(Un(i,t),jn(t),u&512&&(en||a===null||Ni(a,a.return)),t.flags&32){f=t.stateNode;try{da(f,"")}catch(Ee){dt(t,t.return,Ee)}}u&4&&t.stateNode!=null&&(f=t.memoizedProps,xc(t,f,a!==null?a.memoizedProps:f)),u&1024&&(zc=!0);break;case 6:if(Un(i,t),jn(t),u&4){if(t.stateNode===null)throw Error(l(162));u=t.memoizedProps,a=t.stateNode;try{a.nodeValue=u}catch(Ee){dt(t,t.return,Ee)}}break;case 3:if(co=null,f=_i,_i=oo(i.containerInfo),Un(i,t),_i=f,jn(t),u&4&&a!==null&&a.memoizedState.isDehydrated)try{Za(i.containerInfo)}catch(Ee){dt(t,t.return,Ee)}zc&&(zc=!1,zm(t));break;case 4:u=_i,_i=oo(t.stateNode.containerInfo),Un(i,t),jn(t),_i=u;break;case 12:Un(i,t),jn(t);break;case 31:Un(i,t),jn(t),u&4&&(u=t.updateQueue,u!==null&&(t.updateQueue=null,Fu(t,u)));break;case 13:Un(i,t),jn(t),t.child.flags&8192&&t.memoizedState!==null!=(a!==null&&a.memoizedState!==null)&&(Xu=Rt()),u&4&&(u=t.updateQueue,u!==null&&(t.updateQueue=null,Fu(t,u)));break;case 22:f=t.memoizedState!==null;var x=a!==null&&a.memoizedState!==null,q=Ki,X=en;if(Ki=q||f,en=X||x,Un(i,t),en=X,Ki=q,jn(t),u&8192)e:for(i=t.stateNode,i._visibility=f?i._visibility&-2:i._visibility|1,f&&(a===null||x||Ki||en||ta(t)),a=null,i=t;;){if(i.tag===5||i.tag===26){if(a===null){x=a=i;try{if(h=x.stateNode,f)b=h.style,typeof b.setProperty=="function"?b.setProperty("display","none","important"):b.display="none";else{E=x.stateNode;var W=x.memoizedProps.style,P=W!=null&&W.hasOwnProperty("display")?W.display:null;E.style.display=P==null||typeof P=="boolean"?"":(""+P).trim()}}catch(Ee){dt(x,x.return,Ee)}}}else if(i.tag===6){if(a===null){x=i;try{x.stateNode.nodeValue=f?"":x.memoizedProps}catch(Ee){dt(x,x.return,Ee)}}}else if(i.tag===18){if(a===null){x=i;try{var G=x.stateNode;f?Sg(G,!0):Sg(x.stateNode,!1)}catch(Ee){dt(x,x.return,Ee)}}}else if((i.tag!==22&&i.tag!==23||i.memoizedState===null||i===t)&&i.child!==null){i.child.return=i,i=i.child;continue}if(i===t)break e;for(;i.sibling===null;){if(i.return===null||i.return===t)break e;a===i&&(a=null),i=i.return}a===i&&(a=null),i.sibling.return=i.return,i=i.sibling}u&4&&(u=t.updateQueue,u!==null&&(a=u.retryQueue,a!==null&&(u.retryQueue=null,Fu(t,a))));break;case 19:Un(i,t),jn(t),u&4&&(u=t.updateQueue,u!==null&&(t.updateQueue=null,Fu(t,u)));break;case 30:break;case 21:break;default:Un(i,t),jn(t)}}function jn(t){var i=t.flags;if(i&2){try{for(var a,u=t.return;u!==null;){if(Em(u)){a=u;break}u=u.return}if(a==null)throw Error(l(160));switch(a.tag){case 27:var f=a.stateNode,h=Oc(t);Yu(t,h,f);break;case 5:var b=a.stateNode;a.flags&32&&(da(b,""),a.flags&=-33);var E=Oc(t);Yu(t,E,b);break;case 3:case 4:var x=a.stateNode.containerInfo,q=Oc(t);Cc(t,q,x);break;default:throw Error(l(161))}}catch(X){dt(t,t.return,X)}t.flags&=-3}i&4096&&(t.flags&=-4097)}function zm(t){if(t.subtreeFlags&1024)for(t=t.child;t!==null;){var i=t;zm(i),i.tag===5&&i.flags&1024&&i.stateNode.reset(),t=t.sibling}}function Qi(t,i){if(i.subtreeFlags&8772)for(i=i.child;i!==null;)km(t,i.alternate,i),i=i.sibling}function ta(t){for(t=t.child;t!==null;){var i=t;switch(i.tag){case 0:case 11:case 14:case 15:Sr(4,i,i.return),ta(i);break;case 1:Ni(i,i.return);var a=i.stateNode;typeof a.componentWillUnmount=="function"&&Sm(i,i.return,a),ta(i);break;case 27:Ul(i.stateNode);case 26:case 5:Ni(i,i.return),ta(i);break;case 22:i.memoizedState===null&&ta(i);break;case 30:ta(i);break;default:ta(i)}t=t.sibling}}function Ji(t,i,a){for(a=a&&(i.subtreeFlags&8772)!==0,i=i.child;i!==null;){var u=i.alternate,f=t,h=i,b=h.flags;switch(h.tag){case 0:case 11:case 15:Ji(f,h,a),xl(4,h);break;case 1:if(Ji(f,h,a),u=h,f=u.stateNode,typeof f.componentDidMount=="function")try{f.componentDidMount()}catch(q){dt(u,u.return,q)}if(u=h,f=u.updateQueue,f!==null){var E=u.stateNode;try{var x=f.shared.hiddenCallbacks;if(x!==null)for(f.shared.hiddenCallbacks=null,f=0;f<x.length;f++)up(x[f],E)}catch(q){dt(u,u.return,q)}}a&&b&64&&bm(h),Ol(h,h.return);break;case 27:_m(h);case 26:case 5:Ji(f,h,a),a&&u===null&&b&4&&vm(h),Ol(h,h.return);break;case 12:Ji(f,h,a);break;case 31:Ji(f,h,a),a&&b&4&&xm(f,h);break;case 13:Ji(f,h,a),a&&b&4&&Om(f,h);break;case 22:h.memoizedState===null&&Ji(f,h,a),Ol(h,h.return);break;case 30:break;default:Ji(f,h,a)}i=i.sibling}}function Nc(t,i){var a=null;t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(a=t.memoizedState.cachePool.pool),t=null,i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(t=i.memoizedState.cachePool.pool),t!==a&&(t!=null&&t.refCount++,a!=null&&pl(a))}function Rc(t,i){t=null,i.alternate!==null&&(t=i.alternate.memoizedState.cache),i=i.memoizedState.cache,i!==t&&(i.refCount++,t!=null&&pl(t))}function Ti(t,i,a,u){if(i.subtreeFlags&10256)for(i=i.child;i!==null;)Nm(t,i,a,u),i=i.sibling}function Nm(t,i,a,u){var f=i.flags;switch(i.tag){case 0:case 11:case 15:Ti(t,i,a,u),f&2048&&xl(9,i);break;case 1:Ti(t,i,a,u);break;case 3:Ti(t,i,a,u),f&2048&&(t=null,i.alternate!==null&&(t=i.alternate.memoizedState.cache),i=i.memoizedState.cache,i!==t&&(i.refCount++,t!=null&&pl(t)));break;case 12:if(f&2048){Ti(t,i,a,u),t=i.stateNode;try{var h=i.memoizedProps,b=h.id,E=h.onPostCommit;typeof E=="function"&&E(b,i.alternate===null?"mount":"update",t.passiveEffectDuration,-0)}catch(x){dt(i,i.return,x)}}else Ti(t,i,a,u);break;case 31:Ti(t,i,a,u);break;case 13:Ti(t,i,a,u);break;case 23:break;case 22:h=i.stateNode,b=i.alternate,i.memoizedState!==null?h._visibility&2?Ti(t,i,a,u):Cl(t,i):h._visibility&2?Ti(t,i,a,u):(h._visibility|=2,Ra(t,i,a,u,(i.subtreeFlags&10256)!==0||!1)),f&2048&&Nc(b,i);break;case 24:Ti(t,i,a,u),f&2048&&Rc(i.alternate,i);break;default:Ti(t,i,a,u)}}function Ra(t,i,a,u,f){for(f=f&&((i.subtreeFlags&10256)!==0||!1),i=i.child;i!==null;){var h=t,b=i,E=a,x=u,q=b.flags;switch(b.tag){case 0:case 11:case 15:Ra(h,b,E,x,f),xl(8,b);break;case 23:break;case 22:var X=b.stateNode;b.memoizedState!==null?X._visibility&2?Ra(h,b,E,x,f):Cl(h,b):(X._visibility|=2,Ra(h,b,E,x,f)),f&&q&2048&&Nc(b.alternate,b);break;case 24:Ra(h,b,E,x,f),f&&q&2048&&Rc(b.alternate,b);break;default:Ra(h,b,E,x,f)}i=i.sibling}}function Cl(t,i){if(i.subtreeFlags&10256)for(i=i.child;i!==null;){var a=t,u=i,f=u.flags;switch(u.tag){case 22:Cl(a,u),f&2048&&Nc(u.alternate,u);break;case 24:Cl(a,u),f&2048&&Rc(u.alternate,u);break;default:Cl(a,u)}i=i.sibling}}var zl=8192;function Da(t,i,a){if(t.subtreeFlags&zl)for(t=t.child;t!==null;)Rm(t,i,a),t=t.sibling}function Rm(t,i,a){switch(t.tag){case 26:Da(t,i,a),t.flags&zl&&t.memoizedState!==null&&r_(a,_i,t.memoizedState,t.memoizedProps);break;case 5:Da(t,i,a);break;case 3:case 4:var u=_i;_i=oo(t.stateNode.containerInfo),Da(t,i,a),_i=u;break;case 22:t.memoizedState===null&&(u=t.alternate,u!==null&&u.memoizedState!==null?(u=zl,zl=16777216,Da(t,i,a),zl=u):Da(t,i,a));break;default:Da(t,i,a)}}function Dm(t){var i=t.alternate;if(i!==null&&(t=i.child,t!==null)){i.child=null;do i=t.sibling,t.sibling=null,t=i;while(t!==null)}}function Nl(t){var i=t.deletions;if((t.flags&16)!==0){if(i!==null)for(var a=0;a<i.length;a++){var u=i[a];fn=u,Im(u,t)}Dm(t)}if(t.subtreeFlags&10256)for(t=t.child;t!==null;)Mm(t),t=t.sibling}function Mm(t){switch(t.tag){case 0:case 11:case 15:Nl(t),t.flags&2048&&Sr(9,t,t.return);break;case 3:Nl(t);break;case 12:Nl(t);break;case 22:var i=t.stateNode;t.memoizedState!==null&&i._visibility&2&&(t.return===null||t.return.tag!==13)?(i._visibility&=-3,Ku(t)):Nl(t);break;default:Nl(t)}}function Ku(t){var i=t.deletions;if((t.flags&16)!==0){if(i!==null)for(var a=0;a<i.length;a++){var u=i[a];fn=u,Im(u,t)}Dm(t)}for(t=t.child;t!==null;){switch(i=t,i.tag){case 0:case 11:case 15:Sr(8,i,i.return),Ku(i);break;case 22:a=i.stateNode,a._visibility&2&&(a._visibility&=-3,Ku(i));break;default:Ku(i)}t=t.sibling}}function Im(t,i){for(;fn!==null;){var a=fn;switch(a.tag){case 0:case 11:case 15:Sr(8,a,i);break;case 23:case 22:if(a.memoizedState!==null&&a.memoizedState.cachePool!==null){var u=a.memoizedState.cachePool.pool;u!=null&&u.refCount++}break;case 24:pl(a.memoizedState.cache)}if(u=a.child,u!==null)u.return=a,fn=u;else e:for(a=t;fn!==null;){u=fn;var f=u.sibling,h=u.return;if(wm(u),u===a){fn=null;break e}if(f!==null){f.return=h,fn=f;break e}fn=h}}}var SE={getCacheForType:function(t){var i=gn(Qt),a=i.data.get(t);return a===void 0&&(a=t(),i.data.set(t,a)),a},cacheSignal:function(){return gn(Qt).controller.signal}},vE=typeof WeakMap=="function"?WeakMap:Map,ot=0,St=null,Xe=null,We=0,ft=0,Jn=null,vr=!1,Ma=!1,Dc=!1,Wi=0,Vt=0,Er=0,na=0,Mc=0,Wn=0,Ia=0,Rl=null,Bn=null,Ic=!1,Xu=0,Lm=0,Qu=1/0,Ju=null,_r=null,ln=0,Tr=null,La=null,er=0,Lc=0,Uc=null,Um=null,Dl=0,jc=null;function ei(){return(ot&2)!==0&&We!==0?We&-We:H.T!==null?Gc():bt()}function jm(){if(Wn===0)if((We&536870912)===0||tt){var t=rr;rr<<=1,(rr&3932160)===0&&(rr=262144),Wn=t}else Wn=536870912;return t=Xn.current,t!==null&&(t.flags|=32),Wn}function qn(t,i,a){(t===St&&(ft===2||ft===9)||t.cancelPendingCommit!==null)&&(Ua(t,0),kr(t,We,Wn,!1)),lr(t,a),((ot&2)===0||t!==St)&&(t===St&&((ot&2)===0&&(na|=a),Vt===4&&kr(t,We,Wn,!1)),Ri(t))}function Bm(t,i,a){if((ot&6)!==0)throw Error(l(327));var u=!a&&(i&127)===0&&(i&t.expiredLanes)===0||Ai(t,i),f=u?TE(t,i):qc(t,i,!0),h=u;do{if(f===0){Ma&&!u&&kr(t,i,0,!1);break}else{if(a=t.current.alternate,h&&!EE(a)){f=qc(t,i,!1),h=!1;continue}if(f===2){if(h=i,t.errorRecoveryDisabledLanes&h)var b=0;else b=t.pendingLanes&-536870913,b=b!==0?b:b&536870912?536870912:0;if(b!==0){i=b;e:{var E=t;f=Rl;var x=E.current.memoizedState.isDehydrated;if(x&&(Ua(E,b).flags|=256),b=qc(E,b,!1),b!==2){if(Dc&&!x){E.errorRecoveryDisabledLanes|=h,na|=h,f=4;break e}h=Bn,Bn=f,h!==null&&(Bn===null?Bn=h:Bn.push.apply(Bn,h))}f=b}if(h=!1,f!==2)continue}}if(f===1){Ua(t,0),kr(t,i,0,!0);break}e:{switch(u=t,h=f,h){case 0:case 1:throw Error(l(345));case 4:if((i&4194048)!==i)break;case 6:kr(u,i,Wn,!vr);break e;case 2:Bn=null;break;case 3:case 5:break;default:throw Error(l(329))}if((i&62914560)===i&&(f=Xu+300-Rt(),10<f)){if(kr(u,i,Wn,!vr),ar(u,0,!0)!==0)break e;er=i,u.timeoutHandle=gg(qm.bind(null,u,a,Bn,Ju,Ic,i,Wn,na,Ia,vr,h,"Throttled",-0,0),f);break e}qm(u,a,Bn,Ju,Ic,i,Wn,na,Ia,vr,h,null,-0,0)}}break}while(!0);Ri(t)}function qm(t,i,a,u,f,h,b,E,x,q,X,W,P,G){if(t.timeoutHandle=-1,W=i.subtreeFlags,W&8192||(W&16785408)===16785408){W={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Bi},Rm(i,h,W);var Ee=(h&62914560)===h?Xu-Rt():(h&4194048)===h?Lm-Rt():0;if(Ee=a_(W,Ee),Ee!==null){er=h,t.cancelPendingCommit=Ee(Fm.bind(null,t,i,h,a,u,f,b,E,x,X,W,null,P,G)),kr(t,h,b,!q);return}}Fm(t,i,h,a,u,f,b,E,x)}function EE(t){for(var i=t;;){var a=i.tag;if((a===0||a===11||a===15)&&i.flags&16384&&(a=i.updateQueue,a!==null&&(a=a.stores,a!==null)))for(var u=0;u<a.length;u++){var f=a[u],h=f.getSnapshot;f=f.value;try{if(!Fn(h(),f))return!1}catch{return!1}}if(a=i.child,i.subtreeFlags&16384&&a!==null)a.return=i,i=a;else{if(i===t)break;for(;i.sibling===null;){if(i.return===null||i.return===t)return!0;i=i.return}i.sibling.return=i.return,i=i.sibling}}return!0}function kr(t,i,a,u){i&=~Mc,i&=~na,t.suspendedLanes|=i,t.pingedLanes&=~i,u&&(t.warmLanes|=i),u=t.expirationTimes;for(var f=i;0<f;){var h=31-Ye(f),b=1<<h;u[h]=-1,f&=~b}a!==0&&ee(t,a,i)}function Wu(){return(ot&6)===0?(Ml(0),!1):!0}function Bc(){if(Xe!==null){if(ft===0)var t=Xe.return;else t=Xe,Zi=Yr=null,tc(t),xa=null,gl=0,t=Xe;for(;t!==null;)ym(t.alternate,t),t=t.return;Xe=null}}function Ua(t,i){var a=t.timeoutHandle;a!==-1&&(t.timeoutHandle=-1,HE(a)),a=t.cancelPendingCommit,a!==null&&(t.cancelPendingCommit=null,a()),er=0,Bc(),St=t,Xe=a=Hi(t.current,null),We=i,ft=0,Jn=null,vr=!1,Ma=Ai(t,i),Dc=!1,Ia=Wn=Mc=na=Er=Vt=0,Bn=Rl=null,Ic=!1,(i&8)!==0&&(i|=i&32);var u=t.entangledLanes;if(u!==0)for(t=t.entanglements,u&=i;0<u;){var f=31-Ye(u),h=1<<f;i|=t[f],u&=~h}return Wi=i,vu(),a}function Hm(t,i){Ge=null,H.H=kl,i===Aa||i===Ou?(i=ip(),ft=3):i===Zs?(i=ip(),ft=4):ft=i===yc?8:i!==null&&typeof i=="object"&&typeof i.then=="function"?6:1,Jn=i,Xe===null&&(Vt=1,Pu(t,oi(i,t.current)))}function Pm(){var t=Xn.current;return t===null?!0:(We&4194048)===We?di===null:(We&62914560)===We||(We&536870912)!==0?t===di:!1}function Zm(){var t=H.H;return H.H=kl,t===null?kl:t}function Gm(){var t=H.A;return H.A=SE,t}function eo(){Vt=4,vr||(We&4194048)!==We&&Xn.current!==null||(Ma=!0),(Er&134217727)===0&&(na&134217727)===0||St===null||kr(St,We,Wn,!1)}function qc(t,i,a){var u=ot;ot|=2;var f=Zm(),h=Gm();(St!==t||We!==i)&&(Ju=null,Ua(t,i)),i=!1;var b=Vt;e:do try{if(ft!==0&&Xe!==null){var E=Xe,x=Jn;switch(ft){case 8:Bc(),b=6;break e;case 3:case 2:case 9:case 6:Xn.current===null&&(i=!0);var q=ft;if(ft=0,Jn=null,ja(t,E,x,q),a&&Ma){b=0;break e}break;default:q=ft,ft=0,Jn=null,ja(t,E,x,q)}}_E(),b=Vt;break}catch(X){Hm(t,X)}while(!0);return i&&t.shellSuspendCounter++,Zi=Yr=null,ot=u,H.H=f,H.A=h,Xe===null&&(St=null,We=0,vu()),b}function _E(){for(;Xe!==null;)Vm(Xe)}function TE(t,i){var a=ot;ot|=2;var u=Zm(),f=Gm();St!==t||We!==i?(Ju=null,Qu=Rt()+500,Ua(t,i)):Ma=Ai(t,i);e:do try{if(ft!==0&&Xe!==null){i=Xe;var h=Jn;t:switch(ft){case 1:ft=0,Jn=null,ja(t,i,h,1);break;case 2:case 9:if(tp(h)){ft=0,Jn=null,$m(i);break}i=function(){ft!==2&&ft!==9||St!==t||(ft=7),Ri(t)},h.then(i,i);break e;case 3:ft=7;break e;case 4:ft=5;break e;case 7:tp(h)?(ft=0,Jn=null,$m(i)):(ft=0,Jn=null,ja(t,i,h,7));break;case 5:var b=null;switch(Xe.tag){case 26:b=Xe.memoizedState;case 5:case 27:var E=Xe;if(b?Ng(b):E.stateNode.complete){ft=0,Jn=null;var x=E.sibling;if(x!==null)Xe=x;else{var q=E.return;q!==null?(Xe=q,to(q)):Xe=null}break t}}ft=0,Jn=null,ja(t,i,h,5);break;case 6:ft=0,Jn=null,ja(t,i,h,6);break;case 8:Bc(),Vt=6;break e;default:throw Error(l(462))}}kE();break}catch(X){Hm(t,X)}while(!0);return Zi=Yr=null,H.H=u,H.A=f,ot=a,Xe!==null?0:(St=null,We=0,vu(),Vt)}function kE(){for(;Xe!==null&&!pn();)Vm(Xe)}function Vm(t){var i=mm(t.alternate,t,Wi);t.memoizedProps=t.pendingProps,i===null?to(t):Xe=i}function $m(t){var i=t,a=i.alternate;switch(i.tag){case 15:case 0:i=sm(a,i,i.pendingProps,i.type,void 0,We);break;case 11:i=sm(a,i,i.pendingProps,i.type.render,i.ref,We);break;case 5:tc(i);default:ym(a,i),i=Xe=Gh(i,Wi),i=mm(a,i,Wi)}t.memoizedProps=t.pendingProps,i===null?to(t):Xe=i}function ja(t,i,a,u){Zi=Yr=null,tc(i),xa=null,gl=0;var f=i.return;try{if(dE(t,f,i,a,We)){Vt=1,Pu(t,oi(a,t.current)),Xe=null;return}}catch(h){if(f!==null)throw Xe=f,h;Vt=1,Pu(t,oi(a,t.current)),Xe=null;return}i.flags&32768?(tt||u===1?t=!0:Ma||(We&536870912)!==0?t=!1:(vr=t=!0,(u===2||u===9||u===3||u===6)&&(u=Xn.current,u!==null&&u.tag===13&&(u.flags|=16384))),Ym(i,t)):to(i)}function to(t){var i=t;do{if((i.flags&32768)!==0){Ym(i,vr);return}t=i.return;var a=mE(i.alternate,i,Wi);if(a!==null){Xe=a;return}if(i=i.sibling,i!==null){Xe=i;return}Xe=i=t}while(i!==null);Vt===0&&(Vt=5)}function Ym(t,i){do{var a=gE(t.alternate,t);if(a!==null){a.flags&=32767,Xe=a;return}if(a=t.return,a!==null&&(a.flags|=32768,a.subtreeFlags=0,a.deletions=null),!i&&(t=t.sibling,t!==null)){Xe=t;return}Xe=t=a}while(t!==null);Vt=6,Xe=null}function Fm(t,i,a,u,f,h,b,E,x){t.cancelPendingCommit=null;do no();while(ln!==0);if((ot&6)!==0)throw Error(l(327));if(i!==null){if(i===t.current)throw Error(l(177));if(h=i.lanes|i.childLanes,h|=Os,qr(t,a,h,b,E,x),t===St&&(Xe=St=null,We=0),La=i,Tr=t,er=a,Lc=h,Uc=f,Um=u,(i.subtreeFlags&10256)!==0||(i.flags&10256)!==0?(t.callbackNode=null,t.callbackPriority=0,OE(ze,function(){return Wm(),null})):(t.callbackNode=null,t.callbackPriority=0),u=(i.flags&13878)!==0,(i.subtreeFlags&13878)!==0||u){u=H.T,H.T=null,f=le.p,le.p=2,b=ot,ot|=4;try{yE(t,i,a)}finally{ot=b,le.p=f,H.T=u}}ln=1,Km(),Xm(),Qm()}}function Km(){if(ln===1){ln=0;var t=Tr,i=La,a=(i.flags&13878)!==0;if((i.subtreeFlags&13878)!==0||a){a=H.T,H.T=null;var u=le.p;le.p=2;var f=ot;ot|=4;try{Cm(i,t);var h=Jc,b=Ih(t.containerInfo),E=h.focusedElem,x=h.selectionRange;if(b!==E&&E&&E.ownerDocument&&Mh(E.ownerDocument.documentElement,E)){if(x!==null&&Ts(E)){var q=x.start,X=x.end;if(X===void 0&&(X=q),"selectionStart"in E)E.selectionStart=q,E.selectionEnd=Math.min(X,E.value.length);else{var W=E.ownerDocument||document,P=W&&W.defaultView||window;if(P.getSelection){var G=P.getSelection(),Ee=E.textContent.length,De=Math.min(x.start,Ee),gt=x.end===void 0?De:Math.min(x.end,Ee);!G.extend&&De>gt&&(b=gt,gt=De,De=b);var L=Dh(E,De),R=Dh(E,gt);if(L&&R&&(G.rangeCount!==1||G.anchorNode!==L.node||G.anchorOffset!==L.offset||G.focusNode!==R.node||G.focusOffset!==R.offset)){var B=W.createRange();B.setStart(L.node,L.offset),G.removeAllRanges(),De>gt?(G.addRange(B),G.extend(R.node,R.offset)):(B.setEnd(R.node,R.offset),G.addRange(B))}}}}for(W=[],G=E;G=G.parentNode;)G.nodeType===1&&W.push({element:G,left:G.scrollLeft,top:G.scrollTop});for(typeof E.focus=="function"&&E.focus(),E=0;E<W.length;E++){var J=W[E];J.element.scrollLeft=J.left,J.element.scrollTop=J.top}}mo=!!Qc,Jc=Qc=null}finally{ot=f,le.p=u,H.T=a}}t.current=i,ln=2}}function Xm(){if(ln===2){ln=0;var t=Tr,i=La,a=(i.flags&8772)!==0;if((i.subtreeFlags&8772)!==0||a){a=H.T,H.T=null;var u=le.p;le.p=2;var f=ot;ot|=4;try{km(t,i.alternate,i)}finally{ot=f,le.p=u,H.T=a}}ln=3}}function Qm(){if(ln===4||ln===3){ln=0,Vn();var t=Tr,i=La,a=er,u=Um;(i.subtreeFlags&10256)!==0||(i.flags&10256)!==0?ln=5:(ln=0,La=Tr=null,Jm(t,t.pendingLanes));var f=t.pendingLanes;if(f===0&&(_r=null),Ie(a),i=i.stateNode,Ot&&typeof Ot.onCommitFiberRoot=="function")try{Ot.onCommitFiberRoot(xt,i,void 0,(i.current.flags&128)===128)}catch{}if(u!==null){i=H.T,f=le.p,le.p=2,H.T=null;try{for(var h=t.onRecoverableError,b=0;b<u.length;b++){var E=u[b];h(E.value,{componentStack:E.stack})}}finally{H.T=i,le.p=f}}(er&3)!==0&&no(),Ri(t),f=t.pendingLanes,(a&261930)!==0&&(f&42)!==0?t===jc?Dl++:(Dl=0,jc=t):Dl=0,Ml(0)}}function Jm(t,i){(t.pooledCacheLanes&=i)===0&&(i=t.pooledCache,i!=null&&(t.pooledCache=null,pl(i)))}function no(){return Km(),Xm(),Qm(),Wm()}function Wm(){if(ln!==5)return!1;var t=Tr,i=Lc;Lc=0;var a=Ie(er),u=H.T,f=le.p;try{le.p=32>a?32:a,H.T=null,a=Uc,Uc=null;var h=Tr,b=er;if(ln=0,La=Tr=null,er=0,(ot&6)!==0)throw Error(l(331));var E=ot;if(ot|=4,Mm(h.current),Nm(h,h.current,b,a),ot=E,Ml(0,!1),Ot&&typeof Ot.onPostCommitFiberRoot=="function")try{Ot.onPostCommitFiberRoot(xt,h)}catch{}return!0}finally{le.p=f,H.T=u,Jm(t,i)}}function eg(t,i,a){i=oi(a,i),i=gc(t.stateNode,i,2),t=gr(t,i,2),t!==null&&(lr(t,2),Ri(t))}function dt(t,i,a){if(t.tag===3)eg(t,t,a);else for(;i!==null;){if(i.tag===3){eg(i,t,a);break}else if(i.tag===1){var u=i.stateNode;if(typeof i.type.getDerivedStateFromError=="function"||typeof u.componentDidCatch=="function"&&(_r===null||!_r.has(u))){t=oi(a,t),a=tm(2),u=gr(i,a,2),u!==null&&(nm(a,u,i,t),lr(u,2),Ri(u));break}}i=i.return}}function Hc(t,i,a){var u=t.pingCache;if(u===null){u=t.pingCache=new vE;var f=new Set;u.set(i,f)}else f=u.get(i),f===void 0&&(f=new Set,u.set(i,f));f.has(a)||(Dc=!0,f.add(a),t=wE.bind(null,t,i,a),i.then(t,t))}function wE(t,i,a){var u=t.pingCache;u!==null&&u.delete(i),t.pingedLanes|=t.suspendedLanes&a,t.warmLanes&=~a,St===t&&(We&a)===a&&(Vt===4||Vt===3&&(We&62914560)===We&&300>Rt()-Xu?(ot&2)===0&&Ua(t,0):Mc|=a,Ia===We&&(Ia=0)),Ri(t)}function tg(t,i){i===0&&(i=Li()),t=Gr(t,i),t!==null&&(lr(t,i),Ri(t))}function AE(t){var i=t.memoizedState,a=0;i!==null&&(a=i.retryLane),tg(t,a)}function xE(t,i){var a=0;switch(t.tag){case 31:case 13:var u=t.stateNode,f=t.memoizedState;f!==null&&(a=f.retryLane);break;case 19:u=t.stateNode;break;case 22:u=t.stateNode._retryCache;break;default:throw Error(l(314))}u!==null&&u.delete(i),tg(t,a)}function OE(t,i){return Yt(t,i)}var io=null,Ba=null,Pc=!1,ro=!1,Zc=!1,wr=0;function Ri(t){t!==Ba&&t.next===null&&(Ba===null?io=Ba=t:Ba=Ba.next=t),ro=!0,Pc||(Pc=!0,zE())}function Ml(t,i){if(!Zc&&ro){Zc=!0;do for(var a=!1,u=io;u!==null;){if(t!==0){var f=u.pendingLanes;if(f===0)var h=0;else{var b=u.suspendedLanes,E=u.pingedLanes;h=(1<<31-Ye(42|t)+1)-1,h&=f&~(b&~E),h=h&201326741?h&201326741|1:h?h|2:0}h!==0&&(a=!0,ag(u,h))}else h=We,h=ar(u,u===St?h:0,u.cancelPendingCommit!==null||u.timeoutHandle!==-1),(h&3)===0||Ai(u,h)||(a=!0,ag(u,h));u=u.next}while(a);Zc=!1}}function CE(){ng()}function ng(){ro=Pc=!1;var t=0;wr!==0&&qE()&&(t=wr);for(var i=Rt(),a=null,u=io;u!==null;){var f=u.next,h=ig(u,i);h===0?(u.next=null,a===null?io=f:a.next=f,f===null&&(Ba=a)):(a=u,(t!==0||(h&3)!==0)&&(ro=!0)),u=f}ln!==0&&ln!==5||Ml(t),wr!==0&&(wr=0)}function ig(t,i){for(var a=t.suspendedLanes,u=t.pingedLanes,f=t.expirationTimes,h=t.pendingLanes&-62914561;0<h;){var b=31-Ye(h),E=1<<b,x=f[b];x===-1?((E&a)===0||(E&u)!==0)&&(f[b]=Fe(E,i)):x<=i&&(t.expiredLanes|=E),h&=~E}if(i=St,a=We,a=ar(t,t===i?a:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),u=t.callbackNode,a===0||t===i&&(ft===2||ft===9)||t.cancelPendingCommit!==null)return u!==null&&u!==null&&At(u),t.callbackNode=null,t.callbackPriority=0;if((a&3)===0||Ai(t,a)){if(i=a&-a,i===t.callbackPriority)return i;switch(u!==null&&At(u),Ie(a)){case 2:case 8:a=se;break;case 32:a=ze;break;case 268435456:a=$e;break;default:a=ze}return u=rg.bind(null,t),a=Yt(a,u),t.callbackPriority=i,t.callbackNode=a,i}return u!==null&&u!==null&&At(u),t.callbackPriority=2,t.callbackNode=null,2}function rg(t,i){if(ln!==0&&ln!==5)return t.callbackNode=null,t.callbackPriority=0,null;var a=t.callbackNode;if(no()&&t.callbackNode!==a)return null;var u=We;return u=ar(t,t===St?u:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),u===0?null:(Bm(t,u,i),ig(t,Rt()),t.callbackNode!=null&&t.callbackNode===a?rg.bind(null,t):null)}function ag(t,i){if(no())return null;Bm(t,i,!0)}function zE(){PE(function(){(ot&6)!==0?Yt(K,CE):ng()})}function Gc(){if(wr===0){var t=ka;t===0&&(t=ir,ir<<=1,(ir&261888)===0&&(ir=256)),wr=t}return wr}function lg(t){return t==null||typeof t=="symbol"||typeof t=="boolean"?null:typeof t=="function"?t:du(""+t)}function ug(t,i){var a=i.ownerDocument.createElement("input");return a.name=i.name,a.value=i.value,t.id&&a.setAttribute("form",t.id),i.parentNode.insertBefore(a,i),t=new FormData(t),a.parentNode.removeChild(a),t}function NE(t,i,a,u,f){if(i==="submit"&&a&&a.stateNode===f){var h=lg((f[kt]||null).action),b=u.submitter;b&&(i=(i=b[kt]||null)?lg(i.formAction):b.getAttribute("formAction"),i!==null&&(h=i,b=null));var E=new gu("action","action",null,u,f);t.push({event:E,listeners:[{instance:null,listener:function(){if(u.defaultPrevented){if(wr!==0){var x=b?ug(f,b):new FormData(f);cc(a,{pending:!0,data:x,method:f.method,action:h},null,x)}}else typeof h=="function"&&(E.preventDefault(),x=b?ug(f,b):new FormData(f),cc(a,{pending:!0,data:x,method:f.method,action:h},h,x))},currentTarget:f}]})}}for(var Vc=0;Vc<xs.length;Vc++){var $c=xs[Vc],RE=$c.toLowerCase(),DE=$c[0].toUpperCase()+$c.slice(1);Ei(RE,"on"+DE)}Ei(jh,"onAnimationEnd"),Ei(Bh,"onAnimationIteration"),Ei(qh,"onAnimationStart"),Ei("dblclick","onDoubleClick"),Ei("focusin","onFocus"),Ei("focusout","onBlur"),Ei(Kv,"onTransitionRun"),Ei(Xv,"onTransitionStart"),Ei(Qv,"onTransitionCancel"),Ei(Hh,"onTransitionEnd"),me("onMouseEnter",["mouseout","mouseover"]),me("onMouseLeave",["mouseout","mouseover"]),me("onPointerEnter",["pointerout","pointerover"]),me("onPointerLeave",["pointerout","pointerover"]),Z("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Z("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Z("onBeforeInput",["compositionend","keypress","textInput","paste"]),Z("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Z("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Z("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Il="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),ME=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Il));function og(t,i){i=(i&4)!==0;for(var a=0;a<t.length;a++){var u=t[a],f=u.event;u=u.listeners;e:{var h=void 0;if(i)for(var b=u.length-1;0<=b;b--){var E=u[b],x=E.instance,q=E.currentTarget;if(E=E.listener,x!==h&&f.isPropagationStopped())break e;h=E,f.currentTarget=q;try{h(f)}catch(X){Su(X)}f.currentTarget=null,h=x}else for(b=0;b<u.length;b++){if(E=u[b],x=E.instance,q=E.currentTarget,E=E.listener,x!==h&&f.isPropagationStopped())break e;h=E,f.currentTarget=q;try{h(f)}catch(X){Su(X)}f.currentTarget=null,h=x}}}}function Qe(t,i){var a=i[Xt];a===void 0&&(a=i[Xt]=new Set);var u=t+"__bubble";a.has(u)||(sg(i,t,2,!1),a.add(u))}function Yc(t,i,a){var u=0;i&&(u|=4),sg(a,t,u,i)}var ao="_reactListening"+Math.random().toString(36).slice(2);function Fc(t){if(!t[ao]){t[ao]=!0,k.forEach(function(a){a!=="selectionchange"&&(ME.has(a)||Yc(a,!1,t),Yc(a,!0,t))});var i=t.nodeType===9?t:t.ownerDocument;i===null||i[ao]||(i[ao]=!0,Yc("selectionchange",!1,i))}}function sg(t,i,a,u){switch(jg(i)){case 2:var f=o_;break;case 8:f=s_;break;default:f=cf}a=f.bind(null,i,a,t),f=void 0,!ps||i!=="touchstart"&&i!=="touchmove"&&i!=="wheel"||(f=!0),u?f!==void 0?t.addEventListener(i,a,{capture:!0,passive:f}):t.addEventListener(i,a,!0):f!==void 0?t.addEventListener(i,a,{passive:f}):t.addEventListener(i,a,!1)}function Kc(t,i,a,u,f){var h=u;if((i&1)===0&&(i&2)===0&&u!==null)e:for(;;){if(u===null)return;var b=u.tag;if(b===3||b===4){var E=u.stateNode.containerInfo;if(E===f)break;if(b===4)for(b=u.return;b!==null;){var x=b.tag;if((x===3||x===4)&&b.stateNode.containerInfo===f)return;b=b.return}for(;E!==null;){if(b=Mn(E),b===null)return;if(x=b.tag,x===5||x===6||x===26||x===27){u=h=b;continue e}E=E.parentNode}}u=u.return}ph(function(){var q=h,X=ds(a),W=[];e:{var P=Ph.get(t);if(P!==void 0){var G=gu,Ee=t;switch(t){case"keypress":if(pu(a)===0)break e;case"keydown":case"keyup":G=xv;break;case"focusin":Ee="focus",G=bs;break;case"focusout":Ee="blur",G=bs;break;case"beforeblur":case"afterblur":G=bs;break;case"click":if(a.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":G=yh;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":G=mv;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":G=zv;break;case jh:case Bh:case qh:G=bv;break;case Hh:G=Rv;break;case"scroll":case"scrollend":G=hv;break;case"wheel":G=Mv;break;case"copy":case"cut":case"paste":G=vv;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":G=Sh;break;case"toggle":case"beforetoggle":G=Lv}var De=(i&4)!==0,gt=!De&&(t==="scroll"||t==="scrollend"),L=De?P!==null?P+"Capture":null:P;De=[];for(var R=q,B;R!==null;){var J=R;if(B=J.stateNode,J=J.tag,J!==5&&J!==26&&J!==27||B===null||L===null||(J=il(R,L),J!=null&&De.push(Ll(R,J,B))),gt)break;R=R.return}0<De.length&&(P=new G(P,Ee,null,a,X),W.push({event:P,listeners:De}))}}if((i&7)===0){e:{if(P=t==="mouseover"||t==="pointerover",G=t==="mouseout"||t==="pointerout",P&&a!==fs&&(Ee=a.relatedTarget||a.fromElement)&&(Mn(Ee)||Ee[sn]))break e;if((G||P)&&(P=X.window===X?X:(P=X.ownerDocument)?P.defaultView||P.parentWindow:window,G?(Ee=a.relatedTarget||a.toElement,G=q,Ee=Ee?Mn(Ee):null,Ee!==null&&(gt=s(Ee),De=Ee.tag,Ee!==gt||De!==5&&De!==27&&De!==6)&&(Ee=null)):(G=null,Ee=q),G!==Ee)){if(De=yh,J="onMouseLeave",L="onMouseEnter",R="mouse",(t==="pointerout"||t==="pointerover")&&(De=Sh,J="onPointerLeave",L="onPointerEnter",R="pointer"),gt=G==null?P:Yn(G),B=Ee==null?P:Yn(Ee),P=new De(J,R+"leave",G,a,X),P.target=gt,P.relatedTarget=B,J=null,Mn(X)===q&&(De=new De(L,R+"enter",Ee,a,X),De.target=B,De.relatedTarget=gt,J=De),gt=J,G&&Ee)t:{for(De=IE,L=G,R=Ee,B=0,J=L;J;J=De(J))B++;J=0;for(var Oe=R;Oe;Oe=De(Oe))J++;for(;0<B-J;)L=De(L),B--;for(;0<J-B;)R=De(R),J--;for(;B--;){if(L===R||R!==null&&L===R.alternate){De=L;break t}L=De(L),R=De(R)}De=null}else De=null;G!==null&&cg(W,P,G,De,!1),Ee!==null&>!==null&&cg(W,gt,Ee,De,!0)}}e:{if(P=q?Yn(q):window,G=P.nodeName&&P.nodeName.toLowerCase(),G==="select"||G==="input"&&P.type==="file")var rt=xh;else if(wh(P))if(Oh)rt=$v;else{rt=Gv;var we=Zv}else G=P.nodeName,!G||G.toLowerCase()!=="input"||P.type!=="checkbox"&&P.type!=="radio"?q&&cs(q.elementType)&&(rt=xh):rt=Vv;if(rt&&(rt=rt(t,q))){Ah(W,rt,a,X);break e}we&&we(t,P,q),t==="focusout"&&q&&P.type==="number"&&q.memoizedProps.value!=null&&ss(P,"number",P.value)}switch(we=q?Yn(q):window,t){case"focusin":(wh(we)||we.contentEditable==="true")&&(ga=we,ks=q,fl=null);break;case"focusout":fl=ks=ga=null;break;case"mousedown":ws=!0;break;case"contextmenu":case"mouseup":case"dragend":ws=!1,Lh(W,a,X);break;case"selectionchange":if(Fv)break;case"keydown":case"keyup":Lh(W,a,X)}var Ve;if(vs)e:{switch(t){case"compositionstart":var et="onCompositionStart";break e;case"compositionend":et="onCompositionEnd";break e;case"compositionupdate":et="onCompositionUpdate";break e}et=void 0}else ma?Th(t,a)&&(et="onCompositionEnd"):t==="keydown"&&a.keyCode===229&&(et="onCompositionStart");et&&(vh&&a.locale!=="ko"&&(ma||et!=="onCompositionStart"?et==="onCompositionEnd"&&ma&&(Ve=mh()):(sr=X,ms="value"in sr?sr.value:sr.textContent,ma=!0)),we=lo(q,et),0<we.length&&(et=new bh(et,t,null,a,X),W.push({event:et,listeners:we}),Ve?et.data=Ve:(Ve=kh(a),Ve!==null&&(et.data=Ve)))),(Ve=jv?Bv(t,a):qv(t,a))&&(et=lo(q,"onBeforeInput"),0<et.length&&(we=new bh("onBeforeInput","beforeinput",null,a,X),W.push({event:we,listeners:et}),we.data=Ve)),NE(W,t,q,a,X)}og(W,i)})}function Ll(t,i,a){return{instance:t,listener:i,currentTarget:a}}function lo(t,i){for(var a=i+"Capture",u=[];t!==null;){var f=t,h=f.stateNode;if(f=f.tag,f!==5&&f!==26&&f!==27||h===null||(f=il(t,a),f!=null&&u.unshift(Ll(t,f,h)),f=il(t,i),f!=null&&u.push(Ll(t,f,h))),t.tag===3)return u;t=t.return}return[]}function IE(t){if(t===null)return null;do t=t.return;while(t&&t.tag!==5&&t.tag!==27);return t||null}function cg(t,i,a,u,f){for(var h=i._reactName,b=[];a!==null&&a!==u;){var E=a,x=E.alternate,q=E.stateNode;if(E=E.tag,x!==null&&x===u)break;E!==5&&E!==26&&E!==27||q===null||(x=q,f?(q=il(a,h),q!=null&&b.unshift(Ll(a,q,x))):f||(q=il(a,h),q!=null&&b.push(Ll(a,q,x)))),a=a.return}b.length!==0&&t.push({event:i,listeners:b})}var LE=/\r\n?/g,UE=/\u0000|\uFFFD/g;function fg(t){return(typeof t=="string"?t:""+t).replace(LE,`
|
|
9
|
-
`).replace(UE,"")}function dg(t,i){return i=fg(i),fg(t)===i}function mt(t,i,a,u,f,h){switch(a){case"children":typeof u=="string"?i==="body"||i==="textarea"&&u===""||da(t,u):(typeof u=="number"||typeof u=="bigint")&&i!=="body"&&da(t,""+u);break;case"className":ca(t,"class",u);break;case"tabIndex":ca(t,"tabindex",u);break;case"dir":case"role":case"viewBox":case"width":case"height":ca(t,a,u);break;case"style":dh(t,u,h);break;case"data":if(i!=="object"){ca(t,"data",u);break}case"src":case"href":if(u===""&&(i!=="a"||a!=="href")){t.removeAttribute(a);break}if(u==null||typeof u=="function"||typeof u=="symbol"||typeof u=="boolean"){t.removeAttribute(a);break}u=du(""+u),t.setAttribute(a,u);break;case"action":case"formAction":if(typeof u=="function"){t.setAttribute(a,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof h=="function"&&(a==="formAction"?(i!=="input"&&mt(t,i,"name",f.name,f,null),mt(t,i,"formEncType",f.formEncType,f,null),mt(t,i,"formMethod",f.formMethod,f,null),mt(t,i,"formTarget",f.formTarget,f,null)):(mt(t,i,"encType",f.encType,f,null),mt(t,i,"method",f.method,f,null),mt(t,i,"target",f.target,f,null)));if(u==null||typeof u=="symbol"||typeof u=="boolean"){t.removeAttribute(a);break}u=du(""+u),t.setAttribute(a,u);break;case"onClick":u!=null&&(t.onclick=Bi);break;case"onScroll":u!=null&&Qe("scroll",t);break;case"onScrollEnd":u!=null&&Qe("scrollend",t);break;case"dangerouslySetInnerHTML":if(u!=null){if(typeof u!="object"||!("__html"in u))throw Error(l(61));if(a=u.__html,a!=null){if(f.children!=null)throw Error(l(60));t.innerHTML=a}}break;case"multiple":t.multiple=u&&typeof u!="function"&&typeof u!="symbol";break;case"muted":t.muted=u&&typeof u!="function"&&typeof u!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(u==null||typeof u=="function"||typeof u=="boolean"||typeof u=="symbol"){t.removeAttribute("xlink:href");break}a=du(""+u),t.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",a);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":u!=null&&typeof u!="function"&&typeof u!="symbol"?t.setAttribute(a,""+u):t.removeAttribute(a);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":u&&typeof u!="function"&&typeof u!="symbol"?t.setAttribute(a,""):t.removeAttribute(a);break;case"capture":case"download":u===!0?t.setAttribute(a,""):u!==!1&&u!=null&&typeof u!="function"&&typeof u!="symbol"?t.setAttribute(a,u):t.removeAttribute(a);break;case"cols":case"rows":case"size":case"span":u!=null&&typeof u!="function"&&typeof u!="symbol"&&!isNaN(u)&&1<=u?t.setAttribute(a,u):t.removeAttribute(a);break;case"rowSpan":case"start":u==null||typeof u=="function"||typeof u=="symbol"||isNaN(u)?t.removeAttribute(a):t.setAttribute(a,u);break;case"popover":Qe("beforetoggle",t),Qe("toggle",t),vi(t,"popover",u);break;case"xlinkActuate":ji(t,"http://www.w3.org/1999/xlink","xlink:actuate",u);break;case"xlinkArcrole":ji(t,"http://www.w3.org/1999/xlink","xlink:arcrole",u);break;case"xlinkRole":ji(t,"http://www.w3.org/1999/xlink","xlink:role",u);break;case"xlinkShow":ji(t,"http://www.w3.org/1999/xlink","xlink:show",u);break;case"xlinkTitle":ji(t,"http://www.w3.org/1999/xlink","xlink:title",u);break;case"xlinkType":ji(t,"http://www.w3.org/1999/xlink","xlink:type",u);break;case"xmlBase":ji(t,"http://www.w3.org/XML/1998/namespace","xml:base",u);break;case"xmlLang":ji(t,"http://www.w3.org/XML/1998/namespace","xml:lang",u);break;case"xmlSpace":ji(t,"http://www.w3.org/XML/1998/namespace","xml:space",u);break;case"is":vi(t,"is",u);break;case"innerText":case"textContent":break;default:(!(2<a.length)||a[0]!=="o"&&a[0]!=="O"||a[1]!=="n"&&a[1]!=="N")&&(a=fv.get(a)||a,vi(t,a,u))}}function Xc(t,i,a,u,f,h){switch(a){case"style":dh(t,u,h);break;case"dangerouslySetInnerHTML":if(u!=null){if(typeof u!="object"||!("__html"in u))throw Error(l(61));if(a=u.__html,a!=null){if(f.children!=null)throw Error(l(60));t.innerHTML=a}}break;case"children":typeof u=="string"?da(t,u):(typeof u=="number"||typeof u=="bigint")&&da(t,""+u);break;case"onScroll":u!=null&&Qe("scroll",t);break;case"onScrollEnd":u!=null&&Qe("scrollend",t);break;case"onClick":u!=null&&(t.onclick=Bi);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!ye.hasOwnProperty(a))e:{if(a[0]==="o"&&a[1]==="n"&&(f=a.endsWith("Capture"),i=a.slice(2,f?a.length-7:void 0),h=t[kt]||null,h=h!=null?h[a]:null,typeof h=="function"&&t.removeEventListener(i,h,f),typeof u=="function")){typeof h!="function"&&h!==null&&(a in t?t[a]=null:t.hasAttribute(a)&&t.removeAttribute(a)),t.addEventListener(i,u,f);break e}a in t?t[a]=u:u===!0?t.setAttribute(a,""):vi(t,a,u)}}}function bn(t,i,a){switch(i){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Qe("error",t),Qe("load",t);var u=!1,f=!1,h;for(h in a)if(a.hasOwnProperty(h)){var b=a[h];if(b!=null)switch(h){case"src":u=!0;break;case"srcSet":f=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(l(137,i));default:mt(t,i,h,b,a,null)}}f&&mt(t,i,"srcSet",a.srcSet,a,null),u&&mt(t,i,"src",a.src,a,null);return;case"input":Qe("invalid",t);var E=h=b=f=null,x=null,q=null;for(u in a)if(a.hasOwnProperty(u)){var X=a[u];if(X!=null)switch(u){case"name":f=X;break;case"type":b=X;break;case"checked":x=X;break;case"defaultChecked":q=X;break;case"value":h=X;break;case"defaultValue":E=X;break;case"children":case"dangerouslySetInnerHTML":if(X!=null)throw Error(l(137,i));break;default:mt(t,i,u,X,a,null)}}oh(t,h,E,x,q,b,f,!1);return;case"select":Qe("invalid",t),u=b=h=null;for(f in a)if(a.hasOwnProperty(f)&&(E=a[f],E!=null))switch(f){case"value":h=E;break;case"defaultValue":b=E;break;case"multiple":u=E;default:mt(t,i,f,E,a,null)}i=h,a=b,t.multiple=!!u,i!=null?fa(t,!!u,i,!1):a!=null&&fa(t,!!u,a,!0);return;case"textarea":Qe("invalid",t),h=f=u=null;for(b in a)if(a.hasOwnProperty(b)&&(E=a[b],E!=null))switch(b){case"value":u=E;break;case"defaultValue":f=E;break;case"children":h=E;break;case"dangerouslySetInnerHTML":if(E!=null)throw Error(l(91));break;default:mt(t,i,b,E,a,null)}ch(t,u,f,h);return;case"option":for(x in a)a.hasOwnProperty(x)&&(u=a[x],u!=null)&&(x==="selected"?t.selected=u&&typeof u!="function"&&typeof u!="symbol":mt(t,i,x,u,a,null));return;case"dialog":Qe("beforetoggle",t),Qe("toggle",t),Qe("cancel",t),Qe("close",t);break;case"iframe":case"object":Qe("load",t);break;case"video":case"audio":for(u=0;u<Il.length;u++)Qe(Il[u],t);break;case"image":Qe("error",t),Qe("load",t);break;case"details":Qe("toggle",t);break;case"embed":case"source":case"link":Qe("error",t),Qe("load",t);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(q in a)if(a.hasOwnProperty(q)&&(u=a[q],u!=null))switch(q){case"children":case"dangerouslySetInnerHTML":throw Error(l(137,i));default:mt(t,i,q,u,a,null)}return;default:if(cs(i)){for(X in a)a.hasOwnProperty(X)&&(u=a[X],u!==void 0&&Xc(t,i,X,u,a,void 0));return}}for(E in a)a.hasOwnProperty(E)&&(u=a[E],u!=null&&mt(t,i,E,u,a,null))}function jE(t,i,a,u){switch(i){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var f=null,h=null,b=null,E=null,x=null,q=null,X=null;for(G in a){var W=a[G];if(a.hasOwnProperty(G)&&W!=null)switch(G){case"checked":break;case"value":break;case"defaultValue":x=W;default:u.hasOwnProperty(G)||mt(t,i,G,null,u,W)}}for(var P in u){var G=u[P];if(W=a[P],u.hasOwnProperty(P)&&(G!=null||W!=null))switch(P){case"type":h=G;break;case"name":f=G;break;case"checked":q=G;break;case"defaultChecked":X=G;break;case"value":b=G;break;case"defaultValue":E=G;break;case"children":case"dangerouslySetInnerHTML":if(G!=null)throw Error(l(137,i));break;default:G!==W&&mt(t,i,P,G,u,W)}}os(t,b,E,x,q,X,h,f);return;case"select":G=b=E=P=null;for(h in a)if(x=a[h],a.hasOwnProperty(h)&&x!=null)switch(h){case"value":break;case"multiple":G=x;default:u.hasOwnProperty(h)||mt(t,i,h,null,u,x)}for(f in u)if(h=u[f],x=a[f],u.hasOwnProperty(f)&&(h!=null||x!=null))switch(f){case"value":P=h;break;case"defaultValue":E=h;break;case"multiple":b=h;default:h!==x&&mt(t,i,f,h,u,x)}i=E,a=b,u=G,P!=null?fa(t,!!a,P,!1):!!u!=!!a&&(i!=null?fa(t,!!a,i,!0):fa(t,!!a,a?[]:"",!1));return;case"textarea":G=P=null;for(E in a)if(f=a[E],a.hasOwnProperty(E)&&f!=null&&!u.hasOwnProperty(E))switch(E){case"value":break;case"children":break;default:mt(t,i,E,null,u,f)}for(b in u)if(f=u[b],h=a[b],u.hasOwnProperty(b)&&(f!=null||h!=null))switch(b){case"value":P=f;break;case"defaultValue":G=f;break;case"children":break;case"dangerouslySetInnerHTML":if(f!=null)throw Error(l(91));break;default:f!==h&&mt(t,i,b,f,u,h)}sh(t,P,G);return;case"option":for(var Ee in a)P=a[Ee],a.hasOwnProperty(Ee)&&P!=null&&!u.hasOwnProperty(Ee)&&(Ee==="selected"?t.selected=!1:mt(t,i,Ee,null,u,P));for(x in u)P=u[x],G=a[x],u.hasOwnProperty(x)&&P!==G&&(P!=null||G!=null)&&(x==="selected"?t.selected=P&&typeof P!="function"&&typeof P!="symbol":mt(t,i,x,P,u,G));return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var De in a)P=a[De],a.hasOwnProperty(De)&&P!=null&&!u.hasOwnProperty(De)&&mt(t,i,De,null,u,P);for(q in u)if(P=u[q],G=a[q],u.hasOwnProperty(q)&&P!==G&&(P!=null||G!=null))switch(q){case"children":case"dangerouslySetInnerHTML":if(P!=null)throw Error(l(137,i));break;default:mt(t,i,q,P,u,G)}return;default:if(cs(i)){for(var gt in a)P=a[gt],a.hasOwnProperty(gt)&&P!==void 0&&!u.hasOwnProperty(gt)&&Xc(t,i,gt,void 0,u,P);for(X in u)P=u[X],G=a[X],!u.hasOwnProperty(X)||P===G||P===void 0&&G===void 0||Xc(t,i,X,P,u,G);return}}for(var L in a)P=a[L],a.hasOwnProperty(L)&&P!=null&&!u.hasOwnProperty(L)&&mt(t,i,L,null,u,P);for(W in u)P=u[W],G=a[W],!u.hasOwnProperty(W)||P===G||P==null&&G==null||mt(t,i,W,P,u,G)}function hg(t){switch(t){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function BE(){if(typeof performance.getEntriesByType=="function"){for(var t=0,i=0,a=performance.getEntriesByType("resource"),u=0;u<a.length;u++){var f=a[u],h=f.transferSize,b=f.initiatorType,E=f.duration;if(h&&E&&hg(b)){for(b=0,E=f.responseEnd,u+=1;u<a.length;u++){var x=a[u],q=x.startTime;if(q>E)break;var X=x.transferSize,W=x.initiatorType;X&&hg(W)&&(x=x.responseEnd,b+=X*(x<E?1:(E-q)/(x-q)))}if(--u,i+=8*(h+b)/(f.duration/1e3),t++,10<t)break}}if(0<t)return i/t/1e6}return navigator.connection&&(t=navigator.connection.downlink,typeof t=="number")?t:5}var Qc=null,Jc=null;function uo(t){return t.nodeType===9?t:t.ownerDocument}function pg(t){switch(t){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function mg(t,i){if(t===0)switch(i){case"svg":return 1;case"math":return 2;default:return 0}return t===1&&i==="foreignObject"?0:t}function Wc(t,i){return t==="textarea"||t==="noscript"||typeof i.children=="string"||typeof i.children=="number"||typeof i.children=="bigint"||typeof i.dangerouslySetInnerHTML=="object"&&i.dangerouslySetInnerHTML!==null&&i.dangerouslySetInnerHTML.__html!=null}var ef=null;function qE(){var t=window.event;return t&&t.type==="popstate"?t===ef?!1:(ef=t,!0):(ef=null,!1)}var gg=typeof setTimeout=="function"?setTimeout:void 0,HE=typeof clearTimeout=="function"?clearTimeout:void 0,yg=typeof Promise=="function"?Promise:void 0,PE=typeof queueMicrotask=="function"?queueMicrotask:typeof yg<"u"?function(t){return yg.resolve(null).then(t).catch(ZE)}:gg;function ZE(t){setTimeout(function(){throw t})}function Ar(t){return t==="head"}function bg(t,i){var a=i,u=0;do{var f=a.nextSibling;if(t.removeChild(a),f&&f.nodeType===8)if(a=f.data,a==="/$"||a==="/&"){if(u===0){t.removeChild(f),Za(i);return}u--}else if(a==="$"||a==="$?"||a==="$~"||a==="$!"||a==="&")u++;else if(a==="html")Ul(t.ownerDocument.documentElement);else if(a==="head"){a=t.ownerDocument.head,Ul(a);for(var h=a.firstChild;h;){var b=h.nextSibling,E=h.nodeName;h[ii]||E==="SCRIPT"||E==="STYLE"||E==="LINK"&&h.rel.toLowerCase()==="stylesheet"||a.removeChild(h),h=b}}else a==="body"&&Ul(t.ownerDocument.body);a=f}while(a);Za(i)}function Sg(t,i){var a=t;t=0;do{var u=a.nextSibling;if(a.nodeType===1?i?(a._stashedDisplay=a.style.display,a.style.display="none"):(a.style.display=a._stashedDisplay||"",a.getAttribute("style")===""&&a.removeAttribute("style")):a.nodeType===3&&(i?(a._stashedText=a.nodeValue,a.nodeValue=""):a.nodeValue=a._stashedText||""),u&&u.nodeType===8)if(a=u.data,a==="/$"){if(t===0)break;t--}else a!=="$"&&a!=="$?"&&a!=="$~"&&a!=="$!"||t++;a=u}while(a)}function tf(t){var i=t.firstChild;for(i&&i.nodeType===10&&(i=i.nextSibling);i;){var a=i;switch(i=i.nextSibling,a.nodeName){case"HTML":case"HEAD":case"BODY":tf(a),Oi(a);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(a.rel.toLowerCase()==="stylesheet")continue}t.removeChild(a)}}function GE(t,i,a,u){for(;t.nodeType===1;){var f=a;if(t.nodeName.toLowerCase()!==i.toLowerCase()){if(!u&&(t.nodeName!=="INPUT"||t.type!=="hidden"))break}else if(u){if(!t[ii])switch(i){case"meta":if(!t.hasAttribute("itemprop"))break;return t;case"link":if(h=t.getAttribute("rel"),h==="stylesheet"&&t.hasAttribute("data-precedence"))break;if(h!==f.rel||t.getAttribute("href")!==(f.href==null||f.href===""?null:f.href)||t.getAttribute("crossorigin")!==(f.crossOrigin==null?null:f.crossOrigin)||t.getAttribute("title")!==(f.title==null?null:f.title))break;return t;case"style":if(t.hasAttribute("data-precedence"))break;return t;case"script":if(h=t.getAttribute("src"),(h!==(f.src==null?null:f.src)||t.getAttribute("type")!==(f.type==null?null:f.type)||t.getAttribute("crossorigin")!==(f.crossOrigin==null?null:f.crossOrigin))&&h&&t.hasAttribute("async")&&!t.hasAttribute("itemprop"))break;return t;default:return t}}else if(i==="input"&&t.type==="hidden"){var h=f.name==null?null:""+f.name;if(f.type==="hidden"&&t.getAttribute("name")===h)return t}else return t;if(t=hi(t.nextSibling),t===null)break}return null}function VE(t,i,a){if(i==="")return null;for(;t.nodeType!==3;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!a||(t=hi(t.nextSibling),t===null))return null;return t}function vg(t,i){for(;t.nodeType!==8;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!i||(t=hi(t.nextSibling),t===null))return null;return t}function nf(t){return t.data==="$?"||t.data==="$~"}function rf(t){return t.data==="$!"||t.data==="$?"&&t.ownerDocument.readyState!=="loading"}function $E(t,i){var a=t.ownerDocument;if(t.data==="$~")t._reactRetry=i;else if(t.data!=="$?"||a.readyState!=="loading")i();else{var u=function(){i(),a.removeEventListener("DOMContentLoaded",u)};a.addEventListener("DOMContentLoaded",u),t._reactRetry=u}}function hi(t){for(;t!=null;t=t.nextSibling){var i=t.nodeType;if(i===1||i===3)break;if(i===8){if(i=t.data,i==="$"||i==="$!"||i==="$?"||i==="$~"||i==="&"||i==="F!"||i==="F")break;if(i==="/$"||i==="/&")return null}}return t}var af=null;function Eg(t){t=t.nextSibling;for(var i=0;t;){if(t.nodeType===8){var a=t.data;if(a==="/$"||a==="/&"){if(i===0)return hi(t.nextSibling);i--}else a!=="$"&&a!=="$!"&&a!=="$?"&&a!=="$~"&&a!=="&"||i++}t=t.nextSibling}return null}function _g(t){t=t.previousSibling;for(var i=0;t;){if(t.nodeType===8){var a=t.data;if(a==="$"||a==="$!"||a==="$?"||a==="$~"||a==="&"){if(i===0)return t;i--}else a!=="/$"&&a!=="/&"||i++}t=t.previousSibling}return null}function Tg(t,i,a){switch(i=uo(a),t){case"html":if(t=i.documentElement,!t)throw Error(l(452));return t;case"head":if(t=i.head,!t)throw Error(l(453));return t;case"body":if(t=i.body,!t)throw Error(l(454));return t;default:throw Error(l(451))}}function Ul(t){for(var i=t.attributes;i.length;)t.removeAttributeNode(i[0]);Oi(t)}var pi=new Map,kg=new Set;function oo(t){return typeof t.getRootNode=="function"?t.getRootNode():t.nodeType===9?t:t.ownerDocument}var tr=le.d;le.d={f:YE,r:FE,D:KE,C:XE,L:QE,m:JE,X:e_,S:WE,M:t_};function YE(){var t=tr.f(),i=Wu();return t||i}function FE(t){var i=ri(t);i!==null&&i.tag===5&&i.type==="form"?Hp(i):tr.r(t)}var qa=typeof document>"u"?null:document;function wg(t,i,a){var u=qa;if(u&&typeof i=="string"&&i){var f=li(i);f='link[rel="'+t+'"][href="'+f+'"]',typeof a=="string"&&(f+='[crossorigin="'+a+'"]'),kg.has(f)||(kg.add(f),t={rel:t,crossOrigin:a,href:i},u.querySelector(f)===null&&(i=u.createElement("link"),bn(i,"link",t),wt(i),u.head.appendChild(i)))}}function KE(t){tr.D(t),wg("dns-prefetch",t,null)}function XE(t,i){tr.C(t,i),wg("preconnect",t,i)}function QE(t,i,a){tr.L(t,i,a);var u=qa;if(u&&t&&i){var f='link[rel="preload"][as="'+li(i)+'"]';i==="image"&&a&&a.imageSrcSet?(f+='[imagesrcset="'+li(a.imageSrcSet)+'"]',typeof a.imageSizes=="string"&&(f+='[imagesizes="'+li(a.imageSizes)+'"]')):f+='[href="'+li(t)+'"]';var h=f;switch(i){case"style":h=Ha(t);break;case"script":h=Pa(t)}pi.has(h)||(t=g({rel:"preload",href:i==="image"&&a&&a.imageSrcSet?void 0:t,as:i},a),pi.set(h,t),u.querySelector(f)!==null||i==="style"&&u.querySelector(jl(h))||i==="script"&&u.querySelector(Bl(h))||(i=u.createElement("link"),bn(i,"link",t),wt(i),u.head.appendChild(i)))}}function JE(t,i){tr.m(t,i);var a=qa;if(a&&t){var u=i&&typeof i.as=="string"?i.as:"script",f='link[rel="modulepreload"][as="'+li(u)+'"][href="'+li(t)+'"]',h=f;switch(u){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":h=Pa(t)}if(!pi.has(h)&&(t=g({rel:"modulepreload",href:t},i),pi.set(h,t),a.querySelector(f)===null)){switch(u){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(a.querySelector(Bl(h)))return}u=a.createElement("link"),bn(u,"link",t),wt(u),a.head.appendChild(u)}}}function WE(t,i,a){tr.S(t,i,a);var u=qa;if(u&&t){var f=Si(u).hoistableStyles,h=Ha(t);i=i||"default";var b=f.get(h);if(!b){var E={loading:0,preload:null};if(b=u.querySelector(jl(h)))E.loading=5;else{t=g({rel:"stylesheet",href:t,"data-precedence":i},a),(a=pi.get(h))&&lf(t,a);var x=b=u.createElement("link");wt(x),bn(x,"link",t),x._p=new Promise(function(q,X){x.onload=q,x.onerror=X}),x.addEventListener("load",function(){E.loading|=1}),x.addEventListener("error",function(){E.loading|=2}),E.loading|=4,so(b,i,u)}b={type:"stylesheet",instance:b,count:1,state:E},f.set(h,b)}}}function e_(t,i){tr.X(t,i);var a=qa;if(a&&t){var u=Si(a).hoistableScripts,f=Pa(t),h=u.get(f);h||(h=a.querySelector(Bl(f)),h||(t=g({src:t,async:!0},i),(i=pi.get(f))&&uf(t,i),h=a.createElement("script"),wt(h),bn(h,"link",t),a.head.appendChild(h)),h={type:"script",instance:h,count:1,state:null},u.set(f,h))}}function t_(t,i){tr.M(t,i);var a=qa;if(a&&t){var u=Si(a).hoistableScripts,f=Pa(t),h=u.get(f);h||(h=a.querySelector(Bl(f)),h||(t=g({src:t,async:!0,type:"module"},i),(i=pi.get(f))&&uf(t,i),h=a.createElement("script"),wt(h),bn(h,"link",t),a.head.appendChild(h)),h={type:"script",instance:h,count:1,state:null},u.set(f,h))}}function Ag(t,i,a,u){var f=(f=Te.current)?oo(f):null;if(!f)throw Error(l(446));switch(t){case"meta":case"title":return null;case"style":return typeof a.precedence=="string"&&typeof a.href=="string"?(i=Ha(a.href),a=Si(f).hoistableStyles,u=a.get(i),u||(u={type:"style",instance:null,count:0,state:null},a.set(i,u)),u):{type:"void",instance:null,count:0,state:null};case"link":if(a.rel==="stylesheet"&&typeof a.href=="string"&&typeof a.precedence=="string"){t=Ha(a.href);var h=Si(f).hoistableStyles,b=h.get(t);if(b||(f=f.ownerDocument||f,b={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},h.set(t,b),(h=f.querySelector(jl(t)))&&!h._p&&(b.instance=h,b.state.loading=5),pi.has(t)||(a={rel:"preload",as:"style",href:a.href,crossOrigin:a.crossOrigin,integrity:a.integrity,media:a.media,hrefLang:a.hrefLang,referrerPolicy:a.referrerPolicy},pi.set(t,a),h||n_(f,t,a,b.state))),i&&u===null)throw Error(l(528,""));return b}if(i&&u!==null)throw Error(l(529,""));return null;case"script":return i=a.async,a=a.src,typeof a=="string"&&i&&typeof i!="function"&&typeof i!="symbol"?(i=Pa(a),a=Si(f).hoistableScripts,u=a.get(i),u||(u={type:"script",instance:null,count:0,state:null},a.set(i,u)),u):{type:"void",instance:null,count:0,state:null};default:throw Error(l(444,t))}}function Ha(t){return'href="'+li(t)+'"'}function jl(t){return'link[rel="stylesheet"]['+t+"]"}function xg(t){return g({},t,{"data-precedence":t.precedence,precedence:null})}function n_(t,i,a,u){t.querySelector('link[rel="preload"][as="style"]['+i+"]")?u.loading=1:(i=t.createElement("link"),u.preload=i,i.addEventListener("load",function(){return u.loading|=1}),i.addEventListener("error",function(){return u.loading|=2}),bn(i,"link",a),wt(i),t.head.appendChild(i))}function Pa(t){return'[src="'+li(t)+'"]'}function Bl(t){return"script[async]"+t}function Og(t,i,a){if(i.count++,i.instance===null)switch(i.type){case"style":var u=t.querySelector('style[data-href~="'+li(a.href)+'"]');if(u)return i.instance=u,wt(u),u;var f=g({},a,{"data-href":a.href,"data-precedence":a.precedence,href:null,precedence:null});return u=(t.ownerDocument||t).createElement("style"),wt(u),bn(u,"style",f),so(u,a.precedence,t),i.instance=u;case"stylesheet":f=Ha(a.href);var h=t.querySelector(jl(f));if(h)return i.state.loading|=4,i.instance=h,wt(h),h;u=xg(a),(f=pi.get(f))&&lf(u,f),h=(t.ownerDocument||t).createElement("link"),wt(h);var b=h;return b._p=new Promise(function(E,x){b.onload=E,b.onerror=x}),bn(h,"link",u),i.state.loading|=4,so(h,a.precedence,t),i.instance=h;case"script":return h=Pa(a.src),(f=t.querySelector(Bl(h)))?(i.instance=f,wt(f),f):(u=a,(f=pi.get(h))&&(u=g({},a),uf(u,f)),t=t.ownerDocument||t,f=t.createElement("script"),wt(f),bn(f,"link",u),t.head.appendChild(f),i.instance=f);case"void":return null;default:throw Error(l(443,i.type))}else i.type==="stylesheet"&&(i.state.loading&4)===0&&(u=i.instance,i.state.loading|=4,so(u,a.precedence,t));return i.instance}function so(t,i,a){for(var u=a.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),f=u.length?u[u.length-1]:null,h=f,b=0;b<u.length;b++){var E=u[b];if(E.dataset.precedence===i)h=E;else if(h!==f)break}h?h.parentNode.insertBefore(t,h.nextSibling):(i=a.nodeType===9?a.head:a,i.insertBefore(t,i.firstChild))}function lf(t,i){t.crossOrigin==null&&(t.crossOrigin=i.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=i.referrerPolicy),t.title==null&&(t.title=i.title)}function uf(t,i){t.crossOrigin==null&&(t.crossOrigin=i.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=i.referrerPolicy),t.integrity==null&&(t.integrity=i.integrity)}var co=null;function Cg(t,i,a){if(co===null){var u=new Map,f=co=new Map;f.set(a,u)}else f=co,u=f.get(a),u||(u=new Map,f.set(a,u));if(u.has(t))return u;for(u.set(t,null),a=a.getElementsByTagName(t),f=0;f<a.length;f++){var h=a[f];if(!(h[ii]||h[Ke]||t==="link"&&h.getAttribute("rel")==="stylesheet")&&h.namespaceURI!=="http://www.w3.org/2000/svg"){var b=h.getAttribute(i)||"";b=t+b;var E=u.get(b);E?E.push(h):u.set(b,[h])}}return u}function zg(t,i,a){t=t.ownerDocument||t,t.head.insertBefore(a,i==="title"?t.querySelector("head > title"):null)}function i_(t,i,a){if(a===1||i.itemProp!=null)return!1;switch(t){case"meta":case"title":return!0;case"style":if(typeof i.precedence!="string"||typeof i.href!="string"||i.href==="")break;return!0;case"link":if(typeof i.rel!="string"||typeof i.href!="string"||i.href===""||i.onLoad||i.onError)break;return i.rel==="stylesheet"?(t=i.disabled,typeof i.precedence=="string"&&t==null):!0;case"script":if(i.async&&typeof i.async!="function"&&typeof i.async!="symbol"&&!i.onLoad&&!i.onError&&i.src&&typeof i.src=="string")return!0}return!1}function Ng(t){return!(t.type==="stylesheet"&&(t.state.loading&3)===0)}function r_(t,i,a,u){if(a.type==="stylesheet"&&(typeof u.media!="string"||matchMedia(u.media).matches!==!1)&&(a.state.loading&4)===0){if(a.instance===null){var f=Ha(u.href),h=i.querySelector(jl(f));if(h){i=h._p,i!==null&&typeof i=="object"&&typeof i.then=="function"&&(t.count++,t=fo.bind(t),i.then(t,t)),a.state.loading|=4,a.instance=h,wt(h);return}h=i.ownerDocument||i,u=xg(u),(f=pi.get(f))&&lf(u,f),h=h.createElement("link"),wt(h);var b=h;b._p=new Promise(function(E,x){b.onload=E,b.onerror=x}),bn(h,"link",u),a.instance=h}t.stylesheets===null&&(t.stylesheets=new Map),t.stylesheets.set(a,i),(i=a.state.preload)&&(a.state.loading&3)===0&&(t.count++,a=fo.bind(t),i.addEventListener("load",a),i.addEventListener("error",a))}}var of=0;function a_(t,i){return t.stylesheets&&t.count===0&&po(t,t.stylesheets),0<t.count||0<t.imgCount?function(a){var u=setTimeout(function(){if(t.stylesheets&&po(t,t.stylesheets),t.unsuspend){var h=t.unsuspend;t.unsuspend=null,h()}},6e4+i);0<t.imgBytes&&of===0&&(of=62500*BE());var f=setTimeout(function(){if(t.waitingForImages=!1,t.count===0&&(t.stylesheets&&po(t,t.stylesheets),t.unsuspend)){var h=t.unsuspend;t.unsuspend=null,h()}},(t.imgBytes>of?50:800)+i);return t.unsuspend=a,function(){t.unsuspend=null,clearTimeout(u),clearTimeout(f)}}:null}function fo(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)po(this,this.stylesheets);else if(this.unsuspend){var t=this.unsuspend;this.unsuspend=null,t()}}}var ho=null;function po(t,i){t.stylesheets=null,t.unsuspend!==null&&(t.count++,ho=new Map,i.forEach(l_,t),ho=null,fo.call(t))}function l_(t,i){if(!(i.state.loading&4)){var a=ho.get(t);if(a)var u=a.get(null);else{a=new Map,ho.set(t,a);for(var f=t.querySelectorAll("link[data-precedence],style[data-precedence]"),h=0;h<f.length;h++){var b=f[h];(b.nodeName==="LINK"||b.getAttribute("media")!=="not all")&&(a.set(b.dataset.precedence,b),u=b)}u&&a.set(null,u)}f=i.instance,b=f.getAttribute("data-precedence"),h=a.get(b)||u,h===u&&a.set(null,f),a.set(b,f),this.count++,u=fo.bind(this),f.addEventListener("load",u),f.addEventListener("error",u),h?h.parentNode.insertBefore(f,h.nextSibling):(t=t.nodeType===9?t.head:t,t.insertBefore(f,t.firstChild)),i.state.loading|=4}}var ql={$$typeof:j,Provider:null,Consumer:null,_currentValue:ve,_currentValue2:ve,_threadCount:0};function u_(t,i,a,u,f,h,b,E,x){this.tag=1,this.containerInfo=t,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=Ui(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ui(0),this.hiddenUpdates=Ui(null),this.identifierPrefix=u,this.onUncaughtError=f,this.onCaughtError=h,this.onRecoverableError=b,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=x,this.incompleteTransitions=new Map}function Rg(t,i,a,u,f,h,b,E,x,q,X,W){return t=new u_(t,i,a,b,x,q,X,W,E),i=1,h===!0&&(i|=24),h=Kn(3,null,null,i),t.current=h,h.stateNode=t,i=qs(),i.refCount++,t.pooledCache=i,i.refCount++,h.memoizedState={element:u,isDehydrated:a,cache:i},Gs(h),t}function Dg(t){return t?(t=Sa,t):Sa}function Mg(t,i,a,u,f,h){f=Dg(f),u.context===null?u.context=f:u.pendingContext=f,u=mr(i),u.payload={element:a},h=h===void 0?null:h,h!==null&&(u.callback=h),a=gr(t,u,i),a!==null&&(qn(a,t,i),bl(a,t,i))}function Ig(t,i){if(t=t.memoizedState,t!==null&&t.dehydrated!==null){var a=t.retryLane;t.retryLane=a!==0&&a<i?a:i}}function sf(t,i){Ig(t,i),(t=t.alternate)&&Ig(t,i)}function Lg(t){if(t.tag===13||t.tag===31){var i=Gr(t,67108864);i!==null&&qn(i,t,67108864),sf(t,67108864)}}function Ug(t){if(t.tag===13||t.tag===31){var i=ei();i=fe(i);var a=Gr(t,i);a!==null&&qn(a,t,i),sf(t,i)}}var mo=!0;function o_(t,i,a,u){var f=H.T;H.T=null;var h=le.p;try{le.p=2,cf(t,i,a,u)}finally{le.p=h,H.T=f}}function s_(t,i,a,u){var f=H.T;H.T=null;var h=le.p;try{le.p=8,cf(t,i,a,u)}finally{le.p=h,H.T=f}}function cf(t,i,a,u){if(mo){var f=ff(u);if(f===null)Kc(t,i,u,go,a),Bg(t,u);else if(f_(f,t,i,a,u))u.stopPropagation();else if(Bg(t,u),i&4&&-1<c_.indexOf(t)){for(;f!==null;){var h=ri(f);if(h!==null)switch(h.tag){case 3:if(h=h.stateNode,h.current.memoizedState.isDehydrated){var b=$n(h.pendingLanes);if(b!==0){var E=h;for(E.pendingLanes|=2,E.entangledLanes|=2;b;){var x=1<<31-Ye(b);E.entanglements[1]|=x,b&=~x}Ri(h),(ot&6)===0&&(Qu=Rt()+500,Ml(0))}}break;case 31:case 13:E=Gr(h,2),E!==null&&qn(E,h,2),Wu(),sf(h,2)}if(h=ff(u),h===null&&Kc(t,i,u,go,a),h===f)break;f=h}f!==null&&u.stopPropagation()}else Kc(t,i,u,null,a)}}function ff(t){return t=ds(t),df(t)}var go=null;function df(t){if(go=null,t=Mn(t),t!==null){var i=s(t);if(i===null)t=null;else{var a=i.tag;if(a===13){if(t=c(i),t!==null)return t;t=null}else if(a===31){if(t=d(i),t!==null)return t;t=null}else if(a===3){if(i.stateNode.current.memoizedState.isDehydrated)return i.tag===3?i.stateNode.containerInfo:null;t=null}else i!==t&&(t=null)}}return go=t,null}function jg(t){switch(t){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(st()){case K:return 2;case se:return 8;case ze:case je:return 32;case $e:return 268435456;default:return 32}default:return 32}}var hf=!1,xr=null,Or=null,Cr=null,Hl=new Map,Pl=new Map,zr=[],c_="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function Bg(t,i){switch(t){case"focusin":case"focusout":xr=null;break;case"dragenter":case"dragleave":Or=null;break;case"mouseover":case"mouseout":Cr=null;break;case"pointerover":case"pointerout":Hl.delete(i.pointerId);break;case"gotpointercapture":case"lostpointercapture":Pl.delete(i.pointerId)}}function Zl(t,i,a,u,f,h){return t===null||t.nativeEvent!==h?(t={blockedOn:i,domEventName:a,eventSystemFlags:u,nativeEvent:h,targetContainers:[f]},i!==null&&(i=ri(i),i!==null&&Lg(i)),t):(t.eventSystemFlags|=u,i=t.targetContainers,f!==null&&i.indexOf(f)===-1&&i.push(f),t)}function f_(t,i,a,u,f){switch(i){case"focusin":return xr=Zl(xr,t,i,a,u,f),!0;case"dragenter":return Or=Zl(Or,t,i,a,u,f),!0;case"mouseover":return Cr=Zl(Cr,t,i,a,u,f),!0;case"pointerover":var h=f.pointerId;return Hl.set(h,Zl(Hl.get(h)||null,t,i,a,u,f)),!0;case"gotpointercapture":return h=f.pointerId,Pl.set(h,Zl(Pl.get(h)||null,t,i,a,u,f)),!0}return!1}function qg(t){var i=Mn(t.target);if(i!==null){var a=s(i);if(a!==null){if(i=a.tag,i===13){if(i=c(a),i!==null){t.blockedOn=i,Ue(t.priority,function(){Ug(a)});return}}else if(i===31){if(i=d(a),i!==null){t.blockedOn=i,Ue(t.priority,function(){Ug(a)});return}}else if(i===3&&a.stateNode.current.memoizedState.isDehydrated){t.blockedOn=a.tag===3?a.stateNode.containerInfo:null;return}}}t.blockedOn=null}function yo(t){if(t.blockedOn!==null)return!1;for(var i=t.targetContainers;0<i.length;){var a=ff(t.nativeEvent);if(a===null){a=t.nativeEvent;var u=new a.constructor(a.type,a);fs=u,a.target.dispatchEvent(u),fs=null}else return i=ri(a),i!==null&&Lg(i),t.blockedOn=a,!1;i.shift()}return!0}function Hg(t,i,a){yo(t)&&a.delete(i)}function d_(){hf=!1,xr!==null&&yo(xr)&&(xr=null),Or!==null&&yo(Or)&&(Or=null),Cr!==null&&yo(Cr)&&(Cr=null),Hl.forEach(Hg),Pl.forEach(Hg)}function bo(t,i){t.blockedOn===i&&(t.blockedOn=null,hf||(hf=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,d_)))}var So=null;function Pg(t){So!==t&&(So=t,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){So===t&&(So=null);for(var i=0;i<t.length;i+=3){var a=t[i],u=t[i+1],f=t[i+2];if(typeof u!="function"){if(df(u||a)===null)continue;break}var h=ri(a);h!==null&&(t.splice(i,3),i-=3,cc(h,{pending:!0,data:f,method:a.method,action:u},u,f))}}))}function Za(t){function i(x){return bo(x,t)}xr!==null&&bo(xr,t),Or!==null&&bo(Or,t),Cr!==null&&bo(Cr,t),Hl.forEach(i),Pl.forEach(i);for(var a=0;a<zr.length;a++){var u=zr[a];u.blockedOn===t&&(u.blockedOn=null)}for(;0<zr.length&&(a=zr[0],a.blockedOn===null);)qg(a),a.blockedOn===null&&zr.shift();if(a=(t.ownerDocument||t).$$reactFormReplay,a!=null)for(u=0;u<a.length;u+=3){var f=a[u],h=a[u+1],b=f[kt]||null;if(typeof h=="function")b||Pg(a);else if(b){var E=null;if(h&&h.hasAttribute("formAction")){if(f=h,b=h[kt]||null)E=b.formAction;else if(df(f)!==null)continue}else E=b.action;typeof E=="function"?a[u+1]=E:(a.splice(u,3),u-=3),Pg(a)}}}function Zg(){function t(h){h.canIntercept&&h.info==="react-transition"&&h.intercept({handler:function(){return new Promise(function(b){return f=b})},focusReset:"manual",scroll:"manual"})}function i(){f!==null&&(f(),f=null),u||setTimeout(a,20)}function a(){if(!u&&!navigation.transition){var h=navigation.currentEntry;h&&h.url!=null&&navigation.navigate(h.url,{state:h.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var u=!1,f=null;return navigation.addEventListener("navigate",t),navigation.addEventListener("navigatesuccess",i),navigation.addEventListener("navigateerror",i),setTimeout(a,100),function(){u=!0,navigation.removeEventListener("navigate",t),navigation.removeEventListener("navigatesuccess",i),navigation.removeEventListener("navigateerror",i),f!==null&&(f(),f=null)}}}function pf(t){this._internalRoot=t}vo.prototype.render=pf.prototype.render=function(t){var i=this._internalRoot;if(i===null)throw Error(l(409));var a=i.current,u=ei();Mg(a,u,t,i,null,null)},vo.prototype.unmount=pf.prototype.unmount=function(){var t=this._internalRoot;if(t!==null){this._internalRoot=null;var i=t.containerInfo;Mg(t.current,2,null,t,null,null),Wu(),i[sn]=null}};function vo(t){this._internalRoot=t}vo.prototype.unstable_scheduleHydration=function(t){if(t){var i=bt();t={blockedOn:null,target:t,priority:i};for(var a=0;a<zr.length&&i!==0&&i<zr[a].priority;a++);zr.splice(a,0,t),a===0&&qg(t)}};var Gg=n.version;if(Gg!=="19.2.8")throw Error(l(527,Gg,"19.2.8"));le.findDOMNode=function(t){var i=t._reactInternals;if(i===void 0)throw typeof t.render=="function"?Error(l(188)):(t=Object.keys(t).join(","),Error(l(268,t)));return t=p(i),t=t!==null?y(t):null,t=t===null?null:t.stateNode,t};var h_={bundleType:0,version:"19.2.8",rendererPackageName:"react-dom",currentDispatcherRef:H,reconcilerVersion:"19.2.8"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Eo=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Eo.isDisabled&&Eo.supportsFiber)try{xt=Eo.inject(h_),Ot=Eo}catch{}}return Vl.createRoot=function(t,i){if(!o(t))throw Error(l(299));var a=!1,u="",f=Qp,h=Jp,b=Wp;return i!=null&&(i.unstable_strictMode===!0&&(a=!0),i.identifierPrefix!==void 0&&(u=i.identifierPrefix),i.onUncaughtError!==void 0&&(f=i.onUncaughtError),i.onCaughtError!==void 0&&(h=i.onCaughtError),i.onRecoverableError!==void 0&&(b=i.onRecoverableError)),i=Rg(t,1,!1,null,null,a,u,null,f,h,b,Zg),t[sn]=i.current,Fc(t),new pf(i)},Vl.hydrateRoot=function(t,i,a){if(!o(t))throw Error(l(299));var u=!1,f="",h=Qp,b=Jp,E=Wp,x=null;return a!=null&&(a.unstable_strictMode===!0&&(u=!0),a.identifierPrefix!==void 0&&(f=a.identifierPrefix),a.onUncaughtError!==void 0&&(h=a.onUncaughtError),a.onCaughtError!==void 0&&(b=a.onCaughtError),a.onRecoverableError!==void 0&&(E=a.onRecoverableError),a.formState!==void 0&&(x=a.formState)),i=Rg(t,1,!0,i,a??null,u,f,x,h,b,E,Zg),i.context=Dg(null),a=i.current,u=ei(),u=fe(u),f=mr(u),f.callback=null,gr(a,f,u),a=u,i.current.lanes=a,lr(i,a),Ri(i),t[sn]=i.current,Fc(t),new vo(i)},Vl.version="19.2.8",Vl}var ey;function __(){if(ey)return yf.exports;ey=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(n){console.error(n)}}return e(),yf.exports=E_(),yf.exports}var T_=__();const Jf=40;function Wf(e=[],n=Jf){const r=Number.isInteger(n)&&n>=0?n:Jf;return r===0?[]:e.slice(-r)}function k_(e){return String(e||"").replace(/\s+/g," ").trim()}function ty(e,n=""){return String(e||"").replace(/\r\n?/g,`
|
|
10
|
-
`).trim()||String(n||"")}function ed(e){const n=String(e||"").match(/^voice-(\d+)-/);return n?Number(n[1]):Number.POSITIVE_INFINITY}function Kb(e,n){if(!n.turnId)return Wf([...e,n]);const r=e.map((s,c)=>s.turnId===n.turnId?c:-1).filter(s=>s>=0);let l;if(r.length)l=n.role==="user"?r[0]:r.at(-1)+1;else{const s=ed(n.turnId);l=Number.isFinite(s)?e.findIndex(c=>{const d=ed(c.turnId);return Number.isFinite(d)&&d>s}):-1,l<0&&(l=e.length)}const o=[...e];return o.splice(l,0,n),Wf(o)}function w_(e,n=[]){const r=new Set(e.map(o=>o.id)),l=n.flatMap(o=>{const s=String(o.id||o.messageId||""),c=String(o.content||"").trim();return!s||!c||r.has(s)?[]:[{id:s,role:o.role==="user"?"user":"assistant",content:c,turnId:o.turnId||"",taskId:o.taskId||null,taskIds:o.taskIds||[],inputs:o.inputs||[],citations:o.citations||[],source:o.source||"conversation-history",...o.source==="agent-presentation"?{origin:"announcement"}:{},createdAt:Number(o.createdAt)||0,voice:o.source==="voice-user",final:!0,live:!1}]});return Wf([...l,...e],Jf)}function A_(e,{id:n,content:r,turnId:l,final:o=!1}){const s=k_(r);if(!s)return e;const c={id:n,role:"user",content:s,turnId:l,voice:!0,final:o,live:!o},d=e.findIndex(p=>p.id===n);if(d<0)return Kb(e,c);if(e[d].final)return e;const m=[...e];return m[d]={...m[d],...c},m}function x_(e,{id:n,content:r,turnId:l,taskId:o,taskIds:s,origin:c,citations:d,final:m=!1}){const p=e.findIndex(S=>S.id===n);if(p<0)return Kb(e,{id:n,role:"assistant",content:m?ty(r):r||"",turnId:l,taskId:o,taskIds:s,origin:c,...d?.length?{citations:d}:{},live:!m});const y=[...e],g=y[p];return y[p]={...g,content:m?ty(r,g.content):g.content+(r||""),turnId:l||g.turnId,taskId:o||g.taskId,taskIds:s||g.taskIds,origin:c||g.origin,...d?.length?{citations:d}:{},live:!m},y}function O_(e,n){if(!n)return e;const r=`user:${n}`;return e.filter(l=>l.id!==r||l.final)}function C_(e,n){const r=[],l=new Map,o=(d,m=!1)=>{const p={id:d,standalone:m,messages:[],tasks:[]};return r.push(p),m||l.set(d,p),p};e.forEach(d=>{const m=d.turnId||"",p=!m,y=p?`message:${d.id}`:m;(p?o(y,!0):l.get(y)||o(y)).messages.push(d)}),n.forEach(d=>{const m=d.turnId||`task:${d.id}`;(d.turnId?l.get(m)||o(m):o(m,!0)).tasks.push(d)});const s=r.filter(d=>d.messages.length),c=r.filter(d=>!d.messages.length).sort((d,m)=>(_o(d)??Number.MAX_SAFE_INTEGER)-(_o(m)??Number.MAX_SAFE_INTEGER));for(const d of c){const m=_o(d),p=m===null?-1:s.findIndex(y=>{const g=_o(y);return g!==null&&g>m});p<0?s.push(d):s.splice(p,0,d)}return s.map(d=>{const m=new Set(d.tasks.map(y=>y.id)),p=y=>["progress","announcement"].includes(y.origin)&&[...Array.isArray(y.taskIds)?y.taskIds:[],y.taskId].some(g=>m.has(g));return{...d,beforeActivities:d.messages.filter(y=>!p(y)),afterActivities:d.messages.filter(p)}})}function _o(e){const n=[...e.messages.map(l=>Number(l.createdAt||0)),...e.tasks.map(l=>Number(l.createdAt||0))].filter(l=>l>0);if(n.length)return Math.min(...n);const r=ed(e.id);return Number.isFinite(r)?r:null}function z_(e,n){const r={};return(e[e.length-1]===""?[...e,""]:e).join((r.padRight?" ":"")+","+(r.padLeft===!1?"":" ")).trim()}const N_=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,R_=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,D_={};function ny(e,n){return(D_.jsx?R_:N_).test(e)}const M_=/[ \t\n\f\r]/g;function I_(e){return typeof e=="object"?e.type==="text"?iy(e.value):!1:iy(e)}function iy(e){return e.replace(M_,"")===""}class ou{constructor(n,r,l){this.normal=r,this.property=n,l&&(this.space=l)}}ou.prototype.normal={};ou.prototype.property={};ou.prototype.space=void 0;function Xb(e,n){const r={},l={};for(const o of e)Object.assign(r,o.property),Object.assign(l,o.normal);return new ou(r,l,n)}function td(e){return e.toLowerCase()}class Zn{constructor(n,r){this.attribute=r,this.property=n}}Zn.prototype.attribute="";Zn.prototype.booleanish=!1;Zn.prototype.boolean=!1;Zn.prototype.commaOrSpaceSeparated=!1;Zn.prototype.commaSeparated=!1;Zn.prototype.defined=!1;Zn.prototype.mustUseProperty=!1;Zn.prototype.number=!1;Zn.prototype.overloadedBoolean=!1;Zn.prototype.property="";Zn.prototype.spaceSeparated=!1;Zn.prototype.space=void 0;let L_=0;const Be=oa(),tn=oa(),nd=oa(),ce=oa(),vt=oa(),la=oa(),ti=oa();function oa(){return 2**++L_}const id=Object.freeze(Object.defineProperty({__proto__:null,boolean:Be,booleanish:tn,commaOrSpaceSeparated:ti,commaSeparated:la,number:ce,overloadedBoolean:nd,spaceSeparated:vt},Symbol.toStringTag,{value:"Module"})),Ef=Object.keys(id);class kd extends Zn{constructor(n,r,l,o){let s=-1;if(super(n,r),ry(this,"space",o),typeof l=="number")for(;++s<Ef.length;){const c=Ef[s];ry(this,Ef[s],(l&id[c])===id[c])}}}kd.prototype.defined=!0;function ry(e,n,r){r&&(e[n]=r)}function el(e){const n={},r={};for(const[l,o]of Object.entries(e.properties)){const s=new kd(l,e.transform(e.attributes||{},l),o,e.space);e.mustUseProperty&&e.mustUseProperty.includes(l)&&(s.mustUseProperty=!0),n[l]=s,r[td(l)]=l,r[td(s.attribute)]=l}return new ou(n,r,e.space)}const Qb=el({properties:{ariaActiveDescendant:null,ariaAtomic:tn,ariaAutoComplete:null,ariaBusy:tn,ariaChecked:tn,ariaColCount:ce,ariaColIndex:ce,ariaColSpan:ce,ariaControls:vt,ariaCurrent:null,ariaDescribedBy:vt,ariaDetails:null,ariaDisabled:tn,ariaDropEffect:vt,ariaErrorMessage:null,ariaExpanded:tn,ariaFlowTo:vt,ariaGrabbed:tn,ariaHasPopup:null,ariaHidden:tn,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:vt,ariaLevel:ce,ariaLive:null,ariaModal:tn,ariaMultiLine:tn,ariaMultiSelectable:tn,ariaOrientation:null,ariaOwns:vt,ariaPlaceholder:null,ariaPosInSet:ce,ariaPressed:tn,ariaReadOnly:tn,ariaRelevant:null,ariaRequired:tn,ariaRoleDescription:vt,ariaRowCount:ce,ariaRowIndex:ce,ariaRowSpan:ce,ariaSelected:tn,ariaSetSize:ce,ariaSort:null,ariaValueMax:ce,ariaValueMin:ce,ariaValueNow:ce,ariaValueText:null,role:null},transform(e,n){return n==="role"?n:"aria-"+n.slice(4).toLowerCase()}});function Jb(e,n){return n in e?e[n]:n}function Wb(e,n){return Jb(e,n.toLowerCase())}const U_=el({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:la,acceptCharset:vt,accessKey:vt,action:null,allow:null,allowFullScreen:Be,allowPaymentRequest:Be,allowUserMedia:Be,alpha:Be,alt:null,as:null,async:Be,autoCapitalize:null,autoComplete:vt,autoFocus:Be,autoPlay:Be,blocking:vt,capture:null,charSet:null,checked:Be,cite:null,className:vt,closedBy:null,colorSpace:null,cols:ce,colSpan:ce,command:null,commandFor:null,content:null,contentEditable:tn,controls:Be,controlsList:vt,coords:ce|la,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Be,defer:Be,dir:null,dirName:null,disabled:Be,download:nd,draggable:tn,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Be,formTarget:null,headers:vt,height:ce,hidden:nd,high:ce,href:null,hrefLang:null,htmlFor:vt,httpEquiv:vt,id:null,imageSizes:null,imageSrcSet:null,inert:Be,inputMode:null,integrity:null,is:null,isMap:Be,itemId:null,itemProp:vt,itemRef:vt,itemScope:Be,itemType:vt,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Be,low:ce,manifest:null,max:null,maxLength:ce,media:null,method:null,min:null,minLength:ce,multiple:Be,muted:Be,name:null,nonce:null,noModule:Be,noValidate:Be,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:Be,optimum:ce,pattern:null,ping:vt,placeholder:null,playsInline:Be,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Be,referrerPolicy:null,rel:vt,required:Be,reversed:Be,rows:ce,rowSpan:ce,sandbox:vt,scope:null,scoped:Be,seamless:Be,selected:Be,shadowRootClonable:Be,shadowRootCustomElementRegistry:Be,shadowRootDelegatesFocus:Be,shadowRootMode:null,shadowRootSerializable:Be,shape:null,size:ce,sizes:null,slot:null,span:ce,spellCheck:tn,src:null,srcDoc:null,srcLang:null,srcSet:null,start:ce,step:null,style:null,tabIndex:ce,target:null,title:null,translate:null,type:null,typeMustMatch:Be,useMap:null,value:tn,width:ce,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:vt,axis:null,background:null,bgColor:null,border:ce,borderColor:null,bottomMargin:ce,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:Be,declare:Be,event:null,face:null,frame:null,frameBorder:null,hSpace:ce,leftMargin:ce,link:null,longDesc:null,lowSrc:null,marginHeight:ce,marginWidth:ce,noResize:Be,noHref:Be,noShade:Be,noWrap:Be,object:null,profile:null,prompt:null,rev:null,rightMargin:ce,rules:null,scheme:null,scrolling:tn,standby:null,summary:null,text:null,topMargin:ce,valueType:null,version:null,vAlign:null,vLink:null,vSpace:ce,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:Be,disablePictureInPicture:Be,disableRemotePlayback:Be,exportParts:la,part:vt,prefix:null,property:null,results:ce,security:null,unselectable:null},space:"html",transform:Wb}),j_=el({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",maskType:"mask-type",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:ti,accentHeight:ce,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:ce,amplitude:ce,arabicForm:null,ascent:ce,attributeName:null,attributeType:null,azimuth:ce,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:ce,by:null,calcMode:null,capHeight:ce,className:vt,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:ce,diffuseConstant:ce,direction:null,display:null,dur:null,divisor:ce,dominantBaseline:null,download:Be,dx:null,dy:null,edgeMode:null,editable:null,elevation:ce,enableBackground:null,end:null,event:null,exponent:ce,externalResourcesRequired:null,fill:null,fillOpacity:ce,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:la,g2:la,glyphName:la,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:ce,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:ce,horizOriginX:ce,horizOriginY:ce,id:null,ideographic:ce,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:ce,k:ce,k1:ce,k2:ce,k3:ce,k4:ce,kernelMatrix:ti,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:ce,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskType:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:ce,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:ce,overlineThickness:ce,paintOrder:null,panose1:null,path:null,pathLength:ce,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:vt,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:ce,pointsAtY:ce,pointsAtZ:ce,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:ti,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:ti,rev:ti,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:ti,requiredFeatures:ti,requiredFonts:ti,requiredFormats:ti,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:ce,specularExponent:ce,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:ce,strikethroughThickness:ce,string:null,stroke:null,strokeDashArray:ti,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:ce,strokeOpacity:ce,strokeWidth:null,style:null,surfaceScale:ce,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:ti,tabIndex:ce,tableValues:null,target:null,targetX:ce,targetY:ce,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:ti,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:ce,underlineThickness:ce,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:ce,values:null,vAlphabetic:ce,vMathematical:ce,vectorEffect:null,vHanging:ce,vIdeographic:ce,version:null,vertAdvY:ce,vertOriginX:ce,vertOriginY:ce,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:ce,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:Jb}),eS=el({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,n){return"xlink:"+n.slice(5).toLowerCase()}}),tS=el({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:Wb}),nS=el({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,n){return"xml:"+n.slice(3).toLowerCase()}}),B_={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"},q_=/[A-Z]/g,ay=/-[a-z]/g,H_=/^data[-\w.:]+$/i;function P_(e,n){const r=td(n);let l=n,o=Zn;if(r in e.normal)return e.property[e.normal[r]];if(r.length>4&&r.slice(0,4)==="data"&&H_.test(n)){if(n.charAt(4)==="-"){const s=n.slice(5).replace(ay,G_);l="data"+s.charAt(0).toUpperCase()+s.slice(1)}else{const s=n.slice(4);if(!ay.test(s)){let c=s.replace(q_,Z_);c.charAt(0)!=="-"&&(c="-"+c),n="data"+c}}o=kd}return new o(l,n)}function Z_(e){return"-"+e.toLowerCase()}function G_(e){return e.charAt(1).toUpperCase()}const V_=Xb([Qb,U_,eS,tS,nS],"html"),wd=Xb([Qb,j_,eS,tS,nS],"svg");function $_(e){return e.join(" ").trim()}var Ga={},_f,ly;function Y_(){if(ly)return _f;ly=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,n=/\n/g,r=/^\s*/,l=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,o=/^:\s*/,s=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,c=/^[;\s]*/,d=/^\s+|\s+$/g,m=`
|
|
11
|
-
`,p="/",y="*",g="",S="comment",v="declaration";function _(M,A){if(typeof M!="string")throw new TypeError("First argument must be a string");if(!M)return[];A=A||{};var V=1,j=1;function ae(Se){var oe=Se.match(n);oe&&(V+=oe.length);var H=Se.lastIndexOf(m);j=~H?Se.length-H:j+Se.length}function ue(){var Se={line:V,column:j};return function(oe){return oe.position=new D(Se),de(),oe}}function D(Se){this.start=Se,this.end={line:V,column:j},this.source=A.source}D.prototype.content=M;function $(Se){var oe=new Error(A.source+":"+V+":"+j+": "+Se);if(oe.reason=Se,oe.filename=A.source,oe.line=V,oe.column=j,oe.source=M,!A.silent)throw oe}function re(Se){var oe=Se.exec(M);if(oe){var H=oe[0];return ae(H),M=M.slice(H.length),oe}}function de(){re(r)}function U(Se){var oe;for(Se=Se||[];oe=te();)oe!==!1&&Se.push(oe);return Se}function te(){var Se=ue();if(!(p!=M.charAt(0)||y!=M.charAt(1))){for(var oe=2;g!=M.charAt(oe)&&(y!=M.charAt(oe)||p!=M.charAt(oe+1));)++oe;if(oe+=2,g===M.charAt(oe-1))return $("End of comment missing");var H=M.slice(2,oe-2);return j+=2,ae(H),M=M.slice(oe),j+=2,Se({type:S,comment:H})}}function ne(){var Se=ue(),oe=re(l);if(oe){if(te(),!re(o))return $("property missing ':'");var H=re(s),le=Se({type:v,property:N(oe[0].replace(e,g)),value:H?N(H[0].replace(e,g)):g});return re(c),le}}function Ae(){var Se=[];U(Se);for(var oe;oe=ne();)oe!==!1&&(Se.push(oe),U(Se));return Se}return de(),Ae()}function N(M){return M?M.replace(d,g):g}return _f=_,_f}var uy;function F_(){if(uy)return Ga;uy=1;var e=Ga&&Ga.__importDefault||function(l){return l&&l.__esModule?l:{default:l}};Object.defineProperty(Ga,"__esModule",{value:!0}),Ga.default=r;const n=e(Y_());function r(l,o){let s=null;if(!l||typeof l!="string")return s;const c=(0,n.default)(l),d=typeof o=="function";return c.forEach(m=>{if(m.type!=="declaration")return;const{property:p,value:y}=m;d?o(p,y,m):y&&(s=s||{},s[p]=y)}),s}return Ga}var $l={},oy;function K_(){if(oy)return $l;oy=1,Object.defineProperty($l,"__esModule",{value:!0}),$l.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,n=/-([a-z])/g,r=/^[^-]+$/,l=/^-(webkit|moz|ms|o|khtml)-/,o=/^-(ms)-/,s=function(p){return!p||r.test(p)||e.test(p)},c=function(p,y){return y.toUpperCase()},d=function(p,y){return"".concat(y,"-")},m=function(p,y){return y===void 0&&(y={}),s(p)?p:(p=p.toLowerCase(),y.reactCompat?p=p.replace(o,d):p=p.replace(l,d),p.replace(n,c))};return $l.camelCase=m,$l}var Yl,sy;function X_(){if(sy)return Yl;sy=1;var e=Yl&&Yl.__importDefault||function(o){return o&&o.__esModule?o:{default:o}},n=e(F_()),r=K_();function l(o,s){var c={};return!o||typeof o!="string"||(0,n.default)(o,function(d,m){d&&m&&(c[(0,r.camelCase)(d,s)]=m)}),c}return l.default=l,Yl=l,Yl}var Q_=X_();const J_=Yb(Q_),iS=rS("end"),Ad=rS("start");function rS(e){return n;function n(r){const l=r&&r.position&&r.position[e]||{};if(typeof l.line=="number"&&l.line>0&&typeof l.column=="number"&&l.column>0)return{line:l.line,column:l.column,offset:typeof l.offset=="number"&&l.offset>-1?l.offset:void 0}}}function W_(e){const n=Ad(e),r=iS(e);if(n&&r)return{start:n,end:r}}function Wl(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?cy(e.position):"start"in e||"end"in e?cy(e):"line"in e||"column"in e?rd(e):""}function rd(e){return fy(e&&e.line)+":"+fy(e&&e.column)}function cy(e){return rd(e&&e.start)+"-"+rd(e&&e.end)}function fy(e){return e&&typeof e=="number"?e:1}class An extends Error{constructor(n,r,l){super(),typeof r=="string"&&(l=r,r=void 0);let o="",s={},c=!1;if(r&&("line"in r&&"column"in r?s={place:r}:"start"in r&&"end"in r?s={place:r}:"type"in r?s={ancestors:[r],place:r.position}:s={...r}),typeof n=="string"?o=n:!s.cause&&n&&(c=!0,o=n.message,s.cause=n),!s.ruleId&&!s.source&&typeof l=="string"){const m=l.indexOf(":");m===-1?s.ruleId=l:(s.source=l.slice(0,m),s.ruleId=l.slice(m+1))}if(!s.place&&s.ancestors&&s.ancestors){const m=s.ancestors[s.ancestors.length-1];m&&(s.place=m.position)}const d=s.place&&"start"in s.place?s.place.start:s.place;this.ancestors=s.ancestors||void 0,this.cause=s.cause||void 0,this.column=d?d.column:void 0,this.fatal=void 0,this.file="",this.message=o,this.line=d?d.line:void 0,this.name=Wl(s.place)||"1:1",this.place=s.place||void 0,this.reason=this.message,this.ruleId=s.ruleId||void 0,this.source=s.source||void 0,this.stack=c&&s.cause&&typeof s.cause.stack=="string"?s.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}An.prototype.file="";An.prototype.name="";An.prototype.reason="";An.prototype.message="";An.prototype.stack="";An.prototype.column=void 0;An.prototype.line=void 0;An.prototype.ancestors=void 0;An.prototype.cause=void 0;An.prototype.fatal=void 0;An.prototype.place=void 0;An.prototype.ruleId=void 0;An.prototype.source=void 0;const xd={}.hasOwnProperty,e1=new Map,t1=/[A-Z]/g,n1=new Set(["table","tbody","thead","tfoot","tr"]),i1=new Set(["td","th"]),aS="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function r1(e,n){if(!n||n.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const r=n.filePath||void 0;let l;if(n.development){if(typeof n.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");l=d1(r,n.jsxDEV)}else{if(typeof n.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof n.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");l=f1(r,n.jsx,n.jsxs)}const o={Fragment:n.Fragment,ancestors:[],components:n.components||{},create:l,elementAttributeNameCase:n.elementAttributeNameCase||"react",evaluater:n.createEvaluater?n.createEvaluater():void 0,filePath:r,ignoreInvalidStyle:n.ignoreInvalidStyle||!1,passKeys:n.passKeys!==!1,passNode:n.passNode||!1,schema:n.space==="svg"?wd:V_,stylePropertyNameCase:n.stylePropertyNameCase||"dom",tableCellAlignToStyle:n.tableCellAlignToStyle!==!1},s=lS(o,e,void 0);return s&&typeof s!="string"?s:o.create(e,o.Fragment,{children:s||void 0},void 0)}function lS(e,n,r){if(n.type==="element")return a1(e,n,r);if(n.type==="mdxFlowExpression"||n.type==="mdxTextExpression")return l1(e,n);if(n.type==="mdxJsxFlowElement"||n.type==="mdxJsxTextElement")return o1(e,n,r);if(n.type==="mdxjsEsm")return u1(e,n);if(n.type==="root")return s1(e,n,r);if(n.type==="text")return c1(e,n)}function a1(e,n,r){const l=e.schema;let o=l;n.tagName.toLowerCase()==="svg"&&l.space==="html"&&(o=wd,e.schema=o),e.ancestors.push(n);const s=oS(e,n.tagName,!1),c=h1(e,n);let d=Cd(e,n);return n1.has(n.tagName)&&(d=d.filter(function(m){return typeof m=="string"?!I_(m):!0})),uS(e,c,s,n),Od(c,d),e.ancestors.pop(),e.schema=l,e.create(n,s,c,r)}function l1(e,n){if(n.data&&n.data.estree&&e.evaluater){const l=n.data.estree.body[0];return l.type,e.evaluater.evaluateExpression(l.expression)}iu(e,n.position)}function u1(e,n){if(n.data&&n.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(n.data.estree);iu(e,n.position)}function o1(e,n,r){const l=e.schema;let o=l;n.name==="svg"&&l.space==="html"&&(o=wd,e.schema=o),e.ancestors.push(n);const s=n.name===null?e.Fragment:oS(e,n.name,!0),c=p1(e,n),d=Cd(e,n);return uS(e,c,s,n),Od(c,d),e.ancestors.pop(),e.schema=l,e.create(n,s,c,r)}function s1(e,n,r){const l={};return Od(l,Cd(e,n)),e.create(n,e.Fragment,l,r)}function c1(e,n){return n.value}function uS(e,n,r,l){typeof r!="string"&&r!==e.Fragment&&e.passNode&&(n.node=l)}function Od(e,n){if(n.length>0){const r=n.length>1?n:n[0];r&&(e.children=r)}}function f1(e,n,r){return l;function l(o,s,c,d){const p=Array.isArray(c.children)?r:n;return d?p(s,c,d):p(s,c)}}function d1(e,n){return r;function r(l,o,s,c){const d=Array.isArray(s.children),m=Ad(l);return n(o,s,c,d,{columnNumber:m?m.column-1:void 0,fileName:e,lineNumber:m?m.line:void 0},void 0)}}function h1(e,n){const r={};let l,o;for(o in n.properties)if(o!=="children"&&xd.call(n.properties,o)){const s=m1(e,o,n.properties[o]);if(s){const[c,d]=s;e.tableCellAlignToStyle&&c==="align"&&typeof d=="string"&&i1.has(n.tagName)?l=d:r[c]=d}}if(l){const s=r.style||(r.style={});s[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=l}return r}function p1(e,n){const r={};for(const l of n.attributes)if(l.type==="mdxJsxExpressionAttribute")if(l.data&&l.data.estree&&e.evaluater){const s=l.data.estree.body[0];s.type;const c=s.expression;c.type;const d=c.properties[0];d.type,Object.assign(r,e.evaluater.evaluateExpression(d.argument))}else iu(e,n.position);else{const o=l.name;let s;if(l.value&&typeof l.value=="object")if(l.value.data&&l.value.data.estree&&e.evaluater){const d=l.value.data.estree.body[0];d.type,s=e.evaluater.evaluateExpression(d.expression)}else iu(e,n.position);else s=l.value===null?!0:l.value;r[o]=s}return r}function Cd(e,n){const r=[];let l=-1;const o=e.passKeys?new Map:e1;for(;++l<n.children.length;){const s=n.children[l];let c;if(e.passKeys){const m=s.type==="element"?s.tagName:s.type==="mdxJsxFlowElement"||s.type==="mdxJsxTextElement"?s.name:void 0;if(m){const p=o.get(m)||0;c=m+"-"+p,o.set(m,p+1)}}const d=lS(e,s,c);d!==void 0&&r.push(d)}return r}function m1(e,n,r){const l=P_(e.schema,n);if(!(r==null||typeof r=="number"&&Number.isNaN(r))){if(Array.isArray(r)&&(r=l.commaSeparated?z_(r):$_(r)),l.property==="style"){let o=typeof r=="object"?r:g1(e,String(r));return e.stylePropertyNameCase==="css"&&(o=y1(o)),["style",o]}return[e.elementAttributeNameCase==="react"&&l.space?B_[l.property]||l.property:l.attribute,r]}}function g1(e,n){try{return J_(n,{reactCompat:!0})}catch(r){if(e.ignoreInvalidStyle)return{};const l=r,o=new An("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:l,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw o.file=e.filePath||void 0,o.url=aS+"#cannot-parse-style-attribute",o}}function oS(e,n,r){let l;if(!r)l={type:"Literal",value:n};else if(n.includes(".")){const o=n.split(".");let s=-1,c;for(;++s<o.length;){const d=ny(o[s])?{type:"Identifier",name:o[s]}:{type:"Literal",value:o[s]};c=c?{type:"MemberExpression",object:c,property:d,computed:!!(s&&d.type==="Literal"),optional:!1}:d}l=c}else l=ny(n)&&!/^[a-z]/.test(n)?{type:"Identifier",name:n}:{type:"Literal",value:n};if(l.type==="Literal"){const o=l.value;return xd.call(e.components,o)?e.components[o]:o}if(e.evaluater)return e.evaluater.evaluateExpression(l);iu(e)}function iu(e,n){const r=new An("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:n,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw r.file=e.filePath||void 0,r.url=aS+"#cannot-handle-mdx-estrees-without-createevaluater",r}function y1(e){const n={};let r;for(r in e)xd.call(e,r)&&(n[b1(r)]=e[r]);return n}function b1(e){let n=e.replace(t1,S1);return n.slice(0,3)==="ms-"&&(n="-"+n),n}function S1(e){return"-"+e.toLowerCase()}const Tf={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"]},v1={};function zd(e,n){const r=v1,l=typeof r.includeImageAlt=="boolean"?r.includeImageAlt:!0,o=typeof r.includeHtml=="boolean"?r.includeHtml:!0;return sS(e,l,o)}function sS(e,n,r){if(E1(e)){if("value"in e)return e.type==="html"&&!r?"":e.value;if(n&&"alt"in e&&e.alt)return e.alt;if("children"in e)return dy(e.children,n,r)}return Array.isArray(e)?dy(e,n,r):""}function dy(e,n,r){const l=[];let o=-1;for(;++o<e.length;)l[o]=sS(e[o],n,r);return l.join("")}function E1(e){return!!(e&&typeof e=="object")}const hy=document.createElement("i");function Nd(e){const n="&"+e+";";hy.innerHTML=n;const r=hy.textContent;return r.charCodeAt(r.length-1)===59&&e!=="semi"||r===n?!1:r}function ni(e,n,r,l){const o=e.length;let s=0,c;if(n<0?n=-n>o?0:o+n:n=n>o?o:n,r=r>0?r:0,l.length<1e4)c=Array.from(l),c.unshift(n,r),e.splice(...c);else for(r&&e.splice(n,r);s<l.length;)c=l.slice(s,s+1e4),c.unshift(n,0),e.splice(...c),s+=1e4,n+=1e4}function mi(e,n){return e.length>0?(ni(e,e.length,0,n),e):n}const py={}.hasOwnProperty;function cS(e){const n={};let r=-1;for(;++r<e.length;)_1(n,e[r]);return n}function _1(e,n){let r;for(r in n){const o=(py.call(e,r)?e[r]:void 0)||(e[r]={}),s=n[r];let c;if(s)for(c in s){py.call(o,c)||(o[c]=[]);const d=s[c];T1(o[c],Array.isArray(d)?d:d?[d]:[])}}}function T1(e,n){let r=-1;const l=[];for(;++r<n.length;)(n[r].add==="after"?e:l).push(n[r]);ni(e,0,0,l)}function fS(e,n){const r=Number.parseInt(e,n);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 ki(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const Nn=Ur(/[A-Za-z]/),kn=Ur(/[\dA-Za-z]/),k1=Ur(/[#-'*+\--9=?A-Z^-~]/);function jo(e){return e!==null&&(e<32||e===127)}const ad=Ur(/\d/),w1=Ur(/[\dA-Fa-f]/),A1=Ur(/[!-/:-@[-`{-~]/);function Re(e){return e!==null&&e<-2}function _t(e){return e!==null&&(e<0||e===32)}function Je(e){return e===-2||e===-1||e===32}const Xo=Ur(new RegExp("\\p{P}|\\p{S}","u")),ua=Ur(/\s/);function Ur(e){return n;function n(r){return r!==null&&r>-1&&e.test(String.fromCharCode(r))}}function tl(e){const n=[];let r=-1,l=0,o=0;for(;++r<e.length;){const s=e.charCodeAt(r);let c="";if(s===37&&kn(e.charCodeAt(r+1))&&kn(e.charCodeAt(r+2)))o=2;else if(s<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(s))||(c=String.fromCharCode(s));else if(s>55295&&s<57344){const d=e.charCodeAt(r+1);s<56320&&d>56319&&d<57344?(c=String.fromCharCode(s,d),o=1):c="�"}else c=String.fromCharCode(s);c&&(n.push(e.slice(l,r),encodeURIComponent(c)),l=r+o+1,c=""),o&&(r+=o,o=0)}return n.join("")+e.slice(l)}function nt(e,n,r,l){const o=l?l-1:Number.POSITIVE_INFINITY;let s=0;return c;function c(m){return Je(m)?(e.enter(r),d(m)):n(m)}function d(m){return Je(m)&&s++<o?(e.consume(m),d):(e.exit(r),n(m))}}const x1={tokenize:O1};function O1(e){const n=e.attempt(this.parser.constructs.contentInitial,l,o);let r;return n;function l(d){if(d===null){e.consume(d);return}return e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),nt(e,n,"linePrefix")}function o(d){return e.enter("paragraph"),s(d)}function s(d){const m=e.enter("chunkText",{contentType:"text",previous:r});return r&&(r.next=m),r=m,c(d)}function c(d){if(d===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(d);return}return Re(d)?(e.consume(d),e.exit("chunkText"),s):(e.consume(d),c)}}const C1={tokenize:z1},my={tokenize:N1};function z1(e){const n=this,r=[];let l=0,o,s,c;return d;function d(j){if(l<r.length){const ae=r[l];return n.containerState=ae[1],e.attempt(ae[0].continuation,m,p)(j)}return p(j)}function m(j){if(l++,n.containerState._closeFlow){n.containerState._closeFlow=void 0,o&&V();const ae=n.events.length;let ue=ae,D;for(;ue--;)if(n.events[ue][0]==="exit"&&n.events[ue][1].type==="chunkFlow"){D=n.events[ue][1].end;break}A(l);let $=ae;for(;$<n.events.length;)n.events[$][1].end={...D},$++;return ni(n.events,ue+1,0,n.events.slice(ae)),n.events.length=$,p(j)}return d(j)}function p(j){if(l===r.length){if(!o)return S(j);if(o.currentConstruct&&o.currentConstruct.concrete)return _(j);n.interrupt=!!(o.currentConstruct&&!o._gfmTableDynamicInterruptHack)}return n.containerState={},e.check(my,y,g)(j)}function y(j){return o&&V(),A(l),S(j)}function g(j){return n.parser.lazy[n.now().line]=l!==r.length,c=n.now().offset,_(j)}function S(j){return n.containerState={},e.attempt(my,v,_)(j)}function v(j){return l++,r.push([n.currentConstruct,n.containerState]),S(j)}function _(j){if(j===null){o&&V(),A(0),e.consume(j);return}return o=o||n.parser.flow(n.now()),e.enter("chunkFlow",{_tokenizer:o,contentType:"flow",previous:s}),N(j)}function N(j){if(j===null){M(e.exit("chunkFlow"),!0),A(0),e.consume(j);return}return Re(j)?(e.consume(j),M(e.exit("chunkFlow")),l=0,n.interrupt=void 0,d):(e.consume(j),N)}function M(j,ae){const ue=n.sliceStream(j);if(ae&&ue.push(null),j.previous=s,s&&(s.next=j),s=j,o.defineSkip(j.start),o.write(ue),n.parser.lazy[j.start.line]){let D=o.events.length;for(;D--;)if(o.events[D][1].start.offset<c&&(!o.events[D][1].end||o.events[D][1].end.offset>c))return;const $=n.events.length;let re=$,de,U;for(;re--;)if(n.events[re][0]==="exit"&&n.events[re][1].type==="chunkFlow"){if(de){U=n.events[re][1].end;break}de=!0}for(A(l),D=$;D<n.events.length;)n.events[D][1].end={...U},D++;ni(n.events,re+1,0,n.events.slice($)),n.events.length=D}}function A(j){let ae=r.length;for(;ae-- >j;){const ue=r[ae];n.containerState=ue[1],ue[0].exit.call(n,e)}r.length=j}function V(){o.write([null]),s=void 0,o=void 0,n.containerState._closeFlow=void 0}}function N1(e,n,r){return nt(e,e.attempt(this.parser.constructs.document,n,r),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Xa(e){if(e===null||_t(e)||ua(e))return 1;if(Xo(e))return 2}function Qo(e,n,r){const l=[];let o=-1;for(;++o<e.length;){const s=e[o].resolveAll;s&&!l.includes(s)&&(n=s(n,r),l.push(s))}return n}const ld={name:"attention",resolveAll:R1,tokenize:D1};function R1(e,n){let r=-1,l,o,s,c,d,m,p,y;for(;++r<e.length;)if(e[r][0]==="enter"&&e[r][1].type==="attentionSequence"&&e[r][1]._close){for(l=r;l--;)if(e[l][0]==="exit"&&e[l][1].type==="attentionSequence"&&e[l][1]._open&&n.sliceSerialize(e[l][1]).charCodeAt(0)===n.sliceSerialize(e[r][1]).charCodeAt(0)){if((e[l][1]._close||e[r][1]._open)&&(e[r][1].end.offset-e[r][1].start.offset)%3&&!((e[l][1].end.offset-e[l][1].start.offset+e[r][1].end.offset-e[r][1].start.offset)%3))continue;m=e[l][1].end.offset-e[l][1].start.offset>1&&e[r][1].end.offset-e[r][1].start.offset>1?2:1;const g={...e[l][1].end},S={...e[r][1].start};gy(g,-m),gy(S,m),c={type:m>1?"strongSequence":"emphasisSequence",start:g,end:{...e[l][1].end}},d={type:m>1?"strongSequence":"emphasisSequence",start:{...e[r][1].start},end:S},s={type:m>1?"strongText":"emphasisText",start:{...e[l][1].end},end:{...e[r][1].start}},o={type:m>1?"strong":"emphasis",start:{...c.start},end:{...d.end}},e[l][1].end={...c.start},e[r][1].start={...d.end},p=[],e[l][1].end.offset-e[l][1].start.offset&&(p=mi(p,[["enter",e[l][1],n],["exit",e[l][1],n]])),p=mi(p,[["enter",o,n],["enter",c,n],["exit",c,n],["enter",s,n]]),p=mi(p,Qo(n.parser.constructs.insideSpan.null,e.slice(l+1,r),n)),p=mi(p,[["exit",s,n],["enter",d,n],["exit",d,n],["exit",o,n]]),e[r][1].end.offset-e[r][1].start.offset?(y=2,p=mi(p,[["enter",e[r][1],n],["exit",e[r][1],n]])):y=0,ni(e,l-1,r-l+3,p),r=l+p.length-y-2;break}}for(r=-1;++r<e.length;)e[r][1].type==="attentionSequence"&&(e[r][1].type="data");return e}function D1(e,n){const r=this.parser.constructs.attentionMarkers.null,l=this.previous,o=Xa(l);let s;return c;function c(m){return s=m,e.enter("attentionSequence"),d(m)}function d(m){if(m===s)return e.consume(m),d;const p=e.exit("attentionSequence"),y=Xa(m),g=!y||y===2&&o||r.includes(m),S=!o||o===2&&y||r.includes(l);return p._open=!!(s===42?g:g&&(o||!S)),p._close=!!(s===42?S:S&&(y||!g)),n(m)}}function gy(e,n){e.column+=n,e.offset+=n,e._bufferIndex+=n}const M1={name:"autolink",tokenize:I1};function I1(e,n,r){let l=0;return o;function o(v){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(v),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),s}function s(v){return Nn(v)?(e.consume(v),c):v===64?r(v):p(v)}function c(v){return v===43||v===45||v===46||kn(v)?(l=1,d(v)):p(v)}function d(v){return v===58?(e.consume(v),l=0,m):(v===43||v===45||v===46||kn(v))&&l++<32?(e.consume(v),d):(l=0,p(v))}function m(v){return v===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(v),e.exit("autolinkMarker"),e.exit("autolink"),n):v===null||v===32||v===60||jo(v)?r(v):(e.consume(v),m)}function p(v){return v===64?(e.consume(v),y):k1(v)?(e.consume(v),p):r(v)}function y(v){return kn(v)?g(v):r(v)}function g(v){return v===46?(e.consume(v),l=0,y):v===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(v),e.exit("autolinkMarker"),e.exit("autolink"),n):S(v)}function S(v){if((v===45||kn(v))&&l++<63){const _=v===45?S:g;return e.consume(v),_}return r(v)}}const su={partial:!0,tokenize:L1};function L1(e,n,r){return l;function l(s){return Je(s)?nt(e,o,"linePrefix")(s):o(s)}function o(s){return s===null||Re(s)?n(s):r(s)}}const dS={continuation:{tokenize:j1},exit:B1,name:"blockQuote",tokenize:U1};function U1(e,n,r){const l=this;return o;function o(c){if(c===62){const d=l.containerState;return d.open||(e.enter("blockQuote",{_container:!0}),d.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(c),e.exit("blockQuoteMarker"),s}return r(c)}function s(c){return Je(c)?(e.enter("blockQuotePrefixWhitespace"),e.consume(c),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),n):(e.exit("blockQuotePrefix"),n(c))}}function j1(e,n,r){const l=this;return o;function o(c){return Je(c)?nt(e,s,"linePrefix",l.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(c):s(c)}function s(c){return e.attempt(dS,n,r)(c)}}function B1(e){e.exit("blockQuote")}const hS={name:"characterEscape",tokenize:q1};function q1(e,n,r){return l;function l(s){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(s),e.exit("escapeMarker"),o}function o(s){return A1(s)?(e.enter("characterEscapeValue"),e.consume(s),e.exit("characterEscapeValue"),e.exit("characterEscape"),n):r(s)}}const pS={name:"characterReference",tokenize:H1};function H1(e,n,r){const l=this;let o=0,s,c;return d;function d(g){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(g),e.exit("characterReferenceMarker"),m}function m(g){return g===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(g),e.exit("characterReferenceMarkerNumeric"),p):(e.enter("characterReferenceValue"),s=31,c=kn,y(g))}function p(g){return g===88||g===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(g),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),s=6,c=w1,y):(e.enter("characterReferenceValue"),s=7,c=ad,y(g))}function y(g){if(g===59&&o){const S=e.exit("characterReferenceValue");return c===kn&&!Nd(l.sliceSerialize(S))?r(g):(e.enter("characterReferenceMarker"),e.consume(g),e.exit("characterReferenceMarker"),e.exit("characterReference"),n)}return c(g)&&o++<s?(e.consume(g),y):r(g)}}const yy={partial:!0,tokenize:Z1},by={concrete:!0,name:"codeFenced",tokenize:P1};function P1(e,n,r){const l=this,o={partial:!0,tokenize:ue};let s=0,c=0,d;return m;function m(D){return p(D)}function p(D){const $=l.events[l.events.length-1];return s=$&&$[1].type==="linePrefix"?$[2].sliceSerialize($[1],!0).length:0,d=D,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),y(D)}function y(D){return D===d?(c++,e.consume(D),y):c<3?r(D):(e.exit("codeFencedFenceSequence"),Je(D)?nt(e,g,"whitespace")(D):g(D))}function g(D){return D===null||Re(D)?(e.exit("codeFencedFence"),l.interrupt?n(D):e.check(yy,N,ae)(D)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),S(D))}function S(D){return D===null||Re(D)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),g(D)):Je(D)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),nt(e,v,"whitespace")(D)):D===96&&D===d?r(D):(e.consume(D),S)}function v(D){return D===null||Re(D)?g(D):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),_(D))}function _(D){return D===null||Re(D)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),g(D)):D===96&&D===d?r(D):(e.consume(D),_)}function N(D){return e.attempt(o,ae,M)(D)}function M(D){return e.enter("lineEnding"),e.consume(D),e.exit("lineEnding"),A}function A(D){return s>0&&Je(D)?nt(e,V,"linePrefix",s+1)(D):V(D)}function V(D){return D===null||Re(D)?e.check(yy,N,ae)(D):(e.enter("codeFlowValue"),j(D))}function j(D){return D===null||Re(D)?(e.exit("codeFlowValue"),V(D)):(e.consume(D),j)}function ae(D){return e.exit("codeFenced"),n(D)}function ue(D,$,re){let de=0;return U;function U(oe){return D.enter("lineEnding"),D.consume(oe),D.exit("lineEnding"),te}function te(oe){return D.enter("codeFencedFence"),Je(oe)?nt(D,ne,"linePrefix",l.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(oe):ne(oe)}function ne(oe){return oe===d?(D.enter("codeFencedFenceSequence"),Ae(oe)):re(oe)}function Ae(oe){return oe===d?(de++,D.consume(oe),Ae):de>=c?(D.exit("codeFencedFenceSequence"),Je(oe)?nt(D,Se,"whitespace")(oe):Se(oe)):re(oe)}function Se(oe){return oe===null||Re(oe)?(D.exit("codeFencedFence"),$(oe)):re(oe)}}}function Z1(e,n,r){const l=this;return o;function o(c){return c===null?r(c):(e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),s)}function s(c){return l.parser.lazy[l.now().line]?r(c):n(c)}}const kf={name:"codeIndented",tokenize:V1},G1={partial:!0,tokenize:$1};function V1(e,n,r){const l=this;return o;function o(p){return e.enter("codeIndented"),nt(e,s,"linePrefix",5)(p)}function s(p){const y=l.events[l.events.length-1];return y&&y[1].type==="linePrefix"&&y[2].sliceSerialize(y[1],!0).length>=4?c(p):r(p)}function c(p){return p===null?m(p):Re(p)?e.attempt(G1,c,m)(p):(e.enter("codeFlowValue"),d(p))}function d(p){return p===null||Re(p)?(e.exit("codeFlowValue"),c(p)):(e.consume(p),d)}function m(p){return e.exit("codeIndented"),n(p)}}function $1(e,n,r){const l=this;return o;function o(c){return l.parser.lazy[l.now().line]?r(c):Re(c)?(e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),o):nt(e,s,"linePrefix",5)(c)}function s(c){const d=l.events[l.events.length-1];return d&&d[1].type==="linePrefix"&&d[2].sliceSerialize(d[1],!0).length>=4?n(c):Re(c)?o(c):r(c)}}const Y1={name:"codeText",previous:K1,resolve:F1,tokenize:X1};function F1(e){let n=e.length-4,r=3,l,o;if((e[r][1].type==="lineEnding"||e[r][1].type==="space")&&(e[n][1].type==="lineEnding"||e[n][1].type==="space")){for(l=r;++l<n;)if(e[l][1].type==="codeTextData"){e[r][1].type="codeTextPadding",e[n][1].type="codeTextPadding",r+=2,n-=2;break}}for(l=r-1,n++;++l<=n;)o===void 0?l!==n&&e[l][1].type!=="lineEnding"&&(o=l):(l===n||e[l][1].type==="lineEnding")&&(e[o][1].type="codeTextData",l!==o+2&&(e[o][1].end=e[l-1][1].end,e.splice(o+2,l-o-2),n-=l-o-2,l=o+2),o=void 0);return e}function K1(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function X1(e,n,r){let l=0,o,s;return c;function c(g){return e.enter("codeText"),e.enter("codeTextSequence"),d(g)}function d(g){return g===96?(e.consume(g),l++,d):(e.exit("codeTextSequence"),m(g))}function m(g){return g===null?r(g):g===32?(e.enter("space"),e.consume(g),e.exit("space"),m):g===96?(s=e.enter("codeTextSequence"),o=0,y(g)):Re(g)?(e.enter("lineEnding"),e.consume(g),e.exit("lineEnding"),m):(e.enter("codeTextData"),p(g))}function p(g){return g===null||g===32||g===96||Re(g)?(e.exit("codeTextData"),m(g)):(e.consume(g),p)}function y(g){return g===96?(e.consume(g),o++,y):o===l?(e.exit("codeTextSequence"),e.exit("codeText"),n(g)):(s.type="codeTextData",p(g))}}class Q1{constructor(n){this.left=n?[...n]:[],this.right=[]}get(n){if(n<0||n>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+n+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return n<this.left.length?this.left[n]:this.right[this.right.length-n+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(n,r){const l=r??Number.POSITIVE_INFINITY;return l<this.left.length?this.left.slice(n,l):n>this.left.length?this.right.slice(this.right.length-l+this.left.length,this.right.length-n+this.left.length).reverse():this.left.slice(n).concat(this.right.slice(this.right.length-l+this.left.length).reverse())}splice(n,r,l){const o=r||0;this.setCursor(Math.trunc(n));const s=this.right.splice(this.right.length-o,Number.POSITIVE_INFINITY);return l&&Fl(this.left,l),s.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(n){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(n)}pushMany(n){this.setCursor(Number.POSITIVE_INFINITY),Fl(this.left,n)}unshift(n){this.setCursor(0),this.right.push(n)}unshiftMany(n){this.setCursor(0),Fl(this.right,n.reverse())}setCursor(n){if(!(n===this.left.length||n>this.left.length&&this.right.length===0||n<0&&this.left.length===0))if(n<this.left.length){const r=this.left.splice(n,Number.POSITIVE_INFINITY);Fl(this.right,r.reverse())}else{const r=this.right.splice(this.left.length+this.right.length-n,Number.POSITIVE_INFINITY);Fl(this.left,r.reverse())}}}function Fl(e,n){let r=0;if(n.length<1e4)e.push(...n);else for(;r<n.length;)e.push(...n.slice(r,r+1e4)),r+=1e4}function mS(e){const n={};let r=-1,l,o,s,c,d,m,p;const y=new Q1(e);for(;++r<y.length;){for(;r in n;)r=n[r];if(l=y.get(r),r&&l[1].type==="chunkFlow"&&y.get(r-1)[1].type==="listItemPrefix"&&(m=l[1]._tokenizer.events,s=0,s<m.length&&m[s][1].type==="lineEndingBlank"&&(s+=2),s<m.length&&m[s][1].type==="content"))for(;++s<m.length&&m[s][1].type!=="content";)m[s][1].type==="chunkText"&&(m[s][1]._isInFirstContentOfListItem=!0,s++);if(l[0]==="enter")l[1].contentType&&(Object.assign(n,J1(y,r)),r=n[r],p=!0);else if(l[1]._container){for(s=r,o=void 0;s--;)if(c=y.get(s),c[1].type==="lineEnding"||c[1].type==="lineEndingBlank")c[0]==="enter"&&(o&&(y.get(o)[1].type="lineEndingBlank"),c[1].type="lineEnding",o=s);else if(!(c[1].type==="linePrefix"||c[1].type==="listItemIndent"))break;o&&(l[1].end={...y.get(o)[1].start},d=y.slice(o,r),d.unshift(l),y.splice(o,r-o+1,d))}}return ni(e,0,Number.POSITIVE_INFINITY,y.slice(0)),!p}function J1(e,n){const r=e.get(n)[1],l=e.get(n)[2];let o=n-1;const s=[];let c=r._tokenizer;c||(c=l.parser[r.contentType](r.start),r._contentTypeTextTrailing&&(c._contentTypeTextTrailing=!0));const d=c.events,m=[],p={};let y,g,S=-1,v=r,_=0,N=0;const M=[N];for(;v;){for(;e.get(++o)[1]!==v;);s.push(o),v._tokenizer||(y=l.sliceStream(v),v.next||y.push(null),g&&c.defineSkip(v.start),v._isInFirstContentOfListItem&&(c._gfmTasklistFirstContentOfListItem=!0),c.write(y),v._isInFirstContentOfListItem&&(c._gfmTasklistFirstContentOfListItem=void 0)),g=v,v=v.next}for(v=r;++S<d.length;)d[S][0]==="exit"&&d[S-1][0]==="enter"&&d[S][1].type===d[S-1][1].type&&d[S][1].start.line!==d[S][1].end.line&&(N=S+1,M.push(N),v._tokenizer=void 0,v.previous=void 0,v=v.next);for(c.events=[],v?(v._tokenizer=void 0,v.previous=void 0):M.pop(),S=M.length;S--;){const A=d.slice(M[S],M[S+1]),V=s.pop();m.push([V,V+A.length-1]),e.splice(V,2,A)}for(m.reverse(),S=-1;++S<m.length;)p[_+m[S][0]]=_+m[S][1],_+=m[S][1]-m[S][0]-1;return p}const W1={resolve:tT,tokenize:nT},eT={partial:!0,tokenize:iT};function tT(e){return mS(e),e}function nT(e,n){let r;return l;function l(d){return e.enter("content"),r=e.enter("chunkContent",{contentType:"content"}),o(d)}function o(d){return d===null?s(d):Re(d)?e.check(eT,c,s)(d):(e.consume(d),o)}function s(d){return e.exit("chunkContent"),e.exit("content"),n(d)}function c(d){return e.consume(d),e.exit("chunkContent"),r.next=e.enter("chunkContent",{contentType:"content",previous:r}),r=r.next,o}}function iT(e,n,r){const l=this;return o;function o(c){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),nt(e,s,"linePrefix")}function s(c){if(c===null||Re(c))return r(c);const d=l.events[l.events.length-1];return!l.parser.constructs.disable.null.includes("codeIndented")&&d&&d[1].type==="linePrefix"&&d[2].sliceSerialize(d[1],!0).length>=4?n(c):e.interrupt(l.parser.constructs.flow,r,n)(c)}}function gS(e,n,r,l,o,s,c,d,m){const p=m||Number.POSITIVE_INFINITY;let y=0;return g;function g(A){return A===60?(e.enter(l),e.enter(o),e.enter(s),e.consume(A),e.exit(s),S):A===null||A===32||A===41||jo(A)?r(A):(e.enter(l),e.enter(c),e.enter(d),e.enter("chunkString",{contentType:"string"}),N(A))}function S(A){return A===62?(e.enter(s),e.consume(A),e.exit(s),e.exit(o),e.exit(l),n):(e.enter(d),e.enter("chunkString",{contentType:"string"}),v(A))}function v(A){return A===62?(e.exit("chunkString"),e.exit(d),S(A)):A===null||A===60||Re(A)?r(A):(e.consume(A),A===92?_:v)}function _(A){return A===60||A===62||A===92?(e.consume(A),v):v(A)}function N(A){return!y&&(A===null||A===41||_t(A))?(e.exit("chunkString"),e.exit(d),e.exit(c),e.exit(l),n(A)):y<p&&A===40?(e.consume(A),y++,N):A===41?(e.consume(A),y--,N):A===null||A===32||A===40||jo(A)?r(A):(e.consume(A),A===92?M:N)}function M(A){return A===40||A===41||A===92?(e.consume(A),N):N(A)}}function yS(e,n,r,l,o,s){const c=this;let d=0,m;return p;function p(v){return e.enter(l),e.enter(o),e.consume(v),e.exit(o),e.enter(s),y}function y(v){return d>999||v===null||v===91||v===93&&!m||v===94&&!d&&"_hiddenFootnoteSupport"in c.parser.constructs?r(v):v===93?(e.exit(s),e.enter(o),e.consume(v),e.exit(o),e.exit(l),n):Re(v)?(e.enter("lineEnding"),e.consume(v),e.exit("lineEnding"),y):(e.enter("chunkString",{contentType:"string"}),g(v))}function g(v){return v===null||v===91||v===93||Re(v)||d++>999?(e.exit("chunkString"),y(v)):(e.consume(v),m||(m=!Je(v)),v===92?S:g)}function S(v){return v===91||v===92||v===93?(e.consume(v),d++,g):g(v)}}function bS(e,n,r,l,o,s){let c;return d;function d(S){return S===34||S===39||S===40?(e.enter(l),e.enter(o),e.consume(S),e.exit(o),c=S===40?41:S,m):r(S)}function m(S){return S===c?(e.enter(o),e.consume(S),e.exit(o),e.exit(l),n):(e.enter(s),p(S))}function p(S){return S===c?(e.exit(s),m(c)):S===null?r(S):Re(S)?(e.enter("lineEnding"),e.consume(S),e.exit("lineEnding"),nt(e,p,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),y(S))}function y(S){return S===c||S===null||Re(S)?(e.exit("chunkString"),p(S)):(e.consume(S),S===92?g:y)}function g(S){return S===c||S===92?(e.consume(S),y):y(S)}}function eu(e,n){let r;return l;function l(o){return Re(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),r=!0,l):Je(o)?nt(e,l,r?"linePrefix":"lineSuffix")(o):n(o)}}const rT={name:"definition",tokenize:lT},aT={partial:!0,tokenize:uT};function lT(e,n,r){const l=this;let o;return s;function s(v){return e.enter("definition"),c(v)}function c(v){return yS.call(l,e,d,r,"definitionLabel","definitionLabelMarker","definitionLabelString")(v)}function d(v){return o=ki(l.sliceSerialize(l.events[l.events.length-1][1]).slice(1,-1)),v===58?(e.enter("definitionMarker"),e.consume(v),e.exit("definitionMarker"),m):r(v)}function m(v){return _t(v)?eu(e,p)(v):p(v)}function p(v){return gS(e,y,r,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(v)}function y(v){return e.attempt(aT,g,g)(v)}function g(v){return Je(v)?nt(e,S,"whitespace")(v):S(v)}function S(v){return v===null||Re(v)?(e.exit("definition"),l.parser.defined.push(o),n(v)):r(v)}}function uT(e,n,r){return l;function l(d){return _t(d)?eu(e,o)(d):r(d)}function o(d){return bS(e,s,r,"definitionTitle","definitionTitleMarker","definitionTitleString")(d)}function s(d){return Je(d)?nt(e,c,"whitespace")(d):c(d)}function c(d){return d===null||Re(d)?n(d):r(d)}}const oT={name:"hardBreakEscape",tokenize:sT};function sT(e,n,r){return l;function l(s){return e.enter("hardBreakEscape"),e.consume(s),o}function o(s){return Re(s)?(e.exit("hardBreakEscape"),n(s)):r(s)}}const cT={name:"headingAtx",resolve:fT,tokenize:dT};function fT(e,n){let r=e.length-2,l=3,o,s;return e[l][1].type==="whitespace"&&(l+=2),r-2>l&&e[r][1].type==="whitespace"&&(r-=2),e[r][1].type==="atxHeadingSequence"&&(l===r-1||r-4>l&&e[r-2][1].type==="whitespace")&&(r-=l+1===r?2:4),r>l&&(o={type:"atxHeadingText",start:e[l][1].start,end:e[r][1].end},s={type:"chunkText",start:e[l][1].start,end:e[r][1].end,contentType:"text"},ni(e,l,r-l+1,[["enter",o,n],["enter",s,n],["exit",s,n],["exit",o,n]])),e}function dT(e,n,r){let l=0;return o;function o(y){return e.enter("atxHeading"),s(y)}function s(y){return e.enter("atxHeadingSequence"),c(y)}function c(y){return y===35&&l++<6?(e.consume(y),c):y===null||_t(y)?(e.exit("atxHeadingSequence"),d(y)):r(y)}function d(y){return y===35?(e.enter("atxHeadingSequence"),m(y)):y===null||Re(y)?(e.exit("atxHeading"),n(y)):Je(y)?nt(e,d,"whitespace")(y):(e.enter("atxHeadingText"),p(y))}function m(y){return y===35?(e.consume(y),m):(e.exit("atxHeadingSequence"),d(y))}function p(y){return y===null||y===35||_t(y)?(e.exit("atxHeadingText"),d(y)):(e.consume(y),p)}}const hT=["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"],Sy=["pre","script","style","textarea"],pT={concrete:!0,name:"htmlFlow",resolveTo:yT,tokenize:bT},mT={partial:!0,tokenize:vT},gT={partial:!0,tokenize:ST};function yT(e){let n=e.length;for(;n--&&!(e[n][0]==="enter"&&e[n][1].type==="htmlFlow"););return n>1&&e[n-2][1].type==="linePrefix"&&(e[n][1].start=e[n-2][1].start,e[n+1][1].start=e[n-2][1].start,e.splice(n-2,2)),e}function bT(e,n,r){const l=this;let o,s,c,d,m;return p;function p(T){return y(T)}function y(T){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(T),g}function g(T){return T===33?(e.consume(T),S):T===47?(e.consume(T),s=!0,N):T===63?(e.consume(T),o=3,l.interrupt?n:w):Nn(T)?(e.consume(T),c=String.fromCharCode(T),M):r(T)}function S(T){return T===45?(e.consume(T),o=2,v):T===91?(e.consume(T),o=5,d=0,_):Nn(T)?(e.consume(T),o=4,l.interrupt?n:w):r(T)}function v(T){return T===45?(e.consume(T),l.interrupt?n:w):r(T)}function _(T){const he="CDATA[";return T===he.charCodeAt(d++)?(e.consume(T),d===he.length?l.interrupt?n:ne:_):r(T)}function N(T){return Nn(T)?(e.consume(T),c=String.fromCharCode(T),M):r(T)}function M(T){if(T===null||T===47||T===62||_t(T)){const he=T===47,_e=c.toLowerCase();return!he&&!s&&Sy.includes(_e)?(o=1,l.interrupt?n(T):ne(T)):hT.includes(c.toLowerCase())?(o=6,he?(e.consume(T),A):l.interrupt?n(T):ne(T)):(o=7,l.interrupt&&!l.parser.lazy[l.now().line]?r(T):s?V(T):j(T))}return T===45||kn(T)?(e.consume(T),c+=String.fromCharCode(T),M):r(T)}function A(T){return T===62?(e.consume(T),l.interrupt?n:ne):r(T)}function V(T){return Je(T)?(e.consume(T),V):U(T)}function j(T){return T===47?(e.consume(T),U):T===58||T===95||Nn(T)?(e.consume(T),ae):Je(T)?(e.consume(T),j):U(T)}function ae(T){return T===45||T===46||T===58||T===95||kn(T)?(e.consume(T),ae):ue(T)}function ue(T){return T===61?(e.consume(T),D):Je(T)?(e.consume(T),ue):j(T)}function D(T){return T===null||T===60||T===61||T===62||T===96?r(T):T===34||T===39?(e.consume(T),m=T,$):Je(T)?(e.consume(T),D):re(T)}function $(T){return T===m?(e.consume(T),m=null,de):T===null||Re(T)?r(T):(e.consume(T),$)}function re(T){return T===null||T===34||T===39||T===47||T===60||T===61||T===62||T===96||_t(T)?ue(T):(e.consume(T),re)}function de(T){return T===47||T===62||Je(T)?j(T):r(T)}function U(T){return T===62?(e.consume(T),te):r(T)}function te(T){return T===null||Re(T)?ne(T):Je(T)?(e.consume(T),te):r(T)}function ne(T){return T===45&&o===2?(e.consume(T),H):T===60&&o===1?(e.consume(T),le):T===62&&o===4?(e.consume(T),z):T===63&&o===3?(e.consume(T),w):T===93&&o===5?(e.consume(T),Pe):Re(T)&&(o===6||o===7)?(e.exit("htmlFlowData"),e.check(mT,F,Ae)(T)):T===null||Re(T)?(e.exit("htmlFlowData"),Ae(T)):(e.consume(T),ne)}function Ae(T){return e.check(gT,Se,F)(T)}function Se(T){return e.enter("lineEnding"),e.consume(T),e.exit("lineEnding"),oe}function oe(T){return T===null||Re(T)?Ae(T):(e.enter("htmlFlowData"),ne(T))}function H(T){return T===45?(e.consume(T),w):ne(T)}function le(T){return T===47?(e.consume(T),c="",ve):ne(T)}function ve(T){if(T===62){const he=c.toLowerCase();return Sy.includes(he)?(e.consume(T),z):ne(T)}return Nn(T)&&c.length<8?(e.consume(T),c+=String.fromCharCode(T),ve):ne(T)}function Pe(T){return T===93?(e.consume(T),w):ne(T)}function w(T){return T===62?(e.consume(T),z):T===45&&o===2?(e.consume(T),w):ne(T)}function z(T){return T===null||Re(T)?(e.exit("htmlFlowData"),F(T)):(e.consume(T),z)}function F(T){return e.exit("htmlFlow"),n(T)}}function ST(e,n,r){const l=this;return o;function o(c){return Re(c)?(e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),s):r(c)}function s(c){return l.parser.lazy[l.now().line]?r(c):n(c)}}function vT(e,n,r){return l;function l(o){return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),e.attempt(su,n,r)}}const ET={name:"htmlText",tokenize:_T};function _T(e,n,r){const l=this;let o,s,c;return d;function d(w){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(w),m}function m(w){return w===33?(e.consume(w),p):w===47?(e.consume(w),ue):w===63?(e.consume(w),j):Nn(w)?(e.consume(w),re):r(w)}function p(w){return w===45?(e.consume(w),y):w===91?(e.consume(w),s=0,_):Nn(w)?(e.consume(w),V):r(w)}function y(w){return w===45?(e.consume(w),v):r(w)}function g(w){return w===null?r(w):w===45?(e.consume(w),S):Re(w)?(c=g,le(w)):(e.consume(w),g)}function S(w){return w===45?(e.consume(w),v):g(w)}function v(w){return w===62?H(w):w===45?S(w):g(w)}function _(w){const z="CDATA[";return w===z.charCodeAt(s++)?(e.consume(w),s===z.length?N:_):r(w)}function N(w){return w===null?r(w):w===93?(e.consume(w),M):Re(w)?(c=N,le(w)):(e.consume(w),N)}function M(w){return w===93?(e.consume(w),A):N(w)}function A(w){return w===62?H(w):w===93?(e.consume(w),A):N(w)}function V(w){return w===null||w===62?H(w):Re(w)?(c=V,le(w)):(e.consume(w),V)}function j(w){return w===null?r(w):w===63?(e.consume(w),ae):Re(w)?(c=j,le(w)):(e.consume(w),j)}function ae(w){return w===62?H(w):j(w)}function ue(w){return Nn(w)?(e.consume(w),D):r(w)}function D(w){return w===45||kn(w)?(e.consume(w),D):$(w)}function $(w){return Re(w)?(c=$,le(w)):Je(w)?(e.consume(w),$):H(w)}function re(w){return w===45||kn(w)?(e.consume(w),re):w===47||w===62||_t(w)?de(w):r(w)}function de(w){return w===47?(e.consume(w),H):w===58||w===95||Nn(w)?(e.consume(w),U):Re(w)?(c=de,le(w)):Je(w)?(e.consume(w),de):H(w)}function U(w){return w===45||w===46||w===58||w===95||kn(w)?(e.consume(w),U):te(w)}function te(w){return w===61?(e.consume(w),ne):Re(w)?(c=te,le(w)):Je(w)?(e.consume(w),te):de(w)}function ne(w){return w===null||w===60||w===61||w===62||w===96?r(w):w===34||w===39?(e.consume(w),o=w,Ae):Re(w)?(c=ne,le(w)):Je(w)?(e.consume(w),ne):(e.consume(w),Se)}function Ae(w){return w===o?(e.consume(w),o=void 0,oe):w===null?r(w):Re(w)?(c=Ae,le(w)):(e.consume(w),Ae)}function Se(w){return w===null||w===34||w===39||w===60||w===61||w===96?r(w):w===47||w===62||_t(w)?de(w):(e.consume(w),Se)}function oe(w){return w===47||w===62||_t(w)?de(w):r(w)}function H(w){return w===62?(e.consume(w),e.exit("htmlTextData"),e.exit("htmlText"),n):r(w)}function le(w){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(w),e.exit("lineEnding"),ve}function ve(w){return Je(w)?nt(e,Pe,"linePrefix",l.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(w):Pe(w)}function Pe(w){return e.enter("htmlTextData"),c(w)}}const Rd={name:"labelEnd",resolveAll:AT,resolveTo:xT,tokenize:OT},TT={tokenize:CT},kT={tokenize:zT},wT={tokenize:NT};function AT(e){let n=-1;const r=[];for(;++n<e.length;){const l=e[n][1];if(r.push(e[n]),l.type==="labelImage"||l.type==="labelLink"||l.type==="labelEnd"){const o=l.type==="labelImage"?4:2;l.type="data",n+=o}}return e.length!==r.length&&ni(e,0,e.length,r),e}function xT(e,n){let r=e.length,l=0,o,s,c,d;for(;r--;)if(o=e[r][1],s){if(o.type==="link"||o.type==="labelLink"&&o._inactive)break;e[r][0]==="enter"&&o.type==="labelLink"&&(o._inactive=!0)}else if(c){if(e[r][0]==="enter"&&(o.type==="labelImage"||o.type==="labelLink")&&!o._balanced&&(s=r,o.type!=="labelLink")){l=2;break}}else o.type==="labelEnd"&&(c=r);const m={type:e[s][1].type==="labelLink"?"link":"image",start:{...e[s][1].start},end:{...e[e.length-1][1].end}},p={type:"label",start:{...e[s][1].start},end:{...e[c][1].end}},y={type:"labelText",start:{...e[s+l+2][1].end},end:{...e[c-2][1].start}};return d=[["enter",m,n],["enter",p,n]],d=mi(d,e.slice(s+1,s+l+3)),d=mi(d,[["enter",y,n]]),d=mi(d,Qo(n.parser.constructs.insideSpan.null,e.slice(s+l+4,c-3),n)),d=mi(d,[["exit",y,n],e[c-2],e[c-1],["exit",p,n]]),d=mi(d,e.slice(c+1)),d=mi(d,[["exit",m,n]]),ni(e,s,e.length,d),e}function OT(e,n,r){const l=this;let o=l.events.length,s,c;for(;o--;)if((l.events[o][1].type==="labelImage"||l.events[o][1].type==="labelLink")&&!l.events[o][1]._balanced){s=l.events[o][1];break}return d;function d(S){return s?s._inactive?g(S):(c=l.parser.defined.includes(ki(l.sliceSerialize({start:s.end,end:l.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(S),e.exit("labelMarker"),e.exit("labelEnd"),m):r(S)}function m(S){return S===40?e.attempt(TT,y,c?y:g)(S):S===91?e.attempt(kT,y,c?p:g)(S):c?y(S):g(S)}function p(S){return e.attempt(wT,y,g)(S)}function y(S){return n(S)}function g(S){return s._balanced=!0,r(S)}}function CT(e,n,r){return l;function l(g){return e.enter("resource"),e.enter("resourceMarker"),e.consume(g),e.exit("resourceMarker"),o}function o(g){return _t(g)?eu(e,s)(g):s(g)}function s(g){return g===41?y(g):gS(e,c,d,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(g)}function c(g){return _t(g)?eu(e,m)(g):y(g)}function d(g){return r(g)}function m(g){return g===34||g===39||g===40?bS(e,p,r,"resourceTitle","resourceTitleMarker","resourceTitleString")(g):y(g)}function p(g){return _t(g)?eu(e,y)(g):y(g)}function y(g){return g===41?(e.enter("resourceMarker"),e.consume(g),e.exit("resourceMarker"),e.exit("resource"),n):r(g)}}function zT(e,n,r){const l=this;return o;function o(d){return yS.call(l,e,s,c,"reference","referenceMarker","referenceString")(d)}function s(d){return l.parser.defined.includes(ki(l.sliceSerialize(l.events[l.events.length-1][1]).slice(1,-1)))?n(d):r(d)}function c(d){return r(d)}}function NT(e,n,r){return l;function l(s){return e.enter("reference"),e.enter("referenceMarker"),e.consume(s),e.exit("referenceMarker"),o}function o(s){return s===93?(e.enter("referenceMarker"),e.consume(s),e.exit("referenceMarker"),e.exit("reference"),n):r(s)}}const RT={name:"labelStartImage",resolveAll:Rd.resolveAll,tokenize:DT};function DT(e,n,r){const l=this;return o;function o(d){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(d),e.exit("labelImageMarker"),s}function s(d){return d===91?(e.enter("labelMarker"),e.consume(d),e.exit("labelMarker"),e.exit("labelImage"),c):r(d)}function c(d){return d===94&&"_hiddenFootnoteSupport"in l.parser.constructs?r(d):n(d)}}const MT={name:"labelStartLink",resolveAll:Rd.resolveAll,tokenize:IT};function IT(e,n,r){const l=this;return o;function o(c){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(c),e.exit("labelMarker"),e.exit("labelLink"),s}function s(c){return c===94&&"_hiddenFootnoteSupport"in l.parser.constructs?r(c):n(c)}}const wf={name:"lineEnding",tokenize:LT};function LT(e,n){return r;function r(l){return e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),nt(e,n,"linePrefix")}}const Lo={name:"thematicBreak",tokenize:UT};function UT(e,n,r){let l=0,o;return s;function s(p){return e.enter("thematicBreak"),c(p)}function c(p){return o=p,d(p)}function d(p){return p===o?(e.enter("thematicBreakSequence"),m(p)):l>=3&&(p===null||Re(p))?(e.exit("thematicBreak"),n(p)):r(p)}function m(p){return p===o?(e.consume(p),l++,m):(e.exit("thematicBreakSequence"),Je(p)?nt(e,d,"whitespace")(p):d(p))}}const Hn={continuation:{tokenize:HT},exit:ZT,name:"list",tokenize:qT},jT={partial:!0,tokenize:GT},BT={partial:!0,tokenize:PT};function qT(e,n,r){const l=this,o=l.events[l.events.length-1];let s=o&&o[1].type==="linePrefix"?o[2].sliceSerialize(o[1],!0).length:0,c=0;return d;function d(v){const _=l.containerState.type||(v===42||v===43||v===45?"listUnordered":"listOrdered");if(_==="listUnordered"?!l.containerState.marker||v===l.containerState.marker:ad(v)){if(l.containerState.type||(l.containerState.type=_,e.enter(_,{_container:!0})),_==="listUnordered")return e.enter("listItemPrefix"),v===42||v===45?e.check(Lo,r,p)(v):p(v);if(!l.interrupt||v===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),m(v)}return r(v)}function m(v){return ad(v)&&++c<10?(e.consume(v),m):(!l.interrupt||c<2)&&(l.containerState.marker?v===l.containerState.marker:v===41||v===46)?(e.exit("listItemValue"),p(v)):r(v)}function p(v){return e.enter("listItemMarker"),e.consume(v),e.exit("listItemMarker"),l.containerState.marker=l.containerState.marker||v,e.check(su,l.interrupt?r:y,e.attempt(jT,S,g))}function y(v){return l.containerState.initialBlankLine=!0,s++,S(v)}function g(v){return Je(v)?(e.enter("listItemPrefixWhitespace"),e.consume(v),e.exit("listItemPrefixWhitespace"),S):r(v)}function S(v){return l.containerState.size=s+l.sliceSerialize(e.exit("listItemPrefix"),!0).length,n(v)}}function HT(e,n,r){const l=this;return l.containerState._closeFlow=void 0,e.check(su,o,s);function o(d){return l.containerState.furtherBlankLines=l.containerState.furtherBlankLines||l.containerState.initialBlankLine,nt(e,n,"listItemIndent",l.containerState.size+1)(d)}function s(d){return l.containerState.furtherBlankLines||!Je(d)?(l.containerState.furtherBlankLines=void 0,l.containerState.initialBlankLine=void 0,c(d)):(l.containerState.furtherBlankLines=void 0,l.containerState.initialBlankLine=void 0,e.attempt(BT,n,c)(d))}function c(d){return l.containerState._closeFlow=!0,l.interrupt=void 0,nt(e,e.attempt(Hn,n,r),"linePrefix",l.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(d)}}function PT(e,n,r){const l=this;return nt(e,o,"listItemIndent",l.containerState.size+1);function o(s){const c=l.events[l.events.length-1];return c&&c[1].type==="listItemIndent"&&c[2].sliceSerialize(c[1],!0).length===l.containerState.size?n(s):r(s)}}function ZT(e){e.exit(this.containerState.type)}function GT(e,n,r){const l=this;return nt(e,o,"listItemPrefixWhitespace",l.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function o(s){const c=l.events[l.events.length-1];return!Je(s)&&c&&c[1].type==="listItemPrefixWhitespace"?n(s):r(s)}}const vy={name:"setextUnderline",resolveTo:VT,tokenize:$T};function VT(e,n){let r=e.length,l,o,s;for(;r--;)if(e[r][0]==="enter"){if(e[r][1].type==="content"){l=r;break}e[r][1].type==="paragraph"&&(o=r)}else e[r][1].type==="content"&&e.splice(r,1),!s&&e[r][1].type==="definition"&&(s=r);const c={type:"setextHeading",start:{...e[l][1].start},end:{...e[e.length-1][1].end}};return e[o][1].type="setextHeadingText",s?(e.splice(o,0,["enter",c,n]),e.splice(s+1,0,["exit",e[l][1],n]),e[l][1].end={...e[s][1].end}):e[l][1]=c,e.push(["exit",c,n]),e}function $T(e,n,r){const l=this;let o;return s;function s(p){let y=l.events.length,g;for(;y--;)if(l.events[y][1].type!=="lineEnding"&&l.events[y][1].type!=="linePrefix"&&l.events[y][1].type!=="content"){g=l.events[y][1].type==="paragraph";break}return!l.parser.lazy[l.now().line]&&(l.interrupt||g)?(e.enter("setextHeadingLine"),o=p,c(p)):r(p)}function c(p){return e.enter("setextHeadingLineSequence"),d(p)}function d(p){return p===o?(e.consume(p),d):(e.exit("setextHeadingLineSequence"),Je(p)?nt(e,m,"lineSuffix")(p):m(p))}function m(p){return p===null||Re(p)?(e.exit("setextHeadingLine"),n(p)):r(p)}}const YT={tokenize:FT};function FT(e){const n=this,r=e.attempt(su,l,e.attempt(this.parser.constructs.flowInitial,o,nt(e,e.attempt(this.parser.constructs.flow,o,e.attempt(W1,o)),"linePrefix")));return r;function l(s){if(s===null){e.consume(s);return}return e.enter("lineEndingBlank"),e.consume(s),e.exit("lineEndingBlank"),n.currentConstruct=void 0,r}function o(s){if(s===null){e.consume(s);return}return e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),n.currentConstruct=void 0,r}}const KT={resolveAll:vS()},XT=SS("string"),QT=SS("text");function SS(e){return{resolveAll:vS(e==="text"?JT:void 0),tokenize:n};function n(r){const l=this,o=this.parser.constructs[e],s=r.attempt(o,c,d);return c;function c(y){return p(y)?s(y):d(y)}function d(y){if(y===null){r.consume(y);return}return r.enter("data"),r.consume(y),m}function m(y){return p(y)?(r.exit("data"),s(y)):(r.consume(y),m)}function p(y){if(y===null)return!0;const g=o[y];let S=-1;if(g)for(;++S<g.length;){const v=g[S];if(!v.previous||v.previous.call(l,l.previous))return!0}return!1}}}function vS(e){return n;function n(r,l){let o=-1,s;for(;++o<=r.length;)s===void 0?r[o]&&r[o][1].type==="data"&&(s=o,o++):(!r[o]||r[o][1].type!=="data")&&(o!==s+2&&(r[s][1].end=r[o-1][1].end,r.splice(s+2,o-s-2),o=s+2),s=void 0);return e?e(r,l):r}}function JT(e,n){let r=0;for(;++r<=e.length;)if((r===e.length||e[r][1].type==="lineEnding")&&e[r-1][1].type==="data"){const l=e[r-1][1],o=n.sliceStream(l);let s=o.length,c=-1,d=0,m;for(;s--;){const p=o[s];if(typeof p=="string"){for(c=p.length;p.charCodeAt(c-1)===32;)d++,c--;if(c)break;c=-1}else if(p===-2)m=!0,d++;else if(p!==-1){s++;break}}if(n._contentTypeTextTrailing&&r===e.length&&(d=0),d){const p={type:r===e.length||m||d<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:s?c:l.start._bufferIndex+c,_index:l.start._index+s,line:l.end.line,column:l.end.column-d,offset:l.end.offset-d},end:{...l.end}};l.end={...p.start},l.start.offset===l.end.offset?Object.assign(l,p):(e.splice(r,0,["enter",p,n],["exit",p,n]),r+=2)}r++}return e}const WT={42:Hn,43:Hn,45:Hn,48:Hn,49:Hn,50:Hn,51:Hn,52:Hn,53:Hn,54:Hn,55:Hn,56:Hn,57:Hn,62:dS},ek={91:rT},tk={[-2]:kf,[-1]:kf,32:kf},nk={35:cT,42:Lo,45:[vy,Lo],60:pT,61:vy,95:Lo,96:by,126:by},ik={38:pS,92:hS},rk={[-5]:wf,[-4]:wf,[-3]:wf,33:RT,38:pS,42:ld,60:[M1,ET],91:MT,92:[oT,hS],93:Rd,95:ld,96:Y1},ak={null:[ld,KT]},lk={null:[42,95]},uk={null:[]},ok=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:lk,contentInitial:ek,disable:uk,document:WT,flow:nk,flowInitial:tk,insideSpan:ak,string:ik,text:rk},Symbol.toStringTag,{value:"Module"}));function sk(e,n,r){let l={_bufferIndex:-1,_index:0,line:r&&r.line||1,column:r&&r.column||1,offset:r&&r.offset||0};const o={},s=[];let c=[],d=[];const m={attempt:$(ue),check:$(D),consume:V,enter:j,exit:ae,interrupt:$(D,{interrupt:!0})},p={code:null,containerState:{},defineSkip:N,events:[],now:_,parser:e,previous:null,sliceSerialize:S,sliceStream:v,write:g};let y=n.tokenize.call(p,m);return n.resolveAll&&s.push(n),p;function g(te){return c=mi(c,te),M(),c[c.length-1]!==null?[]:(re(n,0),p.events=Qo(s,p.events,p),p.events)}function S(te,ne){return fk(v(te),ne)}function v(te){return ck(c,te)}function _(){const{_bufferIndex:te,_index:ne,line:Ae,column:Se,offset:oe}=l;return{_bufferIndex:te,_index:ne,line:Ae,column:Se,offset:oe}}function N(te){o[te.line]=te.column,U()}function M(){let te;for(;l._index<c.length;){const ne=c[l._index];if(typeof ne=="string")for(te=l._index,l._bufferIndex<0&&(l._bufferIndex=0);l._index===te&&l._bufferIndex<ne.length;)A(ne.charCodeAt(l._bufferIndex));else A(ne)}}function A(te){y=y(te)}function V(te){Re(te)?(l.line++,l.column=1,l.offset+=te===-3?2:1,U()):te!==-1&&(l.column++,l.offset++),l._bufferIndex<0?l._index++:(l._bufferIndex++,l._bufferIndex===c[l._index].length&&(l._bufferIndex=-1,l._index++)),p.previous=te}function j(te,ne){const Ae=ne||{};return Ae.type=te,Ae.start=_(),p.events.push(["enter",Ae,p]),d.push(Ae),Ae}function ae(te){const ne=d.pop();return ne.end=_(),p.events.push(["exit",ne,p]),ne}function ue(te,ne){re(te,ne.from)}function D(te,ne){ne.restore()}function $(te,ne){return Ae;function Ae(Se,oe,H){let le,ve,Pe,w;return Array.isArray(Se)?F(Se):"tokenize"in Se?F([Se]):z(Se);function z(Te){return Ze;function Ze(ut){const Le=ut!==null&&Te[ut],dn=ut!==null&&Te.null,yt=[...Array.isArray(Le)?Le:Le?[Le]:[],...Array.isArray(dn)?dn:dn?[dn]:[]];return F(yt)(ut)}}function F(Te){return le=Te,ve=0,Te.length===0?H:T(Te[ve])}function T(Te){return Ze;function Ze(ut){return w=de(),Pe=Te,Te.partial||(p.currentConstruct=Te),Te.name&&p.parser.constructs.disable.null.includes(Te.name)?_e():Te.tokenize.call(ne?Object.assign(Object.create(p),ne):p,m,he,_e)(ut)}}function he(Te){return te(Pe,w),oe}function _e(Te){return w.restore(),++ve<le.length?T(le[ve]):H}}}function re(te,ne){te.resolveAll&&!s.includes(te)&&s.push(te),te.resolve&&ni(p.events,ne,p.events.length-ne,te.resolve(p.events.slice(ne),p)),te.resolveTo&&(p.events=te.resolveTo(p.events,p))}function de(){const te=_(),ne=p.previous,Ae=p.currentConstruct,Se=p.events.length,oe=Array.from(d);return{from:Se,restore:H};function H(){l=te,p.previous=ne,p.currentConstruct=Ae,p.events.length=Se,d=oe,U()}}function U(){l.line in o&&l.column<2&&(l.column=o[l.line],l.offset+=o[l.line]-1)}}function ck(e,n){const r=n.start._index,l=n.start._bufferIndex,o=n.end._index,s=n.end._bufferIndex;let c;if(r===o)c=[e[r].slice(l,s)];else{if(c=e.slice(r,o),l>-1){const d=c[0];typeof d=="string"?c[0]=d.slice(l):c.shift()}s>0&&c.push(e[o].slice(0,s))}return c}function fk(e,n){let r=-1;const l=[];let o;for(;++r<e.length;){const s=e[r];let c;if(typeof s=="string")c=s;else switch(s){case-5:{c="\r";break}case-4:{c=`
|
|
12
|
-
`;break}case-3:{c=`\r
|
|
13
|
-
`;break}case-2:{c=n?" ":" ";break}case-1:{if(!n&&o)continue;c=" ";break}default:c=String.fromCharCode(s)}o=s===-2,l.push(c)}return l.join("")}function dk(e){const l={constructs:cS([ok,...(e||{}).extensions||[]]),content:o(x1),defined:[],document:o(C1),flow:o(YT),lazy:{},string:o(XT),text:o(QT)};return l;function o(s){return c;function c(d){return sk(l,s,d)}}}function hk(e){for(;!mS(e););return e}const Ey=/[\0\t\n\r]/g;function pk(){let e=1,n="",r=!0,l;return o;function o(s,c,d){const m=[];let p,y,g,S,v;for(s=n+(typeof s=="string"?s.toString():new TextDecoder(c||void 0).decode(s)),g=0,n="",r&&(s.charCodeAt(0)===65279&&g++,r=void 0);g<s.length;){if(Ey.lastIndex=g,p=Ey.exec(s),S=p&&p.index!==void 0?p.index:s.length,v=s.charCodeAt(S),!p){n=s.slice(g);break}if(v===10&&g===S&&l)m.push(-3),l=void 0;else switch(l&&(m.push(-5),l=void 0),g<S&&(m.push(s.slice(g,S)),e+=S-g),v){case 0:{m.push(65533),e++;break}case 9:{for(y=Math.ceil(e/4)*4,m.push(-2);e++<y;)m.push(-1);break}case 10:{m.push(-4),e=1;break}default:l=!0,e=1}g=S+1}return d&&(l&&m.push(-5),n&&m.push(n),m.push(null)),m}}const mk=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function gk(e){return e.replace(mk,yk)}function yk(e,n,r){if(n)return n;if(r.charCodeAt(0)===35){const o=r.charCodeAt(1),s=o===120||o===88;return fS(r.slice(s?2:1),s?16:10)}return Nd(r)||e}const ES={}.hasOwnProperty;function bk(e,n,r){return n&&typeof n=="object"&&(r=n,n=void 0),Sk(r)(hk(dk(r).document().write(pk()(e,n,!0))))}function Sk(e){const n={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:s(on),autolinkProtocol:de,autolinkEmail:de,atxHeading:s(un),blockQuote:s(dn),characterEscape:de,characterReference:de,codeFenced:s(yt),codeFencedFenceInfo:c,codeFencedFenceMeta:c,codeIndented:s(yt,c),codeText:s(En,c),codeTextData:de,data:de,codeFlowValue:de,definition:s(On),definitionDestinationString:c,definitionLabelString:c,definitionTitleString:c,emphasis:s(_n),hardBreakEscape:s(bi),hardBreakTrailing:s(bi),htmlFlow:s(hn,c),htmlFlowData:de,htmlText:s(hn,c),htmlTextData:de,image:s(Tt),label:c,link:s(on),listItem:s(At),listItemValue:S,listOrdered:s(Yt,g),listUnordered:s(Yt),paragraph:s(pn),reference:T,referenceString:c,resourceDestinationString:c,resourceTitleString:c,setextHeading:s(un),strong:s(Vn),thematicBreak:s(st)},exit:{atxHeading:m(),atxHeadingSequence:ue,autolink:m(),autolinkEmail:Le,autolinkProtocol:ut,blockQuote:m(),characterEscapeValue:U,characterReferenceMarkerHexadecimal:_e,characterReferenceMarkerNumeric:_e,characterReferenceValue:Te,characterReference:Ze,codeFenced:m(M),codeFencedFence:N,codeFencedFenceInfo:v,codeFencedFenceMeta:_,codeFlowValue:U,codeIndented:m(A),codeText:m(oe),codeTextData:U,data:U,definition:m(),definitionDestinationString:ae,definitionLabelString:V,definitionTitleString:j,emphasis:m(),hardBreakEscape:m(ne),hardBreakTrailing:m(ne),htmlFlow:m(Ae),htmlFlowData:U,htmlText:m(Se),htmlTextData:U,image:m(le),label:Pe,labelText:ve,lineEnding:te,link:m(H),listItem:m(),listOrdered:m(),listUnordered:m(),paragraph:m(),referenceString:he,resourceDestinationString:w,resourceTitleString:z,resource:F,setextHeading:m(re),setextHeadingLineSequence:$,setextHeadingText:D,strong:m(),thematicBreak:m()}};_S(n,(e||{}).mdastExtensions||[]);const r={};return l;function l(K){let se={type:"root",children:[]};const ze={stack:[se],tokenStack:[],config:n,enter:d,exit:p,buffer:c,resume:y,data:r},je=[];let $e=-1;for(;++$e<K.length;)if(K[$e][1].type==="listOrdered"||K[$e][1].type==="listUnordered")if(K[$e][0]==="enter")je.push($e);else{const ct=je.pop();$e=o(K,ct,$e)}for($e=-1;++$e<K.length;){const ct=n[K[$e][0]];ES.call(ct,K[$e][1].type)&&ct[K[$e][1].type].call(Object.assign({sliceSerialize:K[$e][2].sliceSerialize},ze),K[$e][1])}if(ze.tokenStack.length>0){const ct=ze.tokenStack[ze.tokenStack.length-1];(ct[1]||_y).call(ze,void 0,ct[0])}for(se.position={start:Rr(K.length>0?K[0][1].start:{line:1,column:1,offset:0}),end:Rr(K.length>0?K[K.length-2][1].end:{line:1,column:1,offset:0})},$e=-1;++$e<n.transforms.length;)se=n.transforms[$e](se)||se;return se}function o(K,se,ze){let je=se-1,$e=-1,ct=!1,Pt,xt,Ot,Ct;for(;++je<=ze;){const Ye=K[je];switch(Ye[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{Ye[0]==="enter"?$e++:$e--,Ct=void 0;break}case"lineEndingBlank":{Ye[0]==="enter"&&(Pt&&!Ct&&!$e&&!Ot&&(Ot=je),Ct=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:Ct=void 0}if(!$e&&Ye[0]==="enter"&&Ye[1].type==="listItemPrefix"||$e===-1&&Ye[0]==="exit"&&(Ye[1].type==="listUnordered"||Ye[1].type==="listOrdered")){if(Pt){let Dn=je;for(xt=void 0;Dn--;){const Zt=K[Dn];if(Zt[1].type==="lineEnding"||Zt[1].type==="lineEndingBlank"){if(Zt[0]==="exit")continue;xt&&(K[xt][1].type="lineEndingBlank",ct=!0),Zt[1].type="lineEnding",xt=Dn}else if(!(Zt[1].type==="linePrefix"||Zt[1].type==="blockQuotePrefix"||Zt[1].type==="blockQuotePrefixWhitespace"||Zt[1].type==="blockQuoteMarker"||Zt[1].type==="listItemIndent"))break}Ot&&(!xt||Ot<xt)&&(Pt._spread=!0),Pt.end=Object.assign({},xt?K[xt][1].start:Ye[1].end),K.splice(xt||je,0,["exit",Pt,Ye[2]]),je++,ze++}if(Ye[1].type==="listItemPrefix"){const Dn={type:"listItem",_spread:!1,start:Object.assign({},Ye[1].start),end:void 0};Pt=Dn,K.splice(je,0,["enter",Dn,Ye[2]]),je++,ze++,Ot=void 0,Ct=!0}}}return K[se][1]._spread=ct,ze}function s(K,se){return ze;function ze(je){d.call(this,K(je),je),se&&se.call(this,je)}}function c(){this.stack.push({type:"fragment",children:[]})}function d(K,se,ze){this.stack[this.stack.length-1].children.push(K),this.stack.push(K),this.tokenStack.push([se,ze||void 0]),K.position={start:Rr(se.start),end:void 0}}function m(K){return se;function se(ze){K&&K.call(this,ze),p.call(this,ze)}}function p(K,se){const ze=this.stack.pop(),je=this.tokenStack.pop();if(je)je[0].type!==K.type&&(se?se.call(this,K,je[0]):(je[1]||_y).call(this,K,je[0]));else throw new Error("Cannot close `"+K.type+"` ("+Wl({start:K.start,end:K.end})+"): it’s not open");ze.position.end=Rr(K.end)}function y(){return zd(this.stack.pop())}function g(){this.data.expectingFirstListItemValue=!0}function S(K){if(this.data.expectingFirstListItemValue){const se=this.stack[this.stack.length-2];se.start=Number.parseInt(this.sliceSerialize(K),10),this.data.expectingFirstListItemValue=void 0}}function v(){const K=this.resume(),se=this.stack[this.stack.length-1];se.lang=K}function _(){const K=this.resume(),se=this.stack[this.stack.length-1];se.meta=K}function N(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function M(){const K=this.resume(),se=this.stack[this.stack.length-1];se.value=K.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function A(){const K=this.resume(),se=this.stack[this.stack.length-1];se.value=K.replace(/(\r?\n|\r)$/g,"")}function V(K){const se=this.resume(),ze=this.stack[this.stack.length-1];ze.label=se,ze.identifier=ki(this.sliceSerialize(K)).toLowerCase()}function j(){const K=this.resume(),se=this.stack[this.stack.length-1];se.title=K}function ae(){const K=this.resume(),se=this.stack[this.stack.length-1];se.url=K}function ue(K){const se=this.stack[this.stack.length-1];if(!se.depth){const ze=this.sliceSerialize(K).length;se.depth=ze}}function D(){this.data.setextHeadingSlurpLineEnding=!0}function $(K){const se=this.stack[this.stack.length-1];se.depth=this.sliceSerialize(K).codePointAt(0)===61?1:2}function re(){this.data.setextHeadingSlurpLineEnding=void 0}function de(K){const ze=this.stack[this.stack.length-1].children;let je=ze[ze.length-1];(!je||je.type!=="text")&&(je=Rt(),je.position={start:Rr(K.start),end:void 0},ze.push(je)),this.stack.push(je)}function U(K){const se=this.stack.pop();se.value+=this.sliceSerialize(K),se.position.end=Rr(K.end)}function te(K){const se=this.stack[this.stack.length-1];if(this.data.atHardBreak){const ze=se.children[se.children.length-1];ze.position.end=Rr(K.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&n.canContainEols.includes(se.type)&&(de.call(this,K),U.call(this,K))}function ne(){this.data.atHardBreak=!0}function Ae(){const K=this.resume(),se=this.stack[this.stack.length-1];se.value=K}function Se(){const K=this.resume(),se=this.stack[this.stack.length-1];se.value=K}function oe(){const K=this.resume(),se=this.stack[this.stack.length-1];se.value=K}function H(){const K=this.stack[this.stack.length-1];if(this.data.inReference){const se=this.data.referenceType||"shortcut";K.type+="Reference",K.referenceType=se,delete K.url,delete K.title}else delete K.identifier,delete K.label;this.data.referenceType=void 0}function le(){const K=this.stack[this.stack.length-1];if(this.data.inReference){const se=this.data.referenceType||"shortcut";K.type+="Reference",K.referenceType=se,delete K.url,delete K.title}else delete K.identifier,delete K.label;this.data.referenceType=void 0}function ve(K){const se=this.sliceSerialize(K),ze=this.stack[this.stack.length-2];ze.label=gk(se),ze.identifier=ki(se).toLowerCase()}function Pe(){const K=this.stack[this.stack.length-1],se=this.resume(),ze=this.stack[this.stack.length-1];if(this.data.inReference=!0,ze.type==="link"){const je=K.children;ze.children=je}else ze.alt=se}function w(){const K=this.resume(),se=this.stack[this.stack.length-1];se.url=K}function z(){const K=this.resume(),se=this.stack[this.stack.length-1];se.title=K}function F(){this.data.inReference=void 0}function T(){this.data.referenceType="collapsed"}function he(K){const se=this.resume(),ze=this.stack[this.stack.length-1];ze.label=se,ze.identifier=ki(this.sliceSerialize(K)).toLowerCase(),this.data.referenceType="full"}function _e(K){this.data.characterReferenceType=K.type}function Te(K){const se=this.sliceSerialize(K),ze=this.data.characterReferenceType;let je;ze?(je=fS(se,ze==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):je=Nd(se);const $e=this.stack[this.stack.length-1];$e.value+=je}function Ze(K){const se=this.stack.pop();se.position.end=Rr(K.end)}function ut(K){U.call(this,K);const se=this.stack[this.stack.length-1];se.url=this.sliceSerialize(K)}function Le(K){U.call(this,K);const se=this.stack[this.stack.length-1];se.url="mailto:"+this.sliceSerialize(K)}function dn(){return{type:"blockquote",children:[]}}function yt(){return{type:"code",lang:null,meta:null,value:""}}function En(){return{type:"inlineCode",value:""}}function On(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function _n(){return{type:"emphasis",children:[]}}function un(){return{type:"heading",depth:0,children:[]}}function bi(){return{type:"break"}}function hn(){return{type:"html",value:""}}function Tt(){return{type:"image",title:null,url:"",alt:null}}function on(){return{type:"link",title:null,url:"",children:[]}}function Yt(K){return{type:"list",ordered:K.type==="listOrdered",start:null,spread:K._spread,children:[]}}function At(K){return{type:"listItem",spread:K._spread,checked:null,children:[]}}function pn(){return{type:"paragraph",children:[]}}function Vn(){return{type:"strong",children:[]}}function Rt(){return{type:"text",value:""}}function st(){return{type:"thematicBreak"}}}function Rr(e){return{line:e.line,column:e.column,offset:e.offset}}function _S(e,n){let r=-1;for(;++r<n.length;){const l=n[r];Array.isArray(l)?_S(e,l):vk(e,l)}}function vk(e,n){let r;for(r in n)if(ES.call(n,r))switch(r){case"canContainEols":{const l=n[r];l&&e[r].push(...l);break}case"transforms":{const l=n[r];l&&e[r].push(...l);break}case"enter":case"exit":{const l=n[r];l&&Object.assign(e[r],l);break}}}function _y(e,n){throw e?new Error("Cannot close `"+e.type+"` ("+Wl({start:e.start,end:e.end})+"): a different token (`"+n.type+"`, "+Wl({start:n.start,end:n.end})+") is open"):new Error("Cannot close document, a token (`"+n.type+"`, "+Wl({start:n.start,end:n.end})+") is still open")}function Ek(e){const n=this;n.parser=r;function r(l){return bk(l,{...n.data("settings"),...e,extensions:n.data("micromarkExtensions")||[],mdastExtensions:n.data("fromMarkdownExtensions")||[]})}}function _k(e,n){const r={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(n),!0)};return e.patch(n,r),e.applyData(n,r)}function Tk(e,n){const r={type:"element",tagName:"br",properties:{},children:[]};return e.patch(n,r),[e.applyData(n,r),{type:"text",value:`
|
|
14
|
-
`}]}function kk(e,n){const r=n.value?n.value+`
|
|
15
|
-
`:"",l={},o=n.lang?n.lang.split(/\s+/):[];o.length>0&&(l.className=["language-"+o[0]]);let s={type:"element",tagName:"code",properties:l,children:[{type:"text",value:r}]};return n.meta&&(s.data={meta:n.meta}),e.patch(n,s),s=e.applyData(n,s),s={type:"element",tagName:"pre",properties:{},children:[s]},e.patch(n,s),s}function wk(e,n){const r={type:"element",tagName:"del",properties:{},children:e.all(n)};return e.patch(n,r),e.applyData(n,r)}function Ak(e,n){const r={type:"element",tagName:"em",properties:{},children:e.all(n)};return e.patch(n,r),e.applyData(n,r)}function xk(e,n){const r=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",l=String(n.identifier).toUpperCase(),o=tl(l.toLowerCase()),s=e.footnoteOrder.indexOf(l);let c,d=e.footnoteCounts.get(l);d===void 0?(d=0,e.footnoteOrder.push(l),c=e.footnoteOrder.length):c=s+1,d+=1,e.footnoteCounts.set(l,d);const m={type:"element",tagName:"a",properties:{href:"#"+r+"fn-"+o,id:r+"fnref-"+o+(d>1?"-"+d:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(c)}]};e.patch(n,m);const p={type:"element",tagName:"sup",properties:{},children:[m]};return e.patch(n,p),e.applyData(n,p)}function Ok(e,n){const r={type:"element",tagName:"h"+n.depth,properties:{},children:e.all(n)};return e.patch(n,r),e.applyData(n,r)}function Ck(e,n){if(e.options.allowDangerousHtml){const r={type:"raw",value:n.value};return e.patch(n,r),e.applyData(n,r)}}function TS(e,n){const r=n.referenceType;let l="]";if(r==="collapsed"?l+="[]":r==="full"&&(l+="["+(n.label||n.identifier)+"]"),n.type==="imageReference")return[{type:"text",value:"!["+n.alt+l}];const o=e.all(n),s=o[0];s&&s.type==="text"?s.value="["+s.value:o.unshift({type:"text",value:"["});const c=o[o.length-1];return c&&c.type==="text"?c.value+=l:o.push({type:"text",value:l}),o}function zk(e,n){const r=String(n.identifier).toUpperCase(),l=e.definitionById.get(r);if(!l)return TS(e,n);const o={src:tl(l.url||""),alt:n.alt};l.title!==null&&l.title!==void 0&&(o.title=l.title);const s={type:"element",tagName:"img",properties:o,children:[]};return e.patch(n,s),e.applyData(n,s)}function Nk(e,n){const r={src:tl(n.url)};n.alt!==null&&n.alt!==void 0&&(r.alt=n.alt),n.title!==null&&n.title!==void 0&&(r.title=n.title);const l={type:"element",tagName:"img",properties:r,children:[]};return e.patch(n,l),e.applyData(n,l)}function Rk(e,n){const r={type:"text",value:n.value.replace(/\r?\n|\r/g," ")};e.patch(n,r);const l={type:"element",tagName:"code",properties:{},children:[r]};return e.patch(n,l),e.applyData(n,l)}function Dk(e,n){const r=String(n.identifier).toUpperCase(),l=e.definitionById.get(r);if(!l)return TS(e,n);const o={href:tl(l.url||"")};l.title!==null&&l.title!==void 0&&(o.title=l.title);const s={type:"element",tagName:"a",properties:o,children:e.all(n)};return e.patch(n,s),e.applyData(n,s)}function Mk(e,n){const r={href:tl(n.url)};n.title!==null&&n.title!==void 0&&(r.title=n.title);const l={type:"element",tagName:"a",properties:r,children:e.all(n)};return e.patch(n,l),e.applyData(n,l)}function Ik(e,n,r){const l=e.all(n),o=r?Lk(r):kS(n),s={},c=[];if(typeof n.checked=="boolean"){const y=l[0];let g;y&&y.type==="element"&&y.tagName==="p"?g=y:(g={type:"element",tagName:"p",properties:{},children:[]},l.unshift(g)),g.children.length>0&&g.children.unshift({type:"text",value:" "}),g.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:n.checked,disabled:!0},children:[]}),s.className=["task-list-item"]}let d=-1;for(;++d<l.length;){const y=l[d];(o||d!==0||y.type!=="element"||y.tagName!=="p")&&c.push({type:"text",value:`
|
|
16
|
-
`}),y.type==="element"&&y.tagName==="p"&&!o?c.push(...y.children):c.push(y)}const m=l[l.length-1];m&&(o||m.type!=="element"||m.tagName!=="p")&&c.push({type:"text",value:`
|
|
17
|
-
`});const p={type:"element",tagName:"li",properties:s,children:c};return e.patch(n,p),e.applyData(n,p)}function Lk(e){let n=!1;if(e.type==="list"){n=e.spread||!1;const r=e.children;let l=-1;for(;!n&&++l<r.length;)n=kS(r[l])}return n}function kS(e){const n=e.spread;return n??e.children.length>1}function Uk(e,n){const r={},l=e.all(n);let o=-1;for(typeof n.start=="number"&&n.start!==1&&(r.start=n.start);++o<l.length;){const c=l[o];if(c.type==="element"&&c.tagName==="li"&&c.properties&&Array.isArray(c.properties.className)&&c.properties.className.includes("task-list-item")){r.className=["contains-task-list"];break}}const s={type:"element",tagName:n.ordered?"ol":"ul",properties:r,children:e.wrap(l,!0)};return e.patch(n,s),e.applyData(n,s)}function jk(e,n){const r={type:"element",tagName:"p",properties:{},children:e.all(n)};return e.patch(n,r),e.applyData(n,r)}function Bk(e,n){const r={type:"root",children:e.wrap(e.all(n))};return e.patch(n,r),e.applyData(n,r)}function qk(e,n){const r={type:"element",tagName:"strong",properties:{},children:e.all(n)};return e.patch(n,r),e.applyData(n,r)}function Hk(e,n){const r=e.all(n),l=r.shift(),o=[];if(l){const c={type:"element",tagName:"thead",properties:{},children:e.wrap([l],!0)};e.patch(n.children[0],c),o.push(c)}if(r.length>0){const c={type:"element",tagName:"tbody",properties:{},children:e.wrap(r,!0)},d=Ad(n.children[1]),m=iS(n.children[n.children.length-1]);d&&m&&(c.position={start:d,end:m}),o.push(c)}const s={type:"element",tagName:"table",properties:{},children:e.wrap(o,!0)};return e.patch(n,s),e.applyData(n,s)}function Pk(e,n,r){const l=r?r.children:void 0,s=(l?l.indexOf(n):1)===0?"th":"td",c=r&&r.type==="table"?r.align:void 0,d=c?c.length:n.children.length;let m=-1;const p=[];for(;++m<d;){const g=n.children[m],S={},v=c?c[m]:void 0;v&&(S.align=v);let _={type:"element",tagName:s,properties:S,children:[]};g&&(_.children=e.all(g),e.patch(g,_),_=e.applyData(g,_)),p.push(_)}const y={type:"element",tagName:"tr",properties:{},children:e.wrap(p,!0)};return e.patch(n,y),e.applyData(n,y)}function Zk(e,n){const r={type:"element",tagName:"td",properties:{},children:e.all(n)};return e.patch(n,r),e.applyData(n,r)}const Ty=9,ky=32;function Gk(e){const n=String(e),r=/\r?\n|\r/g;let l=r.exec(n),o=0;const s=[];for(;l;)s.push(wy(n.slice(o,l.index),o>0,!0),l[0]),o=l.index+l[0].length,l=r.exec(n);return s.push(wy(n.slice(o),o>0,!1)),s.join("")}function wy(e,n,r){let l=0,o=e.length;if(n){let s=e.codePointAt(l);for(;s===Ty||s===ky;)l++,s=e.codePointAt(l)}if(r){let s=e.codePointAt(o-1);for(;s===Ty||s===ky;)o--,s=e.codePointAt(o-1)}return o>l?e.slice(l,o):""}function Vk(e,n){const r={type:"text",value:Gk(String(n.value))};return e.patch(n,r),e.applyData(n,r)}function $k(e,n){const r={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(n,r),e.applyData(n,r)}const Yk={blockquote:_k,break:Tk,code:kk,delete:wk,emphasis:Ak,footnoteReference:xk,heading:Ok,html:Ck,imageReference:zk,image:Nk,inlineCode:Rk,linkReference:Dk,link:Mk,listItem:Ik,list:Uk,paragraph:jk,root:Bk,strong:qk,table:Hk,tableCell:Zk,tableRow:Pk,text:Vk,thematicBreak:$k,toml:To,yaml:To,definition:To,footnoteDefinition:To};function To(){}const wS=-1,Jo=0,tu=1,Bo=2,Dd=3,Md=4,Id=5,Ld=6,AS=7,xS=8,OS=typeof self=="object"?self:globalThis,Ay=(e,n)=>{switch(e){case"Function":case"SharedWorker":case"Worker":case"eval":case"setInterval":case"setTimeout":throw new TypeError("unable to deserialize "+e)}return new OS[e](n)},Fk=(e,n)=>{const r=(o,s)=>(e.set(s,o),o),l=o=>{if(e.has(o))return e.get(o);const[s,c]=n[o];switch(s){case Jo:case wS:return r(c,o);case tu:{const d=r([],o);for(const m of c)d.push(l(m));return d}case Bo:{const d=r({},o);for(const[m,p]of c)d[l(m)]=l(p);return d}case Dd:return r(new Date(c),o);case Md:{const{source:d,flags:m}=c;return r(new RegExp(d,m),o)}case Id:{const d=r(new Map,o);for(const[m,p]of c)d.set(l(m),l(p));return d}case Ld:{const d=r(new Set,o);for(const m of c)d.add(l(m));return d}case AS:{const{name:d,message:m}=c;return r(typeof OS[d]=="function"?Ay(d,m):new Error(m),o)}case xS:return r(BigInt(c),o);case"BigInt":return r(Object(BigInt(c)),o);case"ArrayBuffer":return r(new Uint8Array(c).buffer,c);case"DataView":{const{buffer:d}=new Uint8Array(c);return r(new DataView(d),c)}}return r(Ay(s,c),o)};return l},xy=e=>Fk(new Map,e)(0),aa="",{toString:Kk}={},{keys:Xk}=Object,Kl=e=>{const n=typeof e;if(n!=="object"||!e)return[Jo,n];const r=Kk.call(e).slice(8,-1);switch(r){case"Array":return[tu,aa];case"Object":return[Bo,aa];case"Date":return[Dd,aa];case"RegExp":return[Md,aa];case"Map":return[Id,aa];case"Set":return[Ld,aa];case"DataView":return[tu,r]}return r.includes("Array")?[tu,r]:e instanceof Error?[AS,e.name||"Error"]:[Bo,r]},ko=([e,n])=>e===Jo&&(n==="function"||n==="symbol"),Qk=(e,n,r,l)=>{const o=(c,d)=>{const m=l.push(c)-1;return r.set(d,m),m},s=c=>{if(r.has(c))return r.get(c);let[d,m]=Kl(c);switch(d){case Jo:{let y=c;switch(m){case"bigint":d=xS,y=c.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+m);y=null;break;case"undefined":return o([wS],c)}return o([d,y],c)}case tu:{if(m){let S=c;return m==="DataView"?S=new Uint8Array(c.buffer):m==="ArrayBuffer"&&(S=new Uint8Array(c)),o([m,[...S]],c)}const y=[],g=o([d,y],c);for(const S of c)y.push(s(S));return g}case Bo:{if(m)switch(m){case"BigInt":return o([m,c.toString()],c);case"Boolean":case"Number":case"String":return o([m,c.valueOf()],c)}if(n&&"toJSON"in c)return s(c.toJSON());const y=[],g=o([d,y],c);for(const S of Xk(c))(e||!ko(Kl(c[S])))&&y.push([s(S),s(c[S])]);return g}case Dd:return o([d,isNaN(c.getTime())?aa:c.toISOString()],c);case Md:{const{source:y,flags:g}=c;return o([d,{source:y,flags:g}],c)}case Id:{const y=[],g=o([d,y],c);for(const[S,v]of c)(e||!(ko(Kl(S))||ko(Kl(v))))&&y.push([s(S),s(v)]);return g}case Ld:{const y=[],g=o([d,y],c);for(const S of c)(e||!ko(Kl(S)))&&y.push(s(S));return g}}const{message:p}=c;return o([d,{name:m,message:p}],c)};return s},Oy=(e,{json:n,lossy:r}={})=>{const l=[];return Qk(!(n||r),!!n,new Map,l)(e),l},qo=typeof structuredClone=="function"?(e,n)=>n&&("json"in n||"lossy"in n)?xy(Oy(e,n)):structuredClone(e):(e,n)=>xy(Oy(e,n));function Jk(e,n){const r=[{type:"text",value:"↩"}];return n>1&&r.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(n)}]}),r}function Wk(e,n){return"Back to reference "+(e+1)+(n>1?"-"+n:"")}function ew(e){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=e.options.footnoteBackContent||Jk,l=e.options.footnoteBackLabel||Wk,o=e.options.footnoteLabel||"Footnotes",s=e.options.footnoteLabelTagName||"h2",c=e.options.footnoteLabelProperties||{className:["sr-only"]},d=[];let m=-1;for(;++m<e.footnoteOrder.length;){const p=e.footnoteById.get(e.footnoteOrder[m]);if(!p)continue;const y=e.all(p),g=String(p.identifier).toUpperCase(),S=tl(g.toLowerCase());let v=0;const _=[],N=e.footnoteCounts.get(g);for(;N!==void 0&&++v<=N;){_.length>0&&_.push({type:"text",value:" "});let V=typeof r=="string"?r:r(m,v);typeof V=="string"&&(V={type:"text",value:V}),_.push({type:"element",tagName:"a",properties:{href:"#"+n+"fnref-"+S+(v>1?"-"+v:""),dataFootnoteBackref:"",ariaLabel:typeof l=="string"?l:l(m,v),className:["data-footnote-backref"]},children:Array.isArray(V)?V:[V]})}const M=y[y.length-1];if(M&&M.type==="element"&&M.tagName==="p"){const V=M.children[M.children.length-1];V&&V.type==="text"?V.value+=" ":M.children.push({type:"text",value:" "}),M.children.push(..._)}else y.push(..._);const A={type:"element",tagName:"li",properties:{id:n+"fn-"+S},children:e.wrap(y,!0)};e.patch(p,A),d.push(A)}if(d.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:s,properties:{...qo(c),id:"footnote-label"},children:[{type:"text",value:o}]},{type:"text",value:`
|
|
18
|
-
`},{type:"element",tagName:"ol",properties:{},children:e.wrap(d,!0)},{type:"text",value:`
|
|
19
|
-
`}]}}const Wo=(function(e){if(e==null)return rw;if(typeof e=="function")return es(e);if(typeof e=="object")return Array.isArray(e)?tw(e):nw(e);if(typeof e=="string")return iw(e);throw new Error("Expected function, string, or object as test")});function tw(e){const n=[];let r=-1;for(;++r<e.length;)n[r]=Wo(e[r]);return es(l);function l(...o){let s=-1;for(;++s<n.length;)if(n[s].apply(this,o))return!0;return!1}}function nw(e){const n=e;return es(r);function r(l){const o=l;let s;for(s in e)if(o[s]!==n[s])return!1;return!0}}function iw(e){return es(n);function n(r){return r&&r.type===e}}function es(e){return n;function n(r,l,o){return!!(aw(r)&&e.call(this,r,typeof l=="number"?l:void 0,o||void 0))}}function rw(){return!0}function aw(e){return e!==null&&typeof e=="object"&&"type"in e}const CS=[],lw=!0,ud=!1,uw="skip";function zS(e,n,r,l){let o;typeof n=="function"&&typeof r!="function"?(l=r,r=n):o=n;const s=Wo(o),c=l?-1:1;d(e,void 0,[])();function d(m,p,y){const g=m&&typeof m=="object"?m:{};if(typeof g.type=="string"){const v=typeof g.tagName=="string"?g.tagName:typeof g.name=="string"?g.name:void 0;Object.defineProperty(S,"name",{value:"node ("+(m.type+(v?"<"+v+">":""))+")"})}return S;function S(){let v=CS,_,N,M;if((!n||s(m,p,y[y.length-1]||void 0))&&(v=ow(r(m,y)),v[0]===ud))return v;if("children"in m&&m.children){const A=m;if(A.children&&v[0]!==uw)for(N=(l?A.children.length:-1)+c,M=y.concat(A);N>-1&&N<A.children.length;){const V=A.children[N];if(_=d(V,N,M)(),_[0]===ud)return _;N=typeof _[1]=="number"?_[1]:N+c}}return v}}}function ow(e){return Array.isArray(e)?e:typeof e=="number"?[lw,e]:e==null?CS:[e]}function Ud(e,n,r,l){let o,s,c;typeof n=="function"&&typeof r!="function"?(s=void 0,c=n,o=r):(s=n,c=r,o=l),zS(e,s,d,o);function d(m,p){const y=p[p.length-1],g=y?y.children.indexOf(m):void 0;return c(m,g,y)}}const od={}.hasOwnProperty,sw={};function cw(e,n){const r=n||sw,l=new Map,o=new Map,s=new Map,c={...Yk,...r.handlers},d={all:p,applyData:dw,definitionById:l,footnoteById:o,footnoteCounts:s,footnoteOrder:[],handlers:c,one:m,options:r,patch:fw,wrap:pw};return Ud(e,function(y){if(y.type==="definition"||y.type==="footnoteDefinition"){const g=y.type==="definition"?l:o,S=String(y.identifier).toUpperCase();g.has(S)||g.set(S,y)}}),d;function m(y,g){const S=y.type,v=d.handlers[S];if(od.call(d.handlers,S)&&v)return v(d,y,g);if(d.options.passThrough&&d.options.passThrough.includes(S)){if("children"in y){const{children:N,...M}=y,A=qo(M);return A.children=d.all(y),A}return qo(y)}return(d.options.unknownHandler||hw)(d,y,g)}function p(y){const g=[];if("children"in y){const S=y.children;let v=-1;for(;++v<S.length;){const _=d.one(S[v],y);if(_){if(v&&S[v-1].type==="break"&&(!Array.isArray(_)&&_.type==="text"&&(_.value=Cy(_.value)),!Array.isArray(_)&&_.type==="element")){const N=_.children[0];N&&N.type==="text"&&(N.value=Cy(N.value))}Array.isArray(_)?g.push(..._):g.push(_)}}}return g}}function fw(e,n){e.position&&(n.position=W_(e))}function dw(e,n){let r=n;if(e&&e.data){const l=e.data.hName,o=e.data.hChildren,s=e.data.hProperties;if(typeof l=="string")if(r.type==="element")r.tagName=l;else{const c="children"in r?r.children:[r];r={type:"element",tagName:l,properties:{},children:c}}r.type==="element"&&s&&Object.assign(r.properties,qo(s)),"children"in r&&r.children&&o!==null&&o!==void 0&&(r.children=o)}return r}function hw(e,n){const r=n.data||{},l="value"in n&&!(od.call(r,"hProperties")||od.call(r,"hChildren"))?{type:"text",value:n.value}:{type:"element",tagName:"div",properties:{},children:e.all(n)};return e.patch(n,l),e.applyData(n,l)}function pw(e,n){const r=[];let l=-1;for(n&&r.push({type:"text",value:`
|
|
20
|
-
`});++l<e.length;)l&&r.push({type:"text",value:`
|
|
21
|
-
`}),r.push(e[l]);return n&&e.length>0&&r.push({type:"text",value:`
|
|
22
|
-
`}),r}function Cy(e){let n=0,r=e.charCodeAt(n);for(;r===9||r===32;)n++,r=e.charCodeAt(n);return e.slice(n)}function zy(e,n){const r=cw(e,n),l=r.one(e,void 0),o=ew(r),s=Array.isArray(l)?{type:"root",children:l}:l||{type:"root",children:[]};return o&&s.children.push({type:"text",value:`
|
|
23
|
-
`},o),s}function mw(e,n){return e&&"run"in e?async function(r,l){const o=zy(r,{file:l,...n});await e.run(o,l)}:function(r,l){return zy(r,{file:l,...e||n})}}function Ny(e){if(e)throw e}var Af,Ry;function gw(){if(Ry)return Af;Ry=1;var e=Object.prototype.hasOwnProperty,n=Object.prototype.toString,r=Object.defineProperty,l=Object.getOwnPropertyDescriptor,o=function(p){return typeof Array.isArray=="function"?Array.isArray(p):n.call(p)==="[object Array]"},s=function(p){if(!p||n.call(p)!=="[object Object]")return!1;var y=e.call(p,"constructor"),g=p.constructor&&p.constructor.prototype&&e.call(p.constructor.prototype,"isPrototypeOf");if(p.constructor&&!y&&!g)return!1;var S;for(S in p);return typeof S>"u"||e.call(p,S)},c=function(p,y){r&&y.name==="__proto__"?r(p,y.name,{enumerable:!0,configurable:!0,value:y.newValue,writable:!0}):p[y.name]=y.newValue},d=function(p,y){if(y==="__proto__")if(e.call(p,y)){if(l)return l(p,y).value}else return;return p[y]};return Af=function m(){var p,y,g,S,v,_,N=arguments[0],M=1,A=arguments.length,V=!1;for(typeof N=="boolean"&&(V=N,N=arguments[1]||{},M=2),(N==null||typeof N!="object"&&typeof N!="function")&&(N={});M<A;++M)if(p=arguments[M],p!=null)for(y in p)g=d(N,y),S=d(p,y),N!==S&&(V&&S&&(s(S)||(v=o(S)))?(v?(v=!1,_=g&&o(g)?g:[]):_=g&&s(g)?g:{},c(N,{name:y,newValue:m(V,_,S)})):typeof S<"u"&&c(N,{name:y,newValue:S}));return N},Af}var yw=gw();const xf=Yb(yw);function sd(e){if(typeof e!="object"||e===null)return!1;const n=Object.getPrototypeOf(e);return(n===null||n===Object.prototype||Object.getPrototypeOf(n)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function bw(){const e=[],n={run:r,use:l};return n;function r(...o){let s=-1;const c=o.pop();if(typeof c!="function")throw new TypeError("Expected function as last argument, not "+c);d(null,...o);function d(m,...p){const y=e[++s];let g=-1;if(m){c(m);return}for(;++g<o.length;)(p[g]===null||p[g]===void 0)&&(p[g]=o[g]);o=p,y?Sw(y,d)(...p):c(null,...p)}}function l(o){if(typeof o!="function")throw new TypeError("Expected `middelware` to be a function, not "+o);return e.push(o),n}}function Sw(e,n){let r;return l;function l(...c){const d=e.length>c.length;let m;d&&c.push(o);try{m=e.apply(this,c)}catch(p){const y=p;if(d&&r)throw y;return o(y)}d||(m&&m.then&&typeof m.then=="function"?m.then(s,o):m instanceof Error?o(m):s(m))}function o(c,...d){r||(r=!0,n(c,...d))}function s(c){o(null,c)}}const Di={basename:vw,dirname:Ew,extname:_w,join:Tw,sep:"/"};function vw(e,n){if(n!==void 0&&typeof n!="string")throw new TypeError('"ext" argument must be a string');cu(e);let r=0,l=-1,o=e.length,s;if(n===void 0||n.length===0||n.length>e.length){for(;o--;)if(e.codePointAt(o)===47){if(s){r=o+1;break}}else l<0&&(s=!0,l=o+1);return l<0?"":e.slice(r,l)}if(n===e)return"";let c=-1,d=n.length-1;for(;o--;)if(e.codePointAt(o)===47){if(s){r=o+1;break}}else c<0&&(s=!0,c=o+1),d>-1&&(e.codePointAt(o)===n.codePointAt(d--)?d<0&&(l=o):(d=-1,l=c));return r===l?l=c:l<0&&(l=e.length),e.slice(r,l)}function Ew(e){if(cu(e),e.length===0)return".";let n=-1,r=e.length,l;for(;--r;)if(e.codePointAt(r)===47){if(l){n=r;break}}else l||(l=!0);return n<0?e.codePointAt(0)===47?"/":".":n===1&&e.codePointAt(0)===47?"//":e.slice(0,n)}function _w(e){cu(e);let n=e.length,r=-1,l=0,o=-1,s=0,c;for(;n--;){const d=e.codePointAt(n);if(d===47){if(c){l=n+1;break}continue}r<0&&(c=!0,r=n+1),d===46?o<0?o=n:s!==1&&(s=1):o>-1&&(s=-1)}return o<0||r<0||s===0||s===1&&o===r-1&&o===l+1?"":e.slice(o,r)}function Tw(...e){let n=-1,r;for(;++n<e.length;)cu(e[n]),e[n]&&(r=r===void 0?e[n]:r+"/"+e[n]);return r===void 0?".":kw(r)}function kw(e){cu(e);const n=e.codePointAt(0)===47;let r=ww(e,!n);return r.length===0&&!n&&(r="."),r.length>0&&e.codePointAt(e.length-1)===47&&(r+="/"),n?"/"+r:r}function ww(e,n){let r="",l=0,o=-1,s=0,c=-1,d,m;for(;++c<=e.length;){if(c<e.length)d=e.codePointAt(c);else{if(d===47)break;d=47}if(d===47){if(!(o===c-1||s===1))if(o!==c-1&&s===2){if(r.length<2||l!==2||r.codePointAt(r.length-1)!==46||r.codePointAt(r.length-2)!==46){if(r.length>2){if(m=r.lastIndexOf("/"),m!==r.length-1){m<0?(r="",l=0):(r=r.slice(0,m),l=r.length-1-r.lastIndexOf("/")),o=c,s=0;continue}}else if(r.length>0){r="",l=0,o=c,s=0;continue}}n&&(r=r.length>0?r+"/..":"..",l=2)}else r.length>0?r+="/"+e.slice(o+1,c):r=e.slice(o+1,c),l=c-o-1;o=c,s=0}else d===46&&s>-1?s++:s=-1}return r}function cu(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const Aw={cwd:xw};function xw(){return"/"}function cd(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function Ow(e){if(typeof e=="string")e=new URL(e);else if(!cd(e)){const n=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw n.code="ERR_INVALID_ARG_TYPE",n}if(e.protocol!=="file:"){const n=new TypeError("The URL must be of scheme file");throw n.code="ERR_INVALID_URL_SCHEME",n}return Cw(e)}function Cw(e){if(e.hostname!==""){const l=new TypeError('File URL host must be "localhost" or empty on darwin');throw l.code="ERR_INVALID_FILE_URL_HOST",l}const n=e.pathname;let r=-1;for(;++r<n.length;)if(n.codePointAt(r)===37&&n.codePointAt(r+1)===50){const l=n.codePointAt(r+2);if(l===70||l===102){const o=new TypeError("File URL path must not include encoded / characters");throw o.code="ERR_INVALID_FILE_URL_PATH",o}}return decodeURIComponent(n)}const Of=["history","path","basename","stem","extname","dirname"];class NS{constructor(n){let r;n?cd(n)?r={path:n}:typeof n=="string"||zw(n)?r={value:n}:r=n:r={},this.cwd="cwd"in r?"":Aw.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let l=-1;for(;++l<Of.length;){const s=Of[l];s in r&&r[s]!==void 0&&r[s]!==null&&(this[s]=s==="history"?[...r[s]]:r[s])}let o;for(o in r)Of.includes(o)||(this[o]=r[o])}get basename(){return typeof this.path=="string"?Di.basename(this.path):void 0}set basename(n){zf(n,"basename"),Cf(n,"basename"),this.path=Di.join(this.dirname||"",n)}get dirname(){return typeof this.path=="string"?Di.dirname(this.path):void 0}set dirname(n){Dy(this.basename,"dirname"),this.path=Di.join(n||"",this.basename)}get extname(){return typeof this.path=="string"?Di.extname(this.path):void 0}set extname(n){if(Cf(n,"extname"),Dy(this.dirname,"extname"),n){if(n.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(n.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=Di.join(this.dirname,this.stem+(n||""))}get path(){return this.history[this.history.length-1]}set path(n){cd(n)&&(n=Ow(n)),zf(n,"path"),this.path!==n&&this.history.push(n)}get stem(){return typeof this.path=="string"?Di.basename(this.path,this.extname):void 0}set stem(n){zf(n,"stem"),Cf(n,"stem"),this.path=Di.join(this.dirname||"",n+(this.extname||""))}fail(n,r,l){const o=this.message(n,r,l);throw o.fatal=!0,o}info(n,r,l){const o=this.message(n,r,l);return o.fatal=void 0,o}message(n,r,l){const o=new An(n,r,l);return this.path&&(o.name=this.path+":"+o.name,o.file=this.path),o.fatal=!1,this.messages.push(o),o}toString(n){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(n||void 0).decode(this.value)}}function Cf(e,n){if(e&&e.includes(Di.sep))throw new Error("`"+n+"` cannot be a path: did not expect `"+Di.sep+"`")}function zf(e,n){if(!e)throw new Error("`"+n+"` cannot be empty")}function Dy(e,n){if(!e)throw new Error("Setting `"+n+"` requires `path` to be set too")}function zw(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const Nw=(function(e){const l=this.constructor.prototype,o=l[e],s=function(){return o.apply(s,arguments)};return Object.setPrototypeOf(s,l),s}),Rw={}.hasOwnProperty;class jd extends Nw{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=bw()}copy(){const n=new jd;let r=-1;for(;++r<this.attachers.length;){const l=this.attachers[r];n.use(...l)}return n.data(xf(!0,{},this.namespace)),n}data(n,r){return typeof n=="string"?arguments.length===2?(Df("data",this.frozen),this.namespace[n]=r,this):Rw.call(this.namespace,n)&&this.namespace[n]||void 0:n?(Df("data",this.frozen),this.namespace=n,this):this.namespace}freeze(){if(this.frozen)return this;const n=this;for(;++this.freezeIndex<this.attachers.length;){const[r,...l]=this.attachers[this.freezeIndex];if(l[0]===!1)continue;l[0]===!0&&(l[0]=void 0);const o=r.call(n,...l);typeof o=="function"&&this.transformers.use(o)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(n){this.freeze();const r=wo(n),l=this.parser||this.Parser;return Nf("parse",l),l(String(r),r)}process(n,r){const l=this;return this.freeze(),Nf("process",this.parser||this.Parser),Rf("process",this.compiler||this.Compiler),r?o(void 0,r):new Promise(o);function o(s,c){const d=wo(n),m=l.parse(d);l.run(m,d,function(y,g,S){if(y||!g||!S)return p(y);const v=g,_=l.stringify(v,S);Iw(_)?S.value=_:S.result=_,p(y,S)});function p(y,g){y||!g?c(y):s?s(g):r(void 0,g)}}}processSync(n){let r=!1,l;return this.freeze(),Nf("processSync",this.parser||this.Parser),Rf("processSync",this.compiler||this.Compiler),this.process(n,o),Iy("processSync","process",r),l;function o(s,c){r=!0,Ny(s),l=c}}run(n,r,l){My(n),this.freeze();const o=this.transformers;return!l&&typeof r=="function"&&(l=r,r=void 0),l?s(void 0,l):new Promise(s);function s(c,d){const m=wo(r);o.run(n,m,p);function p(y,g,S){const v=g||n;y?d(y):c?c(v):l(void 0,v,S)}}}runSync(n,r){let l=!1,o;return this.run(n,r,s),Iy("runSync","run",l),o;function s(c,d){Ny(c),o=d,l=!0}}stringify(n,r){this.freeze();const l=wo(r),o=this.compiler||this.Compiler;return Rf("stringify",o),My(n),o(n,l)}use(n,...r){const l=this.attachers,o=this.namespace;if(Df("use",this.frozen),n!=null)if(typeof n=="function")m(n,r);else if(typeof n=="object")Array.isArray(n)?d(n):c(n);else throw new TypeError("Expected usable value, not `"+n+"`");return this;function s(p){if(typeof p=="function")m(p,[]);else if(typeof p=="object")if(Array.isArray(p)){const[y,...g]=p;m(y,g)}else c(p);else throw new TypeError("Expected usable value, not `"+p+"`")}function c(p){if(!("plugins"in p)&&!("settings"in p))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");d(p.plugins),p.settings&&(o.settings=xf(!0,o.settings,p.settings))}function d(p){let y=-1;if(p!=null)if(Array.isArray(p))for(;++y<p.length;){const g=p[y];s(g)}else throw new TypeError("Expected a list of plugins, not `"+p+"`")}function m(p,y){let g=-1,S=-1;for(;++g<l.length;)if(l[g][0]===p){S=g;break}if(S===-1)l.push([p,...y]);else if(y.length>0){let[v,..._]=y;const N=l[S][1];sd(N)&&sd(v)&&(v=xf(!0,N,v)),l[S]=[p,v,..._]}}}}const Dw=new jd().freeze();function Nf(e,n){if(typeof n!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function Rf(e,n){if(typeof n!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function Df(e,n){if(n)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function My(e){if(!sd(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function Iy(e,n,r){if(!r)throw new Error("`"+e+"` finished async. Use `"+n+"` instead")}function wo(e){return Mw(e)?e:new NS(e)}function Mw(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function Iw(e){return typeof e=="string"||Lw(e)}function Lw(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const Uw="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",Ly=[],Uy={allowDangerousHtml:!0},jw=/^(https?|ircs?|mailto|xmpp)$/i,Bw=[{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:"className",id:"remove-classname"},{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 qw(e){const n=Hw(e),r=Pw(e);return Zw(n.runSync(n.parse(r),r),e)}function Hw(e){const n=e.rehypePlugins||Ly,r=e.remarkPlugins||Ly,l=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...Uy}:Uy;return Dw().use(Ek).use(r).use(mw,l).use(n)}function Pw(e){const n=e.children||"",r=new NS;return typeof n=="string"&&(r.value=n),r}function Zw(e,n){const r=n.allowedElements,l=n.allowElement,o=n.components,s=n.disallowedElements,c=n.skipHtml,d=n.unwrapDisallowed,m=n.urlTransform||Gw;for(const y of Bw)Object.hasOwn(n,y.from)&&(""+y.from+(y.to?"use `"+y.to+"` instead":"remove it")+Uw+y.id,void 0);return Ud(e,p),r1(e,{Fragment:O.Fragment,components:o,ignoreInvalidStyle:!0,jsx:O.jsx,jsxs:O.jsxs,passKeys:!0,passNode:!0});function p(y,g,S){if(y.type==="raw"&&S&&typeof g=="number")return c?S.children.splice(g,1):S.children[g]={type:"text",value:y.value},g;if(y.type==="element"){let v;for(v in Tf)if(Object.hasOwn(Tf,v)&&Object.hasOwn(y.properties,v)){const _=y.properties[v],N=Tf[v];(N===null||N.includes(y.tagName))&&(y.properties[v]=m(String(_||""),v,y))}}if(y.type==="element"){let v=r?!r.includes(y.tagName):s?s.includes(y.tagName):!1;if(!v&&l&&typeof g=="number"&&(v=!l(y,g,S)),v&&S&&typeof g=="number")return d&&y.children?S.children.splice(g,1,...y.children):S.children.splice(g,1),g}}}function Gw(e){const n=e.indexOf(":"),r=e.indexOf("?"),l=e.indexOf("#"),o=e.indexOf("/");return n===-1||o!==-1&&n>o||r!==-1&&n>r||l!==-1&&n>l||jw.test(e.slice(0,n))?e:""}function jy(e,n){const r=String(e);if(typeof n!="string")throw new TypeError("Expected character");let l=0,o=r.indexOf(n);for(;o!==-1;)l++,o=r.indexOf(n,o+n.length);return l}function Vw(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function $w(e,n,r){const o=Wo((r||{}).ignore||[]),s=Yw(n);let c=-1;for(;++c<s.length;)zS(e,"text",d);function d(p,y){let g=-1,S;for(;++g<y.length;){const v=y[g],_=S?S.children:void 0;if(o(v,_?_.indexOf(v):void 0,S))return;S=v}if(S)return m(p,y)}function m(p,y){const g=y[y.length-1],S=s[c][0],v=s[c][1];let _=0;const M=g.children.indexOf(p);let A=!1,V=[];S.lastIndex=0;let j=S.exec(p.value);for(;j;){const ae=j.index,ue={index:j.index,input:j.input,stack:[...y,p]};let D=v(...j,ue);if(typeof D=="string"&&(D=D.length>0?{type:"text",value:D}:void 0),D===!1?S.lastIndex=ae+1:(_!==ae&&V.push({type:"text",value:p.value.slice(_,ae)}),Array.isArray(D)?V.push(...D):D&&V.push(D),_=ae+j[0].length,A=!0),!S.global)break;j=S.exec(p.value)}return A?(_<p.value.length&&V.push({type:"text",value:p.value.slice(_)}),g.children.splice(M,1,...V)):V=[p],M+V.length}}function Yw(e){const n=[];if(!Array.isArray(e))throw new TypeError("Expected find and replace tuple or list of tuples");const r=!e[0]||Array.isArray(e[0])?e:[e];let l=-1;for(;++l<r.length;){const o=r[l];n.push([Fw(o[0]),Kw(o[1])])}return n}function Fw(e){return typeof e=="string"?new RegExp(Vw(e),"g"):e}function Kw(e){return typeof e=="function"?e:function(){return e}}const Mf="phrasing",If=["autolink","link","image","label"];function Xw(){return{transforms:[iA],enter:{literalAutolink:Jw,literalAutolinkEmail:Lf,literalAutolinkHttp:Lf,literalAutolinkWww:Lf},exit:{literalAutolink:nA,literalAutolinkEmail:tA,literalAutolinkHttp:Ww,literalAutolinkWww:eA}}}function Qw(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:Mf,notInConstruct:If},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:Mf,notInConstruct:If},{character:":",before:"[ps]",after:"\\/",inConstruct:Mf,notInConstruct:If}]}}function Jw(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function Lf(e){this.config.enter.autolinkProtocol.call(this,e)}function Ww(e){this.config.exit.autolinkProtocol.call(this,e)}function eA(e){this.config.exit.data.call(this,e);const n=this.stack[this.stack.length-1];n.type,n.url="http://"+this.sliceSerialize(e)}function tA(e){this.config.exit.autolinkEmail.call(this,e)}function nA(e){this.exit(e)}function iA(e){$w(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,rA],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),aA]],{ignore:["link","linkReference"]})}function rA(e,n,r,l,o){let s="";if(!RS(o)||(/^w/i.test(n)&&(r=n+r,n="",s="http://"),!lA(r)))return!1;const c=uA(r+l);if(!c[0])return!1;const d={type:"link",title:null,url:s+n+c[0],children:[{type:"text",value:n+c[0]}]};return c[1]?[d,{type:"text",value:c[1]}]:d}function aA(e,n,r,l){return!RS(l,!0)||/[-\d_]$/.test(r)?!1:{type:"link",title:null,url:"mailto:"+n+"@"+r,children:[{type:"text",value:n+"@"+r}]}}function lA(e){const n=e.split(".");return!(n.length<2||n[n.length-1]&&(/_/.test(n[n.length-1])||!/[a-zA-Z\d]/.test(n[n.length-1]))||n[n.length-2]&&(/_/.test(n[n.length-2])||!/[a-zA-Z\d]/.test(n[n.length-2])))}function uA(e){const n=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!n)return[e,void 0];e=e.slice(0,n.index);let r=n[0],l=r.indexOf(")");const o=jy(e,"(");let s=jy(e,")");for(;l!==-1&&o>s;)e+=r.slice(0,l+1),r=r.slice(l+1),l=r.indexOf(")"),s++;return[e,r]}function RS(e,n){const r=e.input.charCodeAt(e.index-1);return(e.index===0||ua(r)||Xo(r))&&(!n||r!==47)}DS.peek=gA;function oA(){this.buffer()}function sA(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function cA(){this.buffer()}function fA(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function dA(e){const n=this.resume(),r=this.stack[this.stack.length-1];r.type,r.identifier=ki(this.sliceSerialize(e)).toLowerCase(),r.label=n}function hA(e){this.exit(e)}function pA(e){const n=this.resume(),r=this.stack[this.stack.length-1];r.type,r.identifier=ki(this.sliceSerialize(e)).toLowerCase(),r.label=n}function mA(e){this.exit(e)}function gA(){return"["}function DS(e,n,r,l){const o=r.createTracker(l);let s=o.move("[^");const c=r.enter("footnoteReference"),d=r.enter("reference");return s+=o.move(r.safe(r.associationId(e),{after:"]",before:s})),d(),c(),s+=o.move("]"),s}function yA(){return{enter:{gfmFootnoteCallString:oA,gfmFootnoteCall:sA,gfmFootnoteDefinitionLabelString:cA,gfmFootnoteDefinition:fA},exit:{gfmFootnoteCallString:dA,gfmFootnoteCall:hA,gfmFootnoteDefinitionLabelString:pA,gfmFootnoteDefinition:mA}}}function bA(e){let n=!1;return e&&e.firstLineBlank&&(n=!0),{handlers:{footnoteDefinition:r,footnoteReference:DS},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function r(l,o,s,c){const d=s.createTracker(c);let m=d.move("[^");const p=s.enter("footnoteDefinition"),y=s.enter("label");return m+=d.move(s.safe(s.associationId(l),{before:m,after:"]"})),y(),m+=d.move("]:"),l.children&&l.children.length>0&&(d.shift(4),m+=d.move((n?`
|
|
24
|
-
`:" ")+s.indentLines(s.containerFlow(l,d.current()),n?MS:SA))),p(),m}}function SA(e,n,r){return n===0?e:MS(e,n,r)}function MS(e,n,r){return(r?"":" ")+e}const vA=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];IS.peek=wA;function EA(){return{canContainEols:["delete"],enter:{strikethrough:TA},exit:{strikethrough:kA}}}function _A(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:vA}],handlers:{delete:IS}}}function TA(e){this.enter({type:"delete",children:[]},e)}function kA(e){this.exit(e)}function IS(e,n,r,l){const o=r.createTracker(l),s=r.enter("strikethrough");let c=o.move("~~");return c+=r.containerPhrasing(e,{...o.current(),before:c,after:"~"}),c+=o.move("~~"),s(),c}function wA(){return"~"}function AA(e){return e.length}function xA(e,n){const r=n||{},l=(r.align||[]).concat(),o=r.stringLength||AA,s=[],c=[],d=[],m=[];let p=0,y=-1;for(;++y<e.length;){const N=[],M=[];let A=-1;for(e[y].length>p&&(p=e[y].length);++A<e[y].length;){const V=OA(e[y][A]);if(r.alignDelimiters!==!1){const j=o(V);M[A]=j,(m[A]===void 0||j>m[A])&&(m[A]=j)}N.push(V)}c[y]=N,d[y]=M}let g=-1;if(typeof l=="object"&&"length"in l)for(;++g<p;)s[g]=By(l[g]);else{const N=By(l);for(;++g<p;)s[g]=N}g=-1;const S=[],v=[];for(;++g<p;){const N=s[g];let M="",A="";N===99?(M=":",A=":"):N===108?M=":":N===114&&(A=":");let V=r.alignDelimiters===!1?1:Math.max(1,m[g]-M.length-A.length);const j=M+"-".repeat(V)+A;r.alignDelimiters!==!1&&(V=M.length+V+A.length,V>m[g]&&(m[g]=V),v[g]=V),S[g]=j}c.splice(1,0,S),d.splice(1,0,v),y=-1;const _=[];for(;++y<c.length;){const N=c[y],M=d[y];g=-1;const A=[];for(;++g<p;){const V=N[g]||"";let j="",ae="";if(r.alignDelimiters!==!1){const ue=m[g]-(M[g]||0),D=s[g];D===114?j=" ".repeat(ue):D===99?ue%2?(j=" ".repeat(ue/2+.5),ae=" ".repeat(ue/2-.5)):(j=" ".repeat(ue/2),ae=j):ae=" ".repeat(ue)}r.delimiterStart!==!1&&!g&&A.push("|"),r.padding!==!1&&!(r.alignDelimiters===!1&&V==="")&&(r.delimiterStart!==!1||g)&&A.push(" "),r.alignDelimiters!==!1&&A.push(j),A.push(V),r.alignDelimiters!==!1&&A.push(ae),r.padding!==!1&&A.push(" "),(r.delimiterEnd!==!1||g!==p-1)&&A.push("|")}_.push(r.delimiterEnd===!1?A.join("").replace(/ +$/,""):A.join(""))}return _.join(`
|
|
25
|
-
`)}function OA(e){return e==null?"":String(e)}function By(e){const n=typeof e=="string"?e.codePointAt(0):0;return n===67||n===99?99:n===76||n===108?108:n===82||n===114?114:0}function CA(e,n,r,l){const o=r.enter("blockquote"),s=r.createTracker(l);s.move("> "),s.shift(2);const c=r.indentLines(r.containerFlow(e,s.current()),zA);return o(),c}function zA(e,n,r){return">"+(r?"":" ")+e}function NA(e,n){return qy(e,n.inConstruct,!0)&&!qy(e,n.notInConstruct,!1)}function qy(e,n,r){if(typeof n=="string"&&(n=[n]),!n||n.length===0)return r;let l=-1;for(;++l<n.length;)if(e.includes(n[l]))return!0;return!1}function Hy(e,n,r,l){let o=-1;for(;++o<r.unsafe.length;)if(r.unsafe[o].character===`
|
|
26
|
-
`&&NA(r.stack,r.unsafe[o]))return/[ \t]/.test(l.before)?"":" ";return`\\
|
|
27
|
-
`}function RA(e,n){const r=String(e);let l=r.indexOf(n),o=l,s=0,c=0;if(typeof n!="string")throw new TypeError("Expected substring");for(;l!==-1;)l===o?++s>c&&(c=s):s=1,o=l+n.length,l=r.indexOf(n,o);return c}function DA(e,n){return!!(n.options.fences===!1&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}function MA(e){const n=e.options.fence||"`";if(n!=="`"&&n!=="~")throw new Error("Cannot serialize code with `"+n+"` for `options.fence`, expected `` ` `` or `~`");return n}function IA(e,n,r,l){const o=MA(r),s=e.value||"",c=o==="`"?"GraveAccent":"Tilde";if(DA(e,r)){const g=r.enter("codeIndented"),S=r.indentLines(s,LA);return g(),S}const d=r.createTracker(l),m=o.repeat(Math.max(RA(s,o)+1,3)),p=r.enter("codeFenced");let y=d.move(m);if(e.lang){const g=r.enter(`codeFencedLang${c}`);y+=d.move(r.safe(e.lang,{before:y,after:" ",encode:["`"],...d.current()})),g()}if(e.lang&&e.meta){const g=r.enter(`codeFencedMeta${c}`);y+=d.move(" "),y+=d.move(r.safe(e.meta,{before:y,after:`
|
|
28
|
-
`,encode:["`"],...d.current()})),g()}return y+=d.move(`
|
|
29
|
-
`),s&&(y+=d.move(s+`
|
|
30
|
-
`)),y+=d.move(m),p(),y}function LA(e,n,r){return(r?"":" ")+e}function Bd(e){const n=e.options.quote||'"';if(n!=='"'&&n!=="'")throw new Error("Cannot serialize title with `"+n+"` for `options.quote`, expected `\"`, or `'`");return n}function UA(e,n,r,l){const o=Bd(r),s=o==='"'?"Quote":"Apostrophe",c=r.enter("definition");let d=r.enter("label");const m=r.createTracker(l);let p=m.move("[");return p+=m.move(r.safe(r.associationId(e),{before:p,after:"]",...m.current()})),p+=m.move("]: "),d(),!e.url||/[\0- \u007F]/.test(e.url)?(d=r.enter("destinationLiteral"),p+=m.move("<"),p+=m.move(r.safe(e.url,{before:p,after:">",...m.current()})),p+=m.move(">")):(d=r.enter("destinationRaw"),p+=m.move(r.safe(e.url,{before:p,after:e.title?" ":`
|
|
31
|
-
`,...m.current()}))),d(),e.title&&(d=r.enter(`title${s}`),p+=m.move(" "+o),p+=m.move(r.safe(e.title,{before:p,after:o,...m.current()})),p+=m.move(o),d()),c(),p}function jA(e){const n=e.options.emphasis||"*";if(n!=="*"&&n!=="_")throw new Error("Cannot serialize emphasis with `"+n+"` for `options.emphasis`, expected `*`, or `_`");return n}function ru(e){return"&#x"+e.toString(16).toUpperCase()+";"}function Ho(e,n,r){const l=Xa(e),o=Xa(n);return l===void 0?o===void 0?r==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:o===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:l===1?o===void 0?{inside:!1,outside:!1}:o===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:o===void 0?{inside:!1,outside:!1}:o===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}LS.peek=BA;function LS(e,n,r,l){const o=jA(r),s=r.enter("emphasis"),c=r.createTracker(l),d=c.move(o);let m=c.move(r.containerPhrasing(e,{after:o,before:d,...c.current()}));const p=m.charCodeAt(0),y=Ho(l.before.charCodeAt(l.before.length-1),p,o);y.inside&&(m=ru(p)+m.slice(1));const g=m.charCodeAt(m.length-1),S=Ho(l.after.charCodeAt(0),g,o);S.inside&&(m=m.slice(0,-1)+ru(g));const v=c.move(o);return s(),r.attentionEncodeSurroundingInfo={after:S.outside,before:y.outside},d+m+v}function BA(e,n,r){return r.options.emphasis||"*"}function qA(e,n){let r=!1;return Ud(e,function(l){if("value"in l&&/\r?\n|\r/.test(l.value)||l.type==="break")return r=!0,ud}),!!((!e.depth||e.depth<3)&&zd(e)&&(n.options.setext||r))}function HA(e,n,r,l){const o=Math.max(Math.min(6,e.depth||1),1),s=r.createTracker(l);if(qA(e,r)){const y=r.enter("headingSetext"),g=r.enter("phrasing"),S=r.containerPhrasing(e,{...s.current(),before:`
|
|
32
|
-
`,after:`
|
|
33
|
-
`});return g(),y(),S+`
|
|
34
|
-
`+(o===1?"=":"-").repeat(S.length-(Math.max(S.lastIndexOf("\r"),S.lastIndexOf(`
|
|
35
|
-
`))+1))}const c="#".repeat(o),d=r.enter("headingAtx"),m=r.enter("phrasing");s.move(c+" ");let p=r.containerPhrasing(e,{before:"# ",after:`
|
|
36
|
-
`,...s.current()});return/^[\t ]/.test(p)&&(p=ru(p.charCodeAt(0))+p.slice(1)),p=p?c+" "+p:c,r.options.closeAtx&&(p+=" "+c),m(),d(),p}US.peek=PA;function US(e){return e.value||""}function PA(){return"<"}jS.peek=ZA;function jS(e,n,r,l){const o=Bd(r),s=o==='"'?"Quote":"Apostrophe",c=r.enter("image");let d=r.enter("label");const m=r.createTracker(l);let p=m.move("![");return p+=m.move(r.safe(e.alt,{before:p,after:"]",...m.current()})),p+=m.move("]("),d(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(d=r.enter("destinationLiteral"),p+=m.move("<"),p+=m.move(r.safe(e.url,{before:p,after:">",...m.current()})),p+=m.move(">")):(d=r.enter("destinationRaw"),p+=m.move(r.safe(e.url,{before:p,after:e.title?" ":")",...m.current()}))),d(),e.title&&(d=r.enter(`title${s}`),p+=m.move(" "+o),p+=m.move(r.safe(e.title,{before:p,after:o,...m.current()})),p+=m.move(o),d()),p+=m.move(")"),c(),p}function ZA(){return"!"}BS.peek=GA;function BS(e,n,r,l){const o=e.referenceType,s=r.enter("imageReference");let c=r.enter("label");const d=r.createTracker(l);let m=d.move("![");const p=r.safe(e.alt,{before:m,after:"]",...d.current()});m+=d.move(p+"]["),c();const y=r.stack;r.stack=[],c=r.enter("reference");const g=r.safe(r.associationId(e),{before:m,after:"]",...d.current()});return c(),r.stack=y,s(),o==="full"||!p||p!==g?m+=d.move(g+"]"):o==="shortcut"?m=m.slice(0,-1):m+=d.move("]"),m}function GA(){return"!"}qS.peek=VA;function qS(e,n,r){let l=e.value||"",o="`",s=-1;for(;new RegExp("(^|[^`])"+o+"([^`]|$)").test(l);)o+="`";for(/[^ \r\n]/.test(l)&&(/^[ \r\n]/.test(l)&&/[ \r\n]$/.test(l)||/^`|`$/.test(l))&&(l=" "+l+" ");++s<r.unsafe.length;){const c=r.unsafe[s],d=r.compilePattern(c);let m;if(c.atBreak)for(;m=d.exec(l);){let p=m.index;l.charCodeAt(p)===10&&l.charCodeAt(p-1)===13&&p--,l=l.slice(0,p)+" "+l.slice(m.index+1)}}return o+l+o}function VA(){return"`"}function HS(e,n){const r=zd(e);return!!(!n.options.resourceLink&&e.url&&!e.title&&e.children&&e.children.length===1&&e.children[0].type==="text"&&(r===e.url||"mailto:"+r===e.url)&&/^[a-z][a-z+.-]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}PS.peek=$A;function PS(e,n,r,l){const o=Bd(r),s=o==='"'?"Quote":"Apostrophe",c=r.createTracker(l);let d,m;if(HS(e,r)){const y=r.stack;r.stack=[],d=r.enter("autolink");let g=c.move("<");return g+=c.move(r.containerPhrasing(e,{before:g,after:">",...c.current()})),g+=c.move(">"),d(),r.stack=y,g}d=r.enter("link"),m=r.enter("label");let p=c.move("[");return p+=c.move(r.containerPhrasing(e,{before:p,after:"](",...c.current()})),p+=c.move("]("),m(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(m=r.enter("destinationLiteral"),p+=c.move("<"),p+=c.move(r.safe(e.url,{before:p,after:">",...c.current()})),p+=c.move(">")):(m=r.enter("destinationRaw"),p+=c.move(r.safe(e.url,{before:p,after:e.title?" ":")",...c.current()}))),m(),e.title&&(m=r.enter(`title${s}`),p+=c.move(" "+o),p+=c.move(r.safe(e.title,{before:p,after:o,...c.current()})),p+=c.move(o),m()),p+=c.move(")"),d(),p}function $A(e,n,r){return HS(e,r)?"<":"["}ZS.peek=YA;function ZS(e,n,r,l){const o=e.referenceType,s=r.enter("linkReference");let c=r.enter("label");const d=r.createTracker(l);let m=d.move("[");const p=r.containerPhrasing(e,{before:m,after:"]",...d.current()});m+=d.move(p+"]["),c();const y=r.stack;r.stack=[],c=r.enter("reference");const g=r.safe(r.associationId(e),{before:m,after:"]",...d.current()});return c(),r.stack=y,s(),o==="full"||!p||p!==g?m+=d.move(g+"]"):o==="shortcut"?m=m.slice(0,-1):m+=d.move("]"),m}function YA(){return"["}function qd(e){const n=e.options.bullet||"*";if(n!=="*"&&n!=="+"&&n!=="-")throw new Error("Cannot serialize items with `"+n+"` for `options.bullet`, expected `*`, `+`, or `-`");return n}function FA(e){const n=qd(e),r=e.options.bulletOther;if(!r)return n==="*"?"-":"*";if(r!=="*"&&r!=="+"&&r!=="-")throw new Error("Cannot serialize items with `"+r+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(r===n)throw new Error("Expected `bullet` (`"+n+"`) and `bulletOther` (`"+r+"`) to be different");return r}function KA(e){const n=e.options.bulletOrdered||".";if(n!=="."&&n!==")")throw new Error("Cannot serialize items with `"+n+"` for `options.bulletOrdered`, expected `.` or `)`");return n}function GS(e){const n=e.options.rule||"*";if(n!=="*"&&n!=="-"&&n!=="_")throw new Error("Cannot serialize rules with `"+n+"` for `options.rule`, expected `*`, `-`, or `_`");return n}function XA(e,n,r,l){const o=r.enter("list"),s=r.bulletCurrent;let c=e.ordered?KA(r):qd(r);const d=e.ordered?c==="."?")":".":FA(r);let m=n&&r.bulletLastUsed?c===r.bulletLastUsed:!1;if(!e.ordered){const y=e.children?e.children[0]:void 0;if((c==="*"||c==="-")&&y&&(!y.children||!y.children[0])&&r.stack[r.stack.length-1]==="list"&&r.stack[r.stack.length-2]==="listItem"&&r.stack[r.stack.length-3]==="list"&&r.stack[r.stack.length-4]==="listItem"&&r.indexStack[r.indexStack.length-1]===0&&r.indexStack[r.indexStack.length-2]===0&&r.indexStack[r.indexStack.length-3]===0&&(m=!0),GS(r)===c&&y){let g=-1;for(;++g<e.children.length;){const S=e.children[g];if(S&&S.type==="listItem"&&S.children&&S.children[0]&&S.children[0].type==="thematicBreak"){m=!0;break}}}}m&&(c=d),r.bulletCurrent=c;const p=r.containerFlow(e,l);return r.bulletLastUsed=c,r.bulletCurrent=s,o(),p}function QA(e){const n=e.options.listItemIndent||"one";if(n!=="tab"&&n!=="one"&&n!=="mixed")throw new Error("Cannot serialize items with `"+n+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return n}function JA(e,n,r,l){const o=QA(r);let s=r.bulletCurrent||qd(r);n&&n.type==="list"&&n.ordered&&(s=(typeof n.start=="number"&&n.start>-1?n.start:1)+(r.options.incrementListMarker===!1?0:n.children.indexOf(e))+s);let c=s.length+1;(o==="tab"||o==="mixed"&&(n&&n.type==="list"&&n.spread||e.spread))&&(c=Math.ceil(c/4)*4);const d=r.createTracker(l);d.move(s+" ".repeat(c-s.length)),d.shift(c);const m=r.enter("listItem"),p=r.indentLines(r.containerFlow(e,d.current()),y);return m(),p;function y(g,S,v){return S?(v?"":" ".repeat(c))+g:(v?s:s+" ".repeat(c-s.length))+g}}function WA(e,n,r,l){const o=r.enter("paragraph"),s=r.enter("phrasing"),c=r.containerPhrasing(e,l);return s(),o(),c}const ex=Wo(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function tx(e,n,r,l){return(e.children.some(function(c){return ex(c)})?r.containerPhrasing:r.containerFlow).call(r,e,l)}function nx(e){const n=e.options.strong||"*";if(n!=="*"&&n!=="_")throw new Error("Cannot serialize strong with `"+n+"` for `options.strong`, expected `*`, or `_`");return n}VS.peek=ix;function VS(e,n,r,l){const o=nx(r),s=r.enter("strong"),c=r.createTracker(l),d=c.move(o+o);let m=c.move(r.containerPhrasing(e,{after:o,before:d,...c.current()}));const p=m.charCodeAt(0),y=Ho(l.before.charCodeAt(l.before.length-1),p,o);y.inside&&(m=ru(p)+m.slice(1));const g=m.charCodeAt(m.length-1),S=Ho(l.after.charCodeAt(0),g,o);S.inside&&(m=m.slice(0,-1)+ru(g));const v=c.move(o+o);return s(),r.attentionEncodeSurroundingInfo={after:S.outside,before:y.outside},d+m+v}function ix(e,n,r){return r.options.strong||"*"}function rx(e,n,r,l){return r.safe(e.value,l)}function ax(e){const n=e.options.ruleRepetition||3;if(n<3)throw new Error("Cannot serialize rules with repetition `"+n+"` for `options.ruleRepetition`, expected `3` or more");return n}function lx(e,n,r){const l=(GS(r)+(r.options.ruleSpaces?" ":"")).repeat(ax(r));return r.options.ruleSpaces?l.slice(0,-1):l}const $S={blockquote:CA,break:Hy,code:IA,definition:UA,emphasis:LS,hardBreak:Hy,heading:HA,html:US,image:jS,imageReference:BS,inlineCode:qS,link:PS,linkReference:ZS,list:XA,listItem:JA,paragraph:WA,root:tx,strong:VS,text:rx,thematicBreak:lx};function ux(){return{enter:{table:ox,tableData:Py,tableHeader:Py,tableRow:cx},exit:{codeText:fx,table:sx,tableData:Uf,tableHeader:Uf,tableRow:Uf}}}function ox(e){const n=e._align;this.enter({type:"table",align:n.map(function(r){return r==="none"?null:r}),children:[]},e),this.data.inTable=!0}function sx(e){this.exit(e),this.data.inTable=void 0}function cx(e){this.enter({type:"tableRow",children:[]},e)}function Uf(e){this.exit(e)}function Py(e){this.enter({type:"tableCell",children:[]},e)}function fx(e){let n=this.resume();this.data.inTable&&(n=n.replace(/\\([\\|])/g,dx));const r=this.stack[this.stack.length-1];r.type,r.value=n,this.exit(e)}function dx(e,n){return n==="|"?n:e}function hx(e){const n=e||{},r=n.tableCellPadding,l=n.tablePipeAlign,o=n.stringLength,s=r?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
|
|
37
|
-
`,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:S,table:c,tableCell:m,tableRow:d}};function c(v,_,N,M){return p(y(v,N,M),v.align)}function d(v,_,N,M){const A=g(v,N,M),V=p([A]);return V.slice(0,V.indexOf(`
|
|
38
|
-
`))}function m(v,_,N,M){const A=N.enter("tableCell"),V=N.enter("phrasing"),j=N.containerPhrasing(v,{...M,before:s,after:s});return V(),A(),j}function p(v,_){return xA(v,{align:_,alignDelimiters:l,padding:r,stringLength:o})}function y(v,_,N){const M=v.children;let A=-1;const V=[],j=_.enter("table");for(;++A<M.length;)V[A]=g(M[A],_,N);return j(),V}function g(v,_,N){const M=v.children;let A=-1;const V=[],j=_.enter("tableRow");for(;++A<M.length;)V[A]=m(M[A],v,_,N);return j(),V}function S(v,_,N){let M=$S.inlineCode(v,_,N);return N.stack.includes("tableCell")&&(M=M.replace(/\|/g,"\\$&")),M}}function px(){return{exit:{taskListCheckValueChecked:Zy,taskListCheckValueUnchecked:Zy,paragraph:gx}}}function mx(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:yx}}}function Zy(e){const n=this.stack[this.stack.length-2];n.type,n.checked=e.type==="taskListCheckValueChecked"}function gx(e){const n=this.stack[this.stack.length-2];if(n&&n.type==="listItem"&&typeof n.checked=="boolean"){const r=this.stack[this.stack.length-1];r.type;const l=r.children[0];if(l&&l.type==="text"){const o=n.children;let s=-1,c;for(;++s<o.length;){const d=o[s];if(d.type==="paragraph"){c=d;break}}c===r&&(l.value=l.value.slice(1),l.value.length===0?r.children.shift():r.position&&l.position&&typeof l.position.start.offset=="number"&&(l.position.start.column++,l.position.start.offset++,r.position.start=Object.assign({},l.position.start)))}}this.exit(e)}function yx(e,n,r,l){const o=e.children[0],s=typeof e.checked=="boolean"&&o&&o.type==="paragraph",c="["+(e.checked?"x":" ")+"] ",d=r.createTracker(l);s&&d.move(c);let m=$S.listItem(e,n,r,{...l,...d.current()});return s&&(m=m.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,p)),m;function p(y){return y+c}}function bx(){return[Xw(),yA(),EA(),ux(),px()]}function Sx(e){return{extensions:[Qw(),bA(e),_A(),hx(e),mx()]}}const vx={tokenize:Ax,partial:!0},YS={tokenize:xx,partial:!0},FS={tokenize:Ox,partial:!0},KS={tokenize:Cx,partial:!0},Ex={tokenize:zx,partial:!0},XS={name:"wwwAutolink",tokenize:kx,previous:JS},QS={name:"protocolAutolink",tokenize:wx,previous:WS},nr={name:"emailAutolink",tokenize:Tx,previous:e0},Ii={};function _x(){return{text:Ii}}let ia=48;for(;ia<123;)Ii[ia]=nr,ia++,ia===58?ia=65:ia===91&&(ia=97);Ii[43]=nr;Ii[45]=nr;Ii[46]=nr;Ii[95]=nr;Ii[72]=[nr,QS];Ii[104]=[nr,QS];Ii[87]=[nr,XS];Ii[119]=[nr,XS];function Tx(e,n,r){const l=this;let o,s;return c;function c(g){return!fd(g)||!e0.call(l,l.previous)||Hd(l.events)?r(g):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),d(g))}function d(g){return fd(g)?(e.consume(g),d):g===64?(e.consume(g),m):r(g)}function m(g){return g===46?e.check(Ex,y,p)(g):g===45||g===95||kn(g)?(s=!0,e.consume(g),m):y(g)}function p(g){return e.consume(g),o=!0,m}function y(g){return s&&o&&Nn(l.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),n(g)):r(g)}}function kx(e,n,r){const l=this;return o;function o(c){return c!==87&&c!==119||!JS.call(l,l.previous)||Hd(l.events)?r(c):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(vx,e.attempt(YS,e.attempt(FS,s),r),r)(c))}function s(c){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),n(c)}}function wx(e,n,r){const l=this;let o="",s=!1;return c;function c(g){return(g===72||g===104)&&WS.call(l,l.previous)&&!Hd(l.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),o+=String.fromCodePoint(g),e.consume(g),d):r(g)}function d(g){if(Nn(g)&&o.length<5)return o+=String.fromCodePoint(g),e.consume(g),d;if(g===58){const S=o.toLowerCase();if(S==="http"||S==="https")return e.consume(g),m}return r(g)}function m(g){return g===47?(e.consume(g),s?p:(s=!0,m)):r(g)}function p(g){return g===null||jo(g)||_t(g)||ua(g)||Xo(g)?r(g):e.attempt(YS,e.attempt(FS,y),r)(g)}function y(g){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),n(g)}}function Ax(e,n,r){let l=0;return o;function o(c){return(c===87||c===119)&&l<3?(l++,e.consume(c),o):c===46&&l===3?(e.consume(c),s):r(c)}function s(c){return c===null?r(c):n(c)}}function xx(e,n,r){let l,o,s;return c;function c(p){return p===46||p===95?e.check(KS,m,d)(p):p===null||_t(p)||ua(p)||p!==45&&Xo(p)?m(p):(s=!0,e.consume(p),c)}function d(p){return p===95?l=!0:(o=l,l=void 0),e.consume(p),c}function m(p){return o||l||!s?r(p):n(p)}}function Ox(e,n){let r=0,l=0;return o;function o(c){return c===40?(r++,e.consume(c),o):c===41&&l<r?s(c):c===33||c===34||c===38||c===39||c===41||c===42||c===44||c===46||c===58||c===59||c===60||c===63||c===93||c===95||c===126?e.check(KS,n,s)(c):c===null||_t(c)||ua(c)?n(c):(e.consume(c),o)}function s(c){return c===41&&l++,e.consume(c),o}}function Cx(e,n,r){return l;function l(d){return d===33||d===34||d===39||d===41||d===42||d===44||d===46||d===58||d===59||d===63||d===95||d===126?(e.consume(d),l):d===38?(e.consume(d),s):d===93?(e.consume(d),o):d===60||d===null||_t(d)||ua(d)?n(d):r(d)}function o(d){return d===null||d===40||d===91||_t(d)||ua(d)?n(d):l(d)}function s(d){return Nn(d)?c(d):r(d)}function c(d){return d===59?(e.consume(d),l):Nn(d)?(e.consume(d),c):r(d)}}function zx(e,n,r){return l;function l(s){return e.consume(s),o}function o(s){return kn(s)?r(s):n(s)}}function JS(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||_t(e)}function WS(e){return!Nn(e)}function e0(e){return!(e===47||fd(e))}function fd(e){return e===43||e===45||e===46||e===95||kn(e)}function Hd(e){let n=e.length,r=!1;for(;n--;){const l=e[n][1];if((l.type==="labelLink"||l.type==="labelImage")&&!l._balanced){r=!0;break}if(l._gfmAutolinkLiteralWalkedInto){r=!1;break}}return e.length>0&&!r&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),r}const Nx={tokenize:Bx,partial:!0};function Rx(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:Lx,continuation:{tokenize:Ux},exit:jx}},text:{91:{name:"gfmFootnoteCall",tokenize:Ix},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:Dx,resolveTo:Mx}}}}function Dx(e,n,r){const l=this;let o=l.events.length;const s=l.parser.gfmFootnotes||(l.parser.gfmFootnotes=[]);let c;for(;o--;){const m=l.events[o][1];if(m.type==="labelImage"){c=m;break}if(m.type==="gfmFootnoteCall"||m.type==="labelLink"||m.type==="label"||m.type==="image"||m.type==="link")break}return d;function d(m){if(!c||!c._balanced)return r(m);const p=ki(l.sliceSerialize({start:c.end,end:l.now()}));return p.codePointAt(0)!==94||!s.includes(p.slice(1))?r(m):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(m),e.exit("gfmFootnoteCallLabelMarker"),n(m))}}function Mx(e,n){let r=e.length;for(;r--;)if(e[r][1].type==="labelImage"&&e[r][0]==="enter"){e[r][1];break}e[r+1][1].type="data",e[r+3][1].type="gfmFootnoteCallLabelMarker";const l={type:"gfmFootnoteCall",start:Object.assign({},e[r+3][1].start),end:Object.assign({},e[e.length-1][1].end)},o={type:"gfmFootnoteCallMarker",start:Object.assign({},e[r+3][1].end),end:Object.assign({},e[r+3][1].end)};o.end.column++,o.end.offset++,o.end._bufferIndex++;const s={type:"gfmFootnoteCallString",start:Object.assign({},o.end),end:Object.assign({},e[e.length-1][1].start)},c={type:"chunkString",contentType:"string",start:Object.assign({},s.start),end:Object.assign({},s.end)},d=[e[r+1],e[r+2],["enter",l,n],e[r+3],e[r+4],["enter",o,n],["exit",o,n],["enter",s,n],["enter",c,n],["exit",c,n],["exit",s,n],e[e.length-2],e[e.length-1],["exit",l,n]];return e.splice(r,e.length-r+1,...d),e}function Ix(e,n,r){const l=this,o=l.parser.gfmFootnotes||(l.parser.gfmFootnotes=[]);let s=0,c;return d;function d(g){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(g),e.exit("gfmFootnoteCallLabelMarker"),m}function m(g){return g!==94?r(g):(e.enter("gfmFootnoteCallMarker"),e.consume(g),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",p)}function p(g){if(s>999||g===93&&!c||g===null||g===91||_t(g))return r(g);if(g===93){e.exit("chunkString");const S=e.exit("gfmFootnoteCallString");return o.includes(ki(l.sliceSerialize(S)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(g),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),n):r(g)}return _t(g)||(c=!0),s++,e.consume(g),g===92?y:p}function y(g){return g===91||g===92||g===93?(e.consume(g),s++,p):p(g)}}function Lx(e,n,r){const l=this,o=l.parser.gfmFootnotes||(l.parser.gfmFootnotes=[]);let s,c=0,d;return m;function m(_){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(_),e.exit("gfmFootnoteDefinitionLabelMarker"),p}function p(_){return _===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(_),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",y):r(_)}function y(_){if(c>999||_===93&&!d||_===null||_===91||_t(_))return r(_);if(_===93){e.exit("chunkString");const N=e.exit("gfmFootnoteDefinitionLabelString");return s=ki(l.sliceSerialize(N)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(_),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),S}return _t(_)||(d=!0),c++,e.consume(_),_===92?g:y}function g(_){return _===91||_===92||_===93?(e.consume(_),c++,y):y(_)}function S(_){return _===58?(e.enter("definitionMarker"),e.consume(_),e.exit("definitionMarker"),o.includes(s)||o.push(s),nt(e,v,"gfmFootnoteDefinitionWhitespace")):r(_)}function v(_){return n(_)}}function Ux(e,n,r){return e.check(su,n,e.attempt(Nx,n,r))}function jx(e){e.exit("gfmFootnoteDefinition")}function Bx(e,n,r){const l=this;return nt(e,o,"gfmFootnoteDefinitionIndent",5);function o(s){const c=l.events[l.events.length-1];return c&&c[1].type==="gfmFootnoteDefinitionIndent"&&c[2].sliceSerialize(c[1],!0).length===4?n(s):r(s)}}function qx(e){let r=(e||{}).singleTilde;const l={name:"strikethrough",tokenize:s,resolveAll:o};return r==null&&(r=!0),{text:{126:l},insideSpan:{null:[l]},attentionMarkers:{null:[126]}};function o(c,d){let m=-1;for(;++m<c.length;)if(c[m][0]==="enter"&&c[m][1].type==="strikethroughSequenceTemporary"&&c[m][1]._close){let p=m;for(;p--;)if(c[p][0]==="exit"&&c[p][1].type==="strikethroughSequenceTemporary"&&c[p][1]._open&&c[m][1].end.offset-c[m][1].start.offset===c[p][1].end.offset-c[p][1].start.offset){c[m][1].type="strikethroughSequence",c[p][1].type="strikethroughSequence";const y={type:"strikethrough",start:Object.assign({},c[p][1].start),end:Object.assign({},c[m][1].end)},g={type:"strikethroughText",start:Object.assign({},c[p][1].end),end:Object.assign({},c[m][1].start)},S=[["enter",y,d],["enter",c[p][1],d],["exit",c[p][1],d],["enter",g,d]],v=d.parser.constructs.insideSpan.null;v&&ni(S,S.length,0,Qo(v,c.slice(p+1,m),d)),ni(S,S.length,0,[["exit",g,d],["enter",c[m][1],d],["exit",c[m][1],d],["exit",y,d]]),ni(c,p-1,m-p+3,S),m=p+S.length-2;break}}for(m=-1;++m<c.length;)c[m][1].type==="strikethroughSequenceTemporary"&&(c[m][1].type="data");return c}function s(c,d,m){const p=this.previous,y=this.events;let g=0;return S;function S(_){return p===126&&y[y.length-1][1].type!=="characterEscape"?m(_):(c.enter("strikethroughSequenceTemporary"),v(_))}function v(_){const N=Xa(p);if(_===126)return g>1?m(_):(c.consume(_),g++,v);if(g<2&&!r)return m(_);const M=c.exit("strikethroughSequenceTemporary"),A=Xa(_);return M._open=!A||A===2&&!!N,M._close=!N||N===2&&!!A,d(_)}}}class Hx{constructor(){this.map=[]}add(n,r,l){Px(this,n,r,l)}consume(n){if(this.map.sort(function(s,c){return s[0]-c[0]}),this.map.length===0)return;let r=this.map.length;const l=[];for(;r>0;)r-=1,l.push(n.slice(this.map[r][0]+this.map[r][1]),this.map[r][2]),n.length=this.map[r][0];l.push(n.slice()),n.length=0;let o=l.pop();for(;o;){for(const s of o)n.push(s);o=l.pop()}this.map.length=0}}function Px(e,n,r,l){let o=0;if(!(r===0&&l.length===0)){for(;o<e.map.length;){if(e.map[o][0]===n){e.map[o][1]+=r,e.map[o][2].push(...l);return}o+=1}e.map.push([n,r,l])}}function Zx(e,n){let r=!1;const l=[];for(;n<e.length;){const o=e[n];if(r){if(o[0]==="enter")o[1].type==="tableContent"&&l.push(e[n+1][1].type==="tableDelimiterMarker"?"left":"none");else if(o[1].type==="tableContent"){if(e[n-1][1].type==="tableDelimiterMarker"){const s=l.length-1;l[s]=l[s]==="left"?"center":"right"}}else if(o[1].type==="tableDelimiterRow")break}else o[0]==="enter"&&o[1].type==="tableDelimiterRow"&&(r=!0);n+=1}return l}function Gx(){return{flow:{null:{name:"table",tokenize:Vx,resolveAll:$x}}}}function Vx(e,n,r){const l=this;let o=0,s=0,c;return d;function d(U){let te=l.events.length-1;for(;te>-1;){const Se=l.events[te][1].type;if(Se==="lineEnding"||Se==="linePrefix")te--;else break}const ne=te>-1?l.events[te][1].type:null,Ae=ne==="tableHead"||ne==="tableRow"?D:m;return Ae===D&&l.parser.lazy[l.now().line]?r(U):Ae(U)}function m(U){return e.enter("tableHead"),e.enter("tableRow"),p(U)}function p(U){return U===124||(c=!0,s+=1),y(U)}function y(U){return U===null?r(U):Re(U)?s>1?(s=0,l.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(U),e.exit("lineEnding"),v):r(U):Je(U)?nt(e,y,"whitespace")(U):(s+=1,c&&(c=!1,o+=1),U===124?(e.enter("tableCellDivider"),e.consume(U),e.exit("tableCellDivider"),c=!0,y):(e.enter("data"),g(U)))}function g(U){return U===null||U===124||_t(U)?(e.exit("data"),y(U)):(e.consume(U),U===92?S:g)}function S(U){return U===92||U===124?(e.consume(U),g):g(U)}function v(U){return l.interrupt=!1,l.parser.lazy[l.now().line]?r(U):(e.enter("tableDelimiterRow"),c=!1,Je(U)?nt(e,_,"linePrefix",l.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(U):_(U))}function _(U){return U===45||U===58?M(U):U===124?(c=!0,e.enter("tableCellDivider"),e.consume(U),e.exit("tableCellDivider"),N):ue(U)}function N(U){return Je(U)?nt(e,M,"whitespace")(U):M(U)}function M(U){return U===58?(s+=1,c=!0,e.enter("tableDelimiterMarker"),e.consume(U),e.exit("tableDelimiterMarker"),A):U===45?(s+=1,A(U)):U===null||Re(U)?ae(U):ue(U)}function A(U){return U===45?(e.enter("tableDelimiterFiller"),V(U)):ue(U)}function V(U){return U===45?(e.consume(U),V):U===58?(c=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(U),e.exit("tableDelimiterMarker"),j):(e.exit("tableDelimiterFiller"),j(U))}function j(U){return Je(U)?nt(e,ae,"whitespace")(U):ae(U)}function ae(U){return U===124?_(U):U===null||Re(U)?!c||o!==s?ue(U):(e.exit("tableDelimiterRow"),e.exit("tableHead"),n(U)):ue(U)}function ue(U){return r(U)}function D(U){return e.enter("tableRow"),$(U)}function $(U){return U===124?(e.enter("tableCellDivider"),e.consume(U),e.exit("tableCellDivider"),$):U===null||Re(U)?(e.exit("tableRow"),n(U)):Je(U)?nt(e,$,"whitespace")(U):(e.enter("data"),re(U))}function re(U){return U===null||U===124||_t(U)?(e.exit("data"),$(U)):(e.consume(U),U===92?de:re)}function de(U){return U===92||U===124?(e.consume(U),re):re(U)}}function $x(e,n){let r=-1,l=!0,o=0,s=[0,0,0,0],c=[0,0,0,0],d=!1,m=0,p,y,g;const S=new Hx;for(;++r<e.length;){const v=e[r],_=v[1];v[0]==="enter"?_.type==="tableHead"?(d=!1,m!==0&&(Gy(S,n,m,p,y),y=void 0,m=0),p={type:"table",start:Object.assign({},_.start),end:Object.assign({},_.end)},S.add(r,0,[["enter",p,n]])):_.type==="tableRow"||_.type==="tableDelimiterRow"?(l=!0,g=void 0,s=[0,0,0,0],c=[0,r+1,0,0],d&&(d=!1,y={type:"tableBody",start:Object.assign({},_.start),end:Object.assign({},_.end)},S.add(r,0,[["enter",y,n]])),o=_.type==="tableDelimiterRow"?2:y?3:1):o&&(_.type==="data"||_.type==="tableDelimiterMarker"||_.type==="tableDelimiterFiller")?(l=!1,c[2]===0&&(s[1]!==0&&(c[0]=c[1],g=Ao(S,n,s,o,void 0,g),s=[0,0,0,0]),c[2]=r)):_.type==="tableCellDivider"&&(l?l=!1:(s[1]!==0&&(c[0]=c[1],g=Ao(S,n,s,o,void 0,g)),s=c,c=[s[1],r,0,0])):_.type==="tableHead"?(d=!0,m=r):_.type==="tableRow"||_.type==="tableDelimiterRow"?(m=r,s[1]!==0?(c[0]=c[1],g=Ao(S,n,s,o,r,g)):c[1]!==0&&(g=Ao(S,n,c,o,r,g)),o=0):o&&(_.type==="data"||_.type==="tableDelimiterMarker"||_.type==="tableDelimiterFiller")&&(c[3]=r)}for(m!==0&&Gy(S,n,m,p,y),S.consume(n.events),r=-1;++r<n.events.length;){const v=n.events[r];v[0]==="enter"&&v[1].type==="table"&&(v[1]._align=Zx(n.events,r))}return e}function Ao(e,n,r,l,o,s){const c=l===1?"tableHeader":l===2?"tableDelimiter":"tableData",d="tableContent";r[0]!==0&&(s.end=Object.assign({},Va(n.events,r[0])),e.add(r[0],0,[["exit",s,n]]));const m=Va(n.events,r[1]);if(s={type:c,start:Object.assign({},m),end:Object.assign({},m)},e.add(r[1],0,[["enter",s,n]]),r[2]!==0){const p=Va(n.events,r[2]),y=Va(n.events,r[3]),g={type:d,start:Object.assign({},p),end:Object.assign({},y)};if(e.add(r[2],0,[["enter",g,n]]),l!==2){const S=n.events[r[2]],v=n.events[r[3]];if(S[1].end=Object.assign({},v[1].end),S[1].type="chunkText",S[1].contentType="text",r[3]>r[2]+1){const _=r[2]+1,N=r[3]-r[2]-1;e.add(_,N,[])}}e.add(r[3]+1,0,[["exit",g,n]])}return o!==void 0&&(s.end=Object.assign({},Va(n.events,o)),e.add(o,0,[["exit",s,n]]),s=void 0),s}function Gy(e,n,r,l,o){const s=[],c=Va(n.events,r);o&&(o.end=Object.assign({},c),s.push(["exit",o,n])),l.end=Object.assign({},c),s.push(["exit",l,n]),e.add(r+1,0,s)}function Va(e,n){const r=e[n],l=r[0]==="enter"?"start":"end";return r[1][l]}const Yx={name:"tasklistCheck",tokenize:Kx};function Fx(){return{text:{91:Yx}}}function Kx(e,n,r){const l=this;return o;function o(m){return l.previous!==null||!l._gfmTasklistFirstContentOfListItem?r(m):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(m),e.exit("taskListCheckMarker"),s)}function s(m){return _t(m)?(e.enter("taskListCheckValueUnchecked"),e.consume(m),e.exit("taskListCheckValueUnchecked"),c):m===88||m===120?(e.enter("taskListCheckValueChecked"),e.consume(m),e.exit("taskListCheckValueChecked"),c):r(m)}function c(m){return m===93?(e.enter("taskListCheckMarker"),e.consume(m),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),d):r(m)}function d(m){return Re(m)?n(m):Je(m)?e.check({tokenize:Xx},n,r)(m):r(m)}}function Xx(e,n,r){return nt(e,l,"whitespace");function l(o){return o===null?r(o):n(o)}}function Qx(e){return cS([_x(),Rx(),qx(e),Gx(),Fx()])}const Jx={};function Wx(e){const n=this,r=e||Jx,l=n.data(),o=l.micromarkExtensions||(l.micromarkExtensions=[]),s=l.fromMarkdownExtensions||(l.fromMarkdownExtensions=[]),c=l.toMarkdownExtensions||(l.toMarkdownExtensions=[]);o.push(Qx(r)),s.push(bx()),c.push(Sx(r))}const eO={待命:"Standby",正在听:"Listening",正在说:"Speaking",正在处理任务:"Working on a task",等待你的确认:"Waiting for your confirmation",正在启动:"Starting",正在连接语音前台:"Connecting voice frontend",其他入口正在使用:"In use by another client",已隐藏:"Hidden",正在显示:"Showing",桌面端:"Desktop",终端:"Terminal",其他入口:"another client","正在检查后台 Agent":"Checking backend agent","请求失败({status})":"Request failed ({status})","没有提交成功:{message}":"Submission failed: {message}","Gateway 已连接":"Gateway connected",能力服务尚未连接:"Backend service not connected","qwen-audio-agent Gateway 尚未连接":"qwen-audio-agent Gateway not connected",正在听你说:"Listening","qwen-audio-agent Gateway 已断开,正在重连":"qwen-audio-agent Gateway disconnected, reconnecting","网关重连后未找到这次后台执行,请重新提交。":"This background task was not found after the gateway reconnected. Please submit it again.","{holder}正在使用语音":"{holder} is using voice",正在接入语音:"Connecting voice",正在回复:"Replying",正在处理:"Processing",已安排:"Scheduled","下次触发:{time}":"Next: {time}",时间待定:"Time pending",一次:"Once",每天:"Daily",每周:"Weekly",工作日:"Weekdays",排队中:"Queued",进行中:"In progress","正在处理 · {seconds} 秒":"Processing · {seconds}s",正在整理项目结果:"Finalizing project results",正在取消:"Cancelling",正在继续处理:"Resuming",正在准备回复:"Preparing reply",处理完成:"Completed","后台失败:{error}":"Background task failed: {error}",已取消:"Cancelled",已创建新会话:"New session created","等待{holder}释放语音":"Waiting for {holder} to release voice",正在显示悬浮球:"Showing the orb",连接异常:"Connection error",语音控制:"Voice controls",麦克风静音:"Mute microphone",取消等待语音:"Cancel waiting for voice",开启麦克风:"Enable microphone",设置:"Settings",打开对话:"Open conversation",收起:"Collapse",收起为悬浮球:"Collapse to orb",退出:"Quit",后台任务:"Background tasks",折叠后台任务:"Collapse background tasks",展开后台任务:"Expand background tasks",取消提醒:"Cancel reminder",取消计划:"Cancel scheduled task",正在提交:"Submitting",允许此任务:"Allow task",始终允许:"Always allow",权限决定:"Permission decision","允许此任务及后续操作,任务结束后失效":"Allow this task and its subsequent operations until it ends",本会话后续权限请求自动允许:"Automatically allow later permission requests in this session",拒绝当前操作:"Deny this operation",拒绝:"Deny",你:"You",已打断:"Interrupted",来源:"Sources","打开 {label}":"Open {label}",模型信息不可用:"Model information unavailable",模型能力信息不可用:"Model capability information unavailable",视频通话:"Video call",开启视频:"Enable video",关闭视频:"Disable video",开启摄像头:"Enable camera",关闭摄像头:"Disable camera",摄像头已关闭:"Camera off",正在开启摄像头:"Starting camera","关闭视频,保留语音":"Close video, keep voice",相机预览:"Camera preview","实时视觉已开启 · 已发送 {count} 帧":"Live vision enabled · {count} frames sent","实时视觉已暂停,连接恢复后将自动继续":"Live vision paused · reconnecting automatically",请先开启麦克风:"Enable the microphone first",当前浏览器无法使用相机:"Camera access is unavailable in this browser",无法打开相机:"Could not open the camera",相机连接已断开:"Camera disconnected",视觉输入连接不可用:"Live vision connection is unavailable",视觉帧超过大小限制:"Visual frame exceeds the size limit",无法采集视觉画面:"Could not capture a visual frame",新会话:"New session",资料库:"Library","把本机的手册、规章、教材交给助手":"Hand local manuals, policies and textbooks to the assistant","粘贴本机文件路径,例如 /Users/me/手册.md":"Paste a local file path, e.g. /Users/me/manual.md",加入资料库:"Add to library","支持 Markdown、txt 等文本;复杂文档会先提取文字。":"Supports text files such as Markdown and txt; text is extracted from richer document formats first.","还没有资料。加进来之后,助手就知道该去查哪一份。":"No documents yet. Once added, the assistant knows which one to consult.","资料库功能未开启。":"The document library is not enabled.",读不到资料列表:"Cannot read the document list","正在加入…":"Adding…",正在加入资料库:"Adding to the knowledge library","已收进资料库:{name}":"Added to the library: {name}","已移除:{name}":"Removed: {name}","“{name}” 已收进资料库":"“{name}” was added to the library","“{name}” 提取失败":"Could not extract “{name}”","导入失败({status})":"Import failed ({status})","导入失败,请稍后再试":"Import failed, please try again later","移除失败,请稍后再试":"Could not remove it, please try again later",待摘要:"summary pending",移除:"Remove",关闭语音:"Disable voice",取消等待:"Cancel waiting",开启语音:"Enable voice",语音交互:"Voice interaction","你说,我来调度。":"You speak, I orchestrate.",试着说:"Try saying","“帮我查一下今天的 AI 新闻,并整理成三点摘要。”":`"Look up today's AI news and summarize it in three points."`,"输入文字,或粘贴、拖入图片和文件":"Type a message, or paste and drop images and files",输入文字或图片:"Type text or add an image",添加图片或文件:"Add images or files",移除附件:"Remove attachment",发送:"Send","Gateway 尚未连接":"Gateway is not connected yet",无法读取文件:"Unable to read file","文件 {name} 超过 8 MB 限制":"File {name} exceeds the 8 MB limit",处理失败:"Failed",连接已中断:"Connection lost",正在整理结果:"Organizing results",后台正在请求执行权限:"Backend is requesting permission to proceed",这项工作已停止:"This task has stopped","项目结果已返回,协调 Agent 正在整理":"Project results returned, coordinator agent is organizing them",正在等待后台确认停止:"Waiting for backend to confirm cancellation","结果已经返回,正在准备语音回复":"Results returned, preparing voice reply",结果已经发送:"Results delivered",正在等待与后台重新连接:"Waiting to reconnect to backend","正在连接后台 Agent":"Connecting to backend agent","当前模式:{mode}":"Current mode: {mode}","会话:{title}":"Session: {title}",未知:"Unknown",正在生成图片:"Generating image",正在查询相关信息:"Searching for information",正在读取相关内容:"Reading content",正在修改内容:"Editing content","一个处理步骤已完成,正在继续":"A step completed, continuing",正在执行任务:"Running a task",执行结果:"Result",当前浏览器不支持实时语音播放:"This browser does not support realtime voice playback","语音播放没有成功启用,请再点一次开启语音":'Voice playback failed to start. Click "Enable voice" again.',语音播放失败:"Voice playback failed",语音播放尚未启用:"Voice playback is not enabled yet","语音前台连接异常,正在重试":"Voice frontend connection error, retrying","实时语音连接中断,正在重连":"Realtime voice connection lost, reconnecting","Gateway 正由另一个客户端使用":"Gateway is in use by another client",当前连接已被另一个客户端接管:"This connection was taken over by another client","当前设备的访问权限已被撤销,请重新配对":"Access for this device was revoked. Pair it again.","另一个客户端正在使用语音助手,是否接管?":"Another client is using the voice assistant. Take over?",无法打开麦克风:"Could not open the microphone","麦克风权限未开启,请在系统设置中允许后重试":"Microphone permission is disabled. Allow it in system settings and try again.",未检测到可用麦克风:"No microphone detected","麦克风正被其他应用占用,请稍后重试":"The microphone is in use by another app. Try again shortly.",当前环境不支持麦克风输入:"Microphone input is not supported in this environment",正在切换麦克风:"Switching microphone","未检测到可用麦克风,连接设备后会自动恢复":"No microphone detected. Input will recover automatically when a device is connected.",无法初始化实时语音播放:"Could not initialize realtime voice playback",加载远程图片:"Load remote image",加载远程音频:"Load remote audio",加载远程视频:"Load remote video",打开链接:"Open link",任务产物:"Task artifacts","任务产物 {number}":"Task artifact {number}","文件 {number}":"File {number}"};let dd="";function tO(e=""){dd=String(e||"").trim(),Pd()}function Pd(){typeof document<"u"&&(document.documentElement.lang=n0(t0())?"zh-CN":"en")}function t0(){if(dd)return dd;try{const e=new URLSearchParams(globalThis.location?.search||"").get("lang");if(e)return e}catch{}return globalThis.navigator?.languages?.[0]||globalThis.navigator?.language||"zh-CN"}function n0(e){return/^zh(-|$)/i.test(e)}function C(e,n){const r=n0(t0())?e:eO[e]??e;return n?r.replace(/\{(\w+)\}/g,(l,o)=>o in n?String(n[o]):l):r}Pd();const nO=/\.(png|jpe?g|gif|webp|svg|bmp|ico|avif)(\?.*)?$/i,i0=/\.(mp3|wav|ogg|m4a|aac|flac|opus)(\?.*)?$/i,r0=/\.(mp4|webm|mov|avi|mkv)(\?.*)?$/i;function a0(e){try{const n=new URL(e);return n.protocol==="http:"||n.protocol==="https:"}catch{return!1}}function Ql({src:e,alt:n,type:r}){const[l,o]=I.useState(!1);return!e||!a0(e)?O.jsx("span",{children:n||e}):l?r==="audio"?O.jsx("audio",{controls:!0,preload:"none",src:e,className:"media-audio"}):r==="video"?O.jsx("video",{controls:!0,preload:"none",src:e,className:"media-video",children:O.jsx("track",{kind:"captions"})}):O.jsx("a",{href:e,target:"_blank",rel:"noopener noreferrer",children:O.jsx("img",{src:e,alt:n||"",loading:"lazy",className:"media-image"})}):O.jsxs("span",{className:"media-consent",children:[O.jsx("button",{type:"button",onClick:()=>o(!0),children:C(r==="image"?"加载远程图片":r==="audio"?"加载远程音频":"加载远程视频")}),O.jsx("a",{href:e,target:"_blank",rel:"noopener noreferrer",children:C("打开链接")})]})}function iO(e){return nO.test(e)?"image":i0.test(e)?"audio":r0.test(e)?"video":null}const rO={p:({children:e})=>O.jsx("p",{children:e}),img:({src:e,alt:n})=>i0.test(e||"")?O.jsx(Ql,{src:e,type:"audio"}):r0.test(e||"")?O.jsx(Ql,{src:e,type:"video"}):O.jsx(Ql,{src:e,alt:n,type:"image"}),a:({href:e,children:n})=>{if(!e)return O.jsx("span",{children:n});const r=iO(e);return r?O.jsx(Ql,{src:e,alt:String(n),type:r}):O.jsx("a",{href:e,target:"_blank",rel:"noopener noreferrer",children:n})},pre:({children:e})=>O.jsx(O.Fragment,{children:e}),code:({node:e,className:n,children:r,...l})=>n?.startsWith("language-")?O.jsx("pre",{className:"code-block",children:O.jsx("code",{className:n,children:r})}):O.jsx("code",{className:"inline-code",...l,children:r}),table:({children:e})=>O.jsx("div",{className:"table-wrap",children:O.jsx("table",{children:e})})};function aO({citations:e}){const n=(e||[]).filter(r=>r?.title&&a0(r.url));return n.length?O.jsxs("nav",{className:"message-citations","aria-label":C("来源"),children:[O.jsx("small",{children:C("来源")}),O.jsx("ol",{children:n.map((r,l)=>O.jsx("li",{children:O.jsxs("a",{href:r.url,target:"_blank",rel:"noopener noreferrer",title:r.snippet||r.title,children:[O.jsx("span",{children:l+1}),r.title]})},r.id||r.url))})]}):null}function lO({role:e,content:n,live:r,citations:l}){return e==="user"?O.jsx("div",{className:"message-body",children:n}):n?O.jsxs("div",{className:"message-body",children:[O.jsx(qw,{remarkPlugins:[Wx],components:rO,children:n}),O.jsx(aO,{citations:l})]}):r?O.jsx("div",{className:"message-body streaming-empty",children:"…"}):null}const l0=I.memo(lO),uO=8*1024*1024;function oO(e=[]){return e.filter(n=>n?.type==="text").map(n=>String(n.text||"").trim()).filter(Boolean).join(`
|
|
39
|
-
`)}function sO(e=[]){return e.filter(n=>n?.type==="file")}function Zd(e,n=0){const r=String(e?.source?.text?.value||"").trim();return r?r.slice(0,2048):String(e?.mime||"").startsWith("image/")?`[Image ${n+1}]`:e?.filename?`@${e.filename}`:`[File ${n+1}]`}function cO({mime:e,filename:n,url:r,sourceType:l="file",path:o="",reference:s=""}={},c=0){const d={type:"file",mime:String(e||"application/octet-stream"),...n?{filename:String(n)}:{},url:String(r||"")},m=String(s||Zd(d,c));return{...d,source:{type:l,...o?{path:String(o)}:{},text:{value:m}}}}function fO(e,n=0){return Zd(e,n).slice(0,120)}function dO(e){const n=new Set;return e.map((r,l)=>{let o=Zd(r,l);if(!n.has(o))return n.add(o),o;const s=String(r?.mime||"").startsWith("image/")?"Image":"File";let c=l+1;do o=`[${s} ${c}]`,c+=1;while(n.has(o));return n.add(o),o})}function hO(e=[]){const n=sO(e);if(!n.length)return e;const r=dO(n),l=oO(e),s=[r.filter(m=>!l.includes(m)).join(" "),l].filter(Boolean).join(" ");let c=0;const d=n.map((m,p)=>{const y=r[p];let g=s.indexOf(y,c);return g<0&&(g=s.indexOf(y)),c=g+y.length,{...m,source:{...m.source||{},type:m.source?.type||"file",text:{value:y,start:g,end:g+y.length}}}});return[{type:"text",text:s},...d]}function pO(e,n,r="file"){return new Promise((l,o)=>{if(e.size>uO){o(new Error(C("文件 {name} 超过 8 MB 限制",{name:e.name})));return}const s=new FileReader;s.onerror=()=>o(s.error||new Error(C("无法读取文件"))),s.onload=()=>{l({id:crypto.randomUUID(),part:cO({mime:e.type||"application/octet-stream",filename:e.name,url:String(s.result||""),sourceType:r},n)})},s.readAsDataURL(e)})}function mO({onSend:e,compact:n=!1}){const[r,l]=I.useState(""),[o,s]=I.useState([]),[c,d]=I.useState(""),m=I.useRef(null),p=I.useCallback(S=>{s(S)},[]),y=I.useCallback(async(S,v="file")=>{const _=[...S];if(_.length)try{const N=await Promise.all(_.map((M,A)=>pO(M,o.length+A,v)));p([...o,...N]),d("")}catch(N){d(N?.message||String(N))}},[o,p]),g=S=>{S.preventDefault();const v=r.trim();if(!v&&!o.length)return;const _=hO([...v?[{type:"text",text:v}]:[],...o.map(N=>N.part)]);if(!e(_)){d(C("Gateway 尚未连接"));return}l(""),p([]),d("")};return O.jsxs("form",{className:"multimodal-composer",onSubmit:g,onDragOver:S=>S.preventDefault(),onDrop:S=>{S.preventDefault(),y(S.dataTransfer.files)},children:[o.length>0&&O.jsx("div",{className:"composer-attachments",children:o.map((S,v)=>O.jsxs("span",{className:"composer-attachment",children:[O.jsx("span",{children:fO(S.part,v)}),O.jsx("button",{type:"button","aria-label":C("移除附件"),onClick:()=>p(o.filter(_=>_.id!==S.id)),children:"×"})]},S.id))}),O.jsxs("div",{className:"composer-row",children:[O.jsx("button",{className:"composer-attach",type:"button",title:C("添加图片或文件"),"aria-label":C("添加图片或文件"),onClick:()=>m.current?.click(),children:"+"}),O.jsx("input",{ref:m,type:"file",multiple:!0,hidden:!0,onChange:S=>{y(S.target.files),S.target.value=""}}),O.jsx("textarea",{value:r,rows:"1",placeholder:C(n?"输入文字或图片":"输入文字,或粘贴、拖入图片和文件"),onChange:S=>l(S.target.value),onPaste:S=>{const v=S.clipboardData?.files;v?.length&&(S.preventDefault(),y(v,"clipboard"))},onKeyDown:S=>{S.key==="Enter"&&!S.shiftKey&&g(S)}}),O.jsx("button",{className:"composer-send",type:"submit",children:C("发送")})]}),c&&O.jsx("small",{className:"composer-error",role:"alert",children:c})]})}var gO=Fb();const yO=1280,bO=720,SO=190*1024,vO=1e3,u0="camera_image_too_large",EO=Object.freeze([.86,.74,.62,.5,.38,.25,.18,.12,.08]);function _O(e,n,{maxWidth:r=yO,maxHeight:l=bO}={}){const o=Number(e),s=Number(n);if(!Number.isFinite(o)||!Number.isFinite(s)||o<=0||s<=0)throw new Error("camera_dimensions_unavailable");const c=Math.min(1,r/o,l/s);return{width:Math.max(1,Math.round(o*c)),height:Math.max(1,Math.round(s*c))}}function Vy(e){e?.getTracks?.().forEach(n=>n.stop())}function TO(e){return!e||typeof FileReader>"u"?Promise.reject(new Error("camera_encoder_unavailable")):new Promise((n,r)=>{const l=new FileReader;l.onerror=()=>r(l.error||new Error("camera_encoder_unavailable")),l.onload=()=>{const o=String(l.result||""),s=o.indexOf(",");if(s<0){r(new Error("camera_encoder_unavailable"));return}n(o.slice(s+1))},l.readAsDataURL(e)})}function kO(e,{maxBytes:n=SO,qualities:r=EO}={}){if(!e||typeof e.toBlob!="function")return Promise.reject(new Error("camera_encoder_unavailable"));const l=[...r].filter(Number.isFinite);return l.length?new Promise((o,s)=>{let c=0;const d=()=>{e.toBlob(m=>{if(m&&m.size<=n){o(m);return}if(c+1>=l.length){s(new Error(m?u0:"camera_encoder_unavailable"));return}c+=1,d()},"image/jpeg",l[c])};d()}):Promise.reject(new Error("camera_encoder_unavailable"))}async function wO(e,n={}){const r=_O(e?.videoWidth,e?.videoHeight,n),l=document.createElement("canvas");l.width=r.width,l.height=r.height;const o=l.getContext("2d");if(!o)throw new Error("camera_encoder_unavailable");return o.drawImage(e,0,0,r.width,r.height),kO(l,n)}const $y="(min-width: 1400px)";function Yy({disabled:e=!1}){return O.jsxs("svg",{viewBox:"0 0 24 24","aria-hidden":"true",children:[O.jsx("rect",{x:"3",y:"6",width:"12",height:"12",rx:"3"}),O.jsx("path",{d:"m15 10 6-3v10l-6-3"}),e&&O.jsx("path",{d:"m3 3 18 18"})]})}function AO({available:e=!1,connectionState:n="connected",onFrame:r,onStop:l,onStateChange:o,onClose:s}){const[c,d]=I.useState(!0),[m,p]=I.useState(null),[y,g]=I.useState(!1),[S,v]=I.useState(0),[_,N]=I.useState(""),[M,A]=I.useState(()=>typeof window<"u"&&window.matchMedia?.($y).matches===!0),V=I.useRef(null),j=I.useRef(!1),ue=c&&y&&(e&&n==="connected");j.current=ue,I.useEffect(()=>{const re=window.matchMedia?.($y);if(!re)return;const de=U=>A(U.matches);return re.addEventListener?.("change",de),()=>re.removeEventListener?.("change",de)},[]),I.useEffect(()=>{if(!c)return;let re=!1,de=null;const U=()=>{re||(j.current=!1,N(C("相机连接已断开")),d(!1))};return(async()=>{try{if(!navigator.mediaDevices?.getUserMedia)throw new Error(C("当前浏览器无法使用相机"));if(de=await navigator.mediaDevices.getUserMedia({audio:!1,video:{facingMode:{ideal:"environment"},width:{ideal:1280},height:{ideal:720}}}),re){Vy(de);return}de.getTracks().forEach(ne=>ne.addEventListener("ended",U)),p(de)}catch{if(re)return;N(C("无法打开相机")),d(!1)}})(),()=>{re=!0,de?.getTracks().forEach(ne=>ne.removeEventListener("ended",U)),Vy(de),p(null),g(!1)}},[c]),I.useEffect(()=>{const re=V.current;if(!(!m||!re))return re.srcObject=m,re.play().catch(()=>{}),()=>{re.srcObject=null}},[m,M]),I.useEffect(()=>{if(!ue)return;let re=!1,de=!1,U=!1;const te=async()=>{if(!(re||de||!j.current||!V.current)&&!(V.current.readyState<2||!V.current.videoWidth)){de=!0;try{const Ae=await wO(V.current),Se=await TO(Ae);if(re||!j.current)return;if(r?.(Se,Date.now())===!1){U&&o?.(!1),U=!1,N(C("视觉输入连接不可用"));return}U||o?.(!0),U=!0,N(""),v(oe=>oe+1)}catch(Ae){if(re)return;N(Ae?.message===u0?C("视觉帧超过大小限制"):C("无法采集视觉画面")),d(!1)}finally{de=!1}}};te();const ne=setInterval(te,vO);return()=>{re=!0,clearInterval(ne),l?.(),o?.(!1)}},[ue,r,l,o]);const D=()=>{j.current=!1,d(re=>!re),v(0),N("")},$=O.jsxs("div",{className:`camera-stream${M?" camera-stream-docked":""}`,role:"region","aria-label":C("视频通话"),children:[O.jsxs("div",{className:"camera-heading",children:[O.jsx("span",{children:C("视频通话")}),O.jsx("button",{type:"button",className:"camera-icon-button",title:C("关闭视频,保留语音"),"aria-label":C("关闭视频,保留语音"),onClick:s,children:O.jsx("svg",{viewBox:"0 0 24 24","aria-hidden":"true",children:O.jsx("path",{d:"m6 6 12 12M6 18 18 6"})})})]}),c?O.jsx("video",{ref:V,autoPlay:!0,playsInline:!0,muted:!0,onLoadedMetadata:()=>g(!0),"aria-label":C("相机预览")}):O.jsxs("div",{className:"camera-placeholder",children:[O.jsx(Yy,{disabled:!0}),O.jsx("span",{children:C("摄像头已关闭")})]}),O.jsxs("div",{className:"camera-controls",children:[O.jsxs("small",{className:`camera-status${ue?" active":""}`,role:"status",children:[O.jsx("span",{className:"camera-status-dot","aria-hidden":"true"}),c?y?ue?C("实时视觉已开启 · 已发送 {count} 帧",{count:S}):C("实时视觉已暂停,连接恢复后将自动继续"):C("正在开启摄像头"):C("摄像头已关闭")]}),O.jsx("button",{type:"button",className:`camera-icon-button${c?" active":""}`,"aria-label":C(c?"关闭摄像头":"开启摄像头"),title:C(c?"关闭摄像头":"开启摄像头"),"aria-pressed":c,onClick:D,children:O.jsx(Yy,{disabled:!c})})]}),_&&O.jsx("small",{className:"composer-error",role:"alert",children:_})]});return M?gO.createPortal($,document.body):$}const xO=Object.freeze([{name:"enter_sleep",description:"让当前语音入口进入休眠。用户明确要求退下、隐藏、收起或暂时休息时必须立即调用,不要只口头回应。休眠不取消后台工作,不用于退出应用或单独静音。",inputSchema:{type:"object",properties:{},additionalProperties:!1},response_on_success:"none"}]),OO=new Set(["http:","https:"]);function Fa(e){return String(e||"").trim()}function CO(e){try{const n=new URL(e);return!OO.has(n.protocol)&&n.protocol!=="data:"||n.protocol==="data:"&&!n.pathname.includes(",")||n.username||n.password?null:n}catch{return null}}function zO(e){try{return JSON.stringify(e,null,2)}catch{return""}}function Fy(e){return e.startsWith("image/")?"image":e.startsWith("audio/")?"audio":e.startsWith("video/")?"video":"file"}function NO(e,n=0){if(!e||typeof e!="object")return null;const r=Fa(e.mediaType).toLowerCase()||"application/octet-stream",l=Fa(e.filename);if(Object.hasOwn(e,"text")){const o=String(e.text||"");return o?{kind:"text",content:o,mediaType:r,filename:l}:null}if(Object.hasOwn(e,"data")){const o=zO(e.data);return o?{kind:"data",content:o,mediaType:r,filename:l}:null}if(Object.hasOwn(e,"raw")){const o=Fa(e.raw).replace(/\s/g,"");return!o||!/^[a-z\d+/]*={0,2}$/i.test(o)?null:{kind:Fy(r),href:`data:${r};base64,${o}`,mediaType:r,filename:l,remote:!1,index:n}}if(Object.hasOwn(e,"url")){const o=CO(e.url);return o?{kind:Fy(r),href:o.href,mediaType:r,filename:l,remote:o.protocol!=="data:",index:n}:null}return null}function o0(e=[]){return(Array.isArray(e)?e:[]).flatMap((n,r)=>{if(!n||typeof n!="object")return[];const l=(Array.isArray(n.parts)?n.parts:[]).map((o,s)=>NO(o,s)).filter(Boolean);return l.length?[{id:Fa(n.artifactId)||`artifact_${r+1}`,name:Fa(n.name),description:Fa(n.description),parts:l}]:[]})}function au(e){return o0(e?.artifacts).length>0}function jf(e,n){return e.filename||C("文件 {number}",{number:n+1})}function RO({part:e,index:n}){return e.kind==="text"?O.jsx(l0,{role:"assistant",content:e.content}):e.kind==="data"?O.jsx("pre",{className:"task-artifact-data",children:e.content}):e.remote&&["image","audio","video"].includes(e.kind)?O.jsx(Ql,{src:e.href,alt:jf(e,n),type:e.kind},e.href):e.kind==="image"?O.jsx("a",{className:"task-artifact-image",href:e.href,download:e.filename||void 0,target:"_blank",rel:"noopener noreferrer",children:O.jsx("img",{src:e.href,alt:jf(e,n),loading:"lazy"})}):O.jsxs("a",{className:"task-artifact-file",href:e.href,download:e.remote?void 0:e.filename||void 0,target:"_blank",rel:"noopener noreferrer",children:[O.jsx("span",{"aria-hidden":"true",children:"↗"}),jf(e,n)]})}function DO({artifacts:e}){const n=o0(e);return n.length?O.jsx("section",{className:"task-artifacts","aria-label":C("任务产物"),children:n.map((r,l)=>O.jsxs("section",{className:"task-artifact",children:[O.jsx("strong",{children:r.name||C("任务产物 {number}",{number:l+1})}),r.description&&O.jsx("small",{children:r.description}),O.jsx("div",{className:"task-artifact-parts",children:r.parts.map((o,s)=>O.jsx(RO,{part:o,index:s},`${r.id}:${s}`))})]},r.id))}):null}const MO=[{value:"task",label:"允许此任务",title:"允许此任务及后续操作,任务结束后失效"},{value:"always",label:"始终允许",title:"本会话后续权限请求自动允许"},{value:"reject",label:"拒绝",title:"拒绝当前操作"}];function IO({authorization:e,onRespond:n}){return O.jsxs("div",{className:"permission-controls","aria-busy":!!e.submitting,children:[O.jsx("div",{className:"permission-actions",role:"group","aria-label":C("权限决定"),children:MO.map(({value:r,label:l,title:o})=>O.jsx("button",{type:"button",className:`permission-${r}`,title:C(o),"aria-label":`${C(l)}:${C(o)}`,disabled:e.submitting,onClick:()=>n(r),children:C(l)},r))}),e.submitting&&O.jsx("small",{role:"status",children:C("正在提交")}),e.error&&O.jsx("small",{className:"permission-error",role:"alert",children:e.error})]})}function LO({style:e="fluid"}){return e==="goo"?O.jsx("div",{className:"stage goo-orb",children:O.jsx("div",{className:"stage-scale goo-scale",children:O.jsxs("div",{className:"goo",children:[O.jsx("div",{className:"fill"}),O.jsx("div",{className:"shade"})]})})}):O.jsx("div",{className:"stage fluid-orb",children:O.jsx("div",{className:"stage-scale",children:O.jsxs("div",{className:"fluid",children:[O.jsx("span",{className:"blob b1"}),O.jsx("span",{className:"blob b2"}),O.jsx("span",{className:"blob b3"}),O.jsx("span",{className:"blob b4"}),O.jsx("div",{className:"glass"})]})})})}const s0=8,UO=192,jO=208,BO=9,qO=11,HO=8,PO=60;function ZO(){return{frames:[1680,660,660,840,840,1920].map((n,r)=>({spriteIndex:r,durationMs:n})),loopStart:0,fallback:"idle"}}function Dr(e,n,r,l){return{frames:Array.from({length:n},(o,s)=>({spriteIndex:e*s0+s,durationMs:s===n-1?l:r})),loopStart:null,fallback:"idle"}}function GO(){return{idle:ZO(),"running-right":Dr(1,8,120,220),"running-left":Dr(2,8,120,220),waving:Dr(3,4,140,280),jumping:Dr(4,5,140,280),failed:Dr(5,8,140,240),waiting:Dr(6,6,150,260),running:Dr(7,6,120,220),review:Dr(8,6,150,280)}}const VO=Object.freeze({idle:{name:"idle",mode:"loop"},connecting:{name:"idle",mode:"loop"},occupied:{name:"idle",mode:"loop"},hidden:{name:"idle",mode:"loop"},listening:{name:"waiting",mode:"loop",blocksCues:!0},speaking:{name:"waving",mode:"loop",blocksCues:!0},starting:{name:"running",mode:"loop",blocksCues:!0},working:{name:"running",mode:"loop"},waking:{name:"jumping",mode:"once",blocksCues:!0},processing:{name:"review",mode:"once",blocksCues:!0},error:{name:"failed",mode:"once",blocksCues:!0}}),$O=Object.freeze({ready:"jumping",wake:"jumping","task.completed":"jumping","task.failed":"failed",hover:"jumping","runtime.failed":"failed"});function YO(e){return $O[e]||null}function FO(e={}){return e.type==="task.completed"||e.type==="task.failed"?e.type:null}function KO({state:e,baseWorking:n=!1,dragDirection:r="",cue:l=null}={}){const o=n||e==="working"?"running":"idle",s=VO[e]||{name:o,mode:"loop"};return r==="left"||r==="right"?{name:`running-${r}`,key:`drag:${r}`,loop:!0,completion:"none",fallback:o}:l?.id&&l.name&&(!s.blocksCues||l.name===s.name)?{name:l.name,key:`cue:${l.id}`,loop:!1,completion:"cue",completionId:l.id,fallback:o}:{name:s.name,key:`state:${e}:${s.name}`,loop:s.mode==="loop",completion:"none",completionId:null,fallback:o}}function XO(e={}){const n=e.spriteVersionNumber??1,r=e.frame&&typeof e.frame=="object"?e.frame:{width:UO,height:jO,columns:s0,rows:n===2?qO:BO};for(const l of["width","height","columns","rows"])if(!Number.isInteger(r[l])||r[l]<=0)return null;return{width:r.width,height:r.height,columns:r.columns,rows:r.rows,frameCount:r.columns*r.rows}}function QO(e,n){return{x:n%e.columns*e.width,y:Math.floor(n/e.columns)*e.height,width:e.width,height:e.height}}function JO(e={},n=0){const r=GO(),l=e.animations;if(l&&typeof l=="object"&&!Array.isArray(l))for(const[o,s]of Object.entries(l)){if(!s||!Array.isArray(s.frames)||s.frames.length===0)throw new Error(`皮肤动画 ${o} 至少要包含一帧`);const c=s.fps===void 0?HO:s.fps;if(!Number.isFinite(c)||c<=0||c>PO)throw new Error(`皮肤动画 ${o} 的 fps 非法`);const d=1e3/c;r[o]={frames:s.frames.map(m=>({spriteIndex:m,durationMs:d})),loopStart:o==="idle"?0:null,fallback:"idle"}}for(const[o,s]of Object.entries(r))for(const c of s.frames)if(!Number.isInteger(c.spriteIndex)||c.spriteIndex<0||c.spriteIndex>=n)throw new Error(`皮肤动画 ${o} 引用了越界的帧索引`);return r}function WO(e){return e.frames.reduce((n,r)=>n+r.durationMs,0)}function Ky(e,n){const r=WO(e);if(r<=0)return null;let l=Math.max(0,n);if(l>=r){if(e.loopStart===null)return null;const s=e.frames.slice(0,e.loopStart).reduce((d,m)=>d+m.durationMs,0),c=r-s;if(c<=0)return null;l=s+(l-r)%c}let o=0;for(const s of e.frames){if(l<o+s.durationMs)return{spriteIndex:s.spriteIndex,remainingMs:o+s.durationMs-l};o+=s.durationMs}return null}function eC({skin:e,state:n,baseWorking:r=!1,dragDirection:l="",cue:o=null,onCueComplete:s,onError:c}){const d=I.useRef(null),m=I.useRef(c),p=I.useRef(s),y=I.useRef(null),[g,S]=I.useState(null);m.current=c,p.current=s,I.useEffect(()=>{let _=!1;S(null);const N=M=>{_||m.current?.(M)};return fetch(`skins/${encodeURIComponent(e)}/pet.json`).then(M=>{if(!M.ok)throw new Error(`皮肤 ${e} 不存在`);return M.json()}).then(M=>{const A=XO(M);if(!A)throw new Error(`皮肤 ${e} 的网格定义非法`);const V=JO(M,A.frameCount),j=String(M.spritesheetPath||"spritesheet.webp"),ae=new Image;ae.decoding="async",ae.onload=()=>{if(!_){if(ae.naturalWidth!==A.width*A.columns||ae.naturalHeight!==A.height*A.rows){N(new Error(`皮肤 ${e} 的贴图尺寸与网格不符`));return}S({image:ae,geometry:A,animations:V})}},ae.onerror=()=>N(new Error(`皮肤 ${e} 的贴图加载失败`)),ae.src=`skins/${encodeURIComponent(e)}/${j}`}).catch(N),()=>{_=!0}},[e]);const v=KO({state:n,baseWorking:r,dragDirection:l,cue:o});return y.current=v,I.useEffect(()=>{if(!g)return;const _=d.current,N=_?.getContext("2d");if(!N)return;const{image:M,geometry:A,animations:V}=g,j=y.current;let ue={...V[j.name]||V.idle,loopStart:j.loop?0:null},D=performance.now(),$=0,re=!1;const de=()=>{let U=Ky(ue,performance.now()-D);if(!U){re||(re=!0,j.completion==="cue"&&p.current?.(j.completionId));const ne=y.current?.fallback||j.fallback;if(ue={...V[ne]||V.idle,loopStart:0,fallback:"idle"},D=performance.now(),U=Ky(ue,0),!U)return}const te=QO(A,U.spriteIndex);N.clearRect(0,0,_.width,_.height),N.imageSmoothingEnabled=!1,N.drawImage(M,te.x,te.y,te.width,te.height,0,0,_.width,_.height),$=setTimeout(de,Math.max(16,U.remainingMs))};return de(),()=>clearTimeout($)},[g,v.key]),g?O.jsx("div",{className:"stage sprite-orb",children:O.jsx("canvas",{ref:d,className:"sprite-orb-canvas",width:g.geometry.width,height:g.geometry.height})}):O.jsx("div",{className:"stage sprite-orb"})}const tC="qwaudio.gcp.v6",nC="qwaudio.bearer.",iC=/^[A-Za-z0-9_-]{24,256}$/;function rC(e=""){const n=String(e||"").trim();if(!n)return[];if(!iC.test(n))throw new TypeError("Gateway WebSocket credential contains invalid characters");return[tC,`${nC}${n}`]}let gi=Object.freeze({gatewayUrl:"",accessToken:"",clientType:"",clientLabel:"",clientInstanceId:""});const aC=new Set(["localhost","127.0.0.1","::1"]);function lC(e="web"){return gi.clientType||e}function uC(e="WebUI"){return gi.clientLabel||e}function oC(e=""){return gi.clientInstanceId||e}function sC(e=globalThis.location){const n=gi.gatewayUrl||e?.href||"";if(!n)return!1;try{return!aC.has(new URL(n).hostname.toLowerCase())}catch{return!1}}function cC(e){return gi.gatewayUrl?new URL(String(e).replace(/^\//,""),`${gi.gatewayUrl}/`).toString():e}function Uo(e,n={},r=globalThis.fetch){const l=new Headers(n.headers||{});return gi.accessToken&&l.set("Authorization",`Bearer ${gi.accessToken}`),r(cC(e),{...n,headers:l,credentials:"include"})}function fC(e,n=globalThis.location){const r=gi.gatewayUrl?new URL(gi.gatewayUrl):new URL(n.href),l=r.protocol==="https:"?"wss:":"ws:",o=gi.gatewayUrl?"/":r.pathname.endsWith("/")?r.pathname:r.pathname.replace(/[^/]*$/,"");return`${l}//${r.host}${o}api/realtime?sessionId=${encodeURIComponent(e)}`}function dC(e,n={},r=globalThis.WebSocket){const l=rC(gi.accessToken);if(l.length&&new URL(e).protocol!=="wss:")throw new Error("Remote Gateway credentials require a secure WebSocket endpoint");return l.length?new r(e,l):new r(e)}const hC=2e3;function pC(e){return e?e<1024?`${e} B`:e<1024*1024?`${Math.round(e/1024)} KB`:`${(e/1024/1024).toFixed(1)} MB`:""}function mC({onClose:e,getTask:n}){const[r,l]=I.useState([]),[o,s]=I.useState(""),[c,d]=I.useState(!1),[m,p]=I.useState(""),[y,g]=I.useState(""),[S,v]=I.useState([]),[_,N]=I.useState(!1),M=I.useCallback(async()=>{try{const j=await Uo("api/domain",{cache:"no-store"});if(j.status===404){N(!0);return}if(!j.ok)throw new Error(String(j.status));const ae=await j.json();l(Array.isArray(ae.documents)?ae.documents:[]),N(!1)}catch{p(C("读不到资料列表"))}},[]);I.useEffect(()=>{M()},[M]),I.useEffect(()=>{if(!S.length)return;const j=setInterval(async()=>{for(const ae of S){const ue=await n?.(ae.taskId).catch(()=>null),D=ue?.status;!D||["queued","running","delegated","finalizing"].includes(D)||(v($=>$.filter(re=>re.taskId!==ae.taskId)),D==="completed"?(g(C("“{name}” 已收进资料库",{name:ae.filename})),M()):p(ue?.error||C("“{name}” 提取失败",{name:ae.filename})))}},hC);return()=>clearInterval(j)},[S,n,M]);const A=async j=>{j.preventDefault();const ae=o.trim();if(!(!ae||c)){d(!0),p(""),g("");try{const ue=await Uo("api/domain/import",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:ae})}),D=await ue.json().catch(()=>({}));if(ue.status===202){v($=>[...$,{taskId:D.task_id,filename:D.target||ae}]),g(C("正在加入资料库")),s("");return}if(!ue.ok){p(D.message||D.error||C("导入失败({status})",{status:ue.status}));return}g(C("已收进资料库:{name}",{name:D.document?.title||ae})),s(""),M()}catch{p(C("导入失败,请稍后再试"))}finally{d(!1)}}},V=async j=>{if(!c){d(!0),p(""),g("");try{const ae=await Uo(`api/domain/${encodeURIComponent(j.id)}`,{method:"DELETE"});if(!ae.ok)throw new Error(String(ae.status));g(C("已移除:{name}",{name:j.title})),M()}catch{p(C("移除失败,请稍后再试"))}finally{d(!1)}}};return O.jsxs("aside",{className:"knowledge-panel","aria-label":C("资料库"),children:[O.jsxs("header",{children:[O.jsx("b",{children:C("资料库")}),e&&O.jsx("button",{type:"button",onClick:e,"aria-label":C("关闭"),children:"×"})]}),_?O.jsx("p",{className:"knowledge-hint",children:C("资料库功能未开启。")}):O.jsxs(O.Fragment,{children:[O.jsxs("form",{onSubmit:A,children:[O.jsx("input",{type:"text",value:o,spellCheck:!1,placeholder:C("粘贴本机文件路径,例如 /Users/me/手册.md"),onChange:j=>s(j.target.value)}),O.jsx("button",{type:"submit",disabled:c||!o.trim(),children:C("加入资料库")})]}),O.jsx("p",{className:"knowledge-hint",children:C("支持 Markdown、txt 等文本;复杂文档会先提取文字。")}),m&&O.jsx("p",{className:"knowledge-error",role:"alert",children:m}),y&&O.jsx("p",{className:"knowledge-notice",children:y}),S.map(j=>O.jsxs("div",{className:"knowledge-item pending",children:[O.jsx("b",{children:j.filename}),O.jsx("small",{children:C("正在加入…")})]},j.taskId)),!r.length&&!S.length&&O.jsx("p",{className:"knowledge-hint",children:C("还没有资料。加进来之后,助手就知道该去查哪一份。")}),r.map(j=>O.jsxs("div",{className:"knowledge-item",children:[O.jsx("b",{children:j.title}),j.gist&&O.jsx("small",{children:j.gist}),j.sections?.length>0&&O.jsx("small",{className:"knowledge-sections",children:j.sections.join(" · ")}),O.jsx("small",{className:"knowledge-meta",children:[j.filename,pC(j.bytes),j.summarised?"":C("待摘要")].filter(Boolean).join(" · ")}),O.jsx("button",{type:"button",onClick:()=>V(j),disabled:c,children:C("移除")})]},j.id))]})]})}const gC=new Set(["listening","processing","speaking"]);function yC({lifecycle:e="active",runtimeState:n=null,connectionError:r=!1,connecting:l=!1,ownershipBusy:o=!1,voiceState:s="idle",tasksWorking:c=!1}={}){return e==="hidden"?"hidden":e==="waking"?"waking":n==="failed"?"error":n==="starting"?"starting":r?"error":gC.has(s)?s:c?"working":o?"occupied":l?"connecting":"idle"}function bC({state:e,enabled:n,error:r=!1,dragging:l=!1,lifecycle:o="active"}){return["desktop-orb-stage",e,n?"enabled":"input-muted",r?"error":"",l?"dragging":"",o!=="active"?o:""].filter(Boolean).join(" ")}const SC=Object.freeze([Object.freeze({id:"fluid",type:"theme",displayName:"流光声波球"}),Object.freeze({id:"goo",type:"theme",displayName:"液态渐变球"})]),vC=/^[a-z0-9][a-z0-9._-]{0,63}$/i;function Bf(e){return SC.some(n=>n.id===String(e||""))}function Xy(e){const n=String(e||"").trim();return vC.test(n)?n:""}function c0({orbSkin:e,orbStyle:n}={}){return Xy(e)||Xy(n)||"fluid"}const Qy=Object.freeze({web:Object.freeze({text:!0,audio:!0,image:!0,visualStream:!0,resource:!0}),cli:Object.freeze({text:!0,audio:!0,image:!0,resource:!0}),desktop:Object.freeze({text:!0,audio:!0,image:!0,resource:!0}),mobile:Object.freeze({text:!0,audio:!0,image:!0,resource:!0})});function Gd(e="web"){return{...Qy[e]||Qy.web}}function EC(e="web"){const n=Gd(e);return n.text||n.image||n.resource}function _C(e){return String(e?.title||"").trim()||C("执行结果")}function TC(e){return e.status==="scheduled"?"scheduled":e.status==="completed"?["pending","delivering"].includes(e.notificationStatus)?"responding":"completed":e.status==="failed"?"failed":e.status==="cancelled"?"cancelled":e.status==="queued"?"queued":e.status==="delegated"?"delegated":e.status==="finalizing"?"finalizing":e.status==="cancelling"?"cancelling":(["working","auth_required","active"].includes(e.workState),"running")}function kC(e){return["submitted","working","auth_required","active"].includes(e?.workState)}function wC(e){return au(e)||kC(e)?!0:["completed","failed"].includes(e?.status)&&["pending","delivering"].includes(e?.notificationStatus)}function AC(e,n){return e.flatMap(r=>r.id!==n?[r]:au(r)?[r.phase==="responding"?{...r,phase:"completed"}:r]:[])}function xC(e){return!au(e)&&["completed","failed"].includes(e?.status)&&e?.notificationStatus==="delivered"}function OC(e,n,r){return e.filter(l=>l.id!==n||l.phase!==r)}function xo(e){return e.authorization?.status==="pending"?C("等待你的确认"):e.phase==="scheduled"?C("已安排"):e.phase==="failed"?C("处理失败"):e.phase==="cancelled"?C("已取消"):e.phase==="disconnected"?C("连接已中断"):e.phase==="queued"?C("排队中"):e.phase==="delegated"?C("进行中"):e.phase==="finalizing"?C("正在整理结果"):e.phase==="cancelling"?C("正在取消"):e.phase==="completed"?C("处理完成"):e.phase==="responding"?C("正在回复"):C("进行中")}function CC(e=[]){const n=e.filter(o=>o&&o.tool!=="invalid"),r=n.findLast(o=>o.kind==="tool"&&!["completed","failed"].includes(o.status));if(r)return r;const l=n.findLast(o=>o.kind==="plan"&&o.status==="running");return l||n.findLast(o=>o.kind==="tool")||n.findLast(o=>o.kind==="plan")||null}function qf(e){if(e.authorization?.status==="pending")return e.authorization.summary||C("后台正在请求执行权限");if(e.phase==="scheduled")return NC(e);if(e.error)return e.error;if(e.phase==="cancelled")return C("这项工作已停止");if(e.phase==="queued")return e.objective;if(e.phase==="finalizing")return C("项目结果已返回,协调 Agent 正在整理");if(e.phase==="cancelling")return C("正在等待后台确认停止");if(e.phase==="responding")return C("结果已经返回,正在准备语音回复");if(e.phase==="completed")return e.result||C("结果已经发送");if(e.phase==="disconnected")return C("正在等待与后台重新连接");const n=String(e.message||"").trim();if(n)return n.slice(0,300);const r=CC(e.activity);if(!r)return e.phase==="delegated"?C("进行中"):e.objective||C("正在执行任务");if(r.kind==="plan")return[r.total>0?`${r.completed}/${r.total}`:"",r.detail].filter(Boolean).join(" · ")||C("正在执行任务");if(r.kind==="tool"){if(r.label)return r.label;if(r.category==="image")return C("正在生成图片");if(r.category==="search")return C("正在查询相关信息");if(r.category==="read")return C("正在读取相关内容");if(r.category==="write")return C("正在修改内容");const l=`${r.tool||""} ${r.detail||""}`.toLowerCase();return/image|图片|图像/.test(l)?C("正在生成图片"):/search|web|fetch|搜索|查询/.test(l)?C("正在查询相关信息"):/read|glob|grep|list|读取|查找/.test(l)?C("正在读取相关内容"):r.status==="completed"?C("一个处理步骤已完成,正在继续"):C("正在执行任务")}return e.objective}const Jy=Object.freeze({once:"一次",daily:"每天",weekly:"每周",weekdays:"工作日"});function zC(e){const n=Number(e.schedule?.at);if(!Number.isFinite(n))return C("时间待定");const r={month:"numeric",day:"numeric",hour:"2-digit",minute:"2-digit",hour12:!1},l=String(e.schedule?.timeZone||"").trim();l&&(r.timeZone=l);try{return new Intl.DateTimeFormat(void 0,r).format(new Date(n))}catch{return delete r.timeZone,new Intl.DateTimeFormat(void 0,r).format(new Date(n))}}function NC(e){const n=String(e.schedule?.recurrence||"once"),r=Jy[n]?C(Jy[n]):n;return[C("下次触发:{time}",{time:zC(e)}),r].filter(Boolean).join(" · ")}function Mt(e,n={}){return{...n,id:e.id,...e.kind!==void 0||n.kind!==void 0?{kind:e.kind!==void 0?e.kind:n.kind}:{},...Object.hasOwn(e,"seriesId")||Object.hasOwn(n,"seriesId")?{seriesId:Object.hasOwn(e,"seriesId")?e.seriesId:n.seriesId}:{},objective:e.objective,...e.createdAt!==void 0||n.createdAt!==void 0?{createdAt:e.createdAt!==void 0?e.createdAt:n.createdAt}:{},...e.startedAt!==void 0||n.startedAt!==void 0?{startedAt:e.startedAt!==void 0?e.startedAt:n.startedAt}:{},elapsedMs:e.elapsedMs||0,phase:TC(e),turnId:e.turnId,...Object.hasOwn(e,"schedule")||Object.hasOwn(n,"schedule")?{schedule:Object.hasOwn(e,"schedule")?e.schedule:n.schedule}:{},result:Object.hasOwn(e,"result")?e.result:n.result,...Object.hasOwn(e,"artifacts")||Object.hasOwn(n,"artifacts")?{artifacts:Object.hasOwn(e,"artifacts")?e.artifacts:n.artifacts}:{},...Object.hasOwn(e,"message")||Object.hasOwn(n,"message")?{message:Object.hasOwn(e,"message")?e.message:n.message}:{},...Object.hasOwn(e,"activity")||Object.hasOwn(n,"activity")?{activity:e.activity||n.activity||[]}:{},...Object.hasOwn(e,"delegation")||Object.hasOwn(n,"delegation")?{delegation:Object.hasOwn(e,"delegation")?e.delegation:n.delegation}:{},error:e.error,...Object.hasOwn(e,"authorization")||Object.hasOwn(n,"authorization")?{authorization:Object.hasOwn(e,"authorization")?e.authorization:n.authorization}:{}}}class RC{constructor(n){this.publish=n,this.ready=!1,this.latest=new Map}set(n,r){const l=JSON.stringify(r);this.latest.get(n)?.serialized!==l&&this.latest.set(n,{serialized:l,sent:!1}),this.flush()}setReady(n){if(this.ready=n,!n)for(const r of this.latest.values())r.sent=!1;this.flush()}flush(){if(this.ready)for(const[n,r]of this.latest)r.sent||(r.sent=this.publish(n,JSON.parse(r.serialized))===!0)}}const it=Object.freeze({CONNECT:"connect",UNMUTE:"unmute",MUTE:"mute",INPUT_UNMUTE:"input.unmute",INPUT_MUTE:"input.mute",AUDIO_APPEND:"audio.append",IMAGE_APPEND:"image.append",IMAGE_CLEAR:"image.clear",TEXT_MESSAGE:"text.message",INPUT_MESSAGE:"input.message",INTERRUPT:"interrupt",SLEEP:"sleep",WAKE:"wake",PLAYBACK_STARTED:"playback.started",PLAYBACK_ENDED:"playback.ended",PLAYBACK_CANCELLED:"playback.cancelled",INPUT_SUSPEND_ACK:"input.suspend.ack"}),Me=Object.freeze({GATEWAY_CONNECTED:"gateway.connected",GATEWAY_DISCONNECTED:"gateway.disconnected",VOICE_CONNECTION:"voice.connection",VOICE_READY:"voice.ready",VOICE_STATE:"voice.state",VOICE_OWNERSHIP:"voice.ownership",VOICE_DEACTIVATED:"voice.deactivated",VOICE_SLEEP:"voice.sleep",TURN_STARTED:"turn.started",PLAYBACK_CLEAR:"playback.clear",INPUT_SUSPEND:"input.suspend",INPUT_RESUME:"input.resume",AUDIO_DELTA:"audio.delta",AUDIO_DONE:"audio.done",RESPONSE_STARTED:"response.started",RESPONSE_INTERRUPTED:"response.interrupted",TRANSCRIPT_DELTA:"transcript.delta",TRANSCRIPT_FINAL:"transcript.final",TRANSCRIPT_DISCARD:"transcript.discard",TOOL_CALL:"tool.call",MEMORY_CHANGED:"memory.changed",AGENT_ACTIVITY:"agent.activity",CLIENT_STATE:"client.state",ERROR:"error"}),f0=Object.freeze({SNAPSHOT:"task.snapshot",ACCEPTED:"task.accepted",SCHEDULED:"task.scheduled",SCHEDULED_FIRED:"task.scheduled.fired",RUNNING:"task.running",DELEGATED:"task.delegated",FINALIZING:"task.finalizing",CANCELLING:"task.cancelling",UPDATED:"task.updated",PROGRESS:"task.progress",COMPLETED:"task.completed",FAILED:"task.failed",CANCELLED:"task.cancelled",PERMISSION_REQUESTED:"task.permission.requested",PERMISSION_RESOLVED:"task.permission.resolved",INPUT_REQUESTED:"task.input.requested",INPUT_RESOLVED:"task.input.resolved",NOTIFICATION_PENDING:"task.notification.pending",NOTIFICATION_DELIVERED:"task.notification.delivered",NOTIFICATION_OFFLINE:"task.notification.offline"});new Set(Object.values(it));[...Object.values(Me),...Object.values(f0)];const DC=Object.freeze({state:"available",holder:null});function d0({connectionState:e="connecting"}={}){return{connectionState:e,voiceReady:!1,voiceState:"idle",wakeWordActive:!1,ownership:{...DC},currentTurnId:""}}function h0(e,n){return!e?.turnId||e.turnId===n||e.origin!=="model"}function MC(e,n){const r=e||d0();if(!n||typeof n!="object")return r;switch(n.type){case Me.GATEWAY_CONNECTED:return{...r,connectionState:"connecting",voiceReady:!1};case Me.GATEWAY_DISCONNECTED:return{...r,connectionState:"unavailable",voiceReady:!1,voiceState:"idle"};case Me.VOICE_READY:return n.inputSampleRate?{...r,connectionState:"connected",voiceReady:!0}:r;case Me.VOICE_CONNECTION:return{...r,connectionState:n.state||"connecting",voiceReady:n.state==="connected"?r.voiceReady:!1};case Me.TURN_STARTED:return{...r,currentTurnId:n.turnId||""};case Me.VOICE_STATE:return h0(n,r.currentTurnId)?{...r,voiceState:n.state||r.voiceState}:r;case Me.VOICE_SLEEP:return n.state!=="enabled"&&n.state!=="disabled"?r:{...r,wakeWordActive:n.state==="enabled"};case Me.VOICE_OWNERSHIP:return{...r,ownership:{state:n.state||"available",holder:n.holder||null}};case Me.VOICE_DEACTIVATED:return{...r,ownership:{state:"busy",holder:n.holder||null}};default:return r}}function p0(e){const n=Object.values(e).filter(l=>typeof l=="number");return Object.entries(e).filter(([l,o])=>n.indexOf(+l)===-1).map(([l,o])=>o)}function Wy(e,n="|"){return e.map(r=>y0(r)).join(n)}function hd(e,n){return typeof n=="bigint"?n.toString():n}function ts(e){return{get value(){{const n=e();return Object.defineProperty(this,"value",{value:n}),n}}}}function IC(e){return e==null}function Vd(e){const n=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(n,r)}function LC(e,n){const r=e/n,l=Math.round(r),o=4*Number.EPSILON*Math.max(Math.abs(r),1);return Math.abs(r-l)<o?0:r-l}function Rn(e,n,r){Object.defineProperty(e,n,{value:r,writable:!0,enumerable:!0,configurable:!0})}function jr(...e){const n={};for(const r of e){const l=Object.getOwnPropertyDescriptors(r);Object.assign(n,l)}return Object.defineProperties({},n)}function UC(e){return JSON.stringify(e)}function jC(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const m0="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function lu(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const BC=ts(()=>{if(wi.jitless||typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{const e=Function;return new e(""),!0}catch{return!1}});function Qa(e){if(lu(e)===!1)return!1;const n=e.constructor;if(n===void 0||typeof n!="function")return!0;const r=n.prototype;return!(lu(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}function g0(e){return Qa(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}const qC=new Set(["string","number","symbol"]);function Ja(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Br(e,n,r){const l=new e._zod.constr(n??e._zod.def);return(!n||r?.parent)&&(l._zod.parent=e),l}function xe(e){const n=e;if(!n)return{};if(typeof n=="string")return{error:()=>n};if(n?.message!==void 0){if(n?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");n.error=n.message}return delete n.message,typeof n.error=="string"?{...n,error:()=>n.error}:n}function y0(e){return typeof e=="bigint"?e.toString()+"n":typeof e=="string"?`"${e}"`:`${e}`}function HC(e){return Object.keys(e).filter(n=>e[n]._zod.optin!==void 0&&e[n]._zod.optout==="optional")}const PC={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function ZC(e,n){const r=e._zod.def,l=r.checks;if(l&&l.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");const s=jr(e._zod.def,{get shape(){const c={};for(const d of Reflect.ownKeys(n)){if(!Object.prototype.hasOwnProperty.call(r.shape,d))throw new Error(`Unrecognized key: "${String(d)}"`);n[d]&&Rn(c,d,r.shape[d])}return Rn(this,"shape",c),c},checks:[]});return Br(e,s)}function GC(e,n){const r=e._zod.def,l=r.checks;if(l&&l.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");const s=jr(e._zod.def,{get shape(){const c={...e._zod.def.shape};for(const d of Reflect.ownKeys(n)){if(!Object.prototype.hasOwnProperty.call(r.shape,d))throw new Error(`Unrecognized key: "${String(d)}"`);n[d]&&delete c[d]}return Rn(this,"shape",c),c},checks:[]});return Br(e,s)}function VC(e,n){if(!Qa(n))throw new Error("Invalid input to extend: expected a plain object");const r=e._zod.def.checks;if(r&&r.length>0){const s=e._zod.def.shape;for(const c of Reflect.ownKeys(n))if(Object.getOwnPropertyDescriptor(s,c)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}const o=jr(e._zod.def,{get shape(){const s={...e._zod.def.shape,...n};return Rn(this,"shape",s),s}});return Br(e,o)}function $C(e,n){if(!Qa(n))throw new Error("Invalid input to safeExtend: expected a plain object");const r=jr(e._zod.def,{get shape(){const l={...e._zod.def.shape,...n};return Rn(this,"shape",l),l}});return Br(e,r)}function YC(e,n){if(!n?._zod?.def)throw new Error("Invalid input to merge: expected an object schema. To merge a plain shape, use `.extend()`.");if(e._zod.def.checks?.length)throw new Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");const r=jr(e._zod.def,{get shape(){const l={...e._zod.def.shape,...n._zod.def.shape};return Rn(this,"shape",l),l},get catchall(){return n._zod.def.catchall},checks:n._zod.def.checks??[]});return Br(e,r)}function eb(e,n,r,l="partial"){const s=n._zod.def.checks;if(s&&s.length>0)throw new Error(`.${l}() cannot be used on object schemas containing refinements`);const d=jr(n._zod.def,{get shape(){const m=n._zod.def.shape,p={...m};if(r)for(const y of Reflect.ownKeys(r)){if(!Object.prototype.hasOwnProperty.call(m,y))throw new Error(`Unrecognized key: "${String(y)}"`);r[y]&&(p[y]=e?new e({type:"optional",innerType:m[y]}):m[y])}else for(const y of Reflect.ownKeys(m))p[y]=e?new e({type:"optional",innerType:m[y]}):m[y];return Rn(this,"shape",p),p},checks:[]});return Br(n,d)}function FC(e,n,r){const l=jr(n._zod.def,{get shape(){const o=n._zod.def.shape,s={...o};if(r)for(const c of Reflect.ownKeys(r)){if(!Object.prototype.hasOwnProperty.call(s,c))throw new Error(`Unrecognized key: "${String(c)}"`);r[c]&&(s[c]=new e({type:"nonoptional",innerType:o[c]}))}else for(const c of Reflect.ownKeys(o))s[c]=new e({type:"nonoptional",innerType:o[c]});return Rn(this,"shape",s),s}});return Br(n,l)}function $a(e,n=0){if(e.aborted===!0)return!0;for(let r=n;r<e.issues.length;r++)if(e.issues[r]?.continue!==!0)return!0;return!1}function KC(e,n=0){if(e.aborted===!0)return!0;for(let r=n;r<e.issues.length;r++)if(e.issues[r]?.continue===!1)return!0;return!1}function Ya(e,n){return n.map(r=>{var l;return(l=r).path??(l.path=[]),r.path.unshift(e),r})}function Xl(e){return typeof e=="string"?e:e?.message}function tb(e,n,r){var l;for(let o=n;o<e.length;o++)(l=e[o]).schema??(l.schema=r)}function Ir(e,n,r){var l;const o=e.inst?._zod?.traits;o?.has("$ZodType")&&(o.has("$ZodCheck")?(l=e).schema??(l.schema=e.inst):e.schema=e.inst);const s=e.schema!==e.inst?e.schema?._zod.def?.error:void 0,c=e.message?e.message:Xl(e.inst?._zod.def?.error?.(e))??Xl(s?.(e))??Xl(n?.error?.(e))??Xl(r.customError?.(e))??Xl(r.localeError?.(e))??"Invalid input",{inst:d,schema:m,continue:p,input:y,...g}=e;return g.path??(g.path=[]),g.message=c,n?.reportInput&&(g.input=y),g}const XC=/[\uD800-\uDBFF]/;function $d(e){const n=e.length;if(!XC.test(e))return n;let r=n;for(let l=0;l<n-1;l++)(e.charCodeAt(l)&64512)===55296&&(e.charCodeAt(l+1)&64512)===56320&&(r--,l++);return r}function Yd(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function QC(e){const n=typeof e;switch(n){case"number":return Number.isNaN(e)?"nan":"number";case"object":{if(e===null)return"null";if(Array.isArray(e))return"array";const r=e;if(r&&Object.getPrototypeOf(r)!==Object.prototype&&"constructor"in r&&r.constructor)return r.constructor.name}}return n}function uu(...e){const[n,r,l]=e;return typeof n=="string"?{message:n,code:"custom",input:r,inst:l}:{...n}}function JC(e,n){for(const r in n){const l=Object.getOwnPropertyDescriptor(n,r);l.get?Object.defineProperty(e,r,{...l,enumerable:!1}):WC(e,r,l.value)}}function Wa(e,n,r,l=!0){return Object.defineProperty(e,n,{configurable:!0,writable:!0,enumerable:l,value:r}),r}function b0(e,n,r){return Wa(e,n,r,!1)}function WC(e,n,r){Object.defineProperty(e,n,{configurable:!0,get(){return this==null?r:Wa(this,n,r.bind(this))},set(l){Wa(this,n,l)}})}function ez(e,n){const r=Object.getPrototypeOf(e);return n in r?void 0:r}let Hf,Mr=!1;const tz={configurable:!0,get(){Mr=!0}};function ht(e,n,r){const l=Object.getPrototypeOf(e._zod);if(n in l&&Hf!==e._zod){Hf=void 0;return}Hf=e._zod,Object.defineProperty(l,n,{configurable:!0,get(){Object.defineProperty(this,n,tz);const o=Mr;Mr=!1;try{const s=r(this);return Mr?delete this[n]:Object.defineProperty(this,n,{configurable:!0,writable:!0,value:s}),Mr=Mr||o,s}catch(s){throw delete this[n],Mr=Mr||o,s}},set(o){Object.defineProperty(this,n,{configurable:!0,writable:!0,value:o})}})}function nz(e,n,r,l){const o=ez(e,n);o&&Object.defineProperty(o,n,{configurable:!0,get(){const s={configurable:!0,writable:!0,enumerable:l,value:void 0};return Object.defineProperty(this,n,s),s.value=r(this),Object.defineProperty(this,n,s),s.value},set(s){Object.defineProperty(this,n,{configurable:!0,writable:!0,enumerable:l,value:s})}})}const iz="~constantCatch";function rz(e){const n=()=>e;return n[iz]=!0,n}var nb;const Pf={value:void 0,enumerable:!1};let ib="captureStackTrace"in Error?Error:null;function az(e){const n=ib;if(n){const r=n.stackTraceLimit;if(typeof r=="number"){try{n.stackTraceLimit=0}catch{return ib=null,new e}try{return new e}finally{n.stackTraceLimit=r}}}return new e}function Q(e,n,r,l){const o={};function s(S){this.def=S,this.constr=g,this.traits=new Set}s.prototype=o;const c=r,d=c&&new WeakSet;function m(S,v){if(!S._zod){Pf.value=new s(v);try{Object.defineProperty(S,"_zod",Pf)}finally{Pf.value=void 0}}if(S._zod.traits.has(e))return;if(S._zod.traits.add(e),n(S,v),d){const N=Object.getPrototypeOf(S),M=S._zod.constr.prototype;let A=N;for(;A&&A!==M;)A=Object.getPrototypeOf(A);const V=A??N;d.has(V)||(d.add(V),JC(V,c))}const _=g.prototype;for(const N in _)Object.prototype.hasOwnProperty.call(_,N)&&(N in S||(S[N]=_[N].bind(S)))}const p=l?.Parent??Object;class y extends p{}Object.defineProperty(y,"name",{value:e});function g(S){const v=l?.Parent?az(y):this;m(v,S);const _=v._zod.deferred;if(_){for(const M of _)M();v._zod.deferred=void 0}const N=globalThis.__zod_globalConfig?.postProcessor;return N&&N(v),v}return Object.defineProperty(g,"init",{value:m}),Object.defineProperty(g,Symbol.hasInstance,{value:S=>l?.Parent&&S instanceof l.Parent?!0:S?._zod?.traits?.has(e)}),Object.defineProperty(g,"name",{value:e}),g}class Ka extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class S0 extends Error{constructor(n){super(`Encountered unidirectional transform during encode: ${n}`),this.name="ZodEncodeError"}}(nb=globalThis).__zod_globalConfig??(nb.__zod_globalConfig={});const wi=globalThis.__zod_globalConfig;function Mi(e){return e&&Object.assign(wi,e),wi}function lz(){const e=this._zod;return e.message??(e.message=JSON.stringify(e.def,hd,2)),e.message}function uz(e){this._zod.message=e}const oz={get:lz,set:uz,enumerable:!0,configurable:!0},Zf={value:void 0,enumerable:!1},Gf={value:void 0,enumerable:!1},rb=new WeakSet([Object.prototype,Error.prototype]),v0=(e,n)=>{e.name="$ZodError",Zf.value=e._zod,Object.defineProperty(e,"_zod",Zf),Gf.value=n,Object.defineProperty(e,"issues",Gf),Zf.value=void 0,Gf.value=void 0,Object.defineProperty(e,"message",oz);const r=Object.getPrototypeOf(e);rb.has(r)||(rb.add(r),Object.defineProperty(r,"toString",{configurable:!0,enumerable:!1,get(){const l=()=>this.message;return Object.defineProperty(this,"toString",{value:l,configurable:!0,writable:!0}),l},set(l){Object.defineProperty(this,"toString",{value:l,configurable:!0,writable:!0})}}))},E0=Q("$ZodError",v0),_0=Q("$ZodError",v0,void 0,{Parent:Error});function sz(e,n,r){return Object.prototype.hasOwnProperty.call(e,n)||(n==="__proto__"?Object.defineProperty(e,n,{value:r(),writable:!0,enumerable:!0,configurable:!0}):e[n]=r()),e[n]}function cz(e,n=r=>r.message){const r={},l=[];for(const o of e.issues)o.path.length>0?sz(r,o.path[0],()=>[]).push(n(o)):l.push(n(o));return{formErrors:l,fieldErrors:r}}function fz(e,n=r=>r.message){const r={_errors:[]},l=(o,s=[])=>{for(const c of o.issues)if(c.code==="invalid_union"&&c.errors.length)c.errors.map(d=>l({issues:d},[...s,...c.path]));else if(c.code==="invalid_key")l({issues:c.issues},[...s,...c.path]);else if(c.code==="invalid_element")l({issues:c.issues},[...s,...c.path]);else{const d=[...s,...c.path];if(d.length===0)r._errors.push(n(c));else{let m=r,p=0;for(;p<d.length;){const y=d[p],g=p===d.length-1;if(y==="_errors"){g&&m._errors.push(n(c)),p++;continue}Object.prototype.hasOwnProperty.call(m,y)||Object.defineProperty(m,y,{value:{_errors:[]},enumerable:!0,writable:!0,configurable:!0});const S=m[y];g&&S._errors.push(n(c)),m=S,p++}}}};return l(e),r}function ns(e,n){return{callee:n?.callee??e,Err:n?.Err}}const Fd=e=>{const n=(r,l,o,s)=>{const c=o?{...o,async:!1}:{async:!1},d=r._zod.run({value:l,issues:[]},c);if(d instanceof Promise)throw new Ka;if(d.issues.length){const m=new(s?.Err??e)(d.issues.map(p=>Ir(p,c,Mi())));throw m0(m,s?.callee??n),m}return d.value};return n},Kd=e=>{const n=async(r,l,o,s)=>{const c=o?{...o,async:!0}:{async:!0};let d=r._zod.run({value:l,issues:[]},c);if(d instanceof Promise&&(d=await d),d.issues.length){const m=new(s?.Err??e)(d.issues.map(p=>Ir(p,c,Mi())));throw m0(m,s?.callee??n),m}return d.value};return n},is=e=>(n,r,l)=>{const o=l?{...l,async:!1}:{async:!1},s=n._zod.run({value:r,issues:[]},o);if(s instanceof Promise)throw new Ka;return s.issues.length?{success:!1,error:new(e??E0)(s.issues.map(c=>Ir(c,o,Mi())))}:{success:!0,data:s.value}},dz=is(_0),rs=e=>async(n,r,l)=>{const o=l?{...l,async:!0}:{async:!0};let s=n._zod.run({value:r,issues:[]},o);return s instanceof Promise&&(s=await s),s.issues.length?{success:!1,error:new e(s.issues.map(c=>Ir(c,o,Mi())))}:{success:!0,data:s.value}},hz=rs(_0),pz=e=>{const n=Fd(e),r=(l,o,s,c)=>{const d=s?{...s,direction:"backward"}:{direction:"backward"};return n(l,o,d,ns(r,c))};return r},mz=e=>{const n=Fd(e),r=(l,o,s,c)=>n(l,o,s,ns(r,c));return r},gz=e=>{const n=Kd(e),r=async(l,o,s,c)=>{const d=s?{...s,direction:"backward"}:{direction:"backward"};return await n(l,o,d,ns(r,c))};return r},yz=e=>{const n=Kd(e),r=async(l,o,s,c)=>await n(l,o,s,ns(r,c));return r},bz=e=>(n,r,l)=>{const o=l?{...l,direction:"backward"}:{direction:"backward"};return is(e)(n,r,o)},Sz=e=>(n,r,l)=>is(e)(n,r,l),vz=e=>async(n,r,l)=>{const o=l?{...l,direction:"backward"}:{direction:"backward"};return rs(e)(n,r,o)},Ez=e=>async(n,r,l)=>rs(e)(n,r,l),_z=/^[cC][0-9a-z]{6,}$/,Tz=/^[0-9a-z]+$/,kz=/^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$/,wz=/^[0-9a-vA-V]{20}$/,Az=/^[A-Za-z0-9]{27}$/,xz=/^[a-zA-Z0-9_-]{21}$/;function Oz(e){return new RegExp(`^[a-zA-Z0-9_-]{${e}}$`)}const Cz=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,zz=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,ab=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,Nz=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,Rz="^[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$";function Dz(){return new RegExp(Rz,"u")}const Mz=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,Iz=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,Lz=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,Uz=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,jz=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,T0=/^[A-Za-z0-9_-]*$/,Bz=/^https?$/,qz=/^\+[1-9]\d{6,14}$/,k0="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))";function Hz(e){return new RegExp(`^${e}$`)}const Pz=Hz(k0);function pd(e){const n="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${n}`:e.precision===0?`${n}:[0-5]\\d`:`${n}:[0-5]\\d\\.\\d{${e.precision}}`:e.seconds?`${n}:[0-5]\\d(?:\\.\\d+)?`:`${n}(?::[0-5]\\d(?:\\.\\d+)?)?`}function Zz(e){return new RegExp(`^${pd(e)}$`)}function Gz(e){const n=["Z"];e.offset&&n.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const r=`${pd({precision:e.precision,seconds:!0})}(?:${n.join("|")})`,l=e.local?`${r}|${pd({precision:e.precision})}`:r;return new RegExp(`^${k0}T(?:${l})$`)}const Vz=e=>{const n=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${n}$`)},w0=/^-?\d+$/,Xd=/^-?\d+(?:\.\d+)?$/,$z=/^(?:true|false)$/i,Yz=/^[^A-Z]*$/,Fz=/^[^a-z]*$/,Gn=Q("$ZodCheck",(e,n)=>{var r;e._zod??(e._zod={}),e._zod.def=n,(r=e._zod).onattach??(r.onattach=[])}),Qd=e=>{const n=e.value;return!IC(n)&&n.length!==void 0},Po={number:"number",bigint:"bigint",object:"date"},A0=Q("$ZodCheckLessThan",(e,n)=>{Gn.init(e,n);const r=Po[typeof n.value];e._zod.onattach.push(l=>{const o=l._zod.bag,s=(n.inclusive?o.maximum:o.exclusiveMaximum)??Number.POSITIVE_INFINITY;n.value<s&&(n.inclusive?o.maximum=n.value:o.exclusiveMaximum=n.value)}),e._zod.check=l=>{(n.inclusive?l.value<=n.value:l.value<n.value)||l.issues.push({origin:Po[typeof l.value]??r,code:"too_big",maximum:typeof n.value=="object"?n.value.getTime():n.value,input:l.value,inclusive:n.inclusive,inst:e,continue:!n.abort})}}),x0=Q("$ZodCheckGreaterThan",(e,n)=>{Gn.init(e,n);const r=Po[typeof n.value];e._zod.onattach.push(l=>{const o=l._zod.bag,s=(n.inclusive?o.minimum:o.exclusiveMinimum)??Number.NEGATIVE_INFINITY;n.value>s&&(n.inclusive?o.minimum=n.value:o.exclusiveMinimum=n.value)}),e._zod.check=l=>{(n.inclusive?l.value>=n.value:l.value>n.value)||l.issues.push({origin:Po[typeof l.value]??r,code:"too_small",minimum:typeof n.value=="object"?n.value.getTime():n.value,input:l.value,inclusive:n.inclusive,inst:e,continue:!n.abort})}}),Kz=Q("$ZodCheckMultipleOf",(e,n)=>{Gn.init(e,n),e._zod.onattach.push(r=>{var l;(l=r._zod.bag).multipleOf??(l.multipleOf=n.value)}),e._zod.check=r=>{if(typeof r.value!=typeof n.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof r.value=="bigint"?n.value!==BigInt(0)&&r.value%n.value===BigInt(0):LC(r.value,n.value)===0)||r.issues.push({origin:typeof r.value,code:"not_multiple_of",divisor:n.value,input:r.value,inst:e,continue:!n.abort})}}),Xz=Q("$ZodCheckNumberFormat",(e,n)=>{Gn.init(e,n),n.format=n.format||"float64";const r=n.format?.includes("int"),l=r?"int":"number",[o,s]=PC[n.format];e._zod.onattach.push(c=>{const d=c._zod.bag;d.format=n.format,d.minimum=o,d.maximum=s,r&&(d.pattern=w0)}),e._zod.check=c=>{const d=c.value;if(r){if(!Number.isInteger(d)){c.issues.push({expected:l,format:n.format,code:"invalid_type",continue:!1,input:d,inst:e});return}if(!Number.isSafeInteger(d)){d>0?c.issues.push({input:d,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:l,inclusive:!0,continue:!n.abort}):c.issues.push({input:d,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:l,inclusive:!0,continue:!n.abort});return}}d<o&&c.issues.push({origin:"number",input:d,code:"too_small",minimum:o,inclusive:!0,inst:e,continue:!n.abort}),d>s&&c.issues.push({origin:"number",input:d,code:"too_big",maximum:s,inclusive:!0,inst:e,continue:!n.abort})}}),Qz=Q("$ZodCheckMaxLength",(e,n)=>{var r;Gn.init(e,n),(r=e._zod.def).when??(r.when=Qd),e._zod.onattach.push(l=>{const o=l._zod.bag.maximum??Number.POSITIVE_INFINITY;n.maximum<o&&(l._zod.bag.maximum=n.maximum)}),e._zod.check=l=>{const o=l.value,s=o.length;if((typeof o=="string"&&s>n.maximum?$d(o):s)<=n.maximum)return;const d=Yd(o);l.issues.push({origin:d,code:"too_big",maximum:n.maximum,inclusive:!0,input:o,inst:e,continue:!n.abort})}}),Jz=Q("$ZodCheckMinLength",(e,n)=>{var r;Gn.init(e,n),(r=e._zod.def).when??(r.when=Qd),e._zod.onattach.push(l=>{const o=l._zod.bag.minimum??Number.NEGATIVE_INFINITY;n.minimum>o&&(l._zod.bag.minimum=n.minimum)}),e._zod.check=l=>{const o=l.value,s=o.length;if((typeof o=="string"&&s>=n.minimum&&s<n.minimum*2?$d(o):s)>=n.minimum)return;const d=Yd(o);l.issues.push({origin:d,code:"too_small",minimum:n.minimum,inclusive:!0,input:o,inst:e,continue:!n.abort})}}),Wz=Q("$ZodCheckLengthEquals",(e,n)=>{var r;Gn.init(e,n),(r=e._zod.def).when??(r.when=Qd),e._zod.onattach.push(l=>{const o=l._zod.bag;o.minimum=n.length,o.maximum=n.length,o.length=n.length}),e._zod.check=l=>{const o=l.value,s=o.length,c=typeof o=="string"&&s>=n.length&&s<=n.length*2?$d(o):s;if(c===n.length)return;const d=Yd(o),m=c>n.length;l.issues.push({origin:d,...m?{code:"too_big",maximum:n.length}:{code:"too_small",minimum:n.length},inclusive:!0,exact:!0,input:l.value,inst:e,continue:!n.abort})}}),as=Q("$ZodCheckStringFormat",(e,n)=>{var r,l;Gn.init(e,n),e._zod.onattach.push(o=>{const s=o._zod.bag;s.format=n.format,n.pattern&&(s.patterns??(s.patterns=new Set),s.patterns.add(n.pattern))}),n.pattern?(r=e._zod).check??(r.check=o=>{n.pattern.lastIndex=0,!n.pattern.test(o.value)&&o.issues.push({origin:"string",code:"invalid_format",format:n.format,input:o.value,...n.pattern?{pattern:n.pattern.toString()}:{},inst:e,continue:!n.abort})}):(l=e._zod).check??(l.check=()=>{})}),eN=Q("$ZodCheckRegex",(e,n)=>{as.init(e,n),e._zod.check=r=>{n.pattern.lastIndex=0,!n.pattern.test(r.value)&&r.issues.push({origin:"string",code:"invalid_format",format:"regex",input:r.value,pattern:n.pattern.toString(),inst:e,continue:!n.abort})}}),tN=Q("$ZodCheckLowerCase",(e,n)=>{n.pattern??(n.pattern=Yz),as.init(e,n)}),nN=Q("$ZodCheckUpperCase",(e,n)=>{n.pattern??(n.pattern=Fz),as.init(e,n)}),iN=Q("$ZodCheckIncludes",(e,n)=>{Gn.init(e,n);const r=Ja(n.includes),l=new RegExp(typeof n.position=="number"?`^.{${n.position},}${r}`:r);n.pattern=l,e._zod.onattach.push(o=>{const s=o._zod.bag;s.patterns??(s.patterns=new Set),s.patterns.add(l)}),e._zod.check=o=>{o.value.includes(n.includes,n.position)||o.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:n.includes,input:o.value,inst:e,continue:!n.abort})}}),rN=Q("$ZodCheckStartsWith",(e,n)=>{Gn.init(e,n);const r=new RegExp(`^${Ja(n.prefix)}.*`);n.pattern??(n.pattern=r),e._zod.onattach.push(l=>{const o=l._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(r)}),e._zod.check=l=>{l.value.startsWith(n.prefix)||l.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:n.prefix,input:l.value,inst:e,continue:!n.abort})}}),aN=Q("$ZodCheckEndsWith",(e,n)=>{Gn.init(e,n);const r=new RegExp(`.*${Ja(n.suffix)}$`);n.pattern??(n.pattern=r),e._zod.onattach.push(l=>{const o=l._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(r)}),e._zod.check=l=>{l.value.endsWith(n.suffix)||l.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:n.suffix,input:l.value,inst:e,continue:!n.abort})}}),lN=Q("$ZodCheckOverwrite",(e,n)=>{Gn.init(e,n),e._zod.check=r=>{r.value=n.tx(r.value)}});class uN{constructor(n=[],r={}){this.content=[],this.indent=0,this.args=n,this.closed=r}indented(n){this.indent+=1,n(this),this.indent-=1}write(n){if(typeof n=="function"){n(this,{execution:"sync"}),n(this,{execution:"async"});return}const l=n.split(`
|
|
40
|
-
`).filter(c=>c),o=Math.min(...l.map(c=>c.length-c.trimStart().length)),s=l.map(c=>c.slice(o)).map(c=>" ".repeat(this.indent*2)+c);for(const c of s)this.content.push(c)}compile(){const n=Function,r=this?.content??[""];return new n(...Object.keys(this.closed),`return function (${this.args.join(", ")}) {
|
|
41
|
-
${r.join(`
|
|
42
|
-
`)}
|
|
43
|
-
};`)(...Object.values(this.closed))}}const oN={major:4,minor:5,patch:4},Bt=Q("$ZodType",(e,n)=>{var r;e??(e={}),e._zod.def=n,e._zod.bag=e._zod.bag||{},e._zod.version=oN;const l=e._zod.def.checks,o=e._zod.traits.has("$ZodCheck")?[e,...l??[]]:l?.length?[...l]:[];for(const s of o)for(const c of s._zod.onattach)c(e);if(o.length===0)(r=e._zod).deferred??(r.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{const s=(d,m,p)=>{if(d.memo)return d;let y=$a(d),g;for(const S of m){if(S._zod.def.when){if(KC(d)||!S._zod.def.when(d))continue}else if(y)continue;const v=d.issues.length,_=S._zod.check(d);if(_ instanceof Promise&&p?.async===!1)throw new Ka;if(g||_ instanceof Promise)g=(g??Promise.resolve()).then(async()=>{await _,d.issues.length!==v&&(tb(d.issues,v,e),y||(y=$a(d,v)))});else{if(d.issues.length===v)continue;tb(d.issues,v,e),y||(y=$a(d,v))}}return g?g.then(()=>d):d},c=(d,m,p)=>{if($a(d))return d.aborted=!0,d;const y=s(m,o,p);if(y instanceof Promise){if(p.async===!1)throw new Ka;return y.then(g=>e._zod.parse(g,p))}return e._zod.parse(y,p)};e._zod.run=(d,m)=>{if(m.skipChecks)return e._zod.parse(d,m);if(m.direction==="backward"){const y=e._zod.parse({value:d.value,issues:[]},{...m,skipChecks:!0});return y instanceof Promise?y.then(g=>c(g,d,m)):c(y,d,m)}const p=e._zod.parse(d,m);if(p instanceof Promise){if(m.async===!1)throw new Ka;return p.then(y=>s(y,o,m))}return s(p,o,m)}}},{get"~standard"(){return b0(this,"~standard",O0(this))},set"~standard"(e){Wa(this,"~standard",e)}}),lb=e=>e.success?{value:e.data}:{issues:e.error?.issues};function O0(e){return{validate:n=>{try{return lb(dz(e,n))}catch{return hz(e,n).then(lb)}},vendor:"zod",version:1}}const Jd=Q("$ZodString",(e,n)=>{Bt.init(e,n),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??Vz(e._zod.bag),e._zod.parse=(r,l)=>{if(n.coerce)try{r.value=String(r.value)}catch{}return typeof r.value=="string"||r.issues.push({expected:"string",code:"invalid_type",input:r.value,inst:e}),r}}),It=Q("$ZodStringFormat",(e,n)=>{as.init(e,n),Jd.init(e,n)}),sN=Q("$ZodGUID",(e,n)=>{n.pattern??(n.pattern=zz),It.init(e,n)}),cN=Q("$ZodUUID",(e,n)=>{if(n.version){const l={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[n.version];if(l===void 0)throw new Error(`Invalid UUID version: "${n.version}"`);n.pattern??(n.pattern=ab(l))}else n.pattern??(n.pattern=ab());It.init(e,n)}),fN=Q("$ZodEmail",(e,n)=>{n.pattern??(n.pattern=Nz),It.init(e,n)}),C0=1,z0=2;function dN(e,n){if(!n.normalize&&n.protocol?.source===Bz.source&&!/^https?:\/\//i.test(e))return C0;try{return new URL(e)}catch{return z0}}const hN=/[\t\n\r]/g;function pN(e){return e.replace(hN,"")}function mN(e,n){return n.lastIndex=0,n.test(e.hostname)}function gN(e,n){return n.lastIndex=0,n.test(e.protocol.endsWith(":")?e.protocol.slice(0,-1):e.protocol)}const yN=Q("$ZodURL",(e,n)=>{It.init(e,n),e._zod.check=r=>{try{const l=r.value.trim(),o=dN(l,n);if(o===C0){r.issues.push({code:"invalid_format",format:"url",note:"Invalid URL format",input:r.value,inst:e,continue:!n.abort});return}if(o===z0){r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:e,continue:!n.abort});return}n.hostname&&!mN(o,n.hostname)&&r.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:n.hostname.source,input:r.value,inst:e,continue:!n.abort}),n.protocol&&!gN(o,n.protocol)&&r.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:n.protocol.source,input:r.value,inst:e,continue:!n.abort}),r.value=n.normalize?o.href:pN(l);return}catch{r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:e,continue:!n.abort})}}}),bN=Q("$ZodEmoji",(e,n)=>{n.pattern??(n.pattern=Dz()),It.init(e,n)}),SN=Q("$ZodNanoID",(e,n)=>{if(n.length!==void 0&&(!Number.isInteger(n.length)||n.length<1))throw new Error(`Invalid nanoid length: ${n.length}`);n.pattern??(n.pattern=n.length===void 0?xz:Oz(n.length)),It.init(e,n)}),vN=Q("$ZodCUID",(e,n)=>{n.pattern??(n.pattern=_z),It.init(e,n)}),EN=Q("$ZodCUID2",(e,n)=>{n.pattern??(n.pattern=Tz),It.init(e,n)}),_N=Q("$ZodULID",(e,n)=>{n.pattern??(n.pattern=kz),It.init(e,n)}),TN=Q("$ZodXID",(e,n)=>{n.pattern??(n.pattern=wz),It.init(e,n)}),kN=Q("$ZodKSUID",(e,n)=>{n.pattern??(n.pattern=Az),It.init(e,n)}),wN=Q("$ZodISODateTime",(e,n)=>{n.pattern??(n.pattern=Gz(n)),It.init(e,n),(n.local||n.precision===-1)&&(e._zod.bag.laxFormat=!0,e._zod.onattach.push(r=>{r._zod.bag.laxFormat=!0}))}),AN=Q("$ZodISODate",(e,n)=>{n.pattern??(n.pattern=Pz),It.init(e,n)}),xN=Q("$ZodISOTime",(e,n)=>{n.pattern??(n.pattern=Zz(n)),It.init(e,n)}),ON=Q("$ZodISODuration",(e,n)=>{n.pattern??(n.pattern=Cz),It.init(e,n)}),CN=Q("$ZodIPv4",(e,n)=>{n.pattern??(n.pattern=Mz),It.init(e,n),e._zod.bag.format="ipv4"}),zN=/^[0-9a-fA-F:.]+$/;function N0(e){if(!zN.test(e))return!1;try{return new URL(`http://[${e}]`),!0}catch{return!1}}const NN=Q("$ZodIPv6",(e,n)=>{n.pattern??(n.pattern=Iz),It.init(e,n),e._zod.bag.format="ipv6",e._zod.check=r=>{N0(r.value)||r.issues.push({code:"invalid_format",format:"ipv6",input:r.value,inst:e,continue:!n.abort})}}),RN=Q("$ZodCIDRv4",(e,n)=>{n.pattern??(n.pattern=Lz),It.init(e,n)});function DN(e){const n=e.split("/");if(n.length!==2)return!1;const[r,l]=n;if(!l)return!1;const o=Number(l);return`${o}`!==l||o<0||o>128?!1:N0(r)}const MN=Q("$ZodCIDRv6",(e,n)=>{n.pattern??(n.pattern=Uz),It.init(e,n),e._zod.check=r=>{DN(r.value)||r.issues.push({code:"invalid_format",format:"cidrv6",input:r.value,inst:e,continue:!n.abort})}});function R0(e){if(e==="")return!0;if(/\s/.test(e)||e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}const IN=Q("$ZodBase64",(e,n)=>{n.pattern??(n.pattern=jz),It.init(e,n),e._zod.bag.contentEncoding="base64",e._zod.check=r=>{R0(r.value)||r.issues.push({code:"invalid_format",format:"base64",input:r.value,inst:e,continue:!n.abort})}});function LN(e){if(!T0.test(e))return!1;const n=e.replace(/[-_]/g,l=>l==="-"?"+":"/"),r=n.padEnd(Math.ceil(n.length/4)*4,"=");return R0(r)}const UN=Q("$ZodBase64URL",(e,n)=>{n.pattern??(n.pattern=T0),It.init(e,n),e._zod.bag.contentEncoding="base64url",e._zod.check=r=>{LN(r.value)||r.issues.push({code:"invalid_format",format:"base64url",input:r.value,inst:e,continue:!n.abort})}}),jN=Q("$ZodE164",(e,n)=>{n.pattern??(n.pattern=qz),It.init(e,n)});function BN(e,n=null){try{const r=e.split(".");if(r.length!==3)return!1;const[l]=r;if(!l)return!1;const o=JSON.parse(atob(l));return!("typ"in o&&o?.typ!=="JWT"||!o.alg||n&&(!("alg"in o)||o.alg!==n))}catch{return!1}}const qN=Q("$ZodJWT",(e,n)=>{It.init(e,n),e._zod.check=r=>{BN(r.value,n.alg)||r.issues.push({code:"invalid_format",format:"jwt",input:r.value,inst:e,continue:!n.abort})}}),D0=Q("$ZodNumber",(e,n)=>{Bt.init(e,n),e._zod.pattern=e._zod.bag.pattern??Xd,e._zod.parse=(r,l)=>{if(n.coerce)try{r.value=Number(r.value)}catch{}const o=r.value;if(typeof o=="number"&&!Number.isNaN(o)&&Number.isFinite(o))return r;const s=typeof o=="number"?Number.isNaN(o)?"NaN":Number.isFinite(o)?void 0:String(o):void 0;return r.issues.push({expected:"number",code:"invalid_type",input:o,inst:e,...s?{received:s}:{}}),r}}),HN=Q("$ZodNumberFormat",(e,n)=>{Xz.init(e,n),D0.init(e,n)}),PN=Q("$ZodBoolean",(e,n)=>{Bt.init(e,n),e._zod.pattern=$z,e._zod.parse=(r,l)=>{if(n.coerce)try{r.value=!!r.value}catch{}const o=r.value;return typeof o=="boolean"||r.issues.push({expected:"boolean",code:"invalid_type",input:o,inst:e}),r}}),ZN=Q("$ZodUnknown",(e,n)=>{Bt.init(e,n),e._zod.parse=r=>r}),GN=Q("$ZodNever",(e,n)=>{Bt.init(e,n),e._zod.parse=(r,l)=>(r.issues.push({expected:"never",code:"invalid_type",input:r.value,inst:e}),r)});function ub(e,n,r){e.issues.length&&n.issues.push(...Ya(r,e.issues)),n.value[r]=e.value}const VN=Q("$ZodArray",(e,n)=>{Bt.init(e,n);const r=wi.memoizer;r?.attach(e),e._zod.parse=(l,o)=>{const s=l.value;if(!Array.isArray(s))return l.issues.push({expected:"array",code:"invalid_type",input:s,inst:e}),l;l.value=r?r.alloc(e,l,Array(s.length),o):Array(s.length);const c=[];for(let d=0;d<s.length;d++){const m=s[d],p=n.element._zod.run({value:m,issues:[]},o);p instanceof Promise?c.push(p.then(y=>ub(y,l,d))):ub(p,l,d)}return c.length?Promise.all(c).then(()=>l):l}});function Zo(e,n,r,l,o,s){const c=r in l,d=s==="optional";if(!(!c&&d&&o==="optional")){if(e.issues.length){if(o!==void 0&&d&&!c)return;n.issues.push(...Ya(r,e.issues))}if(!c&&o===void 0){e.issues.length||n.issues.push({code:"invalid_type",expected:"nonoptional",input:void 0,path:[r]});return}e.value===void 0?c&&(n.value[r]=void 0):n.value[r]=e.value}}const $N=[];function M0(e){const n=Object.keys(e.shape),r=Object.getOwnPropertySymbols(e.shape),l=r.length?r:$N,o=l.length?[...n,...l]:n;for(const c of o)if(!e.shape?.[c]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${String(c)}": expected a Zod schema`);const s=HC(e.shape);return{...e,allKeys:o,symbolKeys:l,keySet:new Set(n),numKeys:n.length,optionalKeys:new Set(s)}}function I0(e,n,r,l,o,s){const c=[],d=o.keySet,m=o.catchall._zod,p=m.def.type,y=m.optin,g=m.optout;for(const S in n){if(d.has(S))continue;if(S==="__proto__"){p==="never"&&c.push(S);continue}if(p==="never"){c.push(S);continue}const v=m.run({value:n[S],issues:[]},l);v instanceof Promise?e.push(v.then(_=>Zo(_,r,S,n,y,g))):Zo(v,r,S,n,y,g)}return c.length&&r.issues.push({code:"unrecognized_keys",keys:c,input:n,inst:s,continue:!0}),e.length?Promise.all(e).then(()=>r):r}const md=new WeakMap,YN=Q("$ZodObject",(e,n)=>{if(Bt.init(e,n),!Object.getOwnPropertyDescriptor(n,"shape")?.get){const m=n.shape;md.set(n,m),Object.defineProperty(n,"shape",{get:()=>{const p={...m};return Object.defineProperty(n,"shape",{value:p}),md.set(n,p),p}})}const l=ts(()=>M0(n));ht(e,"propValues",m=>{const p=m.def.shape,y={};for(const g in p){const S=p[g]._zod;if(S.values){Object.prototype.hasOwnProperty.call(y,g)||Rn(y,g,new Set);for(const v of S.values)y[g].add(v);S.optin!==void 0&&y[g].add(void 0)}}return y});const o=lu,s=n.catchall;let c;const d=wi.memoizer;d?.attach(e),e._zod.parse=(m,p)=>{c??(c=l.value);const y=m.value;if(!o(y))return m.issues.push({expected:"object",code:"invalid_type",input:y,inst:e}),m;m.value=d?d.alloc(e,m,{},p):{};const g=[],S=c.shape;for(const v of c.allKeys){if(v==="__proto__")continue;const _=S[v],N=_._zod.optin,M=_._zod.optout,A=_._zod.run({value:y[v],issues:[]},p);A instanceof Promise?g.push(A.then(V=>Zo(V,m,v,y,N,M))):Zo(A,m,v,y,N,M)}return s?I0(g,y,m,p,l.value,e):g.length?Promise.all(g).then(()=>m):m}}),FN=Q("$ZodObjectJIT",(e,n)=>{YN.init(e,n);const r=e._zod.parse,l=ts(()=>M0(n)),o=wi.memoizer,s=v=>{const _=l.value,N=_.symbolKeys,M=new uN(["payload","ctx"],{shape:v,inst:e,memo:o,syms:N}),A=ue=>`shape[${ue}]._zod.run({ value: input[${ue}], issues: [] }, ctx)`,V=(ue,D)=>`
|
|
44
|
-
for (let i = 0; i < ${ue}.issues.length; i++) {
|
|
45
|
-
const iss = ${ue}.issues[i];
|
|
46
|
-
iss.path = iss.path ? [${D}, ...iss.path] : [${D}];
|
|
47
|
-
payload.issues.push(iss);
|
|
48
|
-
}`;M.write("const input = payload.value;");const j=Object.create(null);let ae=0;for(const ue of _.allKeys)j[ue]=`key_${ae++}`;M.write(o?"const newResult = memo.alloc(inst, payload, {}, ctx);":"const newResult = {};");for(const ue of _.allKeys){if(ue==="__proto__")continue;const D=j[ue],$=typeof ue=="symbol"?`syms[${N.indexOf(ue)}]`:UC(ue),re=`${$} in input`,de=v[ue],U=de?._zod?.optin,te=U!==void 0,ne=de?._zod?.optout==="optional";if(M.write(`const ${D} = ${A($)};`),te&&ne){const Ae=U==="optional"?`${D}_present`:`${D}.value !== undefined || ${D}_present`;M.write(`
|
|
49
|
-
const ${D}_present = ${re};
|
|
50
|
-
if (!${D}.issues.length || ${D}_present) {
|
|
51
|
-
if (${D}.issues.length) {${V(D,$)}
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
if (${Ae}) {
|
|
55
|
-
newResult[${$}] = ${D}.value;
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
`)}else te?M.write(`
|
|
60
|
-
if (${D}.issues.length) {${V(D,$)}
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
if (${D}.value === undefined) {
|
|
64
|
-
if (${re}) {
|
|
65
|
-
newResult[${$}] = undefined;
|
|
66
|
-
}
|
|
67
|
-
} else {
|
|
68
|
-
newResult[${$}] = ${D}.value;
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
`):M.write(`
|
|
72
|
-
const ${D}_present = ${re};
|
|
73
|
-
if (${D}.issues.length) {${V(D,$)}
|
|
74
|
-
}
|
|
75
|
-
if (!${D}_present && !${D}.issues.length) {
|
|
76
|
-
payload.issues.push({
|
|
77
|
-
code: "invalid_type",
|
|
78
|
-
expected: "nonoptional",
|
|
79
|
-
input: undefined,
|
|
80
|
-
path: [${$}]
|
|
81
|
-
});
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
if (${D}_present) {
|
|
85
|
-
newResult[${$}] = ${D}.value;
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
`)}return M.write("payload.value = newResult;"),M.write("return payload;"),M.compile()};let c;const d=lu,m=!wi.jitless,y=m&&BC.value,g=n.catchall;let S;e._zod.parse=(v,_)=>{S??(S=l.value);const N=v.value;return d(N)?m&&y&&_?.async===!1&&_.jitless!==!0?(c||(c=s(n.shape)),v=c(v,_),g?I0([],N,v,_,S,e):v):r(v,_):(v.issues.push({expected:"object",code:"invalid_type",input:N,inst:e}),v)}});function ob(e,n,r,l){for(const s of e)if(s.issues.length===0)return n.value=s.value,n;const o=e.filter(s=>!$a(s));return o.length===1?(n.value=o[0].value,o[0]):(n.issues.push({code:"invalid_union",input:n.value,inst:r,errors:e.map(s=>s.issues.map(c=>Ir(c,l,Mi())))}),n)}const L0=Q("$ZodUnion",(e,n)=>{Bt.init(e,n),ht(e,"optin",l=>l.def.options.some(o=>o._zod.optin==="defaulted")?"defaulted":l.def.options.some(o=>o._zod.optin!==void 0)?"optional":void 0),ht(e,"optout",l=>l.def.options.some(o=>o._zod.optout==="optional")?"optional":void 0),ht(e,"values",l=>{if(l.def.options.every(o=>o._zod.values))return new Set(l.def.options.flatMap(o=>Array.from(o._zod.values)))}),ht(e,"pattern",l=>{if(l.def.options.every(o=>o._zod.pattern)){const o=l.def.options.map(s=>s._zod.pattern);return new RegExp(`^(${o.map(s=>Vd(s.source)).join("|")})$`)}});const r=n.options.length===1?n.options[0]._zod.run:null;e._zod.parse=(l,o)=>{if(r)return r(l,o);let s=!1;const c=[];for(const d of n.options){const m=d._zod.run({value:l.value,issues:[]},o);if(m instanceof Promise)c.push(m),s=!0;else{if(m.issues.length===0)return m;c.push(m)}}return s?Promise.all(c).then(d=>ob(d,l,e,o)):ob(c,l,e,o)}}),KN=Q("$ZodDiscriminatedUnion",(e,n)=>{n.inclusive=!1,L0.init(e,n);const r=e._zod.parse;ht(e,"propValues",o=>{const s={};for(const c of o.def.options){const d=c._zod.propValues;if(!d||Object.keys(d).length===0)throw new Error(`Invalid discriminated union option at index "${o.def.options.indexOf(c)}"`);for(const[m,p]of Object.entries(d)){Object.prototype.hasOwnProperty.call(s,m)||Rn(s,m,new Set);for(const y of p)s[m].add(y)}}return s}),n.options.forEach((o,s)=>{const c=md.get(o._zod.def);if(c&&!Object.prototype.hasOwnProperty.call(c,n.discriminator))throw new Error(`Invalid discriminated union option at index "${s}"`)});const l=ts(()=>{const o=n.options,s=new Map;for(const c of o){const d=c._zod.propValues?.[n.discriminator];if(!d||d.size===0)throw new Error(`Invalid discriminated union option at index "${n.options.indexOf(c)}"`);for(const m of d){if(s.has(m))throw new Error(`Duplicate discriminator value "${String(m)}"`);s.set(m,c)}}return s});e._zod.parse=(o,s)=>{const c=o.value;if(!lu(c))return o.issues.push({code:"invalid_type",expected:"object",input:c,inst:e}),o;const d=l.value.get(c?.[n.discriminator]);return d?d._zod.run(o,s):n.unionFallback||s.direction==="backward"?r(o,s):(o.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:n.discriminator,options:Array.from(l.value.keys()),input:c,path:[n.discriminator],inst:e}),o)}}),XN=Q("$ZodIntersection",(e,n)=>{Bt.init(e,n),e._zod.parse=(r,l)=>{const o=r.value,s=n.left._zod.run({value:o,issues:[]},l),c=n.right._zod.run({value:o,issues:[]},l);return s instanceof Promise||c instanceof Promise?Promise.all([s,c]).then(([m,p])=>sb(r,m,p)):sb(r,s,c)}});function gd(e,n){if(e===n)return{valid:!0,data:e};if(e instanceof Date&&n instanceof Date&&+e==+n)return{valid:!0,data:e};if(Qa(e)&&Qa(n)){const r=Object.keys(n),l=Object.keys(e).filter(s=>r.indexOf(s)!==-1),o={...e,...n};Object.prototype.hasOwnProperty.call(o,"__proto__")&&delete o.__proto__;for(const s of l){if(s==="__proto__")continue;const c=gd(e[s],n[s]);if(!c.valid)return{valid:!1,mergeErrorPath:[s,...c.mergeErrorPath]};o[s]=c.data}return{valid:!0,data:o}}if(Array.isArray(e)&&Array.isArray(n)){if(e.length!==n.length)return{valid:!1,mergeErrorPath:[]};const r=[];for(let l=0;l<e.length;l++){const o=e[l],s=n[l],c=gd(o,s);if(!c.valid)return{valid:!1,mergeErrorPath:[l,...c.mergeErrorPath]};r.push(c.data)}return{valid:!0,data:r}}return{valid:!1,mergeErrorPath:[]}}function sb(e,n,r){const l=new Map;let o;const s=new Map,c=(p,y)=>{let g;if(p.code==="unrecognized_keys"&&!p.path?.length)o??(o=p),g=p.keys;else if(p.code==="invalid_key"&&p.origin==="record"&&p.path?.length===1){const S=String(p.path[0]);s.has(S)||s.set(S,p),g=[S]}else return!1;for(const S of g)l.has(S)||l.set(S,{}),l.get(S)[y]=!0;return!0};for(const p of n.issues)c(p,"l")||e.issues.push(p);for(const p of r.issues)c(p,"r")||e.issues.push(p);const d=[...l].filter(([,p])=>p.l&&p.r).map(([p])=>p);if(d.length){const p=o?d.filter(y=>o.keys.includes(y)):[];p.length&&e.issues.push({...o,keys:p});for(const y of d)!p.includes(y)&&s.has(y)&&e.issues.push(s.get(y))}const m=gd(n.value,r.value);if(!m.valid){if($a(e))return e;throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(m.mergeErrorPath)}`)}return e.value=m.data,e}const QN=Q("$ZodRecord",(e,n)=>{Bt.init(e,n);const r=wi.memoizer;r?.attach(e),e._zod.parse=(l,o)=>{const s=l.value;if(!Qa(s))return l.issues.push({expected:"record",code:"invalid_type",input:s,inst:e}),l;const c=[],d=n.keyType._zod.values;if(d&&!n.partial){l.value=r?r.alloc(e,l,{},o):{};const m=new Set;for(const y of d)if(typeof y=="string"||typeof y=="number"||typeof y=="symbol"){if(m.add(typeof y=="number"?y.toString():y),y==="__proto__")continue;const g=n.keyType._zod.run({value:y,issues:[]},o);if(g instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(g.issues.length){l.issues.push({code:"invalid_key",origin:"record",issues:g.issues.map(_=>Ir(_,o,Mi())),input:y,path:[y],inst:e});continue}const S=g.value;if(S==="__proto__")continue;const v=n.valueType._zod.run({value:s[y],issues:[]},o);v instanceof Promise?c.push(v.then(_=>{_.issues.length&&l.issues.push(...Ya(y,_.issues)),l.value[S]=_.value})):(v.issues.length&&l.issues.push(...Ya(y,v.issues)),l.value[S]=v.value)}let p;for(const y in s)if(!m.has(y))if(n.mode==="loose"){if(y==="__proto__")continue;l.value[y]=s[y]}else p=p??[],p.push(y);p&&p.length>0&&l.issues.push({code:"unrecognized_keys",input:s,inst:e,keys:p,continue:!0})}else{l.value=r?r.alloc(e,l,{},o):{};let m;for(const p of Reflect.ownKeys(s)){if(p==="__proto__"||!Object.prototype.propertyIsEnumerable.call(s,p))continue;let y=n.keyType._zod.run({value:p,issues:[]},o);if(y instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof p=="string"&&Xd.test(p)&&y.issues.length){const _=n.keyType._zod.run({value:Number(p),issues:[]},o);if(_ instanceof Promise)throw new Error("Async schemas not supported in object keys currently");_.issues.length===0&&(y=_)}if(y.issues.length){n.mode==="loose"?l.value[p]=s[p]:d?(m=m??[],m.push(p)):l.issues.push({code:"invalid_key",origin:"record",issues:y.issues.map(_=>Ir(_,o,Mi())),input:p,path:[p],inst:e});continue}const S=y.value;if(S==="__proto__")continue;const v=n.valueType._zod.run({value:s[p],issues:[]},o);v instanceof Promise?c.push(v.then(_=>{_.issues.length&&l.issues.push(...Ya(p,_.issues)),l.value[S]=_.value})):(v.issues.length&&l.issues.push(...Ya(p,v.issues)),l.value[S]=v.value)}m&&m.length>0&&l.issues.push({code:"unrecognized_keys",input:s,inst:e,keys:m,continue:!0})}return c.length?Promise.all(c).then(()=>l):l}}),JN=Q("$ZodEnum",(e,n)=>{Bt.init(e,n);const r=p0(n.entries),l=new Set(r);e._zod.values=l;const o=r.filter(s=>qC.has(typeof s));e._zod.pattern=new RegExp(o.length?`^(${o.map(s=>Ja(s.toString())).join("|")})$`:"^[^\\s\\S]$"),e._zod.parse=(s,c)=>{const d=s.value;return l.has(d)||s.issues.push({code:"invalid_value",values:r,input:d,inst:e}),s}}),WN=Q("$ZodLiteral",(e,n)=>{Bt.init(e,n);const r=new Set(n.values);e._zod.values=r,e._zod.pattern=new RegExp(n.values.length?`^(${n.values.map(l=>typeof l=="string"?Ja(l):l?Ja(l.toString()):String(l)).join("|")})$`:"^[^\\s\\S]$"),e._zod.parse=(l,o)=>{const s=l.value;return r.has(s)||l.issues.push({code:"invalid_value",values:n.values,input:s,inst:e}),l}}),eR=Q("$ZodTransform",(e,n)=>{Bt.init(e,n),e._zod.optin="optional",wi.memoizer?.guard(e),e._zod.parse=(r,l)=>{if(l.direction==="backward")throw new S0(e.constructor.name);const o=n.transform(r.value,r);if(l.async)return(o instanceof Promise?o:Promise.resolve(o)).then(c=>(r.value=c,r));if(o instanceof Promise)throw new Ka;return r.value=o,r}});function cb(e,n){return e.value=n.issues.length?void 0:n.value,e}const U0=Q("$ZodOptional",(e,n)=>{Bt.init(e,n),ht(e,"optin",r=>r.def.innerType._zod.optin==="defaulted"?"defaulted":"optional"),e._zod.optout="optional",ht(e,"values",r=>{const l=r.def.innerType._zod.values;return l?new Set([...l,void 0]):void 0}),ht(e,"pattern",r=>{const l=r.def.innerType._zod.pattern;return l?new RegExp(`^(${Vd(l.source)})?$`):void 0}),e._zod.parse=(r,l)=>{if(r.value===void 0){if(n.innerType._zod.optin!=="defaulted")return r;const o=n.innerType._zod.run({value:r.value,issues:[]},l);return o instanceof Promise?o.then(s=>cb(r,s)):cb(r,o)}return n.innerType._zod.run(r,l)}}),tR=Q("$ZodExactOptional",(e,n)=>{U0.init(e,n),ht(e,"values",r=>r.def.innerType._zod.values),ht(e,"pattern",r=>r.def.innerType._zod.pattern),e._zod.parse=(r,l)=>n.innerType._zod.run(r,l)}),nR=Q("$ZodNullable",(e,n)=>{Bt.init(e,n),ht(e,"optin",r=>r.def.innerType._zod.optin),ht(e,"optout",r=>r.def.innerType._zod.optout),ht(e,"pattern",r=>{const l=r.def.innerType._zod.pattern;return l?new RegExp(`^(${Vd(l.source)}|null)$`):void 0}),ht(e,"values",r=>r.def.innerType._zod.values?new Set([...r.def.innerType._zod.values,null]):void 0),e._zod.parse=(r,l)=>r.value===null?r:n.innerType._zod.run(r,l)}),iR=Q("$ZodDefault",(e,n)=>{Bt.init(e,n),e._zod.optin="defaulted",ht(e,"values",r=>r.def.innerType._zod.values),e._zod.parse=(r,l)=>{if(l.direction==="backward")return n.innerType._zod.run(r,l);if(r.value===void 0)return r.value=n.defaultValue,r;const o=n.innerType._zod.run(r,l);return o instanceof Promise?o.then(s=>fb(s,n)):fb(o,n)}});function fb(e,n){return e.value===void 0&&(e.value=n.defaultValue),e}const rR=Q("$ZodPrefault",(e,n)=>{Bt.init(e,n),e._zod.optin="defaulted",ht(e,"values",r=>r.def.innerType._zod.values),e._zod.parse=(r,l)=>(l.direction==="backward"||r.value===void 0&&(r.value=n.defaultValue),n.innerType._zod.run(r,l))}),aR=Q("$ZodNonOptional",(e,n)=>{Bt.init(e,n),ht(e,"values",r=>{const l=r.def.innerType._zod.values;return l?new Set([...l].filter(o=>o!==void 0)):void 0}),e._zod.parse=(r,l)=>{const o=n.innerType._zod.run(r,l);return o instanceof Promise?o.then(s=>db(s,e)):db(o,e)}});function db(e,n){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:n}),e}function hb(e,n,r,l){return n.issues.length?(e.value=r.catchValue({...n,value:e.value,error:{issues:n.issues.map(o=>Ir(o,l,Mi()))},input:e.value}),e):(e.value=n.value,n.memo&&(e.memo=!0),e)}const lR=Q("$ZodCatch",(e,n)=>{Bt.init(e,n),ht(e,"optin",r=>r.def.innerType._zod.optin==="defaulted"?"defaulted":"optional"),ht(e,"optout",r=>r.def.innerType._zod.optout),ht(e,"values",r=>r.def.innerType._zod.values),e._zod.parse=(r,l)=>{if(l.direction==="backward")return n.innerType._zod.run(r,l);const o=n.innerType._zod.run({value:r.value,issues:[]},l);return o instanceof Promise?o.then(s=>hb(r,s,n,l)):hb(r,o,n,l)}}),uR=Q("$ZodPipe",(e,n)=>{Bt.init(e,n),ht(e,"values",r=>r.def.in._zod.values),ht(e,"optin",r=>r.def.in._zod.optin),ht(e,"optout",r=>r.def.out._zod.optout),ht(e,"propValues",r=>r.def.in._zod.propValues),e._zod.parse=(r,l)=>{if(l.direction==="backward"){const s=n.out._zod.run(r,l);return s instanceof Promise?s.then(c=>Oo(c,n.in,l)):Oo(s,n.in,l)}const o=n.in._zod.run(r,l);return o instanceof Promise?o.then(s=>Oo(s,n.out,l)):Oo(o,n.out,l)}});function Oo(e,n,r){return e.issues.some(l=>l.code!=="unrecognized_keys")?(e.aborted=!0,e):n._zod.run({value:e.value,issues:e.issues},r)}const oR=Q("$ZodReadonly",(e,n)=>{Bt.init(e,n),ht(e,"propValues",r=>r.def.innerType._zod.propValues),ht(e,"values",r=>r.def.innerType._zod.values),ht(e,"optin",r=>r.def.innerType?._zod?.optin),ht(e,"optout",r=>r.def.innerType?._zod?.optout),e._zod.parse=(r,l)=>{if(l.direction==="backward")return n.innerType._zod.run(r,l);const o=n.innerType._zod.run(r,l);return o instanceof Promise?o.then(pb):pb(o)}});function pb(e){return e.memo||(e.value=Object.freeze(e.value)),e}const sR=Q("$ZodCustom",(e,n)=>{Gn.init(e,n),Bt.init(e,n),e._zod.parse=(r,l)=>r,e._zod.check=r=>{const l=r.value,o=n.fn(l);if(o instanceof Promise)return o.then(s=>mb(s,r,l,e));mb(o,r,l,e)}});function mb(e,n,r,l){if(!e){const o={code:"custom",input:r,inst:l,path:[...l._zod.def.path??[]],continue:!l._zod.def.abort};l._zod.def.params&&(o.params=l._zod.def.params),n.issues.push(uu(o))}}class cR extends Error{constructor(){super("Cannot parse a reference cycle that closes through a transform"),this.name="ZodCyclicError"}}const yd="~memo",gb=[];function Vf(e){return e.map(n=>n.path?{...n,path:n.path.slice()}:{...n})}const yb=new WeakMap;function j0(e,n){const r=yb.get(e);if(r!==void 0)return r;if(n.has(e))return!0;n.add(e);let l=!1;const o=d=>{!l&&d?._zod&&j0(d,n)&&(l=!0)},s=e._zod.def;switch(s.type){case"object":{for(const d of Reflect.ownKeys(s.shape))o(s.shape[d]);o(s.catchall);break}case"array":o(s.element);break;case"tuple":for(const d of s.items)o(d);o(s.rest);break;case"record":case"map":o(s.keyType),o(s.valueType);break;case"set":o(s.valueType);break;case"union":for(const d of s.options)o(d);break;case"intersection":o(s.left),o(s.right);break;case"optional":case"nullable":case"default":case"prefault":case"catch":case"readonly":case"nonoptional":case"promise":case"success":o(s.innerType);break;case"pipe":o(s.in),o(s.out);break;case"function":o(s.input),o(s.output);break;case"lazy":o(e._zod.innerType);break;case"template_literal":case"string":case"number":case"int":case"boolean":case"bigint":case"symbol":case"undefined":case"null":case"void":case"never":case"any":case"unknown":case"date":case"nan":case"enum":case"literal":case"file":case"transform":case"custom":break;default:for(const d in s){const m=Object.getOwnPropertyDescriptor(s,d);if(!m||m.get)continue;const p=m.value;if(!(!p||typeof p!="object")){if(p._zod)o(p);else if(Array.isArray(p))for(const y of p)o(y)}}}return n.delete(e),yb.set(e,l),l}function fR(e,n){let r=e.buckets.get(n);return r||(r=new Map,e.buckets.set(n,r)),r}let Co;const zo=[],dR={alloc(e,n,r){const l=Co;if(!l)return r;Co=void 0;const o={value:r,issues:null};return l.set(n.value,o),zo.push(o),r},guard(e){var n;(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred.push(()=>{const r=e._zod.parse,l=(o,s)=>{if(s.direction!=="backward"&&pR(s,o.value))throw new cR;return r(o,s)};e._zod.parse=l,e._zod.run===r&&(e._zod.run=l)})},attach(e){var n;let r,l,o;(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred.push(()=>{const s=e._zod.parse,c=(d,m)=>{if(r===void 0&&(r=j0(e,new Set),!r))return e._zod.parse=s,e._zod.run===c&&(e._zod.run=s),s(d,m);const p=d.value;if(p===null||typeof p!="object")return s(d,m);let y=m[yd];y||(y={buckets:new Map,backEdges:void 0},m[yd]=y);let g;l===m?g=o:(g=fR(y,e),l=m,o=g);const S=g.get(p);if(S)return d.value=S.value,S.issues?S.issues.length&&d.issues.push(...Vf(S.issues)):(d.memo=!0,y.backEdges??(y.backEdges=new Set),y.backEdges.add(S.value)),d;Co=g;const v=zo.length,_=s(d,m);Co=void 0;const N=zo.length>v?zo.pop():void 0;return _ instanceof Promise?_.then(M=>(N&&(N.issues=M.issues.length?Vf(M.issues):gb),M)):(N&&(N.issues=_.issues.length?Vf(_.issues):gb),_)};e._zod.parse=c,e._zod.run===s&&(e._zod.run=c)})}};function hR(){return dR}function pR(e,n){const r=e[yd]?.backEdges;return r!==void 0&&n!==null&&typeof n=="object"&&r.has(n)}const mR=()=>{const e={string:{unit:"characters",verb:"to have"},file:{unit:"bytes",verb:"to have"},array:{unit:"items",verb:"to have"},set:{unit:"items",verb:"to have"},map:{unit:"entries",verb:"to have"}};function n(s){return e[s]??null}const r={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",mac:"MAC address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",credit_card:"credit card number",jwt:"JWT",template_literal:"input"},l={nan:"NaN"};function o(s,c){return s==="number"&&typeof c=="number"&&!Number.isFinite(c)?String(c):l[s]??s}return s=>{switch(s.code){case"invalid_type":{const c=o(s.expected),d=QC(s.input),m=o(d,s.input);return`Invalid input: expected ${c}, received ${m}`}case"invalid_value":return s.values.length===1?`Invalid input: expected ${y0(s.values[0])}`:`Invalid option: expected one of ${Wy(s.values,"|")}`;case"too_big":{const c=s.exact?"exactly ":s.inclusive?"<=":"<",d=n(s.origin);return d?`Too big: expected ${s.origin??"value"} to have ${c}${s.maximum.toString()} ${d.unit??"elements"}`:`Too big: expected ${s.origin??"value"} to be ${c}${s.maximum.toString()}`}case"too_small":{const c=s.exact?"exactly ":s.inclusive?">=":">",d=n(s.origin);return d?`Too small: expected ${s.origin} to have ${c}${s.minimum.toString()} ${d.unit}`:`Too small: expected ${s.origin} to be ${c}${s.minimum.toString()}`}case"invalid_format":{const c=s;return c.format==="starts_with"?`Invalid string: must start with "${c.prefix}"`:c.format==="ends_with"?`Invalid string: must end with "${c.suffix}"`:c.format==="includes"?`Invalid string: must include "${c.includes}"`:c.format==="regex"?`Invalid string: must match pattern ${c.pattern}`:`Invalid ${r[c.format]??s.format}`}case"not_multiple_of":return`Invalid number: must be a multiple of ${s.divisor}`;case"unrecognized_keys":return`Unrecognized key${s.keys.length>1?"s":""}: ${Wy(s.keys,", ")}`;case"invalid_key":return`Invalid key in ${s.origin}`;case"invalid_union":return s.options&&Array.isArray(s.options)&&s.options.length>0?`Invalid discriminator value. Expected ${s.options.map(d=>`'${d}'`).join(" | ")}`:s.inclusive===!1?"Invalid input: more than one option matched":"Invalid input";case"invalid_element":return`Invalid value in ${s.origin}`;default:return"Invalid input"}}};function gR(){return{localeError:mR()}}var bb;class yR{constructor(){this._map=new WeakMap,this._idmap=new Map}add(n,...r){const l=r[0];return this._map.set(n,l),l&&typeof l=="object"&&"id"in l&&this._idmap.set(l.id,n),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(n){const r=this._map.get(n);return r&&typeof r=="object"&&"id"in r&&this._idmap.delete(r.id),this._map.delete(n),this}get(n){const r=n._zod.parent;if(r){const l={...this.get(r)??{}};delete l.id;const o={...l,...this._map.get(n)};return Object.keys(o).length?o:void 0}return this._map.get(n)}has(n){return this._map.has(n)}}function bR(){return new yR}(bb=globalThis).__zod_globalRegistry??(bb.__zod_globalRegistry=bR());const Jl=globalThis.__zod_globalRegistry;function SR(e,n){return new e({type:"string",...xe(n)})}function vR(e,n){return new e({type:"string",format:"email",check:"string_format",abort:!1,...xe(n)})}function ER(e,n){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...xe(n)})}function _R(e,n){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...xe(n)})}function TR(e,n){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...xe(n)})}function kR(e,n){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...xe(n)})}function wR(e,n){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...xe(n)})}function AR(e,n){return new e({type:"string",format:"url",check:"string_format",abort:!1,...xe(n)})}function xR(e,n){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...xe(n)})}function OR(e,n){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...xe(n)})}function CR(e,n){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...xe(n)})}function zR(e,n){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...xe(n)})}function NR(e,n){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...xe(n)})}function RR(e,n){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...xe(n)})}function DR(e,n){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...xe(n)})}function MR(e,n){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...xe(n)})}function IR(e,n){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...xe(n)})}function LR(e,n){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...xe(n)})}function UR(e,n){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...xe(n)})}function jR(e,n){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...xe(n)})}function BR(e,n){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...xe(n)})}function qR(e,n){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...xe(n)})}function HR(e,n){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...xe(n)})}function PR(e,n){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...xe(n)})}function ZR(e,n){return new e({type:"string",format:"date",check:"string_format",...xe(n)})}function GR(e,n){return new e({type:"string",format:"time",check:"string_format",precision:null,...xe(n)})}function VR(e,n){return new e({type:"string",format:"duration",check:"string_format",...xe(n)})}function $R(e,n){return new e({type:"number",checks:[],...xe(n)})}function YR(e,n){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...xe(n)})}function FR(e,n){return new e({type:"boolean",...xe(n)})}function KR(e){return new e({type:"unknown"})}function XR(e,n){return new e({type:"never",...xe(n)})}function Sb(e,n){return new A0({check:"less_than",...xe(n),value:e,inclusive:!1})}function $f(e,n){return new A0({check:"less_than",...xe(n),value:e,inclusive:!0})}function vb(e,n){return new x0({check:"greater_than",...xe(n),value:e,inclusive:!1})}function Yf(e,n){return new x0({check:"greater_than",...xe(n),value:e,inclusive:!0})}function Eb(e,n){return new Kz({check:"multiple_of",...xe(n),value:e})}function B0(e,n){return new Qz({check:"max_length",...xe(n),maximum:e})}function Go(e,n){return new Jz({check:"min_length",...xe(n),minimum:e})}function q0(e,n){return new Wz({check:"length_equals",...xe(n),length:e})}function QR(e,n){return new eN({check:"string_format",format:"regex",...xe(n),pattern:e})}function JR(e){return new tN({check:"string_format",format:"lowercase",...xe(e)})}function WR(e){return new nN({check:"string_format",format:"uppercase",...xe(e)})}function e2(e,n){return new iN({check:"string_format",format:"includes",...xe(n),includes:e})}function t2(e,n){return new rN({check:"string_format",format:"starts_with",...xe(n),prefix:e})}function n2(e,n){return new aN({check:"string_format",format:"ends_with",...xe(n),suffix:e})}function nl(e){return new lN({check:"overwrite",tx:e})}function i2(e){return nl(n=>n.normalize(e))}function r2(){return nl(e=>e.trim())}function a2(){return nl(e=>e.toLowerCase())}function l2(){return nl(e=>e.toUpperCase())}function u2(){return nl(e=>jC(e))}function o2(e,n,r){return new e({type:"array",element:n,...xe(r)})}function s2(e,n,r){return new e({type:"custom",check:"custom",fn:n,...xe(r)})}function c2(e,n){const r=f2(l=>(l.addIssue=o=>{if(typeof o=="string")l.issues.push(uu(o,l.value,r._zod.def));else{const s=o;s.fatal&&(s.continue=!1),s.code??(s.code="custom"),"input"in s||(s.input=l.value),s.inst??(s.inst=r),s.continue??(s.continue=!r._zod.def.abort),l.issues.push(uu(s))}},e(l.value,l)),n);return r}function f2(e,n){const r=new Gn({check:"custom",...xe(n)});return r._zod.check=e,r}function nu(e,...n){for(const r of n)for(const l of Reflect.ownKeys(r))Object.prototype.propertyIsEnumerable.call(r,l)&&Rn(e,l,r[l]);return e}function H0(e){let n=e?.target??"draft-2020-12";return n==="draft-4"&&(n="draft-04"),n==="draft-7"&&(n="draft-07"),{processors:e.processors??{},metadataRegistry:e?.metadata??Jl,target:n,unrepresentable:e?.unrepresentable??"throw",override:e?.override??(()=>{}),io:e?.io??"output",counter:0,seen:new Map,sharedDefsExtractedFor:void 0,sharedEmitDoneFor:void 0,cycles:e?.cycles??"ref",reused:e?.reused??"inline",intersections:[],deferred:[],external:e?.external??void 0}}function Lr(e,n,r,l,o){const s=typeof n.unrepresentable=="function"?n.unrepresentable({zodSchema:e,path:l.path,message:o}):n.unrepresentable;if(s==="any")return!1;if(s===void 0||s==="throw")throw new Error(o);return Object.assign(r,s),!0}function nn(e,n,r={path:[],schemaPath:[]}){var l;const o=e._zod.def,s=n.seen.get(e);if(s)return s.count++,r.schemaPath.includes(e)&&(s.cycle=r.path),s.schema;const c={schema:{},count:1,cycle:void 0,path:r.path};n.seen.set(e,c),n.sharedDefsExtractedFor=void 0,n.sharedEmitDoneFor=void 0;const d=e._zod.toJSONSchema?.();if(d)c.schema=d;else{const y={...r,schemaPath:[...r.schemaPath,e],path:r.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(n,c.schema,y);else{const S=c.schema,v=n.processors[o.type];if(!v)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${o.type}`);v(e,n,S,y)}const g=e._zod.parent;g&&(c.ref||(c.ref=g),nn(g,n,y),n.seen.get(g).isParent=!0)}const m=n.metadataRegistry.get(e);return m&&nu(c.schema,m),n.io==="input"&&zn(e)&&(delete c.schema.examples,delete c.schema.default),n.io==="input"&&"_prefault"in c.schema&&((l=c.schema).default??(l.default=c.schema._prefault)),delete c.schema._prefault,n.seen.get(e).schema}function _b(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}function P0(e,n){const r=e.seen.get(n);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");if(e.external&&e.sharedDefsExtractedFor===e.external)return;const l=new Map;for(const c of e.seen.entries()){const d=e.metadataRegistry.get(c[0])?.id;if(d){const m=l.get(d);if(m&&m!==c[0])throw new Error(`Duplicate schema id "${d}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);l.set(d,c[0])}}const o=c=>{const d=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){const g=e.external.registry.get(c[0])?.id,S=e.external.uri??(_=>_);if(g)return{ref:S(g)};const v=c[1].defId??c[1].schema.id??`schema${e.counter++}`;return c[1].defId=v,{defId:v,ref:`${S("__shared")}#/${d}/${_b(v)}`}}const m="#",p=`${m}/${d}/`;if(c[1]===r&&!c[1].schema.id)return{ref:m};const y=c[1].schema.id??`__schema${e.counter++}`;return{defId:y,ref:p+_b(y)}},s=c=>{if(c[1].schema.$ref)return;const d=c[1],{ref:m,defId:p}=o(c);d.def={...d.schema},p&&(d.defId=p);const y=d.schema;for(const g in y)delete y[g];y.$ref=m};if(e.cycles==="throw")for(const c of e.seen.entries()){const d=c[1];if(d.cycle)throw new Error(`Cycle detected: #/${d.cycle?.join("/")}/<root>
|
|
89
|
-
|
|
90
|
-
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const c of e.seen.entries()){const d=c[1];if(n===c[0]){s(c);continue}if(e.external){const p=e.external.registry.get(c[0])?.id;if(n!==c[0]&&p){s(c);continue}}if(e.metadataRegistry.get(c[0])?.id){s(c);continue}if(d.cycle){s(c);continue}if(d.count>1&&e.reused==="ref"){s(c);continue}}e.external&&(e.sharedDefsExtractedFor=e.external)}function Z0(e){const n=e.anyOf;if(!Array.isArray(n)||n.length===0||e.type!==void 0)return;const r=[];for(const l of n){if(!l||typeof l!="object")return;Z0(l);const o=Object.keys(l);if(o.length!==1||o[0]!=="type")return;const s=l.type;for(const c of Array.isArray(s)?s:[s]){if(typeof c!="string")return;r.includes(c)||r.push(c)}}delete e.anyOf,e.type=r.length===1?r[0]:r}const G0=new Set(["type","properties","required","additionalProperties"]),Tb=["oneOf","anyOf"];function kb(e){const n=e.additionalProperties;return n===void 0||n===!1||typeof n!="object"||n===null?null:Object.keys(n).length?n:null}function bd(e){const n=[];for(const s of e){if(typeof s!="object"||s.type!=="object")return null;for(const c in s)if(!G0.has(c))return null;n.push(s)}const r={},l=new Set;for(const s of n){for(const c in s.properties){if(Object.prototype.hasOwnProperty.call(r,c))continue;const d=[];for(const p of n){const y=p.properties?.[c]??kb(p);y!=null&&(d.some(g=>JSON.stringify(g)===JSON.stringify(y))||d.push(y))}const m=d.length===1?d[0]:bd(d)??{allOf:d};Rn(r,c,m)}for(const c of s.required??[])l.add(c)}const o={type:"object",properties:r};if(l.size&&(o.required=[...l]),n.every(s=>s.additionalProperties===!1))o.additionalProperties=!1;else{const s=[];for(const c of n){const d=kb(c);d&&!s.some(m=>JSON.stringify(m)===JSON.stringify(d))&&s.push(d)}s.length===1?o.additionalProperties=s[0]:s.length>1&&(o.additionalProperties={allOf:s})}return o}function d2(e){const n=e.allOf;if(!Array.isArray(n)||n.length<2)return;for(const o of G0)if(o in e)return;const r=n.filter(o=>Tb.some(s=>Array.isArray(o[s])));let l=null;if(!r.length)l=bd(n);else{const o=r[0],s=Tb.find(m=>Array.isArray(o[m]));if(Object.keys(o).length!==1)return;const c=n.filter(m=>m!==o),d=o[s].map(m=>bd([...c,m]));if(d.some(m=>!m))return;l={[s]:d}}l&&(delete e.allOf,nu(e,l))}function V0(e,n){const r=e.seen.get(n);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");const l=d=>{const m=e.seen.get(d);if(m.ref===null)return;const p=m.def??m.schema,y={...p},g=m.ref;if(m.ref=null,g){l(g);const v=e.seen.get(g),_=v.schema;if(_.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(p.allOf=p.allOf??[],p.allOf.push(_)):nu(p,_),nu(p,y),d._zod.parent===g)for(const M in p)M==="$ref"||M==="allOf"||M in y||delete p[M];if(_.$ref&&v.def)for(const M in p)M==="$ref"||M==="allOf"||M in v.def&&JSON.stringify(p[M])===JSON.stringify(v.def[M])&&delete p[M]}const S=d._zod.parent;if(S&&S!==g){l(S);const v=e.seen.get(S);if(v?.schema.$ref&&(p.$ref=v.schema.$ref,v.def))for(const _ in p)_==="$ref"||_==="allOf"||_ in v.def&&JSON.stringify(p[_])===JSON.stringify(v.def[_])&&delete p[_]}e.override({zodSchema:d,jsonSchema:p,path:m.path??[]})};if(!e.external||e.sharedEmitDoneFor!==e.external){for(const d of[...e.seen.entries()].reverse())l(d[0]);if(e.target!=="openapi-3.0")for(const d of e.seen.entries())Z0(d[1].def??d[1].schema);for(const d of e.deferred)d();if(e.intersections.length){const d=new Map;for(const m of e.seen.values())for(const p of[m.schema,m.def]){const y=p?.allOf;if(!Array.isArray(y))continue;const g=d.get(y);g?g.push(p):d.set(y,[p])}for(const m of e.intersections)for(const p of d.get(m)??[])d2(p)}}const o={};if(e.target==="draft-2020-12"?o.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?o.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?o.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){const d=e.external.registry.get(n)?.id;if(!d)throw new Error("Schema is missing an `id` property");o.$id=e.external.uri(d)}nu(o,r.defId?r.schema:r.def??r.schema);const s=e.metadataRegistry.get(n)?.id;s!==void 0&&o.id===s&&delete o.id;const c=e.external?.defs??{};if(!e.external||e.sharedEmitDoneFor!==e.external)for(const d of e.seen.entries()){const m=d[1];m.def&&m.defId&&(m.def.id===m.defId&&delete m.def.id,Rn(c,m.defId,m.def))}e.external&&(e.sharedEmitDoneFor=e.external),e.external||Object.keys(c).length>0&&(e.target==="draft-2020-12"?o.$defs=c:o.definitions=c);try{const d=JSON.parse(JSON.stringify(o));return Object.defineProperty(d,"~standard",{value:{...n["~standard"],jsonSchema:{input:Vo(n,"input",e.processors),output:Vo(n,"output",e.processors)}},enumerable:!1,writable:!1}),d}catch{throw new Error("Error converting schema to JSON.")}}function zn(e,n){const r=n??{seen:new Set};if(r.seen.has(e))return!1;r.seen.add(e);const l=e._zod.def;if(l.type==="transform")return!0;if(l.type==="array")return zn(l.element,r);if(l.type==="set")return zn(l.valueType,r);if(l.type==="lazy")return zn(l.getter(),r);if(l.type==="promise"||l.type==="optional"||l.type==="nonoptional"||l.type==="nullable"||l.type==="readonly"||l.type==="default"||l.type==="prefault"||l.type==="catch")return zn(l.innerType,r);if(l.type==="intersection")return zn(l.left,r)||zn(l.right,r);if(l.type==="record"||l.type==="map")return zn(l.keyType,r)||zn(l.valueType,r);if(l.type==="pipe")return e._zod.traits.has("$ZodCodec")?!0:zn(l.in,r)||zn(l.out,r);if(l.type==="object"){for(const o in l.shape)if(zn(l.shape[o],r))return!0;return!1}if(l.type==="union"){for(const o of l.options)if(zn(o,r))return!0;return!1}if(l.type==="tuple"){for(const o of l.items)if(zn(o,r))return!0;return!!(l.rest&&zn(l.rest,r))}return!1}const h2=(e,n={})=>r=>{const l=H0({...r,processors:n});return nn(e,l),P0(l,e),V0(l,e)},Vo=(e,n,r={})=>l=>{const{libraryOptions:o,target:s}=l??{},c=H0({...o??{},target:s,io:n,processors:r});return nn(e,c),P0(c,e),V0(c,e)},p2={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},m2=(e,n,r,l)=>{const o=r;o.type="string";const{minimum:s,maximum:c,format:d,patterns:m,contentEncoding:p,laxFormat:y}=e._zod.bag;if(typeof s=="number"&&(o.minLength=s),typeof c=="number"&&(o.maxLength=c),d&&(o.format=p2[d]??d,o.format===""&&delete o.format,(d==="time"||y)&&delete o.format),p&&(o.contentEncoding=p),m&&m.size>0){const g=[...m];g.length===1?o.pattern=g[0].source:g.length>1&&(o.allOf=[...g.map(S=>({...n.target==="draft-07"||n.target==="draft-04"||n.target==="openapi-3.0"?{type:"string"}:{},pattern:S.source}))])}},g2=(e,n,r,l)=>{const o=r,{minimum:s,maximum:c,format:d,multipleOf:m,exclusiveMaximum:p,exclusiveMinimum:y}=e._zod.bag;typeof d=="string"&&d.includes("int")?o.type="integer":o.type="number";const g=typeof y=="number"&&y>=(s??Number.NEGATIVE_INFINITY),S=typeof p=="number"&&p<=(c??Number.POSITIVE_INFINITY),v=n.target==="draft-04"||n.target==="openapi-3.0";g?v?(o.minimum=y,o.exclusiveMinimum=!0):o.exclusiveMinimum=y:typeof s=="number"&&(o.minimum=s),S?v?(o.maximum=p,o.exclusiveMaximum=!0):o.exclusiveMaximum=p:typeof c=="number"&&(o.maximum=c),typeof m=="number"&&(Number.isFinite(m)&&m!==0?o.multipleOf=Math.abs(m):Lr(e,n,o,l,`A multipleOf divisor of ${m} cannot be represented in JSON Schema`))},y2=(e,n,r,l)=>{r.type="boolean"},b2=(e,n,r,l)=>{r.not={}},S2=(e,n,r,l)=>{},v2=(e,n,r,l)=>{const o=e._zod.def,s=p0(o.entries);if(s.length===0){r.not={};return}s.every(c=>typeof c=="number")&&(r.type="number"),s.every(c=>typeof c=="string")&&(r.type="string"),r.enum=s},E2=(e,n,r,l)=>{const o=e._zod.def;if(o.values.length===0){r.not={};return}const s=[];for(const c of o.values)if(c===void 0){if(Lr(e,n,r,l,"Literal `undefined` cannot be represented in JSON Schema"))return}else if(typeof c=="bigint"){if(Lr(e,n,r,l,"BigInt literals cannot be represented in JSON Schema"))return;s.push(Number(c))}else s.push(c);if(s.length!==0)if(s.length===1){const c=s[0];r.type=c===null?"null":typeof c,n.target==="draft-04"||n.target==="openapi-3.0"?r.enum=[c]:r.const=c}else s.every(c=>typeof c=="number")&&(r.type="number"),s.every(c=>typeof c=="string")&&(r.type="string"),s.every(c=>typeof c=="boolean")&&(r.type="boolean"),s.every(c=>c===null)&&(r.type="null"),r.enum=s},_2=(e,n,r,l)=>{Lr(e,n,r,l,"Custom types cannot be represented in JSON Schema")},T2=(e,n,r,l)=>{Lr(e,n,r,l,"Transforms cannot be represented in JSON Schema")},k2=(e,n,r,l)=>{const o=r,s=e._zod.def,{minimum:c,maximum:d}=e._zod.bag;typeof c=="number"&&(o.minItems=c),typeof d=="number"&&(o.maxItems=d),o.type="array",o.items=nn(s.element,n,{...l,path:[...l.path,"items"]})};function $o(e){const n=e._zod.def;return n.type==="pipe"&&n.in._zod.traits.has("$ZodTransform")?$o(n.out):n.type==="catch"?$o(n.innerType):e._zod.optin}const w2=(e,n,r,l)=>{const o=r,s=e._zod.def,c=s.shape;if(Object.getOwnPropertySymbols(c).length&&Lr(e,n,o,l,"Symbol keys cannot be represented in JSON Schema"))return;o.type="object",o.properties={};for(const y in c)Rn(o.properties,y,nn(c[y],n,{...l,path:[...l.path,"properties",y]}));const m=new Set(Object.keys(c)),p=new Set([...m].filter(y=>{const g=s.shape[y];return n.io==="input"?$o(g)===void 0:g._zod.optout===void 0}));p.size>0&&(o.required=Array.from(p)),s.catchall?._zod.def.type==="never"?o.additionalProperties=!1:s.catchall?s.catchall&&(o.additionalProperties=nn(s.catchall,n,{...l,path:[...l.path,"additionalProperties"]})):n.io==="output"&&(o.additionalProperties=!1)},A2=(e,n,r,l)=>{const o=e._zod.def,s=o.inclusive===!1,c=o.options.map((d,m)=>nn(d,n,{...l,path:[...l.path,s?"oneOf":"anyOf",m]}));s?r.oneOf=c:r.anyOf=c},x2=(e,n,r,l)=>{const o=e._zod.def,s=nn(o.left,n,{...l,path:[...l.path,"allOf",0]}),c=nn(o.right,n,{...l,path:[...l.path,"allOf",1]}),d=p=>"allOf"in p&&Object.keys(p).length===1,m=[...d(s)?s.allOf:[s],...d(c)?c.allOf:[c]];r.allOf=m,n.intersections.push(m)};function Sd(e,n,r){if(n.$ref){if(r.has(n))return n;r.add(n);const _=e.get(n)?.def;if(!_)return n;const N=Sd(e,_,r);return N===_?n:N}for(const _ of["anyOf","oneOf"]){const N=n[_];if(!Array.isArray(N))continue;const M=N.map(A=>Sd(e,A,r));M.some((A,V)=>A!==N[V])&&(n={...n,[_]:M})}const l=Array.isArray(n.type)?n.type:[n.type],o=!l.includes("string")&&l.some(_=>_==="number"||_==="integer"),s=n.enum??(n.const!==void 0?[n.const]:void 0);if(!o&&!s?.some(_=>typeof _=="number"))return n;const{minimum:c,maximum:d,exclusiveMinimum:m,exclusiveMaximum:p,multipleOf:y,format:g,id:S,...v}=n;return v.enum?v.enum=v.enum.map(_=>typeof _=="number"?String(_):_):typeof v.const=="number"&&(v.const=String(v.const)),o&&(v.type="string",s||(v.pattern=(l.includes("number")?Xd:w0).source)),v}const vd=new WeakMap;function O2(e){const n=new Map;for(const l of e.seen.values())l.def&&!n.has(l.schema)&&n.set(l.schema,l);const r=new Map;for(const l of vd.get(e)??[]){const o=e.seen.get(l),s=(o?.def??o?.schema)?.propertyNames;if(!s||s===!0||r.has(s))continue;const c=Sd(n,s,new Set);c!==s&&r.set(s,c)}if(r.size)for(const l of e.seen.values())for(const o of[l.schema,l.def]){const s=o&&r.get(o.propertyNames);s&&(o.propertyNames=s)}}const C2=(e,n,r,l)=>{const o=r,s=e._zod.def;o.type="object";const c=s.keyType,m=c._zod.bag?.patterns;if(s.mode==="loose"&&m&&m.size>0){const g=nn(s.valueType,n,{...l,path:[...l.path,"patternProperties","*"]});o.patternProperties={};for(const S of m)Rn(o.patternProperties,S.source,g)}else{if(n.target==="draft-07"||n.target==="draft-2020-12"){o.propertyNames=nn(s.keyType,n,{...l,path:[...l.path,"propertyNames"]});let g=vd.get(n);g||(g=[],vd.set(n,g),n.deferred.push(()=>O2(n))),g.push(e)}o.additionalProperties=nn(s.valueType,n,{...l,path:[...l.path,"additionalProperties"]})}const p=c._zod.values,y=n.io==="input"&&$o(s.valueType)!==void 0;if(p&&!s.partial&&!y){const g=[...p].filter(S=>typeof S=="string"||typeof S=="number");g.length>0&&(o.required=g.map(String))}},z2=(e,n,r,l)=>{const o=e._zod.def,s=nn(o.innerType,n,l),c=n.seen.get(e);n.target==="openapi-3.0"?(c.ref=o.innerType,r.nullable=!0):r.anyOf=[s,{type:"null"}]},N2=(e,n,r,l)=>{const o=e._zod.def;nn(o.innerType,n,l);const s=n.seen.get(e);s.ref=o.innerType},Wd=Symbol();function $0(e,n,r,l,o){let s=!1;const c=JSON.stringify(e,(d,m)=>typeof m!="bigint"?m:(s=!0,null));return s?(Lr(n,r,l,o,"BigInt defaults cannot be represented in JSON Schema"),Wd):JSON.parse(c)}const R2=(e,n,r,l)=>{const o=e._zod.def;nn(o.innerType,n,l);const s=n.seen.get(e);s.ref=o.innerType;const c=$0(o.defaultValue,e,n,r,l);c!==Wd&&(r.default=c)},D2=(e,n,r,l)=>{const o=e._zod.def;nn(o.innerType,n,l);const s=n.seen.get(e);if(s.ref=o.innerType,n.io!=="input")return;const c=$0(o.defaultValue,e,n,r,l);c!==Wd&&(r._prefault=c)},M2=(e,n,r,l)=>{const o=e._zod.def;nn(o.innerType,n,l);const s=n.seen.get(e);s.ref=o.innerType;let c;try{c=o.catchValue(void 0)}catch{Lr(e,n,r,l,"Dynamic catch values are not supported in JSON Schema");return}r.default=c},I2=(e,n,r,l)=>{const o=e._zod.def,s=o.in._zod.traits.has("$ZodTransform"),c=n.io==="input"?s?o.out:o.in:o.out;nn(c,n,l);const d=n.seen.get(e);d.ref=c},L2=(e,n,r,l)=>{const o=e._zod.def;nn(o.innerType,n,l);const s=n.seen.get(e);s.ref=o.innerType,r.readOnly=!0},Y0=(e,n,r,l)=>{const o=e._zod.def;nn(o.innerType,n,l);const s=n.seen.get(e);s.ref=o.innerType},wb=new WeakSet([Object.prototype,Error.prototype]);function No(e,n,r){Object.defineProperty(e,n,{configurable:!0,enumerable:!1,get(){const l=r(this);return Object.defineProperty(this,n,{value:l,configurable:!0,writable:!0}),l},set(l){Object.defineProperty(this,n,{value:l,configurable:!0,writable:!0})}})}const U2=(e,n)=>{E0.init(e,n),e.name="ZodError";const r=Object.getPrototypeOf(e);wb.has(r)||(wb.add(r),No(r,"format",l=>o=>fz(l,o)),No(r,"flatten",l=>o=>cz(l,o)),No(r,"addIssue",l=>o=>{l.issues.push(o),l.message=JSON.stringify(l.issues,hd,2)}),No(r,"addIssues",l=>o=>{l.issues.push(...o),l.message=JSON.stringify(l.issues,hd,2)}),Object.defineProperty(r,"isEmpty",{configurable:!0,enumerable:!1,get(){return this.issues.length===0}}))},yi=Q("ZodError",U2,void 0,{Parent:Error}),j2=Fd(yi),B2=Kd(yi),q2=is(yi),H2=rs(yi),P2=pz(yi),Z2=mz(yi),G2=gz(yi),V2=yz(yi),$2=bz(yi),Y2=Sz(yi),F2=vz(yi),K2=Ez(yi);function X2(){wi.localeError||Mi(gR())}function ls(){wi.memoizer||Mi({memoizer:hR()})}const qt=Q("ZodType",(e,n)=>(X2(),Bt.init(e,n),e.def=n,e.type=n.type,e),{check(...e){const n=this.def;return this.clone(jr(n,{checks:[...n.checks??[],...e.map(r=>typeof r=="function"?{_zod:{check:r,def:{check:"custom"},onattach:[]}}:r)]}),{parent:!0})},with(...e){return this.check(...e)},clone(e,n){return Br(this,e,n)},brand(){return this},register(e,n){return e.add(this,n),this},refine(e,n){return this.check(FD(e,n))},superRefine(e,n){return this.check(KD(e,n))},overwrite(e){return this.check(nl(e))},optional(){return xb(this)},exactOptional(){return ID(this)},nullable(){return Ob(this)},nullish(){return xb(Ob(this))},nonoptional(e){return HD(this,e)},array(){return vn(this)},or(e){return eh([this,e])},and(e){return zD(this,e)},transform(e){return Cb(this,MD(e))},default(e){return jD(this,e)},prefault(e){return qD(this,e)},catch(e){return ZD(this,e)},pipe(e){return Cb(this,e)},readonly(){return $D(this)},describe(e){const n=this.clone();return Jl.add(n,{description:e}),n},meta(...e){if(e.length===0)return Jl.get(this);const n=this.clone();return Jl.add(n,e[0]),n},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(e,...n){return n.length===0?e(this):e(this,...n)},get"~standard"(){return b0(this,"~standard",{...O0(this),jsonSchema:{input:Vo(this,"input"),output:Vo(this,"output")}})},set"~standard"(e){Wa(this,"~standard",e)},parse:function e(n,r){return j2(this,n,r,{callee:e})},parseAsync:async function e(n,r){return await B2(this,n,r,{callee:e})},safeParse(e,n){return q2(this,e,n)},async safeParseAsync(e,n){return H2(this,e,n)},get spa(){return this?.safeParseAsync},set spa(e){Wa(this,"spa",e)},encode:function e(n,r){return P2(this,n,r,{callee:e})},decode:function e(n,r){return Z2(this,n,r,{callee:e})},encodeAsync:async function e(n,r){return await G2(this,n,r,{callee:e})},decodeAsync:async function e(n,r){return await V2(this,n,r,{callee:e})},safeEncode(e,n){return $2(this,e,n)},safeDecode(e,n){return Y2(this,e,n)},async safeEncodeAsync(e,n){return F2(this,e,n)},async safeDecodeAsync(e,n){return K2(this,e,n)},toJSONSchema(e){return h2(this,{})(e)},get description(){return Jl.get(this)?.description},get _def(){return this._zod.def}}),F0=Q("_ZodString",(e,n)=>{Jd.init(e,n),qt.init(e,n),e._zod.processJSONSchema=(l,o,s)=>m2(e,l,o);const r=e._zod.bag;e.format=r.format??null,e.minLength=r.minimum??null,e.maxLength=r.maximum??null},{regex(...e){return this.check(QR(...e))},includes(...e){return this.check(e2(...e))},startsWith(...e){return this.check(t2(...e))},endsWith(...e){return this.check(n2(...e))},min(...e){return this.check(Go(...e))},max(...e){return this.check(B0(...e))},length(...e){return this.check(q0(...e))},nonempty(...e){return this.check(Go(1,...e))},lowercase(e){return this.check(JR(e))},uppercase(e){return this.check(WR(e))},trim(){return this.check(r2())},normalize(...e){return this.check(i2(...e))},toLowerCase(){return this.check(a2())},toUpperCase(){return this.check(l2())},slugify(){return this.check(u2())}}),Q2=Q("ZodString",(e,n)=>{Jd.init(e,n),F0.init(e,n)},{email(e){return this.check(vR(nD,e))},url(e){return this.check(AR(rD,e))},jwt(e){return this.check(HR(SD,e))},emoji(e){return this.check(xR(aD,e))},guid(e){return this.check(ER(iD,e))},uuid(e){return this.check(_R(Ro,e))},uuidv4(e){return this.check(TR(Ro,e))},uuidv6(e){return this.check(kR(Ro,e))},uuidv7(e){return this.check(wR(Ro,e))},nanoid(e){return this.check(OR(lD,e))},cuid(e){return this.check(CR(uD,e))},cuid2(e){return this.check(zR(oD,e))},ulid(e){return this.check(NR(sD,e))},base64(e){return this.check(jR(gD,e))},base64url(e){return this.check(BR(yD,e))},xid(e){return this.check(RR(cD,e))},ksuid(e){return this.check(DR(fD,e))},ipv4(e){return this.check(MR(dD,e))},ipv6(e){return this.check(IR(hD,e))},cidrv4(e){return this.check(LR(pD,e))},cidrv6(e){return this.check(UR(mD,e))},e164(e){return this.check(qR(bD,e))},datetime(e){return this.check(PR(J2,e))},date(e){return this.check(ZR(W2,e))},time(e){return this.check(GR(eD,e))},duration(e){return this.check(VR(tD,e))}});function Y(e){return SR(Q2,e)}const Ht=Q("ZodStringFormat",(e,n)=>{It.init(e,n),F0.init(e,n)}),J2=Q("ZodISODateTime",(e,n)=>{wN.init(e,n),Ht.init(e,n)}),W2=Q("ZodISODate",(e,n)=>{AN.init(e,n),Ht.init(e,n)}),eD=Q("ZodISOTime",(e,n)=>{xN.init(e,n),Ht.init(e,n)}),tD=Q("ZodISODuration",(e,n)=>{ON.init(e,n),Ht.init(e,n)}),nD=Q("ZodEmail",(e,n)=>{fN.init(e,n),Ht.init(e,n)}),iD=Q("ZodGUID",(e,n)=>{sN.init(e,n),Ht.init(e,n)}),Ro=Q("ZodUUID",(e,n)=>{cN.init(e,n),Ht.init(e,n)}),rD=Q("ZodURL",(e,n)=>{yN.init(e,n),Ht.init(e,n)}),aD=Q("ZodEmoji",(e,n)=>{bN.init(e,n),Ht.init(e,n)}),lD=Q("ZodNanoID",(e,n)=>{SN.init(e,n),Ht.init(e,n)}),uD=Q("ZodCUID",(e,n)=>{vN.init(e,n),Ht.init(e,n)}),oD=Q("ZodCUID2",(e,n)=>{EN.init(e,n),Ht.init(e,n)}),sD=Q("ZodULID",(e,n)=>{_N.init(e,n),Ht.init(e,n)}),cD=Q("ZodXID",(e,n)=>{TN.init(e,n),Ht.init(e,n)}),fD=Q("ZodKSUID",(e,n)=>{kN.init(e,n),Ht.init(e,n)}),dD=Q("ZodIPv4",(e,n)=>{CN.init(e,n),Ht.init(e,n)}),hD=Q("ZodIPv6",(e,n)=>{NN.init(e,n),Ht.init(e,n)}),pD=Q("ZodCIDRv4",(e,n)=>{RN.init(e,n),Ht.init(e,n)}),mD=Q("ZodCIDRv6",(e,n)=>{MN.init(e,n),Ht.init(e,n)}),gD=Q("ZodBase64",(e,n)=>{IN.init(e,n),Ht.init(e,n)}),yD=Q("ZodBase64URL",(e,n)=>{UN.init(e,n),Ht.init(e,n)}),bD=Q("ZodE164",(e,n)=>{jN.init(e,n),Ht.init(e,n)}),SD=Q("ZodJWT",(e,n)=>{qN.init(e,n),Ht.init(e,n)}),K0=Q("ZodNumber",(e,n)=>{D0.init(e,n),qt.init(e,n),e._zod.processJSONSchema=(l,o,s)=>g2(e,l,o,s);const r=e._zod.bag;e.minValue=Math.max(r.minimum??Number.NEGATIVE_INFINITY,r.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(r.maximum??Number.POSITIVE_INFINITY,r.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(r.format??"").includes("int")||Number.isSafeInteger(r.multipleOf??.5),e.isFinite=!0,e.format=r.format??null},{gt(e,n){return this.check(vb(e,n))},gte(e,n){return this.check(Yf(e,n))},min(e,n){return this.check(Yf(e,n))},lt(e,n){return this.check(Sb(e,n))},lte(e,n){return this.check($f(e,n))},max(e,n){return this.check($f(e,n))},int(e){return this.check(Ab(e))},safe(e){return this.check(Ab(e))},positive(e){return this.check(vb(0,e))},nonnegative(e){return this.check(Yf(0,e))},negative(e){return this.check(Sb(0,e))},nonpositive(e){return this.check($f(0,e))},multipleOf(e,n){return this.check(Eb(e,n))},step(e,n){return this.check(Eb(e,n))},finite(){return this}});function Et(e){return $R(K0,e)}const vD=Q("ZodNumberFormat",(e,n)=>{HN.init(e,n),K0.init(e,n)});function Ab(e){return YR(vD,e)}const ED=Q("ZodBoolean",(e,n)=>{PN.init(e,n),qt.init(e,n),e._zod.processJSONSchema=(r,l,o)=>y2(e,r,l)});function $t(e){return FR(ED,e)}const _D=Q("ZodUnknown",(e,n)=>{ZN.init(e,n),qt.init(e,n),e._zod.processJSONSchema=(r,l,o)=>S2()});function wn(){return KR(_D)}const TD=Q("ZodNever",(e,n)=>{GN.init(e,n),qt.init(e,n),e._zod.processJSONSchema=(r,l,o)=>b2(e,r,l)});function kD(e){return XR(TD,e)}const wD=Q("ZodArray",(e,n)=>{ls(),VN.init(e,n),qt.init(e,n),e._zod.processJSONSchema=(r,l,o)=>k2(e,r,l,o),e.element=n.element},{min(e,n){return this.check(Go(e,n))},nonempty(e){return this.check(Go(1,e))},max(e,n){return this.check(B0(e,n))},length(e,n){return this.check(q0(e,n))},unwrap(){return this.element}});function vn(e,n){return o2(wD,e,n)}const AD=Q("ZodObject",(e,n)=>{ls(),FN.init(e,n),qt.init(e,n),e._zod.processJSONSchema=(r,l,o)=>w2(e,r,l,o),nz(e,"shape",r=>r._zod.def.shape,!1)},{keyof(){return Ut(Object.keys(this._zod.def.shape))},catchall(e){return this.clone({...this._zod.def,catchall:e})},passthrough(){return this.clone({...this._zod.def,catchall:wn()})},loose(){return this.clone({...this._zod.def,catchall:wn()})},strict(){return this.clone({...this._zod.def,catchall:kD()})},strip(){return this.clone({...this._zod.def,catchall:void 0})},extend(e){return VC(this,e)},safeExtend(e){return $C(this,e)},merge(e){return YC(this,e)},pick(e){return ZC(this,e)},omit(e){return GC(this,e)},partial(...e){return eb(J0,this,e[0])},exactPartial(...e){return eb(W0,this,e[0],"exactPartial")},required(...e){return FC(ev,this,e[0])}});function Ce(e,n){const r={type:"object",shape:e??{},...xe(n)};return new AD(r)}const X0=Q("ZodUnion",(e,n)=>{L0.init(e,n),qt.init(e,n),e._zod.processJSONSchema=(r,l,o)=>A2(e,r,l,o),e.options=n.options});function eh(e,n){return new X0({type:"union",options:e,...xe(n)})}const xD=Q("ZodDiscriminatedUnion",(e,n)=>{X0.init(e,n),KN.init(e,n)});function OD(e,n,r){return new xD({type:"union",options:n,discriminator:e,...xe(r)})}const CD=Q("ZodIntersection",(e,n)=>{XN.init(e,n),qt.init(e,n),e._zod.processJSONSchema=(r,l,o)=>x2(e,r,l,o)});function zD(e,n){return new CD({type:"intersection",left:e,right:n})}const ND=Q("ZodRecord",(e,n)=>{ls(),QN.init(e,n),qt.init(e,n),e._zod.processJSONSchema=(r,l,o)=>C2(e,r,l,o),e.keyType=n.keyType,e.valueType=n.valueType});function Q0(e,n,r){return new ND({type:"record",keyType:Y(),valueType:e,...xe(n)})}const Ed=Q("ZodEnum",(e,n)=>{JN.init(e,n),qt.init(e,n),e._zod.processJSONSchema=(l,o,s)=>v2(e,l,o),e.enum=n.entries,e.options=Object.values(n.entries);const r=new Set(Object.keys(n.entries));e.extract=(l,o)=>{const s={};for(const c of l)if(r.has(c))s[c]=n.entries[c];else throw new Error(`Key ${c} not found in enum`);return new Ed({...n,checks:[],...xe(o),entries:s})},e.exclude=(l,o)=>{const s={...n.entries};for(const c of l)if(r.has(c))delete s[c];else throw new Error(`Key ${c} not found in enum`);return new Ed({...n,checks:[],...xe(o),entries:s})}});function Ut(e,n){const r=Array.isArray(e)?Object.fromEntries(e.map(l=>[l,l])):e;return new Ed({type:"enum",entries:r,...xe(n)})}const RD=Q("ZodLiteral",(e,n)=>{WN.init(e,n),qt.init(e,n),e._zod.processJSONSchema=(r,l,o)=>E2(e,r,l,o),e.values=new Set(n.values),Object.defineProperty(e,"value",{get(){if(n.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return n.values[0]}})});function lt(e,n){return new RD({type:"literal",values:Array.isArray(e)?e:[e],...xe(n)})}const DD=Q("ZodTransform",(e,n)=>{ls(),eR.init(e,n),qt.init(e,n),e._zod.processJSONSchema=(r,l,o)=>T2(e,r,l,o),e._zod.parse=(r,l)=>{if(l.direction==="backward")throw new S0(e.constructor.name);r.addIssue=s=>{if(typeof s=="string")r.issues.push(uu(s,r.value,n));else{const c=s;c.fatal&&(c.continue=!1),c.code??(c.code="custom"),"input"in c||(c.input=r.value),c.inst??(c.inst=e),r.issues.push(uu(c))}};const o=n.transform(r.value,r);return o instanceof Promise?o.then(s=>(r.value=s,r)):(r.value=o,r)}});function MD(e){return new DD({type:"transform",transform:e})}const J0=Q("ZodOptional",(e,n)=>{U0.init(e,n),qt.init(e,n),e._zod.processJSONSchema=(r,l,o)=>Y0(e,r,l,o),e.unwrap=()=>e._zod.def.innerType});function xb(e){return new J0({type:"optional",innerType:e})}const W0=Q("ZodExactOptional",(e,n)=>{tR.init(e,n),qt.init(e,n),e._zod.processJSONSchema=(r,l,o)=>Y0(e,r,l,o),e.unwrap=()=>e._zod.def.innerType});function ID(e){return new W0({type:"optional",innerType:e})}const LD=Q("ZodNullable",(e,n)=>{nR.init(e,n),qt.init(e,n),e._zod.processJSONSchema=(r,l,o)=>z2(e,r,l,o),e.unwrap=()=>e._zod.def.innerType});function Ob(e){return new LD({type:"nullable",innerType:e})}const UD=Q("ZodDefault",(e,n)=>{iR.init(e,n),qt.init(e,n),e._zod.processJSONSchema=(r,l,o)=>R2(e,r,l,o),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function jD(e,n){return new UD({type:"default",innerType:e,get defaultValue(){return typeof n=="function"?n():g0(n)}})}const BD=Q("ZodPrefault",(e,n)=>{rR.init(e,n),qt.init(e,n),e._zod.processJSONSchema=(r,l,o)=>D2(e,r,l,o),e.unwrap=()=>e._zod.def.innerType});function qD(e,n){return new BD({type:"prefault",innerType:e,get defaultValue(){return typeof n=="function"?n():g0(n)}})}const ev=Q("ZodNonOptional",(e,n)=>{aR.init(e,n),qt.init(e,n),e._zod.processJSONSchema=(r,l,o)=>N2(e,r,l,o),e.unwrap=()=>e._zod.def.innerType});function HD(e,n){return new ev({type:"nonoptional",innerType:e,...xe(n)})}const PD=Q("ZodCatch",(e,n)=>{lR.init(e,n),qt.init(e,n),e._zod.processJSONSchema=(r,l,o)=>M2(e,r,l,o),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function ZD(e,n){return new PD({type:"catch",innerType:e,catchValue:typeof n=="function"?n:rz(n)})}const GD=Q("ZodPipe",(e,n)=>{uR.init(e,n),qt.init(e,n),e._zod.processJSONSchema=(r,l,o)=>I2(e,r,l,o),e.in=n.in,e.out=n.out});function Cb(e,n){return new GD({type:"pipe",in:e,out:n})}const VD=Q("ZodReadonly",(e,n)=>{oR.init(e,n),qt.init(e,n),e._zod.processJSONSchema=(r,l,o)=>L2(e,r,l,o),e.unwrap=()=>e._zod.def.innerType});function $D(e){return new VD({type:"readonly",innerType:e})}const YD=Q("ZodCustom",(e,n)=>{sR.init(e,n),qt.init(e,n),e._zod.processJSONSchema=(r,l,o)=>_2(e,r,l,o)});function FD(e,n={}){return s2(YD,e,n)}function KD(e,n){return c2(e,n)}const XD=Object.freeze(["task","always","reject"]),th=e=>Object.freeze(Object.values(e)),QD=th(it),JD=th(Me),WD=th(f0),nh=Ce({type:Y().min(1)}).passthrough(),eM=eh([Ce({text:Y(),mediaType:Y().min(1),filename:Y().optional()}),Ce({raw:Y().min(1),mediaType:Y().min(1),filename:Y().optional()}),Ce({url:Y().min(1),mediaType:Y().min(1),filename:Y().optional()}),Ce({data:wn(),mediaType:Y().min(1),filename:Y().optional()})]),tM=Ce({artifactId:Y().min(1),name:Y().optional(),description:Y().optional(),parts:vn(eM).min(1)}),nM=Y().max(2048).url().refine(e=>{const n=new URL(e);return["http:","https:"].includes(n.protocol)&&!n.username&&!n.password},"citation URL must be a public HTTP(S) URL without credentials"),iM=Ce({id:Y().min(1).max(40),title:Y().min(1).max(300),url:nM,snippet:Y().max(1200).optional(),source:Y().max(120).optional(),published_at:Y().max(80).optional()}),tv=Ce({id:Y().min(1),taskId:Y().nullable(),status:Ut(["pending","approved","denied","cancelled"]),category:Y().min(1),summary:Y().min(1),patterns:vn(Y()),approvalScope:Ut(["once","session","persistent"]).optional(),operation:Ce({title:Y().min(1),kind:Y().min(1),description:Y().optional(),command:Y().optional(),path:Y().optional(),locations:vn(Ce({path:Y().min(1),line:Et().int().positive().optional()})).optional()}).nullable().optional(),createdAt:Et(),resolvedAt:Et().nullable()}),rM=Ce({id:Y().min(1),taskId:Y().nullable(),status:Ut(["pending","accepted","declined","cancelled"]),kind:Ut(["input","authorization"]),mode:Ut(["text","form","url"]),prompt:Y().min(1),schema:Q0(wn()).optional(),url:Y().url().optional(),createdAt:Et(),resolvedAt:Et().nullable()}),aM=Ce({id:Y().nullable().optional(),kind:Y().min(1),status:Y().optional(),message:Y().optional(),label:Y().optional(),detail:Y().optional(),category:Y().optional(),tool:Y().optional(),title:Y().optional(),updatedAt:Y().optional(),mode:Y().optional(),completed:Et().int().nonnegative().optional(),total:Et().int().nonnegative().optional()}).passthrough(),ih=Ce({id:Y().min(1),workState:Ut(["submitted","working","auth_required","input_required","completed","failed","cancelled"]),status:Y().min(1),kind:Y().min(1),seriesId:Y().min(1).optional(),parentTaskId:Y().nullable().optional(),objective:Y(),ownerId:Y().optional(),sessionId:Y().optional(),turnId:Y().nullable().optional(),createdAt:Et(),startedAt:Et().nullable().optional(),completedAt:Et().nullable().optional(),elapsedMs:Et(),result:Y().nullable().optional(),error:Y().nullable().optional(),message:Y().nullable().optional(),artifacts:vn(tM).optional(),activity:vn(aM).optional(),delegation:wn().optional(),authorization:tv.nullable().optional(),inputRequest:rM.nullable().optional(),notificationStatus:Y().optional(),notificationDeliveredAt:Et().nullable().optional(),schedule:wn().optional(),timeoutMs:Et().nullable().optional()}),lM=Ut(QD),uM=Ut(JD),oM=Ut(WD),nv=OD("type",[Ce({type:lt("text"),text:Y().min(1)}).passthrough(),Ce({type:lt("file"),mime:Y().min(3).refine(e=>e.includes("/"),"invalid MIME type"),filename:Y().min(1).optional(),url:Y().min(1)}).passthrough()]),zb=Ce({text:Y().min(1).optional(),parts:vn(nv).min(1).max(16).optional()}).passthrough().refine(e=>e.text||e.parts,{message:"a text or parts payload is required"}),sM=Object.freeze({[it.CONNECT]:Ce({voiceEnabled:$t().optional(),inputEnabled:$t().optional(),outputEnabled:$t().optional(),textOnly:$t().optional(),provider:Y().min(1).optional(),outputVoice:Y().min(1).max(160).optional(),clientType:Y().min(1).optional(),clientLabel:Y().min(1).optional(),clientInstanceId:Y().min(1).optional(),timeZone:Y().min(1).optional(),locale:Y().min(1).optional(),workingDirectory:Y().min(1).optional(),inputCapabilities:Ce({text:$t().optional(),audio:$t().optional(),image:$t().optional(),resource:$t().optional()}).passthrough().optional(),clientStates:vn(Y().min(1)).optional(),takeoverRequested:$t().optional()}).passthrough(),[it.AUDIO_APPEND]:Ce({audio:Y().min(1)}).passthrough(),[it.IMAGE_APPEND]:Ce({image:Y().min(1).max(256*1024),media_type:lt("image/jpeg").default("image/jpeg"),occurred_at:Et().int().nonnegative().optional()}).passthrough(),[it.IMAGE_CLEAR]:Ce({}).passthrough(),[it.TEXT_MESSAGE]:zb,[it.INPUT_MESSAGE]:zb,[it.PLAYBACK_STARTED]:Ce({responseId:Y().min(1)}).passthrough(),[it.PLAYBACK_ENDED]:Ce({responseId:Y().min(1)}).passthrough(),[it.PLAYBACK_CANCELLED]:Ce({responseId:Y().min(1),reason:Y().optional()}).passthrough()}),cM=Object.freeze({[Me.VOICE_READY]:Ce({inputSampleRate:Et().int().positive(),provider:Y().min(1).optional(),providerLabel:Y().min(1).optional()}).passthrough(),[Me.VOICE_CONNECTION]:Ce({state:Y().min(1)}).passthrough(),[Me.VOICE_STATE]:Ce({state:Ut(["idle","listening","processing","speaking"]),turnId:Y().min(1).nullable().optional()}).passthrough(),[Me.VOICE_OWNERSHIP]:Ce({state:Ut(["active","busy","available"]),holder:wn().nullable().optional()}).passthrough(),[Me.VOICE_DEACTIVATED]:Ce({holder:wn().nullable().optional()}).passthrough(),[Me.VOICE_SLEEP]:Ce({state:Ut(["preparing","enabled","sleeping","detected","awake","disabled"])}).passthrough(),[Me.TURN_STARTED]:Ce({turnId:Y().min(1)}).passthrough(),[Me.INPUT_SUSPEND]:Ce({owner:Y().min(1),reason:Y().optional(),expiresAt:Et().optional()}).passthrough(),[Me.AUDIO_DELTA]:Ce({audio:Y().min(1),sampleRate:Et().int().positive(),responseId:Y().min(1)}).passthrough(),[Me.AUDIO_DONE]:Ce({responseId:Y().min(1)}).passthrough(),[Me.RESPONSE_STARTED]:Ce({responseId:Y().min(1)}).passthrough(),[Me.RESPONSE_INTERRUPTED]:Ce({responseId:Y().min(1)}).passthrough(),[Me.TRANSCRIPT_DELTA]:Ce({role:Ut(["user","assistant"]),content:Y()}).passthrough(),[Me.TRANSCRIPT_FINAL]:Ce({role:Ut(["user","assistant"]),content:Y()}).passthrough(),[Me.TRANSCRIPT_DISCARD]:Ce({role:Ut(["user","assistant"])}).passthrough(),[Me.TOOL_CALL]:Ce({callId:Y().min(1),name:Y().min(1),surface:Ut(["frontend","backend"]),status:Y().min(1),arguments:wn().optional(),result:Y().optional(),durationMs:Et().nonnegative().optional(),responseId:Y().optional(),turnId:Y().optional(),taskId:Y().optional()}).passthrough(),[Me.MEMORY_CHANGED]:Ce({}).passthrough(),[Me.AGENT_ACTIVITY]:Ce({activity:Y().min(1)}).passthrough(),[Me.CLIENT_STATE]:Ce({state:Y().min(1)}).passthrough(),[Me.ERROR]:Ce({message:Y().min(1)}).passthrough()});function iv(e,n,r){if(!e)return;const l=e.safeParse(n);if(!l.success)for(const o of l.error.issues)r.addIssue(o)}nh.extend({type:lM}).superRefine((e,n)=>{iv(sM[e.type],e,n)});const fM=nh.extend({type:uM,citations:vn(iM).max(16).optional()}).superRefine((e,n)=>{iv(cM[e.type],e,n),e.citations&&(e.type!==Me.TRANSCRIPT_FINAL||e.role!=="assistant")&&n.addIssue({code:"custom",path:["citations"],message:"citations are allowed only on final assistant transcripts"})}),dM=nh.extend({type:oM,task:ih,permission:tv.optional(),message:Y().optional()});eh([fM,dM]);const Yo="7.0.0",hM=4001,Nb=4002,Rb=4003,ie=Object.freeze({SESSION_HELLO:"session.hello",SESSION_READY:"session.ready",SESSION_PING:"session.ping",SESSION_PONG:"session.pong",SESSION_OUTPUT_VOICE_UPDATE:"session.output_voice.update",SESSION_OUTPUT_VOICE_UPDATED:"session.output_voice.updated",INPUT_AUDIO_APPEND:"input_audio_buffer.append",INPUT_IMAGE_APPEND:"input_image_buffer.append",INPUT_IMAGE_CLEAR:"input_image_buffer.clear",CONVERSATION_ITEM_CREATE:"conversation.item.create",RESPONSE_CANCEL:"response.cancel",CLIENT_EVENT_PUBLISH:"client.event.publish",CLIENT_EVENT_PUBLISH_RESULT:"client.event.publish.result",CLIENT_ACTION_REQUEST:"client.action.request",CLIENT_ACTION_RESULT:"client.action.result",CLIENT_PRESENCE_UPDATE:"client.presence.update",TASK_CREATE:"task.create",TASK_CREATE_RESULT:"task.create.result",TASK_GET:"task.get",TASK_GET_RESULT:"task.get.result",TASK_LIST:"task.list",TASK_LIST_RESULT:"task.list.result",TASK_CANCEL:"task.cancel",TASK_CANCEL_RESULT:"task.cancel.result",PERMISSION_RESPOND:"permission.respond",PERMISSION_RESPOND_RESULT:"permission.respond.result",INPUT_RESPOND:"task.input.respond",INPUT_RESPOND_RESULT:"task.input.respond.result",CONVERSATION_HISTORY:"conversation.history",CONVERSATION_HISTORY_RESULT:"conversation.history.result",SESSION_REPLAY:"session.replay",SESSION_REPLAY_RESULT:"session.replay.result"}),ke=Object.freeze({INPUT_AUDIO:"input.audio",INPUT_TEXT:"input.text",INPUT_IMAGE:"input.image",INPUT_IMAGE_BUFFER:"input.image_buffer",INPUT_FILE:"input.file",PLAYBACK_RECEIPTS:"playback.receipts",TASK_COMMANDS:"tasks.commands",PERMISSION_RESPOND:"permissions.respond",INPUT_RESPOND:"tasks.input.respond",CONVERSATION_HISTORY:"conversation.history",CLIENT_EVENTS:"client.events",CLIENT_TOOLS:"client.tools",CLIENT_PRESENCE:"client.presence",SESSION_OUTPUT_VOICE:"session.output_voice",CLIENT_ACTION_ENTER_SLEEP:"client.actions.desktop.presence.enter_sleep",SESSION_REPLAY:"session.replay",SESSION_TAKEOVER:"session.takeover",SESSION_HEARTBEAT:"session.heartbeat"}),pM=Object.freeze({ENTER_SLEEP:"desktop.presence.enter_sleep"});Object.freeze(Object.values(ke));const mM=Object.freeze([ke.INPUT_AUDIO,ke.INPUT_TEXT,ke.INPUT_IMAGE,ke.INPUT_IMAGE_BUFFER,ke.INPUT_FILE,ke.PLAYBACK_RECEIPTS,ke.TASK_COMMANDS,ke.PERMISSION_RESPOND,ke.INPUT_RESPOND,ke.CONVERSATION_HISTORY,ke.CLIENT_EVENTS,ke.CLIENT_TOOLS,ke.CLIENT_PRESENCE,ke.SESSION_OUTPUT_VOICE,ke.CLIENT_ACTION_ENTER_SLEEP,ke.SESSION_REPLAY,ke.SESSION_TAKEOVER,ke.SESSION_HEARTBEAT]),jt=Y().min(1).max(128),rv=Y().min(3).max(120).regex(/^[a-z][a-z0-9_-]*(\.[a-z][a-z0-9_-]*)+$/),_d=Y().regex(/^\d+\.\d+\.\d+$/),xn=Ce({type:Y().min(1).max(120),event_id:jt,request_event_id:jt.optional(),occurred_at:Et().int().nonnegative().optional()}).passthrough(),Pn=xn.extend({sequence:Et().int().positive().optional()}),gM=Ce({name:Y().regex(/^[a-z][a-z0-9_]{0,63}$/),description:Y().trim().min(1).max(4e3),inputSchema:Ce({type:lt("object")}).passthrough().refine(e=>new TextEncoder().encode(JSON.stringify(e)).length<=16384,"Tool schema too large"),response_on_success:Ut(["auto","none"]).optional()}).strict(),yM=vn(gM).max(32).refine(e=>new Set(e.map(n=>n.name)).size===e.length,"Duplicate client tool"),av=xn.extend({type:lt(ie.SESSION_HELLO),protocol:Ce({min:_d,max:_d}),client:Ce({type:Y().min(1).max(40),version:Y().min(1).max(80).optional(),instance_id:jt,label:Y().min(1).max(80).optional()}),capabilities:vn(rv).max(64),tools:yM.optional(),locale:Y().min(2).max(40).optional(),time_zone:Y().min(1).max(80).optional(),connection:Ce({voice_enabled:$t().optional(),input_enabled:$t().optional(),output_enabled:$t().optional(),text_only:$t().optional(),wake_word_only:$t().optional(),provider:Y().min(1).max(80).optional(),output_voice:Y().min(1).max(160).optional(),working_directory:Y().min(1).max(4096).optional(),client_states:vn(Y().min(1).max(80)).max(16).optional(),takeover:$t().optional()}).optional()}).superRefine((e,n)=>{e.tools?.length&&!e.capabilities.includes(ke.CLIENT_TOOLS)&&n.addIssue({code:"custom",path:["tools"],message:"tools require client.tools capability"}),new Set(e.capabilities).size!==e.capabilities.length&&n.addIssue({code:"custom",path:["capabilities"],message:"capabilities must not contain duplicates"}),e.connection?.takeover===!0&&!e.capabilities.includes(ke.SESSION_TAKEOVER)&&n.addIssue({code:"custom",path:["connection","takeover"],message:"takeover requires the session.takeover capability"})}),bM=Pn.extend({type:lt(ie.SESSION_READY),request_event_id:jt,protocol_version:_d,session_id:jt,capabilities:vn(rv).max(64),connection:Ce({lease_generation:Et().int().positive(),replaced:$t()}).optional()}),SM=Pn.extend({type:lt(ie.SESSION_PING)}),vM=xn.extend({type:lt(ie.SESSION_PONG),request_event_id:jt}),EM=Pn.extend({type:lt("error"),request_event_id:jt.optional(),error:Ce({code:Y().min(1).max(80),message:Y().min(1).max(500)})}),rh=Y().min(3).max(120).regex(/^[a-z][a-z0-9_-]*(\.[a-z][a-z0-9_-]*)+$/),_M=xn.extend({type:lt(ie.CLIENT_EVENT_PUBLISH),name:rh.optional(),text:Y().trim().min(1).max(16e3).optional(),data:wn().optional(),delivery_hint:Ut(["handle","context","respond","interrupt"]).optional()}).superRefine((e,n)=>{!e.text&&!e.name&&n.addIssue({code:"custom",message:"Client Event requires text or a registered extension name"}),e.text&&(e.data!==void 0||e.delivery_hint==="handle")&&n.addIssue({code:"custom",message:"Text events cannot invoke handlers or carry handler data"})}),TM=Pn.extend({type:lt(ie.CLIENT_EVENT_PUBLISH_RESULT),request_event_id:jt,accepted:$t(),name:rh.optional(),duplicate:$t().optional()}),kM=xn.extend({type:lt(ie.SESSION_OUTPUT_VOICE_UPDATE),voice:Y().trim().min(1).max(160)}),wM=Pn.extend({type:lt(ie.SESSION_OUTPUT_VOICE_UPDATED),request_event_id:jt,voice:Y().min(1).max(160),changed:$t(),reconnecting:$t()}),AM=Pn.extend({type:lt(ie.CLIENT_ACTION_REQUEST),name:rh,arguments:wn().optional()}),xM=xn.extend({type:lt(ie.CLIENT_ACTION_RESULT),request_event_id:jt,status:Ut(["completed","failed","unsupported"]),output:wn().optional(),error:Ce({code:Y().min(1).max(80),message:Y().min(1).max(500)}).optional()}).superRefine((e,n)=>{e.status!=="completed"&&!e.error&&n.addIssue({code:"custom",path:["error"],message:"failed and unsupported Client Actions require an error"})}),OM=xn.extend({type:lt(ie.TASK_CREATE),message:Ce({parts:vn(nv).min(1).max(16)})}),CM=xn.extend({type:lt(ie.TASK_GET),task_id:jt}),zM=xn.extend({type:lt(ie.TASK_LIST),active:$t().optional(),session_id:jt.optional(),limit:Et().int().min(1).max(100).optional()}),NM=xn.extend({type:lt(ie.TASK_CANCEL),task_id:jt}),RM=xn.extend({type:lt(ie.PERMISSION_RESPOND),permission_id:jt,decision:Ut(XD)}),DM=xn.extend({type:lt(ie.INPUT_RESPOND),task_id:jt,input_request_id:jt,action:Ut(["accept","decline","cancel"]),text:Y().max(16e3).optional(),values:Q0(wn()).optional()}),MM=xn.extend({type:lt(ie.CONVERSATION_HISTORY),session_id:jt.optional()}),IM=xn.extend({type:lt(ie.SESSION_REPLAY),after_sequence:Et().int().nonnegative().default(0),limit:Et().int().min(1).max(200).default(50)}),ah=Pn.extend({request_event_id:jt,task:ih}),LM=ah.extend({type:lt(ie.TASK_CREATE_RESULT)}),UM=ah.extend({type:lt(ie.TASK_GET_RESULT)}),jM=ah.extend({type:lt(ie.TASK_CANCEL_RESULT)}),BM=Pn.extend({type:lt(ie.TASK_LIST_RESULT),request_event_id:jt,tasks:vn(ih).max(100)}),qM=Pn.extend({type:lt(ie.PERMISSION_RESPOND_RESULT),request_event_id:jt,permission:wn()}),HM=Pn.extend({type:lt(ie.INPUT_RESPOND_RESULT),request_event_id:jt,input:wn()}),PM=Pn.extend({type:lt(ie.CONVERSATION_HISTORY_RESULT),request_event_id:jt,messages:vn(wn()).max(100)}),ZM=Pn.extend({type:lt(ie.SESSION_REPLAY_RESULT),request_event_id:jt,events:vn(Pn).max(200),earliest_sequence:Et().int().nonnegative(),latest_sequence:Et().int().nonnegative(),next_sequence:Et().int().nonnegative(),has_more:$t()}),Db=Object.freeze({[ie.CLIENT_PRESENCE_UPDATE]:xn.extend({type:lt(ie.CLIENT_PRESENCE_UPDATE),state:Ut(["active","sleeping"])}),[ie.CLIENT_EVENT_PUBLISH]:_M,[ie.SESSION_OUTPUT_VOICE_UPDATE]:kM,[ie.CLIENT_ACTION_RESULT]:xM,[ie.TASK_CREATE]:OM,[ie.TASK_GET]:CM,[ie.TASK_LIST]:zM,[ie.TASK_CANCEL]:NM,[ie.PERMISSION_RESPOND]:RM,[ie.INPUT_RESPOND]:DM,[ie.CONVERSATION_HISTORY]:MM,[ie.SESSION_REPLAY]:IM}),Mb=Object.freeze({[ie.CLIENT_EVENT_PUBLISH_RESULT]:TM,[ie.SESSION_OUTPUT_VOICE_UPDATED]:wM,[ie.CLIENT_ACTION_REQUEST]:AM,[ie.TASK_CREATE_RESULT]:LM,[ie.TASK_GET_RESULT]:UM,[ie.TASK_LIST_RESULT]:BM,[ie.TASK_CANCEL_RESULT]:jM,[ie.PERMISSION_RESPOND_RESULT]:qM,[ie.INPUT_RESPOND_RESULT]:HM,[ie.CONVERSATION_HISTORY_RESULT]:PM,[ie.SESSION_REPLAY_RESULT]:ZM});Object.freeze({[ie.CLIENT_PRESENCE_UPDATE]:ke.CLIENT_PRESENCE,[ie.INPUT_IMAGE_APPEND]:ke.INPUT_IMAGE_BUFFER,[ie.INPUT_IMAGE_CLEAR]:ke.INPUT_IMAGE_BUFFER,[ie.CLIENT_EVENT_PUBLISH]:ke.CLIENT_EVENTS,[ie.SESSION_OUTPUT_VOICE_UPDATE]:ke.SESSION_OUTPUT_VOICE,[ie.TASK_CREATE]:ke.TASK_COMMANDS,[ie.TASK_GET]:ke.TASK_COMMANDS,[ie.TASK_LIST]:ke.TASK_COMMANDS,[ie.TASK_CANCEL]:ke.TASK_COMMANDS,[ie.PERMISSION_RESPOND]:ke.PERMISSION_RESPOND,[ie.INPUT_RESPOND]:ke.INPUT_RESPOND,[ie.CONVERSATION_HISTORY]:ke.CONVERSATION_HISTORY,[ie.SESSION_REPLAY]:ke.SESSION_REPLAY});Object.freeze({[ie.INPUT_AUDIO_APPEND]:it.AUDIO_APPEND,[ie.INPUT_IMAGE_APPEND]:it.IMAGE_APPEND,[ie.INPUT_IMAGE_CLEAR]:it.IMAGE_CLEAR,[ie.CONVERSATION_ITEM_CREATE]:it.INPUT_MESSAGE,[ie.RESPONSE_CANCEL]:it.INTERRUPT});let Ff=0;function Fo(e="client"){const n=globalThis.crypto?.randomUUID?.();return n?`evt_${e}_${n.replaceAll("-","")}`:(Ff=(Ff+1)%Number.MAX_SAFE_INTEGER,`evt_${e}_${Date.now().toString(36)}_${Ff.toString(36)}`)}function GM({eventId:e=Fo("client"),protocolMin:n=Yo,protocolMax:r=Yo,clientType:l="web",clientVersion:o,clientInstanceId:s=Fo("instance"),clientLabel:c,capabilities:d=mM,tools:m,locale:p,timeZone:y,connection:g,takeover:S=!1}={}){const v=g||S?{...g||{},...S?{takeover:!0}:{}}:void 0;return av.parse({type:ie.SESSION_HELLO,event_id:e,protocol:{min:n,max:r},client:{type:l,version:o,instance_id:s,label:c},capabilities:d,tools:m,locale:p,time_zone:y,connection:v})}function Do(e,n={},{eventId:r=Fo("client"),occurredAt:l}={}){return VM({type:e,event_id:r,...l==null?{}:{occurred_at:l},...n})}function VM(e){return e?.type===ie.SESSION_HELLO?av.parse(e):e?.type===ie.SESSION_PONG?vM.parse(e):Db[e?.type]?Db[e.type].parse(e):xn.parse(e)}function $M(e){return e?.type===ie.SESSION_READY?bM.parse(e):e?.type===ie.SESSION_PING?SM.parse(e):e?.type==="error"&&e?.error?EM.parse(e):Mb[e?.type]?Mb[e.type].parse(e):Pn.parse(e)}const YM=new Set([ie.CLIENT_EVENT_PUBLISH_RESULT,ie.SESSION_OUTPUT_VOICE_UPDATED,ie.TASK_CREATE_RESULT,ie.TASK_GET_RESULT,ie.TASK_LIST_RESULT,ie.TASK_CANCEL_RESULT,ie.PERMISSION_RESPOND_RESULT,ie.INPUT_RESPOND_RESULT,ie.CONVERSATION_HISTORY_RESULT,ie.SESSION_REPLAY_RESULT,"error"]);function Mo(e,n,r){if(typeof e.addEventListener=="function"){e.addEventListener(n,r);return}e.on(n,r)}function FM(e){return e?.data===void 0?e:e.data}function Ib(e){return e?.readyState===1}function KM(e){const n=FM(e);return JSON.parse(typeof n=="string"?n:n.toString())}function XM(e={}){if(!(!e||typeof e!="object"))return{...e.voiceEnabled===void 0?{}:{voice_enabled:e.voiceEnabled===!0},...e.inputEnabled===void 0?{}:{input_enabled:e.inputEnabled===!0},...e.outputEnabled===void 0?{}:{output_enabled:e.outputEnabled===!0},...e.textOnly===void 0?{}:{text_only:e.textOnly===!0},...e.wakeWordOnly===void 0?{}:{wake_word_only:e.wakeWordOnly===!0},...e.provider?{provider:String(e.provider)}:{},...e.outputVoice?{output_voice:String(e.outputVoice)}:{},...e.workingDirectory?{working_directory:String(e.workingDirectory)}:{},...Array.isArray(e.clientStates)?{client_states:e.clientStates}:{}}}class QM{constructor({url:n,createSocket:r,clientType:l="web",clientVersion:o,clientInstanceId:s,clientLabel:c,accessToken:d,takeover:m=!1,capabilities:p=[],tools:y=[],locale:g,timeZone:S,configure:v,reconnect:_=!0,reconnectMinMs:N=500,reconnectMaxMs:M=5e3,requestTimeoutMs:A=1e4,connectTimeoutMs:V=1e4,handshakeTimeoutMs:j=1e4,onEvent:ae,onStatus:ue,onAction:D,onRecovery:$}={}){if(!n)throw new TypeError("url is required");if(typeof r!="function")throw new TypeError("createSocket is required");this.url=String(n),this.createSocket=r,this.client={type:l,version:o,instanceId:s,label:c},this.accessToken=String(d||"").trim(),this.takeover=m===!0,this.tools=y,this.requestedCapabilities=[...new Set([...p,...y.length?[ke.CLIENT_TOOLS]:[],...m?[ke.SESSION_TAKEOVER]:[]])],this.locale=g,this.timeZone=S,this.configure=v,this.reconnect=_!==!1,this.reconnectMinMs=Math.max(50,Number(N)||500),this.reconnectMaxMs=Math.max(this.reconnectMinMs,Number(M)||5e3),this.requestTimeoutMs=Math.max(100,Number(A)||1e4),this.connectTimeoutMs=Math.max(100,Number(V)||1e4),this.handshakeTimeoutMs=Math.max(100,Number(j)||1e4),this.onEvent=ae,this.onStatus=ue,this.onAction=D,this.onRecovery=$,this.socket=null,this.stopped=!0,this.ready=!1,this.negotiatedCapabilities=[],this.reconnectDelay=this.reconnectMinMs,this.reconnectTimer=null,this.connectTimer=null,this.handshakeTimer=null,this.pending=new Map,this.lastSequence=0}start(){return this.stopped?(this.stopped=!1,this.#n(),this):this}stop(){this.stopped=!0,this.ready=!1,clearTimeout(this.reconnectTimer),this.reconnectTimer=null,this.#e(),this.#t("client_stopped","Gateway Client stopped");const n=this.socket;this.socket=null,n?.close?.()}supports(n){return this.negotiatedCapabilities.includes(n)}get readyState(){return this.socket?.readyState??3}get bufferedAmount(){return this.socket?.bufferedAmount??0}close(){this.stop()}send(n){if(!Ib(this.socket))return!1;try{const r=n&&typeof n=="object"&&typeof n.type=="string"&&!n.event_id?Do(n.type,Object.fromEntries(Object.entries(n).filter(([l])=>l!=="type"))):n;return this.socket.send(typeof r=="string"?r:JSON.stringify(r)),!0}catch{return!1}}request(n,r={},{timeoutMs:l=this.requestTimeoutMs}={}){if(!this.ready)return Promise.reject(Object.assign(new Error("Gateway Client is not ready"),{code:"client_not_ready"}));const o=Do(n,r);return new Promise((s,c)=>{const d=setTimeout(()=>{this.pending.delete(o.event_id),c(Object.assign(new Error(`${n} timed out`),{code:"request_timeout"}))},Math.max(100,Number(l)||this.requestTimeoutMs));d.unref?.(),this.pending.set(o.event_id,{resolve:s,reject:c,timer:d,type:n}),this.send(o)||(clearTimeout(d),this.pending.delete(o.event_id),c(Object.assign(new Error("Gateway connection is unavailable"),{code:"connection_unavailable"})))})}updateOutputVoice(n,r){return this.supports(ke.SESSION_OUTPUT_VOICE)?this.request(ie.SESSION_OUTPUT_VOICE_UPDATE,{voice:String(n||"").trim()},r):Promise.reject(Object.assign(new Error("session.output_voice was not negotiated"),{code:"capability_not_negotiated"}))}async recover(){const n={events:[],tasks:[],messages:[]};if(this.supports(ke.SESSION_REPLAY)&&this.lastSequence>0)try{let r=this.lastSequence,l=!0;for(;l;){const o=await this.request(ie.SESSION_REPLAY,{after_sequence:r,limit:200});for(const s of o.events||[])this.#a(s,{replayed:!0});n.events.push(...o.events||[]),r=o.next_sequence,l=o.has_more===!0}}catch(r){if(!["sequence_expired","session_expired"].includes(r.code))throw r;this.lastSequence=0}if(this.supports(ke.TASK_COMMANDS)){const r=await this.request(ie.TASK_LIST,{limit:100});n.tasks=r.tasks||[]}if(this.supports(ke.CONVERSATION_HISTORY)){const r=await this.request(ie.CONVERSATION_HISTORY);n.messages=r.messages||[]}return this.onRecovery?.(n),n}#n(){if(this.stopped)return;this.onStatus?.({state:"connecting"});const n=this.createSocket(this.url,{headers:this.accessToken?{Authorization:`Bearer ${this.accessToken}`}:{}});this.socket=n,this.connectTimer=setTimeout(()=>{this.socket!==n||this.stopped||this.#r(n,"connection","Gateway connection timed out")},this.connectTimeoutMs),this.connectTimer.unref?.(),Mo(n,"open",()=>{if(this.socket!==n||this.stopped)return;clearTimeout(this.connectTimer),this.connectTimer=null,this.handshakeTimer=setTimeout(()=>{this.socket!==n||this.stopped||this.ready||this.#r(n,"handshake","Gateway session handshake timed out")},this.handshakeTimeoutMs),this.handshakeTimer.unref?.(),this.onStatus?.({state:"connected"});const r=typeof this.configure=="function"?this.configure():this.configure;this.send(GM({protocolMin:Yo,protocolMax:Yo,clientType:this.client.type,clientVersion:this.client.version,clientInstanceId:this.client.instanceId,clientLabel:this.client.label,capabilities:this.requestedCapabilities,tools:this.tools,locale:this.locale,timeZone:this.timeZone,connection:XM(r),takeover:this.takeover}))}),Mo(n,"message",r=>{if(this.socket!==n||this.stopped)return;let l;try{l=$M(KM(r))}catch{return}this.#l(l)}),Mo(n,"error",r=>{this.socket!==n||this.stopped||this.onStatus?.({state:"unavailable",error:r})}),Mo(n,"close",r=>{if(this.socket!==n||(this.#e(),this.socket=null,this.ready=!1,this.negotiatedCapabilities=[],this.#t("connection_closed","Gateway connection closed"),this.stopped))return;const l=typeof r=="number"?r:Number(r?.code);if(l===hM||l===Nb||l===Rb){this.stopped=!0,this.onStatus?.({state:l===Nb?"occupied":l===Rb?"revoked":"replaced"});return}this.onStatus?.({state:"disconnected"}),this.reconnect&&this.#i()})}#e(){clearTimeout(this.connectTimer),clearTimeout(this.handshakeTimer),this.connectTimer=null,this.handshakeTimer=null}#i(){this.stopped||!this.reconnect||this.reconnectTimer!==null||(this.reconnectTimer=setTimeout(()=>{this.reconnectTimer=null,this.#n()},this.reconnectDelay),this.reconnectTimer.unref?.(),this.reconnectDelay=Math.min(this.reconnectMaxMs,this.reconnectDelay*2))}#r(n,r,l){if(this.socket!==n||this.stopped)return;const o=Object.assign(new Error(l),{code:`${r}_timeout`});this.#e(),this.socket=null,this.ready=!1,this.negotiatedCapabilities=[],this.#t("connection_closed","Gateway connection closed"),this.onStatus?.({state:"unavailable",phase:r,error:o});try{n.close?.()}catch{}this.#i()}#l(n){if(n.type===ie.SESSION_READY){clearTimeout(this.handshakeTimer),this.handshakeTimer=null,this.ready=!0,this.negotiatedCapabilities=[...n.capabilities],this.reconnectDelay=this.reconnectMinMs,this.onStatus?.({state:"ready",event:n}),this.recover().catch(l=>this.onStatus?.({state:"recovery_failed",error:l}));return}if(n.type===ie.SESSION_PING&&this.supports(ke.SESSION_HEARTBEAT)){this.send(Do(ie.SESSION_PONG,{request_event_id:n.event_id}));return}if(n.type===ie.CLIENT_ACTION_REQUEST){this.#u(n);return}const r=n.request_event_id?this.pending.get(n.request_event_id):null;if(r&&YM.has(n.type)){clearTimeout(r.timer),this.pending.delete(n.request_event_id),n.type==="error"?r.reject(Object.assign(new Error(n.error.message),{code:n.error.code})):r.resolve(n);return}this.#a(n.type==="error"&&n.error&&!n.message?{...n,message:n.error.message}:n)}#a(n,r={}){if(Number.isInteger(n.sequence)){if(n.sequence<=this.lastSequence)return;this.lastSequence=Math.max(this.lastSequence,n.sequence)}this.onEvent?.(n,r)}async#u(n){const r=this.socket;let l;try{l=await this.onAction?.(n)}catch(s){l={status:"failed",error:{code:"client_action_failed",message:String(s?.message||s)}}}const o=l?.status?l:{status:"unsupported",error:{code:"client_action_unsupported",message:`Unsupported Client Action: ${String(n.name||"")}`}};this.stopped||this.socket!==r||!Ib(r)||this.send(Do(ie.CLIENT_ACTION_RESULT,{request_event_id:n.event_id,status:o.status,...o.output===void 0?{}:{output:o.output},...o.error?{error:o.error}:{}}))}#t(n,r){for(const l of this.pending.values())clearTimeout(l.timer),l.reject(Object.assign(new Error(r),{code:n}));this.pending.clear()}}const JM=Object.freeze({WEB:"web",DESKTOP:"desktop",TUI:"cli",MOBILE:"mobile"});function WM(e="web"){const n=Gd(e);return[ke.INPUT_TEXT,...n.audio?[ke.INPUT_AUDIO]:[],...n.image?[ke.INPUT_IMAGE]:[],...n.visualStream?[ke.INPUT_IMAGE_BUFFER]:[],...n.resource?[ke.INPUT_FILE]:[],ke.PLAYBACK_RECEIPTS,ke.TASK_COMMANDS,ke.PERMISSION_RESPOND,ke.CONVERSATION_HISTORY,ke.CLIENT_EVENTS,ke.SESSION_OUTPUT_VOICE,ke.SESSION_REPLAY,ke.SESSION_HEARTBEAT,...e===JM.DESKTOP?[ke.CLIENT_ACTION_ENTER_SLEEP]:[]]}function Lb(e,n){const r=Number(e);if(!Number.isFinite(r)||r<=0)throw new RangeError(`${n} sample rate must be a positive number`);return r}function eI(e,n){const r=new Float32Array(e.length+n.length);return r.set(e),r.set(n,e.length),r}const tI=new TextEncoder;function Ub(){let e=0,n=0,r=new Float32Array(0),l=0,o=0,s=0;const c=()=>{e=0,n=0,r=new Float32Array(0),l=0,o=0,s=0},d=(p,y)=>{const g=Lb(p,"input"),S=Lb(y,"output");return(g!==e||S!==n)&&(c(),e=g,n=S),[g,S]},m=p=>{const y=e/n,g=Math.max(1,Math.round(o/y)),S=[];for(;l+1<r.length&&s<g;){const _=Math.floor(l),N=l-_,M=Math.min(r.length-1,_+1);S.push(r[_]*(1-N)+r[M]*N),l+=y,s+=1}if(p)for(;l<r.length&&s<g;){const _=Math.floor(l),N=l-_,M=Math.min(r.length-1,_+1);S.push(r[_]*(1-N)+r[M]*N),l+=y,s+=1}const v=Math.min(r.length,Math.floor(l));return v>0&&(r=r.slice(v),l-=v),Float32Array.from(S)};return{process(p,y,g){if(!p?.length)return new Float32Array(0);const[S,v]=d(y,g);return S===v?p:(r=eI(r,p),o+=p.length,m(!1))},flush(){if(!e||!n||e===n)return c(),new Float32Array(0);const p=m(!0);return c(),p},reset:c}}function jb(e){const n=new Uint8Array(e.length*2),r=new DataView(n.buffer);e.forEach((o,s)=>{const c=Math.max(-1,Math.min(1,o));r.setInt16(s*2,c*32767,!0)});let l="";for(let o=0;o<n.length;o+=32768)l+=String.fromCharCode(...n.subarray(o,o+32768));return btoa(l)}function nI(e){const n=atob(e),r=Uint8Array.from(n,s=>s.charCodeAt(0)),l=new DataView(r.buffer),o=new Float32Array(r.length/2);for(let s=0;s<o.length;s+=1)o[s]=l.getInt16(s*2,!0)/32768;return o}const iI=64*1024,rI=16*1024;function aI(e){const n=typeof e=="string"?e:JSON.stringify(e);return typeof n=="string"?tI.encode(n).byteLength:0}function lI({send:e,getBufferedAmount:n=()=>0,highWaterMarkBytes:r=iI,lowWaterMarkBytes:l=rI,onDrop:o}={}){if(typeof e!="function")throw new TypeError("send is required");const s=Math.max(1,Number(r)||0),c=Math.max(0,Math.min(s,Number(l)||0));let d=!1,m=0;const p=()=>{try{const g=Number(n());return Number.isFinite(g)&&g>0?g:0}catch{return 0}},y=(g,S)=>{m+=1;try{o?.({bufferedAmount:g,payloadBytes:S,droppedCount:m})}catch{}};return{send(g){const S=p(),v=aI(g);return d&&S>c?(y(S,v),!1):(d=!1,S+v>s?(d=!0,y(S,v),!1):e(g)?(p()>=s&&(d=!0),!0):!1)},reset(){d=!1,m=0},get congested(){return d},get droppedCount(){return m}}}function uI(){return .02}function oI(e=[]){const n=[];for(const r of e){const l=n.at(-1);if(l&&l.sampleRate===r.sampleRate&&l.responseId===r.responseId){l.items.push(r),l.length+=r.samples.length;continue}n.push({sampleRate:r.sampleRate,responseId:r.responseId,items:[r],length:r.samples.length})}return n.map(r=>{const l=new Float32Array(r.length);let o=0;for(const s of r.items)l.set(s.samples,o),o+=s.samples.length;return{samples:l,sampleRate:r.sampleRate,responseId:r.responseId,duration:l.length/r.sampleRate}})}function sI({remote:e=!1,onFlush:n,initialBufferSeconds:r=.4,resumeBufferSeconds:l=.32,lowWaterSeconds:o=.12,batchSeconds:s=.1,batchDelayMs:c=60,schedule:d=(p,y)=>setTimeout(p,y),cancel:m=p=>clearTimeout(p)}={}){if(typeof n!="function")throw new TypeError("onFlush is required");let p=[],y=0,g=null,S=!1,v=e;const _=()=>{g!==null&&m(g),g=null},N=()=>{if(_(),!p.length)return;const A=p;p=[],y=0,S=!0,v=!1,n(oI(A))},M=()=>{g===null&&(g=d(()=>{g=null,N()},c))};return{push(A,{timelineAheadSeconds:V=0}={}){if(!e){n([A]);return}S&&V<=o&&(v=!0),p.push(A),y+=A.duration,y>=(v?S?l:r:s)?N():v||M()},finish(){N()},responseIds(){return[...new Set(p.map(A=>A.responseId).filter(Boolean))]},reset(){_(),p=[],y=0,S=!1,v=e}}}const cI="qwen-audio-microphone",Bb=new WeakMap;function fI(e,n){let r=Bb.get(e);r||(r=new Map,Bb.set(e,r));let l=r.get(n);return l||(l=e.audioWorklet.addModule(n).catch(o=>{throw r.delete(n),o}),r.set(n,l)),l}function dI(e){return e instanceof Float32Array?e:e instanceof ArrayBuffer?new Float32Array(e):ArrayBuffer.isView(e)?new Float32Array(e.buffer,e.byteOffset,e.byteLength/Float32Array.BYTES_PER_ELEMENT):null}async function hI({context:e,moduleUrl:n,onSamples:r,nodeConstructor:l=globalThis.AudioWorkletNode}={}){if(!e?.audioWorklet||typeof e.audioWorklet.addModule!="function")throw Object.assign(new Error("AudioWorklet is not available"),{name:"NotSupportedError"});if(!n)throw new TypeError("moduleUrl is required");if(typeof l!="function")throw Object.assign(new Error("AudioWorkletNode is not available"),{name:"NotSupportedError"});if(typeof r!="function")throw new TypeError("onSamples is required");await fI(e,n);const o=new l(e,cI,{numberOfInputs:1,numberOfOutputs:1,outputChannelCount:[1]});let s=!1;const c=d=>{if(s||d?.data?.type!=="samples")return;const m=dI(d.data.samples);m?.length&&r(m)};return o.port.addEventListener?.("message",c),o.port.addEventListener||(o.port.onmessage=c),o.port.start?.(),{node:o,close(){s||(s=!0,o.port.removeEventListener?.("message",c),o.port.removeEventListener||(o.port.onmessage=null),o.port.close?.(),o.disconnect?.())}}}const pI=Object.freeze([500,1e3,2e3,4e3]);function mI(e){return!["NotAllowedError","NotSupportedError","SecurityError","TypeError"].includes(String(e?.name||""))}function gI(e){const n=String(e?.name||""),r=String(e?.message||e||"");return["NotAllowedError","SecurityError"].includes(n)||/permission\s+denied|not\s+allowed/i.test(r)?"permission_denied":n==="NotFoundError"?"device_missing":n==="NotReadableError"?"device_unavailable":n==="NotSupportedError"?"unsupported":"unknown"}function qb(e){return e?.track||e?.media?.getAudioTracks?.()[0]||null}function yI({mediaDevices:e,acquire:n,release:r=y=>y?.close?.(),onState:l=()=>{},onFatalError:o=()=>{},debounceMs:s=300,muteGraceMs:c=1500,retryDelays:d=pI,schedule:m=(y,g)=>setTimeout(y,g),cancel:p=y=>clearTimeout(y)}={}){if(!e?.getUserMedia||typeof n!="function")throw new Error("microphone capture requires mediaDevices and acquire");let y=!1,g=0,S=null,v=null,_=null,N=null,M=0;const A=$=>{const re=$==="restart"?v:$==="retry"?_:N;re!==null&&p(re),$==="restart"?v=null:$==="retry"?_=null:N=null},V=()=>{const $=S;if(!$)return;S=null,A("mute");const re=qb($);re?.removeEventListener?.("ended",$.handleEnded),re?.removeEventListener?.("mute",$.handleMute),re?.removeEventListener?.("unmute",$.handleUnmute),r($)},j=$=>{const re=qb($);re?.addEventListener&&($.handleEnded=()=>ue("track-ended",0),$.handleMute=()=>{A("mute"),N=m(()=>{N=null,re.muted!==!1&&ue("track-muted",0)},c)},$.handleUnmute=()=>A("mute"),re.addEventListener("ended",$.handleEnded),re.addEventListener("mute",$.handleMute),re.addEventListener("unmute",$.handleUnmute))},ae=async $=>{if(!y)return;A("restart"),A("retry");const re=++g;V(),l({state:$==="initial"?"starting":"recovering",reason:$});try{const de=await n({reason:$,generation:re});if(!y||re!==g){r(de);return}S=de,M=0,j(de),l({state:"ready",reason:$})}catch(de){if(!y||re!==g)return;if(!mI(de)){l({state:"unavailable",reason:$,error:de,recoverable:!1}),o(de);return}const U=d[M];M+=1;const te=Number.isFinite(U);l({state:te?"recovering":"unavailable",reason:$,error:de,recoverable:!0}),te&&(_=m(()=>{_=null,ae("retry")},U))}};function ue($="devicechange",re=s){y&&($==="devicechange"&&(M=0),A("restart"),A("retry"),v=m(()=>{v=null,ae($)},re))}const D=()=>ue("devicechange");return{start(){y||(y=!0,e.addEventListener?.("devicechange",D),ae("initial"))},stop(){y&&(y=!1,g+=1,e.removeEventListener?.("devicechange",D),A("restart"),A("retry"),A("mute"),V())},restart($="manual"){M=0,ue($,0)}}}function Hb(e,n,r,l=clearTimeout){if(!n||!e?.sourceCounts?.has(n)||e.startedResponses.has(n))return!1;const o=e.startTimers.get(n);return o!==void 0&&l(o),e.startTimers.delete(n),e.startedResponses.add(n),r?.(n),!0}const bI=16e3,Pb=24e3,SI=new URL(""+new URL("microphone-audio-worklet-processor-DvqhgtX_.js",import.meta.url).href,import.meta.url).href;function vI(e,n){return h0(e,n)}function EI(e,n){return n===!0&&e?.type==="voice.ownership"&&e.state==="available"}function _I(e,n){return e===!0&&n===!0}function TI({enabled:e,inputReady:n,inputOnlyMute:r=!1,wakeWordOnly:l=!1}={}){const o=e!==!0&&r!==!0,s=_I(e,n)&&l!==!0;return{textOnly:o,inputEnabled:s,outputEnabled:o||r===!0||s}}function kI({clientType:e="web"}={}){return WM(e)}const wI=Object.freeze([["textInput","text"],["audioInput","audio"],["imageInput","image"],["videoInput","video"]]),AI=Object.freeze([["textInput","text"],["audioInput","audio"],["imageInput","image"],["imageBufferInput","video"]]);function Zb(e,n){return n.filter(([r])=>e?.[r]===!0).map(([,r])=>r)}function Gb(e,n){return!e||!n?!1:[...new Set([...Object.keys(e),...Object.keys(n)])].every(l=>e[l]===n[l])}function xI(e){return{permission_denied:C("麦克风权限未开启,请在系统设置中允许后重试"),device_missing:C("未检测到可用麦克风"),device_unavailable:C("麦克风正被其他应用占用,请稍后重试"),unsupported:C("当前环境不支持麦克风输入")}[gI(e)]||e?.message||String(e||C("无法打开麦克风"))}function Vb(e={}){const n=e.realtimeModelProfile,r=String(e.realtimeModel||n?.id||"").trim(),l=Array.isArray(e.realtimeModelCatalog)?e.realtimeModelCatalog.find(m=>m?.id===r):null,o=!!n?.id,s=!!(r&&n?.id===r&&l&&l.label===n.label&&l.family===n.family&&Gb(l.modelCapabilities,n.modelCapabilities)&&Gb(l.transportCapabilities,n.transportCapabilities)),c=s?n.modelCapabilities:null,d=s?n.transportCapabilities:null;return{id:r,label:s?n.label:r,metadataStatus:s?"current":o?"stale":"missing",modelInputModes:Zb(c,wI),transportInputModes:Zb(d,AI),imageInputEnabled:d?.imageInput===!0}}function Io({enabled:e,inputOnlyMute:n=!1,wakeWordOnly:r=!1}={}){return r?{type:it.SLEEP}:n?e?{type:it.INPUT_UNMUTE}:{type:it.INPUT_MUTE}:e?{type:it.UNMUTE}:{type:it.MUTE}}function OI(e,n=!1){return n!==!0?e:new Float32Array(e.length)}function CI(e,n=""){return!e||typeof e!="object"?!1:e.type===Me.ERROR?!0:e.type!==Me.RESPONSE_STARTED?!1:!!n&&e.turnId===n}function zI({sessionId:e,enabled:n,suspended:r=!1,outputMuted:l=!1,inputOnlyMute:o=!1,wakeWordOnly:s=!1,clientType:c="web",clientLabel:d="WebUI",clientInstanceId:m="",clientStates:p=[],clientTools:y=[],clientPresence:g,onEvent:S,onInputError:v,onClientAction:_,additionalCapabilities:N=[],onWakeWordAudio:M}){const[A,V]=I.useReducer(MC,void 0,d0),[j,ae]=I.useState(!1),[ue,D]=I.useState(!1),$=JSON.stringify(N),re=JSON.stringify(y),de=I.useRef(g);de.current=g;const[U,te]=I.useState(""),[ne,Ae]=I.useState(!1),[Se,oe]=I.useState(0),{connectionState:H,ownership:le,voiceState:ve,wakeWordActive:Pe}=A,w=I.useRef(S),z=I.useRef(v),F=I.useRef(_),T=I.useRef(M),he=I.useRef(s),_e=I.useRef(null),Te=I.useRef(!1),Ze=I.useRef(!1),ut=I.useRef([]),Le=I.useRef(null),dn=I.useRef(""),yt=I.useRef(String(m||"").trim()||crypto.randomUUID()),En=I.useRef(bI),On=[...new Set((Array.isArray(p)?p:[]).filter(ee=>typeof ee=="string"&&ee))].sort().join(","),_n=I.useRef(n),un=I.useRef(!1),bi=I.useRef(l),hn=I.useRef(new Set),Tt=I.useRef(!1),on=I.useRef(""),Yt=I.useRef(null),At=I.useRef({cursor:0,sources:[],startTimers:new Map,endTimers:new Map,responseEnds:new Map,startedResponses:new Set,sourceCounts:new Map,doneResponses:new Set,failedResponses:new Set,queue:null});w.current=S,z.current=v,F.current=_,T.current=M,he.current=s,_n.current=n,bi.current=l;const pn=I.useCallback(()=>{Tt.current=!1,on.current="",clearTimeout(Yt.current),Yt.current=null},[]),Vn=I.useCallback(()=>{Tt.current=!0,on.current="",clearTimeout(Yt.current),Yt.current=setTimeout(pn,3e4)},[pn]),Rt=I.useCallback(()=>{const ee=window.AudioContext||window.webkitAudioContext;return ee?((!Le.current||Le.current.state==="closed")&&(Le.current=new ee),Le.current.resume().catch(be=>{te(be?.message||C("语音播放没有成功启用,请再点一次开启语音")),Ae(!0)}),!0):(te(C("当前浏览器不支持实时语音播放")),Ae(!0),!1)},[]),st=I.useCallback(ee=>{const be=_e.current;if(be?.readyState!==WebSocket.OPEN)return!1;try{return be.send(ee.type===it.SLEEP&&be.supports?.(ke.CLIENT_PRESENCE)?{type:ie.CLIENT_PRESENCE_UPDATE,state:"sleeping"}:ee),!0}catch{return!1}},[]),K=I.useCallback((ee,be={},pe)=>st({type:ie.CLIENT_EVENT_PUBLISH,event_id:Fo("client"),...typeof ee=="object"?ee:{name:ee,data:be},...pe?{delivery_hint:pe}:{}}),[st]),se=I.useMemo(()=>new RC((ee,be)=>_e.current?.supports?.(ke.CLIENT_EVENTS)===!0&&K({name:ee,text:be},void 0,"context")),[K]),ze=I.useCallback((ee,be)=>se.set(ee,be),[se]),je=I.useCallback(()=>{de.current&&_e.current?.supports?.(ke.CLIENT_PRESENCE)&&st({type:ie.CLIENT_PRESENCE_UPDATE,state:de.current})},[st]);I.useEffect(()=>{je()},[g,je]);const $e=I.useCallback(()=>{const ee=ut.current;for(ee.length&&Vn();ee.length;){if(!st(ee[0]))return;ee.shift()}},[Vn,st]),ct=I.useCallback((ee,be,pe="")=>{be&&st({type:ee,responseId:be,...pe?{reason:pe}:{}})},[st]),Pt=I.useCallback((ee="")=>{const be=At.current,pe=new Set([...be.startTimers.keys(),...be.endTimers.keys(),...be.startedResponses,...be.sourceCounts.keys(),...be.queue?.responseIds?.()||[]]);for(const fe of be.startTimers.values())clearTimeout(fe);for(const fe of be.endTimers.values())clearTimeout(fe);for(const fe of pe)ct(it.PLAYBACK_CANCELLED,fe,ee);At.current.sources.forEach(fe=>{try{fe.stop()}catch{}}),be.queue?.reset?.(),At.current={cursor:0,sources:[],startTimers:new Map,endTimers:new Map,responseEnds:new Map,startedResponses:new Set,sourceCounts:new Map,doneResponses:new Set,failedResponses:new Set,queue:null}},[ct]),xt=I.useCallback(ee=>{if(!ee)return;const be=At.current;if(!be.startedResponses.has(ee)||!be.doneResponses.has(ee)||(be.sourceCounts.get(ee)||0)>0)return;ct(it.PLAYBACK_ENDED,ee);const pe=be.endTimers.get(ee);pe!==void 0&&clearTimeout(pe),be.endTimers.delete(ee),be.responseEnds.delete(ee),be.startedResponses.delete(ee),be.sourceCounts.delete(ee),be.doneResponses.delete(ee)},[ct]),Ot=I.useCallback(ee=>{if(!ee)return;const be=At.current;if(be.failedResponses.delete(ee))return;be.queue?.finish?.(),be.doneResponses.add(ee),xt(ee);const pe=be.responseEnds.get(ee);if(!be.doneResponses.has(ee)||be.endTimers.has(ee)||!Number.isFinite(pe))return;const fe=()=>{const Ue=At.current;if(!Ue.endTimers.has(ee))return;const Ne=Le.current,Ke=Ue.responseEnds.get(ee);if(!Ne||!Number.isFinite(Ke)||Ne.state!=="running"||Ne.currentTime+.01<Ke){const kt=setTimeout(fe,50);Ue.endTimers.set(ee,kt);return}Ue.sourceCounts.set(ee,0),xt(ee)},Ie=Math.max(0,((pe||Le.current?.currentTime||0)-(Le.current?.currentTime||0))*1e3)+50,bt=setTimeout(fe,Ie);be.endTimers.set(ee,bt)},[xt]),Ct=I.useCallback((ee,be)=>{const pe=At.current;if(pe.queue?.reset?.(),ee&&!pe.failedResponses.has(ee)){pe.failedResponses.add(ee);const fe=pe.startTimers.get(ee);fe!==void 0&&clearTimeout(fe);const Ie=pe.endTimers.get(ee);Ie!==void 0&&clearTimeout(Ie),pe.startTimers.delete(ee),pe.endTimers.delete(ee),pe.responseEnds.delete(ee),pe.startedResponses.delete(ee),pe.sourceCounts.delete(ee),pe.doneResponses.delete(ee),ct(it.PLAYBACK_CANCELLED,ee,"playback_error")}te(be?.message||String(be||C("语音播放失败"))),Ae(!0)},[ct]),Ye=I.useCallback(ee=>{!ee||hn.current.has(ee)||(hn.current.add(ee),ct(it.PLAYBACK_STARTED,ee))},[ct]),Dn=I.useCallback(ee=>{!ee||!hn.current.has(ee)||(hn.current.delete(ee),ct(it.PLAYBACK_ENDED,ee))},[ct]),Zt=I.useCallback(({samples:ee,sampleRate:be=Pb,responseId:pe=""})=>{const fe=Le.current;if(!fe){Ct(pe,C("语音播放尚未启用"));return}const Ie=At.current;if(pe&&Ie.failedResponses.has(pe))return;fe.state==="suspended"&&fe.resume().catch(Ne=>Ct(pe,Ne));let bt,Ue;try{const Ne=fe.createBuffer(1,ee.length,be);Ne.copyToChannel(ee,0),bt=fe.createBufferSource(),bt.buffer=Ne,bt.connect(fe.destination);const Ke=uI();Ue=Math.max(fe.currentTime+Ke,Ie.cursor),Ie.cursor=Ue+Ne.duration,Ie.sources.push(bt),pe&&(Ie.sourceCounts.set(pe,(Ie.sourceCounts.get(pe)||0)+1),Ie.responseEnds.set(pe,Math.max(Ie.responseEnds.get(pe)||0,Ie.cursor)))}catch(Ne){Ct(pe,Ne);return}if(pe&&!Ie.startedResponses.has(pe)&&!Ie.startTimers.has(pe)){const Ne=()=>{const sn=At.current;if(sn.startTimers.has(pe)){if(fe.state!=="running"||fe.currentTime+.005<Ue){const Xt=setTimeout(Ne,20);sn.startTimers.set(pe,Xt);return}Hb(sn,pe,Xt=>ct(it.PLAYBACK_STARTED,Xt))}},Ke=Math.max(0,(Ue-fe.currentTime)*1e3),kt=setTimeout(Ne,Ke);Ie.startTimers.set(pe,kt)}bt.onended=()=>{const Ne=At.current;Ne.sources=Ne.sources.filter(Ke=>Ke!==bt),pe&&Ne.sourceCounts.has(pe)&&(Hb(Ne,pe,Ke=>ct(it.PLAYBACK_STARTED,Ke)),Ne.sourceCounts.set(pe,Math.max(0,(Ne.sourceCounts.get(pe)||0)-1)),xt(pe))};try{bt.start(Ue)}catch(Ne){Ie.sources=Ie.sources.filter(Ke=>Ke!==bt),Ct(pe,Ne)}},[Ct,xt,ct]),sa=I.useCallback((ee,be=Pb,pe="")=>{const fe=Le.current;if(!fe){Ct(pe,C("语音播放尚未启用"));return}let Ie;try{const Ue=nI(ee);Ie={samples:Ue,sampleRate:be,responseId:pe,duration:Ue.length/be}}catch(Ue){Ct(pe,Ue);return}const bt=At.current;bt.queue||(bt.queue=sI({remote:sC(),onFlush:Ue=>Ue.forEach(Zt)})),bt.queue.push(Ie,{timelineAheadSeconds:Math.max(0,bt.cursor-fe.currentTime)})},[Ct,Zt]);I.useEffect(()=>{r&&V({type:Me.VOICE_STATE,state:"idle"})},[r]),I.useEffect(()=>{const ee=hn.current,be=fe=>{V(fe),fe.type===Me.VOICE_READY&&se.setReady(!0),fe.type===Me.VOICE_CONNECTION&&fe.state!=="connected"&&se.setReady(!1),fe.type===Me.VOICE_READY&&fe.inputSampleRate&&(En.current=fe.inputSampleRate,Ze.current=!0,te(""),Ae(!1),$e()),fe.type===Me.VOICE_CONNECTION&&(fe.state==="connected"?(Ze.current=!0,te(""),Ae(!1),$e()):fe.state==="unavailable"&&(te(fe.message||C("语音前台连接异常,正在重试")),Ae(!0))),fe.type===Me.TURN_STARTED&&(dn.current=fe.turnId||"",Tt.current&&String(fe.turnId||"").startsWith("text_")&&(on.current=fe.turnId)),CI(fe,on.current)&&pn(),fe.type===Me.VOICE_STATE&&vI(fe,dn.current)&&fe.state==="listening"&&Pt("user_interruption"),fe.type===Me.PLAYBACK_CLEAR&&Pt(fe.reason||""),fe.type===Me.AUDIO_DELTA&&(bi.current||!Le.current?Ye(fe.responseId):sa(fe.audio,fe.sampleRate,fe.responseId)),fe.type===Me.AUDIO_DONE&&(hn.current.has(fe.responseId)?Dn(fe.responseId):Ot(fe.responseId)),fe.type===Me.ERROR&&te(fe.message),w.current?.(fe)},pe=new QM({url:fC(e),createSocket:dC,clientType:c,clientLabel:d,clientInstanceId:yt.current,takeover:Te.current,capabilities:[...new Set([...kI({clientType:c}),...JSON.parse($),...c==="desktop"?[ke.CLIENT_PRESENCE]:[]])],tools:JSON.parse(re),locale:navigator.language,timeZone:Intl.DateTimeFormat().resolvedOptions().timeZone,configure:()=>{const fe=TI({enabled:_n.current,inputReady:un.current,inputOnlyMute:o,wakeWordOnly:he.current});return{type:it.CONNECT,timeZone:Intl.DateTimeFormat().resolvedOptions().timeZone,locale:navigator.language,voiceEnabled:fe.outputEnabled,inputEnabled:fe.inputEnabled,outputEnabled:fe.outputEnabled,textOnly:fe.textOnly,wakeWordOnly:he.current,clientType:c,clientLabel:d,inputCapabilities:Gd(c),clientStates:On?On.split(","):[],clientInstanceId:yt.current}},onEvent:be,onAction:fe=>F.current?.(fe),onRecovery:fe=>w.current?.({type:"session.recovered",...fe}),onStatus:fe=>{if(["ready","connected"].includes(fe.state)||se.setReady(!1),fe.state==="connected"){te(""),Ae(!1);const Ie={type:Me.GATEWAY_CONNECTED};V(Ie),w.current?.(Ie)}else if(fe.state==="ready")Te.current=!1,je(),D(fe.event?.capabilities?.includes(ke.INPUT_IMAGE_BUFFER)===!0);else if(fe.state==="unavailable")D(!1),V({type:Me.VOICE_CONNECTION,state:"unavailable"}),te(C("实时语音连接中断,正在重连")),Ae(!0);else if(fe.state==="disconnected"){D(!1),pn(),Pt();const Ie={type:Me.GATEWAY_DISCONNECTED};V(Ie),te(C("实时语音连接中断,正在重连")),Ae(!0),w.current?.(Ie)}else if(["occupied","replaced","revoked"].includes(fe.state)){D(!1),pn(),Pt();const Ie={type:Me.GATEWAY_DISCONNECTED};V(Ie),te(C(fe.state==="occupied"?"Gateway 正由另一个客户端使用":fe.state==="replaced"?"当前连接已被另一个客户端接管":"当前设备的访问权限已被撤销,请重新配对")),Ae(!0),w.current?.(Ie),fe.state==="occupied"&&globalThis.confirm?.(C("另一个客户端正在使用语音助手,是否接管?"))===!0&&(Te.current=!0,oe(bt=>bt+1))}}});return _e.current=pe,te(""),V({type:Me.VOICE_CONNECTION,state:"connecting"}),pe.start(),()=>{se.setReady(!1),Pt("connection_closed"),pe.stop(),_e.current=null,D(!1),ee.clear(),pn()}},[$,re,je,d,Se,On,c,se,Ye,Dn,o,Ot,sa,pn,$e,e,Pt]),I.useEffect(()=>{l&&Pt()},[l,Pt]),I.useEffect(()=>{ut.current=[]},[e]),I.useEffect(()=>{if(!n||r){un.current=!1,ae(!1),st(Io({enabled:!1,inputOnlyMute:o,wakeWordOnly:!1}));return}let ee=!1;un.current=!1;const be=Ue=>{if(ee)return;const Ne=un.current!==Ue;un.current=Ue,ae(Ue),Ne&&st(Io({enabled:Ue,inputOnlyMute:o,wakeWordOnly:Ue&&he.current}))},pe=Ue=>{const Ne=xI(Ue);un.current=!1,ae(!1),st(Io({enabled:!1,inputOnlyMute:o,wakeWordOnly:!1})),te(Ne),Ae(!0),z.current?.(Ne)};if(!navigator.mediaDevices?.getUserMedia){pe(C("无法打开麦克风"));return}const fe=Ue=>{const Ne=new Error(Ue);return Ne.name="NotSupportedError",Ne},Ie=yI({mediaDevices:navigator.mediaDevices,acquire:async()=>{if(!Rt())throw fe(C("当前浏览器不支持实时语音播放"));const Ue=Le.current;if(!Ue)throw fe(C("无法初始化实时语音播放"));Ue.state==="suspended"&&await Ue.resume();const Ne=await navigator.mediaDevices.getUserMedia({audio:{echoCancellation:!0,noiseSuppression:!0,autoGainControl:!0}}),Ke=Ub(),kt=Ub();let sn=null,Xt=null,xi,ur,or=()=>{},ii=!1;try{xi=Ue.createMediaStreamSource(Ne);const Oi=await hI({context:Ue,moduleUrl:SI,onSamples:Mn=>{if(ii)return;const ri=OI(Mn,Tt.current);if(he.current){kt.reset(),sn=null,Xt?.reset(),Xt=null;const wt=Ke.process(ri,Ue.sampleRate,16e3);wt.length&&T.current?.(jb(wt),16e3);return}Ke.reset();const Yn=_e.current;if(Yn?.readyState!==WebSocket.OPEN){kt.reset(),sn=null,Xt?.reset(),Xt=null;return}Yn!==sn&&(kt.reset(),sn=Yn,Xt=lI({send:wt=>Yn.send(wt),getBufferedAmount:()=>Yn.bufferedAmount}));const Si=kt.process(ri,Ue.sampleRate,En.current);Si.length&&Xt.send({type:it.AUDIO_APPEND,audio:jb(Si)})}});return ur=Oi.node,or=Oi.close,xi.connect(ur),ur.connect(Ue.destination),{media:Ne,track:Ne.getAudioTracks()[0],close(){ii=!0,Ne.getTracks().forEach(Mn=>Mn.stop()),Ke.reset(),kt.reset(),sn=null,Xt?.reset(),Xt=null,or(),xi?.disconnect()}}}catch(Oi){throw ii=!0,Ne.getTracks().forEach(Mn=>Mn.stop()),or(),xi?.disconnect(),Oi}},onState:Ue=>{if(Ue.state==="ready"){te(""),Ae(!1),be(!0);return}be(!1),Ue.error&&Ue.recoverable&&(te(Ue.state==="unavailable"?C("未检测到可用麦克风,连接设备后会自动恢复"):C("正在切换麦克风")),Ae(!0))},onFatalError:pe});Ie.start();const bt=()=>{document.visibilityState==="visible"&&!un.current&&Ie.restart("app-resume")};return document.addEventListener("visibilitychange",bt),()=>{ee=!0,document.removeEventListener("visibilitychange",bt),un.current=!1,ae(!1),Ie.stop()}},[Rt,n,o,st,e,r]),I.useEffect(()=>{!n||r||!un.current||st(Io({enabled:!0,inputOnlyMute:o,wakeWordOnly:s}))},[n,o,st,r,s]),I.useEffect(()=>{if(!r)return;const ee=Le.current;Le.current=null,ee?.close()},[r]),I.useEffect(()=>()=>{Le.current?.close(),Le.current=null},[]);const ir=()=>{Pt("user_interruption"),st({type:"interrupt"})},rr=I.useCallback(()=>st({type:it.WAKE}),[st]),rn=I.useCallback((ee,be={})=>{const pe=_e.current;return pe?.request?pe.request(ee,be):Promise.reject(Object.assign(new Error("Gateway 尚未连接"),{code:"client_not_ready"}))},[]),$n=I.useCallback(ee=>rn(ie.TASK_LIST,ee).then(be=>be.tasks),[rn]),ar=I.useCallback(ee=>rn(ie.TASK_GET,{task_id:ee}).then(be=>be.task),[rn]),Ai=I.useCallback(ee=>rn(ie.TASK_CANCEL,{task_id:ee}).then(be=>be.task),[rn]),Fe=I.useCallback((ee,be)=>rn(ie.PERMISSION_RESPOND,{permission_id:ee,decision:be}).then(pe=>pe.permission),[rn]),Li=I.useCallback(()=>rn(ie.CONVERSATION_HISTORY).then(ee=>ee.messages),[rn]),Ui=I.useCallback(ee=>{Vn();const be={type:it.INPUT_MESSAGE,parts:ee};return _e.current?.readyState===WebSocket.OPEN?st(be)?!0:(pn(),!1):Ze.current?(ut.current.push(be),!0):(pn(),!1)},[Vn,pn,st]),lr=I.useCallback((ee,be=Date.now())=>{const pe=_e.current;return!pe?.ready||!pe.supports?.(ke.INPUT_IMAGE_BUFFER)?!1:st({type:ie.INPUT_IMAGE_APPEND,occurred_at:be,media_type:"image/jpeg",image:ee})},[st]),qr=I.useCallback(()=>{const ee=_e.current;return!ee?.ready||!ee.supports?.(ke.INPUT_IMAGE_BUFFER)?!1:st({type:ie.INPUT_IMAGE_CLEAR})},[st]);return{state:ve,visualState:ve,inputReady:j,imageBufferAvailable:ue,error:U,visualError:ne,connectionState:H,wakeWordActive:Pe,ownership:le,activateAudio:Rt,interrupt:ir,wake:rr,publishClientEvent:K,publishClientState:ze,sendInput:Ui,sendImageFrame:lr,clearImageBuffer:qr,listTasks:$n,getTask:ar,cancelTask:Ai,respondPermission:Fe,conversationHistory:Li}}const NI=200;function RI(e){const n=String(e||"").trim();return!n||n.length>NI||/[\u0000-\u001f\u007f]/.test(n)?"":n}function DI(e){return RI(new URLSearchParams(e).get("session")||"")}function MI({desktopOrbMode:e=!1,clientType:n="web"}={}){return e===!0||n==="mobile"}const lv=new Set(["queued","running","delegated","finalizing","cancelling","responding"]),II=new Set(["listening","processing","speaking"]);function LI(e=""){const n=new URLSearchParams(e),r=n.has("autoHideSeconds")?n.get("autoHideSeconds"):n.get("autoSleepSeconds");if(r===null)return 60;const l=Number(r);return l===0?0:Number.isInteger(l)&&l>=30&&l<=3600?l:60}function UI(e=""){return new URLSearchParams(e).get("wakeWordEnabled")==="true"}function uv(e=[]){return e.some(n=>lv.has(n.phase)||n.authorization?.status==="pending")}function jI(e=[]){return e.some(n=>lv.has(n.phase)&&n.authorization?.status!=="pending")}function BI({tasks:e=[],voiceState:n="idle"}={}){return!uv(e)&&!II.has(n)}function qI({settled:e,connectionState:n,visualError:r=!1,lifecycle:l="active"}={}){return l==="active"&&e===!0&&n==="connected"&&r!==!0}function HI(e){return e==="connected"||e==="unavailable"}function PI(e,n=""){return e==="hidden"?n==="inactivity"?"因空闲超时,桌面客户端已自动进入休眠,已暂停对话收音并隐藏。后台工作不受影响。":n==="requested"?"桌面客户端已执行休眠请求,已暂停对话收音并隐藏。后台工作不受影响。":"桌面客户端已进入休眠,已暂停对话收音并隐藏。后台工作不受影响。":e==="active"||e==="waking"?"桌面客户端当前已显示,可继续交互,不在休眠状态;此前的休眠状态已结束。":""}function ZI({lastInteractionAt:e,workSettledAt:n,timeoutSeconds:r}){return r?Math.max(e,n)+r*1e3:1/0}const GI=5e3;async function VI({bridge:e,onLifecycle:n=()=>{}}){if(typeof e?.enterHide!="function")return!1;const r=await e.enterHide();return r?.state!=="hidden"?!1:(n(r.state,r.reason),!0)}async function $I(e,{desktop:n=!1,bridge:r,onLifecycle:l=()=>{}}={}){if(e?.type!==ie.CLIENT_ACTION_REQUEST)return null;if(!n||![pM.ENTER_SLEEP,"client.tool.enter_sleep"].includes(e.name)||typeof r?.enterHide!="function")return{status:"unsupported",error:{code:"client_action_unsupported",message:`Unsupported Client Action: ${String(e?.name||"")}`}};try{if(e.name==="client.tool.enter_sleep"&&Object.keys(e.arguments||{}).length)return{status:"failed",error:{code:"invalid_arguments",message:"enter_sleep takes no arguments"}};const o=await r.enterHide({explicit:!0});return o?.state&&l(o.state,o.reason),o?.state!=="hidden"?{status:"failed",error:{code:"desktop_hide_incomplete",message:"Desktop did not enter the hidden state"}}:{status:"completed",output:{state:"hidden"}}}catch(o){return{status:"failed",error:{code:"desktop_hide_failed",message:String(o?.message||o).slice(0,500)}}}}async function YI(e,{desktop:n=!1,bridge:r,onLifecycle:l=()=>{},lastWakeAt:o=0,now:s=Date.now()}={}){if(!n||e?.type!==Me.CLIENT_STATE||e.state!=="sleeping"||typeof r?.enterHide!="function"||s-o<GI)return!1;const c=await r.enterHide();return c?.state&&l(c.state,c.reason),c?.state==="hidden"}const FI=new Set(["scheduled","queued","running","delegated","finalizing","cancelling","responding","completed","failed","cancelled","disconnected"]),KI=new Set(["reminder","scheduled_task"]);function $b(e){return Number(e.phase==="scheduled"?e.schedule?.at:e.createdAt)||0}function XI(e=[]){return e.filter(n=>FI.has(n.phase)&&(n.kind===void 0||n.kind==="work"||KI.has(n.kind))).sort((n,r)=>$b(n)-$b(r))}function QI(e,n=Date.now()){const r=e.startedAt&&!["completed","failed","cancelled"].includes(e.phase)?Math.max(e.elapsedMs||0,n-e.startedAt):e.elapsedMs||0;return Math.max(0,Math.round(r/1e3))}const JI=new Set(["failed"]),WI=new Set(["AUTH_REQUIRED","CONFIG_REQUIRED","NOT_INSTALLED","PROCESS_EXITED","PROTOCOL_MISMATCH","START_FAILED","START_TIMEOUT"]);function e4(e={}){return e.enabled===!1||e.status==="not_configured"?"skipped":e.ready===!0||e.status==="ready"?"ready":JI.has(e.status)||WI.has(e.code)?"failed":"connecting"}function t4(e="connecting"){return e==="connected"?"ready":e==="unavailable"?"failed":"connecting"}function n4({gateway:e="connecting",realtime:n="connecting",backend:r="connecting"}={}){const l={gateway:e,realtime:n,backend:r};return Object.values(l).includes("failed")?{overall:"failed",...l}:e==="ready"&&n==="ready"&&["ready","skipped"].includes(r)?{overall:"ready",...l}:{overall:"starting",...l}}function i4({current:e="starting",readyAnnounced:n=!1}={}){return e==="ready"&&!n?{cue:"ready",readyAnnounced:!0}:{cue:null,readyAnnounced:n}}function r4(e=""){const n=new URLSearchParams(e);return{orbSkinId:c0({orbSkin:n.get("orbSkin"),orbStyle:n.get("orbStyle")}),autoHideSeconds:LI(e),wakeWordEnabled:UI(e),language:n.get("lang")||""}}function a4(e,n={}){return{orbSkinId:n.orbSkin?c0({orbSkin:n.orbSkin}):e.orbSkinId,autoHideSeconds:Number.isFinite(n.autoHideSeconds)?n.autoHideSeconds:e.autoHideSeconds,wakeWordEnabled:typeof n.wakeWordEnabled=="boolean"?n.wakeWordEnabled:e.wakeWordEnabled,language:n.language||e.language}}const He=new URLSearchParams(window.location.search).get("desktop")==="orb",l4=new URLSearchParams(window.location.search).get("surface")==="panel"?"panel":"orb",Ko=lC(He?"desktop":"web"),u4=oC(),Kf=He||Ko==="mobile",o4=EC(Ko),s4=["text","image","video","audio"],c4={text:"Text",image:"Image",video:"Video",audio:"Audio"};function f4(e=[]){const n=new Set(e);return s4.filter(r=>n.has(r)).map(r=>c4[r]).join(" · ")}function d4(){const e=DI(window.location.search);if(e)return localStorage.setItem("qwen-audio-agent.session",e),e;const n=localStorage.getItem("qwen-audio-agent.session");if(n)return n;const r=crypto.randomUUID();return localStorage.setItem("qwen-audio-agent.session",r),r}function Xf(e){return{idle:C("待命"),listening:C("正在听"),processing:C("正在处理"),speaking:C("正在说"),working:C("正在处理任务"),starting:C("正在启动"),connecting:C("正在连接语音前台"),occupied:C("其他入口正在使用"),hidden:C("已隐藏"),waking:C("正在显示")}[e]||e}function Qf(e){return e?.label||{desktop:C("桌面端"),mobile:C("移动端"),cli:C("终端"),web:"WebUI"}[e?.type]||C("其他入口")}function ra({type:e,muted:n=!1,collapsed:r=!1}){return e==="microphone"?O.jsxs("svg",{viewBox:"0 0 24 24","aria-hidden":"true",children:[O.jsx("rect",{x:"9",y:"3.5",width:"6",height:"11",rx:"3"}),O.jsx("path",{d:"M6.5 11.5a5.5 5.5 0 0 0 11 0M12 17v3m-3 0h6"}),n&&O.jsx("path",{d:"M4 4 20 20"})]}):e==="settings"?O.jsxs("svg",{viewBox:"0 0 24 24","aria-hidden":"true",children:[O.jsx("circle",{cx:"12",cy:"12",r:"3"}),O.jsx("path",{d:"M19.4 15a1.8 1.8 0 0 0 .36 1.98l.04.04a2 2 0 0 1-2.83 2.83l-.04-.04a1.8 1.8 0 0 0-1.98-.36 1.8 1.8 0 0 0-1.08 1.65V21a2 2 0 0 1-4 0v-.06A1.8 1.8 0 0 0 8.8 19.3a1.8 1.8 0 0 0-1.98.36l-.04.04a2 2 0 0 1-2.83-2.83l.04-.04a1.8 1.8 0 0 0 .36-1.98A1.8 1.8 0 0 0 2.7 13.8H2.6a2 2 0 0 1 0-4h.06A1.8 1.8 0 0 0 4.3 8.72a1.8 1.8 0 0 0-.36-1.98l-.04-.04a2 2 0 0 1 2.83-2.83l.04.04a1.8 1.8 0 0 0 1.98.36A1.8 1.8 0 0 0 9.82 2.6V2.5a2 2 0 0 1 4 0v.06A1.8 1.8 0 0 0 14.9 4.2a1.8 1.8 0 0 0 1.98-.36l.04-.04a2 2 0 0 1 2.83 2.83l-.04.04a1.8 1.8 0 0 0-.36 1.98 1.8 1.8 0 0 0 1.65 1.08h.1a2 2 0 0 1 0 4h-.06A1.8 1.8 0 0 0 19.4 15Z"})]}):e==="conversation"?O.jsxs("svg",{viewBox:"0 0 24 24","aria-hidden":"true",children:[O.jsx("path",{d:"M5 5.5h14v10H9l-4 3v-13Z"}),O.jsx("path",{d:"M8 9h8m-8 3h5"})]}):e==="collapse"?O.jsx("svg",{viewBox:"0 0 24 24","aria-hidden":"true",children:O.jsx("path",{d:"m8 10 4 4 4-4"})}):e==="tasks"?O.jsx("svg",{viewBox:"0 0 24 24","aria-hidden":"true",children:O.jsx("path",{d:r?"m7 9 5 5 5-5":"m7 14 5-5 5 5"})}):O.jsx("svg",{viewBox:"0 0 24 24","aria-hidden":"true",children:O.jsx("path",{d:"m7 7 10 10M17 7 7 17"})})}function Sn(e,n,r,l){const o=e.findIndex(c=>c.id===n);if(o<0)return l?[...e,l]:e;const s=[...e];return s[o]=r(s[o]),s}function h4(){const[e,n]=I.useState(()=>r4(window.location.search)),{orbSkinId:r,autoHideSeconds:l,wakeWordEnabled:o}=e,[,s]=I.useState(0);I.useEffect(()=>{const k=()=>{Pd(),s(ye=>ye+1)};return window.addEventListener("languagechange",k),()=>window.removeEventListener("languagechange",k)},[]);const[c,d]=I.useState(d4),[m,p]=I.useState(()=>MI({desktopOrbMode:He,clientType:Ko})),[y,g]=I.useState(!1),[S,v]=I.useState(!1),[_,N]=I.useState([]),[M,A]=I.useState(C("正在检查后台 Agent")),[V,j]=I.useState({label:"Realtime Agent"}),[ae,ue]=I.useState(()=>Vb()),D=!Kf&&ae.modelInputModes.includes("video")&&ae.transportInputModes.includes("video");I.useEffect(()=>{D||v(!1)},[D]);const[$,re]=I.useState("connecting"),[de,U]=I.useState({label:"Agent",enabled:null,ready:!1,status:"starting",code:null}),[te,ne]=I.useState([]),[Ae,Se]=I.useState(Date.now),[oe,H]=I.useState(!1),[le,ve]=I.useState(!1),[Pe,w]=I.useState({placement:"below",orbOffsetX:0}),[z,F]=I.useState(!1),[T,he]=I.useState(""),[_e,Te]=I.useState([]),[Ze,ut]=I.useState(!1),[Le,dn]=I.useState({state:"active",reason:""}),yt=Le.state,En=I.useCallback((k,ye)=>{dn(Z=>({state:k,reason:ye??(Z.state===k?Z.reason:"")}))},[]),[On,_n]=I.useState(l4),[un,bi]=I.useState(Date.now),hn=I.useRef(""),Tt=I.useRef(""),on=I.useRef(new Map),Yt=I.useRef(new Set),At=I.useRef(new Map),pn=I.useRef(null),Vn=I.useRef(!0),Rt=I.useRef(null),st=I.useRef(0),K=I.useRef(!1),se=I.useRef(!1),ze=I.useRef(Date.now()),je=I.useRef(null),$e=I.useRef(0),ct=I.useRef(0),Pt=I.useRef("active"),xt=I.useRef(null),Ot=I.useRef(c);Ot.current=c;const Ct=_e[0]||null;I.useEffect(()=>{if(!He)return;const k=window.qwenAudioAgentDesktop;if(typeof k?.onClientSettings=="function")return k.onClientSettings(ye=>{n(Z=>a4(Z,ye)),ye.orbSkin&&ut(!1),ye.language&&(tO(ye.language),s(Z=>Z+1))})},[]),I.useEffect(()=>{const k=window.qwenAudioAgentDesktop?.setConversationSession;!He||typeof k!="function"||k(c).catch(()=>{})},[c]);const Ye=I.useCallback(()=>{bi(Date.now())},[]),Dn=I.useCallback(async k=>{const ye=window.qwenAudioAgentDesktop;if(!(!He||!ye?.setSurface))try{const Z=await ye.setSurface(k);_n(Z?.mode==="panel"?"panel":"orb"),Ye()}catch{}},[Ye]),Zt=I.useCallback((k,{priority:ye=!1}={})=>{if(!He||Bf(r))return;const Z=YO(k);if(!Z)return;st.current+=1;const me={id:st.current,name:Z};Te(ge=>ye?[me,...ge]:[...ge,me])},[r]),sa=I.useCallback(k=>{Te(ye=>ye[0]?.id===k?ye.slice(1):ye)},[]),ir=I.useCallback(async(k,ye,Z)=>{if(!(!ye?.id||ye.submitting)){ne(me=>Sn(me,k,ge=>({...ge,authorization:{...ge.authorization,submitting:!0,error:null}})));try{await xt.current?.respondPermission(ye.id,Z)}catch(me){if(["permission_not_found","task_not_found"].includes(me.code)){ne(ge=>Sn(ge,k,an=>({...an,authorization:null})));return}ne(ge=>Sn(ge,k,an=>({...an,authorization:an.authorization?{...an.authorization,submitting:!1,error:C("没有提交成功:{message}",{message:me.message})}:null})))}}},[]),rr=I.useCallback(async k=>{if(k?.phase!=="scheduled"||!k.id)return;const ye=xt.current?.cancelTask;if(typeof ye=="function"){ne(Z=>Sn(Z,k.id,me=>({...me,phase:"cancelling"})));try{const Z=await ye(k.id);if(!Z)return;ne(me=>Sn(me,k.id,ge=>Mt(Z,ge),Mt(Z)))}catch{ne(Z=>Sn(Z,k.id,me=>me.phase==="cancelling"?{...me,phase:"scheduled"}:me))}}},[]);I.useLayoutEffect(()=>{Vn.current=!0},[On,c]),I.useLayoutEffect(()=>{const k=pn.current;k&&Vn.current&&(k.scrollTop=k.scrollHeight)},[_,te,On,c]),I.useEffect(()=>()=>{At.current.forEach(k=>clearTimeout(k)),At.current.clear()},[]),I.useEffect(()=>{let k=!1,ye;const Z=()=>Uo("api/health",{cache:"no-store"}).then(async me=>({response:me,payload:await me.json()})).then(({response:me,payload:ge})=>{if(k)return;const an=me.ok&&ge.ok!==!1,cn=ge.backend||{},Lt=cn.enabled!==!1&&!!(cn.kind||cn.protocol),vi=ge.backend?.label||ge.backend?.kind||"Agent";if(j({label:ge.realtimeLabel||ge.realtimeProvider||"Realtime Agent"}),ue(Vb(ge)),re(an?"ready":"failed"),U({label:vi,enabled:Lt,ready:an&&(Lt?cn.ok===!0:!0),status:cn.status||(Lt?"starting":"not_configured"),code:cn.code||null,error:cn.error||"",url:ge.backend?.uiPath||ge.backend?.baseUrl||""}),A(me.ok?C("Gateway 已连接"):C("能力服务尚未连接")),He){const ca=!Lt||["ready","failed"].includes(cn.status);ye=setTimeout(Z,ca?3e3:500)}}).catch(()=>{k||(re("failed"),A(C("qwen-audio-agent Gateway 尚未连接")),He&&(ye=setTimeout(Z,1e3)))});return Z(),()=>{k=!0,clearTimeout(ye)}},[]);const rn=I.useCallback((k,ye=!1)=>{const Z=k.turnId?`user:${k.turnId}`:crypto.randomUUID();N(me=>A_(me,{id:Z,content:k.content,turnId:k.turnId,final:ye})),ye&&Ye()},[Ye]),$n=I.useCallback((k,ye=!1)=>{const Z=k.responseId||hn.current;if(!Z)return;hn.current=Z;const me=`voice:${Z}`,ge=on.current.get(Z)||k.turnId||Tt.current;N(an=>x_(an,{id:me,content:k.content,turnId:ge,taskId:k.taskId,taskIds:k.taskIds,origin:k.origin,citations:k.citations,final:ye}))},[]),ar=I.useCallback(k=>{const ye=FO(k);if(ye&&Zt(ye),k.type==="turn.started"&&(Tt.current=k.turnId||"",hn.current="",Vn.current=!0,A(C("正在听你说"))),k.type==="gateway.disconnected"&&(A(C("qwen-audio-agent Gateway 已断开,正在重连")),ne(Z=>Z.map(me=>["queued","running","delegated","finalizing","cancelling","responding"].includes(me.phase)?{...me,phase:"disconnected"}:me))),YI(k,{desktop:He,bridge:window.qwenAudioAgentDesktop,onLifecycle:En,lastWakeAt:ct.current}).catch(()=>{}),k.type==="voice.sleep"&&k.state==="detected"&&He&&window.qwenAudioAgentDesktop?.wake(),k.type==="session.recovered"){if(Ot.current!==c)return;N(ge=>w_(ge,k.messages||[]));const Z=k.tasks||[],me=new Map(Z.map(ge=>[ge.id,ge]));ne(ge=>{const an=new Set(ge.map(Lt=>Lt.id)),cn=ge.flatMap(Lt=>{const vi=me.get(Lt.id);return vi&&xC(vi)?[]:vi?[Mt(vi,Lt)]:Lt.phase!=="disconnected"?[Lt]:[{...Lt,phase:"failed",error:C("网关重连后未找到这次后台执行,请重新提交。")}]});return Z.filter(Lt=>wC(Lt)&&!an.has(Lt.id)).reverse().forEach(Lt=>cn.push(Mt(Lt))),cn})}if(k.type==="voice.deactivated"&&(p(!1),g(!1),A(C("{holder}正在使用语音",{holder:Qf(k.holder)}))),k.type==="voice.ownership"&&k.state==="busy"&&m&&(p(!1),g(!1),A(C("{holder}正在使用语音",{holder:Qf(k.holder)}))),k.type==="voice.ownership"&&k.state==="available"&&(EI(k,y)?(g(!1),p(!0),A(C("正在接入语音"))):m||A(C("待命"))),k.type==="voice.state"){if(k.turnId&&k.turnId!==Tt.current&&k.origin==="model")return;k.state==="listening"&&A(C("正在听你说")),k.state==="processing"&&!Yt.current.has(Tt.current)&&A(C("正在处理")),k.state==="idle"&&!Yt.current.has(Tt.current)&&A(C("待命"))}if(k.type==="transcript.delta"&&k.role==="user"&&rn(k),k.type==="transcript.final"&&k.role==="user"&&rn(k,!0),k.type==="transcript.discard"&&k.role==="user"&&N(Z=>O_(Z,k.turnId)),k.type==="response.started"&&(hn.current=k.responseId,k.turnId&&(on.current.set(k.responseId,k.turnId),on.current.size>100&&on.current.delete(on.current.keys().next().value)),k.turnId===Tt.current&&!Yt.current.has(k.turnId)&&A(C("正在回复"))),k.type==="transcript.delta"&&k.role==="assistant"&&$n(k),k.type==="transcript.final"&&k.role==="assistant"&&$n(k,!0),k.type==="response.interrupted"){const Z=`voice:${k.responseId}`;N(me=>me.map(ge=>ge.id===Z?{...ge,interrupted:!0,live:!1}:ge))}if(k.type==="task.scheduled"){const Z=k.task;ne(me=>Sn(me,Z.id,ge=>Mt(Z,ge),Mt(Z)))}if(k.type==="task.accepted"){const Z=k.task;Z.turnId&&Yt.current.add(Z.turnId),(!Z.turnId||Z.turnId===Tt.current)&&A(C("正在处理")),ne(me=>Sn(me,Z.id,ge=>Mt(Z,ge),Mt(Z)))}if(k.type==="task.running"){const Z=k.task;Z.turnId&&Yt.current.add(Z.turnId),(!Z.turnId||Z.turnId===Tt.current)&&A(C("正在处理")),ne(me=>Sn(me,Z.id,ge=>({...ge,elapsedMs:Z.elapsedMs||0,phase:"running"}),{id:Z.id,kind:Z.kind,objective:Z.objective,createdAt:Z.createdAt,startedAt:Z.startedAt,elapsedMs:Z.elapsedMs||0,phase:"running",turnId:Z.turnId}))}if(k.type==="task.progress"){const Z=k.task;(!Z.turnId||Z.turnId===Tt.current)&&A(C("正在处理 · {seconds} 秒",{seconds:Math.round(Z.elapsedMs/1e3)})),ne(me=>Sn(me,Z.id,ge=>Mt(Z,ge),Mt(Z)))}if(k.type==="task.updated"){const Z=k.task;ne(me=>Sn(me,Z.id,ge=>Mt(Z,ge),Mt(Z)))}if(k.type==="task.delegated"){const Z=k.task;(!Z.turnId||Z.turnId===Tt.current)&&A(C("进行中")),ne(me=>Sn(me,Z.id,ge=>Mt(Z,ge),Mt(Z)))}if(k.type==="task.finalizing"||k.type==="task.cancelling"){const Z=k.task;(!Z.turnId||Z.turnId===Tt.current)&&A(k.type==="task.finalizing"?C("正在整理项目结果"):C("正在取消")),ne(me=>Sn(me,Z.id,ge=>Mt(Z,ge),Mt(Z)))}if(k.type==="task.permission.requested"||k.type==="task.permission.resolved"){const Z=k.task;k.type==="task.permission.requested"?A(C("等待你的确认")):A(C("正在继续处理")),ne(me=>Sn(me,Z.id,ge=>Mt(Z,ge),Mt(Z)))}if(k.type==="task.completed"){const Z=k.task;Z.turnId&&Yt.current.delete(Z.turnId),(!Z.turnId||Z.turnId===Tt.current)&&A(C("正在准备回复")),ne(me=>Sn(me,Z.id,ge=>Mt(Z,ge),Mt(Z)))}if(k.type==="task.notification.delivered"){const Z=k.task;ne(me=>AC(me,Z.id))}if(k.type==="task.failed"){const Z=k.task;Z.turnId&&Yt.current.delete(Z.turnId),(!Z.turnId||Z.turnId===Tt.current)&&A(C("后台失败:{error}",{error:Z.error})),ne(me=>Sn(me,Z.id,ge=>({...Mt(Z,ge),phase:"failed"}),{...Mt(Z),phase:"failed"}))}if(k.type==="task.cancelled"){const Z=k.task;Z.turnId&&Yt.current.delete(Z.turnId),(!Z.turnId||Z.turnId===Tt.current)&&A(C("已取消")),ne(me=>Sn(me,Z.id,ge=>({...Mt(Z,ge),phase:"cancelled"}),{...Mt(Z),phase:"cancelled"})),clearTimeout(At.current.get(Z.id)),At.current.set(Z.id,setTimeout(()=>{ne(me=>OC(me,Z.id,"cancelled")),A(me=>me===C("已取消")?C("待命"):me),At.current.delete(Z.id)},3e3))}if(k.type==="transcript.final"&&k.role==="assistant"){k.turnId===Tt.current&&A(C("待命"));const Z=new Set(k.taskIds?.length?k.taskIds:[k.taskId].filter(Boolean));ne(me=>me.filter(ge=>!Z.has(ge.id)||au(ge)||!["responding","completed"].includes(ge.phase)))}},[c,rn,$n,m,y,Zt,En]),Ai=He&&yt==="hidden"&&o,Fe=zI({sessionId:c,enabled:m||Ai,suspended:He&&yt==="hidden"&&!o,outputMuted:!1,inputOnlyMute:!0,wakeWordOnly:Ai,clientType:Ko,clientLabel:uC(He?C("桌面端"):"WebUI"),clientInstanceId:u4,clientStates:He?["sleeping"]:[],clientTools:He?xO:[],clientPresence:He?yt==="hidden"?"sleeping":"active":void 0,onEvent:ar,onInputError:k=>{p(!1),g(!1),A(k)},onClientAction:k=>$I(k,{desktop:He,bridge:window.qwenAudioAgentDesktop,onLifecycle:En}),onWakeWordAudio:(k,ye)=>{window.qwenAudioAgentDesktop?.acceptWakeWordAudio(k,ye)}});xt.current=Fe;const Li=Fe.publishClientState;I.useEffect(()=>{if(!He)return;const k=PI(yt,Le.reason);k&&Li("desktop.presence.changed",k)},[yt,Le.reason,Li]);const Ui=I.useCallback(k=>{Li("media.visual_input.changed",k?"客户端已开启实时视觉输入;仅根据实际收到的最新画面描述当前环境。":"客户端已停止实时视觉输入,当前无法看到新的画面。之前收到的画面仅代表历史,不代表当前环境。")},[Li]);I.useEffect(()=>{D&&Ui(!1)},[D,Ui]);const qr=!(He&&yt!=="active")&&Fe.connectionState==="unavailable",ee=n4({gateway:$,realtime:t4(Fe.connectionState),backend:e4(de)}),be=He&&jI(te),pe=yC({lifecycle:yt,runtimeState:He?ee.overall:null,connectionError:!He&&qr,connecting:!He&&m&&Fe.connectionState==="connecting",ownershipBusy:Fe.ownership.state==="busy",voiceState:Fe.visualState||Fe.state,tasksWorking:be}),fe=te.find(k=>k.authorization?.status==="pending");I.useEffect(()=>{if(!He)return;const k=ee.overall,ye=i4({current:k,readyAnnounced:K.current});K.current=ye.readyAnnounced,ye.cue&&Zt(ye.cue)},[ee.overall,Zt]);const Ie=I.useMemo(()=>He?XI(te):[],[te]);I.useEffect(()=>{Ie.length||H(!1)},[Ie.length]),I.useEffect(()=>{He&&window.qwenAudioAgentDesktop?.loadSurface?.().then(k=>_n(k?.mode==="panel"?"panel":"orb")).catch(()=>{})},[]),I.useEffect(()=>{if(He)return window.qwenAudioAgentDesktop?.onTaskCardPlacement?.(w)},[]),I.useEffect(()=>{He&&window.qwenAudioAgentDesktop?.setTaskCardCount(On==="panel"?Ie.length:oe?0:Ie.length)},[Ie.length,On,oe]),I.useEffect(()=>{if(He)return()=>window.qwenAudioAgentDesktop?.setTaskCardCount(0)},[]);const bt=Fe.ownership.holder?Qf(Fe.ownership.holder):"",Ue=BI({tasks:te,voiceState:Fe.visualState||Fe.state}),Ne=uv(te);I.useEffect(()=>{if(!Ne)return;const k=setInterval(()=>Se(Date.now()),1e3);return()=>clearInterval(k)},[Ne]),I.useEffect(()=>{if(He){if(!Ne&&se.current){const k=Date.now();ze.current=k}se.current=Ne}},[Ne]),I.useEffect(()=>{if(!He)return;const k=window.qwenAudioAgentDesktop;if(!k)return;const ye=ge=>{ge?.state&&(ge.state==="waking"&&Pt.current!=="waking"&&Zt("wake",{priority:!0}),Pt.current=ge.state,En(ge.state,ge.reason),ge.state==="waking"&&(ct.current=Date.now()),ge.reason==="activity"&&Ye(),ge.state==="hidden"&&(_n("orb"),A(C("已隐藏"))),ge.state==="waking"&&A(C("正在显示悬浮球")),ge.state==="active"&&ge.reason==="ready"&&(A(C("待命")),Ye()))},Z=k.onLifecycle(ye);k.loadLifecycle().then(ye).catch(()=>{});const me=()=>Ye();return window.addEventListener("pointerdown",me),window.addEventListener("keydown",me),()=>{Z(),window.removeEventListener("pointerdown",me),window.removeEventListener("keydown",me)}},[Ye,Zt,En]),I.useEffect(()=>{!He||yt!=="waking"||HI(Fe.connectionState)&&window.qwenAudioAgentDesktop?.lifecycleReady()},[yt,Fe.connectionState]);const Ke=Fe.wake;I.useEffect(()=>{!He||yt!=="waking"||Ke()},[yt,Ke]),je.current={desktopLifecycle:yt,desktopSurfaceMode:On,lastInteractionAt:un,connectionState:Fe.connectionState,visualError:Fe.visualError,workSettled:Ue},I.useEffect(()=>{if(!He||l===0)return;const k=()=>{const Z=je.current;if(!Z||Z.desktopSurfaceMode==="panel"||!qI({settled:Z.workSettled,connectionState:Z.connectionState,visualError:Z.visualError,lifecycle:Z.desktopLifecycle}))return;const me=ZI({lastInteractionAt:Z.lastInteractionAt,workSettledAt:ze.current,timeoutSeconds:l});Date.now()<me||$e.current===me||($e.current=me,VI({bridge:window.qwenAudioAgentDesktop,onLifecycle:En}).then(ge=>{ge||($e.current=null)}).catch(()=>{$e.current=null}))},ye=setInterval(k,1e3);return k(),()=>clearInterval(ye)},[l,En]);const kt=(ae.label||C("模型信息不可用")).replace(/\s+Realtime\b/gi,"").trim(),sn=()=>{v(!1),At.current.forEach(ye=>clearTimeout(ye)),At.current.clear();const k=crypto.randomUUID();localStorage.setItem("qwen-audio-agent.session",k),d(k),N([]),ne([]),Tt.current="",hn.current="",on.current.clear(),Yt.current.clear(),A(C("已创建新会话"))},Xt=()=>{if(Fe.activateAudio()){if(Fe.ownership.state==="busy"){g(!0),A(C("等待{holder}释放语音",{holder:bt||C("其他入口")}));return}g(!1),p(!0)}},xi=C(m?"麦克风静音":y?"取消等待":"开启麦克风"),ur=()=>{g(!1),p(!1),A(C("待命"))},or=k=>(Fe.activateAudio(),Fe.sendInput(k)),ii=I.useMemo(()=>C_(_,te),[_,te]),Oi=k=>{const ye=window.qwenAudioAgentDesktop;!He||k.button!==0||!ye||(k.currentTarget.setPointerCapture?.(k.pointerId),Rt.current={pointerId:k.pointerId,lastX:k.screenX},F(!0),he(""),ye.dragStart(k.screenX,k.screenY))},Mn=k=>{const ye=Rt.current;if(!ye||ye.pointerId!==k.pointerId)return;const Z=k.screenX-ye.lastX;Math.abs(Z)>=2&&(he(Z>0?"right":"left"),ye.lastX=k.screenX),window.qwenAudioAgentDesktop?.dragMove(k.screenX,k.screenY)},ri=k=>{const ye=Rt.current;!ye||ye.pointerId!==k.pointerId||(Rt.current=null,F(!1),he(""),window.qwenAudioAgentDesktop?.dragEnd())},Yn=()=>{if(Fe.state==="speaking"){Fe.interrupt();return}Xt()};if(He&&On==="orb")return O.jsxs("main",{className:`desktop-gallery-shell${Ie.length&&!oe?" has-task-cards":""}${Pe.placement==="above"?" tasks-above":""}`,style:{"--desktop-orb-offset-x":`${Pe.orbOffsetX}px`},children:[O.jsx("div",{className:"desktop-orb-anchor",children:O.jsxs("section",{className:bC({state:pe,enabled:m,error:Fe.visualError||qr,dragging:z,lifecycle:yt}),"aria-label":`qwen-audio · ${Fe.visualError||qr?C("连接异常"):Xf(pe)}`,title:yt==="waking"?C("正在显示悬浮球"):Fe.error||(pe==="idle"&&fe?qf(fe):pe==="occupied"&&bt?C("{holder}正在使用语音",{holder:bt}):Xf(pe)),onPointerEnter:()=>Zt("hover"),onPointerDown:Oi,onPointerMove:Mn,onPointerUp:ri,onPointerCancel:ri,children:[Bf(r)||Ze?O.jsx(LO,{style:Bf(r)?r:"fluid"}):O.jsx(eC,{skin:r,state:pe,baseWorking:be,dragDirection:T,cue:Ct,onCueComplete:sa,onError:()=>ut(!0)}),O.jsxs("nav",{className:"desktop-orb-controls","aria-label":C("语音控制"),onPointerDown:k=>k.stopPropagation(),children:[O.jsx("button",{className:m?"":"active",onClick:k=>{if(k.stopPropagation(),m||y){ur();return}Xt()},"aria-label":C(m?"麦克风静音":y?"取消等待语音":"开启麦克风"),title:C(m?"麦克风静音":y?"取消等待语音":"开启麦克风"),children:O.jsx(ra,{type:"microphone",muted:!m})}),O.jsx("button",{onClick:k=>{k.stopPropagation(),Dn("panel")},"aria-label":C("打开对话"),title:C("打开对话"),children:O.jsx(ra,{type:"conversation"})}),O.jsx("button",{onClick:k=>{k.stopPropagation(),window.qwenAudioAgentDesktop?.openSettings()},"aria-label":C("设置"),title:C("设置"),children:O.jsx(ra,{type:"settings"})}),Ie.length>0&&O.jsx("button",{onClick:k=>{k.stopPropagation(),H(ye=>!ye)},"aria-label":C(oe?"展开后台任务":"折叠后台任务"),title:C(oe?"展开后台任务":"折叠后台任务"),children:O.jsx(ra,{type:"tasks",collapsed:oe})}),O.jsx("button",{className:"danger",onClick:k=>{k.stopPropagation(),window.qwenAudioAgentDesktop?.quit()},"aria-label":C("退出"),title:C("退出"),children:O.jsx(ra,{type:"close"})})]})]})}),Ie.length>0&&!oe&&O.jsx("section",{className:"desktop-task-stack","aria-label":C("后台任务"),"aria-live":"polite",children:Ie.map(k=>{const ye=qf(k),Z=k.delegation?.title||k.objective||xo(k),me=k.phase==="scheduled",ge=["completed","failed","cancelled"].includes(k.phase)?xo(k):ye&&ye!==Z?ye:xo(k),an=k.activity?.findLast(Lt=>Lt.kind==="plan"),cn=["completed","failed","cancelled"].includes(k.phase)?1:an?.total>0?an.completed/an.total:null;return O.jsxs("article",{className:`desktop-task-card ${k.phase}`,title:ye,children:[O.jsx("strong",{children:Z}),O.jsxs("span",{className:"desktop-task-state",children:[O.jsx("i",{"aria-hidden":"true"}),O.jsx("small",{children:ge})]}),me&&O.jsx("button",{className:"desktop-task-cancel",type:"button","aria-label":C(k.kind==="reminder"?"取消提醒":"取消计划"),title:C(k.kind==="reminder"?"取消提醒":"取消计划"),onClick:Lt=>{Lt.stopPropagation(),rr(k)},children:"×"}),O.jsx("span",{className:`desktop-task-progress${cn==null?"":" determinate"}`,style:cn==null?void 0:{"--desktop-task-progress":`${Math.max(0,Math.min(1,cn))*100}%`},"aria-hidden":"true"})]},k.id)})})]});const Si=k=>O.jsxs("aside",{className:`agent-task ${k.phase}${au(k)?" has-artifacts":""}${k.authorization?.status==="pending"?" awaiting-permission":""}`,children:[O.jsx("span",{className:"task-spinner","aria-hidden":"true"}),O.jsxs("div",{children:[O.jsx("b",{children:xo(k)}),O.jsx("small",{children:qf(k)}),O.jsx(DO,{artifacts:k.artifacts})]}),!["failed","disconnected"].includes(k.phase)&&O.jsxs("div",{className:"task-controls",children:[k.authorization?.status==="pending"&&O.jsx(IO,{authorization:k.authorization,onRespond:ye=>ir(k.id,k.authorization,ye)}),O.jsxs("time",{children:[QI(k,Ae),"s"]})]})]},`task:${k.id}`),wt=k=>O.jsxs("article",{className:`${k.role}${k.companion?" companion":""}`,children:[O.jsx("label",{children:k.role==="user"?C("你"):k.companion?_C(k):"qwen-audio"}),O.jsx(l0,{role:k.role,content:k.content,live:k.live,citations:k.citations}),k.interrupted&&O.jsx("small",{className:"interrupted",children:C("已打断")})]},k.id);return O.jsxs("main",{className:`app${He?" desktop-conversation-panel":""}`,children:[O.jsxs("header",{children:[O.jsxs("div",{className:"brand",children:[O.jsx("span",{children:"V"}),O.jsxs("div",{children:["qwen-audio-agent",O.jsx("small",{children:"REALTIME VOICE · LIVE"})]})]}),O.jsxs("a",{className:"backend",href:de.url||void 0,target:"_blank",rel:"noreferrer",title:de.url?C("打开 {label}",{label:de.label}):de.label,children:[O.jsx("i",{className:de.ready?"ready":""}),de.label]}),O.jsxs("div",{className:"model-status",title:`${V.label}
|
|
91
|
-
${ae.id}`,children:[O.jsx("b",{children:kt}),ae.metadataStatus==="current"?O.jsx("small",{children:f4(ae.modelInputModes)}):O.jsx("small",{children:C("模型能力信息不可用")})]}),O.jsxs("div",{className:"status",children:[O.jsx("i",{className:pe}),O.jsx("span",{children:Xf(pe)})]}),!He&&O.jsx("button",{className:`ghost${le?" active":""}`,onClick:()=>ve(k=>!k),title:C("把本机的手册、规章、教材交给助手"),children:C("资料库")}),O.jsx("button",{className:`ghost${He?" desktop-new-session":""}`,onClick:sn,"aria-label":C("新会话"),title:He?C("新会话"):void 0,children:He?"+":C("新会话")}),O.jsx("button",{className:["voice",m?"active":"",y?"waiting":""].filter(Boolean).join(" "),"aria-label":xi,title:Kf?xi:void 0,onClick:()=>{if(m||y){ur();return}Xt()},children:Kf?O.jsx(ra,{type:"microphone",muted:!m}):xi}),D&&O.jsx("button",{className:`video-toggle${S?" active":""}`,"aria-pressed":S,onClick:()=>{S||Fe.activateAudio(),v(k=>!k)},children:C(S?"关闭视频":"开启视频")}),He&&O.jsx("button",{className:"ghost desktop-panel-collapse",onClick:()=>{Dn("orb")},title:C("收起为悬浮球"),children:O.jsx(ra,{type:"collapse"})})]}),O.jsxs("section",{className:"workspace",children:[le&&O.jsx(mC,{onClose:()=>ve(!1),getTask:Fe.getTask}),O.jsxs("div",{className:"hero",children:[O.jsx("button",{className:`orb ${pe}`,onClick:Yn,"aria-label":C("语音交互"),children:O.jsx("span",{})}),O.jsx("p",{children:"VOICE FRONTEND"}),O.jsx("h1",{children:C("你说,我来调度。")}),O.jsx("small",{children:Fe.error||M})]}),O.jsxs("div",{className:"messages",ref:pn,"aria-live":"polite",onScroll:k=>{const ye=k.currentTarget;Vn.current=ye.scrollHeight-ye.scrollTop-ye.clientHeight<48},children:[!ii.length&&O.jsxs("div",{className:"empty",children:[O.jsx("b",{children:C("试着说")}),O.jsx("span",{children:C("“帮我查一下今天的 AI 新闻,并整理成三点摘要。”")})]}),ii.map(k=>O.jsxs("section",{className:`conversation-turn${k.standalone?" standalone":""}`,children:[k.beforeActivities.map(wt),k.tasks.map(Si),k.afterActivities.map(wt)]},k.id))]}),D&&S&&O.jsx("div",{className:"visual-stream-dock",children:O.jsx(AO,{available:Fe.imageBufferAvailable,connectionState:Fe.connectionState,onFrame:Fe.sendImageFrame,onStop:Fe.clearImageBuffer,onStateChange:Ui,onClose:()=>v(!1)})}),o4&&O.jsx(mO,{onSend:or,compact:He})]})]})}new URLSearchParams(window.location.search).get("desktop")==="orb"&&(document.documentElement.dataset.desktop="orb");T_.createRoot(document.getElementById("root")).render(O.jsx(I.StrictMode,{children:O.jsx(h4,{})}));
|