@workerdeck/web 0.7.0 → 0.10.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.
Files changed (94) hide show
  1. package/README.md +4 -2
  2. package/dist/assets/abap-DLDM7-KI.js +1 -0
  3. package/dist/assets/apex-DNDY2TF8.js +1 -0
  4. package/dist/assets/azcli-Y6nb8tq_.js +1 -0
  5. package/dist/assets/bat-BwHxbl9M.js +1 -0
  6. package/dist/assets/bicep-CFznDFnq.js +2 -0
  7. package/dist/assets/cameligo-Bf6VGUru.js +1 -0
  8. package/dist/assets/clojure-Dnu-v4kV.js +1 -0
  9. package/dist/assets/codicon-Brq4_Ui5.ttf +0 -0
  10. package/dist/assets/coffee-Bd8akH9Z.js +1 -0
  11. package/dist/assets/cpp-BbWJElDN.js +1 -0
  12. package/dist/assets/csharp-Co3qMtFm.js +1 -0
  13. package/dist/assets/csp-D-4FJmMZ.js +1 -0
  14. package/dist/assets/css-DdJfP1eB.js +3 -0
  15. package/dist/assets/cypher-cTPe9QuQ.js +1 -0
  16. package/dist/assets/dart-BOtBlQCF.js +1 -0
  17. package/dist/assets/dockerfile-BG73LgW2.js +1 -0
  18. package/dist/assets/ecl-BEgZUVRK.js +1 -0
  19. package/dist/assets/elixir-BkW5O-1t.js +1 -0
  20. package/dist/assets/flow9-BeJ5waoc.js +1 -0
  21. package/dist/assets/freemarker2-BtlyqqMT.js +3 -0
  22. package/dist/assets/fsharp-PahG7c26.js +1 -0
  23. package/dist/assets/go-acbASCJo.js +1 -0
  24. package/dist/assets/graphql-BxJiqAUM.js +1 -0
  25. package/dist/assets/handlebars-C2ZEyrX-.js +1 -0
  26. package/dist/assets/hcl-DtV1sZF8.js +1 -0
  27. package/dist/assets/{highlighted-body-OFNGDK62-BP5tMAtR.js → highlighted-body-OFNGDK62-FrfZbPjC.js} +1 -1
  28. package/dist/assets/html-DFT6pU5-.js +1 -0
  29. package/dist/assets/{index-Bgb6oVBf.js → index-1rpBHb-o.js} +1 -1
  30. package/dist/assets/index-CXkKwxiP.css +1 -0
  31. package/dist/assets/index-Cp7oyvl2.css +1 -0
  32. package/dist/assets/{index-DHI1YKpy.js → index-DV4XHFya.js} +1 -1
  33. package/dist/assets/index-ewsUSLkh.js +669 -0
  34. package/dist/assets/index-if4BL-EX.js +930 -0
  35. package/dist/assets/ini-Kd9XrMLS.js +1 -0
  36. package/dist/assets/java-CXBNlu9o.js +1 -0
  37. package/dist/assets/javascript-jWfXohh3.js +1 -0
  38. package/dist/assets/julia-cl7-CwDS.js +1 -0
  39. package/dist/assets/kotlin-s7OhZKlX.js +1 -0
  40. package/dist/assets/less-9HpZscsL.js +2 -0
  41. package/dist/assets/lexon-OrD6JF1K.js +1 -0
  42. package/dist/assets/liquid-0mJ9eZXa.js +1 -0
  43. package/dist/assets/lua-Cyyb5UIc.js +1 -0
  44. package/dist/assets/m3-B8OfTtLu.js +1 -0
  45. package/dist/assets/markdown-BFxVWTOG.js +1 -0
  46. package/dist/assets/mdx-lKXAm9dp.js +1 -0
  47. package/dist/assets/mips-CiqrrVzr.js +1 -0
  48. package/dist/assets/msdax-DmeGPVcC.js +1 -0
  49. package/dist/assets/mysql-C_tMU-Nz.js +1 -0
  50. package/dist/assets/objective-c-BDtDVThU.js +1 -0
  51. package/dist/assets/pascal-vHIfCaH5.js +1 -0
  52. package/dist/assets/pascaligo-DtZ0uQbO.js +1 -0
  53. package/dist/assets/perl-Ub6l9XKa.js +1 -0
  54. package/dist/assets/pgsql-BlNEE0v7.js +1 -0
  55. package/dist/assets/php-BBUBE1dy.js +1 -0
  56. package/dist/assets/pla-DSh2-awV.js +1 -0
  57. package/dist/assets/postiats-CocnycG-.js +1 -0
  58. package/dist/assets/powerquery-tScXyioY.js +1 -0
  59. package/dist/assets/powershell-COWaemsV.js +1 -0
  60. package/dist/assets/protobuf-Brw8urJB.js +2 -0
  61. package/dist/assets/pug-8SOpv6rk.js +1 -0
  62. package/dist/assets/python-DcG9vfCe.js +1 -0
  63. package/dist/assets/qsharp-Bw9ernYp.js +1 -0
  64. package/dist/assets/r-j7ic8hl3.js +1 -0
  65. package/dist/assets/razor-Bot1_B28.js +1 -0
  66. package/dist/assets/redis-Bu5POkcn.js +1 -0
  67. package/dist/assets/redshift-Bs9aos_-.js +1 -0
  68. package/dist/assets/restructuredtext-CqXO7rUv.js +1 -0
  69. package/dist/assets/ruby-zBfavPgS.js +1 -0
  70. package/dist/assets/rust-BzKRNQWT.js +1 -0
  71. package/dist/assets/sb-BBc9UKZt.js +1 -0
  72. package/dist/assets/scala-D9hQfWCl.js +1 -0
  73. package/dist/assets/scheme-BPhDTwHR.js +1 -0
  74. package/dist/assets/scss-CBJaRo0y.js +3 -0
  75. package/dist/assets/shell-DiJ1NA_G.js +1 -0
  76. package/dist/assets/solidity-Db0IVjzk.js +1 -0
  77. package/dist/assets/sophia-CnS9iZB_.js +1 -0
  78. package/dist/assets/sparql-CJmd_6j2.js +1 -0
  79. package/dist/assets/sql-ClhHkBeG.js +1 -0
  80. package/dist/assets/st-CHwy0fLd.js +1 -0
  81. package/dist/assets/swift-Bqt4WxQ4.js +3 -0
  82. package/dist/assets/systemverilog-Bs9z6M-B.js +1 -0
  83. package/dist/assets/tcl-Dm6ycUr_.js +1 -0
  84. package/dist/assets/twig-Csy3S7wG.js +1 -0
  85. package/dist/assets/typescript-DE6xU1su.js +1 -0
  86. package/dist/assets/typespec-Btyra-wh.js +1 -0
  87. package/dist/assets/vb-Db0cS2oM.js +1 -0
  88. package/dist/assets/wgsl-DumH7NcR.js +298 -0
  89. package/dist/assets/xml-dIt9VBCB.js +1 -0
  90. package/dist/assets/yaml-DRxDnajf.js +1 -0
  91. package/dist/index.html +2 -2
  92. package/package.json +5 -5
  93. package/dist/assets/index-B-6d1dTe.css +0 -1
  94. package/dist/assets/index-DylL4Hn2.js +0 -481
@@ -0,0 +1,669 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-if4BL-EX.js","assets/index-CXkKwxiP.css"])))=>i.map(i=>d[i]);
2
+ function PI(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&&!Array.isArray(r)){for(const i in r)if(i!=="default"&&!(i in e)){const a=Object.getOwnPropertyDescriptor(r,i);a&&Object.defineProperty(e,i,a.get?a:{enumerable:!0,get:()=>r[i]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const a of i)if(a.type==="childList")for(const l of a.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&r(l)}).observe(document,{childList:!0,subtree:!0});function n(i){const a={};return i.integrity&&(a.integrity=i.integrity),i.referrerPolicy&&(a.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?a.credentials="include":i.crossOrigin==="anonymous"?a.credentials="omit":a.credentials="same-origin",a}function r(i){if(i.ep)return;i.ep=!0;const a=n(i);fetch(i.href,a)}})();function tp(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var s0={exports:{}},Xu={};/**
3
+ * @license React
4
+ * react-jsx-runtime.production.js
5
+ *
6
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
7
+ *
8
+ * This source code is licensed under the MIT license found in the
9
+ * LICENSE file in the root directory of this source tree.
10
+ */var m2;function jI(){if(m2)return Xu;m2=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(r,i,a){var l=null;if(a!==void 0&&(l=""+a),i.key!==void 0&&(l=""+i.key),"key"in i){a={};for(var c in i)c!=="key"&&(a[c]=i[c])}else a=i;return i=a.ref,{$$typeof:e,type:r,key:l,ref:i!==void 0?i:null,props:a}}return Xu.Fragment=t,Xu.jsx=n,Xu.jsxs=n,Xu}var g2;function BI(){return g2||(g2=1,s0.exports=jI()),s0.exports}var m=BI(),i0={exports:{}},gt={};/**
11
+ * @license React
12
+ * react.production.js
13
+ *
14
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
15
+ *
16
+ * This source code is licensed under the MIT license found in the
17
+ * LICENSE file in the root directory of this source tree.
18
+ */var b2;function HI(){if(b2)return gt;b2=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),a=Symbol.for("react.consumer"),l=Symbol.for("react.context"),c=Symbol.for("react.forward_ref"),d=Symbol.for("react.suspense"),f=Symbol.for("react.memo"),g=Symbol.for("react.lazy"),h=Symbol.for("react.activity"),b=Symbol.iterator;function x(B){return B===null||typeof B!="object"?null:(B=b&&B[b]||B["@@iterator"],typeof B=="function"?B:null)}var v={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},w=Object.assign,k={};function C(B,G,P){this.props=B,this.context=G,this.refs=k,this.updater=P||v}C.prototype.isReactComponent={},C.prototype.setState=function(B,G){if(typeof B!="object"&&typeof B!="function"&&B!=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,B,G,"setState")},C.prototype.forceUpdate=function(B){this.updater.enqueueForceUpdate(this,B,"forceUpdate")};function N(){}N.prototype=C.prototype;function A(B,G,P){this.props=B,this.context=G,this.refs=k,this.updater=P||v}var R=A.prototype=new N;R.constructor=A,w(R,C.prototype),R.isPureReactComponent=!0;var M=Array.isArray;function _(){}var D={H:null,A:null,T:null,S:null},I=Object.prototype.hasOwnProperty;function U(B,G,P){var ae=P.ref;return{$$typeof:e,type:B,key:G,ref:ae!==void 0?ae:null,props:P}}function j(B,G){return U(B.type,G,B.props)}function X(B){return typeof B=="object"&&B!==null&&B.$$typeof===e}function K(B){var G={"=":"=0",":":"=2"};return"$"+B.replace(/[=:]/g,function(P){return G[P]})}var F=/\/+/g;function W(B,G){return typeof B=="object"&&B!==null&&B.key!=null?K(""+B.key):G.toString(36)}function V(B){switch(B.status){case"fulfilled":return B.value;case"rejected":throw B.reason;default:switch(typeof B.status=="string"?B.then(_,_):(B.status="pending",B.then(function(G){B.status==="pending"&&(B.status="fulfilled",B.value=G)},function(G){B.status==="pending"&&(B.status="rejected",B.reason=G)})),B.status){case"fulfilled":return B.value;case"rejected":throw B.reason}}throw B}function H(B,G,P,ae,ie){var ce=typeof B;(ce==="undefined"||ce==="boolean")&&(B=null);var de=!1;if(B===null)de=!0;else switch(ce){case"bigint":case"string":case"number":de=!0;break;case"object":switch(B.$$typeof){case e:case t:de=!0;break;case g:return de=B._init,H(de(B._payload),G,P,ae,ie)}}if(de)return ie=ie(B),de=ae===""?"."+W(B,0):ae,M(ie)?(P="",de!=null&&(P=de.replace(F,"$&/")+"/"),H(ie,G,P,"",function(Fe){return Fe})):ie!=null&&(X(ie)&&(ie=j(ie,P+(ie.key==null||B&&B.key===ie.key?"":(""+ie.key).replace(F,"$&/")+"/")+de)),G.push(ie)),1;de=0;var he=ae===""?".":ae+":";if(M(B))for(var ve=0;ve<B.length;ve++)ae=B[ve],ce=he+W(ae,ve),de+=H(ae,G,P,ce,ie);else if(ve=x(B),typeof ve=="function")for(B=ve.call(B),ve=0;!(ae=B.next()).done;)ae=ae.value,ce=he+W(ae,ve++),de+=H(ae,G,P,ce,ie);else if(ce==="object"){if(typeof B.then=="function")return H(V(B),G,P,ae,ie);throw G=String(B),Error("Objects are not valid as a React child (found: "+(G==="[object Object]"?"object with keys {"+Object.keys(B).join(", ")+"}":G)+"). If you meant to render a collection of children, use an array instead.")}return de}function q(B,G,P){if(B==null)return B;var ae=[],ie=0;return H(B,ae,"","",function(ce){return G.call(P,ce,ie++)}),ae}function J(B){if(B._status===-1){var G=B._result;G=G(),G.then(function(P){(B._status===0||B._status===-1)&&(B._status=1,B._result=P)},function(P){(B._status===0||B._status===-1)&&(B._status=2,B._result=P)}),B._status===-1&&(B._status=0,B._result=G)}if(B._status===1)return B._result.default;throw B._result}var ue=typeof reportError=="function"?reportError:function(B){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var G=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof B=="object"&&B!==null&&typeof B.message=="string"?String(B.message):String(B),error:B});if(!window.dispatchEvent(G))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",B);return}console.error(B)},L={map:q,forEach:function(B,G,P){q(B,function(){G.apply(this,arguments)},P)},count:function(B){var G=0;return q(B,function(){G++}),G},toArray:function(B){return q(B,function(G){return G})||[]},only:function(B){if(!X(B))throw Error("React.Children.only expected to receive a single React element child.");return B}};return gt.Activity=h,gt.Children=L,gt.Component=C,gt.Fragment=n,gt.Profiler=i,gt.PureComponent=A,gt.StrictMode=r,gt.Suspense=d,gt.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=D,gt.__COMPILER_RUNTIME={__proto__:null,c:function(B){return D.H.useMemoCache(B)}},gt.cache=function(B){return function(){return B.apply(null,arguments)}},gt.cacheSignal=function(){return null},gt.cloneElement=function(B,G,P){if(B==null)throw Error("The argument must be a React element, but you passed "+B+".");var ae=w({},B.props),ie=B.key;if(G!=null)for(ce in G.key!==void 0&&(ie=""+G.key),G)!I.call(G,ce)||ce==="key"||ce==="__self"||ce==="__source"||ce==="ref"&&G.ref===void 0||(ae[ce]=G[ce]);var ce=arguments.length-2;if(ce===1)ae.children=P;else if(1<ce){for(var de=Array(ce),he=0;he<ce;he++)de[he]=arguments[he+2];ae.children=de}return U(B.type,ie,ae)},gt.createContext=function(B){return B={$$typeof:l,_currentValue:B,_currentValue2:B,_threadCount:0,Provider:null,Consumer:null},B.Provider=B,B.Consumer={$$typeof:a,_context:B},B},gt.createElement=function(B,G,P){var ae,ie={},ce=null;if(G!=null)for(ae in G.key!==void 0&&(ce=""+G.key),G)I.call(G,ae)&&ae!=="key"&&ae!=="__self"&&ae!=="__source"&&(ie[ae]=G[ae]);var de=arguments.length-2;if(de===1)ie.children=P;else if(1<de){for(var he=Array(de),ve=0;ve<de;ve++)he[ve]=arguments[ve+2];ie.children=he}if(B&&B.defaultProps)for(ae in de=B.defaultProps,de)ie[ae]===void 0&&(ie[ae]=de[ae]);return U(B,ce,ie)},gt.createRef=function(){return{current:null}},gt.forwardRef=function(B){return{$$typeof:c,render:B}},gt.isValidElement=X,gt.lazy=function(B){return{$$typeof:g,_payload:{_status:-1,_result:B},_init:J}},gt.memo=function(B,G){return{$$typeof:f,type:B,compare:G===void 0?null:G}},gt.startTransition=function(B){var G=D.T,P={};D.T=P;try{var ae=B(),ie=D.S;ie!==null&&ie(P,ae),typeof ae=="object"&&ae!==null&&typeof ae.then=="function"&&ae.then(_,ue)}catch(ce){ue(ce)}finally{G!==null&&P.types!==null&&(G.types=P.types),D.T=G}},gt.unstable_useCacheRefresh=function(){return D.H.useCacheRefresh()},gt.use=function(B){return D.H.use(B)},gt.useActionState=function(B,G,P){return D.H.useActionState(B,G,P)},gt.useCallback=function(B,G){return D.H.useCallback(B,G)},gt.useContext=function(B){return D.H.useContext(B)},gt.useDebugValue=function(){},gt.useDeferredValue=function(B,G){return D.H.useDeferredValue(B,G)},gt.useEffect=function(B,G){return D.H.useEffect(B,G)},gt.useEffectEvent=function(B){return D.H.useEffectEvent(B)},gt.useId=function(){return D.H.useId()},gt.useImperativeHandle=function(B,G,P){return D.H.useImperativeHandle(B,G,P)},gt.useInsertionEffect=function(B,G){return D.H.useInsertionEffect(B,G)},gt.useLayoutEffect=function(B,G){return D.H.useLayoutEffect(B,G)},gt.useMemo=function(B,G){return D.H.useMemo(B,G)},gt.useOptimistic=function(B,G){return D.H.useOptimistic(B,G)},gt.useReducer=function(B,G,P){return D.H.useReducer(B,G,P)},gt.useRef=function(B){return D.H.useRef(B)},gt.useState=function(B){return D.H.useState(B)},gt.useSyncExternalStore=function(B,G,P){return D.H.useSyncExternalStore(B,G,P)},gt.useTransition=function(){return D.H.useTransition()},gt.version="19.2.7",gt}var x2;function Qc(){return x2||(x2=1,i0.exports=HI()),i0.exports}var E=Qc();const ze=tp(E),UI=PI({__proto__:null,default:ze},[E]);var a0={exports:{}},Ku={},o0={exports:{}},l0={};/**
19
+ * @license React
20
+ * scheduler.production.js
21
+ *
22
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
23
+ *
24
+ * This source code is licensed under the MIT license found in the
25
+ * LICENSE file in the root directory of this source tree.
26
+ */var y2;function zI(){return y2||(y2=1,(function(e){function t(H,q){var J=H.length;H.push(q);e:for(;0<J;){var ue=J-1>>>1,L=H[ue];if(0<i(L,q))H[ue]=q,H[J]=L,J=ue;else break e}}function n(H){return H.length===0?null:H[0]}function r(H){if(H.length===0)return null;var q=H[0],J=H.pop();if(J!==q){H[0]=J;e:for(var ue=0,L=H.length,B=L>>>1;ue<B;){var G=2*(ue+1)-1,P=H[G],ae=G+1,ie=H[ae];if(0>i(P,J))ae<L&&0>i(ie,P)?(H[ue]=ie,H[ae]=J,ue=ae):(H[ue]=P,H[G]=J,ue=G);else if(ae<L&&0>i(ie,J))H[ue]=ie,H[ae]=J,ue=ae;else break e}}return q}function i(H,q){var J=H.sortIndex-q.sortIndex;return J!==0?J:H.id-q.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var a=performance;e.unstable_now=function(){return a.now()}}else{var l=Date,c=l.now();e.unstable_now=function(){return l.now()-c}}var d=[],f=[],g=1,h=null,b=3,x=!1,v=!1,w=!1,k=!1,C=typeof setTimeout=="function"?setTimeout:null,N=typeof clearTimeout=="function"?clearTimeout:null,A=typeof setImmediate<"u"?setImmediate:null;function R(H){for(var q=n(f);q!==null;){if(q.callback===null)r(f);else if(q.startTime<=H)r(f),q.sortIndex=q.expirationTime,t(d,q);else break;q=n(f)}}function M(H){if(w=!1,R(H),!v)if(n(d)!==null)v=!0,_||(_=!0,K());else{var q=n(f);q!==null&&V(M,q.startTime-H)}}var _=!1,D=-1,I=5,U=-1;function j(){return k?!0:!(e.unstable_now()-U<I)}function X(){if(k=!1,_){var H=e.unstable_now();U=H;var q=!0;try{e:{v=!1,w&&(w=!1,N(D),D=-1),x=!0;var J=b;try{t:{for(R(H),h=n(d);h!==null&&!(h.expirationTime>H&&j());){var ue=h.callback;if(typeof ue=="function"){h.callback=null,b=h.priorityLevel;var L=ue(h.expirationTime<=H);if(H=e.unstable_now(),typeof L=="function"){h.callback=L,R(H),q=!0;break t}h===n(d)&&r(d),R(H)}else r(d);h=n(d)}if(h!==null)q=!0;else{var B=n(f);B!==null&&V(M,B.startTime-H),q=!1}}break e}finally{h=null,b=J,x=!1}q=void 0}}finally{q?K():_=!1}}}var K;if(typeof A=="function")K=function(){A(X)};else if(typeof MessageChannel<"u"){var F=new MessageChannel,W=F.port2;F.port1.onmessage=X,K=function(){W.postMessage(null)}}else K=function(){C(X,0)};function V(H,q){D=C(function(){H(e.unstable_now())},q)}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"):I=0<H?Math.floor(1e3/H):5},e.unstable_getCurrentPriorityLevel=function(){return b},e.unstable_next=function(H){switch(b){case 1:case 2:case 3:var q=3;break;default:q=b}var J=b;b=q;try{return H()}finally{b=J}},e.unstable_requestPaint=function(){k=!0},e.unstable_runWithPriority=function(H,q){switch(H){case 1:case 2:case 3:case 4:case 5:break;default:H=3}var J=b;b=H;try{return q()}finally{b=J}},e.unstable_scheduleCallback=function(H,q,J){var ue=e.unstable_now();switch(typeof J=="object"&&J!==null?(J=J.delay,J=typeof J=="number"&&0<J?ue+J:ue):J=ue,H){case 1:var L=-1;break;case 2:L=250;break;case 5:L=1073741823;break;case 4:L=1e4;break;default:L=5e3}return L=J+L,H={id:g++,callback:q,priorityLevel:H,startTime:J,expirationTime:L,sortIndex:-1},J>ue?(H.sortIndex=J,t(f,H),n(d)===null&&H===n(f)&&(w?(N(D),D=-1):w=!0,V(M,J-ue))):(H.sortIndex=L,t(d,H),v||x||(v=!0,_||(_=!0,K()))),H},e.unstable_shouldYield=j,e.unstable_wrapCallback=function(H){var q=b;return function(){var J=b;b=q;try{return H.apply(this,arguments)}finally{b=J}}}})(l0)),l0}var E2;function FI(){return E2||(E2=1,o0.exports=zI()),o0.exports}var u0={exports:{}},rr={};/**
27
+ * @license React
28
+ * react-dom.production.js
29
+ *
30
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
31
+ *
32
+ * This source code is licensed under the MIT license found in the
33
+ * LICENSE file in the root directory of this source tree.
34
+ */var v2;function $I(){if(v2)return rr;v2=1;var e=Qc();function t(d){var f="https://react.dev/errors/"+d;if(1<arguments.length){f+="?args[]="+encodeURIComponent(arguments[1]);for(var g=2;g<arguments.length;g++)f+="&args[]="+encodeURIComponent(arguments[g])}return"Minified React error #"+d+"; visit "+f+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function n(){}var r={d:{f:n,r:function(){throw Error(t(522))},D:n,C:n,L:n,m:n,X:n,S:n,M:n},p:0,findDOMNode:null},i=Symbol.for("react.portal");function a(d,f,g){var h=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:i,key:h==null?null:""+h,children:d,containerInfo:f,implementation:g}}var l=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function c(d,f){if(d==="font")return"";if(typeof f=="string")return f==="use-credentials"?f:""}return rr.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=r,rr.createPortal=function(d,f){var g=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!f||f.nodeType!==1&&f.nodeType!==9&&f.nodeType!==11)throw Error(t(299));return a(d,f,null,g)},rr.flushSync=function(d){var f=l.T,g=r.p;try{if(l.T=null,r.p=2,d)return d()}finally{l.T=f,r.p=g,r.d.f()}},rr.preconnect=function(d,f){typeof d=="string"&&(f?(f=f.crossOrigin,f=typeof f=="string"?f==="use-credentials"?f:"":void 0):f=null,r.d.C(d,f))},rr.prefetchDNS=function(d){typeof d=="string"&&r.d.D(d)},rr.preinit=function(d,f){if(typeof d=="string"&&f&&typeof f.as=="string"){var g=f.as,h=c(g,f.crossOrigin),b=typeof f.integrity=="string"?f.integrity:void 0,x=typeof f.fetchPriority=="string"?f.fetchPriority:void 0;g==="style"?r.d.S(d,typeof f.precedence=="string"?f.precedence:void 0,{crossOrigin:h,integrity:b,fetchPriority:x}):g==="script"&&r.d.X(d,{crossOrigin:h,integrity:b,fetchPriority:x,nonce:typeof f.nonce=="string"?f.nonce:void 0})}},rr.preinitModule=function(d,f){if(typeof d=="string")if(typeof f=="object"&&f!==null){if(f.as==null||f.as==="script"){var g=c(f.as,f.crossOrigin);r.d.M(d,{crossOrigin:g,integrity:typeof f.integrity=="string"?f.integrity:void 0,nonce:typeof f.nonce=="string"?f.nonce:void 0})}}else f==null&&r.d.M(d)},rr.preload=function(d,f){if(typeof d=="string"&&typeof f=="object"&&f!==null&&typeof f.as=="string"){var g=f.as,h=c(g,f.crossOrigin);r.d.L(d,g,{crossOrigin:h,integrity:typeof f.integrity=="string"?f.integrity:void 0,nonce:typeof f.nonce=="string"?f.nonce:void 0,type:typeof f.type=="string"?f.type:void 0,fetchPriority:typeof f.fetchPriority=="string"?f.fetchPriority:void 0,referrerPolicy:typeof f.referrerPolicy=="string"?f.referrerPolicy:void 0,imageSrcSet:typeof f.imageSrcSet=="string"?f.imageSrcSet:void 0,imageSizes:typeof f.imageSizes=="string"?f.imageSizes:void 0,media:typeof f.media=="string"?f.media:void 0})}},rr.preloadModule=function(d,f){if(typeof d=="string")if(f){var g=c(f.as,f.crossOrigin);r.d.m(d,{as:typeof f.as=="string"&&f.as!=="script"?f.as:void 0,crossOrigin:g,integrity:typeof f.integrity=="string"?f.integrity:void 0})}else r.d.m(d)},rr.requestFormReset=function(d){r.d.r(d)},rr.unstable_batchedUpdates=function(d,f){return d(f)},rr.useFormState=function(d,f,g){return l.H.useFormState(d,f,g)},rr.useFormStatus=function(){return l.H.useHostTransitionStatus()},rr.version="19.2.7",rr}var T2;function Cw(){if(T2)return u0.exports;T2=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(t){console.error(t)}}return e(),u0.exports=$I(),u0.exports}/**
35
+ * @license React
36
+ * react-dom-client.production.js
37
+ *
38
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
39
+ *
40
+ * This source code is licensed under the MIT license found in the
41
+ * LICENSE file in the root directory of this source tree.
42
+ */var S2;function VI(){if(S2)return Ku;S2=1;var e=FI(),t=Qc(),n=Cw();function r(s){var o="https://react.dev/errors/"+s;if(1<arguments.length){o+="?args[]="+encodeURIComponent(arguments[1]);for(var u=2;u<arguments.length;u++)o+="&args[]="+encodeURIComponent(arguments[u])}return"Minified React error #"+s+"; visit "+o+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function i(s){return!(!s||s.nodeType!==1&&s.nodeType!==9&&s.nodeType!==11)}function a(s){var o=s,u=s;if(s.alternate)for(;o.return;)o=o.return;else{s=o;do o=s,(o.flags&4098)!==0&&(u=o.return),s=o.return;while(s)}return o.tag===3?u:null}function l(s){if(s.tag===13){var o=s.memoizedState;if(o===null&&(s=s.alternate,s!==null&&(o=s.memoizedState)),o!==null)return o.dehydrated}return null}function c(s){if(s.tag===31){var o=s.memoizedState;if(o===null&&(s=s.alternate,s!==null&&(o=s.memoizedState)),o!==null)return o.dehydrated}return null}function d(s){if(a(s)!==s)throw Error(r(188))}function f(s){var o=s.alternate;if(!o){if(o=a(s),o===null)throw Error(r(188));return o!==s?null:s}for(var u=s,p=o;;){var y=u.return;if(y===null)break;var T=y.alternate;if(T===null){if(p=y.return,p!==null){u=p;continue}break}if(y.child===T.child){for(T=y.child;T;){if(T===u)return d(y),s;if(T===p)return d(y),o;T=T.sibling}throw Error(r(188))}if(u.return!==p.return)u=y,p=T;else{for(var O=!1,z=y.child;z;){if(z===u){O=!0,u=y,p=T;break}if(z===p){O=!0,p=y,u=T;break}z=z.sibling}if(!O){for(z=T.child;z;){if(z===u){O=!0,u=T,p=y;break}if(z===p){O=!0,p=T,u=y;break}z=z.sibling}if(!O)throw Error(r(189))}}if(u.alternate!==p)throw Error(r(190))}if(u.tag!==3)throw Error(r(188));return u.stateNode.current===u?s:o}function g(s){var o=s.tag;if(o===5||o===26||o===27||o===6)return s;for(s=s.child;s!==null;){if(o=g(s),o!==null)return o;s=s.sibling}return null}var h=Object.assign,b=Symbol.for("react.element"),x=Symbol.for("react.transitional.element"),v=Symbol.for("react.portal"),w=Symbol.for("react.fragment"),k=Symbol.for("react.strict_mode"),C=Symbol.for("react.profiler"),N=Symbol.for("react.consumer"),A=Symbol.for("react.context"),R=Symbol.for("react.forward_ref"),M=Symbol.for("react.suspense"),_=Symbol.for("react.suspense_list"),D=Symbol.for("react.memo"),I=Symbol.for("react.lazy"),U=Symbol.for("react.activity"),j=Symbol.for("react.memo_cache_sentinel"),X=Symbol.iterator;function K(s){return s===null||typeof s!="object"?null:(s=X&&s[X]||s["@@iterator"],typeof s=="function"?s:null)}var F=Symbol.for("react.client.reference");function W(s){if(s==null)return null;if(typeof s=="function")return s.$$typeof===F?null:s.displayName||s.name||null;if(typeof s=="string")return s;switch(s){case w:return"Fragment";case C:return"Profiler";case k:return"StrictMode";case M:return"Suspense";case _:return"SuspenseList";case U:return"Activity"}if(typeof s=="object")switch(s.$$typeof){case v:return"Portal";case A:return s.displayName||"Context";case N:return(s._context.displayName||"Context")+".Consumer";case R:var o=s.render;return s=s.displayName,s||(s=o.displayName||o.name||"",s=s!==""?"ForwardRef("+s+")":"ForwardRef"),s;case D:return o=s.displayName||null,o!==null?o:W(s.type)||"Memo";case I:o=s._payload,s=s._init;try{return W(s(o))}catch{}}return null}var V=Array.isArray,H=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,q=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,J={pending:!1,data:null,method:null,action:null},ue=[],L=-1;function B(s){return{current:s}}function G(s){0>L||(s.current=ue[L],ue[L]=null,L--)}function P(s,o){L++,ue[L]=s.current,s.current=o}var ae=B(null),ie=B(null),ce=B(null),de=B(null);function he(s,o){switch(P(ce,o),P(ie,s),P(ae,null),o.nodeType){case 9:case 11:s=(s=o.documentElement)&&(s=s.namespaceURI)?BT(s):0;break;default:if(s=o.tagName,o=o.namespaceURI)o=BT(o),s=HT(o,s);else switch(s){case"svg":s=1;break;case"math":s=2;break;default:s=0}}G(ae),P(ae,s)}function ve(){G(ae),G(ie),G(ce)}function Fe(s){s.memoizedState!==null&&P(de,s);var o=ae.current,u=HT(o,s.type);o!==u&&(P(ie,s),P(ae,u))}function Le(s){ie.current===s&&(G(ae),G(ie)),de.current===s&&(G(de),Vu._currentValue=J)}var Ee,Oe;function Ue(s){if(Ee===void 0)try{throw Error()}catch(u){var o=u.stack.trim().match(/\n( *(at )?)/);Ee=o&&o[1]||"",Oe=-1<u.stack.indexOf(`
43
+ at`)?" (<anonymous>)":-1<u.stack.indexOf("@")?"@unknown:0:0":""}return`
44
+ `+Ee+s+Oe}var Xe=!1;function qe(s,o){if(!s||Xe)return"";Xe=!0;var u=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var p={DetermineComponentFrameRoot:function(){try{if(o){var Ae=function(){throw Error()};if(Object.defineProperty(Ae.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(Ae,[])}catch(Te){var xe=Te}Reflect.construct(s,[],Ae)}else{try{Ae.call()}catch(Te){xe=Te}s.call(Ae.prototype)}}else{try{throw Error()}catch(Te){xe=Te}(Ae=s())&&typeof Ae.catch=="function"&&Ae.catch(function(){})}}catch(Te){if(Te&&xe&&typeof Te.stack=="string")return[Te.stack,xe.stack]}return[null,null]}};p.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var y=Object.getOwnPropertyDescriptor(p.DetermineComponentFrameRoot,"name");y&&y.configurable&&Object.defineProperty(p.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var T=p.DetermineComponentFrameRoot(),O=T[0],z=T[1];if(O&&z){var ne=O.split(`
45
+ `),be=z.split(`
46
+ `);for(y=p=0;p<ne.length&&!ne[p].includes("DetermineComponentFrameRoot");)p++;for(;y<be.length&&!be[y].includes("DetermineComponentFrameRoot");)y++;if(p===ne.length||y===be.length)for(p=ne.length-1,y=be.length-1;1<=p&&0<=y&&ne[p]!==be[y];)y--;for(;1<=p&&0<=y;p--,y--)if(ne[p]!==be[y]){if(p!==1||y!==1)do if(p--,y--,0>y||ne[p]!==be[y]){var we=`
47
+ `+ne[p].replace(" at new "," at ");return s.displayName&&we.includes("<anonymous>")&&(we=we.replace("<anonymous>",s.displayName)),we}while(1<=p&&0<=y);break}}}finally{Xe=!1,Error.prepareStackTrace=u}return(u=s?s.displayName||s.name:"")?Ue(u):""}function De(s,o){switch(s.tag){case 26:case 27:case 5:return Ue(s.type);case 16:return Ue("Lazy");case 13:return s.child!==o&&o!==null?Ue("Suspense Fallback"):Ue("Suspense");case 19:return Ue("SuspenseList");case 0:case 15:return qe(s.type,!1);case 11:return qe(s.type.render,!1);case 1:return qe(s.type,!0);case 31:return Ue("Activity");default:return""}}function ke(s){try{var o="",u=null;do o+=De(s,u),u=s,s=s.return;while(s);return o}catch(p){return`
48
+ Error generating stack: `+p.message+`
49
+ `+p.stack}}var ye=Object.prototype.hasOwnProperty,Re=e.unstable_scheduleCallback,Pe=e.unstable_cancelCallback,ee=e.unstable_shouldYield,pe=e.unstable_requestPaint,se=e.unstable_now,re=e.unstable_getCurrentPriorityLevel,Q=e.unstable_ImmediatePriority,$=e.unstable_UserBlockingPriority,oe=e.unstable_NormalPriority,Se=e.unstable_LowPriority,_e=e.unstable_IdlePriority,$e=e.log,ot=e.unstable_setDisableYieldValue,et=null,dt=null;function ut(s){if(typeof $e=="function"&&ot(s),dt&&typeof dt.setStrictMode=="function")try{dt.setStrictMode(et,s)}catch{}}var Ve=Math.clz32?Math.clz32:lt,Rt=Math.log,Pt=Math.LN2;function lt(s){return s>>>=0,s===0?32:31-(Rt(s)/Pt|0)|0}var Lt=256,Wt=262144,$t=4194304;function Zt(s){var o=s&42;if(o!==0)return o;switch(s&-s){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 s&261888;case 262144:case 524288:case 1048576:case 2097152:return s&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return s&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return s}}function Ke(s,o,u){var p=s.pendingLanes;if(p===0)return 0;var y=0,T=s.suspendedLanes,O=s.pingedLanes;s=s.warmLanes;var z=p&134217727;return z!==0?(p=z&~T,p!==0?y=Zt(p):(O&=z,O!==0?y=Zt(O):u||(u=z&~s,u!==0&&(y=Zt(u))))):(z=p&~T,z!==0?y=Zt(z):O!==0?y=Zt(O):u||(u=p&~s,u!==0&&(y=Zt(u)))),y===0?0:o!==0&&o!==y&&(o&T)===0&&(T=y&-y,u=o&-o,T>=u||T===32&&(u&4194048)!==0)?o:y}function yt(s,o){return(s.pendingLanes&~(s.suspendedLanes&~s.pingedLanes)&o)===0}function zt(s,o){switch(s){case 1:case 2:case 4:case 8:case 64:return o+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 o+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 Jt(){var s=$t;return $t<<=1,($t&62914560)===0&&($t=4194304),s}function Xn(s){for(var o=[],u=0;31>u;u++)o.push(s);return o}function Et(s,o){s.pendingLanes|=o,o!==268435456&&(s.suspendedLanes=0,s.pingedLanes=0,s.warmLanes=0)}function an(s,o,u,p,y,T){var O=s.pendingLanes;s.pendingLanes=u,s.suspendedLanes=0,s.pingedLanes=0,s.warmLanes=0,s.expiredLanes&=u,s.entangledLanes&=u,s.errorRecoveryDisabledLanes&=u,s.shellSuspendCounter=0;var z=s.entanglements,ne=s.expirationTimes,be=s.hiddenUpdates;for(u=O&~u;0<u;){var we=31-Ve(u),Ae=1<<we;z[we]=0,ne[we]=-1;var xe=be[we];if(xe!==null)for(be[we]=null,we=0;we<xe.length;we++){var Te=xe[we];Te!==null&&(Te.lane&=-536870913)}u&=~Ae}p!==0&&Er(s,p,0),T!==0&&y===0&&s.tag!==0&&(s.suspendedLanes|=T&~(O&~o))}function Er(s,o,u){s.pendingLanes|=o,s.suspendedLanes&=~o;var p=31-Ve(o);s.entangledLanes|=o,s.entanglements[p]=s.entanglements[p]|1073741824|u&261930}function mn(s,o){var u=s.entangledLanes|=o;for(s=s.entanglements;u;){var p=31-Ve(u),y=1<<p;y&o|s[p]&o&&(s[p]|=o),u&=~y}}function Tn(s,o){var u=o&-o;return u=(u&42)!==0?1:ht(u),(u&(s.suspendedLanes|o))!==0?0:u}function ht(s){switch(s){case 2:s=1;break;case 8:s=4;break;case 32:s=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:s=128;break;case 268435456:s=134217728;break;default:s=0}return s}function Ot(s){return s&=-s,2<s?8<s?(s&134217727)!==0?32:268435456:8:2}function bn(){var s=q.p;return s!==0?s:(s=window.event,s===void 0?32:l2(s.type))}function Un(s,o){var u=q.p;try{return q.p=s,o()}finally{q.p=u}}var Dn=Math.random().toString(36).slice(2),en="__reactFiber$"+Dn,Kn="__reactProps$"+Dn,bs="__reactContainer$"+Dn,su="__reactEvents$"+Dn,fd="__reactListeners$"+Dn,w6="__reactHandles$"+Dn,ky="__reactResources$"+Dn,iu="__reactMarker$"+Dn;function Qp(s){delete s[en],delete s[Kn],delete s[su],delete s[fd],delete s[w6]}function _o(s){var o=s[en];if(o)return o;for(var u=s.parentNode;u;){if(o=u[bs]||u[en]){if(u=o.alternate,o.child!==null||u!==null&&u.child!==null)for(s=YT(s);s!==null;){if(u=s[en])return u;s=YT(s)}return o}s=u,u=s.parentNode}return null}function Ro(s){if(s=s[en]||s[bs]){var o=s.tag;if(o===5||o===6||o===13||o===31||o===26||o===27||o===3)return s}return null}function au(s){var o=s.tag;if(o===5||o===26||o===27||o===6)return s.stateNode;throw Error(r(33))}function Oo(s){var o=s[ky];return o||(o=s[ky]={hoistableStyles:new Map,hoistableScripts:new Map}),o}function zn(s){s[iu]=!0}var wy=new Set,Ny={};function ya(s,o){Io(s,o),Io(s+"Capture",o)}function Io(s,o){for(Ny[s]=o,s=0;s<o.length;s++)wy.add(o[s])}var N6=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]*$"),Ay={},_y={};function A6(s){return ye.call(_y,s)?!0:ye.call(Ay,s)?!1:N6.test(s)?_y[s]=!0:(Ay[s]=!0,!1)}function hd(s,o,u){if(A6(o))if(u===null)s.removeAttribute(o);else{switch(typeof u){case"undefined":case"function":case"symbol":s.removeAttribute(o);return;case"boolean":var p=o.toLowerCase().slice(0,5);if(p!=="data-"&&p!=="aria-"){s.removeAttribute(o);return}}s.setAttribute(o,""+u)}}function pd(s,o,u){if(u===null)s.removeAttribute(o);else{switch(typeof u){case"undefined":case"function":case"symbol":case"boolean":s.removeAttribute(o);return}s.setAttribute(o,""+u)}}function Hs(s,o,u,p){if(p===null)s.removeAttribute(u);else{switch(typeof p){case"undefined":case"function":case"symbol":case"boolean":s.removeAttribute(u);return}s.setAttributeNS(o,u,""+p)}}function Gr(s){switch(typeof s){case"bigint":case"boolean":case"number":case"string":case"undefined":return s;case"object":return s;default:return""}}function Ry(s){var o=s.type;return(s=s.nodeName)&&s.toLowerCase()==="input"&&(o==="checkbox"||o==="radio")}function _6(s,o,u){var p=Object.getOwnPropertyDescriptor(s.constructor.prototype,o);if(!s.hasOwnProperty(o)&&typeof p<"u"&&typeof p.get=="function"&&typeof p.set=="function"){var y=p.get,T=p.set;return Object.defineProperty(s,o,{configurable:!0,get:function(){return y.call(this)},set:function(O){u=""+O,T.call(this,O)}}),Object.defineProperty(s,o,{enumerable:p.enumerable}),{getValue:function(){return u},setValue:function(O){u=""+O},stopTracking:function(){s._valueTracker=null,delete s[o]}}}}function Wp(s){if(!s._valueTracker){var o=Ry(s)?"checked":"value";s._valueTracker=_6(s,o,""+s[o])}}function Oy(s){if(!s)return!1;var o=s._valueTracker;if(!o)return!0;var u=o.getValue(),p="";return s&&(p=Ry(s)?s.checked?"true":"false":s.value),s=p,s!==u?(o.setValue(s),!0):!1}function md(s){if(s=s||(typeof document<"u"?document:void 0),typeof s>"u")return null;try{return s.activeElement||s.body}catch{return s.body}}var R6=/[\n"\\]/g;function Xr(s){return s.replace(R6,function(o){return"\\"+o.charCodeAt(0).toString(16)+" "})}function Zp(s,o,u,p,y,T,O,z){s.name="",O!=null&&typeof O!="function"&&typeof O!="symbol"&&typeof O!="boolean"?s.type=O:s.removeAttribute("type"),o!=null?O==="number"?(o===0&&s.value===""||s.value!=o)&&(s.value=""+Gr(o)):s.value!==""+Gr(o)&&(s.value=""+Gr(o)):O!=="submit"&&O!=="reset"||s.removeAttribute("value"),o!=null?Jp(s,O,Gr(o)):u!=null?Jp(s,O,Gr(u)):p!=null&&s.removeAttribute("value"),y==null&&T!=null&&(s.defaultChecked=!!T),y!=null&&(s.checked=y&&typeof y!="function"&&typeof y!="symbol"),z!=null&&typeof z!="function"&&typeof z!="symbol"&&typeof z!="boolean"?s.name=""+Gr(z):s.removeAttribute("name")}function Iy(s,o,u,p,y,T,O,z){if(T!=null&&typeof T!="function"&&typeof T!="symbol"&&typeof T!="boolean"&&(s.type=T),o!=null||u!=null){if(!(T!=="submit"&&T!=="reset"||o!=null)){Wp(s);return}u=u!=null?""+Gr(u):"",o=o!=null?""+Gr(o):u,z||o===s.value||(s.value=o),s.defaultValue=o}p=p??y,p=typeof p!="function"&&typeof p!="symbol"&&!!p,s.checked=z?s.checked:!!p,s.defaultChecked=!!p,O!=null&&typeof O!="function"&&typeof O!="symbol"&&typeof O!="boolean"&&(s.name=O),Wp(s)}function Jp(s,o,u){o==="number"&&md(s.ownerDocument)===s||s.defaultValue===""+u||(s.defaultValue=""+u)}function Mo(s,o,u,p){if(s=s.options,o){o={};for(var y=0;y<u.length;y++)o["$"+u[y]]=!0;for(u=0;u<s.length;u++)y=o.hasOwnProperty("$"+s[u].value),s[u].selected!==y&&(s[u].selected=y),y&&p&&(s[u].defaultSelected=!0)}else{for(u=""+Gr(u),o=null,y=0;y<s.length;y++){if(s[y].value===u){s[y].selected=!0,p&&(s[y].defaultSelected=!0);return}o!==null||s[y].disabled||(o=s[y])}o!==null&&(o.selected=!0)}}function My(s,o,u){if(o!=null&&(o=""+Gr(o),o!==s.value&&(s.value=o),u==null)){s.defaultValue!==o&&(s.defaultValue=o);return}s.defaultValue=u!=null?""+Gr(u):""}function Ly(s,o,u,p){if(o==null){if(p!=null){if(u!=null)throw Error(r(92));if(V(p)){if(1<p.length)throw Error(r(93));p=p[0]}u=p}u==null&&(u=""),o=u}u=Gr(o),s.defaultValue=u,p=s.textContent,p===u&&p!==""&&p!==null&&(s.value=p),Wp(s)}function Lo(s,o){if(o){var u=s.firstChild;if(u&&u===s.lastChild&&u.nodeType===3){u.nodeValue=o;return}}s.textContent=o}var O6=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 Dy(s,o,u){var p=o.indexOf("--")===0;u==null||typeof u=="boolean"||u===""?p?s.setProperty(o,""):o==="float"?s.cssFloat="":s[o]="":p?s.setProperty(o,u):typeof u!="number"||u===0||O6.has(o)?o==="float"?s.cssFloat=u:s[o]=(""+u).trim():s[o]=u+"px"}function Py(s,o,u){if(o!=null&&typeof o!="object")throw Error(r(62));if(s=s.style,u!=null){for(var p in u)!u.hasOwnProperty(p)||o!=null&&o.hasOwnProperty(p)||(p.indexOf("--")===0?s.setProperty(p,""):p==="float"?s.cssFloat="":s[p]="");for(var y in o)p=o[y],o.hasOwnProperty(y)&&u[y]!==p&&Dy(s,y,p)}else for(var T in o)o.hasOwnProperty(T)&&Dy(s,T,o[T])}function em(s){if(s.indexOf("-")===-1)return!1;switch(s){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 I6=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"]]),M6=/^[\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 gd(s){return M6.test(""+s)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":s}function Us(){}var tm=null;function nm(s){return s=s.target||s.srcElement||window,s.correspondingUseElement&&(s=s.correspondingUseElement),s.nodeType===3?s.parentNode:s}var Do=null,Po=null;function jy(s){var o=Ro(s);if(o&&(s=o.stateNode)){var u=s[Kn]||null;e:switch(s=o.stateNode,o.type){case"input":if(Zp(s,u.value,u.defaultValue,u.defaultValue,u.checked,u.defaultChecked,u.type,u.name),o=u.name,u.type==="radio"&&o!=null){for(u=s;u.parentNode;)u=u.parentNode;for(u=u.querySelectorAll('input[name="'+Xr(""+o)+'"][type="radio"]'),o=0;o<u.length;o++){var p=u[o];if(p!==s&&p.form===s.form){var y=p[Kn]||null;if(!y)throw Error(r(90));Zp(p,y.value,y.defaultValue,y.defaultValue,y.checked,y.defaultChecked,y.type,y.name)}}for(o=0;o<u.length;o++)p=u[o],p.form===s.form&&Oy(p)}break e;case"textarea":My(s,u.value,u.defaultValue);break e;case"select":o=u.value,o!=null&&Mo(s,!!u.multiple,o,!1)}}}var rm=!1;function By(s,o,u){if(rm)return s(o,u);rm=!0;try{var p=s(o);return p}finally{if(rm=!1,(Do!==null||Po!==null)&&(rf(),Do&&(o=Do,s=Po,Po=Do=null,jy(o),s)))for(o=0;o<s.length;o++)jy(s[o])}}function ou(s,o){var u=s.stateNode;if(u===null)return null;var p=u[Kn]||null;if(p===null)return null;u=p[o];e:switch(o){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(p=!p.disabled)||(s=s.type,p=!(s==="button"||s==="input"||s==="select"||s==="textarea")),s=!p;break e;default:s=!1}if(s)return null;if(u&&typeof u!="function")throw Error(r(231,o,typeof u));return u}var zs=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),sm=!1;if(zs)try{var lu={};Object.defineProperty(lu,"passive",{get:function(){sm=!0}}),window.addEventListener("test",lu,lu),window.removeEventListener("test",lu,lu)}catch{sm=!1}var Ei=null,im=null,bd=null;function Hy(){if(bd)return bd;var s,o=im,u=o.length,p,y="value"in Ei?Ei.value:Ei.textContent,T=y.length;for(s=0;s<u&&o[s]===y[s];s++);var O=u-s;for(p=1;p<=O&&o[u-p]===y[T-p];p++);return bd=y.slice(s,1<p?1-p:void 0)}function xd(s){var o=s.keyCode;return"charCode"in s?(s=s.charCode,s===0&&o===13&&(s=13)):s=o,s===10&&(s=13),32<=s||s===13?s:0}function yd(){return!0}function Uy(){return!1}function vr(s){function o(u,p,y,T,O){this._reactName=u,this._targetInst=y,this.type=p,this.nativeEvent=T,this.target=O,this.currentTarget=null;for(var z in s)s.hasOwnProperty(z)&&(u=s[z],this[z]=u?u(T):T[z]);return this.isDefaultPrevented=(T.defaultPrevented!=null?T.defaultPrevented:T.returnValue===!1)?yd:Uy,this.isPropagationStopped=Uy,this}return h(o.prototype,{preventDefault:function(){this.defaultPrevented=!0;var u=this.nativeEvent;u&&(u.preventDefault?u.preventDefault():typeof u.returnValue!="unknown"&&(u.returnValue=!1),this.isDefaultPrevented=yd)},stopPropagation:function(){var u=this.nativeEvent;u&&(u.stopPropagation?u.stopPropagation():typeof u.cancelBubble!="unknown"&&(u.cancelBubble=!0),this.isPropagationStopped=yd)},persist:function(){},isPersistent:yd}),o}var Ea={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(s){return s.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Ed=vr(Ea),uu=h({},Ea,{view:0,detail:0}),L6=vr(uu),am,om,cu,vd=h({},uu,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:um,button:0,buttons:0,relatedTarget:function(s){return s.relatedTarget===void 0?s.fromElement===s.srcElement?s.toElement:s.fromElement:s.relatedTarget},movementX:function(s){return"movementX"in s?s.movementX:(s!==cu&&(cu&&s.type==="mousemove"?(am=s.screenX-cu.screenX,om=s.screenY-cu.screenY):om=am=0,cu=s),am)},movementY:function(s){return"movementY"in s?s.movementY:om}}),zy=vr(vd),D6=h({},vd,{dataTransfer:0}),P6=vr(D6),j6=h({},uu,{relatedTarget:0}),lm=vr(j6),B6=h({},Ea,{animationName:0,elapsedTime:0,pseudoElement:0}),H6=vr(B6),U6=h({},Ea,{clipboardData:function(s){return"clipboardData"in s?s.clipboardData:window.clipboardData}}),z6=vr(U6),F6=h({},Ea,{data:0}),Fy=vr(F6),$6={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},V6={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"},q6={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Y6(s){var o=this.nativeEvent;return o.getModifierState?o.getModifierState(s):(s=q6[s])?!!o[s]:!1}function um(){return Y6}var G6=h({},uu,{key:function(s){if(s.key){var o=$6[s.key]||s.key;if(o!=="Unidentified")return o}return s.type==="keypress"?(s=xd(s),s===13?"Enter":String.fromCharCode(s)):s.type==="keydown"||s.type==="keyup"?V6[s.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:um,charCode:function(s){return s.type==="keypress"?xd(s):0},keyCode:function(s){return s.type==="keydown"||s.type==="keyup"?s.keyCode:0},which:function(s){return s.type==="keypress"?xd(s):s.type==="keydown"||s.type==="keyup"?s.keyCode:0}}),X6=vr(G6),K6=h({},vd,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),$y=vr(K6),Q6=h({},uu,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:um}),W6=vr(Q6),Z6=h({},Ea,{propertyName:0,elapsedTime:0,pseudoElement:0}),J6=vr(Z6),eO=h({},vd,{deltaX:function(s){return"deltaX"in s?s.deltaX:"wheelDeltaX"in s?-s.wheelDeltaX:0},deltaY:function(s){return"deltaY"in s?s.deltaY:"wheelDeltaY"in s?-s.wheelDeltaY:"wheelDelta"in s?-s.wheelDelta:0},deltaZ:0,deltaMode:0}),tO=vr(eO),nO=h({},Ea,{newState:0,oldState:0}),rO=vr(nO),sO=[9,13,27,32],cm=zs&&"CompositionEvent"in window,du=null;zs&&"documentMode"in document&&(du=document.documentMode);var iO=zs&&"TextEvent"in window&&!du,Vy=zs&&(!cm||du&&8<du&&11>=du),qy=" ",Yy=!1;function Gy(s,o){switch(s){case"keyup":return sO.indexOf(o.keyCode)!==-1;case"keydown":return o.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Xy(s){return s=s.detail,typeof s=="object"&&"data"in s?s.data:null}var jo=!1;function aO(s,o){switch(s){case"compositionend":return Xy(o);case"keypress":return o.which!==32?null:(Yy=!0,qy);case"textInput":return s=o.data,s===qy&&Yy?null:s;default:return null}}function oO(s,o){if(jo)return s==="compositionend"||!cm&&Gy(s,o)?(s=Hy(),bd=im=Ei=null,jo=!1,s):null;switch(s){case"paste":return null;case"keypress":if(!(o.ctrlKey||o.altKey||o.metaKey)||o.ctrlKey&&o.altKey){if(o.char&&1<o.char.length)return o.char;if(o.which)return String.fromCharCode(o.which)}return null;case"compositionend":return Vy&&o.locale!=="ko"?null:o.data;default:return null}}var lO={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 Ky(s){var o=s&&s.nodeName&&s.nodeName.toLowerCase();return o==="input"?!!lO[s.type]:o==="textarea"}function Qy(s,o,u,p){Do?Po?Po.push(p):Po=[p]:Do=p,o=df(o,"onChange"),0<o.length&&(u=new Ed("onChange","change",null,u,p),s.push({event:u,listeners:o}))}var fu=null,hu=null;function uO(s){IT(s,0)}function Td(s){var o=au(s);if(Oy(o))return s}function Wy(s,o){if(s==="change")return o}var Zy=!1;if(zs){var dm;if(zs){var fm="oninput"in document;if(!fm){var Jy=document.createElement("div");Jy.setAttribute("oninput","return;"),fm=typeof Jy.oninput=="function"}dm=fm}else dm=!1;Zy=dm&&(!document.documentMode||9<document.documentMode)}function eE(){fu&&(fu.detachEvent("onpropertychange",tE),hu=fu=null)}function tE(s){if(s.propertyName==="value"&&Td(hu)){var o=[];Qy(o,hu,s,nm(s)),By(uO,o)}}function cO(s,o,u){s==="focusin"?(eE(),fu=o,hu=u,fu.attachEvent("onpropertychange",tE)):s==="focusout"&&eE()}function dO(s){if(s==="selectionchange"||s==="keyup"||s==="keydown")return Td(hu)}function fO(s,o){if(s==="click")return Td(o)}function hO(s,o){if(s==="input"||s==="change")return Td(o)}function pO(s,o){return s===o&&(s!==0||1/s===1/o)||s!==s&&o!==o}var Lr=typeof Object.is=="function"?Object.is:pO;function pu(s,o){if(Lr(s,o))return!0;if(typeof s!="object"||s===null||typeof o!="object"||o===null)return!1;var u=Object.keys(s),p=Object.keys(o);if(u.length!==p.length)return!1;for(p=0;p<u.length;p++){var y=u[p];if(!ye.call(o,y)||!Lr(s[y],o[y]))return!1}return!0}function nE(s){for(;s&&s.firstChild;)s=s.firstChild;return s}function rE(s,o){var u=nE(s);s=0;for(var p;u;){if(u.nodeType===3){if(p=s+u.textContent.length,s<=o&&p>=o)return{node:u,offset:o-s};s=p}e:{for(;u;){if(u.nextSibling){u=u.nextSibling;break e}u=u.parentNode}u=void 0}u=nE(u)}}function sE(s,o){return s&&o?s===o?!0:s&&s.nodeType===3?!1:o&&o.nodeType===3?sE(s,o.parentNode):"contains"in s?s.contains(o):s.compareDocumentPosition?!!(s.compareDocumentPosition(o)&16):!1:!1}function iE(s){s=s!=null&&s.ownerDocument!=null&&s.ownerDocument.defaultView!=null?s.ownerDocument.defaultView:window;for(var o=md(s.document);o instanceof s.HTMLIFrameElement;){try{var u=typeof o.contentWindow.location.href=="string"}catch{u=!1}if(u)s=o.contentWindow;else break;o=md(s.document)}return o}function hm(s){var o=s&&s.nodeName&&s.nodeName.toLowerCase();return o&&(o==="input"&&(s.type==="text"||s.type==="search"||s.type==="tel"||s.type==="url"||s.type==="password")||o==="textarea"||s.contentEditable==="true")}var mO=zs&&"documentMode"in document&&11>=document.documentMode,Bo=null,pm=null,mu=null,mm=!1;function aE(s,o,u){var p=u.window===u?u.document:u.nodeType===9?u:u.ownerDocument;mm||Bo==null||Bo!==md(p)||(p=Bo,"selectionStart"in p&&hm(p)?p={start:p.selectionStart,end:p.selectionEnd}:(p=(p.ownerDocument&&p.ownerDocument.defaultView||window).getSelection(),p={anchorNode:p.anchorNode,anchorOffset:p.anchorOffset,focusNode:p.focusNode,focusOffset:p.focusOffset}),mu&&pu(mu,p)||(mu=p,p=df(pm,"onSelect"),0<p.length&&(o=new Ed("onSelect","select",null,o,u),s.push({event:o,listeners:p}),o.target=Bo)))}function va(s,o){var u={};return u[s.toLowerCase()]=o.toLowerCase(),u["Webkit"+s]="webkit"+o,u["Moz"+s]="moz"+o,u}var Ho={animationend:va("Animation","AnimationEnd"),animationiteration:va("Animation","AnimationIteration"),animationstart:va("Animation","AnimationStart"),transitionrun:va("Transition","TransitionRun"),transitionstart:va("Transition","TransitionStart"),transitioncancel:va("Transition","TransitionCancel"),transitionend:va("Transition","TransitionEnd")},gm={},oE={};zs&&(oE=document.createElement("div").style,"AnimationEvent"in window||(delete Ho.animationend.animation,delete Ho.animationiteration.animation,delete Ho.animationstart.animation),"TransitionEvent"in window||delete Ho.transitionend.transition);function Ta(s){if(gm[s])return gm[s];if(!Ho[s])return s;var o=Ho[s],u;for(u in o)if(o.hasOwnProperty(u)&&u in oE)return gm[s]=o[u];return s}var lE=Ta("animationend"),uE=Ta("animationiteration"),cE=Ta("animationstart"),gO=Ta("transitionrun"),bO=Ta("transitionstart"),xO=Ta("transitioncancel"),dE=Ta("transitionend"),fE=new Map,bm="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(" ");bm.push("scrollEnd");function os(s,o){fE.set(s,o),ya(o,[s])}var Sd=typeof reportError=="function"?reportError:function(s){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var o=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof s=="object"&&s!==null&&typeof s.message=="string"?String(s.message):String(s),error:s});if(!window.dispatchEvent(o))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",s);return}console.error(s)},Kr=[],Uo=0,xm=0;function Cd(){for(var s=Uo,o=xm=Uo=0;o<s;){var u=Kr[o];Kr[o++]=null;var p=Kr[o];Kr[o++]=null;var y=Kr[o];Kr[o++]=null;var T=Kr[o];if(Kr[o++]=null,p!==null&&y!==null){var O=p.pending;O===null?y.next=y:(y.next=O.next,O.next=y),p.pending=y}T!==0&&hE(u,y,T)}}function kd(s,o,u,p){Kr[Uo++]=s,Kr[Uo++]=o,Kr[Uo++]=u,Kr[Uo++]=p,xm|=p,s.lanes|=p,s=s.alternate,s!==null&&(s.lanes|=p)}function ym(s,o,u,p){return kd(s,o,u,p),wd(s)}function Sa(s,o){return kd(s,null,null,o),wd(s)}function hE(s,o,u){s.lanes|=u;var p=s.alternate;p!==null&&(p.lanes|=u);for(var y=!1,T=s.return;T!==null;)T.childLanes|=u,p=T.alternate,p!==null&&(p.childLanes|=u),T.tag===22&&(s=T.stateNode,s===null||s._visibility&1||(y=!0)),s=T,T=T.return;return s.tag===3?(T=s.stateNode,y&&o!==null&&(y=31-Ve(u),s=T.hiddenUpdates,p=s[y],p===null?s[y]=[o]:p.push(o),o.lane=u|536870912),T):null}function wd(s){if(50<ju)throw ju=0,Ag=null,Error(r(185));for(var o=s.return;o!==null;)s=o,o=s.return;return s.tag===3?s.stateNode:null}var zo={};function yO(s,o,u,p){this.tag=s,this.key=u,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=o,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=p,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Dr(s,o,u,p){return new yO(s,o,u,p)}function Em(s){return s=s.prototype,!(!s||!s.isReactComponent)}function Fs(s,o){var u=s.alternate;return u===null?(u=Dr(s.tag,o,s.key,s.mode),u.elementType=s.elementType,u.type=s.type,u.stateNode=s.stateNode,u.alternate=s,s.alternate=u):(u.pendingProps=o,u.type=s.type,u.flags=0,u.subtreeFlags=0,u.deletions=null),u.flags=s.flags&65011712,u.childLanes=s.childLanes,u.lanes=s.lanes,u.child=s.child,u.memoizedProps=s.memoizedProps,u.memoizedState=s.memoizedState,u.updateQueue=s.updateQueue,o=s.dependencies,u.dependencies=o===null?null:{lanes:o.lanes,firstContext:o.firstContext},u.sibling=s.sibling,u.index=s.index,u.ref=s.ref,u.refCleanup=s.refCleanup,u}function pE(s,o){s.flags&=65011714;var u=s.alternate;return u===null?(s.childLanes=0,s.lanes=o,s.child=null,s.subtreeFlags=0,s.memoizedProps=null,s.memoizedState=null,s.updateQueue=null,s.dependencies=null,s.stateNode=null):(s.childLanes=u.childLanes,s.lanes=u.lanes,s.child=u.child,s.subtreeFlags=0,s.deletions=null,s.memoizedProps=u.memoizedProps,s.memoizedState=u.memoizedState,s.updateQueue=u.updateQueue,s.type=u.type,o=u.dependencies,s.dependencies=o===null?null:{lanes:o.lanes,firstContext:o.firstContext}),s}function Nd(s,o,u,p,y,T){var O=0;if(p=s,typeof s=="function")Em(s)&&(O=1);else if(typeof s=="string")O=CI(s,u,ae.current)?26:s==="html"||s==="head"||s==="body"?27:5;else e:switch(s){case U:return s=Dr(31,u,o,y),s.elementType=U,s.lanes=T,s;case w:return Ca(u.children,y,T,o);case k:O=8,y|=24;break;case C:return s=Dr(12,u,o,y|2),s.elementType=C,s.lanes=T,s;case M:return s=Dr(13,u,o,y),s.elementType=M,s.lanes=T,s;case _:return s=Dr(19,u,o,y),s.elementType=_,s.lanes=T,s;default:if(typeof s=="object"&&s!==null)switch(s.$$typeof){case A:O=10;break e;case N:O=9;break e;case R:O=11;break e;case D:O=14;break e;case I:O=16,p=null;break e}O=29,u=Error(r(130,s===null?"null":typeof s,"")),p=null}return o=Dr(O,u,o,y),o.elementType=s,o.type=p,o.lanes=T,o}function Ca(s,o,u,p){return s=Dr(7,s,p,o),s.lanes=u,s}function vm(s,o,u){return s=Dr(6,s,null,o),s.lanes=u,s}function mE(s){var o=Dr(18,null,null,0);return o.stateNode=s,o}function Tm(s,o,u){return o=Dr(4,s.children!==null?s.children:[],s.key,o),o.lanes=u,o.stateNode={containerInfo:s.containerInfo,pendingChildren:null,implementation:s.implementation},o}var gE=new WeakMap;function Qr(s,o){if(typeof s=="object"&&s!==null){var u=gE.get(s);return u!==void 0?u:(o={value:s,source:o,stack:ke(o)},gE.set(s,o),o)}return{value:s,source:o,stack:ke(o)}}var Fo=[],$o=0,Ad=null,gu=0,Wr=[],Zr=0,vi=null,xs=1,ys="";function $s(s,o){Fo[$o++]=gu,Fo[$o++]=Ad,Ad=s,gu=o}function bE(s,o,u){Wr[Zr++]=xs,Wr[Zr++]=ys,Wr[Zr++]=vi,vi=s;var p=xs;s=ys;var y=32-Ve(p)-1;p&=~(1<<y),u+=1;var T=32-Ve(o)+y;if(30<T){var O=y-y%5;T=(p&(1<<O)-1).toString(32),p>>=O,y-=O,xs=1<<32-Ve(o)+y|u<<y|p,ys=T+s}else xs=1<<T|u<<y|p,ys=s}function Sm(s){s.return!==null&&($s(s,1),bE(s,1,0))}function Cm(s){for(;s===Ad;)Ad=Fo[--$o],Fo[$o]=null,gu=Fo[--$o],Fo[$o]=null;for(;s===vi;)vi=Wr[--Zr],Wr[Zr]=null,ys=Wr[--Zr],Wr[Zr]=null,xs=Wr[--Zr],Wr[Zr]=null}function xE(s,o){Wr[Zr++]=xs,Wr[Zr++]=ys,Wr[Zr++]=vi,xs=o.id,ys=o.overflow,vi=s}var Qn=null,on=null,Dt=!1,Ti=null,Jr=!1,km=Error(r(519));function Si(s){var o=Error(r(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw bu(Qr(o,s)),km}function yE(s){var o=s.stateNode,u=s.type,p=s.memoizedProps;switch(o[en]=s,o[Kn]=p,u){case"dialog":Nt("cancel",o),Nt("close",o);break;case"iframe":case"object":case"embed":Nt("load",o);break;case"video":case"audio":for(u=0;u<Hu.length;u++)Nt(Hu[u],o);break;case"source":Nt("error",o);break;case"img":case"image":case"link":Nt("error",o),Nt("load",o);break;case"details":Nt("toggle",o);break;case"input":Nt("invalid",o),Iy(o,p.value,p.defaultValue,p.checked,p.defaultChecked,p.type,p.name,!0);break;case"select":Nt("invalid",o);break;case"textarea":Nt("invalid",o),Ly(o,p.value,p.defaultValue,p.children)}u=p.children,typeof u!="string"&&typeof u!="number"&&typeof u!="bigint"||o.textContent===""+u||p.suppressHydrationWarning===!0||PT(o.textContent,u)?(p.popover!=null&&(Nt("beforetoggle",o),Nt("toggle",o)),p.onScroll!=null&&Nt("scroll",o),p.onScrollEnd!=null&&Nt("scrollend",o),p.onClick!=null&&(o.onclick=Us),o=!0):o=!1,o||Si(s,!0)}function EE(s){for(Qn=s.return;Qn;)switch(Qn.tag){case 5:case 31:case 13:Jr=!1;return;case 27:case 3:Jr=!0;return;default:Qn=Qn.return}}function Vo(s){if(s!==Qn)return!1;if(!Dt)return EE(s),Dt=!0,!1;var o=s.tag,u;if((u=o!==3&&o!==27)&&((u=o===5)&&(u=s.type,u=!(u!=="form"&&u!=="button")||$g(s.type,s.memoizedProps)),u=!u),u&&on&&Si(s),EE(s),o===13){if(s=s.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(r(317));on=qT(s)}else if(o===31){if(s=s.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(r(317));on=qT(s)}else o===27?(o=on,ji(s.type)?(s=Xg,Xg=null,on=s):on=o):on=Qn?ts(s.stateNode.nextSibling):null;return!0}function ka(){on=Qn=null,Dt=!1}function wm(){var s=Ti;return s!==null&&(kr===null?kr=s:kr.push.apply(kr,s),Ti=null),s}function bu(s){Ti===null?Ti=[s]:Ti.push(s)}var Nm=B(null),wa=null,Vs=null;function Ci(s,o,u){P(Nm,o._currentValue),o._currentValue=u}function qs(s){s._currentValue=Nm.current,G(Nm)}function Am(s,o,u){for(;s!==null;){var p=s.alternate;if((s.childLanes&o)!==o?(s.childLanes|=o,p!==null&&(p.childLanes|=o)):p!==null&&(p.childLanes&o)!==o&&(p.childLanes|=o),s===u)break;s=s.return}}function _m(s,o,u,p){var y=s.child;for(y!==null&&(y.return=s);y!==null;){var T=y.dependencies;if(T!==null){var O=y.child;T=T.firstContext;e:for(;T!==null;){var z=T;T=y;for(var ne=0;ne<o.length;ne++)if(z.context===o[ne]){T.lanes|=u,z=T.alternate,z!==null&&(z.lanes|=u),Am(T.return,u,s),p||(O=null);break e}T=z.next}}else if(y.tag===18){if(O=y.return,O===null)throw Error(r(341));O.lanes|=u,T=O.alternate,T!==null&&(T.lanes|=u),Am(O,u,s),O=null}else O=y.child;if(O!==null)O.return=y;else for(O=y;O!==null;){if(O===s){O=null;break}if(y=O.sibling,y!==null){y.return=O.return,O=y;break}O=O.return}y=O}}function qo(s,o,u,p){s=null;for(var y=o,T=!1;y!==null;){if(!T){if((y.flags&524288)!==0)T=!0;else if((y.flags&262144)!==0)break}if(y.tag===10){var O=y.alternate;if(O===null)throw Error(r(387));if(O=O.memoizedProps,O!==null){var z=y.type;Lr(y.pendingProps.value,O.value)||(s!==null?s.push(z):s=[z])}}else if(y===de.current){if(O=y.alternate,O===null)throw Error(r(387));O.memoizedState.memoizedState!==y.memoizedState.memoizedState&&(s!==null?s.push(Vu):s=[Vu])}y=y.return}s!==null&&_m(o,s,u,p),o.flags|=262144}function _d(s){for(s=s.firstContext;s!==null;){if(!Lr(s.context._currentValue,s.memoizedValue))return!0;s=s.next}return!1}function Na(s){wa=s,Vs=null,s=s.dependencies,s!==null&&(s.firstContext=null)}function Wn(s){return vE(wa,s)}function Rd(s,o){return wa===null&&Na(s),vE(s,o)}function vE(s,o){var u=o._currentValue;if(o={context:o,memoizedValue:u,next:null},Vs===null){if(s===null)throw Error(r(308));Vs=o,s.dependencies={lanes:0,firstContext:o},s.flags|=524288}else Vs=Vs.next=o;return u}var EO=typeof AbortController<"u"?AbortController:function(){var s=[],o=this.signal={aborted:!1,addEventListener:function(u,p){s.push(p)}};this.abort=function(){o.aborted=!0,s.forEach(function(u){return u()})}},vO=e.unstable_scheduleCallback,TO=e.unstable_NormalPriority,An={$$typeof:A,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Rm(){return{controller:new EO,data:new Map,refCount:0}}function xu(s){s.refCount--,s.refCount===0&&vO(TO,function(){s.controller.abort()})}var yu=null,Om=0,Yo=0,Go=null;function SO(s,o){if(yu===null){var u=yu=[];Om=0,Yo=Lg(),Go={status:"pending",value:void 0,then:function(p){u.push(p)}}}return Om++,o.then(TE,TE),o}function TE(){if(--Om===0&&yu!==null){Go!==null&&(Go.status="fulfilled");var s=yu;yu=null,Yo=0,Go=null;for(var o=0;o<s.length;o++)(0,s[o])()}}function CO(s,o){var u=[],p={status:"pending",value:null,reason:null,then:function(y){u.push(y)}};return s.then(function(){p.status="fulfilled",p.value=o;for(var y=0;y<u.length;y++)(0,u[y])(o)},function(y){for(p.status="rejected",p.reason=y,y=0;y<u.length;y++)(0,u[y])(void 0)}),p}var SE=H.S;H.S=function(s,o){aT=se(),typeof o=="object"&&o!==null&&typeof o.then=="function"&&SO(s,o),SE!==null&&SE(s,o)};var Aa=B(null);function Im(){var s=Aa.current;return s!==null?s:tn.pooledCache}function Od(s,o){o===null?P(Aa,Aa.current):P(Aa,o.pool)}function CE(){var s=Im();return s===null?null:{parent:An._currentValue,pool:s}}var Xo=Error(r(460)),Mm=Error(r(474)),Id=Error(r(542)),Md={then:function(){}};function kE(s){return s=s.status,s==="fulfilled"||s==="rejected"}function wE(s,o,u){switch(u=s[u],u===void 0?s.push(o):u!==o&&(o.then(Us,Us),o=u),o.status){case"fulfilled":return o.value;case"rejected":throw s=o.reason,AE(s),s;default:if(typeof o.status=="string")o.then(Us,Us);else{if(s=tn,s!==null&&100<s.shellSuspendCounter)throw Error(r(482));s=o,s.status="pending",s.then(function(p){if(o.status==="pending"){var y=o;y.status="fulfilled",y.value=p}},function(p){if(o.status==="pending"){var y=o;y.status="rejected",y.reason=p}})}switch(o.status){case"fulfilled":return o.value;case"rejected":throw s=o.reason,AE(s),s}throw Ra=o,Xo}}function _a(s){try{var o=s._init;return o(s._payload)}catch(u){throw u!==null&&typeof u=="object"&&typeof u.then=="function"?(Ra=u,Xo):u}}var Ra=null;function NE(){if(Ra===null)throw Error(r(459));var s=Ra;return Ra=null,s}function AE(s){if(s===Xo||s===Id)throw Error(r(483))}var Ko=null,Eu=0;function Ld(s){var o=Eu;return Eu+=1,Ko===null&&(Ko=[]),wE(Ko,s,o)}function vu(s,o){o=o.props.ref,s.ref=o!==void 0?o:null}function Dd(s,o){throw o.$$typeof===b?Error(r(525)):(s=Object.prototype.toString.call(o),Error(r(31,s==="[object Object]"?"object with keys {"+Object.keys(o).join(", ")+"}":s)))}function _E(s){function o(fe,le){if(s){var ge=fe.deletions;ge===null?(fe.deletions=[le],fe.flags|=16):ge.push(le)}}function u(fe,le){if(!s)return null;for(;le!==null;)o(fe,le),le=le.sibling;return null}function p(fe){for(var le=new Map;fe!==null;)fe.key!==null?le.set(fe.key,fe):le.set(fe.index,fe),fe=fe.sibling;return le}function y(fe,le){return fe=Fs(fe,le),fe.index=0,fe.sibling=null,fe}function T(fe,le,ge){return fe.index=ge,s?(ge=fe.alternate,ge!==null?(ge=ge.index,ge<le?(fe.flags|=67108866,le):ge):(fe.flags|=67108866,le)):(fe.flags|=1048576,le)}function O(fe){return s&&fe.alternate===null&&(fe.flags|=67108866),fe}function z(fe,le,ge,Ne){return le===null||le.tag!==6?(le=vm(ge,fe.mode,Ne),le.return=fe,le):(le=y(le,ge),le.return=fe,le)}function ne(fe,le,ge,Ne){var rt=ge.type;return rt===w?we(fe,le,ge.props.children,Ne,ge.key):le!==null&&(le.elementType===rt||typeof rt=="object"&&rt!==null&&rt.$$typeof===I&&_a(rt)===le.type)?(le=y(le,ge.props),vu(le,ge),le.return=fe,le):(le=Nd(ge.type,ge.key,ge.props,null,fe.mode,Ne),vu(le,ge),le.return=fe,le)}function be(fe,le,ge,Ne){return le===null||le.tag!==4||le.stateNode.containerInfo!==ge.containerInfo||le.stateNode.implementation!==ge.implementation?(le=Tm(ge,fe.mode,Ne),le.return=fe,le):(le=y(le,ge.children||[]),le.return=fe,le)}function we(fe,le,ge,Ne,rt){return le===null||le.tag!==7?(le=Ca(ge,fe.mode,Ne,rt),le.return=fe,le):(le=y(le,ge),le.return=fe,le)}function Ae(fe,le,ge){if(typeof le=="string"&&le!==""||typeof le=="number"||typeof le=="bigint")return le=vm(""+le,fe.mode,ge),le.return=fe,le;if(typeof le=="object"&&le!==null){switch(le.$$typeof){case x:return ge=Nd(le.type,le.key,le.props,null,fe.mode,ge),vu(ge,le),ge.return=fe,ge;case v:return le=Tm(le,fe.mode,ge),le.return=fe,le;case I:return le=_a(le),Ae(fe,le,ge)}if(V(le)||K(le))return le=Ca(le,fe.mode,ge,null),le.return=fe,le;if(typeof le.then=="function")return Ae(fe,Ld(le),ge);if(le.$$typeof===A)return Ae(fe,Rd(fe,le),ge);Dd(fe,le)}return null}function xe(fe,le,ge,Ne){var rt=le!==null?le.key:null;if(typeof ge=="string"&&ge!==""||typeof ge=="number"||typeof ge=="bigint")return rt!==null?null:z(fe,le,""+ge,Ne);if(typeof ge=="object"&&ge!==null){switch(ge.$$typeof){case x:return ge.key===rt?ne(fe,le,ge,Ne):null;case v:return ge.key===rt?be(fe,le,ge,Ne):null;case I:return ge=_a(ge),xe(fe,le,ge,Ne)}if(V(ge)||K(ge))return rt!==null?null:we(fe,le,ge,Ne,null);if(typeof ge.then=="function")return xe(fe,le,Ld(ge),Ne);if(ge.$$typeof===A)return xe(fe,le,Rd(fe,ge),Ne);Dd(fe,ge)}return null}function Te(fe,le,ge,Ne,rt){if(typeof Ne=="string"&&Ne!==""||typeof Ne=="number"||typeof Ne=="bigint")return fe=fe.get(ge)||null,z(le,fe,""+Ne,rt);if(typeof Ne=="object"&&Ne!==null){switch(Ne.$$typeof){case x:return fe=fe.get(Ne.key===null?ge:Ne.key)||null,ne(le,fe,Ne,rt);case v:return fe=fe.get(Ne.key===null?ge:Ne.key)||null,be(le,fe,Ne,rt);case I:return Ne=_a(Ne),Te(fe,le,ge,Ne,rt)}if(V(Ne)||K(Ne))return fe=fe.get(ge)||null,we(le,fe,Ne,rt,null);if(typeof Ne.then=="function")return Te(fe,le,ge,Ld(Ne),rt);if(Ne.$$typeof===A)return Te(fe,le,ge,Rd(le,Ne),rt);Dd(le,Ne)}return null}function Ze(fe,le,ge,Ne){for(var rt=null,Ht=null,Je=le,xt=le=0,Mt=null;Je!==null&&xt<ge.length;xt++){Je.index>xt?(Mt=Je,Je=null):Mt=Je.sibling;var Ut=xe(fe,Je,ge[xt],Ne);if(Ut===null){Je===null&&(Je=Mt);break}s&&Je&&Ut.alternate===null&&o(fe,Je),le=T(Ut,le,xt),Ht===null?rt=Ut:Ht.sibling=Ut,Ht=Ut,Je=Mt}if(xt===ge.length)return u(fe,Je),Dt&&$s(fe,xt),rt;if(Je===null){for(;xt<ge.length;xt++)Je=Ae(fe,ge[xt],Ne),Je!==null&&(le=T(Je,le,xt),Ht===null?rt=Je:Ht.sibling=Je,Ht=Je);return Dt&&$s(fe,xt),rt}for(Je=p(Je);xt<ge.length;xt++)Mt=Te(Je,fe,xt,ge[xt],Ne),Mt!==null&&(s&&Mt.alternate!==null&&Je.delete(Mt.key===null?xt:Mt.key),le=T(Mt,le,xt),Ht===null?rt=Mt:Ht.sibling=Mt,Ht=Mt);return s&&Je.forEach(function(Fi){return o(fe,Fi)}),Dt&&$s(fe,xt),rt}function it(fe,le,ge,Ne){if(ge==null)throw Error(r(151));for(var rt=null,Ht=null,Je=le,xt=le=0,Mt=null,Ut=ge.next();Je!==null&&!Ut.done;xt++,Ut=ge.next()){Je.index>xt?(Mt=Je,Je=null):Mt=Je.sibling;var Fi=xe(fe,Je,Ut.value,Ne);if(Fi===null){Je===null&&(Je=Mt);break}s&&Je&&Fi.alternate===null&&o(fe,Je),le=T(Fi,le,xt),Ht===null?rt=Fi:Ht.sibling=Fi,Ht=Fi,Je=Mt}if(Ut.done)return u(fe,Je),Dt&&$s(fe,xt),rt;if(Je===null){for(;!Ut.done;xt++,Ut=ge.next())Ut=Ae(fe,Ut.value,Ne),Ut!==null&&(le=T(Ut,le,xt),Ht===null?rt=Ut:Ht.sibling=Ut,Ht=Ut);return Dt&&$s(fe,xt),rt}for(Je=p(Je);!Ut.done;xt++,Ut=ge.next())Ut=Te(Je,fe,xt,Ut.value,Ne),Ut!==null&&(s&&Ut.alternate!==null&&Je.delete(Ut.key===null?xt:Ut.key),le=T(Ut,le,xt),Ht===null?rt=Ut:Ht.sibling=Ut,Ht=Ut);return s&&Je.forEach(function(DI){return o(fe,DI)}),Dt&&$s(fe,xt),rt}function Xt(fe,le,ge,Ne){if(typeof ge=="object"&&ge!==null&&ge.type===w&&ge.key===null&&(ge=ge.props.children),typeof ge=="object"&&ge!==null){switch(ge.$$typeof){case x:e:{for(var rt=ge.key;le!==null;){if(le.key===rt){if(rt=ge.type,rt===w){if(le.tag===7){u(fe,le.sibling),Ne=y(le,ge.props.children),Ne.return=fe,fe=Ne;break e}}else if(le.elementType===rt||typeof rt=="object"&&rt!==null&&rt.$$typeof===I&&_a(rt)===le.type){u(fe,le.sibling),Ne=y(le,ge.props),vu(Ne,ge),Ne.return=fe,fe=Ne;break e}u(fe,le);break}else o(fe,le);le=le.sibling}ge.type===w?(Ne=Ca(ge.props.children,fe.mode,Ne,ge.key),Ne.return=fe,fe=Ne):(Ne=Nd(ge.type,ge.key,ge.props,null,fe.mode,Ne),vu(Ne,ge),Ne.return=fe,fe=Ne)}return O(fe);case v:e:{for(rt=ge.key;le!==null;){if(le.key===rt)if(le.tag===4&&le.stateNode.containerInfo===ge.containerInfo&&le.stateNode.implementation===ge.implementation){u(fe,le.sibling),Ne=y(le,ge.children||[]),Ne.return=fe,fe=Ne;break e}else{u(fe,le);break}else o(fe,le);le=le.sibling}Ne=Tm(ge,fe.mode,Ne),Ne.return=fe,fe=Ne}return O(fe);case I:return ge=_a(ge),Xt(fe,le,ge,Ne)}if(V(ge))return Ze(fe,le,ge,Ne);if(K(ge)){if(rt=K(ge),typeof rt!="function")throw Error(r(150));return ge=rt.call(ge),it(fe,le,ge,Ne)}if(typeof ge.then=="function")return Xt(fe,le,Ld(ge),Ne);if(ge.$$typeof===A)return Xt(fe,le,Rd(fe,ge),Ne);Dd(fe,ge)}return typeof ge=="string"&&ge!==""||typeof ge=="number"||typeof ge=="bigint"?(ge=""+ge,le!==null&&le.tag===6?(u(fe,le.sibling),Ne=y(le,ge),Ne.return=fe,fe=Ne):(u(fe,le),Ne=vm(ge,fe.mode,Ne),Ne.return=fe,fe=Ne),O(fe)):u(fe,le)}return function(fe,le,ge,Ne){try{Eu=0;var rt=Xt(fe,le,ge,Ne);return Ko=null,rt}catch(Je){if(Je===Xo||Je===Id)throw Je;var Ht=Dr(29,Je,null,fe.mode);return Ht.lanes=Ne,Ht.return=fe,Ht}finally{}}}var Oa=_E(!0),RE=_E(!1),ki=!1;function Lm(s){s.updateQueue={baseState:s.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Dm(s,o){s=s.updateQueue,o.updateQueue===s&&(o.updateQueue={baseState:s.baseState,firstBaseUpdate:s.firstBaseUpdate,lastBaseUpdate:s.lastBaseUpdate,shared:s.shared,callbacks:null})}function wi(s){return{lane:s,tag:0,payload:null,callback:null,next:null}}function Ni(s,o,u){var p=s.updateQueue;if(p===null)return null;if(p=p.shared,(Ft&2)!==0){var y=p.pending;return y===null?o.next=o:(o.next=y.next,y.next=o),p.pending=o,o=wd(s),hE(s,null,u),o}return kd(s,p,o,u),wd(s)}function Tu(s,o,u){if(o=o.updateQueue,o!==null&&(o=o.shared,(u&4194048)!==0)){var p=o.lanes;p&=s.pendingLanes,u|=p,o.lanes=u,mn(s,u)}}function Pm(s,o){var u=s.updateQueue,p=s.alternate;if(p!==null&&(p=p.updateQueue,u===p)){var y=null,T=null;if(u=u.firstBaseUpdate,u!==null){do{var O={lane:u.lane,tag:u.tag,payload:u.payload,callback:null,next:null};T===null?y=T=O:T=T.next=O,u=u.next}while(u!==null);T===null?y=T=o:T=T.next=o}else y=T=o;u={baseState:p.baseState,firstBaseUpdate:y,lastBaseUpdate:T,shared:p.shared,callbacks:p.callbacks},s.updateQueue=u;return}s=u.lastBaseUpdate,s===null?u.firstBaseUpdate=o:s.next=o,u.lastBaseUpdate=o}var jm=!1;function Su(){if(jm){var s=Go;if(s!==null)throw s}}function Cu(s,o,u,p){jm=!1;var y=s.updateQueue;ki=!1;var T=y.firstBaseUpdate,O=y.lastBaseUpdate,z=y.shared.pending;if(z!==null){y.shared.pending=null;var ne=z,be=ne.next;ne.next=null,O===null?T=be:O.next=be,O=ne;var we=s.alternate;we!==null&&(we=we.updateQueue,z=we.lastBaseUpdate,z!==O&&(z===null?we.firstBaseUpdate=be:z.next=be,we.lastBaseUpdate=ne))}if(T!==null){var Ae=y.baseState;O=0,we=be=ne=null,z=T;do{var xe=z.lane&-536870913,Te=xe!==z.lane;if(Te?(It&xe)===xe:(p&xe)===xe){xe!==0&&xe===Yo&&(jm=!0),we!==null&&(we=we.next={lane:0,tag:z.tag,payload:z.payload,callback:null,next:null});e:{var Ze=s,it=z;xe=o;var Xt=u;switch(it.tag){case 1:if(Ze=it.payload,typeof Ze=="function"){Ae=Ze.call(Xt,Ae,xe);break e}Ae=Ze;break e;case 3:Ze.flags=Ze.flags&-65537|128;case 0:if(Ze=it.payload,xe=typeof Ze=="function"?Ze.call(Xt,Ae,xe):Ze,xe==null)break e;Ae=h({},Ae,xe);break e;case 2:ki=!0}}xe=z.callback,xe!==null&&(s.flags|=64,Te&&(s.flags|=8192),Te=y.callbacks,Te===null?y.callbacks=[xe]:Te.push(xe))}else Te={lane:xe,tag:z.tag,payload:z.payload,callback:z.callback,next:null},we===null?(be=we=Te,ne=Ae):we=we.next=Te,O|=xe;if(z=z.next,z===null){if(z=y.shared.pending,z===null)break;Te=z,z=Te.next,Te.next=null,y.lastBaseUpdate=Te,y.shared.pending=null}}while(!0);we===null&&(ne=Ae),y.baseState=ne,y.firstBaseUpdate=be,y.lastBaseUpdate=we,T===null&&(y.shared.lanes=0),Ii|=O,s.lanes=O,s.memoizedState=Ae}}function OE(s,o){if(typeof s!="function")throw Error(r(191,s));s.call(o)}function IE(s,o){var u=s.callbacks;if(u!==null)for(s.callbacks=null,s=0;s<u.length;s++)OE(u[s],o)}var Qo=B(null),Pd=B(0);function ME(s,o){s=ei,P(Pd,s),P(Qo,o),ei=s|o.baseLanes}function Bm(){P(Pd,ei),P(Qo,Qo.current)}function Hm(){ei=Pd.current,G(Qo),G(Pd)}var Pr=B(null),es=null;function Ai(s){var o=s.alternate;P(Sn,Sn.current&1),P(Pr,s),es===null&&(o===null||Qo.current!==null||o.memoizedState!==null)&&(es=s)}function Um(s){P(Sn,Sn.current),P(Pr,s),es===null&&(es=s)}function LE(s){s.tag===22?(P(Sn,Sn.current),P(Pr,s),es===null&&(es=s)):_i()}function _i(){P(Sn,Sn.current),P(Pr,Pr.current)}function jr(s){G(Pr),es===s&&(es=null),G(Sn)}var Sn=B(0);function jd(s){for(var o=s;o!==null;){if(o.tag===13){var u=o.memoizedState;if(u!==null&&(u=u.dehydrated,u===null||Yg(u)||Gg(u)))return o}else if(o.tag===19&&(o.memoizedProps.revealOrder==="forwards"||o.memoizedProps.revealOrder==="backwards"||o.memoizedProps.revealOrder==="unstable_legacy-backwards"||o.memoizedProps.revealOrder==="together")){if((o.flags&128)!==0)return o}else if(o.child!==null){o.child.return=o,o=o.child;continue}if(o===s)break;for(;o.sibling===null;){if(o.return===null||o.return===s)return null;o=o.return}o.sibling.return=o.return,o=o.sibling}return null}var Ys=0,bt=null,Yt=null,_n=null,Bd=!1,Wo=!1,Ia=!1,Hd=0,ku=0,Zo=null,kO=0;function xn(){throw Error(r(321))}function zm(s,o){if(o===null)return!1;for(var u=0;u<o.length&&u<s.length;u++)if(!Lr(s[u],o[u]))return!1;return!0}function Fm(s,o,u,p,y,T){return Ys=T,bt=o,o.memoizedState=null,o.updateQueue=null,o.lanes=0,H.H=s===null||s.memoizedState===null?bv:rg,Ia=!1,T=u(p,y),Ia=!1,Wo&&(T=PE(o,u,p,y)),DE(s),T}function DE(s){H.H=Au;var o=Yt!==null&&Yt.next!==null;if(Ys=0,_n=Yt=bt=null,Bd=!1,ku=0,Zo=null,o)throw Error(r(300));s===null||Rn||(s=s.dependencies,s!==null&&_d(s)&&(Rn=!0))}function PE(s,o,u,p){bt=s;var y=0;do{if(Wo&&(Zo=null),ku=0,Wo=!1,25<=y)throw Error(r(301));if(y+=1,_n=Yt=null,s.updateQueue!=null){var T=s.updateQueue;T.lastEffect=null,T.events=null,T.stores=null,T.memoCache!=null&&(T.memoCache.index=0)}H.H=xv,T=o(u,p)}while(Wo);return T}function wO(){var s=H.H,o=s.useState()[0];return o=typeof o.then=="function"?wu(o):o,s=s.useState()[0],(Yt!==null?Yt.memoizedState:null)!==s&&(bt.flags|=1024),o}function $m(){var s=Hd!==0;return Hd=0,s}function Vm(s,o,u){o.updateQueue=s.updateQueue,o.flags&=-2053,s.lanes&=~u}function qm(s){if(Bd){for(s=s.memoizedState;s!==null;){var o=s.queue;o!==null&&(o.pending=null),s=s.next}Bd=!1}Ys=0,_n=Yt=bt=null,Wo=!1,ku=Hd=0,Zo=null}function cr(){var s={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return _n===null?bt.memoizedState=_n=s:_n=_n.next=s,_n}function Cn(){if(Yt===null){var s=bt.alternate;s=s!==null?s.memoizedState:null}else s=Yt.next;var o=_n===null?bt.memoizedState:_n.next;if(o!==null)_n=o,Yt=s;else{if(s===null)throw bt.alternate===null?Error(r(467)):Error(r(310));Yt=s,s={memoizedState:Yt.memoizedState,baseState:Yt.baseState,baseQueue:Yt.baseQueue,queue:Yt.queue,next:null},_n===null?bt.memoizedState=_n=s:_n=_n.next=s}return _n}function Ud(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function wu(s){var o=ku;return ku+=1,Zo===null&&(Zo=[]),s=wE(Zo,s,o),o=bt,(_n===null?o.memoizedState:_n.next)===null&&(o=o.alternate,H.H=o===null||o.memoizedState===null?bv:rg),s}function zd(s){if(s!==null&&typeof s=="object"){if(typeof s.then=="function")return wu(s);if(s.$$typeof===A)return Wn(s)}throw Error(r(438,String(s)))}function Ym(s){var o=null,u=bt.updateQueue;if(u!==null&&(o=u.memoCache),o==null){var p=bt.alternate;p!==null&&(p=p.updateQueue,p!==null&&(p=p.memoCache,p!=null&&(o={data:p.data.map(function(y){return y.slice()}),index:0})))}if(o==null&&(o={data:[],index:0}),u===null&&(u=Ud(),bt.updateQueue=u),u.memoCache=o,u=o.data[o.index],u===void 0)for(u=o.data[o.index]=Array(s),p=0;p<s;p++)u[p]=j;return o.index++,u}function Gs(s,o){return typeof o=="function"?o(s):o}function Fd(s){var o=Cn();return Gm(o,Yt,s)}function Gm(s,o,u){var p=s.queue;if(p===null)throw Error(r(311));p.lastRenderedReducer=u;var y=s.baseQueue,T=p.pending;if(T!==null){if(y!==null){var O=y.next;y.next=T.next,T.next=O}o.baseQueue=y=T,p.pending=null}if(T=s.baseState,y===null)s.memoizedState=T;else{o=y.next;var z=O=null,ne=null,be=o,we=!1;do{var Ae=be.lane&-536870913;if(Ae!==be.lane?(It&Ae)===Ae:(Ys&Ae)===Ae){var xe=be.revertLane;if(xe===0)ne!==null&&(ne=ne.next={lane:0,revertLane:0,gesture:null,action:be.action,hasEagerState:be.hasEagerState,eagerState:be.eagerState,next:null}),Ae===Yo&&(we=!0);else if((Ys&xe)===xe){be=be.next,xe===Yo&&(we=!0);continue}else Ae={lane:0,revertLane:be.revertLane,gesture:null,action:be.action,hasEagerState:be.hasEagerState,eagerState:be.eagerState,next:null},ne===null?(z=ne=Ae,O=T):ne=ne.next=Ae,bt.lanes|=xe,Ii|=xe;Ae=be.action,Ia&&u(T,Ae),T=be.hasEagerState?be.eagerState:u(T,Ae)}else xe={lane:Ae,revertLane:be.revertLane,gesture:be.gesture,action:be.action,hasEagerState:be.hasEagerState,eagerState:be.eagerState,next:null},ne===null?(z=ne=xe,O=T):ne=ne.next=xe,bt.lanes|=Ae,Ii|=Ae;be=be.next}while(be!==null&&be!==o);if(ne===null?O=T:ne.next=z,!Lr(T,s.memoizedState)&&(Rn=!0,we&&(u=Go,u!==null)))throw u;s.memoizedState=T,s.baseState=O,s.baseQueue=ne,p.lastRenderedState=T}return y===null&&(p.lanes=0),[s.memoizedState,p.dispatch]}function Xm(s){var o=Cn(),u=o.queue;if(u===null)throw Error(r(311));u.lastRenderedReducer=s;var p=u.dispatch,y=u.pending,T=o.memoizedState;if(y!==null){u.pending=null;var O=y=y.next;do T=s(T,O.action),O=O.next;while(O!==y);Lr(T,o.memoizedState)||(Rn=!0),o.memoizedState=T,o.baseQueue===null&&(o.baseState=T),u.lastRenderedState=T}return[T,p]}function jE(s,o,u){var p=bt,y=Cn(),T=Dt;if(T){if(u===void 0)throw Error(r(407));u=u()}else u=o();var O=!Lr((Yt||y).memoizedState,u);if(O&&(y.memoizedState=u,Rn=!0),y=y.queue,Wm(UE.bind(null,p,y,s),[s]),y.getSnapshot!==o||O||_n!==null&&_n.memoizedState.tag&1){if(p.flags|=2048,Jo(9,{destroy:void 0},HE.bind(null,p,y,u,o),null),tn===null)throw Error(r(349));T||(Ys&127)!==0||BE(p,o,u)}return u}function BE(s,o,u){s.flags|=16384,s={getSnapshot:o,value:u},o=bt.updateQueue,o===null?(o=Ud(),bt.updateQueue=o,o.stores=[s]):(u=o.stores,u===null?o.stores=[s]:u.push(s))}function HE(s,o,u,p){o.value=u,o.getSnapshot=p,zE(o)&&FE(s)}function UE(s,o,u){return u(function(){zE(o)&&FE(s)})}function zE(s){var o=s.getSnapshot;s=s.value;try{var u=o();return!Lr(s,u)}catch{return!0}}function FE(s){var o=Sa(s,2);o!==null&&wr(o,s,2)}function Km(s){var o=cr();if(typeof s=="function"){var u=s;if(s=u(),Ia){ut(!0);try{u()}finally{ut(!1)}}}return o.memoizedState=o.baseState=s,o.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Gs,lastRenderedState:s},o}function $E(s,o,u,p){return s.baseState=u,Gm(s,Yt,typeof p=="function"?p:Gs)}function NO(s,o,u,p,y){if(qd(s))throw Error(r(485));if(s=o.action,s!==null){var T={payload:y,action:s,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(O){T.listeners.push(O)}};H.T!==null?u(!0):T.isTransition=!1,p(T),u=o.pending,u===null?(T.next=o.pending=T,VE(o,T)):(T.next=u.next,o.pending=u.next=T)}}function VE(s,o){var u=o.action,p=o.payload,y=s.state;if(o.isTransition){var T=H.T,O={};H.T=O;try{var z=u(y,p),ne=H.S;ne!==null&&ne(O,z),qE(s,o,z)}catch(be){Qm(s,o,be)}finally{T!==null&&O.types!==null&&(T.types=O.types),H.T=T}}else try{T=u(y,p),qE(s,o,T)}catch(be){Qm(s,o,be)}}function qE(s,o,u){u!==null&&typeof u=="object"&&typeof u.then=="function"?u.then(function(p){YE(s,o,p)},function(p){return Qm(s,o,p)}):YE(s,o,u)}function YE(s,o,u){o.status="fulfilled",o.value=u,GE(o),s.state=u,o=s.pending,o!==null&&(u=o.next,u===o?s.pending=null:(u=u.next,o.next=u,VE(s,u)))}function Qm(s,o,u){var p=s.pending;if(s.pending=null,p!==null){p=p.next;do o.status="rejected",o.reason=u,GE(o),o=o.next;while(o!==p)}s.action=null}function GE(s){s=s.listeners;for(var o=0;o<s.length;o++)(0,s[o])()}function XE(s,o){return o}function KE(s,o){if(Dt){var u=tn.formState;if(u!==null){e:{var p=bt;if(Dt){if(on){t:{for(var y=on,T=Jr;y.nodeType!==8;){if(!T){y=null;break t}if(y=ts(y.nextSibling),y===null){y=null;break t}}T=y.data,y=T==="F!"||T==="F"?y:null}if(y){on=ts(y.nextSibling),p=y.data==="F!";break e}}Si(p)}p=!1}p&&(o=u[0])}}return u=cr(),u.memoizedState=u.baseState=o,p={pending:null,lanes:0,dispatch:null,lastRenderedReducer:XE,lastRenderedState:o},u.queue=p,u=pv.bind(null,bt,p),p.dispatch=u,p=Km(!1),T=ng.bind(null,bt,!1,p.queue),p=cr(),y={state:o,dispatch:null,action:s,pending:null},p.queue=y,u=NO.bind(null,bt,y,T,u),y.dispatch=u,p.memoizedState=s,[o,u,!1]}function QE(s){var o=Cn();return WE(o,Yt,s)}function WE(s,o,u){if(o=Gm(s,o,XE)[0],s=Fd(Gs)[0],typeof o=="object"&&o!==null&&typeof o.then=="function")try{var p=wu(o)}catch(O){throw O===Xo?Id:O}else p=o;o=Cn();var y=o.queue,T=y.dispatch;return u!==o.memoizedState&&(bt.flags|=2048,Jo(9,{destroy:void 0},AO.bind(null,y,u),null)),[p,T,s]}function AO(s,o){s.action=o}function ZE(s){var o=Cn(),u=Yt;if(u!==null)return WE(o,u,s);Cn(),o=o.memoizedState,u=Cn();var p=u.queue.dispatch;return u.memoizedState=s,[o,p,!1]}function Jo(s,o,u,p){return s={tag:s,create:u,deps:p,inst:o,next:null},o=bt.updateQueue,o===null&&(o=Ud(),bt.updateQueue=o),u=o.lastEffect,u===null?o.lastEffect=s.next=s:(p=u.next,u.next=s,s.next=p,o.lastEffect=s),s}function JE(){return Cn().memoizedState}function $d(s,o,u,p){var y=cr();bt.flags|=s,y.memoizedState=Jo(1|o,{destroy:void 0},u,p===void 0?null:p)}function Vd(s,o,u,p){var y=Cn();p=p===void 0?null:p;var T=y.memoizedState.inst;Yt!==null&&p!==null&&zm(p,Yt.memoizedState.deps)?y.memoizedState=Jo(o,T,u,p):(bt.flags|=s,y.memoizedState=Jo(1|o,T,u,p))}function ev(s,o){$d(8390656,8,s,o)}function Wm(s,o){Vd(2048,8,s,o)}function _O(s){bt.flags|=4;var o=bt.updateQueue;if(o===null)o=Ud(),bt.updateQueue=o,o.events=[s];else{var u=o.events;u===null?o.events=[s]:u.push(s)}}function tv(s){var o=Cn().memoizedState;return _O({ref:o,nextImpl:s}),function(){if((Ft&2)!==0)throw Error(r(440));return o.impl.apply(void 0,arguments)}}function nv(s,o){return Vd(4,2,s,o)}function rv(s,o){return Vd(4,4,s,o)}function sv(s,o){if(typeof o=="function"){s=s();var u=o(s);return function(){typeof u=="function"?u():o(null)}}if(o!=null)return s=s(),o.current=s,function(){o.current=null}}function iv(s,o,u){u=u!=null?u.concat([s]):null,Vd(4,4,sv.bind(null,o,s),u)}function Zm(){}function av(s,o){var u=Cn();o=o===void 0?null:o;var p=u.memoizedState;return o!==null&&zm(o,p[1])?p[0]:(u.memoizedState=[s,o],s)}function ov(s,o){var u=Cn();o=o===void 0?null:o;var p=u.memoizedState;if(o!==null&&zm(o,p[1]))return p[0];if(p=s(),Ia){ut(!0);try{s()}finally{ut(!1)}}return u.memoizedState=[p,o],p}function Jm(s,o,u){return u===void 0||(Ys&1073741824)!==0&&(It&261930)===0?s.memoizedState=o:(s.memoizedState=u,s=lT(),bt.lanes|=s,Ii|=s,u)}function lv(s,o,u,p){return Lr(u,o)?u:Qo.current!==null?(s=Jm(s,u,p),Lr(s,o)||(Rn=!0),s):(Ys&42)===0||(Ys&1073741824)!==0&&(It&261930)===0?(Rn=!0,s.memoizedState=u):(s=lT(),bt.lanes|=s,Ii|=s,o)}function uv(s,o,u,p,y){var T=q.p;q.p=T!==0&&8>T?T:8;var O=H.T,z={};H.T=z,ng(s,!1,o,u);try{var ne=y(),be=H.S;if(be!==null&&be(z,ne),ne!==null&&typeof ne=="object"&&typeof ne.then=="function"){var we=CO(ne,p);Nu(s,o,we,Ur(s))}else Nu(s,o,p,Ur(s))}catch(Ae){Nu(s,o,{then:function(){},status:"rejected",reason:Ae},Ur())}finally{q.p=T,O!==null&&z.types!==null&&(O.types=z.types),H.T=O}}function RO(){}function eg(s,o,u,p){if(s.tag!==5)throw Error(r(476));var y=cv(s).queue;uv(s,y,o,J,u===null?RO:function(){return dv(s),u(p)})}function cv(s){var o=s.memoizedState;if(o!==null)return o;o={memoizedState:J,baseState:J,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Gs,lastRenderedState:J},next:null};var u={};return o.next={memoizedState:u,baseState:u,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Gs,lastRenderedState:u},next:null},s.memoizedState=o,s=s.alternate,s!==null&&(s.memoizedState=o),o}function dv(s){var o=cv(s);o.next===null&&(o=s.alternate.memoizedState),Nu(s,o.next.queue,{},Ur())}function tg(){return Wn(Vu)}function fv(){return Cn().memoizedState}function hv(){return Cn().memoizedState}function OO(s){for(var o=s.return;o!==null;){switch(o.tag){case 24:case 3:var u=Ur();s=wi(u);var p=Ni(o,s,u);p!==null&&(wr(p,o,u),Tu(p,o,u)),o={cache:Rm()},s.payload=o;return}o=o.return}}function IO(s,o,u){var p=Ur();u={lane:p,revertLane:0,gesture:null,action:u,hasEagerState:!1,eagerState:null,next:null},qd(s)?mv(o,u):(u=ym(s,o,u,p),u!==null&&(wr(u,s,p),gv(u,o,p)))}function pv(s,o,u){var p=Ur();Nu(s,o,u,p)}function Nu(s,o,u,p){var y={lane:p,revertLane:0,gesture:null,action:u,hasEagerState:!1,eagerState:null,next:null};if(qd(s))mv(o,y);else{var T=s.alternate;if(s.lanes===0&&(T===null||T.lanes===0)&&(T=o.lastRenderedReducer,T!==null))try{var O=o.lastRenderedState,z=T(O,u);if(y.hasEagerState=!0,y.eagerState=z,Lr(z,O))return kd(s,o,y,0),tn===null&&Cd(),!1}catch{}finally{}if(u=ym(s,o,y,p),u!==null)return wr(u,s,p),gv(u,o,p),!0}return!1}function ng(s,o,u,p){if(p={lane:2,revertLane:Lg(),gesture:null,action:p,hasEagerState:!1,eagerState:null,next:null},qd(s)){if(o)throw Error(r(479))}else o=ym(s,u,p,2),o!==null&&wr(o,s,2)}function qd(s){var o=s.alternate;return s===bt||o!==null&&o===bt}function mv(s,o){Wo=Bd=!0;var u=s.pending;u===null?o.next=o:(o.next=u.next,u.next=o),s.pending=o}function gv(s,o,u){if((u&4194048)!==0){var p=o.lanes;p&=s.pendingLanes,u|=p,o.lanes=u,mn(s,u)}}var Au={readContext:Wn,use:zd,useCallback:xn,useContext:xn,useEffect:xn,useImperativeHandle:xn,useLayoutEffect:xn,useInsertionEffect:xn,useMemo:xn,useReducer:xn,useRef:xn,useState:xn,useDebugValue:xn,useDeferredValue:xn,useTransition:xn,useSyncExternalStore:xn,useId:xn,useHostTransitionStatus:xn,useFormState:xn,useActionState:xn,useOptimistic:xn,useMemoCache:xn,useCacheRefresh:xn};Au.useEffectEvent=xn;var bv={readContext:Wn,use:zd,useCallback:function(s,o){return cr().memoizedState=[s,o===void 0?null:o],s},useContext:Wn,useEffect:ev,useImperativeHandle:function(s,o,u){u=u!=null?u.concat([s]):null,$d(4194308,4,sv.bind(null,o,s),u)},useLayoutEffect:function(s,o){return $d(4194308,4,s,o)},useInsertionEffect:function(s,o){$d(4,2,s,o)},useMemo:function(s,o){var u=cr();o=o===void 0?null:o;var p=s();if(Ia){ut(!0);try{s()}finally{ut(!1)}}return u.memoizedState=[p,o],p},useReducer:function(s,o,u){var p=cr();if(u!==void 0){var y=u(o);if(Ia){ut(!0);try{u(o)}finally{ut(!1)}}}else y=o;return p.memoizedState=p.baseState=y,s={pending:null,lanes:0,dispatch:null,lastRenderedReducer:s,lastRenderedState:y},p.queue=s,s=s.dispatch=IO.bind(null,bt,s),[p.memoizedState,s]},useRef:function(s){var o=cr();return s={current:s},o.memoizedState=s},useState:function(s){s=Km(s);var o=s.queue,u=pv.bind(null,bt,o);return o.dispatch=u,[s.memoizedState,u]},useDebugValue:Zm,useDeferredValue:function(s,o){var u=cr();return Jm(u,s,o)},useTransition:function(){var s=Km(!1);return s=uv.bind(null,bt,s.queue,!0,!1),cr().memoizedState=s,[!1,s]},useSyncExternalStore:function(s,o,u){var p=bt,y=cr();if(Dt){if(u===void 0)throw Error(r(407));u=u()}else{if(u=o(),tn===null)throw Error(r(349));(It&127)!==0||BE(p,o,u)}y.memoizedState=u;var T={value:u,getSnapshot:o};return y.queue=T,ev(UE.bind(null,p,T,s),[s]),p.flags|=2048,Jo(9,{destroy:void 0},HE.bind(null,p,T,u,o),null),u},useId:function(){var s=cr(),o=tn.identifierPrefix;if(Dt){var u=ys,p=xs;u=(p&~(1<<32-Ve(p)-1)).toString(32)+u,o="_"+o+"R_"+u,u=Hd++,0<u&&(o+="H"+u.toString(32)),o+="_"}else u=kO++,o="_"+o+"r_"+u.toString(32)+"_";return s.memoizedState=o},useHostTransitionStatus:tg,useFormState:KE,useActionState:KE,useOptimistic:function(s){var o=cr();o.memoizedState=o.baseState=s;var u={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return o.queue=u,o=ng.bind(null,bt,!0,u),u.dispatch=o,[s,o]},useMemoCache:Ym,useCacheRefresh:function(){return cr().memoizedState=OO.bind(null,bt)},useEffectEvent:function(s){var o=cr(),u={impl:s};return o.memoizedState=u,function(){if((Ft&2)!==0)throw Error(r(440));return u.impl.apply(void 0,arguments)}}},rg={readContext:Wn,use:zd,useCallback:av,useContext:Wn,useEffect:Wm,useImperativeHandle:iv,useInsertionEffect:nv,useLayoutEffect:rv,useMemo:ov,useReducer:Fd,useRef:JE,useState:function(){return Fd(Gs)},useDebugValue:Zm,useDeferredValue:function(s,o){var u=Cn();return lv(u,Yt.memoizedState,s,o)},useTransition:function(){var s=Fd(Gs)[0],o=Cn().memoizedState;return[typeof s=="boolean"?s:wu(s),o]},useSyncExternalStore:jE,useId:fv,useHostTransitionStatus:tg,useFormState:QE,useActionState:QE,useOptimistic:function(s,o){var u=Cn();return $E(u,Yt,s,o)},useMemoCache:Ym,useCacheRefresh:hv};rg.useEffectEvent=tv;var xv={readContext:Wn,use:zd,useCallback:av,useContext:Wn,useEffect:Wm,useImperativeHandle:iv,useInsertionEffect:nv,useLayoutEffect:rv,useMemo:ov,useReducer:Xm,useRef:JE,useState:function(){return Xm(Gs)},useDebugValue:Zm,useDeferredValue:function(s,o){var u=Cn();return Yt===null?Jm(u,s,o):lv(u,Yt.memoizedState,s,o)},useTransition:function(){var s=Xm(Gs)[0],o=Cn().memoizedState;return[typeof s=="boolean"?s:wu(s),o]},useSyncExternalStore:jE,useId:fv,useHostTransitionStatus:tg,useFormState:ZE,useActionState:ZE,useOptimistic:function(s,o){var u=Cn();return Yt!==null?$E(u,Yt,s,o):(u.baseState=s,[s,u.queue.dispatch])},useMemoCache:Ym,useCacheRefresh:hv};xv.useEffectEvent=tv;function sg(s,o,u,p){o=s.memoizedState,u=u(p,o),u=u==null?o:h({},o,u),s.memoizedState=u,s.lanes===0&&(s.updateQueue.baseState=u)}var ig={enqueueSetState:function(s,o,u){s=s._reactInternals;var p=Ur(),y=wi(p);y.payload=o,u!=null&&(y.callback=u),o=Ni(s,y,p),o!==null&&(wr(o,s,p),Tu(o,s,p))},enqueueReplaceState:function(s,o,u){s=s._reactInternals;var p=Ur(),y=wi(p);y.tag=1,y.payload=o,u!=null&&(y.callback=u),o=Ni(s,y,p),o!==null&&(wr(o,s,p),Tu(o,s,p))},enqueueForceUpdate:function(s,o){s=s._reactInternals;var u=Ur(),p=wi(u);p.tag=2,o!=null&&(p.callback=o),o=Ni(s,p,u),o!==null&&(wr(o,s,u),Tu(o,s,u))}};function yv(s,o,u,p,y,T,O){return s=s.stateNode,typeof s.shouldComponentUpdate=="function"?s.shouldComponentUpdate(p,T,O):o.prototype&&o.prototype.isPureReactComponent?!pu(u,p)||!pu(y,T):!0}function Ev(s,o,u,p){s=o.state,typeof o.componentWillReceiveProps=="function"&&o.componentWillReceiveProps(u,p),typeof o.UNSAFE_componentWillReceiveProps=="function"&&o.UNSAFE_componentWillReceiveProps(u,p),o.state!==s&&ig.enqueueReplaceState(o,o.state,null)}function Ma(s,o){var u=o;if("ref"in o){u={};for(var p in o)p!=="ref"&&(u[p]=o[p])}if(s=s.defaultProps){u===o&&(u=h({},u));for(var y in s)u[y]===void 0&&(u[y]=s[y])}return u}function vv(s){Sd(s)}function Tv(s){console.error(s)}function Sv(s){Sd(s)}function Yd(s,o){try{var u=s.onUncaughtError;u(o.value,{componentStack:o.stack})}catch(p){setTimeout(function(){throw p})}}function Cv(s,o,u){try{var p=s.onCaughtError;p(u.value,{componentStack:u.stack,errorBoundary:o.tag===1?o.stateNode:null})}catch(y){setTimeout(function(){throw y})}}function ag(s,o,u){return u=wi(u),u.tag=3,u.payload={element:null},u.callback=function(){Yd(s,o)},u}function kv(s){return s=wi(s),s.tag=3,s}function wv(s,o,u,p){var y=u.type.getDerivedStateFromError;if(typeof y=="function"){var T=p.value;s.payload=function(){return y(T)},s.callback=function(){Cv(o,u,p)}}var O=u.stateNode;O!==null&&typeof O.componentDidCatch=="function"&&(s.callback=function(){Cv(o,u,p),typeof y!="function"&&(Mi===null?Mi=new Set([this]):Mi.add(this));var z=p.stack;this.componentDidCatch(p.value,{componentStack:z!==null?z:""})})}function MO(s,o,u,p,y){if(u.flags|=32768,p!==null&&typeof p=="object"&&typeof p.then=="function"){if(o=u.alternate,o!==null&&qo(o,u,y,!0),u=Pr.current,u!==null){switch(u.tag){case 31:case 13:return es===null?sf():u.alternate===null&&yn===0&&(yn=3),u.flags&=-257,u.flags|=65536,u.lanes=y,p===Md?u.flags|=16384:(o=u.updateQueue,o===null?u.updateQueue=new Set([p]):o.add(p),Og(s,p,y)),!1;case 22:return u.flags|=65536,p===Md?u.flags|=16384:(o=u.updateQueue,o===null?(o={transitions:null,markerInstances:null,retryQueue:new Set([p])},u.updateQueue=o):(u=o.retryQueue,u===null?o.retryQueue=new Set([p]):u.add(p)),Og(s,p,y)),!1}throw Error(r(435,u.tag))}return Og(s,p,y),sf(),!1}if(Dt)return o=Pr.current,o!==null?((o.flags&65536)===0&&(o.flags|=256),o.flags|=65536,o.lanes=y,p!==km&&(s=Error(r(422),{cause:p}),bu(Qr(s,u)))):(p!==km&&(o=Error(r(423),{cause:p}),bu(Qr(o,u))),s=s.current.alternate,s.flags|=65536,y&=-y,s.lanes|=y,p=Qr(p,u),y=ag(s.stateNode,p,y),Pm(s,y),yn!==4&&(yn=2)),!1;var T=Error(r(520),{cause:p});if(T=Qr(T,u),Pu===null?Pu=[T]:Pu.push(T),yn!==4&&(yn=2),o===null)return!0;p=Qr(p,u),u=o;do{switch(u.tag){case 3:return u.flags|=65536,s=y&-y,u.lanes|=s,s=ag(u.stateNode,p,s),Pm(u,s),!1;case 1:if(o=u.type,T=u.stateNode,(u.flags&128)===0&&(typeof o.getDerivedStateFromError=="function"||T!==null&&typeof T.componentDidCatch=="function"&&(Mi===null||!Mi.has(T))))return u.flags|=65536,y&=-y,u.lanes|=y,y=kv(y),wv(y,s,u,p),Pm(u,y),!1}u=u.return}while(u!==null);return!1}var og=Error(r(461)),Rn=!1;function Zn(s,o,u,p){o.child=s===null?RE(o,null,u,p):Oa(o,s.child,u,p)}function Nv(s,o,u,p,y){u=u.render;var T=o.ref;if("ref"in p){var O={};for(var z in p)z!=="ref"&&(O[z]=p[z])}else O=p;return Na(o),p=Fm(s,o,u,O,T,y),z=$m(),s!==null&&!Rn?(Vm(s,o,y),Xs(s,o,y)):(Dt&&z&&Sm(o),o.flags|=1,Zn(s,o,p,y),o.child)}function Av(s,o,u,p,y){if(s===null){var T=u.type;return typeof T=="function"&&!Em(T)&&T.defaultProps===void 0&&u.compare===null?(o.tag=15,o.type=T,_v(s,o,T,p,y)):(s=Nd(u.type,null,p,o,o.mode,y),s.ref=o.ref,s.return=o,o.child=s)}if(T=s.child,!mg(s,y)){var O=T.memoizedProps;if(u=u.compare,u=u!==null?u:pu,u(O,p)&&s.ref===o.ref)return Xs(s,o,y)}return o.flags|=1,s=Fs(T,p),s.ref=o.ref,s.return=o,o.child=s}function _v(s,o,u,p,y){if(s!==null){var T=s.memoizedProps;if(pu(T,p)&&s.ref===o.ref)if(Rn=!1,o.pendingProps=p=T,mg(s,y))(s.flags&131072)!==0&&(Rn=!0);else return o.lanes=s.lanes,Xs(s,o,y)}return lg(s,o,u,p,y)}function Rv(s,o,u,p){var y=p.children,T=s!==null?s.memoizedState:null;if(s===null&&o.stateNode===null&&(o.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),p.mode==="hidden"){if((o.flags&128)!==0){if(T=T!==null?T.baseLanes|u:u,s!==null){for(p=o.child=s.child,y=0;p!==null;)y=y|p.lanes|p.childLanes,p=p.sibling;p=y&~T}else p=0,o.child=null;return Ov(s,o,T,u,p)}if((u&536870912)!==0)o.memoizedState={baseLanes:0,cachePool:null},s!==null&&Od(o,T!==null?T.cachePool:null),T!==null?ME(o,T):Bm(),LE(o);else return p=o.lanes=536870912,Ov(s,o,T!==null?T.baseLanes|u:u,u,p)}else T!==null?(Od(o,T.cachePool),ME(o,T),_i(),o.memoizedState=null):(s!==null&&Od(o,null),Bm(),_i());return Zn(s,o,y,u),o.child}function _u(s,o){return s!==null&&s.tag===22||o.stateNode!==null||(o.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),o.sibling}function Ov(s,o,u,p,y){var T=Im();return T=T===null?null:{parent:An._currentValue,pool:T},o.memoizedState={baseLanes:u,cachePool:T},s!==null&&Od(o,null),Bm(),LE(o),s!==null&&qo(s,o,p,!0),o.childLanes=y,null}function Gd(s,o){return o=Kd({mode:o.mode,children:o.children},s.mode),o.ref=s.ref,s.child=o,o.return=s,o}function Iv(s,o,u){return Oa(o,s.child,null,u),s=Gd(o,o.pendingProps),s.flags|=2,jr(o),o.memoizedState=null,s}function LO(s,o,u){var p=o.pendingProps,y=(o.flags&128)!==0;if(o.flags&=-129,s===null){if(Dt){if(p.mode==="hidden")return s=Gd(o,p),o.lanes=536870912,_u(null,s);if(Um(o),(s=on)?(s=VT(s,Jr),s=s!==null&&s.data==="&"?s:null,s!==null&&(o.memoizedState={dehydrated:s,treeContext:vi!==null?{id:xs,overflow:ys}:null,retryLane:536870912,hydrationErrors:null},u=mE(s),u.return=o,o.child=u,Qn=o,on=null)):s=null,s===null)throw Si(o);return o.lanes=536870912,null}return Gd(o,p)}var T=s.memoizedState;if(T!==null){var O=T.dehydrated;if(Um(o),y)if(o.flags&256)o.flags&=-257,o=Iv(s,o,u);else if(o.memoizedState!==null)o.child=s.child,o.flags|=128,o=null;else throw Error(r(558));else if(Rn||qo(s,o,u,!1),y=(u&s.childLanes)!==0,Rn||y){if(p=tn,p!==null&&(O=Tn(p,u),O!==0&&O!==T.retryLane))throw T.retryLane=O,Sa(s,O),wr(p,s,O),og;sf(),o=Iv(s,o,u)}else s=T.treeContext,on=ts(O.nextSibling),Qn=o,Dt=!0,Ti=null,Jr=!1,s!==null&&xE(o,s),o=Gd(o,p),o.flags|=4096;return o}return s=Fs(s.child,{mode:p.mode,children:p.children}),s.ref=o.ref,o.child=s,s.return=o,s}function Xd(s,o){var u=o.ref;if(u===null)s!==null&&s.ref!==null&&(o.flags|=4194816);else{if(typeof u!="function"&&typeof u!="object")throw Error(r(284));(s===null||s.ref!==u)&&(o.flags|=4194816)}}function lg(s,o,u,p,y){return Na(o),u=Fm(s,o,u,p,void 0,y),p=$m(),s!==null&&!Rn?(Vm(s,o,y),Xs(s,o,y)):(Dt&&p&&Sm(o),o.flags|=1,Zn(s,o,u,y),o.child)}function Mv(s,o,u,p,y,T){return Na(o),o.updateQueue=null,u=PE(o,p,u,y),DE(s),p=$m(),s!==null&&!Rn?(Vm(s,o,T),Xs(s,o,T)):(Dt&&p&&Sm(o),o.flags|=1,Zn(s,o,u,T),o.child)}function Lv(s,o,u,p,y){if(Na(o),o.stateNode===null){var T=zo,O=u.contextType;typeof O=="object"&&O!==null&&(T=Wn(O)),T=new u(p,T),o.memoizedState=T.state!==null&&T.state!==void 0?T.state:null,T.updater=ig,o.stateNode=T,T._reactInternals=o,T=o.stateNode,T.props=p,T.state=o.memoizedState,T.refs={},Lm(o),O=u.contextType,T.context=typeof O=="object"&&O!==null?Wn(O):zo,T.state=o.memoizedState,O=u.getDerivedStateFromProps,typeof O=="function"&&(sg(o,u,O,p),T.state=o.memoizedState),typeof u.getDerivedStateFromProps=="function"||typeof T.getSnapshotBeforeUpdate=="function"||typeof T.UNSAFE_componentWillMount!="function"&&typeof T.componentWillMount!="function"||(O=T.state,typeof T.componentWillMount=="function"&&T.componentWillMount(),typeof T.UNSAFE_componentWillMount=="function"&&T.UNSAFE_componentWillMount(),O!==T.state&&ig.enqueueReplaceState(T,T.state,null),Cu(o,p,T,y),Su(),T.state=o.memoizedState),typeof T.componentDidMount=="function"&&(o.flags|=4194308),p=!0}else if(s===null){T=o.stateNode;var z=o.memoizedProps,ne=Ma(u,z);T.props=ne;var be=T.context,we=u.contextType;O=zo,typeof we=="object"&&we!==null&&(O=Wn(we));var Ae=u.getDerivedStateFromProps;we=typeof Ae=="function"||typeof T.getSnapshotBeforeUpdate=="function",z=o.pendingProps!==z,we||typeof T.UNSAFE_componentWillReceiveProps!="function"&&typeof T.componentWillReceiveProps!="function"||(z||be!==O)&&Ev(o,T,p,O),ki=!1;var xe=o.memoizedState;T.state=xe,Cu(o,p,T,y),Su(),be=o.memoizedState,z||xe!==be||ki?(typeof Ae=="function"&&(sg(o,u,Ae,p),be=o.memoizedState),(ne=ki||yv(o,u,ne,p,xe,be,O))?(we||typeof T.UNSAFE_componentWillMount!="function"&&typeof T.componentWillMount!="function"||(typeof T.componentWillMount=="function"&&T.componentWillMount(),typeof T.UNSAFE_componentWillMount=="function"&&T.UNSAFE_componentWillMount()),typeof T.componentDidMount=="function"&&(o.flags|=4194308)):(typeof T.componentDidMount=="function"&&(o.flags|=4194308),o.memoizedProps=p,o.memoizedState=be),T.props=p,T.state=be,T.context=O,p=ne):(typeof T.componentDidMount=="function"&&(o.flags|=4194308),p=!1)}else{T=o.stateNode,Dm(s,o),O=o.memoizedProps,we=Ma(u,O),T.props=we,Ae=o.pendingProps,xe=T.context,be=u.contextType,ne=zo,typeof be=="object"&&be!==null&&(ne=Wn(be)),z=u.getDerivedStateFromProps,(be=typeof z=="function"||typeof T.getSnapshotBeforeUpdate=="function")||typeof T.UNSAFE_componentWillReceiveProps!="function"&&typeof T.componentWillReceiveProps!="function"||(O!==Ae||xe!==ne)&&Ev(o,T,p,ne),ki=!1,xe=o.memoizedState,T.state=xe,Cu(o,p,T,y),Su();var Te=o.memoizedState;O!==Ae||xe!==Te||ki||s!==null&&s.dependencies!==null&&_d(s.dependencies)?(typeof z=="function"&&(sg(o,u,z,p),Te=o.memoizedState),(we=ki||yv(o,u,we,p,xe,Te,ne)||s!==null&&s.dependencies!==null&&_d(s.dependencies))?(be||typeof T.UNSAFE_componentWillUpdate!="function"&&typeof T.componentWillUpdate!="function"||(typeof T.componentWillUpdate=="function"&&T.componentWillUpdate(p,Te,ne),typeof T.UNSAFE_componentWillUpdate=="function"&&T.UNSAFE_componentWillUpdate(p,Te,ne)),typeof T.componentDidUpdate=="function"&&(o.flags|=4),typeof T.getSnapshotBeforeUpdate=="function"&&(o.flags|=1024)):(typeof T.componentDidUpdate!="function"||O===s.memoizedProps&&xe===s.memoizedState||(o.flags|=4),typeof T.getSnapshotBeforeUpdate!="function"||O===s.memoizedProps&&xe===s.memoizedState||(o.flags|=1024),o.memoizedProps=p,o.memoizedState=Te),T.props=p,T.state=Te,T.context=ne,p=we):(typeof T.componentDidUpdate!="function"||O===s.memoizedProps&&xe===s.memoizedState||(o.flags|=4),typeof T.getSnapshotBeforeUpdate!="function"||O===s.memoizedProps&&xe===s.memoizedState||(o.flags|=1024),p=!1)}return T=p,Xd(s,o),p=(o.flags&128)!==0,T||p?(T=o.stateNode,u=p&&typeof u.getDerivedStateFromError!="function"?null:T.render(),o.flags|=1,s!==null&&p?(o.child=Oa(o,s.child,null,y),o.child=Oa(o,null,u,y)):Zn(s,o,u,y),o.memoizedState=T.state,s=o.child):s=Xs(s,o,y),s}function Dv(s,o,u,p){return ka(),o.flags|=256,Zn(s,o,u,p),o.child}var ug={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function cg(s){return{baseLanes:s,cachePool:CE()}}function dg(s,o,u){return s=s!==null?s.childLanes&~u:0,o&&(s|=Hr),s}function Pv(s,o,u){var p=o.pendingProps,y=!1,T=(o.flags&128)!==0,O;if((O=T)||(O=s!==null&&s.memoizedState===null?!1:(Sn.current&2)!==0),O&&(y=!0,o.flags&=-129),O=(o.flags&32)!==0,o.flags&=-33,s===null){if(Dt){if(y?Ai(o):_i(),(s=on)?(s=VT(s,Jr),s=s!==null&&s.data!=="&"?s:null,s!==null&&(o.memoizedState={dehydrated:s,treeContext:vi!==null?{id:xs,overflow:ys}:null,retryLane:536870912,hydrationErrors:null},u=mE(s),u.return=o,o.child=u,Qn=o,on=null)):s=null,s===null)throw Si(o);return Gg(s)?o.lanes=32:o.lanes=536870912,null}var z=p.children;return p=p.fallback,y?(_i(),y=o.mode,z=Kd({mode:"hidden",children:z},y),p=Ca(p,y,u,null),z.return=o,p.return=o,z.sibling=p,o.child=z,p=o.child,p.memoizedState=cg(u),p.childLanes=dg(s,O,u),o.memoizedState=ug,_u(null,p)):(Ai(o),fg(o,z))}var ne=s.memoizedState;if(ne!==null&&(z=ne.dehydrated,z!==null)){if(T)o.flags&256?(Ai(o),o.flags&=-257,o=hg(s,o,u)):o.memoizedState!==null?(_i(),o.child=s.child,o.flags|=128,o=null):(_i(),z=p.fallback,y=o.mode,p=Kd({mode:"visible",children:p.children},y),z=Ca(z,y,u,null),z.flags|=2,p.return=o,z.return=o,p.sibling=z,o.child=p,Oa(o,s.child,null,u),p=o.child,p.memoizedState=cg(u),p.childLanes=dg(s,O,u),o.memoizedState=ug,o=_u(null,p));else if(Ai(o),Gg(z)){if(O=z.nextSibling&&z.nextSibling.dataset,O)var be=O.dgst;O=be,p=Error(r(419)),p.stack="",p.digest=O,bu({value:p,source:null,stack:null}),o=hg(s,o,u)}else if(Rn||qo(s,o,u,!1),O=(u&s.childLanes)!==0,Rn||O){if(O=tn,O!==null&&(p=Tn(O,u),p!==0&&p!==ne.retryLane))throw ne.retryLane=p,Sa(s,p),wr(O,s,p),og;Yg(z)||sf(),o=hg(s,o,u)}else Yg(z)?(o.flags|=192,o.child=s.child,o=null):(s=ne.treeContext,on=ts(z.nextSibling),Qn=o,Dt=!0,Ti=null,Jr=!1,s!==null&&xE(o,s),o=fg(o,p.children),o.flags|=4096);return o}return y?(_i(),z=p.fallback,y=o.mode,ne=s.child,be=ne.sibling,p=Fs(ne,{mode:"hidden",children:p.children}),p.subtreeFlags=ne.subtreeFlags&65011712,be!==null?z=Fs(be,z):(z=Ca(z,y,u,null),z.flags|=2),z.return=o,p.return=o,p.sibling=z,o.child=p,_u(null,p),p=o.child,z=s.child.memoizedState,z===null?z=cg(u):(y=z.cachePool,y!==null?(ne=An._currentValue,y=y.parent!==ne?{parent:ne,pool:ne}:y):y=CE(),z={baseLanes:z.baseLanes|u,cachePool:y}),p.memoizedState=z,p.childLanes=dg(s,O,u),o.memoizedState=ug,_u(s.child,p)):(Ai(o),u=s.child,s=u.sibling,u=Fs(u,{mode:"visible",children:p.children}),u.return=o,u.sibling=null,s!==null&&(O=o.deletions,O===null?(o.deletions=[s],o.flags|=16):O.push(s)),o.child=u,o.memoizedState=null,u)}function fg(s,o){return o=Kd({mode:"visible",children:o},s.mode),o.return=s,s.child=o}function Kd(s,o){return s=Dr(22,s,null,o),s.lanes=0,s}function hg(s,o,u){return Oa(o,s.child,null,u),s=fg(o,o.pendingProps.children),s.flags|=2,o.memoizedState=null,s}function jv(s,o,u){s.lanes|=o;var p=s.alternate;p!==null&&(p.lanes|=o),Am(s.return,o,u)}function pg(s,o,u,p,y,T){var O=s.memoizedState;O===null?s.memoizedState={isBackwards:o,rendering:null,renderingStartTime:0,last:p,tail:u,tailMode:y,treeForkCount:T}:(O.isBackwards=o,O.rendering=null,O.renderingStartTime=0,O.last=p,O.tail=u,O.tailMode=y,O.treeForkCount=T)}function Bv(s,o,u){var p=o.pendingProps,y=p.revealOrder,T=p.tail;p=p.children;var O=Sn.current,z=(O&2)!==0;if(z?(O=O&1|2,o.flags|=128):O&=1,P(Sn,O),Zn(s,o,p,u),p=Dt?gu:0,!z&&s!==null&&(s.flags&128)!==0)e:for(s=o.child;s!==null;){if(s.tag===13)s.memoizedState!==null&&jv(s,u,o);else if(s.tag===19)jv(s,u,o);else if(s.child!==null){s.child.return=s,s=s.child;continue}if(s===o)break e;for(;s.sibling===null;){if(s.return===null||s.return===o)break e;s=s.return}s.sibling.return=s.return,s=s.sibling}switch(y){case"forwards":for(u=o.child,y=null;u!==null;)s=u.alternate,s!==null&&jd(s)===null&&(y=u),u=u.sibling;u=y,u===null?(y=o.child,o.child=null):(y=u.sibling,u.sibling=null),pg(o,!1,y,u,T,p);break;case"backwards":case"unstable_legacy-backwards":for(u=null,y=o.child,o.child=null;y!==null;){if(s=y.alternate,s!==null&&jd(s)===null){o.child=y;break}s=y.sibling,y.sibling=u,u=y,y=s}pg(o,!0,u,null,T,p);break;case"together":pg(o,!1,null,null,void 0,p);break;default:o.memoizedState=null}return o.child}function Xs(s,o,u){if(s!==null&&(o.dependencies=s.dependencies),Ii|=o.lanes,(u&o.childLanes)===0)if(s!==null){if(qo(s,o,u,!1),(u&o.childLanes)===0)return null}else return null;if(s!==null&&o.child!==s.child)throw Error(r(153));if(o.child!==null){for(s=o.child,u=Fs(s,s.pendingProps),o.child=u,u.return=o;s.sibling!==null;)s=s.sibling,u=u.sibling=Fs(s,s.pendingProps),u.return=o;u.sibling=null}return o.child}function mg(s,o){return(s.lanes&o)!==0?!0:(s=s.dependencies,!!(s!==null&&_d(s)))}function DO(s,o,u){switch(o.tag){case 3:he(o,o.stateNode.containerInfo),Ci(o,An,s.memoizedState.cache),ka();break;case 27:case 5:Fe(o);break;case 4:he(o,o.stateNode.containerInfo);break;case 10:Ci(o,o.type,o.memoizedProps.value);break;case 31:if(o.memoizedState!==null)return o.flags|=128,Um(o),null;break;case 13:var p=o.memoizedState;if(p!==null)return p.dehydrated!==null?(Ai(o),o.flags|=128,null):(u&o.child.childLanes)!==0?Pv(s,o,u):(Ai(o),s=Xs(s,o,u),s!==null?s.sibling:null);Ai(o);break;case 19:var y=(s.flags&128)!==0;if(p=(u&o.childLanes)!==0,p||(qo(s,o,u,!1),p=(u&o.childLanes)!==0),y){if(p)return Bv(s,o,u);o.flags|=128}if(y=o.memoizedState,y!==null&&(y.rendering=null,y.tail=null,y.lastEffect=null),P(Sn,Sn.current),p)break;return null;case 22:return o.lanes=0,Rv(s,o,u,o.pendingProps);case 24:Ci(o,An,s.memoizedState.cache)}return Xs(s,o,u)}function Hv(s,o,u){if(s!==null)if(s.memoizedProps!==o.pendingProps)Rn=!0;else{if(!mg(s,u)&&(o.flags&128)===0)return Rn=!1,DO(s,o,u);Rn=(s.flags&131072)!==0}else Rn=!1,Dt&&(o.flags&1048576)!==0&&bE(o,gu,o.index);switch(o.lanes=0,o.tag){case 16:e:{var p=o.pendingProps;if(s=_a(o.elementType),o.type=s,typeof s=="function")Em(s)?(p=Ma(s,p),o.tag=1,o=Lv(null,o,s,p,u)):(o.tag=0,o=lg(null,o,s,p,u));else{if(s!=null){var y=s.$$typeof;if(y===R){o.tag=11,o=Nv(null,o,s,p,u);break e}else if(y===D){o.tag=14,o=Av(null,o,s,p,u);break e}}throw o=W(s)||s,Error(r(306,o,""))}}return o;case 0:return lg(s,o,o.type,o.pendingProps,u);case 1:return p=o.type,y=Ma(p,o.pendingProps),Lv(s,o,p,y,u);case 3:e:{if(he(o,o.stateNode.containerInfo),s===null)throw Error(r(387));p=o.pendingProps;var T=o.memoizedState;y=T.element,Dm(s,o),Cu(o,p,null,u);var O=o.memoizedState;if(p=O.cache,Ci(o,An,p),p!==T.cache&&_m(o,[An],u,!0),Su(),p=O.element,T.isDehydrated)if(T={element:p,isDehydrated:!1,cache:O.cache},o.updateQueue.baseState=T,o.memoizedState=T,o.flags&256){o=Dv(s,o,p,u);break e}else if(p!==y){y=Qr(Error(r(424)),o),bu(y),o=Dv(s,o,p,u);break e}else{switch(s=o.stateNode.containerInfo,s.nodeType){case 9:s=s.body;break;default:s=s.nodeName==="HTML"?s.ownerDocument.body:s}for(on=ts(s.firstChild),Qn=o,Dt=!0,Ti=null,Jr=!0,u=RE(o,null,p,u),o.child=u;u;)u.flags=u.flags&-3|4096,u=u.sibling}else{if(ka(),p===y){o=Xs(s,o,u);break e}Zn(s,o,p,u)}o=o.child}return o;case 26:return Xd(s,o),s===null?(u=QT(o.type,null,o.pendingProps,null))?o.memoizedState=u:Dt||(u=o.type,s=o.pendingProps,p=ff(ce.current).createElement(u),p[en]=o,p[Kn]=s,Jn(p,u,s),zn(p),o.stateNode=p):o.memoizedState=QT(o.type,s.memoizedProps,o.pendingProps,s.memoizedState),null;case 27:return Fe(o),s===null&&Dt&&(p=o.stateNode=GT(o.type,o.pendingProps,ce.current),Qn=o,Jr=!0,y=on,ji(o.type)?(Xg=y,on=ts(p.firstChild)):on=y),Zn(s,o,o.pendingProps.children,u),Xd(s,o),s===null&&(o.flags|=4194304),o.child;case 5:return s===null&&Dt&&((y=p=on)&&(p=dI(p,o.type,o.pendingProps,Jr),p!==null?(o.stateNode=p,Qn=o,on=ts(p.firstChild),Jr=!1,y=!0):y=!1),y||Si(o)),Fe(o),y=o.type,T=o.pendingProps,O=s!==null?s.memoizedProps:null,p=T.children,$g(y,T)?p=null:O!==null&&$g(y,O)&&(o.flags|=32),o.memoizedState!==null&&(y=Fm(s,o,wO,null,null,u),Vu._currentValue=y),Xd(s,o),Zn(s,o,p,u),o.child;case 6:return s===null&&Dt&&((s=u=on)&&(u=fI(u,o.pendingProps,Jr),u!==null?(o.stateNode=u,Qn=o,on=null,s=!0):s=!1),s||Si(o)),null;case 13:return Pv(s,o,u);case 4:return he(o,o.stateNode.containerInfo),p=o.pendingProps,s===null?o.child=Oa(o,null,p,u):Zn(s,o,p,u),o.child;case 11:return Nv(s,o,o.type,o.pendingProps,u);case 7:return Zn(s,o,o.pendingProps,u),o.child;case 8:return Zn(s,o,o.pendingProps.children,u),o.child;case 12:return Zn(s,o,o.pendingProps.children,u),o.child;case 10:return p=o.pendingProps,Ci(o,o.type,p.value),Zn(s,o,p.children,u),o.child;case 9:return y=o.type._context,p=o.pendingProps.children,Na(o),y=Wn(y),p=p(y),o.flags|=1,Zn(s,o,p,u),o.child;case 14:return Av(s,o,o.type,o.pendingProps,u);case 15:return _v(s,o,o.type,o.pendingProps,u);case 19:return Bv(s,o,u);case 31:return LO(s,o,u);case 22:return Rv(s,o,u,o.pendingProps);case 24:return Na(o),p=Wn(An),s===null?(y=Im(),y===null&&(y=tn,T=Rm(),y.pooledCache=T,T.refCount++,T!==null&&(y.pooledCacheLanes|=u),y=T),o.memoizedState={parent:p,cache:y},Lm(o),Ci(o,An,y)):((s.lanes&u)!==0&&(Dm(s,o),Cu(o,null,null,u),Su()),y=s.memoizedState,T=o.memoizedState,y.parent!==p?(y={parent:p,cache:p},o.memoizedState=y,o.lanes===0&&(o.memoizedState=o.updateQueue.baseState=y),Ci(o,An,p)):(p=T.cache,Ci(o,An,p),p!==y.cache&&_m(o,[An],u,!0))),Zn(s,o,o.pendingProps.children,u),o.child;case 29:throw o.pendingProps}throw Error(r(156,o.tag))}function Ks(s){s.flags|=4}function gg(s,o,u,p,y){if((o=(s.mode&32)!==0)&&(o=!1),o){if(s.flags|=16777216,(y&335544128)===y)if(s.stateNode.complete)s.flags|=8192;else if(fT())s.flags|=8192;else throw Ra=Md,Mm}else s.flags&=-16777217}function Uv(s,o){if(o.type!=="stylesheet"||(o.state.loading&4)!==0)s.flags&=-16777217;else if(s.flags|=16777216,!t2(o))if(fT())s.flags|=8192;else throw Ra=Md,Mm}function Qd(s,o){o!==null&&(s.flags|=4),s.flags&16384&&(o=s.tag!==22?Jt():536870912,s.lanes|=o,rl|=o)}function Ru(s,o){if(!Dt)switch(s.tailMode){case"hidden":o=s.tail;for(var u=null;o!==null;)o.alternate!==null&&(u=o),o=o.sibling;u===null?s.tail=null:u.sibling=null;break;case"collapsed":u=s.tail;for(var p=null;u!==null;)u.alternate!==null&&(p=u),u=u.sibling;p===null?o||s.tail===null?s.tail=null:s.tail.sibling=null:p.sibling=null}}function ln(s){var o=s.alternate!==null&&s.alternate.child===s.child,u=0,p=0;if(o)for(var y=s.child;y!==null;)u|=y.lanes|y.childLanes,p|=y.subtreeFlags&65011712,p|=y.flags&65011712,y.return=s,y=y.sibling;else for(y=s.child;y!==null;)u|=y.lanes|y.childLanes,p|=y.subtreeFlags,p|=y.flags,y.return=s,y=y.sibling;return s.subtreeFlags|=p,s.childLanes=u,o}function PO(s,o,u){var p=o.pendingProps;switch(Cm(o),o.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return ln(o),null;case 1:return ln(o),null;case 3:return u=o.stateNode,p=null,s!==null&&(p=s.memoizedState.cache),o.memoizedState.cache!==p&&(o.flags|=2048),qs(An),ve(),u.pendingContext&&(u.context=u.pendingContext,u.pendingContext=null),(s===null||s.child===null)&&(Vo(o)?Ks(o):s===null||s.memoizedState.isDehydrated&&(o.flags&256)===0||(o.flags|=1024,wm())),ln(o),null;case 26:var y=o.type,T=o.memoizedState;return s===null?(Ks(o),T!==null?(ln(o),Uv(o,T)):(ln(o),gg(o,y,null,p,u))):T?T!==s.memoizedState?(Ks(o),ln(o),Uv(o,T)):(ln(o),o.flags&=-16777217):(s=s.memoizedProps,s!==p&&Ks(o),ln(o),gg(o,y,s,p,u)),null;case 27:if(Le(o),u=ce.current,y=o.type,s!==null&&o.stateNode!=null)s.memoizedProps!==p&&Ks(o);else{if(!p){if(o.stateNode===null)throw Error(r(166));return ln(o),null}s=ae.current,Vo(o)?yE(o):(s=GT(y,p,u),o.stateNode=s,Ks(o))}return ln(o),null;case 5:if(Le(o),y=o.type,s!==null&&o.stateNode!=null)s.memoizedProps!==p&&Ks(o);else{if(!p){if(o.stateNode===null)throw Error(r(166));return ln(o),null}if(T=ae.current,Vo(o))yE(o);else{var O=ff(ce.current);switch(T){case 1:T=O.createElementNS("http://www.w3.org/2000/svg",y);break;case 2:T=O.createElementNS("http://www.w3.org/1998/Math/MathML",y);break;default:switch(y){case"svg":T=O.createElementNS("http://www.w3.org/2000/svg",y);break;case"math":T=O.createElementNS("http://www.w3.org/1998/Math/MathML",y);break;case"script":T=O.createElement("div"),T.innerHTML="<script><\/script>",T=T.removeChild(T.firstChild);break;case"select":T=typeof p.is=="string"?O.createElement("select",{is:p.is}):O.createElement("select"),p.multiple?T.multiple=!0:p.size&&(T.size=p.size);break;default:T=typeof p.is=="string"?O.createElement(y,{is:p.is}):O.createElement(y)}}T[en]=o,T[Kn]=p;e:for(O=o.child;O!==null;){if(O.tag===5||O.tag===6)T.appendChild(O.stateNode);else if(O.tag!==4&&O.tag!==27&&O.child!==null){O.child.return=O,O=O.child;continue}if(O===o)break e;for(;O.sibling===null;){if(O.return===null||O.return===o)break e;O=O.return}O.sibling.return=O.return,O=O.sibling}o.stateNode=T;e:switch(Jn(T,y,p),y){case"button":case"input":case"select":case"textarea":p=!!p.autoFocus;break e;case"img":p=!0;break e;default:p=!1}p&&Ks(o)}}return ln(o),gg(o,o.type,s===null?null:s.memoizedProps,o.pendingProps,u),null;case 6:if(s&&o.stateNode!=null)s.memoizedProps!==p&&Ks(o);else{if(typeof p!="string"&&o.stateNode===null)throw Error(r(166));if(s=ce.current,Vo(o)){if(s=o.stateNode,u=o.memoizedProps,p=null,y=Qn,y!==null)switch(y.tag){case 27:case 5:p=y.memoizedProps}s[en]=o,s=!!(s.nodeValue===u||p!==null&&p.suppressHydrationWarning===!0||PT(s.nodeValue,u)),s||Si(o,!0)}else s=ff(s).createTextNode(p),s[en]=o,o.stateNode=s}return ln(o),null;case 31:if(u=o.memoizedState,s===null||s.memoizedState!==null){if(p=Vo(o),u!==null){if(s===null){if(!p)throw Error(r(318));if(s=o.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(r(557));s[en]=o}else ka(),(o.flags&128)===0&&(o.memoizedState=null),o.flags|=4;ln(o),s=!1}else u=wm(),s!==null&&s.memoizedState!==null&&(s.memoizedState.hydrationErrors=u),s=!0;if(!s)return o.flags&256?(jr(o),o):(jr(o),null);if((o.flags&128)!==0)throw Error(r(558))}return ln(o),null;case 13:if(p=o.memoizedState,s===null||s.memoizedState!==null&&s.memoizedState.dehydrated!==null){if(y=Vo(o),p!==null&&p.dehydrated!==null){if(s===null){if(!y)throw Error(r(318));if(y=o.memoizedState,y=y!==null?y.dehydrated:null,!y)throw Error(r(317));y[en]=o}else ka(),(o.flags&128)===0&&(o.memoizedState=null),o.flags|=4;ln(o),y=!1}else y=wm(),s!==null&&s.memoizedState!==null&&(s.memoizedState.hydrationErrors=y),y=!0;if(!y)return o.flags&256?(jr(o),o):(jr(o),null)}return jr(o),(o.flags&128)!==0?(o.lanes=u,o):(u=p!==null,s=s!==null&&s.memoizedState!==null,u&&(p=o.child,y=null,p.alternate!==null&&p.alternate.memoizedState!==null&&p.alternate.memoizedState.cachePool!==null&&(y=p.alternate.memoizedState.cachePool.pool),T=null,p.memoizedState!==null&&p.memoizedState.cachePool!==null&&(T=p.memoizedState.cachePool.pool),T!==y&&(p.flags|=2048)),u!==s&&u&&(o.child.flags|=8192),Qd(o,o.updateQueue),ln(o),null);case 4:return ve(),s===null&&Bg(o.stateNode.containerInfo),ln(o),null;case 10:return qs(o.type),ln(o),null;case 19:if(G(Sn),p=o.memoizedState,p===null)return ln(o),null;if(y=(o.flags&128)!==0,T=p.rendering,T===null)if(y)Ru(p,!1);else{if(yn!==0||s!==null&&(s.flags&128)!==0)for(s=o.child;s!==null;){if(T=jd(s),T!==null){for(o.flags|=128,Ru(p,!1),s=T.updateQueue,o.updateQueue=s,Qd(o,s),o.subtreeFlags=0,s=u,u=o.child;u!==null;)pE(u,s),u=u.sibling;return P(Sn,Sn.current&1|2),Dt&&$s(o,p.treeForkCount),o.child}s=s.sibling}p.tail!==null&&se()>tf&&(o.flags|=128,y=!0,Ru(p,!1),o.lanes=4194304)}else{if(!y)if(s=jd(T),s!==null){if(o.flags|=128,y=!0,s=s.updateQueue,o.updateQueue=s,Qd(o,s),Ru(p,!0),p.tail===null&&p.tailMode==="hidden"&&!T.alternate&&!Dt)return ln(o),null}else 2*se()-p.renderingStartTime>tf&&u!==536870912&&(o.flags|=128,y=!0,Ru(p,!1),o.lanes=4194304);p.isBackwards?(T.sibling=o.child,o.child=T):(s=p.last,s!==null?s.sibling=T:o.child=T,p.last=T)}return p.tail!==null?(s=p.tail,p.rendering=s,p.tail=s.sibling,p.renderingStartTime=se(),s.sibling=null,u=Sn.current,P(Sn,y?u&1|2:u&1),Dt&&$s(o,p.treeForkCount),s):(ln(o),null);case 22:case 23:return jr(o),Hm(),p=o.memoizedState!==null,s!==null?s.memoizedState!==null!==p&&(o.flags|=8192):p&&(o.flags|=8192),p?(u&536870912)!==0&&(o.flags&128)===0&&(ln(o),o.subtreeFlags&6&&(o.flags|=8192)):ln(o),u=o.updateQueue,u!==null&&Qd(o,u.retryQueue),u=null,s!==null&&s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(u=s.memoizedState.cachePool.pool),p=null,o.memoizedState!==null&&o.memoizedState.cachePool!==null&&(p=o.memoizedState.cachePool.pool),p!==u&&(o.flags|=2048),s!==null&&G(Aa),null;case 24:return u=null,s!==null&&(u=s.memoizedState.cache),o.memoizedState.cache!==u&&(o.flags|=2048),qs(An),ln(o),null;case 25:return null;case 30:return null}throw Error(r(156,o.tag))}function jO(s,o){switch(Cm(o),o.tag){case 1:return s=o.flags,s&65536?(o.flags=s&-65537|128,o):null;case 3:return qs(An),ve(),s=o.flags,(s&65536)!==0&&(s&128)===0?(o.flags=s&-65537|128,o):null;case 26:case 27:case 5:return Le(o),null;case 31:if(o.memoizedState!==null){if(jr(o),o.alternate===null)throw Error(r(340));ka()}return s=o.flags,s&65536?(o.flags=s&-65537|128,o):null;case 13:if(jr(o),s=o.memoizedState,s!==null&&s.dehydrated!==null){if(o.alternate===null)throw Error(r(340));ka()}return s=o.flags,s&65536?(o.flags=s&-65537|128,o):null;case 19:return G(Sn),null;case 4:return ve(),null;case 10:return qs(o.type),null;case 22:case 23:return jr(o),Hm(),s!==null&&G(Aa),s=o.flags,s&65536?(o.flags=s&-65537|128,o):null;case 24:return qs(An),null;case 25:return null;default:return null}}function zv(s,o){switch(Cm(o),o.tag){case 3:qs(An),ve();break;case 26:case 27:case 5:Le(o);break;case 4:ve();break;case 31:o.memoizedState!==null&&jr(o);break;case 13:jr(o);break;case 19:G(Sn);break;case 10:qs(o.type);break;case 22:case 23:jr(o),Hm(),s!==null&&G(Aa);break;case 24:qs(An)}}function Ou(s,o){try{var u=o.updateQueue,p=u!==null?u.lastEffect:null;if(p!==null){var y=p.next;u=y;do{if((u.tag&s)===s){p=void 0;var T=u.create,O=u.inst;p=T(),O.destroy=p}u=u.next}while(u!==y)}}catch(z){qt(o,o.return,z)}}function Ri(s,o,u){try{var p=o.updateQueue,y=p!==null?p.lastEffect:null;if(y!==null){var T=y.next;p=T;do{if((p.tag&s)===s){var O=p.inst,z=O.destroy;if(z!==void 0){O.destroy=void 0,y=o;var ne=u,be=z;try{be()}catch(we){qt(y,ne,we)}}}p=p.next}while(p!==T)}}catch(we){qt(o,o.return,we)}}function Fv(s){var o=s.updateQueue;if(o!==null){var u=s.stateNode;try{IE(o,u)}catch(p){qt(s,s.return,p)}}}function $v(s,o,u){u.props=Ma(s.type,s.memoizedProps),u.state=s.memoizedState;try{u.componentWillUnmount()}catch(p){qt(s,o,p)}}function Iu(s,o){try{var u=s.ref;if(u!==null){switch(s.tag){case 26:case 27:case 5:var p=s.stateNode;break;case 30:p=s.stateNode;break;default:p=s.stateNode}typeof u=="function"?s.refCleanup=u(p):u.current=p}}catch(y){qt(s,o,y)}}function Es(s,o){var u=s.ref,p=s.refCleanup;if(u!==null)if(typeof p=="function")try{p()}catch(y){qt(s,o,y)}finally{s.refCleanup=null,s=s.alternate,s!=null&&(s.refCleanup=null)}else if(typeof u=="function")try{u(null)}catch(y){qt(s,o,y)}else u.current=null}function Vv(s){var o=s.type,u=s.memoizedProps,p=s.stateNode;try{e:switch(o){case"button":case"input":case"select":case"textarea":u.autoFocus&&p.focus();break e;case"img":u.src?p.src=u.src:u.srcSet&&(p.srcset=u.srcSet)}}catch(y){qt(s,s.return,y)}}function bg(s,o,u){try{var p=s.stateNode;iI(p,s.type,u,o),p[Kn]=o}catch(y){qt(s,s.return,y)}}function qv(s){return s.tag===5||s.tag===3||s.tag===26||s.tag===27&&ji(s.type)||s.tag===4}function xg(s){e:for(;;){for(;s.sibling===null;){if(s.return===null||qv(s.return))return null;s=s.return}for(s.sibling.return=s.return,s=s.sibling;s.tag!==5&&s.tag!==6&&s.tag!==18;){if(s.tag===27&&ji(s.type)||s.flags&2||s.child===null||s.tag===4)continue e;s.child.return=s,s=s.child}if(!(s.flags&2))return s.stateNode}}function yg(s,o,u){var p=s.tag;if(p===5||p===6)s=s.stateNode,o?(u.nodeType===9?u.body:u.nodeName==="HTML"?u.ownerDocument.body:u).insertBefore(s,o):(o=u.nodeType===9?u.body:u.nodeName==="HTML"?u.ownerDocument.body:u,o.appendChild(s),u=u._reactRootContainer,u!=null||o.onclick!==null||(o.onclick=Us));else if(p!==4&&(p===27&&ji(s.type)&&(u=s.stateNode,o=null),s=s.child,s!==null))for(yg(s,o,u),s=s.sibling;s!==null;)yg(s,o,u),s=s.sibling}function Wd(s,o,u){var p=s.tag;if(p===5||p===6)s=s.stateNode,o?u.insertBefore(s,o):u.appendChild(s);else if(p!==4&&(p===27&&ji(s.type)&&(u=s.stateNode),s=s.child,s!==null))for(Wd(s,o,u),s=s.sibling;s!==null;)Wd(s,o,u),s=s.sibling}function Yv(s){var o=s.stateNode,u=s.memoizedProps;try{for(var p=s.type,y=o.attributes;y.length;)o.removeAttributeNode(y[0]);Jn(o,p,u),o[en]=s,o[Kn]=u}catch(T){qt(s,s.return,T)}}var Qs=!1,On=!1,Eg=!1,Gv=typeof WeakSet=="function"?WeakSet:Set,Fn=null;function BO(s,o){if(s=s.containerInfo,zg=yf,s=iE(s),hm(s)){if("selectionStart"in s)var u={start:s.selectionStart,end:s.selectionEnd};else e:{u=(u=s.ownerDocument)&&u.defaultView||window;var p=u.getSelection&&u.getSelection();if(p&&p.rangeCount!==0){u=p.anchorNode;var y=p.anchorOffset,T=p.focusNode;p=p.focusOffset;try{u.nodeType,T.nodeType}catch{u=null;break e}var O=0,z=-1,ne=-1,be=0,we=0,Ae=s,xe=null;t:for(;;){for(var Te;Ae!==u||y!==0&&Ae.nodeType!==3||(z=O+y),Ae!==T||p!==0&&Ae.nodeType!==3||(ne=O+p),Ae.nodeType===3&&(O+=Ae.nodeValue.length),(Te=Ae.firstChild)!==null;)xe=Ae,Ae=Te;for(;;){if(Ae===s)break t;if(xe===u&&++be===y&&(z=O),xe===T&&++we===p&&(ne=O),(Te=Ae.nextSibling)!==null)break;Ae=xe,xe=Ae.parentNode}Ae=Te}u=z===-1||ne===-1?null:{start:z,end:ne}}else u=null}u=u||{start:0,end:0}}else u=null;for(Fg={focusedElem:s,selectionRange:u},yf=!1,Fn=o;Fn!==null;)if(o=Fn,s=o.child,(o.subtreeFlags&1028)!==0&&s!==null)s.return=o,Fn=s;else for(;Fn!==null;){switch(o=Fn,T=o.alternate,s=o.flags,o.tag){case 0:if((s&4)!==0&&(s=o.updateQueue,s=s!==null?s.events:null,s!==null))for(u=0;u<s.length;u++)y=s[u],y.ref.impl=y.nextImpl;break;case 11:case 15:break;case 1:if((s&1024)!==0&&T!==null){s=void 0,u=o,y=T.memoizedProps,T=T.memoizedState,p=u.stateNode;try{var Ze=Ma(u.type,y);s=p.getSnapshotBeforeUpdate(Ze,T),p.__reactInternalSnapshotBeforeUpdate=s}catch(it){qt(u,u.return,it)}}break;case 3:if((s&1024)!==0){if(s=o.stateNode.containerInfo,u=s.nodeType,u===9)qg(s);else if(u===1)switch(s.nodeName){case"HEAD":case"HTML":case"BODY":qg(s);break;default:s.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((s&1024)!==0)throw Error(r(163))}if(s=o.sibling,s!==null){s.return=o.return,Fn=s;break}Fn=o.return}}function Xv(s,o,u){var p=u.flags;switch(u.tag){case 0:case 11:case 15:Zs(s,u),p&4&&Ou(5,u);break;case 1:if(Zs(s,u),p&4)if(s=u.stateNode,o===null)try{s.componentDidMount()}catch(O){qt(u,u.return,O)}else{var y=Ma(u.type,o.memoizedProps);o=o.memoizedState;try{s.componentDidUpdate(y,o,s.__reactInternalSnapshotBeforeUpdate)}catch(O){qt(u,u.return,O)}}p&64&&Fv(u),p&512&&Iu(u,u.return);break;case 3:if(Zs(s,u),p&64&&(s=u.updateQueue,s!==null)){if(o=null,u.child!==null)switch(u.child.tag){case 27:case 5:o=u.child.stateNode;break;case 1:o=u.child.stateNode}try{IE(s,o)}catch(O){qt(u,u.return,O)}}break;case 27:o===null&&p&4&&Yv(u);case 26:case 5:Zs(s,u),o===null&&p&4&&Vv(u),p&512&&Iu(u,u.return);break;case 12:Zs(s,u);break;case 31:Zs(s,u),p&4&&Wv(s,u);break;case 13:Zs(s,u),p&4&&Zv(s,u),p&64&&(s=u.memoizedState,s!==null&&(s=s.dehydrated,s!==null&&(u=GO.bind(null,u),hI(s,u))));break;case 22:if(p=u.memoizedState!==null||Qs,!p){o=o!==null&&o.memoizedState!==null||On,y=Qs;var T=On;Qs=p,(On=o)&&!T?Js(s,u,(u.subtreeFlags&8772)!==0):Zs(s,u),Qs=y,On=T}break;case 30:break;default:Zs(s,u)}}function Kv(s){var o=s.alternate;o!==null&&(s.alternate=null,Kv(o)),s.child=null,s.deletions=null,s.sibling=null,s.tag===5&&(o=s.stateNode,o!==null&&Qp(o)),s.stateNode=null,s.return=null,s.dependencies=null,s.memoizedProps=null,s.memoizedState=null,s.pendingProps=null,s.stateNode=null,s.updateQueue=null}var fn=null,Tr=!1;function Ws(s,o,u){for(u=u.child;u!==null;)Qv(s,o,u),u=u.sibling}function Qv(s,o,u){if(dt&&typeof dt.onCommitFiberUnmount=="function")try{dt.onCommitFiberUnmount(et,u)}catch{}switch(u.tag){case 26:On||Es(u,o),Ws(s,o,u),u.memoizedState?u.memoizedState.count--:u.stateNode&&(u=u.stateNode,u.parentNode.removeChild(u));break;case 27:On||Es(u,o);var p=fn,y=Tr;ji(u.type)&&(fn=u.stateNode,Tr=!1),Ws(s,o,u),zu(u.stateNode),fn=p,Tr=y;break;case 5:On||Es(u,o);case 6:if(p=fn,y=Tr,fn=null,Ws(s,o,u),fn=p,Tr=y,fn!==null)if(Tr)try{(fn.nodeType===9?fn.body:fn.nodeName==="HTML"?fn.ownerDocument.body:fn).removeChild(u.stateNode)}catch(T){qt(u,o,T)}else try{fn.removeChild(u.stateNode)}catch(T){qt(u,o,T)}break;case 18:fn!==null&&(Tr?(s=fn,FT(s.nodeType===9?s.body:s.nodeName==="HTML"?s.ownerDocument.body:s,u.stateNode),dl(s)):FT(fn,u.stateNode));break;case 4:p=fn,y=Tr,fn=u.stateNode.containerInfo,Tr=!0,Ws(s,o,u),fn=p,Tr=y;break;case 0:case 11:case 14:case 15:Ri(2,u,o),On||Ri(4,u,o),Ws(s,o,u);break;case 1:On||(Es(u,o),p=u.stateNode,typeof p.componentWillUnmount=="function"&&$v(u,o,p)),Ws(s,o,u);break;case 21:Ws(s,o,u);break;case 22:On=(p=On)||u.memoizedState!==null,Ws(s,o,u),On=p;break;default:Ws(s,o,u)}}function Wv(s,o){if(o.memoizedState===null&&(s=o.alternate,s!==null&&(s=s.memoizedState,s!==null))){s=s.dehydrated;try{dl(s)}catch(u){qt(o,o.return,u)}}}function Zv(s,o){if(o.memoizedState===null&&(s=o.alternate,s!==null&&(s=s.memoizedState,s!==null&&(s=s.dehydrated,s!==null))))try{dl(s)}catch(u){qt(o,o.return,u)}}function HO(s){switch(s.tag){case 31:case 13:case 19:var o=s.stateNode;return o===null&&(o=s.stateNode=new Gv),o;case 22:return s=s.stateNode,o=s._retryCache,o===null&&(o=s._retryCache=new Gv),o;default:throw Error(r(435,s.tag))}}function Zd(s,o){var u=HO(s);o.forEach(function(p){if(!u.has(p)){u.add(p);var y=XO.bind(null,s,p);p.then(y,y)}})}function Sr(s,o){var u=o.deletions;if(u!==null)for(var p=0;p<u.length;p++){var y=u[p],T=s,O=o,z=O;e:for(;z!==null;){switch(z.tag){case 27:if(ji(z.type)){fn=z.stateNode,Tr=!1;break e}break;case 5:fn=z.stateNode,Tr=!1;break e;case 3:case 4:fn=z.stateNode.containerInfo,Tr=!0;break e}z=z.return}if(fn===null)throw Error(r(160));Qv(T,O,y),fn=null,Tr=!1,T=y.alternate,T!==null&&(T.return=null),y.return=null}if(o.subtreeFlags&13886)for(o=o.child;o!==null;)Jv(o,s),o=o.sibling}var ls=null;function Jv(s,o){var u=s.alternate,p=s.flags;switch(s.tag){case 0:case 11:case 14:case 15:Sr(o,s),Cr(s),p&4&&(Ri(3,s,s.return),Ou(3,s),Ri(5,s,s.return));break;case 1:Sr(o,s),Cr(s),p&512&&(On||u===null||Es(u,u.return)),p&64&&Qs&&(s=s.updateQueue,s!==null&&(p=s.callbacks,p!==null&&(u=s.shared.hiddenCallbacks,s.shared.hiddenCallbacks=u===null?p:u.concat(p))));break;case 26:var y=ls;if(Sr(o,s),Cr(s),p&512&&(On||u===null||Es(u,u.return)),p&4){var T=u!==null?u.memoizedState:null;if(p=s.memoizedState,u===null)if(p===null)if(s.stateNode===null){e:{p=s.type,u=s.memoizedProps,y=y.ownerDocument||y;t:switch(p){case"title":T=y.getElementsByTagName("title")[0],(!T||T[iu]||T[en]||T.namespaceURI==="http://www.w3.org/2000/svg"||T.hasAttribute("itemprop"))&&(T=y.createElement(p),y.head.insertBefore(T,y.querySelector("head > title"))),Jn(T,p,u),T[en]=s,zn(T),p=T;break e;case"link":var O=JT("link","href",y).get(p+(u.href||""));if(O){for(var z=0;z<O.length;z++)if(T=O[z],T.getAttribute("href")===(u.href==null||u.href===""?null:u.href)&&T.getAttribute("rel")===(u.rel==null?null:u.rel)&&T.getAttribute("title")===(u.title==null?null:u.title)&&T.getAttribute("crossorigin")===(u.crossOrigin==null?null:u.crossOrigin)){O.splice(z,1);break t}}T=y.createElement(p),Jn(T,p,u),y.head.appendChild(T);break;case"meta":if(O=JT("meta","content",y).get(p+(u.content||""))){for(z=0;z<O.length;z++)if(T=O[z],T.getAttribute("content")===(u.content==null?null:""+u.content)&&T.getAttribute("name")===(u.name==null?null:u.name)&&T.getAttribute("property")===(u.property==null?null:u.property)&&T.getAttribute("http-equiv")===(u.httpEquiv==null?null:u.httpEquiv)&&T.getAttribute("charset")===(u.charSet==null?null:u.charSet)){O.splice(z,1);break t}}T=y.createElement(p),Jn(T,p,u),y.head.appendChild(T);break;default:throw Error(r(468,p))}T[en]=s,zn(T),p=T}s.stateNode=p}else e2(y,s.type,s.stateNode);else s.stateNode=ZT(y,p,s.memoizedProps);else T!==p?(T===null?u.stateNode!==null&&(u=u.stateNode,u.parentNode.removeChild(u)):T.count--,p===null?e2(y,s.type,s.stateNode):ZT(y,p,s.memoizedProps)):p===null&&s.stateNode!==null&&bg(s,s.memoizedProps,u.memoizedProps)}break;case 27:Sr(o,s),Cr(s),p&512&&(On||u===null||Es(u,u.return)),u!==null&&p&4&&bg(s,s.memoizedProps,u.memoizedProps);break;case 5:if(Sr(o,s),Cr(s),p&512&&(On||u===null||Es(u,u.return)),s.flags&32){y=s.stateNode;try{Lo(y,"")}catch(Ze){qt(s,s.return,Ze)}}p&4&&s.stateNode!=null&&(y=s.memoizedProps,bg(s,y,u!==null?u.memoizedProps:y)),p&1024&&(Eg=!0);break;case 6:if(Sr(o,s),Cr(s),p&4){if(s.stateNode===null)throw Error(r(162));p=s.memoizedProps,u=s.stateNode;try{u.nodeValue=p}catch(Ze){qt(s,s.return,Ze)}}break;case 3:if(mf=null,y=ls,ls=hf(o.containerInfo),Sr(o,s),ls=y,Cr(s),p&4&&u!==null&&u.memoizedState.isDehydrated)try{dl(o.containerInfo)}catch(Ze){qt(s,s.return,Ze)}Eg&&(Eg=!1,eT(s));break;case 4:p=ls,ls=hf(s.stateNode.containerInfo),Sr(o,s),Cr(s),ls=p;break;case 12:Sr(o,s),Cr(s);break;case 31:Sr(o,s),Cr(s),p&4&&(p=s.updateQueue,p!==null&&(s.updateQueue=null,Zd(s,p)));break;case 13:Sr(o,s),Cr(s),s.child.flags&8192&&s.memoizedState!==null!=(u!==null&&u.memoizedState!==null)&&(ef=se()),p&4&&(p=s.updateQueue,p!==null&&(s.updateQueue=null,Zd(s,p)));break;case 22:y=s.memoizedState!==null;var ne=u!==null&&u.memoizedState!==null,be=Qs,we=On;if(Qs=be||y,On=we||ne,Sr(o,s),On=we,Qs=be,Cr(s),p&8192)e:for(o=s.stateNode,o._visibility=y?o._visibility&-2:o._visibility|1,y&&(u===null||ne||Qs||On||La(s)),u=null,o=s;;){if(o.tag===5||o.tag===26){if(u===null){ne=u=o;try{if(T=ne.stateNode,y)O=T.style,typeof O.setProperty=="function"?O.setProperty("display","none","important"):O.display="none";else{z=ne.stateNode;var Ae=ne.memoizedProps.style,xe=Ae!=null&&Ae.hasOwnProperty("display")?Ae.display:null;z.style.display=xe==null||typeof xe=="boolean"?"":(""+xe).trim()}}catch(Ze){qt(ne,ne.return,Ze)}}}else if(o.tag===6){if(u===null){ne=o;try{ne.stateNode.nodeValue=y?"":ne.memoizedProps}catch(Ze){qt(ne,ne.return,Ze)}}}else if(o.tag===18){if(u===null){ne=o;try{var Te=ne.stateNode;y?$T(Te,!0):$T(ne.stateNode,!1)}catch(Ze){qt(ne,ne.return,Ze)}}}else if((o.tag!==22&&o.tag!==23||o.memoizedState===null||o===s)&&o.child!==null){o.child.return=o,o=o.child;continue}if(o===s)break e;for(;o.sibling===null;){if(o.return===null||o.return===s)break e;u===o&&(u=null),o=o.return}u===o&&(u=null),o.sibling.return=o.return,o=o.sibling}p&4&&(p=s.updateQueue,p!==null&&(u=p.retryQueue,u!==null&&(p.retryQueue=null,Zd(s,u))));break;case 19:Sr(o,s),Cr(s),p&4&&(p=s.updateQueue,p!==null&&(s.updateQueue=null,Zd(s,p)));break;case 30:break;case 21:break;default:Sr(o,s),Cr(s)}}function Cr(s){var o=s.flags;if(o&2){try{for(var u,p=s.return;p!==null;){if(qv(p)){u=p;break}p=p.return}if(u==null)throw Error(r(160));switch(u.tag){case 27:var y=u.stateNode,T=xg(s);Wd(s,T,y);break;case 5:var O=u.stateNode;u.flags&32&&(Lo(O,""),u.flags&=-33);var z=xg(s);Wd(s,z,O);break;case 3:case 4:var ne=u.stateNode.containerInfo,be=xg(s);yg(s,be,ne);break;default:throw Error(r(161))}}catch(we){qt(s,s.return,we)}s.flags&=-3}o&4096&&(s.flags&=-4097)}function eT(s){if(s.subtreeFlags&1024)for(s=s.child;s!==null;){var o=s;eT(o),o.tag===5&&o.flags&1024&&o.stateNode.reset(),s=s.sibling}}function Zs(s,o){if(o.subtreeFlags&8772)for(o=o.child;o!==null;)Xv(s,o.alternate,o),o=o.sibling}function La(s){for(s=s.child;s!==null;){var o=s;switch(o.tag){case 0:case 11:case 14:case 15:Ri(4,o,o.return),La(o);break;case 1:Es(o,o.return);var u=o.stateNode;typeof u.componentWillUnmount=="function"&&$v(o,o.return,u),La(o);break;case 27:zu(o.stateNode);case 26:case 5:Es(o,o.return),La(o);break;case 22:o.memoizedState===null&&La(o);break;case 30:La(o);break;default:La(o)}s=s.sibling}}function Js(s,o,u){for(u=u&&(o.subtreeFlags&8772)!==0,o=o.child;o!==null;){var p=o.alternate,y=s,T=o,O=T.flags;switch(T.tag){case 0:case 11:case 15:Js(y,T,u),Ou(4,T);break;case 1:if(Js(y,T,u),p=T,y=p.stateNode,typeof y.componentDidMount=="function")try{y.componentDidMount()}catch(be){qt(p,p.return,be)}if(p=T,y=p.updateQueue,y!==null){var z=p.stateNode;try{var ne=y.shared.hiddenCallbacks;if(ne!==null)for(y.shared.hiddenCallbacks=null,y=0;y<ne.length;y++)OE(ne[y],z)}catch(be){qt(p,p.return,be)}}u&&O&64&&Fv(T),Iu(T,T.return);break;case 27:Yv(T);case 26:case 5:Js(y,T,u),u&&p===null&&O&4&&Vv(T),Iu(T,T.return);break;case 12:Js(y,T,u);break;case 31:Js(y,T,u),u&&O&4&&Wv(y,T);break;case 13:Js(y,T,u),u&&O&4&&Zv(y,T);break;case 22:T.memoizedState===null&&Js(y,T,u),Iu(T,T.return);break;case 30:break;default:Js(y,T,u)}o=o.sibling}}function vg(s,o){var u=null;s!==null&&s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(u=s.memoizedState.cachePool.pool),s=null,o.memoizedState!==null&&o.memoizedState.cachePool!==null&&(s=o.memoizedState.cachePool.pool),s!==u&&(s!=null&&s.refCount++,u!=null&&xu(u))}function Tg(s,o){s=null,o.alternate!==null&&(s=o.alternate.memoizedState.cache),o=o.memoizedState.cache,o!==s&&(o.refCount++,s!=null&&xu(s))}function us(s,o,u,p){if(o.subtreeFlags&10256)for(o=o.child;o!==null;)tT(s,o,u,p),o=o.sibling}function tT(s,o,u,p){var y=o.flags;switch(o.tag){case 0:case 11:case 15:us(s,o,u,p),y&2048&&Ou(9,o);break;case 1:us(s,o,u,p);break;case 3:us(s,o,u,p),y&2048&&(s=null,o.alternate!==null&&(s=o.alternate.memoizedState.cache),o=o.memoizedState.cache,o!==s&&(o.refCount++,s!=null&&xu(s)));break;case 12:if(y&2048){us(s,o,u,p),s=o.stateNode;try{var T=o.memoizedProps,O=T.id,z=T.onPostCommit;typeof z=="function"&&z(O,o.alternate===null?"mount":"update",s.passiveEffectDuration,-0)}catch(ne){qt(o,o.return,ne)}}else us(s,o,u,p);break;case 31:us(s,o,u,p);break;case 13:us(s,o,u,p);break;case 23:break;case 22:T=o.stateNode,O=o.alternate,o.memoizedState!==null?T._visibility&2?us(s,o,u,p):Mu(s,o):T._visibility&2?us(s,o,u,p):(T._visibility|=2,el(s,o,u,p,(o.subtreeFlags&10256)!==0||!1)),y&2048&&vg(O,o);break;case 24:us(s,o,u,p),y&2048&&Tg(o.alternate,o);break;default:us(s,o,u,p)}}function el(s,o,u,p,y){for(y=y&&((o.subtreeFlags&10256)!==0||!1),o=o.child;o!==null;){var T=s,O=o,z=u,ne=p,be=O.flags;switch(O.tag){case 0:case 11:case 15:el(T,O,z,ne,y),Ou(8,O);break;case 23:break;case 22:var we=O.stateNode;O.memoizedState!==null?we._visibility&2?el(T,O,z,ne,y):Mu(T,O):(we._visibility|=2,el(T,O,z,ne,y)),y&&be&2048&&vg(O.alternate,O);break;case 24:el(T,O,z,ne,y),y&&be&2048&&Tg(O.alternate,O);break;default:el(T,O,z,ne,y)}o=o.sibling}}function Mu(s,o){if(o.subtreeFlags&10256)for(o=o.child;o!==null;){var u=s,p=o,y=p.flags;switch(p.tag){case 22:Mu(u,p),y&2048&&vg(p.alternate,p);break;case 24:Mu(u,p),y&2048&&Tg(p.alternate,p);break;default:Mu(u,p)}o=o.sibling}}var Lu=8192;function tl(s,o,u){if(s.subtreeFlags&Lu)for(s=s.child;s!==null;)nT(s,o,u),s=s.sibling}function nT(s,o,u){switch(s.tag){case 26:tl(s,o,u),s.flags&Lu&&s.memoizedState!==null&&kI(u,ls,s.memoizedState,s.memoizedProps);break;case 5:tl(s,o,u);break;case 3:case 4:var p=ls;ls=hf(s.stateNode.containerInfo),tl(s,o,u),ls=p;break;case 22:s.memoizedState===null&&(p=s.alternate,p!==null&&p.memoizedState!==null?(p=Lu,Lu=16777216,tl(s,o,u),Lu=p):tl(s,o,u));break;default:tl(s,o,u)}}function rT(s){var o=s.alternate;if(o!==null&&(s=o.child,s!==null)){o.child=null;do o=s.sibling,s.sibling=null,s=o;while(s!==null)}}function Du(s){var o=s.deletions;if((s.flags&16)!==0){if(o!==null)for(var u=0;u<o.length;u++){var p=o[u];Fn=p,iT(p,s)}rT(s)}if(s.subtreeFlags&10256)for(s=s.child;s!==null;)sT(s),s=s.sibling}function sT(s){switch(s.tag){case 0:case 11:case 15:Du(s),s.flags&2048&&Ri(9,s,s.return);break;case 3:Du(s);break;case 12:Du(s);break;case 22:var o=s.stateNode;s.memoizedState!==null&&o._visibility&2&&(s.return===null||s.return.tag!==13)?(o._visibility&=-3,Jd(s)):Du(s);break;default:Du(s)}}function Jd(s){var o=s.deletions;if((s.flags&16)!==0){if(o!==null)for(var u=0;u<o.length;u++){var p=o[u];Fn=p,iT(p,s)}rT(s)}for(s=s.child;s!==null;){switch(o=s,o.tag){case 0:case 11:case 15:Ri(8,o,o.return),Jd(o);break;case 22:u=o.stateNode,u._visibility&2&&(u._visibility&=-3,Jd(o));break;default:Jd(o)}s=s.sibling}}function iT(s,o){for(;Fn!==null;){var u=Fn;switch(u.tag){case 0:case 11:case 15:Ri(8,u,o);break;case 23:case 22:if(u.memoizedState!==null&&u.memoizedState.cachePool!==null){var p=u.memoizedState.cachePool.pool;p!=null&&p.refCount++}break;case 24:xu(u.memoizedState.cache)}if(p=u.child,p!==null)p.return=u,Fn=p;else e:for(u=s;Fn!==null;){p=Fn;var y=p.sibling,T=p.return;if(Kv(p),p===u){Fn=null;break e}if(y!==null){y.return=T,Fn=y;break e}Fn=T}}}var UO={getCacheForType:function(s){var o=Wn(An),u=o.data.get(s);return u===void 0&&(u=s(),o.data.set(s,u)),u},cacheSignal:function(){return Wn(An).controller.signal}},zO=typeof WeakMap=="function"?WeakMap:Map,Ft=0,tn=null,wt=null,It=0,Vt=0,Br=null,Oi=!1,nl=!1,Sg=!1,ei=0,yn=0,Ii=0,Da=0,Cg=0,Hr=0,rl=0,Pu=null,kr=null,kg=!1,ef=0,aT=0,tf=1/0,nf=null,Mi=null,Pn=0,Li=null,sl=null,ti=0,wg=0,Ng=null,oT=null,ju=0,Ag=null;function Ur(){return(Ft&2)!==0&&It!==0?It&-It:H.T!==null?Lg():bn()}function lT(){if(Hr===0)if((It&536870912)===0||Dt){var s=Wt;Wt<<=1,(Wt&3932160)===0&&(Wt=262144),Hr=s}else Hr=536870912;return s=Pr.current,s!==null&&(s.flags|=32),Hr}function wr(s,o,u){(s===tn&&(Vt===2||Vt===9)||s.cancelPendingCommit!==null)&&(il(s,0),Di(s,It,Hr,!1)),Et(s,u),((Ft&2)===0||s!==tn)&&(s===tn&&((Ft&2)===0&&(Da|=u),yn===4&&Di(s,It,Hr,!1)),vs(s))}function uT(s,o,u){if((Ft&6)!==0)throw Error(r(327));var p=!u&&(o&127)===0&&(o&s.expiredLanes)===0||yt(s,o),y=p?VO(s,o):Rg(s,o,!0),T=p;do{if(y===0){nl&&!p&&Di(s,o,0,!1);break}else{if(u=s.current.alternate,T&&!FO(u)){y=Rg(s,o,!1),T=!1;continue}if(y===2){if(T=o,s.errorRecoveryDisabledLanes&T)var O=0;else O=s.pendingLanes&-536870913,O=O!==0?O:O&536870912?536870912:0;if(O!==0){o=O;e:{var z=s;y=Pu;var ne=z.current.memoizedState.isDehydrated;if(ne&&(il(z,O).flags|=256),O=Rg(z,O,!1),O!==2){if(Sg&&!ne){z.errorRecoveryDisabledLanes|=T,Da|=T,y=4;break e}T=kr,kr=y,T!==null&&(kr===null?kr=T:kr.push.apply(kr,T))}y=O}if(T=!1,y!==2)continue}}if(y===1){il(s,0),Di(s,o,0,!0);break}e:{switch(p=s,T=y,T){case 0:case 1:throw Error(r(345));case 4:if((o&4194048)!==o)break;case 6:Di(p,o,Hr,!Oi);break e;case 2:kr=null;break;case 3:case 5:break;default:throw Error(r(329))}if((o&62914560)===o&&(y=ef+300-se(),10<y)){if(Di(p,o,Hr,!Oi),Ke(p,0,!0)!==0)break e;ti=o,p.timeoutHandle=UT(cT.bind(null,p,u,kr,nf,kg,o,Hr,Da,rl,Oi,T,"Throttled",-0,0),y);break e}cT(p,u,kr,nf,kg,o,Hr,Da,rl,Oi,T,null,-0,0)}}break}while(!0);vs(s)}function cT(s,o,u,p,y,T,O,z,ne,be,we,Ae,xe,Te){if(s.timeoutHandle=-1,Ae=o.subtreeFlags,Ae&8192||(Ae&16785408)===16785408){Ae={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Us},nT(o,T,Ae);var Ze=(T&62914560)===T?ef-se():(T&4194048)===T?aT-se():0;if(Ze=wI(Ae,Ze),Ze!==null){ti=T,s.cancelPendingCommit=Ze(xT.bind(null,s,o,T,u,p,y,O,z,ne,we,Ae,null,xe,Te)),Di(s,T,O,!be);return}}xT(s,o,T,u,p,y,O,z,ne)}function FO(s){for(var o=s;;){var u=o.tag;if((u===0||u===11||u===15)&&o.flags&16384&&(u=o.updateQueue,u!==null&&(u=u.stores,u!==null)))for(var p=0;p<u.length;p++){var y=u[p],T=y.getSnapshot;y=y.value;try{if(!Lr(T(),y))return!1}catch{return!1}}if(u=o.child,o.subtreeFlags&16384&&u!==null)u.return=o,o=u;else{if(o===s)break;for(;o.sibling===null;){if(o.return===null||o.return===s)return!0;o=o.return}o.sibling.return=o.return,o=o.sibling}}return!0}function Di(s,o,u,p){o&=~Cg,o&=~Da,s.suspendedLanes|=o,s.pingedLanes&=~o,p&&(s.warmLanes|=o),p=s.expirationTimes;for(var y=o;0<y;){var T=31-Ve(y),O=1<<T;p[T]=-1,y&=~O}u!==0&&Er(s,u,o)}function rf(){return(Ft&6)===0?(Bu(0),!1):!0}function _g(){if(wt!==null){if(Vt===0)var s=wt.return;else s=wt,Vs=wa=null,qm(s),Ko=null,Eu=0,s=wt;for(;s!==null;)zv(s.alternate,s),s=s.return;wt=null}}function il(s,o){var u=s.timeoutHandle;u!==-1&&(s.timeoutHandle=-1,lI(u)),u=s.cancelPendingCommit,u!==null&&(s.cancelPendingCommit=null,u()),ti=0,_g(),tn=s,wt=u=Fs(s.current,null),It=o,Vt=0,Br=null,Oi=!1,nl=yt(s,o),Sg=!1,rl=Hr=Cg=Da=Ii=yn=0,kr=Pu=null,kg=!1,(o&8)!==0&&(o|=o&32);var p=s.entangledLanes;if(p!==0)for(s=s.entanglements,p&=o;0<p;){var y=31-Ve(p),T=1<<y;o|=s[y],p&=~T}return ei=o,Cd(),u}function dT(s,o){bt=null,H.H=Au,o===Xo||o===Id?(o=NE(),Vt=3):o===Mm?(o=NE(),Vt=4):Vt=o===og?8:o!==null&&typeof o=="object"&&typeof o.then=="function"?6:1,Br=o,wt===null&&(yn=1,Yd(s,Qr(o,s.current)))}function fT(){var s=Pr.current;return s===null?!0:(It&4194048)===It?es===null:(It&62914560)===It||(It&536870912)!==0?s===es:!1}function hT(){var s=H.H;return H.H=Au,s===null?Au:s}function pT(){var s=H.A;return H.A=UO,s}function sf(){yn=4,Oi||(It&4194048)!==It&&Pr.current!==null||(nl=!0),(Ii&134217727)===0&&(Da&134217727)===0||tn===null||Di(tn,It,Hr,!1)}function Rg(s,o,u){var p=Ft;Ft|=2;var y=hT(),T=pT();(tn!==s||It!==o)&&(nf=null,il(s,o)),o=!1;var O=yn;e:do try{if(Vt!==0&&wt!==null){var z=wt,ne=Br;switch(Vt){case 8:_g(),O=6;break e;case 3:case 2:case 9:case 6:Pr.current===null&&(o=!0);var be=Vt;if(Vt=0,Br=null,al(s,z,ne,be),u&&nl){O=0;break e}break;default:be=Vt,Vt=0,Br=null,al(s,z,ne,be)}}$O(),O=yn;break}catch(we){dT(s,we)}while(!0);return o&&s.shellSuspendCounter++,Vs=wa=null,Ft=p,H.H=y,H.A=T,wt===null&&(tn=null,It=0,Cd()),O}function $O(){for(;wt!==null;)mT(wt)}function VO(s,o){var u=Ft;Ft|=2;var p=hT(),y=pT();tn!==s||It!==o?(nf=null,tf=se()+500,il(s,o)):nl=yt(s,o);e:do try{if(Vt!==0&&wt!==null){o=wt;var T=Br;t:switch(Vt){case 1:Vt=0,Br=null,al(s,o,T,1);break;case 2:case 9:if(kE(T)){Vt=0,Br=null,gT(o);break}o=function(){Vt!==2&&Vt!==9||tn!==s||(Vt=7),vs(s)},T.then(o,o);break e;case 3:Vt=7;break e;case 4:Vt=5;break e;case 7:kE(T)?(Vt=0,Br=null,gT(o)):(Vt=0,Br=null,al(s,o,T,7));break;case 5:var O=null;switch(wt.tag){case 26:O=wt.memoizedState;case 5:case 27:var z=wt;if(O?t2(O):z.stateNode.complete){Vt=0,Br=null;var ne=z.sibling;if(ne!==null)wt=ne;else{var be=z.return;be!==null?(wt=be,af(be)):wt=null}break t}}Vt=0,Br=null,al(s,o,T,5);break;case 6:Vt=0,Br=null,al(s,o,T,6);break;case 8:_g(),yn=6;break e;default:throw Error(r(462))}}qO();break}catch(we){dT(s,we)}while(!0);return Vs=wa=null,H.H=p,H.A=y,Ft=u,wt!==null?0:(tn=null,It=0,Cd(),yn)}function qO(){for(;wt!==null&&!ee();)mT(wt)}function mT(s){var o=Hv(s.alternate,s,ei);s.memoizedProps=s.pendingProps,o===null?af(s):wt=o}function gT(s){var o=s,u=o.alternate;switch(o.tag){case 15:case 0:o=Mv(u,o,o.pendingProps,o.type,void 0,It);break;case 11:o=Mv(u,o,o.pendingProps,o.type.render,o.ref,It);break;case 5:qm(o);default:zv(u,o),o=wt=pE(o,ei),o=Hv(u,o,ei)}s.memoizedProps=s.pendingProps,o===null?af(s):wt=o}function al(s,o,u,p){Vs=wa=null,qm(o),Ko=null,Eu=0;var y=o.return;try{if(MO(s,y,o,u,It)){yn=1,Yd(s,Qr(u,s.current)),wt=null;return}}catch(T){if(y!==null)throw wt=y,T;yn=1,Yd(s,Qr(u,s.current)),wt=null;return}o.flags&32768?(Dt||p===1?s=!0:nl||(It&536870912)!==0?s=!1:(Oi=s=!0,(p===2||p===9||p===3||p===6)&&(p=Pr.current,p!==null&&p.tag===13&&(p.flags|=16384))),bT(o,s)):af(o)}function af(s){var o=s;do{if((o.flags&32768)!==0){bT(o,Oi);return}s=o.return;var u=PO(o.alternate,o,ei);if(u!==null){wt=u;return}if(o=o.sibling,o!==null){wt=o;return}wt=o=s}while(o!==null);yn===0&&(yn=5)}function bT(s,o){do{var u=jO(s.alternate,s);if(u!==null){u.flags&=32767,wt=u;return}if(u=s.return,u!==null&&(u.flags|=32768,u.subtreeFlags=0,u.deletions=null),!o&&(s=s.sibling,s!==null)){wt=s;return}wt=s=u}while(s!==null);yn=6,wt=null}function xT(s,o,u,p,y,T,O,z,ne){s.cancelPendingCommit=null;do of();while(Pn!==0);if((Ft&6)!==0)throw Error(r(327));if(o!==null){if(o===s.current)throw Error(r(177));if(T=o.lanes|o.childLanes,T|=xm,an(s,u,T,O,z,ne),s===tn&&(wt=tn=null,It=0),sl=o,Li=s,ti=u,wg=T,Ng=y,oT=p,(o.subtreeFlags&10256)!==0||(o.flags&10256)!==0?(s.callbackNode=null,s.callbackPriority=0,KO(oe,function(){return ST(),null})):(s.callbackNode=null,s.callbackPriority=0),p=(o.flags&13878)!==0,(o.subtreeFlags&13878)!==0||p){p=H.T,H.T=null,y=q.p,q.p=2,O=Ft,Ft|=4;try{BO(s,o,u)}finally{Ft=O,q.p=y,H.T=p}}Pn=1,yT(),ET(),vT()}}function yT(){if(Pn===1){Pn=0;var s=Li,o=sl,u=(o.flags&13878)!==0;if((o.subtreeFlags&13878)!==0||u){u=H.T,H.T=null;var p=q.p;q.p=2;var y=Ft;Ft|=4;try{Jv(o,s);var T=Fg,O=iE(s.containerInfo),z=T.focusedElem,ne=T.selectionRange;if(O!==z&&z&&z.ownerDocument&&sE(z.ownerDocument.documentElement,z)){if(ne!==null&&hm(z)){var be=ne.start,we=ne.end;if(we===void 0&&(we=be),"selectionStart"in z)z.selectionStart=be,z.selectionEnd=Math.min(we,z.value.length);else{var Ae=z.ownerDocument||document,xe=Ae&&Ae.defaultView||window;if(xe.getSelection){var Te=xe.getSelection(),Ze=z.textContent.length,it=Math.min(ne.start,Ze),Xt=ne.end===void 0?it:Math.min(ne.end,Ze);!Te.extend&&it>Xt&&(O=Xt,Xt=it,it=O);var fe=rE(z,it),le=rE(z,Xt);if(fe&&le&&(Te.rangeCount!==1||Te.anchorNode!==fe.node||Te.anchorOffset!==fe.offset||Te.focusNode!==le.node||Te.focusOffset!==le.offset)){var ge=Ae.createRange();ge.setStart(fe.node,fe.offset),Te.removeAllRanges(),it>Xt?(Te.addRange(ge),Te.extend(le.node,le.offset)):(ge.setEnd(le.node,le.offset),Te.addRange(ge))}}}}for(Ae=[],Te=z;Te=Te.parentNode;)Te.nodeType===1&&Ae.push({element:Te,left:Te.scrollLeft,top:Te.scrollTop});for(typeof z.focus=="function"&&z.focus(),z=0;z<Ae.length;z++){var Ne=Ae[z];Ne.element.scrollLeft=Ne.left,Ne.element.scrollTop=Ne.top}}yf=!!zg,Fg=zg=null}finally{Ft=y,q.p=p,H.T=u}}s.current=o,Pn=2}}function ET(){if(Pn===2){Pn=0;var s=Li,o=sl,u=(o.flags&8772)!==0;if((o.subtreeFlags&8772)!==0||u){u=H.T,H.T=null;var p=q.p;q.p=2;var y=Ft;Ft|=4;try{Xv(s,o.alternate,o)}finally{Ft=y,q.p=p,H.T=u}}Pn=3}}function vT(){if(Pn===4||Pn===3){Pn=0,pe();var s=Li,o=sl,u=ti,p=oT;(o.subtreeFlags&10256)!==0||(o.flags&10256)!==0?Pn=5:(Pn=0,sl=Li=null,TT(s,s.pendingLanes));var y=s.pendingLanes;if(y===0&&(Mi=null),Ot(u),o=o.stateNode,dt&&typeof dt.onCommitFiberRoot=="function")try{dt.onCommitFiberRoot(et,o,void 0,(o.current.flags&128)===128)}catch{}if(p!==null){o=H.T,y=q.p,q.p=2,H.T=null;try{for(var T=s.onRecoverableError,O=0;O<p.length;O++){var z=p[O];T(z.value,{componentStack:z.stack})}}finally{H.T=o,q.p=y}}(ti&3)!==0&&of(),vs(s),y=s.pendingLanes,(u&261930)!==0&&(y&42)!==0?s===Ag?ju++:(ju=0,Ag=s):ju=0,Bu(0)}}function TT(s,o){(s.pooledCacheLanes&=o)===0&&(o=s.pooledCache,o!=null&&(s.pooledCache=null,xu(o)))}function of(){return yT(),ET(),vT(),ST()}function ST(){if(Pn!==5)return!1;var s=Li,o=wg;wg=0;var u=Ot(ti),p=H.T,y=q.p;try{q.p=32>u?32:u,H.T=null,u=Ng,Ng=null;var T=Li,O=ti;if(Pn=0,sl=Li=null,ti=0,(Ft&6)!==0)throw Error(r(331));var z=Ft;if(Ft|=4,sT(T.current),tT(T,T.current,O,u),Ft=z,Bu(0,!1),dt&&typeof dt.onPostCommitFiberRoot=="function")try{dt.onPostCommitFiberRoot(et,T)}catch{}return!0}finally{q.p=y,H.T=p,TT(s,o)}}function CT(s,o,u){o=Qr(u,o),o=ag(s.stateNode,o,2),s=Ni(s,o,2),s!==null&&(Et(s,2),vs(s))}function qt(s,o,u){if(s.tag===3)CT(s,s,u);else for(;o!==null;){if(o.tag===3){CT(o,s,u);break}else if(o.tag===1){var p=o.stateNode;if(typeof o.type.getDerivedStateFromError=="function"||typeof p.componentDidCatch=="function"&&(Mi===null||!Mi.has(p))){s=Qr(u,s),u=kv(2),p=Ni(o,u,2),p!==null&&(wv(u,p,o,s),Et(p,2),vs(p));break}}o=o.return}}function Og(s,o,u){var p=s.pingCache;if(p===null){p=s.pingCache=new zO;var y=new Set;p.set(o,y)}else y=p.get(o),y===void 0&&(y=new Set,p.set(o,y));y.has(u)||(Sg=!0,y.add(u),s=YO.bind(null,s,o,u),o.then(s,s))}function YO(s,o,u){var p=s.pingCache;p!==null&&p.delete(o),s.pingedLanes|=s.suspendedLanes&u,s.warmLanes&=~u,tn===s&&(It&u)===u&&(yn===4||yn===3&&(It&62914560)===It&&300>se()-ef?(Ft&2)===0&&il(s,0):Cg|=u,rl===It&&(rl=0)),vs(s)}function kT(s,o){o===0&&(o=Jt()),s=Sa(s,o),s!==null&&(Et(s,o),vs(s))}function GO(s){var o=s.memoizedState,u=0;o!==null&&(u=o.retryLane),kT(s,u)}function XO(s,o){var u=0;switch(s.tag){case 31:case 13:var p=s.stateNode,y=s.memoizedState;y!==null&&(u=y.retryLane);break;case 19:p=s.stateNode;break;case 22:p=s.stateNode._retryCache;break;default:throw Error(r(314))}p!==null&&p.delete(o),kT(s,u)}function KO(s,o){return Re(s,o)}var lf=null,ol=null,Ig=!1,uf=!1,Mg=!1,Pi=0;function vs(s){s!==ol&&s.next===null&&(ol===null?lf=ol=s:ol=ol.next=s),uf=!0,Ig||(Ig=!0,WO())}function Bu(s,o){if(!Mg&&uf){Mg=!0;do for(var u=!1,p=lf;p!==null;){if(s!==0){var y=p.pendingLanes;if(y===0)var T=0;else{var O=p.suspendedLanes,z=p.pingedLanes;T=(1<<31-Ve(42|s)+1)-1,T&=y&~(O&~z),T=T&201326741?T&201326741|1:T?T|2:0}T!==0&&(u=!0,_T(p,T))}else T=It,T=Ke(p,p===tn?T:0,p.cancelPendingCommit!==null||p.timeoutHandle!==-1),(T&3)===0||yt(p,T)||(u=!0,_T(p,T));p=p.next}while(u);Mg=!1}}function QO(){wT()}function wT(){uf=Ig=!1;var s=0;Pi!==0&&oI()&&(s=Pi);for(var o=se(),u=null,p=lf;p!==null;){var y=p.next,T=NT(p,o);T===0?(p.next=null,u===null?lf=y:u.next=y,y===null&&(ol=u)):(u=p,(s!==0||(T&3)!==0)&&(uf=!0)),p=y}Pn!==0&&Pn!==5||Bu(s),Pi!==0&&(Pi=0)}function NT(s,o){for(var u=s.suspendedLanes,p=s.pingedLanes,y=s.expirationTimes,T=s.pendingLanes&-62914561;0<T;){var O=31-Ve(T),z=1<<O,ne=y[O];ne===-1?((z&u)===0||(z&p)!==0)&&(y[O]=zt(z,o)):ne<=o&&(s.expiredLanes|=z),T&=~z}if(o=tn,u=It,u=Ke(s,s===o?u:0,s.cancelPendingCommit!==null||s.timeoutHandle!==-1),p=s.callbackNode,u===0||s===o&&(Vt===2||Vt===9)||s.cancelPendingCommit!==null)return p!==null&&p!==null&&Pe(p),s.callbackNode=null,s.callbackPriority=0;if((u&3)===0||yt(s,u)){if(o=u&-u,o===s.callbackPriority)return o;switch(p!==null&&Pe(p),Ot(u)){case 2:case 8:u=$;break;case 32:u=oe;break;case 268435456:u=_e;break;default:u=oe}return p=AT.bind(null,s),u=Re(u,p),s.callbackPriority=o,s.callbackNode=u,o}return p!==null&&p!==null&&Pe(p),s.callbackPriority=2,s.callbackNode=null,2}function AT(s,o){if(Pn!==0&&Pn!==5)return s.callbackNode=null,s.callbackPriority=0,null;var u=s.callbackNode;if(of()&&s.callbackNode!==u)return null;var p=It;return p=Ke(s,s===tn?p:0,s.cancelPendingCommit!==null||s.timeoutHandle!==-1),p===0?null:(uT(s,p,o),NT(s,se()),s.callbackNode!=null&&s.callbackNode===u?AT.bind(null,s):null)}function _T(s,o){if(of())return null;uT(s,o,!0)}function WO(){uI(function(){(Ft&6)!==0?Re(Q,QO):wT()})}function Lg(){if(Pi===0){var s=Yo;s===0&&(s=Lt,Lt<<=1,(Lt&261888)===0&&(Lt=256)),Pi=s}return Pi}function RT(s){return s==null||typeof s=="symbol"||typeof s=="boolean"?null:typeof s=="function"?s:gd(""+s)}function OT(s,o){var u=o.ownerDocument.createElement("input");return u.name=o.name,u.value=o.value,s.id&&u.setAttribute("form",s.id),o.parentNode.insertBefore(u,o),s=new FormData(s),u.parentNode.removeChild(u),s}function ZO(s,o,u,p,y){if(o==="submit"&&u&&u.stateNode===y){var T=RT((y[Kn]||null).action),O=p.submitter;O&&(o=(o=O[Kn]||null)?RT(o.formAction):O.getAttribute("formAction"),o!==null&&(T=o,O=null));var z=new Ed("action","action",null,p,y);s.push({event:z,listeners:[{instance:null,listener:function(){if(p.defaultPrevented){if(Pi!==0){var ne=O?OT(y,O):new FormData(y);eg(u,{pending:!0,data:ne,method:y.method,action:T},null,ne)}}else typeof T=="function"&&(z.preventDefault(),ne=O?OT(y,O):new FormData(y),eg(u,{pending:!0,data:ne,method:y.method,action:T},T,ne))},currentTarget:y}]})}}for(var Dg=0;Dg<bm.length;Dg++){var Pg=bm[Dg],JO=Pg.toLowerCase(),eI=Pg[0].toUpperCase()+Pg.slice(1);os(JO,"on"+eI)}os(lE,"onAnimationEnd"),os(uE,"onAnimationIteration"),os(cE,"onAnimationStart"),os("dblclick","onDoubleClick"),os("focusin","onFocus"),os("focusout","onBlur"),os(gO,"onTransitionRun"),os(bO,"onTransitionStart"),os(xO,"onTransitionCancel"),os(dE,"onTransitionEnd"),Io("onMouseEnter",["mouseout","mouseover"]),Io("onMouseLeave",["mouseout","mouseover"]),Io("onPointerEnter",["pointerout","pointerover"]),Io("onPointerLeave",["pointerout","pointerover"]),ya("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),ya("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),ya("onBeforeInput",["compositionend","keypress","textInput","paste"]),ya("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),ya("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),ya("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Hu="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(" "),tI=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Hu));function IT(s,o){o=(o&4)!==0;for(var u=0;u<s.length;u++){var p=s[u],y=p.event;p=p.listeners;e:{var T=void 0;if(o)for(var O=p.length-1;0<=O;O--){var z=p[O],ne=z.instance,be=z.currentTarget;if(z=z.listener,ne!==T&&y.isPropagationStopped())break e;T=z,y.currentTarget=be;try{T(y)}catch(we){Sd(we)}y.currentTarget=null,T=ne}else for(O=0;O<p.length;O++){if(z=p[O],ne=z.instance,be=z.currentTarget,z=z.listener,ne!==T&&y.isPropagationStopped())break e;T=z,y.currentTarget=be;try{T(y)}catch(we){Sd(we)}y.currentTarget=null,T=ne}}}}function Nt(s,o){var u=o[su];u===void 0&&(u=o[su]=new Set);var p=s+"__bubble";u.has(p)||(MT(o,s,2,!1),u.add(p))}function jg(s,o,u){var p=0;o&&(p|=4),MT(u,s,p,o)}var cf="_reactListening"+Math.random().toString(36).slice(2);function Bg(s){if(!s[cf]){s[cf]=!0,wy.forEach(function(u){u!=="selectionchange"&&(tI.has(u)||jg(u,!1,s),jg(u,!0,s))});var o=s.nodeType===9?s:s.ownerDocument;o===null||o[cf]||(o[cf]=!0,jg("selectionchange",!1,o))}}function MT(s,o,u,p){switch(l2(o)){case 2:var y=_I;break;case 8:y=RI;break;default:y=Jg}u=y.bind(null,o,u,s),y=void 0,!sm||o!=="touchstart"&&o!=="touchmove"&&o!=="wheel"||(y=!0),p?y!==void 0?s.addEventListener(o,u,{capture:!0,passive:y}):s.addEventListener(o,u,!0):y!==void 0?s.addEventListener(o,u,{passive:y}):s.addEventListener(o,u,!1)}function Hg(s,o,u,p,y){var T=p;if((o&1)===0&&(o&2)===0&&p!==null)e:for(;;){if(p===null)return;var O=p.tag;if(O===3||O===4){var z=p.stateNode.containerInfo;if(z===y)break;if(O===4)for(O=p.return;O!==null;){var ne=O.tag;if((ne===3||ne===4)&&O.stateNode.containerInfo===y)return;O=O.return}for(;z!==null;){if(O=_o(z),O===null)return;if(ne=O.tag,ne===5||ne===6||ne===26||ne===27){p=T=O;continue e}z=z.parentNode}}p=p.return}By(function(){var be=T,we=nm(u),Ae=[];e:{var xe=fE.get(s);if(xe!==void 0){var Te=Ed,Ze=s;switch(s){case"keypress":if(xd(u)===0)break e;case"keydown":case"keyup":Te=X6;break;case"focusin":Ze="focus",Te=lm;break;case"focusout":Ze="blur",Te=lm;break;case"beforeblur":case"afterblur":Te=lm;break;case"click":if(u.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":Te=zy;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":Te=P6;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":Te=W6;break;case lE:case uE:case cE:Te=H6;break;case dE:Te=J6;break;case"scroll":case"scrollend":Te=L6;break;case"wheel":Te=tO;break;case"copy":case"cut":case"paste":Te=z6;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":Te=$y;break;case"toggle":case"beforetoggle":Te=rO}var it=(o&4)!==0,Xt=!it&&(s==="scroll"||s==="scrollend"),fe=it?xe!==null?xe+"Capture":null:xe;it=[];for(var le=be,ge;le!==null;){var Ne=le;if(ge=Ne.stateNode,Ne=Ne.tag,Ne!==5&&Ne!==26&&Ne!==27||ge===null||fe===null||(Ne=ou(le,fe),Ne!=null&&it.push(Uu(le,Ne,ge))),Xt)break;le=le.return}0<it.length&&(xe=new Te(xe,Ze,null,u,we),Ae.push({event:xe,listeners:it}))}}if((o&7)===0){e:{if(xe=s==="mouseover"||s==="pointerover",Te=s==="mouseout"||s==="pointerout",xe&&u!==tm&&(Ze=u.relatedTarget||u.fromElement)&&(_o(Ze)||Ze[bs]))break e;if((Te||xe)&&(xe=we.window===we?we:(xe=we.ownerDocument)?xe.defaultView||xe.parentWindow:window,Te?(Ze=u.relatedTarget||u.toElement,Te=be,Ze=Ze?_o(Ze):null,Ze!==null&&(Xt=a(Ze),it=Ze.tag,Ze!==Xt||it!==5&&it!==27&&it!==6)&&(Ze=null)):(Te=null,Ze=be),Te!==Ze)){if(it=zy,Ne="onMouseLeave",fe="onMouseEnter",le="mouse",(s==="pointerout"||s==="pointerover")&&(it=$y,Ne="onPointerLeave",fe="onPointerEnter",le="pointer"),Xt=Te==null?xe:au(Te),ge=Ze==null?xe:au(Ze),xe=new it(Ne,le+"leave",Te,u,we),xe.target=Xt,xe.relatedTarget=ge,Ne=null,_o(we)===be&&(it=new it(fe,le+"enter",Ze,u,we),it.target=ge,it.relatedTarget=Xt,Ne=it),Xt=Ne,Te&&Ze)t:{for(it=nI,fe=Te,le=Ze,ge=0,Ne=fe;Ne;Ne=it(Ne))ge++;Ne=0;for(var rt=le;rt;rt=it(rt))Ne++;for(;0<ge-Ne;)fe=it(fe),ge--;for(;0<Ne-ge;)le=it(le),Ne--;for(;ge--;){if(fe===le||le!==null&&fe===le.alternate){it=fe;break t}fe=it(fe),le=it(le)}it=null}else it=null;Te!==null&&LT(Ae,xe,Te,it,!1),Ze!==null&&Xt!==null&&LT(Ae,Xt,Ze,it,!0)}}e:{if(xe=be?au(be):window,Te=xe.nodeName&&xe.nodeName.toLowerCase(),Te==="select"||Te==="input"&&xe.type==="file")var Ht=Wy;else if(Ky(xe))if(Zy)Ht=hO;else{Ht=dO;var Je=cO}else Te=xe.nodeName,!Te||Te.toLowerCase()!=="input"||xe.type!=="checkbox"&&xe.type!=="radio"?be&&em(be.elementType)&&(Ht=Wy):Ht=fO;if(Ht&&(Ht=Ht(s,be))){Qy(Ae,Ht,u,we);break e}Je&&Je(s,xe,be),s==="focusout"&&be&&xe.type==="number"&&be.memoizedProps.value!=null&&Jp(xe,"number",xe.value)}switch(Je=be?au(be):window,s){case"focusin":(Ky(Je)||Je.contentEditable==="true")&&(Bo=Je,pm=be,mu=null);break;case"focusout":mu=pm=Bo=null;break;case"mousedown":mm=!0;break;case"contextmenu":case"mouseup":case"dragend":mm=!1,aE(Ae,u,we);break;case"selectionchange":if(mO)break;case"keydown":case"keyup":aE(Ae,u,we)}var xt;if(cm)e:{switch(s){case"compositionstart":var Mt="onCompositionStart";break e;case"compositionend":Mt="onCompositionEnd";break e;case"compositionupdate":Mt="onCompositionUpdate";break e}Mt=void 0}else jo?Gy(s,u)&&(Mt="onCompositionEnd"):s==="keydown"&&u.keyCode===229&&(Mt="onCompositionStart");Mt&&(Vy&&u.locale!=="ko"&&(jo||Mt!=="onCompositionStart"?Mt==="onCompositionEnd"&&jo&&(xt=Hy()):(Ei=we,im="value"in Ei?Ei.value:Ei.textContent,jo=!0)),Je=df(be,Mt),0<Je.length&&(Mt=new Fy(Mt,s,null,u,we),Ae.push({event:Mt,listeners:Je}),xt?Mt.data=xt:(xt=Xy(u),xt!==null&&(Mt.data=xt)))),(xt=iO?aO(s,u):oO(s,u))&&(Mt=df(be,"onBeforeInput"),0<Mt.length&&(Je=new Fy("onBeforeInput","beforeinput",null,u,we),Ae.push({event:Je,listeners:Mt}),Je.data=xt)),ZO(Ae,s,be,u,we)}IT(Ae,o)})}function Uu(s,o,u){return{instance:s,listener:o,currentTarget:u}}function df(s,o){for(var u=o+"Capture",p=[];s!==null;){var y=s,T=y.stateNode;if(y=y.tag,y!==5&&y!==26&&y!==27||T===null||(y=ou(s,u),y!=null&&p.unshift(Uu(s,y,T)),y=ou(s,o),y!=null&&p.push(Uu(s,y,T))),s.tag===3)return p;s=s.return}return[]}function nI(s){if(s===null)return null;do s=s.return;while(s&&s.tag!==5&&s.tag!==27);return s||null}function LT(s,o,u,p,y){for(var T=o._reactName,O=[];u!==null&&u!==p;){var z=u,ne=z.alternate,be=z.stateNode;if(z=z.tag,ne!==null&&ne===p)break;z!==5&&z!==26&&z!==27||be===null||(ne=be,y?(be=ou(u,T),be!=null&&O.unshift(Uu(u,be,ne))):y||(be=ou(u,T),be!=null&&O.push(Uu(u,be,ne)))),u=u.return}O.length!==0&&s.push({event:o,listeners:O})}var rI=/\r\n?/g,sI=/\u0000|\uFFFD/g;function DT(s){return(typeof s=="string"?s:""+s).replace(rI,`
50
+ `).replace(sI,"")}function PT(s,o){return o=DT(o),DT(s)===o}function Gt(s,o,u,p,y,T){switch(u){case"children":typeof p=="string"?o==="body"||o==="textarea"&&p===""||Lo(s,p):(typeof p=="number"||typeof p=="bigint")&&o!=="body"&&Lo(s,""+p);break;case"className":pd(s,"class",p);break;case"tabIndex":pd(s,"tabindex",p);break;case"dir":case"role":case"viewBox":case"width":case"height":pd(s,u,p);break;case"style":Py(s,p,T);break;case"data":if(o!=="object"){pd(s,"data",p);break}case"src":case"href":if(p===""&&(o!=="a"||u!=="href")){s.removeAttribute(u);break}if(p==null||typeof p=="function"||typeof p=="symbol"||typeof p=="boolean"){s.removeAttribute(u);break}p=gd(""+p),s.setAttribute(u,p);break;case"action":case"formAction":if(typeof p=="function"){s.setAttribute(u,"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 T=="function"&&(u==="formAction"?(o!=="input"&&Gt(s,o,"name",y.name,y,null),Gt(s,o,"formEncType",y.formEncType,y,null),Gt(s,o,"formMethod",y.formMethod,y,null),Gt(s,o,"formTarget",y.formTarget,y,null)):(Gt(s,o,"encType",y.encType,y,null),Gt(s,o,"method",y.method,y,null),Gt(s,o,"target",y.target,y,null)));if(p==null||typeof p=="symbol"||typeof p=="boolean"){s.removeAttribute(u);break}p=gd(""+p),s.setAttribute(u,p);break;case"onClick":p!=null&&(s.onclick=Us);break;case"onScroll":p!=null&&Nt("scroll",s);break;case"onScrollEnd":p!=null&&Nt("scrollend",s);break;case"dangerouslySetInnerHTML":if(p!=null){if(typeof p!="object"||!("__html"in p))throw Error(r(61));if(u=p.__html,u!=null){if(y.children!=null)throw Error(r(60));s.innerHTML=u}}break;case"multiple":s.multiple=p&&typeof p!="function"&&typeof p!="symbol";break;case"muted":s.muted=p&&typeof p!="function"&&typeof p!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(p==null||typeof p=="function"||typeof p=="boolean"||typeof p=="symbol"){s.removeAttribute("xlink:href");break}u=gd(""+p),s.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",u);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":p!=null&&typeof p!="function"&&typeof p!="symbol"?s.setAttribute(u,""+p):s.removeAttribute(u);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":p&&typeof p!="function"&&typeof p!="symbol"?s.setAttribute(u,""):s.removeAttribute(u);break;case"capture":case"download":p===!0?s.setAttribute(u,""):p!==!1&&p!=null&&typeof p!="function"&&typeof p!="symbol"?s.setAttribute(u,p):s.removeAttribute(u);break;case"cols":case"rows":case"size":case"span":p!=null&&typeof p!="function"&&typeof p!="symbol"&&!isNaN(p)&&1<=p?s.setAttribute(u,p):s.removeAttribute(u);break;case"rowSpan":case"start":p==null||typeof p=="function"||typeof p=="symbol"||isNaN(p)?s.removeAttribute(u):s.setAttribute(u,p);break;case"popover":Nt("beforetoggle",s),Nt("toggle",s),hd(s,"popover",p);break;case"xlinkActuate":Hs(s,"http://www.w3.org/1999/xlink","xlink:actuate",p);break;case"xlinkArcrole":Hs(s,"http://www.w3.org/1999/xlink","xlink:arcrole",p);break;case"xlinkRole":Hs(s,"http://www.w3.org/1999/xlink","xlink:role",p);break;case"xlinkShow":Hs(s,"http://www.w3.org/1999/xlink","xlink:show",p);break;case"xlinkTitle":Hs(s,"http://www.w3.org/1999/xlink","xlink:title",p);break;case"xlinkType":Hs(s,"http://www.w3.org/1999/xlink","xlink:type",p);break;case"xmlBase":Hs(s,"http://www.w3.org/XML/1998/namespace","xml:base",p);break;case"xmlLang":Hs(s,"http://www.w3.org/XML/1998/namespace","xml:lang",p);break;case"xmlSpace":Hs(s,"http://www.w3.org/XML/1998/namespace","xml:space",p);break;case"is":hd(s,"is",p);break;case"innerText":case"textContent":break;default:(!(2<u.length)||u[0]!=="o"&&u[0]!=="O"||u[1]!=="n"&&u[1]!=="N")&&(u=I6.get(u)||u,hd(s,u,p))}}function Ug(s,o,u,p,y,T){switch(u){case"style":Py(s,p,T);break;case"dangerouslySetInnerHTML":if(p!=null){if(typeof p!="object"||!("__html"in p))throw Error(r(61));if(u=p.__html,u!=null){if(y.children!=null)throw Error(r(60));s.innerHTML=u}}break;case"children":typeof p=="string"?Lo(s,p):(typeof p=="number"||typeof p=="bigint")&&Lo(s,""+p);break;case"onScroll":p!=null&&Nt("scroll",s);break;case"onScrollEnd":p!=null&&Nt("scrollend",s);break;case"onClick":p!=null&&(s.onclick=Us);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Ny.hasOwnProperty(u))e:{if(u[0]==="o"&&u[1]==="n"&&(y=u.endsWith("Capture"),o=u.slice(2,y?u.length-7:void 0),T=s[Kn]||null,T=T!=null?T[u]:null,typeof T=="function"&&s.removeEventListener(o,T,y),typeof p=="function")){typeof T!="function"&&T!==null&&(u in s?s[u]=null:s.hasAttribute(u)&&s.removeAttribute(u)),s.addEventListener(o,p,y);break e}u in s?s[u]=p:p===!0?s.setAttribute(u,""):hd(s,u,p)}}}function Jn(s,o,u){switch(o){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Nt("error",s),Nt("load",s);var p=!1,y=!1,T;for(T in u)if(u.hasOwnProperty(T)){var O=u[T];if(O!=null)switch(T){case"src":p=!0;break;case"srcSet":y=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(r(137,o));default:Gt(s,o,T,O,u,null)}}y&&Gt(s,o,"srcSet",u.srcSet,u,null),p&&Gt(s,o,"src",u.src,u,null);return;case"input":Nt("invalid",s);var z=T=O=y=null,ne=null,be=null;for(p in u)if(u.hasOwnProperty(p)){var we=u[p];if(we!=null)switch(p){case"name":y=we;break;case"type":O=we;break;case"checked":ne=we;break;case"defaultChecked":be=we;break;case"value":T=we;break;case"defaultValue":z=we;break;case"children":case"dangerouslySetInnerHTML":if(we!=null)throw Error(r(137,o));break;default:Gt(s,o,p,we,u,null)}}Iy(s,T,z,ne,be,O,y,!1);return;case"select":Nt("invalid",s),p=O=T=null;for(y in u)if(u.hasOwnProperty(y)&&(z=u[y],z!=null))switch(y){case"value":T=z;break;case"defaultValue":O=z;break;case"multiple":p=z;default:Gt(s,o,y,z,u,null)}o=T,u=O,s.multiple=!!p,o!=null?Mo(s,!!p,o,!1):u!=null&&Mo(s,!!p,u,!0);return;case"textarea":Nt("invalid",s),T=y=p=null;for(O in u)if(u.hasOwnProperty(O)&&(z=u[O],z!=null))switch(O){case"value":p=z;break;case"defaultValue":y=z;break;case"children":T=z;break;case"dangerouslySetInnerHTML":if(z!=null)throw Error(r(91));break;default:Gt(s,o,O,z,u,null)}Ly(s,p,y,T);return;case"option":for(ne in u)if(u.hasOwnProperty(ne)&&(p=u[ne],p!=null))switch(ne){case"selected":s.selected=p&&typeof p!="function"&&typeof p!="symbol";break;default:Gt(s,o,ne,p,u,null)}return;case"dialog":Nt("beforetoggle",s),Nt("toggle",s),Nt("cancel",s),Nt("close",s);break;case"iframe":case"object":Nt("load",s);break;case"video":case"audio":for(p=0;p<Hu.length;p++)Nt(Hu[p],s);break;case"image":Nt("error",s),Nt("load",s);break;case"details":Nt("toggle",s);break;case"embed":case"source":case"link":Nt("error",s),Nt("load",s);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(be in u)if(u.hasOwnProperty(be)&&(p=u[be],p!=null))switch(be){case"children":case"dangerouslySetInnerHTML":throw Error(r(137,o));default:Gt(s,o,be,p,u,null)}return;default:if(em(o)){for(we in u)u.hasOwnProperty(we)&&(p=u[we],p!==void 0&&Ug(s,o,we,p,u,void 0));return}}for(z in u)u.hasOwnProperty(z)&&(p=u[z],p!=null&&Gt(s,o,z,p,u,null))}function iI(s,o,u,p){switch(o){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var y=null,T=null,O=null,z=null,ne=null,be=null,we=null;for(Te in u){var Ae=u[Te];if(u.hasOwnProperty(Te)&&Ae!=null)switch(Te){case"checked":break;case"value":break;case"defaultValue":ne=Ae;default:p.hasOwnProperty(Te)||Gt(s,o,Te,null,p,Ae)}}for(var xe in p){var Te=p[xe];if(Ae=u[xe],p.hasOwnProperty(xe)&&(Te!=null||Ae!=null))switch(xe){case"type":T=Te;break;case"name":y=Te;break;case"checked":be=Te;break;case"defaultChecked":we=Te;break;case"value":O=Te;break;case"defaultValue":z=Te;break;case"children":case"dangerouslySetInnerHTML":if(Te!=null)throw Error(r(137,o));break;default:Te!==Ae&&Gt(s,o,xe,Te,p,Ae)}}Zp(s,O,z,ne,be,we,T,y);return;case"select":Te=O=z=xe=null;for(T in u)if(ne=u[T],u.hasOwnProperty(T)&&ne!=null)switch(T){case"value":break;case"multiple":Te=ne;default:p.hasOwnProperty(T)||Gt(s,o,T,null,p,ne)}for(y in p)if(T=p[y],ne=u[y],p.hasOwnProperty(y)&&(T!=null||ne!=null))switch(y){case"value":xe=T;break;case"defaultValue":z=T;break;case"multiple":O=T;default:T!==ne&&Gt(s,o,y,T,p,ne)}o=z,u=O,p=Te,xe!=null?Mo(s,!!u,xe,!1):!!p!=!!u&&(o!=null?Mo(s,!!u,o,!0):Mo(s,!!u,u?[]:"",!1));return;case"textarea":Te=xe=null;for(z in u)if(y=u[z],u.hasOwnProperty(z)&&y!=null&&!p.hasOwnProperty(z))switch(z){case"value":break;case"children":break;default:Gt(s,o,z,null,p,y)}for(O in p)if(y=p[O],T=u[O],p.hasOwnProperty(O)&&(y!=null||T!=null))switch(O){case"value":xe=y;break;case"defaultValue":Te=y;break;case"children":break;case"dangerouslySetInnerHTML":if(y!=null)throw Error(r(91));break;default:y!==T&&Gt(s,o,O,y,p,T)}My(s,xe,Te);return;case"option":for(var Ze in u)if(xe=u[Ze],u.hasOwnProperty(Ze)&&xe!=null&&!p.hasOwnProperty(Ze))switch(Ze){case"selected":s.selected=!1;break;default:Gt(s,o,Ze,null,p,xe)}for(ne in p)if(xe=p[ne],Te=u[ne],p.hasOwnProperty(ne)&&xe!==Te&&(xe!=null||Te!=null))switch(ne){case"selected":s.selected=xe&&typeof xe!="function"&&typeof xe!="symbol";break;default:Gt(s,o,ne,xe,p,Te)}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 it in u)xe=u[it],u.hasOwnProperty(it)&&xe!=null&&!p.hasOwnProperty(it)&&Gt(s,o,it,null,p,xe);for(be in p)if(xe=p[be],Te=u[be],p.hasOwnProperty(be)&&xe!==Te&&(xe!=null||Te!=null))switch(be){case"children":case"dangerouslySetInnerHTML":if(xe!=null)throw Error(r(137,o));break;default:Gt(s,o,be,xe,p,Te)}return;default:if(em(o)){for(var Xt in u)xe=u[Xt],u.hasOwnProperty(Xt)&&xe!==void 0&&!p.hasOwnProperty(Xt)&&Ug(s,o,Xt,void 0,p,xe);for(we in p)xe=p[we],Te=u[we],!p.hasOwnProperty(we)||xe===Te||xe===void 0&&Te===void 0||Ug(s,o,we,xe,p,Te);return}}for(var fe in u)xe=u[fe],u.hasOwnProperty(fe)&&xe!=null&&!p.hasOwnProperty(fe)&&Gt(s,o,fe,null,p,xe);for(Ae in p)xe=p[Ae],Te=u[Ae],!p.hasOwnProperty(Ae)||xe===Te||xe==null&&Te==null||Gt(s,o,Ae,xe,p,Te)}function jT(s){switch(s){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function aI(){if(typeof performance.getEntriesByType=="function"){for(var s=0,o=0,u=performance.getEntriesByType("resource"),p=0;p<u.length;p++){var y=u[p],T=y.transferSize,O=y.initiatorType,z=y.duration;if(T&&z&&jT(O)){for(O=0,z=y.responseEnd,p+=1;p<u.length;p++){var ne=u[p],be=ne.startTime;if(be>z)break;var we=ne.transferSize,Ae=ne.initiatorType;we&&jT(Ae)&&(ne=ne.responseEnd,O+=we*(ne<z?1:(z-be)/(ne-be)))}if(--p,o+=8*(T+O)/(y.duration/1e3),s++,10<s)break}}if(0<s)return o/s/1e6}return navigator.connection&&(s=navigator.connection.downlink,typeof s=="number")?s:5}var zg=null,Fg=null;function ff(s){return s.nodeType===9?s:s.ownerDocument}function BT(s){switch(s){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function HT(s,o){if(s===0)switch(o){case"svg":return 1;case"math":return 2;default:return 0}return s===1&&o==="foreignObject"?0:s}function $g(s,o){return s==="textarea"||s==="noscript"||typeof o.children=="string"||typeof o.children=="number"||typeof o.children=="bigint"||typeof o.dangerouslySetInnerHTML=="object"&&o.dangerouslySetInnerHTML!==null&&o.dangerouslySetInnerHTML.__html!=null}var Vg=null;function oI(){var s=window.event;return s&&s.type==="popstate"?s===Vg?!1:(Vg=s,!0):(Vg=null,!1)}var UT=typeof setTimeout=="function"?setTimeout:void 0,lI=typeof clearTimeout=="function"?clearTimeout:void 0,zT=typeof Promise=="function"?Promise:void 0,uI=typeof queueMicrotask=="function"?queueMicrotask:typeof zT<"u"?function(s){return zT.resolve(null).then(s).catch(cI)}:UT;function cI(s){setTimeout(function(){throw s})}function ji(s){return s==="head"}function FT(s,o){var u=o,p=0;do{var y=u.nextSibling;if(s.removeChild(u),y&&y.nodeType===8)if(u=y.data,u==="/$"||u==="/&"){if(p===0){s.removeChild(y),dl(o);return}p--}else if(u==="$"||u==="$?"||u==="$~"||u==="$!"||u==="&")p++;else if(u==="html")zu(s.ownerDocument.documentElement);else if(u==="head"){u=s.ownerDocument.head,zu(u);for(var T=u.firstChild;T;){var O=T.nextSibling,z=T.nodeName;T[iu]||z==="SCRIPT"||z==="STYLE"||z==="LINK"&&T.rel.toLowerCase()==="stylesheet"||u.removeChild(T),T=O}}else u==="body"&&zu(s.ownerDocument.body);u=y}while(u);dl(o)}function $T(s,o){var u=s;s=0;do{var p=u.nextSibling;if(u.nodeType===1?o?(u._stashedDisplay=u.style.display,u.style.display="none"):(u.style.display=u._stashedDisplay||"",u.getAttribute("style")===""&&u.removeAttribute("style")):u.nodeType===3&&(o?(u._stashedText=u.nodeValue,u.nodeValue=""):u.nodeValue=u._stashedText||""),p&&p.nodeType===8)if(u=p.data,u==="/$"){if(s===0)break;s--}else u!=="$"&&u!=="$?"&&u!=="$~"&&u!=="$!"||s++;u=p}while(u)}function qg(s){var o=s.firstChild;for(o&&o.nodeType===10&&(o=o.nextSibling);o;){var u=o;switch(o=o.nextSibling,u.nodeName){case"HTML":case"HEAD":case"BODY":qg(u),Qp(u);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(u.rel.toLowerCase()==="stylesheet")continue}s.removeChild(u)}}function dI(s,o,u,p){for(;s.nodeType===1;){var y=u;if(s.nodeName.toLowerCase()!==o.toLowerCase()){if(!p&&(s.nodeName!=="INPUT"||s.type!=="hidden"))break}else if(p){if(!s[iu])switch(o){case"meta":if(!s.hasAttribute("itemprop"))break;return s;case"link":if(T=s.getAttribute("rel"),T==="stylesheet"&&s.hasAttribute("data-precedence"))break;if(T!==y.rel||s.getAttribute("href")!==(y.href==null||y.href===""?null:y.href)||s.getAttribute("crossorigin")!==(y.crossOrigin==null?null:y.crossOrigin)||s.getAttribute("title")!==(y.title==null?null:y.title))break;return s;case"style":if(s.hasAttribute("data-precedence"))break;return s;case"script":if(T=s.getAttribute("src"),(T!==(y.src==null?null:y.src)||s.getAttribute("type")!==(y.type==null?null:y.type)||s.getAttribute("crossorigin")!==(y.crossOrigin==null?null:y.crossOrigin))&&T&&s.hasAttribute("async")&&!s.hasAttribute("itemprop"))break;return s;default:return s}}else if(o==="input"&&s.type==="hidden"){var T=y.name==null?null:""+y.name;if(y.type==="hidden"&&s.getAttribute("name")===T)return s}else return s;if(s=ts(s.nextSibling),s===null)break}return null}function fI(s,o,u){if(o==="")return null;for(;s.nodeType!==3;)if((s.nodeType!==1||s.nodeName!=="INPUT"||s.type!=="hidden")&&!u||(s=ts(s.nextSibling),s===null))return null;return s}function VT(s,o){for(;s.nodeType!==8;)if((s.nodeType!==1||s.nodeName!=="INPUT"||s.type!=="hidden")&&!o||(s=ts(s.nextSibling),s===null))return null;return s}function Yg(s){return s.data==="$?"||s.data==="$~"}function Gg(s){return s.data==="$!"||s.data==="$?"&&s.ownerDocument.readyState!=="loading"}function hI(s,o){var u=s.ownerDocument;if(s.data==="$~")s._reactRetry=o;else if(s.data!=="$?"||u.readyState!=="loading")o();else{var p=function(){o(),u.removeEventListener("DOMContentLoaded",p)};u.addEventListener("DOMContentLoaded",p),s._reactRetry=p}}function ts(s){for(;s!=null;s=s.nextSibling){var o=s.nodeType;if(o===1||o===3)break;if(o===8){if(o=s.data,o==="$"||o==="$!"||o==="$?"||o==="$~"||o==="&"||o==="F!"||o==="F")break;if(o==="/$"||o==="/&")return null}}return s}var Xg=null;function qT(s){s=s.nextSibling;for(var o=0;s;){if(s.nodeType===8){var u=s.data;if(u==="/$"||u==="/&"){if(o===0)return ts(s.nextSibling);o--}else u!=="$"&&u!=="$!"&&u!=="$?"&&u!=="$~"&&u!=="&"||o++}s=s.nextSibling}return null}function YT(s){s=s.previousSibling;for(var o=0;s;){if(s.nodeType===8){var u=s.data;if(u==="$"||u==="$!"||u==="$?"||u==="$~"||u==="&"){if(o===0)return s;o--}else u!=="/$"&&u!=="/&"||o++}s=s.previousSibling}return null}function GT(s,o,u){switch(o=ff(u),s){case"html":if(s=o.documentElement,!s)throw Error(r(452));return s;case"head":if(s=o.head,!s)throw Error(r(453));return s;case"body":if(s=o.body,!s)throw Error(r(454));return s;default:throw Error(r(451))}}function zu(s){for(var o=s.attributes;o.length;)s.removeAttributeNode(o[0]);Qp(s)}var ns=new Map,XT=new Set;function hf(s){return typeof s.getRootNode=="function"?s.getRootNode():s.nodeType===9?s:s.ownerDocument}var ni=q.d;q.d={f:pI,r:mI,D:gI,C:bI,L:xI,m:yI,X:vI,S:EI,M:TI};function pI(){var s=ni.f(),o=rf();return s||o}function mI(s){var o=Ro(s);o!==null&&o.tag===5&&o.type==="form"?dv(o):ni.r(s)}var ll=typeof document>"u"?null:document;function KT(s,o,u){var p=ll;if(p&&typeof o=="string"&&o){var y=Xr(o);y='link[rel="'+s+'"][href="'+y+'"]',typeof u=="string"&&(y+='[crossorigin="'+u+'"]'),XT.has(y)||(XT.add(y),s={rel:s,crossOrigin:u,href:o},p.querySelector(y)===null&&(o=p.createElement("link"),Jn(o,"link",s),zn(o),p.head.appendChild(o)))}}function gI(s){ni.D(s),KT("dns-prefetch",s,null)}function bI(s,o){ni.C(s,o),KT("preconnect",s,o)}function xI(s,o,u){ni.L(s,o,u);var p=ll;if(p&&s&&o){var y='link[rel="preload"][as="'+Xr(o)+'"]';o==="image"&&u&&u.imageSrcSet?(y+='[imagesrcset="'+Xr(u.imageSrcSet)+'"]',typeof u.imageSizes=="string"&&(y+='[imagesizes="'+Xr(u.imageSizes)+'"]')):y+='[href="'+Xr(s)+'"]';var T=y;switch(o){case"style":T=ul(s);break;case"script":T=cl(s)}ns.has(T)||(s=h({rel:"preload",href:o==="image"&&u&&u.imageSrcSet?void 0:s,as:o},u),ns.set(T,s),p.querySelector(y)!==null||o==="style"&&p.querySelector(Fu(T))||o==="script"&&p.querySelector($u(T))||(o=p.createElement("link"),Jn(o,"link",s),zn(o),p.head.appendChild(o)))}}function yI(s,o){ni.m(s,o);var u=ll;if(u&&s){var p=o&&typeof o.as=="string"?o.as:"script",y='link[rel="modulepreload"][as="'+Xr(p)+'"][href="'+Xr(s)+'"]',T=y;switch(p){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":T=cl(s)}if(!ns.has(T)&&(s=h({rel:"modulepreload",href:s},o),ns.set(T,s),u.querySelector(y)===null)){switch(p){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(u.querySelector($u(T)))return}p=u.createElement("link"),Jn(p,"link",s),zn(p),u.head.appendChild(p)}}}function EI(s,o,u){ni.S(s,o,u);var p=ll;if(p&&s){var y=Oo(p).hoistableStyles,T=ul(s);o=o||"default";var O=y.get(T);if(!O){var z={loading:0,preload:null};if(O=p.querySelector(Fu(T)))z.loading=5;else{s=h({rel:"stylesheet",href:s,"data-precedence":o},u),(u=ns.get(T))&&Kg(s,u);var ne=O=p.createElement("link");zn(ne),Jn(ne,"link",s),ne._p=new Promise(function(be,we){ne.onload=be,ne.onerror=we}),ne.addEventListener("load",function(){z.loading|=1}),ne.addEventListener("error",function(){z.loading|=2}),z.loading|=4,pf(O,o,p)}O={type:"stylesheet",instance:O,count:1,state:z},y.set(T,O)}}}function vI(s,o){ni.X(s,o);var u=ll;if(u&&s){var p=Oo(u).hoistableScripts,y=cl(s),T=p.get(y);T||(T=u.querySelector($u(y)),T||(s=h({src:s,async:!0},o),(o=ns.get(y))&&Qg(s,o),T=u.createElement("script"),zn(T),Jn(T,"link",s),u.head.appendChild(T)),T={type:"script",instance:T,count:1,state:null},p.set(y,T))}}function TI(s,o){ni.M(s,o);var u=ll;if(u&&s){var p=Oo(u).hoistableScripts,y=cl(s),T=p.get(y);T||(T=u.querySelector($u(y)),T||(s=h({src:s,async:!0,type:"module"},o),(o=ns.get(y))&&Qg(s,o),T=u.createElement("script"),zn(T),Jn(T,"link",s),u.head.appendChild(T)),T={type:"script",instance:T,count:1,state:null},p.set(y,T))}}function QT(s,o,u,p){var y=(y=ce.current)?hf(y):null;if(!y)throw Error(r(446));switch(s){case"meta":case"title":return null;case"style":return typeof u.precedence=="string"&&typeof u.href=="string"?(o=ul(u.href),u=Oo(y).hoistableStyles,p=u.get(o),p||(p={type:"style",instance:null,count:0,state:null},u.set(o,p)),p):{type:"void",instance:null,count:0,state:null};case"link":if(u.rel==="stylesheet"&&typeof u.href=="string"&&typeof u.precedence=="string"){s=ul(u.href);var T=Oo(y).hoistableStyles,O=T.get(s);if(O||(y=y.ownerDocument||y,O={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},T.set(s,O),(T=y.querySelector(Fu(s)))&&!T._p&&(O.instance=T,O.state.loading=5),ns.has(s)||(u={rel:"preload",as:"style",href:u.href,crossOrigin:u.crossOrigin,integrity:u.integrity,media:u.media,hrefLang:u.hrefLang,referrerPolicy:u.referrerPolicy},ns.set(s,u),T||SI(y,s,u,O.state))),o&&p===null)throw Error(r(528,""));return O}if(o&&p!==null)throw Error(r(529,""));return null;case"script":return o=u.async,u=u.src,typeof u=="string"&&o&&typeof o!="function"&&typeof o!="symbol"?(o=cl(u),u=Oo(y).hoistableScripts,p=u.get(o),p||(p={type:"script",instance:null,count:0,state:null},u.set(o,p)),p):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,s))}}function ul(s){return'href="'+Xr(s)+'"'}function Fu(s){return'link[rel="stylesheet"]['+s+"]"}function WT(s){return h({},s,{"data-precedence":s.precedence,precedence:null})}function SI(s,o,u,p){s.querySelector('link[rel="preload"][as="style"]['+o+"]")?p.loading=1:(o=s.createElement("link"),p.preload=o,o.addEventListener("load",function(){return p.loading|=1}),o.addEventListener("error",function(){return p.loading|=2}),Jn(o,"link",u),zn(o),s.head.appendChild(o))}function cl(s){return'[src="'+Xr(s)+'"]'}function $u(s){return"script[async]"+s}function ZT(s,o,u){if(o.count++,o.instance===null)switch(o.type){case"style":var p=s.querySelector('style[data-href~="'+Xr(u.href)+'"]');if(p)return o.instance=p,zn(p),p;var y=h({},u,{"data-href":u.href,"data-precedence":u.precedence,href:null,precedence:null});return p=(s.ownerDocument||s).createElement("style"),zn(p),Jn(p,"style",y),pf(p,u.precedence,s),o.instance=p;case"stylesheet":y=ul(u.href);var T=s.querySelector(Fu(y));if(T)return o.state.loading|=4,o.instance=T,zn(T),T;p=WT(u),(y=ns.get(y))&&Kg(p,y),T=(s.ownerDocument||s).createElement("link"),zn(T);var O=T;return O._p=new Promise(function(z,ne){O.onload=z,O.onerror=ne}),Jn(T,"link",p),o.state.loading|=4,pf(T,u.precedence,s),o.instance=T;case"script":return T=cl(u.src),(y=s.querySelector($u(T)))?(o.instance=y,zn(y),y):(p=u,(y=ns.get(T))&&(p=h({},u),Qg(p,y)),s=s.ownerDocument||s,y=s.createElement("script"),zn(y),Jn(y,"link",p),s.head.appendChild(y),o.instance=y);case"void":return null;default:throw Error(r(443,o.type))}else o.type==="stylesheet"&&(o.state.loading&4)===0&&(p=o.instance,o.state.loading|=4,pf(p,u.precedence,s));return o.instance}function pf(s,o,u){for(var p=u.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),y=p.length?p[p.length-1]:null,T=y,O=0;O<p.length;O++){var z=p[O];if(z.dataset.precedence===o)T=z;else if(T!==y)break}T?T.parentNode.insertBefore(s,T.nextSibling):(o=u.nodeType===9?u.head:u,o.insertBefore(s,o.firstChild))}function Kg(s,o){s.crossOrigin==null&&(s.crossOrigin=o.crossOrigin),s.referrerPolicy==null&&(s.referrerPolicy=o.referrerPolicy),s.title==null&&(s.title=o.title)}function Qg(s,o){s.crossOrigin==null&&(s.crossOrigin=o.crossOrigin),s.referrerPolicy==null&&(s.referrerPolicy=o.referrerPolicy),s.integrity==null&&(s.integrity=o.integrity)}var mf=null;function JT(s,o,u){if(mf===null){var p=new Map,y=mf=new Map;y.set(u,p)}else y=mf,p=y.get(u),p||(p=new Map,y.set(u,p));if(p.has(s))return p;for(p.set(s,null),u=u.getElementsByTagName(s),y=0;y<u.length;y++){var T=u[y];if(!(T[iu]||T[en]||s==="link"&&T.getAttribute("rel")==="stylesheet")&&T.namespaceURI!=="http://www.w3.org/2000/svg"){var O=T.getAttribute(o)||"";O=s+O;var z=p.get(O);z?z.push(T):p.set(O,[T])}}return p}function e2(s,o,u){s=s.ownerDocument||s,s.head.insertBefore(u,o==="title"?s.querySelector("head > title"):null)}function CI(s,o,u){if(u===1||o.itemProp!=null)return!1;switch(s){case"meta":case"title":return!0;case"style":if(typeof o.precedence!="string"||typeof o.href!="string"||o.href==="")break;return!0;case"link":if(typeof o.rel!="string"||typeof o.href!="string"||o.href===""||o.onLoad||o.onError)break;switch(o.rel){case"stylesheet":return s=o.disabled,typeof o.precedence=="string"&&s==null;default:return!0}case"script":if(o.async&&typeof o.async!="function"&&typeof o.async!="symbol"&&!o.onLoad&&!o.onError&&o.src&&typeof o.src=="string")return!0}return!1}function t2(s){return!(s.type==="stylesheet"&&(s.state.loading&3)===0)}function kI(s,o,u,p){if(u.type==="stylesheet"&&(typeof p.media!="string"||matchMedia(p.media).matches!==!1)&&(u.state.loading&4)===0){if(u.instance===null){var y=ul(p.href),T=o.querySelector(Fu(y));if(T){o=T._p,o!==null&&typeof o=="object"&&typeof o.then=="function"&&(s.count++,s=gf.bind(s),o.then(s,s)),u.state.loading|=4,u.instance=T,zn(T);return}T=o.ownerDocument||o,p=WT(p),(y=ns.get(y))&&Kg(p,y),T=T.createElement("link"),zn(T);var O=T;O._p=new Promise(function(z,ne){O.onload=z,O.onerror=ne}),Jn(T,"link",p),u.instance=T}s.stylesheets===null&&(s.stylesheets=new Map),s.stylesheets.set(u,o),(o=u.state.preload)&&(u.state.loading&3)===0&&(s.count++,u=gf.bind(s),o.addEventListener("load",u),o.addEventListener("error",u))}}var Wg=0;function wI(s,o){return s.stylesheets&&s.count===0&&xf(s,s.stylesheets),0<s.count||0<s.imgCount?function(u){var p=setTimeout(function(){if(s.stylesheets&&xf(s,s.stylesheets),s.unsuspend){var T=s.unsuspend;s.unsuspend=null,T()}},6e4+o);0<s.imgBytes&&Wg===0&&(Wg=62500*aI());var y=setTimeout(function(){if(s.waitingForImages=!1,s.count===0&&(s.stylesheets&&xf(s,s.stylesheets),s.unsuspend)){var T=s.unsuspend;s.unsuspend=null,T()}},(s.imgBytes>Wg?50:800)+o);return s.unsuspend=u,function(){s.unsuspend=null,clearTimeout(p),clearTimeout(y)}}:null}function gf(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)xf(this,this.stylesheets);else if(this.unsuspend){var s=this.unsuspend;this.unsuspend=null,s()}}}var bf=null;function xf(s,o){s.stylesheets=null,s.unsuspend!==null&&(s.count++,bf=new Map,o.forEach(NI,s),bf=null,gf.call(s))}function NI(s,o){if(!(o.state.loading&4)){var u=bf.get(s);if(u)var p=u.get(null);else{u=new Map,bf.set(s,u);for(var y=s.querySelectorAll("link[data-precedence],style[data-precedence]"),T=0;T<y.length;T++){var O=y[T];(O.nodeName==="LINK"||O.getAttribute("media")!=="not all")&&(u.set(O.dataset.precedence,O),p=O)}p&&u.set(null,p)}y=o.instance,O=y.getAttribute("data-precedence"),T=u.get(O)||p,T===p&&u.set(null,y),u.set(O,y),this.count++,p=gf.bind(this),y.addEventListener("load",p),y.addEventListener("error",p),T?T.parentNode.insertBefore(y,T.nextSibling):(s=s.nodeType===9?s.head:s,s.insertBefore(y,s.firstChild)),o.state.loading|=4}}var Vu={$$typeof:A,Provider:null,Consumer:null,_currentValue:J,_currentValue2:J,_threadCount:0};function AI(s,o,u,p,y,T,O,z,ne){this.tag=1,this.containerInfo=s,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=Xn(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Xn(0),this.hiddenUpdates=Xn(null),this.identifierPrefix=p,this.onUncaughtError=y,this.onCaughtError=T,this.onRecoverableError=O,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=ne,this.incompleteTransitions=new Map}function n2(s,o,u,p,y,T,O,z,ne,be,we,Ae){return s=new AI(s,o,u,O,ne,be,we,Ae,z),o=1,T===!0&&(o|=24),T=Dr(3,null,null,o),s.current=T,T.stateNode=s,o=Rm(),o.refCount++,s.pooledCache=o,o.refCount++,T.memoizedState={element:p,isDehydrated:u,cache:o},Lm(T),s}function r2(s){return s?(s=zo,s):zo}function s2(s,o,u,p,y,T){y=r2(y),p.context===null?p.context=y:p.pendingContext=y,p=wi(o),p.payload={element:u},T=T===void 0?null:T,T!==null&&(p.callback=T),u=Ni(s,p,o),u!==null&&(wr(u,s,o),Tu(u,s,o))}function i2(s,o){if(s=s.memoizedState,s!==null&&s.dehydrated!==null){var u=s.retryLane;s.retryLane=u!==0&&u<o?u:o}}function Zg(s,o){i2(s,o),(s=s.alternate)&&i2(s,o)}function a2(s){if(s.tag===13||s.tag===31){var o=Sa(s,67108864);o!==null&&wr(o,s,67108864),Zg(s,67108864)}}function o2(s){if(s.tag===13||s.tag===31){var o=Ur();o=ht(o);var u=Sa(s,o);u!==null&&wr(u,s,o),Zg(s,o)}}var yf=!0;function _I(s,o,u,p){var y=H.T;H.T=null;var T=q.p;try{q.p=2,Jg(s,o,u,p)}finally{q.p=T,H.T=y}}function RI(s,o,u,p){var y=H.T;H.T=null;var T=q.p;try{q.p=8,Jg(s,o,u,p)}finally{q.p=T,H.T=y}}function Jg(s,o,u,p){if(yf){var y=e0(p);if(y===null)Hg(s,o,p,Ef,u),u2(s,p);else if(II(y,s,o,u,p))p.stopPropagation();else if(u2(s,p),o&4&&-1<OI.indexOf(s)){for(;y!==null;){var T=Ro(y);if(T!==null)switch(T.tag){case 3:if(T=T.stateNode,T.current.memoizedState.isDehydrated){var O=Zt(T.pendingLanes);if(O!==0){var z=T;for(z.pendingLanes|=2,z.entangledLanes|=2;O;){var ne=1<<31-Ve(O);z.entanglements[1]|=ne,O&=~ne}vs(T),(Ft&6)===0&&(tf=se()+500,Bu(0))}}break;case 31:case 13:z=Sa(T,2),z!==null&&wr(z,T,2),rf(),Zg(T,2)}if(T=e0(p),T===null&&Hg(s,o,p,Ef,u),T===y)break;y=T}y!==null&&p.stopPropagation()}else Hg(s,o,p,null,u)}}function e0(s){return s=nm(s),t0(s)}var Ef=null;function t0(s){if(Ef=null,s=_o(s),s!==null){var o=a(s);if(o===null)s=null;else{var u=o.tag;if(u===13){if(s=l(o),s!==null)return s;s=null}else if(u===31){if(s=c(o),s!==null)return s;s=null}else if(u===3){if(o.stateNode.current.memoizedState.isDehydrated)return o.tag===3?o.stateNode.containerInfo:null;s=null}else o!==s&&(s=null)}}return Ef=s,null}function l2(s){switch(s){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(re()){case Q:return 2;case $:return 8;case oe:case Se:return 32;case _e:return 268435456;default:return 32}default:return 32}}var n0=!1,Bi=null,Hi=null,Ui=null,qu=new Map,Yu=new Map,zi=[],OI="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 u2(s,o){switch(s){case"focusin":case"focusout":Bi=null;break;case"dragenter":case"dragleave":Hi=null;break;case"mouseover":case"mouseout":Ui=null;break;case"pointerover":case"pointerout":qu.delete(o.pointerId);break;case"gotpointercapture":case"lostpointercapture":Yu.delete(o.pointerId)}}function Gu(s,o,u,p,y,T){return s===null||s.nativeEvent!==T?(s={blockedOn:o,domEventName:u,eventSystemFlags:p,nativeEvent:T,targetContainers:[y]},o!==null&&(o=Ro(o),o!==null&&a2(o)),s):(s.eventSystemFlags|=p,o=s.targetContainers,y!==null&&o.indexOf(y)===-1&&o.push(y),s)}function II(s,o,u,p,y){switch(o){case"focusin":return Bi=Gu(Bi,s,o,u,p,y),!0;case"dragenter":return Hi=Gu(Hi,s,o,u,p,y),!0;case"mouseover":return Ui=Gu(Ui,s,o,u,p,y),!0;case"pointerover":var T=y.pointerId;return qu.set(T,Gu(qu.get(T)||null,s,o,u,p,y)),!0;case"gotpointercapture":return T=y.pointerId,Yu.set(T,Gu(Yu.get(T)||null,s,o,u,p,y)),!0}return!1}function c2(s){var o=_o(s.target);if(o!==null){var u=a(o);if(u!==null){if(o=u.tag,o===13){if(o=l(u),o!==null){s.blockedOn=o,Un(s.priority,function(){o2(u)});return}}else if(o===31){if(o=c(u),o!==null){s.blockedOn=o,Un(s.priority,function(){o2(u)});return}}else if(o===3&&u.stateNode.current.memoizedState.isDehydrated){s.blockedOn=u.tag===3?u.stateNode.containerInfo:null;return}}}s.blockedOn=null}function vf(s){if(s.blockedOn!==null)return!1;for(var o=s.targetContainers;0<o.length;){var u=e0(s.nativeEvent);if(u===null){u=s.nativeEvent;var p=new u.constructor(u.type,u);tm=p,u.target.dispatchEvent(p),tm=null}else return o=Ro(u),o!==null&&a2(o),s.blockedOn=u,!1;o.shift()}return!0}function d2(s,o,u){vf(s)&&u.delete(o)}function MI(){n0=!1,Bi!==null&&vf(Bi)&&(Bi=null),Hi!==null&&vf(Hi)&&(Hi=null),Ui!==null&&vf(Ui)&&(Ui=null),qu.forEach(d2),Yu.forEach(d2)}function Tf(s,o){s.blockedOn===o&&(s.blockedOn=null,n0||(n0=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,MI)))}var Sf=null;function f2(s){Sf!==s&&(Sf=s,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){Sf===s&&(Sf=null);for(var o=0;o<s.length;o+=3){var u=s[o],p=s[o+1],y=s[o+2];if(typeof p!="function"){if(t0(p||u)===null)continue;break}var T=Ro(u);T!==null&&(s.splice(o,3),o-=3,eg(T,{pending:!0,data:y,method:u.method,action:p},p,y))}}))}function dl(s){function o(ne){return Tf(ne,s)}Bi!==null&&Tf(Bi,s),Hi!==null&&Tf(Hi,s),Ui!==null&&Tf(Ui,s),qu.forEach(o),Yu.forEach(o);for(var u=0;u<zi.length;u++){var p=zi[u];p.blockedOn===s&&(p.blockedOn=null)}for(;0<zi.length&&(u=zi[0],u.blockedOn===null);)c2(u),u.blockedOn===null&&zi.shift();if(u=(s.ownerDocument||s).$$reactFormReplay,u!=null)for(p=0;p<u.length;p+=3){var y=u[p],T=u[p+1],O=y[Kn]||null;if(typeof T=="function")O||f2(u);else if(O){var z=null;if(T&&T.hasAttribute("formAction")){if(y=T,O=T[Kn]||null)z=O.formAction;else if(t0(y)!==null)continue}else z=O.action;typeof z=="function"?u[p+1]=z:(u.splice(p,3),p-=3),f2(u)}}}function h2(){function s(T){T.canIntercept&&T.info==="react-transition"&&T.intercept({handler:function(){return new Promise(function(O){return y=O})},focusReset:"manual",scroll:"manual"})}function o(){y!==null&&(y(),y=null),p||setTimeout(u,20)}function u(){if(!p&&!navigation.transition){var T=navigation.currentEntry;T&&T.url!=null&&navigation.navigate(T.url,{state:T.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var p=!1,y=null;return navigation.addEventListener("navigate",s),navigation.addEventListener("navigatesuccess",o),navigation.addEventListener("navigateerror",o),setTimeout(u,100),function(){p=!0,navigation.removeEventListener("navigate",s),navigation.removeEventListener("navigatesuccess",o),navigation.removeEventListener("navigateerror",o),y!==null&&(y(),y=null)}}}function r0(s){this._internalRoot=s}Cf.prototype.render=r0.prototype.render=function(s){var o=this._internalRoot;if(o===null)throw Error(r(409));var u=o.current,p=Ur();s2(u,p,s,o,null,null)},Cf.prototype.unmount=r0.prototype.unmount=function(){var s=this._internalRoot;if(s!==null){this._internalRoot=null;var o=s.containerInfo;s2(s.current,2,null,s,null,null),rf(),o[bs]=null}};function Cf(s){this._internalRoot=s}Cf.prototype.unstable_scheduleHydration=function(s){if(s){var o=bn();s={blockedOn:null,target:s,priority:o};for(var u=0;u<zi.length&&o!==0&&o<zi[u].priority;u++);zi.splice(u,0,s),u===0&&c2(s)}};var p2=t.version;if(p2!=="19.2.7")throw Error(r(527,p2,"19.2.7"));q.findDOMNode=function(s){var o=s._reactInternals;if(o===void 0)throw typeof s.render=="function"?Error(r(188)):(s=Object.keys(s).join(","),Error(r(268,s)));return s=f(o),s=s!==null?g(s):null,s=s===null?null:s.stateNode,s};var LI={bundleType:0,version:"19.2.7",rendererPackageName:"react-dom",currentDispatcherRef:H,reconcilerVersion:"19.2.7"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var kf=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!kf.isDisabled&&kf.supportsFiber)try{et=kf.inject(LI),dt=kf}catch{}}return Ku.createRoot=function(s,o){if(!i(s))throw Error(r(299));var u=!1,p="",y=vv,T=Tv,O=Sv;return o!=null&&(o.unstable_strictMode===!0&&(u=!0),o.identifierPrefix!==void 0&&(p=o.identifierPrefix),o.onUncaughtError!==void 0&&(y=o.onUncaughtError),o.onCaughtError!==void 0&&(T=o.onCaughtError),o.onRecoverableError!==void 0&&(O=o.onRecoverableError)),o=n2(s,1,!1,null,null,u,p,null,y,T,O,h2),s[bs]=o.current,Bg(s),new r0(o)},Ku.hydrateRoot=function(s,o,u){if(!i(s))throw Error(r(299));var p=!1,y="",T=vv,O=Tv,z=Sv,ne=null;return u!=null&&(u.unstable_strictMode===!0&&(p=!0),u.identifierPrefix!==void 0&&(y=u.identifierPrefix),u.onUncaughtError!==void 0&&(T=u.onUncaughtError),u.onCaughtError!==void 0&&(O=u.onCaughtError),u.onRecoverableError!==void 0&&(z=u.onRecoverableError),u.formState!==void 0&&(ne=u.formState)),o=n2(s,1,!0,o,u??null,p,y,ne,T,O,z,h2),o.context=r2(null),u=o.current,p=Ur(),p=ht(p),y=wi(p),y.callback=null,Ni(u,y,p),u=p,o.current.lanes=u,Et(o,u),vs(o),s[bs]=o.current,Bg(s),new Cf(o)},Ku.version="19.2.7",Ku}var C2;function qI(){if(C2)return a0.exports;C2=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(t){console.error(t)}}return e(),a0.exports=VI(),a0.exports}var YI=qI();const kw="workerdeck.theme";function S1(){try{const e=localStorage.getItem(kw);if(e==="light"||e==="dark")return e}catch{}return matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}function ww(e=S1()){document.documentElement.setAttribute("data-theme",e)}function GI(e){try{localStorage.setItem(kw,e)}catch{}ww(e)}function XI(){const e=S1()==="dark"?"light":"dark";return GI(e),e}var dc=typeof window<"u"?E.useLayoutEffect:E.useEffect;function c0(e){const t=E.useRef({value:e,prev:null}),n=t.current.value;return e!==n&&(t.current={value:e,prev:n}),t.current.prev}function KI(e,t,n={},r={}){E.useEffect(()=>{if(!e.current||r.disabled||typeof IntersectionObserver!="function")return;const i=new IntersectionObserver(([a])=>{t(a)},n);return i.observe(e.current),()=>{i.disconnect()}},[t,n,r.disabled,e])}function QI(e){const t=E.useRef(null);return E.useImperativeHandle(e,()=>t.current,[]),t}const Nw=!1;function Lc(e){return e[e.length-1]}function WI(e){return typeof e=="function"}function Ya(e,t){return WI(e)?e(t):e}const Aw=Object.prototype.hasOwnProperty,k2=Object.prototype.propertyIsEnumerable;function _w(e){for(const t in e)if(Aw.call(e,t))return!0;return!1}const ZI=()=>Object.create(null),Pa=(e,t)=>Ga(e,t,ZI);function Ga(e,t,n=()=>({}),r=0){if(e===t)return e;if(r>500)return t;const i=t,a=A2(e)&&A2(i);if(!a&&!(Th(e)&&Th(i)))return i;const l=a?e:w2(e);if(!l)return i;const c=a?i:w2(i);if(!c)return i;const d=l.length,f=c.length,g=a?new Array(f):n();let h=0;for(let b=0;b<f;b++){const x=a?b:c[b],v=e[x],w=i[x];if(v===w){g[x]=v,(a?b<d:Aw.call(e,x))&&h++;continue}if(v===null||w===null||typeof v!="object"||typeof w!="object"){g[x]=w;continue}const k=Ga(v,w,n,r+1);g[x]=k,k===v&&h++}return d===f&&h===d?e:g}function w2(e){const t=Object.getOwnPropertyNames(e);for(const i of t)if(!k2.call(e,i))return!1;const n=Object.getOwnPropertySymbols(e);if(n.length===0)return t;const r=t;for(const i of n){if(!k2.call(e,i))return!1;r.push(i)}return r}function Th(e){if(!N2(e))return!1;const t=e.constructor;if(typeof t>"u")return!0;const n=t.prototype;return!(!N2(n)||!n.hasOwnProperty("isPrototypeOf"))}function N2(e){return Object.prototype.toString.call(e)==="[object Object]"}function A2(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Za(e,t,n){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return!1;for(let r=0,i=e.length;r<i;r++)if(!Za(e[r],t[r],n))return!1;return!0}if(Th(e)&&Th(t)){const r=n?.ignoreUndefined??!0;if(n?.partial){for(const l in t)if((!r||t[l]!==void 0)&&!Za(e[l],t[l],n))return!1;return!0}let i=0;if(!r)i=Object.keys(e).length;else for(const l in e)e[l]!==void 0&&i++;let a=0;for(const l in t)if((!r||t[l]!==void 0)&&(a++,a>i||!Za(e[l],t[l],n)))return!1;return i===a}return!1}function Al(e){let t,n;const r=new Promise((i,a)=>{t=i,n=a});return r.status="pending",r.resolve=i=>{r.status="resolved",r.value=i,t(i),e?.(i)},r.reject=i=>{r.status="rejected",n(i)},r}function Dc(e){return!!(e&&typeof e=="object"&&typeof e.then=="function")}const JI=/[\x00-\x1f\x7f"<>`{}]/g;function e5(e){return e.replace(JI,t=>"%"+t.charCodeAt(0).toString(16).toUpperCase().padStart(2,"0"))}function _2(e){let t;try{t=decodeURI(e)}catch{t=e.replaceAll(/%[0-9A-F]{2}/gi,n=>{try{return decodeURI(n)}catch{return n}})}return e5(t)}const t5=["http:","https:","mailto:","tel:"];function Sh(e,t){if(!e)return!1;try{const n=new URL(e);return!t.has(n.protocol)}catch{return!1}}function Qu(e){if(!e)return{path:e,handledProtocolRelativeURL:!1};if(!/[%\\\x00-\x1f\x7f]/.test(e)&&!e.startsWith("//"))return{path:e,handledProtocolRelativeURL:!1};const t=/%25|%5C/gi;let n=0,r="",i;for(;(i=t.exec(e))!==null;)r+=_2(e.slice(n,i.index))+i[0],n=t.lastIndex;r=r+_2(n?e.slice(n):e);let a=!1;return r.startsWith("//")&&(a=!0,r="/"+r.replace(/^\/+/,"")),{path:r,handledProtocolRelativeURL:a}}function n5(e){return/\s|[^\u0000-\u007F]/.test(e)?e.replace(/\s|[^\u0000-\u007F]/gu,encodeURIComponent):e}function r5(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function ui(){throw new Error("Invariant failed")}function Pc(e){const t=new Map;let n,r;const i=a=>{a.next&&(a.prev?(a.prev.next=a.next,a.next.prev=a.prev,a.next=void 0,r&&(r.next=a,a.prev=r)):(a.next.prev=void 0,n=a.next,a.next=void 0,r&&(a.prev=r,r.next=a)),r=a)};return{get(a){const l=t.get(a);if(l)return i(l),l.value},set(a,l){if(t.size>=e&&n){const d=n;t.delete(d.key),d.next&&(n=d.next,d.next.prev=void 0),d===r&&(r=void 0)}const c=t.get(a);if(c)c.value=l,i(c);else{const d={key:a,value:l,prev:r};r&&(r.next=d),r=d,n||(n=d),t.set(a,d)}},clear(){t.clear(),n=void 0,r=void 0}}}const Ji=4,Rw=5;function s5(e){const t=e.indexOf("{");if(t===-1)return null;const n=e.indexOf("}",t);return n===-1||t+1>=e.length?null:[t,n]}function Ow(e,t,n=new Uint16Array(6)){const r=e.indexOf("/",t),i=r===-1?e.length:r,a=e.substring(t,i);if(!a||!a.includes("$"))return n[0]=0,n[1]=t,n[2]=t,n[3]=i,n[4]=i,n[5]=i,n;if(a==="$"){const c=e.length;return n[0]=2,n[1]=t,n[2]=t,n[3]=c,n[4]=c,n[5]=c,n}if(a.charCodeAt(0)===36)return n[0]=1,n[1]=t,n[2]=t+1,n[3]=i,n[4]=i,n[5]=i,n;const l=s5(a);if(l){const[c,d]=l,f=a.charCodeAt(c+1);if(f===45){if(c+2<a.length&&a.charCodeAt(c+2)===36){const g=c+3,h=d;if(g<h)return n[0]=3,n[1]=t+c,n[2]=t+g,n[3]=t+h,n[4]=t+d+1,n[5]=i,n}}else if(f===36){const g=c+1,h=c+2;return h===d?(n[0]=2,n[1]=t+c,n[2]=t+g,n[3]=t+h,n[4]=t+d+1,n[5]=e.length,n):(n[0]=1,n[1]=t+c,n[2]=t+h,n[3]=t+d,n[4]=t+d+1,n[5]=i,n)}}return n[0]=0,n[1]=t,n[2]=t,n[3]=i,n[4]=i,n[5]=i,n}function np(e,t,n,r,i,a,l){l?.(n);let c=r;{const d=n.fullPath??n.from,f=d.length,g=n.options?.caseSensitive??e,h=n.options?.params?.parse??n.options?.parseParams;for(;c<f;){const x=Ow(d,c,t);let v;const w=c,k=x[5];switch(c=k+1,a++,x[0]){case 0:{const C=d.substring(x[2],x[3]);if(g){const N=i.static?.get(C);if(N)v=N;else{i.static??=new Map;const A=Xa(n.fullPath??n.from);A.parent=i,A.depth=a,v=A,i.static.set(C,A)}}else{const N=C.toLowerCase(),A=i.staticInsensitive?.get(N);if(A)v=A;else{i.staticInsensitive??=new Map;const R=Xa(n.fullPath??n.from);R.parent=i,R.depth=a,v=R,i.staticInsensitive.set(N,R)}}break}case 1:{const C=d.substring(w,x[1]),N=d.substring(x[4],k),A=g&&!!(C||N),R=C?A?C:C.toLowerCase():void 0,M=N?A?N:N.toLowerCase():void 0,_=!h&&i.dynamic?.find(D=>!D.parse&&D.caseSensitive===A&&D.prefix===R&&D.suffix===M);if(_)v=_;else{const D=f0(1,n.fullPath??n.from,A,R,M);v=D,D.depth=a,D.parent=i,i.dynamic??=[],i.dynamic.push(D)}break}case 3:{const C=d.substring(w,x[1]),N=d.substring(x[4],k),A=g&&!!(C||N),R=C?A?C:C.toLowerCase():void 0,M=N?A?N:N.toLowerCase():void 0,_=!h&&i.optional?.find(D=>!D.parse&&D.caseSensitive===A&&D.prefix===R&&D.suffix===M);if(_)v=_;else{const D=f0(3,n.fullPath??n.from,A,R,M);v=D,D.parent=i,D.depth=a,i.optional??=[],i.optional.push(D)}break}case 2:{const C=d.substring(w,x[1]),N=d.substring(x[4],k),A=g&&!!(C||N),R=C?A?C:C.toLowerCase():void 0,M=N?A?N:N.toLowerCase():void 0,_=f0(2,n.fullPath??n.from,A,R,M);v=_,_.parent=i,_.depth=a,i.wildcard??=[],i.wildcard.push(_)}}i=v}if(h&&n.children&&!n.isRoot&&n.id&&n.id.charCodeAt(n.id.lastIndexOf("/")+1)===95){const x=Xa(n.fullPath??n.from);x.kind=Rw,x.parent=i,a++,x.depth=a,i.pathless??=[],i.pathless.push(x),i=x}const b=(n.path||!n.children)&&!n.isRoot;if(b&&d.endsWith("/")){const x=Xa(n.fullPath??n.from);x.kind=Ji,x.parent=i,a++,x.depth=a,i.index=x,i=x}i.parse=h??null,i.priority=n.options?.params?.priority??0,b&&!i.route&&(i.route=n,i.fullPath=n.fullPath??n.from)}if(n.children)for(const d of n.children)np(e,t,d,c,i,a,l)}function d0(e,t){if(e.parse&&!t.parse)return-1;if(!e.parse&&t.parse)return 1;if(e.parse&&t.parse&&(e.priority||t.priority))return t.priority-e.priority;if(e.prefix&&t.prefix&&e.prefix!==t.prefix){if(e.prefix.startsWith(t.prefix))return-1;if(t.prefix.startsWith(e.prefix))return 1}if(e.suffix&&t.suffix&&e.suffix!==t.suffix){if(e.suffix.endsWith(t.suffix))return-1;if(t.suffix.endsWith(e.suffix))return 1}return e.prefix&&!t.prefix?-1:!e.prefix&&t.prefix?1:e.suffix&&!t.suffix?-1:!e.suffix&&t.suffix?1:e.caseSensitive&&!t.caseSensitive?-1:!e.caseSensitive&&t.caseSensitive?1:0}function Wi(e){if(e.pathless)for(const t of e.pathless)Wi(t);if(e.static)for(const t of e.static.values())Wi(t);if(e.staticInsensitive)for(const t of e.staticInsensitive.values())Wi(t);if(e.dynamic?.length){e.dynamic.sort(d0);for(const t of e.dynamic)Wi(t)}if(e.optional?.length){e.optional.sort(d0);for(const t of e.optional)Wi(t)}if(e.wildcard?.length){e.wildcard.sort(d0);for(const t of e.wildcard)Wi(t)}}function Xa(e){return{kind:0,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:e,parent:null,parse:null,priority:0}}function f0(e,t,n,r,i){return{kind:e,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:t,parent:null,parse:null,priority:0,caseSensitive:n,prefix:r,suffix:i}}function i5(e,t){const n=Xa("/"),r=new Uint16Array(6);for(const i of e)np(!1,r,i,1,n,0);Wi(n),t.masksTree=n,t.flatCache=Pc(1e3)}function a5(e,t){e||="/";const n=t.flatCache.get(e);if(n)return n;const r=C1(e,t.masksTree);return t.flatCache.set(e,r),r}function o5(e,t,n,r,i){e||="/",r||="/";const a=t?`case\0${e}`:e;let l=i.singleCache.get(a);return l||(l=Xa("/"),np(t,new Uint16Array(6),{from:e},1,l,0),i.singleCache.set(a,l)),C1(r,l,n)}function l5(e,t,n=!1){const r=n?e:`nofuzz\0${e}`,i=t.matchCache.get(r);if(i!==void 0)return i;e||="/";let a;try{a=C1(e,t.segmentTree,n)}catch(l){if(l instanceof URIError)a=null;else throw l}return a&&(a.branch=Mw(a.route)),t.matchCache.set(r,a),a}function u5(e){return e==="/"?e:e.replace(/\/{1,}$/,"")}function c5(e,t=!1,n){const r=Xa(e.fullPath),i=new Uint16Array(6),a={},l={};let c=0;return np(t,i,e,1,r,0,d=>{if(n?.(d,c),d.id in a&&ui(),a[d.id]=d,c!==0&&d.path){const f=u5(d.fullPath);(!l[f]||d.fullPath.endsWith("/"))&&(l[f]=d)}c++}),Wi(r),{processedTree:{segmentTree:r,singleCache:Pc(1e3),matchCache:Pc(1e3),flatCache:null,masksTree:null},routesById:a,routesByPath:l}}function C1(e,t,n=!1){const r=e.split("/"),i=f5(e,r,t,n);if(!i)return null;const[a]=Iw(e,r,i);return{route:i.node.route,rawParams:a}}function Iw(e,t,n){const r=d5(n.node);let i=null;const a=Object.create(null);let l=n.extract?.part??0,c=n.extract?.node??0,d=n.extract?.path??0,f=n.extract?.segment??0;for(;c<r.length;l++,c++,d++,f++){const g=r[c];if(g.kind===Ji)break;if(g.kind===Rw){f--,l--,d--;continue}const h=t[l],b=d;if(h&&(d+=h.length),g.kind===1){i??=n.node.fullPath.split("/");const x=i[f],v=g.prefix?.length??0;if(x.charCodeAt(v)===123){const w=g.suffix?.length??0,k=x.substring(v+2,x.length-w-1),C=h.substring(v,h.length-w);a[k]=decodeURIComponent(C)}else{const w=x.substring(1);a[w]=decodeURIComponent(h)}}else if(g.kind===3){if(n.skipped&1<<c){l--,d=b-1;continue}i??=n.node.fullPath.split("/");const x=i[f],v=g.prefix?.length??0,w=g.suffix?.length??0,k=x.substring(v+3,x.length-w-1),C=g.suffix||g.prefix?h.substring(v,h.length-w):h;C&&(a[k]=decodeURIComponent(C))}else if(g.kind===2){const x=g,v=e.substring(b+(x.prefix?.length??0),e.length-(x.suffix?.length??0)),w=decodeURIComponent(v);a["*"]=w,a._splat=w;break}}return n.rawParams&&Object.assign(a,n.rawParams),[a,{part:l,node:c,path:d,segment:f}]}function Mw(e){const t=[e];for(;e.parentRoute;)e=e.parentRoute,t.push(e);return t.reverse(),t}function d5(e){const t=Array(e.depth+1);do t[e.depth]=e,e=e.parent;while(e);return t}function f5(e,t,n,r){if(e==="/"&&n.index)return{node:n.index,skipped:0};const i=!Lc(t),a=i&&e!=="/",l=t.length-(i?1:0),c=[{node:n,index:1,skipped:0,depth:1,statics:0,dynamics:0,optionals:0}];let d=null,f=null;for(;c.length;){const g=c.pop(),{node:h,index:b,skipped:x,depth:v,statics:w,dynamics:k,optionals:C}=g;let{extract:N,rawParams:A}=g;if(h.kind===2&&h.route&&!Nf(f,g))continue;if(h.parse){if(!R2(e,t,g))continue;A=g.rawParams,N=g.extract}r&&h.route&&h.kind!==Ji&&Nf(d,g)&&(d=g);const R=b===l;if(R&&(h.route&&(!a||h.kind===Ji||h.kind===2)&&Nf(f,g)&&(f=g),!h.optional&&!h.wildcard&&!h.index&&!h.pathless))continue;const M=R?void 0:t[b];let _;if(R&&h.index){const D={node:h.index,index:b,skipped:x,depth:v+1,statics:w,dynamics:k,optionals:C,extract:N,rawParams:A};let I=!0;if(h.index.parse&&(R2(e,t,D)||(I=!1)),I){if(!k&&!C&&!x&&h5(w,l))return D;Nf(f,D)&&(f=D)}}if(h.wildcard)for(let D=h.wildcard.length-1;D>=0;D--){const I=h.wildcard[D],{prefix:U,suffix:j}=I;if(!(U&&(R||!(I.caseSensitive?M:_??=M.toLowerCase()).startsWith(U)))){if(j){if(R)continue;const X=t.slice(b).join("/").slice(-j.length);if((I.caseSensitive?X:X.toLowerCase())!==j)continue}c.push({node:I,index:l,skipped:x,depth:v+1,statics:w,dynamics:k,optionals:C,extract:N,rawParams:A})}}if(h.optional){const D=x|1<<v,I=v+1;for(let U=h.optional.length-1;U>=0;U--){const j=h.optional[U];c.push({node:j,index:b,skipped:D,depth:I,statics:w,dynamics:k,optionals:C,extract:N,rawParams:A})}if(!R)for(let U=h.optional.length-1;U>=0;U--){const j=h.optional[U],{prefix:X,suffix:K}=j;if(X||K){const F=j.caseSensitive?M:_??=M.toLowerCase();if(X&&!F.startsWith(X)||K&&!F.endsWith(K))continue}c.push({node:j,index:b+1,skipped:x,depth:I,statics:w,dynamics:k,optionals:C+wf(l,b),extract:N,rawParams:A})}}if(!R&&h.dynamic&&M)for(let D=h.dynamic.length-1;D>=0;D--){const I=h.dynamic[D],{prefix:U,suffix:j}=I;if(U||j){const X=I.caseSensitive?M:_??=M.toLowerCase();if(U&&!X.startsWith(U)||j&&!X.endsWith(j))continue}c.push({node:I,index:b+1,skipped:x,depth:v+1,statics:w,dynamics:k+wf(l,b),optionals:C,extract:N,rawParams:A})}if(!R&&h.staticInsensitive){const D=h.staticInsensitive.get(_??=M.toLowerCase());D&&c.push({node:D,index:b+1,skipped:x,depth:v+1,statics:w+wf(l,b),dynamics:k,optionals:C,extract:N,rawParams:A})}if(!R&&h.static){const D=h.static.get(M);D&&c.push({node:D,index:b+1,skipped:x,depth:v+1,statics:w+wf(l,b),dynamics:k,optionals:C,extract:N,rawParams:A})}if(h.pathless){const D=v+1;for(let I=h.pathless.length-1;I>=0;I--){const U=h.pathless[I];c.push({node:U,index:b,skipped:x,depth:D,statics:w,dynamics:k,optionals:C,extract:N,rawParams:A})}}}if(f)return f;if(r&&d){let g=d.index;for(let b=0;b<d.index;b++)g+=t[b].length;const h=g===e.length?"/":e.slice(g);return d.rawParams??=Object.create(null),d.rawParams["**"]=decodeURIComponent(h),d}return null}function wf(e,t){return 2**(e-t-1)}function h5(e,t){return e===2**(t-1)-1}function R2(e,t,n){let r,i;try{[r,i]=Iw(e,t,n)}catch{return null}if(n.rawParams=r,n.extract=i,!n.node.parse)return!0;try{if(n.node.parse(r)===!1)return null}catch{}return!0}function Nf(e,t){return e?t.statics>e.statics||t.statics===e.statics&&(t.dynamics>e.dynamics||t.dynamics===e.dynamics&&(t.optionals>e.optionals||t.optionals===e.optionals&&((t.node.kind===Ji)>(e.node.kind===Ji)||t.node.kind===Ji==(e.node.kind===Ji)&&t.depth>e.depth))):!0}function oh(e){return k1(e.filter(t=>t!==void 0).join("/"))}function k1(e){return e.replace(/\/{2,}/g,"/")}function Lw(e){return e==="/"?e:e.replace(/^\/{1,}/,"")}function li(e){const t=e.length;return t>1&&e[t-1]==="/"?e.replace(/\/{1,}$/,""):e}function Dw(e){return li(Lw(e))}function Ch(e,t){return e?.endsWith("/")&&e!=="/"&&e!==`${t}/`?e.slice(0,-1):e}function p5(e,t,n){return Ch(e,n)===Ch(t,n)}function m5({base:e,to:t,trailingSlash:n="never",cache:r}){const i=t.startsWith("/"),a=!i&&t===".";let l;if(r){l=i?t:a?e:e+"\0"+t;const f=r.get(l);if(f)return f}let c;if(a)c=e.split("/");else if(i)c=t.split("/");else{for(c=e.split("/");c.length>1&&Lc(c)==="";)c.pop();const f=t.split("/");for(let g=0,h=f.length;g<h;g++){const b=f[g];b===""?g?g===h-1&&c.push(b):c=[b]:b===".."?c.pop():b==="."||c.push(b)}}c.length>1&&(Lc(c)===""?n==="never"&&c.pop():n==="always"&&c.push(""));const d=k1(c.join("/"))||"/";return l&&r&&r.set(l,d),d}function g5(e){const t=new Map(e.map(i=>[encodeURIComponent(i),i])),n=Array.from(t.keys()).map(i=>i.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")).join("|"),r=new RegExp(n,"g");return i=>i.replace(r,a=>t.get(a)??a)}function h0(e,t,n){const r=t[e];return typeof r!="string"?r:e==="_splat"?/^[a-zA-Z0-9\-._~!/]*$/.test(r)?r:r.split("/").map(i=>I2(i,n)).join("/"):I2(r,n)}function O2({path:e,params:t,decoder:n,...r}){let i=!1;const a=Object.create(null);if(!e||e==="/")return{interpolatedPath:"/",usedParams:a,isMissingParams:i};if(!e.includes("$"))return{interpolatedPath:e,usedParams:a,isMissingParams:i};const l=e.length;let c=0,d,f="";for(;c<l;){const g=c;d=Ow(e,g,d);const h=d[5];if(c=h+1,g===h)continue;const b=d[0];if(b===0){f+="/"+e.substring(g,h);continue}if(b===2){const x=t._splat;a._splat=x,a["*"]=x;const v=e.substring(g,d[1]),w=e.substring(d[4],h);if(!x){i=!0,(v||w)&&(f+="/"+v+w);continue}const k=h0("_splat",t,n);f+="/"+v+k+w;continue}if(b===1){const x=e.substring(d[2],d[3]);!i&&!(x in t)&&(i=!0),a[x]=t[x];const v=e.substring(g,d[1]),w=e.substring(d[4],h),k=h0(x,t,n)??"undefined";f+="/"+v+k+w;continue}if(b===3){const x=e.substring(d[2],d[3]),v=t[x];if(v==null)continue;a[x]=v;const w=e.substring(g,d[1]),k=e.substring(d[4],h),C=h0(x,t,n)??"";f+="/"+w+C+k;continue}}return e.endsWith("/")&&(f+="/"),{usedParams:a,interpolatedPath:f||"/",isMissingParams:i}}function I2(e,t){const n=encodeURIComponent(e);return t?.(n)??n}function or(e){return e?.isNotFound===!0}function b5(){try{return sessionStorage}catch{return}}const x5="tsr-scroll-restoration-v1_3",Pw=b5();function y5(){try{return JSON.parse(Pw?.getItem("tsr-scroll-restoration-v1_3")||"{}")}catch{return{}}}function E5(){try{Pw?.setItem(x5,JSON.stringify(ml))}catch{}}const ml=y5(),M2="data-scroll-restoration-id",v5=e=>e.state.__TSR_key||e.href;function T5(e){const t=e.getAttribute(M2);if(t)return`[${M2}="${t}"]`;let n="",r=e,i;for(;i=r.parentNode;){let a=1,l=r;for(;l=l.previousElementSibling;)a++;const c=`${r.localName}:nth-child(${a})`;n=n?`${c} > ${n}`:c,r=i}return n}let Af=!1;const lh="window";function bb(e){try{return typeof e=="function"?e():document.querySelector(e)}catch{}}function L2(e){const t=new Set;for(const n of e){if(n===lh)continue;const r=bb(n);r&&t.add(r)}return t}function S5(e,t){const n=e.options.scrollRestoration,r=e._scroll;n&&(r.restoring=!0);const i=e.options.getScrollRestorationKey||v5,a=new Set,l=c=>{const d=ml[c]||={};for(const f of a)f===document?d[lh]={scrollX,scrollY}:f.isConnected&&(d[T5(f)]={scrollX:f.scrollLeft,scrollY:f.scrollTop})};n&&!r.restoration&&(r.restoration=!0,Af=!1,history.scrollRestoration="manual",document.addEventListener("scroll",c=>{Af||a.add(c.target)},!0),e.subscribe("onBeforeLoad",c=>{c.fromLocation&&l(i(c.fromLocation)),a.clear()}),addEventListener("pagehide",()=>{l(i(e.stores.resolvedLocation.get()??e.stores.location.get())),E5()})),!r.reset&&(r.reset=!0,e.subscribe("onRendered",c=>{const d=e.options.scrollRestorationBehavior,f=e.options.scrollToTopSelectors,g=r.next,h=r.hash;let b;if(a.clear(),r.next=!0,r.hash=!1,typeof e.options.scrollRestoration=="function"&&!e.options.scrollRestoration({location:e.latestLocation}))return;const x=i(c.toLocation),v=c.fromLocation&&i(c.fromLocation);if(r.restoring&&v&&v!==x){const w=ml[v];if(w){let k=ml[x];for(const C in w){if(C===lh){if(g)continue}else{const N=bb(C);if(!N||g&&f&&(b??=L2(f),b.has(N)))continue}k||(k=ml[x]={}),k[C]??=w[C]}}}Af=!0;try{const w=c.toLocation.hash,k=c.toLocation.state.__hashScrollIntoViewOptions??!0;let C=!1;if(g){!w&&f&&(b??=L2(f));const N=w&&k&&h,A=r.restoring?ml[x]:void 0;if(A)for(const R in A){const{scrollX:M,scrollY:_}=A[R];if(R===lh){if(N)continue;scrollTo({top:_,left:M,behavior:d}),C=!0}else{const D=bb(R);D&&(D.scrollLeft=M,D.scrollTop=_,b?.delete(D))}}if(!w){const R={top:0,left:0,behavior:d};if(C||scrollTo(R),b)for(const M of b)M.scrollTo(R)}}!C&&w&&k&&document.getElementById(w)?.scrollIntoView(k)}finally{Af=!1}}))}function C5(e,t=String){const n=new URLSearchParams;for(const r in e){const i=e[r];i!==void 0&&n.set(r,t(i))}return n.toString()}function p0(e){return e?e==="false"?!1:e==="true"?!0:+e*0===0&&+e+""===e?+e:e:""}function k5(e){const t=new URLSearchParams(e),n=Object.create(null);for(const[r,i]of t.entries()){const a=n[r];a==null?n[r]=p0(i):Array.isArray(a)?a.push(p0(i)):n[r]=[a,p0(i)]}return n}const w5=A5(JSON.parse),N5=_5(JSON.stringify,JSON.parse);function A5(e){return t=>{t[0]==="?"&&(t=t.substring(1));const n=k5(t);for(const r in n){const i=n[r];if(typeof i=="string")try{n[r]=e(i)}catch{}}return n}}function _5(e,t){const n=typeof t=="function";function r(i){if(typeof i=="object"&&i!==null)try{return e(i)}catch{}else if(n&&typeof i=="string")try{return t(i),e(i)}catch{}return i}return i=>{const a=C5(i,r);return a?`?${a}`:""}}const Ja="__root__";function jw(e){if(e.statusCode=e.statusCode||e.code||307,!e._builtLocation&&!e.reloadDocument&&typeof e.href=="string")try{new URL(e.href),e.reloadDocument=!0}catch{}const t=new Headers(e.headers);e.href&&t.get("Location")===null&&t.set("Location",e.href);const n=new Response(null,{status:e.statusCode,headers:t});if(n.options=e,e.throw)throw n;return n}function Or(e){return e instanceof Response&&!!e.options}function R5(e){return{input:({url:t})=>{for(const n of e)t=xb(n,t);return t},output:({url:t})=>{for(let n=e.length-1;n>=0;n--)t=Bw(e[n],t);return t}}}function O5(e){const t=Dw(e.basepath),n=`/${t}`,r=e.caseSensitive?n:n.toLowerCase(),i=`${r}/`;return{input:({url:a})=>{const l=e.caseSensitive?a.pathname:a.pathname.toLowerCase();return l===r?a.pathname="/":l.startsWith(i)&&(a.pathname=a.pathname.slice(n.length)),a},output:({url:a})=>(a.pathname=oh(["/",t,a.pathname]),a)}}function xb(e,t){const n=e?.input?.({url:t});if(n){if(typeof n=="string")return new URL(n);if(n instanceof URL)return n}return t}function Bw(e,t){const n=e?.output?.({url:t});if(n){if(typeof n=="string")return new URL(n);if(n instanceof URL)return n}return t}function I5(e,t){const{createMutableStore:n,createReadonlyStore:r,batch:i,init:a}=t,l=new Map,c=new Map,d=new Map,f=n(e.status),g=n(e.loadedAt),h=n(e.isLoading),b=n(e.isTransitioning),x=n(e.location),v=n(e.resolvedLocation),w=n(e.statusCode),k=n(e.redirect),C=n([]),N=n([]),A=n([]),R=r(()=>m0(l,C.get())),M=r(()=>m0(c,N.get())),_=r(()=>m0(d,A.get())),D=r(()=>C.get()[0]),I=r(()=>C.get().some(q=>l.get(q)?.get().status==="pending")),U=r(()=>({locationHref:x.get().href,resolvedLocationHref:v.get()?.href,status:f.get()})),j=r(()=>({status:f.get(),loadedAt:g.get(),isLoading:h.get(),isTransitioning:b.get(),matches:R.get(),location:x.get(),resolvedLocation:v.get(),statusCode:w.get(),redirect:k.get()})),X=Pc(64);function K(q){let J=X.get(q);return J||(J=r(()=>{const ue=C.get();for(const L of ue){const B=l.get(L);if(B&&B.routeId===q)return B.get()}}),X.set(q,J)),J}const F={status:f,loadedAt:g,isLoading:h,isTransitioning:b,location:x,resolvedLocation:v,statusCode:w,redirect:k,matchesId:C,pendingIds:N,cachedIds:A,matches:R,pendingMatches:M,cachedMatches:_,firstId:D,hasPending:I,matchRouteDeps:U,matchStores:l,pendingMatchStores:c,cachedMatchStores:d,__store:j,getRouteMatchStore:K,setMatches:W,setPending:V,setCached:H};W(e.matches),a?.(F);function W(q){g0(q,l,C,n,i)}function V(q){g0(q,c,N,n,i)}function H(q){g0(q,d,A,n,i)}return F}function m0(e,t){const n=[];for(const r of t){const i=e.get(r);i&&n.push(i.get())}return n}function g0(e,t,n,r,i){const a=e.map(c=>c.id),l=new Set(a);i(()=>{for(const c of t.keys())l.has(c)||t.delete(c);for(const c of e){const d=t.get(c.id);if(!d){const f=r(c);f.routeId=c.routeId,t.set(c.id,f);continue}d.routeId=c.routeId,d.get()!==c&&d.set(c)}r5(n.get(),a)||n.set(a)})}const yb=e=>{if(!e.rendered)return e.rendered=!0,e.onReady?.()},M5=e=>e.stores.matchesId.get().some(t=>e.stores.matchStores.get(t)?.get()._forcePending),rp=(e,t)=>!!(e.preload&&!e.router.stores.matchStores.has(t)),eo=(e,t,n=!0)=>{const r={...e.router.options.context??{}},i=n?t:t-1;for(let a=0;a<=i;a++){const l=e.matches[a];if(!l)continue;const c=e.router.getMatch(l.id);c&&Object.assign(r,c.__routeContext,c.__beforeLoadContext)}return r},D2=(e,t)=>{if(!e.matches.length)return;const n=t.routeId,r=e.matches.findIndex(l=>l.routeId===e.router.routeTree.id),i=r>=0?r:0;let a=n?e.matches.findIndex(l=>l.routeId===n):e.firstBadMatchIndex??e.matches.length-1;a<0&&(a=i);for(let l=a;l>=0;l--){const c=e.matches[l];if(e.router.looseRoutesById[c.routeId].options.notFoundComponent)return l}return n?a:i},ea=(e,t,n)=>{if(!(!Or(n)&&!or(n)))throw Or(n)&&n.redirectHandled&&!n.options.reloadDocument||(t&&(t._nonReactive.beforeLoadPromise?.resolve(),t._nonReactive.loaderPromise?.resolve(),t._nonReactive.beforeLoadPromise=void 0,t._nonReactive.loaderPromise=void 0,t._nonReactive.error=n,e.updateMatch(t.id,r=>({...r,status:Or(n)?"redirected":or(n)?"notFound":r.status==="pending"?"success":r.status,context:eo(e,t.index),isFetching:!1,error:n})),or(n)&&!n.routeId&&(n.routeId=t.routeId),t._nonReactive.loadPromise?.resolve()),Or(n)&&(e.rendered=!0,n.options._fromLocation=e.location,n.redirectHandled=!0,n=e.router.resolveRedirect(n))),n},Hw=(e,t)=>{const n=e.router.getMatch(t);return!!(!n||n._nonReactive.dehydrated)},P2=(e,t,n)=>{const r=eo(e,n);e.updateMatch(t,i=>({...i,context:r}))},Wu=(e,t,n)=>{const{id:r,routeId:i}=e.matches[t],a=e.router.looseRoutesById[i];if(n instanceof Promise)throw n;e.firstBadMatchIndex??=t,ea(e,e.router.getMatch(r),n);try{a.options.onError?.(n)}catch(l){n=l,ea(e,e.router.getMatch(r),n)}e.updateMatch(r,l=>(l._nonReactive.beforeLoadPromise?.resolve(),l._nonReactive.beforeLoadPromise=void 0,l._nonReactive.loadPromise?.resolve(),{...l,error:n,status:"error",isFetching:!1,updatedAt:Date.now(),abortController:new AbortController})),!e.preload&&!Or(n)&&!or(n)&&(e.serialError??=n)},Uw=(e,t,n,r)=>{if(r._nonReactive.pendingTimeout!==void 0)return;const i=n.options.pendingMs??e.router.options.defaultPendingMs;if(e.onReady&&!rp(e,t)&&(n.options.loader||n.options.beforeLoad||Fw(n))&&typeof i=="number"&&i!==1/0&&(n.options.pendingComponent??e.router.options?.defaultPendingComponent)){const a=setTimeout(()=>{yb(e)},i);r._nonReactive.pendingTimeout=a}},L5=(e,t,n)=>{const r=e.router.getMatch(t);if(!r._nonReactive.beforeLoadPromise&&!r._nonReactive.loaderPromise)return;Uw(e,t,n,r);const i=()=>{const a=e.router.getMatch(t);a.preload&&(a.status==="redirected"||a.status==="notFound")&&ea(e,a,a.error)};return r._nonReactive.beforeLoadPromise?r._nonReactive.beforeLoadPromise.then(i):i()},D5=(e,t,n,r)=>{const i=e.router.getMatch(t);let a=i._nonReactive.loadPromise;i._nonReactive.loadPromise=Al(()=>{a?.resolve(),a=void 0});const{paramsError:l,searchError:c}=i;l&&Wu(e,n,l),c&&Wu(e,n,c),Uw(e,t,r,i);const d=new AbortController;let f=!1;const g=()=>{f||(f=!0,e.updateMatch(t,R=>({...R,isFetching:"beforeLoad",fetchCount:R.fetchCount+1,abortController:d})))},h=()=>{i._nonReactive.beforeLoadPromise?.resolve(),i._nonReactive.beforeLoadPromise=void 0,e.updateMatch(t,R=>({...R,isFetching:!1}))};if(!r.options.beforeLoad){e.router.batch(()=>{g(),h()});return}i._nonReactive.beforeLoadPromise=Al();const b={...eo(e,n,!1),...i.__routeContext},{search:x,params:v,cause:w}=i,k=rp(e,t),C={search:x,abortController:d,params:v,preload:k,context:b,location:e.location,navigate:R=>e.router.navigate({...R,_fromLocation:e.location}),buildLocation:e.router.buildLocation,cause:k?"preload":w,matches:e.matches,routeId:r.id,...e.router.options.additionalContext},N=R=>{if(R===void 0){e.router.batch(()=>{g(),h()});return}(Or(R)||or(R))&&(g(),Wu(e,n,R)),e.router.batch(()=>{g(),e.updateMatch(t,M=>({...M,__beforeLoadContext:R})),h()})};let A;try{if(A=r.options.beforeLoad(C),Dc(A))return g(),A.catch(R=>{Wu(e,n,R)}).then(N)}catch(R){g(),Wu(e,n,R)}N(A)},P5=(e,t)=>{const{id:n,routeId:r}=e.matches[t],i=e.router.looseRoutesById[r],a=()=>c(),l=()=>D5(e,n,t,i),c=()=>{if(Hw(e,n))return;const d=L5(e,n,i);return Dc(d)?d.then(l):l()};return a()},j5=(e,t,n)=>{const r=e.router.getMatch(t);if(!r||!n.options.head&&!n.options.scripts&&!n.options.headers)return;const i={ssr:e.router.options.ssr,matches:e.matches,match:r,params:r.params,loaderData:r.loaderData};return Promise.all([n.options.head?.(i),n.options.scripts?.(i),n.options.headers?.(i)]).then(([a,l,c])=>({meta:a?.meta,links:a?.links,headScripts:a?.scripts,headers:c,scripts:l,styles:a?.styles}))},zw=(e,t,n,r,i)=>{const a=t[r-1],{params:l,loaderDeps:c,abortController:d,cause:f}=e.router.getMatch(n),g=eo(e,r),h=rp(e,n);return{params:l,deps:c,preload:!!h,parentMatchPromise:a,abortController:d,context:g,location:e.location,navigate:b=>e.router.navigate({...b,_fromLocation:e.location}),cause:h?"preload":f,route:i,...e.router.options.additionalContext}},j2=async(e,t,n,r,i)=>{try{const a=e.router.getMatch(n);try{(!(Nw??e.router.isServer)||a.ssr===!0)&&jc(i);const l=i.options.loader,c=typeof l=="function"?l:l?.handler,d=c?.(zw(e,t,n,r,i)),f=!!c&&Dc(d);if((f||i._lazyPromise||i._componentsPromise||i.options.head||i.options.scripts||i.options.headers||a._nonReactive.minPendingPromise)&&e.updateMatch(n,h=>({...h,isFetching:"loader"})),c){const h=f?await d:d;ea(e,e.router.getMatch(n),h),h!==void 0&&e.updateMatch(n,b=>({...b,loaderData:h}))}i._lazyPromise&&await i._lazyPromise;const g=a._nonReactive.minPendingPromise;g&&await g,i._componentsPromise&&await i._componentsPromise,e.updateMatch(n,h=>({...h,error:void 0,context:eo(e,r),status:"success",isFetching:!1,updatedAt:Date.now()}))}catch(l){let c=l;if(c?.name==="AbortError"){if(a.abortController.signal.aborted){a._nonReactive.loaderPromise?.resolve(),a._nonReactive.loaderPromise=void 0;return}e.updateMatch(n,f=>({...f,status:f.status==="pending"?"success":f.status,isFetching:!1,context:eo(e,r)}));return}const d=a._nonReactive.minPendingPromise;d&&await d,or(l)&&await i.options.notFoundComponent?.preload?.(),ea(e,e.router.getMatch(n),l);try{i.options.onError?.(l)}catch(f){c=f,ea(e,e.router.getMatch(n),f)}!Or(c)&&!or(c)&&await jc(i,["errorComponent"]),e.updateMatch(n,f=>({...f,error:c,context:eo(e,r),status:"error",isFetching:!1}))}}catch(a){const l=e.router.getMatch(n);l&&(l._nonReactive.loaderPromise=void 0),ea(e,l,a)}},B5=async(e,t,n)=>{async function r(x,v,w,k,C){const N=Date.now()-v.updatedAt,A=x?C.options.preloadStaleTime??e.router.options.defaultPreloadStaleTime??3e4:C.options.staleTime??e.router.options.defaultStaleTime??0,R=C.options.shouldReload,M=typeof R=="function"?R(zw(e,t,i,n,C)):R,{status:_,invalid:D}=k,I=N>=A&&(!!e.forceStaleReload||k.cause==="enter"||w!==void 0&&w!==k.id);l=_==="success"&&(D||(M??I)),x&&C.options.preload===!1||(l&&!e.sync&&g?(c=!0,(async()=>{try{await j2(e,t,i,n,C);const U=e.router.getMatch(i);U._nonReactive.loaderPromise?.resolve(),U._nonReactive.loadPromise?.resolve(),U._nonReactive.loaderPromise=void 0,U._nonReactive.loadPromise=void 0}catch(U){Or(U)&&await e.router.navigate(U.options)}})()):_!=="success"||l?await j2(e,t,i,n,C):P2(e,i,n))}const{id:i,routeId:a}=e.matches[n];let l=!1,c=!1;const d=e.router.looseRoutesById[a],f=d.options.loader,g=((typeof f=="function"?void 0:f?.staleReloadMode)??e.router.options.defaultStaleReloadMode)!=="blocking";if(Hw(e,i)){if(!e.router.getMatch(i))return e.matches[n];P2(e,i,n)}else{const x=e.router.getMatch(i),v=e.router.stores.matchesId.get()[n],w=(v&&e.router.stores.matchStores.get(v)||null)?.routeId===a?v:e.router.stores.matches.get().find(C=>C.routeId===a)?.id,k=rp(e,i);if(x._nonReactive.loaderPromise){if(x.status==="success"&&!e.sync&&!x.preload&&g)return x;await x._nonReactive.loaderPromise;const C=e.router.getMatch(i),N=C._nonReactive.error||C.error;N&&ea(e,C,N),C.status==="pending"&&await r(k,x,w,C,d)}else{const C=k&&!e.router.stores.matchStores.has(i),N=e.router.getMatch(i);N._nonReactive.loaderPromise=Al(),C!==N.preload&&e.updateMatch(i,A=>({...A,preload:C})),await r(k,x,w,N,d)}}const h=e.router.getMatch(i);c||(h._nonReactive.loaderPromise?.resolve(),h._nonReactive.loadPromise?.resolve(),h._nonReactive.loadPromise=void 0),clearTimeout(h._nonReactive.pendingTimeout),h._nonReactive.pendingTimeout=void 0,c||(h._nonReactive.loaderPromise=void 0),h._nonReactive.dehydrated=void 0;const b=c?h.isFetching:!1;return b!==h.isFetching||h.invalid!==!1?(e.updateMatch(i,x=>({...x,isFetching:b,invalid:!1})),e.router.getMatch(i)):h};async function B2(e){const t=e,n=[];M5(t.router)&&yb(t);let r;for(let b=0;b<t.matches.length;b++){try{const x=P5(t,b);Dc(x)&&await x}catch(x){if(Or(x))throw x;if(or(x))r=x;else if(!t.preload)throw x;break}if(t.serialError||t.firstBadMatchIndex!=null)break}const i=t.firstBadMatchIndex??t.matches.length,a=r&&!t.preload?D2(t,r):void 0,l=r&&t.preload?0:a!==void 0?Math.min(a+1,i):i;let c,d;for(let b=0;b<l;b++)n.push(B5(t,n,b));try{await Promise.all(n)}catch{const b=await Promise.allSettled(n);for(const x of b){if(x.status!=="rejected")continue;const v=x.reason;if(Or(v))throw v;or(v)?c??=v:d??=v}if(d!==void 0)throw d}const f=c??(r&&!t.preload?r:void 0);let g=t.firstBadMatchIndex!==void 0?t.firstBadMatchIndex:t.matches.length-1;if(!f&&r&&t.preload)return t.matches;if(f){const b=D2(t,f);b===void 0&&ui();const x=t.matches[b],v=t.router.looseRoutesById[x.routeId],w=t.router.options?.defaultNotFoundComponent;!v.options.notFoundComponent&&w&&(v.options.notFoundComponent=w),f.routeId=x.routeId;const k=x.routeId===t.router.routeTree.id;t.updateMatch(x.id,C=>({...C,...k?{status:"success",globalNotFound:!0,error:void 0}:{status:"notFound",error:f},isFetching:!1})),g=b,await jc(v,["notFoundComponent"])}else if(!t.preload){const b=t.matches[0];b.globalNotFound||t.router.getMatch(b.id)?.globalNotFound&&t.updateMatch(b.id,x=>({...x,globalNotFound:!1,error:void 0}))}if(t.serialError&&t.firstBadMatchIndex!==void 0){const b=t.router.looseRoutesById[t.matches[t.firstBadMatchIndex].routeId];await jc(b,["errorComponent"])}for(let b=0;b<=g;b++){const{id:x,routeId:v}=t.matches[b],w=t.router.looseRoutesById[v];try{const k=j5(t,x,w);if(k){const C=await k;t.updateMatch(x,N=>({...N,...C}))}}catch(k){console.error(`Error executing head for route ${v}:`,k)}}const h=yb(t);if(Dc(h)&&await h,f)throw f;if(t.serialError&&!t.preload&&!t.onReady)throw t.serialError;return t.matches}function H2(e,t){const n=t.map(r=>e.options[r]?.preload?.()).filter(Boolean);if(n.length!==0)return Promise.all(n)}function jc(e,t=uh){!e._lazyLoaded&&e._lazyPromise===void 0&&(e.lazyFn?e._lazyPromise=e.lazyFn().then(r=>{const{id:i,...a}=r.options;Object.assign(e.options,a),e._lazyLoaded=!0,e._lazyPromise=void 0}):e._lazyLoaded=!0);const n=()=>e._componentsLoaded?void 0:t===uh?(()=>{if(e._componentsPromise===void 0){const r=H2(e,uh);r?e._componentsPromise=r.then(()=>{e._componentsLoaded=!0,e._componentsPromise=void 0}):e._componentsLoaded=!0}return e._componentsPromise})():H2(e,t);return e._lazyPromise?e._lazyPromise.then(n):n()}function Fw(e){for(const t of uh)if(e.options[t]?.preload)return!0;return!1}const uh=["component","errorComponent","pendingComponent","notFoundComponent"];var ra="__TSR_index",U2="popstate",z2="beforeunload";function H5(e){let t=e.getLocation();const n=new Set,r=l=>{t=e.getLocation(),n.forEach(c=>c({location:t,action:l}))},i=l=>{e.notifyOnIndexChange??!0?r(l):t=e.getLocation()},a=async({task:l,navigateOpts:c,...d})=>{if(c?.ignoreBlocker??!1){l();return}const f=e.getBlockers?.()??[],g=d.type==="PUSH"||d.type==="REPLACE";if(typeof document<"u"&&f.length&&g)for(const h of f){const b=Bc(d.path,d.state);if(await h.blockerFn({currentLocation:t,nextLocation:b,action:d.type})){e.onBlocked?.();return}}l()};return{get location(){return t},get length(){return e.getLength()},subscribers:n,subscribe:l=>(n.add(l),()=>{n.delete(l)}),push:(l,c,d)=>{const f=t.state[ra];c=F2(f+1,c),a({task:()=>{e.pushState(l,c),r({type:"PUSH"})},navigateOpts:d,type:"PUSH",path:l,state:c})},replace:(l,c,d)=>{const f=t.state[ra];c=F2(f,c),a({task:()=>{e.replaceState(l,c),r({type:"REPLACE"})},navigateOpts:d,type:"REPLACE",path:l,state:c})},go:(l,c)=>{a({task:()=>{e.go(l),i({type:"GO",index:l})},navigateOpts:c,type:"GO"})},back:l=>{a({task:()=>{e.back(l?.ignoreBlocker??!1),i({type:"BACK"})},navigateOpts:l,type:"BACK"})},forward:l=>{a({task:()=>{e.forward(l?.ignoreBlocker??!1),i({type:"FORWARD"})},navigateOpts:l,type:"FORWARD"})},canGoBack:()=>t.state[ra]!==0,createHref:l=>e.createHref(l),block:l=>{if(!e.setBlockers)return()=>{};const c=e.getBlockers?.()??[];return e.setBlockers([...c,l]),()=>{const d=e.getBlockers?.()??[];e.setBlockers?.(d.filter(f=>f!==l))}},flush:()=>e.flush?.(),destroy:()=>e.destroy?.(),notify:r}}function F2(e,t){t||(t={});const n=w1();return{...t,key:n,__TSR_key:n,[ra]:e}}function $w(e){const t=e?.window??(typeof document<"u"?window:void 0),n=t.history.pushState,r=t.history.replaceState;let i=[];const a=()=>i,l=I=>i=I,c=e?.createHref??(I=>I),d=e?.parseLocation??(()=>Bc(`${t.location.pathname}${t.location.search}${t.location.hash}`,t.history.state));if(!t.history.state?.__TSR_key&&!t.history.state?.key){const I=w1();t.history.replaceState({[ra]:0,key:I,__TSR_key:I},"")}let f=d(),g,h=!1,b=!1,x=!1,v=!1;const w=()=>f;let k,C;const N=()=>{k&&(D._ignoreSubscribers=!0,(k.isPush?t.history.pushState:t.history.replaceState)(k.state,"",k.href),D._ignoreSubscribers=!1,k=void 0,C=void 0,g=void 0)},A=(I,U,j)=>{const X=c(U);C||(g=f),f=Bc(U,j),k={href:X,state:j,isPush:k?.isPush||I==="push"},C||(C=Promise.resolve().then(()=>N()))},R=I=>{f=d(),D.notify({type:I})},M=async()=>{if(b){b=!1;return}const I=d(),U=I.state[ra]-f.state[ra],j=U===1,X=U===-1,K=!j&&!X||h;h=!1;const F=K?"GO":X?"BACK":"FORWARD",W=K?{type:"GO",index:U}:{type:X?"BACK":"FORWARD"};if(x)x=!1;else{const V=a();if(typeof document<"u"&&V.length){for(const H of V)if(await H.blockerFn({currentLocation:f,nextLocation:I,action:F})){b=!0,t.history.go(1),D.notify(W);return}}}f=d(),D.notify(W)},_=I=>{if(v){v=!1;return}let U=!1;const j=a();if(typeof document<"u"&&j.length)for(const X of j){const K=X.enableBeforeUnload??!0;if(K===!0){U=!0;break}if(typeof K=="function"&&K()===!0){U=!0;break}}if(U)return I.preventDefault(),I.returnValue=""},D=H5({getLocation:w,getLength:()=>t.history.length,pushState:(I,U)=>A("push",I,U),replaceState:(I,U)=>A("replace",I,U),back:I=>(I&&(x=!0),v=!0,t.history.back()),forward:I=>{I&&(x=!0),v=!0,t.history.forward()},go:I=>{h=!0,t.history.go(I)},createHref:I=>c(I),flush:N,destroy:()=>{t.history.pushState=n,t.history.replaceState=r,t.removeEventListener(z2,_,{capture:!0}),t.removeEventListener(U2,M)},onBlocked:()=>{g&&f!==g&&(f=g)},getBlockers:a,setBlockers:l,notifyOnIndexChange:!1});return t.addEventListener(z2,_,{capture:!0}),t.addEventListener(U2,M),t.history.pushState=function(...I){const U=n.apply(t.history,I);return D._ignoreSubscribers||R("PUSH"),U},t.history.replaceState=function(...I){const U=r.apply(t.history,I);return D._ignoreSubscribers||R("REPLACE"),U},D}function U5(e){const t=typeof document<"u"?window:void 0;return $w({window:t,parseLocation:()=>{const n=t.location.hash.split("#").slice(1),r=n[0]??"/",i=t.location.search,a=n.slice(1);return Bc(`${r}${i}${a.length===0?"":`#${a.join("#")}`}`,t.history.state)},createHref:n=>`${t.location.pathname}${t.location.search}#${n}`})}function z5(e){let t=e.replace(/[\x00-\x1f\x7f]/g,"");return t.startsWith("//")&&(t="/"+t.replace(/^\/+/,"")),t}function Bc(e,t){const n=z5(e),r=n.indexOf("#"),i=n.indexOf("?"),a=w1();return{href:n,pathname:n.substring(0,r>0?i>0?Math.min(r,i):r:i>0?i:n.length),hash:r>-1?n.substring(r):"",search:i>-1?n.slice(i,r===-1?void 0:r):"",state:t||{[ra]:0,key:a,__TSR_key:a}}}function w1(){return(Math.random()+1).toString(36).substring(7)}function Tl(e,t){const n=t,r=e;return{fromLocation:n,toLocation:r,pathChanged:n?.pathname!==r.pathname,hrefChanged:n?.href!==r.href,hashChanged:n?.hash!==r.hash}}var F5=class{constructor(e,t){this.tempLocationKey=`${Math.round(Math.random()*1e7)}`,this._scroll={next:!0},this.shouldViewTransition=void 0,this.isViewTransitionTypesSupported=void 0,this.subscribers=new Set,this.routeBranchCache=new WeakMap,this.lightweightCache=new WeakMap,this.startTransition=n=>n(),this.update=n=>{const r=this.options,i=this.basepath??r?.basepath??"/",a=this.basepath===void 0,l=r?.rewrite;if(this.options={...r,...n},this.isServer=this.options.isServer??typeof document>"u",this.protocolAllowlist=new Set(this.options.protocolAllowlist),this.options.pathParamsAllowedCharacters&&(this.pathParamsDecoder=g5(this.options.pathParamsAllowedCharacters)),(!this.history||this.options.history&&this.options.history!==this.history)&&(this.options.history?this.history=this.options.history:this.history=$w()),this.origin=this.options.origin,this.origin||(window?.origin&&window.origin!=="null"?this.origin=window.origin:this.origin="http://localhost"),this.history&&this.updateLatestLocation(),this.options.routeTree!==this.routeTree){this.routeTree=this.options.routeTree;let g;this.resolvePathCache=Pc(1e3),g=this.buildRouteTree(),this.setRoutes(g)}if(!this.stores&&this.latestLocation){const g=this.getStoreConfig(this);this.batch=g.batch,this.stores=I5(V5(this.latestLocation),g),S5(this)}let c=!1;const d=this.options.basepath??"/",f=this.options.rewrite;if(a||i!==d||l!==f){this.basepath=d;const g=[],h=Dw(d);h&&h!=="/"&&g.push(O5({basepath:d})),f&&g.push(f),this.rewrite=g.length===0?void 0:g.length===1?g[0]:R5(g),this.history&&this.updateLatestLocation(),c=!0}c&&this.stores&&this.stores.location.set(this.latestLocation),typeof window<"u"&&"CSS"in window&&typeof window.CSS?.supports=="function"&&(this.isViewTransitionTypesSupported=window.CSS.supports("selector(:active-view-transition-type(a))"))},this.updateLatestLocation=()=>{this.latestLocation=this.parseLocation(this.history.location,this.latestLocation)},this.buildRouteTree=()=>{const n=c5(this.routeTree,this.options.caseSensitive,(r,i)=>{r.init({originalIndex:i})});return this.options.routeMasks&&i5(this.options.routeMasks,n.processedTree),n},this.subscribe=(n,r)=>{const i={eventType:n,fn:r};return this.subscribers.add(i),()=>{this.subscribers.delete(i)}},this.emit=n=>{this.subscribers.forEach(r=>{r.eventType===n.type&&r.fn(n)})},this.parseLocation=(n,r)=>{const i=({pathname:d,search:f,hash:g,href:h,state:b})=>{if(!this.rewrite&&!/[ \x00-\x1f\x7f\u0080-\uffff]/.test(d)){const C=this.options.parseSearch(f),N=this.options.stringifySearch(C);return{href:d+N+g,publicHref:d+N+g,pathname:Qu(d).path,external:!1,searchStr:N,search:Pa(r?.search,C),hash:Qu(g.slice(1)).path,state:Ga(r?.state,b)}}const x=new URL(h,this.origin),v=xb(this.rewrite,x),w=this.options.parseSearch(v.search),k=this.options.stringifySearch(w);return v.search=k,{href:v.href.replace(v.origin,""),publicHref:h,pathname:Qu(v.pathname).path,external:!!this.rewrite&&v.origin!==this.origin,searchStr:k,search:Pa(r?.search,w),hash:Qu(v.hash.slice(1)).path,state:Ga(r?.state,b)}},a=i(n),{__tempLocation:l,__tempKey:c}=a.state;if(l&&(!c||c===this.tempLocationKey)){const d=i(l);return d.state.key=a.state.key,d.state.__TSR_key=a.state.__TSR_key,delete d.state.__tempLocation,{...d,maskedLocation:a}}return a},this.resolvePathWithBase=(n,r)=>m5({base:n,to:r.includes("//")?k1(r):r,trailingSlash:this.options.trailingSlash,cache:this.resolvePathCache}),this.matchRoutes=(n,r,i)=>typeof n=="string"?this.matchRoutesInternal({pathname:n,search:r},i):this.matchRoutesInternal(n,r),this.getMatchedRoutes=n=>q5({pathname:n,routesById:this.routesById,processedTree:this.processedTree}),this.cancelMatch=n=>{const r=this.getMatch(n);r&&(r.abortController.abort(),clearTimeout(r._nonReactive.pendingTimeout),r._nonReactive.pendingTimeout=void 0)},this.cancelMatches=()=>{this.stores.pendingIds.get().forEach(n=>{this.cancelMatch(n)}),this.stores.matchesId.get().forEach(n=>{if(this.stores.pendingMatchStores.has(n))return;const r=this.stores.matchStores.get(n)?.get();r&&(r.status==="pending"||r.isFetching==="loader")&&this.cancelMatch(n)})},this.buildLocation=n=>{const r=(a={})=>{const l=a._fromLocation||this.pendingBuiltLocation||this.latestLocation,c=this.matchRoutesLightweight(l);a.from;const d=a.unsafeRelative==="path"?l.pathname:a.from??c.fullPath,f=a.to?`${a.to}`:void 0,g=c.search,h=Object.assign(Object.create(null),c.params),b=f?.charCodeAt(0)===47?"/":this.resolvePathWithBase(d,"."),x=f?this.resolvePathWithBase(b,f):b,v=a.params===!1||a.params===null?Object.create(null):(a.params??!0)===!0?h:Object.assign(h,Ya(a.params,h)),w=this.routesByPath[li(x)];let k;if(w)k=this.getRouteBranch(w);else if(x.includes("$"))k=[];else{const X=this.getMatchedRoutes(x);k=X.matchedRoutes,this.options.notFoundRoute&&(!X.foundRoute||X.foundRoute.path!=="/"&&X.routeParams["**"])&&(k=[...k,this.options.notFoundRoute])}if(k.length&&_w(v))for(const X of k){const K=X.options.params?.stringify??X.options.stringifyParams;if(K)try{Object.assign(v,K(v))}catch{}}const C=n.leaveParams?x:Qu(O2({path:x,params:v,decoder:this.pathParamsDecoder,server:this.isServer}).interpolatedPath).path;let N=g;if(n._includeValidateSearch&&this.options.search?.strict){const X={};k.forEach(K=>{if(K.options.validateSearch)try{Object.assign(X,ch(K.options.validateSearch,{...X,...N}))}catch{}}),N=X}N=Y5({search:N,dest:a,destRoutes:k,_includeValidateSearch:n._includeValidateSearch}),N=Pa(g,N);const A=this.options.stringifySearch(N),R=a.hash===!0?l.hash:a.hash?Ya(a.hash,l.hash):void 0,M=R?`#${R}`:"";let _=a.state===!0?l.state:a.state?Ya(a.state,l.state):{};_=Ga(l.state,_);const D=`${C}${A}${M}`;let I,U,j=!1;if(this.rewrite){const X=new URL(D,this.origin),K=Bw(this.rewrite,X);I=X.href.replace(X.origin,""),K.origin!==this.origin?(U=K.href,j=!0):U=K.pathname+K.search+K.hash}else I=n5(D),U=I;return{publicHref:U,href:I,pathname:C,search:N,searchStr:A,state:_,hash:R??"",external:j,unmaskOnReload:a.unmaskOnReload}},i=(a={},l)=>{const c=r(a);let d=l?r(l):void 0;if(!d){const f=Object.create(null);if(this.options.routeMasks){const g=a5(c.pathname,this.processedTree);if(g){Object.assign(f,g.rawParams);const{from:h,params:b,...x}=g.route,v=b===!1||b===null?Object.create(null):(b??!0)===!0?f:Object.assign(f,Ya(b,f));l={from:n.from,...x,params:v},d=r(l)}}}return d&&(c.maskedLocation=d),c};return n.mask?i(n,{from:n.from,...n.mask}):i(n)},this.commitLocation=async({viewTransition:n,ignoreBlocker:r,...i})=>{let a;const l=()=>{const f=["key","__TSR_key","__TSR_index","__hashScrollIntoViewOptions"];f.forEach(h=>{i.state[h]=this.latestLocation.state[h]});const g=Za(i.state,this.latestLocation.state);return f.forEach(h=>{delete i.state[h]}),g},c=li(this.latestLocation.href)===li(i.href);let d=this.commitLocationPromise;if(this.commitLocationPromise=Al(()=>{d?.resolve(),d=void 0}),c&&l())this.load();else{let{maskedLocation:f,hashScrollIntoView:g,...h}=i;f&&(h={...f,state:{...f.state,__tempKey:void 0,__tempLocation:{...h,search:h.searchStr,state:{...h.state,__tempKey:void 0,__tempLocation:void 0,__TSR_key:void 0,key:void 0}}}},(h.unmaskOnReload??this.options.unmaskOnReload??!1)&&(h.state.__tempKey=this.tempLocationKey)),h.state.__hashScrollIntoViewOptions=g??this.options.defaultHashScrollIntoView??!0,this.shouldViewTransition=n,a=i.replace?"REPLACE":"PUSH",this.history[a==="REPLACE"?"replace":"push"](h.publicHref,h.state,{ignoreBlocker:r})}return this._scroll.next=i.resetScroll??!0,this.history.subscribers.size||this.load(a?{action:{type:a}}:void 0),this.commitLocationPromise},this.buildAndCommitLocation=({replace:n,resetScroll:r,hashScrollIntoView:i,viewTransition:a,ignoreBlocker:l,href:c,...d}={})=>{if(c){const h=this.history.location.state.__TSR_index,b=Bc(c,{__TSR_index:n?h:h+1}),x=new URL(b.pathname,this.origin);d.to=xb(this.rewrite,x).pathname,d.search=this.options.parseSearch(b.search),d.hash=b.hash.slice(1)}const f=this.buildLocation({...d,_includeValidateSearch:!0});this.pendingBuiltLocation=f;const g=this.commitLocation({...f,viewTransition:a,replace:n,resetScroll:r,hashScrollIntoView:i,ignoreBlocker:l});return queueMicrotask(()=>{this.pendingBuiltLocation===f&&(this.pendingBuiltLocation=void 0)}),g},this.navigate=async({to:n,reloadDocument:r,href:i,publicHref:a,...l})=>{let c=!1;if(i)try{new URL(`${i}`),c=!0}catch{}if(c&&!r&&(r=!0),r){if(n!==void 0||!i){const f=this.buildLocation({to:n,...l});i=i??f.publicHref,a=a??f.publicHref}const d=!c&&a?a:i;if(Sh(d,this.protocolAllowlist))return;if(!l.ignoreBlocker){const f=this.history.getBlockers?.()??[];for(const g of f)if(g?.blockerFn&&await g.blockerFn({currentLocation:this.latestLocation,nextLocation:this.latestLocation,action:"PUSH"}))return}l.replace?window.location.replace(d):window.location.href=d;return}return this.buildAndCommitLocation({...l,href:i,to:n,_isNavigate:!0})},this.beforeLoad=()=>{this.cancelMatches(),this.updateLatestLocation();const n=this.matchRoutes(this.latestLocation),r=this.stores.cachedMatches.get().filter(i=>!n.some(a=>a.id===i.id));this.batch(()=>{this.stores.status.set("pending"),this.stores.statusCode.set(200),this.stores.isLoading.set(!0),this.stores.location.set(this.latestLocation),this.stores.setPending(n),this.stores.setCached(r)})},this.load=async n=>{const r=n?.action?.type;let i,a,l;const c=this.stores.resolvedLocation.get()??this.stores.location.get();for(l=new Promise(f=>{this.startTransition(async()=>{try{this.beforeLoad(),r&&(this._scroll.hash=r==="PUSH"||r==="REPLACE");const g=this.latestLocation,h=Tl(g,this.stores.resolvedLocation.get());this.stores.redirect.get()||this.emit({type:"onBeforeNavigate",...h}),this.emit({type:"onBeforeLoad",...h}),await B2({router:this,sync:n?.sync,forceStaleReload:c.href===g.href,matches:this.stores.pendingMatches.get(),location:g,updateMatch:this.updateMatch,onReady:async()=>{this.startTransition(()=>{this.startViewTransition(async()=>{let b=null,x=null,v=null,w=null;this.batch(()=>{const k=this.stores.pendingMatches.get(),C=k.length,N=this.stores.matches.get();b=C?N.filter(M=>!this.stores.pendingMatchStores.has(M.id)):null;const A=new Set;for(const M of this.stores.pendingMatchStores.values())M.routeId&&A.add(M.routeId);const R=new Set;for(const M of this.stores.matchStores.values())M.routeId&&R.add(M.routeId);x=C?N.filter(M=>!A.has(M.routeId)):null,v=C?k.filter(M=>!R.has(M.routeId)):null,w=C?k.filter(M=>R.has(M.routeId)):N,this.stores.isLoading.set(!1),this.stores.loadedAt.set(Date.now()),C&&(this.stores.setMatches(k),this.stores.setPending([]),this.stores.setCached([...this.stores.cachedMatches.get(),...b.filter(M=>M.status!=="error"&&M.status!=="notFound"&&M.status!=="redirected")]),this.clearExpiredCache())});for(const[k,C]of[[x,"onLeave"],[v,"onEnter"],[w,"onStay"]])if(k)for(const N of k)this.looseRoutesById[N.routeId].options[C]?.(N)})})}})}catch(g){Or(g)?(i=g,this.navigate({...i.options,replace:!0,ignoreBlocker:!0})):or(g)&&(a=g);const h=i?i.status:a?404:this.stores.matches.get().some(b=>b.status==="error")?500:200;this.batch(()=>{this.stores.statusCode.set(h),this.stores.redirect.set(i)})}this.latestLoadPromise===l&&(this.commitLocationPromise?.resolve(),this.latestLoadPromise=void 0,this.commitLocationPromise=void 0),f()})}),this.latestLoadPromise=l,await l;this.latestLoadPromise&&l!==this.latestLoadPromise;)await this.latestLoadPromise;let d;this.hasNotFoundMatch()?d=404:this.stores.matches.get().some(f=>f.status==="error")&&(d=500),d!==void 0&&this.stores.statusCode.set(d)},this.startViewTransition=n=>{const r=this.shouldViewTransition??this.options.defaultViewTransition;if(this.shouldViewTransition=void 0,r&&typeof document<"u"&&"startViewTransition"in document&&typeof document.startViewTransition=="function"){let i;if(typeof r=="object"&&this.isViewTransitionTypesSupported){const a=this.latestLocation,l=this.stores.resolvedLocation.get(),c=typeof r.types=="function"?r.types(Tl(a,l)):r.types;if(c===!1){n();return}i={update:n,types:c}}else i=n;document.startViewTransition(i)}else n()},this.updateMatch=(n,r)=>{this.startTransition(()=>{const i=this.stores.pendingMatchStores.get(n);if(i){i.set(r);return}const a=this.stores.matchStores.get(n);if(a){a.set(r);return}const l=this.stores.cachedMatchStores.get(n);if(l){const c=r(l.get());c.status==="redirected"?this.stores.cachedMatchStores.delete(n)&&this.stores.cachedIds.set(d=>d.filter(f=>f!==n)):l.set(c)}})},this.getMatch=n=>this.stores.cachedMatchStores.get(n)?.get()??this.stores.pendingMatchStores.get(n)?.get()??this.stores.matchStores.get(n)?.get(),this.invalidate=n=>{const r=i=>n?.filter?.(i)??!0?{...i,invalid:!0,...n?.forcePending||i.status==="error"||i.status==="notFound"?{status:"pending",error:void 0}:void 0}:i;return this.batch(()=>{this.stores.setMatches(this.stores.matches.get().map(r)),this.stores.setCached(this.stores.cachedMatches.get().map(r)),this.stores.setPending(this.stores.pendingMatches.get().map(r))}),this.shouldViewTransition=!1,this.load({sync:n?.sync})},this.getParsedLocationHref=n=>n.publicHref||"/",this.resolveRedirect=n=>{const r=n.headers.get("Location");if(!n.options.href||n.options._builtLocation){const i=n.options._builtLocation??this.buildLocation(n.options),a=this.getParsedLocationHref(i);n.options.href=a,n.headers.set("Location",a)}else if(r)try{const i=new URL(r);if(this.origin&&i.origin===this.origin){const a=i.pathname+i.search+i.hash;n.options.href=a,n.headers.set("Location",a)}}catch{}if(n.options.href&&!n.options._builtLocation&&Sh(n.options.href,this.protocolAllowlist))throw new Error("Redirect blocked: unsafe protocol");return n.headers.get("Location")||n.headers.set("Location",n.options.href),n},this.clearCache=n=>{const r=n?.filter;r!==void 0?this.stores.setCached(this.stores.cachedMatches.get().filter(i=>!r(i))):this.stores.setCached([])},this.clearExpiredCache=()=>{const n=Date.now(),r=i=>{const a=this.looseRoutesById[i.routeId];if(!a.options.loader)return!0;const l=(i.preload?a.options.preloadGcTime??this.options.defaultPreloadGcTime:a.options.gcTime??this.options.defaultGcTime)??300*1e3;return i.status==="error"?!0:n-i.updatedAt>=l};this.clearCache({filter:r})},this.loadRouteChunk=jc,this.preloadRoute=async n=>{const r=n._builtLocation??this.buildLocation(n);let i=this.matchRoutes(r,{throwOnError:!0,preload:!0,dest:n});const a=new Set([...this.stores.matchesId.get(),...this.stores.pendingIds.get()]),l=new Set([...a,...this.stores.cachedIds.get()]),c=i.filter(d=>!l.has(d.id));if(c.length){const d=this.stores.cachedMatches.get();this.stores.setCached([...d,...c])}try{return i=await B2({router:this,matches:i,location:r,preload:!0,updateMatch:(d,f)=>{a.has(d)?i=i.map(g=>g.id===d?f(g):g):this.updateMatch(d,f)}}),i}catch(d){if(Or(d))return d.options.reloadDocument?void 0:await this.preloadRoute({...d.options,_fromLocation:r});or(d)||console.error(d);return}},this.matchRoute=(n,r)=>{const i={...n,to:n.to?this.resolvePathWithBase(n.from||"",n.to):void 0,params:n.params||{},leaveParams:!0},a=this.buildLocation(i);if(r?.pending&&this.stores.status.get()!=="pending")return!1;const l=(r?.pending===void 0?!this.stores.isLoading.get():r.pending)?this.latestLocation:this.stores.resolvedLocation.get()||this.stores.location.get(),c=o5(a.pathname,r?.caseSensitive??!1,r?.fuzzy??!1,l.pathname,this.processedTree);return!c||n.params&&!Za(c.rawParams,n.params,{partial:!0})?!1:r?.includeSearch??!0?Za(l.search,a.search,{partial:!0})?c.rawParams:!1:c.rawParams},this.hasNotFoundMatch=()=>this.stores.matches.get().some(n=>n.status==="notFound"||n.globalNotFound),this.getStoreConfig=t,this.update({defaultPreloadDelay:50,defaultPendingMs:1e3,defaultPendingMinMs:500,context:void 0,...e,caseSensitive:e.caseSensitive??!1,notFoundMode:e.notFoundMode??"fuzzy",stringifySearch:e.stringifySearch??N5,parseSearch:e.parseSearch??w5,protocolAllowlist:e.protocolAllowlist??t5}),typeof document<"u"&&(self.__TSR_ROUTER__=this)}isShell(){return!!this.options.isShell}isPrerendering(){return!!this.options.isPrerendering}get state(){return this.stores.__store.get()}setRoutes({routesById:e,routesByPath:t,processedTree:n}){this.routesById=e,this.routesByPath=t,this.processedTree=n;const r=this.options.notFoundRoute;r&&(r.init({originalIndex:99999999999}),this.routesById[r.id]=r)}getRouteBranch(e){let t=this.routeBranchCache.get(e);return t||(t=Mw(e),this.routeBranchCache.set(e,t)),t}get looseRoutesById(){return this.routesById}getParentContext(e){return e?.id?e.context??this.options.context??void 0:this.options.context??void 0}matchRoutesInternal(e,t){const n=this.getMatchedRoutes(e.pathname),{foundRoute:r,routeParams:i}=n;let{matchedRoutes:a}=n,l=!1;(r?r.path!=="/"&&i["**"]:li(e.pathname))&&(this.options.notFoundRoute?a=[...a,this.options.notFoundRoute]:l=!0);const c=l?X5(this.options.notFoundMode,a):void 0,d=new Array(a.length),f=new Map;for(const g of this.stores.matchStores.values())g.routeId&&f.set(g.routeId,g.get());for(let g=0;g<a.length;g++){const h=a[g],b=d[g-1];let x,v,w;{const K=b?.search??e.search,F=b?._strictSearch??void 0;try{const W=ch(h.options.validateSearch,{...K})??void 0;x={...K,...W},v={...F,...W},w=void 0}catch(W){let V=W;if(W instanceof kh||(V=new kh(W.message,{cause:W})),t?.throwOnError)throw V;x=K,v={},w=V}}const k=h.options.loaderDeps?.({search:x})??"",C=k?JSON.stringify(k):"",{interpolatedPath:N,usedParams:A}=O2({path:h.fullPath,params:i,decoder:this.pathParamsDecoder,server:this.isServer}),R=h.id+N+C,M=this.getMatch(R),_=f.get(h.id),D=M?._strictParams??A;let I;if(!M)try{$2(h,D)}catch(K){if(or(K)||Or(K)?I=K:I=new $5(K.message,{cause:K}),t?.throwOnError)throw I}Object.assign(i,D);const U=_?"stay":"enter";let j;if(M)j={...M,cause:U,params:_?.params??i,_strictParams:D,search:Pa(_?_.search:M.search,x),_strictSearch:v};else{const K=h.options.loader||h.options.beforeLoad||h.lazyFn||Fw(h)?"pending":"success";j={id:R,ssr:h.options.ssr,index:g,routeId:h.id,params:_?.params??i,_strictParams:D,pathname:N,updatedAt:Date.now(),search:_?Pa(_.search,x):x,_strictSearch:v,searchError:void 0,status:K,isFetching:!1,error:void 0,paramsError:I,__routeContext:void 0,_nonReactive:{loadPromise:Al()},__beforeLoadContext:void 0,context:{},abortController:new AbortController,fetchCount:0,cause:U,loaderDeps:_?Ga(_.loaderDeps,k):k,invalid:!1,preload:!1,links:void 0,scripts:void 0,headScripts:void 0,meta:void 0,staticData:h.options.staticData||{},fullPath:h.fullPath}}t?.preload||(j.globalNotFound=c===h.id),j.searchError=w;const X=this.getParentContext(b);j.context={...X,...j.__routeContext,...j.__beforeLoadContext},d[g]=j}for(let g=0;g<d.length;g++){const h=d[g],b=this.looseRoutesById[h.routeId],x=this.getMatch(h.id),v=f.get(h.routeId);if(h.params=v?Pa(v.params,i):i,!x){const w=d[g-1],k=this.getParentContext(w);if(b.options.context){const C={deps:h.loaderDeps,params:h.params,context:k??{},location:e,navigate:N=>this.navigate({...N,_fromLocation:e}),buildLocation:this.buildLocation,cause:h.cause,abortController:h.abortController,preload:!!h.preload,matches:d,routeId:b.id};h.__routeContext=b.options.context(C)??void 0}h.context={...k,...h.__routeContext,...h.__beforeLoadContext}}}return d}matchRoutesLightweight(e){const t=Lc(this.stores.matchesId.get()),n=this.lightweightCache.get(e);if(n&&n[0]===t)return n[1];const{matchedRoutes:r,routeParams:i}=this.getMatchedRoutes(e.pathname),a=Lc(r),l={...e.search};for(const h of r)try{Object.assign(l,ch(h.options.validateSearch,l))}catch{}const c=t&&this.stores.matchStores.get(t)?.get(),d=c&&c.routeId===a.id&&c.pathname===e.pathname;let f;if(d)f=c.params;else{const h=Object.assign(Object.create(null),i);for(const b of r)try{$2(b,h)}catch{}f=h}const g={matchedRoutes:r,fullPath:a.fullPath,search:l,params:f};return this.lightweightCache.set(e,[t,g]),g}},kh=class extends Error{},$5=class extends Error{};function V5(e){return{loadedAt:0,isLoading:!1,isTransitioning:!1,status:"idle",resolvedLocation:void 0,location:e,matches:[],statusCode:200}}function ch(e,t){if(e==null)return{};if("~standard"in e){const n=e["~standard"].validate(t);if(n instanceof Promise)throw new kh("Async validation not supported");if(n.issues)throw new kh(JSON.stringify(n.issues,void 0,2),{cause:n});return n.value}return"parse"in e?e.parse(t):typeof e=="function"?e(t):{}}function q5({pathname:e,routesById:t,processedTree:n}){const r=Object.create(null),i=li(e);let a;const l=l5(i,n,!0);return l&&(a=l.route,Object.assign(r,l.rawParams)),{matchedRoutes:l?.branch||[t.__root__],routeParams:r,foundRoute:a}}function Y5({search:e,dest:t,destRoutes:n,_includeValidateSearch:r}){return G5(n)(e,t,r??!1)}function G5(e){let t,n;const r=[];for(const a of e){const l=a.options;if("search"in l)l.search?.middlewares&&r.push(...l.search.middlewares);else if(l.preSearchFilters||l.postSearchFilters){const d=({search:f,next:g})=>{const h=g(l.preSearchFilters?l.preSearchFilters.reduce((b,x)=>x(b),f):f);return l.postSearchFilters?l.postSearchFilters.reduce((b,x)=>x(b),h):h};r.push(d)}const c=l.validateSearch;if(c){const d=({search:f,next:g,meta:h})=>{const b=g(f);if(n)try{const x=ch(c,b);if(h&&x)for(const v in x)v in b||(h.defaulted||=new Map).set(v,x[v]);return{...b,...x}}catch{}return b};r.push(d)}}const i=(a,l,c)=>{if(a>=r.length){if(!t.search)return{};if(t.search===!0)return l;const f=Ya(t.search,l);return c&&(c.explicit=f),f}const d=(f,g)=>{if(g){const h=c||{};return{search:i(a+1,f,h),meta:h}}return i(a+1,f,c)};return r[a]({search:l,next:d,meta:c})};return function(l,c,d){return t=c,n=d,i(0,l)}}function X5(e,t){if(e!=="root")for(let n=t.length-1;n>=0;n--){const r=t[n];if(r.children)return r.id}return Ja}function $2(e,t){const n=e.options.params?.parse??e.options.parseParams;if(n){const r=n(t);if(r===!1)throw new Error("Route params.parse returned false for a matched route");Object.assign(t,r)}}const K5="Error preloading route! ☝️";var Vw=class{get to(){return this._to}get id(){return this._id}get path(){return this._path}get fullPath(){return this._fullPath}constructor(e){if(this.init=t=>{this.originalIndex=t.originalIndex;const n=this.options,r=!n?.path&&!n?.id;this.parentRoute=this.options.getParentRoute?.(),r?this._path=Ja:this.parentRoute||ui();let i=r?Ja:n?.path;i&&i!=="/"&&(i=Lw(i));const a=n?.id||i;let l=r?Ja:oh([this.parentRoute.id==="__root__"?"":this.parentRoute.id,a]);i==="__root__"&&(i="/"),l!=="__root__"&&(l=oh(["/",l]));const c=l==="__root__"?"/":oh([this.parentRoute.fullPath,i]);this._path=i,this._id=l,this._fullPath=c,this._to=li(c)},this.addChildren=t=>this._addFileChildren(t),this._addFileChildren=t=>(Array.isArray(t)&&(this.children=t),typeof t=="object"&&t!==null&&(this.children=Object.values(t)),this),this._addFileTypes=()=>this,this.updateLoader=t=>(Object.assign(this.options,t),this),this.update=t=>(Object.assign(this.options,t),this),this.lazy=t=>(this.lazyFn=t,this),this.redirect=t=>jw({from:this.fullPath,...t}),this.options=e||{},this.isRoot=!e?.getParentRoute,e?.id&&e?.path)throw new Error("Route cannot have both an 'id' and a 'path' option.")}},Q5=class extends Vw{constructor(e){super(e)}};function N1(e){const t=e.errorComponent??A1;return m.jsx(W5,{getResetKey:e.getResetKey,onCatch:e.onCatch,children:({error:n,reset:r})=>n?E.createElement(t,{error:n,reset:r}):e.children})}var W5=class extends E.Component{constructor(...e){super(...e),this.state={error:null}}static getDerivedStateFromProps(e,t){const n=e.getResetKey();return t.error&&t.resetKey!==n?{resetKey:n,error:null}:{resetKey:n}}static getDerivedStateFromError(e){return{error:e}}reset(){this.setState({error:null})}componentDidCatch(e,t){this.props.onCatch&&this.props.onCatch(e,t)}render(){return this.props.children({error:this.state.error,reset:()=>{this.reset()}})}};function A1({error:e}){const[t,n]=E.useState(!1);return m.jsxs("div",{style:{padding:".5rem",maxWidth:"100%"},children:[m.jsxs("div",{style:{display:"flex",alignItems:"center",gap:".5rem"},children:[m.jsx("strong",{style:{fontSize:"1rem"},children:"Something went wrong!"}),m.jsx("button",{style:{appearance:"none",fontSize:".6em",border:"1px solid currentColor",padding:".1rem .2rem",fontWeight:"bold",borderRadius:".25rem"},onClick:()=>n(r=>!r),children:t?"Hide Error":"Show Error"})]}),m.jsx("div",{style:{height:".25rem"}}),t?m.jsx("div",{children:m.jsx("pre",{style:{fontSize:".7em",border:"1px solid red",borderRadius:".25rem",padding:".3rem",color:"red",overflow:"auto"},children:e.message?m.jsx("code",{children:e.message}):null})}):null]})}function Z5({children:e,fallback:t=null}){return qw()?m.jsx(ze.Fragment,{children:e}):m.jsx(ze.Fragment,{children:t})}function qw(){return ze.useSyncExternalStore(J5,()=>!0,()=>!1)}function J5(){return()=>{}}var Yw=E.createContext(null);function Yr(e){return E.useContext(Yw)}var sp=E.createContext(void 0),eM=E.createContext(void 0),pn=(e=>(e[e.None=0]="None",e[e.Mutable=1]="Mutable",e[e.Watching=2]="Watching",e[e.RecursedCheck=4]="RecursedCheck",e[e.Recursed=8]="Recursed",e[e.Dirty=16]="Dirty",e[e.Pending=32]="Pending",e))(pn||{});function tM({update:e,notify:t,unwatched:n}){return{link:r,unlink:i,propagate:a,checkDirty:l,shallowPropagate:c};function r(f,g,h){const b=g.depsTail;if(b!==void 0&&b.dep===f)return;const x=b!==void 0?b.nextDep:g.deps;if(x!==void 0&&x.dep===f){x.version=h,g.depsTail=x;return}const v=f.subsTail;if(v!==void 0&&v.version===h&&v.sub===g)return;const w=g.depsTail=f.subsTail={version:h,dep:f,sub:g,prevDep:b,nextDep:x,prevSub:v,nextSub:void 0};x!==void 0&&(x.prevDep=w),b!==void 0?b.nextDep=w:g.deps=w,v!==void 0?v.nextSub=w:f.subs=w}function i(f,g=f.sub){const h=f.dep,b=f.prevDep,x=f.nextDep,v=f.nextSub,w=f.prevSub;return x!==void 0?x.prevDep=b:g.depsTail=b,b!==void 0?b.nextDep=x:g.deps=x,v!==void 0?v.prevSub=w:h.subsTail=w,w!==void 0?w.nextSub=v:(h.subs=v)===void 0&&n(h),x}function a(f){let g=f.nextSub,h;e:do{const b=f.sub;let x=b.flags;if(x&60?x&12?x&4?!(x&48)&&d(f,b)?(b.flags=x|40,x&=1):x=0:b.flags=x&-9|32:x=0:b.flags=x|32,x&2&&t(b),x&1){const v=b.subs;if(v!==void 0){const w=(f=v).nextSub;w!==void 0&&(h={value:g,prev:h},g=w);continue}}if((f=g)!==void 0){g=f.nextSub;continue}for(;h!==void 0;)if(f=h.value,h=h.prev,f!==void 0){g=f.nextSub;continue e}break}while(!0)}function l(f,g){let h,b=0,x=!1;e:do{const v=f.dep,w=v.flags;if(g.flags&16)x=!0;else if((w&17)===17){if(e(v)){const k=v.subs;k.nextSub!==void 0&&c(k),x=!0}}else if((w&33)===33){(f.nextSub!==void 0||f.prevSub!==void 0)&&(h={value:f,prev:h}),f=v.deps,g=v,++b;continue}if(!x){const k=f.nextDep;if(k!==void 0){f=k;continue}}for(;b--;){const k=g.subs,C=k.nextSub!==void 0;if(C?(f=h.value,h=h.prev):f=k,x){if(e(g)){C&&c(k),g=f.sub;continue}x=!1}else g.flags&=-33;g=f.sub;const N=f.nextDep;if(N!==void 0){f=N;continue e}}return x}while(!0)}function c(f){do{const g=f.sub,h=g.flags;(h&48)===32&&(g.flags=h|16,(h&6)===2&&t(g))}while((f=f.nextSub)!==void 0)}function d(f,g){let h=g.depsTail;for(;h!==void 0;){if(h===f)return!0;h=h.prevDep}return!1}}function nM(e,t,n){const r=typeof e=="object",i=r?e:void 0;return{next:(r?e.next:e)?.bind(i),error:(r?e.error:t)?.bind(i),complete:(r?e.complete:n)?.bind(i)}}const Eb=[];let dh=0;const{link:V2,unlink:rM,propagate:sM,checkDirty:Gw,shallowPropagate:q2}=tM({update(e){return e._update()},notify(e){Eb[vb++]=e,e.flags&=~pn.Watching},unwatched(e){e.depsTail!==void 0&&(e.depsTail=void 0,e.flags=pn.Mutable|pn.Dirty,wh(e))}});let _f=0,vb=0,ws,Tb=0;function Xw(e){try{++Tb,e()}finally{--Tb||Kw()}}function wh(e){const t=e.depsTail;let n=t!==void 0?t.nextDep:e.deps;for(;n!==void 0;)n=rM(n,e)}function Kw(){if(!(Tb>0)){for(;_f<vb;){const e=Eb[_f];Eb[_f++]=void 0,e.notify()}_f=0,vb=0}}function Y2(e,t){const n=typeof e=="function",r=e,i={_snapshot:n?void 0:e,subs:void 0,subsTail:void 0,deps:void 0,depsTail:void 0,flags:n?pn.None:pn.Mutable,get(){return ws!==void 0&&V2(i,ws,dh),i._snapshot},subscribe(a){const l=nM(a),c={current:!1},d=iM(()=>{i.get(),c.current?l.next?.(i._snapshot):c.current=!0});return{unsubscribe:()=>{d.stop()}}},_update(a){const l=ws,c=t?.compare??Object.is;if(n)ws=i,++dh,i.depsTail=void 0;else if(a===void 0)return!1;n&&(i.flags=pn.Mutable|pn.RecursedCheck);try{const d=i._snapshot,f=typeof a=="function"?a(d):a===void 0&&n?r(d):a;return d===void 0||!c(d,f)?(i._snapshot=f,!0):!1}finally{ws=l,n&&(i.flags&=~pn.RecursedCheck),wh(i)}}};return n?(i.flags=pn.Mutable|pn.Dirty,i.get=function(){const a=i.flags;if(a&pn.Dirty||a&pn.Pending&&Gw(i.deps,i)){if(i._update()){const l=i.subs;l!==void 0&&q2(l)}}else a&pn.Pending&&(i.flags=a&~pn.Pending);return ws!==void 0&&V2(i,ws,dh),i._snapshot}):i.set=function(a){if(i._update(a)){const l=i.subs;l!==void 0&&(sM(l),q2(l),Kw())}},i}function iM(e){const t=()=>{const r=ws;ws=n,++dh,n.depsTail=void 0,n.flags=pn.Watching|pn.RecursedCheck;try{return e()}finally{ws=r,n.flags&=~pn.RecursedCheck,wh(n)}},n={deps:void 0,depsTail:void 0,subs:void 0,subsTail:void 0,flags:pn.Watching|pn.RecursedCheck,notify(){const r=this.flags;r&pn.Dirty||r&pn.Pending&&Gw(this.deps,this)?t():this.flags=pn.Watching},stop(){this.flags=pn.None,this.depsTail=void 0,wh(this)}};return t(),n}var b0={exports:{}},x0={},y0={exports:{}},E0={};/**
51
+ * @license React
52
+ * use-sync-external-store-shim.production.js
53
+ *
54
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
55
+ *
56
+ * This source code is licensed under the MIT license found in the
57
+ * LICENSE file in the root directory of this source tree.
58
+ */var G2;function aM(){if(G2)return E0;G2=1;var e=Qc();function t(h,b){return h===b&&(h!==0||1/h===1/b)||h!==h&&b!==b}var n=typeof Object.is=="function"?Object.is:t,r=e.useState,i=e.useEffect,a=e.useLayoutEffect,l=e.useDebugValue;function c(h,b){var x=b(),v=r({inst:{value:x,getSnapshot:b}}),w=v[0].inst,k=v[1];return a(function(){w.value=x,w.getSnapshot=b,d(w)&&k({inst:w})},[h,x,b]),i(function(){return d(w)&&k({inst:w}),h(function(){d(w)&&k({inst:w})})},[h]),l(x),x}function d(h){var b=h.getSnapshot;h=h.value;try{var x=b();return!n(h,x)}catch{return!0}}function f(h,b){return b()}var g=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?f:c;return E0.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:g,E0}var X2;function Qw(){return X2||(X2=1,y0.exports=aM()),y0.exports}/**
59
+ * @license React
60
+ * use-sync-external-store-shim/with-selector.production.js
61
+ *
62
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
63
+ *
64
+ * This source code is licensed under the MIT license found in the
65
+ * LICENSE file in the root directory of this source tree.
66
+ */var K2;function oM(){if(K2)return x0;K2=1;var e=Qc(),t=Qw();function n(f,g){return f===g&&(f!==0||1/f===1/g)||f!==f&&g!==g}var r=typeof Object.is=="function"?Object.is:n,i=t.useSyncExternalStore,a=e.useRef,l=e.useEffect,c=e.useMemo,d=e.useDebugValue;return x0.useSyncExternalStoreWithSelector=function(f,g,h,b,x){var v=a(null);if(v.current===null){var w={hasValue:!1,value:null};v.current=w}else w=v.current;v=c(function(){function C(_){if(!N){if(N=!0,A=_,_=b(_),x!==void 0&&w.hasValue){var D=w.value;if(x(D,_))return R=D}return R=_}if(D=R,r(A,_))return D;var I=b(_);return x!==void 0&&x(D,I)?(A=_,D):(A=_,R=I)}var N=!1,A,R,M=h===void 0?null:h;return[function(){return C(g())},M===null?void 0:function(){return C(M())}]},[g,h,b,x]);var k=i(f,v[0],v[1]);return l(function(){w.hasValue=!0,w.value=k},[k]),d(k),k},x0}var Q2;function lM(){return Q2||(Q2=1,b0.exports=oM()),b0.exports}var Ww=lM();function uM(e,t){return e===t}function gr(e,t,n=uM){const r=E.useCallback(l=>{if(!e)return()=>{};const{unsubscribe:c}=e.subscribe(l);return c},[e]),i=E.useCallback(()=>e?.get(),[e]);return Ww.useSyncExternalStoreWithSelector(r,i,i,t,n)}var v0={get(){},subscribe(){return{unsubscribe(){}}}};function Zw(e,t){const n=E.useRef();return r=>{const i=e?.select?e.select(r):r;return e?.structuralSharing??t.options.defaultStructuralSharing?n.current=Ga(n.current,i):i}}function bo(e){const t=Yr(),n=E.useContext(e.from?eM:sp),r=e.from?t.stores.getRouteMatchStore(e.from):t.stores.matchStores.get(n),i=Zw(e,t),a=gr(r??v0,l=>l?i(l):v0);if(a!==v0)return a;(e.shouldThrow??!0)&&ui()}function Jw(e){return bo({from:e.from,strict:e.strict,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.loaderData):t.loaderData})}function e3(e){const{select:t,...n}=e;return bo({...n,select:r=>t?t(r.loaderDeps):r.loaderDeps})}function ip(e){return bo({from:e.from,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,strict:e.strict,select:t=>{const n=e.strict===!1?t.params:t._strictParams;return e.select?e.select(n):n}})}function t3(e){return bo({from:e.from,strict:e.strict,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.search):t.search})}function zl(e){const t=Yr();return E.useCallback(n=>t.navigate({...n,from:n.from??e?.from}),[e?.from,t])}function n3(e){return bo({...e,select:t=>e.select?e.select(t.context):t.context})}var br=Cw();const cM=tp(br);function dM(e,t){const n=Yr(),r=QI(t),{activeProps:i,inactiveProps:a,activeOptions:l,to:c,preload:d,preloadDelay:f,preloadIntentProximity:g,hashScrollIntoView:h,replace:b,startTransition:x,resetScroll:v,viewTransition:w,children:k,target:C,disabled:N,style:A,className:R,onClick:M,onBlur:_,onFocus:D,onMouseEnter:I,onMouseLeave:U,onTouchStart:j,ignoreBlocker:X,params:K,search:F,hash:W,state:V,mask:H,reloadDocument:q,unsafeRelative:J,from:ue,_fromLocation:L,...B}=e,G=qw(),P=E.useMemo(()=>e,[n,e.from,e._fromLocation,e.hash,e.to,e.search,e.params,e.state,e.mask,e.unsafeRelative]),ae=gr(n.stores.location,re=>re,(re,Q)=>re.href===Q.href),ie=E.useMemo(()=>{const re={_fromLocation:ae,...P};return n.buildLocation(re)},[n,ae,P]),ce=ie.maskedLocation?ie.maskedLocation.publicHref:ie.publicHref,de=ie.maskedLocation?ie.maskedLocation.external:ie.external,he=E.useMemo(()=>bM(ce,de,n.history,N),[N,de,ce,n.history]),ve=E.useMemo(()=>{if(he?.external)return Sh(he.href,n.protocolAllowlist)?void 0:he.href;if(!xM(c)&&!(typeof c!="string"||c.indexOf(":")===-1))try{return new URL(c),Sh(c,n.protocolAllowlist)?void 0:c}catch{}},[c,he,n.protocolAllowlist]),Fe=E.useMemo(()=>{if(ve)return!1;if(l?.exact){if(!p5(ae.pathname,ie.pathname,n.basepath))return!1}else{const re=Ch(ae.pathname,n.basepath),Q=Ch(ie.pathname,n.basepath);if(!(re.startsWith(Q)&&(re.length===Q.length||re[Q.length]==="/")))return!1}return(l?.includeSearch??!0)&&!Za(ae.search,ie.search,{partial:!l?.exact,ignoreUndefined:!l?.explicitUndefined})?!1:l?.includeHash?G&&ae.hash===ie.hash:!0},[l?.exact,l?.explicitUndefined,l?.includeHash,l?.includeSearch,ae,ve,G,ie.hash,ie.pathname,ie.search,n.basepath]),Le=Fe?Ya(i,{})??fM:T0,Ee=Fe?T0:Ya(a,{})??T0,Oe=[R,Le.className,Ee.className].filter(Boolean).join(" "),Ue=(A||Le.style||Ee.style)&&{...A,...Le.style,...Ee.style},[Xe,qe]=E.useState(!1),De=E.useRef(!1),ke=e.reloadDocument||ve?!1:d??n.options.defaultPreload,ye=f??n.options.defaultPreloadDelay??0,Re=E.useCallback(()=>{n.preloadRoute({...P,_builtLocation:ie}).catch(re=>{console.warn(re),console.warn(K5)})},[n,P,ie]);KI(r,E.useCallback(re=>{re?.isIntersecting&&Re()},[Re]),gM,{disabled:!!N||ke!=="viewport"}),E.useEffect(()=>{De.current||!N&&ke==="render"&&(Re(),De.current=!0)},[N,Re,ke]);const Pe=re=>{const Q=re.currentTarget.getAttribute("target"),$=C!==void 0?C:Q;if(!N&&!yM(re)&&!re.defaultPrevented&&(!$||$==="_self")&&re.button===0){re.preventDefault(),br.flushSync(()=>{qe(!0)});const oe=n.subscribe("onResolved",()=>{oe(),qe(!1)});n.navigate({...P,replace:b,resetScroll:v,hashScrollIntoView:h,startTransition:x,viewTransition:w,ignoreBlocker:X})}};if(ve)return{...B,ref:r,href:ve,...k&&{children:k},...C&&{target:C},...N&&{disabled:N},...A&&{style:A},...R&&{className:R},...M&&{onClick:M},..._&&{onBlur:_},...D&&{onFocus:D},...I&&{onMouseEnter:I},...U&&{onMouseLeave:U},...j&&{onTouchStart:j}};const ee=re=>{if(N||ke!=="intent")return;if(!ye){Re();return}const Q=re.currentTarget;if(Zu.has(Q))return;const $=setTimeout(()=>{Zu.delete(Q),Re()},ye);Zu.set(Q,$)},pe=re=>{N||ke!=="intent"||Re()},se=re=>{if(N||!ke||!ye)return;const Q=re.currentTarget,$=Zu.get(Q);$&&(clearTimeout($),Zu.delete(Q))};return{...B,...Le,...Ee,href:he?.href,ref:r,onClick:fl([M,Pe]),onBlur:fl([_,se]),onFocus:fl([D,ee]),onMouseEnter:fl([I,ee]),onMouseLeave:fl([U,se]),onTouchStart:fl([j,pe]),disabled:!!N,target:C,...Ue&&{style:Ue},...Oe&&{className:Oe},...N&&hM,...Fe&&pM,...G&&Xe&&mM}}var T0={},fM={className:"active"},hM={role:"link","aria-disabled":!0},pM={"data-status":"active","aria-current":"page"},mM={"data-transitioning":"transitioning"},Zu=new WeakMap,gM={rootMargin:"100px"},fl=e=>t=>{for(const n of e)if(n){if(t.defaultPrevented)return;n(t)}};function bM(e,t,n,r){if(!r)return t?{href:e,external:!0}:{href:n.createHref(e)||"/",external:!1}}function xM(e){if(typeof e!="string")return!1;const t=e.charCodeAt(0);return t===47?e.charCodeAt(1)!==47:t===46}var Wc=E.forwardRef((e,t)=>{const{_asChild:n,...r}=e,{type:i,...a}=dM(r,t),l=typeof r.children=="function"?r.children({isActive:a["data-status"]==="active"}):r.children;if(!n){const{disabled:c,...d}=a;return E.createElement("a",d,l)}return E.createElement(n,a,l)});function yM(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}var EM=class extends Vw{constructor(e){super(e),this.useMatch=t=>bo({select:t?.select,from:this.id,structuralSharing:t?.structuralSharing}),this.useRouteContext=t=>n3({...t,from:this.id}),this.useSearch=t=>t3({select:t?.select,structuralSharing:t?.structuralSharing,from:this.id}),this.useParams=t=>ip({select:t?.select,structuralSharing:t?.structuralSharing,from:this.id}),this.useLoaderDeps=t=>e3({...t,from:this.id}),this.useLoaderData=t=>Jw({...t,from:this.id}),this.useNavigate=()=>zl({from:this.fullPath}),this.Link=ze.forwardRef((t,n)=>m.jsx(Wc,{ref:n,from:this.fullPath,...t}))}};function xo(e){return new EM(e)}var vM=class extends Q5{constructor(e){super(e),this.useMatch=t=>bo({select:t?.select,from:this.id,structuralSharing:t?.structuralSharing}),this.useRouteContext=t=>n3({...t,from:this.id}),this.useSearch=t=>t3({select:t?.select,structuralSharing:t?.structuralSharing,from:this.id}),this.useParams=t=>ip({select:t?.select,structuralSharing:t?.structuralSharing,from:this.id}),this.useLoaderDeps=t=>e3({...t,from:this.id}),this.useLoaderData=t=>Jw({...t,from:this.id}),this.useNavigate=()=>zl({from:this.fullPath}),this.Link=ze.forwardRef((t,n)=>m.jsx(Wc,{ref:n,from:this.fullPath,...t}))}};function TM(e){return new vM(e)}function SM(e){const t=Yr(),n=`not-found-${gr(t.stores.location,r=>r.pathname)}-${gr(t.stores.status,r=>r)}`;return m.jsx(N1,{getResetKey:()=>n,onCatch:(r,i)=>{if(or(r))e.onCatch?.(r,i);else throw r},errorComponent:({error:r})=>{if(or(r))return e.fallback?.(r);throw r},children:e.children})}function CM(){return m.jsx("p",{children:"Not Found"})}function gl(e){return m.jsx(m.Fragment,{children:e.children})}function r3(e,t,n){return t.options.notFoundComponent?m.jsx(t.options.notFoundComponent,{...n}):e.options.defaultNotFoundComponent?m.jsx(e.options.defaultNotFoundComponent,{...n}):m.jsx(CM,{})}function kM(e){return null}function wM(){return kM(Yr()),null}var NM=(e,t)=>e.routeId===t.routeId&&e._displayPending===t._displayPending,AM=(e,t)=>e[0]===t[0]&&e[1]===t[1],s3=E.memo(function({matchId:t}){const n=Yr(),r=n.stores.matchStores.get(t);r||ui();const i=gr(n.stores.loadedAt,l=>l),a=gr(r,l=>l,NM);return m.jsx(_M,{router:n,matchId:t,resetKey:i,matchState:E.useMemo(()=>{const l=a.routeId,c=n.routesById[l].parentRoute?.id;return{routeId:l,ssr:a.ssr,_displayPending:a._displayPending,parentRouteId:c}},[a._displayPending,a.routeId,a.ssr,n.routesById])})});function _M({router:e,matchId:t,resetKey:n,matchState:r}){const i=e.routesById[r.routeId],a=i.options.pendingComponent??e.options.defaultPendingComponent,l=a?m.jsx(a,{}):null,c=i.options.errorComponent??e.options.defaultErrorComponent,d=i.options.onCatch??e.options.defaultOnCatch,f=i.isRoot?i.options.notFoundComponent??e.options.notFoundRoute?.options.component:i.options.notFoundComponent,g=r.ssr===!1||r.ssr==="data-only",h=(!i.isRoot||i.options.wrapInSuspense||g)&&(i.options.wrapInSuspense??a??(i.options.errorComponent?.preload||g))?E.Suspense:gl,b=c?N1:gl,x=f?SM:gl;return m.jsxs(i.isRoot?i.options.shellComponent??gl:gl,{children:[m.jsx(sp.Provider,{value:t,children:m.jsx(h,{fallback:l,children:m.jsx(b,{getResetKey:()=>n,errorComponent:c||A1,onCatch:(v,w)=>{if(or(v))throw v.routeId??=r.routeId,v;d?.(v,w)},children:m.jsx(x,{fallback:v=>{if(v.routeId??=r.routeId,!f||v.routeId&&v.routeId!==r.routeId||!v.routeId&&!i.isRoot)throw v;return E.createElement(f,v)},children:g||r._displayPending?m.jsx(Z5,{fallback:l,children:m.jsx(W2,{matchId:t})}):m.jsx(W2,{matchId:t})})})})}),r.parentRouteId===Ja?m.jsxs(m.Fragment,{children:[m.jsx(RM,{}),e.options.scrollRestoration&&Nw?m.jsx(wM,{}):null]}):null]})}function RM(){const e=Yr(),t=E.useRef();return dc(()=>{const n=e.stores.resolvedLocation.get(),r=t.current;n&&(!r||r.href!==n.href)&&e.emit({type:"onRendered",...Tl(e.stores.location.get(),r??n)}),t.current=n},[gr(e.stores.resolvedLocation,n=>n?.state.__TSR_key),e]),null}var W2=E.memo(function({matchId:t}){const n=Yr(),r=(g,h)=>n.getMatch(g.id)?._nonReactive[h]??g._nonReactive[h],i=n.stores.matchStores.get(t);i||ui();const a=gr(i,g=>g),l=a.routeId,c=n.routesById[l],d=E.useMemo(()=>{const g=(n.routesById[l].options.remountDeps??n.options.defaultRemountDeps)?.({routeId:l,loaderDeps:a.loaderDeps,params:a._strictParams,search:a._strictSearch});return g?JSON.stringify(g):void 0},[l,a.loaderDeps,a._strictParams,a._strictSearch,n.options.defaultRemountDeps,n.routesById]),f=E.useMemo(()=>{const g=c.options.component??n.options.defaultComponent;return g?m.jsx(g,{},d):m.jsx(i3,{})},[d,c.options.component,n.options.defaultComponent]);if(a._displayPending)throw r(a,"displayPendingPromise");if(a._forcePending)throw r(a,"minPendingPromise");if(a.status==="pending"){const g=c.options.pendingMinMs??n.options.defaultPendingMinMs;if(g){const h=n.getMatch(a.id);if(h&&!h._nonReactive.minPendingPromise){const b=Al();h._nonReactive.minPendingPromise=b,setTimeout(()=>{b.resolve(),h._nonReactive.minPendingPromise=void 0},g)}}throw r(a,"loadPromise")}if(a.status==="notFound")return or(a.error)||ui(),r3(n,c,a.error);if(a.status==="redirected")throw Or(a.error)||ui(),r(a,"loadPromise");if(a.status==="error")throw a.error;return f}),i3=E.memo(function(){const t=Yr(),n=E.useContext(sp);let r,i=!1,a;{const f=n?t.stores.matchStores.get(n):void 0;[r,i]=gr(f,g=>[g?.routeId,g?.globalNotFound??!1],AM),a=gr(t.stores.matchesId,g=>g[g.findIndex(h=>h===n)+1])}const l=r?t.routesById[r]:void 0,c=t.options.defaultPendingComponent?m.jsx(t.options.defaultPendingComponent,{}):null;if(i)return l||ui(),r3(t,l,void 0);if(!a)return null;const d=m.jsx(s3,{matchId:a});return r===Ja?m.jsx(E.Suspense,{fallback:c,children:d}):d});function OM(){const e=Yr(),t=E.useRef({router:e,mounted:!1}),[n,r]=E.useState(!1),i=gr(e.stores.isLoading,h=>h),a=gr(e.stores.hasPending,h=>h),l=c0(i),c=i||n||a,d=c0(c),f=i||a,g=c0(f);return e.startTransition=h=>{r(!0),E.startTransition(()=>{h(),r(!1)})},E.useEffect(()=>{const h=e.history.subscribe(e.load),b=e.buildLocation({to:e.latestLocation.pathname,search:!0,params:!0,hash:!0,state:!0,_includeValidateSearch:!0});return li(e.latestLocation.publicHref)!==li(b.publicHref)&&e.commitLocation({...b,replace:!0}),()=>{h()}},[e,e.history]),dc(()=>{if(typeof window<"u"&&e.ssr||t.current.router===e&&t.current.mounted)return;t.current={router:e,mounted:!0},(async()=>{try{await e.load()}catch(b){console.error(b)}})()},[e]),dc(()=>{l&&!i&&e.emit({type:"onLoad",...Tl(e.stores.location.get(),e.stores.resolvedLocation.get())})},[l,e,i]),dc(()=>{g&&!f&&e.emit({type:"onBeforeRouteMount",...Tl(e.stores.location.get(),e.stores.resolvedLocation.get())})},[f,g,e]),dc(()=>{if(d&&!c){const h=Tl(e.stores.location.get(),e.stores.resolvedLocation.get());e.emit({type:"onResolved",...h}),Xw(()=>{e.stores.status.set("idle"),e.stores.resolvedLocation.set(e.stores.location.get())})}},[c,d,e]),null}function IM(){const e=Yr(),t=e.routesById[Ja].options.pendingComponent??e.options.defaultPendingComponent,n=t?m.jsx(t,{}):null,r=m.jsxs(typeof document<"u"&&e.ssr?gl:E.Suspense,{fallback:n,children:[m.jsx(OM,{}),m.jsx(MM,{})]});return e.options.InnerWrap?m.jsx(e.options.InnerWrap,{children:r}):r}function MM(){const e=Yr(),t=gr(e.stores.firstId,i=>i),n=gr(e.stores.loadedAt,i=>i),r=t?m.jsx(s3,{matchId:t}):null;return m.jsx(sp.Provider,{value:t,children:e.options.disableGlobalCatchBoundary?r:m.jsx(N1,{getResetKey:()=>n,errorComponent:A1,onCatch:void 0,children:r})})}var LM=e=>({createMutableStore:Y2,createReadonlyStore:Y2,batch:Xw}),DM=e=>new PM(e),PM=class extends F5{constructor(e){super(e,LM)}};function jM({router:e,children:t,...n}){_w(n)&&e.update({...e.options,...n,context:{...e.options.context,...n.context}});const r=m.jsx(Yw.Provider,{value:e,children:t});return e.options.Wrap?m.jsx(e.options.Wrap,{children:r}):r}function BM({router:e,...t}){return m.jsx(jM,{router:e,...t,children:m.jsx(IM,{})})}function HM(e){const t=Yr({warn:e?.router===void 0}),n=e?.router||t;return gr(n.stores.__store,Zw(e,n))}function a3(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=a3(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function ap(){for(var e,t,n=0,r="",i=arguments.length;n<i;n++)(e=arguments[n])&&(t=a3(e))&&(r&&(r+=" "),r+=t);return r}const Z2=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,J2=ap,o3=(e,t)=>n=>{var r;if(t?.variants==null)return J2(e,n?.class,n?.className);const{variants:i,defaultVariants:a}=t,l=Object.keys(i).map(f=>{const g=n?.[f],h=a?.[f];if(g===null)return null;const b=Z2(g)||Z2(h);return i[f][b]}),c=n&&Object.entries(n).reduce((f,g)=>{let[h,b]=g;return b===void 0||(f[h]=b),f},{}),d=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((f,g)=>{let{class:h,className:b,...x}=g;return Object.entries(x).every(v=>{let[w,k]=v;return Array.isArray(k)?k.includes({...a,...c}[w]):{...a,...c}[w]===k})?[...f,h,b]:f},[]);return J2(e,l,d,n?.class,n?.className)},UM=(e,t)=>{const n=new Array(e.length+t.length);for(let r=0;r<e.length;r++)n[r]=e[r];for(let r=0;r<t.length;r++)n[e.length+r]=t[r];return n},zM=(e,t)=>({classGroupId:e,validator:t}),l3=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),Nh="-",eS=[],FM="arbitrary..",$M=e=>{const t=qM(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:l=>{if(l.startsWith("[")&&l.endsWith("]"))return VM(l);const c=l.split(Nh),d=c[0]===""&&c.length>1?1:0;return u3(c,d,t)},getConflictingClassGroupIds:(l,c)=>{if(c){const d=r[l],f=n[l];return d?f?UM(f,d):d:f||eS}return n[l]||eS}}},u3=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;const i=e[t],a=n.nextPart.get(i);if(a){const f=u3(e,t+1,a);if(f)return f}const l=n.validators;if(l===null)return;const c=t===0?e.join(Nh):e.slice(t).join(Nh),d=l.length;for(let f=0;f<d;f++){const g=l[f];if(g.validator(c))return g.classGroupId}},VM=e=>e.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const t=e.slice(1,-1),n=t.indexOf(":"),r=t.slice(0,n);return r?FM+r:void 0})(),qM=e=>{const{theme:t,classGroups:n}=e;return YM(n,t)},YM=(e,t)=>{const n=l3();for(const r in e){const i=e[r];_1(i,n,r,t)}return n},_1=(e,t,n,r)=>{const i=e.length;for(let a=0;a<i;a++){const l=e[a];GM(l,t,n,r)}},GM=(e,t,n,r)=>{if(typeof e=="string"){XM(e,t,n);return}if(typeof e=="function"){KM(e,t,n,r);return}QM(e,t,n,r)},XM=(e,t,n)=>{const r=e===""?t:c3(t,e);r.classGroupId=n},KM=(e,t,n,r)=>{if(WM(e)){_1(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(zM(n,e))},QM=(e,t,n,r)=>{const i=Object.entries(e),a=i.length;for(let l=0;l<a;l++){const[c,d]=i[l];_1(d,c3(t,c),n,r)}},c3=(e,t)=>{let n=e;const r=t.split(Nh),i=r.length;for(let a=0;a<i;a++){const l=r[a];let c=n.nextPart.get(l);c||(c=l3(),n.nextPart.set(l,c)),n=c}return n},WM=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,ZM=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null);const i=(a,l)=>{n[a]=l,t++,t>e&&(t=0,r=n,n=Object.create(null))};return{get(a){let l=n[a];if(l!==void 0)return l;if((l=r[a])!==void 0)return i(a,l),l},set(a,l){a in n?n[a]=l:i(a,l)}}},Sb="!",tS=":",JM=[],nS=(e,t,n,r,i)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:i}),eL=e=>{const{prefix:t,experimentalParseClassName:n}=e;let r=i=>{const a=[];let l=0,c=0,d=0,f;const g=i.length;for(let w=0;w<g;w++){const k=i[w];if(l===0&&c===0){if(k===tS){a.push(i.slice(d,w)),d=w+1;continue}if(k==="/"){f=w;continue}}k==="["?l++:k==="]"?l--:k==="("?c++:k===")"&&c--}const h=a.length===0?i:i.slice(d);let b=h,x=!1;h.endsWith(Sb)?(b=h.slice(0,-1),x=!0):h.startsWith(Sb)&&(b=h.slice(1),x=!0);const v=f&&f>d?f-d:void 0;return nS(a,x,b,v)};if(t){const i=t+tS,a=r;r=l=>l.startsWith(i)?a(l.slice(i.length)):nS(JM,!1,l,void 0,!0)}if(n){const i=r;r=a=>n({className:a,parseClassName:i})}return r},tL=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((n,r)=>{t.set(n,1e6+r)}),n=>{const r=[];let i=[];for(let a=0;a<n.length;a++){const l=n[a],c=l[0]==="[",d=t.has(l);c||d?(i.length>0&&(i.sort(),r.push(...i),i=[]),r.push(l)):i.push(l)}return i.length>0&&(i.sort(),r.push(...i)),r}},nL=e=>({cache:ZM(e.cacheSize),parseClassName:eL(e),sortModifiers:tL(e),postfixLookupClassGroupIds:rL(e),...$M(e)}),rL=e=>{const t=Object.create(null),n=e.postfixLookupClassGroups;if(n)for(let r=0;r<n.length;r++)t[n[r]]=!0;return t},sL=/\s+/,iL=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i,sortModifiers:a,postfixLookupClassGroupIds:l}=t,c=[],d=e.trim().split(sL);let f="";for(let g=d.length-1;g>=0;g-=1){const h=d[g],{isExternal:b,modifiers:x,hasImportantModifier:v,baseClassName:w,maybePostfixModifierPosition:k}=n(h);if(b){f=h+(f.length>0?" "+f:f);continue}let C=!!k,N;if(C){const D=w.substring(0,k);N=r(D);const I=N&&l[N]?r(w):void 0;I&&I!==N&&(N=I,C=!1)}else N=r(w);if(!N){if(!C){f=h+(f.length>0?" "+f:f);continue}if(N=r(w),!N){f=h+(f.length>0?" "+f:f);continue}C=!1}const A=x.length===0?"":x.length===1?x[0]:a(x).join(":"),R=v?A+Sb:A,M=R+N;if(c.indexOf(M)>-1)continue;c.push(M);const _=i(N,C);for(let D=0;D<_.length;++D){const I=_[D];c.push(R+I)}f=h+(f.length>0?" "+f:f)}return f},aL=(...e)=>{let t=0,n,r,i="";for(;t<e.length;)(n=e[t++])&&(r=d3(n))&&(i&&(i+=" "),i+=r);return i},d3=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=d3(e[r]))&&(n&&(n+=" "),n+=t);return n},Cb=(e,...t)=>{let n,r,i,a;const l=d=>{const f=t.reduce((g,h)=>h(g),e());return n=nL(f),r=n.cache.get,i=n.cache.set,a=c,c(d)},c=d=>{const f=r(d);if(f)return f;const g=iL(d,n);return i(d,g),g};return a=l,(...d)=>a(aL(...d))},oL=[],jn=e=>{const t=n=>n[e]||oL;return t.isThemeGetter=!0,t},f3=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,h3=/^\((?:(\w[\w-]*):)?(.+)\)$/i,lL=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,uL=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,cL=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,dL=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,fL=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,hL=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,$i=e=>lL.test(e),vt=e=>!!e&&!Number.isNaN(Number(e)),Ts=e=>!!e&&Number.isInteger(Number(e)),S0=e=>e.endsWith("%")&&vt(e.slice(0,-1)),ri=e=>uL.test(e),p3=()=>!0,pL=e=>cL.test(e)&&!dL.test(e),R1=()=>!1,mL=e=>fL.test(e),gL=e=>hL.test(e),bL=e=>!Qe(e)&&!We(e),xL=e=>e.startsWith("@container")&&(e[10]==="/"&&e[11]!==void 0||e[11]==="s"&&e[16]!==void 0&&e.startsWith("-size/",10)||e[11]==="n"&&e[18]!==void 0&&e.startsWith("-normal/",10)),yL=e=>ua(e,b3,R1),Qe=e=>f3.test(e),ja=e=>ua(e,x3,pL),rS=e=>ua(e,NL,vt),EL=e=>ua(e,E3,p3),vL=e=>ua(e,y3,R1),sS=e=>ua(e,m3,R1),TL=e=>ua(e,g3,gL),Rf=e=>ua(e,v3,mL),We=e=>h3.test(e),Ju=e=>yo(e,x3),SL=e=>yo(e,y3),iS=e=>yo(e,m3),CL=e=>yo(e,b3),kL=e=>yo(e,g3),Of=e=>yo(e,v3,!0),wL=e=>yo(e,E3,!0),ua=(e,t,n)=>{const r=f3.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},yo=(e,t,n=!1)=>{const r=h3.exec(e);return r?r[1]?t(r[1]):n:!1},m3=e=>e==="position"||e==="percentage",g3=e=>e==="image"||e==="url",b3=e=>e==="length"||e==="size"||e==="bg-size",x3=e=>e==="length",NL=e=>e==="number",y3=e=>e==="family-name",E3=e=>e==="number"||e==="weight",v3=e=>e==="shadow",kb=()=>{const e=jn("color"),t=jn("font"),n=jn("text"),r=jn("font-weight"),i=jn("tracking"),a=jn("leading"),l=jn("breakpoint"),c=jn("container"),d=jn("spacing"),f=jn("radius"),g=jn("shadow"),h=jn("inset-shadow"),b=jn("text-shadow"),x=jn("drop-shadow"),v=jn("blur"),w=jn("perspective"),k=jn("aspect"),C=jn("ease"),N=jn("animate"),A=()=>["auto","avoid","all","avoid-page","page","left","right","column"],R=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],M=()=>[...R(),We,Qe],_=()=>["auto","hidden","clip","visible","scroll"],D=()=>["auto","contain","none"],I=()=>[We,Qe,d],U=()=>[$i,"full","auto",...I()],j=()=>[Ts,"none","subgrid",We,Qe],X=()=>["auto",{span:["full",Ts,We,Qe]},Ts,We,Qe],K=()=>[Ts,"auto",We,Qe],F=()=>["auto","min","max","fr",We,Qe],W=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],V=()=>["start","end","center","stretch","center-safe","end-safe"],H=()=>["auto",...I()],q=()=>[$i,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...I()],J=()=>[$i,"screen","full","dvw","lvw","svw","min","max","fit",...I()],ue=()=>[$i,"screen","full","lh","dvh","lvh","svh","min","max","fit",...I()],L=()=>[e,We,Qe],B=()=>[...R(),iS,sS,{position:[We,Qe]}],G=()=>["no-repeat",{repeat:["","x","y","space","round"]}],P=()=>["auto","cover","contain",CL,yL,{size:[We,Qe]}],ae=()=>[S0,Ju,ja],ie=()=>["","none","full",f,We,Qe],ce=()=>["",vt,Ju,ja],de=()=>["solid","dashed","dotted","double"],he=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],ve=()=>[vt,S0,iS,sS],Fe=()=>["","none",v,We,Qe],Le=()=>["none",vt,We,Qe],Ee=()=>["none",vt,We,Qe],Oe=()=>[vt,We,Qe],Ue=()=>[$i,"full",...I()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[ri],breakpoint:[ri],color:[p3],container:[ri],"drop-shadow":[ri],ease:["in","out","in-out"],font:[bL],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[ri],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[ri],shadow:[ri],spacing:["px",vt],text:[ri],"text-shadow":[ri],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",$i,Qe,We,k]}],container:["container"],"container-type":[{"@container":["","normal","size",We,Qe]}],"container-named":[xL],columns:[{columns:[vt,Qe,We,c]}],"break-after":[{"break-after":A()}],"break-before":[{"break-before":A()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:M()}],overflow:[{overflow:_()}],"overflow-x":[{"overflow-x":_()}],"overflow-y":[{"overflow-y":_()}],overscroll:[{overscroll:D()}],"overscroll-x":[{"overscroll-x":D()}],"overscroll-y":[{"overscroll-y":D()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:U()}],"inset-x":[{"inset-x":U()}],"inset-y":[{"inset-y":U()}],start:[{"inset-s":U(),start:U()}],end:[{"inset-e":U(),end:U()}],"inset-bs":[{"inset-bs":U()}],"inset-be":[{"inset-be":U()}],top:[{top:U()}],right:[{right:U()}],bottom:[{bottom:U()}],left:[{left:U()}],visibility:["visible","invisible","collapse"],z:[{z:[Ts,"auto",We,Qe]}],basis:[{basis:[$i,"full","auto",c,...I()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[vt,$i,"auto","initial","none",Qe]}],grow:[{grow:["",vt,We,Qe]}],shrink:[{shrink:["",vt,We,Qe]}],order:[{order:[Ts,"first","last","none",We,Qe]}],"grid-cols":[{"grid-cols":j()}],"col-start-end":[{col:X()}],"col-start":[{"col-start":K()}],"col-end":[{"col-end":K()}],"grid-rows":[{"grid-rows":j()}],"row-start-end":[{row:X()}],"row-start":[{"row-start":K()}],"row-end":[{"row-end":K()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":F()}],"auto-rows":[{"auto-rows":F()}],gap:[{gap:I()}],"gap-x":[{"gap-x":I()}],"gap-y":[{"gap-y":I()}],"justify-content":[{justify:[...W(),"normal"]}],"justify-items":[{"justify-items":[...V(),"normal"]}],"justify-self":[{"justify-self":["auto",...V()]}],"align-content":[{content:["normal",...W()]}],"align-items":[{items:[...V(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...V(),{baseline:["","last"]}]}],"place-content":[{"place-content":W()}],"place-items":[{"place-items":[...V(),"baseline"]}],"place-self":[{"place-self":["auto",...V()]}],p:[{p:I()}],px:[{px:I()}],py:[{py:I()}],ps:[{ps:I()}],pe:[{pe:I()}],pbs:[{pbs:I()}],pbe:[{pbe:I()}],pt:[{pt:I()}],pr:[{pr:I()}],pb:[{pb:I()}],pl:[{pl:I()}],m:[{m:H()}],mx:[{mx:H()}],my:[{my:H()}],ms:[{ms:H()}],me:[{me:H()}],mbs:[{mbs:H()}],mbe:[{mbe:H()}],mt:[{mt:H()}],mr:[{mr:H()}],mb:[{mb:H()}],ml:[{ml:H()}],"space-x":[{"space-x":I()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":I()}],"space-y-reverse":["space-y-reverse"],size:[{size:q()}],"inline-size":[{inline:["auto",...J()]}],"min-inline-size":[{"min-inline":["auto",...J()]}],"max-inline-size":[{"max-inline":["none",...J()]}],"block-size":[{block:["auto",...ue()]}],"min-block-size":[{"min-block":["auto",...ue()]}],"max-block-size":[{"max-block":["none",...ue()]}],w:[{w:[c,"screen",...q()]}],"min-w":[{"min-w":[c,"screen","none",...q()]}],"max-w":[{"max-w":[c,"screen","none","prose",{screen:[l]},...q()]}],h:[{h:["screen","lh",...q()]}],"min-h":[{"min-h":["screen","lh","none",...q()]}],"max-h":[{"max-h":["screen","lh",...q()]}],"font-size":[{text:["base",n,Ju,ja]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,wL,EL]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",S0,Qe]}],"font-family":[{font:[SL,vL,t]}],"font-features":[{"font-features":[Qe]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[i,We,Qe]}],"line-clamp":[{"line-clamp":[vt,"none",We,rS]}],leading:[{leading:[a,...I()]}],"list-image":[{"list-image":["none",We,Qe]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",We,Qe]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:L()}],"text-color":[{text:L()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...de(),"wavy"]}],"text-decoration-thickness":[{decoration:[vt,"from-font","auto",We,ja]}],"text-decoration-color":[{decoration:L()}],"underline-offset":[{"underline-offset":[vt,"auto",We,Qe]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:I()}],"tab-size":[{tab:[Ts,We,Qe]}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",We,Qe]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",We,Qe]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:B()}],"bg-repeat":[{bg:G()}],"bg-size":[{bg:P()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Ts,We,Qe],radial:["",We,Qe],conic:[Ts,We,Qe]},kL,TL]}],"bg-color":[{bg:L()}],"gradient-from-pos":[{from:ae()}],"gradient-via-pos":[{via:ae()}],"gradient-to-pos":[{to:ae()}],"gradient-from":[{from:L()}],"gradient-via":[{via:L()}],"gradient-to":[{to:L()}],rounded:[{rounded:ie()}],"rounded-s":[{"rounded-s":ie()}],"rounded-e":[{"rounded-e":ie()}],"rounded-t":[{"rounded-t":ie()}],"rounded-r":[{"rounded-r":ie()}],"rounded-b":[{"rounded-b":ie()}],"rounded-l":[{"rounded-l":ie()}],"rounded-ss":[{"rounded-ss":ie()}],"rounded-se":[{"rounded-se":ie()}],"rounded-ee":[{"rounded-ee":ie()}],"rounded-es":[{"rounded-es":ie()}],"rounded-tl":[{"rounded-tl":ie()}],"rounded-tr":[{"rounded-tr":ie()}],"rounded-br":[{"rounded-br":ie()}],"rounded-bl":[{"rounded-bl":ie()}],"border-w":[{border:ce()}],"border-w-x":[{"border-x":ce()}],"border-w-y":[{"border-y":ce()}],"border-w-s":[{"border-s":ce()}],"border-w-e":[{"border-e":ce()}],"border-w-bs":[{"border-bs":ce()}],"border-w-be":[{"border-be":ce()}],"border-w-t":[{"border-t":ce()}],"border-w-r":[{"border-r":ce()}],"border-w-b":[{"border-b":ce()}],"border-w-l":[{"border-l":ce()}],"divide-x":[{"divide-x":ce()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":ce()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...de(),"hidden","none"]}],"divide-style":[{divide:[...de(),"hidden","none"]}],"border-color":[{border:L()}],"border-color-x":[{"border-x":L()}],"border-color-y":[{"border-y":L()}],"border-color-s":[{"border-s":L()}],"border-color-e":[{"border-e":L()}],"border-color-bs":[{"border-bs":L()}],"border-color-be":[{"border-be":L()}],"border-color-t":[{"border-t":L()}],"border-color-r":[{"border-r":L()}],"border-color-b":[{"border-b":L()}],"border-color-l":[{"border-l":L()}],"divide-color":[{divide:L()}],"outline-style":[{outline:[...de(),"none","hidden"]}],"outline-offset":[{"outline-offset":[vt,We,Qe]}],"outline-w":[{outline:["",vt,Ju,ja]}],"outline-color":[{outline:L()}],shadow:[{shadow:["","none",g,Of,Rf]}],"shadow-color":[{shadow:L()}],"inset-shadow":[{"inset-shadow":["none",h,Of,Rf]}],"inset-shadow-color":[{"inset-shadow":L()}],"ring-w":[{ring:ce()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:L()}],"ring-offset-w":[{"ring-offset":[vt,ja]}],"ring-offset-color":[{"ring-offset":L()}],"inset-ring-w":[{"inset-ring":ce()}],"inset-ring-color":[{"inset-ring":L()}],"text-shadow":[{"text-shadow":["none",b,Of,Rf]}],"text-shadow-color":[{"text-shadow":L()}],opacity:[{opacity:[vt,We,Qe]}],"mix-blend":[{"mix-blend":[...he(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":he()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[vt]}],"mask-image-linear-from-pos":[{"mask-linear-from":ve()}],"mask-image-linear-to-pos":[{"mask-linear-to":ve()}],"mask-image-linear-from-color":[{"mask-linear-from":L()}],"mask-image-linear-to-color":[{"mask-linear-to":L()}],"mask-image-t-from-pos":[{"mask-t-from":ve()}],"mask-image-t-to-pos":[{"mask-t-to":ve()}],"mask-image-t-from-color":[{"mask-t-from":L()}],"mask-image-t-to-color":[{"mask-t-to":L()}],"mask-image-r-from-pos":[{"mask-r-from":ve()}],"mask-image-r-to-pos":[{"mask-r-to":ve()}],"mask-image-r-from-color":[{"mask-r-from":L()}],"mask-image-r-to-color":[{"mask-r-to":L()}],"mask-image-b-from-pos":[{"mask-b-from":ve()}],"mask-image-b-to-pos":[{"mask-b-to":ve()}],"mask-image-b-from-color":[{"mask-b-from":L()}],"mask-image-b-to-color":[{"mask-b-to":L()}],"mask-image-l-from-pos":[{"mask-l-from":ve()}],"mask-image-l-to-pos":[{"mask-l-to":ve()}],"mask-image-l-from-color":[{"mask-l-from":L()}],"mask-image-l-to-color":[{"mask-l-to":L()}],"mask-image-x-from-pos":[{"mask-x-from":ve()}],"mask-image-x-to-pos":[{"mask-x-to":ve()}],"mask-image-x-from-color":[{"mask-x-from":L()}],"mask-image-x-to-color":[{"mask-x-to":L()}],"mask-image-y-from-pos":[{"mask-y-from":ve()}],"mask-image-y-to-pos":[{"mask-y-to":ve()}],"mask-image-y-from-color":[{"mask-y-from":L()}],"mask-image-y-to-color":[{"mask-y-to":L()}],"mask-image-radial":[{"mask-radial":[We,Qe]}],"mask-image-radial-from-pos":[{"mask-radial-from":ve()}],"mask-image-radial-to-pos":[{"mask-radial-to":ve()}],"mask-image-radial-from-color":[{"mask-radial-from":L()}],"mask-image-radial-to-color":[{"mask-radial-to":L()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":R()}],"mask-image-conic-pos":[{"mask-conic":[vt]}],"mask-image-conic-from-pos":[{"mask-conic-from":ve()}],"mask-image-conic-to-pos":[{"mask-conic-to":ve()}],"mask-image-conic-from-color":[{"mask-conic-from":L()}],"mask-image-conic-to-color":[{"mask-conic-to":L()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:B()}],"mask-repeat":[{mask:G()}],"mask-size":[{mask:P()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",We,Qe]}],filter:[{filter:["","none",We,Qe]}],blur:[{blur:Fe()}],brightness:[{brightness:[vt,We,Qe]}],contrast:[{contrast:[vt,We,Qe]}],"drop-shadow":[{"drop-shadow":["","none",x,Of,Rf]}],"drop-shadow-color":[{"drop-shadow":L()}],grayscale:[{grayscale:["",vt,We,Qe]}],"hue-rotate":[{"hue-rotate":[vt,We,Qe]}],invert:[{invert:["",vt,We,Qe]}],saturate:[{saturate:[vt,We,Qe]}],sepia:[{sepia:["",vt,We,Qe]}],"backdrop-filter":[{"backdrop-filter":["","none",We,Qe]}],"backdrop-blur":[{"backdrop-blur":Fe()}],"backdrop-brightness":[{"backdrop-brightness":[vt,We,Qe]}],"backdrop-contrast":[{"backdrop-contrast":[vt,We,Qe]}],"backdrop-grayscale":[{"backdrop-grayscale":["",vt,We,Qe]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[vt,We,Qe]}],"backdrop-invert":[{"backdrop-invert":["",vt,We,Qe]}],"backdrop-opacity":[{"backdrop-opacity":[vt,We,Qe]}],"backdrop-saturate":[{"backdrop-saturate":[vt,We,Qe]}],"backdrop-sepia":[{"backdrop-sepia":["",vt,We,Qe]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":I()}],"border-spacing-x":[{"border-spacing-x":I()}],"border-spacing-y":[{"border-spacing-y":I()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",We,Qe]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[vt,"initial",We,Qe]}],ease:[{ease:["linear","initial",C,We,Qe]}],delay:[{delay:[vt,We,Qe]}],animate:[{animate:["none",N,We,Qe]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[w,We,Qe]}],"perspective-origin":[{"perspective-origin":M()}],rotate:[{rotate:Le()}],"rotate-x":[{"rotate-x":Le()}],"rotate-y":[{"rotate-y":Le()}],"rotate-z":[{"rotate-z":Le()}],scale:[{scale:Ee()}],"scale-x":[{"scale-x":Ee()}],"scale-y":[{"scale-y":Ee()}],"scale-z":[{"scale-z":Ee()}],"scale-3d":["scale-3d"],skew:[{skew:Oe()}],"skew-x":[{"skew-x":Oe()}],"skew-y":[{"skew-y":Oe()}],transform:[{transform:[We,Qe,"","none","gpu","cpu"]}],"transform-origin":[{origin:M()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:Ue()}],"translate-x":[{"translate-x":Ue()}],"translate-y":[{"translate-y":Ue()}],"translate-z":[{"translate-z":Ue()}],"translate-none":["translate-none"],zoom:[{zoom:[Ts,We,Qe]}],accent:[{accent:L()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:L()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",We,Qe]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scrollbar-thumb-color":[{"scrollbar-thumb":L()}],"scrollbar-track-color":[{"scrollbar-track":L()}],"scrollbar-gutter":[{"scrollbar-gutter":["auto","stable","both"]}],"scrollbar-w":[{scrollbar:["auto","thin","none"]}],"scroll-m":[{"scroll-m":I()}],"scroll-mx":[{"scroll-mx":I()}],"scroll-my":[{"scroll-my":I()}],"scroll-ms":[{"scroll-ms":I()}],"scroll-me":[{"scroll-me":I()}],"scroll-mbs":[{"scroll-mbs":I()}],"scroll-mbe":[{"scroll-mbe":I()}],"scroll-mt":[{"scroll-mt":I()}],"scroll-mr":[{"scroll-mr":I()}],"scroll-mb":[{"scroll-mb":I()}],"scroll-ml":[{"scroll-ml":I()}],"scroll-p":[{"scroll-p":I()}],"scroll-px":[{"scroll-px":I()}],"scroll-py":[{"scroll-py":I()}],"scroll-ps":[{"scroll-ps":I()}],"scroll-pe":[{"scroll-pe":I()}],"scroll-pbs":[{"scroll-pbs":I()}],"scroll-pbe":[{"scroll-pbe":I()}],"scroll-pt":[{"scroll-pt":I()}],"scroll-pr":[{"scroll-pr":I()}],"scroll-pb":[{"scroll-pb":I()}],"scroll-pl":[{"scroll-pl":I()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",We,Qe]}],fill:[{fill:["none",...L()]}],"stroke-w":[{stroke:[vt,Ju,ja,rS]}],stroke:[{stroke:["none",...L()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{"container-named":["container-type"],overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pbs","pbe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mbs","mbe","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-bs","border-w-be","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-bs","border-color-be","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mbs","scroll-mbe","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pbs","scroll-pbe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},postfixLookupClassGroups:["container-type"],orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},AL=(e,{cacheSize:t,prefix:n,experimentalParseClassName:r,extend:i={},override:a={}})=>(bl(e,"cacheSize",t),bl(e,"prefix",n),bl(e,"experimentalParseClassName",r),If(e.theme,a.theme),If(e.classGroups,a.classGroups),If(e.conflictingClassGroups,a.conflictingClassGroups),If(e.conflictingClassGroupModifiers,a.conflictingClassGroupModifiers),bl(e,"postfixLookupClassGroups",a.postfixLookupClassGroups),bl(e,"orderSensitiveModifiers",a.orderSensitiveModifiers),Mf(e.theme,i.theme),Mf(e.classGroups,i.classGroups),Mf(e.conflictingClassGroups,i.conflictingClassGroups),Mf(e.conflictingClassGroupModifiers,i.conflictingClassGroupModifiers),wb(e,i,"postfixLookupClassGroups"),wb(e,i,"orderSensitiveModifiers"),e),bl=(e,t,n)=>{n!==void 0&&(e[t]=n)},If=(e,t)=>{if(t)for(const n in t)bl(e,n,t[n])},Mf=(e,t)=>{if(t)for(const n in t)wb(e,t,n)},wb=(e,t,n)=>{const r=t[n];r!==void 0&&(e[n]=e[n]?e[n].concat(r):r)},_L=(e,...t)=>typeof e=="function"?Cb(kb,e,...t):Cb(()=>AL(kb(),e),...t),T3=Cb(kb),RL=_L({extend:{classGroups:{"font-size":[{text:["display-xl","display-lg","display-md","display-sm","heading-1","heading-2","heading-3","body","body-sm","label","code"]}]}}});function Ie(...e){return RL(ap(e))}const OL=o3("group/button inline-flex shrink-0 items-center justify-center rounded-md border border-transparent bg-clip-padding text-sm font-medium whitespace-nowrap transition-colors outline-none select-none focus-visible:ring-2 focus-visible:ring-ring/60 focus-visible:ring-offset-1 focus-visible:ring-offset-bg disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-accent-hover",outline:"border-border bg-surface hover:border-border-strong hover:bg-surface-hover",secondary:"bg-secondary text-secondary-foreground hover:bg-surface-hover",ghost:"text-fg-2 hover:bg-surface-hover hover:text-foreground",destructive:"text-danger hover:bg-danger-bg",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-8 gap-1.5 px-3",xs:"h-6 gap-1 px-2 text-xs [&_svg:not([class*='size-'])]:size-3",sm:"h-7 gap-1 px-2.5 text-xs",lg:"h-9 gap-1.5 px-3.5",icon:"size-8","icon-sm":"size-7"}},defaultVariants:{variant:"default",size:"default"}}),at=E.forwardRef(({className:e,variant:t="default",size:n="default",type:r="button",...i},a)=>m.jsx("button",{ref:a,type:r,"data-slot":"button",className:Ie(OL({variant:t,size:n,className:e})),...i}));at.displayName="Button";const IL=o3("inline-flex items-center gap-1.5 rounded-full border px-2 py-0.5 text-label font-medium whitespace-nowrap",{variants:{variant:{neutral:"border-border bg-surface text-fg-2",accent:"border-transparent bg-accent-bg text-fg-1",success:"border-transparent bg-success-bg text-success",warning:"border-transparent bg-warning-bg text-warning",danger:"border-transparent bg-danger-bg text-danger",info:"border-transparent bg-info-bg text-info"},mono:{true:"font-mono text-code",false:""}},defaultVariants:{variant:"neutral",mono:!1}});function gn({className:e,variant:t="neutral",mono:n,dot:r,children:i,...a}){return m.jsxs("span",{"data-slot":"badge",className:Ie(IL({variant:t,mono:n,className:e})),...a,children:[r?m.jsx("span",{"aria-hidden":!0,className:"size-1.5 rounded-full bg-current"}):null,i]})}function Os({className:e,...t}){return m.jsx("div",{"data-slot":"card",className:Ie("rounded-lg border border-border bg-surface",e),...t})}function Is({className:e,...t}){return m.jsx("div",{className:Ie("flex items-start justify-between gap-3 px-4 pt-3.5 pb-3",e),...t})}function Ms({className:e,...t}){return m.jsx("h3",{className:Ie("text-heading-3 font-semibold text-text",e),...t})}function Ls({className:e,...t}){return m.jsx("div",{className:Ie("px-4 pb-4",e),...t})}const un=E.forwardRef(({className:e,...t},n)=>m.jsx("input",{ref:n,"data-slot":"input",className:Ie("h-8 w-full rounded-md border border-border bg-bg px-2.5 text-body-sm text-text","placeholder:text-fg-4 transition-colors outline-none","hover:border-border-strong focus-visible:border-ring focus-visible:ring-2 focus-visible:ring-ring/40","disabled:pointer-events-none disabled:opacity-50",e),...t}));un.displayName="Input";const O1=E.forwardRef(({className:e,...t},n)=>m.jsx("textarea",{ref:n,"data-slot":"textarea",className:Ie("w-full resize-none rounded-md border border-border bg-bg px-2.5 py-2 text-body-sm text-text","placeholder:text-fg-4 transition-colors outline-none","hover:border-border-strong focus-visible:border-ring focus-visible:ring-2 focus-visible:ring-ring/40","disabled:pointer-events-none disabled:opacity-50",e),...t}));O1.displayName="Textarea";const S3={clipPath:"inset(50%)",overflow:"hidden",whiteSpace:"nowrap",border:0,padding:0,width:1,height:1,margin:-1},C3={...S3,position:"fixed",top:0,left:0},ML={...S3,position:"absolute"},aS={};function xr(e,t){const n=E.useRef(aS);return n.current===aS&&(n.current=e(t)),n}function ro(e,t,n,r){const i=xr(k3).current;return DL(i,e,t,n,r)&&w3(i,[e,t,n,r]),i.callback}function LL(e){const t=xr(k3).current;return PL(t,e)&&w3(t,e),t.callback}function k3(){return{callback:null,cleanup:null,refs:[]}}function DL(e,t,n,r,i){return e.refs[0]!==t||e.refs[1]!==n||e.refs[2]!==r||e.refs[3]!==i}function PL(e,t){return e.refs.length!==t.length||e.refs.some((n,r)=>n!==t[r])}function w3(e,t){if(e.refs=t,t.every(n=>n==null)){e.callback=null;return}e.callback=n=>{if(e.cleanup&&(e.cleanup(),e.cleanup=null),n!=null){const r=Array(t.length).fill(null);for(let i=0;i<t.length;i+=1){const a=t[i];if(a!=null)switch(typeof a){case"function":{const l=a(n);typeof l=="function"&&(r[i]=l);break}case"object":{a.current=n;break}}}e.cleanup=()=>{for(let i=0;i<t.length;i+=1){const a=t[i];if(a!=null)switch(typeof a){case"function":{const l=r[i];typeof l=="function"?l():a(null);break}case"object":{a.current=null;break}}}}}}}function I1(e){const t=E.useRef(!0);t.current&&(t.current=!1,e())}function jL(e){const[t,n]=E.useState({current:e,previous:null});return e!==t.current&&n({current:e,previous:t.current}),t.previous}function BL(e){return e==null||e.hasAttribute("disabled")||e.getAttribute("aria-disabled")==="true"}function oS({controlled:e,default:t,name:n,state:r="value"}){const{current:i}=E.useRef(e!==void 0),[a,l]=E.useState(t),c=i?e:a,d=E.useCallback(f=>{i||l(f)},[]);return[c,d]}const HL=()=>{},Ye=typeof document<"u"?E.useLayoutEffect:HL,M1={...UI},C0=M1.useInsertionEffect,UL=C0&&C0!==M1.useLayoutEffect?C0:e=>e();function tt(e){const t=xr(zL).current;return t.next=e,UL(t.effect),t.trampoline}function zL(){const e={next:void 0,callback:FL,trampoline:(...t)=>e.callback?.(...t),effect:()=>{e.callback=e.next}};return e}function FL(){}function En(e){const t=xr($L,e).current;return t.next=e,Ye(t.effect),t}function $L(e){const t={current:e,next:e,effect:()=>{t.current=t.next}};return t}function VL(e,t){return function(r,...i){const a=new URL(e);return a.searchParams.set("code",r.toString()),i.forEach(l=>a.searchParams.append("args[]",l)),`${t} error #${r}; visit ${a} for the full message.`}}const Ln=VL("https://base-ui.com/production-error","Base UI"),Be=(e,t,n,r,i,a,...l)=>{if(l.length>0)throw new Error(Ln(1));let c;if(e)c=e;else throw new Error("Missing arguments");return c};var N3=Qw();const qL=parseInt(E.version,10);function L1(e){return qL>=e}const Nb=[];let Ab;function YL(){return Ab}function GL(e){Nb.push(e)}function D1(e){const t=(n,r)=>{const i=xr(XL).current;let a;try{Ab=i;for(const l of Nb)l.before(i);a=e(n,r);for(const l of Nb)l.after(i);i.didInitialize=!0}finally{Ab=void 0}return a};return t.displayName=e.displayName||e.name,t}function A3(e){return E.forwardRef(D1(e))}function XL(){return{didInitialize:!1}}const KL=L1(19),QL=KL?ZL:JL;function ft(e,t,n,r,i){return QL(e,t,n,r,i)}function WL(e,t,n,r,i){const a=E.useCallback(()=>t(e.getSnapshot(),n,r,i),[e,t,n,r,i]);return N3.useSyncExternalStore(e.subscribe,a,a)}GL({before(e){e.syncIndex=0,e.didInitialize||(e.syncTick=1,e.syncHooks=[],e.didChangeStore=!0,e.getSnapshot=()=>{let t=!1;for(let n=0;n<e.syncHooks.length;n+=1){const r=e.syncHooks[n],i=r.selector(r.store.state,r.a1,r.a2,r.a3);Object.is(r.value,i)||(t=!0,r.value=i)}return t&&(e.syncTick+=1),e.syncTick})},after(e){e.syncHooks.length>0&&(e.didChangeStore&&(e.didChangeStore=!1,e.subscribe=t=>{const n=new Set;for(const i of e.syncHooks)n.add(i.store);const r=[];for(const i of n)r.push(i.subscribe(t));return()=>{for(const i of r)i()}}),N3.useSyncExternalStore(e.subscribe,e.getSnapshot,e.getSnapshot))}});function ZL(e,t,n,r,i){const a=YL();if(!a)return WL(e,t,n,r,i);const l=a.syncIndex;a.syncIndex+=1;let c;return a.didInitialize?(c=a.syncHooks[l],(c.store!==e||c.selector!==t||!Object.is(c.a1,n)||!Object.is(c.a2,r)||!Object.is(c.a3,i))&&(c.store!==e&&(a.didChangeStore=!0),c.store=e,c.selector=t,c.a1=n,c.a2=r,c.a3=i,c.value=t(e.getSnapshot(),n,r,i))):(c={store:e,selector:t,a1:n,a2:r,a3:i,value:t(e.getSnapshot(),n,r,i)},a.syncHooks.push(c)),c.value}function JL(e,t,n,r,i){return Ww.useSyncExternalStoreWithSelector(e.subscribe,e.getSnapshot,e.getSnapshot,a=>t(a,n,r,i))}class _3{constructor(t){this.state=t,this.listeners=new Set,this.updateTick=0}subscribe=t=>(this.listeners.add(t),()=>{this.listeners.delete(t)});getSnapshot=()=>this.state;setState(t){if(this.state===t)return;this.state=t,this.updateTick+=1;const n=this.updateTick;for(const r of this.listeners){if(n!==this.updateTick)return;r(t)}}update(t){for(const n in t)if(!Object.is(this.state[n],t[n])){this.setState({...this.state,...t});return}}set(t,n){Object.is(this.state[t],n)||this.setState({...this.state,[t]:n})}notifyAll(){const t={...this.state};this.setState(t)}use(t,n,r,i){return ft(this,t,n,r,i)}}function Vn(){}const _l=Object.freeze([]),dn=Object.freeze({});class op extends _3{constructor(t,n={},r){super(t),this.context=n,this.selectors=r}useSyncedValue(t,n){E.useDebugValue(t);const r=this;Ye(()=>{r.state[t]!==n&&r.set(t,n)},[r,t,n])}useSyncedValueWithCleanup(t,n){const r=this;Ye(()=>(r.state[t]!==n&&r.set(t,n),()=>{r.set(t,void 0)}),[r,t,n])}useSyncedValues(t){const n=this,r=Object.values(t);Ye(()=>{n.update(t)},[n,...r])}useControlledProp(t,n){E.useDebugValue(t);const r=this,i=n!==void 0;Ye(()=>{i&&!Object.is(r.state[t],n)&&r.setState({...r.state,[t]:n})},[r,t,n,i])}select(t,n,r,i){const a=this.selectors[t];return a(this.state,n,r,i)}useState(t,n,r,i){return E.useDebugValue(t),ft(this,this.selectors[t],n,r,i)}useContextCallback(t,n){E.useDebugValue(t);const r=tt(n??Vn);this.context[t]=r}useStateSetter(t){const n=E.useRef(void 0);return n.current===void 0&&(n.current=r=>{this.set(t,r)}),n.current}observe(t,n){let r;typeof t=="function"?r=t:r=this.selectors[t];let i=r(this.state);return n(i,i,this),this.subscribe(a=>{const l=r(a);if(!Object.is(i,l)){const c=i;i=l,n(l,c,this)}})}}function lp(){return typeof window<"u"}function nr(e){return P1(e)?(e.nodeName||"").toLowerCase():"#document"}function sn(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function bi(e){var t;return(t=(P1(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function P1(e){return lp()?e instanceof Node||e instanceof sn(e).Node:!1}function St(e){return lp()?e instanceof Element||e instanceof sn(e).Element:!1}function cn(e){return lp()?e instanceof HTMLElement||e instanceof sn(e).HTMLElement:!1}function Rl(e){return!lp()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof sn(e).ShadowRoot}function Eo(e){const{overflow:t,overflowX:n,overflowY:r,display:i}=Vr(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!=="inline"&&i!=="contents"}function eD(e){return/^(table|td|th)$/.test(nr(e))}function up(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}const tD=/transform|translate|scale|rotate|perspective|filter/,nD=/paint|layout|strict|content/,Ba=e=>!!e&&e!=="none";let k0;function j1(e){const t=St(e)?Vr(e):e;return Ba(t.transform)||Ba(t.translate)||Ba(t.scale)||Ba(t.rotate)||Ba(t.perspective)||!B1()&&(Ba(t.backdropFilter)||Ba(t.filter))||tD.test(t.willChange||"")||nD.test(t.contain||"")}function rD(e){let t=hi(e);for(;cn(t)&&!ci(t);){if(j1(t))return t;if(up(t))return null;t=hi(t)}return null}function B1(){return k0==null&&(k0=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),k0}function ci(e){return/^(html|body|#document)$/.test(nr(e))}function Vr(e){return sn(e).getComputedStyle(e)}function cp(e){return St(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function hi(e){if(nr(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Rl(e)&&e.host||bi(e);return Rl(t)?t.host:t}function R3(e){const t=hi(e);return ci(t)?(e.ownerDocument||e).body:cn(t)&&Eo(t)?t:R3(t)}function Hc(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const i=R3(e),a=i===((r=e.ownerDocument)==null?void 0:r.body),l=sn(i);if(a){const c=_b(l);return t.concat(l,l.visualViewport||[],Eo(i)?i:[],c&&n?Hc(c):[])}else return t.concat(i,Hc(i,[],n))}function _b(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Ds(...e){return()=>{for(let t=0;t<e.length;t+=1){const n=e[t];n&&n()}}}function At(e){return e?.ownerDocument||document}function Tt(e,t,n,r){return e.addEventListener(t,n,r),()=>{e.removeEventListener(t,n,r)}}const sD=[];function H1(e){E.useEffect(e,sD)}const Lf=null;class iD{callbacks=[];callbacksCount=0;nextId=1;startId=1;isScheduled=!1;tick=t=>{this.isScheduled=!1;const n=this.callbacks,r=this.callbacksCount;if(this.callbacks=[],this.callbacksCount=0,this.startId=this.nextId,r>0)for(let i=0;i<n.length;i+=1)n[i]?.(t)};request(t){const n=this.nextId;return this.nextId+=1,this.callbacks.push(t),this.callbacksCount+=1,(!this.isScheduled||!1)&&(requestAnimationFrame(this.tick),this.isScheduled=!0),n}cancel(t){const n=t-this.startId;n<0||n>=this.callbacks.length||(this.callbacks[n]=null,this.callbacksCount-=1)}}const Df=new iD;class As{static create(){return new As}static request(t){return Df.request(t)}static cancel(t){return Df.cancel(t)}currentId=Lf;request(t){this.cancel(),this.currentId=Df.request(()=>{this.currentId=Lf,t()})}cancel=()=>{this.currentId!==Lf&&(Df.cancel(this.currentId),this.currentId=Lf)};disposeEffect=()=>this.cancel}function Ol(){const e=xr(As.create).current;return H1(e.disposeEffect),e}const ec=0;class ps{static create(){return new ps}currentId=ec;start(t,n){this.clear(),this.currentId=setTimeout(()=>{this.currentId=ec,n()},t)}isStarted(){return this.currentId!==ec}clear=()=>{this.currentId!==ec&&(clearTimeout(this.currentId),this.currentId=ec)};disposeEffect=()=>this.clear}function Gn(){const e=xr(ps.create).current;return H1(e.disposeEffect),e}function aD(){return typeof navigator>"u"?{userAgent:"",platform:"",maxTouchPoints:0}:{userAgent:navigator.userAgent,platform:navigator.platform??"",maxTouchPoints:navigator.maxTouchPoints??0}}const{userAgent:oD,platform:lD,maxTouchPoints:uD}=aD(),dp=oD.toLowerCase(),Uc=lD.toLowerCase(),fp=/^i(os$|p)/.test(Uc)||Uc==="macintel"&&uD>1,lS="android",Rb=Uc===lS||dp.includes(lS),U1=!fp&&Uc.startsWith("mac");Uc.startsWith("win");const cD=U1||fp,ca=typeof CSS<"u"&&!!CSS.supports?.("-webkit-backdrop-filter:none");!ca&&dp.includes("firefox");!ca&&dp.includes("chrom");const dD=cD,z1=/jsdom|happydom/.test(dp);function Ns(e){e.preventDefault(),e.stopPropagation()}function fD(e){return"nativeEvent"in e}function F1(e){return e.pointerType===""&&e.isTrusted?!0:Rb&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}function O3(e){return z1?!1:!Rb&&e.width===0&&e.height===0||Rb&&e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType==="mouse"||e.width<1&&e.height<1&&e.pressure===0&&e.detail===0&&e.pointerType==="touch"}function so(e,t){const n=["mouse","pen"];return t||n.push("",void 0),n.includes(e)}function hD(e){const t=e.type;return t==="click"||t==="mousedown"||t==="keydown"||t==="keyup"}const Ob="data-base-ui-focusable",I3="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])",hp="ArrowLeft",pp="ArrowRight",M3="ArrowUp",$1="ArrowDown";function Rr(e){let t=e.activeElement;for(;t?.shadowRoot?.activeElement!=null;)t=t.shadowRoot.activeElement;return t}function nt(e,t){if(!e||!t)return!1;const n=t.getRootNode?.();if(e.contains(t))return!0;if(n&&Rl(n)){let r=t;for(;r;){if(e===r)return!0;r=r.parentNode||r.host}}return!1}function mr(e){return"composedPath"in e?e.composedPath()[0]:e.target}function Ah(e,t){if(!St(e))return!1;const n=e;if(t.hasElement(n))return!n.hasAttribute("data-trigger-disabled");for(const[,r]of t.entries())if(nt(r,n))return!r.hasAttribute("data-trigger-disabled");return!1}function w0(e,t){if(t==null)return!1;if("composedPath"in e)return e.composedPath().includes(t);const n=e;return n.target!=null&&t.contains(n.target)}function pD(e){return e.matches("html,body")}function mp(e){return cn(e)&&e.matches(I3)}function mD(e){return e?.closest(`button,a[href],[role="button"],select,[tabindex]:not([tabindex="-1"]),${I3}`)!=null}function Ib(e){return e?e.getAttribute("role")==="combobox"&&mp(e):!1}function gD(e){if(!e||z1)return!0;try{return e.matches(":focus-visible")}catch{return!0}}function _h(e){return e?e.hasAttribute(Ob)?e:e.querySelector(`[${Ob}]`)||e:null}function bD(e,t){return t!=null&&!so(t)?0:typeof e=="function"?e():e}function Il(e,t,n){const r=bD(e,n);return typeof r=="number"?r:r?.[t]}function uS(e){return typeof e=="function"?e():e}function L3(e,t){return t||e==="click"||e==="mousedown"}function xD(e){return e?.includes("mouse")&&e!=="mousedown"}const Fl="none",$l="trigger-press",qn="trigger-hover",Sl="trigger-focus",gp="outside-press",vc="item-press",yD="close-press",io="focus-out",bp="escape-key",Mb="list-navigation",D3="cancel-open",fc="sibling-open",ED="disabled",V1="imperative-action",vD="window-resize";function pt(e,t,n,r){let i=!1,a=!1;const l=dn;return{reason:e,event:t??new Event("base-ui"),cancel(){i=!0},allowPropagation(){a=!0},get isCanceled(){return i},get isPropagationAllowed(){return a},trigger:n,...l}}const P3=E.createContext({hasProvider:!1,timeoutMs:0,delayRef:{current:0},initialDelayRef:{current:0},timeout:new ps,currentIdRef:{current:null},currentContextRef:{current:null}});function TD(e,t){e.current=t.current}function SD(e){const{children:t,delay:n,timeoutMs:r=0}=e,i=E.useRef(n),a=E.useRef(n),l=E.useRef(null),c=E.useRef(null),d=Gn();return Ye(()=>{if(a.current=n,!l.current){i.current=n;return}i.current={open:Il(i.current,"open"),close:Il(n,"close")}},[n,l,i,a]),m.jsx(P3.Provider,{value:E.useMemo(()=>({hasProvider:!0,delayRef:i,initialDelayRef:a,currentIdRef:l,timeoutMs:r,currentContextRef:c,timeout:d}),[r,d]),children:t})}function CD(e,t={open:!1}){const{open:n}=t,r="rootStore"in e?e.rootStore:e,i=r.useState("floatingId"),a=E.useContext(P3),{currentIdRef:l,delayRef:c,timeoutMs:d,initialDelayRef:f,currentContextRef:g,hasProvider:h,timeout:b}=a,[x,v]=E.useState(!1),w=E.useRef(n),k=E.useRef(!1);return Ye(()=>{w.current=n},[n]),Ye(()=>()=>{k.current=!0},[]),Ye(()=>{function C(){k.current||v(!1),g.current?.setIsInstantPhase(!1),l.current=null,g.current=null,c.current=f.current,b.clear()}if(l.current&&!n&&l.current===i){if(v(!1),d){const N=i;return b.start(d,()=>{r.select("open")||l.current&&l.current!==N||C()}),()=>{(w.current||l.current!==N)&&b.clear()}}C()}},[n,i,l,c,d,f,g,b,r]),Ye(()=>{if(!n)return;const C=g.current,N=l.current;b.clear(),g.current={onOpenChange:r.setOpen,setIsInstantPhase:v},l.current=i,c.current={open:0,close:Il(f.current,"close")},N!==null&&N!==i?(v(!0),C?.setIsInstantPhase(!0),C?.onOpenChange(!1,pt(Fl))):(v(!1),C?.setIsInstantPhase(!1))},[n,i,r,l,c,f,g,b]),Ye(()=>()=>{if(l.current===i){if(g.current=null,!w.current)return;l.current=null,TD(c,f),b.clear()}},[g,l,c,i,f,b]),E.useMemo(()=>({hasProvider:h,delayRef:c,isInstantPhase:x}),[h,c,x])}const Ml=E.forwardRef(function(t,n){const[r,i]=E.useState();Ye(()=>{dD&&ca&&i("button")},[]);const a={tabIndex:0,role:r};return m.jsx("span",{...t,ref:n,style:C3,"aria-hidden":r?void 0:!0,...a,"data-base-ui-focus-guard":""})}),kD=["top","right","bottom","left"],Ll=Math.min,di=Math.max,Rh=Math.round,Pf=Math.floor,fi=e=>({x:e,y:e}),wD={left:"right",right:"left",bottom:"top",top:"bottom"};function j3(e,t,n){return di(e,Ll(t,n))}function pi(e,t){return typeof e=="function"?e(t):e}function Fr(e){return e.split("-")[0]}function da(e){return e.split("-")[1]}function q1(e){return e==="x"?"y":"x"}function Y1(e){return e==="y"?"height":"width"}function as(e){const t=e[0];return t==="t"||t==="b"?"y":"x"}function G1(e){return q1(as(e))}function ND(e,t,n){n===void 0&&(n=!1);const r=da(e),i=G1(e),a=Y1(i);let l=i==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[a]>t.floating[a]&&(l=Oh(l)),[l,Oh(l)]}function AD(e){const t=Oh(e);return[Lb(e),t,Lb(t)]}function Lb(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const cS=["left","right"],dS=["right","left"],_D=["top","bottom"],RD=["bottom","top"];function OD(e,t,n){switch(e){case"top":case"bottom":return n?t?dS:cS:t?cS:dS;case"left":case"right":return t?_D:RD;default:return[]}}function ID(e,t,n,r){const i=da(e);let a=OD(Fr(e),n==="start",r);return i&&(a=a.map(l=>l+"-"+i),t&&(a=a.concat(a.map(Lb)))),a}function Oh(e){const t=Fr(e);return wD[t]+e.slice(t.length)}function MD(e){var t,n,r,i;return{top:(t=e.top)!=null?t:0,right:(n=e.right)!=null?n:0,bottom:(r=e.bottom)!=null?r:0,left:(i=e.left)!=null?i:0}}function B3(e){return typeof e!="number"?MD(e):{top:e,right:e,bottom:e,left:e}}function zc(e){const{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function fS(e,t){return t<0||t>=e.length}function N0(e,t){return yl(e.current,{disabledIndices:t})}function hS(e,t){return yl(e.current,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}function yl(e,{startingIndex:t=-1,decrement:n=!1,disabledIndices:r,amount:i=1}={}){let a=t;do a+=n?-i:i;while(a>=0&&a<=e.length-1&&H3(e,a,r));return a}function H3(e,t,n){if(typeof n=="function"?n(t):n?.includes(t)??!1)return!0;const i=e[t];return i?xp(i)?!n&&(i.hasAttribute("disabled")||i.getAttribute("aria-disabled")==="true"):!0:!1}function LD(e){return e.visibility==="hidden"||e.visibility==="collapse"}function xp(e,t=e?Vr(e):null){return!e||!e.isConnected||!t||LD(t)?!1:typeof e.checkVisibility=="function"?e.checkVisibility():t.display!=="none"&&t.display!=="contents"}const DD='a[href],button,input,select,textarea,summary,details,iframe,object,embed,[tabindex],[contenteditable]:not([contenteditable="false"]),audio[controls],video[controls]';function PD(e){const t=e.assignedSlot;if(t)return t;if(e.parentElement)return e.parentElement;const n=e.getRootNode();return Rl(n)?n.host:null}function Db(e){for(const t of Array.from(e.children))if(nr(t)==="summary")return t;return null}function jD(e,t){const n=Db(t);return!!n&&(e===n||nt(n,e))}function U3(e){const t=e?nr(e):"";return e!=null&&e.matches(DD)&&(t!=="summary"||e.parentElement!=null&&nr(e.parentElement)==="details"&&Db(e.parentElement)===e)&&(t!=="details"||Db(e)==null)&&(t!=="input"||e.type!=="hidden")}function z3(e){if(!U3(e)||!e.isConnected||e.matches(":disabled"))return!1;for(let t=e;t;t=PD(t)){const n=t!==e,r=nr(t)==="slot";if(t.hasAttribute("inert")||n&&nr(t)==="details"&&!t.open&&!jD(e,t)||t.hasAttribute("hidden")||!r&&!BD(t,n))return!1}return!0}function BD(e,t){const n=Vr(e);return t?n.display!=="none":xp(e,n)}function F3(e){const t=e.tabIndex;if(t<0){const n=nr(e);if(n==="details"||n==="audio"||n==="video"||cn(e)&&e.isContentEditable)return 0}return t}function A0(e){if(nr(e)!=="input")return null;const t=e;return t.type==="radio"&&t.name!==""?t:null}function HD(e,t){const n=A0(e);if(!n)return!0;const r=t.find(i=>{const a=A0(i);return a?.name===n.name&&a.form===n.form&&a.checked});return r?r===n:t.find(i=>{const a=A0(i);return a?.name===n.name&&a.form===n.form})===n}function $3(e){if(cn(e)&&nr(e)==="slot"){const t=e.assignedElements({flatten:!0});if(t.length>0)return t}return cn(e)&&e.shadowRoot?Array.from(e.shadowRoot.children):Array.from(e.children)}function V3(e,t){$3(e).forEach(n=>{U3(n)&&t.push(n),V3(n,t)})}function q3(e,t,n){$3(e).forEach(r=>{cn(r)&&r.matches(t)&&n.push(r),q3(r,t,n)})}function X1(e){return z3(e)&&F3(e)>=0}function Y3(e){const t=[];return V3(e,t),t.filter(z3)}function Zc(e){const t=Y3(e);return t.filter(n=>F3(n)>=0&&HD(n,t))}function G3(e,t){const n=Zc(e),r=n.length;if(r===0)return;const i=Rr(At(e)),a=n.indexOf(i),l=a===-1?t===1?0:r-1:a+t;return n[l]}function K1(e){return G3(At(e).body,1)||e}function X3(e){return G3(At(e).body,-1)||e}function K3(e,t){if(!e)return null;const n=Zc(At(e).body),r=n.length;if(r===0)return null;const i=n.indexOf(e);if(i===-1)return null;const a=(i+t+r)%r;return n[a]}function UD(e){return K3(e,1)}function zD(e){return K3(e,-1)}function Cl(e,t){const n=t||e.currentTarget,r=e.relatedTarget;return!r||!nt(n,r)}function FD(e){Zc(e).forEach(n=>{n.dataset.tabindex=n.getAttribute("tabindex")||"",n.setAttribute("tabindex","-1")})}function pS(e){const t=[];q3(e,"[data-tabindex]",t),t.forEach(n=>{const r=n.dataset.tabindex;delete n.dataset.tabindex,r?n.setAttribute("tabindex",r):n.removeAttribute("tabindex")})}function sa(e,t,n=!0){return e.filter(i=>i.parentId===t).flatMap(i=>[...!n||i.context?.open?[i]:[],...sa(e,i.id,n)])}function mS(e,t){let n=[],r=e.find(i=>i.id===t)?.parentId;for(;r;){const i=e.find(a=>a.id===r);r=i?.parentId,i&&(n=n.concat(i))}return n}function Fc(e){return`data-base-ui-${e}`}let jf=0;function fh(e,t={}){const{preventScroll:n=!1,sync:r=!1,shouldFocus:i}=t;cancelAnimationFrame(jf);function a(){i&&!i()||e?.focus({preventScroll:n})}if(r)return a(),Vn;const l=requestAnimationFrame(a);return jf=l,()=>{jf===l&&(cancelAnimationFrame(l),jf=0)}}const _0={inert:new WeakMap,"aria-hidden":new WeakMap},gS="data-base-ui-inert",Pb={inert:new WeakSet,"aria-hidden":new WeakSet};let tc=new WeakMap,R0=0;function $D(e){return Pb[e]}function Q3(e){return e?Rl(e)?e.host:Q3(e.parentNode):null}const bS=(e,t)=>t.map(n=>{if(e.contains(n))return n;const r=Q3(n);return e.contains(r)?r:null}).filter(n=>n!=null),xS=e=>{const t=new Set;return e.forEach(n=>{let r=n;for(;r&&!t.has(r);)t.add(r),r=r.parentNode}),t},yS=(e,t,n)=>{const r=[],i=a=>{!a||n.has(a)||Array.from(a.children).forEach(l=>{nr(l)!=="script"&&(t.has(l)?i(l):r.push(l))})};return i(e),r};function VD(e,t,n,r,{mark:i=!0}){let a=null;r?a="inert":n&&(a="aria-hidden");let l=null,c=null;const d=bS(t,e),f=i?yS(t,xS(d),new Set(d)):[],g=[],h=[];if(a){const b=_0[a],x=$D(a);c=x,l=b;const v=bS(t,Array.from(t.querySelectorAll("[aria-live]"))),w=d.concat(v);yS(t,xS(w),new Set(w)).forEach(C=>{const N=C.getAttribute(a),A=N!==null&&N!=="false",R=(b.get(C)||0)+1;b.set(C,R),g.push(C),R===1&&A&&x.add(C),A||C.setAttribute(a,a==="inert"?"":"true")})}return i&&f.forEach(b=>{const x=(tc.get(b)||0)+1;tc.set(b,x),h.push(b),x===1&&b.setAttribute(gS,"")}),R0+=1,()=>{l&&g.forEach(b=>{const v=(l.get(b)||0)-1;l.set(b,v),v||(!c?.has(b)&&a&&b.removeAttribute(a),c?.delete(b))}),i&&h.forEach(b=>{const x=(tc.get(b)||0)-1;tc.set(b,x),x||b.removeAttribute(gS)}),R0-=1,R0||(_0.inert=new WeakMap,_0["aria-hidden"]=new WeakMap,Pb.inert=new WeakSet,Pb["aria-hidden"]=new WeakSet,tc=new WeakMap)}}function ES(e,t={}){const{ariaHidden:n=!1,inert:r=!1,mark:i=!0}=t,a=At(e[0]).body;return VD(e,a,n,r,{mark:i})}let vS=0;function qD(e,t="mui"){const[n,r]=E.useState(e),i=e||n;return E.useEffect(()=>{n==null&&(vS+=1,r(`${t}-${vS}`))},[n,t]),i}const TS=M1.useId;function ao(e,t){if(TS!==void 0){const n=TS();return e??(t?`${t}-${n}`:n)}return qD(e,t)}function SS(e){if(!E.isValidElement(e))return null;const t=e,n=t.props;return(L1(19)?n?.ref:t.ref)??null}function jb(e,t){if(e&&!t)return e;if(!e&&t)return t;if(e||t)return{...e,...t}}function YD(e,t){const n={};for(const r in e){const i=e[r];if(t?.hasOwnProperty(r)){const a=t[r](i);a!=null&&Object.assign(n,a);continue}i===!0?n[`data-${r.toLowerCase()}`]="":i&&(n[`data-${r.toLowerCase()}`]=i.toString())}return n}function GD(e,t){return typeof e=="function"?e(t):e}function XD(e,t){return typeof e=="function"?e(t):e}const Q1={};function Ir(e,t,n,r,i){if(!n&&!r&&!i&&!e)return Ih(t);let a=Ih(e);return t&&(a=hc(a,t)),n&&(a=hc(a,n)),r&&(a=hc(a,r)),i&&(a=hc(a,i)),a}function KD(e){if(e.length===0)return Q1;if(e.length===1)return Ih(e[0]);let t=Ih(e[0]);for(let n=1;n<e.length;n+=1)t=hc(t,e[n]);return t}function Ih(e){return W1(e)?{...Z3(e,Q1)}:QD(e)}function hc(e,t){return W1(t)?Z3(t,e):WD(e,t)}function QD(e){const t={...e};for(const n in t){const r=t[n];W3(n,r)&&(t[n]=J3(r))}return t}function WD(e,t){if(!t)return e;for(const n in t){const r=t[n];switch(n){case"style":{e[n]=jb(e.style,r);break}case"className":{e[n]=eN(e.className,r);break}default:W3(n,r)?e[n]=ZD(e[n],r):e[n]=r}}return e}function W3(e,t){const n=e.charCodeAt(0),r=e.charCodeAt(1),i=e.charCodeAt(2);return n===111&&r===110&&i>=65&&i<=90&&(typeof t=="function"||typeof t>"u")}function W1(e){return typeof e=="function"}function Z3(e,t){return W1(e)?e(t):e??Q1}function ZD(e,t){return t?e?(...n)=>{const r=n[0];if(tN(r)){const a=r;Mh(a);const l=t(...n);return a.baseUIHandlerPrevented||e?.(...n),l}const i=t(...n);return e?.(...n),i}:J3(t):e}function J3(e){return e&&((...t)=>{const n=t[0];return tN(n)&&Mh(n),e(...t)})}function Mh(e){return e.preventBaseUIHandler=()=>{e.baseUIHandlerPrevented=!0},e}function eN(e,t){return t?e?t+" "+e:t:e}function tN(e){return e!=null&&typeof e=="object"&&"nativeEvent"in e}function Nn(e,t,n={}){const r=t.render,i=JD(t,n);if(n.enabled===!1)return null;const a=n.state??dn;return n8(e,r,i,a)}function JD(e,t={}){const{className:n,style:r,render:i}=e,{state:a=dn,ref:l,props:c,stateAttributesMapping:d,enabled:f=!0}=t,g=f?GD(n,a):void 0,h=f?XD(r,a):void 0,b=f?YD(a,d):dn,x=f&&c?e8(c):void 0,v=f?jb(b,x)??{}:dn;return typeof document<"u"&&(f?Array.isArray(l)?v.ref=LL([v.ref,SS(i),...l]):v.ref=ro(v.ref,SS(i),l):ro(null,null)),f?(g!==void 0&&(v.className=eN(v.className,g)),h!==void 0&&(v.style=jb(v.style,h)),v):dn}function e8(e){return Array.isArray(e)?KD(e):Ir(void 0,e)}const t8=Symbol.for("react.lazy");function n8(e,t,n,r){if(t){if(typeof t=="function")return t(n,r);const i=Ir(n,t.props);i.ref=n.ref;let a=t;return a?.$$typeof===t8&&(a=E.Children.toArray(t)[0]),E.cloneElement(a,i)}if(e&&typeof e=="string")return r8(e,n);throw new Error(Ln(8))}function r8(e,t){return e==="button"?E.createElement("button",{type:"button",...t,key:t.key}):e==="img"?E.createElement("img",{alt:"",...t,key:t.key}):E.createElement(e,t)}const s8=500,i8=500,a8={style:{transition:"none"}},nN="data-base-ui-click-trigger",rN={fallbackAxisSide:"none"},sN={fallbackAxisSide:"end"},o8={clipPath:"inset(50%)",position:"fixed",top:0,left:0},iN=E.createContext(null),aN=()=>E.useContext(iN),l8=Fc("portal");function oN(e={}){const{ref:t,container:n,componentProps:r=dn,elementProps:i}=e,a=ao(),c=aN()?.portalNode,[d,f]=E.useState(null),[g,h]=E.useState(null),b=tt(k=>{k!==null&&h(k)}),x=E.useRef(null);Ye(()=>{if(n===null){x.current&&(x.current=null,h(null),f(null));return}if(a==null)return;const k=(n&&(P1(n)?n:n.current))??c??document.body;if(k==null){x.current&&(x.current=null,h(null),f(null));return}x.current!==k&&(x.current=k,h(null),f(k))},[n,c,a]);const v=Nn("div",r,{ref:[t,b],props:[{id:a,[l8]:""},i]});return{portalNode:g,portalSubtree:d&&v?br.createPortal(v,d):null}}const Z1=E.forwardRef(function(t,n){const{render:r,className:i,style:a,children:l,container:c,renderGuards:d,...f}=t,{portalNode:g,portalSubtree:h}=oN({container:c,ref:n,componentProps:t,elementProps:f}),b=E.useRef(null),x=E.useRef(null),v=E.useRef(null),w=E.useRef(null),[k,C]=E.useState(null),N=E.useRef(!1),A=k?.modal,R=k?.open,M=typeof d=="boolean"?d:!!k&&!k.modal&&k.open&&!!g;E.useEffect(()=>{if(!g||A)return;function D(I){g&&I.relatedTarget&&Cl(I)&&(I.type==="focusin"?N.current&&(pS(g),N.current=!1):(FD(g),N.current=!0))}return Ds(Tt(g,"focusin",D,!0),Tt(g,"focusout",D,!0))},[g,A]),Ye(()=>{!g||R!==!0||!N.current||(pS(g),N.current=!1)},[R,g]);const _=E.useMemo(()=>({beforeOutsideRef:b,afterOutsideRef:x,beforeInsideRef:v,afterInsideRef:w,portalNode:g,setFocusManagerState:C}),[g]);return m.jsxs(E.Fragment,{children:[h,m.jsxs(iN.Provider,{value:_,children:[M&&g&&m.jsx(Ml,{"data-type":"outside",ref:b,onFocus:D=>{if(Cl(D,g))v.current?.focus();else{const I=k?k.domReference:null;X3(I)?.focus()}}}),M&&g&&m.jsx("span",{"aria-owns":g.id,style:o8}),g&&br.createPortal(l,g),M&&g&&m.jsx(Ml,{"data-type":"outside",ref:x,onFocus:D=>{if(Cl(D,g))w.current?.focus();else{const I=k?k.domReference:null;K1(I)?.focus(),k?.closeOnFocusOut&&k?.onOpenChange(!1,pt(io,D.nativeEvent))}}})]})]})});function lN(){const e=new Map;return{emit(t,n){e.get(t)?.forEach(r=>r(n))},on(t,n){e.has(t)||e.set(t,new Set),e.get(t).add(n)},off(t,n){e.get(t)?.delete(n)}}}class J1{nodesRef={current:[]};events=lN();addNode(t){this.nodesRef.current.push(t)}removeNode(t){const n=this.nodesRef.current.findIndex(r=>r===t);n!==-1&&this.nodesRef.current.splice(n,1)}}const uN=E.createContext(null),cN=E.createContext(null),fa=()=>E.useContext(uN)?.id||null,ha=e=>{const t=E.useContext(cN);return e??t};function dN(e){const t=ao(),n=ha(e),r=fa();return Ye(()=>{if(!t)return;const i={id:t,parentId:r};return n?.addNode(i),()=>{n?.removeNode(i)}},[n,t,r]),t}function u8(e){const{children:t,id:n}=e,r=fa();return m.jsx(uN.Provider,{value:E.useMemo(()=>({id:n,parentId:r}),[n,r]),children:t})}function c8(e){const{children:t,externalTree:n}=e,r=xr(()=>n??new J1).current;return m.jsx(cN.Provider,{value:r,children:t})}function si(e){return e==null?e:"current"in e?e.current:e}function d8(e,t){const n=sn(mr(e));return e instanceof n.KeyboardEvent?"keyboard":e instanceof n.FocusEvent?t||"keyboard":"pointerType"in e?e.pointerType||"keyboard":"touches"in e?"touch":e instanceof n.MouseEvent?t||(e.detail===0?"keyboard":"mouse"):""}const CS=20;let ta=[];function ex(){ta=ta.filter(e=>e.deref()?.isConnected)}function kS(e){ex(),e&&nr(e)!=="body"&&(ta.push(new WeakRef(e)),ta.length>CS&&(ta=ta.slice(-CS)))}function wS(){return ex(),ta[ta.length-1]?.deref()}function f8(e){return e?X1(e)?e:Zc(e)[0]||e:null}function NS(e){if(e.hasAttribute("tabindex")&&!e.hasAttribute("data-tabindex")||!e.getAttribute("role")?.includes("dialog"))return;const n=Y3(e).filter(i=>{const a=i.getAttribute("data-tabindex")||"";return X1(i)||i.hasAttribute("data-tabindex")&&!a.startsWith("-")}),r=e.getAttribute("tabindex");n.length===0?r!=="0"&&(e.setAttribute("tabindex","0"),e.setAttribute("data-tabindex","0")):(r!=="-1"||e.hasAttribute("data-tabindex")&&e.getAttribute("data-tabindex")!=="-1")&&(e.setAttribute("tabindex","-1"),e.setAttribute("data-tabindex","-1"))}function tx(e){const{context:t,children:n,disabled:r=!1,initialFocus:i=!0,returnFocus:a=!0,restoreFocus:l=!1,modal:c=!0,closeOnFocusOut:d=!0,openInteractionType:f="",nextFocusableElement:g,previousFocusableElement:h,beforeContentFocusGuardRef:b,externalTree:x,getInsideElements:v}=e,w="rootStore"in t?t.rootStore:t,k=w.useState("open"),C=w.useState("domReferenceElement"),N=w.useState("floatingElement"),{events:A,dataRef:R}=w.context,M=tt(()=>R.current.floatingContext?.nodeId),_=i===!1,D=Ib(C)&&_,I=En(i),U=En(a),j=En(f),X=En(k),K=ha(x),F=aN(),W=E.useRef(!1),V=E.useRef(!1),H=E.useRef(!1),q=E.useRef(null),J=E.useRef(""),ue=E.useRef(""),L=E.useRef(null),B=E.useRef(null),G=ro(L,b,F?.beforeInsideRef),P=ro(B,F?.afterInsideRef),ae=Gn(),ie=Gn(),ce=Ol(),de=F!=null,he=_h(N),ve=tt((Ee=he)=>Ee?Zc(Ee):[]),Fe=tt(()=>v?.().filter(Ee=>Ee!=null)??[]);E.useEffect(()=>{if(r||!c)return;function Ee(Ue){Ue.key==="Tab"&&nt(he,Rr(At(he)))&&ve().length===0&&!D&&Ns(Ue)}const Oe=At(he);return Tt(Oe,"keydown",Ee)},[r,he,c,D,ve]),E.useEffect(()=>{if(r||!k)return;const Ee=At(he);function Oe(){H.current=!1}function Ue(qe){const De=mr(qe),ke=Fe(),ye=nt(N,De)||nt(C,De)||nt(F?.portalNode,De)||ke.some(Re=>Re===De||nt(Re,De));H.current=!ye,ue.current=qe.pointerType||"keyboard",De?.closest(`[${nN}]`)&&(V.current=!0,ie.start(0,()=>{V.current=!1}))}function Xe(){ue.current="keyboard"}return Ds(Tt(Ee,"pointerdown",Ue,!0),Tt(Ee,"pointerup",Oe,!0),Tt(Ee,"pointercancel",Oe,!0),Tt(Ee,"keydown",Xe,!0),Oe)},[r,N,C,he,k,F,ie,Fe]),E.useEffect(()=>{if(r||!d)return;const Ee=At(he);function Oe(){V.current=!0,ie.start(0,()=>{V.current=!1})}function Ue(ke){const ye=mr(ke);X1(ye)&&(q.current=ye)}function Xe(ke){const ye=ke.relatedTarget,Re=ke.currentTarget,Pe=mr(ke);c&&ye==null&&Pe!=null&&nt(N,Pe)&&kS(Pe),queueMicrotask(()=>{const ee=M(),pe=w.context.triggerElements,se=Fe(),re=ye?.hasAttribute(Fc("focus-guard"))&&[L.current,B.current,F?.beforeInsideRef.current,F?.afterInsideRef.current,F?.beforeOutsideRef.current,F?.afterOutsideRef.current,si(h),si(g)].includes(ye),Q=!(nt(C,ye)||nt(N,ye)||nt(ye,N)||nt(F?.portalNode,ye)||se.some($=>$===ye||nt($,ye))||ye!=null&&pe.hasElement(ye)||pe.hasMatchingElement($=>nt($,ye))||re||K&&(sa(K.nodesRef.current,ee).find($=>nt($.context?.elements.floating,ye)||nt($.context?.elements.domReference,ye))||mS(K.nodesRef.current,ee).find($=>[$.context?.elements.floating,_h($.context?.elements.floating)].includes(ye)||$.context?.elements.domReference===ye)));if(Re===C&&he&&NS(he),l&&Re!==C&&!xp(Pe)&&Rr(Ee)===Ee.body){if(cn(he)&&(he.focus(),l==="popup")){ce.request(()=>{he.focus()});return}const $=ve(),oe=q.current,Se=(oe&&$.includes(oe)?oe:null)||$[$.length-1]||he;cn(Se)&&Se.focus()}if(R.current.insideReactTree){R.current.insideReactTree=!1;return}(D||!c)&&ye&&Q&&!V.current&&(D||ye!==wS())&&(W.current=!0,w.setOpen(!1,pt(io,ke)))})}function qe(){H.current||(R.current.insideReactTree=!0,ae.start(0,()=>{R.current.insideReactTree=!1}))}const De=cn(C)?C:null;if(!(!N&&!De))return Ds(De&&Tt(De,"focusout",Xe),De&&Tt(De,"pointerdown",Oe),N&&Tt(N,"focusin",Ue),N&&Tt(N,"focusout",Xe),N&&F&&Tt(N,"focusout",qe,!0))},[r,C,N,he,c,K,F,w,d,l,ve,D,M,R,ae,ie,ce,g,h,Fe]),E.useEffect(()=>{if(r||!N||!k)return;const Ee=Array.from(F?.portalNode?.querySelectorAll(`[${Fc("portal")}]`)||[]),Ue=(K?mS(K.nodesRef.current,M()):[]).find(Re=>Ib(Re.context?.elements.domReference||null))?.context?.elements.domReference,qe=[...[N,...Ee,L.current,B.current,F?.beforeOutsideRef.current,F?.afterOutsideRef.current,...Fe()],Ue,si(h),si(g),D?C:null].filter(Re=>Re!=null),De=ES(qe,{ariaHidden:c||D,mark:!1}),ke=[N,...Ee].filter(Re=>Re!=null),ye=ES(ke);return()=>{ye(),De()}},[k,r,C,N,c,F,D,K,M,g,h,Fe]),Ye(()=>{if(!k||r||!cn(he))return;const Ee=At(he),Oe=Rr(Ee);queueMicrotask(()=>{const Ue=I.current,Xe=typeof Ue=="function"?Ue(j.current||""):Ue;if(Xe===void 0||Xe===!1||nt(he,Oe))return;let De=null;const ke=()=>(De==null&&(De=ve(he)),De[0]||he);let ye;Xe===!0||Xe===null?ye=ke():ye=si(Xe),ye=ye||ke();const Re=nt(he,Rr(Ee));fh(ye,{preventScroll:ye===he,shouldFocus(){if(!X.current)return!1;if(Re)return!0;const Pe=Rr(Ee);return!(Pe!==ye&&nt(he,Pe))}})})},[r,k,he,ve,I,j,X]),Ye(()=>{if(r||!he)return;const Ee=At(he),Oe=Rr(Ee),Ue=j.current==null;kS(Oe);function Xe(De){if(De.open||(J.current=d8(De.nativeEvent,ue.current)),De.reason===qn&&De.nativeEvent.type==="mouseleave"&&(W.current=!0),De.reason===gp)if(De.nested)W.current=!1;else if(F1(De.nativeEvent)||O3(De.nativeEvent))W.current=!1;else{let ke=!1;At(he).createElement("div").focus({get preventScroll(){return ke=!0,!1}}),ke?W.current=!1:W.current=!0}}A.on("openchange",Xe);function qe(){const De=U.current;let ke=typeof De=="function"?De(J.current):De;if(ke===void 0||ke===!1)return null;ke===null&&(ke=!0);const ye=C?.isConnected?C:null,Re=Oe?.isConnected&&nr(Oe)!=="body"?Oe:null;let Pe=Ue?Re||ye:ye||Re;return Pe||(Pe=wS()||null),typeof ke=="boolean"?Pe:si(ke)||Pe||null}return()=>{A.off("openchange",Xe);const De=Rr(Ee),ke=Fe(),ye=nt(N,De)||ke.some(ee=>ee===De||nt(ee,De))||K&&sa(K.nodesRef.current,M(),!1).some(ee=>nt(ee.context?.elements.floating,De)),Re=U.current,Pe=qe();queueMicrotask(()=>{const ee=f8(Pe),pe=typeof Re!="boolean";Re&&!W.current&&cn(ee)&&(!(!pe&&ee!==De&&De!==Ee.body)||ye)&&ee.focus({preventScroll:!0}),W.current=!1})}},[r,N,he,U,j,A,K,C,M,Fe]),Ye(()=>{if(!ca||k||!N)return;const Ee=Rr(At(N));!cn(Ee)||!mp(Ee)||nt(N,Ee)&&Ee.blur()},[k,N]),Ye(()=>{if(!(r||!F))return F.setFocusManagerState({modal:c,closeOnFocusOut:d,open:k,onOpenChange:w.setOpen,domReference:C}),()=>{F.setFocusManagerState(null)}},[r,F,c,k,w,d,C]),Ye(()=>{if(!(r||!he))return NS(he),()=>{queueMicrotask(ex)}},[r,he]);const Le=!r&&(c?!D:!0)&&(de||c);return m.jsxs(E.Fragment,{children:[Le&&m.jsx(Ml,{"data-type":"inside",ref:G,onFocus:Ee=>{if(c){const Oe=ve();fh(Oe[Oe.length-1])}else F?.portalNode&&(W.current=!1,Cl(Ee,F.portalNode)?K1(C)?.focus():si(h??F.beforeOutsideRef)?.focus())}}),n,Le&&m.jsx(Ml,{"data-type":"inside",ref:P,onFocus:Ee=>{c?fh(ve()[0]):F?.portalNode&&(d&&(W.current=!0),Cl(Ee,F.portalNode)?X3(C)?.focus():si(g??F.afterOutsideRef)?.focus())}})]})}function nx(e,t={}){const{enabled:n=!0,event:r="click",toggle:i=!0,ignoreMouse:a=!1,stickIfOpen:l=!0,touchOpenDelay:c=0,reason:d=$l}=t,f="rootStore"in e?e.rootStore:e,g=f.context.dataRef,h=E.useRef(void 0),b=Ol(),x=Gn(),v=E.useMemo(()=>{function w(C,N,A,R){const M=pt(d,N,A);C&&R==="touch"&&c>0?x.start(c,()=>{f.setOpen(!0,M)}):f.setOpen(C,M)}function k(C,N,A){const R=g.current.openEvent,M=f.select("domReferenceElement")!==N;return C&&M||!C||!i?!0:R&&l?!A(R.type):!1}return{onPointerDown(C){h.current=C.pointerType},onMouseDown(C){const N=h.current,A=C.nativeEvent,R=f.select("open");if(C.button!==0||r==="click"||so(N,!0)&&a)return;const M=k(R,C.currentTarget,I=>I==="click"||I==="mousedown"),_=mr(A);if(mp(_)){w(M,A,_,N);return}const D=C.currentTarget;b.request(()=>{w(M,A,D,N)})},onClick(C){if(r==="mousedown-only")return;const N=h.current;if(r==="mousedown"&&N){h.current=void 0;return}if(so(N,!0)&&a)return;const A=f.select("open"),R=k(A,C.currentTarget,M=>M==="click"||M==="mousedown"||M==="keydown"||M==="keyup");w(R,C.nativeEvent,C.currentTarget,N)},onKeyDown(){h.current=void 0}}},[g,r,a,d,f,l,i,b,x,c]);return E.useMemo(()=>n?{reference:v}:dn,[n,v])}function h8(e,t){let n=null,r=null,i=!1;return{contextElement:e||void 0,getBoundingClientRect(){const a=e?.getBoundingClientRect()||{width:0,height:0,x:0,y:0},l=t.axis==="x"||t.axis==="both",c=t.axis==="y"||t.axis==="both",d=["mouseenter","mousemove"].includes(t.dataRef.current.openEvent?.type||"")&&t.pointerType!=="touch";let f=a.width,g=a.height,h=a.x,b=a.y;return n==null&&t.x&&l&&(n=a.x-t.x),r==null&&t.y&&c&&(r=a.y-t.y),h-=n||0,b-=r||0,f=0,g=0,!i||d?(f=t.axis==="y"?a.width:0,g=t.axis==="x"?a.height:0,h=l&&t.x!=null?t.x:h,b=c&&t.y!=null?t.y:b):i&&!d&&(g=t.axis==="x"?a.height:g,f=t.axis==="y"?a.width:f),i=!0,{width:f,height:g,x:h,y:b,top:b,right:h+f,bottom:b+g,left:h}}}}function AS(e){return e!=null&&e.clientX!=null}function p8(e,t={}){const{enabled:n=!0,axis:r="both"}=t,i="rootStore"in e?e.rootStore:e,a=i.useState("open"),l=i.useState("floatingElement"),c=i.useState("domReferenceElement"),d=i.context.dataRef,f=E.useRef(!1),g=E.useRef(null),[h,b]=E.useState(),[x,v]=E.useState([]),w=tt(R=>{i.set("positionReference",R)}),k=tt((R,M,_)=>{f.current||d.current.openEvent&&!AS(d.current.openEvent)||i.set("positionReference",h8(_??c,{x:R,y:M,axis:r,dataRef:d,pointerType:h}))}),C=tt(R=>{a?g.current||(k(R.clientX,R.clientY,R.currentTarget),v([])):k(R.clientX,R.clientY,R.currentTarget)}),N=so(h)?l:a;E.useEffect(()=>{if(!n){w(c);return}if(!N)return;function R(){g.current?.(),g.current=null}const M=sn(l);function _(D){const I=mr(D);nt(l,I)?R():k(D.clientX,D.clientY)}return!d.current.openEvent||AS(d.current.openEvent)?g.current=Tt(M,"mousemove",_):w(c),R},[N,n,l,d,c,i,k,w,x]),E.useEffect(()=>()=>{i.set("positionReference",null)},[i]),E.useEffect(()=>{n&&!l&&(f.current=!1)},[n,l]),E.useEffect(()=>{!n&&a&&(f.current=!0)},[n,a]);const A=E.useMemo(()=>{function R(M){b(M.pointerType)}return{onPointerDown:R,onPointerEnter:R,onMouseMove:C,onMouseEnter:C}},[C]);return E.useMemo(()=>n?{reference:A,trigger:A}:{},[n,A])}function m8(){return!1}function g8(e){return{escapeKey:typeof e=="boolean"?e:e?.escapeKey??!1,outsidePress:typeof e=="boolean"?e:e?.outsidePress??!0}}function yp(e,t={}){const{enabled:n=!0,escapeKey:r=!0,outsidePress:i=!0,outsidePressEvent:a="sloppy",referencePress:l=m8,bubbles:c,externalTree:d}=t,f="rootStore"in e?e.rootStore:e,g=f.useState("open"),h=f.useState("floatingElement"),{dataRef:b}=f.context,x=ha(d),v=tt(typeof i=="function"?i:()=>!1),w=typeof i=="function"?v:i,k=w!==!1,C=tt(()=>a),{escapeKey:N,outsidePress:A}=g8(c),R=E.useRef(!1),M=E.useRef(!1),_=E.useRef(!1),D=E.useRef(!1),I=E.useRef(""),U=E.useRef(null),j=Gn(),X=Gn(),K=tt(()=>{X.clear(),b.current.insideReactTree=!1}),F=tt(G=>{const P=b.current.floatingContext?.nodeId;return(x?sa(x.nodesRef.current,P):[]).some(ie=>ie.context?.open&&!ie.context.dataRef.current[G])}),W=tt(G=>w0(G,f.select("floatingElement"))||w0(G,f.select("domReferenceElement"))),V=tt(G=>{l()&&f.setOpen(!1,pt($l,G.nativeEvent))}),H=tt(G=>{if(!g||!n||!r||G.key!=="Escape"||D.current||!N&&F("__escapeKeyBubbles"))return;const P=fD(G)?G.nativeEvent:G,ae=pt(bp,P);f.setOpen(!1,ae),ae.isCanceled||G.preventDefault(),!N&&!ae.isPropagationAllowed&&G.stopPropagation()}),q=tt(()=>{b.current.insideReactTree=!0,X.start(0,K)}),J=tt(G=>{if(!g||!n||G.button!==0)return;const P=mr(G.nativeEvent);nt(f.select("floatingElement"),P)&&(R.current||(R.current=!0,M.current=!1))}),ue=tt(G=>{!g||!n||(G.defaultPrevented||G.nativeEvent.defaultPrevented)&&R.current&&(M.current=!0)});E.useEffect(()=>{if(!g||!n)return;b.current.__escapeKeyBubbles=N,b.current.__outsidePressBubbles=A;const G=new ps,P=new ps;function ae(){G.clear(),D.current=!0}function ie(){G.start(ca?5:0,()=>{D.current=!1})}function ce(){_.current=!0,P.start(0,()=>{_.current=!1})}function de(){R.current=!1,M.current=!1}function he(){const se=I.current,re=se==="pen"||!se?"mouse":se,Q=C(),$=typeof Q=="function"?Q():Q;return typeof $=="string"?$:$[re]}function ve(se){const re=he();return re==="intentional"&&se.type!=="click"||re==="sloppy"&&se.type==="click"}function Fe(se){const re=b.current.floatingContext?.nodeId,Q=x&&sa(x.nodesRef.current,re).some($=>w0(se,$.context?.elements.floating));return W(se)||Q}function Le(se){if(ve(se)){se.type!=="click"&&!W(se)&&(P.clear(),_.current=!1),K();return}if(b.current.insideReactTree){K();return}const re=mr(se),Q=`[${Fc("inert")}]`,$=St(re)?re.getRootNode():null,oe=Array.from((Rl($)?$:At(f.select("floatingElement"))).querySelectorAll(Q)),Se=f.context.triggerElements;if(re&&(Se.hasElement(re)||Se.hasMatchingElement($e=>nt($e,re))))return;let _e=St(re)?re:null;for(;_e&&!ci(_e);){const $e=hi(_e);if(ci($e)||!St($e))break;_e=$e}if(!(oe.length&&St(re)&&!pD(re)&&!nt(re,f.select("floatingElement"))&&oe.every($e=>!nt(_e,$e)))){if(cn(re)&&!("touches"in se)){const $e=ci(re),ot=Vr(re),et=/auto|scroll/,dt=$e||et.test(ot.overflowX),ut=$e||et.test(ot.overflowY),Ve=dt&&re.clientWidth>0&&re.scrollWidth>re.clientWidth,Rt=ut&&re.clientHeight>0&&re.scrollHeight>re.clientHeight,Pt=ot.direction==="rtl",lt=Rt&&(Pt?se.offsetX<=re.offsetWidth-re.clientWidth:se.offsetX>re.clientWidth),Lt=Ve&&se.offsetY>re.clientHeight;if(lt||Lt)return}if(!Fe(se)){if(he()==="intentional"&&_.current){P.clear(),_.current=!1;return}typeof w=="function"&&!w(se)||F("__outsidePressBubbles")||(f.setOpen(!1,pt(gp,se)),K())}}}function Ee(se){he()!=="sloppy"||se.pointerType==="touch"||!f.select("open")||!n||W(se)||Le(se)}function Oe(se){if(he()!=="sloppy"||!f.select("open")||!n||W(se))return;const re=se.touches[0];re&&(U.current={startTime:Date.now(),startX:re.clientX,startY:re.clientY,dismissOnTouchEnd:!1,dismissOnMouseDown:!0},j.start(1e3,()=>{U.current&&(U.current.dismissOnTouchEnd=!1,U.current.dismissOnMouseDown=!1)}))}function Ue(se,re){const Q=mr(se);if(!Q)return;const $=Tt(Q,se.type,()=>{re(se),$()})}function Xe(se){I.current="touch",Ue(se,Oe)}function qe(se){j.clear(),se.type==="pointerdown"&&(I.current=se.pointerType),!(se.type==="mousedown"&&U.current&&!U.current.dismissOnMouseDown)&&Ue(se,re=>{re.type==="pointerdown"?Ee(re):Le(re)})}function De(se){if(!R.current)return;const re=M.current;if(de(),he()==="intentional"){if(se.type==="pointercancel"){re&&ce();return}if(!Fe(se)){if(re){ce();return}typeof w=="function"&&!w(se)||(P.clear(),_.current=!0,K())}}}function ke(se){if(he()!=="sloppy"||!U.current||W(se))return;const re=se.touches[0];if(!re)return;const Q=Math.abs(re.clientX-U.current.startX),$=Math.abs(re.clientY-U.current.startY),oe=Math.sqrt(Q*Q+$*$);oe>5&&(U.current.dismissOnTouchEnd=!0),oe>10&&(Le(se),j.clear(),U.current=null)}function ye(se){Ue(se,ke)}function Re(se){he()!=="sloppy"||!U.current||W(se)||(U.current.dismissOnTouchEnd&&Le(se),j.clear(),U.current=null)}function Pe(se){Ue(se,Re)}const ee=At(h),pe=Ds(r&&Ds(Tt(ee,"keydown",H),Tt(ee,"compositionstart",ae),Tt(ee,"compositionend",ie)),k&&Ds(Tt(ee,"click",qe,!0),Tt(ee,"pointerdown",qe,!0),Tt(ee,"pointerup",De,!0),Tt(ee,"pointercancel",De,!0),Tt(ee,"mousedown",qe,!0),Tt(ee,"mouseup",De,!0),Tt(ee,"touchstart",Xe,!0),Tt(ee,"touchmove",ye,!0),Tt(ee,"touchend",Pe,!0)));return()=>{pe(),G.clear(),P.clear(),de(),_.current=!1}},[b,h,r,k,w,g,n,N,A,H,K,C,F,W,x,f,j]),E.useEffect(K,[w,K]);const L=E.useMemo(()=>({onKeyDown:H,onPointerDown:V,onClick:V}),[H,V]),B=E.useMemo(()=>({onKeyDown:H,onPointerDown:ue,onMouseDown:ue,onClickCapture:q,onMouseDownCapture(G){q(),J(G)},onPointerDownCapture(G){q(),J(G)},onMouseUpCapture:q,onTouchEndCapture:q,onTouchMoveCapture:q}),[H,q,J,ue]);return E.useMemo(()=>n?{reference:L,floating:B,trigger:L}:{},[n,L,B])}function _S(e,t,n){let{reference:r,floating:i}=e;const a=as(t),l=G1(t),c=Y1(l),d=Fr(t),f=a==="y",g=r.x+r.width/2-i.width/2,h=r.y+r.height/2-i.height/2,b=r[c]/2-i[c]/2;let x;switch(d){case"top":x={x:g,y:r.y-i.height};break;case"bottom":x={x:g,y:r.y+r.height};break;case"right":x={x:r.x+r.width,y:h};break;case"left":x={x:r.x-i.width,y:h};break;default:x={x:r.x,y:r.y}}const v=da(t);return v&&(x[l]+=b*(v==="end"?1:-1)*(n&&f?-1:1)),x}async function b8(e,t){var n;t===void 0&&(t={});const{x:r,y:i,platform:a,rects:l,elements:c,strategy:d}=e,{boundary:f="clippingAncestors",rootBoundary:g="viewport",elementContext:h="floating",altBoundary:b=!1,padding:x=0}=pi(t,e),v=B3(x),k=c[b?h==="floating"?"reference":"floating":h],C=zc(await a.getClippingRect({element:(n=await(a.isElement==null?void 0:a.isElement(k)))==null||n?k:k.contextElement||await(a.getDocumentElement==null?void 0:a.getDocumentElement(c.floating)),boundary:f,rootBoundary:g,strategy:d})),N=h==="floating"?{x:r,y:i,width:l.floating.width,height:l.floating.height}:l.reference,A=await(a.getOffsetParent==null?void 0:a.getOffsetParent(c.floating)),R=await(a.isElement==null?void 0:a.isElement(A))&&await(a.getScale==null?void 0:a.getScale(A))||{x:1,y:1},M=zc(a.convertOffsetParentRelativeRectToViewportRelativeRect?await a.convertOffsetParentRelativeRectToViewportRelativeRect({elements:c,rect:N,offsetParent:A,strategy:d}):N);return{top:(C.top-M.top+v.top)/R.y,bottom:(M.bottom-C.bottom+v.bottom)/R.y,left:(C.left-M.left+v.left)/R.x,right:(M.right-C.right+v.right)/R.x}}const x8=50,y8=async(e,t,n)=>{const{placement:r="bottom",strategy:i="absolute",middleware:a=[],platform:l}=n,c=l.detectOverflow?l:{...l,detectOverflow:b8},d=await(l.isRTL==null?void 0:l.isRTL(t));let f=await l.getElementRects({reference:e,floating:t,strategy:i}),{x:g,y:h}=_S(f,r,d),b=r,x=0;const v={};for(let w=0;w<a.length;w++){const k=a[w];if(!k)continue;const{name:C,fn:N}=k,{x:A,y:R,data:M,reset:_}=await N({x:g,y:h,initialPlacement:r,placement:b,strategy:i,middlewareData:v,rects:f,platform:c,elements:{reference:e,floating:t}});g=A??g,h=R??h,v[C]={...v[C],...M},_&&x<x8&&(x++,typeof _=="object"&&(_.placement&&(b=_.placement),_.rects&&(f=_.rects===!0?await l.getElementRects({reference:e,floating:t,strategy:i}):_.rects),{x:g,y:h}=_S(f,b,d)),w=-1)}return{x:g,y:h,placement:b,strategy:i,middlewareData:v}},E8=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:i,middlewareData:a,rects:l,initialPlacement:c,platform:d,elements:f}=t,{mainAxis:g=!0,crossAxis:h=!0,fallbackPlacements:b,fallbackStrategy:x="bestFit",fallbackAxisSideDirection:v="none",flipAlignment:w=!0,...k}=pi(e,t);if((n=a.arrow)!=null&&n.alignmentOffset)return{};const C=Fr(i),N=as(c),A=Fr(c)===c,R=await(d.isRTL==null?void 0:d.isRTL(f.floating)),M=b||(A||!w?[Oh(c)]:AD(c)),_=v!=="none";!b&&_&&M.push(...ID(c,w,v,R));const D=[c,...M],I=await d.detectOverflow(t,k),U=[];let j=((r=a.flip)==null?void 0:r.overflows)||[];if(g&&U.push(I[C]),h){const W=ND(i,l,R);U.push(I[W[0]],I[W[1]])}if(j=[...j,{placement:i,overflows:U}],!U.every(W=>W<=0)){var X,K;const W=(((X=a.flip)==null?void 0:X.index)||0)+1,V=D[W];if(V&&(!(h==="alignment"?N!==as(V):!1)||j.every(J=>as(J.placement)===N?J.overflows[0]>0:!0)))return{data:{index:W,overflows:j},reset:{placement:V}};let H=(K=j.filter(q=>q.overflows[0]<=0).sort((q,J)=>q.overflows[1]-J.overflows[1])[0])==null?void 0:K.placement;if(!H)switch(x){case"bestFit":{var F;const q=(F=j.filter(J=>{if(_){const ue=as(J.placement);return ue===N||ue==="y"}return!0}).map(J=>[J.placement,J.overflows.filter(ue=>ue>0).reduce((ue,L)=>ue+L,0)]).sort((J,ue)=>J[1]-ue[1])[0])==null?void 0:F[0];q&&(H=q);break}case"initialPlacement":H=c;break}if(i!==H)return{reset:{placement:H}}}return{}}}};function RS(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function OS(e){return kD.some(t=>e[t]>=0)}const v8=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n,platform:r}=t,{strategy:i="referenceHidden",...a}=pi(e,t);switch(i){case"referenceHidden":{const l=await r.detectOverflow(t,{...a,elementContext:"reference"}),c=RS(l,n.reference);return{data:{referenceHiddenOffsets:c,referenceHidden:OS(c)}}}case"escaped":{const l=await r.detectOverflow(t,{...a,altBoundary:!0}),c=RS(l,n.floating);return{data:{escapedOffsets:c,escaped:OS(c)}}}default:return{}}}}},fN=new Set(["left","top"]);async function T8(e,t){const{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),l=Fr(n),c=da(n),d=as(n)==="y",f=fN.has(l)?-1:1,g=a&&d?-1:1,h=pi(t,e);let{mainAxis:b,crossAxis:x,alignmentAxis:v}=typeof h=="number"?{mainAxis:h,crossAxis:0,alignmentAxis:null}:{mainAxis:h.mainAxis||0,crossAxis:h.crossAxis||0,alignmentAxis:h.alignmentAxis};return c&&typeof v=="number"&&(x=c==="end"?v*-1:v),d?{x:x*g,y:b*f}:{x:b*f,y:x*g}}const S8=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:i,y:a,placement:l,middlewareData:c}=t,d=await T8(t,e);return l===((n=c.offset)==null?void 0:n.placement)&&(r=c.arrow)!=null&&r.alignmentOffset?{}:{x:i+d.x,y:a+d.y,data:{...d,placement:l}}}}},C8=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:i,platform:a}=t,{mainAxis:l=!0,crossAxis:c=!1,limiter:d={fn:N=>{let{x:A,y:R}=N;return{x:A,y:R}}},...f}=pi(e,t),g={x:n,y:r},h=await a.detectOverflow(t,f),b=as(i),x=q1(b);let v=g[x],w=g[b];const k=(N,A)=>j3(A+h[N==="y"?"top":"left"],A,A-h[N==="y"?"bottom":"right"]);l&&(v=k(x,v)),c&&(w=k(b,w));const C=d.fn({...t,[x]:v,[b]:w});return{...C,data:{x:C.x-n,y:C.y-r,enabled:{[x]:l,[b]:c}}}}}},k8=function(e){return e===void 0&&(e={}),{options:e,fn(t){var n,r;const{x:i,y:a,placement:l,rects:c,middlewareData:d}=t,{offset:f=0,mainAxis:g=!0,crossAxis:h=!0}=pi(e,t),b={x:i,y:a},x=as(l),v=q1(x);let w=b[v],k=b[x];const C=pi(f,t),N=typeof C=="number"?{mainAxis:C,crossAxis:0}:{mainAxis:(n=C.mainAxis)!=null?n:0,crossAxis:(r=C.crossAxis)!=null?r:0};if(g){const M=v==="y"?"height":"width",_=c.reference[v]-c.floating[M]+N.mainAxis,D=c.reference[v]+c.reference[M]-N.mainAxis;w<_?w=_:w>D&&(w=D)}if(h){var A,R;const M=v==="y"?"width":"height",_=fN.has(Fr(l)),D=c.reference[x]-c.floating[M]+(_&&((A=d.offset)==null?void 0:A[x])||0)+(_?0:N.crossAxis),I=c.reference[x]+c.reference[M]+(_?0:((R=d.offset)==null?void 0:R[x])||0)-(_?N.crossAxis:0);k<D?k=D:k>I&&(k=I)}return{[v]:w,[x]:k}}}},w8=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){const{placement:n,rects:r,platform:i,elements:a}=t,{apply:l=()=>{},...c}=pi(e,t),d=await i.detectOverflow(t,c),f=Fr(n),g=da(n),h=as(n)==="y",{width:b,height:x}=r.floating;let v,w;f==="top"||f==="bottom"?(v=f,w=g===(await(i.isRTL==null?void 0:i.isRTL(a.floating))?"start":"end")?"left":"right"):(w=f,v=g==="end"?"top":"bottom");const k=x-d.top-d.bottom,C=b-d.left-d.right,N=Ll(x-d[v],k),A=Ll(b-d[w],C),R=t.middlewareData.shift,M=!R;let _=N,D=A;R!=null&&R.enabled.x&&(D=C),R!=null&&R.enabled.y&&(_=k),M&&!g&&(h?D=b-2*di(d.left,d.right):_=x-2*di(d.top,d.bottom)),await l({...t,availableWidth:D,availableHeight:_});const I=await i.getDimensions(a.floating);return b!==I.width||x!==I.height?{reset:{rects:!0}}:{}}}};function hN(e){const t=Vr(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const i=cn(e),a=i?e.offsetWidth:n,l=i?e.offsetHeight:r,c=Rh(n)!==a||Rh(r)!==l;return c&&(n=a,r=l),{width:n,height:r,$:c}}function rx(e){return St(e)?e:e.contextElement}function kl(e){const t=rx(e);if(!cn(t))return fi(1);const n=t.getBoundingClientRect(),{width:r,height:i,$:a}=hN(t);let l=(a?Rh(n.width):n.width)/r,c=(a?Rh(n.height):n.height)/i;return(!l||!Number.isFinite(l))&&(l=1),(!c||!Number.isFinite(c))&&(c=1),{x:l,y:c}}const N8=fi(0);function pN(e){const t=sn(e);return!B1()||!t.visualViewport?N8:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function A8(e,t,n){return t===void 0&&(t=!1),!!n&&t&&n===sn(e)}function oo(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const i=e.getBoundingClientRect(),a=rx(e);let l=fi(1);t&&(r?St(r)&&(l=kl(r)):l=kl(e));const c=A8(a,n,r)?pN(a):fi(0);let d=(i.left+c.x)/l.x,f=(i.top+c.y)/l.y,g=i.width/l.x,h=i.height/l.y;if(a&&r){const b=sn(a),x=St(r)?sn(r):r;let v=b,w=_b(v);for(;w&&x!==v;){const k=kl(w),C=w.getBoundingClientRect(),N=Vr(w),A=C.left+(w.clientLeft+parseFloat(N.paddingLeft))*k.x,R=C.top+(w.clientTop+parseFloat(N.paddingTop))*k.y;d*=k.x,f*=k.y,g*=k.x,h*=k.y,d+=A,f+=R,v=sn(w),w=_b(v)}}return zc({width:g,height:h,x:d,y:f})}function Ep(e,t){const n=cp(e).scrollLeft;return t?t.left+n:oo(bi(e)).left+n}function mN(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-Ep(e,n),i=n.top+t.scrollTop;return{x:r,y:i}}function _8(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e;const a=i==="fixed",l=bi(r),c=t?up(t.floating):!1;if(r===l||c&&a)return n;let d={scrollLeft:0,scrollTop:0},f=fi(1);const g=fi(0),h=cn(r);if((h||!a)&&((nr(r)!=="body"||Eo(l))&&(d=cp(r)),h)){const x=oo(r);f=kl(r),g.x=x.x+r.clientLeft,g.y=x.y+r.clientTop}const b=l&&!h&&!a?mN(l,d):fi(0);return{width:n.width*f.x,height:n.height*f.y,x:n.x*f.x-d.scrollLeft*f.x+g.x+b.x,y:n.y*f.y-d.scrollTop*f.y+g.y+b.y}}function R8(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function O8(e){const t=cp(e),n=e.ownerDocument.body,r=di(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),i=di(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight);let a=-t.scrollLeft+Ep(e);const l=-t.scrollTop;return Vr(n).direction==="rtl"&&(a+=di(e.clientWidth,n.clientWidth)-r),{width:r,height:i,x:a,y:l}}const I8=25;function M8(e,t,n){n===void 0&&(n="viewport");const r=n==="layoutViewport",i=sn(e),a=bi(e),l=i.visualViewport;let c=a.clientWidth,d=a.clientHeight,f=0,g=0;if(l){const b=!B1()||t==="fixed";r?b||(f=-l.offsetLeft,g=-l.offsetTop):(c=l.width,d=l.height,b&&(f=l.offsetLeft,g=l.offsetTop))}if(Ep(a)<=0){const b=a.ownerDocument,x=b.body,v=getComputedStyle(x),w=b.compatMode==="CSS1Compat"&&parseFloat(v.marginLeft)+parseFloat(v.marginRight)||0,k=Math.abs(a.clientWidth-x.clientWidth-w),C=getComputedStyle(a).scrollbarGutter==="stable both-edges"?k/2:k;C<=I8&&(c-=C)}return{width:c,height:d,x:f,y:g}}function L8(e,t){const n=oo(e,!0,t==="fixed"),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=kl(e),l=e.clientWidth*a.x,c=e.clientHeight*a.y,d=i*a.x,f=r*a.y;return{width:l,height:c,x:d,y:f}}function IS(e,t,n){let r;if(t==="viewport"||t==="layoutViewport")r=M8(e,n,t);else if(t==="document")r=O8(bi(e));else if(St(t))r=L8(t,n);else{const i=pN(e);r={x:t.x-i.x,y:t.y-i.y,width:t.width,height:t.height}}return zc(r)}function D8(e,t){const n=t.get(e);if(n)return n;let r=Hc(e,[],!1).filter(c=>St(c)&&nr(c)!=="body"),i=null;const a=Vr(e).position==="fixed";let l=a?hi(e):e;for(;St(l)&&!ci(l);){const c=Vr(l),d=j1(l),f=i?i.position:a?"fixed":"";!d&&(f==="fixed"||f==="absolute"&&c.position==="static")?r=r.filter(h=>h!==l):i=c,l=hi(l)}return t.set(e,r),r}function P8(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e;const l=[...n==="clippingAncestors"?up(t)?[]:D8(t,this._c):[].concat(n),r],c=IS(t,l[0],i);let d=c.top,f=c.right,g=c.bottom,h=c.left;for(let b=1;b<l.length;b++){const x=IS(t,l[b],i);d=di(x.top,d),f=Ll(x.right,f),g=Ll(x.bottom,g),h=di(x.left,h)}return{width:f-h,height:g-d,x:h,y:d}}function j8(e){const{width:t,height:n}=hN(e);return{width:t,height:n}}function B8(e,t,n){const r=cn(t),i=bi(t),a=n==="fixed",l=oo(e,!0,a,t);let c={scrollLeft:0,scrollTop:0};const d=fi(0);if((r||!a)&&((nr(t)!=="body"||Eo(i))&&(c=cp(t)),r)){const b=oo(t,!0,a,t);d.x=b.x+t.clientLeft,d.y=b.y+t.clientTop}!r&&i&&(d.x=Ep(i));const f=i&&!r&&!a?mN(i,c):fi(0),g=l.left+c.scrollLeft-d.x-f.x,h=l.top+c.scrollTop-d.y-f.y;return{x:g,y:h,width:l.width,height:l.height}}function O0(e){return Vr(e).position==="static"}function MS(e,t){if(!cn(e)||Vr(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return bi(e)===n&&(n=n.ownerDocument.body),n}function gN(e,t){const n=sn(e);if(up(e))return n;if(!cn(e)){let i=hi(e);for(;i&&!ci(i);){if(St(i)&&!O0(i))return i;i=hi(i)}return n}let r=MS(e,t);for(;r&&eD(r)&&O0(r);)r=MS(r,t);return r&&ci(r)&&O0(r)&&!j1(r)?n:r||rD(e)||n}const H8=async function(e){const t=this.getOffsetParent||gN,n=this.getDimensions,r=await n(e.floating);return{reference:B8(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function U8(e){return Vr(e).direction==="rtl"}const bN={convertOffsetParentRelativeRectToViewportRelativeRect:_8,getDocumentElement:bi,getClippingRect:P8,getOffsetParent:gN,getElementRects:H8,getClientRects:R8,getDimensions:j8,getScale:kl,isElement:St,isRTL:U8};function xN(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function z8(e,t,n){let r=null,i;const a=bi(e);function l(){var g;clearTimeout(i),(g=r)==null||g.disconnect(),r=null}function c(g,h){g===void 0&&(g=!1),h===void 0&&(h=1),l();const b=e.getBoundingClientRect(),{left:x,top:v,width:w,height:k}=b;if(g||t(),!w||!k)return;const C=Pf(v),N=Pf(a.clientWidth-(x+w)),A=Pf(a.clientHeight-(v+k)),R=Pf(x),_={rootMargin:-C+"px "+-N+"px "+-A+"px "+-R+"px",threshold:di(0,Ll(1,h))||1};let D=!0;function I(U){const j=U[0].intersectionRatio;if(!xN(b,e.getBoundingClientRect()))return c();if(j!==h){if(!D)return c();j?c(!1,j):i=setTimeout(()=>{c(!1,1e-7)},1e3)}D=!1}try{r=new IntersectionObserver(I,{..._,root:a.ownerDocument})}catch{r=new IntersectionObserver(I,_)}r.observe(e)}const d=sn(e),f=()=>c(n);return d.addEventListener("resize",f),c(!0),()=>{d.removeEventListener("resize",f),l()}}function LS(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:l=typeof ResizeObserver=="function",layoutShift:c=typeof IntersectionObserver=="function",animationFrame:d=!1}=r,f=rx(e),g=i||a?[...f?Hc(f):[],...t?Hc(t):[]]:[];g.forEach(C=>{i&&C.addEventListener("scroll",n),a&&C.addEventListener("resize",n)});const h=f&&c?z8(f,n,a):null;let b=-1,x=null;l&&(x=new ResizeObserver(C=>{let[N]=C;N&&N.target===f&&x&&t&&(x.unobserve(t),cancelAnimationFrame(b),b=requestAnimationFrame(()=>{var A;(A=x)==null||A.observe(t)})),n()}),f&&!d&&x.observe(f),t&&x.observe(t));let v,w=d?oo(e):null;d&&k();function k(){const C=oo(e);w&&!xN(w,C)&&n(),w=C,v=requestAnimationFrame(k)}return n(),()=>{var C;g.forEach(N=>{i&&N.removeEventListener("scroll",n),a&&N.removeEventListener("resize",n)}),h?.(),(C=x)==null||C.disconnect(),x=null,d&&cancelAnimationFrame(v)}}const F8=S8,$8=C8,V8=E8,q8=w8,Y8=v8,G8=k8,X8=(e,t,n)=>{const r=new Map,i=n??{},a={...bN,...i.platform,_c:r};return y8(e,t,{...i,platform:a})};var K8=typeof document<"u",Q8=function(){},hh=K8?E.useLayoutEffect:Q8;function Lh(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!Lh(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){const a=i[r];if(!(a==="_owner"&&e.$$typeof)&&!Lh(e[a],t[a]))return!1}return!0}return e!==e&&t!==t}function yN(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function DS(e,t){const n=yN(e);return Math.round(t*n)/n}function I0(e){const t=E.useRef(e);return hh(()=>{t.current=e}),t}function W8(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:i,elements:{reference:a,floating:l}={},transform:c=!0,whileElementsMounted:d,open:f}=e,[g,h]=E.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[b,x]=E.useState(r);Lh(b,r)||x(r);const[v,w]=E.useState(null),[k,C]=E.useState(null),N=E.useCallback(J=>{J!==_.current&&(_.current=J,w(J))},[]),A=E.useCallback(J=>{J!==D.current&&(D.current=J,C(J))},[]),R=a||v,M=l||k,_=E.useRef(null),D=E.useRef(null),I=E.useRef(g),U=d!=null,j=I0(d),X=I0(i),K=I0(f),F=E.useCallback(()=>{if(!_.current||!D.current)return;const J={placement:t,strategy:n,middleware:b};X.current&&(J.platform=X.current),X8(_.current,D.current,J).then(ue=>{const L={...ue,isPositioned:K.current!==!1};W.current&&!Lh(I.current,L)&&(I.current=L,br.flushSync(()=>{h(L)}))})},[b,t,n,X,K]);hh(()=>{f===!1&&I.current.isPositioned&&(I.current.isPositioned=!1,h(J=>({...J,isPositioned:!1})))},[f]);const W=E.useRef(!1);hh(()=>(W.current=!0,()=>{W.current=!1}),[]),hh(()=>{if(R&&(_.current=R),M&&(D.current=M),R&&M){if(j.current)return j.current(R,M,F);F()}},[R,M,F,j,U]);const V=E.useMemo(()=>({reference:_,floating:D,setReference:N,setFloating:A}),[N,A]),H=E.useMemo(()=>({reference:R,floating:M}),[R,M]),q=E.useMemo(()=>{const J={position:n,left:0,top:0};if(!H.floating)return J;const ue=DS(H.floating,g.x),L=DS(H.floating,g.y);return c?{...J,transform:"translate("+ue+"px, "+L+"px)",...yN(H.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:ue,top:L}},[n,c,H.floating,g.x,g.y]);return E.useMemo(()=>({...g,update:F,refs:V,elements:H,floatingStyles:q}),[g,F,V,H,q])}const Z8=(e,t)=>{const n=F8(e);return{name:n.name,fn:n.fn,options:[e,t]}},J8=(e,t)=>{const n=$8(e);return{name:n.name,fn:n.fn,options:[e,t]}},eP=(e,t)=>({fn:G8(e).fn,options:[e,t]}),tP=(e,t)=>{const n=V8(e);return{name:n.name,fn:n.fn,options:[e,t]}},nP=(e,t)=>{const n=q8(e);return{name:n.name,fn:n.fn,options:[e,t]}},rP=(e,t)=>{const n=Y8(e);return{name:n.name,fn:n.fn,options:[e,t]}},sP={open:Be(e=>e.open),transitionStatus:Be(e=>e.transitionStatus),domReferenceElement:Be(e=>e.domReferenceElement),referenceElement:Be(e=>e.positionReference??e.referenceElement),floatingElement:Be(e=>e.floatingElement),floatingId:Be(e=>e.floatingId)};class vp extends op{constructor(t){const{syncOnly:n,nested:r,onOpenChange:i,triggerElements:a,...l}=t;super({...l,positionReference:l.referenceElement,domReferenceElement:l.referenceElement},{onOpenChange:i,dataRef:{current:{}},events:lN(),nested:r,triggerElements:a},sP),this.syncOnly=n}syncOpenEvent=(t,n)=>{(!t||!this.state.open||n!=null&&hD(n))&&(this.context.dataRef.current.openEvent=t?n:void 0)};dispatchOpenChange=(t,n)=>{this.syncOpenEvent(t,n.event);const r={open:t,reason:n.reason,nativeEvent:n.event,nested:this.context.nested,triggerElement:n.trigger};this.context.events.emit("openchange",r)};setOpen=(t,n)=>{if(this.syncOnly){this.context.onOpenChange?.(t,n);return}this.dispatchOpenChange(t,n),this.context.onOpenChange?.(t,n)}}function EN(e){const{popupStore:t,treatPopupAsFloatingElement:n=!1,floatingRootContext:r,floatingId:i,nested:a,onOpenChange:l}=e,c=t.useState("open"),d=t.useState("activeTriggerElement"),f=t.useState(n?"popupElement":"positionerElement"),g=t.context.triggerElements,h=l,b=E.useRef(null);r===void 0&&b.current===null&&(b.current=new vp({open:c,transitionStatus:void 0,referenceElement:d,floatingElement:f,triggerElements:g,onOpenChange:h,floatingId:i,syncOnly:!0,nested:a}));const x=r??b.current;return t.useSyncedValue("floatingId",i),Ye(()=>{const v={open:c,floatingId:i,referenceElement:d,floatingElement:f};St(d)&&(v.domReferenceElement=d),x.state.positionReference===x.state.referenceElement&&(v.positionReference=d),x.update(v)},[c,i,d,f,x]),x.context.onOpenChange=h,x.context.nested=a,x}function sx(e,t=!1,n=!1){const[r,i]=E.useState(e&&t?"idle":void 0),[a,l]=E.useState(e);return e&&!a&&(l(!0),i("starting")),!e&&a&&r!=="ending"&&!n&&i("ending"),!e&&!a&&r==="ending"&&i(void 0),Ye(()=>{if(!e&&a&&r!=="ending"&&n){const c=As.request(()=>{i("ending")});return()=>{As.cancel(c)}}},[e,a,r,n]),Ye(()=>{if(!e||t)return;const c=As.request(()=>{i(void 0)});return()=>{As.cancel(c)}},[t,e]),Ye(()=>{if(!e||!t)return;e&&a&&r!=="idle"&&i("starting");const c=As.request(()=>{i("idle")});return()=>{As.cancel(c)}},[t,e,a,r]),{mounted:a,setMounted:l,transitionStatus:r}}let $c=(function(e){return e.startingStyle="data-starting-style",e.endingStyle="data-ending-style",e})({});const iP={[$c.startingStyle]:""},aP={[$c.endingStyle]:""},Vl={transitionStatus(e){return e==="starting"?iP:e==="ending"?aP:null}};function vN(e,t=!1,n=!0){const r=Ol();return tt((i,a=null)=>{r.cancel();const l=si(e);if(l==null)return;const c=l,d=()=>{br.flushSync(i)};if(typeof c.getAnimations!="function"||globalThis.BASE_UI_ANIMATIONS_DISABLED){i();return}function f(){Promise.all(c.getAnimations().map(g=>g.finished)).then(()=>{a?.aborted||d()}).catch(()=>{if(n){a?.aborted||d();return}const g=c.getAnimations();!a?.aborted&&g.length>0&&g.some(h=>h.pending||h.playState!=="finished")&&f()})}if(t){const g=$c.startingStyle;if(!c.hasAttribute(g)){r.request(f);return}const h=new MutationObserver(()=>{c.hasAttribute(g)||(h.disconnect(),f())});h.observe(c,{attributes:!0,attributeFilter:[g]}),a?.addEventListener("abort",()=>h.disconnect(),{once:!0});return}r.request(f)})}function vo(e){const{enabled:t=!0,open:n,ref:r,onComplete:i}=e,a=tt(i),l=vN(r,n,!1);E.useEffect(()=>{if(!t)return;const c=new AbortController;return l(a,c.signal),()=>{c.abort()}},[t,n,a,l])}const Tp={tabIndex:-1,[Ob]:""};function oP(e){return t=>t==="touch"?e.current:!0}function TN(e,t,n=!1){const r=ao(),i=fa()!=null,a=E.useRef(null);e===void 0&&a.current===null&&(a.current=t(r,i));const l=e??a.current;return EN({popupStore:l,treatPopupAsFloatingElement:n,floatingRootContext:l.state.floatingRootContext,floatingId:r,nested:i,onOpenChange:l.setOpen}),{store:l,internalStore:a.current}}function lP(e,t){const n=E.useRef(null),r=E.useRef(null);return E.useCallback(i=>{if(e===void 0)return;let a=!1;if(n.current!==null){const l=n.current,c=r.current,d=t.context.triggerElements.getById(l);c&&d===c&&(t.context.triggerElements.delete(l),a=!0),n.current=null,r.current=null}if(i!==null&&(n.current=e,r.current=i,t.context.triggerElements.add(e,i),a=!0),a){const l=t.context.triggerElements.size;t.select("open")&&t.state.triggerCount!==l&&t.set("triggerCount",l)}},[t,e])}function ix(e,t,n,r=!1){t?e.preventUnmountingOnClose=!1:r&&(e.preventUnmountingOnClose=!0);const i=n?.id??null;(i||t)&&(e.activeTriggerId=i,e.activeTriggerElement=n??null)}function SN(e){let t=!1;return e.preventUnmountOnClose=()=>{t=!0},()=>t}function uP(e,t,n,r={}){const i=n.reason,a=i===qn,l=t&&i===Sl,c=!t&&(i===$l||i===bp),d=SN(n);if(e.context.onOpenChange?.(t,n),n.isCanceled)return;r.onBeforeDispatch?.(),e.state.floatingRootContext.dispatchOpenChange(t,n);const f=()=>{const g={...r.extraState,open:t};l?g.instantType="focus":c?g.instantType="dismiss":a&&(g.instantType=void 0),ix(g,t,n.trigger,d()),e.update(g)};a?br.flushSync(f):f()}function CN(e,t,n,r){I1(()=>{t===void 0&&e.state.open===!1&&n&&(e.state={...e.state,open:!0,activeTriggerId:r,preventUnmountingOnClose:!1})})}function ax(e,t,n,r){const i=n.useState("isMountedByTrigger",e),a=lP(e,n),l=tt(c=>{if(a(c),!c)return;const d=n.select("open"),f=n.select("activeTriggerId");if(f===e){n.update({activeTriggerElement:c,...d?r:null});return}f==null&&d&&n.update({activeTriggerId:e,activeTriggerElement:c,...r})});return Ye(()=>{i&&n.update({activeTriggerElement:t.current,...r})},[i,n,t,...Object.values(r)]),{registerTrigger:l,isMountedByThisTrigger:i}}function ox(e,t={}){const{closeOnActiveTriggerUnmount:n=!1}=t,r=e.useState("open"),i=e.useState("triggerCount");Ye(()=>{if(!r){e.state.triggerCount!==0&&e.set("triggerCount",0);return}const a=e.context.triggerElements.size,l={};e.state.triggerCount!==a&&(l.triggerCount=a);const c=e.select("activeTriggerId");let d=null;if(c){const f=e.context.triggerElements.getById(c);f?f!==e.state.activeTriggerElement&&(l.activeTriggerElement=f):d=c}if(!d&&!c&&a===1){const f=e.context.triggerElements.entries().next();if(!f.done){const[g,h]=f.value;l.activeTriggerId=g,l.activeTriggerElement=h}}(l.triggerCount!==void 0||l.activeTriggerId!==void 0||l.activeTriggerElement!==void 0)&&e.update(l),d&&n&&queueMicrotask(()=>{if(e.select("open")&&e.select("activeTriggerId")===d&&!e.context.triggerElements.getById(d)){const f=pt(Fl);e.setOpen(!1,f),f.isCanceled||e.update({activeTriggerId:null,activeTriggerElement:null})}})},[r,e,i,n])}function lx(e,t,n){const{mounted:r,setMounted:i,transitionStatus:a}=sx(e),l=t.useState("preventUnmountingOnClose"),c=e?!1:l;t.useSyncedValues({mounted:r,transitionStatus:a,preventUnmountingOnClose:c});const d=tt(()=>{i(!1),t.update({activeTriggerId:null,activeTriggerElement:null,mounted:!1,preventUnmountingOnClose:!1}),n?.(),t.context.onOpenChangeComplete?.(!1)});return vo({enabled:r&&!e&&!c,open:e,ref:t.context.popupRef,onComplete(){e||d()}}),{forceUnmount:d,transitionStatus:a}}function ux(e,t){e.useSyncedValues(t),Ye(()=>()=>{e.update({activeTriggerProps:dn,inactiveTriggerProps:dn,popupProps:dn})},[e])}function cP(e,t){Ye(()=>{!t&&e.state.openMethod!==null&&e.set("openMethod",null)},[t,e]),Ye(()=>()=>{e.state.openMethod!==null&&e.set("openMethod",null)},[e])}class Jc{constructor(){this.elementsSet=new Set,this.idMap=new Map}add(t,n){const r=this.idMap.get(t);r!==n&&(r!==void 0&&this.elementsSet.delete(r),this.elementsSet.add(n),this.idMap.set(t,n))}delete(t){const n=this.idMap.get(t);n&&(this.elementsSet.delete(n),this.idMap.delete(t))}hasElement(t){return this.elementsSet.has(t)}hasMatchingElement(t){for(const n of this.elementsSet)if(t(n))return!0;return!1}getById(t){return this.idMap.get(t)}entries(){return this.idMap.entries()}elements(){return this.elementsSet.values()}get size(){return this.idMap.size}}function dP(){return new vp({open:!1,transitionStatus:void 0,floatingElement:null,referenceElement:null,triggerElements:new Jc,floatingId:void 0,syncOnly:!1,nested:!1,onOpenChange:void 0})}function cx(){return{open:!1,openProp:void 0,mounted:!1,transitionStatus:void 0,floatingRootContext:dP(),floatingId:void 0,triggerCount:0,preventUnmountingOnClose:!1,payload:void 0,activeTriggerId:null,activeTriggerElement:null,triggerIdProp:void 0,popupElement:null,positionerElement:null,activeTriggerProps:dn,inactiveTriggerProps:dn,popupProps:dn}}function kN(e,t,n=!1){return new vp({open:!1,transitionStatus:void 0,floatingElement:null,referenceElement:null,triggerElements:e,floatingId:t,syncOnly:!0,nested:n,onOpenChange:void 0})}const Tc=Be(e=>e.triggerIdProp??e.activeTriggerId),dx=Be(e=>e.openProp??e.open),PS=Be(e=>(e.popupElement?.id??e.floatingId)||void 0);function wN(e,t){return t!==void 0&&dx(e)&&Tc(e)===t}function fP(e,t){return wN(e,t)?!0:t!==void 0&&dx(e)&&Tc(e)==null&&e.triggerCount===1}const fx={open:dx,mounted:Be(e=>e.mounted),transitionStatus:Be(e=>e.transitionStatus),floatingRootContext:Be(e=>e.floatingRootContext),triggerCount:Be(e=>e.triggerCount),preventUnmountingOnClose:Be(e=>e.preventUnmountingOnClose),payload:Be(e=>e.payload),activeTriggerId:Tc,activeTriggerElement:Be(e=>e.mounted?e.activeTriggerElement:null),popupId:PS,isTriggerActive:Be((e,t)=>t!==void 0&&Tc(e)===t),isOpenedByTrigger:Be((e,t)=>wN(e,t)),isMountedByTrigger:Be((e,t)=>t!==void 0&&Tc(e)===t&&e.mounted),triggerProps:Be((e,t)=>t?e.activeTriggerProps:e.inactiveTriggerProps),triggerPopupId:Be((e,t)=>fP(e,t)?PS(e):void 0),popupProps:Be(e=>e.popupProps),popupElement:Be(e=>e.popupElement),positionerElement:Be(e=>e.positionerElement)};function NN(e){const{open:t=!1,onOpenChange:n,elements:r={}}=e,i=ao(),a=fa()!=null,l=xr(()=>new vp({open:t,transitionStatus:void 0,onOpenChange:n,referenceElement:r.reference??null,floatingElement:r.floating??null,triggerElements:new Jc,floatingId:i,syncOnly:!1,nested:a})).current;return Ye(()=>{const c={open:t,floatingId:i};r.reference!==void 0&&(c.referenceElement=r.reference,c.domReferenceElement=St(r.reference)?r.reference:null),r.floating!==void 0&&(c.floatingElement=r.floating),l.update(c)},[t,i,r.reference,r.floating,l]),l.context.onOpenChange=n,l.context.nested=a,l}function hP(e={}){const{nodeId:t,externalTree:n}=e,r=NN(e),i=e.rootContext||r,a=i.useState("referenceElement"),l=i.useState("floatingElement"),c=i.useState("domReferenceElement"),d=i.useState("open"),f=i.useState("floatingId"),[g,h]=E.useState(null),[b,x]=E.useState(void 0),[v,w]=E.useState(void 0),k=E.useRef(null),C=ha(n),N=E.useMemo(()=>({reference:a,floating:l,domReference:c}),[a,l,c]),A=W8({...e,elements:{...N,...g&&{reference:g}}}),R=St(b)?b:null,M=v===void 0?i.state.floatingElement:v;i.useSyncedValue("referenceElement",b??null),i.useSyncedValue("domReferenceElement",b===void 0?c:R),i.useSyncedValue("floatingElement",M);const _=E.useCallback(K=>{const F=St(K)?{getBoundingClientRect:()=>K.getBoundingClientRect(),getClientRects:()=>K.getClientRects(),contextElement:K}:K;h(F),A.refs.setReference(F)},[A.refs]),D=E.useCallback(K=>{(St(K)||K===null)&&(k.current=K,x(K)),(St(A.refs.reference.current)||A.refs.reference.current===null||K!==null&&!St(K))&&A.refs.setReference(K)},[A.refs,x]),I=E.useCallback(K=>{w(K),A.refs.setFloating(K)},[A.refs]),U=E.useMemo(()=>({...A.refs,setReference:D,setFloating:I,setPositionReference:_,domReference:k}),[A.refs,D,I,_]),j=E.useMemo(()=>({...A.elements,domReference:c}),[A.elements,c]),X=E.useMemo(()=>({...A,dataRef:i.context.dataRef,open:d,onOpenChange:i.setOpen,events:i.context.events,floatingId:f,refs:U,elements:j,nodeId:t,rootStore:i}),[A,U,j,t,i,d,f]);return Ye(()=>{c&&(k.current=c)},[c]),Ye(()=>{i.context.dataRef.current.floatingContext=X;const K=C?.nodesRef.current.find(F=>F.id===t);K&&(K.context=X)}),E.useMemo(()=>({...A,context:X,refs:U,elements:j,rootStore:i}),[A,U,j,X,i])}const M0=U1&&ca;function AN(e,t={}){const{enabled:n=!0,delay:r}=t,i="rootStore"in e?e.rootStore:e,{events:a,dataRef:l}=i.context,c=E.useRef(!1),d=E.useRef(null),f=E.useRef(!0),g=Gn();E.useEffect(()=>{const b=i.select("domReferenceElement");if(!n)return;const x=sn(b);function v(){const C=i.select("domReferenceElement");!i.select("open")&&cn(C)&&C===Rr(At(C))&&(c.current=!0)}function w(){f.current=!0}function k(){f.current=!1}return Ds(Tt(x,"blur",v),M0&&Tt(x,"keydown",w,!0),M0&&Tt(x,"pointerdown",k,!0))},[i,n]),E.useEffect(()=>{if(!n)return;function b(x){if(x.reason===$l||x.reason===bp){const v=i.select("domReferenceElement");St(v)&&(d.current=v,c.current=!0)}}return a.on("openchange",b),()=>{a.off("openchange",b)}},[a,n,i]);const h=E.useMemo(()=>{function b(){c.current=!1,d.current=null}return{onMouseLeave(){b()},onFocus(x){const v=x.currentTarget;if(c.current){if(d.current===v)return;b()}const w=mr(x.nativeEvent);if(St(w)){if(M0&&!x.relatedTarget){if(!f.current&&!mp(w))return}else if(!gD(w))return}const k=Ah(x.relatedTarget,i.context.triggerElements),{nativeEvent:C,currentTarget:N}=x,A=typeof r=="function"?r():r;if(i.select("open")&&k||A===0||A===void 0){i.setOpen(!0,pt(Sl,C,N));return}g.start(A,()=>{c.current||i.setOpen(!0,pt(Sl,C,N))})},onBlur(x){b();const v=x.relatedTarget,w=x.nativeEvent,k=St(v)&&v.hasAttribute(Fc("focus-guard"))&&v.getAttribute("data-type")==="outside";g.start(0,()=>{const C=i.select("domReferenceElement"),N=Rr(At(C));!v&&N===C||nt(l.current.floatingContext?.refs.floating.current,N)||nt(C,N)||k||Ah(v??N,i.context.triggerElements)||i.setOpen(!1,pt(Sl,w))})}}},[l,r,i,g]);return E.useMemo(()=>n?{reference:h,trigger:h}:{},[n,h])}class hx{constructor(){this.pointerType=void 0,this.interactedInside=!1,this.handler=void 0,this.blockMouseMove=!0,this.performedPointerEventsMutation=!1,this.pointerEventsScopeElement=null,this.pointerEventsReferenceElement=null,this.pointerEventsFloatingElement=null,this.restTimeoutPending=!1,this.openChangeTimeout=new ps,this.restTimeout=new ps,this.handleCloseOptions=void 0}static create(){return new hx}dispose=()=>{this.openChangeTimeout.clear(),this.restTimeout.clear()};disposeEffect=()=>this.dispose}const Dh=new WeakMap;function Ph(e){if(!e.performedPointerEventsMutation)return;const t=e.pointerEventsScopeElement;t&&Dh.get(t)===e&&(e.pointerEventsScopeElement?.style.removeProperty("pointer-events"),e.pointerEventsReferenceElement?.style.removeProperty("pointer-events"),e.pointerEventsFloatingElement?.style.removeProperty("pointer-events"),Dh.delete(t)),e.performedPointerEventsMutation=!1,e.pointerEventsScopeElement=null,e.pointerEventsReferenceElement=null,e.pointerEventsFloatingElement=null}function _N(e,t){const{scopeElement:n,referenceElement:r,floatingElement:i}=t,a=Dh.get(n);a&&a!==e&&Ph(a),Ph(e),e.performedPointerEventsMutation=!0,e.pointerEventsScopeElement=n,e.pointerEventsReferenceElement=r,e.pointerEventsFloatingElement=i,Dh.set(n,e),n.style.pointerEvents="none",r.style.pointerEvents="auto",i.style.pointerEvents="auto"}function px(e){const t=e.context.dataRef.current,n=xr(()=>t.hoverInteractionState??hx.create()).current;return t.hoverInteractionState||(t.hoverInteractionState=n),H1(t.hoverInteractionState.disposeEffect),t.hoverInteractionState}function RN(e,t={}){const{enabled:n=!0,closeDelay:r=0,nodeId:i}=t,a="rootStore"in e?e.rootStore:e,l=a.useState("open"),c=a.useState("floatingElement"),d=a.useState("domReferenceElement"),{dataRef:f}=a.context,g=ha(),h=fa(),b=px(a),x=Gn(),v=tt(()=>L3(f.current.openEvent?.type,b.interactedInside)),w=tt(()=>xD(f.current.openEvent?.type)),k=tt(()=>{Ph(b)});Ye(()=>{l||(b.pointerType=void 0,b.restTimeoutPending=!1,b.interactedInside=!1,k())},[l,b,k]),E.useEffect(()=>k,[k]),Ye(()=>{if(n&&l&&b.handleCloseOptions?.blockPointerEvents&&w()&&St(d)&&c){const C=d,N=c,A=At(c),R=g?.nodesRef.current.find(I=>I.id===h)?.context?.elements.floating;R&&(R.style.pointerEvents="");const M=b.pointerEventsScopeElement!==N?b.pointerEventsScopeElement:null,_=R!==N?R:null,D=b.handleCloseOptions?.getScope?.()??M??_??C.closest("[data-rootownerid]")??A.body;return _N(b,{scopeElement:D,referenceElement:C,floatingElement:N}),()=>{k()}}},[n,l,d,c,b,w,g,h,k]),E.useEffect(()=>{if(!n)return;function C(){return!!(g&&h&&sa(g.nodesRef.current,h).length>0)}function N(I){const U=Il(r,"close",b.pointerType),j=()=>{a.setOpen(!1,pt(qn,I)),g?.events.emit("floating.closed",I)};U?b.openChangeTimeout.start(U,j):(b.openChangeTimeout.clear(),j())}function A(I){const U=mr(I);if(!mD(U)){b.interactedInside=!1;return}b.interactedInside=U?.closest("[aria-haspopup]")!=null}function R(){b.openChangeTimeout.clear(),x.clear(),g?.events.off("floating.closed",_),k()}function M(I){if(C()&&g){g.events.on("floating.closed",_);return}if(Ah(I.relatedTarget,a.context.triggerElements))return;const U=f.current.floatingContext?.nodeId??i,j=I.relatedTarget;if(!(g&&U&&St(j)&&sa(g.nodesRef.current,U,!1).some(K=>nt(K.context?.elements.floating,j)))){if(b.handler){b.handler(I);return}k(),w()&&!v()&&N(I)}}function _(I){!g||!h||C()||x.start(0,()=>{g.events.off("floating.closed",_),a.setOpen(!1,pt(qn,I)),g.events.emit("floating.closed",I)})}const D=c;return Ds(D&&Tt(D,"mouseenter",R),D&&Tt(D,"mouseleave",M),D&&Tt(D,"pointerdown",A,!0),()=>{g?.events.off("floating.closed",_)})},[n,c,a,f,r,i,w,v,k,b,g,h,x])}const pP={current:null};function ON(e,t={}){const{enabled:n=!0,delay:r=0,handleClose:i=null,mouseOnly:a=!1,restMs:l=0,move:c=!0,triggerElementRef:d=pP,externalTree:f,isActiveTrigger:g=!0,getHandleCloseContext:h,isClosing:b,shouldOpen:x}=t,v="rootStore"in e?e.rootStore:e,{dataRef:w,events:k}=v.context,C=ha(f),N=px(v),A=E.useRef(!1),R=En(i),M=En(r),_=En(l),D=En(n),I=En(x),U=En(b),j=tt(()=>L3(w.current.openEvent?.type,N.interactedInside)),X=tt(()=>I.current?.()!==!1),K=tt((V,H,q)=>{const J=v.context.triggerElements;if(J.hasElement(H))return!V||!nt(V,H);if(!St(q))return!1;const ue=q;return J.hasMatchingElement(L=>nt(L,ue))&&(!V||!nt(V,ue))}),F=tt(()=>{if(!N.handler)return;At(v.select("domReferenceElement")).removeEventListener("mousemove",N.handler),N.handler=void 0}),W=tt(()=>{Ph(N)});return g&&(N.handleCloseOptions=R.current?.__options),E.useEffect(()=>F,[F]),E.useEffect(()=>{if(!n)return;function V(H){H.open?A.current=!1:(A.current=H.reason===qn,F(),N.openChangeTimeout.clear(),N.restTimeout.clear(),N.blockMouseMove=!0,N.restTimeoutPending=!1)}return k.on("openchange",V),()=>{k.off("openchange",V)}},[n,k,N,F]),E.useEffect(()=>{if(!n)return;function V(ue,L=!0){const B=Il(M.current,"close",N.pointerType);B?N.openChangeTimeout.start(B,()=>{v.setOpen(!1,pt(qn,ue)),C?.events.emit("floating.closed",ue)}):L&&(N.openChangeTimeout.clear(),v.setOpen(!1,pt(qn,ue)),C?.events.emit("floating.closed",ue))}const H=d.current??(g?v.select("domReferenceElement"):null);if(!St(H))return;function q(ue){if(N.openChangeTimeout.clear(),N.blockMouseMove=!1,a&&!so(N.pointerType))return;const L=uS(_.current),B=Il(M.current,"open",N.pointerType),G=mr(ue),P=ue.currentTarget??null,ae=v.select("domReferenceElement");let ie=P;if(St(G)&&!v.context.triggerElements.hasElement(G)){for(const Ue of v.context.triggerElements.elements())if(nt(Ue,G)){ie=Ue;break}}St(P)&&St(ae)&&!v.context.triggerElements.hasElement(P)&&nt(P,ae)&&(ie=ae);const ce=ie==null?!1:K(ae,ie,G),de=v.select("open"),he=U.current?.()??v.select("transitionStatus")==="ending",ve=!de&&he&&A.current,Fe=!ce&&St(ie)&&St(ae)&&nt(ae,ie)&&ve,Le=L>0&&!B,Ee=ce&&(de||ve)||Fe,Oe=!de||ce;if(Ee){X()&&v.setOpen(!0,pt(qn,ue,ie));return}Le||(B?N.openChangeTimeout.start(B,()=>{Oe&&X()&&v.setOpen(!0,pt(qn,ue,ie))}):Oe&&X()&&v.setOpen(!0,pt(qn,ue,ie)))}function J(ue){if(j()){W();return}F();const L=v.select("domReferenceElement"),B=At(L);N.restTimeout.clear(),N.restTimeoutPending=!1;const G=w.current.floatingContext??h?.();if(Ah(ue.relatedTarget,v.context.triggerElements))return;if(R.current&&G){v.select("open")||N.openChangeTimeout.clear();const ae=d.current;N.handler=R.current({...G,tree:C,x:ue.clientX,y:ue.clientY,onClose(){W(),F(),D.current&&!j()&&ae===v.select("domReferenceElement")&&V(ue,!0)}}),B.addEventListener("mousemove",N.handler),N.handler(ue);return}(N.pointerType==="touch"?!nt(v.select("floatingElement"),ue.relatedTarget):!0)&&V(ue)}return c?Ds(Tt(H,"mousemove",q,{once:!0}),Tt(H,"mouseenter",q),Tt(H,"mouseleave",J)):Ds(Tt(H,"mouseenter",q),Tt(H,"mouseleave",J))},[F,W,w,M,v,n,R,N,g,K,j,a,c,_,d,C,D,h,U,X]),E.useMemo(()=>{if(!n)return;function V(H){N.pointerType=H.pointerType}return{onPointerDown:V,onPointerEnter:V,onMouseMove(H){const{nativeEvent:q}=H,J=H.currentTarget,ue=v.select("domReferenceElement"),L=v.select("open"),B=K(ue,J,H.target);if(a&&!so(N.pointerType))return;if(L&&B&&N.handleCloseOptions?.blockPointerEvents){const ae=v.select("floatingElement");if(ae){const ie=N.handleCloseOptions?.getScope?.()??J.ownerDocument.body;_N(N,{scopeElement:ie,referenceElement:J,floatingElement:ae})}}const G=uS(_.current);if(L&&!B||G===0||!B&&N.restTimeoutPending&&H.movementX**2+H.movementY**2<2)return;N.restTimeout.clear();function P(){if(N.restTimeoutPending=!1,j())return;const ae=v.select("open");!N.blockMouseMove&&(!ae||B)&&X()&&v.setOpen(!0,pt(qn,q,J))}N.pointerType==="touch"?br.flushSync(()=>{P()}):B&&L?P():(N.restTimeoutPending=!0,N.restTimeout.start(G,P))}}},[n,N,j,K,a,v,_,X])}const mP="Escape";function Sp(e,t,n){switch(e){case"vertical":return t;case"horizontal":return n;default:return t||n}}function Bf(e,t){return Sp(t,e===M3||e===$1,e===hp||e===pp)}function L0(e,t,n){return Sp(t,e===$1,n?e===hp:e===pp)||e==="Enter"||e===" "||e===""}function gP(e,t,n){return Sp(t,n?e===hp:e===pp,e===$1)}function bP(e,t,n,r){const i=n?e===pp:e===hp,a=e===M3;return t==="both"||t==="horizontal"&&r?e===mP:Sp(t,i,a)}function IN(e,t){const{listRef:n,activeIndex:r,onNavigate:i=()=>{},enabled:a=!0,selectedIndex:l=null,allowEscape:c=!1,loopFocus:d=!1,nested:f=!1,rtl:g=!1,virtual:h=!1,focusItemOnOpen:b="auto",focusItemOnHover:x=!0,openOnArrowKeyDown:v=!0,disabledIndices:w=void 0,orientation:k="vertical",parentOrientation:C,id:N,resetOnPointerLeave:A=!0,externalTree:R,grid:M}=t,_=M!=null,D="rootStore"in e?e.rootStore:e,I=D.useState("open"),U=D.useState("floatingElement"),j=D.useState("domReferenceElement"),X=D.context.dataRef,K=_h(U),F=Ib(j),W=En(K),V=fa(),H=ha(R),q=E.useRef(b),J=E.useRef(l??-1),ue=E.useRef(null),L=E.useRef(!0),B=tt(se=>{i(J.current===-1?null:J.current,se)}),G=E.useRef(!!U),P=E.useRef(I),ae=E.useRef(!1),ie=E.useRef(!1),ce=E.useRef(null),de=En(w),he=En(I),ve=En(l),Fe=En(A),Le=Ol(),Ee=Ol(),Oe=tt(()=>{function se(oe){h?H?.events.emit("virtualfocus",oe):ce.current=fh(oe,{sync:ae.current,preventScroll:!0})}const re=n.current[J.current],Q=ie.current;re&&se(re),(ae.current?oe=>oe():oe=>Le.request(oe))(()=>{const oe=n.current[J.current]||re;if(!oe)return;re||se(oe),ye&&(Q||!L.current)&&oe.scrollIntoView?.({block:"nearest",inline:"nearest"})})});Ye(()=>{X.current.orientation=k},[X,k]),Ye(()=>{a&&(I&&U?(J.current=l??-1,q.current&&l!=null&&(ie.current=!0,B())):G.current&&(J.current=-1,B()))},[a,I,U,l,B]),Ye(()=>{if(a){if(!I){ae.current=!1;return}if(U)if(r==null){if(ae.current=!1,ve.current!=null)return;if(G.current&&(J.current=-1,Oe()),(!P.current||!G.current)&&q.current&&(ue.current!=null||q.current===!0&&ue.current==null)){let se=0;const re=()=>{n.current[0]==null?(se<2&&(se?$=>Ee.request($):queueMicrotask)(re),se+=1):(J.current=ue.current==null||L0(ue.current,k,g)||f?N0(n):hS(n),ue.current=null,B())};re()}}else fS(n.current,r)||(J.current=r,Oe(),ie.current=!1)}},[a,I,U,r,ve,f,n,k,g,B,Oe,Ee]),Ye(()=>{if(!a||U||!H||h||!G.current)return;const se=H.nodesRef.current,re=se.find(oe=>oe.id===V)?.context?.elements.floating,Q=Rr(At(j??re??null)),$=se.some(oe=>oe.context&&nt(oe.context.elements.floating,Q));re&&!$&&L.current&&re.focus({preventScroll:!0})},[a,U,j,H,V,h]),Ye(()=>{P.current=I,G.current=!!U}),Ye(()=>{I||(ue.current=null,q.current=b)},[I,b]);const Ue=r!=null,Xe=tt(se=>{if(!he.current)return;const re=n.current.indexOf(se.currentTarget);re!==-1&&(J.current!==re||r!==re)&&(J.current=re,B(se))}),qe=tt(()=>C??H?.nodesRef.current.find(se=>se.id===V)?.context?.dataRef?.current.orientation),De=tt(()=>N0(n,de.current)),ke=tt(se=>{if(L.current=!1,ae.current=!0,se.which===229||!he.current&&se.currentTarget===W.current)return;if(f&&bP(se.key,k,g,_)){Bf(se.key,qe())||Ns(se),D.setOpen(!1,pt(Mb,se.nativeEvent)),cn(j)&&(h?H?.events.emit("virtualfocus",j):j.focus());return}const re=J.current,Q=N0(n,w),$=hS(n,w);if(F||(se.key==="Home"&&(Ns(se),J.current=Q,B(se)),se.key==="End"&&(Ns(se),J.current=$,B(se))),M!=null){const oe=M(se,J.current,n,k,d,g,w,Q,$);if(oe!=null&&(J.current=oe,B(se)),k==="both")return}if(Bf(se.key,k)){if(Ns(se),I&&!h&&Rr(se.currentTarget.ownerDocument)===se.currentTarget){J.current=L0(se.key,k,g)?Q:$,B(se);return}L0(se.key,k,g)?d?re>=$?c&&re!==n.current.length?J.current=-1:(ae.current=!1,J.current=Q):J.current=yl(n.current,{startingIndex:re,disabledIndices:w}):J.current=Math.min($,yl(n.current,{startingIndex:re,disabledIndices:w})):d?re<=Q?c&&re!==-1?J.current=n.current.length:(ae.current=!1,J.current=$):J.current=yl(n.current,{startingIndex:re,decrement:!0,disabledIndices:w}):J.current=Math.max(Q,yl(n.current,{startingIndex:re,decrement:!0,disabledIndices:w})),fS(n.current,J.current)&&(J.current=-1),B(se)}}),ye=E.useMemo(()=>({onFocus(re){ae.current=!0,Xe(re)},onClick:({currentTarget:re})=>re.focus({preventScroll:!0}),onMouseMove(re){ae.current=!0,ie.current=!1,x&&Xe(re)},onPointerLeave(re){if(!he.current||!L.current||re.pointerType==="touch")return;ae.current=!0;const Q=re.relatedTarget;if(!(!x||n.current.includes(Q))&&Fe.current&&(ce.current?.(),ce.current=null,J.current=-1,B(re),!h)){const $=W.current,oe=Rr(At($));$&&nt($,oe)&&$.focus({preventScroll:!0})}}}),[Xe,he,W,x,n,B,Fe,h]),Re=E.useMemo(()=>h&&I&&Ue&&{"aria-activedescendant":`${N}-${r}`},[h,I,Ue,N,r]),Pe=E.useMemo(()=>({"aria-orientation":k==="both"?void 0:k,...F?{}:Re,onKeyDown(se){if(se.key==="Tab"&&se.shiftKey&&I&&!h){const re=mr(se.nativeEvent);if(re&&!nt(W.current,re))return;Ns(se),D.setOpen(!1,pt(io,se.nativeEvent)),cn(j)&&j.focus();return}ke(se)},onPointerMove(){L.current=!0}}),[Re,ke,W,k,F,D,I,h,j]),ee=E.useMemo(()=>{function se($){D.setOpen(!0,pt(Mb,$.nativeEvent,$.currentTarget))}function re($){b==="auto"&&F1($.nativeEvent)&&(q.current=!h)}function Q($){q.current=b,b==="auto"&&O3($.nativeEvent)&&(q.current=!0)}return{onKeyDown($){const oe=D.select("open");L.current=!1;const Se=$.key.startsWith("Arrow"),_e=gP($.key,qe(),g),$e=Bf($.key,k),ot=(f?_e:$e)||$.key==="Enter"||$.key.trim()==="";if(h&&oe)return ke($);if(!(!oe&&!v&&Se)){if(ot){const et=Bf($.key,qe());ue.current=f&&et?null:$.key}if(f){_e&&(Ns($),oe?(J.current=De(),B($)):se($));return}$e&&(ve.current!=null&&(J.current=ve.current),Ns($),!oe&&v?se($):ke($),oe&&B($))}},onFocus($){D.select("open")&&!h&&(J.current=-1,B($))},onPointerDown:Q,onPointerEnter:Q,onMouseDown:re,onClick:re}},[ke,b,De,f,B,D,v,k,qe,g,ve,h]),pe=E.useMemo(()=>({...Re,...ee}),[Re,ee]);return E.useMemo(()=>a?{reference:pe,floating:Pe,item:ye,trigger:ee}:{},[a,pe,Pe,ee,ye])}function MN(e,t){const{listRef:n,elementsRef:r,activeIndex:i,onMatch:a,disabledIndices:l,onTyping:c,enabled:d=!0,resetMs:f=750,selectedIndex:g=null}=t,h="rootStore"in e?e.rootStore:e,b=h.useState("open"),x=Gn(),v=E.useRef(""),w=E.useRef(g??i??-1),k=E.useRef(null),C=tt(R=>{function M(W){const V=r?.current[W];return!V||xp(V)}function _(W){return M(W)?l==null||!H3(_l,W,l):!1}function D(W,V,H=0){if(W.length===0)return-1;const q=(H%W.length+W.length)%W.length,J=V.toLowerCase();for(let ue=0;ue<W.length;ue+=1){const L=(q+ue)%W.length;if(!(!W[L]?.toLowerCase().startsWith(J)||!_(L)))return L}return-1}const I=n.current;if(v.current.length>0&&R.key===" "&&(Ns(R),c?.(!0)),v.current.length>0&&v.current[0]!==" "&&D(I,v.current)===-1&&R.key!==" "&&c?.(!1),I==null||R.key.length!==1||R.ctrlKey||R.metaKey||R.altKey)return;b&&R.key!==" "&&(Ns(R),c?.(!0));const U=v.current==="";U&&(w.current=g??i??-1),I.every((W,V)=>W&&_(V)?W[0]?.toLowerCase()!==W[1]?.toLowerCase():!0)&&v.current===R.key&&(v.current="",w.current=k.current),v.current+=R.key,x.start(f,()=>{v.current="",w.current=k.current,c?.(!1)});const K=((U?g??i??-1:w.current)??0)+1,F=D(I,v.current,K);F!==-1?(a?.(F),k.current=F):R.key!==" "&&(v.current="",c?.(!1))}),N=tt(R=>{const M=R.relatedTarget,_=h.select("domReferenceElement"),D=h.select("floatingElement");nt(_,M)||nt(D,M)||(x.clear(),v.current="",w.current=k.current,c?.(!1))});Ye(()=>{!b&&g!==null||(x.clear(),k.current=null,v.current!==""&&(v.current=""))},[b,g,x]),Ye(()=>{b&&v.current===""&&(w.current=g??i??-1)},[b,g,i]);const A=E.useMemo(()=>({onKeyDown:C,onBlur:N}),[C,N]);return E.useMemo(()=>d?{reference:A,floating:A}:{},[d,A])}const jS=.1,xP=jS*jS,Kt=.5;function Hf(e,t,n,r,i,a){return r>=t!=a>=t&&e<=(i-n)*(t-r)/(a-r)+n}function Uf(e,t,n,r,i,a,l,c,d,f){let g=!1;return Hf(e,t,n,r,i,a)&&(g=!g),Hf(e,t,i,a,l,c)&&(g=!g),Hf(e,t,l,c,d,f)&&(g=!g),Hf(e,t,d,f,n,r)&&(g=!g),g}function yP(e,t,n){return e>=n.x&&e<=n.x+n.width&&t>=n.y&&t<=n.y+n.height}function zf(e,t,n,r,i,a){const l=Math.min(n,i),c=Math.max(n,i),d=Math.min(r,a),f=Math.max(r,a);return e>=l&&e<=c&&t>=d&&t<=f}function LN(e={}){const{blockPointerEvents:t=!1}=e,n=new ps,r=({x:i,y:a,placement:l,elements:c,onClose:d,nodeId:f,tree:g})=>{const h=l?.split("-")[0];let b=!1,x=null,v=null,w=typeof performance<"u"?performance.now():0;function k(N,A){const R=performance.now(),M=R-w;if(x===null||v===null||M===0)return x=N,v=A,w=R,!1;const _=N-x,D=A-v,I=_*_+D*D,U=M*M*xP;return x=N,v=A,w=R,I<U}function C(){n.clear(),d()}return function(A){n.clear();const R=c.domReference,M=c.floating;if(!R||!M||h==null||i==null||a==null)return;const{clientX:_,clientY:D}=A,I=mr(A),U=A.type==="mouseleave",j=nt(M,I),X=nt(R,I);if(j&&(b=!0,!U))return;if(X&&(b=!1,!U)){b=!0;return}if(U&&St(A.relatedTarget)&&nt(M,A.relatedTarget))return;function K(){return!!(g&&sa(g.nodesRef.current,f).length>0)}function F(){K()||C()}if(K())return;const W=R.getBoundingClientRect(),V=M.getBoundingClientRect(),H=i>V.right-V.width/2,q=a>V.bottom-V.height/2,J=V.width>W.width,ue=V.height>W.height,L=(J?W:V).left,B=(J?W:V).right,G=(ue?W:V).top,P=(ue?W:V).bottom;if(h==="top"&&a>=W.bottom-1||h==="bottom"&&a<=W.top+1||h==="left"&&i>=W.right-1||h==="right"&&i<=W.left+1){F();return}let ae=!1;switch(h){case"top":ae=zf(_,D,L,W.top+1,B,V.bottom-1);break;case"bottom":ae=zf(_,D,L,V.top+1,B,W.bottom-1);break;case"left":ae=zf(_,D,V.right-1,P,W.left+1,G);break;case"right":ae=zf(_,D,W.right-1,P,V.left+1,G);break}if(ae)return;if(b&&!yP(_,D,W)){F();return}if(!U&&k(_,D)){F();return}let ie=!1;switch(h){case"top":{const ce=J?Kt/2:Kt*4,de=J||H?i+ce:i-ce,he=J?i-ce:H?i+ce:i-ce,ve=a+Kt+1,Fe=H||J?V.bottom-Kt:V.top,Le=H?J?V.bottom-Kt:V.top:V.bottom-Kt;ie=Uf(_,D,de,ve,he,ve,V.left,Fe,V.right,Le);break}case"bottom":{const ce=J?Kt/2:Kt*4,de=J||H?i+ce:i-ce,he=J?i-ce:H?i+ce:i-ce,ve=a-Kt,Fe=H||J?V.top+Kt:V.bottom,Le=H?J?V.top+Kt:V.bottom:V.top+Kt;ie=Uf(_,D,de,ve,he,ve,V.left,Fe,V.right,Le);break}case"left":{const ce=ue?Kt/2:Kt*4,de=ue||q?a+ce:a-ce,he=ue?a-ce:q?a+ce:a-ce,ve=i+Kt+1,Fe=q||ue?V.right-Kt:V.left,Le=q?ue?V.right-Kt:V.left:V.right-Kt;ie=Uf(_,D,Fe,V.top,Le,V.bottom,ve,de,ve,he);break}case"right":{const ce=ue?Kt/2:Kt*4,de=ue||q?a+ce:a-ce,he=ue?a-ce:q?a+ce:a-ce,ve=i-Kt,Fe=q||ue?V.left+Kt:V.right,Le=q?ue?V.left+Kt:V.right:V.left+Kt;ie=Uf(_,D,ve,de,ve,he,Fe,V.top,Le,V.bottom);break}}ie?b||n.start(40,F):F()}};return r.__options={...e,blockPointerEvents:t},r}const DN=E.createContext(null),PN=E.createContext(null);function pa(){const e=E.useContext(DN);if(e===null)throw new Error(Ln(60));return e}function jN(){const e=E.useContext(PN);if(e===null)throw new Error(Ln(61));return e}let BS=(function(e){return e.disabled="data-disabled",e.valid="data-valid",e.invalid="data-invalid",e.touched="data-touched",e.dirty="data-dirty",e.filled="data-filled",e.focused="data-focused",e})({});const EP={badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valid:null,valueMissing:!1},pc={valid:null,touched:!1,dirty:!1,filled:!1,focused:!1},vP={disabled:!1,...pc},TP={valid(e){return e===null?null:e?{[BS.valid]:""}:{[BS.invalid]:""}}},SP={invalid:void 0,name:void 0,validityData:{state:EP,errors:[],error:"",value:"",initialValue:null},setValidityData:Vn,disabled:void 0,touched:pc.touched,setTouched:Vn,dirty:pc.dirty,setDirty:Vn,filled:pc.filled,setFilled:Vn,focused:pc.focused,setFocused:Vn,validate:()=>null,validationMode:"onSubmit",validationDebounceTime:0,shouldValidateOnChange:()=>!1,state:vP,markedDirtyRef:{current:!1},registerFieldControl:Vn,validation:{getValidationProps:(e,t=dn)=>t,inputRef:{current:null},registerInput:Vn,commit:async()=>{},change:Vn}},CP=E.createContext(SP);function mx(e=!0){const t=E.useContext(CP);if(t.setValidityData===Vn&&!e)throw new Error(Ln(28));return t}function kP(e,t,n,r,i=!0,a){const{registerFieldControl:l}=mx(),c=E.useRef(null);c.current||(c.current=Symbol()),Ye(()=>{const d=c.current;return!d||!i?void 0:(l(d,{controlRef:e,getValue:r,id:t,name:a,value:n}),()=>{l(d,void 0)})},[e,i,r,t,a,l,n])}function To(e){return ao(e,"base-ui")}const wP=E.createContext({controlId:void 0,registerControlId:Vn,labelId:void 0,setLabelId:Vn,messageIds:[],setMessageIds:Vn,getDescriptionProps:e=>e});function BN(){return E.useContext(wP)}function HN(e={}){const{id:t,implicit:n=!1,controlRef:r}=e,{controlId:i,registerControlId:a}=BN(),l=To(t),c=n?i:void 0,d=xr(()=>Symbol("labelable-control")),f=E.useRef(!1),g=E.useRef(t!=null),h=tt(()=>{!f.current||a===Vn||(f.current=!1,a(d.current,void 0))});return Ye(()=>{if(a===Vn)return;let b;if(n){const x=r?.current;St(x)&&x.closest("label")!=null?b=t??null:b=c??l}else if(t!=null)g.current=!0,b=t;else if(g.current)b=l;else{h();return}if(b===void 0){h();return}f.current=!0,a(d.current,b)},[t,r,c,a,n,l,d,h]),E.useEffect(()=>h,[h]),i??l}const NP=(e,t)=>Object.is(e,t);function lo(e,t,n){return e==null||t==null?Object.is(e,t):n(e,t)}function AP(e,t,n){return!e||e.length===0?!1:e.some(r=>r===void 0?!1:lo(t,r,n))}function Sc(e,t,n){return!e||e.length===0?-1:e.findIndex(r=>r===void 0?!1:lo(r,t,n))}function _P(e,t,n){return e.filter(r=>!lo(t,r,n))}function Bb(e){if(e==null)return"";if(typeof e=="string")return e;try{return JSON.stringify(e)}catch{return String(e)}}function UN(e){return e!=null&&e.length>0&&typeof e[0]=="object"&&e[0]!=null&&"items"in e[0]}function RP(e){if(!Array.isArray(e))return e!=null&&"null"in e;const t=e;if(UN(t)){for(const n of t)for(const r of n.items)if(r&&r.value==null&&r.label!=null)return!0;return!1}for(const n of t)if(n&&n.value==null&&n.label!=null)return!0;return!1}function zN(e,t){if(t&&e!=null)return t(e)??"";if(e&&typeof e=="object"){if("label"in e&&e.label!=null)return String(e.label);if("value"in e)return String(e.value)}return Bb(e)}function Fa(e,t){return t&&e!=null?t(e)??"":e&&typeof e=="object"&&"value"in e&&"label"in e?Bb(e.value):Bb(e)}function FN(e,t,n){function r(){return zN(e,n)}if(n&&e!=null)return n(e);if(e&&typeof e=="object"&&"label"in e&&e.label!=null)return e.label;if(t&&!Array.isArray(t))return t[e]??r();if(Array.isArray(t)){const i=t,a=UN(i)?i.flatMap(l=>l.items):i;if(e==null||typeof e!="object"){const l=a.find(c=>c.value===e);return l&&l.label!=null?l.label:r()}if("value"in e){const l=a.find(c=>c&&c.value===e.value);if(l&&l.label!=null)return l.label}}return r()}function OP(e,t,n){return e.reduce((r,i,a)=>(a>0&&r.push(", "),r.push(m.jsx(E.Fragment,{children:FN(i,t,n)},a)),r),[])}const ct={id:Be(e=>e.id),labelId:Be(e=>e.labelId),modal:Be(e=>e.modal),multiple:Be(e=>e.multiple),items:Be(e=>e.items),itemToStringLabel:Be(e=>e.itemToStringLabel),itemToStringValue:Be(e=>e.itemToStringValue),isItemEqualToValue:Be(e=>e.isItemEqualToValue),value:Be(e=>e.value),hasSelectedValue:Be(e=>{const{value:t,multiple:n,itemToStringValue:r}=e;return t==null?!1:n&&Array.isArray(t)?t.length>0:Fa(t,r)!==""}),hasNullItemLabel:Be((e,t)=>t?RP(e.items):!1),open:Be(e=>e.open),mounted:Be(e=>e.mounted),forceMount:Be(e=>e.forceMount),transitionStatus:Be(e=>e.transitionStatus),openMethod:Be(e=>e.openMethod),activeIndex:Be(e=>e.activeIndex),selectedIndex:Be(e=>e.selectedIndex),isActive:Be((e,t)=>e.activeIndex===t),isSelected:Be((e,t)=>{const n=e.isItemEqualToValue,r=e.value;return e.multiple?Array.isArray(r)&&r.some(i=>lo(t,i,n)):lo(t,r,n)}),isSelectedByFocus:Be((e,t)=>e.selectedIndex===t),popupProps:Be(e=>e.popupProps),triggerProps:Be(e=>e.triggerProps),triggerElement:Be(e=>e.triggerElement),positionerElement:Be(e=>e.positionerElement),listElement:Be(e=>e.listElement),popupSide:Be(e=>e.popupSide),scrollUpArrowVisible:Be(e=>e.scrollUpArrowVisible),scrollDownArrowVisible:Be(e=>e.scrollDownArrowVisible),hasScrollArrows:Be(e=>e.hasScrollArrows)},IP=E.createContext({formRef:{current:{fields:new Map}},errors:{},clearErrors:Vn,validationMode:"onSubmit",submitAttemptedRef:{current:!1}});function MP(){return E.useContext(IP)}function LP(e,t,n=(r,i)=>r===i){return e.length===t.length&&e.every((r,i)=>n(r,t[i]))}function $N(e,t){const n=E.useRef(e),r=tt(t);Ye(()=>{n.current!==e&&r(n.current)},[e,r]),Ye(()=>{n.current=e},[e])}function DP(e){const t=E.useRef(""),n=E.useCallback(i=>{i.defaultPrevented||(t.current=i.pointerType,e(i,i.pointerType))},[e]);return{onClick:E.useCallback(i=>{if(i.detail===0){e(i,"keyboard");return}"pointerType"in i?e(i,i.pointerType):e(i,t.current),t.current=""},[e]),onPointerDown:n}}function VN(e,t){const n=tt((a,l)=>{(typeof e=="function"?e():e)||t(l||(fp?"touch":""))}),{onClick:r,onPointerDown:i}=DP(n);return E.useMemo(()=>({onClick:r,onPointerDown:i}),[r,i])}function qN(e){const[t,n]=E.useState(null),r=VN(e,n);return $N(e,i=>{i&&!e&&n(null)}),E.useMemo(()=>({openMethod:t,triggerProps:r}),[t,r])}function mc(e,t=Number.MIN_SAFE_INTEGER,n=Number.MAX_SAFE_INTEGER){return Math.max(t,Math.min(e,n))}const ii=1;function YN(e,t){return Math.max(0,e-t)}function PP(e,t){if(t<=0)return 0;const n=mc(e,0,t),r=n,i=t-n,a=r<=ii,l=i<=ii;return a&&l?r<=i?0:t:a?0:l?t:n}function jP(e){const{id:t,value:n,defaultValue:r=null,onValueChange:i,open:a,defaultOpen:l=!1,onOpenChange:c,name:d,form:f,autoComplete:g,disabled:h=!1,readOnly:b=!1,required:x=!1,modal:v=!0,actionsRef:w,inputRef:k,onOpenChangeComplete:C,items:N,multiple:A=!1,itemToStringLabel:R,itemToStringValue:M,isItemEqualToValue:_=NP,highlightItemOnHover:D=!0,children:I}=e,{clearErrors:U}=MP(),{setDirty:j,setTouched:X,setFocused:K,validityData:F,setFilled:W,name:V,disabled:H,validation:q,validationMode:J}=mx(),ue=HN({id:t}),L=H||h,B=V??d,[G,P]=oS({controlled:n,default:A?r??_l:r,name:"Select",state:"value"}),[ae,ie]=oS({controlled:a,default:l,name:"Select",state:"open"}),ce=E.useRef([]),de=E.useRef([]),he=E.useRef(null),ve=E.useRef(null),Fe=E.useRef(0),Le=E.useRef(null),Ee=E.useRef([]),Oe=E.useRef(!1),Ue=E.useRef(null),Xe=E.useRef(null),qe=E.useRef({allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1,dragY:0}),De=E.useRef(!1),{mounted:ke,setMounted:ye,transitionStatus:Re}=sx(ae),{openMethod:Pe,triggerProps:ee}=qN(ae),pe=xr(()=>new _3({id:ue,labelId:void 0,modal:v,multiple:A,itemToStringLabel:R,itemToStringValue:M,isItemEqualToValue:_,value:G,open:ae,mounted:ke,transitionStatus:Re,items:N,forceMount:!1,openMethod:null,activeIndex:null,selectedIndex:null,popupProps:{},triggerProps:{},triggerElement:null,positionerElement:null,listElement:null,popupSide:null,scrollUpArrowVisible:!1,scrollDownArrowVisible:!1,hasScrollArrows:!1})).current,se=ft(pe,ct.activeIndex),re=ft(pe,ct.selectedIndex),Q=ft(pe,ct.triggerElement),$=ft(pe,ct.positionerElement),oe=jL(Pe),Se=Pe??oe??null,_e=E.useMemo(()=>A?"":Fa(G,M),[A,G,M]),$e=E.useMemo(()=>A&&Array.isArray(G)?G.map(ht=>Fa(ht,M)):Fa(G,M),[A,G,M]),ot=En(pe.state.triggerElement),et=tt(()=>$e);kP(ot,ue,G,et,!L,d);const dt=E.useRef(G),ut=A?Array.isArray(G)&&G.length>0:G!=null&&Fa(G,M)!=="";Ye(()=>{G!==dt.current&&pe.set("forceMount",!0)},[pe,G]),Ye(()=>{W(ut)},[ut,W]),Ye(function(){const Ot=Ee.current;let bn;if(A){const Un=Array.isArray(G)?G:[];if(Un.length===0)bn=null;else{const Dn=Un[Un.length-1],en=Sc(Ot,Dn,_);bn=en===-1?null:en}}else{const Un=Sc(Ot,G,_);bn=Un===-1?null:Un}bn===null&&(Xe.current=null),!ae&&pe.set("selectedIndex",bn)},[ut,A,ae,G,Ee,_,pe,Xe]);function Ve(ht){const Ot=F.initialValue;return Array.isArray(ht)&&Array.isArray(Ot)?!LP(ht,Ot,(bn,Un)=>lo(bn,Un,_)):ht!==Ot}$N(G,()=>{U(B),j(Ve(G)),q.change(G)});const Rt=tt((ht,Ot)=>{c?.(ht,Ot),!Ot.isCanceled&&(ie(ht),!ht&&(Ot.reason===io||Ot.reason===gp)&&(X(!0),K(!1),J==="onBlur"&&q.commit(G)))}),Pt=tt(()=>{ye(!1),pe.update({activeIndex:null,openMethod:null}),C?.(!1)});vo({enabled:!w,open:ae,ref:he,onComplete(){ae||Pt()}}),E.useImperativeHandle(w,()=>({unmount:Pt}),[Pt]);const lt=tt((ht,Ot)=>{i?.(ht,Ot),!Ot.isCanceled&&P(ht)}),Lt=tt(()=>{const ht=pe.state.listElement||he.current;if(!ht)return;const Ot=YN(ht.scrollHeight,ht.clientHeight),bn=PP(ht.scrollTop,Ot),Un=bn>0,Dn=bn<Ot;pe.state.scrollUpArrowVisible!==Un&&pe.set("scrollUpArrowVisible",Un),pe.state.scrollDownArrowVisible!==Dn&&pe.set("scrollDownArrowVisible",Dn)}),Wt=NN({open:ae,onOpenChange:Rt,elements:{reference:Q,floating:$}}),$t=nx(Wt,{enabled:!b&&!L,event:"mousedown"}),Zt=yp(Wt),Ke=IN(Wt,{enabled:!b&&!L,listRef:ce,activeIndex:se,selectedIndex:re,disabledIndices:_l,onNavigate(ht){ht===null&&!ae||pe.set("activeIndex",ht)},focusItemOnHover:D}),yt=MN(Wt,{enabled:!b&&!L&&(ae||!A),listRef:de,activeIndex:se,selectedIndex:re,disabledIndices:ht=>BL(ce.current[ht]),onMatch(ht){ae?pe.set("activeIndex",ht):lt(Ee.current[ht],pt("none"))},onTyping(ht){Oe.current=ht}}),zt=E.useMemo(()=>{const ht=Ir(yt.reference,Ke.reference,Zt.reference,$t.reference,ee);return ue&&(ht.id=ue),ht},[$t.reference,yt.reference,Ke.reference,Zt.reference,ee,ue]),Jt=E.useMemo(()=>Ir(Tp,yt.floating,Ke.floating,Zt.floating),[yt.floating,Ke.floating,Zt.floating]),Xn=Ke.item??dn;I1(()=>{pe.update({popupProps:Jt,triggerProps:zt})}),Ye(()=>{pe.update({id:ue,modal:v,multiple:A,value:G,open:ae,mounted:ke,transitionStatus:Re,popupProps:Jt,triggerProps:zt,items:N,itemToStringLabel:R,itemToStringValue:M,isItemEqualToValue:_,openMethod:Se})},[pe,ue,v,A,G,ae,ke,Re,Jt,zt,N,R,M,_,Se]);const Et=E.useMemo(()=>({store:pe,name:B,required:x,disabled:L,readOnly:b,multiple:A,highlightItemOnHover:D,setValue:lt,setOpen:Rt,listRef:ce,popupRef:he,scrollHandlerRef:ve,handleScrollArrowVisibility:Lt,scrollArrowsMountedCountRef:Fe,itemProps:Xn,valueRef:Le,valuesRef:Ee,labelsRef:de,typingRef:Oe,selectionRef:qe,firstItemTextRef:Ue,selectedItemTextRef:Xe,validation:q,onOpenChangeComplete:C,alignItemWithTriggerActiveRef:De,initialValueRef:dt}),[pe,B,x,L,b,A,D,lt,Rt,Xn,q,C,Lt]),an=ro(k,q.inputRef),Er=A&&Array.isArray(G)&&G.length>0,mn=A?void 0:B,Tn=E.useMemo(()=>!A||!Array.isArray(G)||!B?null:G.map(ht=>{const Ot=Fa(ht,M);return m.jsx("input",{type:"hidden",form:f,name:B,value:Ot,disabled:L},Ot)}),[A,G,f,B,M,L]);return m.jsx(DN.Provider,{value:Et,children:m.jsxs(PN.Provider,{value:Wt,children:[I,m.jsx("input",{...q.getValidationProps(L,{onFocus(){pe.state.triggerElement?.focus({focusVisible:!0})},onChange(ht){if(ht.nativeEvent.defaultPrevented||L||b)return;const Ot=ht.currentTarget.value,bn=pt(Fl,ht.nativeEvent);function Un(){if(A)return;const Dn=Ot.toLowerCase();let en=Ee.current.findIndex(bs=>Fa(bs,M).toLowerCase()===Dn||zN(bs,R).toLowerCase()===Dn);en===-1&&(en=Ee.current.findIndex((bs,su)=>{const fd=de.current[su];return fd!=null&&fd.toLowerCase()===Dn}));const Kn=en===-1?void 0:Ee.current[en];Kn!=null&&lt(Kn,bn)}pe.set("forceMount",!0),queueMicrotask(Un)}}),id:ue&&mn==null?`${ue}-hidden-input`:void 0,form:f,name:mn,autoComplete:g,value:_e,disabled:L,required:x&&!Er,readOnly:b,ref:an,style:B?ML:C3,tabIndex:-1,"aria-hidden":!0,suppressHydrationWarning:!0}),Tn]})})}function BP(e,t){return e??t}let Ka=(function(e){return e.open="data-open",e.closed="data-closed",e[e.startingStyle=$c.startingStyle]="startingStyle",e[e.endingStyle=$c.endingStyle]="endingStyle",e.anchorHidden="data-anchor-hidden",e.side="data-side",e.align="data-align",e})({}),jh=(function(e){return e.popupOpen="data-popup-open",e.pressed="data-pressed",e})({});const HP={[jh.popupOpen]:""},UP={[jh.popupOpen]:"",[jh.pressed]:""},zP={[Ka.open]:""},FP={[Ka.closed]:""},$P={[Ka.anchorHidden]:""},gx={open(e){return e?HP:null}},Hb={open(e){return e?UP:null}},ql={open(e){return e?zP:FP},anchorHidden(e){return e?$P:null}};function GN(e){const t=e.getBoundingClientRect(),n=sn(e);if(z1)return t;const r=n.getComputedStyle(e,"::before"),i=n.getComputedStyle(e,"::after");if(!(r.content!=="none"||i.content!=="none"))return t;const l=parseFloat(r.width)||0,c=parseFloat(r.height)||0,d=parseFloat(i.width)||0,f=parseFloat(i.height)||0,g=Math.max(t.width,l,d),h=Math.max(t.height,c,f),b=g-t.width,x=h-t.height;return{left:t.left-b/2,right:t.right+b/2,top:t.top-x/2,bottom:t.bottom+x/2}}const VP=E.createContext(void 0);function bx(e=!1){const t=E.useContext(VP);if(t===void 0&&!e)throw new Error(Ln(16));return t}function qP(e){const{focusableWhenDisabled:t,disabled:n,composite:r=!1,tabIndex:i=0,isNativeButton:a}=e,l=r&&t!==!1,c=r&&t===!1;return{props:E.useMemo(()=>{const f={onKeyDown(g){n&&t&&g.key!=="Tab"&&g.preventDefault()}};return r||(f.tabIndex=i,!a&&n&&(f.tabIndex=t?i:-1)),(a&&(t||l)||!a&&n)&&(f["aria-disabled"]=n),a&&(!t||c)&&(f.disabled=n),f},[r,n,t,l,c,a,i])}}function Yl(e={}){const{disabled:t=!1,focusableWhenDisabled:n,tabIndex:r=0,native:i=!0,composite:a}=e,l=E.useRef(null),c=bx(!0),d=a??c!==void 0,{props:f}=qP({focusableWhenDisabled:n,disabled:t,composite:d,tabIndex:r,isNativeButton:i}),g=E.useCallback(()=>{const x=l.current;D0(x)&&d&&t&&f.disabled===void 0&&x.disabled&&(x.disabled=!1)},[t,f.disabled,d]);Ye(g,[g]);const h=E.useCallback((x={})=>{const{onClick:v,onMouseDown:w,onKeyUp:k,onKeyDown:C,onPointerDown:N,...A}=x;return Ir({onClick(R){if(t){R.preventDefault();return}v?.(R)},onMouseDown(R){t||w?.(R)},onKeyDown(R){if(t||(Mh(R),C?.(R),R.baseUIHandlerPrevented))return;const M=R.target===R.currentTarget,_=R.currentTarget,D=D0(_),I=!i&&YP(_),U=M&&(i?D:!I),j=R.key==="Enter",X=R.key===" ",K=_.getAttribute("role"),F=K?.startsWith("menuitem")||K==="option"||K==="gridcell";if(M&&d&&X){if(R.defaultPrevented&&F)return;R.preventDefault(),I||i&&D?(_.click(),R.preventBaseUIHandler()):U&&(v?.(R),R.preventBaseUIHandler());return}U&&(!i&&(X||j)&&R.preventDefault(),!i&&j&&v?.(R))},onKeyUp(R){if(!t){if(Mh(R),k?.(R),R.target===R.currentTarget&&i&&d&&D0(R.currentTarget)&&R.key===" "){R.preventDefault();return}R.baseUIHandlerPrevented||R.target===R.currentTarget&&!i&&!d&&R.key===" "&&v?.(R)}},onPointerDown(R){if(t){R.preventDefault();return}N?.(R)}},i?{type:"button"}:{role:"button"},f,A)},[t,f,d,i]),b=tt(x=>{l.current=x,g()});return{getButtonProps:h,buttonRef:b}}function D0(e){return cn(e)&&e.tagName==="BUTTON"}function YP(e){return!!(e?.tagName==="A"&&e?.href)}const Ff=2,GP=400,XP={...Hb,...TP,popupSide:e=>e?{"data-popup-side":e}:null,value:()=>null},KP=E.forwardRef(function(t,n){const{render:r,className:i,id:a,disabled:l=!1,nativeButton:c=!0,style:d,...f}=t,{setTouched:g,setFocused:h,validationMode:b,state:x,disabled:v}=mx(),{labelId:w}=BN(),{store:k,setOpen:C,selectionRef:N,validation:A,readOnly:R,required:M,alignItemWithTriggerActiveRef:_,disabled:D}=pa(),I=v||D||l,U=ft(k,ct.open),j=ft(k,ct.mounted),X=ft(k,ct.value),K=ft(k,ct.triggerProps),F=ft(k,ct.positionerElement),W=ft(k,ct.listElement),V=ft(k,ct.popupSide),H=ft(k,ct.id),q=ft(k,ct.labelId),J=ft(k,ct.hasSelectedValue),ue=j&&F?V:null,L=a??H,B=BP(w,q);HN({id:L});const G=En(F),P=E.useRef(null),{getButtonProps:ae,buttonRef:ie}=Yl({disabled:I,native:c}),ce=tt(Oe=>{k.set("triggerElement",Oe)}),de=Gn(),he=Gn(),ve=Gn();E.useEffect(()=>{if(U)return ve.start(GP,()=>{N.current.allowUnselectedMouseUp=!0,N.current.allowSelectedMouseUp=!0}),()=>{ve.clear()};N.current={allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1,dragY:0},he.clear()},[U,N,he,ve]);const Fe=Ir(K,{id:L,role:"combobox","aria-expanded":U?"true":"false","aria-haspopup":"listbox","aria-controls":U?W?.id??_h(F)?.id:void 0,"aria-labelledby":B,"aria-readonly":R||void 0,"aria-required":M||void 0,tabIndex:I?-1:0,onFocus(Oe){h(!0),U&&_.current&&C(!1,pt(Fl,Oe.nativeEvent)),de.start(0,()=>{k.set("forceMount",!0)})},onBlur(Oe){nt(F,Oe.relatedTarget)||(g(!0),h(!1),b==="onBlur"&&A.commit(X))},onMouseDown(Oe){if(U)return;const Ue=At(Oe.currentTarget);function Xe(qe){if(!P.current)return;const De=qe.target;if(nt(P.current,De)||nt(G.current,De))return;const ke=GN(P.current);qe.clientX>=ke.left-Ff&&qe.clientX<=ke.right+Ff&&qe.clientY>=ke.top-Ff&&qe.clientY<=ke.bottom+Ff||C(!1,pt(D3,qe))}he.start(0,()=>{Ue.addEventListener("mouseup",Xe,{once:!0})})}},f,ae),Le=A.getValidationProps(I,Fe);Le.role="combobox";const Ee={...x,open:U,disabled:I,value:X,readOnly:R,popupSide:ue,placeholder:!J};return Nn("button",t,{ref:[n,P,ie,ce],state:Ee,stateAttributesMapping:XP,props:Le})}),QP={value:()=>null},WP=E.forwardRef(function(t,n){const{className:r,render:i,children:a,placeholder:l,style:c,...d}=t,{store:f,valueRef:g}=pa(),h=ft(f,ct.value),b=ft(f,ct.items),x=ft(f,ct.itemToStringLabel),v=ft(f,ct.hasSelectedValue),w=!v&&l!=null&&a==null,k=ft(f,ct.hasNullItemLabel,w),C={value:h,placeholder:!v};let N=null;return typeof a=="function"?N=a(h):a!=null?N=a:!v&&l!=null&&!k?N=l:Array.isArray(h)?N=OP(h,b,x):N=FN(h,b,x),Nn("span",t,{state:C,ref:[n,g],props:[{children:N},d],stateAttributesMapping:QP})}),ZP=E.forwardRef(function(t,n){const{render:r,className:i,style:a,...l}=t,{store:c}=pa(),f={open:ft(c,ct.open)};return Nn("span",t,{state:f,ref:n,props:[{"aria-hidden":!0,children:"▼"},l],stateAttributesMapping:gx})}),JP=E.createContext(void 0),ej=E.forwardRef(function(t,n){const{store:r}=pa(),i=ft(r,ct.mounted),a=ft(r,ct.forceMount);return i||a?m.jsx(JP.Provider,{value:!0,children:m.jsx(Z1,{ref:n,...t})}):null});function xx(e){return L1(19)?e:e?"true":void 0}const XN=E.createContext({register:()=>{},unregister:()=>{},subscribeMapChange:()=>()=>{},elementsRef:{current:[]},nextIndexRef:{current:0}});function tj(){return E.useContext(XN)}function KN(e){const{children:t,elementsRef:n,labelsRef:r,onMapChange:i}=e,a=tt(i),l=E.useRef(0),c=xr(rj).current,d=xr(nj).current,[f,g]=E.useState(0),h=E.useRef(f),b=tt((C,N)=>{d.set(C,N??null),h.current+=1,g(h.current)}),x=tt(C=>{d.delete(C),h.current+=1,g(h.current)}),v=E.useMemo(()=>{const C=new Map;return Array.from(d.keys()).filter(A=>A.isConnected).sort(sj).forEach((A,R)=>{const M=d.get(A)??{};C.set(A,{...M,index:R})}),C},[d,f]);Ye(()=>{if(typeof MutationObserver!="function"||v.size===0)return;const C=new MutationObserver(N=>{const A=new Set,R=M=>A.has(M)?A.delete(M):A.add(M);N.forEach(M=>{M.removedNodes.forEach(R),M.addedNodes.forEach(R)}),A.size===0&&(h.current+=1,g(h.current))});return v.forEach((N,A)=>{A.parentElement&&C.observe(A.parentElement,{childList:!0})}),()=>{C.disconnect()}},[v]),Ye(()=>{h.current===f&&(n.current.length!==v.size&&(n.current.length=v.size),r&&r.current.length!==v.size&&(r.current.length=v.size),l.current=v.size),a(v)},[a,v,n,r,f]),Ye(()=>()=>{n.current=[]},[n]),Ye(()=>()=>{r&&(r.current=[])},[r]);const w=tt(C=>(c.add(C),()=>{c.delete(C)}));Ye(()=>{c.forEach(C=>C(v))},[c,v]);const k=E.useMemo(()=>({register:b,unregister:x,subscribeMapChange:w,elementsRef:n,labelsRef:r,nextIndexRef:l}),[b,x,w,n,r,l]);return m.jsx(XN.Provider,{value:k,children:t})}function nj(){return new Map}function rj(){return new Set}function sj(e,t){const n=e.compareDocumentPosition(t);return n&Node.DOCUMENT_POSITION_FOLLOWING||n&Node.DOCUMENT_POSITION_CONTAINED_BY?-1:n&Node.DOCUMENT_POSITION_PRECEDING||n&Node.DOCUMENT_POSITION_CONTAINS?1:0}const ij=E.createContext(void 0);function yx(){return E.useContext(ij)?.direction??"ltr"}const aj=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:i,rects:a,platform:l,elements:c,middlewareData:d}=t,{element:f,padding:g=0,offsetParent:h="real"}=pi(e,t)||{};if(f==null)return{};const b=B3(g),x={x:n,y:r},v=G1(i),w=Y1(v),k=await l.getDimensions(f),C=v==="y",N=C?"top":"left",A=C?"bottom":"right",R=C?"clientHeight":"clientWidth",M=a.reference[w]+a.reference[v]-x[v]-a.floating[w],_=x[v]-a.reference[v],D=h==="real"?await l.getOffsetParent?.(f):c.floating;let I=c.floating[R]||a.floating[w];(!I||!await l.isElement?.(D))&&(I=c.floating[R]||a.floating[w]);const U=M/2-_/2,j=I/2-k[w]/2-1,X=Math.min(b[N],j),K=Math.min(b[A],j),F=X,W=I-k[w]-K,V=I/2-k[w]/2+U,H=j3(F,V,W),q=!d.arrow&&da(i)!=null&&V!==H&&a.reference[w]/2-(V<F?X:K)-k[w]/2<0,J=q?V<F?V-F:V-W:0;return{[v]:x[v]+J,data:{[v]:H,centerOffset:V-H-J,...q&&{alignmentOffset:J}},reset:q}}}),oj=(e,t)=>({...aj(e),options:[e,t]}),lj=rP().fn,uj={name:"hide",async fn(e){const{width:t,height:n,x:r,y:i}=e.rects.reference,a=t===0&&n===0&&r===0&&i===0;return{data:{referenceHidden:(await lj(e)).data?.referenceHidden||a}}}},ph={sideX:"left",sideY:"top"},QN={name:"adaptiveOrigin",async fn(e){const{x:t,y:n,rects:{floating:r},elements:{floating:i},platform:a,strategy:l,placement:c}=e,d=sn(i),f=d.getComputedStyle(i);if(!(f.transitionDuration!=="0s"&&f.transitionDuration!==""))return{x:t,y:n,data:ph};const h=await a.getOffsetParent?.(i);let b={width:0,height:0};if(l==="fixed"&&d?.visualViewport)b={width:d.visualViewport.width,height:d.visualViewport.height};else if(h===d){const N=At(i);b={width:N.documentElement.clientWidth,height:N.documentElement.clientHeight}}else await a.isElement?.(h)&&(b=await a.getDimensions(h));const x=Fr(c);let v=t,w=n;x==="left"&&(v=b.width-(t+r.width)),x==="top"&&(w=b.height-(n+r.height));const k=x==="left"?"right":ph.sideX,C=x==="top"?"bottom":ph.sideY;return{x:v,y:w,data:{sideX:k,sideY:C}}}};function WN(e,t,n){const r=e==="inline-start"||e==="inline-end";return{top:"top",right:r?n?"inline-start":"inline-end":"right",bottom:"bottom",left:r?n?"inline-end":"inline-start":"left"}[t]}function HS(e,t,n){const{rects:r,placement:i}=e;return{side:WN(t,Fr(i),n),align:da(i)||"center",anchor:{width:r.reference.width,height:r.reference.height},positioner:{width:r.floating.width,height:r.floating.height}}}function Ex(e){const{anchor:t,positionMethod:n="absolute",side:r="bottom",sideOffset:i=0,align:a="center",alignOffset:l=0,collisionBoundary:c,collisionPadding:d=5,sticky:f=!1,arrowPadding:g=5,disableAnchorTracking:h=!1,inline:b,keepMounted:x=!1,floatingRootContext:v,mounted:w,collisionAvoidance:k,shiftCrossAxis:C=!1,nodeId:N,adaptiveOrigin:A,lazyFlip:R=!1,externalTree:M}=e,[_,D]=E.useState(null);!w&&_!==null&&D(null);const I=k.side||"flip",U=k.align||"flip",j=k.fallbackAxisSide||"end",X=typeof t=="function"?t:void 0,K=tt(X),F=X?K:t,W=En(t),V=En(w),q=yx()==="rtl",J=_||{top:"top",right:"right",bottom:"bottom",left:"left","inline-end":q?"left":"right","inline-start":q?"right":"left"}[r],ue=a==="center"?J:`${J}-${a}`;let L=d;const B=1,G=r==="bottom"?B:0,P=r==="top"?B:0,ae=r==="right"?B:0,ie=r==="left"?B:0;typeof L=="number"?L={top:L+G,right:L+ie,bottom:L+P,left:L+ae}:L&&(L={top:(L.top||0)+G,right:(L.right||0)+ie,bottom:(L.bottom||0)+P,left:(L.left||0)+ae});const ce={boundary:c==="clipping-ancestors"?"clippingAncestors":c,padding:L},de=E.useRef(null),he=En(i),ve=En(l),Fe=typeof i!="function"?i:0,Le=typeof l!="function"?l:0,Ee=[];b&&Ee.push(b),Ee.push(Z8(lt=>{const Lt=HS(lt,r,q),Wt=typeof he.current=="function"?he.current(Lt):he.current,$t=typeof ve.current=="function"?ve.current(Lt):ve.current;return{mainAxis:Wt,crossAxis:$t,alignmentAxis:$t}},[Fe,Le,q,r]));const Oe=U==="none"&&I!=="shift",Ue=!Oe&&(f||C||I==="shift"),Xe=I==="none"?null:tP({...ce,padding:{top:L.top+B,right:L.right+B,bottom:L.bottom+B,left:L.left+B},mainAxis:!C&&I==="flip",crossAxis:U==="flip"?"alignment":!1,fallbackAxisSideDirection:j}),qe=Oe?null:J8(lt=>{const Lt=At(lt.elements.floating).documentElement;return{...ce,rootBoundary:C?{x:0,y:0,width:Lt.clientWidth,height:Lt.clientHeight}:void 0,mainAxis:U!=="none",crossAxis:Ue,limiter:f||C?void 0:eP(Wt=>{if(!de.current)return{};const{width:$t,height:Zt}=de.current.getBoundingClientRect(),Ke=as(Fr(Wt.placement)),yt=Ke==="y"?$t:Zt,zt=Ke==="y"?L.left+L.right:L.top+L.bottom;return{offset:yt/2+zt/2}})}},[ce,f,C,L,U]);I==="shift"||U==="shift"||a==="center"?Ee.push(qe,Xe):Ee.push(Xe,qe),Ee.push(nP({...ce,apply({elements:{floating:lt},availableWidth:Lt,availableHeight:Wt,rects:$t}){if(!V.current)return;const Zt=lt.style;Zt.setProperty("--available-width",`${Lt}px`),Zt.setProperty("--available-height",`${Wt}px`);const Ke=sn(lt).devicePixelRatio||1,{x:yt,y:zt,width:Jt,height:Xn}=$t.reference,Et=(Math.round((yt+Jt)*Ke)-Math.round(yt*Ke))/Ke,an=(Math.round((zt+Xn)*Ke)-Math.round(zt*Ke))/Ke;Zt.setProperty("--anchor-width",`${Et}px`),Zt.setProperty("--anchor-height",`${an}px`)}}),oj(lt=>({element:de.current||At(lt.elements.floating).createElement("div"),padding:g,offsetParent:"floating"}),[g]),{name:"transformOrigin",fn(lt){const{elements:Lt,middlewareData:Wt,placement:$t,rects:Zt,y:Ke}=lt,yt=Fr($t),zt=as(yt),Jt=de.current,Xn=Wt.arrow?.x||0,Et=Wt.arrow?.y||0,an=Jt?.clientWidth||0,Er=Jt?.clientHeight||0,mn=Xn+an/2,Tn=Et+Er/2,ht=Math.abs(Wt.shift?.y||0),Ot=Zt.reference.height/2,bn=typeof i=="function"?i(HS(lt,r,q)):i,Un=ht>bn,Dn={top:`${mn}px calc(100% + ${bn}px)`,bottom:`${mn}px ${-bn}px`,left:`calc(100% + ${bn}px) ${Tn}px`,right:`${-bn}px ${Tn}px`}[yt],en=`${mn}px ${Zt.reference.y+Ot-Ke}px`;return Lt.floating.style.setProperty("--transform-origin",Ue&&zt==="y"&&Un?en:Dn),{}}},uj,A),Ye(()=>{!w&&v&&v.update({referenceElement:null,floatingElement:null,domReferenceElement:null,positionReference:null})},[w,v]);const De=E.useMemo(()=>({elementResize:!h&&typeof ResizeObserver<"u",layoutShift:!h&&typeof IntersectionObserver<"u"}),[h]),{refs:ke,elements:ye,x:Re,y:Pe,middlewareData:ee,update:pe,placement:se,context:re,isPositioned:Q,floatingStyles:$}=hP({rootContext:v,open:x?w:void 0,placement:ue,middleware:Ee,strategy:n,whileElementsMounted:x?void 0:(...lt)=>LS(...lt,De),nodeId:N,externalTree:M}),{sideX:oe,sideY:Se}=ee.adaptiveOrigin||ph,_e=Q?n:"fixed",$e=E.useMemo(()=>{const lt=A?{position:_e,[oe]:Re,[Se]:Pe}:{position:_e,...$};return Q||(lt.opacity=0),lt},[A,_e,oe,Re,Se,Pe,$,Q]),ot=E.useRef(null);Ye(()=>{if(!w)return;const lt=W.current,Lt=typeof lt=="function"?lt():lt,$t=(US(Lt)?Lt.current:Lt)||null||null;$t!==ot.current&&(ke.setPositionReference($t),ot.current=$t)},[w,ke,F,W]),E.useEffect(()=>{if(!w)return;const lt=W.current;typeof lt!="function"&&US(lt)&&lt.current!==ot.current&&(ke.setPositionReference(lt.current),ot.current=lt.current)},[w,ke,F,W]),E.useEffect(()=>{if(x&&w&&ye.reference&&ye.floating)return LS(ye.reference,ye.floating,pe,De)},[x,w,ye,pe,De]);const et=Fr(se),dt=WN(r,et,q),ut=da(se)||"center",Ve=!!ee.hide?.referenceHidden;Ye(()=>{R&&w&&Q&&D(et)},[R,w,Q,et]);const Rt=E.useMemo(()=>({position:"absolute",top:ee.arrow?.y,left:ee.arrow?.x}),[ee.arrow]),Pt=ee.arrow?.centerOffset!==0;return E.useMemo(()=>({positionerStyles:$e,arrowStyles:Rt,arrowRef:de,arrowUncentered:Pt,side:dt,align:ut,physicalSide:et,anchorHidden:Ve,refs:ke,context:re,isPositioned:Q,update:pe}),[$e,Rt,de,Pt,dt,ut,et,Ve,ke,re,Q,pe])}function US(e){return e!=null&&"current"in e}const ZN=E.createContext(void 0);function cj(){const e=E.useContext(ZN);if(!e)throw new Error(Ln(59));return e}const vx=E.forwardRef(function(t,n){const{cutout:r,...i}=t;let a;if(r){const l=r.getBoundingClientRect();a=`polygon(0% 0%,100% 0%,100% 100%,0% 100%,0% 0%,${l.left}px ${l.top}px,${l.left}px ${l.bottom}px,${l.right}px ${l.bottom}px,${l.right}px ${l.top}px,${l.left}px ${l.top}px)`}return m.jsx("div",{ref:n,role:"presentation","data-base-ui-inert":"",...i,style:{position:"fixed",inset:0,userSelect:"none",WebkitUserSelect:"none",clipPath:a}})});function Bh(e,t){e&&Object.assign(e.style,t)}const dj={position:"relative",maxHeight:"100%",overflowX:"hidden",overflowY:"auto"};function Cp(e){return e==="starting"?a8:dn}function Tx(e,t,{styles:n,transitionStatus:r,props:i,refs:a,hidden:l,inert:c=!1}){const d={...n};return c&&(d.pointerEvents="none"),Nn("div",e,{state:t,ref:a,props:[{role:"presentation",hidden:l,style:d},Cp(r),i],stateAttributesMapping:ql})}let zS={},FS={},$S="";function fj(e){if(typeof document>"u")return!1;const t=At(e);return sn(t).innerWidth-t.documentElement.clientWidth>0}function hj(e){if(!(typeof CSS<"u"&&CSS.supports&&CSS.supports("scrollbar-gutter","stable"))||typeof document>"u")return!1;const n=At(e),r=n.documentElement,i=n.body,a=Eo(r)?r:i,l=a.style.overflowY,c=r.style.scrollbarGutter;r.style.scrollbarGutter="stable",a.style.overflowY="scroll";const d=a.offsetWidth;a.style.overflowY="hidden";const f=a.offsetWidth;return a.style.overflowY=l,r.style.scrollbarGutter=c,d===f}function pj(e){const t=At(e),n=t.documentElement,r=t.body,i=Eo(n)?n:r,a={overflowY:i.style.overflowY,overflowX:i.style.overflowX};return Object.assign(i.style,{overflowY:"hidden",overflowX:"hidden"}),()=>{Object.assign(i.style,a)}}function mj(e){const t=At(e),n=t.documentElement,r=t.body,i=sn(n);let a=0,l=0,c=!1;const d=As.create();if(ca&&(i.visualViewport?.scale??1)!==1)return()=>{};function f(){const x=i.getComputedStyle(n),v=i.getComputedStyle(r),C=(x.scrollbarGutter||"").includes("both-edges")?"stable both-edges":"stable";a=n.scrollTop,l=n.scrollLeft,zS={scrollbarGutter:n.style.scrollbarGutter,overflowY:n.style.overflowY,overflowX:n.style.overflowX},$S=n.style.scrollBehavior,FS={position:r.style.position,height:r.style.height,width:r.style.width,boxSizing:r.style.boxSizing,overflowY:r.style.overflowY,overflowX:r.style.overflowX,scrollBehavior:r.style.scrollBehavior};const N=n.scrollHeight>n.clientHeight,A=n.scrollWidth>n.clientWidth,R=x.overflowY==="scroll"||v.overflowY==="scroll",M=x.overflowX==="scroll"||v.overflowX==="scroll",_=Math.max(0,i.innerWidth-r.clientWidth),D=Math.max(0,i.innerHeight-r.clientHeight),I=parseFloat(v.marginTop)+parseFloat(v.marginBottom),U=parseFloat(v.marginLeft)+parseFloat(v.marginRight),j=Eo(n)?n:r;if(c=hj(e),c){n.style.scrollbarGutter=C,j.style.overflowY="hidden",j.style.overflowX="hidden";return}Object.assign(n.style,{scrollbarGutter:C,overflowY:"hidden",overflowX:"hidden"}),(N||R)&&(n.style.overflowY="scroll"),(A||M)&&(n.style.overflowX="scroll"),Object.assign(r.style,{position:"relative",height:I||D?`calc(100dvh - ${I+D}px)`:"100dvh",width:U||_?`calc(100vw - ${U+_}px)`:"100vw",boxSizing:"border-box",overflow:"hidden",scrollBehavior:"unset"}),r.scrollTop=a,r.scrollLeft=l,n.setAttribute("data-base-ui-scroll-locked",""),n.style.scrollBehavior="unset"}function g(){Object.assign(n.style,zS),Object.assign(r.style,FS),c||(n.scrollTop=a,n.scrollLeft=l,n.removeAttribute("data-base-ui-scroll-locked"),n.style.scrollBehavior=$S)}function h(){g(),d.request(f)}f();const b=Tt(i,"resize",h);return()=>{d.cancel(),g(),typeof i.removeEventListener=="function"&&b()}}class gj{lockCount=0;restore=null;timeoutLock=ps.create();timeoutUnlock=ps.create();acquire(t){return this.lockCount+=1,this.lockCount===1&&this.restore===null&&this.timeoutLock.start(0,()=>this.lock(t)),this.release}release=()=>{this.lockCount-=1,this.lockCount===0&&this.restore&&this.timeoutUnlock.start(0,this.unlock)};unlock=()=>{this.lockCount===0&&this.restore&&(this.restore?.(),this.restore=null)};lock(t){if(this.lockCount===0||this.restore!==null)return;const r=At(t).documentElement,i=sn(r).getComputedStyle(r).overflowY;if(i==="hidden"||i==="clip"){this.restore=Vn;return}const a=fp||!fj(t);this.restore=a?pj(t):mj(t)}}const bj=new gj;function JN(e=!0,t=null){Ye(()=>{if(e)return bj.acquire(t)},[e,t])}const xj=20;function eA(e,t,n,r){const[i,a]=E.useState(!1);Ye(()=>{if(!e||!t||n==null){a(!1);return}const l=At(n).documentElement.clientWidth,c=n.offsetWidth;a(l>0&&c>0&&c>=l-xj)},[e,t,n]),JN(e&&(!t||i),r)}const yj={position:"fixed"},Ej=E.forwardRef(function(t,n){const{anchor:r,positionMethod:i="absolute",className:a,render:l,side:c="bottom",align:d="center",sideOffset:f=0,alignOffset:g=0,collisionBoundary:h="clipping-ancestors",collisionPadding:b,arrowPadding:x=5,sticky:v=!1,disableAnchorTracking:w,alignItemWithTrigger:k=!0,collisionAvoidance:C=rN,style:N,...A}=t,{store:R,listRef:M,labelsRef:_,alignItemWithTriggerActiveRef:D,selectedItemTextRef:I,valuesRef:U,initialValueRef:j,popupRef:X,setValue:K}=pa(),F=jN(),W=ft(R,ct.open),V=ft(R,ct.mounted),H=ft(R,ct.modal),q=ft(R,ct.value),J=ft(R,ct.openMethod),ue=ft(R,ct.positionerElement),L=ft(R,ct.triggerElement),B=ft(R,ct.isItemEqualToValue),G=ft(R,ct.transitionStatus),P=E.useRef(null),ae=E.useRef(null),[ie,ce]=E.useState(k),de=V&&ie&&J!=="touch";!V&&ie!==k&&ce(k),Ye(()=>{V||(ct.scrollUpArrowVisible(R.state)&&R.set("scrollUpArrowVisible",!1),ct.scrollDownArrowVisible(R.state)&&R.set("scrollDownArrowVisible",!1))},[R,V]),E.useImperativeHandle(D,()=>de),eA((de||H)&&W,J==="touch",ue,L);const he=Ex({anchor:r,floatingRootContext:F,positionMethod:i,mounted:V,side:c,sideOffset:f,align:d,alignOffset:g,arrowPadding:x,collisionBoundary:h,collisionPadding:b,sticky:v,disableAnchorTracking:w??de,collisionAvoidance:C,keepMounted:!0}),ve=de?"none":he.side,Fe=de?yj:he.positionerStyles,Le={open:W,side:ve,align:he.align,anchorHidden:he.anchorHidden};Ye(()=>{R.set("popupSide",he.side)},[R,he.side]);const Ee=tt(De=>{R.set("positionerElement",De)}),Oe=Tx(t,Le,{styles:Fe,transitionStatus:G,props:A,refs:[n,Ee],hidden:!V,inert:!W}),Ue=E.useRef(0),Xe=tt(De=>{if(De.size===0&&Ue.current===0||U.current.length===0)return;const ke=Ue.current;if(Ue.current=De.size,De.size===ke)return;const ye=pt(Fl);if(ke!==0&&!R.state.multiple&&q!==null&&Sc(U.current,q,B)===-1){const Pe=j.current,pe=Pe!=null&&Sc(U.current,Pe,B)!==-1?Pe:null;K(pe,ye),pe===null&&(R.set("selectedIndex",null),I.current=null)}if(ke!==0&&R.state.multiple&&Array.isArray(q)){const Re=ee=>Sc(U.current,ee,B)!==-1,Pe=q.filter(ee=>Re(ee));(Pe.length!==q.length||Pe.some(ee=>!AP(q,ee,B)))&&(K(Pe,ye),Pe.length===0&&(R.set("selectedIndex",null),I.current=null))}if(W&&de){R.update({scrollUpArrowVisible:!1,scrollDownArrowVisible:!1});const Re={height:""};Bh(ue,Re),Bh(X.current,Re)}}),qe=E.useMemo(()=>({...he,side:ve,alignItemWithTriggerActive:de,setControlledAlignItemWithTrigger:ce,scrollUpArrowRef:P,scrollDownArrowRef:ae}),[he,ve,de,ce]);return m.jsx(KN,{elementsRef:M,labelsRef:_,onMapChange:Xe,children:m.jsxs(ZN.Provider,{value:qe,children:[V&&H&&m.jsx(vx,{inert:xx(!W),cutout:L}),Oe]})})}),$f="base-ui-disable-scrollbar",VS={className:$f,getElement(e){return m.jsx("style",{nonce:e,href:$f,precedence:"base-ui:low",children:`.${$f}{scrollbar-width:none}.${$f}::-webkit-scrollbar{display:none}`})}},vj=E.createContext(void 0);function tA(e){return E.useContext(vj)}const Tj="ArrowUp",Sj="ArrowDown",Cj="ArrowLeft",kj="ArrowRight",wj="Home",Nj="End",Aj=new Set([Cj,kj]),_j=new Set([Tj,Sj]),Rj=new Set([...Aj,..._j]),Sx=new Set([...Rj,wj,Nj]),Oj=E.createContext(void 0),Ij={disableStyleElements:!1};function Mj(){return E.useContext(Oj)??Ij}const Lj={...ql,...Vl},Dj=E.forwardRef(function(t,n){const{render:r,className:i,style:a,finalFocus:l,...c}=t,{store:d,popupRef:f,onOpenChangeComplete:g,setOpen:h,valueRef:b,firstItemTextRef:x,selectedItemTextRef:v,multiple:w,handleScrollArrowVisibility:k,scrollHandlerRef:C,listRef:N,highlightItemOnHover:A}=pa(),{side:R,align:M,alignItemWithTriggerActive:_,isPositioned:D,setControlledAlignItemWithTrigger:I}=cj(),U=tA()!=null,j=jN(),X=yx(),{nonce:K,disableStyleElements:F}=Mj(),W=ft(d,ct.id),V=ft(d,ct.open),H=ft(d,ct.openMethod),q=ft(d,ct.mounted),J=ft(d,ct.popupProps),ue=ft(d,ct.transitionStatus),L=ft(d,ct.triggerElement),B=ft(d,ct.positionerElement),G=ft(d,ct.listElement),P=E.useRef(!1),ae=E.useRef(!1),ie=E.useRef({}),ce=Ol(),de=tt(Le=>{if(!B||!f.current||!ae.current)return;if(P.current||!_){k();return}const Ee=B.style.top==="0px",Oe=B.style.bottom==="0px";if(!Ee&&!Oe){k();return}const Ue=YS(B),Xe=gc(B.getBoundingClientRect().height,"y",Ue),qe=At(B),De=sn(B),ke=De.getComputedStyle(B),ye=parseFloat(ke.marginTop),Re=parseFloat(ke.marginBottom),Pe=qS(De.getComputedStyle(f.current)),ee=Math.min(qe.documentElement.clientHeight-ye-Re,Pe),pe=Le.scrollTop,se=Vf(Le);let re=0,Q=null,$=!1,oe=!1;const Se=et=>{B.style.height=`${et}px`},_e=(et,dt)=>{const ut=mc(et,0,ee-Xe);ut>0&&Se(Xe+ut),Le.scrollTop=dt,ee-(Xe+ut)<=ii&&(P.current=!0),k()},$e=Ee?se-pe:pe,ot=Math.min(Xe+$e,ee);if(re=ot,$e<=ii){_e($e,Ee?se:0);return}if(ee-ot>ii)Ee?oe=!0:Q=0;else if($=!0,Oe&&pe<se){const et=Xe+$e-ee;Q=pe-($e-et)}if(re=Math.ceil(re),re!==0&&Se(re),oe||Q!=null){const et=Vf(Le),dt=oe?et:mc(Q,0,et);Math.abs(Le.scrollTop-dt)>ii&&(Le.scrollTop=dt)}($||re>=ee-ii)&&(P.current=!0),k()});E.useImperativeHandle(C,()=>de,[de]),vo({open:V,ref:f,onComplete(){V&&g?.(!0)}});const he={open:V,transitionStatus:ue,side:R,align:M};Ye(()=>{!B||!f.current||Object.keys(ie.current).length||(ie.current={top:B.style.top||"0",left:B.style.left||"0",right:B.style.right,height:B.style.height,bottom:B.style.bottom,minHeight:B.style.minHeight,maxHeight:B.style.maxHeight,marginTop:B.style.marginTop,marginBottom:B.style.marginBottom})},[f,B]),Ye(()=>{V||_||(ae.current=!1,P.current=!1,Bh(B,ie.current))},[V,_,B,f]),Ye(()=>{const Le=f.current;if(!V||!L||!B||!Le||_&&!D||d.state.transitionStatus==="ending")return;if(!_){ae.current=!0,ce.request(k),Le.style.removeProperty("--transform-origin");return}const Ee=Pj(Le);Le.style.removeProperty("--transform-origin");try{let Oe=v.current;Oe?.isConnected||(Oe=!ct.hasSelectedValue(d.state)&&x.current?.isConnected?x.current:null);const Ue=b.current,Xe=sn(B),qe=Xe.getComputedStyle(B),De=Xe.getComputedStyle(Le),ke=At(L),ye=YS(L),Re=qf(L.getBoundingClientRect(),ye),Pe=qf(B.getBoundingClientRect(),ye),ee=Re.height,pe=G||Le,se=pe.scrollHeight,re=parseFloat(De.borderBottomWidth),Q=parseFloat(qe.marginTop)||10,$=parseFloat(qe.marginBottom)||10,oe=parseFloat(qe.minHeight)||100,Se=qS(De),_e=5,$e=5,ot=20,et=ke.documentElement.clientHeight-Q-$,dt=ke.documentElement.clientWidth,ut=et-Re.bottom+ee;let Ve,Rt=X==="rtl"?Re.right-Pe.width:Re.left,Pt=0;if(Oe&&Ue){const Et=qf(Ue.getBoundingClientRect(),ye);Ve=qf(Oe.getBoundingClientRect(),ye),Rt=Pe.left+(X==="rtl"?Et.right-Ve.right:Et.left-Ve.left);const an=Et.top-Re.top+Et.height/2;Pt=Ve.top-Pe.top+Ve.height/2-an}const lt=ut+Pt+$+re;let Lt=Math.min(et,lt);const Wt=et-Q-$,$t=lt-Lt,Zt=dt-$e;B.style.left=`${mc(Rt,_e,Zt-Pe.width)}px`,B.style.height=`${Lt}px`,B.style.maxHeight="none",B.style.marginTop=`${Q}px`,B.style.marginBottom=`${$}px`,Le.style.height="100%";const Ke=Vf(pe),yt=$t>=Ke-ii;yt&&(Lt=Math.min(et,Pe.height)-($t-Ke));const zt=Re.top<ot||Re.bottom>et-ot||Math.ceil(Lt)+ii<Math.min(se,oe),Jt=(Xe.visualViewport?.scale??1)!==1&&ca;if(zt||Jt){ae.current=!0,Bh(B,ie.current),I(!1);return}const Xn=Math.max(oe,Lt);if(yt){const Et=Math.max(0,et-lt);B.style.top=Pe.height>=Wt?"0":`${Et}px`,B.style.height=`${Lt}px`,pe.scrollTop=Vf(pe)}else B.style.bottom="0",pe.scrollTop=$t;if(Ve){const Et=Pe.top,an=Pe.height,Er=Ve.top+Ve.height/2,mn=an>0?(Er-Et)/an*100:50,Tn=mc(mn,0,100);Le.style.setProperty("--transform-origin",`50% ${Tn}%`)}(Xn===et||Lt>=Se)&&(P.current=!0),k(),A&&d.state.selectedIndex===null&&d.state.activeIndex===null&&N.current[0]!=null&&d.set("activeIndex",0),ae.current=!0}finally{Ee()}},[d,V,B,L,b,x,v,f,k,_,I,ce,G,N,A,X,D]),E.useEffect(()=>{if(!_||!B||!V)return;const Le=sn(B);function Ee(Oe){h(!1,pt(vD,Oe))}return Tt(Le,"resize",Ee)},[h,_,B,V]);const ve={...G?{role:"presentation","aria-orientation":void 0}:{role:"listbox","aria-multiselectable":w||void 0,id:`${W}-list`},onKeyDown(Le){U&&Sx.has(Le.key)&&Le.stopPropagation()},onScroll(Le){G||de(Le.currentTarget)},..._&&{style:G?{height:"100%"}:dj}},Fe=Nn("div",t,{ref:[n,f],state:he,stateAttributesMapping:Lj,props:[J,ve,Cp(ue),{className:!G&&_?VS.className:void 0},c]});return m.jsxs(E.Fragment,{children:[!F&&VS.getElement(K),m.jsx(tx,{context:j,modal:!1,disabled:!q,openInteractionType:H,returnFocus:l,restoreFocus:!0,children:Fe})]})});function qS(e){const t=e.maxHeight||"";return t.endsWith("px")&&parseFloat(t)||1/0}function Vf(e){return YN(e.scrollHeight,e.clientHeight)}function YS(e){return bN.getScale(e)}function gc(e,t,n){return e/n[t]}function qf(e,t){return zc({x:gc(e.x,"x",t),y:gc(e.y,"y",t),width:gc(e.width,"x",t),height:gc(e.height,"y",t)})}const GS=[["transform","none"],["scale","1"],["translate","0 0"]];function Pj(e){const{style:t}=e,n={};for(const[r,i]of GS)n[r]=t.getPropertyValue(r),t.setProperty(r,i,"important");return()=>{for(const[r]of GS){const i=n[r];i?t.setProperty(r,i):t.removeProperty(r)}}}let nA=(function(e){return e[e.None=0]="None",e[e.GuessFromOrder=1]="GuessFromOrder",e})({});function Cx(e={}){const{label:t,metadata:n,textRef:r,indexGuessBehavior:i,index:a}=e,{register:l,unregister:c,subscribeMapChange:d,elementsRef:f,labelsRef:g,nextIndexRef:h}=tj(),b=E.useRef(-1),[x,v]=E.useState(a??(i===nA.GuessFromOrder?()=>{if(b.current===-1){const C=h.current;h.current+=1,b.current=C}return b.current}:-1)),w=E.useRef(null),k=E.useCallback(C=>{if(w.current=C,x!==-1&&C!==null&&(f.current[x]=C,g)){const N=t!==void 0;g.current[x]=N?t:r?.current?.textContent??C.textContent}},[x,f,g,t,r]);return Ye(()=>{if(a!=null)return;const C=w.current;if(C)return l(C,n),()=>{c(C)}},[a,l,c,n]),Ye(()=>{if(a==null)return d(C=>{const N=w.current?C.get(w.current)?.index:null;N!=null&&v(N)})},[a,d,v]),{ref:k,index:x}}const rA=E.createContext(void 0);function kx(){const e=E.useContext(rA);if(!e)throw new Error(Ln(57));return e}const jj=E.memo(E.forwardRef(function(t,n){const{render:r,className:i,style:a,value:l=null,label:c,disabled:d=!1,nativeButton:f=!1,...g}=t,h=E.useRef(null),b=Cx({label:c,textRef:h,indexGuessBehavior:nA.GuessFromOrder}),{store:x,itemProps:v,setOpen:w,setValue:k,selectionRef:C,typingRef:N,valuesRef:A,multiple:R,selectedItemTextRef:M,disabled:_,readOnly:D}=pa(),I=ft(x,ct.isActive,b.index),U=ft(x,ct.open),j=ft(x,ct.isSelected,l),X=ft(x,ct.isSelectedByFocus,b.index),K=ft(x,ct.isItemEqualToValue),F=b.index,W=F!==-1,V=E.useRef(null);Ye(()=>{if(!W)return;const de=A.current;return de[F]=l,()=>{delete de[F]}},[W,F,l,A]),Ye(()=>{if(!W)return;const de=x.state.value;let he=de;R&&Array.isArray(de)&&(he=de.length>0?de[de.length-1]:void 0),he!==void 0&&lo(l,he,K)&&(x.set("selectedIndex",F),h.current&&(M.current=h.current))},[W,F,R,K,x,l,M]);const H=E.useRef(null),q=E.useRef("mouse"),J=E.useRef(!1),{getButtonProps:ue,buttonRef:L}=Yl({disabled:d,focusableWhenDisabled:!0,native:f,composite:!0}),B={disabled:d,selected:j,highlighted:I};function G(de){if(_||D)return;const he=x.state.value;if(R){const ve=Array.isArray(he)?he:[],Fe=j?_P(ve,l,K):[...ve,l];k(Fe,pt(vc,de))}else k(l,pt(vc,de)),w(!1,pt(vc,de))}function P(){C.current.dragY=0}const ae={role:"option","aria-selected":j,tabIndex:U&&I?0:-1,onKeyDown(de){H.current=de.key,x.set("activeIndex",F),de.key===" "&&N.current&&de.preventDefault()},onClick(de){const he=de.type==="click"&&q.current!=="touch",ve=de.nativeEvent.pointerType,Fe=he&&F1(de.nativeEvent)&&(ve!==void 0||I),Le=he&&!Fe&&!J.current;J.current=!1,!(de.type==="keydown"&&H.current===null)&&(d||de.type==="keydown"&&H.current===" "&&N.current||Le||(H.current=null,G(de.nativeEvent)))},onPointerEnter(de){q.current=de.pointerType},onPointerMove(de){if(de.pointerType==="mouse"&&de.buttons===1){const he=C.current;he.dragY+=de.movementY,he.dragY**2>=64&&(he.allowUnselectedMouseUp=!0)}},onPointerDown(de){q.current=de.pointerType,J.current=!0,P()},onMouseUp(){if(P(),d||q.current==="touch"||J.current)return;const de=!C.current.allowSelectedMouseUp&&j,he=!C.current.allowUnselectedMouseUp&&!j;de||he||(J.current=!0,V.current?.click(),J.current=!1)}},ie=Nn("div",t,{ref:[L,n,b.ref,V],state:B,props:[v,ae,g,ue]}),ce=E.useMemo(()=>({selected:j,index:F,textRef:h,selectedByFocus:X,hasRegistered:W}),[j,F,h,X,W]);return m.jsx(rA.Provider,{value:ce,children:ie})})),Bj=E.forwardRef(function(t,n){const r=t.keepMounted??!1,{selected:i}=kx();return r||i?m.jsx(Hj,{...t,ref:n}):null}),Hj=E.memo(E.forwardRef((e,t)=>{const{render:n,className:r,style:i,keepMounted:a,...l}=e,{selected:c}=kx(),d=E.useRef(null),{transitionStatus:f,setMounted:g}=sx(c),b=Nn("span",e,{ref:[t,d],state:{selected:c,transitionStatus:f},props:[{"aria-hidden":!0,children:"✔️"},l],stateAttributesMapping:Vl});return vo({open:c,ref:d,onComplete(){c||g(!1)}}),b})),Uj=E.memo(E.forwardRef(function(t,n){const{index:r,textRef:i,selectedByFocus:a,hasRegistered:l}=kx(),{firstItemTextRef:c,selectedItemTextRef:d}=pa(),{render:f,className:g,style:h,...b}=t,x=E.useCallback(w=>{w&&(l&&r===0&&(c.current=w),l&&a&&(d.current=w))},[c,d,r,a,l]);return Nn("div",t,{ref:[x,n,i],props:b})}));/**
67
+ * @license lucide-react v1.25.0 - ISC
68
+ *
69
+ * This source code is licensed under the ISC license.
70
+ * See the LICENSE file in the root directory of this source tree.
71
+ */const sA=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim();/**
72
+ * @license lucide-react v1.25.0 - ISC
73
+ *
74
+ * This source code is licensed under the ISC license.
75
+ * See the LICENSE file in the root directory of this source tree.
76
+ */const zj=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();/**
77
+ * @license lucide-react v1.25.0 - ISC
78
+ *
79
+ * This source code is licensed under the ISC license.
80
+ * See the LICENSE file in the root directory of this source tree.
81
+ */const Fj=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,r)=>r?r.toUpperCase():n.toLowerCase());/**
82
+ * @license lucide-react v1.25.0 - ISC
83
+ *
84
+ * This source code is licensed under the ISC license.
85
+ * See the LICENSE file in the root directory of this source tree.
86
+ */const XS=e=>{const t=Fj(e);return t.charAt(0).toUpperCase()+t.slice(1)};/**
87
+ * @license lucide-react v1.25.0 - ISC
88
+ *
89
+ * This source code is licensed under the ISC license.
90
+ * See the LICENSE file in the root directory of this source tree.
91
+ */var P0={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
92
+ * @license lucide-react v1.25.0 - ISC
93
+ *
94
+ * This source code is licensed under the ISC license.
95
+ * See the LICENSE file in the root directory of this source tree.
96
+ */const $j=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0;return!1},Vj=E.createContext({}),qj=()=>E.useContext(Vj),Yj=E.forwardRef(({color:e,size:t,strokeWidth:n,absoluteStrokeWidth:r,className:i="",children:a,iconNode:l,...c},d)=>{const{size:f=24,strokeWidth:g=2,absoluteStrokeWidth:h=!1,color:b="currentColor",className:x=""}=qj()??{},v=r??h?Number(n??g)*24/Number(t??f):n??g;return E.createElement("svg",{ref:d,...P0,width:t??f??P0.width,height:t??f??P0.height,stroke:e??b,strokeWidth:v,className:sA("lucide",x,i),...!a&&!$j(c)&&{"aria-hidden":"true"},...c},[...l.map(([w,k])=>E.createElement(w,k)),...Array.isArray(a)?a:[a]])});/**
97
+ * @license lucide-react v1.25.0 - ISC
98
+ *
99
+ * This source code is licensed under the ISC license.
100
+ * See the LICENSE file in the root directory of this source tree.
101
+ */const Ge=(e,t)=>{const n=E.forwardRef(({className:r,...i},a)=>E.createElement(Yj,{ref:a,iconNode:t,className:sA(`lucide-${zj(XS(e))}`,`lucide-${e}`,r),...i}));return n.displayName=XS(e),n};/**
102
+ * @license lucide-react v1.25.0 - ISC
103
+ *
104
+ * This source code is licensed under the ISC license.
105
+ * See the LICENSE file in the root directory of this source tree.
106
+ */const Gj=[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]],Xj=Ge("arrow-down",Gj);/**
107
+ * @license lucide-react v1.25.0 - ISC
108
+ *
109
+ * This source code is licensed under the ISC license.
110
+ * See the LICENSE file in the root directory of this source tree.
111
+ */const Kj=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],iA=Ge("arrow-left",Kj);/**
112
+ * @license lucide-react v1.25.0 - ISC
113
+ *
114
+ * This source code is licensed under the ISC license.
115
+ * See the LICENSE file in the root directory of this source tree.
116
+ */const Qj=[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]],Wj=Ge("arrow-up",Qj);/**
117
+ * @license lucide-react v1.25.0 - ISC
118
+ *
119
+ * This source code is licensed under the ISC license.
120
+ * See the LICENSE file in the root directory of this source tree.
121
+ */const Zj=[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M16 8v5a3 3 0 0 0 6 0v-1a10 10 0 1 0-4 8",key:"7n84p3"}]],Jj=Ge("at-sign",Zj);/**
122
+ * @license lucide-react v1.25.0 - ISC
123
+ *
124
+ * This source code is licensed under the ISC license.
125
+ * See the LICENSE file in the root directory of this source tree.
126
+ */const e9=[["path",{d:"M12 18V5",key:"adv99a"}],["path",{d:"M15 13a4.17 4.17 0 0 1-3-4 4.17 4.17 0 0 1-3 4",key:"1e3is1"}],["path",{d:"M17.598 6.5A3 3 0 1 0 12 5a3 3 0 1 0-5.598 1.5",key:"1gqd8o"}],["path",{d:"M17.997 5.125a4 4 0 0 1 2.526 5.77",key:"iwvgf7"}],["path",{d:"M18 18a4 4 0 0 0 2-7.464",key:"efp6ie"}],["path",{d:"M19.967 17.483A4 4 0 1 1 12 18a4 4 0 1 1-7.967-.517",key:"1gq6am"}],["path",{d:"M6 18a4 4 0 0 1-2-7.464",key:"k1g0md"}],["path",{d:"M6.003 5.125a4 4 0 0 0-2.526 5.77",key:"q97ue3"}]],t9=Ge("brain",e9);/**
127
+ * @license lucide-react v1.25.0 - ISC
128
+ *
129
+ * This source code is licensed under the ISC license.
130
+ * See the LICENSE file in the root directory of this source tree.
131
+ */const n9=[["path",{d:"M16 14v2.2l1.6 1",key:"fo4ql5"}],["path",{d:"M16 2v4",key:"4m81vk"}],["path",{d:"M21 7.5V6a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h3.5",key:"1osxxc"}],["path",{d:"M3 10h5",key:"r794hk"}],["path",{d:"M8 2v4",key:"1cmpym"}],["circle",{cx:"16",cy:"16",r:"6",key:"qoo3c4"}]],r9=Ge("calendar-clock",n9);/**
132
+ * @license lucide-react v1.25.0 - ISC
133
+ *
134
+ * This source code is licensed under the ISC license.
135
+ * See the LICENSE file in the root directory of this source tree.
136
+ */const s9=[["path",{d:"M21 12c.552 0 1.005-.449.95-.998a10 10 0 0 0-8.953-8.951c-.55-.055-.998.398-.998.95v8a1 1 0 0 0 1 1z",key:"pzmjnu"}],["path",{d:"M21.21 15.89A10 10 0 1 1 8 2.83",key:"k2fpak"}]],i9=Ge("chart-pie",s9);/**
137
+ * @license lucide-react v1.25.0 - ISC
138
+ *
139
+ * This source code is licensed under the ISC license.
140
+ * See the LICENSE file in the root directory of this source tree.
141
+ */const a9=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],aA=Ge("check",a9);/**
142
+ * @license lucide-react v1.25.0 - ISC
143
+ *
144
+ * This source code is licensed under the ISC license.
145
+ * See the LICENSE file in the root directory of this source tree.
146
+ */const o9=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],oA=Ge("chevron-down",o9);/**
147
+ * @license lucide-react v1.25.0 - ISC
148
+ *
149
+ * This source code is licensed under the ISC license.
150
+ * See the LICENSE file in the root directory of this source tree.
151
+ */const l9=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],Hh=Ge("chevron-left",l9);/**
152
+ * @license lucide-react v1.25.0 - ISC
153
+ *
154
+ * This source code is licensed under the ISC license.
155
+ * See the LICENSE file in the root directory of this source tree.
156
+ */const u9=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],kp=Ge("chevron-right",u9);/**
157
+ * @license lucide-react v1.25.0 - ISC
158
+ *
159
+ * This source code is licensed under the ISC license.
160
+ * See the LICENSE file in the root directory of this source tree.
161
+ */const c9=[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]],d9=Ge("chevrons-up-down",c9);/**
162
+ * @license lucide-react v1.25.0 - ISC
163
+ *
164
+ * This source code is licensed under the ISC license.
165
+ * See the LICENSE file in the root directory of this source tree.
166
+ */const f9=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 8v8",key:"napkw2"}],["path",{d:"m8 12 4 4 4-4",key:"k98ssh"}]],h9=Ge("circle-arrow-down",f9);/**
167
+ * @license lucide-react v1.25.0 - ISC
168
+ *
169
+ * This source code is licensed under the ISC license.
170
+ * See the LICENSE file in the root directory of this source tree.
171
+ */const p9=[["rect",{width:"8",height:"4",x:"8",y:"2",rx:"1",ry:"1",key:"tgr4d6"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2",key:"116196"}],["path",{d:"M12 11h4",key:"1jrz19"}],["path",{d:"M12 16h4",key:"n85exb"}],["path",{d:"M8 11h.01",key:"1dfujw"}],["path",{d:"M8 16h.01",key:"18s6g9"}]],m9=Ge("clipboard-list",p9);/**
172
+ * @license lucide-react v1.25.0 - ISC
173
+ *
174
+ * This source code is licensed under the ISC license.
175
+ * See the LICENSE file in the root directory of this source tree.
176
+ */const g9=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6l4 2",key:"mmk7yg"}]],b9=Ge("clock",g9);/**
177
+ * @license lucide-react v1.25.0 - ISC
178
+ *
179
+ * This source code is licensed under the ISC license.
180
+ * See the LICENSE file in the root directory of this source tree.
181
+ */const x9=[["path",{d:"m16 18 6-6-6-6",key:"eg8j8"}],["path",{d:"m8 6-6 6 6 6",key:"ppft3o"}]],wx=Ge("code",x9);/**
182
+ * @license lucide-react v1.25.0 - ISC
183
+ *
184
+ * This source code is licensed under the ISC license.
185
+ * See the LICENSE file in the root directory of this source tree.
186
+ */const y9=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],E9=Ge("copy",y9);/**
187
+ * @license lucide-react v1.25.0 - ISC
188
+ *
189
+ * This source code is licensed under the ISC license.
190
+ * See the LICENSE file in the root directory of this source tree.
191
+ */const v9=[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]],lA=Ge("download",v9);/**
192
+ * @license lucide-react v1.25.0 - ISC
193
+ *
194
+ * This source code is licensed under the ISC license.
195
+ * See the LICENSE file in the root directory of this source tree.
196
+ */const T9=[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]],S9=Ge("ellipsis",T9);/**
197
+ * @license lucide-react v1.25.0 - ISC
198
+ *
199
+ * This source code is licensed under the ISC license.
200
+ * See the LICENSE file in the root directory of this source tree.
201
+ */const C9=[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],uA=Ge("eye",C9);/**
202
+ * @license lucide-react v1.25.0 - ISC
203
+ *
204
+ * This source code is licensed under the ISC license.
205
+ * See the LICENSE file in the root directory of this source tree.
206
+ */const k9=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M9 10h6",key:"9gxzsh"}],["path",{d:"M12 13V7",key:"h0r20n"}],["path",{d:"M9 17h6",key:"r8uit2"}]],w9=Ge("file-diff",k9);/**
207
+ * @license lucide-react v1.25.0 - ISC
208
+ *
209
+ * This source code is licensed under the ISC license.
210
+ * See the LICENSE file in the root directory of this source tree.
211
+ */const N9=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],A9=Ge("file-exclamation-point",N9);/**
212
+ * @license lucide-react v1.25.0 - ISC
213
+ *
214
+ * This source code is licensed under the ISC license.
215
+ * See the LICENSE file in the root directory of this source tree.
216
+ */const _9=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],Nx=Ge("file-text",_9);/**
217
+ * @license lucide-react v1.25.0 - ISC
218
+ *
219
+ * This source code is licensed under the ISC license.
220
+ * See the LICENSE file in the root directory of this source tree.
221
+ */const R9=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}]],wp=Ge("file",R9);/**
222
+ * @license lucide-react v1.25.0 - ISC
223
+ *
224
+ * This source code is licensed under the ISC license.
225
+ * See the LICENSE file in the root directory of this source tree.
226
+ */const O9=[["path",{d:"M10.3 20H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.98a2 2 0 0 1 1.69.9l.66 1.2A2 2 0 0 0 12 6h8a2 2 0 0 1 2 2v3.3",key:"128dxu"}],["path",{d:"m14.305 19.53.923-.382",key:"3m78fa"}],["path",{d:"m15.228 16.852-.923-.383",key:"npixar"}],["path",{d:"m16.852 15.228-.383-.923",key:"5xggr7"}],["path",{d:"m16.852 20.772-.383.924",key:"dpfhf9"}],["path",{d:"m19.148 15.228.383-.923",key:"1reyyz"}],["path",{d:"m19.53 21.696-.382-.924",key:"1goivc"}],["path",{d:"m20.772 16.852.924-.383",key:"htqkph"}],["path",{d:"m20.772 19.148.924.383",key:"9w9pjp"}],["circle",{cx:"18",cy:"18",r:"3",key:"1xkwt0"}]],I9=Ge("folder-cog",O9);/**
227
+ * @license lucide-react v1.25.0 - ISC
228
+ *
229
+ * This source code is licensed under the ISC license.
230
+ * See the LICENSE file in the root directory of this source tree.
231
+ */const M9=[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]],L9=Ge("folder-open",M9);/**
232
+ * @license lucide-react v1.25.0 - ISC
233
+ *
234
+ * This source code is licensed under the ISC license.
235
+ * See the LICENSE file in the root directory of this source tree.
236
+ */const D9=[["path",{d:"M10.7 20H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H20a2 2 0 0 1 2 2v4.1",key:"1bw5m7"}],["path",{d:"m21 21-1.9-1.9",key:"1g2n9r"}],["circle",{cx:"17",cy:"17",r:"3",key:"18b49y"}]],P9=Ge("folder-search",D9);/**
237
+ * @license lucide-react v1.25.0 - ISC
238
+ *
239
+ * This source code is licensed under the ISC license.
240
+ * See the LICENSE file in the root directory of this source tree.
241
+ */const j9=[["path",{d:"M20 10a1 1 0 0 0 1-1V6a1 1 0 0 0-1-1h-2.5a1 1 0 0 1-.8-.4l-.9-1.2A1 1 0 0 0 15 3h-2a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z",key:"hod4my"}],["path",{d:"M20 21a1 1 0 0 0 1-1v-3a1 1 0 0 0-1-1h-2.9a1 1 0 0 1-.88-.55l-.42-.85a1 1 0 0 0-.92-.6H13a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z",key:"w4yl2u"}],["path",{d:"M3 5a2 2 0 0 0 2 2h3",key:"f2jnh7"}],["path",{d:"M3 3v13a2 2 0 0 0 2 2h3",key:"k8epm1"}]],B9=Ge("folder-tree",j9);/**
242
+ * @license lucide-react v1.25.0 - ISC
243
+ *
244
+ * This source code is licensed under the ISC license.
245
+ * See the LICENSE file in the root directory of this source tree.
246
+ */const H9=[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]],cA=Ge("folder",H9);/**
247
+ * @license lucide-react v1.25.0 - ISC
248
+ *
249
+ * This source code is licensed under the ISC license.
250
+ * See the LICENSE file in the root directory of this source tree.
251
+ */const U9=[["path",{d:"m12 14 4-4",key:"9kzdfg"}],["path",{d:"M3.34 19a10 10 0 1 1 17.32 0",key:"19p75a"}]],z9=Ge("gauge",U9);/**
252
+ * @license lucide-react v1.25.0 - ISC
253
+ *
254
+ * This source code is licensed under the ISC license.
255
+ * See the LICENSE file in the root directory of this source tree.
256
+ */const F9=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]],KS=Ge("globe",F9);/**
257
+ * @license lucide-react v1.25.0 - ISC
258
+ *
259
+ * This source code is licensed under the ISC license.
260
+ * See the LICENSE file in the root directory of this source tree.
261
+ */const $9=[["path",{d:"M18 11V6a2 2 0 0 0-2-2a2 2 0 0 0-2 2",key:"1fvzgz"}],["path",{d:"M14 10V4a2 2 0 0 0-2-2a2 2 0 0 0-2 2v2",key:"1kc0my"}],["path",{d:"M10 10.5V6a2 2 0 0 0-2-2a2 2 0 0 0-2 2v8",key:"10h0bg"}],["path",{d:"M18 8a2 2 0 1 1 4 0v6a8 8 0 0 1-8 8h-2c-2.8 0-4.5-.86-5.99-2.34l-3.6-3.6a2 2 0 0 1 2.83-2.82L7 15",key:"1s1gnw"}]],dA=Ge("hand",$9);/**
262
+ * @license lucide-react v1.25.0 - ISC
263
+ *
264
+ * This source code is licensed under the ISC license.
265
+ * See the LICENSE file in the root directory of this source tree.
266
+ */const V9=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]],q9=Ge("history",V9);/**
267
+ * @license lucide-react v1.25.0 - ISC
268
+ *
269
+ * This source code is licensed under the ISC license.
270
+ * See the LICENSE file in the root directory of this source tree.
271
+ */const Y9=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]],G9=Ge("image",Y9);/**
272
+ * @license lucide-react v1.25.0 - ISC
273
+ *
274
+ * This source code is licensed under the ISC license.
275
+ * See the LICENSE file in the root directory of this source tree.
276
+ */const X9=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],K9=Ge("info",X9);/**
277
+ * @license lucide-react v1.25.0 - ISC
278
+ *
279
+ * This source code is licensed under the ISC license.
280
+ * See the LICENSE file in the root directory of this source tree.
281
+ */const Q9=[["path",{d:"M9 17H7A5 5 0 0 1 7 7h2",key:"8i5ue5"}],["path",{d:"M15 7h2a5 5 0 1 1 0 10h-2",key:"1b9ql8"}],["line",{x1:"8",x2:"16",y1:"12",y2:"12",key:"1jonct"}]],fA=Ge("link-2",Q9);/**
282
+ * @license lucide-react v1.25.0 - ISC
283
+ *
284
+ * This source code is licensed under the ISC license.
285
+ * See the LICENSE file in the root directory of this source tree.
286
+ */const W9=[["path",{d:"M13 5h8",key:"a7qcls"}],["path",{d:"M13 12h8",key:"h98zly"}],["path",{d:"M13 19h8",key:"c3s6r1"}],["path",{d:"m3 17 2 2 4-4",key:"1jhpwq"}],["path",{d:"m3 7 2 2 4-4",key:"1obspn"}]],hA=Ge("list-checks",W9);/**
287
+ * @license lucide-react v1.25.0 - ISC
288
+ *
289
+ * This source code is licensed under the ISC license.
290
+ * See the LICENSE file in the root directory of this source tree.
291
+ */const Z9=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],J9=Ge("loader-circle",Z9);/**
292
+ * @license lucide-react v1.25.0 - ISC
293
+ *
294
+ * This source code is licensed under the ISC license.
295
+ * See the LICENSE file in the root directory of this source tree.
296
+ */const e7=[["path",{d:"M2.992 16.342a2 2 0 0 1 .094 1.167l-1.065 3.29a1 1 0 0 0 1.236 1.168l3.413-.998a2 2 0 0 1 1.099.092 10 10 0 1 0-4.777-4.719",key:"1sd12s"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]],pA=Ge("message-circle-question-mark",e7);/**
297
+ * @license lucide-react v1.25.0 - ISC
298
+ *
299
+ * This source code is licensed under the ISC license.
300
+ * See the LICENSE file in the root directory of this source tree.
301
+ */const t7=[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}],["path",{d:"M7 11h10",key:"1twpyw"}],["path",{d:"M7 15h6",key:"d9of3u"}],["path",{d:"M7 7h8",key:"af5zfr"}]],n7=Ge("message-square-text",t7);/**
302
+ * @license lucide-react v1.25.0 - ISC
303
+ *
304
+ * This source code is licensed under the ISC license.
305
+ * See the LICENSE file in the root directory of this source tree.
306
+ */const r7=[["path",{d:"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401",key:"kfwtm"}]],s7=Ge("moon",r7);/**
307
+ * @license lucide-react v1.25.0 - ISC
308
+ *
309
+ * This source code is licensed under the ISC license.
310
+ * See the LICENSE file in the root directory of this source tree.
311
+ */const i7=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"m16 15-3-3 3-3",key:"14y99z"}]],mA=Ge("panel-left-close",i7);/**
312
+ * @license lucide-react v1.25.0 - ISC
313
+ *
314
+ * This source code is licensed under the ISC license.
315
+ * See the LICENSE file in the root directory of this source tree.
316
+ */const a7=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"m14 9 3 3-3 3",key:"8010ee"}]],gA=Ge("panel-left-open",a7);/**
317
+ * @license lucide-react v1.25.0 - ISC
318
+ *
319
+ * This source code is licensed under the ISC license.
320
+ * See the LICENSE file in the root directory of this source tree.
321
+ */const o7=[["path",{d:"m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551",key:"1miecu"}]],l7=Ge("paperclip",o7);/**
322
+ * @license lucide-react v1.25.0 - ISC
323
+ *
324
+ * This source code is licensed under the ISC license.
325
+ * See the LICENSE file in the root directory of this source tree.
326
+ */const u7=[["path",{d:"M13 21h8",key:"1jsn5i"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}],["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}]],c7=Ge("pencil-line",u7);/**
327
+ * @license lucide-react v1.25.0 - ISC
328
+ *
329
+ * This source code is licensed under the ISC license.
330
+ * See the LICENSE file in the root directory of this source tree.
331
+ */const d7=[["path",{d:"M12 22v-5",key:"1ega77"}],["path",{d:"M15 8V2",key:"18g5xt"}],["path",{d:"M17 8a1 1 0 0 1 1 1v4a4 4 0 0 1-4 4h-4a4 4 0 0 1-4-4V9a1 1 0 0 1 1-1z",key:"1xoxul"}],["path",{d:"M9 8V2",key:"14iosj"}]],f7=Ge("plug",d7);/**
332
+ * @license lucide-react v1.25.0 - ISC
333
+ *
334
+ * This source code is licensed under the ISC license.
335
+ * See the LICENSE file in the root directory of this source tree.
336
+ */const h7=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],Ax=Ge("plus",h7);/**
337
+ * @license lucide-react v1.25.0 - ISC
338
+ *
339
+ * This source code is licensed under the ISC license.
340
+ * See the LICENSE file in the root directory of this source tree.
341
+ */const p7=[["path",{d:"M18.36 6.64A9 9 0 0 1 20.77 15",key:"dxknvb"}],["path",{d:"M6.16 6.16a9 9 0 1 0 12.68 12.68",key:"1x7qb5"}],["path",{d:"M12 2v4",key:"3427ic"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]],m7=Ge("power-off",p7);/**
342
+ * @license lucide-react v1.25.0 - ISC
343
+ *
344
+ * This source code is licensed under the ISC license.
345
+ * See the LICENSE file in the root directory of this source tree.
346
+ */const g7=[["path",{d:"M12 2v10",key:"mnfbl"}],["path",{d:"M18.4 6.6a9 9 0 1 1-12.77.04",key:"obofu9"}]],b7=Ge("power",g7);/**
347
+ * @license lucide-react v1.25.0 - ISC
348
+ *
349
+ * This source code is licensed under the ISC license.
350
+ * See the LICENSE file in the root directory of this source tree.
351
+ */const x7=[["path",{d:"M15.39 4.39a1 1 0 0 0 1.68-.474 2.5 2.5 0 1 1 3.014 3.015 1 1 0 0 0-.474 1.68l1.683 1.682a2.414 2.414 0 0 1 0 3.414L19.61 15.39a1 1 0 0 1-1.68-.474 2.5 2.5 0 1 0-3.014 3.015 1 1 0 0 1 .474 1.68l-1.683 1.682a2.414 2.414 0 0 1-3.414 0L8.61 19.61a1 1 0 0 0-1.68.474 2.5 2.5 0 1 1-3.014-3.015 1 1 0 0 0 .474-1.68l-1.683-1.682a2.414 2.414 0 0 1 0-3.414L4.39 8.61a1 1 0 0 1 1.68.474 2.5 2.5 0 1 0 3.014-3.015 1 1 0 0 1-.474-1.68l1.683-1.682a2.414 2.414 0 0 1 3.414 0z",key:"w46dr5"}]],y7=Ge("puzzle",x7);/**
352
+ * @license lucide-react v1.25.0 - ISC
353
+ *
354
+ * This source code is licensed under the ISC license.
355
+ * See the LICENSE file in the root directory of this source tree.
356
+ */const E7=[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]],Np=Ge("refresh-cw",E7);/**
357
+ * @license lucide-react v1.25.0 - ISC
358
+ *
359
+ * This source code is licensed under the ISC license.
360
+ * See the LICENSE file in the root directory of this source tree.
361
+ */const v7=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]],T7=Ge("rotate-ccw",v7);/**
362
+ * @license lucide-react v1.25.0 - ISC
363
+ *
364
+ * This source code is licensed under the ISC license.
365
+ * See the LICENSE file in the root directory of this source tree.
366
+ */const S7=[["path",{d:"M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8",key:"1p45f6"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}]],_x=Ge("rotate-cw",S7);/**
367
+ * @license lucide-react v1.25.0 - ISC
368
+ *
369
+ * This source code is licensed under the ISC license.
370
+ * See the LICENSE file in the root directory of this source tree.
371
+ */const C7=[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]],k7=Ge("save",C7);/**
372
+ * @license lucide-react v1.25.0 - ISC
373
+ *
374
+ * This source code is licensed under the ISC license.
375
+ * See the LICENSE file in the root directory of this source tree.
376
+ */const w7=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],Rx=Ge("search",w7);/**
377
+ * @license lucide-react v1.25.0 - ISC
378
+ *
379
+ * This source code is licensed under the ISC license.
380
+ * See the LICENSE file in the root directory of this source tree.
381
+ */const N7=[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],A7=Ge("settings",N7);/**
382
+ * @license lucide-react v1.25.0 - ISC
383
+ *
384
+ * This source code is licensed under the ISC license.
385
+ * See the LICENSE file in the root directory of this source tree.
386
+ */const _7=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],R7=Ge("shield-check",_7);/**
387
+ * @license lucide-react v1.25.0 - ISC
388
+ *
389
+ * This source code is licensed under the ISC license.
390
+ * See the LICENSE file in the root directory of this source tree.
391
+ */const O7=[["path",{d:"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z",key:"1s2grr"}],["path",{d:"M20 2v4",key:"1rf3ol"}],["path",{d:"M22 4h-4",key:"gwowj6"}],["circle",{cx:"4",cy:"20",r:"2",key:"6kqj1y"}]],Ap=Ge("sparkles",O7);/**
392
+ * @license lucide-react v1.25.0 - ISC
393
+ *
394
+ * This source code is licensed under the ISC license.
395
+ * See the LICENSE file in the root directory of this source tree.
396
+ */const I7=[["path",{d:"M21 10.656V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h12.344",key:"2acyp4"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]],M7=Ge("square-check-big",I7);/**
397
+ * @license lucide-react v1.25.0 - ISC
398
+ *
399
+ * This source code is licensed under the ISC license.
400
+ * See the LICENSE file in the root directory of this source tree.
401
+ */const L7=[["path",{d:"M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7",key:"1m0v6g"}],["path",{d:"M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z",key:"ohrbg2"}]],D7=Ge("square-pen",L7);/**
402
+ * @license lucide-react v1.25.0 - ISC
403
+ *
404
+ * This source code is licensed under the ISC license.
405
+ * See the LICENSE file in the root directory of this source tree.
406
+ */const P7=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["line",{x1:"9",x2:"15",y1:"15",y2:"9",key:"1dfufj"}]],j7=Ge("square-slash",P7);/**
407
+ * @license lucide-react v1.25.0 - ISC
408
+ *
409
+ * This source code is licensed under the ISC license.
410
+ * See the LICENSE file in the root directory of this source tree.
411
+ */const B7=[["path",{d:"m7 11 2-2-2-2",key:"1lz0vl"}],["path",{d:"M11 13h4",key:"1p7l4v"}],["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}]],H7=Ge("square-terminal",B7);/**
412
+ * @license lucide-react v1.25.0 - ISC
413
+ *
414
+ * This source code is licensed under the ISC license.
415
+ * See the LICENSE file in the root directory of this source tree.
416
+ */const U7=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]],z7=Ge("square",U7);/**
417
+ * @license lucide-react v1.25.0 - ISC
418
+ *
419
+ * This source code is licensed under the ISC license.
420
+ * See the LICENSE file in the root directory of this source tree.
421
+ */const F7=[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]],$7=Ge("sun",F7);/**
422
+ * @license lucide-react v1.25.0 - ISC
423
+ *
424
+ * This source code is licensed under the ISC license.
425
+ * See the LICENSE file in the root directory of this source tree.
426
+ */const V7=[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]],Ub=Ge("terminal",V7);/**
427
+ * @license lucide-react v1.25.0 - ISC
428
+ *
429
+ * This source code is licensed under the ISC license.
430
+ * See the LICENSE file in the root directory of this source tree.
431
+ */const q7=[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],Ox=Ge("trash-2",q7);/**
432
+ * @license lucide-react v1.25.0 - ISC
433
+ *
434
+ * This source code is licensed under the ISC license.
435
+ * See the LICENSE file in the root directory of this source tree.
436
+ */const Y7=[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],wl=Ge("triangle-alert",Y7);/**
437
+ * @license lucide-react v1.25.0 - ISC
438
+ *
439
+ * This source code is licensed under the ISC license.
440
+ * See the LICENSE file in the root directory of this source tree.
441
+ */const G7=[["circle",{cx:"12",cy:"8",r:"5",key:"1hypcn"}],["path",{d:"M20 21a8 8 0 0 0-16 0",key:"rfgkzh"}]],X7=Ge("user-round",G7);/**
442
+ * @license lucide-react v1.25.0 - ISC
443
+ *
444
+ * This source code is licensed under the ISC license.
445
+ * See the LICENSE file in the root directory of this source tree.
446
+ */const K7=[["path",{d:"M18 21a8 8 0 0 0-16 0",key:"3ypg7q"}],["circle",{cx:"10",cy:"8",r:"5",key:"o932ke"}],["path",{d:"M22 20c0-3.37-2-6.5-4-8a5 5 0 0 0-.45-8.3",key:"10s06x"}]],bA=Ge("users-round",K7);/**
447
+ * @license lucide-react v1.25.0 - ISC
448
+ *
449
+ * This source code is licensed under the ISC license.
450
+ * See the LICENSE file in the root directory of this source tree.
451
+ */const Q7=[["path",{d:"M12 20h.01",key:"zekei9"}],["path",{d:"M8.5 16.429a5 5 0 0 1 7 0",key:"1bycff"}],["path",{d:"M5 12.859a10 10 0 0 1 5.17-2.69",key:"1dl1wf"}],["path",{d:"M19 12.859a10 10 0 0 0-2.007-1.523",key:"4k23kn"}],["path",{d:"M2 8.82a15 15 0 0 1 4.177-2.643",key:"1grhjp"}],["path",{d:"M22 8.82a15 15 0 0 0-11.288-3.764",key:"z3jwby"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]],W7=Ge("wifi-off",Q7);/**
452
+ * @license lucide-react v1.25.0 - ISC
453
+ *
454
+ * This source code is licensed under the ISC license.
455
+ * See the LICENSE file in the root directory of this source tree.
456
+ */const Z7=[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z",key:"1ngwbx"}]],J7=Ge("wrench",Z7);/**
457
+ * @license lucide-react v1.25.0 - ISC
458
+ *
459
+ * This source code is licensed under the ISC license.
460
+ * See the LICENSE file in the root directory of this source tree.
461
+ */const eB=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],mi=Ge("x",eB);/**
462
+ * @license lucide-react v1.25.0 - ISC
463
+ *
464
+ * This source code is licensed under the ISC license.
465
+ * See the LICENSE file in the root directory of this source tree.
466
+ */const tB=[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]],nB=Ge("zap",tB),uo=jP,co=WP,ia=Uj,fo=({className:e,children:t,...n})=>m.jsxs(KP,{"data-slot":"select-trigger",className:Ie("inline-flex h-7 items-center justify-between gap-1.5 rounded-md border border-border bg-bg px-2 text-body-sm text-text","transition-colors outline-none hover:border-border-strong focus-visible:border-ring focus-visible:ring-2 focus-visible:ring-ring/40","data-popup-open:border-border-strong disabled:pointer-events-none disabled:opacity-50",e),...n,children:[t,m.jsx(ZP,{className:"text-fg-4",children:m.jsx(d9,{className:"size-3.5"})})]}),ho=({className:e,align:t="start",alignItemWithTrigger:n=!1,side:r="bottom",sideOffset:i=6,...a})=>m.jsx(ej,{children:m.jsx(Ej,{align:t,alignItemWithTrigger:n,side:r,sideOffset:i,className:"isolate z-60 outline-none",children:m.jsx(Dj,{"data-slot":"select-content",className:Ie("max-h-[min(24rem,var(--available-height))] min-w-[var(--anchor-width)] overflow-y-auto","rounded-md border border-border bg-surface p-1 text-fg-1 shadow-(--shadow-lg) outline-none",e),...a})})}),aa=({className:e,children:t,...n})=>m.jsxs(jj,{"data-slot":"select-item",className:Ie("flex cursor-pointer items-start gap-2 rounded-sm px-2 py-1.5 text-body-sm text-text outline-none select-none","data-highlighted:bg-surface-hover",e),...n,children:[m.jsx("span",{className:"flex min-w-0 flex-1 flex-col gap-0.5",children:t}),m.jsx(Bj,{className:"mt-0.5 text-fg-1",children:m.jsx(aA,{className:"size-3.5"})})]});function rB(e){const{store:t,actionsRef:n}=e,r=t.useState("open");cP(t,r),ox(t);const{forceUnmount:i}=lx(r,t),a=E.useCallback(()=>{t.setOpen(!1,pt(V1))},[t]);E.useImperativeHandle(n,()=>({unmount:i,close:a}),[i,a])}function sB({store:e,parentContext:t,isDrawer:n}){const r=e.useState("open"),i=e.useState("disablePointerDismissal"),a=e.useState("modal"),l=e.useState("popupElement"),c=e.useState("floatingRootContext"),[d,f]=E.useState(0),[g,h]=E.useState(0),b=d===0,x=yp(c,{outsidePressEvent(){return e.context.internalBackdropRef.current||e.context.backdropRef.current?"intentional":{mouse:a==="trap-focus"?"sloppy":"intentional",touch:"sloppy"}},outsidePress(C){if(!e.context.outsidePressEnabledRef.current||"button"in C&&C.button!==0||"touches"in C&&C.touches.length!==1)return!1;const N=mr(C);return b&&!i?a&&(e.context.internalBackdropRef.current||e.context.backdropRef.current)?e.context.internalBackdropRef.current===N||e.context.backdropRef.current===N||nt(N,l)&&!N?.hasAttribute("data-base-ui-portal"):!0:!1},escapeKey:b});JN(r&&a===!0,l),e.useContextCallback("onNestedDialogOpen",(C,N)=>{f(C),h(N)}),e.useContextCallback("onNestedDialogClose",()=>{f(0),h(0)}),E.useEffect(()=>(t?.onNestedDialogOpen&&r&&t.onNestedDialogOpen(d+1,g+(n?1:0)),t?.onNestedDialogClose&&!r&&t.onNestedDialogClose(),()=>{t?.onNestedDialogClose&&r&&t.onNestedDialogClose()}),[n,r,d,g,t]);const v=x.reference??dn,w=x.trigger??dn,k=x.floating??dn;return ux(e,{activeTriggerProps:v,inactiveTriggerProps:w,popupProps:k,nestedOpenDialogCount:d,nestedOpenDrawerCount:g}),null}const xA=E.createContext(!1),yA=E.createContext(void 0);function ma(e){const t=E.useContext(yA);if(e===!1&&t===void 0)throw new Error(Ln(27));return t}const iB={...fx,modal:Be(e=>e.modal),nested:Be(e=>e.nested),nestedOpenDialogCount:Be(e=>e.nestedOpenDialogCount),nestedOpenDrawerCount:Be(e=>e.nestedOpenDrawerCount),disablePointerDismissal:Be(e=>e.disablePointerDismissal),openMethod:Be(e=>e.openMethod),descriptionElementId:Be(e=>e.descriptionElementId),titleElementId:Be(e=>e.titleElementId),viewportElement:Be(e=>e.viewportElement),role:Be(e=>e.role)};class Ix extends op{constructor(t,n,r=!1){const i=new Jc,a=aB(t);a.floatingRootContext=kN(i,n,r),super(a,{popupRef:E.createRef(),backdropRef:E.createRef(),internalBackdropRef:E.createRef(),outsidePressEnabledRef:{current:!0},triggerElements:i,onOpenChange:void 0,onOpenChangeComplete:void 0},iB)}setOpen=(t,n)=>{if(n.preventUnmountOnClose=()=>{this.set("preventUnmountingOnClose",!0)},!t&&n.trigger==null&&this.state.activeTriggerId!=null&&(n.trigger=this.state.activeTriggerElement??void 0),this.context.onOpenChange?.(t,n),n.isCanceled)return;this.state.floatingRootContext.dispatchOpenChange(t,n);const r={open:t};ix(r,t,n.trigger),this.update(r)};static useStore(t,n){return TN(t,(i,a)=>new Ix(n,i,a),!0).store}}function aB(e={}){return{...cx(),modal:!0,disablePointerDismissal:!1,popupElement:null,viewportElement:null,descriptionElementId:void 0,titleElementId:void 0,openMethod:null,nested:!1,nestedOpenDialogCount:0,nestedOpenDrawerCount:0,role:"dialog",...e}}function EA(e,t="dialog"){const{children:n,open:r,defaultOpen:i=!1,onOpenChange:a,onOpenChangeComplete:l,disablePointerDismissal:c=!1,modal:d=!0,actionsRef:f,handle:g,triggerId:h,defaultTriggerId:b=null}=e,x=t==="drawer",v=t==="alert-dialog",w=v?!0:d,k=v||c,C=v?"alertdialog":"dialog",N=ma(!0),R={modal:w,disablePointerDismissal:k,nested:!!N,role:C},M=Ix.useStore(g?.store,{open:i,openProp:r,activeTriggerId:b,triggerIdProp:h,...R});I1(()=>{const X=r===void 0&&M.state.open===!1&&i===!0?{open:!0,activeTriggerId:b}:null;v?M.update(X?{...R,...X}:R):X&&M.update(X)}),M.useControlledProp("openProp",r),M.useControlledProp("triggerIdProp",h),M.useSyncedValues(R),M.useContextCallback("onOpenChange",a),M.useContextCallback("onOpenChangeComplete",l);const _=M.useState("open"),D=M.useState("mounted"),I=M.useState("payload");rB({store:M,actionsRef:f});const U=_||D,j=E.useMemo(()=>({store:M}),[M]);return m.jsx(xA.Provider,{value:!1,children:m.jsxs(yA.Provider,{value:j,children:[U&&m.jsx(sB,{store:M,parentContext:N?.store.context,isDrawer:x}),typeof n=="function"?n({payload:I}):n]})})}function oB(e){return EA(e,"alert-dialog")}const lB={...ql,...Vl},vA=E.forwardRef(function(t,n){const{render:r,className:i,style:a,forceRender:l=!1,...c}=t,{store:d}=ma(),f=d.useState("open"),g=d.useState("nested"),h=d.useState("mounted"),b=d.useState("transitionStatus");return Nn("div",t,{state:{open:f,transitionStatus:b},ref:[d.context.backdropRef,n],stateAttributesMapping:lB,props:[{role:"presentation",hidden:!h,style:{userSelect:"none",WebkitUserSelect:"none"}},c],enabled:l||!g})}),TA=E.forwardRef(function(t,n){const{render:r,className:i,style:a,disabled:l=!1,nativeButton:c=!0,...d}=t,{store:f}=ma(),g=f.useState("open"),{getButtonProps:h,buttonRef:b}=Yl({disabled:l,native:c}),x={disabled:l};function v(w){g&&f.setOpen(!1,pt(yD,w.nativeEvent))}return Nn("button",t,{state:x,ref:[n,b],props:[{onClick:v},d,h]})}),SA=E.forwardRef(function(t,n){const{render:r,className:i,style:a,id:l,...c}=t,{store:d}=ma(),f=To(l);return d.useSyncedValueWithCleanup("descriptionElementId",f),Nn("p",t,{ref:n,props:[{id:f},c]})});let uB=(function(e){return e.nestedDialogs="--nested-dialogs",e})({}),cB=(function(e){return e[e.open=Ka.open]="open",e[e.closed=Ka.closed]="closed",e[e.startingStyle=Ka.startingStyle]="startingStyle",e[e.endingStyle=Ka.endingStyle]="endingStyle",e.nested="data-nested",e.nestedDialogOpen="data-nested-dialog-open",e})({});const CA=E.createContext(void 0);function dB(){const e=E.useContext(CA);if(e===void 0)throw new Error(Ln(26));return e}const fB={...ql,...Vl,nestedDialogOpen(e){return e?{[cB.nestedDialogOpen]:""}:null}},kA=E.forwardRef(function(t,n){const{render:r,className:i,style:a,finalFocus:l,initialFocus:c,...d}=t,{store:f}=ma(),g=f.useState("descriptionElementId"),h=f.useState("disablePointerDismissal"),b=f.useState("floatingRootContext"),x=f.useState("popupProps"),v=f.useState("modal"),w=f.useState("mounted"),k=f.useState("nested"),C=f.useState("nestedOpenDialogCount"),N=f.useState("open"),A=f.useState("openMethod"),R=f.useState("titleElementId"),M=f.useState("transitionStatus"),_=f.useState("role"),D=b.useState("floatingId"),I=d.id??D;dB(),vo({open:N,ref:f.context.popupRef,onComplete(){N&&f.context.onOpenChangeComplete?.(!0)}});const U=c===void 0?oP(f.context.popupRef):c,j=C>0,X=f.useStateSetter("popupElement"),F=Nn("div",t,{state:{open:N,nested:k,transitionStatus:M,nestedDialogOpen:j},props:[x,{id:I,"aria-labelledby":R??void 0,"aria-describedby":g??void 0,role:_,...Tp,hidden:!w,onKeyDown(W){Sx.has(W.key)&&W.stopPropagation()},style:{[uB.nestedDialogs]:C}},d],ref:[n,f.context.popupRef,X],stateAttributesMapping:fB});return m.jsx(tx,{context:b,openInteractionType:A,disabled:!w,closeOnFocusOut:!h,initialFocus:U,returnFocus:l,modal:v!==!1,restoreFocus:"popup",children:F})}),wA=E.forwardRef(function(t,n){const{keepMounted:r=!1,...i}=t,{store:a}=ma(),l=a.useState("mounted"),c=a.useState("modal"),d=a.useState("open");return l||r?m.jsx(CA.Provider,{value:r,children:m.jsxs(Z1,{ref:n,...i,children:[l&&c===!0&&m.jsx(vx,{ref:a.context.internalBackdropRef,inert:xx(!d)}),t.children]})}):null}),NA=E.forwardRef(function(t,n){const{render:r,className:i,style:a,id:l,...c}=t,{store:d}=ma(),f=To(l);return d.useSyncedValueWithCleanup("titleElementId",f),Nn("h2",t,{ref:n,props:[{id:f},c]})}),hB=E.forwardRef(function(t,n){const{render:r,className:i,style:a,disabled:l=!1,nativeButton:c=!0,id:d,payload:f,handle:g,...h}=t,b=ma(!0),x=g?.store??b?.store;if(!x)throw new Error(Ln(79));const v=To(d),w=x.useState("floatingRootContext"),k=x.useState("isOpenedByTrigger",v),C=x.useState("triggerPopupId",v),N=E.useRef(null),{registerTrigger:A,isMountedByThisTrigger:R}=ax(v,N,x,{payload:f}),{getButtonProps:M,buttonRef:_}=Yl({disabled:l,native:c}),D=nx(w,{enabled:w!=null}),I=VN(()=>x.select("open"),X=>{x.set("openMethod",X)}),U={disabled:l,open:k},j=x.useState("triggerProps",R);return Nn("button",t,{state:U,ref:[_,n,A,N],props:[D.reference,j,I,{[nN]:"",id:v,"aria-haspopup":"dialog","aria-expanded":k,"aria-controls":C},h,M],stateAttributesMapping:gx})}),pB=hB,mB=oB,gB=pB,bB=TA,xB=({className:e,children:t,...n})=>m.jsxs(wA,{children:[m.jsx(vA,{className:Ie("fixed inset-0 z-70 bg-black/40 backdrop-blur-[1px]","transition-opacity duration-(--motion-base)","data-starting-style:opacity-0 data-ending-style:opacity-0")}),m.jsx(kA,{"data-slot":"alert-dialog-content",className:Ie("fixed top-1/2 left-1/2 z-70 w-[min(28rem,calc(100vw-2rem))] -translate-x-1/2 -translate-y-1/2","rounded-lg border border-border bg-surface p-5 shadow-(--shadow-lg) outline-none","transition-[opacity,transform] duration-(--motion-base)","data-starting-style:scale-95 data-starting-style:opacity-0","data-ending-style:scale-95 data-ending-style:opacity-0",e),...n,children:t})]}),yB=({className:e,...t})=>m.jsx(NA,{className:Ie("text-heading-3 font-semibold text-text",e),...t}),EB=({className:e,...t})=>m.jsx(SA,{className:Ie("mt-1.5 text-body-sm text-muted-foreground",e),...t}),AA=E.createContext(void 0);function _A(e){const t=E.useContext(AA);if(t===void 0&&!e)throw new Error(Ln(33));return t}const RA=E.createContext(void 0);function So(e){const t=E.useContext(RA);if(t===void 0&&!e)throw new Error(Ln(36));return t}const vB=E.createContext(void 0);function _p(e=!0){const t=E.useContext(vB);if(t===void 0&&!e)throw new Error(Ln(25));return t}function TB(e){const{closeOnClick:t,highlighted:n,id:r,nodeId:i,store:a,typingRef:l,itemRef:c,itemMetadata:d}=e,{events:f}=a.useState("floatingTreeRoot"),g=a.useState("open"),h=_p(!0),b=h!==void 0;return E.useMemo(()=>({id:r,role:"menuitem",tabIndex:g&&n?0:-1,onKeyDown(x){x.key===" "&&l?.current&&x.preventDefault()},onMouseMove(x){i&&f.emit("itemhover",{nodeId:i,target:x.currentTarget})},onClick(x){t&&f.emit("close",{domEvent:x,reason:vc})},onMouseUp(x){if(h){const v=h.initialCursorPointRef.current;if(h.initialCursorPointRef.current=null,b&&v&&Math.abs(x.clientX-v.x)<=1&&Math.abs(x.clientY-v.y)<=1||b&&!U1&&x.button===2)return}c.current&&a.context.allowMouseUpTriggerRef.current&&(!b||x.button===2)&&(!d||d.type==="regular-item")&&c.current.click()}}),[t,n,r,f,i,g,a,l,c,h,b,d])}const SB={type:"regular-item"};function CB(e){const{closeOnClick:t,disabled:n=!1,highlighted:r,id:i,store:a,typingRef:l=a.context.typingRef,nativeButton:c,itemMetadata:d,nodeId:f}=e,g=a.useState("disabled"),h=n||g,b=E.useRef(null),{getButtonProps:x,buttonRef:v}=Yl({disabled:h,focusableWhenDisabled:!0,native:c,composite:!0}),w=TB({closeOnClick:t,highlighted:r,id:i,nodeId:f,store:a,typingRef:l,itemRef:b,itemMetadata:d}),k=E.useCallback(N=>Ir(w,{onMouseEnter(){d.type==="submenu-trigger"&&d.setActive()}},N,x),[w,x,d]),C=ro(b,v);return E.useMemo(()=>({getItemProps:k,itemRef:C}),[k,C])}const kB=E.forwardRef(function(t,n){const{render:r,className:i,id:a,label:l,nativeButton:c=!1,disabled:d=!1,closeOnClick:f=!0,style:g,...h}=t,b=Cx({label:l}),x=_A(!0),v=To(a),{store:w}=So(),k=w.useState("isActive",b.index),C=w.useState("itemProps"),{getItemProps:N,itemRef:A}=CB({closeOnClick:f,disabled:d,highlighted:k,id:v,store:w,nativeButton:c,nodeId:x?.context.nodeId,itemMetadata:SB});return Nn("div",t,{state:{disabled:d,highlighted:k},props:[C,h,N],ref:[A,n,b.ref]})}),wB={...ql,...Vl},NB=E.forwardRef(function(t,n){const{render:r,className:i,style:a,finalFocus:l,...c}=t,{store:d}=So(),{side:f,align:g}=_A(),h=tA()!=null,b=d.useState("open"),x=d.useState("transitionStatus"),v=d.useState("popupProps"),w=d.useState("mounted"),k=d.useState("instantType"),C=d.useState("activeTriggerElement"),N=d.useState("parent"),A=d.useState("lastOpenChangeReason"),R=d.useState("rootId"),M=d.useState("floatingRootContext"),_=d.useState("floatingTreeRoot"),D=d.useState("closeDelay"),I=d.useState("activeTriggerElement"),U=d.useState("hoverEnabled"),j=d.useState("disabled"),X=d.useState("openMethod"),K=N.type==="context-menu";vo({open:b,ref:d.context.popupRef,onComplete(){b&&d.context.onOpenChangeComplete?.(!0)}}),E.useEffect(()=>{function q(J){d.setOpen(!1,pt(J.reason,J.domEvent))}return _.events.on("close",q),()=>{_.events.off("close",q)}},[_.events,d]),RN(M,{enabled:U&&!j&&!K&&N.type!=="menubar",closeDelay:D});const F=E.useCallback(q=>{d.set("popupElement",q)},[d]),W={transitionStatus:x,side:f,align:g,open:b,nested:N.type==="menu",instant:k},V=Nn("div",t,{state:W,ref:[n,d.context.popupRef,F],stateAttributesMapping:wB,props:[v,{onKeyDown(q){h&&Sx.has(q.key)&&q.stopPropagation()}},Cp(x),c,{"data-rootownerid":R}]});let H=N.type===void 0||K;return(C||N.type==="menubar"&&A!==gp)&&(H=!0),m.jsx(tx,{context:M,openInteractionType:X,modal:K,disabled:!w,returnFocus:l===void 0?H:l,initialFocus:N.type!=="menu",restoreFocus:!0,externalTree:N.type!=="menubar"?_:void 0,previousFocusableElement:I,nextFocusableElement:N.type===void 0?d.context.triggerFocusTargetRef:void 0,beforeContentFocusGuardRef:N.type===void 0?d.context.beforeContentFocusGuardRef:void 0,children:V})}),OA=E.createContext(void 0);function AB(){const e=E.useContext(OA);if(e===void 0)throw new Error(Ln(32));return e}const _B=E.forwardRef(function(t,n){const{keepMounted:r=!1,...i}=t,{store:a}=So();return a.useState("mounted")||r?m.jsx(OA.Provider,{value:r,children:m.jsx(Z1,{ref:n,...i})}):null}),RB=E.forwardRef(function(t,n){const{anchor:r,positionMethod:i="absolute",className:a,render:l,side:c,align:d,sideOffset:f=0,alignOffset:g=0,collisionBoundary:h="clipping-ancestors",collisionPadding:b=5,arrowPadding:x=5,sticky:v=!1,disableAnchorTracking:w=!1,collisionAvoidance:k=rN,style:C,...N}=t,{store:A}=So(),R=AB(),M=_p(!0),_=A.useState("parent"),D=A.useState("floatingRootContext"),I=A.useState("floatingTreeRoot"),U=A.useState("mounted"),j=A.useState("open"),X=A.useState("modal"),K=A.useState("openMethod"),F=A.useState("activeTriggerElement"),W=A.useState("transitionStatus"),V=A.useState("positionerElement"),H=A.useState("instantType"),q=A.useState("hasViewport"),J=A.useState("lastOpenChangeReason"),ue=A.useState("floatingNodeId"),L=A.useState("floatingParentNodeId"),B=D.useState("domReferenceElement"),G=E.useRef(null),P=vN(V,!1,!1);let ae=r,ie=f,ce=g,de=d,he=k;_.type==="context-menu"&&(ae=r??_.context?.anchor,de=de??"start",!c&&de!=="center"&&(ce=t.alignOffset??2,ie=t.sideOffset??-5));let ve=c,Fe=de;_.type==="menu"?(ve=ve??"inline-end",Fe=Fe??"start",he=t.collisionAvoidance??sN):_.type==="menubar"&&(ve=ve??(_.context.orientation==="vertical"?"inline-end":"bottom"),Fe=Fe??"start");const Le=_.type==="context-menu",Ee=Ex({anchor:ae,floatingRootContext:D,positionMethod:M?"fixed":i,mounted:U,side:ve,sideOffset:ie,align:Fe,alignOffset:ce,arrowPadding:Le?0:x,collisionBoundary:h,collisionPadding:b,sticky:v,nodeId:ue,keepMounted:R,disableAnchorTracking:w,collisionAvoidance:he,shiftCrossAxis:Le&&!("side"in he&&he.side==="flip"),externalTree:I,adaptiveOrigin:q?QN:void 0});E.useEffect(()=>{function Re(Pe){Pe.open&&(Pe.parentNodeId===ue&&A.set("hoverEnabled",!1),Pe.nodeId!==ue&&Pe.parentNodeId===A.select("floatingParentNodeId")&&A.setOpen(!1,pt(fc)))}return I.events.on("menuopenchange",Re),()=>{I.events.off("menuopenchange",Re)}},[A,I.events,ue]),E.useEffect(()=>{if(A.select("floatingParentNodeId")==null)return;function Re(Pe){if(Pe.open||Pe.nodeId!==A.select("floatingParentNodeId"))return;const ee=Pe.reason??fc;A.setOpen(!1,pt(ee))}return I.events.on("menuopenchange",Re),()=>{I.events.off("menuopenchange",Re)}},[I.events,A]);const Oe=Gn();E.useEffect(()=>{j||Oe.clear()},[j,Oe]),E.useEffect(()=>{function Re(Pe){if(!(!j||Pe.nodeId!==A.select("floatingParentNodeId")))if(Pe.target&&F&&F!==Pe.target){const ee=A.select("closeDelay");ee>0?Oe.isStarted()||Oe.start(ee,()=>{A.setOpen(!1,pt(fc))}):A.setOpen(!1,pt(fc))}else Oe.clear()}return I.events.on("itemhover",Re),()=>{I.events.off("itemhover",Re)}},[I.events,j,F,A,Oe]),E.useEffect(()=>{const Re={open:j,nodeId:ue,parentNodeId:L,reason:A.select("lastOpenChangeReason")};I.events.emit("menuopenchange",Re)},[I.events,j,A,ue,L]),Ye(()=>{const Re=B,Pe=G.current;if(Re&&(G.current=Re),Pe&&Re&&Re!==Pe){A.set("instantType",void 0);const ee=new AbortController;return P(()=>{A.set("instantType","trigger-change")},ee.signal),()=>{ee.abort()}}},[B,P,A]);const Ue={open:j,side:Ee.side,align:Ee.align,anchorHidden:Ee.anchorHidden,nested:_.type==="menu",instant:H},Xe=_.type==="menubar"&&_.context.modal;eA(j&&(Xe||X&&J!==qn),K==="touch",V,F);const De=Tx(t,Ue,{styles:Ee.positionerStyles,transitionStatus:W,props:N,refs:[n,A.useStateSetter("positionerElement")],hidden:!U,inert:!j}),ke=U&&_.type!=="menu"&&(_.type!=="menubar"&&X&&J!==qn||_.type==="menubar"&&_.context.modal);let ye=null;return _.type==="menubar"?ye=_.context.contentElement:_.type===void 0&&(ye=F),m.jsxs(AA.Provider,{value:Ee,children:[ke&&m.jsx(vx,{ref:_.type==="context-menu"||_.type==="nested-context-menu"?_.context.internalBackdropRef:null,inert:xx(!j),cutout:ye}),m.jsx(u8,{id:ue,children:m.jsx(KN,{elementsRef:A.context.itemDomElements,labelsRef:A.context.itemLabels,children:De})})]})}),OB=E.createContext(null);function IA(e){return E.useContext(OB)}const IB={...fx,disabled:Be(e=>e.parent.type==="menubar"&&e.parent.context.disabled||e.disabled),modal:Be(e=>(e.parent.type===void 0||e.parent.type==="context-menu")&&(e.modal??!0)),openMethod:Be(e=>e.openMethod),allowMouseEnter:Be(e=>e.allowMouseEnter),highlightItemOnHover:Be(e=>e.highlightItemOnHover),stickIfOpen:Be(e=>e.stickIfOpen),parent:Be(e=>e.parent),rootId:Be(e=>e.parent.type==="menu"?e.parent.store.select("rootId"):e.parent.type!==void 0?e.parent.context.rootId:e.rootId),activeIndex:Be(e=>e.activeIndex),isActive:Be((e,t)=>e.activeIndex===t),hoverEnabled:Be(e=>e.hoverEnabled),instantType:Be(e=>e.instantType),lastOpenChangeReason:Be(e=>e.openChangeReason),floatingTreeRoot:Be(e=>e.parent.type==="menu"?e.parent.store.select("floatingTreeRoot"):e.floatingTreeRoot),floatingNodeId:Be(e=>e.floatingNodeId),floatingParentNodeId:Be(e=>e.floatingParentNodeId),itemProps:Be(e=>e.itemProps),closeDelay:Be(e=>e.closeDelay),hasViewport:Be(e=>e.hasViewport),keyboardEventRelay:Be(e=>{if(e.keyboardEventRelay)return e.keyboardEventRelay;if(e.parent.type==="menu")return e.parent.store.select("keyboardEventRelay")})};class Mx extends op{constructor(t){super({...MB(),...t},{positionerRef:E.createRef(),popupRef:E.createRef(),typingRef:{current:!1},itemDomElements:{current:[]},itemLabels:{current:[]},allowMouseUpTriggerRef:{current:!1},triggerFocusTargetRef:E.createRef(),beforeContentFocusGuardRef:E.createRef(),onOpenChangeComplete:void 0,triggerElements:new Jc},IB),this.unsubscribeParentListener=this.observe("parent",n=>{if(this.unsubscribeParentListener?.(),n.type==="menu"){let r=n.store.select("rootId"),i=n.store.select("floatingTreeRoot"),a=n.store.select("keyboardEventRelay");this.unsubscribeParentListener=n.store.subscribe(()=>{const l=n.store.select("rootId"),c=n.store.select("floatingTreeRoot"),d=n.store.select("keyboardEventRelay");r===l&&i===c&&a===d||(r=l,i=c,a=d,this.notifyAll())}),this.context.allowMouseUpTriggerRef=n.store.context.allowMouseUpTriggerRef;return}n.type!==void 0&&(this.context.allowMouseUpTriggerRef=n.context.allowMouseUpTriggerRef),this.unsubscribeParentListener=null})}setOpen(t,n){this.state.floatingRootContext.context.events.emit("setOpen",{open:t,eventDetails:n})}static useStore(t,n){const r=xr(()=>new Mx(n)).current;return t??r}unsubscribeParentListener=null}function MB(){return{...cx(),disabled:!1,modal:!0,openMethod:null,allowMouseEnter:!1,highlightItemOnHover:!0,stickIfOpen:!0,parent:{type:void 0},rootId:void 0,activeIndex:null,hoverEnabled:!0,instantType:void 0,openChangeReason:null,floatingTreeRoot:new J1,floatingNodeId:void 0,floatingParentNodeId:null,itemProps:dn,keyboardEventRelay:void 0,closeDelay:0,hasViewport:!1}}const LB=E.createContext(void 0);function DB(){return E.useContext(LB)}const PB=D1(function(t){const{children:n,open:r,onOpenChange:i,onOpenChangeComplete:a,defaultOpen:l=!1,disabled:c=!1,modal:d,loopFocus:f=!0,orientation:g="vertical",actionsRef:h,closeParentOnEsc:b=!1,handle:x,triggerId:v,defaultTriggerId:w=null,highlightItemOnHover:k=!0}=t,C=_p(!0),N=So(!0),A=IA(!0),R=DB(),M=E.useMemo(()=>R&&N?{type:"menu",store:N.store}:A?{type:"menubar",context:A}:C&&!N?{type:"context-menu",context:C}:{type:void 0},[C,N,A,R]),_=Mx.useStore(x?.store,{open:l,openProp:r,activeTriggerId:w,triggerIdProp:v,parent:M});CN(_,r,l,w),_.useControlledProp("openProp",r),_.useControlledProp("triggerIdProp",v),_.useContextCallback("onOpenChangeComplete",a);const D=ao(),I=ao(),U=_.useState("floatingTreeRoot"),j=dN(U),X=fa(),K=_.useState("open"),F=_.useState("activeTriggerElement"),W=_.useState("positionerElement"),V=_.useState("hoverEnabled"),H=_.useState("disabled"),q=_.useState("lastOpenChangeReason"),J=_.useState("parent"),ue=_.useState("activeIndex"),L=_.useState("payload"),B=_.useState("floatingParentNodeId"),G=E.useRef(null),P=E.useRef(J.type!=="context-menu"),ae=Gn(),ie=E.useRef(!0),ce=Gn(),de=B!=null,{openMethod:he,triggerProps:ve}=qN(K);_.useSyncedValues({disabled:c,highlightItemOnHover:k,modal:J.type===void 0?d:void 0,openMethod:he,rootId:D}),ox(_);const{forceUnmount:Fe}=lx(K,_,()=>{_.update({allowMouseEnter:!1,stickIfOpen:!0})});Ye(()=>{C&&!N?_.update({parent:{type:"context-menu",context:C},floatingNodeId:j,floatingParentNodeId:X}):N&&_.update({floatingNodeId:j,floatingParentNodeId:X})},[C,N,j,X,_]),E.useEffect(()=>{if(K||(G.current=null),J.type==="context-menu"){if(!K){ae.clear(),P.current=!1;return}ae.start(500,()=>{P.current=!0})}},[ae,K,J.type]),Ye(()=>{!K&&!V&&_.set("hoverEnabled",!0)},[K,V,_]);const Le=tt((oe,Se)=>{const _e=Se.reason;if(K===oe&&Se.trigger===F&&q===_e)return;const $e=SN(Se);if(!oe&&Se.trigger==null&&(Se.trigger=F??void 0),i?.(oe,Se),Se.isCanceled)return;_.state.floatingRootContext.dispatchOpenChange(oe,Se);const ot=Se.event;if(oe===!1&&ot?.type==="click"&&ot.pointerType==="touch"&&!ie.current)return;oe&&_e===Sl?(ie.current=!1,ce.start(300,()=>{ie.current=!0})):(ie.current=!0,ce.clear());const et=(_e===$l||_e===vc)&&ot.detail===0&&ot?.isTrusted,dt=!oe&&(_e===bp||_e==null),ut={open:oe,openChangeReason:_e};G.current=Se.event??null,ix(ut,oe,Se.trigger,$e()),_.update(ut),J.type==="menubar"&&(_e===Sl||_e===io||_e===qn||_e===Mb||_e===fc)?_.set("instantType","group"):et||dt?_.set("instantType",et?"click":"dismiss"):_.set("instantType",void 0)}),Ee=EN({popupStore:_,floatingId:I,nested:X!=null,onOpenChange:Le}),Oe=Ee.context.events;E.useEffect(()=>{const oe=({open:Se,eventDetails:_e})=>Le(Se,_e);return Oe.on("setOpen",oe),()=>{Oe?.off("setOpen",oe)}},[Oe,Le]);const Ue=E.useCallback(()=>{_.setOpen(!1,pt(V1))},[_]);E.useImperativeHandle(h,()=>({unmount:Fe,close:Ue}),[Fe,Ue]);let Xe;J.type==="context-menu"&&(Xe=J.context),E.useImperativeHandle(Xe?.positionerRef,()=>W,[W]),E.useImperativeHandle(Xe?.actionsRef,()=>({setOpen:Le}),[Le]);const qe=yp(Ee,{enabled:!H,bubbles:{escapeKey:b&&J.type==="menu"},outsidePress(){return J.type!=="context-menu"||G.current?.type==="contextmenu"?!0:P.current},externalTree:de?U:void 0}),De=yx(),ke=E.useCallback(oe=>{_.select("activeIndex")!==oe&&_.set("activeIndex",oe)},[_]),ye=IN(Ee,{enabled:!H,listRef:_.context.itemDomElements,activeIndex:ue,nested:J.type!==void 0,loopFocus:f,orientation:g,parentOrientation:J.type==="menubar"?J.context.orientation:void 0,rtl:De==="rtl",disabledIndices:_l,onNavigate:ke,openOnArrowKeyDown:J.type!=="context-menu",externalTree:de?U:void 0,focusItemOnHover:k}),Re=E.useCallback(oe=>{_.context.typingRef.current=oe},[_]),Pe=MN(Ee,{enabled:!H,listRef:_.context.itemLabels,elementsRef:_.context.itemDomElements,activeIndex:ue,resetMs:s8,onMatch:oe=>{K&&oe!==ue&&_.set("activeIndex",oe)},onTyping:Re}),ee=E.useMemo(()=>{const oe=Ir(Pe.reference,ye.reference,qe.reference,{onMouseMove(){_.set("allowMouseEnter",!0)}},ve);return oe["aria-haspopup"]="menu",oe["aria-expanded"]=K,oe},[_,Pe.reference,ye.reference,qe.reference,ve,K]),pe=E.useMemo(()=>{const oe=Ir(ye.trigger,qe.trigger,ve);return oe["aria-haspopup"]="menu",oe["aria-expanded"]=!1,oe},[ye.trigger,qe.trigger,ve]),se=E.useMemo(()=>Ir(Tp,{id:I,role:"menu","aria-labelledby":F?.id,onMouseMove(){_.set("allowMouseEnter",!0),J.type==="menu"&&_.set("hoverEnabled",!1)},onClick(){_.select("hoverEnabled")&&_.set("hoverEnabled",!1)},onKeyDown(oe){const Se=_.select("keyboardEventRelay");Se&&!oe.isPropagationStopped()&&Se(oe)}},Pe.floating,ye.floating,qe.floating),[F,I,J.type,_,Pe.floating,ye.floating,qe.floating]),re=ye.item??dn;ux(_,{floatingRootContext:Ee,activeTriggerProps:ee,inactiveTriggerProps:pe,popupProps:se,itemProps:re});const Q=E.useMemo(()=>({store:_,parent:M}),[_,M]),$=m.jsx(RA.Provider,{value:Q,children:typeof n=="function"?n({payload:L}):n});return J.type===void 0||J.type==="context-menu"?m.jsx(c8,{externalTree:U,children:$}):$});function jB(e={}){const{highlightItemOnHover:t,highlightedIndex:n,onHighlightedIndexChange:r}=bx(),{ref:i,index:a}=Cx(e),l=n===a,c=E.useRef(null),d=ro(i,c);return{compositeProps:{tabIndex:l?0:-1,onFocus(){r(a)},onMouseMove(){const g=c.current;if(!t||!g)return;const h=g.hasAttribute("disabled")||g.ariaDisabled==="true";!l&&!h&&g.focus()}},compositeRef:d,index:a}}function BB(e){const{render:t,className:n,style:r,state:i=dn,props:a=_l,refs:l=_l,metadata:c,stateAttributesMapping:d,tag:f="div",...g}=e,{compositeProps:h,compositeRef:b}=jB({metadata:c});return Nn(f,e,{state:i,ref:[...l,b],props:[h,...a,g],stateAttributesMapping:d})}function MA(e){if(cn(e)&&e.hasAttribute("data-rootownerid"))return e.getAttribute("data-rootownerid")??void 0;if(!ci(e))return MA(hi(e))}function HB(e,t){const n=E.useRef(null);function r(a){br.flushSync(()=>{e.setOpen(!1,pt(io,a.nativeEvent,a.currentTarget))}),zD(n.current)?.focus()}function i(a){const l=e.select("positionerElement");if(l&&Cl(a,l))e.context.beforeContentFocusGuardRef.current?.focus();else{br.flushSync(()=>{e.setOpen(!1,pt(io,a.nativeEvent,a.currentTarget))});let c=UD(e.context.triggerFocusTargetRef.current||t.current);for(;c!==null&&nt(l,c);){const d=c;if(c=K1(c),c===d)break}c?.focus()}}return{preFocusGuardRef:n,handlePreFocusGuardFocus:r,handleFocusTargetFocus:i}}function UB(e){const{enabled:t=!0,mouseDownAction:n,open:r}=e,i=E.useRef(!1);return E.useMemo(()=>t?{onMouseDown:a=>{(n==="open"&&!r||n==="close"&&r)&&(i.current=!0,At(a.currentTarget).addEventListener("click",()=>{i.current=!1},{once:!0}))},onClick:a=>{i.current&&(i.current=!1,a.preventBaseUIHandler())}}:dn,[t,n,r])}const Yf=2,zB=A3(function(t,n){const{render:r,className:i,style:a,disabled:l=!1,nativeButton:c=!0,id:d,openOnHover:f,delay:g=100,closeDelay:h=0,handle:b,payload:x,...v}=t,w=So(!0),k=b?.store??w?.store;if(!k)throw new Error(Ln(85));const C=To(d),N=k.useState("isTriggerActive",C),A=k.useState("floatingRootContext"),R=k.useState("isOpenedByTrigger",C),M=k.useState("triggerPopupId",C),_=E.useRef(null),D=$B(),I=bx(!0),U=ha(),j=E.useMemo(()=>U??new J1,[U]),X=dN(j),K=fa(),{registerTrigger:F,isMountedByThisTrigger:W}=ax(C,_,k,{payload:x,closeDelay:h,parent:D,floatingTreeRoot:j,floatingNodeId:X,floatingParentNodeId:K,keyboardEventRelay:I?.relayKeyboardEvent}),V=D.type==="menubar",H=k.useState("disabled"),q=l||H||V&&D.context.disabled,{getButtonProps:J,buttonRef:ue}=Yl({disabled:q,native:c});E.useEffect(()=>{!R&&D.type===void 0&&(k.context.allowMouseUpTriggerRef.current=!1)},[k,R,D.type]);const L=E.useRef(null),B=Gn(),G=tt(ye=>{if(!L.current)return;B.clear(),k.context.allowMouseUpTriggerRef.current=!1;const Re=ye.target;if(nt(L.current,Re)||nt(k.select("positionerElement"),Re)||Re===L.current||Re!=null&&MA(Re)===k.select("rootId"))return;const Pe=GN(L.current);ye.clientX>=Pe.left-Yf&&ye.clientX<=Pe.right+Yf&&ye.clientY>=Pe.top-Yf&&ye.clientY<=Pe.bottom+Yf||j.events.emit("close",{domEvent:ye,reason:D3})});E.useEffect(()=>{R&&k.select("lastOpenChangeReason")===qn&&At(L.current).addEventListener("mouseup",G,{once:!0})},[R,G,k]);const P=V&&D.context.hasSubmenuOpen,ie=ON(A,{enabled:(f??P)&&!q&&D.type!=="context-menu"&&(!V||P&&!W),handleClose:LN({blockPointerEvents:!V}),mouseOnly:!0,move:!1,restMs:D.type===void 0?g:void 0,delay:{close:h},triggerElementRef:_,externalTree:j,isActiveTrigger:N,isClosing:()=>k.select("transitionStatus")==="ending"}),ce=FB(R,k.select("lastOpenChangeReason")),de=nx(A,{enabled:!q&&D.type!=="context-menu",event:R&&V?"click":"mousedown",toggle:!0,ignoreMouse:!1,stickIfOpen:D.type===void 0?ce:!1}),he=AN(A,{enabled:!q&&P}),ve=UB({open:R,enabled:V,mouseDownAction:"open"}),Fe=E.useMemo(()=>Ir(he.reference,de.reference),[he.reference,de.reference]),Le=k.useState("triggerProps",W),{preFocusGuardRef:Ee,handlePreFocusGuardFocus:Oe,handleFocusTargetFocus:Ue}=HB(k,_),Xe={disabled:q,open:R},qe=[L,n,ue,F,_],De=[Fe,ie??dn,Le,{"aria-haspopup":"menu","aria-controls":M,id:C,onMouseDown:ye=>{if(k.select("open"))return;B.start(200,()=>{k.context.allowMouseUpTriggerRef.current=!0}),At(ye.currentTarget).addEventListener("mouseup",G,{once:!0})}},V?{role:"menuitem"}:{},ve,v,J],ke=Nn("button",t,{enabled:!V,stateAttributesMapping:Hb,state:Xe,ref:qe,props:De});return V?m.jsx(BB,{tag:"button",render:r,className:i,style:a,state:Xe,refs:qe,props:De,stateAttributesMapping:Hb}):R?m.jsxs(E.Fragment,{children:[m.jsx(Ml,{ref:Ee,onFocus:Oe},`${C}-pre-focus-guard`),m.jsx(E.Fragment,{children:ke},C),m.jsx(Ml,{ref:k.context.triggerFocusTargetRef,onFocus:Ue},`${C}-post-focus-guard`)]}):m.jsx(E.Fragment,{children:ke},C)});function FB(e,t){const n=Gn(),[r,i]=E.useState(!1);return Ye(()=>{e&&t==="trigger-hover"?(i(!0),n.start(i8,()=>{i(!1)})):e||(n.clear(),i(!1))},[e,t,n]),r}function $B(){const e=_p(!0),t=So(!0),n=IA();return E.useMemo(()=>n?{type:"menubar",context:n}:e&&!t?{type:"context-menu",context:e}:{type:void 0},[e,t,n])}const VB=PB,qB=zB,YB=({className:e,align:t="end",side:n="bottom",sideOffset:r=6,...i})=>m.jsx(_B,{children:m.jsx(RB,{align:t,side:n,sideOffset:r,className:"isolate z-60 outline-none",children:m.jsx(NB,{"data-slot":"menu-content",className:Ie("min-w-48 rounded-md border border-border bg-surface p-1 text-fg-1 shadow-(--shadow-lg) outline-none","transition-[opacity,transform] duration-(--motion-base)","data-starting-style:scale-95 data-starting-style:opacity-0","data-ending-style:scale-95 data-ending-style:opacity-0",e),...i})})}),hl=({className:e,destructive:t,...n})=>m.jsx(kB,{"data-slot":"menu-item",className:Ie("flex cursor-pointer items-center gap-2 rounded-sm px-2 py-1.5 text-body-sm outline-none select-none","data-highlighted:bg-surface-hover",t?"text-danger":"text-text",e),...n});function GB(e){const t=E.useContext(xA)?"drawer":"dialog";return EA(e,t)}const Gl=GB,Xl=({className:e,children:t,size:n="md",...r})=>m.jsxs(wA,{children:[m.jsx(vA,{className:Ie("fixed inset-0 z-70 bg-black/40 backdrop-blur-[1px]","transition-opacity duration-(--motion-base)","data-starting-style:opacity-0 data-ending-style:opacity-0")}),m.jsx(kA,{"data-slot":"dialog-content",className:Ie("fixed top-1/2 left-1/2 z-70 flex max-h-[min(42rem,calc(100dvh-3rem))] -translate-x-1/2 -translate-y-1/2 flex-col",n==="sm"&&"w-[min(24rem,calc(100vw-2rem))]",n==="md"&&"w-[min(32rem,calc(100vw-2rem))]",n==="lg"&&"w-[min(46rem,calc(100vw-2rem))]","rounded-lg border border-border bg-surface shadow-(--shadow-lg) outline-none","transition-[opacity,transform] duration-(--motion-base)","data-starting-style:scale-95 data-starting-style:opacity-0","data-ending-style:scale-95 data-ending-style:opacity-0",e),...r,children:t})]}),Kl=({title:e,description:t,actions:n})=>m.jsxs("div",{className:"flex items-start gap-2 border-b border-border px-4 py-3",children:[m.jsxs("div",{className:"min-w-0 flex-1",children:[m.jsx(NA,{className:"truncate text-body-sm font-semibold text-text",children:e}),t?m.jsx(SA,{className:"mt-0.5 text-label text-fg-4",children:t}):null]}),n,m.jsx(TA,{"aria-label":"Close",className:"-mr-1 flex size-6 shrink-0 items-center justify-center rounded-md text-fg-3 transition-colors outline-none hover:bg-surface-hover hover:text-fg-1",children:m.jsx(mi,{className:"size-3.5"})})]}),Ql=({className:e,...t})=>m.jsx("div",{className:Ie("min-h-0 flex-1 overflow-y-auto p-4",e),...t}),ir=({label:e,children:t,mono:n})=>m.jsxs("div",{className:"flex items-baseline justify-between gap-4 py-1.5",children:[m.jsx("span",{className:"shrink-0 text-label text-fg-3",children:e}),m.jsx("span",{className:Ie("min-w-0 truncate text-right text-body-sm text-fg-1",n&&"font-mono text-label"),children:t})]}),LA=E.createContext(void 0);function Rp(e){const t=E.useContext(LA);if(t===void 0&&!e)throw new Error(Ln(72));return t}const XB={...fx,disabled:Be(e=>e.disabled),instantType:Be(e=>e.instantType),isInstantPhase:Be(e=>e.isInstantPhase),trackCursorAxis:Be(e=>e.trackCursorAxis),disableHoverablePopup:Be(e=>e.disableHoverablePopup),lastOpenChangeReason:Be(e=>e.openChangeReason),closeOnClick:Be(e=>e.closeOnClick),closeDelay:Be(e=>e.closeDelay),hasViewport:Be(e=>e.hasViewport)};class Lx extends op{constructor(t,n,r=!1){const i=new Jc,a={...KB(),...t};a.floatingRootContext=kN(i,n,r),super(a,{popupRef:E.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerElements:i},XB)}setOpen=(t,n)=>{uP(this,t,n,{extraState:{openChangeReason:n.reason}})};cancelPendingOpen(t){this.state.floatingRootContext.dispatchOpenChange(!1,pt($l,t))}static useStore(t,n){return TN(t,(i,a)=>new Lx(n,i,a)).store}}function KB(){return{...cx(),disabled:!1,instantType:void 0,isInstantPhase:!1,trackCursorAxis:"none",disableHoverablePopup:!1,openChangeReason:null,closeOnClick:!0,closeDelay:0,hasViewport:!1}}const QB=D1(function(t){const{disabled:n=!1,defaultOpen:r=!1,open:i,disableHoverablePopup:a=!1,trackCursorAxis:l="none",actionsRef:c,onOpenChange:d,onOpenChangeComplete:f,handle:g,triggerId:h,defaultTriggerId:b=null,children:x}=t,v=Lx.useStore(g?.store,{open:r,openProp:i,activeTriggerId:b,triggerIdProp:h});CN(v,i,r,b),v.useControlledProp("openProp",i),v.useControlledProp("triggerIdProp",h),v.useContextCallback("onOpenChange",d),v.useContextCallback("onOpenChangeComplete",f);const w=v.useState("open"),k=!n&&w,C=v.useState("activeTriggerId"),N=v.useState("mounted"),A=v.useState("payload");v.useSyncedValues({trackCursorAxis:l,disableHoverablePopup:a}),v.useSyncedValue("disabled",n),ox(v,{closeOnActiveTriggerUnmount:!0});const{forceUnmount:R,transitionStatus:M}=lx(k,v),_=v.useState("isInstantPhase"),D=v.useState("instantType"),I=v.useState("lastOpenChangeReason"),U=E.useRef(null);Ye(()=>{w&&n&&v.setOpen(!1,pt(ED))},[w,n,v]),Ye(()=>{M==="ending"&&I===Fl||M!=="ending"&&_?(D!=="delay"&&(U.current=D),v.set("instantType","delay")):U.current!==null&&(v.set("instantType",U.current),U.current=null)},[M,_,I,D,v]),Ye(()=>{k&&C==null&&v.set("payload",void 0)},[v,C,k]);const j=E.useCallback(()=>{v.setOpen(!1,pt(V1))},[v]);E.useImperativeHandle(c,()=>({unmount:R,close:j}),[R,j]);const X=k||N||!n&&l!=="none";return m.jsxs(LA.Provider,{value:v,children:[X&&m.jsx(WB,{store:v,disabled:n,trackCursorAxis:l}),typeof x=="function"?x({payload:A}):x]})});function WB({store:e,disabled:t,trackCursorAxis:n}){const r=e.useState("floatingRootContext"),i=yp(r,{enabled:!t,referencePress:()=>e.select("closeOnClick")}),a=p8(r,{enabled:!t&&n!=="none",axis:n==="none"?void 0:n}),l=E.useMemo(()=>Ir(a.reference,i.reference),[a.reference,i.reference]),c=E.useMemo(()=>Ir(a.trigger,i.trigger),[a.trigger,i.trigger]),d=E.useMemo(()=>Ir(Tp,a.floating,i.floating),[a.floating,i.floating]);return ux(e,{activeTriggerProps:l,inactiveTriggerProps:c,popupProps:d}),null}const DA=E.createContext(void 0);function ZB(){return E.useContext(DA)}let JB=(function(e){return e[e.popupOpen=jh.popupOpen]="popupOpen",e.triggerDisabled="data-trigger-disabled",e})({});const eH=600,PA="data-base-ui-tooltip-trigger";function QS(e){if("composedPath"in e){const n=e.composedPath();for(let r=0;r<n.length;r+=1){const i=n[r];if(St(i))return i}}const t=e.target;return St(t)?t:null}function tH(e){let t=e;for(;t;){if(t.hasAttribute(PA))return t;const n=t.parentElement;if(n){t=n;continue}const r=t.getRootNode();t="host"in r&&St(r.host)?r.host:null}return null}const nH=A3(function(t,n){const{render:r,className:i,style:a,handle:l,payload:c,disabled:d,delay:f,closeOnClick:g=!0,closeDelay:h,id:b,...x}=t,v=Rp(!0),w=l?.store??v;if(!w)throw new Error(Ln(82));const k=To(b),C=w.useState("isTriggerActive",k),N=w.useState("isOpenedByTrigger",k),A=w.useState("floatingRootContext"),R=E.useRef(null),M=f??eH,_=h??0,{registerTrigger:D,isMountedByThisTrigger:I}=ax(k,R,w,{payload:c,closeOnClick:g,closeDelay:_}),U=ZB(),{delayRef:j,isInstantPhase:X,hasProvider:K}=CD(A,{open:N}),F=px(A);w.useSyncedValue("isInstantPhase",X);const W=w.useState("disabled"),V=d??W,H=En(V),q=w.useState("trackCursorAxis"),J=w.useState("disableHoverablePopup"),ue=E.useRef(!1),L=Gn(),B=E.useRef(void 0);function G(){const Ee=U?.delay,Oe=typeof j.current=="object"?j.current.open:void 0;let Ue=M;return K&&(Oe!==0?Ue=f??Ee??M:Ue=0),Ue}function P(Ee){const Oe=R.current;if(!Oe||!Ee)return!1;const Ue=tH(Ee);return Ue!==null&&Ue!==Oe&&nt(Oe,Ue)}function ae(Ee){const Oe=P(Ee);return ue.current=Oe,Oe&&(F.openChangeTimeout.clear(),F.restTimeout.clear(),F.restTimeoutPending=!1,L.clear()),Oe}const ie=ON(A,{enabled:!V,mouseOnly:!0,move:!1,handleClose:!J&&q!=="both"?LN():null,restMs:G,delay(){const Ee=typeof j.current=="object"?j.current.close:void 0;let Oe=_;return h==null&&K&&(Oe=Ee),{close:Oe}},triggerElementRef:R,isActiveTrigger:C,isClosing:()=>w.select("transitionStatus")==="ending",shouldOpen(){return!ue.current}}),ce=AN(A,{enabled:!V}).reference,de=Ee=>{const Oe=ue.current,Ue=QS(Ee),Xe=ae(Ue),qe=R.current,De=qe&&Ue&&nt(qe,Ue);if(Xe&&w.select("open")&&w.select("lastOpenChangeReason")===qn){w.setOpen(!1,pt(qn,Ee));return}if(Oe&&!Xe&&De&&!H.current&&!w.select("open")&&qe&&so(B.current)){const ke=()=>{!ue.current&&!H.current&&!w.select("open")&&w.setOpen(!0,pt(qn,Ee,qe))},ye=G();ye===0?(L.clear(),ke()):L.start(ye,ke)}},he=w.useState("triggerProps",I);return Nn("button",t,{state:{open:N},ref:[n,D,R],props:[ie,ce,I||q!=="none"?he:void 0,{onMouseOver(Ee){de(Ee.nativeEvent)},onFocus(Ee){P(QS(Ee.nativeEvent))&&Ee.preventBaseUIHandler()},onMouseLeave(){ue.current=!1,L.clear(),B.current=void 0},onPointerEnter(Ee){B.current=Ee.pointerType},onPointerDown(Ee){B.current=Ee.pointerType,w.set("closeOnClick",g),g&&!w.select("open")&&w.cancelPendingOpen(Ee.nativeEvent)},onClick(Ee){g&&!w.select("open")&&w.cancelPendingOpen(Ee.nativeEvent)},id:k,[JB.triggerDisabled]:V?"":void 0,[PA]:V?void 0:""},x],stateAttributesMapping:gx})}),jA=E.createContext(void 0);function rH(){const e=E.useContext(jA);if(e===void 0)throw new Error(Ln(70));return e}const sH=E.forwardRef(function(t,n){const{children:r,container:i,className:a,render:l,style:c,...d}=t,{portalNode:f,portalSubtree:g}=oN({container:i,ref:n,componentProps:t,elementProps:d});return!g&&!f?null:m.jsxs(E.Fragment,{children:[g,f&&br.createPortal(r,f)]})}),iH=E.forwardRef(function(t,n){const{keepMounted:r=!1,...i}=t;return Rp().useState("mounted")||r?m.jsx(jA.Provider,{value:r,children:m.jsx(sH,{ref:n,...i})}):null}),BA=E.createContext(void 0);function aH(){const e=E.useContext(BA);if(e===void 0)throw new Error(Ln(71));return e}const oH=E.forwardRef(function(t,n){const{render:r,className:i,anchor:a,positionMethod:l="absolute",side:c="top",align:d="center",sideOffset:f=0,alignOffset:g=0,collisionBoundary:h="clipping-ancestors",collisionPadding:b=5,arrowPadding:x=5,sticky:v=!1,disableAnchorTracking:w=!1,collisionAvoidance:k=sN,style:C,...N}=t,A=Rp(),R=rH(),M=A.useState("open"),_=A.useState("mounted"),D=A.useState("trackCursorAxis"),I=A.useState("disableHoverablePopup"),U=A.useState("floatingRootContext"),j=A.useState("instantType"),X=A.useState("transitionStatus"),K=A.useState("hasViewport"),F=Ex({anchor:a,positionMethod:l,floatingRootContext:U,mounted:_,side:c,sideOffset:f,align:d,alignOffset:g,collisionBoundary:h,collisionPadding:b,sticky:v,arrowPadding:x,disableAnchorTracking:w,keepMounted:R,collisionAvoidance:k,adaptiveOrigin:K?QN:void 0}),W=E.useMemo(()=>({open:M,side:F.side,align:F.align,anchorHidden:F.anchorHidden,instant:D!=="none"?"tracking-cursor":j}),[M,F.side,F.align,F.anchorHidden,D,j]),V=Tx(t,W,{styles:F.positionerStyles,transitionStatus:X,props:N,refs:[n,A.useStateSetter("positionerElement")],hidden:!_,inert:!M||D==="both"||I});return m.jsx(BA.Provider,{value:F,children:V})}),lH={...ql,...Vl},uH=E.forwardRef(function(t,n){const{render:r,className:i,style:a,...l}=t,c=Rp(),{side:d,align:f}=aH(),g=c.useState("open"),h=c.useState("instantType"),b=c.useState("transitionStatus"),x=c.useState("popupProps"),v=c.useState("floatingRootContext"),w=c.useState("disabled"),k=c.useState("closeDelay");vo({open:g,ref:c.context.popupRef,onComplete(){g&&c.context.onOpenChangeComplete?.(!0)}}),RN(v,{enabled:!w,closeDelay:k});const C=c.useStateSetter("popupElement");return Nn("div",t,{state:{open:g,side:d,align:f,instant:h,transitionStatus:b},ref:[n,c.context.popupRef,C],props:[x,Cp(b),l],stateAttributesMapping:lH})}),cH=function(t){const{delay:n,closeDelay:r,timeout:i=400}=t,a=E.useMemo(()=>({delay:n,closeDelay:r}),[n,r]),l=E.useMemo(()=>({open:n,close:r}),[n,r]);return m.jsx(DA.Provider,{value:a,children:m.jsx(SD,{delay:l,timeoutMs:i,children:t.children})})},dH=cH,fH=({className:e,side:t="top",sideOffset:n=6,...r})=>m.jsx(iH,{children:m.jsx(oH,{side:t,sideOffset:n,className:"isolate z-60",children:m.jsx(uH,{"data-slot":"tooltip-content",className:Ie("rounded-md border border-border bg-surface px-2 py-1 text-label text-fg-2 shadow-(--shadow-md) outline-none",e),...r})})});function Dx({content:e,render:t,side:n,children:r}){return m.jsxs(QB,{children:[m.jsx(nH,{render:t??m.jsx("span",{className:"inline-flex"}),children:r}),m.jsx(fH,{side:n,children:e})]})}function hH(e){if(typeof document>"u")return;let t=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css",t.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}const pH=e=>{switch(e){case"success":return bH;case"info":return yH;case"warning":return xH;case"error":return EH;default:return null}},mH=Array(12).fill(0),gH=({visible:e,className:t})=>ze.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},ze.createElement("div",{className:"sonner-spinner"},mH.map((n,r)=>ze.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${r}`})))),bH=ze.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},ze.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),xH=ze.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},ze.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),yH=ze.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},ze.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),EH=ze.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},ze.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),vH=ze.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},ze.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),ze.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),TH=()=>{const[e,t]=ze.useState(document.hidden);return ze.useEffect(()=>{const n=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",n),()=>window.removeEventListener("visibilitychange",n)},[]),e};let zb=1;class SH{constructor(){this.subscribe=t=>(this.subscribers.push(t),()=>{const n=this.subscribers.indexOf(t);this.subscribers.splice(n,1)}),this.publish=t=>{this.subscribers.forEach(n=>n(t))},this.addToast=t=>{this.publish(t),this.toasts=[...this.toasts,t]},this.create=t=>{var n;const{message:r,...i}=t,a=typeof t?.id=="number"||((n=t.id)==null?void 0:n.length)>0?t.id:zb++,l=this.toasts.find(d=>d.id===a),c=t.dismissible===void 0?!0:t.dismissible;return this.dismissedToasts.has(a)&&this.dismissedToasts.delete(a),l?this.toasts=this.toasts.map(d=>d.id===a?(this.publish({...d,...t,id:a,title:r}),{...d,...t,id:a,dismissible:c,title:r}):d):this.addToast({title:r,...i,dismissible:c,id:a}),a},this.dismiss=t=>(t?(this.dismissedToasts.add(t),requestAnimationFrame(()=>this.subscribers.forEach(n=>n({id:t,dismiss:!0})))):this.toasts.forEach(n=>{this.subscribers.forEach(r=>r({id:n.id,dismiss:!0}))}),t),this.message=(t,n)=>this.create({...n,message:t}),this.error=(t,n)=>this.create({...n,message:t,type:"error"}),this.success=(t,n)=>this.create({...n,type:"success",message:t}),this.info=(t,n)=>this.create({...n,type:"info",message:t}),this.warning=(t,n)=>this.create({...n,type:"warning",message:t}),this.loading=(t,n)=>this.create({...n,type:"loading",message:t}),this.promise=(t,n)=>{if(!n)return;let r;n.loading!==void 0&&(r=this.create({...n,promise:t,type:"loading",message:n.loading,description:typeof n.description!="function"?n.description:void 0}));const i=Promise.resolve(t instanceof Function?t():t);let a=r!==void 0,l;const c=i.then(async f=>{if(l=["resolve",f],ze.isValidElement(f))a=!1,this.create({id:r,type:"default",message:f});else if(kH(f)&&!f.ok){a=!1;const h=typeof n.error=="function"?await n.error(`HTTP error! status: ${f.status}`):n.error,b=typeof n.description=="function"?await n.description(`HTTP error! status: ${f.status}`):n.description,v=typeof h=="object"&&!ze.isValidElement(h)?h:{message:h};this.create({id:r,type:"error",description:b,...v})}else if(f instanceof Error){a=!1;const h=typeof n.error=="function"?await n.error(f):n.error,b=typeof n.description=="function"?await n.description(f):n.description,v=typeof h=="object"&&!ze.isValidElement(h)?h:{message:h};this.create({id:r,type:"error",description:b,...v})}else if(n.success!==void 0){a=!1;const h=typeof n.success=="function"?await n.success(f):n.success,b=typeof n.description=="function"?await n.description(f):n.description,v=typeof h=="object"&&!ze.isValidElement(h)?h:{message:h};this.create({id:r,type:"success",description:b,...v})}}).catch(async f=>{if(l=["reject",f],n.error!==void 0){a=!1;const g=typeof n.error=="function"?await n.error(f):n.error,h=typeof n.description=="function"?await n.description(f):n.description,x=typeof g=="object"&&!ze.isValidElement(g)?g:{message:g};this.create({id:r,type:"error",description:h,...x})}}).finally(()=>{a&&(this.dismiss(r),r=void 0),n.finally==null||n.finally.call(n)}),d=()=>new Promise((f,g)=>c.then(()=>l[0]==="reject"?g(l[1]):f(l[1])).catch(g));return typeof r!="string"&&typeof r!="number"?{unwrap:d}:Object.assign(r,{unwrap:d})},this.custom=(t,n)=>{const r=n?.id||zb++;return this.create({jsx:t(r),id:r,...n}),r},this.getActiveToasts=()=>this.toasts.filter(t=>!this.dismissedToasts.has(t.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}}const _r=new SH,CH=(e,t)=>{const n=t?.id||zb++;return _r.addToast({title:e,...t,id:n}),n},kH=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",wH=CH,NH=()=>_r.toasts,AH=()=>_r.getActiveToasts(),Hn=Object.assign(wH,{success:_r.success,info:_r.info,warning:_r.warning,error:_r.error,custom:_r.custom,message:_r.message,promise:_r.promise,dismiss:_r.dismiss,loading:_r.loading},{getHistory:NH,getToasts:AH});hH("[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);background:var(--normal-bg);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}");function Gf(e){return e.label!==void 0}const _H=3,RH="24px",OH="16px",WS=4e3,IH=356,MH=14,LH=45,DH=200;function Ss(...e){return e.filter(Boolean).join(" ")}function PH(e){const[t,n]=e.split("-"),r=[];return t&&r.push(t),n&&r.push(n),r}const jH=e=>{var t,n,r,i,a,l,c,d,f;const{invert:g,toast:h,unstyled:b,interacting:x,setHeights:v,visibleToasts:w,heights:k,index:C,toasts:N,expanded:A,removeToast:R,defaultRichColors:M,closeButton:_,style:D,cancelButtonStyle:I,actionButtonStyle:U,className:j="",descriptionClassName:X="",duration:K,position:F,gap:W,expandByDefault:V,classNames:H,icons:q,closeButtonAriaLabel:J="Close toast"}=e,[ue,L]=ze.useState(null),[B,G]=ze.useState(null),[P,ae]=ze.useState(!1),[ie,ce]=ze.useState(!1),[de,he]=ze.useState(!1),[ve,Fe]=ze.useState(!1),[Le,Ee]=ze.useState(!1),[Oe,Ue]=ze.useState(0),[Xe,qe]=ze.useState(0),De=ze.useRef(h.duration||K||WS),ke=ze.useRef(null),ye=ze.useRef(null),Re=C===0,Pe=C+1<=w,ee=h.type,pe=h.dismissible!==!1,se=h.className||"",re=h.descriptionClassName||"",Q=ze.useMemo(()=>k.findIndex(Ke=>Ke.toastId===h.id)||0,[k,h.id]),$=ze.useMemo(()=>{var Ke;return(Ke=h.closeButton)!=null?Ke:_},[h.closeButton,_]),oe=ze.useMemo(()=>h.duration||K||WS,[h.duration,K]),Se=ze.useRef(0),_e=ze.useRef(0),$e=ze.useRef(0),ot=ze.useRef(null),[et,dt]=F.split("-"),ut=ze.useMemo(()=>k.reduce((Ke,yt,zt)=>zt>=Q?Ke:Ke+yt.height,0),[k,Q]),Ve=TH(),Rt=h.invert||g,Pt=ee==="loading";_e.current=ze.useMemo(()=>Q*W+ut,[Q,ut]),ze.useEffect(()=>{De.current=oe},[oe]),ze.useEffect(()=>{ae(!0)},[]),ze.useEffect(()=>{const Ke=ye.current;if(Ke){const yt=Ke.getBoundingClientRect().height;return qe(yt),v(zt=>[{toastId:h.id,height:yt,position:h.position},...zt]),()=>v(zt=>zt.filter(Jt=>Jt.toastId!==h.id))}},[v,h.id]),ze.useLayoutEffect(()=>{if(!P)return;const Ke=ye.current,yt=Ke.style.height;Ke.style.height="auto";const zt=Ke.getBoundingClientRect().height;Ke.style.height=yt,qe(zt),v(Jt=>Jt.find(Et=>Et.toastId===h.id)?Jt.map(Et=>Et.toastId===h.id?{...Et,height:zt}:Et):[{toastId:h.id,height:zt,position:h.position},...Jt])},[P,h.title,h.description,v,h.id,h.jsx,h.action,h.cancel]);const lt=ze.useCallback(()=>{ce(!0),Ue(_e.current),v(Ke=>Ke.filter(yt=>yt.toastId!==h.id)),setTimeout(()=>{R(h)},DH)},[h,R,v,_e]);ze.useEffect(()=>{if(h.promise&&ee==="loading"||h.duration===1/0||h.type==="loading")return;let Ke;return A||x||Ve?(()=>{if($e.current<Se.current){const Jt=new Date().getTime()-Se.current;De.current=De.current-Jt}$e.current=new Date().getTime()})():(()=>{De.current!==1/0&&(Se.current=new Date().getTime(),Ke=setTimeout(()=>{h.onAutoClose==null||h.onAutoClose.call(h,h),lt()},De.current))})(),()=>clearTimeout(Ke)},[A,x,h,ee,Ve,lt]),ze.useEffect(()=>{h.delete&&(lt(),h.onDismiss==null||h.onDismiss.call(h,h))},[lt,h.delete]);function Lt(){var Ke;if(q?.loading){var yt;return ze.createElement("div",{className:Ss(H?.loader,h==null||(yt=h.classNames)==null?void 0:yt.loader,"sonner-loader"),"data-visible":ee==="loading"},q.loading)}return ze.createElement(gH,{className:Ss(H?.loader,h==null||(Ke=h.classNames)==null?void 0:Ke.loader),visible:ee==="loading"})}const Wt=h.icon||q?.[ee]||pH(ee);var $t,Zt;return ze.createElement("li",{tabIndex:0,ref:ye,className:Ss(j,se,H?.toast,h==null||(t=h.classNames)==null?void 0:t.toast,H?.default,H?.[ee],h==null||(n=h.classNames)==null?void 0:n[ee]),"data-sonner-toast":"","data-rich-colors":($t=h.richColors)!=null?$t:M,"data-styled":!(h.jsx||h.unstyled||b),"data-mounted":P,"data-promise":!!h.promise,"data-swiped":Le,"data-removed":ie,"data-visible":Pe,"data-y-position":et,"data-x-position":dt,"data-index":C,"data-front":Re,"data-swiping":de,"data-dismissible":pe,"data-type":ee,"data-invert":Rt,"data-swipe-out":ve,"data-swipe-direction":B,"data-expanded":!!(A||V&&P),"data-testid":h.testId,style:{"--index":C,"--toasts-before":C,"--z-index":N.length-C,"--offset":`${ie?Oe:_e.current}px`,"--initial-height":V?"auto":`${Xe}px`,...D,...h.style},onDragEnd:()=>{he(!1),L(null),ot.current=null},onPointerDown:Ke=>{Ke.button!==2&&(Pt||!pe||(ke.current=new Date,Ue(_e.current),Ke.target.setPointerCapture(Ke.pointerId),Ke.target.tagName!=="BUTTON"&&(he(!0),ot.current={x:Ke.clientX,y:Ke.clientY})))},onPointerUp:()=>{var Ke,yt,zt;if(ve||!pe)return;ot.current=null;const Jt=Number(((Ke=ye.current)==null?void 0:Ke.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),Xn=Number(((yt=ye.current)==null?void 0:yt.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),Et=new Date().getTime()-((zt=ke.current)==null?void 0:zt.getTime()),an=ue==="x"?Jt:Xn,Er=Math.abs(an)/Et;if(Math.abs(an)>=LH||Er>.11){Ue(_e.current),h.onDismiss==null||h.onDismiss.call(h,h),G(ue==="x"?Jt>0?"right":"left":Xn>0?"down":"up"),lt(),Fe(!0);return}else{var mn,Tn;(mn=ye.current)==null||mn.style.setProperty("--swipe-amount-x","0px"),(Tn=ye.current)==null||Tn.style.setProperty("--swipe-amount-y","0px")}Ee(!1),he(!1),L(null)},onPointerMove:Ke=>{var yt,zt,Jt;if(!ot.current||!pe||((yt=window.getSelection())==null?void 0:yt.toString().length)>0)return;const Et=Ke.clientY-ot.current.y,an=Ke.clientX-ot.current.x;var Er;const mn=(Er=e.swipeDirections)!=null?Er:PH(F);!ue&&(Math.abs(an)>1||Math.abs(Et)>1)&&L(Math.abs(an)>Math.abs(Et)?"x":"y");let Tn={x:0,y:0};const ht=Ot=>1/(1.5+Math.abs(Ot)/20);if(ue==="y"){if(mn.includes("top")||mn.includes("bottom"))if(mn.includes("top")&&Et<0||mn.includes("bottom")&&Et>0)Tn.y=Et;else{const Ot=Et*ht(Et);Tn.y=Math.abs(Ot)<Math.abs(Et)?Ot:Et}}else if(ue==="x"&&(mn.includes("left")||mn.includes("right")))if(mn.includes("left")&&an<0||mn.includes("right")&&an>0)Tn.x=an;else{const Ot=an*ht(an);Tn.x=Math.abs(Ot)<Math.abs(an)?Ot:an}(Math.abs(Tn.x)>0||Math.abs(Tn.y)>0)&&Ee(!0),(zt=ye.current)==null||zt.style.setProperty("--swipe-amount-x",`${Tn.x}px`),(Jt=ye.current)==null||Jt.style.setProperty("--swipe-amount-y",`${Tn.y}px`)}},$&&!h.jsx&&ee!=="loading"?ze.createElement("button",{"aria-label":J,"data-disabled":Pt,"data-close-button":!0,onClick:Pt||!pe?()=>{}:()=>{lt(),h.onDismiss==null||h.onDismiss.call(h,h)},className:Ss(H?.closeButton,h==null||(r=h.classNames)==null?void 0:r.closeButton)},(Zt=q?.close)!=null?Zt:vH):null,(ee||h.icon||h.promise)&&h.icon!==null&&(q?.[ee]!==null||h.icon)?ze.createElement("div",{"data-icon":"",className:Ss(H?.icon,h==null||(i=h.classNames)==null?void 0:i.icon)},h.promise||h.type==="loading"&&!h.icon?h.icon||Lt():null,h.type!=="loading"?Wt:null):null,ze.createElement("div",{"data-content":"",className:Ss(H?.content,h==null||(a=h.classNames)==null?void 0:a.content)},ze.createElement("div",{"data-title":"",className:Ss(H?.title,h==null||(l=h.classNames)==null?void 0:l.title)},h.jsx?h.jsx:typeof h.title=="function"?h.title():h.title),h.description?ze.createElement("div",{"data-description":"",className:Ss(X,re,H?.description,h==null||(c=h.classNames)==null?void 0:c.description)},typeof h.description=="function"?h.description():h.description):null),ze.isValidElement(h.cancel)?h.cancel:h.cancel&&Gf(h.cancel)?ze.createElement("button",{"data-button":!0,"data-cancel":!0,style:h.cancelButtonStyle||I,onClick:Ke=>{Gf(h.cancel)&&pe&&(h.cancel.onClick==null||h.cancel.onClick.call(h.cancel,Ke),lt())},className:Ss(H?.cancelButton,h==null||(d=h.classNames)==null?void 0:d.cancelButton)},h.cancel.label):null,ze.isValidElement(h.action)?h.action:h.action&&Gf(h.action)?ze.createElement("button",{"data-button":!0,"data-action":!0,style:h.actionButtonStyle||U,onClick:Ke=>{Gf(h.action)&&(h.action.onClick==null||h.action.onClick.call(h.action,Ke),!Ke.defaultPrevented&&lt())},className:Ss(H?.actionButton,h==null||(f=h.classNames)==null?void 0:f.actionButton)},h.action.label):null)};function ZS(){if(typeof window>"u"||typeof document>"u")return"ltr";const e=document.documentElement.getAttribute("dir");return e==="auto"||!e?window.getComputedStyle(document.documentElement).direction:e}function BH(e,t){const n={};return[e,t].forEach((r,i)=>{const a=i===1,l=a?"--mobile-offset":"--offset",c=a?OH:RH;function d(f){["top","right","bottom","left"].forEach(g=>{n[`${l}-${g}`]=typeof f=="number"?`${f}px`:f})}typeof r=="number"||typeof r=="string"?d(r):typeof r=="object"?["top","right","bottom","left"].forEach(f=>{r[f]===void 0?n[`${l}-${f}`]=c:n[`${l}-${f}`]=typeof r[f]=="number"?`${r[f]}px`:r[f]}):d(c)}),n}const HH=ze.forwardRef(function(t,n){const{id:r,invert:i,position:a="bottom-right",hotkey:l=["altKey","KeyT"],expand:c,closeButton:d,className:f,offset:g,mobileOffset:h,theme:b="light",richColors:x,duration:v,style:w,visibleToasts:k=_H,toastOptions:C,dir:N=ZS(),gap:A=MH,icons:R,containerAriaLabel:M="Notifications"}=t,[_,D]=ze.useState([]),I=ze.useMemo(()=>r?_.filter(P=>P.toasterId===r):_.filter(P=>!P.toasterId),[_,r]),U=ze.useMemo(()=>Array.from(new Set([a].concat(I.filter(P=>P.position).map(P=>P.position)))),[I,a]),[j,X]=ze.useState([]),[K,F]=ze.useState(!1),[W,V]=ze.useState(!1),[H,q]=ze.useState(b!=="system"?b:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),J=ze.useRef(null),ue=l.join("+").replace(/Key/g,"").replace(/Digit/g,""),L=ze.useRef(null),B=ze.useRef(!1),G=ze.useCallback(P=>{D(ae=>{var ie;return(ie=ae.find(ce=>ce.id===P.id))!=null&&ie.delete||_r.dismiss(P.id),ae.filter(({id:ce})=>ce!==P.id)})},[]);return ze.useEffect(()=>_r.subscribe(P=>{if(P.dismiss){requestAnimationFrame(()=>{D(ae=>ae.map(ie=>ie.id===P.id?{...ie,delete:!0}:ie))});return}setTimeout(()=>{cM.flushSync(()=>{D(ae=>{const ie=ae.findIndex(ce=>ce.id===P.id);return ie!==-1?[...ae.slice(0,ie),{...ae[ie],...P},...ae.slice(ie+1)]:[P,...ae]})})})}),[_]),ze.useEffect(()=>{if(b!=="system"){q(b);return}if(b==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?q("dark"):q("light")),typeof window>"u")return;const P=window.matchMedia("(prefers-color-scheme: dark)");try{P.addEventListener("change",({matches:ae})=>{q(ae?"dark":"light")})}catch{P.addListener(({matches:ie})=>{try{q(ie?"dark":"light")}catch(ce){console.error(ce)}})}},[b]),ze.useEffect(()=>{_.length<=1&&F(!1)},[_]),ze.useEffect(()=>{const P=ae=>{var ie;if(l.every(he=>ae[he]||ae.code===he)){var de;F(!0),(de=J.current)==null||de.focus()}ae.code==="Escape"&&(document.activeElement===J.current||(ie=J.current)!=null&&ie.contains(document.activeElement))&&F(!1)};return document.addEventListener("keydown",P),()=>document.removeEventListener("keydown",P)},[l]),ze.useEffect(()=>{if(J.current)return()=>{L.current&&(L.current.focus({preventScroll:!0}),L.current=null,B.current=!1)}},[J.current]),ze.createElement("section",{ref:n,"aria-label":`${M} ${ue}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},U.map((P,ae)=>{var ie;const[ce,de]=P.split("-");return I.length?ze.createElement("ol",{key:P,dir:N==="auto"?ZS():N,tabIndex:-1,ref:J,className:f,"data-sonner-toaster":!0,"data-sonner-theme":H,"data-y-position":ce,"data-x-position":de,style:{"--front-toast-height":`${((ie=j[0])==null?void 0:ie.height)||0}px`,"--width":`${IH}px`,"--gap":`${A}px`,...w,...BH(g,h)},onBlur:he=>{B.current&&!he.currentTarget.contains(he.relatedTarget)&&(B.current=!1,L.current&&(L.current.focus({preventScroll:!0}),L.current=null))},onFocus:he=>{he.target instanceof HTMLElement&&he.target.dataset.dismissible==="false"||B.current||(B.current=!0,L.current=he.relatedTarget)},onMouseEnter:()=>F(!0),onMouseMove:()=>F(!0),onMouseLeave:()=>{W||F(!1)},onDragEnd:()=>F(!1),onPointerDown:he=>{he.target instanceof HTMLElement&&he.target.dataset.dismissible==="false"||V(!0)},onPointerUp:()=>V(!1)},I.filter(he=>!he.position&&ae===0||he.position===P).map((he,ve)=>{var Fe,Le;return ze.createElement(jH,{key:he.id,icons:R,index:ve,toast:he,defaultRichColors:x,duration:(Fe=C?.duration)!=null?Fe:v,className:C?.className,descriptionClassName:C?.descriptionClassName,invert:i,visibleToasts:k,closeButton:(Le=C?.closeButton)!=null?Le:d,interacting:W,position:P,style:C?.style,unstyled:C?.unstyled,classNames:C?.classNames,cancelButtonStyle:C?.cancelButtonStyle,actionButtonStyle:C?.actionButtonStyle,closeButtonAriaLabel:C?.closeButtonAriaLabel,removeToast:G,toasts:I.filter(Ee=>Ee.position==he.position),heights:j.filter(Ee=>Ee.position==he.position),setHeights:X,expandByDefault:c,gap:A,expanded:K,swipeDirections:t.swipeDirections})})):null}))});function UH(){return m.jsx(HH,{position:"bottom-right",toastOptions:{style:{background:"var(--surface)",color:"var(--text)",border:"1px solid var(--border)",boxShadow:"var(--shadow-md)",fontFamily:"var(--cw-font-sans)",fontSize:"var(--text-body-sm)"}}})}async function zH(e){try{if(navigator.clipboard?.writeText)return await navigator.clipboard.writeText(e),!0}catch{}return FH(e)}function FH(e){if(typeof document>"u")return!1;const t=document.createElement("textarea");t.value=e,t.setAttribute("readonly",""),t.style.position="fixed",t.style.top="-9999px",t.style.opacity="0",document.body.appendChild(t);const n=document.activeElement;try{return t.select(),t.setSelectionRange(0,e.length),document.execCommand("copy")}catch{return!1}finally{document.body.removeChild(t),n instanceof HTMLElement&&n.focus()}}function Px({value:e,className:t,variant:n="ghost",size:r="icon-sm",...i}){const[a,l]=E.useState(!1);return m.jsx(at,{variant:n,size:r,"aria-label":"Copy",className:Ie("text-fg-3",t),onClick:()=>{zH(e).then(c=>{c&&(l(!0),setTimeout(()=>l(!1),1500))})},...i,children:a?m.jsx(aA,{className:"size-3.5 text-success"}):m.jsx(E9,{className:"size-3.5"})})}function wn({className:e}){return m.jsx(J9,{"aria-label":"Loading",className:Ie("size-4 animate-spin text-fg-3",e)})}function mh({code:e,label:t,copyable:n=!0,className:r}){return m.jsxs("div",{"data-slot":"code-block",className:Ie("overflow-hidden rounded-md border border-border bg-code-bg",r),children:[t!==void 0||n?m.jsxs("div",{className:"flex h-8 items-center justify-between border-b border-border px-2.5",children:[m.jsx("span",{className:"font-mono text-label text-fg-3",children:t}),n?m.jsx(Px,{value:e}):null]}):null,m.jsx("pre",{className:"max-h-64 overflow-auto px-3 py-2 font-mono text-label whitespace-pre-wrap text-fg-2",children:e})]})}function JS({orientation:e,value:t,onValueChange:n,min:r,max:i,step:a=16,inverted:l,"aria-label":c,className:d}){const f=E.useRef(null),g=e==="vertical",h=E.useCallback(k=>Math.min(i,Math.max(r,k)),[r,i]),b=k=>{k.button===0&&(k.preventDefault(),k.currentTarget.setPointerCapture(k.pointerId),f.current={origin:g?k.clientX:k.clientY,start:t})},x=k=>{const C=f.current;if(!C)return;const N=(g?k.clientX:k.clientY)-C.origin;n(h(C.start+(l?-N:N)))},v=k=>{f.current&&(f.current=null,k.currentTarget.hasPointerCapture(k.pointerId)&&k.currentTarget.releasePointerCapture(k.pointerId))},w=k=>{const C=g?"ArrowRight":"ArrowDown",N=g?"ArrowLeft":"ArrowUp",A=l?-1:1;if(k.key===C)n(h(t+a*A));else if(k.key===N)n(h(t-a*A));else if(k.key==="Home")n(r);else if(k.key==="End")n(i);else return;k.preventDefault()};return m.jsx("div",{"data-slot":"splitter",role:"separator",tabIndex:0,"aria-label":c,"aria-orientation":e,"aria-valuenow":Math.round(t),"aria-valuemin":r,"aria-valuemax":i,onPointerDown:b,onPointerMove:x,onPointerUp:v,onPointerCancel:v,onKeyDown:w,className:Ie("group relative shrink-0 touch-none bg-border transition-colors","hover:bg-border-strong focus-visible:bg-accent focus-visible:outline-none",g?"w-px cursor-col-resize":"h-px cursor-row-resize",d),children:m.jsx("span",{"aria-hidden":!0,className:Ie("absolute",g?"-inset-x-[3px] inset-y-0":"-inset-y-[3px] inset-x-0")})})}function HA({value:e,size:t=13,strokeWidth:n=2,className:r}){const i=Math.min(100,Math.max(0,e)),a=(t-n)/2,l=2*Math.PI*a;return m.jsxs("svg",{"data-slot":"progress-ring",width:t,height:t,viewBox:`0 0 ${t} ${t}`,role:"img","aria-label":`${Math.round(i)}%`,className:Ie("shrink-0 -rotate-90",r),children:[m.jsx("circle",{cx:t/2,cy:t/2,r:a,fill:"none",stroke:"currentColor",strokeOpacity:.2,strokeWidth:n}),m.jsx("circle",{cx:t/2,cy:t/2,r:a,fill:"none",stroke:"currentColor",strokeWidth:n,strokeLinecap:"round",strokeDasharray:l,strokeDashoffset:l*(1-i/100)})]})}function Bn(e){return e.map(t=>t.type==="text"?t.text:`${t.trigger}${t.displayText}`).join("")}function $H(e){return e?[{type:"text",text:e}]:[]}function VH(e,t){if(t<=0)return[];const n=[];let r=0;for(const i of e){const a=i.type==="text"?i.text.length:i.trigger.length+i.displayText.length;if(r+a<=t){n.push(i),r+=a;continue}if(i.type==="text"){let l=t-r;if(l>0){const c=i.text.charCodeAt(l-1);c>=55296&&c<=56319&&(l-=1),l>0&&n.push({type:"text",text:i.text.slice(0,l)})}}break}return n}function Cc(e){return e===" "||e===`
467
+ `||e===" "}function UA(e){const t=new Map;for(const n of e)t.has(n.char)||t.set(n.char,n);return t}function Uh(e,t,n){if(t===0)return!0;const r=e[t-1];return n==="start"?r===`
468
+ `:Cc(r)}function qH(e,t,n){if(!e||t===0||n.length===0)return null;const r=UA(n);for(let i=t-1;i>=0;i--){const a=e[i];if(Cc(a)){if(i+1<t){const c=e[i+1],d=r.get(c);if(d&&Uh(e,i+1,d.position))return{config:d,startOffset:i+1,query:e.slice(i+2,t)}}return null}const l=r.get(a);if(l&&Uh(e,i,l.position))return{config:l,startOffset:i,query:e.slice(i+1,t)}}return null}function j0(e,t,n){const r=t.startOffset,i=r+1+t.query.length,a=[];let l=0;for(const h of e)if(h.type==="chip"){const b=`${h.trigger}${h.displayText}`,x=l,v=l+b.length;(v<=r||x>=i)&&a.push(h),l=v}else{const b=l,x=l+h.text.length;if(x<=r)a.push(h);else if(b>=i)a.push(h);else{const v=h.text.slice(0,Math.max(0,r-b)),w=h.text.slice(Math.min(h.text.length,i-b));v&&a.push({type:"text",text:v});const k={type:"chip",trigger:t.config.char,value:n.value,displayText:n.displayText,...n.data!==void 0?{data:n.data}:{},...n.autoResolved?{autoResolved:!0}:{}};a.push(k),w?a.push({type:"text",text:" "+w.replace(/^\s/,"")}):a.push({type:"text",text:" "})}l=x}const c=Co(a);let d=-1,f=0;for(const h of c)h.type==="text"?f+=h.text.length:(f+=h.trigger.length+h.displayText.length,h.value===n.value&&h.displayText===n.displayText&&h.trigger===t.config.char&&(d=f));const g=d===-1?f:d+1;return{segments:c,cursorOffset:g}}function YH(e,t,n){const r=t.startOffset,i=r+1+t.query.length,a=[];let l=0,c=r+n.length;for(const g of e){if(g.type==="chip"){const x=l+`${g.trigger}${g.displayText}`.length;(x<=r||l>=i)&&a.push(g),l=x;continue}const h=l,b=l+g.text.length;if(b<=r||h>=i)a.push(g);else{const x=g.text.slice(0,Math.max(0,r-h)),v=g.text.slice(Math.min(g.text.length,i-h));x&&a.push({type:"text",text:x}),a.push({type:"text",text:n}),v&&a.push({type:"text",text:v})}l=b}const d=Co(a),f=Bn(d).length;return c>f&&(c=f),{segments:d,cursorOffset:c}}function GH(e,t){if(t<0||t>=e.length||e[t].type!=="chip")return e;const n=[...e.slice(0,t),...e.slice(t+1)];return Co(n)}function XH(e,t){if(t<0||t>=e.length)return null;const n=e[t];if(n.type!=="chip"||!n.autoResolved)return null;const r=`${n.trigger}${n.displayText}`,i=[...e.slice(0,t),{type:"text",text:r},...e.slice(t+1)];return{segments:Co(i),revertedText:r}}function KH(e,t){const n=t.filter(a=>a.resolveOnSpace);if(n.length===0)return e;const r=UA(n),i=[];for(const a of e){if(a.type==="chip"){i.push(a);continue}const l=QH(a.text,r);i.push(...l)}return Co(i)}function QH(e,t){if(!e)return[];const n=[];let r=0;for(;r<e.length;){const i=e[r];if(t.has(i)&&(r===0||Cc(e[r-1]))){const c=t.get(i);if(c&&Uh(e,r,c.position)){let d=r+1;for(;d<e.length&&!Cc(e[d]);)d++;const f=e.slice(r+1,d);if(f.length>0){const g=c.onSelect?.({value:f,label:f})||f;n.push({type:"chip",trigger:i,value:f,displayText:g,autoResolved:!0}),r=d;continue}}}const a=r;for(r++;r<e.length&&!(t.has(e[r])&&Cc(e[r-1]));)r++;n.push({type:"text",text:e.slice(a,r)})}return n}function hr(e,t,n,r){const i=[];let a=0,l=!1;for(const c of e)if(c.type==="chip"){const d=`${c.trigger}${c.displayText}`,f=a,g=a+d.length;!l&&t===n&&f===t&&(i.push({type:"text",text:r}),l=!0),(g<=t||f>=n)&&i.push(c),a=g}else{const d=a,f=a+c.text.length,g=t===n?f<t:f<=t,h=t===n?d>n:d>=n;if(g)i.push(c);else if(h)i.push(c);else{const b=c.text.slice(0,Math.max(0,t-d)),x=c.text.slice(Math.min(c.text.length,n-d));b&&i.push({type:"text",text:b}),!l&&d<=t&&(i.push({type:"text",text:r}),l=!0),x&&i.push({type:"text",text:x})}a=f}return!l&&r&&i.push({type:"text",text:r}),Co(i)}function WH(e,t,n,r){if(t===n)return null;const i=Bn(e),a=r.length,l=t>=a&&i.slice(t-a,t)===r,c=n+a<=i.length&&i.slice(n,n+a)===r;let d=l&&c;if(d&&a===1){const h=t>a?i[t-a-1]:"",b=n+a<i.length?i[n+a]:"";(h===r||b===r)&&(d=!1)}if(d){const h=hr(e,n,n+a,"");return{segments:hr(h,t-a,t,""),selectionStart:t-a,selectionEnd:n-a}}const f=hr(e,n,n,r);return{segments:hr(f,t,t,r),selectionStart:t+a,selectionEnd:n+a}}function ZH(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++){const r=e[n],i=t[n];if(r.type!==i.type)return!1;if(r.type==="text"){if(i.type!=="text"||r.text!==i.text)return!1}else if(i.type!=="chip"||r.trigger!==i.trigger||r.value!==i.value||r.displayText!==i.displayText||r.autoResolved!==i.autoResolved)return!1}return!0}function Co(e){const t=[];for(const n of e){if(n.type==="text"&&n.text==="")continue;const r=t[t.length-1];n.type==="text"&&r?.type==="text"?t[t.length-1]={type:"text",text:r.text+n.text}:t.push(n)}return t}function Op(e){const t=e.match(/^(\s*)([•\-*]) /);if(t)return{kind:"bullet",indent:Math.floor(t[1].length/2),marker:t[2],prefixLen:t[0].length};const n=e.match(/^(\s*)(\d+)\. /);if(n){const r=n[1].length;return{kind:"numbered",indent:Math.floor(n[1].length/2),number:parseInt(n[2],10),numberStart:r,numberEnd:r+n[2].length,prefixLen:n[0].length}}return null}function Dl(e,t){const n=e.lastIndexOf(`
469
+ `,t-1)+1,r=e.indexOf(`
470
+ `,t),i=e.slice(n,r===-1?e.length:r),a=Op(i);return a?{lineStart:n,prefix:i.slice(0,a.prefixLen),indent:a.indent,listType:a.kind,...a.kind==="bullet"?{marker:a.marker}:{number:a.number},contentStart:n+a.prefixLen}:null}function JH(e,t){const n=Bn(e),r=n.lastIndexOf(`
471
+ `,t-1)+1,i=n.slice(r,t),a=i.match(/^(\s*)[-*] $/);if(!a)return null;const c=`${a[1]}• `,d=r,f=r+i.length;return{segments:hr(e,d,f,c),cursorOffset:r+c.length}}function eU(e,t){const n=Bn(e),r=Dl(n,t);if(!r)return null;const i=n.indexOf(`
472
+ `,t);if(n.slice(r.contentStart,i===-1?n.length:i).trim()==="")return r.indent>0?{segments:hr(e,r.lineStart,r.lineStart+2,""),cursorOffset:Math.max(r.lineStart,t-2)}:{segments:hr(e,r.lineStart,r.lineStart+r.prefix.length,""),cursorOffset:r.lineStart};const l=" ".repeat(r.indent);let c;if(r.listType==="bullet")c=`${l}${r.marker??"•"} `;else{const g=(r.number??1)+1;c=`${l}${g}. `}const d=`
473
+ ${c}`;return{segments:hr(e,t,t,d),cursorOffset:t+d.length}}function tU(e,t){if(t===0)return null;const n=e.lastIndexOf(`
474
+ `,t-2)+1,r=Op(e.slice(n,t-1));return r?r.indent:null}function nU(e,t){const n=Bn(e),r=Dl(n,t);if(!r)return null;const i=tU(n,r.lineStart),a=i===null?0:i+1;return r.indent>=a?null:{segments:hr(e,r.lineStart,r.lineStart," "),cursorOffset:t+2}}function rU(e,t){const n=Bn(e),r=Dl(n,t);return!r||r.indent===0?null:{segments:hr(e,r.lineStart,r.lineStart+2,""),cursorOffset:Math.max(r.lineStart,t-2)}}function sU(e,t){const n=Bn(e),r=Dl(n,t);return!r||t>r.contentStart?null:{segments:hr(e,r.lineStart,r.contentStart," ".repeat(r.indent)),cursorOffset:r.lineStart+r.indent*2}}const iU=/^\s*```/;function zA(e,t){return t?e.replace(/^(\s*)- /,"$1• "):e.replace(/^(\s*)• /,"$1- ")}function FA(e){const t=new Set;let n=-1;return e.forEach((r,i)=>{if(iU.test(r))if(n===-1)n=i;else{for(let a=n;a<=i;a++)t.add(a);n=-1}}),t}function aU(e,t){const n=e.split(`
475
+ `),r=FA(n);return n.map((i,a)=>r.has(a)?i:zA(i,t)).join(`
476
+ `)}function eC(e,t){const n=[];e.forEach(c=>{c.type==="text"&&n.push(...c.text.split(`
477
+ `))});const r=FA(n);let i=0,a=!1;const l=e.map(c=>{if(c.type!=="text")return c;const d=c.text.split(`
478
+ `).map(f=>{const g=r.has(i)?f:zA(f,t);return i++,g}).join(`
479
+ `);return d===c.text?c:(a=!0,{...c,text:d})});return a?l:e}function $A(e){let t=null,n=0,r=0,i=0,a=!0;for(const l of e.split(`
480
+ `)){const c=Op(l);if(c?.kind==="numbered"&&c.indent===t){if(a=a&&c.number===r+1,r=c.number,i++,i>=2&&(n===1||a))return!0}else c?.kind==="numbered"?(t=c.indent,n=c.number,r=c.number,i=1,a=!0):(t=null,i=0)}return!1}function VA(e){if(!/^[ \t]*\d+\. /m.test(e))return{text:e,edits:[]};const t=new Map,n=[],r=e.split(`
481
+ `);let i="",a=0;const l=(c,d)=>{for(const f of t.keys())(d?f>=c:f>c)&&t.delete(f)};for(let c=0;c<r.length;c++){const d=r[c],f=Op(d);if(!f)t.clear(),i+=d;else if(f.kind==="bullet")l(f.indent,!0),i+=d;else{const g=f.indent;l(g,!1);const h=t.get(g),b=h===void 0?1:h+1;t.set(g,b);const x=String(b);x===String(f.number)?i+=d:(n.push({oldStart:a+f.numberStart,oldEnd:a+f.numberEnd,newText:x}),i+=d.slice(0,f.numberStart)+x+d.slice(f.numberEnd))}c<r.length-1&&(i+=`
482
+ `),a+=d.length+1}return n.length===0?{text:e,edits:n}:{text:i,edits:n}}function tC(e,t){let n=0;for(const r of t)if(r.oldEnd<=e)n+=r.newText.length-(r.oldEnd-r.oldStart);else{if(r.oldStart>=e)break;return r.oldStart+n+Math.min(e-r.oldStart,r.newText.length)}return e+n}function nC(e){const{edits:t}=VA(Bn(e));if(t.length===0)return{segments:e,edits:t};let n=e;for(let r=t.length-1;r>=0;r--){const i=t[r];n=hr(n,i.oldStart,i.oldEnd,i.newText)}return{segments:n,edits:t}}function gi(e){return e instanceof HTMLElement}function er(e){return e instanceof HTMLElement&&e.dataset.chipTrigger!==void 0}function zh(e){return e instanceof HTMLBRElement}function ed(e){return e instanceof Text}function Fb(e){return er(e)&&e.dataset.chipAutoResolved==="true"}function oU(e){return e instanceof HTMLAnchorElement&&e.dataset.url==="true"}function lU(e){try{return JSON.parse(e)}catch{return}}function gh(e){try{return JSON.stringify(e)}catch{return}}function qA(e){if(er(e))return e.dataset.chipTrigger}function uU(e){if(er(e))return e.dataset.chipValue}function YA(e){if(er(e))return e.dataset.chipDisplay??e.textContent??void 0}function cU(e){if(!er(e))return;const t=e.dataset.chipData;if(t)return lU(t)}function GA(e){const t=e.dataset.chipTrigger??"",n=e.dataset.chipDisplay??e.textContent??"";return t.length+n.length}function Fh(e){if(!er(e))return null;const t=qA(e),n=uU(e),r=YA(e);if(!t||n===void 0||!r)return null;const i=cU(e),a=Fb(e);return{type:"chip",trigger:t,value:n,displayText:r,...i!==void 0?{data:i}:{},...a?{autoResolved:!0}:{}}}function bh(e,t){const n=e.childNodes;for(let r=0;r<n.length;r++)if(n[r]===t)return r;return-1}function dU(e){return e.nodeType===Node.TEXT_NODE?(e.textContent??"")!=="":zh(e)?!e.dataset.sentinel:er(e)?Fh(e)!==null:gi(e)?(e.textContent??"")!=="":!1}function B0(e,t){let n=0;for(let r=0;r<t;r++)dU(e.childNodes[r])&&n++;return n}function $b(e,t){let n=t;for(;n!==null;){if(n.parentNode===e)return n;n=n.parentNode}return null}function fU(e,t){const n=document.createDocumentFragment();for(;t.firstChild;)n.appendChild(t.firstChild);n.appendChild(document.createElement("br")),e.replaceChild(n,t)}function Vb(e){let t=!1;const n=new Set(["DIV","P","SECTION","ARTICLE","BLOCKQUOTE"]);for(let r=e.childNodes.length-1;r>=0;r--){const i=e.childNodes[r];if(!(i instanceof HTMLElement)||i.dataset.chipTrigger!==void 0||i instanceof HTMLBRElement)continue;const a=i.tagName;if(n.has(a))fU(e,i),t=!0;else if(a==="FONT"||a==="B"||a==="I"||a==="U"||a==="STRONG"||a==="EM"||a==="A"||a==="SPAN"){const l=i.textContent??"";l?e.replaceChild(document.createTextNode(l),i):e.removeChild(i),t=!0}}return e.normalize(),t}const rC=/https?:\/\/[^\s),]+/g;function hU(e){let t=!1;const n=[];for(let r=0;r<e.childNodes.length;r++){const i=e.childNodes[r];ed(i)&&i.textContent&&n.push(i)}for(const r of n){const i=r.textContent??"";rC.lastIndex=0;const a=[];let l;for(;(l=rC.exec(i))!==null;){let h=l[0];for(;h.length>0&&/[.;:!?]$/.test(h);)h=h.slice(0,-1);h.length>0&&a.push({url:h,index:l.index})}if(a.length===0)continue;const c=r.parentNode;if(!c)continue;const d=[];for(const{url:h,index:b}of a)try{const x=new URL(h);(x.protocol==="http:"||x.protocol==="https:")&&d.push({url:h,href:x.href,index:b})}catch{}if(d.length===0)continue;t=!0;const f=document.createDocumentFragment();let g=0;for(const{url:h,href:b,index:x}of d){x>g&&f.appendChild(document.createTextNode(i.slice(g,x)));const v=document.createElement("a");v.href=b,v.target="_blank",v.rel="noopener noreferrer",v.dataset.url="true",v.className="text-accent hover:text-accent-hover underline cursor-pointer",v.textContent=h,f.appendChild(v),g=x+h.length}g<i.length&&f.appendChild(document.createTextNode(i.slice(g))),c.replaceChild(f,r)}return t}const sC=/(\*{3})(.+?)\*{3}|(\*{2})(.+?)\*{2}|(\*)(.+?)\*/g;function pU(e){let t=!1;const n=[];for(let r=0;r<e.childNodes.length;r++){const i=e.childNodes[r];ed(i)&&i.textContent&&n.push(i)}for(const r of n){const i=r.textContent??"";sC.lastIndex=0;const a=[];let l;for(;(l=sC.exec(i))!==null;)l[1]&&l[2]?a.push({fullMatch:l[0],marker:l[1],content:l[2],index:l.index,className:"font-bold italic"}):l[3]&&l[4]?a.push({fullMatch:l[0],marker:l[3],content:l[4],index:l.index,className:"font-bold"}):l[5]&&l[6]&&a.push({fullMatch:l[0],marker:l[5],content:l[6],index:l.index,className:"italic"});if(a.length===0)continue;t=!0;const c=r.parentNode;if(!c)continue;const d=document.createDocumentFragment();let f=0;for(const{fullMatch:g,marker:h,content:b,index:x,className:v}of a){x>f&&d.appendChild(document.createTextNode(i.slice(f,x)));const w=document.createElement("span");w.dataset.md="true";const k=document.createElement("span");k.className="prompt-area-md-marker",k.textContent=h;const C=document.createElement("span");C.className=v,C.textContent=b;const N=document.createElement("span");N.className="prompt-area-md-marker",N.textContent=h,w.appendChild(k),w.appendChild(C),w.appendChild(N),d.appendChild(w),f=x+g.length}f<i.length&&d.appendChild(document.createTextNode(i.slice(f))),c.replaceChild(d,r)}return t}const iC=/(^|\n)([ \t]*)•/g;function mU(e){let t=!1;const n=[];for(let r=0;r<e.childNodes.length;r++){const i=e.childNodes[r];ed(i)&&i.textContent?.includes("•")&&n.push(i)}for(const r of n){const i=r.textContent??"";iC.lastIndex=0;const a=[];let l;for(;(l=iC.exec(i))!==null;)a.push(l.index+l[1].length+l[2].length);if(a.length===0)continue;t=!0;const c=r.parentNode;if(!c)continue;const d=document.createDocumentFragment();let f=0;for(const g of a){g>f&&d.appendChild(document.createTextNode(i.slice(f,g)));const h=document.createElement("span");h.dataset.md="true",h.className="prompt-area-list-bullet",h.textContent="•",d.appendChild(h),f=g+1}f<i.length&&d.appendChild(document.createTextNode(i.slice(f))),c.replaceChild(d,r)}return t}const aC=/(^|\n)([ \t]+)(?=(?:[•\-*] |\d+\. ))/g;function gU(e){let t=!1;const n=[];for(let r=0;r<e.childNodes.length;r++){const i=e.childNodes[r];ed(i)&&n.push(i)}for(const r of n){const i=r.textContent??"";aC.lastIndex=0;const a=[];let l;for(;(l=aC.exec(i))!==null;){const g=l.index+l[1].length;a.push({start:g,end:g+l[2].length})}if(a.length===0)continue;t=!0;const c=r.parentNode;if(!c)continue;const d=document.createDocumentFragment();let f=0;for(const{start:g,end:h}of a){g>f&&d.appendChild(document.createTextNode(i.slice(f,g)));const b=i.slice(g,h),x=Math.floor(b.length/2),v=document.createElement("span");v.dataset.md="true",v.className="prompt-area-list-indent",v.style.width=`calc(var(--prompt-area-indent-size, 1.5em) * ${x})`,v.textContent=b,d.appendChild(v),f=h}f<i.length&&d.appendChild(document.createTextNode(i.slice(f))),c.replaceChild(d,r)}return t}function oC(e,t){t&&(gU(e),mU(e)),hU(e),t&&pU(e)}function Rs(){const e=window.getSelection();return!e||e.rangeCount===0?null:e.getRangeAt(0)}function bU(e){const t=Rs();if(!t||!e.contains(t.startContainer))return null;const n=t.startContainer;if(n===e)return{nodeIndex:t.startOffset,offset:0};const r=$b(e,n);return r?{nodeIndex:bh(e,r),offset:t.startOffset}:null}function xU(e,t){const n=window.getSelection();if(!n)return;const r=e.childNodes;if(r.length===0)return;const i=document.createRange();if(t.nodeIndex>=r.length){const a=r[r.length-1];a.nodeType===Node.TEXT_NODE?i.setStart(a,(a.textContent??"").length):i.setStartAfter(a)}else{const a=r[t.nodeIndex];if(a.nodeType===Node.TEXT_NODE){const l=(a.textContent??"").length;i.setStart(a,Math.min(t.offset,l))}else i.setStartAfter(a)}i.collapse(!0),n.removeAllRanges(),n.addRange(i)}function Vi(e){const t=Rs();if(!t||!e.contains(t.startContainer))return null;const n=document.createRange();return n.selectNodeContents(e),n.setEnd(t.startContainer,t.startOffset),$h(n)}function yU(e,t){const n=Vc(e,t);if(!n)return null;const r=document.createRange();return r.setStart(n.node,n.offset),r.collapse(!0),r}function sr(e,t){const n=window.getSelection();if(!n)return;const r=Vc(e,t);if(r){const a=document.createRange();a.setStart(r.node,r.offset),a.collapse(!0),n.removeAllRanges(),n.addRange(a);return}const i=document.createRange();i.selectNodeContents(e),i.collapse(!1),n.removeAllRanges(),n.addRange(i)}function $h(e){const t=e.cloneContents();let n=0;const r=i=>{if(i.nodeType===Node.TEXT_NODE)n+=(i.textContent??"").length;else if(er(i))n+=GA(i);else if(gi(i)&&i.tagName==="BR"){if(i.dataset.sentinel)return;n+=1}else gi(i)&&i.childNodes.forEach(r)};return t.childNodes.forEach(r),n}function Xf(e){const t=Rs();if(!t||!e.contains(t.startContainer))return null;const n=document.createRange();n.selectNodeContents(e),n.setEnd(t.startContainer,t.startOffset);const r=$h(n);if(t.collapsed)return{start:r,end:r};const i=document.createRange();i.selectNodeContents(e),i.setEnd(t.endContainer,t.endOffset);const a=$h(i);return{start:r,end:a}}function lC(e,t,n){const r=window.getSelection();if(!r)return;if(t===n){sr(e,t);return}const i=Vc(e,t),a=Vc(e,n);if(!i||!a)return;const l=document.createRange();l.setStart(i.node,i.offset),l.setEnd(a.node,a.offset),r.removeAllRanges(),r.addRange(l)}function Vc(e,t){let n=t;for(let r=0;r<e.childNodes.length;r++){const i=e.childNodes[r];if(i.nodeType===Node.TEXT_NODE){const a=(i.textContent??"").length;if(n<=a)return{node:i,offset:n};n-=a}else if(er(i)){const a=GA(i);if(n<=a)return{node:e,offset:r+1};n-=a}else if(zh(i)){if(i.dataset.sentinel)continue;if(n<=1)return{node:e,offset:r+1};n-=1}else if(gi(i)){const a=(i.textContent??"").length;if(n<=a){const l=Vc(i,n);if(l)return l}n-=a}}return{node:e,offset:e.childNodes.length}}function EU(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function XA(e,t){const n=r=>{r.nodeType===Node.TEXT_NODE?t.onText(r.textContent??""):er(r)?t.onChip(r):gi(r)&&r.tagName==="BR"?t.onBreak():r.childNodes.forEach(n)};e.childNodes.forEach(n)}function vU(e){let t="";return XA(e,{onText:n=>{t+=n},onChip:n=>{t+=(qA(n)??"")+(YA(n)??"")},onBreak:()=>{t+=`
483
+ `}}),t}function TU(e){const t=[];return XA(e,{onText:n=>{n&&t.push({type:"text",text:n})},onChip:n=>{const r=Fh(n);r&&t.push(r)},onBreak:()=>{t.push({type:"text",text:`
484
+ `})}}),t}function SU(e){try{const t=JSON.parse(e);if(!Array.isArray(t))return null;const n=[];for(const r of t){if(!EU(r))return null;if(r.type==="text"&&typeof r.text=="string")n.push({type:"text",text:r.text});else if(r.type==="chip"&&typeof r.trigger=="string"&&typeof r.value=="string"&&typeof r.displayText=="string"){const i={type:"chip",trigger:r.trigger,value:r.value,displayText:r.displayText,...r.data!==void 0?{data:r.data}:{},...r.autoResolved?{autoResolved:!0}:{}};n.push(i)}else return null}return n}catch{return null}}function CU(e,t,n){const r=Rs();if(!r)return[...e,...t];const i=document.createRange();i.selectNodeContents(n),i.setEnd(r.startContainer,r.startOffset);const a=$h(i),l=[];let c=0,d=!1;const f=()=>{d||(l.push(...t),d=!0)};for(const g of e){if(g.type==="chip"){const b=g.trigger.length+g.displayText.length;c>=a&&f(),l.push(g),c+=b;continue}const h=c+g.text.length;if(h<=a)l.push(g);else if(c>=a)f(),l.push(g);else{const b=a-c,x=g.text.slice(0,b),v=g.text.slice(b);x&&l.push({type:"text",text:x}),f(),v&&l.push({type:"text",text:v})}c=h}return f(),Co(l)}function H0(e,t){const n=new RegExp(`(?:^|;)\\s*${t}\\s*:\\s*([^;]+)`,"i").exec(e);return n?n[1].trim().toLowerCase():""}function kU(e){if(e==="bold"||e==="bolder")return!0;const t=Number.parseInt(e,10);return!Number.isNaN(t)&&t>=600}function wU(e){const t=e.tagName,n=e.getAttribute("style")??"",r=H0(n,"font-weight"),i=r?kU(r):t==="B"||t==="STRONG",a=H0(n,"font-style"),l=a?a==="italic"||a==="oblique":t==="I"||t==="EM",c=H0(n,"text-decoration"),d=t==="S"||t==="DEL"||t==="STRIKE"||c.includes("line-through"),f=(d?"~~":"")+(i?"**":"")+(l?"*":""),g=(l?"*":"")+(i?"**":"")+(d?"~~":"");return{prefix:f,suffix:g}}function NU(e){return e.replace(/\s+/g," ")}function AU(e){return e.replace(/\*/g,"\\*")}function _U(e){const t=e.querySelector("code"),n=`${e.className} ${t?.className??""}`,r=/(?:language|lang)-([\w-]+)/.exec(n);return r?r[1]:e.getAttribute("lang")??t?.getAttribute("lang")??""}function RU(e){const t=_U(e),n=(e.textContent??"").replace(/\n$/,"");return`
485
+
486
+ \`\`\`${t}
487
+ ${n}
488
+ \`\`\`
489
+
490
+ `}function OU(e){const t=e.textContent??"";return t.includes("`")?`\`\` ${t} \`\``:`\`${t}\``}function KA(e){return/^(https?:|mailto:)/i.test(e)}function IU(e,t){const n=e.getAttribute("href")??"",r=ai(e,t).trim();return KA(n)?!r||r===n?n:`[${r}](${n})`:r}function MU(e){const t=e.getAttribute("src")??"";return!t||!KA(t)?"":`![${e.getAttribute("alt")??""}](${t})`}function LU(e,t){return`
491
+
492
+ ${ai(e,t).trim().split(`
493
+ `).map(i=>i?`> ${i}`:">").join(`
494
+ `)}
495
+
496
+ `}function QA(e,t){const n=e.tagName==="OL",r=Number.parseInt(e.getAttribute("start")??"",10);let i=Number.isNaN(r)?1:r;const a=" ".repeat(t),l=[];for(const c of Array.from(e.childNodes)){if(!gi(c)||c.tagName!=="LI")continue;const d=n?`${i}. `:"- ";i++;let f="",g="";for(const h of Array.from(c.childNodes))gi(h)&&(h.tagName==="UL"||h.tagName==="OL")?g+=`
497
+ ${QA(h,t+1)}`:f+=WA(h,t);l.push(`${a}${d}${f.trim()}${g}`)}return l.join(`
498
+ `)}function DU(e,t){const n=Array.from(e.querySelectorAll("tr"));if(n.length===0)return"";const r=n.map(c=>Array.from(c.children).filter(d=>d.tagName==="TD"||d.tagName==="TH").map(d=>ai(d,t).replace(/\n+/g," ").replace(/\|/g,"\\|").trim())),i=r[0],a=i.map(()=>"---"),l=c=>`| ${c.join(" | ")} |`;return[l(i),l(a),...r.slice(1).map(l)].join(`
499
+ `)}function ai(e,t){let n="";return e.childNodes.forEach(r=>{n+=WA(r,t)}),n}function WA(e,t){if(ed(e))return AU(NU(e.textContent??""));if(!gi(e))return"";const n=e.tagName;switch(n){case"SCRIPT":case"STYLE":case"NOSCRIPT":case"HEAD":case"TITLE":return"";case"BR":return`
500
+ `;case"HR":return`
501
+
502
+ ---
503
+
504
+ `;case"H1":case"H2":case"H3":case"H4":case"H5":case"H6":return`
505
+
506
+ ${"#".repeat(Number(n[1]))} ${ai(e,t).trim()}
507
+
508
+ `;case"P":return`
509
+
510
+ ${ai(e,t).trim()}
511
+
512
+ `;case"DIV":return`
513
+ ${ai(e,t).trim()}
514
+ `;case"BLOCKQUOTE":return LU(e,t);case"UL":case"OL":return`
515
+
516
+ ${QA(e,t)}
517
+
518
+ `;case"LI":return`${ai(e,t).trim()}
519
+ `;case"PRE":return RU(e);case"CODE":return OU(e);case"A":return IU(e,t);case"IMG":return MU(e);case"TABLE":return`
520
+
521
+ ${DU(e,t)}
522
+
523
+ `;default:{const{prefix:r,suffix:i}=wU(e);return r+ai(e,t)+i}}}function PU(e){return e.replace(/[ \t]+\n/g,`
524
+ `).replace(/\n[ \t]*\n[ \t\n]*/g,`
525
+
526
+ `).trim()}function jU(e){if(!e)return"";const t=new DOMParser().parseFromString(e,"text/html");return t.body?PU(ai(t.body,0)):""}const BU=100,ZA=150;function HU(e){const{editorRef:t,readSegmentsFromDOM:n,onChange:r,renderSegmentsToDOM:i,runTriggerDetection:a,dismissTrigger:l,triggers:c,markdownEnabled:d,normalizeBullets:f,onPaste:g,onUndo:h,onRedo:b,onChipAdd:x,onImagePaste:v,onRawPaste:w}=e,k=E.useRef(!1),C=E.useRef({undoStack:[],redoStack:[]}),N=E.useCallback(F=>{const W=C.current;W.undoStack.push(F),W.undoStack.length>BU&&W.undoStack.shift(),W.redoStack=[]},[]),A=E.useCallback(()=>{C.current={undoStack:[],redoStack:[]}},[]),R=E.useCallback(F=>{if(w?.(F),F.defaultPrevented)return;F.preventDefault();const W=t.current;if(!W)return;const V=Array.from(F.clipboardData.files).find(ie=>ie.type.startsWith("image/"))??(Array.from(F.clipboardData.items).find(ce=>ce.type.startsWith("image/"))?.getAsFile()??null);if(V){v?.(V);return}const H=n();N(H);const q=F.clipboardData.getData("text/prompt-area-segments");if(q){const ie=SU(q);if(ie&&ie.length>0){const ce=Rs();if(!ce)return;ce.deleteContents();const de=n(),he=CU(de,ie,W);r(he),i(he),g?.({segments:he,source:"internal"});for(const ve of ie)ve.type==="chip"&&x?.(ve);a();return}}let J="";if(d)if(J=F.clipboardData.getData("text/markdown"),J)J=J.replace(/\\([()])/g,"$1");else{const ie=F.clipboardData.getData("text/html");if(ie)try{J=jU(ie)}catch{J=""}}if(J||(J=F.clipboardData.getData("text/plain")),!J)return;d&&f&&(J=aU(J,!0)),d&&$A(J)&&(J=VA(J).text);const ue=Rs();if(!ue)return;ue.deleteContents();const L=J.split(`
527
+ `),B=document.createDocumentFragment();for(let ie=0;ie<L.length;ie++)L[ie]&&B.appendChild(document.createTextNode(L[ie])),ie<L.length-1&&B.appendChild(document.createElement("br"));ue.insertNode(B),ue.collapse(!1);const G=window.getSelection();G?.removeAllRanges(),G?.addRange(ue),Vb(W);const P=n(),ae=KH(P,c);if(ae!==P){r(ae),i(ae);for(const ie of ae)ie.type==="chip"&&!P.some(ce=>ce.type==="chip"&&ce.trigger===ie.trigger&&ce.value===ie.value&&ce.displayText===ie.displayText)&&x?.(ie)}else r(P);g?.({segments:ae,source:"external"}),a()},[t,n,r,N,a,i,c,d,f,g,x,v,w]),M=E.useCallback(F=>{F.preventDefault();const W=Rs();if(!W)return;const V=W.cloneContents(),H=vU(V);F.clipboardData.setData("text/plain",H);const q=TU(V);if(q.some(ue=>ue.type==="chip")){const ue=gh(q);ue&&F.clipboardData.setData("text/prompt-area-segments",ue)}},[]),_=E.useCallback(F=>{M(F);const W=Rs();if(!W)return;const V=n();N(V),W.deleteContents();const H=t.current;H&&Vb(H);const q=n();r(q),a()},[M,t,n,r,N,a]),D=E.useCallback(F=>{F.preventDefault()},[]),I=E.useCallback(F=>{F.preventDefault()},[]),U=E.useCallback(()=>{k.current=!0},[]),j=E.useCallback(()=>{k.current=!1,a()},[a]),X=E.useCallback(()=>{setTimeout(()=>{const F=t.current;if(!F)return;const W=document.activeElement;W&&F.parentElement?.contains(W)||l()},ZA)},[t,l]),K=E.useCallback(F=>{if(!(F.metaKey||F.ctrlKey)||F.key!=="z")return!1;F.preventDefault();const V=C.current;if(F.shiftKey){if(V.redoStack.length===0)return!0;const H=V.redoStack.pop();if(!H)return!0;const q=n();V.undoStack.push(q),r(H),i(H),b?.(H)}else{if(V.undoStack.length===0)return!0;const H=V.undoStack.pop();if(!H)return!0;const q=n();V.redoStack.push(q),r(H),i(H),h?.(H)}return!0},[n,r,i,h,b]);return{handlePaste:R,handleCopy:M,handleCut:_,handleDrop:D,handleDragOver:I,handleCompositionStart:U,handleCompositionEnd:j,handleBlur:X,handleKeyDownForUndoRedo:K,pushUndo:N,resetUndoHistory:A,isComposing:k}}function UU(){const[e,t]=E.useState([]),[n,r]=E.useState(!1),[i,a]=E.useState(null),l=E.useRef(0),c=E.useRef(null),d=E.useRef(null),f=E.useCallback(()=>{c.current?.abort(),d.current&&clearTimeout(d.current),t([]),r(!1),a(null)},[]),g=E.useCallback((h,b)=>{if(!b.onSearch)return;c.current?.abort(),d.current&&clearTimeout(d.current),r(!0),a(null),l.current++;const x=l.current,v=new AbortController;c.current=v;const{onSearch:w,onSearchError:k,searchDebounceMs:C}=b,N=()=>{const A=w(h,{signal:v.signal});A instanceof Promise?A.then(R=>{v.signal.aborted||l.current!==x||(t(R),r(!1))},R=>{v.signal.aborted||l.current!==x||R instanceof DOMException&&R.name==="AbortError"||(a(R instanceof Error?R.message:"Search failed"),r(!1),k?.(R))}):(t(A),r(!1))};C&&C>0&&h.length>0?d.current=setTimeout(N,C):N()},[]);return E.useEffect(()=>()=>{c.current?.abort(),d.current&&clearTimeout(d.current)},[]),{suggestions:e,suggestionsLoading:n,suggestionsError:i,search:g,reset:f}}const zU=300;function FU({value:e,onChange:t,triggers:n=[],disabled:r=!1,onSubmit:i,onEscape:a,onChipClick:l,onChipAdd:c,onChipDelete:d,onLinkClick:f,onPaste:g,onRawPaste:h,onUndo:b,onRedo:x,onImagePaste:v,markdown:w=!0,normalizeBullets:k=!0,submitOnEnter:C=!0,maxLength:N}){const A=E.useRef(null),[R,M]=E.useState(null),[_,D]=E.useState(0),[I,U]=E.useState(null),j=E.useRef(null),X=E.useRef(null),K=E.useRef(null),{suggestions:F,suggestionsLoading:W,suggestionsError:V,search:H,reset:q}=UU(),J=E.useRef(!1),ue=E.useRef([]),L=E.useRef(null),B=E.useRef(null),G=E.useCallback(()=>{const ee=A.current;if(!ee)return[];const pe=[];let se=!1,re=!1;for(let Q=0;Q<ee.childNodes.length;Q++){const $=ee.childNodes[Q];if($.nodeType===Node.TEXT_NODE){const oe=$.textContent??"";oe&&(pe.push({type:"text",text:oe}),se=!0)}else if(er($)){const oe=Fh($);oe&&(pe.push(oe),se=!0)}else if(zh($)){if($.dataset.sentinel){re=!0;continue}pe.push({type:"text",text:`
528
+ `})}else if(gi($)){const oe=$.textContent??"";oe&&(pe.push({type:"text",text:oe}),se=!0)}}return!se&&!re?[]:pe},[]),P=E.useCallback(ee=>{const pe=A.current;if(!pe)return;J.current=!0;const se=bU(pe);for(;pe.firstChild;)pe.removeChild(pe.firstChild);for(const re of ee)if(re.type==="text"){const Q=re.text.split(`
529
+ `);for(let $=0;$<Q.length;$++)Q[$]&&pe.appendChild(document.createTextNode(Q[$])),$<Q.length-1&&pe.appendChild(document.createElement("br"))}else{const Q=document.createElement("span");if(Q.contentEditable="false",Q.dataset.chipTrigger=re.trigger,Q.dataset.chipValue=re.value,Q.dataset.chipDisplay=re.displayText,re.data!==void 0){const Se=gh(re.data);Se&&(Q.dataset.chipData=Se)}re.autoResolved&&(Q.dataset.chipAutoResolved="true");const $=n.find(Se=>Se.char===re.trigger),oe=$?.chipStyle??"pill";Q.dataset.chipStyle=oe,Q.className=Ie("prompt-area-chip",oe==="inline"&&"prompt-area-chip--inline",$?.chipClassName),Q.textContent=`${re.trigger}${re.displayText}`,Q.setAttribute("role","button"),Q.setAttribute("tabindex","-1"),pe.appendChild(Q)}if(pe.lastChild&&zh(pe.lastChild)){const re=document.createElement("br");re.dataset.sentinel="true",pe.appendChild(re)}oC(pe,w),se&&xU(pe,se),ue.current=ee,J.current=!1},[n,w]),ae=E.useCallback((ee,pe)=>se=>{const re=j0(ee,pe,{value:se.value,displayText:se.displayText,data:se.data});t(re.segments),P(re.segments),c?.({type:"chip",trigger:pe.config.char,value:se.value,displayText:se.displayText,...se.data!==void 0?{data:se.data}:{}});const Q=A.current;Q&&sr(Q,re.cursorOffset)},[t,P,c]),ie=E.useCallback(()=>{const ee=A.current;if(!ee)return;const pe=G(),se=Bn(pe),re=Vi(ee);if(re===null)return;const Q=qH(se,re,n);if(j.current=null,X.current=null,Q){M(Q),D(0);const $=yU(ee,Q.startOffset);if($){const oe=$.getBoundingClientRect();(oe.height>0||oe.left>0||oe.top>0)&&U(oe)}Q.config.mode==="dropdown"&&Q.config.onSearch&&H(Q.query,Q.config),Q.config.mode==="callback"&&Q.config.onActivate&&Q.config.onActivate({text:se,cursorPosition:re,insertChip:ae(pe,Q)})}else M(null),q()},[n,G,ae,q,H]),ce=E.useCallback(()=>{j.current=null,X.current=null,M(null),D(0),q()},[q]),de=HU({editorRef:A,readSegmentsFromDOM:G,onChange:t,renderSegmentsToDOM:P,runTriggerDetection:ie,dismissTrigger:ce,triggers:n,markdownEnabled:w,normalizeBullets:k,onPaste:g,onRawPaste:h,onUndo:b,onRedo:x,onChipAdd:c,onImagePaste:v});E.useEffect(()=>{if(!J.current&&!ZH(e,ue.current)){if(w&&k){const ee=eC(e,!0);if(ee!==e){t(ee);return}}P(e)}},[e,P,w,k,t]);const he=E.useRef(w);E.useEffect(()=>{if(he.current===w)return;he.current=w;const ee=k?eC(e,w):e;ee!==e?t(ee):P(e)},[w,k,P,e,t]),E.useEffect(()=>()=>{L.current&&clearTimeout(L.current)},[]);const ve=E.useCallback(()=>{if(J.current)return;if(de.isComposing.current){const $=G();ue.current=$,t($);return}const ee=A.current,pe=ee?Vi(ee):null;ee&&Vb(ee);const se=G();if(N!=null&&ee&&Bn(se).length>N){const $=Vi(ee),oe=VH(se,N);ue.current=oe,t(oe),P(oe),sr(ee,$!=null?Math.min($,N):N),ie();return}if(w&&k&&ee&&pe!==null){const $=JH(se,pe);if($){ue.current=$.segments,t($.segments),P($.segments),sr(ee,$.cursorOffset),ie();return}}let re=se,Q=null;if(w&&pe!==null&&$A(Bn(se))){const $=nC(se);$.edits.length>0&&(re=$.segments,Q=tC(pe,$.edits))}B.current||(B.current=ue.current),ue.current=re,t(re),L.current&&clearTimeout(L.current),L.current=setTimeout(()=>{B.current&&(de.pushUndo(B.current),B.current=null),L.current=null},zU),ee&&(Q!==null?(P(re),sr(ee,Q)):(oC(ee,w),pe!==null&&sr(ee,pe))),ie()},[t,G,ie,P,w,k,N,de]),Fe=E.useCallback(ee=>{const pe=ee.target;if(!(pe instanceof Node))return;const se=A.current;if(!se)return;let re=pe;for(;re&&re!==se;){if(oU(re)){if(ee.metaKey||ee.ctrlKey){ee.preventDefault(),f?.(re.href),window.open(re.href,"_blank","noopener,noreferrer");return}break}if(er(re)){const Q=re.getBoundingClientRect(),$=document.createElement("span");$.className="prompt-area-chip-ripple";const oe=Math.max(Q.width,Q.height);$.style.width=`${oe}px`,$.style.height=`${oe}px`,$.style.left=`${ee.clientX-Q.left-oe/2}px`,$.style.top=`${ee.clientY-Q.top-oe/2}px`,re.appendChild($),$.addEventListener("animationend",()=>$.remove());const Se=Fh(re);if(Se){const _e=n.find(ot=>ot.char===Se.trigger),$e=K.current===re;if(K.current=null,!r&&!$e&&_e?.reopenOnChipClick&&_e.mode==="dropdown"&&_e.onSearch){const ot=bh(se,re);j.current={chip:Se,segIndex:B0(se,ot)},X.current=re,M({config:_e,startOffset:0,query:""}),D(0),U(Q),H("",_e)}l?.(Se)}return}re=re.parentNode}},[l,f,n,H,r]),Le=E.useCallback(ee=>{const pe=ee.target,se=A.current;if(!se||!(pe instanceof Node)){K.current=null;return}let re=pe;for(;re&&re!==se;){if(er(re)){K.current=X.current===re?re:null;return}re=re.parentNode}K.current=null},[]),Ee=E.useCallback((ee,pe)=>{const se=G(),re=bh(ee,pe);if(re===-1)return!1;const Q=B0(ee,re),$=se[Q],oe=GH(se,Q);return t(oe),P(oe),$?.type==="chip"&&d?.($),!0},[G,t,P,d]),Oe=E.useCallback((ee,pe)=>{const se=G(),re=bh(ee,pe);if(re===-1)return!1;const Q=B0(ee,re),$=se[Q],oe=XH(se,Q);if(!oe)return!1;let Se=0;for(let _e=0;_e<Q;_e++){const $e=se[_e];$e.type==="text"?Se+=$e.text.length:Se+=$e.trigger.length+$e.displayText.length}return Se+=oe.revertedText.length,t(oe.segments),P(oe.segments),sr(ee,Se),$?.type==="chip"&&d?.($),!0},[G,t,P,d]),Ue=E.useCallback(()=>{const ee=A.current;if(!ee)return!1;const pe=Rs();if(!pe||!pe.collapsed)return!1;const se=pe.startContainer,re=pe.startOffset;if(se===ee&&re>0){const Q=ee.childNodes[re-1];if(Q&&er(Q))return Fb(Q)?Oe(ee,Q):Ee(ee,Q)}if(se.nodeType===Node.TEXT_NODE&&re===0){const Q=$b(ee,se);if(!Q)return!1;let $=Q.previousSibling;for(;$&&$.nodeType===Node.TEXT_NODE&&$.textContent==="";)$=$.previousSibling;if($&&er($))return Fb($)?Oe(ee,$):Ee(ee,$)}return!1},[Ee,Oe]),Xe=E.useCallback(()=>{const ee=A.current;if(!ee)return!1;const pe=Rs();if(!pe||!pe.collapsed)return!1;const se=pe.startContainer,re=pe.startOffset;if(se===ee&&re<ee.childNodes.length){const Q=ee.childNodes[re];if(Q&&er(Q))return Ee(ee,Q)}if(se.nodeType===Node.TEXT_NODE&&re===(se.textContent??"").length){const Q=$b(ee,se);if(!Q)return!1;let $=Q.nextSibling;for(;$&&$.nodeType===Node.TEXT_NODE&&$.textContent==="";)$=$.nextSibling;if($&&er($))return Ee(ee,$)}return!1},[Ee]),qe=E.useCallback(ee=>{const pe=G(),se=ee.query,re={value:se,label:se},Q=ee.config.onSelect?.(re)??se,$={value:se,displayText:Q||se,autoResolved:!0},oe=j0(pe,ee,$);t(oe.segments),P(oe.segments),c?.({type:"chip",trigger:ee.config.char,...$});const Se=A.current;Se&&sr(Se,oe.cursorOffset),ce()},[G,t,P,ce,c]),De=E.useCallback(ee=>{if(!R)return;const pe=G(),se=R.config.insertAsText?.(ee);if(se!==void 0){const _e=YH(pe,R,se);de.pushUndo(pe),t(_e.segments),P(_e.segments);const $e=A.current;$e&&sr($e,_e.cursorOffset),ce(),setTimeout(()=>{A.current?.focus()},0);return}const re=R.config.onSelect?.(ee)??ee.label,Q={value:ee.value,displayText:re||ee.label,data:ee.data},$=j.current;if($){const _e=A.current;if(_e&&!r){const $e=pe[$.segIndex],et=$e?.type==="chip"&&$e.trigger===$.chip.trigger&&$e.value===$.chip.value?$.segIndex:(()=>{const ut=[];return pe.forEach((Ve,Rt)=>{Ve.type==="chip"&&Ve.trigger===$.chip.trigger&&Ve.value===$.chip.value&&ut.push(Rt)}),ut.length===1?ut[0]:-1})(),dt=et!==-1?pe[et]:void 0;if(dt?.type==="chip"){const ut={type:"chip",trigger:R.config.char,...Q};let Ve=pe.map((Wt,$t)=>$t===et?ut:Wt);const Rt=Ve[et+1],Pt=!Rt||Rt.type!=="text"||Rt.text.length===0;Pt&&(Ve=[...Ve.slice(0,et+1),{type:"text",text:" "},...Ve.slice(et+1)]),de.pushUndo(pe),t(Ve),P(Ve),dt.value===ut.value&&dt.displayText===ut.displayText&&gh(dt.data)===gh(ut.data)||(d?.(dt),c?.(ut));const Lt=Bn(Ve.slice(0,et+1)).length+(Pt?1:0);sr(_e,Lt)}}ce(),setTimeout(()=>{A.current?.focus()},0);return}const oe=j0(pe,R,Q);t(oe.segments),P(oe.segments),c?.({type:"chip",trigger:R.config.char,...Q});const Se=A.current;Se&&sr(Se,oe.cursorOffset),ce(),setTimeout(()=>{A.current?.focus()},0)},[R,G,t,P,ce,c,d,de,r]),ke=De;E.useEffect(()=>{const ee=j.current;if(!ee||!R?.config.reopenOnChipClick)return;const pe=F.findIndex(se=>se.value===ee.chip.value);pe>0&&D(pe)},[F,R]);const ye=E.useCallback(ee=>{const pe=($,oe)=>{let{segments:Se,cursorOffset:_e}=oe;if(w){const $e=nC(Se);Se=$e.segments,_e=tC(_e,$e.edits)}ue.current=Se,t(Se),P(Se),sr($,_e)},se=$=>{if(!w)return!1;const oe=G(),Se=Vi($);if(Se===null)return!1;const _e=Bn(oe);if(!Dl(_e,Se))return!1;const $e=eU(oe,Se);return $e&&pe($,$e),!0};if((ee.metaKey||ee.ctrlKey)&&ee.key==="z"&&B.current&&(L.current&&(clearTimeout(L.current),L.current=null),de.pushUndo(B.current),B.current=null),de.handleKeyDownForUndoRedo(ee))return;if(w&&(ee.metaKey||ee.ctrlKey)&&!ee.shiftKey&&(ee.key==="b"||ee.key==="i")){ee.preventDefault();const $=A.current;if(!$)return;const oe=Xf($);if(!oe||oe.start===oe.end)return;const Se=ee.key==="b"?"**":"*",_e=G();de.pushUndo(_e);const $e=WH(_e,oe.start,oe.end,Se);if(!$e)return;ue.current=$e.segments,t($e.segments),P($e.segments),lC($,$e.selectionStart,$e.selectionEnd);return}if(!ee.metaKey&&!ee.ctrlKey&&!ee.altKey&&!ee.nativeEvent.isComposing&&ee.key.length===1){const $=n.find(Se=>Se.mode==="launch"&&Se.char===ee.key),oe=A.current;if($?.onActivate&&oe){const Se=Vi(oe);if(Se!==null){const _e=G(),$e=Bn(_e);if(Uh($e,Se,$.position)){ee.preventDefault(),$.onActivate({text:$e,cursorPosition:Se,insertChip:ae(hr(_e,Se,Se,$.char),{config:$,startOffset:Se,query:""})});return}}}}if(R&&R.config.mode==="dropdown"&&(F.length>0||W||V!==null||!!R.config.emptyMessage)){if(ee.key==="ArrowDown"){ee.preventDefault(),F.length>0&&D($=>Math.min($+1,F.length-1));return}if(ee.key==="ArrowUp"){ee.preventDefault(),F.length>0&&D($=>Math.max($-1,0));return}if(ee.key==="Enter"||ee.key==="Tab"){ee.preventDefault();const $=F[_];$&&De($);return}if(ee.key==="Escape"){ee.preventDefault(),ce();return}}if(ee.key===" "&&R&&R.config.resolveOnSpace&&R.query.trim().length>0){ee.preventDefault(),qe(R);return}if(w&&ee.key==="Tab"&&!R){const $=A.current;if($){const oe=G(),Se=Bn(oe),_e=Vi($);if(_e!==null&&Dl(Se,_e)){ee.preventDefault();const ot=ee.shiftKey?rU(oe,_e):nU(oe,_e);ot&&pe($,ot);return}}}const Q=$=>{const oe=Xf($);if(!oe)return;const Se=G();de.pushUndo(Se);const _e=hr(Se,oe.start,oe.end,`
530
+ `);pe($,{segments:_e,cursorOffset:oe.start+1})};if(ee.key==="Enter"&&ee.shiftKey&&!ee.nativeEvent.isComposing){ee.preventDefault();const $=A.current;$&&!se($)&&Q($);return}if(ee.key==="Enter"&&!ee.shiftKey&&!ee.nativeEvent.isComposing){const $=A.current;if($&&se($)){ee.preventDefault();return}if(C){ee.preventDefault(),i?.(G());return}ee.preventDefault(),$&&Q($);return}if(ee.key==="Escape"&&a){a();return}if((ee.key==="Backspace"||ee.key==="Delete")&&!ee.nativeEvent.isComposing){const $=A.current;if($){const oe=Xf($);if(oe&&oe.start!==oe.end){ee.preventDefault();const Se=G();de.pushUndo(Se);const _e=hr(Se,oe.start,oe.end,"");pe($,{segments:_e,cursorOffset:oe.start}),ie();return}}}if(ee.key==="Backspace"){const $=A.current;if($){const oe=G(),Se=Vi($);if(w&&Se!==null){const _e=sU(oe,Se);if(_e){ee.preventDefault(),pe($,_e),ie();return}}}if(Ue()){ee.preventDefault(),ie();return}}if(ee.key==="Delete"&&Xe()){ee.preventDefault(),ie();return}},[R,F,W,V,_,i,C,a,G,t,P,w,ce,Ue,Xe,qe,ie,De,de,n,ae]),Re=E.useMemo(()=>({focus:()=>A.current?.focus(),blur:()=>A.current?.blur(),insertChip:ee=>{const pe=G(),se={type:"chip",...ee},re=[...pe,se,{type:"text",text:" "}];t(re),P(re),c?.(se)},getPlainText:()=>Bn(G()),clear:()=>{t([]);const ee=A.current;if(ee)for(;ee.firstChild;)ee.removeChild(ee.firstChild);de.resetUndoHistory(),L.current&&(clearTimeout(L.current),L.current=null),B.current=null},setText:ee=>{de.pushUndo(G());const pe=$H(ee);t(pe),P(pe);const se=A.current;se&&sr(se,ee.length)},appendText:ee=>{const pe=G();de.pushUndo(pe);const se=pe[pe.length-1],re=se?.type==="text"?[...pe.slice(0,-1),{type:"text",text:se.text+ee}]:[...pe,{type:"text",text:ee}];t(re),P(re);const Q=A.current;Q&&sr(Q,Bn(re).length)},getCursorPosition:()=>{const ee=A.current;return ee?Vi(ee):null},setCursorPosition:ee=>{const pe=A.current;pe&&sr(pe,ee)},setCursorToEnd:()=>{const ee=A.current;ee&&sr(ee,Bn(G()).length)},getSelection:()=>{const ee=A.current;return ee?Xf(ee):null},setSelection:(ee,pe)=>{const se=A.current;se&&lC(se,ee,pe)}}),[G,t,P,c,de]),Pe=E.useMemo(()=>({onPaste:de.handlePaste,onCopy:de.handleCopy,onCut:de.handleCut,onDrop:de.handleDrop,onDragOver:de.handleDragOver,onCompositionStart:de.handleCompositionStart,onCompositionEnd:de.handleCompositionEnd,onBlur:de.handleBlur}),[de.handlePaste,de.handleCopy,de.handleCut,de.handleDrop,de.handleDragOver,de.handleCompositionStart,de.handleCompositionEnd,de.handleBlur]);return{editorRef:A,activeTrigger:R,suggestions:F,suggestionsLoading:W,suggestionsError:V,selectedSuggestionIndex:_,handleInput:ve,handleKeyDown:ye,handleClick:Fe,handleMouseDown:Le,selectSuggestion:ke,dismissTrigger:ce,handle:Re,triggerRect:I,eventHandlers:Pe}}const uC=240;function $U({suggestions:e,loading:t,error:n,emptyMessage:r,selectedIndex:i,onSelect:a,onDismiss:l,triggerRect:c,triggerChar:d}){const f=E.useRef(null),g=E.useRef(null);if(E.useEffect(()=>{g.current?.scrollIntoView({block:"nearest"})},[i]),E.useEffect(()=>{const k=C=>{const N=C.target;f.current&&N instanceof Node&&!f.current.contains(N)&&l()};return document.addEventListener("mousedown",k),()=>document.removeEventListener("mousedown",k)},[l]),!c||e.length===0&&!t&&!n&&!r)return null;const h=Math.min(320,window.innerWidth-16),b=Math.min(c.left,window.innerWidth-h-8),x=window.innerHeight-c.bottom,v=x<uC&&c.top>x,w={position:"fixed",left:`${Math.max(8,b)}px`,zIndex:50,maxWidth:`${h}px`,maxHeight:`${uC}px`,...v?{bottom:`${window.innerHeight-c.top+4}px`}:{top:`${c.bottom+4}px`}};return m.jsx("div",{ref:f,className:Ie("min-w-[200px] overflow-y-auto","bg-surface rounded-xl border p-2 shadow-md","animate-in fade-in-0 zoom-in-95"),style:w,role:"listbox","aria-label":`${d} suggestions`,children:t?m.jsx("div",{role:"option","aria-selected":!1,className:"text-muted-foreground px-3 py-2 text-sm",children:"Loading suggestions..."}):n?m.jsx("div",{role:"option","aria-selected":!1,className:"text-destructive px-3 py-2 text-sm",children:n}):e.length===0&&r?m.jsx("div",{role:"option","aria-selected":!1,className:"text-muted-foreground px-3 py-2 text-sm",children:r}):e.map((k,C)=>m.jsxs("button",{ref:C===i?g:void 0,type:"button",role:"option","aria-selected":C===i,className:Ie("text-foreground flex w-full items-start gap-2 rounded-lg px-3 py-2 text-left text-sm","hover:bg-surface-hover cursor-pointer transition-colors",C===i&&"bg-surface-hover"),onMouseDown:N=>{N.preventDefault(),a(k)},children:[k.icon&&m.jsx("span",{className:"mt-0.5 shrink-0",children:k.icon}),m.jsxs("div",{className:"min-w-0 flex-1",children:[m.jsx("div",{className:"truncate font-medium",children:k.label}),k.description&&m.jsx("div",{className:"text-muted-foreground truncate text-xs",children:k.description})]})]},k.value))})}function VU({texts:e,interval:t=3e3}){const[n,r]=E.useState(0);return E.useEffect(()=>{if(e.length<=1)return;const i=setInterval(()=>{r(a=>(a+1)%e.length)},t);return()=>clearInterval(i)},[e.length,t]),m.jsx("div",{className:"pointer-events-none absolute top-0 left-0 overflow-hidden select-none",style:{color:"var(--prompt-area-placeholder, var(--muted-foreground))"},"aria-hidden":"true",children:m.jsx("div",{className:"animate-in fade-in-0 slide-in-from-top-4 duration-300 ease-in-out",children:e[n]},n)})}function JA({onClick:e,label:t,className:n}){return m.jsx("button",{type:"button",onClick:r=>{r.stopPropagation(),e()},className:Ie("absolute top-0.5 right-0.5 grid h-3.5 w-3.5 cursor-pointer place-items-center","rounded-full bg-black/60 text-white hover:bg-black/80 dark:bg-white/60 dark:text-black dark:hover:bg-white/80","transition-colors",n),"aria-label":t,children:m.jsxs("svg",{width:"8",height:"8",viewBox:"0 0 10 10",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",children:[m.jsx("line",{x1:"2.75",y1:"2.75",x2:"7.25",y2:"7.25"}),m.jsx("line",{x1:"7.25",y1:"2.75",x2:"2.75",y2:"7.25"})]})})}function qU({images:e,onRemove:t,onClick:n,className:r}){return e.length===0?null:m.jsx("div",{className:Ie("flex flex-wrap gap-2",r),role:"list","aria-label":"Attached images",children:e.map(i=>m.jsxs("div",{role:"listitem",className:Ie("border-border relative h-16 w-16 flex-shrink-0 overflow-hidden rounded-md border",n&&"cursor-pointer"),onClick:()=>n?.(i),children:[m.jsx("img",{src:i.url,alt:i.alt??"Attached image",className:"h-full w-full object-cover"}),i.loading&&m.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-black/40",children:m.jsx("div",{className:"h-4 w-4 animate-spin rounded-full border-2 border-white border-t-transparent"})}),t&&m.jsx(JA,{onClick:()=>t(i),label:`Remove ${i.alt??"image"}`})]},i.id))})}function td({className:e,children:t}){return m.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",className:e,children:t})}const Ip=m.jsxs(m.Fragment,{children:[m.jsx("path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z"}),m.jsx("path",{d:"M14 2v5a1 1 0 0 0 1 1h5"})]}),YU=({className:e})=>m.jsx(td,{className:e,children:Ip}),GU=({className:e})=>m.jsxs(td,{className:e,children:[Ip,m.jsx("path",{d:"M10 9H8"}),m.jsx("path",{d:"M16 13H8"}),m.jsx("path",{d:"M16 17H8"})]}),XU=({className:e})=>m.jsxs(td,{className:e,children:[Ip,m.jsx("path",{d:"M8 13h2"}),m.jsx("path",{d:"M14 13h2"}),m.jsx("path",{d:"M8 17h2"}),m.jsx("path",{d:"M14 17h2"})]}),KU=({className:e})=>m.jsxs(td,{className:e,children:[Ip,m.jsx("path",{d:"M10 12.5 8 15l2 2.5"}),m.jsx("path",{d:"m14 12.5 2 2.5-2 2.5"})]}),QU=({className:e})=>m.jsxs(td,{className:e,children:[m.jsx("rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2"}),m.jsx("circle",{cx:"9",cy:"9",r:"2"}),m.jsx("path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21"})]}),Kf=3;function WU(e){return e?e==="application/pdf"?"pdf":e.includes("spreadsheet")||e==="text/csv"?"spreadsheet":e.startsWith("text/")||e.includes("javascript")||e.includes("json")||e.includes("xml")?"code":e.startsWith("image/")?"image":"default":"default"}const ZU={pdf:GU,spreadsheet:XU,code:KU,image:QU,default:YU};function JU(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:e<1024*1024*1024?`${(e/(1024*1024)).toFixed(1)} MB`:`${(e/(1024*1024*1024)).toFixed(1)} GB`}function ez(e){const t=e.lastIndexOf(".");return t===-1||t===e.length-1?null:e.slice(t+1).toUpperCase()}function cC({file:e,compact:t,onRemove:n,onClick:r}){const i=ez(e.name),a=e.size!=null?JU(e.size):null,l=[i,a].filter(Boolean).join(" · ");return m.jsxs("div",{role:"listitem",className:Ie("border-border relative flex flex-shrink-0 items-center gap-2 overflow-hidden rounded-lg border transition-colors","hover:bg-surface-hover",t?"h-10 w-36 px-2":"h-14 w-48 px-3",r&&"cursor-pointer"),onClick:()=>r?.(e),children:[(()=>{const c=ZU[WU(e.type)];return m.jsx(c,{className:Ie("text-muted-foreground flex-shrink-0",t?"h-4 w-4":"h-5 w-5")})})(),m.jsxs("div",{className:"min-w-0 flex-1",children:[m.jsx("div",{className:Ie("truncate font-medium",t?"text-xs":"text-sm"),title:e.name,children:e.name}),!t&&l&&m.jsx("div",{className:"text-muted-foreground truncate text-xs",children:l})]}),e.loading&&m.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-black/40",children:m.jsx("div",{className:"h-4 w-4 animate-spin rounded-full border-2 border-white border-t-transparent"})}),n&&m.jsx(JA,{onClick:()=>n(e),label:`Remove ${e.name}`})]})}function tz({files:e,onRemove:t,onClick:n,className:r}){const[i,a]=E.useState(!1),l=E.useRef(null),c=E.useRef(null);if(E.useEffect(()=>{if(!i)return;const b=x=>{const v=x.target;v instanceof Node&&l.current&&!l.current.contains(v)&&!c.current?.contains(v)&&a(!1)};return document.addEventListener("mousedown",b),()=>document.removeEventListener("mousedown",b)},[i]),e.length===0)return null;const d=e.length>Kf,f=d,g=e.length-Kf,h=e.slice(0,Kf);return m.jsxs("div",{className:Ie("relative",r),children:[m.jsxs("div",{className:"flex flex-wrap gap-2",role:"list","aria-label":"Attached files",children:[(d?h:e).map(b=>m.jsx(cC,{file:b,compact:f,onRemove:t,onClick:n},b.id)),d&&m.jsx("div",{role:"listitem",children:m.jsx("button",{ref:c,type:"button",onClick:()=>a(b=>!b),className:Ie("border-border text-muted-foreground hover:bg-surface-hover flex flex-shrink-0 cursor-pointer items-center justify-center rounded-lg border transition-colors",f?"h-10 px-3 text-xs":"h-14 px-4 text-sm"),children:i?"Show less":`+${g} more`})})]}),i&&m.jsx("div",{ref:l,className:Ie("bg-surface border-border absolute bottom-full left-0 z-10 mb-2 max-h-48 overflow-y-auto rounded-lg border p-2 shadow-lg"),children:m.jsx("div",{className:"flex flex-wrap gap-2",role:"list","aria-label":"More attached files",children:e.slice(Kf).map(b=>m.jsx(cC,{file:b,compact:f,onRemove:t,onClick:n},b.id))})})]})}function nz({value:e,onChange:t,triggers:n,placeholder:r,className:i,disabled:a=!1,markdown:l,normalizeBullets:c,onSubmit:d,onEscape:f,onChipClick:g,onChipAdd:h,onChipDelete:b,onLinkClick:x,onPaste:v,onUndo:w,onRedo:k,minHeight:C=80,maxHeight:N,autoFocus:A=!1,autoGrow:R=!1,"aria-label":M,"data-test-id":_,images:D=[],imagePosition:I="above",onImagePaste:U,onImageRemove:j,onImageClick:X,files:K=[],filePosition:F="above",onFileRemove:W,onFileClick:V,onKeyDown:H,onBlur:q,onRawPaste:J,submitOnEnter:ue,spellCheck:L,maxLength:B,"aria-describedby":G,ref:P}){const{editorRef:ae,activeTrigger:ie,suggestions:ce,suggestionsLoading:de,suggestionsError:he,selectedSuggestionIndex:ve,handleInput:Fe,handleKeyDown:Le,handleClick:Ee,handleMouseDown:Oe,selectSuggestion:Ue,dismissTrigger:Xe,handle:qe,triggerRect:De,eventHandlers:ke}=FU({value:e,onChange:t,triggers:n,disabled:a,onSubmit:d,onEscape:f,onChipClick:g,onChipAdd:h,onChipDelete:b,onLinkClick:x,onPaste:v,onRawPaste:J,onUndo:w,onRedo:k,onImagePaste:U,markdown:l,normalizeBullets:c,submitOnEnter:ue,maxLength:B});E.useImperativeHandle(P,()=>qe,[qe]),E.useEffect(()=>{A&&ae.current?.focus()},[A,ae]);const[ye,Re]=E.useState(!1),[Pe,ee]=E.useState(void 0),pe=E.useCallback(()=>{const Ve=ae.current;if(!Ve)return;Ve.style.height="auto";const Rt=Ve.scrollHeight;Ve.style.height=`${Rt}px`,ee(Rt)},[ae]),se=E.useCallback(()=>{R&&(Re(!0),pe())},[R,pe]),re=E.useCallback(()=>{ke.onBlur(),R&&setTimeout(()=>{const Ve=ae.current;if(!Ve)return;const Rt=document.activeElement;Rt&&Ve.parentElement?.contains(Rt)||(Re(!1),ee(void 0))},ZA)},[ke,R,ae]),Q=E.useCallback(()=>{Fe(),R&&ye&&pe()},[Fe,R,ye,pe]);E.useEffect(()=>{R&&ye&&requestAnimationFrame(()=>pe())},[e,R,ye,pe]);const[$,oe]=E.useState(!1),Se=E.useRef(null);E.useEffect(()=>{if(!R)return;const Ve=()=>{if(ye){oe(!1);return}const Pt=ae.current;Pt&&oe(Pt.scrollHeight>Pt.clientHeight)},Rt=ye?0:160;return Se.current=setTimeout(Ve,Rt),()=>{Se.current!==null&&clearTimeout(Se.current)}},[R,ye,e,ae]);const _e=E.useMemo(()=>{if(!R){const Ve={minHeight:`${C}px`};return N&&(Ve.maxHeight=`${N}px`,Ve.overflowY="auto"),Ve}return{height:ye&&Pe?`${Pe}px`:`${C}px`,minHeight:`${C}px`,maxHeight:N?`${N}px`:"70dvh",overflowY:ye?"auto":"hidden",transition:"height 150ms ease-out, min-height 240ms cubic-bezier(0.33, 1, 0.68, 1)"}},[R,C,N,ye,Pe]),$e=E.useCallback(Ve=>{H?.(Ve),!Ve.defaultPrevented&&Le(Ve)},[H,Le]),ot=E.useCallback(Ve=>{q?.(Ve),re()},[q,re]),et=e.length===0||e.length===1&&e[0].type==="text"&&e[0].text==="",dt=D.length>0?m.jsx(qU,{images:D,onRemove:j,onClick:X,className:I==="above"?"pb-2":"pt-2"}):null,ut=K.length>0?m.jsx(tz,{files:K,onRemove:W,onClick:V,className:F==="above"?"pb-2":"pt-2"}):null;return m.jsxs("div",{className:Ie("prompt-area-container relative text-sm leading-relaxed",i),children:[I==="above"&&dt,F==="above"&&ut,m.jsxs("div",{className:"relative",children:[m.jsx("div",{ref:ae,contentEditable:!a,suppressContentEditableWarning:!0,role:"textbox","aria-label":M??"Text input","aria-multiline":"true","aria-disabled":a||void 0,"aria-describedby":G,"data-test-id":_,spellCheck:L,className:Ie("prompt-area-editor","w-full min-w-0 break-words whitespace-pre-wrap outline-none",a&&"cursor-not-allowed opacity-50"),style:_e,onFocus:se,onInput:R?Q:Fe,onKeyDown:$e,onMouseDown:Oe,onClick:Ee,onPaste:ke.onPaste,onCopy:ke.onCopy,onCut:ke.onCut,onDrop:ke.onDrop,onDragOver:ke.onDragOver,onCompositionStart:ke.onCompositionStart,onCompositionEnd:ke.onCompositionEnd,onBlur:ot}),R&&$&&!ye&&m.jsx("div",{"aria-hidden":"true",className:"pointer-events-auto absolute right-0 bottom-0 left-0 cursor-pointer",style:{height:"32px"},onClick:()=>ae.current?.focus(),children:m.jsx("div",{className:"h-full w-full",style:{background:"linear-gradient(to bottom, transparent, color-mix(in srgb, var(--prompt-area-surface, var(--background)) 80%, transparent), var(--prompt-area-surface, var(--background)))"}})}),et&&r&&(Array.isArray(r)?m.jsx(VU,{texts:r}):m.jsx("div",{className:"pointer-events-none absolute top-0 left-0 select-none",style:{color:"var(--prompt-area-placeholder, var(--muted-foreground))"},"aria-hidden":"true",children:r}))]}),F==="below"&&ut,I==="below"&&dt,ie&&ie.config.mode==="dropdown"&&m.jsx($U,{suggestions:ce,loading:de,error:he,emptyMessage:ie.config.emptyMessage,selectedIndex:ve,onSelect:Ue,onDismiss:Xe,triggerRect:De,triggerChar:ie.config.char})]})}function rz(e={}){const{initialValue:t=[]}=e,[n,r]=E.useState(t),i=E.useRef(null),a=E.useMemo(()=>Bn(n),[n]),l=E.useMemo(()=>n.length===0?!0:n.every(v=>v.type==="text"&&v.text.trim()===""),[n]),c=E.useMemo(()=>n.some(v=>v.type==="chip"),[n]),d=E.useMemo(()=>n.filter(v=>v.type==="chip"),[n]),f=E.useMemo(()=>({ref:i,value:n,onChange:r}),[n]),g=E.useCallback(()=>{i.current?i.current.clear():r([])},[]),h=E.useCallback(()=>i.current?.focus(),[]),b=E.useCallback(()=>i.current?.blur(),[]),x=E.useCallback(v=>i.current?.insertChip(v),[]);return{bind:f,plainText:a,isEmpty:l,hasChips:c,chips:d,clear:g,focus:h,blur:b,insertChip:x}}function sz(e={}){const{char:t="@",...n}=e;return{char:t,position:"any",mode:"dropdown",chipStyle:"pill",accessibilityLabel:"mention",...n}}function dC(e={}){const{char:t="/",position:n="any",...r}=e;return{char:t,position:n,mode:"dropdown",chipStyle:"inline",accessibilityLabel:"command",...r}}const e_=7,nd={claude:{interactiveApprovals:!0,permissionModes:["default","acceptEdits","bypassPermissions","plan","dontAsk","auto"],defaultPermissionMode:"default",resume:!0,resumeBackfill:!0,listSessions:!0,contextUsage:!0,rateLimits:!0,mcpStatus:!0,mcpServerActions:!0,sessionMcpServers:!0,slashCommands:!0,skillsList:!1,settingSources:!0,budgets:!0,attachments:["image","pdf","text"],reasoningEfforts:["low","medium","high","xhigh","max"],vfs:!1,streaming:"token"},codex:{interactiveApprovals:!0,permissionModes:["default","acceptEdits","bypassPermissions"],defaultPermissionMode:"default",resume:!0,resumeBackfill:!0,listSessions:!0,contextUsage:!0,rateLimits:!0,mcpStatus:!0,mcpServerActions:!1,sessionMcpServers:!1,slashCommands:!1,skillsList:!0,settingSources:!1,budgets:!1,attachments:["image","text"],reasoningEfforts:["minimal","low","medium","high","xhigh"],vfs:!1,streaming:"token"},provider:{interactiveApprovals:!1,permissionModes:["default","bypassPermissions","dontAsk"],defaultPermissionMode:"default",resume:!1,resumeBackfill:!1,listSessions:!1,contextUsage:!1,rateLimits:!1,mcpStatus:!1,mcpServerActions:!1,sessionMcpServers:!1,slashCommands:!1,skillsList:!1,settingSources:!1,budgets:!1,attachments:["image","pdf","text"],vfs:!0,streaming:"token"}};nd.provider.permissionModes;const iz={status:"starting",capabilities:nd.claude,items:[],pendingApprovals:[],totalCostUsd:0,lastSeq:0},U0="streaming",Qf="streaming-thinking";function az(e){return e===void 0?"":typeof e=="string"?e:e.map(t=>typeof t.text=="string"?t.text:"").filter(Boolean).join(`
531
+ `)}function fC(e){return typeof e=="string"?[{type:"text",text:e}]:e}function oz(e){if(e.type==="text")return e.value;try{return JSON.stringify(e.value)}catch{return String(e.value)}}const lz=/^<local-command-(stdout|stderr)>([\s\S]*?)<\/local-command-\1>$/;function Ha(e,t){const n=e.findIndex(i=>i.id===t.id&&i.kind===t.kind);if(n===-1)return[...e,t];const r=[...e];return r[n]=t,r}function uz(e,t){const n=t.engine??e.engine;return{...e,status:e.lastSeq===0?t.status:e.status,model:e.model??t.model,permissionMode:e.permissionMode??t.permissionMode,cwd:e.cwd??t.cwd,sdkSessionId:e.sdkSessionId??t.sdkSessionId,engine:n,capabilities:t.capabilities??nd[n??"claude"],session:t}}function cz(e){const t=Object.entries(e.rateLimits??{}).filter(([,i])=>i.utilization!==void 0).map(([i,a])=>({key:i,info:a})),n=["five_hour","seven_day"].flatMap(i=>t.filter(a=>a.key===i)),r=t.filter(i=>i.key.startsWith("seven_day_")).sort((i,a)=>i.key.localeCompare(a.key));return[...n,...r]}function dz(e,t){if(t.seq<=e.lastSeq)return e;const n={...e,lastSeq:t.seq};switch(t.type){case"system_init":return{...n,model:t.model,cwd:t.cwd,sdkSessionId:t.sdkSessionId,permissionMode:t.permissionMode};case"status_changed":return{...n,status:t.status,statusDetail:t.detail};case"capabilities":return{...n,models:t.models,commands:t.commands,defaultModel:t.defaultModel??n.defaultModel};case"skills":return{...n,skills:t.skills};case"file_produced":return{...n,producedFiles:{...n.producedFiles,[t.path]:{fileId:t.fileId,...t.mediaType?{mediaType:t.mediaType}:{},...t.bytes!==void 0?{bytes:t.bytes}:{}}}};case"model_changed":return t.model===void 0?n:{...n,model:t.model};case"permission_mode_changed":return{...n,permissionMode:t.mode};case"context_usage":return{...n,contextUsage:t.usage};case"rate_limit":{const r=t.info.rateLimitType;return r?{...n,rateLimits:{...n.rateLimits,[r]:t.info},rateLimitsUpdatedAt:t.ts}:n}case"plan_info":return{...n,subscriptionType:t.subscriptionType};case"user_message":{let r=n.items;for(const i of fC(t.message.content))if(i.type==="tool_result"){const a=i,l=a.is_error===!0;r=r.map(c=>c.kind==="tool_call"&&c.id===a.tool_use_id?{...c,status:l?"failed":"settled",result:{text:az(a.content),isError:l}}:c)}else if(i.type==="text"&&!t.synthetic){const a=i.text,l=lz.exec(a.trim());l?r=Ha(r,{kind:"notice",id:t.uuid??`user-${t.seq}`,level:l[1]==="stderr"?"error":"info",text:l[2].trim()}):r=Ha(r,{kind:"user",id:t.uuid??`user-${t.seq}`,text:a,attachments:t.attachments})}return{...n,items:r}}case"assistant_message":{let r=n.items.find(l=>l.kind==="thinking"&&l.id===Qf)?.text??"",i=n.items.filter(l=>!(l.kind==="assistant_text"&&l.id===U0)&&!(l.kind==="thinking"&&l.id===Qf));return fC(t.message.content).forEach((l,c)=>{const d=`${t.uuid}-${c}`;if(l.type==="text")i=Ha(i,{kind:"assistant_text",id:d,text:l.text,streaming:!1,parentToolUseId:t.parentToolUseId});else if(l.type==="thinking"){const f=l.thinking||r;if(r="",f.trim()==="")return;i=Ha(i,{kind:"thinking",id:d,text:f,parentToolUseId:t.parentToolUseId})}else if(l.type==="tool_use"){const f=l;i=Ha(i,{kind:"tool_call",id:f.id,name:f.name,input:f.input,parentToolUseId:t.parentToolUseId,status:"running"})}}),{...n,items:i}}case"stream_delta":{const r=t.event;if(r.type!=="content_block_delta")return n;if(r.delta?.type==="text_delta"){const i=n.items.find(l=>l.kind==="assistant_text"&&l.id===U0),a={kind:"assistant_text",id:U0,text:(i?.text??"")+(r.delta.text??""),streaming:!0,parentToolUseId:t.parentToolUseId};return{...n,items:Ha(n.items,a)}}if(r.delta?.type==="thinking_delta"){const i=n.items.find(l=>l.kind==="thinking"&&l.id===Qf),a={kind:"thinking",id:Qf,text:(i?.text??"")+(r.delta.thinking??""),parentToolUseId:t.parentToolUseId};return{...n,items:Ha(n.items,a)}}return n}case"turn_result":return{...n,totalCostUsd:t.totalCostUsd,items:[...n.items,{kind:"turn_result",id:`turn-${t.seq}`,subtype:t.subtype,isError:t.isError,durationMs:t.durationMs,totalCostUsd:t.totalCostUsd,errors:t.errors}]};case"permission_requested":return{...n,pendingApprovals:[...n.pendingApprovals,t.request]};case"permission_resolved":return{...n,pendingApprovals:n.pendingApprovals.filter(r=>r.id!==t.requestId)};case"execution_dispatched":return{...n,items:n.items.map(r=>r.kind==="tool_call"&&r.id===t.executionId?{...r,status:t.deferred?"deferred":"pending",executionId:t.executionId,backend:t.backend}:r)};case"execution_result":return{...n,items:n.items.map(r=>r.kind==="tool_call"&&r.id===t.executionId?{...r,status:"settled",executionId:t.executionId,result:{text:oz(t.output),isError:!1},logs:t.logs??r.logs}:r)};case"execution_failed":return{...n,items:n.items.map(r=>r.kind==="tool_call"&&r.id===t.executionId?{...r,status:"failed",executionId:t.executionId,result:{text:`${t.reason}: ${t.error}`,isError:!0},logs:t.logs??r.logs}:r)};case"file_delivered":return{...n,items:[...n.items,{kind:"file_delivered",id:`file-${t.seq}`,path:t.path,bytes:t.bytes,description:t.description}]};case"session_error":return{...n,items:[...n.items,{kind:"notice",id:`err-${t.seq}`,level:"error",text:t.message}]};case"session_closed":return{...n,items:[...n.items,{kind:"notice",id:`closed-${t.seq}`,level:"info",text:`Session closed (${t.reason})`}]};case"sdk_event":default:return n}}function fz(e,t){return t.type==="attached"?uz(e,t.session):dz(e,t)}const hz=3;function pz(e,t,n){const[r,i]=E.useReducer(fz,iz),[a,l]=E.useState("reconnecting"),[c,d]=E.useState(),[f,g]=E.useState(),h=E.useRef(null),b=E.useRef(n?.onProtocolError);b.current=n?.onProtocolError,E.useEffect(()=>{if(!t)return;const k=e.attach(t);h.current=k,g(k);const C=k.on("event",_=>i(_)),N=k.on("attached",_=>{i(_),d(_.protocolVersion===e_?void 0:_.protocolVersion)}),A=k.on("connectionChange",_=>l(_?"live":"reconnecting")),R=k.on("reconnectAttempt",_=>l(_>=hz?"offline":"reconnecting")),M=k.on("protocolError",_=>{b.current?.(_)});return()=>{C(),N(),A(),R(),M(),k.detach(),h.current=null,g(void 0),l("reconnecting"),d(void 0)}},[e,t]);const x=mz(e,t,r),v=a==="live",w=E.useCallback(()=>h.current?.reconnectNow(),[]);return E.useMemo(()=>({state:r,connected:v,connection:a,protocolMismatch:c,models:x,effectiveModel:r.model??r.defaultModel,handle:f,send:(k,C)=>h.current?.send(k,C),approve:(k,C)=>h.current?.approve(k,C),deny:(k,C,N)=>h.current?.deny(k,C,N),interrupt:()=>h.current?.interrupt(),setPermissionMode:k=>h.current?.setPermissionMode(k),setModel:k=>h.current?.setModel(k),closeSession:()=>h.current?.closeSession(),reconnectNow:w}),[r,v,a,c,x,f,w])}function mz(e,t,n){const[r,i]=E.useState([]),a=n.session?.profile,l=n.models,c=!!l?.length;return E.useEffect(()=>i([]),[t]),E.useEffect(()=>{if(!a||c)return;let d=!1;return e.listProfiles().then(f=>{d||i(f.profiles.find(g=>g.name===a)?.models??[])}).catch(()=>{}),()=>{d=!0}},[e,a,c]),c?l:r}function gz(e){const t=e.split(";")[0].trim().toLowerCase();if(t.startsWith("image/"))return"image";if(t==="application/pdf")return"pdf";if(t.startsWith("text/")||bz.has(t))return"text"}const bz=new Set(["application/json","application/xml","application/yaml","application/x-yaml","application/toml","application/javascript","application/typescript","application/x-sh","application/sql"]),hC=1568;function xz(e,t,{capabilities:n,engine:r}){const[i,a]=E.useState([]),[l,c]=E.useState(),d=E.useRef(0),f=E.useRef(new Map),g=E.useRef([]);g.current=i.flatMap(A=>A.previewUrl?[A.previewUrl]:[]);const h=n.attachments;E.useEffect(()=>()=>{for(const A of g.current)URL.revokeObjectURL(A)},[]);const b=E.useCallback((A,R)=>{a(M=>M.map(_=>_.key===A?{..._,...R}:_))},[]),x=E.useCallback((A,R)=>{t&&(b(A,{status:"uploading",error:void 0}),(async()=>{try{const M=await vz(R),_=await e.uploadAttachment(t,{name:R.name,mediaType:M.mediaType,data:M.body});b(A,{status:"ready",id:_.id,bytes:_.bytes??R.size})}catch(M){b(A,{status:"failed",error:M instanceof Error?M.message:"Upload failed"})}})())},[e,b,t]),v=E.useCallback(A=>{const R=[],M=[];for(const _ of A){const D=_.type||"application/octet-stream",I=gz(D);if(I&&!h.includes(I)){c(`The ${r??"claude"} engine does not take ${I} attachments.`);continue}const U=`att-${++d.current}`;R.push({key:U,name:_.name,mediaType:D,bytes:_.size,previewUrl:I==="image"?URL.createObjectURL(_):void 0,status:"uploading"}),M.push({key:U,file:_})}if(R.length!==0){a(_=>[..._,...R]),f.current=new Map([...f.current,...M.map(({key:_,file:D})=>[_,D])]);for(const{key:_,file:D}of M)x(_,D)}},[h,r,x]),w=E.useCallback(A=>{a(R=>{for(const M of R)A.includes(M.key)&&M.previewUrl&&URL.revokeObjectURL(M.previewUrl);return R.filter(M=>!A.includes(M.key))});for(const R of A)f.current.delete(R)},[]),k=E.useCallback(A=>w([A]),[w]),C=E.useCallback(()=>{a(A=>{for(const R of A)R.previewUrl&&URL.revokeObjectURL(R.previewUrl);return[]}),f.current.clear()},[]),N=E.useCallback(A=>{const R=f.current.get(A);R&&x(A,R)},[x]);return E.useMemo(()=>({items:i,readyIds:i.flatMap(A=>A.id?[A.id]:[]),uploading:i.some(A=>A.status==="uploading"),hasFailure:i.some(A=>A.status==="failed"),accept:yz(h),disabled:h.length===0||!t,add:v,retry:N,remove:k,clear:C,error:l,dismissError:()=>c(void 0)}),[i,h,t,v,N,k,C,l])}function yz(e){if(e.length===0)return"";const t=[];return e.includes("image")&&t.push("image/*"),e.includes("pdf")&&t.push("application/pdf"),e.includes("text")&&t.push("text/*",".md",".json",".yaml",".yml",".toml"),e.length===3?"":t.join(",")}const Ez=globalThis;async function vz(e){const t=e.type||"application/octet-stream",{createImageBitmap:n,document:r}=Ez;if(!n||!r||!t.startsWith("image/"))return{body:e,mediaType:t};if(t==="image/gif")return{body:e,mediaType:t};try{const i=await n(e),a=Math.max(i.width,i.height);if(a<=hC)return i.close(),{body:e,mediaType:t};const l=hC/a,c=r.createElement("canvas");c.width=Math.round(i.width*l),c.height=Math.round(i.height*l);const d=c.getContext("2d");if(!d)return i.close(),{body:e,mediaType:t};d.drawImage(i,0,0,c.width,c.height),i.close();const f=await new Promise(g=>c.toBlob(g,"image/jpeg",.85));return f?{body:f,mediaType:"image/jpeg"}:{body:e,mediaType:t}}catch{return{body:e,mediaType:t}}}const Tz=/^[A-Za-z0-9\-_.:]+$/,Sz=new Set([".",",",";",":","!","?",")","]","}",'"',"'"]);function Cz(e){const t=[],n=/\S+/g;let r;for(;(r=n.exec(e))!==null;){const i=r[0],a=i[0]==="@"?"file":i[0]==="/"?"command":void 0;if(!a)continue;let l=r.index+i.length;for(;l>r.index&&Sz.has(e[l-1]);)l--;const c=e.slice(r.index+1,l);c&&(a==="command"&&!Tz.test(c)||t.push({kind:a,start:r.index,end:l,text:e.slice(r.index,l)}))}return t}class Qa extends Error{status;constructor(t,n){super(t),this.name="WorkerDeckError",this.status=n}}class kz{sessionId;#t;#r;#n;#e=new Map;#s;#u=!1;#o=0;#i=[];#c;constructor(t,n,r={}){this.#t=t,this.sessionId=n,this.#r={reconnect:!0,...r},this.#s=r.afterSeq??0,this.#c=setTimeout(()=>this.#d(),0)}get lastSeq(){return this.#s}on(t,n){let r=this.#e.get(t);return r||(r=new Set,this.#e.set(t,r)),r.add(n),()=>r.delete(n)}send(t,n){this.#a({type:"user_message",text:t,attachmentIds:n?.length?n:void 0})}approve(t,n){this.#a({type:"permission_decision",requestId:t,behavior:"allow",updatedInput:n})}deny(t,n,r){this.#a({type:"permission_decision",requestId:t,behavior:"deny",message:n,interrupt:r})}interrupt(){this.#a({type:"interrupt"})}setPermissionMode(t){this.#a({type:"set_permission_mode",mode:t})}setModel(t){this.#a({type:"set_model",model:t})}sendToolCallResult(t,n,r){this.#a({type:"tool_call_result",executionId:t,output:n,logs:r})}sendToolCallError(t,n,r,i){this.#a({type:"tool_call_error",executionId:t,reason:n,error:r,logs:i})}closeSession(){this.#a({type:"close"}),this.detach()}reconnectNow(){this.#u||this.#n&&this.#n.readyState===1||(clearTimeout(this.#c),this.#o=0,this.#d())}detach(){this.#u=!0,clearTimeout(this.#c),this.#n?.close(),this.#n=void 0}#l(t,n){const r=this.#e.get(t);if(r)for(const i of r)try{i(n)}catch{}}#a(t){const n=JSON.stringify(t);this.#n&&this.#n.readyState===1?this.#n.send(n):this.#i.push(n)}#d(){if(this.#u)return;const t=this.#t.openSocket(this.sessionId,this.#s);this.#n=t,t.onopen=()=>{this.#o=0,this.#l("connectionChange",!0);for(const n of this.#i.splice(0))t.send(n)},t.onmessage=n=>{const r=JSON.parse(String(n.data));if(r.type==="attached")this.#l("attached",r);else if(r.type==="event"){if(r.event.seq<=this.#s)return;this.#s=r.event.seq,this.#l("event",r.event)}else r.type==="tool_call_request"?this.#l("toolCallRequest",r):r.type==="tool_call_canceled"?this.#l("toolCallCanceled",{executionId:r.executionId,reason:r.reason}):r.type==="protocol_error"&&this.#l("protocolError",r.message)},t.onclose=()=>{if(this.#l("connectionChange",!1),this.#u||!this.#r.reconnect)return;const n=Math.min(500*2**this.#o++,1e4);this.#l("reconnectAttempt",this.#o),this.#c=setTimeout(()=>this.#d(),n)},t.onerror=()=>{}}}class wz{#t;#r;#n;#e=new Map;#s=!1;#u=0;#o;constructor(t,n={}){this.#t=t,this.#r=n.reconnect??!0,this.#o=setTimeout(()=>this.#c(),0)}on(t,n){let r=this.#e.get(t);return r||(r=new Set,this.#e.set(t,r)),r.add(n),()=>r.delete(n)}detach(){this.#s=!0,clearTimeout(this.#o),this.#n?.close(),this.#n=void 0}#i(t,n){const r=this.#e.get(t);if(r)for(const i of r)try{i(n)}catch{}}#c(){if(this.#s)return;const t=this.#t.openQueueSocket();this.#n=t,t.onopen=()=>{this.#u=0,this.#i("connectionChange",!0)},t.onmessage=n=>{const r=JSON.parse(String(n.data));r.type==="queue_attached"?(this.#i("attached",r.stats),this.#i("stats",r.stats)):r.type==="job_event"?this.#i("event",r.event):r.type==="queue_stats"&&this.#i("stats",r.stats)},t.onclose=()=>{if(this.#i("connectionChange",!1),this.#s||!this.#r)return;const n=Math.min(500*2**this.#u++,1e4);this.#o=setTimeout(()=>this.#c(),n)},t.onerror=()=>{}}}class Nz{#t;#r;#n;constructor(t){this.#t=t,this.#r=t.fetchImpl??fetch.bind(globalThis),this.#n=t.WebSocketImpl??WebSocket}async createSession(t){return(await this.#e("POST","/sessions",t)).session}async listSessions(){return(await this.#e("GET","/sessions")).sessions}async getSession(t){return(await this.#e("GET",`/sessions/${encodeURIComponent(t)}`)).session}async deleteSession(t){return(await this.#e("DELETE",`/sessions/${encodeURIComponent(t)}`)).session}async listSessionFiles(t){return(await this.#e("GET",`/sessions/${encodeURIComponent(t)}/files`)).files}async fetchSessionFile(t,n){const r=await this.#r(this.sessionFileUrl(t,n),{headers:this.#t.headers});if(!r.ok){const i=await r.json().catch(()=>({}));throw new Qa(i.error??`GET file failed with ${r.status}`,r.status)}return await r.text()}async uploadAttachment(t,n){const r=`${this.#t.baseUrl}/sessions/${encodeURIComponent(t)}/attachments?name=${encodeURIComponent(n.name)}`,i=await this.#r(r,{method:"POST",headers:{...this.#t.headers,"content-type":n.mediaType},body:n.data});if(!i.ok){const a=await i.json().catch(()=>({}));throw new Qa(a.error??`upload failed with ${i.status}`,i.status)}return(await i.json()).attachment}attachmentUrl(t,n){return`${this.#t.baseUrl}/sessions/${encodeURIComponent(t)}/attachments/${encodeURIComponent(n)}`}producedFileUrl(t,n){return`${this.#t.baseUrl}/sessions/${encodeURIComponent(t)}/produced/${encodeURIComponent(n)}`}async readProducedFile(t,n){const r=await this.#r(this.producedFileUrl(t,n),{headers:{...this.#t.headers}});if(!r.ok){const i=await r.json().catch(()=>({}));throw new Qa(i.error??`produced file request failed with ${r.status}`,r.status)}return await r.blob()}async listMcpServers(t){return(await this.#e("GET",`/sessions/${encodeURIComponent(t)}/mcp`)).servers}async mcpServerAction(t,n,r){return(await this.#e("POST",`/sessions/${encodeURIComponent(t)}/mcp/${encodeURIComponent(n)}`,{action:r})).servers}sessionFileUrl(t,n){const r=n.split("/").filter(Boolean).map(encodeURIComponent).join("/");return`${this.#t.baseUrl}/sessions/${encodeURIComponent(t)}/files/${r}`}async resolvePermission(t,n,r){await this.#e("POST",`/sessions/${encodeURIComponent(t)}/permissions/${encodeURIComponent(n)}`,r)}async submitExecutionResult(t,n){return await this.#e("POST",`/executions/${encodeURIComponent(t)}/result`,n)}async listProfiles(){return await this.#e("GET","/profiles")}async getProfile(t){return await this.#e("GET",`/profiles/${encodeURIComponent(t)}`)}async createProfile(t){return(await this.#e("POST","/profiles",t)).profile}async updateProfile(t,n){return(await this.#e("PATCH",`/profiles/${encodeURIComponent(t)}`,n)).profile}async deleteProfile(t){await this.#e("DELETE",`/profiles/${encodeURIComponent(t)}`)}async listSdkSessions(t){const n=new URLSearchParams;t?.dir&&n.set("dir",t.dir),t?.limit!==void 0&&n.set("limit",String(t.limit)),t?.offset!==void 0&&n.set("offset",String(t.offset)),t?.profile&&n.set("profile",t.profile);const r=n.size>0?`?${n.toString()}`:"";return(await this.#e("GET",`/sdk-sessions${r}`)).sdkSessions}async listHostRoots(){return await this.#e("GET","/fs/roots")}async listHostDir(t){const n=`?path=${encodeURIComponent(t)}`;return await this.#e("GET",`/fs/list${n}`)}async findHostFiles(t,n="",r){const i=new URLSearchParams({path:t,q:n});return r!==void 0&&i.set("limit",String(r)),await this.#e("GET",`/fs/find?${i.toString()}`)}async readHostFile(t){const n=`?path=${encodeURIComponent(t)}`;return await this.#e("GET",`/fs/read${n}`)}async writeHostFile(t){return await this.#e("PUT","/fs/write",t)}async createJob(t){return(await this.#e("POST","/jobs",t)).job}async listJobs(){return(await this.#e("GET","/jobs")).jobs}async getJob(t){return(await this.#e("GET",`/jobs/${encodeURIComponent(t)}`)).job}async cancelJob(t){return(await this.#e("DELETE",`/jobs/${encodeURIComponent(t)}`)).job}async queueStats(){return(await this.#e("GET","/queue")).stats}attach(t,n){return new kz(this,t,n)}attachQueue(t){return new wz(this,t)}openSocket(t,n){const r=this.#t.buildWsUrl?.(t,n)??`${this.#t.baseUrl.replace(/^http/,"ws")}/sessions/${encodeURIComponent(t)}/ws?afterSeq=${n}`;return new this.#n(r)}openQueueSocket(){const t=this.#t.buildQueueWsUrl?.()??`${this.#t.baseUrl.replace(/^http/,"ws")}/queue/ws`;return new this.#n(t)}async#e(t,n,r){const i=await this.#r(`${this.#t.baseUrl}${n}`,{method:t,headers:{...r!==void 0?{"content-type":"application/json"}:{},...this.#t.headers},body:r!==void 0?JSON.stringify(r):void 0}),a=await i.json().catch(()=>({}));if(!i.ok)throw new Qa(a.error??`${t} ${n} failed with ${i.status}`,i.status);return a}}function Az(e,t,n){const r=[],i=(a,l)=>{const c=t.get(a);if(c)for(const d of c.entries){if(d.type!=="dir"){r.push({entry:d,depth:l});continue}const f=n.has(d.path),g=t.get(d.path);r.push({entry:d,depth:l,expanded:f,loading:f&&!g,truncated:f?g?.truncated:void 0}),f&&g&&i(d.path,l+1)}};return i(e,0),r}function _z(e,t){const n=e.endsWith("/")?e.slice(0,-1):e;if(t===n||!t.startsWith(`${n}/`))return[];const r=t.slice(n.length+1).split("/"),i=[];let a=n;for(const l of r.slice(0,-1))a=`${a}/${l}`,i.push(a);return i}function t_(e,t){const[n,r]=E.useState(!1),i=E.useRef(t);E.useEffect(()=>{i.current!==t&&(i.current=t,r(!1))},[t]);const a=E.useCallback(async(l,c)=>{if(!t||n)return[];try{const d=await e.findHostFiles(t,l,c?.limit??8);return c?.signal?.aborted?[]:d.matches}catch(d){return d instanceof Qa&&d.status===404&&r(!0),[]}},[e,t,n]);return{available:!!t&&!n,search:a}}function Rz(e){const[t,n]=E.useState({available:!1,canWrite:!1});return E.useEffect(()=>{let r=!1;return e.listHostRoots().then(i=>{r||n({available:!0,canWrite:i.canWrite})}).catch(()=>{r||n({available:!1,canWrite:!1})}),()=>{r=!0}},[e]),t}function Oz(e,t){const[n,r]=E.useState(()=>new Map),[i,a]=E.useState(()=>new Set),[l,c]=E.useState(!1),[d,f]=E.useState(),g=E.useRef(t);E.useEffect(()=>{g.current!==t&&(g.current=t,r(new Map),a(new Set),c(!1),f(void 0))},[t]);const h=E.useRef(!0);E.useEffect(()=>(h.current=!0,()=>{h.current=!1}),[]);const b=E.useRef(new Set),x=E.useCallback((N,{force:A=!1}={})=>{l||!A&&b.current.has(N)||(b.current.add(N),e.listHostDir(N).then(R=>{h.current&&r(M=>{const _=new Map(M);return _.set(N,{entries:R.entries,truncated:R.truncated}),_})}).catch(R=>{if(h.current){if(b.current.delete(N),R instanceof Qa&&R.status===404){c(!0);return}f(R instanceof Error?R.message:"Could not read that directory")}}))},[e,l]);E.useEffect(()=>{t&&x(t)},[t,x]);const v=E.useCallback(N=>{a(A=>{const R=new Set(A);return R.has(N)?R.delete(N):R.add(N),R}),x(N)},[x]),w=E.useCallback(N=>{if(!t)return;const A=_z(t,N);if(A.length!==0){for(const R of A)x(R);a(R=>{const M=new Set(R);for(const _ of A)M.add(_);return M})}},[t,x]),k=E.useCallback(N=>{const A=N??t;A&&(f(void 0),x(A,{force:!0}))},[t,x]),C=E.useMemo(()=>t?Az(t,n,i):[],[t,n,i]);return{available:!!t&&!l,root:t,rows:C,loading:!!t&&!l&&!n.has(t)&&!d,error:d,toggle:v,reveal:w,refresh:k}}function n_(e,t){const[n,r]=E.useState(),[i,a]=E.useState(!!t),[l,c]=E.useState();return E.useEffect(()=>{if(!t){r(void 0),a(!1),c(void 0);return}let d=!1;return a(!0),c(void 0),r(void 0),e.getSession(t).then(f=>{d||(r(f),a(!1))}).catch(f=>{d||(c(f instanceof Error?f.message:"Session not found"),a(!1))}),()=>{d=!0}},[e,t]),{info:n,loading:i,error:l}}function qc(e){return e.draft!==void 0&&e.draft!==e.content}function qb(e){return e.draft??e.content??""}const r_={files:[]};function Iz(e,t){switch(t.type){case"open":{if(e.files.some(r=>r.path===t.path))return e.activePath===t.path?e:{...e,activePath:t.path};const n={path:t.path,name:pC(t.path),status:"loading"};return{files:[...e.files,n],activePath:t.path}}case"close":{const n=e.files.findIndex(a=>a.path===t.path);if(n===-1)return e;const r=e.files.filter(a=>a.path!==t.path);if(e.activePath!==t.path)return{...e,files:r};const i=r[n]??r[n-1];return{files:r,activePath:i?.path}}case"closeAll":return r_;case"activate":return e.files.some(n=>n.path===t.path)?e.activePath===t.path?e:{...e,activePath:t.path}:e;case"loaded":return qi(e,t.path,()=>({path:t.path,name:pC(t.path),status:t.encoding==="utf8"?"ready":"binary",content:t.encoding==="utf8"?t.content:void 0,bytes:t.bytes,hash:t.hash,modifiedAt:t.modifiedAt}));case"failed":return qi(e,t.path,n=>({...n,status:"error",error:t.error}));case"edit":return qi(e,t.path,n=>n.status==="ready"?{...n,draft:t.content}:n);case"revert":return qi(e,t.path,n=>({...n,draft:void 0,saveError:void 0,conflict:!1}));case"saveStart":return qi(e,t.path,n=>({...n,saving:!0,saveError:void 0,conflict:!1}));case"saved":return qi(e,t.path,n=>({...n,saving:!1,saveError:void 0,conflict:!1,content:t.content,bytes:t.bytes,hash:t.hash,modifiedAt:t.modifiedAt,draft:n.draft===t.content?void 0:n.draft}));case"saveFailed":return qi(e,t.path,n=>({...n,saving:!1,saveError:t.error,conflict:t.conflict??!1}));case"dismissConflict":return qi(e,t.path,n=>({...n,conflict:!1,saveError:void 0}))}}function qi(e,t,n){const r=e.files.findIndex(c=>c.path===t);if(r===-1)return e;const i=e.files[r],a=n(i);if(a===i)return e;const l=e.files.slice();return l[r]=a,{...e,files:l}}function pC(e){const t=e.endsWith("/")?e.slice(0,-1):e;return t.slice(t.lastIndexOf("/")+1)||t||e}function Mz(e){const[t,n]=E.useReducer(Iz,r_),r=E.useRef(new Set),i=E.useRef(!0);E.useEffect(()=>(i.current=!0,()=>{i.current=!1}),[]);const a=E.useRef(t);E.useEffect(()=>{a.current=t},[t]);const c=t.files.filter(_=>_.status==="loading").map(_=>_.path).join(`
532
+ `),d=E.useCallback(_=>e.readHostFile(_).then(D=>{if(i.current)return n({type:"loaded",path:_,content:D.content,encoding:D.encoding,bytes:D.bytes,hash:D.hash,modifiedAt:D.modifiedAt}),D}),[e]);E.useEffect(()=>{for(const _ of c?c.split(`
533
+ `):[])r.current.has(_)||(r.current.add(_),d(_).catch(D=>{i.current&&n({type:"failed",path:_,error:D instanceof Error?D.message:"Could not read that file"})}))},[d,c]);const f=E.useCallback(_=>n({type:"open",path:_}),[]),g=E.useCallback(_=>{r.current.delete(_),n({type:"close",path:_})},[]),h=E.useCallback(()=>{r.current.clear(),n({type:"closeAll"})},[]),b=E.useCallback(_=>n({type:"activate",path:_}),[]),x=E.useCallback((_,D)=>n({type:"edit",path:_,content:D}),[]),v=E.useCallback(_=>n({type:"revert",path:_}),[]),w=E.useCallback(_=>n({type:"dismissConflict",path:_}),[]),k=E.useCallback(_=>{r.current.add(_),d(_).catch(D=>{i.current&&n({type:"failed",path:_,error:D instanceof Error?D.message:"Could not re-read that file"})})},[d]),C=E.useCallback(async(_,D,I)=>{try{const U=await e.writeHostFile({path:_,content:D,expectedHash:I});if(!i.current)return;n({type:"saved",path:_,content:D,bytes:U.bytes,hash:U.hash,modifiedAt:U.modifiedAt})}catch(U){if(!i.current)return;const j=U instanceof Qa&&U.status===409;n({type:"saveFailed",path:_,conflict:j,error:j?"This file changed on disk since you opened it.":U instanceof Error?U.message:"Could not save that file"})}},[e]),N=E.useCallback(async _=>{const D=a.current.files.find(I=>I.path===_);!D||D.saving||!qc(D)||(n({type:"saveStart",path:_}),await C(_,qb(D),D.hash))},[C]),A=E.useCallback(async _=>{const D=a.current.files.find(U=>U.path===_);if(!D||D.saving)return;const I=qb(D);n({type:"saveStart",path:_});try{const U=await e.readHostFile(_);if(!i.current)return;await C(_,I,U.hash)}catch(U){if(!i.current)return;n({type:"saveFailed",path:_,error:U instanceof Error?U.message:"Could not save that file"})}},[e,C]),R=E.useMemo(()=>t.files.find(_=>_.path===t.activePath),[t.files,t.activePath]),M=E.useMemo(()=>t.files.some(qc),[t.files]);return{...t,active:R,hasUnsaved:M,open:f,close:g,closeAll:h,activate:b,edit:x,save:N,revert:v,reload:k,overwrite:A,dismissConflict:w}}const Lz="modulepreload",Dz=function(e){return"/"+e},mC={},Pl=function(t,n,r){let i=Promise.resolve();if(n&&n.length>0){let l=function(f){return Promise.all(f.map(g=>Promise.resolve(g).then(h=>({status:"fulfilled",value:h}),h=>({status:"rejected",reason:h}))))};document.getElementsByTagName("link");const c=document.querySelector("meta[property=csp-nonce]"),d=c?.nonce||c?.getAttribute("nonce");i=l(n.map(f=>{if(f=Dz(f),f in mC)return;mC[f]=!0;const g=f.endsWith(".css"),h=g?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${f}"]${h}`))return;const b=document.createElement("link");if(b.rel=g?"stylesheet":Lz,g||(b.as="script"),b.crossOrigin="",b.href=f,d&&b.setAttribute("nonce",d),document.head.appendChild(b),g)return new Promise((x,v)=>{b.addEventListener("load",x),b.addEventListener("error",()=>v(new Error(`Unable to preload CSS for ${f}`)))})}))}function a(l){const c=new Event("vite:preloadError",{cancelable:!0});if(c.payload=l,window.dispatchEvent(c),!c.defaultPrevented)throw l}return i.then(l=>{for(const c of l||[])c.status==="rejected"&&a(c.reason);return t().catch(a)})};function Pz(e,t={}){const n=new Map;let r,i=!1;const a=g=>t.onExecution?.(g),l=(g,h,b,x)=>{e.sendToolCallError(g.executionId,h,b),a({executionId:g.executionId,toolName:g.toolName,status:"failed",reason:h,startedAt:x,endedAt:Date.now()})},c=async g=>{const h=Date.now();if(!(t.tools??["eval_script"]).includes(g.toolName)){l(g,"unsupported_tool",`this client does not execute '${g.toolName}'`,h);return}const x=g.input?.script;if(typeof x!="string"){l(g,"invalid_input","expected a string `script` input",h);return}const v=new AbortController;n.set(g.executionId,v),a({executionId:g.executionId,toolName:g.toolName,status:"running",startedAt:h});try{const w=await Pl(()=>import("./index-DV4XHFya.js"),[]),k=w.createVfs(g.vfsSeed),C=Math.min(g.limits?.timeoutMs??Number.POSITIVE_INFINITY,t.timeoutMs??5e3),N=Math.min(g.limits?.memoryLimitBytes??Number.POSITIVE_INFINITY,t.memoryLimitBytes??64*1024*1024),A=t.execute?await t.execute({script:x,vfs:k,timeoutMs:C,memoryLimitBytes:N,signal:v.signal}):await(async()=>(r??=(t.loadEngine??jz)(),w.runScript(await r,{script:x,vfs:k,timeoutMs:C,memoryLimitBytes:N,signal:v.signal,fetchText:t.fetchText})))();if(i||!n.has(g.executionId))return;const R=A.logs.map(M=>`[${M.level}] ${M.text}`);A.ok?(e.sendToolCallResult(g.executionId,{type:"json",value:A.value},R),a({executionId:g.executionId,toolName:g.toolName,status:"settled",startedAt:h,endedAt:Date.now()})):(e.sendToolCallError(g.executionId,A.reason,A.error,R),a({executionId:g.executionId,toolName:g.toolName,status:"failed",reason:A.reason,startedAt:h,endedAt:Date.now()}))}catch(w){if(i||!n.has(g.executionId))return;l(g,"host_error",w instanceof Error?w.message:String(w),h)}finally{n.delete(g.executionId)}},d=e.on("toolCallRequest",g=>void c(g)),f=e.on("toolCallCanceled",({executionId:g,reason:h})=>{const b=n.get(g);b&&(b.abort(),n.delete(g),a({executionId:g,toolName:"",status:"canceled",reason:h,startedAt:Date.now(),endedAt:Date.now()}))});return{dispose:()=>{i=!0,d(),f();for(const g of n.values())g.abort();n.clear()}}}async function jz(){const[e,t]=await Promise.all([Pl(()=>import("./index-DV4XHFya.js"),[]),Pl(()=>import("./index-1rpBHb-o.js"),[])]);return e.loadEngine(t)}function Bz(e,t={}){const[n,r]=E.useState([]),i=E.useRef(t);return i.current=t,E.useEffect(()=>{if(!e||t.enabled===!1)return;const a=Pz(e,{get tools(){return i.current.tools},get timeoutMs(){return i.current.timeoutMs},get memoryLimitBytes(){return i.current.memoryLimitBytes},get loadEngine(){return i.current.loadEngine},get execute(){return i.current.execute},get fetchText(){return i.current.fetchText},onExecution:l=>{i.current.onExecution?.(l);const c=i.current.historyLimit??50;r(d=>[...d.filter(f=>f.executionId!==l.executionId),l].slice(-c))}});return()=>a.dispose()},[e,t.enabled]),{executions:n}}function Wl(e){return e===void 0||Number.isNaN(e)?"—":e===0?"$0.00":e<.01?"<$0.01":`$${e.toFixed(2)}`}function Hz(e){if(e<1e3)return`${Math.round(e)}ms`;const t=e/1e3;return t<60?`${t.toFixed(1)}s`:`${Math.floor(t/60)}m ${Math.round(t%60)}s`}function fs(e){return e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}k`:String(Math.round(e))}function jl(e){return e>=1024*1024?`${(e/(1024*1024)).toFixed(1)} MB`:e>=1024?`${(e/1024).toFixed(1)} KB`:`${e} B`}function Yb(e,t=Date.now()){const n=e-t;if(n<=0)return"now";const r=Math.ceil(n/6e4);if(r<1)return"<1m";if(r<60)return`${r}m`;const i=Math.floor(r/1440);return i>=1?`${i}d ${Math.floor(r%1440/60)}h`:`${Math.floor(r/60)}h ${r%60}m`}function Mp(e,t=Date.now()){if(!e)return"—";const n=Math.max(0,t-e),r=Math.floor(n/1e3);if(r<60)return"just now";const i=Math.floor(r/60);if(i<60)return`${i}m ago`;const a=Math.floor(i/60);return a<24?`${a}h ago`:`${Math.floor(a/24)}d ago`}function Uz(e){if(e==="five_hour")return"5-hour session";if(e==="seven_day")return"Weekly";if(e==="seven_day_oauth_apps")return"Weekly · apps";const t=n=>n.replace(/\b\w/g,r=>r.toUpperCase());return e.startsWith("seven_day_")?`Weekly · ${t(e.slice(10).replaceAll("_"," "))}`:t(e.replaceAll("_"," "))}function zz(e){if(e==="five_hour")return 5*3600;if(e.startsWith("seven_day"))return 7*86400}function Fz(e,t=Date.now()){const n=Math.max(0,Math.floor((t-e)/1e3));if(n<60)return`${n} sec${n===1?"":"s"} ago`;if(n<3600){const i=Math.floor(n/60);return`${i} min${i===1?"":"s"} ago`}const r=Math.floor(n/3600);return`${r} hour${r===1?"":"s"} ago`}function s_(e,t=80){if(e==null)return"";if(typeof e=="object"){const r=e,i=r.command??r.file_path??r.path??r.url??r.pattern??r.query??r.description;if(typeof i=="string")return i.length>t?i.slice(0,t-1)+"…":i}const n=JSON.stringify(e)??"";return n.length>t?n.slice(0,t-1)+"…":n}const $z=e=>e.replace(/\s*\(MCP\)$/i,"");function i_(e){const t=e.defaultPrompt?.trim()||`$${e.name}`;return/\s$/.test(t)?t:t+" "}function gC(e,t){const n=e.toLowerCase(),r=t.map(i=>i.toLowerCase());return r.some(i=>i.startsWith(n))?2:r.some(i=>i.includes(n))?1:0}function Vz({onSend:e,onInterrupt:t,busy:n,disabled:r,placeholder:i="Message the agent…",commands:a,skills:l,onSearchFiles:c,attachments:d,toolbar:f,className:g,ref:h}){const{bind:b,plainText:x,isEmpty:v,clear:w,focus:k}=rz(),C=E.useRef(null),[N,A]=E.useState(!1);E.useImperativeHandle(h,()=>({insertText:U=>{const j=x.length>0&&!/\s$/.test(x)?" ":"";b.ref.current?.appendText(j+U),k()}}),[b.ref,x,k]);const R=E.useMemo(()=>{const U=[],j=(l??[]).filter(X=>X.enabled);if(a&&a.length>0){const X=new Set,K=a.flatMap(F=>{const W=$z(F.name);return X.has(W)?[]:(X.add(W),[{...F,name:W}])});U.push(dC({onSearch:F=>{const W=[];for(const V of K){const H=gC(F,[V.name,...V.aliases??[],...V.name.split(":")]);H!==0&&W.push({score:H,suggestion:{value:V.name,label:`/${V.name}${V.argumentHint?` ${V.argumentHint}`:""}`,description:V.description}})}return W.sort((V,H)=>H.score-V.score),W.map(({suggestion:V})=>V)},onSelect:F=>F.value,chipClassName:"font-mono"}))}return j.length>0&&U.push(dC({char:"$",accessibilityLabel:"skill",onSearch:X=>{const K=[];for(const F of j){const W=gC(X,[F.name,...F.name.split(/[-:_]/)]);if(W===0)continue;const V=F.shortDescription??F.description;K.push({score:W,suggestion:{value:F.name,label:F.displayName??F.name,description:V?`Skill · ${V}`:"Skill · inserts a message you can edit",icon:m.jsx(Ap,{className:"size-3.5 text-fg-3"})}})}return K.sort((F,W)=>W.score-F.score),K.map(({suggestion:F})=>F)},insertAsText:X=>{const K=j.find(F=>F.name===X.value);return K?i_(K):`$${X.value} `}})),c&&U.push(sz({searchDebounceMs:150,onSearch:async(X,K)=>(await c(X,K)).map(W=>({value:W.relative,label:W.relative,description:W.path})),onSelect:X=>X.value,chipStyle:"inline",chipClassName:"font-mono",emptyMessage:"No matching files"})),U.length>0?U:void 0},[a,l,c]),M=d?.items??[],_=!r&&(!v||M.length>0)&&!d?.uploading&&!d?.hasFailure,D=()=>{_&&(e(x.trim(),d?.readyIds??[]),d?.clear(),w(),k())},I=U=>{U&&U.length>0&&d?.add(U)};return m.jsxs("div",{"data-slot":"composer",className:Ie("px-3 pb-3",g),children:[m.jsxs("div",{onDragOver:U=>{d&&!d.disabled&&(U.preventDefault(),A(!0))},onDragLeave:()=>A(!1),onDrop:U=>{!d||d.disabled||(U.preventDefault(),A(!1),I(U.dataTransfer.files))},className:Ie("mx-auto w-full max-w-3xl overflow-hidden rounded-lg border border-border bg-bg shadow-(--shadow-xs)","transition-colors focus-within:border-ring focus-within:ring-2 focus-within:ring-ring/30",N&&"border-ring ring-2 ring-ring/30",r&&"opacity-60"),children:[M.length>0&&d?m.jsx(qz,{attachments:d}):null,m.jsx(nz,{...b,triggers:R,onSubmit:D,disabled:r,placeholder:r?"Session ended":i,minHeight:28,maxHeight:192,"aria-label":"Message the agent",className:"px-3 pt-2.5 pb-1 text-body-sm text-text",onImagePaste:U=>d?.add([U])}),m.jsxs("div",{className:"flex items-center justify-between gap-2 px-2 pb-2",children:[m.jsxs("div",{className:"flex min-w-0 items-center gap-1",children:[d&&!d.disabled?m.jsxs(m.Fragment,{children:[m.jsx("input",{ref:C,type:"file",multiple:!0,accept:d.accept||void 0,className:"hidden",onChange:U=>{I(U.target.files),U.target.value=""}}),m.jsx(at,{variant:"ghost",size:"icon-sm","aria-label":"Attach files",disabled:r,onClick:()=>C.current?.click(),children:m.jsx(l7,{className:"size-4"})})]}):null,f]}),n&&!_?m.jsx(at,{variant:"outline",size:"icon-sm","aria-label":"Interrupt",className:"rounded-full",onClick:t,children:m.jsx(z7,{className:"size-3"})}):m.jsx(at,{size:"icon-sm","aria-label":"Send",className:"rounded-full",disabled:!_,onClick:D,children:m.jsx(Wj,{className:"size-4"})})]})]}),d?.error?m.jsxs("div",{className:"mx-auto mt-1 flex w-full max-w-3xl items-center gap-2 text-label text-danger",children:[m.jsx(wl,{className:"size-3 shrink-0"}),m.jsx("span",{className:"min-w-0 flex-1",children:d.error}),m.jsx("button",{type:"button",onClick:d.dismissError,"aria-label":"Dismiss",className:"shrink-0 opacity-70 hover:opacity-100",children:m.jsx(mi,{className:"size-3"})})]}):m.jsx("div",{className:"mx-auto mt-1 w-full max-w-3xl text-center text-label text-fg-4",children:"Enter to send · Shift+Enter for a new line"})]})}function qz({attachments:e}){return m.jsx("div",{className:"flex gap-2 overflow-x-auto border-b border-border px-2 py-2",children:e.items.map(t=>m.jsx(Yz,{item:t,onRetry:()=>e.retry(t.key),onRemove:()=>e.remove(t.key)},t.key))})}function Yz({item:e,onRetry:t,onRemove:n}){const r=e.status==="failed";return m.jsxs("div",{className:"group relative shrink-0",title:r?`${e.name} — ${e.error}`:`${e.name} · ${jl(e.bytes)}`,children:[m.jsx("div",{className:Ie("flex size-14 items-center justify-center overflow-hidden rounded-md border border-border bg-surface",r&&"border-danger/50"),children:e.previewUrl?m.jsx("img",{src:e.previewUrl,alt:e.name,className:"size-full object-cover"}):m.jsxs("div",{className:"flex flex-col items-center gap-0.5 text-fg-3",children:[m.jsx(Nx,{className:"size-4"}),m.jsx("span",{className:"max-w-12 truncate text-[9px] font-semibold uppercase",children:Gz(e.name)})]})}),e.status==="uploading"?m.jsx("div",{className:"absolute inset-0 flex items-center justify-center rounded-md bg-black/35",children:m.jsx(wn,{className:"size-4 text-white"})}):null,r?m.jsx("button",{type:"button",onClick:t,"aria-label":`Retry ${e.name}`,className:"absolute inset-0 flex items-center justify-center rounded-md bg-black/45 text-warning",children:m.jsx(_x,{className:"size-4"})}):null,m.jsx("button",{type:"button",onClick:n,"aria-label":`Remove ${e.name}`,className:"absolute -top-1 -right-1 flex size-4 items-center justify-center rounded-full border border-border bg-surface text-fg-3 shadow-(--shadow-xs) hover:text-fg-1",children:m.jsx(mi,{className:"size-2.5"})})]})}const Gz=e=>{const t=e.lastIndexOf(".");return t>0?e.slice(t+1).toUpperCase():"FILE"},Xz=e=>typeof CSS<"u"&&CSS.supports("color",e)?e:void 0,Kz=e=>e>=90?"bg-danger":e>=70?"bg-warning":"bg-accent";function Qz({usage:e,open:t,onOpenChange:n}){return m.jsx(Gl,{open:t,onOpenChange:n,children:m.jsxs(Xl,{children:[m.jsx(Kl,{title:"Context",description:e?.model}),m.jsx(Ql,{children:e?m.jsxs(m.Fragment,{children:[m.jsxs("div",{className:"flex items-baseline justify-between gap-4",children:[m.jsx("span",{className:"text-label text-fg-3",children:"Used"}),m.jsxs("span",{className:"font-mono text-body-sm text-fg-1",children:[fs(e.totalTokens)," / ",fs(e.maxTokens)," ·"," ",e.percentage.toFixed(0),"%"]})]}),m.jsx("div",{className:"mt-2 h-2 overflow-hidden rounded-full bg-border",children:m.jsx("div",{className:Ie("h-full rounded-full",Kz(e.percentage)),style:{width:`${Math.min(100,Math.max(2,e.percentage))}%`}})}),e.categories.length>0?m.jsxs("div",{className:"mt-5",children:[m.jsx("h3",{className:"text-label font-medium text-fg-3",children:"Breakdown"}),m.jsx("div",{className:"mt-2 flex flex-col gap-3",children:e.categories.map(r=>{const i=r.tokens/Math.max(e.maxTokens,1)*100,a=Xz(r.color);return m.jsxs("div",{children:[m.jsxs("div",{className:"flex items-baseline justify-between gap-3",children:[m.jsxs("span",{className:"flex min-w-0 items-center gap-2",children:[m.jsx("span",{className:"size-2 shrink-0 rounded-full bg-fg-4",style:a?{backgroundColor:a}:void 0}),m.jsx("span",{className:"truncate text-body-sm text-fg-1",children:r.name})]}),m.jsx("span",{className:"shrink-0 font-mono text-label text-fg-3",children:fs(r.tokens)})]}),m.jsx("div",{className:"mt-1 h-1 overflow-hidden rounded-full bg-border",children:m.jsx("div",{className:"h-full rounded-full bg-fg-4",style:{width:`${Math.min(100,i)}%`,backgroundColor:a}})})]},r.name)})})]}):null]}):m.jsx("p",{className:"py-6 text-center text-body-sm text-fg-4",children:"No reading yet — the context window is measured after a turn completes."})})]})})}function Wz({client:e,cwd:t,open:n,onOpenChange:r}){const[i,a]=E.useState(t),[l,c]=E.useState([]),[d,f]=E.useState(!1),[g,h]=E.useState(""),[b,x]=E.useState(),[v,w]=E.useState(),[k,C]=E.useState(!1),[N,A]=E.useState(),R=E.useCallback(async I=>{C(!0),A(void 0);try{const U=await e.listHostDir(I);a(U.path),c(U.entries),f(U.truncated??!1)}catch(U){A(U instanceof Error?U.message:"Could not read that directory")}finally{C(!1)}},[e]);E.useEffect(()=>{n&&(w(void 0),h(""),x(void 0),A(void 0),t&&R(t))},[n,t,R]),E.useEffect(()=>{if(!n||!t)return;const I=g.trim();if(!I){x(void 0);return}const U=setTimeout(()=>{e.findHostFiles(t,I,40).then(j=>x(j.matches)).catch(()=>x([]))},150);return()=>clearTimeout(U)},[e,t,g,n]);const M=async I=>{C(!0),A(void 0);try{const U=await e.readHostFile(I);w({path:U.path,bytes:U.bytes,content:U.encoding==="utf8"?U.content:"(binary file — not shown)"})}catch(U){A(U instanceof Error?U.message:"Could not read that file")}finally{C(!1)}},_=i&&t&&i!==t?i.slice(0,i.lastIndexOf("/"))||"/":void 0,D=b??l;return m.jsx(Gl,{open:n,onOpenChange:r,children:m.jsxs(Xl,{size:"lg",children:[m.jsx(Kl,{title:v?v.path.split("/").pop():"Files",description:v?v.path:i,actions:v?m.jsxs(at,{variant:"ghost",size:"xs",onClick:()=>w(void 0),children:[m.jsx(Hh,{className:"size-3.5"}),"Back"]}):_?m.jsxs(at,{variant:"ghost",size:"xs",onClick:()=>void R(_),children:[m.jsx(Hh,{className:"size-3.5"}),"Up"]}):null}),m.jsxs(Ql,{className:"flex flex-col gap-3",children:[N?m.jsx("div",{className:"rounded-md bg-danger-bg px-3 py-2 text-body-sm text-danger",children:N}):null,v?m.jsxs(m.Fragment,{children:[m.jsx("p",{className:"text-label text-fg-4",children:jl(v.bytes)}),m.jsx(mh,{code:v.content,label:v.path.split("/").pop()})]}):m.jsxs(m.Fragment,{children:[m.jsxs("div",{className:"relative",children:[m.jsx(Rx,{className:"absolute top-1/2 left-2 size-3.5 -translate-y-1/2 text-fg-4"}),m.jsx(un,{value:g,onChange:I=>h(I.target.value),placeholder:"Search this project…",className:"pl-7",spellCheck:!1})]}),k&&D.length===0?m.jsx("div",{className:"py-6 text-center",children:m.jsx(wn,{className:"size-4 text-fg-4"})}):D.length===0?m.jsx("p",{className:"py-6 text-center text-body-sm text-fg-4",children:b?"No matching files.":"This directory is empty."}):m.jsx("ul",{className:"flex flex-col",children:b?b.map(I=>m.jsx("li",{children:m.jsxs("button",{type:"button",onClick:()=>void M(I.path),className:"flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-left transition-colors hover:bg-surface-hover",children:[m.jsx(wp,{className:"size-3.5 shrink-0 text-fg-4"}),m.jsx("span",{className:"min-w-0 flex-1 truncate font-mono text-label text-fg-1",children:I.relative})]})},I.path)):l.map(I=>m.jsx("li",{children:m.jsxs("button",{type:"button",onClick:()=>I.type==="dir"?void R(I.path):void M(I.path),className:"flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-left transition-colors hover:bg-surface-hover",children:[m.jsx(Zz,{type:I.type}),m.jsxs("span",{className:"min-w-0 flex-1 truncate font-mono text-label text-fg-1",children:[I.name,I.type==="dir"?"/":""]}),I.bytes!==void 0?m.jsx("span",{className:"shrink-0 text-label text-fg-4",children:jl(I.bytes)}):null]})},I.path))}),d&&!b?m.jsx("p",{className:"text-label text-fg-4",children:"More entries than the server will return — use the search box."}):null]})]})]})})}function Zz({type:e}){return e==="dir"?m.jsx(cA,{className:"size-3.5 shrink-0 text-accent"}):e==="symlink"?m.jsx(fA,{className:"size-3.5 shrink-0 text-fg-4"}):m.jsx(wp,{className:"size-3.5 shrink-0 text-fg-4"})}const a_={connected:"success",failed:"danger","needs-auth":"warning",pending:"info",disabled:"neutral"};function Jz({client:e,sessionId:t,open:n,onOpenChange:r,canManageServers:i=!0}){const[a,l]=E.useState(),[c,d]=E.useState(),[f,g]=E.useState(!1),[h,b]=E.useState(),[x,v]=E.useState(),[w,k]=E.useState(),C=E.useCallback(async()=>{if(t){g(!0),d(void 0);try{l(await e.listMcpServers(t))}catch(_){d(_ instanceof Error?_.message:"Could not read MCP status")}finally{g(!1)}}},[e,t]);E.useEffect(()=>{n&&(v(void 0),k(void 0),C())},[n,C]);const N=async(_,D)=>{if(t){b(_),d(void 0);try{l(await e.mcpServerAction(t,_,D))}catch(I){d(I instanceof Error?I.message:`Could not ${D} ${_}`)}finally{b(void 0)}}},A=a?.find(_=>_.name===x),R=A?.tools?.find(_=>_.name===w),M=R?.name??A?.name??"MCP servers";return m.jsx(Gl,{open:n,onOpenChange:r,children:m.jsxs(Xl,{children:[m.jsx(Kl,{title:M,description:R?`${A?.name} tool`:A?A.serverInfo?.name:void 0,actions:x?m.jsxs(at,{variant:"ghost",size:"xs",onClick:()=>w?k(void 0):v(void 0),children:[m.jsx(Hh,{className:"size-3.5"}),"Back"]}):m.jsxs(at,{variant:"ghost",size:"xs",onClick:()=>void C(),disabled:f,children:[f?m.jsx(wn,{className:"size-3 text-current"}):m.jsx(_x,{className:"size-3"}),"Refresh"]})}),m.jsxs(Ql,{children:[c?m.jsx("div",{className:"mb-3 rounded-md bg-danger-bg px-3 py-2 text-body-sm text-danger",children:c}):null,R?m.jsx(nF,{tool:R}):A?m.jsx(tF,{server:A,busy:h===A.name,canManage:i,onAct:_=>void N(A.name,_),onSelectTool:k}):c&&!a?null:m.jsx(eF,{servers:a,loading:f,onSelect:v})]})]})})}function eF({servers:e,loading:t,onSelect:n}){if(t&&!e)return m.jsx("div",{className:"py-6 text-center",children:m.jsx(wn,{className:"size-4 text-fg-4"})});if(!e?.length)return m.jsx("p",{className:"py-6 text-center text-body-sm text-fg-4",children:"No MCP servers configured for this session."});const r=[...new Set(e.map(i=>i.scope??"other"))];return m.jsx("div",{className:"flex flex-col gap-4",children:r.map(i=>m.jsxs("div",{children:[m.jsx("h3",{className:"text-label font-medium text-fg-3 capitalize",children:i}),m.jsx("ul",{className:"mt-1 flex flex-col",children:e.filter(a=>(a.scope??"other")===i).map(a=>m.jsx("li",{children:m.jsxs("button",{type:"button",onClick:()=>n(a.name),className:"flex w-full items-center gap-2 rounded-md px-2 py-2 text-left transition-colors hover:bg-surface-hover",children:[m.jsx("span",{className:"min-w-0 flex-1 truncate text-body-sm text-fg-1",children:a.name}),a.tools?.length?m.jsxs("span",{className:"shrink-0 text-label text-fg-4",children:[a.tools.length," tools"]}):null,m.jsx(gn,{variant:a_[a.status]??"neutral",dot:!0,className:"shrink-0",children:a.status}),m.jsx(kp,{className:"size-3.5 shrink-0 text-fg-4"})]})},a.name))})]},i))})}function tF({server:e,busy:t,canManage:n,onAct:r,onSelectTool:i}){const a=e.status==="disabled";return m.jsxs("div",{className:"flex flex-col gap-4",children:[m.jsxs("div",{children:[m.jsx(ir,{label:"Status",children:m.jsx(gn,{variant:a_[e.status]??"neutral",dot:!0,children:e.status})}),e.transport?m.jsx(ir,{label:"Transport",children:e.transport}):null,e.scope?m.jsx(ir,{label:"Scope",children:e.scope}):null,e.serverInfo?m.jsxs(ir,{label:"Server",children:[e.serverInfo.name," ",e.serverInfo.version]}):null,e.command?m.jsx(ir,{label:"Command",mono:!0,children:[e.command,...e.args??[]].join(" ")}):null,e.url?m.jsx(ir,{label:"URL",mono:!0,children:e.url}):null]}),e.error?m.jsx("div",{className:"rounded-md bg-danger-bg px-3 py-2 text-body-sm break-words text-danger",children:e.error}):null,n?m.jsxs("div",{className:"flex gap-2",children:[m.jsxs(at,{variant:"outline",size:"sm",disabled:t,onClick:()=>r("reconnect"),children:[t?m.jsx(wn,{className:"size-3 text-current"}):m.jsx(_x,{className:"size-3"}),"Reconnect"]}),m.jsxs(at,{variant:"outline",size:"sm",disabled:t,onClick:()=>r(a?"enable":"disable"),children:[a?m.jsx(b7,{className:"size-3"}):m.jsx(m7,{className:"size-3"}),a?"Enable":"Disable"]})]}):null,m.jsxs("div",{children:[m.jsx("h3",{className:"text-label font-medium text-fg-3",children:"Tools"}),e.tools?.length?m.jsx("ul",{className:"mt-1 flex flex-col",children:e.tools.map(l=>m.jsx("li",{children:m.jsxs("button",{type:"button",onClick:()=>i(l.name),className:"flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-left transition-colors hover:bg-surface-hover",children:[m.jsx("span",{className:"min-w-0 flex-1 truncate font-mono text-label text-fg-1",children:l.name}),m.jsx(kp,{className:"size-3.5 shrink-0 text-fg-4"})]})},l.name))}):m.jsx("p",{className:"py-2 text-body-sm text-fg-4",children:e.status==="connected"?"This server exposes no tools.":"Tools are listed once the server connects."})]})]})}function nF({tool:e}){const t=e.annotations;return m.jsxs("div",{className:"flex flex-col gap-3",children:[e.description?m.jsx("p",{className:"text-body-sm whitespace-pre-wrap text-fg-2",children:e.description}):m.jsx("p",{className:"text-body-sm text-fg-4",children:"This tool carries no description."}),t?m.jsxs("div",{className:"flex flex-wrap gap-1.5",children:[t.readOnly?m.jsx(gn,{variant:"success",children:"read-only"}):null,t.destructive?m.jsx(gn,{variant:"danger",children:"destructive"}):null,t.openWorld?m.jsx(gn,{variant:"warning",children:"open world"}):null]}):null,e.inputSchema!==void 0?m.jsxs("div",{children:[m.jsx("h3",{className:"text-label font-medium text-fg-3",children:"Parameters"}),m.jsx("pre",{className:"mt-1 max-h-64 overflow-auto rounded-md bg-surface px-3 py-2 text-label text-fg-2",children:rF(e.inputSchema)})]}):m.jsx("p",{className:Ie("text-label text-fg-4"),children:"Parameters aren’t available: this engine names and describes each tool but reports no input schema."})]})}function rF(e){try{return JSON.stringify(e,null,2)}catch{return String(e)}}const o_={user:"Personal",repo:"This project",system:"System",admin:"Managed"};function sF({skills:e,open:t,onOpenChange:n,onUse:r}){const[i,a]=E.useState(),l=e?.find(c=>c.name===i);return m.jsx(Gl,{open:t,onOpenChange:c=>{c||a(void 0),n(c)},children:m.jsxs(Xl,{children:[m.jsx(Kl,{title:l?l.displayName??l.name:"Skills",description:l?l.name!==(l.displayName??l.name)?l.name:void 0:"Capabilities the agent can choose to use. Not commands — the model picks them from their descriptions.",actions:l?m.jsxs(at,{variant:"ghost",size:"xs",onClick:()=>a(void 0),children:[m.jsx(Hh,{className:"size-3.5"}),"Back"]}):void 0}),m.jsx(Ql,{children:l?m.jsx(aF,{skill:l,onUse:r,onUsed:()=>n(!1)}):m.jsx(iF,{skills:e,onSelect:a})})]})})}function iF({skills:e,onSelect:t}){if(!e)return m.jsx("p",{className:"py-6 text-center text-body-sm text-fg-4",children:"Skills are listed once the session connects — send a message first."});if(e.length===0)return m.jsx("p",{className:"py-6 text-center text-body-sm text-fg-4",children:"This session found no skills."});const n=[...new Set(e.map(r=>r.scope??"other"))];return m.jsx("div",{className:"flex flex-col gap-4",children:n.map(r=>m.jsxs("div",{children:[m.jsx("h3",{className:"text-label font-medium text-fg-3",children:o_[r]??r}),m.jsx("ul",{className:"mt-1 flex flex-col",children:e.filter(i=>(i.scope??"other")===r).map(i=>m.jsx("li",{children:m.jsxs("button",{type:"button",onClick:()=>t(i.name),className:"flex w-full items-start gap-2 rounded-md px-2 py-2 text-left transition-colors hover:bg-surface-hover",children:[m.jsxs("span",{className:"min-w-0 flex-1",children:[m.jsx("span",{className:"block truncate text-body-sm text-fg-1",children:i.displayName??i.name}),i.shortDescription??i.description?m.jsx("span",{className:"block truncate text-label text-fg-4",children:i.shortDescription??i.description}):null]}),i.enabled?null:m.jsx(gn,{variant:"neutral",className:"mt-0.5 shrink-0",children:"off"}),m.jsx(kp,{className:"mt-0.5 size-3.5 shrink-0 text-fg-4"})]})},i.name))})]},r))})}function aF({skill:e,onUse:t,onUsed:n}){return m.jsxs("div",{className:"flex flex-col gap-4",children:[m.jsxs("div",{children:[e.scope?m.jsx(ir,{label:"Scope",children:o_[e.scope]??e.scope}):null,m.jsx(ir,{label:"Status",children:m.jsx(gn,{variant:e.enabled?"success":"neutral",dot:!0,children:e.enabled?"enabled":"disabled"})})]}),e.description?m.jsxs("div",{children:[m.jsx("h3",{className:"text-label font-medium text-fg-3",children:"Description"}),m.jsx("p",{className:"mt-1 text-body-sm whitespace-pre-wrap text-fg-2",children:e.description})]}):m.jsx("p",{className:"text-body-sm text-fg-4",children:"This skill carries no description."}),t&&e.enabled?m.jsxs("div",{children:[m.jsx(at,{variant:"outline",size:"sm",onClick:()=>{t(e),n()},children:"Use this skill"}),m.jsx("p",{className:"mt-1.5 text-label text-fg-4",children:"Writes an opening message into the composer for you to edit — it isn’t sent, and there is no command that runs a skill directly."})]}):null]})}const Gb=e=>e==="default",z0=e=>e.replace(/\[.*\]$/,"");function bC(e){const t=e.toLowerCase().split("-");return t[0]==="claude"&&t.shift(),t[0]??""}function oF(e,t){if(t===e.value||t===e.resolvedModel)return!0;const n=z0(t);if(e.resolvedModel)return n===z0(e.resolvedModel);const r=bC(n);return r!==""&&r===bC(z0(e.value))}function lF(e,t){if(t)return e.filter(n=>!Gb(n.value)).find(n=>oF(n,t))}function l_({models:e,model:t,onModelChange:n,variant:r="toolbar",disabled:i,className:a}){const l=lF(e,t)??(t?void 0:e.find(c=>Gb(c.value)));return m.jsxs(uo,{items:e.map(c=>({value:c.value,label:c.displayName})),value:l?.value??null,onValueChange:c=>{typeof c!="string"||c===l?.value||n(Gb(c)?void 0:c)},disabled:i,children:[m.jsx(fo,{"aria-label":"Model",className:Ie(r==="toolbar"&&"h-6 max-w-56 border-transparent bg-transparent text-fg-3 hover:bg-surface-hover",a),children:m.jsx("span",{className:Ie("truncate",r==="toolbar"&&"font-mono text-label"),children:m.jsx(co,{placeholder:t??"model"})})}),m.jsx(ho,{className:"min-w-72",children:e.map(c=>m.jsxs(aa,{value:c.value,children:[m.jsx(ia,{children:m.jsx("span",{className:"font-medium",children:c.displayName})}),c.description?m.jsx("span",{className:"text-label text-fg-4",children:c.description}):null]},c.value))})]})}const Vh=[{value:"default",label:"Manual",shortLabel:"Manual",description:"Always ask before making changes",icon:dA},{value:"acceptEdits",label:"Accept edits",shortLabel:"Edits",description:"Automatically accept all file edits",icon:wx},{value:"plan",label:"Plan",shortLabel:"Plan",description:"Create a plan before making changes",icon:m9},{value:"auto",label:"Auto",shortLabel:"Auto",description:"Claude handles permission decisions",icon:nB},{value:"dontAsk",label:"Don't ask",shortLabel:"Don't ask",description:"Never ask — deny anything not pre-approved",icon:R7},{value:"bypassPermissions",label:"Bypass permissions",shortLabel:"Bypass",description:"Skip every approval — the agent is unsupervised",icon:wl,dangerous:!0}],uF=e=>Vh.find(t=>t.value===e);function rd({mode:e,onModeChange:t,modes:n,canBypass:r,variant:i="toolbar",disabled:a,className:l}){const c=e==="bypassPermissions",d=n?Vh.filter(g=>n.includes(g.value)):Vh,f=g=>g.value==="bypassPermissions"&&r===!1;return m.jsxs(uo,{items:d.map(g=>({value:g.value,label:g.label})),value:e??null,onValueChange:g=>{typeof g=="string"&&g!==e&&t(g)},disabled:a,children:[m.jsx(fo,{"aria-label":"Permission mode",className:Ie(i==="toolbar"&&"h-6 max-w-44 border-transparent bg-transparent hover:bg-surface-hover",c?"text-danger":i==="toolbar"?"text-fg-3":void 0,l),children:m.jsx("span",{className:Ie("truncate",i==="toolbar"&&"text-label"),children:m.jsx(co,{placeholder:"permissions"})})}),m.jsx(ho,{className:"min-w-64",children:d.map(g=>{const h=f(g);return m.jsxs(aa,{value:g.value,disabled:h,children:[m.jsx(ia,{children:m.jsxs("span",{className:"flex items-center gap-2",children:[m.jsx(g.icon,{className:Ie("size-3.5 shrink-0",g.dangerous?"text-danger":"text-fg-3")}),m.jsx("span",{className:Ie("font-medium",g.dangerous&&"text-danger"),children:g.label})]})}),m.jsx("span",{className:Ie("pl-5.5 text-label",h?"text-fg-4":g.dangerous?"text-danger/80":"text-fg-4"),children:h?"Only available to a session started in this mode":g.description})]},g.value)})})]})}function u_(e){switch(e){case"Bash":case"BashOutput":case"KillShell":return Ub;case"Read":return Nx;case"Write":return D7;case"Edit":case"MultiEdit":case"NotebookEdit":return c7;case"Glob":return P9;case"Grep":return Rx;case"WebFetch":return h9;case"WebSearch":return KS;case"Task":case"Agent":return bA;case"TodoWrite":return M7;case"Skill":return Ap;case"AskUserQuestion":return pA;case"CodexCommand":return Ub;case"CodexFileChange":return w9;case"CodexWebSearch":return KS;case"CodexImageGeneration":case"CodexImageView":return G9;default:return e.startsWith("mcp__")?y7:J7}}function cF({request:e,onApprove:t,onDeny:n,className:r}){const[i,a]=E.useState(!1),[l,c]=E.useState(!1),[d,f]=E.useState(""),g=x=>{const v=d.trim();n(e.id,v||void 0,x||void 0),f(""),c(!1)},h=s_(e.input),b=u_(e.toolName);return m.jsxs("div",{"data-slot":"permission-prompt",className:Ie("rounded-lg border border-warning/40 bg-warning-bg p-3",r),children:[m.jsxs("div",{className:"flex items-start gap-2.5",children:[m.jsx(dA,{className:"mt-0.5 size-4 shrink-0 text-warning"}),m.jsxs("div",{className:"min-w-0 flex-1",children:[m.jsx("div",{className:"text-body-sm font-medium text-fg-1",children:e.title??e.displayName??"Permission needed"}),e.description?m.jsx("div",{className:"mt-0.5 text-label text-fg-3",children:e.description}):null,e.decisionReason?m.jsx("div",{className:"mt-0.5 text-label text-fg-4",children:e.decisionReason}):null,m.jsxs("div",{className:"mt-1.5 flex min-w-0 items-center gap-2",children:[m.jsx(b,{className:"size-3 shrink-0 text-fg-3"}),m.jsx("span",{className:"shrink-0 font-mono text-label font-medium text-fg-2",children:e.toolName}),h?m.jsx("span",{className:"min-w-0 truncate font-mono text-label text-fg-4",children:h}):null]}),m.jsxs("button",{type:"button",className:"mt-1 font-mono text-label text-fg-3 underline-offset-2 hover:underline",onClick:()=>a(x=>!x),children:[i?"Hide":"Show"," ",e.toolName," input"]}),i?m.jsx("pre",{className:"mt-1.5 max-h-48 overflow-auto rounded-md bg-code-bg px-2.5 py-1.5 font-mono text-label whitespace-pre-wrap text-fg-2",children:JSON.stringify(e.input,null,2)}):null]}),m.jsxs("div",{className:"flex shrink-0 flex-wrap justify-end gap-1.5",children:[m.jsx(at,{size:"sm",onClick:()=>t(e.id),children:"Allow"}),m.jsx(at,{size:"sm",variant:"outline",onClick:()=>c(x=>!x),children:"Deny"}),m.jsx(at,{size:"sm",variant:"outline",onClick:()=>g(!0),children:"Deny & stop"})]})]}),l?m.jsxs("div",{className:"mt-2.5 flex items-center gap-2 border-t border-warning/30 pt-2.5",children:[m.jsx(un,{autoFocus:!0,value:d,onChange:x=>f(x.target.value),onKeyDown:x=>{x.key==="Enter"&&g(!1),x.key==="Escape"&&c(!1)},placeholder:"Reason (optional) — the agent reads this and can try something else",className:"h-7 flex-1"}),m.jsx(at,{size:"sm",variant:"outline",onClick:()=>c(!1),children:"Cancel"}),m.jsx(at,{size:"sm",variant:"destructive",onClick:()=>g(!1),children:"Deny"})]}):null]})}const xC=[{value:"auto",label:"Auto-answer",description:"pick each question’s recommended option"},{value:"ask",label:"Ask",description:"wait for a watcher or webhook controller to answer"},{value:"deny",label:"Disabled",description:"the agent is told to decide on its own"}];function c_(e){return(Array.isArray(e.questions)?e.questions:[]).flatMap(n=>{const r=n;if(typeof r.question!="string"||!Array.isArray(r.options))return[];const i=r.options.filter(a=>typeof a?.label=="string");return i.length===0?[]:[{question:r.question,header:typeof r.header=="string"?r.header:"",options:i,multiSelect:r.multiSelect===!0}]})}const nc={labels:[],other:"",otherActive:!1};function yC(e){const t=[...e.labels];return e.otherActive&&e.other.trim()&&t.push(e.other.trim()),t.join(", ")}function dF({request:e,onAnswer:t,onDismiss:n,className:r}){const i=c_(e.input),[a,l]=E.useState(()=>i.map(()=>nc)),c=(h,b)=>{l(x=>x.map((v,w)=>w===h?{...v,...b}:v))},d=(h,b,x)=>{const v=a[h]??nc;x?c(h,{labels:v.labels.includes(b)?v.labels.filter(w=>w!==b):[...v.labels,b]}):c(h,{labels:v.labels[0]===b?[]:[b],otherActive:!1})},f=i.every((h,b)=>yC(a[b]??nc)!==""),g=()=>{const h={};i.forEach((b,x)=>{h[b.question]=yC(a[x]??nc)}),t(e.id,{...e.input,answers:h})};return m.jsx("div",{"data-slot":"question-prompt",className:Ie("rounded-lg border border-info/40 bg-info-bg p-3",r),children:m.jsxs("div",{className:"flex items-start gap-2.5",children:[m.jsx(pA,{className:"mt-0.5 size-4 shrink-0 text-info"}),m.jsxs("div",{className:"flex min-w-0 flex-1 flex-col gap-3",children:[i.map((h,b)=>{const x=a[b]??nc;return m.jsxs("div",{className:"flex flex-col gap-1.5",children:[m.jsxs("div",{className:"flex items-center gap-2",children:[h.header?m.jsx(gn,{variant:"info",children:h.header}):null,m.jsx("span",{className:"text-body-sm font-medium text-fg-1",children:h.question})]}),m.jsxs("div",{className:"flex flex-col gap-1",children:[h.options.map(v=>{const w=x.labels.includes(v.label);return m.jsxs("button",{type:"button",onClick:()=>d(b,v.label,h.multiSelect===!0),className:Ie("rounded-md border px-2.5 py-1.5 text-left transition-colors",w?"border-info bg-bg":"border-border bg-bg/50 hover:border-border-strong hover:bg-bg"),children:[m.jsx("span",{className:"block text-body-sm font-medium text-fg-1",children:v.label}),v.description?m.jsx("span",{className:"block text-label text-fg-4",children:v.description}):null,w&&v.preview?m.jsx("pre",{className:"mt-1.5 max-h-40 overflow-auto rounded-md bg-code-bg px-2.5 py-1.5 font-mono text-label whitespace-pre-wrap text-fg-2",children:v.preview}):null]},v.label)}),m.jsxs("div",{className:"flex items-center gap-2",children:[m.jsx("button",{type:"button",onClick:()=>c(b,{otherActive:!x.otherActive}),className:Ie("shrink-0 rounded-md border px-2.5 py-1.5 text-body-sm font-medium transition-colors",x.otherActive?"border-info bg-bg text-fg-1":"border-border bg-bg/50 text-fg-3 hover:border-border-strong hover:bg-bg"),children:"Other…"}),x.otherActive?m.jsx(un,{autoFocus:!0,value:x.other,onChange:v=>c(b,{other:v.target.value}),placeholder:"Type your own answer",className:"flex-1"}):null]})]})]},b)}),m.jsx("div",{children:m.jsx(at,{size:"sm",onClick:g,disabled:!f,children:"Answer"})})]}),m.jsx(at,{variant:"ghost",size:"icon-sm","aria-label":"Dismiss question",className:"shrink-0",onClick:()=>n(e.id,"Question dismissed by user"),children:m.jsx(mi,{className:"size-3.5"})})]})})}function fF({state:e,client:t,sessionId:n,open:r,onOpenChange:i}){const a=e.session,l=e.permissionMode?uF(e.permissionMode):void 0;return m.jsx(Gl,{open:r,onOpenChange:i,children:m.jsxs(Xl,{children:[m.jsx(Kl,{title:"Session info",description:a?.title}),m.jsx(Ql,{children:m.jsxs("div",{className:"flex flex-col divide-y divide-border",children:[m.jsxs("div",{className:"pb-2",children:[m.jsx(ir,{label:"Engine",children:e.engine??"claude"}),a?.profile?m.jsx(ir,{label:"Profile",children:a.profile}):null,e.model?m.jsx(ir,{label:"Model",mono:!0,children:e.model}):null,l?m.jsx(ir,{label:"Permission mode",children:l.label}):null,a?.apiKeySource?m.jsx(ir,{label:"Credentials",children:a.apiKeySource}):null]}),m.jsxs("div",{className:"py-2",children:[e.cwd?m.jsx(F0,{label:"Working directory",value:e.cwd}):null,e.sdkSessionId?m.jsx(F0,{label:"Engine session id",value:e.sdkSessionId}):null,a?m.jsx(F0,{label:"Gateway session id",value:a.id}):null]}),m.jsxs("div",{className:"py-2",children:[a?.createdAt?m.jsx(ir,{label:"Started",children:Mp(a.createdAt)}):null,a?.numTurns!==void 0?m.jsx(ir,{label:"Turns",children:a.numTurns}):null,m.jsx(ir,{label:"Cost",mono:!0,children:Wl(e.totalCostUsd)})]}),e.capabilities.vfs?m.jsx(hF,{client:t,sessionId:n,open:r}):null]})})]})})}function F0({label:e,value:t}){return m.jsxs("div",{className:"flex items-start justify-between gap-2 py-1.5",children:[m.jsxs("div",{className:"min-w-0 flex-1",children:[m.jsx("div",{className:"text-label text-fg-3",children:e}),m.jsx("div",{className:"mt-0.5 font-mono text-label break-all text-fg-1",children:t})]}),m.jsx(Px,{value:t,"aria-label":`Copy ${e.toLowerCase()}`})]})}function hF({client:e,sessionId:t,open:n}){const[r,i]=E.useState(),[a,l]=E.useState(!1);return E.useEffect(()=>{if(!n||!t)return;let c=!1;return l(!0),e.listSessionFiles(t).then(d=>{c||i(d)}).catch(()=>{c||i([])}).finally(()=>{c||l(!1)}),()=>{c=!0}},[e,t,n]),m.jsxs("div",{className:"pt-3",children:[m.jsx("h3",{className:"text-label font-medium text-fg-3",children:"Files"}),a?m.jsx("div",{className:"py-3 text-center",children:m.jsx(wn,{className:"size-4 text-fg-4"})}):r?.length?m.jsx("ul",{className:"mt-1 flex flex-col",children:r.map(c=>m.jsx("li",{children:m.jsxs("a",{href:t?e.sessionFileUrl(t,c.path):void 0,className:"flex items-center gap-2 rounded-md px-1 py-1.5 hover:bg-surface-hover",children:[m.jsx(lA,{className:"size-3.5 shrink-0 text-fg-4"}),m.jsx("span",{className:"min-w-0 flex-1 truncate font-mono text-label text-fg-1",children:c.path}),m.jsx("span",{className:"shrink-0 text-label text-fg-4",children:jl(c.bytes)})]})},c.path))}):m.jsx("p",{className:"py-2 text-body-sm text-fg-4",children:"Nothing delivered yet."})]})}const d_={starting:{label:"Starting",variant:"info",busy:!0},running:{label:"Running",variant:"info",busy:!0},awaiting_approval:{label:"Needs approval",variant:"warning",busy:!0},idle:{label:"Idle",variant:"success",busy:!1},parked:{label:"Parked",variant:"accent",busy:!1},failed:{label:"Failed",variant:"danger",busy:!1},closed:{label:"Closed",variant:"neutral",busy:!1}};function pF(e=3e4){const[t,n]=E.useState(()=>Date.now());return E.useEffect(()=>{const r=setInterval(()=>n(Date.now()),e);return()=>clearInterval(r)},[e]),t}const f_=e=>e>=95?"text-danger":e>=80?"text-warning":"text-fg-3",mF=e=>typeof CSS<"u"&&CSS.supports("color",e)?e:void 0;function gF({usage:e}){return m.jsx(Dx,{content:m.jsxs("div",{className:"flex min-w-44 flex-col gap-1 py-0.5",children:[e.categories.map(t=>m.jsxs("div",{className:"flex items-center gap-2",children:[m.jsx("span",{className:"size-2 shrink-0 rounded-full bg-fg-4",style:mF(t.color)?{backgroundColor:t.color}:void 0}),m.jsx("span",{className:"flex-1",children:t.name}),m.jsx("span",{className:"font-mono text-fg-3",children:fs(t.tokens)})]},t.name)),m.jsxs("div",{className:"mt-0.5 flex items-center justify-between gap-2 border-t border-border pt-1",children:[m.jsx("span",{children:"Total"}),m.jsxs("span",{className:"font-mono text-fg-3",children:[fs(e.totalTokens)," / ",fs(e.maxTokens)," (",e.percentage.toFixed(0),"%)"]})]})]}),children:m.jsxs("span",{className:Ie("inline-flex cursor-default items-center gap-1 font-mono text-label",f_(e.percentage)),children:["Ctx ",fs(e.totalTokens)]})})}function EC({label:e,info:t,now:n}){const r=t.utilization,i=t.resetsAt!==void 0?t.resetsAt*1e3:void 0;return m.jsx(Dx,{content:m.jsxs("div",{className:"flex min-w-36 flex-col gap-1 py-0.5",children:[m.jsxs("div",{className:"flex items-center justify-between gap-2",children:[m.jsxs("span",{children:[e," usage"]}),m.jsx("span",{className:"font-mono text-fg-3",children:r!==void 0?`${r.toFixed(1)}%`:"—"})]}),i!==void 0?m.jsxs("div",{className:"flex items-center justify-between gap-2",children:[m.jsx("span",{children:"Resets in"}),m.jsx("span",{className:"font-mono text-fg-3",children:Yb(i,n)})]}):null,t.isUsingOverage?m.jsx("div",{className:"text-warning",children:"Using overage"}):null,t.status==="rejected"?m.jsx("div",{className:"text-danger",children:"Limit reached"}):null]}),children:m.jsxs("span",{className:Ie("inline-flex cursor-default items-center gap-1 font-mono text-label",t.status==="rejected"?"text-danger":f_(r??0)),children:[m.jsx(HA,{value:r??0}),e,r!==void 0?` ${r.toFixed(0)}%`:"",i!==void 0?m.jsxs("span",{className:"text-fg-4",children:["· ",Yb(i,n)]}):null]})})}function $0({onClick:e,hint:t,children:n}){return e?m.jsx("button",{type:"button",onClick:e,"aria-label":t,className:"rounded-md px-1 py-0.5 transition-colors outline-none hover:bg-surface-hover focus-visible:bg-surface-hover",children:n}):m.jsx(m.Fragment,{children:n})}function bF({state:e,connected:t,connection:n,onOpenStatus:r,onOpenContext:i,onOpenUsage:a,actions:l,className:c}){const d=d_[e.status],f=pF(),g=e.rateLimits?.five_hour,h=e.rateLimits?.seven_day,b=n??(t===!1?"reconnecting":"live");return m.jsxs("div",{"data-slot":"status-bar",className:Ie("flex items-center gap-2 border-b border-border bg-surface px-3 py-1.5",c),children:[m.jsx($0,{onClick:r,hint:"Session info",children:b==="live"?m.jsxs(gn,{variant:d.variant,dot:!d.busy,children:[d.busy?m.jsx(wn,{className:"size-3 text-current"}):null,d.label]}):m.jsxs(gn,{variant:b==="offline"?"danger":"warning",dot:!1,children:[b==="offline"?m.jsx(W7,{className:"size-3 text-current"}):m.jsx(Np,{className:"size-3 animate-spin text-current"}),b==="offline"?"Offline":"Reconnecting…"]})}),e.capabilities.contextUsage&&e.contextUsage?m.jsx($0,{onClick:i,hint:"Context breakdown",children:m.jsx(gF,{usage:e.contextUsage})}):null,g||h?m.jsx($0,{onClick:a,hint:"Plan usage",children:m.jsxs("span",{className:"inline-flex items-center gap-2",children:[g?m.jsx(EC,{label:"Session",info:g,now:f}):null,h?m.jsx(EC,{label:"Weekly",info:h,now:f}):null]})}):null,m.jsx("span",{className:"flex-1"}),m.jsx("span",{className:"font-mono text-label text-fg-3",children:Wl(e.totalCostUsd)}),l]})}/*!---------------------------------------------------------------------------------------------
534
+ * Copyright (c) StackBlitz. All rights reserved.
535
+ * Licensed under the MIT License. See License.txt in the project root for license information.
536
+ *--------------------------------------------------------------------------------------------*/const xF={damping:.7,stiffness:.05,mass:1.25},yF=70,EF=1e3/60,vF=350;let Lp=!1;globalThis.document?.addEventListener("mousedown",()=>{Lp=!0});globalThis.document?.addEventListener("mouseup",()=>{Lp=!1});globalThis.document?.addEventListener("click",()=>{Lp=!1});const TF=(e={})=>{const[t,n]=E.useState(!1),[r,i]=E.useState(e.initial!==!1),[a,l]=E.useState(!1),c=E.useRef(null);c.current=e;const d=E.useCallback(()=>{if(!Lp)return!1;const N=window.getSelection();if(!N||!N.rangeCount)return!1;const A=N.getRangeAt(0);return A.commonAncestorContainer.contains(k.current)||k.current?.contains(A.commonAncestorContainer)},[]),f=E.useCallback(N=>{h.isAtBottom=N,i(N)},[]),g=E.useCallback(N=>{h.escapedFromLock=N,n(N)},[]),h=E.useMemo(()=>{let N;return{escapedFromLock:t,isAtBottom:r,resizeDifference:0,accumulated:0,velocity:0,listeners:new Set,get scrollTop(){return k.current?.scrollTop??0},set scrollTop(A){if(k.current){const{scrollBehavior:R}=getComputedStyle(k.current);R!=="auto"&&(k.current.style.scrollBehavior="auto"),k.current.scrollTop=A,h.ignoreScrollToTop=k.current.scrollTop,R!=="auto"&&(k.current.style.scrollBehavior=R)}},get targetScrollTop(){return!k.current||!C.current?0:k.current.scrollHeight-1-k.current.clientHeight},get calculatedTargetScrollTop(){if(!k.current||!C.current)return 0;const{targetScrollTop:A}=this;if(!e.targetScrollTop)return A;if(N?.targetScrollTop===A)return N.calculatedScrollTop;const R=Math.max(Math.min(e.targetScrollTop(A,{scrollElement:k.current,contentElement:C.current}),A),0);return N={targetScrollTop:A,calculatedScrollTop:R},requestAnimationFrame(()=>{N=void 0}),R},get scrollDifference(){return this.calculatedTargetScrollTop-this.scrollTop},get isNearBottom(){return this.scrollDifference<=yF}}},[]),b=E.useCallback((N={})=>{typeof N=="string"&&(N={animation:N}),N.preserveScrollPosition||f(!0);const A=Date.now()+(Number(N.wait)||0),R=q0(c.current,N.animation),{ignoreEscapes:M=!1}=N;let _,D=h.calculatedTargetScrollTop;N.duration instanceof Promise?N.duration.finally(()=>{_=Date.now()}):_=A+(N.duration??0);const I=async()=>{const U=new Promise(requestAnimationFrame).then(()=>{if(!h.isAtBottom)return h.animation=void 0,!1;const{scrollTop:j}=h,X=performance.now(),K=(X-(h.lastTick??X))/EF;if(h.animation||(h.animation={behavior:R,promise:U,ignoreEscapes:M}),h.animation.behavior===R&&(h.lastTick=X),d()||A>Date.now())return I();if(j<Math.min(D,h.calculatedTargetScrollTop)){if(h.animation?.behavior===R){if(R==="instant")return h.scrollTop=h.calculatedTargetScrollTop,I();h.velocity=(R.damping*h.velocity+R.stiffness*h.scrollDifference)/R.mass,h.accumulated+=h.velocity*K,h.scrollTop+=h.accumulated,h.scrollTop!==j&&(h.accumulated=0)}return I()}return _>Date.now()?(D=h.calculatedTargetScrollTop,I()):(h.animation=void 0,h.scrollTop<h.calculatedTargetScrollTop?b({animation:q0(c.current,c.current.resize),ignoreEscapes:M,duration:Math.max(0,_-Date.now())||void 0}):h.isAtBottom)});return U.then(j=>(requestAnimationFrame(()=>{h.animation||(h.lastTick=void 0,h.velocity=0)}),j))};return N.wait!==!0&&(h.animation=void 0),h.animation?.behavior===R?h.animation.promise:I()},[f,d,h]),x=E.useCallback(()=>{g(!0),f(!1)},[g,f]),v=E.useCallback(({target:N})=>{if(N!==k.current)return;const{scrollTop:A,ignoreScrollToTop:R}=h;let{lastScrollTop:M=A}=h;h.lastScrollTop=A,h.ignoreScrollToTop=void 0,R&&R>A&&(M=R),l(h.isNearBottom),setTimeout(()=>{if(h.resizeDifference||A===R)return;if(d()){g(!0),f(!1);return}const _=A>M,D=A<M;if(h.animation?.ignoreEscapes){h.scrollTop=M;return}D&&(g(!0),f(!1)),_&&g(!1),!h.escapedFromLock&&h.isNearBottom&&f(!0)},1)},[g,f,d,h]),w=E.useCallback(({target:N,deltaY:A})=>{let R=N;for(;!["scroll","auto"].includes(getComputedStyle(R).overflow);){if(!R.parentElement)return;R=R.parentElement}R===k.current&&A<0&&k.current.scrollHeight>k.current.clientHeight&&!h.animation?.ignoreEscapes&&(g(!0),f(!1))},[g,f,h]),k=vC(N=>{k.current?.removeEventListener("scroll",v),k.current?.removeEventListener("wheel",w),N?.addEventListener("scroll",v,{passive:!0}),N?.addEventListener("wheel",w,{passive:!0})},[]),C=vC(N=>{if(h.resizeObserver?.disconnect(),h.resizeObserver=void 0,!N)return;let A;h.resizeObserver=new ResizeObserver(([R])=>{const{height:M}=R.contentRect,_=M-(A??M);if(h.resizeDifference=_,h.scrollTop>h.targetScrollTop&&(h.scrollTop=h.targetScrollTop),l(h.isNearBottom),_>=0){const D=q0(c.current,A?c.current.resize:c.current.initial);b({animation:D,wait:!0,preserveScrollPosition:!0,duration:D==="instant"?void 0:vF})}else h.isNearBottom&&(g(!1),f(!0));A=M,requestAnimationFrame(()=>{setTimeout(()=>{h.resizeDifference===_&&(h.resizeDifference=0)},1)})}),h.resizeObserver?.observe(N)},[]);return{contentRef:C,scrollRef:k,scrollToBottom:b,stopScroll:x,isAtBottom:r||a,isNearBottom:a,escapedFromLock:t,state:h}};function vC(e,t){const n=E.useCallback(r=>(n.current=r,e(r)),t);return n}const V0=new Map;function q0(...e){const t={...xF};let n=!1;for(const i of e){if(i==="instant"){n=!0;continue}typeof i=="object"&&(n=!1,t.damping=i.damping??t.damping,t.stiffness=i.stiffness??t.stiffness,t.mass=i.mass??t.mass)}const r=JSON.stringify(t);return V0.has(r)||V0.set(r,Object.freeze(t)),n?"instant":V0.get(r)}/*!---------------------------------------------------------------------------------------------
537
+ * Copyright (c) StackBlitz. All rights reserved.
538
+ * Licensed under the MIT License. See License.txt in the project root for license information.
539
+ *--------------------------------------------------------------------------------------------*/const h_=E.createContext(null),SF=typeof window<"u"?E.useLayoutEffect:E.useEffect;function qh({instance:e,children:t,resize:n,initial:r,mass:i,damping:a,stiffness:l,targetScrollTop:c,contextRef:d,...f}){const g=E.useRef(null),h=E.useCallback((M,_)=>(R?.targetScrollTop??c)?.(M,_)??M,[c]),b=TF({mass:i,damping:a,stiffness:l,resize:n,initial:r,targetScrollTop:h}),{scrollRef:x,contentRef:v,scrollToBottom:w,stopScroll:k,isAtBottom:C,escapedFromLock:N,state:A}=e??b,R=E.useMemo(()=>({scrollToBottom:w,stopScroll:k,scrollRef:x,isAtBottom:C,escapedFromLock:N,contentRef:v,state:A,get targetScrollTop(){return g.current},set targetScrollTop(M){g.current=M}}),[w,C,v,x,k,N,A]);return E.useImperativeHandle(d,()=>R,[R]),SF(()=>{x.current&&getComputedStyle(x.current).overflow==="visible"&&(x.current.style.overflow="auto")},[]),E.createElement(h_.Provider,{value:R},E.createElement("div",{...f},typeof t=="function"?t(R):t))}(function(e){function t({children:n,scrollClassName:r,...i}){const a=p_();return E.createElement("div",{ref:a.scrollRef,style:{height:"100%",width:"100%",scrollbarGutter:"stable both-edges"},className:r},E.createElement("div",{...i,ref:a.contentRef},typeof n=="function"?n(a):n))}e.Content=t})(qh||(qh={}));function p_(){const e=E.useContext(h_);if(!e)throw new Error("use-stick-to-bottom component context must be used within a StickToBottom component");return e}function CF({className:e,children:t,...n}){return m.jsx(qh,{"data-slot":"conversation",className:Ie("relative flex-1 overflow-y-auto",e),initial:"instant",resize:"smooth",role:"log",...n,children:t})}function kF({className:e,children:t,...n}){return m.jsx(qh.Content,{"data-slot":"conversation-content",className:Ie("mx-auto flex w-full max-w-3xl flex-col gap-4 px-4 py-4",e),...n,children:t})}function wF({className:e}){const{isAtBottom:t,scrollToBottom:n}=p_();return t?null:m.jsx(at,{variant:"outline",size:"icon","aria-label":"Scroll to bottom","data-slot":"conversation-scroll-button",className:Ie("absolute bottom-4 left-1/2 -translate-x-1/2 rounded-full shadow-(--shadow-md)",e),onClick:()=>void n(),children:m.jsx(Xj,{className:"size-4"})})}function NF({item:e,href:t,className:n}){const r=e.path.split("/").pop()||e.path;return m.jsxs("div",{"data-slot":"file-delivered",className:Ie("flex w-full items-center gap-3 rounded-lg border border-border bg-surface px-3 py-2.5",n),children:[m.jsx(Nx,{className:"size-4 shrink-0 text-fg-3"}),m.jsxs("div",{className:"min-w-0 flex-1",children:[m.jsx("div",{className:"truncate font-mono text-body-sm font-medium text-fg-1",children:r}),m.jsxs("div",{className:"truncate text-label text-fg-4",children:[jl(e.bytes),e.description?` · ${e.description}`:""]})]}),t?m.jsxs("a",{href:t,download:r,className:Ie("flex shrink-0 items-center gap-1.5 rounded-md border border-border px-2.5 py-1.5","text-body-sm text-fg-2 transition-colors hover:bg-surface-hover"),children:[m.jsx(lA,{className:"size-3.5"}),"Download"]}):null]})}function AF({label:e,className:t}){return m.jsxs("div",{"data-slot":"loader",className:Ie("flex items-center gap-2 py-1 text-body-sm text-fg-4",t),children:[m.jsx("span",{className:"flex items-center gap-1",children:[0,1,2].map(n=>m.jsx("span",{className:"size-1.5 animate-pulse rounded-full bg-fg-4",style:{animationDelay:`${n*160}ms`}},n))}),e?m.jsx("span",{children:e}):null]})}function TC({from:e,className:t,...n}){return m.jsx("div",{"data-slot":"message","data-from":e,className:Ie("flex w-full flex-col gap-1",e==="user"?"items-end":"items-start",t),...n})}function SC({className:e,...t}){return m.jsx("div",{"data-slot":"message-content",className:Ie("min-w-0 text-body-sm leading-6 text-fg-1","in-data-[from=user]:max-w-[85%] in-data-[from=user]:rounded-lg in-data-[from=user]:rounded-br-sm","in-data-[from=user]:bg-accent-bg in-data-[from=user]:px-3 in-data-[from=user]:py-2","in-data-[from=user]:whitespace-pre-wrap","in-data-[from=assistant]:w-full",e),...t})}function _F({text:e,className:t}){const n=Cz(e);if(n.length===0)return m.jsx("span",{className:t,children:e});const r=[];let i=0;for(const[a,l]of n.entries())l.start>i&&r.push(e.slice(i,l.start)),r.push(m.jsx("span",{className:Ie("font-mono",l.kind==="file"?"text-accent":"text-info"),children:l.text},`${l.start}-${a}`)),i=l.end;return i<e.length&&r.push(e.slice(i)),m.jsx("span",{className:t,children:r.map((a,l)=>m.jsx(E.Fragment,{children:a},l))})}const Dp=(function(e){if(e==null)return MF;if(typeof e=="function")return Pp(e);if(typeof e=="object")return Array.isArray(e)?RF(e):OF(e);if(typeof e=="string")return IF(e);throw new Error("Expected function, string, or object as test")});function RF(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=Dp(e[n]);return Pp(r);function r(...i){let a=-1;for(;++a<t.length;)if(t[a].apply(this,i))return!0;return!1}}function OF(e){const t=e;return Pp(n);function n(r){const i=r;let a;for(a in e)if(i[a]!==t[a])return!1;return!0}}function IF(e){return Pp(t);function t(n){return n&&n.type===e}}function Pp(e){return t;function t(n,r,i){return!!(LF(n)&&e.call(this,n,typeof r=="number"?r:void 0,i||void 0))}}function MF(){return!0}function LF(e){return e!==null&&typeof e=="object"&&"type"in e}const m_=[],bc=!0,Xb=!1,El="skip";function jx(e,t,n,r){let i;typeof t=="function"&&typeof n!="function"?(r=n,n=t):i=t;const a=Dp(i),l=r?-1:1;c(e,void 0,[])();function c(d,f,g){const h=d&&typeof d=="object"?d:{};if(typeof h.type=="string"){const x=typeof h.tagName=="string"?h.tagName:typeof h.name=="string"?h.name:void 0;Object.defineProperty(b,"name",{value:"node ("+(d.type+(x?"<"+x+">":""))+")"})}return b;function b(){let x=m_,v,w,k;if((!t||a(d,f,g[g.length-1]||void 0))&&(x=DF(n(d,g)),x[0]===Xb))return x;if("children"in d&&d.children){const C=d;if(C.children&&x[0]!==El)for(w=(r?C.children.length:-1)+l,k=g.concat(C);w>-1&&w<C.children.length;){const N=C.children[w];if(v=c(N,w,k)(),v[0]===Xb)return v;w=typeof v[1]=="number"?v[1]:w+l}}return x}}}function DF(e){return Array.isArray(e)?e:typeof e=="number"?[bc,e]:e==null?m_:[e]}function Ps(e,t,n,r){let i,a,l;typeof t=="function"&&typeof n!="function"?(a=void 0,l=t,i=n):(a=t,l=n,i=r),jx(e,a,c,i);function c(d,f){const g=f[f.length-1],h=g?g.children.indexOf(d):void 0;return l(d,h,g)}}const Bl={indicator:"indicator",textOnly:"text-only",remove:"remove"};function PF({defaultOrigin:e="",allowedLinkPrefixes:t=[],allowedImagePrefixes:n=[],allowDataImages:r=!1,allowedProtocols:i=[],blockedImageClass:a="inline-block bg-gray-200 dark:bg-gray-700 text-gray-600 dark:text-gray-400 px-3 py-1 rounded text-sm",blockedLinkClass:l="text-gray-500",linkBlockPolicy:c=Bl.indicator,imageBlockPolicy:d=Bl.indicator}){const f=t.length&&!t.every(h=>h==="*"),g=n.length&&!n.every(h=>h==="*");if(!e&&(f||g))throw new Error("defaultOrigin is required when allowedLinkPrefixes or allowedImagePrefixes are provided");return h=>{const b=FF(e,t,n,r,i,a,l,c,d);g_(h),Ps(h,b)}}function CC(e,t){if(typeof e!="string")return null;try{return new URL(e)}catch{if(t)try{return new URL(e,t)}catch{return null}if(e.startsWith("/")||e.startsWith("./")||e.startsWith("../"))try{return new URL(e,"http://example.com")}catch{return null}return null}}function jF(e){return typeof e!="string"?!1:e.startsWith("/")||e.startsWith("./")||e.startsWith("../")}const BF=new Set(["https:","http:","irc:","ircs:","mailto:","xmpp:","blob:"]),HF=new Set(["javascript:","data:","file:","vbscript:"]);function kC(e,t,n,r=!1,i=!1,a=[]){if(!e)return null;if(typeof e=="string"&&e.startsWith("#")&&!i)try{if(new URL(e,"http://example.com").hash===e)return e}catch{}if(typeof e=="string"&&e.startsWith("data:"))return i&&r&&e.startsWith("data:image/")?e:null;if(typeof e=="string"&&e.startsWith("blob:")){try{if(new URL(e).protocol==="blob:"&&e.length>5){const g=e.substring(5);if(g&&g.length>0&&g!=="invalid")return e}}catch{return null}return null}const l=CC(e,n);if(!l||HF.has(l.protocol)||!(BF.has(l.protocol)||a.includes(l.protocol)||a.includes("*")))return null;if(l.protocol==="mailto:"||!l.protocol.match(/^https?:$/))return l.href;const d=jF(e);return l&&t.some(f=>{const g=CC(f,n);return!g||g.origin!==l.origin?!1:l.href.startsWith(g.href)})?d?l.pathname+l.search+l.hash:l.href:t.includes("*")?l.protocol!=="https:"&&l.protocol!=="http:"?null:d?l.pathname+l.search+l.hash:l.href:null}function g_(e){if("children"in e&&Array.isArray(e.children)){e.children=e.children.filter(t=>t!=null);for(const t of e.children)g_(t)}}const Y0=Symbol("node-seen");function UF(e,t,n){return t===Bl.remove?{type:"remove"}:t===Bl.textOnly?{type:"replace",element:{type:"element",tagName:"span",properties:{},children:[...e.children]}}:{type:"replace",element:{type:"element",tagName:"span",properties:{title:"Blocked URL: "+String(e.properties.href),class:n},children:[...e.children,{type:"text",value:" [blocked]"}]}}}function zF(e,t,n){if(t===Bl.remove)return{type:"remove"};if(t===Bl.textOnly){const r=String(e.properties.alt||"");return r?{type:"replace",element:{type:"element",tagName:"span",properties:{},children:[{type:"text",value:r}]}}:{type:"remove"}}return{type:"replace",element:{type:"element",tagName:"span",properties:{class:n},children:[{type:"text",value:"[Image blocked: "+String(e.properties.alt||"No description")+"]"}]}}}const FF=(e,t,n,r,i,a,l,c,d)=>{const f=(g,h,b)=>{if(g.type!=="element"||g[Y0])return bc;if(g.tagName==="a"){const x=kC(g.properties.href,t,e,!1,!1,i);if(x===null){if(g[Y0]=!0,Ps(g,f),b&&typeof h=="number"){const v=UF(g,c,l);if(v.type==="remove")return b.children.splice(h,1),[El,h];b.children[h]=v.element}return El}else return g.properties.href=x,g.properties.target="_blank",g.properties.rel="noopener noreferrer",bc}if(g.tagName==="img"){const x=kC(g.properties.src,n,e,r,!0,i);if(x===null){if(g[Y0]=!0,Ps(g,f),b&&typeof h=="number"){const v=zF(g,d,a);if(v.type==="remove")return b.children.splice(h,1),[El,h];b.children[h]=v.element}return El}else return g.properties.src=x,bc}return bc};return f},b_=-1,jp=0,kc=1,Yh=2,Bx=3,Hx=4,Ux=5,zx=6,x_=7,y_=8,E_=typeof self=="object"?self:globalThis,wC=(e,t)=>{switch(e){case"Function":case"SharedWorker":case"Worker":case"eval":case"setInterval":case"setTimeout":throw new TypeError("unable to deserialize "+e)}return new E_[e](t)},$F=(e,t)=>{const n=(i,a)=>(e.set(a,i),i),r=i=>{if(e.has(i))return e.get(i);const[a,l]=t[i];switch(a){case jp:case b_:return n(l,i);case kc:{const c=n([],i);for(const d of l)c.push(r(d));return c}case Yh:{const c=n({},i);for(const[d,f]of l)c[r(d)]=r(f);return c}case Bx:return n(new Date(l),i);case Hx:{const{source:c,flags:d}=l;return n(new RegExp(c,d),i)}case Ux:{const c=n(new Map,i);for(const[d,f]of l)c.set(r(d),r(f));return c}case zx:{const c=n(new Set,i);for(const d of l)c.add(r(d));return c}case x_:{const{name:c,message:d}=l;return n(typeof E_[c]=="function"?wC(c,d):new Error(d),i)}case y_:return n(BigInt(l),i);case"BigInt":return n(Object(BigInt(l)),i);case"ArrayBuffer":return n(new Uint8Array(l).buffer,l);case"DataView":{const{buffer:c}=new Uint8Array(l);return n(new DataView(c),l)}}return n(wC(a,l),i)};return r},NC=e=>$F(new Map,e)(0),$a="",{toString:VF}={},{keys:qF}=Object,rc=e=>{const t=typeof e;if(t!=="object"||!e)return[jp,t];const n=VF.call(e).slice(8,-1);switch(n){case"Array":return[kc,$a];case"Object":return[Yh,$a];case"Date":return[Bx,$a];case"RegExp":return[Hx,$a];case"Map":return[Ux,$a];case"Set":return[zx,$a];case"DataView":return[kc,n]}return n.includes("Array")?[kc,n]:e instanceof Error?[x_,e.name||"Error"]:[Yh,n]},Wf=([e,t])=>e===jp&&(t==="function"||t==="symbol"),YF=(e,t,n,r)=>{const i=(l,c)=>{const d=r.push(l)-1;return n.set(c,d),d},a=l=>{if(n.has(l))return n.get(l);let[c,d]=rc(l);switch(c){case jp:{let g=l;switch(d){case"bigint":c=y_,g=l.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+d);g=null;break;case"undefined":return i([b_],l)}return i([c,g],l)}case kc:{if(d){let b=l;return d==="DataView"?b=new Uint8Array(l.buffer):d==="ArrayBuffer"&&(b=new Uint8Array(l)),i([d,[...b]],l)}const g=[],h=i([c,g],l);for(const b of l)g.push(a(b));return h}case Yh:{if(d)switch(d){case"BigInt":return i([d,l.toString()],l);case"Boolean":case"Number":case"String":return i([d,l.valueOf()],l)}if(t&&"toJSON"in l)return a(l.toJSON());const g=[],h=i([c,g],l);for(const b of qF(l))(e||!Wf(rc(l[b])))&&g.push([a(b),a(l[b])]);return h}case Bx:return i([c,isNaN(l.getTime())?$a:l.toISOString()],l);case Hx:{const{source:g,flags:h}=l;return i([c,{source:g,flags:h}],l)}case Ux:{const g=[],h=i([c,g],l);for(const[b,x]of l)(e||!(Wf(rc(b))||Wf(rc(x))))&&g.push([a(b),a(x)]);return h}case zx:{const g=[],h=i([c,g],l);for(const b of l)(e||!Wf(rc(b)))&&g.push(a(b));return h}}const{message:f}=l;return i([c,{name:d,message:f}],l)};return a},AC=(e,{json:t,lossy:n}={})=>{const r=[];return YF(!(t||n),!!t,new Map,r)(e),r},po=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?NC(AC(e,t)):structuredClone(e):(e,t)=>NC(AC(e,t));class sd{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}sd.prototype.normal={};sd.prototype.property={};sd.prototype.space=void 0;function v_(e,t){const n={},r={};for(const i of e)Object.assign(n,i.property),Object.assign(r,i.normal);return new sd(n,r,t)}function Yc(e){return e.toLowerCase()}class Mr{constructor(t,n){this.attribute=n,this.property=t}}Mr.prototype.attribute="";Mr.prototype.booleanish=!1;Mr.prototype.boolean=!1;Mr.prototype.commaOrSpaceSeparated=!1;Mr.prototype.commaSeparated=!1;Mr.prototype.defined=!1;Mr.prototype.mustUseProperty=!1;Mr.prototype.number=!1;Mr.prototype.overloadedBoolean=!1;Mr.prototype.property="";Mr.prototype.spaceSeparated=!1;Mr.prototype.space=void 0;let GF=0;const mt=ko(),Mn=ko(),Kb=ko(),He=ko(),nn=ko(),to=ko(),zr=ko();function ko(){return 2**++GF}const Qb=Object.freeze(Object.defineProperty({__proto__:null,boolean:mt,booleanish:Mn,commaOrSpaceSeparated:zr,commaSeparated:to,number:He,overloadedBoolean:Kb,spaceSeparated:nn},Symbol.toStringTag,{value:"Module"})),G0=Object.keys(Qb);class Fx extends Mr{constructor(t,n,r,i){let a=-1;if(super(t,n),_C(this,"space",i),typeof r=="number")for(;++a<G0.length;){const l=G0[a];_C(this,G0[a],(r&Qb[l])===Qb[l])}}}Fx.prototype.defined=!0;function _C(e,t,n){n&&(e[t]=n)}function Zl(e){const t={},n={};for(const[r,i]of Object.entries(e.properties)){const a=new Fx(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(a.mustUseProperty=!0),t[r]=a,n[Yc(r)]=r,n[Yc(a.attribute)]=r}return new sd(t,n,e.space)}const T_=Zl({properties:{ariaActiveDescendant:null,ariaAtomic:Mn,ariaAutoComplete:null,ariaBusy:Mn,ariaChecked:Mn,ariaColCount:He,ariaColIndex:He,ariaColSpan:He,ariaControls:nn,ariaCurrent:null,ariaDescribedBy:nn,ariaDetails:null,ariaDisabled:Mn,ariaDropEffect:nn,ariaErrorMessage:null,ariaExpanded:Mn,ariaFlowTo:nn,ariaGrabbed:Mn,ariaHasPopup:null,ariaHidden:Mn,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:nn,ariaLevel:He,ariaLive:null,ariaModal:Mn,ariaMultiLine:Mn,ariaMultiSelectable:Mn,ariaOrientation:null,ariaOwns:nn,ariaPlaceholder:null,ariaPosInSet:He,ariaPressed:Mn,ariaReadOnly:Mn,ariaRelevant:null,ariaRequired:Mn,ariaRoleDescription:nn,ariaRowCount:He,ariaRowIndex:He,ariaRowSpan:He,ariaSelected:Mn,ariaSetSize:He,ariaSort:null,ariaValueMax:He,ariaValueMin:He,ariaValueNow:He,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function S_(e,t){return t in e?e[t]:t}function C_(e,t){return S_(e,t.toLowerCase())}const XF=Zl({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:to,acceptCharset:nn,accessKey:nn,action:null,allow:null,allowFullScreen:mt,allowPaymentRequest:mt,allowUserMedia:mt,alpha:mt,alt:null,as:null,async:mt,autoCapitalize:null,autoComplete:nn,autoFocus:mt,autoPlay:mt,blocking:nn,capture:null,charSet:null,checked:mt,cite:null,className:nn,closedBy:null,colorSpace:null,cols:He,colSpan:He,command:null,commandFor:null,content:null,contentEditable:Mn,controls:mt,controlsList:nn,coords:He|to,crossOrigin:null,data:null,dateTime:null,decoding:null,default:mt,defer:mt,dir:null,dirName:null,disabled:mt,download:Kb,draggable:Mn,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:mt,formTarget:null,headers:nn,height:He,hidden:Kb,high:He,href:null,hrefLang:null,htmlFor:nn,httpEquiv:nn,id:null,imageSizes:null,imageSrcSet:null,inert:mt,inputMode:null,integrity:null,is:null,isMap:mt,itemId:null,itemProp:nn,itemRef:nn,itemScope:mt,itemType:nn,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:mt,low:He,manifest:null,max:null,maxLength:He,media:null,method:null,min:null,minLength:He,multiple:mt,muted:mt,name:null,nonce:null,noModule:mt,noValidate:mt,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:mt,optimum:He,pattern:null,ping:nn,placeholder:null,playsInline:mt,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:mt,referrerPolicy:null,rel:nn,required:mt,reversed:mt,rows:He,rowSpan:He,sandbox:nn,scope:null,scoped:mt,seamless:mt,selected:mt,shadowRootClonable:mt,shadowRootCustomElementRegistry:mt,shadowRootDelegatesFocus:mt,shadowRootMode:null,shadowRootSerializable:mt,shape:null,size:He,sizes:null,slot:null,span:He,spellCheck:Mn,src:null,srcDoc:null,srcLang:null,srcSet:null,start:He,step:null,style:null,tabIndex:He,target:null,title:null,translate:null,type:null,typeMustMatch:mt,useMap:null,value:Mn,width:He,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:nn,axis:null,background:null,bgColor:null,border:He,borderColor:null,bottomMargin:He,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:mt,declare:mt,event:null,face:null,frame:null,frameBorder:null,hSpace:He,leftMargin:He,link:null,longDesc:null,lowSrc:null,marginHeight:He,marginWidth:He,noResize:mt,noHref:mt,noShade:mt,noWrap:mt,object:null,profile:null,prompt:null,rev:null,rightMargin:He,rules:null,scheme:null,scrolling:Mn,standby:null,summary:null,text:null,topMargin:He,valueType:null,version:null,vAlign:null,vLink:null,vSpace:He,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:mt,disablePictureInPicture:mt,disableRemotePlayback:mt,exportParts:to,part:nn,prefix:null,property:null,results:He,security:null,unselectable:null},space:"html",transform:C_}),KF=Zl({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:zr,accentHeight:He,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:He,amplitude:He,arabicForm:null,ascent:He,attributeName:null,attributeType:null,azimuth:He,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:He,by:null,calcMode:null,capHeight:He,className:nn,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:He,diffuseConstant:He,direction:null,display:null,dur:null,divisor:He,dominantBaseline:null,download:mt,dx:null,dy:null,edgeMode:null,editable:null,elevation:He,enableBackground:null,end:null,event:null,exponent:He,externalResourcesRequired:null,fill:null,fillOpacity:He,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:to,g2:to,glyphName:to,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:He,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:He,horizOriginX:He,horizOriginY:He,id:null,ideographic:He,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:He,k:He,k1:He,k2:He,k3:He,k4:He,kernelMatrix:zr,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:He,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:He,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:He,overlineThickness:He,paintOrder:null,panose1:null,path:null,pathLength:He,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:nn,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:He,pointsAtY:He,pointsAtZ:He,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:zr,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:zr,rev:zr,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:zr,requiredFeatures:zr,requiredFonts:zr,requiredFormats:zr,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:He,specularExponent:He,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:He,strikethroughThickness:He,string:null,stroke:null,strokeDashArray:zr,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:He,strokeOpacity:He,strokeWidth:null,style:null,surfaceScale:He,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:zr,tabIndex:He,tableValues:null,target:null,targetX:He,targetY:He,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:zr,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:He,underlineThickness:He,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:He,values:null,vAlphabetic:He,vMathematical:He,vectorEffect:null,vHanging:He,vIdeographic:He,version:null,vertAdvY:He,vertOriginX:He,vertOriginY:He,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:He,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:S_}),k_=Zl({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()}}),w_=Zl({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:C_}),N_=Zl({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),QF={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"},WF=/[A-Z]/g,RC=/-[a-z]/g,ZF=/^data[-\w.:]+$/i;function Bp(e,t){const n=Yc(t);let r=t,i=Mr;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&ZF.test(t)){if(t.charAt(4)==="-"){const a=t.slice(5).replace(RC,e$);r="data"+a.charAt(0).toUpperCase()+a.slice(1)}else{const a=t.slice(4);if(!RC.test(a)){let l=a.replace(WF,JF);l.charAt(0)!=="-"&&(l="-"+l),t="data"+l}}i=Fx}return new i(r,t)}function JF(e){return"-"+e.toLowerCase()}function e$(e){return e.charAt(1).toUpperCase()}const id=v_([T_,XF,k_,w_,N_],"html"),ga=v_([T_,KF,k_,w_,N_],"svg");function OC(e){const t=[],n=String(e||"");let r=n.indexOf(","),i=0,a=!1;for(;!a;){r===-1&&(r=n.length,a=!0);const l=n.slice(i,r).trim();(l||!a)&&t.push(l),i=r+1,r=n.indexOf(",",i)}return t}function A_(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const IC=/[#.]/g;function t$(e,t){const n=e||"",r={};let i=0,a,l;for(;i<n.length;){IC.lastIndex=i;const c=IC.exec(n),d=n.slice(i,c?c.index:n.length);d&&(a?a==="#"?r.id=d:Array.isArray(r.className)?r.className.push(d):r.className=[d]:l=d,i+=d.length),c&&(a=c[0],i++)}return{type:"element",tagName:l||t||"div",properties:r,children:[]}}function MC(e){const t=String(e||"").trim();return t?t.split(/[ \t\n\r\f]+/g):[]}function __(e){return e.join(" ").trim()}function R_(e,t,n){const r=n?i$(n):void 0;function i(a,l,...c){let d;if(a==null){d={type:"root",children:[]};const f=l;c.unshift(f)}else{d=t$(a,t);const f=d.tagName.toLowerCase(),g=r?r.get(f):void 0;if(d.tagName=g||f,n$(l))c.unshift(l);else for(const[h,b]of Object.entries(l))r$(e,d.properties,h,b)}for(const f of c)Wb(d.children,f);return d.type==="element"&&d.tagName==="template"&&(d.content={type:"root",children:d.children},d.children=[]),d}return i}function n$(e){if(e===null||typeof e!="object"||Array.isArray(e))return!0;if(typeof e.type!="string")return!1;const t=e,n=Object.keys(e);for(const r of n){const i=t[r];if(i&&typeof i=="object"){if(!Array.isArray(i))return!0;const a=i;for(const l of a)if(typeof l!="number"&&typeof l!="string")return!0}}return!!("children"in e&&Array.isArray(e.children))}function r$(e,t,n,r){const i=Bp(e,n);let a;if(r!=null){if(typeof r=="number"){if(Number.isNaN(r))return;a=r}else typeof r=="boolean"?a=r:typeof r=="string"?i.spaceSeparated?a=MC(r):i.commaSeparated?a=OC(r):i.commaOrSpaceSeparated?a=MC(OC(r).join(" ")):a=LC(i,i.property,r):Array.isArray(r)?a=[...r]:a=i.property==="style"?s$(r):String(r);if(Array.isArray(a)){const l=[];for(const c of a)l.push(LC(i,i.property,c));a=l}i.property==="className"&&Array.isArray(t.className)&&(a=t.className.concat(a)),t[i.property]=a}}function Wb(e,t){if(t!=null)if(typeof t=="number"||typeof t=="string")e.push({type:"text",value:String(t)});else if(Array.isArray(t))for(const n of t)Wb(e,n);else if(typeof t=="object"&&"type"in t)t.type==="root"?Wb(e,t.children):e.push(t);else throw new Error("Expected node, nodes, or string, got `"+t+"`")}function LC(e,t,n){if(typeof n=="string"){if(e.number&&n&&!Number.isNaN(Number(n)))return Number(n);if((e.boolean||e.overloadedBoolean)&&(n===""||Yc(n)===Yc(t)))return!0}return n}function s$(e){const t=[];for(const[n,r]of Object.entries(e))t.push([n,r].join(": "));return t.join("; ")}function i$(e){const t=new Map;for(const n of e)t.set(n.toLowerCase(),n);return t}const a$=["altGlyph","altGlyphDef","altGlyphItem","animateColor","animateMotion","animateTransform","clipPath","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","foreignObject","glyphRef","linearGradient","radialGradient","solidColor","textArea","textPath"],o$=R_(id,"div"),l$=R_(ga,"g",a$);function u$(e){const t=String(e),n=[];return{toOffset:i,toPoint:r};function r(a){if(typeof a=="number"&&a>-1&&a<=t.length){let l=0;for(;;){let c=n[l];if(c===void 0){const d=DC(t,n[l-1]);c=d===-1?t.length+1:d+1,n[l]=c}if(c>a)return{line:l+1,column:a-(l>0?n[l-1]:0)+1,offset:a};l++}}}function i(a){if(a&&typeof a.line=="number"&&typeof a.column=="number"&&!Number.isNaN(a.line)&&!Number.isNaN(a.column)){for(;n.length<a.line;){const c=n[n.length-1],d=DC(t,c),f=d===-1?t.length+1:d+1;if(c===f)break;n.push(f)}const l=(a.line>1?n[a.line-2]:0)+a.column-1;if(l<n[a.line-1])return l}}}function DC(e,t){const n=e.indexOf("\r",t),r=e.indexOf(`
540
+ `,t);return r===-1?n:n===-1||n+1===r?r:n<r?n:r}const Wa={html:"http://www.w3.org/1999/xhtml",mathml:"http://www.w3.org/1998/Math/MathML",svg:"http://www.w3.org/2000/svg",xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"},O_={}.hasOwnProperty,c$=Object.prototype;function d$(e,t){const n=t||{};return $x({file:n.file||void 0,location:!1,schema:n.space==="svg"?ga:id,verbose:n.verbose||!1},e)}function $x(e,t){let n;switch(t.nodeName){case"#comment":{const r=t;return n={type:"comment",value:r.data},xh(e,r,n),n}case"#document":case"#document-fragment":{const r=t,i="mode"in r?r.mode==="quirks"||r.mode==="limited-quirks":!1;if(n={type:"root",children:I_(e,t.childNodes),data:{quirksMode:i}},e.file&&e.location){const a=String(e.file),l=u$(a),c=l.toPoint(0),d=l.toPoint(a.length);n.position={start:c,end:d}}return n}case"#documentType":{const r=t;return n={type:"doctype"},xh(e,r,n),n}case"#text":{const r=t;return n={type:"text",value:r.value},xh(e,r,n),n}default:return n=f$(e,t),n}}function I_(e,t){let n=-1;const r=[];for(;++n<t.length;){const i=$x(e,t[n]);r.push(i)}return r}function f$(e,t){const n=e.schema;e.schema=t.namespaceURI===Wa.svg?ga:id;let r=-1;const i={};for(;++r<t.attrs.length;){const c=t.attrs[r],d=(c.prefix?c.prefix+":":"")+c.name;O_.call(c$,d)||(i[d]=c.value)}const l=(e.schema.space==="svg"?l$:o$)(t.tagName,i,I_(e,t.childNodes));if(xh(e,t,l),l.tagName==="template"){const c=t,d=c.sourceCodeLocation,f=d&&d.startTag&&vl(d.startTag),g=d&&d.endTag&&vl(d.endTag),h=$x(e,c.content);f&&g&&e.file&&(h.position={start:f.end,end:g.start}),l.content=h}return e.schema=n,l}function xh(e,t,n){if("sourceCodeLocation"in t&&t.sourceCodeLocation&&e.file){const r=h$(e,n,t.sourceCodeLocation);r&&(e.location=!0,n.position=r)}}function h$(e,t,n){const r=vl(n);if(t.type==="element"){const i=t.children[t.children.length-1];if(r&&!n.endTag&&i&&i.position&&i.position.end&&(r.end=Object.assign({},i.position.end)),e.verbose){const a={};let l;if(n.attrs)for(l in n.attrs)O_.call(n.attrs,l)&&(a[Bp(e.schema,l).property]=vl(n.attrs[l]));n.startTag;const c=vl(n.startTag),d=n.endTag?vl(n.endTag):void 0,f={opening:c};d&&(f.closing=d),f.properties=a,t.data={position:f}}}return r}function vl(e){const t=PC({line:e.startLine,column:e.startCol,offset:e.startOffset}),n=PC({line:e.endLine,column:e.endCol,offset:e.endOffset});return t||n?{start:t,end:n}:void 0}function PC(e){return e.line&&e.column?e:void 0}const jC={}.hasOwnProperty;function M_(e,t){const n=t||{};function r(i,...a){let l=r.invalid;const c=r.handlers;if(i&&jC.call(i,e)){const d=String(i[e]);l=jC.call(c,d)?c[d]:r.unknown}if(l)return l.call(this,i,...a)}return r.handlers=n.handlers||{},r.invalid=n.invalid,r.unknown=n.unknown,r}const p$={},m$={}.hasOwnProperty,L_=M_("type",{handlers:{root:b$,element:T$,text:E$,comment:v$,doctype:y$}});function g$(e,t){const r=(t||p$).space;return L_(e,r==="svg"?ga:id)}function b$(e,t){const n={nodeName:"#document",mode:(e.data||{}).quirksMode?"quirks":"no-quirks",childNodes:[]};return n.childNodes=Vx(e.children,n,t),Jl(e,n),n}function x$(e,t){const n={nodeName:"#document-fragment",childNodes:[]};return n.childNodes=Vx(e.children,n,t),Jl(e,n),n}function y$(e){const t={nodeName:"#documentType",name:"html",publicId:"",systemId:"",parentNode:null};return Jl(e,t),t}function E$(e){const t={nodeName:"#text",value:e.value,parentNode:null};return Jl(e,t),t}function v$(e){const t={nodeName:"#comment",data:e.value,parentNode:null};return Jl(e,t),t}function T$(e,t){const n=t;let r=n;e.type==="element"&&e.tagName.toLowerCase()==="svg"&&n.space==="html"&&(r=ga);const i=[];let a;if(e.properties){for(a in e.properties)if(a!=="children"&&m$.call(e.properties,a)){const d=S$(r,a,e.properties[a]);d&&i.push(d)}}const l=r.space,c={nodeName:e.tagName,tagName:e.tagName,attrs:i,namespaceURI:Wa[l],childNodes:[],parentNode:null};return c.childNodes=Vx(e.children,c,r),Jl(e,c),e.tagName==="template"&&e.content&&(c.content=x$(e.content,r)),c}function S$(e,t,n){const r=Bp(e,t);if(n===!1||n===null||n===void 0||typeof n=="number"&&Number.isNaN(n)||!n&&r.boolean)return;Array.isArray(n)&&(n=r.commaSeparated?A_(n):__(n));const i={name:r.attribute,value:n===!0?"":String(n)};if(r.space&&r.space!=="html"&&r.space!=="svg"){const a=i.name.indexOf(":");a<0?i.prefix="":(i.name=i.name.slice(a+1),i.prefix=r.attribute.slice(0,a)),i.namespace=Wa[r.space]}return i}function Vx(e,t,n){let r=-1;const i=[];if(e)for(;++r<e.length;){const a=L_(e[r],n);a.parentNode=t,i.push(a)}return i}function Jl(e,t){const n=e.position;n&&n.start&&n.end&&(n.start.offset,n.end.offset,t.sourceCodeLocation={startLine:n.start.line,startCol:n.start.column,startOffset:n.start.offset,endLine:n.end.line,endCol:n.end.column,endOffset:n.end.offset})}const C$=["area","base","basefont","bgsound","br","col","command","embed","frame","hr","image","img","input","keygen","link","meta","param","source","track","wbr"],k$=new Set([65534,65535,131070,131071,196606,196607,262142,262143,327678,327679,393214,393215,458750,458751,524286,524287,589822,589823,655358,655359,720894,720895,786430,786431,851966,851967,917502,917503,983038,983039,1048574,1048575,1114110,1114111]),hn="�";var Y;(function(e){e[e.EOF=-1]="EOF",e[e.NULL=0]="NULL",e[e.TABULATION=9]="TABULATION",e[e.CARRIAGE_RETURN=13]="CARRIAGE_RETURN",e[e.LINE_FEED=10]="LINE_FEED",e[e.FORM_FEED=12]="FORM_FEED",e[e.SPACE=32]="SPACE",e[e.EXCLAMATION_MARK=33]="EXCLAMATION_MARK",e[e.QUOTATION_MARK=34]="QUOTATION_MARK",e[e.AMPERSAND=38]="AMPERSAND",e[e.APOSTROPHE=39]="APOSTROPHE",e[e.HYPHEN_MINUS=45]="HYPHEN_MINUS",e[e.SOLIDUS=47]="SOLIDUS",e[e.DIGIT_0=48]="DIGIT_0",e[e.DIGIT_9=57]="DIGIT_9",e[e.SEMICOLON=59]="SEMICOLON",e[e.LESS_THAN_SIGN=60]="LESS_THAN_SIGN",e[e.EQUALS_SIGN=61]="EQUALS_SIGN",e[e.GREATER_THAN_SIGN=62]="GREATER_THAN_SIGN",e[e.QUESTION_MARK=63]="QUESTION_MARK",e[e.LATIN_CAPITAL_A=65]="LATIN_CAPITAL_A",e[e.LATIN_CAPITAL_Z=90]="LATIN_CAPITAL_Z",e[e.RIGHT_SQUARE_BRACKET=93]="RIGHT_SQUARE_BRACKET",e[e.GRAVE_ACCENT=96]="GRAVE_ACCENT",e[e.LATIN_SMALL_A=97]="LATIN_SMALL_A",e[e.LATIN_SMALL_Z=122]="LATIN_SMALL_Z"})(Y||(Y={}));const Nr={DASH_DASH:"--",CDATA_START:"[CDATA[",DOCTYPE:"doctype",SCRIPT:"script",PUBLIC:"public",SYSTEM:"system"};function D_(e){return e>=55296&&e<=57343}function w$(e){return e>=56320&&e<=57343}function N$(e,t){return(e-55296)*1024+9216+t}function P_(e){return e!==32&&e!==10&&e!==13&&e!==9&&e!==12&&e>=1&&e<=31||e>=127&&e<=159}function j_(e){return e>=64976&&e<=65007||k$.has(e)}var Ce;(function(e){e.controlCharacterInInputStream="control-character-in-input-stream",e.noncharacterInInputStream="noncharacter-in-input-stream",e.surrogateInInputStream="surrogate-in-input-stream",e.nonVoidHtmlElementStartTagWithTrailingSolidus="non-void-html-element-start-tag-with-trailing-solidus",e.endTagWithAttributes="end-tag-with-attributes",e.endTagWithTrailingSolidus="end-tag-with-trailing-solidus",e.unexpectedSolidusInTag="unexpected-solidus-in-tag",e.unexpectedNullCharacter="unexpected-null-character",e.unexpectedQuestionMarkInsteadOfTagName="unexpected-question-mark-instead-of-tag-name",e.invalidFirstCharacterOfTagName="invalid-first-character-of-tag-name",e.unexpectedEqualsSignBeforeAttributeName="unexpected-equals-sign-before-attribute-name",e.missingEndTagName="missing-end-tag-name",e.unexpectedCharacterInAttributeName="unexpected-character-in-attribute-name",e.unknownNamedCharacterReference="unknown-named-character-reference",e.missingSemicolonAfterCharacterReference="missing-semicolon-after-character-reference",e.unexpectedCharacterAfterDoctypeSystemIdentifier="unexpected-character-after-doctype-system-identifier",e.unexpectedCharacterInUnquotedAttributeValue="unexpected-character-in-unquoted-attribute-value",e.eofBeforeTagName="eof-before-tag-name",e.eofInTag="eof-in-tag",e.missingAttributeValue="missing-attribute-value",e.missingWhitespaceBetweenAttributes="missing-whitespace-between-attributes",e.missingWhitespaceAfterDoctypePublicKeyword="missing-whitespace-after-doctype-public-keyword",e.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers="missing-whitespace-between-doctype-public-and-system-identifiers",e.missingWhitespaceAfterDoctypeSystemKeyword="missing-whitespace-after-doctype-system-keyword",e.missingQuoteBeforeDoctypePublicIdentifier="missing-quote-before-doctype-public-identifier",e.missingQuoteBeforeDoctypeSystemIdentifier="missing-quote-before-doctype-system-identifier",e.missingDoctypePublicIdentifier="missing-doctype-public-identifier",e.missingDoctypeSystemIdentifier="missing-doctype-system-identifier",e.abruptDoctypePublicIdentifier="abrupt-doctype-public-identifier",e.abruptDoctypeSystemIdentifier="abrupt-doctype-system-identifier",e.cdataInHtmlContent="cdata-in-html-content",e.incorrectlyOpenedComment="incorrectly-opened-comment",e.eofInScriptHtmlCommentLikeText="eof-in-script-html-comment-like-text",e.eofInDoctype="eof-in-doctype",e.nestedComment="nested-comment",e.abruptClosingOfEmptyComment="abrupt-closing-of-empty-comment",e.eofInComment="eof-in-comment",e.incorrectlyClosedComment="incorrectly-closed-comment",e.eofInCdata="eof-in-cdata",e.absenceOfDigitsInNumericCharacterReference="absence-of-digits-in-numeric-character-reference",e.nullCharacterReference="null-character-reference",e.surrogateCharacterReference="surrogate-character-reference",e.characterReferenceOutsideUnicodeRange="character-reference-outside-unicode-range",e.controlCharacterReference="control-character-reference",e.noncharacterCharacterReference="noncharacter-character-reference",e.missingWhitespaceBeforeDoctypeName="missing-whitespace-before-doctype-name",e.missingDoctypeName="missing-doctype-name",e.invalidCharacterSequenceAfterDoctypeName="invalid-character-sequence-after-doctype-name",e.duplicateAttribute="duplicate-attribute",e.nonConformingDoctype="non-conforming-doctype",e.missingDoctype="missing-doctype",e.misplacedDoctype="misplaced-doctype",e.endTagWithoutMatchingOpenElement="end-tag-without-matching-open-element",e.closingOfElementWithOpenChildElements="closing-of-element-with-open-child-elements",e.disallowedContentInNoscriptInHead="disallowed-content-in-noscript-in-head",e.openElementsLeftAfterEof="open-elements-left-after-eof",e.abandonedHeadElementChild="abandoned-head-element-child",e.misplacedStartTagForHeadElement="misplaced-start-tag-for-head-element",e.nestedNoscriptInHead="nested-noscript-in-head",e.eofInElementThatCanContainOnlyText="eof-in-element-that-can-contain-only-text"})(Ce||(Ce={}));const A$=65536;class _${constructor(t){this.handler=t,this.html="",this.pos=-1,this.lastGapPos=-2,this.gapStack=[],this.skipNextNewLine=!1,this.lastChunkWritten=!1,this.endOfChunkHit=!1,this.bufferWaterline=A$,this.isEol=!1,this.lineStartPos=0,this.droppedBufferSize=0,this.line=1,this.lastErrOffset=-1}get col(){return this.pos-this.lineStartPos+ +(this.lastGapPos!==this.pos)}get offset(){return this.droppedBufferSize+this.pos}getError(t,n){const{line:r,col:i,offset:a}=this,l=i+n,c=a+n;return{code:t,startLine:r,endLine:r,startCol:l,endCol:l,startOffset:c,endOffset:c}}_err(t){this.handler.onParseError&&this.lastErrOffset!==this.offset&&(this.lastErrOffset=this.offset,this.handler.onParseError(this.getError(t,0)))}_addGap(){this.gapStack.push(this.lastGapPos),this.lastGapPos=this.pos}_processSurrogate(t){if(this.pos!==this.html.length-1){const n=this.html.charCodeAt(this.pos+1);if(w$(n))return this.pos++,this._addGap(),N$(t,n)}else if(!this.lastChunkWritten)return this.endOfChunkHit=!0,Y.EOF;return this._err(Ce.surrogateInInputStream),t}willDropParsedChunk(){return this.pos>this.bufferWaterline}dropParsedChunk(){this.willDropParsedChunk()&&(this.html=this.html.substring(this.pos),this.lineStartPos-=this.pos,this.droppedBufferSize+=this.pos,this.pos=0,this.lastGapPos=-2,this.gapStack.length=0)}write(t,n){this.html.length>0?this.html+=t:this.html=t,this.endOfChunkHit=!1,this.lastChunkWritten=n}insertHtmlAtCurrentPos(t){this.html=this.html.substring(0,this.pos+1)+t+this.html.substring(this.pos+1),this.endOfChunkHit=!1}startsWith(t,n){if(this.pos+t.length>this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,!1;if(n)return this.html.startsWith(t,this.pos);for(let r=0;r<t.length;r++)if((this.html.charCodeAt(this.pos+r)|32)!==t.charCodeAt(r))return!1;return!0}peek(t){const n=this.pos+t;if(n>=this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,Y.EOF;const r=this.html.charCodeAt(n);return r===Y.CARRIAGE_RETURN?Y.LINE_FEED:r}advance(){if(this.pos++,this.isEol&&(this.isEol=!1,this.line++,this.lineStartPos=this.pos),this.pos>=this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,Y.EOF;let t=this.html.charCodeAt(this.pos);return t===Y.CARRIAGE_RETURN?(this.isEol=!0,this.skipNextNewLine=!0,Y.LINE_FEED):t===Y.LINE_FEED&&(this.isEol=!0,this.skipNextNewLine)?(this.line--,this.skipNextNewLine=!1,this._addGap(),this.advance()):(this.skipNextNewLine=!1,D_(t)&&(t=this._processSurrogate(t)),this.handler.onParseError===null||t>31&&t<127||t===Y.LINE_FEED||t===Y.CARRIAGE_RETURN||t>159&&t<64976||this._checkForProblematicCharacters(t),t)}_checkForProblematicCharacters(t){P_(t)?this._err(Ce.controlCharacterInInputStream):j_(t)&&this._err(Ce.noncharacterInInputStream)}retreat(t){for(this.pos-=t;this.pos<this.lastGapPos;)this.lastGapPos=this.gapStack.pop(),this.pos--;this.isEol=!1}}var Ct;(function(e){e[e.CHARACTER=0]="CHARACTER",e[e.NULL_CHARACTER=1]="NULL_CHARACTER",e[e.WHITESPACE_CHARACTER=2]="WHITESPACE_CHARACTER",e[e.START_TAG=3]="START_TAG",e[e.END_TAG=4]="END_TAG",e[e.COMMENT=5]="COMMENT",e[e.DOCTYPE=6]="DOCTYPE",e[e.EOF=7]="EOF",e[e.HIBERNATION=8]="HIBERNATION"})(Ct||(Ct={}));function B_(e,t){for(let n=e.attrs.length-1;n>=0;n--)if(e.attrs[n].name===t)return e.attrs[n].value;return null}const R$=new Uint16Array('ᵁ<Õıʊҝջאٵ۞ޢߖࠏ੊ઑඡ๭༉༦჊ረዡᐕᒝᓃᓟᔥ\0\0\0\0\0\0ᕫᛍᦍᰒᷝ὾⁠↰⊍⏀⏻⑂⠤⤒ⴈ⹈⿎〖㊺㘹㞬㣾㨨㩱㫠㬮ࠀEMabcfglmnoprstu\\bfms„‹•˜¦³¹ÈÏlig耻Æ䃆P耻&䀦cute耻Á䃁reve;䄂Āiyx}rc耻Â䃂;䐐r;쀀𝔄rave耻À䃀pha;䎑acr;䄀d;橓Āgp¡on;䄄f;쀀𝔸plyFunction;恡ing耻Å䃅Ācs¾Ãr;쀀𝒜ign;扔ilde耻Ã䃃ml耻Ä䃄ЀaceforsuåûþėĜĢħĪĀcrêòkslash;或Ŷöø;櫧ed;挆y;䐑ƀcrtąċĔause;戵noullis;愬a;䎒r;쀀𝔅pf;쀀𝔹eve;䋘còēmpeq;扎܀HOacdefhilorsuōőŖƀƞƢƵƷƺǜȕɳɸɾcy;䐧PY耻©䂩ƀcpyŝŢźute;䄆Ā;iŧŨ拒talDifferentialD;慅leys;愭ȀaeioƉƎƔƘron;䄌dil耻Ç䃇rc;䄈nint;戰ot;䄊ĀdnƧƭilla;䂸terDot;䂷òſi;䎧rcleȀDMPTLJNjǑǖot;抙inus;抖lus;投imes;抗oĀcsǢǸkwiseContourIntegral;戲eCurlyĀDQȃȏoubleQuote;思uote;怙ȀlnpuȞȨɇɕonĀ;eȥȦ户;橴ƀgitȯȶȺruent;扡nt;戯ourIntegral;戮ĀfrɌɎ;愂oduct;成nterClockwiseContourIntegral;戳oss;樯cr;쀀𝒞pĀ;Cʄʅ拓ap;才րDJSZacefiosʠʬʰʴʸˋ˗ˡ˦̳ҍĀ;oŹʥtrahd;椑cy;䐂cy;䐅cy;䐏ƀgrsʿ˄ˇger;怡r;憡hv;櫤Āayː˕ron;䄎;䐔lĀ;t˝˞戇a;䎔r;쀀𝔇Āaf˫̧Ācm˰̢riticalȀADGT̖̜̀̆cute;䂴oŴ̋̍;䋙bleAcute;䋝rave;䁠ilde;䋜ond;拄ferentialD;慆Ѱ̽\0\0\0͔͂\0Ѕf;쀀𝔻ƀ;DE͈͉͍䂨ot;惜qual;扐blèCDLRUVͣͲ΂ϏϢϸontourIntegraìȹoɴ͹\0\0ͻ»͉nArrow;懓Āeo·ΤftƀARTΐΖΡrrow;懐ightArrow;懔eåˊngĀLRΫτeftĀARγιrrow;柸ightArrow;柺ightArrow;柹ightĀATϘϞrrow;懒ee;抨pɁϩ\0\0ϯrrow;懑ownArrow;懕erticalBar;戥ǹABLRTaВЪаўѿͼrrowƀ;BUНОТ憓ar;椓pArrow;懵reve;䌑eft˒к\0ц\0ѐightVector;楐eeVector;楞ectorĀ;Bљњ憽ar;楖ightǔѧ\0ѱeeVector;楟ectorĀ;BѺѻ懁ar;楗eeĀ;A҆҇护rrow;憧ĀctҒҗr;쀀𝒟rok;䄐ࠀNTacdfglmopqstuxҽӀӄӋӞӢӧӮӵԡԯԶՒ՝ՠեG;䅊H耻Ð䃐cute耻É䃉ƀaiyӒӗӜron;䄚rc耻Ê䃊;䐭ot;䄖r;쀀𝔈rave耻È䃈ement;戈ĀapӺӾcr;䄒tyɓԆ\0\0ԒmallSquare;旻erySmallSquare;斫ĀgpԦԪon;䄘f;쀀𝔼silon;䎕uĀaiԼՉlĀ;TՂՃ橵ilde;扂librium;懌Āci՗՚r;愰m;橳a;䎗ml耻Ë䃋Āipժկsts;戃onentialE;慇ʀcfiosօֈ֍ֲ׌y;䐤r;쀀𝔉lledɓ֗\0\0֣mallSquare;旼erySmallSquare;斪Ͱֺ\0ֿ\0\0ׄf;쀀𝔽All;戀riertrf;愱cò׋؀JTabcdfgorstר׬ׯ׺؀ؒؖ؛؝أ٬ٲcy;䐃耻>䀾mmaĀ;d׷׸䎓;䏜reve;䄞ƀeiy؇،ؐdil;䄢rc;䄜;䐓ot;䄠r;쀀𝔊;拙pf;쀀𝔾eater̀EFGLSTصلَٖٛ٦qualĀ;Lؾؿ扥ess;招ullEqual;执reater;檢ess;扷lantEqual;橾ilde;扳cr;쀀𝒢;扫ЀAacfiosuڅڋږڛڞڪھۊRDcy;䐪Āctڐڔek;䋇;䁞irc;䄤r;愌lbertSpace;愋ǰگ\0ڲf;愍izontalLine;攀Āctۃۅòکrok;䄦mpńېۘownHumðįqual;扏܀EJOacdfgmnostuۺ۾܃܇܎ܚܞܡܨ݄ݸދޏޕcy;䐕lig;䄲cy;䐁cute耻Í䃍Āiyܓܘrc耻Î䃎;䐘ot;䄰r;愑rave耻Ì䃌ƀ;apܠܯܿĀcgܴܷr;䄪inaryI;慈lieóϝǴ݉\0ݢĀ;eݍݎ戬Āgrݓݘral;戫section;拂isibleĀCTݬݲomma;恣imes;恢ƀgptݿރވon;䄮f;쀀𝕀a;䎙cr;愐ilde;䄨ǫޚ\0ޞcy;䐆l耻Ï䃏ʀcfosuެ޷޼߂ߐĀiyޱ޵rc;䄴;䐙r;쀀𝔍pf;쀀𝕁ǣ߇\0ߌr;쀀𝒥rcy;䐈kcy;䐄΀HJacfosߤߨ߽߬߱ࠂࠈcy;䐥cy;䐌ppa;䎚Āey߶߻dil;䄶;䐚r;쀀𝔎pf;쀀𝕂cr;쀀𝒦րJTaceflmostࠥࠩࠬࡐࡣ঳সে্਷ੇcy;䐉耻<䀼ʀcmnpr࠷࠼ࡁࡄࡍute;䄹bda;䎛g;柪lacetrf;愒r;憞ƀaeyࡗ࡜ࡡron;䄽dil;䄻;䐛Āfsࡨ॰tԀACDFRTUVarࡾࢩࢱࣦ࣠ࣼयज़ΐ४Ānrࢃ࢏gleBracket;柨rowƀ;BR࢙࢚࢞憐ar;懤ightArrow;懆eiling;挈oǵࢷ\0ࣃbleBracket;柦nǔࣈ\0࣒eeVector;楡ectorĀ;Bࣛࣜ懃ar;楙loor;挊ightĀAV࣯ࣵrrow;憔ector;楎Āerँगeƀ;AVउऊऐ抣rrow;憤ector;楚iangleƀ;BEतथऩ抲ar;槏qual;抴pƀDTVषूौownVector;楑eeVector;楠ectorĀ;Bॖॗ憿ar;楘ectorĀ;B॥०憼ar;楒ightáΜs̀EFGLSTॾঋকঝঢভqualGreater;拚ullEqual;扦reater;扶ess;檡lantEqual;橽ilde;扲r;쀀𝔏Ā;eঽা拘ftarrow;懚idot;䄿ƀnpw৔ਖਛgȀLRlr৞৷ਂਐeftĀAR০৬rrow;柵ightArrow;柷ightArrow;柶eftĀarγਊightáοightáϊf;쀀𝕃erĀLRਢਬeftArrow;憙ightArrow;憘ƀchtਾੀੂòࡌ;憰rok;䅁;扪Ѐacefiosuਗ਼੝੠੷੼અઋ઎p;椅y;䐜Ādl੥੯iumSpace;恟lintrf;愳r;쀀𝔐nusPlus;戓pf;쀀𝕄cò੶;䎜ҀJacefostuણધભીଔଙඑ඗ඞcy;䐊cute;䅃ƀaey઴હાron;䅇dil;䅅;䐝ƀgswે૰଎ativeƀMTV૓૟૨ediumSpace;怋hiĀcn૦૘ë૙eryThiî૙tedĀGL૸ଆreaterGreateòٳessLesóੈLine;䀊r;쀀𝔑ȀBnptଢନଷ଺reak;恠BreakingSpace;䂠f;愕ڀ;CDEGHLNPRSTV୕ୖ୪୼஡௫ఄ౞಄ದ೘ൡඅ櫬Āou୛୤ngruent;扢pCap;扭oubleVerticalBar;戦ƀlqxஃஊ஛ement;戉ualĀ;Tஒஓ扠ilde;쀀≂̸ists;戄reater΀;EFGLSTஶஷ஽௉௓௘௥扯qual;扱ullEqual;쀀≧̸reater;쀀≫̸ess;批lantEqual;쀀⩾̸ilde;扵umpń௲௽ownHump;쀀≎̸qual;쀀≏̸eĀfsఊధtTriangleƀ;BEచఛడ拪ar;쀀⧏̸qual;括s̀;EGLSTవశ఼ౄోౘ扮qual;扰reater;扸ess;쀀≪̸lantEqual;쀀⩽̸ilde;扴estedĀGL౨౹reaterGreater;쀀⪢̸essLess;쀀⪡̸recedesƀ;ESಒಓಛ技qual;쀀⪯̸lantEqual;拠ĀeiಫಹverseElement;戌ghtTriangleƀ;BEೋೌ೒拫ar;쀀⧐̸qual;拭ĀquೝഌuareSuĀbp೨೹setĀ;E೰ೳ쀀⊏̸qual;拢ersetĀ;Eഃആ쀀⊐̸qual;拣ƀbcpഓതൎsetĀ;Eഛഞ쀀⊂⃒qual;抈ceedsȀ;ESTലള഻െ抁qual;쀀⪰̸lantEqual;拡ilde;쀀≿̸ersetĀ;E൘൛쀀⊃⃒qual;抉ildeȀ;EFT൮൯൵ൿ扁qual;扄ullEqual;扇ilde;扉erticalBar;戤cr;쀀𝒩ilde耻Ñ䃑;䎝܀Eacdfgmoprstuvලෂ෉෕ෛ෠෧෼ขภยา฿ไlig;䅒cute耻Ó䃓Āiy෎ීrc耻Ô䃔;䐞blac;䅐r;쀀𝔒rave耻Ò䃒ƀaei෮ෲ෶cr;䅌ga;䎩cron;䎟pf;쀀𝕆enCurlyĀDQฎบoubleQuote;怜uote;怘;橔Āclวฬr;쀀𝒪ash耻Ø䃘iŬื฼de耻Õ䃕es;樷ml耻Ö䃖erĀBP๋๠Āar๐๓r;怾acĀek๚๜;揞et;掴arenthesis;揜Ҁacfhilors๿ງຊຏຒດຝະ໼rtialD;戂y;䐟r;쀀𝔓i;䎦;䎠usMinus;䂱Āipຢອncareplanåڝf;愙Ȁ;eio຺ູ໠໤檻cedesȀ;EST່້໏໚扺qual;檯lantEqual;扼ilde;找me;怳Ādp໩໮uct;戏ortionĀ;aȥ໹l;戝Āci༁༆r;쀀𝒫;䎨ȀUfos༑༖༛༟OT耻"䀢r;쀀𝔔pf;愚cr;쀀𝒬؀BEacefhiorsu༾གྷཇའཱིྦྷྪྭ႖ႩႴႾarr;椐G耻®䂮ƀcnrཎནབute;䅔g;柫rĀ;tཛྷཝ憠l;椖ƀaeyཧཬཱron;䅘dil;䅖;䐠Ā;vླྀཹ愜erseĀEUྂྙĀlq྇ྎement;戋uilibrium;懋pEquilibrium;楯r»ཹo;䎡ghtЀACDFTUVa࿁࿫࿳ဢဨၛႇϘĀnr࿆࿒gleBracket;柩rowƀ;BL࿜࿝࿡憒ar;懥eftArrow;懄eiling;按oǵ࿹\0စbleBracket;柧nǔည\0နeeVector;楝ectorĀ;Bဝသ懂ar;楕loor;挋Āerိ၃eƀ;AVဵံြ抢rrow;憦ector;楛iangleƀ;BEၐၑၕ抳ar;槐qual;抵pƀDTVၣၮၸownVector;楏eeVector;楜ectorĀ;Bႂႃ憾ar;楔ectorĀ;B႑႒懀ar;楓Āpuႛ႞f;愝ndImplies;楰ightarrow;懛ĀchႹႼr;愛;憱leDelayed;槴ڀHOacfhimoqstuფჱჷჽᄙᄞᅑᅖᅡᅧᆵᆻᆿĀCcჩხHcy;䐩y;䐨FTcy;䐬cute;䅚ʀ;aeiyᄈᄉᄎᄓᄗ檼ron;䅠dil;䅞rc;䅜;䐡r;쀀𝔖ortȀDLRUᄪᄴᄾᅉownArrow»ОeftArrow»࢚ightArrow»࿝pArrow;憑gma;䎣allCircle;战pf;쀀𝕊ɲᅭ\0\0ᅰt;戚areȀ;ISUᅻᅼᆉᆯ斡ntersection;抓uĀbpᆏᆞsetĀ;Eᆗᆘ抏qual;抑ersetĀ;Eᆨᆩ抐qual;抒nion;抔cr;쀀𝒮ar;拆ȀbcmpᇈᇛሉላĀ;sᇍᇎ拐etĀ;Eᇍᇕqual;抆ĀchᇠህeedsȀ;ESTᇭᇮᇴᇿ扻qual;檰lantEqual;扽ilde;承Tháྌ;我ƀ;esሒሓሣ拑rsetĀ;Eሜም抃qual;抇et»ሓրHRSacfhiorsሾቄ቉ቕ቞ቱቶኟዂወዑORN耻Þ䃞ADE;愢ĀHc቎ቒcy;䐋y;䐦Ābuቚቜ;䀉;䎤ƀaeyብቪቯron;䅤dil;䅢;䐢r;쀀𝔗Āeiቻ኉Dzኀ\0ኇefore;戴a;䎘Ācn኎ኘkSpace;쀀  Space;怉ldeȀ;EFTካኬኲኼ戼qual;扃ullEqual;扅ilde;扈pf;쀀𝕋ipleDot;惛Āctዖዛr;쀀𝒯rok;䅦ૡዷጎጚጦ\0ጬጱ\0\0\0\0\0ጸጽ፷ᎅ\0᏿ᐄᐊᐐĀcrዻጁute耻Ú䃚rĀ;oጇገ憟cir;楉rǣጓ\0጖y;䐎ve;䅬Āiyጞጣrc耻Û䃛;䐣blac;䅰r;쀀𝔘rave耻Ù䃙acr;䅪Ādiፁ፩erĀBPፈ፝Āarፍፐr;䁟acĀekፗፙ;揟et;掵arenthesis;揝onĀ;P፰፱拃lus;抎Āgp፻፿on;䅲f;쀀𝕌ЀADETadps᎕ᎮᎸᏄϨᏒᏗᏳrrowƀ;BDᅐᎠᎤar;椒ownArrow;懅ownArrow;憕quilibrium;楮eeĀ;AᏋᏌ报rrow;憥ownáϳerĀLRᏞᏨeftArrow;憖ightArrow;憗iĀ;lᏹᏺ䏒on;䎥ing;䅮cr;쀀𝒰ilde;䅨ml耻Ü䃜ҀDbcdefosvᐧᐬᐰᐳᐾᒅᒊᒐᒖash;披ar;櫫y;䐒ashĀ;lᐻᐼ抩;櫦Āerᑃᑅ;拁ƀbtyᑌᑐᑺar;怖Ā;iᑏᑕcalȀBLSTᑡᑥᑪᑴar;戣ine;䁼eparator;杘ilde;所ThinSpace;怊r;쀀𝔙pf;쀀𝕍cr;쀀𝒱dash;抪ʀcefosᒧᒬᒱᒶᒼirc;䅴dge;拀r;쀀𝔚pf;쀀𝕎cr;쀀𝒲Ȁfiosᓋᓐᓒᓘr;쀀𝔛;䎞pf;쀀𝕏cr;쀀𝒳ҀAIUacfosuᓱᓵᓹᓽᔄᔏᔔᔚᔠcy;䐯cy;䐇cy;䐮cute耻Ý䃝Āiyᔉᔍrc;䅶;䐫r;쀀𝔜pf;쀀𝕐cr;쀀𝒴ml;䅸ЀHacdefosᔵᔹᔿᕋᕏᕝᕠᕤcy;䐖cute;䅹Āayᕄᕉron;䅽;䐗ot;䅻Dzᕔ\0ᕛoWidtè૙a;䎖r;愨pf;愤cr;쀀𝒵௡ᖃᖊᖐ\0ᖰᖶᖿ\0\0\0\0ᗆᗛᗫᙟ᙭\0ᚕ᚛ᚲᚹ\0ᚾcute耻á䃡reve;䄃̀;Ediuyᖜᖝᖡᖣᖨᖭ戾;쀀∾̳;房rc耻â䃢te肻´̆;䐰lig耻æ䃦Ā;r²ᖺ;쀀𝔞rave耻à䃠ĀepᗊᗖĀfpᗏᗔsym;愵èᗓha;䎱ĀapᗟcĀclᗤᗧr;䄁g;樿ɤᗰ\0\0ᘊʀ;adsvᗺᗻᗿᘁᘇ戧nd;橕;橜lope;橘;橚΀;elmrszᘘᘙᘛᘞᘿᙏᙙ戠;榤e»ᘙsdĀ;aᘥᘦ戡ѡᘰᘲᘴᘶᘸᘺᘼᘾ;榨;榩;榪;榫;榬;榭;榮;榯tĀ;vᙅᙆ戟bĀ;dᙌᙍ抾;榝Āptᙔᙗh;戢»¹arr;捼Āgpᙣᙧon;䄅f;쀀𝕒΀;Eaeiop዁ᙻᙽᚂᚄᚇᚊ;橰cir;橯;扊d;手s;䀧roxĀ;e዁ᚒñᚃing耻å䃥ƀctyᚡᚦᚨr;쀀𝒶;䀪mpĀ;e዁ᚯñʈilde耻ã䃣ml耻ä䃤Āciᛂᛈoninôɲnt;樑ࠀNabcdefiklnoprsu᛭ᛱᜰ᜼ᝃᝈ᝸᝽០៦ᠹᡐᜍ᤽᥈ᥰot;櫭Ācrᛶ᜞kȀcepsᜀᜅᜍᜓong;扌psilon;䏶rime;怵imĀ;e᜚᜛戽q;拍Ŷᜢᜦee;抽edĀ;gᜬᜭ挅e»ᜭrkĀ;t፜᜷brk;掶Āoyᜁᝁ;䐱quo;怞ʀcmprtᝓ᝛ᝡᝤᝨausĀ;eĊĉptyv;榰séᜌnoõēƀahwᝯ᝱ᝳ;䎲;愶een;扬r;쀀𝔟g΀costuvwឍឝឳេ៕៛៞ƀaiuបពរðݠrc;旯p»፱ƀdptឤឨឭot;樀lus;樁imes;樂ɱឹ\0\0ើcup;樆ar;昅riangleĀdu៍្own;施p;斳plus;樄eåᑄåᒭarow;植ƀako៭ᠦᠵĀcn៲ᠣkƀlst៺֫᠂ozenge;槫riangleȀ;dlr᠒᠓᠘᠝斴own;斾eft;旂ight;斸k;搣Ʊᠫ\0ᠳƲᠯ\0ᠱ;斒;斑4;斓ck;斈ĀeoᠾᡍĀ;qᡃᡆ쀀=⃥uiv;쀀≡⃥t;挐Ȁptwxᡙᡞᡧᡬf;쀀𝕓Ā;tᏋᡣom»Ꮜtie;拈؀DHUVbdhmptuvᢅᢖᢪᢻᣗᣛᣬ᣿ᤅᤊᤐᤡȀLRlrᢎᢐᢒᢔ;敗;敔;敖;敓ʀ;DUduᢡᢢᢤᢦᢨ敐;敦;敩;敤;敧ȀLRlrᢳᢵᢷᢹ;敝;敚;敜;教΀;HLRhlrᣊᣋᣍᣏᣑᣓᣕ救;敬;散;敠;敫;敢;敟ox;槉ȀLRlrᣤᣦᣨᣪ;敕;敒;攐;攌ʀ;DUduڽ᣷᣹᣻᣽;敥;敨;攬;攴inus;抟lus;択imes;抠ȀLRlrᤙᤛᤝ᤟;敛;敘;攘;攔΀;HLRhlrᤰᤱᤳᤵᤷ᤻᤹攂;敪;敡;敞;攼;攤;攜Āevģ᥂bar耻¦䂦Ȁceioᥑᥖᥚᥠr;쀀𝒷mi;恏mĀ;e᜚᜜lƀ;bhᥨᥩᥫ䁜;槅sub;柈Ŭᥴ᥾lĀ;e᥹᥺怢t»᥺pƀ;Eeįᦅᦇ;檮Ā;qۜۛೡᦧ\0᧨ᨑᨕᨲ\0ᨷᩐ\0\0᪴\0\0᫁\0\0ᬡᬮ᭍᭒\0᯽\0ᰌƀcpr᦭ᦲ᧝ute;䄇̀;abcdsᦿᧀᧄ᧊᧕᧙戩nd;橄rcup;橉Āau᧏᧒p;橋p;橇ot;橀;쀀∩︀Āeo᧢᧥t;恁îړȀaeiu᧰᧻ᨁᨅǰ᧵\0᧸s;橍on;䄍dil耻ç䃧rc;䄉psĀ;sᨌᨍ橌m;橐ot;䄋ƀdmnᨛᨠᨦil肻¸ƭptyv;榲t脀¢;eᨭᨮ䂢räƲr;쀀𝔠ƀceiᨽᩀᩍy;䑇ckĀ;mᩇᩈ朓ark»ᩈ;䏇r΀;Ecefms᩟᩠ᩢᩫ᪤᪪᪮旋;槃ƀ;elᩩᩪᩭ䋆q;扗eɡᩴ\0\0᪈rrowĀlr᩼᪁eft;憺ight;憻ʀRSacd᪒᪔᪖᪚᪟»ཇ;擈st;抛irc;抚ash;抝nint;樐id;櫯cir;槂ubsĀ;u᪻᪼晣it»᪼ˬ᫇᫔᫺\0ᬊonĀ;eᫍᫎ䀺Ā;qÇÆɭ᫙\0\0᫢aĀ;t᫞᫟䀬;䁀ƀ;fl᫨᫩᫫戁îᅠeĀmx᫱᫶ent»᫩eóɍǧ᫾\0ᬇĀ;dኻᬂot;橭nôɆƀfryᬐᬔᬗ;쀀𝕔oäɔ脀©;sŕᬝr;愗Āaoᬥᬩrr;憵ss;朗Ācuᬲᬷr;쀀𝒸Ābpᬼ᭄Ā;eᭁᭂ櫏;櫑Ā;eᭉᭊ櫐;櫒dot;拯΀delprvw᭠᭬᭷ᮂᮬᯔ᯹arrĀlr᭨᭪;椸;椵ɰ᭲\0\0᭵r;拞c;拟arrĀ;p᭿ᮀ憶;椽̀;bcdosᮏᮐᮖᮡᮥᮨ截rcap;橈Āauᮛᮞp;橆p;橊ot;抍r;橅;쀀∪︀Ȁalrv᮵ᮿᯞᯣrrĀ;mᮼᮽ憷;椼yƀevwᯇᯔᯘqɰᯎ\0\0ᯒreã᭳uã᭵ee;拎edge;拏en耻¤䂤earrowĀlrᯮ᯳eft»ᮀight»ᮽeäᯝĀciᰁᰇoninôǷnt;戱lcty;挭ঀAHabcdefhijlorstuwz᰸᰻᰿ᱝᱩᱵᲊᲞᲬᲷ᳻᳿ᴍᵻᶑᶫᶻ᷆᷍rò΁ar;楥Ȁglrs᱈ᱍ᱒᱔ger;怠eth;愸òᄳhĀ;vᱚᱛ怐»ऊūᱡᱧarow;椏aã̕Āayᱮᱳron;䄏;䐴ƀ;ao̲ᱼᲄĀgrʿᲁr;懊tseq;橷ƀglmᲑᲔᲘ耻°䂰ta;䎴ptyv;榱ĀirᲣᲨsht;楿;쀀𝔡arĀlrᲳᲵ»ࣜ»သʀaegsv᳂͸᳖᳜᳠mƀ;oș᳊᳔ndĀ;ș᳑uit;晦amma;䏝in;拲ƀ;io᳧᳨᳸䃷de脀÷;o᳧ᳰntimes;拇nø᳷cy;䑒cɯᴆ\0\0ᴊrn;挞op;挍ʀlptuwᴘᴝᴢᵉᵕlar;䀤f;쀀𝕕ʀ;emps̋ᴭᴷᴽᵂqĀ;d͒ᴳot;扑inus;戸lus;戔quare;抡blebarwedgåúnƀadhᄮᵝᵧownarrowóᲃarpoonĀlrᵲᵶefôᲴighôᲶŢᵿᶅkaro÷གɯᶊ\0\0ᶎrn;挟op;挌ƀcotᶘᶣᶦĀryᶝᶡ;쀀𝒹;䑕l;槶rok;䄑Ādrᶰᶴot;拱iĀ;fᶺ᠖斿Āah᷀᷃ròЩaòྦangle;榦Āci᷒ᷕy;䑟grarr;柿ऀDacdefglmnopqrstuxḁḉḙḸոḼṉṡṾấắẽỡἪἷὄ὎὚ĀDoḆᴴoôᲉĀcsḎḔute耻é䃩ter;橮ȀaioyḢḧḱḶron;䄛rĀ;cḭḮ扖耻ê䃪lon;払;䑍ot;䄗ĀDrṁṅot;扒;쀀𝔢ƀ;rsṐṑṗ檚ave耻è䃨Ā;dṜṝ檖ot;檘Ȁ;ilsṪṫṲṴ檙nters;揧;愓Ā;dṹṺ檕ot;檗ƀapsẅẉẗcr;䄓tyƀ;svẒẓẕ戅et»ẓpĀ1;ẝẤijạả;怄;怅怃ĀgsẪẬ;䅋p;怂ĀgpẴẸon;䄙f;쀀𝕖ƀalsỄỎỒrĀ;sỊị拕l;槣us;橱iƀ;lvỚớở䎵on»ớ;䏵ȀcsuvỪỳἋἣĀioữḱrc»Ḯɩỹ\0\0ỻíՈantĀglἂἆtr»ṝess»Ṻƀaeiἒ἖Ἒls;䀽st;扟vĀ;DȵἠD;橸parsl;槥ĀDaἯἳot;打rr;楱ƀcdiἾὁỸr;愯oô͒ĀahὉὋ;䎷耻ð䃰Āmrὓὗl耻ë䃫o;悬ƀcipὡὤὧl;䀡sôծĀeoὬὴctatioîՙnentialåչৡᾒ\0ᾞ\0ᾡᾧ\0\0ῆῌ\0ΐ\0ῦῪ \0 ⁚llingdotseñṄy;䑄male;晀ƀilrᾭᾳ῁lig;耀ffiɩᾹ\0\0᾽g;耀ffig;耀ffl;쀀𝔣lig;耀filig;쀀fjƀaltῙ῜ῡt;晭ig;耀flns;斱of;䆒ǰ΅\0ῳf;쀀𝕗ĀakֿῷĀ;vῼ´拔;櫙artint;樍Āao‌⁕Ācs‑⁒ႉ‸⁅⁈\0⁐β•‥‧‪‬\0‮耻½䂽;慓耻¼䂼;慕;慙;慛Ƴ‴\0‶;慔;慖ʴ‾⁁\0\0⁃耻¾䂾;慗;慜5;慘ƶ⁌\0⁎;慚;慝8;慞l;恄wn;挢cr;쀀𝒻ࢀEabcdefgijlnorstv₂₉₟₥₰₴⃰⃵⃺⃿℃ℒℸ̗ℾ⅒↞Ā;lٍ₇;檌ƀcmpₐₕ₝ute;䇵maĀ;dₜ᳚䎳;檆reve;䄟Āiy₪₮rc;䄝;䐳ot;䄡Ȁ;lqsؾق₽⃉ƀ;qsؾٌ⃄lanô٥Ȁ;cdl٥⃒⃥⃕c;檩otĀ;o⃜⃝檀Ā;l⃢⃣檂;檄Ā;e⃪⃭쀀⋛︀s;檔r;쀀𝔤Ā;gٳ؛mel;愷cy;䑓Ȁ;Eajٚℌℎℐ;檒;檥;檤ȀEaesℛℝ℩ℴ;扩pĀ;p℣ℤ檊rox»ℤĀ;q℮ℯ檈Ā;q℮ℛim;拧pf;쀀𝕘Āci⅃ⅆr;愊mƀ;el٫ⅎ⅐;檎;檐茀>;cdlqr׮ⅠⅪⅮⅳⅹĀciⅥⅧ;檧r;橺ot;拗Par;榕uest;橼ʀadelsↄⅪ←ٖ↛ǰ↉\0↎proø₞r;楸qĀlqؿ↖lesó₈ií٫Āen↣↭rtneqq;쀀≩︀Å↪ԀAabcefkosy⇄⇇⇱⇵⇺∘∝∯≨≽ròΠȀilmr⇐⇔⇗⇛rsðᒄf»․ilôکĀdr⇠⇤cy;䑊ƀ;cwࣴ⇫⇯ir;楈;憭ar;意irc;䄥ƀalr∁∎∓rtsĀ;u∉∊晥it»∊lip;怦con;抹r;쀀𝔥sĀew∣∩arow;椥arow;椦ʀamopr∺∾≃≞≣rr;懿tht;戻kĀlr≉≓eftarrow;憩ightarrow;憪f;쀀𝕙bar;怕ƀclt≯≴≸r;쀀𝒽asè⇴rok;䄧Ābp⊂⊇ull;恃hen»ᱛૡ⊣\0⊪\0⊸⋅⋎\0⋕⋳\0\0⋸⌢⍧⍢⍿\0⎆⎪⎴cute耻í䃭ƀ;iyݱ⊰⊵rc耻î䃮;䐸Ācx⊼⊿y;䐵cl耻¡䂡ĀfrΟ⋉;쀀𝔦rave耻ì䃬Ȁ;inoܾ⋝⋩⋮Āin⋢⋦nt;樌t;戭fin;槜ta;愩lig;䄳ƀaop⋾⌚⌝ƀcgt⌅⌈⌗r;䄫ƀelpܟ⌏⌓inåގarôܠh;䄱f;抷ed;䆵ʀ;cfotӴ⌬⌱⌽⍁are;愅inĀ;t⌸⌹戞ie;槝doô⌙ʀ;celpݗ⍌⍐⍛⍡al;抺Āgr⍕⍙eróᕣã⍍arhk;樗rod;樼Ȁcgpt⍯⍲⍶⍻y;䑑on;䄯f;쀀𝕚a;䎹uest耻¿䂿Āci⎊⎏r;쀀𝒾nʀ;EdsvӴ⎛⎝⎡ӳ;拹ot;拵Ā;v⎦⎧拴;拳Ā;iݷ⎮lde;䄩ǫ⎸\0⎼cy;䑖l耻ï䃯̀cfmosu⏌⏗⏜⏡⏧⏵Āiy⏑⏕rc;䄵;䐹r;쀀𝔧ath;䈷pf;쀀𝕛ǣ⏬\0⏱r;쀀𝒿rcy;䑘kcy;䑔Ѐacfghjos␋␖␢␧␭␱␵␻ppaĀ;v␓␔䎺;䏰Āey␛␠dil;䄷;䐺r;쀀𝔨reen;䄸cy;䑅cy;䑜pf;쀀𝕜cr;쀀𝓀஀ABEHabcdefghjlmnoprstuv⑰⒁⒆⒍⒑┎┽╚▀♎♞♥♹♽⚚⚲⛘❝❨➋⟀⠁⠒ƀart⑷⑺⑼rò৆òΕail;椛arr;椎Ā;gঔ⒋;檋ar;楢ॣ⒥\0⒪\0⒱\0\0\0\0\0⒵Ⓔ\0ⓆⓈⓍ\0⓹ute;䄺mptyv;榴raîࡌbda;䎻gƀ;dlࢎⓁⓃ;榑åࢎ;檅uo耻«䂫rЀ;bfhlpst࢙ⓞⓦⓩ⓫⓮⓱⓵Ā;f࢝ⓣs;椟s;椝ë≒p;憫l;椹im;楳l;憢ƀ;ae⓿─┄檫il;椙Ā;s┉┊檭;쀀⪭︀ƀabr┕┙┝rr;椌rk;杲Āak┢┬cĀek┨┪;䁻;䁛Āes┱┳;榋lĀdu┹┻;榏;榍Ȁaeuy╆╋╖╘ron;䄾Ādi═╔il;䄼ìࢰâ┩;䐻Ȁcqrs╣╦╭╽a;椶uoĀ;rนᝆĀdu╲╷har;楧shar;楋h;憲ʀ;fgqs▋▌উ◳◿扤tʀahlrt▘▤▷◂◨rrowĀ;t࢙□aé⓶arpoonĀdu▯▴own»њp»०eftarrows;懇ightƀahs◍◖◞rrowĀ;sࣴࢧarpoonó྘quigarro÷⇰hreetimes;拋ƀ;qs▋ও◺lanôবʀ;cdgsব☊☍☝☨c;檨otĀ;o☔☕橿Ā;r☚☛檁;檃Ā;e☢☥쀀⋚︀s;檓ʀadegs☳☹☽♉♋pproøⓆot;拖qĀgq♃♅ôউgtò⒌ôছiíলƀilr♕࣡♚sht;楼;쀀𝔩Ā;Eজ♣;檑š♩♶rĀdu▲♮Ā;l॥♳;楪lk;斄cy;䑙ʀ;achtੈ⚈⚋⚑⚖rò◁orneòᴈard;楫ri;旺Āio⚟⚤dot;䅀ustĀ;a⚬⚭掰che»⚭ȀEaes⚻⚽⛉⛔;扨pĀ;p⛃⛄檉rox»⛄Ā;q⛎⛏檇Ā;q⛎⚻im;拦Ѐabnoptwz⛩⛴⛷✚✯❁❇❐Ānr⛮⛱g;柬r;懽rëࣁgƀlmr⛿✍✔eftĀar০✇ightá৲apsto;柼ightá৽parrowĀlr✥✩efô⓭ight;憬ƀafl✶✹✽r;榅;쀀𝕝us;樭imes;樴š❋❏st;戗áፎƀ;ef❗❘᠀旊nge»❘arĀ;l❤❥䀨t;榓ʀachmt❳❶❼➅➇ròࢨorneòᶌarĀ;d྘➃;業;怎ri;抿̀achiqt➘➝ੀ➢➮➻quo;怹r;쀀𝓁mƀ;egল➪➬;檍;檏Ābu┪➳oĀ;rฟ➹;怚rok;䅂萀<;cdhilqrࠫ⟒☹⟜⟠⟥⟪⟰Āci⟗⟙;檦r;橹reå◲mes;拉arr;楶uest;橻ĀPi⟵⟹ar;榖ƀ;ef⠀भ᠛旃rĀdu⠇⠍shar;楊har;楦Āen⠗⠡rtneqq;쀀≨︀Å⠞܀Dacdefhilnopsu⡀⡅⢂⢎⢓⢠⢥⢨⣚⣢⣤ઃ⣳⤂Dot;戺Ȁclpr⡎⡒⡣⡽r耻¯䂯Āet⡗⡙;時Ā;e⡞⡟朠se»⡟Ā;sျ⡨toȀ;dluျ⡳⡷⡻owîҌefôएðᏑker;斮Āoy⢇⢌mma;権;䐼ash;怔asuredangle»ᘦr;쀀𝔪o;愧ƀcdn⢯⢴⣉ro耻µ䂵Ȁ;acdᑤ⢽⣀⣄sôᚧir;櫰ot肻·Ƶusƀ;bd⣒ᤃ⣓戒Ā;uᴼ⣘;横ţ⣞⣡p;櫛ò−ðઁĀdp⣩⣮els;抧f;쀀𝕞Āct⣸⣽r;쀀𝓂pos»ᖝƀ;lm⤉⤊⤍䎼timap;抸ఀGLRVabcdefghijlmoprstuvw⥂⥓⥾⦉⦘⧚⧩⨕⨚⩘⩝⪃⪕⪤⪨⬄⬇⭄⭿⮮ⰴⱧⱼ⳩Āgt⥇⥋;쀀⋙̸Ā;v⥐௏쀀≫⃒ƀelt⥚⥲⥶ftĀar⥡⥧rrow;懍ightarrow;懎;쀀⋘̸Ā;v⥻ే쀀≪⃒ightarrow;懏ĀDd⦎⦓ash;抯ash;抮ʀbcnpt⦣⦧⦬⦱⧌la»˞ute;䅄g;쀀∠⃒ʀ;Eiop඄⦼⧀⧅⧈;쀀⩰̸d;쀀≋̸s;䅉roø඄urĀ;a⧓⧔普lĀ;s⧓ସdz⧟\0⧣p肻 ଷmpĀ;e௹ఀʀaeouy⧴⧾⨃⨐⨓ǰ⧹\0⧻;橃on;䅈dil;䅆ngĀ;dൾ⨊ot;쀀⩭̸p;橂;䐽ash;怓΀;Aadqsxஒ⨩⨭⨻⩁⩅⩐rr;懗rĀhr⨳⨶k;椤Ā;oᏲᏰot;쀀≐̸uiöୣĀei⩊⩎ar;椨í஘istĀ;s஠டr;쀀𝔫ȀEest௅⩦⩹⩼ƀ;qs஼⩭௡ƀ;qs஼௅⩴lanô௢ií௪Ā;rஶ⪁»ஷƀAap⪊⪍⪑rò⥱rr;憮ar;櫲ƀ;svྍ⪜ྌĀ;d⪡⪢拼;拺cy;䑚΀AEadest⪷⪺⪾⫂⫅⫶⫹rò⥦;쀀≦̸rr;憚r;急Ȁ;fqs఻⫎⫣⫯tĀar⫔⫙rro÷⫁ightarro÷⪐ƀ;qs఻⪺⫪lanôౕĀ;sౕ⫴»శiíౝĀ;rవ⫾iĀ;eచథiäඐĀpt⬌⬑f;쀀𝕟膀¬;in⬙⬚⬶䂬nȀ;Edvஉ⬤⬨⬮;쀀⋹̸ot;쀀⋵̸ǡஉ⬳⬵;拷;拶iĀ;vಸ⬼ǡಸ⭁⭃;拾;拽ƀaor⭋⭣⭩rȀ;ast୻⭕⭚⭟lleì୻l;쀀⫽⃥;쀀∂̸lint;樔ƀ;ceಒ⭰⭳uåಥĀ;cಘ⭸Ā;eಒ⭽ñಘȀAait⮈⮋⮝⮧rò⦈rrƀ;cw⮔⮕⮙憛;쀀⤳̸;쀀↝̸ghtarrow»⮕riĀ;eೋೖ΀chimpqu⮽⯍⯙⬄୸⯤⯯Ȁ;cerല⯆ഷ⯉uå൅;쀀𝓃ortɭ⬅\0\0⯖ará⭖mĀ;e൮⯟Ā;q൴൳suĀbp⯫⯭å೸åഋƀbcp⯶ⰑⰙȀ;Ees⯿ⰀഢⰄ抄;쀀⫅̸etĀ;eഛⰋqĀ;qണⰀcĀ;eലⰗñസȀ;EesⰢⰣൟⰧ抅;쀀⫆̸etĀ;e൘ⰮqĀ;qൠⰣȀgilrⰽⰿⱅⱇìௗlde耻ñ䃱çృiangleĀlrⱒⱜeftĀ;eచⱚñదightĀ;eೋⱥñ೗Ā;mⱬⱭ䎽ƀ;esⱴⱵⱹ䀣ro;愖p;怇ҀDHadgilrsⲏⲔⲙⲞⲣⲰⲶⳓⳣash;抭arr;椄p;쀀≍⃒ash;抬ĀetⲨⲬ;쀀≥⃒;쀀>⃒nfin;槞ƀAetⲽⳁⳅrr;椂;쀀≤⃒Ā;rⳊⳍ쀀<⃒ie;쀀⊴⃒ĀAtⳘⳜrr;椃rie;쀀⊵⃒im;쀀∼⃒ƀAan⳰⳴ⴂrr;懖rĀhr⳺⳽k;椣Ā;oᏧᏥear;椧ቓ᪕\0\0\0\0\0\0\0\0\0\0\0\0\0ⴭ\0ⴸⵈⵠⵥ⵲ⶄᬇ\0\0ⶍⶫ\0ⷈⷎ\0ⷜ⸙⸫⸾⹃Ācsⴱ᪗ute耻ó䃳ĀiyⴼⵅrĀ;c᪞ⵂ耻ô䃴;䐾ʀabios᪠ⵒⵗLjⵚlac;䅑v;樸old;榼lig;䅓Ācr⵩⵭ir;榿;쀀𝔬ͯ⵹\0\0⵼\0ⶂn;䋛ave耻ò䃲;槁Ābmⶈ෴ar;榵Ȁacitⶕ⶘ⶥⶨrò᪀Āir⶝ⶠr;榾oss;榻nå๒;槀ƀaeiⶱⶵⶹcr;䅍ga;䏉ƀcdnⷀⷅǍron;䎿;榶pf;쀀𝕠ƀaelⷔ⷗ǒr;榷rp;榹΀;adiosvⷪⷫⷮ⸈⸍⸐⸖戨rò᪆Ȁ;efmⷷⷸ⸂⸅橝rĀ;oⷾⷿ愴f»ⷿ耻ª䂪耻º䂺gof;抶r;橖lope;橗;橛ƀclo⸟⸡⸧ò⸁ash耻ø䃸l;折iŬⸯ⸴de耻õ䃵esĀ;aǛ⸺s;樶ml耻ö䃶bar;挽ૡ⹞\0⹽\0⺀⺝\0⺢⺹\0\0⻋ຜ\0⼓\0\0⼫⾼\0⿈rȀ;astЃ⹧⹲຅脀¶;l⹭⹮䂶leìЃɩ⹸\0\0⹻m;櫳;櫽y;䐿rʀcimpt⺋⺏⺓ᡥ⺗nt;䀥od;䀮il;怰enk;怱r;쀀𝔭ƀimo⺨⺰⺴Ā;v⺭⺮䏆;䏕maô੶ne;明ƀ;tv⺿⻀⻈䏀chfork»´;䏖Āau⻏⻟nĀck⻕⻝kĀ;h⇴⻛;愎ö⇴sҀ;abcdemst⻳⻴ᤈ⻹⻽⼄⼆⼊⼎䀫cir;樣ir;樢Āouᵀ⼂;樥;橲n肻±ຝim;樦wo;樧ƀipu⼙⼠⼥ntint;樕f;쀀𝕡nd耻£䂣Ԁ;Eaceinosu່⼿⽁⽄⽇⾁⾉⾒⽾⾶;檳p;檷uå໙Ā;c໎⽌̀;acens່⽙⽟⽦⽨⽾pproø⽃urlyeñ໙ñ໎ƀaes⽯⽶⽺pprox;檹qq;檵im;拨iíໟmeĀ;s⾈ຮ怲ƀEas⽸⾐⽺ð⽵ƀdfp໬⾙⾯ƀals⾠⾥⾪lar;挮ine;挒urf;挓Ā;t໻⾴ï໻rel;抰Āci⿀⿅r;쀀𝓅;䏈ncsp;怈̀fiopsu⿚⋢⿟⿥⿫⿱r;쀀𝔮pf;쀀𝕢rime;恗cr;쀀𝓆ƀaeo⿸〉〓tĀei⿾々rnionóڰnt;樖stĀ;e【】䀿ñἙô༔઀ABHabcdefhilmnoprstux぀けさすムㄎㄫㅇㅢㅲㆎ㈆㈕㈤㈩㉘㉮㉲㊐㊰㊷ƀartぇおがròႳòϝail;検aròᱥar;楤΀cdenqrtとふへみわゔヌĀeuねぱ;쀀∽̱te;䅕iãᅮmptyv;榳gȀ;del࿑らるろ;榒;榥å࿑uo耻»䂻rր;abcfhlpstw࿜ガクシスゼゾダッデナp;極Ā;f࿠ゴs;椠;椳s;椞ë≝ð✮l;楅im;楴l;憣;憝Āaiパフil;椚oĀ;nホボ戶aló༞ƀabrョリヮrò៥rk;杳ĀakンヽcĀekヹ・;䁽;䁝Āes㄂㄄;榌lĀduㄊㄌ;榎;榐Ȁaeuyㄗㄜㄧㄩron;䅙Ādiㄡㄥil;䅗ì࿲âヺ;䑀Ȁclqsㄴㄷㄽㅄa;椷dhar;楩uoĀ;rȎȍh;憳ƀacgㅎㅟངlȀ;ipsླྀㅘㅛႜnåႻarôྩt;断ƀilrㅩဣㅮsht;楽;쀀𝔯ĀaoㅷㆆrĀduㅽㅿ»ѻĀ;l႑ㆄ;楬Ā;vㆋㆌ䏁;䏱ƀgns㆕ㇹㇼht̀ahlrstㆤㆰ㇂㇘㇤㇮rrowĀ;t࿜ㆭaéトarpoonĀduㆻㆿowîㅾp»႒eftĀah㇊㇐rrowó࿪arpoonóՑightarrows;應quigarro÷ニhreetimes;拌g;䋚ingdotseñἲƀahm㈍㈐㈓rò࿪aòՑ;怏oustĀ;a㈞㈟掱che»㈟mid;櫮Ȁabpt㈲㈽㉀㉒Ānr㈷㈺g;柭r;懾rëဃƀafl㉇㉊㉎r;榆;쀀𝕣us;樮imes;樵Āap㉝㉧rĀ;g㉣㉤䀩t;榔olint;樒arò㇣Ȁachq㉻㊀Ⴜ㊅quo;怺r;쀀𝓇Ābu・㊊oĀ;rȔȓƀhir㊗㊛㊠reåㇸmes;拊iȀ;efl㊪ၙᠡ㊫方tri;槎luhar;楨;愞ൡ㋕㋛㋟㌬㌸㍱\0㍺㎤\0\0㏬㏰\0㐨㑈㑚㒭㒱㓊㓱\0㘖\0\0㘳cute;䅛quï➺Ԁ;Eaceinpsyᇭ㋳㋵㋿㌂㌋㌏㌟㌦㌩;檴ǰ㋺\0㋼;檸on;䅡uåᇾĀ;dᇳ㌇il;䅟rc;䅝ƀEas㌖㌘㌛;檶p;檺im;择olint;樓iíሄ;䑁otƀ;be㌴ᵇ㌵担;橦΀Aacmstx㍆㍊㍗㍛㍞㍣㍭rr;懘rĀhr㍐㍒ë∨Ā;oਸ਼਴t耻§䂧i;䀻war;椩mĀin㍩ðnuóñt;朶rĀ;o㍶⁕쀀𝔰Ȁacoy㎂㎆㎑㎠rp;景Āhy㎋㎏cy;䑉;䑈rtɭ㎙\0\0㎜iäᑤaraì⹯耻­䂭Āgm㎨㎴maƀ;fv㎱㎲㎲䏃;䏂Ѐ;deglnprካ㏅㏉㏎㏖㏞㏡㏦ot;橪Ā;q኱ኰĀ;E㏓㏔檞;檠Ā;E㏛㏜檝;檟e;扆lus;樤arr;楲aròᄽȀaeit㏸㐈㐏㐗Āls㏽㐄lsetmé㍪hp;樳parsl;槤Ādlᑣ㐔e;挣Ā;e㐜㐝檪Ā;s㐢㐣檬;쀀⪬︀ƀflp㐮㐳㑂tcy;䑌Ā;b㐸㐹䀯Ā;a㐾㐿槄r;挿f;쀀𝕤aĀdr㑍ЂesĀ;u㑔㑕晠it»㑕ƀcsu㑠㑹㒟Āau㑥㑯pĀ;sᆈ㑫;쀀⊓︀pĀ;sᆴ㑵;쀀⊔︀uĀbp㑿㒏ƀ;esᆗᆜ㒆etĀ;eᆗ㒍ñᆝƀ;esᆨᆭ㒖etĀ;eᆨ㒝ñᆮƀ;afᅻ㒦ְrť㒫ֱ»ᅼaròᅈȀcemt㒹㒾㓂㓅r;쀀𝓈tmîñiì㐕aræᆾĀar㓎㓕rĀ;f㓔ឿ昆Āan㓚㓭ightĀep㓣㓪psiloîỠhé⺯s»⡒ʀbcmnp㓻㕞ሉ㖋㖎Ҁ;Edemnprs㔎㔏㔑㔕㔞㔣㔬㔱㔶抂;櫅ot;檽Ā;dᇚ㔚ot;櫃ult;櫁ĀEe㔨㔪;櫋;把lus;檿arr;楹ƀeiu㔽㕒㕕tƀ;en㔎㕅㕋qĀ;qᇚ㔏eqĀ;q㔫㔨m;櫇Ābp㕚㕜;櫕;櫓c̀;acensᇭ㕬㕲㕹㕻㌦pproø㋺urlyeñᇾñᇳƀaes㖂㖈㌛pproø㌚qñ㌗g;晪ڀ123;Edehlmnps㖩㖬㖯ሜ㖲㖴㗀㗉㗕㗚㗟㗨㗭耻¹䂹耻²䂲耻³䂳;櫆Āos㖹㖼t;檾ub;櫘Ā;dሢ㗅ot;櫄sĀou㗏㗒l;柉b;櫗arr;楻ult;櫂ĀEe㗤㗦;櫌;抋lus;櫀ƀeiu㗴㘉㘌tƀ;enሜ㗼㘂qĀ;qሢ㖲eqĀ;q㗧㗤m;櫈Ābp㘑㘓;櫔;櫖ƀAan㘜㘠㘭rr;懙rĀhr㘦㘨ë∮Ā;oਫ਩war;椪lig耻ß䃟௡㙑㙝㙠ዎ㙳㙹\0㙾㛂\0\0\0\0\0㛛㜃\0㜉㝬\0\0\0㞇ɲ㙖\0\0㙛get;挖;䏄rë๟ƀaey㙦㙫㙰ron;䅥dil;䅣;䑂lrec;挕r;쀀𝔱Ȁeiko㚆㚝㚵㚼Dz㚋\0㚑eĀ4fኄኁaƀ;sv㚘㚙㚛䎸ym;䏑Ācn㚢㚲kĀas㚨㚮pproø዁im»ኬsðኞĀas㚺㚮ð዁rn耻þ䃾Ǭ̟㛆⋧es膀×;bd㛏㛐㛘䃗Ā;aᤏ㛕r;樱;樰ƀeps㛡㛣㜀á⩍Ȁ;bcf҆㛬㛰㛴ot;挶ir;櫱Ā;o㛹㛼쀀𝕥rk;櫚á㍢rime;怴ƀaip㜏㜒㝤dåቈ΀adempst㜡㝍㝀㝑㝗㝜㝟ngleʀ;dlqr㜰㜱㜶㝀㝂斵own»ᶻeftĀ;e⠀㜾ñम;扜ightĀ;e㊪㝋ñၚot;旬inus;樺lus;樹b;槍ime;樻ezium;揢ƀcht㝲㝽㞁Āry㝷㝻;쀀𝓉;䑆cy;䑛rok;䅧Āio㞋㞎xô᝷headĀlr㞗㞠eftarro÷ࡏightarrow»ཝऀAHabcdfghlmoprstuw㟐㟓㟗㟤㟰㟼㠎㠜㠣㠴㡑㡝㡫㢩㣌㣒㣪㣶ròϭar;楣Ācr㟜㟢ute耻ú䃺òᅐrǣ㟪\0㟭y;䑞ve;䅭Āiy㟵㟺rc耻û䃻;䑃ƀabh㠃㠆㠋ròᎭlac;䅱aòᏃĀir㠓㠘sht;楾;쀀𝔲rave耻ù䃹š㠧㠱rĀlr㠬㠮»ॗ»ႃlk;斀Āct㠹㡍ɯ㠿\0\0㡊rnĀ;e㡅㡆挜r»㡆op;挏ri;旸Āal㡖㡚cr;䅫肻¨͉Āgp㡢㡦on;䅳f;쀀𝕦̀adhlsuᅋ㡸㡽፲㢑㢠ownáᎳarpoonĀlr㢈㢌efô㠭ighô㠯iƀ;hl㢙㢚㢜䏅»ᏺon»㢚parrows;懈ƀcit㢰㣄㣈ɯ㢶\0\0㣁rnĀ;e㢼㢽挝r»㢽op;挎ng;䅯ri;旹cr;쀀𝓊ƀdir㣙㣝㣢ot;拰lde;䅩iĀ;f㜰㣨»᠓Āam㣯㣲rò㢨l耻ü䃼angle;榧ހABDacdeflnoprsz㤜㤟㤩㤭㦵㦸㦽㧟㧤㧨㧳㧹㧽㨁㨠ròϷarĀ;v㤦㤧櫨;櫩asèϡĀnr㤲㤷grt;榜΀eknprst㓣㥆㥋㥒㥝㥤㦖appá␕othinçẖƀhir㓫⻈㥙opô⾵Ā;hᎷ㥢ïㆍĀiu㥩㥭gmá㎳Ābp㥲㦄setneqĀ;q㥽㦀쀀⊊︀;쀀⫋︀setneqĀ;q㦏㦒쀀⊋︀;쀀⫌︀Āhr㦛㦟etá㚜iangleĀlr㦪㦯eft»थight»ၑy;䐲ash»ံƀelr㧄㧒㧗ƀ;beⷪ㧋㧏ar;抻q;扚lip;拮Ābt㧜ᑨaòᑩr;쀀𝔳tré㦮suĀbp㧯㧱»ജ»൙pf;쀀𝕧roð໻tré㦴Ācu㨆㨋r;쀀𝓋Ābp㨐㨘nĀEe㦀㨖»㥾nĀEe㦒㨞»㦐igzag;榚΀cefoprs㨶㨻㩖㩛㩔㩡㩪irc;䅵Ādi㩀㩑Ābg㩅㩉ar;機eĀ;qᗺ㩏;扙erp;愘r;쀀𝔴pf;쀀𝕨Ā;eᑹ㩦atèᑹcr;쀀𝓌ૣណ㪇\0㪋\0㪐㪛\0\0㪝㪨㪫㪯\0\0㫃㫎\0㫘ៜ៟tré៑r;쀀𝔵ĀAa㪔㪗ròσrò৶;䎾ĀAa㪡㪤ròθrò৫að✓is;拻ƀdptឤ㪵㪾Āfl㪺ឩ;쀀𝕩imåឲĀAa㫇㫊ròώròਁĀcq㫒ីr;쀀𝓍Āpt៖㫜ré។Ѐacefiosu㫰㫽㬈㬌㬑㬕㬛㬡cĀuy㫶㫻te耻ý䃽;䑏Āiy㬂㬆rc;䅷;䑋n耻¥䂥r;쀀𝔶cy;䑗pf;쀀𝕪cr;쀀𝓎Ācm㬦㬩y;䑎l耻ÿ䃿Ԁacdefhiosw㭂㭈㭔㭘㭤㭩㭭㭴㭺㮀cute;䅺Āay㭍㭒ron;䅾;䐷ot;䅼Āet㭝㭡træᕟa;䎶r;쀀𝔷cy;䐶grarr;懝pf;쀀𝕫cr;쀀𝓏Ājn㮅㮇;怍j;怌'.split("").map(e=>e.charCodeAt(0))),O$=new Map([[0,65533],[128,8364],[130,8218],[131,402],[132,8222],[133,8230],[134,8224],[135,8225],[136,710],[137,8240],[138,352],[139,8249],[140,338],[142,381],[145,8216],[146,8217],[147,8220],[148,8221],[149,8226],[150,8211],[151,8212],[152,732],[153,8482],[154,353],[155,8250],[156,339],[158,382],[159,376]]);function I$(e){var t;return e>=55296&&e<=57343||e>1114111?65533:(t=O$.get(e))!==null&&t!==void 0?t:e}var Yn;(function(e){e[e.NUM=35]="NUM",e[e.SEMI=59]="SEMI",e[e.EQUALS=61]="EQUALS",e[e.ZERO=48]="ZERO",e[e.NINE=57]="NINE",e[e.LOWER_A=97]="LOWER_A",e[e.LOWER_F=102]="LOWER_F",e[e.LOWER_X=120]="LOWER_X",e[e.LOWER_Z=122]="LOWER_Z",e[e.UPPER_A=65]="UPPER_A",e[e.UPPER_F=70]="UPPER_F",e[e.UPPER_Z=90]="UPPER_Z"})(Yn||(Yn={}));const M$=32;var na;(function(e){e[e.VALUE_LENGTH=49152]="VALUE_LENGTH",e[e.BRANCH_LENGTH=16256]="BRANCH_LENGTH",e[e.JUMP_TABLE=127]="JUMP_TABLE"})(na||(na={}));function Zb(e){return e>=Yn.ZERO&&e<=Yn.NINE}function L$(e){return e>=Yn.UPPER_A&&e<=Yn.UPPER_F||e>=Yn.LOWER_A&&e<=Yn.LOWER_F}function D$(e){return e>=Yn.UPPER_A&&e<=Yn.UPPER_Z||e>=Yn.LOWER_A&&e<=Yn.LOWER_Z||Zb(e)}function P$(e){return e===Yn.EQUALS||D$(e)}var $n;(function(e){e[e.EntityStart=0]="EntityStart",e[e.NumericStart=1]="NumericStart",e[e.NumericDecimal=2]="NumericDecimal",e[e.NumericHex=3]="NumericHex",e[e.NamedEntity=4]="NamedEntity"})($n||($n={}));var oi;(function(e){e[e.Legacy=0]="Legacy",e[e.Strict=1]="Strict",e[e.Attribute=2]="Attribute"})(oi||(oi={}));class j${constructor(t,n,r){this.decodeTree=t,this.emitCodePoint=n,this.errors=r,this.state=$n.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=oi.Strict}startEntity(t){this.decodeMode=t,this.state=$n.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1}write(t,n){switch(this.state){case $n.EntityStart:return t.charCodeAt(n)===Yn.NUM?(this.state=$n.NumericStart,this.consumed+=1,this.stateNumericStart(t,n+1)):(this.state=$n.NamedEntity,this.stateNamedEntity(t,n));case $n.NumericStart:return this.stateNumericStart(t,n);case $n.NumericDecimal:return this.stateNumericDecimal(t,n);case $n.NumericHex:return this.stateNumericHex(t,n);case $n.NamedEntity:return this.stateNamedEntity(t,n)}}stateNumericStart(t,n){return n>=t.length?-1:(t.charCodeAt(n)|M$)===Yn.LOWER_X?(this.state=$n.NumericHex,this.consumed+=1,this.stateNumericHex(t,n+1)):(this.state=$n.NumericDecimal,this.stateNumericDecimal(t,n))}addToNumericResult(t,n,r,i){if(n!==r){const a=r-n;this.result=this.result*Math.pow(i,a)+Number.parseInt(t.substr(n,a),i),this.consumed+=a}}stateNumericHex(t,n){const r=n;for(;n<t.length;){const i=t.charCodeAt(n);if(Zb(i)||L$(i))n+=1;else return this.addToNumericResult(t,r,n,16),this.emitNumericEntity(i,3)}return this.addToNumericResult(t,r,n,16),-1}stateNumericDecimal(t,n){const r=n;for(;n<t.length;){const i=t.charCodeAt(n);if(Zb(i))n+=1;else return this.addToNumericResult(t,r,n,10),this.emitNumericEntity(i,2)}return this.addToNumericResult(t,r,n,10),-1}emitNumericEntity(t,n){var r;if(this.consumed<=n)return(r=this.errors)===null||r===void 0||r.absenceOfDigitsInNumericCharacterReference(this.consumed),0;if(t===Yn.SEMI)this.consumed+=1;else if(this.decodeMode===oi.Strict)return 0;return this.emitCodePoint(I$(this.result),this.consumed),this.errors&&(t!==Yn.SEMI&&this.errors.missingSemicolonAfterCharacterReference(),this.errors.validateNumericCharacterReference(this.result)),this.consumed}stateNamedEntity(t,n){const{decodeTree:r}=this;let i=r[this.treeIndex],a=(i&na.VALUE_LENGTH)>>14;for(;n<t.length;n++,this.excess++){const l=t.charCodeAt(n);if(this.treeIndex=B$(r,i,this.treeIndex+Math.max(1,a),l),this.treeIndex<0)return this.result===0||this.decodeMode===oi.Attribute&&(a===0||P$(l))?0:this.emitNotTerminatedNamedEntity();if(i=r[this.treeIndex],a=(i&na.VALUE_LENGTH)>>14,a!==0){if(l===Yn.SEMI)return this.emitNamedEntityData(this.treeIndex,a,this.consumed+this.excess);this.decodeMode!==oi.Strict&&(this.result=this.treeIndex,this.consumed+=this.excess,this.excess=0)}}return-1}emitNotTerminatedNamedEntity(){var t;const{result:n,decodeTree:r}=this,i=(r[n]&na.VALUE_LENGTH)>>14;return this.emitNamedEntityData(n,i,this.consumed),(t=this.errors)===null||t===void 0||t.missingSemicolonAfterCharacterReference(),this.consumed}emitNamedEntityData(t,n,r){const{decodeTree:i}=this;return this.emitCodePoint(n===1?i[t]&~na.VALUE_LENGTH:i[t+1],r),n===3&&this.emitCodePoint(i[t+2],r),r}end(){var t;switch(this.state){case $n.NamedEntity:return this.result!==0&&(this.decodeMode!==oi.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case $n.NumericDecimal:return this.emitNumericEntity(0,2);case $n.NumericHex:return this.emitNumericEntity(0,3);case $n.NumericStart:return(t=this.errors)===null||t===void 0||t.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case $n.EntityStart:return 0}}}function B$(e,t,n,r){const i=(t&na.BRANCH_LENGTH)>>7,a=t&na.JUMP_TABLE;if(i===0)return a!==0&&r===a?n:-1;if(a){const d=r-a;return d<0||d>=i?-1:e[n+d]-1}let l=n,c=l+i-1;for(;l<=c;){const d=l+c>>>1,f=e[d];if(f<r)l=d+1;else if(f>r)c=d-1;else return e[d+i]}return-1}var Me;(function(e){e.HTML="http://www.w3.org/1999/xhtml",e.MATHML="http://www.w3.org/1998/Math/MathML",e.SVG="http://www.w3.org/2000/svg",e.XLINK="http://www.w3.org/1999/xlink",e.XML="http://www.w3.org/XML/1998/namespace",e.XMLNS="http://www.w3.org/2000/xmlns/"})(Me||(Me={}));var no;(function(e){e.TYPE="type",e.ACTION="action",e.ENCODING="encoding",e.PROMPT="prompt",e.NAME="name",e.COLOR="color",e.FACE="face",e.SIZE="size"})(no||(no={}));var rs;(function(e){e.NO_QUIRKS="no-quirks",e.QUIRKS="quirks",e.LIMITED_QUIRKS="limited-quirks"})(rs||(rs={}));var me;(function(e){e.A="a",e.ADDRESS="address",e.ANNOTATION_XML="annotation-xml",e.APPLET="applet",e.AREA="area",e.ARTICLE="article",e.ASIDE="aside",e.B="b",e.BASE="base",e.BASEFONT="basefont",e.BGSOUND="bgsound",e.BIG="big",e.BLOCKQUOTE="blockquote",e.BODY="body",e.BR="br",e.BUTTON="button",e.CAPTION="caption",e.CENTER="center",e.CODE="code",e.COL="col",e.COLGROUP="colgroup",e.DD="dd",e.DESC="desc",e.DETAILS="details",e.DIALOG="dialog",e.DIR="dir",e.DIV="div",e.DL="dl",e.DT="dt",e.EM="em",e.EMBED="embed",e.FIELDSET="fieldset",e.FIGCAPTION="figcaption",e.FIGURE="figure",e.FONT="font",e.FOOTER="footer",e.FOREIGN_OBJECT="foreignObject",e.FORM="form",e.FRAME="frame",e.FRAMESET="frameset",e.H1="h1",e.H2="h2",e.H3="h3",e.H4="h4",e.H5="h5",e.H6="h6",e.HEAD="head",e.HEADER="header",e.HGROUP="hgroup",e.HR="hr",e.HTML="html",e.I="i",e.IMG="img",e.IMAGE="image",e.INPUT="input",e.IFRAME="iframe",e.KEYGEN="keygen",e.LABEL="label",e.LI="li",e.LINK="link",e.LISTING="listing",e.MAIN="main",e.MALIGNMARK="malignmark",e.MARQUEE="marquee",e.MATH="math",e.MENU="menu",e.META="meta",e.MGLYPH="mglyph",e.MI="mi",e.MO="mo",e.MN="mn",e.MS="ms",e.MTEXT="mtext",e.NAV="nav",e.NOBR="nobr",e.NOFRAMES="noframes",e.NOEMBED="noembed",e.NOSCRIPT="noscript",e.OBJECT="object",e.OL="ol",e.OPTGROUP="optgroup",e.OPTION="option",e.P="p",e.PARAM="param",e.PLAINTEXT="plaintext",e.PRE="pre",e.RB="rb",e.RP="rp",e.RT="rt",e.RTC="rtc",e.RUBY="ruby",e.S="s",e.SCRIPT="script",e.SEARCH="search",e.SECTION="section",e.SELECT="select",e.SOURCE="source",e.SMALL="small",e.SPAN="span",e.STRIKE="strike",e.STRONG="strong",e.STYLE="style",e.SUB="sub",e.SUMMARY="summary",e.SUP="sup",e.TABLE="table",e.TBODY="tbody",e.TEMPLATE="template",e.TEXTAREA="textarea",e.TFOOT="tfoot",e.TD="td",e.TH="th",e.THEAD="thead",e.TITLE="title",e.TR="tr",e.TRACK="track",e.TT="tt",e.U="u",e.UL="ul",e.SVG="svg",e.VAR="var",e.WBR="wbr",e.XMP="xmp"})(me||(me={}));var S;(function(e){e[e.UNKNOWN=0]="UNKNOWN",e[e.A=1]="A",e[e.ADDRESS=2]="ADDRESS",e[e.ANNOTATION_XML=3]="ANNOTATION_XML",e[e.APPLET=4]="APPLET",e[e.AREA=5]="AREA",e[e.ARTICLE=6]="ARTICLE",e[e.ASIDE=7]="ASIDE",e[e.B=8]="B",e[e.BASE=9]="BASE",e[e.BASEFONT=10]="BASEFONT",e[e.BGSOUND=11]="BGSOUND",e[e.BIG=12]="BIG",e[e.BLOCKQUOTE=13]="BLOCKQUOTE",e[e.BODY=14]="BODY",e[e.BR=15]="BR",e[e.BUTTON=16]="BUTTON",e[e.CAPTION=17]="CAPTION",e[e.CENTER=18]="CENTER",e[e.CODE=19]="CODE",e[e.COL=20]="COL",e[e.COLGROUP=21]="COLGROUP",e[e.DD=22]="DD",e[e.DESC=23]="DESC",e[e.DETAILS=24]="DETAILS",e[e.DIALOG=25]="DIALOG",e[e.DIR=26]="DIR",e[e.DIV=27]="DIV",e[e.DL=28]="DL",e[e.DT=29]="DT",e[e.EM=30]="EM",e[e.EMBED=31]="EMBED",e[e.FIELDSET=32]="FIELDSET",e[e.FIGCAPTION=33]="FIGCAPTION",e[e.FIGURE=34]="FIGURE",e[e.FONT=35]="FONT",e[e.FOOTER=36]="FOOTER",e[e.FOREIGN_OBJECT=37]="FOREIGN_OBJECT",e[e.FORM=38]="FORM",e[e.FRAME=39]="FRAME",e[e.FRAMESET=40]="FRAMESET",e[e.H1=41]="H1",e[e.H2=42]="H2",e[e.H3=43]="H3",e[e.H4=44]="H4",e[e.H5=45]="H5",e[e.H6=46]="H6",e[e.HEAD=47]="HEAD",e[e.HEADER=48]="HEADER",e[e.HGROUP=49]="HGROUP",e[e.HR=50]="HR",e[e.HTML=51]="HTML",e[e.I=52]="I",e[e.IMG=53]="IMG",e[e.IMAGE=54]="IMAGE",e[e.INPUT=55]="INPUT",e[e.IFRAME=56]="IFRAME",e[e.KEYGEN=57]="KEYGEN",e[e.LABEL=58]="LABEL",e[e.LI=59]="LI",e[e.LINK=60]="LINK",e[e.LISTING=61]="LISTING",e[e.MAIN=62]="MAIN",e[e.MALIGNMARK=63]="MALIGNMARK",e[e.MARQUEE=64]="MARQUEE",e[e.MATH=65]="MATH",e[e.MENU=66]="MENU",e[e.META=67]="META",e[e.MGLYPH=68]="MGLYPH",e[e.MI=69]="MI",e[e.MO=70]="MO",e[e.MN=71]="MN",e[e.MS=72]="MS",e[e.MTEXT=73]="MTEXT",e[e.NAV=74]="NAV",e[e.NOBR=75]="NOBR",e[e.NOFRAMES=76]="NOFRAMES",e[e.NOEMBED=77]="NOEMBED",e[e.NOSCRIPT=78]="NOSCRIPT",e[e.OBJECT=79]="OBJECT",e[e.OL=80]="OL",e[e.OPTGROUP=81]="OPTGROUP",e[e.OPTION=82]="OPTION",e[e.P=83]="P",e[e.PARAM=84]="PARAM",e[e.PLAINTEXT=85]="PLAINTEXT",e[e.PRE=86]="PRE",e[e.RB=87]="RB",e[e.RP=88]="RP",e[e.RT=89]="RT",e[e.RTC=90]="RTC",e[e.RUBY=91]="RUBY",e[e.S=92]="S",e[e.SCRIPT=93]="SCRIPT",e[e.SEARCH=94]="SEARCH",e[e.SECTION=95]="SECTION",e[e.SELECT=96]="SELECT",e[e.SOURCE=97]="SOURCE",e[e.SMALL=98]="SMALL",e[e.SPAN=99]="SPAN",e[e.STRIKE=100]="STRIKE",e[e.STRONG=101]="STRONG",e[e.STYLE=102]="STYLE",e[e.SUB=103]="SUB",e[e.SUMMARY=104]="SUMMARY",e[e.SUP=105]="SUP",e[e.TABLE=106]="TABLE",e[e.TBODY=107]="TBODY",e[e.TEMPLATE=108]="TEMPLATE",e[e.TEXTAREA=109]="TEXTAREA",e[e.TFOOT=110]="TFOOT",e[e.TD=111]="TD",e[e.TH=112]="TH",e[e.THEAD=113]="THEAD",e[e.TITLE=114]="TITLE",e[e.TR=115]="TR",e[e.TRACK=116]="TRACK",e[e.TT=117]="TT",e[e.U=118]="U",e[e.UL=119]="UL",e[e.SVG=120]="SVG",e[e.VAR=121]="VAR",e[e.WBR=122]="WBR",e[e.XMP=123]="XMP"})(S||(S={}));const H$=new Map([[me.A,S.A],[me.ADDRESS,S.ADDRESS],[me.ANNOTATION_XML,S.ANNOTATION_XML],[me.APPLET,S.APPLET],[me.AREA,S.AREA],[me.ARTICLE,S.ARTICLE],[me.ASIDE,S.ASIDE],[me.B,S.B],[me.BASE,S.BASE],[me.BASEFONT,S.BASEFONT],[me.BGSOUND,S.BGSOUND],[me.BIG,S.BIG],[me.BLOCKQUOTE,S.BLOCKQUOTE],[me.BODY,S.BODY],[me.BR,S.BR],[me.BUTTON,S.BUTTON],[me.CAPTION,S.CAPTION],[me.CENTER,S.CENTER],[me.CODE,S.CODE],[me.COL,S.COL],[me.COLGROUP,S.COLGROUP],[me.DD,S.DD],[me.DESC,S.DESC],[me.DETAILS,S.DETAILS],[me.DIALOG,S.DIALOG],[me.DIR,S.DIR],[me.DIV,S.DIV],[me.DL,S.DL],[me.DT,S.DT],[me.EM,S.EM],[me.EMBED,S.EMBED],[me.FIELDSET,S.FIELDSET],[me.FIGCAPTION,S.FIGCAPTION],[me.FIGURE,S.FIGURE],[me.FONT,S.FONT],[me.FOOTER,S.FOOTER],[me.FOREIGN_OBJECT,S.FOREIGN_OBJECT],[me.FORM,S.FORM],[me.FRAME,S.FRAME],[me.FRAMESET,S.FRAMESET],[me.H1,S.H1],[me.H2,S.H2],[me.H3,S.H3],[me.H4,S.H4],[me.H5,S.H5],[me.H6,S.H6],[me.HEAD,S.HEAD],[me.HEADER,S.HEADER],[me.HGROUP,S.HGROUP],[me.HR,S.HR],[me.HTML,S.HTML],[me.I,S.I],[me.IMG,S.IMG],[me.IMAGE,S.IMAGE],[me.INPUT,S.INPUT],[me.IFRAME,S.IFRAME],[me.KEYGEN,S.KEYGEN],[me.LABEL,S.LABEL],[me.LI,S.LI],[me.LINK,S.LINK],[me.LISTING,S.LISTING],[me.MAIN,S.MAIN],[me.MALIGNMARK,S.MALIGNMARK],[me.MARQUEE,S.MARQUEE],[me.MATH,S.MATH],[me.MENU,S.MENU],[me.META,S.META],[me.MGLYPH,S.MGLYPH],[me.MI,S.MI],[me.MO,S.MO],[me.MN,S.MN],[me.MS,S.MS],[me.MTEXT,S.MTEXT],[me.NAV,S.NAV],[me.NOBR,S.NOBR],[me.NOFRAMES,S.NOFRAMES],[me.NOEMBED,S.NOEMBED],[me.NOSCRIPT,S.NOSCRIPT],[me.OBJECT,S.OBJECT],[me.OL,S.OL],[me.OPTGROUP,S.OPTGROUP],[me.OPTION,S.OPTION],[me.P,S.P],[me.PARAM,S.PARAM],[me.PLAINTEXT,S.PLAINTEXT],[me.PRE,S.PRE],[me.RB,S.RB],[me.RP,S.RP],[me.RT,S.RT],[me.RTC,S.RTC],[me.RUBY,S.RUBY],[me.S,S.S],[me.SCRIPT,S.SCRIPT],[me.SEARCH,S.SEARCH],[me.SECTION,S.SECTION],[me.SELECT,S.SELECT],[me.SOURCE,S.SOURCE],[me.SMALL,S.SMALL],[me.SPAN,S.SPAN],[me.STRIKE,S.STRIKE],[me.STRONG,S.STRONG],[me.STYLE,S.STYLE],[me.SUB,S.SUB],[me.SUMMARY,S.SUMMARY],[me.SUP,S.SUP],[me.TABLE,S.TABLE],[me.TBODY,S.TBODY],[me.TEMPLATE,S.TEMPLATE],[me.TEXTAREA,S.TEXTAREA],[me.TFOOT,S.TFOOT],[me.TD,S.TD],[me.TH,S.TH],[me.THEAD,S.THEAD],[me.TITLE,S.TITLE],[me.TR,S.TR],[me.TRACK,S.TRACK],[me.TT,S.TT],[me.U,S.U],[me.UL,S.UL],[me.SVG,S.SVG],[me.VAR,S.VAR],[me.WBR,S.WBR],[me.XMP,S.XMP]]);function eu(e){var t;return(t=H$.get(e))!==null&&t!==void 0?t:S.UNKNOWN}const je=S,U$={[Me.HTML]:new Set([je.ADDRESS,je.APPLET,je.AREA,je.ARTICLE,je.ASIDE,je.BASE,je.BASEFONT,je.BGSOUND,je.BLOCKQUOTE,je.BODY,je.BR,je.BUTTON,je.CAPTION,je.CENTER,je.COL,je.COLGROUP,je.DD,je.DETAILS,je.DIR,je.DIV,je.DL,je.DT,je.EMBED,je.FIELDSET,je.FIGCAPTION,je.FIGURE,je.FOOTER,je.FORM,je.FRAME,je.FRAMESET,je.H1,je.H2,je.H3,je.H4,je.H5,je.H6,je.HEAD,je.HEADER,je.HGROUP,je.HR,je.HTML,je.IFRAME,je.IMG,je.INPUT,je.LI,je.LINK,je.LISTING,je.MAIN,je.MARQUEE,je.MENU,je.META,je.NAV,je.NOEMBED,je.NOFRAMES,je.NOSCRIPT,je.OBJECT,je.OL,je.P,je.PARAM,je.PLAINTEXT,je.PRE,je.SCRIPT,je.SECTION,je.SELECT,je.SOURCE,je.STYLE,je.SUMMARY,je.TABLE,je.TBODY,je.TD,je.TEMPLATE,je.TEXTAREA,je.TFOOT,je.TH,je.THEAD,je.TITLE,je.TR,je.TRACK,je.UL,je.WBR,je.XMP]),[Me.MATHML]:new Set([je.MI,je.MO,je.MN,je.MS,je.MTEXT,je.ANNOTATION_XML]),[Me.SVG]:new Set([je.TITLE,je.FOREIGN_OBJECT,je.DESC]),[Me.XLINK]:new Set,[Me.XML]:new Set,[Me.XMLNS]:new Set},Jb=new Set([je.H1,je.H2,je.H3,je.H4,je.H5,je.H6]);me.STYLE,me.SCRIPT,me.XMP,me.IFRAME,me.NOEMBED,me.NOFRAMES,me.PLAINTEXT;var Z;(function(e){e[e.DATA=0]="DATA",e[e.RCDATA=1]="RCDATA",e[e.RAWTEXT=2]="RAWTEXT",e[e.SCRIPT_DATA=3]="SCRIPT_DATA",e[e.PLAINTEXT=4]="PLAINTEXT",e[e.TAG_OPEN=5]="TAG_OPEN",e[e.END_TAG_OPEN=6]="END_TAG_OPEN",e[e.TAG_NAME=7]="TAG_NAME",e[e.RCDATA_LESS_THAN_SIGN=8]="RCDATA_LESS_THAN_SIGN",e[e.RCDATA_END_TAG_OPEN=9]="RCDATA_END_TAG_OPEN",e[e.RCDATA_END_TAG_NAME=10]="RCDATA_END_TAG_NAME",e[e.RAWTEXT_LESS_THAN_SIGN=11]="RAWTEXT_LESS_THAN_SIGN",e[e.RAWTEXT_END_TAG_OPEN=12]="RAWTEXT_END_TAG_OPEN",e[e.RAWTEXT_END_TAG_NAME=13]="RAWTEXT_END_TAG_NAME",e[e.SCRIPT_DATA_LESS_THAN_SIGN=14]="SCRIPT_DATA_LESS_THAN_SIGN",e[e.SCRIPT_DATA_END_TAG_OPEN=15]="SCRIPT_DATA_END_TAG_OPEN",e[e.SCRIPT_DATA_END_TAG_NAME=16]="SCRIPT_DATA_END_TAG_NAME",e[e.SCRIPT_DATA_ESCAPE_START=17]="SCRIPT_DATA_ESCAPE_START",e[e.SCRIPT_DATA_ESCAPE_START_DASH=18]="SCRIPT_DATA_ESCAPE_START_DASH",e[e.SCRIPT_DATA_ESCAPED=19]="SCRIPT_DATA_ESCAPED",e[e.SCRIPT_DATA_ESCAPED_DASH=20]="SCRIPT_DATA_ESCAPED_DASH",e[e.SCRIPT_DATA_ESCAPED_DASH_DASH=21]="SCRIPT_DATA_ESCAPED_DASH_DASH",e[e.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN=22]="SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN",e[e.SCRIPT_DATA_ESCAPED_END_TAG_OPEN=23]="SCRIPT_DATA_ESCAPED_END_TAG_OPEN",e[e.SCRIPT_DATA_ESCAPED_END_TAG_NAME=24]="SCRIPT_DATA_ESCAPED_END_TAG_NAME",e[e.SCRIPT_DATA_DOUBLE_ESCAPE_START=25]="SCRIPT_DATA_DOUBLE_ESCAPE_START",e[e.SCRIPT_DATA_DOUBLE_ESCAPED=26]="SCRIPT_DATA_DOUBLE_ESCAPED",e[e.SCRIPT_DATA_DOUBLE_ESCAPED_DASH=27]="SCRIPT_DATA_DOUBLE_ESCAPED_DASH",e[e.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH=28]="SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH",e[e.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN=29]="SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN",e[e.SCRIPT_DATA_DOUBLE_ESCAPE_END=30]="SCRIPT_DATA_DOUBLE_ESCAPE_END",e[e.BEFORE_ATTRIBUTE_NAME=31]="BEFORE_ATTRIBUTE_NAME",e[e.ATTRIBUTE_NAME=32]="ATTRIBUTE_NAME",e[e.AFTER_ATTRIBUTE_NAME=33]="AFTER_ATTRIBUTE_NAME",e[e.BEFORE_ATTRIBUTE_VALUE=34]="BEFORE_ATTRIBUTE_VALUE",e[e.ATTRIBUTE_VALUE_DOUBLE_QUOTED=35]="ATTRIBUTE_VALUE_DOUBLE_QUOTED",e[e.ATTRIBUTE_VALUE_SINGLE_QUOTED=36]="ATTRIBUTE_VALUE_SINGLE_QUOTED",e[e.ATTRIBUTE_VALUE_UNQUOTED=37]="ATTRIBUTE_VALUE_UNQUOTED",e[e.AFTER_ATTRIBUTE_VALUE_QUOTED=38]="AFTER_ATTRIBUTE_VALUE_QUOTED",e[e.SELF_CLOSING_START_TAG=39]="SELF_CLOSING_START_TAG",e[e.BOGUS_COMMENT=40]="BOGUS_COMMENT",e[e.MARKUP_DECLARATION_OPEN=41]="MARKUP_DECLARATION_OPEN",e[e.COMMENT_START=42]="COMMENT_START",e[e.COMMENT_START_DASH=43]="COMMENT_START_DASH",e[e.COMMENT=44]="COMMENT",e[e.COMMENT_LESS_THAN_SIGN=45]="COMMENT_LESS_THAN_SIGN",e[e.COMMENT_LESS_THAN_SIGN_BANG=46]="COMMENT_LESS_THAN_SIGN_BANG",e[e.COMMENT_LESS_THAN_SIGN_BANG_DASH=47]="COMMENT_LESS_THAN_SIGN_BANG_DASH",e[e.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH=48]="COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH",e[e.COMMENT_END_DASH=49]="COMMENT_END_DASH",e[e.COMMENT_END=50]="COMMENT_END",e[e.COMMENT_END_BANG=51]="COMMENT_END_BANG",e[e.DOCTYPE=52]="DOCTYPE",e[e.BEFORE_DOCTYPE_NAME=53]="BEFORE_DOCTYPE_NAME",e[e.DOCTYPE_NAME=54]="DOCTYPE_NAME",e[e.AFTER_DOCTYPE_NAME=55]="AFTER_DOCTYPE_NAME",e[e.AFTER_DOCTYPE_PUBLIC_KEYWORD=56]="AFTER_DOCTYPE_PUBLIC_KEYWORD",e[e.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER=57]="BEFORE_DOCTYPE_PUBLIC_IDENTIFIER",e[e.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED=58]="DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED",e[e.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED=59]="DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED",e[e.AFTER_DOCTYPE_PUBLIC_IDENTIFIER=60]="AFTER_DOCTYPE_PUBLIC_IDENTIFIER",e[e.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS=61]="BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS",e[e.AFTER_DOCTYPE_SYSTEM_KEYWORD=62]="AFTER_DOCTYPE_SYSTEM_KEYWORD",e[e.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER=63]="BEFORE_DOCTYPE_SYSTEM_IDENTIFIER",e[e.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED=64]="DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED",e[e.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED=65]="DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED",e[e.AFTER_DOCTYPE_SYSTEM_IDENTIFIER=66]="AFTER_DOCTYPE_SYSTEM_IDENTIFIER",e[e.BOGUS_DOCTYPE=67]="BOGUS_DOCTYPE",e[e.CDATA_SECTION=68]="CDATA_SECTION",e[e.CDATA_SECTION_BRACKET=69]="CDATA_SECTION_BRACKET",e[e.CDATA_SECTION_END=70]="CDATA_SECTION_END",e[e.CHARACTER_REFERENCE=71]="CHARACTER_REFERENCE",e[e.AMBIGUOUS_AMPERSAND=72]="AMBIGUOUS_AMPERSAND"})(Z||(Z={}));const kn={DATA:Z.DATA,RCDATA:Z.RCDATA,RAWTEXT:Z.RAWTEXT,SCRIPT_DATA:Z.SCRIPT_DATA,PLAINTEXT:Z.PLAINTEXT,CDATA_SECTION:Z.CDATA_SECTION};function z$(e){return e>=Y.DIGIT_0&&e<=Y.DIGIT_9}function xc(e){return e>=Y.LATIN_CAPITAL_A&&e<=Y.LATIN_CAPITAL_Z}function F$(e){return e>=Y.LATIN_SMALL_A&&e<=Y.LATIN_SMALL_Z}function Ki(e){return F$(e)||xc(e)}function BC(e){return Ki(e)||z$(e)}function Zf(e){return e+32}function H_(e){return e===Y.SPACE||e===Y.LINE_FEED||e===Y.TABULATION||e===Y.FORM_FEED}function HC(e){return H_(e)||e===Y.SOLIDUS||e===Y.GREATER_THAN_SIGN}function $$(e){return e===Y.NULL?Ce.nullCharacterReference:e>1114111?Ce.characterReferenceOutsideUnicodeRange:D_(e)?Ce.surrogateCharacterReference:j_(e)?Ce.noncharacterCharacterReference:P_(e)||e===Y.CARRIAGE_RETURN?Ce.controlCharacterReference:null}class V${constructor(t,n){this.options=t,this.handler=n,this.paused=!1,this.inLoop=!1,this.inForeignNode=!1,this.lastStartTagName="",this.active=!1,this.state=Z.DATA,this.returnState=Z.DATA,this.entityStartPos=0,this.consumedAfterSnapshot=-1,this.currentCharacterToken=null,this.currentToken=null,this.currentAttr={name:"",value:""},this.preprocessor=new _$(n),this.currentLocation=this.getCurrentLocation(-1),this.entityDecoder=new j$(R$,(r,i)=>{this.preprocessor.pos=this.entityStartPos+i-1,this._flushCodePointConsumedAsCharacterReference(r)},n.onParseError?{missingSemicolonAfterCharacterReference:()=>{this._err(Ce.missingSemicolonAfterCharacterReference,1)},absenceOfDigitsInNumericCharacterReference:r=>{this._err(Ce.absenceOfDigitsInNumericCharacterReference,this.entityStartPos-this.preprocessor.pos+r)},validateNumericCharacterReference:r=>{const i=$$(r);i&&this._err(i,1)}}:void 0)}_err(t,n=0){var r,i;(i=(r=this.handler).onParseError)===null||i===void 0||i.call(r,this.preprocessor.getError(t,n))}getCurrentLocation(t){return this.options.sourceCodeLocationInfo?{startLine:this.preprocessor.line,startCol:this.preprocessor.col-t,startOffset:this.preprocessor.offset-t,endLine:-1,endCol:-1,endOffset:-1}:null}_runParsingLoop(){if(!this.inLoop){for(this.inLoop=!0;this.active&&!this.paused;){this.consumedAfterSnapshot=0;const t=this._consume();this._ensureHibernation()||this._callState(t)}this.inLoop=!1}}pause(){this.paused=!0}resume(t){if(!this.paused)throw new Error("Parser was already resumed");this.paused=!1,!this.inLoop&&(this._runParsingLoop(),this.paused||t?.())}write(t,n,r){this.active=!0,this.preprocessor.write(t,n),this._runParsingLoop(),this.paused||r?.()}insertHtmlAtCurrentPos(t){this.active=!0,this.preprocessor.insertHtmlAtCurrentPos(t),this._runParsingLoop()}_ensureHibernation(){return this.preprocessor.endOfChunkHit?(this.preprocessor.retreat(this.consumedAfterSnapshot),this.consumedAfterSnapshot=0,this.active=!1,!0):!1}_consume(){return this.consumedAfterSnapshot++,this.preprocessor.advance()}_advanceBy(t){this.consumedAfterSnapshot+=t;for(let n=0;n<t;n++)this.preprocessor.advance()}_consumeSequenceIfMatch(t,n){return this.preprocessor.startsWith(t,n)?(this._advanceBy(t.length-1),!0):!1}_createStartTagToken(){this.currentToken={type:Ct.START_TAG,tagName:"",tagID:S.UNKNOWN,selfClosing:!1,ackSelfClosing:!1,attrs:[],location:this.getCurrentLocation(1)}}_createEndTagToken(){this.currentToken={type:Ct.END_TAG,tagName:"",tagID:S.UNKNOWN,selfClosing:!1,ackSelfClosing:!1,attrs:[],location:this.getCurrentLocation(2)}}_createCommentToken(t){this.currentToken={type:Ct.COMMENT,data:"",location:this.getCurrentLocation(t)}}_createDoctypeToken(t){this.currentToken={type:Ct.DOCTYPE,name:t,forceQuirks:!1,publicId:null,systemId:null,location:this.currentLocation}}_createCharacterToken(t,n){this.currentCharacterToken={type:t,chars:n,location:this.currentLocation}}_createAttr(t){this.currentAttr={name:t,value:""},this.currentLocation=this.getCurrentLocation(0)}_leaveAttrName(){var t,n;const r=this.currentToken;if(B_(r,this.currentAttr.name)===null){if(r.attrs.push(this.currentAttr),r.location&&this.currentLocation){const i=(t=(n=r.location).attrs)!==null&&t!==void 0?t:n.attrs=Object.create(null);i[this.currentAttr.name]=this.currentLocation,this._leaveAttrValue()}}else this._err(Ce.duplicateAttribute)}_leaveAttrValue(){this.currentLocation&&(this.currentLocation.endLine=this.preprocessor.line,this.currentLocation.endCol=this.preprocessor.col,this.currentLocation.endOffset=this.preprocessor.offset)}prepareToken(t){this._emitCurrentCharacterToken(t.location),this.currentToken=null,t.location&&(t.location.endLine=this.preprocessor.line,t.location.endCol=this.preprocessor.col+1,t.location.endOffset=this.preprocessor.offset+1),this.currentLocation=this.getCurrentLocation(-1)}emitCurrentTagToken(){const t=this.currentToken;this.prepareToken(t),t.tagID=eu(t.tagName),t.type===Ct.START_TAG?(this.lastStartTagName=t.tagName,this.handler.onStartTag(t)):(t.attrs.length>0&&this._err(Ce.endTagWithAttributes),t.selfClosing&&this._err(Ce.endTagWithTrailingSolidus),this.handler.onEndTag(t)),this.preprocessor.dropParsedChunk()}emitCurrentComment(t){this.prepareToken(t),this.handler.onComment(t),this.preprocessor.dropParsedChunk()}emitCurrentDoctype(t){this.prepareToken(t),this.handler.onDoctype(t),this.preprocessor.dropParsedChunk()}_emitCurrentCharacterToken(t){if(this.currentCharacterToken){switch(t&&this.currentCharacterToken.location&&(this.currentCharacterToken.location.endLine=t.startLine,this.currentCharacterToken.location.endCol=t.startCol,this.currentCharacterToken.location.endOffset=t.startOffset),this.currentCharacterToken.type){case Ct.CHARACTER:{this.handler.onCharacter(this.currentCharacterToken);break}case Ct.NULL_CHARACTER:{this.handler.onNullCharacter(this.currentCharacterToken);break}case Ct.WHITESPACE_CHARACTER:{this.handler.onWhitespaceCharacter(this.currentCharacterToken);break}}this.currentCharacterToken=null}}_emitEOFToken(){const t=this.getCurrentLocation(0);t&&(t.endLine=t.startLine,t.endCol=t.startCol,t.endOffset=t.startOffset),this._emitCurrentCharacterToken(t),this.handler.onEof({type:Ct.EOF,location:t}),this.active=!1}_appendCharToCurrentCharacterToken(t,n){if(this.currentCharacterToken)if(this.currentCharacterToken.type===t){this.currentCharacterToken.chars+=n;return}else this.currentLocation=this.getCurrentLocation(0),this._emitCurrentCharacterToken(this.currentLocation),this.preprocessor.dropParsedChunk();this._createCharacterToken(t,n)}_emitCodePoint(t){const n=H_(t)?Ct.WHITESPACE_CHARACTER:t===Y.NULL?Ct.NULL_CHARACTER:Ct.CHARACTER;this._appendCharToCurrentCharacterToken(n,String.fromCodePoint(t))}_emitChars(t){this._appendCharToCurrentCharacterToken(Ct.CHARACTER,t)}_startCharacterReference(){this.returnState=this.state,this.state=Z.CHARACTER_REFERENCE,this.entityStartPos=this.preprocessor.pos,this.entityDecoder.startEntity(this._isCharacterReferenceInAttribute()?oi.Attribute:oi.Legacy)}_isCharacterReferenceInAttribute(){return this.returnState===Z.ATTRIBUTE_VALUE_DOUBLE_QUOTED||this.returnState===Z.ATTRIBUTE_VALUE_SINGLE_QUOTED||this.returnState===Z.ATTRIBUTE_VALUE_UNQUOTED}_flushCodePointConsumedAsCharacterReference(t){this._isCharacterReferenceInAttribute()?this.currentAttr.value+=String.fromCodePoint(t):this._emitCodePoint(t)}_callState(t){switch(this.state){case Z.DATA:{this._stateData(t);break}case Z.RCDATA:{this._stateRcdata(t);break}case Z.RAWTEXT:{this._stateRawtext(t);break}case Z.SCRIPT_DATA:{this._stateScriptData(t);break}case Z.PLAINTEXT:{this._statePlaintext(t);break}case Z.TAG_OPEN:{this._stateTagOpen(t);break}case Z.END_TAG_OPEN:{this._stateEndTagOpen(t);break}case Z.TAG_NAME:{this._stateTagName(t);break}case Z.RCDATA_LESS_THAN_SIGN:{this._stateRcdataLessThanSign(t);break}case Z.RCDATA_END_TAG_OPEN:{this._stateRcdataEndTagOpen(t);break}case Z.RCDATA_END_TAG_NAME:{this._stateRcdataEndTagName(t);break}case Z.RAWTEXT_LESS_THAN_SIGN:{this._stateRawtextLessThanSign(t);break}case Z.RAWTEXT_END_TAG_OPEN:{this._stateRawtextEndTagOpen(t);break}case Z.RAWTEXT_END_TAG_NAME:{this._stateRawtextEndTagName(t);break}case Z.SCRIPT_DATA_LESS_THAN_SIGN:{this._stateScriptDataLessThanSign(t);break}case Z.SCRIPT_DATA_END_TAG_OPEN:{this._stateScriptDataEndTagOpen(t);break}case Z.SCRIPT_DATA_END_TAG_NAME:{this._stateScriptDataEndTagName(t);break}case Z.SCRIPT_DATA_ESCAPE_START:{this._stateScriptDataEscapeStart(t);break}case Z.SCRIPT_DATA_ESCAPE_START_DASH:{this._stateScriptDataEscapeStartDash(t);break}case Z.SCRIPT_DATA_ESCAPED:{this._stateScriptDataEscaped(t);break}case Z.SCRIPT_DATA_ESCAPED_DASH:{this._stateScriptDataEscapedDash(t);break}case Z.SCRIPT_DATA_ESCAPED_DASH_DASH:{this._stateScriptDataEscapedDashDash(t);break}case Z.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN:{this._stateScriptDataEscapedLessThanSign(t);break}case Z.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:{this._stateScriptDataEscapedEndTagOpen(t);break}case Z.SCRIPT_DATA_ESCAPED_END_TAG_NAME:{this._stateScriptDataEscapedEndTagName(t);break}case Z.SCRIPT_DATA_DOUBLE_ESCAPE_START:{this._stateScriptDataDoubleEscapeStart(t);break}case Z.SCRIPT_DATA_DOUBLE_ESCAPED:{this._stateScriptDataDoubleEscaped(t);break}case Z.SCRIPT_DATA_DOUBLE_ESCAPED_DASH:{this._stateScriptDataDoubleEscapedDash(t);break}case Z.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH:{this._stateScriptDataDoubleEscapedDashDash(t);break}case Z.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN:{this._stateScriptDataDoubleEscapedLessThanSign(t);break}case Z.SCRIPT_DATA_DOUBLE_ESCAPE_END:{this._stateScriptDataDoubleEscapeEnd(t);break}case Z.BEFORE_ATTRIBUTE_NAME:{this._stateBeforeAttributeName(t);break}case Z.ATTRIBUTE_NAME:{this._stateAttributeName(t);break}case Z.AFTER_ATTRIBUTE_NAME:{this._stateAfterAttributeName(t);break}case Z.BEFORE_ATTRIBUTE_VALUE:{this._stateBeforeAttributeValue(t);break}case Z.ATTRIBUTE_VALUE_DOUBLE_QUOTED:{this._stateAttributeValueDoubleQuoted(t);break}case Z.ATTRIBUTE_VALUE_SINGLE_QUOTED:{this._stateAttributeValueSingleQuoted(t);break}case Z.ATTRIBUTE_VALUE_UNQUOTED:{this._stateAttributeValueUnquoted(t);break}case Z.AFTER_ATTRIBUTE_VALUE_QUOTED:{this._stateAfterAttributeValueQuoted(t);break}case Z.SELF_CLOSING_START_TAG:{this._stateSelfClosingStartTag(t);break}case Z.BOGUS_COMMENT:{this._stateBogusComment(t);break}case Z.MARKUP_DECLARATION_OPEN:{this._stateMarkupDeclarationOpen(t);break}case Z.COMMENT_START:{this._stateCommentStart(t);break}case Z.COMMENT_START_DASH:{this._stateCommentStartDash(t);break}case Z.COMMENT:{this._stateComment(t);break}case Z.COMMENT_LESS_THAN_SIGN:{this._stateCommentLessThanSign(t);break}case Z.COMMENT_LESS_THAN_SIGN_BANG:{this._stateCommentLessThanSignBang(t);break}case Z.COMMENT_LESS_THAN_SIGN_BANG_DASH:{this._stateCommentLessThanSignBangDash(t);break}case Z.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:{this._stateCommentLessThanSignBangDashDash(t);break}case Z.COMMENT_END_DASH:{this._stateCommentEndDash(t);break}case Z.COMMENT_END:{this._stateCommentEnd(t);break}case Z.COMMENT_END_BANG:{this._stateCommentEndBang(t);break}case Z.DOCTYPE:{this._stateDoctype(t);break}case Z.BEFORE_DOCTYPE_NAME:{this._stateBeforeDoctypeName(t);break}case Z.DOCTYPE_NAME:{this._stateDoctypeName(t);break}case Z.AFTER_DOCTYPE_NAME:{this._stateAfterDoctypeName(t);break}case Z.AFTER_DOCTYPE_PUBLIC_KEYWORD:{this._stateAfterDoctypePublicKeyword(t);break}case Z.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER:{this._stateBeforeDoctypePublicIdentifier(t);break}case Z.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED:{this._stateDoctypePublicIdentifierDoubleQuoted(t);break}case Z.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED:{this._stateDoctypePublicIdentifierSingleQuoted(t);break}case Z.AFTER_DOCTYPE_PUBLIC_IDENTIFIER:{this._stateAfterDoctypePublicIdentifier(t);break}case Z.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS:{this._stateBetweenDoctypePublicAndSystemIdentifiers(t);break}case Z.AFTER_DOCTYPE_SYSTEM_KEYWORD:{this._stateAfterDoctypeSystemKeyword(t);break}case Z.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER:{this._stateBeforeDoctypeSystemIdentifier(t);break}case Z.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED:{this._stateDoctypeSystemIdentifierDoubleQuoted(t);break}case Z.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED:{this._stateDoctypeSystemIdentifierSingleQuoted(t);break}case Z.AFTER_DOCTYPE_SYSTEM_IDENTIFIER:{this._stateAfterDoctypeSystemIdentifier(t);break}case Z.BOGUS_DOCTYPE:{this._stateBogusDoctype(t);break}case Z.CDATA_SECTION:{this._stateCdataSection(t);break}case Z.CDATA_SECTION_BRACKET:{this._stateCdataSectionBracket(t);break}case Z.CDATA_SECTION_END:{this._stateCdataSectionEnd(t);break}case Z.CHARACTER_REFERENCE:{this._stateCharacterReference();break}case Z.AMBIGUOUS_AMPERSAND:{this._stateAmbiguousAmpersand(t);break}default:throw new Error("Unknown state")}}_stateData(t){switch(t){case Y.LESS_THAN_SIGN:{this.state=Z.TAG_OPEN;break}case Y.AMPERSAND:{this._startCharacterReference();break}case Y.NULL:{this._err(Ce.unexpectedNullCharacter),this._emitCodePoint(t);break}case Y.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateRcdata(t){switch(t){case Y.AMPERSAND:{this._startCharacterReference();break}case Y.LESS_THAN_SIGN:{this.state=Z.RCDATA_LESS_THAN_SIGN;break}case Y.NULL:{this._err(Ce.unexpectedNullCharacter),this._emitChars(hn);break}case Y.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateRawtext(t){switch(t){case Y.LESS_THAN_SIGN:{this.state=Z.RAWTEXT_LESS_THAN_SIGN;break}case Y.NULL:{this._err(Ce.unexpectedNullCharacter),this._emitChars(hn);break}case Y.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateScriptData(t){switch(t){case Y.LESS_THAN_SIGN:{this.state=Z.SCRIPT_DATA_LESS_THAN_SIGN;break}case Y.NULL:{this._err(Ce.unexpectedNullCharacter),this._emitChars(hn);break}case Y.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_statePlaintext(t){switch(t){case Y.NULL:{this._err(Ce.unexpectedNullCharacter),this._emitChars(hn);break}case Y.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateTagOpen(t){if(Ki(t))this._createStartTagToken(),this.state=Z.TAG_NAME,this._stateTagName(t);else switch(t){case Y.EXCLAMATION_MARK:{this.state=Z.MARKUP_DECLARATION_OPEN;break}case Y.SOLIDUS:{this.state=Z.END_TAG_OPEN;break}case Y.QUESTION_MARK:{this._err(Ce.unexpectedQuestionMarkInsteadOfTagName),this._createCommentToken(1),this.state=Z.BOGUS_COMMENT,this._stateBogusComment(t);break}case Y.EOF:{this._err(Ce.eofBeforeTagName),this._emitChars("<"),this._emitEOFToken();break}default:this._err(Ce.invalidFirstCharacterOfTagName),this._emitChars("<"),this.state=Z.DATA,this._stateData(t)}}_stateEndTagOpen(t){if(Ki(t))this._createEndTagToken(),this.state=Z.TAG_NAME,this._stateTagName(t);else switch(t){case Y.GREATER_THAN_SIGN:{this._err(Ce.missingEndTagName),this.state=Z.DATA;break}case Y.EOF:{this._err(Ce.eofBeforeTagName),this._emitChars("</"),this._emitEOFToken();break}default:this._err(Ce.invalidFirstCharacterOfTagName),this._createCommentToken(2),this.state=Z.BOGUS_COMMENT,this._stateBogusComment(t)}}_stateTagName(t){const n=this.currentToken;switch(t){case Y.SPACE:case Y.LINE_FEED:case Y.TABULATION:case Y.FORM_FEED:{this.state=Z.BEFORE_ATTRIBUTE_NAME;break}case Y.SOLIDUS:{this.state=Z.SELF_CLOSING_START_TAG;break}case Y.GREATER_THAN_SIGN:{this.state=Z.DATA,this.emitCurrentTagToken();break}case Y.NULL:{this._err(Ce.unexpectedNullCharacter),n.tagName+=hn;break}case Y.EOF:{this._err(Ce.eofInTag),this._emitEOFToken();break}default:n.tagName+=String.fromCodePoint(xc(t)?Zf(t):t)}}_stateRcdataLessThanSign(t){t===Y.SOLIDUS?this.state=Z.RCDATA_END_TAG_OPEN:(this._emitChars("<"),this.state=Z.RCDATA,this._stateRcdata(t))}_stateRcdataEndTagOpen(t){Ki(t)?(this.state=Z.RCDATA_END_TAG_NAME,this._stateRcdataEndTagName(t)):(this._emitChars("</"),this.state=Z.RCDATA,this._stateRcdata(t))}handleSpecialEndTag(t){if(!this.preprocessor.startsWith(this.lastStartTagName,!1))return!this._ensureHibernation();this._createEndTagToken();const n=this.currentToken;switch(n.tagName=this.lastStartTagName,this.preprocessor.peek(this.lastStartTagName.length)){case Y.SPACE:case Y.LINE_FEED:case Y.TABULATION:case Y.FORM_FEED:return this._advanceBy(this.lastStartTagName.length),this.state=Z.BEFORE_ATTRIBUTE_NAME,!1;case Y.SOLIDUS:return this._advanceBy(this.lastStartTagName.length),this.state=Z.SELF_CLOSING_START_TAG,!1;case Y.GREATER_THAN_SIGN:return this._advanceBy(this.lastStartTagName.length),this.emitCurrentTagToken(),this.state=Z.DATA,!1;default:return!this._ensureHibernation()}}_stateRcdataEndTagName(t){this.handleSpecialEndTag(t)&&(this._emitChars("</"),this.state=Z.RCDATA,this._stateRcdata(t))}_stateRawtextLessThanSign(t){t===Y.SOLIDUS?this.state=Z.RAWTEXT_END_TAG_OPEN:(this._emitChars("<"),this.state=Z.RAWTEXT,this._stateRawtext(t))}_stateRawtextEndTagOpen(t){Ki(t)?(this.state=Z.RAWTEXT_END_TAG_NAME,this._stateRawtextEndTagName(t)):(this._emitChars("</"),this.state=Z.RAWTEXT,this._stateRawtext(t))}_stateRawtextEndTagName(t){this.handleSpecialEndTag(t)&&(this._emitChars("</"),this.state=Z.RAWTEXT,this._stateRawtext(t))}_stateScriptDataLessThanSign(t){switch(t){case Y.SOLIDUS:{this.state=Z.SCRIPT_DATA_END_TAG_OPEN;break}case Y.EXCLAMATION_MARK:{this.state=Z.SCRIPT_DATA_ESCAPE_START,this._emitChars("<!");break}default:this._emitChars("<"),this.state=Z.SCRIPT_DATA,this._stateScriptData(t)}}_stateScriptDataEndTagOpen(t){Ki(t)?(this.state=Z.SCRIPT_DATA_END_TAG_NAME,this._stateScriptDataEndTagName(t)):(this._emitChars("</"),this.state=Z.SCRIPT_DATA,this._stateScriptData(t))}_stateScriptDataEndTagName(t){this.handleSpecialEndTag(t)&&(this._emitChars("</"),this.state=Z.SCRIPT_DATA,this._stateScriptData(t))}_stateScriptDataEscapeStart(t){t===Y.HYPHEN_MINUS?(this.state=Z.SCRIPT_DATA_ESCAPE_START_DASH,this._emitChars("-")):(this.state=Z.SCRIPT_DATA,this._stateScriptData(t))}_stateScriptDataEscapeStartDash(t){t===Y.HYPHEN_MINUS?(this.state=Z.SCRIPT_DATA_ESCAPED_DASH_DASH,this._emitChars("-")):(this.state=Z.SCRIPT_DATA,this._stateScriptData(t))}_stateScriptDataEscaped(t){switch(t){case Y.HYPHEN_MINUS:{this.state=Z.SCRIPT_DATA_ESCAPED_DASH,this._emitChars("-");break}case Y.LESS_THAN_SIGN:{this.state=Z.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break}case Y.NULL:{this._err(Ce.unexpectedNullCharacter),this._emitChars(hn);break}case Y.EOF:{this._err(Ce.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateScriptDataEscapedDash(t){switch(t){case Y.HYPHEN_MINUS:{this.state=Z.SCRIPT_DATA_ESCAPED_DASH_DASH,this._emitChars("-");break}case Y.LESS_THAN_SIGN:{this.state=Z.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break}case Y.NULL:{this._err(Ce.unexpectedNullCharacter),this.state=Z.SCRIPT_DATA_ESCAPED,this._emitChars(hn);break}case Y.EOF:{this._err(Ce.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=Z.SCRIPT_DATA_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataEscapedDashDash(t){switch(t){case Y.HYPHEN_MINUS:{this._emitChars("-");break}case Y.LESS_THAN_SIGN:{this.state=Z.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break}case Y.GREATER_THAN_SIGN:{this.state=Z.SCRIPT_DATA,this._emitChars(">");break}case Y.NULL:{this._err(Ce.unexpectedNullCharacter),this.state=Z.SCRIPT_DATA_ESCAPED,this._emitChars(hn);break}case Y.EOF:{this._err(Ce.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=Z.SCRIPT_DATA_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataEscapedLessThanSign(t){t===Y.SOLIDUS?this.state=Z.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:Ki(t)?(this._emitChars("<"),this.state=Z.SCRIPT_DATA_DOUBLE_ESCAPE_START,this._stateScriptDataDoubleEscapeStart(t)):(this._emitChars("<"),this.state=Z.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(t))}_stateScriptDataEscapedEndTagOpen(t){Ki(t)?(this.state=Z.SCRIPT_DATA_ESCAPED_END_TAG_NAME,this._stateScriptDataEscapedEndTagName(t)):(this._emitChars("</"),this.state=Z.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(t))}_stateScriptDataEscapedEndTagName(t){this.handleSpecialEndTag(t)&&(this._emitChars("</"),this.state=Z.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(t))}_stateScriptDataDoubleEscapeStart(t){if(this.preprocessor.startsWith(Nr.SCRIPT,!1)&&HC(this.preprocessor.peek(Nr.SCRIPT.length))){this._emitCodePoint(t);for(let n=0;n<Nr.SCRIPT.length;n++)this._emitCodePoint(this._consume());this.state=Z.SCRIPT_DATA_DOUBLE_ESCAPED}else this._ensureHibernation()||(this.state=Z.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(t))}_stateScriptDataDoubleEscaped(t){switch(t){case Y.HYPHEN_MINUS:{this.state=Z.SCRIPT_DATA_DOUBLE_ESCAPED_DASH,this._emitChars("-");break}case Y.LESS_THAN_SIGN:{this.state=Z.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break}case Y.NULL:{this._err(Ce.unexpectedNullCharacter),this._emitChars(hn);break}case Y.EOF:{this._err(Ce.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateScriptDataDoubleEscapedDash(t){switch(t){case Y.HYPHEN_MINUS:{this.state=Z.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH,this._emitChars("-");break}case Y.LESS_THAN_SIGN:{this.state=Z.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break}case Y.NULL:{this._err(Ce.unexpectedNullCharacter),this.state=Z.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitChars(hn);break}case Y.EOF:{this._err(Ce.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=Z.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataDoubleEscapedDashDash(t){switch(t){case Y.HYPHEN_MINUS:{this._emitChars("-");break}case Y.LESS_THAN_SIGN:{this.state=Z.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break}case Y.GREATER_THAN_SIGN:{this.state=Z.SCRIPT_DATA,this._emitChars(">");break}case Y.NULL:{this._err(Ce.unexpectedNullCharacter),this.state=Z.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitChars(hn);break}case Y.EOF:{this._err(Ce.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=Z.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataDoubleEscapedLessThanSign(t){t===Y.SOLIDUS?(this.state=Z.SCRIPT_DATA_DOUBLE_ESCAPE_END,this._emitChars("/")):(this.state=Z.SCRIPT_DATA_DOUBLE_ESCAPED,this._stateScriptDataDoubleEscaped(t))}_stateScriptDataDoubleEscapeEnd(t){if(this.preprocessor.startsWith(Nr.SCRIPT,!1)&&HC(this.preprocessor.peek(Nr.SCRIPT.length))){this._emitCodePoint(t);for(let n=0;n<Nr.SCRIPT.length;n++)this._emitCodePoint(this._consume());this.state=Z.SCRIPT_DATA_ESCAPED}else this._ensureHibernation()||(this.state=Z.SCRIPT_DATA_DOUBLE_ESCAPED,this._stateScriptDataDoubleEscaped(t))}_stateBeforeAttributeName(t){switch(t){case Y.SPACE:case Y.LINE_FEED:case Y.TABULATION:case Y.FORM_FEED:break;case Y.SOLIDUS:case Y.GREATER_THAN_SIGN:case Y.EOF:{this.state=Z.AFTER_ATTRIBUTE_NAME,this._stateAfterAttributeName(t);break}case Y.EQUALS_SIGN:{this._err(Ce.unexpectedEqualsSignBeforeAttributeName),this._createAttr("="),this.state=Z.ATTRIBUTE_NAME;break}default:this._createAttr(""),this.state=Z.ATTRIBUTE_NAME,this._stateAttributeName(t)}}_stateAttributeName(t){switch(t){case Y.SPACE:case Y.LINE_FEED:case Y.TABULATION:case Y.FORM_FEED:case Y.SOLIDUS:case Y.GREATER_THAN_SIGN:case Y.EOF:{this._leaveAttrName(),this.state=Z.AFTER_ATTRIBUTE_NAME,this._stateAfterAttributeName(t);break}case Y.EQUALS_SIGN:{this._leaveAttrName(),this.state=Z.BEFORE_ATTRIBUTE_VALUE;break}case Y.QUOTATION_MARK:case Y.APOSTROPHE:case Y.LESS_THAN_SIGN:{this._err(Ce.unexpectedCharacterInAttributeName),this.currentAttr.name+=String.fromCodePoint(t);break}case Y.NULL:{this._err(Ce.unexpectedNullCharacter),this.currentAttr.name+=hn;break}default:this.currentAttr.name+=String.fromCodePoint(xc(t)?Zf(t):t)}}_stateAfterAttributeName(t){switch(t){case Y.SPACE:case Y.LINE_FEED:case Y.TABULATION:case Y.FORM_FEED:break;case Y.SOLIDUS:{this.state=Z.SELF_CLOSING_START_TAG;break}case Y.EQUALS_SIGN:{this.state=Z.BEFORE_ATTRIBUTE_VALUE;break}case Y.GREATER_THAN_SIGN:{this.state=Z.DATA,this.emitCurrentTagToken();break}case Y.EOF:{this._err(Ce.eofInTag),this._emitEOFToken();break}default:this._createAttr(""),this.state=Z.ATTRIBUTE_NAME,this._stateAttributeName(t)}}_stateBeforeAttributeValue(t){switch(t){case Y.SPACE:case Y.LINE_FEED:case Y.TABULATION:case Y.FORM_FEED:break;case Y.QUOTATION_MARK:{this.state=Z.ATTRIBUTE_VALUE_DOUBLE_QUOTED;break}case Y.APOSTROPHE:{this.state=Z.ATTRIBUTE_VALUE_SINGLE_QUOTED;break}case Y.GREATER_THAN_SIGN:{this._err(Ce.missingAttributeValue),this.state=Z.DATA,this.emitCurrentTagToken();break}default:this.state=Z.ATTRIBUTE_VALUE_UNQUOTED,this._stateAttributeValueUnquoted(t)}}_stateAttributeValueDoubleQuoted(t){switch(t){case Y.QUOTATION_MARK:{this.state=Z.AFTER_ATTRIBUTE_VALUE_QUOTED;break}case Y.AMPERSAND:{this._startCharacterReference();break}case Y.NULL:{this._err(Ce.unexpectedNullCharacter),this.currentAttr.value+=hn;break}case Y.EOF:{this._err(Ce.eofInTag),this._emitEOFToken();break}default:this.currentAttr.value+=String.fromCodePoint(t)}}_stateAttributeValueSingleQuoted(t){switch(t){case Y.APOSTROPHE:{this.state=Z.AFTER_ATTRIBUTE_VALUE_QUOTED;break}case Y.AMPERSAND:{this._startCharacterReference();break}case Y.NULL:{this._err(Ce.unexpectedNullCharacter),this.currentAttr.value+=hn;break}case Y.EOF:{this._err(Ce.eofInTag),this._emitEOFToken();break}default:this.currentAttr.value+=String.fromCodePoint(t)}}_stateAttributeValueUnquoted(t){switch(t){case Y.SPACE:case Y.LINE_FEED:case Y.TABULATION:case Y.FORM_FEED:{this._leaveAttrValue(),this.state=Z.BEFORE_ATTRIBUTE_NAME;break}case Y.AMPERSAND:{this._startCharacterReference();break}case Y.GREATER_THAN_SIGN:{this._leaveAttrValue(),this.state=Z.DATA,this.emitCurrentTagToken();break}case Y.NULL:{this._err(Ce.unexpectedNullCharacter),this.currentAttr.value+=hn;break}case Y.QUOTATION_MARK:case Y.APOSTROPHE:case Y.LESS_THAN_SIGN:case Y.EQUALS_SIGN:case Y.GRAVE_ACCENT:{this._err(Ce.unexpectedCharacterInUnquotedAttributeValue),this.currentAttr.value+=String.fromCodePoint(t);break}case Y.EOF:{this._err(Ce.eofInTag),this._emitEOFToken();break}default:this.currentAttr.value+=String.fromCodePoint(t)}}_stateAfterAttributeValueQuoted(t){switch(t){case Y.SPACE:case Y.LINE_FEED:case Y.TABULATION:case Y.FORM_FEED:{this._leaveAttrValue(),this.state=Z.BEFORE_ATTRIBUTE_NAME;break}case Y.SOLIDUS:{this._leaveAttrValue(),this.state=Z.SELF_CLOSING_START_TAG;break}case Y.GREATER_THAN_SIGN:{this._leaveAttrValue(),this.state=Z.DATA,this.emitCurrentTagToken();break}case Y.EOF:{this._err(Ce.eofInTag),this._emitEOFToken();break}default:this._err(Ce.missingWhitespaceBetweenAttributes),this.state=Z.BEFORE_ATTRIBUTE_NAME,this._stateBeforeAttributeName(t)}}_stateSelfClosingStartTag(t){switch(t){case Y.GREATER_THAN_SIGN:{const n=this.currentToken;n.selfClosing=!0,this.state=Z.DATA,this.emitCurrentTagToken();break}case Y.EOF:{this._err(Ce.eofInTag),this._emitEOFToken();break}default:this._err(Ce.unexpectedSolidusInTag),this.state=Z.BEFORE_ATTRIBUTE_NAME,this._stateBeforeAttributeName(t)}}_stateBogusComment(t){const n=this.currentToken;switch(t){case Y.GREATER_THAN_SIGN:{this.state=Z.DATA,this.emitCurrentComment(n);break}case Y.EOF:{this.emitCurrentComment(n),this._emitEOFToken();break}case Y.NULL:{this._err(Ce.unexpectedNullCharacter),n.data+=hn;break}default:n.data+=String.fromCodePoint(t)}}_stateMarkupDeclarationOpen(t){this._consumeSequenceIfMatch(Nr.DASH_DASH,!0)?(this._createCommentToken(Nr.DASH_DASH.length+1),this.state=Z.COMMENT_START):this._consumeSequenceIfMatch(Nr.DOCTYPE,!1)?(this.currentLocation=this.getCurrentLocation(Nr.DOCTYPE.length+1),this.state=Z.DOCTYPE):this._consumeSequenceIfMatch(Nr.CDATA_START,!0)?this.inForeignNode?this.state=Z.CDATA_SECTION:(this._err(Ce.cdataInHtmlContent),this._createCommentToken(Nr.CDATA_START.length+1),this.currentToken.data="[CDATA[",this.state=Z.BOGUS_COMMENT):this._ensureHibernation()||(this._err(Ce.incorrectlyOpenedComment),this._createCommentToken(2),this.state=Z.BOGUS_COMMENT,this._stateBogusComment(t))}_stateCommentStart(t){switch(t){case Y.HYPHEN_MINUS:{this.state=Z.COMMENT_START_DASH;break}case Y.GREATER_THAN_SIGN:{this._err(Ce.abruptClosingOfEmptyComment),this.state=Z.DATA;const n=this.currentToken;this.emitCurrentComment(n);break}default:this.state=Z.COMMENT,this._stateComment(t)}}_stateCommentStartDash(t){const n=this.currentToken;switch(t){case Y.HYPHEN_MINUS:{this.state=Z.COMMENT_END;break}case Y.GREATER_THAN_SIGN:{this._err(Ce.abruptClosingOfEmptyComment),this.state=Z.DATA,this.emitCurrentComment(n);break}case Y.EOF:{this._err(Ce.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="-",this.state=Z.COMMENT,this._stateComment(t)}}_stateComment(t){const n=this.currentToken;switch(t){case Y.HYPHEN_MINUS:{this.state=Z.COMMENT_END_DASH;break}case Y.LESS_THAN_SIGN:{n.data+="<",this.state=Z.COMMENT_LESS_THAN_SIGN;break}case Y.NULL:{this._err(Ce.unexpectedNullCharacter),n.data+=hn;break}case Y.EOF:{this._err(Ce.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+=String.fromCodePoint(t)}}_stateCommentLessThanSign(t){const n=this.currentToken;switch(t){case Y.EXCLAMATION_MARK:{n.data+="!",this.state=Z.COMMENT_LESS_THAN_SIGN_BANG;break}case Y.LESS_THAN_SIGN:{n.data+="<";break}default:this.state=Z.COMMENT,this._stateComment(t)}}_stateCommentLessThanSignBang(t){t===Y.HYPHEN_MINUS?this.state=Z.COMMENT_LESS_THAN_SIGN_BANG_DASH:(this.state=Z.COMMENT,this._stateComment(t))}_stateCommentLessThanSignBangDash(t){t===Y.HYPHEN_MINUS?this.state=Z.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:(this.state=Z.COMMENT_END_DASH,this._stateCommentEndDash(t))}_stateCommentLessThanSignBangDashDash(t){t!==Y.GREATER_THAN_SIGN&&t!==Y.EOF&&this._err(Ce.nestedComment),this.state=Z.COMMENT_END,this._stateCommentEnd(t)}_stateCommentEndDash(t){const n=this.currentToken;switch(t){case Y.HYPHEN_MINUS:{this.state=Z.COMMENT_END;break}case Y.EOF:{this._err(Ce.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="-",this.state=Z.COMMENT,this._stateComment(t)}}_stateCommentEnd(t){const n=this.currentToken;switch(t){case Y.GREATER_THAN_SIGN:{this.state=Z.DATA,this.emitCurrentComment(n);break}case Y.EXCLAMATION_MARK:{this.state=Z.COMMENT_END_BANG;break}case Y.HYPHEN_MINUS:{n.data+="-";break}case Y.EOF:{this._err(Ce.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="--",this.state=Z.COMMENT,this._stateComment(t)}}_stateCommentEndBang(t){const n=this.currentToken;switch(t){case Y.HYPHEN_MINUS:{n.data+="--!",this.state=Z.COMMENT_END_DASH;break}case Y.GREATER_THAN_SIGN:{this._err(Ce.incorrectlyClosedComment),this.state=Z.DATA,this.emitCurrentComment(n);break}case Y.EOF:{this._err(Ce.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="--!",this.state=Z.COMMENT,this._stateComment(t)}}_stateDoctype(t){switch(t){case Y.SPACE:case Y.LINE_FEED:case Y.TABULATION:case Y.FORM_FEED:{this.state=Z.BEFORE_DOCTYPE_NAME;break}case Y.GREATER_THAN_SIGN:{this.state=Z.BEFORE_DOCTYPE_NAME,this._stateBeforeDoctypeName(t);break}case Y.EOF:{this._err(Ce.eofInDoctype),this._createDoctypeToken(null);const n=this.currentToken;n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(Ce.missingWhitespaceBeforeDoctypeName),this.state=Z.BEFORE_DOCTYPE_NAME,this._stateBeforeDoctypeName(t)}}_stateBeforeDoctypeName(t){if(xc(t))this._createDoctypeToken(String.fromCharCode(Zf(t))),this.state=Z.DOCTYPE_NAME;else switch(t){case Y.SPACE:case Y.LINE_FEED:case Y.TABULATION:case Y.FORM_FEED:break;case Y.NULL:{this._err(Ce.unexpectedNullCharacter),this._createDoctypeToken(hn),this.state=Z.DOCTYPE_NAME;break}case Y.GREATER_THAN_SIGN:{this._err(Ce.missingDoctypeName),this._createDoctypeToken(null);const n=this.currentToken;n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=Z.DATA;break}case Y.EOF:{this._err(Ce.eofInDoctype),this._createDoctypeToken(null);const n=this.currentToken;n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._createDoctypeToken(String.fromCodePoint(t)),this.state=Z.DOCTYPE_NAME}}_stateDoctypeName(t){const n=this.currentToken;switch(t){case Y.SPACE:case Y.LINE_FEED:case Y.TABULATION:case Y.FORM_FEED:{this.state=Z.AFTER_DOCTYPE_NAME;break}case Y.GREATER_THAN_SIGN:{this.state=Z.DATA,this.emitCurrentDoctype(n);break}case Y.NULL:{this._err(Ce.unexpectedNullCharacter),n.name+=hn;break}case Y.EOF:{this._err(Ce.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:n.name+=String.fromCodePoint(xc(t)?Zf(t):t)}}_stateAfterDoctypeName(t){const n=this.currentToken;switch(t){case Y.SPACE:case Y.LINE_FEED:case Y.TABULATION:case Y.FORM_FEED:break;case Y.GREATER_THAN_SIGN:{this.state=Z.DATA,this.emitCurrentDoctype(n);break}case Y.EOF:{this._err(Ce.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._consumeSequenceIfMatch(Nr.PUBLIC,!1)?this.state=Z.AFTER_DOCTYPE_PUBLIC_KEYWORD:this._consumeSequenceIfMatch(Nr.SYSTEM,!1)?this.state=Z.AFTER_DOCTYPE_SYSTEM_KEYWORD:this._ensureHibernation()||(this._err(Ce.invalidCharacterSequenceAfterDoctypeName),n.forceQuirks=!0,this.state=Z.BOGUS_DOCTYPE,this._stateBogusDoctype(t))}}_stateAfterDoctypePublicKeyword(t){const n=this.currentToken;switch(t){case Y.SPACE:case Y.LINE_FEED:case Y.TABULATION:case Y.FORM_FEED:{this.state=Z.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER;break}case Y.QUOTATION_MARK:{this._err(Ce.missingWhitespaceAfterDoctypePublicKeyword),n.publicId="",this.state=Z.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED;break}case Y.APOSTROPHE:{this._err(Ce.missingWhitespaceAfterDoctypePublicKeyword),n.publicId="",this.state=Z.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED;break}case Y.GREATER_THAN_SIGN:{this._err(Ce.missingDoctypePublicIdentifier),n.forceQuirks=!0,this.state=Z.DATA,this.emitCurrentDoctype(n);break}case Y.EOF:{this._err(Ce.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(Ce.missingQuoteBeforeDoctypePublicIdentifier),n.forceQuirks=!0,this.state=Z.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateBeforeDoctypePublicIdentifier(t){const n=this.currentToken;switch(t){case Y.SPACE:case Y.LINE_FEED:case Y.TABULATION:case Y.FORM_FEED:break;case Y.QUOTATION_MARK:{n.publicId="",this.state=Z.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED;break}case Y.APOSTROPHE:{n.publicId="",this.state=Z.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED;break}case Y.GREATER_THAN_SIGN:{this._err(Ce.missingDoctypePublicIdentifier),n.forceQuirks=!0,this.state=Z.DATA,this.emitCurrentDoctype(n);break}case Y.EOF:{this._err(Ce.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(Ce.missingQuoteBeforeDoctypePublicIdentifier),n.forceQuirks=!0,this.state=Z.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateDoctypePublicIdentifierDoubleQuoted(t){const n=this.currentToken;switch(t){case Y.QUOTATION_MARK:{this.state=Z.AFTER_DOCTYPE_PUBLIC_IDENTIFIER;break}case Y.NULL:{this._err(Ce.unexpectedNullCharacter),n.publicId+=hn;break}case Y.GREATER_THAN_SIGN:{this._err(Ce.abruptDoctypePublicIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=Z.DATA;break}case Y.EOF:{this._err(Ce.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:n.publicId+=String.fromCodePoint(t)}}_stateDoctypePublicIdentifierSingleQuoted(t){const n=this.currentToken;switch(t){case Y.APOSTROPHE:{this.state=Z.AFTER_DOCTYPE_PUBLIC_IDENTIFIER;break}case Y.NULL:{this._err(Ce.unexpectedNullCharacter),n.publicId+=hn;break}case Y.GREATER_THAN_SIGN:{this._err(Ce.abruptDoctypePublicIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=Z.DATA;break}case Y.EOF:{this._err(Ce.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:n.publicId+=String.fromCodePoint(t)}}_stateAfterDoctypePublicIdentifier(t){const n=this.currentToken;switch(t){case Y.SPACE:case Y.LINE_FEED:case Y.TABULATION:case Y.FORM_FEED:{this.state=Z.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS;break}case Y.GREATER_THAN_SIGN:{this.state=Z.DATA,this.emitCurrentDoctype(n);break}case Y.QUOTATION_MARK:{this._err(Ce.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers),n.systemId="",this.state=Z.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case Y.APOSTROPHE:{this._err(Ce.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers),n.systemId="",this.state=Z.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case Y.EOF:{this._err(Ce.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(Ce.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=Z.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateBetweenDoctypePublicAndSystemIdentifiers(t){const n=this.currentToken;switch(t){case Y.SPACE:case Y.LINE_FEED:case Y.TABULATION:case Y.FORM_FEED:break;case Y.GREATER_THAN_SIGN:{this.emitCurrentDoctype(n),this.state=Z.DATA;break}case Y.QUOTATION_MARK:{n.systemId="",this.state=Z.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case Y.APOSTROPHE:{n.systemId="",this.state=Z.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case Y.EOF:{this._err(Ce.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(Ce.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=Z.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateAfterDoctypeSystemKeyword(t){const n=this.currentToken;switch(t){case Y.SPACE:case Y.LINE_FEED:case Y.TABULATION:case Y.FORM_FEED:{this.state=Z.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER;break}case Y.QUOTATION_MARK:{this._err(Ce.missingWhitespaceAfterDoctypeSystemKeyword),n.systemId="",this.state=Z.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case Y.APOSTROPHE:{this._err(Ce.missingWhitespaceAfterDoctypeSystemKeyword),n.systemId="",this.state=Z.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case Y.GREATER_THAN_SIGN:{this._err(Ce.missingDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=Z.DATA,this.emitCurrentDoctype(n);break}case Y.EOF:{this._err(Ce.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(Ce.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=Z.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateBeforeDoctypeSystemIdentifier(t){const n=this.currentToken;switch(t){case Y.SPACE:case Y.LINE_FEED:case Y.TABULATION:case Y.FORM_FEED:break;case Y.QUOTATION_MARK:{n.systemId="",this.state=Z.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case Y.APOSTROPHE:{n.systemId="",this.state=Z.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case Y.GREATER_THAN_SIGN:{this._err(Ce.missingDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=Z.DATA,this.emitCurrentDoctype(n);break}case Y.EOF:{this._err(Ce.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(Ce.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=Z.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateDoctypeSystemIdentifierDoubleQuoted(t){const n=this.currentToken;switch(t){case Y.QUOTATION_MARK:{this.state=Z.AFTER_DOCTYPE_SYSTEM_IDENTIFIER;break}case Y.NULL:{this._err(Ce.unexpectedNullCharacter),n.systemId+=hn;break}case Y.GREATER_THAN_SIGN:{this._err(Ce.abruptDoctypeSystemIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=Z.DATA;break}case Y.EOF:{this._err(Ce.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:n.systemId+=String.fromCodePoint(t)}}_stateDoctypeSystemIdentifierSingleQuoted(t){const n=this.currentToken;switch(t){case Y.APOSTROPHE:{this.state=Z.AFTER_DOCTYPE_SYSTEM_IDENTIFIER;break}case Y.NULL:{this._err(Ce.unexpectedNullCharacter),n.systemId+=hn;break}case Y.GREATER_THAN_SIGN:{this._err(Ce.abruptDoctypeSystemIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=Z.DATA;break}case Y.EOF:{this._err(Ce.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:n.systemId+=String.fromCodePoint(t)}}_stateAfterDoctypeSystemIdentifier(t){const n=this.currentToken;switch(t){case Y.SPACE:case Y.LINE_FEED:case Y.TABULATION:case Y.FORM_FEED:break;case Y.GREATER_THAN_SIGN:{this.emitCurrentDoctype(n),this.state=Z.DATA;break}case Y.EOF:{this._err(Ce.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(Ce.unexpectedCharacterAfterDoctypeSystemIdentifier),this.state=Z.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateBogusDoctype(t){const n=this.currentToken;switch(t){case Y.GREATER_THAN_SIGN:{this.emitCurrentDoctype(n),this.state=Z.DATA;break}case Y.NULL:{this._err(Ce.unexpectedNullCharacter);break}case Y.EOF:{this.emitCurrentDoctype(n),this._emitEOFToken();break}}}_stateCdataSection(t){switch(t){case Y.RIGHT_SQUARE_BRACKET:{this.state=Z.CDATA_SECTION_BRACKET;break}case Y.EOF:{this._err(Ce.eofInCdata),this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateCdataSectionBracket(t){t===Y.RIGHT_SQUARE_BRACKET?this.state=Z.CDATA_SECTION_END:(this._emitChars("]"),this.state=Z.CDATA_SECTION,this._stateCdataSection(t))}_stateCdataSectionEnd(t){switch(t){case Y.GREATER_THAN_SIGN:{this.state=Z.DATA;break}case Y.RIGHT_SQUARE_BRACKET:{this._emitChars("]");break}default:this._emitChars("]]"),this.state=Z.CDATA_SECTION,this._stateCdataSection(t)}}_stateCharacterReference(){let t=this.entityDecoder.write(this.preprocessor.html,this.preprocessor.pos);if(t<0)if(this.preprocessor.lastChunkWritten)t=this.entityDecoder.end();else{this.active=!1,this.preprocessor.pos=this.preprocessor.html.length-1,this.consumedAfterSnapshot=0,this.preprocessor.endOfChunkHit=!0;return}t===0?(this.preprocessor.pos=this.entityStartPos,this._flushCodePointConsumedAsCharacterReference(Y.AMPERSAND),this.state=!this._isCharacterReferenceInAttribute()&&BC(this.preprocessor.peek(1))?Z.AMBIGUOUS_AMPERSAND:this.returnState):this.state=this.returnState}_stateAmbiguousAmpersand(t){BC(t)?this._flushCodePointConsumedAsCharacterReference(t):(t===Y.SEMICOLON&&this._err(Ce.unknownNamedCharacterReference),this.state=this.returnState,this._callState(t))}}const U_=new Set([S.DD,S.DT,S.LI,S.OPTGROUP,S.OPTION,S.P,S.RB,S.RP,S.RT,S.RTC]),UC=new Set([...U_,S.CAPTION,S.COLGROUP,S.TBODY,S.TD,S.TFOOT,S.TH,S.THEAD,S.TR]),Gh=new Set([S.APPLET,S.CAPTION,S.HTML,S.MARQUEE,S.OBJECT,S.TABLE,S.TD,S.TEMPLATE,S.TH]),q$=new Set([...Gh,S.OL,S.UL]),Y$=new Set([...Gh,S.BUTTON]),zC=new Set([S.ANNOTATION_XML,S.MI,S.MN,S.MO,S.MS,S.MTEXT]),FC=new Set([S.DESC,S.FOREIGN_OBJECT,S.TITLE]),G$=new Set([S.TR,S.TEMPLATE,S.HTML]),X$=new Set([S.TBODY,S.TFOOT,S.THEAD,S.TEMPLATE,S.HTML]),K$=new Set([S.TABLE,S.TEMPLATE,S.HTML]),Q$=new Set([S.TD,S.TH]);class W${get currentTmplContentOrNode(){return this._isInTemplate()?this.treeAdapter.getTemplateContent(this.current):this.current}constructor(t,n,r){this.treeAdapter=n,this.handler=r,this.items=[],this.tagIDs=[],this.stackTop=-1,this.tmplCount=0,this.currentTagId=S.UNKNOWN,this.current=t}_indexOf(t){return this.items.lastIndexOf(t,this.stackTop)}_isInTemplate(){return this.currentTagId===S.TEMPLATE&&this.treeAdapter.getNamespaceURI(this.current)===Me.HTML}_updateCurrentElement(){this.current=this.items[this.stackTop],this.currentTagId=this.tagIDs[this.stackTop]}push(t,n){this.stackTop++,this.items[this.stackTop]=t,this.current=t,this.tagIDs[this.stackTop]=n,this.currentTagId=n,this._isInTemplate()&&this.tmplCount++,this.handler.onItemPush(t,n,!0)}pop(){const t=this.current;this.tmplCount>0&&this._isInTemplate()&&this.tmplCount--,this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(t,!0)}replace(t,n){const r=this._indexOf(t);this.items[r]=n,r===this.stackTop&&(this.current=n)}insertAfter(t,n,r){const i=this._indexOf(t)+1;this.items.splice(i,0,n),this.tagIDs.splice(i,0,r),this.stackTop++,i===this.stackTop&&this._updateCurrentElement(),this.current&&this.currentTagId!==void 0&&this.handler.onItemPush(this.current,this.currentTagId,i===this.stackTop)}popUntilTagNamePopped(t){let n=this.stackTop+1;do n=this.tagIDs.lastIndexOf(t,n-1);while(n>0&&this.treeAdapter.getNamespaceURI(this.items[n])!==Me.HTML);this.shortenToLength(Math.max(n,0))}shortenToLength(t){for(;this.stackTop>=t;){const n=this.current;this.tmplCount>0&&this._isInTemplate()&&(this.tmplCount-=1),this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(n,this.stackTop<t)}}popUntilElementPopped(t){const n=this._indexOf(t);this.shortenToLength(Math.max(n,0))}popUntilPopped(t,n){const r=this._indexOfTagNames(t,n);this.shortenToLength(Math.max(r,0))}popUntilNumberedHeaderPopped(){this.popUntilPopped(Jb,Me.HTML)}popUntilTableCellPopped(){this.popUntilPopped(Q$,Me.HTML)}popAllUpToHtmlElement(){this.tmplCount=0,this.shortenToLength(1)}_indexOfTagNames(t,n){for(let r=this.stackTop;r>=0;r--)if(t.has(this.tagIDs[r])&&this.treeAdapter.getNamespaceURI(this.items[r])===n)return r;return-1}clearBackTo(t,n){const r=this._indexOfTagNames(t,n);this.shortenToLength(r+1)}clearBackToTableContext(){this.clearBackTo(K$,Me.HTML)}clearBackToTableBodyContext(){this.clearBackTo(X$,Me.HTML)}clearBackToTableRowContext(){this.clearBackTo(G$,Me.HTML)}remove(t){const n=this._indexOf(t);n>=0&&(n===this.stackTop?this.pop():(this.items.splice(n,1),this.tagIDs.splice(n,1),this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(t,!1)))}tryPeekProperlyNestedBodyElement(){return this.stackTop>=1&&this.tagIDs[1]===S.BODY?this.items[1]:null}contains(t){return this._indexOf(t)>-1}getCommonAncestor(t){const n=this._indexOf(t)-1;return n>=0?this.items[n]:null}isRootHtmlElementCurrent(){return this.stackTop===0&&this.tagIDs[0]===S.HTML}hasInDynamicScope(t,n){for(let r=this.stackTop;r>=0;r--){const i=this.tagIDs[r];switch(this.treeAdapter.getNamespaceURI(this.items[r])){case Me.HTML:{if(i===t)return!0;if(n.has(i))return!1;break}case Me.SVG:{if(FC.has(i))return!1;break}case Me.MATHML:{if(zC.has(i))return!1;break}}}return!0}hasInScope(t){return this.hasInDynamicScope(t,Gh)}hasInListItemScope(t){return this.hasInDynamicScope(t,q$)}hasInButtonScope(t){return this.hasInDynamicScope(t,Y$)}hasNumberedHeaderInScope(){for(let t=this.stackTop;t>=0;t--){const n=this.tagIDs[t];switch(this.treeAdapter.getNamespaceURI(this.items[t])){case Me.HTML:{if(Jb.has(n))return!0;if(Gh.has(n))return!1;break}case Me.SVG:{if(FC.has(n))return!1;break}case Me.MATHML:{if(zC.has(n))return!1;break}}}return!0}hasInTableScope(t){for(let n=this.stackTop;n>=0;n--)if(this.treeAdapter.getNamespaceURI(this.items[n])===Me.HTML)switch(this.tagIDs[n]){case t:return!0;case S.TABLE:case S.HTML:return!1}return!0}hasTableBodyContextInTableScope(){for(let t=this.stackTop;t>=0;t--)if(this.treeAdapter.getNamespaceURI(this.items[t])===Me.HTML)switch(this.tagIDs[t]){case S.TBODY:case S.THEAD:case S.TFOOT:return!0;case S.TABLE:case S.HTML:return!1}return!0}hasInSelectScope(t){for(let n=this.stackTop;n>=0;n--)if(this.treeAdapter.getNamespaceURI(this.items[n])===Me.HTML)switch(this.tagIDs[n]){case t:return!0;case S.OPTION:case S.OPTGROUP:break;default:return!1}return!0}generateImpliedEndTags(){for(;this.currentTagId!==void 0&&U_.has(this.currentTagId);)this.pop()}generateImpliedEndTagsThoroughly(){for(;this.currentTagId!==void 0&&UC.has(this.currentTagId);)this.pop()}generateImpliedEndTagsWithExclusion(t){for(;this.currentTagId!==void 0&&this.currentTagId!==t&&UC.has(this.currentTagId);)this.pop()}}const X0=3;var _s;(function(e){e[e.Marker=0]="Marker",e[e.Element=1]="Element"})(_s||(_s={}));const $C={type:_s.Marker};class Z${constructor(t){this.treeAdapter=t,this.entries=[],this.bookmark=null}_getNoahArkConditionCandidates(t,n){const r=[],i=n.length,a=this.treeAdapter.getTagName(t),l=this.treeAdapter.getNamespaceURI(t);for(let c=0;c<this.entries.length;c++){const d=this.entries[c];if(d.type===_s.Marker)break;const{element:f}=d;if(this.treeAdapter.getTagName(f)===a&&this.treeAdapter.getNamespaceURI(f)===l){const g=this.treeAdapter.getAttrList(f);g.length===i&&r.push({idx:c,attrs:g})}}return r}_ensureNoahArkCondition(t){if(this.entries.length<X0)return;const n=this.treeAdapter.getAttrList(t),r=this._getNoahArkConditionCandidates(t,n);if(r.length<X0)return;const i=new Map(n.map(l=>[l.name,l.value]));let a=0;for(let l=0;l<r.length;l++){const c=r[l];c.attrs.every(d=>i.get(d.name)===d.value)&&(a+=1,a>=X0&&this.entries.splice(c.idx,1))}}insertMarker(){this.entries.unshift($C)}pushElement(t,n){this._ensureNoahArkCondition(t),this.entries.unshift({type:_s.Element,element:t,token:n})}insertElementAfterBookmark(t,n){const r=this.entries.indexOf(this.bookmark);this.entries.splice(r,0,{type:_s.Element,element:t,token:n})}removeEntry(t){const n=this.entries.indexOf(t);n!==-1&&this.entries.splice(n,1)}clearToLastMarker(){const t=this.entries.indexOf($C);t===-1?this.entries.length=0:this.entries.splice(0,t+1)}getElementEntryInScopeWithTagName(t){const n=this.entries.find(r=>r.type===_s.Marker||this.treeAdapter.getTagName(r.element)===t);return n&&n.type===_s.Element?n:null}getElementEntry(t){return this.entries.find(n=>n.type===_s.Element&&n.element===t)}}const Qi={createDocument(){return{nodeName:"#document",mode:rs.NO_QUIRKS,childNodes:[]}},createDocumentFragment(){return{nodeName:"#document-fragment",childNodes:[]}},createElement(e,t,n){return{nodeName:e,tagName:e,attrs:n,namespaceURI:t,childNodes:[],parentNode:null}},createCommentNode(e){return{nodeName:"#comment",data:e,parentNode:null}},createTextNode(e){return{nodeName:"#text",value:e,parentNode:null}},appendChild(e,t){e.childNodes.push(t),t.parentNode=e},insertBefore(e,t,n){const r=e.childNodes.indexOf(n);e.childNodes.splice(r,0,t),t.parentNode=e},setTemplateContent(e,t){e.content=t},getTemplateContent(e){return e.content},setDocumentType(e,t,n,r){const i=e.childNodes.find(a=>a.nodeName==="#documentType");if(i)i.name=t,i.publicId=n,i.systemId=r;else{const a={nodeName:"#documentType",name:t,publicId:n,systemId:r,parentNode:null};Qi.appendChild(e,a)}},setDocumentMode(e,t){e.mode=t},getDocumentMode(e){return e.mode},detachNode(e){if(e.parentNode){const t=e.parentNode.childNodes.indexOf(e);e.parentNode.childNodes.splice(t,1),e.parentNode=null}},insertText(e,t){if(e.childNodes.length>0){const n=e.childNodes[e.childNodes.length-1];if(Qi.isTextNode(n)){n.value+=t;return}}Qi.appendChild(e,Qi.createTextNode(t))},insertTextBefore(e,t,n){const r=e.childNodes[e.childNodes.indexOf(n)-1];r&&Qi.isTextNode(r)?r.value+=t:Qi.insertBefore(e,Qi.createTextNode(t),n)},adoptAttributes(e,t){const n=new Set(e.attrs.map(r=>r.name));for(let r=0;r<t.length;r++)n.has(t[r].name)||e.attrs.push(t[r])},getFirstChild(e){return e.childNodes[0]},getChildNodes(e){return e.childNodes},getParentNode(e){return e.parentNode},getAttrList(e){return e.attrs},getTagName(e){return e.tagName},getNamespaceURI(e){return e.namespaceURI},getTextNodeContent(e){return e.value},getCommentNodeContent(e){return e.data},getDocumentTypeNodeName(e){return e.name},getDocumentTypeNodePublicId(e){return e.publicId},getDocumentTypeNodeSystemId(e){return e.systemId},isTextNode(e){return e.nodeName==="#text"},isCommentNode(e){return e.nodeName==="#comment"},isDocumentTypeNode(e){return e.nodeName==="#documentType"},isElementNode(e){return Object.prototype.hasOwnProperty.call(e,"tagName")},setNodeSourceCodeLocation(e,t){e.sourceCodeLocation=t},getNodeSourceCodeLocation(e){return e.sourceCodeLocation},updateNodeSourceCodeLocation(e,t){e.sourceCodeLocation={...e.sourceCodeLocation,...t}}},z_="html",J$="about:legacy-compat",eV="http://www.ibm.com/data/dtd/v11/ibmxhtml1-transitional.dtd",F_=["+//silmaril//dtd html pro v0r11 19970101//","-//as//dtd html 3.0 aswedit + extensions//","-//advasoft ltd//dtd html 3.0 aswedit + extensions//","-//ietf//dtd html 2.0 level 1//","-//ietf//dtd html 2.0 level 2//","-//ietf//dtd html 2.0 strict level 1//","-//ietf//dtd html 2.0 strict level 2//","-//ietf//dtd html 2.0 strict//","-//ietf//dtd html 2.0//","-//ietf//dtd html 2.1e//","-//ietf//dtd html 3.0//","-//ietf//dtd html 3.2 final//","-//ietf//dtd html 3.2//","-//ietf//dtd html 3//","-//ietf//dtd html level 0//","-//ietf//dtd html level 1//","-//ietf//dtd html level 2//","-//ietf//dtd html level 3//","-//ietf//dtd html strict level 0//","-//ietf//dtd html strict level 1//","-//ietf//dtd html strict level 2//","-//ietf//dtd html strict level 3//","-//ietf//dtd html strict//","-//ietf//dtd html//","-//metrius//dtd metrius presentational//","-//microsoft//dtd internet explorer 2.0 html strict//","-//microsoft//dtd internet explorer 2.0 html//","-//microsoft//dtd internet explorer 2.0 tables//","-//microsoft//dtd internet explorer 3.0 html strict//","-//microsoft//dtd internet explorer 3.0 html//","-//microsoft//dtd internet explorer 3.0 tables//","-//netscape comm. corp.//dtd html//","-//netscape comm. corp.//dtd strict html//","-//o'reilly and associates//dtd html 2.0//","-//o'reilly and associates//dtd html extended 1.0//","-//o'reilly and associates//dtd html extended relaxed 1.0//","-//sq//dtd html 2.0 hotmetal + extensions//","-//softquad software//dtd hotmetal pro 6.0::19990601::extensions to html 4.0//","-//softquad//dtd hotmetal pro 4.0::19971010::extensions to html 4.0//","-//spyglass//dtd html 2.0 extended//","-//sun microsystems corp.//dtd hotjava html//","-//sun microsystems corp.//dtd hotjava strict html//","-//w3c//dtd html 3 1995-03-24//","-//w3c//dtd html 3.2 draft//","-//w3c//dtd html 3.2 final//","-//w3c//dtd html 3.2//","-//w3c//dtd html 3.2s draft//","-//w3c//dtd html 4.0 frameset//","-//w3c//dtd html 4.0 transitional//","-//w3c//dtd html experimental 19960712//","-//w3c//dtd html experimental 970421//","-//w3c//dtd w3 html//","-//w3o//dtd w3 html 3.0//","-//webtechs//dtd mozilla html 2.0//","-//webtechs//dtd mozilla html//"],tV=[...F_,"-//w3c//dtd html 4.01 frameset//","-//w3c//dtd html 4.01 transitional//"],nV=new Set(["-//w3o//dtd w3 html strict 3.0//en//","-/w3c/dtd html 4.0 transitional/en","html"]),$_=["-//w3c//dtd xhtml 1.0 frameset//","-//w3c//dtd xhtml 1.0 transitional//"],rV=[...$_,"-//w3c//dtd html 4.01 frameset//","-//w3c//dtd html 4.01 transitional//"];function VC(e,t){return t.some(n=>e.startsWith(n))}function sV(e){return e.name===z_&&e.publicId===null&&(e.systemId===null||e.systemId===J$)}function iV(e){if(e.name!==z_)return rs.QUIRKS;const{systemId:t}=e;if(t&&t.toLowerCase()===eV)return rs.QUIRKS;let{publicId:n}=e;if(n!==null){if(n=n.toLowerCase(),nV.has(n))return rs.QUIRKS;let r=t===null?tV:F_;if(VC(n,r))return rs.QUIRKS;if(r=t===null?$_:rV,VC(n,r))return rs.LIMITED_QUIRKS}return rs.NO_QUIRKS}const qC={TEXT_HTML:"text/html",APPLICATION_XML:"application/xhtml+xml"},aV="definitionurl",oV="definitionURL",lV=new Map(["attributeName","attributeType","baseFrequency","baseProfile","calcMode","clipPathUnits","diffuseConstant","edgeMode","filterUnits","glyphRef","gradientTransform","gradientUnits","kernelMatrix","kernelUnitLength","keyPoints","keySplines","keyTimes","lengthAdjust","limitingConeAngle","markerHeight","markerUnits","markerWidth","maskContentUnits","maskUnits","numOctaves","pathLength","patternContentUnits","patternTransform","patternUnits","pointsAtX","pointsAtY","pointsAtZ","preserveAlpha","preserveAspectRatio","primitiveUnits","refX","refY","repeatCount","repeatDur","requiredExtensions","requiredFeatures","specularConstant","specularExponent","spreadMethod","startOffset","stdDeviation","stitchTiles","surfaceScale","systemLanguage","tableValues","targetX","targetY","textLength","viewBox","viewTarget","xChannelSelector","yChannelSelector","zoomAndPan"].map(e=>[e.toLowerCase(),e])),uV=new Map([["xlink:actuate",{prefix:"xlink",name:"actuate",namespace:Me.XLINK}],["xlink:arcrole",{prefix:"xlink",name:"arcrole",namespace:Me.XLINK}],["xlink:href",{prefix:"xlink",name:"href",namespace:Me.XLINK}],["xlink:role",{prefix:"xlink",name:"role",namespace:Me.XLINK}],["xlink:show",{prefix:"xlink",name:"show",namespace:Me.XLINK}],["xlink:title",{prefix:"xlink",name:"title",namespace:Me.XLINK}],["xlink:type",{prefix:"xlink",name:"type",namespace:Me.XLINK}],["xml:lang",{prefix:"xml",name:"lang",namespace:Me.XML}],["xml:space",{prefix:"xml",name:"space",namespace:Me.XML}],["xmlns",{prefix:"",name:"xmlns",namespace:Me.XMLNS}],["xmlns:xlink",{prefix:"xmlns",name:"xlink",namespace:Me.XMLNS}]]),cV=new Map(["altGlyph","altGlyphDef","altGlyphItem","animateColor","animateMotion","animateTransform","clipPath","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","foreignObject","glyphRef","linearGradient","radialGradient","textPath"].map(e=>[e.toLowerCase(),e])),dV=new Set([S.B,S.BIG,S.BLOCKQUOTE,S.BODY,S.BR,S.CENTER,S.CODE,S.DD,S.DIV,S.DL,S.DT,S.EM,S.EMBED,S.H1,S.H2,S.H3,S.H4,S.H5,S.H6,S.HEAD,S.HR,S.I,S.IMG,S.LI,S.LISTING,S.MENU,S.META,S.NOBR,S.OL,S.P,S.PRE,S.RUBY,S.S,S.SMALL,S.SPAN,S.STRONG,S.STRIKE,S.SUB,S.SUP,S.TABLE,S.TT,S.U,S.UL,S.VAR]);function fV(e){const t=e.tagID;return t===S.FONT&&e.attrs.some(({name:r})=>r===no.COLOR||r===no.SIZE||r===no.FACE)||dV.has(t)}function V_(e){for(let t=0;t<e.attrs.length;t++)if(e.attrs[t].name===aV){e.attrs[t].name=oV;break}}function q_(e){for(let t=0;t<e.attrs.length;t++){const n=lV.get(e.attrs[t].name);n!=null&&(e.attrs[t].name=n)}}function qx(e){for(let t=0;t<e.attrs.length;t++){const n=uV.get(e.attrs[t].name);n&&(e.attrs[t].prefix=n.prefix,e.attrs[t].name=n.name,e.attrs[t].namespace=n.namespace)}}function hV(e){const t=cV.get(e.tagName);t!=null&&(e.tagName=t,e.tagID=eu(e.tagName))}function pV(e,t){return t===Me.MATHML&&(e===S.MI||e===S.MO||e===S.MN||e===S.MS||e===S.MTEXT)}function mV(e,t,n){if(t===Me.MATHML&&e===S.ANNOTATION_XML){for(let r=0;r<n.length;r++)if(n[r].name===no.ENCODING){const i=n[r].value.toLowerCase();return i===qC.TEXT_HTML||i===qC.APPLICATION_XML}}return t===Me.SVG&&(e===S.FOREIGN_OBJECT||e===S.DESC||e===S.TITLE)}function gV(e,t,n,r){return(!r||r===Me.HTML)&&mV(e,t,n)||(!r||r===Me.MATHML)&&pV(e,t)}const bV="hidden",xV=8,yV=3;var te;(function(e){e[e.INITIAL=0]="INITIAL",e[e.BEFORE_HTML=1]="BEFORE_HTML",e[e.BEFORE_HEAD=2]="BEFORE_HEAD",e[e.IN_HEAD=3]="IN_HEAD",e[e.IN_HEAD_NO_SCRIPT=4]="IN_HEAD_NO_SCRIPT",e[e.AFTER_HEAD=5]="AFTER_HEAD",e[e.IN_BODY=6]="IN_BODY",e[e.TEXT=7]="TEXT",e[e.IN_TABLE=8]="IN_TABLE",e[e.IN_TABLE_TEXT=9]="IN_TABLE_TEXT",e[e.IN_CAPTION=10]="IN_CAPTION",e[e.IN_COLUMN_GROUP=11]="IN_COLUMN_GROUP",e[e.IN_TABLE_BODY=12]="IN_TABLE_BODY",e[e.IN_ROW=13]="IN_ROW",e[e.IN_CELL=14]="IN_CELL",e[e.IN_SELECT=15]="IN_SELECT",e[e.IN_SELECT_IN_TABLE=16]="IN_SELECT_IN_TABLE",e[e.IN_TEMPLATE=17]="IN_TEMPLATE",e[e.AFTER_BODY=18]="AFTER_BODY",e[e.IN_FRAMESET=19]="IN_FRAMESET",e[e.AFTER_FRAMESET=20]="AFTER_FRAMESET",e[e.AFTER_AFTER_BODY=21]="AFTER_AFTER_BODY",e[e.AFTER_AFTER_FRAMESET=22]="AFTER_AFTER_FRAMESET"})(te||(te={}));const EV={startLine:-1,startCol:-1,startOffset:-1,endLine:-1,endCol:-1,endOffset:-1},Y_=new Set([S.TABLE,S.TBODY,S.TFOOT,S.THEAD,S.TR]),YC={scriptingEnabled:!0,sourceCodeLocationInfo:!1,treeAdapter:Qi,onParseError:null};class GC{constructor(t,n,r=null,i=null){this.fragmentContext=r,this.scriptHandler=i,this.currentToken=null,this.stopped=!1,this.insertionMode=te.INITIAL,this.originalInsertionMode=te.INITIAL,this.headElement=null,this.formElement=null,this.currentNotInHTML=!1,this.tmplInsertionModeStack=[],this.pendingCharacterTokens=[],this.hasNonWhitespacePendingCharacterToken=!1,this.framesetOk=!0,this.skipNextNewLine=!1,this.fosterParentingEnabled=!1,this.options={...YC,...t},this.treeAdapter=this.options.treeAdapter,this.onParseError=this.options.onParseError,this.onParseError&&(this.options.sourceCodeLocationInfo=!0),this.document=n??this.treeAdapter.createDocument(),this.tokenizer=new V$(this.options,this),this.activeFormattingElements=new Z$(this.treeAdapter),this.fragmentContextID=r?eu(this.treeAdapter.getTagName(r)):S.UNKNOWN,this._setContextModes(r??this.document,this.fragmentContextID),this.openElements=new W$(this.document,this.treeAdapter,this)}static parse(t,n){const r=new this(n);return r.tokenizer.write(t,!0),r.document}static getFragmentParser(t,n){const r={...YC,...n};t??(t=r.treeAdapter.createElement(me.TEMPLATE,Me.HTML,[]));const i=r.treeAdapter.createElement("documentmock",Me.HTML,[]),a=new this(r,i,t);return a.fragmentContextID===S.TEMPLATE&&a.tmplInsertionModeStack.unshift(te.IN_TEMPLATE),a._initTokenizerForFragmentParsing(),a._insertFakeRootElement(),a._resetInsertionMode(),a._findFormInFragmentContext(),a}getFragment(){const t=this.treeAdapter.getFirstChild(this.document),n=this.treeAdapter.createDocumentFragment();return this._adoptNodes(t,n),n}_err(t,n,r){var i;if(!this.onParseError)return;const a=(i=t.location)!==null&&i!==void 0?i:EV,l={code:n,startLine:a.startLine,startCol:a.startCol,startOffset:a.startOffset,endLine:r?a.startLine:a.endLine,endCol:r?a.startCol:a.endCol,endOffset:r?a.startOffset:a.endOffset};this.onParseError(l)}onItemPush(t,n,r){var i,a;(a=(i=this.treeAdapter).onItemPush)===null||a===void 0||a.call(i,t),r&&this.openElements.stackTop>0&&this._setContextModes(t,n)}onItemPop(t,n){var r,i;if(this.options.sourceCodeLocationInfo&&this._setEndLocation(t,this.currentToken),(i=(r=this.treeAdapter).onItemPop)===null||i===void 0||i.call(r,t,this.openElements.current),n){let a,l;this.openElements.stackTop===0&&this.fragmentContext?(a=this.fragmentContext,l=this.fragmentContextID):{current:a,currentTagId:l}=this.openElements,this._setContextModes(a,l)}}_setContextModes(t,n){const r=t===this.document||t&&this.treeAdapter.getNamespaceURI(t)===Me.HTML;this.currentNotInHTML=!r,this.tokenizer.inForeignNode=!r&&t!==void 0&&n!==void 0&&!this._isIntegrationPoint(n,t)}_switchToTextParsing(t,n){this._insertElement(t,Me.HTML),this.tokenizer.state=n,this.originalInsertionMode=this.insertionMode,this.insertionMode=te.TEXT}switchToPlaintextParsing(){this.insertionMode=te.TEXT,this.originalInsertionMode=te.IN_BODY,this.tokenizer.state=kn.PLAINTEXT}_getAdjustedCurrentElement(){return this.openElements.stackTop===0&&this.fragmentContext?this.fragmentContext:this.openElements.current}_findFormInFragmentContext(){let t=this.fragmentContext;for(;t;){if(this.treeAdapter.getTagName(t)===me.FORM){this.formElement=t;break}t=this.treeAdapter.getParentNode(t)}}_initTokenizerForFragmentParsing(){if(!(!this.fragmentContext||this.treeAdapter.getNamespaceURI(this.fragmentContext)!==Me.HTML))switch(this.fragmentContextID){case S.TITLE:case S.TEXTAREA:{this.tokenizer.state=kn.RCDATA;break}case S.STYLE:case S.XMP:case S.IFRAME:case S.NOEMBED:case S.NOFRAMES:case S.NOSCRIPT:{this.tokenizer.state=kn.RAWTEXT;break}case S.SCRIPT:{this.tokenizer.state=kn.SCRIPT_DATA;break}case S.PLAINTEXT:{this.tokenizer.state=kn.PLAINTEXT;break}}}_setDocumentType(t){const n=t.name||"",r=t.publicId||"",i=t.systemId||"";if(this.treeAdapter.setDocumentType(this.document,n,r,i),t.location){const l=this.treeAdapter.getChildNodes(this.document).find(c=>this.treeAdapter.isDocumentTypeNode(c));l&&this.treeAdapter.setNodeSourceCodeLocation(l,t.location)}}_attachElementToTree(t,n){if(this.options.sourceCodeLocationInfo){const r=n&&{...n,startTag:n};this.treeAdapter.setNodeSourceCodeLocation(t,r)}if(this._shouldFosterParentOnInsertion())this._fosterParentElement(t);else{const r=this.openElements.currentTmplContentOrNode;this.treeAdapter.appendChild(r??this.document,t)}}_appendElement(t,n){const r=this.treeAdapter.createElement(t.tagName,n,t.attrs);this._attachElementToTree(r,t.location)}_insertElement(t,n){const r=this.treeAdapter.createElement(t.tagName,n,t.attrs);this._attachElementToTree(r,t.location),this.openElements.push(r,t.tagID)}_insertFakeElement(t,n){const r=this.treeAdapter.createElement(t,Me.HTML,[]);this._attachElementToTree(r,null),this.openElements.push(r,n)}_insertTemplate(t){const n=this.treeAdapter.createElement(t.tagName,Me.HTML,t.attrs),r=this.treeAdapter.createDocumentFragment();this.treeAdapter.setTemplateContent(n,r),this._attachElementToTree(n,t.location),this.openElements.push(n,t.tagID),this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(r,null)}_insertFakeRootElement(){const t=this.treeAdapter.createElement(me.HTML,Me.HTML,[]);this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(t,null),this.treeAdapter.appendChild(this.openElements.current,t),this.openElements.push(t,S.HTML)}_appendCommentNode(t,n){const r=this.treeAdapter.createCommentNode(t.data);this.treeAdapter.appendChild(n,r),this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(r,t.location)}_insertCharacters(t){let n,r;if(this._shouldFosterParentOnInsertion()?({parent:n,beforeElement:r}=this._findFosterParentingLocation(),r?this.treeAdapter.insertTextBefore(n,t.chars,r):this.treeAdapter.insertText(n,t.chars)):(n=this.openElements.currentTmplContentOrNode,this.treeAdapter.insertText(n,t.chars)),!t.location)return;const i=this.treeAdapter.getChildNodes(n),a=r?i.lastIndexOf(r):i.length,l=i[a-1];if(this.treeAdapter.getNodeSourceCodeLocation(l)){const{endLine:d,endCol:f,endOffset:g}=t.location;this.treeAdapter.updateNodeSourceCodeLocation(l,{endLine:d,endCol:f,endOffset:g})}else this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(l,t.location)}_adoptNodes(t,n){for(let r=this.treeAdapter.getFirstChild(t);r;r=this.treeAdapter.getFirstChild(t))this.treeAdapter.detachNode(r),this.treeAdapter.appendChild(n,r)}_setEndLocation(t,n){if(this.treeAdapter.getNodeSourceCodeLocation(t)&&n.location){const r=n.location,i=this.treeAdapter.getTagName(t),a=n.type===Ct.END_TAG&&i===n.tagName?{endTag:{...r},endLine:r.endLine,endCol:r.endCol,endOffset:r.endOffset}:{endLine:r.startLine,endCol:r.startCol,endOffset:r.startOffset};this.treeAdapter.updateNodeSourceCodeLocation(t,a)}}shouldProcessStartTagTokenInForeignContent(t){if(!this.currentNotInHTML)return!1;let n,r;return this.openElements.stackTop===0&&this.fragmentContext?(n=this.fragmentContext,r=this.fragmentContextID):{current:n,currentTagId:r}=this.openElements,t.tagID===S.SVG&&this.treeAdapter.getTagName(n)===me.ANNOTATION_XML&&this.treeAdapter.getNamespaceURI(n)===Me.MATHML?!1:this.tokenizer.inForeignNode||(t.tagID===S.MGLYPH||t.tagID===S.MALIGNMARK)&&r!==void 0&&!this._isIntegrationPoint(r,n,Me.HTML)}_processToken(t){switch(t.type){case Ct.CHARACTER:{this.onCharacter(t);break}case Ct.NULL_CHARACTER:{this.onNullCharacter(t);break}case Ct.COMMENT:{this.onComment(t);break}case Ct.DOCTYPE:{this.onDoctype(t);break}case Ct.START_TAG:{this._processStartTag(t);break}case Ct.END_TAG:{this.onEndTag(t);break}case Ct.EOF:{this.onEof(t);break}case Ct.WHITESPACE_CHARACTER:{this.onWhitespaceCharacter(t);break}}}_isIntegrationPoint(t,n,r){const i=this.treeAdapter.getNamespaceURI(n),a=this.treeAdapter.getAttrList(n);return gV(t,i,a,r)}_reconstructActiveFormattingElements(){const t=this.activeFormattingElements.entries.length;if(t){const n=this.activeFormattingElements.entries.findIndex(i=>i.type===_s.Marker||this.openElements.contains(i.element)),r=n===-1?t-1:n-1;for(let i=r;i>=0;i--){const a=this.activeFormattingElements.entries[i];this._insertElement(a.token,this.treeAdapter.getNamespaceURI(a.element)),a.element=this.openElements.current}}}_closeTableCell(){this.openElements.generateImpliedEndTags(),this.openElements.popUntilTableCellPopped(),this.activeFormattingElements.clearToLastMarker(),this.insertionMode=te.IN_ROW}_closePElement(){this.openElements.generateImpliedEndTagsWithExclusion(S.P),this.openElements.popUntilTagNamePopped(S.P)}_resetInsertionMode(){for(let t=this.openElements.stackTop;t>=0;t--)switch(t===0&&this.fragmentContext?this.fragmentContextID:this.openElements.tagIDs[t]){case S.TR:{this.insertionMode=te.IN_ROW;return}case S.TBODY:case S.THEAD:case S.TFOOT:{this.insertionMode=te.IN_TABLE_BODY;return}case S.CAPTION:{this.insertionMode=te.IN_CAPTION;return}case S.COLGROUP:{this.insertionMode=te.IN_COLUMN_GROUP;return}case S.TABLE:{this.insertionMode=te.IN_TABLE;return}case S.BODY:{this.insertionMode=te.IN_BODY;return}case S.FRAMESET:{this.insertionMode=te.IN_FRAMESET;return}case S.SELECT:{this._resetInsertionModeForSelect(t);return}case S.TEMPLATE:{this.insertionMode=this.tmplInsertionModeStack[0];return}case S.HTML:{this.insertionMode=this.headElement?te.AFTER_HEAD:te.BEFORE_HEAD;return}case S.TD:case S.TH:{if(t>0){this.insertionMode=te.IN_CELL;return}break}case S.HEAD:{if(t>0){this.insertionMode=te.IN_HEAD;return}break}}this.insertionMode=te.IN_BODY}_resetInsertionModeForSelect(t){if(t>0)for(let n=t-1;n>0;n--){const r=this.openElements.tagIDs[n];if(r===S.TEMPLATE)break;if(r===S.TABLE){this.insertionMode=te.IN_SELECT_IN_TABLE;return}}this.insertionMode=te.IN_SELECT}_isElementCausesFosterParenting(t){return Y_.has(t)}_shouldFosterParentOnInsertion(){return this.fosterParentingEnabled&&this.openElements.currentTagId!==void 0&&this._isElementCausesFosterParenting(this.openElements.currentTagId)}_findFosterParentingLocation(){for(let t=this.openElements.stackTop;t>=0;t--){const n=this.openElements.items[t];switch(this.openElements.tagIDs[t]){case S.TEMPLATE:{if(this.treeAdapter.getNamespaceURI(n)===Me.HTML)return{parent:this.treeAdapter.getTemplateContent(n),beforeElement:null};break}case S.TABLE:{const r=this.treeAdapter.getParentNode(n);return r?{parent:r,beforeElement:n}:{parent:this.openElements.items[t-1],beforeElement:null}}}}return{parent:this.openElements.items[0],beforeElement:null}}_fosterParentElement(t){const n=this._findFosterParentingLocation();n.beforeElement?this.treeAdapter.insertBefore(n.parent,t,n.beforeElement):this.treeAdapter.appendChild(n.parent,t)}_isSpecialElement(t,n){const r=this.treeAdapter.getNamespaceURI(t);return U$[r].has(n)}onCharacter(t){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){Qq(this,t);return}switch(this.insertionMode){case te.INITIAL:{sc(this,t);break}case te.BEFORE_HTML:{wc(this,t);break}case te.BEFORE_HEAD:{Nc(this,t);break}case te.IN_HEAD:{Ac(this,t);break}case te.IN_HEAD_NO_SCRIPT:{_c(this,t);break}case te.AFTER_HEAD:{Rc(this,t);break}case te.IN_BODY:case te.IN_CAPTION:case te.IN_CELL:case te.IN_TEMPLATE:{X_(this,t);break}case te.TEXT:case te.IN_SELECT:case te.IN_SELECT_IN_TABLE:{this._insertCharacters(t);break}case te.IN_TABLE:case te.IN_TABLE_BODY:case te.IN_ROW:{K0(this,t);break}case te.IN_TABLE_TEXT:{eR(this,t);break}case te.IN_COLUMN_GROUP:{Xh(this,t);break}case te.AFTER_BODY:{Kh(this,t);break}case te.AFTER_AFTER_BODY:{yh(this,t);break}}}onNullCharacter(t){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){Kq(this,t);return}switch(this.insertionMode){case te.INITIAL:{sc(this,t);break}case te.BEFORE_HTML:{wc(this,t);break}case te.BEFORE_HEAD:{Nc(this,t);break}case te.IN_HEAD:{Ac(this,t);break}case te.IN_HEAD_NO_SCRIPT:{_c(this,t);break}case te.AFTER_HEAD:{Rc(this,t);break}case te.TEXT:{this._insertCharacters(t);break}case te.IN_TABLE:case te.IN_TABLE_BODY:case te.IN_ROW:{K0(this,t);break}case te.IN_COLUMN_GROUP:{Xh(this,t);break}case te.AFTER_BODY:{Kh(this,t);break}case te.AFTER_AFTER_BODY:{yh(this,t);break}}}onComment(t){if(this.skipNextNewLine=!1,this.currentNotInHTML){e1(this,t);return}switch(this.insertionMode){case te.INITIAL:case te.BEFORE_HTML:case te.BEFORE_HEAD:case te.IN_HEAD:case te.IN_HEAD_NO_SCRIPT:case te.AFTER_HEAD:case te.IN_BODY:case te.IN_TABLE:case te.IN_CAPTION:case te.IN_COLUMN_GROUP:case te.IN_TABLE_BODY:case te.IN_ROW:case te.IN_CELL:case te.IN_SELECT:case te.IN_SELECT_IN_TABLE:case te.IN_TEMPLATE:case te.IN_FRAMESET:case te.AFTER_FRAMESET:{e1(this,t);break}case te.IN_TABLE_TEXT:{ic(this,t);break}case te.AFTER_BODY:{NV(this,t);break}case te.AFTER_AFTER_BODY:case te.AFTER_AFTER_FRAMESET:{AV(this,t);break}}}onDoctype(t){switch(this.skipNextNewLine=!1,this.insertionMode){case te.INITIAL:{_V(this,t);break}case te.BEFORE_HEAD:case te.IN_HEAD:case te.IN_HEAD_NO_SCRIPT:case te.AFTER_HEAD:{this._err(t,Ce.misplacedDoctype);break}case te.IN_TABLE_TEXT:{ic(this,t);break}}}onStartTag(t){this.skipNextNewLine=!1,this.currentToken=t,this._processStartTag(t),t.selfClosing&&!t.ackSelfClosing&&this._err(t,Ce.nonVoidHtmlElementStartTagWithTrailingSolidus)}_processStartTag(t){this.shouldProcessStartTagTokenInForeignContent(t)?Wq(this,t):this._startTagOutsideForeignContent(t)}_startTagOutsideForeignContent(t){switch(this.insertionMode){case te.INITIAL:{sc(this,t);break}case te.BEFORE_HTML:{RV(this,t);break}case te.BEFORE_HEAD:{IV(this,t);break}case te.IN_HEAD:{ms(this,t);break}case te.IN_HEAD_NO_SCRIPT:{DV(this,t);break}case te.AFTER_HEAD:{jV(this,t);break}case te.IN_BODY:{lr(this,t);break}case te.IN_TABLE:{Hl(this,t);break}case te.IN_TABLE_TEXT:{ic(this,t);break}case te.IN_CAPTION:{Mq(this,t);break}case te.IN_COLUMN_GROUP:{Xx(this,t);break}case te.IN_TABLE_BODY:{zp(this,t);break}case te.IN_ROW:{Fp(this,t);break}case te.IN_CELL:{Pq(this,t);break}case te.IN_SELECT:{rR(this,t);break}case te.IN_SELECT_IN_TABLE:{Bq(this,t);break}case te.IN_TEMPLATE:{Uq(this,t);break}case te.AFTER_BODY:{Fq(this,t);break}case te.IN_FRAMESET:{$q(this,t);break}case te.AFTER_FRAMESET:{qq(this,t);break}case te.AFTER_AFTER_BODY:{Gq(this,t);break}case te.AFTER_AFTER_FRAMESET:{Xq(this,t);break}}}onEndTag(t){this.skipNextNewLine=!1,this.currentToken=t,this.currentNotInHTML?Zq(this,t):this._endTagOutsideForeignContent(t)}_endTagOutsideForeignContent(t){switch(this.insertionMode){case te.INITIAL:{sc(this,t);break}case te.BEFORE_HTML:{OV(this,t);break}case te.BEFORE_HEAD:{MV(this,t);break}case te.IN_HEAD:{LV(this,t);break}case te.IN_HEAD_NO_SCRIPT:{PV(this,t);break}case te.AFTER_HEAD:{BV(this,t);break}case te.IN_BODY:{Up(this,t);break}case te.TEXT:{Sq(this,t);break}case te.IN_TABLE:{Gc(this,t);break}case te.IN_TABLE_TEXT:{ic(this,t);break}case te.IN_CAPTION:{Lq(this,t);break}case te.IN_COLUMN_GROUP:{Dq(this,t);break}case te.IN_TABLE_BODY:{t1(this,t);break}case te.IN_ROW:{nR(this,t);break}case te.IN_CELL:{jq(this,t);break}case te.IN_SELECT:{sR(this,t);break}case te.IN_SELECT_IN_TABLE:{Hq(this,t);break}case te.IN_TEMPLATE:{zq(this,t);break}case te.AFTER_BODY:{aR(this,t);break}case te.IN_FRAMESET:{Vq(this,t);break}case te.AFTER_FRAMESET:{Yq(this,t);break}case te.AFTER_AFTER_BODY:{yh(this,t);break}}}onEof(t){switch(this.insertionMode){case te.INITIAL:{sc(this,t);break}case te.BEFORE_HTML:{wc(this,t);break}case te.BEFORE_HEAD:{Nc(this,t);break}case te.IN_HEAD:{Ac(this,t);break}case te.IN_HEAD_NO_SCRIPT:{_c(this,t);break}case te.AFTER_HEAD:{Rc(this,t);break}case te.IN_BODY:case te.IN_TABLE:case te.IN_CAPTION:case te.IN_COLUMN_GROUP:case te.IN_TABLE_BODY:case te.IN_ROW:case te.IN_CELL:case te.IN_SELECT:case te.IN_SELECT_IN_TABLE:{Z_(this,t);break}case te.TEXT:{Cq(this,t);break}case te.IN_TABLE_TEXT:{ic(this,t);break}case te.IN_TEMPLATE:{iR(this,t);break}case te.AFTER_BODY:case te.IN_FRAMESET:case te.AFTER_FRAMESET:case te.AFTER_AFTER_BODY:case te.AFTER_AFTER_FRAMESET:{Gx(this,t);break}}}onWhitespaceCharacter(t){if(this.skipNextNewLine&&(this.skipNextNewLine=!1,t.chars.charCodeAt(0)===Y.LINE_FEED)){if(t.chars.length===1)return;t.chars=t.chars.substr(1)}if(this.tokenizer.inForeignNode){this._insertCharacters(t);return}switch(this.insertionMode){case te.IN_HEAD:case te.IN_HEAD_NO_SCRIPT:case te.AFTER_HEAD:case te.TEXT:case te.IN_COLUMN_GROUP:case te.IN_SELECT:case te.IN_SELECT_IN_TABLE:case te.IN_FRAMESET:case te.AFTER_FRAMESET:{this._insertCharacters(t);break}case te.IN_BODY:case te.IN_CAPTION:case te.IN_CELL:case te.IN_TEMPLATE:case te.AFTER_BODY:case te.AFTER_AFTER_BODY:case te.AFTER_AFTER_FRAMESET:{G_(this,t);break}case te.IN_TABLE:case te.IN_TABLE_BODY:case te.IN_ROW:{K0(this,t);break}case te.IN_TABLE_TEXT:{J_(this,t);break}}}}function vV(e,t){let n=e.activeFormattingElements.getElementEntryInScopeWithTagName(t.tagName);return n?e.openElements.contains(n.element)?e.openElements.hasInScope(t.tagID)||(n=null):(e.activeFormattingElements.removeEntry(n),n=null):W_(e,t),n}function TV(e,t){let n=null,r=e.openElements.stackTop;for(;r>=0;r--){const i=e.openElements.items[r];if(i===t.element)break;e._isSpecialElement(i,e.openElements.tagIDs[r])&&(n=i)}return n||(e.openElements.shortenToLength(Math.max(r,0)),e.activeFormattingElements.removeEntry(t)),n}function SV(e,t,n){let r=t,i=e.openElements.getCommonAncestor(t);for(let a=0,l=i;l!==n;a++,l=i){i=e.openElements.getCommonAncestor(l);const c=e.activeFormattingElements.getElementEntry(l),d=c&&a>=yV;!c||d?(d&&e.activeFormattingElements.removeEntry(c),e.openElements.remove(l)):(l=CV(e,c),r===t&&(e.activeFormattingElements.bookmark=c),e.treeAdapter.detachNode(r),e.treeAdapter.appendChild(l,r),r=l)}return r}function CV(e,t){const n=e.treeAdapter.getNamespaceURI(t.element),r=e.treeAdapter.createElement(t.token.tagName,n,t.token.attrs);return e.openElements.replace(t.element,r),t.element=r,r}function kV(e,t,n){const r=e.treeAdapter.getTagName(t),i=eu(r);if(e._isElementCausesFosterParenting(i))e._fosterParentElement(n);else{const a=e.treeAdapter.getNamespaceURI(t);i===S.TEMPLATE&&a===Me.HTML&&(t=e.treeAdapter.getTemplateContent(t)),e.treeAdapter.appendChild(t,n)}}function wV(e,t,n){const r=e.treeAdapter.getNamespaceURI(n.element),{token:i}=n,a=e.treeAdapter.createElement(i.tagName,r,i.attrs);e._adoptNodes(t,a),e.treeAdapter.appendChild(t,a),e.activeFormattingElements.insertElementAfterBookmark(a,i),e.activeFormattingElements.removeEntry(n),e.openElements.remove(n.element),e.openElements.insertAfter(t,a,i.tagID)}function Yx(e,t){for(let n=0;n<xV;n++){const r=vV(e,t);if(!r)break;const i=TV(e,r);if(!i)break;e.activeFormattingElements.bookmark=r;const a=SV(e,i,r.element),l=e.openElements.getCommonAncestor(r.element);e.treeAdapter.detachNode(a),l&&kV(e,l,a),wV(e,i,r)}}function e1(e,t){e._appendCommentNode(t,e.openElements.currentTmplContentOrNode)}function NV(e,t){e._appendCommentNode(t,e.openElements.items[0])}function AV(e,t){e._appendCommentNode(t,e.document)}function Gx(e,t){if(e.stopped=!0,t.location){const n=e.fragmentContext?0:2;for(let r=e.openElements.stackTop;r>=n;r--)e._setEndLocation(e.openElements.items[r],t);if(!e.fragmentContext&&e.openElements.stackTop>=0){const r=e.openElements.items[0],i=e.treeAdapter.getNodeSourceCodeLocation(r);if(i&&!i.endTag&&(e._setEndLocation(r,t),e.openElements.stackTop>=1)){const a=e.openElements.items[1],l=e.treeAdapter.getNodeSourceCodeLocation(a);l&&!l.endTag&&e._setEndLocation(a,t)}}}}function _V(e,t){e._setDocumentType(t);const n=t.forceQuirks?rs.QUIRKS:iV(t);sV(t)||e._err(t,Ce.nonConformingDoctype),e.treeAdapter.setDocumentMode(e.document,n),e.insertionMode=te.BEFORE_HTML}function sc(e,t){e._err(t,Ce.missingDoctype,!0),e.treeAdapter.setDocumentMode(e.document,rs.QUIRKS),e.insertionMode=te.BEFORE_HTML,e._processToken(t)}function RV(e,t){t.tagID===S.HTML?(e._insertElement(t,Me.HTML),e.insertionMode=te.BEFORE_HEAD):wc(e,t)}function OV(e,t){const n=t.tagID;(n===S.HTML||n===S.HEAD||n===S.BODY||n===S.BR)&&wc(e,t)}function wc(e,t){e._insertFakeRootElement(),e.insertionMode=te.BEFORE_HEAD,e._processToken(t)}function IV(e,t){switch(t.tagID){case S.HTML:{lr(e,t);break}case S.HEAD:{e._insertElement(t,Me.HTML),e.headElement=e.openElements.current,e.insertionMode=te.IN_HEAD;break}default:Nc(e,t)}}function MV(e,t){const n=t.tagID;n===S.HEAD||n===S.BODY||n===S.HTML||n===S.BR?Nc(e,t):e._err(t,Ce.endTagWithoutMatchingOpenElement)}function Nc(e,t){e._insertFakeElement(me.HEAD,S.HEAD),e.headElement=e.openElements.current,e.insertionMode=te.IN_HEAD,e._processToken(t)}function ms(e,t){switch(t.tagID){case S.HTML:{lr(e,t);break}case S.BASE:case S.BASEFONT:case S.BGSOUND:case S.LINK:case S.META:{e._appendElement(t,Me.HTML),t.ackSelfClosing=!0;break}case S.TITLE:{e._switchToTextParsing(t,kn.RCDATA);break}case S.NOSCRIPT:{e.options.scriptingEnabled?e._switchToTextParsing(t,kn.RAWTEXT):(e._insertElement(t,Me.HTML),e.insertionMode=te.IN_HEAD_NO_SCRIPT);break}case S.NOFRAMES:case S.STYLE:{e._switchToTextParsing(t,kn.RAWTEXT);break}case S.SCRIPT:{e._switchToTextParsing(t,kn.SCRIPT_DATA);break}case S.TEMPLATE:{e._insertTemplate(t),e.activeFormattingElements.insertMarker(),e.framesetOk=!1,e.insertionMode=te.IN_TEMPLATE,e.tmplInsertionModeStack.unshift(te.IN_TEMPLATE);break}case S.HEAD:{e._err(t,Ce.misplacedStartTagForHeadElement);break}default:Ac(e,t)}}function LV(e,t){switch(t.tagID){case S.HEAD:{e.openElements.pop(),e.insertionMode=te.AFTER_HEAD;break}case S.BODY:case S.BR:case S.HTML:{Ac(e,t);break}case S.TEMPLATE:{wo(e,t);break}default:e._err(t,Ce.endTagWithoutMatchingOpenElement)}}function wo(e,t){e.openElements.tmplCount>0?(e.openElements.generateImpliedEndTagsThoroughly(),e.openElements.currentTagId!==S.TEMPLATE&&e._err(t,Ce.closingOfElementWithOpenChildElements),e.openElements.popUntilTagNamePopped(S.TEMPLATE),e.activeFormattingElements.clearToLastMarker(),e.tmplInsertionModeStack.shift(),e._resetInsertionMode()):e._err(t,Ce.endTagWithoutMatchingOpenElement)}function Ac(e,t){e.openElements.pop(),e.insertionMode=te.AFTER_HEAD,e._processToken(t)}function DV(e,t){switch(t.tagID){case S.HTML:{lr(e,t);break}case S.BASEFONT:case S.BGSOUND:case S.HEAD:case S.LINK:case S.META:case S.NOFRAMES:case S.STYLE:{ms(e,t);break}case S.NOSCRIPT:{e._err(t,Ce.nestedNoscriptInHead);break}default:_c(e,t)}}function PV(e,t){switch(t.tagID){case S.NOSCRIPT:{e.openElements.pop(),e.insertionMode=te.IN_HEAD;break}case S.BR:{_c(e,t);break}default:e._err(t,Ce.endTagWithoutMatchingOpenElement)}}function _c(e,t){const n=t.type===Ct.EOF?Ce.openElementsLeftAfterEof:Ce.disallowedContentInNoscriptInHead;e._err(t,n),e.openElements.pop(),e.insertionMode=te.IN_HEAD,e._processToken(t)}function jV(e,t){switch(t.tagID){case S.HTML:{lr(e,t);break}case S.BODY:{e._insertElement(t,Me.HTML),e.framesetOk=!1,e.insertionMode=te.IN_BODY;break}case S.FRAMESET:{e._insertElement(t,Me.HTML),e.insertionMode=te.IN_FRAMESET;break}case S.BASE:case S.BASEFONT:case S.BGSOUND:case S.LINK:case S.META:case S.NOFRAMES:case S.SCRIPT:case S.STYLE:case S.TEMPLATE:case S.TITLE:{e._err(t,Ce.abandonedHeadElementChild),e.openElements.push(e.headElement,S.HEAD),ms(e,t),e.openElements.remove(e.headElement);break}case S.HEAD:{e._err(t,Ce.misplacedStartTagForHeadElement);break}default:Rc(e,t)}}function BV(e,t){switch(t.tagID){case S.BODY:case S.HTML:case S.BR:{Rc(e,t);break}case S.TEMPLATE:{wo(e,t);break}default:e._err(t,Ce.endTagWithoutMatchingOpenElement)}}function Rc(e,t){e._insertFakeElement(me.BODY,S.BODY),e.insertionMode=te.IN_BODY,Hp(e,t)}function Hp(e,t){switch(t.type){case Ct.CHARACTER:{X_(e,t);break}case Ct.WHITESPACE_CHARACTER:{G_(e,t);break}case Ct.COMMENT:{e1(e,t);break}case Ct.START_TAG:{lr(e,t);break}case Ct.END_TAG:{Up(e,t);break}case Ct.EOF:{Z_(e,t);break}}}function G_(e,t){e._reconstructActiveFormattingElements(),e._insertCharacters(t)}function X_(e,t){e._reconstructActiveFormattingElements(),e._insertCharacters(t),e.framesetOk=!1}function HV(e,t){e.openElements.tmplCount===0&&e.treeAdapter.adoptAttributes(e.openElements.items[0],t.attrs)}function UV(e,t){const n=e.openElements.tryPeekProperlyNestedBodyElement();n&&e.openElements.tmplCount===0&&(e.framesetOk=!1,e.treeAdapter.adoptAttributes(n,t.attrs))}function zV(e,t){const n=e.openElements.tryPeekProperlyNestedBodyElement();e.framesetOk&&n&&(e.treeAdapter.detachNode(n),e.openElements.popAllUpToHtmlElement(),e._insertElement(t,Me.HTML),e.insertionMode=te.IN_FRAMESET)}function FV(e,t){e.openElements.hasInButtonScope(S.P)&&e._closePElement(),e._insertElement(t,Me.HTML)}function $V(e,t){e.openElements.hasInButtonScope(S.P)&&e._closePElement(),e.openElements.currentTagId!==void 0&&Jb.has(e.openElements.currentTagId)&&e.openElements.pop(),e._insertElement(t,Me.HTML)}function VV(e,t){e.openElements.hasInButtonScope(S.P)&&e._closePElement(),e._insertElement(t,Me.HTML),e.skipNextNewLine=!0,e.framesetOk=!1}function qV(e,t){const n=e.openElements.tmplCount>0;(!e.formElement||n)&&(e.openElements.hasInButtonScope(S.P)&&e._closePElement(),e._insertElement(t,Me.HTML),n||(e.formElement=e.openElements.current))}function YV(e,t){e.framesetOk=!1;const n=t.tagID;for(let r=e.openElements.stackTop;r>=0;r--){const i=e.openElements.tagIDs[r];if(n===S.LI&&i===S.LI||(n===S.DD||n===S.DT)&&(i===S.DD||i===S.DT)){e.openElements.generateImpliedEndTagsWithExclusion(i),e.openElements.popUntilTagNamePopped(i);break}if(i!==S.ADDRESS&&i!==S.DIV&&i!==S.P&&e._isSpecialElement(e.openElements.items[r],i))break}e.openElements.hasInButtonScope(S.P)&&e._closePElement(),e._insertElement(t,Me.HTML)}function GV(e,t){e.openElements.hasInButtonScope(S.P)&&e._closePElement(),e._insertElement(t,Me.HTML),e.tokenizer.state=kn.PLAINTEXT}function XV(e,t){e.openElements.hasInScope(S.BUTTON)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(S.BUTTON)),e._reconstructActiveFormattingElements(),e._insertElement(t,Me.HTML),e.framesetOk=!1}function KV(e,t){const n=e.activeFormattingElements.getElementEntryInScopeWithTagName(me.A);n&&(Yx(e,t),e.openElements.remove(n.element),e.activeFormattingElements.removeEntry(n)),e._reconstructActiveFormattingElements(),e._insertElement(t,Me.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function QV(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,Me.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function WV(e,t){e._reconstructActiveFormattingElements(),e.openElements.hasInScope(S.NOBR)&&(Yx(e,t),e._reconstructActiveFormattingElements()),e._insertElement(t,Me.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function ZV(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,Me.HTML),e.activeFormattingElements.insertMarker(),e.framesetOk=!1}function JV(e,t){e.treeAdapter.getDocumentMode(e.document)!==rs.QUIRKS&&e.openElements.hasInButtonScope(S.P)&&e._closePElement(),e._insertElement(t,Me.HTML),e.framesetOk=!1,e.insertionMode=te.IN_TABLE}function K_(e,t){e._reconstructActiveFormattingElements(),e._appendElement(t,Me.HTML),e.framesetOk=!1,t.ackSelfClosing=!0}function Q_(e){const t=B_(e,no.TYPE);return t!=null&&t.toLowerCase()===bV}function eq(e,t){e._reconstructActiveFormattingElements(),e._appendElement(t,Me.HTML),Q_(t)||(e.framesetOk=!1),t.ackSelfClosing=!0}function tq(e,t){e._appendElement(t,Me.HTML),t.ackSelfClosing=!0}function nq(e,t){e.openElements.hasInButtonScope(S.P)&&e._closePElement(),e._appendElement(t,Me.HTML),e.framesetOk=!1,t.ackSelfClosing=!0}function rq(e,t){t.tagName=me.IMG,t.tagID=S.IMG,K_(e,t)}function sq(e,t){e._insertElement(t,Me.HTML),e.skipNextNewLine=!0,e.tokenizer.state=kn.RCDATA,e.originalInsertionMode=e.insertionMode,e.framesetOk=!1,e.insertionMode=te.TEXT}function iq(e,t){e.openElements.hasInButtonScope(S.P)&&e._closePElement(),e._reconstructActiveFormattingElements(),e.framesetOk=!1,e._switchToTextParsing(t,kn.RAWTEXT)}function aq(e,t){e.framesetOk=!1,e._switchToTextParsing(t,kn.RAWTEXT)}function XC(e,t){e._switchToTextParsing(t,kn.RAWTEXT)}function oq(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,Me.HTML),e.framesetOk=!1,e.insertionMode=e.insertionMode===te.IN_TABLE||e.insertionMode===te.IN_CAPTION||e.insertionMode===te.IN_TABLE_BODY||e.insertionMode===te.IN_ROW||e.insertionMode===te.IN_CELL?te.IN_SELECT_IN_TABLE:te.IN_SELECT}function lq(e,t){e.openElements.currentTagId===S.OPTION&&e.openElements.pop(),e._reconstructActiveFormattingElements(),e._insertElement(t,Me.HTML)}function uq(e,t){e.openElements.hasInScope(S.RUBY)&&e.openElements.generateImpliedEndTags(),e._insertElement(t,Me.HTML)}function cq(e,t){e.openElements.hasInScope(S.RUBY)&&e.openElements.generateImpliedEndTagsWithExclusion(S.RTC),e._insertElement(t,Me.HTML)}function dq(e,t){e._reconstructActiveFormattingElements(),V_(t),qx(t),t.selfClosing?e._appendElement(t,Me.MATHML):e._insertElement(t,Me.MATHML),t.ackSelfClosing=!0}function fq(e,t){e._reconstructActiveFormattingElements(),q_(t),qx(t),t.selfClosing?e._appendElement(t,Me.SVG):e._insertElement(t,Me.SVG),t.ackSelfClosing=!0}function KC(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,Me.HTML)}function lr(e,t){switch(t.tagID){case S.I:case S.S:case S.B:case S.U:case S.EM:case S.TT:case S.BIG:case S.CODE:case S.FONT:case S.SMALL:case S.STRIKE:case S.STRONG:{QV(e,t);break}case S.A:{KV(e,t);break}case S.H1:case S.H2:case S.H3:case S.H4:case S.H5:case S.H6:{$V(e,t);break}case S.P:case S.DL:case S.OL:case S.UL:case S.DIV:case S.DIR:case S.NAV:case S.MAIN:case S.MENU:case S.ASIDE:case S.CENTER:case S.FIGURE:case S.FOOTER:case S.HEADER:case S.HGROUP:case S.DIALOG:case S.DETAILS:case S.ADDRESS:case S.ARTICLE:case S.SEARCH:case S.SECTION:case S.SUMMARY:case S.FIELDSET:case S.BLOCKQUOTE:case S.FIGCAPTION:{FV(e,t);break}case S.LI:case S.DD:case S.DT:{YV(e,t);break}case S.BR:case S.IMG:case S.WBR:case S.AREA:case S.EMBED:case S.KEYGEN:{K_(e,t);break}case S.HR:{nq(e,t);break}case S.RB:case S.RTC:{uq(e,t);break}case S.RT:case S.RP:{cq(e,t);break}case S.PRE:case S.LISTING:{VV(e,t);break}case S.XMP:{iq(e,t);break}case S.SVG:{fq(e,t);break}case S.HTML:{HV(e,t);break}case S.BASE:case S.LINK:case S.META:case S.STYLE:case S.TITLE:case S.SCRIPT:case S.BGSOUND:case S.BASEFONT:case S.TEMPLATE:{ms(e,t);break}case S.BODY:{UV(e,t);break}case S.FORM:{qV(e,t);break}case S.NOBR:{WV(e,t);break}case S.MATH:{dq(e,t);break}case S.TABLE:{JV(e,t);break}case S.INPUT:{eq(e,t);break}case S.PARAM:case S.TRACK:case S.SOURCE:{tq(e,t);break}case S.IMAGE:{rq(e,t);break}case S.BUTTON:{XV(e,t);break}case S.APPLET:case S.OBJECT:case S.MARQUEE:{ZV(e,t);break}case S.IFRAME:{aq(e,t);break}case S.SELECT:{oq(e,t);break}case S.OPTION:case S.OPTGROUP:{lq(e,t);break}case S.NOEMBED:case S.NOFRAMES:{XC(e,t);break}case S.FRAMESET:{zV(e,t);break}case S.TEXTAREA:{sq(e,t);break}case S.NOSCRIPT:{e.options.scriptingEnabled?XC(e,t):KC(e,t);break}case S.PLAINTEXT:{GV(e,t);break}case S.COL:case S.TH:case S.TD:case S.TR:case S.HEAD:case S.FRAME:case S.TBODY:case S.TFOOT:case S.THEAD:case S.CAPTION:case S.COLGROUP:break;default:KC(e,t)}}function hq(e,t){if(e.openElements.hasInScope(S.BODY)&&(e.insertionMode=te.AFTER_BODY,e.options.sourceCodeLocationInfo)){const n=e.openElements.tryPeekProperlyNestedBodyElement();n&&e._setEndLocation(n,t)}}function pq(e,t){e.openElements.hasInScope(S.BODY)&&(e.insertionMode=te.AFTER_BODY,aR(e,t))}function mq(e,t){const n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n))}function gq(e){const t=e.openElements.tmplCount>0,{formElement:n}=e;t||(e.formElement=null),(n||t)&&e.openElements.hasInScope(S.FORM)&&(e.openElements.generateImpliedEndTags(),t?e.openElements.popUntilTagNamePopped(S.FORM):n&&e.openElements.remove(n))}function bq(e){e.openElements.hasInButtonScope(S.P)||e._insertFakeElement(me.P,S.P),e._closePElement()}function xq(e){e.openElements.hasInListItemScope(S.LI)&&(e.openElements.generateImpliedEndTagsWithExclusion(S.LI),e.openElements.popUntilTagNamePopped(S.LI))}function yq(e,t){const n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTagsWithExclusion(n),e.openElements.popUntilTagNamePopped(n))}function Eq(e){e.openElements.hasNumberedHeaderInScope()&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilNumberedHeaderPopped())}function vq(e,t){const n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n),e.activeFormattingElements.clearToLastMarker())}function Tq(e){e._reconstructActiveFormattingElements(),e._insertFakeElement(me.BR,S.BR),e.openElements.pop(),e.framesetOk=!1}function W_(e,t){const n=t.tagName,r=t.tagID;for(let i=e.openElements.stackTop;i>0;i--){const a=e.openElements.items[i],l=e.openElements.tagIDs[i];if(r===l&&(r!==S.UNKNOWN||e.treeAdapter.getTagName(a)===n)){e.openElements.generateImpliedEndTagsWithExclusion(r),e.openElements.stackTop>=i&&e.openElements.shortenToLength(i);break}if(e._isSpecialElement(a,l))break}}function Up(e,t){switch(t.tagID){case S.A:case S.B:case S.I:case S.S:case S.U:case S.EM:case S.TT:case S.BIG:case S.CODE:case S.FONT:case S.NOBR:case S.SMALL:case S.STRIKE:case S.STRONG:{Yx(e,t);break}case S.P:{bq(e);break}case S.DL:case S.UL:case S.OL:case S.DIR:case S.DIV:case S.NAV:case S.PRE:case S.MAIN:case S.MENU:case S.ASIDE:case S.BUTTON:case S.CENTER:case S.FIGURE:case S.FOOTER:case S.HEADER:case S.HGROUP:case S.DIALOG:case S.ADDRESS:case S.ARTICLE:case S.DETAILS:case S.SEARCH:case S.SECTION:case S.SUMMARY:case S.LISTING:case S.FIELDSET:case S.BLOCKQUOTE:case S.FIGCAPTION:{mq(e,t);break}case S.LI:{xq(e);break}case S.DD:case S.DT:{yq(e,t);break}case S.H1:case S.H2:case S.H3:case S.H4:case S.H5:case S.H6:{Eq(e);break}case S.BR:{Tq(e);break}case S.BODY:{hq(e,t);break}case S.HTML:{pq(e,t);break}case S.FORM:{gq(e);break}case S.APPLET:case S.OBJECT:case S.MARQUEE:{vq(e,t);break}case S.TEMPLATE:{wo(e,t);break}default:W_(e,t)}}function Z_(e,t){e.tmplInsertionModeStack.length>0?iR(e,t):Gx(e,t)}function Sq(e,t){var n;t.tagID===S.SCRIPT&&((n=e.scriptHandler)===null||n===void 0||n.call(e,e.openElements.current)),e.openElements.pop(),e.insertionMode=e.originalInsertionMode}function Cq(e,t){e._err(t,Ce.eofInElementThatCanContainOnlyText),e.openElements.pop(),e.insertionMode=e.originalInsertionMode,e.onEof(t)}function K0(e,t){if(e.openElements.currentTagId!==void 0&&Y_.has(e.openElements.currentTagId))switch(e.pendingCharacterTokens.length=0,e.hasNonWhitespacePendingCharacterToken=!1,e.originalInsertionMode=e.insertionMode,e.insertionMode=te.IN_TABLE_TEXT,t.type){case Ct.CHARACTER:{eR(e,t);break}case Ct.WHITESPACE_CHARACTER:{J_(e,t);break}}else ad(e,t)}function kq(e,t){e.openElements.clearBackToTableContext(),e.activeFormattingElements.insertMarker(),e._insertElement(t,Me.HTML),e.insertionMode=te.IN_CAPTION}function wq(e,t){e.openElements.clearBackToTableContext(),e._insertElement(t,Me.HTML),e.insertionMode=te.IN_COLUMN_GROUP}function Nq(e,t){e.openElements.clearBackToTableContext(),e._insertFakeElement(me.COLGROUP,S.COLGROUP),e.insertionMode=te.IN_COLUMN_GROUP,Xx(e,t)}function Aq(e,t){e.openElements.clearBackToTableContext(),e._insertElement(t,Me.HTML),e.insertionMode=te.IN_TABLE_BODY}function _q(e,t){e.openElements.clearBackToTableContext(),e._insertFakeElement(me.TBODY,S.TBODY),e.insertionMode=te.IN_TABLE_BODY,zp(e,t)}function Rq(e,t){e.openElements.hasInTableScope(S.TABLE)&&(e.openElements.popUntilTagNamePopped(S.TABLE),e._resetInsertionMode(),e._processStartTag(t))}function Oq(e,t){Q_(t)?e._appendElement(t,Me.HTML):ad(e,t),t.ackSelfClosing=!0}function Iq(e,t){!e.formElement&&e.openElements.tmplCount===0&&(e._insertElement(t,Me.HTML),e.formElement=e.openElements.current,e.openElements.pop())}function Hl(e,t){switch(t.tagID){case S.TD:case S.TH:case S.TR:{_q(e,t);break}case S.STYLE:case S.SCRIPT:case S.TEMPLATE:{ms(e,t);break}case S.COL:{Nq(e,t);break}case S.FORM:{Iq(e,t);break}case S.TABLE:{Rq(e,t);break}case S.TBODY:case S.TFOOT:case S.THEAD:{Aq(e,t);break}case S.INPUT:{Oq(e,t);break}case S.CAPTION:{kq(e,t);break}case S.COLGROUP:{wq(e,t);break}default:ad(e,t)}}function Gc(e,t){switch(t.tagID){case S.TABLE:{e.openElements.hasInTableScope(S.TABLE)&&(e.openElements.popUntilTagNamePopped(S.TABLE),e._resetInsertionMode());break}case S.TEMPLATE:{wo(e,t);break}case S.BODY:case S.CAPTION:case S.COL:case S.COLGROUP:case S.HTML:case S.TBODY:case S.TD:case S.TFOOT:case S.TH:case S.THEAD:case S.TR:break;default:ad(e,t)}}function ad(e,t){const n=e.fosterParentingEnabled;e.fosterParentingEnabled=!0,Hp(e,t),e.fosterParentingEnabled=n}function J_(e,t){e.pendingCharacterTokens.push(t)}function eR(e,t){e.pendingCharacterTokens.push(t),e.hasNonWhitespacePendingCharacterToken=!0}function ic(e,t){let n=0;if(e.hasNonWhitespacePendingCharacterToken)for(;n<e.pendingCharacterTokens.length;n++)ad(e,e.pendingCharacterTokens[n]);else for(;n<e.pendingCharacterTokens.length;n++)e._insertCharacters(e.pendingCharacterTokens[n]);e.insertionMode=e.originalInsertionMode,e._processToken(t)}const tR=new Set([S.CAPTION,S.COL,S.COLGROUP,S.TBODY,S.TD,S.TFOOT,S.TH,S.THEAD,S.TR]);function Mq(e,t){const n=t.tagID;tR.has(n)?e.openElements.hasInTableScope(S.CAPTION)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(S.CAPTION),e.activeFormattingElements.clearToLastMarker(),e.insertionMode=te.IN_TABLE,Hl(e,t)):lr(e,t)}function Lq(e,t){const n=t.tagID;switch(n){case S.CAPTION:case S.TABLE:{e.openElements.hasInTableScope(S.CAPTION)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(S.CAPTION),e.activeFormattingElements.clearToLastMarker(),e.insertionMode=te.IN_TABLE,n===S.TABLE&&Gc(e,t));break}case S.BODY:case S.COL:case S.COLGROUP:case S.HTML:case S.TBODY:case S.TD:case S.TFOOT:case S.TH:case S.THEAD:case S.TR:break;default:Up(e,t)}}function Xx(e,t){switch(t.tagID){case S.HTML:{lr(e,t);break}case S.COL:{e._appendElement(t,Me.HTML),t.ackSelfClosing=!0;break}case S.TEMPLATE:{ms(e,t);break}default:Xh(e,t)}}function Dq(e,t){switch(t.tagID){case S.COLGROUP:{e.openElements.currentTagId===S.COLGROUP&&(e.openElements.pop(),e.insertionMode=te.IN_TABLE);break}case S.TEMPLATE:{wo(e,t);break}case S.COL:break;default:Xh(e,t)}}function Xh(e,t){e.openElements.currentTagId===S.COLGROUP&&(e.openElements.pop(),e.insertionMode=te.IN_TABLE,e._processToken(t))}function zp(e,t){switch(t.tagID){case S.TR:{e.openElements.clearBackToTableBodyContext(),e._insertElement(t,Me.HTML),e.insertionMode=te.IN_ROW;break}case S.TH:case S.TD:{e.openElements.clearBackToTableBodyContext(),e._insertFakeElement(me.TR,S.TR),e.insertionMode=te.IN_ROW,Fp(e,t);break}case S.CAPTION:case S.COL:case S.COLGROUP:case S.TBODY:case S.TFOOT:case S.THEAD:{e.openElements.hasTableBodyContextInTableScope()&&(e.openElements.clearBackToTableBodyContext(),e.openElements.pop(),e.insertionMode=te.IN_TABLE,Hl(e,t));break}default:Hl(e,t)}}function t1(e,t){const n=t.tagID;switch(t.tagID){case S.TBODY:case S.TFOOT:case S.THEAD:{e.openElements.hasInTableScope(n)&&(e.openElements.clearBackToTableBodyContext(),e.openElements.pop(),e.insertionMode=te.IN_TABLE);break}case S.TABLE:{e.openElements.hasTableBodyContextInTableScope()&&(e.openElements.clearBackToTableBodyContext(),e.openElements.pop(),e.insertionMode=te.IN_TABLE,Gc(e,t));break}case S.BODY:case S.CAPTION:case S.COL:case S.COLGROUP:case S.HTML:case S.TD:case S.TH:case S.TR:break;default:Gc(e,t)}}function Fp(e,t){switch(t.tagID){case S.TH:case S.TD:{e.openElements.clearBackToTableRowContext(),e._insertElement(t,Me.HTML),e.insertionMode=te.IN_CELL,e.activeFormattingElements.insertMarker();break}case S.CAPTION:case S.COL:case S.COLGROUP:case S.TBODY:case S.TFOOT:case S.THEAD:case S.TR:{e.openElements.hasInTableScope(S.TR)&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=te.IN_TABLE_BODY,zp(e,t));break}default:Hl(e,t)}}function nR(e,t){switch(t.tagID){case S.TR:{e.openElements.hasInTableScope(S.TR)&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=te.IN_TABLE_BODY);break}case S.TABLE:{e.openElements.hasInTableScope(S.TR)&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=te.IN_TABLE_BODY,t1(e,t));break}case S.TBODY:case S.TFOOT:case S.THEAD:{(e.openElements.hasInTableScope(t.tagID)||e.openElements.hasInTableScope(S.TR))&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=te.IN_TABLE_BODY,t1(e,t));break}case S.BODY:case S.CAPTION:case S.COL:case S.COLGROUP:case S.HTML:case S.TD:case S.TH:break;default:Gc(e,t)}}function Pq(e,t){const n=t.tagID;tR.has(n)?(e.openElements.hasInTableScope(S.TD)||e.openElements.hasInTableScope(S.TH))&&(e._closeTableCell(),Fp(e,t)):lr(e,t)}function jq(e,t){const n=t.tagID;switch(n){case S.TD:case S.TH:{e.openElements.hasInTableScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n),e.activeFormattingElements.clearToLastMarker(),e.insertionMode=te.IN_ROW);break}case S.TABLE:case S.TBODY:case S.TFOOT:case S.THEAD:case S.TR:{e.openElements.hasInTableScope(n)&&(e._closeTableCell(),nR(e,t));break}case S.BODY:case S.CAPTION:case S.COL:case S.COLGROUP:case S.HTML:break;default:Up(e,t)}}function rR(e,t){switch(t.tagID){case S.HTML:{lr(e,t);break}case S.OPTION:{e.openElements.currentTagId===S.OPTION&&e.openElements.pop(),e._insertElement(t,Me.HTML);break}case S.OPTGROUP:{e.openElements.currentTagId===S.OPTION&&e.openElements.pop(),e.openElements.currentTagId===S.OPTGROUP&&e.openElements.pop(),e._insertElement(t,Me.HTML);break}case S.HR:{e.openElements.currentTagId===S.OPTION&&e.openElements.pop(),e.openElements.currentTagId===S.OPTGROUP&&e.openElements.pop(),e._appendElement(t,Me.HTML),t.ackSelfClosing=!0;break}case S.INPUT:case S.KEYGEN:case S.TEXTAREA:case S.SELECT:{e.openElements.hasInSelectScope(S.SELECT)&&(e.openElements.popUntilTagNamePopped(S.SELECT),e._resetInsertionMode(),t.tagID!==S.SELECT&&e._processStartTag(t));break}case S.SCRIPT:case S.TEMPLATE:{ms(e,t);break}}}function sR(e,t){switch(t.tagID){case S.OPTGROUP:{e.openElements.stackTop>0&&e.openElements.currentTagId===S.OPTION&&e.openElements.tagIDs[e.openElements.stackTop-1]===S.OPTGROUP&&e.openElements.pop(),e.openElements.currentTagId===S.OPTGROUP&&e.openElements.pop();break}case S.OPTION:{e.openElements.currentTagId===S.OPTION&&e.openElements.pop();break}case S.SELECT:{e.openElements.hasInSelectScope(S.SELECT)&&(e.openElements.popUntilTagNamePopped(S.SELECT),e._resetInsertionMode());break}case S.TEMPLATE:{wo(e,t);break}}}function Bq(e,t){const n=t.tagID;n===S.CAPTION||n===S.TABLE||n===S.TBODY||n===S.TFOOT||n===S.THEAD||n===S.TR||n===S.TD||n===S.TH?(e.openElements.popUntilTagNamePopped(S.SELECT),e._resetInsertionMode(),e._processStartTag(t)):rR(e,t)}function Hq(e,t){const n=t.tagID;n===S.CAPTION||n===S.TABLE||n===S.TBODY||n===S.TFOOT||n===S.THEAD||n===S.TR||n===S.TD||n===S.TH?e.openElements.hasInTableScope(n)&&(e.openElements.popUntilTagNamePopped(S.SELECT),e._resetInsertionMode(),e.onEndTag(t)):sR(e,t)}function Uq(e,t){switch(t.tagID){case S.BASE:case S.BASEFONT:case S.BGSOUND:case S.LINK:case S.META:case S.NOFRAMES:case S.SCRIPT:case S.STYLE:case S.TEMPLATE:case S.TITLE:{ms(e,t);break}case S.CAPTION:case S.COLGROUP:case S.TBODY:case S.TFOOT:case S.THEAD:{e.tmplInsertionModeStack[0]=te.IN_TABLE,e.insertionMode=te.IN_TABLE,Hl(e,t);break}case S.COL:{e.tmplInsertionModeStack[0]=te.IN_COLUMN_GROUP,e.insertionMode=te.IN_COLUMN_GROUP,Xx(e,t);break}case S.TR:{e.tmplInsertionModeStack[0]=te.IN_TABLE_BODY,e.insertionMode=te.IN_TABLE_BODY,zp(e,t);break}case S.TD:case S.TH:{e.tmplInsertionModeStack[0]=te.IN_ROW,e.insertionMode=te.IN_ROW,Fp(e,t);break}default:e.tmplInsertionModeStack[0]=te.IN_BODY,e.insertionMode=te.IN_BODY,lr(e,t)}}function zq(e,t){t.tagID===S.TEMPLATE&&wo(e,t)}function iR(e,t){e.openElements.tmplCount>0?(e.openElements.popUntilTagNamePopped(S.TEMPLATE),e.activeFormattingElements.clearToLastMarker(),e.tmplInsertionModeStack.shift(),e._resetInsertionMode(),e.onEof(t)):Gx(e,t)}function Fq(e,t){t.tagID===S.HTML?lr(e,t):Kh(e,t)}function aR(e,t){var n;if(t.tagID===S.HTML){if(e.fragmentContext||(e.insertionMode=te.AFTER_AFTER_BODY),e.options.sourceCodeLocationInfo&&e.openElements.tagIDs[0]===S.HTML){e._setEndLocation(e.openElements.items[0],t);const r=e.openElements.items[1];r&&!(!((n=e.treeAdapter.getNodeSourceCodeLocation(r))===null||n===void 0)&&n.endTag)&&e._setEndLocation(r,t)}}else Kh(e,t)}function Kh(e,t){e.insertionMode=te.IN_BODY,Hp(e,t)}function $q(e,t){switch(t.tagID){case S.HTML:{lr(e,t);break}case S.FRAMESET:{e._insertElement(t,Me.HTML);break}case S.FRAME:{e._appendElement(t,Me.HTML),t.ackSelfClosing=!0;break}case S.NOFRAMES:{ms(e,t);break}}}function Vq(e,t){t.tagID===S.FRAMESET&&!e.openElements.isRootHtmlElementCurrent()&&(e.openElements.pop(),!e.fragmentContext&&e.openElements.currentTagId!==S.FRAMESET&&(e.insertionMode=te.AFTER_FRAMESET))}function qq(e,t){switch(t.tagID){case S.HTML:{lr(e,t);break}case S.NOFRAMES:{ms(e,t);break}}}function Yq(e,t){t.tagID===S.HTML&&(e.insertionMode=te.AFTER_AFTER_FRAMESET)}function Gq(e,t){t.tagID===S.HTML?lr(e,t):yh(e,t)}function yh(e,t){e.insertionMode=te.IN_BODY,Hp(e,t)}function Xq(e,t){switch(t.tagID){case S.HTML:{lr(e,t);break}case S.NOFRAMES:{ms(e,t);break}}}function Kq(e,t){t.chars=hn,e._insertCharacters(t)}function Qq(e,t){e._insertCharacters(t),e.framesetOk=!1}function oR(e){for(;e.treeAdapter.getNamespaceURI(e.openElements.current)!==Me.HTML&&e.openElements.currentTagId!==void 0&&!e._isIntegrationPoint(e.openElements.currentTagId,e.openElements.current);)e.openElements.pop()}function Wq(e,t){if(fV(t))oR(e),e._startTagOutsideForeignContent(t);else{const n=e._getAdjustedCurrentElement(),r=e.treeAdapter.getNamespaceURI(n);r===Me.MATHML?V_(t):r===Me.SVG&&(hV(t),q_(t)),qx(t),t.selfClosing?e._appendElement(t,r):e._insertElement(t,r),t.ackSelfClosing=!0}}function Zq(e,t){if(t.tagID===S.P||t.tagID===S.BR){oR(e),e._endTagOutsideForeignContent(t);return}for(let n=e.openElements.stackTop;n>0;n--){const r=e.openElements.items[n];if(e.treeAdapter.getNamespaceURI(r)===Me.HTML){e._endTagOutsideForeignContent(t);break}const i=e.treeAdapter.getTagName(r);if(i.toLowerCase()===t.tagName){t.tagName=i,e.openElements.shortenToLength(n);break}}}me.AREA,me.BASE,me.BASEFONT,me.BGSOUND,me.BR,me.COL,me.EMBED,me.FRAME,me.HR,me.IMG,me.INPUT,me.KEYGEN,me.LINK,me.META,me.PARAM,me.SOURCE,me.TRACK,me.WBR;const $p=lR("end"),js=lR("start");function lR(e){return t;function t(n){const r=n&&n.position&&n.position[e]||{};if(typeof r.line=="number"&&r.line>0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function uR(e){const t=js(e),n=$p(e);if(t&&n)return{start:t,end:n}}const Jq=/<(\/?)(iframe|noembed|noframes|plaintext|script|style|textarea|title|xmp)(?=[\t\n\f\r />])/gi,eY=new Set(["mdxFlowExpression","mdxJsxFlowElement","mdxJsxTextElement","mdxTextExpression","mdxjsEsm"]),QC={sourceCodeLocationInfo:!0,scriptingEnabled:!1};function cR(e,t){const n=cY(e),r=M_("type",{handlers:{root:tY,element:nY,text:rY,comment:fR,doctype:sY,raw:aY},unknown:oY}),i={parser:n?new GC(QC):GC.getFragmentParser(void 0,QC),handle(c){r(c,i)},stitches:!1,options:t||{}};r(e,i),tu(i,js());const a=n?i.parser.document:i.parser.getFragment(),l=d$(a,{file:i.options.file});return i.stitches&&Ps(l,"comment",function(c,d,f){const g=c;if(g.value.stitch&&f&&d!==void 0){const h=f.children;return h[d]=g.value.stitch,d}}),l.type==="root"&&l.children.length===1&&l.children[0].type===e.type?l.children[0]:l}function dR(e,t){let n=-1;if(e)for(;++n<e.length;)t.handle(e[n])}function tY(e,t){dR(e.children,t)}function nY(e,t){lY(e,t),dR(e.children,t),uY(e,t)}function rY(e,t){t.parser.tokenizer.state>4&&(t.parser.tokenizer.state=0);const n={type:Ct.CHARACTER,chars:e.value,location:od(e)};tu(t,js(e)),t.parser.currentToken=n,t.parser._processToken(t.parser.currentToken)}function sY(e,t){const n={type:Ct.DOCTYPE,name:"html",forceQuirks:!1,publicId:"",systemId:"",location:od(e)};tu(t,js(e)),t.parser.currentToken=n,t.parser._processToken(t.parser.currentToken)}function iY(e,t){t.stitches=!0;const n=dY(e);if("children"in e&&"children"in n){const r=cR({type:"root",children:e.children},t.options);n.children=r.children}fR({type:"comment",value:{stitch:n}},t)}function fR(e,t){const n=e.value,r={type:Ct.COMMENT,data:n,location:od(e)};tu(t,js(e)),t.parser.currentToken=r,t.parser._processToken(t.parser.currentToken)}function aY(e,t){if(t.parser.tokenizer.preprocessor.html="",t.parser.tokenizer.preprocessor.pos=-1,t.parser.tokenizer.preprocessor.lastGapPos=-2,t.parser.tokenizer.preprocessor.gapStack=[],t.parser.tokenizer.preprocessor.skipNextNewLine=!1,t.parser.tokenizer.preprocessor.lastChunkWritten=!1,t.parser.tokenizer.preprocessor.endOfChunkHit=!1,t.parser.tokenizer.preprocessor.isEol=!1,hR(t,js(e)),t.parser.tokenizer.write(t.options.tagfilter?e.value.replace(Jq,"&lt;$1$2"):e.value,!1),t.parser.tokenizer._runParsingLoop(),t.parser.tokenizer.state===72||t.parser.tokenizer.state===78){t.parser.tokenizer.preprocessor.lastChunkWritten=!0;const n=t.parser.tokenizer._consume();t.parser.tokenizer._callState(n)}}function oY(e,t){const n=e;if(t.options.passThrough&&t.options.passThrough.includes(n.type))iY(n,t);else{let r="";throw eY.has(n.type)&&(r=". It looks like you are using MDX nodes with `hast-util-raw` (or `rehype-raw`). If you use this because you are using remark or rehype plugins that inject `'html'` nodes, then please raise an issue with that plugin, as its a bad and slow idea. If you use this because you are using markdown syntax, then you have to configure this utility (or plugin) to pass through these nodes (see `passThrough` in docs), but you can also migrate to use the MDX syntax"),new Error("Cannot compile `"+n.type+"` node"+r)}}function tu(e,t){hR(e,t);const n=e.parser.tokenizer.currentCharacterToken;n&&n.location&&(n.location.endLine=e.parser.tokenizer.preprocessor.line,n.location.endCol=e.parser.tokenizer.preprocessor.col+1,n.location.endOffset=e.parser.tokenizer.preprocessor.offset+1,e.parser.currentToken=n,e.parser._processToken(e.parser.currentToken)),e.parser.tokenizer.paused=!1,e.parser.tokenizer.inLoop=!1,e.parser.tokenizer.active=!1,e.parser.tokenizer.returnState=kn.DATA,e.parser.tokenizer.charRefCode=-1,e.parser.tokenizer.consumedAfterSnapshot=-1,e.parser.tokenizer.currentLocation=null,e.parser.tokenizer.currentCharacterToken=null,e.parser.tokenizer.currentToken=null,e.parser.tokenizer.currentAttr={name:"",value:""}}function hR(e,t){if(t&&t.offset!==void 0){const n={startLine:t.line,startCol:t.column,startOffset:t.offset,endLine:-1,endCol:-1,endOffset:-1};e.parser.tokenizer.preprocessor.lineStartPos=-t.column+1,e.parser.tokenizer.preprocessor.droppedBufferSize=t.offset,e.parser.tokenizer.preprocessor.line=t.line,e.parser.tokenizer.currentLocation=n}}function lY(e,t){const n=e.tagName.toLowerCase();if(t.parser.tokenizer.state===kn.PLAINTEXT)return;tu(t,js(e));const r=t.parser.openElements.current;let i="namespaceURI"in r?r.namespaceURI:Wa.html;i===Wa.html&&n==="svg"&&(i=Wa.svg);const a=g$({...e,children:[]},{space:i===Wa.svg?"svg":"html"}),l={type:Ct.START_TAG,tagName:n,tagID:eu(n),selfClosing:!1,ackSelfClosing:!1,attrs:"attrs"in a?a.attrs:[],location:od(e)};t.parser.currentToken=l,t.parser._processToken(t.parser.currentToken),t.parser.tokenizer.lastStartTagName=n}function uY(e,t){const n=e.tagName.toLowerCase();if(!t.parser.tokenizer.inForeignNode&&C$.includes(n)||t.parser.tokenizer.state===kn.PLAINTEXT)return;tu(t,$p(e));const r={type:Ct.END_TAG,tagName:n,tagID:eu(n),selfClosing:!1,ackSelfClosing:!1,attrs:[],location:od(e)};t.parser.currentToken=r,t.parser._processToken(t.parser.currentToken),n===t.parser.tokenizer.lastStartTagName&&(t.parser.tokenizer.state===kn.RCDATA||t.parser.tokenizer.state===kn.RAWTEXT||t.parser.tokenizer.state===kn.SCRIPT_DATA)&&(t.parser.tokenizer.state=kn.DATA)}function cY(e){const t=e.type==="root"?e.children[0]:e;return!!(t&&(t.type==="doctype"||t.type==="element"&&t.tagName.toLowerCase()==="html"))}function od(e){const t=js(e)||{line:void 0,column:void 0,offset:void 0},n=$p(e)||{line:void 0,column:void 0,offset:void 0};return{startLine:t.line,startCol:t.column,startOffset:t.offset,endLine:n.line,endCol:n.column,endOffset:n.offset}}function dY(e){return"children"in e?po({...e,children:[]}):po(e)}function n1(e){return function(t,n){return cR(t,{...e,file:n})}}const Ua=["ariaDescribedBy","ariaLabel","ariaLabelledBy"],Va={ancestors:{tbody:["table"],td:["table"],th:["table"],thead:["table"],tfoot:["table"],tr:["table"]},attributes:{a:[...Ua,"dataFootnoteBackref","dataFootnoteRef",["className","data-footnote-backref"],"href"],blockquote:["cite"],code:[["className",/^language-./]],del:["cite"],div:["itemScope","itemType"],dl:[...Ua],h2:[["className","sr-only"]],img:[...Ua,"longDesc","src"],input:[["disabled",!0],["type","checkbox"]],ins:["cite"],li:[["className","task-list-item"]],ol:[...Ua,["className","contains-task-list"]],q:["cite"],section:["dataFootnotes",["className","footnotes"]],source:["srcSet"],summary:[...Ua],table:[...Ua],ul:[...Ua,["className","contains-task-list"]],"*":["abbr","accept","acceptCharset","accessKey","action","align","alt","axis","border","cellPadding","cellSpacing","char","charOff","charSet","checked","clear","colSpan","color","cols","compact","coords","dateTime","dir","encType","frame","hSpace","headers","height","hrefLang","htmlFor","id","isMap","itemProp","label","lang","maxLength","media","method","multiple","name","noHref","noShade","noWrap","open","prompt","readOnly","rev","rowSpan","rows","rules","scope","selected","shape","size","span","start","summary","tabIndex","title","useMap","vAlign","value","width"]},clobber:["ariaDescribedBy","ariaLabelledBy","id","name"],clobberPrefix:"user-content-",protocols:{cite:["http","https"],href:["http","https","irc","ircs","mailto","xmpp"],longDesc:["http","https"],src:["http","https"]},required:{input:{disabled:!0,type:"checkbox"}},strip:["script"],tagNames:["a","b","blockquote","br","code","dd","del","details","div","dl","dt","em","h1","h2","h3","h4","h5","h6","hr","i","img","input","ins","kbd","li","ol","p","picture","pre","q","rp","rt","ruby","s","samp","section","source","span","strike","strong","sub","summary","sup","table","tbody","td","tfoot","th","thead","tr","tt","ul","var"]},Zi={}.hasOwnProperty;function fY(e,t){let n={type:"root",children:[]};const r={schema:t?{...Va,...t}:Va,stack:[]},i=pR(r,e);return i&&(Array.isArray(i)?i.length===1?n=i[0]:n.children=i:n=i),n}function pR(e,t){if(t&&typeof t=="object"){const n=t;switch(typeof n.type=="string"?n.type:""){case"comment":return hY(e,n);case"doctype":return pY(e,n);case"element":return mY(e,n);case"root":return gY(e,n);case"text":return bY(e,n)}}}function hY(e,t){if(e.schema.allowComments){const n=typeof t.value=="string"?t.value:"",r=n.indexOf("-->"),a={type:"comment",value:r<0?n:n.slice(0,r)};return ld(a,t),a}}function pY(e,t){if(e.schema.allowDoctypes){const n={type:"doctype"};return ld(n,t),n}}function mY(e,t){const n=typeof t.tagName=="string"?t.tagName:"";e.stack.push(n);const r=mR(e,t.children),i=xY(e,t.properties);e.stack.pop();let a=!1;if(n&&n!=="*"&&(!e.schema.tagNames||e.schema.tagNames.includes(n))&&(a=!0,e.schema.ancestors&&Zi.call(e.schema.ancestors,n))){const c=e.schema.ancestors[n];let d=-1;for(a=!1;++d<c.length;)e.stack.includes(c[d])&&(a=!0)}if(!a)return e.schema.strip&&!e.schema.strip.includes(n)?r:void 0;const l={type:"element",tagName:n,properties:i,children:r};return ld(l,t),l}function gY(e,t){const r={type:"root",children:mR(e,t.children)};return ld(r,t),r}function bY(e,t){const r={type:"text",value:typeof t.value=="string"?t.value:""};return ld(r,t),r}function mR(e,t){const n=[];if(Array.isArray(t)){const r=t;let i=-1;for(;++i<r.length;){const a=pR(e,r[i]);a&&(Array.isArray(a)?n.push(...a):n.push(a))}}return n}function xY(e,t){const n=e.stack[e.stack.length-1],r=e.schema.attributes,i=e.schema.required,a=r&&Zi.call(r,n)?r[n]:void 0,l=r&&Zi.call(r,"*")?r["*"]:void 0,c=t&&typeof t=="object"?t:{},d={};let f;for(f in c)if(Zi.call(c,f)){const g=c[f];let h=WC(e,ZC(a,f),f,g);h==null&&(h=WC(e,ZC(l,f),f,g)),h!=null&&(d[f]=h)}if(i&&Zi.call(i,n)){const g=i[n];for(f in g)Zi.call(g,f)&&!Zi.call(d,f)&&(d[f]=g[f])}return d}function WC(e,t,n,r){return t?Array.isArray(r)?yY(e,t,n,r):gR(e,t,n,r):void 0}function yY(e,t,n,r){let i=-1;const a=[];for(;++i<r.length;){const l=gR(e,t,n,r[i]);(typeof l=="number"||typeof l=="string")&&a.push(l)}return a}function gR(e,t,n,r){if(!(typeof r!="boolean"&&typeof r!="number"&&typeof r!="string")&&EY(e,n,r)){if(typeof t=="object"&&t.length>1){let i=!1,a=0;for(;++a<t.length;){const l=t[a];if(l&&typeof l=="object"&&"flags"in l){if(l.test(String(r))){i=!0;break}}else if(l===r){i=!0;break}}if(!i)return}return e.schema.clobber&&e.schema.clobberPrefix&&e.schema.clobber.includes(n)?e.schema.clobberPrefix+r:r}}function EY(e,t,n){const r=e.schema.protocols&&Zi.call(e.schema.protocols,t)?e.schema.protocols[t]:void 0;if(!r||r.length===0)return!0;const i=String(n),a=i.indexOf(":"),l=i.indexOf("?"),c=i.indexOf("#"),d=i.indexOf("/");if(a<0||d>-1&&a>d||l>-1&&a>l||c>-1&&a>c)return!0;let f=-1;for(;++f<r.length;){const g=r[f];if(a===g.length&&i.slice(0,g.length)===g)return!0}return!1}function ld(e,t){const n=uR(t);t.data&&(e.data=po(t.data)),n&&(e.position=n)}function ZC(e,t){let n,r=-1;if(e)for(;++r<e.length;){const i=e[r],a=typeof i=="string"?i:i[0];if(a===t)return i;a==="data*"&&(n=i)}if(t.length>4&&t.slice(0,4).toLowerCase()==="data")return n}function bR(e){return function(t){return fY(t,e)}}function JC(e,t){const n=String(e);if(typeof t!="string")throw new TypeError("Expected character");let r=0,i=n.indexOf(t);for(;i!==-1;)r++,i=n.indexOf(t,i+t.length);return r}const fr=ba(/[A-Za-z]/),ar=ba(/[\dA-Za-z]/),vY=ba(/[#-'*+\--9=?A-Z^-~]/);function Qh(e){return e!==null&&(e<32||e===127)}const r1=ba(/\d/),TY=ba(/[\dA-Fa-f]/),SY=ba(/[!-/:-@[-`{-~]/);function st(e){return e!==null&&e<-2}function rn(e){return e!==null&&(e<0||e===32)}function _t(e){return e===-2||e===-1||e===32}const Vp=ba(/\p{P}|\p{S}/u),mo=ba(/\s/);function ba(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function CY(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function kY(e,t,n){const i=Dp((n||{}).ignore||[]),a=wY(t);let l=-1;for(;++l<a.length;)jx(e,"text",c);function c(f,g){let h=-1,b;for(;++h<g.length;){const x=g[h],v=b?b.children:void 0;if(i(x,v?v.indexOf(x):void 0,b))return;b=x}if(b)return d(f,g)}function d(f,g){const h=g[g.length-1],b=a[l][0],x=a[l][1];let v=0;const k=h.children.indexOf(f);let C=!1,N=[];b.lastIndex=0;let A=b.exec(f.value);for(;A;){const R=A.index,M={index:A.index,input:A.input,stack:[...g,f]};let _=x(...A,M);if(typeof _=="string"&&(_=_.length>0?{type:"text",value:_}:void 0),_===!1?b.lastIndex=R+1:(v!==R&&N.push({type:"text",value:f.value.slice(v,R)}),Array.isArray(_)?N.push(..._):_&&N.push(_),v=R+A[0].length,C=!0),!b.global)break;A=b.exec(f.value)}return C?(v<f.value.length&&N.push({type:"text",value:f.value.slice(v)}),h.children.splice(k,1,...N)):N=[f],k+N.length}}function wY(e){const t=[];if(!Array.isArray(e))throw new TypeError("Expected find and replace tuple or list of tuples");const n=!e[0]||Array.isArray(e[0])?e:[e];let r=-1;for(;++r<n.length;){const i=n[r];t.push([NY(i[0]),AY(i[1])])}return t}function NY(e){return typeof e=="string"?new RegExp(CY(e),"g"):e}function AY(e){return typeof e=="function"?e:function(){return e}}const Q0="phrasing",W0=["autolink","link","image","label"];function _Y(){return{transforms:[PY],enter:{literalAutolink:OY,literalAutolinkEmail:Z0,literalAutolinkHttp:Z0,literalAutolinkWww:Z0},exit:{literalAutolink:DY,literalAutolinkEmail:LY,literalAutolinkHttp:IY,literalAutolinkWww:MY}}}function RY(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:Q0,notInConstruct:W0},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:Q0,notInConstruct:W0},{character:":",before:"[ps]",after:"\\/",inConstruct:Q0,notInConstruct:W0}]}}function OY(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function Z0(e){this.config.enter.autolinkProtocol.call(this,e)}function IY(e){this.config.exit.autolinkProtocol.call(this,e)}function MY(e){this.config.exit.data.call(this,e);const t=this.stack[this.stack.length-1];t.type,t.url="http://"+this.sliceSerialize(e)}function LY(e){this.config.exit.autolinkEmail.call(this,e)}function DY(e){this.exit(e)}function PY(e){kY(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,jY],[/(?<=^|\s|\p{P}|\p{S})([-.\w+]+)@([-\w]+(?:\.[-\w]+)+)/gu,BY]],{ignore:["link","linkReference"]})}function jY(e,t,n,r,i){let a="";if(!xR(i)||(/^w/i.test(t)&&(n=t+n,t="",a="http://"),!HY(n)))return!1;const l=UY(n+r);if(!l[0])return!1;const c={type:"link",title:null,url:a+t+l[0],children:[{type:"text",value:t+l[0]}]};return l[1]?[c,{type:"text",value:l[1]}]:c}function BY(e,t,n,r){return!xR(r,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function HY(e){const t=e.split(".");return!(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[a-zA-Z\d]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[a-zA-Z\d]/.test(t[t.length-2])))}function UY(e){const t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(")");const i=JC(e,"(");let a=JC(e,")");for(;r!==-1&&i>a;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(")"),a++;return[e,n]}function xR(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||mo(n)||Vp(n))&&(!t||n!==47)}function hs(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}yR.peek=KY;function zY(){this.buffer()}function FY(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function $Y(){this.buffer()}function VY(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function qY(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=hs(this.sliceSerialize(e)).toLowerCase(),n.label=t}function YY(e){this.exit(e)}function GY(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=hs(this.sliceSerialize(e)).toLowerCase(),n.label=t}function XY(e){this.exit(e)}function KY(){return"["}function yR(e,t,n,r){const i=n.createTracker(r);let a=i.move("[^");const l=n.enter("footnoteReference"),c=n.enter("reference");return a+=i.move(n.safe(n.associationId(e),{after:"]",before:a})),c(),l(),a+=i.move("]"),a}function QY(){return{enter:{gfmFootnoteCallString:zY,gfmFootnoteCall:FY,gfmFootnoteDefinitionLabelString:$Y,gfmFootnoteDefinition:VY},exit:{gfmFootnoteCallString:qY,gfmFootnoteCall:YY,gfmFootnoteDefinitionLabelString:GY,gfmFootnoteDefinition:XY}}}function WY(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:yR},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(r,i,a,l){const c=a.createTracker(l);let d=c.move("[^");const f=a.enter("footnoteDefinition"),g=a.enter("label");return d+=c.move(a.safe(a.associationId(r),{before:d,after:"]"})),g(),d+=c.move("]:"),r.children&&r.children.length>0&&(c.shift(4),d+=c.move((t?`
541
+ `:" ")+a.indentLines(a.containerFlow(r,c.current()),t?ER:ZY))),f(),d}}function ZY(e,t,n){return t===0?e:ER(e,t,n)}function ER(e,t,n){return(n?"":" ")+e}const JY=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];vR.peek=sG;function eG(){return{canContainEols:["delete"],enter:{strikethrough:nG},exit:{strikethrough:rG}}}function tG(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:JY}],handlers:{delete:vR}}}function nG(e){this.enter({type:"delete",children:[]},e)}function rG(e){this.exit(e)}function vR(e,t,n,r){const i=n.createTracker(r),a=n.enter("strikethrough");let l=i.move("~~");return l+=n.containerPhrasing(e,{...i.current(),before:l,after:"~"}),l+=i.move("~~"),a(),l}function sG(){return"~"}function iG(e){return e.length}function aG(e,t){const n=t||{},r=(n.align||[]).concat(),i=n.stringLength||iG,a=[],l=[],c=[],d=[];let f=0,g=-1;for(;++g<e.length;){const w=[],k=[];let C=-1;for(e[g].length>f&&(f=e[g].length);++C<e[g].length;){const N=oG(e[g][C]);if(n.alignDelimiters!==!1){const A=i(N);k[C]=A,(d[C]===void 0||A>d[C])&&(d[C]=A)}w.push(N)}l[g]=w,c[g]=k}let h=-1;if(typeof r=="object"&&"length"in r)for(;++h<f;)a[h]=ek(r[h]);else{const w=ek(r);for(;++h<f;)a[h]=w}h=-1;const b=[],x=[];for(;++h<f;){const w=a[h];let k="",C="";w===99?(k=":",C=":"):w===108?k=":":w===114&&(C=":");let N=n.alignDelimiters===!1?1:Math.max(1,d[h]-k.length-C.length);const A=k+"-".repeat(N)+C;n.alignDelimiters!==!1&&(N=k.length+N+C.length,N>d[h]&&(d[h]=N),x[h]=N),b[h]=A}l.splice(1,0,b),c.splice(1,0,x),g=-1;const v=[];for(;++g<l.length;){const w=l[g],k=c[g];h=-1;const C=[];for(;++h<f;){const N=w[h]||"";let A="",R="";if(n.alignDelimiters!==!1){const M=d[h]-(k[h]||0),_=a[h];_===114?A=" ".repeat(M):_===99?M%2?(A=" ".repeat(M/2+.5),R=" ".repeat(M/2-.5)):(A=" ".repeat(M/2),R=A):R=" ".repeat(M)}n.delimiterStart!==!1&&!h&&C.push("|"),n.padding!==!1&&!(n.alignDelimiters===!1&&N==="")&&(n.delimiterStart!==!1||h)&&C.push(" "),n.alignDelimiters!==!1&&C.push(A),C.push(N),n.alignDelimiters!==!1&&C.push(R),n.padding!==!1&&C.push(" "),(n.delimiterEnd!==!1||h!==f-1)&&C.push("|")}v.push(n.delimiterEnd===!1?C.join("").replace(/ +$/,""):C.join(""))}return v.join(`
542
+ `)}function oG(e){return e==null?"":String(e)}function ek(e){const t=typeof e=="string"?e.codePointAt(0):0;return t===67||t===99?99:t===76||t===108?108:t===82||t===114?114:0}function lG(e,t,n,r){const i=n.enter("blockquote"),a=n.createTracker(r);a.move("> "),a.shift(2);const l=n.indentLines(n.containerFlow(e,a.current()),uG);return i(),l}function uG(e,t,n){return">"+(n?"":" ")+e}function cG(e,t){return tk(e,t.inConstruct,!0)&&!tk(e,t.notInConstruct,!1)}function tk(e,t,n){if(typeof t=="string"&&(t=[t]),!t||t.length===0)return n;let r=-1;for(;++r<t.length;)if(e.includes(t[r]))return!0;return!1}function nk(e,t,n,r){let i=-1;for(;++i<n.unsafe.length;)if(n.unsafe[i].character===`
543
+ `&&cG(n.stack,n.unsafe[i]))return/[ \t]/.test(r.before)?"":" ";return`\\
544
+ `}function dG(e,t){const n=String(e);let r=n.indexOf(t),i=r,a=0,l=0;if(typeof t!="string")throw new TypeError("Expected substring");for(;r!==-1;)r===i?++a>l&&(l=a):a=1,i=r+t.length,r=n.indexOf(t,i);return l}function fG(e,t){return!!(t.options.fences===!1&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}function hG(e){const t=e.options.fence||"`";if(t!=="`"&&t!=="~")throw new Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}function pG(e,t,n,r){const i=hG(n),a=e.value||"",l=i==="`"?"GraveAccent":"Tilde";if(fG(e,n)){const h=n.enter("codeIndented"),b=n.indentLines(a,mG);return h(),b}const c=n.createTracker(r),d=i.repeat(Math.max(dG(a,i)+1,3)),f=n.enter("codeFenced");let g=c.move(d);if(e.lang){const h=n.enter(`codeFencedLang${l}`);g+=c.move(n.safe(e.lang,{before:g,after:" ",encode:["`"],...c.current()})),h()}if(e.lang&&e.meta){const h=n.enter(`codeFencedMeta${l}`);g+=c.move(" "),g+=c.move(n.safe(e.meta,{before:g,after:`
545
+ `,encode:["`"],...c.current()})),h()}return g+=c.move(`
546
+ `),a&&(g+=c.move(a+`
547
+ `)),g+=c.move(d),f(),g}function mG(e,t,n){return(n?"":" ")+e}function Kx(e){const t=e.options.quote||'"';if(t!=='"'&&t!=="'")throw new Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function gG(e,t,n,r){const i=Kx(n),a=i==='"'?"Quote":"Apostrophe",l=n.enter("definition");let c=n.enter("label");const d=n.createTracker(r);let f=d.move("[");return f+=d.move(n.safe(n.associationId(e),{before:f,after:"]",...d.current()})),f+=d.move("]: "),c(),!e.url||/[\0- \u007F]/.test(e.url)?(c=n.enter("destinationLiteral"),f+=d.move("<"),f+=d.move(n.safe(e.url,{before:f,after:">",...d.current()})),f+=d.move(">")):(c=n.enter("destinationRaw"),f+=d.move(n.safe(e.url,{before:f,after:e.title?" ":`
548
+ `,...d.current()}))),c(),e.title&&(c=n.enter(`title${a}`),f+=d.move(" "+i),f+=d.move(n.safe(e.title,{before:f,after:i,...d.current()})),f+=d.move(i),c()),l(),f}function bG(e){const t=e.options.emphasis||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}function Xc(e){return"&#x"+e.toString(16).toUpperCase()+";"}function Ul(e){if(e===null||rn(e)||mo(e))return 1;if(Vp(e))return 2}function Wh(e,t,n){const r=Ul(e),i=Ul(t);return r===void 0?i===void 0?n==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:r===1?i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}TR.peek=xG;function TR(e,t,n,r){const i=bG(n),a=n.enter("emphasis"),l=n.createTracker(r),c=l.move(i);let d=l.move(n.containerPhrasing(e,{after:i,before:c,...l.current()}));const f=d.charCodeAt(0),g=Wh(r.before.charCodeAt(r.before.length-1),f,i);g.inside&&(d=Xc(f)+d.slice(1));const h=d.charCodeAt(d.length-1),b=Wh(r.after.charCodeAt(0),h,i);b.inside&&(d=d.slice(0,-1)+Xc(h));const x=l.move(i);return a(),n.attentionEncodeSurroundingInfo={after:b.outside,before:g.outside},c+d+x}function xG(e,t,n){return n.options.emphasis||"*"}const yG={};function Qx(e,t){const n=yG,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,i=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return SR(e,r,i)}function SR(e,t,n){if(EG(e)){if("value"in e)return e.type==="html"&&!n?"":e.value;if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return rk(e.children,t,n)}return Array.isArray(e)?rk(e,t,n):""}function rk(e,t,n){const r=[];let i=-1;for(;++i<e.length;)r[i]=SR(e[i],t,n);return r.join("")}function EG(e){return!!(e&&typeof e=="object")}function vG(e,t){let n=!1;return Ps(e,function(r){if("value"in r&&/\r?\n|\r/.test(r.value)||r.type==="break")return n=!0,Xb}),!!((!e.depth||e.depth<3)&&Qx(e)&&(t.options.setext||n))}function TG(e,t,n,r){const i=Math.max(Math.min(6,e.depth||1),1),a=n.createTracker(r);if(vG(e,n)){const g=n.enter("headingSetext"),h=n.enter("phrasing"),b=n.containerPhrasing(e,{...a.current(),before:`
549
+ `,after:`
550
+ `});return h(),g(),b+`
551
+ `+(i===1?"=":"-").repeat(b.length-(Math.max(b.lastIndexOf("\r"),b.lastIndexOf(`
552
+ `))+1))}const l="#".repeat(i),c=n.enter("headingAtx"),d=n.enter("phrasing");a.move(l+" ");let f=n.containerPhrasing(e,{before:"# ",after:`
553
+ `,...a.current()});return/^[\t ]/.test(f)&&(f=Xc(f.charCodeAt(0))+f.slice(1)),f=f?l+" "+f:l,n.options.closeAtx&&(f+=" "+l),d(),c(),f}CR.peek=SG;function CR(e){return e.value||""}function SG(){return"<"}kR.peek=CG;function kR(e,t,n,r){const i=Kx(n),a=i==='"'?"Quote":"Apostrophe",l=n.enter("image");let c=n.enter("label");const d=n.createTracker(r);let f=d.move("![");return f+=d.move(n.safe(e.alt,{before:f,after:"]",...d.current()})),f+=d.move("]("),c(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(c=n.enter("destinationLiteral"),f+=d.move("<"),f+=d.move(n.safe(e.url,{before:f,after:">",...d.current()})),f+=d.move(">")):(c=n.enter("destinationRaw"),f+=d.move(n.safe(e.url,{before:f,after:e.title?" ":")",...d.current()}))),c(),e.title&&(c=n.enter(`title${a}`),f+=d.move(" "+i),f+=d.move(n.safe(e.title,{before:f,after:i,...d.current()})),f+=d.move(i),c()),f+=d.move(")"),l(),f}function CG(){return"!"}wR.peek=kG;function wR(e,t,n,r){const i=e.referenceType,a=n.enter("imageReference");let l=n.enter("label");const c=n.createTracker(r);let d=c.move("![");const f=n.safe(e.alt,{before:d,after:"]",...c.current()});d+=c.move(f+"]["),l();const g=n.stack;n.stack=[],l=n.enter("reference");const h=n.safe(n.associationId(e),{before:d,after:"]",...c.current()});return l(),n.stack=g,a(),i==="full"||!f||f!==h?d+=c.move(h+"]"):i==="shortcut"?d=d.slice(0,-1):d+=c.move("]"),d}function kG(){return"!"}NR.peek=wG;function NR(e,t,n){let r=e.value||"",i="`",a=-1;for(;new RegExp("(^|[^`])"+i+"([^`]|$)").test(r);)i+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=" "+r+" ");++a<n.unsafe.length;){const l=n.unsafe[a],c=n.compilePattern(l);let d;if(l.atBreak)for(;d=c.exec(r);){let f=d.index;r.charCodeAt(f)===10&&r.charCodeAt(f-1)===13&&f--,r=r.slice(0,f)+" "+r.slice(d.index+1)}}return i+r+i}function wG(){return"`"}function AR(e,t){const n=Qx(e);return!!(!t.options.resourceLink&&e.url&&!e.title&&e.children&&e.children.length===1&&e.children[0].type==="text"&&(n===e.url||"mailto:"+n===e.url)&&/^[a-z][a-z+.-]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}_R.peek=NG;function _R(e,t,n,r){const i=Kx(n),a=i==='"'?"Quote":"Apostrophe",l=n.createTracker(r);let c,d;if(AR(e,n)){const g=n.stack;n.stack=[],c=n.enter("autolink");let h=l.move("<");return h+=l.move(n.containerPhrasing(e,{before:h,after:">",...l.current()})),h+=l.move(">"),c(),n.stack=g,h}c=n.enter("link"),d=n.enter("label");let f=l.move("[");return f+=l.move(n.containerPhrasing(e,{before:f,after:"](",...l.current()})),f+=l.move("]("),d(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(d=n.enter("destinationLiteral"),f+=l.move("<"),f+=l.move(n.safe(e.url,{before:f,after:">",...l.current()})),f+=l.move(">")):(d=n.enter("destinationRaw"),f+=l.move(n.safe(e.url,{before:f,after:e.title?" ":")",...l.current()}))),d(),e.title&&(d=n.enter(`title${a}`),f+=l.move(" "+i),f+=l.move(n.safe(e.title,{before:f,after:i,...l.current()})),f+=l.move(i),d()),f+=l.move(")"),c(),f}function NG(e,t,n){return AR(e,n)?"<":"["}RR.peek=AG;function RR(e,t,n,r){const i=e.referenceType,a=n.enter("linkReference");let l=n.enter("label");const c=n.createTracker(r);let d=c.move("[");const f=n.containerPhrasing(e,{before:d,after:"]",...c.current()});d+=c.move(f+"]["),l();const g=n.stack;n.stack=[],l=n.enter("reference");const h=n.safe(n.associationId(e),{before:d,after:"]",...c.current()});return l(),n.stack=g,a(),i==="full"||!f||f!==h?d+=c.move(h+"]"):i==="shortcut"?d=d.slice(0,-1):d+=c.move("]"),d}function AG(){return"["}function Wx(e){const t=e.options.bullet||"*";if(t!=="*"&&t!=="+"&&t!=="-")throw new Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function _G(e){const t=Wx(e),n=e.options.bulletOther;if(!n)return t==="*"?"-":"*";if(n!=="*"&&n!=="+"&&n!=="-")throw new Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw new Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}function RG(e){const t=e.options.bulletOrdered||".";if(t!=="."&&t!==")")throw new Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function OR(e){const t=e.options.rule||"*";if(t!=="*"&&t!=="-"&&t!=="_")throw new Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function OG(e,t,n,r){const i=n.enter("list"),a=n.bulletCurrent;let l=e.ordered?RG(n):Wx(n);const c=e.ordered?l==="."?")":".":_G(n);let d=t&&n.bulletLastUsed?l===n.bulletLastUsed:!1;if(!e.ordered){const g=e.children?e.children[0]:void 0;if((l==="*"||l==="-")&&g&&(!g.children||!g.children[0])&&n.stack[n.stack.length-1]==="list"&&n.stack[n.stack.length-2]==="listItem"&&n.stack[n.stack.length-3]==="list"&&n.stack[n.stack.length-4]==="listItem"&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(d=!0),OR(n)===l&&g){let h=-1;for(;++h<e.children.length;){const b=e.children[h];if(b&&b.type==="listItem"&&b.children&&b.children[0]&&b.children[0].type==="thematicBreak"){d=!0;break}}}}d&&(l=c),n.bulletCurrent=l;const f=n.containerFlow(e,r);return n.bulletLastUsed=l,n.bulletCurrent=a,i(),f}function IG(e){const t=e.options.listItemIndent||"one";if(t!=="tab"&&t!=="one"&&t!=="mixed")throw new Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}function MG(e,t,n,r){const i=IG(n);let a=n.bulletCurrent||Wx(n);t&&t.type==="list"&&t.ordered&&(a=(typeof t.start=="number"&&t.start>-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+a);let l=a.length+1;(i==="tab"||i==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(l=Math.ceil(l/4)*4);const c=n.createTracker(r);c.move(a+" ".repeat(l-a.length)),c.shift(l);const d=n.enter("listItem"),f=n.indentLines(n.containerFlow(e,c.current()),g);return d(),f;function g(h,b,x){return b?(x?"":" ".repeat(l))+h:(x?a:a+" ".repeat(l-a.length))+h}}function LG(e,t,n,r){const i=n.enter("paragraph"),a=n.enter("phrasing"),l=n.containerPhrasing(e,r);return a(),i(),l}const DG=Dp(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function PG(e,t,n,r){return(e.children.some(function(l){return DG(l)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}function jG(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}IR.peek=BG;function IR(e,t,n,r){const i=jG(n),a=n.enter("strong"),l=n.createTracker(r),c=l.move(i+i);let d=l.move(n.containerPhrasing(e,{after:i,before:c,...l.current()}));const f=d.charCodeAt(0),g=Wh(r.before.charCodeAt(r.before.length-1),f,i);g.inside&&(d=Xc(f)+d.slice(1));const h=d.charCodeAt(d.length-1),b=Wh(r.after.charCodeAt(0),h,i);b.inside&&(d=d.slice(0,-1)+Xc(h));const x=l.move(i+i);return a(),n.attentionEncodeSurroundingInfo={after:b.outside,before:g.outside},c+d+x}function BG(e,t,n){return n.options.strong||"*"}function HG(e,t,n,r){return n.safe(e.value,r)}function UG(e){const t=e.options.ruleRepetition||3;if(t<3)throw new Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function zG(e,t,n){const r=(OR(n)+(n.options.ruleSpaces?" ":"")).repeat(UG(n));return n.options.ruleSpaces?r.slice(0,-1):r}const MR={blockquote:lG,break:nk,code:pG,definition:gG,emphasis:TR,hardBreak:nk,heading:TG,html:CR,image:kR,imageReference:wR,inlineCode:NR,link:_R,linkReference:RR,list:OG,listItem:MG,paragraph:LG,root:PG,strong:IR,text:HG,thematicBreak:zG},sk=document.createElement("i");function Zx(e){const t="&"+e+";";sk.innerHTML=t;const n=sk.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function LR(e,t){const n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}const FG=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function $G(e){return e.replace(FG,VG)}function VG(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const i=n.charCodeAt(1),a=i===120||i===88;return LR(n.slice(a?2:1),a?16:10)}return Zx(n)||e}function qG(){return{enter:{table:YG,tableData:ik,tableHeader:ik,tableRow:XG},exit:{codeText:KG,table:GG,tableData:J0,tableHeader:J0,tableRow:J0}}}function YG(e){const t=e._align;this.enter({type:"table",align:t.map(function(n){return n==="none"?null:n}),children:[]},e),this.data.inTable=!0}function GG(e){this.exit(e),this.data.inTable=void 0}function XG(e){this.enter({type:"tableRow",children:[]},e)}function J0(e){this.exit(e)}function ik(e){this.enter({type:"tableCell",children:[]},e)}function KG(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,QG));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function QG(e,t){return t==="|"?t:e}function WG(e){const t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,i=t.stringLength,a=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
554
+ `,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:b,table:l,tableCell:d,tableRow:c}};function l(x,v,w,k){return f(g(x,w,k),x.align)}function c(x,v,w,k){const C=h(x,w,k),N=f([C]);return N.slice(0,N.indexOf(`
555
+ `))}function d(x,v,w,k){const C=w.enter("tableCell"),N=w.enter("phrasing"),A=w.containerPhrasing(x,{...k,before:a,after:a});return N(),C(),A}function f(x,v){return aG(x,{align:v,alignDelimiters:r,padding:n,stringLength:i})}function g(x,v,w){const k=x.children;let C=-1;const N=[],A=v.enter("table");for(;++C<k.length;)N[C]=h(k[C],v,w);return A(),N}function h(x,v,w){const k=x.children;let C=-1;const N=[],A=v.enter("tableRow");for(;++C<k.length;)N[C]=d(k[C],x,v,w);return A(),N}function b(x,v,w){let k=MR.inlineCode(x,v,w);return w.stack.includes("tableCell")&&(k=k.replace(/\|/g,"\\$&")),k}}function ZG(){return{exit:{taskListCheckValueChecked:ak,taskListCheckValueUnchecked:ak,paragraph:eX}}}function JG(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:tX}}}function ak(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function eX(e){const t=this.stack[this.stack.length-2];if(t&&t.type==="listItem"&&typeof t.checked=="boolean"){const n=this.stack[this.stack.length-1];n.type;const r=n.children[0];if(r&&r.type==="text"){const i=t.children;let a=-1,l;for(;++a<i.length;){const c=i[a];if(c.type==="paragraph"){l=c;break}}l===n&&(r.value=r.value.slice(1),r.value.length===0?n.children.shift():n.position&&r.position&&typeof r.position.start.offset=="number"&&(r.position.start.column++,r.position.start.offset++,n.position.start=Object.assign({},r.position.start)))}}this.exit(e)}function tX(e,t,n,r){const i=e.children[0],a=typeof e.checked=="boolean"&&i&&i.type==="paragraph",l="["+(e.checked?"x":" ")+"] ",c=n.createTracker(r);a&&c.move(l);let d=MR.listItem(e,t,n,{...r,...c.current()});return a&&(d=d.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,f)),d;function f(g){return g+l}}function nX(){return[_Y(),QY(),eG(),qG(),ZG()]}function rX(e){return{extensions:[RY(),WY(e),tG(),WG(e),JG()]}}function $r(e,t,n,r){const i=e.length;let a=0,l;if(t<0?t=-t>i?0:i+t:t=t>i?i:t,n=n>0?n:0,r.length<1e4)l=Array.from(r),l.unshift(t,n),e.splice(...l);else for(n&&e.splice(t,n);a<r.length;)l=r.slice(a,a+1e4),l.unshift(t,0),e.splice(...l),a+=1e4,t+=1e4}function ss(e,t){return e.length>0?($r(e,e.length,0,t),e):t}const ok={}.hasOwnProperty;function DR(e){const t={};let n=-1;for(;++n<e.length;)sX(t,e[n]);return t}function sX(e,t){let n;for(n in t){const i=(ok.call(e,n)?e[n]:void 0)||(e[n]={}),a=t[n];let l;if(a)for(l in a){ok.call(i,l)||(i[l]=[]);const c=a[l];iX(i[l],Array.isArray(c)?c:c?[c]:[])}}}function iX(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);$r(e,0,0,r)}const aX={tokenize:fX,partial:!0},PR={tokenize:hX,partial:!0},jR={tokenize:pX,partial:!0},BR={tokenize:mX,partial:!0},oX={tokenize:gX,partial:!0},HR={name:"wwwAutolink",tokenize:cX,previous:zR},UR={name:"protocolAutolink",tokenize:dX,previous:FR},xi={name:"emailAutolink",tokenize:uX,previous:$R},Bs={};function lX(){return{text:Bs}}let za=48;for(;za<123;)Bs[za]=xi,za++,za===58?za=65:za===91&&(za=97);Bs[43]=xi;Bs[45]=xi;Bs[46]=xi;Bs[95]=xi;Bs[72]=[xi,UR];Bs[104]=[xi,UR];Bs[87]=[xi,HR];Bs[119]=[xi,HR];function uX(e,t,n){const r=this;let i,a;return l;function l(h){return!s1(h)||!$R.call(r,r.previous)||Jx(r.events)?n(h):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),c(h))}function c(h){return s1(h)?(e.consume(h),c):h===64?(e.consume(h),d):n(h)}function d(h){return h===46?e.check(oX,g,f)(h):h===45||h===95||ar(h)?(a=!0,e.consume(h),d):g(h)}function f(h){return e.consume(h),i=!0,d}function g(h){return a&&i&&fr(r.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(h)):n(h)}}function cX(e,t,n){const r=this;return i;function i(l){return l!==87&&l!==119||!zR.call(r,r.previous)||Jx(r.events)?n(l):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(aX,e.attempt(PR,e.attempt(jR,a),n),n)(l))}function a(l){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(l)}}function dX(e,t,n){const r=this;let i="",a=!1;return l;function l(h){return(h===72||h===104)&&FR.call(r,r.previous)&&!Jx(r.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),i+=String.fromCodePoint(h),e.consume(h),c):n(h)}function c(h){if(fr(h)&&i.length<5)return i+=String.fromCodePoint(h),e.consume(h),c;if(h===58){const b=i.toLowerCase();if(b==="http"||b==="https")return e.consume(h),d}return n(h)}function d(h){return h===47?(e.consume(h),a?f:(a=!0,d)):n(h)}function f(h){return h===null||Qh(h)||rn(h)||mo(h)||Vp(h)?n(h):e.attempt(PR,e.attempt(jR,g),n)(h)}function g(h){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(h)}}function fX(e,t,n){let r=0;return i;function i(l){return(l===87||l===119)&&r<3?(r++,e.consume(l),i):l===46&&r===3?(e.consume(l),a):n(l)}function a(l){return l===null?n(l):t(l)}}function hX(e,t,n){let r,i,a;return l;function l(f){return f===46||f===95?e.check(BR,d,c)(f):f===null||rn(f)||mo(f)||f!==45&&Vp(f)?d(f):(a=!0,e.consume(f),l)}function c(f){return f===95?r=!0:(i=r,r=void 0),e.consume(f),l}function d(f){return i||r||!a?n(f):t(f)}}function pX(e,t){let n=0,r=0;return i;function i(l){return l===40?(n++,e.consume(l),i):l===41&&r<n?a(l):l===33||l===34||l===38||l===39||l===41||l===42||l===44||l===46||l===58||l===59||l===60||l===63||l===93||l===95||l===126?e.check(BR,t,a)(l):l===null||rn(l)||mo(l)?t(l):(e.consume(l),i)}function a(l){return l===41&&r++,e.consume(l),i}}function mX(e,t,n){return r;function r(c){return c===33||c===34||c===39||c===41||c===42||c===44||c===46||c===58||c===59||c===63||c===95||c===126?(e.consume(c),r):c===38?(e.consume(c),a):c===93?(e.consume(c),i):c===60||c===null||rn(c)||mo(c)?t(c):n(c)}function i(c){return c===null||c===40||c===91||rn(c)||mo(c)?t(c):r(c)}function a(c){return fr(c)?l(c):n(c)}function l(c){return c===59?(e.consume(c),r):fr(c)?(e.consume(c),l):n(c)}}function gX(e,t,n){return r;function r(a){return e.consume(a),i}function i(a){return ar(a)?n(a):t(a)}}function zR(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||rn(e)}function FR(e){return!fr(e)}function $R(e){return!(e===47||s1(e))}function s1(e){return e===43||e===45||e===46||e===95||ar(e)}function Jx(e){let t=e.length,n=!1;for(;t--;){const r=e[t][1];if((r.type==="labelLink"||r.type==="labelImage")&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}function nu(e){const t=[];let n=-1,r=0,i=0;for(;++n<e.length;){const a=e.charCodeAt(n);let l="";if(a===37&&ar(e.charCodeAt(n+1))&&ar(e.charCodeAt(n+2)))i=2;else if(a<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(a))||(l=String.fromCharCode(a));else if(a>55295&&a<57344){const c=e.charCodeAt(n+1);a<56320&&c>56319&&c<57344?(l=String.fromCharCode(a,c),i=1):l="�"}else l=String.fromCharCode(a);l&&(t.push(e.slice(r,n),encodeURIComponent(l)),r=n+i+1,l=""),i&&(n+=i,i=0)}return t.join("")+e.slice(r)}function qp(e,t,n){const r=[];let i=-1;for(;++i<e.length;){const a=e[i].resolveAll;a&&!r.includes(a)&&(t=a(t,n),r.push(a))}return t}const i1={name:"attention",resolveAll:bX,tokenize:xX};function bX(e,t){let n=-1,r,i,a,l,c,d,f,g;for(;++n<e.length;)if(e[n][0]==="enter"&&e[n][1].type==="attentionSequence"&&e[n][1]._close){for(r=n;r--;)if(e[r][0]==="exit"&&e[r][1].type==="attentionSequence"&&e[r][1]._open&&t.sliceSerialize(e[r][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[r][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;d=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const h={...e[r][1].end},b={...e[n][1].start};lk(h,-d),lk(b,d),l={type:d>1?"strongSequence":"emphasisSequence",start:h,end:{...e[r][1].end}},c={type:d>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:b},a={type:d>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[n][1].start}},i={type:d>1?"strong":"emphasis",start:{...l.start},end:{...c.end}},e[r][1].end={...l.start},e[n][1].start={...c.end},f=[],e[r][1].end.offset-e[r][1].start.offset&&(f=ss(f,[["enter",e[r][1],t],["exit",e[r][1],t]])),f=ss(f,[["enter",i,t],["enter",l,t],["exit",l,t],["enter",a,t]]),f=ss(f,qp(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),f=ss(f,[["exit",a,t],["enter",c,t],["exit",c,t],["exit",i,t]]),e[n][1].end.offset-e[n][1].start.offset?(g=2,f=ss(f,[["enter",e[n][1],t],["exit",e[n][1],t]])):g=0,$r(e,r-1,n-r+3,f),n=r+f.length-g-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function xX(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=Ul(r);let a;return l;function l(d){return a=d,e.enter("attentionSequence"),c(d)}function c(d){if(d===a)return e.consume(d),c;const f=e.exit("attentionSequence"),g=Ul(d),h=!g||g===2&&i||n.includes(d),b=!i||i===2&&g||n.includes(r);return f._open=!!(a===42?h:h&&(i||!b)),f._close=!!(a===42?b:b&&(g||!h)),t(d)}}function lk(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const yX={name:"autolink",tokenize:EX};function EX(e,t,n){let r=0;return i;function i(x){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(x),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),a}function a(x){return fr(x)?(e.consume(x),l):x===64?n(x):f(x)}function l(x){return x===43||x===45||x===46||ar(x)?(r=1,c(x)):f(x)}function c(x){return x===58?(e.consume(x),r=0,d):(x===43||x===45||x===46||ar(x))&&r++<32?(e.consume(x),c):(r=0,f(x))}function d(x){return x===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(x),e.exit("autolinkMarker"),e.exit("autolink"),t):x===null||x===32||x===60||Qh(x)?n(x):(e.consume(x),d)}function f(x){return x===64?(e.consume(x),g):vY(x)?(e.consume(x),f):n(x)}function g(x){return ar(x)?h(x):n(x)}function h(x){return x===46?(e.consume(x),r=0,g):x===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(x),e.exit("autolinkMarker"),e.exit("autolink"),t):b(x)}function b(x){if((x===45||ar(x))&&r++<63){const v=x===45?b:h;return e.consume(x),v}return n(x)}}function jt(e,t,n,r){const i=r?r-1:Number.POSITIVE_INFINITY;let a=0;return l;function l(d){return _t(d)?(e.enter(n),c(d)):t(d)}function c(d){return _t(d)&&a++<i?(e.consume(d),c):(e.exit(n),t(d))}}const ud={partial:!0,tokenize:vX};function vX(e,t,n){return r;function r(a){return _t(a)?jt(e,i,"linePrefix")(a):i(a)}function i(a){return a===null||st(a)?t(a):n(a)}}const VR={continuation:{tokenize:SX},exit:CX,name:"blockQuote",tokenize:TX};function TX(e,t,n){const r=this;return i;function i(l){if(l===62){const c=r.containerState;return c.open||(e.enter("blockQuote",{_container:!0}),c.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(l),e.exit("blockQuoteMarker"),a}return n(l)}function a(l){return _t(l)?(e.enter("blockQuotePrefixWhitespace"),e.consume(l),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(l))}}function SX(e,t,n){const r=this;return i;function i(l){return _t(l)?jt(e,a,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(l):a(l)}function a(l){return e.attempt(VR,t,n)(l)}}function CX(e){e.exit("blockQuote")}const qR={name:"characterEscape",tokenize:kX};function kX(e,t,n){return r;function r(a){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(a),e.exit("escapeMarker"),i}function i(a){return SY(a)?(e.enter("characterEscapeValue"),e.consume(a),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(a)}}const YR={name:"characterReference",tokenize:wX};function wX(e,t,n){const r=this;let i=0,a,l;return c;function c(h){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(h),e.exit("characterReferenceMarker"),d}function d(h){return h===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(h),e.exit("characterReferenceMarkerNumeric"),f):(e.enter("characterReferenceValue"),a=31,l=ar,g(h))}function f(h){return h===88||h===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(h),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),a=6,l=TY,g):(e.enter("characterReferenceValue"),a=7,l=r1,g(h))}function g(h){if(h===59&&i){const b=e.exit("characterReferenceValue");return l===ar&&!Zx(r.sliceSerialize(b))?n(h):(e.enter("characterReferenceMarker"),e.consume(h),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return l(h)&&i++<a?(e.consume(h),g):n(h)}}const uk={partial:!0,tokenize:AX},ck={concrete:!0,name:"codeFenced",tokenize:NX};function NX(e,t,n){const r=this,i={partial:!0,tokenize:M};let a=0,l=0,c;return d;function d(_){return f(_)}function f(_){const D=r.events[r.events.length-1];return a=D&&D[1].type==="linePrefix"?D[2].sliceSerialize(D[1],!0).length:0,c=_,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),g(_)}function g(_){return _===c?(l++,e.consume(_),g):l<3?n(_):(e.exit("codeFencedFenceSequence"),_t(_)?jt(e,h,"whitespace")(_):h(_))}function h(_){return _===null||st(_)?(e.exit("codeFencedFence"),r.interrupt?t(_):e.check(uk,w,R)(_)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),b(_))}function b(_){return _===null||st(_)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),h(_)):_t(_)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),jt(e,x,"whitespace")(_)):_===96&&_===c?n(_):(e.consume(_),b)}function x(_){return _===null||st(_)?h(_):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),v(_))}function v(_){return _===null||st(_)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),h(_)):_===96&&_===c?n(_):(e.consume(_),v)}function w(_){return e.attempt(i,R,k)(_)}function k(_){return e.enter("lineEnding"),e.consume(_),e.exit("lineEnding"),C}function C(_){return a>0&&_t(_)?jt(e,N,"linePrefix",a+1)(_):N(_)}function N(_){return _===null||st(_)?e.check(uk,w,R)(_):(e.enter("codeFlowValue"),A(_))}function A(_){return _===null||st(_)?(e.exit("codeFlowValue"),N(_)):(e.consume(_),A)}function R(_){return e.exit("codeFenced"),t(_)}function M(_,D,I){let U=0;return j;function j(V){return _.enter("lineEnding"),_.consume(V),_.exit("lineEnding"),X}function X(V){return _.enter("codeFencedFence"),_t(V)?jt(_,K,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(V):K(V)}function K(V){return V===c?(_.enter("codeFencedFenceSequence"),F(V)):I(V)}function F(V){return V===c?(U++,_.consume(V),F):U>=l?(_.exit("codeFencedFenceSequence"),_t(V)?jt(_,W,"whitespace")(V):W(V)):I(V)}function W(V){return V===null||st(V)?(_.exit("codeFencedFence"),D(V)):I(V)}}}function AX(e,t,n){const r=this;return i;function i(l){return l===null?n(l):(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),a)}function a(l){return r.parser.lazy[r.now().line]?n(l):t(l)}}const eb={name:"codeIndented",tokenize:RX},_X={partial:!0,tokenize:OX};function RX(e,t,n){const r=this;return i;function i(f){return e.enter("codeIndented"),jt(e,a,"linePrefix",5)(f)}function a(f){const g=r.events[r.events.length-1];return g&&g[1].type==="linePrefix"&&g[2].sliceSerialize(g[1],!0).length>=4?l(f):n(f)}function l(f){return f===null?d(f):st(f)?e.attempt(_X,l,d)(f):(e.enter("codeFlowValue"),c(f))}function c(f){return f===null||st(f)?(e.exit("codeFlowValue"),l(f)):(e.consume(f),c)}function d(f){return e.exit("codeIndented"),t(f)}}function OX(e,t,n){const r=this;return i;function i(l){return r.parser.lazy[r.now().line]?n(l):st(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),i):jt(e,a,"linePrefix",5)(l)}function a(l){const c=r.events[r.events.length-1];return c&&c[1].type==="linePrefix"&&c[2].sliceSerialize(c[1],!0).length>=4?t(l):st(l)?i(l):n(l)}}const IX={name:"codeText",previous:LX,resolve:MX,tokenize:DX};function MX(e){let t=e.length-4,n=3,r,i;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(r=n;++r<t;)if(e[r][1].type==="codeTextData"){e[n][1].type="codeTextPadding",e[t][1].type="codeTextPadding",n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)i===void 0?r!==t&&e[r][1].type!=="lineEnding"&&(i=r):(r===t||e[r][1].type==="lineEnding")&&(e[i][1].type="codeTextData",r!==i+2&&(e[i][1].end=e[r-1][1].end,e.splice(i+2,r-i-2),t-=r-i-2,r=i+2),i=void 0);return e}function LX(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function DX(e,t,n){let r=0,i,a;return l;function l(h){return e.enter("codeText"),e.enter("codeTextSequence"),c(h)}function c(h){return h===96?(e.consume(h),r++,c):(e.exit("codeTextSequence"),d(h))}function d(h){return h===null?n(h):h===32?(e.enter("space"),e.consume(h),e.exit("space"),d):h===96?(a=e.enter("codeTextSequence"),i=0,g(h)):st(h)?(e.enter("lineEnding"),e.consume(h),e.exit("lineEnding"),d):(e.enter("codeTextData"),f(h))}function f(h){return h===null||h===32||h===96||st(h)?(e.exit("codeTextData"),d(h)):(e.consume(h),f)}function g(h){return h===96?(e.consume(h),i++,g):i===r?(e.exit("codeTextSequence"),e.exit("codeText"),t(h)):(a.type="codeTextData",f(h))}}class PX{constructor(t){this.left=t?[...t]:[],this.right=[]}get(t){if(t<0||t>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return t<this.left.length?this.left[t]:this.right[this.right.length-t+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(t,n){const r=n??Number.POSITIVE_INFINITY;return r<this.left.length?this.left.slice(t,r):t>this.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(t,n,r){const i=n||0;this.setCursor(Math.trunc(t));const a=this.right.splice(this.right.length-i,Number.POSITIVE_INFINITY);return r&&ac(this.left,r),a.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),ac(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),ac(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t<this.left.length){const n=this.left.splice(t,Number.POSITIVE_INFINITY);ac(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);ac(this.left,n.reverse())}}}function ac(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function GR(e){const t={};let n=-1,r,i,a,l,c,d,f;const g=new PX(e);for(;++n<g.length;){for(;n in t;)n=t[n];if(r=g.get(n),n&&r[1].type==="chunkFlow"&&g.get(n-1)[1].type==="listItemPrefix"&&(d=r[1]._tokenizer.events,a=0,a<d.length&&d[a][1].type==="lineEndingBlank"&&(a+=2),a<d.length&&d[a][1].type==="content"))for(;++a<d.length&&d[a][1].type!=="content";)d[a][1].type==="chunkText"&&(d[a][1]._isInFirstContentOfListItem=!0,a++);if(r[0]==="enter")r[1].contentType&&(Object.assign(t,jX(g,n)),n=t[n],f=!0);else if(r[1]._container){for(a=n,i=void 0;a--;)if(l=g.get(a),l[1].type==="lineEnding"||l[1].type==="lineEndingBlank")l[0]==="enter"&&(i&&(g.get(i)[1].type="lineEndingBlank"),l[1].type="lineEnding",i=a);else if(!(l[1].type==="linePrefix"||l[1].type==="listItemIndent"))break;i&&(r[1].end={...g.get(i)[1].start},c=g.slice(i,n),c.unshift(r),g.splice(i,n-i+1,c))}}return $r(e,0,Number.POSITIVE_INFINITY,g.slice(0)),!f}function jX(e,t){const n=e.get(t)[1],r=e.get(t)[2];let i=t-1;const a=[];let l=n._tokenizer;l||(l=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(l._contentTypeTextTrailing=!0));const c=l.events,d=[],f={};let g,h,b=-1,x=n,v=0,w=0;const k=[w];for(;x;){for(;e.get(++i)[1]!==x;);a.push(i),x._tokenizer||(g=r.sliceStream(x),x.next||g.push(null),h&&l.defineSkip(x.start),x._isInFirstContentOfListItem&&(l._gfmTasklistFirstContentOfListItem=!0),l.write(g),x._isInFirstContentOfListItem&&(l._gfmTasklistFirstContentOfListItem=void 0)),h=x,x=x.next}for(x=n;++b<c.length;)c[b][0]==="exit"&&c[b-1][0]==="enter"&&c[b][1].type===c[b-1][1].type&&c[b][1].start.line!==c[b][1].end.line&&(w=b+1,k.push(w),x._tokenizer=void 0,x.previous=void 0,x=x.next);for(l.events=[],x?(x._tokenizer=void 0,x.previous=void 0):k.pop(),b=k.length;b--;){const C=c.slice(k[b],k[b+1]),N=a.pop();d.push([N,N+C.length-1]),e.splice(N,2,C)}for(d.reverse(),b=-1;++b<d.length;)f[v+d[b][0]]=v+d[b][1],v+=d[b][1]-d[b][0]-1;return f}const BX={resolve:UX,tokenize:zX},HX={partial:!0,tokenize:FX};function UX(e){return GR(e),e}function zX(e,t){let n;return r;function r(c){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),i(c)}function i(c){return c===null?a(c):st(c)?e.check(HX,l,a)(c):(e.consume(c),i)}function a(c){return e.exit("chunkContent"),e.exit("content"),t(c)}function l(c){return e.consume(c),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,i}}function FX(e,t,n){const r=this;return i;function i(l){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),jt(e,a,"linePrefix")}function a(l){if(l===null||st(l))return n(l);const c=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&c&&c[1].type==="linePrefix"&&c[2].sliceSerialize(c[1],!0).length>=4?t(l):e.interrupt(r.parser.constructs.flow,n,t)(l)}}function XR(e,t,n,r,i,a,l,c,d){const f=d||Number.POSITIVE_INFINITY;let g=0;return h;function h(C){return C===60?(e.enter(r),e.enter(i),e.enter(a),e.consume(C),e.exit(a),b):C===null||C===32||C===41||Qh(C)?n(C):(e.enter(r),e.enter(l),e.enter(c),e.enter("chunkString",{contentType:"string"}),w(C))}function b(C){return C===62?(e.enter(a),e.consume(C),e.exit(a),e.exit(i),e.exit(r),t):(e.enter(c),e.enter("chunkString",{contentType:"string"}),x(C))}function x(C){return C===62?(e.exit("chunkString"),e.exit(c),b(C)):C===null||C===60||st(C)?n(C):(e.consume(C),C===92?v:x)}function v(C){return C===60||C===62||C===92?(e.consume(C),x):x(C)}function w(C){return!g&&(C===null||C===41||rn(C))?(e.exit("chunkString"),e.exit(c),e.exit(l),e.exit(r),t(C)):g<f&&C===40?(e.consume(C),g++,w):C===41?(e.consume(C),g--,w):C===null||C===32||C===40||Qh(C)?n(C):(e.consume(C),C===92?k:w)}function k(C){return C===40||C===41||C===92?(e.consume(C),w):w(C)}}function KR(e,t,n,r,i,a){const l=this;let c=0,d;return f;function f(x){return e.enter(r),e.enter(i),e.consume(x),e.exit(i),e.enter(a),g}function g(x){return c>999||x===null||x===91||x===93&&!d||x===94&&!c&&"_hiddenFootnoteSupport"in l.parser.constructs?n(x):x===93?(e.exit(a),e.enter(i),e.consume(x),e.exit(i),e.exit(r),t):st(x)?(e.enter("lineEnding"),e.consume(x),e.exit("lineEnding"),g):(e.enter("chunkString",{contentType:"string"}),h(x))}function h(x){return x===null||x===91||x===93||st(x)||c++>999?(e.exit("chunkString"),g(x)):(e.consume(x),d||(d=!_t(x)),x===92?b:h)}function b(x){return x===91||x===92||x===93?(e.consume(x),c++,h):h(x)}}function QR(e,t,n,r,i,a){let l;return c;function c(b){return b===34||b===39||b===40?(e.enter(r),e.enter(i),e.consume(b),e.exit(i),l=b===40?41:b,d):n(b)}function d(b){return b===l?(e.enter(i),e.consume(b),e.exit(i),e.exit(r),t):(e.enter(a),f(b))}function f(b){return b===l?(e.exit(a),d(l)):b===null?n(b):st(b)?(e.enter("lineEnding"),e.consume(b),e.exit("lineEnding"),jt(e,f,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),g(b))}function g(b){return b===l||b===null||st(b)?(e.exit("chunkString"),f(b)):(e.consume(b),b===92?h:g)}function h(b){return b===l||b===92?(e.consume(b),g):g(b)}}function Oc(e,t){let n;return r;function r(i){return st(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n=!0,r):_t(i)?jt(e,r,n?"linePrefix":"lineSuffix")(i):t(i)}}const $X={name:"definition",tokenize:qX},VX={partial:!0,tokenize:YX};function qX(e,t,n){const r=this;let i;return a;function a(x){return e.enter("definition"),l(x)}function l(x){return KR.call(r,e,c,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(x)}function c(x){return i=hs(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),x===58?(e.enter("definitionMarker"),e.consume(x),e.exit("definitionMarker"),d):n(x)}function d(x){return rn(x)?Oc(e,f)(x):f(x)}function f(x){return XR(e,g,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(x)}function g(x){return e.attempt(VX,h,h)(x)}function h(x){return _t(x)?jt(e,b,"whitespace")(x):b(x)}function b(x){return x===null||st(x)?(e.exit("definition"),r.parser.defined.push(i),t(x)):n(x)}}function YX(e,t,n){return r;function r(c){return rn(c)?Oc(e,i)(c):n(c)}function i(c){return QR(e,a,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(c)}function a(c){return _t(c)?jt(e,l,"whitespace")(c):l(c)}function l(c){return c===null||st(c)?t(c):n(c)}}const GX={name:"hardBreakEscape",tokenize:XX};function XX(e,t,n){return r;function r(a){return e.enter("hardBreakEscape"),e.consume(a),i}function i(a){return st(a)?(e.exit("hardBreakEscape"),t(a)):n(a)}}const KX={name:"headingAtx",resolve:QX,tokenize:WX};function QX(e,t){let n=e.length-2,r=3,i,a;return e[r][1].type==="whitespace"&&(r+=2),n-2>r&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&e[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r&&(i={type:"atxHeadingText",start:e[r][1].start,end:e[n][1].end},a={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},$r(e,r,n-r+1,[["enter",i,t],["enter",a,t],["exit",a,t],["exit",i,t]])),e}function WX(e,t,n){let r=0;return i;function i(g){return e.enter("atxHeading"),a(g)}function a(g){return e.enter("atxHeadingSequence"),l(g)}function l(g){return g===35&&r++<6?(e.consume(g),l):g===null||rn(g)?(e.exit("atxHeadingSequence"),c(g)):n(g)}function c(g){return g===35?(e.enter("atxHeadingSequence"),d(g)):g===null||st(g)?(e.exit("atxHeading"),t(g)):_t(g)?jt(e,c,"whitespace")(g):(e.enter("atxHeadingText"),f(g))}function d(g){return g===35?(e.consume(g),d):(e.exit("atxHeadingSequence"),c(g))}function f(g){return g===null||g===35||rn(g)?(e.exit("atxHeadingText"),c(g)):(e.consume(g),f)}}const ZX=["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"],dk=["pre","script","style","textarea"],JX={concrete:!0,name:"htmlFlow",resolveTo:nK,tokenize:rK},eK={partial:!0,tokenize:iK},tK={partial:!0,tokenize:sK};function nK(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function rK(e,t,n){const r=this;let i,a,l,c,d;return f;function f(P){return g(P)}function g(P){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(P),h}function h(P){return P===33?(e.consume(P),b):P===47?(e.consume(P),a=!0,w):P===63?(e.consume(P),i=3,r.interrupt?t:L):fr(P)?(e.consume(P),l=String.fromCharCode(P),k):n(P)}function b(P){return P===45?(e.consume(P),i=2,x):P===91?(e.consume(P),i=5,c=0,v):fr(P)?(e.consume(P),i=4,r.interrupt?t:L):n(P)}function x(P){return P===45?(e.consume(P),r.interrupt?t:L):n(P)}function v(P){const ae="CDATA[";return P===ae.charCodeAt(c++)?(e.consume(P),c===ae.length?r.interrupt?t:K:v):n(P)}function w(P){return fr(P)?(e.consume(P),l=String.fromCharCode(P),k):n(P)}function k(P){if(P===null||P===47||P===62||rn(P)){const ae=P===47,ie=l.toLowerCase();return!ae&&!a&&dk.includes(ie)?(i=1,r.interrupt?t(P):K(P)):ZX.includes(l.toLowerCase())?(i=6,ae?(e.consume(P),C):r.interrupt?t(P):K(P)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(P):a?N(P):A(P))}return P===45||ar(P)?(e.consume(P),l+=String.fromCharCode(P),k):n(P)}function C(P){return P===62?(e.consume(P),r.interrupt?t:K):n(P)}function N(P){return _t(P)?(e.consume(P),N):j(P)}function A(P){return P===47?(e.consume(P),j):P===58||P===95||fr(P)?(e.consume(P),R):_t(P)?(e.consume(P),A):j(P)}function R(P){return P===45||P===46||P===58||P===95||ar(P)?(e.consume(P),R):M(P)}function M(P){return P===61?(e.consume(P),_):_t(P)?(e.consume(P),M):A(P)}function _(P){return P===null||P===60||P===61||P===62||P===96?n(P):P===34||P===39?(e.consume(P),d=P,D):_t(P)?(e.consume(P),_):I(P)}function D(P){return P===d?(e.consume(P),d=null,U):P===null||st(P)?n(P):(e.consume(P),D)}function I(P){return P===null||P===34||P===39||P===47||P===60||P===61||P===62||P===96||rn(P)?M(P):(e.consume(P),I)}function U(P){return P===47||P===62||_t(P)?A(P):n(P)}function j(P){return P===62?(e.consume(P),X):n(P)}function X(P){return P===null||st(P)?K(P):_t(P)?(e.consume(P),X):n(P)}function K(P){return P===45&&i===2?(e.consume(P),H):P===60&&i===1?(e.consume(P),q):P===62&&i===4?(e.consume(P),B):P===63&&i===3?(e.consume(P),L):P===93&&i===5?(e.consume(P),ue):st(P)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(eK,G,F)(P)):P===null||st(P)?(e.exit("htmlFlowData"),F(P)):(e.consume(P),K)}function F(P){return e.check(tK,W,G)(P)}function W(P){return e.enter("lineEnding"),e.consume(P),e.exit("lineEnding"),V}function V(P){return P===null||st(P)?F(P):(e.enter("htmlFlowData"),K(P))}function H(P){return P===45?(e.consume(P),L):K(P)}function q(P){return P===47?(e.consume(P),l="",J):K(P)}function J(P){if(P===62){const ae=l.toLowerCase();return dk.includes(ae)?(e.consume(P),B):K(P)}return fr(P)&&l.length<8?(e.consume(P),l+=String.fromCharCode(P),J):K(P)}function ue(P){return P===93?(e.consume(P),L):K(P)}function L(P){return P===62?(e.consume(P),B):P===45&&i===2?(e.consume(P),L):K(P)}function B(P){return P===null||st(P)?(e.exit("htmlFlowData"),G(P)):(e.consume(P),B)}function G(P){return e.exit("htmlFlow"),t(P)}}function sK(e,t,n){const r=this;return i;function i(l){return st(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),a):n(l)}function a(l){return r.parser.lazy[r.now().line]?n(l):t(l)}}function iK(e,t,n){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(ud,t,n)}}const aK={name:"htmlText",tokenize:oK};function oK(e,t,n){const r=this;let i,a,l;return c;function c(L){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(L),d}function d(L){return L===33?(e.consume(L),f):L===47?(e.consume(L),M):L===63?(e.consume(L),A):fr(L)?(e.consume(L),I):n(L)}function f(L){return L===45?(e.consume(L),g):L===91?(e.consume(L),a=0,v):fr(L)?(e.consume(L),N):n(L)}function g(L){return L===45?(e.consume(L),x):n(L)}function h(L){return L===null?n(L):L===45?(e.consume(L),b):st(L)?(l=h,q(L)):(e.consume(L),h)}function b(L){return L===45?(e.consume(L),x):h(L)}function x(L){return L===62?H(L):L===45?b(L):h(L)}function v(L){const B="CDATA[";return L===B.charCodeAt(a++)?(e.consume(L),a===B.length?w:v):n(L)}function w(L){return L===null?n(L):L===93?(e.consume(L),k):st(L)?(l=w,q(L)):(e.consume(L),w)}function k(L){return L===93?(e.consume(L),C):w(L)}function C(L){return L===62?H(L):L===93?(e.consume(L),C):w(L)}function N(L){return L===null||L===62?H(L):st(L)?(l=N,q(L)):(e.consume(L),N)}function A(L){return L===null?n(L):L===63?(e.consume(L),R):st(L)?(l=A,q(L)):(e.consume(L),A)}function R(L){return L===62?H(L):A(L)}function M(L){return fr(L)?(e.consume(L),_):n(L)}function _(L){return L===45||ar(L)?(e.consume(L),_):D(L)}function D(L){return st(L)?(l=D,q(L)):_t(L)?(e.consume(L),D):H(L)}function I(L){return L===45||ar(L)?(e.consume(L),I):L===47||L===62||rn(L)?U(L):n(L)}function U(L){return L===47?(e.consume(L),H):L===58||L===95||fr(L)?(e.consume(L),j):st(L)?(l=U,q(L)):_t(L)?(e.consume(L),U):H(L)}function j(L){return L===45||L===46||L===58||L===95||ar(L)?(e.consume(L),j):X(L)}function X(L){return L===61?(e.consume(L),K):st(L)?(l=X,q(L)):_t(L)?(e.consume(L),X):U(L)}function K(L){return L===null||L===60||L===61||L===62||L===96?n(L):L===34||L===39?(e.consume(L),i=L,F):st(L)?(l=K,q(L)):_t(L)?(e.consume(L),K):(e.consume(L),W)}function F(L){return L===i?(e.consume(L),i=void 0,V):L===null?n(L):st(L)?(l=F,q(L)):(e.consume(L),F)}function W(L){return L===null||L===34||L===39||L===60||L===61||L===96?n(L):L===47||L===62||rn(L)?U(L):(e.consume(L),W)}function V(L){return L===47||L===62||rn(L)?U(L):n(L)}function H(L){return L===62?(e.consume(L),e.exit("htmlTextData"),e.exit("htmlText"),t):n(L)}function q(L){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(L),e.exit("lineEnding"),J}function J(L){return _t(L)?jt(e,ue,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(L):ue(L)}function ue(L){return e.enter("htmlTextData"),l(L)}}const ey={name:"labelEnd",resolveAll:dK,resolveTo:fK,tokenize:hK},lK={tokenize:pK},uK={tokenize:mK},cK={tokenize:gK};function dK(e){let t=-1;const n=[];for(;++t<e.length;){const r=e[t][1];if(n.push(e[t]),r.type==="labelImage"||r.type==="labelLink"||r.type==="labelEnd"){const i=r.type==="labelImage"?4:2;r.type="data",t+=i}}return e.length!==n.length&&$r(e,0,e.length,n),e}function fK(e,t){let n=e.length,r=0,i,a,l,c;for(;n--;)if(i=e[n][1],a){if(i.type==="link"||i.type==="labelLink"&&i._inactive)break;e[n][0]==="enter"&&i.type==="labelLink"&&(i._inactive=!0)}else if(l){if(e[n][0]==="enter"&&(i.type==="labelImage"||i.type==="labelLink")&&!i._balanced&&(a=n,i.type!=="labelLink")){r=2;break}}else i.type==="labelEnd"&&(l=n);const d={type:e[a][1].type==="labelLink"?"link":"image",start:{...e[a][1].start},end:{...e[e.length-1][1].end}},f={type:"label",start:{...e[a][1].start},end:{...e[l][1].end}},g={type:"labelText",start:{...e[a+r+2][1].end},end:{...e[l-2][1].start}};return c=[["enter",d,t],["enter",f,t]],c=ss(c,e.slice(a+1,a+r+3)),c=ss(c,[["enter",g,t]]),c=ss(c,qp(t.parser.constructs.insideSpan.null,e.slice(a+r+4,l-3),t)),c=ss(c,[["exit",g,t],e[l-2],e[l-1],["exit",f,t]]),c=ss(c,e.slice(l+1)),c=ss(c,[["exit",d,t]]),$r(e,a,e.length,c),e}function hK(e,t,n){const r=this;let i=r.events.length,a,l;for(;i--;)if((r.events[i][1].type==="labelImage"||r.events[i][1].type==="labelLink")&&!r.events[i][1]._balanced){a=r.events[i][1];break}return c;function c(b){return a?a._inactive?h(b):(l=r.parser.defined.includes(hs(r.sliceSerialize({start:a.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(b),e.exit("labelMarker"),e.exit("labelEnd"),d):n(b)}function d(b){return b===40?e.attempt(lK,g,l?g:h)(b):b===91?e.attempt(uK,g,l?f:h)(b):l?g(b):h(b)}function f(b){return e.attempt(cK,g,h)(b)}function g(b){return t(b)}function h(b){return a._balanced=!0,n(b)}}function pK(e,t,n){return r;function r(h){return e.enter("resource"),e.enter("resourceMarker"),e.consume(h),e.exit("resourceMarker"),i}function i(h){return rn(h)?Oc(e,a)(h):a(h)}function a(h){return h===41?g(h):XR(e,l,c,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(h)}function l(h){return rn(h)?Oc(e,d)(h):g(h)}function c(h){return n(h)}function d(h){return h===34||h===39||h===40?QR(e,f,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(h):g(h)}function f(h){return rn(h)?Oc(e,g)(h):g(h)}function g(h){return h===41?(e.enter("resourceMarker"),e.consume(h),e.exit("resourceMarker"),e.exit("resource"),t):n(h)}}function mK(e,t,n){const r=this;return i;function i(c){return KR.call(r,e,a,l,"reference","referenceMarker","referenceString")(c)}function a(c){return r.parser.defined.includes(hs(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(c):n(c)}function l(c){return n(c)}}function gK(e,t,n){return r;function r(a){return e.enter("reference"),e.enter("referenceMarker"),e.consume(a),e.exit("referenceMarker"),i}function i(a){return a===93?(e.enter("referenceMarker"),e.consume(a),e.exit("referenceMarker"),e.exit("reference"),t):n(a)}}const bK={name:"labelStartImage",resolveAll:ey.resolveAll,tokenize:xK};function xK(e,t,n){const r=this;return i;function i(c){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(c),e.exit("labelImageMarker"),a}function a(c){return c===91?(e.enter("labelMarker"),e.consume(c),e.exit("labelMarker"),e.exit("labelImage"),l):n(c)}function l(c){return c===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(c):t(c)}}const yK={name:"labelStartLink",resolveAll:ey.resolveAll,tokenize:EK};function EK(e,t,n){const r=this;return i;function i(l){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(l),e.exit("labelMarker"),e.exit("labelLink"),a}function a(l){return l===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(l):t(l)}}const tb={name:"lineEnding",tokenize:vK};function vK(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),jt(e,t,"linePrefix")}}const Eh={name:"thematicBreak",tokenize:TK};function TK(e,t,n){let r=0,i;return a;function a(f){return e.enter("thematicBreak"),l(f)}function l(f){return i=f,c(f)}function c(f){return f===i?(e.enter("thematicBreakSequence"),d(f)):r>=3&&(f===null||st(f))?(e.exit("thematicBreak"),t(f)):n(f)}function d(f){return f===i?(e.consume(f),r++,d):(e.exit("thematicBreakSequence"),_t(f)?jt(e,c,"whitespace")(f):c(f))}}const Ar={continuation:{tokenize:wK},exit:AK,name:"list",tokenize:kK},SK={partial:!0,tokenize:_K},CK={partial:!0,tokenize:NK};function kK(e,t,n){const r=this,i=r.events[r.events.length-1];let a=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,l=0;return c;function c(x){const v=r.containerState.type||(x===42||x===43||x===45?"listUnordered":"listOrdered");if(v==="listUnordered"?!r.containerState.marker||x===r.containerState.marker:r1(x)){if(r.containerState.type||(r.containerState.type=v,e.enter(v,{_container:!0})),v==="listUnordered")return e.enter("listItemPrefix"),x===42||x===45?e.check(Eh,n,f)(x):f(x);if(!r.interrupt||x===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),d(x)}return n(x)}function d(x){return r1(x)&&++l<10?(e.consume(x),d):(!r.interrupt||l<2)&&(r.containerState.marker?x===r.containerState.marker:x===41||x===46)?(e.exit("listItemValue"),f(x)):n(x)}function f(x){return e.enter("listItemMarker"),e.consume(x),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||x,e.check(ud,r.interrupt?n:g,e.attempt(SK,b,h))}function g(x){return r.containerState.initialBlankLine=!0,a++,b(x)}function h(x){return _t(x)?(e.enter("listItemPrefixWhitespace"),e.consume(x),e.exit("listItemPrefixWhitespace"),b):n(x)}function b(x){return r.containerState.size=a+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(x)}}function wK(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(ud,i,a);function i(c){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,jt(e,t,"listItemIndent",r.containerState.size+1)(c)}function a(c){return r.containerState.furtherBlankLines||!_t(c)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,l(c)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(CK,t,l)(c))}function l(c){return r.containerState._closeFlow=!0,r.interrupt=void 0,jt(e,e.attempt(Ar,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(c)}}function NK(e,t,n){const r=this;return jt(e,i,"listItemIndent",r.containerState.size+1);function i(a){const l=r.events[r.events.length-1];return l&&l[1].type==="listItemIndent"&&l[2].sliceSerialize(l[1],!0).length===r.containerState.size?t(a):n(a)}}function AK(e){e.exit(this.containerState.type)}function _K(e,t,n){const r=this;return jt(e,i,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(a){const l=r.events[r.events.length-1];return!_t(a)&&l&&l[1].type==="listItemPrefixWhitespace"?t(a):n(a)}}const fk={name:"setextUnderline",resolveTo:RK,tokenize:OK};function RK(e,t){let n=e.length,r,i,a;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){r=n;break}e[n][1].type==="paragraph"&&(i=n)}else e[n][1].type==="content"&&e.splice(n,1),!a&&e[n][1].type==="definition"&&(a=n);const l={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type="setextHeadingText",a?(e.splice(i,0,["enter",l,t]),e.splice(a+1,0,["exit",e[r][1],t]),e[r][1].end={...e[a][1].end}):e[r][1]=l,e.push(["exit",l,t]),e}function OK(e,t,n){const r=this;let i;return a;function a(f){let g=r.events.length,h;for(;g--;)if(r.events[g][1].type!=="lineEnding"&&r.events[g][1].type!=="linePrefix"&&r.events[g][1].type!=="content"){h=r.events[g][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||h)?(e.enter("setextHeadingLine"),i=f,l(f)):n(f)}function l(f){return e.enter("setextHeadingLineSequence"),c(f)}function c(f){return f===i?(e.consume(f),c):(e.exit("setextHeadingLineSequence"),_t(f)?jt(e,d,"lineSuffix")(f):d(f))}function d(f){return f===null||st(f)?(e.exit("setextHeadingLine"),t(f)):n(f)}}const IK={tokenize:UK,partial:!0};function MK(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:jK,continuation:{tokenize:BK},exit:HK}},text:{91:{name:"gfmFootnoteCall",tokenize:PK},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:LK,resolveTo:DK}}}}function LK(e,t,n){const r=this;let i=r.events.length;const a=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let l;for(;i--;){const d=r.events[i][1];if(d.type==="labelImage"){l=d;break}if(d.type==="gfmFootnoteCall"||d.type==="labelLink"||d.type==="label"||d.type==="image"||d.type==="link")break}return c;function c(d){if(!l||!l._balanced)return n(d);const f=hs(r.sliceSerialize({start:l.end,end:r.now()}));return f.codePointAt(0)!==94||!a.includes(f.slice(1))?n(d):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(d),e.exit("gfmFootnoteCallLabelMarker"),t(d))}}function DK(e,t){let n=e.length;for(;n--;)if(e[n][1].type==="labelImage"&&e[n][0]==="enter"){e[n][1];break}e[n+1][1].type="data",e[n+3][1].type="gfmFootnoteCallLabelMarker";const r={type:"gfmFootnoteCall",start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},i={type:"gfmFootnoteCallMarker",start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};i.end.column++,i.end.offset++,i.end._bufferIndex++;const a={type:"gfmFootnoteCallString",start:Object.assign({},i.end),end:Object.assign({},e[e.length-1][1].start)},l={type:"chunkString",contentType:"string",start:Object.assign({},a.start),end:Object.assign({},a.end)},c=[e[n+1],e[n+2],["enter",r,t],e[n+3],e[n+4],["enter",i,t],["exit",i,t],["enter",a,t],["enter",l,t],["exit",l,t],["exit",a,t],e[e.length-2],e[e.length-1],["exit",r,t]];return e.splice(n,e.length-n+1,...c),e}function PK(e,t,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let a=0,l;return c;function c(h){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(h),e.exit("gfmFootnoteCallLabelMarker"),d}function d(h){return h!==94?n(h):(e.enter("gfmFootnoteCallMarker"),e.consume(h),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",f)}function f(h){if(a>999||h===93&&!l||h===null||h===91||rn(h))return n(h);if(h===93){e.exit("chunkString");const b=e.exit("gfmFootnoteCallString");return i.includes(hs(r.sliceSerialize(b)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(h),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(h)}return rn(h)||(l=!0),a++,e.consume(h),h===92?g:f}function g(h){return h===91||h===92||h===93?(e.consume(h),a++,f):f(h)}}function jK(e,t,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let a,l=0,c;return d;function d(v){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(v),e.exit("gfmFootnoteDefinitionLabelMarker"),f}function f(v){return v===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(v),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",g):n(v)}function g(v){if(l>999||v===93&&!c||v===null||v===91||rn(v))return n(v);if(v===93){e.exit("chunkString");const w=e.exit("gfmFootnoteDefinitionLabelString");return a=hs(r.sliceSerialize(w)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(v),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),b}return rn(v)||(c=!0),l++,e.consume(v),v===92?h:g}function h(v){return v===91||v===92||v===93?(e.consume(v),l++,g):g(v)}function b(v){return v===58?(e.enter("definitionMarker"),e.consume(v),e.exit("definitionMarker"),i.includes(a)||i.push(a),jt(e,x,"gfmFootnoteDefinitionWhitespace")):n(v)}function x(v){return t(v)}}function BK(e,t,n){return e.check(ud,t,e.attempt(IK,t,n))}function HK(e){e.exit("gfmFootnoteDefinition")}function UK(e,t,n){const r=this;return jt(e,i,"gfmFootnoteDefinitionIndent",5);function i(a){const l=r.events[r.events.length-1];return l&&l[1].type==="gfmFootnoteDefinitionIndent"&&l[2].sliceSerialize(l[1],!0).length===4?t(a):n(a)}}function zK(e){let n=(e||{}).singleTilde;const r={name:"strikethrough",tokenize:a,resolveAll:i};return n==null&&(n=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function i(l,c){let d=-1;for(;++d<l.length;)if(l[d][0]==="enter"&&l[d][1].type==="strikethroughSequenceTemporary"&&l[d][1]._close){let f=d;for(;f--;)if(l[f][0]==="exit"&&l[f][1].type==="strikethroughSequenceTemporary"&&l[f][1]._open&&l[d][1].end.offset-l[d][1].start.offset===l[f][1].end.offset-l[f][1].start.offset){l[d][1].type="strikethroughSequence",l[f][1].type="strikethroughSequence";const g={type:"strikethrough",start:Object.assign({},l[f][1].start),end:Object.assign({},l[d][1].end)},h={type:"strikethroughText",start:Object.assign({},l[f][1].end),end:Object.assign({},l[d][1].start)},b=[["enter",g,c],["enter",l[f][1],c],["exit",l[f][1],c],["enter",h,c]],x=c.parser.constructs.insideSpan.null;x&&$r(b,b.length,0,qp(x,l.slice(f+1,d),c)),$r(b,b.length,0,[["exit",h,c],["enter",l[d][1],c],["exit",l[d][1],c],["exit",g,c]]),$r(l,f-1,d-f+3,b),d=f+b.length-2;break}}for(d=-1;++d<l.length;)l[d][1].type==="strikethroughSequenceTemporary"&&(l[d][1].type="data");return l}function a(l,c,d){const f=this.previous,g=this.events;let h=0;return b;function b(v){return f===126&&g[g.length-1][1].type!=="characterEscape"?d(v):(l.enter("strikethroughSequenceTemporary"),x(v))}function x(v){const w=Ul(f);if(v===126)return h>1?d(v):(l.consume(v),h++,x);if(h<2&&!n)return d(v);const k=l.exit("strikethroughSequenceTemporary"),C=Ul(v);return k._open=!C||C===2&&!!w,k._close=!w||w===2&&!!C,c(v)}}}class FK{constructor(){this.map=[]}add(t,n,r){$K(this,t,n,r)}consume(t){if(this.map.sort(function(a,l){return a[0]-l[0]}),this.map.length===0)return;let n=this.map.length;const r=[];for(;n>0;)n-=1,r.push(t.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),t.length=this.map[n][0];r.push(t.slice()),t.length=0;let i=r.pop();for(;i;){for(const a of i)t.push(a);i=r.pop()}this.map.length=0}}function $K(e,t,n,r){let i=0;if(!(n===0&&r.length===0)){for(;i<e.map.length;){if(e.map[i][0]===t){e.map[i][1]+=n,e.map[i][2].push(...r);return}i+=1}e.map.push([t,n,r])}}function VK(e,t){let n=!1;const r=[];for(;t<e.length;){const i=e[t];if(n){if(i[0]==="enter")i[1].type==="tableContent"&&r.push(e[t+1][1].type==="tableDelimiterMarker"?"left":"none");else if(i[1].type==="tableContent"){if(e[t-1][1].type==="tableDelimiterMarker"){const a=r.length-1;r[a]=r[a]==="left"?"center":"right"}}else if(i[1].type==="tableDelimiterRow")break}else i[0]==="enter"&&i[1].type==="tableDelimiterRow"&&(n=!0);t+=1}return r}function qK(){return{flow:{null:{name:"table",tokenize:YK,resolveAll:GK}}}}function YK(e,t,n){const r=this;let i=0,a=0,l;return c;function c(j){let X=r.events.length-1;for(;X>-1;){const W=r.events[X][1].type;if(W==="lineEnding"||W==="linePrefix")X--;else break}const K=X>-1?r.events[X][1].type:null,F=K==="tableHead"||K==="tableRow"?_:d;return F===_&&r.parser.lazy[r.now().line]?n(j):F(j)}function d(j){return e.enter("tableHead"),e.enter("tableRow"),f(j)}function f(j){return j===124||(l=!0,a+=1),g(j)}function g(j){return j===null?n(j):st(j)?a>1?(a=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(j),e.exit("lineEnding"),x):n(j):_t(j)?jt(e,g,"whitespace")(j):(a+=1,l&&(l=!1,i+=1),j===124?(e.enter("tableCellDivider"),e.consume(j),e.exit("tableCellDivider"),l=!0,g):(e.enter("data"),h(j)))}function h(j){return j===null||j===124||rn(j)?(e.exit("data"),g(j)):(e.consume(j),j===92?b:h)}function b(j){return j===92||j===124?(e.consume(j),h):h(j)}function x(j){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(j):(e.enter("tableDelimiterRow"),l=!1,_t(j)?jt(e,v,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(j):v(j))}function v(j){return j===45||j===58?k(j):j===124?(l=!0,e.enter("tableCellDivider"),e.consume(j),e.exit("tableCellDivider"),w):M(j)}function w(j){return _t(j)?jt(e,k,"whitespace")(j):k(j)}function k(j){return j===58?(a+=1,l=!0,e.enter("tableDelimiterMarker"),e.consume(j),e.exit("tableDelimiterMarker"),C):j===45?(a+=1,C(j)):j===null||st(j)?R(j):M(j)}function C(j){return j===45?(e.enter("tableDelimiterFiller"),N(j)):M(j)}function N(j){return j===45?(e.consume(j),N):j===58?(l=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(j),e.exit("tableDelimiterMarker"),A):(e.exit("tableDelimiterFiller"),A(j))}function A(j){return _t(j)?jt(e,R,"whitespace")(j):R(j)}function R(j){return j===124?v(j):j===null||st(j)?!l||i!==a?M(j):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(j)):M(j)}function M(j){return n(j)}function _(j){return e.enter("tableRow"),D(j)}function D(j){return j===124?(e.enter("tableCellDivider"),e.consume(j),e.exit("tableCellDivider"),D):j===null||st(j)?(e.exit("tableRow"),t(j)):_t(j)?jt(e,D,"whitespace")(j):(e.enter("data"),I(j))}function I(j){return j===null||j===124||rn(j)?(e.exit("data"),D(j)):(e.consume(j),j===92?U:I)}function U(j){return j===92||j===124?(e.consume(j),I):I(j)}}function GK(e,t){let n=-1,r=!0,i=0,a=[0,0,0,0],l=[0,0,0,0],c=!1,d=0,f,g,h;const b=new FK;for(;++n<e.length;){const x=e[n],v=x[1];x[0]==="enter"?v.type==="tableHead"?(c=!1,d!==0&&(hk(b,t,d,f,g),g=void 0,d=0),f={type:"table",start:Object.assign({},v.start),end:Object.assign({},v.end)},b.add(n,0,[["enter",f,t]])):v.type==="tableRow"||v.type==="tableDelimiterRow"?(r=!0,h=void 0,a=[0,0,0,0],l=[0,n+1,0,0],c&&(c=!1,g={type:"tableBody",start:Object.assign({},v.start),end:Object.assign({},v.end)},b.add(n,0,[["enter",g,t]])),i=v.type==="tableDelimiterRow"?2:g?3:1):i&&(v.type==="data"||v.type==="tableDelimiterMarker"||v.type==="tableDelimiterFiller")?(r=!1,l[2]===0&&(a[1]!==0&&(l[0]=l[1],h=Jf(b,t,a,i,void 0,h),a=[0,0,0,0]),l[2]=n)):v.type==="tableCellDivider"&&(r?r=!1:(a[1]!==0&&(l[0]=l[1],h=Jf(b,t,a,i,void 0,h)),a=l,l=[a[1],n,0,0])):v.type==="tableHead"?(c=!0,d=n):v.type==="tableRow"||v.type==="tableDelimiterRow"?(d=n,a[1]!==0?(l[0]=l[1],h=Jf(b,t,a,i,n,h)):l[1]!==0&&(h=Jf(b,t,l,i,n,h)),i=0):i&&(v.type==="data"||v.type==="tableDelimiterMarker"||v.type==="tableDelimiterFiller")&&(l[3]=n)}for(d!==0&&hk(b,t,d,f,g),b.consume(t.events),n=-1;++n<t.events.length;){const x=t.events[n];x[0]==="enter"&&x[1].type==="table"&&(x[1]._align=VK(t.events,n))}return e}function Jf(e,t,n,r,i,a){const l=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",c="tableContent";n[0]!==0&&(a.end=Object.assign({},xl(t.events,n[0])),e.add(n[0],0,[["exit",a,t]]));const d=xl(t.events,n[1]);if(a={type:l,start:Object.assign({},d),end:Object.assign({},d)},e.add(n[1],0,[["enter",a,t]]),n[2]!==0){const f=xl(t.events,n[2]),g=xl(t.events,n[3]),h={type:c,start:Object.assign({},f),end:Object.assign({},g)};if(e.add(n[2],0,[["enter",h,t]]),r!==2){const b=t.events[n[2]],x=t.events[n[3]];if(b[1].end=Object.assign({},x[1].end),b[1].type="chunkText",b[1].contentType="text",n[3]>n[2]+1){const v=n[2]+1,w=n[3]-n[2]-1;e.add(v,w,[])}}e.add(n[3]+1,0,[["exit",h,t]])}return i!==void 0&&(a.end=Object.assign({},xl(t.events,i)),e.add(i,0,[["exit",a,t]]),a=void 0),a}function hk(e,t,n,r,i){const a=[],l=xl(t.events,n);i&&(i.end=Object.assign({},l),a.push(["exit",i,t])),r.end=Object.assign({},l),a.push(["exit",r,t]),e.add(n+1,0,a)}function xl(e,t){const n=e[t],r=n[0]==="enter"?"start":"end";return n[1][r]}const XK={name:"tasklistCheck",tokenize:QK};function KK(){return{text:{91:XK}}}function QK(e,t,n){const r=this;return i;function i(d){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(d):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(d),e.exit("taskListCheckMarker"),a)}function a(d){return rn(d)?(e.enter("taskListCheckValueUnchecked"),e.consume(d),e.exit("taskListCheckValueUnchecked"),l):d===88||d===120?(e.enter("taskListCheckValueChecked"),e.consume(d),e.exit("taskListCheckValueChecked"),l):n(d)}function l(d){return d===93?(e.enter("taskListCheckMarker"),e.consume(d),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),c):n(d)}function c(d){return st(d)?t(d):_t(d)?e.check({tokenize:WK},t,n)(d):n(d)}}function WK(e,t,n){return jt(e,r,"whitespace");function r(i){return i===null?n(i):t(i)}}function ZK(e){return DR([lX(),MK(),zK(e),qK(),KK()])}const JK={};function eQ(e){const t=this,n=e||JK,r=t.data(),i=r.micromarkExtensions||(r.micromarkExtensions=[]),a=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),l=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);i.push(ZK(n)),a.push(nX()),l.push(rX(n))}var tQ=Object.defineProperty,nQ=Object.defineProperties,rQ=Object.getOwnPropertyDescriptors,pk=Object.getOwnPropertySymbols,sQ=Object.prototype.hasOwnProperty,iQ=Object.prototype.propertyIsEnumerable,mk=(e,t,n)=>t in e?tQ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,WR=(e,t)=>{for(var n in t||(t={}))sQ.call(t,n)&&mk(e,n,t[n]);if(pk)for(var n of pk(t))iQ.call(t,n)&&mk(e,n,t[n]);return e},ZR=(e,t)=>nQ(e,rQ(t)),yr=(e,t)=>{let n=!1,r=!1;for(let i=0;i<t;i+=1){if(e[i]==="\\"&&i+1<e.length&&e[i+1]==="`"){i+=1;continue}if(e.substring(i,i+3)==="```"){r=!r,i+=2;continue}!r&&e[i]==="`"&&(n=!n)}return n||r},aQ=(e,t)=>{let n=e.substring(t,t+3)==="```",r=t>0&&e.substring(t-1,t+2)==="```",i=t>1&&e.substring(t-2,t+1)==="```";return n||r||i},oQ=e=>{let t=0;for(let n=0;n<e.length;n+=1){if(e[n]==="\\"&&n+1<e.length&&e[n+1]==="`"){n+=1;continue}e[n]==="`"&&!aQ(e,n)&&(t+=1)}return t},oa=(e,t)=>{let n=!1,r=!1,i=-1;for(let a=0;a<e.length;a+=1){if(e[a]==="\\"&&a+1<e.length&&e[a+1]==="`"){a+=1;continue}if(e.substring(a,a+3)==="```"){r=!r,a+=2;continue}if(!r&&e[a]==="`")if(n){if(i<t&&t<a)return!0;n=!1,i=-1}else n=!0,i=a}return!1},lQ=/^(\s*(?:[-*+]|\d+[.)]) +)>(=?\s*[$]?\d)/gm,uQ=e=>!e||typeof e!="string"||!e.includes(">")?e:e.replace(lQ,(t,n,r,i)=>yr(e,i)?t:`${n}\\>${r}`),cQ=/(\*\*)([^*]*\*?)$/,dQ=/(__)([^_]*?)$/,fQ=/(\*\*\*)([^*]*?)$/,hQ=/(\*)([^*]*?)$/,pQ=/(_)([^_]*?)$/,mQ=/(`)([^`]*?)$/,gQ=/(~~)([^~]*?)$/,No=/^[\s_~*`]*$/,JR=/^[\s]*[-*+][\s]+$/,bQ=/[\p{L}\p{N}_]/u,xQ=/^```[^`\n]*```?$/,yQ=/^\*{4,}$/,EQ=/(__)([^_]+)_$/,vQ=/(~~)([^~]+)~$/,gk=/~~/g,la=e=>{if(!e)return!1;let t=e.charCodeAt(0);return t>=48&&t<=57||t>=65&&t<=90||t>=97&&t<=122||t===95?!0:bQ.test(e)},TQ=(e,t)=>{let n=1;for(let r=t-1;r>=0;r-=1)if(e[r]==="]")n+=1;else if(e[r]==="["&&(n-=1,n===0))return r;return-1},e4=(e,t)=>{let n=1;for(let r=t+1;r<e.length;r+=1)if(e[r]==="[")n+=1;else if(e[r]==="]"&&(n-=1,n===0))return r;return-1},Yp=(e,t)=>{let n=!1,r=!1;for(let i=0;i<e.length&&i<t;i+=1){if(e[i]==="\\"&&e[i+1]==="$"){i+=1;continue}e[i]==="$"&&(e[i+1]==="$"?(r=!r,i+=1,n=!1):r||(n=!n))}return n||r},SQ=(e,t)=>{for(let n=t;n<e.length;n+=1){if(e[n]===")")return!0;if(e[n]===`
556
+ `)return!1}return!1},t4=(e,t)=>{for(let n=t-1;n>=0;n-=1){if(e[n]===")")return!1;if(e[n]==="(")return n>0&&e[n-1]==="]"?SQ(e,t):!1;if(e[n]===`
557
+ `)return!1}return!1},CQ=(e,t)=>{for(let n=t-1;n>=0;n-=1){if(e[n]===">")return!1;if(e[n]==="<"){let r=n+1<e.length?e[n+1]:"";return r>="a"&&r<="z"||r>="A"&&r<="Z"||r==="/"}if(e[n]===`
558
+ `)return!1}return!1},ty=(e,t,n)=>{let r=0;for(let d=t-1;d>=0;d-=1)if(e[d]===`
559
+ `){r=d+1;break}let i=e.length;for(let d=t;d<e.length;d+=1)if(e[d]===`
560
+ `){i=d;break}let a=e.substring(r,i),l=0,c=!1;for(let d of a)if(d===n)l+=1;else if(d!==" "&&d!==" "){c=!0;break}return l>=3&&!c},kQ=(e,t,n,r)=>n==="\\"||e.includes("$")&&Yp(e,t)?!0:n!=="*"&&r==="*"?(t<e.length-2?e[t+2]:"")!=="*":!!(n==="*"||n&&r&&la(n)&&la(r)||(!n||n===" "||n===" "||n===`
561
+ `)&&(!r||r===" "||r===" "||r===`
562
+ `)),n4=e=>{let t=0,n=!1,r=e.length;for(let i=0;i<r;i+=1){if(e[i]==="`"&&i+2<r&&e[i+1]==="`"&&e[i+2]==="`"){n=!n,i+=2;continue}if(n||e[i]!=="*")continue;let a=i>0?e[i-1]:"",l=i<r-1?e[i+1]:"";kQ(e,i,a,l)||(t+=1)}return t},wQ=(e,t,n,r)=>!!(n==="\\"||e.includes("$")&&Yp(e,t)||t4(e,t)||CQ(e,t)||n==="_"||r==="_"||n&&r&&la(n)&&la(r)),NQ=e=>{let t=0,n=!1,r=e.length;for(let i=0;i<r;i+=1){if(e[i]==="`"&&i+2<r&&e[i+1]==="`"&&e[i+2]==="`"){n=!n,i+=2;continue}if(n||e[i]!=="_")continue;let a=i>0?e[i-1]:"",l=i<r-1?e[i+1]:"";wQ(e,i,a,l)||(t+=1)}return t},AQ=e=>{let t=0,n=0,r=!1;for(let i=0;i<e.length;i+=1){if(e[i]==="`"&&i+2<e.length&&e[i+1]==="`"&&e[i+2]==="`"){n>=3&&(t+=Math.floor(n/3)),n=0,r=!r,i+=2;continue}r||(e[i]==="*"?n+=1:(n>=3&&(t+=Math.floor(n/3)),n=0))}return n>=3&&(t+=Math.floor(n/3)),t},ny=e=>{let t=0,n=!1;for(let r=0;r<e.length;r+=1){if(e[r]==="`"&&r+2<e.length&&e[r+1]==="`"&&e[r+2]==="`"){n=!n,r+=2;continue}n||e[r]==="*"&&r+1<e.length&&e[r+1]==="*"&&(t+=1,r+=1)}return t},bk=e=>{let t=0,n=!1;for(let r=0;r<e.length;r+=1){if(e[r]==="`"&&r+2<e.length&&e[r+1]==="`"&&e[r+2]==="`"){n=!n,r+=2;continue}n||e[r]==="_"&&r+1<e.length&&e[r+1]==="_"&&(t+=1,r+=1)}return t},_Q=(e,t,n)=>{if(!t||No.test(t))return!0;let r=e.substring(0,n).lastIndexOf(`
563
+ `),i=r===-1?0:r+1,a=e.substring(i,n);return JR.test(a)&&t.includes(`
564
+ `)?!0:ty(e,n,"*")},RQ=e=>{let t=e.match(cQ);if(!t)return e;let n=t[2],r=e.lastIndexOf(t[1]);return yr(e,r)||oa(e,r)||_Q(e,n,r)?e:ny(e)%2===1?n.endsWith("*")?`${e}*`:`${e}**`:e},OQ=(e,t,n)=>{if(!t||No.test(t))return!0;let r=e.substring(0,n).lastIndexOf(`
565
+ `),i=r===-1?0:r+1,a=e.substring(i,n);return JR.test(a)&&t.includes(`
566
+ `)?!0:ty(e,n,"_")},IQ=e=>{let t=e.match(dQ);if(!t){let i=e.match(EQ);if(i){let a=e.lastIndexOf(i[1]);if(!(yr(e,a)||oa(e,a))&&bk(e)%2===1)return`${e}_`}return e}let n=t[2],r=e.lastIndexOf(t[1]);return yr(e,r)||oa(e,r)||OQ(e,n,r)?e:bk(e)%2===1?`${e}__`:e},MQ=e=>{let t=!1;for(let n=0;n<e.length;n+=1){if(e[n]==="`"&&n+2<e.length&&e[n+1]==="`"&&e[n+2]==="`"){t=!t,n+=2;continue}if(!t&&e[n]==="*"&&e[n-1]!=="*"&&e[n+1]!=="*"&&e[n-1]!=="\\"&&!Yp(e,n)){let r=n>0?e[n-1]:"",i=n<e.length-1?e[n+1]:"";if((!r||r===" "||r===" "||r===`
567
+ `)&&(!i||i===" "||i===" "||i===`
568
+ `)||r&&i&&la(r)&&la(i))continue;return n}}return-1},LQ=e=>{if(!e.match(hQ))return e;let t=MQ(e);if(t===-1||yr(e,t)||oa(e,t))return e;let n=e.substring(t+1);return!n||No.test(n)?e:n4(e)%2===1?`${e}*`:e},r4=e=>{let t=!1;for(let n=0;n<e.length;n+=1){if(e[n]==="`"&&n+2<e.length&&e[n+1]==="`"&&e[n+2]==="`"){t=!t,n+=2;continue}if(!t&&e[n]==="_"&&e[n-1]!=="_"&&e[n+1]!=="_"&&e[n-1]!=="\\"&&!Yp(e,n)&&!t4(e,n)){let r=n>0?e[n-1]:"",i=n<e.length-1?e[n+1]:"";if(r&&i&&la(r)&&la(i))continue;return n}}return-1},DQ=e=>{let t=e.length;for(;t>0&&e[t-1]===`
569
+ `;)t-=1;if(t<e.length){let n=e.slice(0,t),r=e.slice(t);return`${n}_${r}`}return`${e}_`},PQ=e=>{if(!e.endsWith("**"))return null;let t=e.slice(0,-2);if(ny(t)%2!==1)return null;let n=t.indexOf("**"),r=r4(t);return n!==-1&&r!==-1&&n<r?`${t}_**`:null},jQ=e=>{if(!e.match(pQ))return e;let t=r4(e);if(t===-1)return e;let n=e.substring(t+1);if(!n||No.test(n)||yr(e,t)||oa(e,t))return e;if(NQ(e)%2===1){let r=PQ(e);return r!==null?r:DQ(e)}return e},BQ=e=>{let t=ny(e),n=n4(e);return t%2===0&&n%2===0},HQ=(e,t,n)=>!t||No.test(t)||yr(e,n)||oa(e,n)?!0:ty(e,n,"*"),UQ=e=>{if(yQ.test(e))return e;let t=e.match(fQ);if(!t)return e;let n=t[2],r=e.lastIndexOf(t[1]);return HQ(e,n,r)?e:AQ(e)%2===1?BQ(e)?e:`${e}***`:e},zQ=/<[a-zA-Z/][^>]*$/,FQ=e=>{let t=e.match(zQ);return!t||t.index===void 0||yr(e,t.index)?e:e.substring(0,t.index).trimEnd()},$Q=e=>!e.match(xQ)||e.includes(`
570
+ `)?null:e.endsWith("``")&&!e.endsWith("```")?`${e}\``:e,VQ=e=>(e.match(/```/g)||[]).length%2===1,qQ=e=>{let t=$Q(e);if(t!==null)return t;let n=e.match(mQ);if(n&&!VQ(e)){let r=n[2];if(!r||No.test(r))return e;if(oQ(e)%2===1)return`${e}\``}return e},s4=(e,t)=>t>=2&&e.substring(t-2,t+1)==="```"||t>=1&&e.substring(t-1,t+2)==="```"||t<=e.length-3&&e.substring(t,t+3)==="```",YQ=e=>{let t=0,n=!1;for(let r=0;r<e.length-1;r+=1)e[r]==="`"&&!s4(e,r)&&(n=!n),!n&&e[r]==="$"&&e[r+1]==="$"&&(t+=1,r+=1);return t},GQ=e=>{let t=0,n=!1;for(let r=0;r<e.length;r+=1){if(e[r]==="\\"){r+=1;continue}if(e[r]==="`"&&!s4(e,r)){n=!n;continue}!n&&e[r]==="$"&&(r+1<e.length&&e[r+1]==="$"?r+=1:t+=1)}return t},XQ=e=>{if(e.endsWith("$")&&!e.endsWith("$$"))return`${e}$`;let t=e.indexOf("$$");return t!==-1&&e.indexOf(`
571
+ `,t)!==-1&&!e.endsWith(`
572
+ `)?`${e}
573
+ $$`:`${e}$$`},KQ=e=>YQ(e)%2===0?e:XQ(e),QQ=e=>GQ(e)%2===1?`${e}$`:e,WQ=(e,t,n)=>{if(e.substring(t+2).includes(")"))return null;let r=TQ(e,t);if(r===-1||yr(e,r))return null;let i=r>0&&e[r-1]==="!",a=i?r-1:r,l=e.substring(0,a);if(i)return l;let c=e.substring(r+1,t);return n==="text-only"?`${l}${c}`:`${l}[${c}](streamdown:incomplete-link)`},xk=(e,t)=>{for(let n=0;n<t;n++)if(e[n]==="["&&!yr(e,n)){if(n>0&&e[n-1]==="!")continue;let r=e4(e,n);if(r===-1)return n;if(r+1<e.length&&e[r+1]==="("){let i=e.indexOf(")",r+2);i!==-1&&(n=i)}}return t},ZQ=(e,t,n)=>{let r=t>0&&e[t-1]==="!",i=r?t-1:t;if(!e.substring(t+1).includes("]")){let a=e.substring(0,i);if(r)return a;if(n==="text-only"){let l=xk(e,t);return e.substring(0,l)+e.substring(l+1)}return`${e}](streamdown:incomplete-link)`}if(e4(e,t)===-1){let a=e.substring(0,i);if(r)return a;if(n==="text-only"){let l=xk(e,t);return e.substring(0,l)+e.substring(l+1)}return`${e}](streamdown:incomplete-link)`}return null},i4=(e,t="protocol")=>{let n=e.lastIndexOf("](");if(n!==-1&&!yr(e,n)){let r=WQ(e,n,t);if(r!==null)return r}for(let r=e.length-1;r>=0;r-=1)if(e[r]==="["&&!yr(e,r)){let i=ZQ(e,r,t);if(i!==null)return i}return e},JQ=/^-{1,2}$/,eW=/^[\s]*-{1,2}[\s]+$/,tW=/^={1,2}$/,nW=/^[\s]*={1,2}[\s]+$/,rW=e=>{if(!e||typeof e!="string")return e;let t=e.lastIndexOf(`
574
+ `);if(t===-1)return e;let n=e.substring(t+1),r=e.substring(0,t),i=n.trim();if(JQ.test(i)&&!n.match(eW)){let a=r.split(`
575
+ `).at(-1);if(a&&a.trim().length>0)return`${e}​`}if(tW.test(i)&&!n.match(nW)){let a=r.split(`
576
+ `).at(-1);if(a&&a.trim().length>0)return`${e}​`}return e},sW=new RegExp("(?<=[\\p{L}\\p{N}_])~(?!~)(?=[\\p{L}\\p{N}_])","gu"),iW=e=>!e||typeof e!="string"||!e.includes("~")?e:e.replace(sW,(t,n)=>yr(e,n)?t:"\\~"),aW=e=>{var t,n;let r=e.match(gQ);if(r){let i=r[2];if(!i||No.test(i))return e;let a=e.lastIndexOf(r[1]);if(yr(e,a)||oa(e,a))return e;if(((t=e.match(gk))==null?void 0:t.length)%2===1)return`${e}~~`}else{let i=e.match(vQ);if(i){let a=e.lastIndexOf(i[0].slice(0,2));if(yr(e,a)||oa(e,a))return e;if(((n=e.match(gk))==null?void 0:n.length)%2===1)return`${e}~`}}return e},nb=e=>e!==!1,oW=e=>e===!0,dr={SINGLE_TILDE:0,COMPARISON_OPERATORS:5,HTML_TAGS:10,SETEXT_HEADINGS:15,LINKS:20,BOLD_ITALIC:30,BOLD:35,ITALIC_DOUBLE_UNDERSCORE:40,ITALIC_SINGLE_ASTERISK:41,ITALIC_SINGLE_UNDERSCORE:42,INLINE_CODE:50,STRIKETHROUGH:60,KATEX:70,INLINE_KATEX:75,DEFAULT:100},lW=[{handler:{name:"singleTilde",handle:iW,priority:dr.SINGLE_TILDE},optionKey:"singleTilde"},{handler:{name:"comparisonOperators",handle:uQ,priority:dr.COMPARISON_OPERATORS},optionKey:"comparisonOperators"},{handler:{name:"htmlTags",handle:FQ,priority:dr.HTML_TAGS},optionKey:"htmlTags"},{handler:{name:"setextHeadings",handle:rW,priority:dr.SETEXT_HEADINGS},optionKey:"setextHeadings"},{handler:{name:"links",handle:i4,priority:dr.LINKS},optionKey:"links",earlyReturn:e=>e.endsWith("](streamdown:incomplete-link)")},{handler:{name:"boldItalic",handle:UQ,priority:dr.BOLD_ITALIC},optionKey:"boldItalic"},{handler:{name:"bold",handle:RQ,priority:dr.BOLD},optionKey:"bold"},{handler:{name:"italicDoubleUnderscore",handle:IQ,priority:dr.ITALIC_DOUBLE_UNDERSCORE},optionKey:"italic"},{handler:{name:"italicSingleAsterisk",handle:LQ,priority:dr.ITALIC_SINGLE_ASTERISK},optionKey:"italic"},{handler:{name:"italicSingleUnderscore",handle:jQ,priority:dr.ITALIC_SINGLE_UNDERSCORE},optionKey:"italic"},{handler:{name:"inlineCode",handle:qQ,priority:dr.INLINE_CODE},optionKey:"inlineCode"},{handler:{name:"strikethrough",handle:aW,priority:dr.STRIKETHROUGH},optionKey:"strikethrough"},{handler:{name:"katex",handle:KQ,priority:dr.KATEX},optionKey:"katex"},{handler:{name:"inlineKatex",handle:QQ,priority:dr.INLINE_KATEX},optionKey:"inlineKatex"}],uW=e=>{var t;let n=(t=e?.linkMode)!=null?t:"protocol";return lW.filter(({handler:r,optionKey:i})=>r.name==="links"?nb(e?.links)||nb(e?.images):r.name==="inlineKatex"?oW(e?.inlineKatex):nb(e?.[i])).map(({handler:r,earlyReturn:i})=>r.name==="links"?{handler:ZR(WR({},r),{handle:a=>i4(a,n)}),earlyReturn:n==="protocol"?i:void 0}:{handler:r,earlyReturn:i})},cW=(e,t)=>{var n;if(!e||typeof e!="string")return e;let r=e.endsWith(" ")&&!e.endsWith(" ")?e.slice(0,-1):e,i=uW(t),a=((n=t?.handlers)!=null?n:[]).map(c=>{var d;return{handler:ZR(WR({},c),{priority:(d=c.priority)!=null?d:dr.DEFAULT}),earlyReturn:void 0}}),l=[...i,...a].sort((c,d)=>{var f,g;return((f=c.handler.priority)!=null?f:0)-((g=d.handler.priority)!=null?g:0)});for(let{handler:c,earlyReturn:d}of l)if(r=c.handle(r),d!=null&&d(r))return r;return r},dW=cW;const fW=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,hW=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,pW={};function yk(e,t){return(pW.jsx?hW:fW).test(e)}const mW=/[ \t\n\f\r]/g;function gW(e){return typeof e=="object"?e.type==="text"?Ek(e.value):!1:Ek(e)}function Ek(e){return e.replace(mW,"")===""}var pl={},rb,vk;function bW(){if(vk)return rb;vk=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,n=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,i=/^:\s*/,a=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,l=/^[;\s]*/,c=/^\s+|\s+$/g,d=`
577
+ `,f="/",g="*",h="",b="comment",x="declaration";function v(k,C){if(typeof k!="string")throw new TypeError("First argument must be a string");if(!k)return[];C=C||{};var N=1,A=1;function R(W){var V=W.match(t);V&&(N+=V.length);var H=W.lastIndexOf(d);A=~H?W.length-H:A+W.length}function M(){var W={line:N,column:A};return function(V){return V.position=new _(W),U(),V}}function _(W){this.start=W,this.end={line:N,column:A},this.source=C.source}_.prototype.content=k;function D(W){var V=new Error(C.source+":"+N+":"+A+": "+W);if(V.reason=W,V.filename=C.source,V.line=N,V.column=A,V.source=k,!C.silent)throw V}function I(W){var V=W.exec(k);if(V){var H=V[0];return R(H),k=k.slice(H.length),V}}function U(){I(n)}function j(W){var V;for(W=W||[];V=X();)V!==!1&&W.push(V);return W}function X(){var W=M();if(!(f!=k.charAt(0)||g!=k.charAt(1))){for(var V=2;h!=k.charAt(V)&&(g!=k.charAt(V)||f!=k.charAt(V+1));)++V;if(V+=2,h===k.charAt(V-1))return D("End of comment missing");var H=k.slice(2,V-2);return A+=2,R(H),k=k.slice(V),A+=2,W({type:b,comment:H})}}function K(){var W=M(),V=I(r);if(V){if(X(),!I(i))return D("property missing ':'");var H=I(a),q=W({type:x,property:w(V[0].replace(e,h)),value:H?w(H[0].replace(e,h)):h});return I(l),q}}function F(){var W=[];j(W);for(var V;V=K();)V!==!1&&(W.push(V),j(W));return W}return U(),F()}function w(k){return k?k.replace(c,h):h}return rb=v,rb}var Tk;function xW(){if(Tk)return pl;Tk=1;var e=pl&&pl.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(pl,"__esModule",{value:!0}),pl.default=n;const t=e(bW());function n(r,i){let a=null;if(!r||typeof r!="string")return a;const l=(0,t.default)(r),c=typeof i=="function";return l.forEach(d=>{if(d.type!=="declaration")return;const{property:f,value:g}=d;c?i(f,g,d):g&&(a=a||{},a[f]=g)}),a}return pl}var oc={},Sk;function yW(){if(Sk)return oc;Sk=1,Object.defineProperty(oc,"__esModule",{value:!0}),oc.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,t=/-([a-z])/g,n=/^[^-]+$/,r=/^-(webkit|moz|ms|o|khtml)-/,i=/^-(ms)-/,a=function(f){return!f||n.test(f)||e.test(f)},l=function(f,g){return g.toUpperCase()},c=function(f,g){return"".concat(g,"-")},d=function(f,g){return g===void 0&&(g={}),a(f)?f:(f=f.toLowerCase(),g.reactCompat?f=f.replace(i,c):f=f.replace(r,c),f.replace(t,l))};return oc.camelCase=d,oc}var lc,Ck;function EW(){if(Ck)return lc;Ck=1;var e=lc&&lc.__importDefault||function(i){return i&&i.__esModule?i:{default:i}},t=e(xW()),n=yW();function r(i,a){var l={};return!i||typeof i!="string"||(0,t.default)(i,function(c,d){c&&d&&(l[(0,n.camelCase)(c,a)]=d)}),l}return r.default=r,lc=r,lc}var vW=EW();const TW=tp(vW);function Ic(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?kk(e.position):"start"in e||"end"in e?kk(e):"line"in e||"column"in e?a1(e):""}function a1(e){return wk(e&&e.line)+":"+wk(e&&e.column)}function kk(e){return a1(e&&e.start)+"-"+a1(e&&e.end)}function wk(e){return e&&typeof e=="number"?e:1}class ur extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let i="",a={},l=!1;if(n&&("line"in n&&"column"in n?a={place:n}:"start"in n&&"end"in n?a={place:n}:"type"in n?a={ancestors:[n],place:n.position}:a={...n}),typeof t=="string"?i=t:!a.cause&&t&&(l=!0,i=t.message,a.cause=t),!a.ruleId&&!a.source&&typeof r=="string"){const d=r.indexOf(":");d===-1?a.ruleId=r:(a.source=r.slice(0,d),a.ruleId=r.slice(d+1))}if(!a.place&&a.ancestors&&a.ancestors){const d=a.ancestors[a.ancestors.length-1];d&&(a.place=d.position)}const c=a.place&&"start"in a.place?a.place.start:a.place;this.ancestors=a.ancestors||void 0,this.cause=a.cause||void 0,this.column=c?c.column:void 0,this.fatal=void 0,this.file="",this.message=i,this.line=c?c.line:void 0,this.name=Ic(a.place)||"1:1",this.place=a.place||void 0,this.reason=this.message,this.ruleId=a.ruleId||void 0,this.source=a.source||void 0,this.stack=l&&a.cause&&typeof a.cause.stack=="string"?a.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}ur.prototype.file="";ur.prototype.name="";ur.prototype.reason="";ur.prototype.message="";ur.prototype.stack="";ur.prototype.column=void 0;ur.prototype.line=void 0;ur.prototype.ancestors=void 0;ur.prototype.cause=void 0;ur.prototype.fatal=void 0;ur.prototype.place=void 0;ur.prototype.ruleId=void 0;ur.prototype.source=void 0;const ry={}.hasOwnProperty,SW=new Map,CW=/[A-Z]/g,kW=new Set(["table","tbody","thead","tfoot","tr"]),wW=new Set(["td","th"]),a4="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function NW(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let r;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=DW(n,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=LW(n,t.jsx,t.jsxs)}const i={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?ga:id,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},a=o4(i,e,void 0);return a&&typeof a!="string"?a:i.create(e,i.Fragment,{children:a||void 0},void 0)}function o4(e,t,n){if(t.type==="element")return AW(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return _W(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return OW(e,t,n);if(t.type==="mdxjsEsm")return RW(e,t);if(t.type==="root")return IW(e,t,n);if(t.type==="text")return MW(e,t)}function AW(e,t,n){const r=e.schema;let i=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(i=ga,e.schema=i),e.ancestors.push(t);const a=u4(e,t.tagName,!1),l=PW(e,t);let c=iy(e,t);return kW.has(t.tagName)&&(c=c.filter(function(d){return typeof d=="string"?!gW(d):!0})),l4(e,l,a,t),sy(l,c),e.ancestors.pop(),e.schema=r,e.create(t,a,l,n)}function _W(e,t){if(t.data&&t.data.estree&&e.evaluater){const r=t.data.estree.body[0];return r.type,e.evaluater.evaluateExpression(r.expression)}Kc(e,t.position)}function RW(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Kc(e,t.position)}function OW(e,t,n){const r=e.schema;let i=r;t.name==="svg"&&r.space==="html"&&(i=ga,e.schema=i),e.ancestors.push(t);const a=t.name===null?e.Fragment:u4(e,t.name,!0),l=jW(e,t),c=iy(e,t);return l4(e,l,a,t),sy(l,c),e.ancestors.pop(),e.schema=r,e.create(t,a,l,n)}function IW(e,t,n){const r={};return sy(r,iy(e,t)),e.create(t,e.Fragment,r,n)}function MW(e,t){return t.value}function l4(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function sy(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function LW(e,t,n){return r;function r(i,a,l,c){const f=Array.isArray(l.children)?n:t;return c?f(a,l,c):f(a,l)}}function DW(e,t){return n;function n(r,i,a,l){const c=Array.isArray(a.children),d=js(r);return t(i,a,l,c,{columnNumber:d?d.column-1:void 0,fileName:e,lineNumber:d?d.line:void 0},void 0)}}function PW(e,t){const n={};let r,i;for(i in t.properties)if(i!=="children"&&ry.call(t.properties,i)){const a=BW(e,i,t.properties[i]);if(a){const[l,c]=a;e.tableCellAlignToStyle&&l==="align"&&typeof c=="string"&&wW.has(t.tagName)?r=c:n[l]=c}}if(r){const a=n.style||(n.style={});a[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function jW(e,t){const n={};for(const r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const a=r.data.estree.body[0];a.type;const l=a.expression;l.type;const c=l.properties[0];c.type,Object.assign(n,e.evaluater.evaluateExpression(c.argument))}else Kc(e,t.position);else{const i=r.name;let a;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const c=r.value.data.estree.body[0];c.type,a=e.evaluater.evaluateExpression(c.expression)}else Kc(e,t.position);else a=r.value===null?!0:r.value;n[i]=a}return n}function iy(e,t){const n=[];let r=-1;const i=e.passKeys?new Map:SW;for(;++r<t.children.length;){const a=t.children[r];let l;if(e.passKeys){const d=a.type==="element"?a.tagName:a.type==="mdxJsxFlowElement"||a.type==="mdxJsxTextElement"?a.name:void 0;if(d){const f=i.get(d)||0;l=d+"-"+f,i.set(d,f+1)}}const c=o4(e,a,l);c!==void 0&&n.push(c)}return n}function BW(e,t,n){const r=Bp(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?A_(n):__(n)),r.property==="style"){let i=typeof n=="object"?n:HW(e,String(n));return e.stylePropertyNameCase==="css"&&(i=UW(i)),["style",i]}return[e.elementAttributeNameCase==="react"&&r.space?QF[r.property]||r.property:r.attribute,n]}}function HW(e,t){try{return TW(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const r=n,i=new ur("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:r,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw i.file=e.filePath||void 0,i.url=a4+"#cannot-parse-style-attribute",i}}function u4(e,t,n){let r;if(!n)r={type:"Literal",value:t};else if(t.includes(".")){const i=t.split(".");let a=-1,l;for(;++a<i.length;){const c=yk(i[a])?{type:"Identifier",name:i[a]}:{type:"Literal",value:i[a]};l=l?{type:"MemberExpression",object:l,property:c,computed:!!(a&&c.type==="Literal"),optional:!1}:c}r=l}else r=yk(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const i=r.value;return ry.call(e.components,i)?e.components[i]:i}if(e.evaluater)return e.evaluater.evaluateExpression(r);Kc(e)}function Kc(e,t){const n=new ur("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw n.file=e.filePath||void 0,n.url=a4+"#cannot-handle-mdx-estrees-without-createevaluater",n}function UW(e){const t={};let n;for(n in e)ry.call(e,n)&&(t[zW(n)]=e[n]);return t}function zW(e){let t=e.replace(CW,FW);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function FW(e){return"-"+e.toLowerCase()}const sb={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"]},$W={tokenize:VW};function VW(e){const t=e.attempt(this.parser.constructs.contentInitial,r,i);let n;return t;function r(c){if(c===null){e.consume(c);return}return e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),jt(e,t,"linePrefix")}function i(c){return e.enter("paragraph"),a(c)}function a(c){const d=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=d),n=d,l(c)}function l(c){if(c===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(c);return}return st(c)?(e.consume(c),e.exit("chunkText"),a):(e.consume(c),l)}}const qW={tokenize:YW},Nk={tokenize:GW};function YW(e){const t=this,n=[];let r=0,i,a,l;return c;function c(A){if(r<n.length){const R=n[r];return t.containerState=R[1],e.attempt(R[0].continuation,d,f)(A)}return f(A)}function d(A){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&N();const R=t.events.length;let M=R,_;for(;M--;)if(t.events[M][0]==="exit"&&t.events[M][1].type==="chunkFlow"){_=t.events[M][1].end;break}C(r);let D=R;for(;D<t.events.length;)t.events[D][1].end={..._},D++;return $r(t.events,M+1,0,t.events.slice(R)),t.events.length=D,f(A)}return c(A)}function f(A){if(r===n.length){if(!i)return b(A);if(i.currentConstruct&&i.currentConstruct.concrete)return v(A);t.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(Nk,g,h)(A)}function g(A){return i&&N(),C(r),b(A)}function h(A){return t.parser.lazy[t.now().line]=r!==n.length,l=t.now().offset,v(A)}function b(A){return t.containerState={},e.attempt(Nk,x,v)(A)}function x(A){return r++,n.push([t.currentConstruct,t.containerState]),b(A)}function v(A){if(A===null){i&&N(),C(0),e.consume(A);return}return i=i||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:i,contentType:"flow",previous:a}),w(A)}function w(A){if(A===null){k(e.exit("chunkFlow"),!0),C(0),e.consume(A);return}return st(A)?(e.consume(A),k(e.exit("chunkFlow")),r=0,t.interrupt=void 0,c):(e.consume(A),w)}function k(A,R){const M=t.sliceStream(A);if(R&&M.push(null),A.previous=a,a&&(a.next=A),a=A,i.defineSkip(A.start),i.write(M),t.parser.lazy[A.start.line]){let _=i.events.length;for(;_--;)if(i.events[_][1].start.offset<l&&(!i.events[_][1].end||i.events[_][1].end.offset>l))return;const D=t.events.length;let I=D,U,j;for(;I--;)if(t.events[I][0]==="exit"&&t.events[I][1].type==="chunkFlow"){if(U){j=t.events[I][1].end;break}U=!0}for(C(r),_=D;_<t.events.length;)t.events[_][1].end={...j},_++;$r(t.events,I+1,0,t.events.slice(D)),t.events.length=_}}function C(A){let R=n.length;for(;R-- >A;){const M=n[R];t.containerState=M[1],M[0].exit.call(t,e)}n.length=A}function N(){i.write([null]),a=void 0,i=void 0,t.containerState._closeFlow=void 0}}function GW(e,t,n){return jt(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}const XW={tokenize:KW};function KW(e){const t=this,n=e.attempt(ud,r,e.attempt(this.parser.constructs.flowInitial,i,jt(e,e.attempt(this.parser.constructs.flow,i,e.attempt(BX,i)),"linePrefix")));return n;function r(a){if(a===null){e.consume(a);return}return e.enter("lineEndingBlank"),e.consume(a),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function i(a){if(a===null){e.consume(a);return}return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const QW={resolveAll:d4()},WW=c4("string"),ZW=c4("text");function c4(e){return{resolveAll:d4(e==="text"?JW:void 0),tokenize:t};function t(n){const r=this,i=this.parser.constructs[e],a=n.attempt(i,l,c);return l;function l(g){return f(g)?a(g):c(g)}function c(g){if(g===null){n.consume(g);return}return n.enter("data"),n.consume(g),d}function d(g){return f(g)?(n.exit("data"),a(g)):(n.consume(g),d)}function f(g){if(g===null)return!0;const h=i[g];let b=-1;if(h)for(;++b<h.length;){const x=h[b];if(!x.previous||x.previous.call(r,r.previous))return!0}return!1}}}function d4(e){return t;function t(n,r){let i=-1,a;for(;++i<=n.length;)a===void 0?n[i]&&n[i][1].type==="data"&&(a=i,i++):(!n[i]||n[i][1].type!=="data")&&(i!==a+2&&(n[a][1].end=n[i-1][1].end,n.splice(a+2,i-a-2),i=a+2),a=void 0);return e?e(n,r):n}}function JW(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type==="lineEnding")&&e[n-1][1].type==="data"){const r=e[n-1][1],i=t.sliceStream(r);let a=i.length,l=-1,c=0,d;for(;a--;){const f=i[a];if(typeof f=="string"){for(l=f.length;f.charCodeAt(l-1)===32;)c++,l--;if(l)break;l=-1}else if(f===-2)d=!0,c++;else if(f!==-1){a++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(c=0),c){const f={type:n===e.length||d||c<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:a?l:r.start._bufferIndex+l,_index:r.start._index+a,line:r.end.line,column:r.end.column-c,offset:r.end.offset-c},end:{...r.end}};r.end={...f.start},r.start.offset===r.end.offset?Object.assign(r,f):(e.splice(n,0,["enter",f,t],["exit",f,t]),n+=2)}n++}return e}const eZ={42:Ar,43:Ar,45:Ar,48:Ar,49:Ar,50:Ar,51:Ar,52:Ar,53:Ar,54:Ar,55:Ar,56:Ar,57:Ar,62:VR},tZ={91:$X},nZ={[-2]:eb,[-1]:eb,32:eb},rZ={35:KX,42:Eh,45:[fk,Eh],60:JX,61:fk,95:Eh,96:ck,126:ck},sZ={38:YR,92:qR},iZ={[-5]:tb,[-4]:tb,[-3]:tb,33:bK,38:YR,42:i1,60:[yX,aK],91:yK,92:[GX,qR],93:ey,95:i1,96:IX},aZ={null:[i1,QW]},oZ={null:[42,95]},lZ={null:[]},uZ=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:oZ,contentInitial:tZ,disable:lZ,document:eZ,flow:rZ,flowInitial:nZ,insideSpan:aZ,string:sZ,text:iZ},Symbol.toStringTag,{value:"Module"}));function cZ(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const i={},a=[];let l=[],c=[];const d={attempt:D(M),check:D(_),consume:N,enter:A,exit:R,interrupt:D(_,{interrupt:!0})},f={code:null,containerState:{},defineSkip:w,events:[],now:v,parser:e,previous:null,sliceSerialize:b,sliceStream:x,write:h};let g=t.tokenize.call(f,d);return t.resolveAll&&a.push(t),f;function h(X){return l=ss(l,X),k(),l[l.length-1]!==null?[]:(I(t,0),f.events=qp(a,f.events,f),f.events)}function b(X,K){return fZ(x(X),K)}function x(X){return dZ(l,X)}function v(){const{_bufferIndex:X,_index:K,line:F,column:W,offset:V}=r;return{_bufferIndex:X,_index:K,line:F,column:W,offset:V}}function w(X){i[X.line]=X.column,j()}function k(){let X;for(;r._index<l.length;){const K=l[r._index];if(typeof K=="string")for(X=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===X&&r._bufferIndex<K.length;)C(K.charCodeAt(r._bufferIndex));else C(K)}}function C(X){g=g(X)}function N(X){st(X)?(r.line++,r.column=1,r.offset+=X===-3?2:1,j()):X!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===l[r._index].length&&(r._bufferIndex=-1,r._index++)),f.previous=X}function A(X,K){const F=K||{};return F.type=X,F.start=v(),f.events.push(["enter",F,f]),c.push(F),F}function R(X){const K=c.pop();return K.end=v(),f.events.push(["exit",K,f]),K}function M(X,K){I(X,K.from)}function _(X,K){K.restore()}function D(X,K){return F;function F(W,V,H){let q,J,ue,L;return Array.isArray(W)?G(W):"tokenize"in W?G([W]):B(W);function B(ce){return de;function de(he){const ve=he!==null&&ce[he],Fe=he!==null&&ce.null,Le=[...Array.isArray(ve)?ve:ve?[ve]:[],...Array.isArray(Fe)?Fe:Fe?[Fe]:[]];return G(Le)(he)}}function G(ce){return q=ce,J=0,ce.length===0?H:P(ce[J])}function P(ce){return de;function de(he){return L=U(),ue=ce,ce.partial||(f.currentConstruct=ce),ce.name&&f.parser.constructs.disable.null.includes(ce.name)?ie():ce.tokenize.call(K?Object.assign(Object.create(f),K):f,d,ae,ie)(he)}}function ae(ce){return X(ue,L),V}function ie(ce){return L.restore(),++J<q.length?P(q[J]):H}}}function I(X,K){X.resolveAll&&!a.includes(X)&&a.push(X),X.resolve&&$r(f.events,K,f.events.length-K,X.resolve(f.events.slice(K),f)),X.resolveTo&&(f.events=X.resolveTo(f.events,f))}function U(){const X=v(),K=f.previous,F=f.currentConstruct,W=f.events.length,V=Array.from(c);return{from:W,restore:H};function H(){r=X,f.previous=K,f.currentConstruct=F,f.events.length=W,c=V,j()}}function j(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function dZ(e,t){const n=t.start._index,r=t.start._bufferIndex,i=t.end._index,a=t.end._bufferIndex;let l;if(n===i)l=[e[n].slice(r,a)];else{if(l=e.slice(n,i),r>-1){const c=l[0];typeof c=="string"?l[0]=c.slice(r):l.shift()}a>0&&l.push(e[i].slice(0,a))}return l}function fZ(e,t){let n=-1;const r=[];let i;for(;++n<e.length;){const a=e[n];let l;if(typeof a=="string")l=a;else switch(a){case-5:{l="\r";break}case-4:{l=`
578
+ `;break}case-3:{l=`\r
579
+ `;break}case-2:{l=t?" ":" ";break}case-1:{if(!t&&i)continue;l=" ";break}default:l=String.fromCharCode(a)}i=a===-2,r.push(l)}return r.join("")}function hZ(e){const r={constructs:DR([uZ,...(e||{}).extensions||[]]),content:i($W),defined:[],document:i(qW),flow:i(XW),lazy:{},string:i(WW),text:i(ZW)};return r;function i(a){return l;function l(c){return cZ(r,a,c)}}}function pZ(e){for(;!GR(e););return e}const Ak=/[\0\t\n\r]/g;function mZ(){let e=1,t="",n=!0,r;return i;function i(a,l,c){const d=[];let f,g,h,b,x;for(a=t+(typeof a=="string"?a.toString():new TextDecoder(l||void 0).decode(a)),h=0,t="",n&&(a.charCodeAt(0)===65279&&h++,n=void 0);h<a.length;){if(Ak.lastIndex=h,f=Ak.exec(a),b=f&&f.index!==void 0?f.index:a.length,x=a.charCodeAt(b),!f){t=a.slice(h);break}if(x===10&&h===b&&r)d.push(-3),r=void 0;else switch(r&&(d.push(-5),r=void 0),h<b&&(d.push(a.slice(h,b)),e+=b-h),x){case 0:{d.push(65533),e++;break}case 9:{for(g=Math.ceil(e/4)*4,d.push(-2);e++<g;)d.push(-1);break}case 10:{d.push(-4),e=1;break}default:r=!0,e=1}h=b+1}return c&&(r&&d.push(-5),t&&d.push(t),d.push(null)),d}}const f4={}.hasOwnProperty;function gZ(e,t,n){return t&&typeof t=="object"&&(n=t,t=void 0),bZ(n)(pZ(hZ(n).document().write(mZ()(e,t,!0))))}function bZ(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:a(ye),autolinkProtocol:U,autolinkEmail:U,atxHeading:a(Xe),blockQuote:a(Fe),characterEscape:U,characterReference:U,codeFenced:a(Le),codeFencedFenceInfo:l,codeFencedFenceMeta:l,codeIndented:a(Le,l),codeText:a(Ee,l),codeTextData:U,data:U,codeFlowValue:U,definition:a(Oe),definitionDestinationString:l,definitionLabelString:l,definitionTitleString:l,emphasis:a(Ue),hardBreakEscape:a(qe),hardBreakTrailing:a(qe),htmlFlow:a(De,l),htmlFlowData:U,htmlText:a(De,l),htmlTextData:U,image:a(ke),label:l,link:a(ye),listItem:a(Pe),listItemValue:b,listOrdered:a(Re,h),listUnordered:a(Re),paragraph:a(ee),reference:P,referenceString:l,resourceDestinationString:l,resourceTitleString:l,setextHeading:a(Xe),strong:a(pe),thematicBreak:a(re)},exit:{atxHeading:d(),atxHeadingSequence:M,autolink:d(),autolinkEmail:ve,autolinkProtocol:he,blockQuote:d(),characterEscapeValue:j,characterReferenceMarkerHexadecimal:ie,characterReferenceMarkerNumeric:ie,characterReferenceValue:ce,characterReference:de,codeFenced:d(k),codeFencedFence:w,codeFencedFenceInfo:x,codeFencedFenceMeta:v,codeFlowValue:j,codeIndented:d(C),codeText:d(V),codeTextData:j,data:j,definition:d(),definitionDestinationString:R,definitionLabelString:N,definitionTitleString:A,emphasis:d(),hardBreakEscape:d(K),hardBreakTrailing:d(K),htmlFlow:d(F),htmlFlowData:j,htmlText:d(W),htmlTextData:j,image:d(q),label:ue,labelText:J,lineEnding:X,link:d(H),listItem:d(),listOrdered:d(),listUnordered:d(),paragraph:d(),referenceString:ae,resourceDestinationString:L,resourceTitleString:B,resource:G,setextHeading:d(I),setextHeadingLineSequence:D,setextHeadingText:_,strong:d(),thematicBreak:d()}};h4(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(Q){let $={type:"root",children:[]};const oe={stack:[$],tokenStack:[],config:t,enter:c,exit:f,buffer:l,resume:g,data:n},Se=[];let _e=-1;for(;++_e<Q.length;)if(Q[_e][1].type==="listOrdered"||Q[_e][1].type==="listUnordered")if(Q[_e][0]==="enter")Se.push(_e);else{const $e=Se.pop();_e=i(Q,$e,_e)}for(_e=-1;++_e<Q.length;){const $e=t[Q[_e][0]];f4.call($e,Q[_e][1].type)&&$e[Q[_e][1].type].call(Object.assign({sliceSerialize:Q[_e][2].sliceSerialize},oe),Q[_e][1])}if(oe.tokenStack.length>0){const $e=oe.tokenStack[oe.tokenStack.length-1];($e[1]||_k).call(oe,void 0,$e[0])}for($.position={start:Yi(Q.length>0?Q[0][1].start:{line:1,column:1,offset:0}),end:Yi(Q.length>0?Q[Q.length-2][1].end:{line:1,column:1,offset:0})},_e=-1;++_e<t.transforms.length;)$=t.transforms[_e]($)||$;return $}function i(Q,$,oe){let Se=$-1,_e=-1,$e=!1,ot,et,dt,ut;for(;++Se<=oe;){const Ve=Q[Se];switch(Ve[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{Ve[0]==="enter"?_e++:_e--,ut=void 0;break}case"lineEndingBlank":{Ve[0]==="enter"&&(ot&&!ut&&!_e&&!dt&&(dt=Se),ut=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:ut=void 0}if(!_e&&Ve[0]==="enter"&&Ve[1].type==="listItemPrefix"||_e===-1&&Ve[0]==="exit"&&(Ve[1].type==="listUnordered"||Ve[1].type==="listOrdered")){if(ot){let Rt=Se;for(et=void 0;Rt--;){const Pt=Q[Rt];if(Pt[1].type==="lineEnding"||Pt[1].type==="lineEndingBlank"){if(Pt[0]==="exit")continue;et&&(Q[et][1].type="lineEndingBlank",$e=!0),Pt[1].type="lineEnding",et=Rt}else if(!(Pt[1].type==="linePrefix"||Pt[1].type==="blockQuotePrefix"||Pt[1].type==="blockQuotePrefixWhitespace"||Pt[1].type==="blockQuoteMarker"||Pt[1].type==="listItemIndent"))break}dt&&(!et||dt<et)&&(ot._spread=!0),ot.end=Object.assign({},et?Q[et][1].start:Ve[1].end),Q.splice(et||Se,0,["exit",ot,Ve[2]]),Se++,oe++}if(Ve[1].type==="listItemPrefix"){const Rt={type:"listItem",_spread:!1,start:Object.assign({},Ve[1].start),end:void 0};ot=Rt,Q.splice(Se,0,["enter",Rt,Ve[2]]),Se++,oe++,dt=void 0,ut=!0}}}return Q[$][1]._spread=$e,oe}function a(Q,$){return oe;function oe(Se){c.call(this,Q(Se),Se),$&&$.call(this,Se)}}function l(){this.stack.push({type:"fragment",children:[]})}function c(Q,$,oe){this.stack[this.stack.length-1].children.push(Q),this.stack.push(Q),this.tokenStack.push([$,oe||void 0]),Q.position={start:Yi($.start),end:void 0}}function d(Q){return $;function $(oe){Q&&Q.call(this,oe),f.call(this,oe)}}function f(Q,$){const oe=this.stack.pop(),Se=this.tokenStack.pop();if(Se)Se[0].type!==Q.type&&($?$.call(this,Q,Se[0]):(Se[1]||_k).call(this,Q,Se[0]));else throw new Error("Cannot close `"+Q.type+"` ("+Ic({start:Q.start,end:Q.end})+"): it’s not open");oe.position.end=Yi(Q.end)}function g(){return Qx(this.stack.pop())}function h(){this.data.expectingFirstListItemValue=!0}function b(Q){if(this.data.expectingFirstListItemValue){const $=this.stack[this.stack.length-2];$.start=Number.parseInt(this.sliceSerialize(Q),10),this.data.expectingFirstListItemValue=void 0}}function x(){const Q=this.resume(),$=this.stack[this.stack.length-1];$.lang=Q}function v(){const Q=this.resume(),$=this.stack[this.stack.length-1];$.meta=Q}function w(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function k(){const Q=this.resume(),$=this.stack[this.stack.length-1];$.value=Q.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function C(){const Q=this.resume(),$=this.stack[this.stack.length-1];$.value=Q.replace(/(\r?\n|\r)$/g,"")}function N(Q){const $=this.resume(),oe=this.stack[this.stack.length-1];oe.label=$,oe.identifier=hs(this.sliceSerialize(Q)).toLowerCase()}function A(){const Q=this.resume(),$=this.stack[this.stack.length-1];$.title=Q}function R(){const Q=this.resume(),$=this.stack[this.stack.length-1];$.url=Q}function M(Q){const $=this.stack[this.stack.length-1];if(!$.depth){const oe=this.sliceSerialize(Q).length;$.depth=oe}}function _(){this.data.setextHeadingSlurpLineEnding=!0}function D(Q){const $=this.stack[this.stack.length-1];$.depth=this.sliceSerialize(Q).codePointAt(0)===61?1:2}function I(){this.data.setextHeadingSlurpLineEnding=void 0}function U(Q){const oe=this.stack[this.stack.length-1].children;let Se=oe[oe.length-1];(!Se||Se.type!=="text")&&(Se=se(),Se.position={start:Yi(Q.start),end:void 0},oe.push(Se)),this.stack.push(Se)}function j(Q){const $=this.stack.pop();$.value+=this.sliceSerialize(Q),$.position.end=Yi(Q.end)}function X(Q){const $=this.stack[this.stack.length-1];if(this.data.atHardBreak){const oe=$.children[$.children.length-1];oe.position.end=Yi(Q.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes($.type)&&(U.call(this,Q),j.call(this,Q))}function K(){this.data.atHardBreak=!0}function F(){const Q=this.resume(),$=this.stack[this.stack.length-1];$.value=Q}function W(){const Q=this.resume(),$=this.stack[this.stack.length-1];$.value=Q}function V(){const Q=this.resume(),$=this.stack[this.stack.length-1];$.value=Q}function H(){const Q=this.stack[this.stack.length-1];if(this.data.inReference){const $=this.data.referenceType||"shortcut";Q.type+="Reference",Q.referenceType=$,delete Q.url,delete Q.title}else delete Q.identifier,delete Q.label;this.data.referenceType=void 0}function q(){const Q=this.stack[this.stack.length-1];if(this.data.inReference){const $=this.data.referenceType||"shortcut";Q.type+="Reference",Q.referenceType=$,delete Q.url,delete Q.title}else delete Q.identifier,delete Q.label;this.data.referenceType=void 0}function J(Q){const $=this.sliceSerialize(Q),oe=this.stack[this.stack.length-2];oe.label=$G($),oe.identifier=hs($).toLowerCase()}function ue(){const Q=this.stack[this.stack.length-1],$=this.resume(),oe=this.stack[this.stack.length-1];if(this.data.inReference=!0,oe.type==="link"){const Se=Q.children;oe.children=Se}else oe.alt=$}function L(){const Q=this.resume(),$=this.stack[this.stack.length-1];$.url=Q}function B(){const Q=this.resume(),$=this.stack[this.stack.length-1];$.title=Q}function G(){this.data.inReference=void 0}function P(){this.data.referenceType="collapsed"}function ae(Q){const $=this.resume(),oe=this.stack[this.stack.length-1];oe.label=$,oe.identifier=hs(this.sliceSerialize(Q)).toLowerCase(),this.data.referenceType="full"}function ie(Q){this.data.characterReferenceType=Q.type}function ce(Q){const $=this.sliceSerialize(Q),oe=this.data.characterReferenceType;let Se;oe?(Se=LR($,oe==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):Se=Zx($);const _e=this.stack[this.stack.length-1];_e.value+=Se}function de(Q){const $=this.stack.pop();$.position.end=Yi(Q.end)}function he(Q){j.call(this,Q);const $=this.stack[this.stack.length-1];$.url=this.sliceSerialize(Q)}function ve(Q){j.call(this,Q);const $=this.stack[this.stack.length-1];$.url="mailto:"+this.sliceSerialize(Q)}function Fe(){return{type:"blockquote",children:[]}}function Le(){return{type:"code",lang:null,meta:null,value:""}}function Ee(){return{type:"inlineCode",value:""}}function Oe(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function Ue(){return{type:"emphasis",children:[]}}function Xe(){return{type:"heading",depth:0,children:[]}}function qe(){return{type:"break"}}function De(){return{type:"html",value:""}}function ke(){return{type:"image",title:null,url:"",alt:null}}function ye(){return{type:"link",title:null,url:"",children:[]}}function Re(Q){return{type:"list",ordered:Q.type==="listOrdered",start:null,spread:Q._spread,children:[]}}function Pe(Q){return{type:"listItem",spread:Q._spread,checked:null,children:[]}}function ee(){return{type:"paragraph",children:[]}}function pe(){return{type:"strong",children:[]}}function se(){return{type:"text",value:""}}function re(){return{type:"thematicBreak"}}}function Yi(e){return{line:e.line,column:e.column,offset:e.offset}}function h4(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?h4(e,r):xZ(e,r)}}function xZ(e,t){let n;for(n in t)if(f4.call(t,n))switch(n){case"canContainEols":{const r=t[n];r&&e[n].push(...r);break}case"transforms":{const r=t[n];r&&e[n].push(...r);break}case"enter":case"exit":{const r=t[n];r&&Object.assign(e[n],r);break}}}function _k(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+Ic({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+Ic({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+Ic({start:t.start,end:t.end})+") is still open")}function yZ(e){const t=this;t.parser=n;function n(r){return gZ(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function EZ(e,t){const n={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function vZ(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
580
+ `}]}function TZ(e,t){const n=t.value?t.value+`
581
+ `:"",r={},i=t.lang?t.lang.split(/\s+/):[];i.length>0&&(r.className=["language-"+i[0]]);let a={type:"element",tagName:"code",properties:r,children:[{type:"text",value:n}]};return t.meta&&(a.data={meta:t.meta}),e.patch(t,a),a=e.applyData(t,a),a={type:"element",tagName:"pre",properties:{},children:[a]},e.patch(t,a),a}function SZ(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function CZ(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function kZ(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),i=nu(r.toLowerCase()),a=e.footnoteOrder.indexOf(r);let l,c=e.footnoteCounts.get(r);c===void 0?(c=0,e.footnoteOrder.push(r),l=e.footnoteOrder.length):l=a+1,c+=1,e.footnoteCounts.set(r,c);const d={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+i,id:n+"fnref-"+i+(c>1?"-"+c:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(l)}]};e.patch(t,d);const f={type:"element",tagName:"sup",properties:{},children:[d]};return e.patch(t,f),e.applyData(t,f)}function wZ(e,t){const n={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function NZ(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function p4(e,t){const n=t.referenceType;let r="]";if(n==="collapsed"?r+="[]":n==="full"&&(r+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return[{type:"text",value:"!["+t.alt+r}];const i=e.all(t),a=i[0];a&&a.type==="text"?a.value="["+a.value:i.unshift({type:"text",value:"["});const l=i[i.length-1];return l&&l.type==="text"?l.value+=r:i.push({type:"text",value:r}),i}function AZ(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return p4(e,t);const i={src:nu(r.url||""),alt:t.alt};r.title!==null&&r.title!==void 0&&(i.title=r.title);const a={type:"element",tagName:"img",properties:i,children:[]};return e.patch(t,a),e.applyData(t,a)}function _Z(e,t){const n={src:nu(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)}function RZ(e,t){const n={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,n);const r={type:"element",tagName:"code",properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)}function OZ(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return p4(e,t);const i={href:nu(r.url||"")};r.title!==null&&r.title!==void 0&&(i.title=r.title);const a={type:"element",tagName:"a",properties:i,children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}function IZ(e,t){const n={href:nu(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function MZ(e,t,n){const r=e.all(t),i=n?LZ(n):m4(t),a={},l=[];if(typeof t.checked=="boolean"){const g=r[0];let h;g&&g.type==="element"&&g.tagName==="p"?h=g:(h={type:"element",tagName:"p",properties:{},children:[]},r.unshift(h)),h.children.length>0&&h.children.unshift({type:"text",value:" "}),h.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),a.className=["task-list-item"]}let c=-1;for(;++c<r.length;){const g=r[c];(i||c!==0||g.type!=="element"||g.tagName!=="p")&&l.push({type:"text",value:`
582
+ `}),g.type==="element"&&g.tagName==="p"&&!i?l.push(...g.children):l.push(g)}const d=r[r.length-1];d&&(i||d.type!=="element"||d.tagName!=="p")&&l.push({type:"text",value:`
583
+ `});const f={type:"element",tagName:"li",properties:a,children:l};return e.patch(t,f),e.applyData(t,f)}function LZ(e){let t=!1;if(e.type==="list"){t=e.spread||!1;const n=e.children;let r=-1;for(;!t&&++r<n.length;)t=m4(n[r])}return t}function m4(e){const t=e.spread;return t??e.children.length>1}function DZ(e,t){const n={},r=e.all(t);let i=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++i<r.length;){const l=r[i];if(l.type==="element"&&l.tagName==="li"&&l.properties&&Array.isArray(l.properties.className)&&l.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}const a={type:"element",tagName:t.ordered?"ol":"ul",properties:n,children:e.wrap(r,!0)};return e.patch(t,a),e.applyData(t,a)}function PZ(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function jZ(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function BZ(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function HZ(e,t){const n=e.all(t),r=n.shift(),i=[];if(r){const l={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],l),i.push(l)}if(n.length>0){const l={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},c=js(t.children[1]),d=$p(t.children[t.children.length-1]);c&&d&&(l.position={start:c,end:d}),i.push(l)}const a={type:"element",tagName:"table",properties:{},children:e.wrap(i,!0)};return e.patch(t,a),e.applyData(t,a)}function UZ(e,t,n){const r=n?n.children:void 0,a=(r?r.indexOf(t):1)===0?"th":"td",l=n&&n.type==="table"?n.align:void 0,c=l?l.length:t.children.length;let d=-1;const f=[];for(;++d<c;){const h=t.children[d],b={},x=l?l[d]:void 0;x&&(b.align=x);let v={type:"element",tagName:a,properties:b,children:[]};h&&(v.children=e.all(h),e.patch(h,v),v=e.applyData(h,v)),f.push(v)}const g={type:"element",tagName:"tr",properties:{},children:e.wrap(f,!0)};return e.patch(t,g),e.applyData(t,g)}function zZ(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const Rk=9,Ok=32;function FZ(e){const t=String(e),n=/\r?\n|\r/g;let r=n.exec(t),i=0;const a=[];for(;r;)a.push(Ik(t.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return a.push(Ik(t.slice(i),i>0,!1)),a.join("")}function Ik(e,t,n){let r=0,i=e.length;if(t){let a=e.codePointAt(r);for(;a===Rk||a===Ok;)r++,a=e.codePointAt(r)}if(n){let a=e.codePointAt(i-1);for(;a===Rk||a===Ok;)i--,a=e.codePointAt(i-1)}return i>r?e.slice(r,i):""}function $Z(e,t){const n={type:"text",value:FZ(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function VZ(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const qZ={blockquote:EZ,break:vZ,code:TZ,delete:SZ,emphasis:CZ,footnoteReference:kZ,heading:wZ,html:NZ,imageReference:AZ,image:_Z,inlineCode:RZ,linkReference:OZ,link:IZ,listItem:MZ,list:DZ,paragraph:PZ,root:jZ,strong:BZ,table:HZ,tableCell:zZ,tableRow:UZ,text:$Z,thematicBreak:VZ,toml:eh,yaml:eh,definition:eh,footnoteDefinition:eh};function eh(){}function YZ(e,t){const n=[{type:"text",value:"↩"}];return t>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),n}function GZ(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function XZ(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||YZ,r=e.options.footnoteBackLabel||GZ,i=e.options.footnoteLabel||"Footnotes",a=e.options.footnoteLabelTagName||"h2",l=e.options.footnoteLabelProperties||{className:["sr-only"]},c=[];let d=-1;for(;++d<e.footnoteOrder.length;){const f=e.footnoteById.get(e.footnoteOrder[d]);if(!f)continue;const g=e.all(f),h=String(f.identifier).toUpperCase(),b=nu(h.toLowerCase());let x=0;const v=[],w=e.footnoteCounts.get(h);for(;w!==void 0&&++x<=w;){v.length>0&&v.push({type:"text",value:" "});let N=typeof n=="string"?n:n(d,x);typeof N=="string"&&(N={type:"text",value:N}),v.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+b+(x>1?"-"+x:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(d,x),className:["data-footnote-backref"]},children:Array.isArray(N)?N:[N]})}const k=g[g.length-1];if(k&&k.type==="element"&&k.tagName==="p"){const N=k.children[k.children.length-1];N&&N.type==="text"?N.value+=" ":k.children.push({type:"text",value:" "}),k.children.push(...v)}else g.push(...v);const C={type:"element",tagName:"li",properties:{id:t+"fn-"+b},children:e.wrap(g,!0)};e.patch(f,C),c.push(C)}if(c.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:a,properties:{...po(l),id:"footnote-label"},children:[{type:"text",value:i}]},{type:"text",value:`
584
+ `},{type:"element",tagName:"ol",properties:{},children:e.wrap(c,!0)},{type:"text",value:`
585
+ `}]}}const o1={}.hasOwnProperty,KZ={};function QZ(e,t){const n=t||KZ,r=new Map,i=new Map,a=new Map,l={...qZ,...n.handlers},c={all:f,applyData:ZZ,definitionById:r,footnoteById:i,footnoteCounts:a,footnoteOrder:[],handlers:l,one:d,options:n,patch:WZ,wrap:eJ};return Ps(e,function(g){if(g.type==="definition"||g.type==="footnoteDefinition"){const h=g.type==="definition"?r:i,b=String(g.identifier).toUpperCase();h.has(b)||h.set(b,g)}}),c;function d(g,h){const b=g.type,x=c.handlers[b];if(o1.call(c.handlers,b)&&x)return x(c,g,h);if(c.options.passThrough&&c.options.passThrough.includes(b)){if("children"in g){const{children:w,...k}=g,C=po(k);return C.children=c.all(g),C}return po(g)}return(c.options.unknownHandler||JZ)(c,g,h)}function f(g){const h=[];if("children"in g){const b=g.children;let x=-1;for(;++x<b.length;){const v=c.one(b[x],g);if(v){if(x&&b[x-1].type==="break"&&(!Array.isArray(v)&&v.type==="text"&&(v.value=Mk(v.value)),!Array.isArray(v)&&v.type==="element")){const w=v.children[0];w&&w.type==="text"&&(w.value=Mk(w.value))}Array.isArray(v)?h.push(...v):h.push(v)}}}return h}}function WZ(e,t){e.position&&(t.position=uR(e))}function ZZ(e,t){let n=t;if(e&&e.data){const r=e.data.hName,i=e.data.hChildren,a=e.data.hProperties;if(typeof r=="string")if(n.type==="element")n.tagName=r;else{const l="children"in n?n.children:[n];n={type:"element",tagName:r,properties:{},children:l}}n.type==="element"&&a&&Object.assign(n.properties,po(a)),"children"in n&&n.children&&i!==null&&i!==void 0&&(n.children=i)}return n}function JZ(e,t){const n=t.data||{},r="value"in t&&!(o1.call(n,"hProperties")||o1.call(n,"hChildren"))?{type:"text",value:t.value}:{type:"element",tagName:"div",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function eJ(e,t){const n=[];let r=-1;for(t&&n.push({type:"text",value:`
586
+ `});++r<e.length;)r&&n.push({type:"text",value:`
587
+ `}),n.push(e[r]);return t&&e.length>0&&n.push({type:"text",value:`
588
+ `}),n}function Mk(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function Lk(e,t){const n=QZ(e,t),r=n.one(e,void 0),i=XZ(n),a=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return i&&a.children.push({type:"text",value:`
589
+ `},i),a}function tJ(e,t){return e&&"run"in e?async function(n,r){const i=Lk(n,{file:r,...t});await e.run(i,r)}:function(n,r){return Lk(n,{file:r,...e||t})}}function Dk(e){if(e)throw e}var ib,Pk;function nJ(){if(Pk)return ib;Pk=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,i=function(f){return typeof Array.isArray=="function"?Array.isArray(f):t.call(f)==="[object Array]"},a=function(f){if(!f||t.call(f)!=="[object Object]")return!1;var g=e.call(f,"constructor"),h=f.constructor&&f.constructor.prototype&&e.call(f.constructor.prototype,"isPrototypeOf");if(f.constructor&&!g&&!h)return!1;var b;for(b in f);return typeof b>"u"||e.call(f,b)},l=function(f,g){n&&g.name==="__proto__"?n(f,g.name,{enumerable:!0,configurable:!0,value:g.newValue,writable:!0}):f[g.name]=g.newValue},c=function(f,g){if(g==="__proto__")if(e.call(f,g)){if(r)return r(f,g).value}else return;return f[g]};return ib=function d(){var f,g,h,b,x,v,w=arguments[0],k=1,C=arguments.length,N=!1;for(typeof w=="boolean"&&(N=w,w=arguments[1]||{},k=2),(w==null||typeof w!="object"&&typeof w!="function")&&(w={});k<C;++k)if(f=arguments[k],f!=null)for(g in f)h=c(w,g),b=c(f,g),w!==b&&(N&&b&&(a(b)||(x=i(b)))?(x?(x=!1,v=h&&i(h)?h:[]):v=h&&a(h)?h:{},l(w,{name:g,newValue:d(N,v,b)})):typeof b<"u"&&l(w,{name:g,newValue:b}));return w},ib}var rJ=nJ();const ab=tp(rJ);function l1(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function sJ(){const e=[],t={run:n,use:r};return t;function n(...i){let a=-1;const l=i.pop();if(typeof l!="function")throw new TypeError("Expected function as last argument, not "+l);c(null,...i);function c(d,...f){const g=e[++a];let h=-1;if(d){l(d);return}for(;++h<i.length;)(f[h]===null||f[h]===void 0)&&(f[h]=i[h]);i=f,g?iJ(g,c)(...f):l(null,...f)}}function r(i){if(typeof i!="function")throw new TypeError("Expected `middelware` to be a function, not "+i);return e.push(i),t}}function iJ(e,t){let n;return r;function r(...l){const c=e.length>l.length;let d;c&&l.push(i);try{d=e.apply(this,l)}catch(f){const g=f;if(c&&n)throw g;return i(g)}c||(d&&d.then&&typeof d.then=="function"?d.then(a,i):d instanceof Error?i(d):a(d))}function i(l,...c){n||(n=!0,t(l,...c))}function a(l){i(null,l)}}const ks={basename:aJ,dirname:oJ,extname:lJ,join:uJ,sep:"/"};function aJ(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');cd(e);let n=0,r=-1,i=e.length,a;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(a){n=i+1;break}}else r<0&&(a=!0,r=i+1);return r<0?"":e.slice(n,r)}if(t===e)return"";let l=-1,c=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(a){n=i+1;break}}else l<0&&(a=!0,l=i+1),c>-1&&(e.codePointAt(i)===t.codePointAt(c--)?c<0&&(r=i):(c=-1,r=l));return n===r?r=l:r<0&&(r=e.length),e.slice(n,r)}function oJ(e){if(cd(e),e.length===0)return".";let t=-1,n=e.length,r;for(;--n;)if(e.codePointAt(n)===47){if(r){t=n;break}}else r||(r=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function lJ(e){cd(e);let t=e.length,n=-1,r=0,i=-1,a=0,l;for(;t--;){const c=e.codePointAt(t);if(c===47){if(l){r=t+1;break}continue}n<0&&(l=!0,n=t+1),c===46?i<0?i=t:a!==1&&(a=1):i>-1&&(a=-1)}return i<0||n<0||a===0||a===1&&i===n-1&&i===r+1?"":e.slice(i,n)}function uJ(...e){let t=-1,n;for(;++t<e.length;)cd(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":cJ(n)}function cJ(e){cd(e);const t=e.codePointAt(0)===47;let n=dJ(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function dJ(e,t){let n="",r=0,i=-1,a=0,l=-1,c,d;for(;++l<=e.length;){if(l<e.length)c=e.codePointAt(l);else{if(c===47)break;c=47}if(c===47){if(!(i===l-1||a===1))if(i!==l-1&&a===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(d=n.lastIndexOf("/"),d!==n.length-1){d<0?(n="",r=0):(n=n.slice(0,d),r=n.length-1-n.lastIndexOf("/")),i=l,a=0;continue}}else if(n.length>0){n="",r=0,i=l,a=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(i+1,l):n=e.slice(i+1,l),r=l-i-1;i=l,a=0}else c===46&&a>-1?a++:a=-1}return n}function cd(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const fJ={cwd:hJ};function hJ(){return"/"}function u1(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function pJ(e){if(typeof e=="string")e=new URL(e);else if(!u1(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){const t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return mJ(e)}function mJ(e){if(e.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const t=e.pathname;let n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){const r=t.codePointAt(n+2);if(r===70||r===102){const i=new TypeError("File URL path must not include encoded / characters");throw i.code="ERR_INVALID_FILE_URL_PATH",i}}return decodeURIComponent(t)}const ob=["history","path","basename","stem","extname","dirname"];class gJ{constructor(t){let n;t?u1(t)?n={path:t}:typeof t=="string"||bJ(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":fJ.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<ob.length;){const a=ob[r];a in n&&n[a]!==void 0&&n[a]!==null&&(this[a]=a==="history"?[...n[a]]:n[a])}let i;for(i in n)ob.includes(i)||(this[i]=n[i])}get basename(){return typeof this.path=="string"?ks.basename(this.path):void 0}set basename(t){ub(t,"basename"),lb(t,"basename"),this.path=ks.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?ks.dirname(this.path):void 0}set dirname(t){jk(this.basename,"dirname"),this.path=ks.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?ks.extname(this.path):void 0}set extname(t){if(lb(t,"extname"),jk(this.dirname,"extname"),t){if(t.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(t.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=ks.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){u1(t)&&(t=pJ(t)),ub(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?ks.basename(this.path,this.extname):void 0}set stem(t){ub(t,"stem"),lb(t,"stem"),this.path=ks.join(this.dirname||"",t+(this.extname||""))}fail(t,n,r){const i=this.message(t,n,r);throw i.fatal=!0,i}info(t,n,r){const i=this.message(t,n,r);return i.fatal=void 0,i}message(t,n,r){const i=new ur(t,n,r);return this.path&&(i.name=this.path+":"+i.name,i.file=this.path),i.fatal=!1,this.messages.push(i),i}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}}function lb(e,t){if(e&&e.includes(ks.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+ks.sep+"`")}function ub(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function jk(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function bJ(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const xJ=(function(e){const r=this.constructor.prototype,i=r[e],a=function(){return i.apply(a,arguments)};return Object.setPrototypeOf(a,r),a}),yJ={}.hasOwnProperty;class ay extends xJ{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=sJ()}copy(){const t=new ay;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];t.use(...r)}return t.data(ab(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(fb("data",this.frozen),this.namespace[t]=n,this):yJ.call(this.namespace,t)&&this.namespace[t]||void 0:t?(fb("data",this.frozen),this.namespace=t,this):this.namespace}freeze(){if(this.frozen)return this;const t=this;for(;++this.freezeIndex<this.attachers.length;){const[n,...r]=this.attachers[this.freezeIndex];if(r[0]===!1)continue;r[0]===!0&&(r[0]=void 0);const i=n.call(t,...r);typeof i=="function"&&this.transformers.use(i)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();const n=th(t),r=this.parser||this.Parser;return cb("parse",r),r(String(n),n)}process(t,n){const r=this;return this.freeze(),cb("process",this.parser||this.Parser),db("process",this.compiler||this.Compiler),n?i(void 0,n):new Promise(i);function i(a,l){const c=th(t),d=r.parse(c);r.run(d,c,function(g,h,b){if(g||!h||!b)return f(g);const x=h,v=r.stringify(x,b);TJ(v)?b.value=v:b.result=v,f(g,b)});function f(g,h){g||!h?l(g):a?a(h):n(void 0,h)}}}processSync(t){let n=!1,r;return this.freeze(),cb("processSync",this.parser||this.Parser),db("processSync",this.compiler||this.Compiler),this.process(t,i),Hk("processSync","process",n),r;function i(a,l){n=!0,Dk(a),r=l}}run(t,n,r){Bk(t),this.freeze();const i=this.transformers;return!r&&typeof n=="function"&&(r=n,n=void 0),r?a(void 0,r):new Promise(a);function a(l,c){const d=th(n);i.run(t,d,f);function f(g,h,b){const x=h||t;g?c(g):l?l(x):r(void 0,x,b)}}}runSync(t,n){let r=!1,i;return this.run(t,n,a),Hk("runSync","run",r),i;function a(l,c){Dk(l),i=c,r=!0}}stringify(t,n){this.freeze();const r=th(n),i=this.compiler||this.Compiler;return db("stringify",i),Bk(t),i(t,r)}use(t,...n){const r=this.attachers,i=this.namespace;if(fb("use",this.frozen),t!=null)if(typeof t=="function")d(t,n);else if(typeof t=="object")Array.isArray(t)?c(t):l(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function a(f){if(typeof f=="function")d(f,[]);else if(typeof f=="object")if(Array.isArray(f)){const[g,...h]=f;d(g,h)}else l(f);else throw new TypeError("Expected usable value, not `"+f+"`")}function l(f){if(!("plugins"in f)&&!("settings"in f))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");c(f.plugins),f.settings&&(i.settings=ab(!0,i.settings,f.settings))}function c(f){let g=-1;if(f!=null)if(Array.isArray(f))for(;++g<f.length;){const h=f[g];a(h)}else throw new TypeError("Expected a list of plugins, not `"+f+"`")}function d(f,g){let h=-1,b=-1;for(;++h<r.length;)if(r[h][0]===f){b=h;break}if(b===-1)r.push([f,...g]);else if(g.length>0){let[x,...v]=g;const w=r[b][1];l1(w)&&l1(x)&&(x=ab(!0,w,x)),r[b]=[f,x,...v]}}}}const EJ=new ay().freeze();function cb(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function db(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function fb(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function Bk(e){if(!l1(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function Hk(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function th(e){return vJ(e)?e:new gJ(e)}function vJ(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function TJ(e){return typeof e=="string"||SJ(e)}function SJ(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}function oy(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var Ao=oy();function g4(e){Ao=e}var qa={exec:()=>null};function Bt(e,t=""){let n=typeof e=="string"?e:e.source,r={replace:(i,a)=>{let l=typeof a=="string"?a:a.source;return l=l.replace(pr.caret,"$1"),n=n.replace(i,l),r},getRegex:()=>new RegExp(n,t)};return r}var CJ=(()=>{try{return!!new RegExp("(?<=1)(?<!1)")}catch{return!1}})(),pr={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:e=>new RegExp(`^( {0,3}${e})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}#`),htmlBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}<(?:[a-z].*>|!--)`,"i"),blockquoteBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}>`)},kJ=/^(?:[ \t]*(?:\n|$))+/,wJ=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,NJ=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,dd=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,AJ=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,ly=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,b4=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,x4=Bt(b4).replace(/bull/g,ly).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),_J=Bt(b4).replace(/bull/g,ly).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),uy=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,RJ=/^[^\n]+/,cy=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,OJ=Bt(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",cy).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),IJ=Bt(/^(bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,ly).getRegex(),Gp="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|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",dy=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,MJ=Bt("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",dy).replace("tag",Gp).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),y4=Bt(uy).replace("hr",dd).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Gp).getRegex(),LJ=Bt(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",y4).getRegex(),fy={blockquote:LJ,code:wJ,def:OJ,fences:NJ,heading:AJ,hr:dd,html:MJ,lheading:x4,list:IJ,newline:kJ,paragraph:y4,table:qa,text:RJ},Uk=Bt("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",dd).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Gp).getRegex(),DJ={...fy,lheading:_J,table:Uk,paragraph:Bt(uy).replace("hr",dd).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",Uk).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Gp).getRegex()},PJ={...fy,html:Bt(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",dy).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:qa,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:Bt(uy).replace("hr",dd).replace("heading",` *#{1,6} *[^
590
+ ]`).replace("lheading",x4).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},jJ=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,BJ=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,E4=/^( {2,}|\\)\n(?!\s*$)/,HJ=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,ru=/[\p{P}\p{S}]/u,Xp=/[\s\p{P}\p{S}]/u,hy=/[^\s\p{P}\p{S}]/u,UJ=Bt(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,Xp).getRegex(),v4=/(?!~)[\p{P}\p{S}]/u,zJ=/(?!~)[\s\p{P}\p{S}]/u,FJ=/(?:[^\s\p{P}\p{S}]|~)/u,$J=Bt(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",CJ?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),T4=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,VJ=Bt(T4,"u").replace(/punct/g,ru).getRegex(),qJ=Bt(T4,"u").replace(/punct/g,v4).getRegex(),S4="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",YJ=Bt(S4,"gu").replace(/notPunctSpace/g,hy).replace(/punctSpace/g,Xp).replace(/punct/g,ru).getRegex(),GJ=Bt(S4,"gu").replace(/notPunctSpace/g,FJ).replace(/punctSpace/g,zJ).replace(/punct/g,v4).getRegex(),XJ=Bt("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,hy).replace(/punctSpace/g,Xp).replace(/punct/g,ru).getRegex(),KJ=Bt(/^~~?(?:((?!~)punct)|[^\s~])/,"u").replace(/punct/g,ru).getRegex(),QJ="^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)",WJ=Bt(QJ,"gu").replace(/notPunctSpace/g,hy).replace(/punctSpace/g,Xp).replace(/punct/g,ru).getRegex(),ZJ=Bt(/\\(punct)/,"gu").replace(/punct/g,ru).getRegex(),JJ=Bt(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),eee=Bt(dy).replace("(?:-->|$)","-->").getRegex(),tee=Bt("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",eee).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),Zh=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/,nee=Bt(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label",Zh).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),C4=Bt(/^!?\[(label)\]\[(ref)\]/).replace("label",Zh).replace("ref",cy).getRegex(),k4=Bt(/^!?\[(ref)\](?:\[\])?/).replace("ref",cy).getRegex(),ree=Bt("reflink|nolink(?!\\()","g").replace("reflink",C4).replace("nolink",k4).getRegex(),zk=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,py={_backpedal:qa,anyPunctuation:ZJ,autolink:JJ,blockSkip:$J,br:E4,code:BJ,del:qa,delLDelim:qa,delRDelim:qa,emStrongLDelim:VJ,emStrongRDelimAst:YJ,emStrongRDelimUnd:XJ,escape:jJ,link:nee,nolink:k4,punctuation:UJ,reflink:C4,reflinkSearch:ree,tag:tee,text:HJ,url:qa},see={...py,link:Bt(/^!?\[(label)\]\((.*?)\)/).replace("label",Zh).getRegex(),reflink:Bt(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Zh).getRegex()},c1={...py,emStrongRDelimAst:GJ,emStrongLDelim:qJ,delLDelim:KJ,delRDelim:WJ,url:Bt(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",zk).replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:Bt(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",zk).getRegex()},iee={...c1,br:Bt(E4).replace("{2,}","*").getRegex(),text:Bt(c1.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},nh={normal:fy,gfm:DJ,pedantic:PJ},uc={normal:py,gfm:c1,breaks:iee,pedantic:see},aee={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},Fk=e=>aee[e];function Cs(e,t){if(t){if(pr.escapeTest.test(e))return e.replace(pr.escapeReplace,Fk)}else if(pr.escapeTestNoEncode.test(e))return e.replace(pr.escapeReplaceNoEncode,Fk);return e}function $k(e){try{e=encodeURI(e).replace(pr.percentDecode,"%")}catch{return null}return e}function Vk(e,t){let n=e.replace(pr.findPipe,(a,l,c)=>{let d=!1,f=l;for(;--f>=0&&c[f]==="\\";)d=!d;return d?"|":" |"}),r=n.split(pr.splitPipe),i=0;if(r[0].trim()||r.shift(),r.length>0&&!r.at(-1)?.trim()&&r.pop(),t)if(r.length>t)r.splice(t);else for(;r.length<t;)r.push("");for(;i<r.length;i++)r[i]=r[i].trim().replace(pr.slashPipe,"|");return r}function cc(e,t,n){let r=e.length;if(r===0)return"";let i=0;for(;i<r&&e.charAt(r-i-1)===t;)i++;return e.slice(0,r-i)}function oee(e,t){if(e.indexOf(t[1])===-1)return-1;let n=0;for(let r=0;r<e.length;r++)if(e[r]==="\\")r++;else if(e[r]===t[0])n++;else if(e[r]===t[1]&&(n--,n<0))return r;return n>0?-2:-1}function lee(e,t=0){let n=t,r="";for(let i of e)if(i===" "){let a=4-n%4;r+=" ".repeat(a),n+=a}else r+=i,n++;return r}function qk(e,t,n,r,i){let a=t.href,l=t.title||null,c=e[1].replace(i.other.outputLinkReplace,"$1");r.state.inLink=!0;let d={type:e[0].charAt(0)==="!"?"image":"link",raw:n,href:a,title:l,text:c,tokens:r.inlineTokens(c)};return r.state.inLink=!1,d}function uee(e,t,n){let r=e.match(n.other.indentCodeCompensation);if(r===null)return t;let i=r[1];return t.split(`
591
+ `).map(a=>{let l=a.match(n.other.beginningSpace);if(l===null)return a;let[c]=l;return c.length>=i.length?a.slice(i.length):a}).join(`
592
+ `)}var Jh=class{options;rules;lexer;constructor(e){this.options=e||Ao}space(e){let t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:"space",raw:t[0]}}code(e){let t=this.rules.block.code.exec(e);if(t){let n=t[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:t[0],codeBlockStyle:"indented",text:this.options.pedantic?n:cc(n,`
593
+ `)}}}fences(e){let t=this.rules.block.fences.exec(e);if(t){let n=t[0],r=uee(n,t[3]||"",this.rules);return{type:"code",raw:n,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):t[2],text:r}}}heading(e){let t=this.rules.block.heading.exec(e);if(t){let n=t[2].trim();if(this.rules.other.endingHash.test(n)){let r=cc(n,"#");(this.options.pedantic||!r||this.rules.other.endingSpaceChar.test(r))&&(n=r.trim())}return{type:"heading",raw:t[0],depth:t[1].length,text:n,tokens:this.lexer.inline(n)}}}hr(e){let t=this.rules.block.hr.exec(e);if(t)return{type:"hr",raw:cc(t[0],`
594
+ `)}}blockquote(e){let t=this.rules.block.blockquote.exec(e);if(t){let n=cc(t[0],`
595
+ `).split(`
596
+ `),r="",i="",a=[];for(;n.length>0;){let l=!1,c=[],d;for(d=0;d<n.length;d++)if(this.rules.other.blockquoteStart.test(n[d]))c.push(n[d]),l=!0;else if(!l)c.push(n[d]);else break;n=n.slice(d);let f=c.join(`
597
+ `),g=f.replace(this.rules.other.blockquoteSetextReplace,`
598
+ $1`).replace(this.rules.other.blockquoteSetextReplace2,"");r=r?`${r}
599
+ ${f}`:f,i=i?`${i}
600
+ ${g}`:g;let h=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(g,a,!0),this.lexer.state.top=h,n.length===0)break;let b=a.at(-1);if(b?.type==="code")break;if(b?.type==="blockquote"){let x=b,v=x.raw+`
601
+ `+n.join(`
602
+ `),w=this.blockquote(v);a[a.length-1]=w,r=r.substring(0,r.length-x.raw.length)+w.raw,i=i.substring(0,i.length-x.text.length)+w.text;break}else if(b?.type==="list"){let x=b,v=x.raw+`
603
+ `+n.join(`
604
+ `),w=this.list(v);a[a.length-1]=w,r=r.substring(0,r.length-b.raw.length)+w.raw,i=i.substring(0,i.length-x.raw.length)+w.raw,n=v.substring(a.at(-1).raw.length).split(`
605
+ `);continue}}return{type:"blockquote",raw:r,tokens:a,text:i}}}list(e){let t=this.rules.block.list.exec(e);if(t){let n=t[1].trim(),r=n.length>1,i={type:"list",raw:"",ordered:r,start:r?+n.slice(0,-1):"",loose:!1,items:[]};n=r?`\\d{1,9}\\${n.slice(-1)}`:`\\${n}`,this.options.pedantic&&(n=r?n:"[*+-]");let a=this.rules.other.listItemRegex(n),l=!1;for(;e;){let d=!1,f="",g="";if(!(t=a.exec(e))||this.rules.block.hr.test(e))break;f=t[0],e=e.substring(f.length);let h=lee(t[2].split(`
606
+ `,1)[0],t[1].length),b=e.split(`
607
+ `,1)[0],x=!h.trim(),v=0;if(this.options.pedantic?(v=2,g=h.trimStart()):x?v=t[1].length+1:(v=h.search(this.rules.other.nonSpaceChar),v=v>4?1:v,g=h.slice(v),v+=t[1].length),x&&this.rules.other.blankLine.test(b)&&(f+=b+`
608
+ `,e=e.substring(b.length+1),d=!0),!d){let w=this.rules.other.nextBulletRegex(v),k=this.rules.other.hrRegex(v),C=this.rules.other.fencesBeginRegex(v),N=this.rules.other.headingBeginRegex(v),A=this.rules.other.htmlBeginRegex(v),R=this.rules.other.blockquoteBeginRegex(v);for(;e;){let M=e.split(`
609
+ `,1)[0],_;if(b=M,this.options.pedantic?(b=b.replace(this.rules.other.listReplaceNesting," "),_=b):_=b.replace(this.rules.other.tabCharGlobal," "),C.test(b)||N.test(b)||A.test(b)||R.test(b)||w.test(b)||k.test(b))break;if(_.search(this.rules.other.nonSpaceChar)>=v||!b.trim())g+=`
610
+ `+_.slice(v);else{if(x||h.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||C.test(h)||N.test(h)||k.test(h))break;g+=`
611
+ `+b}x=!b.trim(),f+=M+`
612
+ `,e=e.substring(M.length+1),h=_.slice(v)}}i.loose||(l?i.loose=!0:this.rules.other.doubleBlankLine.test(f)&&(l=!0)),i.items.push({type:"list_item",raw:f,task:!!this.options.gfm&&this.rules.other.listIsTask.test(g),loose:!1,text:g,tokens:[]}),i.raw+=f}let c=i.items.at(-1);if(c)c.raw=c.raw.trimEnd(),c.text=c.text.trimEnd();else return;i.raw=i.raw.trimEnd();for(let d of i.items){if(this.lexer.state.top=!1,d.tokens=this.lexer.blockTokens(d.text,[]),d.task){if(d.text=d.text.replace(this.rules.other.listReplaceTask,""),d.tokens[0]?.type==="text"||d.tokens[0]?.type==="paragraph"){d.tokens[0].raw=d.tokens[0].raw.replace(this.rules.other.listReplaceTask,""),d.tokens[0].text=d.tokens[0].text.replace(this.rules.other.listReplaceTask,"");for(let g=this.lexer.inlineQueue.length-1;g>=0;g--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[g].src)){this.lexer.inlineQueue[g].src=this.lexer.inlineQueue[g].src.replace(this.rules.other.listReplaceTask,"");break}}let f=this.rules.other.listTaskCheckbox.exec(d.raw);if(f){let g={type:"checkbox",raw:f[0]+" ",checked:f[0]!=="[ ]"};d.checked=g.checked,i.loose?d.tokens[0]&&["paragraph","text"].includes(d.tokens[0].type)&&"tokens"in d.tokens[0]&&d.tokens[0].tokens?(d.tokens[0].raw=g.raw+d.tokens[0].raw,d.tokens[0].text=g.raw+d.tokens[0].text,d.tokens[0].tokens.unshift(g)):d.tokens.unshift({type:"paragraph",raw:g.raw,text:g.raw,tokens:[g]}):d.tokens.unshift(g)}}if(!i.loose){let f=d.tokens.filter(h=>h.type==="space"),g=f.length>0&&f.some(h=>this.rules.other.anyLine.test(h.raw));i.loose=g}}if(i.loose)for(let d of i.items){d.loose=!0;for(let f of d.tokens)f.type==="text"&&(f.type="paragraph")}return i}}html(e){let t=this.rules.block.html.exec(e);if(t)return{type:"html",block:!0,raw:t[0],pre:t[1]==="pre"||t[1]==="script"||t[1]==="style",text:t[0]}}def(e){let t=this.rules.block.def.exec(e);if(t){let n=t[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),r=t[2]?t[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",i=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):t[3];return{type:"def",tag:n,raw:t[0],href:r,title:i}}}table(e){let t=this.rules.block.table.exec(e);if(!t||!this.rules.other.tableDelimiter.test(t[2]))return;let n=Vk(t[1]),r=t[2].replace(this.rules.other.tableAlignChars,"").split("|"),i=t[3]?.trim()?t[3].replace(this.rules.other.tableRowBlankLine,"").split(`
613
+ `):[],a={type:"table",raw:t[0],header:[],align:[],rows:[]};if(n.length===r.length){for(let l of r)this.rules.other.tableAlignRight.test(l)?a.align.push("right"):this.rules.other.tableAlignCenter.test(l)?a.align.push("center"):this.rules.other.tableAlignLeft.test(l)?a.align.push("left"):a.align.push(null);for(let l=0;l<n.length;l++)a.header.push({text:n[l],tokens:this.lexer.inline(n[l]),header:!0,align:a.align[l]});for(let l of i)a.rows.push(Vk(l,a.header.length).map((c,d)=>({text:c,tokens:this.lexer.inline(c),header:!1,align:a.align[d]})));return a}}lheading(e){let t=this.rules.block.lheading.exec(e);if(t){let n=t[1].trim();return{type:"heading",raw:t[0],depth:t[2].charAt(0)==="="?1:2,text:n,tokens:this.lexer.inline(n)}}}paragraph(e){let t=this.rules.block.paragraph.exec(e);if(t){let n=t[1].charAt(t[1].length-1)===`
614
+ `?t[1].slice(0,-1):t[1];return{type:"paragraph",raw:t[0],text:n,tokens:this.lexer.inline(n)}}}text(e){let t=this.rules.block.text.exec(e);if(t)return{type:"text",raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(e){let t=this.rules.inline.escape.exec(e);if(t)return{type:"escape",raw:t[0],text:t[1]}}tag(e){let t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&this.rules.other.startATag.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(e){let t=this.rules.inline.link.exec(e);if(t){let n=t[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(n)){if(!this.rules.other.endAngleBracket.test(n))return;let a=cc(n.slice(0,-1),"\\");if((n.length-a.length)%2===0)return}else{let a=oee(t[2],"()");if(a===-2)return;if(a>-1){let l=(t[0].indexOf("!")===0?5:4)+t[1].length+a;t[2]=t[2].substring(0,a),t[0]=t[0].substring(0,l).trim(),t[3]=""}}let r=t[2],i="";if(this.options.pedantic){let a=this.rules.other.pedanticHrefTitle.exec(r);a&&(r=a[1],i=a[3])}else i=t[3]?t[3].slice(1,-1):"";return r=r.trim(),this.rules.other.startAngleBracket.test(r)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(n)?r=r.slice(1):r=r.slice(1,-1)),qk(t,{href:r&&r.replace(this.rules.inline.anyPunctuation,"$1"),title:i&&i.replace(this.rules.inline.anyPunctuation,"$1")},t[0],this.lexer,this.rules)}}reflink(e,t){let n;if((n=this.rules.inline.reflink.exec(e))||(n=this.rules.inline.nolink.exec(e))){let r=(n[2]||n[1]).replace(this.rules.other.multipleSpaceGlobal," "),i=t[r.toLowerCase()];if(!i){let a=n[0].charAt(0);return{type:"text",raw:a,text:a}}return qk(n,i,n[0],this.lexer,this.rules)}}emStrong(e,t,n=""){let r=this.rules.inline.emStrongLDelim.exec(e);if(!(!r||!r[1]&&!r[2]&&!r[3]&&!r[4]||r[4]&&n.match(this.rules.other.unicodeAlphaNumeric))&&(!(r[1]||r[3])||!n||this.rules.inline.punctuation.exec(n))){let i=[...r[0]].length-1,a,l,c=i,d=0,f=r[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(f.lastIndex=0,t=t.slice(-1*e.length+i);(r=f.exec(t))!==null;){if(a=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!a)continue;if(l=[...a].length,r[3]||r[4]){c+=l;continue}else if((r[5]||r[6])&&i%3&&!((i+l)%3)){d+=l;continue}if(c-=l,c>0)continue;l=Math.min(l,l+c+d);let g=[...r[0]][0].length,h=e.slice(0,i+r.index+g+l);if(Math.min(i,l)%2){let x=h.slice(1,-1);return{type:"em",raw:h,text:x,tokens:this.lexer.inlineTokens(x)}}let b=h.slice(2,-2);return{type:"strong",raw:h,text:b,tokens:this.lexer.inlineTokens(b)}}}}codespan(e){let t=this.rules.inline.code.exec(e);if(t){let n=t[2].replace(this.rules.other.newLineCharGlobal," "),r=this.rules.other.nonSpaceChar.test(n),i=this.rules.other.startingSpaceChar.test(n)&&this.rules.other.endingSpaceChar.test(n);return r&&i&&(n=n.substring(1,n.length-1)),{type:"codespan",raw:t[0],text:n}}}br(e){let t=this.rules.inline.br.exec(e);if(t)return{type:"br",raw:t[0]}}del(e,t,n=""){let r=this.rules.inline.delLDelim.exec(e);if(r&&(!r[1]||!n||this.rules.inline.punctuation.exec(n))){let i=[...r[0]].length-1,a,l,c=i,d=this.rules.inline.delRDelim;for(d.lastIndex=0,t=t.slice(-1*e.length+i);(r=d.exec(t))!==null;){if(a=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!a||(l=[...a].length,l!==i))continue;if(r[3]||r[4]){c+=l;continue}if(c-=l,c>0)continue;l=Math.min(l,l+c);let f=[...r[0]][0].length,g=e.slice(0,i+r.index+f+l),h=g.slice(i,-i);return{type:"del",raw:g,text:h,tokens:this.lexer.inlineTokens(h)}}}}autolink(e){let t=this.rules.inline.autolink.exec(e);if(t){let n,r;return t[2]==="@"?(n=t[1],r="mailto:"+n):(n=t[1],r=n),{type:"link",raw:t[0],text:n,href:r,tokens:[{type:"text",raw:n,text:n}]}}}url(e){let t;if(t=this.rules.inline.url.exec(e)){let n,r;if(t[2]==="@")n=t[0],r="mailto:"+n;else{let i;do i=t[0],t[0]=this.rules.inline._backpedal.exec(t[0])?.[0]??"";while(i!==t[0]);n=t[0],t[1]==="www."?r="http://"+t[0]:r=t[0]}return{type:"link",raw:t[0],text:n,href:r,tokens:[{type:"text",raw:n,text:n}]}}}inlineText(e){let t=this.rules.inline.text.exec(e);if(t){let n=this.lexer.state.inRawBlock;return{type:"text",raw:t[0],text:t[0],escaped:n}}}},is=class d1{tokens;options;state;inlineQueue;tokenizer;constructor(t){this.tokens=[],this.tokens.links=Object.create(null),this.options=t||Ao,this.options.tokenizer=this.options.tokenizer||new Jh,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let n={other:pr,block:nh.normal,inline:uc.normal};this.options.pedantic?(n.block=nh.pedantic,n.inline=uc.pedantic):this.options.gfm&&(n.block=nh.gfm,this.options.breaks?n.inline=uc.breaks:n.inline=uc.gfm),this.tokenizer.rules=n}static get rules(){return{block:nh,inline:uc}}static lex(t,n){return new d1(n).lex(t)}static lexInline(t,n){return new d1(n).inlineTokens(t)}lex(t){t=t.replace(pr.carriageReturn,`
615
+ `),this.blockTokens(t,this.tokens);for(let n=0;n<this.inlineQueue.length;n++){let r=this.inlineQueue[n];this.inlineTokens(r.src,r.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(t,n=[],r=!1){for(this.tokenizer.lexer=this,this.options.pedantic&&(t=t.replace(pr.tabCharGlobal," ").replace(pr.spaceLine,""));t;){let i;if(this.options.extensions?.block?.some(l=>(i=l.call({lexer:this},t,n))?(t=t.substring(i.raw.length),n.push(i),!0):!1))continue;if(i=this.tokenizer.space(t)){t=t.substring(i.raw.length);let l=n.at(-1);i.raw.length===1&&l!==void 0?l.raw+=`
616
+ `:n.push(i);continue}if(i=this.tokenizer.code(t)){t=t.substring(i.raw.length);let l=n.at(-1);l?.type==="paragraph"||l?.type==="text"?(l.raw+=(l.raw.endsWith(`
617
+ `)?"":`
618
+ `)+i.raw,l.text+=`
619
+ `+i.text,this.inlineQueue.at(-1).src=l.text):n.push(i);continue}if(i=this.tokenizer.fences(t)){t=t.substring(i.raw.length),n.push(i);continue}if(i=this.tokenizer.heading(t)){t=t.substring(i.raw.length),n.push(i);continue}if(i=this.tokenizer.hr(t)){t=t.substring(i.raw.length),n.push(i);continue}if(i=this.tokenizer.blockquote(t)){t=t.substring(i.raw.length),n.push(i);continue}if(i=this.tokenizer.list(t)){t=t.substring(i.raw.length),n.push(i);continue}if(i=this.tokenizer.html(t)){t=t.substring(i.raw.length),n.push(i);continue}if(i=this.tokenizer.def(t)){t=t.substring(i.raw.length);let l=n.at(-1);l?.type==="paragraph"||l?.type==="text"?(l.raw+=(l.raw.endsWith(`
620
+ `)?"":`
621
+ `)+i.raw,l.text+=`
622
+ `+i.raw,this.inlineQueue.at(-1).src=l.text):this.tokens.links[i.tag]||(this.tokens.links[i.tag]={href:i.href,title:i.title},n.push(i));continue}if(i=this.tokenizer.table(t)){t=t.substring(i.raw.length),n.push(i);continue}if(i=this.tokenizer.lheading(t)){t=t.substring(i.raw.length),n.push(i);continue}let a=t;if(this.options.extensions?.startBlock){let l=1/0,c=t.slice(1),d;this.options.extensions.startBlock.forEach(f=>{d=f.call({lexer:this},c),typeof d=="number"&&d>=0&&(l=Math.min(l,d))}),l<1/0&&l>=0&&(a=t.substring(0,l+1))}if(this.state.top&&(i=this.tokenizer.paragraph(a))){let l=n.at(-1);r&&l?.type==="paragraph"?(l.raw+=(l.raw.endsWith(`
623
+ `)?"":`
624
+ `)+i.raw,l.text+=`
625
+ `+i.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=l.text):n.push(i),r=a.length!==t.length,t=t.substring(i.raw.length);continue}if(i=this.tokenizer.text(t)){t=t.substring(i.raw.length);let l=n.at(-1);l?.type==="text"?(l.raw+=(l.raw.endsWith(`
626
+ `)?"":`
627
+ `)+i.raw,l.text+=`
628
+ `+i.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=l.text):n.push(i);continue}if(t){let l="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(l);break}else throw new Error(l)}}return this.state.top=!0,n}inline(t,n=[]){return this.inlineQueue.push({src:t,tokens:n}),n}inlineTokens(t,n=[]){this.tokenizer.lexer=this;let r=t,i=null;if(this.tokens.links){let d=Object.keys(this.tokens.links);if(d.length>0)for(;(i=this.tokenizer.rules.inline.reflinkSearch.exec(r))!==null;)d.includes(i[0].slice(i[0].lastIndexOf("[")+1,-1))&&(r=r.slice(0,i.index)+"["+"a".repeat(i[0].length-2)+"]"+r.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(i=this.tokenizer.rules.inline.anyPunctuation.exec(r))!==null;)r=r.slice(0,i.index)+"++"+r.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);let a;for(;(i=this.tokenizer.rules.inline.blockSkip.exec(r))!==null;)a=i[2]?i[2].length:0,r=r.slice(0,i.index+a)+"["+"a".repeat(i[0].length-a-2)+"]"+r.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);r=this.options.hooks?.emStrongMask?.call({lexer:this},r)??r;let l=!1,c="";for(;t;){l||(c=""),l=!1;let d;if(this.options.extensions?.inline?.some(g=>(d=g.call({lexer:this},t,n))?(t=t.substring(d.raw.length),n.push(d),!0):!1))continue;if(d=this.tokenizer.escape(t)){t=t.substring(d.raw.length),n.push(d);continue}if(d=this.tokenizer.tag(t)){t=t.substring(d.raw.length),n.push(d);continue}if(d=this.tokenizer.link(t)){t=t.substring(d.raw.length),n.push(d);continue}if(d=this.tokenizer.reflink(t,this.tokens.links)){t=t.substring(d.raw.length);let g=n.at(-1);d.type==="text"&&g?.type==="text"?(g.raw+=d.raw,g.text+=d.text):n.push(d);continue}if(d=this.tokenizer.emStrong(t,r,c)){t=t.substring(d.raw.length),n.push(d);continue}if(d=this.tokenizer.codespan(t)){t=t.substring(d.raw.length),n.push(d);continue}if(d=this.tokenizer.br(t)){t=t.substring(d.raw.length),n.push(d);continue}if(d=this.tokenizer.del(t,r,c)){t=t.substring(d.raw.length),n.push(d);continue}if(d=this.tokenizer.autolink(t)){t=t.substring(d.raw.length),n.push(d);continue}if(!this.state.inLink&&(d=this.tokenizer.url(t))){t=t.substring(d.raw.length),n.push(d);continue}let f=t;if(this.options.extensions?.startInline){let g=1/0,h=t.slice(1),b;this.options.extensions.startInline.forEach(x=>{b=x.call({lexer:this},h),typeof b=="number"&&b>=0&&(g=Math.min(g,b))}),g<1/0&&g>=0&&(f=t.substring(0,g+1))}if(d=this.tokenizer.inlineText(f)){t=t.substring(d.raw.length),d.raw.slice(-1)!=="_"&&(c=d.raw.slice(-1)),l=!0;let g=n.at(-1);g?.type==="text"?(g.raw+=d.raw,g.text+=d.text):n.push(d);continue}if(t){let g="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(g);break}else throw new Error(g)}}return n}},ep=class{options;parser;constructor(t){this.options=t||Ao}space(t){return""}code({text:t,lang:n,escaped:r}){let i=(n||"").match(pr.notSpaceStart)?.[0],a=t.replace(pr.endingNewline,"")+`
629
+ `;return i?'<pre><code class="language-'+Cs(i)+'">'+(r?a:Cs(a,!0))+`</code></pre>
630
+ `:"<pre><code>"+(r?a:Cs(a,!0))+`</code></pre>
631
+ `}blockquote({tokens:t}){return`<blockquote>
632
+ ${this.parser.parse(t)}</blockquote>
633
+ `}html({text:t}){return t}def(t){return""}heading({tokens:t,depth:n}){return`<h${n}>${this.parser.parseInline(t)}</h${n}>
634
+ `}hr(t){return`<hr>
635
+ `}list(t){let n=t.ordered,r=t.start,i="";for(let c=0;c<t.items.length;c++){let d=t.items[c];i+=this.listitem(d)}let a=n?"ol":"ul",l=n&&r!==1?' start="'+r+'"':"";return"<"+a+l+`>
636
+ `+i+"</"+a+`>
637
+ `}listitem(t){return`<li>${this.parser.parse(t.tokens)}</li>
638
+ `}checkbox({checked:t}){return"<input "+(t?'checked="" ':"")+'disabled="" type="checkbox"> '}paragraph({tokens:t}){return`<p>${this.parser.parseInline(t)}</p>
639
+ `}table(t){let n="",r="";for(let a=0;a<t.header.length;a++)r+=this.tablecell(t.header[a]);n+=this.tablerow({text:r});let i="";for(let a=0;a<t.rows.length;a++){let l=t.rows[a];r="";for(let c=0;c<l.length;c++)r+=this.tablecell(l[c]);i+=this.tablerow({text:r})}return i&&(i=`<tbody>${i}</tbody>`),`<table>
640
+ <thead>
641
+ `+n+`</thead>
642
+ `+i+`</table>
643
+ `}tablerow({text:t}){return`<tr>
644
+ ${t}</tr>
645
+ `}tablecell(t){let n=this.parser.parseInline(t.tokens),r=t.header?"th":"td";return(t.align?`<${r} align="${t.align}">`:`<${r}>`)+n+`</${r}>
646
+ `}strong({tokens:t}){return`<strong>${this.parser.parseInline(t)}</strong>`}em({tokens:t}){return`<em>${this.parser.parseInline(t)}</em>`}codespan({text:t}){return`<code>${Cs(t,!0)}</code>`}br(t){return"<br>"}del({tokens:t}){return`<del>${this.parser.parseInline(t)}</del>`}link({href:t,title:n,tokens:r}){let i=this.parser.parseInline(r),a=$k(t);if(a===null)return i;t=a;let l='<a href="'+t+'"';return n&&(l+=' title="'+Cs(n)+'"'),l+=">"+i+"</a>",l}image({href:t,title:n,text:r,tokens:i}){i&&(r=this.parser.parseInline(i,this.parser.textRenderer));let a=$k(t);if(a===null)return Cs(r);t=a;let l=`<img src="${t}" alt="${Cs(r)}"`;return n&&(l+=` title="${Cs(n)}"`),l+=">",l}text(t){return"tokens"in t&&t.tokens?this.parser.parseInline(t.tokens):"escaped"in t&&t.escaped?t.text:Cs(t.text)}},my=class{strong({text:e}){return e}em({text:e}){return e}codespan({text:e}){return e}del({text:e}){return e}html({text:e}){return e}text({text:e}){return e}link({text:e}){return""+e}image({text:e}){return""+e}br(){return""}checkbox({raw:e}){return e}},ds=class f1{options;renderer;textRenderer;constructor(t){this.options=t||Ao,this.options.renderer=this.options.renderer||new ep,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new my}static parse(t,n){return new f1(n).parse(t)}static parseInline(t,n){return new f1(n).parseInline(t)}parse(t){this.renderer.parser=this;let n="";for(let r=0;r<t.length;r++){let i=t[r];if(this.options.extensions?.renderers?.[i.type]){let l=i,c=this.options.extensions.renderers[l.type].call({parser:this},l);if(c!==!1||!["space","hr","heading","code","table","blockquote","list","html","def","paragraph","text"].includes(l.type)){n+=c||"";continue}}let a=i;switch(a.type){case"space":{n+=this.renderer.space(a);break}case"hr":{n+=this.renderer.hr(a);break}case"heading":{n+=this.renderer.heading(a);break}case"code":{n+=this.renderer.code(a);break}case"table":{n+=this.renderer.table(a);break}case"blockquote":{n+=this.renderer.blockquote(a);break}case"list":{n+=this.renderer.list(a);break}case"checkbox":{n+=this.renderer.checkbox(a);break}case"html":{n+=this.renderer.html(a);break}case"def":{n+=this.renderer.def(a);break}case"paragraph":{n+=this.renderer.paragraph(a);break}case"text":{n+=this.renderer.text(a);break}default:{let l='Token with "'+a.type+'" type was not found.';if(this.options.silent)return console.error(l),"";throw new Error(l)}}}return n}parseInline(t,n=this.renderer){this.renderer.parser=this;let r="";for(let i=0;i<t.length;i++){let a=t[i];if(this.options.extensions?.renderers?.[a.type]){let c=this.options.extensions.renderers[a.type].call({parser:this},a);if(c!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(a.type)){r+=c||"";continue}}let l=a;switch(l.type){case"escape":{r+=n.text(l);break}case"html":{r+=n.html(l);break}case"link":{r+=n.link(l);break}case"image":{r+=n.image(l);break}case"checkbox":{r+=n.checkbox(l);break}case"strong":{r+=n.strong(l);break}case"em":{r+=n.em(l);break}case"codespan":{r+=n.codespan(l);break}case"br":{r+=n.br(l);break}case"del":{r+=n.del(l);break}case"text":{r+=n.text(l);break}default:{let c='Token with "'+l.type+'" type was not found.';if(this.options.silent)return console.error(c),"";throw new Error(c)}}}return r}},yc=class{options;block;constructor(e){this.options=e||Ao}static passThroughHooks=new Set(["preprocess","postprocess","processAllTokens","emStrongMask"]);static passThroughHooksRespectAsync=new Set(["preprocess","postprocess","processAllTokens"]);preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}emStrongMask(e){return e}provideLexer(e=this.block){return e?is.lex:is.lexInline}provideParser(e=this.block){return e?ds.parse:ds.parseInline}},cee=class{defaults=oy();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=ds;Renderer=ep;TextRenderer=my;Lexer=is;Tokenizer=Jh;Hooks=yc;constructor(...t){this.use(...t)}walkTokens(t,n){let r=[];for(let i of t)switch(r=r.concat(n.call(this,i)),i.type){case"table":{let a=i;for(let l of a.header)r=r.concat(this.walkTokens(l.tokens,n));for(let l of a.rows)for(let c of l)r=r.concat(this.walkTokens(c.tokens,n));break}case"list":{let a=i;r=r.concat(this.walkTokens(a.items,n));break}default:{let a=i;this.defaults.extensions?.childTokens?.[a.type]?this.defaults.extensions.childTokens[a.type].forEach(l=>{let c=a[l].flat(1/0);r=r.concat(this.walkTokens(c,n))}):a.tokens&&(r=r.concat(this.walkTokens(a.tokens,n)))}}return r}use(...t){let n=this.defaults.extensions||{renderers:{},childTokens:{}};return t.forEach(r=>{let i={...r};if(i.async=this.defaults.async||i.async||!1,r.extensions&&(r.extensions.forEach(a=>{if(!a.name)throw new Error("extension name required");if("renderer"in a){let l=n.renderers[a.name];l?n.renderers[a.name]=function(...c){let d=a.renderer.apply(this,c);return d===!1&&(d=l.apply(this,c)),d}:n.renderers[a.name]=a.renderer}if("tokenizer"in a){if(!a.level||a.level!=="block"&&a.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let l=n[a.level];l?l.unshift(a.tokenizer):n[a.level]=[a.tokenizer],a.start&&(a.level==="block"?n.startBlock?n.startBlock.push(a.start):n.startBlock=[a.start]:a.level==="inline"&&(n.startInline?n.startInline.push(a.start):n.startInline=[a.start]))}"childTokens"in a&&a.childTokens&&(n.childTokens[a.name]=a.childTokens)}),i.extensions=n),r.renderer){let a=this.defaults.renderer||new ep(this.defaults);for(let l in r.renderer){if(!(l in a))throw new Error(`renderer '${l}' does not exist`);if(["options","parser"].includes(l))continue;let c=l,d=r.renderer[c],f=a[c];a[c]=(...g)=>{let h=d.apply(a,g);return h===!1&&(h=f.apply(a,g)),h||""}}i.renderer=a}if(r.tokenizer){let a=this.defaults.tokenizer||new Jh(this.defaults);for(let l in r.tokenizer){if(!(l in a))throw new Error(`tokenizer '${l}' does not exist`);if(["options","rules","lexer"].includes(l))continue;let c=l,d=r.tokenizer[c],f=a[c];a[c]=(...g)=>{let h=d.apply(a,g);return h===!1&&(h=f.apply(a,g)),h}}i.tokenizer=a}if(r.hooks){let a=this.defaults.hooks||new yc;for(let l in r.hooks){if(!(l in a))throw new Error(`hook '${l}' does not exist`);if(["options","block"].includes(l))continue;let c=l,d=r.hooks[c],f=a[c];yc.passThroughHooks.has(l)?a[c]=g=>{if(this.defaults.async&&yc.passThroughHooksRespectAsync.has(l))return(async()=>{let b=await d.call(a,g);return f.call(a,b)})();let h=d.call(a,g);return f.call(a,h)}:a[c]=(...g)=>{if(this.defaults.async)return(async()=>{let b=await d.apply(a,g);return b===!1&&(b=await f.apply(a,g)),b})();let h=d.apply(a,g);return h===!1&&(h=f.apply(a,g)),h}}i.hooks=a}if(r.walkTokens){let a=this.defaults.walkTokens,l=r.walkTokens;i.walkTokens=function(c){let d=[];return d.push(l.call(this,c)),a&&(d=d.concat(a.call(this,c))),d}}this.defaults={...this.defaults,...i}}),this}setOptions(t){return this.defaults={...this.defaults,...t},this}lexer(t,n){return is.lex(t,n??this.defaults)}parser(t,n){return ds.parse(t,n??this.defaults)}parseMarkdown(t){return(n,r)=>{let i={...r},a={...this.defaults,...i},l=this.onError(!!a.silent,!!a.async);if(this.defaults.async===!0&&i.async===!1)return l(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof n>"u"||n===null)return l(new Error("marked(): input parameter is undefined or null"));if(typeof n!="string")return l(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(n)+", string expected"));if(a.hooks&&(a.hooks.options=a,a.hooks.block=t),a.async)return(async()=>{let c=a.hooks?await a.hooks.preprocess(n):n,d=await(a.hooks?await a.hooks.provideLexer(t):t?is.lex:is.lexInline)(c,a),f=a.hooks?await a.hooks.processAllTokens(d):d;a.walkTokens&&await Promise.all(this.walkTokens(f,a.walkTokens));let g=await(a.hooks?await a.hooks.provideParser(t):t?ds.parse:ds.parseInline)(f,a);return a.hooks?await a.hooks.postprocess(g):g})().catch(l);try{a.hooks&&(n=a.hooks.preprocess(n));let c=(a.hooks?a.hooks.provideLexer(t):t?is.lex:is.lexInline)(n,a);a.hooks&&(c=a.hooks.processAllTokens(c)),a.walkTokens&&this.walkTokens(c,a.walkTokens);let d=(a.hooks?a.hooks.provideParser(t):t?ds.parse:ds.parseInline)(c,a);return a.hooks&&(d=a.hooks.postprocess(d)),d}catch(c){return l(c)}}}onError(t,n){return r=>{if(r.message+=`
647
+ Please report this to https://github.com/markedjs/marked.`,t){let i="<p>An error occurred:</p><pre>"+Cs(r.message+"",!0)+"</pre>";return n?Promise.resolve(i):i}if(n)return Promise.reject(r);throw r}}},go=new cee;function Qt(e,t){return go.parse(e,t)}Qt.options=Qt.setOptions=function(e){return go.setOptions(e),Qt.defaults=go.defaults,g4(Qt.defaults),Qt};Qt.getDefaults=oy;Qt.defaults=Ao;Qt.use=function(...e){return go.use(...e),Qt.defaults=go.defaults,g4(Qt.defaults),Qt};Qt.walkTokens=function(e,t){return go.walkTokens(e,t)};Qt.parseInline=go.parseInline;Qt.Parser=ds;Qt.parser=ds.parse;Qt.Renderer=ep;Qt.TextRenderer=my;Qt.Lexer=is;Qt.lexer=is.lex;Qt.Tokenizer=Jh;Qt.Hooks=yc;Qt.parse=Qt;Qt.options;Qt.setOptions;Qt.use;Qt.walkTokens;Qt.parseInline;ds.parse;is.lex;var dee=300,fee="300px",hee=500;function pee(e={}){let{immediate:t=!1,debounceDelay:n=dee,rootMargin:r=fee,idleTimeout:i=hee}=e,[a,l]=E.useState(!1),c=E.useRef(null),d=E.useRef(null),f=E.useRef(null),g=E.useMemo(()=>x=>{let v=Date.now();return window.setTimeout(()=>{x({didTimeout:!1,timeRemaining:()=>Math.max(0,50-(Date.now()-v))})},1)},[]),h=E.useMemo(()=>typeof window<"u"&&window.requestIdleCallback?(x,v)=>window.requestIdleCallback(x,v):g,[g]),b=E.useMemo(()=>typeof window<"u"&&window.cancelIdleCallback?x=>window.cancelIdleCallback(x):x=>{clearTimeout(x)},[]);return E.useEffect(()=>{if(t){l(!0);return}let x=c.current;if(!x)return;d.current&&(clearTimeout(d.current),d.current=null),f.current&&(b(f.current),f.current=null);let v=()=>{d.current&&(clearTimeout(d.current),d.current=null),f.current&&(b(f.current),f.current=null)},w=A=>{f.current=h(R=>{R.timeRemaining()>0||R.didTimeout?(l(!0),A.disconnect()):f.current=h(()=>{l(!0),A.disconnect()},{timeout:i/2})},{timeout:i})},k=A=>{v(),d.current=window.setTimeout(()=>{var R,M;let _=A.takeRecords();(_.length===0||(M=(R=_.at(-1))==null?void 0:R.isIntersecting)!=null&&M)&&w(A)},n)},C=(A,R)=>{A.isIntersecting?k(R):v()},N=new IntersectionObserver(A=>{for(let R of A)C(R,N)},{rootMargin:r,threshold:0});return N.observe(x),()=>{d.current&&clearTimeout(d.current),f.current&&b(f.current),N.disconnect()}},[t,n,r,i,b,h]),{shouldRender:a,containerRef:c}}var w4=/\s/,mee=/^\s+$/,gee=new Set(["code","pre","svg","math","annotation"]),bee=e=>typeof e=="object"&&e!==null&&"type"in e&&e.type==="element",xee=e=>e.some(t=>bee(t)&&gee.has(t.tagName)),yee=e=>{let t=[],n="",r=!1;for(let i of e){let a=w4.test(i);a!==r&&n&&(t.push(n),n=""),n+=i,r=a}return n&&t.push(n),t},Eee=e=>{let t=[],n="";for(let r of e)w4.test(r)?n+=r:(n&&(t.push(n),n=""),t.push(r));return n&&t.push(n),t},vee=(e,t,n,r,i,a)=>{let l=`--sd-animation:sd-${t};--sd-duration:${i?0:n}ms;--sd-easing:${r}`;return a&&(l+=`;--sd-delay:${a}ms`),{type:"element",tagName:"span",properties:{"data-sd-animate":!0,style:l},children:[{type:"text",value:e}]}},Tee=(e,t,n,r,i)=>{let a=t.at(-1);if(!(a&&"children"in a))return;if(xee(t))return El;let l=a,c=l.children.indexOf(e);if(c===-1)return;let d=e.value;if(!d.trim()){i.count+=d.length;return}let f=n.sep==="char"?Eee(d):yee(d),g=r.prevContentLength,h=f.map(b=>{let x=i.count;if(i.count+=b.length,mee.test(b))return{type:"text",value:b};let v=g>0&&x<g,w=v?0:i.newIndex++*n.stagger;return vee(b,n.animation,n.duration,n.easing,v,w)});return l.children.splice(c,1,...h),c+h.length},See=0;function h1(e){var t,n,r,i,a;let l={animation:(t=e?.animation)!=null?t:"fadeIn",duration:(n=e?.duration)!=null?n:150,easing:(r=e?.easing)!=null?r:"ease",sep:(i=e?.sep)!=null?i:"word",stagger:(a=e?.stagger)!=null?a:40},c={prevContentLength:0,lastRenderCharCount:0},d=See++,f=()=>g=>{let h={count:0,newIndex:0};jx(g,"text",(b,x)=>Tee(b,x,l,c,h)),c.lastRenderCharCount=h.count,c.prevContentLength=0};return Object.defineProperty(f,"name",{value:`rehypeAnimate$${d}`}),{name:"animate",type:"animate",rehypePlugin:f,setPrevContentLength(g){c.prevContentLength=g},getLastRenderCharCount(){let g=c.lastRenderCharCount;return c.lastRenderCharCount=0,g}}}h1();var N4=E.createContext(!1),Cee=()=>E.useContext(N4),gy=(...e)=>T3(ap(e)),kee=(e,t)=>{if(!e||!t)return t;let n=`${e}:`;return t.split(/\s+/).filter(Boolean).map(r=>r.startsWith(n)?r:`${e}:${r}`).join(" ")},wee=e=>e?(...t)=>kee(e,T3(ap(t))):gy,Nl=(e,t,n)=>{let r=typeof t=="string"&&n.startsWith("text/csv")?"\uFEFF":"",i=typeof t=="string"?new Blob([r+t],{type:n}):t,a=URL.createObjectURL(i),l=document.createElement("a");l.href=a,l.download=e,document.body.appendChild(l),l.click(),document.body.removeChild(l),URL.revokeObjectURL(a)},p1=E.createContext(gy),kt=()=>E.useContext(p1),Nee=gy("block","before:content-[counter(line)]","before:inline-block","before:[counter-increment:line]","before:w-6","before:mr-4","before:text-[13px]","before:text-right","before:text-muted-foreground/50","before:font-mono","before:select-none"),Aee=e=>{let t={};for(let n of e.split(";")){let r=n.indexOf(":");if(r>0){let i=n.slice(0,r).trim(),a=n.slice(r+1).trim();i&&a&&(t[i]=a)}}return t},_ee=E.memo(({children:e,result:t,language:n,className:r,startLine:i,lineNumbers:a=!0,...l})=>{let c=kt(),d=E.useMemo(()=>c(Nee),[c]),f=E.useMemo(()=>{let g={};return t.bg&&(g["--sdm-bg"]=t.bg),t.fg&&(g["--sdm-fg"]=t.fg),t.rootStyle&&Object.assign(g,Aee(t.rootStyle)),g},[t.bg,t.fg,t.rootStyle]);return m.jsx("div",{className:c(r,"overflow-x-auto rounded-md border border-border bg-background p-4 text-sm"),"data-language":n,"data-streamdown":"code-block-body",...l,children:m.jsx("pre",{className:c(r,"bg-[var(--sdm-bg,inherit]","dark:bg-[var(--shiki-dark-bg,var(--sdm-bg,inherit)]"),style:f,children:m.jsx("code",{className:a?c("[counter-increment:line_0] [counter-reset:line]"):void 0,style:a&&i&&i>1?{counterReset:`line ${i-1}`}:void 0,children:t.tokens.map((g,h)=>m.jsx("span",{className:a?d:void 0,children:g.length===0||g.length===1&&g[0].content===""?`
648
+ `:g.map((b,x)=>{let v={},w=!!b.bgColor;if(b.color&&(v["--sdm-c"]=b.color),b.bgColor&&(v["--sdm-tbg"]=b.bgColor),b.htmlStyle)for(let[k,C]of Object.entries(b.htmlStyle))k==="color"?v["--sdm-c"]=C:k==="background-color"?(v["--sdm-tbg"]=C,w=!0):v[k]=C;return m.jsx("span",{className:c("text-[var(--sdm-c,inherit)]","dark:text-[var(--shiki-dark,var(--sdm-c,inherit))]",w&&"bg-[var(--sdm-tbg)]",w&&"dark:bg-[var(--shiki-dark-bg,var(--sdm-tbg))]"),style:v,...b.htmlAttrs,children:b.content},x)})},h))})})})},(e,t)=>e.result===t.result&&e.language===t.language&&e.className===t.className&&e.startLine===t.startLine&&e.lineNumbers===t.lineNumbers),Ree=({className:e,language:t,style:n,isIncomplete:r,...i})=>{let a=kt();return m.jsx("div",{className:a("my-4 flex w-full flex-col gap-2 rounded-xl border border-border bg-sidebar p-2",e),"data-incomplete":r||void 0,"data-language":t,"data-streamdown":"code-block",style:{contentVisibility:"auto",containIntrinsicSize:"auto 200px",...n},...i})},A4=E.createContext({code:""}),_4=()=>E.useContext(A4),Oee=({language:e})=>{let t=kt();return m.jsx("div",{className:t("flex h-8 items-center text-muted-foreground text-xs"),"data-language":e,"data-streamdown":"code-block-header",children:m.jsx("span",{className:t("ml-1 font-mono lowercase"),children:e})})},Iee=e=>{let t=e.length;for(;t>0&&e[t-1]===`
649
+ `;)t--;return e.slice(0,t)},Mee=E.lazy(()=>Pl(()=>import("./highlighted-body-OFNGDK62-FrfZbPjC.js"),[]).then(e=>({default:e.HighlightedCodeBlockBody}))),Lee=({code:e,language:t,className:n,children:r,isIncomplete:i=!1,startLine:a,lineNumbers:l,...c})=>{let d=kt(),f=E.useMemo(()=>Iee(e),[e]),g=E.useMemo(()=>({bg:"transparent",fg:"inherit",tokens:f.split(`
650
+ `).map(h=>[{content:h,color:"inherit",bgColor:"transparent",htmlStyle:{},offset:0}])}),[f]);return m.jsx(A4.Provider,{value:{code:e},children:m.jsxs(Ree,{isIncomplete:i,language:t,children:[m.jsx(Oee,{language:t}),r?m.jsx("div",{className:d("pointer-events-none sticky top-2 z-10 -mt-10 flex h-8 items-center justify-end"),children:m.jsx("div",{className:d("pointer-events-auto flex shrink-0 items-center gap-2 rounded-md border border-sidebar bg-sidebar/80 px-1.5 py-1 supports-[backdrop-filter]:bg-sidebar/70 supports-[backdrop-filter]:backdrop-blur"),"data-streamdown":"code-block-actions",children:r})}):null,m.jsx(E.Suspense,{fallback:m.jsx(_ee,{className:n,language:t,lineNumbers:l,result:g,startLine:a,...c}),children:m.jsx(Mee,{className:n,code:f,language:t,lineNumbers:l,raw:g,startLine:a,...c})})]})})},Dee=e=>m.jsx("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:m.jsx("path",{clipRule:"evenodd",d:"M15.5607 3.99999L15.0303 4.53032L6.23744 13.3232C5.55403 14.0066 4.44599 14.0066 3.76257 13.3232L4.2929 12.7929L3.76257 13.3232L0.969676 10.5303L0.439346 9.99999L1.50001 8.93933L2.03034 9.46966L4.82323 12.2626C4.92086 12.3602 5.07915 12.3602 5.17678 12.2626L13.9697 3.46966L14.5 2.93933L15.5607 3.99999Z",fill:"currentColor",fillRule:"evenodd"})}),Pee=e=>m.jsx("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:m.jsx("path",{clipRule:"evenodd",d:"M2.75 0.5C1.7835 0.5 1 1.2835 1 2.25V9.75C1 10.7165 1.7835 11.5 2.75 11.5H3.75H4.5V10H3.75H2.75C2.61193 10 2.5 9.88807 2.5 9.75V2.25C2.5 2.11193 2.61193 2 2.75 2H8.25C8.38807 2 8.5 2.11193 8.5 2.25V3H10V2.25C10 1.2835 9.2165 0.5 8.25 0.5H2.75ZM7.75 4.5C6.7835 4.5 6 5.2835 6 6.25V13.75C6 14.7165 6.7835 15.5 7.75 15.5H13.25C14.2165 15.5 15 14.7165 15 13.75V6.25C15 5.2835 14.2165 4.5 13.25 4.5H7.75ZM7.5 6.25C7.5 6.11193 7.61193 6 7.75 6H13.25C13.3881 6 13.5 6.11193 13.5 6.25V13.75C13.5 13.8881 13.3881 14 13.25 14H7.75C7.61193 14 7.5 13.8881 7.5 13.75V6.25Z",fill:"currentColor",fillRule:"evenodd"})}),jee=e=>m.jsx("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:m.jsx("path",{clipRule:"evenodd",d:"M8.75 1V1.75V8.68934L10.7197 6.71967L11.25 6.18934L12.3107 7.25L11.7803 7.78033L8.70711 10.8536C8.31658 11.2441 7.68342 11.2441 7.29289 10.8536L4.21967 7.78033L3.68934 7.25L4.75 6.18934L5.28033 6.71967L7.25 8.68934V1.75V1H8.75ZM13.5 9.25V13.5H2.5V9.25V8.5H1V9.25V14C1 14.5523 1.44771 15 2 15H14C14.5523 15 15 14.5523 15 14V9.25V8.5H13.5V9.25Z",fill:"currentColor",fillRule:"evenodd"})}),Bee=e=>m.jsxs("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:[m.jsx("path",{d:"M8 0V4",stroke:"currentColor",strokeWidth:"1.5"}),m.jsx("path",{d:"M8 16V12",opacity:"0.5",stroke:"currentColor",strokeWidth:"1.5"}),m.jsx("path",{d:"M3.29773 1.52783L5.64887 4.7639",opacity:"0.9",stroke:"currentColor",strokeWidth:"1.5"}),m.jsx("path",{d:"M12.7023 1.52783L10.3511 4.7639",opacity:"0.1",stroke:"currentColor",strokeWidth:"1.5"}),m.jsx("path",{d:"M12.7023 14.472L10.3511 11.236",opacity:"0.4",stroke:"currentColor",strokeWidth:"1.5"}),m.jsx("path",{d:"M3.29773 14.472L5.64887 11.236",opacity:"0.6",stroke:"currentColor",strokeWidth:"1.5"}),m.jsx("path",{d:"M15.6085 5.52783L11.8043 6.7639",opacity:"0.2",stroke:"currentColor",strokeWidth:"1.5"}),m.jsx("path",{d:"M0.391602 10.472L4.19583 9.23598",opacity:"0.7",stroke:"currentColor",strokeWidth:"1.5"}),m.jsx("path",{d:"M15.6085 10.4722L11.8043 9.2361",opacity:"0.3",stroke:"currentColor",strokeWidth:"1.5"}),m.jsx("path",{d:"M0.391602 5.52783L4.19583 6.7639",opacity:"0.8",stroke:"currentColor",strokeWidth:"1.5"})]}),Hee=e=>m.jsx("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:m.jsx("path",{clipRule:"evenodd",d:"M1 5.25V6H2.5V5.25V2.5H5.25H6V1H5.25H2C1.44772 1 1 1.44772 1 2V5.25ZM5.25 14.9994H6V13.4994H5.25H2.5V10.7494V9.99939H1V10.7494V13.9994C1 14.5517 1.44772 14.9994 2 14.9994H5.25ZM15 10V10.75V14C15 14.5523 14.5523 15 14 15H10.75H10V13.5H10.75H13.5V10.75V10H15ZM10.75 1H10V2.5H10.75H13.5V5.25V6H15V5.25V2C15 1.44772 14.5523 1 14 1H10.75Z",fill:"currentColor",fillRule:"evenodd"})}),Uee=e=>m.jsx("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:m.jsx("path",{clipRule:"evenodd",d:"M13.5 8C13.5 4.96643 11.0257 2.5 7.96452 2.5C5.42843 2.5 3.29365 4.19393 2.63724 6.5H5.25H6V8H5.25H0.75C0.335787 8 0 7.66421 0 7.25V2.75V2H1.5V2.75V5.23347C2.57851 2.74164 5.06835 1 7.96452 1C11.8461 1 15 4.13001 15 8C15 11.87 11.8461 15 7.96452 15C5.62368 15 3.54872 13.8617 2.27046 12.1122L1.828 11.5066L3.03915 10.6217L3.48161 11.2273C4.48831 12.6051 6.12055 13.5 7.96452 13.5C11.0257 13.5 13.5 11.0336 13.5 8Z",fill:"currentColor",fillRule:"evenodd"})}),zee=e=>m.jsx("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:m.jsx("path",{clipRule:"evenodd",d:"M12.4697 13.5303L13 14.0607L14.0607 13L13.5303 12.4697L9.06065 7.99999L13.5303 3.53032L14.0607 2.99999L13 1.93933L12.4697 2.46966L7.99999 6.93933L3.53032 2.46966L2.99999 1.93933L1.93933 2.99999L2.46966 3.53032L6.93933 7.99999L2.46966 12.4697L1.93933 13L2.99999 14.0607L3.53032 13.5303L7.99999 9.06065L12.4697 13.5303Z",fill:"currentColor",fillRule:"evenodd"})}),Fee=e=>m.jsx("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:m.jsx("path",{clipRule:"evenodd",d:"M13.5 10.25V13.25C13.5 13.3881 13.3881 13.5 13.25 13.5H2.75C2.61193 13.5 2.5 13.3881 2.5 13.25L2.5 2.75C2.5 2.61193 2.61193 2.5 2.75 2.5H5.75H6.5V1H5.75H2.75C1.7835 1 1 1.7835 1 2.75V13.25C1 14.2165 1.7835 15 2.75 15H13.25C14.2165 15 15 14.2165 15 13.25V10.25V9.5H13.5V10.25ZM9 1H9.75H14.2495C14.6637 1 14.9995 1.33579 14.9995 1.75V6.25V7H13.4995V6.25V3.56066L8.53033 8.52978L8 9.06011L6.93934 7.99945L7.46967 7.46912L12.4388 2.5H9.75H9V1Z",fill:"currentColor",fillRule:"evenodd"})}),$ee=e=>m.jsx("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:m.jsx("path",{clipRule:"evenodd",d:"M1.5 6.5C1.5 3.73858 3.73858 1.5 6.5 1.5C9.26142 1.5 11.5 3.73858 11.5 6.5C11.5 9.26142 9.26142 11.5 6.5 11.5C3.73858 11.5 1.5 9.26142 1.5 6.5ZM6.5 0C2.91015 0 0 2.91015 0 6.5C0 10.0899 2.91015 13 6.5 13C8.02469 13 9.42677 12.475 10.5353 11.596L13.9697 15.0303L14.5 15.5607L15.5607 14.5L15.0303 13.9697L11.596 10.5353C12.475 9.42677 13 8.02469 13 6.5C13 2.91015 10.0899 0 6.5 0ZM4.125 5.875H4.75H5.875V4.75V4.125H7.125V4.75V5.875H8.25H8.875V7.125H8.25H7.125V8.25V8.875H5.875V8.25V7.125H4.75H4.125V5.875Z",fill:"currentColor",fillRule:"evenodd"})}),Vee=e=>m.jsx("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:m.jsx("path",{clipRule:"evenodd",d:"M1.5 6.5C1.5 3.73858 3.73858 1.5 6.5 1.5C9.26142 1.5 11.5 3.73858 11.5 6.5C11.5 9.26142 9.26142 11.5 6.5 11.5C3.73858 11.5 1.5 9.26142 1.5 6.5ZM6.5 0C2.91015 0 0 2.91015 0 6.5C0 10.0899 2.91015 13 6.5 13C8.02469 13 9.42677 12.475 10.5353 11.596L13.9697 15.0303L14.5 15.5607L15.5607 14.5L15.0303 13.9697L11.596 10.5353C12.475 9.42677 13 8.02469 13 6.5C13 2.91015 10.0899 0 6.5 0ZM4.125 5.875H4.75H8.25H8.875V7.125H8.25H4.75H4.125V5.875Z",fill:"currentColor",fillRule:"evenodd"})}),Ec={CheckIcon:Dee,CopyIcon:Pee,DownloadIcon:jee,ExternalLinkIcon:Fee,Loader2Icon:Bee,Maximize2Icon:Hee,RotateCcwIcon:Uee,XIcon:zee,ZoomInIcon:$ee,ZoomOutIcon:Vee},R4=E.createContext(Ec),qee=(e,t)=>{if(e===t)return!0;if(!(e&&t))return e===t;let n=Object.keys(e),r=Object.keys(t);return n.length!==r.length?!1:n.every(i=>e[i]===t[i])},Yk=({icons:e,children:t})=>{let n=E.useRef(e),r=E.useRef(e?{...Ec,...e}:Ec);qee(n.current,e)||(n.current=e,r.current=e?{...Ec,...e}:Ec);let i=r.current;return m.jsx(R4.Provider,{value:i,children:t})},gs=()=>E.useContext(R4),O4={copyCode:"Copy Code",downloadFile:"Download file",downloadDiagram:"Download diagram",downloadDiagramAsSvg:"Download diagram as SVG",downloadDiagramAsPng:"Download diagram as PNG",downloadDiagramAsMmd:"Download diagram as MMD",viewFullscreen:"View fullscreen",exitFullscreen:"Exit fullscreen",mermaidFormatSvg:"SVG",mermaidFormatPng:"PNG",mermaidFormatMmd:"MMD",copyTable:"Copy table",copyTableAsMarkdown:"Copy table as Markdown",copyTableAsCsv:"Copy table as CSV",copyTableAsTsv:"Copy table as TSV",downloadTable:"Download table",downloadTableAsCsv:"Download table as CSV",downloadTableAsMarkdown:"Download table as Markdown",tableFormatMarkdown:"Markdown",tableFormatCsv:"CSV",tableFormatTsv:"TSV",imageNotAvailable:"Image not available",downloadImage:"Download image",openExternalLink:"Open external link?",externalLinkWarning:"You're about to visit an external website.",close:"Close",copyLink:"Copy link",copied:"Copied",openLink:"Open link"},m1=E.createContext(O4),yi=()=>E.useContext(m1),Gk=({onCopy:e,onError:t,timeout:n=2e3,children:r,className:i,code:a,...l})=>{let c=kt(),[d,f]=E.useState(!1),g=E.useRef(0),{code:h}=_4(),{isAnimating:b}=E.useContext(qr),x=yi(),v=a??h,w=async()=>{var N;if(typeof window>"u"||!((N=navigator?.clipboard)!=null&&N.writeText)){t?.(new Error("Clipboard API not available"));return}try{d||(await navigator.clipboard.writeText(v),f(!0),e?.(),g.current=window.setTimeout(()=>f(!1),n))}catch(A){t?.(A)}};E.useEffect(()=>()=>{window.clearTimeout(g.current)},[]);let k=gs(),C=d?k.CheckIcon:k.CopyIcon;return m.jsx("button",{className:c("cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50",i),"data-streamdown":"code-block-copy-button",disabled:b,onClick:w,title:x.copyCode,type:"button",...l,children:r??m.jsx(C,{size:14})})},Xk={"1c":"1c","1c-query":"1cq",abap:"abap","actionscript-3":"as",ada:"ada",adoc:"adoc","angular-html":"html","angular-ts":"ts",apache:"conf",apex:"cls",apl:"apl",applescript:"applescript",ara:"ara",asciidoc:"adoc",asm:"asm",astro:"astro",awk:"awk",ballerina:"bal",bash:"sh",bat:"bat",batch:"bat",be:"be",beancount:"beancount",berry:"berry",bibtex:"bib",bicep:"bicep",blade:"blade.php",bsl:"bsl",c:"c","c#":"cs","c++":"cpp",cadence:"cdc",cairo:"cairo",cdc:"cdc",clarity:"clar",clj:"clj",clojure:"clj","closure-templates":"soy",cmake:"cmake",cmd:"cmd",cobol:"cob",codeowners:"CODEOWNERS",codeql:"ql",coffee:"coffee",coffeescript:"coffee","common-lisp":"lisp",console:"sh",coq:"v",cpp:"cpp",cql:"cql",crystal:"cr",cs:"cs",csharp:"cs",css:"css",csv:"csv",cue:"cue",cypher:"cql",d:"d",dart:"dart",dax:"dax",desktop:"desktop",diff:"diff",docker:"dockerfile",dockerfile:"dockerfile",dotenv:"env","dream-maker":"dm",edge:"edge",elisp:"el",elixir:"ex",elm:"elm","emacs-lisp":"el",erb:"erb",erl:"erl",erlang:"erl",f:"f","f#":"fs",f03:"f03",f08:"f08",f18:"f18",f77:"f77",f90:"f90",f95:"f95",fennel:"fnl",fish:"fish",fluent:"ftl",for:"for","fortran-fixed-form":"f","fortran-free-form":"f90",fs:"fs",fsharp:"fs",fsl:"fsl",ftl:"ftl",gdresource:"tres",gdscript:"gd",gdshader:"gdshader",genie:"gs",gherkin:"feature","git-commit":"gitcommit","git-rebase":"gitrebase",gjs:"js",gleam:"gleam","glimmer-js":"js","glimmer-ts":"ts",glsl:"glsl",gnuplot:"plt",go:"go",gql:"gql",graphql:"graphql",groovy:"groovy",gts:"gts",hack:"hack",haml:"haml",handlebars:"hbs",haskell:"hs",haxe:"hx",hbs:"hbs",hcl:"hcl",hjson:"hjson",hlsl:"hlsl",hs:"hs",html:"html","html-derivative":"html",http:"http",hxml:"hxml",hy:"hy",imba:"imba",ini:"ini",jade:"jade",java:"java",javascript:"js",jinja:"jinja",jison:"jison",jl:"jl",js:"js",json:"json",json5:"json5",jsonc:"jsonc",jsonl:"jsonl",jsonnet:"jsonnet",jssm:"jssm",jsx:"jsx",julia:"jl",kotlin:"kt",kql:"kql",kt:"kt",kts:"kts",kusto:"kql",latex:"tex",lean:"lean",lean4:"lean",less:"less",liquid:"liquid",lisp:"lisp",lit:"lit",llvm:"ll",log:"log",logo:"logo",lua:"lua",luau:"luau",make:"mak",makefile:"mak",markdown:"md",marko:"marko",matlab:"m",md:"md",mdc:"mdc",mdx:"mdx",mediawiki:"wiki",mermaid:"mmd",mips:"s",mipsasm:"s",mmd:"mmd",mojo:"mojo",move:"move",nar:"nar",narrat:"narrat",nextflow:"nf",nf:"nf",nginx:"conf",nim:"nim",nix:"nix",nu:"nu",nushell:"nu",objc:"m","objective-c":"m","objective-cpp":"mm",ocaml:"ml",pascal:"pas",perl:"pl",perl6:"p6",php:"php",plsql:"pls",po:"po",polar:"polar",postcss:"pcss",pot:"pot",potx:"potx",powerquery:"pq",powershell:"ps1",prisma:"prisma",prolog:"pl",properties:"properties",proto:"proto",protobuf:"proto",ps:"ps",ps1:"ps1",pug:"pug",puppet:"pp",purescript:"purs",py:"py",python:"py",ql:"ql",qml:"qml",qmldir:"qmldir",qss:"qss",r:"r",racket:"rkt",raku:"raku",razor:"cshtml",rb:"rb",reg:"reg",regex:"regex",regexp:"regexp",rel:"rel",riscv:"s",rs:"rs",rst:"rst",ruby:"rb",rust:"rs",sas:"sas",sass:"sass",scala:"scala",scheme:"scm",scss:"scss",sdbl:"sdbl",sh:"sh",shader:"shader",shaderlab:"shader",shell:"sh",shellscript:"sh",shellsession:"sh",smalltalk:"st",solidity:"sol",soy:"soy",sparql:"rq",spl:"spl",splunk:"spl",sql:"sql","ssh-config":"config",stata:"do",styl:"styl",stylus:"styl",svelte:"svelte",swift:"swift","system-verilog":"sv",systemd:"service",talon:"talon",talonscript:"talon",tasl:"tasl",tcl:"tcl",templ:"templ",terraform:"tf",tex:"tex",tf:"tf",tfvars:"tfvars",toml:"toml",ts:"ts","ts-tags":"ts",tsp:"tsp",tsv:"tsv",tsx:"tsx",turtle:"ttl",twig:"twig",typ:"typ",typescript:"ts",typespec:"tsp",typst:"typ",v:"v",vala:"vala",vb:"vb",verilog:"v",vhdl:"vhdl",vim:"vim",viml:"vim",vimscript:"vim",vue:"vue","vue-html":"html","vue-vine":"vine",vy:"vy",vyper:"vy",wasm:"wasm",wenyan:"wy",wgsl:"wgsl",wiki:"wiki",wikitext:"wiki",wit:"wit",wl:"wl",wolfram:"wl",xml:"xml",xsl:"xsl",yaml:"yaml",yml:"yml",zenscript:"zs",zig:"zig",zsh:"zsh",文言:"wy"},Yee=({onDownload:e,onError:t,language:n,children:r,className:i,code:a,...l})=>{let c=kt(),{code:d}=_4(),{isAnimating:f}=E.useContext(qr),g=yi(),h=gs(),b=a??d,x=`file.${n&&n in Xk?Xk[n]:"txt"}`,v="text/plain",w=()=>{try{Nl(x,b,v),e?.()}catch(k){t?.(k)}};return m.jsx("button",{className:c("cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50",i),"data-streamdown":"code-block-download-button",disabled:f,onClick:w,title:g.downloadFile,type:"button",...l,children:r??m.jsx(h.DownloadIcon,{size:14})})},Kk=()=>{let{Loader2Icon:e}=gs(),t=kt();return m.jsxs("div",{className:t("w-full divide-y divide-border overflow-hidden rounded-xl border border-border"),children:[m.jsx("div",{className:t("h-[46px] w-full bg-muted/80")}),m.jsx("div",{className:t("flex w-full items-center justify-center p-4"),children:m.jsx(e,{className:t("size-4 animate-spin")})})]})},Gee=/\.[^/.]+$/,Xee=({node:e,className:t,src:n,alt:r,onLoad:i,onError:a,...l})=>{let{DownloadIcon:c}=gs(),d=kt(),f=E.useRef(null),[g,h]=E.useState(!1),[b,x]=E.useState(!1),v=yi(),w=l.width!=null||l.height!=null,k=(g||w)&&!b,C=b&&!w;E.useEffect(()=>{let M=f.current;if(M!=null&&M.complete){let _=M.naturalWidth>0;h(_),x(!_)}},[]);let N=E.useCallback(M=>{h(!0),x(!1),i?.(M)},[i]),A=E.useCallback(M=>{h(!1),x(!0),a?.(M)},[a]),R=async()=>{if(n)try{let M=await(await fetch(n)).blob(),_=new URL(n,window.location.origin).pathname.split("/").pop()||"",D=_.split(".").pop(),I=_.includes(".")&&D!==void 0&&D.length<=4,U="";if(I)U=_;else{let j=M.type,X="png";j.includes("jpeg")||j.includes("jpg")?X="jpg":j.includes("png")?X="png":j.includes("svg")?X="svg":j.includes("gif")?X="gif":j.includes("webp")&&(X="webp"),U=`${(r||_||"image").replace(Gee,"")}.${X}`}Nl(U,M,M.type)}catch{window.open(n,"_blank")}};return n?m.jsxs("div",{className:d("group relative my-4 inline-block"),"data-streamdown":"image-wrapper",children:[m.jsx("img",{alt:r,className:d("max-w-full rounded-lg",C&&"hidden",t),"data-streamdown":"image",onError:A,onLoad:N,ref:f,src:n,...l}),C&&m.jsx("span",{className:d("text-muted-foreground text-xs italic"),"data-streamdown":"image-fallback",children:v.imageNotAvailable}),m.jsx("div",{className:d("pointer-events-none absolute inset-0 hidden rounded-lg bg-black/10 group-hover:block")}),k&&m.jsx("button",{className:d("absolute right-2 bottom-2 flex h-8 w-8 cursor-pointer items-center justify-center rounded-md border border-border bg-background/90 shadow-sm backdrop-blur-sm transition-all duration-200 hover:bg-background","opacity-0 group-hover:opacity-100"),onClick:R,title:v.downloadImage,type:"button",children:m.jsx(c,{size:14})})]}):null},Mc=0,by=()=>{Mc+=1,Mc===1&&(document.body.style.overflow="hidden")},xy=()=>{Mc=Math.max(0,Mc-1),Mc===0&&(document.body.style.overflow="")},Kee=({url:e,isOpen:t,onClose:n,onConfirm:r})=>{let{CheckIcon:i,CopyIcon:a,ExternalLinkIcon:l,XIcon:c}=gs(),d=kt(),[f,g]=E.useState(!1),h=yi(),b=E.useCallback(async()=>{try{await navigator.clipboard.writeText(e),g(!0),setTimeout(()=>g(!1),2e3)}catch{}},[e]),x=E.useCallback(()=>{r(),n()},[r,n]);return E.useEffect(()=>{if(t){by();let v=w=>{w.key==="Escape"&&n()};return document.addEventListener("keydown",v),()=>{document.removeEventListener("keydown",v),xy()}}},[t,n]),t?m.jsx("div",{className:d("fixed inset-0 z-50 flex items-center justify-center bg-background/50 backdrop-blur-sm"),"data-streamdown":"link-safety-modal",onClick:n,onKeyDown:v=>{v.key==="Escape"&&n()},role:"button",tabIndex:0,children:m.jsxs("div",{className:d("relative mx-4 flex w-full max-w-md flex-col gap-4 rounded-xl border bg-background p-6 shadow-lg"),onClick:v=>v.stopPropagation(),onKeyDown:v=>v.stopPropagation(),role:"presentation",children:[m.jsx("button",{className:d("absolute top-4 right-4 rounded-md p-1 text-muted-foreground transition-all hover:bg-muted hover:text-foreground"),onClick:n,title:h.close,type:"button",children:m.jsx(c,{size:16})}),m.jsxs("div",{className:d("flex flex-col gap-2"),children:[m.jsxs("div",{className:d("flex items-center gap-2 font-semibold text-lg"),children:[m.jsx(l,{size:20}),m.jsx("span",{children:h.openExternalLink})]}),m.jsx("p",{className:d("text-muted-foreground text-sm"),children:h.externalLinkWarning})]}),m.jsx("div",{className:d("break-all rounded-md bg-muted p-3 font-mono text-sm",e.length>100&&"max-h-32 overflow-y-auto"),children:e}),m.jsxs("div",{className:d("flex gap-2"),children:[m.jsx("button",{className:d("flex flex-1 items-center justify-center gap-2 rounded-md border bg-background px-4 py-2 font-medium text-sm transition-all hover:bg-muted"),onClick:b,type:"button",children:f?m.jsxs(m.Fragment,{children:[m.jsx(i,{size:14}),m.jsx("span",{children:h.copied})]}):m.jsxs(m.Fragment,{children:[m.jsx(a,{size:14}),m.jsx("span",{children:h.copyLink})]})}),m.jsxs("button",{className:d("flex flex-1 items-center justify-center gap-2 rounded-md bg-primary px-4 py-2 font-medium text-primary-foreground text-sm transition-all hover:bg-primary/90"),onClick:x,type:"button",children:[m.jsx(l,{size:14}),m.jsx("span",{children:h.openLink})]})]})]})}):null},g1=E.createContext(null),yy=()=>E.useContext(g1),bre=()=>{var e;let t=yy();return(e=t?.code)!=null?e:null},Ey=()=>{var e;let t=yy();return(e=t?.mermaid)!=null?e:null},Qee=e=>{var t;let n=yy();return n!=null&&n.renderers&&e&&(t=n.renderers.find(r=>Array.isArray(r.language)?r.language.includes(e):r.language===e))!=null?t:null},Wee=(e,t)=>{var n;let r=(n=void 0)!=null?n:5;return new Promise((i,a)=>{let l="data:image/svg+xml;base64,"+btoa(unescape(encodeURIComponent(e))),c=new Image;c.crossOrigin="anonymous",c.onload=()=>{let d=document.createElement("canvas"),f=c.width*r,g=c.height*r;d.width=f,d.height=g;let h=d.getContext("2d");if(!h){a(new Error("Failed to create 2D canvas context for PNG export"));return}h.drawImage(c,0,0,f,g),d.toBlob(b=>{if(!b){a(new Error("Failed to create PNG blob"));return}i(b)},"image/png")},c.onerror=()=>a(new Error("Failed to load SVG image")),c.src=l})},Zee=({chart:e,children:t,className:n,onDownload:r,config:i,onError:a})=>{let l=kt(),[c,d]=E.useState(!1),f=E.useRef(null),{isAnimating:g}=E.useContext(qr),h=gs(),b=Ey(),x=yi(),v=async w=>{try{if(w==="mmd"){Nl("diagram.mmd",e,"text/plain"),d(!1),r?.(w);return}if(!b){a?.(new Error("Mermaid plugin not available"));return}let k=b.getMermaid(i),C=e.split("").reduce((R,M)=>(R<<5)-R+M.charCodeAt(0)|0,0),N=`mermaid-${Math.abs(C)}-${Date.now()}-${Math.random().toString(36).substring(2,9)}`,{svg:A}=await k.render(N,e);if(!A){a?.(new Error("SVG not found. Please wait for the diagram to render."));return}if(w==="svg"){Nl("diagram.svg",A,"image/svg+xml"),d(!1),r?.(w);return}if(w==="png"){let R=await Wee(A);Nl("diagram.png",R,"image/png"),r?.(w),d(!1);return}}catch(k){a?.(k)}};return E.useEffect(()=>{let w=k=>{let C=k.composedPath();f.current&&!C.includes(f.current)&&d(!1)};return document.addEventListener("mousedown",w),()=>{document.removeEventListener("mousedown",w)}},[]),m.jsxs("div",{className:l("relative"),ref:f,children:[m.jsx("button",{className:l("cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50",n),disabled:g,onClick:()=>d(!c),title:x.downloadDiagram,type:"button",children:t??m.jsx(h.DownloadIcon,{size:14})}),c?m.jsxs("div",{className:l("absolute top-full right-0 z-10 mt-1 min-w-[120px] overflow-hidden rounded-md border border-border bg-background shadow-lg"),children:[m.jsx("button",{className:l("w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40"),onClick:()=>v("svg"),title:x.downloadDiagramAsSvg,type:"button",children:x.mermaidFormatSvg}),m.jsx("button",{className:l("w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40"),onClick:()=>v("png"),title:x.downloadDiagramAsPng,type:"button",children:x.mermaidFormatPng}),m.jsx("button",{className:l("w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40"),onClick:()=>v("mmd"),title:x.downloadDiagramAsMmd,type:"button",children:x.mermaidFormatMmd})]}):null]})},Jee=({chart:e,config:t,onFullscreen:n,onExit:r,className:i,...a})=>{let{Maximize2Icon:l,XIcon:c}=gs(),d=kt(),[f,g]=E.useState(!1),{isAnimating:h,controls:b}=E.useContext(qr),x=yi(),v=(()=>{if(typeof b=="boolean")return b;let k=b.mermaid;return k===!1?!1:k===!0||k===void 0?!0:k.panZoom!==!1})(),w=()=>{g(!f)};return E.useEffect(()=>{if(f){by();let k=C=>{C.key==="Escape"&&g(!1)};return document.addEventListener("keydown",k),()=>{document.removeEventListener("keydown",k),xy()}}},[f]),E.useEffect(()=>{f?n?.():r&&r()},[f,n,r]),m.jsxs(m.Fragment,{children:[m.jsx("button",{className:d("cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50",i),disabled:h,onClick:w,title:x.viewFullscreen,type:"button",...a,children:m.jsx(l,{size:14})}),f?br.createPortal(m.jsxs("div",{className:d("fixed inset-0 z-50 flex items-center justify-center bg-background/95 backdrop-blur-sm"),onClick:w,onKeyDown:k=>{k.key==="Escape"&&w()},role:"button",tabIndex:0,children:[m.jsx("button",{className:d("absolute top-4 right-4 z-10 rounded-md p-2 text-muted-foreground transition-all hover:bg-muted hover:text-foreground"),onClick:w,title:x.exitFullscreen,type:"button",children:m.jsx(c,{size:20})}),m.jsx("div",{className:d("flex size-full items-center justify-center p-4"),onClick:k=>k.stopPropagation(),onKeyDown:k=>k.stopPropagation(),role:"presentation",children:m.jsx(f6,{chart:e,className:d("size-full [&_svg]:h-auto [&_svg]:w-auto"),config:t,fullscreen:!0,showControls:v})})]}),document.body):null]})},I4=e=>{var t,n;let r=[],i=[],a=e.querySelectorAll("thead th");for(let c of a)r.push(((t=c.textContent)==null?void 0:t.trim())||"");let l=e.querySelectorAll("tbody tr");for(let c of l){let d=[],f=c.querySelectorAll("td");for(let g of f)d.push(((n=g.textContent)==null?void 0:n.trim())||"");i.push(d)}return{headers:r,rows:i}},M4=e=>{let{headers:t,rows:n}=e,r=c=>{let d=!1,f=!1;for(let g of c){if(g==='"'){d=!0,f=!0;break}(g===","||g===`
651
+ `)&&(d=!0)}return d?f?`"${c.replace(/"/g,'""')}"`:`"${c}"`:c},i=t.length>0?n.length+1:n.length,a=new Array(i),l=0;t.length>0&&(a[l]=t.map(r).join(","),l+=1);for(let c of n)a[l]=c.map(r).join(","),l+=1;return a.join(`
652
+ `)},ete=e=>{let{headers:t,rows:n}=e,r=c=>{let d=!1;for(let g of c)if(g===" "||g===`
653
+ `||g==="\r"){d=!0;break}if(!d)return c;let f=[];for(let g of c)g===" "?f.push("\\t"):g===`
654
+ `?f.push("\\n"):g==="\r"?f.push("\\r"):f.push(g);return f.join("")},i=t.length>0?n.length+1:n.length,a=new Array(i),l=0;t.length>0&&(a[l]=t.map(r).join(" "),l+=1);for(let c of n)a[l]=c.map(r).join(" "),l+=1;return a.join(`
655
+ `)},hb=e=>{let t=!1;for(let r of e)if(r==="\\"||r==="|"){t=!0;break}if(!t)return e;let n=[];for(let r of e)r==="\\"?n.push("\\\\"):r==="|"?n.push("\\|"):n.push(r);return n.join("")},b1=e=>{let{headers:t,rows:n}=e;if(t.length===0)return"";let r=new Array(n.length+2),i=0,a=t.map(c=>hb(c));r[i]=`| ${a.join(" | ")} |`,i+=1;let l=new Array(t.length);for(let c=0;c<t.length;c+=1)l[c]="---";r[i]=`| ${l.join(" | ")} |`,i+=1;for(let c of n)if(c.length<t.length){let d=new Array(t.length);for(let f=0;f<t.length;f+=1)d[f]=f<c.length?hb(c[f]):"";r[i]=`| ${d.join(" | ")} |`,i+=1}else{let d=c.map(f=>hb(f));r[i]=`| ${d.join(" | ")} |`,i+=1}return r.join(`
656
+ `)},L4=({children:e,className:t,onCopy:n,onError:r,timeout:i=2e3})=>{let a=kt(),[l,c]=E.useState(!1),[d,f]=E.useState(!1),g=E.useRef(null),h=E.useRef(0),{isAnimating:b}=E.useContext(qr),x=yi(),v=async C=>{var N,A;if(typeof window>"u"||!((N=navigator?.clipboard)!=null&&N.write)){r?.(new Error("Clipboard API not available"));return}try{let R=(A=g.current)==null?void 0:A.closest('[data-streamdown="table-wrapper"]'),M=R?.querySelector("table");if(!M){r?.(new Error("Table not found"));return}let _=I4(M),D=({csv:M4,tsv:ete,md:b1}[C]||b1)(_),I=new ClipboardItem({"text/plain":new Blob([D],{type:"text/plain"}),"text/html":new Blob([M.outerHTML],{type:"text/html"})});await navigator.clipboard.write([I]),f(!0),c(!1),n?.(C),h.current=window.setTimeout(()=>f(!1),i)}catch(R){r?.(R)}};E.useEffect(()=>{let C=N=>{let A=N.composedPath();g.current&&!A.includes(g.current)&&c(!1)};return document.addEventListener("mousedown",C),()=>{document.removeEventListener("mousedown",C),window.clearTimeout(h.current)}},[]);let w=gs(),k=d?w.CheckIcon:w.CopyIcon;return m.jsxs("div",{className:a("relative"),ref:g,children:[m.jsx("button",{className:a("cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50",t),disabled:b,onClick:()=>c(!l),title:x.copyTable,type:"button",children:e??m.jsx(k,{height:14,width:14})}),l?m.jsxs("div",{className:a("absolute top-full right-0 z-20 mt-1 min-w-[120px] overflow-hidden rounded-md border border-border bg-background shadow-lg"),children:[m.jsx("button",{className:a("w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40"),onClick:()=>v("md"),title:x.copyTableAsMarkdown,type:"button",children:x.tableFormatMarkdown}),m.jsx("button",{className:a("w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40"),onClick:()=>v("csv"),title:x.copyTableAsCsv,type:"button",children:x.tableFormatCsv}),m.jsx("button",{className:a("w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40"),onClick:()=>v("tsv"),title:x.copyTableAsTsv,type:"button",children:x.tableFormatTsv})]}):null]})},D4=({children:e,className:t,onDownload:n,onError:r})=>{let i=kt(),[a,l]=E.useState(!1),c=E.useRef(null),{isAnimating:d}=E.useContext(qr),f=yi(),g=gs(),h=b=>{var x;try{let v=(x=c.current)==null?void 0:x.closest('[data-streamdown="table-wrapper"]'),w=v?.querySelector("table");if(!w){r?.(new Error("Table not found"));return}let k=I4(w),C=b==="csv"?M4(k):b1(k);Nl(`table.${b==="csv"?"csv":"md"}`,C,b==="csv"?"text/csv":"text/markdown"),l(!1),n?.(b)}catch(v){r?.(v)}};return E.useEffect(()=>{let b=x=>{let v=x.composedPath();c.current&&!v.includes(c.current)&&l(!1)};return document.addEventListener("mousedown",b),()=>{document.removeEventListener("mousedown",b)}},[]),m.jsxs("div",{className:i("relative"),ref:c,children:[m.jsx("button",{className:i("cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50",t),disabled:d,onClick:()=>l(!a),title:f.downloadTable,type:"button",children:e??m.jsx(g.DownloadIcon,{size:14})}),a?m.jsxs("div",{className:i("absolute top-full right-0 z-20 mt-1 min-w-[120px] overflow-hidden rounded-md border border-border bg-background shadow-lg"),children:[m.jsx("button",{className:i("w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40"),onClick:()=>h("csv"),title:f.downloadTableAsCsv,type:"button",children:f.tableFormatCsv}),m.jsx("button",{className:i("w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40"),onClick:()=>h("markdown"),title:f.downloadTableAsMarkdown,type:"button",children:f.tableFormatMarkdown})]}):null]})},tte=({children:e,className:t,showCopy:n=!0,showDownload:r=!0})=>{let{Maximize2Icon:i,XIcon:a}=gs(),l=kt(),[c,d]=E.useState(!1),{isAnimating:f}=E.useContext(qr),g=yi(),h=()=>{d(!0)},b=()=>{d(!1)};return E.useEffect(()=>{if(c){by();let x=v=>{v.key==="Escape"&&d(!1)};return document.addEventListener("keydown",x),()=>{document.removeEventListener("keydown",x),xy()}}},[c]),m.jsxs(m.Fragment,{children:[m.jsx("button",{className:l("cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50",t),disabled:f,onClick:h,title:g.viewFullscreen,type:"button",children:m.jsx(i,{size:14})}),c?br.createPortal(m.jsx("div",{"aria-label":g.viewFullscreen,"aria-modal":"true",className:l("fixed inset-0 z-50 flex flex-col bg-background"),"data-streamdown":"table-fullscreen",onClick:b,onKeyDown:x=>{x.key==="Escape"&&b()},role:"dialog",children:m.jsxs("div",{className:l("flex h-full flex-col"),onClick:x=>x.stopPropagation(),onKeyDown:x=>x.stopPropagation(),role:"presentation",children:[m.jsxs("div",{className:l("flex items-center justify-end gap-1 p-4"),children:[n?m.jsx(L4,{}):null,r?m.jsx(D4,{}):null,m.jsx("button",{className:l("rounded-md p-1 text-muted-foreground transition-all hover:bg-muted hover:text-foreground"),onClick:b,title:g.exitFullscreen,type:"button",children:m.jsx(a,{size:20})})]}),m.jsx("div",{className:l("flex-1 overflow-auto p-4 pt-0 [&_thead]:sticky [&_thead]:top-0 [&_thead]:z-10"),children:m.jsx("table",{className:l("w-full border-collapse border border-border"),"data-streamdown":"table",children:e})})]})}),document.body):null]})},nte=({children:e,className:t,showControls:n,showCopy:r=!0,showDownload:i=!0,showFullscreen:a=!0,...l})=>{let c=kt(),d=n&&r,f=n&&i,g=n&&a,h=d||f||g;return m.jsxs("div",{className:c("my-4 flex flex-col gap-2 rounded-lg border border-border bg-sidebar p-2"),"data-streamdown":"table-wrapper",children:[h?m.jsxs("div",{className:c("flex items-center justify-end gap-1"),children:[d?m.jsx(L4,{}):null,f?m.jsx(D4,{}):null,g?m.jsx(tte,{showCopy:d,showDownload:f,children:e}):null]}):null,m.jsx("div",{className:c("border-collapse overflow-x-auto overflow-y-auto rounded-md border border-border bg-background"),children:m.jsx("table",{className:c("w-full divide-y divide-border",t),"data-streamdown":"table",...l,children:e})})]})},rte=/startLine=(\d+)/,ste=/\bnoLineNumbers\b/,ite=E.lazy(()=>Pl(()=>Promise.resolve().then(()=>pre),void 0).then(e=>({default:e.Mermaid}))),ate=/language-([^\s]+)/;function Kp(e,t){if(!(e!=null&&e.position||t!=null&&t.position))return!0;if(!(e!=null&&e.position&&t!=null&&t.position))return!1;let n=e.position.start,r=t.position.start,i=e.position.end,a=t.position.end;return n?.line===r?.line&&n?.column===r?.column&&i?.line===a?.line&&i?.column===a?.column}function vn(e,t){return e.className===t.className&&Kp(e.node,t.node)}var x1=(e,t)=>typeof e=="boolean"?e:e[t]!==!1,pb=(e,t)=>{if(typeof e=="boolean")return e;let n=e.table;return n===!1?!1:n===!0||n===void 0?!0:n[t]!==!1},Qk=(e,t)=>{if(typeof e=="boolean")return e;let n=e.code;return n===!1?!1:n===!0||n===void 0?!0:n[t]!==!1},rh=(e,t)=>{if(typeof e=="boolean")return e;let n=e.mermaid;return n===!1?!1:n===!0||n===void 0?!0:n[t]!==!1},vy=E.memo(({children:e,className:t,node:n,...r})=>{let i=kt();return m.jsx("ol",{className:i("list-inside list-decimal whitespace-normal [li_&]:pl-6",t),"data-streamdown":"ordered-list",...r,children:e})},(e,t)=>vn(e,t));vy.displayName="MarkdownOl";var P4=E.memo(({children:e,className:t,node:n,...r})=>{let i=kt();return m.jsx("li",{className:i("py-1 [&>p]:inline",t),"data-streamdown":"list-item",...r,children:e})},(e,t)=>e.className===t.className&&Kp(e.node,t.node));P4.displayName="MarkdownLi";var j4=E.memo(({children:e,className:t,node:n,...r})=>{let i=kt();return m.jsx("ul",{className:i("list-inside list-disc whitespace-normal [li_&]:pl-6",t),"data-streamdown":"unordered-list",...r,children:e})},(e,t)=>vn(e,t));j4.displayName="MarkdownUl";var B4=E.memo(({className:e,node:t,...n})=>{let r=kt();return m.jsx("hr",{className:r("my-6 border-border",e),"data-streamdown":"horizontal-rule",...n})},(e,t)=>vn(e,t));B4.displayName="MarkdownHr";var H4=E.memo(({children:e,className:t,node:n,...r})=>{let i=kt();return m.jsx("span",{className:i("font-semibold",t),"data-streamdown":"strong",...r,children:e})},(e,t)=>vn(e,t));H4.displayName="MarkdownStrong";var ote=({children:e,className:t,href:n,node:r,...i})=>{let a=kt(),{linkSafety:l}=E.useContext(qr),[c,d]=E.useState(!1),f=n==="streamdown:incomplete-link",g=E.useCallback(async v=>{if(!(!(l!=null&&l.enabled&&n)||f)){if(v.preventDefault(),l.onLinkCheck&&await l.onLinkCheck(n)){window.open(n,"_blank","noreferrer");return}d(!0)}},[l,n,f]),h=E.useCallback(()=>{n&&window.open(n,"_blank","noreferrer")},[n]),b=E.useCallback(()=>{d(!1)},[]),x={url:n??"",isOpen:c,onClose:b,onConfirm:h};return l!=null&&l.enabled&&n?m.jsxs(m.Fragment,{children:[m.jsx("button",{className:a("wrap-anywhere appearance-none text-left font-medium text-primary underline",t),"data-incomplete":f,"data-streamdown":"link",onClick:g,type:"button",children:e}),l.renderModal?l.renderModal(x):m.jsx(Kee,{...x})]}):m.jsx("a",{className:a("wrap-anywhere font-medium text-primary underline",t),"data-incomplete":f,"data-streamdown":"link",href:n,rel:"noreferrer",target:"_blank",...i,children:e})},U4=E.memo(ote,(e,t)=>vn(e,t)&&e.href===t.href);U4.displayName="MarkdownA";var z4=E.memo(({children:e,className:t,node:n,...r})=>{let i=kt();return m.jsx("h1",{className:i("mt-6 mb-2 font-semibold text-3xl",t),"data-streamdown":"heading-1",...r,children:e})},(e,t)=>vn(e,t));z4.displayName="MarkdownH1";var F4=E.memo(({children:e,className:t,node:n,...r})=>{let i=kt();return m.jsx("h2",{className:i("mt-6 mb-2 font-semibold text-2xl",t),"data-streamdown":"heading-2",...r,children:e})},(e,t)=>vn(e,t));F4.displayName="MarkdownH2";var $4=E.memo(({children:e,className:t,node:n,...r})=>{let i=kt();return m.jsx("h3",{className:i("mt-6 mb-2 font-semibold text-xl",t),"data-streamdown":"heading-3",...r,children:e})},(e,t)=>vn(e,t));$4.displayName="MarkdownH3";var V4=E.memo(({children:e,className:t,node:n,...r})=>{let i=kt();return m.jsx("h4",{className:i("mt-6 mb-2 font-semibold text-lg",t),"data-streamdown":"heading-4",...r,children:e})},(e,t)=>vn(e,t));V4.displayName="MarkdownH4";var q4=E.memo(({children:e,className:t,node:n,...r})=>{let i=kt();return m.jsx("h5",{className:i("mt-6 mb-2 font-semibold text-base",t),"data-streamdown":"heading-5",...r,children:e})},(e,t)=>vn(e,t));q4.displayName="MarkdownH5";var Y4=E.memo(({children:e,className:t,node:n,...r})=>{let i=kt();return m.jsx("h6",{className:i("mt-6 mb-2 font-semibold text-sm",t),"data-streamdown":"heading-6",...r,children:e})},(e,t)=>vn(e,t));Y4.displayName="MarkdownH6";var G4=E.memo(({children:e,className:t,node:n,...r})=>{let{controls:i}=E.useContext(qr),a=x1(i,"table"),l=pb(i,"copy"),c=pb(i,"download"),d=pb(i,"fullscreen");return m.jsx(nte,{className:t,showControls:a,showCopy:l,showDownload:c,showFullscreen:d,...r,children:e})},(e,t)=>vn(e,t));G4.displayName="MarkdownTable";var X4=E.memo(({children:e,className:t,node:n,...r})=>{let i=kt();return m.jsx("thead",{className:i("bg-muted/80",t),"data-streamdown":"table-header",...r,children:e})},(e,t)=>vn(e,t));X4.displayName="MarkdownThead";var K4=E.memo(({children:e,className:t,node:n,...r})=>{let i=kt();return m.jsx("tbody",{className:i("divide-y divide-border",t),"data-streamdown":"table-body",...r,children:e})},(e,t)=>vn(e,t));K4.displayName="MarkdownTbody";var Q4=E.memo(({children:e,className:t,node:n,...r})=>{let i=kt();return m.jsx("tr",{className:i("border-border",t),"data-streamdown":"table-row",...r,children:e})},(e,t)=>vn(e,t));Q4.displayName="MarkdownTr";var W4=E.memo(({children:e,className:t,node:n,...r})=>{let i=kt();return m.jsx("th",{className:i("whitespace-nowrap px-4 py-2 text-left font-semibold text-sm",t),"data-streamdown":"table-header-cell",...r,children:e})},(e,t)=>vn(e,t));W4.displayName="MarkdownTh";var Z4=E.memo(({children:e,className:t,node:n,...r})=>{let i=kt();return m.jsx("td",{className:i("px-4 py-2 text-sm",t),"data-streamdown":"table-cell",...r,children:e})},(e,t)=>vn(e,t));Z4.displayName="MarkdownTd";var J4=E.memo(({children:e,className:t,node:n,...r})=>{let i=kt();return m.jsx("blockquote",{className:i("my-4 border-muted-foreground/30 border-l-4 pl-4 text-muted-foreground italic",t),"data-streamdown":"blockquote",...r,children:e})},(e,t)=>vn(e,t));J4.displayName="MarkdownBlockquote";var e6=E.memo(({children:e,className:t,node:n,...r})=>{let i=kt();return m.jsx("sup",{className:i("text-sm",t),"data-streamdown":"superscript",...r,children:e})},(e,t)=>vn(e,t));e6.displayName="MarkdownSup";var t6=E.memo(({children:e,className:t,node:n,...r})=>{let i=kt();return m.jsx("sub",{className:i("text-sm",t),"data-streamdown":"subscript",...r,children:e})},(e,t)=>vn(e,t));t6.displayName="MarkdownSub";var n6=E.memo(({children:e,className:t,node:n,...r})=>{if("data-footnotes"in r){let i=l=>{var c,d;if(!E.isValidElement(l))return!1;let f=Array.isArray(l.props.children)?l.props.children:[l.props.children],g=!1,h=!1;for(let b of f)if(b){if(typeof b=="string")b.trim()!==""&&(g=!0);else if(E.isValidElement(b))if(((c=b.props)==null?void 0:c["data-footnote-backref"])!==void 0)h=!0;else{let x=Array.isArray(b.props.children)?b.props.children:[b.props.children];for(let v of x){if(typeof v=="string"&&v.trim()!==""){g=!0;break}if(E.isValidElement(v)&&((d=v.props)==null?void 0:d["data-footnote-backref"])===void 0){g=!0;break}}}}return h&&!g},a=Array.isArray(e)?e.map(l=>{if(!E.isValidElement(l))return l;if(l.type===vy){let c=(Array.isArray(l.props.children)?l.props.children:[l.props.children]).filter(d=>!i(d));return c.length===0?null:{...l,props:{...l.props,children:c}}}return l}):e;return(Array.isArray(a)?a.some(l=>l!==null):a!==null)?m.jsx("section",{className:t,...r,children:a}):null}return m.jsx("section",{className:t,...r,children:e})},(e,t)=>vn(e,t));n6.displayName="MarkdownSection";var lte=({node:e,className:t,children:n,...r})=>{var i,a;let l=kt(),c=!("data-block"in r),{mermaid:d,controls:f,lineNumbers:g}=E.useContext(qr),h=Ey(),b=Cee(),x=t?.match(ate),v=(i=x?.at(1))!=null?i:"",w=Qee(v);if(c)return m.jsx("code",{className:l("rounded bg-muted px-1.5 py-0.5 font-mono text-sm",t),"data-streamdown":"inline-code",...r,children:n});let k=(a=e?.properties)==null?void 0:a.metastring,C=k?.match(rte),N=C?Number.parseInt(C[1],10):void 0,A=N!==void 0&&N>=1?N:void 0,R=!(k&&ste.test(k))&&g!==!1,M="";if(E.isValidElement(n)&&n.props&&typeof n.props=="object"&&"children"in n.props&&typeof n.props.children=="string"?M=n.props.children:typeof n=="string"&&(M=n),w){let U=w.component;return m.jsx(E.Suspense,{fallback:m.jsx(Kk,{}),children:m.jsx(U,{code:M,isIncomplete:b,language:v,meta:k})})}if(v==="mermaid"&&h){let U=x1(f,"mermaid"),j=rh(f,"download"),X=rh(f,"copy"),K=rh(f,"fullscreen"),F=rh(f,"panZoom"),W=U&&(j||X||K);return m.jsx(E.Suspense,{fallback:m.jsx(Kk,{}),children:m.jsxs("div",{className:l("group relative my-4 flex w-full flex-col gap-2 rounded-xl border border-border bg-sidebar p-2",t),"data-streamdown":"mermaid-block",children:[m.jsx("div",{className:l("flex h-8 items-center text-muted-foreground text-xs"),children:m.jsx("span",{className:l("ml-1 font-mono lowercase"),children:"mermaid"})}),W?m.jsx("div",{className:l("pointer-events-none sticky top-2 z-10 -mt-10 flex h-8 items-center justify-end"),children:m.jsxs("div",{className:l("pointer-events-auto flex shrink-0 items-center gap-2 rounded-md border border-sidebar bg-sidebar/80 px-1.5 py-1 supports-[backdrop-filter]:bg-sidebar/70 supports-[backdrop-filter]:backdrop-blur"),"data-streamdown":"mermaid-block-actions",children:[j?m.jsx(Zee,{chart:M,config:d?.config}):null,X?m.jsx(Gk,{code:M}):null,K?m.jsx(Jee,{chart:M,config:d?.config}):null]})}):null,m.jsx("div",{className:l("rounded-md border border-border bg-background"),children:m.jsx(ite,{chart:M,config:d?.config,showControls:F})})]})})}let _=x1(f,"code"),D=Qk(f,"download"),I=Qk(f,"copy");return m.jsx(Lee,{className:t,code:M,isIncomplete:b,language:v,lineNumbers:R,startLine:A,children:_?m.jsxs(m.Fragment,{children:[D?m.jsx(Yee,{code:M,language:v}):null,I?m.jsx(Gk,{}):null]}):null})},r6=E.memo(lte,(e,t)=>e.className===t.className&&Kp(e.node,t.node));r6.displayName="MarkdownCode";var s6=E.memo(Xee,(e,t)=>e.className===t.className&&Kp(e.node,t.node));s6.displayName="MarkdownImg";var i6=E.memo(({children:e,node:t,...n})=>{let r=(Array.isArray(e)?e:[e]).filter(i=>i!=null&&i!=="");if(r.length===1&&E.isValidElement(r[0])){let i=r[0].props.node,a=i?.tagName;if(a==="img")return m.jsx(m.Fragment,{children:e});if(a==="code"&&"data-block"in r[0].props)return m.jsx(m.Fragment,{children:e})}return m.jsx("p",{...n,children:e})},(e,t)=>vn(e,t));i6.displayName="MarkdownParagraph";var ute={ol:vy,li:P4,ul:j4,hr:B4,strong:H4,a:U4,h1:z4,h2:F4,h3:$4,h4:V4,h5:q4,h6:Y4,table:G4,thead:X4,tbody:K4,tr:Q4,th:W4,td:Z4,blockquote:J4,code:r6,img:s6,pre:({children:e})=>E.isValidElement(e)?E.cloneElement(e,{"data-block":"true"}):e,sup:e6,sub:t6,p:i6,section:n6},cte=/[\u0590-\u08FF\uFB1D-\uFDFF\uFE70-\uFEFF]/,dte=/\p{L}/u;function Wk(e){let t=e.replace(/^#{1,6}\s+/gm,"").replace(/(\*{1,3}|_{1,3})/g,"").replace(/`[^`]*`/g,"").replace(/\[([^\]]*)\]\([^)]*\)/g,"$1").replace(/^[\s>*\-+\d.]+/gm,"");for(let n of t){if(cte.test(n))return"rtl";if(dte.test(n))return"ltr"}return"ltr"}var fte=/^[ \t]{0,3}(`{3,}|~{3,})/,hte=/^\|?[ \t]*:?-{1,}:?[ \t]*(\|[ \t]*:?-{1,}:?[ \t]*)*\|?$/,Zk=e=>{let t=e.split(`
657
+ `),n=null,r=0;for(let i of t){let a=fte.exec(i);if(n===null){if(a){let l=a[1];n=l[0],r=l.length}}else if(a){let l=a[1],c=l[0],d=l.length;c===n&&d>=r&&(n=null,r=0)}}return n!==null},pte=e=>{let t=e.split(`
658
+ `);for(let n of t){let r=n.trim();if(r.length>0&&r.includes("|")&&hte.test(r))return!0}return!1},mte=()=>e=>{Ps(e,"html",(t,n,r)=>{!r||typeof n!="number"||(r.children[n]={type:"text",value:t.value})})},Jk=[],ew={allowDangerousHtml:!0},sh=new WeakMap,gte=class{constructor(){this.cache=new Map,this.keyCache=new WeakMap,this.maxSize=100}generateCacheKey(e){let t=this.keyCache.get(e);if(t)return t;let n=e.rehypePlugins,r=e.remarkPlugins,i=e.remarkRehypeOptions;if(!(n||r||i)){let g="default";return this.keyCache.set(e,g),g}let a=g=>{if(!g||g.length===0)return"";let h="";for(let b=0;b<g.length;b+=1){let x=g[b];if(b>0&&(h+=","),Array.isArray(x)){let[v,w]=x;if(typeof v=="function"){let k=sh.get(v);k||(k=v.name,sh.set(v,k)),h+=k}else h+=String(v);h+=":",h+=JSON.stringify(w)}else if(typeof x=="function"){let v=sh.get(x);v||(v=x.name,sh.set(x,v)),h+=v}else h+=String(x)}return h},l=a(n),c=a(r),d=i?JSON.stringify(i):"",f=`${c}::${l}::${d}`;return this.keyCache.set(e,f),f}get(e){let t=this.generateCacheKey(e),n=this.cache.get(t);return n&&(this.cache.delete(t),this.cache.set(t,n)),n}set(e,t){let n=this.generateCacheKey(e);if(this.cache.size>=this.maxSize){let r=this.cache.keys().next().value;r&&this.cache.delete(r)}this.cache.set(n,t)}clear(){this.cache.clear()}},tw=new gte,a6=e=>{let t=bte(e),n=e.children||"",r=t.runSync(t.parse(n),n);return Cte(r,e)},bte=e=>{let t=tw.get(e);if(t)return t;let n=yte(e);return tw.set(e,n),n},xte=e=>e.some(t=>Array.isArray(t)?t[0]===n1:t===n1),yte=e=>{let t=e.rehypePlugins||Jk,n=e.remarkPlugins||Jk,r=xte(t)?n:[...n,mte],i=e.remarkRehypeOptions?{...ew,...e.remarkRehypeOptions}:ew;return EJ().use(yZ).use(r).use(tJ,i).use(t)},Ete=e=>e,vte=(e,t,n,r)=>{n?e.children.splice(t,1):e.children[t]={type:"text",value:r}},Tte=(e,t)=>{var n;for(let r in sb)if(Object.hasOwn(sb,r)&&Object.hasOwn(e.properties,r)){let i=e.properties[r],a=sb[r];(a===null||a.includes(e.tagName))&&(e.properties[r]=(n=t(String(i||""),r,e))!=null?n:void 0)}},Ste=(e,t,n,r,i,a)=>{let l=!1;return r?l=!r.includes(e.tagName):i&&(l=i.includes(e.tagName)),!l&&a&&typeof t=="number"&&(l=!a(e,t,n)),l},Cte=(e,t)=>{let{allowElement:n,allowedElements:r,disallowedElements:i,skipHtml:a,unwrapDisallowed:l,urlTransform:c}=t;if(n||r||i||a||c){let d=c||Ete;Ps(e,(f,g,h)=>{if(f.type==="raw"&&h&&typeof g=="number")return vte(h,g,a,f.value),g;if(f.type==="element"&&(Tte(f,d),Ste(f,g,h,r,i,n)&&h&&typeof g=="number"))return l&&f.children?h.children.splice(g,1,...f.children):h.children.splice(g,1),g})}return NW(e,{Fragment:m.Fragment,components:t.components,ignoreInvalidStyle:!0,jsx:m.jsx,jsxs:m.jsxs,passKeys:!0,passNode:!0})},kte=/\[\^[\w-]{1,200}\](?!:)/,wte=/\[\^[\w-]{1,200}\]:/,Nte=/<(\w+)[\s>]/,Ate=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),nw=new Map,rw=new Map,_te=e=>{let t=e.toLowerCase(),n=nw.get(t);if(n)return n;let r=new RegExp(`<${t}(?=[\\s>/])[^>]*>`,"gi");return nw.set(t,r),r},Rte=e=>{let t=e.toLowerCase(),n=rw.get(t);if(n)return n;let r=new RegExp(`</${t}(?=[\\s>])[^>]*>`,"gi");return rw.set(t,r),r},sw=(e,t)=>{if(Ate.has(t.toLowerCase()))return 0;let n=e.match(_te(t));if(!n)return 0;let r=0;for(let i of n)i.trimEnd().endsWith("/>")||(r+=1);return r},iw=(e,t)=>{let n=e.match(Rte(t));return n?n.length:0},Ote=e=>{let t=0;for(let n=0;n<e.length-1;n+=1)e[n]==="$"&&e[n+1]==="$"&&(t+=1,n+=1);return t},Ite=e=>{let t=kte.test(e),n=wte.test(e);if(t||n)return[e];let r=is.lex(e,{gfm:!0}),i=[],a=[],l=!1;for(let c of r){let d=c.raw,f=i.length;if(a.length>0){i[f-1]+=d;let g=a.at(-1),h=sw(d,g),b=iw(d,g);for(let x=0;x<h;x+=1)a.push(g);for(let x=0;x<b;x+=1)a.length>0&&a.at(-1)===g&&a.pop();continue}if(c.type==="html"&&c.block){let g=d.match(Nte);if(g){let h=g[1],b=sw(d,h),x=iw(d,h);b>x&&a.push(h)}}if(f>0&&!l){let g=i[f-1];if(Ote(g)%2===1){i[f-1]=g+d;continue}}i.push(d),c.type!=="space"&&(l=c.type==="code")}return i},Mte=(e,t)=>{if(!t.length)return e;let n=e;for(let r of t){let i=new RegExp(`(<${r}(?=[\\s>/])[^>]*>)([\\s\\S]*?)(</${r}\\s*>)`,"gi");n=n.replace(i,(a,l,c,d)=>{if(!c.includes(`
659
+
660
+ `))return l+c+d;let f=c.replace(/\n\n/g,`
661
+ <!---->
662
+ `),g=(f.startsWith(`
663
+ `)?"":`
664
+ `)+f+(f.endsWith(`
665
+ `)?"":`
666
+ `);return`${l}${g}${d}
667
+
668
+ `})}return n},Lte=/([\\`*_~[\]|])/g,Dte=e=>e.replace(Lte,"\\$1"),Pte=(e,t)=>{if(!t.length)return e;let n=e;for(let r of t){let i=new RegExp(`(<${r}(?=[\\s>/])[^>]*>)([\\s\\S]*?)(</${r}\\s*>)`,"gi");n=n.replace(i,(a,l,c,d)=>{let f=Dte(c).replace(/\n\n/g,"&#10;&#10;");return l+f+d})}return n},o6=e=>e.type==="text"?e.value:"children"in e&&Array.isArray(e.children)?e.children.map(o6).join(""):"",jte=e=>t=>{if(!e||e.length===0)return;let n=new Set(e.map(r=>r.toLowerCase()));Ps(t,"element",r=>{if(n.has(r.tagName.toLowerCase())){let i=o6(r);r.children=i?[{type:"text",value:i}]:[]}})},Bte=()=>e=>{Ps(e,"code",t=>{var n,r;t.meta&&(t.data=(n=t.data)!=null?n:{},t.data.hProperties={...(r=t.data.hProperties)!=null?r:{},metastring:t.meta})})},Hte=/^[ \t]*<[\w!/?-]/,Ute=/(^|\n)[ \t]{4,}(?=<[\w!/?-])/g,zte=e=>typeof e!="string"||e.length===0||!Hte.test(e)?e:e.replace(Ute,"$1"),aw,ow,lw,uw,vh={...Va,protocols:{...Va.protocols,href:[...(ow=(aw=Va.protocols)==null?void 0:aw.href)!=null?ow:[],"tel"]},attributes:{...Va.attributes,code:[...(uw=(lw=Va.attributes)==null?void 0:lw.code)!=null?uw:[],"metastring"]}},y1={raw:n1,sanitize:[bR,vh],harden:[PF,{allowedImagePrefixes:["*"],allowedLinkPrefixes:["*"],allowedProtocols:["*"],defaultOrigin:void 0,allowDataImages:!0}]},Fte={gfm:[eQ,{}],codeMeta:Bte},cw=Object.values(y1),$te=Object.values(Fte),Vte={block:" ▋",circle:" ●"},l6=["github-light","github-dark"],u6={enabled:!0},qte={shikiTheme:l6,controls:!0,isAnimating:!1,lineNumbers:!0,mode:"streaming",mermaid:void 0,linkSafety:u6},qr=E.createContext(qte),c6=E.memo(({content:e,shouldParseIncompleteMarkdown:t,shouldNormalizeHtmlIndentation:n,index:r,isIncomplete:i,dir:a,animatePlugin:l,...c})=>{if(l){let g=l.getLastRenderCharCount();l.setPrevContentLength(g)}let d=typeof e=="string"&&n?zte(e):e,f=m.jsx(a6,{...c,children:d});return m.jsx(N4.Provider,{value:i,children:a?m.jsx("div",{dir:a,style:{display:"contents"},children:f}):f})},(e,t)=>{if(e.content!==t.content||e.shouldNormalizeHtmlIndentation!==t.shouldNormalizeHtmlIndentation||e.index!==t.index||e.isIncomplete!==t.isIncomplete||e.dir!==t.dir)return!1;if(e.components!==t.components){let n=Object.keys(e.components||{}),r=Object.keys(t.components||{});if(n.length!==r.length||n.some(i=>{var a,l;return((a=e.components)==null?void 0:a[i])!==((l=t.components)==null?void 0:l[i])}))return!1}return!(e.rehypePlugins!==t.rehypePlugins||e.remarkPlugins!==t.remarkPlugins)});c6.displayName="Block";var d6=E.memo(({children:e,mode:t="streaming",dir:n,parseIncompleteMarkdown:r=!0,normalizeHtmlIndentation:i=!1,components:a,rehypePlugins:l=cw,remarkPlugins:c=$te,className:d,shikiTheme:f=l6,mermaid:g,controls:h=!0,isAnimating:b=!1,animated:x,BlockComponent:v=c6,parseMarkdownIntoBlocksFn:w=Ite,caret:k,plugins:C,remend:N,linkSafety:A=u6,lineNumbers:R=!0,allowedTags:M,literalTagContent:_,translations:D,icons:I,prefix:U,onAnimationStart:j,onAnimationEnd:X,...K})=>{let F=E.useId(),[W,V]=E.useTransition(),H=E.useMemo(()=>wee(U),[U]),q=E.useRef(null),J=E.useRef(j),ue=E.useRef(X);J.current=j,ue.current=X,E.useEffect(()=>{var ke,ye,Re;if(t==="static")return;let Pe=q.current;if(q.current=b,Pe===null){b&&((ke=J.current)==null||ke.call(J));return}b&&!Pe?(ye=J.current)==null||ye.call(J):!b&&Pe&&((Re=ue.current)==null||Re.call(ue))},[b,t]);let L=E.useMemo(()=>M?Object.keys(M):[],[M]),B=E.useMemo(()=>{if(typeof e!="string")return"";let ke=t==="streaming"&&r?dW(e,N):e;return _&&_.length>0&&(ke=Pte(ke,_)),L.length>0&&(ke=Mte(ke,L)),ke},[e,t,r,N,L,_]),G=E.useMemo(()=>w(B),[B,w]),[P,ae]=E.useState(G);E.useEffect(()=>{t==="streaming"&&!ve?V(()=>{ae(G)}):ae(G)},[G,t]);let ie=t==="streaming"?P:G,ce=E.useMemo(()=>n==="auto"?ie.map(Wk):void 0,[ie,n]),de=E.useMemo(()=>ie.map((ke,ye)=>`${F}-${ye}`),[ie.length,F]),he=E.useMemo(()=>x===!0?"true":x?JSON.stringify(x):"",[x]),ve=E.useMemo(()=>he?he==="true"?h1():h1(x):null,[he]),Fe=E.useMemo(()=>{var ke,ye;return{shikiTheme:(ye=(ke=C?.code)==null?void 0:ke.getThemes())!=null?ye:f,controls:h,isAnimating:b,lineNumbers:R,mode:t,mermaid:g,linkSafety:A}},[f,h,b,R,t,g,A,C?.code]),Le=E.useMemo(()=>D?JSON.stringify(D):"",[D]),Ee=E.useMemo(()=>({...O4,...D}),[Le]),Oe=E.useMemo(()=>{let{inlineCode:ke,...ye}=a??{},Re={...ute,...ye};if(ke){let Pe=Re.code;Re.code=ee=>"data-block"in ee?Pe?E.createElement(Pe,ee):null:E.createElement(ke,ee)}return Re},[a]),Ue=E.useMemo(()=>{let ke=[];return C!=null&&C.cjk&&(ke=[...ke,...C.cjk.remarkPluginsBefore]),ke=[...ke,...c],C!=null&&C.cjk&&(ke=[...ke,...C.cjk.remarkPluginsAfter]),C!=null&&C.math&&(ke=[...ke,C.math.remarkPlugin]),ke},[c,C?.math,C?.cjk]),Xe=E.useMemo(()=>{var ke;let ye=l;if(M&&Object.keys(M).length>0&&l===cw){let Re={...vh,tagNames:[...(ke=vh.tagNames)!=null?ke:[],...Object.keys(M)],attributes:{...vh.attributes,...M}};ye=[y1.raw,[bR,Re],y1.harden]}return _&&_.length>0&&(ye=[...ye,[jte,_]]),C!=null&&C.math&&(ye=[...ye,C.math.rehypePlugin]),ve&&b&&(ye=[...ye,ve.rehypePlugin]),ye},[l,C?.math,ve,b,M,_]),qe=E.useMemo(()=>{if(!b||ie.length===0)return!1;let ke=ie.at(-1);return Zk(ke)||pte(ke)},[b,ie]),De=E.useMemo(()=>k&&b&&!qe?{"--streamdown-caret":`"${Vte[k]}"`}:void 0,[k,b,qe]);return t==="static"?m.jsx(m1.Provider,{value:Ee,children:m.jsx(g1.Provider,{value:C??null,children:m.jsx(qr.Provider,{value:Fe,children:m.jsx(Yk,{icons:I,children:m.jsx(p1.Provider,{value:H,children:m.jsx("div",{className:H("space-y-4 whitespace-normal [&>*:first-child]:mt-0 [&>*:last-child]:mb-0",d),dir:n==="auto"?Wk(B):n,children:m.jsx(a6,{components:Oe,rehypePlugins:Xe,remarkPlugins:Ue,...K,children:B})})})})})})}):m.jsx(m1.Provider,{value:Ee,children:m.jsx(g1.Provider,{value:C??null,children:m.jsx(qr.Provider,{value:Fe,children:m.jsx(Yk,{icons:I,children:m.jsx(p1.Provider,{value:H,children:m.jsxs("div",{className:H("space-y-4 whitespace-normal [&>*:first-child]:mt-0 [&>*:last-child]:mb-0",k&&!qe?"[&>*:last-child]:after:inline [&>*:last-child]:after:align-baseline [&>*:last-child]:after:content-[var(--streamdown-caret)]":null,d),style:De,children:[ie.length===0&&k&&b&&m.jsx("span",{}),ie.map((ke,ye)=>{var Re;let Pe=ye===ie.length-1,ee=b&&Pe&&Zk(ke);return m.jsx(v,{animatePlugin:ve,components:Oe,content:ke,dir:(Re=ce?.[ye])!=null?Re:n!=="auto"?n:void 0,index:ye,isIncomplete:ee,rehypePlugins:Xe,remarkPlugins:Ue,shouldNormalizeHtmlIndentation:i,shouldParseIncompleteMarkdown:r,...K},de[ye])})]})})})})})})},(e,t)=>e.children===t.children&&e.shikiTheme===t.shikiTheme&&e.isAnimating===t.isAnimating&&e.animated===t.animated&&e.mode===t.mode&&e.plugins===t.plugins&&e.className===t.className&&e.linkSafety===t.linkSafety&&e.lineNumbers===t.lineNumbers&&e.normalizeHtmlIndentation===t.normalizeHtmlIndentation&&e.literalTagContent===t.literalTagContent&&JSON.stringify(e.translations)===JSON.stringify(t.translations)&&e.prefix===t.prefix&&e.dir===t.dir);d6.displayName="Streamdown";var Yte=({children:e,className:t,minZoom:n=.5,maxZoom:r=3,zoomStep:i=.1,showControls:a=!0,initialZoom:l=1,fullscreen:c=!1})=>{let{RotateCcwIcon:d,ZoomInIcon:f,ZoomOutIcon:g}=gs(),h=kt(),b=E.useRef(null),x=E.useRef(null),[v,w]=E.useState(l),[k,C]=E.useState({x:0,y:0}),[N,A]=E.useState(!1),[R,M]=E.useState({x:0,y:0}),[_,D]=E.useState({x:0,y:0}),I=E.useCallback(H=>{w(q=>Math.max(n,Math.min(r,q+H)))},[n,r]),U=E.useCallback(()=>{I(i)},[I,i]),j=E.useCallback(()=>{I(-i)},[I,i]),X=E.useCallback(()=>{w(l),C({x:0,y:0})},[l]),K=E.useCallback(H=>{H.preventDefault();let q=H.deltaY>0?-i:i;I(q)},[I,i]),F=E.useCallback(H=>{if(H.button!==0||H.isPrimary===!1)return;A(!0),M({x:H.clientX,y:H.clientY}),D(k);let q=H.currentTarget;q instanceof HTMLElement&&q.setPointerCapture(H.pointerId)},[k]),W=E.useCallback(H=>{if(!N)return;H.preventDefault();let q=H.clientX-R.x,J=H.clientY-R.y;C({x:_.x+q,y:_.y+J})},[N,R,_]),V=E.useCallback(H=>{A(!1);let q=H.currentTarget;q instanceof HTMLElement&&q.releasePointerCapture(H.pointerId)},[]);return E.useEffect(()=>{let H=b.current;if(H)return H.addEventListener("wheel",K,{passive:!1}),()=>{H.removeEventListener("wheel",K)}},[K]),E.useEffect(()=>{let H=x.current;if(H&&N)return document.body.style.userSelect="none",H.addEventListener("pointermove",W,{passive:!1}),H.addEventListener("pointerup",V),H.addEventListener("pointercancel",V),()=>{document.body.style.userSelect="",H.removeEventListener("pointermove",W),H.removeEventListener("pointerup",V),H.removeEventListener("pointercancel",V)}},[N,W,V]),m.jsxs("div",{className:h("relative flex flex-col",c?"h-full w-full":"min-h-28 w-full",t),ref:b,style:{cursor:N?"grabbing":"grab"},children:[a?m.jsxs("div",{className:h("absolute z-10 flex flex-col gap-1 rounded-md border border-border bg-background/80 p-1 supports-[backdrop-filter]:bg-background/70 supports-[backdrop-filter]:backdrop-blur-sm",c?"bottom-4 left-4":"bottom-2 left-2"),children:[m.jsx("button",{className:h("flex items-center justify-center rounded p-1.5 text-muted-foreground transition-colors hover:bg-muted hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50"),disabled:v>=r,onClick:U,title:"Zoom in",type:"button",children:m.jsx(f,{size:16})}),m.jsx("button",{className:h("flex items-center justify-center rounded p-1.5 text-muted-foreground transition-colors hover:bg-muted hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50"),disabled:v<=n,onClick:j,title:"Zoom out",type:"button",children:m.jsx(g,{size:16})}),m.jsx("button",{className:h("flex items-center justify-center rounded p-1.5 text-muted-foreground transition-colors hover:bg-muted hover:text-foreground"),onClick:X,title:"Reset zoom and pan",type:"button",children:m.jsx(d,{size:16})})]}):null,m.jsx("div",{className:h("flex-1 origin-center transition-transform duration-150 ease-out",c?"flex h-full w-full items-center justify-center":"flex w-full items-center justify-center"),onPointerDown:F,ref:x,role:"application",style:{transform:`translate(${k.x}px, ${k.y}px) scale(${v})`,transformOrigin:"center center",touchAction:"none",willChange:"transform"},children:e})]})},f6=({chart:e,className:t,config:n,fullscreen:r=!1,showControls:i=!0})=>{let a=kt(),[l,c]=E.useState(null),[d,f]=E.useState(!1),[g,h]=E.useState(""),[b,x]=E.useState(""),[v,w]=E.useState(0),{mermaid:k}=E.useContext(qr),C=Ey(),N=k?.errorComponent,{shouldRender:A,containerRef:R}=pee({immediate:r});if(E.useEffect(()=>{if(A){if(!C){c("Mermaid plugin not available. Please add the mermaid plugin to enable diagram rendering.");return}(async()=>{try{c(null),f(!0);let _=C.getMermaid(n),D=e.split("").reduce((j,X)=>(j<<5)-j+X.charCodeAt(0)|0,0),I=`mermaid-${Math.abs(D)}-${Date.now()}-${Math.random().toString(36).substring(2,9)}`,{svg:U}=await _.render(I,e);h(U),x(U)}catch(_){if(!(b||g)){let D=_ instanceof Error?_.message:"Failed to render Mermaid chart";c(D)}}finally{f(!1)}})()}},[e,n,v,A,C]),!(A||g||b))return m.jsx("div",{className:a("my-4 min-h-[200px]",t),ref:R});if(d&&!g&&!b)return m.jsx("div",{className:a("my-4 flex justify-center p-4",t),ref:R,children:m.jsxs("div",{className:a("flex items-center space-x-2 text-muted-foreground"),children:[m.jsx("div",{className:a("h-4 w-4 animate-spin rounded-full border-current border-b-2")}),m.jsx("span",{className:a("text-sm"),children:"Loading diagram..."})]})});if(l&&!g&&!b){let _=()=>w(D=>D+1);return N?m.jsx("div",{ref:R,children:m.jsx(N,{chart:e,error:l,retry:_})}):m.jsxs("div",{className:a("rounded-md bg-red-50 p-4",t),ref:R,children:[m.jsxs("p",{className:a("font-mono text-red-700 text-sm"),children:["Mermaid Error: ",l]}),m.jsxs("details",{className:a("mt-2"),children:[m.jsx("summary",{className:a("cursor-pointer text-red-600 text-xs"),children:"Show Code"}),m.jsx("pre",{className:a("mt-2 overflow-x-auto rounded bg-red-100 p-2 text-red-800 text-xs"),children:e})]})]})}let M=g||b;return m.jsx("div",{className:a("size-full",t),"data-streamdown":"mermaid",ref:R,children:m.jsx(Yte,{className:a(r?"size-full overflow-hidden":"overflow-hidden",t),fullscreen:r,maxZoom:3,minZoom:.5,showControls:i,zoomStep:.1,children:m.jsx("div",{"aria-label":"Mermaid chart",className:a("flex justify-center",r?"size-full items-center":null),dangerouslySetInnerHTML:{__html:M},role:"img"})})})};const h6=E.memo(function({children:t,streaming:n,className:r}){return m.jsx(d6,{mode:n?"streaming":"static",parseIncompleteMarkdown:n,shikiTheme:["github-light","github-dark"],className:Ie("size-full [&>*:first-child]:mt-0 [&>*:last-child]:mb-0",r),children:t})},(e,t)=>e.children===t.children&&e.streaming===t.streaming&&e.className===t.className);function Gte({children:e,isStreaming:t=!1,defaultOpen:n,className:r}){const[i,a]=E.useState(n??t),l=E.useRef(!1);E.useEffect(()=>{if(!l.current)if(t)a(!0);else{const d=setTimeout(()=>a(!1),600);return()=>clearTimeout(d)}},[t]);const c=e.trim()!=="";return!c&&!t?null:m.jsxs("div",{"data-slot":"reasoning","data-streaming":t||void 0,className:Ie("w-full",r),children:[m.jsxs("button",{type:"button",disabled:!c,onClick:()=>{l.current=!0,a(d=>!d)},className:"flex items-center gap-1.5 text-label text-fg-3 transition-colors outline-none disabled:cursor-default hover:text-fg-1 disabled:hover:text-fg-3",children:[m.jsx(t9,{className:"size-3.5"}),m.jsx("span",{children:t?"Thinking…":"Thought process"}),c?m.jsx(oA,{className:Ie("size-3.5 transition-transform",i&&"rotate-180")}):null]}),i&&c?m.jsx("div",{className:"mt-2 border-l-2 border-border pl-3 text-body-sm text-fg-3 [&_*]:text-fg-3",children:m.jsx(h6,{streaming:t,children:e})}):null]})}function Xte({cwd:e,hasCommands:t,hasSkills:n,canBrowseFiles:r,className:i}){const a=[{icon:n7,text:"Tell the agent what to do."},...t?[{icon:j7,text:"Type / for the CLI’s slash commands."}]:[],...n?[{icon:Ap,text:"Type $ to draft a message for one of the agent’s skills."}]:[],...r?[{icon:Jj,text:"Type @ to search this project’s files."}]:[]];return m.jsxs("div",{className:Ie("flex flex-col items-center gap-4 py-10",i),children:[m.jsx("div",{className:"flex size-12 items-center justify-center rounded-xl bg-surface text-fg-3",children:m.jsx(Ub,{className:"size-5"})}),e?m.jsx("p",{className:"max-w-full truncate font-mono text-label text-fg-4",children:e}):null,m.jsx("ul",{className:"w-full max-w-sm divide-y divide-border overflow-hidden rounded-lg bg-surface",children:a.map(l=>m.jsxs("li",{className:"flex items-center gap-3 px-3.5 py-2.5",children:[m.jsx(l.icon,{className:"size-4 shrink-0 text-fg-4"}),m.jsx("span",{className:"text-body-sm text-fg-3",children:l.text})]},l.text))})]})}const dw=2e3,Kte=new Set(["CodexImageGeneration","CodexImageView"]),Qte=e=>{if(!Kte.has(e.name))return;const t=e.input,n=t?.savedPath??t?.path;return typeof n=="string"?n:void 0},Wte={running:{label:"Running",variant:"info",busy:!0},pending:{label:"Executing",variant:"info",busy:!0},deferred:{label:"Deferred",variant:"accent",busy:!1},settled:{label:"Done",variant:"success",busy:!1},failed:{label:"Error",variant:"danger",busy:!1}};function Zte({item:e,hostImage:t,className:n}){const[r,i]=E.useState(!1),[a,l]=E.useState(!1),c=Qte(e),d=e.status??(e.result===void 0?"running":"settled"),f=Wte[d],g=d==="failed"||e.result?.isError===!0,h=u_(e.name),b=e.result?.text??"",x=!a&&b.length>dw,v=x?b.slice(0,dw):b;return m.jsxs("div",{"data-slot":"tool-call","data-state":d,className:Ie("w-full overflow-hidden rounded-lg border border-border bg-surface",n),children:[m.jsxs("button",{type:"button",onClick:()=>i(w=>!w),className:Ie("flex w-full items-center gap-2 px-3 py-2 text-left transition-colors outline-none","hover:bg-surface-hover focus-visible:bg-surface-hover"),children:[m.jsx(h,{className:"size-3.5 shrink-0 text-fg-3"}),m.jsx("span",{className:"shrink-0 font-mono text-body-sm font-medium text-fg-1",children:e.name}),e.backend&&e.backend!=="server"?m.jsx(gn,{variant:"neutral",className:"shrink-0",children:e.backend}):null,m.jsx("span",{className:"min-w-0 flex-1 truncate font-mono text-label text-fg-4",children:s_(e.input)}),m.jsxs(gn,{variant:f.variant,dot:!f.busy,className:"shrink-0 gap-1",children:[f.busy?m.jsx(wn,{className:"size-3 text-current"}):null,d==="deferred"?m.jsx(b9,{className:"size-3 text-current"}):null,f.label]}),m.jsx(oA,{className:Ie("size-3.5 shrink-0 text-fg-4 transition-transform",r&&"rotate-180")})]}),c&&t?m.jsx(Jte,{path:c,load:t}):null,r?m.jsxs("div",{className:"flex flex-col gap-2 border-t border-border p-2.5",children:[m.jsx(mh,{code:JSON.stringify(e.input,null,2),label:"Parameters"}),e.logs?.length?m.jsx(mh,{code:e.logs.join(`
669
+ `),label:"Logs"}):null,e.result!==void 0?m.jsxs("div",{children:[m.jsx(mh,{code:v||"(empty result)",label:g?"Error":"Result",className:Ie(g&&"border-danger/40 [&_pre]:text-danger")}),x?m.jsxs("button",{type:"button",className:"mt-1 text-label text-fg-3 underline-offset-2 hover:underline",onClick:()=>l(!0),children:["Show all ",b.length.toLocaleString()," chars"]}):null]}):null]}):null]})}function Jte({path:e,load:t}){const[n,r]=E.useState();return E.useEffect(()=>{let i=!1;return r(void 0),t(e).then(a=>{i||r(a)}).catch(()=>{}),()=>{i=!0}},[e,t]),n?m.jsx("div",{className:"border-t border-border p-2.5",children:m.jsx("img",{src:n,alt:e.split("/").pop()??"Generated image",className:"max-h-96 w-auto max-w-full rounded-md border border-border"})}):null}function ene({item:e}){return m.jsxs("div",{"data-slot":"turn-result",className:"py-1",children:[m.jsxs("div",{className:"flex items-center gap-2",children:[m.jsx("div",{className:"h-px flex-1 bg-border"}),m.jsxs("span",{className:Ie("font-mono text-label",e.isError?"text-danger":"text-fg-4"),children:[e.isError?e.subtype:"turn done"," · ",Hz(e.durationMs)," ·"," ",Wl(e.totalCostUsd)]}),m.jsx("div",{className:"h-px flex-1 bg-border"})]}),e.errors?.length?m.jsx("ul",{className:"mt-1 flex flex-col gap-0.5 text-center",children:e.errors.map((t,n)=>m.jsx("li",{className:"text-label break-words text-danger",children:t},n))}):null]})}function tne({item:e}){return m.jsx("div",{"data-slot":"notice",className:Ie("rounded-md border px-3 py-2 text-body-sm",e.level==="error"?"border-transparent bg-danger-bg text-danger":"border-border bg-surface text-fg-3"),children:e.text})}function nne({item:e,fileUrl:t,attachmentUrl:n,hostImage:r}){switch(e.kind){case"user":return m.jsxs(TC,{from:"user",children:[e.attachments?.length?m.jsx(sne,{attachments:e.attachments,attachmentUrl:n}):null,e.text?m.jsx(SC,{children:m.jsx(_F,{text:e.text})}):null]});case"assistant_text":return m.jsx(TC,{from:"assistant",children:m.jsx(SC,{children:m.jsx(h6,{streaming:e.streaming,children:e.text})})});case"thinking":return m.jsx(Gte,{isStreaming:e.id==="streaming-thinking",children:e.text});case"tool_call":return m.jsx(Zte,{item:e,hostImage:r});case"turn_result":return m.jsx(ene,{item:e});case"notice":return m.jsx(tne,{item:e});case"file_delivered":return m.jsx(NF,{item:e,href:t?.(e.path)});default:return null}}function rne(e){if(e.status!=="running"&&e.status!=="starting")return!1;const t=e.items.at(-1);return t?t.kind==="assistant_text"&&t.streaming||t.kind==="thinking"&&t.id==="streaming-thinking"?!1:t.kind!=="turn_result"||e.status==="running":!0}function sne({attachments:e,attachmentUrl:t}){return m.jsx("div",{className:"mb-1 flex flex-wrap justify-end gap-1.5",children:e.map(n=>{const r=t?.(n.id);return n.mediaType.startsWith("image/")&&r?m.jsx("img",{src:r,alt:n.name,className:"size-20 rounded-md border border-border object-cover"},n.id):m.jsx("span",{className:"rounded-full border border-border bg-surface px-2.5 py-1 text-body-xs text-fg-3",children:n.name},n.id)})})}function ine(e){return"parentToolUseId"in e&&e.parentToolUseId!=null?"border-l-2 border-border pl-3":void 0}function ane({state:e,fileUrl:t,attachmentUrl:n,canBrowseFiles:r,hostImage:i,className:a}){return m.jsxs(CF,{className:a,children:[m.jsxs(kF,{children:[e.items.length===0&&e.status!=="starting"?m.jsx(Xte,{cwd:e.cwd,hasCommands:!!e.commands?.length,hasSkills:!!e.skills?.some(l=>l.enabled),canBrowseFiles:r}):e.items.map(l=>m.jsx("div",{className:ine(l),children:m.jsx(nne,{item:l,fileUrl:t,attachmentUrl:n,hostImage:i})},`${l.kind}:${l.id}`)),rne(e)?m.jsx(AF,{label:e.status==="starting"?"Starting session…":void 0}):null]}),m.jsx(wF,{})]})}function one(e){const[t,n]=E.useState(()=>Date.now());return E.useEffect(()=>{if(!e)return;n(Date.now());const r=setInterval(()=>n(Date.now()),6e4);return()=>clearInterval(r)},[e]),t}const lne=e=>e>=90?"bg-danger":e>=70?"bg-warning":"bg-accent";function une({rateLimits:e,subscriptionType:t,engine:n,totalCostUsd:r,updatedAt:i,open:a,onOpenChange:l}){const c=one(a);return m.jsx(Gl,{open:a,onOpenChange:l,children:m.jsxs(Xl,{children:[m.jsx(Kl,{title:"Usage",description:n==="claude"?"Claude Code":n,actions:t?m.jsx(gn,{variant:"accent",className:"mt-0.5 shrink-0 capitalize",children:t}):null}),m.jsxs(Ql,{children:[e.length===0?m.jsx("p",{className:"py-6 text-center text-body-sm text-fg-4",children:n==="claude"?"This session reports no plan windows — API-key sessions have none, and a subscription session reports them once a turn has run.":`Plan windows are a claude.ai subscription thing; this session runs on the ${n} engine.`}):m.jsx("div",{className:"flex flex-col gap-5",children:e.map(({key:d,info:f})=>m.jsx(cne,{windowKey:d,info:f,now:c},d))}),m.jsxs("div",{className:"mt-5 flex items-baseline justify-between gap-4 border-t border-border pt-3",children:[m.jsx("span",{className:"text-label text-fg-3",children:"This session has cost"}),m.jsx("span",{className:"font-mono text-body-sm text-fg-1",children:Wl(r)})]}),i?m.jsxs("p",{className:"mt-2 text-label text-fg-4",children:["Updated ",Fz(i,c)]}):null]})]})})}function cne({windowKey:e,info:t,now:n}){const r=t.utilization??0,i=t.resetsAt!==void 0?t.resetsAt*1e3:void 0,a=zz(e),l=i!==void 0?(i-n)/1e3:void 0,c=a!==void 0&&l!==void 0&&l>0&&l<a?(a-l)/a:void 0;return m.jsxs("div",{children:[m.jsxs("div",{className:"flex items-baseline justify-between gap-3",children:[m.jsx("span",{className:"truncate text-body-sm text-fg-1",children:Uz(e)}),m.jsxs("span",{className:Ie("shrink-0 font-mono text-body-sm font-medium",t.status==="rejected"?"text-danger":"text-fg-1"),children:[r.toFixed(0),"% used"]})]}),m.jsxs("div",{className:"relative mt-2 h-2 rounded-full bg-border",children:[m.jsx("div",{className:Ie("h-full rounded-full",lne(r)),style:{width:`${Math.min(100,Math.max(2,r))}%`}}),c!==void 0?m.jsx("span",{"aria-hidden":!0,title:"Spent evenly, usage would be here by now",className:"absolute -top-1 h-4 w-0.5 -translate-x-1/2 rounded-full bg-fg-1",style:{left:`${Math.min(100,Math.max(0,c*100))}%`}}):null]}),m.jsxs("div",{className:"mt-1.5 flex items-center gap-3 text-label text-fg-4",children:[i!==void 0?m.jsxs("span",{className:"inline-flex items-center gap-1",children:[m.jsx(T7,{className:"size-3"})," Resets in ",Yb(i,n)]}):null,t.isUsingOverage?m.jsx("span",{className:"text-warning",children:"overage"}):null,t.status==="rejected"?m.jsx("span",{className:"text-danger",children:"limit reached"}):null]})]})}function dne({client:e,sessionId:t,header:n,className:r}){const[i,a]=E.useState(void 0),[l,c]=E.useState(),{state:d,connection:f,protocolMismatch:g,models:h,effectiveModel:b,handle:x,send:v,approve:w,deny:k,interrupt:C,setModel:N,setPermissionMode:A,reconnectNow:R}=pz(e,t,{onProtocolError:a});E.useEffect(()=>a(void 0),[t]),E.useEffect(()=>{const q=()=>{document.visibilityState==="visible"&&R()};return document.addEventListener("visibilitychange",q),()=>document.removeEventListener("visibilitychange",q)},[R]),Bz(x);const M=d.capabilities,_=d.status==="running"||d.status==="awaiting_approval",D=d.status==="failed"||d.status==="closed",I=xz(e,t,{capabilities:M,engine:d.engine}),U=t_(e,d.cwd),j=E.useMemo(()=>cz(d),[d]),X=fne(e,t,d.producedFiles),K=E.useRef(null),F=E.useMemo(()=>{if(d.commands)return d.commands.some(q=>q.name==="model")?d.commands:[{name:"model",description:"Switch the model for this session",argumentHint:"<model>"},...d.commands]},[d.commands]),W=(q,J)=>{if(J.length===0){const ue=/^\/model\s+(\S+)$/.exec(q);if(ue){N(ue[1]);return}if(M.mcpStatus&&q.trim()==="/mcp"){c("mcp");return}}v(q,J)},V=m.jsxs(VB,{children:[m.jsx(qB,{render:m.jsx(at,{variant:"ghost",size:"icon-sm","aria-label":"Session actions",children:m.jsx(S9,{className:"size-4"})})}),m.jsxs(YB,{children:[M.contextUsage?m.jsxs(hl,{onClick:()=>c("context"),children:[m.jsx(i9,{className:"size-3.5 text-fg-3"})," Context"]}):null,M.rateLimits?m.jsxs(hl,{onClick:()=>c("usage"),children:[m.jsx(z9,{className:"size-3.5 text-fg-3"})," Usage"]}):null,m.jsxs(hl,{onClick:()=>c("info"),children:[m.jsx(K9,{className:"size-3.5 text-fg-3"})," Session info"]}),M.mcpStatus?m.jsxs(hl,{onClick:()=>c("mcp"),children:[m.jsx(f7,{className:"size-3.5 text-fg-3"})," MCP servers"]}):null,M.skillsList?m.jsxs(hl,{onClick:()=>c("skills"),children:[m.jsx(Ap,{className:"size-3.5 text-fg-3"})," Skills"]}):null,U.available?m.jsxs(hl,{onClick:()=>c("files"),children:[m.jsx(B9,{className:"size-3.5 text-fg-3"})," Project files"]}):null]})]}),H=typeof n=="function";return m.jsxs("div",{"data-slot":"session-panel",className:Ie("flex h-full min-h-0 flex-col overflow-hidden bg-bg",r),children:[H?n({actions:V}):n,m.jsx(bF,{state:d,connection:f,onOpenStatus:()=>c("info"),onOpenContext:()=>c("context"),onOpenUsage:()=>c("usage"),actions:H?void 0:V}),g!==void 0?m.jsxs(fw,{level:"warning",children:["Server speaks protocol v",g,", this build renders v",e_,". Some events may not render."]}):null,i?m.jsx(fw,{level:"error",onDismiss:()=>a(void 0),children:i}):null,m.jsx(ane,{state:d,fileUrl:t?q=>e.sessionFileUrl(t,q):void 0,attachmentUrl:t?q=>e.attachmentUrl(t,q):void 0,canBrowseFiles:U.available,hostImage:X}),M.interactiveApprovals&&d.pendingApprovals.length>0?m.jsx("div",{className:"px-3 pb-2",children:m.jsx("div",{className:"mx-auto flex w-full max-w-3xl flex-col gap-2",children:d.pendingApprovals.map(q=>q.toolName==="AskUserQuestion"&&c_(q.input).length>0?m.jsx(dF,{request:q,onAnswer:w,onDismiss:J=>k(J,"Question dismissed by user")},q.id):m.jsx(cF,{request:q,onApprove:w,onDeny:k},q.id))})}):null,m.jsx(Vz,{ref:K,onSend:W,onInterrupt:C,busy:_,disabled:D||!t,commands:M.slashCommands?F:void 0,skills:M.skillsList?d.skills:void 0,attachments:I,onSearchFiles:U.available?(q,J)=>U.search(q,{...J,limit:8}):void 0,toolbar:m.jsxs(m.Fragment,{children:[h.length?m.jsx(l_,{models:h,model:b,onModelChange:N,disabled:D}):null,d.permissionMode?m.jsx(rd,{mode:d.permissionMode,onModeChange:A,modes:M.permissionModes,canBypass:d.session?.canBypassPermissions,disabled:D}):null]})}),m.jsx(fF,{state:d,client:e,sessionId:t,open:l==="info",onOpenChange:q=>c(q?"info":void 0)}),m.jsx(Qz,{usage:d.contextUsage,open:l==="context",onOpenChange:q=>c(q?"context":void 0)}),m.jsx(une,{rateLimits:j,subscriptionType:d.subscriptionType,engine:d.engine??"claude",totalCostUsd:d.totalCostUsd,updatedAt:d.rateLimitsUpdatedAt,open:l==="usage",onOpenChange:q=>c(q?"usage":void 0)}),m.jsx(Jz,{client:e,sessionId:t,canManageServers:M.mcpServerActions,open:l==="mcp",onOpenChange:q=>c(q?"mcp":void 0)}),m.jsx(sF,{skills:d.skills,open:l==="skills",onOpenChange:q=>c(q?"skills":void 0),onUse:q=>K.current?.insertText(i_(q))}),m.jsx(Wz,{client:e,cwd:d.cwd,open:l==="files",onOpenChange:q=>c(q?"files":void 0)})]})}function fne(e,t,n){const r=E.useRef(new Map),i=E.useRef([]);return E.useEffect(()=>()=>{for(const a of i.current)URL.revokeObjectURL(a);i.current=[]},[]),E.useCallback(a=>{const l=n?.[a],c=l?`produced:${l.fileId}`:`fs:${a}`,d=r.current.get(c);if(d)return d;const f=l&&t?e.readProducedFile(t,l.fileId).then(g=>{if(g.size===0)return;const h=URL.createObjectURL(g);return i.current.push(h),h}).catch(()=>{}):e.readHostFile(a).then(g=>{if(g.encoding!=="base64")return;const h=a.slice(a.lastIndexOf(".")+1).toLowerCase(),b=hne[h];return b?`data:${b};base64,${g.content}`:void 0}).catch(()=>{});return r.current.set(c,f),f},[e,t,n])}const hne={png:"image/png",jpg:"image/jpeg",jpeg:"image/jpeg",gif:"image/gif",webp:"image/webp"};function fw({level:e,onDismiss:t,children:n}){return m.jsx("div",{className:"px-3 pt-2",children:m.jsxs("div",{role:"alert",className:Ie("mx-auto flex w-full max-w-3xl items-start gap-2 rounded-md border px-3 py-2 text-body-sm",e==="error"?"border-danger/40 bg-danger-bg text-danger":"border-warning/40 bg-warning-bg text-warning"),children:[m.jsx(wl,{className:"mt-0.5 size-3.5 shrink-0"}),m.jsx("span",{className:"min-w-0 flex-1 break-words",children:n}),t?m.jsx("button",{type:"button",onClick:t,"aria-label":"Dismiss",className:"shrink-0 opacity-70 transition-opacity hover:opacity-100",children:m.jsx(mi,{className:"size-3.5"})}):null]})})}function pne({files:e,activePath:t,onActivate:n,onClose:r,className:i}){return m.jsx(dH,{delay:500,closeDelay:0,children:m.jsx("div",{"data-slot":"editor-tabs",role:"tablist","aria-label":"Open files",className:Ie("flex shrink-0 items-stretch overflow-x-auto border-b border-border bg-surface",i),children:e.map(a=>m.jsx(mne,{file:a,active:a.path===t,onActivate:()=>n(a.path),onClose:()=>r(a.path),onArrow:l=>{const c=e.findIndex(f=>f.path===a.path),d=e[c+l];d&&n(d.path)}},a.path))})})}function mne({file:e,active:t,onActivate:n,onClose:r,onArrow:i}){const a=qc(e),l=E.useRef(null);E.useEffect(()=>{t&&l.current?.scrollIntoView({block:"nearest",inline:"nearest"})},[t]);const c=d=>{d.button===1&&(d.preventDefault(),r())};return m.jsxs(Dx,{side:"bottom",render:m.jsx("div",{ref:l,role:"tab",tabIndex:t?0:-1,"aria-selected":t,onClick:n,onAuxClick:c,onKeyDown:d=>{if(d.key==="ArrowRight")i(1);else if(d.key==="ArrowLeft")i(-1);else if(d.key==="Enter"||d.key===" ")n();else return;d.preventDefault()},className:Ie("group flex min-w-0 shrink-0 cursor-pointer items-center gap-1.5 border-r border-border px-3 py-1.5 transition-colors","focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-accent focus-visible:ring-inset",t?"bg-bg text-fg-1":"text-fg-3 hover:bg-surface-hover hover:text-fg-2")}),content:m.jsxs("span",{className:"flex flex-col gap-0.5",children:[m.jsx("span",{className:"font-mono break-all",children:e.path}),e.bytes!==void 0?m.jsx("span",{className:"text-fg-4",children:jl(e.bytes)}):null]}),children:[m.jsx("span",{className:Ie("max-w-40 truncate font-mono text-label",a&&"italic"),children:e.name}),e.status==="error"?m.jsx("span",{className:"shrink-0 text-danger",children:"!"}):null,m.jsxs("button",{type:"button","aria-label":a?`Close ${e.name} (unsaved changes)`:`Close ${e.name}`,onClick:d=>{d.stopPropagation(),r()},className:Ie("shrink-0 rounded p-0.5 text-fg-4 transition-opacity hover:bg-surface-hover hover:text-fg-1",t||a?"opacity-70":"opacity-0 group-hover:opacity-70 focus-visible:opacity-100"),children:[m.jsx("span",{className:Ie("block",a&&"group-hover:hidden"),children:a?m.jsx("span",{className:"block size-3 rounded-full bg-fg-2"}):m.jsx(mi,{className:"size-3"})}),a?m.jsx("span",{className:"hidden group-hover:block",children:m.jsx(mi,{className:"size-3"})}):null]})]})}const p6=12;function gne({tree:e,search:t,activePath:n,onOpenFile:r,onCollapse:i,style:a,className:l}){const[c,d]=E.useState(""),[f,g]=E.useState(),h=c.trim().length>0;return E.useEffect(()=>{if(!t?.available)return;const b=c.trim();if(!b){g(void 0);return}const x=new AbortController,v=setTimeout(()=>{t.search(b,{limit:60,signal:x.signal}).then(w=>{x.signal.aborted||g(w)})},150);return()=>{x.abort(),clearTimeout(v)}},[t,c]),m.jsxs("div",{"data-slot":"file-tree",style:a,className:Ie("flex min-h-0 min-w-0 flex-col bg-surface",l),children:[m.jsxs("div",{className:"flex items-center gap-1 px-2 pt-2",children:[t?.available?m.jsxs("div",{className:"relative min-w-0 flex-1",children:[m.jsx(Rx,{className:"absolute top-1/2 left-2 size-3.5 -translate-y-1/2 text-fg-4"}),m.jsx(un,{value:c,onChange:b=>d(b.target.value),placeholder:"Search files…",className:"h-7 pr-7 pl-7 text-label",spellCheck:!1}),h?m.jsx("button",{type:"button",onClick:()=>d(""),"aria-label":"Clear search",className:"absolute top-1/2 right-1.5 -translate-y-1/2 text-fg-4 transition-colors hover:text-fg-2",children:m.jsx(mi,{className:"size-3.5"})}):null]}):m.jsx("span",{className:"min-w-0 flex-1 truncate px-1 font-mono text-label text-fg-4",children:e.root}),m.jsx(at,{variant:"ghost",size:"icon-sm","aria-label":"Refresh the file tree",onClick:()=>e.refresh(),children:m.jsx(Np,{className:"size-3.5 text-fg-3"})}),i?m.jsx(at,{variant:"ghost",size:"icon-sm","aria-label":"Hide project files",onClick:i,children:m.jsx(mA,{className:"size-3.5 text-fg-3"})}):null]}),m.jsx("div",{className:"min-h-0 flex-1 overflow-auto px-1 py-1",children:e.error?m.jsx("p",{className:"px-2 py-3 text-body-sm text-danger",children:e.error}):h?f===void 0?m.jsx("div",{className:"py-6 text-center",children:m.jsx(wn,{className:"size-4 text-fg-4"})}):f.length===0?m.jsx("p",{className:"px-2 py-6 text-center text-body-sm text-fg-4",children:"No matching files."}):m.jsx("ul",{children:f.map(b=>m.jsx("li",{children:m.jsx(hw,{label:bne(b.relative),detail:xne(b.relative),title:b.relative,icon:m.jsx(wp,{className:"size-3.5 shrink-0 text-fg-4"}),active:b.path===n,onClick:()=>r(b.path)})},b.path))}):e.loading?m.jsx("div",{className:"py-6 text-center",children:m.jsx(wn,{className:"size-4 text-fg-4"})}):e.rows.length===0?m.jsx("p",{className:"px-2 py-6 text-center text-body-sm text-fg-4",children:"This project is empty."}):m.jsx("ul",{role:"tree","aria-label":"Project files",children:e.rows.map(b=>m.jsxs("li",{role:"treeitem","aria-expanded":b.expanded,"aria-level":b.depth+1,children:[m.jsx(hw,{label:b.entry.name,indent:b.depth,active:b.entry.path===n,icon:b.entry.type==="dir"?b.loading?m.jsx(wn,{className:"size-3.5 shrink-0 text-fg-4"}):b.expanded?m.jsx(L9,{className:"size-3.5 shrink-0 text-accent"}):m.jsx(cA,{className:"size-3.5 shrink-0 text-accent"}):m.jsx(yne,{type:b.entry.type}),chevron:b.entry.type==="dir"?m.jsx(kp,{className:Ie("size-3 shrink-0 text-fg-4 transition-transform",b.expanded&&"rotate-90")}):void 0,onClick:()=>b.entry.type==="dir"?e.toggle(b.entry.path):r(b.entry.path)}),b.truncated?m.jsx("p",{className:"truncate py-0.5 text-label text-fg-4",style:{paddingLeft:(b.depth+1)*p6+22},children:"More entries than the server will return — use search."}):null]},b.entry.path))})})]})}function hw({label:e,detail:t,title:n,icon:r,chevron:i,indent:a=0,active:l,onClick:c}){const d=E.useRef(null);return E.useEffect(()=>{l&&d.current?.scrollIntoView({block:"nearest"})},[l]),m.jsxs("button",{ref:d,type:"button",onClick:c,title:n??e,style:{paddingLeft:a*p6+4},className:Ie("flex w-full items-center gap-1 rounded py-1 pr-2 text-left transition-colors",l?"bg-surface-hover text-fg-1":"text-fg-2 hover:bg-surface-hover"),children:[m.jsx("span",{className:"flex size-3 shrink-0 items-center justify-center",children:i}),r,m.jsx("span",{className:"shrink-0 truncate font-mono text-label",children:e}),t?m.jsx("span",{className:"min-w-0 flex-1 truncate font-mono text-label text-fg-4",children:t}):null]})}function bne(e){return e.slice(e.lastIndexOf("/")+1)}function xne(e){const t=e.lastIndexOf("/");return t===-1?void 0:e.slice(0,t)}function yne({type:e}){return e==="symlink"?m.jsx(fA,{className:"size-3.5 shrink-0 text-fg-4"}):m.jsx(wp,{className:"size-3.5 shrink-0 text-fg-4"})}function Ene({path:e,value:t,onChange:n,onSave:r,readOnly:i,className:a}){const l=E.useRef(null),c=E.useRef(null),d=E.useRef(null),[f,g]=E.useState(!1),h=vne(),b=E.useRef({onChange:n,onSave:r});return b.current={onChange:n,onSave:r},E.useEffect(()=>{let x=!1;return Tne().then(v=>{if(x||!l.current)return;d.current=v;const w=v.editor.create(l.current,{value:t,language:gw(e),readOnly:i,automaticLayout:!0,theme:pw(document.documentElement.getAttribute("data-theme")),minimap:{enabled:!1},scrollBeyondLastLine:!1,fontSize:12,lineHeight:20,fontFamily:'ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace',renderLineHighlight:"line",smoothScrolling:!0,padding:{top:8,bottom:8},scrollbar:{verticalScrollbarSize:10,horizontalScrollbarSize:10},wordBasedSuggestions:"off",quickSuggestions:!1});c.current=w,w.onDidChangeModelContent(()=>{b.current.onChange?.(w.getValue())}),w.addCommand(v.KeyMod.CtrlCmd|v.KeyCode.KeyS,()=>{b.current.onSave?.()}),g(!0)}),()=>{x=!0,c.current?.dispose(),c.current=null,g(!1)}},[]),E.useEffect(()=>{const x=d.current,v=c.current;if(!x||!v||!f)return;const w=x.Uri.parse(`workerdeck://host${e}`),k=x.editor.getModel(w)??x.editor.createModel(t,gw(e),w);v.getModel()!==k&&v.setModel(k)},[e,f,t]),E.useEffect(()=>{const x=c.current;if(!x||!f)return;const v=x.getModel();!v||v.getValue()===t||v.pushEditOperations([],[{range:v.getFullModelRange(),text:t}],()=>null)},[t,f]),E.useEffect(()=>{f&&c.current?.updateOptions({readOnly:i})},[i,f]),E.useEffect(()=>{f&&d.current?.editor.setTheme(pw(h))},[h,f]),m.jsxs("div",{className:Ie("relative min-h-0 min-w-0 flex-1",a),children:[m.jsx("div",{ref:l,className:"absolute inset-0"}),f?null:m.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-bg",children:m.jsx(wn,{className:"size-4 text-fg-4"})})]})}function vne(){const[e,t]=E.useState(()=>typeof document>"u"?null:document.documentElement.getAttribute("data-theme"));return E.useEffect(()=>{const n=document.documentElement,r=()=>t(n.getAttribute("data-theme"));r();const i=new MutationObserver(r);return i.observe(n,{attributes:!0,attributeFilter:["data-theme"]}),()=>i.disconnect()},[]),e}function pw(e){return e==="light"?"wd-light":"wd-dark"}let mw;function Tne(){return mw??=(async()=>{const e=await Pl(()=>import("./index-if4BL-EX.js"),__vite__mapDeps([0,1]));return e.editor.defineTheme("wd-dark",{base:"vs-dark",inherit:!0,rules:[],colors:{"editor.background":"#00000000"}}),e.editor.defineTheme("wd-light",{base:"vs",inherit:!0,rules:[],colors:{"editor.background":"#00000000"}}),e})(),mw}function gw(e){const t=e.slice(e.lastIndexOf("/")+1),n=Sne[t.toLowerCase()];if(n)return n;const r=t.slice(t.lastIndexOf(".")+1).toLowerCase();return Cne[r]??"plaintext"}const Sne={dockerfile:"dockerfile",makefile:"plaintext",".gitignore":"plaintext",".env":"shell"},Cne={ts:"typescript",tsx:"typescript",mts:"typescript",cts:"typescript",js:"javascript",jsx:"javascript",mjs:"javascript",cjs:"javascript",json:"json",jsonc:"json",md:"markdown",mdx:"markdown",css:"css",scss:"scss",less:"less",html:"html",htm:"html",xml:"xml",svg:"xml",yml:"yaml",yaml:"yaml",toml:"plaintext",sh:"shell",bash:"shell",zsh:"shell",fish:"shell",py:"python",rb:"ruby",rs:"rust",go:"go",swift:"swift",java:"java",kt:"kotlin",c:"c",h:"c",cpp:"cpp",cc:"cpp",hpp:"cpp",cs:"csharp",php:"php",sql:"sql",graphql:"graphql",gql:"graphql",lua:"lua",r:"r",pl:"perl",dart:"dart",scala:"scala",ini:"ini",cfg:"ini",conf:"ini",txt:"plaintext",log:"plaintext"};function kne({file:e,canWrite:t,onChange:n,onSave:r,onRevert:i,onReload:a,onOverwrite:l,onDismissConflict:c,className:d}){return e?m.jsxs("div",{"data-slot":"file-viewer",className:Ie("flex min-h-0 min-w-0 flex-1 flex-col bg-bg",d),children:[e.conflict?m.jsxs("div",{className:"flex shrink-0 flex-wrap items-center gap-2 border-b border-warning/40 bg-warning-bg px-3 py-2",children:[m.jsx(wl,{className:"size-3.5 shrink-0 text-warning"}),m.jsx("span",{className:"min-w-0 flex-1 text-body-sm text-warning",children:"This file changed on disk since you opened it."}),m.jsx(at,{variant:"outline",size:"xs",onClick:()=>a?.(e.path),children:"Use the version on disk"}),m.jsx(at,{variant:"outline",size:"xs",onClick:()=>l?.(e.path),children:"Keep mine"}),m.jsx(at,{variant:"ghost",size:"xs",onClick:()=>c?.(e.path),children:"Dismiss"})]}):e.saveError?m.jsxs("div",{className:"flex shrink-0 items-center gap-2 border-b border-danger/40 bg-danger-bg px-3 py-2",children:[m.jsx(wl,{className:"size-3.5 shrink-0 text-danger"}),m.jsx("span",{className:"min-w-0 flex-1 text-body-sm text-danger",children:e.saveError}),m.jsx(at,{variant:"ghost",size:"xs",onClick:()=>c?.(e.path),children:"Dismiss"})]}):null,e.status==="loading"?m.jsx(mb,{children:m.jsx(wn,{className:"size-4 text-fg-4"})}):e.status==="error"?m.jsxs(mb,{children:[m.jsx(wl,{className:"size-4 text-danger"}),m.jsx("p",{className:"text-body-sm text-danger",children:e.error})]}):e.status==="binary"?m.jsxs(mb,{children:[m.jsx(A9,{className:"size-4 text-fg-4"}),m.jsx("p",{className:"text-body-sm text-fg-4",children:"This file isn’t text."}),m.jsx("p",{className:"text-label text-fg-4",children:"It can’t be edited here without corrupting it."})]}):m.jsx(Ene,{path:e.path,value:qb(e),readOnly:!t,onChange:n?f=>n(e.path,f):void 0,onSave:r?()=>r(e.path):void 0}),e.status==="ready"&&(e.saving||qc(e)||!t)?m.jsx("div",{className:"flex shrink-0 items-center gap-2 border-t border-border px-3 py-1",children:e.saving?m.jsxs(m.Fragment,{children:[m.jsx(wn,{className:"size-3 text-fg-4"}),m.jsx("span",{className:"text-label text-fg-4",children:"Saving…"})]}):t?m.jsxs(m.Fragment,{children:[m.jsx("span",{className:"text-label text-fg-3",children:"Unsaved changes"}),m.jsx("span",{className:"flex-1"}),m.jsx(at,{variant:"ghost",size:"xs",onClick:()=>i?.(e.path),children:"Revert"}),m.jsxs(at,{variant:"outline",size:"xs",onClick:()=>r?.(e.path),children:["Save",m.jsx("span",{className:"ml-1 text-fg-4",children:"⌘S"})]})]}):m.jsx("span",{className:"text-label text-fg-4",children:"Read-only — this gateway doesn’t allow writes."})}):null]}):null}function mb({children:e}){return m.jsx("div",{className:"flex min-h-0 flex-1 flex-col items-center justify-center gap-2 p-6",children:e})}const wne=180,Nne=520,Ane=220,bw=120;function _ne({client:e,sessionId:t,header:n,defaultRailWidth:r=260,defaultRailCollapsed:i,className:a}){const{info:l}=n_(e,t),c=l?.cwd,d=Oz(e,c),f=t_(e,c),g=Mz(e),{canWrite:h}=Rz(e);E.useEffect(()=>{if(!g.hasUnsaved)return;const F=W=>W.preventDefault();return window.addEventListener("beforeunload",F),()=>window.removeEventListener("beforeunload",F)},[g.hasUnsaved]);const b=One(),[x,v]=E.useState(i??!1),[w,k]=E.useState(r),[C,N]=E.useState(360),A=g.files.length>0,R=!b,M=d.available&&!x;E.useEffect(()=>{R&&v(!0)},[R]);const _=E.useCallback(F=>{const W=g.files.find(V=>V.path===F);if(W&&qc(W)){const V=W.name;if(!window.confirm(`${V} has unsaved changes. Close it and lose them?`))return}g.close(F)},[g]),D=E.useRef(null),I=Rne(D),U=Math.max(bw,I-Ane),[j,X]=E.useState(null),K=n===void 0||j===null?void 0:typeof n=="function"?F=>br.createPortal(n(F),j):br.createPortal(n,j);return m.jsxs("div",{"data-slot":"session-workspace",className:Ie("flex h-full min-h-0 w-full flex-col overflow-hidden bg-bg",a),children:[n!==void 0?m.jsx("div",{ref:X,className:"shrink-0"}):null,m.jsxs("div",{className:"relative flex min-h-0 flex-1",children:[M?m.jsx(gne,{tree:d,search:f,activePath:g.activePath,onOpenFile:g.open,onCollapse:()=>v(!0),style:{width:R?Math.min(w,320):w},className:Ie("shrink-0 border-r border-border",R&&"absolute inset-y-0 left-0 z-20 shadow-lg")}):d.available?m.jsx("div",{className:"flex w-8 shrink-0 flex-col items-center border-r border-border bg-surface pt-1.5",children:m.jsx(at,{variant:"ghost",size:"icon-sm","aria-label":"Show project files",onClick:()=>v(!1),children:m.jsx(gA,{className:"size-4 text-fg-3"})})}):null,M&&!R?m.jsx(JS,{orientation:"vertical",value:w,onValueChange:k,min:wne,max:Nne,"aria-label":"Resize the file tree"}):null,m.jsxs("div",{ref:D,className:"flex min-h-0 min-w-0 flex-1 flex-col",children:[A?m.jsxs("div",{className:"flex min-h-0 shrink-0 flex-col overflow-hidden",style:{height:Math.min(C,U||C)},children:[m.jsx(pne,{files:g.files,activePath:g.activePath,onActivate:g.activate,onClose:_}),m.jsx(kne,{file:g.active,canWrite:h,onChange:g.edit,onSave:F=>void g.save(F),onRevert:g.revert,onReload:g.reload,onOverwrite:F=>void g.overwrite(F),onDismissConflict:g.dismissConflict})]}):null,A?m.jsx(JS,{orientation:"horizontal",value:Math.min(C,U||C),onValueChange:N,min:bw,max:U,"aria-label":"Resize the open file"}):null,m.jsx(dne,{client:e,sessionId:t,header:K,className:"min-h-0 flex-1"})]}),R&&M?m.jsx("button",{type:"button","aria-label":"Close the file tree",onClick:()=>v(!0),className:"absolute inset-0 z-10 bg-black/30"}):null]})]})}function Rne(e){const[t,n]=E.useState(0);return E.useLayoutEffect(()=>{const r=e.current;if(!r)return;const i=new ResizeObserver(([a])=>{a&&n(a.contentRect.height)});return i.observe(r),()=>i.disconnect()},[e]),t}function One(){const[e,t]=E.useState(!0);return E.useEffect(()=>{const n=window.matchMedia("(min-width: 768px)"),r=()=>t(n.matches);return r(),n.addEventListener("change",r),()=>n.removeEventListener("change",r)},[]),e}function Ine({session:e,active:t,onSelect:n,onDelete:r}){const i=d_[e.status];return m.jsxs("div",{"data-slot":"session-list-item","data-active":t||void 0,className:Ie("group flex w-full items-center gap-2 rounded-md border border-transparent px-2.5 py-2 text-left transition-colors",t?"border-border bg-surface":"hover:bg-surface-hover"),children:[m.jsxs("button",{type:"button",onClick:()=>n?.(e.id),className:"min-w-0 flex-1 text-left outline-none",children:[m.jsxs("div",{className:"flex items-center gap-2",children:[m.jsx("span",{className:"truncate text-body-sm font-medium text-fg-1",children:e.title??e.id.slice(0,8)}),m.jsx(gn,{variant:i.variant,dot:!0,className:"shrink-0",children:i.label})]}),m.jsxs("div",{className:"mt-0.5 flex items-center gap-2 font-mono text-label text-fg-4",children:[m.jsx("span",{className:"truncate",children:e.cwd}),e.profile?m.jsxs("span",{className:"shrink-0",children:["@",e.profile]}):null,m.jsx("span",{className:"shrink-0",children:Wl(e.totalCostUsd)}),m.jsx("span",{className:"shrink-0",children:Mp(e.lastActivityAt??e.createdAt)})]})]}),r?m.jsx(at,{variant:"ghost",size:"icon-sm","aria-label":"Close session",className:"opacity-0 transition-opacity group-hover:opacity-100",onClick:()=>r(e.id),children:m.jsx(Ox,{className:"size-3.5 text-fg-3"})}):null]})}function Mne({sessions:e,activeId:t,onSelect:n,onDelete:r,emptyText:i="No sessions yet.",className:a}){return m.jsx("div",{"data-slot":"session-list",className:Ie("flex flex-col gap-1",a),children:e.length===0?m.jsx("div",{className:"px-2.5 py-6 text-center text-body-sm text-fg-4",children:i}):e.map(l=>m.jsx(Ine,{session:l,active:l.id===t,onSelect:n,onDelete:r},l.id))})}const Lne="0.10.0",Dne=Lne;function Pne({className:e}){return m.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",className:e,children:[m.jsx("path",{d:"M8 3.5h9A3.5 3.5 0 0 1 20.5 7v9"}),m.jsx("rect",{width:"13.5",height:"13.5",x:"3.5",y:"7",rx:"3.5"}),m.jsx("path",{d:"m7 16.5 2.5-2.5L7 11.5"}),m.jsx("circle",{cx:"13.2",cy:"14",r:"1.7",fill:"#2fbf71",stroke:"none"})]})}function m6(){const[e,t]=E.useState(S1());return m.jsx(at,{variant:"ghost",size:"icon-sm","aria-label":"Toggle theme",onClick:()=>t(XI()),children:e==="dark"?m.jsx($7,{className:"size-4"}):m.jsx(s7,{className:"size-4"})})}const jne=[{id:"sessions",label:"Sessions",icon:H7,path:"/sessions"},{id:"jobs",label:"Jobs",icon:hA,path:"/jobs"},{id:"profiles",label:"Profiles",icon:bA,path:"/profiles"},{id:"settings",label:"Settings",icon:A7,path:"/settings"}],xw="workerdeck.sidebar-collapsed";function Bne({children:e}){const t=HM({select:a=>a.location.pathname}),[n,r]=E.useState(()=>{try{return localStorage.getItem(xw)==="1"}catch{return!1}}),i=()=>{r(a=>{try{localStorage.setItem(xw,a?"0":"1")}catch{}return!a})};return m.jsxs("div",{className:"flex h-dvh bg-sidebar",children:[m.jsxs("aside",{className:Ie("flex shrink-0 flex-col gap-1 p-3 transition-[width] duration-150",n?"w-14 items-center":"w-52"),children:[m.jsxs("div",{className:Ie("flex items-center py-2",n?"justify-center":"gap-2 px-2"),children:[m.jsx(Pne,{className:"size-4 shrink-0 text-fg-1"}),!n&&m.jsx("span",{className:"text-body-sm font-semibold tracking-tight text-fg-1",children:"workerdeck"})]}),m.jsx("nav",{className:Ie("mt-1 flex flex-1 flex-col gap-0.5",n&&"items-center"),children:jne.map(a=>{const l=t.startsWith(a.path);return m.jsxs(Wc,{to:a.path,title:n?a.label:void 0,"aria-label":a.label,className:Ie("flex items-center rounded-md text-body-sm transition-colors outline-none",n?"justify-center p-2":"gap-2 px-2 py-1.5",l?"bg-surface font-medium text-fg-1 shadow-(--shadow-xs)":"text-fg-3 hover:bg-surface-hover hover:text-fg-1"),children:[m.jsx(a.icon,{className:"size-4 shrink-0"}),!n&&a.label]},a.id)})}),m.jsxs("div",{className:Ie("flex items-center",n?"flex-col gap-1":"justify-between px-1"),children:[!n&&m.jsxs("span",{className:"font-mono text-label text-fg-4",children:["v",Dne]}),m.jsx(m6,{}),m.jsx("button",{type:"button",onClick:i,title:n?"Expand sidebar":"Collapse sidebar","aria-label":n?"Expand sidebar":"Collapse sidebar",className:"flex size-7 items-center justify-center rounded-md text-fg-3 transition-colors outline-none hover:bg-surface-hover hover:text-fg-1",children:n?m.jsx(gA,{className:"size-4"}):m.jsx(mA,{className:"size-4"})})]})]}),m.jsx("main",{className:"frame-shine m-2 ml-0 flex min-w-0 flex-1 flex-col overflow-hidden rounded-xl",children:e??m.jsx(i3,{})})]})}const g6=[{value:"default",displayName:"Default (recommended)",description:"The CLI's configured default model"},{value:"fable",displayName:"Fable",description:"Fable 5 · Most capable for your hardest and longest-running tasks"},{value:"opus",displayName:"Opus",description:"Opus 5 with 1M context · Best for everyday, complex tasks"},{value:"sonnet",displayName:"Sonnet",description:"Sonnet 5 · Efficient for routine tasks"},{value:"haiku",displayName:"Haiku",description:"Haiku 4.5 · Fastest for quick answers"}],E1={session:"workerdeck.default-session-model",job:"workerdeck.default-job-model"};function Ty(e){return localStorage.getItem(E1[e])??""}function Hne(e,t){const n=t.trim();n?localStorage.setItem(E1[e],n):localStorage.removeItem(E1[e])}const b6={session:"workerdeck.default-session-permission-mode",job:"workerdeck.default-job-permission-mode"},Une={session:"default",job:"acceptEdits"};function Sy(e){const t=localStorage.getItem(b6[e]);return Vh.some(r=>r.value===t)?t:Une[e]}function zne(e,t){localStorage.setItem(b6[e],t)}function Cy({value:e,onChange:t,models:n=g6,className:r}){return m.jsx(l_,{variant:"form",models:n,model:e||void 0,onModelChange:i=>t(i??""),className:r})}function x6({profiles:e,value:t,onChange:n,className:r}){return e.length===0?null:m.jsxs("label",{className:"flex min-w-0 flex-col gap-1",children:[m.jsx("span",{className:"text-label font-medium text-fg-3",children:"Profile"}),m.jsxs(uo,{items:e.map(i=>({value:i.name,label:i.name})),value:t,onValueChange:i=>n(i),children:[m.jsx(fo,{className:r,children:m.jsx(co,{})}),m.jsx(ho,{children:e.map(i=>m.jsx(aa,{value:i.name,children:m.jsx(ia,{children:m.jsxs("span",{className:i.available===!1?"text-fg-4":void 0,title:i.unavailableReason,children:[i.description?`${i.name} — ${i.description}`:i.name,i.available===!1?" (unavailable)":""]})})},i.name))})]})]})}const tr=new Nz({baseUrl:`${location.origin}/v1`});function y6(e,t,n){const r=e?.capabilities??nd[e?.engine??"claude"],i=r.permissionModes.includes(t)?t:r.defaultPermissionMode;let a,l;if(e?.models?.length)a=e.models,l=e.defaultModel;else if(e?.engine==="provider"){const f=e.provider;a=(f?.models?.length?f.models:f?.model?[f.model]:[]).map(h=>({value:h,displayName:h})),l=f?.model}else a=g6.filter(f=>f.value!=="default");const c=a.find(f=>f.value===n||f.resolvedModel===n),d=c||n===""?n:"";return{capabilities:r,modes:r.permissionModes,models:[{value:"default",displayName:"Profile default",description:l??"the profile's configured model"},...a],mode:i,model:d,reasoningEfforts:(c?c.reasoningEfforts:void 0)??r.reasoningEfforts??[]}}function Fne(e=15e3){const[t,n]=E.useState([]),[r,i]=E.useState(),[a,l]=E.useState(!0),[c,d]=E.useState(!1),[f,g]=E.useState(),h=E.useRef(void 0),b=E.useCallback(async()=>{try{const[v,w]=await Promise.all([tr.listJobs(),tr.queueStats()]);n(v),i(w),l(!0),g(void 0)}catch(v){const w=v instanceof Error?v.message:String(v);/not configured/i.test(w)?(l(!1),g(void 0)):g(w)}},[]);E.useEffect(()=>(b(),h.current=setInterval(()=>void b(),e),()=>clearInterval(h.current)),[b,e]);const x=a&&r!==void 0;return E.useEffect(()=>{if(!x)return;const v=tr.attachQueue(),w=[v.on("attached",()=>void b()),v.on("stats",i),v.on("connectionChange",d),v.on("event",k=>{n(C=>C.some(A=>A.id===k.job.id)?C.map(A=>A.id===k.job.id?k.job:A):[...C,k.job])})];return()=>{for(const k of w)k();v.detach()}},[x,b]),{jobs:t,stats:r,enabled:a,live:c,error:f,refresh:b}}const E6={profiles:[]};let v1,gb;const T1=new Set;async function yw(){const e=await tr.listProfiles().catch(()=>E6);v1=e;for(const t of T1)t(e);return e}function v6(){const[e,t]=E.useState(v1??E6);E.useEffect(()=>(T1.add(t),v1||(gb??=yw()),()=>{T1.delete(t)}),[]);const n=E.useCallback(async()=>{gb=yw(),await gb},[]);return{...e,refresh:n}}function $ne(){return v6().profiles}const Ew="workerdeck.last-profile";function T6(){const e=$ne(),[t,n]=E.useState(()=>localStorage.getItem(Ew)??""),r=e.some(l=>l.name===t)?t:e[0]?.name??"",i=e.find(l=>l.name===r);return{profiles:e,profile:r,selected:i,select:l=>{n(l),localStorage.setItem(Ew,l)}}}function S6(e=5e3){const[t,n]=E.useState([]),[r,i]=E.useState(),a=E.useRef(void 0),l=E.useCallback(async()=>{try{n(await tr.listSessions()),i(void 0)}catch(c){i(c instanceof Error?c.message:String(c))}},[]);return E.useEffect(()=>(l(),a.current=setInterval(()=>void l(),e),()=>clearInterval(a.current)),[l,e]),{sessions:t,error:r,refresh:l}}const vw="workerdeck.last-cwd",Vne={queued:{label:"Queued",variant:"neutral"},running:{label:"Running",variant:"info",busy:!0},parked:{label:"Parked",variant:"accent"},succeeded:{label:"Succeeded",variant:"success"},failed:{label:"Failed",variant:"danger"},canceled:{label:"Canceled",variant:"warning"}};function qne({stats:e}){const t=e.dailyTokenLimit!==void 0&&e.dailyTokenLimit>0?e.dailyTokensUsed/e.dailyTokenLimit*100:void 0;return m.jsxs("div",{className:"flex flex-wrap items-center gap-x-5 gap-y-2 rounded-md border border-border bg-surface px-3 py-2 text-body-sm text-fg-2",children:[m.jsxs("span",{children:["Running ",m.jsxs("span",{className:"font-mono text-fg-1",children:[e.running,"/",e.maxConcurrency]})]}),m.jsxs("span",{children:["Queued ",m.jsx("span",{className:"font-mono text-fg-1",children:e.queued})]}),e.parked>0?m.jsxs("span",{children:["Parked ",m.jsx("span",{className:"font-mono text-fg-1",children:e.parked})]}):null,m.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[t!==void 0?m.jsx(HA,{value:t,className:t>=95?"text-danger":t>=80?"text-warning":"text-fg-3"}):null,"Daily tokens"," ",m.jsxs("span",{className:"font-mono text-fg-1",children:[fs(e.dailyTokensUsed),e.dailyTokenLimit!==void 0?` / ${fs(e.dailyTokenLimit)}`:""]})]}),e.sessionTokenLimit!==void 0?m.jsxs("span",{children:["Per-job cap ",m.jsx("span",{className:"font-mono text-fg-1",children:fs(e.sessionTokenLimit)})]}):null,e.paused?m.jsx(gn,{variant:"warning",dot:!0,children:"Paused — daily budget exhausted"}):null]})}function Yne({onScheduled:e}){const[t,n]=E.useState(()=>localStorage.getItem(vw)??""),[r,i]=E.useState(""),[a,l]=E.useState(()=>Sy("job")),[c,d]=E.useState("auto"),[f,g]=E.useState(()=>Ty("job")),[h,b]=E.useState(""),{profiles:x,profile:v,selected:w,select:k}=T6(),C=y6(w,a,f),[N,A]=E.useState(!1),[R,M]=E.useState(""),[_,D]=E.useState(""),[I,U]=E.useState(""),[j,X]=E.useState(!1),K=async()=>{if(!t.trim()||!r.trim()){Hn.error("Working directory and prompt are required");return}const F=R.trim()?Number(R.trim()):void 0;if(F!==void 0&&(!Number.isFinite(F)||F<=0)){Hn.error("Max tokens must be a positive number");return}const W=_.trim()?Number(_.trim()):void 0;if(W!==void 0&&(!Number.isInteger(W)||W<1)){Hn.error("Attempts must be a whole number of at least 1");return}X(!0);try{localStorage.setItem(vw,t.trim()),await tr.createJob({session:{cwd:t.trim(),profile:v||void 0,prompt:r.trim(),permissionMode:C.mode,questionBehavior:C.capabilities.interactiveApprovals?c:void 0,model:C.model.trim()||void 0,reasoningEffort:h&&C.reasoningEfforts.includes(h)?h:void 0,...C.capabilities.settingSources?{settingSources:["user","project"],allowDangerouslySkipPermissions:N||void 0}:{}},maxTokens:F,attempts:W,webhook:I.trim()?{url:I.trim()}:void 0}),i(""),Hn.success("Job scheduled"),e()}catch(V){Hn.error(V instanceof Error?V.message:"Failed to schedule job")}finally{X(!1)}};return m.jsxs(Os,{children:[m.jsx(Is,{children:m.jsx(Ms,{children:"Schedule a job"})}),m.jsxs(Ls,{className:"flex flex-col gap-3",children:[m.jsxs("label",{className:"flex flex-col gap-1",children:[m.jsx("span",{className:"text-label font-medium text-fg-3",children:"Working directory"}),m.jsx(un,{value:t,onChange:F=>n(F.target.value),placeholder:"/path/to/project",spellCheck:!1,className:"font-mono"})]}),m.jsxs("label",{className:"flex flex-col gap-1",children:[m.jsx("span",{className:"text-label font-medium text-fg-3",children:"Prompt (the task — runs unattended)"}),m.jsx(O1,{value:r,onChange:F=>i(F.target.value),rows:2,placeholder:"e.g. /verify-content 42, or a task description"})]}),m.jsxs("div",{className:"flex flex-wrap items-end gap-3",children:[m.jsx(x6,{profiles:x,value:v,onChange:k,className:"min-w-32"}),m.jsxs("label",{className:"flex min-w-0 flex-col gap-1",children:[m.jsx("span",{className:"text-label font-medium text-fg-3",children:"Permission mode"}),m.jsx(rd,{variant:"form",mode:C.mode,onModeChange:l,modes:C.modes,className:"min-w-44"})]}),C.capabilities.interactiveApprovals?m.jsxs("label",{className:"flex min-w-0 flex-col gap-1",children:[m.jsx("span",{className:"text-label font-medium text-fg-3",children:"Questions"}),m.jsxs(uo,{items:xC.map(F=>({value:F.value,label:F.label})),value:c,onValueChange:F=>d(F),children:[m.jsx(fo,{className:"min-w-36",children:m.jsx(co,{})}),m.jsx(ho,{children:xC.map(F=>m.jsx(aa,{value:F.value,children:m.jsx(ia,{children:`${F.label} — ${F.description}`})},F.value))})]})]}):null,m.jsxs("label",{className:"flex min-w-0 flex-col gap-1",children:[m.jsx("span",{className:"text-label font-medium text-fg-3",children:"Model"}),m.jsx(Cy,{value:C.model,onChange:g,models:C.models,className:"min-w-40"})]}),C.reasoningEfforts.length>0?m.jsxs("label",{className:"flex min-w-0 flex-col gap-1",children:[m.jsx("span",{className:"text-label font-medium text-fg-3",children:"Effort"}),m.jsxs(uo,{items:[{value:"default",label:"Default"},...C.reasoningEfforts.map(F=>({value:F,label:F}))],value:h||"default",onValueChange:F=>b(F==="default"?"":String(F)),children:[m.jsx(fo,{className:"min-w-28",children:m.jsx(co,{})}),m.jsx(ho,{children:["default",...C.reasoningEfforts].map(F=>m.jsx(aa,{value:F,children:m.jsx(ia,{children:F})},F))})]})]}):null,m.jsxs("label",{className:"flex min-w-0 flex-col gap-1",children:[m.jsx("span",{className:"text-label font-medium text-fg-3",children:"Max tokens (optional)"}),m.jsx(un,{value:R,onChange:F=>M(F.target.value),placeholder:"per-job cap",inputMode:"numeric",className:"min-w-28 font-mono"})]}),m.jsxs("label",{className:"flex min-w-0 flex-col gap-1",children:[m.jsx("span",{className:"text-label font-medium text-fg-3",children:"Attempts (optional)"}),m.jsx(un,{value:_,onChange:F=>D(F.target.value),placeholder:"1",inputMode:"numeric",className:"min-w-20 font-mono"})]}),m.jsxs("label",{className:"flex min-w-0 flex-1 flex-col gap-1",children:[m.jsx("span",{className:"text-label font-medium text-fg-3",children:"Webhook URL (optional)"}),m.jsx(un,{value:I,onChange:F=>U(F.target.value),placeholder:"https://…/hook",spellCheck:!1,className:"min-w-44 font-mono"})]}),m.jsxs(at,{onClick:()=>void K(),disabled:j,children:[j?m.jsx(wn,{className:"size-3.5 text-current"}):m.jsx(Ax,{className:"size-4"}),"Schedule"]})]}),C.capabilities.settingSources?m.jsxs("label",{className:"flex w-fit cursor-pointer items-center gap-2 text-body-sm text-fg-2",title:"Spawns the CLI with --dangerously-skip-permissions available, so the mode can be switched on while watching the run. The job still starts in the mode selected above.",children:[m.jsx("input",{type:"checkbox",checked:N,onChange:F=>A(F.target.checked),className:"size-3.5 accent-(--color-fg-1)"}),"Allow switching to ",m.jsx("code",{className:"font-mono",children:"bypassPermissions"})," mid-run",m.jsx("span",{className:"text-label text-fg-4",children:"(dangerous)"})]}):null,m.jsxs("p",{className:"text-label text-fg-4",children:["Unattended runs still surface permission prompts — watch the job's session to approve, or pick a mode that doesn't ask. Unanswered prompts deny after the server's timeout. With Questions set to Ask, webhook deliveries carry the full question so a controller can answer via"," ",m.jsx("code",{className:"font-mono",children:"POST /sessions/:id/permissions/:requestId"}),"."]})]})]})}function Gne({job:e,watchable:t,onChanged:n}){const r=zl(),i=Vne[e.status],a=e.status==="queued"||e.status==="running"||e.status==="parked",l=async()=>{try{await tr.cancelJob(e.id),n()}catch(c){Hn.error(c instanceof Error?c.message:"Cancel failed")}};return m.jsxs("li",{className:"flex items-center gap-3 rounded-md px-2 py-2 hover:bg-surface-hover",children:[m.jsxs(gn,{variant:i.variant,dot:!i.busy,children:[i.busy?m.jsx(wn,{className:"size-3 text-current"}):null,i.label]}),m.jsxs("div",{className:"min-w-0 flex-1",children:[m.jsx("div",{className:"truncate text-body-sm text-fg-1",children:e.prompt}),m.jsxs("div",{className:"flex flex-wrap gap-x-3 font-mono text-label text-fg-4",children:[m.jsx("span",{className:"truncate",children:e.cwd}),e.profile?m.jsxs("span",{className:"shrink-0",children:["@",e.profile]}):null,m.jsx("span",{className:"shrink-0",children:Mp(e.finishedAt??e.startedAt??e.createdAt)}),e.maxAttempts!==void 0&&e.maxAttempts>1?m.jsxs("span",{className:"shrink-0",children:["attempt ",e.attempt??1,"/",e.maxAttempts,e.status==="queued"&&e.nextRunAt!==void 0&&e.nextRunAt>Date.now()?" — retry pending":""]}):null,e.usage.tokens>0?m.jsxs("span",{className:"shrink-0",children:[fs(e.usage.tokens)," tok"]}):null,e.usage.totalCostUsd>0?m.jsx("span",{className:"shrink-0",children:Wl(e.usage.totalCostUsd)}):null,e.error?m.jsx("span",{className:"truncate text-danger",children:e.error}):null]})]}),e.sessionId&&t?m.jsxs(at,{variant:"ghost",size:"xs",onClick:()=>void r({to:"/sessions/$sessionId",params:{sessionId:e.sessionId}}),children:[m.jsx(uA,{className:"size-3"}),"Watch"]}):null,a?m.jsxs(at,{variant:"outline",size:"xs",onClick:()=>void l(),children:[m.jsx(mi,{className:"size-3"}),"Cancel"]}):null]})}function Xne(){const{jobs:e,stats:t,enabled:n,live:r,error:i,refresh:a}=Fne(),{sessions:l}=S6(),c=new Set(l.map(f=>f.id)),d=[...e].sort((f,g)=>g.createdAt-f.createdAt);return m.jsx("div",{className:"flex-1 overflow-y-auto",children:m.jsxs("div",{className:"mx-auto flex w-full max-w-3xl flex-col gap-5 px-6 py-6",children:[m.jsxs("header",{className:"flex items-end justify-between",children:[m.jsxs("div",{children:[m.jsx("h1",{className:"text-display-sm font-semibold tracking-tight text-text",children:"Jobs"}),m.jsx("p",{className:"mt-0.5 text-body-sm text-muted-foreground",children:"Scheduled one-shot runs with concurrency and token budgets."})]}),m.jsxs("div",{className:"flex items-center gap-2",children:[n?m.jsx(gn,{variant:r?"success":"neutral",dot:!0,children:r?"Live":"Polling"}):null,m.jsx(at,{variant:"ghost",size:"icon-sm","aria-label":"Refresh",onClick:()=>void a(),children:m.jsx(Np,{className:"size-4"})})]})]}),i?m.jsxs("div",{className:"rounded-md bg-danger-bg px-3 py-2 text-body-sm text-danger",children:["Can't reach the worker server: ",i,". Start it with"," ",m.jsx("code",{className:"font-mono",children:"pnpm server"}),"."]}):null,n?m.jsxs(m.Fragment,{children:[t?m.jsx(qne,{stats:t}):null,d.length===0?m.jsxs("div",{className:"flex flex-col items-center gap-2 rounded-md border border-border bg-surface px-4 py-8 text-center",children:[m.jsx(hA,{className:"size-6 text-fg-4"}),m.jsx("p",{className:"text-body-sm text-fg-2",children:"No jobs yet. Schedule one below."})]}):m.jsx("ul",{className:"flex flex-col gap-1 rounded-md border border-border bg-surface p-1",children:d.map(f=>m.jsx(Gne,{job:f,watchable:f.sessionId!==void 0&&c.has(f.sessionId),onChanged:()=>void a()},f.id))}),m.jsx(Yne,{onScheduled:()=>void a()})]}):m.jsxs("div",{className:"flex flex-col items-center gap-2 rounded-md border border-border bg-surface px-4 py-8 text-center",children:[m.jsx(r9,{className:"size-6 text-fg-4"}),m.jsx("p",{className:"text-body-sm text-fg-2",children:"The server has no job queue configured."}),m.jsxs("p",{className:"text-label text-fg-4",children:["Pass ",m.jsxs("code",{className:"font-mono",children:["queue: ","{ maxConcurrency, … }"]})," to"," ",m.jsx("code",{className:"font-mono",children:"createWorkerServer"})," — the dev server enables it by default."]})]})]})})}const Kne=["web_search","download","web_fetch","deliver_file"],ih=e=>e.split(",").map(t=>t.trim()).filter(Boolean);function Gi({label:e,children:t}){return m.jsxs("label",{className:"flex min-w-0 flex-1 flex-col gap-1",children:[m.jsx("span",{className:"text-label font-medium text-fg-3",children:e}),t]})}function Qne({profile:e,onSaved:t}){const n=e.engine==="provider",[r,i]=E.useState(e.description??""),[a,l]=E.useState(e.defaults?.model??""),[c,d]=E.useState(e.defaults?.permissionMode),[f,g]=E.useState(e.provider?.model??""),[h,b]=E.useState((e.provider?.models??[]).join(", ")),[x,v]=E.useState(e.session?.capabilities),[w,k]=E.useState((e.session?.mcpServers??[]).join(", ")),[C,N]=E.useState(e.session?.instructions??""),[A,R]=E.useState(!1),M=async()=>{const _={description:r.trim()||void 0,defaults:{model:a.trim()||void 0,permissionMode:c}};n&&(_.provider={...e.provider,id:e.provider?.id??"",model:f.trim()||void 0,models:ih(h).length>0?ih(h):void 0},_.session={capabilities:x,mcpServers:ih(w).length>0?ih(w):void 0,instructions:C.trim()||void 0}),R(!0);try{t(await tr.updateProfile(e.name,_)),Hn.success("Profile saved")}catch(D){Hn.error(D instanceof Error?D.message:"Failed to save profile")}finally{R(!1)}};return m.jsxs(Os,{children:[m.jsx(Is,{children:m.jsx(Ms,{children:"Edit profile"})}),m.jsxs(Ls,{className:"flex flex-col gap-3",children:[m.jsx(Gi,{label:"Description",children:m.jsx(un,{value:r,onChange:_=>i(_.target.value)})}),m.jsxs("div",{className:"flex flex-wrap items-end gap-3",children:[m.jsx(Gi,{label:"Default model",children:m.jsx(un,{value:a,onChange:_=>l(_.target.value),placeholder:"unset — request / engine default",className:"font-mono"})}),m.jsx(Gi,{label:"Default permission mode",children:m.jsx(rd,{variant:"form",mode:c,onModeChange:d,modes:(e.capabilities??nd[e.engine??"claude"]).permissionModes})})]}),n?m.jsxs(m.Fragment,{children:[m.jsxs("div",{className:"flex flex-wrap items-end gap-3",children:[m.jsx(Gi,{label:"Default model id",children:m.jsx(un,{value:f,onChange:_=>g(_.target.value),className:"font-mono"})}),m.jsx(Gi,{label:"Models offered (comma-separated)",children:m.jsx(un,{value:h,onChange:_=>b(_.target.value),className:"font-mono"})})]}),m.jsx(Gi,{label:"Capabilities granted",children:m.jsxs("div",{className:"flex flex-wrap items-center gap-3 py-1.5",children:[m.jsxs("label",{className:"flex cursor-pointer items-center gap-1.5 text-body-sm text-fg-2",children:[m.jsx("input",{type:"checkbox",checked:x===void 0,onChange:_=>v(_.target.checked?void 0:[]),className:"size-3.5 accent-(--color-fg-1)"}),"not declared"]}),Kne.map(_=>m.jsxs("label",{className:"flex cursor-pointer items-center gap-1.5 text-body-sm text-fg-2",children:[m.jsx("input",{type:"checkbox",disabled:x===void 0,checked:x?.includes(_)??!1,onChange:D=>v(I=>D.target.checked?[...I??[],_]:(I??[]).filter(U=>U!==_)),className:"size-3.5 accent-(--color-fg-1) disabled:opacity-40"}),m.jsx("code",{className:"font-mono text-label",children:_})]},_))]})}),m.jsxs("div",{className:"flex flex-wrap items-end gap-3",children:[m.jsx(Gi,{label:"MCP servers (names, comma-separated)",children:m.jsx(un,{value:w,onChange:_=>k(_.target.value),className:"font-mono"})}),m.jsx(Gi,{label:"Instructions",children:m.jsx(un,{value:C,onChange:_=>N(_.target.value)})})]})]}):null,m.jsxs("div",{className:"flex items-center justify-between gap-3",children:[m.jsx("p",{className:"text-label text-fg-4",children:"Name and engine are fixed — sessions and jobs are pinned to the name, and the engine decides what the rest of these fields mean."}),m.jsxs(at,{onClick:()=>void M(),disabled:A,children:[A?m.jsx(wn,{className:"size-3.5 text-current"}):m.jsx(k7,{className:"size-4"}),"Save"]})]})]})]})}const Wne=["web_search","download","web_fetch","deliver_file"],ah=e=>e.split(",").map(t=>t.trim()).filter(Boolean);function cs({label:e,children:t}){return m.jsxs("label",{className:"flex min-w-0 flex-1 flex-col gap-1",children:[m.jsx("span",{className:"text-label font-medium text-fg-3",children:e}),t]})}function Zne({onCreated:e}){const[t,n]=E.useState("provider"),[r,i]=E.useState(""),[a,l]=E.useState(""),[c,d]=E.useState(""),[f,g]=E.useState(""),[h,b]=E.useState(""),[x,v]=E.useState(""),[w,k]=E.useState(""),[C,N]=E.useState([]),[A,R]=E.useState(""),[M,_]=E.useState(""),[D,I]=E.useState(!1),U=t==="provider",j=async()=>{if(!r.trim()){Hn.error("Name is required");return}const X={name:r.trim(),engine:t};if(a.trim()&&(X.description=a.trim()),U){X.provider={id:c.trim(),model:f.trim()||void 0,models:ah(h).length>0?ah(h):void 0,apiKeyEnv:x.trim()||void 0};const K={};C.length>0&&(K.capabilities=C),ah(A).length>0&&(K.mcpServers=ah(A)),M.trim()&&(K.instructions=M.trim()),Object.keys(K).length>0&&(X.session=K)}else X.configDir=w.trim();I(!0);try{await tr.createProfile(X),await e(),i(""),l(""),_(""),Hn.success(`Profile '${X.name}' created`)}catch(K){Hn.error(K instanceof Error?K.message:"Failed to create profile")}finally{I(!1)}};return m.jsxs(Os,{children:[m.jsx(Is,{children:m.jsx(Ms,{children:"New profile"})}),m.jsxs(Ls,{className:"flex flex-col gap-3",children:[m.jsxs("div",{className:"flex flex-wrap items-end gap-3",children:[m.jsx(cs,{label:"Engine",children:m.jsxs(uo,{items:[{value:"provider",label:"provider"},{value:"claude",label:"claude"}],value:t,onValueChange:X=>n(X),children:[m.jsx(fo,{className:"min-w-32",children:m.jsx(co,{})}),m.jsxs(ho,{children:[m.jsx(aa,{value:"provider",children:m.jsx(ia,{children:"provider — model-agnostic engine"})}),m.jsx(aa,{value:"claude",children:m.jsx(ia,{children:"claude — Agent SDK + config dir"})})]})]})}),m.jsx(cs,{label:"Name",children:m.jsx(un,{value:r,onChange:X=>i(X.target.value),placeholder:"kimi"})}),m.jsx(cs,{label:"Description (optional)",children:m.jsx(un,{value:a,onChange:X=>l(X.target.value),placeholder:"what this profile is for"})})]}),U?m.jsxs(m.Fragment,{children:[m.jsxs("div",{className:"flex flex-wrap items-end gap-3",children:[m.jsx(cs,{label:"Provider id",children:m.jsx(un,{value:c,onChange:X=>d(X.target.value),placeholder:"anthropic / openai / moonshotai",className:"font-mono"})}),m.jsx(cs,{label:"Default model",children:m.jsx(un,{value:f,onChange:X=>g(X.target.value),placeholder:"kimi-k3",className:"font-mono"})}),m.jsx(cs,{label:"Models offered (comma-separated)",children:m.jsx(un,{value:h,onChange:X=>b(X.target.value),placeholder:"kimi-k3, kimi-k2",className:"font-mono"})}),m.jsx(cs,{label:"API key variable",children:m.jsx(un,{value:x,onChange:X=>v(X.target.value),placeholder:"MOONSHOT_API_KEY",className:"font-mono"})})]}),m.jsxs("div",{className:"flex flex-wrap items-end gap-3",children:[m.jsx(cs,{label:"Capabilities granted",children:m.jsx("div",{className:"flex flex-wrap gap-3 py-1.5",children:Wne.map(X=>m.jsxs("label",{className:"flex cursor-pointer items-center gap-1.5 text-body-sm text-fg-2",children:[m.jsx("input",{type:"checkbox",checked:C.includes(X),onChange:K=>N(F=>K.target.checked?[...F,X]:F.filter(W=>W!==X)),className:"size-3.5 accent-(--color-fg-1)"}),m.jsx("code",{className:"font-mono text-label",children:X})]},X))})}),m.jsx(cs,{label:"MCP servers (names, comma-separated)",children:m.jsx(un,{value:A,onChange:X=>R(X.target.value),placeholder:"deepwiki",className:"font-mono"})})]}),m.jsx(cs,{label:"Instructions (optional)",children:m.jsx(un,{value:M,onChange:X=>_(X.target.value),placeholder:"prepended to the session's system prompt"})}),m.jsx("p",{className:"text-label text-fg-4",children:"Leave capabilities and MCP servers empty to inherit whatever the server's engine factory wired — that factory is the ceiling either way, so a grant here can never exceed it. MCP servers are named, never configured: their transport config (and any credentials in it) stays on the server."})]}):m.jsxs(m.Fragment,{children:[m.jsx(cs,{label:"Config directory",children:m.jsx(un,{value:w,onChange:X=>k(X.target.value),placeholder:"/Users/you/.claude",spellCheck:!1,className:"font-mono"})}),m.jsxs("p",{className:"text-label text-fg-4",children:["Must resolve inside the server's"," ",m.jsx("code",{className:"font-mono",children:"allowedConfigDirRoots"})," — a config directory is a credential store, so the server bounds which ones a managed profile may point at."]})]}),m.jsx("div",{className:"flex justify-end",children:m.jsxs(at,{onClick:()=>void j(),disabled:D,children:[D?m.jsx(wn,{className:"size-3.5 text-current"}):m.jsx(Ax,{className:"size-4"}),"Create profile"]})})]})]})}function C6(e){window.location.href=`vscode://file${e}`}function Jne(){const{profiles:e,canManage:t,refresh:n}=v6(),r=zl(),i=a=>{tr.deleteProfile(a).then(()=>n()).then(()=>Hn.success(`Profile '${a}' deleted`)).catch(l=>Hn.error(l instanceof Error?l.message:"Delete failed"))};return m.jsx("div",{className:"flex-1 overflow-y-auto",children:m.jsxs("div",{className:"mx-auto flex w-full max-w-3xl flex-col gap-5 px-6 py-6",children:[m.jsxs("header",{children:[m.jsx("h1",{className:"text-display-sm font-semibold tracking-tight text-text",children:"Profiles"}),m.jsx("p",{className:"mt-0.5 text-body-sm text-muted-foreground",children:"What a session runs as: a named Claude Code config directory — its own settings, memory, skills, and credentials — or a model provider for the model-agnostic engine."})]}),e.length===0?m.jsxs("div",{className:"flex flex-col items-center gap-2 rounded-md border border-border bg-surface px-4 py-8 text-center",children:[m.jsx(I9,{className:"size-6 text-fg-4"}),m.jsx("p",{className:"text-body-sm text-fg-2",children:"The server declares no profiles."}),m.jsxs("p",{className:"text-label text-fg-4",children:["Pass ",m.jsxs("code",{className:"font-mono",children:["profiles: [","{ name, configDir, … }","]"]})," to"," ",m.jsx("code",{className:"font-mono",children:"createWorkerServer"})," — without the option, a"," ",m.jsx("code",{className:"font-mono",children:"default"})," profile is auto-created from"," ",m.jsx("code",{className:"font-mono",children:"~/.claude"})," when it exists."]})]}):m.jsx("ul",{className:"divide-y divide-border rounded-md border border-border bg-surface",children:e.map(a=>m.jsxs("li",{className:"flex items-center gap-3 px-3 py-2.5",children:[m.jsx(X7,{className:"size-4 shrink-0 text-fg-3"}),m.jsxs("div",{className:"min-w-0 flex-1",children:[m.jsxs("div",{className:"flex items-center gap-2",children:[m.jsx("span",{className:"truncate text-body-sm font-medium text-fg-1",children:a.name}),a.description?m.jsx("span",{className:"truncate text-body-sm text-fg-3",children:a.description}):null]}),m.jsx("div",{className:"mt-0.5 truncate font-mono text-label text-fg-4",children:a.configDir??(a.provider?`${a.provider.id}${a.provider.model?` · ${a.provider.model}`:""}`:"")})]}),m.jsxs("div",{className:"flex shrink-0 items-center gap-1.5",children:[m.jsx(gn,{variant:"neutral",children:a.engine??"claude"}),a.defaults?.model?m.jsx(gn,{variant:"neutral",children:a.defaults.model}):null,a.defaults?.permissionMode?m.jsx(gn,{variant:"neutral",children:a.defaults.permissionMode}):null,a.configDir?m.jsx(at,{variant:"ghost",size:"icon-sm","aria-label":`Open ${a.name} in VSCode`,title:"Open config dir in VSCode",onClick:()=>C6(a.configDir),children:m.jsx(wx,{className:"size-4"})}):null,m.jsx(at,{variant:"ghost",size:"icon-sm","aria-label":`View ${a.name}`,title:"View profile",onClick:()=>void r({to:"/profiles/$profileName",params:{profileName:a.name}}),children:m.jsx(uA,{className:"size-4"})}),a.managed?m.jsx(at,{variant:"ghost",size:"icon-sm","aria-label":`Delete ${a.name}`,title:"Delete profile",onClick:()=>i(a.name),children:m.jsx(Ox,{className:"size-4"})}):null]})]},a.name))}),t?m.jsx(Zne,{onCreated:n}):null,m.jsxs("p",{className:"text-label text-fg-4",children:["Session and job creates run under the selected profile; when the server declares more than one, picking a profile is required."," ",t?"Profiles created here are stored by the server; the ones declared in its options are code and stay read-only.":"Profiles are declared in server configuration and read-only here."]})]})})}function In({label:e,children:t}){return m.jsxs("div",{className:"flex items-baseline justify-between gap-4 py-1.5",children:[m.jsx("span",{className:"shrink-0 text-label font-medium text-fg-3",children:e}),m.jsx("span",{className:"min-w-0 text-right text-body-sm text-fg-1",children:t})]})}function Xi({items:e,empty:t}){return e.length===0?m.jsx("span",{className:"text-fg-4",children:t}):m.jsx("span",{className:"flex flex-wrap justify-end gap-1",children:e.map(n=>m.jsx(gn,{variant:"neutral",children:n},n))})}function ere(){const{profileName:e}=ip({from:"/profiles/$profileName"}),[t,n]=E.useState(),[r,i]=E.useState();E.useEffect(()=>{let c=!0;return tr.getProfile(e).then(d=>{c&&n(d)}).catch(d=>{c&&i(d instanceof Error?d.message:"Failed to load profile")}),()=>{c=!1}},[e]);const a=t?.profile,l=t?.config;return m.jsx("div",{className:"flex-1 overflow-y-auto",children:m.jsxs("div",{className:"mx-auto flex w-full max-w-3xl flex-col gap-5 px-6 py-6",children:[m.jsxs("header",{className:"flex items-end justify-between gap-3",children:[m.jsxs("div",{className:"min-w-0",children:[m.jsxs(Wc,{to:"/profiles",className:"mb-1 inline-flex items-center gap-1 text-label text-fg-3 hover:text-fg-1",children:[m.jsx(iA,{className:"size-3"}),"Profiles"]}),m.jsx("h1",{className:"truncate text-display-sm font-semibold tracking-tight text-text",children:e}),a?.description?m.jsx("p",{className:"mt-0.5 text-body-sm text-muted-foreground",children:a.description}):null]}),a?.configDir?m.jsxs(at,{variant:"outline",size:"xs",onClick:()=>C6(a.configDir),children:[m.jsx(wx,{className:"size-3"}),"Open in VSCode"]}):null]}),r?m.jsx("div",{className:"rounded-md bg-danger-bg px-3 py-2 text-body-sm text-danger",children:r}):null,!t&&!r?m.jsx(wn,{className:"mx-auto size-5 text-fg-4"}):null,a&&l?m.jsxs(m.Fragment,{children:[m.jsxs(Os,{children:[m.jsx(Is,{children:m.jsx(Ms,{children:"Worker defaults"})}),m.jsxs(Ls,{className:"flex flex-col divide-y divide-border",children:[m.jsx(In,{label:"Engine",children:m.jsx(gn,{variant:"neutral",children:a.engine??"claude"})}),a.engine==="provider"?m.jsx(In,{label:"Provider",children:m.jsx("span",{className:"font-mono text-label",children:a.provider?.id})}):m.jsx(In,{label:"Config directory",children:m.jsx("span",{className:"font-mono text-label",children:a.configDir})}),m.jsx(In,{label:"Default model",children:a.defaults?.model??a.provider?.model??m.jsx("span",{className:"text-fg-4",children:"request / engine default"})}),m.jsx(In,{label:"Default permission mode",children:a.defaults?.permissionMode??m.jsx("span",{className:"text-fg-4",children:"request / engine default"})}),a.engine==="provider"?m.jsxs(m.Fragment,{children:[m.jsx(In,{label:"Models offered",children:m.jsx(Xi,{items:a.provider?.models??[],empty:"the default model only"})}),m.jsx(In,{label:"API key variable",children:a.provider?.apiKeyEnv?m.jsx("span",{className:"font-mono text-label",children:a.provider.apiKeyEnv}):m.jsx("span",{className:"text-fg-4",children:"provider SDK default"})})]}):null]})]}),a.engine==="provider"?m.jsxs(Os,{children:[m.jsx(Is,{children:m.jsx(Ms,{children:"Session grants"})}),m.jsxs(Ls,{className:"flex flex-col divide-y divide-border",children:[m.jsx(In,{label:"Capabilities",children:m.jsx(Xi,{items:a.session?.capabilities??[],empty:"not declared — whatever the server wired"})}),m.jsx(In,{label:"MCP servers",children:m.jsx(Xi,{items:a.session?.mcpServers??[],empty:"not declared — every connected server"})}),m.jsx(In,{label:"Instructions",children:a.session?.instructions?`${a.session.instructions.length} characters`:m.jsx("span",{className:"text-fg-4",children:"none"})})]})]}):null,a.engine==="provider"?null:m.jsxs(Os,{children:[m.jsx(Is,{children:m.jsx(Ms,{children:"Claude Code configuration"})}),m.jsxs(Ls,{className:"flex flex-col divide-y divide-border",children:[l.settings?m.jsxs(m.Fragment,{children:[m.jsx(In,{label:"Model (settings.json)",children:l.settings.model??m.jsx("span",{className:"text-fg-4",children:"not set"})}),m.jsx(In,{label:"Default permission mode",children:l.settings.defaultPermissionMode??m.jsx("span",{className:"text-fg-4",children:"not set"})}),m.jsx(In,{label:"Permission rules",children:m.jsx("span",{className:"font-mono text-label",children:l.settings.permissionRules?`${l.settings.permissionRules.allow} allow · ${l.settings.permissionRules.ask} ask · ${l.settings.permissionRules.deny} deny`:"—"})}),m.jsx(In,{label:"Env vars (names only)",children:m.jsx(Xi,{items:l.settings.envKeys??[],empty:"none"})}),m.jsx(In,{label:"Hooks",children:m.jsx(Xi,{items:l.settings.hooks??[],empty:"none"})})]}):m.jsx(In,{label:"settings.json",children:m.jsx("span",{className:"text-fg-4",children:"not found"})}),m.jsx(In,{label:"User memory (CLAUDE.md)",children:l.hasUserMemory?"present":m.jsx("span",{className:"text-fg-4",children:"none"})}),m.jsx(In,{label:"Skills",children:m.jsx(Xi,{items:l.skills,empty:"none"})}),m.jsx(In,{label:"Agents",children:m.jsx(Xi,{items:l.agents,empty:"none"})}),m.jsx(In,{label:"Commands",children:m.jsx(Xi,{items:l.commands,empty:"none"})})]})]}),a.managed?m.jsx(Qne,{profile:a,onSaved:c=>n({...t,profile:c})}):null,m.jsxs("p",{className:"text-label text-fg-4",children:[a.managed?"Stored on the server and editable here. ":"View only — this profile is declared in the server options. ","Other profile configuration lives on the server (the"," ",m.jsx("code",{className:"font-mono",children:"profiles"})," option; for Claude profiles, the config directory itself, e.g. via VSCode). Provider credentials are resolved from the server's environment and never leave it."]})]}):null]})})}function tre(){const{sessionId:e}=ip({from:"/sessions/$sessionId"}),t=zl(),{info:n,error:r}=n_(tr,e);E.useEffect(()=>{r&&(Hn.error("Session not found"),t({to:"/sessions"}))},[r,t]);const i=async()=>{try{await tr.deleteSession(e)}catch{}t({to:"/sessions"})},a=n?.cwd?.split("/").filter(Boolean).pop();return m.jsx(_ne,{client:tr,sessionId:e,header:({actions:l})=>m.jsxs("div",{className:"flex items-center gap-2 border-b border-border bg-surface px-3 py-2",children:[m.jsx(Wc,{to:"/sessions","aria-label":"Back to sessions",children:m.jsx(at,{variant:"ghost",size:"icon-sm",children:m.jsx(iA,{className:"size-4"})})}),m.jsx("span",{className:"truncate text-body-sm font-medium text-fg-1",children:n?.title??a??e.slice(0,8)}),n?.engine&&n.engine!=="claude"?m.jsx(gn,{variant:"neutral",className:"shrink-0",children:n.engine}):null,n?.cwd?m.jsx("span",{className:"min-w-0 truncate font-mono text-label text-fg-4",title:n.cwd,children:n.cwd}):null,m.jsx("span",{className:"flex-1"}),m.jsx(Px,{value:e,"aria-label":"Copy session id"}),m.jsxs(mB,{children:[m.jsx(gB,{render:m.jsx(at,{variant:"ghost",size:"icon-sm","aria-label":"Close session",children:m.jsx(Ox,{className:"size-4 text-fg-3"})})}),m.jsxs(xB,{children:[m.jsx(yB,{children:"Close this session?"}),m.jsx(EB,{children:"The run is terminated on the server. You can pick it up later from “Resume a previous session” — the transcript is kept by the engine, not by the gateway."}),m.jsxs("div",{className:"mt-4 flex justify-end gap-2",children:[m.jsx(bB,{render:m.jsx(at,{variant:"outline",children:"Cancel"})}),m.jsx(at,{variant:"destructive",onClick:()=>void i(),children:"Close session"})]})]})]}),l]})},e)}const Tw="workerdeck.last-cwd";function nre({onCreated:e}){const[t,n]=E.useState(()=>localStorage.getItem(Tw)??""),[r,i]=E.useState(""),[a,l]=E.useState(()=>Sy("session")),[c,d]=E.useState(()=>Ty("session")),[f,g]=E.useState(""),{profiles:h,profile:b,selected:x,select:v}=T6(),w=y6(x,a,c),[k,C]=E.useState(!1),[N,A]=E.useState(),[R,M]=E.useState(!1),_=async I=>{const U=I?.cwd??t.trim();if(!U){Hn.error("Working directory is required");return}C(!0);try{localStorage.setItem(Tw,t.trim()||U);const j=await tr.createSession({cwd:U,profile:b||void 0,prompt:I?void 0:r.trim()||void 0,permissionMode:w.mode,model:w.model.trim()||void 0,resume:I?.sessionId,reasoningEffort:f&&w.reasoningEfforts.includes(f)?f:void 0,...w.capabilities.settingSources?{settingSources:["user","project"],allowDangerouslySkipPermissions:!0}:{}});e(j.id)}catch(j){Hn.error(j instanceof Error?j.message:"Failed to create session")}finally{C(!1)}},D=async()=>{if(!t.trim()){Hn.error("Set a working directory first — resumable sessions are listed per project");return}M(!0);try{A(await tr.listSdkSessions({dir:t.trim(),limit:20,profile:b||void 0}))}catch(I){Hn.error(I instanceof Error?I.message:"Failed to list resumable sessions")}finally{M(!1)}};return m.jsxs(Os,{children:[m.jsx(Is,{children:m.jsx(Ms,{children:"New session"})}),m.jsxs(Ls,{className:"flex flex-col gap-3",children:[m.jsxs("label",{className:"flex flex-col gap-1",children:[m.jsx("span",{className:"text-label font-medium text-fg-3",children:"Working directory"}),m.jsx(un,{value:t,onChange:I=>n(I.target.value),placeholder:"/path/to/project",spellCheck:!1,className:"font-mono"})]}),m.jsxs("label",{className:"flex flex-col gap-1",children:[m.jsx("span",{className:"text-label font-medium text-fg-3",children:"Initial prompt (optional)"}),m.jsx(O1,{value:r,onChange:I=>i(I.target.value),rows:2,placeholder:"e.g. /verify-content 42, or a task description"})]}),m.jsxs("div",{className:"flex items-end justify-between gap-3",children:[m.jsx(x6,{profiles:h,value:b,onChange:I=>{v(I),A(void 0)},className:"min-w-32"}),m.jsxs("label",{className:"flex min-w-0 flex-col gap-1",children:[m.jsx("span",{className:"text-label font-medium text-fg-3",children:"Permission mode"}),m.jsx(rd,{variant:"form",mode:w.mode,onModeChange:l,modes:w.modes,className:"min-w-44"})]}),m.jsxs("label",{className:"flex min-w-0 flex-col gap-1",children:[m.jsx("span",{className:"text-label font-medium text-fg-3",children:"Model"}),m.jsx(Cy,{value:w.model,onChange:d,models:w.models,className:"min-w-44"})]}),w.reasoningEfforts.length>0?m.jsxs("label",{className:"flex min-w-0 flex-col gap-1",children:[m.jsx("span",{className:"text-label font-medium text-fg-3",children:"Effort"}),m.jsxs(uo,{items:[{value:"default",label:"Default"},...w.reasoningEfforts.map(I=>({value:I,label:I}))],value:f||"default",onValueChange:I=>g(I==="default"?"":String(I)),children:[m.jsx(fo,{className:"min-w-28",children:m.jsx(co,{})}),m.jsx(ho,{children:["default",...w.reasoningEfforts].map(I=>m.jsx(aa,{value:I,children:m.jsx(ia,{children:I})},I))})]})]}):null,m.jsxs(at,{onClick:()=>void _(),disabled:k,children:[k?m.jsx(wn,{className:"size-3.5 text-current"}):m.jsx(Ax,{className:"size-4"}),"Create"]})]}),w.capabilities.listSessions?m.jsxs("div",{className:"mt-1 border-t border-border pt-3",children:[m.jsxs("div",{className:"flex items-center justify-between",children:[m.jsx("span",{className:"text-label font-medium text-fg-3",children:"Resume a previous session"}),m.jsxs(at,{variant:"ghost",size:"xs",onClick:()=>void D(),disabled:R,children:[R?m.jsx(wn,{className:"size-3 text-current"}):m.jsx(q9,{className:"size-3"}),N?"Reload":"Browse"]})]}),N!==void 0?N.length===0?m.jsx("div",{className:"py-3 text-center text-body-sm text-fg-4",children:"No stored sessions for this directory."}):m.jsx("ul",{className:"mt-2 flex flex-col gap-1",children:N.map(I=>m.jsxs("li",{className:"flex items-center gap-2 rounded-md px-2 py-1.5 hover:bg-surface-hover",children:[m.jsxs("div",{className:"min-w-0 flex-1",children:[m.jsx("div",{className:"truncate text-body-sm text-fg-1",children:I.customTitle??I.summary}),m.jsxs("div",{className:"flex gap-2 font-mono text-label text-fg-4",children:[I.gitBranch?m.jsx("span",{className:"truncate",children:I.gitBranch}):null,m.jsx("span",{className:"shrink-0",children:Mp(I.lastModified)})]})]}),m.jsx(at,{variant:"outline",size:"xs",onClick:()=>void _(I),disabled:k,children:"Resume"})]},I.sessionId))}):null]}):null]})]})}function rre(){const e=zl(),{sessions:t,error:n,refresh:r}=S6(),i=a=>void e({to:"/sessions/$sessionId",params:{sessionId:a}});return m.jsx("div",{className:"flex-1 overflow-y-auto",children:m.jsxs("div",{className:"mx-auto flex w-full max-w-3xl flex-col gap-5 px-6 py-6",children:[m.jsxs("header",{className:"flex items-end justify-between",children:[m.jsxs("div",{children:[m.jsx("h1",{className:"text-display-sm font-semibold tracking-tight text-text",children:"Sessions"}),m.jsx("p",{className:"mt-0.5 text-body-sm text-muted-foreground",children:"Live Agent SDK sessions on this worker."})]}),m.jsx(at,{variant:"ghost",size:"icon-sm","aria-label":"Refresh",onClick:()=>void r(),children:m.jsx(Np,{className:"size-4"})})]}),n?m.jsxs("div",{className:"rounded-md bg-danger-bg px-3 py-2 text-body-sm text-danger",children:["Can’t reach the worker server: ",n,". Start it with ",m.jsx("code",{className:"font-mono",children:"pnpm server"}),"."]}):null,m.jsx(Mne,{sessions:[...t].sort((a,l)=>(l.lastActivityAt??l.createdAt)-(a.lastActivityAt??a.createdAt)),onSelect:i,onDelete:a=>{tr.deleteSession(a).then(()=>r()).catch(l=>Hn.error(l instanceof Error?l.message:"Delete failed"))},emptyText:"No live sessions. Create one below."}),m.jsx(nre,{onCreated:i})]})})}function Sw({kind:e,label:t}){const[n,r]=E.useState(()=>Ty(e)),[i,a]=E.useState(()=>Sy(e));return m.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-x-3 gap-y-2",children:[m.jsx("span",{className:"text-body-sm text-fg-2",children:t}),m.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[m.jsx(rd,{variant:"form",mode:i,onModeChange:l=>{a(l),zne(e,l)},className:"min-w-40"}),m.jsx(Cy,{value:n,onChange:l=>{r(l),Hne(e,l)},className:"min-w-44"})]})]})}function sre(){return m.jsx("div",{className:"flex-1 overflow-y-auto",children:m.jsxs("div",{className:"mx-auto flex w-full max-w-3xl flex-col gap-4 px-6 py-6",children:[m.jsxs("header",{children:[m.jsx("h1",{className:"text-display-sm font-semibold tracking-tight text-text",children:"Settings"}),m.jsx("p",{className:"mt-0.5 text-body-sm text-muted-foreground",children:"Client-side preferences. Server policy (auth, cwd roots, API-key requirements) is configured where the worker runs."})]}),m.jsxs(Os,{children:[m.jsx(Is,{children:m.jsx(Ms,{children:"Appearance"})}),m.jsxs(Ls,{className:"flex items-center justify-between",children:[m.jsx("span",{className:"text-body-sm text-fg-2",children:"Theme"}),m.jsx(m6,{})]})]}),m.jsxs(Os,{children:[m.jsx(Is,{children:m.jsx(Ms,{children:"Defaults"})}),m.jsxs(Ls,{className:"flex flex-col gap-3",children:[m.jsx(Sw,{kind:"session",label:"New session"}),m.jsx(Sw,{kind:"job",label:"Queue job"}),m.jsx("p",{className:"text-label text-fg-4",children:'Pre-fills the permission mode and model on the new-session and schedule-job forms (still editable per run). "Default (recommended)" leaves the model to the CLI.'})]})]}),m.jsxs(Os,{children:[m.jsx(Is,{children:m.jsx(Ms,{children:"Worker server"})}),m.jsxs(Ls,{className:"flex flex-col gap-1 text-body-sm text-fg-2",children:[m.jsxs("div",{children:["Endpoint: ",m.jsxs("code",{className:"font-mono text-code",children:[location.origin,"/v1"]})," (dev proxy → ",m.jsx("code",{className:"font-mono text-code",children:"WORKER_URL"}),", default"," ",m.jsx("code",{className:"font-mono text-code",children:"http://127.0.0.1:8787"}),")"]}),m.jsx("div",{className:"text-label text-fg-4",children:"Anthropic credentials are resolved by the SDK from the server operator’s environment — this app never handles them."})]})]})]})})}const xa=TM({component:Bne}),ire=xo({getParentRoute:()=>xa,path:"/",beforeLoad:()=>{throw jw({to:"/sessions"})}}),are=xo({getParentRoute:()=>xa,path:"/sessions",component:rre}),ore=xo({getParentRoute:()=>xa,path:"/sessions/$sessionId",component:tre}),lre=xo({getParentRoute:()=>xa,path:"/jobs",component:Xne}),ure=xo({getParentRoute:()=>xa,path:"/profiles",component:Jne}),cre=xo({getParentRoute:()=>xa,path:"/profiles/$profileName",component:ere}),dre=xo({getParentRoute:()=>xa,path:"/settings",component:sre}),fre=DM({routeTree:xa.addChildren([ire,are,ore,lre,ure,cre,dre]),history:U5()});function hre(){return m.jsxs(m.Fragment,{children:[m.jsx(BM,{router:fre}),m.jsx(UH,{})]})}ww();const k6=document.getElementById("root");if(!k6)throw new Error("Root element #root not found");YI.createRoot(k6).render(m.jsx(E.StrictMode,{children:m.jsx(hre,{})}));const pre=Object.freeze(Object.defineProperty({__proto__:null,Mermaid:f6},Symbol.toStringTag,{value:"Module"}));export{_ee as A,bre as L,qr as R,Pl as _,m as j,E as r};