@ours.network/messenger-server 1.0.31-nightly.8 → 2.0.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 (148) hide show
  1. package/README.md +54 -12
  2. package/dist/chunks/{chunk-R7BUOI6N.js → chunk-WZKKVWF2.js} +1 -1
  3. package/dist/chunks/{server-HW65GMOR.js → server-CMRJ5OCO.js} +3183 -1969
  4. package/dist/cli.js +2 -2
  5. package/package.json +10 -36
  6. package/dist/web/assets/abnfDiagram-VCTEODGH-Bsy770zT.js +0 -2
  7. package/dist/web/assets/abnfDiagram-VCTEODGH-Bsy770zT.js.map +0 -1
  8. package/dist/web/assets/arc-smj0skcK.js +0 -2
  9. package/dist/web/assets/arc-smj0skcK.js.map +0 -1
  10. package/dist/web/assets/architectureDiagram-5GKGNRK7-CvMhiOPf.js +0 -37
  11. package/dist/web/assets/architectureDiagram-5GKGNRK7-CvMhiOPf.js.map +0 -1
  12. package/dist/web/assets/blockDiagram-I7D4REHJ-BMzQpWoB.js +0 -130
  13. package/dist/web/assets/blockDiagram-I7D4REHJ-BMzQpWoB.js.map +0 -1
  14. package/dist/web/assets/browser-Dhhdn8L5.js +0 -9
  15. package/dist/web/assets/browser-Dhhdn8L5.js.map +0 -1
  16. package/dist/web/assets/c4Diagram-7LVT6UL2-D6oP9oqL.js +0 -39
  17. package/dist/web/assets/c4Diagram-7LVT6UL2-D6oP9oqL.js.map +0 -1
  18. package/dist/web/assets/channel-DpVnOptZ.js +0 -2
  19. package/dist/web/assets/channel-DpVnOptZ.js.map +0 -1
  20. package/dist/web/assets/chunk-2Q5K7J3B-Ci9Rok3C.js +0 -2
  21. package/dist/web/assets/chunk-2Q5K7J3B-Ci9Rok3C.js.map +0 -1
  22. package/dist/web/assets/chunk-5VM5RSS4-DUXABFmH.js +0 -16
  23. package/dist/web/assets/chunk-5VM5RSS4-DUXABFmH.js.map +0 -1
  24. package/dist/web/assets/chunk-F27PBJKO-D0ToOoor.js +0 -2
  25. package/dist/web/assets/chunk-F27PBJKO-D0ToOoor.js.map +0 -1
  26. package/dist/web/assets/chunk-IMKFNOWR-B7X9IE0d.js +0 -232
  27. package/dist/web/assets/chunk-IMKFNOWR-B7X9IE0d.js.map +0 -1
  28. package/dist/web/assets/chunk-JWPE2WC7-BFy2IZwu.js +0 -2
  29. package/dist/web/assets/chunk-JWPE2WC7-BFy2IZwu.js.map +0 -1
  30. package/dist/web/assets/chunk-POPQ4Y6H-CO1_SejU.js +0 -2
  31. package/dist/web/assets/chunk-POPQ4Y6H-CO1_SejU.js.map +0 -1
  32. package/dist/web/assets/chunk-SVP7TREG-DWzLpi99.js +0 -89
  33. package/dist/web/assets/chunk-SVP7TREG-DWzLpi99.js.map +0 -1
  34. package/dist/web/assets/chunk-TICWLB2K-BN-FzAsh.js +0 -207
  35. package/dist/web/assets/chunk-TICWLB2K-BN-FzAsh.js.map +0 -1
  36. package/dist/web/assets/chunk-XXDRQBXY-Zi3kmkY1.js +0 -2
  37. package/dist/web/assets/chunk-XXDRQBXY-Zi3kmkY1.js.map +0 -1
  38. package/dist/web/assets/classDiagram-ZZMXUADV-D0QSHBxd.js +0 -2
  39. package/dist/web/assets/classDiagram-ZZMXUADV-D0QSHBxd.js.map +0 -1
  40. package/dist/web/assets/classDiagram-v2-VYDZK3BY-D0QSHBxd.js +0 -2
  41. package/dist/web/assets/classDiagram-v2-VYDZK3BY-D0QSHBxd.js.map +0 -1
  42. package/dist/web/assets/cose-bilkent-JH36ORCC-C08QbLCm.js +0 -2
  43. package/dist/web/assets/cose-bilkent-JH36ORCC-C08QbLCm.js.map +0 -1
  44. package/dist/web/assets/cynefin-OW5HDTMX-CkpSL7Wh.js +0 -179
  45. package/dist/web/assets/cynefin-OW5HDTMX-CkpSL7Wh.js.map +0 -1
  46. package/dist/web/assets/cynefinDiagram-5FMLGOSQ-CUJiCMMe.js +0 -63
  47. package/dist/web/assets/cynefinDiagram-5FMLGOSQ-CUJiCMMe.js.map +0 -1
  48. package/dist/web/assets/cytoscape.esm-CtNdOvlO.js +0 -332
  49. package/dist/web/assets/cytoscape.esm-CtNdOvlO.js.map +0 -1
  50. package/dist/web/assets/dagre-GXQ25YYZ-CopeDP5i.js +0 -5
  51. package/dist/web/assets/dagre-GXQ25YYZ-CopeDP5i.js.map +0 -1
  52. package/dist/web/assets/defaultLocale-DX6XiGOO.js +0 -2
  53. package/dist/web/assets/defaultLocale-DX6XiGOO.js.map +0 -1
  54. package/dist/web/assets/diagram-S7CK7UJ4-BbJ5MRYY.js +0 -31
  55. package/dist/web/assets/diagram-S7CK7UJ4-BbJ5MRYY.js.map +0 -1
  56. package/dist/web/assets/diagram-UQ7AKVKN-DEVLw8Np.js +0 -42
  57. package/dist/web/assets/diagram-UQ7AKVKN-DEVLw8Np.js.map +0 -1
  58. package/dist/web/assets/diagram-VSXAHHWV-o4wAqqDd.js +0 -4
  59. package/dist/web/assets/diagram-VSXAHHWV-o4wAqqDd.js.map +0 -1
  60. package/dist/web/assets/diagram-VX7I27RA-B7v-lLie.js +0 -25
  61. package/dist/web/assets/diagram-VX7I27RA-B7v-lLie.js.map +0 -1
  62. package/dist/web/assets/diagram-Z3DM3KII-869THeyj.js +0 -25
  63. package/dist/web/assets/diagram-Z3DM3KII-869THeyj.js.map +0 -1
  64. package/dist/web/assets/ebnfDiagram-PWID7BFC-DnUp07Lj.js +0 -2
  65. package/dist/web/assets/ebnfDiagram-PWID7BFC-DnUp07Lj.js.map +0 -1
  66. package/dist/web/assets/erDiagram-RLTQ6QDP-DwqR0o7N.js +0 -100
  67. package/dist/web/assets/erDiagram-RLTQ6QDP-DwqR0o7N.js.map +0 -1
  68. package/dist/web/assets/flowDiagram-HODETNUW-CIjJ1GAM.js +0 -169
  69. package/dist/web/assets/flowDiagram-HODETNUW-CIjJ1GAM.js.map +0 -1
  70. package/dist/web/assets/ganttDiagram-EL5Y4UJY-Dg0NXxc2.js +0 -293
  71. package/dist/web/assets/ganttDiagram-EL5Y4UJY-Dg0NXxc2.js.map +0 -1
  72. package/dist/web/assets/gitGraphDiagram-WWUBYQGX-CmKSkpPJ.js +0 -107
  73. package/dist/web/assets/gitGraphDiagram-WWUBYQGX-CmKSkpPJ.js.map +0 -1
  74. package/dist/web/assets/index-BAN62UdD.js +0 -332
  75. package/dist/web/assets/index-BAN62UdD.js.map +0 -1
  76. package/dist/web/assets/index-D5Q5XY4t.css +0 -1
  77. package/dist/web/assets/infoDiagram-27XIBGKW-BXthwNyR.js +0 -3
  78. package/dist/web/assets/infoDiagram-27XIBGKW-BXthwNyR.js.map +0 -1
  79. package/dist/web/assets/init-Gi6I4Gst.js +0 -2
  80. package/dist/web/assets/init-Gi6I4Gst.js.map +0 -1
  81. package/dist/web/assets/ishikawaDiagram-5VMMS53U-KT81x4Jv.js +0 -71
  82. package/dist/web/assets/ishikawaDiagram-5VMMS53U-KT81x4Jv.js.map +0 -1
  83. package/dist/web/assets/jetbrains-mono-cyrillic-wght-normal-D73BlboJ.woff2 +0 -0
  84. package/dist/web/assets/jetbrains-mono-greek-wght-normal-Bw9x6K1M.woff2 +0 -0
  85. package/dist/web/assets/jetbrains-mono-latin-ext-wght-normal-DBQx-q_a.woff2 +0 -0
  86. package/dist/web/assets/jetbrains-mono-latin-wght-normal-B9CIFXIH.woff2 +0 -0
  87. package/dist/web/assets/jetbrains-mono-vietnamese-wght-normal-Bt-aOZkq.woff2 +0 -0
  88. package/dist/web/assets/journeyDiagram-3NMN7TZE-BZYjvsli.js +0 -140
  89. package/dist/web/assets/journeyDiagram-3NMN7TZE-BZYjvsli.js.map +0 -1
  90. package/dist/web/assets/jsQR-9sKVnlrx.js +0 -2
  91. package/dist/web/assets/jsQR-9sKVnlrx.js.map +0 -1
  92. package/dist/web/assets/kanban-definition-UXKFOSKX-D6XpCVPA.js +0 -90
  93. package/dist/web/assets/kanban-definition-UXKFOSKX-D6XpCVPA.js.map +0 -1
  94. package/dist/web/assets/katex-HP8lGamR.js +0 -258
  95. package/dist/web/assets/katex-HP8lGamR.js.map +0 -1
  96. package/dist/web/assets/layout-D-RI75hd.js +0 -2
  97. package/dist/web/assets/layout-D-RI75hd.js.map +0 -1
  98. package/dist/web/assets/linear-CxKQaVz6.js +0 -2
  99. package/dist/web/assets/linear-CxKQaVz6.js.map +0 -1
  100. package/dist/web/assets/mermaid.core-B4rA_8qO.js +0 -313
  101. package/dist/web/assets/mermaid.core-B4rA_8qO.js.map +0 -1
  102. package/dist/web/assets/mindmap-definition-YA3MSWOX-y2D83RX0.js +0 -97
  103. package/dist/web/assets/mindmap-definition-YA3MSWOX-y2D83RX0.js.map +0 -1
  104. package/dist/web/assets/ordinal-Cboi1Yqb.js +0 -2
  105. package/dist/web/assets/ordinal-Cboi1Yqb.js.map +0 -1
  106. package/dist/web/assets/pegDiagram-XKGWAZYB-B4q6ECKc.js +0 -2
  107. package/dist/web/assets/pegDiagram-XKGWAZYB-B4q6ECKc.js.map +0 -1
  108. package/dist/web/assets/pieDiagram-E7YTZNPT-C8Po7jX6.js +0 -40
  109. package/dist/web/assets/pieDiagram-E7YTZNPT-C8Po7jX6.js.map +0 -1
  110. package/dist/web/assets/quadrantDiagram-AXDQQJYC-xMvZtoST.js +0 -8
  111. package/dist/web/assets/quadrantDiagram-AXDQQJYC-xMvZtoST.js.map +0 -1
  112. package/dist/web/assets/railroadDiagram-O6MQD6OU-CpJNZnuT.js +0 -2
  113. package/dist/web/assets/railroadDiagram-O6MQD6OU-CpJNZnuT.js.map +0 -1
  114. package/dist/web/assets/requirementDiagram-BXWQKSXE-Ctjahaz-.js +0 -85
  115. package/dist/web/assets/requirementDiagram-BXWQKSXE-Ctjahaz-.js.map +0 -1
  116. package/dist/web/assets/sankeyDiagram-P5KCCOFB-C7mvWHwN.js +0 -41
  117. package/dist/web/assets/sankeyDiagram-P5KCCOFB-C7mvWHwN.js.map +0 -1
  118. package/dist/web/assets/sequenceDiagram-WJ2MYXX4-CdKvRxG9.js +0 -163
  119. package/dist/web/assets/sequenceDiagram-WJ2MYXX4-CdKvRxG9.js.map +0 -1
  120. package/dist/web/assets/sizeCapture-INFHLROL-Ucl1QUac.js +0 -2
  121. package/dist/web/assets/sizeCapture-INFHLROL-Ucl1QUac.js.map +0 -1
  122. package/dist/web/assets/stateDiagram-D77RDMKH-fsxc7tQr.js +0 -2
  123. package/dist/web/assets/stateDiagram-D77RDMKH-fsxc7tQr.js.map +0 -1
  124. package/dist/web/assets/stateDiagram-v2-MP3YSRHH-DFRoft6f.js +0 -2
  125. package/dist/web/assets/stateDiagram-v2-MP3YSRHH-DFRoft6f.js.map +0 -1
  126. package/dist/web/assets/swimlanes-42K2YHIH-BNpJElyX.js +0 -2
  127. package/dist/web/assets/swimlanes-42K2YHIH-BNpJElyX.js.map +0 -1
  128. package/dist/web/assets/swimlanesDiagram-VR7AAH4N-DvRNHYvv.js +0 -9
  129. package/dist/web/assets/swimlanesDiagram-VR7AAH4N-DvRNHYvv.js.map +0 -1
  130. package/dist/web/assets/timeline-definition-24CTP7MA-DBN7qndE.js +0 -121
  131. package/dist/web/assets/timeline-definition-24CTP7MA-DBN7qndE.js.map +0 -1
  132. package/dist/web/assets/vennDiagram-4TSXK5OY-P6TiB55y.js +0 -35
  133. package/dist/web/assets/vennDiagram-4TSXK5OY-P6TiB55y.js.map +0 -1
  134. package/dist/web/assets/wardleyDiagram-VM6X3IG4-zSiZQB87.js +0 -79
  135. package/dist/web/assets/wardleyDiagram-VM6X3IG4-zSiZQB87.js.map +0 -1
  136. package/dist/web/assets/xychartDiagram-S5SC5T6Z-HMjdbUIZ.js +0 -8
  137. package/dist/web/assets/xychartDiagram-S5SC5T6Z-HMjdbUIZ.js.map +0 -1
  138. package/dist/web/icons/apple-touch-icon.png +0 -0
  139. package/dist/web/icons/favicon-16.png +0 -0
  140. package/dist/web/icons/favicon-32.png +0 -0
  141. package/dist/web/icons/icon-192-maskable.png +0 -0
  142. package/dist/web/icons/icon-192.png +0 -0
  143. package/dist/web/icons/icon-512-maskable.png +0 -0
  144. package/dist/web/icons/icon-512.png +0 -0
  145. package/dist/web/index.html +0 -19
  146. package/dist/web/manifest.webmanifest +0 -17
  147. package/dist/web/sw.js +0 -190
  148. package/dist/web/version.json +0 -1
@@ -1,332 +0,0 @@
1
- function UE(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&&!Array.isArray(r)){for(const s in r)if(s!=="default"&&!(s in e)){const a=Object.getOwnPropertyDescriptor(r,s);a&&Object.defineProperty(e,s,a.get?a:{enumerable:!0,get:()=>r[s]})}}}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 s of document.querySelectorAll('link[rel="modulepreload"]'))r(s);new MutationObserver(s=>{for(const a of s)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(s){const a={};return s.integrity&&(a.integrity=s.integrity),s.referrerPolicy&&(a.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?a.credentials="include":s.crossOrigin==="anonymous"?a.credentials="omit":a.credentials="same-origin",a}function r(s){if(s.ep)return;s.ep=!0;const a=n(s);fetch(s.href,a)}})();function Zh(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Ud={exports:{}},jo={},$d={exports:{}},ze={};/**
2
- * @license React
3
- * react.production.min.js
4
- *
5
- * Copyright (c) Facebook, Inc. and its affiliates.
6
- *
7
- * This source code is licensed under the MIT license found in the
8
- * LICENSE file in the root directory of this source tree.
9
- */var Hy;function $E(){if(Hy)return ze;Hy=1;var e=Symbol.for("react.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),a=Symbol.for("react.provider"),l=Symbol.for("react.context"),c=Symbol.for("react.forward_ref"),d=Symbol.for("react.suspense"),h=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),m=Symbol.iterator;function y(F){return F===null||typeof F!="object"?null:(F=m&&F[m]||F["@@iterator"],typeof F=="function"?F:null)}var w={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},k=Object.assign,b={};function E(F,X,M){this.props=F,this.context=X,this.refs=b,this.updater=M||w}E.prototype.isReactComponent={},E.prototype.setState=function(F,X){if(typeof F!="object"&&typeof F!="function"&&F!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,F,X,"setState")},E.prototype.forceUpdate=function(F){this.updater.enqueueForceUpdate(this,F,"forceUpdate")};function P(){}P.prototype=E.prototype;function R(F,X,M){this.props=F,this.context=X,this.refs=b,this.updater=M||w}var _=R.prototype=new P;_.constructor=R,k(_,E.prototype),_.isPureReactComponent=!0;var j=Array.isArray,A=Object.prototype.hasOwnProperty,N={current:null},q={key:!0,ref:!0,__self:!0,__source:!0};function B(F,X,M){var oe,ue={},ae=null,me=null;if(X!=null)for(oe in X.ref!==void 0&&(me=X.ref),X.key!==void 0&&(ae=""+X.key),X)A.call(X,oe)&&!q.hasOwnProperty(oe)&&(ue[oe]=X[oe]);var ke=arguments.length-2;if(ke===1)ue.children=M;else if(1<ke){for(var xe=Array(ke),$e=0;$e<ke;$e++)xe[$e]=arguments[$e+2];ue.children=xe}if(F&&F.defaultProps)for(oe in ke=F.defaultProps,ke)ue[oe]===void 0&&(ue[oe]=ke[oe]);return{$$typeof:e,type:F,key:ae,ref:me,props:ue,_owner:N.current}}function D(F,X){return{$$typeof:e,type:F.type,key:X,ref:F.ref,props:F.props,_owner:F._owner}}function I(F){return typeof F=="object"&&F!==null&&F.$$typeof===e}function U(F){var X={"=":"=0",":":"=2"};return"$"+F.replace(/[=:]/g,function(M){return X[M]})}var z=/\/+/g;function he(F,X){return typeof F=="object"&&F!==null&&F.key!=null?U(""+F.key):X.toString(36)}function J(F,X,M,oe,ue){var ae=typeof F;(ae==="undefined"||ae==="boolean")&&(F=null);var me=!1;if(F===null)me=!0;else switch(ae){case"string":case"number":me=!0;break;case"object":switch(F.$$typeof){case e:case t:me=!0}}if(me)return me=F,ue=ue(me),F=oe===""?"."+he(me,0):oe,j(ue)?(M="",F!=null&&(M=F.replace(z,"$&/")+"/"),J(ue,X,M,"",function($e){return $e})):ue!=null&&(I(ue)&&(ue=D(ue,M+(!ue.key||me&&me.key===ue.key?"":(""+ue.key).replace(z,"$&/")+"/")+F)),X.push(ue)),1;if(me=0,oe=oe===""?".":oe+":",j(F))for(var ke=0;ke<F.length;ke++){ae=F[ke];var xe=oe+he(ae,ke);me+=J(ae,X,M,xe,ue)}else if(xe=y(F),typeof xe=="function")for(F=xe.call(F),ke=0;!(ae=F.next()).done;)ae=ae.value,xe=oe+he(ae,ke++),me+=J(ae,X,M,xe,ue);else if(ae==="object")throw X=String(F),Error("Objects are not valid as a React child (found: "+(X==="[object Object]"?"object with keys {"+Object.keys(F).join(", ")+"}":X)+"). If you meant to render a collection of children, use an array instead.");return me}function Z(F,X,M){if(F==null)return F;var oe=[],ue=0;return J(F,oe,"","",function(ae){return X.call(M,ae,ue++)}),oe}function ve(F){if(F._status===-1){var X=F._result;X=X(),X.then(function(M){(F._status===0||F._status===-1)&&(F._status=1,F._result=M)},function(M){(F._status===0||F._status===-1)&&(F._status=2,F._result=M)}),F._status===-1&&(F._status=0,F._result=X)}if(F._status===1)return F._result.default;throw F._result}var Se={current:null},Q={transition:null},pe={ReactCurrentDispatcher:Se,ReactCurrentBatchConfig:Q,ReactCurrentOwner:N};function T(){throw Error("act(...) is not supported in production builds of React.")}return ze.Children={map:Z,forEach:function(F,X,M){Z(F,function(){X.apply(this,arguments)},M)},count:function(F){var X=0;return Z(F,function(){X++}),X},toArray:function(F){return Z(F,function(X){return X})||[]},only:function(F){if(!I(F))throw Error("React.Children.only expected to receive a single React element child.");return F}},ze.Component=E,ze.Fragment=n,ze.Profiler=s,ze.PureComponent=R,ze.StrictMode=r,ze.Suspense=d,ze.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=pe,ze.act=T,ze.cloneElement=function(F,X,M){if(F==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+F+".");var oe=k({},F.props),ue=F.key,ae=F.ref,me=F._owner;if(X!=null){if(X.ref!==void 0&&(ae=X.ref,me=N.current),X.key!==void 0&&(ue=""+X.key),F.type&&F.type.defaultProps)var ke=F.type.defaultProps;for(xe in X)A.call(X,xe)&&!q.hasOwnProperty(xe)&&(oe[xe]=X[xe]===void 0&&ke!==void 0?ke[xe]:X[xe])}var xe=arguments.length-2;if(xe===1)oe.children=M;else if(1<xe){ke=Array(xe);for(var $e=0;$e<xe;$e++)ke[$e]=arguments[$e+2];oe.children=ke}return{$$typeof:e,type:F.type,key:ue,ref:ae,props:oe,_owner:me}},ze.createContext=function(F){return F={$$typeof:l,_currentValue:F,_currentValue2:F,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},F.Provider={$$typeof:a,_context:F},F.Consumer=F},ze.createElement=B,ze.createFactory=function(F){var X=B.bind(null,F);return X.type=F,X},ze.createRef=function(){return{current:null}},ze.forwardRef=function(F){return{$$typeof:c,render:F}},ze.isValidElement=I,ze.lazy=function(F){return{$$typeof:p,_payload:{_status:-1,_result:F},_init:ve}},ze.memo=function(F,X){return{$$typeof:h,type:F,compare:X===void 0?null:X}},ze.startTransition=function(F){var X=Q.transition;Q.transition={};try{F()}finally{Q.transition=X}},ze.unstable_act=T,ze.useCallback=function(F,X){return Se.current.useCallback(F,X)},ze.useContext=function(F){return Se.current.useContext(F)},ze.useDebugValue=function(){},ze.useDeferredValue=function(F){return Se.current.useDeferredValue(F)},ze.useEffect=function(F,X){return Se.current.useEffect(F,X)},ze.useId=function(){return Se.current.useId()},ze.useImperativeHandle=function(F,X,M){return Se.current.useImperativeHandle(F,X,M)},ze.useInsertionEffect=function(F,X){return Se.current.useInsertionEffect(F,X)},ze.useLayoutEffect=function(F,X){return Se.current.useLayoutEffect(F,X)},ze.useMemo=function(F,X){return Se.current.useMemo(F,X)},ze.useReducer=function(F,X,M){return Se.current.useReducer(F,X,M)},ze.useRef=function(F){return Se.current.useRef(F)},ze.useState=function(F){return Se.current.useState(F)},ze.useSyncExternalStore=function(F,X,M){return Se.current.useSyncExternalStore(F,X,M)},ze.useTransition=function(){return Se.current.useTransition()},ze.version="18.3.1",ze}var Wy;function ep(){return Wy||(Wy=1,$d.exports=$E()),$d.exports}/**
10
- * @license React
11
- * react-jsx-runtime.production.min.js
12
- *
13
- * Copyright (c) Facebook, Inc. and its affiliates.
14
- *
15
- * This source code is licensed under the MIT license found in the
16
- * LICENSE file in the root directory of this source tree.
17
- */var qy;function HE(){if(qy)return jo;qy=1;var e=ep(),t=Symbol.for("react.element"),n=Symbol.for("react.fragment"),r=Object.prototype.hasOwnProperty,s=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,a={key:!0,ref:!0,__self:!0,__source:!0};function l(c,d,h){var p,m={},y=null,w=null;h!==void 0&&(y=""+h),d.key!==void 0&&(y=""+d.key),d.ref!==void 0&&(w=d.ref);for(p in d)r.call(d,p)&&!a.hasOwnProperty(p)&&(m[p]=d[p]);if(c&&c.defaultProps)for(p in d=c.defaultProps,d)m[p]===void 0&&(m[p]=d[p]);return{$$typeof:t,type:c,key:y,ref:w,props:m,_owner:s.current}}return jo.Fragment=n,jo.jsx=l,jo.jsxs=l,jo}var Gy;function WE(){return Gy||(Gy=1,Ud.exports=HE()),Ud.exports}var v=WE(),Dl={},Hd={exports:{}},gn={},Wd={exports:{}},qd={};/**
18
- * @license React
19
- * scheduler.production.min.js
20
- *
21
- * Copyright (c) Facebook, Inc. and its affiliates.
22
- *
23
- * This source code is licensed under the MIT license found in the
24
- * LICENSE file in the root directory of this source tree.
25
- */var Ky;function qE(){return Ky||(Ky=1,(function(e){function t(Q,pe){var T=Q.length;Q.push(pe);e:for(;0<T;){var F=T-1>>>1,X=Q[F];if(0<s(X,pe))Q[F]=pe,Q[T]=X,T=F;else break e}}function n(Q){return Q.length===0?null:Q[0]}function r(Q){if(Q.length===0)return null;var pe=Q[0],T=Q.pop();if(T!==pe){Q[0]=T;e:for(var F=0,X=Q.length,M=X>>>1;F<M;){var oe=2*(F+1)-1,ue=Q[oe],ae=oe+1,me=Q[ae];if(0>s(ue,T))ae<X&&0>s(me,ue)?(Q[F]=me,Q[ae]=T,F=ae):(Q[F]=ue,Q[oe]=T,F=oe);else if(ae<X&&0>s(me,T))Q[F]=me,Q[ae]=T,F=ae;else break e}}return pe}function s(Q,pe){var T=Q.sortIndex-pe.sortIndex;return T!==0?T:Q.id-pe.id}if(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=[],h=[],p=1,m=null,y=3,w=!1,k=!1,b=!1,E=typeof setTimeout=="function"?setTimeout:null,P=typeof clearTimeout=="function"?clearTimeout:null,R=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function _(Q){for(var pe=n(h);pe!==null;){if(pe.callback===null)r(h);else if(pe.startTime<=Q)r(h),pe.sortIndex=pe.expirationTime,t(d,pe);else break;pe=n(h)}}function j(Q){if(b=!1,_(Q),!k)if(n(d)!==null)k=!0,ve(A);else{var pe=n(h);pe!==null&&Se(j,pe.startTime-Q)}}function A(Q,pe){k=!1,b&&(b=!1,P(B),B=-1),w=!0;var T=y;try{for(_(pe),m=n(d);m!==null&&(!(m.expirationTime>pe)||Q&&!U());){var F=m.callback;if(typeof F=="function"){m.callback=null,y=m.priorityLevel;var X=F(m.expirationTime<=pe);pe=e.unstable_now(),typeof X=="function"?m.callback=X:m===n(d)&&r(d),_(pe)}else r(d);m=n(d)}if(m!==null)var M=!0;else{var oe=n(h);oe!==null&&Se(j,oe.startTime-pe),M=!1}return M}finally{m=null,y=T,w=!1}}var N=!1,q=null,B=-1,D=5,I=-1;function U(){return!(e.unstable_now()-I<D)}function z(){if(q!==null){var Q=e.unstable_now();I=Q;var pe=!0;try{pe=q(!0,Q)}finally{pe?he():(N=!1,q=null)}}else N=!1}var he;if(typeof R=="function")he=function(){R(z)};else if(typeof MessageChannel<"u"){var J=new MessageChannel,Z=J.port2;J.port1.onmessage=z,he=function(){Z.postMessage(null)}}else he=function(){E(z,0)};function ve(Q){q=Q,N||(N=!0,he())}function Se(Q,pe){B=E(function(){Q(e.unstable_now())},pe)}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(Q){Q.callback=null},e.unstable_continueExecution=function(){k||w||(k=!0,ve(A))},e.unstable_forceFrameRate=function(Q){0>Q||125<Q?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):D=0<Q?Math.floor(1e3/Q):5},e.unstable_getCurrentPriorityLevel=function(){return y},e.unstable_getFirstCallbackNode=function(){return n(d)},e.unstable_next=function(Q){switch(y){case 1:case 2:case 3:var pe=3;break;default:pe=y}var T=y;y=pe;try{return Q()}finally{y=T}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(Q,pe){switch(Q){case 1:case 2:case 3:case 4:case 5:break;default:Q=3}var T=y;y=Q;try{return pe()}finally{y=T}},e.unstable_scheduleCallback=function(Q,pe,T){var F=e.unstable_now();switch(typeof T=="object"&&T!==null?(T=T.delay,T=typeof T=="number"&&0<T?F+T:F):T=F,Q){case 1:var X=-1;break;case 2:X=250;break;case 5:X=1073741823;break;case 4:X=1e4;break;default:X=5e3}return X=T+X,Q={id:p++,callback:pe,priorityLevel:Q,startTime:T,expirationTime:X,sortIndex:-1},T>F?(Q.sortIndex=T,t(h,Q),n(d)===null&&Q===n(h)&&(b?(P(B),B=-1):b=!0,Se(j,T-F))):(Q.sortIndex=X,t(d,Q),k||w||(k=!0,ve(A))),Q},e.unstable_shouldYield=U,e.unstable_wrapCallback=function(Q){var pe=y;return function(){var T=y;y=pe;try{return Q.apply(this,arguments)}finally{y=T}}}})(qd)),qd}var Xy;function GE(){return Xy||(Xy=1,Wd.exports=qE()),Wd.exports}/**
26
- * @license React
27
- * react-dom.production.min.js
28
- *
29
- * Copyright (c) Facebook, Inc. and its affiliates.
30
- *
31
- * This source code is licensed under the MIT license found in the
32
- * LICENSE file in the root directory of this source tree.
33
- */var Yy;function KE(){if(Yy)return gn;Yy=1;var e=ep(),t=GE();function n(i){for(var o="https://reactjs.org/docs/error-decoder.html?invariant="+i,u=1;u<arguments.length;u++)o+="&args[]="+encodeURIComponent(arguments[u]);return"Minified React error #"+i+"; visit "+o+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var r=new Set,s={};function a(i,o){l(i,o),l(i+"Capture",o)}function l(i,o){for(s[i]=o,i=0;i<o.length;i++)r.add(o[i])}var c=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),d=Object.prototype.hasOwnProperty,h=/^[: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]*$/,p={},m={};function y(i){return d.call(m,i)?!0:d.call(p,i)?!1:h.test(i)?m[i]=!0:(p[i]=!0,!1)}function w(i,o,u,f){if(u!==null&&u.type===0)return!1;switch(typeof o){case"function":case"symbol":return!0;case"boolean":return f?!1:u!==null?!u.acceptsBooleans:(i=i.toLowerCase().slice(0,5),i!=="data-"&&i!=="aria-");default:return!1}}function k(i,o,u,f){if(o===null||typeof o>"u"||w(i,o,u,f))return!0;if(f)return!1;if(u!==null)switch(u.type){case 3:return!o;case 4:return o===!1;case 5:return isNaN(o);case 6:return isNaN(o)||1>o}return!1}function b(i,o,u,f,g,x,C){this.acceptsBooleans=o===2||o===3||o===4,this.attributeName=f,this.attributeNamespace=g,this.mustUseProperty=u,this.propertyName=i,this.type=o,this.sanitizeURL=x,this.removeEmptyString=C}var E={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(i){E[i]=new b(i,0,!1,i,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(i){var o=i[0];E[o]=new b(o,1,!1,i[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(i){E[i]=new b(i,2,!1,i.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(i){E[i]=new b(i,2,!1,i,null,!1,!1)}),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(i){E[i]=new b(i,3,!1,i.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(i){E[i]=new b(i,3,!0,i,null,!1,!1)}),["capture","download"].forEach(function(i){E[i]=new b(i,4,!1,i,null,!1,!1)}),["cols","rows","size","span"].forEach(function(i){E[i]=new b(i,6,!1,i,null,!1,!1)}),["rowSpan","start"].forEach(function(i){E[i]=new b(i,5,!1,i.toLowerCase(),null,!1,!1)});var P=/[\-:]([a-z])/g;function R(i){return i[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(i){var o=i.replace(P,R);E[o]=new b(o,1,!1,i,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(i){var o=i.replace(P,R);E[o]=new b(o,1,!1,i,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(i){var o=i.replace(P,R);E[o]=new b(o,1,!1,i,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(i){E[i]=new b(i,1,!1,i.toLowerCase(),null,!1,!1)}),E.xlinkHref=new b("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(i){E[i]=new b(i,1,!1,i.toLowerCase(),null,!0,!0)});function _(i,o,u,f){var g=E.hasOwnProperty(o)?E[o]:null;(g!==null?g.type!==0:f||!(2<o.length)||o[0]!=="o"&&o[0]!=="O"||o[1]!=="n"&&o[1]!=="N")&&(k(o,u,g,f)&&(u=null),f||g===null?y(o)&&(u===null?i.removeAttribute(o):i.setAttribute(o,""+u)):g.mustUseProperty?i[g.propertyName]=u===null?g.type===3?!1:"":u:(o=g.attributeName,f=g.attributeNamespace,u===null?i.removeAttribute(o):(g=g.type,u=g===3||g===4&&u===!0?"":""+u,f?i.setAttributeNS(f,o,u):i.setAttribute(o,u))))}var j=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,A=Symbol.for("react.element"),N=Symbol.for("react.portal"),q=Symbol.for("react.fragment"),B=Symbol.for("react.strict_mode"),D=Symbol.for("react.profiler"),I=Symbol.for("react.provider"),U=Symbol.for("react.context"),z=Symbol.for("react.forward_ref"),he=Symbol.for("react.suspense"),J=Symbol.for("react.suspense_list"),Z=Symbol.for("react.memo"),ve=Symbol.for("react.lazy"),Se=Symbol.for("react.offscreen"),Q=Symbol.iterator;function pe(i){return i===null||typeof i!="object"?null:(i=Q&&i[Q]||i["@@iterator"],typeof i=="function"?i:null)}var T=Object.assign,F;function X(i){if(F===void 0)try{throw Error()}catch(u){var o=u.stack.trim().match(/\n( *(at )?)/);F=o&&o[1]||""}return`
34
- `+F+i}var M=!1;function oe(i,o){if(!i||M)return"";M=!0;var u=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(o)if(o=function(){throw Error()},Object.defineProperty(o.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(o,[])}catch(G){var f=G}Reflect.construct(i,[],o)}else{try{o.call()}catch(G){f=G}i.call(o.prototype)}else{try{throw Error()}catch(G){f=G}i()}}catch(G){if(G&&f&&typeof G.stack=="string"){for(var g=G.stack.split(`
35
- `),x=f.stack.split(`
36
- `),C=g.length-1,L=x.length-1;1<=C&&0<=L&&g[C]!==x[L];)L--;for(;1<=C&&0<=L;C--,L--)if(g[C]!==x[L]){if(C!==1||L!==1)do if(C--,L--,0>L||g[C]!==x[L]){var O=`
37
- `+g[C].replace(" at new "," at ");return i.displayName&&O.includes("<anonymous>")&&(O=O.replace("<anonymous>",i.displayName)),O}while(1<=C&&0<=L);break}}}finally{M=!1,Error.prepareStackTrace=u}return(i=i?i.displayName||i.name:"")?X(i):""}function ue(i){switch(i.tag){case 5:return X(i.type);case 16:return X("Lazy");case 13:return X("Suspense");case 19:return X("SuspenseList");case 0:case 2:case 15:return i=oe(i.type,!1),i;case 11:return i=oe(i.type.render,!1),i;case 1:return i=oe(i.type,!0),i;default:return""}}function ae(i){if(i==null)return null;if(typeof i=="function")return i.displayName||i.name||null;if(typeof i=="string")return i;switch(i){case q:return"Fragment";case N:return"Portal";case D:return"Profiler";case B:return"StrictMode";case he:return"Suspense";case J:return"SuspenseList"}if(typeof i=="object")switch(i.$$typeof){case U:return(i.displayName||"Context")+".Consumer";case I:return(i._context.displayName||"Context")+".Provider";case z:var o=i.render;return i=i.displayName,i||(i=o.displayName||o.name||"",i=i!==""?"ForwardRef("+i+")":"ForwardRef"),i;case Z:return o=i.displayName||null,o!==null?o:ae(i.type)||"Memo";case ve:o=i._payload,i=i._init;try{return ae(i(o))}catch{}}return null}function me(i){var o=i.type;switch(i.tag){case 24:return"Cache";case 9:return(o.displayName||"Context")+".Consumer";case 10:return(o._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return i=o.render,i=i.displayName||i.name||"",o.displayName||(i!==""?"ForwardRef("+i+")":"ForwardRef");case 7:return"Fragment";case 5:return o;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return ae(o);case 8:return o===B?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof o=="function")return o.displayName||o.name||null;if(typeof o=="string")return o}return null}function ke(i){switch(typeof i){case"boolean":case"number":case"string":case"undefined":return i;case"object":return i;default:return""}}function xe(i){var o=i.type;return(i=i.nodeName)&&i.toLowerCase()==="input"&&(o==="checkbox"||o==="radio")}function $e(i){var o=xe(i)?"checked":"value",u=Object.getOwnPropertyDescriptor(i.constructor.prototype,o),f=""+i[o];if(!i.hasOwnProperty(o)&&typeof u<"u"&&typeof u.get=="function"&&typeof u.set=="function"){var g=u.get,x=u.set;return Object.defineProperty(i,o,{configurable:!0,get:function(){return g.call(this)},set:function(C){f=""+C,x.call(this,C)}}),Object.defineProperty(i,o,{enumerable:u.enumerable}),{getValue:function(){return f},setValue:function(C){f=""+C},stopTracking:function(){i._valueTracker=null,delete i[o]}}}}function Fe(i){i._valueTracker||(i._valueTracker=$e(i))}function qe(i){if(!i)return!1;var o=i._valueTracker;if(!o)return!0;var u=o.getValue(),f="";return i&&(f=xe(i)?i.checked?"true":"false":i.value),i=f,i!==u?(o.setValue(i),!0):!1}function st(i){if(i=i||(typeof document<"u"?document:void 0),typeof i>"u")return null;try{return i.activeElement||i.body}catch{return i.body}}function ot(i,o){var u=o.checked;return T({},o,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:u??i._wrapperState.initialChecked})}function Vt(i,o){var u=o.defaultValue==null?"":o.defaultValue,f=o.checked!=null?o.checked:o.defaultChecked;u=ke(o.value!=null?o.value:u),i._wrapperState={initialChecked:f,initialValue:u,controlled:o.type==="checkbox"||o.type==="radio"?o.checked!=null:o.value!=null}}function en(i,o){o=o.checked,o!=null&&_(i,"checked",o,!1)}function et(i,o){en(i,o);var u=ke(o.value),f=o.type;if(u!=null)f==="number"?(u===0&&i.value===""||i.value!=u)&&(i.value=""+u):i.value!==""+u&&(i.value=""+u);else if(f==="submit"||f==="reset"){i.removeAttribute("value");return}o.hasOwnProperty("value")?Tn(i,o.type,u):o.hasOwnProperty("defaultValue")&&Tn(i,o.type,ke(o.defaultValue)),o.checked==null&&o.defaultChecked!=null&&(i.defaultChecked=!!o.defaultChecked)}function Wt(i,o,u){if(o.hasOwnProperty("value")||o.hasOwnProperty("defaultValue")){var f=o.type;if(!(f!=="submit"&&f!=="reset"||o.value!==void 0&&o.value!==null))return;o=""+i._wrapperState.initialValue,u||o===i.value||(i.value=o),i.defaultValue=o}u=i.name,u!==""&&(i.name=""),i.defaultChecked=!!i._wrapperState.initialChecked,u!==""&&(i.name=u)}function Tn(i,o,u){(o!=="number"||st(i.ownerDocument)!==i)&&(u==null?i.defaultValue=""+i._wrapperState.initialValue:i.defaultValue!==""+u&&(i.defaultValue=""+u))}var zt=Array.isArray;function tn(i,o,u,f){if(i=i.options,o){o={};for(var g=0;g<u.length;g++)o["$"+u[g]]=!0;for(u=0;u<i.length;u++)g=o.hasOwnProperty("$"+i[u].value),i[u].selected!==g&&(i[u].selected=g),g&&f&&(i[u].defaultSelected=!0)}else{for(u=""+ke(u),o=null,g=0;g<i.length;g++){if(i[g].value===u){i[g].selected=!0,f&&(i[g].defaultSelected=!0);return}o!==null||i[g].disabled||(o=i[g])}o!==null&&(o.selected=!0)}}function bt(i,o){if(o.dangerouslySetInnerHTML!=null)throw Error(n(91));return T({},o,{value:void 0,defaultValue:void 0,children:""+i._wrapperState.initialValue})}function tr(i,o){var u=o.value;if(u==null){if(u=o.children,o=o.defaultValue,u!=null){if(o!=null)throw Error(n(92));if(zt(u)){if(1<u.length)throw Error(n(93));u=u[0]}o=u}o==null&&(o=""),u=o}i._wrapperState={initialValue:ke(u)}}function He(i,o){var u=ke(o.value),f=ke(o.defaultValue);u!=null&&(u=""+u,u!==i.value&&(i.value=u),o.defaultValue==null&&i.defaultValue!==u&&(i.defaultValue=u)),f!=null&&(i.defaultValue=""+f)}function jr(i){var o=i.textContent;o===i._wrapperState.initialValue&&o!==""&&o!==null&&(i.value=o)}function Y(i){switch(i){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function ee(i,o){return i==null||i==="http://www.w3.org/1999/xhtml"?Y(o):i==="http://www.w3.org/2000/svg"&&o==="foreignObject"?"http://www.w3.org/1999/xhtml":i}var Te,Ae=(function(i){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(o,u,f,g){MSApp.execUnsafeLocalFunction(function(){return i(o,u,f,g)})}:i})(function(i,o){if(i.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in i)i.innerHTML=o;else{for(Te=Te||document.createElement("div"),Te.innerHTML="<svg>"+o.valueOf().toString()+"</svg>",o=Te.firstChild;i.firstChild;)i.removeChild(i.firstChild);for(;o.firstChild;)i.appendChild(o.firstChild)}});function Ve(i,o){if(o){var u=i.firstChild;if(u&&u===i.lastChild&&u.nodeType===3){u.nodeValue=o;return}}i.textContent=o}var at={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},Nt=["Webkit","ms","Moz","O"];Object.keys(at).forEach(function(i){Nt.forEach(function(o){o=o+i.charAt(0).toUpperCase()+i.substring(1),at[o]=at[i]})});function H(i,o,u){return o==null||typeof o=="boolean"||o===""?"":u||typeof o!="number"||o===0||at.hasOwnProperty(i)&&at[i]?(""+o).trim():o+"px"}function ge(i,o){i=i.style;for(var u in o)if(o.hasOwnProperty(u)){var f=u.indexOf("--")===0,g=H(u,o[u],f);u==="float"&&(u="cssFloat"),f?i.setProperty(u,g):i[u]=g}}var ie=T({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function ye(i,o){if(o){if(ie[i]&&(o.children!=null||o.dangerouslySetInnerHTML!=null))throw Error(n(137,i));if(o.dangerouslySetInnerHTML!=null){if(o.children!=null)throw Error(n(60));if(typeof o.dangerouslySetInnerHTML!="object"||!("__html"in o.dangerouslySetInnerHTML))throw Error(n(61))}if(o.style!=null&&typeof o.style!="object")throw Error(n(62))}}function Le(i,o){if(i.indexOf("-")===-1)return typeof o.is=="string";switch(i){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 fe=null;function Ge(i){return i=i.target||i.srcElement||window,i.correspondingUseElement&&(i=i.correspondingUseElement),i.nodeType===3?i.parentNode:i}var wt=null,dt=null,Je=null;function yt(i){if(i=wo(i)){if(typeof wt!="function")throw Error(n(280));var o=i.stateNode;o&&(o=Qa(o),wt(i.stateNode,i.type,o))}}function ht(i){dt?Je?Je.push(i):Je=[i]:dt=i}function qt(){if(dt){var i=dt,o=Je;if(Je=dt=null,yt(i),o)for(i=0;i<o.length;i++)yt(o[i])}}function Tt(i,o){return i(o)}function Ra(){}var Qi=!1;function gi(i,o,u){if(Qi)return i(o,u);Qi=!0;try{return Tt(i,o,u)}finally{Qi=!1,(dt!==null||Je!==null)&&(Ra(),qt())}}function Dr(i,o){var u=i.stateNode;if(u===null)return null;var f=Qa(u);if(f===null)return null;u=f[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":(f=!f.disabled)||(i=i.type,f=!(i==="button"||i==="input"||i==="select"||i==="textarea")),i=!f;break e;default:i=!1}if(i)return null;if(u&&typeof u!="function")throw Error(n(231,o,typeof u));return u}var Ji=!1;if(c)try{var xn={};Object.defineProperty(xn,"passive",{get:function(){Ji=!0}}),window.addEventListener("test",xn,xn),window.removeEventListener("test",xn,xn)}catch{Ji=!1}function Aa(i,o,u,f,g,x,C,L,O){var G=Array.prototype.slice.call(arguments,3);try{o.apply(u,G)}catch(re){this.onError(re)}}var nr=!1,Lt=null,Or=!1,xr=null,Ia={onError:function(i){nr=!0,Lt=i}};function lc(i,o,u,f,g,x,C,L,O){nr=!1,Lt=null,Aa.apply(Ia,arguments)}function Zs(i,o,u,f,g,x,C,L,O){if(lc.apply(this,arguments),nr){if(nr){var G=Lt;nr=!1,Lt=null}else throw Error(n(198));Or||(Or=!0,xr=G)}}function wr(i){var o=i,u=i;if(i.alternate)for(;o.return;)o=o.return;else{i=o;do o=i,(o.flags&4098)!==0&&(u=o.return),i=o.return;while(i)}return o.tag===3?u:null}function Zi(i){if(i.tag===13){var o=i.memoizedState;if(o===null&&(i=i.alternate,i!==null&&(o=i.memoizedState)),o!==null)return o.dehydrated}return null}function eo(i){if(wr(i)!==i)throw Error(n(188))}function K(i){var o=i.alternate;if(!o){if(o=wr(i),o===null)throw Error(n(188));return o!==i?null:i}for(var u=i,f=o;;){var g=u.return;if(g===null)break;var x=g.alternate;if(x===null){if(f=g.return,f!==null){u=f;continue}break}if(g.child===x.child){for(x=g.child;x;){if(x===u)return eo(g),i;if(x===f)return eo(g),o;x=x.sibling}throw Error(n(188))}if(u.return!==f.return)u=g,f=x;else{for(var C=!1,L=g.child;L;){if(L===u){C=!0,u=g,f=x;break}if(L===f){C=!0,f=g,u=x;break}L=L.sibling}if(!C){for(L=x.child;L;){if(L===u){C=!0,u=x,f=g;break}if(L===f){C=!0,f=x,u=g;break}L=L.sibling}if(!C)throw Error(n(189))}}if(u.alternate!==f)throw Error(n(190))}if(u.tag!==3)throw Error(n(188));return u.stateNode.current===u?i:o}function ne(i){return i=K(i),i!==null?ce(i):null}function ce(i){if(i.tag===5||i.tag===6)return i;for(i=i.child;i!==null;){var o=ce(i);if(o!==null)return o;i=i.sibling}return null}var Oe=t.unstable_scheduleCallback,pt=t.unstable_cancelCallback,Rt=t.unstable_shouldYield,Rn=t.unstable_requestPaint,Qe=t.unstable_now,Gt=t.unstable_getCurrentPriorityLevel,cn=t.unstable_ImmediatePriority,St=t.unstable_UserBlockingPriority,Bn=t.unstable_NormalPriority,nb=t.unstable_LowPriority,wm=t.unstable_IdlePriority,Ma=null,rr=null;function rb(i){if(rr&&typeof rr.onCommitFiberRoot=="function")try{rr.onCommitFiberRoot(Ma,i,void 0,(i.current.flags&128)===128)}catch{}}var Un=Math.clz32?Math.clz32:ob,ib=Math.log,sb=Math.LN2;function ob(i){return i>>>=0,i===0?32:31-(ib(i)/sb|0)|0}var Na=64,La=4194304;function to(i){switch(i&-i){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:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return i&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return i&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return i}}function ja(i,o){var u=i.pendingLanes;if(u===0)return 0;var f=0,g=i.suspendedLanes,x=i.pingedLanes,C=u&268435455;if(C!==0){var L=C&~g;L!==0?f=to(L):(x&=C,x!==0&&(f=to(x)))}else C=u&~g,C!==0?f=to(C):x!==0&&(f=to(x));if(f===0)return 0;if(o!==0&&o!==f&&(o&g)===0&&(g=f&-f,x=o&-o,g>=x||g===16&&(x&4194240)!==0))return o;if((f&4)!==0&&(f|=u&16),o=i.entangledLanes,o!==0)for(i=i.entanglements,o&=f;0<o;)u=31-Un(o),g=1<<u,f|=i[u],o&=~g;return f}function ab(i,o){switch(i){case 1:case 2:case 4:return o+250;case 8:case 16:case 32:case 64: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:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function lb(i,o){for(var u=i.suspendedLanes,f=i.pingedLanes,g=i.expirationTimes,x=i.pendingLanes;0<x;){var C=31-Un(x),L=1<<C,O=g[C];O===-1?((L&u)===0||(L&f)!==0)&&(g[C]=ab(L,o)):O<=o&&(i.expiredLanes|=L),x&=~L}}function uc(i){return i=i.pendingLanes&-1073741825,i!==0?i:i&1073741824?1073741824:0}function Sm(){var i=Na;return Na<<=1,(Na&4194240)===0&&(Na=64),i}function cc(i){for(var o=[],u=0;31>u;u++)o.push(i);return o}function no(i,o,u){i.pendingLanes|=o,o!==536870912&&(i.suspendedLanes=0,i.pingedLanes=0),i=i.eventTimes,o=31-Un(o),i[o]=u}function ub(i,o){var u=i.pendingLanes&~o;i.pendingLanes=o,i.suspendedLanes=0,i.pingedLanes=0,i.expiredLanes&=o,i.mutableReadLanes&=o,i.entangledLanes&=o,o=i.entanglements;var f=i.eventTimes;for(i=i.expirationTimes;0<u;){var g=31-Un(u),x=1<<g;o[g]=0,f[g]=-1,i[g]=-1,u&=~x}}function dc(i,o){var u=i.entangledLanes|=o;for(i=i.entanglements;u;){var f=31-Un(u),g=1<<f;g&o|i[f]&o&&(i[f]|=o),u&=~g}}var Ze=0;function km(i){return i&=-i,1<i?4<i?(i&268435455)!==0?16:536870912:4:1}var Cm,fc,bm,Em,_m,hc=!1,Da=[],Fr=null,Vr=null,zr=null,ro=new Map,io=new Map,Br=[],cb="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 submit".split(" ");function Pm(i,o){switch(i){case"focusin":case"focusout":Fr=null;break;case"dragenter":case"dragleave":Vr=null;break;case"mouseover":case"mouseout":zr=null;break;case"pointerover":case"pointerout":ro.delete(o.pointerId);break;case"gotpointercapture":case"lostpointercapture":io.delete(o.pointerId)}}function so(i,o,u,f,g,x){return i===null||i.nativeEvent!==x?(i={blockedOn:o,domEventName:u,eventSystemFlags:f,nativeEvent:x,targetContainers:[g]},o!==null&&(o=wo(o),o!==null&&fc(o)),i):(i.eventSystemFlags|=f,o=i.targetContainers,g!==null&&o.indexOf(g)===-1&&o.push(g),i)}function db(i,o,u,f,g){switch(o){case"focusin":return Fr=so(Fr,i,o,u,f,g),!0;case"dragenter":return Vr=so(Vr,i,o,u,f,g),!0;case"mouseover":return zr=so(zr,i,o,u,f,g),!0;case"pointerover":var x=g.pointerId;return ro.set(x,so(ro.get(x)||null,i,o,u,f,g)),!0;case"gotpointercapture":return x=g.pointerId,io.set(x,so(io.get(x)||null,i,o,u,f,g)),!0}return!1}function Tm(i){var o=yi(i.target);if(o!==null){var u=wr(o);if(u!==null){if(o=u.tag,o===13){if(o=Zi(u),o!==null){i.blockedOn=o,_m(i.priority,function(){bm(u)});return}}else if(o===3&&u.stateNode.current.memoizedState.isDehydrated){i.blockedOn=u.tag===3?u.stateNode.containerInfo:null;return}}}i.blockedOn=null}function Oa(i){if(i.blockedOn!==null)return!1;for(var o=i.targetContainers;0<o.length;){var u=mc(i.domEventName,i.eventSystemFlags,o[0],i.nativeEvent);if(u===null){u=i.nativeEvent;var f=new u.constructor(u.type,u);fe=f,u.target.dispatchEvent(f),fe=null}else return o=wo(u),o!==null&&fc(o),i.blockedOn=u,!1;o.shift()}return!0}function Rm(i,o,u){Oa(i)&&u.delete(o)}function fb(){hc=!1,Fr!==null&&Oa(Fr)&&(Fr=null),Vr!==null&&Oa(Vr)&&(Vr=null),zr!==null&&Oa(zr)&&(zr=null),ro.forEach(Rm),io.forEach(Rm)}function oo(i,o){i.blockedOn===o&&(i.blockedOn=null,hc||(hc=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,fb)))}function ao(i){function o(g){return oo(g,i)}if(0<Da.length){oo(Da[0],i);for(var u=1;u<Da.length;u++){var f=Da[u];f.blockedOn===i&&(f.blockedOn=null)}}for(Fr!==null&&oo(Fr,i),Vr!==null&&oo(Vr,i),zr!==null&&oo(zr,i),ro.forEach(o),io.forEach(o),u=0;u<Br.length;u++)f=Br[u],f.blockedOn===i&&(f.blockedOn=null);for(;0<Br.length&&(u=Br[0],u.blockedOn===null);)Tm(u),u.blockedOn===null&&Br.shift()}var es=j.ReactCurrentBatchConfig,Fa=!0;function hb(i,o,u,f){var g=Ze,x=es.transition;es.transition=null;try{Ze=1,pc(i,o,u,f)}finally{Ze=g,es.transition=x}}function pb(i,o,u,f){var g=Ze,x=es.transition;es.transition=null;try{Ze=4,pc(i,o,u,f)}finally{Ze=g,es.transition=x}}function pc(i,o,u,f){if(Fa){var g=mc(i,o,u,f);if(g===null)Mc(i,o,f,Va,u),Pm(i,f);else if(db(g,i,o,u,f))f.stopPropagation();else if(Pm(i,f),o&4&&-1<cb.indexOf(i)){for(;g!==null;){var x=wo(g);if(x!==null&&Cm(x),x=mc(i,o,u,f),x===null&&Mc(i,o,f,Va,u),x===g)break;g=x}g!==null&&f.stopPropagation()}else Mc(i,o,f,null,u)}}var Va=null;function mc(i,o,u,f){if(Va=null,i=Ge(f),i=yi(i),i!==null)if(o=wr(i),o===null)i=null;else if(u=o.tag,u===13){if(i=Zi(o),i!==null)return i;i=null}else if(u===3){if(o.stateNode.current.memoizedState.isDehydrated)return o.tag===3?o.stateNode.containerInfo:null;i=null}else o!==i&&(i=null);return Va=i,null}function Am(i){switch(i){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"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 1;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"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(Gt()){case cn:return 1;case St:return 4;case Bn:case nb:return 16;case wm:return 536870912;default:return 16}default:return 16}}var Ur=null,gc=null,za=null;function Im(){if(za)return za;var i,o=gc,u=o.length,f,g="value"in Ur?Ur.value:Ur.textContent,x=g.length;for(i=0;i<u&&o[i]===g[i];i++);var C=u-i;for(f=1;f<=C&&o[u-f]===g[x-f];f++);return za=g.slice(i,1<f?1-f:void 0)}function Ba(i){var o=i.keyCode;return"charCode"in i?(i=i.charCode,i===0&&o===13&&(i=13)):i=o,i===10&&(i=13),32<=i||i===13?i:0}function Ua(){return!0}function Mm(){return!1}function wn(i){function o(u,f,g,x,C){this._reactName=u,this._targetInst=g,this.type=f,this.nativeEvent=x,this.target=C,this.currentTarget=null;for(var L in i)i.hasOwnProperty(L)&&(u=i[L],this[L]=u?u(x):x[L]);return this.isDefaultPrevented=(x.defaultPrevented!=null?x.defaultPrevented:x.returnValue===!1)?Ua:Mm,this.isPropagationStopped=Mm,this}return T(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=Ua)},stopPropagation:function(){var u=this.nativeEvent;u&&(u.stopPropagation?u.stopPropagation():typeof u.cancelBubble!="unknown"&&(u.cancelBubble=!0),this.isPropagationStopped=Ua)},persist:function(){},isPersistent:Ua}),o}var ts={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(i){return i.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},yc=wn(ts),lo=T({},ts,{view:0,detail:0}),mb=wn(lo),vc,xc,uo,$a=T({},lo,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Sc,button:0,buttons:0,relatedTarget:function(i){return i.relatedTarget===void 0?i.fromElement===i.srcElement?i.toElement:i.fromElement:i.relatedTarget},movementX:function(i){return"movementX"in i?i.movementX:(i!==uo&&(uo&&i.type==="mousemove"?(vc=i.screenX-uo.screenX,xc=i.screenY-uo.screenY):xc=vc=0,uo=i),vc)},movementY:function(i){return"movementY"in i?i.movementY:xc}}),Nm=wn($a),gb=T({},$a,{dataTransfer:0}),yb=wn(gb),vb=T({},lo,{relatedTarget:0}),wc=wn(vb),xb=T({},ts,{animationName:0,elapsedTime:0,pseudoElement:0}),wb=wn(xb),Sb=T({},ts,{clipboardData:function(i){return"clipboardData"in i?i.clipboardData:window.clipboardData}}),kb=wn(Sb),Cb=T({},ts,{data:0}),Lm=wn(Cb),bb={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Eb={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"},_b={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Pb(i){var o=this.nativeEvent;return o.getModifierState?o.getModifierState(i):(i=_b[i])?!!o[i]:!1}function Sc(){return Pb}var Tb=T({},lo,{key:function(i){if(i.key){var o=bb[i.key]||i.key;if(o!=="Unidentified")return o}return i.type==="keypress"?(i=Ba(i),i===13?"Enter":String.fromCharCode(i)):i.type==="keydown"||i.type==="keyup"?Eb[i.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Sc,charCode:function(i){return i.type==="keypress"?Ba(i):0},keyCode:function(i){return i.type==="keydown"||i.type==="keyup"?i.keyCode:0},which:function(i){return i.type==="keypress"?Ba(i):i.type==="keydown"||i.type==="keyup"?i.keyCode:0}}),Rb=wn(Tb),Ab=T({},$a,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),jm=wn(Ab),Ib=T({},lo,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Sc}),Mb=wn(Ib),Nb=T({},ts,{propertyName:0,elapsedTime:0,pseudoElement:0}),Lb=wn(Nb),jb=T({},$a,{deltaX:function(i){return"deltaX"in i?i.deltaX:"wheelDeltaX"in i?-i.wheelDeltaX:0},deltaY:function(i){return"deltaY"in i?i.deltaY:"wheelDeltaY"in i?-i.wheelDeltaY:"wheelDelta"in i?-i.wheelDelta:0},deltaZ:0,deltaMode:0}),Db=wn(jb),Ob=[9,13,27,32],kc=c&&"CompositionEvent"in window,co=null;c&&"documentMode"in document&&(co=document.documentMode);var Fb=c&&"TextEvent"in window&&!co,Dm=c&&(!kc||co&&8<co&&11>=co),Om=" ",Fm=!1;function Vm(i,o){switch(i){case"keyup":return Ob.indexOf(o.keyCode)!==-1;case"keydown":return o.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function zm(i){return i=i.detail,typeof i=="object"&&"data"in i?i.data:null}var ns=!1;function Vb(i,o){switch(i){case"compositionend":return zm(o);case"keypress":return o.which!==32?null:(Fm=!0,Om);case"textInput":return i=o.data,i===Om&&Fm?null:i;default:return null}}function zb(i,o){if(ns)return i==="compositionend"||!kc&&Vm(i,o)?(i=Im(),za=gc=Ur=null,ns=!1,i):null;switch(i){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 Dm&&o.locale!=="ko"?null:o.data;default:return null}}var Bb={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 Bm(i){var o=i&&i.nodeName&&i.nodeName.toLowerCase();return o==="input"?!!Bb[i.type]:o==="textarea"}function Um(i,o,u,f){ht(f),o=Ka(o,"onChange"),0<o.length&&(u=new yc("onChange","change",null,u,f),i.push({event:u,listeners:o}))}var fo=null,ho=null;function Ub(i){og(i,0)}function Ha(i){var o=as(i);if(qe(o))return i}function $b(i,o){if(i==="change")return o}var $m=!1;if(c){var Cc;if(c){var bc="oninput"in document;if(!bc){var Hm=document.createElement("div");Hm.setAttribute("oninput","return;"),bc=typeof Hm.oninput=="function"}Cc=bc}else Cc=!1;$m=Cc&&(!document.documentMode||9<document.documentMode)}function Wm(){fo&&(fo.detachEvent("onpropertychange",qm),ho=fo=null)}function qm(i){if(i.propertyName==="value"&&Ha(ho)){var o=[];Um(o,ho,i,Ge(i)),gi(Ub,o)}}function Hb(i,o,u){i==="focusin"?(Wm(),fo=o,ho=u,fo.attachEvent("onpropertychange",qm)):i==="focusout"&&Wm()}function Wb(i){if(i==="selectionchange"||i==="keyup"||i==="keydown")return Ha(ho)}function qb(i,o){if(i==="click")return Ha(o)}function Gb(i,o){if(i==="input"||i==="change")return Ha(o)}function Kb(i,o){return i===o&&(i!==0||1/i===1/o)||i!==i&&o!==o}var $n=typeof Object.is=="function"?Object.is:Kb;function po(i,o){if($n(i,o))return!0;if(typeof i!="object"||i===null||typeof o!="object"||o===null)return!1;var u=Object.keys(i),f=Object.keys(o);if(u.length!==f.length)return!1;for(f=0;f<u.length;f++){var g=u[f];if(!d.call(o,g)||!$n(i[g],o[g]))return!1}return!0}function Gm(i){for(;i&&i.firstChild;)i=i.firstChild;return i}function Km(i,o){var u=Gm(i);i=0;for(var f;u;){if(u.nodeType===3){if(f=i+u.textContent.length,i<=o&&f>=o)return{node:u,offset:o-i};i=f}e:{for(;u;){if(u.nextSibling){u=u.nextSibling;break e}u=u.parentNode}u=void 0}u=Gm(u)}}function Xm(i,o){return i&&o?i===o?!0:i&&i.nodeType===3?!1:o&&o.nodeType===3?Xm(i,o.parentNode):"contains"in i?i.contains(o):i.compareDocumentPosition?!!(i.compareDocumentPosition(o)&16):!1:!1}function Ym(){for(var i=window,o=st();o instanceof i.HTMLIFrameElement;){try{var u=typeof o.contentWindow.location.href=="string"}catch{u=!1}if(u)i=o.contentWindow;else break;o=st(i.document)}return o}function Ec(i){var o=i&&i.nodeName&&i.nodeName.toLowerCase();return o&&(o==="input"&&(i.type==="text"||i.type==="search"||i.type==="tel"||i.type==="url"||i.type==="password")||o==="textarea"||i.contentEditable==="true")}function Xb(i){var o=Ym(),u=i.focusedElem,f=i.selectionRange;if(o!==u&&u&&u.ownerDocument&&Xm(u.ownerDocument.documentElement,u)){if(f!==null&&Ec(u)){if(o=f.start,i=f.end,i===void 0&&(i=o),"selectionStart"in u)u.selectionStart=o,u.selectionEnd=Math.min(i,u.value.length);else if(i=(o=u.ownerDocument||document)&&o.defaultView||window,i.getSelection){i=i.getSelection();var g=u.textContent.length,x=Math.min(f.start,g);f=f.end===void 0?x:Math.min(f.end,g),!i.extend&&x>f&&(g=f,f=x,x=g),g=Km(u,x);var C=Km(u,f);g&&C&&(i.rangeCount!==1||i.anchorNode!==g.node||i.anchorOffset!==g.offset||i.focusNode!==C.node||i.focusOffset!==C.offset)&&(o=o.createRange(),o.setStart(g.node,g.offset),i.removeAllRanges(),x>f?(i.addRange(o),i.extend(C.node,C.offset)):(o.setEnd(C.node,C.offset),i.addRange(o)))}}for(o=[],i=u;i=i.parentNode;)i.nodeType===1&&o.push({element:i,left:i.scrollLeft,top:i.scrollTop});for(typeof u.focus=="function"&&u.focus(),u=0;u<o.length;u++)i=o[u],i.element.scrollLeft=i.left,i.element.scrollTop=i.top}}var Yb=c&&"documentMode"in document&&11>=document.documentMode,rs=null,_c=null,mo=null,Pc=!1;function Qm(i,o,u){var f=u.window===u?u.document:u.nodeType===9?u:u.ownerDocument;Pc||rs==null||rs!==st(f)||(f=rs,"selectionStart"in f&&Ec(f)?f={start:f.selectionStart,end:f.selectionEnd}:(f=(f.ownerDocument&&f.ownerDocument.defaultView||window).getSelection(),f={anchorNode:f.anchorNode,anchorOffset:f.anchorOffset,focusNode:f.focusNode,focusOffset:f.focusOffset}),mo&&po(mo,f)||(mo=f,f=Ka(_c,"onSelect"),0<f.length&&(o=new yc("onSelect","select",null,o,u),i.push({event:o,listeners:f}),o.target=rs)))}function Wa(i,o){var u={};return u[i.toLowerCase()]=o.toLowerCase(),u["Webkit"+i]="webkit"+o,u["Moz"+i]="moz"+o,u}var is={animationend:Wa("Animation","AnimationEnd"),animationiteration:Wa("Animation","AnimationIteration"),animationstart:Wa("Animation","AnimationStart"),transitionend:Wa("Transition","TransitionEnd")},Tc={},Jm={};c&&(Jm=document.createElement("div").style,"AnimationEvent"in window||(delete is.animationend.animation,delete is.animationiteration.animation,delete is.animationstart.animation),"TransitionEvent"in window||delete is.transitionend.transition);function qa(i){if(Tc[i])return Tc[i];if(!is[i])return i;var o=is[i],u;for(u in o)if(o.hasOwnProperty(u)&&u in Jm)return Tc[i]=o[u];return i}var Zm=qa("animationend"),eg=qa("animationiteration"),tg=qa("animationstart"),ng=qa("transitionend"),rg=new Map,ig="abort auxClick 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(" ");function $r(i,o){rg.set(i,o),a(o,[i])}for(var Rc=0;Rc<ig.length;Rc++){var Ac=ig[Rc],Qb=Ac.toLowerCase(),Jb=Ac[0].toUpperCase()+Ac.slice(1);$r(Qb,"on"+Jb)}$r(Zm,"onAnimationEnd"),$r(eg,"onAnimationIteration"),$r(tg,"onAnimationStart"),$r("dblclick","onDoubleClick"),$r("focusin","onFocus"),$r("focusout","onBlur"),$r(ng,"onTransitionEnd"),l("onMouseEnter",["mouseout","mouseover"]),l("onMouseLeave",["mouseout","mouseover"]),l("onPointerEnter",["pointerout","pointerover"]),l("onPointerLeave",["pointerout","pointerover"]),a("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),a("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),a("onBeforeInput",["compositionend","keypress","textInput","paste"]),a("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),a("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),a("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var go="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(" "),Zb=new Set("cancel close invalid load scroll toggle".split(" ").concat(go));function sg(i,o,u){var f=i.type||"unknown-event";i.currentTarget=u,Zs(f,o,void 0,i),i.currentTarget=null}function og(i,o){o=(o&4)!==0;for(var u=0;u<i.length;u++){var f=i[u],g=f.event;f=f.listeners;e:{var x=void 0;if(o)for(var C=f.length-1;0<=C;C--){var L=f[C],O=L.instance,G=L.currentTarget;if(L=L.listener,O!==x&&g.isPropagationStopped())break e;sg(g,L,G),x=O}else for(C=0;C<f.length;C++){if(L=f[C],O=L.instance,G=L.currentTarget,L=L.listener,O!==x&&g.isPropagationStopped())break e;sg(g,L,G),x=O}}}if(Or)throw i=xr,Or=!1,xr=null,i}function ut(i,o){var u=o[Fc];u===void 0&&(u=o[Fc]=new Set);var f=i+"__bubble";u.has(f)||(ag(o,i,2,!1),u.add(f))}function Ic(i,o,u){var f=0;o&&(f|=4),ag(u,i,f,o)}var Ga="_reactListening"+Math.random().toString(36).slice(2);function yo(i){if(!i[Ga]){i[Ga]=!0,r.forEach(function(u){u!=="selectionchange"&&(Zb.has(u)||Ic(u,!1,i),Ic(u,!0,i))});var o=i.nodeType===9?i:i.ownerDocument;o===null||o[Ga]||(o[Ga]=!0,Ic("selectionchange",!1,o))}}function ag(i,o,u,f){switch(Am(o)){case 1:var g=hb;break;case 4:g=pb;break;default:g=pc}u=g.bind(null,o,u,i),g=void 0,!Ji||o!=="touchstart"&&o!=="touchmove"&&o!=="wheel"||(g=!0),f?g!==void 0?i.addEventListener(o,u,{capture:!0,passive:g}):i.addEventListener(o,u,!0):g!==void 0?i.addEventListener(o,u,{passive:g}):i.addEventListener(o,u,!1)}function Mc(i,o,u,f,g){var x=f;if((o&1)===0&&(o&2)===0&&f!==null)e:for(;;){if(f===null)return;var C=f.tag;if(C===3||C===4){var L=f.stateNode.containerInfo;if(L===g||L.nodeType===8&&L.parentNode===g)break;if(C===4)for(C=f.return;C!==null;){var O=C.tag;if((O===3||O===4)&&(O=C.stateNode.containerInfo,O===g||O.nodeType===8&&O.parentNode===g))return;C=C.return}for(;L!==null;){if(C=yi(L),C===null)return;if(O=C.tag,O===5||O===6){f=x=C;continue e}L=L.parentNode}}f=f.return}gi(function(){var G=x,re=Ge(u),se=[];e:{var te=rg.get(i);if(te!==void 0){var we=yc,Ee=i;switch(i){case"keypress":if(Ba(u)===0)break e;case"keydown":case"keyup":we=Rb;break;case"focusin":Ee="focus",we=wc;break;case"focusout":Ee="blur",we=wc;break;case"beforeblur":case"afterblur":we=wc;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":we=Nm;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":we=yb;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":we=Mb;break;case Zm:case eg:case tg:we=wb;break;case ng:we=Lb;break;case"scroll":we=mb;break;case"wheel":we=Db;break;case"copy":case"cut":case"paste":we=kb;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":we=jm}var Pe=(o&4)!==0,kt=!Pe&&i==="scroll",$=Pe?te!==null?te+"Capture":null:te;Pe=[];for(var V=G,W;V!==null;){W=V;var de=W.stateNode;if(W.tag===5&&de!==null&&(W=de,$!==null&&(de=Dr(V,$),de!=null&&Pe.push(vo(V,de,W)))),kt)break;V=V.return}0<Pe.length&&(te=new we(te,Ee,null,u,re),se.push({event:te,listeners:Pe}))}}if((o&7)===0){e:{if(te=i==="mouseover"||i==="pointerover",we=i==="mouseout"||i==="pointerout",te&&u!==fe&&(Ee=u.relatedTarget||u.fromElement)&&(yi(Ee)||Ee[Sr]))break e;if((we||te)&&(te=re.window===re?re:(te=re.ownerDocument)?te.defaultView||te.parentWindow:window,we?(Ee=u.relatedTarget||u.toElement,we=G,Ee=Ee?yi(Ee):null,Ee!==null&&(kt=wr(Ee),Ee!==kt||Ee.tag!==5&&Ee.tag!==6)&&(Ee=null)):(we=null,Ee=G),we!==Ee)){if(Pe=Nm,de="onMouseLeave",$="onMouseEnter",V="mouse",(i==="pointerout"||i==="pointerover")&&(Pe=jm,de="onPointerLeave",$="onPointerEnter",V="pointer"),kt=we==null?te:as(we),W=Ee==null?te:as(Ee),te=new Pe(de,V+"leave",we,u,re),te.target=kt,te.relatedTarget=W,de=null,yi(re)===G&&(Pe=new Pe($,V+"enter",Ee,u,re),Pe.target=W,Pe.relatedTarget=kt,de=Pe),kt=de,we&&Ee)t:{for(Pe=we,$=Ee,V=0,W=Pe;W;W=ss(W))V++;for(W=0,de=$;de;de=ss(de))W++;for(;0<V-W;)Pe=ss(Pe),V--;for(;0<W-V;)$=ss($),W--;for(;V--;){if(Pe===$||$!==null&&Pe===$.alternate)break t;Pe=ss(Pe),$=ss($)}Pe=null}else Pe=null;we!==null&&lg(se,te,we,Pe,!1),Ee!==null&&kt!==null&&lg(se,kt,Ee,Pe,!0)}}e:{if(te=G?as(G):window,we=te.nodeName&&te.nodeName.toLowerCase(),we==="select"||we==="input"&&te.type==="file")var Re=$b;else if(Bm(te))if($m)Re=Gb;else{Re=Wb;var Ie=Hb}else(we=te.nodeName)&&we.toLowerCase()==="input"&&(te.type==="checkbox"||te.type==="radio")&&(Re=qb);if(Re&&(Re=Re(i,G))){Um(se,Re,u,re);break e}Ie&&Ie(i,te,G),i==="focusout"&&(Ie=te._wrapperState)&&Ie.controlled&&te.type==="number"&&Tn(te,"number",te.value)}switch(Ie=G?as(G):window,i){case"focusin":(Bm(Ie)||Ie.contentEditable==="true")&&(rs=Ie,_c=G,mo=null);break;case"focusout":mo=_c=rs=null;break;case"mousedown":Pc=!0;break;case"contextmenu":case"mouseup":case"dragend":Pc=!1,Qm(se,u,re);break;case"selectionchange":if(Yb)break;case"keydown":case"keyup":Qm(se,u,re)}var Me;if(kc)e:{switch(i){case"compositionstart":var je="onCompositionStart";break e;case"compositionend":je="onCompositionEnd";break e;case"compositionupdate":je="onCompositionUpdate";break e}je=void 0}else ns?Vm(i,u)&&(je="onCompositionEnd"):i==="keydown"&&u.keyCode===229&&(je="onCompositionStart");je&&(Dm&&u.locale!=="ko"&&(ns||je!=="onCompositionStart"?je==="onCompositionEnd"&&ns&&(Me=Im()):(Ur=re,gc="value"in Ur?Ur.value:Ur.textContent,ns=!0)),Ie=Ka(G,je),0<Ie.length&&(je=new Lm(je,i,null,u,re),se.push({event:je,listeners:Ie}),Me?je.data=Me:(Me=zm(u),Me!==null&&(je.data=Me)))),(Me=Fb?Vb(i,u):zb(i,u))&&(G=Ka(G,"onBeforeInput"),0<G.length&&(re=new Lm("onBeforeInput","beforeinput",null,u,re),se.push({event:re,listeners:G}),re.data=Me))}og(se,o)})}function vo(i,o,u){return{instance:i,listener:o,currentTarget:u}}function Ka(i,o){for(var u=o+"Capture",f=[];i!==null;){var g=i,x=g.stateNode;g.tag===5&&x!==null&&(g=x,x=Dr(i,u),x!=null&&f.unshift(vo(i,x,g)),x=Dr(i,o),x!=null&&f.push(vo(i,x,g))),i=i.return}return f}function ss(i){if(i===null)return null;do i=i.return;while(i&&i.tag!==5);return i||null}function lg(i,o,u,f,g){for(var x=o._reactName,C=[];u!==null&&u!==f;){var L=u,O=L.alternate,G=L.stateNode;if(O!==null&&O===f)break;L.tag===5&&G!==null&&(L=G,g?(O=Dr(u,x),O!=null&&C.unshift(vo(u,O,L))):g||(O=Dr(u,x),O!=null&&C.push(vo(u,O,L)))),u=u.return}C.length!==0&&i.push({event:o,listeners:C})}var eE=/\r\n?/g,tE=/\u0000|\uFFFD/g;function ug(i){return(typeof i=="string"?i:""+i).replace(eE,`
38
- `).replace(tE,"")}function Xa(i,o,u){if(o=ug(o),ug(i)!==o&&u)throw Error(n(425))}function Ya(){}var Nc=null,Lc=null;function jc(i,o){return i==="textarea"||i==="noscript"||typeof o.children=="string"||typeof o.children=="number"||typeof o.dangerouslySetInnerHTML=="object"&&o.dangerouslySetInnerHTML!==null&&o.dangerouslySetInnerHTML.__html!=null}var Dc=typeof setTimeout=="function"?setTimeout:void 0,nE=typeof clearTimeout=="function"?clearTimeout:void 0,cg=typeof Promise=="function"?Promise:void 0,rE=typeof queueMicrotask=="function"?queueMicrotask:typeof cg<"u"?function(i){return cg.resolve(null).then(i).catch(iE)}:Dc;function iE(i){setTimeout(function(){throw i})}function Oc(i,o){var u=o,f=0;do{var g=u.nextSibling;if(i.removeChild(u),g&&g.nodeType===8)if(u=g.data,u==="/$"){if(f===0){i.removeChild(g),ao(o);return}f--}else u!=="$"&&u!=="$?"&&u!=="$!"||f++;u=g}while(u);ao(o)}function Hr(i){for(;i!=null;i=i.nextSibling){var o=i.nodeType;if(o===1||o===3)break;if(o===8){if(o=i.data,o==="$"||o==="$!"||o==="$?")break;if(o==="/$")return null}}return i}function dg(i){i=i.previousSibling;for(var o=0;i;){if(i.nodeType===8){var u=i.data;if(u==="$"||u==="$!"||u==="$?"){if(o===0)return i;o--}else u==="/$"&&o++}i=i.previousSibling}return null}var os=Math.random().toString(36).slice(2),ir="__reactFiber$"+os,xo="__reactProps$"+os,Sr="__reactContainer$"+os,Fc="__reactEvents$"+os,sE="__reactListeners$"+os,oE="__reactHandles$"+os;function yi(i){var o=i[ir];if(o)return o;for(var u=i.parentNode;u;){if(o=u[Sr]||u[ir]){if(u=o.alternate,o.child!==null||u!==null&&u.child!==null)for(i=dg(i);i!==null;){if(u=i[ir])return u;i=dg(i)}return o}i=u,u=i.parentNode}return null}function wo(i){return i=i[ir]||i[Sr],!i||i.tag!==5&&i.tag!==6&&i.tag!==13&&i.tag!==3?null:i}function as(i){if(i.tag===5||i.tag===6)return i.stateNode;throw Error(n(33))}function Qa(i){return i[xo]||null}var Vc=[],ls=-1;function Wr(i){return{current:i}}function ct(i){0>ls||(i.current=Vc[ls],Vc[ls]=null,ls--)}function lt(i,o){ls++,Vc[ls]=i.current,i.current=o}var qr={},Kt=Wr(qr),dn=Wr(!1),vi=qr;function us(i,o){var u=i.type.contextTypes;if(!u)return qr;var f=i.stateNode;if(f&&f.__reactInternalMemoizedUnmaskedChildContext===o)return f.__reactInternalMemoizedMaskedChildContext;var g={},x;for(x in u)g[x]=o[x];return f&&(i=i.stateNode,i.__reactInternalMemoizedUnmaskedChildContext=o,i.__reactInternalMemoizedMaskedChildContext=g),g}function fn(i){return i=i.childContextTypes,i!=null}function Ja(){ct(dn),ct(Kt)}function fg(i,o,u){if(Kt.current!==qr)throw Error(n(168));lt(Kt,o),lt(dn,u)}function hg(i,o,u){var f=i.stateNode;if(o=o.childContextTypes,typeof f.getChildContext!="function")return u;f=f.getChildContext();for(var g in f)if(!(g in o))throw Error(n(108,me(i)||"Unknown",g));return T({},u,f)}function Za(i){return i=(i=i.stateNode)&&i.__reactInternalMemoizedMergedChildContext||qr,vi=Kt.current,lt(Kt,i),lt(dn,dn.current),!0}function pg(i,o,u){var f=i.stateNode;if(!f)throw Error(n(169));u?(i=hg(i,o,vi),f.__reactInternalMemoizedMergedChildContext=i,ct(dn),ct(Kt),lt(Kt,i)):ct(dn),lt(dn,u)}var kr=null,el=!1,zc=!1;function mg(i){kr===null?kr=[i]:kr.push(i)}function aE(i){el=!0,mg(i)}function Gr(){if(!zc&&kr!==null){zc=!0;var i=0,o=Ze;try{var u=kr;for(Ze=1;i<u.length;i++){var f=u[i];do f=f(!0);while(f!==null)}kr=null,el=!1}catch(g){throw kr!==null&&(kr=kr.slice(i+1)),Oe(cn,Gr),g}finally{Ze=o,zc=!1}}return null}var cs=[],ds=0,tl=null,nl=0,An=[],In=0,xi=null,Cr=1,br="";function wi(i,o){cs[ds++]=nl,cs[ds++]=tl,tl=i,nl=o}function gg(i,o,u){An[In++]=Cr,An[In++]=br,An[In++]=xi,xi=i;var f=Cr;i=br;var g=32-Un(f)-1;f&=~(1<<g),u+=1;var x=32-Un(o)+g;if(30<x){var C=g-g%5;x=(f&(1<<C)-1).toString(32),f>>=C,g-=C,Cr=1<<32-Un(o)+g|u<<g|f,br=x+i}else Cr=1<<x|u<<g|f,br=i}function Bc(i){i.return!==null&&(wi(i,1),gg(i,1,0))}function Uc(i){for(;i===tl;)tl=cs[--ds],cs[ds]=null,nl=cs[--ds],cs[ds]=null;for(;i===xi;)xi=An[--In],An[In]=null,br=An[--In],An[In]=null,Cr=An[--In],An[In]=null}var Sn=null,kn=null,ft=!1,Hn=null;function yg(i,o){var u=jn(5,null,null,0);u.elementType="DELETED",u.stateNode=o,u.return=i,o=i.deletions,o===null?(i.deletions=[u],i.flags|=16):o.push(u)}function vg(i,o){switch(i.tag){case 5:var u=i.type;return o=o.nodeType!==1||u.toLowerCase()!==o.nodeName.toLowerCase()?null:o,o!==null?(i.stateNode=o,Sn=i,kn=Hr(o.firstChild),!0):!1;case 6:return o=i.pendingProps===""||o.nodeType!==3?null:o,o!==null?(i.stateNode=o,Sn=i,kn=null,!0):!1;case 13:return o=o.nodeType!==8?null:o,o!==null?(u=xi!==null?{id:Cr,overflow:br}:null,i.memoizedState={dehydrated:o,treeContext:u,retryLane:1073741824},u=jn(18,null,null,0),u.stateNode=o,u.return=i,i.child=u,Sn=i,kn=null,!0):!1;default:return!1}}function $c(i){return(i.mode&1)!==0&&(i.flags&128)===0}function Hc(i){if(ft){var o=kn;if(o){var u=o;if(!vg(i,o)){if($c(i))throw Error(n(418));o=Hr(u.nextSibling);var f=Sn;o&&vg(i,o)?yg(f,u):(i.flags=i.flags&-4097|2,ft=!1,Sn=i)}}else{if($c(i))throw Error(n(418));i.flags=i.flags&-4097|2,ft=!1,Sn=i}}}function xg(i){for(i=i.return;i!==null&&i.tag!==5&&i.tag!==3&&i.tag!==13;)i=i.return;Sn=i}function rl(i){if(i!==Sn)return!1;if(!ft)return xg(i),ft=!0,!1;var o;if((o=i.tag!==3)&&!(o=i.tag!==5)&&(o=i.type,o=o!=="head"&&o!=="body"&&!jc(i.type,i.memoizedProps)),o&&(o=kn)){if($c(i))throw wg(),Error(n(418));for(;o;)yg(i,o),o=Hr(o.nextSibling)}if(xg(i),i.tag===13){if(i=i.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(n(317));e:{for(i=i.nextSibling,o=0;i;){if(i.nodeType===8){var u=i.data;if(u==="/$"){if(o===0){kn=Hr(i.nextSibling);break e}o--}else u!=="$"&&u!=="$!"&&u!=="$?"||o++}i=i.nextSibling}kn=null}}else kn=Sn?Hr(i.stateNode.nextSibling):null;return!0}function wg(){for(var i=kn;i;)i=Hr(i.nextSibling)}function fs(){kn=Sn=null,ft=!1}function Wc(i){Hn===null?Hn=[i]:Hn.push(i)}var lE=j.ReactCurrentBatchConfig;function So(i,o,u){if(i=u.ref,i!==null&&typeof i!="function"&&typeof i!="object"){if(u._owner){if(u=u._owner,u){if(u.tag!==1)throw Error(n(309));var f=u.stateNode}if(!f)throw Error(n(147,i));var g=f,x=""+i;return o!==null&&o.ref!==null&&typeof o.ref=="function"&&o.ref._stringRef===x?o.ref:(o=function(C){var L=g.refs;C===null?delete L[x]:L[x]=C},o._stringRef=x,o)}if(typeof i!="string")throw Error(n(284));if(!u._owner)throw Error(n(290,i))}return i}function il(i,o){throw i=Object.prototype.toString.call(o),Error(n(31,i==="[object Object]"?"object with keys {"+Object.keys(o).join(", ")+"}":i))}function Sg(i){var o=i._init;return o(i._payload)}function kg(i){function o($,V){if(i){var W=$.deletions;W===null?($.deletions=[V],$.flags|=16):W.push(V)}}function u($,V){if(!i)return null;for(;V!==null;)o($,V),V=V.sibling;return null}function f($,V){for($=new Map;V!==null;)V.key!==null?$.set(V.key,V):$.set(V.index,V),V=V.sibling;return $}function g($,V){return $=ti($,V),$.index=0,$.sibling=null,$}function x($,V,W){return $.index=W,i?(W=$.alternate,W!==null?(W=W.index,W<V?($.flags|=2,V):W):($.flags|=2,V)):($.flags|=1048576,V)}function C($){return i&&$.alternate===null&&($.flags|=2),$}function L($,V,W,de){return V===null||V.tag!==6?(V=Dd(W,$.mode,de),V.return=$,V):(V=g(V,W),V.return=$,V)}function O($,V,W,de){var Re=W.type;return Re===q?re($,V,W.props.children,de,W.key):V!==null&&(V.elementType===Re||typeof Re=="object"&&Re!==null&&Re.$$typeof===ve&&Sg(Re)===V.type)?(de=g(V,W.props),de.ref=So($,V,W),de.return=$,de):(de=Tl(W.type,W.key,W.props,null,$.mode,de),de.ref=So($,V,W),de.return=$,de)}function G($,V,W,de){return V===null||V.tag!==4||V.stateNode.containerInfo!==W.containerInfo||V.stateNode.implementation!==W.implementation?(V=Od(W,$.mode,de),V.return=$,V):(V=g(V,W.children||[]),V.return=$,V)}function re($,V,W,de,Re){return V===null||V.tag!==7?(V=Ti(W,$.mode,de,Re),V.return=$,V):(V=g(V,W),V.return=$,V)}function se($,V,W){if(typeof V=="string"&&V!==""||typeof V=="number")return V=Dd(""+V,$.mode,W),V.return=$,V;if(typeof V=="object"&&V!==null){switch(V.$$typeof){case A:return W=Tl(V.type,V.key,V.props,null,$.mode,W),W.ref=So($,null,V),W.return=$,W;case N:return V=Od(V,$.mode,W),V.return=$,V;case ve:var de=V._init;return se($,de(V._payload),W)}if(zt(V)||pe(V))return V=Ti(V,$.mode,W,null),V.return=$,V;il($,V)}return null}function te($,V,W,de){var Re=V!==null?V.key:null;if(typeof W=="string"&&W!==""||typeof W=="number")return Re!==null?null:L($,V,""+W,de);if(typeof W=="object"&&W!==null){switch(W.$$typeof){case A:return W.key===Re?O($,V,W,de):null;case N:return W.key===Re?G($,V,W,de):null;case ve:return Re=W._init,te($,V,Re(W._payload),de)}if(zt(W)||pe(W))return Re!==null?null:re($,V,W,de,null);il($,W)}return null}function we($,V,W,de,Re){if(typeof de=="string"&&de!==""||typeof de=="number")return $=$.get(W)||null,L(V,$,""+de,Re);if(typeof de=="object"&&de!==null){switch(de.$$typeof){case A:return $=$.get(de.key===null?W:de.key)||null,O(V,$,de,Re);case N:return $=$.get(de.key===null?W:de.key)||null,G(V,$,de,Re);case ve:var Ie=de._init;return we($,V,W,Ie(de._payload),Re)}if(zt(de)||pe(de))return $=$.get(W)||null,re(V,$,de,Re,null);il(V,de)}return null}function Ee($,V,W,de){for(var Re=null,Ie=null,Me=V,je=V=0,Ot=null;Me!==null&&je<W.length;je++){Me.index>je?(Ot=Me,Me=null):Ot=Me.sibling;var Ye=te($,Me,W[je],de);if(Ye===null){Me===null&&(Me=Ot);break}i&&Me&&Ye.alternate===null&&o($,Me),V=x(Ye,V,je),Ie===null?Re=Ye:Ie.sibling=Ye,Ie=Ye,Me=Ot}if(je===W.length)return u($,Me),ft&&wi($,je),Re;if(Me===null){for(;je<W.length;je++)Me=se($,W[je],de),Me!==null&&(V=x(Me,V,je),Ie===null?Re=Me:Ie.sibling=Me,Ie=Me);return ft&&wi($,je),Re}for(Me=f($,Me);je<W.length;je++)Ot=we(Me,$,je,W[je],de),Ot!==null&&(i&&Ot.alternate!==null&&Me.delete(Ot.key===null?je:Ot.key),V=x(Ot,V,je),Ie===null?Re=Ot:Ie.sibling=Ot,Ie=Ot);return i&&Me.forEach(function(ni){return o($,ni)}),ft&&wi($,je),Re}function Pe($,V,W,de){var Re=pe(W);if(typeof Re!="function")throw Error(n(150));if(W=Re.call(W),W==null)throw Error(n(151));for(var Ie=Re=null,Me=V,je=V=0,Ot=null,Ye=W.next();Me!==null&&!Ye.done;je++,Ye=W.next()){Me.index>je?(Ot=Me,Me=null):Ot=Me.sibling;var ni=te($,Me,Ye.value,de);if(ni===null){Me===null&&(Me=Ot);break}i&&Me&&ni.alternate===null&&o($,Me),V=x(ni,V,je),Ie===null?Re=ni:Ie.sibling=ni,Ie=ni,Me=Ot}if(Ye.done)return u($,Me),ft&&wi($,je),Re;if(Me===null){for(;!Ye.done;je++,Ye=W.next())Ye=se($,Ye.value,de),Ye!==null&&(V=x(Ye,V,je),Ie===null?Re=Ye:Ie.sibling=Ye,Ie=Ye);return ft&&wi($,je),Re}for(Me=f($,Me);!Ye.done;je++,Ye=W.next())Ye=we(Me,$,je,Ye.value,de),Ye!==null&&(i&&Ye.alternate!==null&&Me.delete(Ye.key===null?je:Ye.key),V=x(Ye,V,je),Ie===null?Re=Ye:Ie.sibling=Ye,Ie=Ye);return i&&Me.forEach(function(BE){return o($,BE)}),ft&&wi($,je),Re}function kt($,V,W,de){if(typeof W=="object"&&W!==null&&W.type===q&&W.key===null&&(W=W.props.children),typeof W=="object"&&W!==null){switch(W.$$typeof){case A:e:{for(var Re=W.key,Ie=V;Ie!==null;){if(Ie.key===Re){if(Re=W.type,Re===q){if(Ie.tag===7){u($,Ie.sibling),V=g(Ie,W.props.children),V.return=$,$=V;break e}}else if(Ie.elementType===Re||typeof Re=="object"&&Re!==null&&Re.$$typeof===ve&&Sg(Re)===Ie.type){u($,Ie.sibling),V=g(Ie,W.props),V.ref=So($,Ie,W),V.return=$,$=V;break e}u($,Ie);break}else o($,Ie);Ie=Ie.sibling}W.type===q?(V=Ti(W.props.children,$.mode,de,W.key),V.return=$,$=V):(de=Tl(W.type,W.key,W.props,null,$.mode,de),de.ref=So($,V,W),de.return=$,$=de)}return C($);case N:e:{for(Ie=W.key;V!==null;){if(V.key===Ie)if(V.tag===4&&V.stateNode.containerInfo===W.containerInfo&&V.stateNode.implementation===W.implementation){u($,V.sibling),V=g(V,W.children||[]),V.return=$,$=V;break e}else{u($,V);break}else o($,V);V=V.sibling}V=Od(W,$.mode,de),V.return=$,$=V}return C($);case ve:return Ie=W._init,kt($,V,Ie(W._payload),de)}if(zt(W))return Ee($,V,W,de);if(pe(W))return Pe($,V,W,de);il($,W)}return typeof W=="string"&&W!==""||typeof W=="number"?(W=""+W,V!==null&&V.tag===6?(u($,V.sibling),V=g(V,W),V.return=$,$=V):(u($,V),V=Dd(W,$.mode,de),V.return=$,$=V),C($)):u($,V)}return kt}var hs=kg(!0),Cg=kg(!1),sl=Wr(null),ol=null,ps=null,qc=null;function Gc(){qc=ps=ol=null}function Kc(i){var o=sl.current;ct(sl),i._currentValue=o}function Xc(i,o,u){for(;i!==null;){var f=i.alternate;if((i.childLanes&o)!==o?(i.childLanes|=o,f!==null&&(f.childLanes|=o)):f!==null&&(f.childLanes&o)!==o&&(f.childLanes|=o),i===u)break;i=i.return}}function ms(i,o){ol=i,qc=ps=null,i=i.dependencies,i!==null&&i.firstContext!==null&&((i.lanes&o)!==0&&(hn=!0),i.firstContext=null)}function Mn(i){var o=i._currentValue;if(qc!==i)if(i={context:i,memoizedValue:o,next:null},ps===null){if(ol===null)throw Error(n(308));ps=i,ol.dependencies={lanes:0,firstContext:i}}else ps=ps.next=i;return o}var Si=null;function Yc(i){Si===null?Si=[i]:Si.push(i)}function bg(i,o,u,f){var g=o.interleaved;return g===null?(u.next=u,Yc(o)):(u.next=g.next,g.next=u),o.interleaved=u,Er(i,f)}function Er(i,o){i.lanes|=o;var u=i.alternate;for(u!==null&&(u.lanes|=o),u=i,i=i.return;i!==null;)i.childLanes|=o,u=i.alternate,u!==null&&(u.childLanes|=o),u=i,i=i.return;return u.tag===3?u.stateNode:null}var Kr=!1;function Qc(i){i.updateQueue={baseState:i.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Eg(i,o){i=i.updateQueue,o.updateQueue===i&&(o.updateQueue={baseState:i.baseState,firstBaseUpdate:i.firstBaseUpdate,lastBaseUpdate:i.lastBaseUpdate,shared:i.shared,effects:i.effects})}function _r(i,o){return{eventTime:i,lane:o,tag:0,payload:null,callback:null,next:null}}function Xr(i,o,u){var f=i.updateQueue;if(f===null)return null;if(f=f.shared,(Ke&2)!==0){var g=f.pending;return g===null?o.next=o:(o.next=g.next,g.next=o),f.pending=o,Er(i,u)}return g=f.interleaved,g===null?(o.next=o,Yc(f)):(o.next=g.next,g.next=o),f.interleaved=o,Er(i,u)}function al(i,o,u){if(o=o.updateQueue,o!==null&&(o=o.shared,(u&4194240)!==0)){var f=o.lanes;f&=i.pendingLanes,u|=f,o.lanes=u,dc(i,u)}}function _g(i,o){var u=i.updateQueue,f=i.alternate;if(f!==null&&(f=f.updateQueue,u===f)){var g=null,x=null;if(u=u.firstBaseUpdate,u!==null){do{var C={eventTime:u.eventTime,lane:u.lane,tag:u.tag,payload:u.payload,callback:u.callback,next:null};x===null?g=x=C:x=x.next=C,u=u.next}while(u!==null);x===null?g=x=o:x=x.next=o}else g=x=o;u={baseState:f.baseState,firstBaseUpdate:g,lastBaseUpdate:x,shared:f.shared,effects:f.effects},i.updateQueue=u;return}i=u.lastBaseUpdate,i===null?u.firstBaseUpdate=o:i.next=o,u.lastBaseUpdate=o}function ll(i,o,u,f){var g=i.updateQueue;Kr=!1;var x=g.firstBaseUpdate,C=g.lastBaseUpdate,L=g.shared.pending;if(L!==null){g.shared.pending=null;var O=L,G=O.next;O.next=null,C===null?x=G:C.next=G,C=O;var re=i.alternate;re!==null&&(re=re.updateQueue,L=re.lastBaseUpdate,L!==C&&(L===null?re.firstBaseUpdate=G:L.next=G,re.lastBaseUpdate=O))}if(x!==null){var se=g.baseState;C=0,re=G=O=null,L=x;do{var te=L.lane,we=L.eventTime;if((f&te)===te){re!==null&&(re=re.next={eventTime:we,lane:0,tag:L.tag,payload:L.payload,callback:L.callback,next:null});e:{var Ee=i,Pe=L;switch(te=o,we=u,Pe.tag){case 1:if(Ee=Pe.payload,typeof Ee=="function"){se=Ee.call(we,se,te);break e}se=Ee;break e;case 3:Ee.flags=Ee.flags&-65537|128;case 0:if(Ee=Pe.payload,te=typeof Ee=="function"?Ee.call(we,se,te):Ee,te==null)break e;se=T({},se,te);break e;case 2:Kr=!0}}L.callback!==null&&L.lane!==0&&(i.flags|=64,te=g.effects,te===null?g.effects=[L]:te.push(L))}else we={eventTime:we,lane:te,tag:L.tag,payload:L.payload,callback:L.callback,next:null},re===null?(G=re=we,O=se):re=re.next=we,C|=te;if(L=L.next,L===null){if(L=g.shared.pending,L===null)break;te=L,L=te.next,te.next=null,g.lastBaseUpdate=te,g.shared.pending=null}}while(!0);if(re===null&&(O=se),g.baseState=O,g.firstBaseUpdate=G,g.lastBaseUpdate=re,o=g.shared.interleaved,o!==null){g=o;do C|=g.lane,g=g.next;while(g!==o)}else x===null&&(g.shared.lanes=0);bi|=C,i.lanes=C,i.memoizedState=se}}function Pg(i,o,u){if(i=o.effects,o.effects=null,i!==null)for(o=0;o<i.length;o++){var f=i[o],g=f.callback;if(g!==null){if(f.callback=null,f=u,typeof g!="function")throw Error(n(191,g));g.call(f)}}}var ko={},sr=Wr(ko),Co=Wr(ko),bo=Wr(ko);function ki(i){if(i===ko)throw Error(n(174));return i}function Jc(i,o){switch(lt(bo,o),lt(Co,i),lt(sr,ko),i=o.nodeType,i){case 9:case 11:o=(o=o.documentElement)?o.namespaceURI:ee(null,"");break;default:i=i===8?o.parentNode:o,o=i.namespaceURI||null,i=i.tagName,o=ee(o,i)}ct(sr),lt(sr,o)}function gs(){ct(sr),ct(Co),ct(bo)}function Tg(i){ki(bo.current);var o=ki(sr.current),u=ee(o,i.type);o!==u&&(lt(Co,i),lt(sr,u))}function Zc(i){Co.current===i&&(ct(sr),ct(Co))}var mt=Wr(0);function ul(i){for(var o=i;o!==null;){if(o.tag===13){var u=o.memoizedState;if(u!==null&&(u=u.dehydrated,u===null||u.data==="$?"||u.data==="$!"))return o}else if(o.tag===19&&o.memoizedProps.revealOrder!==void 0){if((o.flags&128)!==0)return o}else if(o.child!==null){o.child.return=o,o=o.child;continue}if(o===i)break;for(;o.sibling===null;){if(o.return===null||o.return===i)return null;o=o.return}o.sibling.return=o.return,o=o.sibling}return null}var ed=[];function td(){for(var i=0;i<ed.length;i++)ed[i]._workInProgressVersionPrimary=null;ed.length=0}var cl=j.ReactCurrentDispatcher,nd=j.ReactCurrentBatchConfig,Ci=0,gt=null,At=null,jt=null,dl=!1,Eo=!1,_o=0,uE=0;function Xt(){throw Error(n(321))}function rd(i,o){if(o===null)return!1;for(var u=0;u<o.length&&u<i.length;u++)if(!$n(i[u],o[u]))return!1;return!0}function id(i,o,u,f,g,x){if(Ci=x,gt=o,o.memoizedState=null,o.updateQueue=null,o.lanes=0,cl.current=i===null||i.memoizedState===null?hE:pE,i=u(f,g),Eo){x=0;do{if(Eo=!1,_o=0,25<=x)throw Error(n(301));x+=1,jt=At=null,o.updateQueue=null,cl.current=mE,i=u(f,g)}while(Eo)}if(cl.current=pl,o=At!==null&&At.next!==null,Ci=0,jt=At=gt=null,dl=!1,o)throw Error(n(300));return i}function sd(){var i=_o!==0;return _o=0,i}function or(){var i={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return jt===null?gt.memoizedState=jt=i:jt=jt.next=i,jt}function Nn(){if(At===null){var i=gt.alternate;i=i!==null?i.memoizedState:null}else i=At.next;var o=jt===null?gt.memoizedState:jt.next;if(o!==null)jt=o,At=i;else{if(i===null)throw Error(n(310));At=i,i={memoizedState:At.memoizedState,baseState:At.baseState,baseQueue:At.baseQueue,queue:At.queue,next:null},jt===null?gt.memoizedState=jt=i:jt=jt.next=i}return jt}function Po(i,o){return typeof o=="function"?o(i):o}function od(i){var o=Nn(),u=o.queue;if(u===null)throw Error(n(311));u.lastRenderedReducer=i;var f=At,g=f.baseQueue,x=u.pending;if(x!==null){if(g!==null){var C=g.next;g.next=x.next,x.next=C}f.baseQueue=g=x,u.pending=null}if(g!==null){x=g.next,f=f.baseState;var L=C=null,O=null,G=x;do{var re=G.lane;if((Ci&re)===re)O!==null&&(O=O.next={lane:0,action:G.action,hasEagerState:G.hasEagerState,eagerState:G.eagerState,next:null}),f=G.hasEagerState?G.eagerState:i(f,G.action);else{var se={lane:re,action:G.action,hasEagerState:G.hasEagerState,eagerState:G.eagerState,next:null};O===null?(L=O=se,C=f):O=O.next=se,gt.lanes|=re,bi|=re}G=G.next}while(G!==null&&G!==x);O===null?C=f:O.next=L,$n(f,o.memoizedState)||(hn=!0),o.memoizedState=f,o.baseState=C,o.baseQueue=O,u.lastRenderedState=f}if(i=u.interleaved,i!==null){g=i;do x=g.lane,gt.lanes|=x,bi|=x,g=g.next;while(g!==i)}else g===null&&(u.lanes=0);return[o.memoizedState,u.dispatch]}function ad(i){var o=Nn(),u=o.queue;if(u===null)throw Error(n(311));u.lastRenderedReducer=i;var f=u.dispatch,g=u.pending,x=o.memoizedState;if(g!==null){u.pending=null;var C=g=g.next;do x=i(x,C.action),C=C.next;while(C!==g);$n(x,o.memoizedState)||(hn=!0),o.memoizedState=x,o.baseQueue===null&&(o.baseState=x),u.lastRenderedState=x}return[x,f]}function Rg(){}function Ag(i,o){var u=gt,f=Nn(),g=o(),x=!$n(f.memoizedState,g);if(x&&(f.memoizedState=g,hn=!0),f=f.queue,ld(Ng.bind(null,u,f,i),[i]),f.getSnapshot!==o||x||jt!==null&&jt.memoizedState.tag&1){if(u.flags|=2048,To(9,Mg.bind(null,u,f,g,o),void 0,null),Dt===null)throw Error(n(349));(Ci&30)!==0||Ig(u,o,g)}return g}function Ig(i,o,u){i.flags|=16384,i={getSnapshot:o,value:u},o=gt.updateQueue,o===null?(o={lastEffect:null,stores:null},gt.updateQueue=o,o.stores=[i]):(u=o.stores,u===null?o.stores=[i]:u.push(i))}function Mg(i,o,u,f){o.value=u,o.getSnapshot=f,Lg(o)&&jg(i)}function Ng(i,o,u){return u(function(){Lg(o)&&jg(i)})}function Lg(i){var o=i.getSnapshot;i=i.value;try{var u=o();return!$n(i,u)}catch{return!0}}function jg(i){var o=Er(i,1);o!==null&&Kn(o,i,1,-1)}function Dg(i){var o=or();return typeof i=="function"&&(i=i()),o.memoizedState=o.baseState=i,i={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Po,lastRenderedState:i},o.queue=i,i=i.dispatch=fE.bind(null,gt,i),[o.memoizedState,i]}function To(i,o,u,f){return i={tag:i,create:o,destroy:u,deps:f,next:null},o=gt.updateQueue,o===null?(o={lastEffect:null,stores:null},gt.updateQueue=o,o.lastEffect=i.next=i):(u=o.lastEffect,u===null?o.lastEffect=i.next=i:(f=u.next,u.next=i,i.next=f,o.lastEffect=i)),i}function Og(){return Nn().memoizedState}function fl(i,o,u,f){var g=or();gt.flags|=i,g.memoizedState=To(1|o,u,void 0,f===void 0?null:f)}function hl(i,o,u,f){var g=Nn();f=f===void 0?null:f;var x=void 0;if(At!==null){var C=At.memoizedState;if(x=C.destroy,f!==null&&rd(f,C.deps)){g.memoizedState=To(o,u,x,f);return}}gt.flags|=i,g.memoizedState=To(1|o,u,x,f)}function Fg(i,o){return fl(8390656,8,i,o)}function ld(i,o){return hl(2048,8,i,o)}function Vg(i,o){return hl(4,2,i,o)}function zg(i,o){return hl(4,4,i,o)}function Bg(i,o){if(typeof o=="function")return i=i(),o(i),function(){o(null)};if(o!=null)return i=i(),o.current=i,function(){o.current=null}}function Ug(i,o,u){return u=u!=null?u.concat([i]):null,hl(4,4,Bg.bind(null,o,i),u)}function ud(){}function $g(i,o){var u=Nn();o=o===void 0?null:o;var f=u.memoizedState;return f!==null&&o!==null&&rd(o,f[1])?f[0]:(u.memoizedState=[i,o],i)}function Hg(i,o){var u=Nn();o=o===void 0?null:o;var f=u.memoizedState;return f!==null&&o!==null&&rd(o,f[1])?f[0]:(i=i(),u.memoizedState=[i,o],i)}function Wg(i,o,u){return(Ci&21)===0?(i.baseState&&(i.baseState=!1,hn=!0),i.memoizedState=u):($n(u,o)||(u=Sm(),gt.lanes|=u,bi|=u,i.baseState=!0),o)}function cE(i,o){var u=Ze;Ze=u!==0&&4>u?u:4,i(!0);var f=nd.transition;nd.transition={};try{i(!1),o()}finally{Ze=u,nd.transition=f}}function qg(){return Nn().memoizedState}function dE(i,o,u){var f=Zr(i);if(u={lane:f,action:u,hasEagerState:!1,eagerState:null,next:null},Gg(i))Kg(o,u);else if(u=bg(i,o,u,f),u!==null){var g=rn();Kn(u,i,f,g),Xg(u,o,f)}}function fE(i,o,u){var f=Zr(i),g={lane:f,action:u,hasEagerState:!1,eagerState:null,next:null};if(Gg(i))Kg(o,g);else{var x=i.alternate;if(i.lanes===0&&(x===null||x.lanes===0)&&(x=o.lastRenderedReducer,x!==null))try{var C=o.lastRenderedState,L=x(C,u);if(g.hasEagerState=!0,g.eagerState=L,$n(L,C)){var O=o.interleaved;O===null?(g.next=g,Yc(o)):(g.next=O.next,O.next=g),o.interleaved=g;return}}catch{}finally{}u=bg(i,o,g,f),u!==null&&(g=rn(),Kn(u,i,f,g),Xg(u,o,f))}}function Gg(i){var o=i.alternate;return i===gt||o!==null&&o===gt}function Kg(i,o){Eo=dl=!0;var u=i.pending;u===null?o.next=o:(o.next=u.next,u.next=o),i.pending=o}function Xg(i,o,u){if((u&4194240)!==0){var f=o.lanes;f&=i.pendingLanes,u|=f,o.lanes=u,dc(i,u)}}var pl={readContext:Mn,useCallback:Xt,useContext:Xt,useEffect:Xt,useImperativeHandle:Xt,useInsertionEffect:Xt,useLayoutEffect:Xt,useMemo:Xt,useReducer:Xt,useRef:Xt,useState:Xt,useDebugValue:Xt,useDeferredValue:Xt,useTransition:Xt,useMutableSource:Xt,useSyncExternalStore:Xt,useId:Xt,unstable_isNewReconciler:!1},hE={readContext:Mn,useCallback:function(i,o){return or().memoizedState=[i,o===void 0?null:o],i},useContext:Mn,useEffect:Fg,useImperativeHandle:function(i,o,u){return u=u!=null?u.concat([i]):null,fl(4194308,4,Bg.bind(null,o,i),u)},useLayoutEffect:function(i,o){return fl(4194308,4,i,o)},useInsertionEffect:function(i,o){return fl(4,2,i,o)},useMemo:function(i,o){var u=or();return o=o===void 0?null:o,i=i(),u.memoizedState=[i,o],i},useReducer:function(i,o,u){var f=or();return o=u!==void 0?u(o):o,f.memoizedState=f.baseState=o,i={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:i,lastRenderedState:o},f.queue=i,i=i.dispatch=dE.bind(null,gt,i),[f.memoizedState,i]},useRef:function(i){var o=or();return i={current:i},o.memoizedState=i},useState:Dg,useDebugValue:ud,useDeferredValue:function(i){return or().memoizedState=i},useTransition:function(){var i=Dg(!1),o=i[0];return i=cE.bind(null,i[1]),or().memoizedState=i,[o,i]},useMutableSource:function(){},useSyncExternalStore:function(i,o,u){var f=gt,g=or();if(ft){if(u===void 0)throw Error(n(407));u=u()}else{if(u=o(),Dt===null)throw Error(n(349));(Ci&30)!==0||Ig(f,o,u)}g.memoizedState=u;var x={value:u,getSnapshot:o};return g.queue=x,Fg(Ng.bind(null,f,x,i),[i]),f.flags|=2048,To(9,Mg.bind(null,f,x,u,o),void 0,null),u},useId:function(){var i=or(),o=Dt.identifierPrefix;if(ft){var u=br,f=Cr;u=(f&~(1<<32-Un(f)-1)).toString(32)+u,o=":"+o+"R"+u,u=_o++,0<u&&(o+="H"+u.toString(32)),o+=":"}else u=uE++,o=":"+o+"r"+u.toString(32)+":";return i.memoizedState=o},unstable_isNewReconciler:!1},pE={readContext:Mn,useCallback:$g,useContext:Mn,useEffect:ld,useImperativeHandle:Ug,useInsertionEffect:Vg,useLayoutEffect:zg,useMemo:Hg,useReducer:od,useRef:Og,useState:function(){return od(Po)},useDebugValue:ud,useDeferredValue:function(i){var o=Nn();return Wg(o,At.memoizedState,i)},useTransition:function(){var i=od(Po)[0],o=Nn().memoizedState;return[i,o]},useMutableSource:Rg,useSyncExternalStore:Ag,useId:qg,unstable_isNewReconciler:!1},mE={readContext:Mn,useCallback:$g,useContext:Mn,useEffect:ld,useImperativeHandle:Ug,useInsertionEffect:Vg,useLayoutEffect:zg,useMemo:Hg,useReducer:ad,useRef:Og,useState:function(){return ad(Po)},useDebugValue:ud,useDeferredValue:function(i){var o=Nn();return At===null?o.memoizedState=i:Wg(o,At.memoizedState,i)},useTransition:function(){var i=ad(Po)[0],o=Nn().memoizedState;return[i,o]},useMutableSource:Rg,useSyncExternalStore:Ag,useId:qg,unstable_isNewReconciler:!1};function Wn(i,o){if(i&&i.defaultProps){o=T({},o),i=i.defaultProps;for(var u in i)o[u]===void 0&&(o[u]=i[u]);return o}return o}function cd(i,o,u,f){o=i.memoizedState,u=u(f,o),u=u==null?o:T({},o,u),i.memoizedState=u,i.lanes===0&&(i.updateQueue.baseState=u)}var ml={isMounted:function(i){return(i=i._reactInternals)?wr(i)===i:!1},enqueueSetState:function(i,o,u){i=i._reactInternals;var f=rn(),g=Zr(i),x=_r(f,g);x.payload=o,u!=null&&(x.callback=u),o=Xr(i,x,g),o!==null&&(Kn(o,i,g,f),al(o,i,g))},enqueueReplaceState:function(i,o,u){i=i._reactInternals;var f=rn(),g=Zr(i),x=_r(f,g);x.tag=1,x.payload=o,u!=null&&(x.callback=u),o=Xr(i,x,g),o!==null&&(Kn(o,i,g,f),al(o,i,g))},enqueueForceUpdate:function(i,o){i=i._reactInternals;var u=rn(),f=Zr(i),g=_r(u,f);g.tag=2,o!=null&&(g.callback=o),o=Xr(i,g,f),o!==null&&(Kn(o,i,f,u),al(o,i,f))}};function Yg(i,o,u,f,g,x,C){return i=i.stateNode,typeof i.shouldComponentUpdate=="function"?i.shouldComponentUpdate(f,x,C):o.prototype&&o.prototype.isPureReactComponent?!po(u,f)||!po(g,x):!0}function Qg(i,o,u){var f=!1,g=qr,x=o.contextType;return typeof x=="object"&&x!==null?x=Mn(x):(g=fn(o)?vi:Kt.current,f=o.contextTypes,x=(f=f!=null)?us(i,g):qr),o=new o(u,x),i.memoizedState=o.state!==null&&o.state!==void 0?o.state:null,o.updater=ml,i.stateNode=o,o._reactInternals=i,f&&(i=i.stateNode,i.__reactInternalMemoizedUnmaskedChildContext=g,i.__reactInternalMemoizedMaskedChildContext=x),o}function Jg(i,o,u,f){i=o.state,typeof o.componentWillReceiveProps=="function"&&o.componentWillReceiveProps(u,f),typeof o.UNSAFE_componentWillReceiveProps=="function"&&o.UNSAFE_componentWillReceiveProps(u,f),o.state!==i&&ml.enqueueReplaceState(o,o.state,null)}function dd(i,o,u,f){var g=i.stateNode;g.props=u,g.state=i.memoizedState,g.refs={},Qc(i);var x=o.contextType;typeof x=="object"&&x!==null?g.context=Mn(x):(x=fn(o)?vi:Kt.current,g.context=us(i,x)),g.state=i.memoizedState,x=o.getDerivedStateFromProps,typeof x=="function"&&(cd(i,o,x,u),g.state=i.memoizedState),typeof o.getDerivedStateFromProps=="function"||typeof g.getSnapshotBeforeUpdate=="function"||typeof g.UNSAFE_componentWillMount!="function"&&typeof g.componentWillMount!="function"||(o=g.state,typeof g.componentWillMount=="function"&&g.componentWillMount(),typeof g.UNSAFE_componentWillMount=="function"&&g.UNSAFE_componentWillMount(),o!==g.state&&ml.enqueueReplaceState(g,g.state,null),ll(i,u,g,f),g.state=i.memoizedState),typeof g.componentDidMount=="function"&&(i.flags|=4194308)}function ys(i,o){try{var u="",f=o;do u+=ue(f),f=f.return;while(f);var g=u}catch(x){g=`
39
- Error generating stack: `+x.message+`
40
- `+x.stack}return{value:i,source:o,stack:g,digest:null}}function fd(i,o,u){return{value:i,source:null,stack:u??null,digest:o??null}}function hd(i,o){try{console.error(o.value)}catch(u){setTimeout(function(){throw u})}}var gE=typeof WeakMap=="function"?WeakMap:Map;function Zg(i,o,u){u=_r(-1,u),u.tag=3,u.payload={element:null};var f=o.value;return u.callback=function(){kl||(kl=!0,Td=f),hd(i,o)},u}function ey(i,o,u){u=_r(-1,u),u.tag=3;var f=i.type.getDerivedStateFromError;if(typeof f=="function"){var g=o.value;u.payload=function(){return f(g)},u.callback=function(){hd(i,o)}}var x=i.stateNode;return x!==null&&typeof x.componentDidCatch=="function"&&(u.callback=function(){hd(i,o),typeof f!="function"&&(Qr===null?Qr=new Set([this]):Qr.add(this));var C=o.stack;this.componentDidCatch(o.value,{componentStack:C!==null?C:""})}),u}function ty(i,o,u){var f=i.pingCache;if(f===null){f=i.pingCache=new gE;var g=new Set;f.set(o,g)}else g=f.get(o),g===void 0&&(g=new Set,f.set(o,g));g.has(u)||(g.add(u),i=AE.bind(null,i,o,u),o.then(i,i))}function ny(i){do{var o;if((o=i.tag===13)&&(o=i.memoizedState,o=o!==null?o.dehydrated!==null:!0),o)return i;i=i.return}while(i!==null);return null}function ry(i,o,u,f,g){return(i.mode&1)===0?(i===o?i.flags|=65536:(i.flags|=128,u.flags|=131072,u.flags&=-52805,u.tag===1&&(u.alternate===null?u.tag=17:(o=_r(-1,1),o.tag=2,Xr(u,o,1))),u.lanes|=1),i):(i.flags|=65536,i.lanes=g,i)}var yE=j.ReactCurrentOwner,hn=!1;function nn(i,o,u,f){o.child=i===null?Cg(o,null,u,f):hs(o,i.child,u,f)}function iy(i,o,u,f,g){u=u.render;var x=o.ref;return ms(o,g),f=id(i,o,u,f,x,g),u=sd(),i!==null&&!hn?(o.updateQueue=i.updateQueue,o.flags&=-2053,i.lanes&=~g,Pr(i,o,g)):(ft&&u&&Bc(o),o.flags|=1,nn(i,o,f,g),o.child)}function sy(i,o,u,f,g){if(i===null){var x=u.type;return typeof x=="function"&&!jd(x)&&x.defaultProps===void 0&&u.compare===null&&u.defaultProps===void 0?(o.tag=15,o.type=x,oy(i,o,x,f,g)):(i=Tl(u.type,null,f,o,o.mode,g),i.ref=o.ref,i.return=o,o.child=i)}if(x=i.child,(i.lanes&g)===0){var C=x.memoizedProps;if(u=u.compare,u=u!==null?u:po,u(C,f)&&i.ref===o.ref)return Pr(i,o,g)}return o.flags|=1,i=ti(x,f),i.ref=o.ref,i.return=o,o.child=i}function oy(i,o,u,f,g){if(i!==null){var x=i.memoizedProps;if(po(x,f)&&i.ref===o.ref)if(hn=!1,o.pendingProps=f=x,(i.lanes&g)!==0)(i.flags&131072)!==0&&(hn=!0);else return o.lanes=i.lanes,Pr(i,o,g)}return pd(i,o,u,f,g)}function ay(i,o,u){var f=o.pendingProps,g=f.children,x=i!==null?i.memoizedState:null;if(f.mode==="hidden")if((o.mode&1)===0)o.memoizedState={baseLanes:0,cachePool:null,transitions:null},lt(xs,Cn),Cn|=u;else{if((u&1073741824)===0)return i=x!==null?x.baseLanes|u:u,o.lanes=o.childLanes=1073741824,o.memoizedState={baseLanes:i,cachePool:null,transitions:null},o.updateQueue=null,lt(xs,Cn),Cn|=i,null;o.memoizedState={baseLanes:0,cachePool:null,transitions:null},f=x!==null?x.baseLanes:u,lt(xs,Cn),Cn|=f}else x!==null?(f=x.baseLanes|u,o.memoizedState=null):f=u,lt(xs,Cn),Cn|=f;return nn(i,o,g,u),o.child}function ly(i,o){var u=o.ref;(i===null&&u!==null||i!==null&&i.ref!==u)&&(o.flags|=512,o.flags|=2097152)}function pd(i,o,u,f,g){var x=fn(u)?vi:Kt.current;return x=us(o,x),ms(o,g),u=id(i,o,u,f,x,g),f=sd(),i!==null&&!hn?(o.updateQueue=i.updateQueue,o.flags&=-2053,i.lanes&=~g,Pr(i,o,g)):(ft&&f&&Bc(o),o.flags|=1,nn(i,o,u,g),o.child)}function uy(i,o,u,f,g){if(fn(u)){var x=!0;Za(o)}else x=!1;if(ms(o,g),o.stateNode===null)yl(i,o),Qg(o,u,f),dd(o,u,f,g),f=!0;else if(i===null){var C=o.stateNode,L=o.memoizedProps;C.props=L;var O=C.context,G=u.contextType;typeof G=="object"&&G!==null?G=Mn(G):(G=fn(u)?vi:Kt.current,G=us(o,G));var re=u.getDerivedStateFromProps,se=typeof re=="function"||typeof C.getSnapshotBeforeUpdate=="function";se||typeof C.UNSAFE_componentWillReceiveProps!="function"&&typeof C.componentWillReceiveProps!="function"||(L!==f||O!==G)&&Jg(o,C,f,G),Kr=!1;var te=o.memoizedState;C.state=te,ll(o,f,C,g),O=o.memoizedState,L!==f||te!==O||dn.current||Kr?(typeof re=="function"&&(cd(o,u,re,f),O=o.memoizedState),(L=Kr||Yg(o,u,L,f,te,O,G))?(se||typeof C.UNSAFE_componentWillMount!="function"&&typeof C.componentWillMount!="function"||(typeof C.componentWillMount=="function"&&C.componentWillMount(),typeof C.UNSAFE_componentWillMount=="function"&&C.UNSAFE_componentWillMount()),typeof C.componentDidMount=="function"&&(o.flags|=4194308)):(typeof C.componentDidMount=="function"&&(o.flags|=4194308),o.memoizedProps=f,o.memoizedState=O),C.props=f,C.state=O,C.context=G,f=L):(typeof C.componentDidMount=="function"&&(o.flags|=4194308),f=!1)}else{C=o.stateNode,Eg(i,o),L=o.memoizedProps,G=o.type===o.elementType?L:Wn(o.type,L),C.props=G,se=o.pendingProps,te=C.context,O=u.contextType,typeof O=="object"&&O!==null?O=Mn(O):(O=fn(u)?vi:Kt.current,O=us(o,O));var we=u.getDerivedStateFromProps;(re=typeof we=="function"||typeof C.getSnapshotBeforeUpdate=="function")||typeof C.UNSAFE_componentWillReceiveProps!="function"&&typeof C.componentWillReceiveProps!="function"||(L!==se||te!==O)&&Jg(o,C,f,O),Kr=!1,te=o.memoizedState,C.state=te,ll(o,f,C,g);var Ee=o.memoizedState;L!==se||te!==Ee||dn.current||Kr?(typeof we=="function"&&(cd(o,u,we,f),Ee=o.memoizedState),(G=Kr||Yg(o,u,G,f,te,Ee,O)||!1)?(re||typeof C.UNSAFE_componentWillUpdate!="function"&&typeof C.componentWillUpdate!="function"||(typeof C.componentWillUpdate=="function"&&C.componentWillUpdate(f,Ee,O),typeof C.UNSAFE_componentWillUpdate=="function"&&C.UNSAFE_componentWillUpdate(f,Ee,O)),typeof C.componentDidUpdate=="function"&&(o.flags|=4),typeof C.getSnapshotBeforeUpdate=="function"&&(o.flags|=1024)):(typeof C.componentDidUpdate!="function"||L===i.memoizedProps&&te===i.memoizedState||(o.flags|=4),typeof C.getSnapshotBeforeUpdate!="function"||L===i.memoizedProps&&te===i.memoizedState||(o.flags|=1024),o.memoizedProps=f,o.memoizedState=Ee),C.props=f,C.state=Ee,C.context=O,f=G):(typeof C.componentDidUpdate!="function"||L===i.memoizedProps&&te===i.memoizedState||(o.flags|=4),typeof C.getSnapshotBeforeUpdate!="function"||L===i.memoizedProps&&te===i.memoizedState||(o.flags|=1024),f=!1)}return md(i,o,u,f,x,g)}function md(i,o,u,f,g,x){ly(i,o);var C=(o.flags&128)!==0;if(!f&&!C)return g&&pg(o,u,!1),Pr(i,o,x);f=o.stateNode,yE.current=o;var L=C&&typeof u.getDerivedStateFromError!="function"?null:f.render();return o.flags|=1,i!==null&&C?(o.child=hs(o,i.child,null,x),o.child=hs(o,null,L,x)):nn(i,o,L,x),o.memoizedState=f.state,g&&pg(o,u,!0),o.child}function cy(i){var o=i.stateNode;o.pendingContext?fg(i,o.pendingContext,o.pendingContext!==o.context):o.context&&fg(i,o.context,!1),Jc(i,o.containerInfo)}function dy(i,o,u,f,g){return fs(),Wc(g),o.flags|=256,nn(i,o,u,f),o.child}var gd={dehydrated:null,treeContext:null,retryLane:0};function yd(i){return{baseLanes:i,cachePool:null,transitions:null}}function fy(i,o,u){var f=o.pendingProps,g=mt.current,x=!1,C=(o.flags&128)!==0,L;if((L=C)||(L=i!==null&&i.memoizedState===null?!1:(g&2)!==0),L?(x=!0,o.flags&=-129):(i===null||i.memoizedState!==null)&&(g|=1),lt(mt,g&1),i===null)return Hc(o),i=o.memoizedState,i!==null&&(i=i.dehydrated,i!==null)?((o.mode&1)===0?o.lanes=1:i.data==="$!"?o.lanes=8:o.lanes=1073741824,null):(C=f.children,i=f.fallback,x?(f=o.mode,x=o.child,C={mode:"hidden",children:C},(f&1)===0&&x!==null?(x.childLanes=0,x.pendingProps=C):x=Rl(C,f,0,null),i=Ti(i,f,u,null),x.return=o,i.return=o,x.sibling=i,o.child=x,o.child.memoizedState=yd(u),o.memoizedState=gd,i):vd(o,C));if(g=i.memoizedState,g!==null&&(L=g.dehydrated,L!==null))return vE(i,o,C,f,L,g,u);if(x){x=f.fallback,C=o.mode,g=i.child,L=g.sibling;var O={mode:"hidden",children:f.children};return(C&1)===0&&o.child!==g?(f=o.child,f.childLanes=0,f.pendingProps=O,o.deletions=null):(f=ti(g,O),f.subtreeFlags=g.subtreeFlags&14680064),L!==null?x=ti(L,x):(x=Ti(x,C,u,null),x.flags|=2),x.return=o,f.return=o,f.sibling=x,o.child=f,f=x,x=o.child,C=i.child.memoizedState,C=C===null?yd(u):{baseLanes:C.baseLanes|u,cachePool:null,transitions:C.transitions},x.memoizedState=C,x.childLanes=i.childLanes&~u,o.memoizedState=gd,f}return x=i.child,i=x.sibling,f=ti(x,{mode:"visible",children:f.children}),(o.mode&1)===0&&(f.lanes=u),f.return=o,f.sibling=null,i!==null&&(u=o.deletions,u===null?(o.deletions=[i],o.flags|=16):u.push(i)),o.child=f,o.memoizedState=null,f}function vd(i,o){return o=Rl({mode:"visible",children:o},i.mode,0,null),o.return=i,i.child=o}function gl(i,o,u,f){return f!==null&&Wc(f),hs(o,i.child,null,u),i=vd(o,o.pendingProps.children),i.flags|=2,o.memoizedState=null,i}function vE(i,o,u,f,g,x,C){if(u)return o.flags&256?(o.flags&=-257,f=fd(Error(n(422))),gl(i,o,C,f)):o.memoizedState!==null?(o.child=i.child,o.flags|=128,null):(x=f.fallback,g=o.mode,f=Rl({mode:"visible",children:f.children},g,0,null),x=Ti(x,g,C,null),x.flags|=2,f.return=o,x.return=o,f.sibling=x,o.child=f,(o.mode&1)!==0&&hs(o,i.child,null,C),o.child.memoizedState=yd(C),o.memoizedState=gd,x);if((o.mode&1)===0)return gl(i,o,C,null);if(g.data==="$!"){if(f=g.nextSibling&&g.nextSibling.dataset,f)var L=f.dgst;return f=L,x=Error(n(419)),f=fd(x,f,void 0),gl(i,o,C,f)}if(L=(C&i.childLanes)!==0,hn||L){if(f=Dt,f!==null){switch(C&-C){case 4:g=2;break;case 16:g=8;break;case 64: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:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:g=32;break;case 536870912:g=268435456;break;default:g=0}g=(g&(f.suspendedLanes|C))!==0?0:g,g!==0&&g!==x.retryLane&&(x.retryLane=g,Er(i,g),Kn(f,i,g,-1))}return Ld(),f=fd(Error(n(421))),gl(i,o,C,f)}return g.data==="$?"?(o.flags|=128,o.child=i.child,o=IE.bind(null,i),g._reactRetry=o,null):(i=x.treeContext,kn=Hr(g.nextSibling),Sn=o,ft=!0,Hn=null,i!==null&&(An[In++]=Cr,An[In++]=br,An[In++]=xi,Cr=i.id,br=i.overflow,xi=o),o=vd(o,f.children),o.flags|=4096,o)}function hy(i,o,u){i.lanes|=o;var f=i.alternate;f!==null&&(f.lanes|=o),Xc(i.return,o,u)}function xd(i,o,u,f,g){var x=i.memoizedState;x===null?i.memoizedState={isBackwards:o,rendering:null,renderingStartTime:0,last:f,tail:u,tailMode:g}:(x.isBackwards=o,x.rendering=null,x.renderingStartTime=0,x.last=f,x.tail=u,x.tailMode=g)}function py(i,o,u){var f=o.pendingProps,g=f.revealOrder,x=f.tail;if(nn(i,o,f.children,u),f=mt.current,(f&2)!==0)f=f&1|2,o.flags|=128;else{if(i!==null&&(i.flags&128)!==0)e:for(i=o.child;i!==null;){if(i.tag===13)i.memoizedState!==null&&hy(i,u,o);else if(i.tag===19)hy(i,u,o);else if(i.child!==null){i.child.return=i,i=i.child;continue}if(i===o)break e;for(;i.sibling===null;){if(i.return===null||i.return===o)break e;i=i.return}i.sibling.return=i.return,i=i.sibling}f&=1}if(lt(mt,f),(o.mode&1)===0)o.memoizedState=null;else switch(g){case"forwards":for(u=o.child,g=null;u!==null;)i=u.alternate,i!==null&&ul(i)===null&&(g=u),u=u.sibling;u=g,u===null?(g=o.child,o.child=null):(g=u.sibling,u.sibling=null),xd(o,!1,g,u,x);break;case"backwards":for(u=null,g=o.child,o.child=null;g!==null;){if(i=g.alternate,i!==null&&ul(i)===null){o.child=g;break}i=g.sibling,g.sibling=u,u=g,g=i}xd(o,!0,u,null,x);break;case"together":xd(o,!1,null,null,void 0);break;default:o.memoizedState=null}return o.child}function yl(i,o){(o.mode&1)===0&&i!==null&&(i.alternate=null,o.alternate=null,o.flags|=2)}function Pr(i,o,u){if(i!==null&&(o.dependencies=i.dependencies),bi|=o.lanes,(u&o.childLanes)===0)return null;if(i!==null&&o.child!==i.child)throw Error(n(153));if(o.child!==null){for(i=o.child,u=ti(i,i.pendingProps),o.child=u,u.return=o;i.sibling!==null;)i=i.sibling,u=u.sibling=ti(i,i.pendingProps),u.return=o;u.sibling=null}return o.child}function xE(i,o,u){switch(o.tag){case 3:cy(o),fs();break;case 5:Tg(o);break;case 1:fn(o.type)&&Za(o);break;case 4:Jc(o,o.stateNode.containerInfo);break;case 10:var f=o.type._context,g=o.memoizedProps.value;lt(sl,f._currentValue),f._currentValue=g;break;case 13:if(f=o.memoizedState,f!==null)return f.dehydrated!==null?(lt(mt,mt.current&1),o.flags|=128,null):(u&o.child.childLanes)!==0?fy(i,o,u):(lt(mt,mt.current&1),i=Pr(i,o,u),i!==null?i.sibling:null);lt(mt,mt.current&1);break;case 19:if(f=(u&o.childLanes)!==0,(i.flags&128)!==0){if(f)return py(i,o,u);o.flags|=128}if(g=o.memoizedState,g!==null&&(g.rendering=null,g.tail=null,g.lastEffect=null),lt(mt,mt.current),f)break;return null;case 22:case 23:return o.lanes=0,ay(i,o,u)}return Pr(i,o,u)}var my,wd,gy,yy;my=function(i,o){for(var u=o.child;u!==null;){if(u.tag===5||u.tag===6)i.appendChild(u.stateNode);else if(u.tag!==4&&u.child!==null){u.child.return=u,u=u.child;continue}if(u===o)break;for(;u.sibling===null;){if(u.return===null||u.return===o)return;u=u.return}u.sibling.return=u.return,u=u.sibling}},wd=function(){},gy=function(i,o,u,f){var g=i.memoizedProps;if(g!==f){i=o.stateNode,ki(sr.current);var x=null;switch(u){case"input":g=ot(i,g),f=ot(i,f),x=[];break;case"select":g=T({},g,{value:void 0}),f=T({},f,{value:void 0}),x=[];break;case"textarea":g=bt(i,g),f=bt(i,f),x=[];break;default:typeof g.onClick!="function"&&typeof f.onClick=="function"&&(i.onclick=Ya)}ye(u,f);var C;u=null;for(G in g)if(!f.hasOwnProperty(G)&&g.hasOwnProperty(G)&&g[G]!=null)if(G==="style"){var L=g[G];for(C in L)L.hasOwnProperty(C)&&(u||(u={}),u[C]="")}else G!=="dangerouslySetInnerHTML"&&G!=="children"&&G!=="suppressContentEditableWarning"&&G!=="suppressHydrationWarning"&&G!=="autoFocus"&&(s.hasOwnProperty(G)?x||(x=[]):(x=x||[]).push(G,null));for(G in f){var O=f[G];if(L=g?.[G],f.hasOwnProperty(G)&&O!==L&&(O!=null||L!=null))if(G==="style")if(L){for(C in L)!L.hasOwnProperty(C)||O&&O.hasOwnProperty(C)||(u||(u={}),u[C]="");for(C in O)O.hasOwnProperty(C)&&L[C]!==O[C]&&(u||(u={}),u[C]=O[C])}else u||(x||(x=[]),x.push(G,u)),u=O;else G==="dangerouslySetInnerHTML"?(O=O?O.__html:void 0,L=L?L.__html:void 0,O!=null&&L!==O&&(x=x||[]).push(G,O)):G==="children"?typeof O!="string"&&typeof O!="number"||(x=x||[]).push(G,""+O):G!=="suppressContentEditableWarning"&&G!=="suppressHydrationWarning"&&(s.hasOwnProperty(G)?(O!=null&&G==="onScroll"&&ut("scroll",i),x||L===O||(x=[])):(x=x||[]).push(G,O))}u&&(x=x||[]).push("style",u);var G=x;(o.updateQueue=G)&&(o.flags|=4)}},yy=function(i,o,u,f){u!==f&&(o.flags|=4)};function Ro(i,o){if(!ft)switch(i.tailMode){case"hidden":o=i.tail;for(var u=null;o!==null;)o.alternate!==null&&(u=o),o=o.sibling;u===null?i.tail=null:u.sibling=null;break;case"collapsed":u=i.tail;for(var f=null;u!==null;)u.alternate!==null&&(f=u),u=u.sibling;f===null?o||i.tail===null?i.tail=null:i.tail.sibling=null:f.sibling=null}}function Yt(i){var o=i.alternate!==null&&i.alternate.child===i.child,u=0,f=0;if(o)for(var g=i.child;g!==null;)u|=g.lanes|g.childLanes,f|=g.subtreeFlags&14680064,f|=g.flags&14680064,g.return=i,g=g.sibling;else for(g=i.child;g!==null;)u|=g.lanes|g.childLanes,f|=g.subtreeFlags,f|=g.flags,g.return=i,g=g.sibling;return i.subtreeFlags|=f,i.childLanes=u,o}function wE(i,o,u){var f=o.pendingProps;switch(Uc(o),o.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Yt(o),null;case 1:return fn(o.type)&&Ja(),Yt(o),null;case 3:return f=o.stateNode,gs(),ct(dn),ct(Kt),td(),f.pendingContext&&(f.context=f.pendingContext,f.pendingContext=null),(i===null||i.child===null)&&(rl(o)?o.flags|=4:i===null||i.memoizedState.isDehydrated&&(o.flags&256)===0||(o.flags|=1024,Hn!==null&&(Id(Hn),Hn=null))),wd(i,o),Yt(o),null;case 5:Zc(o);var g=ki(bo.current);if(u=o.type,i!==null&&o.stateNode!=null)gy(i,o,u,f,g),i.ref!==o.ref&&(o.flags|=512,o.flags|=2097152);else{if(!f){if(o.stateNode===null)throw Error(n(166));return Yt(o),null}if(i=ki(sr.current),rl(o)){f=o.stateNode,u=o.type;var x=o.memoizedProps;switch(f[ir]=o,f[xo]=x,i=(o.mode&1)!==0,u){case"dialog":ut("cancel",f),ut("close",f);break;case"iframe":case"object":case"embed":ut("load",f);break;case"video":case"audio":for(g=0;g<go.length;g++)ut(go[g],f);break;case"source":ut("error",f);break;case"img":case"image":case"link":ut("error",f),ut("load",f);break;case"details":ut("toggle",f);break;case"input":Vt(f,x),ut("invalid",f);break;case"select":f._wrapperState={wasMultiple:!!x.multiple},ut("invalid",f);break;case"textarea":tr(f,x),ut("invalid",f)}ye(u,x),g=null;for(var C in x)if(x.hasOwnProperty(C)){var L=x[C];C==="children"?typeof L=="string"?f.textContent!==L&&(x.suppressHydrationWarning!==!0&&Xa(f.textContent,L,i),g=["children",L]):typeof L=="number"&&f.textContent!==""+L&&(x.suppressHydrationWarning!==!0&&Xa(f.textContent,L,i),g=["children",""+L]):s.hasOwnProperty(C)&&L!=null&&C==="onScroll"&&ut("scroll",f)}switch(u){case"input":Fe(f),Wt(f,x,!0);break;case"textarea":Fe(f),jr(f);break;case"select":case"option":break;default:typeof x.onClick=="function"&&(f.onclick=Ya)}f=g,o.updateQueue=f,f!==null&&(o.flags|=4)}else{C=g.nodeType===9?g:g.ownerDocument,i==="http://www.w3.org/1999/xhtml"&&(i=Y(u)),i==="http://www.w3.org/1999/xhtml"?u==="script"?(i=C.createElement("div"),i.innerHTML="<script><\/script>",i=i.removeChild(i.firstChild)):typeof f.is=="string"?i=C.createElement(u,{is:f.is}):(i=C.createElement(u),u==="select"&&(C=i,f.multiple?C.multiple=!0:f.size&&(C.size=f.size))):i=C.createElementNS(i,u),i[ir]=o,i[xo]=f,my(i,o,!1,!1),o.stateNode=i;e:{switch(C=Le(u,f),u){case"dialog":ut("cancel",i),ut("close",i),g=f;break;case"iframe":case"object":case"embed":ut("load",i),g=f;break;case"video":case"audio":for(g=0;g<go.length;g++)ut(go[g],i);g=f;break;case"source":ut("error",i),g=f;break;case"img":case"image":case"link":ut("error",i),ut("load",i),g=f;break;case"details":ut("toggle",i),g=f;break;case"input":Vt(i,f),g=ot(i,f),ut("invalid",i);break;case"option":g=f;break;case"select":i._wrapperState={wasMultiple:!!f.multiple},g=T({},f,{value:void 0}),ut("invalid",i);break;case"textarea":tr(i,f),g=bt(i,f),ut("invalid",i);break;default:g=f}ye(u,g),L=g;for(x in L)if(L.hasOwnProperty(x)){var O=L[x];x==="style"?ge(i,O):x==="dangerouslySetInnerHTML"?(O=O?O.__html:void 0,O!=null&&Ae(i,O)):x==="children"?typeof O=="string"?(u!=="textarea"||O!=="")&&Ve(i,O):typeof O=="number"&&Ve(i,""+O):x!=="suppressContentEditableWarning"&&x!=="suppressHydrationWarning"&&x!=="autoFocus"&&(s.hasOwnProperty(x)?O!=null&&x==="onScroll"&&ut("scroll",i):O!=null&&_(i,x,O,C))}switch(u){case"input":Fe(i),Wt(i,f,!1);break;case"textarea":Fe(i),jr(i);break;case"option":f.value!=null&&i.setAttribute("value",""+ke(f.value));break;case"select":i.multiple=!!f.multiple,x=f.value,x!=null?tn(i,!!f.multiple,x,!1):f.defaultValue!=null&&tn(i,!!f.multiple,f.defaultValue,!0);break;default:typeof g.onClick=="function"&&(i.onclick=Ya)}switch(u){case"button":case"input":case"select":case"textarea":f=!!f.autoFocus;break e;case"img":f=!0;break e;default:f=!1}}f&&(o.flags|=4)}o.ref!==null&&(o.flags|=512,o.flags|=2097152)}return Yt(o),null;case 6:if(i&&o.stateNode!=null)yy(i,o,i.memoizedProps,f);else{if(typeof f!="string"&&o.stateNode===null)throw Error(n(166));if(u=ki(bo.current),ki(sr.current),rl(o)){if(f=o.stateNode,u=o.memoizedProps,f[ir]=o,(x=f.nodeValue!==u)&&(i=Sn,i!==null))switch(i.tag){case 3:Xa(f.nodeValue,u,(i.mode&1)!==0);break;case 5:i.memoizedProps.suppressHydrationWarning!==!0&&Xa(f.nodeValue,u,(i.mode&1)!==0)}x&&(o.flags|=4)}else f=(u.nodeType===9?u:u.ownerDocument).createTextNode(f),f[ir]=o,o.stateNode=f}return Yt(o),null;case 13:if(ct(mt),f=o.memoizedState,i===null||i.memoizedState!==null&&i.memoizedState.dehydrated!==null){if(ft&&kn!==null&&(o.mode&1)!==0&&(o.flags&128)===0)wg(),fs(),o.flags|=98560,x=!1;else if(x=rl(o),f!==null&&f.dehydrated!==null){if(i===null){if(!x)throw Error(n(318));if(x=o.memoizedState,x=x!==null?x.dehydrated:null,!x)throw Error(n(317));x[ir]=o}else fs(),(o.flags&128)===0&&(o.memoizedState=null),o.flags|=4;Yt(o),x=!1}else Hn!==null&&(Id(Hn),Hn=null),x=!0;if(!x)return o.flags&65536?o:null}return(o.flags&128)!==0?(o.lanes=u,o):(f=f!==null,f!==(i!==null&&i.memoizedState!==null)&&f&&(o.child.flags|=8192,(o.mode&1)!==0&&(i===null||(mt.current&1)!==0?It===0&&(It=3):Ld())),o.updateQueue!==null&&(o.flags|=4),Yt(o),null);case 4:return gs(),wd(i,o),i===null&&yo(o.stateNode.containerInfo),Yt(o),null;case 10:return Kc(o.type._context),Yt(o),null;case 17:return fn(o.type)&&Ja(),Yt(o),null;case 19:if(ct(mt),x=o.memoizedState,x===null)return Yt(o),null;if(f=(o.flags&128)!==0,C=x.rendering,C===null)if(f)Ro(x,!1);else{if(It!==0||i!==null&&(i.flags&128)!==0)for(i=o.child;i!==null;){if(C=ul(i),C!==null){for(o.flags|=128,Ro(x,!1),f=C.updateQueue,f!==null&&(o.updateQueue=f,o.flags|=4),o.subtreeFlags=0,f=u,u=o.child;u!==null;)x=u,i=f,x.flags&=14680066,C=x.alternate,C===null?(x.childLanes=0,x.lanes=i,x.child=null,x.subtreeFlags=0,x.memoizedProps=null,x.memoizedState=null,x.updateQueue=null,x.dependencies=null,x.stateNode=null):(x.childLanes=C.childLanes,x.lanes=C.lanes,x.child=C.child,x.subtreeFlags=0,x.deletions=null,x.memoizedProps=C.memoizedProps,x.memoizedState=C.memoizedState,x.updateQueue=C.updateQueue,x.type=C.type,i=C.dependencies,x.dependencies=i===null?null:{lanes:i.lanes,firstContext:i.firstContext}),u=u.sibling;return lt(mt,mt.current&1|2),o.child}i=i.sibling}x.tail!==null&&Qe()>ws&&(o.flags|=128,f=!0,Ro(x,!1),o.lanes=4194304)}else{if(!f)if(i=ul(C),i!==null){if(o.flags|=128,f=!0,u=i.updateQueue,u!==null&&(o.updateQueue=u,o.flags|=4),Ro(x,!0),x.tail===null&&x.tailMode==="hidden"&&!C.alternate&&!ft)return Yt(o),null}else 2*Qe()-x.renderingStartTime>ws&&u!==1073741824&&(o.flags|=128,f=!0,Ro(x,!1),o.lanes=4194304);x.isBackwards?(C.sibling=o.child,o.child=C):(u=x.last,u!==null?u.sibling=C:o.child=C,x.last=C)}return x.tail!==null?(o=x.tail,x.rendering=o,x.tail=o.sibling,x.renderingStartTime=Qe(),o.sibling=null,u=mt.current,lt(mt,f?u&1|2:u&1),o):(Yt(o),null);case 22:case 23:return Nd(),f=o.memoizedState!==null,i!==null&&i.memoizedState!==null!==f&&(o.flags|=8192),f&&(o.mode&1)!==0?(Cn&1073741824)!==0&&(Yt(o),o.subtreeFlags&6&&(o.flags|=8192)):Yt(o),null;case 24:return null;case 25:return null}throw Error(n(156,o.tag))}function SE(i,o){switch(Uc(o),o.tag){case 1:return fn(o.type)&&Ja(),i=o.flags,i&65536?(o.flags=i&-65537|128,o):null;case 3:return gs(),ct(dn),ct(Kt),td(),i=o.flags,(i&65536)!==0&&(i&128)===0?(o.flags=i&-65537|128,o):null;case 5:return Zc(o),null;case 13:if(ct(mt),i=o.memoizedState,i!==null&&i.dehydrated!==null){if(o.alternate===null)throw Error(n(340));fs()}return i=o.flags,i&65536?(o.flags=i&-65537|128,o):null;case 19:return ct(mt),null;case 4:return gs(),null;case 10:return Kc(o.type._context),null;case 22:case 23:return Nd(),null;case 24:return null;default:return null}}var vl=!1,Qt=!1,kE=typeof WeakSet=="function"?WeakSet:Set,be=null;function vs(i,o){var u=i.ref;if(u!==null)if(typeof u=="function")try{u(null)}catch(f){vt(i,o,f)}else u.current=null}function Sd(i,o,u){try{u()}catch(f){vt(i,o,f)}}var vy=!1;function CE(i,o){if(Nc=Fa,i=Ym(),Ec(i)){if("selectionStart"in i)var u={start:i.selectionStart,end:i.selectionEnd};else e:{u=(u=i.ownerDocument)&&u.defaultView||window;var f=u.getSelection&&u.getSelection();if(f&&f.rangeCount!==0){u=f.anchorNode;var g=f.anchorOffset,x=f.focusNode;f=f.focusOffset;try{u.nodeType,x.nodeType}catch{u=null;break e}var C=0,L=-1,O=-1,G=0,re=0,se=i,te=null;t:for(;;){for(var we;se!==u||g!==0&&se.nodeType!==3||(L=C+g),se!==x||f!==0&&se.nodeType!==3||(O=C+f),se.nodeType===3&&(C+=se.nodeValue.length),(we=se.firstChild)!==null;)te=se,se=we;for(;;){if(se===i)break t;if(te===u&&++G===g&&(L=C),te===x&&++re===f&&(O=C),(we=se.nextSibling)!==null)break;se=te,te=se.parentNode}se=we}u=L===-1||O===-1?null:{start:L,end:O}}else u=null}u=u||{start:0,end:0}}else u=null;for(Lc={focusedElem:i,selectionRange:u},Fa=!1,be=o;be!==null;)if(o=be,i=o.child,(o.subtreeFlags&1028)!==0&&i!==null)i.return=o,be=i;else for(;be!==null;){o=be;try{var Ee=o.alternate;if((o.flags&1024)!==0)switch(o.tag){case 0:case 11:case 15:break;case 1:if(Ee!==null){var Pe=Ee.memoizedProps,kt=Ee.memoizedState,$=o.stateNode,V=$.getSnapshotBeforeUpdate(o.elementType===o.type?Pe:Wn(o.type,Pe),kt);$.__reactInternalSnapshotBeforeUpdate=V}break;case 3:var W=o.stateNode.containerInfo;W.nodeType===1?W.textContent="":W.nodeType===9&&W.documentElement&&W.removeChild(W.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(n(163))}}catch(de){vt(o,o.return,de)}if(i=o.sibling,i!==null){i.return=o.return,be=i;break}be=o.return}return Ee=vy,vy=!1,Ee}function Ao(i,o,u){var f=o.updateQueue;if(f=f!==null?f.lastEffect:null,f!==null){var g=f=f.next;do{if((g.tag&i)===i){var x=g.destroy;g.destroy=void 0,x!==void 0&&Sd(o,u,x)}g=g.next}while(g!==f)}}function xl(i,o){if(o=o.updateQueue,o=o!==null?o.lastEffect:null,o!==null){var u=o=o.next;do{if((u.tag&i)===i){var f=u.create;u.destroy=f()}u=u.next}while(u!==o)}}function kd(i){var o=i.ref;if(o!==null){var u=i.stateNode;switch(i.tag){case 5:i=u;break;default:i=u}typeof o=="function"?o(i):o.current=i}}function xy(i){var o=i.alternate;o!==null&&(i.alternate=null,xy(o)),i.child=null,i.deletions=null,i.sibling=null,i.tag===5&&(o=i.stateNode,o!==null&&(delete o[ir],delete o[xo],delete o[Fc],delete o[sE],delete o[oE])),i.stateNode=null,i.return=null,i.dependencies=null,i.memoizedProps=null,i.memoizedState=null,i.pendingProps=null,i.stateNode=null,i.updateQueue=null}function wy(i){return i.tag===5||i.tag===3||i.tag===4}function Sy(i){e:for(;;){for(;i.sibling===null;){if(i.return===null||wy(i.return))return null;i=i.return}for(i.sibling.return=i.return,i=i.sibling;i.tag!==5&&i.tag!==6&&i.tag!==18;){if(i.flags&2||i.child===null||i.tag===4)continue e;i.child.return=i,i=i.child}if(!(i.flags&2))return i.stateNode}}function Cd(i,o,u){var f=i.tag;if(f===5||f===6)i=i.stateNode,o?u.nodeType===8?u.parentNode.insertBefore(i,o):u.insertBefore(i,o):(u.nodeType===8?(o=u.parentNode,o.insertBefore(i,u)):(o=u,o.appendChild(i)),u=u._reactRootContainer,u!=null||o.onclick!==null||(o.onclick=Ya));else if(f!==4&&(i=i.child,i!==null))for(Cd(i,o,u),i=i.sibling;i!==null;)Cd(i,o,u),i=i.sibling}function bd(i,o,u){var f=i.tag;if(f===5||f===6)i=i.stateNode,o?u.insertBefore(i,o):u.appendChild(i);else if(f!==4&&(i=i.child,i!==null))for(bd(i,o,u),i=i.sibling;i!==null;)bd(i,o,u),i=i.sibling}var Bt=null,qn=!1;function Yr(i,o,u){for(u=u.child;u!==null;)ky(i,o,u),u=u.sibling}function ky(i,o,u){if(rr&&typeof rr.onCommitFiberUnmount=="function")try{rr.onCommitFiberUnmount(Ma,u)}catch{}switch(u.tag){case 5:Qt||vs(u,o);case 6:var f=Bt,g=qn;Bt=null,Yr(i,o,u),Bt=f,qn=g,Bt!==null&&(qn?(i=Bt,u=u.stateNode,i.nodeType===8?i.parentNode.removeChild(u):i.removeChild(u)):Bt.removeChild(u.stateNode));break;case 18:Bt!==null&&(qn?(i=Bt,u=u.stateNode,i.nodeType===8?Oc(i.parentNode,u):i.nodeType===1&&Oc(i,u),ao(i)):Oc(Bt,u.stateNode));break;case 4:f=Bt,g=qn,Bt=u.stateNode.containerInfo,qn=!0,Yr(i,o,u),Bt=f,qn=g;break;case 0:case 11:case 14:case 15:if(!Qt&&(f=u.updateQueue,f!==null&&(f=f.lastEffect,f!==null))){g=f=f.next;do{var x=g,C=x.destroy;x=x.tag,C!==void 0&&((x&2)!==0||(x&4)!==0)&&Sd(u,o,C),g=g.next}while(g!==f)}Yr(i,o,u);break;case 1:if(!Qt&&(vs(u,o),f=u.stateNode,typeof f.componentWillUnmount=="function"))try{f.props=u.memoizedProps,f.state=u.memoizedState,f.componentWillUnmount()}catch(L){vt(u,o,L)}Yr(i,o,u);break;case 21:Yr(i,o,u);break;case 22:u.mode&1?(Qt=(f=Qt)||u.memoizedState!==null,Yr(i,o,u),Qt=f):Yr(i,o,u);break;default:Yr(i,o,u)}}function Cy(i){var o=i.updateQueue;if(o!==null){i.updateQueue=null;var u=i.stateNode;u===null&&(u=i.stateNode=new kE),o.forEach(function(f){var g=ME.bind(null,i,f);u.has(f)||(u.add(f),f.then(g,g))})}}function Gn(i,o){var u=o.deletions;if(u!==null)for(var f=0;f<u.length;f++){var g=u[f];try{var x=i,C=o,L=C;e:for(;L!==null;){switch(L.tag){case 5:Bt=L.stateNode,qn=!1;break e;case 3:Bt=L.stateNode.containerInfo,qn=!0;break e;case 4:Bt=L.stateNode.containerInfo,qn=!0;break e}L=L.return}if(Bt===null)throw Error(n(160));ky(x,C,g),Bt=null,qn=!1;var O=g.alternate;O!==null&&(O.return=null),g.return=null}catch(G){vt(g,o,G)}}if(o.subtreeFlags&12854)for(o=o.child;o!==null;)by(o,i),o=o.sibling}function by(i,o){var u=i.alternate,f=i.flags;switch(i.tag){case 0:case 11:case 14:case 15:if(Gn(o,i),ar(i),f&4){try{Ao(3,i,i.return),xl(3,i)}catch(Pe){vt(i,i.return,Pe)}try{Ao(5,i,i.return)}catch(Pe){vt(i,i.return,Pe)}}break;case 1:Gn(o,i),ar(i),f&512&&u!==null&&vs(u,u.return);break;case 5:if(Gn(o,i),ar(i),f&512&&u!==null&&vs(u,u.return),i.flags&32){var g=i.stateNode;try{Ve(g,"")}catch(Pe){vt(i,i.return,Pe)}}if(f&4&&(g=i.stateNode,g!=null)){var x=i.memoizedProps,C=u!==null?u.memoizedProps:x,L=i.type,O=i.updateQueue;if(i.updateQueue=null,O!==null)try{L==="input"&&x.type==="radio"&&x.name!=null&&en(g,x),Le(L,C);var G=Le(L,x);for(C=0;C<O.length;C+=2){var re=O[C],se=O[C+1];re==="style"?ge(g,se):re==="dangerouslySetInnerHTML"?Ae(g,se):re==="children"?Ve(g,se):_(g,re,se,G)}switch(L){case"input":et(g,x);break;case"textarea":He(g,x);break;case"select":var te=g._wrapperState.wasMultiple;g._wrapperState.wasMultiple=!!x.multiple;var we=x.value;we!=null?tn(g,!!x.multiple,we,!1):te!==!!x.multiple&&(x.defaultValue!=null?tn(g,!!x.multiple,x.defaultValue,!0):tn(g,!!x.multiple,x.multiple?[]:"",!1))}g[xo]=x}catch(Pe){vt(i,i.return,Pe)}}break;case 6:if(Gn(o,i),ar(i),f&4){if(i.stateNode===null)throw Error(n(162));g=i.stateNode,x=i.memoizedProps;try{g.nodeValue=x}catch(Pe){vt(i,i.return,Pe)}}break;case 3:if(Gn(o,i),ar(i),f&4&&u!==null&&u.memoizedState.isDehydrated)try{ao(o.containerInfo)}catch(Pe){vt(i,i.return,Pe)}break;case 4:Gn(o,i),ar(i);break;case 13:Gn(o,i),ar(i),g=i.child,g.flags&8192&&(x=g.memoizedState!==null,g.stateNode.isHidden=x,!x||g.alternate!==null&&g.alternate.memoizedState!==null||(Pd=Qe())),f&4&&Cy(i);break;case 22:if(re=u!==null&&u.memoizedState!==null,i.mode&1?(Qt=(G=Qt)||re,Gn(o,i),Qt=G):Gn(o,i),ar(i),f&8192){if(G=i.memoizedState!==null,(i.stateNode.isHidden=G)&&!re&&(i.mode&1)!==0)for(be=i,re=i.child;re!==null;){for(se=be=re;be!==null;){switch(te=be,we=te.child,te.tag){case 0:case 11:case 14:case 15:Ao(4,te,te.return);break;case 1:vs(te,te.return);var Ee=te.stateNode;if(typeof Ee.componentWillUnmount=="function"){f=te,u=te.return;try{o=f,Ee.props=o.memoizedProps,Ee.state=o.memoizedState,Ee.componentWillUnmount()}catch(Pe){vt(f,u,Pe)}}break;case 5:vs(te,te.return);break;case 22:if(te.memoizedState!==null){Py(se);continue}}we!==null?(we.return=te,be=we):Py(se)}re=re.sibling}e:for(re=null,se=i;;){if(se.tag===5){if(re===null){re=se;try{g=se.stateNode,G?(x=g.style,typeof x.setProperty=="function"?x.setProperty("display","none","important"):x.display="none"):(L=se.stateNode,O=se.memoizedProps.style,C=O!=null&&O.hasOwnProperty("display")?O.display:null,L.style.display=H("display",C))}catch(Pe){vt(i,i.return,Pe)}}}else if(se.tag===6){if(re===null)try{se.stateNode.nodeValue=G?"":se.memoizedProps}catch(Pe){vt(i,i.return,Pe)}}else if((se.tag!==22&&se.tag!==23||se.memoizedState===null||se===i)&&se.child!==null){se.child.return=se,se=se.child;continue}if(se===i)break e;for(;se.sibling===null;){if(se.return===null||se.return===i)break e;re===se&&(re=null),se=se.return}re===se&&(re=null),se.sibling.return=se.return,se=se.sibling}}break;case 19:Gn(o,i),ar(i),f&4&&Cy(i);break;case 21:break;default:Gn(o,i),ar(i)}}function ar(i){var o=i.flags;if(o&2){try{e:{for(var u=i.return;u!==null;){if(wy(u)){var f=u;break e}u=u.return}throw Error(n(160))}switch(f.tag){case 5:var g=f.stateNode;f.flags&32&&(Ve(g,""),f.flags&=-33);var x=Sy(i);bd(i,x,g);break;case 3:case 4:var C=f.stateNode.containerInfo,L=Sy(i);Cd(i,L,C);break;default:throw Error(n(161))}}catch(O){vt(i,i.return,O)}i.flags&=-3}o&4096&&(i.flags&=-4097)}function bE(i,o,u){be=i,Ey(i)}function Ey(i,o,u){for(var f=(i.mode&1)!==0;be!==null;){var g=be,x=g.child;if(g.tag===22&&f){var C=g.memoizedState!==null||vl;if(!C){var L=g.alternate,O=L!==null&&L.memoizedState!==null||Qt;L=vl;var G=Qt;if(vl=C,(Qt=O)&&!G)for(be=g;be!==null;)C=be,O=C.child,C.tag===22&&C.memoizedState!==null?Ty(g):O!==null?(O.return=C,be=O):Ty(g);for(;x!==null;)be=x,Ey(x),x=x.sibling;be=g,vl=L,Qt=G}_y(i)}else(g.subtreeFlags&8772)!==0&&x!==null?(x.return=g,be=x):_y(i)}}function _y(i){for(;be!==null;){var o=be;if((o.flags&8772)!==0){var u=o.alternate;try{if((o.flags&8772)!==0)switch(o.tag){case 0:case 11:case 15:Qt||xl(5,o);break;case 1:var f=o.stateNode;if(o.flags&4&&!Qt)if(u===null)f.componentDidMount();else{var g=o.elementType===o.type?u.memoizedProps:Wn(o.type,u.memoizedProps);f.componentDidUpdate(g,u.memoizedState,f.__reactInternalSnapshotBeforeUpdate)}var x=o.updateQueue;x!==null&&Pg(o,x,f);break;case 3:var C=o.updateQueue;if(C!==null){if(u=null,o.child!==null)switch(o.child.tag){case 5:u=o.child.stateNode;break;case 1:u=o.child.stateNode}Pg(o,C,u)}break;case 5:var L=o.stateNode;if(u===null&&o.flags&4){u=L;var O=o.memoizedProps;switch(o.type){case"button":case"input":case"select":case"textarea":O.autoFocus&&u.focus();break;case"img":O.src&&(u.src=O.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(o.memoizedState===null){var G=o.alternate;if(G!==null){var re=G.memoizedState;if(re!==null){var se=re.dehydrated;se!==null&&ao(se)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(n(163))}Qt||o.flags&512&&kd(o)}catch(te){vt(o,o.return,te)}}if(o===i){be=null;break}if(u=o.sibling,u!==null){u.return=o.return,be=u;break}be=o.return}}function Py(i){for(;be!==null;){var o=be;if(o===i){be=null;break}var u=o.sibling;if(u!==null){u.return=o.return,be=u;break}be=o.return}}function Ty(i){for(;be!==null;){var o=be;try{switch(o.tag){case 0:case 11:case 15:var u=o.return;try{xl(4,o)}catch(O){vt(o,u,O)}break;case 1:var f=o.stateNode;if(typeof f.componentDidMount=="function"){var g=o.return;try{f.componentDidMount()}catch(O){vt(o,g,O)}}var x=o.return;try{kd(o)}catch(O){vt(o,x,O)}break;case 5:var C=o.return;try{kd(o)}catch(O){vt(o,C,O)}}}catch(O){vt(o,o.return,O)}if(o===i){be=null;break}var L=o.sibling;if(L!==null){L.return=o.return,be=L;break}be=o.return}}var EE=Math.ceil,wl=j.ReactCurrentDispatcher,Ed=j.ReactCurrentOwner,Ln=j.ReactCurrentBatchConfig,Ke=0,Dt=null,Et=null,Ut=0,Cn=0,xs=Wr(0),It=0,Io=null,bi=0,Sl=0,_d=0,Mo=null,pn=null,Pd=0,ws=1/0,Tr=null,kl=!1,Td=null,Qr=null,Cl=!1,Jr=null,bl=0,No=0,Rd=null,El=-1,_l=0;function rn(){return(Ke&6)!==0?Qe():El!==-1?El:El=Qe()}function Zr(i){return(i.mode&1)===0?1:(Ke&2)!==0&&Ut!==0?Ut&-Ut:lE.transition!==null?(_l===0&&(_l=Sm()),_l):(i=Ze,i!==0||(i=window.event,i=i===void 0?16:Am(i.type)),i)}function Kn(i,o,u,f){if(50<No)throw No=0,Rd=null,Error(n(185));no(i,u,f),((Ke&2)===0||i!==Dt)&&(i===Dt&&((Ke&2)===0&&(Sl|=u),It===4&&ei(i,Ut)),mn(i,f),u===1&&Ke===0&&(o.mode&1)===0&&(ws=Qe()+500,el&&Gr()))}function mn(i,o){var u=i.callbackNode;lb(i,o);var f=ja(i,i===Dt?Ut:0);if(f===0)u!==null&&pt(u),i.callbackNode=null,i.callbackPriority=0;else if(o=f&-f,i.callbackPriority!==o){if(u!=null&&pt(u),o===1)i.tag===0?aE(Ay.bind(null,i)):mg(Ay.bind(null,i)),rE(function(){(Ke&6)===0&&Gr()}),u=null;else{switch(km(f)){case 1:u=cn;break;case 4:u=St;break;case 16:u=Bn;break;case 536870912:u=wm;break;default:u=Bn}u=Fy(u,Ry.bind(null,i))}i.callbackPriority=o,i.callbackNode=u}}function Ry(i,o){if(El=-1,_l=0,(Ke&6)!==0)throw Error(n(327));var u=i.callbackNode;if(Ss()&&i.callbackNode!==u)return null;var f=ja(i,i===Dt?Ut:0);if(f===0)return null;if((f&30)!==0||(f&i.expiredLanes)!==0||o)o=Pl(i,f);else{o=f;var g=Ke;Ke|=2;var x=My();(Dt!==i||Ut!==o)&&(Tr=null,ws=Qe()+500,_i(i,o));do try{TE();break}catch(L){Iy(i,L)}while(!0);Gc(),wl.current=x,Ke=g,Et!==null?o=0:(Dt=null,Ut=0,o=It)}if(o!==0){if(o===2&&(g=uc(i),g!==0&&(f=g,o=Ad(i,g))),o===1)throw u=Io,_i(i,0),ei(i,f),mn(i,Qe()),u;if(o===6)ei(i,f);else{if(g=i.current.alternate,(f&30)===0&&!_E(g)&&(o=Pl(i,f),o===2&&(x=uc(i),x!==0&&(f=x,o=Ad(i,x))),o===1))throw u=Io,_i(i,0),ei(i,f),mn(i,Qe()),u;switch(i.finishedWork=g,i.finishedLanes=f,o){case 0:case 1:throw Error(n(345));case 2:Pi(i,pn,Tr);break;case 3:if(ei(i,f),(f&130023424)===f&&(o=Pd+500-Qe(),10<o)){if(ja(i,0)!==0)break;if(g=i.suspendedLanes,(g&f)!==f){rn(),i.pingedLanes|=i.suspendedLanes&g;break}i.timeoutHandle=Dc(Pi.bind(null,i,pn,Tr),o);break}Pi(i,pn,Tr);break;case 4:if(ei(i,f),(f&4194240)===f)break;for(o=i.eventTimes,g=-1;0<f;){var C=31-Un(f);x=1<<C,C=o[C],C>g&&(g=C),f&=~x}if(f=g,f=Qe()-f,f=(120>f?120:480>f?480:1080>f?1080:1920>f?1920:3e3>f?3e3:4320>f?4320:1960*EE(f/1960))-f,10<f){i.timeoutHandle=Dc(Pi.bind(null,i,pn,Tr),f);break}Pi(i,pn,Tr);break;case 5:Pi(i,pn,Tr);break;default:throw Error(n(329))}}}return mn(i,Qe()),i.callbackNode===u?Ry.bind(null,i):null}function Ad(i,o){var u=Mo;return i.current.memoizedState.isDehydrated&&(_i(i,o).flags|=256),i=Pl(i,o),i!==2&&(o=pn,pn=u,o!==null&&Id(o)),i}function Id(i){pn===null?pn=i:pn.push.apply(pn,i)}function _E(i){for(var o=i;;){if(o.flags&16384){var u=o.updateQueue;if(u!==null&&(u=u.stores,u!==null))for(var f=0;f<u.length;f++){var g=u[f],x=g.getSnapshot;g=g.value;try{if(!$n(x(),g))return!1}catch{return!1}}}if(u=o.child,o.subtreeFlags&16384&&u!==null)u.return=o,o=u;else{if(o===i)break;for(;o.sibling===null;){if(o.return===null||o.return===i)return!0;o=o.return}o.sibling.return=o.return,o=o.sibling}}return!0}function ei(i,o){for(o&=~_d,o&=~Sl,i.suspendedLanes|=o,i.pingedLanes&=~o,i=i.expirationTimes;0<o;){var u=31-Un(o),f=1<<u;i[u]=-1,o&=~f}}function Ay(i){if((Ke&6)!==0)throw Error(n(327));Ss();var o=ja(i,0);if((o&1)===0)return mn(i,Qe()),null;var u=Pl(i,o);if(i.tag!==0&&u===2){var f=uc(i);f!==0&&(o=f,u=Ad(i,f))}if(u===1)throw u=Io,_i(i,0),ei(i,o),mn(i,Qe()),u;if(u===6)throw Error(n(345));return i.finishedWork=i.current.alternate,i.finishedLanes=o,Pi(i,pn,Tr),mn(i,Qe()),null}function Md(i,o){var u=Ke;Ke|=1;try{return i(o)}finally{Ke=u,Ke===0&&(ws=Qe()+500,el&&Gr())}}function Ei(i){Jr!==null&&Jr.tag===0&&(Ke&6)===0&&Ss();var o=Ke;Ke|=1;var u=Ln.transition,f=Ze;try{if(Ln.transition=null,Ze=1,i)return i()}finally{Ze=f,Ln.transition=u,Ke=o,(Ke&6)===0&&Gr()}}function Nd(){Cn=xs.current,ct(xs)}function _i(i,o){i.finishedWork=null,i.finishedLanes=0;var u=i.timeoutHandle;if(u!==-1&&(i.timeoutHandle=-1,nE(u)),Et!==null)for(u=Et.return;u!==null;){var f=u;switch(Uc(f),f.tag){case 1:f=f.type.childContextTypes,f!=null&&Ja();break;case 3:gs(),ct(dn),ct(Kt),td();break;case 5:Zc(f);break;case 4:gs();break;case 13:ct(mt);break;case 19:ct(mt);break;case 10:Kc(f.type._context);break;case 22:case 23:Nd()}u=u.return}if(Dt=i,Et=i=ti(i.current,null),Ut=Cn=o,It=0,Io=null,_d=Sl=bi=0,pn=Mo=null,Si!==null){for(o=0;o<Si.length;o++)if(u=Si[o],f=u.interleaved,f!==null){u.interleaved=null;var g=f.next,x=u.pending;if(x!==null){var C=x.next;x.next=g,f.next=C}u.pending=f}Si=null}return i}function Iy(i,o){do{var u=Et;try{if(Gc(),cl.current=pl,dl){for(var f=gt.memoizedState;f!==null;){var g=f.queue;g!==null&&(g.pending=null),f=f.next}dl=!1}if(Ci=0,jt=At=gt=null,Eo=!1,_o=0,Ed.current=null,u===null||u.return===null){It=1,Io=o,Et=null;break}e:{var x=i,C=u.return,L=u,O=o;if(o=Ut,L.flags|=32768,O!==null&&typeof O=="object"&&typeof O.then=="function"){var G=O,re=L,se=re.tag;if((re.mode&1)===0&&(se===0||se===11||se===15)){var te=re.alternate;te?(re.updateQueue=te.updateQueue,re.memoizedState=te.memoizedState,re.lanes=te.lanes):(re.updateQueue=null,re.memoizedState=null)}var we=ny(C);if(we!==null){we.flags&=-257,ry(we,C,L,x,o),we.mode&1&&ty(x,G,o),o=we,O=G;var Ee=o.updateQueue;if(Ee===null){var Pe=new Set;Pe.add(O),o.updateQueue=Pe}else Ee.add(O);break e}else{if((o&1)===0){ty(x,G,o),Ld();break e}O=Error(n(426))}}else if(ft&&L.mode&1){var kt=ny(C);if(kt!==null){(kt.flags&65536)===0&&(kt.flags|=256),ry(kt,C,L,x,o),Wc(ys(O,L));break e}}x=O=ys(O,L),It!==4&&(It=2),Mo===null?Mo=[x]:Mo.push(x),x=C;do{switch(x.tag){case 3:x.flags|=65536,o&=-o,x.lanes|=o;var $=Zg(x,O,o);_g(x,$);break e;case 1:L=O;var V=x.type,W=x.stateNode;if((x.flags&128)===0&&(typeof V.getDerivedStateFromError=="function"||W!==null&&typeof W.componentDidCatch=="function"&&(Qr===null||!Qr.has(W)))){x.flags|=65536,o&=-o,x.lanes|=o;var de=ey(x,L,o);_g(x,de);break e}}x=x.return}while(x!==null)}Ly(u)}catch(Re){o=Re,Et===u&&u!==null&&(Et=u=u.return);continue}break}while(!0)}function My(){var i=wl.current;return wl.current=pl,i===null?pl:i}function Ld(){(It===0||It===3||It===2)&&(It=4),Dt===null||(bi&268435455)===0&&(Sl&268435455)===0||ei(Dt,Ut)}function Pl(i,o){var u=Ke;Ke|=2;var f=My();(Dt!==i||Ut!==o)&&(Tr=null,_i(i,o));do try{PE();break}catch(g){Iy(i,g)}while(!0);if(Gc(),Ke=u,wl.current=f,Et!==null)throw Error(n(261));return Dt=null,Ut=0,It}function PE(){for(;Et!==null;)Ny(Et)}function TE(){for(;Et!==null&&!Rt();)Ny(Et)}function Ny(i){var o=Oy(i.alternate,i,Cn);i.memoizedProps=i.pendingProps,o===null?Ly(i):Et=o,Ed.current=null}function Ly(i){var o=i;do{var u=o.alternate;if(i=o.return,(o.flags&32768)===0){if(u=wE(u,o,Cn),u!==null){Et=u;return}}else{if(u=SE(u,o),u!==null){u.flags&=32767,Et=u;return}if(i!==null)i.flags|=32768,i.subtreeFlags=0,i.deletions=null;else{It=6,Et=null;return}}if(o=o.sibling,o!==null){Et=o;return}Et=o=i}while(o!==null);It===0&&(It=5)}function Pi(i,o,u){var f=Ze,g=Ln.transition;try{Ln.transition=null,Ze=1,RE(i,o,u,f)}finally{Ln.transition=g,Ze=f}return null}function RE(i,o,u,f){do Ss();while(Jr!==null);if((Ke&6)!==0)throw Error(n(327));u=i.finishedWork;var g=i.finishedLanes;if(u===null)return null;if(i.finishedWork=null,i.finishedLanes=0,u===i.current)throw Error(n(177));i.callbackNode=null,i.callbackPriority=0;var x=u.lanes|u.childLanes;if(ub(i,x),i===Dt&&(Et=Dt=null,Ut=0),(u.subtreeFlags&2064)===0&&(u.flags&2064)===0||Cl||(Cl=!0,Fy(Bn,function(){return Ss(),null})),x=(u.flags&15990)!==0,(u.subtreeFlags&15990)!==0||x){x=Ln.transition,Ln.transition=null;var C=Ze;Ze=1;var L=Ke;Ke|=4,Ed.current=null,CE(i,u),by(u,i),Xb(Lc),Fa=!!Nc,Lc=Nc=null,i.current=u,bE(u),Rn(),Ke=L,Ze=C,Ln.transition=x}else i.current=u;if(Cl&&(Cl=!1,Jr=i,bl=g),x=i.pendingLanes,x===0&&(Qr=null),rb(u.stateNode),mn(i,Qe()),o!==null)for(f=i.onRecoverableError,u=0;u<o.length;u++)g=o[u],f(g.value,{componentStack:g.stack,digest:g.digest});if(kl)throw kl=!1,i=Td,Td=null,i;return(bl&1)!==0&&i.tag!==0&&Ss(),x=i.pendingLanes,(x&1)!==0?i===Rd?No++:(No=0,Rd=i):No=0,Gr(),null}function Ss(){if(Jr!==null){var i=km(bl),o=Ln.transition,u=Ze;try{if(Ln.transition=null,Ze=16>i?16:i,Jr===null)var f=!1;else{if(i=Jr,Jr=null,bl=0,(Ke&6)!==0)throw Error(n(331));var g=Ke;for(Ke|=4,be=i.current;be!==null;){var x=be,C=x.child;if((be.flags&16)!==0){var L=x.deletions;if(L!==null){for(var O=0;O<L.length;O++){var G=L[O];for(be=G;be!==null;){var re=be;switch(re.tag){case 0:case 11:case 15:Ao(8,re,x)}var se=re.child;if(se!==null)se.return=re,be=se;else for(;be!==null;){re=be;var te=re.sibling,we=re.return;if(xy(re),re===G){be=null;break}if(te!==null){te.return=we,be=te;break}be=we}}}var Ee=x.alternate;if(Ee!==null){var Pe=Ee.child;if(Pe!==null){Ee.child=null;do{var kt=Pe.sibling;Pe.sibling=null,Pe=kt}while(Pe!==null)}}be=x}}if((x.subtreeFlags&2064)!==0&&C!==null)C.return=x,be=C;else e:for(;be!==null;){if(x=be,(x.flags&2048)!==0)switch(x.tag){case 0:case 11:case 15:Ao(9,x,x.return)}var $=x.sibling;if($!==null){$.return=x.return,be=$;break e}be=x.return}}var V=i.current;for(be=V;be!==null;){C=be;var W=C.child;if((C.subtreeFlags&2064)!==0&&W!==null)W.return=C,be=W;else e:for(C=V;be!==null;){if(L=be,(L.flags&2048)!==0)try{switch(L.tag){case 0:case 11:case 15:xl(9,L)}}catch(Re){vt(L,L.return,Re)}if(L===C){be=null;break e}var de=L.sibling;if(de!==null){de.return=L.return,be=de;break e}be=L.return}}if(Ke=g,Gr(),rr&&typeof rr.onPostCommitFiberRoot=="function")try{rr.onPostCommitFiberRoot(Ma,i)}catch{}f=!0}return f}finally{Ze=u,Ln.transition=o}}return!1}function jy(i,o,u){o=ys(u,o),o=Zg(i,o,1),i=Xr(i,o,1),o=rn(),i!==null&&(no(i,1,o),mn(i,o))}function vt(i,o,u){if(i.tag===3)jy(i,i,u);else for(;o!==null;){if(o.tag===3){jy(o,i,u);break}else if(o.tag===1){var f=o.stateNode;if(typeof o.type.getDerivedStateFromError=="function"||typeof f.componentDidCatch=="function"&&(Qr===null||!Qr.has(f))){i=ys(u,i),i=ey(o,i,1),o=Xr(o,i,1),i=rn(),o!==null&&(no(o,1,i),mn(o,i));break}}o=o.return}}function AE(i,o,u){var f=i.pingCache;f!==null&&f.delete(o),o=rn(),i.pingedLanes|=i.suspendedLanes&u,Dt===i&&(Ut&u)===u&&(It===4||It===3&&(Ut&130023424)===Ut&&500>Qe()-Pd?_i(i,0):_d|=u),mn(i,o)}function Dy(i,o){o===0&&((i.mode&1)===0?o=1:(o=La,La<<=1,(La&130023424)===0&&(La=4194304)));var u=rn();i=Er(i,o),i!==null&&(no(i,o,u),mn(i,u))}function IE(i){var o=i.memoizedState,u=0;o!==null&&(u=o.retryLane),Dy(i,u)}function ME(i,o){var u=0;switch(i.tag){case 13:var f=i.stateNode,g=i.memoizedState;g!==null&&(u=g.retryLane);break;case 19:f=i.stateNode;break;default:throw Error(n(314))}f!==null&&f.delete(o),Dy(i,u)}var Oy;Oy=function(i,o,u){if(i!==null)if(i.memoizedProps!==o.pendingProps||dn.current)hn=!0;else{if((i.lanes&u)===0&&(o.flags&128)===0)return hn=!1,xE(i,o,u);hn=(i.flags&131072)!==0}else hn=!1,ft&&(o.flags&1048576)!==0&&gg(o,nl,o.index);switch(o.lanes=0,o.tag){case 2:var f=o.type;yl(i,o),i=o.pendingProps;var g=us(o,Kt.current);ms(o,u),g=id(null,o,f,i,g,u);var x=sd();return o.flags|=1,typeof g=="object"&&g!==null&&typeof g.render=="function"&&g.$$typeof===void 0?(o.tag=1,o.memoizedState=null,o.updateQueue=null,fn(f)?(x=!0,Za(o)):x=!1,o.memoizedState=g.state!==null&&g.state!==void 0?g.state:null,Qc(o),g.updater=ml,o.stateNode=g,g._reactInternals=o,dd(o,f,i,u),o=md(null,o,f,!0,x,u)):(o.tag=0,ft&&x&&Bc(o),nn(null,o,g,u),o=o.child),o;case 16:f=o.elementType;e:{switch(yl(i,o),i=o.pendingProps,g=f._init,f=g(f._payload),o.type=f,g=o.tag=LE(f),i=Wn(f,i),g){case 0:o=pd(null,o,f,i,u);break e;case 1:o=uy(null,o,f,i,u);break e;case 11:o=iy(null,o,f,i,u);break e;case 14:o=sy(null,o,f,Wn(f.type,i),u);break e}throw Error(n(306,f,""))}return o;case 0:return f=o.type,g=o.pendingProps,g=o.elementType===f?g:Wn(f,g),pd(i,o,f,g,u);case 1:return f=o.type,g=o.pendingProps,g=o.elementType===f?g:Wn(f,g),uy(i,o,f,g,u);case 3:e:{if(cy(o),i===null)throw Error(n(387));f=o.pendingProps,x=o.memoizedState,g=x.element,Eg(i,o),ll(o,f,null,u);var C=o.memoizedState;if(f=C.element,x.isDehydrated)if(x={element:f,isDehydrated:!1,cache:C.cache,pendingSuspenseBoundaries:C.pendingSuspenseBoundaries,transitions:C.transitions},o.updateQueue.baseState=x,o.memoizedState=x,o.flags&256){g=ys(Error(n(423)),o),o=dy(i,o,f,u,g);break e}else if(f!==g){g=ys(Error(n(424)),o),o=dy(i,o,f,u,g);break e}else for(kn=Hr(o.stateNode.containerInfo.firstChild),Sn=o,ft=!0,Hn=null,u=Cg(o,null,f,u),o.child=u;u;)u.flags=u.flags&-3|4096,u=u.sibling;else{if(fs(),f===g){o=Pr(i,o,u);break e}nn(i,o,f,u)}o=o.child}return o;case 5:return Tg(o),i===null&&Hc(o),f=o.type,g=o.pendingProps,x=i!==null?i.memoizedProps:null,C=g.children,jc(f,g)?C=null:x!==null&&jc(f,x)&&(o.flags|=32),ly(i,o),nn(i,o,C,u),o.child;case 6:return i===null&&Hc(o),null;case 13:return fy(i,o,u);case 4:return Jc(o,o.stateNode.containerInfo),f=o.pendingProps,i===null?o.child=hs(o,null,f,u):nn(i,o,f,u),o.child;case 11:return f=o.type,g=o.pendingProps,g=o.elementType===f?g:Wn(f,g),iy(i,o,f,g,u);case 7:return nn(i,o,o.pendingProps,u),o.child;case 8:return nn(i,o,o.pendingProps.children,u),o.child;case 12:return nn(i,o,o.pendingProps.children,u),o.child;case 10:e:{if(f=o.type._context,g=o.pendingProps,x=o.memoizedProps,C=g.value,lt(sl,f._currentValue),f._currentValue=C,x!==null)if($n(x.value,C)){if(x.children===g.children&&!dn.current){o=Pr(i,o,u);break e}}else for(x=o.child,x!==null&&(x.return=o);x!==null;){var L=x.dependencies;if(L!==null){C=x.child;for(var O=L.firstContext;O!==null;){if(O.context===f){if(x.tag===1){O=_r(-1,u&-u),O.tag=2;var G=x.updateQueue;if(G!==null){G=G.shared;var re=G.pending;re===null?O.next=O:(O.next=re.next,re.next=O),G.pending=O}}x.lanes|=u,O=x.alternate,O!==null&&(O.lanes|=u),Xc(x.return,u,o),L.lanes|=u;break}O=O.next}}else if(x.tag===10)C=x.type===o.type?null:x.child;else if(x.tag===18){if(C=x.return,C===null)throw Error(n(341));C.lanes|=u,L=C.alternate,L!==null&&(L.lanes|=u),Xc(C,u,o),C=x.sibling}else C=x.child;if(C!==null)C.return=x;else for(C=x;C!==null;){if(C===o){C=null;break}if(x=C.sibling,x!==null){x.return=C.return,C=x;break}C=C.return}x=C}nn(i,o,g.children,u),o=o.child}return o;case 9:return g=o.type,f=o.pendingProps.children,ms(o,u),g=Mn(g),f=f(g),o.flags|=1,nn(i,o,f,u),o.child;case 14:return f=o.type,g=Wn(f,o.pendingProps),g=Wn(f.type,g),sy(i,o,f,g,u);case 15:return oy(i,o,o.type,o.pendingProps,u);case 17:return f=o.type,g=o.pendingProps,g=o.elementType===f?g:Wn(f,g),yl(i,o),o.tag=1,fn(f)?(i=!0,Za(o)):i=!1,ms(o,u),Qg(o,f,g),dd(o,f,g,u),md(null,o,f,!0,i,u);case 19:return py(i,o,u);case 22:return ay(i,o,u)}throw Error(n(156,o.tag))};function Fy(i,o){return Oe(i,o)}function NE(i,o,u,f){this.tag=i,this.key=u,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=o,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=f,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function jn(i,o,u,f){return new NE(i,o,u,f)}function jd(i){return i=i.prototype,!(!i||!i.isReactComponent)}function LE(i){if(typeof i=="function")return jd(i)?1:0;if(i!=null){if(i=i.$$typeof,i===z)return 11;if(i===Z)return 14}return 2}function ti(i,o){var u=i.alternate;return u===null?(u=jn(i.tag,o,i.key,i.mode),u.elementType=i.elementType,u.type=i.type,u.stateNode=i.stateNode,u.alternate=i,i.alternate=u):(u.pendingProps=o,u.type=i.type,u.flags=0,u.subtreeFlags=0,u.deletions=null),u.flags=i.flags&14680064,u.childLanes=i.childLanes,u.lanes=i.lanes,u.child=i.child,u.memoizedProps=i.memoizedProps,u.memoizedState=i.memoizedState,u.updateQueue=i.updateQueue,o=i.dependencies,u.dependencies=o===null?null:{lanes:o.lanes,firstContext:o.firstContext},u.sibling=i.sibling,u.index=i.index,u.ref=i.ref,u}function Tl(i,o,u,f,g,x){var C=2;if(f=i,typeof i=="function")jd(i)&&(C=1);else if(typeof i=="string")C=5;else e:switch(i){case q:return Ti(u.children,g,x,o);case B:C=8,g|=8;break;case D:return i=jn(12,u,o,g|2),i.elementType=D,i.lanes=x,i;case he:return i=jn(13,u,o,g),i.elementType=he,i.lanes=x,i;case J:return i=jn(19,u,o,g),i.elementType=J,i.lanes=x,i;case Se:return Rl(u,g,x,o);default:if(typeof i=="object"&&i!==null)switch(i.$$typeof){case I:C=10;break e;case U:C=9;break e;case z:C=11;break e;case Z:C=14;break e;case ve:C=16,f=null;break e}throw Error(n(130,i==null?i:typeof i,""))}return o=jn(C,u,o,g),o.elementType=i,o.type=f,o.lanes=x,o}function Ti(i,o,u,f){return i=jn(7,i,f,o),i.lanes=u,i}function Rl(i,o,u,f){return i=jn(22,i,f,o),i.elementType=Se,i.lanes=u,i.stateNode={isHidden:!1},i}function Dd(i,o,u){return i=jn(6,i,null,o),i.lanes=u,i}function Od(i,o,u){return o=jn(4,i.children!==null?i.children:[],i.key,o),o.lanes=u,o.stateNode={containerInfo:i.containerInfo,pendingChildren:null,implementation:i.implementation},o}function jE(i,o,u,f,g){this.tag=o,this.containerInfo=i,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=cc(0),this.expirationTimes=cc(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=cc(0),this.identifierPrefix=f,this.onRecoverableError=g,this.mutableSourceEagerHydrationData=null}function Fd(i,o,u,f,g,x,C,L,O){return i=new jE(i,o,u,L,O),o===1?(o=1,x===!0&&(o|=8)):o=0,x=jn(3,null,null,o),i.current=x,x.stateNode=i,x.memoizedState={element:f,isDehydrated:u,cache:null,transitions:null,pendingSuspenseBoundaries:null},Qc(x),i}function DE(i,o,u){var f=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:N,key:f==null?null:""+f,children:i,containerInfo:o,implementation:u}}function Vy(i){if(!i)return qr;i=i._reactInternals;e:{if(wr(i)!==i||i.tag!==1)throw Error(n(170));var o=i;do{switch(o.tag){case 3:o=o.stateNode.context;break e;case 1:if(fn(o.type)){o=o.stateNode.__reactInternalMemoizedMergedChildContext;break e}}o=o.return}while(o!==null);throw Error(n(171))}if(i.tag===1){var u=i.type;if(fn(u))return hg(i,u,o)}return o}function zy(i,o,u,f,g,x,C,L,O){return i=Fd(u,f,!0,i,g,x,C,L,O),i.context=Vy(null),u=i.current,f=rn(),g=Zr(u),x=_r(f,g),x.callback=o??null,Xr(u,x,g),i.current.lanes=g,no(i,g,f),mn(i,f),i}function Al(i,o,u,f){var g=o.current,x=rn(),C=Zr(g);return u=Vy(u),o.context===null?o.context=u:o.pendingContext=u,o=_r(x,C),o.payload={element:i},f=f===void 0?null:f,f!==null&&(o.callback=f),i=Xr(g,o,C),i!==null&&(Kn(i,g,C,x),al(i,g,C)),C}function Il(i){if(i=i.current,!i.child)return null;switch(i.child.tag){case 5:return i.child.stateNode;default:return i.child.stateNode}}function By(i,o){if(i=i.memoizedState,i!==null&&i.dehydrated!==null){var u=i.retryLane;i.retryLane=u!==0&&u<o?u:o}}function Vd(i,o){By(i,o),(i=i.alternate)&&By(i,o)}function OE(){return null}var Uy=typeof reportError=="function"?reportError:function(i){console.error(i)};function zd(i){this._internalRoot=i}Ml.prototype.render=zd.prototype.render=function(i){var o=this._internalRoot;if(o===null)throw Error(n(409));Al(i,o,null,null)},Ml.prototype.unmount=zd.prototype.unmount=function(){var i=this._internalRoot;if(i!==null){this._internalRoot=null;var o=i.containerInfo;Ei(function(){Al(null,i,null,null)}),o[Sr]=null}};function Ml(i){this._internalRoot=i}Ml.prototype.unstable_scheduleHydration=function(i){if(i){var o=Em();i={blockedOn:null,target:i,priority:o};for(var u=0;u<Br.length&&o!==0&&o<Br[u].priority;u++);Br.splice(u,0,i),u===0&&Tm(i)}};function Bd(i){return!(!i||i.nodeType!==1&&i.nodeType!==9&&i.nodeType!==11)}function Nl(i){return!(!i||i.nodeType!==1&&i.nodeType!==9&&i.nodeType!==11&&(i.nodeType!==8||i.nodeValue!==" react-mount-point-unstable "))}function $y(){}function FE(i,o,u,f,g){if(g){if(typeof f=="function"){var x=f;f=function(){var G=Il(C);x.call(G)}}var C=zy(o,f,i,0,null,!1,!1,"",$y);return i._reactRootContainer=C,i[Sr]=C.current,yo(i.nodeType===8?i.parentNode:i),Ei(),C}for(;g=i.lastChild;)i.removeChild(g);if(typeof f=="function"){var L=f;f=function(){var G=Il(O);L.call(G)}}var O=Fd(i,0,!1,null,null,!1,!1,"",$y);return i._reactRootContainer=O,i[Sr]=O.current,yo(i.nodeType===8?i.parentNode:i),Ei(function(){Al(o,O,u,f)}),O}function Ll(i,o,u,f,g){var x=u._reactRootContainer;if(x){var C=x;if(typeof g=="function"){var L=g;g=function(){var O=Il(C);L.call(O)}}Al(o,C,i,g)}else C=FE(u,o,i,g,f);return Il(C)}Cm=function(i){switch(i.tag){case 3:var o=i.stateNode;if(o.current.memoizedState.isDehydrated){var u=to(o.pendingLanes);u!==0&&(dc(o,u|1),mn(o,Qe()),(Ke&6)===0&&(ws=Qe()+500,Gr()))}break;case 13:Ei(function(){var f=Er(i,1);if(f!==null){var g=rn();Kn(f,i,1,g)}}),Vd(i,1)}},fc=function(i){if(i.tag===13){var o=Er(i,134217728);if(o!==null){var u=rn();Kn(o,i,134217728,u)}Vd(i,134217728)}},bm=function(i){if(i.tag===13){var o=Zr(i),u=Er(i,o);if(u!==null){var f=rn();Kn(u,i,o,f)}Vd(i,o)}},Em=function(){return Ze},_m=function(i,o){var u=Ze;try{return Ze=i,o()}finally{Ze=u}},wt=function(i,o,u){switch(o){case"input":if(et(i,u),o=u.name,u.type==="radio"&&o!=null){for(u=i;u.parentNode;)u=u.parentNode;for(u=u.querySelectorAll("input[name="+JSON.stringify(""+o)+'][type="radio"]'),o=0;o<u.length;o++){var f=u[o];if(f!==i&&f.form===i.form){var g=Qa(f);if(!g)throw Error(n(90));qe(f),et(f,g)}}}break;case"textarea":He(i,u);break;case"select":o=u.value,o!=null&&tn(i,!!u.multiple,o,!1)}},Tt=Md,Ra=Ei;var VE={usingClientEntryPoint:!1,Events:[wo,as,Qa,ht,qt,Md]},Lo={findFiberByHostInstance:yi,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},zE={bundleType:Lo.bundleType,version:Lo.version,rendererPackageName:Lo.rendererPackageName,rendererConfig:Lo.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:j.ReactCurrentDispatcher,findHostInstanceByFiber:function(i){return i=ne(i),i===null?null:i.stateNode},findFiberByHostInstance:Lo.findFiberByHostInstance||OE,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var jl=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!jl.isDisabled&&jl.supportsFiber)try{Ma=jl.inject(zE),rr=jl}catch{}}return gn.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=VE,gn.createPortal=function(i,o){var u=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Bd(o))throw Error(n(200));return DE(i,o,null,u)},gn.createRoot=function(i,o){if(!Bd(i))throw Error(n(299));var u=!1,f="",g=Uy;return o!=null&&(o.unstable_strictMode===!0&&(u=!0),o.identifierPrefix!==void 0&&(f=o.identifierPrefix),o.onRecoverableError!==void 0&&(g=o.onRecoverableError)),o=Fd(i,1,!1,null,null,u,!1,f,g),i[Sr]=o.current,yo(i.nodeType===8?i.parentNode:i),new zd(o)},gn.findDOMNode=function(i){if(i==null)return null;if(i.nodeType===1)return i;var o=i._reactInternals;if(o===void 0)throw typeof i.render=="function"?Error(n(188)):(i=Object.keys(i).join(","),Error(n(268,i)));return i=ne(o),i=i===null?null:i.stateNode,i},gn.flushSync=function(i){return Ei(i)},gn.hydrate=function(i,o,u){if(!Nl(o))throw Error(n(200));return Ll(null,i,o,!0,u)},gn.hydrateRoot=function(i,o,u){if(!Bd(i))throw Error(n(405));var f=u!=null&&u.hydratedSources||null,g=!1,x="",C=Uy;if(u!=null&&(u.unstable_strictMode===!0&&(g=!0),u.identifierPrefix!==void 0&&(x=u.identifierPrefix),u.onRecoverableError!==void 0&&(C=u.onRecoverableError)),o=zy(o,null,i,1,u??null,g,!1,x,C),i[Sr]=o.current,yo(i),f)for(i=0;i<f.length;i++)u=f[i],g=u._getVersion,g=g(u._source),o.mutableSourceEagerHydrationData==null?o.mutableSourceEagerHydrationData=[u,g]:o.mutableSourceEagerHydrationData.push(u,g);return new Ml(o)},gn.render=function(i,o,u){if(!Nl(o))throw Error(n(200));return Ll(null,i,o,!1,u)},gn.unmountComponentAtNode=function(i){if(!Nl(i))throw Error(n(40));return i._reactRootContainer?(Ei(function(){Ll(null,null,i,!1,function(){i._reactRootContainer=null,i[Sr]=null})}),!0):!1},gn.unstable_batchedUpdates=Md,gn.unstable_renderSubtreeIntoContainer=function(i,o,u,f){if(!Nl(u))throw Error(n(200));if(i==null||i._reactInternals===void 0)throw Error(n(38));return Ll(i,o,u,!1,f)},gn.version="18.3.1-next-f1338f8080-20240426",gn}var Qy;function uw(){if(Qy)return Hd.exports;Qy=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(),Hd.exports=KE(),Hd.exports}var Jy;function XE(){if(Jy)return Dl;Jy=1;var e=uw();return Dl.createRoot=e.createRoot,Dl.hydrateRoot=e.hydrateRoot,Dl}var YE=XE(),S=ep();const QE=Zh(S),ya=UE({__proto__:null,default:QE},[S]),tp=S.createContext({});function Gu(e){const t=S.useRef(null);return t.current===null&&(t.current=e()),t.current}const JE=typeof window<"u",np=JE?S.useLayoutEffect:S.useEffect,Ku=S.createContext(null);function rp(e,t){e.indexOf(t)===-1&&e.push(t)}function vu(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}const mr=(e,t,n)=>n>t?t:n<e?e:n;let Xu=()=>{};const ci={},cw=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e),dw=e=>typeof e=="object"&&e!==null,fw=e=>/^0[^.\s]+$/u.test(e);function hw(e){let t;return()=>(t===void 0&&(t=e()),t)}const Vn=e=>e,va=(...e)=>e.reduce((t,n)=>r=>n(t(r))),sa=(e,t,n)=>{const r=t-e;return r?(n-e)/r:1};class ip{constructor(){this.subscriptions=[]}add(t){return rp(this.subscriptions,t),()=>vu(this.subscriptions,t)}notify(t,n,r){const s=this.subscriptions.length;if(s)if(s===1)this.subscriptions[0](t,n,r);else for(let a=0;a<s;a++){const l=this.subscriptions[a];l&&l(t,n,r)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const _n=e=>e*1e3,Fn=e=>e/1e3,pw=(e,t)=>t?e*(1e3/t):0,mw=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,ZE=1e-7,e_=12;function t_(e,t,n,r,s){let a,l,c=0;do l=t+(n-t)/2,a=mw(l,r,s)-e,a>0?n=l:t=l;while(Math.abs(a)>ZE&&++c<e_);return l}function xa(e,t,n,r){if(e===t&&n===r)return Vn;const s=a=>t_(a,0,1,e,n);return a=>a===0||a===1?a:mw(s(a),t,r)}const gw=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,yw=e=>t=>1-e(1-t),vw=xa(.33,1.53,.69,.99),sp=yw(vw),xw=gw(sp),ww=e=>e>=1?1:(e*=2)<1?.5*sp(e):.5*(2-Math.pow(2,-10*(e-1))),op=e=>1-Math.sin(Math.acos(e)),Sw=yw(op),kw=gw(op),n_=xa(.42,0,1,1),r_=xa(0,0,.58,1),Cw=xa(.42,0,.58,1),i_=e=>Array.isArray(e)&&typeof e[0]!="number",bw=e=>Array.isArray(e)&&typeof e[0]=="number",s_={linear:Vn,easeIn:n_,easeInOut:Cw,easeOut:r_,circIn:op,circInOut:kw,circOut:Sw,backIn:sp,backInOut:xw,backOut:vw,anticipate:ww},o_=e=>typeof e=="string",Zy=e=>{if(bw(e)){Xu(e.length===4);const[t,n,r,s]=e;return xa(t,n,r,s)}else if(o_(e))return s_[e];return e},Ol=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function a_(e){let t=new Set,n=new Set,r=!1,s=!1;const a=new WeakSet;let l={delta:0,timestamp:0,isProcessing:!1};function c(h){a.has(h)&&(d.schedule(h),e()),h(l)}const d={schedule:(h,p=!1,m=!1)=>{const w=m&&r?t:n;return p&&a.add(h),w.add(h),h},cancel:h=>{n.delete(h),a.delete(h)},process:h=>{if(l=h,r){s=!0;return}r=!0;const p=t;t=n,n=p,t.forEach(c),t.clear(),r=!1,s&&(s=!1,d.process(h))}};return d}const l_=40;function Ew(e,t){let n=!1,r=!0;const s={delta:0,timestamp:0,isProcessing:!1},a=()=>n=!0,l=Ol.reduce((_,j)=>(_[j]=a_(a),_),{}),{setup:c,read:d,resolveKeyframes:h,preUpdate:p,update:m,preRender:y,render:w,postRender:k}=l,b=()=>{const _=ci.useManualTiming,j=_?s.timestamp:performance.now();n=!1,_||(s.delta=r?1e3/60:Math.max(Math.min(j-s.timestamp,l_),1)),s.timestamp=j,s.isProcessing=!0,c.process(s),d.process(s),h.process(s),p.process(s),m.process(s),y.process(s),w.process(s),k.process(s),s.isProcessing=!1,n&&t&&(r=!1,e(b))},E=()=>{n=!0,r=!0,s.isProcessing||e(b)};return{schedule:Ol.reduce((_,j)=>{const A=l[j];return _[j]=(N,q=!1,B=!1)=>(n||E(),A.schedule(N,q,B)),_},{}),cancel:_=>{for(let j=0;j<Ol.length;j++)l[Ol[j]].cancel(_)},state:s,steps:l}}const{schedule:rt,cancel:di,state:$t,steps:Gd}=Ew(typeof requestAnimationFrame<"u"?requestAnimationFrame:Vn,!0);let tu;function u_(){tu=void 0}const an={now:()=>(tu===void 0&&an.set($t.isProcessing||ci.useManualTiming?$t.timestamp:performance.now()),tu),set:e=>{tu=e,queueMicrotask(u_)}},_w=e=>t=>typeof t=="string"&&t.startsWith(e),Pw=_w("--"),c_=_w("var(--"),ap=e=>c_(e)?d_.test(e.split("/*")[0].trim()):!1,d_=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function ev(e){return typeof e!="string"?!1:e.split("/*")[0].includes("var(--")}const qs={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},oa={...qs,transform:e=>mr(0,1,e)},Fl={...qs,default:1},Go=e=>Math.round(e*1e5)/1e5,lp=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function f_(e){return e==null}const h_=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,up=(e,t)=>n=>!!(typeof n=="string"&&h_.test(n)&&n.startsWith(e)||t&&!f_(n)&&Object.prototype.hasOwnProperty.call(n,t)),Tw=(e,t,n)=>r=>{if(typeof r!="string")return r;const[s,a,l,c]=r.match(lp);return{[e]:parseFloat(s),[t]:parseFloat(a),[n]:parseFloat(l),alpha:c!==void 0?parseFloat(c):1}},p_=e=>mr(0,255,e),Kd={...qs,transform:e=>Math.round(p_(e))},zi={test:up("rgb","red"),parse:Tw("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:r=1})=>"rgba("+Kd.transform(e)+", "+Kd.transform(t)+", "+Kd.transform(n)+", "+Go(oa.transform(r))+")"};function m_(e){let t="",n="",r="",s="";return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),r=e.substring(5,7),s=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),r=e.substring(3,4),s=e.substring(4,5),t+=t,n+=n,r+=r,s+=s),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:s?parseInt(s,16)/255:1}}const Hf={test:up("#"),parse:m_,transform:zi.transform},wa=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),Ar=wa("deg"),pr=wa("%"),_e=wa("px"),g_=wa("vh"),y_=wa("vw"),tv={...pr,parse:e=>pr.parse(e)/100,transform:e=>pr.transform(e*100)},Ns={test:up("hsl","hue"),parse:Tw("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>"hsla("+Math.round(e)+", "+pr.transform(Go(t))+", "+pr.transform(Go(n))+", "+Go(oa.transform(r))+")"},Pt={test:e=>zi.test(e)||Hf.test(e)||Ns.test(e),parse:e=>zi.test(e)?zi.parse(e):Ns.test(e)?Ns.parse(e):Hf.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?zi.transform(e):Ns.transform(e),getAnimatableNone:e=>{const t=Pt.parse(e);return t.alpha=0,Pt.transform(t)}},v_=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function x_(e){return isNaN(e)&&typeof e=="string"&&(e.match(lp)?.length||0)+(e.match(v_)?.length||0)>0}const Rw="number",Aw="color",w_="var",S_="var(",nv="${}",k_=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function zs(e){const t=e.toString(),n=[],r={color:[],number:[],var:[]},s=[];let a=0;const c=t.replace(k_,d=>(Pt.test(d)?(r.color.push(a),s.push(Aw),n.push(Pt.parse(d))):d.startsWith(S_)?(r.var.push(a),s.push(w_),n.push(d)):(r.number.push(a),s.push(Rw),n.push(parseFloat(d))),++a,nv)).split(nv);return{values:n,split:c,indexes:r,types:s}}function C_(e){return zs(e).values}function Iw({split:e,types:t}){const n=e.length;return r=>{let s="";for(let a=0;a<n;a++)if(s+=e[a],r[a]!==void 0){const l=t[a];l===Rw?s+=Go(r[a]):l===Aw?s+=Pt.transform(r[a]):s+=r[a]}return s}}function b_(e){return Iw(zs(e))}const E_=e=>typeof e=="number"?0:Pt.test(e)?Pt.getAnimatableNone(e):e,__=(e,t)=>typeof e=="number"?t?.trim().endsWith("/")?e:0:E_(e);function P_(e){const t=zs(e);return Iw(t)(t.values.map((r,s)=>__(r,t.split[s])))}const Jn={test:x_,parse:C_,createTransformer:b_,getAnimatableNone:P_};function Xd(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function T_({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,t/=100,n/=100;let s=0,a=0,l=0;if(!t)s=a=l=n;else{const c=n<.5?n*(1+t):n+t-n*t,d=2*n-c;s=Xd(d,c,e+1/3),a=Xd(d,c,e),l=Xd(d,c,e-1/3)}return{red:Math.round(s*255),green:Math.round(a*255),blue:Math.round(l*255),alpha:r}}function xu(e,t){return n=>n>0?t:e}const nt=(e,t,n)=>e+(t-e)*n,Yd=(e,t,n)=>{const r=e*e,s=n*(t*t-r)+r;return s<0?0:Math.sqrt(s)},R_=[Hf,zi,Ns],A_=e=>R_.find(t=>t.test(e));function rv(e){const t=A_(e);if(!t)return!1;let n=t.parse(e);return t===Ns&&(n=T_(n)),n}const iv=(e,t)=>{const n=rv(e),r=rv(t);if(!n||!r)return xu(e,t);const s={...n};return a=>(s.red=Yd(n.red,r.red,a),s.green=Yd(n.green,r.green,a),s.blue=Yd(n.blue,r.blue,a),s.alpha=nt(n.alpha,r.alpha,a),zi.transform(s))},Wf=new Set(["none","hidden"]);function I_(e,t){return Wf.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function M_(e,t){return n=>nt(e,t,n)}function cp(e){return typeof e=="number"?M_:typeof e=="string"?ap(e)?xu:Pt.test(e)?iv:j_:Array.isArray(e)?Mw:typeof e=="object"?Pt.test(e)?iv:N_:xu}function Mw(e,t){const n=[...e],r=n.length,s=e.map((a,l)=>cp(a)(a,t[l]));return a=>{for(let l=0;l<r;l++)n[l]=s[l](a);return n}}function N_(e,t){const n={...e,...t},r={};for(const s in n)e[s]!==void 0&&t[s]!==void 0&&(r[s]=cp(e[s])(e[s],t[s]));return s=>{for(const a in r)n[a]=r[a](s);return n}}function L_(e,t){const n=[],r={color:0,var:0,number:0};for(let s=0;s<t.values.length;s++){const a=t.types[s],l=e.indexes[a][r[a]],c=e.values[l]??0;n[s]=c,r[a]++}return n}const j_=(e,t)=>{const n=Jn.createTransformer(t),r=zs(e),s=zs(t);return r.indexes.var.length===s.indexes.var.length&&r.indexes.color.length===s.indexes.color.length&&r.indexes.number.length>=s.indexes.number.length?Wf.has(e)&&!s.values.length||Wf.has(t)&&!r.values.length?I_(e,t):va(Mw(L_(r,s),s.values),n):xu(e,t)};function Nw(e,t,n){return typeof e=="number"&&typeof t=="number"&&typeof n=="number"?nt(e,t,n):cp(e)(e,t)}const D_=e=>{const t=({timestamp:n})=>e(n);return{start:(n=!0)=>rt.update(t,n),stop:()=>di(t),now:()=>$t.isProcessing?$t.timestamp:an.now()}},Lw=(e,t,n=10)=>{let r="";const s=Math.max(Math.round(t/n),2);for(let a=0;a<s;a++)r+=Math.round(e(a/(s-1))*1e4)/1e4+", ";return`linear(${r.substring(0,r.length-2)})`},wu=2e4;function dp(e){let t=0;const n=50;let r=e.next(t);for(;!r.done&&t<wu;)t+=n,r=e.next(t);return t>=wu?1/0:t}function O_(e,t=100,n){const r=n({...e,keyframes:[0,t]}),s=Math.min(dp(r),wu);return{type:"keyframes",ease:a=>r.next(s*a).value/t,duration:Fn(s)}}const xt={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1};function qf(e,t){return e*Math.sqrt(1-t*t)}const F_=12;function V_(e,t,n){let r=n;for(let s=1;s<F_;s++)r=r-e(r)/t(r);return r}const Qd=.001;function z_({duration:e=xt.duration,bounce:t=xt.bounce,velocity:n=xt.velocity,mass:r=xt.mass}){let s,a,l=1-t;l=mr(xt.minDamping,xt.maxDamping,l),e=mr(xt.minDuration,xt.maxDuration,Fn(e)),l<1?(s=h=>{const p=h*l,m=p*e,y=p-n,w=qf(h,l),k=Math.exp(-m);return Qd-y/w*k},a=h=>{const m=h*l*e,y=m*n+n,w=Math.pow(l,2)*Math.pow(h,2)*e,k=Math.exp(-m),b=qf(Math.pow(h,2),l);return(-s(h)+Qd>0?-1:1)*((y-w)*k)/b}):(s=h=>{const p=Math.exp(-h*e),m=(h-n)*e+1;return-Qd+p*m},a=h=>{const p=Math.exp(-h*e),m=(n-h)*(e*e);return p*m});const c=5/e,d=V_(s,a,c);if(e=_n(e),isNaN(d))return{stiffness:xt.stiffness,damping:xt.damping,duration:e};{const h=Math.pow(d,2)*r;return{stiffness:h,damping:l*2*Math.sqrt(r*h),duration:e}}}const B_=["duration","bounce"],U_=["stiffness","damping","mass"];function sv(e,t){return t.some(n=>e[n]!==void 0)}function $_(e){let t={velocity:xt.velocity,stiffness:xt.stiffness,damping:xt.damping,mass:xt.mass,isResolvedFromDuration:!1,...e};if(!sv(e,U_)&&sv(e,B_))if(t.velocity=0,e.visualDuration){const n=e.visualDuration,r=2*Math.PI/(n*1.2),s=r*r,a=2*mr(.05,1,1-(e.bounce||0))*Math.sqrt(s);t={...t,mass:xt.mass,stiffness:s,damping:a}}else{const n=z_({...e,velocity:0});t={...t,...n,mass:xt.mass},t.isResolvedFromDuration=!0}return t}function Su(e=xt.visualDuration,t=xt.bounce){const n=typeof e!="object"?{visualDuration:e,keyframes:[0,1],bounce:t}:e;let{restSpeed:r,restDelta:s}=n;const a=n.keyframes[0],l=n.keyframes[n.keyframes.length-1],c={done:!1,value:a},{stiffness:d,damping:h,mass:p,duration:m,velocity:y,isResolvedFromDuration:w}=$_({...n,velocity:-Fn(n.velocity||0)}),k=y||0,b=h/(2*Math.sqrt(d*p)),E=l-a,P=Fn(Math.sqrt(d/p)),R=Math.abs(E)<5;r||(r=R?xt.restSpeed.granular:xt.restSpeed.default),s||(s=R?xt.restDelta.granular:xt.restDelta.default);let _,j,A,N,q,B;if(b<1)A=qf(P,b),N=(k+b*P*E)/A,_=I=>{const U=Math.exp(-b*P*I);return l-U*(N*Math.sin(A*I)+E*Math.cos(A*I))},q=b*P*N+E*A,B=b*P*E-N*A,j=I=>Math.exp(-b*P*I)*(q*Math.sin(A*I)+B*Math.cos(A*I));else if(b===1){_=U=>l-Math.exp(-P*U)*(E+(k+P*E)*U);const I=k+P*E;j=U=>Math.exp(-P*U)*(P*I*U-k)}else{const I=P*Math.sqrt(b*b-1);_=J=>{const Z=Math.exp(-b*P*J),ve=Math.min(I*J,300);return l-Z*((k+b*P*E)*Math.sinh(ve)+I*E*Math.cosh(ve))/I};const U=(k+b*P*E)/I,z=b*P*U-E*I,he=b*P*E-U*I;j=J=>{const Z=Math.exp(-b*P*J),ve=Math.min(I*J,300);return Z*(z*Math.sinh(ve)+he*Math.cosh(ve))}}const D={calculatedDuration:w&&m||null,velocity:I=>_n(j(I)),next:I=>{if(!w&&b<1){const z=Math.exp(-b*P*I),he=Math.sin(A*I),J=Math.cos(A*I),Z=l-z*(N*he+E*J),ve=_n(z*(q*he+B*J));return c.done=Math.abs(ve)<=r&&Math.abs(l-Z)<=s,c.value=c.done?l:Z,c}const U=_(I);if(w)c.done=I>=m;else{const z=_n(j(I));c.done=Math.abs(z)<=r&&Math.abs(l-U)<=s}return c.value=c.done?l:U,c},toString:()=>{const I=Math.min(dp(D),wu),U=Lw(z=>D.next(I*z).value,I,30);return I+"ms "+U},toTransition:()=>{}};return D}Su.applyToOptions=e=>{const t=O_(e,100,Su);return e.ease=t.ease,e.duration=_n(t.duration),e.type="keyframes",e};const H_=5;function jw(e,t,n){const r=Math.max(t-H_,0);return pw(n-e(r),t-r)}function Gf({keyframes:e,velocity:t=0,power:n=.8,timeConstant:r=325,bounceDamping:s=10,bounceStiffness:a=500,modifyTarget:l,min:c,max:d,restDelta:h=.5,restSpeed:p}){const m=e[0],y={done:!1,value:m},w=B=>c!==void 0&&B<c||d!==void 0&&B>d,k=B=>c===void 0?d:d===void 0||Math.abs(c-B)<Math.abs(d-B)?c:d;let b=n*t;const E=m+b,P=l===void 0?E:l(E);P!==E&&(b=P-m);const R=B=>-b*Math.exp(-B/r),_=B=>P+R(B),j=B=>{const D=R(B),I=_(B);y.done=Math.abs(D)<=h,y.value=y.done?P:I};let A,N;const q=B=>{w(y.value)&&(A=B,N=Su({keyframes:[y.value,k(y.value)],velocity:jw(_,B,y.value),damping:s,stiffness:a,restDelta:h,restSpeed:p}))};return q(0),{calculatedDuration:null,next:B=>{let D=!1;return!N&&A===void 0&&(D=!0,j(B),q(B)),A!==void 0&&B>=A?N.next(B-A):(!D&&j(B),y)}}}function W_(e,t,n){const r=[],s=n||ci.mix||Nw,a=e.length-1;for(let l=0;l<a;l++){let c=s(e[l],e[l+1]);if(t){const d=Array.isArray(t)?t[l]||Vn:t;c=va(d,c)}r.push(c)}return r}function q_(e,t,{clamp:n=!0,ease:r,mixer:s}={}){const a=e.length;if(Xu(a===t.length),a===1)return()=>t[0];if(a===2&&t[0]===t[1])return()=>t[1];const l=e[0]===e[1];e[0]>e[a-1]&&(e=[...e].reverse(),t=[...t].reverse());const c=W_(t,r,s),d=c.length,h=p=>{if(l&&p<e[0])return t[0];let m=0;if(d>1)for(;m<e.length-2&&!(p<e[m+1]);m++);const y=sa(e[m],e[m+1],p);return c[m](y)};return n?p=>h(mr(e[0],e[a-1],p)):h}function G_(e,t){const n=e[e.length-1];for(let r=1;r<=t;r++){const s=sa(0,t,r);e.push(nt(n,1,s))}}function K_(e){const t=[0];return G_(t,e.length-1),t}function X_(e,t){return e.map(n=>n*t)}function Y_(e,t){return e.map(()=>t||Cw).splice(0,e.length-1)}function Ko({duration:e=300,keyframes:t,times:n,ease:r="easeInOut"}){const s=i_(r)?r.map(Zy):Zy(r),a={done:!1,value:t[0]},l=X_(n&&n.length===t.length?n:K_(t),e),c=q_(l,t,{ease:Array.isArray(s)?s:Y_(t,s)});return{calculatedDuration:e,next:d=>(a.value=c(d),a.done=d>=e,a)}}const Q_=e=>e!==null;function Yu(e,{repeat:t,repeatType:n="loop"},r,s=1){const a=e.filter(Q_),c=s<0||t&&n!=="loop"&&t%2===1?0:a.length-1;return!c||r===void 0?a[c]:r}const J_={decay:Gf,inertia:Gf,tween:Ko,keyframes:Ko,spring:Su};function Dw(e){typeof e.type=="string"&&(e.type=J_[e.type])}class fp{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(t=>{this.resolve=t})}notifyFinished(){this.resolve()}then(t,n){return this.finished.then(t,n)}}const Z_=e=>e/100;class ku extends fp{constructor(t){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.delayState={done:!1,value:void 0},this.stop=()=>{const{motionValue:n}=this.options;n&&n.updatedAt!==an.now()&&this.tick(an.now()),this.isStopped=!0,this.state!=="idle"&&(this.teardown(),this.options.onStop?.())},this.options=t,this.initAnimation(),this.play(),t.autoplay===!1&&this.pause()}initAnimation(){const{options:t}=this;Dw(t);const{type:n=Ko,repeat:r=0,repeatDelay:s=0,repeatType:a,velocity:l=0}=t;let{keyframes:c}=t;const d=n||Ko;d!==Ko&&typeof c[0]!="number"&&(this.mixKeyframes=va(Z_,Nw(c[0],c[1])),c=[0,100]);const h=d({...t,keyframes:c});a==="mirror"&&(this.mirroredGenerator=d({...t,keyframes:[...c].reverse(),velocity:-l})),h.calculatedDuration===null&&(h.calculatedDuration=dp(h));const{calculatedDuration:p}=h;this.calculatedDuration=p,this.resolvedDuration=p+s,this.totalDuration=this.resolvedDuration*(r+1)-s,this.generator=h}updateTime(t){const n=Math.round(t-this.startTime)*this.playbackSpeed;this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=n}tick(t,n=!1){const{generator:r,totalDuration:s,mixKeyframes:a,mirroredGenerator:l,resolvedDuration:c,calculatedDuration:d}=this;if(this.startTime===null)return r.next(0);const{delay:h=0,keyframes:p,repeat:m,repeatType:y,repeatDelay:w,type:k,onUpdate:b,finalKeyframe:E}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-s/this.speed,this.startTime)),n?this.currentTime=t:this.updateTime(t);const P=this.currentTime-h*(this.playbackSpeed>=0?1:-1),R=this.playbackSpeed>=0?P<0:P>s;this.currentTime=Math.max(P,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=s);let _=this.currentTime,j=r;if(m){const B=Math.min(this.currentTime,s)/c;let D=Math.floor(B),I=B%1;!I&&B>=1&&(I=1),I===1&&D--,D=Math.min(D,m+1),!!(D%2)&&(y==="reverse"?(I=1-I,w&&(I-=w/c)):y==="mirror"&&(j=l)),_=mr(0,1,I)*c}let A;R?(this.delayState.value=p[0],A=this.delayState):A=j.next(_),a&&!R&&(A.value=a(A.value));let{done:N}=A;!R&&d!==null&&(N=this.playbackSpeed>=0?this.currentTime>=s:this.currentTime<=0);const q=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&N);return q&&k!==Gf&&(A.value=Yu(p,this.options,E,this.speed)),b&&b(A.value),q&&this.finish(),A}then(t,n){return this.finished.then(t,n)}get duration(){return Fn(this.calculatedDuration)}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+Fn(t)}get time(){return Fn(this.currentTime)}set time(t){t=_n(t),this.currentTime=t,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.playbackSpeed),this.driver?this.driver.start(!1):(this.startTime=0,this.state="paused",this.holdTime=t,this.tick(t))}getGeneratorVelocity(){const t=this.currentTime;if(t<=0)return this.options.velocity||0;if(this.generator.velocity)return this.generator.velocity(t);const n=this.generator.next(t).value;return jw(r=>this.generator.next(r).value,t,n)}get speed(){return this.playbackSpeed}set speed(t){const n=this.playbackSpeed!==t;n&&this.driver&&this.updateTime(an.now()),this.playbackSpeed=t,n&&this.driver&&(this.time=Fn(this.currentTime))}play(){if(this.isStopped)return;const{driver:t=D_,startTime:n}=this.options;this.driver||(this.driver=t(s=>this.tick(s))),this.options.onPlay?.();const r=this.driver.now();this.state==="finished"?(this.updateFinished(),this.startTime=r):this.holdTime!==null?this.startTime=r-this.holdTime:this.startTime||(this.startTime=n??r),this.state==="finished"&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(an.now()),this.holdTime=this.currentTime}complete(){this.state!=="running"&&this.play(),this.state="finished",this.holdTime=null}finish(){this.notifyFinished(),this.teardown(),this.state="finished",this.options.onComplete?.()}cancel(){this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),this.options.onCancel?.()}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}attachTimeline(t){return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),this.driver?.stop(),t.observe(this)}}function e2(e){for(let t=1;t<e.length;t++)e[t]??(e[t]=e[t-1])}const Bi=e=>e*180/Math.PI,Kf=e=>{const t=Bi(Math.atan2(e[1],e[0]));return Xf(t)},t2={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:Kf,rotateZ:Kf,skewX:e=>Bi(Math.atan(e[1])),skewY:e=>Bi(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},Xf=e=>(e=e%360,e<0&&(e+=360),e),ov=Kf,av=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),lv=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),n2={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:av,scaleY:lv,scale:e=>(av(e)+lv(e))/2,rotateX:e=>Xf(Bi(Math.atan2(e[6],e[5]))),rotateY:e=>Xf(Bi(Math.atan2(-e[2],e[0]))),rotateZ:ov,rotate:ov,skewX:e=>Bi(Math.atan(e[4])),skewY:e=>Bi(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function Yf(e){return e.includes("scale")?1:0}function Qf(e,t){if(!e||e==="none")return Yf(t);const n=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let r,s;if(n)r=n2,s=n;else{const c=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);r=t2,s=c}if(!s)return Yf(t);const a=r[t],l=s[1].split(",").map(i2);return typeof a=="function"?a(l):l[a]}const r2=(e,t)=>{const{transform:n="none"}=getComputedStyle(e);return Qf(n,t)};function i2(e){return parseFloat(e.trim())}const Gs=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Ks=new Set([...Gs,"pathRotation"]),uv=e=>e===qs||e===_e,s2=new Set(["x","y","z"]),o2=Gs.filter(e=>!s2.has(e));function a2(e){const t=[];return o2.forEach(n=>{const r=e.getValue(n);r!==void 0&&(t.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))}),t}const ai={width:({x:e},{paddingLeft:t="0",paddingRight:n="0",boxSizing:r})=>{const s=e.max-e.min;return r==="border-box"?s:s-parseFloat(t)-parseFloat(n)},height:({y:e},{paddingTop:t="0",paddingBottom:n="0",boxSizing:r})=>{const s=e.max-e.min;return r==="border-box"?s:s-parseFloat(t)-parseFloat(n)},top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:(e,{transform:t})=>Qf(t,"x"),y:(e,{transform:t})=>Qf(t,"y")};ai.translateX=ai.x;ai.translateY=ai.y;const Ui=new Set;let Jf=!1,Zf=!1,eh=!1;function Ow(){if(Zf){const e=Array.from(Ui).filter(r=>r.needsMeasurement),t=new Set(e.map(r=>r.element)),n=new Map;t.forEach(r=>{const s=a2(r);s.length&&(n.set(r,s),r.render())}),e.forEach(r=>r.measureInitialState()),t.forEach(r=>{r.render();const s=n.get(r);s&&s.forEach(([a,l])=>{r.getValue(a)?.set(l)})}),e.forEach(r=>r.measureEndState()),e.forEach(r=>{r.suspendedScrollY!==void 0&&window.scrollTo(0,r.suspendedScrollY)})}Zf=!1,Jf=!1,Ui.forEach(e=>e.complete(eh)),Ui.clear()}function Fw(){Ui.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(Zf=!0)})}function l2(){eh=!0,Fw(),Ow(),eh=!1}class hp{constructor(t,n,r,s,a,l=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...t],this.onComplete=n,this.name=r,this.motionValue=s,this.element=a,this.isAsync=l}scheduleResolve(){this.state="scheduled",this.isAsync?(Ui.add(this),Jf||(Jf=!0,rt.read(Fw),rt.resolveKeyframes(Ow))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:n,element:r,motionValue:s}=this;if(t[0]===null){const a=s?.get(),l=t[t.length-1];if(a!==void 0)t[0]=a;else if(r&&n){const c=r.readValue(n,l);c!=null&&(t[0]=c)}t[0]===void 0&&(t[0]=l),s&&a===void 0&&s.set(t[0])}e2(t)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(t=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,t),Ui.delete(this)}cancel(){this.state==="scheduled"&&(Ui.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const u2=e=>e.startsWith("--");function Vw(e,t,n){u2(t)?e.style.setProperty(t,n):e.style[t]=n}const c2={};function zw(e,t){const n=hw(e);return()=>c2[t]??n()}const d2=zw(()=>window.ScrollTimeline!==void 0,"scrollTimeline"),Bw=zw(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),$o=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,cv={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:$o([0,.65,.55,1]),circOut:$o([.55,0,1,.45]),backIn:$o([.31,.01,.66,-.59]),backOut:$o([.33,1.53,.69,.99])};function Uw(e,t){if(e)return typeof e=="function"?Bw()?Lw(e,t):"ease-out":bw(e)?$o(e):Array.isArray(e)?e.map(n=>Uw(n,t)||cv.easeOut):cv[e]}function f2(e,t,n,{delay:r=0,duration:s=300,repeat:a=0,repeatType:l="loop",ease:c="easeOut",times:d}={},h=void 0){const p={[t]:n};d&&(p.offset=d);const m=Uw(c,s);Array.isArray(m)&&(p.easing=m);const y={delay:r,duration:s,easing:Array.isArray(m)?"linear":m,fill:"both",iterations:a+1,direction:l==="reverse"?"alternate":"normal"};return h&&(y.pseudoElement=h),e.animate(p,y)}function $w(e){return typeof e=="function"&&"applyToOptions"in e}function h2({type:e,...t}){return $w(e)&&Bw()?e.applyToOptions(t):(t.duration??(t.duration=300),t.ease??(t.ease="easeOut"),t)}class Hw extends fp{constructor(t){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!t)return;const{element:n,name:r,keyframes:s,pseudoElement:a,allowFlatten:l=!1,finalKeyframe:c,onComplete:d}=t;this.isPseudoElement=!!a,this.allowFlatten=l,this.options=t,Xu(typeof t.type!="string");const h=h2(t);this.animation=f2(n,r,s,h,a),h.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!a){const p=Yu(s,this.options,c,this.speed);this.updateMotionValue&&this.updateMotionValue(p),Vw(n,r,p),this.animation.cancel()}d?.(),this.notifyFinished()}}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),this.state==="finished"&&this.updateFinished())}pause(){this.animation.pause()}complete(){this.animation.finish?.()}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:t}=this;t==="idle"||t==="finished"||(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){const t=this.options?.element;!this.isPseudoElement&&t?.isConnected&&this.animation.commitStyles?.()}get duration(){const t=this.animation.effect?.getComputedTiming?.().duration||0;return Fn(Number(t))}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+Fn(t)}get time(){return Fn(Number(this.animation.currentTime)||0)}set time(t){const n=this.finishedTime!==null;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=_n(t),n&&this.animation.pause()}get speed(){return this.animation.playbackRate}set speed(t){t<0&&(this.finishedTime=null),this.animation.playbackRate=t}get state(){return this.finishedTime!==null?"finished":this.animation.playState}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(t){this.manualStartTime=this.animation.startTime=t}attachTimeline({timeline:t,rangeStart:n,rangeEnd:r,observe:s}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:"linear"}),this.animation.onfinish=null,t&&d2()?(this.animation.timeline=t,n&&(this.animation.rangeStart=n),r&&(this.animation.rangeEnd=r),Vn):s(this)}}const Ww={anticipate:ww,backInOut:xw,circInOut:kw};function p2(e){return e in Ww}function m2(e){typeof e.ease=="string"&&p2(e.ease)&&(e.ease=Ww[e.ease])}const Jd=10;class g2 extends Hw{constructor(t){m2(t),Dw(t),super(t),t.startTime!==void 0&&t.autoplay!==!1&&(this.startTime=t.startTime),this.options=t}updateMotionValue(t){const{motionValue:n,onUpdate:r,onComplete:s,element:a,...l}=this.options;if(!n)return;if(t!==void 0){n.set(t);return}const c=new ku({...l,autoplay:!1}),d=Math.max(Jd,an.now()-this.startTime),h=mr(0,Jd,d-Jd),p=c.sample(d).value,{name:m}=this.options;a&&m&&Vw(a,m,p),n.setWithVelocity(c.sample(Math.max(0,d-h)).value,p,h),c.stop()}}const dv=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(Jn.test(e)||e==="0")&&!e.startsWith("url("));function y2(e){const t=e[0];if(e.length===1)return!0;for(let n=0;n<e.length;n++)if(e[n]!==t)return!0}function v2(e,t,n,r){const s=e[0];if(s===null)return!1;if(t==="display"||t==="visibility")return!0;const a=e[e.length-1],l=dv(s,t),c=dv(a,t);return!l||!c?!1:y2(e)||(n==="spring"||$w(n))&&r}function th(e){e.duration=0,e.type="keyframes"}const qw=new Set(["opacity","clipPath","filter","transform","backgroundColor"]),x2=/^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\(/;function w2(e){for(let t=0;t<e.length;t++)if(typeof e[t]=="string"&&x2.test(e[t]))return!0;return!1}const S2=new Set(["color","backgroundColor","outlineColor","fill","stroke","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor"]),k2=hw(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function C2(e){const{motionValue:t,name:n,repeatDelay:r,repeatType:s,damping:a,type:l,keyframes:c}=e,d=t?.owner?.current;if(!(d instanceof HTMLElement)&&!(d instanceof SVGElement))return!1;const{onUpdate:h,transformTemplate:p}=t.owner.getProps();return k2()&&n&&(qw.has(n)||S2.has(n)&&w2(c))&&(n!=="transform"||!p)&&!h&&!r&&s!=="mirror"&&a!==0&&l!=="inertia"}const b2=40;class E2 extends fp{constructor({autoplay:t=!0,delay:n=0,type:r="keyframes",repeat:s=0,repeatDelay:a=0,repeatType:l="loop",keyframes:c,name:d,motionValue:h,element:p,...m}){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=an.now();const y={autoplay:t,delay:n,type:r,repeat:s,repeatDelay:a,repeatType:l,name:d,motionValue:h,element:p,...m},w=p?.KeyframeResolver||hp;this.keyframeResolver=new w(c,(k,b,E)=>this.onKeyframesResolved(k,b,y,!E),d,h,p),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(t,n,r,s){this.keyframeResolver=void 0;const{name:a,type:l,velocity:c,delay:d,isHandoff:h,onUpdate:p}=r;this.resolvedAt=an.now();let m=!0;v2(t,a,l,c)||(m=!1,(ci.instantAnimations||!d)&&p?.(Yu(t,r,n)),t[0]=t[t.length-1],th(r),r.repeat=0);const w={startTime:s?this.resolvedAt?this.resolvedAt-this.createdAt>b2?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:n,...r,keyframes:t},k=m&&!h&&C2(w),b=w.motionValue?.owner?.current;let E;if(k)try{E=new g2({...w,element:b})}catch{E=new ku(w)}else E=new ku(w);E.finished.then(()=>{this.notifyFinished()}).catch(Vn),this.pendingTimeline&&(this.stopTimeline=E.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=E}get finished(){return this._animation?this.animation.finished:this._finished}then(t,n){return this.finished.finally(t).then(()=>{})}get animation(){return this._animation||(this.keyframeResolver?.resume(),l2()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(t){this.animation.time=t}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(t){this.animation.speed=t}get startTime(){return this.animation.startTime}attachTimeline(t){return this._animation?this.stopTimeline=this.animation.attachTimeline(t):this.pendingTimeline=t,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){this._animation&&this.animation.cancel(),this.keyframeResolver?.cancel()}}function Gw(e,t,n,r=0,s=1){const a=Array.from(e).sort((h,p)=>h.sortNodePosition(p)).indexOf(t),l=e.size,c=(l-1)*r;return typeof n=="function"?n(a,l):s===1?a*r:c-a*r}const fv=30,_2=e=>!isNaN(parseFloat(e));class P2{constructor(t,n={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=r=>{const s=an.now();if(this.updatedAt!==s&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(r),this.current!==this.prev&&(this.events.change?.notify(this.current),this.dependents))for(const a of this.dependents)a.dirty()},this.hasAnimated=!1,this.setCurrent(t),this.owner=n.owner}setCurrent(t){this.current=t,this.updatedAt=an.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=_2(this.current))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return this.on("change",t)}on(t,n){this.events[t]||(this.events[t]=new ip);const r=this.events[t].add(n);return t==="change"?()=>{r(),rt.read(()=>{this.events.change.getSize()||this.stop()})}:r}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,n){this.passiveEffect=t,this.stopPassiveEffect=n}set(t){this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t)}setWithVelocity(t,n,r){this.set(n),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-r}jump(t,n=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,n&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){this.events.change?.notify(this.current)}addDependent(t){this.dependents||(this.dependents=new Set),this.dependents.add(t)}removeDependent(t){this.dependents&&this.dependents.delete(t)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const t=an.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>fv)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,fv);return pw(parseFloat(this.current)-parseFloat(this.prevFrameValue),n)}start(t){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.animation=t(n),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.dependents?.clear(),this.events.destroy?.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function Bs(e,t){return new P2(e,t)}function pp(e,t){if(e?.inherit&&t){const{inherit:n,...r}=e;return{...t,...r}}return e}function mp(e,t){const n=e?.[t]??e?.default??e;return n!==e?pp(n,e):n}const T2={type:"spring",stiffness:500,damping:25,restSpeed:10},R2=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),A2={type:"keyframes",duration:.8},I2={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},M2=(e,{keyframes:t})=>t.length>2?A2:Ks.has(e)?e.startsWith("scale")?R2(t[1]):T2:I2,N2=new Set(["when","delay","delayChildren","staggerChildren","staggerDirection","repeat","repeatType","repeatDelay","from","elapsed"]);function L2(e){for(const t in e)if(!N2.has(t))return!0;return!1}const gp=(e,t,n,r={},s,a)=>l=>{const c=mp(r,e)||{},d=c.delay||r.delay||0;let{elapsed:h=0}=r;h=h-_n(d);const p={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:t.getVelocity(),...c,delay:-h,onUpdate:y=>{t.set(y),c.onUpdate&&c.onUpdate(y)},onComplete:()=>{l(),c.onComplete&&c.onComplete()},name:e,motionValue:t,element:a?void 0:s};L2(c)||Object.assign(p,M2(e,p)),p.duration&&(p.duration=_n(p.duration)),p.repeatDelay&&(p.repeatDelay=_n(p.repeatDelay)),p.from!==void 0&&(p.keyframes[0]=p.from);let m=!1;if((p.type===!1||p.duration===0&&!p.repeatDelay)&&(th(p),p.delay===0&&(m=!0)),(ci.instantAnimations||ci.skipAnimations||s?.shouldSkipAnimations||c.skipAnimations)&&(m=!0,th(p),p.delay=0),p.allowFlatten=!c.type&&!c.ease,m&&!a&&t.get()!==void 0){const y=Yu(p.keyframes,c);if(y!==void 0){rt.update(()=>{p.onUpdate(y),p.onComplete()});return}}return c.isSync?new ku(p):new E2(p)},j2=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function D2(e){const t=j2.exec(e);if(!t)return[,];const[,n,r,s]=t;return[`--${n??r}`,s]}function Kw(e,t,n=1){const[r,s]=D2(e);if(!r)return;const a=window.getComputedStyle(t).getPropertyValue(r);if(a){const l=a.trim();return cw(l)?parseFloat(l):l}return ap(s)?Kw(s,t,n+1):s}function hv(e){const t=[{},{}];return e?.values.forEach((n,r)=>{t[0][r]=n.get(),t[1][r]=n.getVelocity()}),t}function yp(e,t,n,r){if(typeof t=="function"){const[s,a]=hv(r);t=t(n!==void 0?n:e.custom,s,a)}if(typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"){const[s,a]=hv(r);t=t(n!==void 0?n:e.custom,s,a)}return t}function $i(e,t,n){const r=e.getProps();return yp(r,t,n!==void 0?n:r.custom,e)}const Xw=new Set(["width","height","top","left","right","bottom",...Gs]),nh=e=>Array.isArray(e);function O2(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,Bs(n))}function F2(e){return nh(e)?e[e.length-1]||0:e}function V2(e,t){const n=$i(e,t);let{transitionEnd:r={},transition:s={},...a}=n||{};a={...a,...r};for(const l in a){const c=F2(a[l]);O2(e,l,c)}}const Ht=e=>!!(e&&e.getVelocity);function z2(e){return!!(Ht(e)&&e.add)}function rh(e,t){const n=e.getValue("willChange");if(z2(n))return n.add(t);if(!n&&ci.WillChange){const r=new ci.WillChange("auto");e.addValue("willChange",r),r.add(t)}}function vp(e){return e.replace(/([A-Z])/g,t=>`-${t.toLowerCase()}`)}const B2="framerAppearId",Yw="data-"+vp(B2);function Qw(e){return e.props[Yw]}function U2({protectedKeys:e,needsAnimating:t},n){const r=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,r}function Jw(e,t,{delay:n=0,transitionOverride:r,type:s}={}){let{transition:a,transitionEnd:l,...c}=t;const d=e.getDefaultTransition();a=a?pp(a,d):d;const h=a?.reduceMotion,p=a?.skipAnimations;r&&(a=r);const m=[],y=s&&e.animationState&&e.animationState.getState()[s],w=a?.path;w&&w.animateVisualElement(e,c,a,n,m);for(const k in c){const b=e.getValue(k,e.latestValues[k]??null),E=c[k];if(E===void 0||y&&U2(y,k))continue;const P={delay:n,...mp(a||{},k)};p&&(P.skipAnimations=!0);const R=b.get();if(R!==void 0&&!b.isAnimating()&&!Array.isArray(E)&&E===R&&!P.velocity){rt.update(()=>b.set(E));continue}let _=!1;if(window.MotionHandoffAnimation){const N=Qw(e);if(N){const q=window.MotionHandoffAnimation(N,k,rt);q!==null&&(P.startTime=q,_=!0)}}rh(e,k);const j=h??e.shouldReduceMotion;b.start(gp(k,b,E,j&&Xw.has(k)?{type:!1}:P,e,_));const A=b.animation;A&&m.push(A)}if(l){const k=()=>rt.update(()=>{l&&V2(e,l)});m.length?Promise.all(m).then(k):k()}return m}function ih(e,t,n={}){const r=$i(e,t,n.type==="exit"?e.presenceContext?.custom:void 0);let{transition:s=e.getDefaultTransition()||{}}=r||{};n.transitionOverride&&(s=n.transitionOverride);const a=r?()=>Promise.all(Jw(e,r,n)):()=>Promise.resolve(),l=e.variantChildren&&e.variantChildren.size?(d=0)=>{const{delayChildren:h=0,staggerChildren:p,staggerDirection:m}=s;return $2(e,t,d,h,p,m,n)}:()=>Promise.resolve(),{when:c}=s;if(c){const[d,h]=c==="beforeChildren"?[a,l]:[l,a];return d().then(()=>h())}else return Promise.all([a(),l(n.delay)])}function $2(e,t,n=0,r=0,s=0,a=1,l){const c=[];for(const d of e.variantChildren)d.notify("AnimationStart",t),c.push(ih(d,t,{...l,delay:n+(typeof r=="function"?0:r)+Gw(e.variantChildren,d,r,s,a)}).then(()=>d.notify("AnimationComplete",t)));return Promise.all(c)}function H2(e,t,n={}){e.notify("AnimationStart",t);let r;if(Array.isArray(t)){const s=t.map(a=>ih(e,a,n));r=Promise.all(s)}else if(typeof t=="string")r=ih(e,t,n);else{const s=typeof t=="function"?$i(e,t,n.custom):t;r=Promise.all(Jw(e,s,n))}return r.then(()=>{e.notify("AnimationComplete",t)})}const W2={test:e=>e==="auto",parse:e=>e},Zw=e=>t=>t.test(e),e1=[qs,_e,pr,Ar,y_,g_,W2],pv=e=>e1.find(Zw(e));function q2(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||fw(e):!0}const G2=new Set(["brightness","contrast","saturate","opacity"]);function K2(e){const[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[r]=n.match(lp)||[];if(!r)return e;const s=n.replace(r,"");let a=G2.has(t)?1:0;return r!==n&&(a*=100),t+"("+a+s+")"}const X2=/\b([a-z-]*)\(.*?\)/gu,sh={...Jn,getAnimatableNone:e=>{const t=e.match(X2);return t?t.map(K2).join(" "):e}},oh={...Jn,getAnimatableNone:e=>{const t=Jn.parse(e);return Jn.createTransformer(e)(t.map(r=>typeof r=="number"?0:typeof r=="object"?{...r,alpha:1}:r))}},mv={...qs,transform:Math.round},Y2={rotate:Ar,pathRotation:Ar,rotateX:Ar,rotateY:Ar,rotateZ:Ar,scale:Fl,scaleX:Fl,scaleY:Fl,scaleZ:Fl,skew:Ar,skewX:Ar,skewY:Ar,distance:_e,translateX:_e,translateY:_e,translateZ:_e,x:_e,y:_e,z:_e,perspective:_e,transformPerspective:_e,opacity:oa,originX:tv,originY:tv,originZ:_e},Cu={borderWidth:_e,borderTopWidth:_e,borderRightWidth:_e,borderBottomWidth:_e,borderLeftWidth:_e,borderRadius:_e,borderTopLeftRadius:_e,borderTopRightRadius:_e,borderBottomRightRadius:_e,borderBottomLeftRadius:_e,width:_e,maxWidth:_e,height:_e,maxHeight:_e,top:_e,right:_e,bottom:_e,left:_e,inset:_e,insetBlock:_e,insetBlockStart:_e,insetBlockEnd:_e,insetInline:_e,insetInlineStart:_e,insetInlineEnd:_e,padding:_e,paddingTop:_e,paddingRight:_e,paddingBottom:_e,paddingLeft:_e,paddingBlock:_e,paddingBlockStart:_e,paddingBlockEnd:_e,paddingInline:_e,paddingInlineStart:_e,paddingInlineEnd:_e,margin:_e,marginTop:_e,marginRight:_e,marginBottom:_e,marginLeft:_e,marginBlock:_e,marginBlockStart:_e,marginBlockEnd:_e,marginInline:_e,marginInlineStart:_e,marginInlineEnd:_e,fontSize:_e,backgroundPositionX:_e,backgroundPositionY:_e,...Y2,zIndex:mv,fillOpacity:oa,strokeOpacity:oa,numOctaves:mv},Q2={...Cu,color:Pt,backgroundColor:Pt,outlineColor:Pt,fill:Pt,stroke:Pt,borderColor:Pt,borderTopColor:Pt,borderRightColor:Pt,borderBottomColor:Pt,borderLeftColor:Pt,filter:sh,WebkitFilter:sh,mask:oh,WebkitMask:oh},t1=e=>Q2[e],J2=new Set([sh,oh]);function n1(e,t){let n=t1(e);return J2.has(n)||(n=Jn),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const Z2=new Set(["auto","none","0"]);function eP(e,t,n){let r=0,s;for(;r<e.length&&!s;){const a=e[r];typeof a=="string"&&!Z2.has(a)&&zs(a).values.length&&(s=e[r]),r++}if(s&&n)for(const a of t)e[a]=n1(n,s)}class tP extends hp{constructor(t,n,r,s,a){super(t,n,r,s,a,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:n,name:r}=this;if(!n||!n.current)return;super.readKeyframes();for(let p=0;p<t.length;p++){let m=t[p];if(typeof m=="string"&&(m=m.trim(),ap(m))){const y=Kw(m,n.current);y!==void 0&&(t[p]=y),p===t.length-1&&(this.finalKeyframe=m)}}if(this.resolveNoneKeyframes(),!Xw.has(r)||t.length!==2)return;const[s,a]=t,l=pv(s),c=pv(a),d=ev(s),h=ev(a);if(d!==h&&ai[r]){this.needsMeasurement=!0;return}if(l!==c)if(uv(l)&&uv(c))for(let p=0;p<t.length;p++){const m=t[p];typeof m=="string"&&(t[p]=parseFloat(m))}else ai[r]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:n}=this,r=[];for(let s=0;s<t.length;s++)(t[s]===null||q2(t[s]))&&r.push(s);r.length&&eP(t,r,n)}measureInitialState(){const{element:t,unresolvedKeyframes:n,name:r}=this;if(!t||!t.current)return;r==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=ai[r](t.measureViewportBox(),window.getComputedStyle(t.current)),n[0]=this.measuredOrigin;const s=n[n.length-1];s!==void 0&&t.getValue(r,s).jump(s,!1)}measureEndState(){const{element:t,name:n,unresolvedKeyframes:r}=this;if(!t||!t.current)return;const s=t.getValue(n);s&&s.jump(this.measuredOrigin,!1);const a=r.length-1,l=r[a];r[a]=ai[n](t.measureViewportBox(),window.getComputedStyle(t.current)),l!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=l),this.removedTransforms?.length&&this.removedTransforms.forEach(([c,d])=>{t.getValue(c).set(d)}),this.resolveNoneKeyframes()}}const xp=["borderTopLeftRadius","borderTopRightRadius","borderBottomRightRadius","borderBottomLeftRadius"];function r1(e,t,n){if(e==null)return[];if(e instanceof EventTarget)return[e];if(typeof e=="string"){let r=document;const s=n?.[e]??r.querySelectorAll(e);return s?Array.from(s):[]}return Array.from(e).filter(r=>r!=null)}const ah=(e,t)=>t&&typeof e=="number"?t.transform(e):e;function nu(e){return dw(e)&&"offsetHeight"in e&&!("ownerSVGElement"in e)}const{schedule:wp}=Ew(queueMicrotask,!1),Yn={x:!1,y:!1};function i1(){return Yn.x||Yn.y}function nP(e){return e==="x"||e==="y"?Yn[e]?null:(Yn[e]=!0,()=>{Yn[e]=!1}):Yn.x||Yn.y?null:(Yn.x=Yn.y=!0,()=>{Yn.x=Yn.y=!1})}function s1(e,t){const n=r1(e),r=new AbortController,s={passive:!0,...t,signal:r.signal};return[n,s,()=>r.abort()]}function rP(e){return!(e.pointerType==="touch"||i1())}function iP(e,t,n={}){const[r,s,a]=s1(e,n);return r.forEach(l=>{let c=!1,d=!1,h;const p=()=>{l.removeEventListener("pointerleave",k)},m=E=>{h&&(h(E),h=void 0),p()},y=E=>{c=!1,window.removeEventListener("pointerup",y),window.removeEventListener("pointercancel",y),d&&(d=!1,m(E))},w=()=>{c=!0,window.addEventListener("pointerup",y,s),window.addEventListener("pointercancel",y,s)},k=E=>{if(E.pointerType!=="touch"){if(c){d=!0;return}m(E)}},b=E=>{if(!rP(E))return;d=!1;const P=t(l,E);typeof P=="function"&&(h=P,l.addEventListener("pointerleave",k,s))};l.addEventListener("pointerenter",b,s),l.addEventListener("pointerdown",w,s)}),a}const o1=(e,t)=>t?e===t?!0:o1(e,t.parentElement):!1,Sp=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1,sP=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function oP(e){return sP.has(e.tagName)||e.isContentEditable===!0}const aP=new Set(["INPUT","SELECT","TEXTAREA"]);function lP(e){return aP.has(e.tagName)||e.isContentEditable===!0}const ru=new WeakSet;function gv(e){return t=>{t.key==="Enter"&&e(t)}}function Zd(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}const uP=(e,t)=>{const n=e.currentTarget;if(!n)return;const r=gv(()=>{if(ru.has(n))return;Zd(n,"down");const s=gv(()=>{Zd(n,"up")}),a=()=>Zd(n,"cancel");n.addEventListener("keyup",s,t),n.addEventListener("blur",a,t)});n.addEventListener("keydown",r,t),n.addEventListener("blur",()=>n.removeEventListener("keydown",r),t)};function yv(e){return Sp(e)&&!i1()}const vv=new WeakSet;function cP(e,t,n={}){const[r,s,a]=s1(e,n),l=c=>{const d=c.currentTarget;if(!yv(c)||vv.has(c))return;ru.add(d),n.stopPropagation&&vv.add(c);const h=t(d,c),p={...s,capture:!0},m=(k,b)=>{window.removeEventListener("pointerup",y,p),window.removeEventListener("pointercancel",w,p),ru.has(d)&&ru.delete(d),yv(k)&&typeof h=="function"&&h(k,{success:b})},y=k=>{m(k,d===window||d===document||n.useGlobalTarget||o1(d,k.target))},w=k=>{m(k,!1)};window.addEventListener("pointerup",y,p),window.addEventListener("pointercancel",w,p)};return r.forEach(c=>{(n.useGlobalTarget?window:c).addEventListener("pointerdown",l,s),nu(c)&&(c.addEventListener("focus",h=>uP(h,s)),!oP(c)&&!c.hasAttribute("tabindex")&&(c.tabIndex=0))}),a}function kp(e){return dw(e)&&"ownerSVGElement"in e}const iu=new WeakMap;let su;const a1=(e,t,n)=>(r,s)=>s&&s[0]?s[0][e+"Size"]:kp(r)&&"getBBox"in r?r.getBBox()[t]:r[n],dP=a1("inline","width","offsetWidth"),fP=a1("block","height","offsetHeight");function hP({target:e,borderBoxSize:t}){iu.get(e)?.forEach(n=>{n(e,{get width(){return dP(e,t)},get height(){return fP(e,t)}})})}function pP(e){e.forEach(hP)}function mP(){typeof ResizeObserver>"u"||(su=new ResizeObserver(pP))}function gP(e,t){su||mP();const n=r1(e);return n.forEach(r=>{let s=iu.get(r);s||(s=new Set,iu.set(r,s)),s.add(t),su?.observe(r)}),()=>{n.forEach(r=>{const s=iu.get(r);s?.delete(t),s?.size||su?.unobserve(r)})}}const ou=new Set;let Ls;function yP(){Ls=()=>{const e={get width(){return window.innerWidth},get height(){return window.innerHeight}};ou.forEach(t=>t(e))},window.addEventListener("resize",Ls)}function vP(e){return ou.add(e),Ls||yP(),()=>{ou.delete(e),!ou.size&&typeof Ls=="function"&&(window.removeEventListener("resize",Ls),Ls=void 0)}}function xv(e,t){return typeof e=="function"?vP(e):gP(e,t)}function xP(e){return kp(e)&&e.tagName==="svg"}const wP=[...e1,Pt,Jn],SP=e=>wP.find(Zw(e)),wv=()=>({translate:0,scale:1,origin:0,originPoint:0}),js=()=>({x:wv(),y:wv()}),Sv=()=>({min:0,max:0}),Mt=()=>({x:Sv(),y:Sv()}),kP=new WeakMap;function Qu(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}function aa(e){return typeof e=="string"||Array.isArray(e)}const Cp=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],bp=["initial",...Cp];function Ju(e){return Qu(e.animate)||bp.some(t=>aa(e[t]))}function l1(e){return!!(Ju(e)||e.variants)}function CP(e,t,n){for(const r in t){const s=t[r],a=n[r];if(Ht(s))e.addValue(r,s);else if(Ht(a))e.addValue(r,Bs(s,{owner:e}));else if(a!==s)if(e.hasValue(r)){const l=e.getValue(r);l.liveStyle===!0?l.jump(s):l.hasAnimated||l.set(s)}else{const l=e.getStaticValue(r);e.addValue(r,Bs(l!==void 0?l:s,{owner:e}))}}for(const r in n)t[r]===void 0&&e.removeValue(r);return t}const lh={current:null},u1={current:!1},bP=typeof window<"u";function EP(){if(u1.current=!0,!!bP)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>lh.current=e.matches;e.addEventListener("change",t),t()}else lh.current=!1}const kv=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let bu={};function c1(e){bu=e}function _P(){return bu}class PP{scrapeMotionValuesFromProps(t,n,r){return{}}constructor({parent:t,props:n,presenceContext:r,reducedMotionConfig:s,skipAnimations:a,blockInitialAnimation:l,visualState:c},d={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.shouldSkipAnimations=!1,this.values=new Map,this.KeyframeResolver=hp,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.hasBeenMounted=!1,this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const w=an.now();this.renderScheduledAt<w&&(this.renderScheduledAt=w,rt.render(this.render,!1,!0))};const{latestValues:h,renderState:p}=c;this.latestValues=h,this.baseTarget={...h},this.initialValues=n.initial?{...h}:{},this.renderState=p,this.parent=t,this.props=n,this.presenceContext=r,this.depth=t?t.depth+1:0,this.reducedMotionConfig=s,this.skipAnimationsConfig=a,this.options=d,this.blockInitialAnimation=!!l,this.isControllingVariants=Ju(n),this.isVariantNode=l1(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(t&&t.current);const{willChange:m,...y}=this.scrapeMotionValuesFromProps(n,{},this);for(const w in y){const k=y[w];h[w]!==void 0&&Ht(k)&&k.set(h[w])}}mount(t){if(this.hasBeenMounted)for(const n in this.initialValues)this.values.get(n)?.jump(this.initialValues[n]),this.latestValues[n]=this.initialValues[n];this.current=t,kP.set(t,this),this.projection&&!this.projection.instance&&this.projection.mount(t),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((n,r)=>this.bindToMotionValue(r,n)),this.reducedMotionConfig==="never"?this.shouldReduceMotion=!1:this.reducedMotionConfig==="always"?this.shouldReduceMotion=!0:(u1.current||EP(),this.shouldReduceMotion=lh.current),this.shouldSkipAnimations=this.skipAnimationsConfig??!1,this.parent?.addChild(this),this.update(this.props,this.presenceContext),this.hasBeenMounted=!0}unmount(){this.projection&&this.projection.unmount(),di(this.notifyUpdate),di(this.render),this.valueSubscriptions.forEach(t=>t()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent?.removeChild(this);for(const t in this.events)this.events[t].clear();for(const t in this.features){const n=this.features[t];n&&(n.unmount(),n.isMounted=!1)}this.current=null}addChild(t){this.children.add(t),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(t)}removeChild(t){this.children.delete(t),this.enteringChildren&&this.enteringChildren.delete(t)}bindToMotionValue(t,n){if(this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)(),n.accelerate&&qw.has(t)&&this.current instanceof HTMLElement){const{factory:l,keyframes:c,times:d,ease:h,duration:p}=n.accelerate,m=new Hw({element:this.current,name:t,keyframes:c,times:d,ease:h,duration:_n(p)}),y=l(m);this.valueSubscriptions.set(t,()=>{y(),m.cancel()});return}const r=Ks.has(t);r&&this.onBindTransform&&this.onBindTransform();const s=n.on("change",l=>{this.latestValues[t]=l,this.props.onUpdate&&rt.preRender(this.notifyUpdate),r&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let a;typeof window<"u"&&window.MotionCheckAppearSync&&(a=window.MotionCheckAppearSync(this,t,n)),this.valueSubscriptions.set(t,()=>{s(),a&&a()})}sortNodePosition(t){return!this.current||!this.sortInstanceNodePosition||this.type!==t.type?0:this.sortInstanceNodePosition(this.current,t.current)}updateFeatures(){let t="animation";for(t in bu){const n=bu[t];if(!n)continue;const{isEnabled:r,Feature:s}=n;if(!this.features[t]&&s&&r(this.props)&&(this.features[t]=new s(this)),this.features[t]){const a=this.features[t];a.isMounted?a.update():(a.mount(),a.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):Mt()}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,n){this.latestValues[t]=n}update(t,n){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let r=0;r<kv.length;r++){const s=kv[r];this.propEventSubscriptions[s]&&(this.propEventSubscriptions[s](),delete this.propEventSubscriptions[s]);const a="on"+s,l=t[a];l&&(this.propEventSubscriptions[s]=this.on(s,l))}this.prevMotionValues=CP(this,this.scrapeMotionValuesFromProps(t,this.prevProps||{},this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(t){return this.props.variants?this.props.variants[t]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(t){const n=this.getClosestVariantNode();if(n)return n.variantChildren&&n.variantChildren.add(t),()=>n.variantChildren.delete(t)}addValue(t,n){const r=this.values.get(t);n!==r&&(r&&this.removeValue(t),this.bindToMotionValue(t,n),this.values.set(t,n),this.latestValues[t]=n.get())}removeValue(t){this.values.delete(t);const n=this.valueSubscriptions.get(t);n&&(n(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,n){if(this.props.values&&this.props.values[t])return this.props.values[t];let r=this.values.get(t);return r===void 0&&n!==void 0&&(r=Bs(n===null?void 0:n,{owner:this}),this.addValue(t,r)),r}readValue(t,n){let r=this.latestValues[t]!==void 0||!this.current?this.latestValues[t]:this.getBaseTargetFromProps(this.props,t)??this.readValueFromInstance(this.current,t,this.options);return r!=null&&(typeof r=="string"&&(cw(r)||fw(r))?r=parseFloat(r):!SP(r)&&Jn.test(n)&&(r=n1(t,n)),this.setBaseTarget(t,Ht(r)?r.get():r)),Ht(r)?r.get():r}setBaseTarget(t,n){this.baseTarget[t]=n}getBaseTarget(t){const{initial:n}=this.props;let r;if(typeof n=="string"||typeof n=="object"){const a=yp(this.props,n,this.presenceContext?.custom);a&&(r=a[t])}if(n&&r!==void 0)return r;const s=this.getBaseTargetFromProps(this.props,t);return s!==void 0&&!Ht(s)?s:this.initialValues[t]!==void 0&&r===void 0?void 0:this.baseTarget[t]}on(t,n){return this.events[t]||(this.events[t]=new ip),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}scheduleRenderMicrotask(){wp.render(this.render)}}class d1 extends PP{constructor(){super(...arguments),this.KeyframeResolver=tP}sortInstanceNodePosition(t,n){return t.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(t,n){const r=t.style;return r?r[n]:void 0}removeValueFromRenderState(t,{vars:n,style:r}){delete n[t],delete r[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;Ht(t)&&(this.childSubscription=t.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}class pi{constructor(t){this.isMounted=!1,this.node=t}update(){}}function f1({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function TP({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function RP(e,t){if(!t)return e;const n=t({x:e.left,y:e.top}),r=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}function ef(e){return e===void 0||e===1}function uh({scale:e,scaleX:t,scaleY:n}){return!ef(e)||!ef(t)||!ef(n)}function Ii(e){return uh(e)||h1(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function h1(e){return Cv(e.x)||Cv(e.y)}function Cv(e){return e&&e!=="0%"}function Eu(e,t,n){const r=e-n,s=t*r;return n+s}function bv(e,t,n,r,s){return s!==void 0&&(e=Eu(e,s,r)),Eu(e,n,r)+t}function ch(e,t=0,n=1,r,s){e.min=bv(e.min,t,n,r,s),e.max=bv(e.max,t,n,r,s)}function p1(e,{x:t,y:n}){ch(e.x,t.translate,t.scale,t.originPoint),ch(e.y,n.translate,n.scale,n.originPoint)}const Ev=.999999999999,_v=1.0000000000001;function AP(e,t,n,r=!1){const s=n.length;if(!s)return;t.x=t.y=1;let a,l;for(let c=0;c<s;c++){a=n[c],l=a.projectionDelta;const{visualElement:d}=a.options;d&&d.props.style&&d.props.style.display==="contents"||(r&&a.options.layoutScroll&&a.scroll&&a!==a.root&&(fr(e.x,-a.scroll.offset.x),fr(e.y,-a.scroll.offset.y)),l&&(t.x*=l.x.scale,t.y*=l.y.scale,p1(e,l)),r&&Ii(a.latestValues)&&au(e,a.latestValues,a.layout?.layoutBox))}t.x<_v&&t.x>Ev&&(t.x=1),t.y<_v&&t.y>Ev&&(t.y=1)}function fr(e,t){e.min+=t,e.max+=t}function Pv(e,t,n,r,s=.5){const a=nt(e.min,e.max,s);ch(e,t,n,a,r)}function Tv(e,t){return typeof e=="string"?parseFloat(e)/100*(t.max-t.min):e}function au(e,t,n){const r=n??e;Pv(e.x,Tv(t.x,r.x),t.scaleX,t.scale,t.originX),Pv(e.y,Tv(t.y,r.y),t.scaleY,t.scale,t.originY)}function m1(e,t){return f1(RP(e.getBoundingClientRect(),t))}function IP(e,t,n){const r=m1(e,n),{scroll:s}=t;return s&&(fr(r.x,s.offset.x),fr(r.y,s.offset.y)),r}const MP={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},NP=Gs.length;function LP(e,t,n){let r="",s=!0;for(let l=0;l<NP;l++){const c=Gs[l],d=e[c];if(d===void 0)continue;let h=!0;if(typeof d=="number")h=d===(c.startsWith("scale")?1:0);else{const p=parseFloat(d);h=c.startsWith("scale")?p===1:p===0}if(!h||n){const p=ah(d,Cu[c]);if(!h){s=!1;const m=MP[c]||c;r+=`${m}(${p}) `}n&&(t[c]=p)}}const a=e.pathRotation;return a&&(s=!1,r+=`rotate(${ah(a,Cu.pathRotation)}) `),r=r.trim(),n?r=n(t,s?"":r):s&&(r="none"),r}function Ep(e,t,n){const{style:r,vars:s,transformOrigin:a}=e;let l=!1,c=!1;for(const d in t){const h=t[d];if(Ks.has(d)){l=!0;continue}else if(Pw(d)){s[d]=h;continue}else{const p=ah(h,Cu[d]);d.startsWith("origin")?(c=!0,a[d]=p):r[d]=p}}if(t.transform||(l||n?r.transform=LP(t,e.transform,n):r.transform&&(r.transform="none")),c){const{originX:d="50%",originY:h="50%",originZ:p=0}=a;r.transformOrigin=`${d} ${h} ${p}`}}function g1(e,{style:t,vars:n},r,s){const a=e.style;let l;for(l in t)a[l]=t[l];s?.applyProjectionStyles(a,r);for(l in n)a.setProperty(l,n[l])}function Rv(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const Do={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(_e.test(e))e=parseFloat(e);else return e;const n=Rv(e,t.target.x),r=Rv(e,t.target.y);return`${n}% ${r}%`}},jP={correct:(e,{treeScale:t,projectionDelta:n})=>{const r=e,s=Jn.parse(e);if(s.length>5)return r;const a=Jn.createTransformer(e),l=typeof s[0]!="number"?1:0,c=n.x.scale*t.x,d=n.y.scale*t.y;s[0+l]/=c,s[1+l]/=d;const h=nt(c,d,.5);return typeof s[2+l]=="number"&&(s[2+l]/=h),typeof s[3+l]=="number"&&(s[3+l]/=h),a(s)}},dh={borderRadius:{...Do,applyTo:[...xp]},borderTopLeftRadius:Do,borderTopRightRadius:Do,borderBottomLeftRadius:Do,borderBottomRightRadius:Do,boxShadow:jP};function y1(e,{layout:t,layoutId:n}){return Ks.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!dh[e]||e==="opacity")}function _p(e,t,n){const r=e.style,s=t?.style,a={};if(!r)return a;for(const l in r)(Ht(r[l])||s&&Ht(s[l])||y1(l,e)||n?.getValue(l)?.liveStyle!==void 0)&&(a[l]=r[l]);return a}function DP(e){return window.getComputedStyle(e)}class OP extends d1{constructor(){super(...arguments),this.type="html",this.renderInstance=g1}mount(t){Xu(!!t.style),super.mount(t)}readValueFromInstance(t,n){if(Ks.has(n))return this.projection?.isProjecting?Yf(n):r2(t,n);{const r=DP(t),s=(Pw(n)?r.getPropertyValue(n):r[n])||0;return typeof s=="string"?s.trim():s}}measureInstanceViewportBox(t,{transformPagePoint:n}){return m1(t,n)}build(t,n,r){Ep(t,n,r.transformTemplate)}scrapeMotionValuesFromProps(t,n,r){return _p(t,n,r)}}const FP={offset:"stroke-dashoffset",array:"stroke-dasharray"},VP={offset:"strokeDashoffset",array:"strokeDasharray"};function zP(e,t,n=1,r=0,s=!0){e.pathLength=1;const a=s?FP:VP;e[a.offset]=`${-r}`,e[a.array]=`${t} ${n}`}const BP=["offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function v1(e,{attrX:t,attrY:n,attrScale:r,pathLength:s,pathSpacing:a=1,pathOffset:l=0,...c},d,h,p){if(Ep(e,c,h),d){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};const{attrs:m,style:y}=e;m.transform&&(y.transform=m.transform,delete m.transform),(y.transform||m.transformOrigin)&&(y.transformOrigin=m.transformOrigin??"50% 50%",delete m.transformOrigin),y.transform&&(y.transformBox=p?.transformBox??"fill-box",delete m.transformBox);for(const w of BP)m[w]!==void 0&&(y[w]=m[w],delete m[w]);t!==void 0&&(m.x=t),n!==void 0&&(m.y=n),r!==void 0&&(m.scale=r),s!==void 0&&zP(m,s,a,l,!1)}const x1=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]),w1=e=>typeof e=="string"&&e.toLowerCase()==="svg";function UP(e,t,n,r){g1(e,t,void 0,r);for(const s in t.attrs)e.setAttribute(x1.has(s)?s:vp(s),t.attrs[s])}function S1(e,t,n){const r=_p(e,t,n);for(const s in e)if(Ht(e[s])||Ht(t[s])){const a=Gs.indexOf(s)!==-1?"attr"+s.charAt(0).toUpperCase()+s.substring(1):s;r[a]=e[s]}return r}class $P extends d1{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=Mt}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(Ks.has(n)){const r=t1(n);return r&&r.default||0}return n=x1.has(n)?n:vp(n),t.getAttribute(n)}scrapeMotionValuesFromProps(t,n,r){return S1(t,n,r)}build(t,n,r){v1(t,n,this.isSVGTag,r.transformTemplate,r.style)}renderInstance(t,n,r,s){UP(t,n,r,s)}mount(t){this.isSVGTag=w1(t.tagName),super.mount(t)}}const HP=bp.length;function k1(e){if(!e)return;if(!e.isControllingVariants){const n=e.parent?k1(e.parent)||{}:{};return e.props.initial!==void 0&&(n.initial=e.props.initial),n}const t={};for(let n=0;n<HP;n++){const r=bp[n],s=e.props[r];(aa(s)||s===!1)&&(t[r]=s)}return t}function C1(e,t){if(!Array.isArray(t))return!1;const n=t.length;if(n!==e.length)return!1;for(let r=0;r<n;r++)if(t[r]!==e[r])return!1;return!0}const WP=[...Cp].reverse(),qP=Cp.length;function GP(e){return t=>Promise.all(t.map(({animation:n,options:r})=>H2(e,n,r)))}function KP(e){let t=GP(e),n=Av(),r=!0,s=!1;const a=h=>(p,m)=>{const y=$i(e,m,h==="exit"?e.presenceContext?.custom:void 0);if(y){const{transition:w,transitionEnd:k,...b}=y;p={...p,...b,...k}}return p};function l(h){t=h(e)}function c(h){const{props:p}=e,m=k1(e.parent)||{},y=[],w=new Set;let k={},b=1/0;for(let P=0;P<qP;P++){const R=WP[P],_=n[R],j=p[R]!==void 0?p[R]:m[R],A=aa(j),N=R===h?_.isActive:null;N===!1&&(b=P);let q=j===m[R]&&j!==p[R]&&A;if(q&&(r||s)&&e.manuallyAnimateOnMount&&(q=!1),_.protectedKeys={...k},!_.isActive&&N===null||!j&&!_.prevProp||Qu(j)||typeof j=="boolean")continue;if(R==="exit"&&_.isActive&&N!==!0){_.prevResolvedValues&&(k={...k,..._.prevResolvedValues});continue}const B=XP(_.prevProp,j);let D=B||R===h&&_.isActive&&!q&&A||P>b&&A,I=!1;const U=Array.isArray(j)?j:[j];let z=U.reduce(a(R),{});N===!1&&(z={});const{prevResolvedValues:he={}}=_,J={...he,...z},Z=Q=>{D=!0,w.has(Q)&&(I=!0,w.delete(Q)),_.needsAnimating[Q]=!0;const pe=e.getValue(Q);pe&&(pe.liveStyle=!1)};for(const Q in J){const pe=z[Q],T=he[Q];if(k.hasOwnProperty(Q))continue;let F=!1;nh(pe)&&nh(T)?F=!C1(pe,T)||B:F=pe!==T,F?pe!=null?Z(Q):w.add(Q):pe!==void 0&&w.has(Q)?Z(Q):_.protectedKeys[Q]=!0}_.prevProp=j,_.prevResolvedValues=z,_.isActive&&(k={...k,...z}),(r||s)&&e.blockInitialAnimation&&(D=!1);const ve=q&&B;D&&(!ve||I)&&y.push(...U.map(Q=>{const pe={type:R};if(typeof Q=="string"&&(r||s)&&!ve&&e.manuallyAnimateOnMount&&e.parent){const{parent:T}=e,F=$i(T,Q);if(T.enteringChildren&&F){const{delayChildren:X}=F.transition||{};pe.delay=Gw(T.enteringChildren,e,X)}}return{animation:Q,options:pe}}))}if(w.size){const P={};if(typeof p.initial!="boolean"){const R=$i(e,Array.isArray(p.initial)?p.initial[0]:p.initial);R&&R.transition&&(P.transition=R.transition)}w.forEach(R=>{const _=e.getBaseTarget(R),j=e.getValue(R);j&&(j.liveStyle=!0),P[R]=_??null}),y.push({animation:P})}let E=!!y.length;return r&&(p.initial===!1||p.initial===p.animate)&&!e.manuallyAnimateOnMount&&(E=!1),r=!1,s=!1,E?t(y):Promise.resolve()}function d(h,p){if(n[h].isActive===p)return Promise.resolve();e.variantChildren?.forEach(y=>y.animationState?.setActive(h,p)),n[h].isActive=p;const m=c(h);for(const y in n)n[y].protectedKeys={};return m}return{animateChanges:c,setActive:d,setAnimateFunction:l,getState:()=>n,reset:()=>{n=Av(),s=!0}}}function XP(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!C1(t,e):!1}function Ri(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function Av(){return{animate:Ri(!0),whileInView:Ri(),whileHover:Ri(),whileTap:Ri(),whileDrag:Ri(),whileFocus:Ri(),exit:Ri()}}function fh(e,t){e.min=t.min,e.max=t.max}function Xn(e,t){fh(e.x,t.x),fh(e.y,t.y)}function Iv(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}const b1=1e-4,YP=1-b1,QP=1+b1,E1=.01,JP=0-E1,ZP=0+E1;function ln(e){return e.max-e.min}function eT(e,t,n){return Math.abs(e-t)<=n}function Mv(e,t,n,r=.5){e.origin=r,e.originPoint=nt(t.min,t.max,e.origin),e.scale=ln(n)/ln(t),e.translate=nt(n.min,n.max,e.origin)-e.originPoint,(e.scale>=YP&&e.scale<=QP||isNaN(e.scale))&&(e.scale=1),(e.translate>=JP&&e.translate<=ZP||isNaN(e.translate))&&(e.translate=0)}function Xo(e,t,n,r){Mv(e.x,t.x,n.x,r?r.originX:void 0),Mv(e.y,t.y,n.y,r?r.originY:void 0)}function Nv(e,t,n,r=0){const s=r?nt(n.min,n.max,r):n.min;e.min=s+t.min,e.max=e.min+ln(t)}function tT(e,t,n,r){Nv(e.x,t.x,n.x,r?.x),Nv(e.y,t.y,n.y,r?.y)}function Lv(e,t,n,r=0){const s=r?nt(n.min,n.max,r):n.min;e.min=t.min-s,e.max=e.min+ln(t)}function _u(e,t,n,r){Lv(e.x,t.x,n.x,r?.x),Lv(e.y,t.y,n.y,r?.y)}function jv(e,t,n,r,s){return e-=t,e=Eu(e,1/n,r),s!==void 0&&(e=Eu(e,1/s,r)),e}function nT(e,t=0,n=1,r=.5,s,a=e,l=e){if(pr.test(t)&&(t=parseFloat(t),t=nt(l.min,l.max,t/100)-l.min),typeof t!="number")return;let c=nt(a.min,a.max,r);e===a&&(c-=t),e.min=jv(e.min,t,n,c,s),e.max=jv(e.max,t,n,c,s)}function Dv(e,t,[n,r,s],a,l){nT(e,t[n],t[r],t[s],t.scale,a,l)}const rT=["x","scaleX","originX"],iT=["y","scaleY","originY"];function Ov(e,t,n,r){Dv(e.x,t,rT,n?n.x:void 0,r?r.x:void 0),Dv(e.y,t,iT,n?n.y:void 0,r?r.y:void 0)}function Fv(e){return e.translate===0&&e.scale===1}function _1(e){return Fv(e.x)&&Fv(e.y)}function Vv(e,t){return e.min===t.min&&e.max===t.max}function sT(e,t){return Vv(e.x,t.x)&&Vv(e.y,t.y)}function zv(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function P1(e,t){return zv(e.x,t.x)&&zv(e.y,t.y)}function Bv(e){return ln(e.x)/ln(e.y)}function Uv(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}function cr(e){return[e("x"),e("y")]}function oT(e,t,n){let r="";const s=e.x.translate/t.x,a=e.y.translate/t.y,l=n?.z||0;if((s||a||l)&&(r=`translate3d(${s}px, ${a}px, ${l}px) `),(t.x!==1||t.y!==1)&&(r+=`scale(${1/t.x}, ${1/t.y}) `),n){const{transformPerspective:h,rotate:p,pathRotation:m,rotateX:y,rotateY:w,skewX:k,skewY:b}=n;h&&(r=`perspective(${h}px) ${r}`),p&&(r+=`rotate(${p}deg) `),m&&(r+=`rotate(${m}deg) `),y&&(r+=`rotateX(${y}deg) `),w&&(r+=`rotateY(${w}deg) `),k&&(r+=`skewX(${k}deg) `),b&&(r+=`skewY(${b}deg) `)}const c=e.x.scale*t.x,d=e.y.scale*t.y;return(c!==1||d!==1)&&(r+=`scale(${c}, ${d})`),r||"none"}const aT=xp.length,$v=e=>typeof e=="string"?parseFloat(e):e,Hv=e=>typeof e=="number"||_e.test(e);function lT(e,t,n,r,s,a){s?(e.opacity=nt(0,n.opacity??1,uT(r)),e.opacityExit=nt(t.opacity??1,0,cT(r))):a&&(e.opacity=nt(t.opacity??1,n.opacity??1,r));for(let l=0;l<aT;l++){const c=xp[l];let d=Wv(t,c),h=Wv(n,c);if(d===void 0&&h===void 0)continue;d||(d=0),h||(h=0),d===0||h===0||Hv(d)===Hv(h)?(e[c]=Math.max(nt($v(d),$v(h),r),0),(pr.test(h)||pr.test(d))&&(e[c]+="%")):e[c]=h}(t.rotate||n.rotate)&&(e.rotate=nt(t.rotate||0,n.rotate||0,r))}function Wv(e,t){return e[t]!==void 0?e[t]:e.borderRadius}const uT=T1(0,.5,Sw),cT=T1(.5,.95,Vn);function T1(e,t,n){return r=>r<e?0:r>t?1:n(sa(e,t,r))}function dT(e,t,n){const r=Ht(e)?e:Bs(e);return r.start(gp("",r,t,n)),r.animation}function la(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n,r)}const fT=(e,t)=>e.depth-t.depth;class hT{constructor(){this.children=[],this.isDirty=!1}add(t){rp(this.children,t),this.isDirty=!0}remove(t){vu(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(fT),this.isDirty=!1,this.children.forEach(t)}}function pT(e,t){const n=an.now(),r=({timestamp:s})=>{const a=s-n;a>=t&&(di(r),e(a-t))};return rt.setup(r,!0),()=>di(r)}function lu(e){return Ht(e)?e.get():e}class mT{constructor(){this.members=[]}add(t){rp(this.members,t);for(let n=this.members.length-1;n>=0;n--){const r=this.members[n];if(r===t||r===this.lead||r===this.prevLead)continue;const s=r.instance;(!s||s.isConnected===!1)&&!r.snapshot&&(vu(this.members,r),r.unmount())}t.scheduleRender()}remove(t){if(vu(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(t){for(let n=this.members.indexOf(t)-1;n>=0;n--){const r=this.members[n];if(r.isPresent!==!1&&r.instance?.isConnected!==!1)return this.promote(r),!0}return!1}promote(t,n){const r=this.lead;if(t!==r&&(this.prevLead=r,this.lead=t,t.show(),r)){r.updateSnapshot(),t.scheduleRender();const{layoutDependency:s}=r.options,{layoutDependency:a}=t.options;(s===void 0||s!==a)&&(t.resumeFrom=r,n&&(r.preserveOpacity=!0),r.snapshot&&(t.snapshot=r.snapshot,t.snapshot.latestValues=r.animationValues||r.latestValues),t.root?.isUpdating&&(t.isLayoutDirty=!0)),t.options.crossfade===!1&&r.hide()}}exitAnimationComplete(){this.members.forEach(t=>{t.options.onExitComplete?.(),t.resumingFrom?.options.onExitComplete?.()})}scheduleRender(){this.members.forEach(t=>t.instance&&t.scheduleRender(!1))}removeLeadSnapshot(){this.lead?.snapshot&&(this.lead.snapshot=void 0)}}const uu={hasAnimatedSinceResize:!0,hasEverUpdated:!1},tf=["","X","Y","Z"],gT=1e3;let yT=0;function nf(e,t,n,r){const{latestValues:s}=t;s[e]&&(n[e]=s[e],t.setStaticValue(e,0),r&&(r[e]=0))}function R1(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const n=Qw(t);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:s,layoutId:a}=e.options;window.MotionCancelOptimisedAnimation(n,"transform",rt,!(s||a))}const{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&R1(r)}function A1({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:s}){return class{constructor(l={},c=t?.()){this.id=yT++,this.animationId=0,this.animationCommitId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.layoutVersion=0,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,this.nodes.forEach(wT),this.nodes.forEach(_T),this.nodes.forEach(PT),this.nodes.forEach(ST)},this.resolvedRelativeTargetAt=0,this.linkedParentVersion=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=l,this.root=c?c.root||c:this,this.path=c?[...c.path,c]:[],this.parent=c,this.depth=c?c.depth+1:0;for(let d=0;d<this.path.length;d++)this.path[d].shouldResetTransform=!0;this.root===this&&(this.nodes=new hT)}addEventListener(l,c){return this.eventHandlers.has(l)||this.eventHandlers.set(l,new ip),this.eventHandlers.get(l).add(c)}notifyListeners(l,...c){const d=this.eventHandlers.get(l);d&&d.notify(...c)}hasListeners(l){return this.eventHandlers.has(l)}mount(l){if(this.instance)return;this.isSVG=kp(l)&&!xP(l),this.instance=l;const{layoutId:c,layout:d,visualElement:h}=this.options;if(h&&!h.current&&h.mount(l),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(d||c)&&(this.isLayoutDirty=!0),e){let p,m=0;const y=()=>this.root.updateBlockedByResize=!1;rt.read(()=>{m=window.innerWidth}),e(l,()=>{const w=window.innerWidth;w!==m&&(m=w,this.root.updateBlockedByResize=!0,p&&p(),p=pT(y,250),uu.hasAnimatedSinceResize&&(uu.hasAnimatedSinceResize=!1,this.nodes.forEach(Kv)))})}c&&this.root.registerSharedNode(c,this),this.options.animate!==!1&&h&&(c||d)&&this.addEventListener("didUpdate",({delta:p,hasLayoutChanged:m,hasRelativeLayoutChanged:y,layout:w})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const k=this.options.transition||h.getDefaultTransition()||MT,{onLayoutAnimationStart:b,onLayoutAnimationComplete:E}=h.getProps(),P=!this.targetLayout||!P1(this.targetLayout,w),R=!m&&y;if(this.options.layoutRoot||this.resumeFrom||R||m&&(P||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const _={...mp(k,"layout"),onPlay:b,onComplete:E};(h.shouldReduceMotion||this.options.layoutRoot)&&(_.delay=0,_.type=!1),this.startAnimation(_),this.setAnimationOrigin(p,R,_.path)}else m||Kv(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=w})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const l=this.getStack();l&&l.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),di(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(TT),this.animationId++)}getTransformTemplate(){const{visualElement:l}=this.options;return l&&l.getProps().transformTemplate}willUpdate(l=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&R1(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let p=0;p<this.path.length;p++){const m=this.path[p];m.shouldResetTransform=!0,(typeof m.latestValues.x=="string"||typeof m.latestValues.y=="string")&&(m.isLayoutDirty=!0),m.updateScroll("snapshot"),m.options.layoutRoot&&m.willUpdate(!1)}const{layoutId:c,layout:d}=this.options;if(c===void 0&&!d)return;const h=this.getTransformTemplate();this.prevTransformTemplateValue=h?h(this.latestValues,""):void 0,this.updateSnapshot(),l&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){const d=this.updateBlockedByResize;this.unblockUpdate(),this.updateBlockedByResize=!1,this.clearAllSnapshots(),d&&this.nodes.forEach(CT),this.nodes.forEach(qv);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(Gv);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(bT),this.nodes.forEach(ET),this.nodes.forEach(vT),this.nodes.forEach(xT)):this.nodes.forEach(Gv),this.clearAllSnapshots();const c=an.now();$t.delta=mr(0,1e3/60,c-$t.timestamp),$t.timestamp=c,$t.isProcessing=!0,Gd.update.process($t),Gd.preRender.process($t),Gd.render.process($t),$t.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,wp.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(kT),this.sharedNodes.forEach(RT)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,rt.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){rt.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!ln(this.snapshot.measuredBox.x)&&!ln(this.snapshot.measuredBox.y)&&(this.snapshot=void 0))}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let d=0;d<this.path.length;d++)this.path[d].updateScroll();const l=this.layout;this.layout=this.measure(!1),this.layoutVersion++,this.layoutCorrected||(this.layoutCorrected=Mt()),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:c}=this.options;c&&c.notify("LayoutMeasure",this.layout.layoutBox,l?l.layoutBox:void 0)}updateScroll(l="measure"){let c=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===l&&(c=!1),c&&this.instance){const d=r(this.instance);this.scroll={animationId:this.root.animationId,phase:l,isRoot:d,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:d}}}resetTransform(){if(!s)return;const l=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,c=this.projectionDelta&&!_1(this.projectionDelta),d=this.getTransformTemplate(),h=d?d(this.latestValues,""):void 0,p=h!==this.prevTransformTemplateValue;l&&this.instance&&(c||Ii(this.latestValues)||p)&&(s(this.instance,h),this.shouldResetTransform=!1,this.scheduleRender())}measure(l=!0){const c=this.measurePageBox();let d=this.removeElementScroll(c);return l&&(d=this.removeTransform(d)),NT(d),{animationId:this.root.animationId,measuredBox:c,layoutBox:d,latestValues:{},source:this.id}}measurePageBox(){const{visualElement:l}=this.options;if(!l)return Mt();const c=l.measureViewportBox();if(!(this.scroll?.wasRoot||this.path.some(LT))){const{scroll:h}=this.root;h&&(fr(c.x,h.offset.x),fr(c.y,h.offset.y))}return c}removeElementScroll(l){const c=Mt();if(Xn(c,l),this.scroll?.wasRoot)return c;for(let d=0;d<this.path.length;d++){const h=this.path[d],{scroll:p,options:m}=h;h!==this.root&&p&&m.layoutScroll&&(p.wasRoot&&Xn(c,l),fr(c.x,p.offset.x),fr(c.y,p.offset.y))}return c}applyTransform(l,c=!1,d){const h=d||Mt();Xn(h,l);for(let p=0;p<this.path.length;p++){const m=this.path[p];!c&&m.options.layoutScroll&&m.scroll&&m!==m.root&&(fr(h.x,-m.scroll.offset.x),fr(h.y,-m.scroll.offset.y)),Ii(m.latestValues)&&au(h,m.latestValues,m.layout?.layoutBox)}return Ii(this.latestValues)&&au(h,this.latestValues,this.layout?.layoutBox),h}removeTransform(l){const c=Mt();Xn(c,l);for(let d=0;d<this.path.length;d++){const h=this.path[d];if(!Ii(h.latestValues))continue;let p;h.instance&&(uh(h.latestValues)&&h.updateSnapshot(),p=Mt(),Xn(p,h.measurePageBox())),Ov(c,h.latestValues,h.snapshot?.layoutBox,p)}return Ii(this.latestValues)&&Ov(c,this.latestValues),c}setTargetDelta(l){this.targetDelta=l,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(l){this.options={...this.options,...l,crossfade:l.crossfade!==void 0?l.crossfade:!0}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==$t.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(l=!1){const c=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=c.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=c.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=c.isSharedProjectionDirty);const d=!!this.resumingFrom||this!==c;if(!(l||d&&this.isSharedProjectionDirty||this.isProjectionDirty||this.parent?.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:p,layoutId:m}=this.options;if(!this.layout||!(p||m))return;this.resolvedRelativeTargetAt=$t.timestamp;const y=this.getClosestProjectingParent();y&&this.linkedParentVersion!==y.layoutVersion&&!y.options.layoutRoot&&this.removeRelativeTarget(),!this.targetDelta&&!this.relativeTarget&&(this.options.layoutAnchor!==!1&&y&&y.layout?this.createRelativeTarget(y,this.layout.layoutBox,y.layout.layoutBox):this.removeRelativeTarget()),!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=Mt(),this.targetWithTransforms=Mt()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),tT(this.target,this.relativeTarget,this.relativeParent.target,this.options.layoutAnchor||void 0)):this.targetDelta?(this.resumingFrom?this.applyTransform(this.layout.layoutBox,!1,this.target):Xn(this.target,this.layout.layoutBox),p1(this.target,this.targetDelta)):Xn(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,this.options.layoutAnchor!==!1&&y&&!!y.resumingFrom==!!this.resumingFrom&&!y.options.layoutScroll&&y.target&&this.animationProgress!==1?this.createRelativeTarget(y,this.target,y.target):this.relativeParent=this.relativeTarget=void 0))}getClosestProjectingParent(){if(!(!this.parent||uh(this.parent.latestValues)||h1(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}createRelativeTarget(l,c,d){this.relativeParent=l,this.linkedParentVersion=l.layoutVersion,this.forceRelativeParentToResolveTarget(),this.relativeTarget=Mt(),this.relativeTargetOrigin=Mt(),_u(this.relativeTargetOrigin,c,d,this.options.layoutAnchor||void 0),Xn(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){const l=this.getLead(),c=!!this.resumingFrom||this!==l;let d=!0;if((this.isProjectionDirty||this.parent?.isProjectionDirty)&&(d=!1),c&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(d=!1),this.resolvedRelativeTargetAt===$t.timestamp&&(d=!1),d)return;const{layout:h,layoutId:p}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(h||p))return;Xn(this.layoutCorrected,this.layout.layoutBox);const m=this.treeScale.x,y=this.treeScale.y;AP(this.layoutCorrected,this.treeScale,this.path,c),l.layout&&!l.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(l.target=l.layout.layoutBox,l.targetWithTransforms=Mt());const{target:w}=l;if(!w){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(Iv(this.prevProjectionDelta.x,this.projectionDelta.x),Iv(this.prevProjectionDelta.y,this.projectionDelta.y)),Xo(this.projectionDelta,this.layoutCorrected,w,this.latestValues),(this.treeScale.x!==m||this.treeScale.y!==y||!Uv(this.projectionDelta.x,this.prevProjectionDelta.x)||!Uv(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",w))}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(l=!0){if(this.options.visualElement?.scheduleRender(),l){const c=this.getStack();c&&c.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=js(),this.projectionDelta=js(),this.projectionDeltaWithTransform=js()}setAnimationOrigin(l,c=!1,d){const h=this.snapshot,p=h?h.latestValues:{},m={...this.latestValues},y=js();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!c;const w=Mt(),k=h?h.source:void 0,b=this.layout?this.layout.source:void 0,E=k!==b,P=this.getStack(),R=!P||P.members.length<=1,_=!!(E&&!R&&this.options.crossfade===!0&&!this.path.some(IT));this.animationProgress=0;let j;const A=d?.interpolateProjection(l);this.mixTargetDelta=N=>{const q=N/1e3,B=A?.(q);B?(y.x.translate=B.x,y.x.scale=nt(l.x.scale,1,q),y.x.origin=l.x.origin,y.x.originPoint=l.x.originPoint,y.y.translate=B.y,y.y.scale=nt(l.y.scale,1,q),y.y.origin=l.y.origin,y.y.originPoint=l.y.originPoint):(Xv(y.x,l.x,q),Xv(y.y,l.y,q)),this.setTargetDelta(y),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(_u(w,this.layout.layoutBox,this.relativeParent.layout.layoutBox,this.options.layoutAnchor||void 0),AT(this.relativeTarget,this.relativeTargetOrigin,w,q),j&&sT(this.relativeTarget,j)&&(this.isProjectionDirty=!1),j||(j=Mt()),Xn(j,this.relativeTarget)),E&&(this.animationValues=m,lT(m,p,this.latestValues,q,_,R)),B&&B.rotate!==void 0&&(this.animationValues||(this.animationValues=m),this.animationValues.pathRotation=B.rotate),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=q},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(l){this.notifyListeners("animationStart"),this.currentAnimation?.stop(),this.resumingFrom?.currentAnimation?.stop(),this.pendingAnimation&&(di(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=rt.update(()=>{uu.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=Bs(0)),this.motionValue.jump(0,!1),this.currentAnimation=dT(this.motionValue,[0,1e3],{...l,velocity:0,isSync:!0,onUpdate:c=>{this.mixTargetDelta(c),l.onUpdate&&l.onUpdate(c)},onComplete:()=>{l.onComplete&&l.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const l=this.getStack();l&&l.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(gT),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const l=this.getLead();let{targetWithTransforms:c,target:d,layout:h,latestValues:p}=l;if(!(!c||!d||!h)){if(this!==l&&this.layout&&h&&I1(this.options.animationType,this.layout.layoutBox,h.layoutBox)){d=this.target||Mt();const m=ln(this.layout.layoutBox.x);d.x.min=l.target.x.min,d.x.max=d.x.min+m;const y=ln(this.layout.layoutBox.y);d.y.min=l.target.y.min,d.y.max=d.y.min+y}Xn(c,d),au(c,p),Xo(this.projectionDeltaWithTransform,this.layoutCorrected,c,p)}}registerSharedNode(l,c){this.sharedNodes.has(l)||this.sharedNodes.set(l,new mT),this.sharedNodes.get(l).add(c);const h=c.options.initialPromotionConfig;c.promote({transition:h?h.transition:void 0,preserveFollowOpacity:h&&h.shouldPreserveFollowOpacity?h.shouldPreserveFollowOpacity(c):void 0})}isLead(){const l=this.getStack();return l?l.lead===this:!0}getLead(){const{layoutId:l}=this.options;return l?this.getStack()?.lead||this:this}getPrevLead(){const{layoutId:l}=this.options;return l?this.getStack()?.prevLead:void 0}getStack(){const{layoutId:l}=this.options;if(l)return this.root.sharedNodes.get(l)}promote({needsReset:l,transition:c,preserveFollowOpacity:d}={}){const h=this.getStack();h&&h.promote(this,d),l&&(this.projectionDelta=void 0,this.needsReset=!0),c&&this.setOptions({transition:c})}relegate(){const l=this.getStack();return l?l.relegate(this):!1}resetSkewAndRotation(){const{visualElement:l}=this.options;if(!l)return;let c=!1;const{latestValues:d}=l;if((d.z||d.rotate||d.rotateX||d.rotateY||d.rotateZ||d.skewX||d.skewY)&&(c=!0),!c)return;const h={};d.z&&nf("z",l,h,this.animationValues);for(let p=0;p<tf.length;p++)nf(`rotate${tf[p]}`,l,h,this.animationValues),nf(`skew${tf[p]}`,l,h,this.animationValues);l.render();for(const p in h)l.setStaticValue(p,h[p]),this.animationValues&&(this.animationValues[p]=h[p]);l.scheduleRender()}applyProjectionStyles(l,c){if(!this.instance||this.isSVG)return;if(!this.isVisible){l.visibility="hidden";return}const d=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,l.visibility="",l.opacity="",l.pointerEvents=lu(c?.pointerEvents)||"",l.transform=d?d(this.latestValues,""):"none";return}const h=this.getLead();if(!this.projectionDelta||!this.layout||!h.target){this.options.layoutId&&(l.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,l.pointerEvents=lu(c?.pointerEvents)||""),this.hasProjected&&!Ii(this.latestValues)&&(l.transform=d?d({},""):"none",this.hasProjected=!1);return}l.visibility="";const p=h.animationValues||h.latestValues;this.applyTransformsToTarget();let m=oT(this.projectionDeltaWithTransform,this.treeScale,p);d&&(m=d(p,m)),l.transform=m;const{x:y,y:w}=this.projectionDelta;l.transformOrigin=`${y.origin*100}% ${w.origin*100}% 0`,h.animationValues?l.opacity=h===this?p.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:p.opacityExit:l.opacity=h===this?p.opacity!==void 0?p.opacity:"":p.opacityExit!==void 0?p.opacityExit:0;for(const k in dh){if(p[k]===void 0)continue;const{correct:b,applyTo:E,isCSSVariable:P}=dh[k],R=m==="none"?p[k]:b(p[k],h);if(E){const _=E.length;for(let j=0;j<_;j++)l[E[j]]=R}else P?this.options.visualElement.renderState.vars[k]=R:l[k]=R}this.options.layoutId&&(l.pointerEvents=h===this?lu(c?.pointerEvents)||"":"none")}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(l=>l.currentAnimation?.stop()),this.root.nodes.forEach(qv),this.root.sharedNodes.clear()}}}function vT(e){e.updateLayout()}function xT(e){const t=e.resumeFrom?.snapshot||e.snapshot;if(e.isLead()&&e.layout&&t&&e.hasListeners("didUpdate")){const{layoutBox:n,measuredBox:r}=e.layout,{animationType:s}=e.options,a=t.source!==e.layout.source;if(s==="size")cr(p=>{const m=a?t.measuredBox[p]:t.layoutBox[p],y=ln(m);m.min=n[p].min,m.max=m.min+y});else if(s==="x"||s==="y"){const p=s==="x"?"y":"x";fh(a?t.measuredBox[p]:t.layoutBox[p],n[p])}else I1(s,t.layoutBox,n)&&cr(p=>{const m=a?t.measuredBox[p]:t.layoutBox[p],y=ln(n[p]);m.max=m.min+y,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[p].max=e.relativeTarget[p].min+y)});const l=js();Xo(l,n,t.layoutBox);const c=js();a?Xo(c,e.applyTransform(r,!0),t.measuredBox):Xo(c,n,t.layoutBox);const d=!_1(l);let h=!1;if(!e.resumeFrom){const p=e.getClosestProjectingParent();if(p&&!p.resumeFrom){const{snapshot:m,layout:y}=p;if(m&&y){const w=e.options.layoutAnchor||void 0,k=Mt();_u(k,t.layoutBox,m.layoutBox,w);const b=Mt();_u(b,n,y.layoutBox,w),P1(k,b)||(h=!0),p.options.layoutRoot&&(e.relativeTarget=b,e.relativeTargetOrigin=k,e.relativeParent=p)}}}e.notifyListeners("didUpdate",{layout:n,snapshot:t,delta:c,layoutDelta:l,hasLayoutChanged:d,hasRelativeLayoutChanged:h})}else if(e.isLead()){const{onExitComplete:n}=e.options;n&&n()}e.options.transition=void 0}function wT(e){e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||(e.isSharedProjectionDirty=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty)),e.isTransformDirty||(e.isTransformDirty=e.parent.isTransformDirty))}function ST(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function kT(e){e.clearSnapshot()}function qv(e){e.clearMeasurements()}function CT(e){e.isLayoutDirty=!0,e.updateLayout()}function Gv(e){e.isLayoutDirty=!1}function bT(e){e.isAnimationBlocked&&e.layout&&!e.isLayoutDirty&&(e.snapshot=e.layout,e.isLayoutDirty=!0)}function ET(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function Kv(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function _T(e){e.resolveTargetDelta()}function PT(e){e.calcProjection()}function TT(e){e.resetSkewAndRotation()}function RT(e){e.removeLeadSnapshot()}function Xv(e,t,n){e.translate=nt(t.translate,0,n),e.scale=nt(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function Yv(e,t,n,r){e.min=nt(t.min,n.min,r),e.max=nt(t.max,n.max,r)}function AT(e,t,n,r){Yv(e.x,t.x,n.x,r),Yv(e.y,t.y,n.y,r)}function IT(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const MT={duration:.45,ease:[.4,0,.1,1]},Qv=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),Jv=Qv("applewebkit/")&&!Qv("chrome/")?Math.round:Vn;function Zv(e){e.min=Jv(e.min),e.max=Jv(e.max)}function NT(e){Zv(e.x),Zv(e.y)}function I1(e,t,n){return e==="position"||e==="preserve-aspect"&&!eT(Bv(t),Bv(n),.2)}function LT(e){return e!==e.root&&e.scroll?.wasRoot}const jT=A1({attachResizeListener:(e,t)=>la(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body?.scrollLeft||0,y:document.documentElement.scrollTop||document.body?.scrollTop||0}),checkIsScrollRoot:()=>!0}),rf={current:void 0},M1=A1({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!rf.current){const e=new jT({});e.mount(window),e.setOptions({layoutScroll:!0}),rf.current=e}return rf.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),ua=S.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});function e0(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function DT(...e){return t=>{let n=!1;const r=e.map(s=>{const a=e0(s,t);return!n&&typeof a=="function"&&(n=!0),a});if(n)return()=>{for(let s=0;s<r.length;s++){const a=r[s];typeof a=="function"?a():e0(e[s],null)}}}}function OT(...e){return S.useCallback(DT(...e),e)}class FT extends S.Component{getSnapshotBeforeUpdate(t){const n=this.props.childRef.current;if(nu(n)&&t.isPresent&&!this.props.isPresent&&this.props.pop!==!1){const r=n.offsetParent,s=nu(r)&&r.offsetWidth||0,a=nu(r)&&r.offsetHeight||0,l=getComputedStyle(n),c=this.props.sizeRef.current;c.height=parseFloat(l.height),c.width=parseFloat(l.width),c.top=n.offsetTop,c.left=n.offsetLeft,c.right=s-c.width-c.left,c.bottom=a-c.height-c.top,c.direction=l.direction}return null}componentDidUpdate(){}render(){return this.props.children}}function VT({children:e,isPresent:t,anchorX:n,anchorY:r,root:s,pop:a}){const l=S.useId(),c=S.useRef(null),d=S.useRef({width:0,height:0,top:0,left:0,right:0,bottom:0,direction:"ltr"}),{nonce:h}=S.useContext(ua),p=a!==!1?e.props?.ref??e?.ref:void 0,m=OT(c,p);return S.useInsertionEffect(()=>{const{width:y,height:w,top:k,left:b,right:E,bottom:P,direction:R}=d.current;if(t||a===!1||!c.current||!y||!w)return;const _=R==="rtl",j=n==="left"?_?`right: ${E}`:`left: ${b}`:_?`left: ${b}`:`right: ${E}`,A=r==="bottom"?`bottom: ${P}`:`top: ${k}`;c.current.dataset.motionPopId=l;const N=document.createElement("style");h&&(N.nonce=h);const q=s??document.head;return q.appendChild(N),N.sheet&&N.sheet.insertRule(`
41
- [data-motion-pop-id="${l}"] {
42
- position: absolute !important;
43
- width: ${y}px !important;
44
- height: ${w}px !important;
45
- ${j}px !important;
46
- ${A}px !important;
47
- }
48
- `),()=>{c.current?.removeAttribute("data-motion-pop-id"),q.contains(N)&&q.removeChild(N)}},[t]),v.jsx(FT,{isPresent:t,childRef:c,sizeRef:d,pop:a,children:a===!1?e:S.cloneElement(e,{ref:m})})}const zT=({children:e,initial:t,isPresent:n,onExitComplete:r,custom:s,presenceAffectsLayout:a,mode:l,anchorX:c,anchorY:d,root:h})=>{const p=Gu(BT),m=S.useId(),y=S.useRef(n),w=S.useRef(r);np(()=>{y.current=n,w.current=r});let k=!0,b=S.useMemo(()=>(k=!1,{id:m,initial:t,isPresent:n,custom:s,onExitComplete:E=>{p.set(E,!0);for(const P of p.values())if(!P)return;r&&r()},register:E=>(p.set(E,!1),()=>{p.delete(E),!y.current&&!p.size&&w.current?.()})}),[n,p,r]);return a&&k&&(b={...b}),S.useMemo(()=>{p.forEach((E,P)=>p.set(P,!1))},[n]),S.useEffect(()=>{!n&&!p.size&&r&&r()},[n]),e=v.jsx(VT,{pop:l==="popLayout",isPresent:n,anchorX:c,anchorY:d,root:h,children:e}),v.jsx(Ku.Provider,{value:b,children:e})};function BT(){return new Map}function N1(e=!0){const t=S.useContext(Ku);if(t===null)return[!0,null];const{isPresent:n,onExitComplete:r,register:s}=t,a=S.useId();S.useEffect(()=>{if(e)return s(a)},[e]);const l=S.useCallback(()=>e&&r&&r(a),[a,r,e]);return!n&&r?[!1,l]:[!0]}const Vl=e=>e.key||"";function t0(e){const t=[];return S.Children.forEach(e,n=>{S.isValidElement(n)&&t.push(n)}),t}const UT=({children:e,custom:t,initial:n=!0,onExitComplete:r,presenceAffectsLayout:s=!0,mode:a="sync",propagate:l=!1,anchorX:c="left",anchorY:d="top",root:h})=>{const[p,m]=N1(l),y=S.useMemo(()=>t0(e),[e]),w=l&&!p?[]:y.map(Vl),k=S.useRef(!0),b=S.useRef(y),E=Gu(()=>new Map),P=S.useRef(new Set),[R,_]=S.useState(y),[j,A]=S.useState(y);np(()=>{k.current=!1,b.current=y;for(let B=0;B<j.length;B++){const D=Vl(j[B]);w.includes(D)?(E.delete(D),P.current.delete(D)):E.get(D)!==!0&&E.set(D,!1)}},[j,w.length,w.join("-")]);const N=[];if(y!==R){let B=[...y];for(let D=0;D<j.length;D++){const I=j[D],U=Vl(I);w.includes(U)||(B.splice(D,0,I),N.push(I))}return a==="wait"&&N.length&&(B=N),A(t0(B)),_(y),null}const{forceRender:q}=S.useContext(tp);return v.jsx(v.Fragment,{children:j.map(B=>{const D=Vl(B),I=l&&!p?!1:y===j||w.includes(D),U=()=>{if(P.current.has(D))return;if(E.has(D))P.current.add(D),E.set(D,!0);else return;let z=!0;E.forEach(he=>{he||(z=!1)}),z&&(q?.(),A(b.current),l&&m?.(),r&&r())};return v.jsx(zT,{isPresent:I,initial:!k.current||n?void 0:!1,custom:t,presenceAffectsLayout:s,mode:a,root:h,onExitComplete:I?void 0:U,anchorX:c,anchorY:d,children:B},D)})})},L1=S.createContext({strict:!1}),n0={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]};let r0=!1;function $T(){if(r0)return;const e={};for(const t in n0)e[t]={isEnabled:n=>n0[t].some(r=>!!n[r])};c1(e),r0=!0}function j1(){return $T(),_P()}function HT(e){const t=j1();for(const n in e)t[n]={...t[n],...e[n]};c1(t)}const WT=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","propagate","ignoreStrict","viewport"]);function Pu(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||WT.has(e)}let D1=e=>!Pu(e);function O1(e){typeof e=="function"&&(D1=t=>t.startsWith("on")?!Pu(t):e(t))}try{O1(require("@emotion/is-prop-valid").default)}catch{}function qT(e,t,n){const r={};for(const s in e)s==="values"&&typeof e.values=="object"||Ht(e[s])||(D1(s)||n===!0&&Pu(s)||!t&&!Pu(s)||e.draggable&&s.startsWith("onDrag"))&&(r[s]=e[s]);return r}function GT({children:e,isValidProp:t,...n}){t&&O1(t);const r=S.useContext(ua);n={...r,...n},n.transition=pp(n.transition,r.transition),n.isStatic=Gu(()=>n.isStatic);const s=S.useMemo(()=>n,[JSON.stringify(n.transition),n.transformPagePoint,n.reducedMotion,n.skipAnimations]);return v.jsx(ua.Provider,{value:s,children:e})}const Zu=S.createContext({});function KT(e,t){if(Ju(e)){const{initial:n,animate:r}=e;return{initial:n===!1||aa(n)?n:void 0,animate:aa(r)?r:void 0}}return e.inherit!==!1?t:{}}function XT(e){const{initial:t,animate:n}=KT(e,S.useContext(Zu));return S.useMemo(()=>({initial:t,animate:n}),[i0(t),i0(n)])}function i0(e){return Array.isArray(e)?e.join(" "):e}const Pp=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function F1(e,t,n){for(const r in t)!Ht(t[r])&&!y1(r,n)&&(e[r]=t[r])}function YT({transformTemplate:e},t){return S.useMemo(()=>{const n=Pp();return Ep(n,t,e),Object.assign({},n.vars,n.style)},[t])}function QT(e,t){const n=e.style||{},r={};return F1(r,n,e),Object.assign(r,YT(e,t)),r}function JT(e,t){const n={},r=QT(e,t);return e.drag&&e.dragListener!==!1&&(n.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout="none",r.touchAction=e.drag===!0?"none":`pan-${e.drag==="x"?"y":"x"}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(n.tabIndex=0),n.style=r,n}const V1=()=>({...Pp(),attrs:{}});function ZT(e,t,n,r){const s=S.useMemo(()=>{const a=V1();return v1(a,t,w1(r),e.transformTemplate,e.style),{...a.attrs,style:{...a.style}}},[t]);if(e.style){const a={};F1(a,e.style,e),s.style={...a,...s.style}}return s}const eR=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function Tp(e){return typeof e!="string"||e.includes("-")?!1:!!(eR.indexOf(e)>-1||/[A-Z]/u.test(e))}function tR(e,t,n,{latestValues:r},s,a=!1,l){const d=(l??Tp(e)?ZT:JT)(t,r,s,e),h=qT(t,typeof e=="string",a),p=e!==S.Fragment?{...h,...d,ref:n}:{},{children:m}=t,y=S.useMemo(()=>Ht(m)?m.get():m,[m]);return S.createElement(e,{...p,children:y})}function nR({scrapeMotionValuesFromProps:e,createRenderState:t},n,r,s){return{latestValues:rR(n,r,s,e),renderState:t()}}function rR(e,t,n,r){const s={},a=r(e,{});for(const y in a)s[y]=lu(a[y]);let{initial:l,animate:c}=e;const d=Ju(e),h=l1(e);t&&h&&!d&&e.inherit!==!1&&(l===void 0&&(l=t.initial),c===void 0&&(c=t.animate));let p=n?n.initial===!1:!1;p=p||l===!1;const m=p?c:l;if(m&&typeof m!="boolean"&&!Qu(m)){const y=Array.isArray(m)?m:[m];for(let w=0;w<y.length;w++){const k=yp(e,y[w]);if(k){const{transitionEnd:b,transition:E,...P}=k;for(const R in P){let _=P[R];if(Array.isArray(_)){const j=p?_.length-1:0;_=_[j]}_!==null&&(s[R]=_)}for(const R in b)s[R]=b[R]}}}return s}const z1=e=>(t,n)=>{const r=S.useContext(Zu),s=S.useContext(Ku),a=()=>nR(e,t,r,s);return n?a():Gu(a)},iR=z1({scrapeMotionValuesFromProps:_p,createRenderState:Pp}),sR=z1({scrapeMotionValuesFromProps:S1,createRenderState:V1}),oR=Symbol.for("motionComponentSymbol");function aR(e,t,n){const r=S.useRef(n);S.useInsertionEffect(()=>{r.current=n});const s=S.useRef(null);return S.useCallback(a=>{a&&e.onMount?.(a),t&&(a?t.mount(a):t.unmount());const l=r.current;if(typeof l=="function")if(a){const c=l(a);typeof c=="function"&&(s.current=c)}else s.current?(s.current(),s.current=null):l(a);else l&&(l.current=a)},[t])}const B1=S.createContext({});function As(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function lR(e,t,n,r,s,a){const{visualElement:l}=S.useContext(Zu),c=S.useContext(L1),d=S.useContext(Ku),h=S.useContext(ua),p=h.reducedMotion,m=h.skipAnimations,y=S.useRef(null),w=S.useRef(!1);r=r||c.renderer,!y.current&&r&&(y.current=r(e,{visualState:t,parent:l,props:n,presenceContext:d,blockInitialAnimation:d?d.initial===!1:!1,reducedMotionConfig:p,skipAnimations:m,isSVG:a}),w.current&&y.current&&(y.current.manuallyAnimateOnMount=!0));const k=y.current,b=S.useContext(B1);k&&!k.projection&&s&&(k.type==="html"||k.type==="svg")&&uR(y.current,n,s,b);const E=S.useRef(!1);S.useInsertionEffect(()=>{k&&E.current&&k.update(n,d)});const P=n[Yw],R=S.useRef(!!P&&typeof window<"u"&&!window.MotionHandoffIsComplete?.(P)&&window.MotionHasOptimisedAnimation?.(P));return np(()=>{w.current=!0,k&&(E.current=!0,window.MotionIsMounted=!0,k.updateFeatures(),k.scheduleRenderMicrotask(),R.current&&k.animationState&&k.animationState.animateChanges())}),S.useEffect(()=>{k&&(!R.current&&k.animationState&&k.animationState.animateChanges(),R.current&&(queueMicrotask(()=>{window.MotionHandoffMarkAsComplete?.(P)}),R.current=!1),k.enteringChildren=void 0)}),k}function uR(e,t,n,r){const{layoutId:s,layout:a,drag:l,dragConstraints:c,layoutScroll:d,layoutRoot:h,layoutAnchor:p,layoutCrossfade:m}=t;e.projection=new n(e.latestValues,t["data-framer-portal-id"]?void 0:U1(e.parent)),e.projection.setOptions({layoutId:s,layout:a,alwaysMeasureLayout:!!l||c&&As(c),visualElement:e,animationType:typeof a=="string"?a:"both",initialPromotionConfig:r,crossfade:m,layoutScroll:d,layoutRoot:h,layoutAnchor:p})}function U1(e){if(e)return e.options.allowProjection!==!1?e.projection:U1(e.parent)}function sf(e,{forwardMotionProps:t=!1,type:n}={},r,s){r&&HT(r);const a=n?n==="svg":Tp(e),l=a?sR:iR;function c(h,p){let m;const y={...S.useContext(ua),...h,layoutId:cR(h)},{isStatic:w}=y,k=XT(h),b=l(h,w);if(!w&&typeof window<"u"){dR();const E=fR(y);m=E.MeasureLayout,k.visualElement=lR(e,b,y,s,E.ProjectionNode,a)}return v.jsxs(Zu.Provider,{value:k,children:[m&&k.visualElement?v.jsx(m,{visualElement:k.visualElement,...y}):null,tR(e,h,aR(b,k.visualElement,p),b,w,t,a)]})}c.displayName=`motion.${typeof e=="string"?e:`create(${e.displayName??e.name??""})`}`;const d=S.forwardRef(c);return d[oR]=e,d}function cR({layoutId:e}){const t=S.useContext(tp).id;return t&&e!==void 0?t+"-"+e:e}function dR(e,t){S.useContext(L1).strict}function fR(e){const t=j1(),{drag:n,layout:r}=t;if(!n&&!r)return{};const s={...n,...r};return{MeasureLayout:n?.isEnabled(e)||r?.isEnabled(e)?s.MeasureLayout:void 0,ProjectionNode:s.ProjectionNode}}function hR(e,t){if(typeof Proxy>"u")return sf;const n=new Map,r=(a,l)=>sf(a,l,e,t),s=(a,l)=>r(a,l);return new Proxy(s,{get:(a,l)=>l==="create"?r:(n.has(l)||n.set(l,sf(l,void 0,e,t)),n.get(l))})}const pR=(e,t)=>t.isSVG??Tp(e)?new $P(t):new OP(t,{allowProjection:e!==S.Fragment});class mR extends pi{constructor(t){super(t),t.animationState||(t.animationState=KP(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();Qu(t)&&(this.unmountControls=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:n}=this.node.prevProps||{};t!==n&&this.updateAnimationControlsSubscription()}unmount(){this.node.animationState.reset(),this.unmountControls?.()}}let gR=0;class yR extends pi{constructor(){super(...arguments),this.id=gR++,this.isExitComplete=!1}update(){if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:n}=this.node.presenceContext,{isPresent:r}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===r)return;if(t&&r===!1){if(this.isExitComplete){const{initial:a,custom:l}=this.node.getProps();if(typeof a=="string"||typeof a=="object"&&a!==null&&!Array.isArray(a)){const c=$i(this.node,a,l);if(c){const{transition:d,transitionEnd:h,...p}=c;for(const m in p)this.node.getValue(m)?.jump(p[m])}}this.node.animationState.reset(),this.node.animationState.animateChanges()}else this.node.animationState.setActive("exit",!1);this.isExitComplete=!1;return}const s=this.node.animationState.setActive("exit",!t);n&&!t&&s.then(()=>{this.isExitComplete=!0,n(this.id)})}mount(){const{register:t,onExitComplete:n}=this.node.presenceContext||{};n&&n(this.id),t&&(this.unmount=t(this.id))}unmount(){}}const vR={animation:{Feature:mR},exit:{Feature:yR}};function Sa(e){return{point:{x:e.pageX,y:e.pageY}}}const xR=e=>t=>Sp(t)&&e(t,Sa(t));function Yo(e,t,n,r){return la(e,t,xR(n),r)}const $1=({current:e})=>e?e.ownerDocument.defaultView:null,s0=(e,t)=>Math.abs(e-t);function wR(e,t){const n=s0(e.x,t.x),r=s0(e.y,t.y);return Math.sqrt(n**2+r**2)}const o0=new Set(["auto","scroll"]);class H1{constructor(t,n,{transformPagePoint:r,contextWindow:s=window,dragSnapToOrigin:a=!1,distanceThreshold:l=3,element:c}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.lastRawMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.scrollPositions=new Map,this.removeScrollListeners=null,this.onElementScroll=k=>{this.handleScroll(k.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;this.lastRawMoveEventInfo&&(this.lastMoveEventInfo=zl(this.lastRawMoveEventInfo,this.transformPagePoint));const k=of(this.lastMoveEventInfo,this.history),b=this.startEvent!==null,E=wR(k.offset,{x:0,y:0})>=this.distanceThreshold;if(!b&&!E)return;const{point:P}=k,{timestamp:R}=$t;this.history.push({...P,timestamp:R});const{onStart:_,onMove:j}=this.handlers;b||(_&&_(this.lastMoveEvent,k),this.startEvent=this.lastMoveEvent),j&&j(this.lastMoveEvent,k)},this.handlePointerMove=(k,b)=>{this.lastMoveEvent=k,this.lastRawMoveEventInfo=b,this.lastMoveEventInfo=zl(b,this.transformPagePoint),rt.update(this.updatePoint,!0)},this.handlePointerUp=(k,b)=>{this.end();const{onEnd:E,onSessionEnd:P,resumeAnimation:R}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&R&&R(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const _=of(k.type==="pointercancel"?this.lastMoveEventInfo:zl(b,this.transformPagePoint),this.history);this.startEvent&&E&&E(k,_),P&&P(k,_)},!Sp(t))return;this.dragSnapToOrigin=a,this.handlers=n,this.transformPagePoint=r,this.distanceThreshold=l,this.contextWindow=s||window;const d=Sa(t),h=zl(d,this.transformPagePoint),{point:p}=h,{timestamp:m}=$t;this.history=[{...p,timestamp:m}];const{onSessionStart:y}=n;y&&y(t,of(h,this.history));const w={passive:!0,capture:!0};this.removeListeners=va(Yo(this.contextWindow,"pointermove",this.handlePointerMove,w),Yo(this.contextWindow,"pointerup",this.handlePointerUp,w),Yo(this.contextWindow,"pointercancel",this.handlePointerUp,w)),c&&this.startScrollTracking(c)}startScrollTracking(t){let n=t.parentElement;for(;n;){const r=getComputedStyle(n);(o0.has(r.overflowX)||o0.has(r.overflowY))&&this.scrollPositions.set(n,{x:n.scrollLeft,y:n.scrollTop}),n=n.parentElement}this.scrollPositions.set(window,{x:window.scrollX,y:window.scrollY}),window.addEventListener("scroll",this.onElementScroll,{capture:!0}),window.addEventListener("scroll",this.onWindowScroll),this.removeScrollListeners=()=>{window.removeEventListener("scroll",this.onElementScroll,{capture:!0}),window.removeEventListener("scroll",this.onWindowScroll)}}handleScroll(t){const n=this.scrollPositions.get(t);if(!n)return;const r=t===window,s=r?{x:window.scrollX,y:window.scrollY}:{x:t.scrollLeft,y:t.scrollTop},a={x:s.x-n.x,y:s.y-n.y};a.x===0&&a.y===0||(r?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=a.x,this.lastMoveEventInfo.point.y+=a.y):this.history.length>0&&(this.history[0].x-=a.x,this.history[0].y-=a.y),this.scrollPositions.set(t,s),rt.update(this.updatePoint,!0))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),di(this.updatePoint)}}function zl(e,t){return t?{point:t(e.point)}:e}function a0(e,t){return{x:e.x-t.x,y:e.y-t.y}}function of({point:e},t){return{point:e,delta:a0(e,W1(t)),offset:a0(e,SR(t)),velocity:kR(t,.1)}}function SR(e){return e[0]}function W1(e){return e[e.length-1]}function kR(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null;const s=W1(e);for(;n>=0&&(r=e[n],!(s.timestamp-r.timestamp>_n(t)));)n--;if(!r)return{x:0,y:0};r===e[0]&&e.length>2&&s.timestamp-r.timestamp>_n(t)*2&&(r=e[1]);const a=Fn(s.timestamp-r.timestamp);if(a===0)return{x:0,y:0};const l={x:(s.x-r.x)/a,y:(s.y-r.y)/a};return l.x===1/0&&(l.x=0),l.y===1/0&&(l.y=0),l}function CR(e,{min:t,max:n},r){return t!==void 0&&e<t?e=r?nt(t,e,r.min):Math.max(e,t):n!==void 0&&e>n&&(e=r?nt(n,e,r.max):Math.min(e,n)),e}function l0(e,t,n){return{min:t!==void 0?e.min+t:void 0,max:n!==void 0?e.max+n-(e.max-e.min):void 0}}function bR(e,{top:t,left:n,bottom:r,right:s}){return{x:l0(e.x,n,s),y:l0(e.y,t,r)}}function u0(e,t){let n=t.min-e.min,r=t.max-e.max;return t.max-t.min<e.max-e.min&&([n,r]=[r,n]),{min:n,max:r}}function ER(e,t){return{x:u0(e.x,t.x),y:u0(e.y,t.y)}}function _R(e,t){let n=.5;const r=ln(e),s=ln(t);return s>r?n=sa(t.min,t.max-r,e.min):r>s&&(n=sa(e.min,e.max-s,t.min)),mr(0,1,n)}function PR(e,t){const n={};return t.min!==void 0&&(n.min=t.min-e.min),t.max!==void 0&&(n.max=t.max-e.min),n}const hh=.35;function TR(e=hh){return e===!1?e=0:e===!0&&(e=hh),{x:c0(e,"left","right"),y:c0(e,"top","bottom")}}function c0(e,t,n){return{min:d0(e,t),max:d0(e,n)}}function d0(e,t){return typeof e=="number"?e:e[t]||0}const RR=new WeakMap;class AR{constructor(t){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=Mt(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=t}start(t,{snapToCursor:n=!1,distanceThreshold:r}={}){const{presenceContext:s}=this.visualElement;if(s&&s.isPresent===!1)return;const a=m=>{n&&this.snapToCursor(Sa(m).point),this.stopAnimation()},l=(m,y)=>{const{drag:w,dragPropagation:k,onDragStart:b}=this.getProps();if(w&&!k&&(this.openDragLock&&this.openDragLock(),this.openDragLock=nP(w),!this.openDragLock))return;this.latestPointerEvent=m,this.latestPanInfo=y,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),cr(P=>{let R=this.getAxisMotionValue(P).get()||0;if(pr.test(R)){const{projection:_}=this.visualElement;if(_&&_.layout){const j=_.layout.layoutBox[P];j&&(R=ln(j)*(parseFloat(R)/100))}}this.originPoint[P]=R}),b&&rt.update(()=>b(m,y),!1,!0),rh(this.visualElement,"transform");const{animationState:E}=this.visualElement;E&&E.setActive("whileDrag",!0)},c=(m,y)=>{this.latestPointerEvent=m,this.latestPanInfo=y;const{dragPropagation:w,dragDirectionLock:k,onDirectionLock:b,onDrag:E}=this.getProps();if(!w&&!this.openDragLock)return;const{offset:P}=y;if(k&&this.currentDirection===null){this.currentDirection=MR(P),this.currentDirection!==null&&b&&b(this.currentDirection);return}this.updateAxis("x",y.point,P),this.updateAxis("y",y.point,P),this.visualElement.render(),E&&rt.update(()=>E(m,y),!1,!0)},d=(m,y)=>{this.latestPointerEvent=m,this.latestPanInfo=y,this.stop(m,y),this.latestPointerEvent=null,this.latestPanInfo=null},h=()=>{const{dragSnapToOrigin:m}=this.getProps();(m||this.constraints)&&this.startAnimation({x:0,y:0})},{dragSnapToOrigin:p}=this.getProps();this.panSession=new H1(t,{onSessionStart:a,onStart:l,onMove:c,onSessionEnd:d,resumeAnimation:h},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:p,distanceThreshold:r,contextWindow:$1(this.visualElement),element:this.visualElement.current})}stop(t,n){const r=t||this.latestPointerEvent,s=n||this.latestPanInfo,a=this.isDragging;if(this.cancel(),!a||!s||!r)return;const{velocity:l}=s;this.startAnimation(l);const{onDragEnd:c}=this.getProps();c&&rt.postRender(()=>c(r,s))}cancel(){this.isDragging=!1;const{projection:t,animationState:n}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.endPanSession();const{dragPropagation:r}=this.getProps();!r&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),n&&n.setActive("whileDrag",!1)}endPanSession(){this.panSession&&this.panSession.end(),this.panSession=void 0}updateAxis(t,n,r){const{drag:s}=this.getProps();if(!r||!Bl(t,s,this.currentDirection))return;const a=this.getAxisMotionValue(t);let l=this.originPoint[t]+r[t];this.constraints&&this.constraints[t]&&(l=CR(l,this.constraints[t],this.elastic[t])),a.set(l)}resolveConstraints(){const{dragConstraints:t,dragElastic:n}=this.getProps(),r=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):this.visualElement.projection?.layout,s=this.constraints;t&&As(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):t&&r?this.constraints=bR(r.layoutBox,t):this.constraints=!1,this.elastic=TR(n),s!==this.constraints&&!As(t)&&r&&this.constraints&&!this.hasMutatedConstraints&&cr(a=>{this.constraints!==!1&&this.getAxisMotionValue(a)&&(this.constraints[a]=PR(r.layoutBox[a],this.constraints[a]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!As(t))return!1;const r=t.current,{projection:s}=this.visualElement;if(!s||!s.layout)return!1;s.root&&(s.root.scroll=void 0,s.root.updateScroll());const a=IP(r,s.root,this.visualElement.getTransformPagePoint());let l=ER(s.layout.layoutBox,a);if(n){const c=n(TP(l));this.hasMutatedConstraints=!!c,c&&(l=f1(c))}return l}startAnimation(t){const{drag:n,dragMomentum:r,dragElastic:s,dragTransition:a,dragSnapToOrigin:l,onDragTransitionEnd:c}=this.getProps(),d=this.constraints||{},h=cr(p=>{if(!Bl(p,n,this.currentDirection))return;let m=d&&d[p]||{};(l===!0||l===p)&&(m={min:0,max:0});const y=s?200:1e6,w=s?40:1e7,k={type:"inertia",velocity:r?t[p]:0,bounceStiffness:y,bounceDamping:w,timeConstant:750,restDelta:1,restSpeed:10,...a,...m};return this.startAxisValueAnimation(p,k)});return Promise.all(h).then(c)}startAxisValueAnimation(t,n){const r=this.getAxisMotionValue(t);return rh(this.visualElement,t),r.start(gp(t,r,0,n,this.visualElement,!1))}stopAnimation(){cr(t=>this.getAxisMotionValue(t).stop())}getAxisMotionValue(t){const n=`_drag${t.toUpperCase()}`,s=this.visualElement.getProps()[n];return s||this.visualElement.getValue(t,this.visualElement.latestValues[t]??0)}snapToCursor(t){cr(n=>{const{drag:r}=this.getProps();if(!Bl(n,r,this.currentDirection))return;const{projection:s}=this.visualElement,a=this.getAxisMotionValue(n);if(s&&s.layout){const{min:l,max:c}=s.layout.layoutBox[n],d=a.get()||0;a.set(t[n]-nt(l,c,.5)+d)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:n}=this.getProps(),{projection:r}=this.visualElement;if(!As(n)||!r||!this.constraints)return;this.stopAnimation();const s={x:0,y:0};cr(l=>{const c=this.getAxisMotionValue(l);if(c&&this.constraints!==!1){const d=c.get();s[l]=_R({min:d,max:d},this.constraints[l])}});const{transformTemplate:a}=this.visualElement.getProps();this.visualElement.current.style.transform=a?a({},""):"none",r.root&&r.root.updateScroll(),r.updateLayout(),this.constraints=!1,this.resolveConstraints(),cr(l=>{if(!Bl(l,t,null))return;const c=this.getAxisMotionValue(l),{min:d,max:h}=this.constraints[l];c.set(nt(d,h,s[l]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;RR.set(this.visualElement,this);const t=this.visualElement.current,n=Yo(t,"pointerdown",h=>{const{drag:p,dragListener:m=!0}=this.getProps(),y=h.target,w=y!==t&&lP(y);p&&m&&!w&&this.start(h)});let r;const s=()=>{const{dragConstraints:h}=this.getProps();As(h)&&h.current&&(this.constraints=this.resolveRefConstraints(),r||(r=IR(t,h.current,()=>this.scalePositionWithinConstraints())))},{projection:a}=this.visualElement,l=a.addEventListener("measure",s);a&&!a.layout&&(a.root&&a.root.updateScroll(),a.updateLayout()),rt.read(s);const c=la(window,"resize",()=>this.scalePositionWithinConstraints()),d=a.addEventListener("didUpdate",(({delta:h,hasLayoutChanged:p})=>{this.isDragging&&p&&(cr(m=>{const y=this.getAxisMotionValue(m);y&&(this.originPoint[m]+=h[m].translate,y.set(y.get()+h[m].translate))}),this.visualElement.render())}));return()=>{c(),n(),l(),d&&d(),r&&r()}}getProps(){const t=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:r=!1,dragPropagation:s=!1,dragConstraints:a=!1,dragElastic:l=hh,dragMomentum:c=!0}=t;return{...t,drag:n,dragDirectionLock:r,dragPropagation:s,dragConstraints:a,dragElastic:l,dragMomentum:c}}}function f0(e){let t=!0;return()=>{if(t){t=!1;return}e()}}function IR(e,t,n){const r=xv(e,f0(n)),s=xv(t,f0(n));return()=>{r(),s()}}function Bl(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function MR(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}class NR extends pi{constructor(t){super(t),this.removeGroupControls=Vn,this.removeListeners=Vn,this.controls=new AR(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||Vn}update(){const{dragControls:t}=this.node.getProps(),{dragControls:n}=this.node.prevProps||{};t!==n&&(this.removeGroupControls(),t&&(this.removeGroupControls=t.subscribe(this.controls)))}unmount(){this.removeGroupControls(),this.removeListeners(),this.controls.isDragging||this.controls.endPanSession()}}const af=e=>(t,n)=>{e&&rt.update(()=>e(t,n),!1,!0)};class LR extends pi{constructor(){super(...arguments),this.removePointerDownListener=Vn}onPointerDown(t){this.session=new H1(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:$1(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:n,onPan:r,onPanEnd:s}=this.node.getProps();return{onSessionStart:af(t),onStart:af(n),onMove:af(r),onEnd:(a,l)=>{delete this.session,s&&rt.postRender(()=>s(a,l))}}}mount(){this.removePointerDownListener=Yo(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}let lf=!1;class jR extends S.Component{componentDidMount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r,layoutId:s}=this.props,{projection:a}=t;a&&(n.group&&n.group.add(a),r&&r.register&&s&&r.register(a),lf&&a.root.didUpdate(),a.addEventListener("animationComplete",()=>{this.safeToRemove()}),a.setOptions({...a.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),uu.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:n,visualElement:r,drag:s,isPresent:a}=this.props,{projection:l}=r;return l&&(l.isPresent=a,t.layoutDependency!==n&&l.setOptions({...l.options,layoutDependency:n}),lf=!0,s||t.layoutDependency!==n||n===void 0||t.isPresent!==a?l.willUpdate():this.safeToRemove(),t.isPresent!==a&&(a?l.promote():l.relegate()||rt.postRender(()=>{const c=l.getStack();(!c||!c.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{visualElement:t,layoutAnchor:n}=this.props,{projection:r}=t;r&&(r.options.layoutAnchor=n,r.root.didUpdate(),wp.postRender(()=>{!r.currentAnimation&&r.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r}=this.props,{projection:s}=t;lf=!0,s&&(s.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(s),r&&r.deregister&&r.deregister(s))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function q1(e){const[t,n]=N1(),r=S.useContext(tp);return v.jsx(jR,{...e,layoutGroup:r,switchLayoutGroup:S.useContext(B1),isPresent:t,safeToRemove:n})}const DR={pan:{Feature:LR},drag:{Feature:NR,ProjectionNode:M1,MeasureLayout:q1}};function h0(e,t,n){const{props:r}=e;e.animationState&&r.whileHover&&e.animationState.setActive("whileHover",n==="Start");const s="onHover"+n,a=r[s];a&&rt.postRender(()=>a(t,Sa(t)))}class OR extends pi{mount(){const{current:t}=this.node;t&&(this.unmount=iP(t,(n,r)=>(h0(this.node,r,"Start"),s=>h0(this.node,s,"End"))))}unmount(){}}class FR extends pi{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch{t=!0}!t||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=va(la(this.node.current,"focus",()=>this.onFocus()),la(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function p0(e,t,n){const{props:r}=e;if(e.current instanceof HTMLButtonElement&&e.current.disabled)return;e.animationState&&r.whileTap&&e.animationState.setActive("whileTap",n==="Start");const s="onTap"+(n==="End"?"":n),a=r[s];a&&rt.postRender(()=>a(t,Sa(t)))}class VR extends pi{mount(){const{current:t}=this.node;if(!t)return;const{globalTapTarget:n,propagate:r}=this.node.props;this.unmount=cP(t,(s,a)=>(p0(this.node,a,"Start"),(l,{success:c})=>p0(this.node,l,c?"End":"Cancel")),{useGlobalTarget:n,stopPropagation:r?.tap===!1})}unmount(){}}const ph=new WeakMap,uf=new WeakMap,zR=e=>{const t=ph.get(e.target);t&&t(e)},BR=e=>{e.forEach(zR)};function UR({root:e,...t}){const n=e||document;uf.has(n)||uf.set(n,{});const r=uf.get(n),s=JSON.stringify(t);return r[s]||(r[s]=new IntersectionObserver(BR,{root:e,...t})),r[s]}function $R(e,t,n){const r=UR(t);return ph.set(e,n),r.observe(e),()=>{ph.delete(e),r.unobserve(e)}}const HR={some:0,all:1};class WR extends pi{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.stopObserver?.();const{viewport:t={}}=this.node.getProps(),{root:n,margin:r,amount:s="some",once:a}=t,l={root:n?n.current:void 0,rootMargin:r,threshold:typeof s=="number"?s:HR[s]},c=d=>{const{isIntersecting:h}=d;if(this.isInView===h||(this.isInView=h,a&&!h&&this.hasEnteredView))return;h&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",h);const{onViewportEnter:p,onViewportLeave:m}=this.node.getProps(),y=h?p:m;y&&y(d)};this.stopObserver=$R(this.node.current,l,c)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:n}=this.node;["amount","margin","root"].some(qR(t,n))&&this.startObserver()}unmount(){this.stopObserver?.(),this.hasEnteredView=!1,this.isInView=!1}}function qR({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const GR={inView:{Feature:WR},tap:{Feature:VR},focus:{Feature:FR},hover:{Feature:OR}},KR={layout:{ProjectionNode:M1,MeasureLayout:q1}},XR={...vR,...GR,...DR,...KR},Ds=hR(XR,pR);function Rp(){return typeof document>"u"?"/":document.querySelector('meta[name="ours-base-path"]')?.content??"/"}function gr(e){return Rp()+e.replace(/^\//,"")}function YR(e){const t=Rp();return e.startsWith(t)?"/"+e.slice(t.length):e}class Tu extends Error{constructor(t,n){super(n),this.status=t}}function QR(e){let t="";for(let r=0;r<e.length;r+=32768)t+=String.fromCharCode(...e.subarray(r,r+32768));return btoa(t)}function JR(e=globalThis.fetch.bind(globalThis)){async function t(n,r){const s=(r?.method??"GET").toUpperCase(),a=s!=="GET"&&s!=="HEAD",l=await e(gr(n),{...r,cache:"no-store",credentials:"same-origin",headers:a?{"content-type":"application/json","X-Ours-Messenger-CSRF":"1",...r?.headers}:r?.headers}),c=await l.text();let d=null;if(c)try{d=JSON.parse(c)}catch{throw new Tu(l.status,l.ok?"Server returned an invalid response":`HTTP ${l.status}`)}if(!l.ok){const h=d&&typeof d=="object"&&"error"in d&&d.error&&typeof d.error=="object"&&"message"in d.error&&typeof d.error.message=="string"?d.error.message:`HTTP ${l.status}`;throw new Tu(l.status,h)}return d}return{identity:()=>t("/api/identity"),setBio:n=>t("/api/identity/bio",{method:"POST",body:JSON.stringify({bio:n})}),buildInfo:()=>t("/api/build-info"),identities:()=>t("/api/identities"),contacts:()=>t("/api/contacts"),invites:()=>t("/api/invites"),conversation:(n,r,s)=>t(`/api/conversations/${encodeURIComponent(n)}/page?limit=50${r?`&before=${encodeURIComponent(r)}`:""}`,{signal:s}),markRead:n=>t(`/api/conversations/${encodeURIComponent(n)}/read`,{method:"POST"}),send:(n,r,s,a)=>t("/api/messages/send",{method:"POST",signal:a,body:JSON.stringify({contact:n,text:r,...s?{reply_to_wire_id:s}:{}})}),commands:(n,r)=>t(`/api/contacts/${encodeURIComponent(n)}/commands`,{signal:r}),sendCommand:(n,r,s,a,l,c)=>t("/api/commands/send",{method:"POST",signal:c,body:JSON.stringify({contact:n,recipient_cid:n,command:r,arguments:s,invocation_id:a,catalog_fingerprint:l,confirmed:!0})}),sendFile:async(n,r,s,a,l)=>t("/api/messages/send-file",{method:"POST",body:JSON.stringify({contact:n,data_base64:QR(new Uint8Array(await r.arrayBuffer())),filename:s,mime:a,...l?{reply_to_wire_id:l}:{}})}),files:n=>t(`/api/conversations/${encodeURIComponent(n)}/files`),fetchFiles:n=>t("/api/files/fetch",{method:"POST",body:JSON.stringify({wire_ids:n})}),mediaUrl:n=>gr(`/api/media/${encodeURIComponent(n)}`),createInvite:(n="one_time",r)=>t("/api/invites",{method:"POST",body:JSON.stringify({mode:n,...r?{name:r}:{}})}),addContact:(n,r)=>t("/api/contacts/add",{method:"POST",body:JSON.stringify({invite:n,...r?{name:r}:{}})}),renameContact:(n,r)=>t("/api/contacts/rename",{method:"POST",body:JSON.stringify({contact:n,name:r})}),removeContact:n=>t("/api/contacts/remove",{method:"POST",body:JSON.stringify({contact:n})}),revokeInvite:n=>t("/api/invites/revoke",{method:"POST",body:JSON.stringify({invite_id:n})}),respondToIntroduction:(n,r)=>t("/api/contacts/introductions",{method:"POST",body:JSON.stringify({contact:n,action:r})}),vapidPublicKey:()=>t("/api/push/vapid-public-key"),ensurePush:n=>t("/api/push/subscriptions/ensure",{method:"POST",body:JSON.stringify(n)}),deletePush:n=>t("/api/push/subscriptions/delete",{method:"POST",body:JSON.stringify({binding_id:n})})}}const Xe=JR(),mh="ours-messenger-live-event";function G1(e){window.dispatchEvent(new CustomEvent(mh,{detail:e}))}function ZR(e){const t=n=>{const r=n.detail;r?.v===1&&e(r)};return window.addEventListener(mh,t),()=>window.removeEventListener(mh,t)}function eA(e,t){const n=new EventSource(gr("/api/events"));let r=!1;t("connecting"),n.onopen=()=>{r=!0,t("live")},n.onerror=()=>t(r?"retrying":"connecting");const s=a=>{n.addEventListener(a,l=>{try{const c=JSON.parse(l.data);c&&c.v===1&&e({...c,type:a})}catch{}})};return s("sync_required"),s("message_received"),s("receipt_received"),s("file_received"),()=>n.close()}function tA(e=window.location){return`${e.protocol==="https:"?"wss:":"ws:"}//${e.host}${gr("/api/presence")}`}function nA(e){if(!e||typeof e!="object"||Array.isArray(e))return null;const t=e;if(t.type!=="event"||!t.event||typeof t.event!="object")return null;const n=t.event;return n.v===1?n:null}function rA(e){let t=!1,n=null,r,s=1e3,a=0;const l=()=>{r!==void 0&&clearTimeout(r),r=void 0;const p=n;n=null,p&&p.readyState<WebSocket.CLOSING&&p.close(1e3,"hidden")},c=()=>{if(t||document.visibilityState!=="visible")return;e.onState?.("retrying");const p=s;s=Math.min(3e4,s*2),r=setTimeout(()=>{r=void 0,d()},p)},d=async()=>{if(l(),t||document.visibilityState!=="visible")return;const p=++a;e.onState?.("connecting");try{const[m,y]=await Promise.all([e.identity(),e.registration.pushManager.getSubscription()]);if(t||p!==a||document.visibilityState!=="visible")return;const w=y?.toJSON(),k=y?.endpoint,b=w?.keys?.auth;if(!k||!b)return;const E=new WebSocket(tA());n=E,E.onopen=()=>E.send(JSON.stringify({identity:m.cid,endpoint:k,auth:b})),E.onmessage=P=>{let R;try{R=JSON.parse(String(P.data))}catch{return}if(R?.ok===!0){s=1e3,e.onState?.("live");return}const _=nA(R);_&&e.onEvent(_)},E.onclose=()=>{n===E&&(n=null),p===a&&c()},E.onerror=()=>E.close()}catch{p===a&&c()}},h=()=>{a++,document.visibilityState==="visible"?(s=1e3,d()):l()};return document.addEventListener("visibilitychange",h),window.addEventListener("pagehide",l),d(),()=>{t=!0,a++,document.removeEventListener("visibilitychange",h),window.removeEventListener("pagehide",l),l()}}function iA(e,t){return t.visibility==="visible"&&t.appRoute==="chats"&&t.selectedContactCid===e&&(t.desktopLayout||t.mobileDetailOpen)&&!t.conversationCoveringDialogOpen}class sA{#e=new Map;request(t,n){let r=this.#e.get(t);return r?.running?(r.rerun=!0,r.running):(r??={running:null,rerun:!1},this.#e.set(t,r),r.running=(async()=>{do r.rerun=!1,await n();while(r.rerun)})().finally(()=>{r.running=null,r.rerun||this.#e.delete(t)}),r.running)}}function cf(e){if(e=YR(e),e==="/"||e==="/chats"||e==="/chats/")return{name:"chats",contactCid:null};const t=/^\/chats\/([^/]+)\/contact\/?$/.exec(e);if(t)try{const r=decodeURIComponent(t[1]);if(r)return{name:"contact",contactCid:r}}catch{}const n=/^\/chats\/([^/]+)\/?$/.exec(e);if(n)try{const r=decodeURIComponent(n[1]);if(r)return{name:"chats",contactCid:r}}catch{}return{name:"not_found",pathname:e}}function ri(e){return gr(e?`/chats/${encodeURIComponent(e)}`:"/chats")}function oA(e){return gr(`/chats/${encodeURIComponent(e)}/contact`)}function aA(e){return typeof e=="object"&&e!==null&&e.oursMessenger===!0?"back":"replace"}const m0={read:2,delivered:1};function g0(e){return e&&Object.hasOwn(m0,e)?m0[e]:0}function gh(e,t){return g0(t)>g0(e)?t:e}const lA=()=>({contacts:[],pending:[]});function uA(e){return{identity:null,contacts:lA(),route:e,pages:{},pendingSends:{},drafts:{},replies:{},connection:"connecting",search:"",mobileDetailOpen:e.name==="chats"&&e.contactCid!==null||e.name==="contact",coveringDialog:!1,dialogBusy:!1,generatedInvite:null,sendingDialog:null,error:null,loaded:!1}}function Mi(e,t){return`${e}:${t}`}function lr(e){return e.route.name==="chats"||e.route.name==="contact"?e.route.contactCid:null}function ur(e,t){return e.identity?e.pages[Mi(e.identity.cid,t)]??null:null}function cA(e,t){const n=gh(e.receipt,t.receipt);return n===t.receipt?t:{...t,receipt:n}}function ks(e,t){const n=[...e],r=new Map;n.forEach((s,a)=>{s.wire_id&&r.set(s.wire_id,a)});for(const s of t){const a=s.wire_id?r.get(s.wire_id):void 0;a===void 0?(s.wire_id&&r.set(s.wire_id,n.length),n.push(s)):n[a]=cA(n[a],s)}return n}function y0(e,t){const n=lr(e);return!n||t.contacts.some(r=>r.container_id===n)?{}:{route:{name:"chats",contactCid:null},mobileDetailOpen:!1}}function v0(e,t){switch(t.type){case"snapshot":{const n=e.identity!==null&&e.identity.cid!==t.identity.cid;return{...e,identity:t.identity,contacts:t.contacts,loaded:!0,error:null,...n?{pages:{},pendingSends:{},drafts:{},replies:{},sendingDialog:null,generatedInvite:null,coveringDialog:!1,dialogBusy:!1}:{},...y0(e,t.contacts)}}case"contacts":return{...e,contacts:t.contacts,...y0(e,t.contacts)};case"page":{if(!e.identity)return e;const n=Mi(e.identity.cid,t.contactCid),r=e.pages[n],s=e.pendingSends[n]??[],a=new Set(t.page.messages.map(y=>y.wire_id)),l=s.filter(y=>!a.has(y.wire_id)),c=new Map(r?.messages.map(y=>[y.wire_id,y.receipt])??[]),d=r?t.page.messages.map(y=>{const w=gh(c.get(y.wire_id)??null,y.receipt);return w===y.receipt?y:{...y,receipt:w}}):t.page.messages,h=r&&r.messages.length>50?{...t.page,messages:ks(r.messages,d),hasMore:r.hasMore,nextBefore:r.nextBefore}:{...t.page,messages:d},p=ks(h.messages,l),m={...h,messages:p,total:Math.max(h.total+l.length,p.length)};return{...e,pages:{...e.pages,[n]:m},pendingSends:{...e.pendingSends,[n]:l.length?l:void 0}}}case"sent_message":{if(!e.identity)return e;const n=Mi(e.identity.cid,t.contactCid),r=e.pages[n];if(r?.messages.some(l=>l.wire_id===t.message.wire_id))return e;const s=ks(e.pendingSends[n]??[],[t.message]);if(!r)return{...e,pendingSends:{...e.pendingSends,[n]:s}};const a=ks(r.messages,[t.message]);return{...e,pages:{...e.pages,[n]:{...r,messages:a,total:Math.max(r.total+1,a.length)}},pendingSends:{...e.pendingSends,[n]:s}}}case"receipt":{if(!e.identity)return e;const n=Mi(e.identity.cid,t.contactCid),r=e.pages[n],s=e.pendingSends[n],a=new Set(t.wireIds),l=h=>{let p=!1;const m=h.map(y=>{if(!y.wire_id||!a.has(y.wire_id))return y;const w=gh(y.receipt,t.kind);return w===y.receipt?y:(p=!0,{...y,receipt:w})});return p?m:h},c=r?l(r.messages):void 0,d=s?l(s):void 0;return c===r?.messages&&d===s?e:{...e,pages:r&&c?{...e.pages,[n]:{...r,messages:c}}:e.pages,pendingSends:s&&d?{...e.pendingSends,[n]:d}:e.pendingSends}}case"older_page":{if(!e.identity)return e;const n=Mi(e.identity.cid,t.contactCid),r=e.pages[n];if(!r)return e;const s=ks(ks(t.page.messages,t.newer),r.messages),a={...t.page,preview:r.preview,total:Math.max(t.page.total,r.total,s.length),messages:s};return{...e,pages:{...e.pages,[n]:a}}}case"route":return{...e,route:t.route,mobileDetailOpen:t.mobileDetailOpen??(t.route.name==="chats"&&t.route.contactCid!==null||t.route.name==="contact")};case"connection":return{...e,connection:t.connection};case"search":return{...e,search:t.search};case"draft":return e.identity?{...e,drafts:{...e.drafts,[Mi(e.identity.cid,t.contactCid)]:t.value}}:e;case"reply":return e.identity?{...e,replies:{...e.replies,[Mi(e.identity.cid,t.contactCid)]:t.wireId??void 0}}:e;case"sending":return{...e,sendingDialog:t.dialog};case"dialog":return{...e,coveringDialog:t.open,dialogBusy:t.open?e.dialogBusy:!1,generatedInvite:t.open?e.generatedInvite:null,error:null};case"dialog_busy":return{...e,dialogBusy:t.busy};case"generated_invite":return{...e,generatedInvite:t.blob};case"error":return{...e,error:t.message}}}function dA(e,t,n){return!e||t?"ignore":n?"defer":"reload"}function ka(){return{api:Xe,notification:globalThis.Notification,navigator}}function oi(e,t,n){return new Promise((r,s)=>{const a=setTimeout(()=>s(new Error(`${n} did not complete within ${t/1e3}s — try again`)),t);e.then(l=>{clearTimeout(a),r(l)},l=>{clearTimeout(a),s(l)})})}async function fA(e,t={}){let n=null,r=!1,s=!1;const a="serviceWorker"in navigator&&window.isSecureContext,l=()=>e({supported:a,offline:!navigator.onLine,updateAvailable:r,registration:n}),c=()=>l(),d=()=>l(),h=()=>{document.visibilityState==="visible"&&n?.update().catch(()=>{})},p=w=>{if(w.data?.type==="ours-push-repair-required"){window.dispatchEvent(new Event("ours-push-repair-required"));return}if(w.data?.type==="ours-push-foreground"){const k=w.data.contact_id,b=w.data.wire_id,E=w.data.kind;typeof k=="string"&&typeof b=="string"&&G1({v:1,type:E==="file"?"file_received":"message_received",contact_id:k,wire_id:b,date:new Date().toISOString()})}},m=a&&!!navigator.serviceWorker.controller,y=()=>{const w=dA(m,s,t.shouldDeferReload?.()??!1);if(w!=="ignore"){if(w==="defer"){r=!0,l();return}s=!0,(t.reload??(()=>location.reload()))()}};if(window.addEventListener("online",c),window.addEventListener("offline",d),document.addEventListener("visibilitychange",h),navigator.serviceWorker?.addEventListener("message",p),navigator.serviceWorker?.addEventListener("controllerchange",y),a){n=await navigator.serviceWorker.register(gr("/sw.js"),{scope:gr("/"),updateViaCache:"none"}),await navigator.serviceWorker.ready;const w=k=>k?.addEventListener("statechange",()=>{k.state==="installed"&&navigator.serviceWorker.controller&&(r=!0,l())});w(n.installing),n.addEventListener("updatefound",()=>w(n?.installing??null)),n.update().catch(()=>{})}return l(),()=>{window.removeEventListener("online",c),window.removeEventListener("offline",d),document.removeEventListener("visibilitychange",h),navigator.serviceWorker?.removeEventListener("message",p),navigator.serviceWorker?.removeEventListener("controllerchange",y)}}async function x0(e,t=()=>location.reload(),n=navigator.serviceWorker){const r=e.waiting;if(!r){t();return}await oi(new Promise(s=>{let a=!1;const l=()=>{a||(a=!0,n.removeEventListener("controllerchange",l),t(),s())};n.addEventListener("controllerchange",l),r.postMessage({type:"SKIP_WAITING"})}),1e4,"service-worker update")}function hA(e){const t="=".repeat((4-e.length%4)%4),n=atob((e+t).replaceAll("-","+").replaceAll("_","/")),r=new Uint8Array(n.length);for(let s=0;s<n.length;s++)r[s]=n.charCodeAt(s);return r}function pA(e){return e?e instanceof ArrayBuffer?new Uint8Array(e):new Uint8Array(e.buffer,e.byteOffset,e.byteLength):null}function w0(e,t){const n=pA(e);return!!n&&n.length===t.length&&n.every((r,s)=>r===t[s])}function yh(e=navigator.userAgent){return/iP(?:hone|ad|od)/.test(e)}function vh(e=navigator,t=window){return yh(e.userAgent)&&(e.standalone===!0||t.matchMedia("(display-mode: standalone)").matches)}function mA(){return yh()&&!vh()?"On iPhone or iPad, tap Share → Add to Home Screen, then open messenger from its Home Screen icon (iOS 16.4 or later).":!("Notification"in window)||!window.PushManager||!("serviceWorker"in navigator)?"Notifications require a current secure browser with service-worker and Web Push support.":Notification.permission==="denied"?yh()?"Allow messenger in iOS Settings → Notifications, then return and choose Repair.":"Allow notifications in this site’s browser settings, then return and choose Repair.":null}function gA(e={}){const t=e.notification??ka().notification;if(!t)return Promise.reject(new Error("notification permission is unavailable"));const n=new Promise((r,s)=>{let a=!1;const l=c=>{if(a)return;const d=c??t.permission;d!=="granted"&&d!=="denied"&&d!=="default"||(a=!0,r(d))};try{const c=t.requestPermission(l);c&&typeof c.then=="function"&&c.then(l,s)}catch(c){s(c)}});return oi(n,e.timeoutMs??15e3,"notification permission")}function K1(e,t){return!!e&&!!e.pushManager&&!!t.notification&&!!t.navigator.serviceWorker}function Hi(e,t={}){return{status:e,preview:"full",...t}}async function yA(e,t,n){let r=await oi(e.pushManager.getSubscription(),5e3,"push subscription lookup");if((n||r?.options.applicationServerKey&&!w0(r.options.applicationServerKey,t))&&(r&&await oi(r.unsubscribe(),5e3,"stale push unsubscribe"),r=null),r&&w0(r.options.applicationServerKey,t))return r;try{return await oi(e.pushManager.subscribe({userVisibleOnly:!0,applicationServerKey:t}),15e3,"push subscribe")}catch(s){const a=await e.pushManager.getSubscription();if(!a)throw s;return await oi(a.unsubscribe(),5e3,"stale push unsubscribe"),oi(e.pushManager.subscribe({userVisibleOnly:!0,applicationServerKey:t}),15e3,"push repair")}}async function X1(e,t,n,r){const s=await r.api.vapidPublicKey(),l=await oi(Promise.resolve(r.navigator.serviceWorker.ready),1e4,"service-worker readiness")??e,c=hA(s.publicKey),h=(await yA(l,c,n)).toJSON();if(!h.endpoint||!h.keys?.p256dh||!h.keys.auth)throw new Error("browser returned an incomplete push subscription");const p=await r.api.ensurePush({...h,label:r.navigator.userAgent.slice(0,160),...t===void 0?{}:{preview:t}});if(p.status!=="on"||p.fingerprint!==s.fingerprint||p.configEpoch!==s.configEpoch)throw new Error("server did not acknowledge the current Web Push configuration");return Hi("on",{bindingId:p.binding_id,fingerprint:p.fingerprint,configEpoch:p.configEpoch,preview:p.preview})}async function S0(e,t=ka()){return K1(e,t)?t.notification.permission!=="granted"?Hi("needs-permission",{blocked:t.notification.permission==="denied"}):await e.pushManager.getSubscription()?X1(e,void 0,!1,t):Hi("off"):Hi("unsupported")}async function Y1(e,t={},n=ka()){if(!K1(e,n))return Hi("unsupported");const r=await gA({notification:n.notification});return r!=="granted"?Hi("needs-permission",{blocked:r==="denied"}):X1(e,t.preview??"full",t.forceFresh??!1,n)}const vA=(e,t,n=ka())=>Y1(e,{preview:t,forceFresh:!0},n);async function xA(e,t,n=ka()){const r=await e.pushManager.getSubscription(),s=[];if(t.bindingId)try{await n.api.deletePush(t.bindingId)}catch(a){s.push(a)}if(r)try{await r.unsubscribe()}catch(a){s.push(a)}if(s.length)throw new Error("notification disable did not fully converge — choose Repair and try again");return Hi("off",{preview:t.preview})}function wA(e=15e3){if(!("serviceWorker"in navigator))return()=>{};let t;const n=()=>{const a={type:"ours-visibility",state:document.visibilityState,ts:Date.now(),iosStandalone:vh()};navigator.serviceWorker.ready.then(l=>{(navigator.serviceWorker.controller??l.active)?.postMessage(a)}).catch(()=>{})},r=()=>{n(),t!==void 0&&clearInterval(t),t=document.visibilityState==="visible"?setInterval(n,e):void 0,document.visibilityState==="visible"&&Q1()},s=a=>{a.data?.type!=="ours-visibility-query"||!a.ports?.[0]||a.ports[0].postMessage({type:"ours-visibility-reply",state:document.visibilityState,iosStandalone:vh()})};return document.addEventListener("visibilitychange",r),navigator.serviceWorker.addEventListener("message",s),r(),()=>{document.removeEventListener("visibilitychange",r),navigator.serviceWorker.removeEventListener("message",s),t!==void 0&&clearInterval(t)}}async function Q1(){try{if(!("serviceWorker"in navigator))return;const t=await(await navigator.serviceWorker.getRegistration())?.getNotifications()??[];for(const n of t)n.close();"clearAppBadge"in navigator&&await navigator.clearAppBadge()}catch{}}/**
49
- * @license lucide-react v0.468.0 - ISC
50
- *
51
- * This source code is licensed under the ISC license.
52
- * See the LICENSE file in the root directory of this source tree.
53
- */const SA=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),J1=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim();/**
54
- * @license lucide-react v0.468.0 - ISC
55
- *
56
- * This source code is licensed under the ISC license.
57
- * See the LICENSE file in the root directory of this source tree.
58
- */var kA={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"};/**
59
- * @license lucide-react v0.468.0 - ISC
60
- *
61
- * This source code is licensed under the ISC license.
62
- * See the LICENSE file in the root directory of this source tree.
63
- */const CA=S.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:s="",children:a,iconNode:l,...c},d)=>S.createElement("svg",{ref:d,...kA,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:J1("lucide",s),...c},[...l.map(([h,p])=>S.createElement(h,p)),...Array.isArray(a)?a:[a]]));/**
64
- * @license lucide-react v0.468.0 - ISC
65
- *
66
- * This source code is licensed under the ISC license.
67
- * See the LICENSE file in the root directory of this source tree.
68
- */const Ue=(e,t)=>{const n=S.forwardRef(({className:r,...s},a)=>S.createElement(CA,{ref:a,iconNode:t,className:J1(`lucide-${SA(e)}`,r),...s}));return n.displayName=`${e}`,n};/**
69
- * @license lucide-react v0.468.0 - ISC
70
- *
71
- * This source code is licensed under the ISC license.
72
- * See the LICENSE file in the root directory of this source tree.
73
- */const bA=Ue("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);/**
74
- * @license lucide-react v0.468.0 - ISC
75
- *
76
- * This source code is licensed under the ISC license.
77
- * See the LICENSE file in the root directory of this source tree.
78
- */const EA=Ue("Bolt",[["path",{d:"M21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16z",key:"yt0hxn"}],["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}]]);/**
79
- * @license lucide-react v0.468.0 - ISC
80
- *
81
- * This source code is licensed under the ISC license.
82
- * See the LICENSE file in the root directory of this source tree.
83
- */const _A=Ue("Bot",[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]]);/**
84
- * @license lucide-react v0.468.0 - ISC
85
- *
86
- * This source code is licensed under the ISC license.
87
- * See the LICENSE file in the root directory of this source tree.
88
- */const k0=Ue("Boxes",[["path",{d:"M2.97 12.92A2 2 0 0 0 2 14.63v3.24a2 2 0 0 0 .97 1.71l3 1.8a2 2 0 0 0 2.06 0L12 19v-5.5l-5-3-4.03 2.42Z",key:"lc1i9w"}],["path",{d:"m7 16.5-4.74-2.85",key:"1o9zyk"}],["path",{d:"m7 16.5 5-3",key:"va8pkn"}],["path",{d:"M7 16.5v5.17",key:"jnp8gn"}],["path",{d:"M12 13.5V19l3.97 2.38a2 2 0 0 0 2.06 0l3-1.8a2 2 0 0 0 .97-1.71v-3.24a2 2 0 0 0-.97-1.71L17 10.5l-5 3Z",key:"8zsnat"}],["path",{d:"m17 16.5-5-3",key:"8arw3v"}],["path",{d:"m17 16.5 4.74-2.85",key:"8rfmw"}],["path",{d:"M17 16.5v5.17",key:"k6z78m"}],["path",{d:"M7.97 4.42A2 2 0 0 0 7 6.13v4.37l5 3 5-3V6.13a2 2 0 0 0-.97-1.71l-3-1.8a2 2 0 0 0-2.06 0l-3 1.8Z",key:"1xygjf"}],["path",{d:"M12 8 7.26 5.15",key:"1vbdud"}],["path",{d:"m12 8 4.74-2.85",key:"3rx089"}],["path",{d:"M12 13.5V8",key:"1io7kd"}]]);/**
89
- * @license lucide-react v0.468.0 - ISC
90
- *
91
- * This source code is licensed under the ISC license.
92
- * See the LICENSE file in the root directory of this source tree.
93
- */const PA=Ue("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**
94
- * @license lucide-react v0.468.0 - ISC
95
- *
96
- * This source code is licensed under the ISC license.
97
- * See the LICENSE file in the root directory of this source tree.
98
- */const TA=Ue("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
99
- * @license lucide-react v0.468.0 - ISC
100
- *
101
- * This source code is licensed under the ISC license.
102
- * See the LICENSE file in the root directory of this source tree.
103
- */const RA=Ue("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/**
104
- * @license lucide-react v0.468.0 - ISC
105
- *
106
- * This source code is licensed under the ISC license.
107
- * See the LICENSE file in the root directory of this source tree.
108
- */const AA=Ue("CirclePause",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"10",x2:"10",y1:"15",y2:"9",key:"c1nkhi"}],["line",{x1:"14",x2:"14",y1:"15",y2:"9",key:"h65svq"}]]);/**
109
- * @license lucide-react v0.468.0 - ISC
110
- *
111
- * This source code is licensed under the ISC license.
112
- * See the LICENSE file in the root directory of this source tree.
113
- */const IA=Ue("CirclePlay",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polygon",{points:"10 8 16 12 10 16 10 8",key:"1cimsy"}]]);/**
114
- * @license lucide-react v0.468.0 - ISC
115
- *
116
- * This source code is licensed under the ISC license.
117
- * See the LICENSE file in the root directory of this source tree.
118
- */const MA=Ue("Copy",[["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"}]]);/**
119
- * @license lucide-react v0.468.0 - ISC
120
- *
121
- * This source code is licensed under the ISC license.
122
- * See the LICENSE file in the root directory of this source tree.
123
- */const NA=Ue("Download",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"7 10 12 15 17 10",key:"2ggqvy"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3",key:"1vk2je"}]]);/**
124
- * @license lucide-react v0.468.0 - ISC
125
- *
126
- * This source code is licensed under the ISC license.
127
- * See the LICENSE file in the root directory of this source tree.
128
- */const LA=Ue("Ellipsis",[["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"}]]);/**
129
- * @license lucide-react v0.468.0 - ISC
130
- *
131
- * This source code is licensed under the ISC license.
132
- * See the LICENSE file in the root directory of this source tree.
133
- */const C0=Ue("Eye",[["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"}]]);/**
134
- * @license lucide-react v0.468.0 - ISC
135
- *
136
- * This source code is licensed under the ISC license.
137
- * See the LICENSE file in the root directory of this source tree.
138
- */const jA=Ue("Grid2x2",[["path",{d:"M12 3v18",key:"108xh3"}],["path",{d:"M3 12h18",key:"1i2n21"}],["rect",{x:"3",y:"3",width:"18",height:"18",rx:"2",key:"h1oib"}]]);/**
139
- * @license lucide-react v0.468.0 - ISC
140
- *
141
- * This source code is licensed under the ISC license.
142
- * See the LICENSE file in the root directory of this source tree.
143
- */const DA=Ue("Inbox",[["polyline",{points:"22 12 16 12 14 15 10 15 8 12 2 12",key:"o97t9d"}],["path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"oot6mr"}]]);/**
144
- * @license lucide-react v0.468.0 - ISC
145
- *
146
- * This source code is licensed under the ISC license.
147
- * See the LICENSE file in the root directory of this source tree.
148
- */const OA=Ue("Link2",[["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"}]]);/**
149
- * @license lucide-react v0.468.0 - ISC
150
- *
151
- * This source code is licensed under the ISC license.
152
- * See the LICENSE file in the root directory of this source tree.
153
- */const FA=Ue("LockKeyhole",[["circle",{cx:"12",cy:"16",r:"1",key:"1au0dj"}],["rect",{x:"3",y:"10",width:"18",height:"12",rx:"2",key:"6s8ecr"}],["path",{d:"M7 10V7a5 5 0 0 1 10 0v3",key:"1pqi11"}]]);/**
154
- * @license lucide-react v0.468.0 - ISC
155
- *
156
- * This source code is licensed under the ISC license.
157
- * See the LICENSE file in the root directory of this source tree.
158
- */const VA=Ue("Maximize2",[["polyline",{points:"15 3 21 3 21 9",key:"mznyad"}],["polyline",{points:"9 21 3 21 3 15",key:"1avn1i"}],["line",{x1:"21",x2:"14",y1:"3",y2:"10",key:"ota7mn"}],["line",{x1:"3",x2:"10",y1:"21",y2:"14",key:"1atl0r"}]]);/**
159
- * @license lucide-react v0.468.0 - ISC
160
- *
161
- * This source code is licensed under the ISC license.
162
- * See the LICENSE file in the root directory of this source tree.
163
- */const zA=Ue("Menu",[["line",{x1:"4",x2:"20",y1:"12",y2:"12",key:"1e0a9i"}],["line",{x1:"4",x2:"20",y1:"6",y2:"6",key:"1owob3"}],["line",{x1:"4",x2:"20",y1:"18",y2:"18",key:"yk5zj1"}]]);/**
164
- * @license lucide-react v0.468.0 - ISC
165
- *
166
- * This source code is licensed under the ISC license.
167
- * See the LICENSE file in the root directory of this source tree.
168
- */const BA=Ue("MessageCircleReply",[["path",{d:"M7.9 20A9 9 0 1 0 4 16.1L2 22Z",key:"vv11sd"}],["path",{d:"m10 15-3-3 3-3",key:"1pgupc"}],["path",{d:"M7 12h7a2 2 0 0 1 2 2v1",key:"1gheu4"}]]);/**
169
- * @license lucide-react v0.468.0 - ISC
170
- *
171
- * This source code is licensed under the ISC license.
172
- * See the LICENSE file in the root directory of this source tree.
173
- */const UA=Ue("MessageSquareText",[["path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z",key:"1lielz"}],["path",{d:"M13 8H7",key:"14i4kc"}],["path",{d:"M17 12H7",key:"16if0g"}]]);/**
174
- * @license lucide-react v0.468.0 - ISC
175
- *
176
- * This source code is licensed under the ISC license.
177
- * See the LICENSE file in the root directory of this source tree.
178
- */const $A=Ue("Mic",[["path",{d:"M12 2a3 3 0 0 0-3 3v7a3 3 0 0 0 6 0V5a3 3 0 0 0-3-3Z",key:"131961"}],["path",{d:"M19 10v2a7 7 0 0 1-14 0v-2",key:"1vc78b"}],["line",{x1:"12",x2:"12",y1:"19",y2:"22",key:"x3vr5v"}]]);/**
179
- * @license lucide-react v0.468.0 - ISC
180
- *
181
- * This source code is licensed under the ISC license.
182
- * See the LICENSE file in the root directory of this source tree.
183
- */const HA=Ue("Minus",[["path",{d:"M5 12h14",key:"1ays0h"}]]);/**
184
- * @license lucide-react v0.468.0 - ISC
185
- *
186
- * This source code is licensed under the ISC license.
187
- * See the LICENSE file in the root directory of this source tree.
188
- */const WA=Ue("Paperclip",[["path",{d:"M13.234 20.252 21 12.3",key:"1cbrk9"}],["path",{d:"m16 6-8.414 8.586a2 2 0 0 0 0 2.828 2 2 0 0 0 2.828 0l8.414-8.586a4 4 0 0 0 0-5.656 4 4 0 0 0-5.656 0l-8.415 8.585a6 6 0 1 0 8.486 8.486",key:"1pkts6"}]]);/**
189
- * @license lucide-react v0.468.0 - ISC
190
- *
191
- * This source code is licensed under the ISC license.
192
- * See the LICENSE file in the root directory of this source tree.
193
- */const qA=Ue("Pencil",[["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"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]]);/**
194
- * @license lucide-react v0.468.0 - ISC
195
- *
196
- * This source code is licensed under the ISC license.
197
- * See the LICENSE file in the root directory of this source tree.
198
- */const GA=Ue("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/**
199
- * @license lucide-react v0.468.0 - ISC
200
- *
201
- * This source code is licensed under the ISC license.
202
- * See the LICENSE file in the root directory of this source tree.
203
- */const KA=Ue("RefreshCw",[["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"}]]);/**
204
- * @license lucide-react v0.468.0 - ISC
205
- *
206
- * This source code is licensed under the ISC license.
207
- * See the LICENSE file in the root directory of this source tree.
208
- */const XA=Ue("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/**
209
- * @license lucide-react v0.468.0 - ISC
210
- *
211
- * This source code is licensed under the ISC license.
212
- * See the LICENSE file in the root directory of this source tree.
213
- */const YA=Ue("SendHorizontal",[["path",{d:"M3.714 3.048a.498.498 0 0 0-.683.627l2.843 7.627a2 2 0 0 1 0 1.396l-2.842 7.627a.498.498 0 0 0 .682.627l18-8.5a.5.5 0 0 0 0-.904z",key:"117uat"}],["path",{d:"M6 12h16",key:"s4cdu5"}]]);/**
214
- * @license lucide-react v0.468.0 - ISC
215
- *
216
- * This source code is licensed under the ISC license.
217
- * See the LICENSE file in the root directory of this source tree.
218
- */const QA=Ue("Settings2",[["path",{d:"M20 7h-9",key:"3s1dr2"}],["path",{d:"M14 17H5",key:"gfn3mx"}],["circle",{cx:"17",cy:"17",r:"3",key:"18b49y"}],["circle",{cx:"7",cy:"7",r:"3",key:"dfmy0x"}]]);/**
219
- * @license lucide-react v0.468.0 - ISC
220
- *
221
- * This source code is licensed under the ISC license.
222
- * See the LICENSE file in the root directory of this source tree.
223
- */const JA=Ue("ShieldCheck",[["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"}]]);/**
224
- * @license lucide-react v0.468.0 - ISC
225
- *
226
- * This source code is licensed under the ISC license.
227
- * See the LICENSE file in the root directory of this source tree.
228
- */const ZA=Ue("SlidersHorizontal",[["line",{x1:"21",x2:"14",y1:"4",y2:"4",key:"obuewd"}],["line",{x1:"10",x2:"3",y1:"4",y2:"4",key:"1q6298"}],["line",{x1:"21",x2:"12",y1:"12",y2:"12",key:"1iu8h1"}],["line",{x1:"8",x2:"3",y1:"12",y2:"12",key:"ntss68"}],["line",{x1:"21",x2:"16",y1:"20",y2:"20",key:"14d8ph"}],["line",{x1:"12",x2:"3",y1:"20",y2:"20",key:"m0wm8r"}],["line",{x1:"14",x2:"14",y1:"2",y2:"6",key:"14e1ph"}],["line",{x1:"8",x2:"8",y1:"10",y2:"14",key:"1i6ji0"}],["line",{x1:"16",x2:"16",y1:"18",y2:"22",key:"1lctlv"}]]);/**
229
- * @license lucide-react v0.468.0 - ISC
230
- *
231
- * This source code is licensed under the ISC license.
232
- * See the LICENSE file in the root directory of this source tree.
233
- */const eI=Ue("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);/**
234
- * @license lucide-react v0.468.0 - ISC
235
- *
236
- * This source code is licensed under the ISC license.
237
- * See the LICENSE file in the root directory of this source tree.
238
- */const tI=Ue("UserRoundPlus",[["path",{d:"M2 21a8 8 0 0 1 13.292-6",key:"bjp14o"}],["circle",{cx:"10",cy:"8",r:"5",key:"o932ke"}],["path",{d:"M19 16v6",key:"tddt3s"}],["path",{d:"M22 19h-6",key:"vcuq98"}]]);/**
239
- * @license lucide-react v0.468.0 - ISC
240
- *
241
- * This source code is licensed under the ISC license.
242
- * See the LICENSE file in the root directory of this source tree.
243
- */const nI=Ue("UserRound",[["circle",{cx:"12",cy:"8",r:"5",key:"1hypcn"}],["path",{d:"M20 21a8 8 0 0 0-16 0",key:"rfgkzh"}]]);/**
244
- * @license lucide-react v0.468.0 - ISC
245
- *
246
- * This source code is licensed under the ISC license.
247
- * See the LICENSE file in the root directory of this source tree.
248
- */const rI=Ue("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),iI={app:jA,back:bA,bolt:EA,chat:UA,check:PA,chevron:RA,chevronDown:TA,close:rI,clusters:k0,copy:MA,download:NA,edit:qA,inbox:DA,link:OA,lock:FA,mic:$A,maximize:VA,menu:zA,minus:HA,monitor:C0,monitorEye:C0,more:LA,paperclip:WA,pause:AA,play:IA,plus:GA,refresh:KA,reply:BA,search:XA,send:YA,settings:QA,shield:JA,sliders:ZA,trash:eI,user:nI,invite:tI,agent:_A,network:k0};function Ce(e){const{name:t,size:n=18,stroke:r=1.8,fill:s=!1,style:a,className:l}=e,c=iI[t];return c?v.jsx(c,{className:"ic "+(l||""),width:n,height:n,strokeWidth:r,fill:s?"currentColor":"none",style:a,"aria-hidden":"true"}):null}function Z1(e){if(typeof e!="string")return null;const t=/^(\d{4})-(\d{2})-(\d{2})[ T](\d{2}):(\d{2}):(\d{2})(?:\.(\d+))?(?:(Z)|([+-]\d{2}:\d{2})|\s*\(UTC\))?$/i.exec(e.trim());if(!t)return null;const n=t[7]?t[7].slice(0,3).padEnd(3,"0"):"000",r=`${t[1]}-${t[2]}-${t[3]}T${t[4]}:${t[5]}:${t[6]}.${n}`,s=new Date(`${r}Z`);if(Number.isNaN(s.getTime())||s.getUTCFullYear()!==Number(t[1])||s.getUTCMonth()+1!==Number(t[2])||s.getUTCDate()!==Number(t[3])||s.getUTCHours()!==Number(t[4])||s.getUTCMinutes()!==Number(t[5])||s.getUTCSeconds()!==Number(t[6]))return null;if(t[9]){const a=new Date(`${r}${t[9]}`);return Number.isNaN(a.getTime())?null:a.toISOString()}return s.toISOString()}function Ru(e){const t=Z1(e);if(t){const r=Date.parse(t);if(!Number.isNaN(r))return r}const n=new Date(e).getTime();return Number.isNaN(n)?0:n}function sI(e){const t=Z1(e);if(t){const r=new Date(t);if(!Number.isNaN(r.getTime()))return r}const n=new Date(e);return Number.isNaN(n.getTime())?null:n}const Oo="room",oI="room_",Au="ours-cowork-room:",b0="ours-cowork:",E0="ours-cowork-",_0="cowork-room-",xh=/^[0-7][0-9a-hjkmnp-tv-z]{25}$/,aI=/^[a-z0-9]+(?:-[a-z0-9]+)*$/,lI=25,uI=64,cI=80,P0=1e3,ca=e=>typeof e=="object"&&e!==null&&!Array.isArray(e),sn=e=>typeof e=="string"&&e.length>0;function dI(e,t){if(typeof e!="string")return null;const n=e.trim();if(!n.startsWith("{")||!n.endsWith("}"))return null;let r;try{r=JSON.parse(n)}catch{return null}return!ca(r)||r.version!==1||!sn(r.kind)||!r.kind.startsWith(oI)||!sn(r.room_id)||t&&!sn(r.signature)?null:r}function fI(e){const t=ca(e.author)?e.author:{};return{name:sn(t.display_name)?t.display_name:"",role:sn(t.role)?t.role:""}}function df(e){const n=Array.from(String(e)).slice(0,cI).join("").replace(/^room_/,"").split("_").filter(Boolean);return n.length===0?"Room notice":n.join(" ").replace(/^./,r=>r.toUpperCase())}function hI(e){if(!ca(e))return null;const t=sn(e.kind)?e.kind:"",n=fI(e),r=typeof e.text=="string"?e.text:"",s=Number.isSafeInteger(e.briefing_version)&&e.briefing_version>0?e.briefing_version:null,a={roomName:eS(e.room_name)??"",authoredAt:sn(e.at)?e.at:""};switch(t){case"room_msg":return n.role===Oo?si(t,"Room message",r||"Room notice",{...a,authoredBy:n.name}):{variant:"chat",kind:t,author:n.name||"Unknown member",role:n.role,label:"",text:r,...a};case"room_briefing":return si(t,s===null?"Room briefing":`Room briefing · v${s}`,r||"The room briefing was updated.",{...a,authoredBy:n.name,presentation:"briefing"});case"room_role_briefing":{const l=sn(e.briefing_role)?e.briefing_role:"",c=["Role briefing",l,s===null?"":`v${s}`].filter(Boolean).join(" · ");return si(t,c,r||"Your role briefing was updated.",{...a,authoredBy:n.name,presentation:"role",details:l?[`Role: ${l}`]:[]})}case"room_membership":{const l=ca(e.membership)?e.membership:{},c=[sn(l.action)?`Status: ${gI(l.action)}`:"",sn(l.alias)?`Member: ${l.alias}`:"",sn(l.role)?`Role: ${l.role}`:"",Number.isSafeInteger(l.epoch)&&l.epoch>=0?`Epoch: ${l.epoch}`:""].filter(Boolean);return si(t,"Membership",r||wI(l),{...a,authoredBy:n.name,presentation:"membership",details:c})}case"room_file":{const l=sn(e.filename)?e.filename:"Shared file",c=[sn(e.mime)?`Type: ${e.mime}`:"",Number.isSafeInteger(e.size)&&e.size>=0?`Size: ${yI(e.size)}`:"",sn(e.sha256)?`SHA-256: ${vI(e.sha256)}`:""].filter(Boolean);return si(t,"Room file",l,{...a,authoredBy:n.name,role:n.role,presentation:"file",details:c})}case"room_not_member":return si(t,"Room access","You are no longer a member of this room.",{...a,presentation:"lifecycle",details:["Status: Removed"]});default:return r?{variant:n.role&&n.role!==Oo?"chat":"system",kind:t,author:n.role&&n.role!==Oo?n.name||"Unknown member":"",role:n.role&&n.role!==Oo?n.role:"",label:n.role&&n.role!==Oo?"":df(t),text:xI(r),...a}:si(t,df(t),`${df(t)} from the room.`,a)}}function pI(e,t){if(!mI(e))return null;const n=Mp(e)?.roomId??null,r=Ap(e),s=Ip(e),a=dI(t,n===null&&s===null);return a!==null&&n!==null&&a.room_id!==n||a!==null&&r!==null&&a.room_id!==r?T0("Room provenance mismatch"):hI(a)}function eS(e){if(typeof e!="string"||/[\p{Cc}\p{Cf}]/u.test(e))return null;const t=e.trim().normalize("NFC"),n=Array.from(t).length;return n>=1&&n<=uI?t:null}function Ap(e){if(typeof e!="string"||!e.startsWith(_0))return null;const t=e.slice(_0.length);return xh.test(t)?t:null}function Ip(e){return typeof e!="string"||!e.startsWith(b0)?null:eS(e.slice(b0.length))}function Mp(e){if(typeof e!="string"||!e.startsWith(E0))return null;const t=e.slice(E0.length);if(xh.test(t))return{roomId:t,slug:null};const n=t.slice(-26),r=t.at(-27),s=t.slice(0,-27);return r!=="-"||!xh.test(n)||s.length<1||s.length>lI?null:aI.test(s)?{roomId:n,slug:s}:null}function mI(e){const t=String(e??"").trim();return t.startsWith(Au)&&t.slice(Au.length).trim().length>0||Ip(e)!==null||Mp(e)!==null||Ap(e)!==null}function si(e,t,n,r={}){return{variant:"system",kind:e,author:"",role:"",label:t,text:n,...r}}function gI(e){return String(e).replace(/_/g," ").replace(/^./,t=>t.toUpperCase())}function yI(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KiB`:`${(e/(1024*1024)).toFixed(1)} MiB`}function vI(e){const t=String(e);return t.length<=20?t:`${t.slice(0,12)}…${t.slice(-6)}`}function xI(e){const t=Array.from(String(e));return t.length<=P0?t.join(""):`${t.slice(0,P0).join("")}…`}function T0(e){return si("room_invalid","Room notice","This room envelope could not be displayed safely.",{presentation:"lifecycle",details:[`Status: ${e}`]})}function wI(e){if(!ca(e))return"The room membership changed.";const t=sn(e.alias)?e.alias:"A member";return e.action==="remove"?`${t} left the room.`:"The room membership changed."}function SI(e){if(!e)return"";const t=e.variant==="chat"?e.author:e.label,n=kI(e.text);return t?n?`${t} · ${n}`:t:n}function kI(e){return String(e??"").replace(/\s+/g," ").trim()}function CI(e){const t=String(e??"").trim();if(t.startsWith(Au))return t.slice(Au.length).trim()||null;const n=Ip(e);if(n!==null)return n;const r=Mp(e);if(r?.slug)return r.slug.replace(/-/g," ").replace(/[a-z]/,l=>l.toUpperCase());if(r)return`Room ${r.roomId.slice(0,8)}`;const s=Ap(e);return s===null?null:`Room ${s.slice(0,8)}`}const Np=sI;function wh(e){const t=e.trim().split(/\s+/).filter(Boolean);if(!t.length)return"?";const n=r=>Array.from(r).find(s=>/[\p{L}\p{N}]/u.test(s))??Array.from(r)[0]??"";if(t.length===1){const r=Array.from(t[0]),s=r.filter(a=>/[\p{L}\p{N}]/u.test(a));return(s.length?s.slice(0,2).join(""):r[0]??"?").toUpperCase()}return(n(t[0])+n(t.at(-1)??"")).toUpperCase()}function bI(e){const t=Np(e);if(!t)return"";const n=new Date;return t.toDateString()===n.toDateString()?t.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"}):t.toLocaleDateString([],{month:"short",day:"numeric"})}function Wi(e){const t=Np(e);return t?t.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"}):""}function EI(e){const t=Np(e);return t?t.toLocaleString():e}function tS(e){return e.length<=14?e:`${e.slice(0,8)}…${e.slice(-4)}`}function _I(e){return/^[0-9A-Fa-f]{40,}$/.test(e.trim())}function PI(e,t,n){const r=(e??"").trim(),s=CI(r);return s||(r&&!_I(r)?r:r?tS(r):"Unnamed")}function Iu(e){return e.display_name?.trim()||PI(e.name)}const TI="x-ours-kind=voice-message",nS="voice-message-",Ho=20*1024*1024;let da=null,Sh=[];const Lp=new Map;function RI(e){da=e;for(const t of Sh)t(e);Sh=[]}function R0(e){for(const t of e)Lp.set(t.wire_id,{id:t.wire_id,dir:t.dir,filename:t.filename,mime:t.mime,size:t.size,date:t.date,available:t.available,logicalName:t.logical_name,version:t.version,transcription:t.transcription})}function AI(){Lp.clear()}function rS(e){return Lp.get(e)??null}function II(e){return da?.url(e)??null}function MI(e){return`${e}; ${TI}`}function Us(e,t){return/x-ours-kind\s*=\s*voice-message/i.test(e)||t.toLowerCase().startsWith(nS)&&e.toLowerCase().startsWith("audio/")}function NI(e,t){const n=e??"file",r=t??"";return Us(r,n)?"🎤 Voice message":r.toLowerCase().startsWith("image/")?"🖼 Photo":`📎 ${n}`}async function ec(e){return(da??await new Promise(n=>Sh.push(n))).bytes(e)}async function LI(e){if(!da)throw new Error("Media provider is not ready");await da.fetch(e)}function fi(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(0)} KB`:`${(e/1024/1024).toFixed(1)} MB`}function jI(e,t=!1){return e==="read"?{state:"read",label:"read",glyph:"✓✓"}:e==="delivered"?{state:"delivered",label:"delivered",glyph:"✓✓"}:t?{state:"untracked",label:"sent, and cannot report delivery",glyph:"✓"}:{state:"sent",label:"sent",glyph:"✓"}}function kh({receipt:e,content:t="Message",receiptless:n=!1}){const r=jI(e,n);return v.jsx("span",{className:"ticks"+(r.state==="read"?" read":""),"data-receipt-status":r.state,role:"img","aria-label":`${t} ${r.label}`,title:r.label,children:r.glyph})}function A0(e,t){const n=String(e);if(typeof t!="string")throw new TypeError("Expected character");let r=0,s=n.indexOf(t);for(;s!==-1;)r++,s=n.indexOf(t,s+t.length);return r}const on=mi(/[A-Za-z]/),Jt=mi(/[\dA-Za-z]/),DI=mi(/[#-'*+\--9=?A-Z^-~]/);function Mu(e){return e!==null&&(e<32||e===127)}const Ch=mi(/\d/),OI=mi(/[\dA-Fa-f]/),FI=mi(/[!-/:-@[-`{-~]/);function Ne(e){return e!==null&&e<-2}function it(e){return e!==null&&(e<0||e===32)}function Be(e){return e===-2||e===-1||e===32}const tc=mi(/\p{P}|\p{S}/u),Ki=mi(/\s/);function mi(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function VI(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}const nc=(function(e){if(e==null)return $I;if(typeof e=="function")return rc(e);if(typeof e=="object")return Array.isArray(e)?zI(e):BI(e);if(typeof e=="string")return UI(e);throw new Error("Expected function, string, or object as test")});function zI(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=nc(e[n]);return rc(r);function r(...s){let a=-1;for(;++a<t.length;)if(t[a].apply(this,s))return!0;return!1}}function BI(e){const t=e;return rc(n);function n(r){const s=r;let a;for(a in e)if(s[a]!==t[a])return!1;return!0}}function UI(e){return rc(t);function t(n){return n&&n.type===e}}function rc(e){return t;function t(n,r,s){return!!(HI(n)&&e.call(this,n,typeof r=="number"?r:void 0,s||void 0))}}function $I(){return!0}function HI(e){return e!==null&&typeof e=="object"&&"type"in e}const iS=[],WI=!0,bh=!1,qI="skip";function sS(e,t,n,r){let s;typeof t=="function"&&typeof n!="function"?(r=n,n=t):s=t;const a=nc(s),l=r?-1:1;c(e,void 0,[])();function c(d,h,p){const m=d&&typeof d=="object"?d:{};if(typeof m.type=="string"){const w=typeof m.tagName=="string"?m.tagName:typeof m.name=="string"?m.name:void 0;Object.defineProperty(y,"name",{value:"node ("+(d.type+(w?"<"+w+">":""))+")"})}return y;function y(){let w=iS,k,b,E;if((!t||a(d,h,p[p.length-1]||void 0))&&(w=GI(n(d,p)),w[0]===bh))return w;if("children"in d&&d.children){const P=d;if(P.children&&w[0]!==qI)for(b=(r?P.children.length:-1)+l,E=p.concat(P);b>-1&&b<P.children.length;){const R=P.children[b];if(k=c(R,b,E)(),k[0]===bh)return k;b=typeof k[1]=="number"?k[1]:b+l}}return w}}}function GI(e){return Array.isArray(e)?e:typeof e=="number"?[WI,e]:e==null?iS:[e]}function KI(e,t,n){const s=nc((n||{}).ignore||[]),a=XI(t);let l=-1;for(;++l<a.length;)sS(e,"text",c);function c(h,p){let m=-1,y;for(;++m<p.length;){const w=p[m],k=y?y.children:void 0;if(s(w,k?k.indexOf(w):void 0,y))return;y=w}if(y)return d(h,p)}function d(h,p){const m=p[p.length-1],y=a[l][0],w=a[l][1];let k=0;const E=m.children.indexOf(h);let P=!1,R=[];y.lastIndex=0;let _=y.exec(h.value);for(;_;){const j=_.index,A={index:_.index,input:_.input,stack:[...p,h]};let N=w(..._,A);if(typeof N=="string"&&(N=N.length>0?{type:"text",value:N}:void 0),N===!1?y.lastIndex=j+1:(k!==j&&R.push({type:"text",value:h.value.slice(k,j)}),Array.isArray(N)?R.push(...N):N&&R.push(N),k=j+_[0].length,P=!0),!y.global)break;_=y.exec(h.value)}return P?(k<h.value.length&&R.push({type:"text",value:h.value.slice(k)}),m.children.splice(E,1,...R)):R=[h],E+R.length}}function XI(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 s=n[r];t.push([YI(s[0]),QI(s[1])])}return t}function YI(e){return typeof e=="string"?new RegExp(VI(e),"g"):e}function QI(e){return typeof e=="function"?e:function(){return e}}const ff="phrasing",hf=["autolink","link","image","label"];function JI(){return{transforms:[sM],enter:{literalAutolink:eM,literalAutolinkEmail:pf,literalAutolinkHttp:pf,literalAutolinkWww:pf},exit:{literalAutolink:iM,literalAutolinkEmail:rM,literalAutolinkHttp:tM,literalAutolinkWww:nM}}}function ZI(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:ff,notInConstruct:hf},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:ff,notInConstruct:hf},{character:":",before:"[ps]",after:"\\/",inConstruct:ff,notInConstruct:hf}]}}function eM(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function pf(e){this.config.enter.autolinkProtocol.call(this,e)}function tM(e){this.config.exit.autolinkProtocol.call(this,e)}function nM(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 rM(e){this.config.exit.autolinkEmail.call(this,e)}function iM(e){this.exit(e)}function sM(e){KI(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,oM],[/(?<=^|\s|\p{P}|\p{S})([-.\w+]+)@([-\w]+(?:\.[-\w]+)+)/gu,aM]],{ignore:["link","linkReference"]})}function oM(e,t,n,r,s){let a="";if(!oS(s)||(/^w/i.test(t)&&(n=t+n,t="",a="http://"),!lM(n)))return!1;const l=uM(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 aM(e,t,n,r){return!oS(r,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function lM(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 uM(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 s=A0(e,"(");let a=A0(e,")");for(;r!==-1&&s>a;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(")"),a++;return[e,n]}function oS(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||Ki(n)||tc(n))&&(!t||n!==47)}function Zn(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}aS.peek=vM;function cM(){this.buffer()}function dM(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function fM(){this.buffer()}function hM(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function pM(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Zn(this.sliceSerialize(e)).toLowerCase(),n.label=t}function mM(e){this.exit(e)}function gM(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Zn(this.sliceSerialize(e)).toLowerCase(),n.label=t}function yM(e){this.exit(e)}function vM(){return"["}function aS(e,t,n,r){const s=n.createTracker(r);let a=s.move("[^");const l=n.enter("footnoteReference"),c=n.enter("reference");return a+=s.move(n.safe(n.associationId(e),{after:"]",before:a})),c(),l(),a+=s.move("]"),a}function xM(){return{enter:{gfmFootnoteCallString:cM,gfmFootnoteCall:dM,gfmFootnoteDefinitionLabelString:fM,gfmFootnoteDefinition:hM},exit:{gfmFootnoteCallString:pM,gfmFootnoteCall:mM,gfmFootnoteDefinitionLabelString:gM,gfmFootnoteDefinition:yM}}}function wM(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:aS},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(r,s,a,l){const c=a.createTracker(l);let d=c.move("[^");const h=a.enter("footnoteDefinition"),p=a.enter("label");return d+=c.move(a.safe(a.associationId(r),{before:d,after:"]"})),p(),d+=c.move("]:"),r.children&&r.children.length>0&&(c.shift(4),d+=c.move((t?`
249
- `:" ")+a.indentLines(a.containerFlow(r,c.current()),t?lS:SM))),h(),d}}function SM(e,t,n){return t===0?e:lS(e,t,n)}function lS(e,t,n){return(n?"":" ")+e}const kM=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];uS.peek=PM;function CM(){return{canContainEols:["delete"],enter:{strikethrough:EM},exit:{strikethrough:_M}}}function bM(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:kM}],handlers:{delete:uS}}}function EM(e){this.enter({type:"delete",children:[]},e)}function _M(e){this.exit(e)}function uS(e,t,n,r){const s=n.createTracker(r),a=n.enter("strikethrough");let l=s.move("~~");return l+=n.containerPhrasing(e,{...s.current(),before:l,after:"~"}),l+=s.move("~~"),a(),l}function PM(){return"~"}function TM(e){return e.length}function RM(e,t){const n=t||{},r=(n.align||[]).concat(),s=n.stringLength||TM,a=[],l=[],c=[],d=[];let h=0,p=-1;for(;++p<e.length;){const b=[],E=[];let P=-1;for(e[p].length>h&&(h=e[p].length);++P<e[p].length;){const R=AM(e[p][P]);if(n.alignDelimiters!==!1){const _=s(R);E[P]=_,(d[P]===void 0||_>d[P])&&(d[P]=_)}b.push(R)}l[p]=b,c[p]=E}let m=-1;if(typeof r=="object"&&"length"in r)for(;++m<h;)a[m]=I0(r[m]);else{const b=I0(r);for(;++m<h;)a[m]=b}m=-1;const y=[],w=[];for(;++m<h;){const b=a[m];let E="",P="";b===99?(E=":",P=":"):b===108?E=":":b===114&&(P=":");let R=n.alignDelimiters===!1?1:Math.max(1,d[m]-E.length-P.length);const _=E+"-".repeat(R)+P;n.alignDelimiters!==!1&&(R=E.length+R+P.length,R>d[m]&&(d[m]=R),w[m]=R),y[m]=_}l.splice(1,0,y),c.splice(1,0,w),p=-1;const k=[];for(;++p<l.length;){const b=l[p],E=c[p];m=-1;const P=[];for(;++m<h;){const R=b[m]||"";let _="",j="";if(n.alignDelimiters!==!1){const A=d[m]-(E[m]||0),N=a[m];N===114?_=" ".repeat(A):N===99?A%2?(_=" ".repeat(A/2+.5),j=" ".repeat(A/2-.5)):(_=" ".repeat(A/2),j=_):j=" ".repeat(A)}n.delimiterStart!==!1&&!m&&P.push("|"),n.padding!==!1&&!(n.alignDelimiters===!1&&R==="")&&(n.delimiterStart!==!1||m)&&P.push(" "),n.alignDelimiters!==!1&&P.push(_),P.push(R),n.alignDelimiters!==!1&&P.push(j),n.padding!==!1&&P.push(" "),(n.delimiterEnd!==!1||m!==h-1)&&P.push("|")}k.push(n.delimiterEnd===!1?P.join("").replace(/ +$/,""):P.join(""))}return k.join(`
250
- `)}function AM(e){return e==null?"":String(e)}function I0(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 IM(e,t,n,r){const s=n.enter("blockquote"),a=n.createTracker(r);a.move("> "),a.shift(2);const l=n.indentLines(n.containerFlow(e,a.current()),MM);return s(),l}function MM(e,t,n){return">"+(n?"":" ")+e}function NM(e,t){return M0(e,t.inConstruct,!0)&&!M0(e,t.notInConstruct,!1)}function M0(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 N0(e,t,n,r){let s=-1;for(;++s<n.unsafe.length;)if(n.unsafe[s].character===`
251
- `&&NM(n.stack,n.unsafe[s]))return/[ \t]/.test(r.before)?"":" ";return`\\
252
- `}function LM(e,t){const n=String(e);let r=n.indexOf(t),s=r,a=0,l=0;if(typeof t!="string")throw new TypeError("Expected substring");for(;r!==-1;)r===s?++a>l&&(l=a):a=1,s=r+t.length,r=n.indexOf(t,s);return l}function jM(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 DM(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 OM(e,t,n,r){const s=DM(n),a=e.value||"",l=s==="`"?"GraveAccent":"Tilde";if(jM(e,n)){const m=n.enter("codeIndented"),y=n.indentLines(a,FM);return m(),y}const c=n.createTracker(r),d=s.repeat(Math.max(LM(a,s)+1,3)),h=n.enter("codeFenced");let p=c.move(d);if(e.lang){const m=n.enter(`codeFencedLang${l}`);p+=c.move(n.safe(e.lang,{before:p,after:" ",encode:["`"],...c.current()})),m()}if(e.lang&&e.meta){const m=n.enter(`codeFencedMeta${l}`);p+=c.move(" "),p+=c.move(n.safe(e.meta,{before:p,after:`
253
- `,encode:["`"],...c.current()})),m()}return p+=c.move(`
254
- `),a&&(p+=c.move(a+`
255
- `)),p+=c.move(d),h(),p}function FM(e,t,n){return(n?"":" ")+e}function jp(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 VM(e,t,n,r){const s=jp(n),a=s==='"'?"Quote":"Apostrophe",l=n.enter("definition");let c=n.enter("label");const d=n.createTracker(r);let h=d.move("[");return h+=d.move(n.safe(n.associationId(e),{before:h,after:"]",...d.current()})),h+=d.move("]: "),c(),!e.url||/[\0- \u007F]/.test(e.url)?(c=n.enter("destinationLiteral"),h+=d.move("<"),h+=d.move(n.safe(e.url,{before:h,after:">",...d.current()})),h+=d.move(">")):(c=n.enter("destinationRaw"),h+=d.move(n.safe(e.url,{before:h,after:e.title?" ":`
256
- `,...d.current()}))),c(),e.title&&(c=n.enter(`title${a}`),h+=d.move(" "+s),h+=d.move(n.safe(e.title,{before:h,after:s,...d.current()})),h+=d.move(s),c()),l(),h}function zM(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 fa(e){return"&#x"+e.toString(16).toUpperCase()+";"}function $s(e){if(e===null||it(e)||Ki(e))return 1;if(tc(e))return 2}function Nu(e,t,n){const r=$s(e),s=$s(t);return r===void 0?s===void 0?n==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:s===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:r===1?s===void 0?{inside:!1,outside:!1}:s===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:s===void 0?{inside:!1,outside:!1}:s===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}cS.peek=BM;function cS(e,t,n,r){const s=zM(n),a=n.enter("emphasis"),l=n.createTracker(r),c=l.move(s);let d=l.move(n.containerPhrasing(e,{after:s,before:c,...l.current()}));const h=d.charCodeAt(0),p=Nu(r.before.charCodeAt(r.before.length-1),h,s);p.inside&&(d=fa(h)+d.slice(1));const m=d.charCodeAt(d.length-1),y=Nu(r.after.charCodeAt(0),m,s);y.inside&&(d=d.slice(0,-1)+fa(m));const w=l.move(s);return a(),n.attentionEncodeSurroundingInfo={after:y.outside,before:p.outside},c+d+w}function BM(e,t,n){return n.options.emphasis||"*"}function Dp(e,t,n,r){let s,a,l;typeof t=="function"&&typeof n!="function"?(a=void 0,l=t,s=n):(a=t,l=n,s=r),sS(e,a,c,s);function c(d,h){const p=h[h.length-1],m=p?p.children.indexOf(d):void 0;return l(d,m,p)}}const UM={};function Op(e,t){const n=UM,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,s=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return dS(e,r,s)}function dS(e,t,n){if($M(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 L0(e.children,t,n)}return Array.isArray(e)?L0(e,t,n):""}function L0(e,t,n){const r=[];let s=-1;for(;++s<e.length;)r[s]=dS(e[s],t,n);return r.join("")}function $M(e){return!!(e&&typeof e=="object")}function HM(e,t){let n=!1;return Dp(e,function(r){if("value"in r&&/\r?\n|\r/.test(r.value)||r.type==="break")return n=!0,bh}),!!((!e.depth||e.depth<3)&&Op(e)&&(t.options.setext||n))}function WM(e,t,n,r){const s=Math.max(Math.min(6,e.depth||1),1),a=n.createTracker(r);if(HM(e,n)){const p=n.enter("headingSetext"),m=n.enter("phrasing"),y=n.containerPhrasing(e,{...a.current(),before:`
257
- `,after:`
258
- `});return m(),p(),y+`
259
- `+(s===1?"=":"-").repeat(y.length-(Math.max(y.lastIndexOf("\r"),y.lastIndexOf(`
260
- `))+1))}const l="#".repeat(s),c=n.enter("headingAtx"),d=n.enter("phrasing");a.move(l+" ");let h=n.containerPhrasing(e,{before:"# ",after:`
261
- `,...a.current()});return/^[\t ]/.test(h)&&(h=fa(h.charCodeAt(0))+h.slice(1)),h=h?l+" "+h:l,n.options.closeAtx&&(h+=" "+l),d(),c(),h}fS.peek=qM;function fS(e){return e.value||""}function qM(){return"<"}hS.peek=GM;function hS(e,t,n,r){const s=jp(n),a=s==='"'?"Quote":"Apostrophe",l=n.enter("image");let c=n.enter("label");const d=n.createTracker(r);let h=d.move("![");return h+=d.move(n.safe(e.alt,{before:h,after:"]",...d.current()})),h+=d.move("]("),c(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(c=n.enter("destinationLiteral"),h+=d.move("<"),h+=d.move(n.safe(e.url,{before:h,after:">",...d.current()})),h+=d.move(">")):(c=n.enter("destinationRaw"),h+=d.move(n.safe(e.url,{before:h,after:e.title?" ":")",...d.current()}))),c(),e.title&&(c=n.enter(`title${a}`),h+=d.move(" "+s),h+=d.move(n.safe(e.title,{before:h,after:s,...d.current()})),h+=d.move(s),c()),h+=d.move(")"),l(),h}function GM(){return"!"}pS.peek=KM;function pS(e,t,n,r){const s=e.referenceType,a=n.enter("imageReference");let l=n.enter("label");const c=n.createTracker(r);let d=c.move("![");const h=n.safe(e.alt,{before:d,after:"]",...c.current()});d+=c.move(h+"]["),l();const p=n.stack;n.stack=[],l=n.enter("reference");const m=n.safe(n.associationId(e),{before:d,after:"]",...c.current()});return l(),n.stack=p,a(),s==="full"||!h||h!==m?d+=c.move(m+"]"):s==="shortcut"?d=d.slice(0,-1):d+=c.move("]"),d}function KM(){return"!"}mS.peek=XM;function mS(e,t,n){let r=e.value||"",s="`",a=-1;for(;new RegExp("(^|[^`])"+s+"([^`]|$)").test(r);)s+="`";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 h=d.index;r.charCodeAt(h)===10&&r.charCodeAt(h-1)===13&&h--,r=r.slice(0,h)+" "+r.slice(d.index+1)}}return s+r+s}function XM(){return"`"}function gS(e,t){const n=Op(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))}yS.peek=YM;function yS(e,t,n,r){const s=jp(n),a=s==='"'?"Quote":"Apostrophe",l=n.createTracker(r);let c,d;if(gS(e,n)){const p=n.stack;n.stack=[],c=n.enter("autolink");let m=l.move("<");return m+=l.move(n.containerPhrasing(e,{before:m,after:">",...l.current()})),m+=l.move(">"),c(),n.stack=p,m}c=n.enter("link"),d=n.enter("label");let h=l.move("[");return h+=l.move(n.containerPhrasing(e,{before:h,after:"](",...l.current()})),h+=l.move("]("),d(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(d=n.enter("destinationLiteral"),h+=l.move("<"),h+=l.move(n.safe(e.url,{before:h,after:">",...l.current()})),h+=l.move(">")):(d=n.enter("destinationRaw"),h+=l.move(n.safe(e.url,{before:h,after:e.title?" ":")",...l.current()}))),d(),e.title&&(d=n.enter(`title${a}`),h+=l.move(" "+s),h+=l.move(n.safe(e.title,{before:h,after:s,...l.current()})),h+=l.move(s),d()),h+=l.move(")"),c(),h}function YM(e,t,n){return gS(e,n)?"<":"["}vS.peek=QM;function vS(e,t,n,r){const s=e.referenceType,a=n.enter("linkReference");let l=n.enter("label");const c=n.createTracker(r);let d=c.move("[");const h=n.containerPhrasing(e,{before:d,after:"]",...c.current()});d+=c.move(h+"]["),l();const p=n.stack;n.stack=[],l=n.enter("reference");const m=n.safe(n.associationId(e),{before:d,after:"]",...c.current()});return l(),n.stack=p,a(),s==="full"||!h||h!==m?d+=c.move(m+"]"):s==="shortcut"?d=d.slice(0,-1):d+=c.move("]"),d}function QM(){return"["}function Fp(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 JM(e){const t=Fp(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 ZM(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 xS(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 eN(e,t,n,r){const s=n.enter("list"),a=n.bulletCurrent;let l=e.ordered?ZM(n):Fp(n);const c=e.ordered?l==="."?")":".":JM(n);let d=t&&n.bulletLastUsed?l===n.bulletLastUsed:!1;if(!e.ordered){const p=e.children?e.children[0]:void 0;if((l==="*"||l==="-")&&p&&(!p.children||!p.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),xS(n)===l&&p){let m=-1;for(;++m<e.children.length;){const y=e.children[m];if(y&&y.type==="listItem"&&y.children&&y.children[0]&&y.children[0].type==="thematicBreak"){d=!0;break}}}}d&&(l=c),n.bulletCurrent=l;const h=n.containerFlow(e,r);return n.bulletLastUsed=l,n.bulletCurrent=a,s(),h}function tN(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 nN(e,t,n,r){const s=tN(n);let a=n.bulletCurrent||Fp(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;(s==="tab"||s==="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"),h=n.indentLines(n.containerFlow(e,c.current()),p);return d(),h;function p(m,y,w){return y?(w?"":" ".repeat(l))+m:(w?a:a+" ".repeat(l-a.length))+m}}function rN(e,t,n,r){const s=n.enter("paragraph"),a=n.enter("phrasing"),l=n.containerPhrasing(e,r);return a(),s(),l}const iN=nc(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function sN(e,t,n,r){return(e.children.some(function(l){return iN(l)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}function oN(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}wS.peek=aN;function wS(e,t,n,r){const s=oN(n),a=n.enter("strong"),l=n.createTracker(r),c=l.move(s+s);let d=l.move(n.containerPhrasing(e,{after:s,before:c,...l.current()}));const h=d.charCodeAt(0),p=Nu(r.before.charCodeAt(r.before.length-1),h,s);p.inside&&(d=fa(h)+d.slice(1));const m=d.charCodeAt(d.length-1),y=Nu(r.after.charCodeAt(0),m,s);y.inside&&(d=d.slice(0,-1)+fa(m));const w=l.move(s+s);return a(),n.attentionEncodeSurroundingInfo={after:y.outside,before:p.outside},c+d+w}function aN(e,t,n){return n.options.strong||"*"}function lN(e,t,n,r){return n.safe(e.value,r)}function uN(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 cN(e,t,n){const r=(xS(n)+(n.options.ruleSpaces?" ":"")).repeat(uN(n));return n.options.ruleSpaces?r.slice(0,-1):r}const SS={blockquote:IM,break:N0,code:OM,definition:VM,emphasis:cS,hardBreak:N0,heading:WM,html:fS,image:hS,imageReference:pS,inlineCode:mS,link:yS,linkReference:vS,list:eN,listItem:nN,paragraph:rN,root:sN,strong:wS,text:lN,thematicBreak:cN},j0=document.createElement("i");function Vp(e){const t="&"+e+";";j0.innerHTML=t;const n=j0.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function kS(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 dN=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function fN(e){return e.replace(dN,hN)}function hN(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const s=n.charCodeAt(1),a=s===120||s===88;return kS(n.slice(a?2:1),a?16:10)}return Vp(n)||e}function pN(){return{enter:{table:mN,tableData:D0,tableHeader:D0,tableRow:yN},exit:{codeText:vN,table:gN,tableData:mf,tableHeader:mf,tableRow:mf}}}function mN(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 gN(e){this.exit(e),this.data.inTable=void 0}function yN(e){this.enter({type:"tableRow",children:[]},e)}function mf(e){this.exit(e)}function D0(e){this.enter({type:"tableCell",children:[]},e)}function vN(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,xN));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function xN(e,t){return t==="|"?t:e}function wN(e){const t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,s=t.stringLength,a=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
262
- `,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:y,table:l,tableCell:d,tableRow:c}};function l(w,k,b,E){return h(p(w,b,E),w.align)}function c(w,k,b,E){const P=m(w,b,E),R=h([P]);return R.slice(0,R.indexOf(`
263
- `))}function d(w,k,b,E){const P=b.enter("tableCell"),R=b.enter("phrasing"),_=b.containerPhrasing(w,{...E,before:a,after:a});return R(),P(),_}function h(w,k){return RM(w,{align:k,alignDelimiters:r,padding:n,stringLength:s})}function p(w,k,b){const E=w.children;let P=-1;const R=[],_=k.enter("table");for(;++P<E.length;)R[P]=m(E[P],k,b);return _(),R}function m(w,k,b){const E=w.children;let P=-1;const R=[],_=k.enter("tableRow");for(;++P<E.length;)R[P]=d(E[P],w,k,b);return _(),R}function y(w,k,b){let E=SS.inlineCode(w,k,b);return b.stack.includes("tableCell")&&(E=E.replace(/\|/g,"\\$&")),E}}function SN(){return{exit:{taskListCheckValueChecked:O0,taskListCheckValueUnchecked:O0,paragraph:CN}}}function kN(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:bN}}}function O0(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function CN(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 s=t.children;let a=-1,l;for(;++a<s.length;){const c=s[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 bN(e,t,n,r){const s=e.children[0],a=typeof e.checked=="boolean"&&s&&s.type==="paragraph",l="["+(e.checked?"x":" ")+"] ",c=n.createTracker(r);a&&c.move(l);let d=SS.listItem(e,t,n,{...r,...c.current()});return a&&(d=d.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,h)),d;function h(p){return p+l}}function CS(){return[JI(),xM(),CM(),pN(),SN()]}function EN(e){return{extensions:[ZI(),wM(e),bM(),wN(e),kN()]}}function Pn(e,t,n,r){const s=e.length;let a=0,l;if(t<0?t=-t>s?0:s+t:t=t>s?s: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 Dn(e,t){return e.length>0?(Pn(e,e.length,0,t),e):t}const F0={}.hasOwnProperty;function bS(e){const t={};let n=-1;for(;++n<e.length;)_N(t,e[n]);return t}function _N(e,t){let n;for(n in t){const s=(F0.call(e,n)?e[n]:void 0)||(e[n]={}),a=t[n];let l;if(a)for(l in a){F0.call(s,l)||(s[l]=[]);const c=a[l];PN(s[l],Array.isArray(c)?c:c?[c]:[])}}}function PN(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);Pn(e,0,0,r)}function Xs(e){const t=[];let n=-1,r=0,s=0;for(;++n<e.length;){const a=e.charCodeAt(n);let l="";if(a===37&&Jt(e.charCodeAt(n+1))&&Jt(e.charCodeAt(n+2)))s=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),s=1):l="�"}else l=String.fromCharCode(a);l&&(t.push(e.slice(r,n),encodeURIComponent(l)),r=n+s+1,l=""),s&&(n+=s,s=0)}return t.join("")+e.slice(r)}function We(e,t,n,r){const s=r?r-1:Number.POSITIVE_INFINITY;let a=0;return l;function l(d){return Be(d)?(e.enter(n),c(d)):t(d)}function c(d){return Be(d)&&a++<s?(e.consume(d),c):(e.exit(n),t(d))}}const TN={tokenize:RN};function RN(e){const t=e.attempt(this.parser.constructs.contentInitial,r,s);let n;return t;function r(c){if(c===null){e.consume(c);return}return e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),We(e,t,"linePrefix")}function s(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 Ne(c)?(e.consume(c),e.exit("chunkText"),a):(e.consume(c),l)}}const AN={tokenize:IN},V0={tokenize:MN};function IN(e){const t=this,n=[];let r=0,s,a,l;return c;function c(_){if(r<n.length){const j=n[r];return t.containerState=j[1],e.attempt(j[0].continuation,d,h)(_)}return h(_)}function d(_){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,s&&R();const j=t.events.length;let A=j,N;for(;A--;)if(t.events[A][0]==="exit"&&t.events[A][1].type==="chunkFlow"){N=t.events[A][1].end;break}P(r);let q=j;for(;q<t.events.length;)t.events[q][1].end={...N},q++;return Pn(t.events,A+1,0,t.events.slice(j)),t.events.length=q,h(_)}return c(_)}function h(_){if(r===n.length){if(!s)return y(_);if(s.currentConstruct&&s.currentConstruct.concrete)return k(_);t.interrupt=!!(s.currentConstruct&&!s._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(V0,p,m)(_)}function p(_){return s&&R(),P(r),y(_)}function m(_){return t.parser.lazy[t.now().line]=r!==n.length,l=t.now().offset,k(_)}function y(_){return t.containerState={},e.attempt(V0,w,k)(_)}function w(_){return r++,n.push([t.currentConstruct,t.containerState]),y(_)}function k(_){if(_===null){s&&R(),P(0),e.consume(_);return}return s=s||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:s,contentType:"flow",previous:a}),b(_)}function b(_){if(_===null){E(e.exit("chunkFlow"),!0),P(0),e.consume(_);return}return Ne(_)?(e.consume(_),E(e.exit("chunkFlow")),r=0,t.interrupt=void 0,c):(e.consume(_),b)}function E(_,j){const A=t.sliceStream(_);if(j&&A.push(null),_.previous=a,a&&(a.next=_),a=_,s.defineSkip(_.start),s.write(A),t.parser.lazy[_.start.line]){let N=s.events.length;for(;N--;)if(s.events[N][1].start.offset<l&&(!s.events[N][1].end||s.events[N][1].end.offset>l))return;const q=t.events.length;let B=q,D,I;for(;B--;)if(t.events[B][0]==="exit"&&t.events[B][1].type==="chunkFlow"){if(D){I=t.events[B][1].end;break}D=!0}for(P(r),N=q;N<t.events.length;)t.events[N][1].end={...I},N++;Pn(t.events,B+1,0,t.events.slice(q)),t.events.length=N}}function P(_){let j=n.length;for(;j-- >_;){const A=n[j];t.containerState=A[1],A[0].exit.call(t,e)}n.length=_}function R(){s.write([null]),a=void 0,s=void 0,t.containerState._closeFlow=void 0}}function MN(e,t,n){return We(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function ic(e,t,n){const r=[];let s=-1;for(;++s<e.length;){const a=e[s].resolveAll;a&&!r.includes(a)&&(t=a(t,n),r.push(a))}return t}const Eh={name:"attention",resolveAll:NN,tokenize:LN};function NN(e,t){let n=-1,r,s,a,l,c,d,h,p;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 m={...e[r][1].end},y={...e[n][1].start};z0(m,-d),z0(y,d),l={type:d>1?"strongSequence":"emphasisSequence",start:m,end:{...e[r][1].end}},c={type:d>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:y},a={type:d>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[n][1].start}},s={type:d>1?"strong":"emphasis",start:{...l.start},end:{...c.end}},e[r][1].end={...l.start},e[n][1].start={...c.end},h=[],e[r][1].end.offset-e[r][1].start.offset&&(h=Dn(h,[["enter",e[r][1],t],["exit",e[r][1],t]])),h=Dn(h,[["enter",s,t],["enter",l,t],["exit",l,t],["enter",a,t]]),h=Dn(h,ic(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),h=Dn(h,[["exit",a,t],["enter",c,t],["exit",c,t],["exit",s,t]]),e[n][1].end.offset-e[n][1].start.offset?(p=2,h=Dn(h,[["enter",e[n][1],t],["exit",e[n][1],t]])):p=0,Pn(e,r-1,n-r+3,h),n=r+h.length-p-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function LN(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,s=$s(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 h=e.exit("attentionSequence"),p=$s(d),m=!p||p===2&&s||n.includes(d),y=!s||s===2&&p||n.includes(r);return h._open=!!(a===42?m:m&&(s||!y)),h._close=!!(a===42?y:y&&(p||!m)),t(d)}}function z0(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const jN={name:"autolink",tokenize:DN};function DN(e,t,n){let r=0;return s;function s(w){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(w),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),a}function a(w){return on(w)?(e.consume(w),l):w===64?n(w):h(w)}function l(w){return w===43||w===45||w===46||Jt(w)?(r=1,c(w)):h(w)}function c(w){return w===58?(e.consume(w),r=0,d):(w===43||w===45||w===46||Jt(w))&&r++<32?(e.consume(w),c):(r=0,h(w))}function d(w){return w===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(w),e.exit("autolinkMarker"),e.exit("autolink"),t):w===null||w===32||w===60||Mu(w)?n(w):(e.consume(w),d)}function h(w){return w===64?(e.consume(w),p):DI(w)?(e.consume(w),h):n(w)}function p(w){return Jt(w)?m(w):n(w)}function m(w){return w===46?(e.consume(w),r=0,p):w===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(w),e.exit("autolinkMarker"),e.exit("autolink"),t):y(w)}function y(w){if((w===45||Jt(w))&&r++<63){const k=w===45?y:m;return e.consume(w),k}return n(w)}}const Ca={partial:!0,tokenize:ON};function ON(e,t,n){return r;function r(a){return Be(a)?We(e,s,"linePrefix")(a):s(a)}function s(a){return a===null||Ne(a)?t(a):n(a)}}const ES={continuation:{tokenize:VN},exit:zN,name:"blockQuote",tokenize:FN};function FN(e,t,n){const r=this;return s;function s(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 Be(l)?(e.enter("blockQuotePrefixWhitespace"),e.consume(l),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(l))}}function VN(e,t,n){const r=this;return s;function s(l){return Be(l)?We(e,a,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(l):a(l)}function a(l){return e.attempt(ES,t,n)(l)}}function zN(e){e.exit("blockQuote")}const _S={name:"characterEscape",tokenize:BN};function BN(e,t,n){return r;function r(a){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(a),e.exit("escapeMarker"),s}function s(a){return FI(a)?(e.enter("characterEscapeValue"),e.consume(a),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(a)}}const PS={name:"characterReference",tokenize:UN};function UN(e,t,n){const r=this;let s=0,a,l;return c;function c(m){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(m),e.exit("characterReferenceMarker"),d}function d(m){return m===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(m),e.exit("characterReferenceMarkerNumeric"),h):(e.enter("characterReferenceValue"),a=31,l=Jt,p(m))}function h(m){return m===88||m===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(m),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),a=6,l=OI,p):(e.enter("characterReferenceValue"),a=7,l=Ch,p(m))}function p(m){if(m===59&&s){const y=e.exit("characterReferenceValue");return l===Jt&&!Vp(r.sliceSerialize(y))?n(m):(e.enter("characterReferenceMarker"),e.consume(m),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return l(m)&&s++<a?(e.consume(m),p):n(m)}}const B0={partial:!0,tokenize:HN},U0={concrete:!0,name:"codeFenced",tokenize:$N};function $N(e,t,n){const r=this,s={partial:!0,tokenize:A};let a=0,l=0,c;return d;function d(N){return h(N)}function h(N){const q=r.events[r.events.length-1];return a=q&&q[1].type==="linePrefix"?q[2].sliceSerialize(q[1],!0).length:0,c=N,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),p(N)}function p(N){return N===c?(l++,e.consume(N),p):l<3?n(N):(e.exit("codeFencedFenceSequence"),Be(N)?We(e,m,"whitespace")(N):m(N))}function m(N){return N===null||Ne(N)?(e.exit("codeFencedFence"),r.interrupt?t(N):e.check(B0,b,j)(N)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),y(N))}function y(N){return N===null||Ne(N)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),m(N)):Be(N)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),We(e,w,"whitespace")(N)):N===96&&N===c?n(N):(e.consume(N),y)}function w(N){return N===null||Ne(N)?m(N):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),k(N))}function k(N){return N===null||Ne(N)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),m(N)):N===96&&N===c?n(N):(e.consume(N),k)}function b(N){return e.attempt(s,j,E)(N)}function E(N){return e.enter("lineEnding"),e.consume(N),e.exit("lineEnding"),P}function P(N){return a>0&&Be(N)?We(e,R,"linePrefix",a+1)(N):R(N)}function R(N){return N===null||Ne(N)?e.check(B0,b,j)(N):(e.enter("codeFlowValue"),_(N))}function _(N){return N===null||Ne(N)?(e.exit("codeFlowValue"),R(N)):(e.consume(N),_)}function j(N){return e.exit("codeFenced"),t(N)}function A(N,q,B){let D=0;return I;function I(Z){return N.enter("lineEnding"),N.consume(Z),N.exit("lineEnding"),U}function U(Z){return N.enter("codeFencedFence"),Be(Z)?We(N,z,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(Z):z(Z)}function z(Z){return Z===c?(N.enter("codeFencedFenceSequence"),he(Z)):B(Z)}function he(Z){return Z===c?(D++,N.consume(Z),he):D>=l?(N.exit("codeFencedFenceSequence"),Be(Z)?We(N,J,"whitespace")(Z):J(Z)):B(Z)}function J(Z){return Z===null||Ne(Z)?(N.exit("codeFencedFence"),q(Z)):B(Z)}}}function HN(e,t,n){const r=this;return s;function s(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 gf={name:"codeIndented",tokenize:qN},WN={partial:!0,tokenize:GN};function qN(e,t,n){const r=this;return s;function s(h){return e.enter("codeIndented"),We(e,a,"linePrefix",5)(h)}function a(h){const p=r.events[r.events.length-1];return p&&p[1].type==="linePrefix"&&p[2].sliceSerialize(p[1],!0).length>=4?l(h):n(h)}function l(h){return h===null?d(h):Ne(h)?e.attempt(WN,l,d)(h):(e.enter("codeFlowValue"),c(h))}function c(h){return h===null||Ne(h)?(e.exit("codeFlowValue"),l(h)):(e.consume(h),c)}function d(h){return e.exit("codeIndented"),t(h)}}function GN(e,t,n){const r=this;return s;function s(l){return r.parser.lazy[r.now().line]?n(l):Ne(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),s):We(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):Ne(l)?s(l):n(l)}}const KN={name:"codeText",previous:YN,resolve:XN,tokenize:QN};function XN(e){let t=e.length-4,n=3,r,s;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;)s===void 0?r!==t&&e[r][1].type!=="lineEnding"&&(s=r):(r===t||e[r][1].type==="lineEnding")&&(e[s][1].type="codeTextData",r!==s+2&&(e[s][1].end=e[r-1][1].end,e.splice(s+2,r-s-2),t-=r-s-2,r=s+2),s=void 0);return e}function YN(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function QN(e,t,n){let r=0,s,a;return l;function l(m){return e.enter("codeText"),e.enter("codeTextSequence"),c(m)}function c(m){return m===96?(e.consume(m),r++,c):(e.exit("codeTextSequence"),d(m))}function d(m){return m===null?n(m):m===32?(e.enter("space"),e.consume(m),e.exit("space"),d):m===96?(a=e.enter("codeTextSequence"),s=0,p(m)):Ne(m)?(e.enter("lineEnding"),e.consume(m),e.exit("lineEnding"),d):(e.enter("codeTextData"),h(m))}function h(m){return m===null||m===32||m===96||Ne(m)?(e.exit("codeTextData"),d(m)):(e.consume(m),h)}function p(m){return m===96?(e.consume(m),s++,p):s===r?(e.exit("codeTextSequence"),e.exit("codeText"),t(m)):(a.type="codeTextData",h(m))}}class JN{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 s=n||0;this.setCursor(Math.trunc(t));const a=this.right.splice(this.right.length-s,Number.POSITIVE_INFINITY);return r&&Fo(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),Fo(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),Fo(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);Fo(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);Fo(this.left,n.reverse())}}}function Fo(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 TS(e){const t={};let n=-1,r,s,a,l,c,d,h;const p=new JN(e);for(;++n<p.length;){for(;n in t;)n=t[n];if(r=p.get(n),n&&r[1].type==="chunkFlow"&&p.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,ZN(p,n)),n=t[n],h=!0);else if(r[1]._container){for(a=n,s=void 0;a--;)if(l=p.get(a),l[1].type==="lineEnding"||l[1].type==="lineEndingBlank")l[0]==="enter"&&(s&&(p.get(s)[1].type="lineEndingBlank"),l[1].type="lineEnding",s=a);else if(!(l[1].type==="linePrefix"||l[1].type==="listItemIndent"))break;s&&(r[1].end={...p.get(s)[1].start},c=p.slice(s,n),c.unshift(r),p.splice(s,n-s+1,c))}}return Pn(e,0,Number.POSITIVE_INFINITY,p.slice(0)),!h}function ZN(e,t){const n=e.get(t)[1],r=e.get(t)[2];let s=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=[],h={};let p,m,y=-1,w=n,k=0,b=0;const E=[b];for(;w;){for(;e.get(++s)[1]!==w;);a.push(s),w._tokenizer||(p=r.sliceStream(w),w.next||p.push(null),m&&l.defineSkip(w.start),w._isInFirstContentOfListItem&&(l._gfmTasklistFirstContentOfListItem=!0),l.write(p),w._isInFirstContentOfListItem&&(l._gfmTasklistFirstContentOfListItem=void 0)),m=w,w=w.next}for(w=n;++y<c.length;)c[y][0]==="exit"&&c[y-1][0]==="enter"&&c[y][1].type===c[y-1][1].type&&c[y][1].start.line!==c[y][1].end.line&&(b=y+1,E.push(b),w._tokenizer=void 0,w.previous=void 0,w=w.next);for(l.events=[],w?(w._tokenizer=void 0,w.previous=void 0):E.pop(),y=E.length;y--;){const P=c.slice(E[y],E[y+1]),R=a.pop();d.push([R,R+P.length-1]),e.splice(R,2,P)}for(d.reverse(),y=-1;++y<d.length;)h[k+d[y][0]]=k+d[y][1],k+=d[y][1]-d[y][0]-1;return h}const eL={resolve:nL,tokenize:rL},tL={partial:!0,tokenize:iL};function nL(e){return TS(e),e}function rL(e,t){let n;return r;function r(c){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),s(c)}function s(c){return c===null?a(c):Ne(c)?e.check(tL,l,a)(c):(e.consume(c),s)}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,s}}function iL(e,t,n){const r=this;return s;function s(l){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),We(e,a,"linePrefix")}function a(l){if(l===null||Ne(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 RS(e,t,n,r,s,a,l,c,d){const h=d||Number.POSITIVE_INFINITY;let p=0;return m;function m(P){return P===60?(e.enter(r),e.enter(s),e.enter(a),e.consume(P),e.exit(a),y):P===null||P===32||P===41||Mu(P)?n(P):(e.enter(r),e.enter(l),e.enter(c),e.enter("chunkString",{contentType:"string"}),b(P))}function y(P){return P===62?(e.enter(a),e.consume(P),e.exit(a),e.exit(s),e.exit(r),t):(e.enter(c),e.enter("chunkString",{contentType:"string"}),w(P))}function w(P){return P===62?(e.exit("chunkString"),e.exit(c),y(P)):P===null||P===60||Ne(P)?n(P):(e.consume(P),P===92?k:w)}function k(P){return P===60||P===62||P===92?(e.consume(P),w):w(P)}function b(P){return!p&&(P===null||P===41||it(P))?(e.exit("chunkString"),e.exit(c),e.exit(l),e.exit(r),t(P)):p<h&&P===40?(e.consume(P),p++,b):P===41?(e.consume(P),p--,b):P===null||P===32||P===40||Mu(P)?n(P):(e.consume(P),P===92?E:b)}function E(P){return P===40||P===41||P===92?(e.consume(P),b):b(P)}}function AS(e,t,n,r,s,a){const l=this;let c=0,d;return h;function h(w){return e.enter(r),e.enter(s),e.consume(w),e.exit(s),e.enter(a),p}function p(w){return c>999||w===null||w===91||w===93&&!d||w===94&&!c&&"_hiddenFootnoteSupport"in l.parser.constructs?n(w):w===93?(e.exit(a),e.enter(s),e.consume(w),e.exit(s),e.exit(r),t):Ne(w)?(e.enter("lineEnding"),e.consume(w),e.exit("lineEnding"),p):(e.enter("chunkString",{contentType:"string"}),m(w))}function m(w){return w===null||w===91||w===93||Ne(w)||c++>999?(e.exit("chunkString"),p(w)):(e.consume(w),d||(d=!Be(w)),w===92?y:m)}function y(w){return w===91||w===92||w===93?(e.consume(w),c++,m):m(w)}}function IS(e,t,n,r,s,a){let l;return c;function c(y){return y===34||y===39||y===40?(e.enter(r),e.enter(s),e.consume(y),e.exit(s),l=y===40?41:y,d):n(y)}function d(y){return y===l?(e.enter(s),e.consume(y),e.exit(s),e.exit(r),t):(e.enter(a),h(y))}function h(y){return y===l?(e.exit(a),d(l)):y===null?n(y):Ne(y)?(e.enter("lineEnding"),e.consume(y),e.exit("lineEnding"),We(e,h,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),p(y))}function p(y){return y===l||y===null||Ne(y)?(e.exit("chunkString"),h(y)):(e.consume(y),y===92?m:p)}function m(y){return y===l||y===92?(e.consume(y),p):p(y)}}function Qo(e,t){let n;return r;function r(s){return Ne(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),n=!0,r):Be(s)?We(e,r,n?"linePrefix":"lineSuffix")(s):t(s)}}const sL={name:"definition",tokenize:aL},oL={partial:!0,tokenize:lL};function aL(e,t,n){const r=this;let s;return a;function a(w){return e.enter("definition"),l(w)}function l(w){return AS.call(r,e,c,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(w)}function c(w){return s=Zn(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),w===58?(e.enter("definitionMarker"),e.consume(w),e.exit("definitionMarker"),d):n(w)}function d(w){return it(w)?Qo(e,h)(w):h(w)}function h(w){return RS(e,p,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(w)}function p(w){return e.attempt(oL,m,m)(w)}function m(w){return Be(w)?We(e,y,"whitespace")(w):y(w)}function y(w){return w===null||Ne(w)?(e.exit("definition"),r.parser.defined.push(s),t(w)):n(w)}}function lL(e,t,n){return r;function r(c){return it(c)?Qo(e,s)(c):n(c)}function s(c){return IS(e,a,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(c)}function a(c){return Be(c)?We(e,l,"whitespace")(c):l(c)}function l(c){return c===null||Ne(c)?t(c):n(c)}}const uL={name:"hardBreakEscape",tokenize:cL};function cL(e,t,n){return r;function r(a){return e.enter("hardBreakEscape"),e.consume(a),s}function s(a){return Ne(a)?(e.exit("hardBreakEscape"),t(a)):n(a)}}const dL={name:"headingAtx",resolve:fL,tokenize:hL};function fL(e,t){let n=e.length-2,r=3,s,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&&(s={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"},Pn(e,r,n-r+1,[["enter",s,t],["enter",a,t],["exit",a,t],["exit",s,t]])),e}function hL(e,t,n){let r=0;return s;function s(p){return e.enter("atxHeading"),a(p)}function a(p){return e.enter("atxHeadingSequence"),l(p)}function l(p){return p===35&&r++<6?(e.consume(p),l):p===null||it(p)?(e.exit("atxHeadingSequence"),c(p)):n(p)}function c(p){return p===35?(e.enter("atxHeadingSequence"),d(p)):p===null||Ne(p)?(e.exit("atxHeading"),t(p)):Be(p)?We(e,c,"whitespace")(p):(e.enter("atxHeadingText"),h(p))}function d(p){return p===35?(e.consume(p),d):(e.exit("atxHeadingSequence"),c(p))}function h(p){return p===null||p===35||it(p)?(e.exit("atxHeadingText"),c(p)):(e.consume(p),h)}}const pL=["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"],$0=["pre","script","style","textarea"],mL={concrete:!0,name:"htmlFlow",resolveTo:vL,tokenize:xL},gL={partial:!0,tokenize:SL},yL={partial:!0,tokenize:wL};function vL(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 xL(e,t,n){const r=this;let s,a,l,c,d;return h;function h(M){return p(M)}function p(M){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(M),m}function m(M){return M===33?(e.consume(M),y):M===47?(e.consume(M),a=!0,b):M===63?(e.consume(M),s=3,r.interrupt?t:T):on(M)?(e.consume(M),l=String.fromCharCode(M),E):n(M)}function y(M){return M===45?(e.consume(M),s=2,w):M===91?(e.consume(M),s=5,c=0,k):on(M)?(e.consume(M),s=4,r.interrupt?t:T):n(M)}function w(M){return M===45?(e.consume(M),r.interrupt?t:T):n(M)}function k(M){const oe="CDATA[";return M===oe.charCodeAt(c++)?(e.consume(M),c===oe.length?r.interrupt?t:z:k):n(M)}function b(M){return on(M)?(e.consume(M),l=String.fromCharCode(M),E):n(M)}function E(M){if(M===null||M===47||M===62||it(M)){const oe=M===47,ue=l.toLowerCase();return!oe&&!a&&$0.includes(ue)?(s=1,r.interrupt?t(M):z(M)):pL.includes(l.toLowerCase())?(s=6,oe?(e.consume(M),P):r.interrupt?t(M):z(M)):(s=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(M):a?R(M):_(M))}return M===45||Jt(M)?(e.consume(M),l+=String.fromCharCode(M),E):n(M)}function P(M){return M===62?(e.consume(M),r.interrupt?t:z):n(M)}function R(M){return Be(M)?(e.consume(M),R):I(M)}function _(M){return M===47?(e.consume(M),I):M===58||M===95||on(M)?(e.consume(M),j):Be(M)?(e.consume(M),_):I(M)}function j(M){return M===45||M===46||M===58||M===95||Jt(M)?(e.consume(M),j):A(M)}function A(M){return M===61?(e.consume(M),N):Be(M)?(e.consume(M),A):_(M)}function N(M){return M===null||M===60||M===61||M===62||M===96?n(M):M===34||M===39?(e.consume(M),d=M,q):Be(M)?(e.consume(M),N):B(M)}function q(M){return M===d?(e.consume(M),d=null,D):M===null||Ne(M)?n(M):(e.consume(M),q)}function B(M){return M===null||M===34||M===39||M===47||M===60||M===61||M===62||M===96||it(M)?A(M):(e.consume(M),B)}function D(M){return M===47||M===62||Be(M)?_(M):n(M)}function I(M){return M===62?(e.consume(M),U):n(M)}function U(M){return M===null||Ne(M)?z(M):Be(M)?(e.consume(M),U):n(M)}function z(M){return M===45&&s===2?(e.consume(M),ve):M===60&&s===1?(e.consume(M),Se):M===62&&s===4?(e.consume(M),F):M===63&&s===3?(e.consume(M),T):M===93&&s===5?(e.consume(M),pe):Ne(M)&&(s===6||s===7)?(e.exit("htmlFlowData"),e.check(gL,X,he)(M)):M===null||Ne(M)?(e.exit("htmlFlowData"),he(M)):(e.consume(M),z)}function he(M){return e.check(yL,J,X)(M)}function J(M){return e.enter("lineEnding"),e.consume(M),e.exit("lineEnding"),Z}function Z(M){return M===null||Ne(M)?he(M):(e.enter("htmlFlowData"),z(M))}function ve(M){return M===45?(e.consume(M),T):z(M)}function Se(M){return M===47?(e.consume(M),l="",Q):z(M)}function Q(M){if(M===62){const oe=l.toLowerCase();return $0.includes(oe)?(e.consume(M),F):z(M)}return on(M)&&l.length<8?(e.consume(M),l+=String.fromCharCode(M),Q):z(M)}function pe(M){return M===93?(e.consume(M),T):z(M)}function T(M){return M===62?(e.consume(M),F):M===45&&s===2?(e.consume(M),T):z(M)}function F(M){return M===null||Ne(M)?(e.exit("htmlFlowData"),X(M)):(e.consume(M),F)}function X(M){return e.exit("htmlFlow"),t(M)}}function wL(e,t,n){const r=this;return s;function s(l){return Ne(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 SL(e,t,n){return r;function r(s){return e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),e.attempt(Ca,t,n)}}const kL={name:"htmlText",tokenize:CL};function CL(e,t,n){const r=this;let s,a,l;return c;function c(T){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(T),d}function d(T){return T===33?(e.consume(T),h):T===47?(e.consume(T),A):T===63?(e.consume(T),_):on(T)?(e.consume(T),B):n(T)}function h(T){return T===45?(e.consume(T),p):T===91?(e.consume(T),a=0,k):on(T)?(e.consume(T),R):n(T)}function p(T){return T===45?(e.consume(T),w):n(T)}function m(T){return T===null?n(T):T===45?(e.consume(T),y):Ne(T)?(l=m,Se(T)):(e.consume(T),m)}function y(T){return T===45?(e.consume(T),w):m(T)}function w(T){return T===62?ve(T):T===45?y(T):m(T)}function k(T){const F="CDATA[";return T===F.charCodeAt(a++)?(e.consume(T),a===F.length?b:k):n(T)}function b(T){return T===null?n(T):T===93?(e.consume(T),E):Ne(T)?(l=b,Se(T)):(e.consume(T),b)}function E(T){return T===93?(e.consume(T),P):b(T)}function P(T){return T===62?ve(T):T===93?(e.consume(T),P):b(T)}function R(T){return T===null||T===62?ve(T):Ne(T)?(l=R,Se(T)):(e.consume(T),R)}function _(T){return T===null?n(T):T===63?(e.consume(T),j):Ne(T)?(l=_,Se(T)):(e.consume(T),_)}function j(T){return T===62?ve(T):_(T)}function A(T){return on(T)?(e.consume(T),N):n(T)}function N(T){return T===45||Jt(T)?(e.consume(T),N):q(T)}function q(T){return Ne(T)?(l=q,Se(T)):Be(T)?(e.consume(T),q):ve(T)}function B(T){return T===45||Jt(T)?(e.consume(T),B):T===47||T===62||it(T)?D(T):n(T)}function D(T){return T===47?(e.consume(T),ve):T===58||T===95||on(T)?(e.consume(T),I):Ne(T)?(l=D,Se(T)):Be(T)?(e.consume(T),D):ve(T)}function I(T){return T===45||T===46||T===58||T===95||Jt(T)?(e.consume(T),I):U(T)}function U(T){return T===61?(e.consume(T),z):Ne(T)?(l=U,Se(T)):Be(T)?(e.consume(T),U):D(T)}function z(T){return T===null||T===60||T===61||T===62||T===96?n(T):T===34||T===39?(e.consume(T),s=T,he):Ne(T)?(l=z,Se(T)):Be(T)?(e.consume(T),z):(e.consume(T),J)}function he(T){return T===s?(e.consume(T),s=void 0,Z):T===null?n(T):Ne(T)?(l=he,Se(T)):(e.consume(T),he)}function J(T){return T===null||T===34||T===39||T===60||T===61||T===96?n(T):T===47||T===62||it(T)?D(T):(e.consume(T),J)}function Z(T){return T===47||T===62||it(T)?D(T):n(T)}function ve(T){return T===62?(e.consume(T),e.exit("htmlTextData"),e.exit("htmlText"),t):n(T)}function Se(T){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(T),e.exit("lineEnding"),Q}function Q(T){return Be(T)?We(e,pe,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(T):pe(T)}function pe(T){return e.enter("htmlTextData"),l(T)}}const zp={name:"labelEnd",resolveAll:PL,resolveTo:TL,tokenize:RL},bL={tokenize:AL},EL={tokenize:IL},_L={tokenize:ML};function PL(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 s=r.type==="labelImage"?4:2;r.type="data",t+=s}}return e.length!==n.length&&Pn(e,0,e.length,n),e}function TL(e,t){let n=e.length,r=0,s,a,l,c;for(;n--;)if(s=e[n][1],a){if(s.type==="link"||s.type==="labelLink"&&s._inactive)break;e[n][0]==="enter"&&s.type==="labelLink"&&(s._inactive=!0)}else if(l){if(e[n][0]==="enter"&&(s.type==="labelImage"||s.type==="labelLink")&&!s._balanced&&(a=n,s.type!=="labelLink")){r=2;break}}else s.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}},h={type:"label",start:{...e[a][1].start},end:{...e[l][1].end}},p={type:"labelText",start:{...e[a+r+2][1].end},end:{...e[l-2][1].start}};return c=[["enter",d,t],["enter",h,t]],c=Dn(c,e.slice(a+1,a+r+3)),c=Dn(c,[["enter",p,t]]),c=Dn(c,ic(t.parser.constructs.insideSpan.null,e.slice(a+r+4,l-3),t)),c=Dn(c,[["exit",p,t],e[l-2],e[l-1],["exit",h,t]]),c=Dn(c,e.slice(l+1)),c=Dn(c,[["exit",d,t]]),Pn(e,a,e.length,c),e}function RL(e,t,n){const r=this;let s=r.events.length,a,l;for(;s--;)if((r.events[s][1].type==="labelImage"||r.events[s][1].type==="labelLink")&&!r.events[s][1]._balanced){a=r.events[s][1];break}return c;function c(y){return a?a._inactive?m(y):(l=r.parser.defined.includes(Zn(r.sliceSerialize({start:a.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(y),e.exit("labelMarker"),e.exit("labelEnd"),d):n(y)}function d(y){return y===40?e.attempt(bL,p,l?p:m)(y):y===91?e.attempt(EL,p,l?h:m)(y):l?p(y):m(y)}function h(y){return e.attempt(_L,p,m)(y)}function p(y){return t(y)}function m(y){return a._balanced=!0,n(y)}}function AL(e,t,n){return r;function r(m){return e.enter("resource"),e.enter("resourceMarker"),e.consume(m),e.exit("resourceMarker"),s}function s(m){return it(m)?Qo(e,a)(m):a(m)}function a(m){return m===41?p(m):RS(e,l,c,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(m)}function l(m){return it(m)?Qo(e,d)(m):p(m)}function c(m){return n(m)}function d(m){return m===34||m===39||m===40?IS(e,h,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(m):p(m)}function h(m){return it(m)?Qo(e,p)(m):p(m)}function p(m){return m===41?(e.enter("resourceMarker"),e.consume(m),e.exit("resourceMarker"),e.exit("resource"),t):n(m)}}function IL(e,t,n){const r=this;return s;function s(c){return AS.call(r,e,a,l,"reference","referenceMarker","referenceString")(c)}function a(c){return r.parser.defined.includes(Zn(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(c):n(c)}function l(c){return n(c)}}function ML(e,t,n){return r;function r(a){return e.enter("reference"),e.enter("referenceMarker"),e.consume(a),e.exit("referenceMarker"),s}function s(a){return a===93?(e.enter("referenceMarker"),e.consume(a),e.exit("referenceMarker"),e.exit("reference"),t):n(a)}}const NL={name:"labelStartImage",resolveAll:zp.resolveAll,tokenize:LL};function LL(e,t,n){const r=this;return s;function s(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 jL={name:"labelStartLink",resolveAll:zp.resolveAll,tokenize:DL};function DL(e,t,n){const r=this;return s;function s(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 yf={name:"lineEnding",tokenize:OL};function OL(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),We(e,t,"linePrefix")}}const cu={name:"thematicBreak",tokenize:FL};function FL(e,t,n){let r=0,s;return a;function a(h){return e.enter("thematicBreak"),l(h)}function l(h){return s=h,c(h)}function c(h){return h===s?(e.enter("thematicBreakSequence"),d(h)):r>=3&&(h===null||Ne(h))?(e.exit("thematicBreak"),t(h)):n(h)}function d(h){return h===s?(e.consume(h),r++,d):(e.exit("thematicBreakSequence"),Be(h)?We(e,c,"whitespace")(h):c(h))}}const yn={continuation:{tokenize:UL},exit:HL,name:"list",tokenize:BL},VL={partial:!0,tokenize:WL},zL={partial:!0,tokenize:$L};function BL(e,t,n){const r=this,s=r.events[r.events.length-1];let a=s&&s[1].type==="linePrefix"?s[2].sliceSerialize(s[1],!0).length:0,l=0;return c;function c(w){const k=r.containerState.type||(w===42||w===43||w===45?"listUnordered":"listOrdered");if(k==="listUnordered"?!r.containerState.marker||w===r.containerState.marker:Ch(w)){if(r.containerState.type||(r.containerState.type=k,e.enter(k,{_container:!0})),k==="listUnordered")return e.enter("listItemPrefix"),w===42||w===45?e.check(cu,n,h)(w):h(w);if(!r.interrupt||w===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),d(w)}return n(w)}function d(w){return Ch(w)&&++l<10?(e.consume(w),d):(!r.interrupt||l<2)&&(r.containerState.marker?w===r.containerState.marker:w===41||w===46)?(e.exit("listItemValue"),h(w)):n(w)}function h(w){return e.enter("listItemMarker"),e.consume(w),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||w,e.check(Ca,r.interrupt?n:p,e.attempt(VL,y,m))}function p(w){return r.containerState.initialBlankLine=!0,a++,y(w)}function m(w){return Be(w)?(e.enter("listItemPrefixWhitespace"),e.consume(w),e.exit("listItemPrefixWhitespace"),y):n(w)}function y(w){return r.containerState.size=a+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(w)}}function UL(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(Ca,s,a);function s(c){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,We(e,t,"listItemIndent",r.containerState.size+1)(c)}function a(c){return r.containerState.furtherBlankLines||!Be(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(zL,t,l)(c))}function l(c){return r.containerState._closeFlow=!0,r.interrupt=void 0,We(e,e.attempt(yn,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(c)}}function $L(e,t,n){const r=this;return We(e,s,"listItemIndent",r.containerState.size+1);function s(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 HL(e){e.exit(this.containerState.type)}function WL(e,t,n){const r=this;return We(e,s,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function s(a){const l=r.events[r.events.length-1];return!Be(a)&&l&&l[1].type==="listItemPrefixWhitespace"?t(a):n(a)}}const H0={name:"setextUnderline",resolveTo:qL,tokenize:GL};function qL(e,t){let n=e.length,r,s,a;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){r=n;break}e[n][1].type==="paragraph"&&(s=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[s][1].type="setextHeadingText",a?(e.splice(s,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 GL(e,t,n){const r=this;let s;return a;function a(h){let p=r.events.length,m;for(;p--;)if(r.events[p][1].type!=="lineEnding"&&r.events[p][1].type!=="linePrefix"&&r.events[p][1].type!=="content"){m=r.events[p][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||m)?(e.enter("setextHeadingLine"),s=h,l(h)):n(h)}function l(h){return e.enter("setextHeadingLineSequence"),c(h)}function c(h){return h===s?(e.consume(h),c):(e.exit("setextHeadingLineSequence"),Be(h)?We(e,d,"lineSuffix")(h):d(h))}function d(h){return h===null||Ne(h)?(e.exit("setextHeadingLine"),t(h)):n(h)}}const KL={tokenize:XL};function XL(e){const t=this,n=e.attempt(Ca,r,e.attempt(this.parser.constructs.flowInitial,s,We(e,e.attempt(this.parser.constructs.flow,s,e.attempt(eL,s)),"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 s(a){if(a===null){e.consume(a);return}return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const YL={resolveAll:NS()},QL=MS("string"),JL=MS("text");function MS(e){return{resolveAll:NS(e==="text"?ZL:void 0),tokenize:t};function t(n){const r=this,s=this.parser.constructs[e],a=n.attempt(s,l,c);return l;function l(p){return h(p)?a(p):c(p)}function c(p){if(p===null){n.consume(p);return}return n.enter("data"),n.consume(p),d}function d(p){return h(p)?(n.exit("data"),a(p)):(n.consume(p),d)}function h(p){if(p===null)return!0;const m=s[p];let y=-1;if(m)for(;++y<m.length;){const w=m[y];if(!w.previous||w.previous.call(r,r.previous))return!0}return!1}}}function NS(e){return t;function t(n,r){let s=-1,a;for(;++s<=n.length;)a===void 0?n[s]&&n[s][1].type==="data"&&(a=s,s++):(!n[s]||n[s][1].type!=="data")&&(s!==a+2&&(n[a][1].end=n[s-1][1].end,n.splice(a+2,s-a-2),s=a+2),a=void 0);return e?e(n,r):n}}function ZL(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],s=t.sliceStream(r);let a=s.length,l=-1,c=0,d;for(;a--;){const h=s[a];if(typeof h=="string"){for(l=h.length;h.charCodeAt(l-1)===32;)c++,l--;if(l)break;l=-1}else if(h===-2)d=!0,c++;else if(h!==-1){a++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(c=0),c){const h={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={...h.start},r.start.offset===r.end.offset?Object.assign(r,h):(e.splice(n,0,["enter",h,t],["exit",h,t]),n+=2)}n++}return e}const ej={42:yn,43:yn,45:yn,48:yn,49:yn,50:yn,51:yn,52:yn,53:yn,54:yn,55:yn,56:yn,57:yn,62:ES},tj={91:sL},nj={[-2]:gf,[-1]:gf,32:gf},rj={35:dL,42:cu,45:[H0,cu],60:mL,61:H0,95:cu,96:U0,126:U0},ij={38:PS,92:_S},sj={[-5]:yf,[-4]:yf,[-3]:yf,33:NL,38:PS,42:Eh,60:[jN,kL],91:jL,92:[uL,_S],93:zp,95:Eh,96:KN},oj={null:[Eh,YL]},aj={null:[42,95]},lj={null:[]},uj=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:aj,contentInitial:tj,disable:lj,document:ej,flow:rj,flowInitial:nj,insideSpan:oj,string:ij,text:sj},Symbol.toStringTag,{value:"Module"}));function cj(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 s={},a=[];let l=[],c=[];const d={attempt:q(A),check:q(N),consume:R,enter:_,exit:j,interrupt:q(N,{interrupt:!0})},h={code:null,containerState:{},defineSkip:b,events:[],now:k,parser:e,previous:null,sliceSerialize:y,sliceStream:w,write:m};let p=t.tokenize.call(h,d);return t.resolveAll&&a.push(t),h;function m(U){return l=Dn(l,U),E(),l[l.length-1]!==null?[]:(B(t,0),h.events=ic(a,h.events,h),h.events)}function y(U,z){return fj(w(U),z)}function w(U){return dj(l,U)}function k(){const{_bufferIndex:U,_index:z,line:he,column:J,offset:Z}=r;return{_bufferIndex:U,_index:z,line:he,column:J,offset:Z}}function b(U){s[U.line]=U.column,I()}function E(){let U;for(;r._index<l.length;){const z=l[r._index];if(typeof z=="string")for(U=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===U&&r._bufferIndex<z.length;)P(z.charCodeAt(r._bufferIndex));else P(z)}}function P(U){p=p(U)}function R(U){Ne(U)?(r.line++,r.column=1,r.offset+=U===-3?2:1,I()):U!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===l[r._index].length&&(r._bufferIndex=-1,r._index++)),h.previous=U}function _(U,z){const he=z||{};return he.type=U,he.start=k(),h.events.push(["enter",he,h]),c.push(he),he}function j(U){const z=c.pop();return z.end=k(),h.events.push(["exit",z,h]),z}function A(U,z){B(U,z.from)}function N(U,z){z.restore()}function q(U,z){return he;function he(J,Z,ve){let Se,Q,pe,T;return Array.isArray(J)?X(J):"tokenize"in J?X([J]):F(J);function F(ae){return me;function me(ke){const xe=ke!==null&&ae[ke],$e=ke!==null&&ae.null,Fe=[...Array.isArray(xe)?xe:xe?[xe]:[],...Array.isArray($e)?$e:$e?[$e]:[]];return X(Fe)(ke)}}function X(ae){return Se=ae,Q=0,ae.length===0?ve:M(ae[Q])}function M(ae){return me;function me(ke){return T=D(),pe=ae,ae.partial||(h.currentConstruct=ae),ae.name&&h.parser.constructs.disable.null.includes(ae.name)?ue():ae.tokenize.call(z?Object.assign(Object.create(h),z):h,d,oe,ue)(ke)}}function oe(ae){return U(pe,T),Z}function ue(ae){return T.restore(),++Q<Se.length?M(Se[Q]):ve}}}function B(U,z){U.resolveAll&&!a.includes(U)&&a.push(U),U.resolve&&Pn(h.events,z,h.events.length-z,U.resolve(h.events.slice(z),h)),U.resolveTo&&(h.events=U.resolveTo(h.events,h))}function D(){const U=k(),z=h.previous,he=h.currentConstruct,J=h.events.length,Z=Array.from(c);return{from:J,restore:ve};function ve(){r=U,h.previous=z,h.currentConstruct=he,h.events.length=J,c=Z,I()}}function I(){r.line in s&&r.column<2&&(r.column=s[r.line],r.offset+=s[r.line]-1)}}function dj(e,t){const n=t.start._index,r=t.start._bufferIndex,s=t.end._index,a=t.end._bufferIndex;let l;if(n===s)l=[e[n].slice(r,a)];else{if(l=e.slice(n,s),r>-1){const c=l[0];typeof c=="string"?l[0]=c.slice(r):l.shift()}a>0&&l.push(e[s].slice(0,a))}return l}function fj(e,t){let n=-1;const r=[];let s;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=`
264
- `;break}case-3:{l=`\r
265
- `;break}case-2:{l=t?" ":" ";break}case-1:{if(!t&&s)continue;l=" ";break}default:l=String.fromCharCode(a)}s=a===-2,r.push(l)}return r.join("")}function hj(e){const r={constructs:bS([uj,...(e||{}).extensions||[]]),content:s(TN),defined:[],document:s(AN),flow:s(KL),lazy:{},string:s(QL),text:s(JL)};return r;function s(a){return l;function l(c){return cj(r,a,c)}}}function pj(e){for(;!TS(e););return e}const W0=/[\0\t\n\r]/g;function mj(){let e=1,t="",n=!0,r;return s;function s(a,l,c){const d=[];let h,p,m,y,w;for(a=t+(typeof a=="string"?a.toString():new TextDecoder(l||void 0).decode(a)),m=0,t="",n&&(a.charCodeAt(0)===65279&&m++,n=void 0);m<a.length;){if(W0.lastIndex=m,h=W0.exec(a),y=h&&h.index!==void 0?h.index:a.length,w=a.charCodeAt(y),!h){t=a.slice(m);break}if(w===10&&m===y&&r)d.push(-3),r=void 0;else switch(r&&(d.push(-5),r=void 0),m<y&&(d.push(a.slice(m,y)),e+=y-m),w){case 0:{d.push(65533),e++;break}case 9:{for(p=Math.ceil(e/4)*4,d.push(-2);e++<p;)d.push(-1);break}case 10:{d.push(-4),e=1;break}default:r=!0,e=1}m=y+1}return c&&(r&&d.push(-5),t&&d.push(t),d.push(null)),d}}function Jo(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?q0(e.position):"start"in e||"end"in e?q0(e):"line"in e||"column"in e?_h(e):""}function _h(e){return G0(e&&e.line)+":"+G0(e&&e.column)}function q0(e){return _h(e&&e.start)+"-"+_h(e&&e.end)}function G0(e){return e&&typeof e=="number"?e:1}const LS={}.hasOwnProperty;function jS(e,t,n){return t&&typeof t=="object"&&(n=t,t=void 0),gj(n)(pj(hj(n).document().write(mj()(e,t,!0))))}function gj(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:a(Tn),autolinkProtocol:D,autolinkEmail:D,atxHeading:a(Vt),blockQuote:a($e),characterEscape:D,characterReference:D,codeFenced:a(Fe),codeFencedFenceInfo:l,codeFencedFenceMeta:l,codeIndented:a(Fe,l),codeText:a(qe,l),codeTextData:D,data:D,codeFlowValue:D,definition:a(st),definitionDestinationString:l,definitionLabelString:l,definitionTitleString:l,emphasis:a(ot),hardBreakEscape:a(en),hardBreakTrailing:a(en),htmlFlow:a(et,l),htmlFlowData:D,htmlText:a(et,l),htmlTextData:D,image:a(Wt),label:l,link:a(Tn),listItem:a(tn),listItemValue:y,listOrdered:a(zt,m),listUnordered:a(zt),paragraph:a(bt),reference:M,referenceString:l,resourceDestinationString:l,resourceTitleString:l,setextHeading:a(Vt),strong:a(tr),thematicBreak:a(jr)},exit:{atxHeading:d(),atxHeadingSequence:A,autolink:d(),autolinkEmail:xe,autolinkProtocol:ke,blockQuote:d(),characterEscapeValue:I,characterReferenceMarkerHexadecimal:ue,characterReferenceMarkerNumeric:ue,characterReferenceValue:ae,characterReference:me,codeFenced:d(E),codeFencedFence:b,codeFencedFenceInfo:w,codeFencedFenceMeta:k,codeFlowValue:I,codeIndented:d(P),codeText:d(Z),codeTextData:I,data:I,definition:d(),definitionDestinationString:j,definitionLabelString:R,definitionTitleString:_,emphasis:d(),hardBreakEscape:d(z),hardBreakTrailing:d(z),htmlFlow:d(he),htmlFlowData:I,htmlText:d(J),htmlTextData:I,image:d(Se),label:pe,labelText:Q,lineEnding:U,link:d(ve),listItem:d(),listOrdered:d(),listUnordered:d(),paragraph:d(),referenceString:oe,resourceDestinationString:T,resourceTitleString:F,resource:X,setextHeading:d(B),setextHeadingLineSequence:q,setextHeadingText:N,strong:d(),thematicBreak:d()}};DS(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(Y){let ee={type:"root",children:[]};const Te={stack:[ee],tokenStack:[],config:t,enter:c,exit:h,buffer:l,resume:p,data:n},Ae=[];let Ve=-1;for(;++Ve<Y.length;)if(Y[Ve][1].type==="listOrdered"||Y[Ve][1].type==="listUnordered")if(Y[Ve][0]==="enter")Ae.push(Ve);else{const at=Ae.pop();Ve=s(Y,at,Ve)}for(Ve=-1;++Ve<Y.length;){const at=t[Y[Ve][0]];LS.call(at,Y[Ve][1].type)&&at[Y[Ve][1].type].call(Object.assign({sliceSerialize:Y[Ve][2].sliceSerialize},Te),Y[Ve][1])}if(Te.tokenStack.length>0){const at=Te.tokenStack[Te.tokenStack.length-1];(at[1]||K0).call(Te,void 0,at[0])}for(ee.position={start:ii(Y.length>0?Y[0][1].start:{line:1,column:1,offset:0}),end:ii(Y.length>0?Y[Y.length-2][1].end:{line:1,column:1,offset:0})},Ve=-1;++Ve<t.transforms.length;)ee=t.transforms[Ve](ee)||ee;return ee}function s(Y,ee,Te){let Ae=ee-1,Ve=-1,at=!1,Nt,H,ge,ie;for(;++Ae<=Te;){const ye=Y[Ae];switch(ye[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{ye[0]==="enter"?Ve++:Ve--,ie=void 0;break}case"lineEndingBlank":{ye[0]==="enter"&&(Nt&&!ie&&!Ve&&!ge&&(ge=Ae),ie=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:ie=void 0}if(!Ve&&ye[0]==="enter"&&ye[1].type==="listItemPrefix"||Ve===-1&&ye[0]==="exit"&&(ye[1].type==="listUnordered"||ye[1].type==="listOrdered")){if(Nt){let Le=Ae;for(H=void 0;Le--;){const fe=Y[Le];if(fe[1].type==="lineEnding"||fe[1].type==="lineEndingBlank"){if(fe[0]==="exit")continue;H&&(Y[H][1].type="lineEndingBlank",at=!0),fe[1].type="lineEnding",H=Le}else if(!(fe[1].type==="linePrefix"||fe[1].type==="blockQuotePrefix"||fe[1].type==="blockQuotePrefixWhitespace"||fe[1].type==="blockQuoteMarker"||fe[1].type==="listItemIndent"))break}ge&&(!H||ge<H)&&(Nt._spread=!0),Nt.end=Object.assign({},H?Y[H][1].start:ye[1].end),Y.splice(H||Ae,0,["exit",Nt,ye[2]]),Ae++,Te++}if(ye[1].type==="listItemPrefix"){const Le={type:"listItem",_spread:!1,start:Object.assign({},ye[1].start),end:void 0};Nt=Le,Y.splice(Ae,0,["enter",Le,ye[2]]),Ae++,Te++,ge=void 0,ie=!0}}}return Y[ee][1]._spread=at,Te}function a(Y,ee){return Te;function Te(Ae){c.call(this,Y(Ae),Ae),ee&&ee.call(this,Ae)}}function l(){this.stack.push({type:"fragment",children:[]})}function c(Y,ee,Te){this.stack[this.stack.length-1].children.push(Y),this.stack.push(Y),this.tokenStack.push([ee,Te||void 0]),Y.position={start:ii(ee.start),end:void 0}}function d(Y){return ee;function ee(Te){Y&&Y.call(this,Te),h.call(this,Te)}}function h(Y,ee){const Te=this.stack.pop(),Ae=this.tokenStack.pop();if(Ae)Ae[0].type!==Y.type&&(ee?ee.call(this,Y,Ae[0]):(Ae[1]||K0).call(this,Y,Ae[0]));else throw new Error("Cannot close `"+Y.type+"` ("+Jo({start:Y.start,end:Y.end})+"): it’s not open");Te.position.end=ii(Y.end)}function p(){return Op(this.stack.pop())}function m(){this.data.expectingFirstListItemValue=!0}function y(Y){if(this.data.expectingFirstListItemValue){const ee=this.stack[this.stack.length-2];ee.start=Number.parseInt(this.sliceSerialize(Y),10),this.data.expectingFirstListItemValue=void 0}}function w(){const Y=this.resume(),ee=this.stack[this.stack.length-1];ee.lang=Y}function k(){const Y=this.resume(),ee=this.stack[this.stack.length-1];ee.meta=Y}function b(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function E(){const Y=this.resume(),ee=this.stack[this.stack.length-1];ee.value=Y.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function P(){const Y=this.resume(),ee=this.stack[this.stack.length-1];ee.value=Y.replace(/(\r?\n|\r)$/g,"")}function R(Y){const ee=this.resume(),Te=this.stack[this.stack.length-1];Te.label=ee,Te.identifier=Zn(this.sliceSerialize(Y)).toLowerCase()}function _(){const Y=this.resume(),ee=this.stack[this.stack.length-1];ee.title=Y}function j(){const Y=this.resume(),ee=this.stack[this.stack.length-1];ee.url=Y}function A(Y){const ee=this.stack[this.stack.length-1];if(!ee.depth){const Te=this.sliceSerialize(Y).length;ee.depth=Te}}function N(){this.data.setextHeadingSlurpLineEnding=!0}function q(Y){const ee=this.stack[this.stack.length-1];ee.depth=this.sliceSerialize(Y).codePointAt(0)===61?1:2}function B(){this.data.setextHeadingSlurpLineEnding=void 0}function D(Y){const Te=this.stack[this.stack.length-1].children;let Ae=Te[Te.length-1];(!Ae||Ae.type!=="text")&&(Ae=He(),Ae.position={start:ii(Y.start),end:void 0},Te.push(Ae)),this.stack.push(Ae)}function I(Y){const ee=this.stack.pop();ee.value+=this.sliceSerialize(Y),ee.position.end=ii(Y.end)}function U(Y){const ee=this.stack[this.stack.length-1];if(this.data.atHardBreak){const Te=ee.children[ee.children.length-1];Te.position.end=ii(Y.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(ee.type)&&(D.call(this,Y),I.call(this,Y))}function z(){this.data.atHardBreak=!0}function he(){const Y=this.resume(),ee=this.stack[this.stack.length-1];ee.value=Y}function J(){const Y=this.resume(),ee=this.stack[this.stack.length-1];ee.value=Y}function Z(){const Y=this.resume(),ee=this.stack[this.stack.length-1];ee.value=Y}function ve(){const Y=this.stack[this.stack.length-1];if(this.data.inReference){const ee=this.data.referenceType||"shortcut";Y.type+="Reference",Y.referenceType=ee,delete Y.url,delete Y.title}else delete Y.identifier,delete Y.label;this.data.referenceType=void 0}function Se(){const Y=this.stack[this.stack.length-1];if(this.data.inReference){const ee=this.data.referenceType||"shortcut";Y.type+="Reference",Y.referenceType=ee,delete Y.url,delete Y.title}else delete Y.identifier,delete Y.label;this.data.referenceType=void 0}function Q(Y){const ee=this.sliceSerialize(Y),Te=this.stack[this.stack.length-2];Te.label=fN(ee),Te.identifier=Zn(ee).toLowerCase()}function pe(){const Y=this.stack[this.stack.length-1],ee=this.resume(),Te=this.stack[this.stack.length-1];if(this.data.inReference=!0,Te.type==="link"){const Ae=Y.children;Te.children=Ae}else Te.alt=ee}function T(){const Y=this.resume(),ee=this.stack[this.stack.length-1];ee.url=Y}function F(){const Y=this.resume(),ee=this.stack[this.stack.length-1];ee.title=Y}function X(){this.data.inReference=void 0}function M(){this.data.referenceType="collapsed"}function oe(Y){const ee=this.resume(),Te=this.stack[this.stack.length-1];Te.label=ee,Te.identifier=Zn(this.sliceSerialize(Y)).toLowerCase(),this.data.referenceType="full"}function ue(Y){this.data.characterReferenceType=Y.type}function ae(Y){const ee=this.sliceSerialize(Y),Te=this.data.characterReferenceType;let Ae;Te?(Ae=kS(ee,Te==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):Ae=Vp(ee);const Ve=this.stack[this.stack.length-1];Ve.value+=Ae}function me(Y){const ee=this.stack.pop();ee.position.end=ii(Y.end)}function ke(Y){I.call(this,Y);const ee=this.stack[this.stack.length-1];ee.url=this.sliceSerialize(Y)}function xe(Y){I.call(this,Y);const ee=this.stack[this.stack.length-1];ee.url="mailto:"+this.sliceSerialize(Y)}function $e(){return{type:"blockquote",children:[]}}function Fe(){return{type:"code",lang:null,meta:null,value:""}}function qe(){return{type:"inlineCode",value:""}}function st(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function ot(){return{type:"emphasis",children:[]}}function Vt(){return{type:"heading",depth:0,children:[]}}function en(){return{type:"break"}}function et(){return{type:"html",value:""}}function Wt(){return{type:"image",title:null,url:"",alt:null}}function Tn(){return{type:"link",title:null,url:"",children:[]}}function zt(Y){return{type:"list",ordered:Y.type==="listOrdered",start:null,spread:Y._spread,children:[]}}function tn(Y){return{type:"listItem",spread:Y._spread,checked:null,children:[]}}function bt(){return{type:"paragraph",children:[]}}function tr(){return{type:"strong",children:[]}}function He(){return{type:"text",value:""}}function jr(){return{type:"thematicBreak"}}}function ii(e){return{line:e.line,column:e.column,offset:e.offset}}function DS(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?DS(e,r):yj(e,r)}}function yj(e,t){let n;for(n in t)if(LS.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 K0(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+Jo({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+Jo({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+Jo({start:t.start,end:t.end})+") is still open")}const vj={tokenize:bj,partial:!0},OS={tokenize:Ej,partial:!0},FS={tokenize:_j,partial:!0},VS={tokenize:Pj,partial:!0},xj={tokenize:Tj,partial:!0},zS={name:"wwwAutolink",tokenize:kj,previous:US},BS={name:"protocolAutolink",tokenize:Cj,previous:$S},Lr={name:"emailAutolink",tokenize:Sj,previous:HS},yr={};function wj(){return{text:yr}}let Ai=48;for(;Ai<123;)yr[Ai]=Lr,Ai++,Ai===58?Ai=65:Ai===91&&(Ai=97);yr[43]=Lr;yr[45]=Lr;yr[46]=Lr;yr[95]=Lr;yr[72]=[Lr,BS];yr[104]=[Lr,BS];yr[87]=[Lr,zS];yr[119]=[Lr,zS];function Sj(e,t,n){const r=this;let s,a;return l;function l(m){return!Ph(m)||!HS.call(r,r.previous)||Bp(r.events)?n(m):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),c(m))}function c(m){return Ph(m)?(e.consume(m),c):m===64?(e.consume(m),d):n(m)}function d(m){return m===46?e.check(xj,p,h)(m):m===45||m===95||Jt(m)?(a=!0,e.consume(m),d):p(m)}function h(m){return e.consume(m),s=!0,d}function p(m){return a&&s&&on(r.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(m)):n(m)}}function kj(e,t,n){const r=this;return s;function s(l){return l!==87&&l!==119||!US.call(r,r.previous)||Bp(r.events)?n(l):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(vj,e.attempt(OS,e.attempt(FS,a),n),n)(l))}function a(l){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(l)}}function Cj(e,t,n){const r=this;let s="",a=!1;return l;function l(m){return(m===72||m===104)&&$S.call(r,r.previous)&&!Bp(r.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),s+=String.fromCodePoint(m),e.consume(m),c):n(m)}function c(m){if(on(m)&&s.length<5)return s+=String.fromCodePoint(m),e.consume(m),c;if(m===58){const y=s.toLowerCase();if(y==="http"||y==="https")return e.consume(m),d}return n(m)}function d(m){return m===47?(e.consume(m),a?h:(a=!0,d)):n(m)}function h(m){return m===null||Mu(m)||it(m)||Ki(m)||tc(m)?n(m):e.attempt(OS,e.attempt(FS,p),n)(m)}function p(m){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(m)}}function bj(e,t,n){let r=0;return s;function s(l){return(l===87||l===119)&&r<3?(r++,e.consume(l),s):l===46&&r===3?(e.consume(l),a):n(l)}function a(l){return l===null?n(l):t(l)}}function Ej(e,t,n){let r,s,a;return l;function l(h){return h===46||h===95?e.check(VS,d,c)(h):h===null||it(h)||Ki(h)||h!==45&&tc(h)?d(h):(a=!0,e.consume(h),l)}function c(h){return h===95?r=!0:(s=r,r=void 0),e.consume(h),l}function d(h){return s||r||!a?n(h):t(h)}}function _j(e,t){let n=0,r=0;return s;function s(l){return l===40?(n++,e.consume(l),s):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(VS,t,a)(l):l===null||it(l)||Ki(l)?t(l):(e.consume(l),s)}function a(l){return l===41&&r++,e.consume(l),s}}function Pj(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),s):c===60||c===null||it(c)||Ki(c)?t(c):n(c)}function s(c){return c===null||c===40||c===91||it(c)||Ki(c)?t(c):r(c)}function a(c){return on(c)?l(c):n(c)}function l(c){return c===59?(e.consume(c),r):on(c)?(e.consume(c),l):n(c)}}function Tj(e,t,n){return r;function r(a){return e.consume(a),s}function s(a){return Jt(a)?n(a):t(a)}}function US(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||it(e)}function $S(e){return!on(e)}function HS(e){return!(e===47||Ph(e))}function Ph(e){return e===43||e===45||e===46||e===95||Jt(e)}function Bp(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}const Rj={tokenize:Oj,partial:!0};function Aj(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:Lj,continuation:{tokenize:jj},exit:Dj}},text:{91:{name:"gfmFootnoteCall",tokenize:Nj},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:Ij,resolveTo:Mj}}}}function Ij(e,t,n){const r=this;let s=r.events.length;const a=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let l;for(;s--;){const d=r.events[s][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 h=Zn(r.sliceSerialize({start:l.end,end:r.now()}));return h.codePointAt(0)!==94||!a.includes(h.slice(1))?n(d):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(d),e.exit("gfmFootnoteCallLabelMarker"),t(d))}}function Mj(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)},s={type:"gfmFootnoteCallMarker",start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};s.end.column++,s.end.offset++,s.end._bufferIndex++;const a={type:"gfmFootnoteCallString",start:Object.assign({},s.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",s,t],["exit",s,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 Nj(e,t,n){const r=this,s=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let a=0,l;return c;function c(m){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(m),e.exit("gfmFootnoteCallLabelMarker"),d}function d(m){return m!==94?n(m):(e.enter("gfmFootnoteCallMarker"),e.consume(m),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",h)}function h(m){if(a>999||m===93&&!l||m===null||m===91||it(m))return n(m);if(m===93){e.exit("chunkString");const y=e.exit("gfmFootnoteCallString");return s.includes(Zn(r.sliceSerialize(y)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(m),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(m)}return it(m)||(l=!0),a++,e.consume(m),m===92?p:h}function p(m){return m===91||m===92||m===93?(e.consume(m),a++,h):h(m)}}function Lj(e,t,n){const r=this,s=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let a,l=0,c;return d;function d(k){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(k),e.exit("gfmFootnoteDefinitionLabelMarker"),h}function h(k){return k===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(k),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",p):n(k)}function p(k){if(l>999||k===93&&!c||k===null||k===91||it(k))return n(k);if(k===93){e.exit("chunkString");const b=e.exit("gfmFootnoteDefinitionLabelString");return a=Zn(r.sliceSerialize(b)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(k),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),y}return it(k)||(c=!0),l++,e.consume(k),k===92?m:p}function m(k){return k===91||k===92||k===93?(e.consume(k),l++,p):p(k)}function y(k){return k===58?(e.enter("definitionMarker"),e.consume(k),e.exit("definitionMarker"),s.includes(a)||s.push(a),We(e,w,"gfmFootnoteDefinitionWhitespace")):n(k)}function w(k){return t(k)}}function jj(e,t,n){return e.check(Ca,t,e.attempt(Rj,t,n))}function Dj(e){e.exit("gfmFootnoteDefinition")}function Oj(e,t,n){const r=this;return We(e,s,"gfmFootnoteDefinitionIndent",5);function s(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 Fj(e){let n=(e||{}).singleTilde;const r={name:"strikethrough",tokenize:a,resolveAll:s};return n==null&&(n=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function s(l,c){let d=-1;for(;++d<l.length;)if(l[d][0]==="enter"&&l[d][1].type==="strikethroughSequenceTemporary"&&l[d][1]._close){let h=d;for(;h--;)if(l[h][0]==="exit"&&l[h][1].type==="strikethroughSequenceTemporary"&&l[h][1]._open&&l[d][1].end.offset-l[d][1].start.offset===l[h][1].end.offset-l[h][1].start.offset){l[d][1].type="strikethroughSequence",l[h][1].type="strikethroughSequence";const p={type:"strikethrough",start:Object.assign({},l[h][1].start),end:Object.assign({},l[d][1].end)},m={type:"strikethroughText",start:Object.assign({},l[h][1].end),end:Object.assign({},l[d][1].start)},y=[["enter",p,c],["enter",l[h][1],c],["exit",l[h][1],c],["enter",m,c]],w=c.parser.constructs.insideSpan.null;w&&Pn(y,y.length,0,ic(w,l.slice(h+1,d),c)),Pn(y,y.length,0,[["exit",m,c],["enter",l[d][1],c],["exit",l[d][1],c],["exit",p,c]]),Pn(l,h-1,d-h+3,y),d=h+y.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 h=this.previous,p=this.events;let m=0;return y;function y(k){return h===126&&p[p.length-1][1].type!=="characterEscape"?d(k):(l.enter("strikethroughSequenceTemporary"),w(k))}function w(k){const b=$s(h);if(k===126)return m>1?d(k):(l.consume(k),m++,w);if(m<2&&!n)return d(k);const E=l.exit("strikethroughSequenceTemporary"),P=$s(k);return E._open=!P||P===2&&!!b,E._close=!b||b===2&&!!P,c(k)}}}class Vj{constructor(){this.map=[],this.index=new Map}add(t,n,r){zj(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 s=r.pop();for(;s;){for(const a of s)t.push(a);s=r.pop()}this.map.length=0,this.index.clear()}}function zj(e,t,n,r){if(n===0&&r.length===0)return;const s=e.index.get(t);if(s){s[1]+=n,s[2].push(...r);return}const a=[t,n,r];e.map.push(a),e.index.set(t,a)}function Bj(e,t){let n=!1;const r=[];for(;t<e.length;){const s=e[t];if(n){if(s[0]==="enter")s[1].type==="tableContent"&&r.push(e[t+1][1].type==="tableDelimiterMarker"?"left":"none");else if(s[1].type==="tableContent"){if(e[t-1][1].type==="tableDelimiterMarker"){const a=r.length-1;r[a]=r[a]==="left"?"center":"right"}}else if(s[1].type==="tableDelimiterRow")break}else s[0]==="enter"&&s[1].type==="tableDelimiterRow"&&(n=!0);t+=1}return r}function Uj(){return{flow:{null:{name:"table",tokenize:$j,resolveAll:Hj}}}}function $j(e,t,n){const r=this;let s=0,a=0,l;return c;function c(I){let U=r.events.length-1;for(;U>-1;){const{type:J}=r.events[U][1];if(J==="lineEnding"||J==="linePrefix")U--;else break}const z=U>-1?r.events[U][1].type:null,he=z==="tableHead"||z==="tableRow"?N:d;return he===N&&r.parser.lazy[r.now().line]?n(I):he(I)}function d(I){return e.enter("tableHead"),e.enter("tableRow"),h(I)}function h(I){return I===124||(l=!0,a+=1),p(I)}function p(I){return I===null?n(I):Ne(I)?a>1?(a=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(I),e.exit("lineEnding"),w):n(I):Be(I)?We(e,p,"whitespace")(I):(a+=1,l&&(l=!1,s+=1),I===124?(e.enter("tableCellDivider"),e.consume(I),e.exit("tableCellDivider"),l=!0,p):(e.enter("data"),m(I)))}function m(I){return I===null||I===124||it(I)?(e.exit("data"),p(I)):(e.consume(I),I===92?y:m)}function y(I){return I===92||I===124?(e.consume(I),m):m(I)}function w(I){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(I):(e.enter("tableDelimiterRow"),l=!1,Be(I)?We(e,k,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(I):k(I))}function k(I){return I===45||I===58?E(I):I===124?(l=!0,e.enter("tableCellDivider"),e.consume(I),e.exit("tableCellDivider"),b):A(I)}function b(I){return Be(I)?We(e,E,"whitespace")(I):E(I)}function E(I){return I===58?(a+=1,l=!0,e.enter("tableDelimiterMarker"),e.consume(I),e.exit("tableDelimiterMarker"),P):I===45?(a+=1,P(I)):I===null||Ne(I)?j(I):A(I)}function P(I){return I===45?(e.enter("tableDelimiterFiller"),R(I)):A(I)}function R(I){return I===45?(e.consume(I),R):I===58?(l=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(I),e.exit("tableDelimiterMarker"),_):(e.exit("tableDelimiterFiller"),_(I))}function _(I){return Be(I)?We(e,j,"whitespace")(I):j(I)}function j(I){return I===124?k(I):I===null||Ne(I)?!l||s!==a?A(I):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(I)):A(I)}function A(I){return n(I)}function N(I){return e.enter("tableRow"),q(I)}function q(I){return I===124?(e.enter("tableCellDivider"),e.consume(I),e.exit("tableCellDivider"),q):I===null||Ne(I)?(e.exit("tableRow"),t(I)):Be(I)?We(e,q,"whitespace")(I):(e.enter("data"),B(I))}function B(I){return I===null||I===124||it(I)?(e.exit("data"),q(I)):(e.consume(I),I===92?D:B)}function D(I){return I===92||I===124?(e.consume(I),B):B(I)}}function Hj(e,t){let n=-1,r=!0,s=0,a=[0,0,0,0],l=[0,0,0,0],c=!1,d=0,h,p,m;const y=new Vj;for(;++n<e.length;){const w=e[n],k=w[1];w[0]==="enter"?k.type==="tableHead"?(c=!1,d!==0&&(X0(y,t,d,h,p),p=void 0,d=0),h={type:"table",start:Object.assign({},k.start),end:Object.assign({},k.end)},y.add(n,0,[["enter",h,t]])):k.type==="tableRow"||k.type==="tableDelimiterRow"?(r=!0,m=void 0,a=[0,0,0,0],l=[0,n+1,0,0],c&&(c=!1,p={type:"tableBody",start:Object.assign({},k.start),end:Object.assign({},k.end)},y.add(n,0,[["enter",p,t]])),s=k.type==="tableDelimiterRow"?2:p?3:1):s&&(k.type==="data"||k.type==="tableDelimiterMarker"||k.type==="tableDelimiterFiller")?(r=!1,l[2]===0&&(a[1]!==0&&(l[0]=l[1],m=Ul(y,t,a,s,void 0,m),a=[0,0,0,0]),l[2]=n)):k.type==="tableCellDivider"&&(r?r=!1:(a[1]!==0&&(l[0]=l[1],m=Ul(y,t,a,s,void 0,m)),a=l,l=[a[1],n,0,0])):k.type==="tableHead"?(c=!0,d=n):k.type==="tableRow"||k.type==="tableDelimiterRow"?(d=n,a[1]!==0?(l[0]=l[1],m=Ul(y,t,a,s,n,m)):l[1]!==0&&(m=Ul(y,t,l,s,n,m)),s=0):s&&(k.type==="data"||k.type==="tableDelimiterMarker"||k.type==="tableDelimiterFiller")&&(l[3]=n)}for(d!==0&&X0(y,t,d,h,p),y.consume(t.events),n=-1;++n<t.events.length;){const w=t.events[n];w[0]==="enter"&&w[1].type==="table"&&(w[1]._align=Bj(t.events,n))}return e}function Ul(e,t,n,r,s,a){const l=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",c="tableContent";n[0]!==0&&(a.end=Object.assign({},Is(t.events,n[0])),e.add(n[0],0,[["exit",a,t]]));const d=Is(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 h=Is(t.events,n[2]),p=Is(t.events,n[3]),m={type:c,start:Object.assign({},h),end:Object.assign({},p)};if(e.add(n[2],0,[["enter",m,t]]),r!==2){const y=t.events[n[2]],w=t.events[n[3]];if(y[1].end=Object.assign({},w[1].end),y[1].type="chunkText",y[1].contentType="text",n[3]>n[2]+1){const k=n[2]+1,b=n[3]-n[2]-1;e.add(k,b,[])}}e.add(n[3]+1,0,[["exit",m,t]])}return s!==void 0&&(a.end=Object.assign({},Is(t.events,s)),e.add(s,0,[["exit",a,t]]),a=void 0),a}function X0(e,t,n,r,s){const a=[],l=Is(t.events,n);s&&(s.end=Object.assign({},l),a.push(["exit",s,t])),r.end=Object.assign({},l),a.push(["exit",r,t]),e.add(n+1,0,a)}function Is(e,t){const n=e[t],r=n[0]==="enter"?"start":"end";return n[1][r]}const Wj={name:"tasklistCheck",tokenize:Gj};function qj(){return{text:{91:Wj}}}function Gj(e,t,n){const r=this;return s;function s(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 it(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 Ne(d)?t(d):Be(d)?e.check({tokenize:Kj},t,n)(d):n(d)}}function Kj(e,t,n){return We(e,r,"whitespace");function r(s){return s===null?n(s):t(s)}}function WS(e){return bS([wj(),Aj(),Fj(e),Uj(),qj()])}function qS(e){return typeof e=="string"&&/\.md$/i.test(e.trim())}function Xj(e,t){const n=String(e??"").trim().split(/\r?\n/).map(s=>`> ${s}`).join(`
266
- `),r=String(t??"").trim();return n&&r?`${n}
267
-
268
- ${r}`:n||r}function Yj(e){const t=String(e??""),n=t.lastIndexOf(".");return`${n>0?t.slice(0,n):t}_review.md`}function Qj(e,t,n){const r=String(e??""),s=String(t??""),a=Math.max(0,Number(n)||0);if(!s)return 0;let l=0,c=0;for(;c<=r.length;){const d=r.indexOf(s,c);if(d<0||d>=a)return l;l+=1,c=d+Math.max(s.length,1)}return l}function Jj(e){return(String(e??"").match(/https?:\/\/[^\s<>()\[\]{}"']+/gi)??[]).map(n=>n.replace(/[.,!?;:]+$/,""))}function Th(e){return e?.kind!=="file"?null:String(e.mime??"").toLowerCase().startsWith("image/")?"photo":"file"}function Zj(e){const t=r=>{const s=Date.parse(String(r??""));return Number.isFinite(s)?s:0},n=new Map;for(const r of e??[]){const s=String(r?.message?.filename||"file"),a=n.get(s)??[];a.push(r),n.set(s,a)}return[...n.entries()].map(([r,s])=>({filename:r,versions:s.sort((a,l)=>t(l.message?.date)-t(a.message?.date))})).sort((r,s)=>t(s.versions[0]?.message?.date)-t(r.versions[0]?.message?.date))}const eD=new Set(["delete","emphasis","inlineCode","link","linkReference","strong"]);function tD(e){const t=jS(e,{extensions:[WS()],mdastExtensions:[CS()]}),n=[],r=[],s=[],a=(c,d)=>{const h=String(c??""),p=d.position?.start?.offset,m=d.position?.end?.offset;if(!h||!Number.isInteger(p)||!Number.isInteger(m))return;const y=e.slice(p,m),w=y.indexOf(h);if(w>=0){for(let b=0;b<h.length;b+=1)n.push(h[b]),r.push(p+w+b+1);return}let k=0;for(const b of h){const E=y.indexOf(b,k),P=E>=0?E:Math.min(k,Math.max(y.length-1,0));n.push(b),r.push(p+P+1),k=P+1}},l=c=>{const d=n.length;if(c.type==="text"||c.type==="inlineCode"||c.type==="code")a(c.value,c);else for(const m of c.children??[])l(m);const h=n.length,p=c.position?.end?.offset;h>d&&eD.has(c.type)&&Number.isInteger(p)&&s.push({visibleEnd:h,rawEnd:p})};return l(t),{text:n.join(""),rawEnds:r,trailingRanges:s}}function nD(e,t,n){let r=-1,s=0;for(let a=0;a<=n;a+=1){if(r=e.indexOf(t,s),r<0)return-1;s=r+Math.max(t.length,1)}return r}function rD(e,t){const n=String(e??""),r=tD(n),s=new Map,a=[];for(const[d,h]of(t??[]).entries()){const p=String(h?.selection??"").trim(),m=String(h?.comment??"").trim().replace(/\s+/g," ").replace(/\]\]/g,"] ]");if(!m)continue;const y=`[[REVIEW COMMENT ${d+1}: ${m}]]`,w=Number.isInteger(h?.occurrence)&&h.occurrence>=0?h.occurrence:0,k=p?nD(r.text,p,w):-1,b=k+p.length;let E=k>=0?r.rawEnds[b-1]:void 0;if(!Number.isInteger(E)){a.push(`[[REVIEW COMMENT ${d+1} — ANCHOR NOT FOUND: ${m}]]`);continue}for(const R of r.trailingRanges)R.visibleEnd===b&&(E=Math.max(E,R.rawEnd));const P=s.get(E)??[];P.push(y),s.set(E,P)}let l=n;const c=[...s.keys()].sort((d,h)=>h-d);for(const d of c)l=`${l.slice(0,d)} ${s.get(d).join(" ")}${l.slice(d)}`;return a.length>0&&(l=`${l.trimEnd()}
269
-
270
- ${a.join(`
271
- `)}
272
- `),l}const iD="",sD="application/octet-stream",oD=/\.([A-Za-z0-9]{1,12})$/;function GS(e){return String(e??"").split(";")[0].trim().toLowerCase()}function KS(e){const t=oD.exec(String(e??"").trim());return t?t[1].toLowerCase():""}function aD(e){const t=KS(e);return t==="html"||t==="htm"}function ba(e,t){return aD(e)?!0:KS(e)?!1:GS(t)==="text/html"}function Up(e,t){const n=GS(e);return n==="text/html"||ba(t,e)?sD:n}const Rh=48e3,lD=Object.freeze([{rec:"audio/webm;codecs=opus",base:"audio/webm",ext:"webm"},{rec:"audio/ogg;codecs=opus",base:"audio/ogg",ext:"ogg"},{rec:"audio/webm",base:"audio/webm",ext:"webm"},{rec:"audio/mp4",base:"audio/mp4",ext:"m4a"}]),XS="x-ours-duration",uD=4e3;function cD(e){return!Number.isFinite(e)||e<=0?null:String(Math.round(e*100)/100)}function dD(e,t){const n=t===null?null:cD(t);return n===null?e:`${e};${XS}=${n}`}function fD(e){if(!e)return null;const t=new RegExp(`${XS}\\s*=\\s*([0-9]*\\.?[0-9]+)`,"i").exec(e);if(!t)return null;const n=Number(t[1]);return Number.isFinite(n)&&n>0?n:null}function hD(e,t=uD){return typeof Audio!="function"||typeof URL?.createObjectURL!="function"?Promise.resolve(null):new Promise(n=>{const r=URL.createObjectURL(e),s=new Audio;let a=!1;const l=d=>{a||(a=!0,clearTimeout(c),s.removeAttribute("src"),s.load(),URL.revokeObjectURL(r),n(Number.isFinite(d)&&(d??0)>0?d:null))},c=setTimeout(()=>l(null),t);s.addEventListener("loadedmetadata",()=>{Number.isFinite(s.duration)&&s.duration>0?l(s.duration):s.currentTime=Number.MAX_SAFE_INTEGER},{once:!0}),s.addEventListener("durationchange",()=>{Number.isFinite(s.duration)&&s.duration>0&&l(s.duration)}),s.addEventListener("error",()=>l(null),{once:!0}),s.preload="metadata",s.src=r})}const YS=40,pD=44,QS=.14,mD=.5,gD=e=>e<0?0:e>1?1:e;function JS(e,{floor:t=QS,gamma:n=mD}={}){const r=Math.pow(gD(Number.isFinite(e)?e:0),n);return t+(1-t)*r}function yD(e,t=YS){const n=Math.max(1,Math.floor(t)),r=new Array(n).fill(0);if(!e||e.length===0)return r;const s=e.length/n;for(let a=0;a<n;a++){const l=Math.floor(a*s),c=Math.min(e.length,Math.max(l+1,Math.floor((a+1)*s)));let d=0;for(let h=l;h<c;h++)d+=e[h]*e[h];r[a]=Math.sqrt(d/(c-l))}return r}function vD(e,t={}){const{silenceFloor:n=1e-4}=t,r=e.reduce((s,a)=>a>s?a:s,0);return r>n?e.map(s=>JS(s/r,t)):e.map(()=>QS)}function xD({decay:e=.995,minReference:t=.02}={}){let n=t;return{push(r){const s=Number.isFinite(r)&&r>0?r:0;return n=Math.max(t,n*e,s),JS(s/n)},get reference(){return n}}}function ZS(e){return Up(e.mime,e.filename)}function $p(e){const[t,n]=S.useState({url:null,size:0,loaded:!1});return S.useEffect(()=>{let r=null,s=!1;n({url:null,size:0,loaded:!1});const a=e.available?II(e.id):null;return a?(n({url:a,size:e.size,loaded:!0}),()=>{}):(ec(e.id).then(l=>{if(s)return;if(!l){n({url:null,size:0,loaded:!0});return}const c=URL.createObjectURL(new Blob([l],{type:ZS(e)}));r=c,n({url:c,size:l.byteLength,loaded:!0})}),()=>{s=!0,r&&URL.revokeObjectURL(r)})},[e.id,e.available]),t}function Hp({label:e}){return v.jsxs("div",{className:"file-offdevice",children:[v.jsx("div",{className:"file-offdevice-ic",children:v.jsx(Ce,{name:"inbox",size:16})}),v.jsxs("div",{className:"filecard-meta",children:[v.jsx("div",{className:"filecard-name",title:e,children:e}),v.jsx("div",{className:"filecard-sub",children:"Available on your original device"})]})]})}function Y0({rec:e}){if(!e.transcription)return null;const t=e.transcription.text?.trim();return v.jsx("div",{className:"voice-transcript",children:t||`Transcription ${e.transcription.status??"unavailable"}${e.transcription.error_category?` · ${e.transcription.error_category}`:""}`})}function wD({rec:e,receipt:t,receiptless:n,onPreview:r,onFetch:s}){const a=e.dir==="out",l=`bubble file-bubble${a?" me":""}`,c=Us(e.mime,e.filename)?"Voice message":"File",d=v.jsxs("div",{className:"bubble-at",children:[Wi(e.date),a&&v.jsx(kh,{receipt:t,content:c,receiptless:n})]});return e.mime.startsWith("image/")?v.jsx(SD,{rec:e,cls:l,footer:d,onFetch:s}):Us(e.mime,e.filename)?v.jsx(kD,{rec:e,cls:l,footer:d,onFetch:s}):v.jsx(CD,{rec:e,cls:l,footer:d,onPreview:r,onFetch:s})}function Wp({rec:e,onFetch:t}){const[n,r]=S.useState(!1),[s,a]=S.useState(!1);return v.jsxs("div",{className:"file-offdevice",children:[v.jsx("div",{className:"file-offdevice-ic",children:v.jsx(Ce,{name:"inbox",size:16})}),v.jsxs("div",{className:"filecard-meta",children:[v.jsx("div",{className:"filecard-name",title:e.filename,children:Us(e.mime,e.filename)?"Voice message":e.filename}),v.jsx("div",{className:"filecard-sub",children:s?"Could not fetch media":"Available after explicit fetch"})]}),v.jsx("button",{className:"btn sm",disabled:n,onClick:()=>{r(!0),a(!1),(t?.(e.id)??LI(e.id)).catch(()=>a(!0)).finally(()=>r(!1))},children:n?"Fetching…":"Fetch"})]})}function SD({rec:e,cls:t,footer:n,onFetch:r}){const{url:s,loaded:a}=$p(e);return a&&!s?v.jsxs("div",{className:t+" filecard-bubble file-offdevice-bubble",children:[e.available===!1?v.jsx(Wp,{rec:e,onFetch:r}):v.jsx(Hp,{label:e.filename&&e.filename!=="file"?e.filename:"Photo"}),n]}):v.jsxs("div",{className:t+" image-bubble",children:[s?v.jsx("a",{href:s,target:"_blank",rel:"noreferrer",title:e.filename,children:v.jsx("img",{src:s,alt:e.filename})}):v.jsx("div",{className:"file-loading",children:"loading…"}),n]})}function kD({rec:e,cls:t,footer:n,onFetch:r}){const{url:s,loaded:a}=$p(e),l=S.useRef(null),c=S.useRef(null),[d,h]=S.useState(!1),[p,m]=S.useState(0),[y,w]=S.useState(()=>fD(e.mime)),[k,b]=S.useState(!1),[E,P]=S.useState(null);if(S.useEffect(()=>{if(!s)return;let B=!1;const D=typeof window>"u"?void 0:window.AudioContext||window.webkitAudioContext;if(!D)return;const I=new D,U=()=>{try{I.close()?.catch?.(()=>{})}catch{}};return(async()=>{try{const z=await fetch(s).then(J=>J.arrayBuffer()),he=await I.decodeAudioData(z);if(B)return;P(vD(yD(he.getChannelData(0),YS)))}catch{}finally{U()}})(),()=>{B=!0,U()}},[s]),a&&!s)return v.jsxs("div",{className:t+" filecard-bubble file-offdevice-bubble",children:[e.available===!1?v.jsx(Wp,{rec:e,onFetch:r}):v.jsx(Hp,{label:"Voice message"}),n,v.jsx(Y0,{rec:e})]});const R=()=>{const B=l.current;B&&(d?B.pause():B.play())},_=B=>{const D=c.current;if(!D)return 0;const I=D.getBoundingClientRect();return Math.max(0,Math.min(1,(B-I.left)/I.width))},j=B=>{const D=l.current;m(B),D&&y&&isFinite(y)&&(D.currentTime=B*y)},A=B=>{s&&(B.currentTarget.setPointerCapture?.(B.pointerId),b(!0),j(_(B.clientX)))},N=B=>{k&&j(_(B.clientX))},q=B=>{k&&(B.currentTarget.releasePointerCapture?.(B.pointerId),b(!1))};return v.jsxs("div",{className:t+" voice-bubble",children:[v.jsx("button",{className:"voice-play",onClick:R,disabled:!s,title:d?"Pause":"Play",children:v.jsx(Ce,{name:d?"pause":"play",size:14})}),v.jsxs("div",{className:"voice-track"+(s?" seekable":"")+(k?" scrubbing":"")+(E?" has-wave":""),ref:c,onPointerDown:A,onPointerMove:N,onPointerUp:q,onPointerCancel:q,role:s?"slider":void 0,"aria-label":s?"Seek":void 0,"aria-valuenow":Math.round(p*100),children:[E?v.jsx("div",{className:"voice-wave","aria-hidden":!0,children:E.map((B,D)=>v.jsx("span",{className:"voice-wave-bar"+(D/E.length<p?" played":""),style:{height:`${Math.round(B*100)}%`}},D))}):v.jsx("div",{className:"voice-track-fill",style:{width:`${p*100}%`}}),s&&v.jsx("span",{className:"voice-track-knob",style:{left:`${p*100}%`}})]}),v.jsx("span",{className:"voice-dur mono",children:y!==null?`${Math.floor(y/60)}:${String(Math.floor(y%60)).padStart(2,"0")}`:"·:··"}),s&&v.jsx("audio",{ref:l,src:s,onPlay:()=>h(!0),onPause:()=>h(!1),onEnded:()=>{h(!1),m(0)},onTimeUpdate:B=>{const D=B.currentTarget;!k&&D.duration>0&&isFinite(D.duration)&&m(D.currentTime/D.duration)},onLoadedMetadata:B=>{const D=B.currentTarget.duration;isFinite(D)&&D>0&&w(D)}}),n,v.jsx(Y0,{rec:e})]})}function CD({rec:e,cls:t,footer:n,onPreview:r,onFetch:s}){const{url:a,size:l,loaded:c}=$p(e);return c&&!a?v.jsxs("div",{className:t+" filecard-bubble file-offdevice-bubble",children:[e.available===!1?v.jsx(Wp,{rec:e,onFetch:s}):v.jsx(Hp,{label:e.filename}),n]}):v.jsxs("div",{className:t+" filecard-bubble",children:[v.jsxs("div",{className:"filecard",children:[v.jsx("div",{className:"filecard-ic",children:v.jsx(Ce,{name:"copy",size:18})}),v.jsxs("div",{className:"filecard-meta",children:[v.jsx("div",{className:"filecard-name",title:e.filename,children:e.filename}),v.jsx("div",{className:"filecard-sub",children:l?fi(l):e.size?fi(e.size):""})]}),qS(e.filename)&&a&&r&&v.jsx("button",{className:"icon-btn",onClick:()=>r(e),title:"Preview markdown",children:v.jsx(Ce,{name:"monitor",size:16})}),ba(e.filename,e.mime)&&a&&r&&v.jsx("button",{className:"icon-btn",onClick:()=>r(e),title:"Preview HTML",children:v.jsx(Ce,{name:"monitor",size:16})}),v.jsx("a",{className:"icon-btn"+(a?"":" disabled"),href:a??void 0,download:e.filename,title:"Download",children:v.jsx(Ce,{name:"download",size:16})})]}),n]})}function ek(e){const{att:t}=e,[n,r]=S.useState(null);return S.useEffect(()=>{const s=ZS({mime:t.mime,filename:t.filename}),a=URL.createObjectURL(new Blob([t.bytes],{type:s}));return r(a),()=>URL.revokeObjectURL(a)},[t]),v.jsxs("div",{className:"attach-preview",children:[t.mime.startsWith("image/")&&n?v.jsx("img",{className:"attach-thumb",src:n,alt:t.filename}):t.voice&&n?v.jsx("audio",{className:"attach-audio",src:n,controls:!0}):v.jsx("div",{className:"filecard-ic",children:v.jsx(Ce,{name:"copy",size:16})}),v.jsxs("div",{className:"filecard-meta",children:[v.jsx("div",{className:"filecard-name",title:t.filename,children:t.voice?"Voice message":t.filename}),v.jsxs("div",{className:"filecard-sub",children:[fi(t.bytes.length),t.originalSize&&t.originalSize>t.bytes.length?` · optimized from ${fi(t.originalSize)}`:""]})]}),v.jsx("button",{className:"btn primary sm",disabled:e.sending,onClick:e.onSend,children:e.sending?"Sending…":"Send"}),v.jsx("button",{className:"icon-btn",title:"Discard",disabled:e.sending,onClick:e.onDiscard,children:v.jsx(Ce,{name:"close"})})]})}const bD={channelCount:1,echoCancellation:!0,noiseSuppression:!0,autoGainControl:!0},ED=e=>`${Math.floor(e/60)}:${String(Math.floor(e%60)).padStart(2,"0")}`,Q0=84,J0=120,_D=550,PD=Math.floor(Ho/(Rh/8)),TD=Math.min(300,PD),RD=pD;function tk(e){const[t,n]=S.useState("idle"),[r,s]=S.useState(0),[a,l]=S.useState([]),[c,d]=S.useState(0),[h,p]=S.useState(0),m=S.useRef("idle"),y=S.useRef(null),w=S.useRef(null),k=S.useRef([]),b=S.useRef("webm"),E=S.useRef("audio/webm"),P=S.useRef(!1),R=S.useRef({x:0,y:0}),_=S.useRef(0),j=S.useRef(!1),A=S.useRef(null),N=S.useRef(null),q=S.useRef(null),B=S.useRef(e.onReady),D=S.useRef(e.onError),I=S.useRef(e.onActiveChange);B.current=e.onReady,D.current=e.onError,I.current=e.onActiveChange;const U=oe=>{m.current=oe,n(oe),I.current?.(oe==="recording"||oe==="locked"||oe==="arming")},z=()=>{N.current!=null&&cancelAnimationFrame(N.current),N.current=null,q.current&&clearInterval(q.current),q.current=null,A.current?.close().catch(()=>{}),A.current=null,w.current?.getTracks().forEach(oe=>oe.stop()),w.current=null},he=()=>{window.removeEventListener("pointermove",Se),window.removeEventListener("pointerup",Q),window.removeEventListener("pointercancel",Q)},J=oe=>{P.current=oe;const ue=y.current;ue&&ue.state!=="inactive"?ue.stop():Z(),he()},Z=()=>{z(),U("idle"),s(0),l([]),d(0),p(0)},ve=()=>{m.current==="recording"&&(he(),p(0),U("locked"))};function Se(oe){if(m.current!=="recording")return;const ue=R.current.y-oe.clientY,ae=R.current.x-oe.clientX,me=Math.max(0,Math.min(1,ue/Q0)),ke=Math.max(0,Math.min(1,ae/J0));d(me),p(ke),ue>=Q0?ve():ae>=J0&&J(!0)}function Q(){if(m.current==="arming"){j.current=!0,he();return}if(m.current!=="recording")return;const oe=Date.now()-_.current<_D;J(oe)}const pe=oe=>{e.disabled||m.current!=="idle"||(oe.preventDefault(),R.current={x:oe.clientX,y:oe.clientY},j.current=!1,P.current=!1,k.current=[],d(0),p(0),U("arming"),window.addEventListener("pointermove",Se),window.addEventListener("pointerup",Q),window.addEventListener("pointercancel",Q),T())};async function T(){let oe;try{oe=await navigator.mediaDevices.getUserMedia({audio:bD})}catch{D.current("Microphone unavailable — check the browser permission."),he(),U("idle");return}if(j.current||m.current==="idle"){oe.getTracks().forEach(me=>me.stop()),U("idle");return}w.current=oe;const ue=lD.find(me=>typeof MediaRecorder<"u"&&MediaRecorder.isTypeSupported(me.rec));b.current=ue?.ext??"webm",E.current=ue?.base??"audio/webm";const ae=ue?new MediaRecorder(oe,{mimeType:ue.rec,audioBitsPerSecond:Rh}):new MediaRecorder(oe,{audioBitsPerSecond:Rh});y.current=ae,ae.ondataavailable=me=>{me.data.size>0&&k.current.push(me.data)},ae.onstop=()=>{if(P.current){Z();return}const ke=new Blob(k.current,{type:E.current});Promise.all([ke.arrayBuffer(),hD(ke)]).then(([xe,$e])=>{if(Z(),xe.byteLength===0)return;const Fe=new Date().toISOString().replace(/[-:]/g,"").replace(/\..+/,"").replace("T","-");B.current({filename:`${nS}${Fe}.${b.current}`,mime:dD(MI(E.current),$e),bytes:new Uint8Array(xe),voice:!0})})},ae.start(),_.current=Date.now(),U("recording"),s(0),q.current=setInterval(()=>{s(me=>{const ke=me+1;return ke>=TD&&J(!1),ke})},1e3),F(oe)}function F(oe){try{const ue=window.AudioContext||window.webkitAudioContext,ae=new ue;A.current=ae;const me=ae.createMediaStreamSource(oe),ke=ae.createAnalyser();ke.fftSize=256,me.connect(ke);const xe=new Uint8Array(ke.fftSize),$e=xD();let Fe=0;const qe=st=>{if(N.current=requestAnimationFrame(qe),st-Fe<80)return;Fe=st,ke.getByteTimeDomainData(xe);let ot=0;for(let et=0;et<xe.length;et++){const Wt=(xe[et]-128)/128;ot+=Wt*Wt}const Vt=Math.sqrt(ot/xe.length),en=$e.push(Vt);l(et=>{const Wt=et.length>=RD?et.slice(1):et.slice();return Wt.push(en),Wt})};N.current=requestAnimationFrame(qe)}catch{}}S.useEffect(()=>()=>{P.current=!0,y.current?.stop(),he(),z()},[]);const X=t==="recording"||t==="locked"||t==="arming",M=v.jsx("div",{className:"vr-wave","aria-hidden":!0,children:a.map((oe,ue)=>v.jsx("span",{className:"vr-bar",style:{height:`${Math.round(oe*100)}%`}},ue))});return v.jsxs(v.Fragment,{children:[v.jsx("button",{className:"icon-btn composer-tool vr-mic",title:"Hold to record a voice message",disabled:e.disabled,onPointerDown:pe,onContextMenu:oe=>oe.preventDefault(),children:v.jsx(Ce,{name:"mic",size:18})}),X&&v.jsxs("div",{className:"voice-rec-overlay","data-mode":t,children:[t==="recording"&&v.jsxs("div",{className:"vr-lock",style:{"--p":c},"aria-hidden":!0,children:[v.jsx(Ce,{name:"lock",size:13}),v.jsx(Ce,{name:"chevronDown",size:12})]}),v.jsx("span",{className:"voice-rec-dot"}),v.jsx("span",{className:"vr-time mono",children:ED(r)}),t==="locked"?v.jsxs(v.Fragment,{children:[M,v.jsx("button",{className:"icon-btn vr-trash",title:"Cancel",onClick:()=>J(!0),children:v.jsx(Ce,{name:"trash",size:16})}),v.jsxs("button",{className:"btn primary sm vr-stop",onClick:()=>J(!1),children:[v.jsx(Ce,{name:"check",size:13}),"Stop"]})]}):v.jsxs("div",{className:"vr-slide",style:{opacity:1-h},children:[M,v.jsx("span",{className:"vr-hint",children:"‹ slide to cancel · slide up to lock"})]})]})]})}function AD(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const ID=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,MD=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,ND={};function Z0(e,t){return(ND.jsx?MD:ID).test(e)}const LD=/[ \t\n\f\r]/g;function jD(e){return typeof e=="object"?e.type==="text"?ex(e.value):!1:ex(e)}function ex(e){return e.replace(LD,"")===""}class Ea{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}Ea.prototype.normal={};Ea.prototype.property={};Ea.prototype.space=void 0;function nk(e,t){const n={},r={};for(const s of e)Object.assign(n,s.property),Object.assign(r,s.normal);return new Ea(n,r,t)}function Ah(e){return e.toLowerCase()}class vn{constructor(t,n){this.attribute=n,this.property=t}}vn.prototype.attribute="";vn.prototype.booleanish=!1;vn.prototype.boolean=!1;vn.prototype.commaOrSpaceSeparated=!1;vn.prototype.commaSeparated=!1;vn.prototype.defined=!1;vn.prototype.mustUseProperty=!1;vn.prototype.number=!1;vn.prototype.overloadedBoolean=!1;vn.prototype.property="";vn.prototype.spaceSeparated=!1;vn.prototype.space=void 0;let DD=0;const De=Xi(),_t=Xi(),Ih=Xi(),le=Xi(),tt=Xi(),qi=Xi(),bn=Xi();function Xi(){return 2**++DD}const Mh=Object.freeze(Object.defineProperty({__proto__:null,boolean:De,booleanish:_t,commaOrSpaceSeparated:bn,commaSeparated:qi,number:le,overloadedBoolean:Ih,spaceSeparated:tt},Symbol.toStringTag,{value:"Module"})),vf=Object.keys(Mh);class qp extends vn{constructor(t,n,r,s){let a=-1;if(super(t,n),tx(this,"space",s),typeof r=="number")for(;++a<vf.length;){const l=vf[a];tx(this,vf[a],(r&Mh[l])===Mh[l])}}}qp.prototype.defined=!0;function tx(e,t,n){n&&(e[t]=n)}function Ys(e){const t={},n={};for(const[r,s]of Object.entries(e.properties)){const a=new qp(r,e.transform(e.attributes||{},r),s,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(a.mustUseProperty=!0),t[r]=a,n[Ah(r)]=r,n[Ah(a.attribute)]=r}return new Ea(t,n,e.space)}const rk=Ys({properties:{ariaActiveDescendant:null,ariaAtomic:_t,ariaAutoComplete:null,ariaBusy:_t,ariaChecked:_t,ariaColCount:le,ariaColIndex:le,ariaColSpan:le,ariaControls:tt,ariaCurrent:null,ariaDescribedBy:tt,ariaDetails:null,ariaDisabled:_t,ariaDropEffect:tt,ariaErrorMessage:null,ariaExpanded:_t,ariaFlowTo:tt,ariaGrabbed:_t,ariaHasPopup:null,ariaHidden:_t,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:tt,ariaLevel:le,ariaLive:null,ariaModal:_t,ariaMultiLine:_t,ariaMultiSelectable:_t,ariaOrientation:null,ariaOwns:tt,ariaPlaceholder:null,ariaPosInSet:le,ariaPressed:_t,ariaReadOnly:_t,ariaRelevant:null,ariaRequired:_t,ariaRoleDescription:tt,ariaRowCount:le,ariaRowIndex:le,ariaRowSpan:le,ariaSelected:_t,ariaSetSize:le,ariaSort:null,ariaValueMax:le,ariaValueMin:le,ariaValueNow:le,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function ik(e,t){return t in e?e[t]:t}function sk(e,t){return ik(e,t.toLowerCase())}const OD=Ys({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:qi,acceptCharset:tt,accessKey:tt,action:null,allow:null,allowFullScreen:De,allowPaymentRequest:De,allowUserMedia:De,alpha:De,alt:null,as:null,async:De,autoCapitalize:null,autoComplete:tt,autoFocus:De,autoPlay:De,blocking:tt,capture:null,charSet:null,checked:De,cite:null,className:tt,closedBy:null,colorSpace:null,cols:le,colSpan:le,command:null,commandFor:null,content:null,contentEditable:_t,controls:De,controlsList:tt,coords:le|qi,crossOrigin:null,data:null,dateTime:null,decoding:null,default:De,defer:De,dir:null,dirName:null,disabled:De,download:Ih,draggable:_t,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:De,formTarget:null,headers:tt,height:le,hidden:Ih,high:le,href:null,hrefLang:null,htmlFor:tt,httpEquiv:tt,id:null,imageSizes:null,imageSrcSet:null,inert:De,inputMode:null,integrity:null,is:null,isMap:De,itemId:null,itemProp:tt,itemRef:tt,itemScope:De,itemType:tt,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:De,low:le,manifest:null,max:null,maxLength:le,media:null,method:null,min:null,minLength:le,multiple:De,muted:De,name:null,nonce:null,noModule:De,noValidate:De,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:De,optimum:le,pattern:null,ping:tt,placeholder:null,playsInline:De,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:De,referrerPolicy:null,rel:tt,required:De,reversed:De,rows:le,rowSpan:le,sandbox:tt,scope:null,scoped:De,seamless:De,selected:De,shadowRootClonable:De,shadowRootCustomElementRegistry:De,shadowRootDelegatesFocus:De,shadowRootMode:null,shadowRootSerializable:De,shape:null,size:le,sizes:null,slot:null,span:le,spellCheck:_t,src:null,srcDoc:null,srcLang:null,srcSet:null,start:le,step:null,style:null,tabIndex:le,target:null,title:null,translate:null,type:null,typeMustMatch:De,useMap:null,value:_t,width:le,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:tt,axis:null,background:null,bgColor:null,border:le,borderColor:null,bottomMargin:le,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:De,declare:De,event:null,face:null,frame:null,frameBorder:null,hSpace:le,leftMargin:le,link:null,longDesc:null,lowSrc:null,marginHeight:le,marginWidth:le,noResize:De,noHref:De,noShade:De,noWrap:De,object:null,profile:null,prompt:null,rev:null,rightMargin:le,rules:null,scheme:null,scrolling:_t,standby:null,summary:null,text:null,topMargin:le,valueType:null,version:null,vAlign:null,vLink:null,vSpace:le,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:De,disablePictureInPicture:De,disableRemotePlayback:De,exportParts:qi,part:tt,prefix:null,property:null,results:le,security:null,unselectable:null},space:"html",transform:sk}),FD=Ys({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:bn,accentHeight:le,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:le,amplitude:le,arabicForm:null,ascent:le,attributeName:null,attributeType:null,azimuth:le,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:le,by:null,calcMode:null,capHeight:le,className:tt,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:le,diffuseConstant:le,direction:null,display:null,dur:null,divisor:le,dominantBaseline:null,download:De,dx:null,dy:null,edgeMode:null,editable:null,elevation:le,enableBackground:null,end:null,event:null,exponent:le,externalResourcesRequired:null,fill:null,fillOpacity:le,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:qi,g2:qi,glyphName:qi,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:le,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:le,horizOriginX:le,horizOriginY:le,id:null,ideographic:le,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:le,k:le,k1:le,k2:le,k3:le,k4:le,kernelMatrix:bn,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:le,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:le,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:le,overlineThickness:le,paintOrder:null,panose1:null,path:null,pathLength:le,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:tt,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:le,pointsAtY:le,pointsAtZ:le,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:bn,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:bn,rev:bn,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:bn,requiredFeatures:bn,requiredFonts:bn,requiredFormats:bn,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:le,specularExponent:le,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:le,strikethroughThickness:le,string:null,stroke:null,strokeDashArray:bn,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:le,strokeOpacity:le,strokeWidth:null,style:null,surfaceScale:le,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:bn,tabIndex:le,tableValues:null,target:null,targetX:le,targetY:le,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:bn,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:le,underlineThickness:le,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:le,values:null,vAlphabetic:le,vMathematical:le,vectorEffect:null,vHanging:le,vIdeographic:le,version:null,vertAdvY:le,vertOriginX:le,vertOriginY:le,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:le,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:ik}),ok=Ys({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()}}),ak=Ys({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:sk}),lk=Ys({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),VD={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"},zD=/[A-Z]/g,nx=/-[a-z]/g,BD=/^data[-\w.:]+$/i;function UD(e,t){const n=Ah(t);let r=t,s=vn;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&BD.test(t)){if(t.charAt(4)==="-"){const a=t.slice(5).replace(nx,HD);r="data"+a.charAt(0).toUpperCase()+a.slice(1)}else{const a=t.slice(4);if(!nx.test(a)){let l=a.replace(zD,$D);l.charAt(0)!=="-"&&(l="-"+l),t="data"+l}}s=qp}return new s(r,t)}function $D(e){return"-"+e.toLowerCase()}function HD(e){return e.charAt(1).toUpperCase()}const WD=nk([rk,OD,ok,ak,lk],"html"),Gp=nk([rk,FD,ok,ak,lk],"svg");function qD(e){return e.join(" ").trim()}var Cs={},xf,rx;function GD(){if(rx)return xf;rx=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,n=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,s=/^:\s*/,a=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,l=/^[;\s]*/,c=/^\s+|\s+$/g,d=`
273
- `,h="/",p="*",m="",y="comment",w="declaration";function k(E,P){if(typeof E!="string")throw new TypeError("First argument must be a string");if(!E)return[];P=P||{};var R=1,_=1;function j(J){var Z=J.match(t);Z&&(R+=Z.length);var ve=J.lastIndexOf(d);_=~ve?J.length-ve:_+J.length}function A(){var J={line:R,column:_};return function(Z){return Z.position=new N(J),D(),Z}}function N(J){this.start=J,this.end={line:R,column:_},this.source=P.source}N.prototype.content=E;function q(J){var Z=new Error(P.source+":"+R+":"+_+": "+J);if(Z.reason=J,Z.filename=P.source,Z.line=R,Z.column=_,Z.source=E,!P.silent)throw Z}function B(J){var Z=J.exec(E);if(Z){var ve=Z[0];return j(ve),E=E.slice(ve.length),Z}}function D(){B(n)}function I(J){var Z;for(J=J||[];Z=U();)Z!==!1&&J.push(Z);return J}function U(){var J=A();if(!(h!=E.charAt(0)||p!=E.charAt(1))){for(var Z=2;m!=E.charAt(Z)&&(p!=E.charAt(Z)||h!=E.charAt(Z+1));)++Z;if(Z+=2,m===E.charAt(Z-1))return q("End of comment missing");var ve=E.slice(2,Z-2);return _+=2,j(ve),E=E.slice(Z),_+=2,J({type:y,comment:ve})}}function z(){var J=A(),Z=B(r);if(Z){if(U(),!B(s))return q("property missing ':'");var ve=B(a),Se=J({type:w,property:b(Z[0].replace(e,m)),value:ve?b(ve[0].replace(e,m)):m});return B(l),Se}}function he(){var J=[];I(J);for(var Z;Z=z();)Z!==!1&&(J.push(Z),I(J));return J}return D(),he()}function b(E){return E?E.replace(c,m):m}return xf=k,xf}var ix;function KD(){if(ix)return Cs;ix=1;var e=Cs&&Cs.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Cs,"__esModule",{value:!0}),Cs.default=n;const t=e(GD());function n(r,s){let a=null;if(!r||typeof r!="string")return a;const l=(0,t.default)(r),c=typeof s=="function";return l.forEach(d=>{if(d.type!=="declaration")return;const{property:h,value:p}=d;c?s(h,p,d):p&&(a=a||{},a[h]=p)}),a}return Cs}var Vo={},sx;function XD(){if(sx)return Vo;sx=1,Object.defineProperty(Vo,"__esModule",{value:!0}),Vo.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,t=/-([a-z])/g,n=/^[^-]+$/,r=/^-(webkit|moz|ms|o|khtml)-/,s=/^-(ms)-/,a=function(h){return!h||n.test(h)||e.test(h)},l=function(h,p){return p.toUpperCase()},c=function(h,p){return"".concat(p,"-")},d=function(h,p){return p===void 0&&(p={}),a(h)?h:(h=h.toLowerCase(),p.reactCompat?h=h.replace(s,c):h=h.replace(r,c),h.replace(t,l))};return Vo.camelCase=d,Vo}var zo,ox;function YD(){if(ox)return zo;ox=1;var e=zo&&zo.__importDefault||function(s){return s&&s.__esModule?s:{default:s}},t=e(KD()),n=XD();function r(s,a){var l={};return!s||typeof s!="string"||(0,t.default)(s,function(c,d){c&&d&&(l[(0,n.camelCase)(c,a)]=d)}),l}return r.default=r,zo=r,zo}var QD=YD();const JD=Zh(QD),uk=ck("end"),Kp=ck("start");function ck(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 ZD(e){const t=Kp(e),n=uk(e);if(t&&n)return{start:t,end:n}}class Zt extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let s="",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"?s=t:!a.cause&&t&&(l=!0,s=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=s,this.line=c?c.line:void 0,this.name=Jo(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}}Zt.prototype.file="";Zt.prototype.name="";Zt.prototype.reason="";Zt.prototype.message="";Zt.prototype.stack="";Zt.prototype.column=void 0;Zt.prototype.line=void 0;Zt.prototype.ancestors=void 0;Zt.prototype.cause=void 0;Zt.prototype.fatal=void 0;Zt.prototype.place=void 0;Zt.prototype.ruleId=void 0;Zt.prototype.source=void 0;const Xp={}.hasOwnProperty,eO=new Map,tO=/[A-Z]/g,nO=new Set(["table","tbody","thead","tfoot","tr"]),rO=new Set(["td","th"]),dk="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function iO(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=fO(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=dO(n,t.jsx,t.jsxs)}const s={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"?Gp:WD,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},a=fk(s,e,void 0);return a&&typeof a!="string"?a:s.create(e,s.Fragment,{children:a||void 0},void 0)}function fk(e,t,n){if(t.type==="element")return sO(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return oO(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return lO(e,t,n);if(t.type==="mdxjsEsm")return aO(e,t);if(t.type==="root")return uO(e,t,n);if(t.type==="text")return cO(e,t)}function sO(e,t,n){const r=e.schema;let s=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(s=Gp,e.schema=s),e.ancestors.push(t);const a=pk(e,t.tagName,!1),l=hO(e,t);let c=Qp(e,t);return nO.has(t.tagName)&&(c=c.filter(function(d){return typeof d=="string"?!jD(d):!0})),hk(e,l,a,t),Yp(l,c),e.ancestors.pop(),e.schema=r,e.create(t,a,l,n)}function oO(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)}ha(e,t.position)}function aO(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);ha(e,t.position)}function lO(e,t,n){const r=e.schema;let s=r;t.name==="svg"&&r.space==="html"&&(s=Gp,e.schema=s),e.ancestors.push(t);const a=t.name===null?e.Fragment:pk(e,t.name,!0),l=pO(e,t),c=Qp(e,t);return hk(e,l,a,t),Yp(l,c),e.ancestors.pop(),e.schema=r,e.create(t,a,l,n)}function uO(e,t,n){const r={};return Yp(r,Qp(e,t)),e.create(t,e.Fragment,r,n)}function cO(e,t){return t.value}function hk(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function Yp(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function dO(e,t,n){return r;function r(s,a,l,c){const h=Array.isArray(l.children)?n:t;return c?h(a,l,c):h(a,l)}}function fO(e,t){return n;function n(r,s,a,l){const c=Array.isArray(a.children),d=Kp(r);return t(s,a,l,c,{columnNumber:d?d.column-1:void 0,fileName:e,lineNumber:d?d.line:void 0},void 0)}}function hO(e,t){const n={};let r,s;for(s in t.properties)if(s!=="children"&&Xp.call(t.properties,s)){const a=mO(e,s,t.properties[s]);if(a){const[l,c]=a;e.tableCellAlignToStyle&&l==="align"&&typeof c=="string"&&rO.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 pO(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 ha(e,t.position);else{const s=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 ha(e,t.position);else a=r.value===null?!0:r.value;n[s]=a}return n}function Qp(e,t){const n=[];let r=-1;const s=e.passKeys?new Map:eO;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 h=s.get(d)||0;l=d+"-"+h,s.set(d,h+1)}}const c=fk(e,a,l);c!==void 0&&n.push(c)}return n}function mO(e,t,n){const r=UD(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?AD(n):qD(n)),r.property==="style"){let s=typeof n=="object"?n:gO(e,String(n));return e.stylePropertyNameCase==="css"&&(s=yO(s)),["style",s]}return[e.elementAttributeNameCase==="react"&&r.space?VD[r.property]||r.property:r.attribute,n]}}function gO(e,t){try{return JD(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const r=n,s=new Zt("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:r,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw s.file=e.filePath||void 0,s.url=dk+"#cannot-parse-style-attribute",s}}function pk(e,t,n){let r;if(!n)r={type:"Literal",value:t};else if(t.includes(".")){const s=t.split(".");let a=-1,l;for(;++a<s.length;){const c=Z0(s[a])?{type:"Identifier",name:s[a]}:{type:"Literal",value:s[a]};l=l?{type:"MemberExpression",object:l,property:c,computed:!!(a&&c.type==="Literal"),optional:!1}:c}r=l}else r=Z0(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const s=r.value;return Xp.call(e.components,s)?e.components[s]:s}if(e.evaluater)return e.evaluater.evaluateExpression(r);ha(e)}function ha(e,t){const n=new Zt("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=dk+"#cannot-handle-mdx-estrees-without-createevaluater",n}function yO(e){const t={};let n;for(n in e)Xp.call(e,n)&&(t[vO(n)]=e[n]);return t}function vO(e){let t=e.replace(tO,xO);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function xO(e){return"-"+e.toLowerCase()}const wf={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"]};function wO(e){const t=this;t.parser=n;function n(r){return jS(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function SO(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 kO(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
274
- `}]}function CO(e,t){const n=t.value?t.value+`
275
- `:"",r={},s=t.lang?t.lang.split(/\s+/):[];s.length>0&&(r.className=["language-"+s[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 bO(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function EO(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function _O(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),s=Xs(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-"+s,id:n+"fnref-"+s+(c>1?"-"+c:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(l)}]};e.patch(t,d);const h={type:"element",tagName:"sup",properties:{},children:[d]};return e.patch(t,h),e.applyData(t,h)}function PO(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 TO(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function mk(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 s=e.all(t),a=s[0];a&&a.type==="text"?a.value="["+a.value:s.unshift({type:"text",value:"["});const l=s[s.length-1];return l&&l.type==="text"?l.value+=r:s.push({type:"text",value:r}),s}function RO(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return mk(e,t);const s={src:Xs(r.url||""),alt:t.alt};r.title!==null&&r.title!==void 0&&(s.title=r.title);const a={type:"element",tagName:"img",properties:s,children:[]};return e.patch(t,a),e.applyData(t,a)}function AO(e,t){const n={src:Xs(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 IO(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 MO(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return mk(e,t);const s={href:Xs(r.url||"")};r.title!==null&&r.title!==void 0&&(s.title=r.title);const a={type:"element",tagName:"a",properties:s,children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}function NO(e,t){const n={href:Xs(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 LO(e,t,n){const r=e.all(t),s=n?jO(n):gk(t),a={},l=[];if(typeof t.checked=="boolean"){const p=r[0];let m;p&&p.type==="element"&&p.tagName==="p"?m=p:(m={type:"element",tagName:"p",properties:{},children:[]},r.unshift(m)),m.children.length>0&&m.children.unshift({type:"text",value:" "}),m.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 p=r[c];(s||c!==0||p.type!=="element"||p.tagName!=="p")&&l.push({type:"text",value:`
276
- `}),p.type==="element"&&p.tagName==="p"&&!s?l.push(...p.children):l.push(p)}const d=r[r.length-1];d&&(s||d.type!=="element"||d.tagName!=="p")&&l.push({type:"text",value:`
277
- `});const h={type:"element",tagName:"li",properties:a,children:l};return e.patch(t,h),e.applyData(t,h)}function jO(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=gk(n[r])}return t}function gk(e){const t=e.spread;return t??e.children.length>1}function DO(e,t){const n={},r=e.all(t);let s=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++s<r.length;){const l=r[s];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 OO(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function FO(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function VO(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function zO(e,t){const n=e.all(t),r=n.shift(),s=[];if(r){const l={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],l),s.push(l)}if(n.length>0){const l={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},c=Kp(t.children[1]),d=uk(t.children[t.children.length-1]);c&&d&&(l.position={start:c,end:d}),s.push(l)}const a={type:"element",tagName:"table",properties:{},children:e.wrap(s,!0)};return e.patch(t,a),e.applyData(t,a)}function BO(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 h=[];for(;++d<c;){const m=t.children[d],y={},w=l?l[d]:void 0;w&&(y.align=w);let k={type:"element",tagName:a,properties:y,children:[]};m&&(k.children=e.all(m),e.patch(m,k),k=e.applyData(m,k)),h.push(k)}const p={type:"element",tagName:"tr",properties:{},children:e.wrap(h,!0)};return e.patch(t,p),e.applyData(t,p)}function UO(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const ax=9,lx=32;function $O(e){const t=String(e),n=/\r?\n|\r/g;let r=n.exec(t),s=0;const a=[];for(;r;)a.push(ux(t.slice(s,r.index),s>0,!0),r[0]),s=r.index+r[0].length,r=n.exec(t);return a.push(ux(t.slice(s),s>0,!1)),a.join("")}function ux(e,t,n){let r=0,s=e.length;if(t){let a=e.codePointAt(r);for(;a===ax||a===lx;)r++,a=e.codePointAt(r)}if(n){let a=e.codePointAt(s-1);for(;a===ax||a===lx;)s--,a=e.codePointAt(s-1)}return s>r?e.slice(r,s):""}function HO(e,t){const n={type:"text",value:$O(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function WO(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const qO={blockquote:SO,break:kO,code:CO,delete:bO,emphasis:EO,footnoteReference:_O,heading:PO,html:TO,imageReference:RO,image:AO,inlineCode:IO,linkReference:MO,link:NO,listItem:LO,list:DO,paragraph:OO,root:FO,strong:VO,table:zO,tableCell:UO,tableRow:BO,text:HO,thematicBreak:WO,toml:$l,yaml:$l,definition:$l,footnoteDefinition:$l};function $l(){}const yk=-1,sc=0,Zo=1,Lu=2,Jp=3,Zp=4,em=5,tm=6,vk=7,xk=8,{defineProperty:GO}=Object,wk=typeof self=="object"?self:globalThis,cx=(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 wk[e](t)},KO=(e,t)=>{const n=(s,a)=>(e.set(a,s),s),r=s=>{if(e.has(s))return e.get(s);const[a,l]=t[s];switch(a){case sc:case yk:return n(l,s);case Zo:{const c=n([],s);for(const d of l)c.push(r(d));return c}case Lu:{const c=n({},s);for(const[d,h]of l){const p=r(d),m=r(h);p==="__proto__"?GO(c,p,{value:m,configurable:!0,enumerable:!0,writable:!0}):c[p]=m}return c}case Jp:return n(new Date(l),s);case Zp:{const{source:c,flags:d}=l;return n(new RegExp(c,d),s)}case em:{const c=n(new Map,s);for(const[d,h]of l)c.set(r(d),r(h));return c}case tm:{const c=n(new Set,s);for(const d of l)c.add(r(d));return c}case vk:{const{name:c,message:d}=l;return n(typeof wk[c]=="function"?cx(c,d):new Error(d),s)}case xk:return n(BigInt(l),s);case"BigInt":return n(Object(BigInt(l)),s);case"ArrayBuffer":return n(new Uint8Array(l).buffer,l);case"DataView":{const{buffer:c}=new Uint8Array(l);return n(new DataView(c),l)}case"-0":return-0}return n(cx(a,l),s)};return r},dx=e=>KO(new Map,e)(0),Ni="",{toString:XO}={},{keys:YO,is:QO}=Object,Bo=e=>{const t=typeof e;if(t!=="object"||!e)return[sc,t];const n=XO.call(e).slice(8,-1);switch(n){case"Array":return[Zo,Ni];case"Object":return[Lu,Ni];case"Date":return[Jp,Ni];case"RegExp":return[Zp,Ni];case"Map":return[em,Ni];case"Set":return[tm,Ni];case"DataView":return[Zo,n]}return n.includes("Array")?[Zo,n]:e instanceof Error?[vk,e.name||"Error"]:[Lu,n]},Hl=([e,t])=>e===sc&&(t==="function"||t==="symbol"),JO=(e,t,n,r)=>{const s=(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]=Bo(l);switch(c){case sc:{let p=l;switch(d){case"bigint":c=xk,p=l.toString();break;case"number":if(!l&&QO(l,-0))return r.push(["-0"])-1;break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+d);p=null;break;case"undefined":return s([yk],l)}return s([c,p],l)}case Zo:{if(d){let y=l;return d==="DataView"?y=new Uint8Array(l.buffer):d==="ArrayBuffer"&&(y=new Uint8Array(l)),s([d,[...y]],l)}const p=[],m=s([c,p],l);for(const y of l)p.push(a(y));return m}case Lu:{if(d)switch(d){case"BigInt":return s([d,l.toString()],l);case"Boolean":case"Number":case"String":return s([d,l.valueOf()],l)}if(t&&"toJSON"in l)return a(l.toJSON());const p=[],m=s([c,p],l);for(const y of YO(l))(e||!Hl(Bo(l[y])))&&p.push([a(y),a(l[y])]);return m}case Jp:return s([c,isNaN(l.getTime())?Ni:l.toISOString()],l);case Zp:{const{source:p,flags:m}=l;return s([c,{source:p,flags:m}],l)}case em:{const p=[],m=s([c,p],l);for(const[y,w]of l)(e||!(Hl(Bo(y))||Hl(Bo(w))))&&p.push([a(y),a(w)]);return m}case tm:{const p=[],m=s([c,p],l);for(const y of l)(e||!Hl(Bo(y)))&&p.push(a(y));return m}}const{message:h}=l;return s([c,{name:d,message:h}],l)};return a},fx=(e,{json:t,lossy:n}={})=>{const r=[];return JO(!(t||n),!!t,new Map,r)(e),r},ju=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?dx(fx(e,t)):structuredClone(e):(e,t)=>dx(fx(e,t));function ZO(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 e3(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function t3(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||ZO,r=e.options.footnoteBackLabel||e3,s=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 h=e.footnoteById.get(e.footnoteOrder[d]);if(!h)continue;const p=e.all(h),m=String(h.identifier).toUpperCase(),y=Xs(m.toLowerCase());let w=0;const k=[],b=e.footnoteCounts.get(m);for(;b!==void 0&&++w<=b;){k.length>0&&k.push({type:"text",value:" "});let R=typeof n=="string"?n:n(d,w);typeof R=="string"&&(R={type:"text",value:R}),k.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+y+(w>1?"-"+w:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(d,w),className:["data-footnote-backref"]},children:Array.isArray(R)?R:[R]})}const E=p[p.length-1];if(E&&E.type==="element"&&E.tagName==="p"){const R=E.children[E.children.length-1];R&&R.type==="text"?R.value+=" ":E.children.push({type:"text",value:" "}),E.children.push(...k)}else p.push(...k);const P={type:"element",tagName:"li",properties:{id:t+"fn-"+y},children:e.wrap(p,!0)};e.patch(h,P),c.push(P)}if(c.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:a,properties:{...ju(l),id:"footnote-label"},children:[{type:"text",value:s}]},{type:"text",value:`
278
- `},{type:"element",tagName:"ol",properties:{},children:e.wrap(c,!0)},{type:"text",value:`
279
- `}]}}const Nh={}.hasOwnProperty,n3={};function r3(e,t){const n=t||n3,r=new Map,s=new Map,a=new Map,l={...qO,...n.handlers},c={all:h,applyData:s3,definitionById:r,footnoteById:s,footnoteCounts:a,footnoteOrder:[],handlers:l,one:d,options:n,patch:i3,wrap:a3};return Dp(e,function(p){if(p.type==="definition"||p.type==="footnoteDefinition"){const m=p.type==="definition"?r:s,y=String(p.identifier).toUpperCase();m.has(y)||m.set(y,p)}}),c;function d(p,m){const y=p.type,w=c.handlers[y];if(Nh.call(c.handlers,y)&&w)return w(c,p,m);if(c.options.passThrough&&c.options.passThrough.includes(y)){if("children"in p){const{children:b,...E}=p,P=ju(E);return P.children=c.all(p),P}return ju(p)}return(c.options.unknownHandler||o3)(c,p,m)}function h(p){const m=[];if("children"in p){const y=p.children;let w=-1;for(;++w<y.length;){const k=c.one(y[w],p);if(k){if(w&&y[w-1].type==="break"&&(!Array.isArray(k)&&k.type==="text"&&(k.value=hx(k.value)),!Array.isArray(k)&&k.type==="element")){const b=k.children[0];b&&b.type==="text"&&(b.value=hx(b.value))}Array.isArray(k)?m.push(...k):m.push(k)}}}return m}}function i3(e,t){e.position&&(t.position=ZD(e))}function s3(e,t){let n=t;if(e&&e.data){const r=e.data.hName,s=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,ju(a)),"children"in n&&n.children&&s!==null&&s!==void 0&&(n.children=s)}return n}function o3(e,t){const n=t.data||{},r="value"in t&&!(Nh.call(n,"hProperties")||Nh.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 a3(e,t){const n=[];let r=-1;for(t&&n.push({type:"text",value:`
280
- `});++r<e.length;)r&&n.push({type:"text",value:`
281
- `}),n.push(e[r]);return t&&e.length>0&&n.push({type:"text",value:`
282
- `}),n}function hx(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function px(e,t){const n=r3(e,t),r=n.one(e,void 0),s=t3(n),a=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return s&&a.children.push({type:"text",value:`
283
- `},s),a}function l3(e,t){return e&&"run"in e?async function(n,r){const s=px(n,{file:r,...t});await e.run(s,r)}:function(n,r){return px(n,{file:r,...e||t})}}function mx(e){if(e)throw e}var Sf,gx;function u3(){if(gx)return Sf;gx=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,s=function(h){return typeof Array.isArray=="function"?Array.isArray(h):t.call(h)==="[object Array]"},a=function(h){if(!h||t.call(h)!=="[object Object]")return!1;var p=e.call(h,"constructor"),m=h.constructor&&h.constructor.prototype&&e.call(h.constructor.prototype,"isPrototypeOf");if(h.constructor&&!p&&!m)return!1;var y;for(y in h);return typeof y>"u"||e.call(h,y)},l=function(h,p){n&&p.name==="__proto__"?n(h,p.name,{enumerable:!0,configurable:!0,value:p.newValue,writable:!0}):h[p.name]=p.newValue},c=function(h,p){if(p==="__proto__")if(e.call(h,p)){if(r)return r(h,p).value}else return;return h[p]};return Sf=function d(){var h,p,m,y,w,k,b=arguments[0],E=1,P=arguments.length,R=!1;for(typeof b=="boolean"&&(R=b,b=arguments[1]||{},E=2),(b==null||typeof b!="object"&&typeof b!="function")&&(b={});E<P;++E)if(h=arguments[E],h!=null)for(p in h)m=c(b,p),y=c(h,p),b!==y&&(R&&y&&(a(y)||(w=s(y)))?(w?(w=!1,k=m&&s(m)?m:[]):k=m&&a(m)?m:{},l(b,{name:p,newValue:d(R,k,y)})):typeof y<"u"&&l(b,{name:p,newValue:y}));return b},Sf}var c3=u3();const kf=Zh(c3);function Lh(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 d3(){const e=[],t={run:n,use:r};return t;function n(...s){let a=-1;const l=s.pop();if(typeof l!="function")throw new TypeError("Expected function as last argument, not "+l);c(null,...s);function c(d,...h){const p=e[++a];let m=-1;if(d){l(d);return}for(;++m<s.length;)(h[m]===null||h[m]===void 0)&&(h[m]=s[m]);s=h,p?f3(p,c)(...h):l(null,...h)}}function r(s){if(typeof s!="function")throw new TypeError("Expected `middelware` to be a function, not "+s);return e.push(s),t}}function f3(e,t){let n;return r;function r(...l){const c=e.length>l.length;let d;c&&l.push(s);try{d=e.apply(this,l)}catch(h){const p=h;if(c&&n)throw p;return s(p)}c||(d&&d.then&&typeof d.then=="function"?d.then(a,s):d instanceof Error?s(d):a(d))}function s(l,...c){n||(n=!0,t(l,...c))}function a(l){s(null,l)}}const dr={basename:h3,dirname:p3,extname:m3,join:g3,sep:"/"};function h3(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');_a(e);let n=0,r=-1,s=e.length,a;if(t===void 0||t.length===0||t.length>e.length){for(;s--;)if(e.codePointAt(s)===47){if(a){n=s+1;break}}else r<0&&(a=!0,r=s+1);return r<0?"":e.slice(n,r)}if(t===e)return"";let l=-1,c=t.length-1;for(;s--;)if(e.codePointAt(s)===47){if(a){n=s+1;break}}else l<0&&(a=!0,l=s+1),c>-1&&(e.codePointAt(s)===t.codePointAt(c--)?c<0&&(r=s):(c=-1,r=l));return n===r?r=l:r<0&&(r=e.length),e.slice(n,r)}function p3(e){if(_a(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 m3(e){_a(e);let t=e.length,n=-1,r=0,s=-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?s<0?s=t:a!==1&&(a=1):s>-1&&(a=-1)}return s<0||n<0||a===0||a===1&&s===n-1&&s===r+1?"":e.slice(s,n)}function g3(...e){let t=-1,n;for(;++t<e.length;)_a(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":y3(n)}function y3(e){_a(e);const t=e.codePointAt(0)===47;let n=v3(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function v3(e,t){let n="",r=0,s=-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(!(s===l-1||a===1))if(s!==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("/")),s=l,a=0;continue}}else if(n.length>0){n="",r=0,s=l,a=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(s+1,l):n=e.slice(s+1,l),r=l-s-1;s=l,a=0}else c===46&&a>-1?a++:a=-1}return n}function _a(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const x3={cwd:w3};function w3(){return"/"}function jh(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function S3(e){if(typeof e=="string")e=new URL(e);else if(!jh(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 k3(e)}function k3(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 s=new TypeError("File URL path must not include encoded / characters");throw s.code="ERR_INVALID_FILE_URL_PATH",s}}return decodeURIComponent(t)}const Cf=["history","path","basename","stem","extname","dirname"];class Sk{constructor(t){let n;t?jh(t)?n={path:t}:typeof t=="string"||C3(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":x3.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<Cf.length;){const a=Cf[r];a in n&&n[a]!==void 0&&n[a]!==null&&(this[a]=a==="history"?[...n[a]]:n[a])}let s;for(s in n)Cf.includes(s)||(this[s]=n[s])}get basename(){return typeof this.path=="string"?dr.basename(this.path):void 0}set basename(t){Ef(t,"basename"),bf(t,"basename"),this.path=dr.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?dr.dirname(this.path):void 0}set dirname(t){yx(this.basename,"dirname"),this.path=dr.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?dr.extname(this.path):void 0}set extname(t){if(bf(t,"extname"),yx(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=dr.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){jh(t)&&(t=S3(t)),Ef(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?dr.basename(this.path,this.extname):void 0}set stem(t){Ef(t,"stem"),bf(t,"stem"),this.path=dr.join(this.dirname||"",t+(this.extname||""))}fail(t,n,r){const s=this.message(t,n,r);throw s.fatal=!0,s}info(t,n,r){const s=this.message(t,n,r);return s.fatal=void 0,s}message(t,n,r){const s=new Zt(t,n,r);return this.path&&(s.name=this.path+":"+s.name,s.file=this.path),s.fatal=!1,this.messages.push(s),s}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}}function bf(e,t){if(e&&e.includes(dr.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+dr.sep+"`")}function Ef(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function yx(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function C3(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const b3=(function(e){const r=this.constructor.prototype,s=r[e],a=function(){return s.apply(a,arguments)};return Object.setPrototypeOf(a,r),a}),E3={}.hasOwnProperty;class nm extends b3{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=d3()}copy(){const t=new nm;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];t.use(...r)}return t.data(kf(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(Tf("data",this.frozen),this.namespace[t]=n,this):E3.call(this.namespace,t)&&this.namespace[t]||void 0:t?(Tf("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 s=n.call(t,...r);typeof s=="function"&&this.transformers.use(s)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();const n=Wl(t),r=this.parser||this.Parser;return _f("parse",r),r(String(n),n)}process(t,n){const r=this;return this.freeze(),_f("process",this.parser||this.Parser),Pf("process",this.compiler||this.Compiler),n?s(void 0,n):new Promise(s);function s(a,l){const c=Wl(t),d=r.parse(c);r.run(d,c,function(p,m,y){if(p||!m||!y)return h(p);const w=m,k=r.stringify(w,y);T3(k)?y.value=k:y.result=k,h(p,y)});function h(p,m){p||!m?l(p):a?a(m):n(void 0,m)}}}processSync(t){let n=!1,r;return this.freeze(),_f("processSync",this.parser||this.Parser),Pf("processSync",this.compiler||this.Compiler),this.process(t,s),xx("processSync","process",n),r;function s(a,l){n=!0,mx(a),r=l}}run(t,n,r){vx(t),this.freeze();const s=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=Wl(n);s.run(t,d,h);function h(p,m,y){const w=m||t;p?c(p):l?l(w):r(void 0,w,y)}}}runSync(t,n){let r=!1,s;return this.run(t,n,a),xx("runSync","run",r),s;function a(l,c){mx(l),s=c,r=!0}}stringify(t,n){this.freeze();const r=Wl(n),s=this.compiler||this.Compiler;return Pf("stringify",s),vx(t),s(t,r)}use(t,...n){const r=this.attachers,s=this.namespace;if(Tf("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(h){if(typeof h=="function")d(h,[]);else if(typeof h=="object")if(Array.isArray(h)){const[p,...m]=h;d(p,m)}else l(h);else throw new TypeError("Expected usable value, not `"+h+"`")}function l(h){if(!("plugins"in h)&&!("settings"in h))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(h.plugins),h.settings&&(s.settings=kf(!0,s.settings,h.settings))}function c(h){let p=-1;if(h!=null)if(Array.isArray(h))for(;++p<h.length;){const m=h[p];a(m)}else throw new TypeError("Expected a list of plugins, not `"+h+"`")}function d(h,p){let m=-1,y=-1;for(;++m<r.length;)if(r[m][0]===h){y=m;break}if(y===-1)r.push([h,...p]);else if(p.length>0){let[w,...k]=p;const b=r[y][1];Lh(b)&&Lh(w)&&(w=kf(!0,b,w)),r[y]=[h,w,...k]}}}}const _3=new nm().freeze();function _f(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function Pf(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function Tf(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 vx(e){if(!Lh(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function xx(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function Wl(e){return P3(e)?e:new Sk(e)}function P3(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function T3(e){return typeof e=="string"||R3(e)}function R3(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const A3="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",wx=[],Sx={allowDangerousHtml:!0},I3=/^(https?|ircs?|mailto|xmpp)$/i,M3=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"className",id:"remove-classname"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function kk(e){const t=N3(e),n=L3(e);return j3(t.runSync(t.parse(n),n),e)}function N3(e){const t=e.rehypePlugins||wx,n=e.remarkPlugins||wx,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...Sx}:Sx;return _3().use(wO).use(n).use(l3,r).use(t)}function L3(e){const t=e.children||"",n=new Sk;return typeof t=="string"&&(n.value=t),n}function j3(e,t){const n=t.allowedElements,r=t.allowElement,s=t.components,a=t.disallowedElements,l=t.skipHtml,c=t.unwrapDisallowed,d=t.urlTransform||D3;for(const p of M3)Object.hasOwn(t,p.from)&&(""+p.from+(p.to?"use `"+p.to+"` instead":"remove it")+A3+p.id,void 0);return Dp(e,h),iO(e,{Fragment:v.Fragment,components:s,ignoreInvalidStyle:!0,jsx:v.jsx,jsxs:v.jsxs,passKeys:!0,passNode:!0});function h(p,m,y){if(p.type==="raw"&&y&&typeof m=="number")return l?y.children.splice(m,1):y.children[m]={type:"text",value:p.value},m;if(p.type==="element"){let w;for(w in wf)if(Object.hasOwn(wf,w)&&Object.hasOwn(p.properties,w)){const k=p.properties[w],b=wf[w];(b===null||b.includes(p.tagName))&&(p.properties[w]=d(String(k||""),w,p))}}if(p.type==="element"){let w=n?!n.includes(p.tagName):a?a.includes(p.tagName):!1;if(!w&&r&&typeof m=="number"&&(w=!r(p,m,y)),w&&y&&typeof m=="number")return c&&p.children?y.children.splice(m,1,...p.children):y.children.splice(m,1),m}}}function D3(e){const t=e.indexOf(":"),n=e.indexOf("?"),r=e.indexOf("#"),s=e.indexOf("/");return t===-1||s!==-1&&t>s||n!==-1&&t>n||r!==-1&&t>r||I3.test(e.slice(0,t))?e:""}const O3={};function Ck(e){const t=this,n=e||O3,r=t.data(),s=r.micromarkExtensions||(r.micromarkExtensions=[]),a=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),l=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);s.push(WS(n)),a.push(CS()),l.push(EN(n))}var F3=Object.defineProperty,Qs=(e,t)=>F3(e,"name",{value:t,configurable:!0}),bk=!!(typeof window<"u"&&window.document&&window.document.createElement);function ui(e,t,{checkForDefaultPrevented:n=!0}={}){return Qs(function(s){if(e?.(s),n===!1||!s||!s.defaultPrevented)return t?.(s)},"handleEvent")}Qs(ui,"composeEventHandlers");function V3(e){if(!bk)throw new Error("Cannot access window outside of the DOM");return e?.ownerDocument?.defaultView??window}Qs(V3,"getOwnerWindow");function Dh(e){if(!bk)throw new Error("Cannot access document outside of the DOM");return e?.ownerDocument??document}Qs(Dh,"getOwnerDocument");function Ek(e,t=!1){const{activeElement:n}=Dh(e);if(!n?.nodeName)return null;if(_k(n)&&n.contentDocument)return Ek(n.contentDocument.body,t);if(t){const r=n.getAttribute("aria-activedescendant");if(r){const s=Dh(n).getElementById(r);if(s)return s}}return n}Qs(Ek,"getActiveElement");function _k(e){return e.tagName==="IFRAME"}Qs(_k,"isFrame");var z3=Object.defineProperty,rm=(e,t)=>z3(e,"name",{value:t,configurable:!0});function Oh(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}rm(Oh,"setRef");function Pk(...e){return t=>{let n=!1;const r=e.map(s=>{const a=Oh(s,t);return!n&&typeof a=="function"&&(n=!0),a});if(n)return()=>{for(let s=0;s<r.length;s++){const a=r[s];typeof a=="function"?a():Oh(e[s],null)}}}}rm(Pk,"composeRefs");function Js(...e){return S.useCallback(Pk(...e),e)}rm(Js,"useComposedRefs");var B3=Object.defineProperty,On=(e,t)=>B3(e,"name",{value:t,configurable:!0});function U3(e,t){const n=S.createContext(t);n.displayName=e+"Context";const r=On(a=>{const{children:l,...c}=a,d=S.useMemo(()=>c,Object.values(c));return v.jsx(n.Provider,{value:d,children:l})},"Provider");r.displayName=e+"Provider";function s(a,l={}){const{optional:c=!1}=l,d=S.useContext(n);if(d)return d;if(t!==void 0)return t;if(!c)throw new Error(`\`${a}\` must be used within \`${e}\``)}return On(s,"useContext"),[r,s]}On(U3,"createContext");function Tk(e,t=[]){let n=[];function r(a,l){const c=S.createContext(l);c.displayName=a+"Context";const d=n.length;n=[...n,l];const h=On(m=>{const{scope:y,children:w,...k}=m,b=y?.[e]?.[d]||c,E=S.useMemo(()=>k,Object.values(k));return v.jsx(b.Provider,{value:E,children:w})},"Provider");h.displayName=a+"Provider";function p(m,y,w={}){const{optional:k=!1}=w,b=y?.[e]?.[d]||c,E=S.useContext(b);if(E)return E;if(l!==void 0)return l;if(!k)throw new Error(`\`${m}\` must be used within \`${a}\``)}return On(p,"useContext"),[h,p]}On(r,"createContext");const s=On(()=>{const a=n.map(l=>S.createContext(l));return On(function(c){const d=c?.[e]||a;return S.useMemo(()=>({[`__scope${e}`]:{...c,[e]:d}}),[c,d])},"useScope")},"createScope");return s.scopeName=e,[r,Rk(s,...t)]}On(Tk,"createContextScope");function Rk(...e){const t=e[0];if(e.length===1)return t;const n=On(()=>{const r=e.map(s=>({useScope:s(),scopeName:s.scopeName}));return On(function(a){const l=r.reduce((c,{useScope:d,scopeName:h})=>{const m=d(a)[`__scope${h}`];return{...c,...m}},{});return S.useMemo(()=>({[`__scope${t.scopeName}`]:l}),[l])},"useComposedScopes")},"createScope");return n.scopeName=t.scopeName,n}On(Rk,"composeContextScopes");var hi=globalThis?.document?S.useLayoutEffect:()=>{},$3=Object.defineProperty,H3=(e,t)=>$3(e,"name",{value:t,configurable:!0}),W3=ya[" useId ".trim().toString()]||(()=>{}),q3=0;function du(e){const[t,n]=S.useState(W3());return hi(()=>{e||n(r=>r??String(q3++))},[e]),e||(t?`radix-${t}`:"")}H3(du,"useId");var G3=Object.defineProperty,K3=(e,t)=>G3(e,"name",{value:t,configurable:!0}),kx=ya[" useEffectEvent ".trim().toString()],Cx=ya[" useInsertionEffect ".trim().toString()];function Ak(e){if(typeof kx=="function")return kx(e);const t=S.useRef(()=>{throw new Error("Cannot call an event handler while rendering.")});return typeof Cx=="function"?Cx(()=>{t.current=e}):hi(()=>{t.current=e}),S.useMemo(()=>((...n)=>t.current?.(...n)),[])}K3(Ak,"useEffectEvent");var X3=Object.defineProperty,Pa=(e,t)=>X3(e,"name",{value:t,configurable:!0}),Y3=ya[" useInsertionEffect ".trim().toString()]||hi;function Ik({prop:e,defaultProp:t,onChange:n=Pa(()=>{},"onChange"),caller:r}){const[s,a,l]=Mk({defaultProp:t,onChange:n}),c=e!==void 0,d=c?e:s,h=S.useCallback(p=>{if(c){const m=Nk(p)?p(e):p;m!==e&&l.current?.(m)}else a(p)},[c,e,a,l]);return[d,h]}Pa(Ik,"useControllableState");function Mk({defaultProp:e,onChange:t}){const[n,r]=S.useState(e),s=S.useRef(n),a=S.useRef(t);return Y3(()=>{a.current=t},[t]),S.useEffect(()=>{s.current!==n&&(a.current?.(n),s.current=n)},[n,s]),[n,r,a]}Pa(Mk,"useUncontrolledState");function Nk(e){return typeof e=="function"}Pa(Nk,"isFunction");var bx=Symbol("RADIX:SYNC_STATE");function Q3(e,t,n,r){const{prop:s,defaultProp:a,onChange:l,caller:c}=t,d=s!==void 0,h=Ak(l),p=[{...n,state:a}];r&&p.push(r);const[m,y]=S.useReducer((E,P)=>{if(P.type===bx)return{...E,state:P.state};const R=e(E,P);return d&&!Object.is(R.state,E.state)&&h(R.state),R},...p),w=m.state,k=S.useRef(w);S.useEffect(()=>{k.current!==w&&(k.current=w,d||h(w))},[w,k,d]);const b=S.useMemo(()=>s!==void 0?{...m,state:s}:m,[m,s]);return S.useEffect(()=>{d&&!Object.is(s,m.state)&&y({type:bx,state:s})},[s,m.state,d]),[b,y]}Pa(Q3,"useControllableStateReducer");var Lk=uw(),J3=Object.defineProperty,er=(e,t)=>J3(e,"name",{value:t,configurable:!0});function im(e){const t=S.forwardRef((n,r)=>{let{children:s,...a}=n,l=null,c=!1;const d=[];Fh(s)&&typeof ql=="function"&&(s=ql(s._payload)),S.Children.forEach(s,y=>{if(Fk(y)){c=!0;const w=y;let k="child"in w.props?w.props.child:w.props.children;Fh(k)&&typeof ql=="function"&&(k=ql(k._payload)),l=eF(w,k),d.push(l?.props?.children)}else d.push(y)}),l?l=S.cloneElement(l,void 0,d):!c&&S.Children.count(s)===1&&S.isValidElement(s)&&(l=s);const h=l?Ok(l):void 0,p=Js(r,h);if(!l){if(s||s===0)throw new Error(c?rF(e):nF(e));return s}const m=Dk(a,l.props??{});return l.type!==S.Fragment&&(m.ref=r?p:h),S.cloneElement(l,m)});return t.displayName=`${e}.Slot`,t}er(im,"createSlot");var jk=Symbol.for("radix.slottable");function Z3(e){const t=er(n=>"child"in n?n.children(n.child):n.children,"Slottable");return t.displayName=`${e}.Slottable`,t.__radixId=jk,t}er(Z3,"createSlottable");var eF=er((e,t)=>{if("child"in e.props){const n=e.props.child;return S.isValidElement(n)?S.cloneElement(n,void 0,e.props.children(n.props.children)):null}return S.isValidElement(t)?t:null},"getSlottableElementFromSlottable");function Dk(e,t){const n={...t};for(const r in t){const s=e[r],a=t[r];/^on[A-Z]/.test(r)?s&&a?n[r]=(...c)=>{const d=a(...c);return s(...c),d}:s&&(n[r]=s):r==="style"?n[r]={...s,...a}:r==="className"&&(n[r]=[s,a].filter(Boolean).join(" "))}return{...e,...n}}er(Dk,"mergeProps");function Ok(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}er(Ok,"getElementRef");function Fk(e){return S.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===jk}er(Fk,"isSlottable");var tF=Symbol.for("react.lazy");function Fh(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===tF&&"_payload"in e&&Vk(e._payload)}er(Fh,"isLazyComponent");function Vk(e){return typeof e=="object"&&e!==null&&"then"in e}er(Vk,"isPromiseLike");var nF=er(e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,"createSlotError"),rF=er(e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,"createSlottableError"),ql=ya[" use ".trim().toString()],iF=Object.defineProperty,sF=(e,t)=>iF(e,"name",{value:t,configurable:!0}),oF=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Yi=oF.reduce((e,t)=>{const n=im(`Primitive.${t}`),r=S.forwardRef((s,a)=>{const{asChild:l,...c}=s,d=l?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),v.jsx(d,{...c,ref:a})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function zk(e,t){e&&Lk.flushSync(()=>e.dispatchEvent(t))}sF(zk,"dispatchDiscreteCustomEvent");var aF=Object.defineProperty,lF=(e,t)=>aF(e,"name",{value:t,configurable:!0});function Hs(e){const t=S.useRef(e);return S.useEffect(()=>{t.current=e}),S.useMemo(()=>((...n)=>t.current?.(...n)),[])}lF(Hs,"useCallbackRef");var uF=Object.defineProperty,Ft=(e,t)=>uF(e,"name",{value:t,configurable:!0}),Vh="dismissableLayer.update",cF="dismissableLayer.pointerDownOutside",dF="dismissableLayer.focusOutside",Ex,Bk=S.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),fF=S.forwardRef(Ft(function(t,n){const{disableOutsidePointerEvents:r=!1,deferPointerDownOutside:s=!1,onEscapeKeyDown:a,onPointerDownOutside:l,onFocusOutside:c,onInteractOutside:d,onDismiss:h,...p}=t,m=S.useContext(Bk),[y,w]=S.useState(null),k=y?.ownerDocument??globalThis?.document,[,b]=S.useState({}),E=Js(n,w),P=Array.from(m.layers),[R]=[...m.layersWithOutsidePointerEventsDisabled].slice(-1),_=R?P.indexOf(R):-1,j=y?P.indexOf(y):-1,A=m.layersWithOutsidePointerEventsDisabled.size>0,N=j>=_,q=S.useRef(!1),B=$k(z=>{l?.(z),d?.(z),z.defaultPrevented||h?.()},{ownerDocument:k,deferPointerDownOutside:s,isDeferredPointerDownOutsideRef:q,dismissableSurfaces:m.dismissableSurfaces,shouldHandlePointerDownOutside:S.useCallback(z=>{if(!(z instanceof Node))return!1;const he=[...m.branches].some(J=>J.contains(z));return N&&!he},[m.branches,N])}),D=Hk(z=>{if(s&&q.current)return;const he=z.target;[...m.branches].some(Z=>Z.contains(he))||(c?.(z),d?.(z),z.defaultPrevented||h?.())},k),I=y?j===P.length-1:!1,U=Hs(z=>{z.key==="Escape"&&(a?.(z),!z.defaultPrevented&&h&&(z.preventDefault(),h()))});return S.useEffect(()=>{if(I)return k.addEventListener("keydown",U,{capture:!0}),()=>k.removeEventListener("keydown",U,{capture:!0})},[k,I,U]),S.useEffect(()=>{if(y)return r&&(m.layersWithOutsidePointerEventsDisabled.size===0&&(Ex=k.body.style.pointerEvents,k.body.style.pointerEvents="none"),m.layersWithOutsidePointerEventsDisabled.add(y)),m.layers.add(y),zh(),()=>{r&&(m.layersWithOutsidePointerEventsDisabled.delete(y),m.layersWithOutsidePointerEventsDisabled.size===0&&(k.body.style.pointerEvents=Ex))}},[y,k,r,m]),S.useEffect(()=>()=>{y&&(m.layers.delete(y),m.layersWithOutsidePointerEventsDisabled.delete(y),zh())},[y,m]),S.useEffect(()=>{const z=Ft(()=>b({}),"handleUpdate");return document.addEventListener(Vh,z),()=>document.removeEventListener(Vh,z)},[]),v.jsx(Yi.div,{...p,ref:E,style:{pointerEvents:A?N?"auto":"none":void 0,...t.style},onFocusCapture:ui(t.onFocusCapture,D.onFocusCapture),onBlurCapture:ui(t.onBlurCapture,D.onBlurCapture),onPointerDownCapture:ui(t.onPointerDownCapture,B.onPointerDownCapture)})},"DismissableLayer"));function Uk(){const e=S.useContext(Bk),[t,n]=S.useState(null);return S.useEffect(()=>{if(t)return e.dismissableSurfaces.add(t),()=>{e.dismissableSurfaces.delete(t)}},[t,e.dismissableSurfaces]),n}Ft(Uk,"useDismissableLayerSurface");var hF=Ft(()=>!0,"IS_TRUE");function $k(e,t){const{ownerDocument:n=globalThis?.document,deferPointerDownOutside:r=!1,isDeferredPointerDownOutsideRef:s,dismissableSurfaces:a,shouldHandlePointerDownOutside:l=hF}=t,c=Hs(e),d=S.useRef(!1),h=S.useRef(!1),p=S.useRef(new Map),m=S.useRef(()=>{});return S.useEffect(()=>{function y(){h.current=!1,s.current=!1,p.current.clear()}Ft(y,"resetOutsideInteraction");function w(){return Array.from(p.current.values()).some(Boolean)}Ft(w,"isOutsideInteractionIntercepted");function k(_){if(!h.current)return;const j=_.target;j instanceof Node&&[...a].some(N=>N.contains(j))||p.current.set(_.type,!0),_.type==="click"&&window.setTimeout(()=>{h.current&&m.current()},0)}Ft(k,"handleInteractionCapture");function b(_){h.current&&p.current.set(_.type,!1)}Ft(b,"handleInteractionBubble");const E=Ft(_=>{if(_.target&&!d.current){let j=function(){n.removeEventListener("click",m.current);const N=w();y(),N||sm(cF,c,A,{discrete:!0})};if(Ft(j,"handleAndDispatchPointerDownOutsideEvent"),!l(_.target)){n.removeEventListener("click",m.current),y(),d.current=!1;return}const A={originalEvent:_};h.current=!0,s.current=r&&_.button===0,p.current.clear(),!r||_.button!==0?j():(n.removeEventListener("click",m.current),m.current=j,n.addEventListener("click",m.current,{once:!0}))}else n.removeEventListener("click",m.current),y();d.current=!1},"handlePointerDown"),P=["pointerup","mousedown","mouseup","touchstart","touchend","click"];for(const _ of P)n.addEventListener(_,k,!0),n.addEventListener(_,b);const R=window.setTimeout(()=>{n.addEventListener("pointerdown",E)},0);return()=>{window.clearTimeout(R),n.removeEventListener("pointerdown",E),n.removeEventListener("click",m.current);for(const _ of P)n.removeEventListener(_,k,!0),n.removeEventListener(_,b)}},[n,c,r,s,a,l]),{onPointerDownCapture:Ft(()=>d.current=!0,"onPointerDownCapture")}}Ft($k,"usePointerDownOutside");function Hk(e,t=globalThis?.document){const n=Hs(e),r=S.useRef(!1);return S.useEffect(()=>{const s=Ft(a=>{a.target&&!r.current&&sm(dF,n,{originalEvent:a},{discrete:!1})},"handleFocus");return t.addEventListener("focusin",s),()=>t.removeEventListener("focusin",s)},[t,n]),{onFocusCapture:Ft(()=>r.current=!0,"onFocusCapture"),onBlurCapture:Ft(()=>r.current=!1,"onBlurCapture")}}Ft(Hk,"useFocusOutside");function zh(){const e=new CustomEvent(Vh);document.dispatchEvent(e)}Ft(zh,"dispatchUpdate");function sm(e,t,n,{discrete:r}){const s=n.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&s.addEventListener(e,t,{once:!0}),r?zk(s,a):s.dispatchEvent(a)}Ft(sm,"handleAndDispatchCustomEvent");var pF=Object.defineProperty,un=(e,t)=>pF(e,"name",{value:t,configurable:!0}),Rf="focusScope.autoFocusOnMount",Af="focusScope.autoFocusOnUnmount",_x={bubbles:!1,cancelable:!0},mF=S.forwardRef(un(function(t,n){const{loop:r=!1,trapped:s=!1,onMountAutoFocus:a,onUnmountAutoFocus:l,...c}=t,[d,h]=S.useState(null),p=Hs(a),m=Hs(l),y=S.useRef(null),w=Js(n,h),k=S.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;S.useEffect(()=>{if(s){let E=function(j){if(k.paused||!d)return;const A=j.target;d.contains(A)?y.current=A:Ir(y.current,{select:!0})},P=function(j){if(k.paused||!d)return;const A=j.relatedTarget;A!==null&&(d.contains(A)||Ir(y.current,{select:!0}))},R=function(j){if(document.activeElement===document.body)for(const N of j)N.removedNodes.length>0&&Ir(d)};un(E,"handleFocusIn"),un(P,"handleFocusOut"),un(R,"handleMutations"),document.addEventListener("focusin",E),document.addEventListener("focusout",P);const _=new MutationObserver(R);return d&&_.observe(d,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",E),document.removeEventListener("focusout",P),_.disconnect()}}},[s,d,k.paused]),S.useEffect(()=>{if(d){Px.add(k);const E=document.activeElement;if(!d.contains(E)){const R=new CustomEvent(Rf,_x);d.addEventListener(Rf,p),d.dispatchEvent(R),R.defaultPrevented||(Wk(Yk(om(d)),{select:!0}),document.activeElement===E&&Ir(d))}return()=>{d.removeEventListener(Rf,p),setTimeout(()=>{const R=new CustomEvent(Af,_x);d.addEventListener(Af,m),d.dispatchEvent(R),R.defaultPrevented||Ir(E??document.body,{select:!0}),d.removeEventListener(Af,m),Px.remove(k)},0)}}},[d,p,m,k]);const b=S.useCallback(E=>{if(!r&&!s||k.paused)return;const P=E.key==="Tab"&&!E.altKey&&!E.ctrlKey&&!E.metaKey,R=document.activeElement;if(P&&R){const _=E.currentTarget,[j,A]=qk(_);j&&A?!E.shiftKey&&R===A?(E.preventDefault(),r&&Ir(j,{select:!0})):E.shiftKey&&R===j&&(E.preventDefault(),r&&Ir(A,{select:!0})):R===_&&E.preventDefault()}},[r,s,k.paused]);return v.jsx(Yi.div,{tabIndex:-1,...c,ref:w,onKeyDown:b})},"FocusScope"));function Wk(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(Ir(r,{select:t}),document.activeElement!==n)return}un(Wk,"focusFirst");function qk(e){const t=om(e),n=Bh(t,e),r=Bh(t.reverse(),e);return[n,r]}un(qk,"getTabbableEdges");function om(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:un(r=>{const s=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||s?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP},"acceptNode")});for(;n.nextNode();)t.push(n.currentNode);return t}un(om,"getTabbableCandidates");function Bh(e,t){const n=typeof t.checkVisibility=="function"&&t.checkVisibility({checkVisibilityCSS:!0});for(const r of e)if(!(n?!r.checkVisibility({checkVisibilityCSS:!0}):Gk(r,{upTo:t})))return r}un(Bh,"findVisible");function Gk(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}un(Gk,"isHidden");function Kk(e){return e instanceof HTMLInputElement&&"select"in e}un(Kk,"isSelectableInput");function Ir(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&Kk(e)&&t&&e.select()}}un(Ir,"focus");var Px=Xk();function Xk(){let e=[];return{add(t){const n=e[0];t!==n&&n?.pause(),e=Uh(e,t),e.unshift(t)},remove(t){e=Uh(e,t),e[0]?.resume()}}}un(Xk,"createFocusScopesStack");function Uh(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}un(Uh,"arrayRemove");function Yk(e){return e.filter(t=>t.tagName!=="A")}un(Yk,"removeLinks");var gF=Object.defineProperty,yF=(e,t)=>gF(e,"name",{value:t,configurable:!0}),vF=S.forwardRef(yF(function(t,n){const{container:r,...s}=t,[a,l]=S.useState(!1);hi(()=>l(!0),[]);const c=r||a&&globalThis?.document?.body;return c?Lk.createPortal(v.jsx(Yi.div,{...s,ref:n}),c):null},"Portal")),xF=Object.defineProperty,Nr=(e,t)=>xF(e,"name",{value:t,configurable:!0});function Qk(e,t){return S.useReducer((n,r)=>t[n][r]??n,e)}Nr(Qk,"useStateMachine");var am=Nr(e=>{const{present:t,children:n}=e,r=Jk(t),s=typeof n=="function"?n({present:r.isPresent}):S.Children.only(n),a=Zk(r.ref,eC(s));return typeof n=="function"||r.isPresent?S.cloneElement(s,{ref:a}):null},"Presence");function Jk(e){const[t,n]=S.useState(),r=S.useRef(null),s=S.useRef(e),a=S.useRef("none"),l=S.useRef(void 0),c=e?"mounted":"unmounted",[d,h]=Qk(c,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return S.useEffect(()=>{d==="mounted"?(a.current=l.current??Ms(r.current),l.current=void 0):a.current="none"},[d]),hi(()=>{const p=r.current,m=s.current;if(m!==e){const w=a.current,k=Ms(p);e?(l.current=k,h("MOUNT")):k==="none"||p?.display==="none"?h("UNMOUNT"):h(m&&w!==k?"ANIMATION_OUT":"UNMOUNT"),s.current=e}},[e,h]),hi(()=>{if(t){let p;const m=t.ownerDocument.defaultView??window,y=Nr(k=>{const E=Ms(r.current).includes(CSS.escape(k.animationName));if(k.target===t&&E&&(h("ANIMATION_END"),!s.current)){const P=t.style.animationFillMode;t.style.animationFillMode="forwards",p=m.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=P)})}},"handleAnimationEnd"),w=Nr(k=>{k.target===t&&(a.current=Ms(r.current))},"handleAnimationStart");return t.addEventListener("animationstart",w),t.addEventListener("animationcancel",y),t.addEventListener("animationend",y),()=>{m.clearTimeout(p),t.removeEventListener("animationstart",w),t.removeEventListener("animationcancel",y),t.removeEventListener("animationend",y)}}else h("ANIMATION_END")},[t,h]),{isPresent:["mounted","unmountSuspended"].includes(d),ref:S.useCallback(p=>{if(p){const m=getComputedStyle(p);r.current=m,l.current=Ms(m)}else r.current=null;n(p)},[])}}Nr(Jk,"usePresence");function $h(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}Nr($h,"setRef");function Zk(...e){const t=S.useRef(e);return t.current=e,S.useCallback(n=>{const r=t.current;let s=!1;const a=r.map(l=>{const c=$h(l,n);return!s&&typeof c=="function"&&(s=!0),c});if(s)return()=>{for(let l=0;l<a.length;l++){const c=a[l];typeof c=="function"?c():$h(r[l],null)}}},[])}Nr(Zk,"useStableComposedRefs");function Ms(e){return e?.animationName||"none"}Nr(Ms,"getAnimationName");function eC(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}Nr(eC,"getElementRef");var wF=Object.defineProperty,lm=(e,t)=>wF(e,"name",{value:t,configurable:!0}),Gl=0,bs=null;function SF(e){return um(),e.children}lm(SF,"FocusGuards");function um(){S.useEffect(()=>{bs||(bs={start:Hh(),end:Hh()});const{start:e,end:t}=bs;return document.body.firstElementChild!==e&&document.body.insertAdjacentElement("afterbegin",e),document.body.lastElementChild!==t&&document.body.insertAdjacentElement("beforeend",t),Gl++,()=>{Gl===1&&(bs?.start.remove(),bs?.end.remove(),bs=null),Gl=Math.max(0,Gl-1)}},[])}lm(um,"useFocusGuards");function Hh(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}lm(Hh,"createFocusGuard");var hr=function(){return hr=Object.assign||function(t){for(var n,r=1,s=arguments.length;r<s;r++){n=arguments[r];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(t[a]=n[a])}return t},hr.apply(this,arguments)};function tC(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,r=Object.getOwnPropertySymbols(e);s<r.length;s++)t.indexOf(r[s])<0&&Object.prototype.propertyIsEnumerable.call(e,r[s])&&(n[r[s]]=e[r[s]]);return n}function kF(e,t,n){if(n||arguments.length===2)for(var r=0,s=t.length,a;r<s;r++)(a||!(r in t))&&(a||(a=Array.prototype.slice.call(t,0,r)),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))}var fu="right-scroll-bar-position",hu="width-before-scroll-bar",CF="with-scroll-bars-hidden",bF="--removed-body-scroll-bar-size";function If(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function EF(e,t){var n=S.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var s=n.value;s!==r&&(n.value=r,n.callback(r,s))}}}})[0];return n.callback=t,n.facade}var _F=typeof window<"u"?S.useLayoutEffect:S.useEffect,Tx=new WeakMap;function PF(e,t){var n=EF(null,function(r){return e.forEach(function(s){return If(s,r)})});return _F(function(){var r=Tx.get(n);if(r){var s=new Set(r),a=new Set(e),l=n.current;s.forEach(function(c){a.has(c)||If(c,null)}),a.forEach(function(c){s.has(c)||If(c,l)})}Tx.set(n,e)},[e]),n}function TF(e){return e}function RF(e,t){t===void 0&&(t=TF);var n=[],r=!1,s={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(a){var l=t(a,r);return n.push(l),function(){n=n.filter(function(c){return c!==l})}},assignSyncMedium:function(a){for(r=!0;n.length;){var l=n;n=[],l.forEach(a)}n={push:function(c){return a(c)},filter:function(){return n}}},assignMedium:function(a){r=!0;var l=[];if(n.length){var c=n;n=[],c.forEach(a),l=n}var d=function(){var p=l;l=[],p.forEach(a)},h=function(){return Promise.resolve().then(d)};h(),n={push:function(p){l.push(p),h()},filter:function(p){return l=l.filter(p),n}}}};return s}function AF(e){e===void 0&&(e={});var t=RF(null);return t.options=hr({async:!0,ssr:!1},e),t}var nC=function(e){var t=e.sideCar,n=tC(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return S.createElement(r,hr({},n))};nC.isSideCarExport=!0;function IF(e,t){return e.useMedium(t),nC}var rC=AF(),Mf=function(){},oc=S.forwardRef(function(e,t){var n=S.useRef(null),r=S.useState({onScrollCapture:Mf,onWheelCapture:Mf,onTouchMoveCapture:Mf}),s=r[0],a=r[1],l=e.forwardProps,c=e.children,d=e.className,h=e.removeScrollBar,p=e.enabled,m=e.shards,y=e.sideCar,w=e.noRelative,k=e.noIsolation,b=e.inert,E=e.allowPinchZoom,P=e.as,R=P===void 0?"div":P,_=e.gapMode,j=tC(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),A=y,N=PF([n,t]),q=hr(hr({},j),s);return S.createElement(S.Fragment,null,p&&S.createElement(A,{sideCar:rC,removeScrollBar:h,shards:m,noRelative:w,noIsolation:k,inert:b,setCallbacks:a,allowPinchZoom:!!E,lockRef:n,gapMode:_}),l?S.cloneElement(S.Children.only(c),hr(hr({},q),{ref:N})):S.createElement(R,hr({},q,{className:d,ref:N}),c))});oc.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};oc.classNames={fullWidth:hu,zeroRight:fu};var MF=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function NF(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=MF();return t&&e.setAttribute("nonce",t),e}function LF(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function jF(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var DF=function(){var e=0,t=null;return{add:function(n){e==0&&(t=NF())&&(LF(t,n),jF(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},OF=function(){var e=DF();return function(t,n){S.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},iC=function(){var e=OF(),t=function(n){var r=n.styles,s=n.dynamic;return e(r,s),null};return t},FF={left:0,top:0,right:0,gap:0},Nf=function(e){return parseInt(e||"",10)||0},VF=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],s=t[e==="padding"?"paddingRight":"marginRight"];return[Nf(n),Nf(r),Nf(s)]},zF=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return FF;var t=VF(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},BF=iC(),Fs="data-scroll-locked",UF=function(e,t,n,r){var s=e.left,a=e.top,l=e.right,c=e.gap;return n===void 0&&(n="margin"),`
284
- .`.concat(CF,` {
285
- overflow: hidden `).concat(r,`;
286
- padding-right: `).concat(c,"px ").concat(r,`;
287
- }
288
- body[`).concat(Fs,`] {
289
- overflow: hidden `).concat(r,`;
290
- overscroll-behavior: contain;
291
- `).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&`
292
- padding-left: `.concat(s,`px;
293
- padding-top: `).concat(a,`px;
294
- padding-right: `).concat(l,`px;
295
- margin-left:0;
296
- margin-top:0;
297
- margin-right: `).concat(c,"px ").concat(r,`;
298
- `),n==="padding"&&"padding-right: ".concat(c,"px ").concat(r,";")].filter(Boolean).join(""),`
299
- }
300
-
301
- .`).concat(fu,` {
302
- right: `).concat(c,"px ").concat(r,`;
303
- }
304
-
305
- .`).concat(hu,` {
306
- margin-right: `).concat(c,"px ").concat(r,`;
307
- }
308
-
309
- .`).concat(fu," .").concat(fu,` {
310
- right: 0 `).concat(r,`;
311
- }
312
-
313
- .`).concat(hu," .").concat(hu,` {
314
- margin-right: 0 `).concat(r,`;
315
- }
316
-
317
- body[`).concat(Fs,`] {
318
- `).concat(bF,": ").concat(c,`px;
319
- }
320
- `)},Rx=function(){var e=parseInt(document.body.getAttribute(Fs)||"0",10);return isFinite(e)?e:0},$F=function(){S.useEffect(function(){return document.body.setAttribute(Fs,(Rx()+1).toString()),function(){var e=Rx()-1;e<=0?document.body.removeAttribute(Fs):document.body.setAttribute(Fs,e.toString())}},[])},HF=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,s=r===void 0?"margin":r;$F();var a=S.useMemo(function(){return zF(s)},[s]);return S.createElement(BF,{styles:UF(a,!t,s,n?"":"!important")})},Wh=!1;if(typeof window<"u")try{var Kl=Object.defineProperty({},"passive",{get:function(){return Wh=!0,!0}});window.addEventListener("test",Kl,Kl),window.removeEventListener("test",Kl,Kl)}catch{Wh=!1}var Es=Wh?{passive:!1}:!1,WF=function(e){return e.tagName==="TEXTAREA"},sC=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!WF(e)&&n[t]==="visible")},qF=function(e){return sC(e,"overflowY")},GF=function(e){return sC(e,"overflowX")},Ax=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var s=oC(e,r);if(s){var a=aC(e,r),l=a[1],c=a[2];if(l>c)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},KF=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},XF=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},oC=function(e,t){return e==="v"?qF(t):GF(t)},aC=function(e,t){return e==="v"?KF(t):XF(t)},YF=function(e,t){return e==="h"&&t==="rtl"?-1:1},QF=function(e,t,n,r,s){var a=YF(e,window.getComputedStyle(t).direction),l=a*r,c=n.target,d=t.contains(c),h=!1,p=l>0,m=0,y=0;do{if(!c)break;var w=aC(e,c),k=w[0],b=w[1],E=w[2],P=b-E-a*k;(k||P)&&oC(e,c)&&(m+=P,y+=k);var R=c.parentNode;c=R&&R.nodeType===Node.DOCUMENT_FRAGMENT_NODE?R.host:R}while(!d&&c!==document.body||d&&(t.contains(c)||t===c));return(p&&Math.abs(m)<1||!p&&Math.abs(y)<1)&&(h=!0),h},Xl=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Ix=function(e){return[e.deltaX,e.deltaY]},Mx=function(e){return e&&"current"in e?e.current:e},JF=function(e,t){return e[0]===t[0]&&e[1]===t[1]},ZF=function(e){return`
321
- .block-interactivity-`.concat(e,` {pointer-events: none;}
322
- .allow-interactivity-`).concat(e,` {pointer-events: all;}
323
- `)},e4=0,_s=[];function t4(e){var t=S.useRef([]),n=S.useRef([0,0]),r=S.useRef(),s=S.useState(e4++)[0],a=S.useState(iC)[0],l=S.useRef(e);S.useEffect(function(){l.current=e},[e]),S.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(s));var b=kF([e.lockRef.current],(e.shards||[]).map(Mx),!0).filter(Boolean);return b.forEach(function(E){return E.classList.add("allow-interactivity-".concat(s))}),function(){document.body.classList.remove("block-interactivity-".concat(s)),b.forEach(function(E){return E.classList.remove("allow-interactivity-".concat(s))})}}},[e.inert,e.lockRef.current,e.shards]);var c=S.useCallback(function(b,E){if("touches"in b&&b.touches.length===2||b.type==="wheel"&&b.ctrlKey)return!l.current.allowPinchZoom;var P=Xl(b),R=n.current,_="deltaX"in b?b.deltaX:R[0]-P[0],j="deltaY"in b?b.deltaY:R[1]-P[1],A,N=b.target,q=Math.abs(_)>Math.abs(j)?"h":"v";if("touches"in b&&q==="h"&&N.type==="range")return!1;var B=window.getSelection(),D=B&&B.anchorNode,I=D?D===N||D.contains(N):!1;if(I)return!1;var U=Ax(q,N);if(!U)return!0;if(U?A=q:(A=q==="v"?"h":"v",U=Ax(q,N)),!U)return!1;if(!r.current&&"changedTouches"in b&&(_||j)&&(r.current=A),!A)return!0;var z=r.current||A;return QF(z,E,b,z==="h"?_:j)},[]),d=S.useCallback(function(b){var E=b;if(!(!_s.length||_s[_s.length-1]!==a)){var P="deltaY"in E?Ix(E):Xl(E),R=t.current.filter(function(A){return A.name===E.type&&(A.target===E.target||E.target===A.shadowParent)&&JF(A.delta,P)})[0];if(R&&R.should){E.cancelable&&E.preventDefault();return}if(!R){var _=(l.current.shards||[]).map(Mx).filter(Boolean).filter(function(A){return A.contains(E.target)}),j=_.length>0?c(E,_[0]):!l.current.noIsolation;j&&E.cancelable&&E.preventDefault()}}},[]),h=S.useCallback(function(b,E,P,R){var _={name:b,delta:E,target:P,should:R,shadowParent:n4(P)};t.current.push(_),setTimeout(function(){t.current=t.current.filter(function(j){return j!==_})},1)},[]),p=S.useCallback(function(b){n.current=Xl(b),r.current=void 0},[]),m=S.useCallback(function(b){h(b.type,Ix(b),b.target,c(b,e.lockRef.current))},[]),y=S.useCallback(function(b){h(b.type,Xl(b),b.target,c(b,e.lockRef.current))},[]);S.useEffect(function(){return _s.push(a),e.setCallbacks({onScrollCapture:m,onWheelCapture:m,onTouchMoveCapture:y}),document.addEventListener("wheel",d,Es),document.addEventListener("touchmove",d,Es),document.addEventListener("touchstart",p,Es),function(){_s=_s.filter(function(b){return b!==a}),document.removeEventListener("wheel",d,Es),document.removeEventListener("touchmove",d,Es),document.removeEventListener("touchstart",p,Es)}},[]);var w=e.removeScrollBar,k=e.inert;return S.createElement(S.Fragment,null,k?S.createElement(a,{styles:ZF(s)}):null,w?S.createElement(HF,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function n4(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const r4=IF(rC,t4);var lC=S.forwardRef(function(e,t){return S.createElement(oc,hr({},e,{ref:t,sideCar:r4}))});lC.classNames=oc.classNames;var i4=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Ps=new WeakMap,Yl=new WeakMap,Ql={},Lf=0,uC=function(e){return e&&(e.host||uC(e.parentNode))},s4=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=uC(n);return r&&e.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},o4=function(e,t,n,r){var s=s4(t,Array.isArray(e)?e:[e]);Ql[n]||(Ql[n]=new WeakMap);var a=Ql[n],l=[],c=new Set,d=new Set(s),h=function(m){!m||c.has(m)||(c.add(m),h(m.parentNode))};s.forEach(h);var p=function(m){!m||d.has(m)||Array.prototype.forEach.call(m.children,function(y){if(c.has(y))p(y);else try{var w=y.getAttribute(r),k=w!==null&&w!=="false",b=(Ps.get(y)||0)+1,E=(a.get(y)||0)+1;Ps.set(y,b),a.set(y,E),l.push(y),b===1&&k&&Yl.set(y,!0),E===1&&y.setAttribute(n,"true"),k||y.setAttribute(r,"true")}catch(P){console.error("aria-hidden: cannot operate on ",y,P)}})};return p(t),c.clear(),Lf++,function(){l.forEach(function(m){var y=Ps.get(m)-1,w=a.get(m)-1;Ps.set(m,y),a.set(m,w),y||(Yl.has(m)||m.removeAttribute(r),Yl.delete(m)),w||m.removeAttribute(n)}),Lf--,Lf||(Ps=new WeakMap,Ps=new WeakMap,Yl=new WeakMap,Ql={})}},a4=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),s=i4(e);return s?(r.push.apply(r,Array.from(s.querySelectorAll("[aria-live], script"))),o4(r,s,n,"aria-hidden")):function(){return null}},l4=Object.defineProperty,zn=(e,t)=>l4(e,"name",{value:t,configurable:!0}),cm="Dialog",[cC,Qz]=Tk(cm),[u4,vr]=cC(cm),dC=zn(e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:s,onOpenChange:a,modal:l=!0}=e,c=S.useRef(null),d=S.useRef(null),[h,p]=Ik({prop:r,defaultProp:s??!1,onChange:a,caller:cm}),[m,y]=S.useState(0),[w,k]=S.useState(0);return v.jsx(u4,{scope:t,triggerRef:c,contentRef:d,contentId:du(),titleId:du(),descriptionId:du(),titlePresent:m>0,descriptionPresent:w>0,setTitleCount:y,setDescriptionCount:k,open:h,onOpenChange:p,onOpenToggle:S.useCallback(()=>p(b=>!b),[p]),modal:l,children:n})},"Dialog"),fC="DialogPortal",[c4,hC]=cC(fC,{forceMount:void 0}),pC=zn(e=>{const{__scopeDialog:t,forceMount:n,children:r,container:s}=e,a=vr(fC,t);return v.jsx(c4,{scope:t,forceMount:n,children:S.Children.map(r,l=>v.jsx(am,{present:n||a.open,children:v.jsx(vF,{asChild:!0,container:s,children:l})}))})},"DialogPortal"),qh="DialogOverlay",mC=S.forwardRef(zn(function(t,n){const r=hC(qh,t.__scopeDialog),{forceMount:s=r.forceMount,...a}=t,l=vr(qh,t.__scopeDialog);return l.modal?v.jsx(am,{present:s||l.open,children:v.jsx(f4,{...a,ref:n})}):null},"DialogOverlay")),d4=im("DialogOverlay.RemoveScroll"),f4=S.forwardRef(zn(function(t,n){const{__scopeDialog:r,...s}=t,a=vr(qh,r),l=Uk(),c=Js(n,l);return v.jsx(lC,{as:d4,allowPinchZoom:!0,shards:[a.contentRef],children:v.jsx(Yi.div,{"data-state":dm(a.open),...s,ref:c,style:{pointerEvents:"auto",...s.style}})})},"DialogOverlayImpl")),pa="DialogContent",gC=S.forwardRef(zn(function(t,n){const r=hC(pa,t.__scopeDialog),{forceMount:s=r.forceMount,...a}=t,l=vr(pa,t.__scopeDialog);return v.jsx(am,{present:s||l.open,children:l.modal?v.jsx(h4,{...a,ref:n}):v.jsx(p4,{...a,ref:n})})},"DialogContent")),h4=S.forwardRef(zn(function(t,n){const r=vr(pa,t.__scopeDialog),s=S.useRef(null),a=Js(n,r.contentRef,s);return S.useEffect(()=>{const l=s.current;if(l)return a4(l)},[]),v.jsx(yC,{...t,ref:a,trapFocus:r.open,disableOutsidePointerEvents:r.open,onCloseAutoFocus:ui(t.onCloseAutoFocus,l=>{l.preventDefault(),r.triggerRef.current?.focus()}),onPointerDownOutside:ui(t.onPointerDownOutside,l=>{const c=l.detail.originalEvent,d=c.button===0&&c.ctrlKey===!0;(c.button===2||d)&&l.preventDefault()}),onFocusOutside:ui(t.onFocusOutside,l=>l.preventDefault())})},"DialogContentModal")),p4=S.forwardRef(zn(function(t,n){const r=vr(pa,t.__scopeDialog),s=S.useRef(!1),a=S.useRef(!1);return v.jsx(yC,{...t,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:l=>{t.onCloseAutoFocus?.(l),l.defaultPrevented||(s.current||r.triggerRef.current?.focus(),l.preventDefault()),s.current=!1,a.current=!1},onInteractOutside:l=>{t.onInteractOutside?.(l),l.defaultPrevented||(s.current=!0,l.detail.originalEvent.type==="pointerdown"&&(a.current=!0));const c=l.target;r.triggerRef.current?.contains(c)&&l.preventDefault(),l.detail.originalEvent.type==="focusin"&&a.current&&l.preventDefault()}})},"DialogContentNonModal")),yC=S.forwardRef(zn(function(t,n){const{__scopeDialog:r,trapFocus:s,onOpenAutoFocus:a,onCloseAutoFocus:l,...c}=t,d=vr(pa,r);return um(),v.jsx(v.Fragment,{children:v.jsx(mF,{asChild:!0,loop:!0,trapped:s,onMountAutoFocus:a,onUnmountAutoFocus:l,children:v.jsx(fF,{role:"dialog",id:d.contentId,"aria-describedby":d.descriptionPresent?d.descriptionId:void 0,"aria-labelledby":d.titlePresent?d.titleId:void 0,"data-state":dm(d.open),...c,ref:n,deferPointerDownOutside:!0,onDismiss:()=>d.onOpenChange(!1)})})})},"DialogContentImpl")),m4="DialogTitle",vC=S.forwardRef(zn(function(t,n){const{__scopeDialog:r,...s}=t,a=vr(m4,r),{setTitleCount:l}=a;return hi(()=>(l(c=>c+1),()=>l(c=>c-1)),[l]),v.jsx(Yi.h2,{id:a.titleId,...s,ref:n})},"DialogTitle")),g4="DialogDescription",xC=S.forwardRef(zn(function(t,n){const{__scopeDialog:r,...s}=t,a=vr(g4,r),{setDescriptionCount:l}=a;return hi(()=>(l(c=>c+1),()=>l(c=>c-1)),[l]),v.jsx(Yi.p,{id:a.descriptionId,...s,ref:n})},"DialogDescription")),y4="DialogClose",wC=S.forwardRef(zn(function(t,n){const{__scopeDialog:r,...s}=t,a=vr(y4,r);return v.jsx(Yi.button,{type:"button",...s,ref:n,onClick:ui(t.onClick,()=>a.onOpenChange(!1))})},"DialogClose"));function dm(e){return e?"open":"closed"}zn(dm,"getState");function Ta(e){const t=S.useRef(null);return S.useEffect(()=>(t.current=document.activeElement instanceof HTMLElement?document.activeElement:null,()=>{const n=t.current;n?.isConnected&&requestAnimationFrame(()=>n.focus())}),[]),v.jsx(dC,{open:!0,onOpenChange:n=>{n||e.onClose()},children:v.jsxs(pC,{children:[v.jsx(mC,{className:"modal-backdrop"}),v.jsxs(gC,{id:e.contentId,className:"modal"+(e.wide?" modal-wide":"")+(e.className?` ${e.className}`:""),children:[v.jsxs("div",{className:"modal-head",children:[v.jsxs("div",{children:[v.jsx(vC,{asChild:!0,children:v.jsx("h3",{children:e.title})}),e.description&&v.jsx(xC,{className:"modal-description",children:e.description})]}),v.jsx(wC,{asChild:!0,children:v.jsx("button",{className:"icon-btn","aria-label":`Close ${e.title}`,children:v.jsx(Ce,{name:"close"})})})]}),e.tabs,v.jsx("div",{className:"modal-body",children:e.children})]})]})})}const v4="modulepreload",x4=function(e,t){return new URL(e,t).href},Nx={},fm=function(t,n,r){let s=Promise.resolve();if(n&&n.length>0){let l=function(p){return Promise.all(p.map(m=>Promise.resolve(m).then(y=>({status:"fulfilled",value:y}),y=>({status:"rejected",reason:y}))))};const c=document.getElementsByTagName("link"),d=document.querySelector("meta[property=csp-nonce]"),h=d?.nonce||d?.getAttribute("nonce");s=l(n.map(p=>{if(p=x4(p,r),p in Nx)return;Nx[p]=!0;const m=p.endsWith(".css"),y=m?'[rel="stylesheet"]':"";if(!!r)for(let b=c.length-1;b>=0;b--){const E=c[b];if(E.href===p&&(!m||E.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${p}"]${y}`))return;const k=document.createElement("link");if(k.rel=m?"stylesheet":v4,m||(k.as="script"),k.crossOrigin="",k.href=p,h&&k.setAttribute("nonce",h),document.head.appendChild(k),m)return new Promise((b,E)=>{k.addEventListener("load",b),k.addEventListener("error",()=>E(new Error(`Unable to preload CSS for ${p}`)))})}))}function a(l){const c=new Event("vite:preloadError",{cancelable:!0});if(c.payload=l,window.dispatchEvent(c),!c.defaultPrevented)throw l}return s.then(l=>{for(const c of l||[])c.status==="rejected"&&a(c.reason);return t().catch(a)})};let w4=0;const S4=.25,k4=8;let Lx=Promise.resolve();function jx(){return typeof document<"u"&&document.documentElement.classList.contains("theme-dark")?"dark":"default"}function C4(){const[e,t]=S.useState(jx);return S.useEffect(()=>{const n=document.documentElement,r=()=>t(jx()),s=new MutationObserver(r);return s.observe(n,{attributes:!0,attributeFilter:["class"]}),r(),()=>s.disconnect()},[]),e}function b4(e,t,n,r){const s=Lx.then(async()=>{if(!r())return"";const{default:a}=await fm(async()=>{const{default:c}=await import("./mermaid.core-B4rA_8qO.js").then(d=>d.cb);return{default:c}},[],import.meta.url);if(!r())return"";if(a.initialize({startOnLoad:!1,securityLevel:"strict",theme:n,fontFamily:"Arial, sans-serif",htmlLabels:!1,flowchart:{htmlLabels:!1},suppressErrorRendering:!0}),t.length>5e4)throw new Error("Diagram exceeds the rendering limit.");if(/^\s*---(?:\r?\n|$)|%%\s*\{/.test(t))throw new Error("Diagram configuration overrides are not supported.");if(await document.fonts.ready,!r())return"";const l=document.createElement("div");l.style.fontFamily="Arial, sans-serif",l.style.fontSize="16px",l.style.lineHeight="normal",l.style.position="absolute",l.style.visibility="hidden",document.body.append(l);try{const c=await a.render(e,t,l),h=new DOMParser().parseFromString(c.svg,"image/svg+xml").documentElement,p=h.getAttribute("viewBox")?.trim().split(/[\s,]+/).map(Number);if(h.localName!=="svg"||!p||p.length!==4||!p.every(Number.isFinite)||p[2]<=0||p[3]<=0)throw new Error("Diagram has no usable dimensions.");return h.setAttribute("width",String(p[2])),h.setAttribute("height",String(p[3])),URL.createObjectURL(new Blob([new XMLSerializer().serializeToString(h)],{type:"image/svg+xml"}))}finally{l.remove()}});return Lx=s.then(()=>{},()=>{}),s}function E4(e){return Math.min(k4,Math.max(S4,e))}function _4(e){const t=S.useRef(null),n=S.useRef(null),[r,s]=S.useState(1),[a,l]=S.useState({x:0,y:0}),[c,d]=S.useState(!1),h=()=>{s(1),l({x:0,y:0})},p=(m,y,w)=>{const k=E4(m);if(k===r)return;const b=t.current?.getBoundingClientRect();if(b){const E=(y??b.left+b.width/2)-b.left-b.width/2,P=(w??b.top+b.height/2)-b.top-b.height/2,R=k/r;l(_=>({x:E-R*(E-_.x),y:P-R*(P-_.y)}))}s(k)};return S.useEffect(()=>{const m=y=>{y.key==="+"||y.key==="="?(y.preventDefault(),p(r*1.25)):y.key==="-"?(y.preventDefault(),p(r/1.25)):y.key==="0"&&(y.preventDefault(),h())};return window.addEventListener("keydown",m),()=>window.removeEventListener("keydown",m)}),v.jsx(dC,{open:!0,onOpenChange:m=>{m||e.onClose()},children:v.jsxs(pC,{children:[v.jsx(mC,{className:"mermaid-fullscreen-backdrop"}),v.jsxs(gC,{className:"mermaid-fullscreen","data-mermaid-theme":e.theme,"aria-describedby":"mermaid-fullscreen-help",children:[v.jsx(vC,{className:"mermaid-fullscreen-title",children:"Diagram viewer"}),v.jsxs("div",{className:"mermaid-fullscreen-tools",children:[v.jsx("button",{className:"icon-btn","aria-label":"Zoom out",title:"Zoom out (−)",onClick:()=>p(r/1.25),children:v.jsx(Ce,{name:"minus"})}),v.jsxs("button",{className:"mermaid-zoom-value",onClick:h,title:"Reset zoom and position",children:[Math.round(r*100),"%"]}),v.jsx("button",{className:"icon-btn","aria-label":"Zoom in",title:"Zoom in (+)",onClick:()=>p(r*1.25),children:v.jsx(Ce,{name:"plus"})}),v.jsx(wC,{asChild:!0,children:v.jsx("button",{className:"icon-btn","aria-label":"Close diagram viewer",title:"Close (Esc)",children:v.jsx(Ce,{name:"close"})})})]}),v.jsx("div",{ref:t,tabIndex:0,role:"region","aria-label":"Diagram navigation; use arrow keys to pan",onKeyDown:m=>{const y={ArrowLeft:[40,0],ArrowRight:[-40,0],ArrowUp:[0,40],ArrowDown:[0,-40]}[m.key];y&&(m.preventDefault(),l(w=>({x:w.x+y[0],y:w.y+y[1]})))},className:"mermaid-fullscreen-viewport"+(c?" dragging":""),onWheel:m=>{m.preventDefault(),p(r*Math.exp(-m.deltaY*.0015),m.clientX,m.clientY)},onDoubleClick:m=>p(r*1.5,m.clientX,m.clientY),onPointerDown:m=>{m.button===0&&(n.current={pointerId:m.pointerId,startX:m.clientX,startY:m.clientY,panX:a.x,panY:a.y},m.currentTarget.setPointerCapture(m.pointerId),d(!0))},onPointerMove:m=>{const y=n.current;!y||y.pointerId!==m.pointerId||l({x:y.panX+m.clientX-y.startX,y:y.panY+m.clientY-y.startY})},onPointerUp:m=>{n.current?.pointerId===m.pointerId&&(n.current=null,d(!1),m.currentTarget.releasePointerCapture(m.pointerId))},onPointerCancel:()=>{n.current=null,d(!1)},children:v.jsx("div",{className:"mermaid-fullscreen-canvas",style:{transform:`translate(${a.x}px, ${a.y}px) scale(${r})`},children:v.jsx("img",{src:e.svg,alt:"Mermaid diagram"})})}),v.jsx(xC,{id:"mermaid-fullscreen-help",className:"mermaid-fullscreen-help",children:"Scroll or +/− to zoom · drag or arrow keys to move · 0 to reset"})]})]})})}function SC({source:e}){const t=S.useId(),[n,r]=S.useState(""),[s,a]=S.useState(""),[l,c]=S.useState("default"),[d,h]=S.useState(!1),p=C4();return S.useEffect(()=>{let m=!0,y="";const w=`mermaid-${++w4}-${t.replace(/[^a-zA-Z0-9_-]/g,"")}`;return r(""),a(""),h(!1),b4(w,e,p,()=>m).then(k=>{m?(c(p),y=k,r(k)):URL.revokeObjectURL(k)}).catch(k=>{m&&a(k instanceof Error?k.message:String(k))}),()=>{m=!1,y&&URL.revokeObjectURL(y)}},[t,e,p]),v.jsxs("div",{className:"mermaid-block",children:[s?v.jsxs("p",{className:"markdown-mermaid-error",role:"status",children:["Unable to render diagram: ",s]}):n?v.jsxs("div",{className:"markdown-mermaid","data-mermaid-theme":l,children:[v.jsx("button",{className:"icon-btn markdown-mermaid-expand","aria-label":"View diagram fullscreen",title:"View diagram fullscreen",onClick:()=>h(!0),children:v.jsx(Ce,{name:"maximize"})}),v.jsx("div",{className:"markdown-mermaid-diagram",tabIndex:0,role:"region","aria-label":"Scrollable Mermaid diagram",children:v.jsx("img",{src:n,alt:"Mermaid diagram; original source follows",onError:()=>a("Diagram image could not be displayed.")})})]}):v.jsx("div",{className:"markdown-mermaid-loading",role:"status",children:"Rendering diagram…"}),v.jsxs("details",{className:"mermaid-source",open:s?!0:void 0,children:[v.jsx("summary",{children:"Mermaid source"}),v.jsx("pre",{children:v.jsx("code",{children:e})})]}),d&&n&&!s&&v.jsx(_4,{svg:n,theme:l,onClose:()=>h(!1)})]})}const P4=S.memo(function(t){return v.jsx("article",{className:"markdown-body",ref:t.contentRef,children:v.jsx(kk,{remarkPlugins:[Ck],components:{a:({children:n,...r})=>v.jsx("a",{...r,target:"_blank",rel:"noreferrer",children:n}),pre:({children:n})=>{const r=S.isValidElement(n)?n:null;return r?.props.className==="language-mermaid"?v.jsx(SC,{source:String(r.props.children).replace(/\n$/,"")}):v.jsx("pre",{children:n})}},children:t.markdown})})});function kC(e){const{rec:t}=e,n=S.useRef(null),[r,s]=S.useState(""),[a,l]=S.useState(!1),[c,d]=S.useState(null),[h,p]=S.useState("loading"),[m,y]=S.useState(""),[w,k]=S.useState(0),[b,E]=S.useState(""),[P,R]=S.useState(0),[_,j]=S.useState(!1),[A,N]=S.useState(""),[q,B]=S.useState(!1),[D,I]=S.useState(!1),[U,z]=S.useState([]),[he,J]=S.useState(!1),[Z,ve]=S.useState(null),[Se,Q]=S.useState(!1),[pe,T]=S.useState("");S.useEffect(()=>{let ue=!0,ae=null;return p("loading"),ec(t.id).then(me=>{if(ue){if(!me){p("missing");return}s(new TextDecoder("utf-8").decode(me)),ae=URL.createObjectURL(new Blob([me],{type:"text/markdown;charset=utf-8"})),d(ae),p("ready")}}).catch(()=>{ue&&p("error")}),()=>{ue=!1,ae&&URL.revokeObjectURL(ae)}},[t.id]),S.useEffect(()=>{const ue=()=>{const ae=window.getSelection(),me=n.current;if(!ae||ae.isCollapsed||!me){y(""),k(0);return}if(!me.contains(ae.anchorNode)||!me.contains(ae.focusNode)){y(""),k(0);return}const ke=ae.getRangeAt(0),xe=ae.toString(),$e=xe.length-xe.trimStart().length,Fe=xe.trim().slice(0,4e3),qe=document.createRange();qe.selectNodeContents(me),qe.setEnd(ke.startContainer,ke.startOffset);const st=qe.toString().length+$e;y(Fe),k(Qj(me.textContent,Fe,st))};return document.addEventListener("selectionchange",ue),()=>document.removeEventListener("selectionchange",ue)},[]);const F=()=>{m&&(E(m),R(w),j(!0),T(""))},X=async()=>{if(D){if(!b||!A.trim())return;z(ae=>[...ae,{selection:b,comment:A.trim(),occurrence:P}]),N(""),j(!1),T("Comment added to review");return}const ue=Xj(b,A);if(!(!ue||!A.trim()||q)){B(!0),T("");try{await e.onSendText(ue,t.id||void 0),N(""),j(!1),T("Feedback sent")}catch(ae){T(`Send failed: ${String(ae)}`)}finally{B(!1)}}},M=async()=>{if(U.length===0||he)return;const ue=rD(r,U);J(!0),T("");try{e.onSendFile?await e.onSendFile({filename:Yj(t.filename),mime:"text/markdown",bytes:new TextEncoder().encode(ue)},t.id||void 0):await e.onSendText(ue,t.id||void 0),z([]),I(!1),T("Review submitted")}catch(ae){T(`Review send failed: ${String(ae)}`)}finally{J(!1)}},oe=async()=>{if(!(!Z||!e.onSendFile||Se)){Q(!0),T("");try{await e.onSendFile(Z,t.id||void 0),ve(null),T("Voice feedback sent")}catch(ue){T(`Voice send failed: ${String(ue)}`)}finally{Q(!1)}}};return v.jsx(Ta,{title:t.filename,description:"Markdown preview · select text to send precise feedback",onClose:e.onClose,wide:!0,className:"markdown-modal"+(a?" markdown-reader-fullscreen":""),children:v.jsxs("div",{className:"markdown-preview",children:[v.jsxs("div",{className:"markdown-review-toolbar",children:[v.jsxs("button",{className:"btn sm",type:"button","aria-label":a?"Exit reader fullscreen":"View reader fullscreen","aria-pressed":a,onMouseDown:ue=>ue.preventDefault(),onClick:()=>l(ue=>!ue),children:[v.jsx(Ce,{name:"maximize",size:14}),a?"Exit fullscreen":"Fullscreen"]}),v.jsxs("button",{className:"btn sm",disabled:!m,onMouseDown:ue=>ue.preventDefault(),onClick:F,children:[v.jsx(Ce,{name:"reply",size:14}),D?"Add review comment":"Quick message",m?` (${m.length})`:""]}),D?v.jsx("button",{className:"btn sm",onClick:()=>{I(!1),z([]),j(!1),T("Review discarded")},children:"Cancel review"}):v.jsxs("button",{className:"btn sm",onClick:()=>{I(!0),z([]),T("Review started — select passages to add comments")},children:[v.jsx(Ce,{name:"edit",size:14}),"Start review"]}),c&&v.jsxs("a",{className:"btn sm",href:c,download:t.filename,children:[v.jsx(Ce,{name:"download",size:14}),"Download"]}),e.onSendFile&&v.jsx(tk,{disabled:!!Z||Se,onReady:ve,onError:T}),v.jsx("span",{className:"markdown-review-hint",children:m?"Selection ready for feedback":"Highlight any passage to comment on it"})]}),_&&v.jsxs("div",{className:"markdown-feedback",children:[v.jsx("blockquote",{children:b}),v.jsx("textarea",{className:"field",rows:3,autoFocus:!0,placeholder:"What should change?",value:A,onChange:ue=>N(ue.target.value)}),v.jsxs("div",{className:"markdown-feedback-actions",children:[v.jsx("button",{className:"btn sm",onClick:()=>j(!1),children:"Cancel"}),v.jsxs("button",{className:"btn sm primary",disabled:!A.trim()||q,onClick:()=>void X(),children:[v.jsx(Ce,{name:"send",size:14}),D?"Add to review":q?"Sending…":"Send feedback"]})]})]}),D&&v.jsxs("div",{className:"markdown-review-draft",children:[v.jsxs("div",{className:"markdown-review-draft-head",children:[v.jsxs("strong",{children:["Review · ",U.length," comment",U.length===1?"":"s"]}),v.jsxs("button",{className:"btn sm primary",disabled:U.length===0||he,onClick:()=>void M(),children:[v.jsx(Ce,{name:"send",size:14}),he?"Submitting…":"Submit review"]})]}),U.map((ue,ae)=>v.jsxs("div",{className:"markdown-review-comment",children:[v.jsx("span",{children:ae+1}),v.jsxs("div",{children:[v.jsx("blockquote",{children:ue.selection}),v.jsx("p",{children:ue.comment})]}),v.jsx("button",{className:"icon-btn",title:"Remove comment",onClick:()=>z(me=>me.filter((ke,xe)=>xe!==ae)),children:v.jsx(Ce,{name:"close",size:14})})]},`${ae}-${ue.selection.slice(0,24)}`))]}),Z&&v.jsx(ek,{att:Z,sending:Se,onSend:()=>void oe(),onDiscard:()=>ve(null)}),pe&&v.jsx("div",{className:"markdown-review-status",role:"status",children:pe}),v.jsxs("div",{className:"markdown-preview-scroll",children:[h==="loading"&&v.jsx("div",{className:"markdown-empty",children:"Loading preview…"}),h==="missing"&&v.jsx("div",{className:"markdown-empty",children:"This file is available on the original device only."}),h==="error"&&v.jsx("div",{className:"markdown-empty",children:"The file could not be opened."}),h==="ready"&&v.jsx(P4,{markdown:r,contentRef:n})]})]})})}function CC(e){const{rec:t}=e,[n,r]=S.useState(null),[s,a]=S.useState(0),[l,c]=S.useState(!1),[d,h]=S.useState("loading");return S.useEffect(()=>{let p=!0,m=null;return h("loading"),ec(t.id).then(y=>{if(p){if(!y){h("missing");return}a(y.byteLength),m=URL.createObjectURL(new Blob([y],{type:Up(t.mime,t.filename)})),r(m),h("ready")}}).catch(()=>{p&&h("error")}),()=>{p=!1,m&&URL.revokeObjectURL(m)}},[t.id,t.mime,t.filename]),v.jsx(Ta,{title:t.filename,description:"Transformed safe preview · external navigation disabled",onClose:e.onClose,wide:!0,className:"markdown-modal html-modal"+(l?" html-modal-fullscreen":""),children:v.jsxs("div",{className:"html-preview",children:[v.jsxs("div",{className:"html-preview-toolbar",children:[v.jsxs("span",{className:"html-preview-shield",children:[v.jsx(Ce,{name:"shield",size:14}),"Scripts, forms and network requests are blocked"]}),v.jsxs("span",{className:"html-preview-actions",children:[d==="ready"&&v.jsxs("button",{className:"btn sm",type:"button",title:"View HTML fullscreen","aria-label":"View HTML fullscreen",onClick:()=>c(!0),children:[v.jsx(Ce,{name:"maximize",size:14}),"Fullscreen"]}),n&&v.jsxs("a",{className:"btn sm",href:n,download:t.filename,children:[v.jsx(Ce,{name:"download",size:14}),"Download original",s?` · ${fi(s)}`:""]})]})]}),v.jsxs("div",{className:"html-preview-frame",children:[d==="loading"&&v.jsx("div",{className:"markdown-empty",children:"Loading preview…"}),d==="missing"&&v.jsx("div",{className:"markdown-empty",children:"This file is available on the original device only."}),d==="error"&&v.jsx("div",{className:"markdown-empty",children:"The file could not be opened."}),d==="ready"&&v.jsx("iframe",{className:"html-preview-iframe",title:`Sandboxed preview of ${t.filename}`,sandbox:iD,referrerPolicy:"no-referrer",src:gr(`/api/html-preview/${encodeURIComponent(t.id)}`)},t.id)]})]})})}function bC(e){const t=(n,r)=>{const{key:s}=n;if(!["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Home","End"].includes(s))return;n.preventDefault();const a=e.options.length-1,l=s==="Home"?0:s==="End"?a:s==="ArrowLeft"||s==="ArrowUp"?(r-1+e.options.length)%e.options.length:(r+1)%e.options.length,c=e.options[l];c&&(e.onChange(c.id),document.getElementById(`${e.idPrefix}-${c.id}`)?.focus())};return v.jsx("div",{className:e.className,role:"tablist","aria-label":e.label,children:e.options.map((n,r)=>v.jsxs("button",{id:`${e.idPrefix}-${n.id}`,type:"button",role:"tab","aria-selected":e.value===n.id,"aria-controls":e.panelId,tabIndex:e.value===n.id?0:-1,className:"tab"+(e.value===n.id?" active":""),onClick:()=>e.onChange(n.id),onKeyDown:s=>t(s,r),children:[n.label,n.count===void 0?null:v.jsxs(v.Fragment,{children:[" ",v.jsx("span",{children:n.count})]})]},n.id))})}function Gh(e){const{message:t}=e,[n,r]=S.useState(null),[s,a]=S.useState(0),l=rS(t.wireId)??{id:t.wireId,dir:t.dir,filename:t.filename??"file",mime:t.mime??"application/octet-stream",size:s,date:t.date};S.useEffect(()=>{let h=!0,p=null;if(t.wireId)return ec(t.wireId).then(m=>{!h||!m||(a(m.byteLength),p=URL.createObjectURL(new Blob([m],{type:Up(l.mime,l.filename)})),r(p))}).catch(()=>{}),()=>{h=!1,p&&URL.revokeObjectURL(p)}},[t.wireId,l.mime,l.filename]);const c=Th(t)==="photo",d=Us(l.mime,l.filename);return v.jsxs("div",{className:"shared-media-item"+(c?" shared-photo-item":""),children:[v.jsxs("button",{className:"shared-media-jump",onClick:()=>e.onJump(e.messageKey),children:[c&&n?v.jsx("img",{src:n,alt:l.filename}):v.jsx("span",{className:"shared-media-icon",children:v.jsx(Ce,{name:d?"mic":"copy",size:18})}),v.jsxs("span",{className:"shared-media-copy",children:[v.jsx("strong",{children:c?l.filename||"Photo":d?"Voice message":l.filename}),v.jsxs("span",{children:[e.versionLabel?`${e.versionLabel} · `:"",Wi(l.date),s?` · ${fi(s)}`:""]})]})]}),v.jsxs("span",{className:"shared-media-actions",children:[qS(l.filename)&&n&&v.jsx("button",{className:"icon-btn",title:"Preview markdown",onClick:()=>e.onPreview(l),children:v.jsx(Ce,{name:"monitor",size:16})}),ba(l.filename,l.mime)&&n&&v.jsx("button",{className:"icon-btn",title:"Preview HTML",onClick:()=>e.onPreview(l),children:v.jsx(Ce,{name:"monitor",size:16})}),v.jsx("a",{className:"icon-btn"+(n?"":" disabled"),href:n??void 0,download:l.filename,title:"Download",children:v.jsx(Ce,{name:"download",size:16})})]})]})}function T4(e){const[t,n]=S.useState(!1);if(e.versions.length===1){const r=e.versions[0];return v.jsx(Gh,{message:r.message,messageKey:r.key,onJump:e.onJump,onPreview:e.onPreview})}return v.jsxs("div",{className:"file-version-stack"+(t?" expanded":""),children:[v.jsxs("button",{className:"file-version-stack-head",onClick:()=>n(r=>!r),children:[v.jsx("span",{className:"shared-media-icon",children:v.jsx(Ce,{name:"copy",size:18})}),v.jsxs("span",{className:"shared-media-copy",children:[v.jsx("strong",{children:e.filename}),v.jsxs("span",{children:[e.versions.length," versions · newest ",Wi(e.versions[0].message.date)]})]}),v.jsx(Ce,{name:t?"chevronDown":"chevron",size:16})]}),t&&v.jsx("div",{className:"file-version-stack-list",children:e.versions.map((r,s)=>v.jsx(Gh,{message:r.message,messageKey:r.key,versionLabel:`Version ${e.versions.length-s}`,onJump:e.onJump,onPreview:e.onPreview},r.key))})]})}function R4(e){const[t,n]=S.useState("photo"),r=e.messages.map((h,p)=>({message:h,key:h.wireId||`${h.date}-${(e.indexOffset??0)+p}`})),s=r.filter(({message:h})=>Th(h)==="photo"),a=r.filter(({message:h})=>Th(h)==="file"),l=Zj(a),c=r.flatMap(({message:h,key:p})=>h.kind==="file"?[]:Jj(h.text).map(m=>({url:m,message:h,key:p}))),d=[{id:"photo",label:"Photos",count:s.length},{id:"file",label:"Files",count:a.length},{id:"link",label:"Links",count:c.length}];return v.jsx(Ta,{title:"Shared media",description:"Photos, files, and links from this conversation",onClose:e.onClose,wide:!0,className:"shared-media-modal",tabs:v.jsx(bC,{className:"shared-media-tabs",label:"Shared media type",options:d,value:t,onChange:n,idPrefix:"shared-media-tab",panelId:"shared-media-panel"}),children:v.jsxs("div",{id:"shared-media-panel",role:"tabpanel","aria-labelledby":`shared-media-tab-${t}`,className:"shared-media-list"+(t==="photo"?" photos":""),children:[t==="photo"&&s.map(h=>v.jsx(Gh,{message:h.message,messageKey:h.key,onJump:e.onJump,onPreview:e.onPreview},h.key)),t==="file"&&l.map(h=>v.jsx(T4,{filename:h.filename,versions:h.versions,onJump:e.onJump,onPreview:e.onPreview},h.filename)),t==="link"&&c.map((h,p)=>v.jsxs("div",{className:"shared-media-item",children:[v.jsxs("a",{className:"shared-media-jump",href:h.url,target:"_blank",rel:"noreferrer",children:[v.jsx("span",{className:"shared-media-icon",children:v.jsx(Ce,{name:"link",size:18})}),v.jsxs("span",{className:"shared-media-copy",children:[v.jsx("strong",{children:h.url}),v.jsx("span",{children:Wi(h.message.date)})]})]}),v.jsx("button",{className:"icon-btn",title:"Jump to message",onClick:()=>e.onJump(h.key),children:v.jsx(Ce,{name:"reply",size:16})})]},`${h.key}-${h.url}-${p}`)),(t==="photo"&&s.length===0||t==="file"&&a.length===0||t==="link"&&c.length===0)&&v.jsxs("div",{className:"markdown-empty",children:["No ",t==="photo"?"photos":`${t}s`," in this chat yet."]})]})})}const A4=Object.freeze(["image/avif","image/bmp","image/heic","image/heif","image/jpeg","image/jpg","image/png","image/webp"]),I4=/\.(avif|bmp|heic|heif|jpe?g|png|webp)$/i;function EC(e,t=""){return A4.includes(String(e??"").toLowerCase())||I4.test(String(t??""))}function M4(e){return`${(String(e||"photo").trim()||"photo").replace(/\.[^./\\]+$/,"")||"photo"}.jpg`}function N4(e,t,n){const r=Math.max(1,Number(e)||1),s=Math.max(1,Number(t)||1),a=Math.max(1,Number(n)||1),l=Math.min(1,a/Math.max(r,s));return{width:Math.max(1,Math.round(r*l)),height:Math.max(1,Math.round(s*l))}}const L4=2048,j4=640,D4=.82,O4=[.84,.7,.56,.44],F4=.94;function V4(e){return new Promise((t,n)=>{const r=URL.createObjectURL(e),s=new Image,a=()=>URL.revokeObjectURL(r);s.onload=()=>t({image:s,release:a}),s.onerror=()=>{a(),n(new Error("This browser could not decode the selected image."))},s.src=r})}function z4(e,t){return new Promise((n,r)=>{e.toBlob(s=>s?n(s):r(new Error("This browser could not encode the optimized photo.")),"image/jpeg",t)})}async function B4(e,t){if(!EC(e.type,e.name))throw new Error("This image format cannot be optimized safely in this browser.");const n=Math.max(1,Math.floor(t*F4)),{image:r,release:s}=await V4(e),a=document.createElement("canvas"),l=a.getContext("2d",{alpha:!1});if(!l)throw s(),new Error("Photo optimization is unavailable in this browser.");try{let c=Math.min(L4,Math.max(r.naturalWidth,r.naturalHeight));for(;c>=j4;){const d=N4(r.naturalWidth,r.naturalHeight,c);a.width=d.width,a.height=d.height,l.fillStyle="#fff",l.fillRect(0,0,a.width,a.height),l.drawImage(r,0,0,a.width,a.height);for(const h of O4){const p=await z4(a,h);if(p.size<=n)return{filename:M4(e.name),mime:"image/jpeg",bytes:new Uint8Array(await p.arrayBuffer()),width:a.width,height:a.height,originalSize:e.size}}c=Math.floor(c*D4)}}finally{s(),a.width=1,a.height=1}throw new Error("The photo is still too large after optimization.")}const U4=5e4,$4=new Set(["http:","https:","mailto:"]);function _C(e){if(!(!e||e!==e.trim()||/[\u0000-\u001f\u007f]/u.test(e)))try{const t=new URL(e);return $4.has(t.protocol.toLowerCase())?e:void 0}catch{return}}function PC(e){const t="language-";return e?.startsWith(t)&&e.slice(t.length)||void 0}function Dx(e){return e.split(/(\n[ \t]*\n)/).map(t=>{if(/^\n[ \t]*\n$/.test(t))return t;const n=t.split(`
324
- `),r=n.filter(l=>l.trim().length>0);if(r.length===0)return t;const s=r.map(l=>l.match(/^[ \t]+/)?.[0]??"");if(s.some(l=>l.length===0))return t;const a=Math.min(...s.map(l=>l.length));return n.map(l=>l.trim().length>0?l.slice(a):l).join(`
325
- `)}).join("")}function H4(e){const t=[];let n=[],r="";for(const s of e.split(`
326
- `))if(r){n.push(s);const a=/^ {0,3}(`+|~+)[ \t]*$/.exec(s);a&&a[1][0]===r[0]&&a[1].length>=r.length&&(t.push(n.join(`
327
- `)),n=[],r="")}else{const a=/^ {0,3}(`{3,}|~{3,})(.*)$/.exec(s);a&&!(a[1][0]==="`"&&a[2].includes("`"))?(n.length&&t.push(Dx(n.join(`
328
- `))),n=[s],r=a[1]):n.push(s)}return n.length&&t.push(r?n.join(`
329
- `):Dx(n.join(`
330
- `))),t.join(`
331
- `)}function W4({children:e}){const t=S.isValidElement(e)?e:null,n=PC(t?.props.className);return n==="mermaid"?v.jsx(SC,{source:String(t?.props.children??"").replace(/\n$/,"")}):v.jsxs("div",{className:"message-code-block","data-language":n||void 0,children:[n&&v.jsx("div",{className:"message-code-language",children:n}),v.jsx("pre",{children:e})]})}const q4=[Ck],G4={a:({node:e,children:t,href:n,...r})=>{const s=_C(n);return s?v.jsx("a",{...r,href:s,target:"_blank",rel:"noopener noreferrer",children:t}):v.jsx("span",{className:"message-link-blocked",children:t})},img:({alt:e})=>v.jsxs("span",{className:"message-image-placeholder",children:["[image: ",e||"remote image blocked","]"]}),pre:W4,code:({node:e,className:t,children:n,...r})=>v.jsx("code",{className:t,"data-language":PC(t),...r,children:n})},Ox=S.memo(function({text:t,className:n="bubble-text message-markdown"}){return t.length>U4?v.jsx("div",{className:`${n} message-markdown-plaintext`,"data-render-mode":"plaintext",children:t}):v.jsx("div",{className:n,"data-render-mode":"markdown",children:v.jsx(kk,{remarkPlugins:q4,components:G4,urlTransform:r=>_C(r)??"",children:H4(t)})})}),TC=2025;let Jl,Zl;function K4(e){return e<65?!1:e<91?!0:e<97?!1:e<123?!0:AC(e)}function RC(e){return e<48?!1:e<58?!0:e<65?!1:e<91||e===95?!0:e<97?!1:e<123?!0:AC(e)||X4(e)}function AC(e){return IC(e,Jl??(Jl=Y4()))}function X4(e){return IC(e,Zl??(Zl=Q4()))}function Y4(){return MC("4q 0 b 0 5 0 6 m 2 u 2 cp 5 b f 4 8 0 2 0 3m 4 2 1 3 3 2 0 7 0 2 2 2 0 2 j 2 2a 2 3u 9 4l 2 11 3 0 7 14 20 q 5 3 1a 16 10 1 2 2q 2 0 g 1 8 1 b 2 3 0 h 0 2 t u 2g c 0 p w a 1 5 0 6 l 5 0 a 0 4 0 o o 8 a 6 n 2 6 h 15 1n 1h 4 0 j 0 8 9 g f 5 7 3 1 3 l 2 6 2 0 4 3 4 0 h 0 e 1 2 2 f 1 b 0 9 5 5 1 3 l 2 6 2 1 2 1 2 1 w 3 2 0 k 2 h 8 2 2 2 l 2 6 2 1 2 4 4 0 j 0 g 1 o 0 c 7 3 1 3 l 2 6 2 1 2 4 4 0 v 1 2 2 g 0 i 0 2 5 4 2 2 3 4 1 2 0 2 1 4 1 4 2 4 b n 0 1h 7 2 2 2 m 2 f 4 0 r 2 2 1 3 1 v 0 5 7 2 2 2 m 2 9 2 4 4 0 v 2 2 1 g 1 i 8 2 2 2 14 3 0 h 0 6 2 9 2 p 5 6 h 4 n 2 8 2 0 3 6 1n 1b 2 1 d 6 1n 1 2 0 2 4 2 n 2 0 2 9 2 1 a 0 3 4 2 0 m 3 x 0 1s 7 2 z s 4 38 16 l 0 h 5 5 3 4 0 4 1 8 2 5 c d 0 i 11 2 0 6 0 3 16 2 98 2 3 3 6 2 0 2 3 3 14 2 3 3 w 2 3 3 6 2 0 2 3 3 e 2 1k 2 3 3 1u 12 f h 2d 3 5 4 h7 3 g 2 p 6 22 4 a 8 h e i f h f c 2 2 g 1f 10 0 5 0 1w 2g 8 14 2 0 6 1x b u 1e t 3 4 c 17 5 p 1j m a 1g 2b 0 2m 1a i 7 1j t e 1 b 17 r z 16 2 b z 3 a 6 16 3 2 16 3 2 5 2 1 4 0 6 5b 1t 7p 3 5 3 11 3 5 3 7 2 0 2 0 2 0 2 u 3 1g 2 6 2 0 4 2 2 6 4 3 3 5 5 c 6 2 2 6 39 0 e 0 h c 2u 0 5 0 3 9 2 0 3 5 7 0 2 0 2 0 2 f 3 3 6 4 5 0 i 14 22g 6c 7 3 4 1 d 11 2 0 6 0 3 1j 8 0 h m a 6 2 6 2 6 2 6 2 6 2 6 2 6 2 6 fb 2 q 8 8 4 3 4 5 2d 5 4 2 2h 2 3 6 16 2 2l i v 1d f e9 533 1t h3g 1w 19 3 7g 4 f b 1 l 1a h u 3 27 14 8 3 2u 3 29 l g 2 2 2 3 2 m u 1f f 1d 1r 5 4 0 2 1 c r b m q s 8 1a t 0 h 4 2 9 b 4 2 14 o 2 2 7 l m 4 0 4 1d 2 0 4 1 3 4 3 0 2 0 p 2 3 a 8 2 d 5 3 5 3 5 a 6 2 6 2 16 2 d 7 36 u 8mb d m 5 1c 6it a5 3 2x 13 6 d 4 6 0 2 9 2 c 2 4 2 0 2 1 2 1 2 2z y a2 j 1r 3 1h 15 b 39 4 2 3q 11 p 7 p c 2g 4 5 3 5 3 5 3 2 10 b 2 p 2 i 2 1 2 e 3 d z 3e 1y 1g 7g s 4 1c 1c v e t 6 11 b t 3 z 5 7 2 4 17 4d j z 5 z 5 13 9 1f d a 2 e 2 6 2 1 2 a 2 e 2 6 2 1 4 1f d 8m a l b 7 p 5 2 15 2 8 1y 5 3 0 2 17 2 1 4 0 3 m b m a u 1u i 2 1 b l b p 7 p 13 1j 7 1 1t 0 g 3 2 2 2 s 17 s 4 s 10 7 2 r s 1h b l b i e h 33 20 1k 1e e 1e e z 13 r a m 6z 15 7 1 h 5 1l s b 0 9 l 17 h 1b k s m d 1g 1m 1 3 0 e 18 x o r z u 0 3 0 9 y 4 0 d 1b f 3 m 0 2 0 10 h 2 o k 1 1s 6 2 0 2 3 2 e 2 9 8 1a 13 7 3 1 3 l 2 6 2 1 2 4 4 0 j 0 d 4 v 9 2 0 3 0 2 11 2 0 q 0 2 0 19 1g j 3 l 2 v 1b l 1 2 0 55 1a 16 3 11 1b l 0 1o 16 e 0 20 q 12 6 56 17 39 1r w 7 3 0 3 7 2 1 2 n g 0 2 0 2n 7 3 12 h 0 2 0 t 0 b 13 8 0 m 0 c 19 k 0 j 20 5k w w 8 2 10 i 0 1e t 35 6 2 1 2 11 m 0 q 5 2 1 2 v f 0 o 17 79 i g 0 2 c 2 x 3h 0 28 pl 2v 32 i 5f 219 2o g tr i 5 q 32y 6 g6 5a2 t 1cz fs 8 u i 26 i t j 1b h 3 w k 6 i c1 18 5w 1r x o 3 o 19 22 6 0 1v c 1t 1 2 0 f 4 a 5p1 16 v 2q 36 6pq 3 2 6 2 1 2 82 g 0 u 2 3 0 f 3 9 az 1s5 2y 6 c 4 8 8 9 4mf 2c 2 1y 2 1 3 0 3 1 3 3 2 b 2 0 2 6 2 1s 2 3 3 7 2 6 2 r 2 3 2 4 2 0 4 6 2 9f 3 o 2 o 2 u 2 o 2 u 2 o 2 u 2 o 2 u 2 o 2 7 1f9 u 7 5 7a 1p 43 18 b 6 h 0 8y t j 17 dh r 6d t 3 0 5s u 2 2 2 1 2 6 3 4 a 1 69 6 2 3 2 1 2 e 2 5g 1o 1v 8 0 xh 3 2 q 2 1 2 0 3 0 2 9 2 3 2 0 2 0 7 0 5 0 2 0 2 0 2 2 2 1 2 0 3 0 2 0 2 0 2 0 2 0 2 1 2 0 3 3 2 6 2 3 2 3 2 0 2 9 2 g 6 2 2 4 2 g 3et wyn x 3dp 3 4gd 3 5rk g h9 1wj f1 15v 3t6 6 6jt")}function Q4(){return MC("53 0 g9 33 o 0 70 4 7e 18 2 0 2 1 2 1 2 0 21 a 1d u 7 0 2u 6 3 5 3 1 2 3 3 9 o 0 v q 2k a g 9 y 8 a 0 p 3 2 8 2 2 2 4 18 2 1o 8 17 n 2 w 1j 2 2 h 2 6 b 1 3 9 i 2 1l 0 2 6 3 1 3 2 a 0 b 1 3 9 f 0 3 2 1l 0 2 4 5 1 3 2 4 0 l b 4 0 c 2 1l 0 2 7 2 2 2 2 l 1 3 9 b 5 2 2 1l 0 2 6 3 1 3 2 8 2 b 1 3 9 j 0 1o 4 4 2 2 3 a 0 f 9 h 4 1k 0 2 6 2 2 2 3 8 1 c 1 3 9 i 2 1l 0 2 6 2 2 2 3 8 1 c 1 3 9 4 0 d 3 1k 1 2 6 2 2 2 3 a 0 b 1 3 9 i 2 1z 0 5 5 2 0 2 7 7 9 3 1 1q 0 3 6 d 7 2 9 2g 0 3 8 c 6 2 9 1r 1 7 9 c 0 2 0 2 0 5 1 1e j 2 1 6 a 2 z a 0 2t j 2 9 d 3 5 2 2 2 3 6 4 3 e b 2 e jk 2 a 8 pt 3 t 2 u 1 v 1 1t v a 0 3 9 y 2 2 a 40 0 3b b 5 b b 9 3l a 1p 4 1m 9 2 s 3 a 7 9 n d 2 u 3 b l 4 1c g c 9 i 8 d 2 v c 3 9 19 d 1d j 9 9 7 9 3b 2 2 k 5 0 7 0 3 2 5j 1r el 1 1e 1 k 0 3g c 5 0 4 b 2db 2 3y 0 2p v ff 5 2y 1 2p 0 n51 9 1y 0 5 9 x 1 29 1 7l 0 4 0 5 0 o 4 5 0 2c 1 1f h b 9 7 h e a t 7 q c 19 3 1c d g 9 c 0 b 9 1c d d 0 9 1 3 9 y 2 1f 0 2 2 3 1 6 1 2 0 16 4 6 1 6l 7 2 1 3 9 fmt 0 ki f h f 4 1 p 2 5d 9 12 0 12 0 ig 0 6b 0 46 4 86 9 120 2 2 1 6 3 15 2 5 0 4m 1 fy 3 9 9 7 9 w 4 8u 1 26 5 1z a 1e 3 3f 2 1i e w a 3 1 b 3 1a a 8 0 1a 9 7 2 11 d 2 9 6 1 19 0 d 2 1d d 9 3 2 b 2b b 7 0 3 0 4e b 6 9 7 3 1k 1 2 6 3 1 3 2 a 0 b 1 3 6 4 4 1w 8 2 0 3 0 2 3 2 4 2 0 f 1 2b h a 9 5 0 2a j d 9 5y 6 3 8 s 1 2b g g 9 2a c 9 9 7 j 1m e 5 9 6r e 4m 9 1z 5 2 1 3 3 2 0 2 1 d 9 3c 6 3 6 4 0 t 9 15 6 2 3 9 0 a a 1b f 5j 7 3t 9 1i 7 2 7 h 9 1l l 2 d 3f 5 4 0 2 1 2 6 2 0 9 9 1d 4 2 1 2 4 9 9 1j 9 7e 3 a 1 2 0 1d 6 4 4 e a 44m 0 7 e 8uh r 1t3 9 2f 9 13 4 1o 6 q 9 ev 9 d2 0 2 1i 8 3 2a 0 c 1 f58 1 382 9 ef 19 3 m f3 4 4 5 9 7 3 6 v 3 45 2 13e 1d e9 1i 5 1d 9 0 f 0 n 4 2 e 11t 6 2 g 3 6 2 1 2 4 2t 0 4h 6 a 9 9x 0 1q d dv d 6t 1 2 9 6h 0 3 0 8 1 6 0 d7 6 32 6 6 9 3o7 9 gvt3 6n")}function IC(e,t){let n=0,r=t.length/2|0,s=0,a=0,l=0;for(;n<r;)if(s=(n+r)/2|0,a=t[2*s],l=t[2*s+1],e<a)r=s;else if(e>l)n=s+1;else return!0;return!1}function MC(e){let t=0;return e.split(" ").map(n=>t+=parseInt(n,36)|0)}class ac{constructor(t,n,r,s,a,l,c,d,h){this._raw2018=t,this._raw2019=n,this._raw2020=r,this._raw2021=s,this._raw2022=a,this._raw2023=l,this._raw2024=c,this._raw2025=d,this._raw2026=h}get es2018(){var t;return(t=this._set2018)!==null&&t!==void 0?t:this._set2018=new Set(this._raw2018.split(" "))}get es2019(){var t;return(t=this._set2019)!==null&&t!==void 0?t:this._set2019=new Set(this._raw2019.split(" "))}get es2020(){var t;return(t=this._set2020)!==null&&t!==void 0?t:this._set2020=new Set(this._raw2020.split(" "))}get es2021(){var t;return(t=this._set2021)!==null&&t!==void 0?t:this._set2021=new Set(this._raw2021.split(" "))}get es2022(){var t;return(t=this._set2022)!==null&&t!==void 0?t:this._set2022=new Set(this._raw2022.split(" "))}get es2023(){var t;return(t=this._set2023)!==null&&t!==void 0?t:this._set2023=new Set(this._raw2023.split(" "))}get es2024(){var t;return(t=this._set2024)!==null&&t!==void 0?t:this._set2024=new Set(this._raw2024.split(" "))}get es2025(){var t;return(t=this._set2025)!==null&&t!==void 0?t:this._set2025=new Set(this._raw2025.split(" "))}get es2026(){var t;return(t=this._set2026)!==null&&t!==void 0?t:this._set2026=new Set(this._raw2026.split(" "))}}const J4=new Set(["General_Category","gc"]),Z4=new Set(["Script","Script_Extensions","sc","scx"]),eV=new ac("C Cased_Letter Cc Cf Close_Punctuation Cn Co Combining_Mark Connector_Punctuation Control Cs Currency_Symbol Dash_Punctuation Decimal_Number Enclosing_Mark Final_Punctuation Format Initial_Punctuation L LC Letter Letter_Number Line_Separator Ll Lm Lo Lowercase_Letter Lt Lu M Mark Math_Symbol Mc Me Mn Modifier_Letter Modifier_Symbol N Nd Nl No Nonspacing_Mark Number Open_Punctuation Other Other_Letter Other_Number Other_Punctuation Other_Symbol P Paragraph_Separator Pc Pd Pe Pf Pi Po Private_Use Ps Punctuation S Sc Separator Sk Sm So Space_Separator Spacing_Mark Surrogate Symbol Titlecase_Letter Unassigned Uppercase_Letter Z Zl Zp Zs cntrl digit punct","","","","","","","",""),Ts=new ac("Adlam Adlm Aghb Ahom Anatolian_Hieroglyphs Arab Arabic Armenian Armi Armn Avestan Avst Bali Balinese Bamu Bamum Bass Bassa_Vah Batak Batk Beng Bengali Bhaiksuki Bhks Bopo Bopomofo Brah Brahmi Brai Braille Bugi Buginese Buhd Buhid Cakm Canadian_Aboriginal Cans Cari Carian Caucasian_Albanian Chakma Cham Cher Cherokee Common Copt Coptic Cprt Cuneiform Cypriot Cyrillic Cyrl Deseret Deva Devanagari Dsrt Dupl Duployan Egyp Egyptian_Hieroglyphs Elba Elbasan Ethi Ethiopic Geor Georgian Glag Glagolitic Gonm Goth Gothic Gran Grantha Greek Grek Gujarati Gujr Gurmukhi Guru Han Hang Hangul Hani Hano Hanunoo Hatr Hatran Hebr Hebrew Hira Hiragana Hluw Hmng Hung Imperial_Aramaic Inherited Inscriptional_Pahlavi Inscriptional_Parthian Ital Java Javanese Kaithi Kali Kana Kannada Katakana Kayah_Li Khar Kharoshthi Khmer Khmr Khoj Khojki Khudawadi Knda Kthi Lana Lao Laoo Latin Latn Lepc Lepcha Limb Limbu Lina Linb Linear_A Linear_B Lisu Lyci Lycian Lydi Lydian Mahajani Mahj Malayalam Mand Mandaic Mani Manichaean Marc Marchen Masaram_Gondi Meetei_Mayek Mend Mende_Kikakui Merc Mero Meroitic_Cursive Meroitic_Hieroglyphs Miao Mlym Modi Mong Mongolian Mro Mroo Mtei Mult Multani Myanmar Mymr Nabataean Narb Nbat New_Tai_Lue Newa Nko Nkoo Nshu Nushu Ogam Ogham Ol_Chiki Olck Old_Hungarian Old_Italic Old_North_Arabian Old_Permic Old_Persian Old_South_Arabian Old_Turkic Oriya Orkh Orya Osage Osge Osma Osmanya Pahawh_Hmong Palm Palmyrene Pau_Cin_Hau Pauc Perm Phag Phags_Pa Phli Phlp Phnx Phoenician Plrd Prti Psalter_Pahlavi Qaac Qaai Rejang Rjng Runic Runr Samaritan Samr Sarb Saur Saurashtra Sgnw Sharada Shavian Shaw Shrd Sidd Siddham SignWriting Sind Sinh Sinhala Sora Sora_Sompeng Soyo Soyombo Sund Sundanese Sylo Syloti_Nagri Syrc Syriac Tagalog Tagb Tagbanwa Tai_Le Tai_Tham Tai_Viet Takr Takri Tale Talu Tamil Taml Tang Tangut Tavt Telu Telugu Tfng Tglg Thaa Thaana Thai Tibetan Tibt Tifinagh Tirh Tirhuta Ugar Ugaritic Vai Vaii Wara Warang_Citi Xpeo Xsux Yi Yiii Zanabazar_Square Zanb Zinh Zyyy","Dogr Dogra Gong Gunjala_Gondi Hanifi_Rohingya Maka Makasar Medefaidrin Medf Old_Sogdian Rohg Sogd Sogdian Sogo","Elym Elymaic Hmnp Nand Nandinagari Nyiakeng_Puachue_Hmong Wancho Wcho","Chorasmian Chrs Diak Dives_Akuru Khitan_Small_Script Kits Yezi Yezidi","Cpmn Cypro_Minoan Old_Uyghur Ougr Tangsa Tnsa Toto Vith Vithkuqi","Berf Beria_Erfe Gara Garay Gukh Gurung_Khema Hrkt Katakana_Or_Hiragana Kawi Kirat_Rai Krai Nag_Mundari Nagm Ol_Onal Onao Sidetic Sidt Sunu Sunuwar Tai_Yo Tayo Todhri Todr Tolong_Siki Tols Tulu_Tigalari Tutg Unknown Zzzz","","",""),jf=new ac("AHex ASCII ASCII_Hex_Digit Alpha Alphabetic Any Assigned Bidi_C Bidi_Control Bidi_M Bidi_Mirrored CI CWCF CWCM CWKCF CWL CWT CWU Case_Ignorable Cased Changes_When_Casefolded Changes_When_Casemapped Changes_When_Lowercased Changes_When_NFKC_Casefolded Changes_When_Titlecased Changes_When_Uppercased DI Dash Default_Ignorable_Code_Point Dep Deprecated Dia Diacritic Emoji Emoji_Component Emoji_Modifier Emoji_Modifier_Base Emoji_Presentation Ext Extender Gr_Base Gr_Ext Grapheme_Base Grapheme_Extend Hex Hex_Digit IDC IDS IDSB IDST IDS_Binary_Operator IDS_Trinary_Operator ID_Continue ID_Start Ideo Ideographic Join_C Join_Control LOE Logical_Order_Exception Lower Lowercase Math NChar Noncharacter_Code_Point Pat_Syn Pat_WS Pattern_Syntax Pattern_White_Space QMark Quotation_Mark RI Radical Regional_Indicator SD STerm Sentence_Terminal Soft_Dotted Term Terminal_Punctuation UIdeo Unified_Ideograph Upper Uppercase VS Variation_Selector White_Space XIDC XIDS XID_Continue XID_Start space","Extended_Pictographic","","EBase EComp EMod EPres ExtPict","","","","",""),tV=new ac("","","","","","","Basic_Emoji Emoji_Keycap_Sequence RGI_Emoji RGI_Emoji_Flag_Sequence RGI_Emoji_Modifier_Sequence RGI_Emoji_Tag_Sequence RGI_Emoji_ZWJ_Sequence","","");function Fx(e,t,n){return J4.has(t)?e>=2018&&eV.es2018.has(n):Z4.has(t)?e>=2018&&Ts.es2018.has(n)||e>=2019&&Ts.es2019.has(n)||e>=2020&&Ts.es2020.has(n)||e>=2021&&Ts.es2021.has(n)||e>=2022&&Ts.es2022.has(n)||e>=2023&&Ts.es2023.has(n):!1}function nV(e,t){return e>=2018&&jf.es2018.has(t)||e>=2019&&jf.es2019.has(t)||e>=2021&&jf.es2021.has(t)}function rV(e,t){return e>=2024&&tV.es2024.has(t)}const Vx=8,iV=9,NC=10,sV=11,oV=12,LC=13,Du=33,jC=35,Ws=36,DC=37,Li=38,ji=40,Di=41,ea=42,Ou=43,hm=44,En=45,Fu=46,Wo=47,li=48,aV=49,lV=55,Vu=57,zu=58,OC=59,ta=60,na=61,pm=62,Qn=63,FC=64,Bu=65,uV=66,cV=68,VC=70,dV=80,fV=83,hV=87,pV=90,mm=95,Uu=97,Df=98,Rs=99,Kh=100,gm=102,zC=103,ym=105,zx=107,vm=109,mV=110,gV=112,yV=113,vV=114,$u=115,xV=116,pu=117,Xh=118,wV=119,SV=120,BC=121,kV=122,Oi=91,Ct=92,Mr=93,Os=94,UC=96,Fi=123,ra=124,Vi=125,$C=126,CV=8204,bV=8205,EV=8232,_V=8233,PV=0,TV=1114111;function HC(e){return e>=Bu&&e<=pV||e>=Uu&&e<=kV}function mu(e){return e>=li&&e<=Vu}function RV(e){return e>=li&&e<=lV}function Bx(e){return e>=li&&e<=Vu||e>=Bu&&e<=VC||e>=Uu&&e<=gm}function AV(e){return e===NC||e===LC||e===EV||e===_V}function IV(e){return e>=PV&&e<=TV}function Of(e){return e>=Uu&&e<=gm?e-Uu+10:e>=Bu&&e<=VC?e-Bu+10:e-li}function Ff(e){return e>=55296&&e<=56319}function Vf(e){return e>=56320&&e<=57343}function zf(e,t){return(e-55296)*1024+(t-56320)+65536}class MV{constructor(){this.groupName=new Set}clear(){this.groupName.clear()}isEmpty(){return!this.groupName.size}hasInPattern(t){return this.groupName.has(t)}hasInScope(t){return this.hasInPattern(t)}addToScope(t){this.groupName.add(t)}enterDisjunction(){}enterAlternative(){}leaveDisjunction(){}}class ma{constructor(t,n){this.parent=t,this.base=n??this}separatedFrom(t){var n,r;return this.base===t.base&&this!==t||t.parent&&this.separatedFrom(t.parent)?!0:(r=(n=this.parent)===null||n===void 0?void 0:n.separatedFrom(t))!==null&&r!==void 0?r:!1}child(){return new ma(this,null)}sibling(){return new ma(this.parent,this.base)}}class NV{constructor(){this.branchID=new ma(null,null),this.groupNames=new Map}clear(){this.branchID=new ma(null,null),this.groupNames.clear()}isEmpty(){return!this.groupNames.size}enterDisjunction(){this.branchID=this.branchID.child()}enterAlternative(t){t!==0&&(this.branchID=this.branchID.sibling())}leaveDisjunction(){this.branchID=this.branchID.parent}hasInPattern(t){return this.groupNames.has(t)}hasInScope(t){const n=this.groupNames.get(t);if(!n)return!1;for(const r of n)if(!r.separatedFrom(this.branchID))return!0;return!1}addToScope(t){const n=this.groupNames.get(t);if(n){n.push(this.branchID);return}this.groupNames.set(t,[this.branchID])}}const Ux={at(e,t,n){return n<t?e.charCodeAt(n):-1},width(e){return 1}},LV={at(e,t,n){return n<t?e.codePointAt(n):-1},width(e){return e>65535?2:1}};class jV{constructor(){this._impl=Ux,this._s="",this._i=0,this._end=0,this._cp1=-1,this._w1=1,this._cp2=-1,this._w2=1,this._cp3=-1,this._w3=1,this._cp4=-1}get source(){return this._s}get index(){return this._i}get currentCodePoint(){return this._cp1}get nextCodePoint(){return this._cp2}get nextCodePoint2(){return this._cp3}get nextCodePoint3(){return this._cp4}reset(t,n,r,s){this._impl=s?LV:Ux,this._s=t,this._end=r,this.rewind(n)}rewind(t){const n=this._impl;this._i=t,this._cp1=n.at(this._s,this._end,t),this._w1=n.width(this._cp1),this._cp2=n.at(this._s,this._end,t+this._w1),this._w2=n.width(this._cp2),this._cp3=n.at(this._s,this._end,t+this._w1+this._w2),this._w3=n.width(this._cp3),this._cp4=n.at(this._s,this._end,t+this._w1+this._w2+this._w3)}advance(){if(this._cp1!==-1){const t=this._impl;this._i+=this._w1,this._cp1=this._cp2,this._w1=this._w2,this._cp2=this._cp3,this._w2=t.width(this._cp2),this._cp3=this._cp4,this._w3=t.width(this._cp3),this._cp4=t.at(this._s,this._end,this._i+this._w1+this._w2+this._w3)}}eat(t){return this._cp1===t?(this.advance(),!0):!1}eat2(t,n){return this._cp1===t&&this._cp2===n?(this.advance(),this.advance(),!0):!1}eat3(t,n,r){return this._cp1===t&&this._cp2===n&&this._cp3===r?(this.advance(),this.advance(),this.advance(),!0):!1}}class DV extends SyntaxError{constructor(t,n){super(t),this.index=n}}function OV(e,t,n,r){let s="";if(e.kind==="literal"){const a=e.source.slice(e.start,e.end);a&&(s=`: ${a}`)}else if(e.kind==="pattern"){const a=e.source.slice(e.start,e.end),l=`${t.unicode?"u":""}${t.unicodeSets?"v":""}`;s=`: /${a}/${l}`}return new DV(`Invalid regular expression${s}: ${r}`,n)}const FV=new Set([Os,Ws,Ct,Fu,ea,Ou,Qn,ji,Di,Oi,Mr,Fi,Vi,ra]),VV=new Set([Li,Du,jC,Ws,DC,ea,Ou,hm,Fu,zu,OC,ta,na,pm,Qn,FC,Os,UC,$C]),zV=new Set([ji,Di,Oi,Mr,Fi,Vi,Wo,En,Ct,ra]),BV=new Set([Li,En,Du,jC,DC,hm,zu,OC,ta,na,pm,FC,UC,$C]),WC={global:zC,ignoreCase:ym,multiline:vm,unicode:pu,sticky:BC,dotAll:$u,hasIndices:Kh,unicodeSets:Xh},UV=Object.fromEntries(Object.entries(WC).map(([e,t])=>[t,e]));function $x(e){return FV.has(e)}function Hx(e){return VV.has(e)}function $V(e){return zV.has(e)}function HV(e){return BV.has(e)}function WV(e){return K4(e)||e===Ws||e===mm}function qV(e){return RC(e)||e===Ws||e===CV||e===bV}function qC(e){return HC(e)||e===mm}function GV(e){return qC(e)||mu(e)}function KV(e){return e===ym||e===vm||e===$u}class XV{constructor(t){this._reader=new jV,this._unicodeMode=!1,this._unicodeSetsMode=!1,this._nFlag=!1,this._lastIntValue=0,this._lastRange={min:0,max:Number.POSITIVE_INFINITY},this._lastStrValue="",this._lastAssertionIsQuantifiable=!1,this._numCapturingParens=0,this._backreferenceNames=new Set,this._srcCtx=null,this._options=t??{},this._groupSpecifiers=this.ecmaVersion>=2025?new NV:new MV}validateLiteral(t,n=0,r=t.length){if(this._srcCtx={source:t,start:n,end:r,kind:"literal"},this._unicodeSetsMode=this._unicodeMode=this._nFlag=!1,this.reset(t,n,r),this.onLiteralEnter(n),this.eat(Wo)&&this.eatRegExpBody()&&this.eat(Wo)){const s=this.index,a=t.includes("u",s),l=t.includes("v",s);this.validateFlagsInternal(t,s,r),this.validatePatternInternal(t,n+1,s-1,{unicode:a,unicodeSets:l})}else if(n>=r)this.raise("Empty");else{const s=String.fromCodePoint(this.currentCodePoint);this.raise(`Unexpected character '${s}'`)}this.onLiteralLeave(n,r)}validateFlags(t,n=0,r=t.length){this._srcCtx={source:t,start:n,end:r,kind:"flags"},this.validateFlagsInternal(t,n,r)}validatePattern(t,n=0,r=t.length,s=void 0){this._srcCtx={source:t,start:n,end:r,kind:"pattern"},this.validatePatternInternal(t,n,r,s)}validatePatternInternal(t,n=0,r=t.length,s=void 0){const a=this._parseFlagsOptionToMode(s,r);this._unicodeMode=a.unicodeMode,this._nFlag=a.nFlag,this._unicodeSetsMode=a.unicodeSetsMode,this.reset(t,n,r),this.consumePattern(),!this._nFlag&&this.ecmaVersion>=2018&&!this._groupSpecifiers.isEmpty()&&(this._nFlag=!0,this.rewind(n),this.consumePattern())}validateFlagsInternal(t,n,r){const s=this.parseFlags(t,n,r);this.onRegExpFlags(n,r,s)}_parseFlagsOptionToMode(t,n){let r=!1,s=!1;t&&this.ecmaVersion>=2015&&(typeof t=="object"?(r=!!t.unicode,this.ecmaVersion>=2024&&(s=!!t.unicodeSets)):r=t),r&&s&&this.raise("Invalid regular expression flags",{index:n+1,unicode:r,unicodeSets:s});const a=r||s,l=r&&this.ecmaVersion>=2018||s||!!(this._options.strict&&this.ecmaVersion>=2023);return{unicodeMode:a,nFlag:l,unicodeSetsMode:s}}get strict(){return!!this._options.strict||this._unicodeMode}get ecmaVersion(){var t;return(t=this._options.ecmaVersion)!==null&&t!==void 0?t:TC}onLiteralEnter(t){this._options.onLiteralEnter&&this._options.onLiteralEnter(t)}onLiteralLeave(t,n){this._options.onLiteralLeave&&this._options.onLiteralLeave(t,n)}onRegExpFlags(t,n,r){this._options.onRegExpFlags&&this._options.onRegExpFlags(t,n,r),this._options.onFlags&&this._options.onFlags(t,n,r.global,r.ignoreCase,r.multiline,r.unicode,r.sticky,r.dotAll,r.hasIndices)}onPatternEnter(t){this._options.onPatternEnter&&this._options.onPatternEnter(t)}onPatternLeave(t,n){this._options.onPatternLeave&&this._options.onPatternLeave(t,n)}onDisjunctionEnter(t){this._options.onDisjunctionEnter&&this._options.onDisjunctionEnter(t)}onDisjunctionLeave(t,n){this._options.onDisjunctionLeave&&this._options.onDisjunctionLeave(t,n)}onAlternativeEnter(t,n){this._options.onAlternativeEnter&&this._options.onAlternativeEnter(t,n)}onAlternativeLeave(t,n,r){this._options.onAlternativeLeave&&this._options.onAlternativeLeave(t,n,r)}onGroupEnter(t){this._options.onGroupEnter&&this._options.onGroupEnter(t)}onGroupLeave(t,n){this._options.onGroupLeave&&this._options.onGroupLeave(t,n)}onModifiersEnter(t){this._options.onModifiersEnter&&this._options.onModifiersEnter(t)}onModifiersLeave(t,n){this._options.onModifiersLeave&&this._options.onModifiersLeave(t,n)}onAddModifiers(t,n,r){this._options.onAddModifiers&&this._options.onAddModifiers(t,n,r)}onRemoveModifiers(t,n,r){this._options.onRemoveModifiers&&this._options.onRemoveModifiers(t,n,r)}onCapturingGroupEnter(t,n){this._options.onCapturingGroupEnter&&this._options.onCapturingGroupEnter(t,n)}onCapturingGroupLeave(t,n,r){this._options.onCapturingGroupLeave&&this._options.onCapturingGroupLeave(t,n,r)}onQuantifier(t,n,r,s,a){this._options.onQuantifier&&this._options.onQuantifier(t,n,r,s,a)}onLookaroundAssertionEnter(t,n,r){this._options.onLookaroundAssertionEnter&&this._options.onLookaroundAssertionEnter(t,n,r)}onLookaroundAssertionLeave(t,n,r,s){this._options.onLookaroundAssertionLeave&&this._options.onLookaroundAssertionLeave(t,n,r,s)}onEdgeAssertion(t,n,r){this._options.onEdgeAssertion&&this._options.onEdgeAssertion(t,n,r)}onWordBoundaryAssertion(t,n,r,s){this._options.onWordBoundaryAssertion&&this._options.onWordBoundaryAssertion(t,n,r,s)}onAnyCharacterSet(t,n,r){this._options.onAnyCharacterSet&&this._options.onAnyCharacterSet(t,n,r)}onEscapeCharacterSet(t,n,r,s){this._options.onEscapeCharacterSet&&this._options.onEscapeCharacterSet(t,n,r,s)}onUnicodePropertyCharacterSet(t,n,r,s,a,l,c){this._options.onUnicodePropertyCharacterSet&&this._options.onUnicodePropertyCharacterSet(t,n,r,s,a,l,c)}onCharacter(t,n,r){this._options.onCharacter&&this._options.onCharacter(t,n,r)}onBackreference(t,n,r){this._options.onBackreference&&this._options.onBackreference(t,n,r)}onCharacterClassEnter(t,n,r){this._options.onCharacterClassEnter&&this._options.onCharacterClassEnter(t,n,r)}onCharacterClassLeave(t,n,r){this._options.onCharacterClassLeave&&this._options.onCharacterClassLeave(t,n,r)}onCharacterClassRange(t,n,r,s){this._options.onCharacterClassRange&&this._options.onCharacterClassRange(t,n,r,s)}onClassIntersection(t,n){this._options.onClassIntersection&&this._options.onClassIntersection(t,n)}onClassSubtraction(t,n){this._options.onClassSubtraction&&this._options.onClassSubtraction(t,n)}onClassStringDisjunctionEnter(t){this._options.onClassStringDisjunctionEnter&&this._options.onClassStringDisjunctionEnter(t)}onClassStringDisjunctionLeave(t,n){this._options.onClassStringDisjunctionLeave&&this._options.onClassStringDisjunctionLeave(t,n)}onStringAlternativeEnter(t,n){this._options.onStringAlternativeEnter&&this._options.onStringAlternativeEnter(t,n)}onStringAlternativeLeave(t,n,r){this._options.onStringAlternativeLeave&&this._options.onStringAlternativeLeave(t,n,r)}get index(){return this._reader.index}get currentCodePoint(){return this._reader.currentCodePoint}get nextCodePoint(){return this._reader.nextCodePoint}get nextCodePoint2(){return this._reader.nextCodePoint2}get nextCodePoint3(){return this._reader.nextCodePoint3}reset(t,n,r){this._reader.reset(t,n,r,this._unicodeMode)}rewind(t){this._reader.rewind(t)}advance(){this._reader.advance()}eat(t){return this._reader.eat(t)}eat2(t,n){return this._reader.eat2(t,n)}eat3(t,n,r){return this._reader.eat3(t,n,r)}raise(t,n){var r,s,a;throw OV(this._srcCtx,{unicode:(r=n?.unicode)!==null&&r!==void 0?r:this._unicodeMode&&!this._unicodeSetsMode,unicodeSets:(s=n?.unicodeSets)!==null&&s!==void 0?s:this._unicodeSetsMode},(a=n?.index)!==null&&a!==void 0?a:this.index,t)}eatRegExpBody(){const t=this.index;let n=!1,r=!1;for(;;){const s=this.currentCodePoint;if(s===-1||AV(s)){const a=n?"character class":"regular expression";this.raise(`Unterminated ${a}`)}if(r)r=!1;else if(s===Ct)r=!0;else if(s===Oi)n=!0;else if(s===Mr)n=!1;else if(s===Wo&&!n||s===ea&&this.index===t)break;this.advance()}return this.index!==t}consumePattern(){const t=this.index;this._numCapturingParens=this.countCapturingParens(),this._groupSpecifiers.clear(),this._backreferenceNames.clear(),this.onPatternEnter(t),this.consumeDisjunction();const n=this.currentCodePoint;if(this.currentCodePoint!==-1){n===Di&&this.raise("Unmatched ')'"),n===Ct&&this.raise("\\ at end of pattern"),(n===Mr||n===Vi)&&this.raise("Lone quantifier brackets");const r=String.fromCodePoint(n);this.raise(`Unexpected character '${r}'`)}for(const r of this._backreferenceNames)this._groupSpecifiers.hasInPattern(r)||this.raise("Invalid named capture referenced");this.onPatternLeave(t,this.index)}countCapturingParens(){const t=this.index;let n=!1,r=!1,s=0,a=0;for(;(a=this.currentCodePoint)!==-1;)r?r=!1:a===Ct?r=!0:a===Oi?n=!0:a===Mr?n=!1:a===ji&&!n&&(this.nextCodePoint!==Qn||this.nextCodePoint2===ta&&this.nextCodePoint3!==na&&this.nextCodePoint3!==Du)&&(s+=1),this.advance();return this.rewind(t),s}consumeDisjunction(){const t=this.index;let n=0;this._groupSpecifiers.enterDisjunction(),this.onDisjunctionEnter(t);do this.consumeAlternative(n++);while(this.eat(ra));this.consumeQuantifier(!0)&&this.raise("Nothing to repeat"),this.eat(Fi)&&this.raise("Lone quantifier brackets"),this.onDisjunctionLeave(t,this.index),this._groupSpecifiers.leaveDisjunction()}consumeAlternative(t){const n=this.index;for(this._groupSpecifiers.enterAlternative(t),this.onAlternativeEnter(n,t);this.currentCodePoint!==-1&&this.consumeTerm(););this.onAlternativeLeave(n,this.index,t)}consumeTerm(){return this._unicodeMode||this.strict?this.consumeAssertion()||this.consumeAtom()&&this.consumeOptionalQuantifier():this.consumeAssertion()&&(!this._lastAssertionIsQuantifiable||this.consumeOptionalQuantifier())||this.consumeExtendedAtom()&&this.consumeOptionalQuantifier()}consumeOptionalQuantifier(){return this.consumeQuantifier(),!0}consumeAssertion(){const t=this.index;if(this._lastAssertionIsQuantifiable=!1,this.eat(Os))return this.onEdgeAssertion(t,this.index,"start"),!0;if(this.eat(Ws))return this.onEdgeAssertion(t,this.index,"end"),!0;if(this.eat2(Ct,uV))return this.onWordBoundaryAssertion(t,this.index,"word",!0),!0;if(this.eat2(Ct,Df))return this.onWordBoundaryAssertion(t,this.index,"word",!1),!0;if(this.eat2(ji,Qn)){const n=this.ecmaVersion>=2018&&this.eat(ta);let r=!1;if(this.eat(na)||(r=this.eat(Du))){const s=n?"lookbehind":"lookahead";return this.onLookaroundAssertionEnter(t,s,r),this.consumeDisjunction(),this.eat(Di)||this.raise("Unterminated group"),this._lastAssertionIsQuantifiable=!n&&!this.strict,this.onLookaroundAssertionLeave(t,this.index,s,r),!0}this.rewind(t)}return!1}consumeQuantifier(t=!1){const n=this.index;let r=0,s=0,a=!1;if(this.eat(ea))r=0,s=Number.POSITIVE_INFINITY;else if(this.eat(Ou))r=1,s=Number.POSITIVE_INFINITY;else if(this.eat(Qn))r=0,s=1;else if(this.eatBracedQuantifier(t))({min:r,max:s}=this._lastRange);else return!1;return a=!this.eat(Qn),t||this.onQuantifier(n,this.index,r,s,a),!0}eatBracedQuantifier(t){const n=this.index;if(this.eat(Fi)){if(this.eatDecimalDigits()){const r=this._lastIntValue;let s=r;if(this.eat(hm)&&(s=this.eatDecimalDigits()?this._lastIntValue:Number.POSITIVE_INFINITY),this.eat(Vi))return!t&&s<r&&this.raise("numbers out of order in {} quantifier"),this._lastRange={min:r,max:s},!0}!t&&(this._unicodeMode||this.strict)&&this.raise("Incomplete quantifier"),this.rewind(n)}return!1}consumeAtom(){return this.consumePatternCharacter()||this.consumeDot()||this.consumeReverseSolidusAtomEscape()||!!this.consumeCharacterClass()||this.consumeCapturingGroup()||this.consumeUncapturingGroup()}consumeDot(){return this.eat(Fu)?(this.onAnyCharacterSet(this.index-1,this.index,"any"),!0):!1}consumeReverseSolidusAtomEscape(){const t=this.index;if(this.eat(Ct)){if(this.consumeAtomEscape())return!0;this.rewind(t)}return!1}consumeUncapturingGroup(){const t=this.index;return this.eat2(ji,Qn)?(this.onGroupEnter(t),this.ecmaVersion>=2025&&this.consumeModifiers(),this.eat(zu)||(this.rewind(t+1),this.raise("Invalid group")),this.consumeDisjunction(),this.eat(Di)||this.raise("Unterminated group"),this.onGroupLeave(t,this.index),!0):!1}consumeModifiers(){const t=this.index,n=this.eatModifiers(),r=this.index,s=this.eat(En);if(!n&&!s)return!1;this.onModifiersEnter(t);const a=this.parseModifiers(t,r);if(this.onAddModifiers(t,r,a),s){const l=this.index;!this.eatModifiers()&&!n&&this.currentCodePoint===zu&&this.raise("Invalid empty flags");const c=this.parseModifiers(l,this.index);for(const[d]of Object.entries(c).filter(([,h])=>h))a[d]&&this.raise(`Duplicated flag '${String.fromCodePoint(WC[d])}'`);this.onRemoveModifiers(l,this.index,c)}return this.onModifiersLeave(t,this.index),!0}consumeCapturingGroup(){const t=this.index;if(this.eat(ji)){let n=null;if(this.ecmaVersion>=2018){if(this.consumeGroupSpecifier())n=this._lastStrValue;else if(this.currentCodePoint===Qn)return this.rewind(t),!1}else if(this.currentCodePoint===Qn)return this.rewind(t),!1;return this.onCapturingGroupEnter(t,n),this.consumeDisjunction(),this.eat(Di)||this.raise("Unterminated group"),this.onCapturingGroupLeave(t,this.index,n),!0}return!1}consumeExtendedAtom(){return this.consumeDot()||this.consumeReverseSolidusAtomEscape()||this.consumeReverseSolidusFollowedByC()||!!this.consumeCharacterClass()||this.consumeCapturingGroup()||this.consumeUncapturingGroup()||this.consumeInvalidBracedQuantifier()||this.consumeExtendedPatternCharacter()}consumeReverseSolidusFollowedByC(){const t=this.index;return this.currentCodePoint===Ct&&this.nextCodePoint===Rs?(this._lastIntValue=this.currentCodePoint,this.advance(),this.onCharacter(t,this.index,Ct),!0):!1}consumeInvalidBracedQuantifier(){return this.eatBracedQuantifier(!0)&&this.raise("Nothing to repeat"),!1}consumePatternCharacter(){const t=this.index,n=this.currentCodePoint;return n!==-1&&!$x(n)?(this.advance(),this.onCharacter(t,this.index,n),!0):!1}consumeExtendedPatternCharacter(){const t=this.index,n=this.currentCodePoint;return n!==-1&&n!==Os&&n!==Ws&&n!==Ct&&n!==Fu&&n!==ea&&n!==Ou&&n!==Qn&&n!==ji&&n!==Di&&n!==Oi&&n!==ra?(this.advance(),this.onCharacter(t,this.index,n),!0):!1}consumeGroupSpecifier(){const t=this.index;if(this.eat(Qn)){if(this.eatGroupName()){if(!this._groupSpecifiers.hasInScope(this._lastStrValue))return this._groupSpecifiers.addToScope(this._lastStrValue),!0;this.raise("Duplicate capture group name")}this.rewind(t)}return!1}consumeAtomEscape(){return this.consumeBackreference()||this.consumeCharacterClassEscape()||this.consumeCharacterEscape()||this._nFlag&&this.consumeKGroupName()?!0:((this.strict||this._unicodeMode)&&this.raise("Invalid escape"),!1)}consumeBackreference(){const t=this.index;if(this.eatDecimalEscape()){const n=this._lastIntValue;if(n<=this._numCapturingParens)return this.onBackreference(t-1,this.index,n),!0;(this.strict||this._unicodeMode)&&this.raise("Invalid escape"),this.rewind(t)}return!1}consumeCharacterClassEscape(){var t;const n=this.index;if(this.eat(Kh))return this._lastIntValue=-1,this.onEscapeCharacterSet(n-1,this.index,"digit",!1),{};if(this.eat(cV))return this._lastIntValue=-1,this.onEscapeCharacterSet(n-1,this.index,"digit",!0),{};if(this.eat($u))return this._lastIntValue=-1,this.onEscapeCharacterSet(n-1,this.index,"space",!1),{};if(this.eat(fV))return this._lastIntValue=-1,this.onEscapeCharacterSet(n-1,this.index,"space",!0),{};if(this.eat(wV))return this._lastIntValue=-1,this.onEscapeCharacterSet(n-1,this.index,"word",!1),{};if(this.eat(hV))return this._lastIntValue=-1,this.onEscapeCharacterSet(n-1,this.index,"word",!0),{};let r=!1;if(this._unicodeMode&&this.ecmaVersion>=2018&&(this.eat(gV)||(r=this.eat(dV)))){this._lastIntValue=-1;let s=null;if(this.eat(Fi)&&(s=this.eatUnicodePropertyValueExpression())&&this.eat(Vi))return r&&s.strings&&this.raise("Invalid property name"),this.onUnicodePropertyCharacterSet(n-1,this.index,"property",s.key,s.value,r,(t=s.strings)!==null&&t!==void 0?t:!1),{mayContainStrings:s.strings};this.raise("Invalid property name")}return null}consumeCharacterEscape(){const t=this.index;return this.eatControlEscape()||this.eatCControlLetter()||this.eatZero()||this.eatHexEscapeSequence()||this.eatRegExpUnicodeEscapeSequence()||!this.strict&&!this._unicodeMode&&this.eatLegacyOctalEscapeSequence()||this.eatIdentityEscape()?(this.onCharacter(t-1,this.index,this._lastIntValue),!0):!1}consumeKGroupName(){const t=this.index;if(this.eat(zx)){if(this.eatGroupName()){const n=this._lastStrValue;return this._backreferenceNames.add(n),this.onBackreference(t-1,this.index,n),!0}this.raise("Invalid named reference")}return!1}consumeCharacterClass(){const t=this.index;if(this.eat(Oi)){const n=this.eat(Os);this.onCharacterClassEnter(t,n,this._unicodeSetsMode);const r=this.consumeClassContents();return this.eat(Mr)||(this.currentCodePoint===-1&&this.raise("Unterminated character class"),this.raise("Invalid character in character class")),n&&r.mayContainStrings&&this.raise("Negated character class may contain strings"),this.onCharacterClassLeave(t,this.index,n),r}return null}consumeClassContents(){if(this._unicodeSetsMode)return this.currentCodePoint===Mr?{}:this.consumeClassSetExpression();const t=this.strict||this._unicodeMode;for(;;){const n=this.index;if(!this.consumeClassAtom())break;const r=this._lastIntValue;if(!this.eat(En))continue;if(this.onCharacter(this.index-1,this.index,En),!this.consumeClassAtom())break;const s=this._lastIntValue;if(r===-1||s===-1){t&&this.raise("Invalid character class");continue}r>s&&this.raise("Range out of order in character class"),this.onCharacterClassRange(n,this.index,r,s)}return{}}consumeClassAtom(){const t=this.index,n=this.currentCodePoint;if(n!==-1&&n!==Ct&&n!==Mr)return this.advance(),this._lastIntValue=n,this.onCharacter(t,this.index,this._lastIntValue),!0;if(this.eat(Ct)){if(this.consumeClassEscape())return!0;if(!this.strict&&this.currentCodePoint===Rs)return this._lastIntValue=Ct,this.onCharacter(t,this.index,this._lastIntValue),!0;(this.strict||this._unicodeMode)&&this.raise("Invalid escape"),this.rewind(t)}return!1}consumeClassEscape(){const t=this.index;if(this.eat(Df))return this._lastIntValue=Vx,this.onCharacter(t-1,this.index,this._lastIntValue),!0;if(this._unicodeMode&&this.eat(En))return this._lastIntValue=En,this.onCharacter(t-1,this.index,this._lastIntValue),!0;let n=0;return!this.strict&&!this._unicodeMode&&this.currentCodePoint===Rs&&(mu(n=this.nextCodePoint)||n===mm)?(this.advance(),this.advance(),this._lastIntValue=n%32,this.onCharacter(t-1,this.index,this._lastIntValue),!0):!!this.consumeCharacterClassEscape()||this.consumeCharacterEscape()}consumeClassSetExpression(){const t=this.index;let n=!1,r=null;if(this.consumeClassSetCharacter()){if(this.consumeClassSetRangeFromOperator(t))return this.consumeClassUnionRight({}),{};n=!1}else if(r=this.consumeClassSetOperand())n=r.mayContainStrings;else{const s=this.currentCodePoint;s===Ct&&(this.advance(),this.raise("Invalid escape")),s===this.nextCodePoint&&Hx(s)&&this.raise("Invalid set operation in character class"),this.raise("Invalid character in character class")}if(this.eat2(Li,Li)){for(;this.currentCodePoint!==Li&&(r=this.consumeClassSetOperand());)if(this.onClassIntersection(t,this.index),r.mayContainStrings||(n=!1),!this.eat2(Li,Li))return{mayContainStrings:n};this.raise("Invalid character in character class")}if(this.eat2(En,En)){for(;this.consumeClassSetOperand();)if(this.onClassSubtraction(t,this.index),!this.eat2(En,En))return{mayContainStrings:n};this.raise("Invalid character in character class")}return this.consumeClassUnionRight({mayContainStrings:n})}consumeClassUnionRight(t){let n=t.mayContainStrings;for(;;){const r=this.index;if(this.consumeClassSetCharacter()){this.consumeClassSetRangeFromOperator(r);continue}const s=this.consumeClassSetOperand();if(s){s.mayContainStrings&&(n=!0);continue}break}return{mayContainStrings:n}}consumeClassSetRangeFromOperator(t){const n=this.index,r=this._lastIntValue;if(this.eat(En)){if(this.consumeClassSetCharacter()){const s=this._lastIntValue;return(r===-1||s===-1)&&this.raise("Invalid character class"),r>s&&this.raise("Range out of order in character class"),this.onCharacterClassRange(t,this.index,r,s),!0}this.rewind(n)}return!1}consumeClassSetOperand(){let t=null;return(t=this.consumeNestedClass())||(t=this.consumeClassStringDisjunction())?t:this.consumeClassSetCharacter()?{}:null}consumeNestedClass(){const t=this.index;if(this.eat(Oi)){const n=this.eat(Os);this.onCharacterClassEnter(t,n,!0);const r=this.consumeClassContents();return this.eat(Mr)||this.raise("Unterminated character class"),n&&r.mayContainStrings&&this.raise("Negated character class may contain strings"),this.onCharacterClassLeave(t,this.index,n),r}if(this.eat(Ct)){const n=this.consumeCharacterClassEscape();if(n)return n;this.rewind(t)}return null}consumeClassStringDisjunction(){const t=this.index;if(this.eat3(Ct,yV,Fi)){this.onClassStringDisjunctionEnter(t);let n=0,r=!1;do this.consumeClassString(n++).mayContainStrings&&(r=!0);while(this.eat(ra));if(this.eat(Vi))return this.onClassStringDisjunctionLeave(t,this.index),{mayContainStrings:r};this.raise("Unterminated class string disjunction")}return null}consumeClassString(t){const n=this.index;let r=0;for(this.onStringAlternativeEnter(n,t);this.currentCodePoint!==-1&&this.consumeClassSetCharacter();)r++;return this.onStringAlternativeLeave(n,this.index,t),{mayContainStrings:r!==1}}consumeClassSetCharacter(){const t=this.index,n=this.currentCodePoint;if((n!==this.nextCodePoint||!Hx(n))&&n!==-1&&!$V(n))return this._lastIntValue=n,this.advance(),this.onCharacter(t,this.index,this._lastIntValue),!0;if(this.eat(Ct)){if(this.consumeCharacterEscape())return!0;if(HV(this.currentCodePoint))return this._lastIntValue=this.currentCodePoint,this.advance(),this.onCharacter(t,this.index,this._lastIntValue),!0;if(this.eat(Df))return this._lastIntValue=Vx,this.onCharacter(t,this.index,this._lastIntValue),!0;this.rewind(t)}return!1}eatGroupName(){if(this.eat(ta)){if(this.eatRegExpIdentifierName()&&this.eat(pm))return!0;this.raise("Invalid capture group name")}return!1}eatRegExpIdentifierName(){if(this.eatRegExpIdentifierStart()){for(this._lastStrValue=String.fromCodePoint(this._lastIntValue);this.eatRegExpIdentifierPart();)this._lastStrValue+=String.fromCodePoint(this._lastIntValue);return!0}return!1}eatRegExpIdentifierStart(){const t=this.index,n=!this._unicodeMode&&this.ecmaVersion>=2020;let r=this.currentCodePoint;return this.advance(),r===Ct&&this.eatRegExpUnicodeEscapeSequence(n)?r=this._lastIntValue:n&&Ff(r)&&Vf(this.currentCodePoint)&&(r=zf(r,this.currentCodePoint),this.advance()),WV(r)?(this._lastIntValue=r,!0):(this.index!==t&&this.rewind(t),!1)}eatRegExpIdentifierPart(){const t=this.index,n=!this._unicodeMode&&this.ecmaVersion>=2020;let r=this.currentCodePoint;return this.advance(),r===Ct&&this.eatRegExpUnicodeEscapeSequence(n)?r=this._lastIntValue:n&&Ff(r)&&Vf(this.currentCodePoint)&&(r=zf(r,this.currentCodePoint),this.advance()),qV(r)?(this._lastIntValue=r,!0):(this.index!==t&&this.rewind(t),!1)}eatCControlLetter(){const t=this.index;if(this.eat(Rs)){if(this.eatControlLetter())return!0;this.rewind(t)}return!1}eatZero(){return this.currentCodePoint===li&&!mu(this.nextCodePoint)?(this._lastIntValue=0,this.advance(),!0):!1}eatControlEscape(){return this.eat(gm)?(this._lastIntValue=oV,!0):this.eat(mV)?(this._lastIntValue=NC,!0):this.eat(vV)?(this._lastIntValue=LC,!0):this.eat(xV)?(this._lastIntValue=iV,!0):this.eat(Xh)?(this._lastIntValue=sV,!0):!1}eatControlLetter(){const t=this.currentCodePoint;return HC(t)?(this.advance(),this._lastIntValue=t%32,!0):!1}eatRegExpUnicodeEscapeSequence(t=!1){const n=this.index,r=t||this._unicodeMode;if(this.eat(pu)){if(r&&this.eatRegExpUnicodeSurrogatePairEscape()||this.eatFixedHexDigits(4)||r&&this.eatRegExpUnicodeCodePointEscape())return!0;(this.strict||r)&&this.raise("Invalid unicode escape"),this.rewind(n)}return!1}eatRegExpUnicodeSurrogatePairEscape(){const t=this.index;if(this.eatFixedHexDigits(4)){const n=this._lastIntValue;if(Ff(n)&&this.eat(Ct)&&this.eat(pu)&&this.eatFixedHexDigits(4)){const r=this._lastIntValue;if(Vf(r))return this._lastIntValue=zf(n,r),!0}this.rewind(t)}return!1}eatRegExpUnicodeCodePointEscape(){const t=this.index;return this.eat(Fi)&&this.eatHexDigits()&&this.eat(Vi)&&IV(this._lastIntValue)?!0:(this.rewind(t),!1)}eatIdentityEscape(){const t=this.currentCodePoint;return this.isValidIdentityEscape(t)?(this._lastIntValue=t,this.advance(),!0):!1}isValidIdentityEscape(t){return t===-1?!1:this._unicodeMode?$x(t)||t===Wo:this.strict?!RC(t):this._nFlag?!(t===Rs||t===zx):t!==Rs}eatDecimalEscape(){this._lastIntValue=0;let t=this.currentCodePoint;if(t>=aV&&t<=Vu){do this._lastIntValue=10*this._lastIntValue+(t-li),this.advance();while((t=this.currentCodePoint)>=li&&t<=Vu);return!0}return!1}eatUnicodePropertyValueExpression(){const t=this.index;if(this.eatUnicodePropertyName()&&this.eat(na)){const n=this._lastStrValue;if(this.eatUnicodePropertyValue()){const r=this._lastStrValue;if(Fx(this.ecmaVersion,n,r))return{key:n,value:r||null};this.raise("Invalid property name")}}if(this.rewind(t),this.eatLoneUnicodePropertyNameOrValue()){const n=this._lastStrValue;if(Fx(this.ecmaVersion,"General_Category",n))return{key:"General_Category",value:n||null};if(nV(this.ecmaVersion,n))return{key:n,value:null};if(this._unicodeSetsMode&&rV(this.ecmaVersion,n))return{key:n,value:null,strings:!0};this.raise("Invalid property name")}return null}eatUnicodePropertyName(){for(this._lastStrValue="";qC(this.currentCodePoint);)this._lastStrValue+=String.fromCodePoint(this.currentCodePoint),this.advance();return this._lastStrValue!==""}eatUnicodePropertyValue(){for(this._lastStrValue="";GV(this.currentCodePoint);)this._lastStrValue+=String.fromCodePoint(this.currentCodePoint),this.advance();return this._lastStrValue!==""}eatLoneUnicodePropertyNameOrValue(){return this.eatUnicodePropertyValue()}eatHexEscapeSequence(){const t=this.index;if(this.eat(SV)){if(this.eatFixedHexDigits(2))return!0;(this._unicodeMode||this.strict)&&this.raise("Invalid escape"),this.rewind(t)}return!1}eatDecimalDigits(){const t=this.index;for(this._lastIntValue=0;mu(this.currentCodePoint);)this._lastIntValue=10*this._lastIntValue+Of(this.currentCodePoint),this.advance();return this.index!==t}eatHexDigits(){const t=this.index;for(this._lastIntValue=0;Bx(this.currentCodePoint);)this._lastIntValue=16*this._lastIntValue+Of(this.currentCodePoint),this.advance();return this.index!==t}eatLegacyOctalEscapeSequence(){if(this.eatOctalDigit()){const t=this._lastIntValue;if(this.eatOctalDigit()){const n=this._lastIntValue;t<=3&&this.eatOctalDigit()?this._lastIntValue=t*64+n*8+this._lastIntValue:this._lastIntValue=t*8+n}else this._lastIntValue=t;return!0}return!1}eatOctalDigit(){const t=this.currentCodePoint;return RV(t)?(this.advance(),this._lastIntValue=t-li,!0):(this._lastIntValue=0,!1)}eatFixedHexDigits(t){const n=this.index;this._lastIntValue=0;for(let r=0;r<t;++r){const s=this.currentCodePoint;if(!Bx(s))return this.rewind(n),!1;this._lastIntValue=16*this._lastIntValue+Of(s),this.advance()}return!0}eatModifiers(){let t=!1;for(;KV(this.currentCodePoint);)this.advance(),t=!0;return t}parseModifiers(t,n){const{ignoreCase:r,multiline:s,dotAll:a}=this.parseFlags(this._reader.source,t,n);return{ignoreCase:r,multiline:s,dotAll:a}}parseFlags(t,n,r){const s={global:!1,ignoreCase:!1,multiline:!1,unicode:!1,sticky:!1,dotAll:!1,hasIndices:!1,unicodeSets:!1},a=new Set;a.add(zC),a.add(ym),a.add(vm),this.ecmaVersion>=2015&&(a.add(pu),a.add(BC),this.ecmaVersion>=2018&&(a.add($u),this.ecmaVersion>=2022&&(a.add(Kh),this.ecmaVersion>=2024&&a.add(Xh))));for(let l=n;l<r;++l){const c=t.charCodeAt(l);if(a.has(c)){const d=UV[c];s[d]&&this.raise(`Duplicated flag '${t[l]}'`,{index:n}),s[d]=!0}else this.raise(`Invalid flag '${t[l]}'`,{index:n})}return s}}const YV={},QV={},JV={};function eu(e){return e.type==="Character"||e.type==="CharacterSet"||e.type==="CharacterClass"||e.type==="ExpressionCharacterClass"||e.type==="ClassStringDisjunction"}class ZV{constructor(t){var n;this._node=YV,this._expressionBufferMap=new Map,this._flags=QV,this._backreferences=[],this._capturingGroups=[],this.source="",this.strict=!!t?.strict,this.ecmaVersion=(n=t?.ecmaVersion)!==null&&n!==void 0?n:TC}get pattern(){if(this._node.type!=="Pattern")throw new Error("UnknownError");return this._node}get flags(){if(this._flags.type!=="Flags")throw new Error("UnknownError");return this._flags}onRegExpFlags(t,n,{global:r,ignoreCase:s,multiline:a,unicode:l,sticky:c,dotAll:d,hasIndices:h,unicodeSets:p}){this._flags={type:"Flags",parent:null,start:t,end:n,raw:this.source.slice(t,n),global:r,ignoreCase:s,multiline:a,unicode:l,sticky:c,dotAll:d,hasIndices:h,unicodeSets:p}}onPatternEnter(t){this._node={type:"Pattern",parent:null,start:t,end:t,raw:"",alternatives:[]},this._backreferences.length=0,this._capturingGroups.length=0}onPatternLeave(t,n){this._node.end=n,this._node.raw=this.source.slice(t,n);for(const r of this._backreferences){const s=r.ref,a=typeof s=="number"?[this._capturingGroups[s-1]]:this._capturingGroups.filter(l=>l.name===s);if(a.length===1){const l=a[0];r.ambiguous=!1,r.resolved=l}else r.ambiguous=!0,r.resolved=a;for(const l of a)l.references.push(r)}}onAlternativeEnter(t){const n=this._node;if(n.type!=="Assertion"&&n.type!=="CapturingGroup"&&n.type!=="Group"&&n.type!=="Pattern")throw new Error("UnknownError");this._node={type:"Alternative",parent:n,start:t,end:t,raw:"",elements:[]},n.alternatives.push(this._node)}onAlternativeLeave(t,n){const r=this._node;if(r.type!=="Alternative")throw new Error("UnknownError");r.end=n,r.raw=this.source.slice(t,n),this._node=r.parent}onGroupEnter(t){const n=this._node;if(n.type!=="Alternative")throw new Error("UnknownError");const r={type:"Group",parent:n,start:t,end:t,raw:"",modifiers:null,alternatives:[]};this._node=r,n.elements.push(this._node)}onGroupLeave(t,n){const r=this._node;if(r.type!=="Group"||r.parent.type!=="Alternative")throw new Error("UnknownError");r.end=n,r.raw=this.source.slice(t,n),this._node=r.parent}onModifiersEnter(t){const n=this._node;if(n.type!=="Group")throw new Error("UnknownError");this._node={type:"Modifiers",parent:n,start:t,end:t,raw:"",add:null,remove:null},n.modifiers=this._node}onModifiersLeave(t,n){const r=this._node;if(r.type!=="Modifiers"||r.parent.type!=="Group")throw new Error("UnknownError");r.end=n,r.raw=this.source.slice(t,n),this._node=r.parent}onAddModifiers(t,n,{ignoreCase:r,multiline:s,dotAll:a}){const l=this._node;if(l.type!=="Modifiers")throw new Error("UnknownError");l.add={type:"ModifierFlags",parent:l,start:t,end:n,raw:this.source.slice(t,n),ignoreCase:r,multiline:s,dotAll:a}}onRemoveModifiers(t,n,{ignoreCase:r,multiline:s,dotAll:a}){const l=this._node;if(l.type!=="Modifiers")throw new Error("UnknownError");l.remove={type:"ModifierFlags",parent:l,start:t,end:n,raw:this.source.slice(t,n),ignoreCase:r,multiline:s,dotAll:a}}onCapturingGroupEnter(t,n){const r=this._node;if(r.type!=="Alternative")throw new Error("UnknownError");this._node={type:"CapturingGroup",parent:r,start:t,end:t,raw:"",name:n,alternatives:[],references:[]},r.elements.push(this._node),this._capturingGroups.push(this._node)}onCapturingGroupLeave(t,n){const r=this._node;if(r.type!=="CapturingGroup"||r.parent.type!=="Alternative")throw new Error("UnknownError");r.end=n,r.raw=this.source.slice(t,n),this._node=r.parent}onQuantifier(t,n,r,s,a){const l=this._node;if(l.type!=="Alternative")throw new Error("UnknownError");const c=l.elements.pop();if(c==null||c.type==="Quantifier"||c.type==="Assertion"&&c.kind!=="lookahead")throw new Error("UnknownError");const d={type:"Quantifier",parent:l,start:c.start,end:n,raw:this.source.slice(c.start,n),min:r,max:s,greedy:a,element:c};l.elements.push(d),c.parent=d}onLookaroundAssertionEnter(t,n,r){const s=this._node;if(s.type!=="Alternative")throw new Error("UnknownError");const a=this._node={type:"Assertion",parent:s,start:t,end:t,raw:"",kind:n,negate:r,alternatives:[]};s.elements.push(a)}onLookaroundAssertionLeave(t,n){const r=this._node;if(r.type!=="Assertion"||r.parent.type!=="Alternative")throw new Error("UnknownError");r.end=n,r.raw=this.source.slice(t,n),this._node=r.parent}onEdgeAssertion(t,n,r){const s=this._node;if(s.type!=="Alternative")throw new Error("UnknownError");s.elements.push({type:"Assertion",parent:s,start:t,end:n,raw:this.source.slice(t,n),kind:r})}onWordBoundaryAssertion(t,n,r,s){const a=this._node;if(a.type!=="Alternative")throw new Error("UnknownError");a.elements.push({type:"Assertion",parent:a,start:t,end:n,raw:this.source.slice(t,n),kind:r,negate:s})}onAnyCharacterSet(t,n,r){const s=this._node;if(s.type!=="Alternative")throw new Error("UnknownError");s.elements.push({type:"CharacterSet",parent:s,start:t,end:n,raw:this.source.slice(t,n),kind:r})}onEscapeCharacterSet(t,n,r,s){const a=this._node;if(a.type!=="Alternative"&&a.type!=="CharacterClass")throw new Error("UnknownError");a.elements.push({type:"CharacterSet",parent:a,start:t,end:n,raw:this.source.slice(t,n),kind:r,negate:s})}onUnicodePropertyCharacterSet(t,n,r,s,a,l,c){const d=this._node;if(d.type!=="Alternative"&&d.type!=="CharacterClass")throw new Error("UnknownError");const h={type:"CharacterSet",parent:null,start:t,end:n,raw:this.source.slice(t,n),kind:r,strings:null,key:s};if(c){if(d.type==="CharacterClass"&&!d.unicodeSets||l||a!==null)throw new Error("UnknownError");d.elements.push(Object.assign(Object.assign({},h),{parent:d,strings:c,value:a,negate:l}))}else d.elements.push(Object.assign(Object.assign({},h),{parent:d,strings:c,value:a,negate:l}))}onCharacter(t,n,r){const s=this._node;if(s.type!=="Alternative"&&s.type!=="CharacterClass"&&s.type!=="StringAlternative")throw new Error("UnknownError");s.elements.push({type:"Character",parent:s,start:t,end:n,raw:this.source.slice(t,n),value:r})}onBackreference(t,n,r){const s=this._node;if(s.type!=="Alternative")throw new Error("UnknownError");const a={type:"Backreference",parent:s,start:t,end:n,raw:this.source.slice(t,n),ref:r,ambiguous:!1,resolved:JV};s.elements.push(a),this._backreferences.push(a)}onCharacterClassEnter(t,n,r){const s=this._node,a={type:"CharacterClass",parent:s,start:t,end:t,raw:"",unicodeSets:r,negate:n,elements:[]};if(s.type==="Alternative"){const l=Object.assign(Object.assign({},a),{parent:s});this._node=l,s.elements.push(l)}else if(s.type==="CharacterClass"&&s.unicodeSets&&r){const l=Object.assign(Object.assign({},a),{parent:s,unicodeSets:r});this._node=l,s.elements.push(l)}else throw new Error("UnknownError")}onCharacterClassLeave(t,n){const r=this._node;if(r.type!=="CharacterClass"||r.parent.type!=="Alternative"&&r.parent.type!=="CharacterClass")throw new Error("UnknownError");const s=r.parent;r.end=n,r.raw=this.source.slice(t,n),this._node=s;const a=this._expressionBufferMap.get(r);if(!a)return;if(r.elements.length>0)throw new Error("UnknownError");this._expressionBufferMap.delete(r);const l={type:"ExpressionCharacterClass",parent:s,start:r.start,end:r.end,raw:r.raw,negate:r.negate,expression:a};if(a.parent=l,r!==s.elements.pop())throw new Error("UnknownError");s.elements.push(l)}onCharacterClassRange(t,n){const r=this._node;if(r.type!=="CharacterClass")throw new Error("UnknownError");const s=r.elements,a=s.pop();if(!a||a.type!=="Character")throw new Error("UnknownError");if(!r.unicodeSets){const d=s.pop();if(!d||d.type!=="Character"||d.value!==En)throw new Error("UnknownError")}const l=s.pop();if(!l||l.type!=="Character")throw new Error("UnknownError");const c={type:"CharacterClassRange",parent:r,start:t,end:n,raw:this.source.slice(t,n),min:l,max:a};l.parent=c,a.parent=c,s.push(c)}onClassIntersection(t,n){var r;const s=this._node;if(s.type!=="CharacterClass"||!s.unicodeSets)throw new Error("UnknownError");const a=s.elements.pop(),l=(r=this._expressionBufferMap.get(s))!==null&&r!==void 0?r:s.elements.pop();if(!l||!a||l.type==="ClassSubtraction"||l.type!=="ClassIntersection"&&!eu(l)||!eu(a))throw new Error("UnknownError");const c={type:"ClassIntersection",parent:s,start:t,end:n,raw:this.source.slice(t,n),left:l,right:a};l.parent=c,a.parent=c,this._expressionBufferMap.set(s,c)}onClassSubtraction(t,n){var r;const s=this._node;if(s.type!=="CharacterClass"||!s.unicodeSets)throw new Error("UnknownError");const a=s.elements.pop(),l=(r=this._expressionBufferMap.get(s))!==null&&r!==void 0?r:s.elements.pop();if(!l||!a||l.type==="ClassIntersection"||l.type!=="ClassSubtraction"&&!eu(l)||!eu(a))throw new Error("UnknownError");const c={type:"ClassSubtraction",parent:s,start:t,end:n,raw:this.source.slice(t,n),left:l,right:a};l.parent=c,a.parent=c,this._expressionBufferMap.set(s,c)}onClassStringDisjunctionEnter(t){const n=this._node;if(n.type!=="CharacterClass"||!n.unicodeSets)throw new Error("UnknownError");this._node={type:"ClassStringDisjunction",parent:n,start:t,end:t,raw:"",alternatives:[]},n.elements.push(this._node)}onClassStringDisjunctionLeave(t,n){const r=this._node;if(r.type!=="ClassStringDisjunction"||r.parent.type!=="CharacterClass")throw new Error("UnknownError");r.end=n,r.raw=this.source.slice(t,n),this._node=r.parent}onStringAlternativeEnter(t){const n=this._node;if(n.type!=="ClassStringDisjunction")throw new Error("UnknownError");this._node={type:"StringAlternative",parent:n,start:t,end:t,raw:"",elements:[]},n.alternatives.push(this._node)}onStringAlternativeLeave(t,n){const r=this._node;if(r.type!=="StringAlternative")throw new Error("UnknownError");r.end=n,r.raw=this.source.slice(t,n),this._node=r.parent}}class ez{constructor(t){this._state=new ZV(t),this._validator=new XV(this._state)}parseLiteral(t,n=0,r=t.length){this._state.source=t,this._validator.validateLiteral(t,n,r);const s=this._state.pattern,a=this._state.flags,l={type:"RegExpLiteral",parent:null,start:n,end:r,raw:t,pattern:s,flags:a};return s.parent=l,a.parent=l,l}parseFlags(t,n=0,r=t.length){return this._state.source=t,this._validator.validateFlags(t,n,r),this._state.flags}parsePattern(t,n=0,r=t.length,s=void 0){return this._state.source=t,this._validator.validatePattern(t,n,r,s),this._state.pattern}}const Wx=256,Bf=256,qx=24,tz=64;class GC extends Error{}function nz(){return{remaining:1e5}}function Rr(e){if(--e.remaining<0)throw new GC("pattern validation work limit exceeded")}const Uo=new Map;function KC(e){const t=Uo.get(e);if(t!==void 0)return t;if(e.length>Wx)return`pattern exceeds ${Wx} characters`;if(!e.startsWith("^")||!e.endsWith("$"))return"pattern must be anchored with ^ and $";let n;try{const r=new ez({ecmaVersion:2024}).parsePattern(e,0,e.length,{unicode:!0}),s=new Map,a=(l,c)=>{if(c>qx)throw Error(`pattern depth exceeds ${qx}`);switch(l.type){case"Pattern":case"Group":case"CapturingGroup":if(l.type==="Group"&&l.modifiers)throw Error("pattern group modifiers are not supported");for(const d of l.alternatives)a(d,c+1);break;case"Alternative":for(const d of l.elements)a(d,c+1);break;case"Quantifier":if(l.min>Bf||Number.isFinite(l.max)&&l.max>Bf)throw Error(`pattern repetition must not exceed ${Bf}`);a(l.element,c+1);break;case"Assertion":if(l.kind==="lookbehind")throw Error("pattern lookbehind is not supported");if(l.kind==="lookahead")for(const d of l.alternatives)a(d,c+1);break;case"Character":case"CharacterSet":case"CharacterClass":s.set(l,new RegExp(`^(?:${l.raw})$`,"u"));break;default:throw Error(`pattern ${l.type} is not supported`)}};a(r,0),n={root:r,atoms:s}}catch(r){n=r instanceof SyntaxError?"pattern has invalid Unicode syntax":r.message}return Uo.size>=tz&&Uo.delete(Uo.keys().next().value),Uo.set(e,n),n}function rz(e){if(typeof e!="string")return"pattern must be a string";const t=KC(e);return typeof t=="string"?t:null}function iz(e,t,n){const r=KC(e);if(typeof r=="string")throw Error(r);const s=Array.from(t),a=(p,m)=>{Rr(n),p.add(m)},l=(p,m)=>{for(const y of m)a(p,y)},c=(p,m)=>{const y=new Set;for(const w of p)Rr(n),l(y,h(w,m));return y},d=(p,m)=>{const y=new Set;for(const w of m)Rr(n),l(y,h(p,w));return y},h=(p,m)=>{switch(Rr(n),p.type){case"Pattern":case"Group":case"CapturingGroup":return c(p.alternatives,m);case"Alternative":{let y=new Set([m]);for(const w of p.elements)if(Rr(n),y=d(w,y),!y.size)break;return y}case"Quantifier":{let y=new Set([m]);for(let k=0;k<p.min;k++)if(Rr(n),y=d(p.element,y),!y.size)return y;const w=new Set;l(w,y);for(let k=p.min;k<p.max&&y.size;k++){Rr(n);const b=d(p.element,y);if(p.max===1/0)for(const E of b)Rr(n),w.has(E)&&b.delete(E);l(w,b),y=b}return w}case"Assertion":{let y;if(p.kind==="start")y=m===0;else if(p.kind==="end")y=m===s.length;else if(p.kind==="word"){const w=k=>k!==void 0&&/^[a-zA-Z0-9_]$/.test(k);y=w(s[m-1])!==w(s[m])!==p.negate}else if(p.kind==="lookahead")y=c(p.alternatives,m).size>0!==p.negate;else throw Error("unsupported assertion");return new Set(y?[m]:[])}default:{const y=r.atoms.get(p);return new Set(m<s.length&&y.test(s[m])?[m+1]:[])}}};for(let p=0;p<=s.length;p++)if(Rr(n),h(r.root,p).size>0)return!0;return!1}const sz=new Set(["type","title","description","default","enum","const","minimum","maximum","minLength","maxLength","pattern","properties","required","items","minItems","maxItems","additionalProperties","anyOf","uniqueItems"]),Gx=6,Kx=64,Xx=12,Yx=2048,Qx=64*1024;function Vs(e,t=0,n={value:0}){if(t>Gx)return`Schema depth exceeds ${Gx}`;if(n.value++,n.value>Kx)return`Schema exceeds ${Kx} controls`;const r=Object.keys(e).find(a=>!sz.has(a));if(r)return`Unsupported JSON Schema keyword: ${r}`;if(e.title!==void 0&&typeof e.title!="string")return"title must be a string";if(e.description!==void 0&&typeof e.description!="string")return"description must be a string";if(e.enum!==void 0&&(!Array.isArray(e.enum)||e.enum.length===0))return"enum must be a non-empty array";const s=e.type;if(s===void 0&&e.enum===void 0&&!Object.hasOwn(e,"const")&&e.anyOf===void 0)return"An explicit type, enum, or const is required";if(e.anyOf!==void 0){if(!Array.isArray(e.anyOf)||e.anyOf.length===0)return"anyOf must be a non-empty array of schemas";for(let a=0;a<e.anyOf.length;a++){const l=e.anyOf[a];if(!l||typeof l!="object"||Array.isArray(l))return`anyOf[${a}] must be a schema object`;const c=Vs(l,t+1,n);if(c)return`anyOf[${a}]: ${c}`}}if(e.uniqueItems!==void 0){if(typeof e.uniqueItems!="boolean")return"uniqueItems must be boolean";if(s!=="array")return"uniqueItems requires array type"}if(s!==void 0&&(typeof s!="string"||!["object","array","string","number","integer","boolean","null"].includes(s)))return`Unsupported JSON Schema type: ${String(s)}`;for(const a of["minimum","maximum"])if(e[a]!==void 0&&(typeof e[a]!="number"||!Number.isFinite(e[a])))return`${a} must be a finite number`;for(const a of["minLength","maxLength","minItems","maxItems"])if(e[a]!==void 0&&(typeof e[a]!="number"||!Number.isInteger(e[a])||e[a]<0))return`${a} must be a non-negative integer`;if((e.minimum!==void 0||e.maximum!==void 0)&&s!=="number"&&s!=="integer")return"minimum/maximum require a numeric type";if((e.minLength!==void 0||e.maxLength!==void 0)&&s!=="string")return"minLength/maxLength require string type";if(e.pattern!==void 0){if(s!=="string")return"pattern requires a string type";const a=rz(e.pattern);if(a)return a}if((e.minItems!==void 0||e.maxItems!==void 0)&&s!=="array")return"minItems/maxItems require array type";if(e.additionalProperties!==void 0){if(s!=="object")return"additionalProperties requires an object type";if(e.additionalProperties===!0)return"additionalProperties: true is not supported";if(e.additionalProperties!==!1)return e.additionalProperties&&typeof e.additionalProperties=="object"&&!Array.isArray(e.additionalProperties)?"Schema-valued additionalProperties is not supported":"additionalProperties must be false"}if((e.properties!==void 0||e.required!==void 0)&&s!=="object")return"properties/required require object type";if(e.items!==void 0&&s!=="array")return"items requires array type";if(s==="object"){const a=e.properties;if(a!==void 0&&(!a||typeof a!="object"||Array.isArray(a)))return"properties must be an object";if(e.required!==void 0&&(!Array.isArray(e.required)||e.required.some(l=>typeof l!="string")))return"required must be an array of property names";for(const l of Object.values(a??{})){if(!l||typeof l!="object"||Array.isArray(l))return"property schema must be an object";const c=Vs(l,t+1,n);if(c)return c}}return s==="array"&&e.items!==void 0?!e.items||typeof e.items!="object"||Array.isArray(e.items)?"items must be one schema object":Vs(e.items,t+1,n):null}function Hu(e,t){if(e===t)return!0;if(e===null||t===null||typeof e!="object"||typeof t!="object")return!1;if(Array.isArray(e)||Array.isArray(t))return Array.isArray(e)&&Array.isArray(t)&&e.length===t.length&&e.every((s,a)=>Hu(s,t[a]));const n=Object.keys(e).sort(),r=Object.keys(t).sort();return n.length===r.length&&n.every((s,a)=>s===r[a]&&Hu(e[s],t[s]))}function oz(e,t){let n=0;const r=(a,l)=>{if(l>Xx)return`${t} exceeds depth ${Xx}`;if(n++,n>Yx)return`${t} exceeds ${Yx} JSON values`;if(a===null||typeof a!="object")return null;for(const c of Array.isArray(a)?a:Object.values(a)){const d=r(c,l+1);if(d)return d}return null},s=r(e,0);return s||(new TextEncoder().encode(JSON.stringify(e)).byteLength>Qx?`${t} exceeds ${Qx} UTF-8 bytes`:null)}function gu(e,t,n,r){if(Array.isArray(e.anyOf)&&!e.anyOf.some(s=>gu(s,t,n,r)===null))return`${n} must match at least one anyOf alternative`;if(Object.hasOwn(e,"const")&&!Hu(e.const,t))return`${n} must use the fixed value`;if(Array.isArray(e.enum)&&!e.enum.some(s=>Hu(s,t)))return`${n} is not an allowed value`;if(e.type==="null")return t===null?null:`${n} must be null`;if(e.type==="boolean")return typeof t=="boolean"?null:`${n} must be boolean`;if(e.type==="string")return typeof t!="string"?`${n} must be text`:typeof e.minLength=="number"&&Array.from(t).length<e.minLength?`${n} is too short`:typeof e.maxLength=="number"&&Array.from(t).length>e.maxLength?`${n} is too long`:e.pattern!==void 0&&!iz(e.pattern,t,r)?`${n} does not match the required format`:null;if(e.type==="number"||e.type==="integer")return typeof t!="number"||!Number.isFinite(t)?`${n} must be a finite number`:e.type==="integer"&&!Number.isInteger(t)?`${n} must be an integer`:typeof e.minimum=="number"&&t<e.minimum?`${n} is below the minimum`:typeof e.maximum=="number"&&t>e.maximum?`${n} is above the maximum`:null;if(e.type==="array"){if(!Array.isArray(t))return`${n} must be an array`;if(typeof e.minItems=="number"&&t.length<e.minItems)return`${n} has too few items`;if(typeof e.maxItems=="number"&&t.length>e.maxItems)return`${n} has too many items`;if(e.uniqueItems===!0){const s=new Set;for(const a of t){const l=Yh(a);if(s.has(l))return`${n} must contain unique items`;s.add(l)}}if(e.items&&typeof e.items=="object"&&!Array.isArray(e.items))for(let s=0;s<t.length;s++){const a=gu(e.items,t[s],`${n}[${s}]`,r);if(a)return a}return null}if(e.type==="object"){if(!t||typeof t!="object"||Array.isArray(t))return`${n} must be an object`;const s=e.properties??{};for(const l of Object.keys(t))if(e.additionalProperties===!1&&!Object.hasOwn(s,l))return`${n}.${l||"(empty key)"} is not declared by the schema`;const a=Array.isArray(e.required)?e.required:[];for(const l of a)if(!Object.hasOwn(t,l))return`${n}.${l||"(empty key)"} is required`;for(const[l,c]of Object.entries(s)){if(!Object.hasOwn(t,l))continue;const d=gu(c,t[l],`${n}.${l||"(empty key)"}`,r);if(d)return d}}return null}function Wu(e,t,n="Arguments"){const r=Vs(e);if(r)return`${n} cannot be validated safely: ${r}`;try{return oz(t,n)??gu(e,t,n,nz())}catch(s){if(s instanceof GC)return`${n} cannot be validated safely: ${s.message}`;throw s}}function Yh(e){return e===null||typeof e!="object"?JSON.stringify(e):Array.isArray(e)?`[${e.map(Yh).join(",")}]`:`{${Object.keys(e).sort().map(t=>`${JSON.stringify(t)}:${Yh(e[t])}`).join(",")}}`}function xm(e){if(e.type!==void 0)return e.type;if(Array.isArray(e.anyOf)&&e.anyOf.length){const t=e.anyOf.map(n=>xm(n));if(t.every(n=>n===t[0])&&["string","number","integer","boolean","null"].includes(String(t[0])))return t[0]}}function Gi(e){if(Object.hasOwn(e,"const"))return e.const;if(e.default!==void 0)return e.default;if(Array.isArray(e.enum)&&e.enum.length)return e.enum[0];if(Array.isArray(e.anyOf)&&e.anyOf.length&&!e.type)return Gi(e.anyOf[0]);if(e.type==="object"){const t=Object.create(null),n=new Set(Array.isArray(e.required)?e.required.filter(r=>typeof r=="string"):[]);for(const[r,s]of Object.entries(e.properties??{})){const a=s;(n.has(r)||a.default!==void 0)&&(t[r]=Gi(a))}return t}return e.type==="array"?[]:e.type==="boolean"?!1:e.type==="number"||e.type==="integer"?0:e.type==="null"?null:""}function Jx(e,t){return typeof e.title=="string"&&e.title?e.title:t||"(empty key)"}function Zx(e,t,n){const r=Object.create(null);for(const[s,a]of Object.entries(e))r[s]=a;return r[t]=n,r}function az(e,t){const n=Object.create(null);for(const[r,s]of Object.entries(e))r!==t&&(n[r]=s);return n}function ew(e){const{schema:t,label:n,path:r,value:s,required:a,description:l,arrayOnly:c,onChange:d,onValidityChange:h}=e,p=S.useId().replace(/[^a-zA-Z0-9_-]/g,""),y=`command-json-${r.replace(/[^a-zA-Z0-9_-]+/g,"-").replace(/^-|-$/g,"")||"root"}-${p}-help`,[w,k]=S.useState(()=>JSON.stringify(s,null,2)),[b,E]=S.useState(null),P=S.useRef(JSON.stringify(s));S.useEffect(()=>{const _=JSON.stringify(s);_!==P.current&&(P.current=_,k(JSON.stringify(s,null,2)),E(null),h(r,null))},[h,r,s]),S.useEffect(()=>()=>h(r,null),[h,r]);const R=_=>{k(_);let j;try{j=JSON.parse(_)}catch{const N=`${n} must contain valid JSON`;E(N),h(r,N);return}if(c&&!Array.isArray(j)){const N=`${n} must be a JSON array`;E(N),h(r,N);return}const A=Wu(t,j,n);E(A),h(r,A),P.current=JSON.stringify(j),d(j)};return v.jsxs("label",{className:"command-field",children:[v.jsxs("span",{children:[n,a?" *":""]}),v.jsx("textarea",{value:w,rows:3,"aria-describedby":y,"aria-invalid":b?"true":void 0,onChange:_=>R(_.target.value)}),v.jsx("small",{id:y,children:l??(c?"JSON array":"JSON value matching any allowed alternative")}),b&&v.jsx("span",{className:"command-field-error",role:"alert",children:b})]})}function lz(e){const{schema:t,label:n,path:r,value:s,required:a,description:l,numeric:c,onChange:d,onValidityChange:h}=e,p=Wu(t,s,n);return S.useEffect(()=>(h(r,p),()=>h(r,null)),[p,h,r]),v.jsxs("label",{className:"command-field",children:[v.jsxs("span",{children:[n,a?" *":""]}),v.jsx("input",{type:c?"number":"text",value:String(s??""),min:typeof t.minimum=="number"?t.minimum:void 0,max:typeof t.maximum=="number"?t.maximum:void 0,step:xm(t)==="integer"?1:c?"any":void 0,required:a,"aria-invalid":p?"true":void 0,onChange:m=>d(c?Number(m.target.value):m.target.value)}),l&&v.jsx("small",{children:l}),p&&v.jsx("span",{className:"command-field-error",role:"alert",children:p})]})}function XC(e){const{schema:t,name:n,path:r,value:s,required:a,onChange:l,onValidityChange:c}=e,d=Jx(t,n),h=typeof t.description=="string"?t.description:void 0;if(Object.hasOwn(t,"const"))return v.jsxs("div",{className:"command-field",children:[v.jsxs("span",{children:[d,a?" *":""]}),v.jsxs("small",{children:["Fixed value: ",JSON.stringify(t.const)]})]});if(Array.isArray(t.enum))return v.jsxs("label",{className:"command-field",children:[v.jsxs("span",{children:[d,a?" *":""]}),v.jsx("select",{value:JSON.stringify(s),onChange:y=>l(JSON.parse(y.target.value)),children:t.enum.map((y,w)=>v.jsx("option",{value:JSON.stringify(y),children:String(y)},w))}),h&&v.jsx("small",{children:h})]});const p=xm(t);if(t.anyOf&&(p===void 0||p==="object"||p==="array"))return v.jsx(ew,{schema:t,label:d,path:r,value:s,required:a,description:h,onChange:l,onValidityChange:c});if(p==="object"){const y=s&&typeof s=="object"&&!Array.isArray(s)?s:{},w=new Set(Array.isArray(t.required)?t.required.filter(k=>typeof k=="string"):[]);return v.jsxs("fieldset",{className:"command-object",children:[v.jsx("legend",{children:d}),h&&v.jsx("p",{children:h}),Object.entries(t.properties??{}).map(([k,b])=>{const E=b,P=Object.hasOwn(y,k),R=Jx(E,k),_=`${r}.${k||"(empty key)"}`;return!P&&!w.has(k)?v.jsxs("button",{type:"button",className:"linkbtn command-property-add",onClick:()=>l(Zx(y,k,Gi(E))),children:["Add ",R]},k):v.jsxs("div",{className:"command-property",children:[v.jsx(XC,{schema:E,name:k,path:_,value:P?y[k]:Gi(E),required:w.has(k),onValidityChange:c,onChange:j=>l(Zx(y,k,j))}),!w.has(k)&&v.jsx("button",{type:"button",className:"linkbtn command-property-remove","aria-label":`Remove ${R}`,onClick:()=>l(az(y,k)),children:"Remove"})]},k)})]})}if(p==="array")return v.jsx(ew,{arrayOnly:!0,schema:t,label:d,path:r,value:s,required:a,description:h,onChange:l,onValidityChange:c});if(p==="boolean")return v.jsxs("label",{className:"command-check",children:[v.jsx("input",{type:"checkbox",checked:s===!0,onChange:y=>l(y.target.checked)})," ",d]});if(p==="null")return v.jsxs("div",{className:"command-field",children:[v.jsx("span",{children:d}),v.jsx("small",{children:"Null value"})]});const m=p==="number"||p==="integer";return v.jsx(lz,{schema:t,label:d,path:r,value:s,required:a,description:h,numeric:m,onChange:l,onValidityChange:c})}function uz(e){const t=e.catalog.commands.find(_=>_.name===e.initialCommandName)??e.catalog.commands[0],[n,r]=S.useState(t?.name??""),s=e.catalog.commands.find(_=>_.name===n)??t,a=S.useMemo(()=>s?Vs(s.input_schema):null,[s]),[l,c]=S.useState(()=>t&&!a?Gi(t.input_schema):null),[d,h]=S.useState(""),[p,m]=S.useState("idle"),[y,w]=S.useState({}),k=S.useRef(0),b=S.useCallback((_,j)=>{w(A=>{if(j===null){if(!Object.hasOwn(A,_))return A;const N={...A};return delete N[_],N}return A[_]===j?A:{...A,[_]:j}})},[]),E=_=>{const j=e.catalog.commands.find(A=>A.name===_);r(_),c(j&&!Vs(j.input_schema)?Gi(j.input_schema):null),h(""),m("idle"),w({})},P=_=>{if(_.preventDefault(),!s||a||e.busy)return;const A=Object.values(y)[0]??Wu(s.input_schema,l);if(A){h(`Validation denied: ${A}`),m("error");return}const N=++k.current,q=s,B=l;c(Gi(q.input_schema)),w({}),h(`Sending ${q.name}…`),m("pending"),e.onSend(q,B,crypto.randomUUID(),e.catalog.fingerprint).then(D=>{k.current===N&&(D.status==="failed"?(h(`${q.name} was refused before delivery.`),m("error")):D.status==="pending"?(h(`${q.name} delivery is pending.`),m("warning")):D.status==="indeterminate"||!D.wire_id?(h(`${q.name} delivery could not be confirmed.`),m("indeterminate")):(h(`${q.name} sent. Its result will appear in the conversation.`),m("success")))}).catch(()=>{k.current===N&&(h(`${q.name} could not be sent. You can try it again.`),m("error"))})},R=s&&!a?Wu(s.input_schema,l):null;return v.jsxs("form",{noValidate:!0,className:"command-panel","aria-label":"Send a typed command",onSubmit:P,onKeyDown:_=>{_.key==="Escape"&&e.onClose()},children:[v.jsxs("div",{className:"command-panel-head",children:[v.jsxs("div",{className:"command-panel-recipient",children:[v.jsxs("strong",{children:["Commands for ",e.recipientName]}),v.jsxs("span",{className:"mono",title:e.catalog.recipient_cid,children:[e.catalog.recipient_cid.slice(0,12),"…"]})]}),v.jsx("button",{type:"button",className:"linkbtn",onClick:e.onRefresh,children:"Refresh"}),v.jsx("button",{type:"button",className:"icon-btn","aria-label":"Close commands",onClick:e.onClose,children:"×"})]}),e.catalog.commands.length===0?v.jsx("p",{role:"status",children:"This recipient does not advertise commands."}):v.jsxs(v.Fragment,{children:[v.jsxs("label",{className:"command-field",children:[v.jsx("span",{children:"Command"}),v.jsx("select",{autoFocus:!0,value:n,onChange:_=>E(_.target.value),children:e.catalog.commands.map(_=>v.jsx("option",{value:_.name,children:_.name},_.name))})]}),s?.description&&v.jsx("p",{children:s.description}),a?v.jsxs("div",{className:"banner error",role:"alert",children:["Cannot render this command safely: ",a]}):s&&v.jsx(XC,{schema:s.input_schema,name:"Arguments",path:"Arguments",value:l,onChange:c,onValidityChange:b},s.name),R?.includes("cannot be validated safely")&&!Object.values(y).some(_=>_.includes("cannot be validated safely"))&&v.jsx("div",{className:"banner error",role:"alert",children:R}),s&&v.jsx("button",{className:"btn primary",disabled:!!a||e.busy||!!R||Object.keys(y).length>0,children:"Send command"}),v.jsx("div",{className:`command-status ${p}`,"data-state":p,role:"status","aria-live":"polite",children:d})]})]})}const qo={type:"spring",stiffness:430,damping:38,mass:.72},tw=10,YC=56,cz=18,dz=650;function fz(e,t){return Math.abs(e)<tw&&Math.abs(t)<tw?"pending":Math.abs(e)>Math.abs(t)&&e>0?"drag":"reject"}function hz(e){const t=e.at(-1),n=t?e.slice(0,-1).reverse().find(r=>r.x!==t.x&&t.time-r.time<=100):void 0;return n&&t&&t.time>n.time?(t.x-n.x)/(t.time-n.time)*1e3:0}function pz(e,t){const n=hz(t);return n>=0&&(e>=YC||e>=cz&&n>=dz)}const Qh="ours.chats.listMode",ia="recent";function QC(){try{return globalThis.localStorage}catch{return}}function mz(e=QC()){try{return e?.getItem(Qh)==="identity"?"identity":ia}catch{return ia}}function gz(e,t=QC()){const n=e==="identity"?"identity":ia;try{return t?.setItem(Qh,n),t?.getItem(Qh)===n?n:ia}catch{return ia}}function ga(e){return typeof e=="string"?e:""}function qu(e,t){const n=ga(e),r=ga(t),s=n.normalize().toLowerCase(),a=r.normalize().toLowerCase();return s<a?-1:s>a?1:n<r?-1:n>r?1:0}function yz(e,t){const n=Ru(ga(t.activityAt))-Ru(ga(e.activityAt));if(n!==0)return n;const r=qu(e.name,t.name);return r!==0?r:qu(e.id,t.id)}function Jh(e){return[...e].sort(yz)}function nw(e){return e.contacts.length>0?Ru(ga(e.contacts[0].activityAt)):0}function vz(e,t){const n=new Map,r=[];for(const a of e){const l=a.root||(t?.[a.id]?a.id:null);if(!l){r.push(a);continue}const c=t?.[l]||{label:l,note:""};let d=n.get(l);d||(d={id:`root:${l}`,rootId:l,label:c.label,note:c.note,contacts:[]},n.set(l,d)),d.contacts.push(a)}const s=[...n.values()].map(a=>({...a,contacts:Jh(a.contacts)}));return r.length>0&&s.push({id:"rootless",rootId:null,label:"Independent identities",note:"People, agents and apps without a verified Human/root group",contacts:Jh(r)}),s.sort((a,l)=>{const c=nw(l)-nw(a);if(c!==0)return c;const d=qu(a.label,l.label);return d!==0?d:qu(a.id,l.id)})}const xz=15e3;function Uf(e){const{c:t,active:n,grouped:r}=e,[s,a]=S.useState(!1),l=async(h,p)=>{if(!(!h||s)){a(!0);try{const m=await h();requestAnimationFrame(()=>{m?document.getElementById("chat-list-title")?.focus():p.focus()})}finally{a(!1)}}},c=v.jsxs(v.Fragment,{children:[v.jsx("span",{className:"contact-avatar","aria-hidden":!0,children:t.initials}),v.jsxs("span",{className:"contact-copy",children:[v.jsxs("span",{className:"contact-row-topline",children:[v.jsx("span",{className:"contact-name",children:t.name}),t.when&&v.jsx("span",{className:"contact-time",children:t.when})]}),v.jsxs("span",{className:"contact-row-bottomline",children:[v.jsx("span",{className:"contact-last",children:t.last}),t.status==="pending"&&v.jsx("span",{className:"chip",children:"pending approval"}),!!t.unread&&v.jsx("span",{className:"contact-unread",children:t.unread})]})]}),t.status==="pending"&&v.jsxs("span",{className:"pending-actions",role:"group","aria-label":`Decide whether to accept ${t.name}`,children:[v.jsx("button",{type:"button",className:"linkbtn",disabled:s,onClick:h=>void l(e.onApprove,h.currentTarget),children:"Approve"}),v.jsx("button",{type:"button",className:"linkbtn quiet",disabled:s,onClick:h=>void l(e.onReject,h.currentTarget),children:"Reject"})]}),n&&v.jsx(Ds.span,{className:"contact-active-glow",layoutId:"active-contact",transition:qo})]}),d="contact-row"+(n?" active":"")+(r?" grouped":"")+(t.status==="pending"?" pending":"");return t.status==="pending"?v.jsx("div",{className:d,children:c}):v.jsx(Ds.button,{type:"button",className:d,onClick:e.onClick,children:c})}function wz(e){const{contacts:t,roots:n,selected:r}=e,[s,a]=S.useState(""),l=S.useRef(null),c=S.useRef(null),[d,h]=S.useState(()=>mz()),p=D=>D.name.toLowerCase().includes(s.toLowerCase()),m=t.filter(D=>D.status!=="pending"&&p(D)),y=t.filter(D=>D.status==="pending"&&p(D)),w=Jh(m),k=vz(m,n),b=m.length===0&&y.length===0,E=D=>{h(gz(D))},P=[{id:"recent",label:"Recent"},{id:"identity",label:"By identity"}],R=S.useRef(null),_=S.useRef({id:-1,x0:0,y0:0,mode:"idle"}),j=S.useRef(!1),A=(D,I)=>{const U=_.current;if(U.id!==D)return;const z=R.current;if(I&&U.mode==="drag"&&z){const he=parseFloat(z.style.getPropertyValue("--mode-drag-x"))||0,J=Math.max(0,(z.clientWidth-8)/2);E(he>=J/2?"identity":"recent"),j.current=!0,window.setTimeout(()=>{j.current=!1},0)}_.current={id:-1,x0:0,y0:0,mode:"idle"},z?.hasPointerCapture?.(D)&&z.releasePointerCapture(D),z?.classList.remove("dragging"),z?.style.removeProperty("--mode-drag-x")},N=D=>{!D.isPrimary||_.current.id!==-1||(_.current={id:D.pointerId,x0:D.clientX,y0:D.clientY,mode:"pending"})},q=D=>{const I=_.current;if(I.id!==D.pointerId||I.mode==="idle")return;const U=D.clientX-I.x0,z=D.clientY-I.y0;if(I.mode==="pending"){if(Math.abs(U)<10&&Math.abs(z)<10)return;if(Math.abs(z)>Math.abs(U)){A(D.pointerId,!1);return}I.mode="drag",D.currentTarget.setPointerCapture?.(D.pointerId),D.currentTarget.classList.add("dragging")}D.preventDefault();const he=Math.max(0,(D.currentTarget.clientWidth-8)/2),J=d==="identity"?he:0;D.currentTarget.style.setProperty("--mode-drag-x",`${Math.min(he,Math.max(0,J+U))}px`)},B=(D,I)=>{if(!["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Home","End"].includes(D.key))return;D.preventDefault();const z=D.key==="Home"?"recent":D.key==="End"||I==="recent"?"identity":"recent";E(z),document.getElementById(`conversation-list-${z}`)?.focus()};return S.useLayoutEffect(()=>{const D=l.current,I=c.current;if(!D||!I)return;const U=()=>D.style.setProperty("--list-bottom-chrome-height",`${I.getBoundingClientRect().height}px`);U();const z=new ResizeObserver(U);return z.observe(I),()=>{z.disconnect(),D.style.removeProperty("--list-bottom-chrome-height")}},[]),v.jsxs("div",{className:"listcol",ref:l,children:[v.jsxs("div",{className:"listcol-head",children:[v.jsxs("div",{className:"listcol-titlebar",children:[v.jsxs("h2",{id:"chat-list-title",className:"listcol-title messenger-lockup",tabIndex:-1,children:[v.jsx("span",{className:"messenger-brand-ours",children:"Ours"}),v.jsx("span",{className:"messenger-brand-product",children:"messenger"})]}),v.jsxs("div",{className:"listcol-actions",children:[v.jsx("button",{className:"btn icon-btn desktop-invite","aria-label":"Invite",title:"Invite",onClick:e.onInvite,children:v.jsx(Ce,{name:"invite",size:18})}),v.jsx("button",{className:"icon-btn","aria-label":"Settings",title:"Settings",onClick:e.onSettings,children:v.jsx(Ce,{name:"settings",size:18})})]})]}),v.jsx("div",{ref:R,className:"conversation-list-modes",role:"tablist","aria-label":"Conversation list layout","data-mode":d,onPointerDown:N,onPointerMove:q,onPointerUp:D=>A(D.pointerId,!0),onPointerCancel:D=>A(D.pointerId,!1),onLostPointerCapture:D=>A(D.pointerId,!1),children:P.map(D=>v.jsx("button",{id:`conversation-list-${D.id}`,type:"button",role:"tab","aria-selected":d===D.id,"aria-controls":"conversation-list-panel",tabIndex:d===D.id?0:-1,className:d===D.id?"active":"",onClick:I=>{if(j.current){I.preventDefault();return}E(D.id)},onKeyDown:I=>B(I,D.id),children:D.label},D.id))})]}),v.jsxs("div",{id:"conversation-list-panel",className:"listcol-scroll",role:"tabpanel","aria-labelledby":`conversation-list-${d}`,children:[d==="recent"&&w.length>0&&v.jsx("div",{className:"conversation-group",children:w.map(D=>v.jsx(Uf,{c:D,active:r===D.id,onClick:()=>e.onSelect(D.id)},D.id))}),d==="identity"&&k.map(D=>v.jsxs("div",{children:[v.jsxs("div",{className:"group-label",title:D.note,children:[D.rootId&&v.jsx(Ce,{name:"clusters"}),v.jsx("span",{children:D.label}),D.note&&v.jsxs("span",{className:"gl-note",children:["· ",D.note]})]}),v.jsx("div",{className:"conversation-group",children:D.contacts.map(I=>v.jsx(Uf,{c:I,grouped:D.rootId!==null,active:r===I.id,onClick:()=>e.onSelect(I.id)},I.id))})]},D.id)),y.length>0&&v.jsxs("div",{children:[v.jsx("div",{className:"group-label",children:v.jsx("span",{children:"Pending"})}),v.jsx("div",{className:"conversation-group",children:y.map(D=>v.jsx(Uf,{c:D,active:!1,onClick:()=>{},onApprove:()=>e.onApprovePending(D.id.slice(8)),onReject:()=>e.onRejectPending(D.id.slice(8))},D.id))})]}),b&&v.jsx("p",{className:"muted",style:{padding:"14px 10px",fontSize:"0.85rem"},children:"No contacts yet — share an invite to start."})]}),v.jsxs("div",{className:"list-bottom-chrome",ref:c,children:[v.jsxs("div",{className:"search adaptive-search",role:"search",children:[v.jsx("span",{className:"adaptive-search-icon","aria-hidden":!0,children:v.jsx(Ce,{name:"search"})}),v.jsx("input",{className:"field",placeholder:"Search people, agents, apps…",value:s,onChange:D=>a(D.target.value),onKeyDown:D=>{D.key==="Escape"&&(D.preventDefault(),a(""))}})]}),v.jsx("button",{type:"button",className:"icon-btn list-bottom-invite","aria-label":"Invite",title:"Invite",onClick:e.onInvite,children:v.jsx(Ce,{name:"invite",size:20})})]})]})}function Sz(e){const[t,n]=S.useState(!1),[r,s]=S.useState(e.contact.name),[a,l]=S.useState(!1),[c,d]=S.useState(null),h=S.useRef(!1);S.useEffect(()=>{const m=y=>{y.key!=="Escape"||a||c||t||(y.preventDefault(),e.onBack())};return document.addEventListener("keydown",m),()=>document.removeEventListener("keydown",m)},[t,c,e.onBack,a]);const p=()=>{if(h.current)return;h.current=!0;const m=r.trim();m&&m!==e.contact.name?e.onRename(m):s(e.contact.name),n(!1)};return v.jsxs("div",{className:"detail contact-screen",children:[v.jsxs("div",{className:"detail-head contact-screen-head",children:[v.jsx("button",{type:"button",className:"icon-btn detail-back contact-back","aria-label":"Back to conversation",onClick:e.onBack,children:v.jsx(Ce,{name:"back"})}),v.jsx("strong",{children:"Contact"})]}),v.jsxs("div",{className:"contact-screen-scroll",children:[v.jsxs("section",{className:"contact-hero","aria-labelledby":"contact-screen-name",children:[v.jsx("div",{className:"avatar accent contact-avatar-large","aria-hidden":!0,children:e.contact.initials}),t?v.jsx("input",{id:"contact-screen-name",className:"field contact-name-input",value:r,autoFocus:!0,onChange:m=>s(m.target.value),onBlur:p,onKeyDown:m=>{m.key==="Enter"&&p(),m.key==="Escape"&&(h.current=!0,s(e.contact.name),n(!1))}}):v.jsx("h2",{id:"contact-screen-name",children:e.contact.name}),v.jsxs("p",{children:[v.jsx(Ce,{name:"lock",size:13})," End-to-end encrypted connection"]})]}),v.jsxs("section",{className:"contact-action-group","aria-label":"Contact actions",children:[v.jsxs("button",{type:"button",onClick:()=>l(!0),children:[v.jsxs("span",{children:[v.jsx(Ce,{name:"paperclip"}),"Shared photos, files, and links"]}),v.jsx(Ce,{name:"chevron"})]}),v.jsxs("button",{type:"button",onClick:()=>{h.current=!1,s(e.contact.name),n(!0)},children:[v.jsxs("span",{children:[v.jsx(Ce,{name:"edit"}),"Rename contact"]}),v.jsx(Ce,{name:"chevron"})]})]}),v.jsxs("section",{className:"contact-identity","aria-labelledby":"contact-identity-title",children:[v.jsx("h3",{id:"contact-identity-title",children:"Verified identity"}),e.contact.roleId&&v.jsxs("p",{children:["Role ",v.jsx("strong",{children:e.contact.roleId})," of ",v.jsx("strong",{children:e.contact.rootName})]}),v.jsx("code",{children:e.contact.id}),v.jsxs("button",{type:"button",className:"btn sm",onClick:()=>void navigator.clipboard.writeText(e.contact.id),children:[v.jsx(Ce,{name:"copy",size:14}),"Copy identity"]})]}),v.jsxs("button",{type:"button",className:"contact-remove",onClick:e.onRemove,children:[v.jsx(Ce,{name:"trash"}),"Remove contact"]})]}),a&&v.jsx(R4,{messages:e.messages,indexOffset:e.indexOffset,onClose:()=>l(!1),onJump:e.onOpenMessage,onPreview:m=>{l(!1),d(m)}}),c&&(ba(c.filename,c.mime)?v.jsx(CC,{rec:c,onClose:()=>d(null)}):v.jsx(kC,{rec:c,onClose:()=>d(null),onSendText:e.onSendText,onSendFile:e.onSendFile}))]})}const yu=e=>`chat-message-${encodeURIComponent(e)}`,JC=()=>typeof window.matchMedia=="function"&&window.matchMedia("(prefers-reduced-motion: reduce)").matches;function $f(e){const{dir:t,canReply:n,onReply:r}=e,s=S.useRef(null),a=S.useRef(null),l=S.useRef(null),c=S.useRef(r);c.current=r;const d=t==="in"?1:-1,h=YC,p=84,m=()=>({id:-1,x0:0,y0:0,mode:"idle",armed:!1,distance:0,samples:[]}),y=S.useRef(m()),w=R=>{const _=a.current,j=l.current,A=JC();if(_&&(_.style.transform=R&&!A?`translateX(${R}px)`:""),j){const N=Math.min(1,Math.abs(R)/h);j.style.opacity=String(N),j.style.transform=A?"scale(1)":`scale(${.5+.5*N})`}},k=(R,_)=>{const j=y.current;if(j.id!==R)return;const A=_&&j.mode==="drag"&&pz(j.distance,j.samples);y.current=m(),a.current?.classList.remove("swiping"),l.current?.classList.remove("armed"),w(0);const N=s.current;N?.hasPointerCapture?.(R)&&N.releasePointerCapture(R),A&&c.current()};S.useEffect(()=>{const R=s.current;if(!R)return;const _=j=>k(j.pointerId,!1);return R.addEventListener("lostpointercapture",_),()=>{R.removeEventListener("lostpointercapture",_);const j=y.current.id;j!==-1&&k(j,!1)}},[]);const b=R=>{const _=R.target,j=window.getSelection?.();!n||!R.isPrimary||R.pointerType==="mouse"||R.pointerType==="pen"&&R.button!==0||y.current.id!==-1||j&&!j.isCollapsed||_.closest('a, button, input, textarea, select, [role="button"], audio, video, img, [draggable="true"], .filecard, .filecard-bubble, .image-bubble, .voice-bubble, .ours-message-file, .attachment')||(y.current={id:R.pointerId,x0:R.clientX,y0:R.clientY,mode:"maybe",armed:!1,distance:0,samples:[{x:R.clientX*d,time:R.timeStamp}]},w(0))},E=R=>{const _=y.current;if(_.id!==R.pointerId||_.mode==="idle")return;const j=R.clientX-_.x0,A=R.clientY-_.y0,N=window.getSelection?.();if(N&&!N.isCollapsed){k(R.pointerId,!1);return}if(_.mode==="maybe"){const U=fz(j*d,A);if(U==="pending")return;if(U==="drag")_.mode="drag",R.currentTarget.setPointerCapture?.(R.pointerId),a.current?.classList.add("swiping");else{_.mode="idle";return}}R.preventDefault();const q=R.timeStamp;_.samples.push({x:R.clientX*d,time:q}),_.samples=_.samples.filter(U=>q-U.time<=120);let B=j*d;B<0&&(B=0),B>h&&(B=h+(B-h)*.35),B=Math.min(B,p),_.distance=B;const D=B*d,I=Math.abs(D)>=h;I!==_.armed&&(_.armed=I,l.current?.classList.toggle("armed",I),I&&navigator.vibrate?.(10)),w(D)},P=R=>{const _=y.current;_.id===R.pointerId&&_.mode==="drag"&&(_.samples.push({x:R.clientX*d,time:R.timeStamp}),_.distance=Math.max(0,(R.clientX-_.x0)*d),_.armed=_.distance>=h),k(R.pointerId,!0)};return v.jsxs("div",{ref:s,className:"msg-row "+(e.rowClass??t),style:n?{touchAction:"pan-y"}:void 0,onPointerDown:b,onPointerMove:E,onPointerUp:P,onPointerCancel:R=>k(R.pointerId,!1),onLostPointerCapture:R=>k(R.pointerId,!1),children:[n&&v.jsx("span",{className:"swipe-cue",ref:l,"aria-hidden":!0,children:v.jsx(Ce,{name:"reply",size:16})}),v.jsx("div",{className:"bubble-wrap",ref:a,children:e.children}),e.after]})}const kz=S.memo(function(t){const{messages:n,optimisticSend:r,sentKeys:s,hiddenEarlier:a,unreadWireId:l,roomLines:c,contactCid:d,contactName:h,onStartReply:p,onRevealMessage:m,onPreview:y,onFetchFile:w}=t,k=new Map;for(const A of n)A.wireId&&k.set(A.wireId,A);const b=A=>c.get(A)??null,E=A=>{if(A.dir==="out")return"You";const N=b(A);return N&&N.variant==="chat"?N.author:h},P=A=>{if(A.kind==="file")return A.mime?.startsWith("image/")?"Photo":Us(A.mime??"",A.filename??"")?"Voice message":A.filename||"File";const N=b(A);return N?N.text||SI(N):A.text},R=A=>{if(!A.replyTo)return null;const N=k.get(A.replyTo.wireId);return N?{author:E(N),text:P(N)}:{author:"",text:"Original message"}},_=A=>{A.wireId&&p({wireId:A.wireId,author:E(A),text:P(A)})},j=A=>{if(!A)return null;const N=b(A);return N?N.variant==="system"?"room:system":`room:chat:${N.author}${N.role}`:A.dir};return v.jsx(UT,{initial:!1,children:n.map((A,N)=>{const q=A===r?.message?r.key:A.wireId&&s.get(A.wireId)||A.wireId||`${A.date}-${a+N}`,B=yu(A.wireId||q),D=n[N-1],I=n[N+1],U=b(A),z=j(A),he=!!D&&j(D)===z&&z!=="room:system",J=!!I&&j(I)===z&&z!=="room:system",Z=(A.dir==="out"?"out":"in")+(he?" cont-top":"")+(J?" cont-bot":""),ve=A.wireId?v.jsx("button",{className:"msg-reply",title:"Reply",onClick:()=>_(A),children:v.jsx(Ce,{name:"reply",size:15})}):null,Se=R(A),Q=Se&&A.replyTo?v.jsxs("button",{type:"button",className:"quote","aria-label":`Show original message${Se.author?` from ${Se.author}`:""}`,onClick:()=>m(A.replyTo.wireId),children:[Se.author&&v.jsx("span",{className:"quote-author",children:Se.author}),v.jsx("span",{className:"quote-text",children:Se.text})]}):null,pe=A.wireId===l?v.jsx("div",{id:`unread-${B}`,className:"unread-divider",role:"separator",children:v.jsx("span",{children:"Unread messages"})}):null;if(U&&U.variant==="system"){const T=U.presentation??"system";return v.jsxs(Ds.div,{className:"message-motion",id:B,initial:{opacity:0,y:8},animate:{opacity:1,y:0},exit:{opacity:0},transition:qo,children:[pe,v.jsxs("div",{className:`room-system room-${T}-card`,role:"note",children:[Q,U.label&&v.jsx("span",{className:"room-system-label",children:U.label}),U.roomName&&v.jsx("strong",{className:"room-card-name",children:U.roomName}),v.jsx(Ox,{text:U.text,className:"room-system-text message-markdown"}),!!U.details?.length&&v.jsx("ul",{className:"room-card-details","aria-label":"Room event details",children:U.details.map(F=>v.jsx("li",{children:F},F))}),v.jsxs("span",{className:"room-card-provenance",children:[U.authoredBy&&v.jsx("span",{className:"room-card-author",children:U.authoredBy}),v.jsx("span",{className:"room-system-at",children:Wi(A.date)})]})]})]},q)}if(A.kind==="file"){const T=rS(A.wireId)??{id:A.wireId,dir:A.dir,filename:A.filename??"file",mime:A.mime??"application/octet-stream",size:0,date:A.date};return v.jsxs(Ds.div,{className:"message-motion",id:B,initial:{opacity:0,y:12,scale:.985},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,scale:.98},transition:qo,children:[pe,v.jsx($f,{dir:A.dir==="out"?"out":"in",rowClass:Z,canReply:!!A.wireId,onReply:()=>_(A),after:ve,children:v.jsxs("div",{className:`ours-message ours-message-file ours-message--${A.dir}`,children:[Q,v.jsx(wD,{rec:T,receipt:A.receipt,receiptless:A.receiptless,onPreview:y,onFetch:w})]})})]},q)}if(A.typed){const T=A.typed.kind==="command_result"&&A.replyTo?k.get(A.replyTo.wireId):void 0,F=A.typed.kind==="command_result"&&A.dir==="in"&&A.peerCid===d&&T?.dir==="out"&&T.peerCid===d&&T.typed?.kind==="command",X=A.typed.kind==="command_result"&&!A.typed.outcome.ok?A.typed.outcome.error.toLowerCase():"",M=A.typed.kind==="command"?A.dir==="out"?"Accepted · pending result":"Received command":A.typed.kind==="unknown"?"Safe failure":A.dir==="out"?"Result sent":F?X==="validation_denied"||X==="validation_failed"?"Validation denied":X==="policy_denied"||X==="unauthorized"||X==="forbidden"?"Policy denied":A.typed.outcome.ok?"Completed":"Failed":"Unmatched result · safe failure",oe=A.typed.kind==="command"?A.typed.command:A.typed.kind==="command_result"?`Result for ${F&&T?.typed?.kind==="command"?T.typed.command:"unmatched command"}`:`Unsupported ${A.typed.wire_kind}`,ue=A.typed.kind==="command"?A.typed.arguments:A.typed.kind==="command_result"?A.typed.outcome:{safe_failure:A.typed.malformed?"Malformed typed message":"Future typed message preserved"};return v.jsxs(Ds.div,{className:"message-motion",id:B,initial:{opacity:0,y:12},animate:{opacity:1,y:0},exit:{opacity:0},transition:qo,children:[pe,v.jsx($f,{dir:A.dir,rowClass:Z,canReply:!!A.wireId,onReply:()=>_(A),after:ve,children:v.jsxs("div",{className:`ours-message typed-message ours-message--${A.dir}`,children:[Q,v.jsx("div",{className:"typed-message-kind",children:A.typed.kind==="command"?"Command":A.typed.kind==="command_result"?"Result":"Typed message"}),v.jsx("strong",{children:oe}),v.jsx("div",{className:"typed-message-state",role:"status",children:M}),v.jsx("pre",{children:JSON.stringify(ue,null,2)}),v.jsxs("div",{className:"bubble-at",children:[Wi(A.date),A.dir==="out"&&v.jsx(kh,{receipt:A.receipt,receiptless:A.receiptless})]})]})})]},q)}return v.jsxs(Ds.div,{className:"message-motion",id:B,initial:{opacity:0,y:12,scale:.985},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,scale:.98},transition:qo,children:[pe,v.jsx($f,{dir:A.dir==="out"?"out":"in",rowClass:Z,canReply:!!A.wireId,onReply:()=>_(A),after:ve,children:v.jsxs("div",{className:`ours-message ours-message--${A.dir}`,children:[Q,U&&!he&&v.jsxs(v.Fragment,{children:[U.roomName&&v.jsx("div",{className:"room-message-room",children:U.roomName}),v.jsxs("div",{className:"room-author",children:[v.jsx("span",{className:"room-author-name",children:U.author}),U.role&&v.jsx("span",{className:"room-author-role",children:U.role})]})]}),v.jsx(Ox,{text:U?U.text:A.text}),v.jsxs("div",{className:"bubble-at",children:[Wi(A.date),A.dir==="out"&&v.jsx(kh,{receipt:A.receipt,receiptless:A.receiptless})]})]})})]},q)})})});function Cz(e){const{contact:t,messages:n}=e,[r,s]=S.useState(""),[a,l]=S.useState(!1),[c,d]=S.useState(null),[h,p]=S.useState(null),[m,y]=S.useState(null),[w,k]=S.useState(null),[b,E]=S.useState(null),[P,R]=S.useState(!1),[_,j]=S.useState(!1),[A,N]=S.useState(!1),[q,B]=S.useState(null),[D,I]=S.useState(null),[U,z]=S.useState(!1),[he,J]=S.useState(!1),[Z,ve]=S.useState(!1),[Se,Q]=S.useState(!1),[pe,T]=S.useState(!1),[F,X]=S.useState(null),[M,oe]=S.useState(null),ue=S.useRef(null),ae=S.useRef(null),me=S.useRef(null),ke=D?.recipient_cid===t?.id?D:null,$e=/^\/[^\s/]*$/.test(r)&&Z&&!U&&!Se&&!pe,Fe=$e&&e.onSendCommand?ke?.commands.filter(K=>K.name.toLowerCase().startsWith(r.slice(1).toLowerCase()))??[]:[],qe=JSON.stringify([t?.id,ke?.fingerprint,r]),st=F?.key===qe?Fe.findIndex(K=>K.name===F.name):-1,ot=S.useRef(null),Vt=S.useRef(null),en=S.useRef(null),et=S.useRef(null),Wt=S.useRef(null),Tn=S.useRef(null),zt=S.useRef(null),tn=S.useRef(!1),bt=S.useRef(null),tr=S.useRef(!1),[He,jr]=S.useState(!1),[Y,ee]=S.useState(0),Te=S.useRef(null),Ae=S.useRef(!0),Ve=S.useRef(null),at=S.useRef(0),Nt=S.useRef(null),H=S.useRef(new Map),ge=S.useRef(0),ie=S.useRef(null),ye=S.useRef(null),Le=S.useRef(0),fe=S.useRef(null),Ge=S.useRef(null),wt=S.useRef(null),dt=S.useRef(null),[Je,yt]=S.useState(null),[ht,qt]=S.useState(""),Tt=S.useCallback(()=>{Ge.current?.abort(),Ge.current=null,dt.current!==null&&clearTimeout(dt.current),dt.current=null,wt.current?.classList.remove("reply-highlight"),wt.current=null,yt(null),qt("")},[]);S.useLayoutEffect(()=>(Tt(),Tt),[t?.id,Tt]);const Ra=S.useCallback(async K=>{Tt();const ne=new AbortController;Ge.current=ne;const ce=bt.current;ie.current=null,ye.current=null,Ae.current=!1,tr.current=!0,Nt.current=null,ce&&ce.scrollTo({top:ce.scrollTop,behavior:"instant"}),window.location.hash.startsWith("#chat-message-")&&window.history.replaceState(window.history.state,"",window.location.pathname+window.location.search);const Oe=setTimeout(()=>{ne.abort(),qt("Could not load the original message. Please try again.")},1e4);try{let pt="found";const Rt=document.getElementById(yu(K));if((!Rt||!ce?.contains(Rt))&&(qt("Finding original message…"),pt=await e.onRevealMessage?.(K,ne.signal)??"unavailable"),ne.signal.aborted)return;if(pt!=="found"){qt(pt==="limit"?"Original message is beyond the search limit. Load earlier messages and try again.":"Original message is unavailable.");return}qt(""),yt({wireId:K,controller:ne})}catch{ne.signal.aborted||qt("Could not load the original message. Please try again.")}finally{clearTimeout(Oe)}},[Tt,e.onRevealMessage]);S.useLayoutEffect(()=>{if(!Je)return;const K=requestAnimationFrame(()=>{if(Je.controller.signal.aborted)return;const ne=document.getElementById(yu(Je.wireId)),ce=bt.current;if(!ne||!ce?.contains(ne)){qt("Original message is unavailable."),yt(null);return}Nt.current=null,Ae.current=!1;const Oe=ne.getBoundingClientRect(),pt=ce.getBoundingClientRect(),Rt=Math.max(16,(ce.clientHeight-Oe.height)/2);ce.scrollTo({top:ce.scrollTop+Oe.top-pt.top-Rt,behavior:"instant"}),ne.classList.remove("reply-highlight"),ne.offsetWidth,ne.classList.add("reply-highlight"),wt.current=ne,ne.setAttribute("tabindex","-1"),ne.focus({preventScroll:!0}),dt.current=setTimeout(()=>{ne.classList.remove("reply-highlight"),wt.current=null,dt.current=null},1500),yt(null),xr()});return()=>cancelAnimationFrame(K)},[Je]);const Qi=S.useRef("");S.useLayoutEffect(()=>{const K=Wt.current,ne=Tn.current,ce=zt.current;if(!K||!ne||!ce)return;let Oe=-1,pt=-1,Rt=null;const Rn=()=>{const Gt=Math.round(ne.getBoundingClientRect().height),cn=Math.round(ce.getBoundingClientRect().height);if(Gt!==Oe&&(Oe=Gt,K.style.setProperty("--conversation-head-height",`${Gt}px`)),cn!==pt){const St=Ae.current;pt=cn,K.style.setProperty("--conversation-compose-height",`${cn}px`),St&&(Rt!==null&&cancelAnimationFrame(Rt),Rt=requestAnimationFrame(()=>{Rt=null;const Bn=bt.current;Bn&&Ae.current&&(Bn.scrollTop=Math.max(0,Bn.scrollHeight-Bn.clientHeight))}))}};Rn();const Qe=new ResizeObserver(Rn);return Qe.observe(ne),Qe.observe(ce),()=>{Qe.disconnect(),Rt!==null&&cancelAnimationFrame(Rt),K.style.removeProperty("--conversation-head-height"),K.style.removeProperty("--conversation-compose-height")}},[t?.id]),S.useEffect(()=>{s(""),p(null),y(null),d(null),k(null),E(null),R(!1),j(!1),N(!1),at.current+=1,B(null),ot.current?.abort(),I(null),z(!1),J(!1),X(null),T(!1),Q(!1),H.current.clear(),ie.current=null,ye.current=null},[t?.id]);const gi=async(K=!0,ne=!0)=>{if(!t||!e.onLoadCommands)return;ot.current?.abort();const ce=new AbortController;ot.current=ce,J(!0),ne&&p(null);try{const Oe=await e.onLoadCommands(t.id,ce.signal);!ce.signal.aborted&&Oe.recipient_cid===t.id?(I(Oe),Oe.commands.length===0?(z(!1),U&&requestAnimationFrame(()=>et.current?.focus({preventScroll:!0}))):K&&z(!0)):ce.signal.aborted||(I(null),z(!1),ne&&p("Command discovery was refused because the authenticated recipient changed."))}catch(Oe){ce.signal.aborted||(I(null),z(!1),ne&&p(Oe instanceof Tu?`Command discovery failed: ${Oe.message}`:"Command discovery failed safely. The recipient may be offline or unsupported."))}finally{ot.current===ce&&J(!1)}};S.useEffect(()=>(gi(!1,!1),()=>ot.current?.abort()),[t?.id]);const Dr=()=>{z(!1),Vt.current?.focus()},Ji=S.useRef(gi);Ji.current=gi,S.useEffect(()=>{if(!$e||!e.onLoadCommands)return;let K=!1,ne;const ce=async()=>{await Ji.current(!1,!1),K||(ne=setTimeout(ce,2e3))};return ce(),()=>{K=!0,clearTimeout(ne),ot.current?.abort()}},[$e,t?.id]),S.useEffect(()=>{me.current?.querySelector('[aria-selected="true"]')?.scrollIntoView({block:"nearest",behavior:"instant"})},[st,qe]);const xn=()=>{ue.current=null,oe(null)};S.useLayoutEffect(xn,[$e,qe]),S.useLayoutEffect(()=>{ae.current!==null&&(et.current?.setSelectionRange(ae.current,ae.current),ae.current=null)},[r]);const Aa=K=>{if(!$e||!Fe.some(ce=>ce.name===K))return;const ne=`/${K} `;ae.current=ne.length,s(ne),X(null),T(!0),xn(),et.current?.focus({preventScroll:!0})};S.useEffect(()=>{if(!m)return;const K=m.reply?.wireId;n.some(ce=>ce.kind!=="file"&&ce.dir==="out"&&!!ce.wireId&&!m.wireIds.has(ce.wireId)&&ce.text===m.text&&(ce.replyTo?.wireId??void 0)===K)&&(y(null),p(null),s(ce=>ce===m.draft?"":ce),k(ce=>ce===m.reply?null:ce))},[n,m]);const nr=!!c?.wireId&&n.some(K=>K.wireId===c.wireId),Lt=S.useMemo(()=>c&&!nr?[...n,c.message]:n,[n,c,nr]);S.useEffect(()=>{nr&&d(null)},[nr]),S.useLayoutEffect(()=>{const K=et.current;if(!K)return;r.startsWith(Qi.current)||(K.style.height="0px");const ce=K.scrollHeight,pt=`${Math.max(44,Math.min(ce,132))}px`;K.style.height!==pt&&(K.style.height=pt),K.style.overflowY=ce>132?"auto":"hidden",Qi.current=r},[r,t?.id]);const Or=K=>{const ne=bt.current;if(!ne)return;const ce=Math.max(0,ne.scrollHeight-ne.clientHeight);if(Math.abs(ne.scrollTop-ce)<1){ie.current=null,ye.current=null;return}const Oe=K&&!JC();ie.current=Oe?ce:null,ye.current=Oe?ne.scrollTop:null,Oe?ne.scrollTo({top:ce,behavior:"smooth"}):ne.scrollTop=ce},xr=()=>{Te.current===null&&(Te.current=requestAnimationFrame(()=>{Te.current=null;const K=bt.current;if(!K)return;const ne=K.scrollHeight-K.clientHeight-K.scrollTop>48;jr(ne),ne||ee(0)}))};S.useLayoutEffect(()=>{if(!t){Ve.current=null,Ae.current=!0,Le.current=0;return}const K=bt.current;if(!K)return;const ne=Ve.current!==t.id,ce=Le.current,Oe=Lt.length!==ce,pt=Lt.at(-1),Rt=pt?pt.wireId||`${pt.date}:${pt.text}`:null,Rn=fe.current;if(Le.current=Lt.length,fe.current=Rt,!ne&&!Oe&&ie.current===null&&(Ae.current=K.scrollHeight-K.clientHeight-K.scrollTop<=48),ne||Ae.current)Or(Oe&&!ne&&Ve.current!==null),Ae.current=!0;else if(Oe&&Lt.length>ce&&Rt!==Rn){const Qe=Rn===null?-1:Lt.findIndex(Gt=>(Gt.wireId||`${Gt.date}:${Gt.text}`)===Rn);ee(Gt=>Gt+Math.max(1,Lt.length-Math.max(0,Qe+1)))}Ve.current=t.id,xr()},[t,Lt.length]),S.useLayoutEffect(()=>{if(tr.current||!e.unreadOpen||window.location.hash.startsWith("#chat-message-"))return;const K=bt.current,ne=document.getElementById(`unread-${yu(e.unreadOpen.wireId)}`);!K||!ne||(K.scrollTop=Math.max(0,ne.offsetTop-16),Ae.current=!1,tr.current=!0,xr())},[e.unreadOpen,Lt.length]),S.useLayoutEffect(()=>{const K=window.location.hash;if(!K.startsWith("#chat-message-"))return;const ne=document.getElementById(K.slice(1));ne&&(ne.scrollIntoView({block:"center"}),Ae.current=!1)},[t?.id,Lt.length]),S.useLayoutEffect(()=>{const K=Nt.current,ne=bt.current;if(K===null||!ne)return;const ce=requestAnimationFrame(()=>{Nt.current===K&&(ne.scrollTop=K.top+ne.scrollHeight-K.height,Nt.current=null)});return()=>cancelAnimationFrame(ce)},[Lt.length]),S.useEffect(()=>{const K=bt.current;if(!K||typeof ResizeObserver>"u")return;const ne=K.firstElementChild;if(!ne)return;const ce=new ResizeObserver(()=>{Ae.current&&Or(ie.current!==null),xr()});return ce.observe(ne),ce.observe(K),()=>{ce.disconnect(),Te.current!==null&&cancelAnimationFrame(Te.current)}},[t?.id]);const Ia=async K=>{const ne=++at.current;p(null),N(!0);try{if(K.size>Ho&&EC(K.type,K.name)){const Oe=await B4(K,Ho);if(ne!==at.current)return;E({filename:Oe.filename,mime:Oe.mime,bytes:Oe.bytes,originalSize:Oe.originalSize});return}if(K.size>Ho){p(`"${K.name}" is ${fi(K.size)} — files up to ${fi(Ho)} can be sent.`);return}const ce=await K.arrayBuffer();if(ne!==at.current)return;E({filename:K.name||"file",mime:K.type||"application/octet-stream",bytes:new Uint8Array(ce)})}catch(ce){ne===at.current&&p(`Photo optimization failed: ${ce instanceof Error?ce.message:String(ce)}`)}finally{ne===at.current&&N(!1)}},lc=()=>{!b||!e.onSendFile||_||(j(!0),e.onSendFile(b,w?.wireId).then(()=>{E(null),k(null)}).catch(K=>p(`File send failed: ${String(K)} — it was not delivered.`)).finally(()=>j(!1)))},Zs=e.onDraftChange;S.useEffect(()=>(Zs?.(r.trim().length>0||a),()=>Zs?.(!1)),[r,a,Zs]);const wr=S.useMemo(()=>{const K=new Map;for(const ne of Lt)K.set(ne,ne.kind==="file"?null:ne.dir==="in"?pI(t?.announcedName??"",ne.text):null);return K},[Lt,t?.announcedName]);if(!t)return e.emptyOverride?v.jsx(v.Fragment,{children:e.emptyOverride}):v.jsx("div",{className:"detail",children:v.jsxs("div",{className:"detail-empty",children:[v.jsx(Ce,{name:"chat"}),v.jsxs("div",{children:[v.jsx("div",{style:{fontWeight:650,color:"var(--text-2)"},children:"Select a conversation"}),v.jsx("div",{style:{fontSize:"0.85rem"},children:"Chat with people, agents and apps across ours."})]})]})});const Zi=async()=>{const K=r,ne=K.trim(),ce=!!m&&K===m.draft&&(w?.wireId??void 0)===m.reply?.wireId;if(!ne||tn.current||ce)return;m&&y(null),tn.current=!0,l(!0),p(null);const Oe=w,pt=Oe?.wireId,Rt=new AbortController;let Rn=!1,Qe=0;s(""),k(null);const Gt=`optimistic-${++ge.current}`;d({key:Gt,wireId:null,message:{dir:"out",text:ne,date:new Date().toISOString(),read:!0,wireId:"",replyTo:pt?{wireId:pt}:null}});try{const cn=await Promise.race([e.onSend(ne,pt,Rt.signal),new Promise((St,Bn)=>{Qe=window.setTimeout(()=>{Rn=!0,Rt.abort(),Bn(new Error("send timeout"))},xz)})]);cn?(H.current.set(cn,Gt),d(St=>St?.key===Gt?{...St,wireId:cn}:St)):d(St=>St?.key===Gt?null:St),y(null)}catch(cn){d(null),s(St=>St===""?K:St),k(St=>St===null?Oe:St),Rn||!(cn instanceof Tu)?(y({draft:K,text:ne,reply:Oe,wireIds:new Set(n.flatMap(St=>St.wireId?[St.wireId]:[]))}),p(`${Rn?"Send timed out":"Send connection was interrupted"} — delivery status is unknown. Check the conversation; edit the draft before sending again.`)):p(`Send failed: ${String(cn)} — the message was not delivered.`)}finally{window.clearTimeout(Qe),tn.current=!1,l(!1)}},eo=!!m&&r===m.draft&&(w?.wireId??void 0)===m.reply?.wireId;return v.jsxs("div",{className:"detail detail-chat",ref:Wt,children:[v.jsx("div",{className:"detail-head",ref:Tn,children:v.jsxs("div",{className:"conv-peer",children:[v.jsx("button",{className:"icon-btn detail-back","aria-label":"Back to conversations",onClick:e.onBack,children:v.jsx(Ce,{name:"back"})}),v.jsxs("div",{className:"conv-peer-status",children:[v.jsx("span",{className:"conv-peer-name",children:t.name}),e.syncing&&v.jsxs("div",{className:"conv-sync",role:"status","aria-live":"polite",children:[v.jsx("span",{className:"conv-sync-dot","aria-hidden":!0}),e.syncing==="connecting"?"Connecting…":"Updating…"]}),!e.syncing&&v.jsxs("span",{className:"conv-contact-status",children:[v.jsx(Ce,{name:"lock",size:11}),"Encrypted connection"]})]}),v.jsx("button",{type:"button",className:"conv-contact-trigger conv-contact-avatar","data-contact-trigger":!0,onClick:e.onOpenContact,disabled:!e.onOpenContact,"aria-label":`Open contact details for ${t.name}`,children:v.jsx("span",{className:"conv-contact-initials","aria-hidden":!0,children:t.initials})})]})}),v.jsx("div",{className:"messages",ref:bt,tabIndex:-1,"aria-label":"Conversation timeline",onScroll:K=>{const ne=K.currentTarget,ce=ne.scrollHeight-ne.clientHeight-ne.scrollTop;if(ie.current!==null){const Oe=ye.current;if(Oe===null||ne.scrollTop>=Oe-1){ye.current=ne.scrollTop,ce<=4&&(ie.current=null,ye.current=null);return}ie.current=null,ye.current=null}Ae.current=ce<=48,xr()},onPointerDown:()=>{Tt(),ie.current=null,ye.current=null},onTouchStart:()=>{Tt(),ie.current=null,ye.current=null},onWheel:()=>{Tt(),ie.current=null,ye.current=null},onKeyDown:K=>{["ArrowUp","ArrowDown","PageUp","PageDown","Home","End"," ","Escape"].includes(K.key)&&Tt()},onDragOver:K=>{e.onSendFile&&K.preventDefault()},onDrop:K=>{if(!e.onSendFile)return;K.preventDefault();const ne=K.dataTransfer.files?.[0];ne&&Ia(ne)},children:v.jsxs("div",{className:"messages-inner",children:[v.jsxs("div",{className:"e2e-note",children:[v.jsx(Ce,{name:"lock"}),"End-to-end encrypted · the broker only sees ciphertext"]}),(e.hiddenEarlier??0)>0&&e.onLoadEarlier&&v.jsxs("button",{className:"btn sm chat-load-earlier",onClick:()=>{Ae.current=!1;const K=bt.current;Nt.current=K?{height:K.scrollHeight,top:K.scrollTop}:null,e.onLoadEarlier?.()},children:["Load earlier messages (",e.hiddenEarlier," remaining)"]}),v.jsx(kz,{messages:Lt,optimisticSend:c,sentKeys:H.current,hiddenEarlier:e.hiddenEarlier??0,unreadWireId:e.unreadOpen?.wireId,roomLines:wr,contactCid:t.id,contactName:t.name,onStartReply:k,onRevealMessage:Ra,onPreview:B,onFetchFile:e.onFetchFile}),v.jsx("div",{className:"thread-end","aria-hidden":!0})]})},t.id),He&&v.jsxs("button",{type:"button",className:"jump-latest btn sm","aria-label":Y?`Jump to latest, ${Y} new messages`:"Jump to latest",onClick:K=>{const ne=K.currentTarget===document.activeElement;Tt(),ee(0),Or(!0),ne&&requestAnimationFrame(()=>bt.current?.focus({preventScroll:!0}))},children:[v.jsx("span",{children:"Jump to latest"}),!!Y&&v.jsx("span",{className:"jump-latest-count","aria-live":"polite",children:Y})]}),ht&&v.jsx("div",{className:"banner",role:"status",children:ht}),h&&v.jsxs("div",{className:"banner error",role:"alert",children:[h,h.startsWith("Send failed:")&&v.jsx("span",{className:"banner-actions",children:v.jsx("button",{className:"linkbtn",onClick:()=>void Zi(),children:"retry"})})]}),v.jsxs("div",{className:"composer-wrap",ref:zt,children:[U&&ke&&e.onSendCommand&&v.jsx(uz,{catalog:ke,recipientName:t.name,busy:he,onRefresh:()=>void gi(!0,!0),onClose:Dr,onSend:async(K,ne,ce,Oe)=>{if(!t||t.id!==ke.recipient_cid)throw new Error("Recipient changed; refresh commands");return e.onSendCommand(t.id,K.name,ne,ce,Oe)}},`${ke.recipient_cid}:${ke.fingerprint}`),Fe.length>0&&v.jsx("div",{ref:me,id:"composer-command-suggestions",className:"command-suggestions",role:"listbox","aria-label":"Suggested contact commands",onScroll:xn,children:Fe.map((K,ne)=>v.jsxs("div",{id:`composer-command-option-${ne}`,role:"option","aria-selected":ne===st,className:"command-suggestion","data-pressed":M?.key===qe&&M.name===K.name||void 0,onMouseDown:ce=>{ce.button===0&&ce.preventDefault()},onPointerDown:ce=>{!ce.isPrimary||ce.button!==0||(ue.current={key:qe,name:K.name},oe({key:qe,name:K.name,pointer:ce.pointerId,x:ce.clientX,y:ce.clientY}))},onPointerMove:ce=>{M?.pointer===ce.pointerId&&Math.hypot(ce.clientX-M.x,ce.clientY-M.y)>10&&xn()},onPointerUp:()=>oe(null),onPointerCancel:xn,onPointerLeave:ce=>{ce.buttons!==0&&xn()},onClick:ce=>{const Oe=ue.current;xn(),(ce.detail===0||Oe?.key===qe&&Oe.name===K.name)&&Aa(K.name)},children:[v.jsxs("strong",{children:["/",K.name]}),K.description&&v.jsx("span",{children:K.description})]},`${qe}:${K.name}`))}),w&&v.jsxs("div",{className:"reply-bar",children:[v.jsx("div",{className:"reply-bar-line"}),v.jsxs("div",{className:"reply-bar-body",children:[v.jsxs("div",{className:"reply-bar-author",children:["Replying to ",w.author]}),v.jsx("div",{className:"reply-bar-text",children:w.text})]}),v.jsx("button",{className:"icon-btn",title:"Cancel reply",onClick:()=>k(null),children:v.jsx(Ce,{name:"close",size:16})})]}),b&&v.jsx(ek,{att:b,sending:_,onSend:lc,onDiscard:()=>E(null)}),A&&v.jsx("div",{className:"attachment-processing",role:"status",children:"Optimizing photo for secure delivery…"}),v.jsxs("div",{className:"composer"+(P?" recording":""),children:[e.onLoadCommands&&ke&&ke.commands.length>0&&v.jsx("button",{ref:Vt,type:"button",className:"icon-btn composer-tool command-trigger",title:"Recipient commands","aria-label":"Recipient commands","aria-expanded":U,disabled:he,onClick:()=>{U?Dr():z(!0)},children:v.jsx(Ce,{name:"menu",size:19})}),e.onSendFile&&v.jsxs(v.Fragment,{children:[v.jsx("input",{ref:en,type:"file",style:{display:"none"},onChange:K=>{const ne=K.target.files?.[0];ne&&Ia(ne),K.target.value=""}}),v.jsx("button",{className:"icon-btn composer-tool",title:"Attach a file or photo",disabled:_||A||P,onClick:()=>en.current?.click(),children:v.jsx(Ce,{name:"paperclip",size:18})})]}),v.jsx("textarea",{ref:et,className:"field",rows:1,placeholder:(w?"Reply to "+w.author:"Message "+t.name)+"…",value:r,"aria-busy":a,"aria-autocomplete":Fe.length?"list":void 0,"aria-controls":Fe.length?"composer-command-suggestions":void 0,"aria-activedescendant":st>=0?`composer-command-option-${st}`:void 0,onFocus:()=>ve(!0),onBlur:()=>{ve(!1),X(null)},onCompositionStart:()=>{Q(!0),X(null)},onCompositionEnd:()=>Q(!1),onChange:K=>{s(K.target.value),X(null),T(!1)},onKeyDown:K=>{if(!(Se||K.nativeEvent.isComposing||K.keyCode===229)){if(Fe.length&&!K.shiftKey&&!K.altKey&&!K.ctrlKey&&!K.metaKey){if(K.key==="ArrowDown"||K.key==="ArrowUp"){K.preventDefault();const ne=st<0?K.key==="ArrowDown"?0:Fe.length-1:(st+(K.key==="ArrowDown"?1:-1)+Fe.length)%Fe.length;X({key:qe,name:Fe[ne].name});return}if((K.key==="Enter"||K.key==="Tab")&&st>=0){K.preventDefault(),Aa(Fe[st].name);return}if(K.key==="Escape"){K.preventDefault(),T(!0),X(null);return}}K.key==="Enter"?!(window.matchMedia("(pointer: coarse)").matches||window.innerWidth<=860)&&!K.shiftKey&&(K.preventDefault(),Zi()):K.key==="Escape"&&k(null)}}}),e.onSendFile&&!r.trim()&&!b&&!A&&!_?v.jsx(tk,{disabled:_||A||!!b,onReady:K=>{R(!1),E(K)},onError:K=>{R(!1),p(K)},onActiveChange:R},t.id):v.jsxs("button",{className:"btn primary","aria-label":"Send",onPointerDown:K=>{K.button===0&&document.activeElement===et.current&&K.preventDefault()},onClick:()=>void Zi(),disabled:a||eo||!r.trim(),title:eo?"Delivery status unknown — edit before sending again":void 0,children:[v.jsx(Ce,{name:"send",size:16}),v.jsx("span",{className:"btn-label",children:"Send"})]})]})]}),q&&(ba(q.filename,q.mime)?v.jsx(CC,{rec:q,onClose:()=>B(null)}):v.jsx(kC,{rec:q,onClose:()=>B(null),onSendText:e.onSend,onSendFile:e.onSendFile}))]})}const ZC=3;function bz(e,t,n=ZC){return[t,...e.filter(r=>r.cid!==t.cid)].slice(0,n)}function Ez(e,t){return e.filter(n=>n.id!==t)}const _z=6e3,Pz=bz,Tz=Ez;function Rz(){const[e,t]=S.useState([]),n=S.useRef(0),r=S.useCallback((l,c,d)=>{const h=Date.now(),p={id:`${l}:${h}:${n.current++}`,cid:l,name:c,preview:"",at:h};t(m=>Pz(m,p,ZC))},[]),s=S.useCallback(l=>t(c=>Tz(c,l)),[]),a=S.useCallback(l=>t(c=>c.filter(d=>d.cid!==l)),[]);return{toasts:e,push:r,dismiss:s,clear:a}}function Az(e){const{item:t,onOpen:n,onDismiss:r}=e,[s,a]=S.useState(!1),[l,c]=S.useState(!1),d=s||l;return S.useEffect(()=>{if(d)return;const h=setTimeout(()=>r(t.id),_z);return()=>clearTimeout(h)},[t.id,d,r]),v.jsxs("div",{className:"banner msg",role:"status",onMouseEnter:()=>a(!0),onMouseLeave:()=>a(!1),onFocus:()=>c(!0),onBlur:h=>{h.currentTarget.contains(h.relatedTarget)||c(!1)},children:[v.jsxs("button",{className:"msg-open",title:`Open the conversation with ${t.name}`,onClick:()=>n(t.cid),children:[v.jsx("span",{className:"avatar sm accent","aria-hidden":"true",children:wh(t.name)}),v.jsxs("span",{className:"msg-text",children:[v.jsx("strong",{className:"msg-name",children:t.name}),v.jsx("span",{className:"msg-preview",children:t.preview||"New message"})]})]}),v.jsx("button",{className:"icon-btn msg-close",title:"Dismiss","aria-label":`Dismiss the notification from ${t.name}`,onClick:()=>r(t.id),children:v.jsx(Ce,{name:"close",size:15})})]})}function Iz(e){return v.jsx(v.Fragment,{children:e.items.map(t=>v.jsx(Az,{item:t,onOpen:e.onOpen,onDismiss:e.onDismiss},t.id))})}function Mz(e){const t=S.useRef(null),{text:n,size:r=240}=e;return S.useEffect(()=>{if(!t.current||!n)return;const s=t.current;fm(()=>import("./browser-Dhhdn8L5.js").then(a=>a.b),[],import.meta.url).then(a=>{a.toCanvas(s,n,{width:r,margin:2,errorCorrectionLevel:"M",color:{dark:"#000000",light:"#ffffff"}})})},[n,r]),v.jsx("div",{style:{display:"flex",justifyContent:"center",margin:"8px 0"},children:v.jsx("canvas",{ref:t,"data-testid":"qr-canvas","data-invite":n,width:r,height:r,style:{borderRadius:8,border:"1px solid var(--line)",imageRendering:"pixelated"}})})}function Nz(e){const t=S.useRef(null),n=S.useRef(null),r=S.useRef(null),s=S.useRef(0),a=S.useRef(!0),[l,c]=S.useState("requesting"),[d,h]=S.useState(""),p=S.useCallback(()=>{s.current&&cancelAnimationFrame(s.current),r.current&&(r.current.getTracks().forEach(w=>w.stop()),r.current=null),t.current&&(t.current.srcObject=null)},[]),m=S.useCallback(w=>{r.current=w;const k=t.current;k.srcObject=w,k.setAttribute("playsinline","true"),k.play();const b=n.current,E=b.getContext("2d"),P=()=>{if(a.current)if(k.readyState>=k.HAVE_ENOUGH_DATA){const R=k.videoWidth||320,_=k.videoHeight||240;b.width=R,b.height=_,E.drawImage(k,0,0,R,_);const j=E.getImageData(0,0,R,_);fm(()=>import("./jsQR-9sKVnlrx.js").then(A=>A.j),[],import.meta.url).then(A=>{const N=A.default,q=N(j.data,j.width,j.height,{inversionAttempts:"dontInvert"});if(q&&q.data&&a.current){p(),e.onDecode(q.data);return}a.current&&(s.current=requestAnimationFrame(P))})}else s.current=requestAnimationFrame(P)};s.current=requestAnimationFrame(P)},[p,e]);S.useEffect(()=>{if(a.current=!0,!navigator.mediaDevices?.getUserMedia){c("nocamera");return}return navigator.mediaDevices.getUserMedia({video:{facingMode:"environment"}}).then(w=>{if(!a.current){w.getTracks().forEach(k=>k.stop());return}c("scanning"),m(w)}).catch(w=>{if(!a.current)return;const k=w.name??"";k==="NotAllowedError"||k==="PermissionDeniedError"?c("denied"):k==="NotFoundError"||k==="DevicesNotFoundError"?c("nocamera"):(c("error"),h(w.message??String(w)))}),()=>{a.current=!1,p()}},[]);const y=()=>{p(),e.onClose()};return v.jsxs("div",{"data-testid":"qr-scanner",style:{display:"flex",flexDirection:"column",gap:12,padding:"12px 0"},children:[(l==="requesting"||l==="scanning")&&v.jsxs(v.Fragment,{children:[v.jsx("p",{className:"muted",style:{margin:0,fontSize:"0.88rem"},children:l==="requesting"?"Requesting camera…":"Point your camera at the QR code."}),v.jsxs("div",{style:{position:"relative",borderRadius:8,overflow:"hidden",background:"#000",minHeight:200},children:[v.jsx("canvas",{ref:n,"data-testid":"scanner-canvas",style:{display:"none"}}),v.jsx("video",{ref:t,"data-testid":"scanner-video",muted:!0,playsInline:!0,style:{width:"100%",display:"block",borderRadius:8}}),l==="scanning"&&v.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none",display:"flex",alignItems:"center",justifyContent:"center"},children:v.jsx("div",{style:{width:160,height:160,borderRadius:12,border:"2px solid var(--accent)",boxShadow:"0 0 0 9999px rgba(0,0,0,0.4)"}})})]})]}),l==="denied"&&v.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:8},children:[v.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,color:"var(--text-2)"},children:[v.jsx(Ce,{name:"shield",size:16}),v.jsx("span",{style:{fontWeight:600,fontSize:"0.9rem"},children:"Camera access denied"})]}),v.jsx("p",{className:"muted",style:{margin:0,fontSize:"0.88rem"},children:"Camera permission was denied. To scan QR codes, allow camera access in your browser settings, then try again. Or paste the invite text below instead."})]}),l==="nocamera"&&v.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:8},children:[v.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,color:"var(--text-2)"},children:[v.jsx(Ce,{name:"close",size:16}),v.jsx("span",{style:{fontWeight:600,fontSize:"0.9rem"},children:"No camera available"})]}),v.jsx("p",{className:"muted",style:{margin:0,fontSize:"0.88rem"},children:"No camera was found on this device. Paste the invite text below instead."})]}),l==="error"&&v.jsx("div",{style:{display:"flex",flexDirection:"column",gap:8},children:v.jsxs("p",{style:{margin:0,fontSize:"0.85rem",color:"var(--danger, #e53)"},children:["Camera error: ",d||"unknown error",". Paste the invite text below instead."]})}),v.jsx("button",{className:"btn",style:{justifyContent:"center"},onClick:y,children:l==="scanning"?v.jsxs(v.Fragment,{children:[v.jsx(Ce,{name:"close",size:14}),"Cancel scan"]}):v.jsxs(v.Fragment,{children:[v.jsx(Ce,{name:"close",size:14}),"Close scanner"]})})]})}function Lz(e){const[t,n]=S.useState("generate"),[r,s]=S.useState("one_time"),[a,l]=S.useState(""),[c,d]=S.useState(null),[h,p]=S.useState("one_time"),[m,y]=S.useState(""),[w,k]=S.useState(""),[b,E]=S.useState(!1),[P,R]=S.useState(null),[_,j]=S.useState(null),[A,N]=S.useState(!1),[q,B]=S.useState(null),D=S.useRef(!1),I=async()=>{if(!D.current){D.current=!0,E(!0),j(null),R(null);try{p(r),d(await e.onCreate(r,r==="one_time"&&a.trim()||void 0))}catch(z){j(z instanceof Error?z.message:String(z))}finally{D.current=!1,E(!1)}}},U=v.jsx(bC,{className:"modal-tabs",label:"Invite mode",options:[{id:"generate",label:"Generate invite"},{id:"accept",label:"Accept invite"}],value:t,onChange:n,idPrefix:"invite-tab",panelId:"invite-panel"});return v.jsx(Ta,{title:t==="generate"?"Invite a contact":"Accept an invite",onClose:()=>{D.current||e.onClose()},tabs:U,children:v.jsxs("div",{id:"invite-panel",role:"tabpanel","aria-labelledby":`invite-tab-${t}`,children:[t==="generate"&&!c&&v.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:13},children:[v.jsxs("p",{className:"muted","data-testid":"invite-identity",style:{margin:0,fontSize:"0.85rem"},children:["Creating as ",v.jsx("strong",{children:e.identity.name})," · ",v.jsxs("span",{className:"mono",children:["@",tS(e.identity.cid)]})]}),v.jsxs("div",{role:"radiogroup","aria-label":"Invite kind",style:{display:"flex",flexDirection:"column",gap:7},children:[v.jsxs("label",{children:[v.jsx("input",{type:"radio",name:"invite-kind",checked:r==="one_time",onChange:()=>s("one_time")})," One person (one time)"]}),v.jsxs("label",{children:[v.jsx("input",{type:"radio",name:"invite-kind",checked:r==="public",onChange:()=>s("public")})," Reusable public invite"]})]}),r==="one_time"?v.jsxs(v.Fragment,{children:[v.jsx("p",{className:"muted",style:{margin:0,fontSize:"0.9rem"},children:"Optionally name the person or agent this invite is for."}),v.jsx("input",{className:"field",value:a,onChange:z=>l(z.target.value),placeholder:"Their name (optional), e.g. Bob",maxLength:64})]}):v.jsx("p",{className:"onb-warning","data-testid":"public-invite-warning",style:{margin:0,fontSize:"0.9rem"},children:"Anyone with this invite can connect until you revoke it. It has no expiry and stays valid across server restarts."}),v.jsx("button",{className:"btn primary",style:{justifyContent:"center"},disabled:b,onClick:()=>void I(),children:b?"Generating…":r==="public"?"Create public invite":"Generate invite"}),r==="public"&&v.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:8},children:[v.jsx("h4",{style:{margin:0,fontSize:"0.9rem"},children:"Active reusable invites"}),e.invites.filter(z=>z.mode==="public").length===0&&v.jsx("p",{className:"muted",style:{margin:0},children:"None right now."}),e.invites.filter(z=>z.mode==="public").map(z=>v.jsxs("div",{"data-testid":"public-invite-row",style:{padding:"8px 10px",background:"var(--inset)",borderRadius:7},children:[v.jsx("span",{className:"mono",children:z.invite_id}),v.jsxs("p",{className:"muted",children:["Created ",z.created?EI(z.created):"unknown"," · Active until revoked · No expiry"]}),q===z.invite_id?v.jsxs("span",{children:[v.jsx("button",{className:"btn sm danger",onClick:()=>void e.onRevoke(z.invite_id).then(()=>(B(null),e.onRefresh())).catch(he=>j(String(he))),children:"Confirm revoke"})," ",v.jsx("button",{className:"btn sm",onClick:()=>B(null),children:"Keep it"})]}):v.jsx("button",{className:"btn sm",onClick:()=>B(z.invite_id),children:"Revoke"})]},z.invite_id))]}),P&&v.jsx("p",{className:"muted",children:P}),_&&v.jsx("p",{className:"onb-error",children:_})]}),t==="generate"&&c&&v.jsxs(v.Fragment,{children:[v.jsx("p",{className:"muted","data-testid":h==="public"?"public-result-note":void 0,children:h==="public"?"Shown only on this screen. Copy it now; the text cannot be recovered later. The invite stays active until revoked.":`Send this invite to ${a.trim()||"your contact"}. It can be redeemed once.`}),v.jsx("textarea",{className:"field mono","data-testid":"invite-result-text",readOnly:!0,rows:5,value:c,onFocus:z=>z.currentTarget.select()}),h==="one_time"&&v.jsx(Mz,{text:c}),v.jsxs("button",{className:"btn primary",onClick:()=>void navigator.clipboard.writeText(c).then(()=>R("Copied to clipboard.")),children:[v.jsx(Ce,{name:"copy",size:15}),"Copy invite"]}),h==="public"&&v.jsx("button",{className:"btn","data-testid":"done-hide-invite",onClick:()=>{d(null),l(""),e.onRefresh()},children:"Done — hide invite"}),P&&v.jsx("p",{className:"muted",children:P})]}),t==="accept"&&v.jsxs("form",{style:{display:"flex",flexDirection:"column",gap:13},onSubmit:z=>{z.preventDefault(),!(!m.trim()||b)&&(E(!0),j(null),e.onAccept(m.trim(),w.trim()||void 0).then(()=>{R("Invite accepted — the contact will appear once the sender verifies your identity."),y(""),k("")}).catch(he=>j(String(he))).finally(()=>E(!1)))},children:[v.jsx("p",{className:"muted",children:"Paste the invite you received, or scan a QR code."}),A?v.jsx(Nz,{onDecode:z=>{y(z),N(!1)},onClose:()=>N(!1)}):v.jsxs("button",{type:"button",className:"btn",onClick:()=>N(!0),children:[v.jsx(Ce,{name:"monitor",size:15}),"Scan QR code"]}),v.jsx("textarea",{className:"field mono","aria-label":"Invite",rows:5,value:m,onChange:z=>y(z.target.value),placeholder:"Paste invite text…"}),v.jsx("input",{className:"field",value:w,onChange:z=>k(z.target.value),placeholder:"Rename them (optional)",maxLength:64}),v.jsx("button",{className:"btn primary",type:"submit",disabled:b||!m.trim(),children:b?"Connecting…":"Add contact"}),P&&v.jsx("p",{className:"muted",children:P}),_&&v.jsx("p",{className:"onb-error",children:_})]})]})})}function jz(e){const[t,n]=S.useState(e.identity.bio??""),[r,s]=S.useState(!1),[a,l]=S.useState(null),[c,d]=S.useState(e.push.preview),h=mA(),p=!e.workerSupported||e.push.status==="unsupported"?h??"Unavailable — requires a secure browser with service-worker support.":e.push.status==="needs-permission"?h??"Needs permission — allow notifications, then choose Enable or Repair.":e.push.status==="on"?"On — this browser and the server agree on the current Web Push configuration.":e.push.status==="repairing"?"Repairing — checking the browser subscription and server acknowledgement…":e.push.status==="error"?"Repair needed — the browser and server could not confirm the same subscription.":"Off — enable notifications for this browser.";return v.jsxs(Ta,{title:"Settings",onClose:e.onClose,wide:!0,children:[v.jsxs("div",{children:[v.jsx("span",{className:"lbl",children:"Display name"}),v.jsx("input",{className:"field",readOnly:!0,value:e.identity.name})]}),v.jsxs("div",{children:[v.jsx("span",{className:"lbl",children:"Your address"}),v.jsx("input",{className:"field mono",readOnly:!0,value:e.identity.cid,onFocus:m=>m.currentTarget.select()}),v.jsx("p",{className:"muted",children:"Your public address on ours. Share an invite to connect more easily."})]}),v.jsxs("div",{children:[v.jsx("span",{className:"lbl",children:"Public bio"}),v.jsx("textarea",{className:"field",rows:3,value:t,onChange:m=>{n(m.target.value),s(!1),l(null)}}),v.jsx("button",{className:"btn sm",onClick:()=>{l(null),e.onSaveBio(t).then(()=>s(!0)).catch(m=>l(String(m)))},children:r?"Saved":"Save bio"}),a&&v.jsx("p",{className:"onb-error",children:a})]}),v.jsxs("label",{style:{display:"flex",gap:9},children:[v.jsx("input",{type:"checkbox",checked:e.dark,onChange:e.onToggleDark})," Dark mode"]}),v.jsxs("div",{style:{borderTop:"1px solid var(--line)",paddingTop:16},children:[v.jsx("h4",{children:"Notifications"}),v.jsx("p",{className:e.push.status==="needs-permission"||e.push.status==="error"?"onb-error":"muted",children:p}),h&&h!==p&&v.jsx("p",{className:"muted","data-testid":"push-platform-guidance",children:h}),v.jsxs("fieldset",{style:{border:0,padding:0,margin:"12px 0"},children:[v.jsx("legend",{className:"lbl",children:"Lock-screen preview"}),v.jsxs("label",{style:{display:"block",marginTop:7},children:[v.jsx("input",{type:"radio",name:"push-preview",checked:c==="full",onChange:()=>d("full")})," Full — sender and message text or filename"]}),v.jsxs("label",{style:{display:"block",marginTop:7},children:[v.jsx("input",{type:"radio",name:"push-preview",checked:c==="private",onChange:()=>d("private")})," Private — generic content only"]})]}),v.jsx("p",{className:"muted",children:"Full previews can expose sender names, message text, and filenames on the lock screen. The push provider still sees delivery endpoint, timing, and payload size metadata in either mode."}),v.jsx("div",{style:{display:"flex",gap:8,flexWrap:"wrap"},children:e.push.status==="on"?v.jsxs(v.Fragment,{children:[v.jsx("button",{className:"btn",disabled:e.busy,onClick:()=>void e.onPushAction("disable",c),children:"Disable notifications"}),v.jsx("button",{className:"btn",disabled:e.busy,onClick:()=>void e.onPushAction("repair",c),children:"Repair"}),c!==e.push.preview&&v.jsx("button",{className:"btn primary",disabled:e.busy,onClick:()=>void e.onPushAction("enable",c),children:"Save preview"})]}):v.jsx("button",{className:"btn primary",disabled:e.busy||!e.workerSupported||e.push.status==="unsupported",onClick:()=>void e.onPushAction(e.push.status==="error"||e.push.blocked?"repair":"enable",c),children:e.busy?"Repairing…":e.push.status==="error"||e.push.blocked?"Repair":"Enable notifications"})})]}),v.jsxs("div",{style:{borderTop:"1px solid var(--line)",paddingTop:16},children:[v.jsx("h4",{children:"App status"}),v.jsx("p",{className:"muted",children:e.offline?"Offline — reconnecting. Message and identity data are never cached.":"Online."}),e.onInstall&&v.jsx("button",{className:"btn",onClick:e.onInstall,children:"Install app"}),e.updateAvailable&&v.jsx("button",{className:"btn primary",onClick:e.onReloadUpdate,children:"Reload to update"})]}),v.jsxs("div",{style:{borderTop:"1px solid var(--line)",paddingTop:16},children:[v.jsx("h4",{children:"Build"}),v.jsx("input",{className:"field mono",readOnly:!0,value:e.build?`${e.build.version} · ${e.build.sha}`:"Loading…"})]})]})}function Dz(e,t,n,r,s=6e4){return!t||!t.sha?"current":t.sha===e?(n.remoteSha=null,n.firstMismatchAt=null,"current"):(n.remoteSha=t.sha,(n.firstMismatchAt===null||n.firstMismatchAt===void 0)&&(n.firstMismatchAt=r),n.controllerChanged?"newer-available":r-n.firstMismatchAt>=s?"stuck":"newer-available")}const Oz="1ebbcbfe94eaf25c0cbca8c99cac631ab907854c",Fz=15*6e4,Vz=6e4,zz=Dz;async function Bz(){try{const e=await fetch(gr("/version.json"),{cache:"no-store"});return e.ok?await e.json():null}catch{return null}}function Uz(e){const t={remoteSha:null,firstMismatchAt:null,controllerChanged:!1},n=()=>{t.controllerChanged=!0};navigator.serviceWorker?.addEventListener("controllerchange",n);let r=!1;const s=async()=>{const d=await Bz(),h=zz(Oz,d,t,Date.now(),Vz);h==="newer-available"?(e.onUpdateAvailable(),navigator.serviceWorker?.getRegistration().then(p=>p?.update())):h==="stuck"&&!r&&(r=!0,e.onStuck(d.sha))},a=setTimeout(()=>void s(),5e3),l=setInterval(()=>void s(),Fz),c=()=>{document.visibilityState==="visible"&&s()};return document.addEventListener("visibilitychange",c),()=>{clearTimeout(a),clearInterval(l),document.removeEventListener("visibilitychange",c),navigator.serviceWorker?.removeEventListener("controllerchange",n)}}async function $z(e){try{const t=await navigator.serviceWorker.getRegistrations();await Promise.all(t.map(r=>r.unregister()));const n=await caches.keys();await Promise.all(n.map(r=>caches.delete(r)))}catch{}return location.replace(location.pathname+"?v="+encodeURIComponent(e)),new Promise(()=>{})}function Hz(){const e=new URL(location.href);e.searchParams.has("v")&&(e.searchParams.delete("v"),history.replaceState(null,"",e.pathname+e.search+e.hash))}const rw=[0,100,400,1e3,3e3,6e3],iw=e=>new Promise(t=>setTimeout(t,e)),sw={delivered:1,read:2},ow="ours-dark-v3",aw="#chat-message-",lw=Ru,Wz=e=>e instanceof Error&&e.message?e.message:"The request could not be completed.";function eb(e,t){const n=new Map,r=[];for(const s of e?.messages??[]){const a={dir:s.dir,text:s.text,date:s.date,read:s.read,wireId:s.wire_id,replyTo:s.reply_to?{wireId:s.reply_to.wire_id}:null,peerCid:s.peer_cid,receipt:s.receipt??void 0,receiptless:s.dir==="out"&&!s.wire_id,messageKind:s.message_kind,typed:s.typed};s.wire_id?n.set(s.wire_id,a):r.push(a)}for(const s of t){const a=n.get(s.wire_id);n.set(s.wire_id,{dir:s.dir,text:"",date:s.date,read:a?.read??s.dir==="out",wireId:s.wire_id,replyTo:s.reply_to?{wireId:s.reply_to.wire_id}:a?.replyTo??null,kind:"file",filename:s.filename,mime:s.mime,receipt:a?.receipt})}return[...r,...n.values()].sort((s,a)=>{const l=lw(s.date)-lw(a.date);return l===0?s.wireId.localeCompare(a.wireId):l})}function qz(e){const t={};for(const n of Object.values(e.roots??{}))t[n.root_cid]={label:n.root_name,note:"Verified identity"};return t}function Gz(e,t){return[...e.contacts.contacts.map(r=>{const s=e.contacts.roots?.[r.container_id],a=ur(e,r.container_id),c=eb(a,t[r.container_id]??[]).at(-1),d=Iu(r);return{id:r.container_id,name:d,announcedName:r.name,initials:wh(d),when:c?bI(c.date):"",activityAt:c?.date??"",last:c?.kind==="file"?NI(c.filename,c.mime):a?.preview??c?.text??"",unread:a?.unread??0,status:"active",root:s?.root_cid??null,sub:s?`role “${s.role_id}” of ${s.root_name}`:"",roleId:s?.role_id??null,rootName:s?.root_name??null,mine:!1,kind:s?"agent":"person"}}),...e.contacts.pending.map(r=>{const s=Iu(r);return{id:`pending:${r.container_id}`,name:s,announcedName:r.name,initials:wh(s),when:"",activityAt:"",last:`${r.queued} queued · approval required`,unread:0,status:"pending",root:null,sub:"",roleId:null,rootName:null,mine:!1,kind:"person"}})]}function Kz(){return v.jsx(Xz,{})}function Xz(){const e=S.useRef(uA(cf(window.location.pathname))).current,[t,n]=S.useReducer(v0,e),[r,s]=S.useState(null),a=S.useRef(0),l=S.useRef(null),c=S.useRef(t),d=S.useRef(new sA),h=S.useRef(null),p=S.useRef(new Map),m=S.useRef(new Map),[y,w]=S.useState({}),k=S.useRef(y),[b,E]=S.useState(null),P=S.useRef(new Set),[R,_]=S.useState(null),j=S.useRef(R),A=S.useRef(!1),[N,q]=S.useState([]),[B,D]=S.useState(null),[I,U]=S.useState(()=>localStorage.getItem(ow)!=="0"),[z,he]=S.useState(null),[J,Z]=S.useState({supported:!1,offline:!navigator.onLine,updateAvailable:!1,registration:null}),[ve,Se]=S.useState({status:"unsupported",preview:"full"}),[Q,pe]=S.useState(!1),T=S.useRef(!1),[F,X]=S.useState(()=>window.location.hash.startsWith(aw)),{toasts:M,push:oe,dismiss:ue,clear:ae}=Rz(),me=S.useCallback(H=>{c.current=v0(c.current,H),n(H)},[]),ke=S.useCallback(H=>{A.current=H},[]);S.useEffect(()=>{c.current=t},[t]),j.current=R,k.current=y,S.useMemo(()=>(R0(Object.values(y).flat()),null),[y]),S.useEffect(()=>(document.documentElement.classList.toggle("theme-dark",I),()=>document.documentElement.classList.remove("theme-dark")),[I]);const xe=S.useCallback(H=>me({type:"error",message:Wz(H)}),[me]),$e=S.useCallback(()=>{const H=c.current;return{visibility:document.visibilityState,appRoute:H.route.name==="chats"?"chats":"other",selectedContactCid:lr(H),desktopLayout:h.current?.matches??window.innerWidth>=861,mobileDetailOpen:H.mobileDetailOpen,conversationCoveringDialogOpen:j.current!==null}},[]),Fe=S.useCallback(async(H,ge=!0)=>{try{const ie=await Xe.conversation(H);return me({type:"page",contactCid:H,page:ie}),ie}catch(ie){return ge&&xe(ie),null}},[me,xe]),qe=S.useCallback(async(H,ge=!0)=>{try{const ie=await Xe.files(H);return R0(ie.files),w(ye=>({...ye,[H]:ie.files})),ie.files}catch(ie){return ge&&xe(ie),null}},[xe]);S.useEffect(()=>Uz({onUpdateAvailable:()=>Z(H=>({...H,updateAvailable:!0})),onStuck:H=>{$z(H)}}),[]);const st=S.useCallback(async()=>{const H=await Xe.contacts();return me({type:"contacts",contacts:{...H,pending:H.pending??[]}}),H},[me]),ot=S.useCallback(async()=>{try{const[H,ge,ie]=await Promise.all([Xe.identity(),Xe.contacts(),Xe.buildInfo()]),ye={...ge,pending:ge.pending??[]};return c.current.identity&&c.current.identity.cid!==H.cid&&(AI(),k.current={},w({})),me({type:"snapshot",identity:H,contacts:ye}),D(ie),await Promise.all(ye.contacts.flatMap(Le=>[Fe(Le.container_id,!1),qe(Le.container_id,!1)])),lr(c.current)}catch(H){return xe(H),null}},[me,qe,Fe,xe]),Vt=S.useCallback(async H=>{await d.current.request(H,async()=>{iA(H,$e())&&(await Xe.markRead(H),await Promise.all([Fe(H),st()]))}).catch(xe)},[$e,st,Fe,xe]),en=S.useCallback(async H=>{const ge=++a.current;l.current?.abort();const ie=new AbortController;l.current=ie,s(null),ae(H),qe(H,!1);let ye;try{ye=await Xe.conversation(H,void 0,ie.signal)}catch(ht){ie.signal.aborted||xe(ht);return}if(ie.signal.aborted||ge!==a.current)return;me({type:"page",contactCid:H,page:ye});const Le=ye.unread;let fe=[...ye.messages],Ge=ye.nextBefore;const wt=new Set,dt=new Set(fe.map(ht=>ht.wire_id).filter(Boolean)),Je=()=>fe.filter(ht=>ht.dir==="in"&&!ht.read);for(;Je().length<Le&&Ge&&!wt.has(Ge);){wt.add(Ge);let ht;try{ht=await Xe.conversation(H,Ge,ie.signal)}catch{break}if(ie.signal.aborted||ge!==a.current)return;const qt=ht.messages.filter(Tt=>!Tt.wire_id||!dt.has(Tt.wire_id));if(!qt.length&&ht.nextBefore===Ge)break;for(const Tt of qt)Tt.wire_id&&dt.add(Tt.wire_id);fe=[...qt,...fe],me({type:"older_page",contactCid:H,page:ht,newer:ye.messages}),Ge=ht.nextBefore}const yt=Je()[0];yt?.wire_id&&ge===a.current&&!ie.signal.aborted&&s({contactCid:H,wireId:yt.wire_id,count:Le}),await Vt(H)},[ae,me,Vt,qe,xe]),et=S.useCallback(async(H,ge,ie="page")=>{const ye=`page:${H}:${ie}`,Le=(p.current.get(ye)??0)+1;p.current.set(ye,Le);for(const fe of rw){if(fe&&await iw(fe),p.current.get(ye)!==Le)return;const Ge=await Fe(H,!1);if(Ge&&ge(Ge))return}},[Fe]),Wt=S.useCallback(async(H,ge)=>{const ie=`file:${H}`,ye=(p.current.get(ie)??0)+1;p.current.set(ie,ye);for(const Le of rw)if(Le&&await iw(Le),p.current.get(ie)!==ye||(await qe(H,!1))?.some(Ge=>Ge.wire_id===ge))return},[qe]),Tn=S.useRef(!1);S.useEffect(()=>{if(!F||!t.loaded)return;const H=decodeURIComponent(window.location.hash.slice(aw.length)),ge=lr(c.current);if(!H||!ge){X(!1);return}if(ur(c.current,ge)?.messages.some(ie=>ie.wire_id===H)){X(!1);return}Tn.current||(Tn.current=!0,et(ge,ie=>ie.messages.some(ye=>ye.wire_id===H),`anchor:${H}`).catch(()=>{}).finally(()=>X(!1)))},[F,et,t.loaded,t.pages]),S.useMemo(()=>(RI({url:H=>Object.values(k.current).flat().find(ie=>ie.wire_id===H)?.available?Xe.mediaUrl(H):null,bytes:async H=>{if(!Object.values(k.current).flat().find(ye=>ye.wire_id===H)?.available)return null;const ie=await fetch(Xe.mediaUrl(H),{cache:"no-store",credentials:"same-origin"});if(!ie.ok)throw new Error(`Media request failed (HTTP ${ie.status})`);return new Uint8Array(await ie.arrayBuffer())},fetch:async H=>{const ge=Object.values(k.current).flat().find(ie=>ie.wire_id===H);if(!ge)throw new Error("Media record is unavailable");await Xe.fetchFiles([H]),await qe(ge.contact_id)}}),null),[qe]),S.useEffect(()=>{let H;fA(ie=>{Z(ie),S0(ie.registration).then(Se).catch(()=>Se(ye=>({...ye,status:"error"})))},{shouldDeferReload:()=>A.current||j.current!==null}).then(ie=>{H=ie}).catch(xe);const ge=ie=>{ie.preventDefault(),he(ie)};return window.addEventListener("beforeinstallprompt",ge),()=>{H?.(),window.removeEventListener("beforeinstallprompt",ge)}},[xe]),S.useEffect(()=>wA(),[]),S.useEffect(()=>{if(!(!J.registration||ve.status!=="on"))return rA({registration:J.registration,identity:Xe.identity,onEvent:G1})},[ve.status,ve.bindingId,J.registration]),S.useEffect(()=>{const H=()=>Se(ge=>({...ge,status:"error"}));return window.addEventListener("ours-push-repair-required",H),()=>window.removeEventListener("ours-push-repair-required",H)},[]),S.useEffect(()=>{window.location.pathname===Rp()&&window.history.replaceState(null,"",ri()),h.current=window.matchMedia("(min-width: 861px)");const H=()=>{const fe=cf(window.location.pathname);l.current?.abort(),a.current+=1,s(null),me({type:"route",route:fe}),T.current&&fe.name==="chats"&&fe.contactCid&&(T.current=!1,requestAnimationFrame(()=>document.querySelector("[data-contact-trigger]")?.focus({preventScroll:!0}))),fe.name==="chats"&&fe.contactCid&&en(fe.contactCid)},ge=()=>{if(document.visibilityState!=="visible")return;const fe=lr(c.current);fe&&Vt(fe),Q1(),J.registration&&S0(J.registration).then(Se).catch(()=>Se(Ge=>({...Ge,status:"error"})))};window.addEventListener("popstate",H),document.addEventListener("visibilitychange",ge);const ie=fe=>{const Ge=fe.type==="sync_required"?`${fe.type}:${fe.reason}`:fe.type==="receipt_received"?`${fe.type}:${fe.contact_id}:${fe.kind}:${fe.wire_ids.join(",")}`:`${fe.type}:${fe.contact_id}:${fe.wire_id}`,wt=Date.now(),dt=m.current.get(Ge)??0;m.current.set(Ge,wt);for(const[Je,yt]of m.current)wt-yt>6e4&&m.current.delete(Je);wt-dt<6e4||(async()=>{if(fe.type==="sync_required"){await ot();return}if(st().catch(xe),fe.type==="file_received"){await Wt(fe.contact_id,fe.wire_id);const Je=c.current.contacts.contacts.find(yt=>yt.container_id===fe.contact_id);lr(c.current)!==fe.contact_id&&Je&&oe(fe.contact_id,Iu(Je),"New file");return}if(fe.type==="message_received"){const Je=c.current.contacts.contacts.find(yt=>yt.container_id===fe.contact_id);await et(fe.contact_id,yt=>yt.messages.some(ht=>ht.wire_id===fe.wire_id),`message:${fe.wire_id}`),lr(c.current)===fe.contact_id?await Vt(fe.contact_id):Je&&oe(fe.contact_id,Iu(Je),"New message");return}me({type:"receipt",contactCid:fe.contact_id,kind:fe.kind,wireIds:fe.wire_ids}),await et(fe.contact_id,Je=>fe.wire_ids.every(yt=>{const ht=Je.messages.find(qt=>qt.wire_id===yt);return!!ht?.receipt&&sw[ht.receipt]>=sw[fe.kind]}),`receipt:${fe.wire_ids.join(",")}`)})().catch(xe)},ye=ZR(ie),Le=eA(ie,fe=>me({type:"connection",connection:fe}));return ot().then(fe=>{fe&&en(fe)}),()=>{Le(),ye(),window.removeEventListener("popstate",H),document.removeEventListener("visibilitychange",ge)}},[et,Wt,me,Vt,en,oe,st,ot,xe,J.registration]);const zt=(H,ge,ie)=>{window.history.pushState({oursMessenger:!0},"",ge),me({type:"route",route:H,mobileDetailOpen:ie})},tn=async H=>{zt({name:"chats",contactCid:H},ri(H),!0),await en(H)},bt=async H=>{const ge=ur(c.current,H);if(!(!ge?.nextBefore||P.current.has(H))){P.current.add(H),E(H);try{const ie=await Xe.conversation(H,ge.nextBefore);me({type:"older_page",contactCid:H,page:ie,newer:ge.messages})}catch(ie){xe(ie)}finally{P.current.delete(H),E(null)}}},tr=S.useCallback(async(H,ge)=>{const ie=c.current,ye=lr(ie);if(!ye)return"unavailable";const Le=ur(ie,ye);if(!Le)return"unavailable";if(Le.messages.some(dt=>dt.wire_id===H))return"found";let fe=Le.nextBefore;const Ge=new Set;let wt=[...Le.messages];for(let dt=0;fe&&!Ge.has(fe)&&dt<10;dt++){Ge.add(fe);const Je=await Xe.conversation(ye,fe,ge);if(ge.aborted||c.current.identity?.cid!==ie.identity?.cid||lr(c.current)!==ye)return"unavailable";if(wt=[...Je.messages,...wt],Je.messages.some(yt=>yt.wire_id===H))return me({type:"older_page",contactCid:ye,page:Je,newer:wt}),"found";fe=Je.nextBefore}return fe?"limit":"unavailable"},[me]),He=lr(t),jr=t.contacts.contacts.find(H=>H.container_id===He),Y=S.useMemo(()=>Gz(t,y),[t,y]),ee=Y.find(H=>H.id===He)??null,Te=He?eb(ur(t,He),y[He]??[]):[],Ae=t.identity;S.useEffect(()=>{if(!t.loaded)return;const H=cf(window.location.pathname),ge=H.name==="chats"||H.name==="contact"?H.contactCid:null;!ge||t.contacts.contacts.some(ie=>ie.container_id===ge)||(window.history.replaceState({oursMessenger:!0},"",ri()),r?.contactCid===ge&&(l.current?.abort(),a.current+=1,s(null)))},[t.loaded,t.contacts.contacts,r]);const Ve=t.loaded?He&&!ur(t,He)||F?"updating":t.connection!=="live"?"connecting":null:"connecting",at=async(H,ge=ve.preview)=>{if(J.registration){pe(!0),Se(ie=>({...ie,status:"repairing",preview:ge}));try{Se(await(H==="enable"?Y1(J.registration,{preview:ge}):H==="repair"?vA(J.registration,ge):xA(J.registration,ve)))}catch(ie){Se(ye=>({...ye,status:"error"})),xe(ie)}finally{pe(!1)}}},Nt=()=>{q([]),_("invite"),Xe.invites().then(q).catch(xe)};return t.route.name==="not_found"?v.jsxs("div",{className:"centered-screen",children:[v.jsx("h1",{children:"Page not found"}),v.jsx("button",{className:"btn primary",onClick:()=>zt({name:"chats",contactCid:null},ri()),children:"Open chats"})]}):Ae?v.jsx("div",{className:I?"theme-dark":"",style:{height:"100%"},children:v.jsxs("div",{className:"app signal-app",children:[v.jsxs("main",{className:"section signal-stage"+(t.mobileDetailOpen?" show-detail":""),children:[v.jsx(wz,{contacts:Y,roots:qz(t.contacts),selected:He,onSelect:H=>{H.startsWith("pending:")||tn(H)},onInvite:Nt,onSettings:()=>_("settings"),onApprovePending:async H=>{try{return await Xe.respondToIntroduction(H,"approve"),await ot(),!0}catch(ge){return xe(ge),!1}},onRejectPending:async H=>{try{return await Xe.respondToIntroduction(H,"reject"),await ot(),!0}catch(ge){return xe(ge),!1}}}),t.route.name==="contact"&&ee?v.jsx(Sz,{contact:ee,messages:Te,onBack:()=>{T.current=!0,aA(window.history.state)==="back"?window.history.back():(window.history.replaceState({oursMessenger:!0},"",ri(ee.id)),me({type:"route",route:{name:"chats",contactCid:ee.id},mobileDetailOpen:!0}),requestAnimationFrame(()=>document.querySelector("[data-contact-trigger]")?.focus({preventScroll:!0})),T.current=!1)},onRename:H=>void Xe.renameContact(ee.id,H).then(ot).catch(xe),onRemove:()=>{confirm(`Remove “${jr?.name??"contact"}”?`)&&Xe.removeContact(ee.id).then(()=>(window.history.replaceState({oursMessenger:!0},"",ri()),me({type:"route",route:{name:"chats",contactCid:null},mobileDetailOpen:!1}),ot())).catch(xe)},onOpenMessage:H=>{zt({name:"chats",contactCid:ee.id},ri(ee.id),!0);let ge=12;const ie=()=>{const ye=document.getElementById(`chat-message-${encodeURIComponent(H)}`),Le=ye?.closest(".messages");if((!ye||!Le||Le.clientHeight<=0)&&ge-- >0){requestAnimationFrame(ie);return}if(!ye||!Le)return;const fe=ye.getBoundingClientRect(),Ge=Le.getBoundingClientRect(),wt=Le.scrollTop+fe.top-Ge.top-Math.max(0,(Le.clientHeight-fe.height)/2),dt=Math.max(0,Math.min(wt,Le.scrollHeight-Le.clientHeight));Le.scrollTo({top:dt,behavior:window.matchMedia("(prefers-reduced-motion: reduce)").matches?"auto":"smooth"})};requestAnimationFrame(ie)},indexOffset:ur(t,ee.id)?.hasMore?Math.max(1,(ur(t,ee.id)?.total??Te.length)-Te.length):0,onSendText:async(H,ge)=>{const ie=await Xe.send(ee.id,H,ge);return await Fe(ee.id,!1),ie.wire_id??void 0},onSendFile:async(H,ge)=>{await Xe.sendFile(ee.id,new Blob([H.bytes],{type:H.mime}),H.filename,H.mime,ge),await Promise.all([qe(ee.id),Fe(ee.id,!1)])}}):v.jsx(Cz,{contact:ee,messages:Te,syncing:Ve,unreadOpen:r?.contactCid===He?r:null,hiddenEarlier:ur(t,He??"")?.hasMore?Math.max(1,(ur(t,He??"")?.total??Te.length)-Te.length):0,onRevealMessage:tr,onLoadEarlier:He&&b!==He?()=>void bt(He):void 0,onBack:()=>{l.current?.abort(),a.current+=1,s(null),zt({name:"chats",contactCid:null},ri(),!1)},onOpenContact:()=>{He&&zt({name:"contact",contactCid:He},oA(He),!0)},onDraftChange:ke,onSend:async(H,ge,ie)=>{if(!He)return;const ye=He,Le=await Xe.send(ye,H,ge,ie);return me({type:"sent_message",contactCid:ye,message:{dir:"out",text:H,date:new Date().toISOString(),read:!0,wire_id:Le.wire_id??"",receipt:null,reply_to:ge?{wire_id:ge}:null}}),Le.wire_id?et(ye,fe=>fe.messages.some(Ge=>Ge.wire_id===Le.wire_id),`send:${Le.wire_id}`):st().catch(xe),Le.wire_id??void 0},onLoadCommands:async(H,ge)=>Xe.commands(H,ge),onSendCommand:async(H,ge,ie,ye,Le,fe)=>{const Ge=await Xe.sendCommand(H,ge,ie,ye,Le,fe);return Fe(H,!1),Ge},onSendFile:async(H,ge)=>{He&&(await Xe.sendFile(He,new Blob([H.bytes],{type:H.mime}),H.filename,H.mime,ge),await Promise.all([qe(He),Fe(He,!1)]))},onFetchFile:async H=>{await Xe.fetchFiles([H]),He&&await qe(He)}},He??"no-conversation")]}),v.jsxs("div",{className:"app-banners",children:[J.offline&&v.jsx("div",{className:"banner warn",role:"status","aria-live":"polite",children:"Offline — reconnecting to the network…"}),t.connection!=="live"&&v.jsx("div",{className:"banner warn",role:"status","aria-live":"polite",children:t.connection==="retrying"?"Live updates interrupted — reconnecting…":"Connecting to live updates…"}),J.updateAvailable&&v.jsxs("div",{className:"banner info",children:[v.jsx("span",{role:"status","aria-live":"polite",children:"A new version is available."}),v.jsx("span",{className:"banner-actions",children:v.jsx("button",{className:"linkbtn",onClick:()=>{J.registration&&x0(J.registration)},children:"Restart now"})})]}),v.jsx(Iz,{items:M,onDismiss:ue,onOpen:H=>void tn(H)})]}),R==="invite"&&v.jsx(Lz,{identity:Ae,invites:N,onRefresh:async()=>q(await Xe.invites()),onCreate:async(H,ge)=>(await Xe.createInvite(H,ge)).blob,onAccept:async(H,ge)=>{await Xe.addContact(H,ge),await ot()},onRevoke:async H=>{await Xe.revokeInvite(H)},onClose:()=>{_(null),ot()}}),R==="settings"&&v.jsx(jz,{identity:Ae,push:ve,workerSupported:J.supported,busy:Q,offline:J.offline,updateAvailable:J.updateAvailable,build:B,dark:I,onToggleDark:()=>U(H=>(localStorage.setItem(ow,H?"0":"1"),!H)),onSaveBio:async H=>{await Xe.setBio(H),await ot()},onPushAction:at,onInstall:z?()=>void z.prompt().then(()=>he(null)):void 0,onReloadUpdate:()=>{J.registration&&x0(J.registration)},onClose:()=>{j.current=null,_(null),He&&Vt(He)}}),t.error&&v.jsxs("div",{className:"banner error",role:"alert","aria-live":"assertive",children:[t.error,v.jsx("button",{className:"linkbtn",onClick:()=>me({type:"error",message:null}),children:"dismiss"})]})]})}):v.jsx("div",{className:I?"theme-dark":"",style:{height:"100%"},children:v.jsx("div",{className:"centered-screen",children:v.jsx("p",{className:"muted",children:"Loading…"})})})}Hz();const tb=document.getElementById("root");if(!tb)throw new Error("missing #root");YE.createRoot(tb).render(v.jsx(GT,{reducedMotion:"user",children:v.jsx(Kz,{})}));export{fm as _,Zh as g};
332
- //# sourceMappingURL=index-BAN62UdD.js.map