@maudecode/kanvil 0.5.1 → 0.7.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 (137) hide show
  1. package/apps/server/dist/{auth-Bm6cIseE.mjs → auth-D43XyHdK.mjs} +266 -68
  2. package/apps/server/dist/client.mjs +2 -2
  3. package/apps/server/dist/{config-CrJuk5mY.mjs → config-CQVdVhXv.mjs} +1 -1
  4. package/apps/server/dist/index.mjs +167 -45
  5. package/apps/server/dist/migrate.mjs +1 -1
  6. package/apps/server/dist/recover.mjs +3 -3
  7. package/apps/server/dist/{src-D80LNZKP.mjs → src-D70GmZ5R.mjs} +170 -28
  8. package/apps/server/drizzle/0039_intake_credential.sql +2 -0
  9. package/apps/server/drizzle/0040_upload_urls.sql +20 -0
  10. package/apps/server/drizzle/0041_project_repositories.sql +2 -0
  11. package/apps/server/drizzle/meta/0039_snapshot.json +7020 -0
  12. package/apps/server/drizzle/meta/0040_snapshot.json +7170 -0
  13. package/apps/server/drizzle/meta/0041_snapshot.json +7183 -0
  14. package/apps/server/drizzle/meta/_journal.json +21 -0
  15. package/apps/web/dist/assets/{CompositeItem-Tueq2VKR.js → CompositeItem-DLTRsada.js} +1 -1
  16. package/apps/web/dist/assets/{Trans-BgU0eWAX.js → Trans-DqX-qhvQ.js} +1 -1
  17. package/apps/web/dist/assets/admin-settings-BQzdZII5.js +1 -0
  18. package/apps/web/dist/assets/{archive-restore-CSpoH6mS.js → archive-restore-BO1qng5Y.js} +1 -1
  19. package/apps/web/dist/assets/az-AZ-SXqDBPA2.js +1 -0
  20. package/apps/web/dist/assets/{az-DUcDY8Bp.js → az-CEW7-a7J.js} +1 -1
  21. package/apps/web/dist/assets/configuration-D0zvwrXt.js +1 -0
  22. package/apps/web/dist/assets/{corner-left-up-C3OGlXIB.js → corner-left-up-Be7Z9Uhf.js} +1 -1
  23. package/apps/web/dist/assets/{de-89C1V8Ut.js → de-B-oGVMYL.js} +1 -1
  24. package/apps/web/dist/assets/de-DE-CB7aQ6b-.js +1 -0
  25. package/apps/web/dist/assets/default-CCI1vZxa.js +56 -0
  26. package/apps/web/dist/assets/delivery-settings-BrwSrFIN.js +1 -0
  27. package/apps/web/dist/assets/{el-D6CICkhi.js → el-Cp69kezM.js} +1 -1
  28. package/apps/web/dist/assets/el-GR-D1ntYXIt.js +1 -0
  29. package/apps/web/dist/assets/{ellipsis-lJJU8zB7.js → ellipsis-B0AE8ax3.js} +1 -1
  30. package/apps/web/dist/assets/{es-B20Izib2.js → es-CwOMVSTx.js} +1 -1
  31. package/apps/web/dist/assets/es-ES-CllsaxcB.js +1 -0
  32. package/apps/web/dist/assets/{forms--87R7VQW.js → forms-CkVpTx29.js} +1 -1
  33. package/apps/web/dist/assets/{fr-DVlGnGsu.js → fr-Cy4co9ic.js} +1 -1
  34. package/apps/web/dist/assets/fr-FR-DxTw6LgI.js +1 -0
  35. package/apps/web/dist/assets/{hi-D1F5Pi_I.js → hi-DbO9TKwg.js} +1 -1
  36. package/apps/web/dist/assets/hi-IN-CaQga-0l.js +1 -0
  37. package/apps/web/dist/assets/{highlight-ygDJPvRy.js → highlight-zMg1BK-r.js} +1 -1
  38. package/apps/web/dist/assets/{id-LESXKW7G.js → id-B6NKsmCm.js} +1 -1
  39. package/apps/web/dist/assets/id-ID-DBfwAAqU.js +1 -0
  40. package/apps/web/dist/assets/index-CZuFd4LM.js +17 -0
  41. package/apps/web/dist/assets/index-DPT5LAs1.css +2 -0
  42. package/apps/web/dist/assets/invitations-Dp40BfHj.js +1 -0
  43. package/apps/web/dist/assets/it-IT-BckuH9Nl.js +1 -0
  44. package/apps/web/dist/assets/{it-CgRGAs6u.js → it-ilGYCq2T.js} +1 -1
  45. package/apps/web/dist/assets/item-DQR89bKm.js +1 -0
  46. package/apps/web/dist/assets/{ja-B7arhzgX.js → ja-D-hJRTgP.js} +1 -1
  47. package/apps/web/dist/assets/ja-JP-BAGgJKZ4.js +1 -0
  48. package/apps/web/dist/assets/ko-KR-srIEsTP5.js +1 -0
  49. package/apps/web/dist/assets/{ko-Ro_UonyA.js → ko-ajkkoJ_d.js} +1 -1
  50. package/apps/web/dist/assets/label-settings-ChnKkA97.js +1 -0
  51. package/apps/web/dist/assets/{markdown-blocks-toSPlHSc.js → markdown-blocks-CpzrwyQG.js} +1 -1
  52. package/apps/web/dist/assets/member-directory-XK0ZEGUq.js +1 -0
  53. package/apps/web/dist/assets/{mk-DR3kmrIp.js → mk-C_sMyEHX.js} +1 -1
  54. package/apps/web/dist/assets/mk-MK-BTa1NMAF.js +1 -0
  55. package/apps/web/dist/assets/{nl-D3uRJJLT.js → nl-D9-P4UPR.js} +1 -1
  56. package/apps/web/dist/assets/nl-NL-CQduhDqs.js +1 -0
  57. package/apps/web/dist/assets/{pl-CtzDOLdV.js → pl-CiQM7fSB.js} +1 -1
  58. package/apps/web/dist/assets/pl-PL-BdZMf7Ni.js +1 -0
  59. package/apps/web/dist/assets/project-lifecycle-VYecJuiP.js +1 -0
  60. package/apps/web/dist/assets/project-settings-Bs6YEpo9.js +1 -0
  61. package/apps/web/dist/assets/{pt-BR-FarXHHuf.js → pt-BR-CP7dhuqF.js} +1 -1
  62. package/apps/web/dist/assets/pt-BR-DZEXJNHg.js +1 -0
  63. package/apps/web/dist/assets/public-project-DUfWDao9.js +1 -0
  64. package/apps/web/dist/assets/{rotate-ccw-Byx7O3RH.js → rotate-ccw-Cxh9ec2s.js} +1 -1
  65. package/apps/web/dist/assets/{ru-DHMEVxvB.js → ru-DxJ6vF4E.js} +1 -1
  66. package/apps/web/dist/assets/ru-RU-CZKEe7P8.js +1 -0
  67. package/apps/web/dist/assets/search-DfbsqO7M.js +85 -0
  68. package/apps/web/dist/assets/{send-DlGV2XQS.js → send-DrJl0BKm.js} +1 -1
  69. package/apps/web/dist/assets/settings-BN8uIiBG.js +1 -0
  70. package/apps/web/dist/assets/{sliders-horizontal-CEHGGft_.js → sliders-horizontal-DM47MLe7.js} +1 -1
  71. package/apps/web/dist/assets/switch-CJTVGtE9.js +1 -0
  72. package/apps/web/dist/assets/{table-2AEfwytk.js → table-BLLjFPWD.js} +1 -1
  73. package/apps/web/dist/assets/ticket-detail-BTy_3JeU.js +2 -0
  74. package/apps/web/dist/assets/ticket-editor-Bb_lyxnJ.js +2 -0
  75. package/apps/web/dist/assets/ticket-list-Botp5qf5.js +6 -0
  76. package/apps/web/dist/assets/ticket-list-controls-Dmkno4pm.js +1 -0
  77. package/apps/web/dist/assets/{tr-CjdSDu0z.js → tr-9IkdRLIk.js} +1 -1
  78. package/apps/web/dist/assets/tr-TR-Y8wBLO8I.js +1 -0
  79. package/apps/web/dist/assets/{uk-C8od6u_H.js → uk-Btampsdw.js} +1 -1
  80. package/apps/web/dist/assets/uk-UA-CVpasGUS.js +1 -0
  81. package/apps/web/dist/assets/{upload-BeTAGU_W.js → upload-HARy4VC_.js} +1 -1
  82. package/apps/web/dist/assets/{useQueries-BtRgTciJ.js → useQueries-CTeEF--U.js} +1 -1
  83. package/apps/web/dist/assets/{vi-BwdBtgfS.js → vi-BVZzOn_n.js} +1 -1
  84. package/apps/web/dist/assets/vi-VN-BMy-iJD-.js +1 -0
  85. package/apps/web/dist/assets/visual-editor-DKBPjqV-.js +208 -0
  86. package/apps/web/dist/assets/workspace-settings-DqzBNw60.js +1 -0
  87. package/apps/web/dist/assets/{zh-CN-DM-UoFmL.js → zh-CN-BoUvF2do.js} +1 -1
  88. package/apps/web/dist/assets/zh-CN-Cds_v0R8.js +1 -0
  89. package/apps/web/dist/assets/{zh-TW-q2nrwFjt.js → zh-TW-CEIDGTWe.js} +1 -1
  90. package/apps/web/dist/assets/zh-TW-DCCYakXz.js +1 -0
  91. package/apps/web/dist/index.html +9 -9
  92. package/docs/api.md +35 -5
  93. package/docs/cli.md +1 -1
  94. package/docs/mobile.md +67 -4
  95. package/docs/releasing.md +6 -4
  96. package/package.json +1 -1
  97. package/apps/web/dist/assets/admin-settings-Ckis3XJG.js +0 -1
  98. package/apps/web/dist/assets/az-AZ-bFxpMMZN.js +0 -1
  99. package/apps/web/dist/assets/de-DE-BeXI30Ll.js +0 -1
  100. package/apps/web/dist/assets/default-Dnep8Yat.js +0 -56
  101. package/apps/web/dist/assets/delivery-settings-cMldZ9K7.js +0 -1
  102. package/apps/web/dist/assets/el-GR-SgRHlWhY.js +0 -1
  103. package/apps/web/dist/assets/es-ES-BF1J5vap.js +0 -1
  104. package/apps/web/dist/assets/fr-FR-D_sldwf6.js +0 -1
  105. package/apps/web/dist/assets/hi-IN-CfOw4TWf.js +0 -1
  106. package/apps/web/dist/assets/id-ID-CLKtHO7Q.js +0 -1
  107. package/apps/web/dist/assets/index-Bn-MADyj.css +0 -2
  108. package/apps/web/dist/assets/index-Ds3IHeIi.js +0 -17
  109. package/apps/web/dist/assets/invitations-C5WbdDUQ.js +0 -1
  110. package/apps/web/dist/assets/it-IT-eVZNW5qX.js +0 -1
  111. package/apps/web/dist/assets/item-BD1Poxfs.js +0 -1
  112. package/apps/web/dist/assets/ja-JP-D96njn-P.js +0 -1
  113. package/apps/web/dist/assets/ko-KR-Bash_ieA.js +0 -1
  114. package/apps/web/dist/assets/label-settings-BaikCfal.js +0 -1
  115. package/apps/web/dist/assets/member-directory-BjUy1KuK.js +0 -1
  116. package/apps/web/dist/assets/mk-MK-BWQWGIRx.js +0 -1
  117. package/apps/web/dist/assets/nl-NL-D1tvo0Gd.js +0 -1
  118. package/apps/web/dist/assets/pl-PL-DNgGUEcQ.js +0 -1
  119. package/apps/web/dist/assets/project-lifecycle-BBHcRi6p.js +0 -1
  120. package/apps/web/dist/assets/project-settings-BaYuxYjg.js +0 -1
  121. package/apps/web/dist/assets/pt-BR-CZsUZQ6P.js +0 -1
  122. package/apps/web/dist/assets/public-project-DGf3nkg2.js +0 -1
  123. package/apps/web/dist/assets/ru-RU-4ew92YE_.js +0 -1
  124. package/apps/web/dist/assets/search-DwsPEC4E.js +0 -85
  125. package/apps/web/dist/assets/settings-C_sN8Y1h.js +0 -1
  126. package/apps/web/dist/assets/switch-B_rsZYBf.js +0 -1
  127. package/apps/web/dist/assets/ticket-detail-C2l8nwF-.js +0 -2
  128. package/apps/web/dist/assets/ticket-editor-B0UB98HS.js +0 -2
  129. package/apps/web/dist/assets/ticket-list-D_MHudj1.js +0 -6
  130. package/apps/web/dist/assets/ticket-list-controls-jKg4i-NA.js +0 -1
  131. package/apps/web/dist/assets/tr-TR-CM381XCw.js +0 -1
  132. package/apps/web/dist/assets/uk-UA-AeOiWCVo.js +0 -1
  133. package/apps/web/dist/assets/vi-VN-td08xXv9.js +0 -1
  134. package/apps/web/dist/assets/visual-editor-CzB_qwvB.js +0 -208
  135. package/apps/web/dist/assets/workspace-settings-DOr9j8X1.js +0 -1
  136. package/apps/web/dist/assets/zh-CN-D3dhEYLS.js +0 -1
  137. package/apps/web/dist/assets/zh-TW-CfhOEFo8.js +0 -1
@@ -1,85 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/markdown-blocks-toSPlHSc.js","assets/rolldown-runtime-COiEfhsA.js","assets/default-Dnep8Yat.js","assets/core-jXc03Sty.js","assets/en-EnSRisMz.js","assets/preload-helper-BLdHbfdN.js","assets/highlight-ygDJPvRy.js"])))=>i.map(i=>d[i]);
2
- import{i as e,n as t,t as n}from"./rolldown-runtime-COiEfhsA.js";import{$t as r,An as i,B as a,Et as o,Jt as s,Kt as c,M as l,N as u,Nn as d,On as f,P as p,Q as m,Sn as h,V as g,Vt as _,W as v,Wt as y,X as b,Zt as x,_t as S,bn as C,bt as w,c as T,d as E,dt as D,ft as O,gt as k,ht as A,i as j,jn as M,kn as N,ln as P,lt as F,mn as I,mt as L,on as R,pt as z,r as B,rt as ee,sn as V,ut as te,wt as ne}from"./default-Dnep8Yat.js";import{t as H}from"./preload-helper-BLdHbfdN.js";import{t as re}from"./toDate-B3HYxwtT.js";var ie=n((e=>{var t=d();function n(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function r(){}var i={d:{f:r,r:function(){throw Error(n(522))},D:r,C:r,L:r,m:r,X:r,S:r,M:r},p:0,findDOMNode:null},a=Symbol.for(`react.portal`),o=Symbol.for(`react.recoverable`),s=Symbol.for(`react.optimistic_key`);function c(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:a,key:r==null?null:r===s?s:``+r,children:e,containerInfo:t,implementation:n}}var l=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function u(e,t){if(e===`font`)return``;if(typeof t==`string`)return t===`use-credentials`?t:``}e.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=i,e.browser=function(e){return{$$typeof:o,_reason:e}},e.createPortal=function(e,t){var r=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)throw Error(n(299));return c(e,t,null,r)},e.flushSync=function(e){var t=l.T,n=i.p;try{if(l.T=null,i.p=2,e)return e()}finally{l.T=t,i.p=n,i.d.f()}},e.preconnect=function(e,t){typeof e==`string`&&(t?(t=t.crossOrigin,t=typeof t==`string`?t===`use-credentials`?t:``:void 0):t=null,i.d.C(e,t))},e.prefetchDNS=function(e){typeof e==`string`&&i.d.D(e)},e.preinit=function(e,t){if(typeof e==`string`&&t&&typeof t.as==`string`){var n=t.as,r=u(n,t.crossOrigin),a=typeof t.integrity==`string`?t.integrity:void 0,o=typeof t.fetchPriority==`string`?t.fetchPriority:void 0;n===`style`?i.d.S(e,typeof t.precedence==`string`?t.precedence:void 0,{crossOrigin:r,integrity:a,fetchPriority:o}):n===`script`&&i.d.X(e,{crossOrigin:r,integrity:a,fetchPriority:o,nonce:typeof t.nonce==`string`?t.nonce:void 0})}},e.preinitModule=function(e,t){if(typeof e==`string`){if(typeof t==`object`&&t){if(t.as==null||t.as===`script`){var n=u(t.as,t.crossOrigin);i.d.M(e,{crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0})}}else t??i.d.M(e)}},e.preload=function(e,t){if(typeof e==`string`&&typeof t==`object`&&t&&typeof t.as==`string`){var n=t.as,r=u(n,t.crossOrigin);i.d.L(e,n,{crossOrigin:r,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,type:typeof t.type==`string`?t.type:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0,referrerPolicy:typeof t.referrerPolicy==`string`?t.referrerPolicy:void 0,imageSrcSet:typeof t.imageSrcSet==`string`?t.imageSrcSet:void 0,imageSizes:typeof t.imageSizes==`string`?t.imageSizes:void 0,media:typeof t.media==`string`?t.media:void 0})}},e.preloadModule=function(e,t){if(typeof e==`string`){if(t){var n=u(t.as,t.crossOrigin);i.d.m(e,{as:typeof t.as==`string`&&t.as!==`script`?t.as:void 0,crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0})}else i.d.m(e)}},e.requestFormReset=function(e){i.d.r(e)},e.unstable_batchedUpdates=function(e,t){return e(t)},e.useFormState=function(e,t,n){return l.H.useFormState(e,t,n)},e.useFormStatus=function(){return l.H.useHostTransitionStatus()},e.version=`19.3.1`})),ae=n(((e,t)=>{function n(){if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE==`function`)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=ie()})),U=e(d(),1),oe=e(ae(),1),se={default:`text-primary`,red:`text-red-500`,orange:`text-orange-500`,amber:`text-amber-500`,yellow:`text-yellow-600 dark:text-yellow-400`,lime:`text-lime-600 dark:text-lime-400`,green:`text-green-600 dark:text-green-400`,emerald:`text-emerald-600 dark:text-emerald-400`,teal:`text-teal-600 dark:text-teal-400`,cyan:`text-cyan-600 dark:text-cyan-400`,sky:`text-sky-500`,blue:`text-blue-500`,indigo:`text-indigo-500`,violet:`text-violet-500`,purple:`text-purple-500`,fuchsia:`text-fuchsia-500`,pink:`text-pink-500`,rose:`text-rose-500`,gray:`text-muted-foreground`},ce=e=>m(e)?I(`settings.color.${e}`):e;function le(e){return m(e)?{className:se[e]}:{style:{color:e}}}var W=B(),ue=U.createContext(void 0),de=e=>{let t=U.useContext(ue);if(e)return e;if(!t)throw Error(`No QueryClient set, use QueryClientProvider to set one`);return t},fe=({client:e,children:t})=>(U.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),(0,W.jsx)(ue.Provider,{value:e,children:t})),pe={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},G=new class{#e=pe;setTimeoutProvider(e){this.#e=e}setTimeout(e,t){return this.#e.setTimeout(e,t)}clearTimeout(e){this.#e.clearTimeout(e)}setInterval(e,t){return this.#e.setInterval(e,t)}clearInterval(e){this.#e.clearInterval(e)}};function me(e){setTimeout(e,0)}var he=typeof window>`u`||`Deno`in globalThis;function ge(){}function _e(e,t){return typeof e==`function`?e(t):e}function ve(e){return typeof e==`number`&&e>=0&&e!==1/0}function ye(e,t){return Math.max(e+(t||0)-Date.now(),0)}function be(e,t){return typeof e==`function`?e(t):e}function xe(e,t){let{type:n=`all`,exact:r,fetchStatus:i,predicate:a,queryKey:o,stale:s}=e;if(o){if(r){if(t.queryHash!==Ce(o,t.options))return!1}else if(!Te(t.queryKey,o))return!1}if(n!==`all`){let e=t.isActive();if(n===`active`&&!e||n===`inactive`&&e)return!1}return!(typeof s==`boolean`&&t.isStale()!==s||i&&i!==t.state.fetchStatus||a&&!a(t))}function Se(e,t){let{exact:n,status:r,predicate:i,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(n){if(we(t.options.mutationKey)!==we(a))return!1}else if(!Te(t.options.mutationKey,a))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function Ce(e,t){return(t?.queryKeyHashFn||we)(e)}function we(e){return JSON.stringify(e,(e,t)=>Ae(t)?Object.keys(t).sort().reduce((e,n)=>(e[n]=t[n],e),{}):t)}function Te(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(e&&t&&typeof e==`object`&&typeof t==`object`){if(Array.isArray(e)&&Array.isArray(t)){if(t.length>e.length)return!1;for(let n=0;n<t.length;n++)if(!Te(e[n],t[n]))return!1;return!0}let n=Object.keys(t);for(let r of n)if(!Te(e[r],t[r]))return!1;return!0}return!1}var Ee=Object.prototype.hasOwnProperty;function De(e,t,n=0){if(e===t)return e;if(n>500)return t;let r=ke(e)&&ke(t);if(!r&&!(Ae(e)&&Ae(t)))return t;let i=(r?e:Object.keys(e)).length,a=r?t:Object.keys(t),o=a.length,s=r?Array(o):{},c=0;for(let l=0;l<o;l++){let o=r?l:a[l],u=e[o],d=t[o];if(u===d){s[o]=u,(r?l<i:Ee.call(e,o))&&c++;continue}if(u===null||d===null||typeof u!=`object`||typeof d!=`object`){s[o]=d;continue}let f=De(u,d,n+1);s[o]=f,f===u&&c++}return i===o&&c===i?e:s}function Oe(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(let n in e)if(e[n]!==t[n])return!1;return!0}function ke(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Ae(e){if(!je(e))return!1;let t=Object.getPrototypeOf(e),n=t?.constructor;if(n===void 0)return!0;if(typeof n!=`function`)return!1;let r=n.prototype;return!(!je(r)||!r.hasOwnProperty(`isPrototypeOf`)||t!==Object.prototype)}function je(e){return Object.prototype.toString.call(e)===`[object Object]`}function Me(e){return new Promise(t=>{G.setTimeout(t,e)})}function Ne(e,t,n){return typeof n.structuralSharing==`function`?n.structuralSharing(e,t):n.structuralSharing===!1?t:De(e,t)}function Pe(e){return e}function Fe(e,t,n=0){let r=[...e,t];return n&&r.length>n?r.slice(1):r}function Ie(e,t,n=0){let r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var Le=Symbol();function Re(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===Le?()=>Promise.reject(Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function ze(e,t){return typeof e==`function`?e(...t):!!e}function Be(e,t,n){let r=!1,i;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(i??=t(),r||(r=!0,i.aborted?n():i.addEventListener(`abort`,n,{once:!0})),i)}),e}var Ve=()=>he,He=()=>Ve(),Ue=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},We=new class extends Ue{#e;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e();return window.addEventListener(`visibilitychange`,t,!1),()=>{window.removeEventListener(`visibilitychange`,t)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(e=>{typeof e==`boolean`?this.setFocused(e):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){let e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return typeof this.#e==`boolean`?this.#e:globalThis.document?.visibilityState!==`hidden`}},Ge=me;function Ke(){let e=[],t=0,n=e=>{e()},r=e=>{e()},i=Ge,a=r=>{t?e.push(r):i(()=>{n(r)})},o=()=>{let t=e;e=[],t.length&&i(()=>{r(()=>{t.forEach(e=>{n(e)})})})};return{batch:e=>{let n;t++;try{n=e()}finally{t--,t||o()}return n},batchCalls:e=>(...t)=>{a(()=>{e(...t)})},schedule:a,setNotifyFunction:e=>{n=e},setBatchNotifyFunction:e=>{r=e},setScheduler:e=>{i=e}}}var qe=Ke(),Je=new class extends Ue{#e=!0;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e(!0),n=()=>e(!1);return window.addEventListener(`online`,t,!1),window.addEventListener(`offline`,n,!1),()=>{window.removeEventListener(`online`,t),window.removeEventListener(`offline`,n)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#e!==e&&(this.#e=e,this.listeners.forEach(t=>{t(e)}))}isOnline(){return this.#e}};function Ye(e){return Math.min(1e3*2**e,3e4)}function Xe(e){return(e??`online`)!==`online`||Je.isOnline()}var Ze=class extends Error{constructor(e){super(`CancelledError`),this.revert=e?.revert,this.silent=e?.silent}};function Qe(e){let t=!1,n=0,r,i=`pending`,a,o,s=new Promise((e,t)=>{a=e,o=t});s.catch(ge);let c=()=>i!==`pending`,l=t=>{if(!c()){let n=new Ze(t);h(n),e.onCancel?.(n)}},u=()=>{t=!0},d=()=>{t=!1},f=()=>We.isFocused()&&(e.networkMode===`always`||Je.isOnline())&&e.canRun(),p=()=>Xe(e.networkMode)&&e.canRun(),m=e=>{c()||(r?.(),i=`resolved`,a(e))},h=e=>{c()||(r?.(),i=`rejected`,o(e))},g=t=>new Promise(n=>{r=e=>{(c()||t())&&n(e)},e.onPause?.()}).then(()=>{r=void 0,c()||e.onContinue?.()}),_=()=>{if(c())return;let r,i=n===0?e.initialPromise:void 0;try{r=i??e.fn()}catch(e){r=Promise.reject(e)}Promise.resolve(r).then(m).catch(r=>{if(c())return;let i=e.retry??(He()?0:3),a=e.retryDelay??Ye,o=typeof a==`function`?a(n,r):a,s=i===!0||typeof i==`number`&&n<i||typeof i==`function`&&i(n,r);t||!s?h(r):(n++,e.onFail?.(n,r),Me(o).then(()=>f()?void 0:g(f)).then(()=>{t?h(r):_()}))})};return{promise:s,status:()=>i,cancel:l,continue:()=>(r?.(),s),cancelRetry:u,continueRetry:d,canStart:p,start:()=>(p()?_():g(p).then(_),s)}}var $e=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),ve(this.gcTime)&&(this.#e=G.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(He()?1/0:3e5))}clearGcTimeout(){this.#e!==void 0&&(G.clearTimeout(this.#e),this.#e=void 0)}};function et(e){return{onFetch:(t,n)=>{let r=t.options,i=t.fetchOptions?.meta?.fetchMore?.direction,a=t.state.data?.pages||[],o=t.state.data?.pageParams||[],s={pages:[],pageParams:[]},c=0,l=async()=>{let n=!1,l=e=>{Be(e,()=>t.signal,()=>n=!0)},u=Re(t.options,t.fetchOptions),d=async(e,r,i)=>{if(n)return Promise.reject(t.signal.reason);if(r==null&&e.pages.length)return Promise.resolve(e);let a=(()=>{let e={client:t.client,queryKey:t.queryKey,pageParam:r,direction:i?`backward`:`forward`,meta:t.options.meta};return l(e),e})(),o=await u(a),{maxPages:s}=t.options,c=i?Ie:Fe;return{pages:c(e.pages,o,s),pageParams:c(e.pageParams,r,s)}};if(i&&a.length){let e=i===`backward`,t=e?nt:tt,n={pages:a,pageParams:o};s=await d(n,t(r,n),e)}else{let t=e??a.length;do{let e=c===0?o[0]??r.initialPageParam:tt(r,s);if(c>0&&e==null)break;s=await d(s,e),c++}while(c<t)}return s};t.fetchFn=t.options.persister?()=>t.options.persister?.(l,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n):l}}}function tt(e,{pages:t,pageParams:n}){let r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function nt(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}var rt=class extends $e{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e){super(),this.#s=!1,this.#o=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#i=e.client,this.#r=this.#i.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#t=ot(this.options),this.state=e.state??this.#t,this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return this.#e}get promise(){return this.#a?.promise}setOptions(e){if(this.options={...this.#o,...e},e?._type&&(this.#e=e._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){let e=ot(this.options);e.data!==void 0&&(this.setState(at(e.data,e.dataUpdatedAt)),this.#t=e)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus===`idle`&&this.#r.remove(this)}setData(e,t){let n=Ne(this.state.data,e,this.options);return this.#c({data:n,type:`success`,dataUpdatedAt:t?.updatedAt,manual:t?.manual}),n}setState(e){this.#c({type:`setState`,state:e})}cancel(e){let t=this.#a?.promise;return this.#a?.cancel(e),t?t.then(ge).catch(ge):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return this.#t}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(e=>be(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Le||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0&&this.observers.some(e=>be(e.options.staleTime,this)===`static`)}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e===`static`?!1:this.state.isInvalidated?!0:!ye(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(e=>e.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#a?.continue()}onOnline(){this.observers.find(e=>e.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#a?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#r.notify({type:`observerAdded`,query:this,observer:e}))}removeObserver(e){let t=this.observers.indexOf(e);t!==-1&&(this.observers.splice(t,1),this.observers.length||(this.#a&&(this.#s||this.state.fetchStatus===`paused`&&this.state.status===`pending`?this.#a.cancel({revert:!0}):this.#a.cancelRetry()),this.scheduleGc()),this.#r.notify({type:`observerRemoved`,query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#c({type:`invalidate`})}async fetch(e,t){if(this.state.fetchStatus!==`idle`&&this.#a?.status()!==`rejected`){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#a)return this.#a.continueRetry(),this.#a.promise}if(e&&this.setOptions(e),!this.options.queryFn){let e=this.observers.find(e=>e.options.queryFn);e&&this.setOptions(e.options)}let n=new AbortController,r=e=>{Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(this.#s=!0,n.signal)})},i=()=>{let e=Re(this.options,t),n=(()=>{let e={client:this.#i,queryKey:this.queryKey,meta:this.meta};return r(e),e})();return this.#s=!1,this.options.persister?this.options.persister(e,n,this):e(n)},a=(()=>{let e={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#i,state:this.state,fetchFn:i};return r(e),e})();(this.#e===`infinite`?et(this.options.pages):this.options.behavior)?.onFetch(a,this),this.#n=this.state,(this.state.fetchStatus===`idle`||this.state.fetchMeta!==a.fetchOptions?.meta)&&this.#c({type:`fetch`,meta:a.fetchOptions?.meta});let o=this.#a=Qe({initialPromise:t?.initialPromise,fn:a.fetchFn,onCancel:e=>{e instanceof Ze&&e.revert&&this.setState({...this.#n,fetchStatus:`idle`}),n.abort()},onFail:(e,t)=>{this.#c({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#c({type:`pause`})},onContinue:()=>{this.#c({type:`continue`})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0});try{let e=await o.start();if(e===void 0)throw Error(`${this.queryHash} data is undefined`);return this.setData(e),this.#r.config.onSuccess?.(e,this),this.#r.config.onSettled?.(e,this.state.error,this),e}catch(e){if(e instanceof Ze){if(e.silent)return this.#a.promise;if(e.revert){if(this.state.data===void 0)throw e;return this.state.data}}throw this.#c({type:`error`,error:e}),this.#r.config.onError?.(e,this),this.#r.config.onSettled?.(this.state.data,e,this),e}finally{this.#a===o&&(this.#a=void 0),this.scheduleGc()}}#c(e){let t=t=>{switch(e.type){case`failed`:return{...t,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case`pause`:return{...t,fetchStatus:`paused`};case`continue`:return{...t,fetchStatus:`fetching`};case`fetch`:return{...t,...it(t.data,this.options),fetchMeta:e.meta??null};case`success`:let n={...t,...at(e.data,e.dataUpdatedAt),dataUpdateCount:t.dataUpdateCount+1,...!e.manual&&{fetchStatus:`idle`,fetchFailureCount:0,fetchFailureReason:null}};return this.#n=e.manual?n:void 0,n;case`error`:let r=e.error;return{...t,error:r,errorUpdateCount:t.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:t.fetchFailureCount+1,fetchFailureReason:r,fetchStatus:`idle`,status:`error`,isInvalidated:!0};case`invalidate`:return{...t,isInvalidated:!0};case`setState`:return{...t,...e.state}}};this.state=t(this.state),qe.batch(()=>{this.observers.slice().forEach(e=>{e.onQueryUpdate()}),this.#r.notify({query:this,type:`updated`,action:e})})}};function it(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:Xe(t.networkMode)?`fetching`:`paused`,...e===void 0&&{error:null,status:`pending`}}}function at(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:`success`}}function ot(e){let t=typeof e.initialData==`function`?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt==`function`?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?`success`:`pending`,fetchStatus:`idle`}}var st=class extends Ue{#e;#t=void 0;#n=void 0;#r=void 0;#i;#a;#o;#s;#c;#l;#u;#d;#f;#p=new Set;constructor(e,t){super(),this.options=t,this.#e=e,this.#o=null,this.bindMethods(),this.setOptions(t)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),lt(this.#t,this.options)?this.#m():this.updateResult(),this.#y())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return ut(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return ut(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#b(),this.#x(),this.#t.removeObserver(this)}setOptions(e){let t=this.options,n=this.#t;if(this.options=this.#e.defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!=`boolean`&&typeof this.options.enabled!=`function`&&typeof be(this.options.enabled,this.#t)!=`boolean`)throw Error(`Expected enabled to be a boolean or a callback that returns a boolean`);this.#S(),this.#t.setOptions(this.options),t._defaulted&&!Oe(this.options,t)&&this.#e.getQueryCache().notify({type:`observerOptionsUpdated`,query:this.#t,observer:this});let r=this.hasListeners();r&&dt(this.#t,n,this.options,t)&&this.#m(),this.updateResult(),r&&(this.#t!==n||be(this.options.enabled,this.#t)!==be(t.enabled,this.#t)||be(this.options.staleTime,this.#t)!==be(t.staleTime,this.#t))&&this.#g();let i=this.#_();r&&(this.#t!==n||be(this.options.enabled,this.#t)!==be(t.enabled,this.#t)||i!==this.#f)&&this.#v(i)}getOptimisticResult(e){let t=this.#e.getQueryCache().build(this.#e,e),n=this.createResult(t,e);return Oe(this.getCurrentResult(),n)||(this.#r=n,this.#a=this.options,this.#i=this.#t.state),n}getCurrentResult(){return this.#r}trackResult(e,t){return new Proxy(e,{get:(e,n)=>(this.trackProp(n),t?.(n),Reflect.get(e,n))})}trackProp(e){this.#p.add(e)}getCurrentQuery(){return this.#t}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){let t=this.#e.defaultQueryOptions(e),n=this.#e.getQueryCache().build(this.#e,t),r=()=>{},i,a=new Promise(e=>{i=e,r=this.#e.getQueryCache().subscribe(i=>{i.type===`updated`&&i.query.queryHash===n.queryHash&&n.state.data!==void 0&&(r(),e(this.createResult(n,t)))})});return Promise.race([n.fetch().then(()=>{let e=this.createResult(n,t);return i?.(e),e}).finally(()=>{r()}),a])}fetch(e){return this.#m({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#r))}#m(e){this.#S();let t=this.#t.fetch(this.options,e);return e?.throwOnError||(t=t.catch(ge)),t}#h(e){return!He()&&be(this.options.enabled,this.#t)!==!1&&ve(e)}#g(){this.#b();let e=be(this.options.staleTime,this.#t);if(this.#r.isStale||!this.#h(e))return;let t=ye(this.#r.dataUpdatedAt,e)+1;this.#u=G.setTimeout(()=>{this.#r.isStale||this.updateResult()},t)}#_(){return be(this.options.refetchInterval,this.#t)??!1}#v(e){this.#x(),this.#f=e,this.#f!==0&&this.#h(this.#f)&&(this.#d=G.setInterval(()=>{(this.options.refetchIntervalInBackground||We.isFocused())&&this.#m()},this.#f))}#y(){this.#g(),this.#v(this.#_())}#b(){this.#u!==void 0&&(G.clearTimeout(this.#u),this.#u=void 0)}#x(){this.#d!==void 0&&(G.clearInterval(this.#d),this.#d=void 0)}createResult(e,t){let n=this.#t,r=this.options,i=this.#r,a=this.#i,o=this.#a,s=e===n?this.#n:e.state,{state:c}=e,l={...c},u=!1,d;if(t._optimisticResults){let i=this.hasListeners(),a=!i&&lt(e,t),o=i&&dt(e,n,t,r);(a||o)&&(l={...l,...it(c.data,e.options)}),t._optimisticResults===`isRestoring`&&(l.fetchStatus=`idle`)}let{error:f,errorUpdatedAt:p,status:m}=l;d=l.data;let h=!1;if(t.placeholderData!==void 0&&d===void 0&&m===`pending`){let e;i?.isPlaceholderData&&t.placeholderData===o?.placeholderData?(e=i.data,h=!0):e=typeof t.placeholderData==`function`?t.placeholderData(this.#l?.state.data,this.#l):t.placeholderData,e!==void 0&&(m=`success`,d=Ne(i?.data,e,t),u=!0)}if(t.select&&d!==void 0&&!h){if(i&&d===a?.data&&t.select===this.#s)d=this.#c;else try{this.#s=t.select,d=t.select(d),d=Ne(i?.data,d,t),this.#c=d,this.#o=null}catch(e){this.#o=e}}else d===void 0&&(this.#o=null);this.#o&&(f=this.#o,d=this.#c,p=Date.now(),m=`error`,u=!1);let g=l.fetchStatus===`fetching`,_=m===`pending`,v=m===`error`,y=_&&g,b=d!==void 0;return{status:m,fetchStatus:l.fetchStatus,isPending:_,isSuccess:m===`success`,isError:v,isInitialLoading:y,isLoading:y,data:d,dataUpdatedAt:l.dataUpdatedAt,error:f,errorUpdatedAt:p,failureCount:l.fetchFailureCount,failureReason:l.fetchFailureReason,errorUpdateCount:l.errorUpdateCount,isFetched:e.isFetched(),isFetchedAfterMount:l.dataUpdateCount>s.dataUpdateCount||l.errorUpdateCount>s.errorUpdateCount,isFetching:g,isRefetching:g&&!_,isLoadingError:v&&!b,isPaused:l.fetchStatus===`paused`,isPlaceholderData:u,isRefetchError:v&&b,isStale:ft(e,t),refetch:this.refetch,isEnabled:be(t.enabled,e)!==!1}}updateResult(){let e=this.#r,t=this.createResult(this.#t,this.options);if(this.#i=this.#t.state,this.#a=this.options,this.#i.data!==void 0&&(this.#l=this.#t),Oe(t,e))return;this.#r=t;let n=(()=>{if(!e)return!0;let{notifyOnChangeProps:t}=this.options,n=typeof t==`function`?t():t;if(n===`all`||!n&&!this.#p.size)return!0;let r=new Set(n??this.#p);return this.options.throwOnError&&r.add(`error`),Object.keys(this.#r).some(t=>{let n=t;return this.#r[n]!==e[n]&&r.has(n)})})();qe.batch(()=>{n&&this.listeners.forEach(e=>{e(this.#r)}),this.#e.getQueryCache().notify({query:this.#t,type:`observerResultsUpdated`})})}#S(){let e=this.#e.getQueryCache().build(this.#e,this.options);if(e===this.#t)return;let t=this.#t;this.#t=e,this.#n=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#y()}};function ct(e,t){return be(t.enabled,e)!==!1&&e.state.data===void 0&&(e.state.status!==`error`||be(t.retryOnMount,e)!==!1)}function lt(e,t){return ct(e,t)||e.state.data!==void 0&&ut(e,t,t.refetchOnMount)}function ut(e,t,n){if(be(t.enabled,e)!==!1&&be(t.staleTime,e)!==`static`){let r=be(n,e);return r===`always`||r!==!1&&ft(e,t)}return!1}function dt(e,t,n,r){return(e!==t||be(r.enabled,e)===!1)&&(!n.suspense||e.state.status!==`error`)&&ft(e,n)}function ft(e,t){return be(t.enabled,e)!==!1&&e.isStaleByTime(be(t.staleTime,e))}var pt=class extends $e{#e;#t;#n;#r;constructor(e){super(),this.#e=e.client,this.mutationId=e.mutationId,this.#n=e.mutationCache,this.#t=[],this.state=e.state||mt(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#t.includes(e)||(this.#t.push(e),this.clearGcTimeout(),this.#n.notify({type:`observerAdded`,mutation:this,observer:e}))}removeObserver(e){this.#t=this.#t.filter(t=>t!==e),this.scheduleGc(),this.#n.notify({type:`observerRemoved`,mutation:this,observer:e})}optionalRemove(){this.#t.length||(this.state.status===`pending`?this.scheduleGc():this.#n.remove(this))}continue(){return this.#r?.continue()??(this.state.status===`pending`?this.execute(this.state.variables):Promise.resolve())}async execute(e){let t=()=>{this.#i({type:`continue`})},n={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey},r=this.#r=Qe({fn:()=>this.options.mutationFn?this.options.mutationFn(e,n):Promise.reject(Error(`No mutationFn found`)),onFail:(e,t)=>{this.#i({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#i({type:`pause`})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)}),i=this.state.status===`pending`,a=!r.canStart();try{if(i)t();else{this.#i({type:`pending`,variables:e,isPaused:a}),this.#n.config.onMutate&&await this.#n.config.onMutate(e,this,n);let t=await this.options.onMutate?.(e,n);t!==this.state.context&&this.#i({type:`pending`,context:t,variables:e,isPaused:a})}let o=await r.start();return await this.#n.config.onSuccess?.(o,e,this.state.context,this,n),await this.options.onSuccess?.(o,e,this.state.context,n),await this.#n.config.onSettled?.(o,null,this.state.variables,this.state.context,this,n),await this.options.onSettled?.(o,null,e,this.state.context,n),this.#i({type:`success`,data:o}),o}catch(t){try{await this.#n.config.onError?.(t,e,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onError?.(t,e,this.state.context,n)}catch(e){Promise.reject(e)}try{await this.#n.config.onSettled?.(void 0,t,this.state.variables,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onSettled?.(void 0,t,e,this.state.context,n)}catch(e){Promise.reject(e)}throw this.#i({type:`error`,error:t}),t}finally{this.#r===r&&(this.#r=void 0),this.#n.runNext(this)}}#i(e){let t=t=>{switch(e.type){case`failed`:return{...t,failureCount:e.failureCount,failureReason:e.error};case`pause`:return{...t,isPaused:!0};case`continue`:return{...t,isPaused:!1};case`pending`:return{...t,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:`pending`,variables:e.variables,submittedAt:Date.now()};case`success`:return{...t,data:e.data,failureCount:0,failureReason:null,error:null,status:`success`,isPaused:!1};case`error`:return{...t,data:void 0,error:e.error,failureCount:t.failureCount+1,failureReason:e.error,isPaused:!1,status:`error`}}};this.state=t(this.state),qe.batch(()=>{this.#t.forEach(t=>{t.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:`updated`,action:e})})}};function mt(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:`idle`,variables:void 0,submittedAt:0}}var ht=class extends Ue{#e;#t=void 0;#n;#r;constructor(e,t){super(),this.#e=e,this.setOptions(t),this.bindMethods(),this.#i()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(e){let t=this.options;this.options=this.#e.defaultMutationOptions(e),Oe(this.options,t)||this.#e.getMutationCache().notify({type:`observerOptionsUpdated`,mutation:this.#n,observer:this}),t?.mutationKey&&this.options.mutationKey&&we(t.mutationKey)!==we(this.options.mutationKey)?this.reset():this.#n?.state.status===`pending`&&this.#n.setOptions(this.options)}onSubscribe(){this.listeners.size===1&&this.#n&&(this.#n.addObserver(this),this.#i())}onUnsubscribe(){this.hasListeners()||this.#n?.removeObserver(this)}onMutationUpdate(e){this.#i(),this.#a(e)}getCurrentResult(){return this.#t}reset(){this.#n?.removeObserver(this),this.#n=void 0,this.#i(),this.#a()}mutate(e,t){return this.#r=t,this.#n?.removeObserver(this),this.#n=this.#e.getMutationCache().build(this.#e,this.options),this.#n.addObserver(this),this.#n.execute(e)}#i(){let e=this.#n?.state??mt();this.#t={...e,isPending:e.status===`pending`,isSuccess:e.status===`success`,isError:e.status===`error`,isIdle:e.status===`idle`,mutate:this.mutate,reset:this.reset}}#a(e){qe.batch(()=>{let t=this.#r;if(t&&this.hasListeners()){let n=this.#t.variables,r=this.#t.context,i={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};if(e?.type===`success`){try{t.onSuccess?.(e.data,n,r,i)}catch(e){Promise.reject(e)}try{t.onSettled?.(e.data,null,n,r,i)}catch(e){Promise.reject(e)}}else if(e?.type===`error`){try{t.onError?.(e.error,n,r,i)}catch(e){Promise.reject(e)}try{t.onSettled?.(void 0,e.error,n,r,i)}catch(e){Promise.reject(e)}}}this.listeners.forEach(e=>{e(this.#t)})})}},gt=U.createContext(!1),_t=()=>U.useContext(gt),vt=gt.Provider;function yt(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var bt=U.createContext(yt()),xt=()=>U.useContext(bt),St=(e,t,n)=>{let r=n?.state.error&&typeof e.throwOnError==`function`?ze(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||r)&&(t.isReset()||(e.retryOnMount=!1))},Ct=e=>{U.useEffect(()=>{e.clearReset()},[e])},wt=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(i&&e.data===void 0||ze(n,[e.error,r])),Tt=e=>{if(e.suspense){let t=1e3,n=e=>e===`static`?e:Math.max(e??t,t),r=e.staleTime;e.staleTime=typeof r==`function`?(...e)=>n(r(...e)):n(r),typeof e.gcTime==`number`&&(e.gcTime=Math.max(e.gcTime,t))}},Et=(e,t)=>e?.suspense&&t.isPending,Dt=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function Ot(e,t,n){let r=_t(),i=xt(),a=de(n),o=a.defaultQueryOptions(e),s=a.getQueryCache().get(o.queryHash),c=e.subscribed!==!1;o._optimisticResults=r?`isRestoring`:c?`optimistic`:void 0,Tt(o),St(o,i,s),Ct(i);let[l]=U.useState(()=>new t(a,o)),u=l.getOptimisticResult(o),d=!r&&c;if(U.useSyncExternalStore(U.useCallback(e=>{let t=d?l.subscribe(qe.batchCalls(e)):ge;return l.updateResult(),t},[l,d]),()=>l.getCurrentResult(),()=>l.getCurrentResult()),U.useEffect(()=>{l.setOptions(o)},[o,l]),Et(o,u))throw Dt(o,l,i);if(wt({result:u,errorResetBoundary:i,throwOnError:o.throwOnError,query:s,suspense:o.suspense}))throw u.error;return o.notifyOnChangeProps?u:l.trackResult(u)}function kt(e,t){return Ot(e,st,t)}function At(e,t){let n=de(t),[r]=U.useState(()=>new ht(n,e));U.useEffect(()=>{r.setOptions(e)},[r,e]);let i=U.useSyncExternalStore(U.useCallback(e=>r.subscribe(qe.batchCalls(e)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),a=U.useCallback((...e)=>{r.mutate(e[0],e[1]).catch(ge)},[r]);if(i.error&&ze(r.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:a,mutateAsync:i.mutate}}var jt=e=>e?.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase();function Mt(e,t,n=[]){if(t==null)throw Error(`[lucide]: iconNode is required when icon name is used`);return{name:jt(e),size:24,node:t,...n.length>0?{aliases:n}:{}}}var Nt=e=>{let t=``,n=!1;for(let r of e)r===`-`||r===`_`||r<=` `?n=t.length>0:(t.length===0?t+=r.toLowerCase():t+=n?r.toUpperCase():r,n=!1);return t},Pt=e=>{let t=Nt(e);return t.charAt(0).toUpperCase()+t.slice(1)},Ft=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),It={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":2,"stroke-linecap":`round`,"stroke-linejoin":`round`};function Lt(e){return e!=null}function Rt(e,t={}){let n=t.attributeNames??{},r=e=>n[e]??e,i=e.size??e.width??It.width,a=e.size??e.height??It.height,o=e.aliases?.filter(e=>typeof e==`string`&&e.trim()!==``).map(e=>`lucide-${e}`)??[],s=[...e.name?[`lucide-${e.name}`]:[],...o],c=t.className?.split(` `).filter(Boolean)??[],l=t.includeDefaultClasses===!1?Ft(...c):Ft(`lucide`,...s,...c),u=t.absoluteStrokeWidth?Number(t.strokeWidth??It[`stroke-width`])*Number(e.size??e.width??It.width)/Number(t.size??t.width??It.width):t.strokeWidth??It[`stroke-width`];return[`svg`,{...Object.entries(It).reduce((e,[t,n])=>(e[r(t)]=n,e),{}),...`color`in t&&t.color&&{[r(`stroke`)]:t.color},...`size`in t&&Lt(t.size)&&{[r(`width`)]:t.size,[r(`height`)]:t.size},...`width`in t&&Lt(t.width)&&{[r(`width`)]:t.width},...`height`in t&&Lt(t.height)&&{[r(`height`)]:t.height},[r(`stroke-width`)]:u,...l&&{[r(`class`)]:l},[r(`viewBox`)]:`0 0 ${i} ${a}`,...t.hasA11yProp===!1?{[r(`aria-hidden`)]:`true`}:{},...`attributes`in t&&t.attributes},e.node.map(e=>{let[n,i,a]=e,o=t.nonScalingStroke?{[r(`vector-effect`)]:`non-scaling-stroke`,...i}:i;return a?[n,o,a]:[n,o]})]}function zt(e,t={}){return Rt(e,{...t,attributeNames:{...t.attributeNames,class:`className`,"stroke-width":`strokeWidth`,"stroke-linecap":`strokeLinecap`,"stroke-linejoin":`strokeLinejoin`,"vector-effect":`vectorEffect`}})}var Bt=e=>{for(let t in e)if(t.startsWith(`aria-`)||t===`role`||t===`title`)return!0;return!1},Vt=(0,U.createContext)({}),Ht=()=>(0,U.useContext)(Vt),Ut=(0,U.forwardRef)(({color:e,size:t,width:n,height:r,strokeWidth:i,absoluteStrokeWidth:a,nonScalingStroke:o,className:s=``,children:c,iconNode:l=[],icon:u={node:l,aliases:[],size:24},...d},f)=>{let{size:p=24,strokeWidth:m=2,absoluteStrokeWidth:h=!1,nonScalingStroke:g=!1,color:_=`currentColor`,className:v=``}=Ht()??{},y=!!c||Bt(d),[b,x,S=[]]=zt(u,{color:e??_,width:n??t??p,height:r??t??p,strokeWidth:i??m,absoluteStrokeWidth:a??h,nonScalingStroke:o??g,className:Ft(v,s),hasA11yProp:y,attributes:d});return(0,U.createElement)(b,{ref:f,...x},[...S.map(([e,t])=>(0,U.createElement)(e,t)),...Array.isArray(c)?c:[c]])});function Wt(e,t=[],n=[]){let r=typeof e==`string`?Mt(e,t,n):e,i=(0,U.forwardRef)(({className:e,...t},n)=>(0,U.createElement)(Ut,{ref:n,icon:r,className:e,...t}));return r.name&&(i.displayName=Pt(r.name)),i}var Gt={name:`arrow-down`,size:24,node:[[`path`,{d:`M12 5v14`,key:`s699le`}],[`path`,{d:`m19 12-7 7-7-7`,key:`1idqje`}]]};Gt.node;var Kt=Wt(Gt),qt={name:`arrow-up`,size:24,node:[[`path`,{d:`m5 12 7-7 7 7`,key:`hav0vg`}],[`path`,{d:`M12 19V5`,key:`x0mq9r`}]]};qt.node;var Jt=Wt(qt),Yt={name:`calendar-clock`,size:24,node:[[`path`,{d:`M16 14v2.2l1.6 1`,key:`fo4ql5`}],[`path`,{d:`M16 2v3`,key:`otl347`}],[`path`,{d:`M21 7.338V5a2 2 0 00-2-2H5a2 2 0 00-2 2v14a2 2 0 002 2h2.338`,key:`7hb8p4`}],[`path`,{d:`M3 9h5.859`,key:`numkqi`}],[`path`,{d:`M8 2v3`,key:`1ioesn`}],[`circle`,{cx:`16`,cy:`16`,r:`6`,key:`qoo3c4`}]]};Yt.node;var Xt=Wt(Yt),Zt={name:`check`,size:24,node:[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]};Zt.node;var Qt=Wt(Zt),$t={name:`chevron-down`,size:24,node:[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]};$t.node;var en=Wt($t),tn={name:`chevron-up`,size:24,node:[[`path`,{d:`m18 15-6-6-6 6`,key:`153udz`}]]};tn.node;var nn=Wt(tn),rn={name:`circle-alert`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`line`,{x1:`12`,x2:`12`,y1:`8`,y2:`12`,key:`1pkeuh`}],[`line`,{x1:`12`,x2:`12.01`,y1:`16`,y2:`16`,key:`4dfq90`}]],aliases:[`alert-circle`]};rn.node;var an=Wt(rn),on={name:`circle-check`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m16 9-5.5 5.5L8 12`,key:`xofnsj`}]],aliases:[`check-circle-2`]};on.node;var sn=Wt(on),cn={name:`circle-dashed`,size:24,node:[[`path`,{d:`M10.1 2.182a10 10 0 0 1 3.8 0`,key:`5ilxe3`}],[`path`,{d:`M13.9 21.818a10 10 0 0 1-3.8 0`,key:`11zvb9`}],[`path`,{d:`M17.609 3.721a10 10 0 0 1 2.69 2.7`,key:`1iw5b2`}],[`path`,{d:`M2.182 13.9a10 10 0 0 1 0-3.8`,key:`c0bmvh`}],[`path`,{d:`M20.279 17.609a10 10 0 0 1-2.7 2.69`,key:`1ruxm7`}],[`path`,{d:`M21.818 10.1a10 10 0 0 1 0 3.8`,key:`qkgqxc`}],[`path`,{d:`M3.721 6.391a10 10 0 0 1 2.7-2.69`,key:`1mcia2`}],[`path`,{d:`M6.391 20.279a10 10 0 0 1-2.69-2.7`,key:`1fvljs`}]]};cn.node;var ln=Wt(cn),un={name:`circle-dot`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`1`,key:`41hilf`}],[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}]]};un.node;var dn=Wt(un),fn={name:`circle-x`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m15 9-6 6`,key:`1uzhvr`}],[`path`,{d:`m9 9 6 6`,key:`z0biqf`}]],aliases:[`x-circle`]};fn.node;var pn=Wt(fn),mn={name:`circle`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}]]};mn.node;var hn=Wt(mn),gn={name:`clock`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 6v6l4 2`,key:`mmk7yg`}]]};gn.node;var _n=Wt(gn),vn={name:`copy`,size:24,node:[[`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`}]]};vn.node;var yn=Wt(vn),bn={name:`equal`,size:24,node:[[`line`,{x1:`5`,x2:`19`,y1:`9`,y2:`9`,key:`1nwqeh`}],[`line`,{x1:`5`,x2:`19`,y1:`15`,y2:`15`,key:`g8yjpy`}]]};bn.node;var xn=Wt(bn),Sn={name:`eye-off`,size:24,node:[[`path`,{d:`M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49`,key:`ct8e1f`}],[`path`,{d:`M14.084 14.158a3 3 0 0 1-4.242-4.242`,key:`151rxh`}],[`path`,{d:`M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143`,key:`13bj9a`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}]]};Sn.node;var Cn=Wt(Sn),wn={name:`eye`,size:24,node:[[`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`}]]};wn.node;var Tn=Wt(wn),En={name:`loader-circle`,size:24,node:[[`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`,key:`13zald`}]],aliases:[`loader-2`]};En.node;var Dn=Wt(En),On={name:`minus`,size:24,node:[[`path`,{d:`M5 12h14`,key:`1ays0h`}]]};On.node;var kn=Wt(On),An={name:`octagon-alert`,size:24,node:[[`path`,{d:`M12 16h.01`,key:`1drbdi`}],[`path`,{d:`M12 8v4`,key:`1got3b`}],[`path`,{d:`M15.312 2a2 2 0 0 1 1.414.586l4.688 4.688A2 2 0 0 1 22 8.688v6.624a2 2 0 0 1-.586 1.414l-4.688 4.688a2 2 0 0 1-1.414.586H8.688a2 2 0 0 1-1.414-.586l-4.688-4.688A2 2 0 0 1 2 15.312V8.688a2 2 0 0 1 .586-1.414l4.688-4.688A2 2 0 0 1 8.688 2z`,key:`1fd625`}]],aliases:[`alert-octagon`]};An.node;var jn=Wt(An),Mn={name:`search`,size:24,node:[[`path`,{d:`m21 21-4.34-4.34`,key:`14j7rj`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}]]};Mn.node;var Nn=Wt(Mn),Pn={name:`x`,size:24,node:[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]};Pn.node;var Fn=Wt(Pn),In=48,Ln=(e,t=0)=>{let n=new Int32Array(e.length);for(let r=0;r<e.length;r++)n[r]=e.charCodeAt(r)-In-t;return n},Rn=e=>{let t=new Int32Array(e.length+1);for(let n=0;n<e.length;n++)t[n+1]=t[n]+e[n];return t},zn=e=>{let t=new Int32Array(e.length),n=0;for(let r=0;r<e.length;r++){let i=e.charCodeAt(r)-In;n+=i>>>1^-(i&1),t[r]=n}return t},Bn=384,Vn=[],Hn=Rn(Ln(`E0500002005282000000002000150000020021820000011200000003022202000300004200120000200420001200021200301200010400162000010000220021010:2192001200220012000220012000200200200400010200040000000000400200108200110100000022010313000162002000020020012020080213000228200000000082000000000120002000120020020040101020300130001001010`)),Un=Rn(Ln(`:11111111211111119311546544411119731869:671397415686432441111111111161114151214313433415:78311132233313187211117221449443411141111151152226611131111112212518142224214215421421542142424242516171151615616347111111111197911327451111111111111111111113134714133513411111311111111111111111111112444411111342312715245411117:3`)),Wn=`@containerabcdefghinlmoprstunderlineviawzccentlignnimatespectuto-colsrowsaglorightnessckdrop-sisbcontrastfiltergrayscalehue-rotateinvertopacityslurrightnessaturateepia-coniclinearpositionradialsizeockurrderttom-belrstxyespacing-xyaretoursorlnt-umnsendspantartainentrasteividerop-shadowurationcorationlay-xyasendillexontromlter-featuresstretchapr-xyayscaleidow-colsrowsue-rotatedentlinesetvert-beringsxyeshadoweiadingftnest-clamp-imageabein-lrstxyskx--b-coniclpositionrsizet-x-y-fromto-fromto-inearfromto-fromto-adialfromto-fromtofromtofromtofromtoblockhinlinew-screenesblockhinlinewbjectpacityrutlinederigin-offsetbelrstxyesrspective-originaceholderioghtng-offsettateundedw-xyz-belrstlreseslr-endspantartaturatecepiahizekewpace-taleroll-xyz-barmpbelrstxyesbelrstxyes-thumbrackadowrink-xyxyartrokeabextora-shadowpckingnsformitionlate-xyz-offsetill-changeoom`,Gn=(()=>{let e=Hn.length-1,t=new Int32Array(e);for(let n=e-1;n>=0;n--){let e=1,r=n+1;for(let i=Hn[n];i<Hn[n+1];i++)e+=t[r],r+=t[r];t[n]=e}let n=new Int32Array(Hn[e]),r=0;for(let i=0;i<e;i++){let e=i+1;for(let a=Hn[i];a<Hn[i+1];a++)n[r++]=e,e+=t[e]}return n})(),Kn=Ln(`02000000000000900<=0?000B000F00F00ŏI0J0LNPRTVX0000]_a00000000000000000000000rst0000000zŏ00000000000…ŏ000ˆ0000ŏ0000000000—0000000000000000000000000000000000000000000000000000Ë000000000000000000000Þ000000000000000000ð0000000ø0ùúûüýþÿĀāĂ㥹Ć000000000000000000000000000000000000000000ħ0ĨĪ00000000000000000000ļĽ00000Ŭ000000`,1),qn=Rn(Ln(`123333359346463635126536711576`)),Jn=Ln(`93203242332583253248325D>E?F@03263243255B:032523853:0325B:8GA032542H<C=12727B:0328432553;D>E?3257D>032585:0325B:;0328B:032`),Yn=Ln(`012113445661666666789111:5;;;;;;;;444;;;:62999<1161=62>>?61:21@ABCD4446996:64E:::;:?::64:F114GHHIHHHHIHH1HH1HH1HHHHHH::EEJ4444::EE4444441691;644444114244444:;K6666555555555555555999666664444444444444444444444226?6:66644L9M?D:111::::6DE199`),Xn=zn(`020200202020020020020020020020200200200200200200200002020202001003040106000200200200200200200200200200200200200200200200200200200200200200200200200200200200020020020020020020002020200202002002002002002002002002002020002002020020200220200200200200200200200200200200020020020000200020002000200200200020020020002000200200200020020202002020202000200200020022000200200020020002002000200220002002000200W0Z00020020002002020002002000200g0j0002002000200200020020002002000200200020020002000200002000002002002002002000200020000200002002002002002002002020020020200200200200200200200200202020020020020020020020020002002002020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020002002002002002002000200200200200200200200200200020202020002000200020002002002002000020200200`),Zn=(()=>{let e=new Int32Array(319).fill(-1),t=zn(`02422242:222222242224222242442222222422222244442242226224222426222422442462222422622222222626222462242622422622422424242422222222422222222242422222222222222222622442224222222222222224424442262222222222222222222226224222424242422224422422422222`),n=zn(`02222222222222222222202222222222222222222222221422222222222222222222222222222222222Y\\222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222221422222222222222222222222222222222222222Ŀł222222222222222222`);for(let r=0;r<t.length;r++)e[t[r]]=n[r];return e})(),Qn=`container |break-after- all auto avoid avoid-page column left page right|break-before- all auto avoid avoid-page column left page right|break-inside-a uto void void-column void-page|box-decoration- clone slice|box- border content| contents flow-root hidden table table-caption table-cell table-column table-column-group table-footer-group table-header-group table-row table-row-group| not-sr-only sr-only|float- end left none right start|clear- both end left none right start|isolat e ion-auto|overflow- auto clip hidden scroll visible|overflow-x- auto clip hidden scroll visible|overflow-y- auto clip hidden scroll visible|overscroll- auto contain none|overscroll-x- auto contain none|overscroll-y- auto contain none| absolute fixed relative static sticky| collapse invisible visible|justify- around baseline between center center-safe end end-safe evenly normal start stretch|justify-items- center center-safe end end-safe normal start stretch|justify-self- auto center center-safe end end-safe start stretch|items- baseline baseline-last center center-safe end end-safe start stretch|self- auto baseline baseline-last center center-safe end end-safe start stretch|place-content- around baseline between center center-safe end end-safe evenly start stretch|place-items- baseline center center-safe end end-safe start stretch|place-self- auto center center-safe end end-safe start stretch| antialiased subpixel-antialiased| italic not-italic|normal-nums |ordinal |slashed-zero | lining-nums oldstyle-nums| proportional-nums tabular-nums| diagonal-fractions stacked-fractions| no-underline overline| capitalize lowercase normal-case uppercase|truncate |whitespace- break-spaces normal nowrap pre pre-line pre-wrap|break- all keep normal words|wrap- anywhere break-word normal|hyphens- auto manual none|mix-blend- color color-burn color-dodge darken difference exclusion hard-light hue lighten luminosity multiply normal overlay plus-darker plus-lighter saturation screen soft-light|table- auto fixed|caption- bottom top|backface- hidden visible|appearance- auto none|scheme- dark light light-dark normal only-dark only-light|field-sizing- content fixed|pointer-events- auto none|resize -none -x -y|snap- align-none center end start|snap- always normal|snap- both none x y|snap- mandatory proximity|touch- auto manipulation none|touch-pan- left right x|touch-pan- down up y|touch-pinch-zoom |select- all auto none text|forced-color-adjust- auto none| normal size| baseline bottom middle sub super text-bottom text-top top| bounce none ping pulse spin| auto square video| auto fr max min px|none | auto full px| fixed local scroll|clip- border content padding text|origin- border content padding| bottom bottom-left bottom-right center left left-bottom left-top right right-bottom right-top top top-left top-right| no-repeat repeat repeat-round repeat-space repeat-x repeat-y| auto contain cover| gradient-to-b gradient-to-bl gradient-to-br gradient-to-l gradient-to-r gradient-to-t gradient-to-tl gradient-to-tr none|blend- color color-burn color-dodge darken difference exclusion hard-light hue lighten luminosity multiply normal overlay saturation screen soft-light|to- b bl br l r t tl tr| auto dvh fit full lh lvh max min px screen svh| dashed dotted double hidden none solid| collapse separate|px |auto |full | content none strict| inline-size size|layout |paint |style | around baseline between center center-safe end end-safe evenly normal start stretch| alias all-scroll auto cell col-resize context-menu copy crosshair default e-resize ew-resize grab grabbing help move n-resize ne-resize nesw-resize no-drop none not-allowed ns-resize nw-resize nwse-resize pointer progress row-resize s-resize se-resize sw-resize text vertical-text w-resize wait zoom-in zoom-out| dashed dotted double solid wavy| auto from-font|reverse |initial | in in-out initial linear out| col col-reverse row row-reverse| nowrap wrap wrap-reverse| auto initial none| black bold extrabold extralight light medium normal semibold thin| condensed expanded extra-condensed extra-expanded normal semi-condensed semi-expanded ultra-condensed ultra-expanded|flow- col col-dense dense row row-dense| none subgrid| auto dvh dvw fit full lh lvh lvw max min px screen svh svw| block flex grid table| auto dvw fit full lvw max min px screen svw| loose none normal px relaxed snug tight|through |item | inside outside| decimal disc none| auto px| clip-border clip-content clip-fill clip-padding clip-stroke clip-view no-clip| add exclude intersect subtract| alpha luminance match|origin- border content fill padding stroke view|type- alpha luminance| circle ellipse| closest-corner closest-side farthest-corner farthest-side|at- bottom bottom-left bottom-right center left left-bottom left-top right right-bottom right-top top top-left top-right| dvh fit full lh lvh max min none px screen svh| auto dvh dvw fit full lh lvh lvw max min none px screen svh svw| dvw fit full lvw max min none px screen svw| auto dvh dvw fit full lvh lvw max min none prose px svh svw| auto dvh dvw fit full lvh lvw max min none px screen svh svw| contain cover fill none scale-down| first last none| distant dramatic midrange near none normal|inset | full none|3d | auto smooth|gutter- auto both stable| auto none thin| inner none| auto dvh dvw fit full lvh lvw max min px svh svw|base | center end justify left right start| clip ellipsis| balance nowrap pretty wrap| normal tight tighter wide wider widest| cpu gpu none| 3d flat| all colors none opacity shadow transform| discrete normal| full px| auto dvh dvw fit full lvh lvw max min px screen svh svw| auto contents scroll transform`.split(`|`).map(e=>{let t=e.split(` `),n=t.shift();for(let e=0;e<t.length;e++)t[e]=n+t[e];return t}),$n=zn(`0000000000000000000000000000000000000000000000000000000000000262242:6@200000006:240B428:4422400002046044222426220026642642462026224222824220022400000000\\00N222422242222222224062242222222422226264222422222222222222442804222422222222222222222222220<4<0204260002444020204224422`),er=zn(`ɠ222222222222222222222222222222222222222222222222222222222222˕4222226>ʶ22ʷʺʷ2ʸʷ42ʴ2ʓ22>621422ɶ222ɹɼɷɺɷɺ22ɱ42222ɨ2ɧ26622ɘɓ244ƸƵ222]d24242ǖǓƚÄȫ2263ȨȥȨ2222222ǣ222222222222222222ǂƽ2ƾƵ2222222422222ƜƑ22222222222222222222144Ŧţ22Ţş222222222222222222222ĸ2ı68ĦģĦɡŰ4Ġ«®ĝ822ĔđĔ2ē2222622`),tr=zn(`02222222222222222222222222222222222222222222222222222222222222222202022222222222EH2200IL021042222Y\\222IL0cf2e10j2222U00X202[^2y0000120|{~‚22…ˆ‡:22|22222222222G000q†OVI00000}š2›>40000ŒB00000I¨©000¬00000000000000021M®­00°“000000000000000000000–222›HGHa1º222¿2À2222ÉÌ000­°2±`),nr=new Int32Array(995),rr=new Int32Array(995),ir=new Int32Array(995),ar=``,or=new Int32Array(1038);{let e=new Map,t=0,n=0;for(let r=0;r<$n.length;r++)for(let i of Qn[tr[r]]){let a=e.get(i);a===void 0&&(a=t++,e.set(i,a),or[a*2]=ar.length,or[a*2+1]=i.length,ar+=i),nr[n]=$n[r],rr[n]=er[r],ir[n]=a,n++}}var sr=zn(`0b2N:222@R>F@286¦2@H2D266226FB22B2>BD\\6N22222Z222D222p`),cr=Rn(Ln(`1::24444432:442:44:44>222222:44:4421322511111311111114`)),lr=zn(`2Š4A;33N=C@H4A;33N=C@<27;83:;8393NQ:3NQʰ222ˉºŴŽ2R2=18cƴÅҜ=cĞÛC1ƈǝȈ:ħ25=11D3A@4=<1;1DEr25;11B3?<6;:371BCn9@7=<8192>2E121@9@EHE@9>2T25511<398454131<=V25511<398454131<=„ƧNž2Đå242L222290000f22500ɛ000ǘ222`),ur=Ln(`ij`),dr=Ln(`—`),fr=Ln(`1`),pr={GROUP_COUNT:Bn,customValidatorNames:Vn,edgeStart:Hn,labelStart:Un,labelText:Wn,edgeTarget:Gn,nodeGroup:Kn,nodeVlist:Zn,vlistPat:qn,vlistOps:Jn,vlistRef:Yn,vlistGroup:Xn,litAnchor:nr,litGroup:rr,litPool:ir,poolOffsets:or,poolText:ar,adjGid:sr,adjStart:cr,adjTgt:lr,patGid:ur,patTgt:dr,postfixLookupGroups:fr,orderSensitiveModifiers:`* ** after backdrop before details-content file first-letter first-line marker placeholder selection`},mr=`line`in Error(),hr=-1,gr=-1,_r=(e,t,n)=>{let r=2166136261;for(let i=t;i<n;i++)r=Math.imul(r^e.charCodeAt(i),16777619);return r},vr=(e,t,n)=>{let r=n-t,i=Math.imul(r,2654435761)^e.charCodeAt(t);if(r>3){let a=r>>2,o=r>>1;i=Math.imul(i^e.charCodeAt(t+1)<<8^e.charCodeAt(t+2)<<16^e.charCodeAt(t+a),2246822507),i=Math.imul(i^e.charCodeAt(t+o)<<8^e.charCodeAt(t+o+a)<<16^e.charCodeAt(n-3),3266489909),i^=e.charCodeAt(n-2)<<8^e.charCodeAt(n-1)<<16;for(let r=t+3,a=n-4;r<t+8&&r<a;r++,a--)i=Math.imul(i^e.charCodeAt(r)^e.charCodeAt(a)<<8,16777619)}return i^i>>>15},yr=(e,t,n={})=>{let{GROUP_COUNT:r,edgeStart:i,labelStart:a,labelText:o,edgeTarget:s,nodeGroup:c,nodeVlist:l,vlistPat:u,vlistOps:d,vlistRef:f,vlistGroup:p,litAnchor:m,litGroup:h,litPool:g,poolOffsets:_,poolText:v,adjGid:y,adjStart:b,adjTgt:x,patGid:S,patTgt:C,postfixLookupGroups:w,customValidatorNames:T,orderSensitiveModifiers:E}=e,D=new Int32Array(r).fill(-1);for(let e=0;e<y.length;e++)D[y[e]]=e;let O=0;for(let e=0;e+1<b.length;e++){let t=b[e+1]-b[e];t>O&&(O=t)}let k=32;for(;k<2*(1+O+S.length);)k<<=1;let A=new Int32Array(f.length+1);for(let e=0;e<f.length;e++)A[e+1]=A[e]+u[f[e]+1]-u[f[e]];let j=new Uint8Array(r);for(let e=0;e<w.length;e++)j[w[e]]=1;let M=i.length-1,N=new Uint8Array(M),P=0,F=!0;for(let e=0;e<m.length;e++){N[m[e]]=1;let t=_[g[e]*2+1];t>P&&(P=t);let n=v.charCodeAt(_[g[e]*2]);(n===91||n===40)&&(F=!1)}let I=1;for(;I<m.length*2;)I<<=1;let L=new Int32Array(I).fill(-1);for(let e=0;e<m.length;e++){let t=_[g[e]*2],n=(_r(v,t,t+_[g[e]*2+1])^Math.imul(m[e],2654435761)|0)&I-1;for(;L[n]!==-1;)n=n+1&I-1;L[n]=e}let R=(e,t,n,r)=>{let i=(_r(t,n,r)^Math.imul(e,2654435761)|0)&I-1,a=r-n;for(;;){let r=L[i];if(r===-1)return-1;if(m[r]===e&&_[g[r]*2+1]===a){let e=_[g[r]*2],i=!0;for(let r=0;r<a;r++)if(v.charCodeAt(e+r)!==t.charCodeAt(n+r)){i=!1;break}if(i)return h[r]}i=i+1&I-1}},z=n.cacheSize??8192,B=n.prefix??e.prefix??``,ee=B===``?``:B+`:`,V=ee.length,te=(T??[]).map(e=>{let n=t&&t[e];if(!n)throw Error(`cn: missing validator `+e);return n}),ne=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,H=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,re=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,ie=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,ae=0,U=-1,oe=-1,se=-1,ce=-1,le=e=>e>=97&&e<=122||e>=65&&e<=90||e>=48&&e<=57||e===95,W=e=>/\s/.test(String.fromCharCode(e)),ue=(e,t,n)=>{if(ae=0,U=-1,n-t<3)return;let r=e.charCodeAt(t),i=e.charCodeAt(n-1);if(r===91&&i===93)ae=1;else if(r===40&&i===41)ae=2;else return;se=t+1,ce=n-1;let a=t+1;if(le(e.charCodeAt(a))){for(a++;a<n-1;){let t=e.charCodeAt(a);if(!le(t)&&t!==45)break;a++}a<n-2&&e.charCodeAt(a)===58&&(U=t+1,oe=a,se=a+1)}},de=(e,t,n,r)=>{if(n-t!==r.length)return!1;for(let n=0;n<r.length;n++)if(e.charCodeAt(t+n)!==r.charCodeAt(n))return!1;return!0},fe=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,pe=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,G=e=>!!e&&!Number.isNaN(Number(e)),me=(e,t,n)=>{if(n-t<11||!de(e,t,t+10,`@container`))return!1;if(e.charCodeAt(t+10)===47)return n-t>=12;let r=e.charCodeAt(t+11);return r===115&&n-t>=17&&de(e,t+10,t+16,`-size/`)||r===110&&n-t>=19&&de(e,t+10,t+18,`-normal/`)},he=[1,1,1,1,1,1,1,1,2,2,2,2,2,2,2],ge=`length|number|number weight|family-name|position percentage|length size bg-size|image url|shadow|length|family-name|position percentage|length size bg-size|image url|shadow|number weight`.split(`|`).map(e=>e.split(` `)),_e=[2,3,1,0,0,0,4,5,0,0,0,0,0,1,1],ve=(e,t,n,r)=>{if(e>=10){if(e>=25)return te[e-25](t.slice(n,r));let i=e-10;if(ae!==he[i])return!1;if(U>=0){for(let e of ge[i])if(de(t,U,oe,e))return!0;return!1}switch(_e[i]){case 0:return!1;case 1:return!0;case 2:{let e=t.slice(se,ce);return ne.test(e)&&!H.test(e)}case 3:return G(t.slice(se,ce));case 4:return ie.test(t.slice(se,ce));default:return re.test(t.slice(se,ce))}}switch(e){case 0:return!0;case 1:return ae===0;case 2:return ae===1;case 3:return ae===2;case 4:return fe.test(t.slice(n,r));case 5:return G(t.slice(n,r));case 6:{let e=t.slice(n,r);return!!e&&Number.isInteger(Number(e))}case 7:return r>n&&t.charCodeAt(r-1)===37&&G(t.slice(n,r-1));case 8:return pe.test(t.slice(n,r));default:return me(t,n,r)}},ye=new Set(typeof E==`string`?E.split(` `):E),be=(e,t,n,r,i,a)=>{let o=_r(t,n,r)^(i?2654435769:0),s=e.get(o);if(s!==void 0)outer:for(let e=0;e<s.length;e++){let a=s[e];if(a.imp===i&&a.k.length===r-n){for(let e=0;e<a.k.length;e++)if(a.k.charCodeAt(e)!==t.charCodeAt(n+e))continue outer;return a.id}}else e.set(o,s=[]);let c=t.slice(n,r),l=a(c);return s.push({k:c,imp:i,id:l}),l},xe=new Map,Se=new Map,Ce=2,we=4096,Te=(e,t)=>{let n=[],r=0,i=0,a=0;for(let t=0;t<e.length;t++){let o=e.charCodeAt(t);r===0&&i===0&&o===58?(n.push(e.slice(a,t)),a=t+1):o===91?r++:o===93?r--:o===40?i++:o===41&&i--}n.push(e.slice(a));let o=n[0];if(n.length>1){let e=[],t=[];for(let r of n)r.charCodeAt(0)===91||ye.has(r)?(t.length&&(e.push(...t.sort()),t=[]),e.push(r)):t.push(r);t.length&&e.push(...t.sort()),o=e.join(`:`)}let s=t?o+` !`:o,c=Se.get(s);return c===void 0&&Se.set(s,c=Ce++),c},Ee=new Map,De=r,Oe=r+4096,ke=()=>De++,Ae=2097152,je=8192,Me=new Int32Array(je),Ne=Array(je).fill(null),Pe=new Int32Array(je),Fe=new Int32Array(je),Ie=new Uint8Array(je),Le=0,Re=(e,t,n,r,i,a,o,s)=>{let c=e;if(Ne[e]!==null){if(Ne[e|1]===null)c=e|1;else if(!(Le++&3))c=e|Le>>2&1;else return}Ne[c]=t.slice(n,r),Me[c]=i,Pe[c]=a,Fe[c]=o,Ie[c]=s},ze=()=>Ne.fill(null),Be=256,Ve=[new Int32Array(Be),new Int32Array(Be),new Int32Array(Be),new Int32Array(Be)],[He,Ue,We,Ge]=Ve,Ke=new Uint8Array(Be),qe=new Uint8Array(Be),Je=()=>{Be*=2,Ve=Ve.map(e=>{let t=new Int32Array(Be);return t.set(e),t}),[He,Ue,We,Ge]=Ve;let e=new Uint8Array(Be);e.set(Ke),Ke=e,qe=new Uint8Array(Be)},Ye=64,Xe=new Int32Array(Ye),Ze=new Int32Array(Ye),Qe=new Int32Array(r),$e=2048,et=21,tt=new Float64Array($e),nt=new Int32Array($e),rt=0,it=(e,t)=>{if(e===0&&t<r)return Qe[t]===rt?1:(Qe[t]=rt,0);let n=e*2097152+t+1,i=Math.imul(n,2654435761)>>>et;for(;nt[i]===rt;){if(tt[i]===n)return 1;i=i+1&$e-1}return tt[i]=n,nt[i]=rt,0},at=(e,t,n,r,i)=>{if(n-t>=2&&e.charCodeAt(t)===91&&e.charCodeAt(n-1)===93){let r=-1;for(let i=t+1;i<n-1;i++)if(e.charCodeAt(i)===58){r=i;break}return r===-1||r===t+1?hr:be(Ee,e,t+1,r,0,ke)}if(r>=0&&c[r]>=0)return c[r];for(let t=i-1;t>=0;t--){let r=Ze[t];if(r>n)continue;let i=Xe[t],a=n-r;if(N[i]===1&&a>0&&a<=P){let t=e.charCodeAt(r);if(F===!1||t!==91&&t!==40){let t=R(i,e,r,n);if(t>=0)return t}}let o=l[i];if(o<0)continue;let s=f[o],c=u[s],m=u[s+1];if(c===m)continue;ue(e,r,n);let h=A[o]-c;for(let t=c;t<m;t++)if(ve(d[t],e,r,n))return p[h+t]}return hr},ot=e=>{let t=e.length,n=0,c=0,u=!1;(Ce>we||xe.size>we)&&(xe=new Map,Se=new Map,Ce=2,ze()),De>Oe&&(Ee=new Map,De=r,ze());let d=0;for(;d<t;){let f=e.charCodeAt(d);if(f===32||f>=9&&f<=13||f>=160&&W(f)){f!==32&&(u=!0),d++;continue}let p=d,m=0;for(;d<t;){if(f=e.charCodeAt(d),f<=32){if(f===32)break;if(f>=9&&f<=13){u=!0;break}}else if(f>=160&&W(f)){u=!0;break}m=Math.imul(m^f,16777619),d++}let h=d,g=h-p;n===Be&&Je();let _=n++;He[_]=p,Ue[_]=h,c+=g,m^=Math.imul(g,2654435761);let v=m^m>>>15,y=v&8190;{let t=-1;if(Me[y]===v&&Ne[y]!==null&&Ne[y].length===g?t=y:Me[y|1]===v&&Ne[y|1]!==null&&Ne[y|1].length===g&&(t=y|1),t>=0){let n=Ne[t],r=!0;for(let t=0;t<g;t++)if(n.charCodeAt(t)!==e.charCodeAt(p+t)){r=!1;break}if(r){We[_]=Pe[t],Ge[_]=Fe[t],Ke[_]=Ie[t];continue}}}let b=p;if(V!==0){if(h-p<=V||!e.startsWith(ee,p)){We[_]=hr,Re(y,e,p,h,v,hr,0,0);continue}b=p+V}let x=0,S=0,C=-1,w=-1;for(let t=b;t<h;t++){let n=e.charCodeAt(t);if(x===0&&S===0){if(n===58){C=t;continue}if(n===47){w=t;continue}}n===91?x++:n===93?x--:n===40?S++:n===41&&S--}let T=C>=b?C+1:b,E=T,D=h,O=!1,k=0;D>E&&e.charCodeAt(D-1)===33?(O=!0,D--):D>E&&e.charCodeAt(E)===33&&(O=!0,E++,k=1);let A=-1;w>T&&(A=w+k,A>=D&&(A=-1));let M=E;D-E>1&&e.charCodeAt(E)===45&&(M=E+1);let P=0,F=0,I=0,L=-1,R=0;(l[0]>=0||N[0]===1)&&(Xe[0]=0,Ze[0]=M,R=1);let z=gr,B=0;for(let t=M;t<D;t++)if(t===A&&(z=F<I?gr:P,B=R),P!==gr){let n=e.charCodeAt(t),r=-1;if(F<I)o.charCodeAt(F)===n?(F++,F===I&&(r=P=L)):P=gr;else{let e=i[P],t=i[P+1],c=gr;for(let i=e;i<t;i++){let e=a[i];if(o.charCodeAt(e)===n){a[i+1]-e===1?r=c=s[i]:(F=e+1,I=a[i+1],L=s[i],c=P);break}}P=c}if(r>=0&&(l[r]>=0||N[r]===1)&&t+1<D&&e.charCodeAt(t+1)===45){if(R===Ye){Ye*=2;let e=new Int32Array(Ye);e.set(Xe),Xe=e;let t=new Int32Array(Ye);t.set(Ze),Ze=t}Xe[R]=r,Ze[R]=t+2,R++}}A===D&&(z=F<I?gr:P,B=R);let te=F<I?gr:P,ne,H=!1;if(A>=0){if(H=!0,ne=at(e,E,A,z,B),ne!==hr&&ne<r&&j[ne]){let t=at(e,E,D,te,R);t!==hr&&t!==ne&&(ne=t,H=!1)}else ne===hr&&(ne=at(e,E,D,te,R),H=!1)}else ne=at(e,E,D,te,R);let re=0,ie=0;ne===hr?We[_]=hr:(ie=+!!H,re=b>=C?+!!O:be(xe,e,b,C,+!!O,e=>Te(e,O)),We[_]=ne,Ke[_]=ie,Ge[_]=re),Re(y,e,p,h,v,ne,re,ie)}if(n===0)return``;if(n===1)return He[0]===0&&Ue[0]===t?e:e.slice(He[0],Ue[0]);if(n*k>$e){for(;n*k>$e;)$e<<=1,et--;tt=new Float64Array($e),nt=new Int32Array($e)}if(Ce>=Ae||De>=Ae)throw Error(`cn: too many distinct classes in one merge`);rt=rt+1|0,rt===0&&(Qe.fill(0),nt.fill(0),rt=1);let f=!1;for(let e=n-1;e>=0;e--){let t=We[e];if(t===hr){qe[e]=1;continue}let n=Ge[e];if(it(n,t)===1)qe[e]=0,f=!0;else if(qe[e]=1,t<r){let r=D[t];if(r>=0)for(let e=b[r];e<b[r+1];e++)it(n,x[e]);if(Ke[e]&1)for(let e=0;e<S.length;e++)S[e]===t&&it(n,C[e])}}if(!f&&!u&&t===c+n-1)return e;let p=``,m=0;for(;m<n;){if(!qe[m]){m++;continue}let t=He[m],r=Ue[m],i=m+1;for(;i<n&&qe[i]&&He[i]===r+1&&e.charCodeAt(r)===32;)r=Ue[i],i++;p.length>0&&(p+=` `),p+=e.slice(t,r),m=i}return p},st=16384,ct=new Int32Array(st*2),lt=0,ut=1,dt=Object.create(null),ft=Object.create(null),pt=new Map,mt=new Map,ht=0,gt=0,_t=()=>{lt^=st,ut=ut+1|0,gt=0},vt=e=>{let t=dt[e];if(t!==void 0)return t;let n=vr(e,0,e.length),r=(n&16383)+lt,i=ct[r]===(n^ut)||ct[r^st]===(n^ut-1);return i&&(t=ft[e],t!==void 0)?(dt[e]=t,t):(t=ot(e),i?(dt[e]=t,++ht>z&&(ht=0,ft=dt,dt=Object.create(null),_t())):(ct[r]=n^ut,++gt>st&&_t()),t)},yt=e=>{let t=pt.get(e);if(t!==void 0)return t;let n=vr(e,0,e.length),r=(n&16383)+lt,i=ct[r]===(n^ut)||ct[r^st]===(n^ut-1);return i&&(t=mt.get(e),t!==void 0)?(pt.set(e,t),t):(t=ot(e),i?(pt.set(e,t),++ht>z&&(ht=0,mt=pt,pt=new Map,_t())):(ct[r]=n^ut,++gt>st&&_t()),t)},bt=e=>{let t=vr(e,0,e.length),n=(t&16383)+lt;return ct[n]===(t^ut)||ct[n^st]===(t^ut-1)||(ct[n]=t^ut,++gt>st&&_t(),!1)},xt=z===0?ot:mr?e=>{let t=pt.get(e);return t===void 0?yt(e):t}:vt;return{merge:function(){return arguments.length===1&&typeof arguments[0]==`string`?xt(arguments[0]):xt(Sr.apply(null,arguments))},mergeString:xt,seenBefore:z===0?()=>!1:bt,mergeUncached:ot}},br=(e,t)=>{if(!e)return``;if(typeof e==`string`)return e;let n=``;if(typeof e.length==`number`&&(!t||Array.isArray(e))){let r=e;for(let e=0;e<r.length;e++){let i=r[e];if(!i)continue;let a=typeof i==`string`?i:br(i,t);a&&(n&&(n+=` `),n+=a)}return n}if(t){if(typeof e==`number`)return``+e;if(typeof e==`object`)for(let t in e)e[t]&&(n&&(n+=` `),n+=t)}return n},xr=(e,t)=>{let n=``;for(let r=0;r<e.length;r++){let i=e[r];if(!i)continue;let a=typeof i==`string`?i:br(i,t);a&&(n&&(n+=` `),n+=a)}return n},Sr=function(){return xr(arguments,!1)},Cr=256,wr=16,Tr=1024,Er=4096,Dr=(e,t)=>{let n=t===void 0?()=>!0:t.seenBefore,r=t===void 0?e:t.mergeUncached,i=new Map,a=new Map,o=0,s=null,c=null,l=[],u=[],d=0,f=(t,n,r)=>{c===null&&(c=Array(Er).fill(``),l=Array(Er).fill(``),u=Array(Er).fill(``));let i=vr(t,0,t.length)&4094;if(c[i]===t&&l[i]===n)return u[i];if(c[i|1]===t&&l[i|1]===n)return u[i|1];let a=e(r?n+` `+t:t),o=c[i]===``?i:i|(c[i|1]===``?1:d++&1);return c[o]=t,l[o]=n,u[o]=a,a},p=(e,t,n,r)=>{let i=0;if(t){if(t!==e.a0)return!1;i=1}if(n){if(n!==(i===0?e.a0:e.a1))return!1;i++}if(r){if(r!==(i===0?e.a0:i===1?e.a1:e.a2))return!1;i++}return i===e.t},m=(e,t)=>{let n=e.a,r=0;for(let e=0;e<t.length;e++){let i=t[e];if(i){if(i!==n[r])return!1;r++}}return r===e.t},h=(t,c)=>{let l=t.length,u=s===null?null:s.n;if(!c){if(u!==null&&m(u,t))return s=u,u.r;if(s!==null&&s!==u&&m(s,t))return s.r}let d=``,p=-1,h=0,g=!1;for(let e=0;e<l;e++){let n=t[e];if(n){if(typeof n!=`string`){if(n=t[e]=br(n,!0),!n)continue;g=!0}p<0&&(d=n,p=e),h++}}if(h===0)return``;if(h===1)return e(d);if(g){if(u!==null&&m(u,t))return s=u,u.r;if(s!==null&&s!==u&&m(s,t))return s.r}let _=i.get(d);_===void 0&&(_=a.get(d),_!==void 0&&i.set(d,_));let v=null;if(_!==void 0){if(_.skip>0){_.skip--,s=null;let e=d;for(let n=p+1;n<l;n++){let r=t[n];r&&(e+=` `+r)}return f(e,``,!1)}let e=_.e;outer:for(let n=0;n<e.length;n++){let r=e[n];if(r.t!==h)continue;let i=r.a,a=1;for(let e=p+1;e<l;e++){let n=t[e];if(n&&n!==i[a++])continue outer}v=r;break}v!==null&&(_.miss=0)}if(v===null){let s=d,c=[d];for(let e=p+1;e<l;e++){let n=t[e];n&&(s+=` `+n,c.push(n))}if(!n(s))return r(s);v={r:e(s),t:c.length,a0:c[0],a1:c[1],a2:c[2]??``,a:c,n:null},_===void 0?i.set(d,_={e:[],miss:0,skip:0,at:0}):++_.miss>wr&&(_.miss=wr,_.skip=Tr,_.e.length=0,_.at=0);let u=_.e;u.length<Cr?u.push(v):(u[_.at]=v,_.at=_.at+1&255),++o>1e3&&(o=0,a=i,i=new Map)}return s!==null&&s!==v&&(s.n=v),s=v,v.r},g=t=>Array.isArray(t)?h(t.slice(),!1):e(br(t,!0));return function(t,n,r){let a=arguments.length;if((a|1)==3){let e=s;if(e!==null){let i=e.n;if(i!==null&&p(i,t,n,r))return s=i,i.r;if(e!==i&&p(e,t,n,r))return e.r}if(a===2&&typeof n==`string`&&n!==``){let e=i.get(t);if(e!==void 0&&e.skip>0)return e.skip--,s=null,f(n,t,!0)}return h([t,n,r],!0)}if(a===1)return typeof t==`string`?e(t):g(t);let o=s;if(o!==null){let e=o.n;if(e!==null){let t=e.a,n=0,r=!0;for(let e=0;e<a;e++){let i=arguments[e];if(i){if(i!==t[n]){r=!1;break}n++}}if(r&&n===e.t)return s=e,e.r}if(o!==e){let e=o.a,t=0,n=!0;for(let r=0;r<a;r++){let i=arguments[r];if(i){if(i!==e[t]){n=!1;break}t++}}if(n&&t===o.t)return o.r}}let c=[];for(let e=0;e<a;e++)c.push(arguments[e]);return h(c,!0)}},Or=yr(pr),K=Dr(Or.mergeString,Or);Or.merge;function kr(e){if(!e||typeof document>`u`)return;let t=document.head||document.getElementsByTagName(`head`)[0],n=document.createElement(`style`);n.type=`text/css`,t.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}var Ar=e=>{switch(e){case`success`:return Nr;case`info`:return Fr;case`warning`:return Pr;case`error`:return Ir;default:return null}},jr=Array(12).fill(0),Mr=({visible:e,className:t})=>U.createElement(`div`,{className:[`sonner-loading-wrapper`,t].filter(Boolean).join(` `),"data-visible":e},U.createElement(`div`,{className:`sonner-spinner`},jr.map((e,t)=>U.createElement(`div`,{className:`sonner-loading-bar`,key:`spinner-bar-${t}`})))),Nr=U.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 20 20`,fill:`currentColor`,height:`20`,width:`20`,"aria-hidden":`true`},U.createElement(`path`,{fillRule:`evenodd`,d:`M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z`,clipRule:`evenodd`})),Pr=U.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 24 24`,fill:`currentColor`,height:`20`,width:`20`,"aria-hidden":`true`},U.createElement(`path`,{fillRule:`evenodd`,d:`M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z`,clipRule:`evenodd`})),Fr=U.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 20 20`,fill:`currentColor`,height:`20`,width:`20`,"aria-hidden":`true`},U.createElement(`path`,{fillRule:`evenodd`,d:`M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z`,clipRule:`evenodd`})),Ir=U.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 20 20`,fill:`currentColor`,height:`20`,width:`20`,"aria-hidden":`true`},U.createElement(`path`,{fillRule:`evenodd`,d:`M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z`,clipRule:`evenodd`})),Lr=U.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`12`,height:`12`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`},U.createElement(`line`,{x1:`18`,y1:`6`,x2:`6`,y2:`18`}),U.createElement(`line`,{x1:`6`,y1:`6`,x2:`18`,y2:`18`})),Rr=()=>{let[e,t]=U.useState(document.hidden);return U.useEffect(()=>{let e=()=>{t(document.hidden)};return document.addEventListener(`visibilitychange`,e),()=>document.removeEventListener(`visibilitychange`,e)},[]),e},zr=1,Br=100,Vr=e=>typeof e?.id==`number`||e?.id?.length>0?e.id:zr++,Hr=new class{constructor(){this.subscribe=e=>(this.subscribers.push(e),this.getActiveToasts().forEach(t=>e(t)),()=>{let t=this.subscribers.indexOf(e);this.subscribers.splice(t,1)}),this.publish=e=>{this.subscribers.forEach(t=>t(e))},this.addToast=e=>{this.publish(e),this.toasts=[...this.toasts,e],this.trimHistory()},this.trimHistory=()=>{let e=this.toasts.length-Br;e<=0||(this.toasts=this.toasts.filter(t=>e>0&&this.dismissedToasts.has(t.id)?(this.dismissedToasts.delete(t.id),e--,!1):!0))},this.create=e=>{let{message:t,...n}=e,r=Vr(e),i=this.pendingDismissals.get(r);i!==void 0&&(cancelAnimationFrame(i),this.pendingDismissals.delete(r),this.dismissedToasts.delete(r));let a=this.dismissedToasts.has(r),o=e.dismissible===void 0||e.dismissible;return a&&(this.dismissedToasts.delete(r),this.toasts=this.toasts.filter(e=>e.id!==r)),!a&&this.toasts.find(e=>e.id===r)?this.toasts=this.toasts.map(n=>n.id===r?(this.publish({...n,...e,id:r,title:t}),{...n,...e,id:r,dismissible:o,title:t}):n):this.addToast({title:t,...n,dismissible:o,id:r}),r},this.dismiss=e=>{if(e==null)return this.getActiveToasts().forEach(e=>{this.dismissedToasts.add(e.id),this.subscribers.forEach(t=>t({id:e.id,dismiss:!0}))}),e;this.dismissedToasts.add(e);let t=this.pendingDismissals.get(e);return t!==void 0&&cancelAnimationFrame(t),this.pendingDismissals.set(e,requestAnimationFrame(()=>{this.pendingDismissals.delete(e),this.subscribers.forEach(t=>t({id:e,dismiss:!0}))})),e},this.message=(e,t)=>this.create({...t,message:e,type:void 0}),this.error=(e,t)=>this.create({...t,message:e,type:`error`}),this.success=(e,t)=>this.create({...t,type:`success`,message:e}),this.info=(e,t)=>this.create({...t,type:`info`,message:e}),this.warning=(e,t)=>this.create({...t,type:`warning`,message:e}),this.loading=(e,t)=>this.create({...t,type:`loading`,message:e}),this.promise=(e,t)=>{if(!t)return;let n;t.loading!==void 0&&(n=this.create({...t,promise:e,type:`loading`,message:t.loading,description:typeof t.description==`function`?void 0:t.description}));let r=Promise.resolve(e instanceof Function?e():e),i=n!==void 0,a,o=r.then(async e=>{if(a=[`resolve`,e],U.isValidElement(e))i=!1,this.create({id:n,type:`default`,message:e});else if(Wr(e)&&!e.ok){i=!1;let r=typeof t.error==`function`?await t.error(`HTTP error! status: ${e.status}`):t.error,a=typeof t.description==`function`?await t.description(`HTTP error! status: ${e.status}`):t.description,o=typeof r==`object`&&!U.isValidElement(r)?r:{message:r};this.create({id:n,type:`error`,description:a,...o})}else if(e instanceof Error){i=!1;let r=typeof t.error==`function`?await t.error(e):t.error,a=typeof t.description==`function`?await t.description(e):t.description,o=typeof r==`object`&&!U.isValidElement(r)?r:{message:r};this.create({id:n,type:`error`,description:a,...o})}else if(t.success!==void 0){i=!1;let r=typeof t.success==`function`?await t.success(e):t.success,a=typeof t.description==`function`?await t.description(e):t.description,o=typeof r==`object`&&!U.isValidElement(r)?r:{message:r};this.create({id:n,type:`success`,description:a,...o})}}).catch(async e=>{if(a=[`reject`,e],t.error!==void 0){i=!1;let r=typeof t.error==`function`?await t.error(e):t.error,a=typeof t.description==`function`?await t.description(e):t.description,o=typeof r==`object`&&!U.isValidElement(r)?r:{message:r};this.create({id:n,type:`error`,description:a,...o})}}).finally(()=>{i&&(this.dismiss(n),n=void 0),t.finally==null||t.finally.call(t)}),s=()=>new Promise((e,t)=>o.then(()=>a[0]===`reject`?t(a[1]):e(a[1])).catch(t));return typeof n!=`string`&&typeof n!=`number`?{unwrap:s}:Object.assign(n,{unwrap:s})},this.custom=(e,t)=>{let n=Vr(t);return this.create({...t,jsx:e(n),id:n,type:void 0}),n},this.getActiveToasts=()=>this.toasts.filter(e=>!this.dismissedToasts.has(e.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set,this.pendingDismissals=new Map}},Ur=(e,t)=>Hr.message(e,t),Wr=e=>e&&typeof e==`object`&&`ok`in e&&typeof e.ok==`boolean`&&`status`in e&&typeof e.status==`number`,Gr=Object.assign(Ur,{success:Hr.success,info:Hr.info,warning:Hr.warning,error:Hr.error,custom:Hr.custom,message:Hr.message,promise:Hr.promise,dismiss:Hr.dismiss,loading:Hr.loading},{getHistory:()=>Hr.toasts,getToasts:()=>Hr.getActiveToasts()});kr(`[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px;flex:1;min-width:0}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--normal-text);background:var(--normal-bg);border:1px solid var(--normal-border);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{-webkit-user-select:none;user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}`);function Kr(e){return e.label!==void 0}var qr=3,Jr=`24px`,Yr=`16px`,Xr=4e3,Zr=356,Qr=14,$r=45,ei=200;function ti(...e){return e.filter(Boolean).join(` `)}function ni(e){let[t,n]=e.split(`-`),r=[];return t&&r.push(t),n&&r.push(n),r}var ri=e=>{let{invert:t,toast:n,unstyled:r,interacting:i,setHeights:a,visibleToasts:o,heights:s,index:c,toasts:l,expanded:u,removeToast:d,defaultRichColors:f,closeButton:p,style:m,cancelButtonStyle:h,actionButtonStyle:g,className:_=``,descriptionClassName:v=``,duration:y,position:b,gap:x,expandByDefault:S,classNames:C,icons:w,closeButtonAriaLabel:T=`Close toast`}=e,[E,D]=U.useState(null),[O,k]=U.useState(null),[A,j]=U.useState(!1),[M,N]=U.useState(!1),[P,F]=U.useState(!1),[I,L]=U.useState(!1),[R,z]=U.useState(!1),[B,ee]=U.useState(0),[V,te]=U.useState(0),ne=U.useRef(n.duration||y||Xr),H=U.useRef(null),re=U.useRef(null),ie=c===0,ae=c+1<=o,oe=n.type,se=oe??`default`,ce=n.dismissible!==!1,le=n.className||``,W=n.descriptionClassName||``,ue=U.useMemo(()=>s.findIndex(e=>e.toastId===n.id)||0,[s,n.id]),de=U.useMemo(()=>n.closeButton??p,[n.closeButton,p]),fe=U.useMemo(()=>n.duration||y||Xr,[n.duration,y]),pe=U.useRef(0),G=U.useRef(0),me=U.useRef(0),he=U.useRef(null),[ge,_e]=b.split(`-`),ve=U.useMemo(()=>s.reduce((e,t,n)=>n>=ue?e:e+t.height,0),[s,ue]),ye=Rr(),be=U.useMemo(()=>e.swipeDirections??ni(b),[e.swipeDirections,b]),xe=n.invert||t,Se=oe===`loading`;G.current=U.useMemo(()=>ue*x+ve,[ue,ve]),U.useEffect(()=>{ne.current=fe},[fe]),U.useEffect(()=>{j(!0)},[]),U.useEffect(()=>{let e=re.current;if(e){let t=e.getBoundingClientRect().height;return te(t),a(e=>[{toastId:n.id,height:t,position:n.position},...e]),()=>a(e=>e.filter(e=>e.toastId!==n.id))}},[a,n.id]),U.useLayoutEffect(()=>{if(!A)return;let e=re.current,t=e.style.height;e.style.height=`auto`;let r=e.getBoundingClientRect().height;e.style.height=t,te(r),a(e=>e.find(e=>e.toastId===n.id)?e.map(e=>e.toastId===n.id?{...e,height:r}:e):[{toastId:n.id,height:r,position:n.position},...e])},[A,n.title,n.description,a,n.id,n.jsx,n.action,n.cancel]);let Ce=U.useCallback(()=>{N(!0),ee(G.current),a(e=>e.filter(e=>e.toastId!==n.id)),setTimeout(()=>{d(n)},ei)},[n,d,a,G]);U.useEffect(()=>{if(n.promise&&oe===`loading`||n.duration===1/0||n.type===`loading`)return;let e;return u||i||ye?(()=>{if(me.current<pe.current){let e=new Date().getTime()-pe.current;ne.current-=e}me.current=new Date().getTime()})():ne.current!==1/0&&(pe.current=new Date().getTime(),e=setTimeout(()=>{n.onAutoClose==null||n.onAutoClose.call(n,n),Ce()},ne.current)),()=>clearTimeout(e)},[u,i,n,oe,ye,Ce]),U.useEffect(()=>{n.delete&&(Ce(),n.onDismiss==null||n.onDismiss.call(n,n))},[Ce,n.delete]);function we(){return w?.loading?U.createElement(`div`,{className:ti(C?.loader,n?.classNames?.loader,`sonner-loader`),"data-visible":oe===`loading`},w.loading):U.createElement(Mr,{className:ti(C?.loader,n?.classNames?.loader),visible:oe===`loading`})}let Te=n.icon||w?.[oe]||Ar(oe);return U.createElement(`li`,{tabIndex:0,ref:re,className:ti(_,le,C?.toast,n?.classNames?.toast,C?.[se],n?.classNames?.[se]),"data-sonner-toast":``,"data-rich-colors":n.richColors??f,"data-styled":!(n.jsx||n.unstyled||r),"data-mounted":A,"data-promise":!!n.promise,"data-swiped":R,"data-removed":M,"data-visible":ae,"data-y-position":ge,"data-x-position":_e,"data-index":c,"data-front":ie,"data-swiping":P,"data-dismissible":ce,"data-type":oe,"data-invert":xe,"data-swipe-out":I,"data-swipe-direction":O,"data-expanded":!!(u||S&&A),"data-testid":n.testId,style:{"--index":c,"--toasts-before":c,"--z-index":l.length-c,"--offset":`${M?B:G.current}px`,"--initial-height":S?`auto`:`${V}px`,...m,...n.style},onDragEnd:()=>{F(!1),D(null),he.current=null},onPointerDown:e=>{e.button!==2&&!Se&&ce&&(H.current=new Date,ee(G.current),e.target.setPointerCapture(e.pointerId),e.target.tagName!==`BUTTON`&&(F(!0),he.current={x:e.clientX,y:e.clientY}))},onPointerUp:()=>{if(I||!ce)return;he.current=null;let e=Number(re.current?.style.getPropertyValue(`--swipe-amount-x`).replace(`px`,``)||0),t=Number(re.current?.style.getPropertyValue(`--swipe-amount-y`).replace(`px`,``)||0),r=new Date().getTime()-H.current?.getTime(),i=E===`x`?e:t,a=Math.abs(i)/r;if((E===`x`?be.includes(e>0?`right`:`left`):be.includes(t>0?`bottom`:`top`))&&(Math.abs(i)>=$r||a>.11))ee(G.current),n.onDismiss==null||n.onDismiss.call(n,n),k(E===`x`?e>0?`right`:`left`:t>0?`down`:`up`),Ce(),L(!0);else{var o,s;(o=re.current)==null||o.style.setProperty(`--swipe-amount-x`,`0px`),(s=re.current)==null||s.style.setProperty(`--swipe-amount-y`,`0px`),z(!1),F(!1),D(null)}},onPointerMove:e=>{var t,n;if(!he.current||!ce||window.getSelection()?.toString().length>0)return;let r=e.clientY-he.current.y,i=e.clientX-he.current.x;!E&&(Math.abs(i)>1||Math.abs(r)>1)&&D(Math.abs(i)>Math.abs(r)?`x`:`y`);let a={x:0,y:0},o=e=>1/(1.5+Math.abs(e)/20);if(E===`y`){if(be.includes(`top`)||be.includes(`bottom`)){if(be.includes(`top`)&&r<0||be.includes(`bottom`)&&r>0)a.y=r;else{let e=r*o(r);a.y=Math.abs(e)<Math.abs(r)?e:r}}}else if(E===`x`&&(be.includes(`left`)||be.includes(`right`))){if(be.includes(`left`)&&i<0||be.includes(`right`)&&i>0)a.x=i;else{let e=i*o(i);a.x=Math.abs(e)<Math.abs(i)?e:i}}(Math.abs(a.x)>0||Math.abs(a.y)>0)&&z(!0),(t=re.current)==null||t.style.setProperty(`--swipe-amount-x`,`${a.x}px`),(n=re.current)==null||n.style.setProperty(`--swipe-amount-y`,`${a.y}px`)}},de&&!n.jsx&&oe!==`loading`?U.createElement(`button`,{"aria-label":T,"data-disabled":Se,"data-close-button":!0,onClick:Se||!ce?()=>{}:()=>{Ce(),n.onDismiss==null||n.onDismiss.call(n,n)},className:ti(C?.closeButton,n?.classNames?.closeButton)},w?.close??Lr):null,(oe||n.icon||n.promise)&&n.icon!==null&&(w?.[oe]!==null||n.icon)?U.createElement(`div`,{"data-icon":``,className:ti(C?.icon,n?.classNames?.icon)},oe===`loading`?n.icon||we():n.promise?we():null,oe===`loading`?null:Te):null,U.createElement(`div`,{"data-content":``,className:ti(C?.content,n?.classNames?.content)},U.createElement(`div`,{"data-title":``,className:ti(C?.title,n?.classNames?.title)},n.jsx?n.jsx:typeof n.title==`function`?n.title():n.title),n.description?U.createElement(`div`,{"data-description":``,className:ti(v,W,C?.description,n?.classNames?.description)},typeof n.description==`function`?n.description():n.description):null),U.isValidElement(n.cancel)?n.cancel:n.cancel&&Kr(n.cancel)?U.createElement(`button`,{"data-button":!0,"data-cancel":!0,style:n.cancelButtonStyle||h,onClick:e=>{Kr(n.cancel)&&ce&&(n.cancel.onClick==null||n.cancel.onClick.call(n.cancel,e),Ce())},className:ti(C?.cancelButton,n?.classNames?.cancelButton)},n.cancel.label):null,U.isValidElement(n.action)?n.action:n.action&&Kr(n.action)?U.createElement(`button`,{"data-button":!0,"data-action":!0,style:n.actionButtonStyle||g,onClick:e=>{Kr(n.action)&&(n.action.onClick==null||n.action.onClick.call(n.action,e),!e.defaultPrevented&&Ce())},className:ti(C?.actionButton,n?.classNames?.actionButton)},n.action.label):null)};function ii(){if(typeof window>`u`||typeof document>`u`)return`ltr`;let e=document.documentElement.getAttribute(`dir`);return e===`auto`||!e?window.getComputedStyle(document.documentElement).direction:e}function ai(e,t){let n={};return[e,t].forEach((e,t)=>{let r=t===1,i=r?`--mobile-offset`:`--offset`,a=r?Yr:Jr;function o(e){[`top`,`right`,`bottom`,`left`].forEach(t=>{n[`${i}-${t}`]=typeof e==`number`?`${e}px`:e})}typeof e==`number`||typeof e==`string`?o(e):typeof e==`object`?[`top`,`right`,`bottom`,`left`].forEach(t=>{e[t]===void 0?n[`${i}-${t}`]=a:n[`${i}-${t}`]=typeof e[t]==`number`?`${e[t]}px`:e[t]}):o(a)}),n}var oi=U.forwardRef(function(e,t){let{id:n,invert:r,position:i=`bottom-right`,hotkey:a=[`altKey`,`KeyT`],expand:o,closeButton:s,className:c,offset:l,mobileOffset:u,theme:d=`light`,richColors:f,duration:p,style:m,visibleToasts:h=qr,toastOptions:g,dir:_=ii(),gap:v=Qr,icons:y,customAriaLabel:b,containerAriaLabel:x=`Notifications`}=e,[S,C]=U.useState([]),w=U.useMemo(()=>n?S.filter(e=>e.toasterId===n):S.filter(e=>!e.toasterId),[S,n]),T=U.useMemo(()=>Array.from(new Set([i].concat(w.filter(e=>e.position).map(e=>e.position)))),[w,i]),[E,D]=U.useState([]),[O,k]=U.useState(!1),[A,j]=U.useState(!1),[M,N]=U.useState(d===`system`?typeof window<`u`&&window.matchMedia&&window.matchMedia(`(prefers-color-scheme: dark)`).matches?`dark`:`light`:d),P=U.useRef(null),F=a.join(`+`).replace(/Key/g,``).replace(/Digit/g,``),I=U.useRef(null),L=U.useRef(!1),R=U.useCallback(e=>{C(t=>(t.find(t=>t.id===e.id)?.delete||Hr.dismiss(e.id),t.filter(({id:t})=>t!==e.id)))},[]);return U.useEffect(()=>Hr.subscribe(e=>{e.dismiss?requestAnimationFrame(()=>{C(t=>t.map(t=>t.id===e.id?{...t,delete:!0}:t))}):setTimeout(()=>{oe.flushSync(()=>{C(t=>{let n=t.findIndex(t=>t.id===e.id);return n===-1?[e,...t]:[...t.slice(0,n),{...t[n],...e},...t.slice(n+1)]})})})}),[]),U.useEffect(()=>{if(d!==`system`){N(d);return}if(d===`system`&&(window.matchMedia&&window.matchMedia(`(prefers-color-scheme: dark)`).matches?N(`dark`):N(`light`)),typeof window>`u`)return;let e=window.matchMedia(`(prefers-color-scheme: dark)`);try{e.addEventListener(`change`,({matches:e})=>{N(e?`dark`:`light`)})}catch{e.addListener(({matches:e})=>{try{N(e?`dark`:`light`)}catch(e){console.error(e)}})}},[d]),U.useEffect(()=>{S.length<=1&&k(!1)},[S]),U.useEffect(()=>{let e=e=>{if(a.length>0&&a.every(t=>e[t]||e.code===t)){var t;k(!0),(t=P.current)==null||t.focus()}e.code===`Escape`&&(document.activeElement===P.current||P.current?.contains(document.activeElement))&&k(!1)};return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[a]),U.useEffect(()=>{if(P.current)return()=>{I.current&&(I.current.focus({preventScroll:!0}),I.current=null,L.current=!1)}},[P.current]),U.createElement(`section`,{ref:t,"aria-label":b??`${x} ${F}`,tabIndex:-1,"aria-live":`polite`,"aria-relevant":`additions text`,"aria-atomic":`false`,suppressHydrationWarning:!0,"data-react-aria-top-layer":!0},T.map((t,n)=>{let[i,a]=t.split(`-`);return w.length?U.createElement(`ol`,{key:t,dir:_===`auto`?ii():_,tabIndex:-1,ref:P,className:c,"data-sonner-toaster":!0,"data-sonner-theme":M,"data-y-position":i,"data-x-position":a,style:{"--front-toast-height":`${E[0]?.height||0}px`,"--width":`${Zr}px`,"--gap":`${v}px`,...m,...ai(l,u)},onBlur:e=>{L.current&&!e.currentTarget.contains(e.relatedTarget)&&(L.current=!1,I.current&&=(I.current.focus({preventScroll:!0}),null))},onFocus:e=>{e.target instanceof HTMLElement&&e.target.dataset.dismissible===`false`||L.current||(L.current=!0,I.current=e.relatedTarget)},onMouseEnter:()=>k(!0),onMouseMove:()=>k(!0),onMouseLeave:()=>{A||k(!1)},onDragEnd:()=>k(!1),onPointerDown:e=>{e.target instanceof HTMLElement&&e.target.dataset.dismissible===`false`||j(!0)},onPointerUp:()=>j(!1)},w.filter(e=>!e.position&&n===0||e.position===t).map((n,i)=>U.createElement(ri,{key:n.id,icons:y,index:i,toast:n,defaultRichColors:f,duration:g?.duration??p,className:g?.className,descriptionClassName:g?.descriptionClassName,invert:r,visibleToasts:h,closeButton:g?.closeButton??s,interacting:A,position:t,style:g?.style,unstyled:g?.unstyled,classNames:g?.classNames,cancelButtonStyle:g?.cancelButtonStyle,actionButtonStyle:g?.actionButtonStyle,closeButtonAriaLabel:g?.closeButtonAriaLabel,removeToast:R,toasts:w.filter(e=>e.position==n.position),heights:E.filter(e=>e.position==n.position),setHeights:D,expandByDefault:o,gap:v,expanded:O,swipeDirections:e.swipeDirections}))):null}))}),si=n((e=>{var t=d();function n(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var r=typeof Object.is==`function`?Object.is:n,i=t.useState,a=t.useEffect,o=t.useLayoutEffect,s=t.useDebugValue;function c(e,t){var n=t(),r=i({inst:{value:n,getSnapshot:t}}),c=r[0].inst,u=r[1];return o(function(){c.value=n,c.getSnapshot=t,l(c)&&u({inst:c})},[e,n,t]),a(function(){return l(c)&&u({inst:c}),e(function(){l(c)&&u({inst:c})})},[e]),s(n),n}function l(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!r(e,n)}catch{return!0}}function u(e,t){return t()}var f=typeof window>`u`||window.document===void 0||window.document.createElement===void 0?u:c;e.useSyncExternalStore=t.useSyncExternalStore===void 0?f:t.useSyncExternalStore})),ci=n(((e,t)=>{t.exports=si()})),li=n((e=>{var t=d(),n=ci();function r(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var i=typeof Object.is==`function`?Object.is:r,a=n.useSyncExternalStore,o=t.useRef,s=t.useEffect,c=t.useMemo,l=t.useDebugValue;e.useSyncExternalStoreWithSelector=function(e,t,n,r,u){var d=o(null);if(d.current===null){var f={hasValue:!1,value:null};d.current=f}else f=d.current;d=c(function(){function e(e){if(!a){if(a=!0,o=e,e=r(e),u!==void 0&&f.hasValue){var t=f.value;if(u(t,e))return s=t}return s=e}if(t=s,i(o,e))return t;var n=r(e);return u!==void 0&&u(t,n)?(o=e,t):(o=e,s=n)}var a=!1,o,s,c=n===void 0?null:n;return[function(){return e(t())},c===null?void 0:function(){return e(c())}]},[t,n,r,u]);var p=a(e,d[0],d[1]);return s(function(){f.hasValue=!0,f.value=p},[p]),l(p),p}})),ui=n(((e,t)=>{t.exports=li()})),di={};function fi(e,t){let n=U.useRef(di);return n.current===di&&(n.current=e(t)),n}function pi(e,t,n,r){let i=fi(hi).current;return gi(i,e,t,n,r)&&vi(i,[e,t,n,r]),i.callback}function mi(e){let t=fi(hi).current;return _i(t,e)&&vi(t,e),t.callback}function hi(){return{callback:null,cleanup:null,refs:[]}}function gi(e,t,n,r,i){return e.refs[0]!==t||e.refs[1]!==n||e.refs[2]!==r||e.refs[3]!==i}function _i(e,t){return e.refs.length!==t.length||e.refs.some((e,n)=>e!==t[n])}function vi(e,t){e.refs=t,e.callback=t.every(e=>e==null)?null:n=>{if(e.cleanup&&=(e.cleanup(),null),n!=null){let r=Array(t.length).fill(null);for(let e=0;e<t.length;e+=1){let i=t[e];if(i!=null)switch(typeof i){case`function`:{let t=i(n);typeof t==`function`&&(r[e]=t);break}case`object`:i.current=n}}e.cleanup=()=>{for(let e=0;e<t.length;e+=1){let n=t[e];if(n!=null)switch(typeof n){case`function`:{let t=r[e];typeof t==`function`?t():n(null);break}case`object`:n.current=null}}}}}}var yi=19;function bi(e){return yi>=e}function xi(e){if(!U.isValidElement(e))return null;let t=e,n=t.props;return(bi(19)?n?.ref:t.ref)??null}function Si(e,t){if(e&&!t)return e;if(!e&&t)return t;if(e||t)return{...e,...t}}function Ci(){}var wi=Object.freeze([]),Ti=Object.freeze({});function Ei(e,t){let n={};for(let r in e){let i=e[r];if(t?.hasOwnProperty(r)){let e=t[r](i);e!=null&&Object.assign(n,e)}else i===!0?n[`data-${r.toLowerCase()}`]=``:i&&(n[`data-${r.toLowerCase()}`]=i.toString())}return n}function Di(e,t){return typeof e==`function`?e(t):e}function Oi(e,t){return typeof e==`function`?e(t):e}var ki={};function Ai(e,t,n,r,i){if(!n&&!r&&!i&&!e)return Mi(t);let a=Mi(e);return t&&(a=Ni(a,t)),n&&(a=Ni(a,n)),r&&(a=Ni(a,r)),i&&(a=Ni(a,i)),a}function ji(e){if(e.length===0)return ki;if(e.length===1)return Mi(e[0]);let t=Mi(e[0]);for(let n=1;n<e.length;n+=1)t=Ni(t,e[n]);return t}function Mi(e){return Li(e)?{...e(ki)}:Pi(e)}function Ni(e,t){return Li(t)?t(e):Fi(e,t)}function Pi(e){let t={...e};for(let e in t){let n=t[e];Ii(e,n)&&(t[e]=zi(n))}return t}function Fi(e,t){if(!t)return e;for(let n in t){let r=t[n];switch(n){case`style`:e[n]=Si(e.style,r);break;case`className`:e[n]=Vi(e.className,r);break;default:e[n]=Ii(n,r)?Ri(e[n],r):r}}return e}function Ii(e,t){let n=e.charCodeAt(0),r=e.charCodeAt(1),i=e.charCodeAt(2);return n===111&&r===110&&i>=65&&i<=90&&(typeof t==`function`||t===void 0)}function Li(e){return typeof e==`function`}function Ri(e,t){return t?e?(...n)=>{let r=n[0];if(Hi(r)){let i=r;Bi(i);let a=t(...n);return i.baseUIHandlerPrevented||e?.(...n),a}let i=t(...n);return e?.(...n),i}:zi(t):e}function zi(e){return e&&((...t)=>{let n=t[0];return Hi(n)&&Bi(n),e(...t)})}function Bi(e){return e.preventBaseUIHandler=()=>{e.baseUIHandlerPrevented=!0},e}function Vi(e,t){return t?e?t+` `+e:t:e}function Hi(e){return typeof e==`object`&&!!e&&`nativeEvent`in e}function Ui(e,t,n={}){let r=t.render;n.enabled!==!1&&(r=qi(r));let i=Wi(t,n,r);if(n.enabled===!1)return null;let a=n.state??Ti;return Ji(e,r,i,a)}function Wi(e,t,n){let{className:r,style:i}=e,{state:a=Ti,ref:o,props:s,stateAttributesMapping:c,enabled:l=!0}=t,u=l?Di(r,a):void 0,d=l?Oi(i,a):void 0,f=l?Ei(a,c):Ti,p=l&&s?Gi(s):void 0,m=l?Si(f,p)??{}:Ti;return typeof document<`u`&&(l?m.ref=Array.isArray(o)?mi([m.ref,xi(n),...o]):pi(m.ref,xi(n),o):pi(null,null)),l?(u!==void 0&&(m.className=Vi(m.className,u)),d!==void 0&&(m.style=Si(m.style,d)),m):Ti}function Gi(e){return Array.isArray(e)?ji(e):Ai(void 0,e)}var Ki=Symbol.for(`react.lazy`);function qi(e){if(e?.$$typeof!==Ki)return e;let t=U.Children.toArray(e)[0];return U.isValidElement(t)?t:e}function Ji(e,t,n,r){if(t){if(typeof t==`function`)return t(n,r);let e=Ai(n,t.props);return e.ref=n.ref,U.cloneElement(t,e)}return Yi(e,n)}function Yi(e,t){return e===`button`?(0,U.createElement)(`button`,{type:`button`,...t,key:t.key}):e===`img`?(0,U.createElement)(`img`,{alt:``,...t,key:t.key}):U.createElement(e,t)}function Xi(e,t){return function(n,...r){let i=new URL(e);return i.searchParams.set(`code`,n.toString()),r.forEach(e=>i.searchParams.append(`args[]`,e)),`${t} error #${n}; visit ${i} for the full message.`}}var Zi=Xi(`https://base-ui.com/production-error`,`Base UI`),Qi=U.createContext(void 0);function $i(){let e=U.useContext(Qi);if(e===void 0)throw Error(Zi(13));return e}var ea={imageLoadingStatus:()=>null},ta=U.forwardRef(function(e,t){let{className:n,render:r,style:i,...a}=e,[o,s]=U.useState(`idle`),c={imageLoadingStatus:o},l=U.useMemo(()=>({imageLoadingStatus:o,setImageLoadingStatus:s}),[o,s]),u=Ui(`span`,e,{state:c,ref:t,props:a,stateAttributesMapping:ea});return(0,W.jsx)(Qi.Provider,{value:l,children:u})}),na={...U},ra=na.useInsertionEffect,ia=ra&&ra!==na.useLayoutEffect?ra:e=>e();function q(e){let t=fi(aa).current;return t.next=e,ia(t.effect),t.trampoline}function aa(){let e={next:void 0,callback:oa,trampoline:(...t)=>e.callback?.(...t),effect:()=>{e.callback=e.next}};return e}function oa(){}var J=typeof document<`u`?U.useLayoutEffect:()=>{};function sa(e){U.useEffect(e,wi)}var ca=null;globalThis.requestAnimationFrame;var la=new class{callbacks=[];callbacksCount=0;nextId=1;startId=1;isScheduled=!1;tick=e=>{this.isScheduled=!1;let t=this.callbacks,n=this.callbacksCount;if(this.callbacks=[],this.callbacksCount=0,this.startId=this.nextId,n>0)for(let n=0;n<t.length;n+=1)t[n]?.(e)};request(e){let t=this.nextId;return this.nextId+=1,this.callbacks.push(e),this.callbacksCount+=1,this.isScheduled||=(requestAnimationFrame(this.tick),!0),t}cancel(e){let t=e-this.startId;t<0||t>=this.callbacks.length||this.callbacks[t]!==null&&(this.callbacks[t]=null,--this.callbacksCount)}},ua=class e{static create(){return new e}static request(e){return la.request(e)}static cancel(e){return la.cancel(e)}currentId=ca;request(e){this.cancel(),this.currentId=la.request(()=>{this.currentId=ca,e()})}cancel=()=>{this.currentId!==ca&&(la.cancel(this.currentId),this.currentId=ca)};disposeEffect=()=>this.cancel};function da(){let e=fi(ua.create).current;return sa(e.disposeEffect),e}function fa(e){return e==null?e:`current`in e?e.current:e}function pa(e,t){return e.getAnimations(t).filter(e=>{let t=e.effect?.getTiming();return t?.duration!==1/0&&t?.iterations!==1/0})}var ma=`data-starting-style`,ha=`data-ending-style`,ga=null;function _a(e){if(!ga){let e=[];ga=e,queueMicrotask(()=>{ga=null,oe.flushSync(()=>{for(let t of e)t()})})}ga.push(e)}function va(e,t=!1,n=!1){let r=da();return q((i,a=null)=>{r.cancel();let o=fa(e);if(o==null)return;let s=o,c=()=>{n?_a(()=>{a?.aborted||i()}):oe.flushSync(i)};if(typeof s.getAnimations!=`function`||globalThis.BASE_UI_ANIMATIONS_DISABLED){i();return}function l(){Promise.all(pa(s).map(e=>e.finished.then(Ci))).then(()=>{a?.aborted||c()},()=>{a?.aborted||(pa(s).some(e=>e.pending||e.playState!==`finished`)?l():c())})}if(t){let e=ma;if(!s.hasAttribute(e)){r.request(l);return}let t=new MutationObserver(()=>{s.hasAttribute(e)||(t.disconnect(),l())});t.observe(s,{attributes:!0,attributeFilter:[e]}),a?.addEventListener(`abort`,()=>t.disconnect(),{once:!0})}else r.request(l)})}function ya(e){let{enabled:t=!0,open:n,ref:r,batch:i=!1,onComplete:a}=e,o=q(a),s=va(r,n,i);U.useEffect(()=>{if(!t)return;let e=new AbortController;return s(o,e.signal),()=>{e.abort()}},[t,n,o,s])}var ba={[ma]:``},xa={[ha]:``},Sa={transitionStatus(e){return e===`starting`?ba:e===`ending`?xa:null}};function Ca(e,t=!1,n=!1,r=!1){let[i,a]=U.useState(e&&t?`idle`:void 0),[o,s]=U.useState(e&&!r);return e&&!o&&(s(!0),a(`starting`)),!e&&o&&i!==`ending`&&!n&&a(`ending`),!e&&!o&&i===`ending`&&a(void 0),J(()=>{if(!e&&o&&i!==`ending`&&n){let e=ua.request(()=>{a(`ending`)});return()=>{ua.cancel(e)}}},[e,o,i,n]),J(()=>{if(!e||t||i===void 0)return;let n=ua.request(()=>{a(void 0)});return()=>{ua.cancel(n)}},[t,e,i]),J(()=>{if(!e||!t)return;e&&o&&i!==`idle`&&a(`starting`);let n=ua.request(()=>{a(`idle`)});return()=>{ua.cancel(n)}},[t,e,o,i]),{mounted:o,setMounted:s,transitionStatus:i}}function wa(e,{referrerPolicy:t,crossOrigin:n,sizes:r,srcSet:i},a){let o=U.useState(`idle`),s=o[1];return J(()=>{if(!a)return Ci;if(!e&&!i)return s(`error`),Ci;let o=!0,c=new window.Image,l=e=>()=>{o&&s(e)};return s(`loading`),c.onload=l(`loaded`),c.onerror=l(`error`),t&&(c.referrerPolicy=t),c.crossOrigin=n??null,r&&(c.sizes=r),i&&(c.srcset=i),e&&(c.src=e),c.complete&&s(c.naturalWidth>0?`loaded`:`error`),()=>{o=!1}},[a,e,i,r,n,t,s]),o}var Ta={...ea,...Sa},Ea=U.forwardRef(function(e,t){let{className:n,render:r,onLoadingStatusChange:i,keepMounted:a=!1,style:o,sizes:s,srcSet:c,src:l,...u}=e,{setImageLoadingStatus:d}=$i(),[f,p]=wa(l,e,!a),m=f===`loaded`,{mounted:h,transitionStatus:g,setMounted:_}=Ca(m),v=U.useRef(null),y=U.useRef(!0);J(()=>{if(!a)return;let e=y.current;y.current=!1;let t=v.current;if(!t)return;if(!t.complete){p(`loading`);return}let n=t.naturalWidth>0?`loaded`:`error`;p(n),n===`loaded`&&e&&_(!0)},[a,l,c,s,u.crossOrigin,u.referrerPolicy,r,p,_]);let b=a?{"data-loading":f===`loading`?``:void 0,"data-error":f===`error`?``:void 0,"aria-hidden":f!==`loaded`||void 0,onLoad(){p(`loaded`)},onError(){p(`error`)}}:void 0,x=q(e=>{i?.(e),d(e)});J(()=>{f!==`idle`&&x(f)},[f,x]),J(()=>()=>d(`idle`),[d]),ya({enabled:!m,open:m,ref:v,onComplete(){m||_(!1)}});let S={imageLoadingStatus:f,transitionStatus:a&&g===`ending`?void 0:g},C=a||h,w={};s!==void 0&&(w.sizes=s),c!==void 0&&(w.srcSet=c),l!==void 0&&(w.src=l);let T=Ui(`img`,e,{state:S,ref:[t,v],props:[b,u,w],stateAttributesMapping:Ta,enabled:C});return C?T:null}),Da=0,Oa=class e{static create(){return new e}currentId=Da;start(e,t){this.clear(),this.currentId=setTimeout(()=>{this.currentId=Da,t()},e)}isStarted(){return this.currentId!==Da}clear=()=>{this.currentId!==Da&&(clearTimeout(this.currentId),this.currentId=Da)};disposeEffect=()=>this.clear};function ka(){let e=fi(Oa.create).current;return sa(e.disposeEffect),e}var Aa=U.forwardRef(function(e,t){let{className:n,render:r,delay:i=0,style:a,...o}=e,{imageLoadingStatus:s}=$i(),[c,l]=U.useState(i===0),u=ka();return U.useEffect(()=>(i>0?u.start(i,()=>l(!0)):l(!0),u.clear),[u,i]),Ui(`span`,e,{state:{imageLoadingStatus:s},ref:t,props:o,stateAttributesMapping:ea,enabled:s!==`loaded`&&(i===0||c)})});function ja({className:e,size:t=`default`,...n}){return(0,W.jsx)(ta,{"data-slot":`avatar`,"data-size":t,className:K(`group/avatar relative flex size-8 shrink-0 rounded-full select-none after:absolute after:inset-0 after:rounded-full after:border after:border-border after:mix-blend-darken data-[size=lg]:size-10 data-[size=sm]:size-6 dark:after:mix-blend-lighten`,e),...n})}function Ma({className:e,...t}){return(0,W.jsx)(Ea,{"data-slot":`avatar-image`,className:K(`aspect-square size-full rounded-full object-cover`,e),...t})}function Na({className:e,...t}){return(0,W.jsx)(Aa,{"data-slot":`avatar-fallback`,className:K(`flex size-full items-center justify-center rounded-full bg-muted text-sm text-muted-foreground group-data-[size=sm]/avatar:text-xs`,e),...t})}function Pa({name:e,image:t,className:n}){return(0,W.jsxs)(ja,{"aria-hidden":`true`,className:K(`size-8 overflow-hidden rounded-full text-xs`,n),children:[t&&(0,W.jsx)(Ma,{src:t,alt:``}),(0,W.jsx)(Na,{className:`rounded-full bg-primary/10 font-medium text-primary text-[length:inherit]`,children:e.trim().split(/\s+/).slice(0,2).map(e=>e.slice(0,1)).join(``).toUpperCase()||`?`})]})}function Fa({name:e,email:t,image:n}){return(0,W.jsxs)(`span`,{className:`flex min-w-0 items-center gap-3`,children:[(0,W.jsx)(Pa,{name:e,image:n}),(0,W.jsxs)(`span`,{className:`min-w-0`,children:[(0,W.jsx)(`span`,{dir:`auto`,className:`block wrap-anywhere whitespace-normal font-medium`,children:e}),(0,W.jsx)(`span`,{className:`block break-all whitespace-normal text-xs text-muted-foreground`,children:t})]})]})}var Ia={list_members:[`membership.`,`role.`,`project.`],list_workspace_members:[`membership.`,`role.`,`project.`],list_workspace_roles:[`role.`,`membership.`,`project.`],list_project_roles:[`role.`,`membership.`,`project.`],list_invitations:[`invitation.`,`membership.`],list_project_labels:[`label.`,`project.`],list_workflow_states:[`workflow.`,`project.`,`ticket.`],list_workspace_labels:[`label.`,`project.`],list_custom_fields:[`custom_field.`,`project.`,`ticket.`],list_calendar_feeds:[`calendar_feed.`,`label.`,`membership.`,`project.`],list_label_colors:[`label.`],list_views:[`label.`,`custom_field.`,`project.`],get_project:[`project.`,`label.`],list_project_destinations:[`destination.`,`project.`],list_notification_channels:[],list_imports:[],get_import:[],list_deleted_accounts:[`membership.`]};function La(e){return t=>{let[n,,r,i]=t.queryKey;if(n!==`kanvil`)return!1;if(typeof r!=`string`||!i||typeof i!=`object`)return!0;let a=Ia[r];if(a&&!a.some(t=>e.type.startsWith(t)))return!1;let o=Reflect.get(i,`projectId`),s=Reflect.get(i,`ticketId`);return typeof o==`string`?o===e.projectId?!e.ticketId||typeof s!=`string`||s===e.ticketId||s===e.data.key:!1:!0}}function Ra(e,t){let n=[],r=!1,i,a=()=>i||(i=Promise.resolve().then(async()=>{for(;!t.aborted&&(r||n.length);){let t=r?void 0:n;n=[],r=!1,await e(t)}}).finally(()=>{if(i=void 0,!t.aborted&&(r||n.length))return a()}),i);return{push:e=>{t.aborted||(n.push(e),a().catch(()=>{}))},flush:()=>t.aborted?Promise.resolve():(r=!0,a())}}var za=Object.create(null),Ba=e=>({}),Va=new Proxy(za,{get(e,t){return Ba()[t]??za[t]},has(e,t){return t in Ba()||t in za},set(e,t,n){let r=Ba(!0);return r[t]=n,!0},deleteProperty(e,t){if(!t)return!1;let n=Ba(!0);return delete n[t],!0},ownKeys(){let e=Ba(!0);return Object.keys(e)}});Va.NODE_ENV;function Ha(e,t){return typeof process<`u`?{}[e]??t:typeof Deno<`u`?Deno.env.get(e)??t:typeof Bun<`u`?Bun.env[e]??t:t}Object.freeze({get BETTER_AUTH_SECRET(){return Ha(`BETTER_AUTH_SECRET`)},get AUTH_SECRET(){return Ha(`AUTH_SECRET`)},get BETTER_AUTH_TELEMETRY(){return Ha(`BETTER_AUTH_TELEMETRY`)},get BETTER_AUTH_TELEMETRY_ID(){return Ha(`BETTER_AUTH_TELEMETRY_ID`)},get NODE_ENV(){return Ha(`NODE_ENV`,`development`)},get PACKAGE_VERSION(){return Ha(`PACKAGE_VERSION`,`0.0.0`)},get BETTER_AUTH_TELEMETRY_ENDPOINT(){return Ha(`BETTER_AUTH_TELEMETRY_ENDPOINT`,``)}});var Ua=1,Wa=4,Ga=8,Ka=24,qa={eterm:Wa,cons25:Wa,console:Wa,cygwin:Wa,dtterm:Wa,gnome:Wa,hurd:Wa,jfbterm:Wa,konsole:Wa,kterm:Wa,mlterm:Wa,mosh:Ka,putty:Wa,st:Wa,"rxvt-unicode-24bit":Ka,terminator:Ka,"xterm-kitty":Ka},Ja=new Map(Object.entries({APPVEYOR:Ga,BUILDKITE:Ga,CIRCLECI:Ka,DRONE:Ga,GITEA_ACTIONS:Ka,GITHUB_ACTIONS:Ka,GITLAB_CI:Ga,TRAVIS:Ga})),Ya=[/ansi/,/color/,/linux/,/direct/,/^con[0-9]*x[0-9]/,/^rxvt/,/^screen/,/^xterm/,/^vt100/,/^vt220/];function Xa(){if(Ha(`FORCE_COLOR`)!==void 0)switch(Ha(`FORCE_COLOR`)){case``:case`1`:case`true`:return Wa;case`2`:return Ga;case`3`:return Ka;default:return Ua}if(Ha(`NODE_DISABLE_COLORS`)!==void 0&&Ha(`NODE_DISABLE_COLORS`)!==``||Ha(`NO_COLOR`)!==void 0&&Ha(`NO_COLOR`)!==``||Ha(`TERM`)===`dumb`)return Ua;if(Ha(`TMUX`))return Ka;if(`TF_BUILD`in Va&&`AGENT_NAME`in Va)return Wa;if(`CI`in Va){for(let{0:e,1:t}of Ja)if(e in Va)return t;return Ha(`CI_NAME`)===`codeship`?Ga:Ua}if(`TEAMCITY_VERSION`in Va)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.exec(Ha(`TEAMCITY_VERSION`))===null?Ua:Wa;switch(Ha(`TERM_PROGRAM`)){case`iTerm.app`:return!Ha(`TERM_PROGRAM_VERSION`)||/^[0-2]\./.exec(Ha(`TERM_PROGRAM_VERSION`))!==null?Ga:Ka;case`HyperTerm`:case`MacTerm`:return Ka;case`Apple_Terminal`:return Ga}if(Ha(`COLORTERM`)===`truecolor`||Ha(`COLORTERM`)===`24bit`)return Ka;if(Ha(`TERM`)){if(/truecolor/.exec(Ha(`TERM`))!==null)return Ka;if(/^xterm-256/.exec(Ha(`TERM`))!==null)return Ga;let e=Ha(`TERM`).toLowerCase();if(qa[e])return qa[e];if(Ya.some(t=>t.exec(e)!==null))return Wa}return Ha(`COLORTERM`)?Wa:Ua}var Za=Symbol.for(`better-auth:global`),Qa=null,$a={},eo=`1.7.10`;function to(){return globalThis[Za]||(globalThis[Za]={version:eo,epoch:1,context:$a},Qa=globalThis[Za]),Qa=globalThis[Za],Qa.version!==eo&&(Qa.version=eo,Qa.epoch++),globalThis[Za]}function no(){return to().context.endpointContextAsyncStorage?.getStore()}var ro={reset:`\x1B[0m`,bright:`\x1B[1m`,dim:`\x1B[2m`,undim:`\x1B[22m`,underscore:`\x1B[4m`,blink:`\x1B[5m`,reverse:`\x1B[7m`,hidden:`\x1B[8m`,fg:{black:`\x1B[30m`,red:`\x1B[31m`,green:`\x1B[32m`,yellow:`\x1B[33m`,blue:`\x1B[34m`,magenta:`\x1B[35m`,cyan:`\x1B[36m`,white:`\x1B[37m`},bg:{black:`\x1B[40m`,red:`\x1B[41m`,green:`\x1B[42m`,yellow:`\x1B[43m`,blue:`\x1B[44m`,magenta:`\x1B[45m`,cyan:`\x1B[46m`,white:`\x1B[47m`}},io=[`debug`,`info`,`success`,`warn`,`error`];function ao(e,t){return io.indexOf(t)>=io.indexOf(e)}var oo={info:ro.fg.blue,success:ro.fg.green,warn:ro.fg.yellow,error:ro.fg.red,debug:ro.fg.magenta},so=(e,t,n)=>{let r=new Date().toISOString();return n?`${ro.dim}${r}${ro.reset} ${oo[e]}${e.toUpperCase()}${ro.reset} ${ro.bright}[Better Auth]:${ro.reset} ${t}`:`${r} ${e.toUpperCase()} [Better Auth]: ${t}`},co=(e=>{let t=e?.disabled!==!0,n=e?.level??`warn`,r=e?.disableColors===void 0?Xa()!==1:!e.disableColors,i=(i,a,o=[])=>{if(!t||!ao(n,i))return;let s=so(i,a,r);!e||typeof e.log!=`function`?i===`error`?console.error(s,...o):i===`warn`?console.warn(s,...o):console.log(s,...o):e.log(i===`success`?`info`:i,a,...o)};return{...Object.fromEntries(io.map(e=>[e,(...[t,...n])=>i(e,t,n)])),get level(){return n}}})(),lo=()=>{let e=no()?.context.logger;return e&&e!==uo?e:co},uo={debug:(...e)=>lo().debug(...e),info:(...e)=>lo().info(...e),success:(...e)=>lo().success(...e),warn:(...e)=>lo().warn(...e),error:(...e)=>lo().error(...e),get level(){return lo().level}};function fo(e){return Object.fromEntries(Object.entries(e).map(([e,t])=>[e,{code:e,message:t,toString:()=>e}]))}function po(){let e=Object.getOwnPropertyDescriptor(Error,`stackTraceLimit`);return e===void 0?Object.isExtensible(Error):Object.prototype.hasOwnProperty.call(e,`writable`)?e.writable:e.set!==void 0}function mo(e){let t=e.split(`
3
- at `);return t.length<=1?e:(t.splice(1,1),t.join(`
4
- at `))}function ho(e,t){class n extends e{#e;constructor(...e){if(po()){let t=Error.stackTraceLimit;Error.stackTraceLimit=0,super(...e),Error.stackTraceLimit=t}else super(...e);let t=Error().stack;t&&(this.#e=mo(t.replace(/^Error/,this.name)))}get errorStack(){return this.#e}}return Object.defineProperty(n.prototype,"constructor",{get(){return t},enumerable:!1,configurable:!0}),n}var go={OK:200,CREATED:201,ACCEPTED:202,NO_CONTENT:204,MULTIPLE_CHOICES:300,MOVED_PERMANENTLY:301,FOUND:302,SEE_OTHER:303,NOT_MODIFIED:304,TEMPORARY_REDIRECT:307,BAD_REQUEST:400,UNAUTHORIZED:401,PAYMENT_REQUIRED:402,FORBIDDEN:403,NOT_FOUND:404,METHOD_NOT_ALLOWED:405,NOT_ACCEPTABLE:406,PROXY_AUTHENTICATION_REQUIRED:407,REQUEST_TIMEOUT:408,CONFLICT:409,GONE:410,LENGTH_REQUIRED:411,PRECONDITION_FAILED:412,PAYLOAD_TOO_LARGE:413,URI_TOO_LONG:414,UNSUPPORTED_MEDIA_TYPE:415,RANGE_NOT_SATISFIABLE:416,EXPECTATION_FAILED:417,"I'M_A_TEAPOT":418,MISDIRECTED_REQUEST:421,UNPROCESSABLE_ENTITY:422,LOCKED:423,FAILED_DEPENDENCY:424,TOO_EARLY:425,UPGRADE_REQUIRED:426,PRECONDITION_REQUIRED:428,TOO_MANY_REQUESTS:429,REQUEST_HEADER_FIELDS_TOO_LARGE:431,UNAVAILABLE_FOR_LEGAL_REASONS:451,INTERNAL_SERVER_ERROR:500,NOT_IMPLEMENTED:501,BAD_GATEWAY:502,SERVICE_UNAVAILABLE:503,GATEWAY_TIMEOUT:504,HTTP_VERSION_NOT_SUPPORTED:505,VARIANT_ALSO_NEGOTIATES:506,INSUFFICIENT_STORAGE:507,LOOP_DETECTED:508,NOT_EXTENDED:510,NETWORK_AUTHENTICATION_REQUIRED:511};ho(class extends Error{status;body;headers;statusCode;constructor(e=`INTERNAL_SERVER_ERROR`,t=void 0,n={},r=typeof e==`number`?e:go[e]){super(t?.message,t?.cause?{cause:t.cause}:void 0),this.status=e,this.body=t,this.headers=n,this.statusCode=r,this.name=`APIError`,this.status=e,this.headers=n,this.statusCode=r,this.body=t}},Error);var _o=class extends Error{constructor(e,t){super(e,t),this.name=`BetterAuthError`,this.message=e,this.stack=``}},vo=47;function yo(e){let t=e.length;for(;t>0&&e.charCodeAt(t-1)===vo;)t--;return t===e.length?e:e.slice(0,t)}function bo(e){try{return(yo(new URL(e).pathname)||`/`)!==`/`}catch{throw new _o(`Invalid base URL: ${e}. Please provide a valid base URL.`)}}function xo(e){try{let t=new URL(e);if(t.protocol!==`http:`&&t.protocol!==`https:`)throw new _o(`Invalid base URL: ${e}. URL must include 'http://' or 'https://'`)}catch(t){throw t instanceof _o?t:new _o(`Invalid base URL: ${e}. Please provide a valid base URL.`,{cause:t})}}function So(e,t=`/api/auth`){if(xo(e),bo(e))return e;let n=yo(e);return!t||t===`/`?n:(t=t.startsWith(`/`)?t:`/${t}`,`${n}${t}`)}function Co(e,t){return!e||e.trim()===``?!1:t===`proto`?e===`http`||e===`https`:t===`host`?[/\.\./,/\0/,/[\s]/,/^[.]/,/[<>'"]/,/javascript:/i,/file:/i,/data:/i].some(t=>t.test(e))?!1:/^[a-zA-Z0-9]([a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(\.[a-zA-Z0-9]([a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*(:[0-9]{1,5})?$/.test(e)||/^(\d{1,3}\.){3}\d{1,3}(:[0-9]{1,5})?$/.test(e)||/^\[[0-9a-fA-F:]+\](:[0-9]{1,5})?$/.test(e)||/^localhost(:[0-9]{1,5})?$/i.test(e):!1}function wo(e,t,n,r,i){if(e)return So(e,t);if(r!==!1){let e=Va.BETTER_AUTH_URL||Va.NEXT_PUBLIC_BETTER_AUTH_URL||Va.PUBLIC_BETTER_AUTH_URL||Va.NUXT_PUBLIC_BETTER_AUTH_URL||Va.NUXT_PUBLIC_AUTH_URL||(Va.BASE_URL===`/`?void 0:Va.BASE_URL);if(e)return So(e,t)}let a=n?.headers.get(`x-forwarded-host`),o=n?.headers.get(`x-forwarded-proto`);if(a&&o&&i&&Co(o,`proto`)&&Co(a,`host`))try{return So(`${o}://${a}`,t)}catch{}if(n){let e=To(n.url);if(!e)throw new _o(`Could not get origin from request. Please provide a valid base URL.`);return So(e,t)}if(typeof window<`u`&&window.location)return So(window.location.origin,t)}function To(e){try{let t=new URL(e);return t.origin===`null`?null:t.origin}catch{return null}}var Eo={proto:/"(?:_|\\u0{2}5[Ff]){2}(?:p|\\u0{2}70)(?:r|\\u0{2}72)(?:o|\\u0{2}6[Ff])(?:t|\\u0{2}74)(?:o|\\u0{2}6[Ff])(?:_|\\u0{2}5[Ff]){2}"\s*:/,constructor:/"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/,protoShort:/"__proto__"\s*:/,constructorShort:/"constructor"\s*:/},Do=/^\s*["[{]|^\s*-?\d{1,16}(\.\d{1,17})?([Ee][+-]?\d+)?\s*$/,Oo={true:!0,false:!1,null:null,undefined:void 0,nan:NaN,infinity:1/0,"-infinity":-1/0},ko=/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2})(?:\.(\d{1,7}))?(?:Z|([+-])(\d{2}):(\d{2}))$/;function Ao(e){return e instanceof Date&&!isNaN(e.getTime())}function jo(e){let t=ko.exec(e);if(!t)return null;let[,n,r,i,a,o,s,c,l,u,d]=t,f=new Date(Date.UTC(parseInt(n,10),parseInt(r,10)-1,parseInt(i,10),parseInt(a,10),parseInt(o,10),parseInt(s,10),c?parseInt(c.padEnd(3,`0`),10):0));if(l){let e=(parseInt(u,10)*60+parseInt(d,10))*(l===`+`?-1:1);f.setUTCMinutes(f.getUTCMinutes()+e)}return Ao(f)?f:null}function Mo(e,t={}){let{strict:n=!1,warnings:r=!1,reviver:i,parseDates:a=!0}=t;if(typeof e!=`string`)return e;let o=e.trim(),s=o.toLowerCase();if(s.length<=9&&s in Oo)return Oo[s];if(!Do.test(o)){if(n)throw SyntaxError(`[better-json] Invalid JSON`);return e}if(Object.entries(Eo).some(([e,t])=>{let n=t.test(o);return n&&r&&console.warn(`[better-json] Detected potential prototype pollution attempt using ${e} pattern`),n})&&n)throw Error(`[better-json] Potential prototype pollution attempt detected`);try{return JSON.parse(o,(e,t)=>{if(e===`__proto__`||e===`constructor`&&t&&typeof t==`object`&&`prototype`in t)r&&console.warn(`[better-json] Dropping "${e}" key to prevent prototype pollution`);else{if(a&&typeof t==`string`){let e=jo(t);if(e)return e}return i?i(e,t):t}})}catch(t){if(n)throw t;return e}}function No(e,t={strict:!0}){return Mo(e,t)}var Po=[`javascript:`,`data:`,`vbscript:`];function Fo(e){let t;try{t=new URL(e)}catch{return!0}return!Po.includes(t.protocol)}var Io={id:`redirect`,name:`Redirect`,hooks:{onSuccess(e){if(e.data?.url&&e.data?.redirect&&Fo(e.data.url)&&typeof window<`u`&&window.location&&window.location)try{window.location.href=e.data.url}catch{}}}},Lo=[],Ro=0,zo=null,Bo=4,Vo=globalThis.nanostoresGlobal||={epoch:0},Ho=()=>{let e,t;for(;Ro<Lo.length;){t=Ro,Ro+=Bo;let n=zo?.get(Lo[t]);if(n){if(!n.has(Lo[t+1]))continue;n.clear()}try{Lo[t](Lo[t+1].value,Lo[t+2],Lo[t+3])}catch(t){e=t}}if(Lo.length=Ro=0,e)throw e},Uo=e=>{let t=[],n={eq:Object.is,get(){return n.lc||n.listen(()=>{})(),n.value},init:e,lc:0,listen(e){return n.lc=t.push(e),()=>{zo?.get(e)?.delete(n);for(let t=Ro;t<Lo.length;)Lo[t]===e&&Lo[t+1]===n?Lo.splice(t,Bo):t+=Bo;let r=t.indexOf(e);~r&&(t.splice(r,1),--n.lc||n.off())}},notify(e,r){Vo.epoch++;let i=!Lo.length&&!0;for(let i of t)Lo.push(i,n,e,r);i&&Ho()},off(){},set(e){let t=n.value;n.eq(t,e)||(n.value=e,n.notify(t))},subscribe(e){let t=n.listen(e);return e(n.value),t},value:e};return n},Wo=2,Go=5,Ko=6,qo=10,Jo=(e,t,n,r)=>(e.events=e.events||{},e.events[n+qo]||(e.events[n+qo]=r(t=>{e.events[n].reduceRight((e,t)=>(t(e),e),{shared:{},...t})})),e.events[n]=e.events[n]||[],e.events[n].push(t),()=>{let r=e.events[n],i=r.indexOf(t);~i&&(r.splice(i,1),r.length||(e.events[n+qo](),delete e.events[n+qo]))}),Yo=(e,t)=>Jo(e,t,Wo,t=>{let n=e.set,r=e.setKey;return e.setKey&&=(n,i)=>{let a;if(t({abort:()=>{a=!0},changed:n,newValue:{...e.value,[n]:i}}),!a)return r(n,i)},e.set=e=>{let r;if(t({abort:()=>{r=!0},newValue:e}),!r)return n(e)},()=>{e.set=n,e.setKey=r}}),Xo=1e3,Zo=(e,t)=>Jo(e,n=>{let r=t(n);r&&e.events[Ko].push(r)},Go,t=>{let n=e.listen;e.listen=(...r)=>(!e.lc&&!e.active&&(e.active=!0,t()),n(...r));let r=e.off;return e.events[Ko]=[],e.off=()=>{r(),setTimeout(()=>{if(e.active&&!e.lc){e.active=!1;for(let t of e.events[Ko])t();e.events[Ko]=[]}},Xo)},()=>{e.listen=n,e.off=r}});function Qo(e,t){let n=es(t),r=e;for(let e of n){if(r==null)return;r=r[e]}return r}var $o=/(.*)\[(\d+)\]/;function es(e){return e.split(`.`).flatMap(e=>ts(e))}function ts(e){if($o.test(e)){let[,t,n]=e.match($o);return[...ts(t),n]}return[e]}function ns(e,t,n){let r=new Set(t);return e.listen((i,a,o)=>{let s=e=>!Object.is(Qo(i,e),Qo(a,e));(o===void 0?t.some(t=>a===void 0||(e.eqKey?!e.eqKey(a[t],i[t],t):s(t))):r.has(o)||typeof o==`string`&&(r.has(o.split(/\.|\[/)[0])||!e.eqKey&&a!==void 0&&t.some(s)))&&n(i,a,o)})}function rs(e){if(typeof e!=`object`||!e)return!1;let t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}function is(e,t){if(e===t)return!0;if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!is(e[n],t[n]))return!1;return!0}if(rs(e)&&rs(t)){let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let r of n)if(!(r in t)||!is(e[r],t[r]))return!1;return!0}return!1}function as(e,t){return Yo(e,({newValue:n,abort:r})=>{t(e.value,n)&&r()})}var os=Symbol.for(`better-auth:auth-query`);function ss(e){return os in e&&e[os]===!0}function cs(e){let t=Uo(e);return Object.defineProperty(t,os,{value:!0}),t}var ls=Symbol.for(`better-auth:broadcast-channel`),us=()=>Math.floor(Date.now()/1e3),ds=class{listeners=new Set;name;constructor(e=`better-auth.message`){this.name=e}subscribe(e){return this.listeners.add(e),()=>{this.listeners.delete(e)}}post(e){if(typeof window<`u`)try{localStorage.setItem(this.name,JSON.stringify({...e,timestamp:us()}))}catch{}}setup(){if(typeof window>`u`||window.addEventListener===void 0)return()=>{};let e=e=>{if(e.key!==this.name)return;let t=JSON.parse(e.newValue??`{}`);t?.event===`session`&&t?.data&&this.listeners.forEach(e=>e(t))};return window.addEventListener(`storage`,e),()=>{window.removeEventListener(`storage`,e)}}};function fs(e=`better-auth.message`){return globalThis[ls]||(globalThis[ls]=new ds(e)),globalThis[ls]}var ps=Symbol.for(`better-auth:focus-manager`),ms=class{listeners=new Set;subscribe(e){return this.listeners.add(e),()=>{this.listeners.delete(e)}}setFocused(e){this.listeners.forEach(t=>t(e))}setup(){if(typeof window>`u`||typeof document>`u`||window.addEventListener===void 0)return()=>{};let e=()=>{document.visibilityState===`visible`&&this.setFocused(!0)};return document.addEventListener(`visibilitychange`,e,!1),()=>{document.removeEventListener(`visibilitychange`,e,!1)}}};function hs(){return globalThis[ps]||(globalThis[ps]=new ms),globalThis[ps]}var gs=Symbol.for(`better-auth:online-manager`),_s=class{listeners=new Set;isOnline=typeof navigator<`u`?navigator.onLine:!0;subscribe(e){return this.listeners.add(e),()=>{this.listeners.delete(e)}}setOnline(e){this.isOnline=e,this.listeners.forEach(t=>t(e))}setup(){if(typeof window>`u`||window.addEventListener===void 0)return()=>{};let e=()=>this.setOnline(!0),t=()=>this.setOnline(!1);return window.addEventListener(`online`,e,!1),window.addEventListener(`offline`,t,!1),()=>{window.removeEventListener(`online`,e,!1),window.removeEventListener(`offline`,t,!1)}}};function vs(){return globalThis[gs]||(globalThis[gs]=new _s),globalThis[gs]}var ys=()=>Math.floor(Date.now()/1e3),bs=5;function xs(e){let{fetchSession:t,shouldPollSession:n=()=>!0,sessionSignal:r,options:i={}}=e,a=i.sessionOptions?.refetchInterval??0,o=i.sessionOptions?.refetchOnWindowFocus??!0,s=i.sessionOptions?.refetchWhenOffline??!1,c={isInitialized:!1,lastSessionRequest:0},l=()=>s||vs().isOnline,u=e=>{if(l()){if(e?.event===`storage`)t();else if(e?.event===`poll`)c.lastSessionRequest=ys(),t();else if(e?.event===`visibilitychange`){if(ys()-c.lastSessionRequest<bs)return;c.lastSessionRequest=ys(),t()}else t()}},d=e=>{fs().post({event:`session`,data:{trigger:e},clientId:Math.random().toString(36).substring(7)})},f=()=>{a&&a>0&&(c.pollInterval=setInterval(()=>{n()&&u({event:`poll`})},a*1e3))},p=()=>{c.unsubscribeBroadcast=fs().subscribe(()=>{u({event:`storage`})})},m=()=>{o&&(c.unsubscribeFocus=hs().subscribe(()=>{u({event:`visibilitychange`})}))},h=()=>{c.unsubscribeOnline=vs().subscribe(e=>{e&&u({event:`visibilitychange`})})},g=()=>{c.unsubscribeSignal=r.listen(()=>{t()})};return{init:()=>{c.isInitialized||(c.isInitialized=!0,f(),p(),m(),h(),g(),c.cleanupBroadcastSetup=fs().setup(),c.cleanupFocusSetup=hs().setup(),c.cleanupOnlineSetup=vs().setup())},cleanup:()=>{c.isInitialized&&(c.pollInterval&&=(clearInterval(c.pollInterval),void 0),c.unsubscribeBroadcast&&=(c.unsubscribeBroadcast(),void 0),c.unsubscribeFocus&&=(c.unsubscribeFocus(),void 0),c.unsubscribeOnline&&=(c.unsubscribeOnline(),void 0),c.unsubscribeSignal&&=(c.unsubscribeSignal(),void 0),c.cleanupBroadcastSetup&&=(c.cleanupBroadcastSetup(),void 0),c.cleanupFocusSetup&&=(c.cleanupFocusSetup(),void 0),c.cleanupOnlineSetup&&=(c.cleanupOnlineSetup(),void 0),c.isInitialized=!1,c.lastSessionRequest=0)},triggerRefetch:u,broadcastSessionUpdate:d}}var Ss=()=>typeof window>`u`,Cs=Xo;function ws(e,t){if(typeof window>`u`)return;let n=e.get();n.data===null&&t!==null&&e.set({...n,data:t,error:null,isPending:!1})}function Ts(e){return typeof e==`object`&&e&&`data`in e&&`error`in e?e:{data:e,error:null}}function Es(e){return!e||e.session===null&&e.user===null?null:e}function Ds(e,t){return is(e.data,t.data)&&e.error===t.error&&e.isPending===t.isPending&&e.isRefetching===t.isRefetching&&e.refetch===t.refetch}function Os(e,t){let n=Uo(!1),r,i=0,a=0;n.listen(()=>{a++,i=0});let o=e=>u(e),s=cs({data:null,error:null,isPending:!0,isRefetching:!1,refetch:o});as(s,Ds);let c=async(t,n)=>{let r=s.value;if(s.set({...r,isPending:r.data===null,isRefetching:!0,error:null,refetch:o}),t.aborted)return`aborted`;try{let r=await e(`/get-session`,{method:`GET`,query:n?.query,signal:t});if(t.aborted)return`aborted`;let{data:i,error:a}=Ts(r),c=`fresh`;if(i?.needsRefresh)try{let n=await e(`/get-session`,{method:`POST`,signal:t});if(t.aborted)return`aborted`;({data:i,error:a}=Ts(n))}catch{if(t.aborted)return`aborted`;c=`stale`}if(a){let e=s.value,t=a?.status===401;return s.set({data:t?null:e.data,error:a,isPending:!1,isRefetching:!1,refetch:o}),`failed`}let l=Es(i),u=s.value,d=u.data!=null&&l!=null&&is(u.data,l)?u.data:l;return s.set({data:d,error:null,isPending:!1,isRefetching:!1,refetch:o}),c}catch(e){if(t.aborted)return`aborted`;let n=s.value;return s.set({data:n.data,error:e,isPending:!1,isRefetching:!1,refetch:o}),`failed`}},l=()=>{let e=s.value.data?.session?.expiresAt,t=e instanceof Date?e.getTime():1/0;return Math.min(Date.now()+Cs,t)},u=e=>{i=0,r?.cancel();let t=new AbortController,n={cancel:()=>t.abort(),promise:Promise.resolve().then(()=>t.signal.aborted?`aborted`:c(t.signal,e)),revision:a};r=n;let o=e=>{r===n&&(r=void 0,e===`fresh`&&n.revision===a&&(i=l()))};return n.promise.then(o,()=>o(`failed`)),n.promise.then(()=>void 0)},d=()=>r?.revision===a?r.promise.then(()=>void 0):Date.now()<i?Promise.resolve():u(),f=()=>{};return Zo(s,()=>{let e;Ss()||(e=setTimeout(()=>{d()},0));let r=xs({fetchSession:u,shouldPollSession:()=>s.value.data!=null,sessionSignal:n,options:t});return r.init(),f=r.broadcastSessionUpdate,()=>{e&&clearTimeout(e),r.cleanup()}}),{session:s,$sessionSignal:n,broadcastSessionUpdate:e=>f(e)}}function ks(e){if(typeof e!=`object`||!e)return!1;let t=Object.getPrototypeOf(e);return t!==null&&t!==Object.prototype&&Object.getPrototypeOf(t)!==null||Symbol.iterator in e?!1:Symbol.toStringTag in e?Object.prototype.toString.call(e)===`[object Module]`:!0}function As(e,t,n=`.`,r){if(!ks(t))return As(e,{},n,r);let i={...t};for(let t of Object.keys(e)){if(t===`__proto__`||t===`constructor`)continue;let a=e[t];a!=null&&(r&&r(i,t,a,n)||(i[t]=Array.isArray(a)&&Array.isArray(i[t])?[...a,...i[t]]:ks(a)&&ks(i[t])?As(a,i[t],(n?`${n}.`:``)+t.toString(),r):a))}return i}function js(e){return(...t)=>t.reduce((t,n)=>As(t,n,``,e),{})}var Ms=js(),Ns=class extends Error{constructor(e,t,n){super(t||e.toString(),{cause:n}),this.status=e,this.statusText=t,this.error=n,Error.captureStackTrace(this,this.constructor)}},Ps=async(e,t)=>{let n=t||{},r={onRequest:[t?.onRequest],onResponse:[t?.onResponse],onSuccess:[t?.onSuccess],onError:[t?.onError],onRetry:[t?.onRetry]};if(!t||!t?.plugins)return{url:e,options:n,hooks:r};for(let i of t?.plugins||[]){if(i.init){let t=await i.init?.call(i,e.toString(),n);n=t.options||n,e=t.url}r.onRequest.push(i.hooks?.onRequest),r.onResponse.push(i.hooks?.onResponse),r.onSuccess.push(i.hooks?.onSuccess),r.onError.push(i.hooks?.onError),r.onRetry.push(i.hooks?.onRetry)}return{url:e,options:n,hooks:r}},Fs=class{constructor(e){this.options=e}shouldAttemptRetry(e,t){return this.options.shouldRetry?Promise.resolve(e<this.options.attempts&&this.options.shouldRetry(t)):Promise.resolve(e<this.options.attempts)}getDelay(){return this.options.delay}},Is=class{constructor(e){this.options=e}shouldAttemptRetry(e,t){return this.options.shouldRetry?Promise.resolve(e<this.options.attempts&&this.options.shouldRetry(t)):Promise.resolve(e<this.options.attempts)}getDelay(e){return Math.min(this.options.maxDelay,this.options.baseDelay*2**e)}};function Ls(e){if(typeof e==`number`)return new Fs({type:`linear`,attempts:e,delay:1e3});switch(e.type){case`linear`:return new Fs(e);case`exponential`:return new Is(e);default:throw Error(`Invalid retry strategy`)}}var Rs=[`get`,`post`,`put`,`patch`,`delete`];function zs(e){if(!e.startsWith(`@`))return{method:void 0,path:e};let t=e.indexOf(`/`),n=e.slice(1,t===-1?void 0:t);return Rs.includes(n)?{method:n,path:t===-1?e:e.slice(t+1)}:{method:void 0,path:e}}var Bs=e=>e===`.`||e===`..`,Vs=e=>e.split(`:`).map(e=>encodeURIComponent(e)).join(`:`);function Hs(e,t){let n=t.get(e);if(n===void 0)return Vs(e);if(Bs(n))throw TypeError(`Path parameters cannot be reserved path segments`);return encodeURIComponent(n)}function Us(e,t){let{baseURL:n,params:r,query:i}=t||{query:{},params:{},baseURL:``},a=e.startsWith(`http`)?e.split(`/`).slice(0,3).join(`/`):n||``,{path:o}=zs(e);o!==e&&(e=`/${o}`),a.endsWith(`/`)||(a+=`/`);let[s,c]=e.replace(a,``).split(`?`),l=new URLSearchParams(c);for(let[e,t]of Object.entries(i||{})){if(t==null)continue;let n;if(typeof t==`string`)n=t;else if(Array.isArray(t)){for(let n of t)l.append(e,n);continue}else n=JSON.stringify(t);l.set(e,n)}let u=new Map;if(r){if(Array.isArray(r)){let e=s.split(`/`).filter(e=>e.startsWith(`:`));for(let[t,n]of e.entries()){let e=r[t];u.set(n,String(e))}}else for(let[e,t]of Object.entries(r))u.set(`:${e}`,String(t))}s=s.split(`/`).map(e=>Hs(e,u)).join(`/`),s=s.replace(/^\/+/,``);let d=l.toString();return d=d.length>0?`?${d}`.replace(/\+/g,`%20`):``,a.startsWith(`http`)?new URL(`${s}${d}`,a):`${a}${s}${d}`}var Ws=async e=>{let t={},n=async e=>typeof e==`function`?await e():e;if(e?.auth){if(e.auth.type===`Bearer`){let r=await n(e.auth.token);if(!r)return t;t.authorization=`Bearer ${r}`}else if(e.auth.type===`Basic`){let[r,i]=await Promise.all([n(e.auth.username),n(e.auth.password)]);if(!r||!i)return t;t.authorization=`Basic ${btoa(`${r}:${i}`)}`}else if(e.auth.type===`Custom`){let[r,i]=await Promise.all([n(e.auth.prefix),n(e.auth.value)]);if(!i)return t;t.authorization=`${r??``} ${i}`}}return t},Gs=/^application\/(?:[\w!#$%&*.^`~-]*\+)?json(;.+)?$/i;function Ks(e){let t=e.headers.get(`content-type`),n=new Set([`image/svg`,`application/xml`,`application/xhtml`,`application/html`]);if(!t)return`json`;let r=t.split(`;`).shift()||``;return Gs.test(r)?`json`:n.has(r)||r.startsWith(`text/`)?`text`:`blob`}function qs(e){try{return JSON.parse(e),!0}catch{return!1}}function Js(e){if(e===void 0)return!1;let t=typeof e;return t===`string`||t===`number`||t===`boolean`||t===null?!0:t===`object`?Array.isArray(e)?!0:e.buffer?!1:e.constructor&&e.constructor.name===`Object`||typeof e.toJSON==`function`:!1}function Ys(e){try{return JSON.parse(e)}catch{return e}}function Xs(e){return typeof e==`function`}function Zs(e){if(e?.customFetchImpl)return e.customFetchImpl;if(typeof globalThis<`u`&&Xs(globalThis.fetch))return globalThis.fetch;if(typeof window<`u`&&Xs(window.fetch))return window.fetch;throw Error(`No fetch implementation found`)}function Qs(...e){let t={};for(let n of e)if(n){if(n instanceof Headers)n.forEach((e,n)=>{t[n]=e});else{let e=Array.isArray(n)?n:Object.entries(n);for(let[n,r]of e)r!=null&&(t[n]=r)}}return t}async function $s(e){let t=new Headers(Qs(e?.headers,await Ws(e)));if(!t.has(`content-type`)){let n=ec(e?.body);n&&t.set(`content-type`,n)}return t}function ec(e){return Js(e)?`application/json`:null}function tc(e){let t=e.get(`content-type`);return t?t.split(`;`)[0].trim().toLowerCase():null}function nc(e,t){let{body:n}=e;return n?!Js(n)||typeof n==`string`?n:tc(t)===`application/x-www-form-urlencoded`?new URLSearchParams(n).toString():JSON.stringify(n):null}function rc(e,t){if(t?.method)return t.method.toUpperCase();let{method:n}=zs(e);return n?n.toUpperCase():t?.body?`POST`:`GET`}function ic(e,t){let n;return!e?.signal&&e?.timeout&&(n=setTimeout(()=>t?.abort(),e?.timeout)),{abortTimeout:n,clearTimeout:()=>{n&&clearTimeout(n)}}}var ac=class e extends Error{constructor(t,n){super(n||JSON.stringify(t,null,2)),this.issues=t,Object.setPrototypeOf(this,e.prototype)}};async function oc(e,t){let n=await e[`~standard`].validate(t);if(n.issues)throw new ac(n.issues);return n.value}function sc(e){"@babel/helpers - typeof";return sc=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},sc(e)}function cc(e,t){if(sc(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(sc(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function lc(e){var t=cc(e,`string`);return sc(t)==`symbol`?t:t+``}function uc(e,t,n){return(t=lc(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function dc(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function fc(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?dc(Object(n),!0).forEach(function(t){uc(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):dc(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var pc=async(e,t)=>{var n;let{hooks:r,url:i,options:a}=await Ps(e,t),o=Zs(a),s=new AbortController,c=a.signal??s.signal,l=Us(i,a),u=await $s(a),d=nc(a,u),f=rc(i,a),p=fc(fc({},a),{},{url:l,headers:u,body:d,method:f,signal:c});for(let e of r.onRequest)if(e){let t=await e(p);typeof t==`object`&&t&&Object.assign(p,t)}(`pipeTo`in p&&typeof p.pipeTo==`function`||typeof(t==null||(n=t.body)==null?void 0:n.pipe)==`function`)&&(`duplex`in p||(p.duplex=`half`));let{clearTimeout:m}=ic(a,s),h=await o(p.url,p);m();let g={response:h,request:p};for(let e of r.onResponse)if(e){var _;let n=await e(fc(fc({},g),{},{response:t!=null&&(_=t.hookOptions)!=null&&_.cloneResponse?h.clone():h}));n instanceof Response?h=n:typeof n==`object`&&n&&(h=n.response)}if(h.ok){if(p.method===`HEAD`)return{data:``,error:null};let e=Ks(h),n={data:null,response:h,request:p};if(e===`json`||e===`text`){let e=await h.text();n.data=await(p.jsonParser??Ys)(e)}else n.data=await h[e]();p?.output&&p.output&&!p.disableValidation&&(n.data=await oc(p.output,n.data));for(let e of r.onSuccess)if(e){var v;await e(fc(fc({},n),{},{response:t!=null&&(v=t.hookOptions)!=null&&v.cloneResponse?h.clone():h}))}return t?.throw?n.data:{data:n.data,error:null}}let y=t?.jsonParser??Ys,b=await h.text(),x=qs(b),S=x?await y(b):null,C={response:h,responseText:b,request:p,error:fc(fc({},S),{},{status:h.status,statusText:h.statusText})};for(let e of r.onError)if(e){var w;await e(fc(fc({},C),{},{response:t!=null&&(w=t.hookOptions)!=null&&w.cloneResponse?h.clone():h}))}if(t?.retry){let n=Ls(t.retry),i=t.retryAttempt??0;if(await n.shouldAttemptRetry(i,h)){for(let e of r.onRetry)e&&await e(g);let a=n.getDelay(i);return await new Promise(e=>setTimeout(e,a)),await pc(e,fc(fc({},t),{},{retryAttempt:i+1}))}}if(t?.throw)throw new Ns(h.status,h.statusText,x?S:b);return{data:null,error:fc(fc({},S),{},{status:h.status,statusText:h.statusText})}},mc=e=>({id:`apply-schema`,name:`Apply Schema`,version:`1.0.0`,async init(t,n){var r;let i=fc(fc({},n),e.query!==void 0&&{query:fc(fc({},e.query),n?.query)}),a=((r=e.plugins)==null||(r=r.find(e=>e.schema?.config?t.startsWith(e.schema.config.baseURL||``)||t.startsWith(e.schema.config.prefix||``):!1))==null?void 0:r.schema)||e.schema;if(a){let r=t;a.config?.prefix&&r.startsWith(a.config.prefix)&&(r=r.replace(a.config.prefix,``),a.config.baseURL&&(t=t.replace(a.config.prefix,a.config.baseURL))),a.config?.baseURL&&r.startsWith(a.config.baseURL)&&(r=r.replace(a.config.baseURL,``)),r.startsWith(`/`)&&r.charAt(1)===`@`&&(r=r.substring(1));let o=a.schema[r];if(o){let{method:a,path:s}=zs(r);a&&(t=t.slice(0,t.length-r.length)+s);let c=n?.headers;if(o.headers&&!n?.disableValidation){let e={};if(n?.headers){if(n.headers instanceof Headers)n.headers.forEach((t,n)=>{e[n.toLowerCase()]=t});else if(typeof n.headers==`object`)for(let[t,r]of Object.entries(n.headers))r!=null&&(e[t.toLowerCase()]=r)}let t=await oc(o.headers,e),r={};for(let[e,n]of Object.entries(t))r[e.toLowerCase()]=n;c=r}let l=o.method??a;if(i=fc(fc(fc(fc({},i),l!==void 0&&{method:l}),o.output!==void 0&&{output:o.output}),c!==void 0&&{headers:c}),!n?.disableValidation){if(o.query&&(i.query=await oc(o.query,n?.query),i.query!==null&&typeof i.query==`object`)){let t=fc({},e.query);for(let e of Object.keys(t))n?.query&&Object.prototype.hasOwnProperty.call(n.query,e)&&(t[e]=n.query[e]);i.query=fc(fc({},t),i.query)}i=fc(fc({},i),{},{body:o.input?await oc(o.input,n?.body):n?.body,params:o.params?await oc(o.params,n?.params):n?.params})}return{url:t,options:i}}}return fc({url:t},(n!==void 0||e.query!==void 0)&&{options:i})}}),hc=e=>{async function t(t,n){let r=fc(fc(fc({},e),n),{},{headers:Qs(e?.headers,n?.headers),plugins:[...e?.plugins||[],mc(e||{}),...n?.plugins||[]]});if(e?.catchAllError)try{return await pc(t,r)}catch(e){return{data:null,error:{status:500,statusText:`Fetch Error`,message:`Fetch related error. Captured by catchAllError option. See error property for more details.`,error:e}}}return await pc(t,r)}return t},gc=e=>{if(typeof process>`u`)return;let t=e??`/api/auth`;if({}.NEXT_PUBLIC_AUTH_URL)return{}.NEXT_PUBLIC_AUTH_URL;if(typeof window>`u`){if({}.NEXTAUTH_URL)try{return{}.NEXTAUTH_URL}catch{}if({}.VERCEL_URL)try{let e={}.VERCEL_URL.startsWith(`http`)?``:`https://`;return`${new URL(`${e}${{}.VERCEL_URL}`).origin}${t}`}catch{}}},_c=e=>e===`/sign-out`||e===`/update-user`||e===`/update-session`||e===`/sign-up/email`||e===`/sign-in/email`||e===`/delete-user`||e===`/verify-email`||e===`/revoke-sessions`||e===`/revoke-session`||e===`/revoke-other-sessions`||e===`/change-email`||e===`/change-password`,vc=(e,t)=>{let n=`credentials`in Request.prototype,r=wo(e?.baseURL,e?.basePath,void 0,t)??gc(e?.basePath)??`/api/auth`,i=e?.plugins?.flatMap(e=>e.fetchPlugins).filter(e=>e!==void 0)||[],a={id:`lifecycle-hooks`,name:`lifecycle-hooks`,hooks:{onSuccess:e?.fetchOptions?.onSuccess,onError:e?.fetchOptions?.onError,onRequest:e?.fetchOptions?.onRequest,onResponse:e?.fetchOptions?.onResponse}},{onSuccess:o,onError:s,onRequest:c,onResponse:l,...u}=e?.fetchOptions||{},d=hc({baseURL:r,...n?{credentials:`include`}:{},method:`GET`,jsonParser(e){return e?No(e,{strict:!1}):null},customFetchImpl:fetch,...u,plugins:[a,...u.plugins||[],...e?.disableDefaultFetchPlugins?[]:[Io],...i]}),{$sessionSignal:f,session:p,broadcastSessionUpdate:m}=Os(d,e),h=!1,g=e=>{h||e===null||(h=!0,ws(p,e))},_=e?.plugins||[],v={},y={$sessionSignal:f,session:p},b={"/sign-out":`POST`,"/revoke-sessions":`POST`,"/revoke-other-sessions":`POST`,"/delete-user":`POST`},x=[{signal:`$sessionSignal`,matcher:_c,callback(e){e===`/sign-out`?m(`signout`):(e===`/update-user`||e===`/update-session`)&&m(`updateUser`)}}];for(let e of _)e.getAtoms&&Object.assign(y,e.getAtoms?.(d)),e.pathMethods&&Object.assign(b,e.pathMethods),e.atomListeners&&x.push(...e.atomListeners);let S={notify:e=>{y[e].set(!y[e].get())},listen:(e,t)=>{y[e].subscribe(t)},atoms:y};for(let t of _)t.getActions&&(v=Ms(t.getActions?.(d,S,e)??{},v));return{get baseURL(){return r},pluginsActions:v,pluginsAtoms:y,pluginPathMethods:b,atomListeners:x,hydrateSession:g,$sessionSignal:f,$fetch:d,$store:S}};function yc(e){return typeof e==`object`&&!!e&&`get`in e&&typeof e.get==`function`&&`lc`in e&&typeof e.lc==`number`}function bc(e){return e.charAt(0).toUpperCase()+e.slice(1)}var xc=/[\p{Ll}\d]+|\p{Lu}+(?!\p{Ll})|\p{Lu}[\p{Ll}\d]+|\p{Lo}+/gu,Sc=/['\u2019]/g;function Cc(e){return e.replace(Sc,``).match(xc)??[]}function wc(e){return Cc(e).map(e=>e.toLowerCase()).join(`-`)}function Tc(e,t,n){let r=t[e],{fetchOptions:i,query:a,...o}=n||{};return r||(i?.method?i.method:o&&Object.keys(o).length>0?`POST`:`GET`)}function Ec(e,t,n,r,i){function a(o=[]){return new Proxy(function(){},{get(t,n){if(typeof n!=`string`||n===`then`||n===`catch`||n===`finally`)return;let r=[...o,n],i=e;for(let e of r)if(i&&typeof i==`object`&&e in i)i=i[e];else{i=void 0;break}return typeof i==`function`||yc(i)?i:a(r)},apply:async(e,a,s)=>{let c=`/`+o.map(wc).join(`/`),l=s[0]||{},u=s[1]||{},{query:d,fetchOptions:f,...p}=l,m={...u,...f},h=Tc(c,n,l);return await t(c,{...m,body:h===`GET`?void 0:{...p,...m?.body||{}},query:d||m?.query,method:h,async onSuccess(e){if(await m?.onSuccess?.(e),!i||m.disableSignal)return;let t=i.filter(e=>e.matcher(c));if(!t.length)return;let n=new Set;for(let e of t){let t=r[e.signal];if(!t)return;if(n.has(e.signal))continue;n.add(e.signal);let i=t.get();setTimeout(()=>{t.set(!i)},10),e.callback?.(c)}}})}})}return a()}function Dc(e,t={}){let n=(0,U.useRef)(e.get()),{keys:r,deps:i=[e,r]}=t,a=(0,U.useCallback)(t=>{let i=e=>{n.current!==e&&(n.current=e,t())};return i(e.value),r?.length?ns(e,r,i):e.listen(i)},i),o=()=>n.current;return(0,U.useSyncExternalStore)(a,o,ss(e)?()=>e.init:o)}function Oc(e){return`use${bc(e)}`}function kc(e){let{pluginPathMethods:t,pluginsActions:n,pluginsAtoms:r,hydrateSession:i,$fetch:a,$store:o,atomListeners:s}=vc(e),c={};for(let[e,t]of Object.entries(r))c[Oc(e)]=()=>Dc(t);return Ec({...n,...c,hydrateSession:i,$fetch:a,$store:o},a,t,r,s)}var Ac=`1.7.10`,jc=fo({FAILED_TO_CREATE_USER:`Failed to create user`,USER_ALREADY_EXISTS:`User already exists.`,USER_ALREADY_EXISTS_USE_ANOTHER_EMAIL:`User already exists. Use another email.`,YOU_CANNOT_BAN_YOURSELF:`You cannot ban yourself`,YOU_ARE_NOT_ALLOWED_TO_CHANGE_USERS_ROLE:`You are not allowed to change users role`,YOU_ARE_NOT_ALLOWED_TO_CREATE_USERS:`You are not allowed to create users`,YOU_ARE_NOT_ALLOWED_TO_LIST_USERS:`You are not allowed to list users`,YOU_ARE_NOT_ALLOWED_TO_LIST_USERS_SESSIONS:`You are not allowed to list users sessions`,YOU_ARE_NOT_ALLOWED_TO_BAN_USERS:`You are not allowed to ban users`,YOU_ARE_NOT_ALLOWED_TO_IMPERSONATE_USERS:`You are not allowed to impersonate users`,YOU_ARE_NOT_ALLOWED_TO_REVOKE_USERS_SESSIONS:`You are not allowed to revoke users sessions`,YOU_ARE_NOT_ALLOWED_TO_DELETE_USERS:`You are not allowed to delete users`,YOU_ARE_NOT_ALLOWED_TO_SET_USERS_PASSWORD:`You are not allowed to set users password`,BANNED_USER:`You have been banned from this application`,YOU_ARE_NOT_ALLOWED_TO_GET_USER:`You are not allowed to get user`,NO_DATA_TO_UPDATE:`No data to update`,YOU_ARE_NOT_ALLOWED_TO_UPDATE_USERS:`You are not allowed to update users`,YOU_CANNOT_REMOVE_YOURSELF:`You cannot remove yourself`,YOU_ARE_NOT_ALLOWED_TO_SET_NON_EXISTENT_VALUE:`You are not allowed to set a non-existent role value`,YOU_CANNOT_IMPERSONATE_ADMINS:`You cannot impersonate admins`,INVALID_ROLE_TYPE:`Invalid role type`,YOU_ARE_NOT_ALLOWED_TO_SET_USERS_EMAIL:`You are not allowed to update users email`,PASSWORD_CANNOT_BE_UPDATED_VIA_UPDATE_USER:`Password cannot be updated through update-user. Use the set-user-password endpoint instead`});function Mc(e){return{success:!1,error:`You are not allowed to access resource: ${e}`}}function Nc(e){return{success:!1,error:`unauthorized to access resource "${e}"`}}function Pc(e){return e===`OR`?`OR`:`AND`}function Fc(e){return Array.isArray(e)}function Ic(e){if(Fc(e))return{actions:e,connector:`AND`};if(!e||typeof e!=`object`)throw new _o(`Invalid access control request`);let{actions:t,connector:n}=e;return Fc(t)?{actions:t,connector:Pc(n)}:{actions:[],connector:Pc(n)}}function Lc(e,t){return typeof t==`string`&&e.includes(t)}function Rc(e,{actions:t,connector:n}){return t.length===0?!1:n===`OR`?t.some(t=>Lc(e,t)):t.every(t=>Lc(e,t))}function zc(e){return{authorize(t,n=`AND`){let r=!1;for(let[i,a]of Object.entries(t)){let t=e[i];if(!t){if(n===`AND`)return Mc(i);continue}let o=Rc(t,Ic(a));if(o&&(r=!0),o&&n===`OR`)return{success:!0};if(!o&&n===`AND`)return Nc(i)}return r?{success:!0}:{success:!1,error:`Not authorized`}},statements:e}}function Bc(e){return{newRole(e){return zc(e)},statements:e}}var Vc=Bc({user:[`create`,`list`,`set-role`,`ban`,`impersonate`,`impersonate-admins`,`delete`,`set-password`,`set-email`,`get`,`update`],session:[`list`,`revoke`,`delete`]}),Hc=Vc.newRole({user:[`create`,`list`,`set-role`,`ban`,`impersonate`,`delete`,`set-password`,`set-email`,`get`,`update`],session:[`list`,`revoke`,`delete`]}),Uc=Vc.newRole({user:[],session:[]}),Wc={admin:Hc,user:Uc},Gc=e=>{if(e.userId&&e.options?.adminUserIds?.includes(e.userId))return!0;if(!e.permissions)return!1;let t=(e.role||e.options?.defaultRole||`user`).split(`,`),n=e.options?.roles||Wc;for(let r of t)if(n[r]?.authorize(e.permissions)?.success)return!0;return!1},Kc=e=>{let t={admin:Hc,user:Uc,...e?.roles};return{id:`admin-client`,version:Ac,$InferServerPlugin:{},getActions:()=>({admin:{checkRolePermission:n=>Gc({role:n.role,options:{ac:e?.ac,roles:t},permissions:n.permissions})}}),pathMethods:{"/admin/list-users":`GET`,"/admin/impersonate-user":`POST`,"/admin/stop-impersonating":`POST`},atomListeners:[{matcher:e=>e===`/admin/impersonate-user`||e===`/admin/stop-impersonating`,signal:`$sessionSignal`}],$ERROR_CODES:jc}},qc=fo({OTP_EXPIRED:`OTP expired`,INVALID_OTP:`Invalid OTP`,TOO_MANY_ATTEMPTS:`Too many attempts`}),Jc=()=>({id:`email-otp`,version:Ac,$InferServerPlugin:{},atomListeners:[{matcher:e=>e===`/email-otp/verify-email`||e===`/sign-in/email-otp`||e===`/email-otp/request-email-change`,signal:`$sessionSignal`}],$ERROR_CODES:qc}),Yc=`ba_param`;function Xc(e){let t=e.getAll(Yc);if(t.length)return new Set(t)}function Zc(e){let t=new URLSearchParams(e);if(!t.has(`sig`))return;let n=Xc(t);if(!n)return;let r=new URLSearchParams;for(let[e,i]of t.entries())(e===`sig`||e===Yc||n.has(e))&&r.append(e,i);return r.toString()}var Qc=`1.7.10`,$c=/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d+)?Z$/;function el(e){if(typeof e==`string`&&$c.test(e)){let t=new Date(e);if(!isNaN(t.getTime()))return t}return e}function tl(e){if(e==null)return e;if(typeof e==`string`)return el(e);if(e instanceof Date)return e;if(Array.isArray(e))return e.map(tl);if(typeof e==`object`){let t={};for(let n of Object.keys(e))t[n]=tl(e[n]);return t}return e}function nl(e){try{return typeof e==`string`?JSON.parse(e,(e,t)=>el(t)):e==null?null:tl(e)}catch(e){return uo.error(`Error parsing JSON`,{error:e}),null}}var rl=()=>({id:`oauth-provider-client`,version:Qc,fetchPlugins:[{id:`oauth-provider-signin`,name:`oauth-provider-signin`,description:`Adds the current page query to oauth requests`,hooks:{async onRequest(e){let t=e.headers,n=typeof e.body==`string`?t.get(`content-type`)===`application/x-www-form-urlencoded`?Object.fromEntries(new URLSearchParams(e.body)):nl(e.body??`{}`):e.body;n?.oauth_query||typeof window<`u`&&window?.location?.search&&e.method!==`GET`&&e.method!==`DELETE`&&(e.body=JSON.stringify({...n,oauth_query:Zc(window.location.search)}))}}}],$InferServerPlugin:{}}),il=class extends Error{constructor(e,t){super(e),this.name=`ParseError`,this.type=t.type,this.field=t.field,this.value=t.value,this.line=t.line}},al=10,ol=13,sl=32,cl=6;function ll(e){if(typeof e==`function`)throw TypeError("`config` must be an object, got a function instead. Did you mean `createParser({onEvent: fn})`?");let{maxBufferSize:t,onComment:n,onError:r,onEvent:i,onId:a,onRetry:o}=e,s=[],c=0,l=``,u,d=``,f=0,p,m=!1,h=!1,g=!1;function _(e){if(m)throw Error("Cannot feed parser: it was terminated after exceeding the configured max buffer size. Call `reset()` to resume parsing.");if(l!==void 0){if(e=l+e,e===``||e===`ï`||e===`ï»`){l=e;return}l=void 0,e=e.replace(/^(?:\uFEFF|\xEF\xBB\xBF)/,``)}if((h||g)&&(e=v(e),!e))return;if(!s.length){let t=S(e);t!==``&&y(t),x();return}if(e.indexOf(`
5
- `)===-1&&e.indexOf(`\r`)===-1){if(c<cl&&!b(s.join(``)+e.slice(0,cl-c))){s.length=0,c=0,h=!0;return}s.push(e),c+=e.length,x();return}s.push(e);let t=s.join(``);s.length=0,c=0,y(S(t)),x()}function v(e){if(e.length===0)return e;if(g)return g=!1,e.charCodeAt(0)===al?e.slice(1):e;let t=e.indexOf(`\r`),n=e.indexOf(`
6
- `),r=t===-1?n:n===-1||t<n?t:n;return r===-1?``:r===e.length-1&&e.charCodeAt(r)===ol?(h=!1,g=!0,``):(h=!1,e.slice(r+(e.charCodeAt(r)===ol&&e.charCodeAt(r+1)===al?2:1)))}function y(e){if(e){if(e.charCodeAt(e.length-1)===ol){if(C(e,0,e.length-1),x())return;g=!0}else b(e)?(s.push(e),c=e.length):h=!0}}function b(e){let t=e.charCodeAt(0);return t===58&&!!n||t===100&&fl(e,`data`)||t===101&&fl(e,`event`)||t===105&&fl(e,`id`)||t===114&&fl(e,`retry`)}function x(){return m?!0:t===void 0||c+d.length<=t?!1:(m=!0,s.length=0,c=0,u=void 0,d=``,f=0,p=void 0,h=!1,g=!1,r?.(new il(`Buffered data exceeded max buffer size of ${t} characters`,{type:`max-buffer-size-exceeded`})),!0)}function S(e){let t=0;if(e.indexOf(`\r`)===-1){let n=e.indexOf(`
7
- `,t);for(;n!==-1;){if(t===n){u!==void 0&&a?.(u),f>0&&i?.({id:u,event:p,data:d}),u=void 0,d=``,f=0,p=void 0,t=n+1,n=e.indexOf(`
8
- `,t);continue}let r=e.charCodeAt(t);if(ul(e,t,r)){let r=e.charCodeAt(t+5)===sl?t+6:t+5,o=e.slice(r,n);if(f===0&&e.charCodeAt(n+1)===al){u!==void 0&&a?.(u),i?.({id:u,event:p,data:o}),u=void 0,d=``,p=void 0,t=n+2,n=e.indexOf(`
9
- `,t);continue}d=f===0?o:`${d}\n${o}`,f++}else dl(e,t,r)?p=e.slice(e.charCodeAt(t+6)===sl?t+7:t+6,n)||void 0:C(e,t,n);if(x())return``;t=n+1,n=e.indexOf(`
10
- `,t)}return e.slice(t)}for(;t<e.length;){let n=e.indexOf(`\r`,t),r=e.indexOf(`
11
- `,t),i=-1;if(n!==-1&&r!==-1?i=n<r?n:r:n===-1?r!==-1&&(i=r):i=n===e.length-1?-1:n,i===-1)break;if(C(e,t,i),x())return``;t=i+1,e.charCodeAt(t-1)===ol&&e.charCodeAt(t)===al&&t++}return e.slice(t)}function C(e,t,r){if(t===r){T();return}let i=e.charCodeAt(t);if(ul(e,t,i)){let n=e.charCodeAt(t+5)===sl?t+6:t+5,i=e.slice(n,r);d=f===0?i:`${d}\n${i}`,f++;return}if(dl(e,t,i)){p=e.slice(e.charCodeAt(t+6)===sl?t+7:t+6,r)||void 0;return}if(i===105&&e.charCodeAt(t+1)===100&&e.charCodeAt(t+2)===58){let n=e.slice(e.charCodeAt(t+3)===sl?t+4:t+3,r);n.includes(`\0`)||(u=n);return}if(i===58){if(n){let i=e.slice(t,r);n(i.slice(e.charCodeAt(t+1)===sl?2:1))}return}let a=e.slice(t,r),o=a.indexOf(`:`);if(o===-1){w(a,``,a);return}let s=a.slice(0,o),c=a.charCodeAt(o+1)===sl?2:1;w(s,a.slice(o+c),a)}function w(e,t,n){switch(e){case`event`:p=t||void 0;break;case`data`:d=f===0?t:`${d}\n${t}`,f++;break;case`id`:t.includes(`\0`)||(u=t);break;case`retry`:/^\d+$/.test(t)?o?.(parseInt(t,10)):r?.(new il(`Invalid \`retry\` value: "${t}"`,{type:`invalid-retry`,value:t,line:n}));break;default:r?.(new il(`Unknown field "${e.length>20?`${e.slice(0,20)}…`:e}"`,{type:`unknown-field`,field:e,value:t,line:n}))}}function T(){u!==void 0&&a?.(u),f>0&&i?.({id:u,event:p,data:d}),u=void 0,d=``,f=0,p=void 0}function E(e={}){if(e.consume&&s.length>0){let e=s.join(``);C(e,0,e.length)}l=``,u=void 0,d=``,f=0,p=void 0,s.length=0,c=0,m=!1,h=!1,g=!1}return{feed:_,reset:E}}function ul(e,t,n){return n===100&&e.charCodeAt(t+1)===97&&e.charCodeAt(t+2)===116&&e.charCodeAt(t+3)===97&&e.charCodeAt(t+4)===58}function dl(e,t,n){return n===101&&e.charCodeAt(t+1)===118&&e.charCodeAt(t+2)===101&&e.charCodeAt(t+3)===110&&e.charCodeAt(t+4)===116&&e.charCodeAt(t+5)===58}function fl(e,t){let n=1;for(;n<e.length&&n<t.length;){if(e.charCodeAt(n)!==t.charCodeAt(n))return!1;n++}return e.length<=t.length||e.charCodeAt(t.length)===58}function pl(){if(typeof crypto.randomUUID==`function`)return crypto.randomUUID();let e=crypto.getRandomValues(new Uint8Array(16));e[6]=(e[6]??0)&15|64,e[8]=(e[8]??0)&63|128;let t=Array.from(e,e=>e.toString(16).padStart(2,`0`)).join(``);return`${t.slice(0,8)}-${t.slice(8,12)}-${t.slice(12,16)}-${t.slice(16,20)}-${t.slice(20)}`}async function ml(e){let t=await e.json().catch(()=>{throw new j(e.status,`invalid_response`,`Kanvil returned an invalid response`)});if(!e.ok){let n=u.safeParse(t);throw new j(e.status,n.success?n.data.error.code:`request_failed`,n.success?n.data.error.message:`Request failed (${e.status})`,n.success?n.data.error.details:void 0)}return t}function hl(e){let t=e.fetch??fetch,n=t=>{if(!t.startsWith(`/`)||t.startsWith(`//`))throw new j(400,`invalid_path`,`Use a relative Kanvil endpoint`);let n=new URL(`${e.baseUrl.replace(/\/$/,``)}${t}`);if(n.origin!==new URL(e.baseUrl).origin)throw new j(400,`invalid_path`,`Credentials cannot be sent to another origin`);return n},r=async(e,n)=>{try{return await t(e,n)}catch(r){if(n.signal?.aborted)throw r;return t(e,n)}},i=async(n,i,a,o)=>{let s={...n.input.parse(i)},c=n.path.replace(/\{(\w+)\}/g,(e,t)=>{let n=s[t];if(delete s[t],typeof n!=`string`)throw new j(400,`invalid_path`,`Missing path parameter ${t}`);return encodeURIComponent(n)}),l=new URL(`${e.baseUrl.replace(/\/$/,``)}${a}${c}`),u=new Headers(await e.headers?.()),d={method:n.method,credentials:e.credentials??`include`,headers:u,...o?{signal:o}:{}};if(n.method===`GET`)for(let[e,t]of Object.entries(s))for(let n of Array.isArray(t)?t:[t])(typeof n==`string`||typeof n==`number`||typeof n==`boolean`)&&l.searchParams.append(e,String(n));else u.set(`Content-Type`,`application/json`),`requestId`in n.input.shape&&(s.requestId??=(e.requestId??pl)()),d.body=JSON.stringify(s);return ml(await(n.method===`GET`||`requestId`in s?r(l,d):t(l,d)))},a={async request(r,i,a={}){let o=new Headers(await e.headers?.());return new Headers(a.headers).forEach((e,t)=>o.set(t,e)),i.parse(await ml(await t(n(r),{...a,headers:o,credentials:e.credentials??`include`})))},async call(e,t,n){return k(e,await i(A[e],t,`/api/v1`,n))},async callPublic(e,t,n){return S(e,await i(o[e],t,`/api/public`,n))},async subscribe(r){let i=r.cursor,a=1e3;try{for(;!r.signal.aborted;){r.onState?.(`connecting`);let o=n(`/api/v1/events`);i&&o.searchParams.set(`cursor`,i),r.projectId&&o.searchParams.set(`projectId`,r.projectId);let c,l=()=>{c?.cancel().catch(()=>{})};r.signal.addEventListener(`abort`,l,{once:!0});try{let n=await t(o,{headers:new Headers(await e.headers?.()),credentials:e.credentials??`include`,signal:r.signal});if(n.status===410&&r.onReset){i=await r.onReset();continue}if(n.ok||await ml(n),!n.body)throw new j(502,`invalid_stream`,`The event stream has no body`);c=n.body.getReader();let l=[],u=ll({maxBufferSize:1e6,onEvent:e=>l.push(e),onError:e=>{throw new j(502,`invalid_stream`,e.message)}}),d=new TextDecoder;for(;!r.signal.aborted;){let e=await c.read();if(e.done)break;u.feed(d.decode(e.value,{stream:!0}));for(let e of l.splice(0)){if(e.event===`error`){let t=s.parse(JSON.parse(e.data));throw new j(t.status,t.code,t.message)}e.event===`change`&&await r.onEvent(p.parse(JSON.parse(e.data))),(e.event===`checkpoint`||e.event===`change`)&&(r.onState?.(`connected`),a=1e3,e.id&&(await r.onCursor?.(e.id),i=e.id))}}}catch(e){if(r.signal.aborted)return;if(e instanceof j&&e.status===410&&r.onReset){i=await r.onReset();continue}if(e instanceof j&&e.status<500)throw e}finally{r.signal.removeEventListener(`abort`,l),await c?.cancel().catch(()=>{})}if(r.signal.aborted)return;r.onState?.(`offline`),await new Promise(e=>{let t=()=>{clearTimeout(n),r.signal.removeEventListener(`abort`,t),e()},n=setTimeout(t,a);r.signal.addEventListener(`abort`,t,{once:!0}),r.signal.aborted&&t()}),a=Math.min(a*2,3e4)}}finally{r.onState?.(`closed`)}}};return{...a,notifications(){return{queryKey:[`kanvil`,e.baseUrl,`notifications`],queryFn:()=>a.request(`/api/v1/notifications`,z)}},markNotifications(e){return a.request(`/api/v1/notifications/read`,L,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(O.parse(e))})},dismissNotifications(e){return a.request(`/api/v1/notifications/dismiss`,L,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(F.parse(e))})},notificationPreferences(){return{queryKey:[`kanvil`,e.baseUrl,`notification-preferences`],queryFn:()=>a.request(`/api/v1/notifications/preferences`,D)}},setNotificationPreferences(e){return a.request(`/api/v1/notifications/preferences`,D,{method:`PUT`,headers:{"Content-Type":`application/json`},body:JSON.stringify(te.parse(e))})},watch(e){let t=!0;return a.subscribe({...e.projectId?{projectId:e.projectId}:{},signal:e.signal,...e.onState?{onState:e.onState}:{},onEvent:t=>e.invalidate(t),onCursor:async()=>{t&&(t=!1,await e.invalidate())},onReset:async()=>{let t=e.projectId?await a.request(`/api/v1/snapshot?projectId=${encodeURIComponent(e.projectId)}`,y):await a.request(`/api/v1/checkpoint`,E);return await e.invalidate(),t.cursor}})},query(t,n){return{queryKey:[`kanvil`,e.baseUrl,t,n],queryFn:({signal:e}={})=>a.call(t,n,e)}},publicQuery(t,n){return{queryKey:[`kanvil-public`,e.baseUrl,t,n],queryFn:({signal:e}={})=>a.callPublic(t,n,e)}},action(e){return{mutationFn:t=>a.call(e,t),networkMode:`always`,retry:!1}}}}var gl=kc({plugins:[Kc(),Jc(),rl()]}),_l=hl({baseUrl:window.location.origin}),vl=(0,U.createContext)({id:``,name:``,email:``,admin:!1,image:null,clearPrivateData:()=>{}}),yl=()=>(0,U.useContext)(vl),bl=()=>kt({queryKey:[`info`],queryFn:()=>_l.request(`/api/v1/info`,b)});async function xl(e,t=`/login`){let n=await gl.signOut({disableRedirect:!0});if(n.error)throw Error(n.error.message);await e.clearPrivateData(),window.location.assign(t)}function Sl(e,t){let n=de();return At({..._l.action(e),onSuccess:async e=>(await t?.(e),n.invalidateQueries({queryKey:[`kanvil`]}))})}var Cl=(0,U.createContext)({active:void 0,workspaces:[],pending:!0,error:void 0,select:()=>{}}),wl=()=>(0,U.useContext)(Cl),Tl=()=>kt(_l.query(`list_workspaces`,{})),El=()=>_l.query(`list_projects`,{archived:`include`}),Dl=()=>kt(El());function Ol(){let{active:e}=wl();return kt({...El(),select:t=>e?t.filter(t=>t.workspaceId===e.id&&!t.archivedAt):[]})}function kl(e){return kt({...El(),select:t=>t.find(t=>t.id===e)})}function Al(e){let t=de(),n=_t(),[r,i]=(0,U.useState)(`connecting`);return(0,U.useEffect)(()=>{if(n)return;let r=new AbortController,a=Ra(e=>t.invalidateQueries(e?{predicate:t=>e.some(e=>La(e)(t))}:{queryKey:[`kanvil`]}),r.signal);return _l.watch({...e?{projectId:e}:{},signal:r.signal,invalidate:e=>e?a.push(e):a.flush(),onState:i}).catch(()=>i(I(`shell.connection.signIn`))),()=>r.abort()},[t,e,n]),r}function jl(e){for(let t of Object.keys(localStorage))t.startsWith(`kanvil:${e}:`)&&localStorage.removeItem(t)}function Ml(e,t=!0){let n=yl(),r=kt({...El(),enabled:t,select:t=>t.find(t=>t.id===e)}),i=n.admin?`admin`:r.data?.role,a=!!r.data?.archivedAt,o=n.admin?w:T({...r.data,role:i}),s=e=>o.includes(e);return{role:i,archived:a,capabilities:o,canWrite:!a&&s(`ticket.write`),canDelete:!a&&s(`ticket.delete`),canAdmin:!a&&s(`project.manage`),canManage:s(`project.manage`),canManageMembers:s(`member.manage`),canShare:s(`sharing.manage`)}}function Nl(e,t){let n=yl(),r=t===n.id,i=kt({..._l.query(`list_members`,{projectId:e}),enabled:!!t&&!r}),a=i.data?.find(e=>e.userId===t),o=kt({..._l.query(`list_deleted_accounts`,{}),enabled:!!t&&!r&&!!i.data&&!a});return t===null?{name:`Kanvil`,image:void 0}:r?{name:n.name,image:n.image}:{name:ee(i.data,o.data,t),image:a?.image}}function Pl({projectId:e,actorId:t,avatar:n=!1}){let r=yl(),{name:i,image:a}=Nl(e,t);return(0,W.jsxs)(`span`,{className:n?`inline-flex items-center gap-2`:``,title:t??void 0,children:[n&&(0,W.jsx)(Pa,{name:i,image:a,className:`size-7 text-[10px]`}),t===r.id?I(`shell.you`):i]})}function Fl(e){return+re(e)<Date.now()}var Il=ci(),Ll=ui();async function Rl(e){try{if(navigator.clipboard){await navigator.clipboard.writeText(e);return}}catch{}let t=document.activeElement,n=document.createElement(`textarea`);n.value=e,n.style.position=`fixed`,n.style.opacity=`0`,document.body.append(n);try{if(n.select(),!document.execCommand(`copy`))throw Error(I(`shell.browser.copyFailed`))}finally{n.remove(),t instanceof HTMLElement&&t.focus()}}function zl(e,t,n=`application/json`){let r=URL.createObjectURL(new Blob([t],{type:n})),i=document.createElement(`a`);i.href=r,i.download=e,i.click(),setTimeout(()=>URL.revokeObjectURL(r),1e3)}function Bl(e){return new Promise((t,n)=>{let r=new FileReader;r.addEventListener(`error`,()=>n(Error(I(`shell.browser.readFailed`))),{once:!0}),r.addEventListener(`load`,()=>typeof r.result==`string`?t(r.result.slice(r.result.indexOf(`,`)+1)):n(Error(I(`shell.browser.encodeFailed`))),{once:!0}),r.readAsDataURL(e)})}async function Vl(e,{fit:t=`cover`,format:n=`image/jpeg`,size:r=256}={}){if(e.size>1e7)throw Error(I(`shell.browser.imageTooBig`));let i=await createImageBitmap(e);try{let e=document.createElement(`canvas`),a=t===`inside`?Math.min(1,r/Math.max(i.width,i.height)):(t===`cover`?Math.max:Math.min)(r/i.width,r/i.height),o=Math.round(i.width*a),s=Math.round(i.height*a);e.width=t===`inside`?o:r,e.height=t===`inside`?s:r;let c=e.getContext(`2d`);if(!c)throw Error(I(`shell.browser.cannotResize`));c.drawImage(i,(e.width-o)/2,(e.height-s)/2,o,s);for(let t of[.9,.75,.6,.45]){let r=await new Promise((r,i)=>e.toBlob(e=>e?r(e):i(Error(I(`shell.browser.prepareFailed`))),n,t));if(r.size<=5e5)return{contentType:n,data:await Bl(r)}}throw Error(I(`shell.browser.stillTooLarge`))}finally{i.close()}}function Hl(e,t){if(!(e instanceof Element))return!1;if(e.closest(`input, textarea, select, [contenteditable=""], [contenteditable="true"], [role="menu"], [role="listbox"]`))return!0;let n=e.closest(`[role="dialog"], [role="alertdialog"]`);return!!n&&!(t&&n.matches(t))}function Ul(e,t,{enabled:n=!0,mod:r=!1,alt:i=!1,shift:a,guard:o,scope:s}={}){let c=(0,U.useRef)({handler:t,guard:o});(0,U.useEffect)(()=>{c.current={handler:t,guard:o}}),(0,U.useEffect)(()=>{if(!n)return;let t=t=>{t.key!==e||t.defaultPrevented||t.repeat||(r?!(t.metaKey||t.ctrlKey):t.metaKey||t.ctrlKey)||!r&&t.altKey!==i||a!==void 0&&t.shiftKey!==a||(r||!Hl(t.target,s))&&(!c.current.guard||c.current.guard(t))&&(t.preventDefault(),c.current.handler(t))};return window.addEventListener(`keydown`,t),()=>window.removeEventListener(`keydown`,t)},[e,n,r,i,a,s])}var Wl=/^(?:[-*+]|\d+[.)]) (?:\[[ xX]\] )?/,Gl={heading:{get label(){return I(`detail.markdown.format.heading`)},prefix:`### `,pattern:/^#{1,6} /,replaces:/^#{1,6} /},bold:{get label(){return I(`detail.markdown.format.bold`)},shortcut:`⌘ B`,key:`b`,wrap:`**`},italic:{get label(){return I(`detail.markdown.format.italic`)},shortcut:`⌘ I`,key:`i`,wrap:`_`},link:{get label(){return I(`detail.markdown.format.link`)},get help(){return I(`detail.markdown.format.linkHelp`)},shortcut:`⌘ K`,key:`k`},bullets:{get label(){return I(`detail.markdown.format.bullets`)},shortcut:`⌘ ⇧ 8`,code:`Digit8`,prefix:`- `,pattern:/^[-*+] (?!\[[ xX]\] )/,replaces:Wl},numbers:{get label(){return I(`detail.markdown.format.numbers`)},shortcut:`⌘ ⇧ 7`,code:`Digit7`,prefix:`1. `,pattern:/^\d+[.)] (?!\[[ xX]\] )/,replaces:Wl},tasks:{get label(){return I(`detail.markdown.format.tasks`)},shortcut:`⌘ ⇧ 9`,code:`Digit9`,prefix:`- [ ] `,pattern:/^(?:[-*+]|\d+[.)]) \[[ xX]\] /,replaces:Wl},code:{get label(){return I(`detail.markdown.format.code`)},shortcut:`⌘ E`,key:`e`,fence:"```"}},Kl=Object.keys(Gl).filter(e=>e in Gl);function ql(e){if((e.metaKey||e.ctrlKey)&&!e.altKey)return Kl.find(t=>{let n=Gl[t];return`key`in n?!e.shiftKey&&e.key.toLowerCase()===n.key:`code`in n&&e.shiftKey&&e.code===n.code})}function Jl(e,t,n,r){let i=e.slice(t,n),a=Gl[r];if(r===`link`)return{from:t,to:n,text:`[${i}](url)`,start:n+3,end:n+6};if(`wrap`in a){let r=a.wrap,o=r.length;if(e.slice(t-o,t)===r&&e.slice(n,n+o)===r)return{from:t-o,to:n+o,text:i,start:t-o,end:n-o};if(i.length>=2*o&&i.startsWith(r)&&i.endsWith(r)){let e=i.slice(o,-o);return{from:t,to:n,text:e,start:t,end:t+e.length}}return{from:t,to:n,text:r+i+r,start:t+o,end:n+o}}let o=e.lastIndexOf(`
12
- `,t-1)+1,s=e.indexOf(`
13
- `,n>t&&e[n-1]===`
14
- `?n-1:n),c=s<0?e.length:s,l=e.slice(o,c),u=l.split(`
15
- `);if(`fence`in a){if(u.length>1&&u[0]?.startsWith(a.fence)&&u.at(-1)===a.fence){let e=u.slice(1,-1).join(`
16
- `);return{from:o,to:c,text:e,start:o,end:o+e.length}}let e=o+a.fence.length+1;return{from:o,to:c,text:`${a.fence}\n${l}\n${a.fence}`,start:e,end:e+l.length}}if(!(`prefix`in a))return{from:t,to:n,text:i,start:t,end:n};let d=u.map(e=>{let t=e.trimStart();return{indent:e.slice(0,e.length-t.length),rest:t}}),f=d.filter(({rest:e})=>e),p=f.length>0&&f.every(({rest:e})=>a.pattern.test(e)),m=0,h=d.map(({indent:e,rest:t})=>p?e+t.replace(a.pattern,``):!t&&f.length?e:(m+=1,e+(r===`numbers`?`${m}. `:a.prefix)+t.replace(a.replaces,``))).join(`
17
- `);if(t===n&&u.length===1){let e=Math.max(o,t+h.length-l.length);return{from:o,to:c,text:h,start:e,end:e}}return{from:o,to:c,text:h,start:o,end:o+h.length}}function Yl(e,t,n){let r=/^(?:[-*+]|\d+[.)])[ \t]+\[[ xX]\]/.exec(e.slice(t));if(!r)return e;let i=t+r[0].length-2;return e.slice(0,i)+(n?`x`:` `)+e.slice(i+1)}function Xl(e){let t=e.name.replaceAll(/[\\[\]]/g,`\\$&`);return`${e.contentType.startsWith(`image/`)?`!`:``}[${t}](${e.url})`}function Zl(e,t){let n=t||{};return(e[e.length-1]===``?[...e,``]:e).join((n.padRight?` `:``)+`,`+(n.padLeft===!1?``:` `)).trim()}var Ql=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,$l=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,eu={};function tu(e,t){return((t||eu).jsx?$l:Ql).test(e)}var nu=/[ \t\n\f\r]/g;function ru(e){return typeof e==`object`?e.type===`text`&&iu(e.value):iu(e)}function iu(e){return e.replace(nu,``)===``}var au=class{constructor(e,t,n){this.normal=t,this.property=e,n&&(this.space=n)}};au.prototype.normal={},au.prototype.property={},au.prototype.space=void 0;function ou(e,t){let n={},r={};for(let t of e)Object.assign(n,t.property),Object.assign(r,t.normal);return new au(n,r,t)}function su(e){return e.toLowerCase()}var cu=class{constructor(e,t){this.attribute=t,this.property=e}};cu.prototype.attribute=``,cu.prototype.booleanish=!1,cu.prototype.boolean=!1,cu.prototype.commaOrSpaceSeparated=!1,cu.prototype.commaSeparated=!1,cu.prototype.defined=!1,cu.prototype.mustUseProperty=!1,cu.prototype.number=!1,cu.prototype.overloadedBoolean=!1,cu.prototype.property=``,cu.prototype.spaceSeparated=!1,cu.prototype.space=void 0;var lu=t({boolean:()=>Y,booleanish:()=>du,commaOrSpaceSeparated:()=>hu,commaSeparated:()=>mu,number:()=>X,overloadedBoolean:()=>fu,spaceSeparated:()=>pu}),uu=0,Y=gu(),du=gu(),fu=gu(),X=gu(),pu=gu(),mu=gu(),hu=gu();function gu(){return 2**++uu}var _u=Object.keys(lu),vu=class extends cu{constructor(e,t,n,r){let i=-1;if(super(e,t),yu(this,`space`,r),typeof n==`number`)for(;++i<_u.length;){let e=_u[i];yu(this,_u[i],(n&lu[e])===lu[e])}}};vu.prototype.defined=!0;function yu(e,t,n){n&&(e[t]=n)}function bu(e){let t={},n={};for(let[r,i]of Object.entries(e.properties)){let a=new vu(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(a.mustUseProperty=!0),t[r]=a,n[su(r)]=r,n[su(a.attribute)]=r}return new au(t,n,e.space)}var xu=bu({properties:{ariaActiveDescendant:null,ariaAtomic:du,ariaAutoComplete:null,ariaBusy:du,ariaChecked:du,ariaColCount:X,ariaColIndex:X,ariaColSpan:X,ariaControls:pu,ariaCurrent:null,ariaDescribedBy:pu,ariaDetails:null,ariaDisabled:du,ariaDropEffect:pu,ariaErrorMessage:null,ariaExpanded:du,ariaFlowTo:pu,ariaGrabbed:du,ariaHasPopup:null,ariaHidden:du,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:pu,ariaLevel:X,ariaLive:null,ariaModal:du,ariaMultiLine:du,ariaMultiSelectable:du,ariaOrientation:null,ariaOwns:pu,ariaPlaceholder:null,ariaPosInSet:X,ariaPressed:du,ariaReadOnly:du,ariaRelevant:null,ariaRequired:du,ariaRoleDescription:pu,ariaRowCount:X,ariaRowIndex:X,ariaRowSpan:X,ariaSelected:du,ariaSetSize:X,ariaSort:null,ariaValueMax:X,ariaValueMin:X,ariaValueNow:X,ariaValueText:null,role:null},transform(e,t){return t===`role`?t:`aria-`+t.slice(4).toLowerCase()}});function Su(e,t){return t in e?e[t]:t}function Cu(e,t){return Su(e,t.toLowerCase())}var wu=bu({attributes:{acceptcharset:`accept-charset`,classname:`class`,htmlfor:`for`,httpequiv:`http-equiv`},mustUseProperty:[`checked`,`multiple`,`muted`,`selected`],properties:{abbr:null,accept:mu,acceptCharset:pu,accessKey:pu,action:null,allow:null,allowFullScreen:Y,allowPaymentRequest:Y,allowUserMedia:Y,alpha:Y,alt:null,as:null,async:Y,autoCapitalize:null,autoComplete:pu,autoFocus:Y,autoPlay:Y,blocking:pu,capture:null,charSet:null,checked:Y,cite:null,className:pu,closedBy:null,colorSpace:null,cols:X,colSpan:X,command:null,commandFor:null,content:null,contentEditable:du,controls:Y,controlsList:pu,coords:X|mu,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Y,defer:Y,dir:null,dirName:null,disabled:Y,download:fu,draggable:du,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Y,formTarget:null,headers:pu,height:X,hidden:fu,high:X,href:null,hrefLang:null,htmlFor:pu,httpEquiv:pu,id:null,imageSizes:null,imageSrcSet:null,inert:Y,inputMode:null,integrity:null,is:null,isMap:Y,itemId:null,itemProp:pu,itemRef:pu,itemScope:Y,itemType:pu,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Y,low:X,manifest:null,max:null,maxLength:X,media:null,method:null,min:null,minLength:X,multiple:Y,muted:Y,name:null,nonce:null,noModule:Y,noValidate:Y,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:Y,optimum:X,pattern:null,ping:pu,placeholder:null,playsInline:Y,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Y,referrerPolicy:null,rel:pu,required:Y,reversed:Y,rows:X,rowSpan:X,sandbox:pu,scope:null,scoped:Y,seamless:Y,selected:Y,shadowRootClonable:Y,shadowRootCustomElementRegistry:Y,shadowRootDelegatesFocus:Y,shadowRootMode:null,shadowRootSerializable:Y,shape:null,size:X,sizes:null,slot:null,span:X,spellCheck:du,src:null,srcDoc:null,srcLang:null,srcSet:null,start:X,step:null,style:null,tabIndex:X,target:null,title:null,translate:null,type:null,typeMustMatch:Y,useMap:null,value:du,width:X,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:pu,axis:null,background:null,bgColor:null,border:X,borderColor:null,bottomMargin:X,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:Y,declare:Y,event:null,face:null,frame:null,frameBorder:null,hSpace:X,leftMargin:X,link:null,longDesc:null,lowSrc:null,marginHeight:X,marginWidth:X,noResize:Y,noHref:Y,noShade:Y,noWrap:Y,object:null,profile:null,prompt:null,rev:null,rightMargin:X,rules:null,scheme:null,scrolling:du,standby:null,summary:null,text:null,topMargin:X,valueType:null,version:null,vAlign:null,vLink:null,vSpace:X,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:Y,disablePictureInPicture:Y,disableRemotePlayback:Y,exportParts:mu,part:pu,prefix:null,property:null,results:X,security:null,unselectable:null},space:`html`,transform:Cu}),Tu=bu({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:hu,accentHeight:X,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:X,amplitude:X,arabicForm:null,ascent:X,attributeName:null,attributeType:null,azimuth:X,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:X,by:null,calcMode:null,capHeight:X,className:pu,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:X,diffuseConstant:X,direction:null,display:null,dur:null,divisor:X,dominantBaseline:null,download:Y,dx:null,dy:null,edgeMode:null,editable:null,elevation:X,enableBackground:null,end:null,event:null,exponent:X,externalResourcesRequired:null,fill:null,fillOpacity:X,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:mu,g2:mu,glyphName:mu,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:X,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:X,horizOriginX:X,horizOriginY:X,id:null,ideographic:X,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:X,k:X,k1:X,k2:X,k3:X,k4:X,kernelMatrix:hu,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:X,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:X,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:X,overlineThickness:X,paintOrder:null,panose1:null,path:null,pathLength:X,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:pu,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:X,pointsAtY:X,pointsAtZ:X,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:hu,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:hu,rev:hu,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:hu,requiredFeatures:hu,requiredFonts:hu,requiredFormats:hu,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:X,specularExponent:X,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:X,strikethroughThickness:X,string:null,stroke:null,strokeDashArray:hu,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:X,strokeOpacity:X,strokeWidth:null,style:null,surfaceScale:X,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:hu,tabIndex:X,tableValues:null,target:null,targetX:X,targetY:X,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:hu,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:X,underlineThickness:X,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:X,values:null,vAlphabetic:X,vMathematical:X,vectorEffect:null,vHanging:X,vIdeographic:X,version:null,vertAdvY:X,vertOriginX:X,vertOriginY:X,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:X,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:`svg`,transform:Su}),Eu=bu({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()}}),Du=bu({attributes:{xmlnsxlink:`xmlns:xlink`},properties:{xmlnsXLink:null,xmlns:null},space:`xmlns`,transform:Cu}),Ou=bu({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:`xml`,transform(e,t){return`xml:`+t.slice(3).toLowerCase()}}),ku={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`},Au=/[A-Z]/g,ju=/-[a-z]/g,Mu=/^data[-\w.:]+$/i;function Nu(e,t){let n=su(t),r=t,i=cu;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)===`data`&&Mu.test(t)){if(t.charAt(4)===`-`){let e=t.slice(5).replace(ju,Fu);r=`data`+e.charAt(0).toUpperCase()+e.slice(1)}else{let e=t.slice(4);if(!ju.test(e)){let n=e.replace(Au,Pu);n.charAt(0)!==`-`&&(n=`-`+n),t=`data`+n}}i=vu}return new i(r,t)}function Pu(e){return`-`+e.toLowerCase()}function Fu(e){return e.charAt(1).toUpperCase()}var Iu=ou([xu,wu,Eu,Du,Ou],`html`),Lu=ou([xu,Tu,Eu,Du,Ou],`svg`);function Ru(e){return e.join(` `).trim()}var zu=n(((e,t)=>{var n=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,r=/\n/g,i=/^\s*/,a=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,o=/^:\s*/,s=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,c=/^[;\s]*/,l=/^\s+|\s+$/g;function u(e,t){if(typeof e!=`string`)throw TypeError(`First argument must be a string`);if(!e)return[];t||={};var l=1,u=1;function f(e){var t=e.match(r);t&&(l+=t.length);var n=e.lastIndexOf(`
18
- `);u=~n?e.length-n:u+e.length}function p(){var e={line:l,column:u};return function(t){return t.position=new m(e),_(),t}}function m(e){this.start=e,this.end={line:l,column:u},this.source=t.source}m.prototype.content=e;function h(n){var r=Error(t.source+`:`+l+`:`+u+`: `+n);if(r.reason=n,r.filename=t.source,r.line=l,r.column=u,r.source=e,!t.silent)throw r}function g(t){var n=t.exec(e);if(n){var r=n[0];return f(r),e=e.slice(r.length),n}}function _(){g(i)}function v(e){var t;for(e||=[];t=y();)t!==!1&&e.push(t);return e}function y(){var t=p();if(e.charAt(0)==`/`&&e.charAt(1)==`*`){for(var n=2;e.charAt(n)!=``&&(e.charAt(n)!=`*`||e.charAt(n+1)!=`/`);)++n;if(n+=2,e.charAt(n-1)===``)return h(`End of comment missing`);var r=e.slice(2,n-2);return u+=2,f(r),e=e.slice(n),u+=2,t({type:`comment`,comment:r})}}function b(){var e=p(),t=g(a);if(t){if(y(),!g(o))return h(`property missing ':'`);var r=g(s),i=e({type:`declaration`,property:d(t[0].replace(n,``)),value:r?d(r[0].replace(n,``)):``});return g(c),i}}function x(){var e=[];v(e);for(var t;t=b();)t!==!1&&(e.push(t),v(e));return e}return _(),x()}function d(e){return e?e.replace(l,``):``}t.exports=u})),Bu=n(((e,t,n)=>{var r=n&&n.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.default=a;var i=r(zu());function a(e,t){let n=null;if(!e||typeof e!=`string`)return n;let r=(0,i.default)(e),a=typeof t==`function`;return r.forEach(e=>{if(e.type!==`declaration`)return;let{property:r,value:i}=e;a?t(r,i,e):i&&(n||={},n[r]=i)}),n}})),Vu=n((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.camelCase=void 0;var t=/^--[a-zA-Z0-9_-]+$/,n=/-([a-z])/g,r=/^[^-]+$/,i=/^-(webkit|moz|ms|o|khtml)-/,a=/^-(ms)-/,o=function(e){return!e||r.test(e)||t.test(e)},s=function(e,t){return t.toUpperCase()},c=function(e,t){return`${t}-`};e.camelCase=function(e,t){return t===void 0&&(t={}),o(e)?e:(e=e.toLowerCase(),e=t.reactCompat?e.replace(a,c):e.replace(i,c),e.replace(n,s))}})),Hu=n(((e,t,n)=>{var r=(n&&n.__importDefault||function(e){return e&&e.__esModule?e:{default:e}})(Bu()),i=Vu();function a(e,t){var n={};return!e||typeof e!=`string`||(0,r.default)(e,function(e,r){e&&r&&(n[(0,i.camelCase)(e,t)]=r)}),n}a.default=a,t.exports=a})),Uu=Gu(`end`),Wu=Gu(`start`);function Gu(e){return t;function t(t){let n=t&&t.position&&t.position[e]||{};if(typeof n.line==`number`&&n.line>0&&typeof n.column==`number`&&n.column>0)return{line:n.line,column:n.column,offset:typeof n.offset==`number`&&n.offset>-1?n.offset:void 0}}}function Ku(e){let t=Wu(e),n=Uu(e);if(t&&n)return{start:t,end:n}}function qu(e){return!e||typeof e!=`object`?``:`position`in e||`type`in e?Yu(e.position):`start`in e||`end`in e?Yu(e):`line`in e||`column`in e?Ju(e):``}function Ju(e){return Xu(e&&e.line)+`:`+Xu(e&&e.column)}function Yu(e){return Ju(e&&e.start)+`-`+Ju(e&&e.end)}function Xu(e){return e&&typeof e==`number`?e:1}var Zu=class extends Error{constructor(e,t,n){super(),typeof t==`string`&&(n=t,t=void 0);let r=``,i={},a=!1;if(t&&(i=`line`in t&&`column`in t||`start`in t&&`end`in t?{place:t}:`type`in t?{ancestors:[t],place:t.position}:{...t}),typeof e==`string`?r=e:!i.cause&&e&&(a=!0,r=e.message,i.cause=e),!i.ruleId&&!i.source&&typeof n==`string`){let e=n.indexOf(`:`);e===-1?i.ruleId=n:(i.source=n.slice(0,e),i.ruleId=n.slice(e+1))}if(!i.place&&i.ancestors&&i.ancestors){let e=i.ancestors[i.ancestors.length-1];e&&(i.place=e.position)}let o=i.place&&`start`in i.place?i.place.start:i.place;this.ancestors=i.ancestors||void 0,this.cause=i.cause||void 0,this.column=o?o.column:void 0,this.fatal=void 0,this.file=``,this.message=r,this.line=o?o.line:void 0,this.name=qu(i.place)||`1:1`,this.place=i.place||void 0,this.reason=this.message,this.ruleId=i.ruleId||void 0,this.source=i.source||void 0,this.stack=a&&i.cause&&typeof i.cause.stack==`string`?i.cause.stack:``,this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}};Zu.prototype.file=``,Zu.prototype.name=``,Zu.prototype.reason=``,Zu.prototype.message=``,Zu.prototype.stack=``,Zu.prototype.column=void 0,Zu.prototype.line=void 0,Zu.prototype.ancestors=void 0,Zu.prototype.cause=void 0,Zu.prototype.fatal=void 0,Zu.prototype.place=void 0,Zu.prototype.ruleId=void 0,Zu.prototype.source=void 0;var Qu=e(Hu(),1),$u={}.hasOwnProperty,ed=new Map,td=/[A-Z]/g,nd=new Set([`table`,`tbody`,`thead`,`tfoot`,`tr`]),rd=new Set([`td`,`th`]),id=`https://github.com/syntax-tree/hast-util-to-jsx-runtime`;function ad(e,t){if(!t||t.Fragment===void 0)throw TypeError("Expected `Fragment` in options");let n=t.filePath||void 0,r;if(t.development){if(typeof t.jsxDEV!=`function`)throw TypeError("Expected `jsxDEV` in options when `development: true`");r=gd(n,t.jsxDEV)}else{if(typeof t.jsx!=`function`)throw TypeError("Expected `jsx` in production options");if(typeof t.jsxs!=`function`)throw TypeError("Expected `jsxs` in production options");r=hd(n,t.jsx,t.jsxs)}let i={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||`react`,evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space===`svg`?Lu:Iu,stylePropertyNameCase:t.stylePropertyNameCase||`dom`,tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},a=od(i,e,void 0);return a&&typeof a!=`string`?a:i.create(e,i.Fragment,{children:a||void 0},void 0)}function od(e,t,n){if(t.type===`element`)return sd(e,t,n);if(t.type===`mdxFlowExpression`||t.type===`mdxTextExpression`)return cd(e,t);if(t.type===`mdxJsxFlowElement`||t.type===`mdxJsxTextElement`)return ud(e,t,n);if(t.type===`mdxjsEsm`)return ld(e,t);if(t.type===`root`)return dd(e,t,n);if(t.type===`text`)return fd(e,t)}function sd(e,t,n){let r=e.schema,i=r;t.tagName.toLowerCase()===`svg`&&r.space===`html`&&(i=Lu,e.schema=i),e.ancestors.push(t);let a=Sd(e,t.tagName,!1),o=_d(e,t),s=yd(e,t);return nd.has(t.tagName)&&(s=s.filter(function(e){return typeof e!=`string`||!ru(e)})),pd(e,o,a,t),md(o,s),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function cd(e,t){if(t.data&&t.data.estree&&e.evaluater){let n=t.data.estree.body[0];return n.type,e.evaluater.evaluateExpression(n.expression)}Cd(e,t.position)}function ld(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Cd(e,t.position)}function ud(e,t,n){let r=e.schema,i=r;t.name===`svg`&&r.space===`html`&&(i=Lu,e.schema=i),e.ancestors.push(t);let a=t.name===null?e.Fragment:Sd(e,t.name,!0),o=vd(e,t),s=yd(e,t);return pd(e,o,a,t),md(o,s),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function dd(e,t,n){let r={};return md(r,yd(e,t)),e.create(t,e.Fragment,r,n)}function fd(e,t){return t.value}function pd(e,t,n,r){typeof n!=`string`&&n!==e.Fragment&&e.passNode&&(t.node=r)}function md(e,t){if(t.length>0){let n=t.length>1?t:t[0];n&&(e.children=n)}}function hd(e,t,n){return r;function r(e,r,i,a){let o=Array.isArray(i.children)?n:t;return a?o(r,i,a):o(r,i)}}function gd(e,t){return n;function n(n,r,i,a){let o=Array.isArray(i.children),s=Wu(n);return t(r,i,a,o,{columnNumber:s?s.column-1:void 0,fileName:e,lineNumber:s?s.line:void 0},void 0)}}function _d(e,t){let n={},r,i;for(i in t.properties)if(i!==`children`&&$u.call(t.properties,i)){let a=bd(e,i,t.properties[i]);if(a){let[i,o]=a;e.tableCellAlignToStyle&&i===`align`&&typeof o==`string`&&rd.has(t.tagName)?r=o:n[i]=o}}if(r){let t=n.style||={};t[e.stylePropertyNameCase===`css`?`text-align`:`textAlign`]=r}return n}function vd(e,t){let n={};for(let r of t.attributes)if(r.type===`mdxJsxExpressionAttribute`){if(r.data&&r.data.estree&&e.evaluater){let t=r.data.estree.body[0];t.type;let i=t.expression;i.type;let a=i.properties[0];a.type,Object.assign(n,e.evaluater.evaluateExpression(a.argument))}else Cd(e,t.position)}else{let i=r.name,a;if(r.value&&typeof r.value==`object`){if(r.value.data&&r.value.data.estree&&e.evaluater){let t=r.value.data.estree.body[0];t.type,a=e.evaluater.evaluateExpression(t.expression)}else Cd(e,t.position)}else a=r.value===null||r.value;n[i]=a}return n}function yd(e,t){let n=[],r=-1,i=e.passKeys?new Map:ed;for(;++r<t.children.length;){let a=t.children[r],o;if(e.passKeys){let e=a.type===`element`?a.tagName:a.type===`mdxJsxFlowElement`||a.type===`mdxJsxTextElement`?a.name:void 0;if(e){let t=i.get(e)||0;o=e+`-`+t,i.set(e,t+1)}}let s=od(e,a,o);s!==void 0&&n.push(s)}return n}function bd(e,t,n){let r=Nu(e.schema,t);if(!(n==null||typeof n==`number`&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?Zl(n):Ru(n)),r.property===`style`){let t=typeof n==`object`?n:xd(e,String(n));return e.stylePropertyNameCase===`css`&&(t=wd(t)),[`style`,t]}return[e.elementAttributeNameCase===`react`&&r.space?ku[r.property]||r.property:r.attribute,n]}}function xd(e,t){try{return(0,Qu.default)(t,{reactCompat:!0})}catch(t){if(e.ignoreInvalidStyle)return{};let n=t,r=new Zu("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:n,ruleId:`style`,source:`hast-util-to-jsx-runtime`});throw r.file=e.filePath||void 0,r.url=id+`#cannot-parse-style-attribute`,r}}function Sd(e,t,n){let r;if(!n)r={type:`Literal`,value:t};else if(t.includes(`.`)){let e=t.split(`.`),n=-1,i;for(;++n<e.length;){let t=tu(e[n])?{type:`Identifier`,name:e[n]}:{type:`Literal`,value:e[n]};i=i?{type:`MemberExpression`,object:i,property:t,computed:!!(n&&t.type===`Literal`),optional:!1}:t}r=i}else r=tu(t)&&!/^[a-z]/.test(t)?{type:`Identifier`,name:t}:{type:`Literal`,value:t};if(r.type===`Literal`){let t=r.value;return $u.call(e.components,t)?e.components[t]:t}if(e.evaluater)return e.evaluater.evaluateExpression(r);Cd(e)}function Cd(e,t){let n=new Zu("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=id+`#cannot-handle-mdx-estrees-without-createevaluater`,n}function wd(e){let t={},n;for(n in e)$u.call(e,n)&&(t[Td(n)]=e[n]);return t}function Td(e){let t=e.replace(td,Ed);return t.slice(0,3)===`ms-`&&(t=`-`+t),t}function Ed(e){return`-`+e.toLowerCase()}var Dd={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`]},Od={};function kd(e,t){let n=t||Od;return Ad(e,typeof n.includeImageAlt!=`boolean`||n.includeImageAlt,typeof n.includeHtml!=`boolean`||n.includeHtml)}function Ad(e,t,n){if(Md(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 jd(e.children,t,n)}return Array.isArray(e)?jd(e,t,n):``}function jd(e,t,n){let r=[],i=-1;for(;++i<e.length;)r[i]=Ad(e[i],t,n);return r.join(``)}function Md(e){return!!(e&&typeof e==`object`)}var Nd=document.createElement(`i`);function Pd(e){let t=`&`+e+`;`;Nd.innerHTML=t;let n=Nd.textContent;return n.charCodeAt(n.length-1)===59&&e!==`semi`?!1:n!==t&&n}function Fd(e,t,n,r){let i=e.length,a=0,o;if(t=t<0?-t>i?0:i+t:t>i?i:t,n=n>0?n:0,r.length<1e4)o=Array.from(r),o.unshift(t,n),e.splice(...o);else for(n&&e.splice(t,n);a<r.length;)o=r.slice(a,a+1e4),o.unshift(t,0),e.splice(...o),a+=1e4,t+=1e4}function Id(e,t){return e.length>0?(Fd(e,e.length,0,t),e):t}var Ld={}.hasOwnProperty;function Rd(e){let t={},n=-1;for(;++n<e.length;)zd(t,e[n]);return t}function zd(e,t){let n;for(n in t){let r=(Ld.call(e,n)?e[n]:void 0)||(e[n]={}),i=t[n],a;if(i)for(a in i){Ld.call(r,a)||(r[a]=[]);let e=i[a];Bd(r[a],Array.isArray(e)?e:e?[e]:[])}}}function Bd(e,t){let n=-1,r=[];for(;++n<t.length;)(t[n].add===`after`?e:r).push(t[n]);Fd(e,0,0,r)}function Vd(e,t){let 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)}function Hd(e){return e.replace(/[\t\n\r ]+/g,` `).replace(/^ | $/g,``).toLowerCase().toUpperCase()}var Ud=ef(/[A-Za-z]/),Wd=ef(/[\dA-Za-z]/),Gd=ef(/[#-'*+\--9=?A-Z^-~]/);function Kd(e){return e!==null&&(e<32||e===127)}var qd=ef(/\d/),Jd=ef(/[\dA-Fa-f]/),Yd=ef(/[!-/:-@[-`{-~]/);function Z(e){return e!==null&&e<-2}function Xd(e){return e!==null&&(e<0||e===32)}function Zd(e){return e===-2||e===-1||e===32}var Qd=ef(/\p{P}|\p{S}/u),$d=ef(/\s/);function ef(e){return t;function t(t){return t!==null&&t>-1&&e.test(String.fromCharCode(t))}}function tf(e){let t=[],n=-1,r=0,i=0;for(;++n<e.length;){let a=e.charCodeAt(n),o=``;if(a===37&&Wd(e.charCodeAt(n+1))&&Wd(e.charCodeAt(n+2)))i=2;else if(a<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(a))||(o=String.fromCharCode(a));else if(a>55295&&a<57344){let t=e.charCodeAt(n+1);a<56320&&t>56319&&t<57344?(o=String.fromCharCode(a,t),i=1):o=`�`}else o=String.fromCharCode(a);o&&=(t.push(e.slice(r,n),encodeURIComponent(o)),r=n+i+1,``),i&&=(n+=i,0)}return t.join(``)+e.slice(r)}function nf(e,t,n,r){let i=r?r-1:1/0,a=0;return o;function o(r){return Zd(r)?(e.enter(n),s(r)):t(r)}function s(r){return Zd(r)&&a++<i?(e.consume(r),s):(e.exit(n),t(r))}}function rf(e,t,n,r,i,a){let o=0;return s;function s(t){return a>0&&Zd(t)?(e.enter(r),c(t)):l(t)}function c(t){return Zd(t)&&o<a?(e.consume(t),o++,c):(e.exit(r),l(t))}function l(e){return o>=i?t(e):n(e)}}var af={tokenize:of};function of(e){let t=e.attempt(this.parser.constructs.contentInitial,r,i),n;return t;function r(n){if(n===null)e.consume(n);else return e.enter(`lineEnding`),e.consume(n),e.exit(`lineEnding`),nf(e,t,`linePrefix`)}function i(t){return e.enter(`paragraph`),a(t)}function a(t){let r=e.enter(`chunkText`,{contentType:`text`,previous:n});return n&&(n.next=r),n=r,o(t)}function o(t){if(t===null)e.exit(`chunkText`),e.exit(`paragraph`),e.consume(t);else return Z(t)?(e.consume(t),e.exit(`chunkText`),a):(e.consume(t),o)}}var sf=class{constructor(){this.index=new Map,this.map=[]}add(e,t,n){cf(this,e,t,n,!1)}addBefore(e,t,n){cf(this,e,t,n,!0)}consume(e){if(this.map.sort(function(e,t){return e[0]-t[0]}),this.map.length===0)return;let t=this.map.length,n=[];for(;t>0;)--t,n.push(e.slice(this.map[t][0]+this.map[t][1]),this.map[t][2]),e.length=this.map[t][0];n.push(e.slice()),e.length=0;let r=n.pop();for(;r;){for(let t of r)e.push(t);r=n.pop()}this.map.length=0,this.index.clear()}};function cf(e,t,n,r,i){if(n===0&&r.length===0)return;let a=e.index.get(t);if(a){a[1]+=n,i?(r.push(...a[2]),a[2]=r):a[2].push(...r);return}let o=[t,n,r];e.map.push(o),e.index.set(t,o)}var lf={tokenize:df},uf={tokenize:ff};function df(e){let t=this,n=[],r=0,i,a,o;return s;function s(i){if(r<n.length){let a=n[r];return t.containerState=a[1],e.attempt(a[0].continuation,c,l)(i)}return l(i)}function c(e){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&v();let n=t.events.length,a=n,o;for(;a--;)if(t.events[a][0]===`exit`&&t.events[a][1].type===`chunkFlow`){o=t.events[a][1].end;break}_(r);let s=n;for(;s<t.events.length;)t.events[s][1].end={...o},s++;let c=new sf;return c.add(a+1,0,t.events.slice(n)),c.add(n,s-n,[]),c.consume(t.events),l(e)}return s(e)}function l(a){if(r===n.length){if(!i)return f(a);if(i.currentConstruct&&i.currentConstruct.concrete)return m(a);t.interrupt=!(!i.currentConstruct||i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(uf,u,d)(a)}function u(e){return i&&v(),_(r),f(e)}function d(e){return t.parser.lazy[t.now().line]=r!==n.length,o=t.now().offset,m(e)}function f(n){return t.containerState={},e.attempt(uf,p,m)(n)}function p(e){return r++,n.push([t.currentConstruct,t.containerState]),f(e)}function m(n){if(n===null)i&&v(),_(0),e.consume(n);else return i||=t.parser.flow(t.now()),e.enter(`chunkFlow`,{_tokenizer:i,contentType:`flow`,previous:a}),h(n)}function h(n){if(n===null)g(e.exit(`chunkFlow`),!0),_(0),e.consume(n);else return Z(n)?(e.consume(n),g(e.exit(`chunkFlow`)),r=0,t.interrupt=void 0,s):(e.consume(n),h)}function g(e,n){let s=t.sliceStream(e);if(n&&s.push(null),e.previous=a,a&&(a.next=e),a=e,i.defineSkip(e.start),i.write(s),t.parser.lazy[e.start.line]){let e=i.events.length;for(;e--;)if(i.events[e][1].start.offset<o&&(!i.events[e][1].end||i.events[e][1].end.offset>o))return;let n=t.events.length,a=n,s,c;for(;a--;)if(t.events[a][0]===`exit`&&t.events[a][1].type===`chunkFlow`){if(s){c=t.events[a][1].end;break}s=!0}for(_(r),e=n;e<t.events.length;)t.events[e][1].end={...c},e++;let l=new sf;l.add(a+1,0,t.events.slice(n)),l.add(n,e-n,[]),l.consume(t.events)}}function _(r){let i=n.length;for(;i-->r;){let r=n[i];t.containerState=r[1],r[0].exit.call(t,e)}n.length=r}function v(){i.write([null]),a=void 0,i=void 0,t.containerState._closeFlow=void 0}}function ff(e,t,n){return nf(e,e.attempt(this.parser.constructs.document,t,n),`linePrefix`,this.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)}function pf(e){if(e===null||Xd(e)||$d(e))return 1;if(Qd(e))return 2}function mf(e,t,n){let r=[],i=-1;for(;++i<e.length;){let a=e[i].resolveAll;a&&!r.includes(a)&&(t=a(t,n),r.push(a))}return t}var hf={name:`attention`,resolveAll:gf,tokenize:_f};function gf(e,t){let n=-1,r;for(;++n<e.length;)if(e[n][0]===`enter`&&e[n][1].type===`attentionSequence`&&e[n][1]._close){let i=n;for(;i--;)if(e[i][0]===`exit`&&e[i][1].type===`attentionSequence`&&e[i][1]._open&&t.sliceSerialize(e[i][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[i][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[i][1].end.offset-e[i][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;let a=e[i][1].end.offset-e[i][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1,o={...e[i][1].end},s={...e[n][1].start};vf(o,-a),vf(s,a);let c={type:a>1?`strongSequence`:`emphasisSequence`,start:o,end:{...e[i][1].end}},l={type:a>1?`strongSequence`:`emphasisSequence`,start:{...e[n][1].start},end:s},u={type:a>1?`strongText`:`emphasisText`,start:{...e[i][1].end},end:{...e[n][1].start}},d={type:a>1?`strong`:`emphasis`,start:{...c.start},end:{...l.end}};e[i][1].end={...c.start},e[n][1].start={...l.end},r=[],e[i][1].end.offset-e[i][1].start.offset&&(r=Id(r,[[`enter`,e[i][1],t],[`exit`,e[i][1],t]])),r=Id(r,[[`enter`,d,t],[`enter`,c,t],[`exit`,c,t],[`enter`,u,t]]),r=Id(r,mf(t.parser.constructs.insideSpan.null,e.slice(i+1,n),t)),r=Id(r,[[`exit`,u,t],[`enter`,l,t],[`exit`,l,t],[`exit`,d,t]]);let f=0;e[n][1].end.offset-e[n][1].start.offset&&(f=2,r=Id(r,[[`enter`,e[n][1],t],[`exit`,e[n][1],t]])),Fd(e,i-1,n-i+3,r),n=i+r.length-f-2;break}}for(n=-1;++n<e.length;)e[n][1].type===`attentionSequence`&&(e[n][1].type=`data`);return e}function _f(e,t){let n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=pf(r),a;return o;function o(t){return a=t,e.enter(`attentionSequence`),s(t)}function s(o){if(o===a)return e.consume(o),s;let c=e.exit(`attentionSequence`),l=pf(o),u=!l||l===2&&i||n.includes(o)&&o!==42&&o!==95,d=!i||i===2&&l||n.includes(r)&&r!==42&&r!==95;return c._open=!!(a===42?u:u&&(i||!d)),c._close=!!(a===42?d:d&&(l||!u)),t(o)}}function vf(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}var yf={name:`autolink`,tokenize:bf};function bf(e,t,n){let r=0;return i;function i(t){return e.enter(`autolink`),e.enter(`autolinkMarker`),e.consume(t),e.exit(`autolinkMarker`),e.enter(`autolinkProtocol`),a}function a(t){return Ud(t)?(e.consume(t),o):t===64?n(t):l(t)}function o(e){return e===43||e===45||e===46||Wd(e)?(r=1,s(e)):l(e)}function s(t){return t===58?(e.consume(t),r=0,c):(t===43||t===45||t===46||Wd(t))&&r++<32?(e.consume(t),s):(r=0,l(t))}function c(r){return r===62?(e.exit(`autolinkProtocol`),e.enter(`autolinkMarker`),e.consume(r),e.exit(`autolinkMarker`),e.exit(`autolink`),t):r===null||r===32||r===60||Kd(r)?n(r):(e.consume(r),c)}function l(t){return t===64?(e.consume(t),u):Gd(t)?(e.consume(t),l):n(t)}function u(e){return Wd(e)?d(e):n(e)}function d(n){return n===46?(e.consume(n),r=0,u):n===62?(e.exit(`autolinkProtocol`).type=`autolinkEmail`,e.enter(`autolinkMarker`),e.consume(n),e.exit(`autolinkMarker`),e.exit(`autolink`),t):f(n)}function f(t){if((t===45||Wd(t))&&r++<63){let n=t===45?f:d;return e.consume(t),n}return n(t)}}var xf={partial:!0,tokenize:Sf};function Sf(e,t,n){return r;function r(t){return Zd(t)?nf(e,i,`linePrefix`)(t):i(t)}function i(e){return e===null||Z(e)?t(e):n(e)}}var Cf={continuation:{tokenize:Tf},exit:Ef,name:`blockQuote`,tokenize:wf};function wf(e,t,n){let r=this;return i;function i(t){if(t===62){let n=r.containerState;return n.open||=(e.enter(`blockQuote`,{_container:!0}),!0),e.enter(`blockQuotePrefix`),e.enter(`blockQuoteMarker`),e.consume(t),e.exit(`blockQuoteMarker`),a}return n(t)}function a(n){return Zd(n)?(e.enter(`blockQuotePrefixWhitespace`),e.consume(n),e.exit(`blockQuotePrefixWhitespace`),e.exit(`blockQuotePrefix`),t):(e.exit(`blockQuotePrefix`),t(n))}}function Tf(e,t,n){let r=this;return i;function i(t){return Zd(t)?nf(e,a,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):a(t)}function a(r){return e.attempt(Cf,t,n)(r)}}function Ef(e){e.exit(`blockQuote`)}var Df={name:`characterEscape`,tokenize:Of};function Of(e,t,n){return r;function r(t){return e.enter(`characterEscape`),e.enter(`escapeMarker`),e.consume(t),e.exit(`escapeMarker`),i}function i(r){return Yd(r)?(e.enter(`characterEscapeValue`),e.consume(r),e.exit(`characterEscapeValue`),e.exit(`characterEscape`),t):n(r)}}var kf={name:`characterReference`,tokenize:Af};function Af(e,t,n){let r=this,i=0,a,o;return s;function s(t){return e.enter(`characterReference`),e.enter(`characterReferenceMarker`),e.consume(t),e.exit(`characterReferenceMarker`),c}function c(t){return t===35?(e.enter(`characterReferenceMarkerNumeric`),e.consume(t),e.exit(`characterReferenceMarkerNumeric`),l):(e.enter(`characterReferenceValue`),a=31,o=Wd,u(t))}function l(t){return t===88||t===120?(e.enter(`characterReferenceMarkerHexadecimal`),e.consume(t),e.exit(`characterReferenceMarkerHexadecimal`),e.enter(`characterReferenceValue`),a=6,o=Jd,u):(e.enter(`characterReferenceValue`),a=7,o=qd,u(t))}function u(s){if(s===59&&i){let i=e.exit(`characterReferenceValue`);return o===Wd&&!Pd(r.sliceSerialize(i))?n(s):(e.enter(`characterReferenceMarker`),e.consume(s),e.exit(`characterReferenceMarker`),e.exit(`characterReference`),t)}return o(s)&&i++<a?(e.consume(s),u):n(s)}}var jf={partial:!0,tokenize:Mf};function Mf(e,t,n){let r=this;return i;function i(t){return t===null?n(t):(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),a)}function a(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}var Nf={concrete:!0,name:`codeFenced`,tokenize:Pf};function Pf(e,t,n){let r=this,i={partial:!0,tokenize:x},a=0,o=0,s;return c;function c(e){return l(e)}function l(t){let n=r.events[r.events.length-1];return a=n&&n[1].type===`linePrefix`?n[2].sliceSerialize(n[1],!0).length:0,s=t,e.enter(`codeFenced`),e.enter(`codeFencedFence`),e.enter(`codeFencedFenceSequence`),u(t)}function u(t){return t===s?(o++,e.consume(t),u):o<3?n(t):(e.exit(`codeFencedFenceSequence`),Zd(t)?nf(e,d,`whitespace`)(t):d(t))}function d(n){return n===null||Z(n)?(e.exit(`codeFencedFence`),r.interrupt?t(n):e.check(jf,h,b)(n)):(e.enter(`codeFencedFenceInfo`),e.enter(`chunkString`,{contentType:`string`}),f(n))}function f(t){return t===null||Z(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceInfo`),d(t)):Zd(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceInfo`),nf(e,p,`whitespace`)(t)):t===96&&t===s?n(t):(e.consume(t),f)}function p(t){return t===null||Z(t)?d(t):(e.enter(`codeFencedFenceMeta`),e.enter(`chunkString`,{contentType:`string`}),m(t))}function m(t){return t===null||Z(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceMeta`),d(t)):t===96&&t===s?n(t):(e.consume(t),m)}function h(t){return e.attempt(i,b,g)(t)}function g(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),_}function _(t){return a>0&&Zd(t)?nf(e,v,`linePrefix`,a+1)(t):v(t)}function v(t){return t===null||Z(t)?e.check(jf,h,b)(t):(e.enter(`codeFlowValue`),y(t))}function y(t){return t===null||Z(t)?(e.exit(`codeFlowValue`),v(t)):(e.consume(t),y)}function b(n){return e.exit(`codeFenced`),t(n)}function x(e,t,n){let i=0;return a;function a(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),c}function c(t){return e.enter(`codeFencedFence`),Zd(t)?nf(e,l,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):l(t)}function l(t){return t===s?(e.enter(`codeFencedFenceSequence`),u(t)):n(t)}function u(t){return t===s?(i++,e.consume(t),u):i>=o?(e.exit(`codeFencedFenceSequence`),Zd(t)?nf(e,d,`whitespace`)(t):d(t)):n(t)}function d(r){return r===null||Z(r)?(e.exit(`codeFencedFence`),t(r)):n(r)}}}var Ff={name:`codeIndented`,tokenize:Lf},If={partial:!0,tokenize:Rf};function Lf(e,t,n){return r;function r(t){return e.enter(`codeIndented`),rf(e,i,n,`linePrefix`,4,4)(t)}function i(t){return t===null?o(t):Z(t)?e.attempt(If,i,o)(t):(e.enter(`codeFlowValue`),a(t))}function a(t){return t===null||Z(t)?(e.exit(`codeFlowValue`),i(t)):(e.consume(t),a)}function o(n){return e.exit(`codeIndented`),t(n)}}function Rf(e,t,n){let r=this;return i;function i(o){return r.parser.lazy[r.now().line]?n(o):Z(o)?(e.enter(`lineEnding`),e.consume(o),e.exit(`lineEnding`),i):rf(e,t,a,`linePrefix`,4,4)(o)}function a(e){return Z(e)?i(e):n(e)}}var zf={name:`codeText`,previous:Vf,resolve:Bf,tokenize:Hf};function Bf(e){let t=e.length-4,n=3,r,i;if((e[n][1].type===`lineEnding`||e[n][1].type===`space`)&&(e[t][1].type===`lineEnding`||e[t][1].type===`space`)){for(r=n;++r<t;)if(e[r][1].type===`codeTextData`){e[n][1].type=`codeTextPadding`,e[t][1].type=`codeTextPadding`,n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)i===void 0?r!==t&&e[r][1].type!==`lineEnding`&&(i=r):(r===t||e[r][1].type===`lineEnding`)&&(e[i][1].type=`codeTextData`,r!==i+2&&(e[i][1].end=e[r-1][1].end,e.splice(i+2,r-i-2),t-=r-i-2,r=i+2),i=void 0);return e}function Vf(e){return e!==96||this.events[this.events.length-1][1].type===`characterEscape`}function Hf(e,t,n){let r=0,i,a;return o;function o(t){return e.enter(`codeText`),e.enter(`codeTextSequence`),s(t)}function s(t){return t===96?(e.consume(t),r++,s):(e.exit(`codeTextSequence`),c(t))}function c(t){return t===null?n(t):t===32?(e.enter(`space`),e.consume(t),e.exit(`space`),c):t===96?(a=e.enter(`codeTextSequence`),i=0,u(t)):Z(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),c):(e.enter(`codeTextData`),l(t))}function l(t){return t===null||t===32||t===96||Z(t)?(e.exit(`codeTextData`),c(t)):(e.consume(t),l)}function u(n){return n===96?(e.consume(n),i++,u):i===r?(e.exit(`codeTextSequence`),e.exit(`codeText`),t(n)):(a.type=`codeTextData`,l(n))}}var Uf=class{constructor(e){this.left=e?[...e]:[],this.right=[]}get(e){if(e<0||e>=this.left.length+this.right.length)throw RangeError("Cannot access index `"+e+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return e<this.left.length?this.left[e]:this.right[this.right.length-e+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(e,t){let n=t??1/0;return n<this.left.length?this.left.slice(e,n):e>this.left.length?this.right.slice(this.right.length-n+this.left.length,this.right.length-e+this.left.length).reverse():this.left.slice(e).concat(this.right.slice(this.right.length-n+this.left.length).reverse())}splice(e,t,n){let r=t||0;this.setCursor(Math.trunc(e));let i=this.right.splice(this.right.length-r,1/0);return n&&Wf(this.left,n),i.reverse()}pop(){return this.setCursor(1/0),this.left.pop()}push(e){this.setCursor(1/0),this.left.push(e)}pushMany(e){this.setCursor(1/0),Wf(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),Wf(this.right,e.reverse())}setCursor(e){if(!(e===this.left.length||e>this.left.length&&this.right.length===0||e<0&&this.left.length===0)){if(e<this.left.length){let t=this.left.splice(e,1/0);Wf(this.right,t.reverse())}else{let t=this.right.splice(this.left.length+this.right.length-e,1/0);Wf(this.left,t.reverse())}}}};function Wf(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 Gf(e){let t={},n=-1,r,i,a,o,s,c,l,u=new Uf(e);for(;++n<u.length;){for(;n in t;)n=t[n];if(r=u.get(n),n&&r[1].type===`chunkFlow`&&u.get(n-1)[1].type===`listItemPrefix`&&(c=r[1]._tokenizer.events,a=0,a<c.length&&c[a][1].type===`lineEndingBlank`&&(a+=2),a<c.length&&c[a][1].type===`content`))for(;++a<c.length&&c[a][1].type!==`content`;)c[a][1].type===`chunkText`&&(c[a][1]._isInFirstContentOfListItem=!0,a++);if(r[0]===`enter`)r[1].contentType&&(Object.assign(t,Kf(u,n)),n=t[n],l=!0);else if(r[1]._container){for(a=n,i=void 0;a--;)if(o=u.get(a),o[1].type===`lineEnding`||o[1].type===`lineEndingBlank`)o[0]===`enter`&&(i&&(u.get(i)[1].type=`lineEndingBlank`),o[1].type=`lineEnding`,i=a);else if(o[1].type!==`linePrefix`&&o[1].type!==`listItemIndent`)break;i&&(r[1].end={...u.get(i)[1].start},s=u.slice(i,n),s.unshift(r),u.splice(i,n-i+1,s))}}return Fd(e,0,1/0,u.slice(0)),!l}function Kf(e,t){let n=e.get(t)[1],r=e.get(t)[2],i=t-1,a=[],o=n._tokenizer;o||(o=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(o._contentTypeTextTrailing=!0));let s=o.events,c=[],l={},u,d,f=-1,p=n,m=0,h=0,g=[h];for(;p;){for(;e.get(++i)[1]!==p;);a.push(i),p._tokenizer||(u=r.sliceStream(p),p.next||u.push(null),d&&o.defineSkip(p.start),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=!0),o.write(u),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=void 0)),d=p,p=p.next}for(p=n;++f<s.length;)s[f][0]===`exit`&&s[f-1][0]===`enter`&&s[f][1].type===s[f-1][1].type&&s[f][1].start.line!==s[f][1].end.line&&(h=f+1,g.push(h),p._tokenizer=void 0,p.previous=void 0,p=p.next);for(o.events=[],p?(p._tokenizer=void 0,p.previous=void 0):g.pop(),f=g.length;f--;){let t=s.slice(g[f],g[f+1]),n=a.pop();c.push([n,n+t.length-1]),e.splice(n,2,t)}for(c.reverse(),f=-1;++f<c.length;)l[m+c[f][0]]=m+c[f][1],m+=c[f][1]-c[f][0]-1;return l}var qf={resolve:Yf,tokenize:Xf},Jf={partial:!0,tokenize:Zf};function Yf(e){return Gf(e),e}function Xf(e,t){let n;return r;function r(t){return e.enter(`content`),n=e.enter(`chunkContent`,{contentType:`content`}),i(t)}function i(t){return t===null?a(t):Z(t)?e.check(Jf,o,a)(t):(e.consume(t),i)}function a(n){return e.exit(`chunkContent`),e.exit(`content`),t(n)}function o(t){return e.consume(t),e.exit(`chunkContent`),n.next=e.enter(`chunkContent`,{contentType:`content`,previous:n}),n=n.next,i}}function Zf(e,t,n){let r=this;return i;function i(t){return e.exit(`chunkContent`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),nf(e,a,`linePrefix`)}function a(i){if(i===null||Z(i))return n(i);let a=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes(`codeIndented`)&&a&&a[1].type===`linePrefix`&&a[2].sliceSerialize(a[1],!0).length>=4?t(i):e.interrupt(r.parser.constructs.flow,n,t)(i)}}function Qf(e,t,n,r,i,a,o,s,c){let l=c||1/0,u=0;return d;function d(t){return t===60?(e.enter(r),e.enter(i),e.enter(a),e.consume(t),e.exit(a),f):t===null||t===32||t===41||Kd(t)?n(t):(e.enter(r),e.enter(o),e.enter(s),e.enter(`chunkString`,{contentType:`string`}),h(t))}function f(n){return n===62?(e.enter(a),e.consume(n),e.exit(a),e.exit(i),e.exit(r),t):(e.enter(s),e.enter(`chunkString`,{contentType:`string`}),p(n))}function p(t){return t===62?(e.exit(`chunkString`),e.exit(s),f(t)):t===null||t===60||Z(t)?n(t):(e.consume(t),t===92?m:p)}function m(t){return t===60||t===62||t===92?(e.consume(t),p):p(t)}function h(i){return!u&&(i===null||i===41||Xd(i))?(e.exit(`chunkString`),e.exit(s),e.exit(o),e.exit(r),t(i)):u<l&&i===40?(e.consume(i),u++,h):i===41?(e.consume(i),u--,h):i===null||i===32||i===40||Kd(i)?n(i):(e.consume(i),i===92?g:h)}function g(t){return t===40||t===41||t===92?(e.consume(t),h):h(t)}}function $f(e,t,n,r,i,a){let o=this,s=0,c;return l;function l(t){return e.enter(r),e.enter(i),e.consume(t),e.exit(i),e.enter(a),u}function u(l){return s>999||l===null||l===91||l===93&&!c||l===94&&!s&&`_hiddenFootnoteSupport`in o.parser.constructs?n(l):l===93?(e.exit(a),e.enter(i),e.consume(l),e.exit(i),e.exit(r),t):Z(l)?(e.enter(`lineEnding`),e.consume(l),e.exit(`lineEnding`),u):(e.enter(`chunkString`,{contentType:`string`}),d(l))}function d(t){return t===null||t===91||t===93||Z(t)||s++>999?(e.exit(`chunkString`),u(t)):(e.consume(t),c||=!Zd(t),t===92?f:d)}function f(t){return t===91||t===92||t===93?(e.consume(t),s++,d):d(t)}}function ep(e,t,n,r,i,a){let o;return s;function s(t){return t===34||t===39||t===40?(e.enter(r),e.enter(i),e.consume(t),e.exit(i),o=t===40?41:t,c):n(t)}function c(n){return n===o?(e.enter(i),e.consume(n),e.exit(i),e.exit(r),t):(e.enter(a),l(n))}function l(t){return t===o?(e.exit(a),c(o)):t===null?n(t):Z(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),nf(e,l,`linePrefix`)):(e.enter(`chunkString`,{contentType:`string`}),u(t))}function u(t){return t===o||t===null||Z(t)?(e.exit(`chunkString`),l(t)):(e.consume(t),t===92?d:u)}function d(t){return t===o||t===92?(e.consume(t),u):u(t)}}function tp(e,t){let n;return r;function r(i){return Z(i)?(e.enter(`lineEnding`),e.consume(i),e.exit(`lineEnding`),n=!0,r):Zd(i)?nf(e,r,n?`linePrefix`:`lineSuffix`)(i):t(i)}}var np={name:`definition`,tokenize:ip},rp={partial:!0,tokenize:ap};function ip(e,t,n){let r=this,i;return a;function a(t){return e.enter(`definition`),o(t)}function o(t){return $f.call(r,e,s,n,`definitionLabel`,`definitionLabelMarker`,`definitionLabelString`)(t)}function s(t){return i=Hd(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),t===58?(e.enter(`definitionMarker`),e.consume(t),e.exit(`definitionMarker`),c):n(t)}function c(t){return Xd(t)?tp(e,l)(t):l(t)}function l(t){return Qf(e,u,n,`definitionDestination`,`definitionDestinationLiteral`,`definitionDestinationLiteralMarker`,`definitionDestinationRaw`,`definitionDestinationString`)(t)}function u(t){return e.attempt(rp,d,d)(t)}function d(t){return Zd(t)?nf(e,f,`whitespace`)(t):f(t)}function f(a){return a===null||Z(a)?(e.exit(`definition`),r.parser.defined.push(i),t(a)):n(a)}}function ap(e,t,n){return r;function r(t){return Xd(t)?tp(e,i)(t):n(t)}function i(t){return ep(e,a,n,`definitionTitle`,`definitionTitleMarker`,`definitionTitleString`)(t)}function a(t){return Zd(t)?nf(e,o,`whitespace`)(t):o(t)}function o(e){return e===null||Z(e)?t(e):n(e)}}var op={name:`hardBreakEscape`,tokenize:sp};function sp(e,t,n){return r;function r(t){return e.enter(`hardBreakEscape`),e.consume(t),i}function i(r){return Z(r)?(e.exit(`hardBreakEscape`),t(r)):n(r)}}var cp={name:`headingAtx`,resolve:lp,tokenize:up};function lp(e,t){let n=e.length-2,r=3;if(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){let i={type:`atxHeadingText`,start:e[r][1].start,end:e[n][1].end},a={type:`chunkText`,start:e[r][1].start,end:e[n][1].end,contentType:`text`};Fd(e,r,n-r+1,[[`enter`,i,t],[`enter`,a,t],[`exit`,a,t],[`exit`,i,t]])}return e}function up(e,t,n){let r=0;return i;function i(t){return e.enter(`atxHeading`),a(t)}function a(t){return e.enter(`atxHeadingSequence`),o(t)}function o(t){return t===35&&r++<6?(e.consume(t),o):t===null||Xd(t)?(e.exit(`atxHeadingSequence`),s(t)):n(t)}function s(n){return n===35?(e.enter(`atxHeadingSequence`),c(n)):n===null||Z(n)?(e.exit(`atxHeading`),t(n)):Zd(n)?nf(e,s,`whitespace`)(n):(e.enter(`atxHeadingText`),l(n))}function c(t){return t===35?(e.consume(t),c):(e.exit(`atxHeadingSequence`),s(t))}function l(t){return t===null||t===35||Xd(t)?(e.exit(`atxHeadingText`),s(t)):(e.consume(t),l)}}var dp=`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`.split(`.`),fp=[`pre`,`script`,`style`,`textarea`],pp={concrete:!0,name:`htmlFlow`,resolveTo:hp,tokenize:gp},mp={partial:!0,tokenize:_p};function hp(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 gp(e,t,n){let r=this,i,a,o,s,c;return l;function l(e){return u(e)}function u(t){return e.enter(`htmlFlow`),e.enter(`htmlFlowData`),e.consume(t),d}function d(s){return s===33?(e.consume(s),f):s===47?(e.consume(s),a=!0,h):s===63?(e.consume(s),i=3,r.interrupt?t:I):Ud(s)?(e.consume(s),o=String.fromCharCode(s),g):n(s)}function f(a){return a===45?(e.consume(a),i=2,p):a===91?(e.consume(a),i=5,s=0,m):Ud(a)?(e.consume(a),i=4,r.interrupt?t:I):n(a)}function p(i){return i===45?(e.consume(i),r.interrupt?t:I):n(i)}function m(i){return i===`CDATA[`.charCodeAt(s++)?(e.consume(i),s===6?r.interrupt?t:O:m):n(i)}function h(t){return Ud(t)?(e.consume(t),o=String.fromCharCode(t),g):n(t)}function g(s){if(s===null||s===47||s===62||Xd(s)){let c=s===47,l=o.toLowerCase();return!c&&!a&&fp.includes(l)?(i=1,r.interrupt?t(s):O(s)):dp.includes(o.toLowerCase())?(i=6,c?(e.consume(s),_):r.interrupt?t(s):O(s)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(s):a?v(s):y(s))}return s===45||Wd(s)?(e.consume(s),o+=String.fromCharCode(s),g):n(s)}function _(i){return i===62?(e.consume(i),r.interrupt?t:O):n(i)}function v(t){return Zd(t)?(e.consume(t),v):E(t)}function y(t){return t===47?(e.consume(t),E):t===58||t===95||Ud(t)?(e.consume(t),b):Zd(t)?(e.consume(t),y):E(t)}function b(t){return t===45||t===46||t===58||t===95||Wd(t)?(e.consume(t),b):x(t)}function x(t){return t===61?(e.consume(t),S):Zd(t)?(e.consume(t),x):y(t)}function S(t){return t===null||t===60||t===61||t===62||t===96?n(t):t===34||t===39?(e.consume(t),c=t,C):Zd(t)?(e.consume(t),S):w(t)}function C(t){return t===c?(e.consume(t),c=null,T):t===null||Z(t)?n(t):(e.consume(t),C)}function w(t){return t===null||t===34||t===39||t===47||t===60||t===61||t===62||t===96||Xd(t)?x(t):(e.consume(t),w)}function T(e){return e===47||e===62||Zd(e)?y(e):n(e)}function E(t){return t===62?(e.consume(t),D):n(t)}function D(t){return t===null||Z(t)?O(t):Zd(t)?(e.consume(t),D):n(t)}function O(t){return t===45&&i===2?(e.consume(t),M):t===60&&i===1?(e.consume(t),N):t===62&&i===4?(e.consume(t),L):t===63&&i===3?(e.consume(t),I):t===93&&i===5?(e.consume(t),F):Z(t)&&(i===6||i===7)?(e.exit(`htmlFlowData`),e.check(mp,R,k)(t)):t===null||Z(t)?(e.exit(`htmlFlowData`),k(t)):(e.consume(t),O)}function k(t){return e.check(jf,A,R)(t)}function A(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),j}function j(t){return t===null||Z(t)?k(t):(e.enter(`htmlFlowData`),O(t))}function M(t){return t===45?(e.consume(t),I):O(t)}function N(t){return t===47?(e.consume(t),o=``,P):O(t)}function P(t){if(t===62){let n=o.toLowerCase();return fp.includes(n)?(e.consume(t),L):O(t)}return Ud(t)&&o.length<8?(e.consume(t),o+=String.fromCharCode(t),P):O(t)}function F(t){return t===93?(e.consume(t),I):O(t)}function I(t){return t===62?(e.consume(t),L):t===45&&i===2?(e.consume(t),I):O(t)}function L(t){return t===null||Z(t)?(e.exit(`htmlFlowData`),R(t)):(e.consume(t),L)}function R(n){return e.exit(`htmlFlow`),t(n)}}function _p(e,t,n){return r;function r(r){return e.enter(`lineEnding`),e.consume(r),e.exit(`lineEnding`),e.attempt(xf,t,n)}}var vp={name:`htmlText`,tokenize:yp};function yp(e,t,n){let r=this,i,a,o;return s;function s(t){return e.enter(`htmlText`),e.enter(`htmlTextData`),e.consume(t),c}function c(t){return t===33?(e.consume(t),l):t===47?(e.consume(t),x):t===63?(e.consume(t),y):Ud(t)?(e.consume(t),w):n(t)}function l(t){return t===45?(e.consume(t),u):t===91?(e.consume(t),a=0,m):Ud(t)?(e.consume(t),v):n(t)}function u(t){return t===45?(e.consume(t),p):n(t)}function d(t){return t===null?n(t):t===45?(e.consume(t),f):Z(t)?(o=d,N(t)):(e.consume(t),d)}function f(t){return t===45?(e.consume(t),p):d(t)}function p(e){return e===62?M(e):e===45?f(e):d(e)}function m(t){return t===`CDATA[`.charCodeAt(a++)?(e.consume(t),a===6?h:m):n(t)}function h(t){return t===null?n(t):t===93?(e.consume(t),g):Z(t)?(o=h,N(t)):(e.consume(t),h)}function g(t){return t===93?(e.consume(t),_):h(t)}function _(t){return t===62?M(t):t===93?(e.consume(t),_):h(t)}function v(t){return t===null||t===62?M(t):Z(t)?(o=v,N(t)):(e.consume(t),v)}function y(t){return t===null?n(t):t===63?(e.consume(t),b):Z(t)?(o=y,N(t)):(e.consume(t),y)}function b(e){return e===62?M(e):y(e)}function x(t){return Ud(t)?(e.consume(t),S):n(t)}function S(t){return t===45||Wd(t)?(e.consume(t),S):C(t)}function C(t){return Z(t)?(o=C,N(t)):Zd(t)?(e.consume(t),C):M(t)}function w(t){return t===45||Wd(t)?(e.consume(t),w):t===47||t===62||Xd(t)?T(t):n(t)}function T(t){return t===47?(e.consume(t),M):t===58||t===95||Ud(t)?(e.consume(t),E):Z(t)?(o=T,N(t)):Zd(t)?(e.consume(t),T):M(t)}function E(t){return t===45||t===46||t===58||t===95||Wd(t)?(e.consume(t),E):D(t)}function D(t){return t===61?(e.consume(t),O):Z(t)?(o=D,N(t)):Zd(t)?(e.consume(t),D):T(t)}function O(t){return t===null||t===60||t===61||t===62||t===96?n(t):t===34||t===39?(e.consume(t),i=t,k):Z(t)?(o=O,N(t)):Zd(t)?(e.consume(t),O):(e.consume(t),A)}function k(t){return t===i?(e.consume(t),i=void 0,j):t===null?n(t):Z(t)?(o=k,N(t)):(e.consume(t),k)}function A(t){return t===null||t===34||t===39||t===60||t===61||t===96?n(t):t===47||t===62||Xd(t)?T(t):(e.consume(t),A)}function j(e){return e===47||e===62||Xd(e)?T(e):n(e)}function M(r){return r===62?(e.consume(r),e.exit(`htmlTextData`),e.exit(`htmlText`),t):n(r)}function N(t){return e.exit(`htmlTextData`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),P}function P(t){return Zd(t)?nf(e,F,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):F(t)}function F(t){return e.enter(`htmlTextData`),o(t)}}var bp={name:`labelEnd`,resolveAll:wp,resolveTo:Tp,tokenize:Ep},xp={tokenize:Dp},Sp={tokenize:Op},Cp={tokenize:kp};function wp(e){let t=-1,n=[];for(;++t<e.length;){let r=e[t][1];if(n.push(e[t]),r.type===`labelImage`||r.type===`labelLink`||r.type===`labelEnd`){let e=r.type===`labelImage`?4:2;r.type=`data`,t+=e}}return e.length!==n.length&&Fd(e,0,e.length,n),e}function Tp(e,t){let n=e.length,r=0,i,a,o;for(;n--;){let t=e[n][1];if(i){if(t.type===`link`||t.type===`labelLink`&&t._inactive)break;e[n][0]===`enter`&&t.type===`labelLink`&&(t._inactive=!0)}else if(a){if(e[n][0]===`enter`&&(t.type===`labelImage`||t.type===`labelLink`)&&!t._balanced&&(i=n,t.type!==`labelLink`)){r=2;break}}else t.type===`labelEnd`&&(a=n)}let s={type:e[i][1].type===`labelLink`?`link`:`image`,start:{...e[i][1].start},end:{...e[e.length-1][1].end}},c={type:`label`,start:{...e[i][1].start},end:{...e[a][1].end}},l={type:`labelText`,start:{...e[i+r+2][1].end},end:{...e[a-2][1].start}};return o=[[`enter`,s,t],[`enter`,c,t]],o=Id(o,e.slice(i+1,i+r+3)),o=Id(o,[[`enter`,l,t]]),o=Id(o,mf(t.parser.constructs.insideSpan.null,e.slice(i+r+4,a-3),t)),o=Id(o,[[`exit`,l,t],e[a-2],e[a-1],[`exit`,c,t]]),o=Id(o,e.slice(a+1)),o=Id(o,[[`exit`,s,t]]),Fd(e,i,e.length,o),e}function Ep(e,t,n){let r=this,i=r._labelStarts,a,o;if(i){for(;i.length>0&&i[i.length-1]._balanced;)i.pop();a=i[i.length-1]}return s;function s(t){return a?a._inactive?d(t):(o=r.parser.defined.includes(Hd(r.sliceSerialize({start:a.end,end:r.now()}))),e.enter(`labelEnd`),e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),e.exit(`labelEnd`),c):n(t)}function c(t){return t===40?e.attempt(xp,u,o?u:d)(t):t===91?e.attempt(Sp,u,o?l:d)(t):o?u(t):d(t)}function l(t){return e.attempt(Cp,u,d)(t)}function u(e){return i.pop(),t(e)}function d(e){return a._balanced=!0,n(e)}}function Dp(e,t,n){return r;function r(t){return e.enter(`resource`),e.enter(`resourceMarker`),e.consume(t),e.exit(`resourceMarker`),i}function i(t){return Xd(t)?tp(e,a)(t):a(t)}function a(t){return t===41?u(t):Qf(e,o,s,`resourceDestination`,`resourceDestinationLiteral`,`resourceDestinationLiteralMarker`,`resourceDestinationRaw`,`resourceDestinationString`,32)(t)}function o(t){return Xd(t)?tp(e,c)(t):u(t)}function s(e){return n(e)}function c(t){return t===34||t===39||t===40?ep(e,l,n,`resourceTitle`,`resourceTitleMarker`,`resourceTitleString`)(t):u(t)}function l(t){return Xd(t)?tp(e,u)(t):u(t)}function u(r){return r===41?(e.enter(`resourceMarker`),e.consume(r),e.exit(`resourceMarker`),e.exit(`resource`),t):n(r)}}function Op(e,t,n){let r=this;return i;function i(t){return $f.call(r,e,a,o,`reference`,`referenceMarker`,`referenceString`)(t)}function a(e){return r.parser.defined.includes(Hd(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(e):n(e)}function o(e){return n(e)}}function kp(e,t,n){return r;function r(t){return e.enter(`reference`),e.enter(`referenceMarker`),e.consume(t),e.exit(`referenceMarker`),i}function i(r){return r===93?(e.enter(`referenceMarker`),e.consume(r),e.exit(`referenceMarker`),e.exit(`reference`),t):n(r)}}var Ap={name:`labelStartImage`,resolveAll:bp.resolveAll,tokenize:jp};function jp(e,t,n){let r=this,i;return a;function a(t){return e.enter(`labelImage`),e.enter(`labelImageMarker`),e.consume(t),e.exit(`labelImageMarker`),o}function o(t){return t===91?(e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),i=e.exit(`labelImage`),s):n(t)}function s(e){return e===94&&`_hiddenFootnoteSupport`in r.parser.constructs?n(e):(r._labelStarts=r._labelStarts||[],r._labelStarts.push(i),t(e))}}var Mp={name:`labelStartLink`,resolveAll:bp.resolveAll,tokenize:Np};function Np(e,t,n){let r=this,i;return a;function a(t){return e.enter(`labelLink`),e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),i=e.exit(`labelLink`),o}function o(e){return e===94&&`_hiddenFootnoteSupport`in r.parser.constructs?n(e):(r._labelStarts=r._labelStarts||[],r._labelStarts.push(i),t(e))}}var Pp={name:`lineEnding`,tokenize:Fp};function Fp(e,t){return n;function n(n){return e.enter(`lineEnding`),e.consume(n),e.exit(`lineEnding`),nf(e,t,`linePrefix`)}}var Ip={name:`thematicBreak`,tokenize:Lp};function Lp(e,t,n){let r=0,i;return a;function a(t){return e.enter(`thematicBreak`),o(t)}function o(e){return i=e,s(e)}function s(a){return a===i?(e.enter(`thematicBreakSequence`),c(a)):r>=3&&(a===null||Z(a))?(e.exit(`thematicBreak`),t(a)):n(a)}function c(t){return t===i?(e.consume(t),r++,c):(e.exit(`thematicBreakSequence`),Zd(t)?nf(e,s,`whitespace`)(t):s(t))}}var Rp={continuation:{tokenize:Hp},exit:Wp,name:`list`,tokenize:Vp},zp={partial:!0,tokenize:Gp},Bp={partial:!0,tokenize:Up};function Vp(e,t,n){let r=this,i=r.events[r.events.length-1],a=i&&i[1].type===`linePrefix`?i[2].sliceSerialize(i[1],!0).length:0,o=0;return s;function s(t){let i=r.containerState.type||(t===42||t===43||t===45?`listUnordered`:`listOrdered`);if(i===`listUnordered`?!r.containerState.marker||t===r.containerState.marker:qd(t)){if(r.containerState.type||(r.containerState.type=i,e.enter(i,{_container:!0})),i===`listUnordered`)return e.enter(`listItemPrefix`),t===42||t===45?e.check(Ip,n,l)(t):l(t);if(!r.interrupt||t===49)return e.enter(`listItemPrefix`),e.enter(`listItemValue`),c(t)}return n(t)}function c(t){return qd(t)&&++o<10?(e.consume(t),c):(!r.interrupt||o<2)&&(r.containerState.marker?t===r.containerState.marker:t===41||t===46)?(e.exit(`listItemValue`),l(t)):n(t)}function l(t){return e.enter(`listItemMarker`),e.consume(t),e.exit(`listItemMarker`),r.containerState.marker=r.containerState.marker||t,e.check(xf,r.interrupt?n:u,e.attempt(zp,f,d))}function u(e){return r.containerState.initialBlankLine=!0,a++,f(e)}function d(t){return Zd(t)?(e.enter(`listItemPrefixWhitespace`),e.consume(t),e.exit(`listItemPrefixWhitespace`),f):n(t)}function f(n){return r.containerState.size=a+r.sliceSerialize(e.exit(`listItemPrefix`),!0).length,t(n)}}function Hp(e,t,n){let r=this;return r.containerState._closeFlow=void 0,e.check(xf,i,a);function i(n){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,nf(e,t,`listItemIndent`,r.containerState.size+1)(n)}function a(n){return r.containerState.furtherBlankLines||!Zd(n)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,o(n)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(Bp,t,o)(n))}function o(i){return r.containerState._closeFlow=!0,r.interrupt=void 0,nf(e,e.attempt(Rp,t,n),`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(i)}}function Up(e,t,n){let r=this;return nf(e,i,`listItemIndent`,r.containerState.size+1);function i(e){let i=r.events[r.events.length-1];return i&&i[1].type===`listItemIndent`&&i[2].sliceSerialize(i[1],!0).length===r.containerState.size?t(e):n(e)}}function Wp(e){e.exit(this.containerState.type)}function Gp(e,t,n){let r=this;return nf(e,i,`listItemPrefixWhitespace`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:5);function i(e){let i=r.events[r.events.length-1];return!Zd(e)&&i&&i[1].type===`listItemPrefixWhitespace`?t(e):n(e)}}var Kp={name:`setextUnderline`,resolveTo:qp,tokenize:Jp};function qp(e,t){let n=new sf,r=e.length,i,a,o;for(;r--;)if(e[r][0]===`enter`){if(e[r][1].type===`content`){i=r;break}e[r][1].type===`paragraph`&&(a=r)}else e[r][1].type===`content`&&n.add(r,1,[]),!o&&e[r][1].type===`definition`&&(o=r);let s={type:`setextHeading`,start:{...e[i][1].start},end:{...e[e.length-1][1].end}};return e[a][1].type=`setextHeadingText`,o?(n.add(a,0,[[`enter`,s,t]]),n.add(o+1,0,[[`exit`,e[i][1],t]]),e[i][1].end={...e[o][1].end}):e[i][1]=s,n.add(e.length,0,[[`exit`,s,t]]),n.consume(e),e}function Jp(e,t,n){let r=this,i;return a;function a(t){let a=r.events.length,s;for(;a--;)if(r.events[a][1].type!==`lineEnding`&&r.events[a][1].type!==`linePrefix`&&r.events[a][1].type!==`content`){s=r.events[a][1].type===`paragraph`;break}return!r.parser.lazy[r.now().line]&&(r.interrupt||s)?(e.enter(`setextHeadingLine`),i=t,o(t)):n(t)}function o(t){return e.enter(`setextHeadingLineSequence`),s(t)}function s(t){return t===i?(e.consume(t),s):(e.exit(`setextHeadingLineSequence`),Zd(t)?nf(e,c,`lineSuffix`)(t):c(t))}function c(r){return r===null||Z(r)?(e.exit(`setextHeadingLine`),t(r)):n(r)}}var Yp={tokenize:Xp};function Xp(e){let t=this,n=e.attempt(xf,r,e.attempt(this.parser.constructs.flowInitial,i,nf(e,e.attempt(this.parser.constructs.flow,i,e.attempt(qf,i)),`linePrefix`)));return n;function r(r){if(r===null)e.consume(r);else return e.enter(`lineEndingBlank`),e.consume(r),e.exit(`lineEndingBlank`),t.currentConstruct=void 0,n}function i(r){if(r===null)e.consume(r);else return e.enter(`lineEnding`),e.consume(r),e.exit(`lineEnding`),t.currentConstruct=void 0,n}}var Zp={resolveAll:tm()},Qp=em(`string`),$p=em(`text`);function em(e){return{resolveAll:tm(e===`text`?nm:void 0),tokenize:t};function t(t){let n=this,r=this.parser.constructs[e],i=t.attempt(r,a,o);return a;function a(e){return c(e)?i(e):o(e)}function o(e){if(e===null)t.consume(e);else return t.enter(`data`),t.consume(e),s}function s(e){return c(e)?(t.exit(`data`),i(e)):(t.consume(e),s)}function c(e){if(e===null)return!0;let t=r[e],i=-1;if(t)for(;++i<t.length;){let e=t[i];if(!e.previous||e.previous.call(n,n.previous))return!0}return!1}}}function tm(e){return t;function t(t,n){let r=-1,i;for(;++r<=t.length;)i===void 0?t[r]&&t[r][1].type===`data`&&(i=r,r++):(!t[r]||t[r][1].type!==`data`)&&(r!==i+2&&(t[i][1].end=t[r-1][1].end,t.splice(i+2,r-i-2),r=i+2),i=void 0);return e?e(t,n):t}}function nm(e,t){let n=new sf,r=0;for(;++r<=e.length;)if((r===e.length||e[r][1].type===`lineEnding`)&&e[r-1][1].type===`data`){let i=e[r-1][1],a=t.sliceStream(i),o=a.length,s=-1,c=0,l;for(;o--;){let e=a[o];if(typeof e==`string`){for(s=e.length;e.charCodeAt(s-1)===32;)c++,s--;if(s)break;s=-1}else if(e===-2)l=!0,c++;else if(e!==-1){o++;break}}if(t._contentTypeTextTrailing&&r===e.length&&(c=0),c){let a={type:r===e.length||l||c<2?`lineSuffix`:`hardBreakTrailing`,start:{_bufferIndex:o?s:i.start._bufferIndex+s,_index:i.start._index+o,line:i.end.line,column:i.end.column-c,offset:i.end.offset-c},end:{...i.end}};i.end={...a.start},i.start.offset===i.end.offset?Object.assign(i,a):n.add(r,0,[[`enter`,a,t],[`exit`,a,t]])}r++}return n.consume(e),e}var rm=t({attentionMarkers:()=>dm,contentInitial:()=>am,disable:()=>fm,document:()=>im,flow:()=>sm,flowInitial:()=>om,insideSpan:()=>um,string:()=>cm,text:()=>lm}),im={42:Rp,43:Rp,45:Rp,48:Rp,49:Rp,50:Rp,51:Rp,52:Rp,53:Rp,54:Rp,55:Rp,56:Rp,57:Rp,62:Cf},am={91:np},om={[-2]:Ff,[-1]:Ff,32:Ff},sm={35:cp,42:Ip,45:[Kp,Ip],60:pp,61:Kp,95:Ip,96:Nf,126:Nf},cm={38:kf,92:Df},lm={[-5]:Pp,[-4]:Pp,[-3]:Pp,33:Ap,38:kf,42:hf,60:[yf,vp],91:Mp,92:[op,Df],93:bp,95:hf,96:zf},um={null:[hf,Zp]},dm={null:[42,95]},fm={null:[]};function pm(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0},i={},a=[],o=[],s=[],c={attempt:C(x),check:C(S),consume:v,enter:y,exit:b,interrupt:C(S,{interrupt:!0})},l={code:null,containerState:{},defineSkip:h,events:[],now:m,parser:e,previous:null,sliceSerialize:f,sliceStream:p,write:d},u=t.tokenize.call(l,c);return t.resolveAll&&a.push(t),l;function d(e){return o=Id(o,e),g(),o[o.length-1]===null?(w(t,0),l.events=mf(a,l.events,l),l.events):[]}function f(e,t){return hm(p(e),t)}function p(e){return mm(o,e)}function m(){let{_bufferIndex:e,_index:t,line:n,column:i,offset:a}=r;return{_bufferIndex:e,_index:t,line:n,column:i,offset:a}}function h(e){i[e.line]=e.column,E()}function g(){for(;r._index<o.length;){let e=o[r._index];if(typeof e==`string`){let t=r._index;for(r._bufferIndex<0&&(r._bufferIndex=0);r._index===t&&r._bufferIndex<e.length;)_(e.charCodeAt(r._bufferIndex))}else _(e)}}function _(e){u=u(e)}function v(e){Z(e)?(r.line++,r.column=1,r.offset+=e===-3?2:1,E()):e!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===o[r._index].length&&(r._bufferIndex=-1,r._index++)),l.previous=e}function y(e,t){let n=t||{};return n.type=e,n.start=m(),l.events.push([`enter`,n,l]),s.push(n),n}function b(e){let t=s.pop();return t.end=m(),l.events.push([`exit`,t,l]),t}function x(e,t){w(e,t.from)}function S(e,t){t.restore()}function C(e,t){return n;function n(n,r,i){let a,o,s,u;return Array.isArray(n)?f(n):`tokenize`in n?f([n]):d(n);function d(e){return t;function t(t){let n=t!==null&&e[t],r=t!==null&&e.null;return f([...Array.isArray(n)?n:n?[n]:[],...Array.isArray(r)?r:r?[r]:[]])(t)}}function f(e){return a=e,o=0,e.length===0?i:p(e[o])}function p(e){return n;function n(n){return u=T(),s=e,e.partial||(l.currentConstruct=e),e.name&&l.parser.constructs.disable.null.includes(e.name)?h(n):e.tokenize.call(t?Object.assign(Object.create(l),t):l,c,m,h)(n)}}function m(t){return e(s,u),r}function h(e){return u.restore(),++o<a.length?p(a[o]):i}}}function w(e,t){e.resolveAll&&!a.includes(e)&&a.push(e),e.resolve&&Fd(l.events,t,l.events.length-t,e.resolve(l.events.slice(t),l)),e.resolveTo&&(l.events=e.resolveTo(l.events,l))}function T(){let e=m(),t=l.previous,n=l.currentConstruct,i=l.events.length,a=Array.from(s);return{from:i,restore:o};function o(){r=e,l.previous=t,l.currentConstruct=n,l.events.length=i,s=a,E()}}function E(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function mm(e,t){let n=t.start._index,r=t.start._bufferIndex,i=t.end._index,a=t.end._bufferIndex,o;if(n===i)o=[e[n].slice(r,a)];else{if(o=e.slice(n,i),r>-1){let e=o[0];typeof e==`string`?o[0]=e.slice(r):o.shift()}a>0&&o.push(e[i].slice(0,a))}return o}function hm(e,t){let n=-1,r=[],i;for(;++n<e.length;){let a=e[n],o;if(typeof a==`string`)o=a;else switch(a){case-5:o=`\r`;break;case-4:o=`
19
- `;break;case-3:o=`\r
20
- `;break;case-2:o=t?` `:` `;break;case-1:if(!t&&i)continue;o=` `;break;default:o=String.fromCharCode(a)}i=a===-2,r.push(o)}return r.join(``)}function gm(e){let t={constructs:Rd([rm,...(e||{}).extensions||[]]),content:n(af),defined:[],document:n(lf),flow:n(Yp),lazy:{},string:n(Qp),text:n($p)};return t;function n(e){return n;function n(n){return pm(t,e,n)}}}function _m(e){for(;!Gf(e););return e}var vm=/[\0\t\n\r]/g;function ym(){let e=1,t=``,n=!0,r;return i;function i(i,a,o){i=t+(typeof i==`string`?i.toString():new TextDecoder(a||void 0).decode(i));let s=[],c=0;for(t=``,n&&=(i.charCodeAt(0)===65279&&c++,void 0);c<i.length;){vm.lastIndex=c;let n=vm.exec(i),a=n&&n.index!==void 0?n.index:i.length,o=i.charCodeAt(a);if(!n){t=i.slice(c);break}if(o===10&&c===a&&r)s.push(-3),r=void 0;else switch(r&&=(s.push(-5),void 0),c<a&&(s.push(i.slice(c,a)),e+=a-c),o){case 0:s.push(65533),e++;break;case 9:{let t=Math.ceil(e/4)*4;for(s.push(-2);e++<t;)s.push(-1);break}case 10:s.push(-4),e=1;break;default:r=!0,e=1}c=a+1}return o&&(r&&s.push(-5),t&&s.push(t),s.push(null)),s}}var bm=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function xm(e){return e.replace(bm,Sm)}function Sm(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){let e=n.charCodeAt(1),t=e===120||e===88;return Vd(n.slice(t?2:1),t?16:10)}return Pd(n)||e}var Cm={}.hasOwnProperty;function wm(e,t,n){return t&&typeof t==`object`&&(n=t,t=void 0),Tm(n)(_m(gm(n).document().write(ym()(e,t,!0))))}function Tm(e){let t={afterExit:[],beforeEnter:[],transforms:[],canContainEols:[`emphasis`,`fragment`,`heading`,`paragraph`,`strong`],enter:{autolink:o(de),autolinkProtocol:E,autolinkEmail:E,atxHeading:o(ce),blockQuote:o(ie),characterEscape:E,characterReference:E,codeFenced:o(ae),codeFencedFenceInfo:s,codeFencedFenceMeta:s,codeIndented:o(ae,s),codeText:o(U,s),codeTextData:E,data:E,codeFlowValue:E,definition:o(oe),definitionDestinationString:s,definitionLabelString:s,definitionTitleString:s,emphasis:o(se),hardBreakEscape:o(le),hardBreakTrailing:o(le),htmlFlow:o(W,s),htmlFlowData:E,htmlText:o(W,s),htmlTextData:E,image:o(ue),label:s,link:o(de),listItem:o(pe),listItemValue:p,listOrdered:o(fe,f),listUnordered:o(fe),paragraph:o(G),reference:B,referenceString:s,resourceDestinationString:s,resourceTitleString:s,setextHeading:o(ce),strong:o(me),thematicBreak:o(ge)},exit:{atxHeading:l(),atxHeadingSequence:S,autolink:l(),autolinkEmail:re,autolinkProtocol:H,blockQuote:l(),characterEscapeValue:D,characterReferenceMarkerHexadecimal:V,characterReferenceMarkerNumeric:V,characterReferenceValue:te,characterReference:ne,codeFenced:l(_),codeFencedFence:g,codeFencedFenceInfo:m,codeFencedFenceMeta:h,codeFlowValue:D,codeIndented:l(v),codeText:l(M),codeTextData:D,data:D,definition:l(),definitionDestinationString:x,definitionLabelString:y,definitionTitleString:b,emphasis:l(),hardBreakEscape:l(k),hardBreakTrailing:l(k),htmlFlow:l(A),htmlFlowData:D,htmlText:l(j),htmlTextData:D,image:l(P),label:I,labelText:F,lineEnding:O,link:l(N),listItem:l(),listOrdered:l(),listUnordered:l(),paragraph:l(),referenceString:ee,resourceDestinationString:L,resourceTitleString:R,resource:z,setextHeading:l(T),setextHeadingLineSequence:w,setextHeadingText:C,strong:l(),thematicBreak:l()}};Dm(t,(e||{}).mdastExtensions||[]);let n={};return r;function r(e){let r={type:`root`,children:[],position:void 0},o={stack:[r],tokenStack:[],config:t,enter:c,exit:u,buffer:s,resume:d,data:n},l=[],f=[],p=-1;for(;++p<e.length;)f.push(e[p]),(e[p][1].type===`listOrdered`||e[p][1].type===`listUnordered`)&&(e[p][0]===`enter`?l.push(f.length-1):a(f,l.pop()));for(e=f,p=-1;++p<e.length;){let n=t[e[p][0]];e[p][0]===`enter`&&t.beforeEnter.length>0&&i(t.beforeEnter,{...o,sliceSerialize:e[p][2].sliceSerialize},e[p][1]),Cm.call(n,e[p][1].type)&&n[e[p][1].type].call({...o,sliceSerialize:e[p][2].sliceSerialize},e[p][1]),e[p][0]===`exit`&&t.afterExit.length>0&&i(t.afterExit,{...o,sliceSerialize:e[p][2].sliceSerialize},e[p][1])}if(o.tokenStack.length>0){let e=o.tokenStack[o.tokenStack.length-1];(e[1]||km).call(o,void 0,e[0])}for(r.position={start:Em(e.length>0?e[0][1].start:{line:1,column:1,offset:0}),end:Em(e.length>0?e[e.length-2][1].end:{line:1,column:1,offset:0})},p=-1;++p<t.transforms.length;)r=t.transforms[p](r)||r;return r}function i(e,t,n){let r=-1;for(;++r<e.length;)e[r].call(t,n)}function a(e,t){let n=e.length-1,r=t-1,i=-1,a=!1,o,s,c,l,u=[];for(;++r<=n;){let t=e[r];switch(t[1].type){case`listUnordered`:case`listOrdered`:case`blockQuote`:t[0]===`enter`?i++:i--,l=void 0;break;case`lineEndingBlank`:t[0]===`enter`&&(o&&!l&&!i&&!c&&(c=r),l=void 0);break;case`linePrefix`:case`listItemValue`:case`listItemMarker`:case`listItemPrefix`:case`listItemPrefixWhitespace`:break;default:l=void 0}if(!i&&t[0]===`enter`&&t[1].type===`listItemPrefix`||i===-1&&t[0]===`exit`&&(t[1].type===`listUnordered`||t[1].type===`listOrdered`)){if(o){let n=r;for(s=void 0;n--;){let t=e[n];if(t[1].type===`lineEnding`||t[1].type===`lineEndingBlank`){if(t[0]===`exit`)continue;s&&(e[s][1].type=`lineEndingBlank`,a=!0),t[1].type=`lineEnding`,s=n}else if(t[1].type!==`linePrefix`&&t[1].type!==`blockQuotePrefix`&&t[1].type!==`blockQuotePrefixWhitespace`&&t[1].type!==`blockQuoteMarker`&&t[1].type!==`listItemIndent`)break}c&&(!s||c<s)&&(o._spread=!0),o.end=Object.assign({},s?e[s][1].start:t[1].end),u.push({at:s||r,event:[`exit`,o,t[2]]})}if(t[1].type===`listItemPrefix`){let e={type:`listItem`,_spread:!1,start:Object.assign({},t[1].start),end:void 0};o=e,u.push({at:r,event:[`enter`,e,t[2]]}),c=void 0,l=!0}}}let d=e.splice(t),f=0;for(r=-1;++r<d.length;){for(;f<u.length&&u[f].at===t+r;)e.push(u[f++].event);e.push(d[r])}e[t][1]._spread=a}function o(e,t){return n;function n(n){c.call(this,e(n),n),t&&t.call(this,n)}}function s(){this.stack.push({type:`fragment`,children:[]})}function c(e,t,n){this.stack[this.stack.length-1].children.push(e),this.stack.push(e),this.tokenStack.push([t,n||void 0]),e.position={start:Em(t.start),end:void 0}}function l(e){return t;function t(t){e&&e.call(this,t),u.call(this,t)}}function u(e,t){let n=this.stack.pop(),r=this.tokenStack.pop();if(!r)throw Error("Cannot close `"+e.type+"` ("+qu({start:e.start,end:e.end})+`): it’s not open`);r[0].type!==e.type&&(t?t.call(this,e,r[0]):(r[1]||km).call(this,e,r[0])),n.position.end=Em(e.end)}function d(){return kd(this.stack.pop())}function f(){this.data.expectingFirstListItemValue=!0}function p(e){if(this.data.expectingFirstListItemValue){let t=this.stack[this.stack.length-2];t.start=Number.parseInt(this.sliceSerialize(e),10),this.data.expectingFirstListItemValue=void 0}}function m(){let e=this.resume(),t=this.stack[this.stack.length-1];t.lang=e}function h(){let e=this.resume(),t=this.stack[this.stack.length-1];t.meta=e}function g(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function _(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,``),this.data.flowCodeInside=void 0}function v(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e.replace(/(\r?\n|\r)$/g,``)}function y(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=Hd(this.sliceSerialize(e)).toLowerCase()}function b(){let e=this.resume(),t=this.stack[this.stack.length-1];t.title=e}function x(){let e=this.resume(),t=this.stack[this.stack.length-1];t.url=e}function S(e){let t=this.stack[this.stack.length-1];t.depth||=this.sliceSerialize(e).length}function C(){this.data.setextHeadingSlurpLineEnding=!0}function w(e){let t=this.stack[this.stack.length-1];t.depth=this.sliceSerialize(e).codePointAt(0)===61?1:2}function T(){this.data.setextHeadingSlurpLineEnding=void 0}function E(e){let t=this.stack[this.stack.length-1].children,n=t[t.length-1];(!n||n.type!==`text`)&&(n=he(),n.position={start:Em(e.start),end:void 0},t.push(n)),this.stack.push(n)}function D(e){let t=this.stack.pop();t.value+=this.sliceSerialize(e),t.position.end=Em(e.end)}function O(e){let n=this.stack[this.stack.length-1];if(this.data.atHardBreak){let t=n.children[n.children.length-1];t.position.end=Em(e.end),this.data.atHardBreak=void 0}else!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(n.type)&&(E.call(this,e),D.call(this,e))}function k(){this.data.atHardBreak=!0}function A(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function j(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function M(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function N(){let e=this.stack[this.stack.length-1];if(this.data.inReference){let t=this.data.referenceType||`shortcut`;e.type+=`Reference`,e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}function P(){let e=this.stack[this.stack.length-1];if(this.data.inReference){let t=this.data.referenceType||`shortcut`;e.type+=`Reference`,e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}function F(e){let t=this.sliceSerialize(e),n=this.stack[this.stack.length-2];n.label=xm(t),n.identifier=Hd(t).toLowerCase()}function I(){let e=this.stack[this.stack.length-1],t=this.resume(),n=this.stack[this.stack.length-1];this.data.inReference=!0,n.type===`link`?n.children=e.children:n.alt=t}function L(){let e=this.resume(),t=this.stack[this.stack.length-1];t.url=e}function R(){let e=this.resume(),t=this.stack[this.stack.length-1];t.title=e}function z(){this.data.inReference=void 0}function B(){this.data.referenceType=`collapsed`}function ee(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=Hd(this.sliceSerialize(e)).toLowerCase(),this.data.referenceType=`full`}function V(e){this.data.characterReferenceType=e.type}function te(e){let t=this.sliceSerialize(e),n=this.data.characterReferenceType,r;n?(r=Vd(t,n===`characterReferenceMarkerNumeric`?10:16),this.data.characterReferenceType=void 0):r=Pd(t);let i=this.stack[this.stack.length-1];i.value+=r}function ne(e){let t=this.stack.pop();t.position.end=Em(e.end)}function H(e){D.call(this,e);let t=this.stack[this.stack.length-1];t.url=this.sliceSerialize(e)}function re(e){D.call(this,e);let t=this.stack[this.stack.length-1];t.url=`mailto:`+this.sliceSerialize(e)}function ie(){return{type:`blockquote`,children:[],position:void 0}}function ae(){return{type:`code`,lang:null,meta:null,value:``,position:void 0}}function U(){return{type:`inlineCode`,value:``,position:void 0}}function oe(){return{type:`definition`,identifier:``,label:null,title:null,url:``,position:void 0}}function se(){return{type:`emphasis`,children:[],position:void 0}}function ce(){return{type:`heading`,depth:0,children:[],position:void 0}}function le(){return{type:`break`,position:void 0}}function W(){return{type:`html`,value:``,position:void 0}}function ue(){return{type:`image`,title:null,url:``,alt:null,position:void 0}}function de(){return{type:`link`,title:null,url:``,children:[],position:void 0}}function fe(e){return{type:`list`,ordered:e.type===`listOrdered`,start:null,spread:e._spread,children:[],position:void 0}}function pe(e){return{type:`listItem`,spread:e._spread,checked:null,children:[],position:void 0}}function G(){return{type:`paragraph`,children:[],position:void 0}}function me(){return{type:`strong`,children:[],position:void 0}}function he(){return{type:`text`,value:``,position:void 0}}function ge(){return{type:`thematicBreak`,position:void 0}}}function Em(e){return{line:e.line,column:e.column,offset:e.offset}}function Dm(e,t){let n=-1;for(;++n<t.length;){let r=t[n];Array.isArray(r)?Dm(e,r):Om(e,r)}}function Om(e,t){let n;for(n in t)if(Cm.call(t,n))switch(n){case`canContainEols`:{let r=t[n];r&&e[n].push(...r);break}case`transforms`:{let r=t[n];r&&e[n].push(...r);break}case`afterExit`:case`beforeEnter`:{let r=t[n];r&&e[n].push(r);break}case`enter`:case`exit`:{let r=t[n];r&&Object.assign(e[n],r);break}}}function km(e,t){throw Error(e?"Cannot close `"+e.type+"` ("+qu({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+qu({start:t.start,end:t.end})+`) is open`:"Cannot close document, a token (`"+t.type+"`, "+qu({start:t.start,end:t.end})+`) is still open`)}function Am(e){let t=this;t.parser=n;function n(n){return wm(n,{...t.data(`settings`),...e,extensions:t.data(`micromarkExtensions`)||[],mdastExtensions:t.data(`fromMarkdownExtensions`)||[]})}}function jm(e,t){let n={type:`element`,tagName:`blockquote`,properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function Mm(e,t){let n={type:`element`,tagName:`br`,properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:`text`,value:`
21
- `}]}function Nm(e,t){let n=t.value?t.value+`
22
- `:``,r={},i=t.lang?t.lang.split(/\s+/):[];i.length>0&&(r.className=[`language-`+i[0]]);let a={type:`element`,tagName:`code`,properties:r,children:[{type:`text`,value:n}]};return t.meta&&(a.data={meta:t.meta}),e.patch(t,a),a=e.applyData(t,a),a={type:`element`,tagName:`pre`,properties:{},children:[a]},e.patch(t,a),a}function Pm(e,t){let n={type:`element`,tagName:`del`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Fm(e,t){let n={type:`element`,tagName:`em`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Im(e,t){let n=typeof e.options.clobberPrefix==`string`?e.options.clobberPrefix:`user-content-`,r=String(t.identifier).toUpperCase(),i=tf(r.toLowerCase()),a=e.footnoteOrder.indexOf(r),o,s=e.footnoteCounts.get(r);s===void 0?(s=0,e.footnoteOrder.push(r),o=e.footnoteOrder.length):o=a+1,s+=1,e.footnoteCounts.set(r,s);let c={type:`element`,tagName:`a`,properties:{href:`#`+n+`fn-`+i,id:n+`fnref-`+i+(s>1?`-`+s:``),dataFootnoteRef:!0,ariaDescribedBy:[`footnote-label`]},children:[{type:`text`,value:String(o)}]};e.patch(t,c);let l={type:`element`,tagName:`sup`,properties:{},children:[c]};return e.patch(t,l),e.applyData(t,l)}function Lm(e,t){let n={type:`element`,tagName:`h`+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Rm(e,t){if(e.options.allowDangerousHtml){let n={type:`raw`,value:t.value};return e.patch(t,n),e.applyData(t,n)}}function zm(e,t){let n=t.referenceType,r=`]`;if(n===`collapsed`?r+=`[]`:n===`full`&&(r+=`[`+(t.label||t.identifier)+`]`),t.type===`imageReference`)return[{type:`text`,value:`![`+t.alt+r}];let i=e.all(t),a=i[0];a&&a.type===`text`?a.value=`[`+a.value:i.unshift({type:`text`,value:`[`});let o=i[i.length-1];return o&&o.type===`text`?o.value+=r:i.push({type:`text`,value:r}),i}function Bm(e,t){let n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return zm(e,t);let i={src:tf(r.url||``),alt:t.alt};r.title!==null&&r.title!==void 0&&(i.title=r.title);let a={type:`element`,tagName:`img`,properties:i,children:[]};return e.patch(t,a),e.applyData(t,a)}function Vm(e,t){let n={src:tf(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);let r={type:`element`,tagName:`img`,properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)}function Hm(e,t){let n={type:`text`,value:t.value.replace(/\r?\n|\r/g,` `)};e.patch(t,n);let r={type:`element`,tagName:`code`,properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)}function Um(e,t){let n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return zm(e,t);let i={href:tf(r.url||``)};r.title!==null&&r.title!==void 0&&(i.title=r.title);let a={type:`element`,tagName:`a`,properties:i,children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}function Wm(e,t){let n={href:tf(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);let r={type:`element`,tagName:`a`,properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function Gm(e,t,n){let r=e.all(t),i=n?Km(n):qm(t),a={},o=[];if(typeof t.checked==`boolean`){let e=r[0],n;e&&e.type===`element`&&e.tagName===`p`?n=e:(n={type:`element`,tagName:`p`,properties:{},children:[]},r.unshift(n)),n.children.length>0&&n.children.unshift({type:`text`,value:` `}),n.children.unshift({type:`element`,tagName:`input`,properties:{type:`checkbox`,checked:t.checked,disabled:!0},children:[]}),a.className=[`task-list-item`]}let s=-1;for(;++s<r.length;){let e=r[s];(i||s!==0||e.type!==`element`||e.tagName!==`p`)&&o.push({type:`text`,value:`
23
- `}),e.type===`element`&&e.tagName===`p`&&!i?o.push(...e.children):o.push(e)}let c=r[r.length-1];c&&(i||c.type!==`element`||c.tagName!==`p`)&&o.push({type:`text`,value:`
24
- `});let l={type:`element`,tagName:`li`,properties:a,children:o};return e.patch(t,l),e.applyData(t,l)}function Km(e){let t=!1;if(e.type===`list`){t=e.spread||!1;let n=e.children,r=-1;for(;!t&&++r<n.length;)t=qm(n[r])}return t}function qm(e){return e.spread??e.children.length>1}function Jm(e,t){let n={},r=e.all(t),i=-1;for(typeof t.start==`number`&&t.start!==1&&(n.start=t.start);++i<r.length;){let e=r[i];if(e.type===`element`&&e.tagName===`li`&&e.properties&&Array.isArray(e.properties.className)&&e.properties.className.includes(`task-list-item`)){n.className=[`contains-task-list`];break}}let 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 Ym(e,t){let n={type:`element`,tagName:`p`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Xm(e,t){let n={type:`root`,children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function Zm(e,t){let n={type:`element`,tagName:`strong`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Qm(e,t){let n=e.all(t),r=n.shift(),i=[];if(r){let n={type:`element`,tagName:`thead`,properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],n),i.push(n)}if(n.length>0){let r={type:`element`,tagName:`tbody`,properties:{},children:e.wrap(n,!0)},a=Wu(t.children[1]),o=Uu(t.children[t.children.length-1]);a&&o&&(r.position={start:a,end:o}),i.push(r)}let a={type:`element`,tagName:`table`,properties:{},children:e.wrap(i,!0)};return e.patch(t,a),e.applyData(t,a)}function $m(e,t,n){let r=n?n.children:void 0,i=(r?r.indexOf(t):1)===0?`th`:`td`,a=n&&n.type===`table`?n.align:void 0,o=a?a.length:t.children.length,s=-1,c=[];for(;++s<o;){let n=t.children[s],r={},o=a?a[s]:void 0;o&&(r.align=o);let l={type:`element`,tagName:i,properties:r,children:[]};n&&(l.children=e.all(n),e.patch(n,l),l=e.applyData(n,l)),c.push(l)}let l={type:`element`,tagName:`tr`,properties:{},children:e.wrap(c,!0)};return e.patch(t,l),e.applyData(t,l)}function eh(e,t){let n={type:`element`,tagName:`td`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}var th=9,nh=32;function rh(e){let t=String(e),n=/\r?\n|\r/g,r=n.exec(t),i=0,a=[];for(;r;)a.push(ih(t.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return a.push(ih(t.slice(i),i>0,!1)),a.join(``)}function ih(e,t,n){let r=0,i=e.length;if(t){let t=e.codePointAt(r);for(;t===th||t===nh;)r++,t=e.codePointAt(r)}if(n){let t=e.codePointAt(i-1);for(;t===th||t===nh;)i--,t=e.codePointAt(i-1)}return i>r?e.slice(r,i):``}function ah(e,t){let n={type:`text`,value:rh(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function oh(e,t){let n={type:`element`,tagName:`hr`,properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}var sh={blockquote:jm,break:Mm,code:Nm,delete:Pm,emphasis:Fm,footnoteReference:Im,heading:Lm,html:Rm,imageReference:Bm,image:Vm,inlineCode:Hm,linkReference:Um,link:Wm,listItem:Gm,list:Jm,paragraph:Ym,root:Xm,strong:Zm,table:Qm,tableCell:eh,tableRow:$m,text:ah,thematicBreak:oh,toml:ch,yaml:ch,definition:ch,footnoteDefinition:ch};function ch(){}var{defineProperty:lh}=Object,uh=typeof self==`object`?self:globalThis,dh=(e,t)=>{switch(e){case`Function`:case`SharedWorker`:case`Worker`:case`eval`:case`setInterval`:case`setTimeout`:throw TypeError(`unable to deserialize `+e)}return new uh[e](t)},fh=(e,t)=>{let n=(t,n)=>(e.set(n,t),t),r=i=>{if(e.has(i))return e.get(i);let[a,o]=t[i];switch(a){case 0:case-1:return n(o,i);case 1:{let e=n([],i);for(let t of o)e.push(r(t));return e}case 2:{let e=n({},i);for(let[t,n]of o){let i=r(t),a=r(n);i===`__proto__`?lh(e,i,{value:a,configurable:!0,enumerable:!0,writable:!0}):e[i]=a}return e}case 3:return n(new Date(o),i);case 4:{let{source:e,flags:t}=o;return n(new RegExp(e,t),i)}case 5:{let e=n(new Map,i);for(let[t,n]of o)e.set(r(t),r(n));return e}case 6:{let e=n(new Set,i);for(let t of o)e.add(r(t));return e}case 7:{let{name:e,message:t}=o;return n(typeof uh[e]==`function`?dh(e,t):Error(t),i)}case 8:return n(BigInt(o),i);case`BigInt`:return n(Object(BigInt(o)),i);case`ArrayBuffer`:return n(new Uint8Array(o).buffer,o);case`DataView`:{let{buffer:e}=new Uint8Array(o);return n(new DataView(e),o)}case`-0`:return-0}return n(dh(a,o),i)};return r},ph=e=>fh(new Map,e)(0),mh=``,{toString:hh}={},{keys:gh,is:_h}=Object,vh=e=>{let t=typeof e;if(t!==`object`||!e)return[0,t];let n=hh.call(e).slice(8,-1);switch(n){case`Array`:return[1,mh];case`Object`:return[2,mh];case`Date`:return[3,mh];case`RegExp`:return[4,mh];case`Map`:return[5,mh];case`Set`:return[6,mh];case`DataView`:return[1,n]}return n.includes(`Array`)?[1,n]:e instanceof Error?[7,e.name||`Error`]:[2,n]},yh=([e,t])=>e===0&&(t===`function`||t===`symbol`),bh=(e,t,n,r)=>{let i=(e,t)=>{let i=r.push(e)-1;return n.set(t,i),i},a=o=>{if(n.has(o))return n.get(o);let[s,c]=vh(o);switch(s){case 0:{let t=o;switch(c){case`bigint`:s=8,t=o.toString();break;case`number`:if(!o&&_h(o,-0))return r.push([`-0`])-1;break;case`function`:case`symbol`:if(e)throw TypeError(`unable to serialize `+c);t=null;break;case`undefined`:return i([-1],o)}return i([s,t],o)}case 1:{if(c){let e=o;return c===`DataView`?e=new Uint8Array(o.buffer):c===`ArrayBuffer`&&(e=new Uint8Array(o)),i([c,[...e]],o)}let e=[],t=i([s,e],o);for(let t of o)e.push(a(t));return t}case 2:{if(c)switch(c){case`BigInt`:return i([c,o.toString()],o);case`Boolean`:case`Number`:case`String`:return i([c,o.valueOf()],o)}if(t&&`toJSON`in o)return a(o.toJSON());let n=[],r=i([s,n],o);for(let t of gh(o))(e||!yh(vh(o[t])))&&n.push([a(t),a(o[t])]);return r}case 3:return i([s,isNaN(o.getTime())?mh:o.toISOString()],o);case 4:{let{source:e,flags:t}=o;return i([s,{source:e,flags:t}],o)}case 5:{let t=[],n=i([s,t],o);for(let[n,r]of o)(e||!(yh(vh(n))||yh(vh(r))))&&t.push([a(n),a(r)]);return n}case 6:{let t=[],n=i([s,t],o);for(let n of o)(e||!yh(vh(n)))&&t.push(a(n));return n}}let{message:l}=o;return i([s,{name:c,message:l}],o)};return a},xh=(e,{json:t,lossy:n}={})=>{let r=[];return bh(!(t||n),!!t,new Map,r)(e),r},Sh=typeof structuredClone==`function`?(e,t)=>t&&(`json`in t||`lossy`in t)?ph(xh(e,t)):structuredClone(e):(e,t)=>ph(xh(e,t));function Ch(e,t){let n=[{type:`text`,value:`↩`}];return t>1&&n.push({type:`element`,tagName:`sup`,properties:{},children:[{type:`text`,value:String(t)}]}),n}function wh(e,t){return`Back to reference `+(e+1)+(t>1?`-`+t:``)}function Th(e){let t=typeof e.options.clobberPrefix==`string`?e.options.clobberPrefix:`user-content-`,n=e.options.footnoteBackContent||Ch,r=e.options.footnoteBackLabel||wh,i=e.options.footnoteLabel||`Footnotes`,a=e.options.footnoteLabelTagName||`h2`,o=e.options.footnoteLabelProperties||{className:[`sr-only`]},s=[],c=-1;for(;++c<e.footnoteOrder.length;){let i=e.footnoteById.get(e.footnoteOrder[c]);if(!i)continue;let a=e.all(i),o=String(i.identifier).toUpperCase(),l=tf(o.toLowerCase()),u=0,d=[],f=e.footnoteCounts.get(o);for(;f!==void 0&&++u<=f;){d.length>0&&d.push({type:`text`,value:` `});let e=typeof n==`string`?n:n(c,u);typeof e==`string`&&(e={type:`text`,value:e}),d.push({type:`element`,tagName:`a`,properties:{href:`#`+t+`fnref-`+l+(u>1?`-`+u:``),dataFootnoteBackref:``,ariaLabel:typeof r==`string`?r:r(c,u),className:[`data-footnote-backref`]},children:Array.isArray(e)?e:[e]})}let p=a[a.length-1];if(p&&p.type===`element`&&p.tagName===`p`){let e=p.children[p.children.length-1];e&&e.type===`text`?e.value+=` `:p.children.push({type:`text`,value:` `}),p.children.push(...d)}else a.push(...d);let m={type:`element`,tagName:`li`,properties:{id:t+`fn-`+l},children:e.wrap(a,!0)};e.patch(i,m),s.push(m)}if(s.length!==0)return{type:`element`,tagName:`section`,properties:{dataFootnotes:!0,className:[`footnotes`]},children:[{type:`element`,tagName:a,properties:{...Sh(o),id:`footnote-label`},children:[{type:`text`,value:i}]},{type:`text`,value:`
25
- `},{type:`element`,tagName:`ol`,properties:{},children:e.wrap(s,!0)},{type:`text`,value:`
26
- `}]}}var Eh=(function(e){if(e==null)return jh;if(typeof e==`function`)return Ah(e);if(typeof e==`object`)return Array.isArray(e)?Dh(e):Oh(e);if(typeof e==`string`)return kh(e);throw Error(`Expected function, string, or object as test`)});function Dh(e){let t=[],n=-1;for(;++n<e.length;)t[n]=Eh(e[n]);return Ah(r);function r(...e){let n=-1;for(;++n<t.length;)if(t[n].apply(this,e))return!0;return!1}}function Oh(e){let t=e;return Ah(n);function n(n){let r=n,i;for(i in e)if(r[i]!==t[i])return!1;return!0}}function kh(e){return Ah(t);function t(t){return t&&t.type===e}}function Ah(e){return t;function t(t,n,r){return!!(Mh(t)&&e.call(this,t,typeof n==`number`?n:void 0,r||void 0))}}function jh(){return!0}function Mh(e){return typeof e==`object`&&!!e&&`type`in e}function Nh(e){return e}var Ph=[];function Fh(e,t,n,r){let i;typeof t==`function`&&typeof n!=`function`?(r=n,n=t):i=t;let a=Eh(i),o=r?-1:1;s(e,void 0,[])();function s(e,i,c){let l=e&&typeof e==`object`?e:{};if(typeof l.type==`string`){let t=typeof l.tagName==`string`?l.tagName:typeof l.name==`string`?l.name:void 0;Object.defineProperty(u,"name",{value:`node (`+Nh(e.type+(t?`<`+t+`>`:``))+`)`})}return u;function u(){let l=Ph,u,d,f;if((!t||a(e,i,c[c.length-1]||void 0))&&(l=Ih(n(e,c)),l[0]===!1))return l;if(`children`in e&&e.children){let t=e;if(t.children&&l[0]!==`skip`)for(d=(r?t.children.length:-1)+o,f=c.concat(t);d>-1&&d<t.children.length;){let e=t.children[d];if(u=s(e,d,f)(),u[0]===!1)return u;d=typeof u[1]==`number`?u[1]:d+o}}return l}}}function Ih(e){return Array.isArray(e)?e:typeof e==`number`?[!0,e]:e==null?Ph:[e]}function Lh(e,t,n,r){let i,a,o;typeof t==`function`&&typeof n!=`function`?(a=void 0,o=t,i=n):(a=t,o=n,i=r),Fh(e,a,s,i);function s(e,t){let n=t[t.length-1],r=n?n.children.indexOf(e):void 0;return o(e,r,n)}}var Rh={}.hasOwnProperty,zh={};function Bh(e,t){let n=t||zh,r=new Map,i=new Map,a={all:s,applyData:Hh,definitionById:r,footnoteById:i,footnoteCounts:new Map,footnoteOrder:[],handlers:{...sh,...n.handlers},one:o,options:n,patch:Vh,wrap:Wh};return Lh(e,function(e){if(e.type===`definition`||e.type===`footnoteDefinition`){let t=e.type===`definition`?r:i,n=String(e.identifier).toUpperCase();t.has(n)||t.set(n,e)}}),a;function o(e,t){let n=e.type,r=a.handlers[n];if(Rh.call(a.handlers,n)&&r)return r(a,e,t);if(a.options.passThrough&&a.options.passThrough.includes(n)){if(`children`in e){let{children:t,...n}=e,r=Sh(n);return r.children=a.all(e),r}return Sh(e)}return(a.options.unknownHandler||Uh)(a,e,t)}function s(e){let t=[];if(`children`in e){let n=e.children,r=-1;for(;++r<n.length;){let i=a.one(n[r],e);if(i){if(r&&n[r-1].type===`break`&&(!Array.isArray(i)&&i.type===`text`&&(i.value=Gh(i.value)),!Array.isArray(i)&&i.type===`element`)){let e=i.children[0];e&&e.type===`text`&&(e.value=Gh(e.value))}Array.isArray(i)?t.push(...i):t.push(i)}}}return t}}function Vh(e,t){e.position&&(t.position=Ku(e))}function Hh(e,t){let n=t;if(e&&e.data){let t=e.data.hName,r=e.data.hChildren,i=e.data.hProperties;typeof t==`string`&&(n.type===`element`?n.tagName=t:n={type:`element`,tagName:t,properties:{},children:`children`in n?n.children:[n]}),n.type===`element`&&i&&Object.assign(n.properties,Sh(i)),`children`in n&&n.children&&r!=null&&(n.children=r)}return n}function Uh(e,t){let n=t.data||{},r=`value`in t&&!(Rh.call(n,`hProperties`)||Rh.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 Wh(e,t){let n=[],r=-1;for(t&&n.push({type:`text`,value:`
27
- `});++r<e.length;)r&&n.push({type:`text`,value:`
28
- `}),n.push(e[r]);return t&&e.length>0&&n.push({type:`text`,value:`
29
- `}),n}function Gh(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function Kh(e,t){let n=Bh(e,t),r=n.one(e,void 0),i=Th(n),a=Array.isArray(r)?{type:`root`,children:r}:r||{type:`root`,children:[]};return i&&(`children`in a,a.children.push({type:`text`,value:`
30
- `},i)),a}function qh(e,t){return e&&`run`in e?async function(n,r){let i=Kh(n,{file:r,...t});await e.run(i,r)}:function(n,r){return Kh(n,{file:r,...e||t})}}function Jh(e){if(e)throw e}var Yh=e(n(((e,t)=>{var n=Object.prototype.hasOwnProperty,r=Object.prototype.toString,i=Object.defineProperty,a=Object.getOwnPropertyDescriptor,o=function(e){return typeof Array.isArray==`function`?Array.isArray(e):r.call(e)===`[object Array]`},s=function(e){if(!e||r.call(e)!==`[object Object]`)return!1;var t=n.call(e,`constructor`),i=e.constructor&&e.constructor.prototype&&n.call(e.constructor.prototype,`isPrototypeOf`);if(e.constructor&&!t&&!i)return!1;for(var a in e);return a===void 0||n.call(e,a)},c=function(e,t){i&&t.name===`__proto__`?i(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},l=function(e,t){if(t===`__proto__`){if(!n.call(e,t))return;if(a)return a(e,t).value}return e[t]};t.exports=function e(){var t,n,r,i,a,u,d=arguments[0],f=1,p=arguments.length,m=!1;for(typeof d==`boolean`&&(m=d,d=arguments[1]||{},f=2),(d==null||typeof d!=`object`&&typeof d!=`function`)&&(d={});f<p;++f)if(t=arguments[f],t!=null)for(n in t)r=l(d,n),i=l(t,n),d!==i&&(m&&i&&(s(i)||(a=o(i)))?(a?(a=!1,u=r&&o(r)?r:[]):u=r&&s(r)?r:{},c(d,{name:n,newValue:e(m,u,i)})):i!==void 0&&c(d,{name:n,newValue:i}));return d}}))(),1);function Xh(e){if(typeof e!=`object`||!e)return!1;let t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function Zh(){let e=[],t={run:n,use:r};return t;function n(...t){let n=-1,r=t.pop();if(typeof r!=`function`)throw TypeError(`Expected function as last argument, not `+r);i(null,...t);function i(a,...o){let s=e[++n],c=-1;if(a)r(a);else{for(;++c<t.length;)(o[c]===null||o[c]===void 0)&&(o[c]=t[c]);t=o,s?Qh(s,i)(...o):r(null,...o)}}}function r(n){if(typeof n!=`function`)throw TypeError("Expected `middelware` to be a function, not "+n);return e.push(n),t}}function Qh(e,t){let n;return r;function r(...t){let r=e.length>t.length,o;r&&t.push(i);try{o=e.apply(this,t)}catch(e){let t=e;if(r&&n)throw t;return i(t)}r||(o&&o.then&&typeof o.then==`function`?o.then(a,i):o instanceof Error?i(o):a(o))}function i(e,...r){n||(n=!0,t(e,...r))}function a(e){i(null,e)}}var $h={basename:eg,dirname:tg,extname:ng,join:rg,sep:`/`};function eg(e,t){if(t!==void 0&&typeof t!=`string`)throw TypeError(`"ext" argument must be a string`);og(e);let n=0,r=-1,i=e.length,a;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(a){n=i+1;break}}else r<0&&(a=!0,r=i+1);return r<0?``:e.slice(n,r)}if(t===e)return``;let o=-1,s=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(a){n=i+1;break}}else o<0&&(a=!0,o=i+1),s>-1&&(e.codePointAt(i)===t.codePointAt(s--)?s<0&&(r=i):(s=-1,r=o));return n===r?r=o:r<0&&(r=e.length),e.slice(n,r)}function tg(e){if(og(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||=!0;return t<0?e.codePointAt(0)===47?`/`:`.`:t===1&&e.codePointAt(0)===47?`//`:e.slice(0,t)}function ng(e){og(e);let t=e.length,n=-1,r=0,i=-1,a=0,o;for(;t--;){let s=e.codePointAt(t);if(s===47){if(o){r=t+1;break}}else n<0&&(o=!0,n=t+1),s===46?i<0?i=t:a!==1&&(a=1):i>-1&&(a=-1)}return i<0||n<0||a===0||a===1&&i===n-1&&i===r+1?``:e.slice(i,n)}function rg(...e){let t=-1,n;for(;++t<e.length;)og(e[t]),e[t]&&(n=n===void 0?e[t]:n+`/`+e[t]);return n===void 0?`.`:ig(n)}function ig(e){og(e);let t=e.codePointAt(0)===47,n=ag(e,!t);return n.length===0&&!t&&(n=`.`),n.length>0&&e.codePointAt(e.length-1)===47&&(n+=`/`),t?`/`+n:n}function ag(e,t){let n=``,r=0,i=-1,a=0,o=-1,s,c;for(;++o<=e.length;){if(o<e.length)s=e.codePointAt(o);else if(s===47)break;else s=47;if(s===47){if(i!==o-1&&a!==1){if(i!==o-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(c=n.lastIndexOf(`/`),c!==n.length-1){c<0?(n=``,r=0):(n=n.slice(0,c),r=n.length-1-n.lastIndexOf(`/`)),i=o,a=0;continue}}else if(n.length>0){n=``,r=0,i=o,a=0;continue}}t&&(n=n.length>0?n+`/..`:`..`,r=2)}else n.length>0?n+=`/`+e.slice(i+1,o):n=e.slice(i+1,o),r=o-i-1}i=o,a=0}else s===46&&a>-1?a++:a=-1}return n}function og(e){if(typeof e!=`string`)throw TypeError(`Path must be a string. Received `+JSON.stringify(e))}var sg={cwd:cg};function cg(){return`/`}function lg(e){return!!(typeof e==`object`&&e&&`href`in e&&e.href&&`protocol`in e&&e.protocol&&e.auth===void 0)}function ug(e){if(typeof e==`string`)e=new URL(e);else if(!lg(e)){let t=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:`){let e=TypeError(`The URL must be of scheme file`);throw e.code=`ERR_INVALID_URL_SCHEME`,e}return dg(e)}function dg(e){if(e.hostname!==``){let e=TypeError(`File URL host must be "localhost" or empty on darwin`);throw e.code=`ERR_INVALID_FILE_URL_HOST`,e}let t=e.pathname,n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){let e=t.codePointAt(n+2);if(e===70||e===102){let e=TypeError(`File URL path must not include encoded / characters`);throw e.code=`ERR_INVALID_FILE_URL_PATH`,e}}return decodeURIComponent(t)}var fg=[`history`,`path`,`basename`,`stem`,`extname`,`dirname`],pg=class{constructor(e){let t;t=e?lg(e)?{path:e}:typeof e==`string`||_g(e)?{value:e}:e:{},this.cwd=`cwd`in t?``:sg.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let n=-1;for(;++n<fg.length;){let e=fg[n];e in t&&t[e]!==void 0&&t[e]!==null&&(this[e]=e===`history`?[...t[e]]:t[e])}let r;for(r in t)fg.includes(r)||(this[r]=t[r])}get basename(){return typeof this.path==`string`?$h.basename(this.path):void 0}set basename(e){hg(e,`basename`),mg(e,`basename`),this.path=$h.join(this.dirname||``,e)}get dirname(){return typeof this.path==`string`?$h.dirname(this.path):void 0}set dirname(e){gg(this.basename,`dirname`),this.path=$h.join(e||``,this.basename)}get extname(){return typeof this.path==`string`?$h.extname(this.path):void 0}set extname(e){if(mg(e,`extname`),gg(this.dirname,`extname`),e){if(e.codePointAt(0)!==46)throw Error("`extname` must start with `.`");if(e.includes(`.`,1))throw Error("`extname` cannot contain multiple dots")}this.path=$h.join(this.dirname,this.stem+(e||``))}get path(){return this.history[this.history.length-1]}set path(e){lg(e)&&(e=ug(e)),hg(e,`path`),this.path!==e&&this.history.push(e)}get stem(){return typeof this.path==`string`?$h.basename(this.path,this.extname):void 0}set stem(e){hg(e,`stem`),mg(e,`stem`),this.path=$h.join(this.dirname||``,e+(this.extname||``))}fail(e,t,n){let r=this.message(e,t,n);throw r.fatal=!0,r}info(e,t,n){let r=this.message(e,t,n);return r.fatal=void 0,r}message(e,t,n){let r=new Zu(e,t,n);return this.path&&(r.name=this.path+`:`+r.name,r.file=this.path),r.fatal=!1,this.messages.push(r),r}toString(e){return this.value===void 0?``:typeof this.value==`string`?this.value:new TextDecoder(e||void 0).decode(this.value)}};function mg(e,t){if(e&&e.includes($h.sep))throw Error("`"+t+"` cannot be a path: did not expect `"+$h.sep+"`")}function hg(e,t){if(!e)throw Error("`"+t+"` cannot be empty")}function gg(e,t){if(!e)throw Error("Setting `"+t+"` requires `path` to be set too")}function _g(e){return!!(e&&typeof e==`object`&&`byteLength`in e&&`byteOffset`in e)}var vg=(function(e){let t=this.constructor.prototype,n=t[e],r=function(){return n.apply(r,arguments)};return Object.setPrototypeOf(r,t),r}),yg={}.hasOwnProperty,bg=new class e extends vg{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=Zh()}copy(){let t=new e,n=-1;for(;++n<this.attachers.length;){let e=this.attachers[n];t.use(...e)}return t.data((0,Yh.default)(!0,{},this.namespace)),t}data(e,t){return typeof e==`string`?arguments.length===2?(Cg(`data`,this.frozen),this.namespace[e]=t,this):yg.call(this.namespace,e)&&this.namespace[e]||void 0:e?(Cg(`data`,this.frozen),this.namespace=e,this):this.namespace}freeze(){if(this.frozen)return this;let e=this;for(;++this.freezeIndex<this.attachers.length;){let[t,...n]=this.attachers[this.freezeIndex];if(n[0]===!1)continue;n[0]===!0&&(n[0]=void 0);let r=t.call(e,...n);typeof r==`function`&&this.transformers.use(r)}return this.frozen=!0,this.freezeIndex=1/0,this}parse(e){this.freeze();let t=Eg(e),n=this.parser||this.Parser;return xg(`parse`,n),n(String(t),t)}process(e,t){let n=this;return this.freeze(),xg(`process`,this.parser||this.Parser),Sg(`process`,this.compiler||this.Compiler),t?r(void 0,t):new Promise(r);function r(r,i){let a=Eg(e),o=n.parse(a);n.run(o,a,function(e,t,r){if(e||!t||!r)return s(e);let i=t,a=n.stringify(i,r);Og(a)?r.value=a:r.result=a,s(e,r)});function s(e,n){e||!n?i(e):r?r(n):t(void 0,n)}}}processSync(e){let t=!1,n;return this.freeze(),xg(`processSync`,this.parser||this.Parser),Sg(`processSync`,this.compiler||this.Compiler),this.process(e,r),Tg(`processSync`,`process`,t),n;function r(e,r){t=!0,Jh(e),n=r}}run(e,t,n){wg(e),this.freeze();let r=this.transformers;return!n&&typeof t==`function`&&(n=t,t=void 0),n?i(void 0,n):new Promise(i);function i(i,a){let o=Eg(t);r.run(e,o,s);function s(t,r,o){let s=r||e;t?a(t):i?i(s):n(void 0,s,o)}}}runSync(e,t){let n=!1,r;return this.run(e,t,i),Tg(`runSync`,`run`,n),r;function i(e,t){Jh(e),r=t,n=!0}}stringify(e,t){this.freeze();let n=Eg(t),r=this.compiler||this.Compiler;return Sg(`stringify`,r),wg(e),r(e,n)}use(e,...t){let n=this.attachers,r=this.namespace;if(Cg(`use`,this.frozen),e!=null){if(typeof e==`function`)s(e,t);else if(typeof e==`object`)Array.isArray(e)?o(e):a(e);else throw TypeError("Expected usable value, not `"+e+"`")}return this;function i(e){if(typeof e==`function`)s(e,[]);else if(typeof e==`object`){if(Array.isArray(e)){let[t,...n]=e;s(t,n)}else a(e)}else throw TypeError("Expected usable value, not `"+e+"`")}function a(e){if(!(`plugins`in e)&&!(`settings`in e))throw 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");o(e.plugins),e.settings&&(r.settings=(0,Yh.default)(!0,r.settings,e.settings))}function o(e){let t=-1;if(e!=null){if(Array.isArray(e))for(;++t<e.length;){let n=e[t];i(n)}else throw TypeError("Expected a list of plugins, not `"+e+"`")}}function s(e,t){let r=-1,i=-1;for(;++r<n.length;)if(n[r][0]===e){i=r;break}if(i===-1)n.push([e,...t]);else if(t.length>0){let[r,...a]=t,o=n[i][1];Xh(o)&&Xh(r)&&(r=(0,Yh.default)(!0,o,r)),n[i]=[e,r,...a]}}}}().freeze();function xg(e,t){if(typeof t!=`function`)throw TypeError("Cannot `"+e+"` without `parser`")}function Sg(e,t){if(typeof t!=`function`)throw TypeError("Cannot `"+e+"` without `compiler`")}function Cg(e,t){if(t)throw Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function wg(e){if(!Xh(e)||typeof e.type!=`string`)throw TypeError("Expected node, got `"+e+"`")}function Tg(e,t,n){if(!n)throw Error("`"+e+"` finished async. Use `"+t+"` instead")}function Eg(e){return Dg(e)?e:new pg(e)}function Dg(e){return!!(e&&typeof e==`object`&&`message`in e&&`messages`in e)}function Og(e){return typeof e==`string`||kg(e)}function kg(e){return!!(e&&typeof e==`object`&&`byteLength`in e&&`byteOffset`in e)}var Ag=[],jg={allowDangerousHtml:!0},Mg=/^(https?|ircs?|mailto|xmpp)$/i,Ng=[{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 Pg(e){let t=Fg(e),n=Ig(e);return Lg(t.runSync(t.parse(n),n),e)}function Fg(e){let t=e.rehypePlugins||Ag,n=e.remarkPlugins||Ag,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...jg}:jg;return bg().use(Am).use(n).use(qh,r).use(t)}function Ig(e){let t=e.children||``,n=new pg;return typeof t==`string`?n.value=t:``+t,n}function Lg(e,t){let n=t.allowedElements,r=t.allowElement,i=t.components,a=t.disallowedElements,o=t.skipHtml,s=t.unwrapDisallowed,c=t.urlTransform||Rg;for(let e of Ng)Object.hasOwn(t,e.from)&&``+e.from+(e.to?"use `"+e.to+"` instead":`remove it`)+e.id;return Lh(e,l),ad(e,{Fragment:W.Fragment,components:i,ignoreInvalidStyle:!0,jsx:W.jsx,jsxs:W.jsxs,passKeys:!0,passNode:!0});function l(e,t,i){if(e.type===`raw`&&i&&typeof t==`number`)return o?i.children.splice(t,1):i.children[t]={type:`text`,value:e.value},t;if(e.type===`element`){let t;for(t in Dd)if(Object.hasOwn(Dd,t)&&Object.hasOwn(e.properties,t)){let n=e.properties[t],r=Dd[t];(r===null||r.includes(e.tagName))&&(e.properties[t]=c(String(n||``),t,e))}}if(e.type===`element`){let o=n?!n.includes(e.tagName):a?a.includes(e.tagName):!1;if(!o&&r&&typeof t==`number`&&(o=!r(e,t,i)),o&&i&&typeof t==`number`)return s&&e.children?i.children.splice(t,1,...e.children):i.children.splice(t,1),t}}}function Rg(e){let t=e.indexOf(`:`),n=e.indexOf(`?`),r=e.indexOf(`#`),i=e.indexOf(`/`);return t===-1||i!==-1&&t>i||n!==-1&&t>n||r!==-1&&t>r||Mg.test(e.slice(0,t))?e:``}function zg(e,t){let n=String(e);if(typeof t!=`string`)throw TypeError(`Expected character`);let r=0,i=n.indexOf(t);for(;i!==-1;)r++,i=n.indexOf(t,i+t.length);return r}function Bg(e){if(typeof e!=`string`)throw TypeError(`Expected a string`);return e.replace(/[|\\{}()[\]^$+*?.]/g,`\\$&`).replace(/-/g,`\\x2d`)}function Vg(e,t,n){let r=Eh((n||{}).ignore||[]),i=Hg(t),a=-1;for(;++a<i.length;)Fh(e,`text`,o);function o(e,t){let n=-1,i;for(;++n<t.length;){let e=t[n],a=i?i.children:void 0;if(r(e,a?a.indexOf(e):void 0,i))return;i=e}if(i)return s(e,t)}function s(e,t){let n=t[t.length-1],r=i[a][0],o=i[a][1],s=0,c=n.children.indexOf(e),l=!1,u=[];r.lastIndex=0;let d=r.exec(e.value);for(;d;){let n=d.index,i={index:d.index,input:d.input,stack:[...t,e]},a=o(...d,i);if(typeof a==`string`&&(a=a.length>0?{type:`text`,value:a}:void 0),a===!1)r.lastIndex=n+1;else{if(s!==n&&f({type:`text`,value:e.value.slice(s,n)}),Array.isArray(a))for(let e of a)f(e);else a&&f(a);s=n+d[0].length,l=!0}if(!r.global)break;d=r.exec(e.value)}return l?(s<e.value.length&&f({type:`text`,value:e.value.slice(s)}),n.children.splice(c,1,...u)):u=[e],c+u.length;function f(e){let t=u[u.length-1];t&&t.type===`text`&&e.type===`text`?t.value+=e.value:u.push(e)}}}function Hg(e){if(!Array.isArray(e))throw TypeError(`Expected find and replace tuple or list of tuples`);let t=[],n=!e[0]||Array.isArray(e[0])?e:[e],r=-1;for(;++r<n.length;){let e=n[r];t.push([Ug(e[0]),Wg(e[1])])}return t}function Ug(e){return typeof e==`string`?new RegExp(Bg(e),`g`):e}function Wg(e){return typeof e==`function`?e:function(){return e}}var Gg=`phrasing`,Kg=[`autolink`,`link`,`image`,`label`];function qg(){return{transforms:[t_],enter:{literalAutolink:Yg,literalAutolinkEmail:Xg,literalAutolinkHttp:Xg,literalAutolinkWww:Xg},exit:{literalAutolink:e_,literalAutolinkEmail:$g,literalAutolinkHttp:Zg,literalAutolinkWww:Qg}}}function Jg(){return{unsafe:[{character:`@`,before:`[+\\-.\\w]`,after:`[\\-.\\w]`,inConstruct:Gg,notInConstruct:Kg},{character:`.`,before:`[Ww]`,after:`[\\-.\\w]`,inConstruct:Gg,notInConstruct:Kg},{character:`:`,before:`[ps]`,after:`\\/`,inConstruct:Gg,notInConstruct:Kg}]}}function Yg(e){this.enter({type:`link`,title:null,url:``,children:[]},e)}function Xg(e){this.config.enter.autolinkProtocol.call(this,e)}function Zg(e){this.config.exit.autolinkProtocol.call(this,e)}function Qg(e){this.config.exit.data.call(this,e);let t=this.stack[this.stack.length-1];t.type,t.url=`http://`+this.sliceSerialize(e)}function $g(e){this.config.exit.autolinkEmail.call(this,e)}function e_(e){this.exit(e)}function t_(e){Vg(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,n_],[/(?<=^|\s|\p{P}|\p{S})([-.\w+]+)@([-\w]+(?:\.[-\w]+)+)/gu,r_]],{ignore:[`link`,`linkReference`]})}function n_(e,t,n,r,i){let a=``;if(!o_(i)||(/^w/i.test(t)&&(n=t+n,t=``,a=`http://`),!i_(n)))return!1;let o=a_(n+r);if(!o[0])return!1;let s={type:`link`,title:null,url:a+t+o[0],children:[{type:`text`,value:t+o[0]}]};return o[1]?[s,{type:`text`,value:o[1]}]:s}function r_(e,t,n,r){return!o_(r,!0)||/[-\d_]$/.test(n)?!1:{type:`link`,title:null,url:`mailto:`+t+`@`+n,children:[{type:`text`,value:t+`@`+n}]}}function i_(e){let 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 a_(e){let t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(`)`),i=zg(e,`(`),a=zg(e,`)`);for(;r!==-1&&i>a;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(`)`),a++;return[e,n]}function o_(e,t){let n=e.input.charCodeAt(e.index-1);return(e.index===0||$d(n)||Qd(n))&&(!t||n!==47)}g_.peek=h_;function s_(){this.buffer()}function c_(e){this.enter({type:`footnoteReference`,identifier:``,label:``},e)}function l_(){this.buffer()}function u_(e){this.enter({type:`footnoteDefinition`,identifier:``,label:``,children:[]},e)}function d_(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Hd(this.sliceSerialize(e)).toLowerCase(),n.label=t}function f_(e){this.exit(e)}function p_(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Hd(this.sliceSerialize(e)).toLowerCase(),n.label=t}function m_(e){this.exit(e)}function h_(){return`[`}function g_(e,t,n,r){let i=n.createTracker(r),a=i.move(`[^`),o=n.enter(`footnoteReference`),s=n.enter(`reference`);return a+=i.move(n.safe(n.associationId(e),{after:`]`,before:a})),s(),o(),a+=i.move(`]`),a}function __(){return{enter:{gfmFootnoteCallString:s_,gfmFootnoteCall:c_,gfmFootnoteDefinitionLabelString:l_,gfmFootnoteDefinition:u_},exit:{gfmFootnoteCallString:d_,gfmFootnoteCall:f_,gfmFootnoteDefinitionLabelString:p_,gfmFootnoteDefinition:m_}}}function v_(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:g_},unsafe:[{character:`[`,inConstruct:[`label`,`phrasing`,`reference`]}]};function n(e,n,r,i){let a=r.createTracker(i),o=a.move(`[^`),s=r.enter(`footnoteDefinition`),c=r.enter(`label`);return o+=a.move(r.safe(r.associationId(e),{before:o,after:`]`})),c(),o+=a.move(`]:`),e.children&&e.children.length>0&&(a.shift(4),o+=a.move((t?`
31
- `:` `)+r.indentLines(r.containerFlow(e,a.current()),t?b_:y_))),s(),o}}function y_(e,t,n){return t===0?e:b_(e,t,n)}function b_(e,t,n){return(n?``:` `)+e}var x_=[`autolink`,`destinationLiteral`,`destinationRaw`,`reference`,`titleQuote`,`titleApostrophe`];E_.attention=D_,E_.peek=O_;function S_(){return{canContainEols:[`delete`],enter:{strikethrough:w_},exit:{strikethrough:T_}}}function C_(){return{handlers:{delete:E_},unsafe:[{character:`~`,inConstruct:`phrasing`,notInConstruct:x_}]}}function w_(e){this.enter({type:`delete`,children:[],position:void 0},e)}function T_(e){this.exit(e)}function E_(e,t,n,r){let i=n.createTracker(r),a=n.stack.includes(`strikethrough`)?`~`:`~~`,o=n.enter(`strikethrough`),s=i.move(a);return s+=n.containerPhrasing(e,{...i.current(),before:s,after:`~`}),s+=i.move(a),o(),s}function D_(){return{construct:`strikethrough`,markers:[`~`],sizes:[2,1]}}function O_(){return`~`}function k_(e){return e.length}function A_(e,t){let n=t||{},r=(n.align||[]).concat(),i=n.stringLength||k_,a=[],o=[],s=[],c=[],l=0,u=-1;for(;++u<e.length;){let t=[],r=[],a=-1;for(e[u].length>l&&(l=e[u].length);++a<e[u].length;){let o=j_(e[u][a]);if(n.alignDelimiters!==!1){let e=i(o);r[a]=e,(c[a]===void 0||e>c[a])&&(c[a]=e)}t.push(o)}o[u]=t,s[u]=r}let d=-1;if(typeof r==`object`&&`length`in r)for(;++d<l;)a[d]=M_(r[d]);else{let e=M_(r);for(;++d<l;)a[d]=e}d=-1;let f=[],p=[];for(;++d<l;){let e=a[d],t=``,r=``;e===99?(t=`:`,r=`:`):e===108?t=`:`:e===114&&(r=`:`);let i=n.alignDelimiters===!1?1:Math.max(1,c[d]-t.length-r.length),o=t+`-`.repeat(i)+r;n.alignDelimiters!==!1&&(i=t.length+i+r.length,i>c[d]&&(c[d]=i),p[d]=i),f[d]=o}o.splice(1,0,f),s.splice(1,0,p),u=-1;let m=[];for(;++u<o.length;){let e=o[u],t=s[u];d=-1;let r=[];for(;++d<l;){let i=e[d]||``,o=``,s=``;if(n.alignDelimiters!==!1){let e=c[d]-(t[d]||0),n=a[d];n===114?o=` `.repeat(e):n===99?e%2?(o=` `.repeat(e/2+.5),s=` `.repeat(e/2-.5)):(o=` `.repeat(e/2),s=o):s=` `.repeat(e)}n.delimiterStart!==!1&&!d&&r.push(`|`),n.padding!==!1&&(n.alignDelimiters!==!1||i!==``)&&(n.delimiterStart!==!1||d)&&r.push(` `),n.alignDelimiters!==!1&&r.push(o),r.push(i),n.alignDelimiters!==!1&&r.push(s),n.padding!==!1&&r.push(` `),(n.delimiterEnd!==!1||d!==l-1)&&r.push(`|`)}m.push(n.delimiterEnd===!1?r.join(``).replace(/ +$/,``):r.join(``))}return m.join(`
32
- `)}function j_(e){return e==null?``:String(e)}function M_(e){let 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}var N_=Eh([`break`,`delete`,`emphasis`,`footnote`,`footnoteReference`,`image`,`imageReference`,`inlineCode`,`inlineMath`,`link`,`linkReference`,`mdxJsxTextElement`,`mdxTextExpression`,`strong`,`text`,`textDirective`]);function P_(e,t,n,r){let i=n.enter(`blockquote`),a=n.createTracker(r);a.move(`> `),a.shift(2);let o=n.indentLines(n.containerFlow(e,a.current()),F_);return i(),o}function F_(e,t,n){return`>`+(n?``:` `)+e}function I_(e,t){return L_(e,t.inConstruct,!0)&&!L_(e,t.notInConstruct,!1)}function L_(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 R_(e,t,n,r){let i=-1;for(;++i<n.unsafe.length;){let e=n.unsafe[i];if(e.character===`
33
- `&&!e.before&&!e.after&&I_(n.stack,e))return/[\t ]/.test(r.before)?``:` `}return`\\
34
- `}function z_(e,t){let n=String(e),r=n.indexOf(t),i=r,a=0,o=0;if(typeof t!=`string`)throw TypeError(`Expected substring`);for(;r!==-1;)r===i?++a>o&&(o=a):a=1,i=r+t.length,r=n.indexOf(t,i);return o}function B_(e,t){return!(t.options.fences!==!1||!e.value||e.lang||!/[^\n\r ]/.test(e.value)||/^[\t ]*(?:[\n\r]|$)|(?:^|[\n\r])[\t ]*$/.test(e.value))}function V_(e){let t=e.options.fence||"`";if(t!=="`"&&t!==`~`)throw Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}function H_(e,t,n,r){let i=V_(n),a=e.value||``;if(B_(e,n)){let e=n.enter(`codeIndented`),t=n.indentLines(a,U_);return e(),t}let o=n.createTracker(r),s=i.repeat(Math.max(z_(a,i)+1,3)),c=n.enter(`codeFenced`),l=i==="`"?`GraveAccent`:`Tilde`,u=o.move(s);if(e.lang){let t=n.enter(`codeFencedLang${l}`);u+=o.move(n.safe(e.lang,{before:u,after:` `,encode:["`"],...o.current()})),t()}if(e.lang&&e.meta){let t=n.enter(`codeFencedMeta${l}`);u+=o.move(` `),u+=o.move(n.safe(e.meta,{before:u,after:`
35
- `,encode:["`"],...o.current()})),t()}return u+=o.move(`
36
- `),a&&(u+=o.move(a+`
37
- `)),u+=o.move(s),c(),u}function U_(e,t,n){return(n?``:` `)+e}function W_(e){let t=e.options.quote||`"`;if(t!==`"`&&t!==`'`)throw Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function G_(e,t,n,r){let i=W_(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.enter(`definition`),s=n.enter(`label`),c=n.createTracker(r),l=c.move(`[`);return l+=c.move(n.safe(n.associationId(e),{before:l,after:`]`,...c.current()})),l+=c.move(`]: `),s(),!e.url||/[\0- \u007F]/.test(e.url)?(s=n.enter(`destinationLiteral`),l+=c.move(`<`),l+=c.move(n.safe(e.url,{before:l,after:`>`,...c.current()})),l+=c.move(`>`)):(s=n.enter(`destinationRaw`),l+=c.move(n.safe(e.url,{before:l,after:e.title?` `:`
38
- `,...c.current()}))),s(),e.title&&(s=n.enter(`title${a}`),l+=c.move(` `+i),l+=c.move(n.safe(e.title,{before:l,after:i,...c.current()})),l+=c.move(i),s()),o(),l}function K_(e){let t=e.options.emphasis||`*`;if(t!==`*`&&t!==`_`)throw Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}q_.attention=J_,q_.peek=Y_;function q_(e,t,n,r){let i=n.enter(`phrasing`),a=n.containerPhrasing({type:`root`,children:[e]},r);return i(),a}function J_(e,t){return{construct:`emphasis`,markers:K_(t)===`*`?[`*`,`_`]:[`_`,`*`],sizes:[1]}}function Y_(e,t,n){return n.options.emphasis||`*`}function X_(e){return`&#x`+e.toString(16).toUpperCase()+`;`}function Z_(e,t){let n=!1;return Lh(e,function(e){if(`value`in e&&/\r?\n|\r/.test(e.value)||e.type===`break`)return n=!0,!1}),!!((!e.depth||e.depth<3)&&kd(e)&&(t.options.setext||n))}function Q_(e,t,n,r){let i=Math.max(Math.min(6,e.depth||1),1),a=n.createTracker(r);if(Z_(e,n)){let t=n.enter(`headingSetext`),r=n.enter(`phrasing`),o=n.containerPhrasing(e,{...a.current(),before:`
39
- `,after:`
40
- `});return r(),t(),o+`
41
- `+(i===1?`=`:`-`).repeat(o.length-(Math.max(o.lastIndexOf(`\r`),o.lastIndexOf(`
42
- `))+1))}let o=`#`.repeat(i),s=n.enter(`headingAtx`),c=n.enter(`phrasing`);a.move(o+` `);let l=n.containerPhrasing(e,{before:`# `,after:`
43
- `,...a.current()}),u=l.charCodeAt(0);return(u===9||u===32)&&(l=X_(u)+l.slice(1)),l=l?o+` `+l:o,n.options.closeAtx&&(l+=` `+o),c(),s(),l}$_.peek=ev;function $_(e){return e.value||``}function ev(){return`<`}tv.peek=nv;function tv(e,t,n,r){let i=W_(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.enter(`image`),s=n.enter(`label`),c=n.createTracker(r),l=c.move(`![`);return l+=c.move(n.safe(e.alt,{before:l,after:`]`,...c.current()})),l+=c.move(`](`),s(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(s=n.enter(`destinationLiteral`),l+=c.move(`<`),l+=c.move(n.safe(e.url,{before:l,after:`>`,...c.current()})),l+=c.move(`>`)):(s=n.enter(`destinationRaw`),l+=c.move(n.safe(e.url,{before:l,after:e.title?` `:`)`,...c.current()}))),s(),e.title&&(s=n.enter(`title${a}`),l+=c.move(` `+i),l+=c.move(n.safe(e.title,{before:l,after:i,...c.current()})),l+=c.move(i),s()),l+=c.move(`)`),o(),l}function nv(){return`!`}rv.peek=iv;function rv(e,t,n,r){let i=e.referenceType,a=n.enter(`imageReference`),o=n.enter(`label`),s=n.createTracker(r),c=s.move(`![`),l=n.safe(e.alt,{before:c,after:`]`,...s.current()});c+=s.move(l+`][`),o();let u=n.stack;n.stack=u.filter(function(e){return e!==`phrasing`}),o=n.enter(`reference`);let d=n.safe(n.associationId(e),{before:c,after:`]`,...s.current()});return o(),n.stack=u,a(),i===`full`||!l||l!==d?c+=s.move(d+`]`):i===`shortcut`?c=c.slice(0,-1):c+=s.move(`]`),c}function iv(){return`!`}av.peek=ov;function av(e,t,n){let r=e.value||``,i="`",a=-1;for(;RegExp("(^|[^`])"+i+"([^`]|$)").test(r);)i+="`";for(/[^\n\r ]/.test(r)&&(/^[\n\r ]/.test(r)&&/[\n\r ]$/.test(r)||/^`|`$/.test(r))&&(r=` `+r+` `);++a<n.unsafe.length;){let e=n.unsafe[a],t=n.compilePattern(e);if(!e.atBreak)continue;let i;for(;i=t.exec(r);){let e=i.index;r.charCodeAt(e)===10&&r.charCodeAt(e-1)===13&&e--,r=r.slice(0,e)+` `+r.slice(i.index+1)}}return i+r+i}function ov(){return"`"}function sv(e,t){let n=kd(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))}cv.peek=lv;function cv(e,t,n,r){let i=W_(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.createTracker(r);if(sv(e,n)){let t=n.stack;n.stack=t.filter(function(e){return e!==`phrasing`});let r=n.enter(`autolink`),i=o.move(`<`);return i+=o.move(n.containerPhrasing(e,{before:i,after:`>`,...o.current()})),i+=o.move(`>`),r(),n.stack=t,i}let s=n.enter(`link`),c=n.enter(`label`),l=o.move(`[`);return l+=o.move(n.containerPhrasing(e,{before:l,after:`](`,...o.current()})),l+=o.move(`](`),c(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(c=n.enter(`destinationLiteral`),l+=o.move(`<`),l+=o.move(n.safe(e.url,{before:l,after:`>`,...o.current()})),l+=o.move(`>`)):(c=n.enter(`destinationRaw`),l+=o.move(n.safe(e.url,{before:l,after:e.title?` `:`)`,...o.current()}))),c(),e.title&&(c=n.enter(`title${a}`),l+=o.move(` `+i),l+=o.move(n.safe(e.title,{before:l,after:i,...o.current()})),l+=o.move(i),c()),l+=o.move(`)`),s(),l}function lv(e,t,n){return sv(e,n)?`<`:`[`}uv.peek=dv;function uv(e,t,n,r){let i=e.referenceType,a=n.enter(`linkReference`),o=n.enter(`label`),s=n.createTracker(r),c=s.move(`[`),l=n.containerPhrasing(e,{before:c,after:`]`,...s.current()});c+=s.move(l+`][`),o();let u=n.stack;n.stack=u.filter(function(e){return e!==`phrasing`}),o=n.enter(`reference`);let d=n.safe(n.associationId(e),{before:c,after:`]`,...s.current()});return o(),n.stack=u,a(),i===`full`||!l||l!==d?c+=s.move(d+`]`):i===`shortcut`?c=c.slice(0,-1):c+=s.move(`]`),c}function dv(){return`[`}function fv(e){let t=e.options.bullet||`*`;if(t!==`*`&&t!==`+`&&t!==`-`)throw Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function pv(e){let t=fv(e),n=e.options.bulletOther;if(!n)return t===`*`?`-`:`*`;if(n!==`*`&&n!==`+`&&n!==`-`)throw Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}function mv(e){let t=e.options.bulletOrdered||`.`;if(t!==`.`&&t!==`)`)throw Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function hv(e){let t=e.options.rule||`*`;if(t!==`*`&&t!==`-`&&t!==`_`)throw Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function gv(e,t,n,r){let i=n.enter(`list`),a=n.bulletCurrent,o=e.ordered?mv(n):fv(n),s=e.ordered?o===`.`?`)`:`.`:pv(n),c=t&&n.bulletLastUsed?o===n.bulletLastUsed:!1;if(!e.ordered){let t=e.children?e.children[0]:void 0;if((o===`*`||o===`-`)&&t&&(!t.children||!t.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&&(c=!0),hv(n)===o&&t){let t=-1;for(;++t<e.children.length;){let n=e.children[t];if(n&&n.type===`listItem`&&n.children&&n.children[0]&&n.children[0].type===`thematicBreak`){c=!0;break}}}}c&&(o=s),n.bulletCurrent=o;let l=n.containerFlow(e,r);return n.bulletLastUsed=o,n.bulletCurrent=a,i(),l}function _v(e){let t=e.options.listItemIndent||`one`;if(t!==`tab`&&t!==`one`&&t!==`mixed`)throw Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}function vv(e,t,n,r){let i=_v(n),a=n.bulletCurrent||fv(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 o=a.length+1;(i===`tab`||i===`mixed`&&(t&&t.type===`list`&&t.spread||e.spread))&&(o=Math.ceil(o/4)*4);let s=n.createTracker(r);s.move(a+` `.repeat(o-a.length)),s.shift(o);let c=n.enter(`listItem`),l=n.indentLines(n.containerFlow(e,s.current()),u);return c(),l;function u(e,t,n){return t?(n?``:` `.repeat(o))+e:(n?a:a+` `.repeat(o-a.length))+e}}function yv(e,t,n,r){let i=n.enter(`paragraph`),a=n.enter(`phrasing`),o=n.containerPhrasing(e,r);return a(),i(),o}function bv(e,t,n,r){if(!e.children.some(function(e){return N_(e)}))return n.containerFlow(e,r);let i=n.enter(`phrasing`),a=n.containerPhrasing(e,r);return i(),a}function xv(e){let t=e.options.strong||`*`;if(t!==`*`&&t!==`_`)throw Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}Sv.attention=Cv,Sv.peek=wv;function Sv(e,t,n,r){let i=n.enter(`phrasing`),a=n.containerPhrasing({type:`root`,children:[e]},r);return i(),a}function Cv(e,t){return{construct:`strong`,markers:xv(t)===`*`?[`*`,`_`]:[`_`,`*`],sizes:[2]}}function wv(e,t,n){return n.options.strong||`*`}function Tv(e,t,n,r){let i=t?t.children:[],a=i.indexOf(e);return n.safe(e.value,{...r,afterNode:i[a+1],beforeNode:i[a-1]})}function Ev(e){let t=e.options.ruleRepetition||3;if(t<3)throw Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function Dv(e,t,n){let r=(hv(n)+(n.options.ruleSpaces?` `:``)).repeat(Ev(n));return n.options.ruleSpaces?r.slice(0,-1):r}var Ov={blockquote:P_,break:R_,code:H_,definition:G_,emphasis:q_,hardBreak:R_,heading:Q_,html:$_,image:tv,imageReference:rv,inlineCode:av,link:cv,linkReference:uv,list:gv,listItem:vv,paragraph:yv,root:bv,strong:Sv,text:Tv,thematicBreak:Dv};function kv(){return{enter:{table:Av,tableData:Pv,tableHeader:Pv,tableRow:Mv},exit:{codeText:Fv,table:jv,tableData:Nv,tableHeader:Nv,tableRow:Nv}}}function Av(e){let t=e._align;this.enter({type:`table`,align:t.map(function(e){return e===`none`?null:e}),children:[]},e),this.data.inTable=!0}function jv(e){this.exit(e),this.data.inTable=void 0}function Mv(e){this.enter({type:`tableRow`,children:[]},e)}function Nv(e){this.exit(e)}function Pv(e){this.enter({type:`tableCell`,children:[]},e)}function Fv(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,Iv));let n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function Iv(e,t){return t===`|`?t:e}function Lv(e){let t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,i=t.stringLength,a=n?` `:`|`;return{unsafe:[{character:`\r`,inConstruct:`tableCell`},{character:`
44
- `,inConstruct:`tableCell`},{atBreak:!0,character:`|`,after:`[ :-]`},{character:`|`,inConstruct:`tableCell`},{atBreak:!0,character:`:`,after:`-`},{atBreak:!0,character:`-`,after:`[:|-]`}],handlers:{inlineCode:f,table:o,tableCell:c,tableRow:s}};function o(e,t,n,r){return l(u(e,n,r),e.align)}function s(e,t,n,r){let i=l([d(e,n,r)]);return i.slice(0,i.indexOf(`
45
- `))}function c(e,t,n,r){let i=n.enter(`tableCell`),o=n.enter(`phrasing`),s=n.containerPhrasing(e,{...r,before:a,after:a});return o(),i(),s}function l(e,t){return A_(e,{align:t,alignDelimiters:r,padding:n,stringLength:i})}function u(e,t,n){let r=e.children,i=-1,a=[],o=t.enter(`table`);for(;++i<r.length;)a[i]=d(r[i],t,n);return o(),a}function d(e,t,n){let r=e.children,i=-1,a=[],o=t.enter(`tableRow`);for(;++i<r.length;)a[i]=c(r[i],e,t,n);return o(),a}function f(e,t,n){let r=Ov.inlineCode(e,t,n);return n.stack.includes(`tableCell`)&&(r=r.replace(/\|/g,`\\$&`)),r}}function Rv(){return{exit:{taskListCheckValueChecked:Bv,taskListCheckValueUnchecked:Bv,paragraph:Vv}}}function zv(){return{unsafe:[{atBreak:!0,character:`-`,after:`[:|-]`}],handlers:{listItem:Hv}}}function Bv(e){let t=this.stack[this.stack.length-2];t.type,t.checked=e.type===`taskListCheckValueChecked`}function Vv(e){let t=this.stack[this.stack.length-2];if(t&&t.type===`listItem`&&typeof t.checked==`boolean`){let e=this.stack[this.stack.length-1];e.type;let n=e.children[0];if(n&&n.type===`text`){let r=t.children,i=-1,a;for(;++i<r.length;){let e=r[i];if(e.type===`paragraph`){a=e;break}}a===e&&(n.value=n.value.slice(1),n.value.length===0?e.children.shift():e.position&&n.position&&typeof n.position.start.offset==`number`&&(n.position.start.column++,n.position.start.offset++,e.position.start=Object.assign({},n.position.start)))}}this.exit(e)}function Hv(e,t,n,r){let i=e.children[0],a=typeof e.checked==`boolean`&&i&&i.type===`paragraph`,o=`[`+(e.checked?`x`:` `)+`] `,s=n.createTracker(r);a&&s.move(o);let c=Ov.listItem(e,t,n,{...r,...s.current()});return a&&(c=c.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,l)),c;function l(e){return e+o}}function Uv(){return[qg(),__(),S_(),kv(),Rv()]}function Wv(e){return{extensions:[Jg(),v_(e),C_(),Lv(e),zv()]}}var Gv={tokenize:ay,partial:!0},Kv={tokenize:oy,partial:!0},qv={tokenize:sy,partial:!0},Jv={tokenize:cy,partial:!0},Yv={tokenize:ly,partial:!0},Xv={name:`wwwAutolink`,tokenize:ry,previous:uy},Zv={name:`protocolAutolink`,tokenize:iy,previous:dy},Qv={name:`emailAutolink`,tokenize:ny,previous:fy},$v={};function ey(){return{text:$v}}for(var ty=48;ty<123;)$v[ty]=Qv,ty++,ty===58?ty=65:ty===91&&(ty=97);$v[43]=Qv,$v[45]=Qv,$v[46]=Qv,$v[95]=Qv,$v[72]=[Qv,Zv],$v[104]=[Qv,Zv],$v[87]=[Qv,Xv],$v[119]=[Qv,Xv];function ny(e,t,n){let r=this,i,a;return o;function o(t){return!py(t)||!fy.call(r,r.previous)||my(r.events)?n(t):(e.enter(`literalAutolink`),e.enter(`literalAutolinkEmail`),s(t))}function s(t){return py(t)?(e.consume(t),s):t===64?(e.consume(t),c):n(t)}function c(t){return t===46?e.check(Yv,u,l)(t):t===45||t===95||Wd(t)?(a=!0,e.consume(t),c):u(t)}function l(t){return e.consume(t),i=!0,c}function u(o){return a&&i&&Ud(r.previous)?(e.exit(`literalAutolinkEmail`),e.exit(`literalAutolink`),t(o)):n(o)}}function ry(e,t,n){let r=this;return i;function i(t){return t!==87&&t!==119||!uy.call(r,r.previous)||my(r.events)?n(t):(e.enter(`literalAutolink`),e.enter(`literalAutolinkWww`),e.check(Gv,e.attempt(Kv,e.attempt(qv,a),n),n)(t))}function a(n){return e.exit(`literalAutolinkWww`),e.exit(`literalAutolink`),t(n)}}function iy(e,t,n){let r=this,i=``,a=!1;return o;function o(t){return(t===72||t===104)&&dy.call(r,r.previous)&&!my(r.events)?(e.enter(`literalAutolink`),e.enter(`literalAutolinkHttp`),i+=String.fromCodePoint(t),e.consume(t),s):n(t)}function s(t){if(Ud(t)&&i.length<5)return i+=String.fromCodePoint(t),e.consume(t),s;if(t===58){let n=i.toLowerCase();if(n===`http`||n===`https`)return e.consume(t),c}return n(t)}function c(t){return t===47?(e.consume(t),a?l:(a=!0,c)):n(t)}function l(t){return t===null||Kd(t)||Xd(t)||$d(t)||Qd(t)?n(t):e.attempt(Kv,e.attempt(qv,u),n)(t)}function u(n){return e.exit(`literalAutolinkHttp`),e.exit(`literalAutolink`),t(n)}}function ay(e,t,n){let r=0;return i;function i(t){return(t===87||t===119)&&r<3?(r++,e.consume(t),i):t===46&&r===3?(e.consume(t),a):n(t)}function a(e){return e===null?n(e):t(e)}}function oy(e,t,n){let r,i,a;return o;function o(t){return t===46||t===95?e.check(Jv,c,s)(t):t===null||Xd(t)||$d(t)||t!==45&&Qd(t)?c(t):(a=!0,e.consume(t),o)}function s(t){return t===95?r=!0:(i=r,r=void 0),e.consume(t),o}function c(e){return i||r||!a?n(e):t(e)}}function sy(e,t){let n=0,r=0;return i;function i(o){return o===40?(n++,e.consume(o),i):o===41&&r<n?a(o):o===33||o===34||o===38||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===60||o===63||o===93||o===95||o===126?e.check(Jv,t,a)(o):o===null||Xd(o)||$d(o)?t(o):(e.consume(o),i)}function a(t){return t===41&&r++,e.consume(t),i}}function cy(e,t,n){return r;function r(o){return o===33||o===34||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===63||o===95||o===126?(e.consume(o),r):o===38?(e.consume(o),a):o===93?(e.consume(o),i):o===60||o===null||Xd(o)||$d(o)?t(o):n(o)}function i(e){return e===null||e===40||e===91||Xd(e)||$d(e)?t(e):r(e)}function a(e){return Ud(e)?o(e):n(e)}function o(t){return t===59?(e.consume(t),r):Ud(t)?(e.consume(t),o):n(t)}}function ly(e,t,n){return r;function r(t){return e.consume(t),i}function i(e){return Wd(e)?n(e):t(e)}}function uy(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||Xd(e)}function dy(e){return!Ud(e)}function fy(e){return!(e===47||py(e))}function py(e){return e===43||e===45||e===46||e===95||Wd(e)}function my(e){let t=e.length,n=!1;for(;t--;){let 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}var hy={tokenize:Cy,partial:!0};function gy(){return{document:{91:{name:`gfmFootnoteDefinition`,tokenize:by,continuation:{tokenize:xy},exit:Sy}},text:{91:{name:`gfmFootnoteCall`,tokenize:yy},93:{name:`gfmPotentialFootnoteCall`,add:`after`,tokenize:_y,resolveTo:vy}}}}function _y(e,t,n){let r=this,i=r.events.length,a=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),o;for(;i--;){let e=r.events[i][1];if(e.type===`labelImage`){o=e;break}if(e.type===`gfmFootnoteCall`||e.type===`labelLink`||e.type===`label`||e.type===`image`||e.type===`link`)break}return s;function s(i){if(!o||!o._balanced)return n(i);let s=Hd(r.sliceSerialize({start:o.end,end:r.now()}));return s.codePointAt(0)!==94||!a.includes(s.slice(1))?n(i):(e.enter(`gfmFootnoteCallLabelMarker`),e.consume(i),e.exit(`gfmFootnoteCallLabelMarker`),t(i))}}function vy(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`;let r={type:`gfmFootnoteCall`,start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},i={type:`gfmFootnoteCallMarker`,start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};i.end.column++,i.end.offset++,i.end._bufferIndex++;let a={type:`gfmFootnoteCallString`,start:Object.assign({},i.end),end:Object.assign({},e[e.length-1][1].start)},o={type:`chunkString`,contentType:`string`,start:Object.assign({},a.start),end:Object.assign({},a.end)},s=[e[n+1],e[n+2],[`enter`,r,t],e[n+3],e[n+4],[`enter`,i,t],[`exit`,i,t],[`enter`,a,t],[`enter`,o,t],[`exit`,o,t],[`exit`,a,t],e[e.length-2],e[e.length-1],[`exit`,r,t]];return e.splice(n,e.length-n+1,...s),e}function yy(e,t,n){let r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),a=0,o;return s;function s(t){return e.enter(`gfmFootnoteCall`),e.enter(`gfmFootnoteCallLabelMarker`),e.consume(t),e.exit(`gfmFootnoteCallLabelMarker`),c}function c(t){return t===94?(e.enter(`gfmFootnoteCallMarker`),e.consume(t),e.exit(`gfmFootnoteCallMarker`),e.enter(`gfmFootnoteCallString`),e.enter(`chunkString`).contentType=`string`,l):n(t)}function l(s){if(a>999||s===93&&!o||s===null||s===91||Xd(s))return n(s);if(s===93){e.exit(`chunkString`);let a=e.exit(`gfmFootnoteCallString`);return i.includes(Hd(r.sliceSerialize(a)))?(e.enter(`gfmFootnoteCallLabelMarker`),e.consume(s),e.exit(`gfmFootnoteCallLabelMarker`),e.exit(`gfmFootnoteCall`),t):n(s)}return Xd(s)||(o=!0),a++,e.consume(s),s===92?u:l}function u(t){return t===91||t===92||t===93?(e.consume(t),a++,l):l(t)}}function by(e,t,n){let r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),a,o=0,s;return c;function c(t){return e.enter(`gfmFootnoteDefinition`)._container=!0,e.enter(`gfmFootnoteDefinitionLabel`),e.enter(`gfmFootnoteDefinitionLabelMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionLabelMarker`),l}function l(t){return t===94?(e.enter(`gfmFootnoteDefinitionMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionMarker`),e.enter(`gfmFootnoteDefinitionLabelString`),e.enter(`chunkString`).contentType=`string`,u):n(t)}function u(t){if(o>999||t===93&&!s||t===null||t===91||Xd(t))return n(t);if(t===93){e.exit(`chunkString`);let n=e.exit(`gfmFootnoteDefinitionLabelString`);return a=Hd(r.sliceSerialize(n)),e.enter(`gfmFootnoteDefinitionLabelMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionLabelMarker`),e.exit(`gfmFootnoteDefinitionLabel`),f}return Xd(t)||(s=!0),o++,e.consume(t),t===92?d:u}function d(t){return t===91||t===92||t===93?(e.consume(t),o++,u):u(t)}function f(t){return t===58?(e.enter(`definitionMarker`),e.consume(t),e.exit(`definitionMarker`),i.includes(a)||i.push(a),nf(e,p,`gfmFootnoteDefinitionWhitespace`)):n(t)}function p(e){return t(e)}}function xy(e,t,n){return e.check(xf,t,e.attempt(hy,t,n))}function Sy(e){e.exit(`gfmFootnoteDefinition`)}function Cy(e,t,n){let r=this;return nf(e,i,`gfmFootnoteDefinitionIndent`,5);function i(e){let i=r.events[r.events.length-1];return i&&i[1].type===`gfmFootnoteDefinitionIndent`&&i[2].sliceSerialize(i[1],!0).length===4?t(e):n(e)}}function wy(e){let t=(e||{}).singleTilde,n={name:`strikethrough`,tokenize:i,resolveAll:r};return t??=!0,{text:{126:n},insideSpan:{null:[n]},attentionMarkers:{null:[126]}};function r(e,t){let n=-1;for(;++n<e.length;)if(e[n][0]===`enter`&&e[n][1].type===`strikethroughSequenceTemporary`&&e[n][1]._close){let r=n;for(;r--;)if(e[r][0]===`exit`&&e[r][1].type===`strikethroughSequenceTemporary`&&e[r][1]._open&&e[n][1].end.offset-e[n][1].start.offset===e[r][1].end.offset-e[r][1].start.offset){e[n][1].type=`strikethroughSequence`,e[r][1].type=`strikethroughSequence`;let i={type:`strikethrough`,start:Object.assign({},e[r][1].start),end:Object.assign({},e[n][1].end)},a={type:`strikethroughText`,start:Object.assign({},e[r][1].end),end:Object.assign({},e[n][1].start)},o=[[`enter`,i,t],[`enter`,e[r][1],t],[`exit`,e[r][1],t],[`enter`,a,t]],s=t.parser.constructs.insideSpan.null;s&&Fd(o,o.length,0,mf(s,e.slice(r+1,n),t)),Fd(o,o.length,0,[[`exit`,a,t],[`enter`,e[n][1],t],[`exit`,e[n][1],t],[`exit`,i,t]]),Fd(e,r-1,n-r+3,o),n=r+o.length-2;break}}for(n=-1;++n<e.length;)e[n][1].type===`strikethroughSequenceTemporary`&&(e[n][1].type=`data`);return e}function i(e,n,r){let i=this.previous,a=this.events,o=0;return s;function s(t){return i===126&&a[a.length-1][1].type!==`characterEscape`?r(t):(e.enter(`strikethroughSequenceTemporary`),c(t))}function c(a){let s=pf(i);if(a===126)return o>1?r(a):(e.consume(a),o++,c);if(o<2&&!t)return r(a);let l=e.exit(`strikethroughSequenceTemporary`),u=pf(a);return l._open=!u||u===2&&!!s,l._close=!s||s===2&&!!u,n(a)}}}var Ty=class{constructor(){this.map=[],this.index=new Map}add(e,t,n){Ey(this,e,t,n)}consume(e){if(this.map.sort(function(e,t){return e[0]-t[0]}),this.map.length===0)return;let t=this.map.length,n=[];for(;t>0;)--t,n.push(e.slice(this.map[t][0]+this.map[t][1]),this.map[t][2]),e.length=this.map[t][0];n.push(e.slice()),e.length=0;let r=n.pop();for(;r;){for(let t of r)e.push(t);r=n.pop()}this.map.length=0,this.index.clear()}};function Ey(e,t,n,r){if(n===0&&r.length===0)return;let i=e.index.get(t);if(i){i[1]+=n,i[2].push(...r);return}let a=[t,n,r];e.map.push(a),e.index.set(t,a)}function Dy(e,t){let n=!1,r=[];for(;t<e.length;){let i=e[t];if(n){if(i[0]===`enter`)i[1].type===`tableContent`&&r.push(e[t+1][1].type===`tableDelimiterMarker`?`left`:`none`);else if(i[1].type===`tableContent`){if(e[t-1][1].type===`tableDelimiterMarker`){let e=r.length-1;r[e]=r[e]===`left`?`center`:`right`}}else if(i[1].type===`tableDelimiterRow`)break}else i[0]===`enter`&&i[1].type===`tableDelimiterRow`&&(n=!0);t+=1}return r}function Oy(){return{flow:{null:{name:`table`,tokenize:ky,resolveAll:Ay}}}}function ky(e,t,n){let r=this,i=0,a=0,o;return s;function s(e){let t=r.events.length-1;for(;t>-1;){let{type:e}=r.events[t][1];if(e===`lineEnding`||e===`linePrefix`)t--;else break}let i=t>-1?r.events[t][1].type:null,a=i===`tableHead`||i===`tableRow`?S:c;return a===S&&r.parser.lazy[r.now().line]?n(e):a(e)}function c(t){return e.enter(`tableHead`),e.enter(`tableRow`),l(t)}function l(e){return e===124||(o=!0,a+=1),u(e)}function u(t){return t===null?n(t):Z(t)?a>1?(a=0,r.interrupt=!0,e.exit(`tableRow`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),p):n(t):Zd(t)?nf(e,u,`whitespace`)(t):(a+=1,o&&(o=!1,i+=1),t===124?(e.enter(`tableCellDivider`),e.consume(t),e.exit(`tableCellDivider`),o=!0,u):(e.enter(`data`),d(t)))}function d(t){return t===null||t===124||Xd(t)?(e.exit(`data`),u(t)):(e.consume(t),t===92?f:d)}function f(t){return t===92||t===124?(e.consume(t),d):d(t)}function p(t){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(t):(e.enter(`tableDelimiterRow`),o=!1,Zd(t)?nf(e,m,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):m(t))}function m(t){return t===45||t===58?g(t):t===124?(o=!0,e.enter(`tableCellDivider`),e.consume(t),e.exit(`tableCellDivider`),h):x(t)}function h(t){return Zd(t)?nf(e,g,`whitespace`)(t):g(t)}function g(t){return t===58?(a+=1,o=!0,e.enter(`tableDelimiterMarker`),e.consume(t),e.exit(`tableDelimiterMarker`),_):t===45?(a+=1,_(t)):t===null||Z(t)?b(t):x(t)}function _(t){return t===45?(e.enter(`tableDelimiterFiller`),v(t)):x(t)}function v(t){return t===45?(e.consume(t),v):t===58?(o=!0,e.exit(`tableDelimiterFiller`),e.enter(`tableDelimiterMarker`),e.consume(t),e.exit(`tableDelimiterMarker`),y):(e.exit(`tableDelimiterFiller`),y(t))}function y(t){return Zd(t)?nf(e,b,`whitespace`)(t):b(t)}function b(n){return n===124?m(n):n===null||Z(n)?!o||i!==a?x(n):(e.exit(`tableDelimiterRow`),e.exit(`tableHead`),t(n)):x(n)}function x(e){return n(e)}function S(t){return e.enter(`tableRow`),C(t)}function C(n){return n===124?(e.enter(`tableCellDivider`),e.consume(n),e.exit(`tableCellDivider`),C):n===null||Z(n)?(e.exit(`tableRow`),t(n)):Zd(n)?nf(e,C,`whitespace`)(n):(e.enter(`data`),w(n))}function w(t){return t===null||t===124||Xd(t)?(e.exit(`data`),C(t)):(e.consume(t),t===92?T:w)}function T(t){return t===92||t===124?(e.consume(t),w):w(t)}}function Ay(e,t){let n=-1,r=!0,i=0,a=[0,0,0,0],o=[0,0,0,0],s=!1,c=0,l,u,d,f=new Ty;for(;++n<e.length;){let p=e[n],m=p[1];p[0]===`enter`?m.type===`tableHead`?(s=!1,c!==0&&(My(f,t,c,l,u),u=void 0,c=0),l={type:`table`,start:Object.assign({},m.start),end:Object.assign({},m.end)},f.add(n,0,[[`enter`,l,t]])):m.type===`tableRow`||m.type===`tableDelimiterRow`?(r=!0,d=void 0,a=[0,0,0,0],o=[0,n+1,0,0],s&&(s=!1,u={type:`tableBody`,start:Object.assign({},m.start),end:Object.assign({},m.end)},f.add(n,0,[[`enter`,u,t]])),i=m.type===`tableDelimiterRow`?2:u?3:1):i&&(m.type===`data`||m.type===`tableDelimiterMarker`||m.type===`tableDelimiterFiller`)?(r=!1,o[2]===0&&(a[1]!==0&&(o[0]=o[1],d=jy(f,t,a,i,void 0,d),a=[0,0,0,0]),o[2]=n)):m.type===`tableCellDivider`&&(r?r=!1:(a[1]!==0&&(o[0]=o[1],d=jy(f,t,a,i,void 0,d)),a=o,o=[a[1],n,0,0])):m.type===`tableHead`?(s=!0,c=n):m.type===`tableRow`||m.type===`tableDelimiterRow`?(c=n,a[1]===0?o[1]!==0&&(d=jy(f,t,o,i,n,d)):(o[0]=o[1],d=jy(f,t,a,i,n,d)),i=0):i&&(m.type===`data`||m.type===`tableDelimiterMarker`||m.type===`tableDelimiterFiller`)&&(o[3]=n)}for(c!==0&&My(f,t,c,l,u),f.consume(t.events),n=-1;++n<t.events.length;){let e=t.events[n];e[0]===`enter`&&e[1].type===`table`&&(e[1]._align=Dy(t.events,n))}return e}function jy(e,t,n,r,i,a){let o=r===1?`tableHeader`:r===2?`tableDelimiter`:`tableData`;n[0]!==0&&(a.end=Object.assign({},Ny(t.events,n[0])),e.add(n[0],0,[[`exit`,a,t]]));let s=Ny(t.events,n[1]);if(a={type:o,start:Object.assign({},s),end:Object.assign({},s)},e.add(n[1],0,[[`enter`,a,t]]),n[2]!==0){let i=Ny(t.events,n[2]),a=Ny(t.events,n[3]),o={type:`tableContent`,start:Object.assign({},i),end:Object.assign({},a)};if(e.add(n[2],0,[[`enter`,o,t]]),r!==2){let r=t.events[n[2]],i=t.events[n[3]];if(r[1].end=Object.assign({},i[1].end),r[1].type=`chunkText`,r[1].contentType=`text`,n[3]>n[2]+1){let t=n[2]+1,r=n[3]-n[2]-1;e.add(t,r,[])}}e.add(n[3]+1,0,[[`exit`,o,t]])}return i!==void 0&&(a.end=Object.assign({},Ny(t.events,i)),e.add(i,0,[[`exit`,a,t]]),a=void 0),a}function My(e,t,n,r,i){let a=[],o=Ny(t.events,n);i&&(i.end=Object.assign({},o),a.push([`exit`,i,t])),r.end=Object.assign({},o),a.push([`exit`,r,t]),e.add(n+1,0,a)}function Ny(e,t){let n=e[t],r=n[0]===`enter`?`start`:`end`;return n[1][r]}var Py={name:`tasklistCheck`,tokenize:Iy};function Fy(){return{text:{91:Py}}}function Iy(e,t,n){let r=this;return i;function i(t){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(t):(e.enter(`taskListCheck`),e.enter(`taskListCheckMarker`),e.consume(t),e.exit(`taskListCheckMarker`),a)}function a(t){return Xd(t)?(e.enter(`taskListCheckValueUnchecked`),e.consume(t),e.exit(`taskListCheckValueUnchecked`),o):t===88||t===120?(e.enter(`taskListCheckValueChecked`),e.consume(t),e.exit(`taskListCheckValueChecked`),o):n(t)}function o(t){return t===93?(e.enter(`taskListCheckMarker`),e.consume(t),e.exit(`taskListCheckMarker`),e.exit(`taskListCheck`),s):n(t)}function s(r){return Z(r)?t(r):Zd(r)?e.check({tokenize:Ly},t,n)(r):n(r)}}function Ly(e,t,n){return nf(e,r,`whitespace`);function r(e){return e===null?n(e):t(e)}}function Ry(e){return Rd([ey(),gy(),wy(e),Oy(),Fy()])}var zy={};function By(e){let t=this,n=e||zy,r=t.data(),i=r.micromarkExtensions||=[],a=r.fromMarkdownExtensions||=[],o=r.toMarkdownExtensions||=[];i.push(Ry(n)),a.push(Uv()),o.push(Wv(n))}var Vy={path:`M82 352.8h521.8l181.3.2 8.4.3h2.4A14 14 0 0 1 807 358c2.2 3.9 2.3 7.5 2.4 11.9.4 6 .7 9.6 4.6 14.1 7 3.4 13.2 3.4 20.8 3.3h22.8l28.4-.3h3.8l51.2-1h3.4q112.6-2.8 224.8-15.1l3.4-.4 6.4-.7c14.4-1.6 14.4-1.6 19 .7 2.1 2.7 3 4.6 3.3 8.1-1 9.3-7 17.9-12.3 25.4l-2 2.8a224 224 0 0 1-21 24.2l-2.3 2.4a174 174 0 0 1-20 17.4C1071 510.9 971 540.2 855.3 566.6c-70.4 16-70.4 16-97.3 36.4l-2.5 1.8A100 100 0 0 0 715 677l-.2 3c-.8 32.3 13 61.3 34.2 85l1.9 2.1c31.3 33.5 80.1 49.2 122.7 61.7l6.7 2 3.5 1A31 31 0 0 1 899 844l1.9 4.8 1 3 1.1 3.2 1.3 3.6 6.7 19.6 1.1 3.5a17 17 0 0 1-.2 12c-3 3.7-6.7 5-11.4 5.6h-514l-28.5-.1H227.8c-18-.1-18-.1-23-3.1-2.9-3.3-3-5.5-3-9.8a49 49 0 0 1 3.5-13.8l4.3-13.1c3.6-11.1 7.5-20.8 18.2-26.8 5-2.2 10.4-3.5 15.7-4.8 44-12 87.7-29.3 121.5-60.8l2.5-2.2c21.2-20 33.5-49.3 34.8-78.3.6-27.7-8.4-53.3-26.3-74.5l-2.5-3c-10.3-12-23-20.9-36.5-29l-1.8-1.1c-29.6-18.1-64.5-26.8-97.5-36.6l-3-.9-14-4.1-5.2-1.5-2.2-.6A34 34 0 0 1 193 521a267 267 0 0 1-9.8-23.3l-1.4-3.6c-2.2-3.7-4-5.1-7.8-7.1-5.2-1.2-10.3-1.2-15.6-1.2l-46.8-.7-32.7-.5h-2.7a24 24 0 0 1-17.6-7c-3.8-6.2-3.9-12.3-3.9-19.4v-33l-.1-49.8c0-6.9.9-13.7 5.7-18.8 7-4 13.7-3.9 21.6-3.8`,viewBox:`31 329 1194 594`,bounds:{x:55,y:353,width:1146,height:546}};function Hy(){return typeof window<`u`}function Uy(e){return Ky(e)?(e.nodeName||``).toLowerCase():`#document`}function Wy(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Gy(e){return((Ky(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function Ky(e){return Hy()?e instanceof Node||e instanceof Wy(e).Node:!1}function qy(e){return Hy()?e instanceof Element||e instanceof Wy(e).Element:!1}function Jy(e){return Hy()?e instanceof HTMLElement||e instanceof Wy(e).HTMLElement:!1}function Yy(e){return!Hy()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof Wy(e).ShadowRoot}function Xy(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=sb(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function Zy(e){return/^(table|td|th)$/.test(Uy(e))}function Qy(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var $y=/transform|translate|scale|rotate|perspective|filter/,eb=/paint|layout|strict|content/,tb=e=>!!e&&e!==`none`,nb;function rb(e){let t=qy(e)?sb(e):e;return tb(t.transform)||tb(t.translate)||tb(t.scale)||tb(t.rotate)||tb(t.perspective)||!ab()&&(tb(t.backdropFilter)||tb(t.filter))||$y.test(t.willChange||``)||eb.test(t.contain||``)}function ib(e){let t=lb(e);for(;Jy(t)&&!ob(t);){if(rb(t))return t;if(Qy(t))return null;t=lb(t)}return null}function ab(){return nb??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),nb}function ob(e){return/^(html|body|#document)$/.test(Uy(e))}function sb(e){return Wy(e).getComputedStyle(e)}function cb(e){return qy(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function lb(e){if(Uy(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||Yy(e)&&e.host||Gy(e);return Yy(t)?t.host:t}function ub(e){let t=lb(e);return ob(t)?(e.ownerDocument||e).body:Jy(t)&&Xy(t)?t:ub(t)}function db(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=ub(e),i=r===e.ownerDocument?.body,a=Wy(r);if(i){let e=fb(a);return t.concat(a,a.visualViewport||[],Xy(r)?r:[],e&&n?db(e):[])}return t.concat(r,db(r,[],n))}function fb(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}var pb=U.createContext(void 0);function mb(e=!1){let t=U.useContext(pb);if(t===void 0&&!e)throw Error(Zi(16));return t}function hb(e){let{focusableWhenDisabled:t,disabled:n,composite:r=!1,tabIndex:i=0,isNativeButton:a}=e,o=r&&t!==!1,s=r&&t===!1;return{props:U.useMemo(()=>{let e={onKeyDown(e){n&&t&&e.key!==`Tab`&&e.preventDefault()}};return r||(e.tabIndex=i,!a&&n&&(e.tabIndex=t?i:-1)),(a&&(t||o)||!a&&n)&&(e[`aria-disabled`]=n),a&&(!t||s)&&(e.disabled=n),e},[r,n,t,o,s,a,i])}}function gb(e){return e?.ownerDocument||document}function _b(e,t,{detail:n=0,pointerType:r=``}={}){e.dispatchEvent(new(Wy(e)).PointerEvent(`click`,{bubbles:!0,cancelable:!0,composed:!0,detail:n,pointerType:r,shiftKey:t.shiftKey,ctrlKey:t.ctrlKey,altKey:t.altKey,metaKey:t.metaKey}))}function vb(e={}){let{disabled:t=!1,focusableWhenDisabled:n,tabIndex:r=0,native:i=!0,composite:a}=e,o=U.useRef(null),s=mb(!0),c=a??s!==void 0,{props:l}=hb({focusableWhenDisabled:n,disabled:t,composite:c,tabIndex:r,isNativeButton:i}),u=U.useCallback(()=>{let e=o.current;yb(e)&&c&&t&&l.disabled===void 0&&e.disabled&&(e.disabled=!1)},[t,l.disabled,c]);return J(u,[u]),{getButtonProps:U.useCallback((e={})=>{let{onClick:n,onMouseDown:r,onKeyUp:a,onKeyDown:o,onPointerDown:s,...u}=e;return Ai({onClick(e){t?e.preventDefault():n?.(e)},onMouseDown(e){t||r?.(e)},onKeyDown(e){if(t||(Bi(e),o?.(e),e.baseUIHandlerPrevented))return;let n=e.target===e.currentTarget,r=e.currentTarget,a=yb(r),s=!i&&bb(r),l=n&&(i?a:!s),u=e.key===`Enter`,d=e.key===` `,f=r.getAttribute(`role`),p=f?.startsWith(`menuitem`)||f===`option`||f===`gridcell`;if(n&&c&&d){if(e.defaultPrevented&&p)return;e.preventDefault(),(!i||a)&&(e.preventBaseUIHandler(),_b(r,e))}else!l||i||!d&&!u?n&&s&&d&&e.preventDefault():e.defaultPrevented||(e.preventDefault(),u&&(e.preventBaseUIHandler(),_b(r,e)))},onKeyUp(e){t||(Bi(e),a?.(e),e.target===e.currentTarget&&i&&c&&yb(e.currentTarget)&&e.key===` `?e.preventDefault():e.baseUIHandlerPrevented||e.target===e.currentTarget&&!i&&!c&&!e.defaultPrevented&&e.key===` `&&(e.preventBaseUIHandler(),_b(e.currentTarget,e)))},onPointerDown(e){t?e.preventDefault():s?.(e)}},i?{type:`button`}:{role:`button`},l,u)},[t,l,c,i]),buttonRef:q(e=>{o.current=e,u()})}}function yb(e){return Jy(e)&&e.tagName===`BUTTON`}function bb(e){return Jy(e)&&e.tagName===`A`&&!!e.href}var xb=U.forwardRef(function(e,t){let{render:n,className:r,disabled:i=!1,focusableWhenDisabled:a=!1,nativeButton:o=!0,style:s,...c}=e,{getButtonProps:l,buttonRef:u}=vb({disabled:i,focusableWhenDisabled:a,native:o});return Ui(`button`,e,{state:{disabled:i},ref:[t,u],props:[c,l]})});function Sb(e){var t,n,r=``;if(typeof e==`string`||typeof e==`number`)r+=e;else if(typeof e==`object`){if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=Sb(e[t]))&&(r&&(r+=` `),r+=n)}else for(n in e)e[n]&&(r&&(r+=` `),r+=n)}return r}function Cb(){for(var e,t,n=0,r=``,i=arguments.length;n<i;n++)(e=arguments[n])&&(t=Sb(e))&&(r&&(r+=` `),r+=t);return r}var wb=e=>typeof e==`boolean`?`${e}`:e===0?`0`:e,Tb=Cb,Eb=(e,t)=>n=>{if(t?.variants==null)return Tb(e,n?.class,n?.className);let{variants:r,defaultVariants:i}=t,a=Object.keys(r).map(e=>{let t=n?.[e],a=i?.[e];if(t===null)return null;let o=wb(t)||wb(a);return r[e][o]}),o=n&&Object.entries(n).reduce((e,t)=>{let[n,r]=t;return r===void 0||(e[n]=r),e},{});return Tb(e,a,t?.compoundVariants?.reduce((e,t)=>{let{class:n,className:r,...a}=t;return Object.entries(a).every(e=>{let[t,n]=e;return Array.isArray(n)?n.includes({...i,...o}[t]):{...i,...o}[t]===n})?[...e,n,r]:e},[]),n?.class,n?.className)},Db=Eb(`group/button inline-flex shrink-0 items-center justify-center rounded-md border border-transparent bg-clip-padding text-[13px] font-medium whitespace-nowrap transition-all outline-none select-none focus-visible:border-transparent focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background active:not-aria-[haspopup]:translate-y-px disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,{variants:{variant:{default:`bg-primary text-primary-foreground hover:bg-primary/80`,outline:`border-border bg-background hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50`,secondary:`bg-secondary text-secondary-foreground hover:bg-[color-mix(in_oklch,var(--secondary),var(--foreground)_5%)] aria-expanded:bg-secondary aria-expanded:text-secondary-foreground`,ghost:`hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:hover:bg-muted/50`,destructive:`bg-destructive/10 text-destructive hover:bg-destructive/20 focus-visible:border-destructive/40 focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:hover:bg-destructive/30 dark:focus-visible:ring-destructive/40`,link:`text-primary underline-offset-4 hover:underline`},size:{default:`h-7 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2`,xs:`h-6 gap-1 rounded-[min(var(--radius-md),10px)] px-2 text-xs in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3`,sm:`h-7 gap-1 rounded-[min(var(--radius-md),12px)] px-2.5 text-[0.8rem] in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3.5`,lg:`h-9 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2`,icon:`size-8`,"icon-xs":`size-6 rounded-[min(var(--radius-md),10px)] in-data-[slot=button-group]:rounded-lg [&_svg:not([class*='size-'])]:size-3`,"icon-sm":`size-7 rounded-[min(var(--radius-md),12px)] in-data-[slot=button-group]:rounded-lg`,"icon-lg":`size-9`}},defaultVariants:{variant:`outline`,size:`default`}});function Ob(e){return U.isValidElement(e)}function kb({className:e,variant:t=`outline`,size:n=`default`,render:r,...i}){if(Ob(r)&&r.type!==`button`){let{nativeButton:a,focusableWhenDisabled:o,children:s,...c}=i;return U.cloneElement(r,{...c,"data-slot":`button`,className:K(Db({variant:t,size:n,className:e}),typeof r.props.className==`string`?r.props.className:void 0)},...s===void 0?[]:[s])}return(0,W.jsx)(xb,{"data-slot":`button`,className:K(Db({variant:t,size:n,className:e})),render:r,...i})}var Ab=`data-valid`,jb=`data-invalid`,Mb={badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valid:null,valueMissing:!1},Nb={disabled:!1,valid:null,touched:!1,dirty:!1,filled:!1,focused:!1},Pb={valid(e){return e===null?null:e?{[Ab]:``}:{[jb]:``}}},Fb={invalid:void 0,name:void 0,validityData:{state:Mb,errors:[],error:``,value:``,initialValue:null},setValidityData:Ci,disabled:void 0,setTouched:Ci,setDirty:Ci,setFilled:Ci,setFocused:Ci,focusOwnerRef:{current:void 0},validationMode:`onSubmit`,shouldValidateOnChange:()=>!1,state:Nb,registerFieldControl:Ci,validation:{getValidationProps:(e,t=Ti)=>t,inputRef:{current:null},registeredInputs:new Map,registerInput:Ci,getInputControl:()=>null,commit:async()=>{},change:Ci}},Ib=U.createContext(Fb);function Lb(e=!0){let t=U.useContext(Ib);if(t.setValidityData===Ci&&!e)throw Error(Zi(28));return t}var Rb=U.createContext({elementRef:{current:null},formRef:{current:{fields:new Map}},errors:{},clearErrors:Ci,validationMode:`onSubmit`,submitCountRef:{current:0}});function zb(){return U.useContext(Rb)}function Bb(){let[,e]=U.useState({});return U.useCallback(()=>{e({})},[])}var Vb=0;function Hb(e,t=`mui`){let n=U.useRef(void 0),r=Bb(),i=e??n.current;return U.useEffect(()=>{n.current??(Vb+=1,n.current=`${t}-${Vb}`,e??r())},[e,t,r]),i}var Ub=na.useId;function Wb(e,t){if(Ub!==void 0){let n=Ub();return e??(t?`${t}-${n}`:n)}return Hb(e,t)}function Gb(e){return Wb(e,`base-ui`)}var Kb=U.createContext({controlId:void 0,registerControlId:Ci,resetControlId:Ci,labelId:void 0,setLabelId:Ci,messageIds:[],setMessageIds:Ci,getDescriptionProps:e=>e});function qb(){return U.useContext(Kb)}function Jb(e,t,n,r=!0,i,a){let[o,s]=U.useState(),c=Gb(i?`${i}-label`:void 0),l=!!a?.trim(),u=e??(l?void 0:t)??o;return J(()=>{let i=e||t||l||!r?void 0:Yb(n.current,c);o!==i&&s(i)}),u}function Yb(e,t){let n=Xb(e);if(n)return!n.id&&t&&(n.id=t),n.id||void 0}function Xb(e){if(!e)return;let t=e.parentElement;if(t&&t.tagName===`LABEL`)return t;let n=e.id;if(n){let t=e.nextElementSibling;if(t&&t.htmlFor===n)return t}let r=e.labels;return r&&r[0]}function Zb(e={}){let{id:t,enabled:n=!0}=e,{controlId:r,registerControlId:i,resetControlId:a}=qb(),o=Gb(),s=fi(()=>Symbol()),c=U.useRef(!1),l=U.useRef(!1),u=q(()=>{c.current&&i!==Ci&&(c.current=!1,i(s.current,void 0))});return J(()=>{if(!n||i===Ci){u();return}let e;if(t!==void 0)l.current=!0,e=t;else if(l.current)e=o;else{a();return}e===void 0?u():(c.current=!0,i(s.current,e))},[t,n,i,a,o,s,u]),J(()=>u,[u]),(n?r:void 0)??t??o}function Qb(){return typeof navigator>`u`?{userAgent:``,platform:``,maxTouchPoints:0}:{userAgent:navigator.userAgent,platform:navigator.platform??``,maxTouchPoints:navigator.maxTouchPoints??0}}var{userAgent:$b,platform:ex,maxTouchPoints:tx}=Qb(),nx=$b.toLowerCase(),rx=ex.toLowerCase(),ix=/^i(os$|p)/.test(rx)||rx===`macintel`&&tx>1,ax=`android`,ox=rx===ax||nx.includes(ax),sx=!ix&&rx.startsWith(`mac`);rx.startsWith(`win`),!ox&&/^(linux|chrome os)/.test(rx);var cx=sx||ix,lx=typeof CSS<`u`&&!!CSS.supports?.(`-webkit-backdrop-filter:none`);!lx&&nx.includes(`firefox`),!lx&&nx.includes(`chrom`);var ux=cx,dx=/jsdom|happydom/.test(nx);function fx(e){let t=e.activeElement;for(;t?.shadowRoot?.activeElement!=null;)t=t.shadowRoot.activeElement;return t}function Q(e,t){if(!e||!t)return!1;let n=t.getRootNode?.();if(e.contains(t))return!0;if(n&&Yy(n)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}function px(e,t){let n=e;for(;n;){if(qy(n)&&n.matches(t))return n;n=n.assignedSlot??n.parentNode??(Yy(n)?n.host:null)}return null}function mx(e){return`composedPath`in e?e.composedPath()[0]??e.target:e.target}var hx=`data-base-ui-focusable`,gx=`input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])`,_x=`ArrowLeft`,vx=`ArrowRight`,yx=`ArrowUp`,bx=`ArrowDown`,xx=`data-open`,Sx=`data-closed`,Cx=`data-anchor-hidden`,wx=`data-popup-open`,Tx=`data-pressed`,Ex={[wx]:``},Dx={[wx]:``,[Tx]:``},Ox={[xx]:``},kx={[Sx]:``},Ax={[Cx]:``},jx={open(e){return e?Ex:null}},Mx={open(e){return e?Dx:null}},Nx={open(e){return e?Ox:kx},anchorHidden(e){return e?Ax:null}},Px={...Nx,...Sa},Fx=`data-trigger-disabled`;function Ix(e,t){if(!qy(e))return!1;let n=e;if(t.hasElement(n))return!n.hasAttribute(Fx);for(let[,e]of t.entries())if(Q(e,n))return!e.hasAttribute(Fx);return!1}function Lx(e,t){if(t==null)return!1;if(`composedPath`in e)return e.composedPath().includes(t);let n=e;return n.target!=null&&t.contains(n.target)}function Rx(e){return e.matches(`html,body`)}function zx(e){return Jy(e)&&e.matches(`input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])`)}function Bx(e){return px(e,`button,a[href],[role="button"],select,[tabindex]:not([tabindex="-1"]),${gx}`)!=null}function Vx(e){return e?e.getAttribute(`role`)===`combobox`&&zx(e):!1}function Hx(e){if(!e||dx)return!0;try{return e.matches(`:focus-visible`)}catch{return!0}}function Ux(e){return e?e.hasAttribute(`data-base-ui-focusable`)?e:e.querySelector(`[data-base-ui-focusable]`)||e:null}function Wx(e,t,n=!0){return e.filter(e=>e.parentId===t).flatMap(t=>[...!n||t.context?.open?[t]:[],...Wx(e,t.id,n)])}function Gx(e,t){let n=[],r=e.find(e=>e.id===t)?.parentId;for(;r;){let t=e.find(e=>e.id===r);r=t?.parentId,t&&(n=n.concat(t))}return n}function Kx(e){e.preventDefault(),e.stopPropagation()}function qx(e){return`nativeEvent`in e}function Jx(e){return e.pointerType===``&&e.isTrusted?!0:ox&&e.pointerType?e.type===`click`&&e.buttons===1:e.detail===0&&!e.pointerType}function Yx(e){return dx?!1:!ox&&e.width===0&&e.height===0||e.type===`pointerdown`&&e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType===`mouse`&&(ox||e.buttons===0)||e.width<1&&e.height<1&&e.pressure===0&&e.detail===0&&e.pointerType===`touch`}function Xx(e,t){let n=[`mouse`,`pen`];return t||n.push(``,void 0),n.includes(e)}function Zx(e){let t=e.type;return t===`click`||t===`mousedown`||t===`keydown`||t===`keyup`}var Qx=Math.min,$x=Math.max,eS=Math.round,tS=Math.floor,nS=e=>({x:e,y:e}),rS={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function iS(e,t,n){return $x(e,Qx(t,n))}function aS(e,t){return typeof e==`function`?e(t):e}function oS(e){return e.split(`-`)[0]}function sS(e){return e.split(`-`)[1]}function cS(e){return e===`x`?`y`:`x`}function lS(e){return e===`y`?`height`:`width`}function uS(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function dS(e){return cS(uS(e))}function fS(e,t,n){n===void 0&&(n=!1);let r=sS(e),i=dS(e),a=lS(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=xS(o)),[o,xS(o)]}function pS(e){let t=xS(e);return[mS(e),t,mS(t)]}function mS(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var hS=[`left`,`right`],gS=[`right`,`left`],_S=[`top`,`bottom`],vS=[`bottom`,`top`];function yS(e,t,n){switch(e){case`top`:case`bottom`:return n?t?gS:hS:t?hS:gS;case`left`:case`right`:return t?_S:vS;default:return[]}}function bS(e,t,n,r){let i=sS(e),a=yS(oS(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(mS)))),a}function xS(e){let t=oS(e);return rS[t]+e.slice(t.length)}function SS(e){return{top:e.top??0,right:e.right??0,bottom:e.bottom??0,left:e.left??0}}function CS(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:SS(e)}function wS(e){let{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function TS(e,t){return t<0||t>=e.length}function ES(e,t){return kS(e.current,{disabledIndices:t})}function DS(e,t){return kS(e.current,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}function OS(e,t,n){let{decrement:r,loopFocus:i,allowEscape:a,disabledIndices:o,minIndex:s,maxIndex:c}=n,l=()=>kS(e,{startingIndex:t,decrement:r,disabledIndices:o}),u,d=!1;if(!i)u=r?Math.max(s,l()):Math.min(c,l());else if(r?t<=s:t>=c){let n=r?-1:e.length;a&&t!==n?u=-1:(u=r?c:s,d=!0)}else u=l();return{index:TS(e,u)?-1:u,wrapped:d}}function kS(e,{startingIndex:t=-1,decrement:n=!1,disabledIndices:r,amount:i=1}={}){let a=t;do a+=n?-i:i;while(a>=0&&a<=e.length-1&&AS(e,a,r));return a}function AS(e,t,n){if(typeof n==`function`?n(t):n?.includes(t)??!1)return!0;let r=e[t];return r?!MS(r)||r.matches(`:disabled`)?!0:!n&&(r.hasAttribute(`disabled`)||r.getAttribute(`aria-disabled`)===`true`):!1}function jS(e){return e.visibility===`hidden`||e.visibility===`collapse`}function MS(e,t=e?sb(e):null){return!e||!e.isConnected||!t||jS(t)?!1:typeof e.checkVisibility==`function`?e.checkVisibility():t.display!==`none`&&t.display!==`contents`}var NS=`a[href],button,input,select,textarea,summary,details,iframe,object,embed,[tabindex],[contenteditable]:not([contenteditable="false"]),audio[controls],video[controls]`;function PS(e){let t=e.assignedSlot;if(t)return t;if(e.parentElement)return e.parentElement;let n=e.getRootNode();return Yy(n)?n.host:null}function FS(e){for(let t of Array.from(e.children))if(Uy(t)===`summary`)return t;return null}function IS(e,t){let n=FS(t);return!!n&&(e===n||Q(n,e))}function LS(e){let t=e?Uy(e):``;return e!=null&&e.matches(NS)&&(t!==`summary`||e.parentElement!=null&&Uy(e.parentElement)===`details`&&FS(e.parentElement)===e)&&(t!==`details`||FS(e)==null)&&(t!==`input`||e.type!==`hidden`)}function RS(e){if(!LS(e)||!e.isConnected||e.matches(`:disabled`))return!1;for(let t=e;t;t=PS(t)){let n=t!==e,r=Uy(t)===`slot`;if(t.hasAttribute(`inert`)||n&&Uy(t)===`details`&&!t.open&&!IS(e,t)||t.hasAttribute(`hidden`)||!r&&!zS(t,n))return!1}return!0}function zS(e,t){let n=sb(e);return t?n.display!==`none`:MS(e,n)}function BS(e){let t=e.tabIndex;if(t<0){let t=Uy(e);if(t===`details`||t===`audio`||t===`video`||Jy(e)&&e.isContentEditable)return 0}return t}function VS(e){if(Uy(e)!==`input`)return null;let t=e;return t.type===`radio`&&t.name!==``?t:null}function HS(e,t){let n=VS(e);if(!n)return!0;let r=t.find(e=>{let t=VS(e);return t?.name===n.name&&t.form===n.form&&t.checked});return r?r===n:t.find(e=>{let t=VS(e);return t?.name===n.name&&t.form===n.form})===n}function US(e){if(Jy(e)&&Uy(e)===`slot`){let t=e.assignedElements({flatten:!0});if(t.length>0)return t}return Jy(e)&&e.shadowRoot?Array.from(e.shadowRoot.children):Array.from(e.children)}function WS(e,t){US(e).forEach(e=>{LS(e)&&t.push(e),WS(e,t)})}function GS(e,t,n){US(e).forEach(e=>{Jy(e)&&e.matches(t)&&n.push(e),GS(e,t,n)})}function KS(e){return RS(e)&&BS(e)>=0}function qS(e){let t=[];return WS(e,t),t.filter(RS)}function JS(e){let t=qS(e);return t.filter(e=>BS(e)>=0&&HS(e,t))}function YS(e,t){let n=JS(e),r=n.length;if(r===0)return;let i=fx(gb(e)),a=n.indexOf(i);return n[a===-1?t===1?0:r-1:a+t]}function XS(e){return YS(gb(e).body,1)||e}function ZS(e){return YS(gb(e).body,-1)||e}function QS(e,t,n){if(!e)return null;let r=[];WS(gb(e).body,r);let i=r.indexOf(e);if(i===-1)return null;let a=r.filter(RS);for(let e=1;e<r.length;e+=1){let o=r[(i+t*e+r.length)%r.length];if(!Q(n,o)&&KS(o)&&HS(o,a))return o}return r[i]}function $S(e,t){let n=t||e.currentTarget,r=e.relatedTarget;return!r||!Q(n,r)}function eC(e){JS(e).forEach(e=>{e.dataset.tabindex=e.getAttribute(`tabindex`)||``,e.setAttribute(`tabindex`,`-1`)})}function tC(e){let t=[];GS(e,`[data-tabindex]`,t),t.forEach(e=>{let t=e.dataset.tabindex;delete e.dataset.tabindex,t?e.setAttribute(`tabindex`,t):e.removeAttribute(`tabindex`)})}var nC=U.createContext({disabled:!1});function rC(){return U.useContext(nC)}function iC(e,t,n){let{setFocused:r,focusOwnerRef:i}=Lb(),a=q(t=>{(t?!e:i.current===a)&&(i.current=t&&a,n?.(t),r(t))});return J(()=>{let e=t.current;return e?.getRootNode()?.activeElement===e&&a(!0),()=>a(!1)},[e,t,a]),a}function aC(e,t,n,r,i=!0,a){let{registerFieldControl:o}=Lb(),s=fi(()=>Symbol());J(()=>{let c=s.current;i?o(c,{controlRef:e,getValue:r,id:t,name:a,value:n}):o(c,void 0)},[e,i,r,t,a,o,s,n]),J(()=>{let e=s.current;return()=>{o(e,void 0)}},[o,s])}function oC(e,t){let n=U.useRef(e),r=q(t);J(()=>{n.current!==e&&r(n.current),n.current=e},[e,r])}function $(e,t,n,r){let i=!1,a=!1,o=r??Ti;return{reason:e,event:t??new Event(`base-ui`),cancel(){i=!0},allowPropagation(){a=!0},get isCanceled(){return i},get isPropagationAllowed(){return a},trigger:n,...o}}function sC(e,t,n){let r=n??Ti;return{reason:e,event:t??new Event(`base-ui`),...r}}var cC=`none`,lC=`trigger-press`,uC=`trigger-hover`,dC=`trigger-focus`,fC=`outside-press`,pC=`item-press`,mC=`close-press`,hC=`focus-out`,gC=`escape-key`,_C=`list-navigation`,vC=`keyboard`,yC=`pointer`,bC=`cancel-open`,xC=`sibling-open`,SC=`disabled`,CC=`missing`,wC=`initial`,TC=`imperative-action`,EC=`window-resize`,DC=U.forwardRef(function(e,t){let{render:n,className:r,id:i,name:a,value:o,disabled:s=!1,onValueChange:c,defaultValue:l,autoFocus:u=!1,style:d,...f}=e,{state:p,name:m,disabled:h,setTouched:g,setDirty:_,validityData:v,setFilled:y,validationMode:b,validation:x}=Lb(),{clearErrors:S,elementRef:C,submitCountRef:w}=zb(),T=h||s,E=m??a,D={...p,disabled:T},{labelId:O}=qb(),k=Zb({id:i}),A=o!==void 0,j=o==null?void 0:String(o),M=q(()=>x.inputRef.current?.value);aC(x.inputRef,k,j,M,!T,a),J(()=>{let e=j??x.inputRef.current?.value;e!==void 0&&y(e!==``)},[j,l,x.inputRef,y]),oC(j,()=>{j!==void 0&&(S(E),_(j!==(v.initialValue??``)),x.change(j))});let N=U.useRef(null),P=iC(T,N),F=ka();return Ui(`input`,e,{ref:[t,N],state:D,props:[{id:k,disabled:T,name:E,ref:x.inputRef,"aria-labelledby":O,autoFocus:u,...A?{value:o}:{defaultValue:l},onChange(e){let t=e.currentTarget.value,n=$(cC,e.nativeEvent);c?.(t,n),!A&&(_(t!==(v.initialValue??``)),y(t!==``),!e.nativeEvent.defaultPrevented&&!n.isCanceled&&(S(E),x.change(t)))},onFocus(){P(!0)},onBlur(e){if(g(!0),P(!1),b===`onBlur`){let t=e.currentTarget.value;x.commit(t),A&&queueMicrotask(()=>{let e=x.inputRef.current?.value;e!==void 0&&e!==t&&e!==(v.initialValue??``)&&x.commit(e)})}},onKeyDown(e){if(e.currentTarget.tagName===`INPUT`&&e.key===`Enter`){g(!0);let t=e.currentTarget.value,n=e.currentTarget.form;if(n&&n===C.current&&!e.defaultPrevented){let t=e.currentTarget,n=w.current;F.start(0,()=>{w.current===n&&x.commit(t.value)})}else x.commit(t)}}},f,e=>x.getValidationProps(T,e)],stateAttributesMapping:Pb})}),OC=U.forwardRef(function(e,t){return(0,W.jsx)(DC,{ref:t,...e})});function kC({className:e,type:t,...n}){return(0,W.jsx)(OC,{type:t,"data-slot":`input`,className:K(`h-8 w-full min-w-0 rounded-md border border-input bg-transparent px-2.5 py-1 text-base transition-colors outline-none file:inline-flex file:h-6 file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:border-primary focus-visible:ring-2 focus-visible:ring-primary/20 disabled:pointer-events-none disabled:cursor-not-allowed disabled:bg-input/50 disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 md:text-[13px] dark:bg-input/30 dark:disabled:bg-input/80 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40`,e),...n})}function AC({className:e,...t}){return(0,W.jsx)(`textarea`,{"data-slot":`textarea`,className:K(`flex field-sizing-content min-h-16 w-full rounded-lg border border-input bg-transparent px-2.5 py-2 text-base transition-colors outline-none placeholder:text-muted-foreground focus-visible:border-primary focus-visible:ring-2 focus-visible:ring-primary/20 disabled:cursor-not-allowed disabled:bg-input/50 disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:disabled:bg-input/80 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40`,e),...t})}function jC({className:e,...t}){return(0,W.jsx)(`div`,{"data-slot":`input-group`,role:`group`,className:K(`group/input-group relative flex h-8 w-full min-w-0 items-center rounded-lg border border-input transition-colors outline-none in-data-[slot=combobox-content]:focus-within:border-inherit in-data-[slot=combobox-content]:focus-within:ring-0 has-disabled:bg-input/50 has-disabled:opacity-50 has-[[data-slot=input-group-control]:focus-visible]:border-ring has-[[data-slot=input-group-control]:focus-visible]:ring-3 has-[[data-slot=input-group-control]:focus-visible]:ring-ring/50 has-[[data-slot][aria-invalid=true]]:border-destructive has-[[data-slot][aria-invalid=true]]:ring-3 has-[[data-slot][aria-invalid=true]]:ring-destructive/20 has-[>[data-align=block-end]]:h-auto has-[>[data-align=block-end]]:flex-col has-[>[data-align=block-start]]:h-auto has-[>[data-align=block-start]]:flex-col has-[>textarea]:h-auto dark:bg-input/30 dark:has-disabled:bg-input/80 dark:has-[[data-slot][aria-invalid=true]]:ring-destructive/40 has-[>[data-align=block-end]]:[&>input]:pt-3 has-[>[data-align=block-start]]:[&>input]:pb-3 has-[>[data-align=inline-end]]:[&>input]:pr-1.5 has-[>[data-align=inline-start]]:[&>input]:pl-1.5`,e),...t})}var MC=Eb(`flex h-auto cursor-text items-center justify-center gap-2 py-1.5 text-sm font-medium text-muted-foreground select-none group-data-[disabled=true]/input-group:opacity-50 [&>kbd]:rounded-[calc(var(--radius)-5px)] [&>svg:not([class*='size-'])]:size-4`,{variants:{align:{"inline-start":`order-first pl-2 has-[>button]:ml-[-0.3rem] has-[>kbd]:ml-[-0.15rem]`,"inline-end":`order-last pr-2 has-[>button]:mr-[-0.3rem] has-[>kbd]:mr-[-0.15rem]`,"block-start":`order-first w-full justify-start px-2.5 pt-2 group-has-[>input]/input-group:pt-2 [.border-b]:pb-2`,"block-end":`order-last w-full justify-start px-2.5 pb-2 group-has-[>input]/input-group:pb-2 [.border-t]:pt-2`}},defaultVariants:{align:`inline-start`}});function NC({className:e,align:t=`inline-start`,...n}){return(0,W.jsx)(`div`,{role:`group`,"data-slot":`input-group-addon`,"data-align":t,className:K(MC({align:t}),e),onClick:e=>{e.target instanceof Element&&e.target.closest(`button`)||e.currentTarget.parentElement?.querySelector(`input`)?.focus()},...n})}var PC=Eb(`flex items-center gap-2 text-sm shadow-none`,{variants:{size:{xs:`h-6 gap-1 rounded-[calc(var(--radius)-3px)] px-1.5 [&>svg:not([class*='size-'])]:size-3.5`,sm:``,"icon-xs":`size-6 rounded-[calc(var(--radius)-3px)] p-0 has-[>svg]:p-0`,"icon-sm":`size-8 p-0 has-[>svg]:p-0`}},defaultVariants:{size:`xs`}});function FC({className:e,type:t=`button`,variant:n=`ghost`,size:r=`xs`,...i}){return(0,W.jsx)(kb,{type:t,"data-size":r,variant:n,className:K(PC({size:r}),e),...i})}function IC({className:e,...t}){return(0,W.jsx)(kC,{"data-slot":`input-group-control`,className:K(`flex-1 rounded-none border-0 bg-transparent shadow-none ring-0 focus-visible:ring-0 disabled:bg-transparent aria-invalid:ring-0 dark:bg-transparent dark:disabled:bg-transparent`,e),...t})}function LC({className:e,...t}){return(0,W.jsx)(AC,{"data-slot":`input-group-control`,className:K(`flex-1 resize-none rounded-none border-0 bg-transparent py-2 shadow-none ring-0 focus-visible:ring-0 disabled:bg-transparent aria-invalid:ring-0 dark:bg-transparent dark:disabled:bg-transparent`,e),...t})}function RC({className:e,...t}){return(0,W.jsx)(`label`,{"data-slot":`label`,className:K(`flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50`,e),...t})}var zC=U.forwardRef(function(e,t){let{className:n,render:r,orientation:i=`horizontal`,style:a,...o}=e;return Ui(`div`,e,{state:{orientation:i},ref:t,props:[{role:`separator`,"aria-orientation":i},o]})});function BC({className:e,orientation:t=`horizontal`,...n}){return(0,W.jsx)(zC,{"data-slot":`separator`,orientation:t,className:K(`shrink-0 bg-border data-horizontal:h-px data-horizontal:w-full data-vertical:w-px data-vertical:self-stretch`,e),...n})}function VC({className:e,...t}){return(0,W.jsx)(`fieldset`,{"data-slot":`field-set`,className:K(`flex flex-col gap-4 has-[>[data-slot=checkbox-group]]:gap-3 has-[>[data-slot=radio-group]]:gap-3`,e),...t})}function HC({className:e,variant:t=`legend`,...n}){return(0,W.jsx)(`legend`,{"data-slot":`field-legend`,"data-variant":t,className:K(`mb-1.5 font-medium data-[variant=label]:text-sm data-[variant=legend]:text-base`,e),...n})}var UC=Eb(`group/field flex w-full gap-2 data-[invalid=true]:text-destructive`,{variants:{orientation:{vertical:`flex-col *:w-full [&>.sr-only]:w-auto`,horizontal:`flex-row items-center has-[>[data-slot=field-content]]:items-start *:data-[slot=field-label]:flex-auto has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px`,responsive:`flex-col *:w-full @md/field-group:flex-row @md/field-group:items-center @md/field-group:*:w-auto @md/field-group:has-[>[data-slot=field-content]]:items-start @md/field-group:*:data-[slot=field-label]:flex-auto [&>.sr-only]:w-auto @md/field-group:has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px`}},defaultVariants:{orientation:`vertical`}});function WC({className:e,orientation:t=`vertical`,...n}){return(0,W.jsx)(`div`,{role:`group`,"data-slot":`field`,"data-orientation":t,className:K(UC({orientation:t}),e),...n})}function GC({className:e,...t}){return(0,W.jsx)(`div`,{"data-slot":`field-content`,className:K(`group/field-content flex flex-1 flex-col gap-0.5 leading-snug`,e),...t})}function KC({className:e,...t}){return(0,W.jsx)(RC,{"data-slot":`field-label`,className:K(`group/field-label peer/field-label flex w-fit gap-2 leading-snug group-data-[disabled=true]/field:opacity-50 has-data-checked:border-primary/30 has-data-checked:bg-primary/5 has-[>[data-slot=field]]:rounded-lg has-[>[data-slot=field]]:border has-[>[data-slot=field]]:not-has-[:disabled,[data-disabled]]:hover:bg-muted/50 has-[>[data-slot=field]]:has-[:focus-visible]:border-ring has-[>[data-slot=field]]:has-[:focus-visible]:ring-3 has-[>[data-slot=field]]:has-[:focus-visible]:ring-ring/50 *:data-[slot=field]:p-2.5 dark:has-data-checked:border-primary/20 dark:has-data-checked:bg-primary/10`,`has-[>[data-slot=field]]:w-full has-[>[data-slot=field]]:flex-col`,e),...t})}function qC({className:e,...t}){return(0,W.jsx)(`p`,{"data-slot":`field-description`,className:K(`text-left text-sm leading-normal font-normal text-muted-foreground group-has-data-horizontal/field:text-balance [[data-variant=legend]+&]:-mt-1.5`,`last:mt-0 nth-last-2:-mt-1`,`[&>a]:underline [&>a]:underline-offset-4 [&>a:hover]:text-primary`,e),...t})}function JC({className:e,children:t,errors:n,...r}){let i=(0,U.useMemo)(()=>{if(t)return t;if(!n?.length)return null;let e=[...new Map(n.map(e=>[e?.message,e])).values()];return e?.length==1?e[0]?.message:(0,W.jsx)(`ul`,{className:`ml-4 flex list-disc flex-col gap-1`,children:e.map((e,t)=>e?.message&&(0,W.jsx)(`li`,{children:e.message},t))})},[t,n]);return i?(0,W.jsx)(`div`,{role:`alert`,"data-slot":`field-error`,className:K(`text-sm font-normal text-destructive`,e),...r,children:i}):null}function YC({controlled:e,default:t,name:n,state:r=`value`}){let{current:i}=U.useRef(e!==void 0),[a,o]=U.useState(()=>t);return[i&&e!==void 0?e:a,U.useCallback(e=>{i||o(e)},[])]}var XC={clipPath:`inset(50%)`,overflow:`hidden`,whiteSpace:`nowrap`,border:0,padding:0,width:1,height:1,margin:-1},ZC={...XC,position:`fixed`,margin:0,top:0,left:0},QC={...XC,position:`absolute`};function $C(e){if(!e)return null;for(let t of e.elements){let e=t.tagName;if(e===`BUTTON`||e===`INPUT`){let e=t;if(e.type===`submit`)return e}}return null}var ew=`data-checked`,tw=`data-unchecked`;function nw(e){return{checked(t){return e.indeterminate?{}:t?{[ew]:``}:{[tw]:``}},...Pb}}var rw=U.createContext(void 0);function iw(){return U.useContext(rw)}var aw=U.createContext(void 0);function ow(){let e=U.useContext(aw);if(e===void 0)throw Error(Zi(14));return e}var sw=`data-parent`,cw=U.forwardRef(function(e,t){let{checked:n,className:r,defaultChecked:i=!1,"aria-labelledby":a,disabled:o=!1,form:s,id:c,indeterminate:l=!1,inputRef:u,name:d,onCheckedChange:f,parent:p=!1,readOnly:m=!1,render:h,required:g=!1,uncheckedValue:_,value:v,nativeButton:y=!1,style:b,...x}=e,{clearErrors:S}=zb(),{disabled:C,name:w,setDirty:T,setFilled:E,setTouched:D,state:O,validationMode:k,validityData:A,validation:j}=Lb(),M=rC(),{labelId:N,registerControlId:P,getDescriptionProps:F}=qb(),I=iw(),L=I?.allValues===void 0?void 0:I.parent,R=L!==void 0,z=C||M.disabled||I?.disabled||o,B=w??d,ee=v??B,V=Gb(),te=I?.registerControlId!==P,ne=Zb({id:c||void 0,enabled:te}),H=y?ne:V,re={};R&&(p?re=L.getParentProps():ee!==void 0&&(re=L.getChildProps(ee)));let{checked:ie=n,indeterminate:ae=l,onCheckedChange:oe,...se}=re,ce=I?.value,le=U.useRef(null),ue=iC(z,le),{getButtonProps:de,buttonRef:fe}=vb({disabled:z,native:y}),pe=I?.validation??j,[G,me]=YC({controlled:ee!==void 0&&ce!==void 0&&!p?ce.includes(ee):ie,default:i,name:`Checkbox`,state:`checked`}),he=R?!!ie:G,ge=R&&ae||l;aC(le,V,G,void 0,!I&&!z,d);let _e=L?.registerChildId,ve=U.useRef(null),ye=pe.registerInput,be=I?ee:void 0,xe=U.useCallback(e=>ye(e,{controlRef:le,value:be}),[ye,be]),Se=pi(u,ve,p?void 0:xe),Ce=Jb(a,N,ve,!y,ne,x[`aria-label`]);J(()=>{ve.current&&(ve.current.indeterminate=ge),I||E(G)},[G,ge,I,E]),oC(G,()=>{I||(S(B),T(G!==A.initialValue),pe.change(G))});let we=Ai({checked:G,disabled:z,form:s,name:p?void 0:B,id:y?void 0:ne,required:g,ref:Se,style:B?QC:ZC,tabIndex:-1,type:`checkbox`,"aria-hidden":!0,onChange(e){if(e.nativeEvent.defaultPrevented)return;if(m){e.preventDefault();return}let t=e.currentTarget.checked,n=$(cC,e.nativeEvent);if(f?.(t,n),!n.isCanceled&&(oe?.(t,n),!n.isCanceled&&(me(t),ee!==void 0&&I!==void 0&&!p&&!R))){let e=t?[...I.value,ee]:I.value.filter(e=>e!==ee);I.setValue(e,n)}},onClick(e){e.stopPropagation()},onFocus(){le.current?.focus()}},v===void 0?Ti:{value:(I?G&&v:v)||``},F,e=>pe.getValidationProps(z,e));U.useEffect(()=>{if(!L||ee===void 0)return;let e=L.disabledStatesRef.current;return e.set(ee,z),()=>{e.delete(ee)}},[L,z,ee]);let Te=U.useMemo(()=>({...O,checked:he,disabled:z,readOnly:m,required:g,indeterminate:ge}),[O,he,z,m,g,ge]),Ee=nw(Te),De=Ui(`span`,e,{state:Te,ref:[fe,le,t],props:[{id:H,role:`checkbox`,"aria-checked":ge?`mixed`:he,"aria-readonly":m||void 0,"aria-required":g||void 0,"aria-labelledby":Ce,[sw]:p?``:void 0,onFocus(){ue(!0)},onBlur(){let e=ve.current;e&&(D(!0),ue(!1),k===`onBlur`&&pe.commit(I?ce:e.checked))},onKeyDown(e){if(e.key!==`Enter`||(e.preventBaseUIHandler(),e.defaultPrevented))return;let t=ve.current?.form??null,n=e.currentTarget,r=e.nativeEvent,i=e.preventDefault,a=r.preventDefault,o=!1;e.preventDefault=()=>{o=!0,i.call(e)},r.preventDefault=()=>{o=!0,a.call(r)},a.call(r),Wy(n).queueMicrotask(()=>{e.preventDefault=i,r.preventDefault=a,o||$C(t)?.click()})},onClick(e){if(m||z)return;e.preventDefault();let t=ve.current;t&&_b(t,e)}},x,se,de,F,e=>pe.getValidationProps(z,e)],stateAttributesMapping:Ee}),Oe=De.props.id;return J(()=>{if(_e&&!p&&ee!==void 0&&Oe!==void 0)return _e(ee,Oe)},[_e,p,ee,Oe]),(0,W.jsxs)(aw.Provider,{value:Te,children:[De,!G&&!I&&B&&!p&&_!==void 0&&(0,W.jsx)(`input`,{type:`hidden`,form:s,name:B,value:_,disabled:z}),(0,W.jsx)(`input`,{...we,suppressHydrationWarning:!0})]})}),lw=U.forwardRef(function(e,t){let{render:n,className:r,style:i,keepMounted:a=!1,...o}=e,s=ow(),c=s.checked||s.indeterminate,{mounted:l,transitionStatus:u,setMounted:d}=Ca(c),f=U.useRef(null),p={...s,transitionStatus:u};ya({batch:!0,enabled:!c,open:c,ref:f,onComplete(){c||d(!1)}});let m={...nw(s),...Sa},h=a||l,g=Ui(`span`,e,{ref:[t,f],state:p,stateAttributesMapping:m,props:o});return h?g:null});function uw({className:e,...t}){return(0,W.jsx)(cw,{"data-slot":`checkbox`,className:K(`peer relative flex size-4 shrink-0 items-center justify-center rounded-[4px] border border-input transition-colors outline-none group-has-disabled/field:opacity-50 group-has-[:focus-visible]/field-label:ring-0 group-has-[:focus-visible]/field-label:not-data-checked:border-input after:absolute after:-inset-x-3 after:-inset-y-2 focus-visible:border-transparent focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 aria-invalid:aria-checked:border-primary dark:bg-input/30 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 data-checked:border-primary data-checked:bg-primary data-checked:text-primary-foreground group-has-[:focus-visible]/field-label:data-checked:border-primary dark:data-checked:bg-primary`,e),...t,children:(0,W.jsx)(lw,{"data-slot":`checkbox-indicator`,className:`grid place-content-center text-current transition-none data-checked:animate-in data-checked:zoom-in-50 data-checked:duration-150 motion-reduce:animate-none [&>svg]:size-3.5`,children:t.indeterminate?(0,W.jsx)(kn,{}):(0,W.jsx)(Qt,{})})})}function dw({className:e,...t}){return(0,W.jsx)(`kbd`,{"data-slot":`kbd`,className:K(`pointer-events-none inline-flex h-5 w-fit min-w-5 items-center justify-center gap-1 rounded-[5px] border border-border bg-background px-1.5 font-sans text-[11px] font-medium text-muted-foreground shadow-[inset_0_-1.5px_0_var(--border)] select-none dark:bg-muted/40 [&_svg:not([class*='size-'])]:size-3`,e),...t})}function fw({className:e,...t}){return(0,W.jsx)(`kbd`,{"data-slot":`kbd-group`,className:K(`inline-flex items-center gap-1`,e),...t})}function pw(e){let t=U.useRef(!0);t.current&&(t.current=!1,e())}function mw(e){let[t,n]=U.useState({current:e,previous:null});return Object.is(e,t.current)||n({current:e,previous:t.current}),t.previous}function hw(e){return e==null||e.hasAttribute(`disabled`)||e.getAttribute(`aria-disabled`)===`true`}function gw(e){let t=fi(_w,e).current;return t.next=e,J(t.effect),t}function _w(e){let t={current:e,next:e,effect:()=>{t.current=t.next}};return t}var vw=[],yw=void 0;function bw(){return yw}function xw(e){vw.push(e)}function Sw(e){let t=(t,n)=>{let r=fi(ww).current,i;try{yw=r;for(let e of vw)e.before(r);i=e(t,n);for(let e of vw)e.after(r);r.didInitialize=!0}finally{yw=void 0}return i};return t.displayName=e.displayName||e.name,t}function Cw(e){return U.forwardRef(Sw(e))}function ww(){return{didInitialize:!1}}var Tw=bi(19)?Ow:kw;function Ew(e,t,n,r,i){return Tw(e,t,n,r,i)}function Dw(e,t,n,r,i){let a=U.useCallback(()=>t(e.getSnapshot(),n,r,i),[e,t,n,r,i]);return(0,Il.useSyncExternalStore)(e.subscribe,a,a)}xw({before(e){e.syncIndex=0,e.didInitialize||(e.syncTick=1,e.syncHooks=[],e.didChangeStore=!0,e.getSnapshot=()=>{let t=!1;for(let n=0;n<e.syncHooks.length;n+=1){let r=e.syncHooks[n],i=r.selector(r.store.state,r.a1,r.a2,r.a3);Object.is(r.value,i)||(t=!0,r.value=i)}return t&&(e.syncTick+=1),e.syncTick})},after(e){e.syncHooks.length>0&&(e.didChangeStore&&(e.didChangeStore=!1,e.subscribe=t=>{let n=new Set;for(let t of e.syncHooks)n.add(t.store);let r=[];for(let e of n)r.push(e.subscribe(t));return()=>{for(let e of r)e()}}),(0,Il.useSyncExternalStore)(e.subscribe,e.getSnapshot,e.getSnapshot))}});function Ow(e,t,n,r,i){let a=bw();if(!a)return Dw(e,t,n,r,i);let o=a.syncIndex;a.syncIndex+=1;let s;return a.didInitialize?(s=a.syncHooks[o],(s.store!==e||s.selector!==t||!Object.is(s.a1,n)||!Object.is(s.a2,r)||!Object.is(s.a3,i))&&(s.store!==e&&(a.didChangeStore=!0),s.store=e,s.selector=t,s.a1=n,s.a2=r,s.a3=i,s.value=t(e.getSnapshot(),n,r,i))):(s={store:e,selector:t,a1:n,a2:r,a3:i,value:t(e.getSnapshot(),n,r,i)},a.syncHooks.push(s)),s.value}function kw(e,t,n,r,i){return(0,Ll.useSyncExternalStoreWithSelector)(e.subscribe,e.getSnapshot,e.getSnapshot,e=>t(e,n,r,i))}var Aw=class{static create(e){return new this(e)}constructor(e){this.state=e,this.listeners=new Set,this.updateTick=0}subscribe=e=>(this.listeners.add(e),()=>{this.listeners.delete(e)});getSnapshot=()=>this.state;setState(e){if(this.state===e)return;this.state=e,this.updateTick+=1;let t=this.updateTick;for(let n of this.listeners){if(t!==this.updateTick)return;n(e)}}update(e){for(let t in e)if(!Object.is(this.state[t],e[t])){this.setState({...this.state,...e});return}}set(e,t){Object.is(this.state[e],t)||this.setState({...this.state,[e]:t})}notifyAll(){let e={...this.state};this.setState(e)}use(e,t,n,r){return Ew(this,e,t,n,r)}},jw=class extends Aw{constructor(e,t={},n){super(e),this.context=t,this.selectors=n}useSyncedValue(e,t){U.useDebugValue(e);let n=this;J(()=>{n.state[e]!==t&&n.set(e,t)},[n,e,t])}useSyncedValueWithCleanup(e,t){let n=this;J(()=>(n.state[e]!==t&&n.set(e,t),()=>{n.set(e,void 0)}),[n,e,t])}useSyncedValues(e){let t=this;J(()=>{t.update(e)},[t,...Object.values(e)])}useControlledProp(e,t){U.useDebugValue(e);let n=this,r=t!==void 0;J(()=>{r&&!Object.is(n.state[e],t)&&n.setState({...n.state,[e]:t})},[n,e,t,r])}select(e,t,n,r){let i=this.selectors[e];return i(this.state,t,n,r)}useState(e,t,n,r){return U.useDebugValue(e),Ew(this,this.selectors[e],t,n,r)}useContextCallback(e,t){U.useDebugValue(e);let n=q(t??Ci);this.context[e]=n}useStateSetter(e){let t=U.useRef(void 0);return t.current===void 0&&(t.current=t=>{this.set(e,t)}),t.current}observe(e,t){let n;n=typeof e==`function`?e:this.selectors[e];let r=n(this.state);return t(r,r,this),this.subscribe(e=>{let i=n(e);if(!Object.is(r,i)){let e=r;r=i,t(i,e,this)}})}};function Mw(...e){return()=>{for(let t=0;t<e.length;t+=1){let n=e[t];n&&n()}}}function Nw(e,t,n,r){return e.addEventListener(t,n,r),()=>{e.removeEventListener(t,n,r)}}function Pw(e,t){return t!=null&&!Xx(t)?0:typeof e==`function`?e():e}function Fw(e,t,n){let r=Pw(e,n);return typeof r==`number`?r:r?.[t]}function Iw(e){return typeof e==`function`?e():e}function Lw(e,t){return t||e===`click`||e===`mousedown`}function Rw(e){return e?.includes(`mouse`)&&e!==`mousedown`}var zw=U.createContext({hasProvider:!1,timeoutMs:0,delayRef:{current:0},initialDelayRef:{current:0},timeout:new Oa,currentIdRef:{current:null},currentContextRef:{current:null}});function Bw(e,t){e.current=t.current}function Vw(e){let{children:t,delay:n,timeoutMs:r=0}=e,i=U.useRef(n),a=U.useRef(n),o=U.useRef(null),s=U.useRef(null),c=ka();return J(()=>{a.current=n,o.current?i.current={open:Fw(i.current,`open`),close:Fw(n,`close`)}:i.current=n},[n,o,i,a]),(0,W.jsx)(zw.Provider,{value:U.useMemo(()=>({hasProvider:!0,delayRef:i,initialDelayRef:a,currentIdRef:o,timeoutMs:r,currentContextRef:s,timeout:c}),[r,c]),children:t})}function Hw(e,t={open:!1}){let{open:n}=t,r=e.useState(`floatingId`),{currentIdRef:i,delayRef:a,timeoutMs:o,initialDelayRef:s,currentContextRef:c,hasProvider:l,timeout:u}=U.useContext(zw),[d,f]=U.useState(!1),p=U.useRef(n);return J(()=>{p.current=n},[n]),J(()=>{function t(){c.current?.setIsInstantPhase(!1),i.current=null,c.current=null,a.current=s.current,u.clear()}if(i.current&&!n&&i.current===r){if(f(!1),o){let n=r;return u.start(o,()=>{e.select(`open`)||i.current&&i.current!==n||t()}),()=>{(p.current||i.current!==n)&&u.clear()}}t()}},[n,r,i,a,o,s,c,u,e]),J(()=>{if(!n)return;let t=c.current,o=i.current;u.clear(),c.current={onOpenChange:e.setOpen,setIsInstantPhase:f},i.current=r,a.current={open:0,close:Fw(s.current,`close`)},o!==null&&o!==r?(f(!0),t?.setIsInstantPhase(!0),t?.onOpenChange(!1,$(cC))):(f(!1),t?.setIsInstantPhase(!1))},[n,r,e,i,a,s,c,u]),J(()=>()=>{if(i.current===r){if(c.current=null,!p.current)return;i.current=null,Bw(a,s),u.clear()}},[c,i,a,r,s,u]),U.useMemo(()=>({activeIdRef:i,hasProvider:l,delayRef:a,isInstantPhase:d}),[i,l,a,d])}var Uw=U.forwardRef(function(e,t){let[n,r]=U.useState();J(()=>{ux&&lx&&r(`button`)},[]);let i={tabIndex:0,role:n};return(0,W.jsx)(`span`,{...e,ref:t,style:ZC,"aria-hidden":!n||void 0,...i,"data-base-ui-focus-guard":``})});function Ww(e){return`data-base-ui-${e}`}var Gw=0;function Kw(e,t={}){let{preventScroll:n=!1,sync:r=!1,shouldFocus:i}=t;cancelAnimationFrame(Gw);function a(){(!i||i())&&e?.focus({preventScroll:n})}if(r)return a(),Ci;let o=requestAnimationFrame(a);return Gw=o,()=>{Gw===o&&(cancelAnimationFrame(o),Gw=0)}}var qw=`data-base-ui-inert`,Jw=new WeakMap,Yw=new WeakSet,Xw=new WeakMap,Zw=0;function Qw(e){return e?Yy(e)?e.host:Qw(e.parentNode):null}var $w=(e,t)=>t.map(t=>{if(e.contains(t))return t;let n=Qw(t);return e.contains(n)?n:null}).filter(e=>e!=null),eT=e=>{let t=new Set;return e.forEach(e=>{let n=e;for(;n&&!t.has(n);)t.add(n),n=n.parentNode}),t},tT=(e,t,n)=>{let r=[],i=e=>{e&&!n.has(e)&&Array.from(e.children).forEach(e=>{Uy(e)!==`script`&&(t.has(e)?i(e):r.push(e))})};return i(e),r};function nT(e,t,n,{mark:r=!0}){let i=$w(t,e),a=r?tT(t,eT(i),new Set(i)):[],o=[],s=[];if(n){let e=$w(t,Array.from(t.querySelectorAll(`[aria-live]`))),n=i.concat(e);tT(t,eT(n),new Set(n)).forEach(e=>{let t=e.getAttribute(`aria-hidden`),n=t!==null&&t!==`false`,r=(Jw.get(e)||0)+1;Jw.set(e,r),o.push(e),r===1&&n&&Yw.add(e),n||e.setAttribute(`aria-hidden`,`true`)})}return r&&a.forEach(e=>{let t=(Xw.get(e)||0)+1;Xw.set(e,t),s.push(e),t===1&&e.setAttribute(qw,``)}),Zw+=1,()=>{o.forEach(e=>{let t=(Jw.get(e)||0)-1;Jw.set(e,t),t||(Yw.has(e)||e.removeAttribute(`aria-hidden`),Yw.delete(e))}),r&&s.forEach(e=>{let t=(Xw.get(e)||0)-1;Xw.set(e,t),t||e.removeAttribute(qw)}),--Zw,Zw||(Jw=new WeakMap,Yw=new WeakSet,Xw=new WeakMap)}}function rT(e,t={}){let{ariaHidden:n=!1,mark:r=!0}=t,i=gb(e[0]).body;return nT(e,i,n,{mark:r})}var iT={style:{transition:`none`}},aT=`data-base-ui-click-trigger`,oT={fallbackAxisSide:`none`},sT={fallbackAxisSide:`end`},cT={clipPath:`inset(50%)`,position:`fixed`,top:0,left:0},lT=U.createContext(null),uT=()=>U.useContext(lT),dT=Ww(`portal`);function fT(e={}){let{ref:t,container:n,componentProps:r=Ti,elementProps:i}=e,a=Wb(),o=uT()?.portalNode,[s,c]=U.useState(null),[l,u]=U.useState(null),d=q(e=>{e!==null&&u(e)}),f=U.useRef(null);J(()=>{if(n===null){f.current&&(f.current=null,u(null),c(null));return}let e=(n&&(Ky(n)?n:n.current))??o??document.body;e==null?f.current&&(f.current=null,u(null),c(null)):f.current!==e&&(f.current=e,u(null),c(e))},[n,o]);let p=Ui(`div`,r,{ref:[t,d],props:[{id:a,[dT]:``},i]}),m=s&&p?oe.createPortal(p,s):null;return{node:l,nodeId:U.isValidElement(p)?p.props.id:void 0,subtree:m}}var pT=U.forwardRef(function(e,t){let{render:n,className:r,style:i,children:a,container:o,portalOwnerRole:s,...c}=e,{node:l,nodeId:u,subtree:d}=fT({container:o,ref:t,componentProps:e,elementProps:c}),f=U.useRef(null),p=U.useRef(null),m=U.useRef(null),h=U.useRef(null),[g,_]=U.useState(null),v=U.useRef(!1),y=g?.modal,b=g?.open,x=!!g&&!g.modal&&g.open&&!!l;U.useEffect(()=>{if(!l||y)return;function e(e){l&&e.relatedTarget&&$S(e)&&(e.type===`focusin`?v.current&&=(tC(l),!1):(eC(l),v.current=!0))}return Mw(Nw(l,`focusin`,e,!0),Nw(l,`focusout`,e,!0))},[l,y]),J(()=>{l&&b===!0&&v.current&&(tC(l),v.current=!1)},[b,l]);let S=U.useMemo(()=>({beforeOutsideRef:f,afterOutsideRef:p,beforeInsideRef:m,afterInsideRef:h,portalNode:l,setFocusManagerState:_}),[l]);return(0,W.jsxs)(U.Fragment,{children:[d,(0,W.jsxs)(lT.Provider,{value:S,children:[x&&l&&(0,W.jsx)(Uw,{"data-type":`outside`,ref:f,onFocus:e=>{$S(e,l)?m.current?.focus():ZS(g?g.domReference:null)?.focus()}}),x&&l&&(0,W.jsx)(`span`,{role:s,"aria-owns":u,style:cT}),l&&oe.createPortal(a,l),x&&l&&(0,W.jsx)(Uw,{"data-type":`outside`,ref:p,onFocus:e=>{$S(e,l)?h.current?.focus():(XS(g?g.domReference:null)?.focus(),g?.closeOnFocusOut&&g?.onOpenChange(!1,$(`focus-out`,e.nativeEvent)))}})]})]})});function mT(){let e=new Map;return{emit(t,n){e.get(t)?.forEach(e=>e(n))},on(t,n){e.has(t)||e.set(t,new Set),e.get(t).add(n)},off(t,n){e.get(t)?.delete(n)}}}var hT=class{nodesRef={current:[]};events=mT();addNode(e){this.nodesRef.current.push(e)}removeNode(e){let t=this.nodesRef.current.findIndex(t=>t===e);t!==-1&&this.nodesRef.current.splice(t,1)}},gT=U.createContext(null),_T=U.createContext(null),vT=()=>U.useContext(gT)?.id||null,yT=e=>{let t=U.useContext(_T);return e??t};function bT(e){let t=Wb(),n=yT(e),r=vT();return J(()=>{if(!t)return;let e={id:t,parentId:r};return n?.addNode(e),()=>{n?.removeNode(e)}},[n,t,r]),t}function xT(e){let{children:t,id:n}=e,r=vT();return(0,W.jsx)(gT.Provider,{value:U.useMemo(()=>({id:n,parentId:r}),[n,r]),children:t})}function ST(e){let{children:t,externalTree:n}=e,r=fi(()=>n??new hT).current;return(0,W.jsx)(_T.Provider,{value:r,children:t})}function CT(e,t){let n=Wy(mx(e));return e instanceof n.KeyboardEvent?`keyboard`:e instanceof n.FocusEvent?t||`keyboard`:`pointerType`in e?e.pointerType||(Jx(e)?`keyboard`:t||`mouse`):`touches`in e?`touch`:e instanceof n.MouseEvent?t||(e.detail===0?`keyboard`:`mouse`):``}var wT=20,TT=[];function ET(){TT=TT.filter(e=>e.deref()?.isConnected)}function DT(e){ET(),e&&Uy(e)!==`body`&&(TT.push(new WeakRef(e)),TT.length>wT&&(TT=TT.slice(-20)))}function OT(){return ET(),TT[TT.length-1]?.deref()}function kT(e){return e?KS(e)?e:JS(e)[0]||e:null}function AT(e){if(e.hasAttribute(`tabindex`)&&!e.hasAttribute(`data-tabindex`)||!e.getAttribute(`role`)?.includes(`dialog`))return;let t=qS(e).filter(e=>{let t=e.getAttribute(`data-tabindex`)||``;return KS(e)||e.hasAttribute(`data-tabindex`)&&!t.startsWith(`-`)}),n=e.getAttribute(`tabindex`);t.length===0?n!==`0`&&(e.setAttribute(`tabindex`,`0`),e.setAttribute(`data-tabindex`,`0`)):(n!==`-1`||e.hasAttribute(`data-tabindex`)&&e.getAttribute(`data-tabindex`)!==`-1`)&&(e.setAttribute(`tabindex`,`-1`),e.setAttribute(`data-tabindex`,`-1`))}function jT(e){let{context:t,children:n,disabled:r=!1,initialFocus:i=!0,returnFocus:a=!0,explicitReturnFocus:o,restoreFocus:s=!1,modal:c=!0,closeOnFocusOut:l=!0,openInteractionType:u=``,nextFocusableElement:d,previousFocusableElement:f,beforeContentFocusGuardRef:p,externalTree:m,getInsideElements:h}=e,g=t.useState(`open`),_=t.useState(`domReferenceElement`),v=t.useState(`floatingElement`),{events:y,dataRef:b}=t.context,x=q(()=>b.current.floatingContext?.nodeId),S=i===!1,C=Vx(_)&&S,w=gw(i),T=gw(a),E=gw(o),D=gw(u),O=gw(g),k=yT(m),A=uT(),j=U.useRef(!1),M=U.useRef(!1),N=U.useRef(!1),P=U.useRef(null),F=U.useRef(``),I=U.useRef(``),L=U.useRef(null),R=U.useRef(null),z=pi(L,p,A?.beforeInsideRef),B=pi(R,A?.afterInsideRef),ee=ka(),V=ka(),te=da(),ne=A!=null,H=Ux(v),re=q((e=H)=>e?JS(e):[]),ie=q(()=>h?.().filter(e=>e!=null)??[]);U.useEffect(()=>{if(r||!c)return;function e(e){e.key===`Tab`&&Q(H,fx(gb(H)))&&re().length===0&&!C&&Kx(e)}return Nw(gb(H),`keydown`,e)},[r,H,c,C,re]),U.useEffect(()=>{if(r||!g)return;let e=gb(H);function t(){N.current=!1}function n(e){let t=mx(e),n=ie(),r=Q(v,t)||Q(_,t)||Q(A?.portalNode,t)||n.some(e=>e===t||Q(e,t));N.current=!r,I.current=e.pointerType||`keyboard`,px(t,`[data-base-ui-click-trigger]`)&&(M.current=!0,V.start(0,()=>{M.current=!1}))}function i(){I.current=`keyboard`}return Mw(Nw(e,`pointerdown`,n,!0),Nw(e,`pointerup`,t,!0),Nw(e,`pointercancel`,t,!0),Nw(e,`keydown`,i,!0),t)},[r,v,_,H,g,A,V,ie]),U.useEffect(()=>{if(r||!l)return;let e=gb(H);function n(){M.current=!0,V.start(0,()=>{M.current=!1})}function i(e){let t=mx(e);KS(t)&&(P.current=t)}function a(n){let r=n.relatedTarget,i=n.currentTarget,a=mx(n);c&&r==null&&a!=null&&Q(v,a)&&DT(a),queueMicrotask(()=>{let o=x(),l=t.context.triggerElements,u=ie(),p=r?.hasAttribute(Ww(`focus-guard`))&&[L.current,R.current,A?.beforeInsideRef.current,A?.afterInsideRef.current,A?.beforeOutsideRef.current,A?.afterOutsideRef.current,fa(f),fa(d)].includes(r),m=!(Q(_,r)||Q(v,r)||Q(r,v)||Q(A?.portalNode,r)||u.some(e=>e===r||Q(e,r))||l.hasMatchingElement(e=>Q(e,r))||p||k&&(Wx(k.nodesRef.current,o).find(e=>Q(e.context?.elements.floating,r)||Q(e.context?.elements.domReference,r))||Gx(k.nodesRef.current,o).find(e=>[e.context?.elements.floating,Ux(e.context?.elements.floating)].includes(r)||e.context?.elements.domReference===r)));if(i===_&&H&&AT(H),s&&i!==_&&!MS(a)&&fx(e)===e.body){if(Jy(H)&&(H.focus(),s===`popup`)){te.request(()=>{H.focus()});return}let e=re(),t=P.current,n=(t&&e.includes(t)?t:null)||e[e.length-1]||H;Jy(n)&&n.focus()}b.current.insideReactTree?b.current.insideReactTree=!1:(C||!c)&&r&&m&&!M.current&&(C||r!==OT())&&(j.current=!0,t.setOpen(!1,$(hC,n)))})}function o(){N.current||(b.current.insideReactTree=!0,ee.start(0,()=>{b.current.insideReactTree=!1}))}let u=Jy(_)?_:null;if(v||u)return Mw(u&&Nw(u,`focusout`,a),u&&Nw(u,`pointerdown`,n),v&&Nw(v,`focusin`,i),v&&Nw(v,`focusout`,a),v&&A&&Nw(v,`focusout`,o,!0))},[r,_,v,H,c,k,A,t,l,s,re,C,x,b,ee,V,te,d,f,ie]),U.useEffect(()=>{if(r||!v||!g)return;let e=Array.from(A?.portalNode?.querySelectorAll(`[${Ww(`portal`)}]`)||[]),t=(k?Gx(k.nodesRef.current,x()):[]).find(e=>Vx(e.context?.elements.domReference||null))?.context?.elements.domReference,n=rT([v,...e,L.current,R.current,A?.beforeOutsideRef.current,A?.afterOutsideRef.current,...ie(),t,fa(f),fa(d),C?_:null].filter(e=>e!=null),{ariaHidden:c||C,mark:!1}),i=rT([v,...e].filter(e=>e!=null));return()=>{i(),n()}},[g,r,_,v,c,A,C,k,x,d,f,ie]),J(()=>{if(!g||r||!Jy(H))return;F.current=``,I.current=``;let e=gb(H),t=fx(e);queueMicrotask(()=>{let n=w.current,r=typeof n==`function`?n(D.current||``):n;if(r===void 0||r===!1||Q(H,t))return;let i=null,a=()=>(i??=re(H),i[0]||H),o;o=r===!0||r===null?a():fa(r),o||=a();let s=Q(H,fx(e)),c=b.current.openEvent,l=c?.type===`mousedown`&&Jx(c);Kw(o,{sync:l,preventScroll:o===H,shouldFocus(){if(!O.current)return!1;if(s)return!0;let t=fx(e);return!(t!==o&&Q(H,t))}})})},[r,g,H,re,w,D,O,b]);let ae=U.useRef(null);J(()=>{if(r||!H){ae.current=null;return}ae.current&&=(ae.current.cancelled=!0,null);let e=gb(H),t=fx(e),n=D.current==null;DT(t);function i(e){if(e.open||(F.current=CT(e.nativeEvent,I.current)),(e.reason===`focus-out`&&e.triggerElement?.hasAttribute(Ww(`focus-guard`))||e.reason===`trigger-hover`&&e.nativeEvent.type===`mouseleave`)&&(j.current=!0),e.reason===`outside-press`){if(e.nested)j.current=!1;else if(Jx(e.nativeEvent)||Yx(e.nativeEvent))j.current=!1;else{let e=!1;gb(H).createElement(`div`).focus({get preventScroll(){return e=!0,!1}}),e?j.current=!1:j.current=!0}}}y.on(`openchange`,i);function a(e){let r=T.current,i=typeof r==`function`?r(e):r;if(i===void 0||i===!1)return null;i===null&&(i=!0);let a=_?.isConnected?_:null,o=t?.isConnected&&Uy(t)!==`body`?t:null,s=n?o||a:a||o;return s||=OT()||null,typeof i==`boolean`?s:fa(i)||s||null}return()=>{y.off(`openchange`,i);let t=fx(e),n=ie(),r=Q(v,t)||n.some(e=>e===t||Q(e,t))||k&&Wx(k.nodesRef.current,x(),!1).some(e=>Q(e.context?.elements.floating,t)),o=T.current,s=F.current,c=a(s),l={cancelled:!1};ae.current=l,queueMicrotask(()=>{ae.current===l&&(ae.current=null);let n=kT(c),i=E.current??typeof o!=`boolean`;if(!l.cancelled&&o&&!j.current&&Jy(n)&&(i||n===t||t===e.body||r)){let e={preventScroll:!0};s===`keyboard`&&(e.focusVisible=!0),n.focus(e)}j.current=!1})}},[r,v,H,T,E,D,y,k,_,x,ie]),J(()=>{if(!lx||g||!v)return;let e=fx(gb(v));Jy(e)&&zx(e)&&Q(v,e)&&e.blur()},[g,v]),J(()=>{if(!r&&A)return A.setFocusManagerState({modal:c,closeOnFocusOut:l,open:g,onOpenChange:t.setOpen,domReference:_}),()=>{A.setFocusManagerState(null)}},[r,A,c,g,t,l,_]),J(()=>{if(!r&&H)return AT(H),()=>{queueMicrotask(ET)}},[r,H]);let oe=!r&&(!c||!C)&&(ne||c);return(0,W.jsxs)(U.Fragment,{children:[oe&&(0,W.jsx)(Uw,{"data-type":`inside`,ref:z,onFocus:e=>{if(c){let e=re();Kw(e[e.length-1])}else A?.portalNode&&(j.current=!1,$S(e,A.portalNode)?XS(_)?.focus():fa(f??A.beforeOutsideRef)?.focus())}}),n,oe&&(0,W.jsx)(Uw,{"data-type":`inside`,ref:B,onFocus:e=>{c?Kw(re()[0]):A?.portalNode&&(l&&(j.current=!0),$S(e,A.portalNode)?ZS(_)?.focus():fa(d??A.afterOutsideRef)?.focus())}})]})}function MT(e,t={}){let{enabled:n=!0,event:r=`click`,toggle:i=!0,ignoreMouse:a=!1,stickIfOpen:o=!0,touchOpenDelay:s=0,reason:c=lC}=t,l=e.context.dataRef,u=U.useRef(void 0),d=da(),f=ka(),p=U.useMemo(()=>{function t(t,n,r,i){let a=$(c,n,r);t&&i===`touch`&&s>0?f.start(s,()=>{e.setOpen(!0,a)}):e.setOpen(t,a)}function n(t,n,r){let a=l.current.openEvent,s=e.select(`domReferenceElement`)!==n;return t&&s||!t||!i?!0:a&&(typeof o==`function`?o():o)?!r(a.type):!1}return{onPointerDown(e){u.current=Xx(e.pointerType,!0)&&Yx(e.nativeEvent)?`virtual`:e.pointerType},onMouseDown(i){let o=u.current,s=i.nativeEvent,c=e.select(`open`);if(i.button!==0||r===`click`||Xx(o,!0)&&a)return;let l=n(c,i.currentTarget,e=>e===`click`||e===`mousedown`),f=mx(s),p=zx(f);if(p||o===`virtual`){t(l,s,p?f:i.currentTarget,o);return}let m=i.currentTarget;d.request(()=>{t(l,s,m,o)})},onClick(i){if(r===`mousedown-only`)return;let o=u.current;r===`mousedown`&&o?u.current=void 0:Xx(o,!0)&&a||t(n(e.select(`open`),i.currentTarget,e=>e===`click`||e===`mousedown`||e===`keydown`||e===`keyup`),i.nativeEvent,i.currentTarget,o)},onKeyDown(){u.current=void 0}}},[l,r,a,c,e,o,i,d,f,s]);return U.useMemo(()=>n?{reference:p}:Ti,[n,p])}function NT(e,t){let n=null,r=null,i=!1;return{contextElement:e||void 0,getBoundingClientRect(){let a=e?.getBoundingClientRect()||{width:0,height:0,x:0,y:0},o=t.axis===`x`||t.axis===`both`,s=t.axis===`y`||t.axis===`both`,c=[`mouseenter`,`mousemove`].includes(t.dataRef.current.openEvent?.type||``)&&t.pointerType!==`touch`,l=t.axis===`y`?a.width:0,u=t.axis===`x`?a.height:0,d=a.x,f=a.y;return n==null&&t.x&&o&&(n=a.x-t.x),r==null&&t.y&&s&&(r=a.y-t.y),d-=n||0,f-=r||0,(!i||c)&&(d=o&&t.x!=null?t.x:d,f=s&&t.y!=null?t.y:f),i=!0,{width:l,height:u,x:d,y:f,top:f,right:d+l,bottom:f+u,left:d}}}}function PT(e){return e!=null&&e.clientX!=null}function FT(e,t={}){let{enabled:n=!0,axis:r=`both`}=t,i=e.useState(`open`),a=e.useState(`floatingElement`),o=e.useState(`domReferenceElement`),s=e.context.dataRef,c=U.useRef(!1),l=U.useRef(null),[u,d]=U.useState(),[f,p]=U.useState([]),m=q(t=>{e.set(`positionReference`,t)}),h=q((t,n,i)=>{c.current||(!s.current.openEvent||PT(s.current.openEvent))&&e.set(`positionReference`,NT(i??o,{x:t,y:n,axis:r,dataRef:s,pointerType:u}))}),g=q(e=>{i?l.current||(h(e.clientX,e.clientY,e.currentTarget),p([])):h(e.clientX,e.clientY,e.currentTarget)}),_=Xx(u)?a:i;U.useEffect(()=>{if(!n){m(o);return}if(!_)return;function e(){l.current?.(),l.current=null}let t=Wy(a);function r(t){let n=mx(t);Q(a,n)?e():h(t.clientX,t.clientY)}return!s.current.openEvent||PT(s.current.openEvent)?l.current=Nw(t,`mousemove`,r):m(o),e},[_,n,a,s,o,e,h,m,f]),U.useEffect(()=>()=>{e.set(`positionReference`,null)},[e]),U.useEffect(()=>{n&&!a&&(c.current=!1)},[n,a]),U.useEffect(()=>{!n&&i&&(c.current=!0)},[n,i]);let v=U.useMemo(()=>{function e(e){d(e.pointerType)}return{onPointerDown:e,onPointerEnter:e,onMouseMove:g,onMouseEnter:g}},[g]);return U.useMemo(()=>n?{reference:v,trigger:v}:{},[n,v])}function IT(){return!1}function LT(e){return{escapeKey:typeof e==`boolean`?e:e?.escapeKey??!1,outsidePress:typeof e==`boolean`?e:e?.outsidePress??!0}}function RT(e,t={}){let{enabled:n=!0,escapeKey:r=!0,outsidePress:i=!0,outsidePressEvent:a=`sloppy`,referencePress:o=IT,bubbles:s,externalTree:c}=t,l=e.useState(`open`),u=e.useState(`floatingElement`),{dataRef:d,events:f}=e.context,p=yT(c),m=q(typeof i==`function`?i:()=>!1),h=typeof i==`function`?m:i,g=h!==!1,_=q(()=>a),{escapeKey:v,outsidePress:y}=LT(s),b=U.useRef(!1),x=U.useRef(!1),S=U.useRef(!1),C=U.useRef(!1),w=U.useRef(!1),T=U.useRef(``),E=U.useRef(null),D=ka(),O=ka(),k=ka(),A=q(()=>{O.clear(),d.current.insideReactTree=!1}),j=q(e=>{let t=d.current.floatingContext?.nodeId;return(p?Wx(p.nodesRef.current,t):[]).some(t=>t.context?.open&&!t.context.dataRef.current[e])}),M=q(t=>Lx(t,e.select(`floatingElement`))||Lx(t,e.select(`domReferenceElement`))),N=q(t=>{o()&&e.setOpen(!1,$(lC,t.nativeEvent))}),P=q(t=>{if(!l||!n||!r||t.key!==`Escape`)return;let i=qx(t)?t.nativeEvent:t;if(w.current||i.isComposing||!v&&j(`__escapeKeyBubbles`))return;let a=$(gC,i);e.setOpen(!1,a),a.isCanceled||t.preventDefault(),!v&&!a.isPropagationAllowed&&t.stopPropagation()}),F=q(()=>{d.current.insideReactTree=!0,O.start(0,A)}),I=q(t=>{if(!l||!n||t.button!==0)return;let r=mx(t.nativeEvent);Q(e.select(`floatingElement`),r)&&(b.current||(b.current=!0,x.current=!1))}),L=q(e=>{l&&n&&(e.defaultPrevented||e.nativeEvent.defaultPrevented)&&b.current&&(x.current=!0)});U.useEffect(()=>{function e(e){e.open||(C.current=!1)}return f.on(`openchange`,e),()=>{f.off(`openchange`,e)}},[f]),U.useEffect(()=>A,[A]),U.useEffect(()=>{if(!l||!n)return l||(C.current=!1,w.current=!1,T.current=``,E.current=null),A;d.current.__escapeKeyBubbles=v,d.current.__outsidePressBubbles=y;let t=new Oa,i=gb(u);function a(){k.clear(),w.current=!0}function o(){w.current=!0,k.start(lx?5:0,()=>{w.current=!1})}function s(){S.current=!0,t.start(0,()=>{S.current=!1})}function c(){b.current=!1,x.current=!1}function f(){let e=T.current,t=e===`pen`||!e?`mouse`:e,n=_(),r=typeof n==`function`?n():n;return typeof r==`string`?r:r[t]}function m(e){let t=f();return t===`intentional`&&e.type!==`click`||t===`sloppy`&&e.type===`click`}function O(e){let t=d.current.floatingContext?.nodeId,n=p&&Wx(p.nodesRef.current,t).some(t=>Lx(e,t.context?.elements.floating));return M(e)||n}function N(n){if(m(n)){n.type!==`click`&&!M(n)&&(t.clear(),S.current=!1),A();return}if(d.current.insideReactTree){A();return}let r=mx(n),i=`[${Ww(`inert`)}]`,a=qy(r)?r.getRootNode():null,o=Array.from((Yy(a)?a:gb(e.select(`floatingElement`))).querySelectorAll(i)),s=e.context.triggerElements;if(r&&(s.hasElement(r)||s.hasMatchingElement(e=>Q(e,r))))return;let c=qy(r)?r:null;for(;c&&!ob(c);){let e=lb(c);if(ob(e)||!qy(e))break;c=e}if(!(o.length&&qy(r)&&!Rx(r)&&!Q(r,e.select(`floatingElement`))&&o.every(e=>!Q(c,e)))){if(Jy(r)&&!(`touches`in n)){let e=ob(r),t=sb(r),i=/auto|scroll/,a=e||i.test(t.overflowX),o=e||i.test(t.overflowY),s=a&&r.clientWidth>0&&r.scrollWidth>r.clientWidth,c=o&&r.clientHeight>0&&r.scrollHeight>r.clientHeight,l=t.direction===`rtl`,u=c&&(l?n.offsetX<=r.offsetWidth-r.clientWidth:n.offsetX>r.clientWidth),d=s&&n.offsetY>r.clientHeight;if(u||d)return}if(!O(n)){if(f()===`intentional`){if(n.detail!==0&&!Jx(n)&&!C.current)return;if(S.current){t.clear(),S.current=!1;return}}(typeof h!=`function`||h(n))&&(j(`__outsidePressBubbles`)||(e.setOpen(!1,$(fC,n)),A()))}}}function F(t){f()===`sloppy`&&t.pointerType!==`touch`&&e.select(`open`)&&n&&!M(t)&&N(t)}function I(t){if(f()!==`sloppy`||!e.select(`open`)||!n||M(t))return;let r=t.touches[0];r&&(E.current={startTime:Date.now(),startX:r.clientX,startY:r.clientY,dismissOnTouchEnd:!1,dismissOnMouseDown:!0},D.start(1e3,()=>{E.current&&(E.current.dismissOnTouchEnd=!1,E.current.dismissOnMouseDown=!1)}))}function L(e,t){let n=mx(e);if(!n)return;let r=Nw(n,e.type,()=>{t(e),r()})}function R(e){T.current=`touch`,L(e,I)}function z(e){D.clear(),e.type===`pointerdown`&&(e.button===0&&(C.current=!0),T.current=e.pointerType),(e.type!==`mousedown`||!E.current||E.current.dismissOnMouseDown)&&L(e,e=>{e.type===`pointerdown`?F(e):N(e)})}function B(e){if(e.type===`pointercancel`&&(C.current=!1),!b.current)return;let n=x.current;c(),f()===`intentional`&&(e.type===`pointercancel`?n&&s():O(e)||(n?s():(typeof h!=`function`||h(e))&&(t.clear(),S.current=!0,A())))}function ee(e){if(f()!==`sloppy`||!E.current||M(e))return;let t=e.touches[0];if(!t)return;let n=Math.abs(t.clientX-E.current.startX),r=Math.abs(t.clientY-E.current.startY),i=Math.sqrt(n*n+r*r);i>5&&(E.current.dismissOnTouchEnd=!0),i>10&&(N(e),D.clear(),E.current=null)}function V(e){L(e,ee)}function te(e){f()===`sloppy`&&E.current&&!M(e)&&(E.current.dismissOnTouchEnd&&N(e),D.clear(),E.current=null)}function ne(e){L(e,te)}let H=Mw(r&&Mw(Nw(i,`keydown`,P),Nw(i,`compositionstart`,a),Nw(i,`compositionend`,o)),g&&Mw(Nw(i,`click`,z,!0),Nw(i,`pointerdown`,z,!0),Nw(i,`pointerup`,B,!0),Nw(i,`pointercancel`,B,!0),Nw(i,`mousedown`,z,!0),Nw(i,`mouseup`,B,!0),Nw(i,`touchstart`,R,{capture:!0,passive:!0}),Nw(i,`touchmove`,V,{capture:!0,passive:!0}),Nw(i,`touchend`,ne,{capture:!0,passive:!0})));return()=>{H(),t.clear(),c(),S.current=!1}},[d,u,r,g,h,l,n,v,y,P,A,_,j,M,p,e,D,k]);let R=U.useMemo(()=>({onKeyDown:P,onPointerDown:N,onClick:N}),[P,N]),z=U.useMemo(()=>({onKeyDown:P,onPointerDown:L,onMouseDown:L,onClickCapture:F,onMouseDownCapture(e){F(),I(e)},onPointerDownCapture(e){F(),I(e)},onMouseUpCapture:F,onTouchEndCapture:F,onTouchMoveCapture:F}),[P,F,I,L]);return U.useMemo(()=>n?{reference:R,floating:z,trigger:R}:{},[n,R,z])}function zT(e){let{popupStore:t,treatPopupAsFloatingElement:n=!1,floatingRootContext:r,floatingId:i,nested:a,onOpenChange:o}=e,s=t.useState(`open`),c=t.useState(`activeTriggerElement`),l=t.useState(n?`popupElement`:`positionerElement`),u=o;return t.useSyncedValue(`floatingId`,i),J(()=>{let e={open:s,floatingId:i,referenceElement:c,floatingElement:l};qy(c)&&(e.domReferenceElement=c),r.state.positionReference===r.state.referenceElement&&(e.positionReference=c),r.update(e)},[s,i,c,l,r]),r.context.onOpenChange=u,r.context.nested=a,r}function BT(e){let{open:t,ref:n,preventUnmountOnClose:r,setPreventUnmountOnClose:i,onUnmount:a,animateInitialOpen:o}=e,s=q(i),{mounted:c,setMounted:l,transitionStatus:u}=Ca(t,!1,!1,o),d=!t&&r;J(()=>{t&&s(!1)},[t,s]);let f=U.useRef(c),p=U.useRef(!1),m=Bb(),h=()=>{f.current=!1,l(!1),a()};J(()=>{f.current=c,p.current&&(p.current=!1,!t&&c&&h())});let g=q(()=>{f.current&&(t?(p.current=!0,m()):h())});return ya({enabled:c&&!t&&!d,open:t,ref:n,onComplete(){t||g()}}),{mounted:c,transitionStatus:u,preventUnmountingOnClose:d,forceUnmount:g}}var VT={tabIndex:-1,[hx]:``};function HT(e){return t=>t!==`touch`||e.current}function UT(e,t=!1){let n=Wb(),r=vT()!=null,i=fi(()=>e(n,r)).current;return zT({popupStore:i,treatPopupAsFloatingElement:t,floatingRootContext:i.state.floatingRootContext,floatingId:n,nested:r,onOpenChange:i.setOpen}),i}function WT({handle:e,store:t}){return J(()=>e.attachStore(t),[e,t]),null}function GT(e){let t=e.context.triggerElements.size;e.select(`open`)&&e.state.triggerCount!==t&&e.set(`triggerCount`,t)}function KT(e,t){let n=U.useRef(null);return q(r=>{let i=n.current;if(i!==null){if(i.element===r&&i.store===t&&i.id===e)return;n.current=null;let a=i.store;a.context.triggerElements.getById(i.id)===i.element&&(a.context.triggerElements.delete(i.id),GT(a))}r!==null&&e!==void 0&&(n.current={store:t,id:e,element:r},t.context.triggerElements.add(e,r),GT(t))})}function qT(e,t,n,r=!1){let i=e.preventUnmountingOnClose;t?i=!1:r&&(i=!0);let a=n?.id??null,o=e.activeTriggerId,s=e.activeTriggerElement;return(a||t)&&(o=a,s=n??null),{open:t,preventUnmountingOnClose:i,activeTriggerId:o,activeTriggerElement:s,openedWithoutTrigger:t?n==null:e.openedWithoutTrigger}}function JT(e){let t=!1;return e.preventUnmountOnClose=()=>{t=!0},()=>t}function YT(e,t,n,r={}){let i=n.reason,a=i===uC,o=t&&i===`trigger-focus`,s=!t&&(i===`trigger-press`||i===`escape-key`),c=JT(n);if(e.context.onOpenChange?.(t,n),n.isCanceled)return;r.onBeforeDispatch?.(),e.state.floatingRootContext.dispatchOpenChange(t,n);let l=()=>{let i=qT(e.state,t,n.trigger,c()),l={...r.extraState,...i};o?l.instantType=`focus`:s?l.instantType=`dismiss`:a&&(l.instantType=void 0),e.update(l)};a?oe.flushSync(l):l()}function XT(e,t,n,r){let i=n.useState(`isMountedByTrigger`,e),a=KT(e,n),o=q(t=>{let i=n.select(`open`),a=n.select(`activeTriggerId`);if(a===e){let e={activeTriggerElement:t,...i?r:null};n.update(e)}else if(a==null&&i&&!n.state.openedWithoutTrigger){let i={activeTriggerId:e??null,activeTriggerElement:t,...r};n.update(i)}}),s=q(e=>{a(e),e&&o(e)});return J(()=>(s(t.current),()=>s(null)),[s,t,n,e]),J(()=>{if(i){let e={activeTriggerElement:t.current,...r};n.update(e)}},[i,n,t,...Object.values(r)]),{registerTrigger:s,isMountedByThisTrigger:i}}function ZT(e,t={}){let{closeOnActiveTriggerUnmount:n=!1}=t,r=U.useRef(null),i=e.useState(`open`);J(()=>{if(!i){r.current=null,e.state.triggerCount!==0&&e.set(`triggerCount`,0),e.state.openedWithoutTrigger&&e.set(`openedWithoutTrigger`,!1);return}let t=e.context.triggerElements.size,a={};e.state.triggerCount!==t&&(a.triggerCount=t);let o=e.select(`activeTriggerId`),s=null;if(o){let t=e.context.triggerElements.getById(o);if(t)r.current=o,t!==e.state.activeTriggerElement&&(a.activeTriggerElement=t);else{for(let[t,n]of e.context.triggerElements.entries())if(n===e.state.activeTriggerElement){a.activeTriggerId=t,a.activeTriggerElement=n,r.current=t;break}a.activeTriggerId===void 0&&(r.current===o?s=o:r.current=null)}}else r.current=null;if(!s&&!o&&!e.state.openedWithoutTrigger&&t===1){let t=e.context.triggerElements.entries().next();if(!t.done){let[e,n]=t.value;a.activeTriggerId=e,a.activeTriggerElement=n,r.current=e}}(a.triggerCount!==void 0||a.activeTriggerId!==void 0||a.activeTriggerElement!==void 0)&&e.update(a),s&&n&&queueMicrotask(()=>{if(e.select(`open`)&&e.select(`activeTriggerId`)===s&&!e.context.triggerElements.getById(s)){let t=$(cC);e.setOpen(!1,t),t.isCanceled||e.update({activeTriggerId:null,activeTriggerElement:null})}})},[i,e,e.useState(`triggerCount`),e.useState(`activeTriggerId`),e.useState(`activeTriggerElement`),n])}function QT(e,t,n,r){let{mounted:i,transitionStatus:a,forceUnmount:o}=BT({open:e,ref:t.context.popupRef,preventUnmountOnClose:t.useState(`preventUnmountingOnClose`),setPreventUnmountOnClose:e=>t.set(`preventUnmountingOnClose`,e),animateInitialOpen:r,onUnmount(){t.update({activeTriggerId:null,activeTriggerElement:null,mounted:!1,preventUnmountingOnClose:!1}),n?.(),t.context.onOpenChangeComplete?.(!1)}});return fi(()=>(t.set(`mounted`,i),null)),t.useSyncedValues({mounted:i,transitionStatus:a}),{forceUnmount:o,transitionStatus:a}}function $T(e,t){e.useSyncedValues(t),J(()=>()=>{e.update({activeTriggerProps:Ti,inactiveTriggerProps:Ti,popupProps:Ti})},[e])}function eE(e,t){J(()=>{!t&&e.state.openMethod!==null&&e.set(`openMethod`,null)},[t,e]),J(()=>()=>{e.state.openMethod!==null&&e.set(`openMethod`,null)},[e])}var tE=class{idMap=new Map;add(e,t){this.idMap.set(e,t)}delete(e){this.idMap.delete(e)}hasElement(e){for(let t of this.idMap.values())if(t===e)return!0;return!1}hasMatchingElement(e){for(let t of this.idMap.values())if(e(t))return!0;return!1}getById(e){return this.idMap.get(e)}entries(){return this.idMap.entries()}elements(){return this.idMap.values()}get size(){return this.idMap.size}},nE={open:e=>e.open,transitionStatus:e=>e.transitionStatus,domReferenceElement:e=>e.domReferenceElement,referenceElement:e=>e.positionReference??e.referenceElement,floatingElement:e=>e.floatingElement,floatingId:e=>e.floatingId},rE=class extends jw{constructor(e){let{syncOnly:t,nested:n,onOpenChange:r,triggerElements:i,...a}=e;super({...a,positionReference:a.referenceElement,domReferenceElement:a.referenceElement},{onOpenChange:r,dataRef:{current:{}},events:mT(),nested:n,triggerElements:i},nE),this.syncOnly=t}syncOpenEvent=(e,t)=>{(!e||!this.state.open||t!=null&&Zx(t))&&(this.context.dataRef.current.openEvent=e?t:void 0)};dispatchOpenChange=(e,t)=>{this.syncOpenEvent(e,t.event);let n={open:e,reason:t.reason,nativeEvent:t.event,nested:this.context.nested,triggerElement:t.trigger};this.context.events.emit(`openchange`,n)};setOpen=(e,t)=>{this.syncOnly||this.dispatchOpenChange(e,t),this.context.onOpenChange?.(e,t)}};function iE(e,t,n=!1){return{open:!1,openProp:void 0,mounted:!1,transitionStatus:void 0,floatingRootContext:new rE({open:!1,transitionStatus:void 0,floatingElement:null,referenceElement:null,triggerElements:e,floatingId:t,syncOnly:!0,nested:n,onOpenChange:void 0}),floatingId:t,triggerCount:0,preventUnmountingOnClose:!1,payload:void 0,activeTriggerId:null,activeTriggerElement:null,openedWithoutTrigger:!1,triggerIdProp:void 0,popupElement:null,positionerElement:null,activeTriggerProps:Ti,inactiveTriggerProps:Ti,popupProps:Ti}}var aE=e=>e.triggerIdProp??e.activeTriggerId,oE=e=>e.openProp??e.open,sE=e=>(e.popupElement?.id??e.floatingId)||void 0;function cE(e,t){return t!==void 0&&oE(e)&&aE(e)===t}function lE(e,t){return cE(e,t)?!0:t!==void 0&&oE(e)&&aE(e)==null&&!e.openedWithoutTrigger&&e.triggerCount===1}var uE={open:oE,mounted:e=>e.mounted,transitionStatus:e=>oE(e)&&!e.mounted?`starting`:e.transitionStatus,floatingRootContext:e=>e.floatingRootContext,triggerCount:e=>e.triggerCount,preventUnmountingOnClose:e=>e.preventUnmountingOnClose,payload:e=>e.payload,activeTriggerId:aE,activeTriggerElement:e=>e.mounted?e.activeTriggerElement:null,popupId:sE,isTriggerActive:(e,t)=>t!==void 0&&aE(e)===t,isOpenedByTrigger:(e,t)=>cE(e,t),isMountedByTrigger:(e,t)=>t!==void 0&&aE(e)===t&&e.mounted,triggerProps:(e,t)=>t?e.activeTriggerProps:e.inactiveTriggerProps,triggerPopupId:(e,t)=>lE(e,t)?sE(e):void 0,popupProps:e=>e.popupProps,popupElement:e=>e.popupElement,positionerElement:e=>e.positionerElement};function dE(e){let t=U.useCallback(t=>e===void 0?Ci:e.subscribeStore(t),[e]),n=U.useCallback(()=>e===void 0?void 0:e.store,[e]);return(0,Il.useSyncExternalStore)(t,n,()=>e?.serverStore)}function fE(e){let{open:t=!1,onOpenChange:n,elements:r={}}=e,i=Wb(),a=vT()!=null,o=fi(()=>new rE({open:t,transitionStatus:void 0,onOpenChange:n,referenceElement:r.reference??null,floatingElement:r.floating??null,triggerElements:new tE,floatingId:i,syncOnly:!1,nested:a})).current;return J(()=>{let e={open:t,floatingId:i};r.reference!==void 0&&(e.referenceElement=r.reference,e.domReferenceElement=qy(r.reference)?r.reference:null),r.floating!==void 0&&(e.floatingElement=r.floating),o.update(e)},[t,i,r.reference,r.floating,o]),o.context.onOpenChange=n,o.context.nested=a,o}var pE=sx&&lx;function mE(e,t={}){let{enabled:n=!0,delay:r}=t,{events:i,dataRef:a}=e.context,o=U.useRef(!1),s=U.useRef(null),c=U.useRef(!0),l=ka();U.useEffect(()=>{let t=e.select(`domReferenceElement`);if(!n)return;let r=Wy(t);function i(){let t=e.select(`domReferenceElement`);!e.select(`open`)&&Jy(t)&&t===fx(gb(t))&&(o.current=!0,s.current=t)}function a(){c.current=!0}function l(){c.current=!1}return Mw(Nw(r,`blur`,i),pE&&Nw(r,`keydown`,a,!0),pE&&Nw(r,`pointerdown`,l,!0))},[e,n]),U.useEffect(()=>{if(!n)return;function t(t){if(t.reason===`trigger-press`||t.reason===`escape-key`){let t=e.select(`domReferenceElement`);qy(t)&&(s.current=t,o.current=!0)}}return i.on(`openchange`,t),()=>{i.off(`openchange`,t)}},[i,n,e]);let u=U.useMemo(()=>{function t(){o.current=!1,s.current=null}return{onMouseLeave(){t()},onFocus(n){let i=n.currentTarget;if(o.current){if(s.current===i)return;t()}let a=mx(n.nativeEvent);if(qy(a)){if(pE&&!n.relatedTarget){if(!c.current&&!zx(a))return}else if(!Hx(a))return}let u=Ix(n.relatedTarget,e.context.triggerElements),{nativeEvent:d,currentTarget:f}=n;e.select(`open`)&&u||!r?e.setOpen(!0,$(dC,d,f)):l.start(r,()=>{o.current||e.setOpen(!0,$(dC,d,f))})},onBlur(n){t();let r=n.relatedTarget,i=n.nativeEvent,o=qy(r)&&r.hasAttribute(Ww(`focus-guard`))&&r.getAttribute(`data-type`)===`outside`;l.start(0,()=>{let t=e.select(`domReferenceElement`),n=fx(gb(t));(r||n!==t)&&(Q(a.current.floatingContext?.refs.floating.current,n)||Q(t,n)||o||Ix(r??n,e.context.triggerElements)||e.setOpen(!1,$(dC,i)))})}}},[a,r,e,l]);return U.useMemo(()=>n?{reference:u,trigger:u}:{},[n,u])}var hE=class e{pointerType=void 0;interactedInside=!1;handler=void 0;blockMouseMove=!0;performedPointerEventsMutation=!1;pointerEventsScopeElement=null;pointerEventsReferenceElement=null;pointerEventsFloatingElement=null;restTimeoutPending=!1;openChangeTimeout=new Oa;restTimeout=new Oa;handleCloseOptions=void 0;static create(){return new e}dispose=()=>{this.openChangeTimeout.clear(),this.restTimeout.clear()};disposeEffect=()=>this.dispose},gE=new WeakMap;function _E(e){if(!e.performedPointerEventsMutation)return;let t=e.pointerEventsScopeElement;t&&gE.get(t)===e&&(e.pointerEventsScopeElement?.style.removeProperty(`pointer-events`),e.pointerEventsReferenceElement?.style.removeProperty(`pointer-events`),e.pointerEventsFloatingElement?.style.removeProperty(`pointer-events`),gE.delete(t)),e.performedPointerEventsMutation=!1,e.pointerEventsScopeElement=null,e.pointerEventsReferenceElement=null,e.pointerEventsFloatingElement=null}function vE(e,t){let{scopeElement:n,referenceElement:r,floatingElement:i}=t,a=gE.get(n);a&&a!==e&&_E(a),_E(e),e.performedPointerEventsMutation=!0,e.pointerEventsScopeElement=n,e.pointerEventsReferenceElement=r,e.pointerEventsFloatingElement=i,gE.set(n,e),n.style.pointerEvents=`none`,r.style.pointerEvents=`auto`,i.style.pointerEvents=`auto`}function yE(e){let t=e.context.dataRef.current,n=fi(()=>t.hoverInteractionState??hE.create()).current;return t.hoverInteractionState||=n,sa(t.hoverInteractionState.disposeEffect),t.hoverInteractionState}function bE(e,t={}){let{enabled:n=!0,closeDelay:r=0,nodeId:i}=t,a=e.useState(`open`),o=e.useState(`floatingElement`),s=e.useState(`domReferenceElement`),{dataRef:c}=e.context,l=yT(),u=vT(),d=yE(e),f=ka(),p=q(()=>Lw(c.current.openEvent?.type,d.interactedInside)),m=q(()=>Rw(c.current.openEvent?.type)),h=q(()=>{_E(d)});J(()=>{a||(d.pointerType=void 0,d.restTimeoutPending=!1,d.interactedInside=!1,h())},[a,d,h]),U.useEffect(()=>h,[h]),J(()=>{if(n&&a&&d.handleCloseOptions?.blockPointerEvents&&m()&&qy(s)&&o){let e=s,t=o,n=gb(o),r=l?.nodesRef.current.find(e=>e.id===u)?.context?.elements.floating;r&&(r.style.pointerEvents=``);let i=d.pointerEventsScopeElement===t?null:d.pointerEventsScopeElement,a=r===t?null:r,c=d.handleCloseOptions?.getScope?.()??i??a??px(e,`[data-rootownerid]`)??n.body;return vE(d,{scopeElement:c,referenceElement:e,floatingElement:t}),()=>{h()}}},[n,a,s,o,d,m,l,u,h]),U.useEffect(()=>{if(!n)return;function t(){return!!(l&&u&&Wx(l.nodesRef.current,u).length>0)}function a(t){let n=Fw(r,`close`,d.pointerType),i=()=>{e.setOpen(!1,$(uC,t)),l?.events.emit(`floating.closed`,t)};n?d.openChangeTimeout.start(n,i):(d.openChangeTimeout.clear(),i())}function s(e){let t=mx(e);Bx(t)?d.interactedInside=px(t,`[aria-haspopup]`)!=null:d.interactedInside=!1}function g(){d.openChangeTimeout.clear(),f.clear(),l?.events.off(`floating.closed`,v),h()}function _(n){if(t()&&l){l.events.on(`floating.closed`,v);return}if(Ix(n.relatedTarget,e.context.triggerElements))return;let r=c.current.floatingContext?.nodeId??i,o=n.relatedTarget;l&&r&&qy(o)&&Wx(l.nodesRef.current,r,!1).some(e=>Q(e.context?.elements.floating,o))||(d.handler?d.handler(n):(h(),m()&&!p()&&a(n)))}function v(n){l&&u&&!t()&&f.start(0,()=>{l.events.off(`floating.closed`,v),e.setOpen(!1,$(uC,n)),l.events.emit(`floating.closed`,n)})}let y=o;return Mw(y&&Nw(y,`mouseenter`,g),y&&Nw(y,`mouseleave`,_),y&&Nw(y,`pointerdown`,s,!0),()=>{l?.events.off(`floating.closed`,v)})},[n,o,e,c,r,i,m,p,h,d,l,u,f])}var xE={current:null};function SE(e,t={}){let{enabled:n=!0,delay:r=0,handleClose:i=null,mouseOnly:a=!1,restMs:o=0,move:s=!0,triggerElementRef:c=xE,externalTree:l,isActiveTrigger:u=!0,getHandleCloseContext:d,isClosing:f,shouldOpen:p,guardStaleOpen:m=!1}=t,{dataRef:h,events:g}=e.context,_=yT(l),v=yE(e),y=U.useRef(!1),b=gw(i),x=gw(r),S=gw(o),C=gw(n),w=gw(p),T=gw(f),E=q(()=>Lw(h.current.openEvent?.type,v.interactedInside)),D=q(()=>w.current?.()!==!1),O=q((t,n,r)=>{let i=e.context.triggerElements;if(i.hasElement(n))return!t||!Q(t,n);if(!qy(r))return!1;let a=r;return i.hasMatchingElement(e=>Q(e,a))&&(!t||!Q(t,a))}),k=q(()=>{v.handler&&=(gb(e.select(`domReferenceElement`)).removeEventListener(`mousemove`,v.handler),void 0)}),A=q(()=>{_E(v)});return u&&(v.handleCloseOptions=i?.__options),U.useEffect(()=>k,[k]),U.useEffect(()=>{if(!n)return;function e(e){e.open?y.current=!1:(y.current=e.reason===uC,k(),v.openChangeTimeout.clear(),v.restTimeout.clear(),v.blockMouseMove=!0,v.restTimeoutPending=!1)}return g.on(`openchange`,e),()=>{g.off(`openchange`,e)}},[n,g,v,k]),U.useEffect(()=>{if(!n)return;function t(t,n=!0){let r=Fw(x.current,`close`,v.pointerType);r?v.openChangeTimeout.start(r,()=>{e.setOpen(!1,$(uC,t)),_?.events.emit(`floating.closed`,t)}):n&&(v.openChangeTimeout.clear(),e.setOpen(!1,$(uC,t)),_?.events.emit(`floating.closed`,t))}let r=c.current??(u?e.select(`domReferenceElement`):null);if(!qy(r))return;function i(t){if(v.openChangeTimeout.clear(),v.blockMouseMove=!1,a&&!Xx(v.pointerType))return;let n=Iw(S.current),r=Fw(x.current,`open`,v.pointerType),i=mx(t),o=t.currentTarget??null,s=e.select(`domReferenceElement`),c=o;if(qy(i)&&!e.context.triggerElements.hasElement(i)){for(let t of e.context.triggerElements.elements())if(Q(t,i)){c=t;break}}qy(o)&&qy(s)&&!e.context.triggerElements.hasElement(o)&&Q(o,s)&&(c=s);let l=c!=null&&O(s,c,i),u=e.select(`open`),d=T.current?.()??e.select(`transitionStatus`)===`ending`,f=!u&&d&&y.current,p=!l&&qy(c)&&qy(s)&&Q(s,c)&&f,m=n>0&&!r,h=l&&(u||f)||p,g=!u||l;h?D()&&e.setOpen(!0,$(uC,t,c)):m||(r?v.openChangeTimeout.start(r,()=>{g&&D()&&e.setOpen(!0,$(uC,t,c))}):g&&D()&&e.setOpen(!0,$(uC,t,c)))}function o(n){if(E()){A();return}k();let r=gb(e.select(`domReferenceElement`));v.restTimeout.clear(),v.restTimeoutPending=!1;let i=h.current.floatingContext??d?.();if(!Ix(n.relatedTarget,e.context.triggerElements)){if(b.current&&i){e.select(`open`)||v.openChangeTimeout.clear();let a=c.current;v.handler=b.current({...i,tree:_,x:n.clientX,y:n.clientY,onClose(){A(),k(),C.current&&!E()&&a===e.select(`domReferenceElement`)&&t(n,!0)}}),r.addEventListener(`mousemove`,v.handler),v.handler(n)}else(v.pointerType!==`touch`||!Q(e.select(`floatingElement`),n.relatedTarget))&&t(n)}}function l(e){Q(r,e.relatedTarget)||(v.openChangeTimeout.clear(),v.restTimeout.clear(),v.restTimeoutPending=!1)}let f=m?Nw(r,`mouseout`,l):void 0;return s?Mw(Nw(r,`mousemove`,i,{once:!0}),Nw(r,`mouseenter`,i),Nw(r,`mouseleave`,o),f):Mw(Nw(r,`mouseenter`,i),Nw(r,`mouseleave`,o),f)},[k,A,h,x,e,n,b,v,u,O,E,a,s,S,c,_,C,d,T,D,m]),U.useMemo(()=>{if(!n)return;function t(e){v.pointerType=e.pointerType}return{onPointerDown:t,onPointerEnter:t,onMouseMove(t){let{nativeEvent:n}=t,r=t.currentTarget,i=e.select(`domReferenceElement`),o=e.select(`open`),s=O(i,r,t.target);if(a&&!Xx(v.pointerType))return;if(o&&s&&v.handleCloseOptions?.blockPointerEvents){let t=e.select(`floatingElement`);if(t){let e=v.handleCloseOptions?.getScope?.()??r.ownerDocument.body;vE(v,{scopeElement:e,referenceElement:r,floatingElement:t})}}let c=Iw(S.current);if(o&&!s||c===0||!s&&v.restTimeoutPending&&t.movementX**2+t.movementY**2<2)return;v.restTimeout.clear();function l(){if(v.restTimeoutPending=!1,E())return;let t=e.select(`open`);!v.blockMouseMove&&(!t||s)&&D()&&e.setOpen(!0,$(uC,n,r))}v.pointerType===`touch`?oe.flushSync(()=>{l()}):s&&o?l():(v.restTimeoutPending=!0,v.restTimeout.start(c,l))}}},[n,v,E,O,a,e,S,D])}function CE(e){return lx&&e.movementX===0&&e.movementY===0}function wE(e,t,n){switch(e){case`vertical`:return t;case`horizontal`:return n;default:return t||n}}function TE(e,t){return wE(t,e===`ArrowUp`||e===`ArrowDown`,e===`ArrowLeft`||e===`ArrowRight`)}function EE(e,t,n){return wE(t,e===`ArrowDown`,n?e===`ArrowLeft`:e===`ArrowRight`)||e===`Enter`||e===` `||e===``}function DE(e,t,n){return wE(t,n?e===_x:e===vx,e===bx)}function OE(e,t,n,r){return t===`both`||t===`horizontal`&&r?e===`Escape`:wE(t,n?e===vx:e===_x,e===yx)}function kE(e,t){let{listRef:n,activeIndex:r,onNavigate:i=()=>{},enabled:a=!0,selectedIndex:o=null,allowEscape:s=!1,loopFocus:c=!1,nested:l=!1,rtl:u=!1,virtual:d=!1,focusItemOnOpen:f=`auto`,focusItemOnHover:p=!0,openOnArrowKeyDown:m=!0,disabledIndices:h=void 0,orientation:g=`vertical`,triggerOrientation:_=g,parentOrientation:v,id:y,resetOnPointerLeave:b=!0,externalTree:x,nestedReturnFocusRef:S,grid:C}=t,w=C!=null,T=e.useState(`open`),E=e.useState(`floatingElement`),D=e.useState(`domReferenceElement`),O=e.context.dataRef,k=Ux(E),A=Vx(D),j=gw(k),M=vT(),N=yT(x),P=U.useRef(f),F=U.useRef(o??-1),I=U.useRef(null),L=U.useRef(!0),R=q(e=>{i(F.current===-1?null:F.current,e)}),z=U.useRef(!!E),B=U.useRef(T),ee=U.useRef(!1),V=U.useRef(!1),te=U.useRef(null),ne=gw(h),H=gw(T),re=gw(o),ie=gw(b),ae=da(),oe=da(),se=q(()=>{ae.cancel();function e(e){d||(te.current=Kw(e,{sync:ee.current,preventScroll:!0}))}let t=n.current[F.current],r=V.current;t&&e(t),(ee.current?e=>e():e=>ae.request(e))(()=>{let i=n.current[F.current]||t;i&&(t||e(i),fe&&(r||!L.current)&&i.scrollIntoView?.({block:`nearest`,inline:`nearest`}))})});J(()=>{O.current.orientation=g},[O,g]),J(()=>{T||(I.current=null),(!T||f!==`auto`)&&(P.current=f)},[T,f]),J(()=>{a&&(T&&E?(F.current=o??-1,P.current&&o!=null&&(V.current=!0,R())):z.current&&(F.current=-1,R()))},[a,T,E,o,R]),J(()=>{if(a){if(!T)ee.current=!1;else if(E){if(r==null){if(ee.current=!1,re.current!=null)return;if(z.current&&(F.current=-1,se()),(!B.current||!z.current)&&P.current&&(I.current!=null||P.current===!0&&I.current==null)){let e=0,t=()=>{n.current[0]==null?(e<2&&(e?e=>oe.request(e):queueMicrotask)(t),e+=1):(F.current=I.current==null||EE(I.current,_,u)||l?ES(n):DS(n),I.current=null,R())};t()}}else TS(n.current,r)||(F.current=r,se(),V.current=!1)}}},[a,T,E,r,re,l,n,_,u,R,se,oe]),J(()=>{if(!a||E||!N||d||!z.current)return;let e=N.nodesRef.current,t=e.find(e=>e.id===M)?.context?.elements.floating,n=fx(gb(D??t??null)),r=e.some(e=>e.context&&Q(e.context.elements.floating,n));t&&!r&&L.current&&t.focus({preventScroll:!0})},[a,E,D,N,M,d]),J(()=>{B.current=T,z.current=!!E});let ce=r!=null,le=q(e=>{if(!H.current)return;let t=n.current.indexOf(e.currentTarget);t!==-1&&(F.current!==t||r!==t)&&(F.current=t,R(e))}),W=q(()=>v??N?.nodesRef.current.find(e=>e.id===M)?.context?.dataRef?.current.orientation),ue=q(()=>ES(n,ne.current)),de=q(t=>{if(L.current=!1,ee.current=!0,t.which===229||!H.current&&t.currentTarget===j.current)return;if(l&&OE(t.key,g,u,w)){TE(t.key,W())||Kx(t),e.setOpen(!1,$(_C,t.nativeEvent));let n=S?.current??D;Jy(n)&&n.focus();return}r!=null&&r!==F.current&&!TS(n.current,r)&&(F.current=r);let i=F.current,a=ES(n,h),o=DS(n,h);if(A||(t.key===`Home`&&(Kx(t),F.current=a,R(t)),t.key===`End`&&(Kx(t),F.current=o,R(t))),C!=null){let e=C(t,F.current,n,g,c,u,h,a,o);if(e!=null&&e!==F.current&&(F.current=e,R(t)),g===`both`)return}if(TE(t.key,g)){Kx(t);let e=fx(t.currentTarget.ownerDocument);if(T&&!d&&Q(t.currentTarget,e)&&!n.current.some(t=>t!=null&&Q(t,e))){F.current=EE(t.key,g,u)?a:o,R(t),r===F.current&&se();return}let{index:l,wrapped:f}=OS(n.current,i,{decrement:!EE(t.key,g,u),loopFocus:c,allowEscape:s,disabledIndices:h,minIndex:a,maxIndex:o});f&&(ee.current=!1),F.current=l,R(t)}}),fe=U.useMemo(()=>({onFocus(e){ee.current=!0,le(e)},onClick({currentTarget:e}){d||e.focus({preventScroll:!0})},onMouseMove(e){CE(e)||(ee.current=!0,V.current=!1,p&&le(e))},onPointerLeave(e){if(!H.current||!L.current||e.pointerType===`touch`)return;ee.current=!0;let t=e.relatedTarget;if(p&&!n.current.includes(t)&&ie.current&&(te.current?.(),te.current=null,F.current=-1,R(e),!d)){let e=j.current,t=fx(gb(e));e&&Q(e,t)&&e.focus({preventScroll:!0})}}}),[le,H,j,p,n,R,ie,d]),pe=U.useMemo(()=>d&&T&&ce&&{"aria-activedescendant":`${y}-${r}`},[d,T,ce,y,r]),G=U.useMemo(()=>({...A?{}:pe,onKeyDown(t){if(t.key===`Tab`&&t.shiftKey&&T&&!d){let n=mx(t.nativeEvent);if(n&&!Q(j.current,n))return;Kx(t);let r=$(hC,t.nativeEvent);e.setOpen(!1,r);let i=S?.current??D;!r.isCanceled&&Jy(i)&&i.focus()}else de(t)},onPointerMove(e){CE(e)||(L.current=!0)}}),[pe,de,j,A,e,T,d,D,S]),me=U.useMemo(()=>{function t(t){e.setOpen(!0,$(_C,t.nativeEvent,t.currentTarget))}function n(e){f===`auto`&&Jx(e.nativeEvent)&&(P.current=!d)}function r(e){P.current=f,f===`auto`&&Yx(e.nativeEvent)&&(P.current=!0)}return{onKeyDown(n){let r=e.select(`open`);L.current=!1;let i=n.key.startsWith(`Arrow`),a=DE(n.key,W(),u),o=TE(n.key,r?g:_),s=(l?a:o)||n.key===`Enter`||n.key.trim()===``;if(d&&r&&(!l||zx(n.currentTarget)))return de(n);if(r||m||!i){if(s){let e=TE(n.key,W());I.current=l&&e?null:n.key}l?a&&(Kx(n),r?(F.current=ue(),R(n),d&&j.current?.focus()):t(n)):o&&(re.current!=null&&(F.current=re.current),Kx(n),!r&&m?t(n):de(n),r&&R(n))}},onFocus(t){t.target===t.currentTarget&&e.select(`open`)&&!d&&(F.current=-1,R(t))},onPointerDown:r,onPointerEnter:r,onMouseDown:n,onClick:n}},[de,f,ue,l,R,e,m,g,_,W,u,re,d,j]),he=U.useMemo(()=>({...pe,...me}),[pe,me]);return U.useMemo(()=>a?{reference:he,floating:G,item:fe,trigger:me}:{},[a,he,G,me,fe])}function AE(e,t){let{listRef:n,elementsRef:r,activeIndex:i,onMatch:a,disabledIndices:o,onTyping:s,enabled:c=!0,resetMs:l=750,selectedIndex:u=null}=t,d=q(s),f=e.useState(`open`),p=ka(),m=U.useRef(``),h=U.useRef(u??i??-1),g=U.useRef(null),_=q(e=>{function t(e){return r?.current[e]}function s(e){let n=t(e);return n&&!MS(n)||n?.matches(`:disabled`)?!1:o==null||!AS(wi,e,o)}function c(e,t,n=0){if(e.length===0)return-1;let r=(n%e.length+e.length)%e.length,i=t.toLowerCase();for(let t=0;t<e.length;t+=1){let n=(r+t)%e.length;if(e[n]?.toLowerCase().startsWith(i)&&s(n))return n}return-1}let _=n.current;if(m.current.length>0&&e.key===` `&&(Kx(e),d?.(!0)),m.current.length>0&&m.current[0]!==` `&&c(_,m.current)===-1&&e.key!==` `&&d?.(!1),_==null||e.key.length!==1||e.ctrlKey||e.metaKey||e.altKey)return;f&&e.key!==` `&&(Kx(e),d?.(!0));let v=m.current===``;v&&(h.current=u??i??-1),_.every((e,t)=>e&&s(t)?e[0]?.toLowerCase()!==e[1]?.toLowerCase():!0)&&m.current===e.key&&(m.current=``,h.current=g.current),m.current+=e.key,p.start(l,()=>{m.current=``,h.current=g.current,d?.(!1)});let y=((v?u??i??-1:h.current)??0)+1,b=c(_,m.current,y);b===-1?e.key!==` `&&(m.current=``,d?.(!1)):(a?.(b,e),g.current=b)}),v=q(t=>{let n=t.relatedTarget,r=e.select(`domReferenceElement`),i=e.select(`floatingElement`);Q(r,n)||Q(i,n)||(p.clear(),m.current=``,h.current=g.current,d?.(!1))});J(()=>{(f||u===null)&&(p.clear(),g.current=null,m.current!==``&&(m.current=``,d?.(!1)))},[f,u,p,d]);let y=U.useMemo(()=>({onKeyDown:_,onBlur:v}),[_,v]);return U.useMemo(()=>c?{reference:y,floating:y}:{},[c,y])}var jE=.1,ME=jE*jE,NE=.5;function PE(e,t,n,r,i,a){return r>=t!=a>=t&&e<=(i-n)*(t-r)/(a-r)+n}function FE(e,t,n,r,i,a,o,s,c,l){let u=!1;return PE(e,t,n,r,i,a)&&(u=!u),PE(e,t,i,a,o,s)&&(u=!u),PE(e,t,o,s,c,l)&&(u=!u),PE(e,t,c,l,n,r)&&(u=!u),u}function IE(e,t,n){return e>=n.x&&e<=n.x+n.width&&t>=n.y&&t<=n.y+n.height}function LE(e,t,n,r,i,a){return e>=Math.min(n,i)&&e<=Math.max(n,i)&&t>=Math.min(r,a)&&t<=Math.max(r,a)}function RE(e={}){let{blockPointerEvents:t=!1}=e,n=new Oa,r=({x:e,y:t,placement:r,elements:i,onClose:a,nodeId:o,tree:s})=>{let c=r?.split(`-`)[0],l=!1,u=null,d=null,f=typeof performance<`u`?performance.now():0;function p(e,t){let n=performance.now(),r=n-f;if(u===null||d===null||r===0)return u=e,d=t,f=n,!1;let i=e-u,a=t-d,o=i*i+a*a,s=r*r*ME;return u=e,d=t,f=n,o<s}function m(){n.clear(),a()}return function(r){n.clear();let a=i.domReference,u=i.floating;if(!a||!u||c==null||e==null||t==null)return;let{clientX:d,clientY:f}=r,h=mx(r),g=r.type===`mouseleave`,_=Q(u,h),v=Q(a,h);if(_&&(l=!0,!g))return;if(v&&(l=!1,!g)){l=!0;return}if(g&&qy(r.relatedTarget)&&Q(u,r.relatedTarget))return;function y(){return!!(s&&Wx(s.nodesRef.current,o).length>0)}function b(){y()||m()}if(y())return;let x=a.getBoundingClientRect(),S=u.getBoundingClientRect(),C=e>S.right-S.width/2,w=t>S.bottom-S.height/2,T=S.width>x.width,E=S.height>x.height,D=(T?x:S).left,O=(T?x:S).right,k=(E?x:S).top,A=(E?x:S).bottom;if(c===`top`&&t>=x.bottom-1||c===`bottom`&&t<=x.top+1||c===`left`&&e>=x.right-1||c===`right`&&e<=x.left+1){b();return}let j=!1;switch(c){case`top`:j=LE(d,f,D,x.top+1,O,S.bottom-1);break;case`bottom`:j=LE(d,f,D,S.top+1,O,x.bottom-1);break;case`left`:j=LE(d,f,S.right-1,A,x.left+1,k);break;case`right`:j=LE(d,f,x.right-1,A,S.left+1,k)}if(j)return;if(l&&!IE(d,f,x)||!g&&p(d,f)){b();return}let M=!1;switch(c){case`top`:{let n=T?NE/2:NE*4,r=T||C?e+n:e-n,i=T?e-n:C?e+n:e-n,a=t+NE+1,o=C||T?S.bottom-NE:S.top,s=C?T?S.bottom-NE:S.top:S.bottom-NE;M=FE(d,f,r,a,i,a,S.left,o,S.right,s);break}case`bottom`:{let n=T?NE/2:NE*4,r=T||C?e+n:e-n,i=T?e-n:C?e+n:e-n,a=t-NE,o=C||T?S.top+NE:S.bottom,s=C?T?S.top+NE:S.bottom:S.top+NE;M=FE(d,f,r,a,i,a,S.left,o,S.right,s);break}case`left`:{let n=E?NE/2:NE*4,r=E||w?t+n:t-n,i=E?t-n:w?t+n:t-n,a=e+NE+1,o=w||E?S.right-NE:S.left,s=w?E?S.right-NE:S.left:S.right-NE;M=FE(d,f,o,S.top,s,S.bottom,a,r,a,i);break}case`right`:{let n=E?NE/2:NE*4,r=E||w?t+n:t-n,i=E?t-n:w?t+n:t-n,a=e-NE,o=w||E?S.left+NE:S.right,s=w?E?S.left+NE:S.right:S.left+NE;M=FE(d,f,a,r,a,i,o,S.top,s,S.bottom);break}}M?l||n.start(40,b):b()}};return r.__options={...e,blockPointerEvents:t},r}function zE(e,t,n){let{reference:r,floating:i}=e,a=uS(t),o=dS(t),s=lS(o),c=oS(t),l=a===`y`,u=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[s]/2-i[s]/2,p;switch(c){case`top`:p={x:u,y:r.y-i.height};break;case`bottom`:p={x:u,y:r.y+r.height};break;case`right`:p={x:r.x+r.width,y:d};break;case`left`:p={x:r.x-i.width,y:d};break;default:p={x:r.x,y:r.y}}let m=sS(t);return m&&(p[o]+=f*(m===`end`?1:-1)*(n&&l?-1:1)),p}async function BE(e,t){t===void 0&&(t={});let{x:n,y:r,platform:i,rects:a,elements:o,strategy:s}=e,{boundary:c=`clippingAncestors`,rootBoundary:l=`viewport`,elementContext:u=`floating`,altBoundary:d=!1,padding:f=0}=aS(t,e),p=CS(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=wS(await i.getClippingRect({element:await(i.isElement==null?void 0:i.isElement(m))??!0?m:m.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(o.floating)),boundary:c,rootBoundary:l,strategy:s})),g=u===`floating`?{x:n,y:r,width:a.floating.width,height:a.floating.height}:a.reference,_=await(i.getOffsetParent==null?void 0:i.getOffsetParent(o.floating)),v=await(i.isElement==null?void 0:i.isElement(_))&&await(i.getScale==null?void 0:i.getScale(_))||{x:1,y:1},y=wS(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:g,offsetParent:_,strategy:s}):g);return{top:(h.top-y.top+p.top)/v.y,bottom:(y.bottom-h.bottom+p.bottom)/v.y,left:(h.left-y.left+p.left)/v.x,right:(y.right-h.right+p.right)/v.x}}var VE=50,HE=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:BE},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=zE(l,r,c),f=r,p=0,m={};for(let n=0;n<a.length;n++){let h=a[n];if(!h)continue;let{name:g,fn:_}=h,{x:v,y,data:b,reset:x}=await _({x:u,y:d,initialPlacement:r,placement:f,strategy:i,middlewareData:m,rects:l,platform:s,elements:{reference:e,floating:t}});u=v??u,d=y??d,m[g]={...m[g],...b},x&&p<VE&&(p++,typeof x==`object`&&(x.placement&&(f=x.placement),x.rects&&(l=x.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):x.rects),{x:u,y:d}=zE(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},UE=function(e){return e===void 0&&(e={}),{name:`flip`,options:e,async fn(t){var n;let{placement:r,middlewareData:i,rects:a,initialPlacement:o,platform:s,elements:c}=t,{mainAxis:l=!0,crossAxis:u=!0,fallbackPlacements:d,fallbackStrategy:f=`bestFit`,fallbackAxisSideDirection:p=`none`,flipAlignment:m=!0,...h}=aS(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=oS(r),_=uS(o),v=oS(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[xS(o)]:pS(o)),x=p!==`none`;!d&&x&&b.push(...bS(o,m,p,y));let S=[o,...b],C=await s.detectOverflow(t,h),w=[],T=i.flip?.overflows||[];if(l&&w.push(C[g]),u){let e=fS(r,a,y);w.push(C[e[0]],C[e[1]])}if(T=[...T,{placement:r,overflows:w}],!w.every(e=>e<=0)){let e=(i.flip?.index||0)+1,t=S[e];if(t&&(u!==`alignment`||_===uS(t)||T.every(e=>uS(e.placement)!==_||e.overflows[0]>0)))return{data:{index:e,overflows:T},reset:{placement:t}};let n=T.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0]?.placement;if(!n)switch(f){case`bestFit`:{let e=T.filter(e=>{if(x){let t=uS(e.placement);return t===_||t===`y`}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0]?.[0];e&&(n=e);break}case`initialPlacement`:n=o}if(r!==n)return{reset:{placement:n}}}return{}}}},WE=new Set([`left`,`top`]);async function GE(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=oS(n),s=sS(n),c=uS(n)===`y`,l=WE.has(o)?-1:1,u=a&&c?-1:1,d=aS(t,e),{mainAxis:f,crossAxis:p,alignmentAxis:m}=typeof d==`number`?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof m==`number`&&(p=s===`end`?m*-1:m),c?{x:p*u,y:f*l}:{x:f*l,y:p*u}}var KE=function(e){return e===void 0&&(e=0),{name:`offset`,options:e,async fn(t){var n;let{x:r,y:i,placement:a,middlewareData:o}=t,s=await GE(t,e);return a===o.offset?.placement&&(n=o.arrow)!=null&&n.alignmentOffset?{}:{x:r+s.x,y:i+s.y,data:{...s,placement:a}}}}},qE=function(e){return e===void 0&&(e={}),{name:`shift`,options:e,async fn(t){let{x:n,y:r,placement:i,platform:a}=t,{mainAxis:o=!0,crossAxis:s=!1,limiter:c={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=aS(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=uS(i),p=cS(f),m=u[p],h=u[f],g=(e,t)=>iS(t+d[e===`y`?`top`:`left`],t,t-d[e===`y`?`bottom`:`right`]);o&&(m=g(p,m)),s&&(h=g(f,h));let _=c.fn({...t,[p]:m,[f]:h});return{..._,data:{x:_.x-n,y:_.y-r,enabled:{[p]:o,[f]:s}}}}}},JE=function(e){return e===void 0&&(e={}),{options:e,fn(t){let{x:n,y:r,placement:i,rects:a,middlewareData:o}=t,{offset:s=0,mainAxis:c=!0,crossAxis:l=!0}=aS(e,t),u={x:n,y:r},d=uS(i),f=cS(d),p=u[f],m=u[d],h=aS(s,t),g=typeof h==`number`?{mainAxis:h,crossAxis:0}:{mainAxis:h.mainAxis??0,crossAxis:h.crossAxis??0};if(c){let e=f===`y`?`height`:`width`,t=a.reference[f]-a.floating[e]+g.mainAxis,n=a.reference[f]+a.reference[e]-g.mainAxis;p<t?p=t:p>n&&(p=n)}if(l){let e=f===`y`?`width`:`height`,t=WE.has(oS(i)),n=a.reference[d]-a.floating[e]+(t&&o.offset?.[d]||0)+(t?0:g.crossAxis),r=a.reference[d]+a.reference[e]+(t?0:o.offset?.[d]||0)-(t?g.crossAxis:0);m<n?m=n:m>r&&(m=r)}return{[f]:p,[d]:m}}}},YE=function(e){return e===void 0&&(e={}),{name:`size`,options:e,async fn(t){let{placement:n,rects:r,platform:i,elements:a}=t,{apply:o=()=>{},...s}=aS(e,t),c=await i.detectOverflow(t,s),l=oS(n),u=sS(n),d=uS(n)===`y`,{width:f,height:p}=r.floating,m,h;l===`top`||l===`bottom`?(m=l,h=u===(await(i.isRTL==null?void 0:i.isRTL(a.floating))?`start`:`end`)?`left`:`right`):(h=l,m=u===`end`?`top`:`bottom`);let g=p-c.top-c.bottom,_=f-c.left-c.right,v=Qx(p-c[m],g),y=Qx(f-c[h],_),b=t.middlewareData.shift,x=!b,S=v,C=y;b!=null&&b.enabled.x&&(C=_),b!=null&&b.enabled.y&&(S=g),x&&!u&&(d?C=f-2*$x(c.left,c.right):S=p-2*$x(c.top,c.bottom)),await o({...t,availableWidth:C,availableHeight:S});let w=await i.getDimensions(a.floating);return f!==w.width||p!==w.height?{reset:{rects:!0}}:{}}}};function XE(e){let t=sb(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=Jy(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=eS(n)!==a||eS(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function ZE(e){return qy(e)?e:e.contextElement}function QE(e){let t=ZE(e);if(!Jy(t))return nS(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=XE(t),o=(a?eS(n.width):n.width)/r,s=(a?eS(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var $E=nS(0);function eD(e){let t=Wy(e);return!ab()||!t.visualViewport?$E:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function tD(e,t,n){return t===void 0&&(t=!1),!!n&&t&&n===Wy(e)}function nD(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=ZE(e),o=nS(1);t&&(r?qy(r)&&(o=QE(r)):o=QE(e));let s=tD(a,n,r)?eD(a):nS(0),c=(i.left+s.x)/o.x,l=(i.top+s.y)/o.y,u=i.width/o.x,d=i.height/o.y;if(a&&r){let e=Wy(a),t=qy(r)?Wy(r):r,n=e,i=fb(n);for(;i&&t!==n;){let e=QE(i),t=i.getBoundingClientRect(),r=sb(i),a=t.left+(i.clientLeft+parseFloat(r.paddingLeft))*e.x,o=t.top+(i.clientTop+parseFloat(r.paddingTop))*e.y;c*=e.x,l*=e.y,u*=e.x,d*=e.y,c+=a,l+=o,n=Wy(i),i=fb(n)}}return wS({width:u,height:d,x:c,y:l})}function rD(e,t){let n=cb(e).scrollLeft;return t?t.left+n:nD(Gy(e)).left+n}function iD(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-rD(e,n),y:n.top+t.scrollTop}}function aD(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=Gy(r),s=t?Qy(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=nS(1),u=nS(0),d=Jy(r);if((d||!a)&&((Uy(r)!==`body`||Xy(o))&&(c=cb(r)),d)){let e=nD(r);l=QE(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?iD(o,c):nS(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+f.x,y:n.y*l.y-c.scrollTop*l.y+u.y+f.y}}function oD(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function sD(e){let t=cb(e),n=e.ownerDocument.body,r=$x(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),i=$x(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight),a=-t.scrollLeft+rD(e),o=-t.scrollTop;return sb(n).direction===`rtl`&&(a+=$x(e.clientWidth,n.clientWidth)-r),{width:r,height:i,x:a,y:o}}var cD=25;function lD(e,t,n){n===void 0&&(n=`viewport`);let r=n===`layoutViewport`,i=Wy(e),a=Gy(e),o=i.visualViewport,s=a.clientWidth,c=a.clientHeight,l=0,u=0;if(o){let e=!ab()||t===`fixed`;r?e||(l=-o.offsetLeft,u=-o.offsetTop):(s=o.width,c=o.height,e&&(l=o.offsetLeft,u=o.offsetTop))}if(rD(a)<=0){let e=a.ownerDocument,t=e.body,n=getComputedStyle(t),r=e.compatMode===`CSS1Compat`&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,i=Math.abs(a.clientWidth-t.clientWidth-r),o=getComputedStyle(a).scrollbarGutter===`stable both-edges`?i/2:i;o<=cD&&(s-=o)}return{width:s,height:c,x:l,y:u}}function uD(e,t){let n=nD(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=QE(e);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function dD(e,t,n){let r;if(t===`viewport`||t===`layoutViewport`)r=lD(e,n,t);else if(t===`document`)r=sD(Gy(e));else if(qy(t))r=uD(t,n);else{let n=eD(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return wS(r)}function fD(e,t){let n=t.get(e);if(n)return n;let r=db(e,[],!1).filter(e=>qy(e)&&Uy(e)!==`body`),i=null,a=sb(e).position===`fixed`,o=a?lb(e):e;for(;qy(o)&&!ob(o);){let e=sb(o),t=rb(o),n=i?i.position:a?`fixed`:``;!t&&(n===`fixed`||n===`absolute`&&e.position===`static`)?r=r.filter(e=>e!==o):i=e,o=lb(o)}return t.set(e,r),r}function pD(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?Qy(t)?[]:fD(t,this._c):[].concat(n),r],o=dD(t,a[0],i),s=o.top,c=o.right,l=o.bottom,u=o.left;for(let e=1;e<a.length;e++){let n=dD(t,a[e],i);s=$x(n.top,s),c=Qx(n.right,c),l=Qx(n.bottom,l),u=$x(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function mD(e){let{width:t,height:n}=XE(e);return{width:t,height:n}}function hD(e,t,n){let r=Jy(t),i=Gy(t),a=n===`fixed`,o=nD(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=nS(0);if((r||!a)&&((Uy(t)!==`body`||Xy(i))&&(s=cb(t)),r)){let e=nD(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}!r&&i&&(c.x=rD(i));let l=i&&!r&&!a?iD(i,s):nS(0);return{x:o.left+s.scrollLeft-c.x-l.x,y:o.top+s.scrollTop-c.y-l.y,width:o.width,height:o.height}}function gD(e){return sb(e).position===`static`}function _D(e,t){if(!Jy(e)||sb(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return Gy(e)===n&&(n=n.ownerDocument.body),n}function vD(e,t){let n=Wy(e);if(Qy(e))return n;if(!Jy(e)){let t=lb(e);for(;t&&!ob(t);){if(qy(t)&&!gD(t))return t;t=lb(t)}return n}let r=_D(e,t);for(;r&&Zy(r)&&gD(r);)r=_D(r,t);return r&&ob(r)&&gD(r)&&!rb(r)?n:r||ib(e)||n}var yD=async function(e){let t=this.getOffsetParent||vD,n=this.getDimensions,r=await n(e.floating);return{reference:hD(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function bD(e){return sb(e).direction===`rtl`}var xD={convertOffsetParentRelativeRectToViewportRelativeRect:aD,getDocumentElement:Gy,getClippingRect:pD,getOffsetParent:vD,getElementRects:yD,getClientRects:oD,getDimensions:mD,getScale:QE,isElement:qy,isRTL:bD};function SD(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function CD(e,t,n){let r=null,i,a=Gy(e);function o(){var e;clearTimeout(i),(e=r)==null||e.disconnect(),r=null}function s(n,c){n===void 0&&(n=!1),c===void 0&&(c=1),o();let l=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=l;if(n||t(),!f||!p)return;let m=tS(d),h=tS(a.clientWidth-(u+f)),g=tS(a.clientHeight-(d+p)),_=tS(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:$x(0,Qx(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(!SD(l,e.getBoundingClientRect()))return s();if(n!==c){if(!y)return s();n?s(!1,n):i=setTimeout(()=>{s(!1,1e-7)},1e3)}y=!1}try{r=new IntersectionObserver(b,{...v,root:a.ownerDocument})}catch{r=new IntersectionObserver(b,v)}r.observe(e)}let c=Wy(e),l=()=>s(n);return c.addEventListener(`resize`,l),s(!0),()=>{c.removeEventListener(`resize`,l),o()}}function wD(e,t,n,r){r===void 0&&(r={});let{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver==`function`,layoutShift:s=typeof IntersectionObserver==`function`,animationFrame:c=!1}=r,l=ZE(e),u=i||a?[...l?db(l):[],...t?db(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n),a&&e.addEventListener(`resize`,n)});let d=l&&s?CD(l,n,a):null,f=-1,p=null;o&&(p=new ResizeObserver(e=>{let[r]=e;r&&r.target===l&&p&&t&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var e;(e=p)==null||e.observe(t)})),n()}),l&&!c&&p.observe(l),t&&p.observe(t));let m,h=c?nD(e):null;c&&g();function g(){let t=nD(e);h&&!SD(h,t)&&n(),h=t,m=requestAnimationFrame(g)}return n(),()=>{var e;u.forEach(e=>{i&&e.removeEventListener(`scroll`,n),a&&e.removeEventListener(`resize`,n)}),d?.(),(e=p)==null||e.disconnect(),p=null,c&&cancelAnimationFrame(m)}}var TD=KE,ED=qE,DD=UE,OD=YE,kD=JE,AD=(e,t,n)=>{let r=new Map,i=n??{},a={...xD,...i.platform,_c:r};return HE(e,t,{...i,platform:a})},jD=typeof document<`u`?U.useLayoutEffect:function(){};function MD(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e==`function`&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e==`object`){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!MD(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){let n=i[r];if(!(n===`_owner`&&e.$$typeof)&&!MD(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function ND(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function PD(e,t){let n=ND(e);return Math.round(t*n)/n}function FD(e){let t=U.useRef(e);return jD(()=>{t.current=e}),t}function ID(e){e===void 0&&(e={});let{placement:t=`bottom`,strategy:n=`absolute`,middleware:r=[],platform:i,elements:{reference:a,floating:o}={},transform:s=!0,whileElementsMounted:c,open:l}=e,[u,d]=U.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,p]=U.useState(r);MD(f,r)||p(r);let[m,h]=U.useState(null),[g,_]=U.useState(null),v=U.useCallback(e=>{e!==S.current&&(S.current=e,h(e))},[]),y=U.useCallback(e=>{e!==C.current&&(C.current=e,_(e))},[]),b=a||m,x=o||g,S=U.useRef(null),C=U.useRef(null),w=U.useRef(u),T=c!=null,E=FD(c),D=FD(i),O=FD(l),k=U.useCallback(()=>{if(!S.current||!C.current)return;let e={placement:t,strategy:n,middleware:f};D.current&&(e.platform=D.current),AD(S.current,C.current,e).then(e=>{let t={...e,isPositioned:O.current!==!1};A.current&&!MD(w.current,t)&&(w.current=t,oe.flushSync(()=>{d(t)}))})},[f,t,n,D,O]);jD(()=>{l===!1&&w.current.isPositioned&&(w.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[l]);let A=U.useRef(!1);jD(()=>(A.current=!0,()=>{A.current=!1}),[]),jD(()=>{if(b&&(S.current=b),x&&(C.current=x),b&&x){if(E.current)return E.current(b,x,k);k()}},[b,x,k,E,T]);let j=U.useMemo(()=>({reference:S,floating:C,setReference:v,setFloating:y}),[v,y]),M=U.useMemo(()=>({reference:b,floating:x}),[b,x]),N=U.useMemo(()=>{let e={position:n,left:0,top:0};if(!M.floating)return e;let t=PD(M.floating,u.x),r=PD(M.floating,u.y);return s?{...e,transform:`translate(`+t+`px, `+r+`px)`,...ND(M.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,s,M.floating,u.x,u.y]);return U.useMemo(()=>({...u,update:k,refs:j,elements:M,floatingStyles:N}),[u,k,j,M,N])}var LD=(e,t)=>{let n=TD(e);return{name:n.name,fn:n.fn,options:[e,t]}},RD=(e,t)=>{let n=ED(e);return{name:n.name,fn:n.fn,options:[e,t]}},zD=(e,t)=>({fn:kD(e).fn,options:[e,t]}),BD=(e,t)=>{let n=DD(e);return{name:n.name,fn:n.fn,options:[e,t]}},VD=(e,t)=>{let n=OD(e);return{name:n.name,fn:n.fn,options:[e,t]}},HD=U.createContext(void 0),UD=U.createContext(void 0);function WD(){let e=U.useContext(HD);if(e===void 0)throw Error(Zi(60));return e}function GD(){let e=U.useContext(UD);if(e===void 0)throw Error(Zi(61));return e}function KD(e,t,n=Object.is){let{length:r}=e;if(r!==t.length)return!1;for(let i=0;i<r;i+=1)if(!n(e[i],t[i]))return!1;return!0}var qD=(e,t)=>Object.is(e,t);function JD(e,t,n){return e==null||t==null?Object.is(e,t):n(e,t)}function YD(e,t,n){return Array.isArray(e)&&Array.isArray(t)?!KD(e,t,(e,t)=>JD(e,t,n)):e!==t}function XD(e,t,n){return e?e.some(e=>e!==void 0&&JD(t,e,n)):!1}function ZD(e,t,n){return e?e.findIndex(e=>e!==void 0&&JD(e,t,n)):-1}function QD(e,t){if(t!==qD)return n=>XD(e,n,t);let n=new Set(e);return n.delete(void 0),t=>n.has(t)&&(t!==0||e.some(e=>Object.is(t,e)))}function $D(e,t,n,r){let i=r&&Array.isArray(t)?e.findIndex(QD(t,n)):ZD(e,t,n);return i===-1?null:i}function eO(e,t,n,r,i,a){return XD(r,t,i)?a!=null&&e>a&&XD(r,n[a],i)?a:e:e===a?$D(n,r,i,!0):a}function tO(e,t,n){return e.filter(e=>!JD(t,e,n))}function nO(e){if(e==null)return``;if(typeof e==`string`)return e;try{return JSON.stringify(e)}catch{return String(e)}}function rO(e){return typeof e==`object`&&!!e&&Array.isArray(e.items)}function iO(e){return rO(e?.[0])}function aO(e){return iO(e)?e.flatMap(e=>e.items):e}function oO(e){if(!Array.isArray(e))return e!=null&&`null`in e;let t=e;if(iO(t)){for(let e of t)for(let t of e.items)if(t&&t.value==null&&t.label!=null)return!0;return!1}for(let e of t)if(e&&e.value==null&&e.label!=null)return!0;return!1}function sO(e,t){if(t&&e!=null)return t(e)??``;if(e&&typeof e==`object`){if(`label`in e&&e.label!=null)return String(e.label);if(`value`in e)return String(e.value)}return nO(e)}function cO(e,t){return t&&e!=null?t(e)??``:e&&typeof e==`object`&&`value`in e&&`label`in e?nO(e.value):nO(e)}function lO(e,t,n){function r(){return sO(e,n)}if(n&&e!=null)return n(e);if(e&&typeof e==`object`&&`label`in e&&e.label!=null)return e.label;if(t&&!Array.isArray(t))return(Object.hasOwn(t,e)?t[e]:void 0)??r();if(Array.isArray(t)){let n=aO(t);if(typeof e!=`object`||!e){let t=n.find(t=>t.value===e);return t&&t.label!=null?t.label:r()}if(`value`in e){let t=n.find(t=>t&&t.value===e.value);if(t&&t.label!=null)return t.label}}return r()}function uO(e,t,n){return e.reduce((e,r,i)=>(i>0&&e.push(`, `),e.push((0,W.jsx)(U.Fragment,{children:lO(r,t,n)},i)),e),[])}var dO={id:e=>e.id,labelId:e=>e.labelId,modal:e=>e.modal,multiple:e=>e.multiple,disabled:e=>e.disabled,readOnly:e=>e.readOnly,required:e=>e.required,highlightItemOnHover:e=>e.highlightItemOnHover,items:e=>e.items,itemToStringLabel:e=>e.itemToStringLabel,isItemEqualToValue:e=>e.isItemEqualToValue,value:e=>e.value,hasSelectedValue:e=>{let{value:t,multiple:n,itemToStringValue:r}=e;return t==null?!1:n&&Array.isArray(t)?t.length>0:cO(t,r)!==``},hasNullItemLabel:(e,t)=>t?oO(e.items):!1,open:e=>e.open,mounted:e=>e.mounted,forceMount:e=>e.forceMount,transitionStatus:e=>e.transitionStatus,openMethod:e=>e.openMethod,activeIndex:e=>e.activeIndex,selectedIndex:e=>e.selectedIndex,isActive:(e,t)=>e.activeIndex===t,isSelected:(e,t)=>{let n=e.isItemEqualToValue,r=e.value;return e.multiple?Array.isArray(r)&&r.some(e=>JD(t,e,n)):JD(t,r,n)},isSelectedByFocus:(e,t)=>e.selectedIndex===t,popupProps:e=>e.popupProps,triggerProps:e=>e.triggerProps,itemRoot:e=>e.itemRoot,triggerElement:e=>e.triggerElement,positionerElement:e=>e.positionerElement,listElement:e=>e.listElement,popupSide:e=>e.popupSide,scrollUpArrowVisible:e=>e.scrollUpArrowVisible,scrollDownArrowVisible:e=>e.scrollDownArrowVisible,hasScrollArrows:e=>e.hasScrollArrows};function fO(e){let t=U.useRef(``),n=U.useCallback(n=>{n.defaultPrevented||(t.current=n.pointerType,e(n,n.pointerType))},[e]);return{onClick:U.useCallback(n=>{n.detail===0?e(n,`keyboard`):(`pointerType`in n?e(n,n.pointerType):e(n,t.current),t.current=``)},[e]),onPointerDown:n}}function pO(e,t){let{onClick:n,onPointerDown:r}=fO(q((n,r)=>{(typeof e==`function`?e():e)||t(r||(ix?`touch`:``))}));return U.useMemo(()=>({onClick:n,onPointerDown:r}),[n,r])}function mO(e){let[t,n]=U.useState(null),r=pO(e,n);return oC(e,t=>{t&&!e&&n(null)}),U.useMemo(()=>({openMethod:t,triggerProps:r}),[t,r])}function hO(e,t=-(2**53-1),n=2**53-1){return Math.max(t,Math.min(e,n))}function gO(e,t){return Math.max(0,e-t)}function _O(e,t){if(t<=0)return 0;let n=hO(e,0,t),r=n,i=t-n,a=r<=1,o=i<=1;return a&&o?r<=i?0:t:a?0:o?t:n}function vO(e){let{id:t,value:n,defaultValue:r=null,onValueChange:i,open:a,defaultOpen:o=!1,onOpenChange:s,name:c,form:l,autoComplete:u,disabled:d=!1,readOnly:f=!1,required:p=!1,modal:m=!0,actionsRef:h,inputRef:g,onOpenChangeComplete:_,items:v,multiple:y=!1,itemToStringLabel:b,itemToStringValue:x,isItemEqualToValue:S=qD,highlightItemOnHover:C=!0,children:w}=e,{clearErrors:T}=zb(),{setDirty:E,setTouched:D,setFocused:O,validityData:k,setFilled:A,name:j,disabled:M,validation:N,validationMode:P}=Lb(),F=Zb({id:t}),I=M||d,L=j??c,[R,z]=YC({controlled:n,default:y?r??wi:r,name:`Select`,state:`value`}),[B,ee]=YC({controlled:a,default:o,name:`Select`,state:`open`}),V=U.useRef([]),te=U.useRef([]),ne=U.useRef(null),H=U.useRef(null),re=U.useRef(0),ie=U.useRef(null),ae=U.useRef([]),oe=U.useRef(!1),se=U.useRef(null),ce=U.useRef(null),le=U.useRef({allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1,dragY:0}),ue=U.useRef(!1),de=U.useRef(R),{openMethod:fe,triggerProps:pe}=mO(B),G=fi(()=>new jw({id:F,labelId:void 0,modal:m,multiple:y,disabled:I,readOnly:f,required:p,highlightItemOnHover:C,itemToStringLabel:b,itemToStringValue:x,isItemEqualToValue:S,value:R,open:B,mounted:B,transitionStatus:void 0,items:v,forceMount:!1,openMethod:null,activeIndex:null,selectedIndex:null,popupProps:Ti,triggerProps:Ti,itemRoot:{props:Ti,multiple:y,disabled:I,readOnly:f,isItemEqualToValue:S},triggerElement:null,positionerElement:null,listElement:null,popupSide:null,scrollUpArrowVisible:!1,scrollDownArrowVisible:!1,hasScrollArrows:!1},{setValue:Ci,setOpen:Ci,handleScrollArrowVisibility:Ci,onOpenChangeComplete:Ci,listRef:V,popupRef:ne,scrollHandlerRef:H,scrollArrowsMountedCountRef:re,valueRef:ie,valuesRef:ae,labelsRef:te,typingRef:oe,selectionRef:le,firstItemTextRef:se,selectedItemTextRef:ce,alignItemWithTriggerActiveRef:ue,initialValueRef:de},dO)).current,[me,he]=U.useState(!1),{mounted:ge,transitionStatus:_e,forceUnmount:ve}=BT({open:B,ref:ne,preventUnmountOnClose:me,setPreventUnmountOnClose:he,onUnmount(){G.update({activeIndex:null,openMethod:null,scrollUpArrowVisible:!1,scrollDownArrowVisible:!1}),_?.(!1)}}),ye=G.useState(`activeIndex`),be=G.useState(`selectedIndex`),xe=G.useState(`triggerElement`),Se=G.useState(`positionerElement`),Ce=mw(fe),we=fe??Ce,Te=U.useMemo(()=>y?``:cO(R,x),[y,R,x]),Ee=U.useMemo(()=>y&&Array.isArray(R)?R.map(e=>cO(e,x)):cO(R,x),[y,R,x]);aC(gw(xe),F,R,q(()=>Ee),!I,c);let De=y?Array.isArray(R)&&R.length>0:R!=null&&Te!==``;J(()=>{A(De)},[De,A]),J(function(){let e=$D(ae.current,R,S,y);e===null&&(ce.current=null),!B&&G.set(`selectedIndex`,e)},[y,B,R,S,G]),oC(R,()=>{T(L),E(YD(R,k.initialValue,S)),N.change(R)});let Oe=q((e,t)=>{let n=t,r=JT(n);s?.(e,n),!t.isCanceled&&(e||he(r()),ee(e),!e&&(t.reason===`focus-out`||t.reason===`outside-press`)&&(D(!0),O(!1),P===`onBlur`&&N.commit(R)))});U.useImperativeHandle(h,()=>({unmount:ve,close:()=>{G.state.open&&Oe(!1,$(TC))}}),[ve,Oe,G]);let ke=q((e,t)=>{i?.(e,t),!t.isCanceled&&z(e)}),Ae=q(e=>{let t=gO(e.scrollHeight,e.clientHeight),n=_O(e.scrollTop,t),r=n>0,i=n<t;G.set(`scrollUpArrowVisible`,r),G.set(`scrollDownArrowVisible`,i)}),je=fE({open:B,onOpenChange:Oe,elements:{reference:xe,floating:Se}}),Me=MT(je,{enabled:!I,event:`mousedown`}),Ne=RT(je),Pe=kE(je,{enabled:!I,listRef:V,activeIndex:ye,selectedIndex:be,disabledIndices:wi,onNavigate(e){(e!==null||B)&&G.set(`activeIndex`,e)},focusItemOnHover:C}),Fe=AE(je,{enabled:!I&&(B||!f&&!y),listRef:te,activeIndex:ye,selectedIndex:be,disabledIndices:e=>hw(V.current[e]),onMatch(e){B?G.set(`activeIndex`,e):ke(ae.current[e],$(cC))},onTyping(e){oe.current=e}}),Ie=U.useMemo(()=>Ai(Fe.reference,Pe.reference,Ne.reference,Me.reference,pe),[Me.reference,Fe.reference,Pe.reference,Ne.reference,pe]),Le=U.useMemo(()=>Ai(VT,Fe.floating,Pe.floating,Ne.floating),[Fe.floating,Pe.floating,Ne.floating]),Re=Pe.item??Ti,ze=U.useMemo(()=>({props:Re,multiple:y,disabled:I,readOnly:f,isItemEqualToValue:S}),[Re,y,I,f,S]);G.useContextCallback(`setValue`,ke),G.useContextCallback(`setOpen`,Oe),G.useContextCallback(`handleScrollArrowVisibility`,Ae),G.useContextCallback(`onOpenChangeComplete`,_),pw(()=>{G.update({popupProps:Le,triggerProps:Ie,itemRoot:ze})}),G.useSyncedValues({id:F,modal:m,multiple:y,disabled:I,readOnly:f,required:p,highlightItemOnHover:C,value:R,open:B,mounted:ge,transitionStatus:_e,popupProps:Le,triggerProps:Ie,itemRoot:ze,items:v,itemToStringLabel:b,itemToStringValue:x,isItemEqualToValue:S,openMethod:we});let Be=pi(g,N.inputRef),Ve=y?void 0:L,He=U.useMemo(()=>!y||!Array.isArray(R)||!L?null:R.map(e=>{let t=cO(e,x);return(0,W.jsx)(`input`,{type:`hidden`,form:l,name:L,value:t,disabled:I},t)}),[y,R,l,L,x,I]);return(0,W.jsxs)(HD.Provider,{value:G,children:[(0,W.jsx)(UD.Provider,{value:je,children:w}),(0,W.jsx)(`input`,{...N.getValidationProps(I,{onFocus(){G.state.triggerElement?.focus({focusVisible:!0})},onChange(e){if(e.nativeEvent.defaultPrevented||I||f)return;let t=e.currentTarget.value,n=$(cC,e.nativeEvent);function r(){if(y)return;let e=t.toLowerCase(),r=ae.current.findIndex(t=>cO(t,x).toLowerCase()===e||sO(t,b).toLowerCase()===e);r===-1&&(r=ae.current.findIndex((t,n)=>{let r=te.current[n];return r!=null&&r.toLowerCase()===e}));let i=ae.current[r];i!=null&&ke(i,n)}G.set(`forceMount`,!0),queueMicrotask(r)}}),id:F&&Ve==null?`${F}-hidden-input`:void 0,form:l,name:Ve,autoComplete:u,value:Te,disabled:I,required:p&&!(y&&De),readOnly:f,ref:Be,style:L?QC:ZC,tabIndex:-1,"aria-hidden":!0,suppressHydrationWarning:!0}),He]})}function yO(e,t){return e??t}var bO=5;function xO(e,t){let n=SO(t);return e.clientX>=n.left-bO&&e.clientX<=n.right+bO&&e.clientY>=n.top-bO&&e.clientY<=n.bottom+bO}function SO(e){let t=e.getBoundingClientRect(),n=Wy(e);if(dx)return t;let r=n.getComputedStyle(e,`::before`),i=n.getComputedStyle(e,`::after`);if(r.content===`none`&&i.content===`none`)return t;let a=parseFloat(r.width)||0,o=parseFloat(r.height)||0,s=parseFloat(i.width)||0,c=parseFloat(i.height)||0,l=Math.max(t.width,a,s),u=Math.max(t.height,o,c),d=l-t.width,f=u-t.height;return{left:t.left-d/2,right:t.right+d/2,top:t.top-f/2,bottom:t.bottom+f/2}}var CO=`data-popup-side`,wO=400,TO={...Mx,...Pb,popupSide:e=>e?{[CO]:e}:null,value:()=>null},EO=U.forwardRef(function(e,t){let{render:n,className:r,id:i,disabled:a=!1,nativeButton:o=!0,style:s,...c}=e,{setTouched:l,validationMode:u,validation:d,state:f,disabled:p}=Lb(),{labelId:m}=qb(),h=WD(),g=h.useState(`readOnly`),_=h.useState(`required`),v=h.useState(`disabled`),y=p||v||a,b=h.useState(`open`),x=h.useState(`mounted`),S=h.useState(`value`),C=h.useState(`triggerProps`),w=h.useState(`positionerElement`),T=h.useState(`listElement`),E=h.useState(`popupSide`),D=h.useState(`id`),O=h.useState(`labelId`),k=h.useState(`hasSelectedValue`),A=x&&w?E:null,j=i??D,M=yO(m,O);Zb({id:i});let N=gw(w),P=U.useRef(null),F=iC(y,P),{getButtonProps:I,buttonRef:L}=vb({disabled:y,native:o}),R=h.useStateSetter(`triggerElement`),z=ka(),B=ka(),ee=ka();U.useEffect(()=>{if(b)return ee.start(wO,()=>{h.context.selectionRef.current.allowUnselectedMouseUp=!0,h.context.selectionRef.current.allowSelectedMouseUp=!0}),()=>{ee.clear()};h.context.selectionRef.current={allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1,dragY:0},B.clear()},[b,h,B,ee]);let V=Ai(C,{id:j,role:`combobox`,"aria-expanded":b,"aria-haspopup":`listbox`,"aria-controls":b?T?.id??Ux(w)?.id:void 0,"aria-labelledby":M,"aria-readonly":g||void 0,"aria-required":_||void 0,tabIndex:y?-1:0,onFocus(e){F(!0),b&&h.context.alignItemWithTriggerActiveRef.current&&h.context.setOpen(!1,$(cC,e.nativeEvent)),z.start(0,()=>{h.set(`forceMount`,!0)})},onBlur(e){Q(w,e.relatedTarget)||(l(!0),F(!1),u===`onBlur`&&d.commit(S))},onMouseDown(e){if(b)return;let t=gb(e.currentTarget);function n(e){if(!P.current)return;let t=e.target;Q(P.current,t)||Q(N.current,t)||xO(e,P.current)||h.context.setOpen(!1,$(bC,e))}B.start(0,()=>{t.addEventListener(`mouseup`,n,{once:!0})})}},c,I),te=d.getValidationProps(y,V);te.role=`combobox`;let ne={...f,open:b,disabled:y,value:S,readOnly:g,popupSide:A,placeholder:!k};return Ui(`button`,e,{ref:[t,P,L,R],state:ne,stateAttributesMapping:TO,props:te})}),DO={value:()=>null},OO=U.forwardRef(function(e,t){let{className:n,render:r,children:i,placeholder:a,style:o,...s}=e,c=WD(),l=c.useState(`value`),u=c.useState(`items`),d=c.useState(`itemToStringLabel`),f=c.useState(`hasSelectedValue`),p=!f&&a!=null&&i==null,m=c.useState(`hasNullItemLabel`,p),h={value:l,placeholder:!f},g=null;return g=typeof i==`function`?i(l):i??(p&&!m?a:Array.isArray(l)?uO(l,u,d):lO(l,u,d)),Ui(`span`,e,{state:h,ref:[t,c.context.valueRef],props:[{children:g},s],stateAttributesMapping:DO})}),kO=U.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e;return Ui(`span`,e,{state:{open:WD().useState(`open`)},ref:t,props:[{"aria-hidden":!0,children:`▼`},a],stateAttributesMapping:jx})}),AO=U.forwardRef(function(e,t){let n=WD(),r=n.useState(`mounted`),i=n.useState(`forceMount`);return r||i?(0,W.jsx)(pT,{ref:t,...e}):null});function jO(e){return bi(19)?e:e?`true`:void 0}var MO=U.createContext({register:()=>{},unregister:()=>{},subscribeMapChange:()=>()=>{},nextIndexRef:{current:0}});function NO(){return U.useContext(MO)}function PO(e){let{children:t,elementsRef:n,labelsRef:r,onMapChange:i}=e,a=q(i),[,o]=U.useState(0),s=fi(IO).current,c=fi(FO).current,l=U.useRef(0),u=U.useRef(!0),d=U.useRef(null),f=U.useRef(null),p=q(()=>{u.current||(u.current=!0,o(e=>e+1))}),m=q((e,t)=>{c.set(e,t),p()}),h=q(e=>{c.delete(e),p()}),g=q(e=>{let t=new Map;return n.current.length=0,r&&(r.current.length=0),e.forEach(e=>{t.set(e.element,{...e.registration.metadata??{},index:e.index}),n.current[e.index]=e.element,r&&(r.current[e.index]=e.registration.label===void 0?e.registration.textRef?.current?.textContent??e.element.textContent:e.registration.label)}),l.current=n.current.length,t});function _(e){if(f.current?.disconnect(),f.current=null,typeof MutationObserver!=`function`||e.length<2)return;let t=new MutationObserver(n=>{if(!zO(n))return;let r=null;for(let n of e)if(n.isConnected){if(r&&BO(r,n)>0){t.disconnect(),p();return}r=n}});f.current=t;let n=new Set;for(let t=1;t<e.length;t+=1){let r=RO(e[t-1],e[t]);r&&n.add(r)}n.forEach(e=>t.observe(e,{childList:!0}))}let v=q(()=>{let[e,t]=LO(c),n=g(e),r=d.current,i=!r||r.length!==e.length||e.some((e,t)=>{let n=r[t];return e.index!==n.index||e.element!==n.element||e.registration.index!==n.registration.index||e.registration.metadata!==n.registration.metadata});_(t),d.current=e,u.current=!1,i&&(s.forEach(e=>e(n)),a(n))});J(()=>(!u.current&&d.current&&g(d.current),()=>{n.current=[],r&&(r.current=[])}),[n,r,g]),J(()=>{u.current&&v()}),J(()=>()=>{f.current?.disconnect(),u.current=!0},[]);let y=q(e=>(s.add(e),()=>{s.delete(e)})),b=U.useMemo(()=>({register:m,unregister:h,subscribeMapChange:y,nextIndexRef:l}),[m,h,y,l]);return(0,W.jsx)(MO.Provider,{value:b,children:t})}function FO(){return new Map}function IO(){return new Set}function LO(e){let t=new Set,n=[],r=[];e.forEach((e,i)=>{if(!i.isConnected)return;let a=e.index,o={index:a??-1,element:i,registration:e};a===null?r.push(o):a>=0&&(t.add(a),n.push(o))});let i=0;return r.sort((e,t)=>BO(e.element,t.element)),r.forEach(e=>{for(;t.has(i);)i+=1;e.index=i,n.push(e),i+=1}),t.size>0&&n.sort((e,t)=>e.index-t.index),[n,r.map(e=>e.element)]}function RO(e,t){let n=e.parentElement;for(;n&&!n.contains(t);)n=n.parentElement;return n}function zO(e){for(let t of e)for(let e=0;e<t.removedNodes.length;e+=1)if(t.removedNodes[e].isConnected)return!0;return!1}function BO(e,t){return e.nextElementSibling===t?-1:t.nextElementSibling===e?1:e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_FOLLOWING?-1:1}function VO(e){let{nodeId:t,externalTree:n,rootContext:r}=e,i=r.useState(`referenceElement`),a=r.useState(`floatingElement`),o=r.useState(`domReferenceElement`),s=r.useState(`open`),c=r.useState(`floatingId`),[l,u]=U.useState(null),d=U.useRef(null),f=yT(n),p=U.useMemo(()=>({reference:i,floating:a,domReference:o}),[i,a,o]),m=ID({...e,elements:{...p,...l&&{reference:l}}}),h=U.useCallback(e=>{let t=qy(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),getClientRects:()=>e.getClientRects(),contextElement:e}:e;u(t),m.refs.setReference(t)},[m.refs]),g=U.useMemo(()=>({...m.refs,setPositionReference:h,domReference:d}),[m.refs,h]),_=U.useMemo(()=>({...m.elements,domReference:o}),[m.elements,o]),v=U.useMemo(()=>({...m,dataRef:r.context.dataRef,open:s,onOpenChange:r.setOpen,events:r.context.events,floatingId:c,refs:g,elements:_,nodeId:t,rootStore:r}),[m,g,_,t,r,s,c]);return J(()=>{o&&(d.current=o)},[o]),J(()=>{r.context.dataRef.current.floatingContext=v;let e=f?.nodesRef.current.find(e=>e.id===t);e&&(e.context=v)}),U.useMemo(()=>({...m,context:v,refs:g,elements:_,rootStore:r}),[m,g,_,v,r])}var HO=U.createContext(void 0);function UO(){return U.useContext(HO)?.direction??`ltr`}var WO=e=>({name:`arrow`,options:e,async fn(t){let{x:n,y:r,placement:i,rects:a,platform:o,elements:s,middlewareData:c}=t,{element:l,padding:u=0}=aS(e,t)||{};if(l==null)return{};let d=CS(u),f={x:n,y:r},p=dS(i),m=lS(p),h=await o.getDimensions(l),g=p===`y`,_=g?`top`:`left`,v=g?`bottom`:`right`,y=g?`clientHeight`:`clientWidth`,b=a.reference[m]+a.reference[p]-f[p]-a.floating[m],x=f[p]-a.reference[p],S=s.floating[y]||a.floating[m],C=b/2-x/2,w=S/2-h[m]/2-1,T=Math.min(d[_],w),E=Math.min(d[v],w),D=T,O=S-h[m]-E,k=S/2-h[m]/2+C,A=iS(D,k,O),j=!c.arrow&&sS(i)!=null&&k!==A&&a.reference[m]/2-(k<D?T:E)-h[m]/2<0,M=j?k<D?k-D:k-O:0;return{[p]:f[p]+M,data:{[p]:A,centerOffset:k-A-M,...j&&{alignmentOffset:M}},reset:j}}}),GO=(e,t)=>{let{name:n,fn:r}=WO(e);return{name:n,fn:r,options:[e,t]}},KO={name:`hide`,async fn(e){let{width:t,height:n,x:r,y:i}=e.rects.reference,a=t===0&&n===0&&r===0&&i===0,o=await e.platform.detectOverflow(e,{elementContext:`reference`});return{data:{referenceHidden:o.top-n>=0||o.right-t>=0||o.bottom-n>=0||o.left-t>=0||a}}}},qO={sideX:`left`,sideY:`top`},JO=`--available-width`,YO=`--available-height`,XO=`--anchor-width`,ZO=`--anchor-height`,QO=`--transform-origin`,$O=JO,ek=YO;function tk(e,t,n){let r=e===`inline-start`||e===`inline-end`;return{top:`top`,right:r?n?`inline-start`:`inline-end`:`right`,bottom:`bottom`,left:r?n?`inline-end`:`inline-start`:`left`}[t]}function nk(e,t,n){let{rects:r,placement:i}=e;return{side:tk(t,oS(i),n),align:sS(i)||`center`,anchor:{width:r.reference.width,height:r.reference.height},positioner:{width:r.floating.width,height:r.floating.height}}}function rk(e){return ik(e,VO)}function ik(e,t){let{anchor:n,positionMethod:r=`absolute`,side:i=`bottom`,sideOffset:a=0,align:o=`center`,alignOffset:s=0,collisionBoundary:c,collisionPadding:l=5,sticky:u=!1,arrowPadding:d=5,disableAnchorTracking:f=!1,inline:p,keepMounted:m=!1,floatingRootContext:h,mounted:g,collisionAvoidance:_,shift:v,nodeId:y,adaptiveOrigin:b,lazyFlip:x=!1,externalTree:S}=e,C=_.side||`flip`,w=_.align||`flip`,T=_.fallbackAxisSide||`end`,E=v?.crossAxis??!1,D=v?.rootBoundary,O=typeof n==`function`?n:void 0,k=q(O),A=O?k:n,j=gw(n),M=gw(g),N=UO()===`rtl`,[P,F]=U.useState(null);!g&&P!==null&&F(null);let I=x===`placement`,L=P?oS(P):null,R=P&&I?sS(P)||`center`:null,z=L||{top:`top`,right:`right`,bottom:`bottom`,left:`left`,"inline-end":N?`left`:`right`,"inline-start":N?`right`:`left`}[i],B=R||o,ee=B===`center`?z:`${z}-${B}`,V=l;typeof V==`number`?V={top:V,right:V,bottom:V,left:V}:V&&={top:V.top||0,right:V.right||0,bottom:V.bottom||0,left:V.left||0};let te=+(i===`bottom`),ne=+(i===`top`),H=+(i===`right`),re=+(i===`left`),ie={boundary:c===`clipping-ancestors`?`clippingAncestors`:c,padding:V},ae=U.useRef(null),oe=gw(a),se=gw(s),ce=typeof a==`function`?0:a,le=typeof s==`function`?0:s,W=[];p&&W.push(p),W.push(LD(e=>{let t=nk(e,i,N),n=typeof oe.current==`function`?oe.current(t):oe.current,r=typeof se.current==`function`?se.current(t):se.current;return{mainAxis:n,crossAxis:r,alignmentAxis:r}},[ce,le,N,i]));let ue=w===`none`&&C!==`shift`,de=!ue&&(u||E||C===`shift`),fe=C===`none`?null:BD({...ie,padding:{top:V.top+1+te,right:V.right+1+re,bottom:V.bottom+1+ne,left:V.left+1+H},mainAxis:!E&&C===`flip`,crossAxis:w===`flip`&&`alignment`,fallbackAxisSideDirection:T}),pe=ue?null:RD({...ie,rootBoundary:D,mainAxis:w!==`none`,crossAxis:de,limiter:u||E?void 0:zD(e=>{if(!ae.current)return{};let{width:t,height:n}=ae.current.getBoundingClientRect(),r=uS(oS(e.placement)),i=r===`y`?t:n,a=r===`y`?V.left+V.right:V.top+V.bottom;return{offset:i/2+a/2}})},[ie,u,E,D,V,w]);C===`shift`||w===`shift`||B===`center`?W.push(pe,fe):W.push(fe,pe),W.push(VD({...ie,apply({elements:{floating:e},availableWidth:t,availableHeight:n,rects:r}){if(!M.current)return;let i=e.style;i.setProperty($O,`${t}px`),i.setProperty(ek,`${n}px`);let a=Wy(e).devicePixelRatio||1,{x:o,y:s,width:c,height:l}=r.reference,u=(Math.round((o+c)*a)-Math.round(o*a))/a,d=(Math.round((s+l)*a)-Math.round(s*a))/a;i.setProperty(XO,`${u}px`),i.setProperty(ZO,`${d}px`)}}),GO(e=>({element:ae.current||gb(e.elements.floating).createElement(`div`),padding:ae.current?d:0}),[d]),{name:`transformOrigin`,fn(e){let{elements:{floating:t},middlewareData:n,placement:r,platform:o,rects:s,y:c}=e,l=oS(r),u=sS(r),d=uS(l)===`y`,f=ae.current,p=typeof a==`function`?a(nk(e,i,N)):a,m;m=!f&&u&&Math.abs(d?n.shift?.x||0:n.shift?.y||0)<=1?u===`start`===(d&&o.isRTL?.(t)===!0)?`100%`:`0%`:`${(d?n.arrow?.x||0:n.arrow?.y||0)+(d?f?.clientWidth||0:f?.clientHeight||0)/2}px`;let h=l===`top`||l===`left`?`calc(100% + ${p}px)`:`${-p}px`;return de&&d&&Math.abs(n.shift?.y||0)>p&&(h=`${s.reference.y+s.reference.height/2-c}px`),t.style.setProperty(QO,d?`${m} ${h}`:`${h} ${m}`),{}}},KO,b),J(()=>{!g&&h&&h.update({referenceElement:null,floatingElement:null,domReferenceElement:null,positionReference:null})},[g,h]);let G=U.useMemo(()=>({ancestorScroll:!f,elementResize:!f&&typeof ResizeObserver<`u`,layoutShift:!f&&typeof IntersectionObserver<`u`}),[f]),{refs:me,elements:he,x:ge,y:_e,middlewareData:ve,update:ye,placement:be,context:xe,isPositioned:Se,floatingStyles:Ce}=t({rootContext:h,open:m?g:void 0,placement:ee,middleware:W,strategy:r,whileElementsMounted:m?void 0:(...e)=>wD(...e,G),nodeId:y,externalTree:S}),{sideX:we,sideY:Te}=ve.adaptiveOrigin||qO,Ee=Se?r:`fixed`,De=U.useMemo(()=>{let e;return e=Se?b?{position:Ee,[we]:ge,[Te]:_e}:{...Ce,position:Ee}:{position:Ee,top:0,left:0},e[$O]=`100vw`,e[ek]=`100vh`,Se||(e.opacity=0),e},[b,Ee,we,ge,Te,_e,Ce,Se]),Oe=U.useRef(null);J(()=>{if(!g)return;let e=j.current,t=typeof e==`function`?e():e,n=(ak(t)?t.current:t)||null;n!==Oe.current&&(me.setPositionReference(n),Oe.current=n)},[g,me,A,j]),U.useEffect(()=>{if(!g)return;let e=j.current;typeof e!=`function`&&ak(e)&&e.current!==Oe.current&&(me.setPositionReference(e.current),Oe.current=e.current)},[g,me,A,j]),U.useEffect(()=>{if(m&&g&&he.reference&&he.floating)return wD(he.reference,he.floating,ye,G)},[m,g,he,ye,G]);let ke=oS(be),Ae=tk(i,ke,N),je=sS(be)||`center`,Me=!!ve.hide?.referenceHidden;J(()=>{x&&g&&Se&&(ke!==z||I&&je!==B)&&F(be)},[x,I,g,Se,be,ke,je,z,B]);let Ne=U.useMemo(()=>({position:`absolute`,top:ve.arrow?.y,left:ve.arrow?.x}),[ve.arrow]),Pe=ve.arrow?.centerOffset!==0;return U.useMemo(()=>({positionerStyles:De,arrowStyles:Ne,arrowRef:ae,arrowUncentered:Pe,side:Ae,align:je,physicalSide:ke,anchorHidden:Me,refs:me,context:xe,isPositioned:Se,update:ye}),[De,Ne,ae,Pe,Ae,je,ke,Me,me,xe,Se,ye])}function ak(e){return e!=null&&`current`in e}var ok=U.createContext(void 0);function sk(){let e=U.useContext(ok);if(!e)throw Error(Zi(59));return e}var ck=U.forwardRef(function(e,t){let{cutout:n,...r}=e,i;if(n){let e=n.getBoundingClientRect();i=`polygon(0% 0%,100% 0%,100% 100%,0% 100%,0% 0%,${e.left}px ${e.top}px,${e.left}px ${e.bottom}px,${e.right}px ${e.bottom}px,${e.right}px ${e.top}px,${e.left}px ${e.top}px)`}return(0,W.jsx)(`div`,{ref:t,role:`presentation`,"data-base-ui-inert":``,...r,style:{position:`fixed`,inset:0,userSelect:`none`,WebkitUserSelect:`none`,clipPath:i}})});function lk(e,t){e&&Object.assign(e.style,t)}var uk={position:`relative`,maxHeight:`100%`,overflowX:`hidden`,overflowY:`auto`};function dk(e){return e===`starting`?iT:Ti}function fk(e,t,{styles:n,transitionStatus:r,props:i,refs:a,hidden:o,inert:s=!1}){let c={...n};return s&&(c.pointerEvents=`none`),Ui(`div`,e,{state:t,ref:a,props:[{role:`presentation`,hidden:o,style:c},dk(r),i],stateAttributesMapping:Nx})}var pk={},mk={},hk=``;function gk(e,t){return Xy(e)?e:t}function _k(e,t,n){return/hidden|clip/.test(e.getComputedStyle(gk(t,n)).overflowY)}function vk(e){if(typeof document>`u`)return!1;let t=gb(e);return Wy(t).innerWidth-t.documentElement.clientWidth>0}function yk(e){if(!(typeof CSS<`u`&&CSS.supports&&CSS.supports(`scrollbar-gutter`,`stable`))||typeof document>`u`)return!1;let t=gb(e),n=t.documentElement,r=t.body,i=gk(n,r),a=i.style.overflowY,o=n.style.scrollbarGutter;n.style.scrollbarGutter=`stable`,i.style.overflowY=`scroll`;let s=i.offsetWidth;i.style.overflowY=`hidden`;let c=i.offsetWidth;return i.style.overflowY=a,n.style.scrollbarGutter=o,s===c}function bk(e){let t=gb(e),n=t.documentElement,r=t.body,i=gk(n,r),a={overflowY:i.style.overflowY,overflowX:i.style.overflowX};return Object.assign(i.style,{overflowY:`hidden`,overflowX:`hidden`}),()=>{Object.assign(i.style,a)}}function xk(e){let t=gb(e),n=t.documentElement,r=t.body,i=Wy(n),a=0,o=0,s=!1,c=ua.create();if(lx&&(i.visualViewport?.scale??1)!==1)return()=>{};function l(){let t=i.getComputedStyle(n),c=i.getComputedStyle(r),l=(t.scrollbarGutter||``).includes(`both-edges`)?`stable both-edges`:`stable`;a=n.scrollTop,o=n.scrollLeft,pk={scrollbarGutter:n.style.scrollbarGutter,overflowY:n.style.overflowY,overflowX:n.style.overflowX},hk=n.style.scrollBehavior,mk={position:r.style.position,height:r.style.height,width:r.style.width,boxSizing:r.style.boxSizing,overflowY:r.style.overflowY,overflowX:r.style.overflowX,scrollBehavior:r.style.scrollBehavior};let u=n.scrollHeight>n.clientHeight,d=n.scrollWidth>n.clientWidth,f=t.overflowY===`scroll`||c.overflowY===`scroll`,p=t.overflowX===`scroll`||c.overflowX===`scroll`,m=Math.max(0,i.innerWidth-r.clientWidth),h=Math.max(0,i.innerHeight-r.clientHeight),g=parseFloat(c.marginTop)+parseFloat(c.marginBottom),_=parseFloat(c.marginLeft)+parseFloat(c.marginRight),v=gk(n,r);s=yk(e),s?(n.style.scrollbarGutter=l,v.style.overflowY=`hidden`,v.style.overflowX=`hidden`):(Object.assign(n.style,{scrollbarGutter:l,overflowY:`hidden`,overflowX:`hidden`}),(u||f)&&(n.style.overflowY=`scroll`),(d||p)&&(n.style.overflowX=`scroll`),Object.assign(r.style,{position:`relative`,height:g||h?`calc(100dvh - ${g+h}px)`:`100dvh`,width:_||m?`calc(100vw - ${_+m}px)`:`100vw`,boxSizing:`border-box`,overflowY:`hidden`,overflowX:`hidden`,scrollBehavior:`unset`}),r.scrollTop=a,r.scrollLeft=o,n.setAttribute(`data-base-ui-scroll-locked`,``),n.style.scrollBehavior=`unset`)}function u(){Object.assign(n.style,pk),Object.assign(r.style,mk),s||(n.scrollTop=a,n.scrollLeft=o,n.removeAttribute(`data-base-ui-scroll-locked`),n.style.scrollBehavior=hk)}function d(){u(),c.request(l)}l();let f=Nw(i,`resize`,d);return()=>{c.cancel(),u(),typeof i.removeEventListener==`function`&&f()}}var Sk=new class{lockCount=0;restore=null;timeoutLock=Oa.create();timeoutUnlock=Oa.create();acquire(e){return this.lockCount+=1,this.lockCount===1&&this.restore===null&&this.timeoutLock.start(0,()=>this.lock(e)),this.release}release=()=>{--this.lockCount,this.lockCount===0&&this.restore&&this.timeoutUnlock.start(0,this.unlock)};unlock=()=>{this.lockCount===0&&this.restore&&(this.restore?.(),this.restore=null)};lock(e){if(this.lockCount===0||this.restore!==null)return;let t=gb(e),n=t.documentElement,r=t.body,i=Wy(n);if(_k(i,n,r)){let t=new i.MutationObserver(()=>{_k(i,n,r)||(t.disconnect(),this.restore=null,this.lock(e))}),a={attributes:!0};t.observe(n,a),t.observe(r,a),this.restore=()=>t.disconnect();return}let a=ix||!vk(e);this.restore=a?bk(e):xk(e)}};function Ck(e=!0,t=null){J(()=>{if(e)return Sk.acquire(t)},[e,t])}var wk=20;function Tk(e,t,n,r){let[i,a]=U.useState(!1);J(()=>{if(!e||!t||n==null){a(!1);return}let r=gb(n).documentElement.clientWidth,i=n.offsetWidth;a(r>0&&i>0&&i>=r-wk)},[e,t,n]),Ck(e&&(!t||i),r)}var Ek={position:`fixed`},Dk=U.forwardRef(function(e,t){let{anchor:n,className:r,render:i,positionMethod:a,side:o,align:s,sideOffset:c,alignOffset:l,collisionBoundary:u=`clipping-ancestors`,collisionPadding:d,arrowPadding:f,sticky:p,disableAnchorTracking:m,alignItemWithTrigger:h=!0,collisionAvoidance:g=oT,style:_,...v}=e,y=WD(),b=GD(),x=y.useState(`open`),S=y.useState(`mounted`),C=y.useState(`modal`),w=y.useState(`value`),T=y.useState(`openMethod`),E=y.useState(`positionerElement`),D=y.useState(`triggerElement`),O=y.useState(`isItemEqualToValue`),k=y.useState(`transitionStatus`),A=U.useRef(null),j=U.useRef(null),[M,N]=U.useState(h),P=S&&M&&T!==`touch`;!S&&M!==h&&N(h),U.useImperativeHandle(y.context.alignItemWithTriggerActiveRef,()=>P),Tk((P||C)&&x,T===`touch`,E,D);let F=rk({anchor:n,floatingRootContext:b,positionMethod:a,mounted:S,side:o,sideOffset:c,align:s,alignOffset:l,arrowPadding:f,collisionBoundary:u,collisionPadding:d,sticky:p,disableAnchorTracking:m??P,collisionAvoidance:g,keepMounted:!0}),I=P?`none`:F.side,L=P?Ek:F.positionerStyles,R={open:x,side:I,align:F.align,anchorHidden:F.anchorHidden};J(()=>{y.set(`popupSide`,F.side)},[y,F.side]);let z=fk(e,R,{styles:L,transitionStatus:k,props:v,refs:[t,y.useStateSetter(`positionerElement`)],hidden:!S,inert:!x}),B=U.useRef(0),ee=q(e=>{if(y.context.valuesRef.current.length===0)return;let t=B.current;B.current=e.size;let n=$(cC);if(t!==0&&!y.state.multiple&&w!==null&&ZD(y.context.valuesRef.current,w,O)===-1){let e=y.context.initialValueRef.current,t=e!=null&&ZD(y.context.valuesRef.current,e,O)!==-1?e:null;y.context.setValue(t,n),t===null&&(y.set(`selectedIndex`,null),y.context.selectedItemTextRef.current=null)}if(t!==0&&y.state.multiple&&Array.isArray(w)){let e=w.filter(e=>ZD(y.context.valuesRef.current,e,O)!==-1);e.length!==w.length&&(y.context.setValue(e,n),e.length===0&&(y.set(`selectedIndex`,null),y.context.selectedItemTextRef.current=null))}if(x&&P){y.update({scrollUpArrowVisible:!1,scrollDownArrowVisible:!1});let e={height:``};lk(E,e),lk(y.context.popupRef.current,e)}}),V=U.useMemo(()=>({...F,side:I,alignItemWithTriggerActive:P,setControlledAlignItemWithTrigger:N,scrollUpArrowRef:A,scrollDownArrowRef:j}),[F,I,P,N]);return(0,W.jsx)(PO,{elementsRef:y.context.listRef,labelsRef:y.context.labelsRef,onMapChange:ee,children:(0,W.jsxs)(ok.Provider,{value:V,children:[S&&C&&(0,W.jsx)(ck,{inert:jO(!x),cutout:D}),z]})})}),Ok=`base-ui-disable-scrollbar`,kk={className:Ok,getElement(e){return(0,W.jsx)(`style`,{nonce:e,href:Ok,precedence:`base-ui:low`,children:`.${Ok}{scrollbar-width:none}.${Ok}::-webkit-scrollbar{display:none}`})}},Ak=U.createContext(void 0);function jk(e){let t=U.useContext(Ak);if(t===void 0&&!e)throw Error(Zi(69));return t}var Mk=`ArrowUp`,Nk=`ArrowDown`,Pk=`ArrowLeft`,Fk=`ArrowRight`,Ik=`Home`,Lk=new Set([Mk,Nk,Pk,Fk,Ik,`End`]),Rk=`Shift`,zk=[Rk,`Control`,`Alt`,`Meta`];function Bk(e){return Jy(e)&&e.tagName===`INPUT`}function Vk(e){return!!(Bk(e)&&e.selectionStart!=null||Jy(e)&&e.tagName===`TEXTAREA`)}function Hk(e,t,n,r){if(!e||!t||!t.scrollTo)return;let i=e.scrollLeft,a=e.scrollTop,o=e.clientWidth<e.scrollWidth,s=e.clientHeight<e.scrollHeight;if(o&&r!==`vertical`){let r=Uk(e,t,`left`),a=Wk(e),o=Wk(t);n===`ltr`&&(r+t.offsetWidth+o.scrollMarginRight>e.scrollLeft+e.clientWidth-a.scrollPaddingRight?i=r+t.offsetWidth+o.scrollMarginRight-e.clientWidth+a.scrollPaddingRight:r-o.scrollMarginLeft<e.scrollLeft+a.scrollPaddingLeft&&(i=r-o.scrollMarginLeft-a.scrollPaddingLeft)),n===`rtl`&&(r-o.scrollMarginLeft<e.scrollLeft+a.scrollPaddingLeft?i=r-o.scrollMarginLeft-a.scrollPaddingLeft:r+t.offsetWidth+o.scrollMarginRight>e.scrollLeft+e.clientWidth-a.scrollPaddingRight&&(i=r+t.offsetWidth+o.scrollMarginRight-e.clientWidth+a.scrollPaddingRight))}if(s&&r!==`horizontal`){let n=Uk(e,t,`top`),r=Wk(e),i=Wk(t);n-i.scrollMarginTop<e.scrollTop+r.scrollPaddingTop?a=n-i.scrollMarginTop-r.scrollPaddingTop:n+t.offsetHeight+i.scrollMarginBottom>e.scrollTop+e.clientHeight-r.scrollPaddingBottom&&(a=n+t.offsetHeight+i.scrollMarginBottom-e.clientHeight+r.scrollPaddingBottom)}e.scrollTo({left:i,top:a,behavior:`auto`})}function Uk(e,t,n){let r=n===`left`?`offsetLeft`:`offsetTop`,i=0;for(;t.offsetParent&&(i+=t[r],t.offsetParent!==e);)t=t.offsetParent;return i}function Wk(e){let t=getComputedStyle(e);return{scrollMarginTop:parseFloat(t.scrollMarginTop)||0,scrollMarginRight:parseFloat(t.scrollMarginRight)||0,scrollMarginBottom:parseFloat(t.scrollMarginBottom)||0,scrollMarginLeft:parseFloat(t.scrollMarginLeft)||0,scrollPaddingTop:parseFloat(t.scrollPaddingTop)||0,scrollPaddingRight:parseFloat(t.scrollPaddingRight)||0,scrollPaddingBottom:parseFloat(t.scrollPaddingBottom)||0,scrollPaddingLeft:parseFloat(t.scrollPaddingLeft)||0}}var Gk=U.createContext(void 0),Kk={disableStyleElements:!1};function qk(){return U.useContext(Gk)??Kk}var Jk=`--transform-origin`,Yk={...Nx,...Sa},Xk=U.forwardRef(function(e,t){let{render:n,className:r,style:i,finalFocus:a,...o}=e,s=WD(),c=s.useState(`multiple`),l=s.useState(`readOnly`),u=s.useState(`highlightItemOnHover`),d=GD(),{side:f,align:p,alignItemWithTriggerActive:m,isPositioned:h,setControlledAlignItemWithTrigger:g}=sk(),_=jk(!0)!=null,v=UO(),{nonce:y,disableStyleElements:b}=qk(),x=s.useState(`id`),S=s.useState(`open`),C=s.useState(`openMethod`),w=s.useState(`mounted`),T=s.useState(`popupProps`),E=s.useState(`transitionStatus`),D=s.useState(`triggerElement`),O=s.useState(`positionerElement`),k=s.useState(`listElement`),A=U.useRef(!1),j=U.useRef(!1),M=U.useRef({}),N=da(),P=q(e=>{if(!O||!s.context.popupRef.current||!j.current)return;let t=O.style.top===`0px`,n=O.style.bottom===`0px`;if(A.current||!m||!t&&!n){s.context.handleScrollArrowVisibility(e);return}let r=$k(O),i=eA(O.getBoundingClientRect().height,`y`,r),a=gb(O),o=Wy(O),c=o.getComputedStyle(O),l=parseFloat(c.marginTop),u=parseFloat(c.marginBottom),d=Zk(o.getComputedStyle(s.context.popupRef.current)),f=Math.min(a.documentElement.clientHeight-l-u,d),p=e.scrollTop,h=Qk(e),g=null,_=e=>{O.style.height=`${e}px`},v=t?h-p:p,y=Math.min(i+v,f);if(v<=1){let n=hO(v,0,f-i);n>0&&_(i+n),e.scrollTop=t?h:0,f-(i+n)<=1&&(A.current=!0),s.context.handleScrollArrowVisibility(e);return}f-y>1?g=t?1/0:0:n&&p<h&&(g=p-(v-(i+v-f)));let b=Math.ceil(y);if(b!==0&&_(b),g!=null){let t=hO(g,0,Qk(e));Math.abs(e.scrollTop-t)>1&&(e.scrollTop=t)}b>=f-1&&(A.current=!0),s.context.handleScrollArrowVisibility(e)});U.useImperativeHandle(s.context.scrollHandlerRef,()=>P,[P]),ya({open:S,ref:s.context.popupRef,onComplete(){S&&s.context.onOpenChangeComplete(!0)}});let F={open:S,transitionStatus:E,side:f,align:p};J(()=>{O&&s.context.popupRef.current&&!Object.keys(M.current).length&&(M.current={top:O.style.top||`0`,left:O.style.left||`0`,right:O.style.right,height:O.style.height,bottom:O.style.bottom,minHeight:O.style.minHeight,maxHeight:O.style.maxHeight,marginTop:O.style.marginTop,marginBottom:O.style.marginBottom})},[s,O]),J(()=>{S||m||(j.current=!1,A.current=!1,lk(O,M.current))},[S,m,O]),J(()=>{let e=s.context.popupRef.current;if(!S||!D||!O||!e||m&&!h||s.state.transitionStatus===`ending`)return;if(j.current=!0,e.style.removeProperty(Jk),!m){N.request(()=>s.context.handleScrollArrowVisibility(k||e));return}let t=rA(e);try{let t=s.context.selectedItemTextRef.current;t?.isConnected||(t=!s.select(`hasSelectedValue`)&&s.context.firstItemTextRef.current?.isConnected?s.context.firstItemTextRef.current:null);let n=s.context.valueRef.current,r=Wy(O),i=r.getComputedStyle(O),a=r.getComputedStyle(e),o=gb(D),c=$k(D),l=tA(D.getBoundingClientRect(),c),d=tA(O.getBoundingClientRect(),c),f=l.height,p=k||e,m=p.scrollHeight,h=parseFloat(a.borderBottomWidth),_=parseFloat(i.marginTop)||10,y=parseFloat(i.marginBottom)||10,b=parseFloat(i.minHeight)||100,x=Zk(a),S=o.documentElement.clientHeight-_-y,C=o.documentElement.clientWidth,w=S-l.bottom+f,T,E=v===`rtl`?l.right-d.width:l.left,j=0;if(t&&n){let e=tA(n.getBoundingClientRect(),c);T=tA(t.getBoundingClientRect(),c),E=d.left+(v===`rtl`?e.right-T.right:e.left-T.left);let r=e.top-l.top+e.height/2;j=T.top-d.top+T.height/2-r}let N=w+j+y+h,P=Math.min(S,N),F=S-_-y,I=N-P,L=C-5;O.style.left=`${hO(E,5,L-d.width)}px`,O.style.height=`${P}px`,O.style.maxHeight=`none`,O.style.marginTop=`${_}px`,O.style.marginBottom=`${y}px`,e.style.height=`100%`;let R=Qk(p),z=I>=R-1;z&&(P=Math.min(S,d.height)-(I-R));let B=l.top<20||l.bottom>S-20||Math.ceil(P)+1<Math.min(m,b),ee=(r.visualViewport?.scale??1)!==1&&lx;if(B||ee){lk(O,M.current),g(!1);return}let V=Math.max(b,P);if(z){let e=Math.max(0,S-N);O.style.top=d.height>=F?`0`:`${e}px`,O.style.height=`${P}px`,p.scrollTop=Qk(p)}else O.style.bottom=`0`,p.scrollTop=I;if(T){let t=d.top,n=d.height,r=T.top+T.height/2,i=hO(n>0?(r-t)/n*100:50,0,100);e.style.setProperty(Jk,`50% ${i}%`)}(V===S||P>=x)&&(A.current=!0),s.context.handleScrollArrowVisibility(p),u&&s.state.selectedIndex===null&&s.state.activeIndex===null&&s.context.listRef.current[0]!=null&&s.set(`activeIndex`,0)}finally{t()}},[s,S,O,D,m,g,N,k,u,v,h]),U.useEffect(()=>{if(!m||!O||!S)return;let e=Wy(O);function t(e){s.context.setOpen(!1,$(EC,e))}return Nw(e,`resize`,t)},[s,m,O,S]);let I={...k?{role:`presentation`}:{role:`listbox`,"aria-multiselectable":c||void 0,"aria-readonly":l||void 0,id:`${x}-list`},onKeyDown(e){_&&Lk.has(e.key)&&e.stopPropagation()},onScroll(e){k||P(e.currentTarget)},...m&&{style:k?{height:`100%`}:uk},className:!k&&m?kk.className:void 0},L=Ui(`div`,e,{ref:[t,s.context.popupRef],state:F,stateAttributesMapping:Yk,props:[T,I,dk(E),o]});return(0,W.jsxs)(U.Fragment,{children:[!b&&kk.getElement(y),(0,W.jsx)(jT,{context:d,modal:!1,disabled:!w,openInteractionType:C,returnFocus:a,restoreFocus:!0,children:L})]})});function Zk(e){let t=e.maxHeight;return t.endsWith(`px`)&&parseFloat(t)||1/0}function Qk(e){return gO(e.scrollHeight,e.clientHeight)}function $k(e){return xD.getScale(e)}function eA(e,t,n){return e/n[t]}function tA(e,t){return wS({x:eA(e.x,`x`,t),y:eA(e.y,`y`,t),width:eA(e.width,`x`,t),height:eA(e.height,`y`,t)})}var nA=[[`transform`,`none`],[`scale`,`1`],[`translate`,`0 0`]];function rA(e){let{style:t}=e,n={};for(let[e,r]of nA)n[e]=t.getPropertyValue(e),t.setProperty(e,r,`important`);return()=>{for(let[e]of nA){let r=n[e];r?t.setProperty(e,r):t.removeProperty(e)}}}var iA=U.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,o=WD(),s=o.useState(`multiple`),c=o.useState(`readOnly`),{alignItemWithTriggerActive:l}=sk(),u=o.useState(`hasScrollArrows`),d=o.useState(`openMethod`),f={id:`${o.useState(`id`)}-list`,role:`listbox`,"aria-multiselectable":s||void 0,"aria-readonly":c||void 0,onScroll(e){o.context.scrollHandlerRef.current?.(e.currentTarget)},...l&&{style:uk},className:u&&d!==`touch`?kk.className:void 0};return Ui(`div`,e,{ref:[t,o.useStateSetter(`listElement`)],props:[f,a]})});function aA(e={}){let{guess:t,label:n,metadata:r,textRef:i,index:a}=e,{register:o,unregister:s,subscribeMapChange:c,nextIndexRef:l}=NO(),u=U.useRef(-1),[d,f]=U.useState(a==null&&t?()=>{if(u.current===-1){let e=l.current;l.current+=1,u.current=e}return u.current}:-1),p=a??d,m=U.useRef(null),h=U.useCallback(e=>{let t=m.current;t&&s(t),m.current=e,e&&o(e,{metadata:r??null,index:a??null,label:n,textRef:i})},[a,o,s,r,n,i]);return J(()=>{if(a==null)return c(e=>{let t=m.current?e.get(m.current)?.index:null;t!=null&&f(t)})},[a,c]),{ref:h,index:p}}var oA=U.createContext(void 0);function sA(){let e=U.useContext(oA);if(!e)throw Error(Zi(57));return e}var cA=U.memo(U.forwardRef(function(e,t){let{render:n,className:r,style:i,value:a=null,label:o,disabled:s=!1,nativeButton:c=!1,...l}=e,u=U.useRef(null),d=aA({guess:!0,label:o,textRef:u}),f=WD(),{props:p,multiple:m,disabled:h,readOnly:g,isItemEqualToValue:_}=f.useState(`itemRoot`),v=h||s,y=f.useState(`isActive`,d.index),b=f.useState(`open`),x=f.useState(`isSelected`,a),S=f.useState(`isSelectedByFocus`,d.index),C=d.index,w=U.useRef(null);J(()=>{let e=f.context.valuesRef.current;return e[C]=a,()=>{delete e[C]}},[C,a,f]),J(()=>{let e=f.state.value,t=f.state.selectedIndex,n=t,r;m&&Array.isArray(e)?(n=eO(C,a,f.context.valuesRef.current,e,_,t),r=n===C,C===t&&!r&&(f.context.selectedItemTextRef.current=null)):(r=e!==void 0&&JD(a,e,_),r&&(n=C)),f.set(`selectedIndex`,n),r&&u.current&&(f.context.selectedItemTextRef.current=u.current)},[C,m,_,f,a]);let T=U.useRef(`mouse`),E=U.useRef(!1),{getButtonProps:D,buttonRef:O}=vb({disabled:v,focusableWhenDisabled:!0,native:c,composite:!0}),k={disabled:v,selected:x,highlighted:y};function A(e){if(h||g)return;let t=f.state.value;if(m){let n=Array.isArray(t)?t:[],r=x?tO(n,a,_):[...n,a];f.context.setValue(r,$(pC,e))}else f.context.setValue(a,$(pC,e)),f.context.setOpen(!1,$(pC,e))}function j(){f.context.selectionRef.current.dragY=0}let M={role:`option`,"aria-selected":x,tabIndex:b&&y?0:-1,onKeyDown(e){f.set(`activeIndex`,C),e.key===` `&&f.context.typingRef.current&&e.preventDefault()},onClick(e){let t=T.current!==`touch`,n=e.nativeEvent.pointerType,r=t&&Jx(e.nativeEvent)&&(n!==void 0||y),i=t&&!r&&!E.current;E.current=!1,!(v||i)&&A(e.nativeEvent)},onPointerEnter(e){T.current=e.pointerType},onPointerMove(e){if(e.pointerType===`mouse`&&e.buttons===1){let t=f.context.selectionRef.current;t.dragY+=e.movementY,t.dragY**2>=64&&(t.allowUnselectedMouseUp=!0)}},onPointerDown(e){T.current=e.pointerType,E.current=!0,j()},onMouseUp(){if(j(),v||T.current===`touch`||E.current)return;let e=!f.context.selectionRef.current.allowSelectedMouseUp&&x,t=!f.context.selectionRef.current.allowUnselectedMouseUp&&!x;e||t||(E.current=!0,w.current?.click(),E.current=!1)}},N=Ui(`div`,e,{ref:[O,t,d.ref,w],state:k,props:[p,M,l,D]}),P=U.useMemo(()=>({selected:x,index:C,textRef:u,selectedByFocus:S}),[x,C,u,S]);return(0,W.jsx)(oA.Provider,{value:P,children:N})})),lA=U.memo(U.forwardRef(function(e,t){let{render:n,className:r,style:i,keepMounted:a,selected:o,...s}=e,c=U.useRef(null),{transitionStatus:l,setMounted:u}=Ca(o),d=Ui(`span`,e,{ref:[t,c],state:{selected:o,transitionStatus:l},props:[{"aria-hidden":!0,children:`✔️`},s],stateAttributesMapping:Sa});return ya({batch:!0,enabled:!o,open:o,ref:c,onComplete(){o||u(!1)}}),d})),uA=U.forwardRef(function(e,t){let{selected:n}=sA();return e.keepMounted||n?(0,W.jsx)(lA,{...e,selected:n,ref:t}):null}),dA=U.memo(U.forwardRef(function(e,t){let{index:n,textRef:r,selectedByFocus:i}=sA(),a=WD(),{render:o,className:s,style:c,...l}=e;return Ui(`div`,e,{ref:[U.useCallback(e=>{e&&(n===0&&(a.context.firstItemTextRef.current=e),i&&(a.context.selectedItemTextRef.current=e))},[a,n,i]),t,r],props:l})})),fA=U.forwardRef(function(e,t){let{render:n,className:r,style:i,direction:a,keepMounted:o,...s}=e,c=a===`up`,l=WD(),{side:u,scrollDownArrowRef:d,scrollUpArrowRef:f}=sk(),p=c?`scrollUpArrowVisible`:`scrollDownArrowVisible`,m=l.useState(p),h=l.useState(`openMethod`),g=m&&h!==`touch`,_=ka(),v=c?f:d,{mounted:y,transitionStatus:b,setMounted:x}=Ca(g);J(()=>(l.context.scrollArrowsMountedCountRef.current+=1,l.set(`hasScrollArrows`,!0),()=>{l.context.scrollArrowsMountedCountRef.current=Math.max(0,l.context.scrollArrowsMountedCountRef.current-1),l.context.scrollArrowsMountedCountRef.current===0&&l.set(`hasScrollArrows`,!1)}),[l]),ya({open:g,ref:v,onComplete(){g||x(!1)}});let S=Ui(`div`,e,{ref:[t,v],state:{direction:a,visible:g,side:u,transitionStatus:b},props:[{"aria-hidden":!0,children:c?`▲`:`▼`,style:{position:`absolute`},onMouseMove(e){if(e.movementX===0&&e.movementY===0||_.isStarted())return;l.set(`activeIndex`,null);function t(){let e=l.state.listElement??l.context.popupRef.current;if(!e)return;l.set(`activeIndex`,null),l.context.handleScrollArrowVisibility(e);let n=gO(e.scrollHeight,e.clientHeight),r=_O(e.scrollTop,n),i=r===(c?0:n),a=l.context.listRef.current;if(r!==e.scrollTop&&(e.scrollTop=r),i)_.clear();else{if(a.length>0){let t=v.current?.offsetHeight||0;e.scrollTop=pA(a,c,r,e.clientHeight,t,n)}_.start(40,t)}}_.start(40,t)},onMouseLeave(){_.clear()}},s],stateAttributesMapping:Sa});return y||o?S:null});function pA(e,t,n,r,i,a){if(t){let t=0,r=n+i-1;for(let n=0;n<e.length;n+=1){let i=e[n];if(i&&i.offsetTop>=r){t=n;break}}let o=Math.max(0,t-1),s=e[o];return o<t&&s?_O(s.offsetTop-i,a):0}let o=e.length-1,s=n+r-i+1;for(let t=0;t<e.length;t+=1){let n=e[t];if(n&&n.offsetTop+n.offsetHeight>s){o=Math.max(0,t-1);break}}let c=Math.min(e.length-1,o+1),l=e[c];return c>o&&l?_O(l.offsetTop+l.offsetHeight-r+i,a):a}var mA=U.forwardRef(function(e,t){return(0,W.jsx)(fA,{...e,ref:t,direction:`down`})}),hA=U.forwardRef(function(e,t){return(0,W.jsx)(fA,{...e,ref:t,direction:`up`})}),gA=U.createContext(void 0);function _A(){let e=U.useContext(gA);if(e===void 0)throw Error(Zi(56));return e}var vA=U.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,[o,s]=U.useState(),c=U.useMemo(()=>({labelId:o,setLabelId:s}),[o,s]),l=Ui(`div`,e,{ref:t,props:[{role:`group`,"aria-labelledby":o},a]});return(0,W.jsx)(gA.Provider,{value:c,children:l})}),yA=U.forwardRef(function(e,t){let{render:n,className:r,style:i,id:a,...o}=e,{setLabelId:s}=_A(),c=Gb(a);return J(()=>(s(c),()=>{s(e=>e===c?void 0:e)}),[c,s]),Ui(`div`,e,{ref:t,props:[{id:c,"aria-hidden":!0},o]})}),bA=vO;function xA({className:e,...t}){return(0,W.jsx)(vA,{"data-slot":`select-group`,className:K(`scroll-my-1 p-1`,e),...t})}function SA({className:e,...t}){return(0,W.jsx)(OO,{"data-slot":`select-value`,className:K(`flex flex-1 text-left`,e),...t})}function CA({className:e,size:t=`default`,children:n,...r}){return(0,W.jsxs)(EO,{"data-slot":`select-trigger`,"data-size":t,className:K(`flex w-fit items-center justify-between gap-1.5 rounded-md border border-input bg-transparent py-2 pr-2 pl-2.5 text-[13px] whitespace-nowrap transition-colors outline-none select-none focus-visible:border-primary focus-visible:ring-2 focus-visible:ring-primary/20 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 data-placeholder:text-muted-foreground data-[size=default]:h-8 data-[size=sm]:h-7 data-[size=sm]:rounded-[min(var(--radius-md),10px)] *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-1.5 dark:bg-input/30 dark:hover:bg-input/50 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,e),...r,children:[n,(0,W.jsx)(kO,{render:(0,W.jsx)(en,{className:`pointer-events-none size-4 text-muted-foreground`})})]})}function wA({className:e,children:t,side:n=`bottom`,sideOffset:r=4,align:i=`center`,alignOffset:a=0,alignItemWithTrigger:o=!0,...s}){return(0,W.jsx)(AO,{children:(0,W.jsx)(Dk,{side:n,sideOffset:r,align:i,alignOffset:a,alignItemWithTrigger:o,className:`isolate z-50`,children:(0,W.jsxs)(Xk,{"data-slot":`select-content`,"data-align-trigger":o,className:K(`relative isolate z-50 max-h-(--available-height) w-(--anchor-width) min-w-36 origin-(--transform-origin) overflow-x-hidden overflow-y-auto rounded-lg bg-popover text-popover-foreground border border-border/70 shadow-float duration-100 data-[align-trigger=true]:animate-none data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95`,e),...s,children:[(0,W.jsx)(DA,{}),(0,W.jsx)(iA,{children:t}),(0,W.jsx)(OA,{})]})})})}function TA({className:e,...t}){return(0,W.jsx)(yA,{"data-slot":`select-label`,className:K(`px-1.5 py-1 text-xs text-muted-foreground`,e),...t})}function EA({className:e,children:t,...n}){return(0,W.jsxs)(cA,{"data-slot":`select-item`,className:K(`relative flex w-full cursor-default items-center gap-1.5 rounded-md py-1 pr-8 pl-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2`,e),...n,children:[(0,W.jsx)(dA,{className:`flex flex-1 shrink-0 gap-2 whitespace-nowrap`,children:t}),(0,W.jsx)(uA,{render:(0,W.jsx)(`span`,{className:`pointer-events-none absolute right-2 flex size-4 items-center justify-center`}),children:(0,W.jsx)(Qt,{className:`pointer-events-none`})})]})}function DA({className:e,...t}){return(0,W.jsx)(hA,{"data-slot":`select-scroll-up-button`,className:K(`top-0 z-10 flex w-full cursor-default items-center justify-center bg-popover py-1 [&_svg:not([class*='size-'])]:size-4`,e),...t,children:(0,W.jsx)(nn,{})})}function OA({className:e,...t}){return(0,W.jsx)(mA,{"data-slot":`select-scroll-down-button`,className:K(`bottom-0 z-10 flex w-full cursor-default items-center justify-center bg-popover py-1 [&_svg:not([class*='size-'])]:size-4`,e),...t,children:(0,W.jsx)(en,{})})}var kA=U.createContext(void 0);function AA(e){let t=U.useContext(kA);if(!e&&t===void 0)throw Error(Zi(27));return t}var jA=U.forwardRef(function(e,t){let{render:n,className:r,style:i,forceRender:a=!1,...o}=e,s=AA(),c=s.useState(`open`),l=s.useState(`nested`),u=s.useState(`mounted`);return Ui(`div`,e,{state:{open:c,transitionStatus:s.useState(`transitionStatus`)},ref:[s.context.backdropRef,t],stateAttributesMapping:Px,props:[{role:`presentation`,hidden:!u,style:{userSelect:`none`,WebkitUserSelect:`none`}},o],enabled:a||!l})}),MA=U.forwardRef(function(e,t){let{render:n,className:r,style:i,disabled:a=!1,nativeButton:o=!0,...s}=e,c=AA(),l=c.useState(`open`),{getButtonProps:u,buttonRef:d}=vb({disabled:a,native:o}),f={disabled:a};function p(e){l&&c.setOpen(!1,$(mC,e.nativeEvent))}return Ui(`button`,e,{state:f,ref:[t,d],props:[{onClick:p},s,u]})}),NA=U.forwardRef(function(e,t){let{render:n,className:r,style:i,id:a,...o}=e,s=AA(),c=Gb(a);return s.useSyncedValueWithCleanup(`descriptionElementId`,c),Ui(`p`,e,{ref:t,props:[{id:c},o]})}),PA=U.createContext(void 0);function FA(){let e=U.useContext(PA);if(e===void 0)throw Error(Zi(26));return e}var IA=`--nested-dialogs`,LA=`data-nested-dialog-open`,RA={...Nx,...Sa,nestedDialogOpen(e){return e?{[LA]:``}:null}},zA=U.forwardRef(function(e,t){let{render:n,className:r,style:i,finalFocus:a,initialFocus:o,...s}=e,c=AA(),l=c.useState(`descriptionElementId`),u=c.useState(`disablePointerDismissal`),d=c.useState(`floatingRootContext`),f=c.useState(`popupProps`),p=c.useState(`modal`),m=c.useState(`mounted`),h=c.useState(`nested`),g=c.useState(`nestedOpenDialogCount`),_=c.useState(`open`),v=c.useState(`openMethod`),y=c.useState(`titleElementId`),b=c.useState(`transitionStatus`),x=c.useState(`role`),S=d.useState(`floatingId`);FA(),ya({open:_,ref:c.context.popupRef,onComplete(){_&&c.context.onOpenChangeComplete?.(!0)}});let C=o===void 0?HT(c.context.popupRef):o,w=g>0,T=c.useStateSetter(`popupElement`),E=Ui(`div`,e,{state:{open:_,nested:h,transitionStatus:b,nestedDialogOpen:w},props:[f,{id:S,"aria-labelledby":y,"aria-describedby":l,role:x,...VT,hidden:!m,onKeyDown(e){Lk.has(e.key)&&e.stopPropagation()},style:{[IA]:g}},s],ref:[t,c.context.popupRef,T],stateAttributesMapping:RA});return(0,W.jsx)(jT,{context:d,openInteractionType:v,disabled:!m,closeOnFocusOut:!u,initialFocus:C,returnFocus:a,modal:p!==!1,restoreFocus:`popup`,children:E})}),BA=U.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e,i=AA(),a=i.useState(`mounted`),o=i.useState(`modal`),s=i.useState(`open`);return a||n?(0,W.jsx)(PA.Provider,{value:n,children:(0,W.jsxs)(pT,{ref:t,...r,children:[a&&o===!0&&(0,W.jsx)(ck,{ref:i.context.internalBackdropRef,inert:jO(!s)}),e.children]})}):null});function VA({store:e,parentContext:t,isDrawer:n}){let r=e.useState(`open`),i=e.useState(`mounted`),a=e.useState(`disablePointerDismissal`),o=e.useState(`modal`),s=e.useState(`popupElement`),c=e.useState(`floatingRootContext`),[l,u]=U.useState(0),[d,f]=U.useState(0),p=l===0,m=RT(c,{outsidePressEvent(){return e.context.internalBackdropRef.current||e.context.backdropRef.current?`intentional`:{mouse:o===`trap-focus`?`sloppy`:`intentional`,touch:`sloppy`}},outsidePress(t){if(!e.context.outsidePressEnabledRef.current||`button`in t&&t.button!==0)return!1;if(`touches`in t){if(t.type===`touchend`){if(t.changedTouches.length!==1||t.touches.length!==0)return!1}else if(t.touches.length!==1)return!1}let n=mx(t);if(p&&!a){if(o){let t=e.context.internalBackdropRef.current,r=e.context.backdropRef.current;return t||r?t===n||r===n||Q(n,s)&&!n?.hasAttribute(`data-base-ui-portal`):!0}return!0}return!1},escapeKey:p});return Ck(r&&o===!0,s),e.useContextCallback(`onNestedDialogOpen`,(t,n)=>{(e.select(`open`)||e.select(`mounted`))&&(u(t),f(n))}),J(()=>{!r&&!i&&(u(0),f(0))},[r,i]),J(()=>(t?.onNestedDialogOpen&&r&&t.onNestedDialogOpen(l+1,d+ +!!n),()=>{t?.onNestedDialogOpen&&r&&t.onNestedDialogOpen(0,0)}),[n,r,l,d,t]),$T(e,{activeTriggerProps:m.reference,inactiveTriggerProps:m.trigger,popupProps:m.floating,nestedOpenDialogCount:l,nestedOpenDrawerCount:d}),null}var HA={...uE,modal:e=>e.modal,nested:e=>e.nested,nestedOpenDialogCount:e=>e.nestedOpenDialogCount,nestedOpenDrawerCount:e=>e.nestedOpenDrawerCount,disablePointerDismissal:e=>e.disablePointerDismissal,openMethod:e=>e.openMethod,descriptionElementId:e=>e.descriptionElementId,titleElementId:e=>e.titleElementId,viewportElement:e=>e.viewportElement,role:e=>e.role},UA=class extends jw{constructor(e,t,n){let r=new tE,i=WA(e,r,t,n);super(i,GA(r),HA)}setOpen=(e,t)=>{t.preventUnmountOnClose=()=>{this.set(`preventUnmountingOnClose`,!0)},!e&&t.trigger==null&&this.state.activeTriggerId!=null&&(t.trigger=this.state.activeTriggerElement??void 0),this.context.onOpenChange?.(e,t),!t.isCanceled&&(this.state.floatingRootContext.dispatchOpenChange(e,t),this.update(qT(this.state,e,t.trigger)))}};function WA(e,t,n,r=!1){return{...iE(t,n,r),modal:!0,disablePointerDismissal:!1,viewportElement:null,descriptionElementId:void 0,titleElementId:void 0,openMethod:null,nested:!1,nestedOpenDialogCount:0,nestedOpenDrawerCount:0,role:`dialog`,...e}}function GA(e){return{popupRef:U.createRef(),backdropRef:U.createRef(),internalBackdropRef:U.createRef(),outsidePressEnabledRef:{current:!0},triggerElements:e,onOpenChange:void 0,onOpenChangeComplete:void 0}}function KA(e,t){let{children:n,open:r,defaultOpen:i=!1,onOpenChange:a,onOpenChangeComplete:o,disablePointerDismissal:s=!1,modal:c=!0,actionsRef:l,handle:u,triggerId:d,defaultTriggerId:f=null}=t,p=e===`drawer`,m=e===`alert-dialog`,h=m?!0:c,g=m||s,_=m?`alertdialog`:`dialog`,v=AA(!0),y={modal:h,disablePointerDismissal:g,nested:v!=null,role:_},b=UT((e,t)=>new UA({open:i,openProp:r,activeTriggerId:f,triggerIdProp:d,...y},e,t),!0);b.useControlledProp(`openProp`,r),b.useControlledProp(`triggerIdProp`,d),b.useSyncedValues(y),b.useContextCallback(`onOpenChange`,a),b.useContextCallback(`onOpenChangeComplete`,o);let x=b.useState(`open`),S=b.useState(`mounted`),C=b.useState(`payload`);eE(b,x),ZT(b);let{forceUnmount:w}=QT(x,b);U.useImperativeHandle(l,()=>({unmount:w,close:()=>b.setOpen(!1,$(TC))}),[w,b]);let T=x||S||u!=null;return(0,W.jsxs)(kA.Provider,{value:b,children:[u&&(0,W.jsx)(WT,{handle:u,store:b}),T&&(0,W.jsx)(VA,{store:b,parentContext:v?.context,isDrawer:p}),typeof n==`function`?n({payload:C}):n]})}var qA=Sw(function(e){return KA(`dialog`,e)}),JA=U.forwardRef(function(e,t){let{render:n,className:r,style:i,id:a,...o}=e,s=AA(),c=Gb(a);return s.useSyncedValueWithCleanup(`titleElementId`,c),Ui(`h2`,e,{ref:t,props:[{id:c},o]})}),YA=Cw(function(e,t){let{render:n,className:r,style:i,disabled:a=!1,nativeButton:o=!0,id:s,payload:c,handle:l,...u}=e,d=AA(!0),f=dE(l)??d;if(!f)throw Error(Zi(79));let p=Gb(s),m=f.useState(`floatingRootContext`),h=f.useState(`isOpenedByTrigger`,p),g=f.useState(`triggerPopupId`,p),_=U.useRef(null),{registerTrigger:v,isMountedByThisTrigger:y}=XT(p,_,f,{payload:c}),{getButtonProps:b,buttonRef:x}=vb({disabled:a,native:o}),S=MT(m),C=pO(()=>f.select(`open`),e=>{f.set(`openMethod`,e)}),w={disabled:a,open:h},T=f.useState(`triggerProps`,y);return Ui(`button`,e,{state:w,ref:[x,t,v,_],props:[S.reference,T,C,{[aT]:``,id:p,"aria-haspopup":`dialog`,"aria-expanded":h,"aria-controls":g},u,b],stateAttributesMapping:jx})});function XA({...e}){return(0,W.jsx)(qA,{"data-slot":`dialog`,...e})}function ZA({...e}){return(0,W.jsx)(YA,{"data-slot":`dialog-trigger`,...e})}function QA({...e}){return(0,W.jsx)(BA,{"data-slot":`dialog-portal`,...e})}function $A({...e}){return(0,W.jsx)(MA,{"data-slot":`dialog-close`,...e})}function ej({className:e,...t}){return(0,W.jsx)(jA,{"data-slot":`dialog-overlay`,className:K(`fixed inset-0 isolate z-50 bg-black/10 duration-100 supports-backdrop-filter:backdrop-blur-xs data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0`,e),...t})}function tj({className:e,children:t,showCloseButton:n=!0,...r}){let i=U.useRef(null);return(0,W.jsxs)(QA,{children:[(0,W.jsx)(ej,{}),(0,W.jsxs)(zA,{ref:i,"data-slot":`dialog-content`,initialFocus:()=>i.current?.querySelector(`input:not([type=hidden]):not([disabled]), textarea:not([disabled]), select:not([disabled]), [role=combobox]:not([disabled])`)??i.current,className:K(`fixed top-1/2 left-1/2 z-50 grid w-full max-w-[calc(100%-2rem)] -translate-x-1/2 -translate-y-1/2 gap-4 rounded-xl bg-popover p-4 text-sm text-popover-foreground border border-border/70 shadow-overlay duration-100 outline-none sm:max-w-sm data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95`,e),...r,children:[t,n&&(0,W.jsxs)(MA,{"data-slot":`dialog-close`,render:(0,W.jsx)(kb,{variant:`ghost`,className:`absolute top-2 right-2`,size:`icon-sm`}),children:[(0,W.jsx)(Fn,{}),(0,W.jsx)(`span`,{className:`sr-only`,children:I(`shell.primitive.close`)})]})]})]})}function nj({className:e,...t}){return(0,W.jsx)(`div`,{"data-slot":`dialog-header`,className:K(`flex flex-col gap-2`,e),...t})}function rj({className:e,showCloseButton:t=!1,children:n,...r}){return(0,W.jsxs)(`div`,{"data-slot":`dialog-footer`,className:K(`-mx-4 -mb-4 flex flex-col-reverse gap-2 rounded-b-xl border-t bg-muted/50 p-4 sm:flex-row sm:justify-end`,e),...r,children:[n,t&&(0,W.jsx)(MA,{render:(0,W.jsx)(kb,{variant:`outline`}),children:I(`shell.primitive.close`)})]})}function ij({className:e,...t}){return(0,W.jsx)(JA,{"data-slot":`dialog-title`,className:K(`font-heading text-base leading-none font-medium`,e),...t})}function aj({className:e,...t}){return(0,W.jsx)(NA,{"data-slot":`dialog-description`,className:K(`text-sm text-muted-foreground *:[a]:underline *:[a]:underline-offset-3 *:[a]:hover:text-foreground`,e),...t})}function oj(e){return KA(`alert-dialog`,e)}var sj=YA;function cj({...e}){return(0,W.jsx)(oj,{"data-slot":`alert-dialog`,...e})}function lj({...e}){return(0,W.jsx)(sj,{"data-slot":`alert-dialog-trigger`,...e})}function uj({...e}){return(0,W.jsx)(BA,{"data-slot":`alert-dialog-portal`,...e})}function dj({className:e,...t}){return(0,W.jsx)(jA,{"data-slot":`alert-dialog-overlay`,className:K(`fixed inset-0 isolate z-50 bg-black/10 duration-100 supports-backdrop-filter:backdrop-blur-xs data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0`,e),...t})}function fj({className:e,size:t=`default`,...n}){return(0,W.jsxs)(uj,{children:[(0,W.jsx)(dj,{}),(0,W.jsx)(zA,{"data-slot":`alert-dialog-content`,"data-size":t,className:K(`group/alert-dialog-content fixed top-1/2 left-1/2 z-50 grid w-full -translate-x-1/2 -translate-y-1/2 gap-4 rounded-xl bg-popover p-4 text-popover-foreground border border-border/70 shadow-overlay duration-100 outline-none data-[size=default]:max-w-xs data-[size=sm]:max-w-xs data-[size=default]:sm:max-w-sm data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95`,e),...n})]})}function pj({className:e,...t}){return(0,W.jsx)(`div`,{"data-slot":`alert-dialog-header`,className:K(`grid grid-rows-[auto_1fr] place-items-center gap-1.5 text-center has-data-[slot=alert-dialog-media]:grid-rows-[auto_auto_1fr] has-data-[slot=alert-dialog-media]:gap-x-4 sm:group-data-[size=default]/alert-dialog-content:place-items-start sm:group-data-[size=default]/alert-dialog-content:text-left sm:group-data-[size=default]/alert-dialog-content:has-data-[slot=alert-dialog-media]:grid-rows-[auto_1fr]`,e),...t})}function mj({className:e,...t}){return(0,W.jsx)(`div`,{"data-slot":`alert-dialog-footer`,className:K(`-mx-4 -mb-4 flex flex-col-reverse gap-2 rounded-b-xl border-t bg-muted/50 p-4 group-data-[size=sm]/alert-dialog-content:grid group-data-[size=sm]/alert-dialog-content:grid-cols-2 sm:flex-row sm:justify-end`,e),...t})}function hj({className:e,...t}){return(0,W.jsx)(JA,{"data-slot":`alert-dialog-title`,className:K(`font-heading text-base font-medium sm:group-data-[size=default]/alert-dialog-content:group-has-data-[slot=alert-dialog-media]/alert-dialog-content:col-start-2`,e),...t})}function gj({className:e,...t}){return(0,W.jsx)(NA,{"data-slot":`alert-dialog-description`,className:K(`text-sm text-balance text-muted-foreground md:text-pretty *:[a]:underline *:[a]:underline-offset-3 *:[a]:hover:text-foreground`,e),...t})}function _j({className:e,...t}){return(0,W.jsx)(kb,{"data-slot":`alert-dialog-action`,className:K(e),...t})}function vj({className:e,variant:t=`outline`,size:n=`default`,...r}){return(0,W.jsx)(MA,{"data-slot":`alert-dialog-cancel`,className:K(e),render:(0,W.jsx)(kb,{variant:t,size:n}),...r})}var yj=U.createContext(void 0);function bj(e){let t=U.useContext(yj);if(t===void 0&&!e)throw Error(Zi(72));return t}var xj={...uE,disabled:e=>e.disabled,instantType:e=>e.instantType,isInstantPhase:e=>e.isInstantPhase,trackCursorAxis:e=>e.trackCursorAxis,disableHoverablePopup:e=>e.disableHoverablePopup,lastOpenChangeReason:e=>e.openChangeReason,closeOnClick:e=>e.closeOnClick,appliedTriggerProps:(e,t)=>t?e.activeTriggerProps:void 0,closeDelay:e=>e.closeDelay,adaptiveOrigin:e=>e.adaptiveOrigin},Sj=class extends jw{constructor(e,t,n){let r=new tE;super(Cj(e,r,t,n),wj(r),xj)}setOpen=(e,t)=>{YT(this,e,t,{extraState:{openChangeReason:t.reason}})};cancelPendingOpen(e){this.state.floatingRootContext.dispatchOpenChange(!1,$(lC,e))}};function Cj(e,t,n,r=!1){return{...iE(t,n,r),disabled:!1,instantType:void 0,isInstantPhase:!1,trackCursorAxis:`none`,disableHoverablePopup:!1,openChangeReason:null,closeOnClick:!0,closeDelay:0,adaptiveOrigin:void 0,...e}}function wj(e){return{popupRef:U.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerElements:e}}var Tj=Sw(function(e){let{disabled:t=!1,defaultOpen:n=!1,open:r,disableHoverablePopup:i=!1,trackCursorAxis:a=`none`,actionsRef:o,onOpenChange:s,onOpenChangeComplete:c,handle:l,triggerId:u,defaultTriggerId:d=null,children:f}=e,p=UT((e,t)=>new Sj({open:n,openProp:r,activeTriggerId:d,triggerIdProp:u},e,t));p.useControlledProp(`openProp`,r),p.useControlledProp(`triggerIdProp`,u),p.useContextCallback(`onOpenChange`,s),p.useContextCallback(`onOpenChangeComplete`,c);let m=p.useState(`open`),h=!t&&m,g=p.useState(`activeTriggerId`),_=p.useState(`mounted`),v=p.useState(`payload`);p.useSyncedValues({trackCursorAxis:a,disableHoverablePopup:i,disabled:t}),ZT(p,{closeOnActiveTriggerUnmount:!0});let{forceUnmount:y,transitionStatus:b}=QT(h,p),x=p.useState(`isInstantPhase`),S=p.useState(`instantType`),C=p.useState(`lastOpenChangeReason`),w=U.useRef(null);J(()=>{m&&t&&p.setOpen(!1,$(SC))},[m,t,p]),J(()=>{b===`ending`&&C===`none`||b!==`ending`&&x?(S!==`delay`&&(w.current=S),p.set(`instantType`,`delay`)):w.current!==null&&(p.set(`instantType`,w.current),w.current=null)},[b,x,C,S,p]),J(()=>{h&&(g??p.set(`payload`,void 0))},[p,g,h]),U.useImperativeHandle(o,()=>({unmount:y,close:()=>p.setOpen(!1,$(TC))}),[y,p]);let T=h||_||!t&&a!==`none`;return(0,W.jsxs)(yj.Provider,{value:p,children:[l&&(0,W.jsx)(WT,{handle:l,store:p}),T&&(0,W.jsx)(Ej,{store:p,disabled:t,trackCursorAxis:a}),typeof f==`function`?f({payload:v}):f]})});function Ej({store:e,disabled:t,trackCursorAxis:n}){let r=e.useState(`floatingRootContext`),i=RT(r,{enabled:!t,referencePress:()=>e.select(`closeOnClick`)}),a=FT(r,{enabled:!t&&n!==`none`,axis:n===`none`?void 0:n}),o=U.useMemo(()=>Ai(a.reference,i.reference),[a.reference,i.reference]);return $T(e,{activeTriggerProps:o,inactiveTriggerProps:o,popupProps:i.floating??Ti}),null}var Dj=U.createContext(void 0);function Oj(){return U.useContext(Dj)}var kj=`data-base-ui-tooltip-trigger`;function Aj(e){let t=mx(e);return qy(t)?t:null}var jj=Cw(function(e,t){let{render:n,className:r,style:i,handle:a,payload:o,disabled:s,delay:c,closeOnClick:l=!0,closeDelay:u,id:d,...f}=e,p=bj(!0),m=dE(a)??p;if(!m)throw Error(Zi(82));let h=Gb(d),g=m.useState(`isTriggerActive`,h),_=m.useState(`isOpenedByTrigger`,h),v=m.useState(`floatingRootContext`),y=U.useRef(null),b=u??0,{registerTrigger:x,isMountedByThisTrigger:S}=XT(h,y,m,{payload:o,closeOnClick:l,closeDelay:b}),C=Oj(),{activeIdRef:w,delayRef:T,isInstantPhase:E,hasProvider:D}=Hw(v,{open:_}),O=yE(v);m.useSyncedValue(`isInstantPhase`,E);let k=m.useState(`disabled`),A=s??k,j=gw(A),M=m.useState(`trackCursorAxis`),N=m.useState(`disableHoverablePopup`),P=U.useRef(!1),F=ka(),I=U.useRef(void 0);function L(){return D&&w.current!=null?0:c??C??600}function R(e){let t=y.current;if(!t||!e)return!1;let n=px(e,`[${kj}]`);return n!==null&&n!==t&&Q(t,n)}function z(e){let t=R(e);return P.current=t,t&&(O.openChangeTimeout.clear(),O.restTimeout.clear(),O.restTimeoutPending=!1,F.clear()),t}let B=SE(v,{enabled:!A,mouseOnly:!0,move:!1,handleClose:!N&&M!==`both`?RE():null,restMs:L,delay(){return u==null&&D?{close:Fw(T.current,`close`)}:{close:b}},triggerElementRef:y,isActiveTrigger:g,isClosing:()=>m.select(`transitionStatus`)===`ending`,shouldOpen(){return!P.current}}),ee=mE(v,{enabled:!A}).reference,V=e=>{let t=P.current,n=Aj(e),r=z(n),i=y.current,a=i&&n&&Q(i,n);if(r&&m.select(`open`)&&m.select(`lastOpenChangeReason`)===`trigger-hover`)m.setOpen(!1,$(uC,e));else if(t&&!r&&a&&!j.current&&!m.select(`open`)&&i&&Xx(I.current)){let t=()=>{!P.current&&!j.current&&!m.select(`open`)&&m.setOpen(!0,$(uC,e,i))},n=L();n===0?(F.clear(),t()):F.start(n,t)}},te=m.useState(`appliedTriggerProps`,S||M!==`none`);return Ui(`button`,e,{state:{open:_},ref:[t,x,y],props:[B,ee,te,{onMouseOver(e){V(e.nativeEvent)},onFocus(e){R(Aj(e.nativeEvent))&&e.preventBaseUIHandler()},onMouseLeave(){P.current=!1,F.clear(),I.current=void 0},onPointerEnter(e){I.current=e.pointerType},onPointerDown(e){I.current=e.pointerType,m.set(`closeOnClick`,l),l&&!m.select(`open`)&&m.cancelPendingOpen(e.nativeEvent)},onClick(e){l&&!m.select(`open`)&&m.cancelPendingOpen(e.nativeEvent)},id:h,[Fx]:A?``:void 0,[kj]:A?void 0:``},f],stateAttributesMapping:jx})}),Mj=U.createContext(void 0);function Nj(){let e=U.useContext(Mj);if(e===void 0)throw Error(Zi(70));return e}var Pj=U.forwardRef(function(e,t){let{children:n,container:r,className:i,render:a,style:o,...s}=e,{node:c,subtree:l}=fT({container:r,ref:t,componentProps:e,elementProps:s});return!l&&!c?null:(0,W.jsxs)(U.Fragment,{children:[l,c&&oe.createPortal(n,c)]})}),Fj=U.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e;return bj().useState(`mounted`)||n?(0,W.jsx)(Mj.Provider,{value:n,children:(0,W.jsx)(Pj,{ref:t,...r})}):null}),Ij=U.createContext(void 0);function Lj(){let e=U.useContext(Ij);if(e===void 0)throw Error(Zi(71));return e}var Rj=U.forwardRef(function(e,t){let{render:n,className:r,anchor:i,positionMethod:a=`absolute`,side:o=`top`,align:s=`center`,sideOffset:c=0,alignOffset:l=0,collisionBoundary:u=`clipping-ancestors`,collisionPadding:d=5,arrowPadding:f=5,sticky:p=!1,disableAnchorTracking:m=!1,collisionAvoidance:h=sT,style:g,..._}=e,v=bj(),y=Nj(),b=v.useState(`open`),x=v.useState(`mounted`),S=v.useState(`trackCursorAxis`),C=v.useState(`disableHoverablePopup`),w=v.useState(`floatingRootContext`),T=v.useState(`instantType`),E=v.useState(`transitionStatus`),D=rk({anchor:i,positionMethod:a,floatingRootContext:w,mounted:x,side:o,sideOffset:c,align:s,alignOffset:l,collisionBoundary:u,collisionPadding:d,sticky:p,arrowPadding:f,disableAnchorTracking:m,keepMounted:y,collisionAvoidance:h,adaptiveOrigin:v.useState(`adaptiveOrigin`)}),O=fk(e,U.useMemo(()=>({open:b,side:D.side,align:D.align,anchorHidden:D.anchorHidden,instant:S===`none`?T:`tracking-cursor`}),[b,D.side,D.align,D.anchorHidden,S,T]),{styles:D.positionerStyles,transitionStatus:E,props:_,refs:[t,v.useStateSetter(`positionerElement`)],hidden:!x,inert:!b||S===`both`||C});return(0,W.jsx)(Ij.Provider,{value:D,children:O})}),zj=U.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,o=bj(),{side:s,align:c}=Lj(),l=o.useState(`open`),u=o.useState(`instantType`),d=o.useState(`transitionStatus`),f=o.useState(`popupProps`),p=o.useState(`floatingRootContext`),m=o.useState(`disabled`),h=o.useState(`closeDelay`);ya({open:l,ref:o.context.popupRef,onComplete(){l&&o.context.onOpenChangeComplete?.(!0)}}),bE(p,{enabled:!m,closeDelay:h});let g=o.useStateSetter(`popupElement`);return Ui(`div`,e,{state:{open:l,side:s,align:c,instant:u,transitionStatus:d},ref:[t,o.context.popupRef,g],props:[VT,f,dk(d),a],stateAttributesMapping:Px})}),Bj=function(e){let{delay:t,closeDelay:n,timeout:r=400}=e,i=U.useMemo(()=>({open:t,close:n}),[t,n]);return(0,W.jsx)(Dj.Provider,{value:t,children:(0,W.jsx)(Vw,{delay:i,timeoutMs:r,children:e.children})})};function Vj({delay:e=0,...t}){return(0,W.jsx)(Bj,{"data-slot":`tooltip-provider`,delay:e,...t})}function Hj({...e}){return(0,W.jsx)(Tj,{"data-slot":`tooltip`,...e})}function Uj({...e}){return(0,W.jsx)(jj,{"data-slot":`tooltip-trigger`,...e})}function Wj({className:e,side:t=`top`,sideOffset:n=4,align:r=`center`,alignOffset:i=0,children:a,...o}){return(0,W.jsx)(Fj,{children:(0,W.jsx)(Rj,{align:r,alignOffset:i,side:t,sideOffset:n,className:`isolate z-50`,children:(0,W.jsx)(zj,{"data-slot":`tooltip-content`,className:K(`z-50 inline-flex w-fit max-w-xs origin-(--transform-origin) items-center gap-1.5 rounded-md border border-border/70 bg-popover px-2.5 py-1.5 text-xs text-popover-foreground shadow-float has-data-[slot=kbd]:pr-1.5 data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 **:data-[slot=kbd]:relative **:data-[slot=kbd]:isolate **:data-[slot=kbd]:z-50 **:data-[slot=kbd]:rounded-sm data-[state=delayed-open]:animate-in data-[state=delayed-open]:fade-in-0 data-[state=delayed-open]:zoom-in-95 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95`,e),...o,children:a})})})}function Gj(e){return Ui(e.defaultTagName??`div`,e,e)}var Kj=Eb(`group/badge inline-flex h-5 w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-md border border-transparent px-1.5 py-0.5 text-[10px] font-medium whitespace-nowrap transition-all focus-visible:border-transparent focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none [&>svg]:size-3!`,{variants:{variant:{default:`bg-primary text-primary-foreground [a]:hover:bg-primary/80`,secondary:`bg-secondary text-secondary-foreground [a]:hover:bg-secondary/80`,destructive:`bg-destructive/10 text-destructive focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:focus-visible:ring-destructive/40 [a]:hover:bg-destructive/20`,outline:`border-border text-foreground [a]:hover:bg-muted [a]:hover:text-muted-foreground`,ghost:`hover:bg-muted hover:text-muted-foreground dark:hover:bg-muted/50`,link:`text-primary underline-offset-4 hover:underline`}},defaultVariants:{variant:`default`}});function qj({className:e,variant:t=`default`,render:n,...r}){return Gj({defaultTagName:`span`,props:Ai({className:K(Kj({variant:t}),e)},r),render:n,state:{slot:`badge`,variant:t}})}function Jj({className:e,...t}){return(0,W.jsx)(`div`,{"data-slot":`skeleton`,className:K(`animate-pulse rounded-md bg-muted`,e),...t})}function Yj({className:e,...t}){return(0,W.jsx)(Dn,{"data-slot":`spinner`,"aria-hidden":`true`,className:K(`size-4 animate-spin`,e),...t})}var Xj=Eb(`group/alert relative grid w-full gap-0.5 rounded-lg border px-2.5 py-2 text-left text-sm has-data-[slot=alert-action]:relative has-data-[slot=alert-action]:pr-18 has-[>svg]:grid-cols-[auto_1fr] has-[>svg]:gap-x-2 *:[svg]:row-span-2 *:[svg]:translate-y-0.5 *:[svg]:text-current *:[svg:not([class*='size-'])]:size-4`,{variants:{variant:{default:`bg-card text-card-foreground`,destructive:`bg-card text-destructive *:data-[slot=alert-description]:text-destructive/90 *:[svg]:text-current`}},defaultVariants:{variant:`default`}});function Zj({className:e,variant:t,...n}){return(0,W.jsx)(`div`,{"data-slot":`alert`,role:`alert`,className:K(Xj({variant:t}),e),...n})}function Qj({className:e,...t}){return(0,W.jsx)(`div`,{"data-slot":`alert-title`,className:K(`font-medium group-has-[>svg]/alert:col-start-2 [&_a]:underline [&_a]:underline-offset-3 [&_a]:hover:text-foreground`,e),...t})}function $j({className:e,...t}){return(0,W.jsx)(`div`,{"data-slot":`alert-description`,className:K(`text-sm text-balance text-muted-foreground md:text-pretty [&_a]:underline [&_a]:underline-offset-3 [&_a]:hover:text-foreground [&_p:not(:last-child)]:mb-4`,e),...t})}function eM({className:e,...t}){return(0,W.jsx)(`div`,{"data-slot":`empty`,className:K(`flex w-full min-w-0 flex-1 flex-col items-center justify-center gap-4 rounded-xl border-dashed p-6 text-center text-balance`,e),...t})}function tM({className:e,...t}){return(0,W.jsx)(`div`,{"data-slot":`empty-header`,className:K(`flex max-w-sm flex-col items-center gap-2`,e),...t})}var nM=Eb(`mb-2 flex shrink-0 items-center justify-center [&_svg]:pointer-events-none [&_svg]:shrink-0`,{variants:{variant:{default:`bg-transparent`,icon:`flex size-8 shrink-0 items-center justify-center rounded-lg bg-muted text-foreground [&_svg:not([class*='size-'])]:size-4`}},defaultVariants:{variant:`default`}});function rM({className:e,variant:t=`default`,...n}){return(0,W.jsx)(`div`,{"data-slot":`empty-icon`,"data-variant":t,className:K(nM({variant:t,className:e})),...n})}function iM({className:e,...t}){return(0,W.jsx)(`div`,{"data-slot":`empty-title`,className:K(`font-heading text-sm font-medium tracking-tight`,e),...t})}function aM(){return(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`svg`,{className:`brand-mark h-5 w-7 shrink-0 text-primary`,viewBox:Vy.viewBox,"aria-hidden":`true`,children:(0,W.jsx)(`path`,{d:Vy.path,fill:`currentColor`})}),(0,W.jsx)(`span`,{className:`brand-word text-sm font-semibold tracking-tight group-data-[collapsible=icon]:hidden`,children:`Kanvil`})]})}var oM=`relative mb-4 min-w-0 [&>[data-slot=field-label]]:text-xs [&>[data-slot=field-label]]:font-medium [&>[data-slot=field-label]]:text-muted-foreground`,sM=e=>Gr.error(l(e));function cM({label:e,shortcut:t,children:n,...r}){return(0,W.jsxs)(Hj,{children:[(0,W.jsx)(Uj,{render:(0,W.jsx)(kb,{variant:`ghost`,size:`icon`,"aria-label":e,...r}),children:n}),(0,W.jsxs)(Wj,{children:[e,t&&(0,W.jsx)(fw,{children:t.split(` `).map(e=>(0,W.jsx)(dw,{children:e},e))})]})]})}function lM({label:e,labelHidden:t=!1,...n}){let r=(0,U.useId)(),[i,a]=(0,U.useState)(!1);return(0,W.jsxs)(WC,{className:K(oM,t&&`mb-0`),children:[(0,W.jsx)(KC,{htmlFor:r,className:K(t&&`sr-only`),children:e}),n.type===`password`?(0,W.jsxs)(jC,{children:[(0,W.jsx)(IC,{...n,id:r,type:i?`text`:`password`}),(0,W.jsx)(NC,{align:`inline-end`,children:(0,W.jsx)(FC,{size:`icon-sm`,"aria-label":I(i?`shell.ui.hideValue`:`shell.ui.showValue`,{label:e}),title:I(i?`shell.ui.hideValue`:`shell.ui.showValue`,{label:e}),disabled:n.disabled,onClick:()=>a(e=>!e),children:i?(0,W.jsx)(Cn,{}):(0,W.jsx)(Tn,{})})})]}):(0,W.jsx)(kC,{...n,id:r})]})}function uM({label:e,...t}){let n=(0,U.useId)();return(0,W.jsxs)(WC,{className:oM,children:[(0,W.jsx)(KC,{htmlFor:n,children:e}),(0,W.jsx)(AC,{...t,id:n})]})}function dM(e){return U.Children.toArray(e).flatMap(e=>(0,U.isValidElement)(e)?e.props.value===void 0?dM(e.props.children):[{value:e.props.value,label:e.props.children}]:[])}function fM({label:e,children:t,className:n,layout:r=`field`,labelHidden:i=!1,...a}){let o=(0,U.useId)(),s=dM(t);return(0,W.jsxs)(WC,{className:K(oM,r===`property`&&`mb-0 grid grid-cols-[72px_minmax(0,1fr)] items-center gap-2`,n),children:[(0,W.jsx)(KC,{htmlFor:o,className:K(r===`property`&&`text-xs font-normal text-muted-foreground`,i&&`sr-only`),children:e}),(0,W.jsxs)(bA,{items:s,defaultValue:s[0]?.value??``,...a,children:[(0,W.jsx)(CA,{id:o,className:K(`w-full`,r===`property`&&`h-auto min-h-8 border-transparent bg-transparent shadow-none hover:bg-muted dark:bg-transparent`),children:(0,W.jsx)(SA,{})}),(0,W.jsx)(wA,{alignItemWithTrigger:!1,children:t})]})]})}function pM({label:e,description:t,className:n,...r}){let i=(0,U.useId)(),a=n===`sr-checkbox`;return(0,W.jsxs)(WC,{orientation:`horizontal`,className:K(`my-2 min-h-7 w-auto`,a&&`my-0 min-h-4 justify-center`),children:[(0,W.jsx)(uw,{...r,id:i,"aria-describedby":t?[r[`aria-describedby`],`${i}-description`].filter(Boolean).join(` `):r[`aria-describedby`]}),t?(0,W.jsxs)(GC,{children:[(0,W.jsx)(KC,{htmlFor:i,className:K(`font-normal`,a&&`sr-only`),children:e}),(0,W.jsx)(qC,{id:`${i}-description`,className:`text-xs`,children:t})]}):(0,W.jsx)(KC,{htmlFor:i,className:K(`font-normal`,a&&`sr-only`),children:e})]})}function mM({error:e}){return e?(0,W.jsxs)(Zj,{variant:`destructive`,className:`my-3`,children:[(0,W.jsx)(an,{}),(0,W.jsx)($j,{children:l(e)})]}):null}function hM({noun:e,offset:t,total:n,size:r,onChange:i}){return n<=r&&!t?null:(0,W.jsxs)(`footer`,{className:`mt-5 flex flex-wrap items-center justify-end gap-2 text-xs text-muted-foreground [&>span]:mr-auto`,children:[(0,W.jsx)(kb,{disabled:!t,onClick:()=>i(Math.max(0,t-r)),children:I(`shell.ui.previousPage`,{noun:e})}),(0,W.jsx)(`span`,{children:I(`shell.ui.pageRange`,{from:R(t+1),to:R(Math.min(t+r,n)),total:R(n)})}),(0,W.jsx)(kb,{disabled:t+r>=n,onClick:()=>i(t+r),children:I(`shell.ui.nextPage`,{noun:e})})]})}function gM(){return(0,W.jsxs)(`div`,{role:`status`,className:`space-y-4 py-5`,children:[(0,W.jsx)(`span`,{className:`sr-only`,children:I(`common.state.loading`)}),(0,W.jsx)(Jj,{className:`h-6 w-40`}),(0,W.jsx)(Jj,{className:`h-12 w-full`}),(0,W.jsx)(Jj,{className:`h-12 w-full`}),(0,W.jsx)(Jj,{className:`h-12 w-3/4`})]})}function _M({title:e,icon:t=ln,children:n,className:r}){return(0,W.jsxs)(eM,{className:K(`relative isolate overflow-hidden py-20`,r),children:[(0,W.jsxs)(tM,{className:`w-full`,children:[(0,W.jsx)(rM,{variant:`icon`,children:(0,W.jsx)(t,{})}),(0,W.jsxs)(iM,{className:`relative w-full`,children:[(0,W.jsx)(`svg`,{"aria-hidden":`true`,viewBox:Vy.viewBox,className:`pointer-events-none absolute top-1/2 left-1/2 -z-10 h-auto w-full -translate-x-[44.2%] -translate-y-[59.2%] text-foreground/[0.07] dark:text-foreground/[0.09]`,children:(0,W.jsx)(`path`,{d:Vy.path,fill:`none`,stroke:`currentColor`,strokeWidth:5})}),e]})]}),n]})}var vM={backlog:{icon:ln,color:`text-muted-foreground`},todo:{icon:hn,color:`text-muted-foreground`},in_progress:{icon:dn,color:`text-primary`},in_review:{icon:_n,color:`text-[var(--warning)]`},done:{icon:sn,color:`text-[var(--success)]`},cancelled:{icon:pn,color:`text-muted-foreground`}},yM=e=>vM[e].color,bM={urgent:{icon:jn,color:`text-destructive`},high:{icon:Jt,color:`text-[var(--warning)]`},medium:{icon:xn,color:`text-foreground`},low:{icon:Kt,color:`text-primary`},none:{icon:kn,color:`text-muted-foreground`}};function xM({property:e,value:t,iconOnly:n=!1,label:r,color:i}){let a=e===`status`&&i&&i!=="default"?le(i):void 0,{icon:o,color:s,label:l}=e===`status`?{...vM[t],color:a?a.className:vM[t].color,label:r??c[t]}:{...bM[t],label:ne[t]},u=e===`priority`&&t!==`none`?I(`shell.ui.priority`,{label:l}):l;return(0,W.jsxs)(qj,{variant:`outline`,className:K(e===`status`?`status rounded-full bg-current/8 px-2 text-xs whitespace-nowrap`:`h-6 border-transparent bg-transparent px-0 text-xs`,`gap-1.5 border-transparent font-normal`,s),style:a?.style,"data-priority":e===`priority`?t:void 0,role:n?`img`:void 0,"aria-label":n?u:void 0,title:n?u:void 0,children:[(0,W.jsx)(o,{className:e===`status`?`size-3.5`:`size-4.5`,strokeWidth:e===`status`?2:2.5,"aria-hidden":`true`}),!n&&l]})}var SM=e=>e.type===`text`?e.value:e.type===`element`&&![`ul`,`ol`].includes(e.tagName)?e.children.map(SM).join(``):``,CM=(0,U.lazy)(()=>H(()=>import(`./markdown-blocks-toSPlHSc.js`),__vite__mapDeps([0,1,2,3,4,5,6])));function wM(e){let t=e?.children[0];if(t?.type!==`element`||t.tagName!==`code`)return;let n=t.properties.className;return(Array.isArray(n)?n:[]).map(String).find(e=>e.startsWith(`language-`))?.slice(9)}var TM=(0,U.createContext)({source:``}),EM=(0,U.createContext)(null);function DM({checked:e}){let{source:t,onChange:n}=(0,U.useContext)(TM),r=(0,U.useContext)(EM),i=r?.offset;return(0,W.jsx)(uw,{checked:e,"aria-label":r?.label,disabled:!n||i===void 0,onCheckedChange:e=>{n&&i!==void 0&&n(Yl(t,i,e))},className:`relative top-0.5 -ml-6 mr-2 inline-flex`})}var OM={pre:({children:e,node:t,...n})=>{let r=wM(t),i=(0,W.jsx)(`pre`,{...n,children:e});return r&&t?(0,W.jsx)(U.Suspense,{fallback:i,children:(0,W.jsx)(CM,{language:r,code:SM(t).replace(/\n$/,``)})}):i},img:({node:e,...t})=>(0,W.jsx)(`img`,{...t,loading:`lazy`,className:`my-2 rounded-md border`}),a:({children:e,node:t,...n})=>n.href?.startsWith(`mention:`)?(0,W.jsx)(`span`,{className:`rounded-sm bg-primary/10 px-0.5 font-medium text-primary`,children:e}):(0,W.jsx)(`a`,{...n,target:`_blank`,rel:`noreferrer`,children:e}),li:({children:e,node:t,className:n,...r})=>n?.includes(`task-list-item`)&&t?(0,W.jsx)(`li`,{...r,className:K(n,`list-none`),children:(0,W.jsx)(EM,{value:{offset:t.position?.start.offset,label:SM(t).trim()},children:e})}):(0,W.jsx)(`li`,{...r,className:n,children:e}),input:({node:e,...t})=>t.type===`checkbox`?(0,W.jsx)(DM,{checked:!!t.checked}):(0,W.jsx)(`input`,{...t})};function kM({children:e,onChange:t}){return(0,W.jsx)(`div`,{className:`markdown`,children:(0,W.jsx)(TM,{value:{source:e,...t?{onChange:t}:{}},children:(0,W.jsx)(Pg,{remarkPlugins:[By],components:OM,urlTransform:e=>e.startsWith(`mention:`)?e:Rg(e),children:e})})})}var AM=(0,U.createContext)(null),jM=()=>(0,U.useContext)(AM),MM={default:`max-h-[90dvh] overflow-y-auto p-6 sm:max-w-2xl`,composer:`flex max-h-[calc(100dvh-2rem)] w-[calc(100%-1rem)] flex-col gap-0 overflow-hidden p-0 sm:max-w-3xl has-[[data-expanded=true]]:h-[calc(100dvh-1rem)] has-[[data-expanded=true]]:w-[calc(100%-1rem)] has-[[data-expanded=true]]:sm:max-w-[calc(100%-1rem)] max-sm:h-dvh max-sm:w-full max-sm:max-w-none max-sm:rounded-none`};function NM({title:e,description:t,trigger:n,children:r,open:i,onOpenChange:a,busy:o=!1,size:s=`default`}){let[c,l]=(0,U.useState)(!1),u=o||c;return(0,W.jsx)(AM,{value:l,children:(0,W.jsxs)(XA,{...i===void 0?{}:{open:i},onOpenChange:(e,t)=>{!e&&u?t.cancel():a?.(e)},children:[n&&(0,W.jsx)(ZA,{render:(0,W.jsx)(kb,{variant:`outline`}),children:n}),(0,W.jsxs)(tj,{showCloseButton:!u,className:MM[s],"aria-describedby":void 0,children:[(0,W.jsxs)(nj,{className:K(`mb-2`,s===`composer`&&`m-0 shrink-0 border-b px-5 py-3 pr-24`),children:[(0,W.jsx)(ij,{className:K(`mb-0`,s===`composer`?`text-sm`:`text-lg`),children:e}),t&&(0,W.jsx)(aj,{children:t})]}),r]})]})})}function PM({error:e,layout:t=`dialog`,pending:n=!1,submitLabel:r,pendingLabel:i,onCancel:a,cancelLabel:o=I(`common.action.cancel`),submitDisabled:s=!1,danger:c=!1,children:l}){return(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(mM,{error:e}),(0,W.jsxs)(FM,{className:t===`inline`?`mx-0 mb-0 rounded-none border-0 bg-transparent px-0`:``,children:[l,a&&(0,W.jsx)(kb,{disabled:n,onClick:a,children:o}),(0,W.jsxs)(kb,{type:`submit`,variant:c?`destructive`:`default`,disabled:n||s,children:[n&&(0,W.jsx)(Yj,{}),n&&i?i:r]})]})]})}function FM({children:e,className:t}){return(0,W.jsx)(rj,{className:K(`mt-4`,t),children:e})}function IM({label:e,description:t,onConfirm:n,danger:r=!1,icon:i,disabled:a=!1,open:o,onOpenChange:s,trigger:c=!0}){let[l,u]=(0,U.useState)(!1),d=o??l,f=s??u,[p,m]=(0,U.useState)(!1),[h,g]=(0,U.useState)();return(0,W.jsxs)(cj,{open:d,onOpenChange:f,children:[c&&(0,W.jsx)(lj,{render:i?(0,W.jsx)(cM,{label:e,disabled:a}):(0,W.jsx)(kb,{variant:r?`destructive`:`outline`,disabled:a}),children:i??e}),(0,W.jsxs)(fj,{children:[(0,W.jsxs)(pj,{children:[(0,W.jsx)(hj,{children:e}),(0,W.jsx)(gj,{children:t})]}),(0,W.jsx)(mM,{error:h}),(0,W.jsxs)(mj,{children:[(0,W.jsx)(vj,{disabled:p,children:I(`common.action.cancel`)}),(0,W.jsx)(_j,{variant:r?`destructive`:`default`,disabled:p,onClick:()=>{m(!0),g(void 0),n().then(()=>f(!1)).catch(g).finally(()=>m(!1))},children:p?I(`shell.ui.working`):e})]})]})]})}var LM=e=>R(e/1e3,{style:`unit`,unit:`kilobyte`,maximumFractionDigits:1});function RM({value:e,className:t}){let n=new Date(e);return(0,W.jsx)(`time`,{dateTime:e,title:v(e),className:t,children:V(n)})}function zM({value:e,open:t=!0,className:n}){if(!e)return null;let r=t&&Fl(new Date(e));return(0,W.jsxs)(`span`,{className:K(`inline-flex items-center gap-1.5`,r?`text-destructive`:`text-muted-foreground`,n),children:[(0,W.jsx)(Xt,{className:`size-3.5 shrink-0`,"aria-hidden":`true`}),(0,W.jsx)(RM,{value:e})]})}var BM=`mt-4 mb-6 max-w-4xl text-2xl leading-snug font-semibold tracking-tight [unicode-bidi:plaintext]`;function VM({title:e,children:t}){return(0,W.jsxs)(`header`,{className:`mb-4 flex min-h-8 flex-wrap items-center justify-between gap-3`,children:[typeof e==`string`?(0,W.jsx)(`h1`,{className:`m-0 text-base`,children:e}):e,t]})}function HM({title:e,description:t,action:n,compact:r=!1}){return(0,W.jsxs)(`header`,{className:K(`mb-4 flex flex-wrap items-start justify-between gap-3`,r&&`mb-3 items-center gap-2 [&_[data-slot=button]]:h-7 [&_[data-slot=button]]:text-xs`),children:[(0,W.jsxs)(`div`,{children:[(0,W.jsx)(`h2`,{className:K(`mb-0 text-sm`,r&&`text-[11px] font-medium tracking-[0.08em] text-muted-foreground uppercase`),children:e}),t&&(0,W.jsx)(`p`,{className:`mt-1.5 mb-0 max-w-xl text-sm text-muted-foreground`,children:t})]}),n]})}function UM({label:e,value:t,onChange:n,placeholder:r=I(`shell.ui.searchPlaceholder`),shortcut:i,defaultOpen:a=!1,wide:o=!1,className:s}){let[c,l]=(0,U.useState)(()=>a||t.length>0),u=(0,U.useRef)(null),d=c||t.length>0;return Ul(i??``,()=>{l(!0),u.current?.focus()},{enabled:!!i}),(0,W.jsxs)(`div`,{role:`search`,"data-expanded":d,className:K(`group/search flex min-w-0 items-center`,d&&`flex-1`,s),children:[(0,W.jsx)(cM,{label:e,size:`icon-sm`,"aria-expanded":d,title:i?`${e} (${i})`:void 0,className:K(`transition-colors`,d&&`text-foreground`),onClick:()=>{l(!0),u.current?.focus()},children:(0,W.jsx)(Nn,{})}),(0,W.jsxs)(`div`,{className:K(`flex items-center overflow-hidden transition-[width,opacity] duration-200 ease-out motion-reduce:transition-none`,d?K(`w-full opacity-100`,!o&&`max-w-56`):`w-0 opacity-0`),children:[(0,W.jsx)(`input`,{ref:u,type:`search`,"aria-label":e,placeholder:r,value:t,tabIndex:d?0:-1,onChange:e=>n(e.target.value),onBlur:()=>{t||l(a)},onKeyDown:e=>{(e.key===`Escape`||e.key===`Enter`)&&(e.preventDefault(),e.currentTarget.blur())},className:`h-8 min-w-0 flex-1 border-0 border-b border-border bg-transparent px-1 text-sm transition-colors outline-none placeholder:text-muted-foreground focus:border-foreground [&::-webkit-search-cancel-button]:hidden`}),t&&(0,W.jsx)(cM,{label:I(`shell.ui.clearValue`,{label:e}),size:`icon-xs`,onClick:()=>{n(``),l(a)},children:(0,W.jsx)(Fn,{})})]})]})}function WM({label:e,value:t,size:n=`icon`,className:r}){let[i,a]=(0,U.useState)(!1);return(0,W.jsx)(cM,{label:e,size:n,className:K(`text-muted-foreground hover:text-foreground`,r),onClick:()=>{Rl(t).then(()=>{a(!0),setTimeout(()=>a(!1),1500),Gr.success(I(`shell.ui.copied`,{value:t}))}).catch(sM)},children:i?(0,W.jsx)(Qt,{className:`text-(--success)`}):(0,W.jsx)(yn,{})})}function GM({label:e,value:t,inline:n=!1}){let r=(0,U.useId)(),i=(0,W.jsxs)(`div`,{role:`group`,"aria-label":n?e:void 0,"aria-labelledby":n?void 0:r,className:K(`flex min-w-0 items-center gap-3`,!n&&`justify-between`),children:[(0,W.jsx)(`code`,{className:`min-w-0 text-xs break-all`,children:t}),(0,W.jsx)(WM,{label:I(`shell.ui.copyValue`,{label:e}),value:t,size:n?`icon-sm`:`icon`})]});return n?i:(0,W.jsxs)(`div`,{className:`mb-4 min-w-0`,children:[(0,W.jsx)(`span`,{id:r,className:`mb-1 block text-xs text-muted-foreground`,children:e}),i]})}var KM=U.createContext(void 0);function qM(e){let t=U.useContext(KM);if(t===void 0&&!e)throw Error(Zi(47));return t}var JM={...uE,disabled:e=>e.disabled,instantType:e=>e.instantType===`trigger-change`&&!uE.open(e)?void 0:e.instantType,openMethod:e=>e.openMethod,openChangeReason:e=>e.openChangeReason,isPressOpenedByTrigger:(e,t)=>e.openChangeReason===`trigger-press`&&uE.isOpenedByTrigger(e,t),isTouchPressOpen:(e,t)=>t&&e.openMethod===`touch`&&e.openChangeReason===`trigger-press`,hasTriggerFocusGuards:(e,t)=>uE.isOpenedByTrigger(e,t)&&!e.focusManagerModal,modal:e=>e.modal,titleElementId:e=>e.titleElementId,descriptionElementId:e=>e.descriptionElementId,openOnHover:e=>e.openOnHover,closeDelay:e=>e.closeDelay,adaptiveOrigin:e=>e.adaptiveOrigin},YM=class extends jw{constructor(e,t,n){let r=new tE;super(XM(e,r,t,n),ZM(r),JM)}setOpen=(e,t)=>{let n=t.reason===uC,r=t.reason===`trigger-press`&&t.event.detail===0,i=!e&&(t.reason===`escape-key`||t.reason==null),a=JT(t),o=this.select(`activeTriggerId`);if(!e&&t.reason===`close-press`&&t.trigger==null&&o!=null&&(t.trigger=this.context.triggerElements.getById(o)??this.select(`activeTriggerElement`)??void 0),this.context.onOpenChange?.(e,t),t.isCanceled)return;this.state.floatingRootContext.dispatchOpenChange(e,t);let s=()=>{let n=qT(this.state,e,t.trigger,a());n.openChangeReason=t.reason,this.update(n)};n?(this.context.stickIfOpen=!0,this.context.stickIfOpenTimeout.start(500,()=>{this.context.stickIfOpen=!1}),oe.flushSync(s)):s();let c;r?c=`click`:i?c=`dismiss`:t.reason===`focus-out`&&(c=`focus`),this.set(`instantType`,c)}};function XM(e,t,n,r=!1){let i={...iE(t,n,r),disabled:!1,modal:!1,focusManagerModal:!1,instantType:void 0,openMethod:null,openChangeReason:null,titleElementId:void 0,descriptionElementId:void 0,openOnHover:!1,closeDelay:0,adaptiveOrigin:void 0,...e};return i.open&&e?.mounted===void 0&&(i.mounted=!0),i}function ZM(e){return{popupRef:U.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerFocusTargetRef:U.createRef(),beforeTriggerFocusGuardRef:U.createRef(),beforeContentFocusGuardRef:U.createRef(),stickIfOpenTimeout:new Oa,stickIfOpen:!0,triggerElements:e}}var QM=Sw(function({props:e}){let{children:t,open:n,defaultOpen:r=!1,onOpenChange:i,onOpenChangeComplete:a,modal:o=!1,handle:s,triggerId:c,defaultTriggerId:l=null}=e,u=eN(s,{modal:o,open:r,openProp:n,activeTriggerId:l,triggerIdProp:c});u.useControlledProp(`openProp`,n),u.useControlledProp(`triggerIdProp`,c);let d=u.useState(`open`),f=u.useState(`mounted`),p=u.useState(`payload`);u.useContextCallback(`onOpenChange`,i),u.useContextCallback(`onOpenChangeComplete`,a),eE(u,d),ZT(u);let{forceUnmount:m}=QT(d,u,()=>{u.context.stickIfOpen=!0,u.set(`openChangeReason`,null)});u.useSyncedValues({modal:o}),U.useEffect(()=>{d||u.context.stickIfOpenTimeout.clear()},[u,d]),U.useImperativeHandle(e.actionsRef,()=>({unmount:m,close:()=>u.setOpen(!1,$(TC))}),[m,u]);let h=d||f||s!=null;return(0,W.jsxs)(KM.Provider,{value:u,children:[s&&(0,W.jsx)(WT,{handle:s,store:u}),h&&(0,W.jsx)(tN,{store:u,modal:o}),typeof t==`function`?t({payload:p}):t]})});function $M(e){return qM(!0)?(0,W.jsx)(QM,{props:e}):(0,W.jsx)(ST,{children:(0,W.jsx)(QM,{props:e})})}function eN(e,t){let n=UT((e,n)=>new YM(t,e,n));return U.useEffect(()=>n.context.stickIfOpenTimeout.disposeEffect(),[n]),n}function tN({store:e,modal:t}){let n=RT(e.useState(`floatingRootContext`),{outsidePressEvent:{mouse:t===`trap-focus`?`sloppy`:`intentional`,touch:`sloppy`}}),r=n.reference,i=n.floating;return $T(e,{activeTriggerProps:r,inactiveTriggerProps:r,popupProps:i}),null}function nN(e,t){function n(n,r,i){let a=n.currentTarget;oe.flushSync(()=>{e.setOpen(!1,$(hC,n.nativeEvent,a))}),QS(a.isConnected?a:t.current,r,i)?.focus()}function r(t){n(t,-1,e.select(`positionerElement`))}function i(t){let r=e.select(`positionerElement`);r&&$S(t,r)?e.context.beforeContentFocusGuardRef.current?.focus():n(t,1,r)}return{handlePreFocusGuardFocus:r,handleFocusTargetFocus:i}}var rN=Cw(function(e,t){let{render:n,className:r,style:i,disabled:a=!1,nativeButton:o=!0,handle:s,payload:c,openOnHover:l=!1,delay:u=300,closeDelay:d=0,id:f,...p}=e,m=qM(!0),h=dE(s)??m;if(!h)throw Error(Zi(74));let g=Gb(f),_=h.useState(`isTriggerActive`,g),v=h.useState(`floatingRootContext`),y=h.useState(`isOpenedByTrigger`,g),b=h.useState(`triggerPopupId`,g),x=U.useRef(null),{registerTrigger:S,isMountedByThisTrigger:C}=XT(g,x,h,{payload:c,disabled:a,openOnHover:l,closeDelay:d}),w=h.useState(`isPressOpenedByTrigger`,g),T=h.useState(`isTouchPressOpen`,l),E=h.useState(`hasTriggerFocusGuards`,g),D=SE(v,{enabled:!a&&l&&!T,mouseOnly:!0,move:!1,handleClose:RE(),restMs:u,delay:{close:d},triggerElementRef:x,isActiveTrigger:_,isClosing:()=>h.select(`transitionStatus`)===`ending`}),O=MT(v,{stickIfOpen:q(()=>h.context.stickIfOpen)}),k=pO(()=>h.select(`open`),e=>{h.set(`openMethod`,e)}),A=h.useState(`triggerProps`,C),{getButtonProps:j,buttonRef:M}=vb({disabled:a,native:o}),N={open(e){return w?Mx.open(e):jx.open(e)}},{handlePreFocusGuardFocus:P,handleFocusTargetFocus:F}=nN(h,x),I=Ui(`button`,e,{state:{disabled:a,open:y},ref:[M,t,S,x],props:[O.reference,D,A,k,{[aT]:``,id:g,"aria-haspopup":`dialog`,"aria-expanded":y,"aria-controls":b},p,j],stateAttributesMapping:N}),L=(0,W.jsx)(U.Fragment,{children:I},g);return E?(0,W.jsxs)(U.Fragment,{children:[(0,W.jsx)(Uw,{ref:h.context.beforeTriggerFocusGuardRef,onFocus:P}),L,(0,W.jsx)(Uw,{ref:h.context.triggerFocusTargetRef,onFocus:F})]}):L}),iN=U.createContext(void 0);function aN(){let e=U.useContext(iN);if(e===void 0)throw Error(Zi(45));return e}var oN=U.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e;return qM().useState(`mounted`)||n?(0,W.jsx)(iN.Provider,{value:n,children:(0,W.jsx)(pT,{ref:t,...r})}):null}),sN=U.createContext(void 0);function cN(){let e=U.useContext(sN);if(!e)throw Error(Zi(46));return e}function lN(e){let{store:t,domReference:n,positionerElement:r,open:i}=e,a=U.useRef(null),o=U.useRef(null),s=va(r);J(()=>{i||(o.current?.abort(),o.current=null,t.state.instantType===`trigger-change`&&t.set(`instantType`,void 0))},[i,t]),J(()=>{let e=n,r=a.current;if(e&&(a.current=e),!r||!e||e===r||!t.select(`open`))return;t.set(`instantType`,void 0);let i=new AbortController;return o.current=i,s(()=>{t.select(`open`)&&t.set(`instantType`,`trigger-change`)},i.signal),()=>{i.abort()}},[n,s,t])}var uN=U.forwardRef(function(e,t){let{render:n,className:r,style:i,anchor:a,positionMethod:o,side:s,align:c,sideOffset:l,alignOffset:u,collisionBoundary:d=`clipping-ancestors`,collisionPadding:f,arrowPadding:p,sticky:m,disableAnchorTracking:h=!1,collisionAvoidance:g=sT,..._}=e,v=qM(),y=aN(),b=bT(),x=v.useState(`floatingRootContext`),S=v.useState(`mounted`),C=v.useState(`open`),w=v.useState(`openChangeReason`),T=v.useState(`activeTriggerElement`),E=v.useState(`modal`),D=v.useState(`openMethod`),O=v.useState(`positionerElement`),k=v.useState(`instantType`),A=v.useState(`transitionStatus`),j=rk({anchor:a,floatingRootContext:x,positionMethod:o,mounted:S,side:s,sideOffset:l,align:c,alignOffset:u,arrowPadding:p,collisionBoundary:d,collisionPadding:f,sticky:m,disableAnchorTracking:h,keepMounted:y,nodeId:b,collisionAvoidance:g,adaptiveOrigin:v.useState(`adaptiveOrigin`)});lN({store:v,domReference:x.useState(`domReferenceElement`),positionerElement:O,open:C});let M=E===!0&&w!==`trigger-hover`;Tk(C&&M,D===`touch`,O,T);let N=v.useStateSetter(`positionerElement`),P=fk(e,{open:C,side:j.side,align:j.align,anchorHidden:j.anchorHidden,instant:k},{styles:j.positionerStyles,transitionStatus:A,props:_,refs:[t,N],hidden:!S,inert:!C});return(0,W.jsxs)(sN.Provider,{value:j,children:[S&&M&&(0,W.jsx)(ck,{inert:jO(!C),cutout:T}),(0,W.jsx)(xT,{id:b,children:P})]})}),dN=U.createContext(void 0);function fN(){let[e,t]=U.useState(0),n=q(()=>(t(e=>e+1),()=>{t(e=>Math.max(0,e-1))}));return{context:U.useMemo(()=>({register:n}),[n]),hasClosePart:e>0}}var pN=U.forwardRef(function(e,t){let{render:n,className:r,style:i,initialFocus:a,finalFocus:o,...s}=e,c=qM(),l=cN(),u=jk(!0)!=null,{context:d,hasClosePart:f}=fN(),p=c.useState(`open`),m=c.useState(`openMethod`),h=c.useState(`instantType`),g=c.useState(`transitionStatus`),_=c.useState(`popupProps`),v=c.useState(`titleElementId`),y=c.useState(`descriptionElementId`),b=c.useState(`modal`),x=c.useState(`mounted`),S=c.useState(`openChangeReason`),C=c.useState(`activeTriggerElement`),w=c.useState(`floatingRootContext`),T=w.useState(`floatingId`),E=c.useState(`disabled`),D=c.useState(`openOnHover`),O=c.useState(`closeDelay`);ya({open:p,ref:c.context.popupRef,onComplete(){p&&c.context.onOpenChangeComplete?.(!0)}}),bE(w,{enabled:D&&!E,closeDelay:O});let k=a===void 0?HT(c.context.popupRef):a,A=b!==!1&&f;c.useSyncedValue(`focusManagerModal`,A);let j=c.useStateSetter(`popupElement`),M=Ui(`div`,e,{state:{open:p,side:l.side,align:l.align,instant:h,transitionStatus:g},ref:[t,c.context.popupRef,j],props:[_,{id:T,role:`dialog`,...VT,"aria-labelledby":v,"aria-describedby":y,onKeyDown(e){u&&Lk.has(e.key)&&e.stopPropagation()}},dk(g),s],stateAttributesMapping:Px});return(0,W.jsx)(jT,{context:w,openInteractionType:m,modal:A,disabled:!x||S===`trigger-hover`,initialFocus:k,returnFocus:o,restoreFocus:`popup`,getInsideElements:()=>[c.context.beforeTriggerFocusGuardRef.current],previousFocusableElement:Jy(C)?C:void 0,nextFocusableElement:c.context.triggerFocusTargetRef,beforeContentFocusGuardRef:c.context.beforeContentFocusGuardRef,children:(0,W.jsx)(dN.Provider,{value:d,children:M})})}),mN=U.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,o=qM(),s=Gb(a.id);return o.useSyncedValueWithCleanup(`titleElementId`,s),Ui(`h2`,e,{ref:t,props:[{id:s},a]})});function hN({...e}){return(0,W.jsx)($M,{"data-slot":`popover`,...e})}function gN({...e}){return(0,W.jsx)(rN,{"data-slot":`popover-trigger`,...e})}function _N({className:e,align:t=`center`,alignOffset:n=0,side:r=`bottom`,sideOffset:i=4,anchor:a,...o}){return(0,W.jsx)(oN,{children:(0,W.jsx)(uN,{anchor:a,align:t,alignOffset:n,side:r,sideOffset:i,className:`isolate z-50`,children:(0,W.jsx)(pN,{"data-slot":`popover-content`,className:K(`z-50 flex max-h-(--available-height) w-72 origin-(--transform-origin) flex-col overflow-y-auto gap-2.5 rounded-lg bg-popover p-2.5 text-sm text-popover-foreground border border-border/70 shadow-float outline-hidden duration-100 data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95`,e),...o})})})}function vN({className:e,...t}){return(0,W.jsx)(mN,{"data-slot":`popover-title`,className:K(`font-medium`,e),...t})}var yN=1,bN=.9,xN=.8,SN=.17,CN=.1,wN=.999,TN=.9999,EN=.99,DN=/[\\\/_+.#"@\[\(\{&]/,ON=/[\\\/_+.#"@\[\(\{&]/g,kN=/[\s-]/,AN=/[\s-]/g;function jN(e,t,n,r,i,a,o){if(a===t.length)return i===e.length?yN:EN;var s=`${i},${a}`;if(o[s]!==void 0)return o[s];for(var c=r.charAt(a),l=n.indexOf(c,i),u=0,d,f,p,m;l>=0;)d=jN(e,t,n,r,l+1,a+1,o),d>u&&(l===i?d*=yN:DN.test(e.charAt(l-1))?(d*=xN,p=e.slice(i,l-1).match(ON),p&&i>0&&(d*=wN**+p.length)):kN.test(e.charAt(l-1))?(d*=bN,m=e.slice(i,l-1).match(AN),m&&i>0&&(d*=wN**+m.length)):(d*=SN,i>0&&(d*=wN**+(l-i))),e.charAt(l)!==t.charAt(a)&&(d*=TN)),(d<CN&&n.charAt(l-1)===r.charAt(a+1)||r.charAt(a+1)===r.charAt(a)&&n.charAt(l-1)!==r.charAt(a))&&(f=jN(e,t,n,r,l+1,a+2,o),f*CN>d&&(d=f*CN)),d>u&&(u=d),l=n.indexOf(c,l+1);return o[s]=u,u}function MN(e){return e.toLowerCase().replace(AN,` `)}function NN(e,t,n){return e=n&&n.length>0?`${e+` `+n.join(` `)}`:e,jN(e,t,MN(e),MN(t),0,0,{})}var PN=Object.defineProperty,FN=(e,t)=>PN(e,`name`,{value:t,configurable:!0}),IN=!!(typeof window<`u`&&window.document&&window.document.createElement);function LN(e,t,{checkForDefaultPrevented:n=!0}={}){return FN(function(r){if(e?.(r),n===!1||!r||!r.defaultPrevented)return t?.(r)},`handleEvent`)}FN(LN,`composeEventHandlers`);function RN(e){if(!IN)throw Error(`Cannot access window outside of the DOM`);return e?.ownerDocument?.defaultView??window}FN(RN,`getOwnerWindow`);function zN(e){if(!IN)throw Error(`Cannot access document outside of the DOM`);return e?.ownerDocument??document}FN(zN,`getOwnerDocument`);function BN(e,t=!1){let{activeElement:n}=zN(e);if(!n?.nodeName)return null;if(VN(n)&&n.contentDocument)return BN(n.contentDocument.body,t);if(t){let e=n.getAttribute(`aria-activedescendant`);if(e){let t=zN(n).getElementById(e);if(t)return t}}return n}FN(BN,`getActiveElement`);function VN(e){return e.tagName===`IFRAME`}FN(VN,`isFrame`);var HN=Object.defineProperty,UN=(e,t)=>HN(e,`name`,{value:t,configurable:!0});function WN(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}UN(WN,`setRef`);function GN(...e){return t=>{let n=!1,r=e.map(e=>{let r=WN(e,t);return!n&&typeof r==`function`&&(n=!0),r});if(n)return()=>{for(let t=0;t<r.length;t++){let n=r[t];typeof n==`function`?n():WN(e[t],null)}}}}UN(GN,`composeRefs`);function KN(...e){return U.useCallback(GN(...e),e)}UN(KN,`useComposedRefs`);var qN=Object.defineProperty,JN=(e,t)=>qN(e,`name`,{value:t,configurable:!0});function YN(e,t){let n=U.createContext(t);n.displayName=e+`Context`;let r=JN(e=>{let{children:t,...r}=e,i=U.useMemo(()=>r,Object.values(r));return(0,W.jsx)(n.Provider,{value:i,children:t})},`Provider`);r.displayName=e+`Provider`;function i(r,i={}){let{optional:a=!1}=i,o=U.useContext(n);if(o)return o;if(t!==void 0)return t;if(!a)throw Error(`\`${r}\` must be used within \`${e}\``)}return JN(i,`useContext`),[r,i]}JN(YN,`createContext`);function XN(e,t=[]){let n=[];function r(t,r){let i=U.createContext(r);i.displayName=t+`Context`;let a=n.length;n=[...n,r];let o=JN(t=>{let{scope:n,children:r,...o}=t,s=n?.[e]?.[a]||i,c=U.useMemo(()=>o,Object.values(o));return(0,W.jsx)(s.Provider,{value:c,children:r})},`Provider`);o.displayName=t+`Provider`;function s(n,o,s={}){let{optional:c=!1}=s,l=o?.[e]?.[a]||i,u=U.useContext(l);if(u)return u;if(r!==void 0)return r;if(!c)throw Error(`\`${n}\` must be used within \`${t}\``)}return JN(s,`useContext`),[o,s]}JN(r,`createContext`);let i=JN(()=>{let t=n.map(e=>U.createContext(e));return JN(function(n){let r=n?.[e]||t;return U.useMemo(()=>({[`__scope${e}`]:{...n,[e]:r}}),[n,r])},`useScope`)},`createScope`);return i.scopeName=e,[r,ZN(i,...t)]}JN(XN,`createContextScope`);function ZN(...e){let t=e[0];if(e.length===1)return t;let n=JN(()=>{let n=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return JN(function(e){let r=n.reduce((t,{useScope:n,scopeName:r})=>{let i=n(e)[`__scope${r}`];return{...t,...i}},{});return U.useMemo(()=>({[`__scope${t.scopeName}`]:r}),[r])},`useComposedScopes`)},`createScope`);return n.scopeName=t.scopeName,n}JN(ZN,`composeContextScopes`);var QN=globalThis?.document?U.useLayoutEffect:()=>{},$N=Object.defineProperty,eP=(e,t)=>$N(e,`name`,{value:t,configurable:!0}),tP=U.useId||(()=>void 0),nP=0;function rP(e){let[t,n]=U.useState(tP());return QN(()=>{e||n(e=>e??String(nP++))},[e]),e||(t?`radix-${t}`:``)}eP(rP,`useId`);var iP=Object.defineProperty,aP=(e,t)=>iP(e,`name`,{value:t,configurable:!0}),oP=U.useEffectEvent,sP=U.useInsertionEffect;function cP(e){if(typeof oP==`function`)return oP(e);let t=U.useRef(()=>{throw Error(`Cannot call an event handler while rendering.`)});return typeof sP==`function`?sP(()=>{t.current=e}):QN(()=>{t.current=e}),U.useMemo(()=>((...e)=>t.current?.(...e)),[])}aP(cP,`useEffectEvent`);var lP=Object.defineProperty,uP=(e,t)=>lP(e,`name`,{value:t,configurable:!0}),dP=U.useInsertionEffect||QN;function fP({prop:e,defaultProp:t,onChange:n=uP(()=>{},`onChange`),caller:r}){let[i,a,o]=pP({defaultProp:t,onChange:n}),s=e!==void 0;return[s?e:i,U.useCallback(t=>{if(s){let n=mP(t)?t(e):t;n!==e&&o.current?.(n)}else a(t)},[s,e,a,o])]}uP(fP,`useControllableState`);function pP({defaultProp:e,onChange:t}){let[n,r]=U.useState(e),i=U.useRef(n),a=U.useRef(t);return dP(()=>{a.current=t},[t]),U.useEffect(()=>{i.current!==n&&(a.current?.(n),i.current=n)},[n,i]),[n,r,a]}uP(pP,`useUncontrolledState`);function mP(e){return typeof e==`function`}uP(mP,`isFunction`);var hP=Symbol(`RADIX:SYNC_STATE`);function gP(e,t,n,r){let{prop:i,defaultProp:a,onChange:o,caller:s}=t,c=i!==void 0,l=cP(o),u=[{...n,state:a}];r&&u.push(r);let[d,f]=U.useReducer((t,n)=>{if(n.type===hP)return{...t,state:n.state};let r=e(t,n);return c&&!Object.is(r.state,t.state)&&l(r.state),r},...u),p=d.state,m=U.useRef(p);U.useEffect(()=>{m.current!==p&&(m.current=p,c||l(p))},[p,m,c]);let h=U.useMemo(()=>i===void 0?d:{...d,state:i},[d,i]);return U.useEffect(()=>{c&&!Object.is(i,d.state)&&f({type:hP,state:i})},[i,d.state,c]),[h,f]}uP(gP,`useControllableStateReducer`);var _P=Object.defineProperty,vP=(e,t)=>_P(e,`name`,{value:t,configurable:!0});function yP(e){let t=U.forwardRef((t,n)=>{let{children:r,...i}=t,a=null,o=!1,s=[];r=kP(r),U.Children.forEach(r,e=>{if(TP(e)){o=!0;let t=e,n=`child`in t.props?t.props.child:t.props.children;for(;DP(n)&&typeof NP==`function`;)n=NP(n._payload);a=SP(t,n),s.push(a?.props?.children)}else s.push(e)}),a?a=U.cloneElement(a,void 0,s):!o&&U.Children.count(r)===1&&U.isValidElement(r)&&(a=r);let c=a?wP(a):void 0,l=KN(n,c);if(!a){if(r||r===0)throw Error(o?MP(e):jP(e));return r}let u=CP(i,a.props??{});return a.type!==U.Fragment&&(u.ref=n?l:c),U.cloneElement(a,u)});return t.displayName=`${e}.Slot`,t}vP(yP,`createSlot`);var bP=Symbol.for(`radix.slottable`);function xP(e){let t=vP(e=>`child`in e?e.children(e.child):e.children,`Slottable`);return t.displayName=`${e}.Slottable`,t.__radixId=bP,t}vP(xP,`createSlottable`);var SP=vP((e,t)=>`child`in e.props?U.isValidElement(t)?U.cloneElement(t,void 0,e.props.children(t.props.children)):null:U.isValidElement(t)?t:null,`getSlottableElementFromSlottable`);function CP(e,t){let n={...t};for(let r in t){let i=e[r],a=t[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...e)=>{let t=a(...e);return i(...e),t}:i&&(n[r]=i):r===`style`?n[r]={...i,...a}:r===`className`?n[r]=[i,a].filter(Boolean).join(` `):r===`aria-describedby`&&(n[r]=AP(a,i))}return{...e,...n}}vP(CP,`mergeProps`);function wP(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)}vP(wP,`getElementRef`);function TP(e){return U.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===bP}vP(TP,`isSlottable`);var EP=Symbol.for(`react.lazy`);function DP(e){return typeof e==`object`&&!!e&&`$$typeof`in e&&e.$$typeof===EP&&`_payload`in e&&OP(e._payload)}vP(DP,`isLazyComponent`);function OP(e){return typeof e==`object`&&!!e&&`then`in e}vP(OP,`isPromiseLike`);function kP(e){let t=e;for(;DP(t)&&typeof NP==`function`;)t=NP(t._payload);return t}vP(kP,`useUnwrappedLazy`);function AP(...e){let t=new Set;for(let n of e)if(typeof n==`string`)for(let e of String(n).trim().split(/\s+/))e&&t.add(e);return t.size>0?Array.from(t).join(` `):void 0}vP(AP,`concatAriaDescribedby`);var jP=vP(e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,`createSlotError`),MP=vP(e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,`createSlottableError`),NP=U.use,PP=Object.defineProperty,FP=(e,t)=>PP(e,`name`,{value:t,configurable:!0}),IP=[`a`,`button`,`div`,`form`,`h2`,`h3`,`img`,`input`,`label`,`li`,`nav`,`ol`,`p`,`select`,`span`,`svg`,`ul`].reduce((e,t)=>{let n=yP(`Primitive.${t}`),r=U.forwardRef((e,r)=>{let{asChild:i,...a}=e,o=i?n:t;return typeof window<`u`&&(window[Symbol.for(`radix-ui`)]=!0),(0,W.jsx)(o,{...a,ref:r})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function LP(e,t){e&&oe.flushSync(()=>e.dispatchEvent(t))}FP(LP,`dispatchDiscreteCustomEvent`);var RP=Object.defineProperty,zP=(e,t)=>RP(e,`name`,{value:t,configurable:!0}),BP=U.useInsertionEffect;function VP(e){let t=U.useRef(e);return typeof BP==`function`?BP(()=>{t.current=e}):QN(()=>{t.current=e}),U.useMemo(()=>((...e)=>t.current?.(...e)),[])}zP(VP,`useCallbackRef`);var HP=Object.defineProperty,UP=(e,t)=>HP(e,`name`,{value:t,configurable:!0}),WP=`dismissableLayer.update`,GP=`dismissableLayer.pointerDownOutside`,KP=`dismissableLayer.focusOutside`,qP,JP=U.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),YP=U.forwardRef(UP(function(e,t){let{disableOutsidePointerEvents:n=!1,deferPointerDownOutside:r=!1,onEscapeKeyDown:i,onPointerDownOutside:a,onFocusOutside:o,onInteractOutside:s,onDismiss:c,...l}=e,u=U.useContext(JP),[d,f]=U.useState(null),p=d?.ownerDocument??globalThis?.document,[,m]=U.useState({}),h=KN(t,f),g=Array.from(u.layers),[_]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),v=_?g.indexOf(_):-1,y=d?g.indexOf(d):-1,b=u.layersWithOutsidePointerEventsDisabled.size>0,x=y>=v,S=U.useRef(!1),C=QP(e=>{a?.(e),s?.(e),e.defaultPrevented||c?.()},{ownerDocument:p,deferPointerDownOutside:r,isDeferredPointerDownOutsideRef:S,dismissableSurfaces:u.dismissableSurfaces,shouldHandlePointerDownOutside:U.useCallback(e=>{if(!(e instanceof Node))return!1;let t=[...u.branches].some(t=>t.contains(e));return x&&!t},[u.branches,x])}),w=$P(e=>{if(r&&S.current)return;let t=e.target;[...u.branches].some(e=>e.contains(t))||(o?.(e),s?.(e),e.defaultPrevented||c?.())},p),T=d?y===g.length-1:!1,E=VP(e=>{e.key===`Escape`&&(i?.(e),!e.defaultPrevented&&c&&(e.preventDefault(),c()))});return U.useEffect(()=>{if(T)return p.addEventListener(`keydown`,E,{capture:!0}),()=>p.removeEventListener(`keydown`,E,{capture:!0})},[p,T,E]),U.useEffect(()=>{if(d)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(qP=p.body.style.pointerEvents,p.body.style.pointerEvents=`none`),u.layersWithOutsidePointerEventsDisabled.add(d)),u.layers.add(d),eF(),()=>{n&&(u.layersWithOutsidePointerEventsDisabled.delete(d),u.layersWithOutsidePointerEventsDisabled.size===0&&(p.body.style.pointerEvents=qP))}},[d,p,n,u]),U.useEffect(()=>()=>{d&&(u.layers.delete(d),u.layersWithOutsidePointerEventsDisabled.delete(d),eF())},[d,u]),U.useEffect(()=>{let e=UP(()=>m({}),`handleUpdate`);return document.addEventListener(WP,e),()=>document.removeEventListener(WP,e)},[]),(0,W.jsx)(IP.div,{...l,ref:h,style:{pointerEvents:b?x?`auto`:`none`:void 0,...e.style},onFocusCapture:LN(e.onFocusCapture,w.onFocusCapture),onBlurCapture:LN(e.onBlurCapture,w.onBlurCapture),onPointerDownCapture:LN(e.onPointerDownCapture,C.onPointerDownCapture)})},`DismissableLayer`));function XP(){let e=U.useContext(JP),[t,n]=U.useState(null);return U.useEffect(()=>{if(t)return e.dismissableSurfaces.add(t),()=>{e.dismissableSurfaces.delete(t)}},[t,e.dismissableSurfaces]),n}UP(XP,`useDismissableLayerSurface`);var ZP=UP(()=>!0,`IS_TRUE`);function QP(e,t){let{ownerDocument:n=globalThis?.document,deferPointerDownOutside:r=!1,isDeferredPointerDownOutsideRef:i,dismissableSurfaces:a,shouldHandlePointerDownOutside:o=ZP}=t,s=VP(e),c=U.useRef(!1),l=U.useRef(!1),u=U.useRef(new Map),d=U.useRef(()=>{});return U.useEffect(()=>{function e(){l.current=!1,i.current=!1,u.current.clear()}UP(e,`resetOutsideInteraction`);function t(){return Array.from(u.current.values()).some(Boolean)}UP(t,`isOutsideInteractionIntercepted`);function f(e){if(!l.current)return;let t=e.target;t instanceof Node&&[...a].some(e=>e.contains(t))||u.current.set(e.type,!0),e.type===`click`&&window.setTimeout(()=>{l.current&&d.current()},0)}UP(f,`handleInteractionCapture`);function p(e){l.current&&u.current.set(e.type,!1)}UP(p,`handleInteractionBubble`);let m=UP(a=>{if(a.target&&!c.current){let f=function(){n.removeEventListener(`click`,d.current);let r=t();e(),r||tF(GP,s,p,{discrete:!0})};if(UP(f,`handleAndDispatchPointerDownOutsideEvent`),!o(a.target)){n.removeEventListener(`click`,d.current),e(),c.current=!1;return}let p={originalEvent:a};l.current=!0,i.current=r&&a.button===0,u.current.clear(),!r||a.button!==0?f():(n.removeEventListener(`click`,d.current),d.current=f,n.addEventListener(`click`,d.current,{once:!0}))}else n.removeEventListener(`click`,d.current),e();c.current=!1},`handlePointerDown`),h=[`pointerup`,`mousedown`,`mouseup`,`touchstart`,`touchend`,`click`];for(let e of h)n.addEventListener(e,f,!0),n.addEventListener(e,p);let g=window.setTimeout(()=>{n.addEventListener(`pointerdown`,m)},0);return()=>{window.clearTimeout(g),n.removeEventListener(`pointerdown`,m),n.removeEventListener(`click`,d.current);for(let e of h)n.removeEventListener(e,f,!0),n.removeEventListener(e,p)}},[n,s,r,i,a,o]),{onPointerDownCapture:UP(()=>c.current=!0,`onPointerDownCapture`)}}UP(QP,`usePointerDownOutside`);function $P(e,t=globalThis?.document){let n=VP(e),r=U.useRef(!1);return U.useEffect(()=>{let e=UP(e=>{e.target&&!r.current&&tF(KP,n,{originalEvent:e},{discrete:!1})},`handleFocus`);return t.addEventListener(`focusin`,e),()=>t.removeEventListener(`focusin`,e)},[t,n]),{onFocusCapture:UP(()=>r.current=!0,`onFocusCapture`),onBlurCapture:UP(()=>r.current=!1,`onBlurCapture`)}}UP($P,`useFocusOutside`);function eF(){let e=new CustomEvent(WP);document.dispatchEvent(e)}UP(eF,`dispatchUpdate`);function tF(e,t,n,{discrete:r}){let i=n.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?LP(i,a):i.dispatchEvent(a)}UP(tF,`handleAndDispatchCustomEvent`);var nF=Object.defineProperty,rF=(e,t)=>nF(e,`name`,{value:t,configurable:!0}),iF=`focusScope.autoFocusOnMount`,aF=`focusScope.autoFocusOnUnmount`,oF={bubbles:!1,cancelable:!0},sF=U.forwardRef(rF(function(e,t){let{loop:n=!1,trapped:r=!1,branches:i,onMountAutoFocus:a,onUnmountAutoFocus:o,...s}=e,[c,l]=U.useState(null),u=VP(a),d=VP(o),f=U.useRef(null),p=KN(t,l),m=U.useRef(i);U.useEffect(()=>{m.current=i});let h=U.useCallback(e=>e?c?.contains(e)?!0:!!m.current?.some(t=>t.contains(e)):!1,[c]),g=U.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;U.useEffect(()=>{if(r){let e=function(e){if(g.paused||!c)return;let t=e.target;h(t)?f.current=t:vF(f.current,{select:!0})},t=function(e){if(g.paused||!c)return;let t=e.relatedTarget;t!==null&&(h(t)||vF(f.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(let t of e)t.removedNodes.length>0&&vF(c)};rF(e,`handleFocusIn`),rF(t,`handleFocusOut`),rF(n,`handleMutations`),document.addEventListener(`focusin`,e),document.addEventListener(`focusout`,t);let r=new MutationObserver(n);return c&&r.observe(c,{childList:!0,subtree:!0}),()=>{document.removeEventListener(`focusin`,e),document.removeEventListener(`focusout`,t),r.disconnect()}}},[r,c,g.paused,h]),U.useEffect(()=>{if(c){yF.add(g);let e=document.activeElement;if(!c.contains(e)){let t=new CustomEvent(iF,oF);c.addEventListener(iF,u),c.dispatchEvent(t),t.defaultPrevented||(fF(SF(mF(c)),{select:!0}),document.activeElement===e&&vF(c))}return()=>{c.removeEventListener(iF,u);let t=c.ownerDocument,n=CustomEvent;setTimeout(()=>{let r=new n(aF,oF);c.addEventListener(aF,d),c.dispatchEvent(r),r.defaultPrevented||vF(e??t.body,{select:!0}),c.removeEventListener(aF,d),yF.remove(g)},0)}}},[c,u,d,g]);let _=U.useCallback(e=>{if(!n&&!r||g.paused)return;let t=e.key===`Tab`&&!e.altKey&&!e.ctrlKey&&!e.metaKey,i=document.activeElement;if(t&&i){let t=e.currentTarget,[r,a]=pF(t);r&&a?!e.shiftKey&&i===a?(e.preventDefault(),n&&vF(r,{select:!0})):e.shiftKey&&i===r&&(e.preventDefault(),n&&vF(a,{select:!0})):i===t&&e.preventDefault()}},[n,r,g.paused]);return(0,W.jsx)(IP.div,{tabIndex:-1,...s,ref:p,onKeyDown:_})},`FocusScope`)),cF=U.createContext(null);function lF({registry:e,children:t}){return e?(0,W.jsx)(cF.Provider,{value:e,children:t}):t}rF(lF,`FocusScopeBranchProvider`);function uF(){let[e,t]=U.useState([]);return{nodes:e,registry:U.useMemo(()=>({add:rF(e=>t(t=>t.includes(e)?t:[...t,e]),`add`),remove:rF(e=>t(t=>t.filter(t=>t!==e)),`remove`)}),[])}}rF(uF,`useFocusScopeBranchRegistry`);function dF(e){let t=U.useContext(cF);U.useEffect(()=>{if(e&&t)return t.add(e),()=>t.remove(e)},[e,t])}rF(dF,`useFocusScopeBranch`);function fF(e,{select:t=!1}={}){let n=document.activeElement;for(let r of e)if(vF(r,{select:t}),document.activeElement!==n)return}rF(fF,`focusFirst`);function pF(e){let t=mF(e);return[hF(t,e),hF(t.reverse(),e)]}rF(pF,`getTabbableEdges`);function mF(e){let t=[],n=e.ownerDocument.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:rF(e=>{let t=e.tagName===`INPUT`&&e.type===`hidden`;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP},`acceptNode`)});for(;n.nextNode();)t.push(n.currentNode);return t}rF(mF,`getTabbableCandidates`);function hF(e,t){let n=typeof t.checkVisibility==`function`&&t.checkVisibility({checkVisibilityCSS:!0});for(let r of e)if(!(n?!r.checkVisibility({checkVisibilityCSS:!0}):gF(r,{upTo:t})))return r}rF(hF,`findVisible`);function gF(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}rF(gF,`isHidden`);function _F(e){return e.tagName===`INPUT`&&typeof e.select==`function`}rF(_F,`isSelectableInput`);function vF(e,{select:t=!1}={}){if(e&&e.focus){let n=(e.ownerDocument??document).activeElement;e.focus({preventScroll:!0}),e!==n&&_F(e)&&t&&e.select()}}rF(vF,`focus`);var yF=bF();function bF(){let e=[];return{add(t){let n=e[0];t!==n&&n?.pause(),e=xF(e,t),e.unshift(t)},remove(t){e=xF(e,t),e[0]?.resume()}}}rF(bF,`createFocusScopesStack`);function xF(e,t){let n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}rF(xF,`arrayRemove`);function SF(e){return e.filter(e=>e.tagName!==`A`)}rF(SF,`removeLinks`);var CF=Object.defineProperty,wF=U.forwardRef(((e,t)=>CF(e,`name`,{value:t,configurable:!0}))(function(e,t){let{container:n,...r}=e,[i,a]=U.useState(!1);QN(()=>a(!0),[]);let o=n||i&&globalThis?.document?.body;return o?oe.createPortal((0,W.jsx)(IP.div,{...r,ref:t}),o):null},`Portal`)),TF=Object.defineProperty,EF=(e,t)=>TF(e,`name`,{value:t,configurable:!0});function DF(e,t){return U.useReducer((e,n)=>t[e][n]??e,e)}EF(DF,`useStateMachine`);var OF=EF(e=>{let{present:t,children:n}=e,r=kF(t),i=typeof n==`function`?n({present:r.isPresent}):U.Children.only(n),a=jF(r.ref,NF(i));return typeof n==`function`||r.isPresent?U.cloneElement(i,{ref:a}):null},`Presence`);function kF(e){let[t,n]=U.useState(),r=U.useRef(null),i=U.useRef(e),a=U.useRef(`none`),o=U.useRef(void 0),[s,c]=DF(e?`mounted`:`unmounted`,{mounted:{UNMOUNT:`unmounted`,ANIMATION_OUT:`unmountSuspended`},unmountSuspended:{MOUNT:`mounted`,ANIMATION_END:`unmounted`},unmounted:{MOUNT:`mounted`}});return U.useEffect(()=>{s===`mounted`?(a.current=o.current??MF(r.current),o.current=void 0):a.current=`none`},[s]),QN(()=>{let t=r.current,n=i.current;if(n!==e){let r=a.current,s=MF(t);e?(o.current=s,c(`MOUNT`)):s===`none`||t?.display===`none`?c(`UNMOUNT`):c(n&&r!==s?`ANIMATION_OUT`:`UNMOUNT`),i.current=e}},[e,c]),QN(()=>{if(t){let e,n=t.ownerDocument.defaultView??window,o=EF(a=>{let o=MF(r.current).includes(CSS.escape(a.animationName));if(a.target===t&&o&&(c(`ANIMATION_END`),!i.current)){let r=t.style.animationFillMode;t.style.animationFillMode=`forwards`,e=n.setTimeout(()=>{t.style.animationFillMode===`forwards`&&(t.style.animationFillMode=r)})}},`handleAnimationEnd`),s=EF(e=>{e.target===t&&(a.current=MF(r.current))},`handleAnimationStart`);return t.addEventListener(`animationstart`,s),t.addEventListener(`animationcancel`,o),t.addEventListener(`animationend`,o),()=>{n.clearTimeout(e),t.removeEventListener(`animationstart`,s),t.removeEventListener(`animationcancel`,o),t.removeEventListener(`animationend`,o)}}c(`ANIMATION_END`)},[t,c]),{isPresent:[`mounted`,`unmountSuspended`].includes(s),ref:U.useCallback(e=>{if(e){let t=getComputedStyle(e);r.current=t,o.current=MF(t)}else r.current=null;n(e)},[])}}EF(kF,`usePresence`);function AF(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}EF(AF,`setRef`);function jF(...e){let t=U.useRef(e);return t.current=e,U.useCallback(e=>{let n=t.current,r=!1,i=n.map(t=>{let n=AF(t,e);return!r&&typeof n==`function`&&(r=!0),n});if(r)return()=>{for(let e=0;e<i.length;e++){let t=i[e];typeof t==`function`?t():AF(n[e],null)}}},[])}EF(jF,`useStableComposedRefs`);function MF(e){return e?.animationName||`none`}EF(MF,`getAnimationName`);function NF(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)}EF(NF,`getElementRef`);var PF=Object.defineProperty,FF=(e,t)=>PF(e,`name`,{value:t,configurable:!0}),IF=0,LF=null;function RF(e){return zF(),e.children}FF(RF,`FocusGuards`);function zF(){U.useEffect(()=>{LF||={start:BF(),end:BF()};let{start:e,end:t}=LF;return document.body.firstElementChild!==e&&document.body.insertAdjacentElement(`afterbegin`,e),document.body.lastElementChild!==t&&document.body.insertAdjacentElement(`beforeend`,t),IF++,()=>{IF===1&&(LF?.start.remove(),LF?.end.remove(),LF=null),IF=Math.max(0,IF-1)}},[])}FF(zF,`useFocusGuards`);function BF(){let 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}FF(BF,`createFocusGuard`);var VF=function(){return VF=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n],t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},VF.apply(this,arguments)};function HF(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 i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function UF(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,a;r<i;r++)(a||!(r in t))&&(a||=Array.prototype.slice.call(t,0,r),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))}var WF=`right-scroll-bar-position`,GF=`width-before-scroll-bar`,KF=`with-scroll-bars-hidden`,qF=`--removed-body-scroll-bar-size`;function JF(e,t){return typeof e==`function`?e(t):e&&(e.current=t),e}function YF(e,t){var n=(0,U.useState)(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(e){var t=n.value;t!==e&&(n.value=e,n.callback(e,t))}}}})[0];return n.callback=t,n.facade}var XF=typeof window<`u`?U.useLayoutEffect:U.useEffect,ZF=new WeakMap;function QF(e,t){var n=YF(t||null,function(t){return e.forEach(function(e){return JF(e,t)})});return XF(function(){var t=ZF.get(n);if(t){var r=new Set(t),i=new Set(e),a=n.current;r.forEach(function(e){i.has(e)||JF(e,null)}),i.forEach(function(e){r.has(e)||JF(e,a)})}ZF.set(n,e)},[e]),n}function $F(e){return e}function eI(e,t){t===void 0&&(t=$F);var n=[],r=!1;return{read:function(){if(r)throw 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(e){var i=t(e,r);return n.push(i),function(){n=n.filter(function(e){return e!==i})}},assignSyncMedium:function(e){for(r=!0;n.length;){var t=n;n=[],t.forEach(e)}n={push:function(t){return e(t)},filter:function(){return n}}},assignMedium:function(e){r=!0;var t=[];if(n.length){var i=n;n=[],i.forEach(e),t=n}var a=function(){var n=t;t=[],n.forEach(e)},o=function(){return Promise.resolve().then(a)};o(),n={push:function(e){t.push(e),o()},filter:function(e){return t=t.filter(e),n}}}}}function tI(e){e===void 0&&(e={});var t=eI(null);return t.options=VF({async:!0,ssr:!1},e),t}var nI=function(e){var t=e.sideCar,n=HF(e,[`sideCar`]);if(!t)throw Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw Error(`Sidecar medium not found`);return U.createElement(r,VF({},n))};nI.isSideCarExport=!0;function rI(e,t){return e.useMedium(t),nI}var iI=tI(),aI=function(){},oI=U.forwardRef(function(e,t){var n=U.useRef(null),r=U.useState({onScrollCapture:aI,onWheelCapture:aI,onTouchMoveCapture:aI}),i=r[0],a=r[1],o=e.forwardProps,s=e.children,c=e.className,l=e.removeScrollBar,u=e.enabled,d=e.shards,f=e.sideCar,p=e.noRelative,m=e.noIsolation,h=e.inert,g=e.allowPinchZoom,_=e.as,v=_===void 0?`div`:_,y=e.gapMode,b=HF(e,[`forwardProps`,`children`,`className`,`removeScrollBar`,`enabled`,`shards`,`sideCar`,`noRelative`,`noIsolation`,`inert`,`allowPinchZoom`,`as`,`gapMode`]),x=f,S=QF([n,t]),C=VF(VF({},b),i);return U.createElement(U.Fragment,null,u&&U.createElement(x,{sideCar:iI,removeScrollBar:l,shards:d,noRelative:p,noIsolation:m,inert:h,setCallbacks:a,allowPinchZoom:!!g,lockRef:n,gapMode:y}),o?U.cloneElement(U.Children.only(s),VF(VF({},C),{ref:S})):U.createElement(v,VF({},C,{className:c,ref:S}),s))});oI.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},oI.classNames={fullWidth:GF,zeroRight:WF};var sI=function(){if(typeof __webpack_nonce__<`u`)return __webpack_nonce__};function cI(){if(!document)return null;var e=document.createElement(`style`);e.type=`text/css`;var t=sI();return t&&e.setAttribute(`nonce`,t),e}function lI(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function uI(e){(document.head||document.getElementsByTagName(`head`)[0]).appendChild(e)}var dI=function(){var e=0,t=null;return{add:function(n){e==0&&(t=cI())&&(lI(t,n),uI(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},fI=function(){var e=dI();return function(t,n){U.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},pI=function(){var e=fI();return function(t){var n=t.styles,r=t.dynamic;return e(n,r),null}},mI={left:0,top:0,right:0,gap:0},hI=function(e){return parseInt(e||``,10)||0},gI=function(e){var t=window.getComputedStyle(document.body),n=t[e===`padding`?`paddingLeft`:`marginLeft`],r=t[e===`padding`?`paddingTop`:`marginTop`],i=t[e===`padding`?`paddingRight`:`marginRight`];return[hI(n),hI(r),hI(i)]},_I=function(e){if(e===void 0&&(e=`margin`),typeof window>`u`)return mI;var t=gI(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])}},vI=pI(),yI=`data-scroll-locked`,bI=function(e,t,n,r){var i=e.left,a=e.top,o=e.right,s=e.gap;return n===void 0&&(n=`margin`),`
46
- .${KF} {
47
- overflow: hidden ${r};
48
- padding-right: ${s}px ${r};
49
- }
50
- body[${yI}] {
51
- overflow: hidden ${r};
52
- overscroll-behavior: contain;
53
- ${[t&&`position: relative ${r};`,n===`margin`&&`
54
- padding-left: ${i}px;
55
- padding-top: ${a}px;
56
- padding-right: ${o}px;
57
- margin-left:0;
58
- margin-top:0;
59
- margin-right: ${s}px ${r};
60
- `,n===`padding`&&`padding-right: ${s}px ${r};`].filter(Boolean).join(``)}
61
- }
62
-
63
- .${WF} {
64
- right: ${s}px ${r};
65
- }
66
-
67
- .${GF} {
68
- margin-right: ${s}px ${r};
69
- }
70
-
71
- .${WF} .${WF} {
72
- right: 0 ${r};
73
- }
74
-
75
- .${GF} .${GF} {
76
- margin-right: 0 ${r};
77
- }
78
-
79
- body[${yI}] {
80
- ${qF}: ${s}px;
81
- }
82
- `},xI=function(){var e=parseInt(document.body.getAttribute(`data-scroll-locked`)||`0`,10);return isFinite(e)?e:0},SI=function(){U.useEffect(function(){return document.body.setAttribute(yI,(xI()+1).toString()),function(){var e=xI()-1;e<=0?document.body.removeAttribute(yI):document.body.setAttribute(yI,e.toString())}},[])},CI=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?`margin`:r;SI();var a=U.useMemo(function(){return _I(i)},[i]);return U.createElement(vI,{styles:bI(a,!t,i,n?``:`!important`)})},wI=!1;if(typeof window<`u`)try{var TI=Object.defineProperty({},"passive",{get:function(){return wI=!0,!0}});window.addEventListener(`test`,TI,TI),window.removeEventListener(`test`,TI,TI)}catch{wI=!1}var EI=wI?{passive:!1}:!1,DI=function(e){return e.tagName===`TEXTAREA`},OI=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!==`hidden`&&!(n.overflowY===n.overflowX&&!DI(e)&&n[t]===`visible`)},kI=function(e){return OI(e,`overflowY`)},AI=function(e){return OI(e,`overflowX`)},jI=function(e,t){var n=t.ownerDocument,r=t;do{if(typeof ShadowRoot<`u`&&r instanceof ShadowRoot&&(r=r.host),PI(e,r)){var i=FI(e,r);if(i[1]>i[2])return!0}r=r.parentNode}while(r&&r!==n.body);return!1},MI=function(e){return[e.scrollTop,e.scrollHeight,e.clientHeight]},NI=function(e){return[e.scrollLeft,e.scrollWidth,e.clientWidth]},PI=function(e,t){return e===`v`?kI(t):AI(t)},FI=function(e,t){return e===`v`?MI(t):NI(t)},II=function(e,t){return e===`h`&&t===`rtl`?-1:1},LI=function(e,t,n,r,i){var a=II(e,window.getComputedStyle(t).direction),o=a*r,s=n.target,c=t.contains(s),l=!1,u=o>0,d=0,f=0;do{if(!s)break;var p=FI(e,s),m=p[0],h=p[1]-p[2]-a*m;(m||h)&&PI(e,s)&&(d+=h,f+=m);var g=s.parentNode;s=g&&g.nodeType===Node.DOCUMENT_FRAGMENT_NODE?g.host:g}while(!c&&s!==document.body||c&&(t.contains(s)||t===s));return(u&&(i&&Math.abs(d)<1||!i&&o>d)||!u&&(i&&Math.abs(f)<1||!i&&-o>f))&&(l=!0),l},RI=function(e){return`changedTouches`in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},zI=function(e){return[e.deltaX,e.deltaY]},BI=function(e){return e&&`current`in e?e.current:e},VI=function(e,t){return e[0]===t[0]&&e[1]===t[1]},HI=function(e){return`
83
- .block-interactivity-${e} {pointer-events: none;}
84
- .allow-interactivity-${e} {pointer-events: all;}
85
- `},UI=0,WI=[];function GI(e){var t=U.useRef([]),n=U.useRef([0,0]),r=U.useRef(),i=U.useState(UI++)[0],a=U.useState(pI)[0],o=U.useRef(e);U.useEffect(function(){o.current=e},[e]),U.useEffect(function(){if(e.inert){document.body.classList.add(`block-interactivity-${i}`);var t=UF([e.lockRef.current],(e.shards||[]).map(BI),!0).filter(Boolean);return t.forEach(function(e){return e.classList.add(`allow-interactivity-${i}`)}),function(){document.body.classList.remove(`block-interactivity-${i}`),t.forEach(function(e){return e.classList.remove(`allow-interactivity-${i}`)})}}},[e.inert,e.lockRef.current,e.shards]);var s=U.useCallback(function(e,t){if(`touches`in e&&e.touches.length===2||e.type===`wheel`&&e.ctrlKey)return!o.current.allowPinchZoom;var i=RI(e),a=n.current,s=`deltaX`in e?e.deltaX:a[0]-i[0],c=`deltaY`in e?e.deltaY:a[1]-i[1],l,u=e.target,d=Math.abs(s)>Math.abs(c)?`h`:`v`;if(`touches`in e&&d===`h`&&u.type===`range`)return!1;var f=window.getSelection(),p=f&&f.anchorNode;if(p&&(p===u||p.contains(u)))return!1;var m=jI(d,u);if(!m)return!0;if(m?l=d:(l=d===`v`?`h`:`v`,m=jI(d,u)),!m)return!1;if(!r.current&&`changedTouches`in e&&(s||c)&&(r.current=l),!l)return!0;var h=r.current||l;return LI(h,t,e,h===`h`?s:c,!0)},[]),c=U.useCallback(function(e){var n=e;if(WI.length&&WI[WI.length-1]===a){var r=`deltaY`in n?zI(n):RI(n),i=t.current.filter(function(e){return e.name===n.type&&(e.target===n.target||n.target===e.shadowParent)&&VI(e.delta,r)})[0];if(i&&i.should)n.cancelable&&n.preventDefault();else if(!i){var c=(o.current.shards||[]).map(BI).filter(Boolean).filter(function(e){return e.contains(n.target)});(c.length>0?s(n,c[0]):!o.current.noIsolation)&&n.cancelable&&n.preventDefault()}}},[]),l=U.useCallback(function(e,n,r,i){var a={name:e,delta:n,target:r,should:i,shadowParent:KI(r)};t.current.push(a),setTimeout(function(){t.current=t.current.filter(function(e){return e!==a})},1)},[]),u=U.useCallback(function(e){n.current=RI(e),r.current=void 0},[]),d=U.useCallback(function(t){l(t.type,zI(t),t.target,s(t,e.lockRef.current))},[]),f=U.useCallback(function(t){l(t.type,RI(t),t.target,s(t,e.lockRef.current))},[]);U.useEffect(function(){return WI.push(a),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:f}),document.addEventListener(`wheel`,c,EI),document.addEventListener(`touchmove`,c,EI),document.addEventListener(`touchstart`,u,EI),function(){WI=WI.filter(function(e){return e!==a}),document.removeEventListener(`wheel`,c,EI),document.removeEventListener(`touchmove`,c,EI),document.removeEventListener(`touchstart`,u,EI)}},[]);var p=e.removeScrollBar,m=e.inert;return U.createElement(U.Fragment,null,m?U.createElement(a,{styles:HI(i)}):null,p?U.createElement(CI,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function KI(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}var qI=rI(iI,GI),JI=U.forwardRef(function(e,t){return U.createElement(oI,VF({},e,{ref:t,sideCar:qI}))});JI.classNames=oI.classNames;var YI=function(e){return typeof document>`u`?null:(Array.isArray(e)?e[0]:e).ownerDocument.body},XI=new WeakMap,ZI=new WeakMap,QI={},$I=0,eL=function(e){return e&&(e.host||eL(e.parentNode))},tL=function(e,t){return t.map(function(t){if(e.contains(t))return t;var n=eL(t);return n&&e.contains(n)?n:(console.error(`aria-hidden`,t,`in not contained inside`,e,`. Doing nothing`),null)}).filter(function(e){return!!e})},nL=function(e,t,n,r){var i=tL(t,Array.isArray(e)?e:[e]);QI[n]||(QI[n]=new WeakMap);var a=QI[n],o=[],s=new Set,c=new Set(i),l=function(e){e&&!s.has(e)&&(s.add(e),l(e.parentNode))};i.forEach(l);var u=function(e){e&&!c.has(e)&&Array.prototype.forEach.call(e.children,function(e){if(s.has(e))u(e);else try{var t=e.getAttribute(r),i=t!==null&&t!==`false`,c=(XI.get(e)||0)+1,l=(a.get(e)||0)+1;XI.set(e,c),a.set(e,l),o.push(e),c===1&&i&&ZI.set(e,!0),l===1&&e.setAttribute(n,`true`),i||e.setAttribute(r,`true`)}catch(t){console.error(`aria-hidden: cannot operate on `,e,t)}})};return u(t),s.clear(),$I++,function(){o.forEach(function(e){var t=XI.get(e)-1,i=a.get(e)-1;XI.set(e,t),a.set(e,i),t||(ZI.has(e)||e.removeAttribute(r),ZI.delete(e)),i||e.removeAttribute(n)}),$I--,$I||(XI=new WeakMap,XI=new WeakMap,ZI=new WeakMap,QI={})}},rL=function(e,t,n){n===void 0&&(n=`data-aria-hidden`);var r=Array.from(Array.isArray(e)?e:[e]),i=t||YI(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll(`[aria-live], script`))),nL(r,i,n,`aria-hidden`)):function(){return null}},iL=Object.defineProperty,aL=(e,t)=>iL(e,`name`,{value:t,configurable:!0}),oL=`Dialog`,[sL,cL]=XN(oL),[lL,uL]=sL(oL),dL=aL(e=>{let{__scopeDialog:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:o=!0}=e,s=U.useRef(null),c=U.useRef(null),{nodes:l,registry:u}=uF(),[d,f]=fP({prop:r,defaultProp:i??!1,onChange:a,caller:oL}),[p,m]=U.useState(0),[h,g]=U.useState(0);return(0,W.jsx)(lL,{scope:t,triggerRef:s,contentRef:c,contentId:rP(),titleId:rP(),descriptionId:rP(),titlePresent:p>0,descriptionPresent:h>0,setTitleCount:m,setDescriptionCount:g,open:d,onOpenChange:f,onOpenToggle:U.useCallback(()=>f(e=>!e),[f]),modal:o,branchNodes:l,branchRegistry:u,children:n})},`Dialog`),fL=`DialogPortal`,[pL,mL]=sL(fL,{forceMount:void 0}),hL=aL(e=>{let{__scopeDialog:t,forceMount:n,children:r,container:i}=e,a=uL(fL,t);return(0,W.jsx)(pL,{scope:t,forceMount:n,children:U.Children.map(r,e=>(0,W.jsx)(OF,{present:n||a.open,children:(0,W.jsx)(wF,{asChild:!0,container:i,children:e})}))})},`DialogPortal`),gL=`DialogOverlay`,_L=U.forwardRef(aL(function(e,t){let n=mL(gL,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=uL(gL,e.__scopeDialog);return a.modal?(0,W.jsx)(OF,{present:r||a.open,children:(0,W.jsx)(yL,{...i,ref:t})}):null},`DialogOverlay`)),vL=yP(`DialogOverlay.RemoveScroll`),yL=U.forwardRef(aL(function(e,t){let{__scopeDialog:n,...r}=e,i=uL(gL,n),a=KN(t,XP());return(0,W.jsx)(JI,{as:vL,allowPinchZoom:!0,shards:U.useMemo(()=>[i.contentRef,...i.branchNodes.map(e=>({current:e}))],[i.contentRef,i.branchNodes]),children:(0,W.jsx)(IP.div,{"data-state":EL(i.open),...r,ref:a,style:{pointerEvents:`auto`,...r.style}})})},`DialogOverlayImpl`)),bL=`DialogContent`,xL=U.forwardRef(aL(function(e,t){let n=mL(bL,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=uL(bL,e.__scopeDialog);return(0,W.jsx)(OF,{present:r||a.open,children:a.modal?(0,W.jsx)(SL,{...i,ref:t}):(0,W.jsx)(CL,{...i,ref:t})})},`DialogContent`)),SL=U.forwardRef(aL(function(e,t){let n=uL(bL,e.__scopeDialog),r=U.useRef(null),i=KN(t,n.contentRef,r);return U.useEffect(()=>{let e=r.current;if(e)return rL(e)},[]),(0,W.jsx)(wL,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,onCloseAutoFocus:LN(e.onCloseAutoFocus,e=>{e.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:LN(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0;(t.button===2||n)&&e.preventDefault()}),onFocusOutside:LN(e.onFocusOutside,e=>e.preventDefault())})},`DialogContentModal`)),CL=U.forwardRef(aL(function(e,t){let n=uL(bL,e.__scopeDialog),r=U.useRef(!1),i=U.useRef(!1);return(0,W.jsx)(wL,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(r.current||n.triggerRef.current?.focus(),t.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(r.current=!0,t.detail.originalEvent.type===`pointerdown`&&(i.current=!0));let a=t.target;n.triggerRef.current?.contains(a)&&t.preventDefault(),t.detail.originalEvent.type===`focusin`&&i.current&&t.preventDefault()}})},`DialogContentNonModal`)),wL=U.forwardRef(aL(function(e,t){let{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,"aria-describedby":o,children:s,...c}=e,l=uL(bL,n);return zF(),(0,W.jsx)(lF,{registry:l.branchRegistry,children:(0,W.jsx)(sF,{asChild:!0,loop:!0,trapped:r,branches:l.branchNodes,onMountAutoFocus:i,onUnmountAutoFocus:a,children:(0,W.jsx)(YP,{role:`dialog`,id:l.contentId,"aria-labelledby":l.titlePresent?l.titleId:void 0,"aria-describedby":l.descriptionPresent?TL(o,l.descriptionId):o,"data-state":EL(l.open),...c,ref:t,deferPointerDownOutside:!0,onDismiss:()=>l.onOpenChange(!1),children:s})})})},`DialogContentImpl`));function TL(...e){let t=new Set;for(let n of e)if(typeof n==`string`)for(let e of String(n).trim().split(/\s+/))e&&t.add(e);return t.size>0?Array.from(t).join(` `):void 0}aL(TL,`concatAriaDescribedby`);function EL(e){return e?`open`:`closed`}aL(EL,`getState`);var DL=`[cmdk-group=""]`,OL=`[cmdk-group-items=""]`,kL=`[cmdk-group-heading=""]`,AL=`[cmdk-item=""]`,jL=`${AL}:not([aria-disabled="true"])`,ML=`cmdk-item-select`,NL=`data-value`,PL=(e,t,n)=>NN(e,t,n),FL=U.createContext(void 0),IL=()=>U.useContext(FL),LL=U.createContext(void 0),RL=()=>U.useContext(LL),zL=U.createContext(void 0),BL=U.forwardRef((e,t)=>{let n=eR(()=>({search:``,value:e.value??e.defaultValue??``,selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}})),r=eR(()=>new Set),i=eR(()=>new Map),a=eR(()=>new Map),o=eR(()=>new Set),s=QL(e),{label:c,children:l,value:u,onValueChange:d,filter:f,shouldFilter:p,loop:m,disablePointerSelection:h=!1,vimBindings:g=!0,..._}=e,v=rP(),y=rP(),b=rP(),x=U.useRef(null),S=rR();$L(()=>{if(u!==void 0){let e=u.trim();n.current.value=e,C.emit()}},[u]),$L(()=>{S(6,k)},[]);let C=U.useMemo(()=>({subscribe:e=>(o.current.add(e),()=>o.current.delete(e)),snapshot:()=>n.current,setState:(e,t,r)=>{var i,a,o;if(!Object.is(n.current[e],t)){if(n.current[e]=t,e===`search`)O(),E(),S(1,D);else if(e===`value`){if(document.activeElement.hasAttribute(`cmdk-input`)||document.activeElement.hasAttribute(`cmdk-root`)){let e=document.getElementById(b);e?e.focus():(i=document.getElementById(v))==null||i.focus()}if(S(7,()=>{n.current.selectedItemId=A()?.id,C.emit()}),r||S(5,k),s.current?.value!==void 0){let e=t??``;(o=(a=s.current).onValueChange)==null||o.call(a,e);return}}C.emit()}},emit:()=>{o.current.forEach(e=>e())}}),[]),w=U.useMemo(()=>({value:(e,t,r)=>{t!==a.current.get(e)?.value&&(a.current.set(e,{value:t,keywords:r}),n.current.filtered.items.set(e,T(t,r)),S(2,()=>{E(),C.emit()}))},item:(e,t)=>(r.current.add(e),t&&(i.current.has(t)?i.current.get(t).add(e):i.current.set(t,new Set([e]))),S(3,()=>{O(),E(),n.current.value||D(),C.emit()}),()=>{a.current.delete(e),r.current.delete(e),n.current.filtered.items.delete(e);let t=A();S(4,()=>{O(),t?.getAttribute(`id`)===e&&D(),C.emit()})}),group:e=>(i.current.has(e)||i.current.set(e,new Set),()=>{a.current.delete(e),i.current.delete(e)}),filter:()=>s.current.shouldFilter,label:c||e[`aria-label`],getDisablePointerSelection:()=>s.current.disablePointerSelection,listId:v,inputId:b,labelId:y,listInnerRef:x}),[]);function T(e,t){let r=s.current?.filter??PL;return e?r(e,n.current.search,t):0}function E(){if(!n.current.search||s.current.shouldFilter===!1)return;let e=n.current.filtered.items,t=[];n.current.filtered.groups.forEach(n=>{let r=i.current.get(n),a=0;r.forEach(t=>{let n=e.get(t);a=Math.max(n,a)}),t.push([n,a])});let r=x.current;j().sort((t,n)=>{let r=t.getAttribute(`id`),i=n.getAttribute(`id`);return(e.get(i)??0)-(e.get(r)??0)}).forEach(e=>{let t=e.closest(OL);t?t.appendChild(e.parentElement===t?e:e.closest(`${OL} > *`)):r.appendChild(e.parentElement===r?e:e.closest(`${OL} > *`))}),t.sort((e,t)=>t[1]-e[1]).forEach(e=>{let t=x.current?.querySelector(`${DL}[${NL}="${encodeURIComponent(e[0])}"]`);t?.parentElement.appendChild(t)})}function D(){let e=j().find(e=>e.getAttribute(`aria-disabled`)!==`true`)?.getAttribute(NL);C.setState(`value`,e||void 0)}function O(){if(!n.current.search||s.current.shouldFilter===!1){n.current.filtered.count=r.current.size;return}n.current.filtered.groups=new Set;let e=0;for(let t of r.current){let r=T(a.current.get(t)?.value??``,a.current.get(t)?.keywords??[]);n.current.filtered.items.set(t,r),r>0&&e++}for(let[e,t]of i.current)for(let r of t)if(n.current.filtered.items.get(r)>0){n.current.filtered.groups.add(e);break}n.current.filtered.count=e}function k(){var e;let t=A();t&&(t.parentElement?.firstChild===t&&((e=t.closest(DL)?.querySelector(kL))==null||e.scrollIntoView({block:`nearest`})),t.scrollIntoView({block:`nearest`}))}function A(){return x.current?.querySelector(`${AL}[aria-selected="true"]`)}function j(){return Array.from(x.current?.querySelectorAll(jL)||[])}function M(e){let t=j()[e];t&&C.setState(`value`,t.getAttribute(NL))}function N(e){var t;let n=A(),r=j(),i=r.findIndex(e=>e===n),a=r[i+e];(t=s.current)!=null&&t.loop&&(a=i+e<0?r[r.length-1]:i+e===r.length?r[0]:r[i+e]),a&&C.setState(`value`,a.getAttribute(NL))}function P(e){let t=A()?.closest(DL),n;for(;t&&!n;)t=e>0?XL(t,DL):ZL(t,DL),n=t?.querySelector(jL);n?C.setState(`value`,n.getAttribute(NL)):N(e)}let F=()=>M(j().length-1),I=e=>{e.preventDefault(),e.metaKey?F():e.altKey?P(1):N(1)},L=e=>{e.preventDefault(),e.metaKey?M(0):e.altKey?P(-1):N(-1)};return U.createElement(IP.div,{ref:t,tabIndex:-1,..._,"cmdk-root":``,onKeyDown:e=>{var t;(t=_.onKeyDown)==null||t.call(_,e);let n=e.nativeEvent.isComposing||e.keyCode===229;if(!(e.defaultPrevented||n))switch(e.key){case`n`:case`j`:g&&e.ctrlKey&&I(e);break;case`ArrowDown`:I(e);break;case`p`:case`k`:g&&e.ctrlKey&&L(e);break;case`ArrowUp`:L(e);break;case`Home`:e.preventDefault(),M(0);break;case`End`:e.preventDefault(),F();break;case`Enter`:{e.preventDefault();let t=A();if(t){let e=new Event(ML);t.dispatchEvent(e)}}}}},U.createElement(`label`,{"cmdk-label":``,htmlFor:w.inputId,id:w.labelId,style:oR},c),aR(e,e=>U.createElement(LL.Provider,{value:C},U.createElement(FL.Provider,{value:w},e))))}),VL=U.forwardRef((e,t)=>{let n=rP(),r=U.useRef(null),i=U.useContext(zL),a=IL(),o=QL(e),s=o.current?.forceMount??i?.forceMount;$L(()=>{if(!s)return a.item(n,i?.id)},[s]);let c=nR(n,r,[e.value,e.children,r],e.keywords),l=RL(),u=tR(e=>e.value&&e.value===c.current),d=tR(e=>s||a.filter()===!1?!0:!e.search||e.filtered.items.get(n)>0);U.useEffect(()=>{let t=r.current;if(t&&!e.disabled)return t.addEventListener(ML,f),()=>t.removeEventListener(ML,f)},[d,e.onSelect,e.disabled]);function f(){var e,t;p(),(t=(e=o.current).onSelect)==null||t.call(e,c.current)}function p(){l.setState(`value`,c.current,!0)}if(!d)return null;let{disabled:m,value:h,onSelect:g,forceMount:_,keywords:v,...y}=e;return U.createElement(IP.div,{ref:GN(r,t),...y,id:n,"cmdk-item":``,role:`option`,"aria-disabled":!!m,"aria-selected":!!u,"data-disabled":!!m,"data-selected":!!u,onPointerMove:m||a.getDisablePointerSelection()?void 0:p,onClick:m?void 0:f},e.children)}),HL=U.forwardRef((e,t)=>{let{heading:n,children:r,forceMount:i,...a}=e,o=rP(),s=U.useRef(null),c=U.useRef(null),l=rP(),u=IL(),d=tR(e=>i||u.filter()===!1?!0:!e.search||e.filtered.groups.has(o));$L(()=>u.group(o),[]),nR(o,s,[e.value,e.heading,c]);let f=U.useMemo(()=>({id:o,forceMount:i}),[i]);return U.createElement(IP.div,{ref:GN(s,t),...a,"cmdk-group":``,role:`presentation`,hidden:!d||void 0},n&&U.createElement(`div`,{ref:c,"cmdk-group-heading":``,"aria-hidden":!0,id:l},n),aR(e,e=>U.createElement(`div`,{"cmdk-group-items":``,role:`group`,"aria-labelledby":n?l:void 0},U.createElement(zL.Provider,{value:f},e))))}),UL=U.forwardRef((e,t)=>{let{alwaysRender:n,...r}=e,i=U.useRef(null),a=tR(e=>!e.search);return!n&&!a?null:U.createElement(IP.div,{ref:GN(i,t),...r,"cmdk-separator":``,role:`separator`})}),WL=U.forwardRef((e,t)=>{let{onValueChange:n,...r}=e,i=e.value!=null,a=RL(),o=tR(e=>e.search),s=tR(e=>e.selectedItemId),c=IL();return U.useEffect(()=>{e.value!=null&&a.setState(`search`,e.value)},[e.value]),U.createElement(IP.input,{ref:t,...r,"cmdk-input":``,autoComplete:`off`,autoCorrect:`off`,spellCheck:!1,"aria-autocomplete":`list`,role:`combobox`,"aria-expanded":!0,"aria-controls":c.listId,"aria-labelledby":c.labelId,"aria-activedescendant":s,id:c.inputId,type:`text`,value:i?e.value:o,onChange:e=>{i||a.setState(`search`,e.target.value),n?.(e.target.value)}})}),GL=U.forwardRef((e,t)=>{let{children:n,label:r=`Suggestions`,...i}=e,a=U.useRef(null),o=U.useRef(null),s=tR(e=>e.selectedItemId),c=IL();return U.useEffect(()=>{if(o.current&&a.current){let e=o.current,t=a.current,n,r=new ResizeObserver(()=>{n=requestAnimationFrame(()=>{let n=e.offsetHeight;t.style.setProperty(`--cmdk-list-height`,n.toFixed(1)+`px`)})});return r.observe(e),()=>{cancelAnimationFrame(n),r.unobserve(e)}}},[]),U.createElement(IP.div,{ref:GN(a,t),...i,"cmdk-list":``,role:`listbox`,tabIndex:-1,"aria-activedescendant":s,"aria-label":r,id:c.listId},aR(e,e=>U.createElement(`div`,{ref:GN(o,c.listInnerRef),"cmdk-list-sizer":``},e)))}),KL=U.forwardRef((e,t)=>{let{open:n,onOpenChange:r,overlayClassName:i,contentClassName:a,container:o,...s}=e;return U.createElement(dL,{open:n,onOpenChange:r},U.createElement(hL,{container:o},U.createElement(_L,{"cmdk-overlay":``,className:i}),U.createElement(xL,{"aria-label":e.label,"cmdk-dialog":``,className:a},U.createElement(BL,{ref:t,...s}))))}),qL=U.forwardRef((e,t)=>tR(e=>e.filtered.count===0)?U.createElement(IP.div,{ref:t,...e,"cmdk-empty":``,role:`presentation`}):null),JL=U.forwardRef((e,t)=>{let{progress:n,children:r,label:i=`Loading...`,...a}=e;return U.createElement(IP.div,{ref:t,...a,"cmdk-loading":``,role:`progressbar`,"aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":i},aR(e,e=>U.createElement(`div`,{"aria-hidden":!0},e)))}),YL=Object.assign(BL,{List:GL,Item:VL,Input:WL,Group:HL,Separator:UL,Dialog:KL,Empty:qL,Loading:JL});function XL(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function ZL(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function QL(e){let t=U.useRef(e);return $L(()=>{t.current=e}),t}var $L=typeof window>`u`?U.useEffect:U.useLayoutEffect;function eR(e){let t=U.useRef();return t.current===void 0&&(t.current=e()),t}function tR(e){let t=RL(),n=()=>e(t.snapshot());return U.useSyncExternalStore(t.subscribe,n,n)}function nR(e,t,n,r=[]){let i=U.useRef(),a=IL();return $L(()=>{var o;let s=(()=>{for(let e of n){if(typeof e==`string`)return e.trim();if(typeof e==`object`&&`current`in e)return e.current?e.current.textContent?.trim():i.current}})(),c=r.map(e=>e.trim());a.value(e,s,c),(o=t.current)==null||o.setAttribute(NL,s),i.current=s}),i}var rR=()=>{let[e,t]=U.useState(),n=eR(()=>new Map);return $L(()=>{n.current.forEach(e=>e()),n.current=new Map},[e]),(e,r)=>{n.current.set(e,r),t({})}};function iR(e){let t=e.type;return typeof t==`function`?t(e.props):`render`in t?t.render(e.props):e}function aR({asChild:e,children:t},n){return e&&U.isValidElement(t)?U.cloneElement(iR(t),{ref:t.ref},n(t.props.children)):n(t)}var oR={position:`absolute`,width:`1px`,height:`1px`,padding:`0`,margin:`-1px`,overflow:`hidden`,clip:`rect(0, 0, 0, 0)`,whiteSpace:`nowrap`,borderWidth:`0`};function sR({className:e,...t}){return(0,W.jsx)(YL,{"data-slot":`command`,className:K(`flex size-full flex-col overflow-hidden rounded-xl! bg-popover p-1 text-popover-foreground`,e),...t})}function cR({title:e=I(`shell.primitive.commandTitle`),description:t=I(`shell.primitive.commandDescription`),children:n,className:r,showCloseButton:i=!1,...a}){return(0,W.jsxs)(XA,{...a,children:[(0,W.jsxs)(nj,{className:`sr-only`,children:[(0,W.jsx)(ij,{children:e}),(0,W.jsx)(aj,{children:t})]}),(0,W.jsx)(tj,{className:K(`top-1/3 translate-y-0 overflow-hidden rounded-xl! p-0`,r),showCloseButton:i,children:n})]})}function lR({className:e,...t}){return(0,W.jsx)(`div`,{"data-slot":`command-input-wrapper`,className:`p-1 pb-0`,children:(0,W.jsxs)(jC,{className:`h-8! rounded-lg! border-input/30 bg-input/30 shadow-none! *:data-[slot=input-group-addon]:pl-2!`,children:[(0,W.jsx)(YL.Input,{"data-slot":`command-input`,className:K(`w-full text-sm outline-hidden disabled:cursor-not-allowed disabled:opacity-50`,e),...t}),(0,W.jsx)(NC,{children:(0,W.jsx)(Nn,{className:`size-4 shrink-0 opacity-50`})})]})})}function uR({className:e,...t}){return(0,W.jsx)(YL.List,{"data-slot":`command-list`,className:K(`no-scrollbar max-h-72 scroll-py-1 overflow-x-hidden overflow-y-auto outline-none`,e),...t})}function dR({className:e,...t}){return(0,W.jsx)(YL.Empty,{"data-slot":`command-empty`,className:K(`py-6 text-center text-sm`,e),...t})}function fR({className:e,...t}){return(0,W.jsx)(YL.Group,{"data-slot":`command-group`,className:K(`overflow-hidden p-1 text-foreground **:[[cmdk-group-heading]]:px-2 **:[[cmdk-group-heading]]:py-1.5 **:[[cmdk-group-heading]]:text-xs **:[[cmdk-group-heading]]:font-medium **:[[cmdk-group-heading]]:text-muted-foreground`,e),...t})}var pR=`group/command-item relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none in-data-[slot=dialog-content]:rounded-lg! data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 data-selected:bg-muted data-selected:text-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 data-selected:*:[svg]:text-foreground`;function mR({className:e,children:t,...n}){return(0,W.jsxs)(YL.Item,{"data-slot":`command-item`,className:K(pR,e),...n,children:[t,(0,W.jsx)(Qt,{className:`ml-auto opacity-0 group-has-data-[slot=command-shortcut]/command-item:hidden group-data-[checked=true]/command-item:opacity-100`})]})}function hR({className:e,...t}){return(0,W.jsx)(`span`,{"data-slot":`command-shortcut`,className:K(`ml-auto text-xs tracking-widest text-muted-foreground group-data-selected/command-item:text-foreground`,e),...t})}var gR={peek:i().min(1).max(80).optional().catch(void 0),peekProject:i().min(1).max(80).optional().catch(void 0)},_R=f(gR),vR={period:i().regex(/^\d{4}-\d{2}-\d{2}$/).optional().catch(void 0)},yR=x.extend({offset:C().int().min(0).catch(0).default(0),...gR,...vR});function bR(e){let{q:t,parentId:n,archived:a,due:o,sort:s,order:c,...l}=x.parse(Object.fromEntries(Object.entries(N(i(),M()).parse(e)).filter(([e])=>e!==`offset`))),u=r(l).map(e=>({...e,values:e.values.toSorted()}));return JSON.stringify([u,t,n,a,o,s,c])}function xR(e,t,n){let r=g(e[t]),i=g(e[a(t,`none`)]);return(!r.length||r.includes(n))&&!i.includes(n)}var SR=f({q:i().trim().max(200).optional().catch(void 0),type:h(_).optional().catch(void 0),offset:C().int().min(0).max(1e3).catch(0).default(0)}),CR=yR.transform(({q:e,sort:t,order:n,peek:r,peekProject:i})=>yR.parse({q:e,sort:t,order:n,peek:r,peekProject:i})),wR=f({...gR,view:h([`unread`,`mentions`,`all`]).catch(`unread`).default(`unread`)}),TR=h([`compact`,`comfortable`]),ER=h([`compact`,`all`]),DR=h([`status`,`none`]),OR=h([`list`,`board`,`calendar`,`timeline`]),kR=h([`due`,`project`,`none`]),AR=P([`key`,`labels`,`scopes`,`status`,`priority`,`difficulty`,`kind`,`assigneeId`,`startAt`,`dueAt`,`createdAt`,`updatedAt`],e=>I(`shell.column.${e}`)),jR=e=>`field:${e}`,MR=[`account`,`appearance`,`preferences`,`credentials`,`notifications`],NR=[`general`,`storage`,`search`,`events`,`users`,`workspaces`,`authentication`],PR=f({error:i().optional().catch(void 0)}),FR=PR.extend({section:h(MR).catch(`account`).default(`account`)}),IR=f({section:h(NR).catch(`general`).default(`general`)}),LR=[`general`,`members`,`roles`,`labels`],RR=[`general`,`members`,`workflow`,`labels`,`fields`,`integrations`,`calendar`],zR=f({section:h(LR).catch(`general`).default(`general`)}),BR=zR.extend({section:h(RR).catch(`general`).default(`general`)});export{FM as $,Ct as $a,kl as $i,ZC as $n,lx as $r,rk as $t,uR as A,Fn as Aa,Jl as Ai,KT as An,dC as Ar,NA as At,pM as B,nn as Ba,vl as Bi,hT as Bn,DS as Br,Fk as Bt,LR as C,pi as Ca,Jy as Ci,JT as Cn,de as Co,vC as Cr,Uj as Ct,fR as D,oi as Da,bg as Di,$T as Dn,ae as Do,fC as Dr,qA as Dt,dR as E,ci as Ea,By as Ei,QT as En,ce as Eo,cC as Er,JA as Et,vN as F,_n as Fa,Bl as Fi,xT as Fn,oC as Fr,TA as Ft,_M as G,Wt as Ga,El as Gi,Nw as Gn,Kx as Gr,Rk as Gt,WM as H,Qt as Ha,_l as Hi,oT as Hn,TS as Hr,Lk as Ht,gN as I,pn as Ia,Rl as Ii,ST as In,aC as Ir,aA as It,cM as J,Tt as Ja,yl as Ji,Cw as Jn,jx as Jr,jk as Jt,mM as K,At as Ka,xl as Ki,jw as Kn,Px as Kr,Vk as Kt,lN as L,dn as La,zl as Li,bT as Ln,iC as Lr,qk as Lt,pR as M,kn as Ma,Kl as Mi,RT as Mn,lC as Mr,jA as Mt,hN as N,Dn as Na,ql as Ni,MT as Nn,$ as Nr,xA as Nt,lR as O,Gr as Oa,Am as Oi,UT as On,yC as Or,BA as Ot,_N as P,yn as Pa,Ul as Pi,jT as Pn,sC as Pr,EA as Pt,NM as Q,wt as Qa,Nl as Qi,uw as Qn,ux as Qr,ck as Qt,nN as R,ln as Ra,Vl as Ri,vT as Rn,rC as Rr,Nk as Rt,CR as S,bi as Sa,qy as Si,YT as Sn,fe as So,pC as Sr,Vj as St,cR as T,ui as Ta,Vy as Ti,ZT as Tn,se as To,CC as Tr,$A as Tt,GM as U,Jt as Ua,gl as Ui,sT as Un,AS as Ur,Ik as Ut,IM as V,en as Va,Cl as Vi,pT as Vn,ES as Vr,Mk as Vt,zM as W,Kt as Wa,jl as Wi,Uw as Wn,eS as Wr,zk as Wt,gM as X,Et as Xa,Al as Xi,dw as Xn,Q as Xr,fk as Xt,lM as Y,Dt as Ya,bl as Yi,hw as Yn,fx as Yr,Tk as Yt,kM as Z,St as Za,Sl as Zi,fw as Zn,mx as Zr,dk as Zt,TR as _,Ui as _a,pb as _i,iE as _n,Te as _o,SC as _r,Yj as _t,jR as a,Fa as aa,Wb as ai,nO as an,rt as ao,JC as ar,fM as at,OR as b,Ti as ba,lb as bi,VT as bn,Oe as bo,TC as br,Hj as bt,wR as c,Sa as ca,Lb as ci,DD as cn,We as co,VC as cr,oM as ct,RR as d,ha as da,kb as di,AE as dn,we as do,RC as dr,yM as dt,Ml as ea,sx as ei,UO as en,xt as eo,QC as er,VM as et,BR as f,ma as fa,Db as fi,kE as fn,Ce as fo,jC as fr,BM as ft,AR as g,qi as ga,gb as gi,dE as gn,ge as go,bC as gr,Qj as gt,FR as h,Zi as ha,_b as hi,mE as hn,xe as ho,kC as hr,$j as ht,PR as i,Pa as ia,Gb as ii,mO as in,st as io,qC as ir,HM as it,hR as j,Nn as ja,Gl as ji,zT as jn,uC as jr,MA as jt,mR as k,K as ka,Xl as ki,XT as kn,xC as kr,zA as kt,xR as l,ya as la,Mb as li,TD as ln,Ue as lo,BC as lr,LM as lt,yR as m,q as ma,vb as mi,bE as mn,Se as mo,LC as mr,Zj as mt,IR as n,wl as na,Jb as ni,jO as nn,_t as no,WC as nr,RM as nt,bR as o,ka as oa,Bb as oi,wD as on,Je as oo,KC as or,uM as ot,SR as p,J as pa,Eb as pi,SE as pn,Pe as po,NC as pr,jM as pt,PM as q,kt as qa,Dl as qi,Sw as qn,Mx as qr,Hk as qt,NR as r,Tl as ra,qb as ri,xO as rn,pt as ro,GC as rr,UM as rt,zR as s,Ca as sa,zb as si,AD as sn,qe as so,HC as sr,xM as st,MR as t,Ol as ta,Zb as ti,PO as tn,vt as to,YC as tr,hM as tt,_R as u,va as ua,Pb as ui,RE as un,_e as uo,zC as ur,sM as ut,DR as v,Ai as va,mb as vi,uE as vn,De as vo,gC as vr,qj as vt,sR as w,fi as wa,ob as wi,qT as wn,le as wo,_C as wr,Pj as wt,kR as x,Ci as xa,Wy as xi,WT as xn,Le as xo,wC as xr,Wj as xt,ER as y,wi as ya,sb as yi,tE as yn,be as yo,hC as yr,Gj as yt,aM as z,sn as za,Pl as zi,yT as zn,kS as zr,Pk as zt};