ocean-brain 0.8.2 → 0.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (232) hide show
  1. package/README.md +2 -0
  2. package/dist/mcp.js +47 -75
  3. package/package.json +3 -2
  4. package/server/client/dist/assets/{ArrowRight.es-g2YZTklZ.js → ArrowRight.es-Bm-ZXpEC.js} +1 -1
  5. package/server/client/dist/assets/Calendar-BsNs3NzO.js +25 -0
  6. package/server/client/dist/assets/{Callout-B_IPSF_5.js → Callout-CviyPHKO.js} +1 -1
  7. package/server/client/dist/assets/{Copy.es-CNxe4ujr.js → Copy.es-BPreRnP9.js} +1 -1
  8. package/server/client/dist/assets/{Graph-D9GeO71k.js → Graph-vXQQ0a-Q.js} +1 -1
  9. package/server/client/dist/assets/Graph-yPE3ljW0.js +46 -0
  10. package/server/client/dist/assets/{Image.es-DnON8cv2.js → Image.es-DnR3qc_c.js} +1 -1
  11. package/server/client/dist/assets/KaTeX_AMS-Regular-BQhdFMY1.woff2 +0 -0
  12. package/server/client/dist/assets/KaTeX_AMS-Regular-DMm9YOAa.woff +0 -0
  13. package/server/client/dist/assets/KaTeX_AMS-Regular-DRggAlZN.ttf +0 -0
  14. package/server/client/dist/assets/KaTeX_Caligraphic-Bold-ATXxdsX0.ttf +0 -0
  15. package/server/client/dist/assets/KaTeX_Caligraphic-Bold-BEiXGLvX.woff +0 -0
  16. package/server/client/dist/assets/KaTeX_Caligraphic-Bold-Dq_IR9rO.woff2 +0 -0
  17. package/server/client/dist/assets/KaTeX_Caligraphic-Regular-CTRA-rTL.woff +0 -0
  18. package/server/client/dist/assets/KaTeX_Caligraphic-Regular-Di6jR-x-.woff2 +0 -0
  19. package/server/client/dist/assets/KaTeX_Caligraphic-Regular-wX97UBjC.ttf +0 -0
  20. package/server/client/dist/assets/KaTeX_Fraktur-Bold-BdnERNNW.ttf +0 -0
  21. package/server/client/dist/assets/KaTeX_Fraktur-Bold-BsDP51OF.woff +0 -0
  22. package/server/client/dist/assets/KaTeX_Fraktur-Bold-CL6g_b3V.woff2 +0 -0
  23. package/server/client/dist/assets/KaTeX_Fraktur-Regular-CB_wures.ttf +0 -0
  24. package/server/client/dist/assets/KaTeX_Fraktur-Regular-CTYiF6lA.woff2 +0 -0
  25. package/server/client/dist/assets/KaTeX_Fraktur-Regular-Dxdc4cR9.woff +0 -0
  26. package/server/client/dist/assets/KaTeX_Main-Bold-Cx986IdX.woff2 +0 -0
  27. package/server/client/dist/assets/KaTeX_Main-Bold-Jm3AIy58.woff +0 -0
  28. package/server/client/dist/assets/KaTeX_Main-Bold-waoOVXN0.ttf +0 -0
  29. package/server/client/dist/assets/KaTeX_Main-BoldItalic-DxDJ3AOS.woff2 +0 -0
  30. package/server/client/dist/assets/KaTeX_Main-BoldItalic-DzxPMmG6.ttf +0 -0
  31. package/server/client/dist/assets/KaTeX_Main-BoldItalic-SpSLRI95.woff +0 -0
  32. package/server/client/dist/assets/KaTeX_Main-Italic-3WenGoN9.ttf +0 -0
  33. package/server/client/dist/assets/KaTeX_Main-Italic-BMLOBm91.woff +0 -0
  34. package/server/client/dist/assets/KaTeX_Main-Italic-NWA7e6Wa.woff2 +0 -0
  35. package/server/client/dist/assets/KaTeX_Main-Regular-B22Nviop.woff2 +0 -0
  36. package/server/client/dist/assets/KaTeX_Main-Regular-Dr94JaBh.woff +0 -0
  37. package/server/client/dist/assets/KaTeX_Main-Regular-ypZvNtVU.ttf +0 -0
  38. package/server/client/dist/assets/KaTeX_Math-BoldItalic-B3XSjfu4.ttf +0 -0
  39. package/server/client/dist/assets/KaTeX_Math-BoldItalic-CZnvNsCZ.woff2 +0 -0
  40. package/server/client/dist/assets/KaTeX_Math-BoldItalic-iY-2wyZ7.woff +0 -0
  41. package/server/client/dist/assets/KaTeX_Math-Italic-DA0__PXp.woff +0 -0
  42. package/server/client/dist/assets/KaTeX_Math-Italic-flOr_0UB.ttf +0 -0
  43. package/server/client/dist/assets/KaTeX_Math-Italic-t53AETM-.woff2 +0 -0
  44. package/server/client/dist/assets/KaTeX_SansSerif-Bold-CFMepnvq.ttf +0 -0
  45. package/server/client/dist/assets/KaTeX_SansSerif-Bold-D1sUS0GD.woff2 +0 -0
  46. package/server/client/dist/assets/KaTeX_SansSerif-Bold-DbIhKOiC.woff +0 -0
  47. package/server/client/dist/assets/KaTeX_SansSerif-Italic-C3H0VqGB.woff2 +0 -0
  48. package/server/client/dist/assets/KaTeX_SansSerif-Italic-DN2j7dab.woff +0 -0
  49. package/server/client/dist/assets/KaTeX_SansSerif-Italic-YYjJ1zSn.ttf +0 -0
  50. package/server/client/dist/assets/KaTeX_SansSerif-Regular-BNo7hRIc.ttf +0 -0
  51. package/server/client/dist/assets/KaTeX_SansSerif-Regular-CS6fqUqJ.woff +0 -0
  52. package/server/client/dist/assets/KaTeX_SansSerif-Regular-DDBCnlJ7.woff2 +0 -0
  53. package/server/client/dist/assets/KaTeX_Script-Regular-C5JkGWo-.ttf +0 -0
  54. package/server/client/dist/assets/KaTeX_Script-Regular-D3wIWfF6.woff2 +0 -0
  55. package/server/client/dist/assets/KaTeX_Script-Regular-D5yQViql.woff +0 -0
  56. package/server/client/dist/assets/KaTeX_Size1-Regular-C195tn64.woff +0 -0
  57. package/server/client/dist/assets/KaTeX_Size1-Regular-Dbsnue_I.ttf +0 -0
  58. package/server/client/dist/assets/KaTeX_Size1-Regular-mCD8mA8B.woff2 +0 -0
  59. package/server/client/dist/assets/KaTeX_Size2-Regular-B7gKUWhC.ttf +0 -0
  60. package/server/client/dist/assets/KaTeX_Size2-Regular-Dy4dx90m.woff2 +0 -0
  61. package/server/client/dist/assets/KaTeX_Size2-Regular-oD1tc_U0.woff +0 -0
  62. package/server/client/dist/assets/KaTeX_Size3-Regular-CTq5MqoE.woff +0 -0
  63. package/server/client/dist/assets/KaTeX_Size3-Regular-DgpXs0kz.ttf +0 -0
  64. package/server/client/dist/assets/KaTeX_Size4-Regular-BF-4gkZK.woff +0 -0
  65. package/server/client/dist/assets/KaTeX_Size4-Regular-DWFBv043.ttf +0 -0
  66. package/server/client/dist/assets/KaTeX_Size4-Regular-Dl5lxZxV.woff2 +0 -0
  67. package/server/client/dist/assets/KaTeX_Typewriter-Regular-C0xS9mPB.woff +0 -0
  68. package/server/client/dist/assets/KaTeX_Typewriter-Regular-CO6r4hn1.woff2 +0 -0
  69. package/server/client/dist/assets/KaTeX_Typewriter-Regular-D3Ib7_Hf.ttf +0 -0
  70. package/server/client/dist/assets/Note-CmreVzvQ.js +25 -0
  71. package/server/client/dist/assets/{NotePropertiesPanel-2DgXEM4B.js → NotePropertiesPanel-DXYgE8h2.js} +2 -2
  72. package/server/client/dist/assets/PencilLine.es-B9V6u64t.js +1 -0
  73. package/server/client/dist/assets/{Plus.es-CQ8wn2is.js → Plus.es-CRRp2u5J.js} +1 -1
  74. package/server/client/dist/assets/Reminders-BOtfNeYD.js +1 -0
  75. package/server/client/dist/assets/Search-C-FB3pKf.js +1 -0
  76. package/server/client/dist/assets/SurfaceCard-GMt5xM7v.js +1 -0
  77. package/server/client/dist/assets/Tag-lBxDRE77.js +1 -0
  78. package/server/client/dist/assets/TagNotes-Bgorp_rC.js +1 -0
  79. package/server/client/dist/assets/{Trash.es-0aPpA-3S.js → Trash.es-svHOb5LN.js} +1 -1
  80. package/server/client/dist/assets/ViewNotes-C7d10VFf.js +1 -0
  81. package/server/client/dist/assets/ViewSectionDialog-Bhw-ILop.js +102 -0
  82. package/server/client/dist/assets/Views-C7V3saUo.js +1 -0
  83. package/server/client/dist/assets/abnfDiagram-VRR7QNED-CWlV5dXw.js +1 -0
  84. package/server/client/dist/assets/app-DQBV36r_.js +50 -0
  85. package/server/client/dist/assets/app-ZgwR5t_I.css +1 -0
  86. package/server/client/dist/assets/arc-BV-n6RUX.js +1 -0
  87. package/server/client/dist/assets/architectureDiagram-ZJ3FMSHR-CekzMXdu.js +36 -0
  88. package/server/client/dist/assets/blockDiagram-677ZJIJ3-B49yHoxq.js +132 -0
  89. package/server/client/dist/assets/c4Diagram-LMCZKHZV-0AfB9NBC.js +10 -0
  90. package/server/client/dist/assets/channel-CigOulR-.js +1 -0
  91. package/server/client/dist/assets/chunk-2Q5K7J3B-DaPQAU1q.js +1 -0
  92. package/server/client/dist/assets/chunk-32BRIVSS-CfL3kZAg.js +1 -0
  93. package/server/client/dist/assets/chunk-5VM5RSS4-DeOwWPE_.js +15 -0
  94. package/server/client/dist/assets/chunk-EX3LRPZG-C3W1oc9y.js +231 -0
  95. package/server/client/dist/assets/chunk-JWPE2WC7-_Oqh79OY.js +1 -0
  96. package/server/client/dist/assets/chunk-MOJQB5TN-DDKNNzI6.js +88 -0
  97. package/server/client/dist/assets/chunk-RYQCIY6F-DCHah7CC.js +1 -0
  98. package/server/client/dist/assets/chunk-V7JOEXUC-uUOIzgxj.js +206 -0
  99. package/server/client/dist/assets/chunk-VR4S4FIN-DDVw2WPs.js +1 -0
  100. package/server/client/dist/assets/chunk-XXDRQBXY-Coo4UFm2.js +1 -0
  101. package/server/client/dist/assets/classDiagram-OUVF2IWQ-D13ISIOW.js +1 -0
  102. package/server/client/dist/assets/classDiagram-v2-EOCWNBFH-D13ISIOW.js +1 -0
  103. package/server/client/dist/assets/colors-Cc3OSVma.js +1 -0
  104. package/server/client/dist/assets/cose-bilkent-JH36ORCC-C3pHmHpD.js +1 -0
  105. package/server/client/dist/assets/cynefin-VYW2F7L2-DU_G4Atc.js +166 -0
  106. package/server/client/dist/assets/cynefinDiagram-TSTJHNR4-DZ6iiJFo.js +62 -0
  107. package/server/client/dist/assets/cytoscape.esm-D3_iZ_3b.js +321 -0
  108. package/server/client/dist/assets/dagre-VKFMJZFB-DNELbhwC.js +4 -0
  109. package/server/client/dist/assets/defaultLocale-DX6XiGOO.js +1 -0
  110. package/server/client/dist/assets/diagram-FQU43EPY-CMEvZJ61.js +3 -0
  111. package/server/client/dist/assets/diagram-G47NLZAW-BYDtf6j9.js +24 -0
  112. package/server/client/dist/assets/diagram-NH7WQ7WH-CmXfcCQA.js +24 -0
  113. package/server/client/dist/assets/diagram-OA4YK3LP-BflTKJxU.js +30 -0
  114. package/server/client/dist/assets/diagram-WEI45ONY-KW3fKqna.js +41 -0
  115. package/server/client/dist/assets/ebnfDiagram-CCIWWBDH-CbyhY5Nj.js +1 -0
  116. package/server/client/dist/assets/erDiagram-Q63AITRT-CC2eZV8g.js +85 -0
  117. package/server/client/dist/assets/{floating-ui.react-dom-wWLZ1CdM.js → floating-ui.react-dom-BWTnA00G.js} +1 -1
  118. package/server/client/dist/assets/flowDiagram-23GEKE2U-unplo7Qm.js +156 -0
  119. package/server/client/dist/assets/ganttDiagram-NO4QXBWP-BcBK5HcZ.js +292 -0
  120. package/server/client/dist/assets/gitGraphDiagram-IHSO6WYX-DgVbbb5k.js +106 -0
  121. package/server/client/dist/assets/graph-C5DFNLrC.js +1 -0
  122. package/server/client/dist/assets/image-delete-confirmation-D7xrODQV.js +1 -0
  123. package/server/client/dist/assets/image.api-QmHYjp3z.js +17 -0
  124. package/server/client/dist/assets/index-CaF9d-zG.js +1 -0
  125. package/server/client/dist/assets/infoDiagram-FWYZ7A6U-N_D9RdfG.js +2 -0
  126. package/server/client/dist/assets/init-Gi6I4Gst.js +1 -0
  127. package/server/client/dist/assets/isObject-U9U2HXiq.js +1 -0
  128. package/server/client/dist/assets/ishikawaDiagram-FXEZZL3T-BBKrzmB2.js +70 -0
  129. package/server/client/dist/assets/journeyDiagram-5HDEW3XC-NdCxLmQB.js +139 -0
  130. package/server/client/dist/assets/kanban-definition-HUTT4EX6-Ck7t4-tt.js +89 -0
  131. package/server/client/dist/assets/katex-DywYRkvg.css +1 -0
  132. package/server/client/dist/assets/katex-HP8lGamR.js +257 -0
  133. package/server/client/dist/assets/katex-x288kqHd.js +257 -0
  134. package/server/client/dist/assets/layout-Cz0MDlGi.js +1 -0
  135. package/server/client/dist/assets/linear-D6yRgDLq.js +1 -0
  136. package/server/client/dist/assets/manage-image-DCDF8AM9.js +1 -0
  137. package/server/client/dist/assets/manage-image-detail-e0ViRAj-.js +1 -0
  138. package/server/client/dist/assets/map-Mm1V-_Na.js +1 -0
  139. package/server/client/dist/assets/mcp-admin-adapter-D39G3udJ.js +1 -0
  140. package/server/client/dist/assets/{mcp-CT_9IV2c.js → mcp-uFZkdhCi.js} +4 -4
  141. package/server/client/dist/assets/mermaid.core-B14ZAmWA.js +308 -0
  142. package/server/client/dist/assets/min-tv6RD-6E.js +1 -0
  143. package/server/client/dist/assets/mindmap-definition-LN4V7U3C-BTUqSdcP.js +96 -0
  144. package/server/client/dist/assets/{note-core-Buwzyxi7.js → note-core-DUTqUh5N.js} +2 -2
  145. package/server/client/dist/assets/{note-runtime-CPDVOFEo.js → note-runtime-zN5ddTba.js} +1 -1
  146. package/server/client/dist/assets/{note-ui-CHI-tzj-.js → note-ui-CxK8ymUc.js} +1 -1
  147. package/server/client/dist/assets/{note.api-D_00ZzJC.js → note.api-BQovzEzd.js} +6 -6
  148. package/server/client/dist/assets/ordinal-Cboi1Yqb.js +1 -0
  149. package/server/client/dist/assets/pegDiagram-2B236MQR-Cjcu3mVz.js +1 -0
  150. package/server/client/dist/assets/pieDiagram-ENE6RG2P-BxI_c22Z.js +39 -0
  151. package/server/client/dist/assets/{placeholder-DbdGiYGL.js → placeholder-D3b8lZGE.js} +4 -4
  152. package/server/client/dist/assets/properties-M-yWq1D7.js +1 -0
  153. package/server/client/dist/assets/quadrantDiagram-ABIIQ3AL-DGm0a-yR.js +7 -0
  154. package/server/client/dist/assets/railroadDiagram-RFXS5EU6-DmCDu89O.js +1 -0
  155. package/server/client/dist/assets/requirementDiagram-TGXJPOKE-CBpUt7Ig.js +84 -0
  156. package/server/client/dist/assets/route-preload.js +2 -2
  157. package/server/client/dist/assets/sankeyDiagram-HTMAVEWB-BjGnDZlp.js +40 -0
  158. package/server/client/dist/assets/search-DFnzZKLd.js +1 -0
  159. package/server/client/dist/assets/sequenceDiagram-DBY2YBRQ-B7rpCfS6.js +162 -0
  160. package/server/client/dist/assets/sizeCapture-X5ZJPWSS-CUJhD0uW.js +1 -0
  161. package/server/client/dist/assets/stateDiagram-2N3HPSRC-Y9-3XqRX.js +1 -0
  162. package/server/client/dist/assets/stateDiagram-v2-6OUMAXLB-DbHXhT02.js +1 -0
  163. package/server/client/dist/assets/swimlanes-5IMT3BWC-Cs1NO9ng.js +2 -0
  164. package/server/client/dist/assets/swimlanesDiagram-G3AALYLV-DQnrq2ZC.js +8 -0
  165. package/server/client/dist/assets/{tag.api-CX0SE06J.js → tag.api-DUfjr8bg.js} +3 -3
  166. package/server/client/dist/assets/time-CfAYZipR.js +9 -0
  167. package/server/client/dist/assets/timeline-definition-FHXFAJF6-8fqD4WNL.js +120 -0
  168. package/server/client/dist/assets/toNumber-DE3J3kMD.js +1 -0
  169. package/server/client/dist/assets/transform-BUB79_za.js +1 -0
  170. package/server/client/dist/assets/trash-CClKfP1x.js +1 -0
  171. package/server/client/dist/assets/url-9nrbQs7Z.js +1 -0
  172. package/server/client/dist/assets/{useReminderMutate-CLK1tHvT.js → useReminderMutate--omDLmBV.js} +4 -4
  173. package/server/client/dist/assets/vennDiagram-L72KCM5P-BPqKkd5a.js +34 -0
  174. package/server/client/dist/assets/wardleyDiagram-EHGQE667-Cq11kU2M.js +78 -0
  175. package/server/client/dist/assets/xychartDiagram-FW5EYKEG-DJ6UzFj-.js +7 -0
  176. package/server/client/dist/index.html +7 -7
  177. package/server/dist/features/image/services/delete.js +25 -1
  178. package/server/dist/features/note/graphql/note.mutation.resolver.js +38 -12
  179. package/server/dist/features/note/graphql/note.type-defs.js +1 -1
  180. package/server/dist/features/note/http/mcp.js +1 -60
  181. package/server/dist/features/note/services/authoring.js +2 -70
  182. package/server/dist/features/note/services/markdown-patch.js +80 -8
  183. package/server/dist/features/note/services/properties.js +21 -1
  184. package/server/dist/features/note/services/property-restore.js +26 -0
  185. package/server/dist/features/note/services/snapshot.js +79 -59
  186. package/server/dist/features/note/services/trash.js +16 -31
  187. package/server/dist/features/search/embedding-api-key-store.js +57 -0
  188. package/server/dist/features/search/embedding-client.js +179 -0
  189. package/server/dist/features/search/graphql/index.js +6 -0
  190. package/server/dist/features/search/graphql/resolver.js +20 -0
  191. package/server/dist/features/search/graphql/type-defs.js +30 -0
  192. package/server/dist/features/search/http/handlers.js +108 -0
  193. package/server/dist/features/search/hybrid-ranking.js +55 -0
  194. package/server/dist/features/search/hybrid-search.js +174 -0
  195. package/server/dist/features/search/note-change.js +16 -0
  196. package/server/dist/features/search/note-chunking.js +75 -0
  197. package/server/dist/features/search/search-config.js +150 -0
  198. package/server/dist/features/search/search-manager.js +431 -0
  199. package/server/dist/features/search/semantic-indexer.js +138 -0
  200. package/server/dist/features/search/sqlite-vector-index.js +636 -0
  201. package/server/dist/features/search/url-normalization.js +10 -0
  202. package/server/dist/features/tag/services/organization.js +3 -0
  203. package/server/dist/features/view/services/workspace.js +1 -1
  204. package/server/dist/main.js +2 -0
  205. package/server/dist/modules/blocknote.js +4 -5
  206. package/server/dist/paths.js +7 -2
  207. package/server/dist/routes/api.js +37 -0
  208. package/server/dist/routes/mcp.js +0 -5
  209. package/server/dist/schema/index.js +3 -0
  210. package/server/client/dist/assets/Calendar-BP6HTuSn.js +0 -25
  211. package/server/client/dist/assets/Graph-Xha3fwhp.js +0 -46
  212. package/server/client/dist/assets/Image-BLEjLUqd.js +0 -1
  213. package/server/client/dist/assets/Note-DjrCYtat.js +0 -24
  214. package/server/client/dist/assets/Reminders-B4l3KdlK.js +0 -1
  215. package/server/client/dist/assets/Search-BN5sf7bE.js +0 -1
  216. package/server/client/dist/assets/SurfaceCard-BZm73nyS.js +0 -1
  217. package/server/client/dist/assets/Tag-oSnmViVp.js +0 -1
  218. package/server/client/dist/assets/TagNotes-BDTCcJcL.js +0 -1
  219. package/server/client/dist/assets/ViewNotes-CiZtGJNE.js +0 -1
  220. package/server/client/dist/assets/ViewSectionDialog-Ctl_694Y.js +0 -102
  221. package/server/client/dist/assets/Views-D-zlatYD.js +0 -1
  222. package/server/client/dist/assets/app-DmqIOMWF.css +0 -1
  223. package/server/client/dist/assets/app-cTRcKMGc.js +0 -26
  224. package/server/client/dist/assets/image.api-CVuuvTBk.js +0 -17
  225. package/server/client/dist/assets/index-DKJChPr4.js +0 -1
  226. package/server/client/dist/assets/manage-image-BZjaxp-f.js +0 -1
  227. package/server/client/dist/assets/manage-image-detail-DPv0FQ2m.js +0 -1
  228. package/server/client/dist/assets/mcp-admin-adapter-xAuyZc_M.js +0 -1
  229. package/server/client/dist/assets/properties-D447wsWk.js +0 -1
  230. package/server/client/dist/assets/time-B3pt8vt4.js +0 -9
  231. package/server/client/dist/assets/trash-8sH7EZgc.js +0 -1
  232. package/server/client/dist/assets/url-BSnWpmJx.js +0 -1
@@ -1,4 +1,4 @@
1
- import{r as l,R as lr,b as C,j as p,w as zd,a as ur,d as ci,g as yn,e as Gd,u as Kd,o as Zd,s as Qd,k as Yd,p as Xd,n as Jd,i as ef,h as tf,l as nf,q as rf}from"./floating-ui.react-dom-wWLZ1CdM.js";import{H as of}from"./url-BSnWpmJx.js";function co(e){return e[e.length-1]}function sf(e){return typeof e=="function"}function Us(e,t){return sf(e)?e(t):e}const af=Object.prototype.hasOwnProperty,Hs=Object.prototype.propertyIsEnumerable;function li(e,t,n=0){if(e===t)return e;if(n>500)return t;const r=t,o=Ws(e)&&Ws(r);if(!o&&!(Qn(e)&&Qn(r)))return r;const s=o?e:Vs(e);if(!s)return r;const i=o?r:Vs(r);if(!i)return r;const a=s.length,c=i.length,d=o?new Array(c):{};let f=0;for(let u=0;u<c;u++){const h=o?u:i[u],m=e[h],b=r[h];if(m===b){d[h]=m,(o?u<a:af.call(e,h))&&f++;continue}if(m===null||b===null||typeof m!="object"||typeof b!="object"){d[h]=b;continue}const g=li(m,b,n+1);d[h]=g,g===m&&f++}return a===c&&f===a?e:d}function Vs(e){const t=Object.getOwnPropertyNames(e);for(const o of t)if(!Hs.call(e,o))return!1;const n=Object.getOwnPropertySymbols(e);if(n.length===0)return t;const r=t;for(const o of n){if(!Hs.call(e,o))return!1;r.push(o)}return r}function Qn(e){if(!qs(e))return!1;const t=e.constructor;if(typeof t>"u")return!0;const n=t.prototype;return!(!qs(n)||!n.hasOwnProperty("isPrototypeOf"))}function qs(e){return Object.prototype.toString.call(e)==="[object Object]"}function Ws(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Vn(e,t,n){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return!1;for(let r=0,o=e.length;r<o;r++)if(!Vn(e[r],t[r],n))return!1;return!0}if(Qn(e)&&Qn(t)){const r=n?.ignoreUndefined??!0;if(n?.partial){for(const i in t)if((!r||t[i]!==void 0)&&!Vn(e[i],t[i],n))return!1;return!0}let o=0;if(!r)o=Object.keys(e).length;else for(const i in e)e[i]!==void 0&&o++;let s=0;for(const i in t)if((!r||t[i]!==void 0)&&(s++,s>o||!Vn(e[i],t[i],n)))return!1;return o===s}return!1}function A1(e){let t,n;const r=new Promise((o,s)=>{t=o,n=s});return r.status="pending",r.resolve=o=>{r.status="resolved",r.value=o,t(o),e?.(o)},r.reject=o=>{r.status="rejected",n(o)},r}function O1(e){return typeof e?.message!="string"?!1:e.message.startsWith("Failed to fetch dynamically imported module")||e.message.startsWith("error loading dynamically imported module")||e.message.startsWith("Importing a module script failed")}function N1(e){return!!(e&&typeof e=="object"&&typeof e.then=="function")}function cf(e){return e.replace(/[\x00-\x1f\x7f]/g,"")}function zs(e){let t;try{t=decodeURI(e)}catch{t=e.replaceAll(/%[0-9A-F]{2}/gi,n=>{try{return decodeURI(n)}catch{return n}})}return cf(t)}const _1=["http:","https:","mailto:","tel:"];function Gs(e,t){if(!e)return!1;try{const n=new URL(e);return!t.has(n.protocol)}catch{return!1}}function I1(e){if(!e)return{path:e,handledProtocolRelativeURL:!1};if(!/[%\\\x00-\x1f\x7f]/.test(e)&&!e.startsWith("//"))return{path:e,handledProtocolRelativeURL:!1};const t=/%25|%5C/gi;let n=0,r="",o;for(;(o=t.exec(e))!==null;)r+=zs(e.slice(n,o.index))+o[0],n=t.lastIndex;r=r+zs(n?e.slice(n):e);let s=!1;return r.startsWith("//")&&(s=!0,r="/"+r.replace(/^\/+/,"")),{path:r,handledProtocolRelativeURL:s}}function M1(e){return/\s|[^\u0000-\u007F]/.test(e)?e.replace(/\s|[^\u0000-\u007F]/gu,encodeURIComponent):e}var lf="Invariant failed";function Bo(e,t){if(!e)throw new Error(lf)}function lo(e){const t=new Map;let n,r;const o=s=>{s.next&&(s.prev?(s.prev.next=s.next,s.next.prev=s.prev,s.next=void 0,r&&(r.next=s,s.prev=r)):(s.next.prev=void 0,n=s.next,s.next=void 0,r&&(s.prev=r,r.next=s)),r=s)};return{get(s){const i=t.get(s);if(i)return o(i),i.value},set(s,i){if(t.size>=e&&n){const c=n;t.delete(c.key),c.next&&(n=c.next,c.next.prev=void 0),c===r&&(r=void 0)}const a=t.get(s);if(a)a.value=i,o(a);else{const c={key:s,value:i,prev:r};r&&(r.next=c),r=c,n||(n=c),t.set(s,c)}},clear(){t.clear(),n=void 0,r=void 0}}}const Wt=0,xt=1,wt=2,un=3,ht=4,ui=5;function uf(e){const t=e.indexOf("{");if(t===-1)return null;const n=e.indexOf("}",t);return n===-1||t+1>=e.length?null:[t,n]}function Uo(e,t,n=new Uint16Array(6)){const r=e.indexOf("/",t),o=r===-1?e.length:r,s=e.substring(t,o);if(!s||!s.includes("$"))return n[0]=Wt,n[1]=t,n[2]=t,n[3]=o,n[4]=o,n[5]=o,n;if(s==="$"){const a=e.length;return n[0]=wt,n[1]=t,n[2]=t,n[3]=a,n[4]=a,n[5]=a,n}if(s.charCodeAt(0)===36)return n[0]=xt,n[1]=t,n[2]=t+1,n[3]=o,n[4]=o,n[5]=o,n;const i=uf(s);if(i){const[a,c]=i,d=s.charCodeAt(a+1);if(d===45){if(a+2<s.length&&s.charCodeAt(a+2)===36){const f=a+3,u=c;if(f<u)return n[0]=un,n[1]=t+a,n[2]=t+f,n[3]=t+u,n[4]=t+c+1,n[5]=o,n}}else if(d===36){const f=a+1,u=a+2;return u===c?(n[0]=wt,n[1]=t+a,n[2]=t+f,n[3]=t+u,n[4]=t+c+1,n[5]=e.length,n):(n[0]=xt,n[1]=t+a,n[2]=t+u,n[3]=t+c,n[4]=t+c+1,n[5]=o,n)}}return n[0]=Wt,n[1]=t,n[2]=t,n[3]=o,n[4]=o,n[5]=o,n}function dr(e,t,n,r,o,s,i){i?.(n);let a=r;{const c=n.fullPath??n.from,d=c.length,f=n.options?.caseSensitive??e,u=!!(n.options?.params?.parse&&n.options?.skipRouteOnParseError?.params);for(;a<d;){const m=Uo(c,a,t);let b;const g=a,y=m[5];switch(a=y+1,s++,m[0]){case Wt:{const x=c.substring(m[2],m[3]);if(f){const E=o.static?.get(x);if(E)b=E;else{o.static??=new Map;const S=mt(n.fullPath??n.from);S.parent=o,S.depth=s,b=S,o.static.set(x,S)}}else{const E=x.toLowerCase(),S=o.staticInsensitive?.get(E);if(S)b=S;else{o.staticInsensitive??=new Map;const T=mt(n.fullPath??n.from);T.parent=o,T.depth=s,b=T,o.staticInsensitive.set(E,T)}}break}case xt:{const x=c.substring(g,m[1]),E=c.substring(m[4],y),S=f&&!!(x||E),T=x?S?x:x.toLowerCase():void 0,P=E?S?E:E.toLowerCase():void 0,R=!u&&o.dynamic?.find(A=>!A.skipOnParamError&&A.caseSensitive===S&&A.prefix===T&&A.suffix===P);if(R)b=R;else{const A=Dr(xt,n.fullPath??n.from,S,T,P);b=A,A.depth=s,A.parent=o,o.dynamic??=[],o.dynamic.push(A)}break}case un:{const x=c.substring(g,m[1]),E=c.substring(m[4],y),S=f&&!!(x||E),T=x?S?x:x.toLowerCase():void 0,P=E?S?E:E.toLowerCase():void 0,R=!u&&o.optional?.find(A=>!A.skipOnParamError&&A.caseSensitive===S&&A.prefix===T&&A.suffix===P);if(R)b=R;else{const A=Dr(un,n.fullPath??n.from,S,T,P);b=A,A.parent=o,A.depth=s,o.optional??=[],o.optional.push(A)}break}case wt:{const x=c.substring(g,m[1]),E=c.substring(m[4],y),S=f&&!!(x||E),T=x?S?x:x.toLowerCase():void 0,P=E?S?E:E.toLowerCase():void 0,R=Dr(wt,n.fullPath??n.from,S,T,P);b=R,R.parent=o,R.depth=s,o.wildcard??=[],o.wildcard.push(R)}}o=b}if(u&&n.children&&!n.isRoot&&n.id&&n.id.charCodeAt(n.id.lastIndexOf("/")+1)===95){const m=mt(n.fullPath??n.from);m.kind=ui,m.parent=o,s++,m.depth=s,o.pathless??=[],o.pathless.push(m),o=m}const h=(n.path||!n.children)&&!n.isRoot;if(h&&c.endsWith("/")){const m=mt(n.fullPath??n.from);m.kind=ht,m.parent=o,s++,m.depth=s,o.index=m,o=m}o.parse=n.options?.params?.parse??null,o.skipOnParamError=u,o.parsingPriority=n.options?.skipRouteOnParseError?.priority??0,h&&!o.route&&(o.route=n,o.fullPath=n.fullPath??n.from)}if(n.children)for(const c of n.children)dr(e,t,c,a,o,s,i)}function Mr(e,t){if(e.skipOnParamError&&!t.skipOnParamError)return-1;if(!e.skipOnParamError&&t.skipOnParamError)return 1;if(e.skipOnParamError&&t.skipOnParamError&&(e.parsingPriority||t.parsingPriority))return t.parsingPriority-e.parsingPriority;if(e.prefix&&t.prefix&&e.prefix!==t.prefix){if(e.prefix.startsWith(t.prefix))return-1;if(t.prefix.startsWith(e.prefix))return 1}if(e.suffix&&t.suffix&&e.suffix!==t.suffix){if(e.suffix.endsWith(t.suffix))return-1;if(t.suffix.endsWith(e.suffix))return 1}return e.prefix&&!t.prefix?-1:!e.prefix&&t.prefix?1:e.suffix&&!t.suffix?-1:!e.suffix&&t.suffix?1:e.caseSensitive&&!t.caseSensitive?-1:!e.caseSensitive&&t.caseSensitive?1:0}function at(e){if(e.pathless)for(const t of e.pathless)at(t);if(e.static)for(const t of e.static.values())at(t);if(e.staticInsensitive)for(const t of e.staticInsensitive.values())at(t);if(e.dynamic?.length){e.dynamic.sort(Mr);for(const t of e.dynamic)at(t)}if(e.optional?.length){e.optional.sort(Mr);for(const t of e.optional)at(t)}if(e.wildcard?.length){e.wildcard.sort(Mr);for(const t of e.wildcard)at(t)}}function mt(e){return{kind:Wt,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:e,parent:null,parse:null,skipOnParamError:!1,parsingPriority:0}}function Dr(e,t,n,r,o){return{kind:e,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:t,parent:null,parse:null,skipOnParamError:!1,parsingPriority:0,caseSensitive:n,prefix:r,suffix:o}}function D1(e,t){const n=mt("/"),r=new Uint16Array(6);for(const o of e)dr(!1,r,o,1,n,0);at(n),t.masksTree=n,t.flatCache=lo(1e3)}function j1(e,t){e||="/";const n=t.flatCache.get(e);if(n)return n;const r=Ho(e,t.masksTree);return t.flatCache.set(e,r),r}function L1(e,t,n,r,o){e||="/",r||="/";const s=t?`case\0${e}`:e;let i=o.singleCache.get(s);if(!i){i=mt("/");const a=new Uint16Array(6);dr(t,a,{from:e},1,i,0),o.singleCache.set(s,i)}return Ho(r,i,n)}function k1(e,t,n=!1){const r=n?e:`nofuzz\0${e}`,o=t.matchCache.get(r);if(o!==void 0)return o;e||="/";let s;try{s=Ho(e,t.segmentTree,n)}catch(i){if(i instanceof URIError)s=null;else throw i}return s&&(s.branch=ff(s.route)),t.matchCache.set(r,s),s}function df(e){return e==="/"?e:e.replace(/\/{1,}$/,"")}function F1(e,t=!1,n){const r=mt(e.fullPath),o=new Uint16Array(6),s={},i={};let a=0;return dr(t,o,e,1,r,0,d=>{if(n?.(d,a),Bo(!(d.id in s),`Duplicate routes found with id: ${String(d.id)}`),s[d.id]=d,a!==0&&d.path){const f=df(d.fullPath);(!i[f]||d.fullPath.endsWith("/"))&&(i[f]=d)}a++}),at(r),{processedTree:{segmentTree:r,singleCache:lo(1e3),matchCache:lo(1e3),flatCache:null,masksTree:null},routesById:s,routesByPath:i}}function Ho(e,t,n=!1){const r=e.split("/"),o=hf(e,r,t,n);if(!o)return null;const[s]=di(e,r,o);return{route:o.node.route,rawParams:s,parsedParams:o.parsedParams}}function di(e,t,n){const r=pf(n.node);let o=null;const s={};let i=n.extract?.part??0,a=n.extract?.node??0,c=n.extract?.path??0,d=n.extract?.segment??0;for(;a<r.length;i++,a++,c++,d++){const f=r[a];if(f.kind===ht)break;if(f.kind===ui){d--,i--,c--;continue}const u=t[i],h=c;if(u&&(c+=u.length),f.kind===xt){o??=n.node.fullPath.split("/");const m=o[d],b=f.prefix?.length??0;if(m.charCodeAt(b)===123){const y=f.suffix?.length??0,v=m.substring(b+2,m.length-y-1),x=u.substring(b,u.length-y);s[v]=decodeURIComponent(x)}else{const y=m.substring(1);s[y]=decodeURIComponent(u)}}else if(f.kind===un){if(n.skipped&1<<a){i--,c=h-1;continue}o??=n.node.fullPath.split("/");const m=o[d],b=f.prefix?.length??0,g=f.suffix?.length??0,y=m.substring(b+3,m.length-g-1),v=f.suffix||f.prefix?u.substring(b,u.length-g):u;v&&(s[y]=decodeURIComponent(v))}else if(f.kind===wt){const m=f,b=e.substring(h+(m.prefix?.length??0),e.length-(m.suffix?.length??0)),g=decodeURIComponent(b);s["*"]=g,s._splat=g;break}}return n.rawParams&&Object.assign(s,n.rawParams),[s,{part:i,node:a,path:c,segment:d}]}function ff(e){const t=[e];for(;e.parentRoute;)e=e.parentRoute,t.push(e);return t.reverse(),t}function pf(e){const t=Array(e.depth+1);do t[e.depth]=e,e=e.parent;while(e);return t}function hf(e,t,n,r){if(e==="/"&&n.index)return{node:n.index,skipped:0};const o=!co(t),s=o&&e!=="/",i=t.length-(o?1:0),a=[{node:n,index:1,skipped:0,depth:1,statics:1,dynamics:0,optionals:0}];let c=null,d=null,f=null;for(;a.length;){const u=a.pop(),{node:h,index:m,skipped:b,depth:g,statics:y,dynamics:v,optionals:x}=u;let{extract:E,rawParams:S,parsedParams:T}=u;if(h.skipOnParamError){if(!jr(e,t,u))continue;S=u.rawParams,E=u.extract,T=u.parsedParams}r&&h.route&&h.kind!==ht&&nn(d,u)&&(d=u);const P=m===i;if(P&&(h.route&&!s&&nn(f,u)&&(f=u),!h.optional&&!h.wildcard&&!h.index&&!h.pathless))continue;const R=P?void 0:t[m];let A;if(P&&h.index){const _={node:h.index,index:m,skipped:b,depth:g+1,statics:y,dynamics:v,optionals:x,extract:E,rawParams:S,parsedParams:T};let D=!0;if(h.index.skipOnParamError&&(jr(e,t,_)||(D=!1)),D){if(y===i&&!v&&!x&&!b)return _;nn(f,_)&&(f=_)}}if(h.wildcard&&nn(c,u))for(const _ of h.wildcard){const{prefix:D,suffix:k}=_;if(D&&(P||!(_.caseSensitive?R:A??=R.toLowerCase()).startsWith(D)))continue;if(k){if(P)continue;const H=t.slice(m).join("/").slice(-k.length);if((_.caseSensitive?H:H.toLowerCase())!==k)continue}const U={node:_,index:i,skipped:b,depth:g,statics:y,dynamics:v,optionals:x,extract:E,rawParams:S,parsedParams:T};if(!(_.skipOnParamError&&!jr(e,t,U))){c=U;break}}if(h.optional){const _=b|1<<g,D=g+1;for(let k=h.optional.length-1;k>=0;k--){const U=h.optional[k];a.push({node:U,index:m,skipped:_,depth:D,statics:y,dynamics:v,optionals:x,extract:E,rawParams:S,parsedParams:T})}if(!P)for(let k=h.optional.length-1;k>=0;k--){const U=h.optional[k],{prefix:H,suffix:Q}=U;if(H||Q){const ne=U.caseSensitive?R:A??=R.toLowerCase();if(H&&!ne.startsWith(H)||Q&&!ne.endsWith(Q))continue}a.push({node:U,index:m+1,skipped:b,depth:D,statics:y,dynamics:v,optionals:x+1,extract:E,rawParams:S,parsedParams:T})}}if(!P&&h.dynamic&&R)for(let _=h.dynamic.length-1;_>=0;_--){const D=h.dynamic[_],{prefix:k,suffix:U}=D;if(k||U){const H=D.caseSensitive?R:A??=R.toLowerCase();if(k&&!H.startsWith(k)||U&&!H.endsWith(U))continue}a.push({node:D,index:m+1,skipped:b,depth:g+1,statics:y,dynamics:v+1,optionals:x,extract:E,rawParams:S,parsedParams:T})}if(!P&&h.staticInsensitive){const _=h.staticInsensitive.get(A??=R.toLowerCase());_&&a.push({node:_,index:m+1,skipped:b,depth:g+1,statics:y+1,dynamics:v,optionals:x,extract:E,rawParams:S,parsedParams:T})}if(!P&&h.static){const _=h.static.get(R);_&&a.push({node:_,index:m+1,skipped:b,depth:g+1,statics:y+1,dynamics:v,optionals:x,extract:E,rawParams:S,parsedParams:T})}if(h.pathless){const _=g+1;for(let D=h.pathless.length-1;D>=0;D--){const k=h.pathless[D];a.push({node:k,index:m,skipped:b,depth:_,statics:y,dynamics:v,optionals:x,extract:E,rawParams:S,parsedParams:T})}}}if(f&&c)return nn(c,f)?f:c;if(f)return f;if(c)return c;if(r&&d){let u=d.index;for(let m=0;m<d.index;m++)u+=t[m].length;const h=u===e.length?"/":e.slice(u);return d.rawParams??={},d.rawParams["**"]=decodeURIComponent(h),d}return null}function jr(e,t,n){try{const[r,o]=di(e,t,n);n.rawParams=r,n.extract=o;const s=n.node.parse(r);return n.parsedParams=Object.assign({},n.parsedParams,s),!0}catch{return null}}function nn(e,t){return e?t.statics>e.statics||t.statics===e.statics&&(t.dynamics>e.dynamics||t.dynamics===e.dynamics&&(t.optionals>e.optionals||t.optionals===e.optionals&&((t.node.kind===ht)>(e.node.kind===ht)||t.node.kind===ht==(e.node.kind===ht)&&t.depth>e.depth))):!0}function Lr(e){return fi(e.filter(t=>t!==void 0).join("/"))}function fi(e){return e.replace(/\/{2,}/g,"/")}function pi(e){return e==="/"?e:e.replace(/^\/{1,}/,"")}function hi(e){const t=e.length;return t>1&&e[t-1]==="/"?e.replace(/\/{1,}$/,""):e}function $1(e){return hi(pi(e))}function Yn(e,t){return e?.endsWith("/")&&e!=="/"&&e!==`${t}/`?e.slice(0,-1):e}function mf(e,t,n){return Yn(e,n)===Yn(t,n)}function B1({base:e,to:t,trailingSlash:n="never",cache:r}){const o=t.startsWith("/"),s=!o&&t===".";let i;if(r){i=o?t:s?e:e+"\0"+t;const u=r.get(i);if(u)return u}let a;if(s)a=e.split("/");else if(o)a=t.split("/");else{for(a=e.split("/");a.length>1&&co(a)==="";)a.pop();const u=t.split("/");for(let h=0,m=u.length;h<m;h++){const b=u[h];b===""?h?h===m-1&&a.push(b):a=[b]:b===".."?a.pop():b==="."||a.push(b)}}a.length>1&&(co(a)===""?n==="never"&&a.pop():n==="always"&&a.push(""));let c,d="";for(let u=0;u<a.length;u++){u>0&&(d+="/");const h=a[u];if(!h)continue;c=Uo(h,0,c);const m=c[0];if(m===Wt){d+=h;continue}const b=c[5],g=h.substring(0,c[1]),y=h.substring(c[4],b),v=h.substring(c[2],c[3]);m===xt?d+=g||y?`${g}{$${v}}${y}`:`$${v}`:m===wt?d+=g||y?`${g}{$}${y}`:"$":d+=`${g}{-$${v}}${y}`}d=fi(d);const f=d||"/";return i&&r&&r.set(i,f),f}function U1(e){const t=new Map(e.map(o=>[encodeURIComponent(o),o])),n=Array.from(t.keys()).map(o=>o.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")).join("|"),r=new RegExp(n,"g");return o=>o.replace(r,s=>t.get(s)??s)}function kr(e,t,n){const r=t[e];return typeof r!="string"?r:e==="_splat"?/^[a-zA-Z0-9\-._~!/]*$/.test(r)?r:r.split("/").map(o=>Ks(o,n)).join("/"):Ks(r,n)}function H1({path:e,params:t,decoder:n,...r}){let o=!1;const s={};if(!e||e==="/")return{interpolatedPath:"/",usedParams:s,isMissingParams:o};if(!e.includes("$"))return{interpolatedPath:e,usedParams:s,isMissingParams:o};const i=e.length;let a=0,c,d="";for(;a<i;){const u=a;c=Uo(e,u,c);const h=c[5];if(a=h+1,u===h)continue;const m=c[0];if(m===Wt){d+="/"+e.substring(u,h);continue}if(m===wt){const b=t._splat;s._splat=b,s["*"]=b;const g=e.substring(u,c[1]),y=e.substring(c[4],h);if(!b){o=!0,(g||y)&&(d+="/"+g+y);continue}const v=kr("_splat",t,n);d+="/"+g+v+y;continue}if(m===xt){const b=e.substring(c[2],c[3]);!o&&!(b in t)&&(o=!0),s[b]=t[b];const g=e.substring(u,c[1]),y=e.substring(c[4],h),v=kr(b,t,n)??"undefined";d+="/"+g+v+y;continue}if(m===un){const b=e.substring(c[2],c[3]),g=t[b];if(g==null)continue;s[b]=g;const y=e.substring(u,c[1]),v=e.substring(c[4],h),x=kr(b,t,n)??"";d+="/"+y+x+v;continue}}return e.endsWith("/")&&(d+="/"),{usedParams:s,interpolatedPath:d||"/",isMissingParams:o}}function Ks(e,t){const n=encodeURIComponent(e);return t?.(n)??n}function mi(e={}){if(e.isNotFound=!0,e.throw)throw e;return e}function V1(e){return!!e?.isNotFound}const pt="__root__";function gi(e){if(e.statusCode=e.statusCode||e.code||307,!e._builtLocation&&!e.reloadDocument&&typeof e.href=="string")try{new URL(e.href),e.reloadDocument=!0}catch{}const t=new Headers(e.headers);e.href&&t.get("Location")===null&&t.set("Location",e.href);const n=new Response(null,{status:e.statusCode,headers:t});if(n.options=e,e.throw)throw n;return n}function q1(e){return e instanceof Response&&!!e.options}const gf="Error preloading route! ☝️";class vi{constructor(t){if(this.init=n=>{this.originalIndex=n.originalIndex;const r=this.options,o=!r?.path&&!r?.id;this.parentRoute=this.options.getParentRoute?.(),o?this._path=pt:this.parentRoute||Bo(!1);let s=o?pt:r?.path;s&&s!=="/"&&(s=pi(s));const i=r?.id||s;let a=o?pt:Lr([this.parentRoute.id===pt?"":this.parentRoute.id,i]);s===pt&&(s="/"),a!==pt&&(a=Lr(["/",a]));const c=a===pt?"/":Lr([this.parentRoute.fullPath,s]);this._path=s,this._id=a,this._fullPath=c,this._to=hi(c)},this.addChildren=n=>this._addFileChildren(n),this._addFileChildren=n=>(Array.isArray(n)&&(this.children=n),typeof n=="object"&&n!==null&&(this.children=Object.values(n)),this),this._addFileTypes=()=>this,this.updateLoader=n=>(Object.assign(this.options,n),this),this.update=n=>(Object.assign(this.options,n),this),this.lazy=n=>(this.lazyFn=n,this),this.redirect=n=>gi({from:this.fullPath,...n}),this.options=t||{},this.isRoot=!t?.getParentRoute,t?.id&&t?.path)throw new Error("Route cannot have both an 'id' and a 'path' option.")}get to(){return this._to}get id(){return this._id}get path(){return this._path}get fullPath(){return this._fullPath}}class vf{constructor({id:t}){this.notFound=n=>mi({routeId:this.id,...n}),this.redirect=n=>gi({from:this.id,...n}),this.id=t}}class yf extends vi{constructor(t){super(t)}}const bf="use",W1=lr[bf],z1=typeof window<"u"?l.useLayoutEffect:l.useEffect;function G1(e){const t=l.useRef({value:e,prev:null}),n=t.current.value;return e!==n&&(t.current={value:e,prev:n}),t.current.prev}function xf(e,t,n={},r={}){l.useEffect(()=>{if(!e.current||r.disabled||typeof IntersectionObserver!="function")return;const o=new IntersectionObserver(([s])=>{t(s)},n);return o.observe(e.current),()=>{o.disconnect()}},[t,n,r.disabled,e])}function wf(e){const t=l.useRef(null);return l.useImperativeHandle(e,()=>t.current,[]),t}function K1({children:e,fallback:t=null}){return yi()?p.jsx(C.Fragment,{children:e}):p.jsx(C.Fragment,{children:t})}function yi(){return C.useSyncExternalStore(Ef,()=>!0,()=>!1)}function Ef(){return()=>{}}function Sf(e,t){return e===t}function Cf(e,t,n=Sf){const r=l.useCallback(i=>{if(!e)return()=>{};const{unsubscribe:a}=e.subscribe(i);return a},[e]),o=l.useCallback(()=>e?.get(),[e]);return zd.useSyncExternalStoreWithSelector(r,o,o,t,n)}const Tf=l.createContext(null);function zt(e){const t=l.useContext(Tf);return e?.warn,t}function uo(e){const t=zt({warn:e?.router===void 0}),n=e?.router||t,r=l.useRef(void 0);return Cf(n.__store,o=>{if(e?.select){if(e.structuralSharing??n.options.defaultStructuralSharing){const s=li(r.current,e.select(o));return r.current=s,s}return e.select(o)}return o})}const Rf=l.createContext(void 0),Pf=l.createContext(void 0);function Qe(e){const t=l.useContext(e.from?Pf:Rf);return uo({select:r=>{const o=r.matches.find(s=>e.from?e.from===s.routeId:s.id===t);if(Bo(!((e.shouldThrow??!0)&&!o),`Could not find ${e.from?`an active match from "${e.from}"`:"a nearest match!"}`),o!==void 0)return e.select?e.select(o):o},structuralSharing:e.structuralSharing})}function Vo(e){return Qe({from:e.from,strict:e.strict,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.loaderData):t.loaderData})}function qo(e){const{select:t,...n}=e;return Qe({...n,select:r=>t?t(r.loaderDeps):r.loaderDeps})}function Wo(e){return Qe({from:e.from,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,strict:e.strict,select:t=>{const n=e.strict===!1?t.params:t._strictParams;return e.select?e.select(n):n}})}function zo(e){return Qe({from:e.from,strict:e.strict,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.search):t.search})}function fr(e){const t=zt();return l.useCallback(n=>t.navigate({...n,from:n.from??e?.from}),[e?.from,t])}function Af(e,t){const n=zt(),r=wf(t),{activeProps:o,inactiveProps:s,activeOptions:i,to:a,preload:c,preloadDelay:d,hashScrollIntoView:f,replace:u,startTransition:h,resetScroll:m,viewTransition:b,children:g,target:y,disabled:v,style:x,className:E,onClick:S,onBlur:T,onFocus:P,onMouseEnter:R,onMouseLeave:A,onTouchStart:_,ignoreBlocker:D,params:k,search:U,hash:H,state:Q,mask:ne,reloadDocument:L,unsafeRelative:Z,from:te,_fromLocation:I,...J}=e,W=yi(),ae=uo({select:se=>{const ge=se.matches[se.matches.length-1];return{search:ge?.search,hash:se.location.hash,path:ge?.pathname}},structuralSharing:!0}),$=e.from,q=l.useMemo(()=>({...e,from:$}),[n,ae,$,e._fromLocation,e.hash,e.to,e.search,e.params,e.state,e.mask,e.unsafeRelative]),V=l.useMemo(()=>n.buildLocation({...q}),[n,q]),F=V.maskedLocation?V.maskedLocation.publicHref:V.publicHref,O=V.maskedLocation?V.maskedLocation.external:V.external,j=l.useMemo(()=>Df(F,O,n.history,v),[v,O,F,n.history]),oe=l.useMemo(()=>{if(j?.external)return Gs(j.href,n.protocolAllowlist)?void 0:j.href;if(!jf(a)&&!(typeof a!="string"||a.indexOf(":")===-1))try{return new URL(a),Gs(a,n.protocolAllowlist)?void 0:a}catch{}},[a,j,n.protocolAllowlist]),ee=uo({select:se=>{if(oe)return!1;if(i?.exact){if(!mf(se.location.pathname,V.pathname,n.basepath))return!1}else{const ge=Yn(se.location.pathname,n.basepath),Ne=Yn(V.pathname,n.basepath);if(!(ge.startsWith(Ne)&&(ge.length===Ne.length||ge[Ne.length]==="/")))return!1}return(i?.includeSearch??!0)&&!Vn(se.location.search,V.search,{partial:!i?.exact,ignoreUndefined:!i?.explicitUndefined})?!1:i?.includeHash?W&&se.location.hash===V.hash:!0}}),X=ee?Us(o,{})??Of:Fr,G=ee?Fr:Us(s,{})??Fr,me=[E,X.className,G.className].filter(Boolean).join(" "),ve=(x||X.style||G.style)&&{...x,...X.style,...G.style},[xe,B]=l.useState(!1),ie=l.useRef(!1),ye=e.reloadDocument||oe?!1:c??n.options.defaultPreload,pe=d??n.options.defaultPreloadDelay??0,Le=l.useCallback(()=>{n.preloadRoute({...q,_builtLocation:V}).catch(se=>{console.warn(se),console.warn(gf)})},[n,q,V]),tn=l.useCallback(se=>{se?.isIntersecting&&Le()},[Le]);xf(r,tn,Mf,{disabled:!!v||ye!=="viewport"}),l.useEffect(()=>{ie.current||!v&&ye==="render"&&(Le(),ie.current=!0)},[v,Le,ye]);const he=se=>{const ge=se.currentTarget.getAttribute("target"),Ne=y!==void 0?y:ge;if(!v&&!Lf(se)&&!se.defaultPrevented&&(!Ne||Ne==="_self")&&se.button===0){se.preventDefault(),ur.flushSync(()=>{B(!0)});const _t=n.subscribe("onResolved",()=>{_t(),B(!1)});n.navigate({...q,replace:u,resetScroll:m,hashScrollIntoView:f,startTransition:h,viewTransition:b,ignoreBlocker:D})}};if(oe)return{...J,ref:r,href:oe,...g&&{children:g},...y&&{target:y},...v&&{disabled:v},...x&&{style:x},...E&&{className:E},...S&&{onClick:S},...T&&{onBlur:T},...P&&{onFocus:P},...R&&{onMouseEnter:R},...A&&{onMouseLeave:A},..._&&{onTouchStart:_}};const et=se=>{if(v||ye!=="intent")return;if(!pe){Le();return}const ge=se.currentTarget;if(rn.has(ge))return;const Ne=setTimeout(()=>{rn.delete(ge),Le()},pe);rn.set(ge,Ne)},_r=se=>{v||ye!=="intent"||Le()},In=se=>{if(v||!ye||!pe)return;const ge=se.currentTarget,Ne=rn.get(ge);Ne&&(clearTimeout(Ne),rn.delete(ge))};return{...J,...X,...G,href:j?.href,ref:r,onClick:Dt([S,he]),onBlur:Dt([T,In]),onFocus:Dt([P,et]),onMouseEnter:Dt([R,et]),onMouseLeave:Dt([A,In]),onTouchStart:Dt([_,_r]),disabled:!!v,target:y,...ve&&{style:ve},...me&&{className:me},...v&&Nf,...ee&&_f,...W&&xe&&If}}const Fr={},Of={className:"active"},Nf={role:"link","aria-disabled":!0},_f={"data-status":"active","aria-current":"page"},If={"data-transitioning":"transitioning"},rn=new WeakMap,Mf={rootMargin:"100px"},Dt=e=>t=>{for(const n of e)if(n){if(t.defaultPrevented)return;n(t)}};function Df(e,t,n,r){if(!r)return t?{href:e,external:!0}:{href:n.createHref(e)||"/",external:!1}}function jf(e){if(typeof e!="string")return!1;const t=e.charCodeAt(0);return t===47?e.charCodeAt(1)!==47:t===46}const Go=l.forwardRef((e,t)=>{const{_asChild:n,...r}=e,{type:o,...s}=Af(r,t),i=typeof r.children=="function"?r.children({isActive:s["data-status"]==="active"}):r.children;if(!n){const{disabled:a,...c}=s;return l.createElement("a",c,i)}return l.createElement(n,s,i)});function Lf(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function Z1(e){return new kf({id:e})}class kf extends vf{constructor({id:t}){super({id:t}),this.useMatch=n=>Qe({select:n?.select,from:this.id,structuralSharing:n?.structuralSharing}),this.useRouteContext=n=>Qe({from:this.id,select:r=>n?.select?n.select(r.context):r.context}),this.useSearch=n=>zo({select:n?.select,structuralSharing:n?.structuralSharing,from:this.id}),this.useParams=n=>Wo({select:n?.select,structuralSharing:n?.structuralSharing,from:this.id}),this.useLoaderDeps=n=>qo({...n,from:this.id,strict:!1}),this.useLoaderData=n=>Vo({...n,from:this.id,strict:!1}),this.useNavigate=()=>{const n=zt();return fr({from:n.routesById[this.id].fullPath})},this.notFound=n=>mi({routeId:this.id,...n}),this.Link=C.forwardRef((n,r)=>{const s=zt().routesById[this.id].fullPath;return p.jsx(Go,{ref:r,from:s,...n})})}}class Ff extends vi{constructor(t){super(t),this.useMatch=n=>Qe({select:n?.select,from:this.id,structuralSharing:n?.structuralSharing}),this.useRouteContext=n=>Qe({...n,from:this.id,select:r=>n?.select?n.select(r.context):r.context}),this.useSearch=n=>zo({select:n?.select,structuralSharing:n?.structuralSharing,from:this.id}),this.useParams=n=>Wo({select:n?.select,structuralSharing:n?.structuralSharing,from:this.id}),this.useLoaderDeps=n=>qo({...n,from:this.id}),this.useLoaderData=n=>Vo({...n,from:this.id}),this.useNavigate=()=>fr({from:this.fullPath}),this.Link=C.forwardRef((n,r)=>p.jsx(Go,{ref:r,from:this.fullPath,...n})),this.$$typeof=Symbol.for("react.memo")}}function Q1(e){return new Ff(e)}class $f extends yf{constructor(t){super(t),this.useMatch=n=>Qe({select:n?.select,from:this.id,structuralSharing:n?.structuralSharing}),this.useRouteContext=n=>Qe({...n,from:this.id,select:r=>n?.select?n.select(r.context):r.context}),this.useSearch=n=>zo({select:n?.select,structuralSharing:n?.structuralSharing,from:this.id}),this.useParams=n=>Wo({select:n?.select,structuralSharing:n?.structuralSharing,from:this.id}),this.useLoaderDeps=n=>qo({...n,from:this.id}),this.useLoaderData=n=>Vo({...n,from:this.id}),this.useNavigate=()=>fr({from:this.fullPath}),this.Link=C.forwardRef((n,r)=>p.jsx(Go,{ref:r,from:this.fullPath,...n})),this.$$typeof=Symbol.for("react.memo")}}function Y1(e){return new $f(e)}var bn=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(){}},Bf={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},Uf=class{#e=Bf;#t=!1;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)}},gt=new Uf;function Hf(e){setTimeout(e,0)}var Et=typeof window>"u"||"Deno"in globalThis;function Me(){}function Vf(e,t){return typeof e=="function"?e(t):e}function fo(e){return typeof e=="number"&&e>=0&&e!==1/0}function bi(e,t){return Math.max(e+(t||0)-Date.now(),0)}function ct(e,t){return typeof e=="function"?e(t):e}function Fe(e,t){return typeof e=="function"?e(t):e}function Zs(e,t){const{type:n="all",exact:r,fetchStatus:o,predicate:s,queryKey:i,stale:a}=e;if(i){if(r){if(t.queryHash!==Ko(i,t.options))return!1}else if(!fn(t.queryKey,i))return!1}if(n!=="all"){const c=t.isActive();if(n==="active"&&!c||n==="inactive"&&c)return!1}return!(typeof a=="boolean"&&t.isStale()!==a||o&&o!==t.state.fetchStatus||s&&!s(t))}function Qs(e,t){const{exact:n,status:r,predicate:o,mutationKey:s}=e;if(s){if(!t.options.mutationKey)return!1;if(n){if(dn(t.options.mutationKey)!==dn(s))return!1}else if(!fn(t.options.mutationKey,s))return!1}return!(r&&t.state.status!==r||o&&!o(t))}function Ko(e,t){return(t?.queryKeyHashFn||dn)(e)}function dn(e){return JSON.stringify(e,(t,n)=>ho(n)?Object.keys(n).sort().reduce((r,o)=>(r[o]=n[o],r),{}):n)}function fn(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(n=>fn(e[n],t[n])):!1}var qf=Object.prototype.hasOwnProperty;function xi(e,t,n=0){if(e===t)return e;if(n>500)return t;const r=Ys(e)&&Ys(t);if(!r&&!(ho(e)&&ho(t)))return t;const s=(r?e:Object.keys(e)).length,i=r?t:Object.keys(t),a=i.length,c=r?new Array(a):{};let d=0;for(let f=0;f<a;f++){const u=r?f:i[f],h=e[u],m=t[u];if(h===m){c[u]=h,(r?f<s:qf.call(e,u))&&d++;continue}if(h===null||m===null||typeof h!="object"||typeof m!="object"){c[u]=m;continue}const b=xi(h,m,n+1);c[u]=b,b===h&&d++}return s===a&&d===s?e:c}function po(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(e[n]!==t[n])return!1;return!0}function Ys(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function ho(e){if(!Xs(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!Xs(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function Xs(e){return Object.prototype.toString.call(e)==="[object Object]"}function Wf(e){return new Promise(t=>{gt.setTimeout(t,e)})}function mo(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?xi(e,t):t}function zf(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function Gf(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var Zo=Symbol();function wi(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===Zo?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function Ei(e,t){return typeof e=="function"?e(...t):!!e}function Kf(e,t,n){let r=!1,o;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(o??=t(),r||(r=!0,o.aborted?n():o.addEventListener("abort",n,{once:!0})),o)}),e}var Zf=class extends bn{#e;#t;#n;constructor(){super(),this.#n=e=>{if(!Et&&window.addEventListener){const 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(t=>{typeof t=="boolean"?this.setFocused(t):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){const e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return typeof this.#e=="boolean"?this.#e:globalThis.document?.visibilityState!=="hidden"}},Qo=new Zf;function go(){let e,t;const n=new Promise((o,s)=>{e=o,t=s});n.status="pending",n.catch(()=>{});function r(o){Object.assign(n,o),delete n.resolve,delete n.reject}return n.resolve=o=>{r({status:"fulfilled",value:o}),e(o)},n.reject=o=>{r({status:"rejected",reason:o}),t(o)},n}var Qf=Hf;function Yf(){let e=[],t=0,n=a=>{a()},r=a=>{a()},o=Qf;const s=a=>{t?e.push(a):o(()=>{n(a)})},i=()=>{const a=e;e=[],a.length&&o(()=>{r(()=>{a.forEach(c=>{n(c)})})})};return{batch:a=>{let c;t++;try{c=a()}finally{t--,t||i()}return c},batchCalls:a=>(...c)=>{s(()=>{a(...c)})},schedule:s,setNotifyFunction:a=>{n=a},setBatchNotifyFunction:a=>{r=a},setScheduler:a=>{o=a}}}var Ee=Yf(),Xf=class extends bn{#e=!0;#t;#n;constructor(){super(),this.#n=e=>{if(!Et&&window.addEventListener){const 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(n=>{n(e)}))}isOnline(){return this.#e}},Xn=new Xf;function Jf(e){return Math.min(1e3*2**e,3e4)}function Si(e){return(e??"online")==="online"?Xn.isOnline():!0}var vo=class extends Error{constructor(e){super("CancelledError"),this.revert=e?.revert,this.silent=e?.silent}};function Ci(e){let t=!1,n=0,r;const o=go(),s=()=>o.status!=="pending",i=g=>{if(!s()){const y=new vo(g);h(y),e.onCancel?.(y)}},a=()=>{t=!0},c=()=>{t=!1},d=()=>Qo.isFocused()&&(e.networkMode==="always"||Xn.isOnline())&&e.canRun(),f=()=>Si(e.networkMode)&&e.canRun(),u=g=>{s()||(r?.(),o.resolve(g))},h=g=>{s()||(r?.(),o.reject(g))},m=()=>new Promise(g=>{r=y=>{(s()||d())&&g(y)},e.onPause?.()}).then(()=>{r=void 0,s()||e.onContinue?.()}),b=()=>{if(s())return;let g;const y=n===0?e.initialPromise:void 0;try{g=y??e.fn()}catch(v){g=Promise.reject(v)}Promise.resolve(g).then(u).catch(v=>{if(s())return;const x=e.retry??(Et?0:3),E=e.retryDelay??Jf,S=typeof E=="function"?E(n,v):E,T=x===!0||typeof x=="number"&&n<x||typeof x=="function"&&x(n,v);if(t||!T){h(v);return}n++,e.onFail?.(n,v),Wf(S).then(()=>d()?void 0:m()).then(()=>{t?h(v):b()})})};return{promise:o,status:()=>o.status,cancel:i,continue:()=>(r?.(),o),cancelRetry:a,continueRetry:c,canStart:f,start:()=>(f()?b():m().then(b),o)}}var Ti=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),fo(this.gcTime)&&(this.#e=gt.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Et?1/0:300*1e3))}clearGcTimeout(){this.#e&&(gt.clearTimeout(this.#e),this.#e=void 0)}},ep=class extends Ti{#e;#t;#n;#o;#r;#i;#a;constructor(e){super(),this.#a=!1,this.#i=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#o=e.client,this.#n=this.#o.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#e=ea(this.options),this.state=e.state??this.#e,this.scheduleGc()}get meta(){return this.options.meta}get promise(){return this.#r?.promise}setOptions(e){if(this.options={...this.#i,...e},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const t=ea(this.options);t.data!==void 0&&(this.setState(Js(t.data,t.dataUpdatedAt)),this.#e=t)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.#n.remove(this)}setData(e,t){const n=mo(this.state.data,e,this.options);return this.#s({data:n,type:"success",dataUpdatedAt:t?.updatedAt,manual:t?.manual}),n}setState(e,t){this.#s({type:"setState",state:e,setStateOptions:t})}cancel(e){const t=this.#r?.promise;return this.#r?.cancel(e),t?t.then(Me).catch(Me):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.#e)}isActive(){return this.observers.some(e=>Fe(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Zo||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>ct(e.options.staleTime,this)==="static"):!1}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:!bi(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(t=>t.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#r?.continue()}onOnline(){this.observers.find(t=>t.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#r?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#n.notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(t=>t!==e),this.observers.length||(this.#r&&(this.#a?this.#r.cancel({revert:!0}):this.#r.cancelRetry()),this.scheduleGc()),this.#n.notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#s({type:"invalidate"})}async fetch(e,t){if(this.state.fetchStatus!=="idle"&&this.#r?.status()!=="rejected"){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#r)return this.#r.continueRetry(),this.#r.promise}if(e&&this.setOptions(e),!this.options.queryFn){const a=this.observers.find(c=>c.options.queryFn);a&&this.setOptions(a.options)}const n=new AbortController,r=a=>{Object.defineProperty(a,"signal",{enumerable:!0,get:()=>(this.#a=!0,n.signal)})},o=()=>{const a=wi(this.options,t),d=(()=>{const f={client:this.#o,queryKey:this.queryKey,meta:this.meta};return r(f),f})();return this.#a=!1,this.options.persister?this.options.persister(a,d,this):a(d)},i=(()=>{const a={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#o,state:this.state,fetchFn:o};return r(a),a})();this.options.behavior?.onFetch(i,this),this.#t=this.state,(this.state.fetchStatus==="idle"||this.state.fetchMeta!==i.fetchOptions?.meta)&&this.#s({type:"fetch",meta:i.fetchOptions?.meta}),this.#r=Ci({initialPromise:t?.initialPromise,fn:i.fetchFn,onCancel:a=>{a instanceof vo&&a.revert&&this.setState({...this.#t,fetchStatus:"idle"}),n.abort()},onFail:(a,c)=>{this.#s({type:"failed",failureCount:a,error:c})},onPause:()=>{this.#s({type:"pause"})},onContinue:()=>{this.#s({type:"continue"})},retry:i.options.retry,retryDelay:i.options.retryDelay,networkMode:i.options.networkMode,canRun:()=>!0});try{const a=await this.#r.start();if(a===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(a),this.#n.config.onSuccess?.(a,this),this.#n.config.onSettled?.(a,this.state.error,this),a}catch(a){if(a instanceof vo){if(a.silent)return this.#r.promise;if(a.revert){if(this.state.data===void 0)throw a;return this.state.data}}throw this.#s({type:"error",error:a}),this.#n.config.onError?.(a,this),this.#n.config.onSettled?.(this.state.data,a,this),a}finally{this.scheduleGc()}}#s(e){const t=n=>{switch(e.type){case"failed":return{...n,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...n,fetchStatus:"paused"};case"continue":return{...n,fetchStatus:"fetching"};case"fetch":return{...n,...Ri(n.data,this.options),fetchMeta:e.meta??null};case"success":const r={...n,...Js(e.data,e.dataUpdatedAt),dataUpdateCount:n.dataUpdateCount+1,...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return this.#t=e.manual?r:void 0,r;case"error":const o=e.error;return{...n,error:o,errorUpdateCount:n.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:n.fetchFailureCount+1,fetchFailureReason:o,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...n,isInvalidated:!0};case"setState":return{...n,...e.state}}};this.state=t(this.state),Ee.batch(()=>{this.observers.forEach(n=>{n.onQueryUpdate()}),this.#n.notify({query:this,type:"updated",action:e})})}};function Ri(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:Si(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function Js(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function ea(e){const 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 tp=class extends bn{constructor(e,t){super(),this.options=t,this.#e=e,this.#s=null,this.#a=go(),this.bindMethods(),this.setOptions(t)}#e;#t=void 0;#n=void 0;#o=void 0;#r;#i;#a;#s;#m;#f;#p;#l;#u;#c;#h=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),ta(this.#t,this.options)?this.#d():this.updateResult(),this.#b())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return yo(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return yo(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#x(),this.#w(),this.#t.removeObserver(this)}setOptions(e){const 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 Fe(this.options.enabled,this.#t)!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");this.#E(),this.#t.setOptions(this.options),t._defaulted&&!po(this.options,t)&&this.#e.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#t,observer:this});const r=this.hasListeners();r&&na(this.#t,n,this.options,t)&&this.#d(),this.updateResult(),r&&(this.#t!==n||Fe(this.options.enabled,this.#t)!==Fe(t.enabled,this.#t)||ct(this.options.staleTime,this.#t)!==ct(t.staleTime,this.#t))&&this.#g();const o=this.#v();r&&(this.#t!==n||Fe(this.options.enabled,this.#t)!==Fe(t.enabled,this.#t)||o!==this.#c)&&this.#y(o)}getOptimisticResult(e){const t=this.#e.getQueryCache().build(this.#e,e),n=this.createResult(t,e);return rp(this,n)&&(this.#o=n,this.#i=this.options,this.#r=this.#t.state),n}getCurrentResult(){return this.#o}trackResult(e,t){return new Proxy(e,{get:(n,r)=>(this.trackProp(r),t?.(r),r==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&this.#a.status==="pending"&&this.#a.reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(n,r))})}trackProp(e){this.#h.add(e)}getCurrentQuery(){return this.#t}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){const t=this.#e.defaultQueryOptions(e),n=this.#e.getQueryCache().build(this.#e,t);return n.fetch().then(()=>this.createResult(n,t))}fetch(e){return this.#d({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#o))}#d(e){this.#E();let t=this.#t.fetch(this.options,e);return e?.throwOnError||(t=t.catch(Me)),t}#g(){this.#x();const e=ct(this.options.staleTime,this.#t);if(Et||this.#o.isStale||!fo(e))return;const n=bi(this.#o.dataUpdatedAt,e)+1;this.#l=gt.setTimeout(()=>{this.#o.isStale||this.updateResult()},n)}#v(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(this.#t):this.options.refetchInterval)??!1}#y(e){this.#w(),this.#c=e,!(Et||Fe(this.options.enabled,this.#t)===!1||!fo(this.#c)||this.#c===0)&&(this.#u=gt.setInterval(()=>{(this.options.refetchIntervalInBackground||Qo.isFocused())&&this.#d()},this.#c))}#b(){this.#g(),this.#y(this.#v())}#x(){this.#l&&(gt.clearTimeout(this.#l),this.#l=void 0)}#w(){this.#u&&(gt.clearInterval(this.#u),this.#u=void 0)}createResult(e,t){const n=this.#t,r=this.options,o=this.#o,s=this.#r,i=this.#i,c=e!==n?e.state:this.#n,{state:d}=e;let f={...d},u=!1,h;if(t._optimisticResults){const A=this.hasListeners(),_=!A&&ta(e,t),D=A&&na(e,n,t,r);(_||D)&&(f={...f,...Ri(d.data,e.options)}),t._optimisticResults==="isRestoring"&&(f.fetchStatus="idle")}let{error:m,errorUpdatedAt:b,status:g}=f;h=f.data;let y=!1;if(t.placeholderData!==void 0&&h===void 0&&g==="pending"){let A;o?.isPlaceholderData&&t.placeholderData===i?.placeholderData?(A=o.data,y=!0):A=typeof t.placeholderData=="function"?t.placeholderData(this.#p?.state.data,this.#p):t.placeholderData,A!==void 0&&(g="success",h=mo(o?.data,A,t),u=!0)}if(t.select&&h!==void 0&&!y)if(o&&h===s?.data&&t.select===this.#m)h=this.#f;else try{this.#m=t.select,h=t.select(h),h=mo(o?.data,h,t),this.#f=h,this.#s=null}catch(A){this.#s=A}this.#s&&(m=this.#s,h=this.#f,b=Date.now(),g="error");const v=f.fetchStatus==="fetching",x=g==="pending",E=g==="error",S=x&&v,T=h!==void 0,R={status:g,fetchStatus:f.fetchStatus,isPending:x,isSuccess:g==="success",isError:E,isInitialLoading:S,isLoading:S,data:h,dataUpdatedAt:f.dataUpdatedAt,error:m,errorUpdatedAt:b,failureCount:f.fetchFailureCount,failureReason:f.fetchFailureReason,errorUpdateCount:f.errorUpdateCount,isFetched:f.dataUpdateCount>0||f.errorUpdateCount>0,isFetchedAfterMount:f.dataUpdateCount>c.dataUpdateCount||f.errorUpdateCount>c.errorUpdateCount,isFetching:v,isRefetching:v&&!x,isLoadingError:E&&!T,isPaused:f.fetchStatus==="paused",isPlaceholderData:u,isRefetchError:E&&T,isStale:Yo(e,t),refetch:this.refetch,promise:this.#a,isEnabled:Fe(t.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){const A=R.data!==void 0,_=R.status==="error"&&!A,D=H=>{_?H.reject(R.error):A&&H.resolve(R.data)},k=()=>{const H=this.#a=R.promise=go();D(H)},U=this.#a;switch(U.status){case"pending":e.queryHash===n.queryHash&&D(U);break;case"fulfilled":(_||R.data!==U.value)&&k();break;case"rejected":(!_||R.error!==U.reason)&&k();break}}return R}updateResult(){const e=this.#o,t=this.createResult(this.#t,this.options);if(this.#r=this.#t.state,this.#i=this.options,this.#r.data!==void 0&&(this.#p=this.#t),po(t,e))return;this.#o=t;const n=()=>{if(!e)return!0;const{notifyOnChangeProps:r}=this.options,o=typeof r=="function"?r():r;if(o==="all"||!o&&!this.#h.size)return!0;const s=new Set(o??this.#h);return this.options.throwOnError&&s.add("error"),Object.keys(this.#o).some(i=>{const a=i;return this.#o[a]!==e[a]&&s.has(a)})};this.#S({listeners:n()})}#E(){const e=this.#e.getQueryCache().build(this.#e,this.options);if(e===this.#t)return;const t=this.#t;this.#t=e,this.#n=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#b()}#S(e){Ee.batch(()=>{e.listeners&&this.listeners.forEach(t=>{t(this.#o)}),this.#e.getQueryCache().notify({query:this.#t,type:"observerResultsUpdated"})})}};function np(e,t){return Fe(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function ta(e,t){return np(e,t)||e.state.data!==void 0&&yo(e,t,t.refetchOnMount)}function yo(e,t,n){if(Fe(t.enabled,e)!==!1&&ct(t.staleTime,e)!=="static"){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&Yo(e,t)}return!1}function na(e,t,n,r){return(e!==t||Fe(r.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&Yo(e,n)}function Yo(e,t){return Fe(t.enabled,e)!==!1&&e.isStaleByTime(ct(t.staleTime,e))}function rp(e,t){return!po(e.getCurrentResult(),t)}function ra(e){return{onFetch:(t,n)=>{const r=t.options,o=t.fetchOptions?.meta?.fetchMore?.direction,s=t.state.data?.pages||[],i=t.state.data?.pageParams||[];let a={pages:[],pageParams:[]},c=0;const d=async()=>{let f=!1;const u=b=>{Kf(b,()=>t.signal,()=>f=!0)},h=wi(t.options,t.fetchOptions),m=async(b,g,y)=>{if(f)return Promise.reject();if(g==null&&b.pages.length)return Promise.resolve(b);const x=(()=>{const P={client:t.client,queryKey:t.queryKey,pageParam:g,direction:y?"backward":"forward",meta:t.options.meta};return u(P),P})(),E=await h(x),{maxPages:S}=t.options,T=y?Gf:zf;return{pages:T(b.pages,E,S),pageParams:T(b.pageParams,g,S)}};if(o&&s.length){const b=o==="backward",g=b?op:oa,y={pages:s,pageParams:i},v=g(r,y);a=await m(y,v,b)}else{const b=e??s.length;do{const g=c===0?i[0]??r.initialPageParam:oa(r,a);if(c>0&&g==null)break;a=await m(a,g),c++}while(c<b)}return a};t.options.persister?t.fetchFn=()=>t.options.persister?.(d,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n):t.fetchFn=d}}}function oa(e,{pages:t,pageParams:n}){const r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function op(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}var sp=class extends Ti{#e;#t;#n;#o;constructor(e){super(),this.#e=e.client,this.mutationId=e.mutationId,this.#n=e.mutationCache,this.#t=[],this.state=e.state||ap(),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.#o?.continue()??this.execute(this.state.variables)}async execute(e){const t=()=>{this.#r({type:"continue"})},n={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#o=Ci({fn:()=>this.options.mutationFn?this.options.mutationFn(e,n):Promise.reject(new Error("No mutationFn found")),onFail:(s,i)=>{this.#r({type:"failed",failureCount:s,error:i})},onPause:()=>{this.#r({type:"pause"})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)});const r=this.state.status==="pending",o=!this.#o.canStart();try{if(r)t();else{this.#r({type:"pending",variables:e,isPaused:o}),this.#n.config.onMutate&&await this.#n.config.onMutate(e,this,n);const i=await this.options.onMutate?.(e,n);i!==this.state.context&&this.#r({type:"pending",context:i,variables:e,isPaused:o})}const s=await this.#o.start();return await this.#n.config.onSuccess?.(s,e,this.state.context,this,n),await this.options.onSuccess?.(s,e,this.state.context,n),await this.#n.config.onSettled?.(s,null,this.state.variables,this.state.context,this,n),await this.options.onSettled?.(s,null,e,this.state.context,n),this.#r({type:"success",data:s}),s}catch(s){try{await this.#n.config.onError?.(s,e,this.state.context,this,n)}catch(i){Promise.reject(i)}try{await this.options.onError?.(s,e,this.state.context,n)}catch(i){Promise.reject(i)}try{await this.#n.config.onSettled?.(void 0,s,this.state.variables,this.state.context,this,n)}catch(i){Promise.reject(i)}try{await this.options.onSettled?.(void 0,s,e,this.state.context,n)}catch(i){Promise.reject(i)}throw this.#r({type:"error",error:s}),s}finally{this.#n.runNext(this)}}#r(e){const t=n=>{switch(e.type){case"failed":return{...n,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...n,isPaused:!0};case"continue":return{...n,isPaused:!1};case"pending":return{...n,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{...n,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...n,data:void 0,error:e.error,failureCount:n.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}};this.state=t(this.state),Ee.batch(()=>{this.#t.forEach(n=>{n.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:"updated",action:e})})}};function ap(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var ip=class extends bn{constructor(e={}){super(),this.config=e,this.#e=new Set,this.#t=new Map,this.#n=0}#e;#t;#n;build(e,t,n){const r=new sp({client:e,mutationCache:this,mutationId:++this.#n,options:e.defaultMutationOptions(t),state:n});return this.add(r),r}add(e){this.#e.add(e);const t=jn(e);if(typeof t=="string"){const n=this.#t.get(t);n?n.push(e):this.#t.set(t,[e])}this.notify({type:"added",mutation:e})}remove(e){if(this.#e.delete(e)){const t=jn(e);if(typeof t=="string"){const n=this.#t.get(t);if(n)if(n.length>1){const r=n.indexOf(e);r!==-1&&n.splice(r,1)}else n[0]===e&&this.#t.delete(t)}}this.notify({type:"removed",mutation:e})}canRun(e){const t=jn(e);if(typeof t=="string"){const r=this.#t.get(t)?.find(o=>o.state.status==="pending");return!r||r===e}else return!0}runNext(e){const t=jn(e);return typeof t=="string"?this.#t.get(t)?.find(r=>r!==e&&r.state.isPaused)?.continue()??Promise.resolve():Promise.resolve()}clear(){Ee.batch(()=>{this.#e.forEach(e=>{this.notify({type:"removed",mutation:e})}),this.#e.clear(),this.#t.clear()})}getAll(){return Array.from(this.#e)}find(e){const t={exact:!0,...e};return this.getAll().find(n=>Qs(t,n))}findAll(e={}){return this.getAll().filter(t=>Qs(e,t))}notify(e){Ee.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){const e=this.getAll().filter(t=>t.state.isPaused);return Ee.batch(()=>Promise.all(e.map(t=>t.continue().catch(Me))))}};function jn(e){return e.options.scope?.id}var cp=class extends bn{constructor(e={}){super(),this.config=e,this.#e=new Map}#e;build(e,t,n){const r=t.queryKey,o=t.queryHash??Ko(r,t);let s=this.get(o);return s||(s=new ep({client:e,queryKey:r,queryHash:o,options:e.defaultQueryOptions(t),state:n,defaultOptions:e.getQueryDefaults(r)}),this.add(s)),s}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const t=this.#e.get(e.queryHash);t&&(e.destroy(),t===e&&this.#e.delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){Ee.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){const t={exact:!0,...e};return this.getAll().find(n=>Zs(t,n))}findAll(e={}){const t=this.getAll();return Object.keys(e).length>0?t.filter(n=>Zs(e,n)):t}notify(e){Ee.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){Ee.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){Ee.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},lp=class{#e;#t;#n;#o;#r;#i;#a;#s;constructor(e={}){this.#e=e.queryCache||new cp,this.#t=e.mutationCache||new ip,this.#n=e.defaultOptions||{},this.#o=new Map,this.#r=new Map,this.#i=0}mount(){this.#i++,this.#i===1&&(this.#a=Qo.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#s=Xn.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#i--,this.#i===0&&(this.#a?.(),this.#a=void 0,this.#s?.(),this.#s=void 0)}isFetching(e){return this.#e.findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return this.#t.findAll({...e,status:"pending"}).length}getQueryData(e){const t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=this.#e.build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(ct(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return this.#e.findAll(e).map(({queryKey:t,state:n})=>{const r=n.data;return[t,r]})}setQueryData(e,t,n){const r=this.defaultQueryOptions({queryKey:e}),s=this.#e.get(r.queryHash)?.state.data,i=Vf(t,s);if(i!==void 0)return this.#e.build(this,r).setData(i,{...n,manual:!0})}setQueriesData(e,t,n){return Ee.batch(()=>this.#e.findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,n)]))}getQueryState(e){const t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state}removeQueries(e){const t=this.#e;Ee.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=this.#e;return Ee.batch(()=>(n.findAll(e).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},r=Ee.batch(()=>this.#e.findAll(e).map(o=>o.cancel(n)));return Promise.all(r).then(Me).catch(Me)}invalidateQueries(e,t={}){return Ee.batch(()=>(this.#e.findAll(e).forEach(n=>{n.invalidate()}),e?.refetchType==="none"?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??"active"},t)))}refetchQueries(e,t={}){const n={...t,cancelRefetch:t.cancelRefetch??!0},r=Ee.batch(()=>this.#e.findAll(e).filter(o=>!o.isDisabled()&&!o.isStatic()).map(o=>{let s=o.fetch(void 0,n);return n.throwOnError||(s=s.catch(Me)),o.state.fetchStatus==="paused"?Promise.resolve():s}));return Promise.all(r).then(Me)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=this.#e.build(this,t);return n.isStaleByTime(ct(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Me).catch(Me)}fetchInfiniteQuery(e){return e.behavior=ra(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Me).catch(Me)}ensureInfiniteQueryData(e){return e.behavior=ra(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return Xn.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#n}setDefaultOptions(e){this.#n=e}setQueryDefaults(e,t){this.#o.set(dn(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...this.#o.values()],n={};return t.forEach(r=>{fn(e,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(e,t){this.#r.set(dn(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...this.#r.values()],n={};return t.forEach(r=>{fn(e,r.mutationKey)&&Object.assign(n,r.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...this.#n.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=Ko(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===Zo&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#n.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}},Pi=l.createContext(void 0),up=e=>{const t=l.useContext(Pi);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},X1=({client:e,children:t})=>(l.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),p.jsx(Pi.Provider,{value:e,children:t})),Ai=l.createContext(!1),dp=()=>l.useContext(Ai);Ai.Provider;function Oi(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var Ni=l.createContext(Oi()),fp=()=>l.useContext(Ni),pp=({children:e})=>{const[t]=l.useState(()=>Oi());return p.jsx(Ni.Provider,{value:t,children:typeof e=="function"?e(t):e})},hp=(e,t,n)=>{const r=n?.state.error&&typeof e.throwOnError=="function"?Ei(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||r)&&(t.isReset()||(e.retryOnMount=!1))},mp=e=>{l.useEffect(()=>{e.clearReset()},[e])},gp=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:o})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(o&&e.data===void 0||Ei(n,[e.error,r])),vp=(e,t)=>t.state.data===void 0,yp=e=>{if(e.suspense){const n=o=>o==="static"?o:Math.max(o??1e3,1e3),r=e.staleTime;e.staleTime=typeof r=="function"?(...o)=>n(r(...o)):n(r),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},bp=(e,t)=>e.isLoading&&e.isFetching&&!t,xp=(e,t)=>e?.suspense&&t.isPending,sa=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function wp(e,t,n){const r=dp(),o=fp(),s=up(),i=s.defaultQueryOptions(e);s.getDefaultOptions().queries?._experimental_beforeQuery?.(i);const a=s.getQueryCache().get(i.queryHash);i._optimisticResults=r?"isRestoring":"optimistic",yp(i),hp(i,o,a),mp(o);const c=!s.getQueryCache().get(i.queryHash),[d]=l.useState(()=>new t(s,i)),f=d.getOptimisticResult(i),u=!r&&e.subscribed!==!1;if(l.useSyncExternalStore(l.useCallback(h=>{const m=u?d.subscribe(Ee.batchCalls(h)):Me;return d.updateResult(),m},[d,u]),()=>d.getCurrentResult(),()=>d.getCurrentResult()),l.useEffect(()=>{d.setOptions(i)},[i,d]),xp(i,f))throw sa(i,d,o);if(gp({result:f,errorResetBoundary:o,throwOnError:i.throwOnError,query:a,suspense:i.suspense}))throw f.error;return s.getDefaultOptions().queries?._experimental_afterQuery?.(i,f),i.experimental_prefetchInRender&&!Et&&bp(f,r)&&(c?sa(i,d,o):a?.promise)?.catch(Me).finally(()=>{d.updateResult()}),i.notifyOnChangeProps?f:d.trackResult(f)}function J1(e,t){return wp({...e,enabled:!0,suspense:!0,throwOnError:vp,placeholderData:void 0},tp)}var $r={confirmLabel:"OK",dismissible:!0},aa={confirmLabel:"Continue",cancelLabel:"Cancel",tone:"default",dismissible:!0},Ep=e=>typeof e=="string"?{title:e,...$r}:{...$r,...e,dismissible:e.dismissible??$r.dismissible},Sp=e=>typeof e=="string"?{title:e,...aa}:{...aa,...e,dismissible:e.dismissible??e.tone!=="danger"},Cp=()=>{let e={current:null};const t=new Set,n=()=>{t.forEach(c=>c())},r=c=>{e=c,n()},o=()=>e,s=()=>{const c=e.current;!c||c.kind!=="alert"||(r({current:null}),c.resolver())},i=c=>{const d=e.current;!d||d.kind!=="confirm"||(r({current:null}),d.resolver(c))},a=()=>{const c=e.current;if(c){if(c.kind==="confirm"){i(!1);return}s()}};return{subscribe:c=>(t.add(c),()=>{t.delete(c)}),getSnapshot:o,alert:c=>{const d=Ep(c);return a(),new Promise(f=>{r({current:{kind:"alert",options:d,resolver:f}})})},confirm:c=>{const d=Sp(c);return a(),new Promise(f=>{r({current:{kind:"confirm",options:d,resolver:f}})})},resolveAlert:s,resolveConfirm:i,dismiss:a,reset:()=>{a()}}},_i=l.createContext(null),Tp=()=>{const e=l.useRef();return e.current||(e.current=Cp()),e.current},Rp=({children:e,components:t})=>{const n=Tp(),r=l.useSyncExternalStore(n.subscribe,n.getSnapshot,n.getSnapshot);l.useEffect(()=>()=>{n.reset()},[n]);const o=n,s=r.current;return p.jsxs(_i.Provider,{value:o,children:[e,s?.kind==="alert"&&p.jsx(t.Alert,{open:!0,options:s.options,onClose:n.resolveAlert}),s?.kind==="confirm"&&p.jsx(t.Confirm,{open:!0,options:s.options,onCancel:()=>n.resolveConfirm(!1),onConfirm:()=>n.resolveConfirm(!0)})]})},eE=()=>{const e=l.useContext(_i);if(!e)throw new Error("useModal must be used within ModalProvider");return e};function Pp(e,t){const n=l.createContext(t),r=s=>{const{children:i,...a}=s,c=l.useMemo(()=>a,Object.values(a));return p.jsx(n.Provider,{value:c,children:i})};r.displayName=e+"Provider";function o(s){const i=l.useContext(n);if(i)return i;if(t!==void 0)return t;throw new Error(`\`${s}\` must be used within \`${e}\``)}return[r,o]}function Xe(e,t=[]){let n=[];function r(s,i){const a=l.createContext(i),c=n.length;n=[...n,i];const d=u=>{const{scope:h,children:m,...b}=u,g=h?.[e]?.[c]||a,y=l.useMemo(()=>b,Object.values(b));return p.jsx(g.Provider,{value:y,children:m})};d.displayName=s+"Provider";function f(u,h){const m=h?.[e]?.[c]||a,b=l.useContext(m);if(b)return b;if(i!==void 0)return i;throw new Error(`\`${u}\` must be used within \`${s}\``)}return[d,f]}const o=()=>{const s=n.map(i=>l.createContext(i));return function(a){const c=a?.[e]||s;return l.useMemo(()=>({[`__scope${e}`]:{...a,[e]:c}}),[a,c])}};return o.scopeName=e,[r,Ap(o,...t)]}function Ap(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(s){const i=r.reduce((a,{useScope:c,scopeName:d})=>{const u=c(s)[`__scope${d}`];return{...a,...u}},{});return l.useMemo(()=>({[`__scope${t.scopeName}`]:i}),[i])}};return n.scopeName=t.scopeName,n}function ia(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function xn(...e){return t=>{let n=!1;const r=e.map(o=>{const s=ia(o,t);return!n&&typeof s=="function"&&(n=!0),s});if(n)return()=>{for(let o=0;o<r.length;o++){const s=r[o];typeof s=="function"?s():ia(e[o],null)}}}}function re(...e){return l.useCallback(xn(...e),e)}function M(e,t,{checkForDefaultPrevented:n=!0}={}){return function(o){if(e?.(o),n===!1||!o.defaultPrevented)return t?.(o)}}var Pe=globalThis?.document?l.useLayoutEffect:()=>{},Op=lr[" useId ".trim().toString()]||(()=>{}),Np=0;function Ze(e){const[t,n]=l.useState(Op());return Pe(()=>{n(r=>r??String(Np++))},[e]),t?`radix-${t}`:""}var _p=lr[" useInsertionEffect ".trim().toString()]||Pe;function nt({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[o,s,i]=Ip({defaultProp:t,onChange:n}),a=e!==void 0,c=a?e:o;{const f=l.useRef(e!==void 0);l.useEffect(()=>{const u=f.current;u!==a&&console.warn(`${r} is changing from ${u?"controlled":"uncontrolled"} to ${a?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),f.current=a},[a,r])}const d=l.useCallback(f=>{if(a){const u=Mp(f)?f(e):f;u!==e&&i.current?.(u)}else s(f)},[a,e,s,i]);return[c,d]}function Ip({defaultProp:e,onChange:t}){const[n,r]=l.useState(e),o=l.useRef(n),s=l.useRef(t);return _p(()=>{s.current=t},[t]),l.useEffect(()=>{o.current!==n&&(s.current?.(n),o.current=n)},[n,o]),[n,r,s]}function Mp(e){return typeof e=="function"}function Gt(e){const t=Dp(e),n=l.forwardRef((r,o)=>{const{children:s,...i}=r,a=l.Children.toArray(s),c=a.find(jp);if(c){const d=c.props.children,f=a.map(u=>u===c?l.Children.count(d)>1?l.Children.only(null):l.isValidElement(d)?d.props.children:null:u);return p.jsx(t,{...i,ref:o,children:l.isValidElement(d)?l.cloneElement(d,void 0,f):null})}return p.jsx(t,{...i,ref:o,children:s})});return n.displayName=`${e}.Slot`,n}function Dp(e){const t=l.forwardRef((n,r)=>{const{children:o,...s}=n;if(l.isValidElement(o)){const i=kp(o),a=Lp(s,o.props);return o.type!==l.Fragment&&(a.ref=r?xn(r,i):i),l.cloneElement(o,a)}return l.Children.count(o)>1?l.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Ii=Symbol("radix.slottable");function Mi(e){const t=({children:n})=>p.jsx(p.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=Ii,t}function jp(e){return l.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Ii}function Lp(e,t){const n={...t};for(const r in t){const o=e[r],s=t[r];/^on[A-Z]/.test(r)?o&&s?n[r]=(...a)=>{const c=s(...a);return o(...a),c}:o&&(n[r]=o):r==="style"?n[r]={...o,...s}:r==="className"&&(n[r]=[o,s].filter(Boolean).join(" "))}return{...e,...n}}function kp(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)}var Fp=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Y=Fp.reduce((e,t)=>{const n=Gt(`Primitive.${t}`),r=l.forwardRef((o,s)=>{const{asChild:i,...a}=o,c=i?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),p.jsx(c,{...a,ref:s})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function Di(e,t){e&&ur.flushSync(()=>e.dispatchEvent(t))}function Ye(e){const t=l.useRef(e);return l.useEffect(()=>{t.current=e}),l.useMemo(()=>(...n)=>t.current?.(...n),[])}function $p(e,t=globalThis?.document){const n=Ye(e);l.useEffect(()=>{const r=o=>{o.key==="Escape"&&n(o)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var Bp="DismissableLayer",bo="dismissableLayer.update",Up="dismissableLayer.pointerDownOutside",Hp="dismissableLayer.focusOutside",ca,ji=l.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),wn=l.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:s,onInteractOutside:i,onDismiss:a,...c}=e,d=l.useContext(ji),[f,u]=l.useState(null),h=f?.ownerDocument??globalThis?.document,[,m]=l.useState({}),b=re(t,R=>u(R)),g=Array.from(d.layers),[y]=[...d.layersWithOutsidePointerEventsDisabled].slice(-1),v=g.indexOf(y),x=f?g.indexOf(f):-1,E=d.layersWithOutsidePointerEventsDisabled.size>0,S=x>=v,T=Wp(R=>{const A=R.target,_=[...d.branches].some(D=>D.contains(A));!S||_||(o?.(R),i?.(R),R.defaultPrevented||a?.())},h),P=zp(R=>{const A=R.target;[...d.branches].some(D=>D.contains(A))||(s?.(R),i?.(R),R.defaultPrevented||a?.())},h);return $p(R=>{x===d.layers.size-1&&(r?.(R),!R.defaultPrevented&&a&&(R.preventDefault(),a()))},h),l.useEffect(()=>{if(f)return n&&(d.layersWithOutsidePointerEventsDisabled.size===0&&(ca=h.body.style.pointerEvents,h.body.style.pointerEvents="none"),d.layersWithOutsidePointerEventsDisabled.add(f)),d.layers.add(f),la(),()=>{n&&d.layersWithOutsidePointerEventsDisabled.size===1&&(h.body.style.pointerEvents=ca)}},[f,h,n,d]),l.useEffect(()=>()=>{f&&(d.layers.delete(f),d.layersWithOutsidePointerEventsDisabled.delete(f),la())},[f,d]),l.useEffect(()=>{const R=()=>m({});return document.addEventListener(bo,R),()=>document.removeEventListener(bo,R)},[]),p.jsx(Y.div,{...c,ref:b,style:{pointerEvents:E?S?"auto":"none":void 0,...e.style},onFocusCapture:M(e.onFocusCapture,P.onFocusCapture),onBlurCapture:M(e.onBlurCapture,P.onBlurCapture),onPointerDownCapture:M(e.onPointerDownCapture,T.onPointerDownCapture)})});wn.displayName=Bp;var Vp="DismissableLayerBranch",qp=l.forwardRef((e,t)=>{const n=l.useContext(ji),r=l.useRef(null),o=re(t,r);return l.useEffect(()=>{const s=r.current;if(s)return n.branches.add(s),()=>{n.branches.delete(s)}},[n.branches]),p.jsx(Y.div,{...e,ref:o})});qp.displayName=Vp;function Wp(e,t=globalThis?.document){const n=Ye(e),r=l.useRef(!1),o=l.useRef(()=>{});return l.useEffect(()=>{const s=a=>{if(a.target&&!r.current){let c=function(){Li(Up,n,d,{discrete:!0})};const d={originalEvent:a};a.pointerType==="touch"?(t.removeEventListener("click",o.current),o.current=c,t.addEventListener("click",o.current,{once:!0})):c()}else t.removeEventListener("click",o.current);r.current=!1},i=window.setTimeout(()=>{t.addEventListener("pointerdown",s)},0);return()=>{window.clearTimeout(i),t.removeEventListener("pointerdown",s),t.removeEventListener("click",o.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function zp(e,t=globalThis?.document){const n=Ye(e),r=l.useRef(!1);return l.useEffect(()=>{const o=s=>{s.target&&!r.current&&Li(Hp,n,{originalEvent:s},{discrete:!1})};return t.addEventListener("focusin",o),()=>t.removeEventListener("focusin",o)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function la(){const e=new CustomEvent(bo);document.dispatchEvent(e)}function Li(e,t,n,{discrete:r}){const o=n.originalEvent.target,s=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?Di(o,s):o.dispatchEvent(s)}var Br="focusScope.autoFocusOnMount",Ur="focusScope.autoFocusOnUnmount",ua={bubbles:!1,cancelable:!0},Gp="FocusScope",pr=l.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:o,onUnmountAutoFocus:s,...i}=e,[a,c]=l.useState(null),d=Ye(o),f=Ye(s),u=l.useRef(null),h=re(t,g=>c(g)),m=l.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;l.useEffect(()=>{if(r){let g=function(E){if(m.paused||!a)return;const S=E.target;a.contains(S)?u.current=S:st(u.current,{select:!0})},y=function(E){if(m.paused||!a)return;const S=E.relatedTarget;S!==null&&(a.contains(S)||st(u.current,{select:!0}))},v=function(E){if(document.activeElement===document.body)for(const T of E)T.removedNodes.length>0&&st(a)};document.addEventListener("focusin",g),document.addEventListener("focusout",y);const x=new MutationObserver(v);return a&&x.observe(a,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",g),document.removeEventListener("focusout",y),x.disconnect()}}},[r,a,m.paused]),l.useEffect(()=>{if(a){fa.add(m);const g=document.activeElement;if(!a.contains(g)){const v=new CustomEvent(Br,ua);a.addEventListener(Br,d),a.dispatchEvent(v),v.defaultPrevented||(Kp(Jp(ki(a)),{select:!0}),document.activeElement===g&&st(a))}return()=>{a.removeEventListener(Br,d),setTimeout(()=>{const v=new CustomEvent(Ur,ua);a.addEventListener(Ur,f),a.dispatchEvent(v),v.defaultPrevented||st(g??document.body,{select:!0}),a.removeEventListener(Ur,f),fa.remove(m)},0)}}},[a,d,f,m]);const b=l.useCallback(g=>{if(!n&&!r||m.paused)return;const y=g.key==="Tab"&&!g.altKey&&!g.ctrlKey&&!g.metaKey,v=document.activeElement;if(y&&v){const x=g.currentTarget,[E,S]=Zp(x);E&&S?!g.shiftKey&&v===S?(g.preventDefault(),n&&st(E,{select:!0})):g.shiftKey&&v===E&&(g.preventDefault(),n&&st(S,{select:!0})):v===x&&g.preventDefault()}},[n,r,m.paused]);return p.jsx(Y.div,{tabIndex:-1,...i,ref:h,onKeyDown:b})});pr.displayName=Gp;function Kp(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(st(r,{select:t}),document.activeElement!==n)return}function Zp(e){const t=ki(e),n=da(t,e),r=da(t.reverse(),e);return[n,r]}function ki(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const o=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||o?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function da(e,t){for(const n of e)if(!Qp(n,{upTo:t}))return n}function Qp(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}function Yp(e){return e instanceof HTMLInputElement&&"select"in e}function st(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&Yp(e)&&t&&e.select()}}var fa=Xp();function Xp(){let e=[];return{add(t){const n=e[0];t!==n&&n?.pause(),e=pa(e,t),e.unshift(t)},remove(t){e=pa(e,t),e[0]?.resume()}}}function pa(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function Jp(e){return e.filter(t=>t.tagName!=="A")}var eh="Portal",En=l.forwardRef((e,t)=>{const{container:n,...r}=e,[o,s]=l.useState(!1);Pe(()=>s(!0),[]);const i=n||o&&globalThis?.document?.body;return i?ci.createPortal(p.jsx(Y.div,{...r,ref:t}),i):null});En.displayName=eh;function th(e,t){return l.useReducer((n,r)=>t[n][r]??n,e)}var Je=e=>{const{present:t,children:n}=e,r=nh(t),o=typeof n=="function"?n({present:r.isPresent}):l.Children.only(n),s=re(r.ref,rh(o));return typeof n=="function"||r.isPresent?l.cloneElement(o,{ref:s}):null};Je.displayName="Presence";function nh(e){const[t,n]=l.useState(),r=l.useRef(null),o=l.useRef(e),s=l.useRef("none"),i=e?"mounted":"unmounted",[a,c]=th(i,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return l.useEffect(()=>{const d=Ln(r.current);s.current=a==="mounted"?d:"none"},[a]),Pe(()=>{const d=r.current,f=o.current;if(f!==e){const h=s.current,m=Ln(d);e?c("MOUNT"):m==="none"||d?.display==="none"?c("UNMOUNT"):c(f&&h!==m?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,c]),Pe(()=>{if(t){let d;const f=t.ownerDocument.defaultView??window,u=m=>{const g=Ln(r.current).includes(CSS.escape(m.animationName));if(m.target===t&&g&&(c("ANIMATION_END"),!o.current)){const y=t.style.animationFillMode;t.style.animationFillMode="forwards",d=f.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=y)})}},h=m=>{m.target===t&&(s.current=Ln(r.current))};return t.addEventListener("animationstart",h),t.addEventListener("animationcancel",u),t.addEventListener("animationend",u),()=>{f.clearTimeout(d),t.removeEventListener("animationstart",h),t.removeEventListener("animationcancel",u),t.removeEventListener("animationend",u)}}else c("ANIMATION_END")},[t,c]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:l.useCallback(d=>{r.current=d?getComputedStyle(d):null,n(d)},[])}}function Ln(e){return e?.animationName||"none"}function rh(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)}var Hr=0;function Xo(){l.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??ha()),document.body.insertAdjacentElement("beforeend",e[1]??ha()),Hr++,()=>{Hr===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),Hr--}},[])}function ha(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var Ke=function(){return Ke=Object.assign||function(t){for(var n,r=1,o=arguments.length;r<o;r++){n=arguments[r];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(t[s]=n[s])}return t},Ke.apply(this,arguments)};function Fi(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 o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n}function oh(e,t,n){if(n||arguments.length===2)for(var r=0,o=t.length,s;r<o;r++)(s||!(r in t))&&(s||(s=Array.prototype.slice.call(t,0,r)),s[r]=t[r]);return e.concat(s||Array.prototype.slice.call(t))}var qn="right-scroll-bar-position",Wn="width-before-scroll-bar",sh="with-scroll-bars-hidden",ah="--removed-body-scroll-bar-size";function Vr(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function ih(e,t){var n=l.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var o=n.value;o!==r&&(n.value=r,n.callback(r,o))}}}})[0];return n.callback=t,n.facade}var ch=typeof window<"u"?l.useLayoutEffect:l.useEffect,ma=new WeakMap;function lh(e,t){var n=ih(null,function(r){return e.forEach(function(o){return Vr(o,r)})});return ch(function(){var r=ma.get(n);if(r){var o=new Set(r),s=new Set(e),i=n.current;o.forEach(function(a){s.has(a)||Vr(a,null)}),s.forEach(function(a){o.has(a)||Vr(a,i)})}ma.set(n,e)},[e]),n}function uh(e){return e}function dh(e,t){t===void 0&&(t=uh);var n=[],r=!1,o={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(s){var i=t(s,r);return n.push(i),function(){n=n.filter(function(a){return a!==i})}},assignSyncMedium:function(s){for(r=!0;n.length;){var i=n;n=[],i.forEach(s)}n={push:function(a){return s(a)},filter:function(){return n}}},assignMedium:function(s){r=!0;var i=[];if(n.length){var a=n;n=[],a.forEach(s),i=n}var c=function(){var f=i;i=[],f.forEach(s)},d=function(){return Promise.resolve().then(c)};d(),n={push:function(f){i.push(f),d()},filter:function(f){return i=i.filter(f),n}}}};return o}function fh(e){e===void 0&&(e={});var t=dh(null);return t.options=Ke({async:!0,ssr:!1},e),t}var $i=function(e){var t=e.sideCar,n=Fi(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return l.createElement(r,Ke({},n))};$i.isSideCarExport=!0;function ph(e,t){return e.useMedium(t),$i}var Bi=fh(),qr=function(){},hr=l.forwardRef(function(e,t){var n=l.useRef(null),r=l.useState({onScrollCapture:qr,onWheelCapture:qr,onTouchMoveCapture:qr}),o=r[0],s=r[1],i=e.forwardProps,a=e.children,c=e.className,d=e.removeScrollBar,f=e.enabled,u=e.shards,h=e.sideCar,m=e.noRelative,b=e.noIsolation,g=e.inert,y=e.allowPinchZoom,v=e.as,x=v===void 0?"div":v,E=e.gapMode,S=Fi(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),T=h,P=lh([n,t]),R=Ke(Ke({},S),o);return l.createElement(l.Fragment,null,f&&l.createElement(T,{sideCar:Bi,removeScrollBar:d,shards:u,noRelative:m,noIsolation:b,inert:g,setCallbacks:s,allowPinchZoom:!!y,lockRef:n,gapMode:E}),i?l.cloneElement(l.Children.only(a),Ke(Ke({},R),{ref:P})):l.createElement(x,Ke({},R,{className:c,ref:P}),a))});hr.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};hr.classNames={fullWidth:Wn,zeroRight:qn};var hh=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function mh(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=hh();return t&&e.setAttribute("nonce",t),e}function gh(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function vh(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var yh=function(){var e=0,t=null;return{add:function(n){e==0&&(t=mh())&&(gh(t,n),vh(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},bh=function(){var e=yh();return function(t,n){l.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},Ui=function(){var e=bh(),t=function(n){var r=n.styles,o=n.dynamic;return e(r,o),null};return t},xh={left:0,top:0,right:0,gap:0},Wr=function(e){return parseInt(e||"",10)||0},wh=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],o=t[e==="padding"?"paddingRight":"marginRight"];return[Wr(n),Wr(r),Wr(o)]},Eh=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return xh;var t=wh(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])}},Sh=Ui(),Ht="data-scroll-locked",Ch=function(e,t,n,r){var o=e.left,s=e.top,i=e.right,a=e.gap;return n===void 0&&(n="margin"),`
1
+ import{r as l,R as lr,b as C,j as p,w as zd,a as ur,d as ci,g as yn,e as Gd,u as Kd,o as Zd,s as Qd,k as Yd,p as Xd,n as Jd,i as ef,h as tf,l as nf,t as rf}from"./floating-ui.react-dom-BWTnA00G.js";import{H as of}from"./url-9nrbQs7Z.js";function co(e){return e[e.length-1]}function sf(e){return typeof e=="function"}function Us(e,t){return sf(e)?e(t):e}const af=Object.prototype.hasOwnProperty,Hs=Object.prototype.propertyIsEnumerable;function li(e,t,n=0){if(e===t)return e;if(n>500)return t;const r=t,o=Ws(e)&&Ws(r);if(!o&&!(Qn(e)&&Qn(r)))return r;const s=o?e:Vs(e);if(!s)return r;const i=o?r:Vs(r);if(!i)return r;const a=s.length,c=i.length,d=o?new Array(c):{};let f=0;for(let u=0;u<c;u++){const h=o?u:i[u],m=e[h],b=r[h];if(m===b){d[h]=m,(o?u<a:af.call(e,h))&&f++;continue}if(m===null||b===null||typeof m!="object"||typeof b!="object"){d[h]=b;continue}const g=li(m,b,n+1);d[h]=g,g===m&&f++}return a===c&&f===a?e:d}function Vs(e){const t=Object.getOwnPropertyNames(e);for(const o of t)if(!Hs.call(e,o))return!1;const n=Object.getOwnPropertySymbols(e);if(n.length===0)return t;const r=t;for(const o of n){if(!Hs.call(e,o))return!1;r.push(o)}return r}function Qn(e){if(!qs(e))return!1;const t=e.constructor;if(typeof t>"u")return!0;const n=t.prototype;return!(!qs(n)||!n.hasOwnProperty("isPrototypeOf"))}function qs(e){return Object.prototype.toString.call(e)==="[object Object]"}function Ws(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Vn(e,t,n){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return!1;for(let r=0,o=e.length;r<o;r++)if(!Vn(e[r],t[r],n))return!1;return!0}if(Qn(e)&&Qn(t)){const r=n?.ignoreUndefined??!0;if(n?.partial){for(const i in t)if((!r||t[i]!==void 0)&&!Vn(e[i],t[i],n))return!1;return!0}let o=0;if(!r)o=Object.keys(e).length;else for(const i in e)e[i]!==void 0&&o++;let s=0;for(const i in t)if((!r||t[i]!==void 0)&&(s++,s>o||!Vn(e[i],t[i],n)))return!1;return o===s}return!1}function A1(e){let t,n;const r=new Promise((o,s)=>{t=o,n=s});return r.status="pending",r.resolve=o=>{r.status="resolved",r.value=o,t(o),e?.(o)},r.reject=o=>{r.status="rejected",n(o)},r}function O1(e){return typeof e?.message!="string"?!1:e.message.startsWith("Failed to fetch dynamically imported module")||e.message.startsWith("error loading dynamically imported module")||e.message.startsWith("Importing a module script failed")}function N1(e){return!!(e&&typeof e=="object"&&typeof e.then=="function")}function cf(e){return e.replace(/[\x00-\x1f\x7f]/g,"")}function zs(e){let t;try{t=decodeURI(e)}catch{t=e.replaceAll(/%[0-9A-F]{2}/gi,n=>{try{return decodeURI(n)}catch{return n}})}return cf(t)}const _1=["http:","https:","mailto:","tel:"];function Gs(e,t){if(!e)return!1;try{const n=new URL(e);return!t.has(n.protocol)}catch{return!1}}function I1(e){if(!e)return{path:e,handledProtocolRelativeURL:!1};if(!/[%\\\x00-\x1f\x7f]/.test(e)&&!e.startsWith("//"))return{path:e,handledProtocolRelativeURL:!1};const t=/%25|%5C/gi;let n=0,r="",o;for(;(o=t.exec(e))!==null;)r+=zs(e.slice(n,o.index))+o[0],n=t.lastIndex;r=r+zs(n?e.slice(n):e);let s=!1;return r.startsWith("//")&&(s=!0,r="/"+r.replace(/^\/+/,"")),{path:r,handledProtocolRelativeURL:s}}function M1(e){return/\s|[^\u0000-\u007F]/.test(e)?e.replace(/\s|[^\u0000-\u007F]/gu,encodeURIComponent):e}var lf="Invariant failed";function Bo(e,t){if(!e)throw new Error(lf)}function lo(e){const t=new Map;let n,r;const o=s=>{s.next&&(s.prev?(s.prev.next=s.next,s.next.prev=s.prev,s.next=void 0,r&&(r.next=s,s.prev=r)):(s.next.prev=void 0,n=s.next,s.next=void 0,r&&(s.prev=r,r.next=s)),r=s)};return{get(s){const i=t.get(s);if(i)return o(i),i.value},set(s,i){if(t.size>=e&&n){const c=n;t.delete(c.key),c.next&&(n=c.next,c.next.prev=void 0),c===r&&(r=void 0)}const a=t.get(s);if(a)a.value=i,o(a);else{const c={key:s,value:i,prev:r};r&&(r.next=c),r=c,n||(n=c),t.set(s,c)}},clear(){t.clear(),n=void 0,r=void 0}}}const Wt=0,xt=1,wt=2,un=3,ht=4,ui=5;function uf(e){const t=e.indexOf("{");if(t===-1)return null;const n=e.indexOf("}",t);return n===-1||t+1>=e.length?null:[t,n]}function Uo(e,t,n=new Uint16Array(6)){const r=e.indexOf("/",t),o=r===-1?e.length:r,s=e.substring(t,o);if(!s||!s.includes("$"))return n[0]=Wt,n[1]=t,n[2]=t,n[3]=o,n[4]=o,n[5]=o,n;if(s==="$"){const a=e.length;return n[0]=wt,n[1]=t,n[2]=t,n[3]=a,n[4]=a,n[5]=a,n}if(s.charCodeAt(0)===36)return n[0]=xt,n[1]=t,n[2]=t+1,n[3]=o,n[4]=o,n[5]=o,n;const i=uf(s);if(i){const[a,c]=i,d=s.charCodeAt(a+1);if(d===45){if(a+2<s.length&&s.charCodeAt(a+2)===36){const f=a+3,u=c;if(f<u)return n[0]=un,n[1]=t+a,n[2]=t+f,n[3]=t+u,n[4]=t+c+1,n[5]=o,n}}else if(d===36){const f=a+1,u=a+2;return u===c?(n[0]=wt,n[1]=t+a,n[2]=t+f,n[3]=t+u,n[4]=t+c+1,n[5]=e.length,n):(n[0]=xt,n[1]=t+a,n[2]=t+u,n[3]=t+c,n[4]=t+c+1,n[5]=o,n)}}return n[0]=Wt,n[1]=t,n[2]=t,n[3]=o,n[4]=o,n[5]=o,n}function dr(e,t,n,r,o,s,i){i?.(n);let a=r;{const c=n.fullPath??n.from,d=c.length,f=n.options?.caseSensitive??e,u=!!(n.options?.params?.parse&&n.options?.skipRouteOnParseError?.params);for(;a<d;){const m=Uo(c,a,t);let b;const g=a,y=m[5];switch(a=y+1,s++,m[0]){case Wt:{const x=c.substring(m[2],m[3]);if(f){const E=o.static?.get(x);if(E)b=E;else{o.static??=new Map;const S=mt(n.fullPath??n.from);S.parent=o,S.depth=s,b=S,o.static.set(x,S)}}else{const E=x.toLowerCase(),S=o.staticInsensitive?.get(E);if(S)b=S;else{o.staticInsensitive??=new Map;const T=mt(n.fullPath??n.from);T.parent=o,T.depth=s,b=T,o.staticInsensitive.set(E,T)}}break}case xt:{const x=c.substring(g,m[1]),E=c.substring(m[4],y),S=f&&!!(x||E),T=x?S?x:x.toLowerCase():void 0,P=E?S?E:E.toLowerCase():void 0,R=!u&&o.dynamic?.find(A=>!A.skipOnParamError&&A.caseSensitive===S&&A.prefix===T&&A.suffix===P);if(R)b=R;else{const A=Dr(xt,n.fullPath??n.from,S,T,P);b=A,A.depth=s,A.parent=o,o.dynamic??=[],o.dynamic.push(A)}break}case un:{const x=c.substring(g,m[1]),E=c.substring(m[4],y),S=f&&!!(x||E),T=x?S?x:x.toLowerCase():void 0,P=E?S?E:E.toLowerCase():void 0,R=!u&&o.optional?.find(A=>!A.skipOnParamError&&A.caseSensitive===S&&A.prefix===T&&A.suffix===P);if(R)b=R;else{const A=Dr(un,n.fullPath??n.from,S,T,P);b=A,A.parent=o,A.depth=s,o.optional??=[],o.optional.push(A)}break}case wt:{const x=c.substring(g,m[1]),E=c.substring(m[4],y),S=f&&!!(x||E),T=x?S?x:x.toLowerCase():void 0,P=E?S?E:E.toLowerCase():void 0,R=Dr(wt,n.fullPath??n.from,S,T,P);b=R,R.parent=o,R.depth=s,o.wildcard??=[],o.wildcard.push(R)}}o=b}if(u&&n.children&&!n.isRoot&&n.id&&n.id.charCodeAt(n.id.lastIndexOf("/")+1)===95){const m=mt(n.fullPath??n.from);m.kind=ui,m.parent=o,s++,m.depth=s,o.pathless??=[],o.pathless.push(m),o=m}const h=(n.path||!n.children)&&!n.isRoot;if(h&&c.endsWith("/")){const m=mt(n.fullPath??n.from);m.kind=ht,m.parent=o,s++,m.depth=s,o.index=m,o=m}o.parse=n.options?.params?.parse??null,o.skipOnParamError=u,o.parsingPriority=n.options?.skipRouteOnParseError?.priority??0,h&&!o.route&&(o.route=n,o.fullPath=n.fullPath??n.from)}if(n.children)for(const c of n.children)dr(e,t,c,a,o,s,i)}function Mr(e,t){if(e.skipOnParamError&&!t.skipOnParamError)return-1;if(!e.skipOnParamError&&t.skipOnParamError)return 1;if(e.skipOnParamError&&t.skipOnParamError&&(e.parsingPriority||t.parsingPriority))return t.parsingPriority-e.parsingPriority;if(e.prefix&&t.prefix&&e.prefix!==t.prefix){if(e.prefix.startsWith(t.prefix))return-1;if(t.prefix.startsWith(e.prefix))return 1}if(e.suffix&&t.suffix&&e.suffix!==t.suffix){if(e.suffix.endsWith(t.suffix))return-1;if(t.suffix.endsWith(e.suffix))return 1}return e.prefix&&!t.prefix?-1:!e.prefix&&t.prefix?1:e.suffix&&!t.suffix?-1:!e.suffix&&t.suffix?1:e.caseSensitive&&!t.caseSensitive?-1:!e.caseSensitive&&t.caseSensitive?1:0}function at(e){if(e.pathless)for(const t of e.pathless)at(t);if(e.static)for(const t of e.static.values())at(t);if(e.staticInsensitive)for(const t of e.staticInsensitive.values())at(t);if(e.dynamic?.length){e.dynamic.sort(Mr);for(const t of e.dynamic)at(t)}if(e.optional?.length){e.optional.sort(Mr);for(const t of e.optional)at(t)}if(e.wildcard?.length){e.wildcard.sort(Mr);for(const t of e.wildcard)at(t)}}function mt(e){return{kind:Wt,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:e,parent:null,parse:null,skipOnParamError:!1,parsingPriority:0}}function Dr(e,t,n,r,o){return{kind:e,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:t,parent:null,parse:null,skipOnParamError:!1,parsingPriority:0,caseSensitive:n,prefix:r,suffix:o}}function D1(e,t){const n=mt("/"),r=new Uint16Array(6);for(const o of e)dr(!1,r,o,1,n,0);at(n),t.masksTree=n,t.flatCache=lo(1e3)}function j1(e,t){e||="/";const n=t.flatCache.get(e);if(n)return n;const r=Ho(e,t.masksTree);return t.flatCache.set(e,r),r}function L1(e,t,n,r,o){e||="/",r||="/";const s=t?`case\0${e}`:e;let i=o.singleCache.get(s);if(!i){i=mt("/");const a=new Uint16Array(6);dr(t,a,{from:e},1,i,0),o.singleCache.set(s,i)}return Ho(r,i,n)}function k1(e,t,n=!1){const r=n?e:`nofuzz\0${e}`,o=t.matchCache.get(r);if(o!==void 0)return o;e||="/";let s;try{s=Ho(e,t.segmentTree,n)}catch(i){if(i instanceof URIError)s=null;else throw i}return s&&(s.branch=ff(s.route)),t.matchCache.set(r,s),s}function df(e){return e==="/"?e:e.replace(/\/{1,}$/,"")}function F1(e,t=!1,n){const r=mt(e.fullPath),o=new Uint16Array(6),s={},i={};let a=0;return dr(t,o,e,1,r,0,d=>{if(n?.(d,a),Bo(!(d.id in s),`Duplicate routes found with id: ${String(d.id)}`),s[d.id]=d,a!==0&&d.path){const f=df(d.fullPath);(!i[f]||d.fullPath.endsWith("/"))&&(i[f]=d)}a++}),at(r),{processedTree:{segmentTree:r,singleCache:lo(1e3),matchCache:lo(1e3),flatCache:null,masksTree:null},routesById:s,routesByPath:i}}function Ho(e,t,n=!1){const r=e.split("/"),o=hf(e,r,t,n);if(!o)return null;const[s]=di(e,r,o);return{route:o.node.route,rawParams:s,parsedParams:o.parsedParams}}function di(e,t,n){const r=pf(n.node);let o=null;const s={};let i=n.extract?.part??0,a=n.extract?.node??0,c=n.extract?.path??0,d=n.extract?.segment??0;for(;a<r.length;i++,a++,c++,d++){const f=r[a];if(f.kind===ht)break;if(f.kind===ui){d--,i--,c--;continue}const u=t[i],h=c;if(u&&(c+=u.length),f.kind===xt){o??=n.node.fullPath.split("/");const m=o[d],b=f.prefix?.length??0;if(m.charCodeAt(b)===123){const y=f.suffix?.length??0,v=m.substring(b+2,m.length-y-1),x=u.substring(b,u.length-y);s[v]=decodeURIComponent(x)}else{const y=m.substring(1);s[y]=decodeURIComponent(u)}}else if(f.kind===un){if(n.skipped&1<<a){i--,c=h-1;continue}o??=n.node.fullPath.split("/");const m=o[d],b=f.prefix?.length??0,g=f.suffix?.length??0,y=m.substring(b+3,m.length-g-1),v=f.suffix||f.prefix?u.substring(b,u.length-g):u;v&&(s[y]=decodeURIComponent(v))}else if(f.kind===wt){const m=f,b=e.substring(h+(m.prefix?.length??0),e.length-(m.suffix?.length??0)),g=decodeURIComponent(b);s["*"]=g,s._splat=g;break}}return n.rawParams&&Object.assign(s,n.rawParams),[s,{part:i,node:a,path:c,segment:d}]}function ff(e){const t=[e];for(;e.parentRoute;)e=e.parentRoute,t.push(e);return t.reverse(),t}function pf(e){const t=Array(e.depth+1);do t[e.depth]=e,e=e.parent;while(e);return t}function hf(e,t,n,r){if(e==="/"&&n.index)return{node:n.index,skipped:0};const o=!co(t),s=o&&e!=="/",i=t.length-(o?1:0),a=[{node:n,index:1,skipped:0,depth:1,statics:1,dynamics:0,optionals:0}];let c=null,d=null,f=null;for(;a.length;){const u=a.pop(),{node:h,index:m,skipped:b,depth:g,statics:y,dynamics:v,optionals:x}=u;let{extract:E,rawParams:S,parsedParams:T}=u;if(h.skipOnParamError){if(!jr(e,t,u))continue;S=u.rawParams,E=u.extract,T=u.parsedParams}r&&h.route&&h.kind!==ht&&nn(d,u)&&(d=u);const P=m===i;if(P&&(h.route&&!s&&nn(f,u)&&(f=u),!h.optional&&!h.wildcard&&!h.index&&!h.pathless))continue;const R=P?void 0:t[m];let A;if(P&&h.index){const _={node:h.index,index:m,skipped:b,depth:g+1,statics:y,dynamics:v,optionals:x,extract:E,rawParams:S,parsedParams:T};let D=!0;if(h.index.skipOnParamError&&(jr(e,t,_)||(D=!1)),D){if(y===i&&!v&&!x&&!b)return _;nn(f,_)&&(f=_)}}if(h.wildcard&&nn(c,u))for(const _ of h.wildcard){const{prefix:D,suffix:k}=_;if(D&&(P||!(_.caseSensitive?R:A??=R.toLowerCase()).startsWith(D)))continue;if(k){if(P)continue;const H=t.slice(m).join("/").slice(-k.length);if((_.caseSensitive?H:H.toLowerCase())!==k)continue}const U={node:_,index:i,skipped:b,depth:g,statics:y,dynamics:v,optionals:x,extract:E,rawParams:S,parsedParams:T};if(!(_.skipOnParamError&&!jr(e,t,U))){c=U;break}}if(h.optional){const _=b|1<<g,D=g+1;for(let k=h.optional.length-1;k>=0;k--){const U=h.optional[k];a.push({node:U,index:m,skipped:_,depth:D,statics:y,dynamics:v,optionals:x,extract:E,rawParams:S,parsedParams:T})}if(!P)for(let k=h.optional.length-1;k>=0;k--){const U=h.optional[k],{prefix:H,suffix:Q}=U;if(H||Q){const ne=U.caseSensitive?R:A??=R.toLowerCase();if(H&&!ne.startsWith(H)||Q&&!ne.endsWith(Q))continue}a.push({node:U,index:m+1,skipped:b,depth:D,statics:y,dynamics:v,optionals:x+1,extract:E,rawParams:S,parsedParams:T})}}if(!P&&h.dynamic&&R)for(let _=h.dynamic.length-1;_>=0;_--){const D=h.dynamic[_],{prefix:k,suffix:U}=D;if(k||U){const H=D.caseSensitive?R:A??=R.toLowerCase();if(k&&!H.startsWith(k)||U&&!H.endsWith(U))continue}a.push({node:D,index:m+1,skipped:b,depth:g+1,statics:y,dynamics:v+1,optionals:x,extract:E,rawParams:S,parsedParams:T})}if(!P&&h.staticInsensitive){const _=h.staticInsensitive.get(A??=R.toLowerCase());_&&a.push({node:_,index:m+1,skipped:b,depth:g+1,statics:y+1,dynamics:v,optionals:x,extract:E,rawParams:S,parsedParams:T})}if(!P&&h.static){const _=h.static.get(R);_&&a.push({node:_,index:m+1,skipped:b,depth:g+1,statics:y+1,dynamics:v,optionals:x,extract:E,rawParams:S,parsedParams:T})}if(h.pathless){const _=g+1;for(let D=h.pathless.length-1;D>=0;D--){const k=h.pathless[D];a.push({node:k,index:m,skipped:b,depth:_,statics:y,dynamics:v,optionals:x,extract:E,rawParams:S,parsedParams:T})}}}if(f&&c)return nn(c,f)?f:c;if(f)return f;if(c)return c;if(r&&d){let u=d.index;for(let m=0;m<d.index;m++)u+=t[m].length;const h=u===e.length?"/":e.slice(u);return d.rawParams??={},d.rawParams["**"]=decodeURIComponent(h),d}return null}function jr(e,t,n){try{const[r,o]=di(e,t,n);n.rawParams=r,n.extract=o;const s=n.node.parse(r);return n.parsedParams=Object.assign({},n.parsedParams,s),!0}catch{return null}}function nn(e,t){return e?t.statics>e.statics||t.statics===e.statics&&(t.dynamics>e.dynamics||t.dynamics===e.dynamics&&(t.optionals>e.optionals||t.optionals===e.optionals&&((t.node.kind===ht)>(e.node.kind===ht)||t.node.kind===ht==(e.node.kind===ht)&&t.depth>e.depth))):!0}function Lr(e){return fi(e.filter(t=>t!==void 0).join("/"))}function fi(e){return e.replace(/\/{2,}/g,"/")}function pi(e){return e==="/"?e:e.replace(/^\/{1,}/,"")}function hi(e){const t=e.length;return t>1&&e[t-1]==="/"?e.replace(/\/{1,}$/,""):e}function $1(e){return hi(pi(e))}function Yn(e,t){return e?.endsWith("/")&&e!=="/"&&e!==`${t}/`?e.slice(0,-1):e}function mf(e,t,n){return Yn(e,n)===Yn(t,n)}function B1({base:e,to:t,trailingSlash:n="never",cache:r}){const o=t.startsWith("/"),s=!o&&t===".";let i;if(r){i=o?t:s?e:e+"\0"+t;const u=r.get(i);if(u)return u}let a;if(s)a=e.split("/");else if(o)a=t.split("/");else{for(a=e.split("/");a.length>1&&co(a)==="";)a.pop();const u=t.split("/");for(let h=0,m=u.length;h<m;h++){const b=u[h];b===""?h?h===m-1&&a.push(b):a=[b]:b===".."?a.pop():b==="."||a.push(b)}}a.length>1&&(co(a)===""?n==="never"&&a.pop():n==="always"&&a.push(""));let c,d="";for(let u=0;u<a.length;u++){u>0&&(d+="/");const h=a[u];if(!h)continue;c=Uo(h,0,c);const m=c[0];if(m===Wt){d+=h;continue}const b=c[5],g=h.substring(0,c[1]),y=h.substring(c[4],b),v=h.substring(c[2],c[3]);m===xt?d+=g||y?`${g}{$${v}}${y}`:`$${v}`:m===wt?d+=g||y?`${g}{$}${y}`:"$":d+=`${g}{-$${v}}${y}`}d=fi(d);const f=d||"/";return i&&r&&r.set(i,f),f}function U1(e){const t=new Map(e.map(o=>[encodeURIComponent(o),o])),n=Array.from(t.keys()).map(o=>o.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")).join("|"),r=new RegExp(n,"g");return o=>o.replace(r,s=>t.get(s)??s)}function kr(e,t,n){const r=t[e];return typeof r!="string"?r:e==="_splat"?/^[a-zA-Z0-9\-._~!/]*$/.test(r)?r:r.split("/").map(o=>Ks(o,n)).join("/"):Ks(r,n)}function H1({path:e,params:t,decoder:n,...r}){let o=!1;const s={};if(!e||e==="/")return{interpolatedPath:"/",usedParams:s,isMissingParams:o};if(!e.includes("$"))return{interpolatedPath:e,usedParams:s,isMissingParams:o};const i=e.length;let a=0,c,d="";for(;a<i;){const u=a;c=Uo(e,u,c);const h=c[5];if(a=h+1,u===h)continue;const m=c[0];if(m===Wt){d+="/"+e.substring(u,h);continue}if(m===wt){const b=t._splat;s._splat=b,s["*"]=b;const g=e.substring(u,c[1]),y=e.substring(c[4],h);if(!b){o=!0,(g||y)&&(d+="/"+g+y);continue}const v=kr("_splat",t,n);d+="/"+g+v+y;continue}if(m===xt){const b=e.substring(c[2],c[3]);!o&&!(b in t)&&(o=!0),s[b]=t[b];const g=e.substring(u,c[1]),y=e.substring(c[4],h),v=kr(b,t,n)??"undefined";d+="/"+g+v+y;continue}if(m===un){const b=e.substring(c[2],c[3]),g=t[b];if(g==null)continue;s[b]=g;const y=e.substring(u,c[1]),v=e.substring(c[4],h),x=kr(b,t,n)??"";d+="/"+y+x+v;continue}}return e.endsWith("/")&&(d+="/"),{usedParams:s,interpolatedPath:d||"/",isMissingParams:o}}function Ks(e,t){const n=encodeURIComponent(e);return t?.(n)??n}function mi(e={}){if(e.isNotFound=!0,e.throw)throw e;return e}function V1(e){return!!e?.isNotFound}const pt="__root__";function gi(e){if(e.statusCode=e.statusCode||e.code||307,!e._builtLocation&&!e.reloadDocument&&typeof e.href=="string")try{new URL(e.href),e.reloadDocument=!0}catch{}const t=new Headers(e.headers);e.href&&t.get("Location")===null&&t.set("Location",e.href);const n=new Response(null,{status:e.statusCode,headers:t});if(n.options=e,e.throw)throw n;return n}function q1(e){return e instanceof Response&&!!e.options}const gf="Error preloading route! ☝️";class vi{constructor(t){if(this.init=n=>{this.originalIndex=n.originalIndex;const r=this.options,o=!r?.path&&!r?.id;this.parentRoute=this.options.getParentRoute?.(),o?this._path=pt:this.parentRoute||Bo(!1);let s=o?pt:r?.path;s&&s!=="/"&&(s=pi(s));const i=r?.id||s;let a=o?pt:Lr([this.parentRoute.id===pt?"":this.parentRoute.id,i]);s===pt&&(s="/"),a!==pt&&(a=Lr(["/",a]));const c=a===pt?"/":Lr([this.parentRoute.fullPath,s]);this._path=s,this._id=a,this._fullPath=c,this._to=hi(c)},this.addChildren=n=>this._addFileChildren(n),this._addFileChildren=n=>(Array.isArray(n)&&(this.children=n),typeof n=="object"&&n!==null&&(this.children=Object.values(n)),this),this._addFileTypes=()=>this,this.updateLoader=n=>(Object.assign(this.options,n),this),this.update=n=>(Object.assign(this.options,n),this),this.lazy=n=>(this.lazyFn=n,this),this.redirect=n=>gi({from:this.fullPath,...n}),this.options=t||{},this.isRoot=!t?.getParentRoute,t?.id&&t?.path)throw new Error("Route cannot have both an 'id' and a 'path' option.")}get to(){return this._to}get id(){return this._id}get path(){return this._path}get fullPath(){return this._fullPath}}class vf{constructor({id:t}){this.notFound=n=>mi({routeId:this.id,...n}),this.redirect=n=>gi({from:this.id,...n}),this.id=t}}class yf extends vi{constructor(t){super(t)}}const bf="use",W1=lr[bf],z1=typeof window<"u"?l.useLayoutEffect:l.useEffect;function G1(e){const t=l.useRef({value:e,prev:null}),n=t.current.value;return e!==n&&(t.current={value:e,prev:n}),t.current.prev}function xf(e,t,n={},r={}){l.useEffect(()=>{if(!e.current||r.disabled||typeof IntersectionObserver!="function")return;const o=new IntersectionObserver(([s])=>{t(s)},n);return o.observe(e.current),()=>{o.disconnect()}},[t,n,r.disabled,e])}function wf(e){const t=l.useRef(null);return l.useImperativeHandle(e,()=>t.current,[]),t}function K1({children:e,fallback:t=null}){return yi()?p.jsx(C.Fragment,{children:e}):p.jsx(C.Fragment,{children:t})}function yi(){return C.useSyncExternalStore(Ef,()=>!0,()=>!1)}function Ef(){return()=>{}}function Sf(e,t){return e===t}function Cf(e,t,n=Sf){const r=l.useCallback(i=>{if(!e)return()=>{};const{unsubscribe:a}=e.subscribe(i);return a},[e]),o=l.useCallback(()=>e?.get(),[e]);return zd.useSyncExternalStoreWithSelector(r,o,o,t,n)}const Tf=l.createContext(null);function zt(e){const t=l.useContext(Tf);return e?.warn,t}function uo(e){const t=zt({warn:e?.router===void 0}),n=e?.router||t,r=l.useRef(void 0);return Cf(n.__store,o=>{if(e?.select){if(e.structuralSharing??n.options.defaultStructuralSharing){const s=li(r.current,e.select(o));return r.current=s,s}return e.select(o)}return o})}const Rf=l.createContext(void 0),Pf=l.createContext(void 0);function Qe(e){const t=l.useContext(e.from?Pf:Rf);return uo({select:r=>{const o=r.matches.find(s=>e.from?e.from===s.routeId:s.id===t);if(Bo(!((e.shouldThrow??!0)&&!o),`Could not find ${e.from?`an active match from "${e.from}"`:"a nearest match!"}`),o!==void 0)return e.select?e.select(o):o},structuralSharing:e.structuralSharing})}function Vo(e){return Qe({from:e.from,strict:e.strict,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.loaderData):t.loaderData})}function qo(e){const{select:t,...n}=e;return Qe({...n,select:r=>t?t(r.loaderDeps):r.loaderDeps})}function Wo(e){return Qe({from:e.from,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,strict:e.strict,select:t=>{const n=e.strict===!1?t.params:t._strictParams;return e.select?e.select(n):n}})}function zo(e){return Qe({from:e.from,strict:e.strict,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.search):t.search})}function fr(e){const t=zt();return l.useCallback(n=>t.navigate({...n,from:n.from??e?.from}),[e?.from,t])}function Af(e,t){const n=zt(),r=wf(t),{activeProps:o,inactiveProps:s,activeOptions:i,to:a,preload:c,preloadDelay:d,hashScrollIntoView:f,replace:u,startTransition:h,resetScroll:m,viewTransition:b,children:g,target:y,disabled:v,style:x,className:E,onClick:S,onBlur:T,onFocus:P,onMouseEnter:R,onMouseLeave:A,onTouchStart:_,ignoreBlocker:D,params:k,search:U,hash:H,state:Q,mask:ne,reloadDocument:L,unsafeRelative:Z,from:te,_fromLocation:I,...J}=e,W=yi(),ae=uo({select:se=>{const ge=se.matches[se.matches.length-1];return{search:ge?.search,hash:se.location.hash,path:ge?.pathname}},structuralSharing:!0}),$=e.from,q=l.useMemo(()=>({...e,from:$}),[n,ae,$,e._fromLocation,e.hash,e.to,e.search,e.params,e.state,e.mask,e.unsafeRelative]),V=l.useMemo(()=>n.buildLocation({...q}),[n,q]),F=V.maskedLocation?V.maskedLocation.publicHref:V.publicHref,O=V.maskedLocation?V.maskedLocation.external:V.external,j=l.useMemo(()=>Df(F,O,n.history,v),[v,O,F,n.history]),oe=l.useMemo(()=>{if(j?.external)return Gs(j.href,n.protocolAllowlist)?void 0:j.href;if(!jf(a)&&!(typeof a!="string"||a.indexOf(":")===-1))try{return new URL(a),Gs(a,n.protocolAllowlist)?void 0:a}catch{}},[a,j,n.protocolAllowlist]),ee=uo({select:se=>{if(oe)return!1;if(i?.exact){if(!mf(se.location.pathname,V.pathname,n.basepath))return!1}else{const ge=Yn(se.location.pathname,n.basepath),Ne=Yn(V.pathname,n.basepath);if(!(ge.startsWith(Ne)&&(ge.length===Ne.length||ge[Ne.length]==="/")))return!1}return(i?.includeSearch??!0)&&!Vn(se.location.search,V.search,{partial:!i?.exact,ignoreUndefined:!i?.explicitUndefined})?!1:i?.includeHash?W&&se.location.hash===V.hash:!0}}),X=ee?Us(o,{})??Of:Fr,G=ee?Fr:Us(s,{})??Fr,me=[E,X.className,G.className].filter(Boolean).join(" "),ve=(x||X.style||G.style)&&{...x,...X.style,...G.style},[xe,B]=l.useState(!1),ie=l.useRef(!1),ye=e.reloadDocument||oe?!1:c??n.options.defaultPreload,pe=d??n.options.defaultPreloadDelay??0,Le=l.useCallback(()=>{n.preloadRoute({...q,_builtLocation:V}).catch(se=>{console.warn(se),console.warn(gf)})},[n,q,V]),tn=l.useCallback(se=>{se?.isIntersecting&&Le()},[Le]);xf(r,tn,Mf,{disabled:!!v||ye!=="viewport"}),l.useEffect(()=>{ie.current||!v&&ye==="render"&&(Le(),ie.current=!0)},[v,Le,ye]);const he=se=>{const ge=se.currentTarget.getAttribute("target"),Ne=y!==void 0?y:ge;if(!v&&!Lf(se)&&!se.defaultPrevented&&(!Ne||Ne==="_self")&&se.button===0){se.preventDefault(),ur.flushSync(()=>{B(!0)});const _t=n.subscribe("onResolved",()=>{_t(),B(!1)});n.navigate({...q,replace:u,resetScroll:m,hashScrollIntoView:f,startTransition:h,viewTransition:b,ignoreBlocker:D})}};if(oe)return{...J,ref:r,href:oe,...g&&{children:g},...y&&{target:y},...v&&{disabled:v},...x&&{style:x},...E&&{className:E},...S&&{onClick:S},...T&&{onBlur:T},...P&&{onFocus:P},...R&&{onMouseEnter:R},...A&&{onMouseLeave:A},..._&&{onTouchStart:_}};const et=se=>{if(v||ye!=="intent")return;if(!pe){Le();return}const ge=se.currentTarget;if(rn.has(ge))return;const Ne=setTimeout(()=>{rn.delete(ge),Le()},pe);rn.set(ge,Ne)},_r=se=>{v||ye!=="intent"||Le()},In=se=>{if(v||!ye||!pe)return;const ge=se.currentTarget,Ne=rn.get(ge);Ne&&(clearTimeout(Ne),rn.delete(ge))};return{...J,...X,...G,href:j?.href,ref:r,onClick:Dt([S,he]),onBlur:Dt([T,In]),onFocus:Dt([P,et]),onMouseEnter:Dt([R,et]),onMouseLeave:Dt([A,In]),onTouchStart:Dt([_,_r]),disabled:!!v,target:y,...ve&&{style:ve},...me&&{className:me},...v&&Nf,...ee&&_f,...W&&xe&&If}}const Fr={},Of={className:"active"},Nf={role:"link","aria-disabled":!0},_f={"data-status":"active","aria-current":"page"},If={"data-transitioning":"transitioning"},rn=new WeakMap,Mf={rootMargin:"100px"},Dt=e=>t=>{for(const n of e)if(n){if(t.defaultPrevented)return;n(t)}};function Df(e,t,n,r){if(!r)return t?{href:e,external:!0}:{href:n.createHref(e)||"/",external:!1}}function jf(e){if(typeof e!="string")return!1;const t=e.charCodeAt(0);return t===47?e.charCodeAt(1)!==47:t===46}const Go=l.forwardRef((e,t)=>{const{_asChild:n,...r}=e,{type:o,...s}=Af(r,t),i=typeof r.children=="function"?r.children({isActive:s["data-status"]==="active"}):r.children;if(!n){const{disabled:a,...c}=s;return l.createElement("a",c,i)}return l.createElement(n,s,i)});function Lf(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function Z1(e){return new kf({id:e})}class kf extends vf{constructor({id:t}){super({id:t}),this.useMatch=n=>Qe({select:n?.select,from:this.id,structuralSharing:n?.structuralSharing}),this.useRouteContext=n=>Qe({from:this.id,select:r=>n?.select?n.select(r.context):r.context}),this.useSearch=n=>zo({select:n?.select,structuralSharing:n?.structuralSharing,from:this.id}),this.useParams=n=>Wo({select:n?.select,structuralSharing:n?.structuralSharing,from:this.id}),this.useLoaderDeps=n=>qo({...n,from:this.id,strict:!1}),this.useLoaderData=n=>Vo({...n,from:this.id,strict:!1}),this.useNavigate=()=>{const n=zt();return fr({from:n.routesById[this.id].fullPath})},this.notFound=n=>mi({routeId:this.id,...n}),this.Link=C.forwardRef((n,r)=>{const s=zt().routesById[this.id].fullPath;return p.jsx(Go,{ref:r,from:s,...n})})}}class Ff extends vi{constructor(t){super(t),this.useMatch=n=>Qe({select:n?.select,from:this.id,structuralSharing:n?.structuralSharing}),this.useRouteContext=n=>Qe({...n,from:this.id,select:r=>n?.select?n.select(r.context):r.context}),this.useSearch=n=>zo({select:n?.select,structuralSharing:n?.structuralSharing,from:this.id}),this.useParams=n=>Wo({select:n?.select,structuralSharing:n?.structuralSharing,from:this.id}),this.useLoaderDeps=n=>qo({...n,from:this.id}),this.useLoaderData=n=>Vo({...n,from:this.id}),this.useNavigate=()=>fr({from:this.fullPath}),this.Link=C.forwardRef((n,r)=>p.jsx(Go,{ref:r,from:this.fullPath,...n})),this.$$typeof=Symbol.for("react.memo")}}function Q1(e){return new Ff(e)}class $f extends yf{constructor(t){super(t),this.useMatch=n=>Qe({select:n?.select,from:this.id,structuralSharing:n?.structuralSharing}),this.useRouteContext=n=>Qe({...n,from:this.id,select:r=>n?.select?n.select(r.context):r.context}),this.useSearch=n=>zo({select:n?.select,structuralSharing:n?.structuralSharing,from:this.id}),this.useParams=n=>Wo({select:n?.select,structuralSharing:n?.structuralSharing,from:this.id}),this.useLoaderDeps=n=>qo({...n,from:this.id}),this.useLoaderData=n=>Vo({...n,from:this.id}),this.useNavigate=()=>fr({from:this.fullPath}),this.Link=C.forwardRef((n,r)=>p.jsx(Go,{ref:r,from:this.fullPath,...n})),this.$$typeof=Symbol.for("react.memo")}}function Y1(e){return new $f(e)}var bn=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(){}},Bf={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},Uf=class{#e=Bf;#t=!1;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)}},gt=new Uf;function Hf(e){setTimeout(e,0)}var Et=typeof window>"u"||"Deno"in globalThis;function Me(){}function Vf(e,t){return typeof e=="function"?e(t):e}function fo(e){return typeof e=="number"&&e>=0&&e!==1/0}function bi(e,t){return Math.max(e+(t||0)-Date.now(),0)}function ct(e,t){return typeof e=="function"?e(t):e}function Fe(e,t){return typeof e=="function"?e(t):e}function Zs(e,t){const{type:n="all",exact:r,fetchStatus:o,predicate:s,queryKey:i,stale:a}=e;if(i){if(r){if(t.queryHash!==Ko(i,t.options))return!1}else if(!fn(t.queryKey,i))return!1}if(n!=="all"){const c=t.isActive();if(n==="active"&&!c||n==="inactive"&&c)return!1}return!(typeof a=="boolean"&&t.isStale()!==a||o&&o!==t.state.fetchStatus||s&&!s(t))}function Qs(e,t){const{exact:n,status:r,predicate:o,mutationKey:s}=e;if(s){if(!t.options.mutationKey)return!1;if(n){if(dn(t.options.mutationKey)!==dn(s))return!1}else if(!fn(t.options.mutationKey,s))return!1}return!(r&&t.state.status!==r||o&&!o(t))}function Ko(e,t){return(t?.queryKeyHashFn||dn)(e)}function dn(e){return JSON.stringify(e,(t,n)=>ho(n)?Object.keys(n).sort().reduce((r,o)=>(r[o]=n[o],r),{}):n)}function fn(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(n=>fn(e[n],t[n])):!1}var qf=Object.prototype.hasOwnProperty;function xi(e,t,n=0){if(e===t)return e;if(n>500)return t;const r=Ys(e)&&Ys(t);if(!r&&!(ho(e)&&ho(t)))return t;const s=(r?e:Object.keys(e)).length,i=r?t:Object.keys(t),a=i.length,c=r?new Array(a):{};let d=0;for(let f=0;f<a;f++){const u=r?f:i[f],h=e[u],m=t[u];if(h===m){c[u]=h,(r?f<s:qf.call(e,u))&&d++;continue}if(h===null||m===null||typeof h!="object"||typeof m!="object"){c[u]=m;continue}const b=xi(h,m,n+1);c[u]=b,b===h&&d++}return s===a&&d===s?e:c}function po(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(e[n]!==t[n])return!1;return!0}function Ys(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function ho(e){if(!Xs(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!Xs(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function Xs(e){return Object.prototype.toString.call(e)==="[object Object]"}function Wf(e){return new Promise(t=>{gt.setTimeout(t,e)})}function mo(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?xi(e,t):t}function zf(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function Gf(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var Zo=Symbol();function wi(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===Zo?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function Ei(e,t){return typeof e=="function"?e(...t):!!e}function Kf(e,t,n){let r=!1,o;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(o??=t(),r||(r=!0,o.aborted?n():o.addEventListener("abort",n,{once:!0})),o)}),e}var Zf=class extends bn{#e;#t;#n;constructor(){super(),this.#n=e=>{if(!Et&&window.addEventListener){const 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(t=>{typeof t=="boolean"?this.setFocused(t):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){const e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return typeof this.#e=="boolean"?this.#e:globalThis.document?.visibilityState!=="hidden"}},Qo=new Zf;function go(){let e,t;const n=new Promise((o,s)=>{e=o,t=s});n.status="pending",n.catch(()=>{});function r(o){Object.assign(n,o),delete n.resolve,delete n.reject}return n.resolve=o=>{r({status:"fulfilled",value:o}),e(o)},n.reject=o=>{r({status:"rejected",reason:o}),t(o)},n}var Qf=Hf;function Yf(){let e=[],t=0,n=a=>{a()},r=a=>{a()},o=Qf;const s=a=>{t?e.push(a):o(()=>{n(a)})},i=()=>{const a=e;e=[],a.length&&o(()=>{r(()=>{a.forEach(c=>{n(c)})})})};return{batch:a=>{let c;t++;try{c=a()}finally{t--,t||i()}return c},batchCalls:a=>(...c)=>{s(()=>{a(...c)})},schedule:s,setNotifyFunction:a=>{n=a},setBatchNotifyFunction:a=>{r=a},setScheduler:a=>{o=a}}}var Ee=Yf(),Xf=class extends bn{#e=!0;#t;#n;constructor(){super(),this.#n=e=>{if(!Et&&window.addEventListener){const 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(n=>{n(e)}))}isOnline(){return this.#e}},Xn=new Xf;function Jf(e){return Math.min(1e3*2**e,3e4)}function Si(e){return(e??"online")==="online"?Xn.isOnline():!0}var vo=class extends Error{constructor(e){super("CancelledError"),this.revert=e?.revert,this.silent=e?.silent}};function Ci(e){let t=!1,n=0,r;const o=go(),s=()=>o.status!=="pending",i=g=>{if(!s()){const y=new vo(g);h(y),e.onCancel?.(y)}},a=()=>{t=!0},c=()=>{t=!1},d=()=>Qo.isFocused()&&(e.networkMode==="always"||Xn.isOnline())&&e.canRun(),f=()=>Si(e.networkMode)&&e.canRun(),u=g=>{s()||(r?.(),o.resolve(g))},h=g=>{s()||(r?.(),o.reject(g))},m=()=>new Promise(g=>{r=y=>{(s()||d())&&g(y)},e.onPause?.()}).then(()=>{r=void 0,s()||e.onContinue?.()}),b=()=>{if(s())return;let g;const y=n===0?e.initialPromise:void 0;try{g=y??e.fn()}catch(v){g=Promise.reject(v)}Promise.resolve(g).then(u).catch(v=>{if(s())return;const x=e.retry??(Et?0:3),E=e.retryDelay??Jf,S=typeof E=="function"?E(n,v):E,T=x===!0||typeof x=="number"&&n<x||typeof x=="function"&&x(n,v);if(t||!T){h(v);return}n++,e.onFail?.(n,v),Wf(S).then(()=>d()?void 0:m()).then(()=>{t?h(v):b()})})};return{promise:o,status:()=>o.status,cancel:i,continue:()=>(r?.(),o),cancelRetry:a,continueRetry:c,canStart:f,start:()=>(f()?b():m().then(b),o)}}var Ti=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),fo(this.gcTime)&&(this.#e=gt.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Et?1/0:300*1e3))}clearGcTimeout(){this.#e&&(gt.clearTimeout(this.#e),this.#e=void 0)}},ep=class extends Ti{#e;#t;#n;#o;#r;#i;#a;constructor(e){super(),this.#a=!1,this.#i=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#o=e.client,this.#n=this.#o.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#e=ea(this.options),this.state=e.state??this.#e,this.scheduleGc()}get meta(){return this.options.meta}get promise(){return this.#r?.promise}setOptions(e){if(this.options={...this.#i,...e},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const t=ea(this.options);t.data!==void 0&&(this.setState(Js(t.data,t.dataUpdatedAt)),this.#e=t)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.#n.remove(this)}setData(e,t){const n=mo(this.state.data,e,this.options);return this.#s({data:n,type:"success",dataUpdatedAt:t?.updatedAt,manual:t?.manual}),n}setState(e,t){this.#s({type:"setState",state:e,setStateOptions:t})}cancel(e){const t=this.#r?.promise;return this.#r?.cancel(e),t?t.then(Me).catch(Me):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.#e)}isActive(){return this.observers.some(e=>Fe(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Zo||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>ct(e.options.staleTime,this)==="static"):!1}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:!bi(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(t=>t.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#r?.continue()}onOnline(){this.observers.find(t=>t.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#r?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#n.notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(t=>t!==e),this.observers.length||(this.#r&&(this.#a?this.#r.cancel({revert:!0}):this.#r.cancelRetry()),this.scheduleGc()),this.#n.notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#s({type:"invalidate"})}async fetch(e,t){if(this.state.fetchStatus!=="idle"&&this.#r?.status()!=="rejected"){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#r)return this.#r.continueRetry(),this.#r.promise}if(e&&this.setOptions(e),!this.options.queryFn){const a=this.observers.find(c=>c.options.queryFn);a&&this.setOptions(a.options)}const n=new AbortController,r=a=>{Object.defineProperty(a,"signal",{enumerable:!0,get:()=>(this.#a=!0,n.signal)})},o=()=>{const a=wi(this.options,t),d=(()=>{const f={client:this.#o,queryKey:this.queryKey,meta:this.meta};return r(f),f})();return this.#a=!1,this.options.persister?this.options.persister(a,d,this):a(d)},i=(()=>{const a={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#o,state:this.state,fetchFn:o};return r(a),a})();this.options.behavior?.onFetch(i,this),this.#t=this.state,(this.state.fetchStatus==="idle"||this.state.fetchMeta!==i.fetchOptions?.meta)&&this.#s({type:"fetch",meta:i.fetchOptions?.meta}),this.#r=Ci({initialPromise:t?.initialPromise,fn:i.fetchFn,onCancel:a=>{a instanceof vo&&a.revert&&this.setState({...this.#t,fetchStatus:"idle"}),n.abort()},onFail:(a,c)=>{this.#s({type:"failed",failureCount:a,error:c})},onPause:()=>{this.#s({type:"pause"})},onContinue:()=>{this.#s({type:"continue"})},retry:i.options.retry,retryDelay:i.options.retryDelay,networkMode:i.options.networkMode,canRun:()=>!0});try{const a=await this.#r.start();if(a===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(a),this.#n.config.onSuccess?.(a,this),this.#n.config.onSettled?.(a,this.state.error,this),a}catch(a){if(a instanceof vo){if(a.silent)return this.#r.promise;if(a.revert){if(this.state.data===void 0)throw a;return this.state.data}}throw this.#s({type:"error",error:a}),this.#n.config.onError?.(a,this),this.#n.config.onSettled?.(this.state.data,a,this),a}finally{this.scheduleGc()}}#s(e){const t=n=>{switch(e.type){case"failed":return{...n,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...n,fetchStatus:"paused"};case"continue":return{...n,fetchStatus:"fetching"};case"fetch":return{...n,...Ri(n.data,this.options),fetchMeta:e.meta??null};case"success":const r={...n,...Js(e.data,e.dataUpdatedAt),dataUpdateCount:n.dataUpdateCount+1,...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return this.#t=e.manual?r:void 0,r;case"error":const o=e.error;return{...n,error:o,errorUpdateCount:n.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:n.fetchFailureCount+1,fetchFailureReason:o,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...n,isInvalidated:!0};case"setState":return{...n,...e.state}}};this.state=t(this.state),Ee.batch(()=>{this.observers.forEach(n=>{n.onQueryUpdate()}),this.#n.notify({query:this,type:"updated",action:e})})}};function Ri(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:Si(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function Js(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function ea(e){const 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 tp=class extends bn{constructor(e,t){super(),this.options=t,this.#e=e,this.#s=null,this.#a=go(),this.bindMethods(),this.setOptions(t)}#e;#t=void 0;#n=void 0;#o=void 0;#r;#i;#a;#s;#m;#f;#p;#l;#u;#c;#h=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),ta(this.#t,this.options)?this.#d():this.updateResult(),this.#b())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return yo(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return yo(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#x(),this.#w(),this.#t.removeObserver(this)}setOptions(e){const 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 Fe(this.options.enabled,this.#t)!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");this.#E(),this.#t.setOptions(this.options),t._defaulted&&!po(this.options,t)&&this.#e.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#t,observer:this});const r=this.hasListeners();r&&na(this.#t,n,this.options,t)&&this.#d(),this.updateResult(),r&&(this.#t!==n||Fe(this.options.enabled,this.#t)!==Fe(t.enabled,this.#t)||ct(this.options.staleTime,this.#t)!==ct(t.staleTime,this.#t))&&this.#g();const o=this.#v();r&&(this.#t!==n||Fe(this.options.enabled,this.#t)!==Fe(t.enabled,this.#t)||o!==this.#c)&&this.#y(o)}getOptimisticResult(e){const t=this.#e.getQueryCache().build(this.#e,e),n=this.createResult(t,e);return rp(this,n)&&(this.#o=n,this.#i=this.options,this.#r=this.#t.state),n}getCurrentResult(){return this.#o}trackResult(e,t){return new Proxy(e,{get:(n,r)=>(this.trackProp(r),t?.(r),r==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&this.#a.status==="pending"&&this.#a.reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(n,r))})}trackProp(e){this.#h.add(e)}getCurrentQuery(){return this.#t}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){const t=this.#e.defaultQueryOptions(e),n=this.#e.getQueryCache().build(this.#e,t);return n.fetch().then(()=>this.createResult(n,t))}fetch(e){return this.#d({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#o))}#d(e){this.#E();let t=this.#t.fetch(this.options,e);return e?.throwOnError||(t=t.catch(Me)),t}#g(){this.#x();const e=ct(this.options.staleTime,this.#t);if(Et||this.#o.isStale||!fo(e))return;const n=bi(this.#o.dataUpdatedAt,e)+1;this.#l=gt.setTimeout(()=>{this.#o.isStale||this.updateResult()},n)}#v(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(this.#t):this.options.refetchInterval)??!1}#y(e){this.#w(),this.#c=e,!(Et||Fe(this.options.enabled,this.#t)===!1||!fo(this.#c)||this.#c===0)&&(this.#u=gt.setInterval(()=>{(this.options.refetchIntervalInBackground||Qo.isFocused())&&this.#d()},this.#c))}#b(){this.#g(),this.#y(this.#v())}#x(){this.#l&&(gt.clearTimeout(this.#l),this.#l=void 0)}#w(){this.#u&&(gt.clearInterval(this.#u),this.#u=void 0)}createResult(e,t){const n=this.#t,r=this.options,o=this.#o,s=this.#r,i=this.#i,c=e!==n?e.state:this.#n,{state:d}=e;let f={...d},u=!1,h;if(t._optimisticResults){const A=this.hasListeners(),_=!A&&ta(e,t),D=A&&na(e,n,t,r);(_||D)&&(f={...f,...Ri(d.data,e.options)}),t._optimisticResults==="isRestoring"&&(f.fetchStatus="idle")}let{error:m,errorUpdatedAt:b,status:g}=f;h=f.data;let y=!1;if(t.placeholderData!==void 0&&h===void 0&&g==="pending"){let A;o?.isPlaceholderData&&t.placeholderData===i?.placeholderData?(A=o.data,y=!0):A=typeof t.placeholderData=="function"?t.placeholderData(this.#p?.state.data,this.#p):t.placeholderData,A!==void 0&&(g="success",h=mo(o?.data,A,t),u=!0)}if(t.select&&h!==void 0&&!y)if(o&&h===s?.data&&t.select===this.#m)h=this.#f;else try{this.#m=t.select,h=t.select(h),h=mo(o?.data,h,t),this.#f=h,this.#s=null}catch(A){this.#s=A}this.#s&&(m=this.#s,h=this.#f,b=Date.now(),g="error");const v=f.fetchStatus==="fetching",x=g==="pending",E=g==="error",S=x&&v,T=h!==void 0,R={status:g,fetchStatus:f.fetchStatus,isPending:x,isSuccess:g==="success",isError:E,isInitialLoading:S,isLoading:S,data:h,dataUpdatedAt:f.dataUpdatedAt,error:m,errorUpdatedAt:b,failureCount:f.fetchFailureCount,failureReason:f.fetchFailureReason,errorUpdateCount:f.errorUpdateCount,isFetched:f.dataUpdateCount>0||f.errorUpdateCount>0,isFetchedAfterMount:f.dataUpdateCount>c.dataUpdateCount||f.errorUpdateCount>c.errorUpdateCount,isFetching:v,isRefetching:v&&!x,isLoadingError:E&&!T,isPaused:f.fetchStatus==="paused",isPlaceholderData:u,isRefetchError:E&&T,isStale:Yo(e,t),refetch:this.refetch,promise:this.#a,isEnabled:Fe(t.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){const A=R.data!==void 0,_=R.status==="error"&&!A,D=H=>{_?H.reject(R.error):A&&H.resolve(R.data)},k=()=>{const H=this.#a=R.promise=go();D(H)},U=this.#a;switch(U.status){case"pending":e.queryHash===n.queryHash&&D(U);break;case"fulfilled":(_||R.data!==U.value)&&k();break;case"rejected":(!_||R.error!==U.reason)&&k();break}}return R}updateResult(){const e=this.#o,t=this.createResult(this.#t,this.options);if(this.#r=this.#t.state,this.#i=this.options,this.#r.data!==void 0&&(this.#p=this.#t),po(t,e))return;this.#o=t;const n=()=>{if(!e)return!0;const{notifyOnChangeProps:r}=this.options,o=typeof r=="function"?r():r;if(o==="all"||!o&&!this.#h.size)return!0;const s=new Set(o??this.#h);return this.options.throwOnError&&s.add("error"),Object.keys(this.#o).some(i=>{const a=i;return this.#o[a]!==e[a]&&s.has(a)})};this.#S({listeners:n()})}#E(){const e=this.#e.getQueryCache().build(this.#e,this.options);if(e===this.#t)return;const t=this.#t;this.#t=e,this.#n=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#b()}#S(e){Ee.batch(()=>{e.listeners&&this.listeners.forEach(t=>{t(this.#o)}),this.#e.getQueryCache().notify({query:this.#t,type:"observerResultsUpdated"})})}};function np(e,t){return Fe(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function ta(e,t){return np(e,t)||e.state.data!==void 0&&yo(e,t,t.refetchOnMount)}function yo(e,t,n){if(Fe(t.enabled,e)!==!1&&ct(t.staleTime,e)!=="static"){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&Yo(e,t)}return!1}function na(e,t,n,r){return(e!==t||Fe(r.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&Yo(e,n)}function Yo(e,t){return Fe(t.enabled,e)!==!1&&e.isStaleByTime(ct(t.staleTime,e))}function rp(e,t){return!po(e.getCurrentResult(),t)}function ra(e){return{onFetch:(t,n)=>{const r=t.options,o=t.fetchOptions?.meta?.fetchMore?.direction,s=t.state.data?.pages||[],i=t.state.data?.pageParams||[];let a={pages:[],pageParams:[]},c=0;const d=async()=>{let f=!1;const u=b=>{Kf(b,()=>t.signal,()=>f=!0)},h=wi(t.options,t.fetchOptions),m=async(b,g,y)=>{if(f)return Promise.reject();if(g==null&&b.pages.length)return Promise.resolve(b);const x=(()=>{const P={client:t.client,queryKey:t.queryKey,pageParam:g,direction:y?"backward":"forward",meta:t.options.meta};return u(P),P})(),E=await h(x),{maxPages:S}=t.options,T=y?Gf:zf;return{pages:T(b.pages,E,S),pageParams:T(b.pageParams,g,S)}};if(o&&s.length){const b=o==="backward",g=b?op:oa,y={pages:s,pageParams:i},v=g(r,y);a=await m(y,v,b)}else{const b=e??s.length;do{const g=c===0?i[0]??r.initialPageParam:oa(r,a);if(c>0&&g==null)break;a=await m(a,g),c++}while(c<b)}return a};t.options.persister?t.fetchFn=()=>t.options.persister?.(d,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n):t.fetchFn=d}}}function oa(e,{pages:t,pageParams:n}){const r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function op(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}var sp=class extends Ti{#e;#t;#n;#o;constructor(e){super(),this.#e=e.client,this.mutationId=e.mutationId,this.#n=e.mutationCache,this.#t=[],this.state=e.state||ap(),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.#o?.continue()??this.execute(this.state.variables)}async execute(e){const t=()=>{this.#r({type:"continue"})},n={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#o=Ci({fn:()=>this.options.mutationFn?this.options.mutationFn(e,n):Promise.reject(new Error("No mutationFn found")),onFail:(s,i)=>{this.#r({type:"failed",failureCount:s,error:i})},onPause:()=>{this.#r({type:"pause"})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)});const r=this.state.status==="pending",o=!this.#o.canStart();try{if(r)t();else{this.#r({type:"pending",variables:e,isPaused:o}),this.#n.config.onMutate&&await this.#n.config.onMutate(e,this,n);const i=await this.options.onMutate?.(e,n);i!==this.state.context&&this.#r({type:"pending",context:i,variables:e,isPaused:o})}const s=await this.#o.start();return await this.#n.config.onSuccess?.(s,e,this.state.context,this,n),await this.options.onSuccess?.(s,e,this.state.context,n),await this.#n.config.onSettled?.(s,null,this.state.variables,this.state.context,this,n),await this.options.onSettled?.(s,null,e,this.state.context,n),this.#r({type:"success",data:s}),s}catch(s){try{await this.#n.config.onError?.(s,e,this.state.context,this,n)}catch(i){Promise.reject(i)}try{await this.options.onError?.(s,e,this.state.context,n)}catch(i){Promise.reject(i)}try{await this.#n.config.onSettled?.(void 0,s,this.state.variables,this.state.context,this,n)}catch(i){Promise.reject(i)}try{await this.options.onSettled?.(void 0,s,e,this.state.context,n)}catch(i){Promise.reject(i)}throw this.#r({type:"error",error:s}),s}finally{this.#n.runNext(this)}}#r(e){const t=n=>{switch(e.type){case"failed":return{...n,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...n,isPaused:!0};case"continue":return{...n,isPaused:!1};case"pending":return{...n,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{...n,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...n,data:void 0,error:e.error,failureCount:n.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}};this.state=t(this.state),Ee.batch(()=>{this.#t.forEach(n=>{n.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:"updated",action:e})})}};function ap(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var ip=class extends bn{constructor(e={}){super(),this.config=e,this.#e=new Set,this.#t=new Map,this.#n=0}#e;#t;#n;build(e,t,n){const r=new sp({client:e,mutationCache:this,mutationId:++this.#n,options:e.defaultMutationOptions(t),state:n});return this.add(r),r}add(e){this.#e.add(e);const t=jn(e);if(typeof t=="string"){const n=this.#t.get(t);n?n.push(e):this.#t.set(t,[e])}this.notify({type:"added",mutation:e})}remove(e){if(this.#e.delete(e)){const t=jn(e);if(typeof t=="string"){const n=this.#t.get(t);if(n)if(n.length>1){const r=n.indexOf(e);r!==-1&&n.splice(r,1)}else n[0]===e&&this.#t.delete(t)}}this.notify({type:"removed",mutation:e})}canRun(e){const t=jn(e);if(typeof t=="string"){const r=this.#t.get(t)?.find(o=>o.state.status==="pending");return!r||r===e}else return!0}runNext(e){const t=jn(e);return typeof t=="string"?this.#t.get(t)?.find(r=>r!==e&&r.state.isPaused)?.continue()??Promise.resolve():Promise.resolve()}clear(){Ee.batch(()=>{this.#e.forEach(e=>{this.notify({type:"removed",mutation:e})}),this.#e.clear(),this.#t.clear()})}getAll(){return Array.from(this.#e)}find(e){const t={exact:!0,...e};return this.getAll().find(n=>Qs(t,n))}findAll(e={}){return this.getAll().filter(t=>Qs(e,t))}notify(e){Ee.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){const e=this.getAll().filter(t=>t.state.isPaused);return Ee.batch(()=>Promise.all(e.map(t=>t.continue().catch(Me))))}};function jn(e){return e.options.scope?.id}var cp=class extends bn{constructor(e={}){super(),this.config=e,this.#e=new Map}#e;build(e,t,n){const r=t.queryKey,o=t.queryHash??Ko(r,t);let s=this.get(o);return s||(s=new ep({client:e,queryKey:r,queryHash:o,options:e.defaultQueryOptions(t),state:n,defaultOptions:e.getQueryDefaults(r)}),this.add(s)),s}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const t=this.#e.get(e.queryHash);t&&(e.destroy(),t===e&&this.#e.delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){Ee.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){const t={exact:!0,...e};return this.getAll().find(n=>Zs(t,n))}findAll(e={}){const t=this.getAll();return Object.keys(e).length>0?t.filter(n=>Zs(e,n)):t}notify(e){Ee.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){Ee.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){Ee.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},lp=class{#e;#t;#n;#o;#r;#i;#a;#s;constructor(e={}){this.#e=e.queryCache||new cp,this.#t=e.mutationCache||new ip,this.#n=e.defaultOptions||{},this.#o=new Map,this.#r=new Map,this.#i=0}mount(){this.#i++,this.#i===1&&(this.#a=Qo.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#s=Xn.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#i--,this.#i===0&&(this.#a?.(),this.#a=void 0,this.#s?.(),this.#s=void 0)}isFetching(e){return this.#e.findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return this.#t.findAll({...e,status:"pending"}).length}getQueryData(e){const t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=this.#e.build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(ct(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return this.#e.findAll(e).map(({queryKey:t,state:n})=>{const r=n.data;return[t,r]})}setQueryData(e,t,n){const r=this.defaultQueryOptions({queryKey:e}),s=this.#e.get(r.queryHash)?.state.data,i=Vf(t,s);if(i!==void 0)return this.#e.build(this,r).setData(i,{...n,manual:!0})}setQueriesData(e,t,n){return Ee.batch(()=>this.#e.findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,n)]))}getQueryState(e){const t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state}removeQueries(e){const t=this.#e;Ee.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=this.#e;return Ee.batch(()=>(n.findAll(e).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},r=Ee.batch(()=>this.#e.findAll(e).map(o=>o.cancel(n)));return Promise.all(r).then(Me).catch(Me)}invalidateQueries(e,t={}){return Ee.batch(()=>(this.#e.findAll(e).forEach(n=>{n.invalidate()}),e?.refetchType==="none"?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??"active"},t)))}refetchQueries(e,t={}){const n={...t,cancelRefetch:t.cancelRefetch??!0},r=Ee.batch(()=>this.#e.findAll(e).filter(o=>!o.isDisabled()&&!o.isStatic()).map(o=>{let s=o.fetch(void 0,n);return n.throwOnError||(s=s.catch(Me)),o.state.fetchStatus==="paused"?Promise.resolve():s}));return Promise.all(r).then(Me)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=this.#e.build(this,t);return n.isStaleByTime(ct(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Me).catch(Me)}fetchInfiniteQuery(e){return e.behavior=ra(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Me).catch(Me)}ensureInfiniteQueryData(e){return e.behavior=ra(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return Xn.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#n}setDefaultOptions(e){this.#n=e}setQueryDefaults(e,t){this.#o.set(dn(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...this.#o.values()],n={};return t.forEach(r=>{fn(e,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(e,t){this.#r.set(dn(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...this.#r.values()],n={};return t.forEach(r=>{fn(e,r.mutationKey)&&Object.assign(n,r.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...this.#n.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=Ko(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===Zo&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#n.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}},Pi=l.createContext(void 0),up=e=>{const t=l.useContext(Pi);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},X1=({client:e,children:t})=>(l.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),p.jsx(Pi.Provider,{value:e,children:t})),Ai=l.createContext(!1),dp=()=>l.useContext(Ai);Ai.Provider;function Oi(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var Ni=l.createContext(Oi()),fp=()=>l.useContext(Ni),pp=({children:e})=>{const[t]=l.useState(()=>Oi());return p.jsx(Ni.Provider,{value:t,children:typeof e=="function"?e(t):e})},hp=(e,t,n)=>{const r=n?.state.error&&typeof e.throwOnError=="function"?Ei(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||r)&&(t.isReset()||(e.retryOnMount=!1))},mp=e=>{l.useEffect(()=>{e.clearReset()},[e])},gp=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:o})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(o&&e.data===void 0||Ei(n,[e.error,r])),vp=(e,t)=>t.state.data===void 0,yp=e=>{if(e.suspense){const n=o=>o==="static"?o:Math.max(o??1e3,1e3),r=e.staleTime;e.staleTime=typeof r=="function"?(...o)=>n(r(...o)):n(r),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},bp=(e,t)=>e.isLoading&&e.isFetching&&!t,xp=(e,t)=>e?.suspense&&t.isPending,sa=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function wp(e,t,n){const r=dp(),o=fp(),s=up(),i=s.defaultQueryOptions(e);s.getDefaultOptions().queries?._experimental_beforeQuery?.(i);const a=s.getQueryCache().get(i.queryHash);i._optimisticResults=r?"isRestoring":"optimistic",yp(i),hp(i,o,a),mp(o);const c=!s.getQueryCache().get(i.queryHash),[d]=l.useState(()=>new t(s,i)),f=d.getOptimisticResult(i),u=!r&&e.subscribed!==!1;if(l.useSyncExternalStore(l.useCallback(h=>{const m=u?d.subscribe(Ee.batchCalls(h)):Me;return d.updateResult(),m},[d,u]),()=>d.getCurrentResult(),()=>d.getCurrentResult()),l.useEffect(()=>{d.setOptions(i)},[i,d]),xp(i,f))throw sa(i,d,o);if(gp({result:f,errorResetBoundary:o,throwOnError:i.throwOnError,query:a,suspense:i.suspense}))throw f.error;return s.getDefaultOptions().queries?._experimental_afterQuery?.(i,f),i.experimental_prefetchInRender&&!Et&&bp(f,r)&&(c?sa(i,d,o):a?.promise)?.catch(Me).finally(()=>{d.updateResult()}),i.notifyOnChangeProps?f:d.trackResult(f)}function J1(e,t){return wp({...e,enabled:!0,suspense:!0,throwOnError:vp,placeholderData:void 0},tp)}var $r={confirmLabel:"OK",dismissible:!0},aa={confirmLabel:"Continue",cancelLabel:"Cancel",tone:"default",dismissible:!0},Ep=e=>typeof e=="string"?{title:e,...$r}:{...$r,...e,dismissible:e.dismissible??$r.dismissible},Sp=e=>typeof e=="string"?{title:e,...aa}:{...aa,...e,dismissible:e.dismissible??e.tone!=="danger"},Cp=()=>{let e={current:null};const t=new Set,n=()=>{t.forEach(c=>c())},r=c=>{e=c,n()},o=()=>e,s=()=>{const c=e.current;!c||c.kind!=="alert"||(r({current:null}),c.resolver())},i=c=>{const d=e.current;!d||d.kind!=="confirm"||(r({current:null}),d.resolver(c))},a=()=>{const c=e.current;if(c){if(c.kind==="confirm"){i(!1);return}s()}};return{subscribe:c=>(t.add(c),()=>{t.delete(c)}),getSnapshot:o,alert:c=>{const d=Ep(c);return a(),new Promise(f=>{r({current:{kind:"alert",options:d,resolver:f}})})},confirm:c=>{const d=Sp(c);return a(),new Promise(f=>{r({current:{kind:"confirm",options:d,resolver:f}})})},resolveAlert:s,resolveConfirm:i,dismiss:a,reset:()=>{a()}}},_i=l.createContext(null),Tp=()=>{const e=l.useRef();return e.current||(e.current=Cp()),e.current},Rp=({children:e,components:t})=>{const n=Tp(),r=l.useSyncExternalStore(n.subscribe,n.getSnapshot,n.getSnapshot);l.useEffect(()=>()=>{n.reset()},[n]);const o=n,s=r.current;return p.jsxs(_i.Provider,{value:o,children:[e,s?.kind==="alert"&&p.jsx(t.Alert,{open:!0,options:s.options,onClose:n.resolveAlert}),s?.kind==="confirm"&&p.jsx(t.Confirm,{open:!0,options:s.options,onCancel:()=>n.resolveConfirm(!1),onConfirm:()=>n.resolveConfirm(!0)})]})},eE=()=>{const e=l.useContext(_i);if(!e)throw new Error("useModal must be used within ModalProvider");return e};function Pp(e,t){const n=l.createContext(t),r=s=>{const{children:i,...a}=s,c=l.useMemo(()=>a,Object.values(a));return p.jsx(n.Provider,{value:c,children:i})};r.displayName=e+"Provider";function o(s){const i=l.useContext(n);if(i)return i;if(t!==void 0)return t;throw new Error(`\`${s}\` must be used within \`${e}\``)}return[r,o]}function Xe(e,t=[]){let n=[];function r(s,i){const a=l.createContext(i),c=n.length;n=[...n,i];const d=u=>{const{scope:h,children:m,...b}=u,g=h?.[e]?.[c]||a,y=l.useMemo(()=>b,Object.values(b));return p.jsx(g.Provider,{value:y,children:m})};d.displayName=s+"Provider";function f(u,h){const m=h?.[e]?.[c]||a,b=l.useContext(m);if(b)return b;if(i!==void 0)return i;throw new Error(`\`${u}\` must be used within \`${s}\``)}return[d,f]}const o=()=>{const s=n.map(i=>l.createContext(i));return function(a){const c=a?.[e]||s;return l.useMemo(()=>({[`__scope${e}`]:{...a,[e]:c}}),[a,c])}};return o.scopeName=e,[r,Ap(o,...t)]}function Ap(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(s){const i=r.reduce((a,{useScope:c,scopeName:d})=>{const u=c(s)[`__scope${d}`];return{...a,...u}},{});return l.useMemo(()=>({[`__scope${t.scopeName}`]:i}),[i])}};return n.scopeName=t.scopeName,n}function ia(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function xn(...e){return t=>{let n=!1;const r=e.map(o=>{const s=ia(o,t);return!n&&typeof s=="function"&&(n=!0),s});if(n)return()=>{for(let o=0;o<r.length;o++){const s=r[o];typeof s=="function"?s():ia(e[o],null)}}}}function re(...e){return l.useCallback(xn(...e),e)}function M(e,t,{checkForDefaultPrevented:n=!0}={}){return function(o){if(e?.(o),n===!1||!o.defaultPrevented)return t?.(o)}}var Pe=globalThis?.document?l.useLayoutEffect:()=>{},Op=lr[" useId ".trim().toString()]||(()=>{}),Np=0;function Ze(e){const[t,n]=l.useState(Op());return Pe(()=>{n(r=>r??String(Np++))},[e]),t?`radix-${t}`:""}var _p=lr[" useInsertionEffect ".trim().toString()]||Pe;function nt({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[o,s,i]=Ip({defaultProp:t,onChange:n}),a=e!==void 0,c=a?e:o;{const f=l.useRef(e!==void 0);l.useEffect(()=>{const u=f.current;u!==a&&console.warn(`${r} is changing from ${u?"controlled":"uncontrolled"} to ${a?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),f.current=a},[a,r])}const d=l.useCallback(f=>{if(a){const u=Mp(f)?f(e):f;u!==e&&i.current?.(u)}else s(f)},[a,e,s,i]);return[c,d]}function Ip({defaultProp:e,onChange:t}){const[n,r]=l.useState(e),o=l.useRef(n),s=l.useRef(t);return _p(()=>{s.current=t},[t]),l.useEffect(()=>{o.current!==n&&(s.current?.(n),o.current=n)},[n,o]),[n,r,s]}function Mp(e){return typeof e=="function"}function Gt(e){const t=Dp(e),n=l.forwardRef((r,o)=>{const{children:s,...i}=r,a=l.Children.toArray(s),c=a.find(jp);if(c){const d=c.props.children,f=a.map(u=>u===c?l.Children.count(d)>1?l.Children.only(null):l.isValidElement(d)?d.props.children:null:u);return p.jsx(t,{...i,ref:o,children:l.isValidElement(d)?l.cloneElement(d,void 0,f):null})}return p.jsx(t,{...i,ref:o,children:s})});return n.displayName=`${e}.Slot`,n}function Dp(e){const t=l.forwardRef((n,r)=>{const{children:o,...s}=n;if(l.isValidElement(o)){const i=kp(o),a=Lp(s,o.props);return o.type!==l.Fragment&&(a.ref=r?xn(r,i):i),l.cloneElement(o,a)}return l.Children.count(o)>1?l.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Ii=Symbol("radix.slottable");function Mi(e){const t=({children:n})=>p.jsx(p.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=Ii,t}function jp(e){return l.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Ii}function Lp(e,t){const n={...t};for(const r in t){const o=e[r],s=t[r];/^on[A-Z]/.test(r)?o&&s?n[r]=(...a)=>{const c=s(...a);return o(...a),c}:o&&(n[r]=o):r==="style"?n[r]={...o,...s}:r==="className"&&(n[r]=[o,s].filter(Boolean).join(" "))}return{...e,...n}}function kp(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)}var Fp=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Y=Fp.reduce((e,t)=>{const n=Gt(`Primitive.${t}`),r=l.forwardRef((o,s)=>{const{asChild:i,...a}=o,c=i?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),p.jsx(c,{...a,ref:s})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function Di(e,t){e&&ur.flushSync(()=>e.dispatchEvent(t))}function Ye(e){const t=l.useRef(e);return l.useEffect(()=>{t.current=e}),l.useMemo(()=>(...n)=>t.current?.(...n),[])}function $p(e,t=globalThis?.document){const n=Ye(e);l.useEffect(()=>{const r=o=>{o.key==="Escape"&&n(o)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var Bp="DismissableLayer",bo="dismissableLayer.update",Up="dismissableLayer.pointerDownOutside",Hp="dismissableLayer.focusOutside",ca,ji=l.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),wn=l.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:s,onInteractOutside:i,onDismiss:a,...c}=e,d=l.useContext(ji),[f,u]=l.useState(null),h=f?.ownerDocument??globalThis?.document,[,m]=l.useState({}),b=re(t,R=>u(R)),g=Array.from(d.layers),[y]=[...d.layersWithOutsidePointerEventsDisabled].slice(-1),v=g.indexOf(y),x=f?g.indexOf(f):-1,E=d.layersWithOutsidePointerEventsDisabled.size>0,S=x>=v,T=Wp(R=>{const A=R.target,_=[...d.branches].some(D=>D.contains(A));!S||_||(o?.(R),i?.(R),R.defaultPrevented||a?.())},h),P=zp(R=>{const A=R.target;[...d.branches].some(D=>D.contains(A))||(s?.(R),i?.(R),R.defaultPrevented||a?.())},h);return $p(R=>{x===d.layers.size-1&&(r?.(R),!R.defaultPrevented&&a&&(R.preventDefault(),a()))},h),l.useEffect(()=>{if(f)return n&&(d.layersWithOutsidePointerEventsDisabled.size===0&&(ca=h.body.style.pointerEvents,h.body.style.pointerEvents="none"),d.layersWithOutsidePointerEventsDisabled.add(f)),d.layers.add(f),la(),()=>{n&&d.layersWithOutsidePointerEventsDisabled.size===1&&(h.body.style.pointerEvents=ca)}},[f,h,n,d]),l.useEffect(()=>()=>{f&&(d.layers.delete(f),d.layersWithOutsidePointerEventsDisabled.delete(f),la())},[f,d]),l.useEffect(()=>{const R=()=>m({});return document.addEventListener(bo,R),()=>document.removeEventListener(bo,R)},[]),p.jsx(Y.div,{...c,ref:b,style:{pointerEvents:E?S?"auto":"none":void 0,...e.style},onFocusCapture:M(e.onFocusCapture,P.onFocusCapture),onBlurCapture:M(e.onBlurCapture,P.onBlurCapture),onPointerDownCapture:M(e.onPointerDownCapture,T.onPointerDownCapture)})});wn.displayName=Bp;var Vp="DismissableLayerBranch",qp=l.forwardRef((e,t)=>{const n=l.useContext(ji),r=l.useRef(null),o=re(t,r);return l.useEffect(()=>{const s=r.current;if(s)return n.branches.add(s),()=>{n.branches.delete(s)}},[n.branches]),p.jsx(Y.div,{...e,ref:o})});qp.displayName=Vp;function Wp(e,t=globalThis?.document){const n=Ye(e),r=l.useRef(!1),o=l.useRef(()=>{});return l.useEffect(()=>{const s=a=>{if(a.target&&!r.current){let c=function(){Li(Up,n,d,{discrete:!0})};const d={originalEvent:a};a.pointerType==="touch"?(t.removeEventListener("click",o.current),o.current=c,t.addEventListener("click",o.current,{once:!0})):c()}else t.removeEventListener("click",o.current);r.current=!1},i=window.setTimeout(()=>{t.addEventListener("pointerdown",s)},0);return()=>{window.clearTimeout(i),t.removeEventListener("pointerdown",s),t.removeEventListener("click",o.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function zp(e,t=globalThis?.document){const n=Ye(e),r=l.useRef(!1);return l.useEffect(()=>{const o=s=>{s.target&&!r.current&&Li(Hp,n,{originalEvent:s},{discrete:!1})};return t.addEventListener("focusin",o),()=>t.removeEventListener("focusin",o)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function la(){const e=new CustomEvent(bo);document.dispatchEvent(e)}function Li(e,t,n,{discrete:r}){const o=n.originalEvent.target,s=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?Di(o,s):o.dispatchEvent(s)}var Br="focusScope.autoFocusOnMount",Ur="focusScope.autoFocusOnUnmount",ua={bubbles:!1,cancelable:!0},Gp="FocusScope",pr=l.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:o,onUnmountAutoFocus:s,...i}=e,[a,c]=l.useState(null),d=Ye(o),f=Ye(s),u=l.useRef(null),h=re(t,g=>c(g)),m=l.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;l.useEffect(()=>{if(r){let g=function(E){if(m.paused||!a)return;const S=E.target;a.contains(S)?u.current=S:st(u.current,{select:!0})},y=function(E){if(m.paused||!a)return;const S=E.relatedTarget;S!==null&&(a.contains(S)||st(u.current,{select:!0}))},v=function(E){if(document.activeElement===document.body)for(const T of E)T.removedNodes.length>0&&st(a)};document.addEventListener("focusin",g),document.addEventListener("focusout",y);const x=new MutationObserver(v);return a&&x.observe(a,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",g),document.removeEventListener("focusout",y),x.disconnect()}}},[r,a,m.paused]),l.useEffect(()=>{if(a){fa.add(m);const g=document.activeElement;if(!a.contains(g)){const v=new CustomEvent(Br,ua);a.addEventListener(Br,d),a.dispatchEvent(v),v.defaultPrevented||(Kp(Jp(ki(a)),{select:!0}),document.activeElement===g&&st(a))}return()=>{a.removeEventListener(Br,d),setTimeout(()=>{const v=new CustomEvent(Ur,ua);a.addEventListener(Ur,f),a.dispatchEvent(v),v.defaultPrevented||st(g??document.body,{select:!0}),a.removeEventListener(Ur,f),fa.remove(m)},0)}}},[a,d,f,m]);const b=l.useCallback(g=>{if(!n&&!r||m.paused)return;const y=g.key==="Tab"&&!g.altKey&&!g.ctrlKey&&!g.metaKey,v=document.activeElement;if(y&&v){const x=g.currentTarget,[E,S]=Zp(x);E&&S?!g.shiftKey&&v===S?(g.preventDefault(),n&&st(E,{select:!0})):g.shiftKey&&v===E&&(g.preventDefault(),n&&st(S,{select:!0})):v===x&&g.preventDefault()}},[n,r,m.paused]);return p.jsx(Y.div,{tabIndex:-1,...i,ref:h,onKeyDown:b})});pr.displayName=Gp;function Kp(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(st(r,{select:t}),document.activeElement!==n)return}function Zp(e){const t=ki(e),n=da(t,e),r=da(t.reverse(),e);return[n,r]}function ki(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const o=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||o?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function da(e,t){for(const n of e)if(!Qp(n,{upTo:t}))return n}function Qp(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}function Yp(e){return e instanceof HTMLInputElement&&"select"in e}function st(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&Yp(e)&&t&&e.select()}}var fa=Xp();function Xp(){let e=[];return{add(t){const n=e[0];t!==n&&n?.pause(),e=pa(e,t),e.unshift(t)},remove(t){e=pa(e,t),e[0]?.resume()}}}function pa(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function Jp(e){return e.filter(t=>t.tagName!=="A")}var eh="Portal",En=l.forwardRef((e,t)=>{const{container:n,...r}=e,[o,s]=l.useState(!1);Pe(()=>s(!0),[]);const i=n||o&&globalThis?.document?.body;return i?ci.createPortal(p.jsx(Y.div,{...r,ref:t}),i):null});En.displayName=eh;function th(e,t){return l.useReducer((n,r)=>t[n][r]??n,e)}var Je=e=>{const{present:t,children:n}=e,r=nh(t),o=typeof n=="function"?n({present:r.isPresent}):l.Children.only(n),s=re(r.ref,rh(o));return typeof n=="function"||r.isPresent?l.cloneElement(o,{ref:s}):null};Je.displayName="Presence";function nh(e){const[t,n]=l.useState(),r=l.useRef(null),o=l.useRef(e),s=l.useRef("none"),i=e?"mounted":"unmounted",[a,c]=th(i,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return l.useEffect(()=>{const d=Ln(r.current);s.current=a==="mounted"?d:"none"},[a]),Pe(()=>{const d=r.current,f=o.current;if(f!==e){const h=s.current,m=Ln(d);e?c("MOUNT"):m==="none"||d?.display==="none"?c("UNMOUNT"):c(f&&h!==m?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,c]),Pe(()=>{if(t){let d;const f=t.ownerDocument.defaultView??window,u=m=>{const g=Ln(r.current).includes(CSS.escape(m.animationName));if(m.target===t&&g&&(c("ANIMATION_END"),!o.current)){const y=t.style.animationFillMode;t.style.animationFillMode="forwards",d=f.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=y)})}},h=m=>{m.target===t&&(s.current=Ln(r.current))};return t.addEventListener("animationstart",h),t.addEventListener("animationcancel",u),t.addEventListener("animationend",u),()=>{f.clearTimeout(d),t.removeEventListener("animationstart",h),t.removeEventListener("animationcancel",u),t.removeEventListener("animationend",u)}}else c("ANIMATION_END")},[t,c]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:l.useCallback(d=>{r.current=d?getComputedStyle(d):null,n(d)},[])}}function Ln(e){return e?.animationName||"none"}function rh(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)}var Hr=0;function Xo(){l.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??ha()),document.body.insertAdjacentElement("beforeend",e[1]??ha()),Hr++,()=>{Hr===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),Hr--}},[])}function ha(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var Ke=function(){return Ke=Object.assign||function(t){for(var n,r=1,o=arguments.length;r<o;r++){n=arguments[r];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(t[s]=n[s])}return t},Ke.apply(this,arguments)};function Fi(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 o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n}function oh(e,t,n){if(n||arguments.length===2)for(var r=0,o=t.length,s;r<o;r++)(s||!(r in t))&&(s||(s=Array.prototype.slice.call(t,0,r)),s[r]=t[r]);return e.concat(s||Array.prototype.slice.call(t))}var qn="right-scroll-bar-position",Wn="width-before-scroll-bar",sh="with-scroll-bars-hidden",ah="--removed-body-scroll-bar-size";function Vr(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function ih(e,t){var n=l.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var o=n.value;o!==r&&(n.value=r,n.callback(r,o))}}}})[0];return n.callback=t,n.facade}var ch=typeof window<"u"?l.useLayoutEffect:l.useEffect,ma=new WeakMap;function lh(e,t){var n=ih(null,function(r){return e.forEach(function(o){return Vr(o,r)})});return ch(function(){var r=ma.get(n);if(r){var o=new Set(r),s=new Set(e),i=n.current;o.forEach(function(a){s.has(a)||Vr(a,null)}),s.forEach(function(a){o.has(a)||Vr(a,i)})}ma.set(n,e)},[e]),n}function uh(e){return e}function dh(e,t){t===void 0&&(t=uh);var n=[],r=!1,o={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(s){var i=t(s,r);return n.push(i),function(){n=n.filter(function(a){return a!==i})}},assignSyncMedium:function(s){for(r=!0;n.length;){var i=n;n=[],i.forEach(s)}n={push:function(a){return s(a)},filter:function(){return n}}},assignMedium:function(s){r=!0;var i=[];if(n.length){var a=n;n=[],a.forEach(s),i=n}var c=function(){var f=i;i=[],f.forEach(s)},d=function(){return Promise.resolve().then(c)};d(),n={push:function(f){i.push(f),d()},filter:function(f){return i=i.filter(f),n}}}};return o}function fh(e){e===void 0&&(e={});var t=dh(null);return t.options=Ke({async:!0,ssr:!1},e),t}var $i=function(e){var t=e.sideCar,n=Fi(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return l.createElement(r,Ke({},n))};$i.isSideCarExport=!0;function ph(e,t){return e.useMedium(t),$i}var Bi=fh(),qr=function(){},hr=l.forwardRef(function(e,t){var n=l.useRef(null),r=l.useState({onScrollCapture:qr,onWheelCapture:qr,onTouchMoveCapture:qr}),o=r[0],s=r[1],i=e.forwardProps,a=e.children,c=e.className,d=e.removeScrollBar,f=e.enabled,u=e.shards,h=e.sideCar,m=e.noRelative,b=e.noIsolation,g=e.inert,y=e.allowPinchZoom,v=e.as,x=v===void 0?"div":v,E=e.gapMode,S=Fi(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),T=h,P=lh([n,t]),R=Ke(Ke({},S),o);return l.createElement(l.Fragment,null,f&&l.createElement(T,{sideCar:Bi,removeScrollBar:d,shards:u,noRelative:m,noIsolation:b,inert:g,setCallbacks:s,allowPinchZoom:!!y,lockRef:n,gapMode:E}),i?l.cloneElement(l.Children.only(a),Ke(Ke({},R),{ref:P})):l.createElement(x,Ke({},R,{className:c,ref:P}),a))});hr.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};hr.classNames={fullWidth:Wn,zeroRight:qn};var hh=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function mh(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=hh();return t&&e.setAttribute("nonce",t),e}function gh(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function vh(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var yh=function(){var e=0,t=null;return{add:function(n){e==0&&(t=mh())&&(gh(t,n),vh(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},bh=function(){var e=yh();return function(t,n){l.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},Ui=function(){var e=bh(),t=function(n){var r=n.styles,o=n.dynamic;return e(r,o),null};return t},xh={left:0,top:0,right:0,gap:0},Wr=function(e){return parseInt(e||"",10)||0},wh=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],o=t[e==="padding"?"paddingRight":"marginRight"];return[Wr(n),Wr(r),Wr(o)]},Eh=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return xh;var t=wh(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])}},Sh=Ui(),Ht="data-scroll-locked",Ch=function(e,t,n,r){var o=e.left,s=e.top,i=e.right,a=e.gap;return n===void 0&&(n="margin"),`
2
2
  .`.concat(sh,` {
3
3
  overflow: hidden `).concat(r,`;
4
4
  padding-right: `).concat(a,"px ").concat(r,`;
@@ -56,7 +56,7 @@ For more information, see https://radix-ui.com/primitives/docs/components/alert-
56
56
  `);return i===-1?"":o.stack.slice(i+1)})();try{if(!r.stack)r.stack=s;else if(s){const i=s.indexOf(`
57
57
  `),a=i===-1?-1:s.indexOf(`
58
58
  `,i+1),c=a===-1?"":s.slice(a+1);String(r.stack).endsWith(c)||(r.stack+=`
59
- `+s)}}catch{}}throw r}}_request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=Tt(this.defaults,n);const{transitional:r,paramsSerializer:o,headers:s}=n;r!==void 0&&Kn.assertOptions(r,{silentJSONParsing:Te.transitional(Te.boolean),forcedJSONParsing:Te.transitional(Te.boolean),clarifyTimeoutError:Te.transitional(Te.boolean),legacyInterceptorReqResOrdering:Te.transitional(Te.boolean),advertiseZstdAcceptEncoding:Te.transitional(Te.boolean),validateStatusUndefinedResolves:Te.transitional(Te.boolean)},!1),o!=null&&(w.isFunction(o)?n.paramsSerializer={serialize:o}:Kn.assertOptions(o,{encode:Te.function,serialize:Te.function},!0)),n.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?n.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:n.allowAbsoluteUrls=!0),Kn.assertOptions(n,{baseUrl:Te.spelling("baseURL"),withXsrfToken:Te.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let i=s&&w.merge(s.common,s[n.method]);s&&w.forEach(["delete","get","head","post","put","patch","query","common"],b=>{delete s[b]}),n.headers=Re.concat(i,s);const a=[];let c=!0;this.interceptors.request.forEach(function(g){if(typeof g.runWhen=="function"&&g.runWhen(n)===!1)return;c=c&&g.synchronous;const y=n.transitional||fs;y&&y.legacyInterceptorReqResOrdering?a.unshift(g.fulfilled,g.rejected):a.push(g.fulfilled,g.rejected)});const d=[];this.interceptors.response.forEach(function(g){d.push(g.fulfilled,g.rejected)});let f,u=0,h;if(!c){const b=[Ba.bind(this),void 0];for(b.unshift(...a),b.push(...d),h=b.length,f=Promise.resolve(n);u<h;)f=f.then(b[u++],b[u++]);return f}h=a.length;let m=n;for(;u<h;){const b=a[u++],g=a[u++];try{m=b(m)}catch(y){g.call(this,y);break}}try{f=Ba.call(this,m)}catch(b){return Promise.reject(b)}for(u=0,h=d.length;u<h;)f=f.then(d[u++],d[u++]);return f}getUri(t){t=Tt(this.defaults,t);const n=cl(t.baseURL,t.url,t.allowAbsoluteUrls,t);return rl(n,t.params,t.paramsSerializer)}};w.forEach(["delete","get","head","options"],function(t){yt.prototype[t]=function(n,r){return this.request(Tt(r||{},{method:t,url:n,data:r&&w.hasOwnProp(r,"data")?r.data:void 0}))}});w.forEach(["post","put","patch","query"],function(t){function n(r){return function(s,i,a){return this.request(Tt(a||{},{method:t,headers:r?{"Content-Type":"multipart/form-data"}:{},url:s,data:i}))}}yt.prototype[t]=n(),t!=="query"&&(yt.prototype[t+"Form"]=n(!0))});let by=class fl{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(s){n=s});const r=this;this.promise.then(o=>{if(!r._listeners)return;let s=r._listeners.length;for(;s-- >0;)r._listeners[s](o);r._listeners=null}),this.promise.then=o=>{let s;const i=new Promise(a=>{r.subscribe(a),s=a}).then(o);return i.cancel=function(){r.unsubscribe(s)},i},t(function(s,i,a){r.reason||(r.reason=new Rn(s,i,a),n(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const n=this._listeners.indexOf(t);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const t=new AbortController,n=r=>{t.abort(r)};return this.subscribe(n),t.signal.unsubscribe=()=>this.unsubscribe(n),t.signal}static source(){let t;return{token:new fl(function(o){t=o}),cancel:t}}};function xy(e){return function(n){return e.apply(null,n)}}function wy(e){return w.isObject(e)&&e.isAxiosError===!0}const To={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(To).forEach(([e,t])=>{To[t]=e});function pl(e){const t=new yt(e),n=Vc(yt.prototype.request,t);return w.extend(n,yt.prototype,t,{allOwnKeys:!0}),w.extend(n,t,null,{allOwnKeys:!0}),n.create=function(o){return pl(Tt(e,o))},n}const ue=pl(Tn);ue.Axios=yt;ue.CanceledError=Rn;ue.CancelToken=by;ue.isCancel=al;ue.VERSION=hs;ue.toFormData=yr;ue.AxiosError=N;ue.Cancel=ue.CanceledError;ue.all=function(t){return Promise.all(t)};ue.spread=xy;ue.isAxiosError=wy;ue.mergeConfig=Tt;ue.AxiosHeaders=Re;ue.formToJSON=e=>sl(w.isHTMLForm(e)?new FormData(e):e);ue.getAdapter=dl.getAdapter;ue.HttpStatusCode=To;ue.default=ue;const{Axios:cE,AxiosError:lE,CanceledError:uE,isCancel:dE,CancelToken:fE,VERSION:pE,all:hE,Cancel:mE,isAxiosError:gE,spread:vE,toFormData:yE,AxiosHeaders:bE,HttpStatusCode:xE,formToJSON:wE,getAdapter:EE,mergeConfig:SE,create:CE}=ue,Ey=e=>!e||e.length===0?null:[...new Set(e)].sort(),Sy=e=>!e||e.length===0?[]:[...new Set(e.map(t=>t.trim()).filter(Boolean))].sort(),Cy=e=>!e||e.length===0?null:[...new Set(e)].sort(),TE={notes:{all:()=>["notes"],listAll:()=>["notes","list"],list:(e={})=>["notes","list",{limit:e.limit??25,offset:e.offset??0,query:e.query??"",sortBy:e.sortBy??null,sortOrder:e.sortOrder??null,pinnedFirst:e.pinnedFirst??null,fields:Ey(e.fields)}],tagListAll:()=>["notes","tag-list"],tagList:(e={})=>["notes","tag-list",{limit:e.limit??25,offset:e.offset??0,query:e.query??""}],tagNameListAll:()=>["notes","tag-name-list"],tagNameList:e=>["notes","tag-name-list",{limit:e.limit??25,offset:e.offset??0,mode:e.mode??"and",tagNames:Sy(e.tagNames)}],detail:e=>["notes","detail",{id:e}],snapshots:(e,t=10)=>["notes","snapshots",{id:e,limit:t}],snapshotDetail:e=>["notes","snapshot-detail",{id:e}],trashAll:()=>["notes","trash"],trash:(e={})=>["notes","trash",{limit:e.limit??25,offset:e.offset??0}],trashDetail:e=>["notes","trash","detail",{id:e}],pinned:()=>["notes","pinned"],backReferencesAll:()=>["notes","back-references"],backReferences:e=>["notes","back-references",{noteId:e}],graph:()=>["notes","graph"],propertyKeysAll:()=>["notes","property-keys"],propertyKeys:(e={})=>["notes","property-keys",{query:e.query??"",limit:e.limit??50,offset:e.offset??0}]},tags:{all:()=>["tags"],list:(e={})=>["tags","list",{limit:e.limit??50,offset:e.offset??0,query:e.query??"",sortBy:e.sortBy??"referenceCount",sortOrder:e.sortOrder??"desc"}]},images:{all:()=>["images"],listAll:()=>["images","list"],list:(e={})=>["images","list",{limit:e.limit??50,offset:e.offset??0}],detail:e=>["images","detail",{id:e}],notes:e=>["images","notes",{id:e}]},reminders:{all:()=>["reminders"],note:(e,t={})=>["reminders","note",e,{limit:t.limit??10,offset:t.offset??0}],noteAllPages:e=>["reminders","note",e],upcoming:(e={})=>["reminders","upcoming",{limit:e.limit??10,offset:e.offset??0}],upcomingAllPages:()=>["reminders","upcoming"],inDateRangeAll:()=>["reminders","in-date-range"],inDateRange:(e,t)=>["reminders","in-date-range",{year:e,month:t}]},placeholders:{all:()=>["placeholders"],listAll:()=>["placeholders","list"],list:(e={})=>["placeholders","list",{limit:e.limit??25,offset:e.offset??0,query:e.query??"",fields:Cy(e.fields)}]},calendar:{all:()=>["calendar"],notesInDateRange:(e,t)=>["calendar","notes-in-date-range",{year:e,month:t}]},views:{all:()=>["views"],workspace:()=>["views","workspace"],section:e=>["views","section",{id:e}],sectionNotesAll:()=>["views","section-notes"],sectionNotes:(e,t={})=>["views","section-notes",{id:e,limit:t.limit??25,offset:t.offset??0}]},ui:{heroBanner:()=>["ui","hero-banner"]}},Ty={sm:"w-4 h-4",md:"w-5 h-5",lg:"w-6 h-6"},Ha={sm:10,md:12,lg:14},Ry=l.forwardRef(({className:e,size:t="md",checked:n,disabled:r,...o},s)=>p.jsxs("label",{className:fe("relative inline-flex items-center justify-center cursor-pointer",r&&"cursor-not-allowed opacity-50",e),children:[p.jsx("input",{ref:s,type:"checkbox",checked:n,disabled:r,className:"sr-only peer",...o}),p.jsx("span",{className:fe(Ty[t],"flex items-center justify-center","border border-border-secondary","rounded-[6px]","bg-surface","transition-all duration-200","peer-checked:bg-cta","peer-checked:border-cta","focus-ring-soft","peer-focus-visible:border-border-focus","peer-focus-visible:shadow-[0_0_0_4px_color-mix(in_srgb,var(--accent-soft-primary)_90%,transparent)]"),children:n&&p.jsx(Fm,{width:Ha[t],height:Ha[t],className:"text-fg-on-filled",weight:"bold"})})]}));Ry.displayName="Checkbox";var Py=lc,Ay=uc,hl=dc,ml=fc,Oy=rs,gl=pc,vl=hc;const Ny=Py,_y=Ay,Iy=Oy,yl=l.createContext("default"),Pn=()=>l.useContext(yl),bl=l.forwardRef(({className:e,...t},n)=>p.jsx(hl,{ref:n,className:fe("fixed","inset-0","z-[1090]","bg-overlay","backdrop-blur-[2px]","data-[state=open]:animate-in","data-[state=closed]:animate-out","data-[state=closed]:fade-out-0","data-[state=open]:fade-in-0",e),...t}));bl.displayName=hl.displayName;const xl=l.forwardRef(({className:e,children:t,variant:n="default",...r},o)=>p.jsxs(_y,{children:[p.jsx(bl,{}),p.jsx("div",{className:"pointer-events-none fixed inset-0 z-[1100] flex items-center justify-center p-4",children:p.jsx(ml,{ref:o,"data-dialog-variant":n,className:os({variant:n,className:e}),...r,children:p.jsx(yl.Provider,{value:n,children:t})})})]}));xl.displayName=ml.displayName;const wl=({title:e,onClose:t,className:n})=>{const r=Pn();return p.jsxs("div",{className:Hm({variant:r,className:n}),children:[p.jsx(Cl,{children:e}),t&&p.jsx(Iy,{asChild:!0,children:p.jsx("button",{type:"button","aria-label":"Close dialog",className:Vm({variant:r}),onClick:t,children:p.jsx(Bm,{className:r==="compact"||r==="form"||r==="confirm"?"h-[18px] w-[18px]":"h-5 w-5"})})})]})};wl.displayName="DialogHeader";const El=l.forwardRef(({className:e,...t},n)=>{const r=Pn();return p.jsx("div",{ref:n,className:ss({variant:r,className:e}),...t})});El.displayName="DialogBody";const Sl=l.forwardRef(({className:e,...t},n)=>{const r=Pn();return p.jsx("div",{ref:n,className:as({variant:r,className:e}),...t})});Sl.displayName="DialogFooter";const Cl=l.forwardRef(({className:e,...t},n)=>{const r=Pn();return p.jsx(gl,{ref:n,className:fe(is({variant:r}),e),...t})});Cl.displayName=gl.displayName;const Tl=l.forwardRef(({className:e,...t},n)=>{const r=Pn();return p.jsx(vl,{ref:n,className:fe(cs({variant:r}),e),...t})});Tl.displayName=vl.displayName;const xr=({isOpen:e,onClose:t,children:n,className:r,variant:o="default"})=>p.jsx(Ny,{open:e,onOpenChange:s=>!s&&t(),children:p.jsx(xl,{variant:o,className:r,children:n})});xr.Header=wl;xr.Body=El;xr.Footer=Sl;xr.Description=Tl;function gs(e){const t=e+"CollectionProvider",[n,r]=Xe(t),[o,s]=n(t,{collectionRef:{current:null},itemMap:new Map}),i=g=>{const{scope:y,children:v}=g,x=C.useRef(null),E=C.useRef(new Map).current;return p.jsx(o,{scope:y,itemMap:E,collectionRef:x,children:v})};i.displayName=t;const a=e+"CollectionSlot",c=Gt(a),d=C.forwardRef((g,y)=>{const{scope:v,children:x}=g,E=s(a,v),S=re(y,E.collectionRef);return p.jsx(c,{ref:S,children:x})});d.displayName=a;const f=e+"CollectionItemSlot",u="data-radix-collection-item",h=Gt(f),m=C.forwardRef((g,y)=>{const{scope:v,children:x,...E}=g,S=C.useRef(null),T=re(y,S),P=s(f,v);return C.useEffect(()=>(P.itemMap.set(S,{ref:S,...E}),()=>{P.itemMap.delete(S)})),p.jsx(h,{[u]:"",ref:T,children:x})});m.displayName=f;function b(g){const y=s(e+"CollectionConsumer",g);return C.useCallback(()=>{const x=y.collectionRef.current;if(!x)return[];const E=Array.from(x.querySelectorAll(`[${u}]`));return Array.from(y.itemMap.values()).sort((P,R)=>E.indexOf(P.ref.current)-E.indexOf(R.ref.current))},[y.collectionRef,y.itemMap])}return[{Provider:i,Slot:d,ItemSlot:m},b,r]}var My=l.createContext(void 0);function wr(e){const t=l.useContext(My);return e||t||"ltr"}var Dy="Arrow",Rl=l.forwardRef((e,t)=>{const{children:n,width:r=10,height:o=5,...s}=e;return p.jsx(Y.svg,{...s,ref:t,width:r,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:p.jsx("polygon",{points:"0,0 30,0 15,10"})})});Rl.displayName=Dy;var jy=Rl;function Ly(e){const[t,n]=l.useState(void 0);return Pe(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;const s=o[0];let i,a;if("borderBoxSize"in s){const c=s.borderBoxSize,d=Array.isArray(c)?c[0]:c;i=d.inlineSize,a=d.blockSize}else i=e.offsetWidth,a=e.offsetHeight;n({width:i,height:a})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}var vs="Popper",[Pl,Jt]=Xe(vs),[ky,Al]=Pl(vs),Ol=e=>{const{__scopePopper:t,children:n}=e,[r,o]=l.useState(null);return p.jsx(ky,{scope:t,anchor:r,onAnchorChange:o,children:n})};Ol.displayName=vs;var Nl="PopperAnchor",_l=l.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...o}=e,s=Al(Nl,n),i=l.useRef(null),a=re(t,i),c=l.useRef(null);return l.useEffect(()=>{const d=c.current;c.current=r?.current||i.current,d!==c.current&&s.onAnchorChange(c.current)}),r?null:p.jsx(Y.div,{...o,ref:a})});_l.displayName=Nl;var ys="PopperContent",[Fy,$y]=Pl(ys),Il=l.forwardRef((e,t)=>{const{__scopePopper:n,side:r="bottom",sideOffset:o=0,align:s="center",alignOffset:i=0,arrowPadding:a=0,avoidCollisions:c=!0,collisionBoundary:d=[],collisionPadding:f=0,sticky:u="partial",hideWhenDetached:h=!1,updatePositionStrategy:m="optimized",onPlaced:b,...g}=e,y=Al(ys,n),[v,x]=l.useState(null),E=re(t,O=>x(O)),[S,T]=l.useState(null),P=Ly(S),R=P?.width??0,A=P?.height??0,_=r+(s!=="center"?"-"+s:""),D=typeof f=="number"?f:{top:0,right:0,bottom:0,left:0,...f},k=Array.isArray(d)?d:[d],U=k.length>0,H={padding:D,boundary:k.filter(Uy),altBoundary:U},{refs:Q,floatingStyles:ne,placement:L,isPositioned:Z,middlewareData:te}=Kd({strategy:"fixed",placement:_,whileElementsMounted:(...O)=>tf(...O,{animationFrame:m==="always"}),elements:{reference:y.anchor},middleware:[Zd({mainAxis:o+A,alignmentAxis:i}),c&&Qd({mainAxis:!0,crossAxis:!1,limiter:u==="partial"?nf():void 0,...H}),c&&Yd({...H}),Xd({...H,apply:({elements:O,rects:j,availableWidth:oe,availableHeight:ee})=>{const{width:X,height:G}=j.reference,me=O.floating.style;me.setProperty("--radix-popper-available-width",`${oe}px`),me.setProperty("--radix-popper-available-height",`${ee}px`),me.setProperty("--radix-popper-anchor-width",`${X}px`),me.setProperty("--radix-popper-anchor-height",`${G}px`)}}),S&&Jd({element:S,padding:a}),Hy({arrowWidth:R,arrowHeight:A}),h&&ef({strategy:"referenceHidden",...H})]}),[I,J]=jl(L),W=Ye(b);Pe(()=>{Z&&W?.()},[Z,W]);const ae=te.arrow?.x,$=te.arrow?.y,q=te.arrow?.centerOffset!==0,[V,F]=l.useState();return Pe(()=>{v&&F(window.getComputedStyle(v).zIndex)},[v]),p.jsx("div",{ref:Q.setFloating,"data-radix-popper-content-wrapper":"",style:{...ne,transform:Z?ne.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:V,"--radix-popper-transform-origin":[te.transformOrigin?.x,te.transformOrigin?.y].join(" "),...te.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:p.jsx(Fy,{scope:n,placedSide:I,onArrowChange:T,arrowX:ae,arrowY:$,shouldHideArrow:q,children:p.jsx(Y.div,{"data-side":I,"data-align":J,...g,ref:E,style:{...g.style,animation:Z?void 0:"none"}})})})});Il.displayName=ys;var Ml="PopperArrow",By={top:"bottom",right:"left",bottom:"top",left:"right"},Dl=l.forwardRef(function(t,n){const{__scopePopper:r,...o}=t,s=$y(Ml,r),i=By[s.placedSide];return p.jsx("span",{ref:s.onArrowChange,style:{position:"absolute",left:s.arrowX,top:s.arrowY,[i]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[s.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[s.placedSide],visibility:s.shouldHideArrow?"hidden":void 0},children:p.jsx(jy,{...o,ref:n,style:{...o.style,display:"block"}})})});Dl.displayName=Ml;function Uy(e){return e!==null}var Hy=e=>({name:"transformOrigin",options:e,fn(t){const{placement:n,rects:r,middlewareData:o}=t,i=o.arrow?.centerOffset!==0,a=i?0:e.arrowWidth,c=i?0:e.arrowHeight,[d,f]=jl(n),u={start:"0%",center:"50%",end:"100%"}[f],h=(o.arrow?.x??0)+a/2,m=(o.arrow?.y??0)+c/2;let b="",g="";return d==="bottom"?(b=i?u:`${h}px`,g=`${-c}px`):d==="top"?(b=i?u:`${h}px`,g=`${r.floating.height+c}px`):d==="right"?(b=`${-c}px`,g=i?u:`${m}px`):d==="left"&&(b=`${r.floating.width+c}px`,g=i?u:`${m}px`),{data:{x:b,y:g}}}});function jl(e){const[t,n="center"]=e.split("-");return[t,n]}var bs=Ol,xs=_l,ws=Il,Es=Dl,eo="rovingFocusGroup.onEntryFocus",Vy={bubbles:!1,cancelable:!0},An="RovingFocusGroup",[Ro,Ll,qy]=gs(An),[Wy,Er]=Xe(An,[qy]),[zy,Gy]=Wy(An),kl=l.forwardRef((e,t)=>p.jsx(Ro.Provider,{scope:e.__scopeRovingFocusGroup,children:p.jsx(Ro.Slot,{scope:e.__scopeRovingFocusGroup,children:p.jsx(Ky,{...e,ref:t})})}));kl.displayName=An;var Ky=l.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:o=!1,dir:s,currentTabStopId:i,defaultCurrentTabStopId:a,onCurrentTabStopIdChange:c,onEntryFocus:d,preventScrollOnEntryFocus:f=!1,...u}=e,h=l.useRef(null),m=re(t,h),b=wr(s),[g,y]=nt({prop:i,defaultProp:a??null,onChange:c,caller:An}),[v,x]=l.useState(!1),E=Ye(d),S=Ll(n),T=l.useRef(!1),[P,R]=l.useState(0);return l.useEffect(()=>{const A=h.current;if(A)return A.addEventListener(eo,E),()=>A.removeEventListener(eo,E)},[E]),p.jsx(zy,{scope:n,orientation:r,dir:b,loop:o,currentTabStopId:g,onItemFocus:l.useCallback(A=>y(A),[y]),onItemShiftTab:l.useCallback(()=>x(!0),[]),onFocusableItemAdd:l.useCallback(()=>R(A=>A+1),[]),onFocusableItemRemove:l.useCallback(()=>R(A=>A-1),[]),children:p.jsx(Y.div,{tabIndex:v||P===0?-1:0,"data-orientation":r,...u,ref:m,style:{outline:"none",...e.style},onMouseDown:M(e.onMouseDown,()=>{T.current=!0}),onFocus:M(e.onFocus,A=>{const _=!T.current;if(A.target===A.currentTarget&&_&&!v){const D=new CustomEvent(eo,Vy);if(A.currentTarget.dispatchEvent(D),!D.defaultPrevented){const k=S().filter(L=>L.focusable),U=k.find(L=>L.active),H=k.find(L=>L.id===g),ne=[U,H,...k].filter(Boolean).map(L=>L.ref.current);Bl(ne,f)}}T.current=!1}),onBlur:M(e.onBlur,()=>x(!1))})})}),Fl="RovingFocusGroupItem",$l=l.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:o=!1,tabStopId:s,children:i,...a}=e,c=Ze(),d=s||c,f=Gy(Fl,n),u=f.currentTabStopId===d,h=Ll(n),{onFocusableItemAdd:m,onFocusableItemRemove:b,currentTabStopId:g}=f;return l.useEffect(()=>{if(r)return m(),()=>b()},[r,m,b]),p.jsx(Ro.ItemSlot,{scope:n,id:d,focusable:r,active:o,children:p.jsx(Y.span,{tabIndex:u?0:-1,"data-orientation":f.orientation,...a,ref:t,onMouseDown:M(e.onMouseDown,y=>{r?f.onItemFocus(d):y.preventDefault()}),onFocus:M(e.onFocus,()=>f.onItemFocus(d)),onKeyDown:M(e.onKeyDown,y=>{if(y.key==="Tab"&&y.shiftKey){f.onItemShiftTab();return}if(y.target!==y.currentTarget)return;const v=Yy(y,f.orientation,f.dir);if(v!==void 0){if(y.metaKey||y.ctrlKey||y.altKey||y.shiftKey)return;y.preventDefault();let E=h().filter(S=>S.focusable).map(S=>S.ref.current);if(v==="last")E.reverse();else if(v==="prev"||v==="next"){v==="prev"&&E.reverse();const S=E.indexOf(y.currentTarget);E=f.loop?Xy(E,S+1):E.slice(S+1)}setTimeout(()=>Bl(E))}}),children:typeof i=="function"?i({isCurrentTabStop:u,hasTabStop:g!=null}):i})})});$l.displayName=Fl;var Zy={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function Qy(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function Yy(e,t,n){const r=Qy(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return Zy[r]}function Bl(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function Xy(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var Ul=kl,Hl=$l,Po=["Enter"," "],Jy=["ArrowDown","PageUp","Home"],Vl=["ArrowUp","PageDown","End"],e0=[...Jy,...Vl],t0={ltr:[...Po,"ArrowRight"],rtl:[...Po,"ArrowLeft"]},n0={ltr:["ArrowLeft"],rtl:["ArrowRight"]},On="Menu",[hn,r0,o0]=gs(On),[Ot,ql]=Xe(On,[o0,Jt,Er]),Sr=Jt(),Wl=Er(),[s0,Nt]=Ot(On),[a0,Nn]=Ot(On),zl=e=>{const{__scopeMenu:t,open:n=!1,children:r,dir:o,onOpenChange:s,modal:i=!0}=e,a=Sr(t),[c,d]=l.useState(null),f=l.useRef(!1),u=Ye(s),h=wr(o);return l.useEffect(()=>{const m=()=>{f.current=!0,document.addEventListener("pointerdown",b,{capture:!0,once:!0}),document.addEventListener("pointermove",b,{capture:!0,once:!0})},b=()=>f.current=!1;return document.addEventListener("keydown",m,{capture:!0}),()=>{document.removeEventListener("keydown",m,{capture:!0}),document.removeEventListener("pointerdown",b,{capture:!0}),document.removeEventListener("pointermove",b,{capture:!0})}},[]),p.jsx(bs,{...a,children:p.jsx(s0,{scope:t,open:n,onOpenChange:u,content:c,onContentChange:d,children:p.jsx(a0,{scope:t,onClose:l.useCallback(()=>u(!1),[u]),isUsingKeyboardRef:f,dir:h,modal:i,children:r})})})};zl.displayName=On;var i0="MenuAnchor",Ss=l.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,o=Sr(n);return p.jsx(xs,{...o,...r,ref:t})});Ss.displayName=i0;var Cs="MenuPortal",[c0,Gl]=Ot(Cs,{forceMount:void 0}),Kl=e=>{const{__scopeMenu:t,forceMount:n,children:r,container:o}=e,s=Nt(Cs,t);return p.jsx(c0,{scope:t,forceMount:n,children:p.jsx(Je,{present:n||s.open,children:p.jsx(En,{asChild:!0,container:o,children:r})})})};Kl.displayName=Cs;var Be="MenuContent",[l0,Ts]=Ot(Be),Zl=l.forwardRef((e,t)=>{const n=Gl(Be,e.__scopeMenu),{forceMount:r=n.forceMount,...o}=e,s=Nt(Be,e.__scopeMenu),i=Nn(Be,e.__scopeMenu);return p.jsx(hn.Provider,{scope:e.__scopeMenu,children:p.jsx(Je,{present:r||s.open,children:p.jsx(hn.Slot,{scope:e.__scopeMenu,children:i.modal?p.jsx(u0,{...o,ref:t}):p.jsx(d0,{...o,ref:t})})})})}),u0=l.forwardRef((e,t)=>{const n=Nt(Be,e.__scopeMenu),r=l.useRef(null),o=re(t,r);return l.useEffect(()=>{const s=r.current;if(s)return Jo(s)},[]),p.jsx(Rs,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:M(e.onFocusOutside,s=>s.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),d0=l.forwardRef((e,t)=>{const n=Nt(Be,e.__scopeMenu);return p.jsx(Rs,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),f0=Gt("MenuContent.ScrollLock"),Rs=l.forwardRef((e,t)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:o,onOpenAutoFocus:s,onCloseAutoFocus:i,disableOutsidePointerEvents:a,onEntryFocus:c,onEscapeKeyDown:d,onPointerDownOutside:f,onFocusOutside:u,onInteractOutside:h,onDismiss:m,disableOutsideScroll:b,...g}=e,y=Nt(Be,n),v=Nn(Be,n),x=Sr(n),E=Wl(n),S=r0(n),[T,P]=l.useState(null),R=l.useRef(null),A=re(t,R,y.onContentChange),_=l.useRef(0),D=l.useRef(""),k=l.useRef(0),U=l.useRef(null),H=l.useRef("right"),Q=l.useRef(0),ne=b?mr:l.Fragment,L=b?{as:f0,allowPinchZoom:!0}:void 0,Z=I=>{const J=D.current+I,W=S().filter(O=>!O.disabled),ae=document.activeElement,$=W.find(O=>O.ref.current===ae)?.textValue,q=W.map(O=>O.textValue),V=C0(q,J,$),F=W.find(O=>O.textValue===V)?.ref.current;(function O(j){D.current=j,window.clearTimeout(_.current),j!==""&&(_.current=window.setTimeout(()=>O(""),1e3))})(J),F&&setTimeout(()=>F.focus())};l.useEffect(()=>()=>window.clearTimeout(_.current),[]),Xo();const te=l.useCallback(I=>H.current===U.current?.side&&R0(I,U.current?.area),[]);return p.jsx(l0,{scope:n,searchRef:D,onItemEnter:l.useCallback(I=>{te(I)&&I.preventDefault()},[te]),onItemLeave:l.useCallback(I=>{te(I)||(R.current?.focus(),P(null))},[te]),onTriggerLeave:l.useCallback(I=>{te(I)&&I.preventDefault()},[te]),pointerGraceTimerRef:k,onPointerGraceIntentChange:l.useCallback(I=>{U.current=I},[]),children:p.jsx(ne,{...L,children:p.jsx(pr,{asChild:!0,trapped:o,onMountAutoFocus:M(s,I=>{I.preventDefault(),R.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:i,children:p.jsx(wn,{asChild:!0,disableOutsidePointerEvents:a,onEscapeKeyDown:d,onPointerDownOutside:f,onFocusOutside:u,onInteractOutside:h,onDismiss:m,children:p.jsx(Ul,{asChild:!0,...E,dir:v.dir,orientation:"vertical",loop:r,currentTabStopId:T,onCurrentTabStopIdChange:P,onEntryFocus:M(c,I=>{v.isUsingKeyboardRef.current||I.preventDefault()}),preventScrollOnEntryFocus:!0,children:p.jsx(ws,{role:"menu","aria-orientation":"vertical","data-state":du(y.open),"data-radix-menu-content":"",dir:v.dir,...x,...g,ref:A,style:{outline:"none",...g.style},onKeyDown:M(g.onKeyDown,I=>{const W=I.target.closest("[data-radix-menu-content]")===I.currentTarget,ae=I.ctrlKey||I.altKey||I.metaKey,$=I.key.length===1;W&&(I.key==="Tab"&&I.preventDefault(),!ae&&$&&Z(I.key));const q=R.current;if(I.target!==q||!e0.includes(I.key))return;I.preventDefault();const F=S().filter(O=>!O.disabled).map(O=>O.ref.current);Vl.includes(I.key)&&F.reverse(),E0(F)}),onBlur:M(e.onBlur,I=>{I.currentTarget.contains(I.target)||(window.clearTimeout(_.current),D.current="")}),onPointerMove:M(e.onPointerMove,mn(I=>{const J=I.target,W=Q.current!==I.clientX;if(I.currentTarget.contains(J)&&W){const ae=I.clientX>Q.current?"right":"left";H.current=ae,Q.current=I.clientX}}))})})})})})})});Zl.displayName=Be;var p0="MenuGroup",Ps=l.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return p.jsx(Y.div,{role:"group",...r,ref:t})});Ps.displayName=p0;var h0="MenuLabel",Ql=l.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return p.jsx(Y.div,{...r,ref:t})});Ql.displayName=h0;var or="MenuItem",Va="menu.itemSelect",Cr=l.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:r,...o}=e,s=l.useRef(null),i=Nn(or,e.__scopeMenu),a=Ts(or,e.__scopeMenu),c=re(t,s),d=l.useRef(!1),f=()=>{const u=s.current;if(!n&&u){const h=new CustomEvent(Va,{bubbles:!0,cancelable:!0});u.addEventListener(Va,m=>r?.(m),{once:!0}),Di(u,h),h.defaultPrevented?d.current=!1:i.onClose()}};return p.jsx(Yl,{...o,ref:c,disabled:n,onClick:M(e.onClick,f),onPointerDown:u=>{e.onPointerDown?.(u),d.current=!0},onPointerUp:M(e.onPointerUp,u=>{d.current||u.currentTarget?.click()}),onKeyDown:M(e.onKeyDown,u=>{const h=a.searchRef.current!=="";n||h&&u.key===" "||Po.includes(u.key)&&(u.currentTarget.click(),u.preventDefault())})})});Cr.displayName=or;var Yl=l.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:r=!1,textValue:o,...s}=e,i=Ts(or,n),a=Wl(n),c=l.useRef(null),d=re(t,c),[f,u]=l.useState(!1),[h,m]=l.useState("");return l.useEffect(()=>{const b=c.current;b&&m((b.textContent??"").trim())},[s.children]),p.jsx(hn.ItemSlot,{scope:n,disabled:r,textValue:o??h,children:p.jsx(Hl,{asChild:!0,...a,focusable:!r,children:p.jsx(Y.div,{role:"menuitem","data-highlighted":f?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...s,ref:d,onPointerMove:M(e.onPointerMove,mn(b=>{r?i.onItemLeave(b):(i.onItemEnter(b),b.defaultPrevented||b.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:M(e.onPointerLeave,mn(b=>i.onItemLeave(b))),onFocus:M(e.onFocus,()=>u(!0)),onBlur:M(e.onBlur,()=>u(!1))})})})}),m0="MenuCheckboxItem",Xl=l.forwardRef((e,t)=>{const{checked:n=!1,onCheckedChange:r,...o}=e;return p.jsx(ru,{scope:e.__scopeMenu,checked:n,children:p.jsx(Cr,{role:"menuitemcheckbox","aria-checked":sr(n)?"mixed":n,...o,ref:t,"data-state":Os(n),onSelect:M(o.onSelect,()=>r?.(sr(n)?!0:!n),{checkForDefaultPrevented:!1})})})});Xl.displayName=m0;var Jl="MenuRadioGroup",[g0,v0]=Ot(Jl,{value:void 0,onValueChange:()=>{}}),eu=l.forwardRef((e,t)=>{const{value:n,onValueChange:r,...o}=e,s=Ye(r);return p.jsx(g0,{scope:e.__scopeMenu,value:n,onValueChange:s,children:p.jsx(Ps,{...o,ref:t})})});eu.displayName=Jl;var tu="MenuRadioItem",nu=l.forwardRef((e,t)=>{const{value:n,...r}=e,o=v0(tu,e.__scopeMenu),s=n===o.value;return p.jsx(ru,{scope:e.__scopeMenu,checked:s,children:p.jsx(Cr,{role:"menuitemradio","aria-checked":s,...r,ref:t,"data-state":Os(s),onSelect:M(r.onSelect,()=>o.onValueChange?.(n),{checkForDefaultPrevented:!1})})})});nu.displayName=tu;var As="MenuItemIndicator",[ru,y0]=Ot(As,{checked:!1}),ou=l.forwardRef((e,t)=>{const{__scopeMenu:n,forceMount:r,...o}=e,s=y0(As,n);return p.jsx(Je,{present:r||sr(s.checked)||s.checked===!0,children:p.jsx(Y.span,{...o,ref:t,"data-state":Os(s.checked)})})});ou.displayName=As;var b0="MenuSeparator",su=l.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return p.jsx(Y.div,{role:"separator","aria-orientation":"horizontal",...r,ref:t})});su.displayName=b0;var x0="MenuArrow",au=l.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,o=Sr(n);return p.jsx(Es,{...o,...r,ref:t})});au.displayName=x0;var w0="MenuSub",[RE,iu]=Ot(w0),cn="MenuSubTrigger",cu=l.forwardRef((e,t)=>{const n=Nt(cn,e.__scopeMenu),r=Nn(cn,e.__scopeMenu),o=iu(cn,e.__scopeMenu),s=Ts(cn,e.__scopeMenu),i=l.useRef(null),{pointerGraceTimerRef:a,onPointerGraceIntentChange:c}=s,d={__scopeMenu:e.__scopeMenu},f=l.useCallback(()=>{i.current&&window.clearTimeout(i.current),i.current=null},[]);return l.useEffect(()=>f,[f]),l.useEffect(()=>{const u=a.current;return()=>{window.clearTimeout(u),c(null)}},[a,c]),p.jsx(Ss,{asChild:!0,...d,children:p.jsx(Yl,{id:o.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":o.contentId,"data-state":du(n.open),...e,ref:xn(t,o.onTriggerChange),onClick:u=>{e.onClick?.(u),!(e.disabled||u.defaultPrevented)&&(u.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:M(e.onPointerMove,mn(u=>{s.onItemEnter(u),!u.defaultPrevented&&!e.disabled&&!n.open&&!i.current&&(s.onPointerGraceIntentChange(null),i.current=window.setTimeout(()=>{n.onOpenChange(!0),f()},100))})),onPointerLeave:M(e.onPointerLeave,mn(u=>{f();const h=n.content?.getBoundingClientRect();if(h){const m=n.content?.dataset.side,b=m==="right",g=b?-5:5,y=h[b?"left":"right"],v=h[b?"right":"left"];s.onPointerGraceIntentChange({area:[{x:u.clientX+g,y:u.clientY},{x:y,y:h.top},{x:v,y:h.top},{x:v,y:h.bottom},{x:y,y:h.bottom}],side:m}),window.clearTimeout(a.current),a.current=window.setTimeout(()=>s.onPointerGraceIntentChange(null),300)}else{if(s.onTriggerLeave(u),u.defaultPrevented)return;s.onPointerGraceIntentChange(null)}})),onKeyDown:M(e.onKeyDown,u=>{const h=s.searchRef.current!=="";e.disabled||h&&u.key===" "||t0[r.dir].includes(u.key)&&(n.onOpenChange(!0),n.content?.focus(),u.preventDefault())})})})});cu.displayName=cn;var lu="MenuSubContent",uu=l.forwardRef((e,t)=>{const n=Gl(Be,e.__scopeMenu),{forceMount:r=n.forceMount,...o}=e,s=Nt(Be,e.__scopeMenu),i=Nn(Be,e.__scopeMenu),a=iu(lu,e.__scopeMenu),c=l.useRef(null),d=re(t,c);return p.jsx(hn.Provider,{scope:e.__scopeMenu,children:p.jsx(Je,{present:r||s.open,children:p.jsx(hn.Slot,{scope:e.__scopeMenu,children:p.jsx(Rs,{id:a.contentId,"aria-labelledby":a.triggerId,...o,ref:d,align:"start",side:i.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:f=>{i.isUsingKeyboardRef.current&&c.current?.focus(),f.preventDefault()},onCloseAutoFocus:f=>f.preventDefault(),onFocusOutside:M(e.onFocusOutside,f=>{f.target!==a.trigger&&s.onOpenChange(!1)}),onEscapeKeyDown:M(e.onEscapeKeyDown,f=>{i.onClose(),f.preventDefault()}),onKeyDown:M(e.onKeyDown,f=>{const u=f.currentTarget.contains(f.target),h=n0[i.dir].includes(f.key);u&&h&&(s.onOpenChange(!1),a.trigger?.focus(),f.preventDefault())})})})})})});uu.displayName=lu;function du(e){return e?"open":"closed"}function sr(e){return e==="indeterminate"}function Os(e){return sr(e)?"indeterminate":e?"checked":"unchecked"}function E0(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function S0(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function C0(e,t,n){const o=t.length>1&&Array.from(t).every(d=>d===t[0])?t[0]:t,s=n?e.indexOf(n):-1;let i=S0(e,Math.max(s,0));o.length===1&&(i=i.filter(d=>d!==n));const c=i.find(d=>d.toLowerCase().startsWith(o.toLowerCase()));return c!==n?c:void 0}function T0(e,t){const{x:n,y:r}=e;let o=!1;for(let s=0,i=t.length-1;s<t.length;i=s++){const a=t[s],c=t[i],d=a.x,f=a.y,u=c.x,h=c.y;f>r!=h>r&&n<(u-d)*(r-f)/(h-f)+d&&(o=!o)}return o}function R0(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return T0(n,t)}function mn(e){return t=>t.pointerType==="mouse"?e(t):void 0}var P0=zl,A0=Ss,O0=Kl,N0=Zl,_0=Ps,I0=Ql,M0=Cr,D0=Xl,j0=eu,L0=nu,k0=ou,F0=su,$0=au,B0=cu,U0=uu,Tr="DropdownMenu",[H0]=Xe(Tr,[ql]),Oe=ql(),[V0,fu]=H0(Tr),pu=e=>{const{__scopeDropdownMenu:t,children:n,dir:r,open:o,defaultOpen:s,onOpenChange:i,modal:a=!0}=e,c=Oe(t),d=l.useRef(null),[f,u]=nt({prop:o,defaultProp:s??!1,onChange:i,caller:Tr});return p.jsx(V0,{scope:t,triggerId:Ze(),triggerRef:d,contentId:Ze(),open:f,onOpenChange:u,onOpenToggle:l.useCallback(()=>u(h=>!h),[u]),modal:a,children:p.jsx(P0,{...c,open:f,onOpenChange:u,dir:r,modal:a,children:n})})};pu.displayName=Tr;var hu="DropdownMenuTrigger",mu=l.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,disabled:r=!1,...o}=e,s=fu(hu,n),i=Oe(n);return p.jsx(A0,{asChild:!0,...i,children:p.jsx(Y.button,{type:"button",id:s.triggerId,"aria-haspopup":"menu","aria-expanded":s.open,"aria-controls":s.open?s.contentId:void 0,"data-state":s.open?"open":"closed","data-disabled":r?"":void 0,disabled:r,...o,ref:xn(t,s.triggerRef),onPointerDown:M(e.onPointerDown,a=>{!r&&a.button===0&&a.ctrlKey===!1&&(s.onOpenToggle(),s.open||a.preventDefault())}),onKeyDown:M(e.onKeyDown,a=>{r||(["Enter"," "].includes(a.key)&&s.onOpenToggle(),a.key==="ArrowDown"&&s.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(a.key)&&a.preventDefault())})})})});mu.displayName=hu;var q0="DropdownMenuPortal",gu=e=>{const{__scopeDropdownMenu:t,...n}=e,r=Oe(t);return p.jsx(O0,{...r,...n})};gu.displayName=q0;var vu="DropdownMenuContent",yu=l.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=fu(vu,n),s=Oe(n),i=l.useRef(!1);return p.jsx(N0,{id:o.contentId,"aria-labelledby":o.triggerId,...s,...r,ref:t,onCloseAutoFocus:M(e.onCloseAutoFocus,a=>{i.current||o.triggerRef.current?.focus(),i.current=!1,a.preventDefault()}),onInteractOutside:M(e.onInteractOutside,a=>{const c=a.detail.originalEvent,d=c.button===0&&c.ctrlKey===!0,f=c.button===2||d;(!o.modal||f)&&(i.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});yu.displayName=vu;var W0="DropdownMenuGroup",z0=l.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Oe(n);return p.jsx(_0,{...o,...r,ref:t})});z0.displayName=W0;var G0="DropdownMenuLabel",bu=l.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Oe(n);return p.jsx(I0,{...o,...r,ref:t})});bu.displayName=G0;var K0="DropdownMenuItem",xu=l.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Oe(n);return p.jsx(M0,{...o,...r,ref:t})});xu.displayName=K0;var Z0="DropdownMenuCheckboxItem",wu=l.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Oe(n);return p.jsx(D0,{...o,...r,ref:t})});wu.displayName=Z0;var Q0="DropdownMenuRadioGroup",Y0=l.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Oe(n);return p.jsx(j0,{...o,...r,ref:t})});Y0.displayName=Q0;var X0="DropdownMenuRadioItem",Eu=l.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Oe(n);return p.jsx(L0,{...o,...r,ref:t})});Eu.displayName=X0;var J0="DropdownMenuItemIndicator",Su=l.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Oe(n);return p.jsx(k0,{...o,...r,ref:t})});Su.displayName=J0;var eb="DropdownMenuSeparator",Cu=l.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Oe(n);return p.jsx(F0,{...o,...r,ref:t})});Cu.displayName=eb;var tb="DropdownMenuArrow",nb=l.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Oe(n);return p.jsx($0,{...o,...r,ref:t})});nb.displayName=tb;var rb="DropdownMenuSubTrigger",Tu=l.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Oe(n);return p.jsx(B0,{...o,...r,ref:t})});Tu.displayName=rb;var ob="DropdownMenuSubContent",Ru=l.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Oe(n);return p.jsx(U0,{...o,...r,ref:t,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});Ru.displayName=ob;var sb=pu,ab=mu,ib=gu,cb=yu,lb=bu,ub=xu,db=wu,fb=Eu,pb=Su,hb=Cu,mb=Tu,gb=Ru,vb=sb,yb=ab,bb=ib,Pu=cb,Au=ub,Ou=db,Nu=fb,_u=pb,Iu=lb,Mu=hb,Du=mb,ju=gb;const xb=vb,wb=yb,Eb=l.forwardRef(({className:e,inset:t,children:n,...r},o)=>p.jsx(Du,{ref:o,className:fe("flex","cursor-default","select-none","items-center","rounded-[10px]","px-3","py-2","text-sm","font-medium","text-fg-secondary","outline-none","focus-ring-soft","focus:bg-hover-subtle","focus:text-fg-default","data-[state=open]:bg-hover-subtle","data-[state=open]:text-fg-default",t&&"pl-8",e),...r,children:n}));Eb.displayName=Du.displayName;const Sb=l.forwardRef(({className:e,...t},n)=>p.jsx(ju,{ref:n,className:fe("z-50","min-w-[8rem]","overflow-hidden","surface-floating","p-1",e),...t}));Sb.displayName=ju.displayName;const Lu=l.forwardRef(({className:e,sideOffset:t=4,...n},r)=>p.jsx(bb,{children:p.jsx(Pu,{ref:r,sideOffset:t,className:fe("z-[1100]","min-w-[10rem]","overflow-hidden","surface-floating","p-1","data-[state=open]:animate-fade-in","data-[state=open]:animate-zoom-in",e),...n})}));Lu.displayName=Pu.displayName;const ku=l.forwardRef(({className:e,inset:t,...n},r)=>p.jsx(Au,{ref:r,className:fe("relative","flex","cursor-pointer","select-none","items-center","px-3","py-2","text-sm","font-medium","text-fg-secondary","outline-none","focus-ring-soft","transition-colors","rounded-[10px]","focus:bg-hover-subtle","focus:text-fg-default","data-[disabled]:pointer-events-none","data-[disabled]:opacity-50",t&&"pl-8",e),...n}));ku.displayName=Au.displayName;const Cb=l.forwardRef(({className:e,children:t,checked:n,...r},o)=>p.jsxs(Ou,{ref:o,className:fe("relative","flex","cursor-pointer","select-none","items-center","rounded-[10px]","py-2","pl-8","pr-3","text-sm","font-medium","text-fg-secondary","outline-none","focus-ring-soft","transition-colors","focus:bg-hover-subtle","focus:text-fg-default","data-[disabled]:pointer-events-none","data-[disabled]:opacity-50",e),checked:n,...r,children:[p.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:p.jsx(_u,{children:"✓"})}),t]}));Cb.displayName=Ou.displayName;const Tb=l.forwardRef(({className:e,children:t,...n},r)=>p.jsxs(Nu,{ref:r,className:fe("relative","flex","cursor-pointer","select-none","items-center","rounded-[10px]","py-2","pl-8","pr-3","text-sm","font-medium","text-fg-secondary","outline-none","focus-ring-soft","transition-colors","focus:bg-hover-subtle","focus:text-fg-default","data-[disabled]:pointer-events-none","data-[disabled]:opacity-50",e),...n,children:[p.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:p.jsx(_u,{children:"●"})}),t]}));Tb.displayName=Nu.displayName;const Rb=l.forwardRef(({className:e,inset:t,...n},r)=>p.jsx(Iu,{ref:r,className:fe("px-2","py-1.5","text-sm","font-semibold","text-fg-secondary",t&&"pl-8",e),...n}));Rb.displayName=Iu.displayName;const Fu=l.forwardRef(({className:e,...t},n)=>p.jsx(Mu,{ref:n,className:fe("-mx-1","my-1","h-px","bg-divider",e),...t}));Fu.displayName=Mu.displayName;const PE=({button:e,items:t})=>p.jsxs(xb,{children:[p.jsx(wb,{asChild:!0,children:e}),p.jsx(Lu,{align:"end",children:t.map((n,r)=>n.type==="separator"?p.jsx(Fu,{},n.key??`separator-${r}`):p.jsx(ku,{onClick:n.onClick,children:n.name},n.name))})]}),Pb=l.forwardRef(({title:e,description:t,className:n="",...r},o)=>p.jsxs("div",{ref:o,className:fe("flex flex-col items-center justify-center text-center","h-[400px]","bg-muted/30","border-2 border-dashed","border-border-secondary","rounded-[20px]","p-8",n),...r,children:[e&&p.jsx($e,{as:"h3",variant:"heading",weight:"bold",tone:"muted",className:"mb-2",children:e}),t&&p.jsx($e,{as:"p",variant:"meta",weight:"medium",tone:"tertiary",className:"max-w-[400px]",children:t})]}));Pb.displayName="Empty";const Ab=Ae(["w-full","border","border-border-subtle","bg-elevated","text-fg-default","placeholder:text-fg-placeholder","transition-colors","outline-none","focus-ring-soft","disabled:cursor-not-allowed","disabled:opacity-50"],{variants:{variant:{default:[],ghost:["border-transparent","bg-subtle","hover:bg-hover-subtle"],error:["border-border-error","bg-accent-soft-danger/40","text-fg-default"]},size:{sm:"h-8 px-3 text-sm rounded-[12px]",md:"h-9 px-3 text-sm rounded-[14px]",lg:"h-11 px-4 text-base rounded-[16px]"}},defaultVariants:{variant:"default",size:"md"}}),Ob=l.forwardRef(({className:e,variant:t,size:n,type:r="text",...o},s)=>p.jsx("input",{ref:s,type:r,className:Ab({variant:t,size:n,className:e}),...o}));Ob.displayName="Input";const Nb=Ae(["font-bold","text-fg-muted","whitespace-nowrap"],{variants:{size:{sm:"text-xs",md:"text-sm",lg:"text-base"}},defaultVariants:{size:"sm"}}),_b=l.forwardRef(({className:e,size:t,...n},r)=>p.jsx("label",{ref:r,className:Nb({size:t,className:e}),...n}));_b.displayName="Label";const Ib=l.forwardRef(({page:e,last:t,onChange:n,className:r="",...o},s)=>{const i=Number(e),a=Number(t),c=[];for(let u=1;u<a+1;u++)(i===u||i===1&&u<i+5||i===2&&u<i+4||u>i-3&&u<i+3||i===a-1&&u>i-4||i===a&&u>i-5)&&c.push(u);const d=i===1,f=i===a;return p.jsxs("nav",{ref:s,className:`mt-8 flex justify-center items-center gap-1 ${r}`,...o,children:[p.jsxs(Ut,{disabled:d,onClick:()=>!d&&n(1),"aria-label":"First page",isSkip:!0,children:[p.jsx(Kr,{width:16}),p.jsx(Kr,{width:16})]}),p.jsx(Ut,{disabled:d,onClick:()=>!d&&n(i-1),"aria-label":"Previous page",children:p.jsx(Kr,{width:20})}),c.map(u=>p.jsx(Ut,{active:i===u,onClick:()=>n(u),"aria-label":`Page ${u}`,"aria-current":i===u?"page":void 0,children:u},u)),p.jsx(Ut,{disabled:f,onClick:()=>!f&&n(i+1),"aria-label":"Next page",children:p.jsx(Zr,{width:20})}),p.jsxs(Ut,{disabled:f,onClick:()=>!f&&n(a),"aria-label":"Last page",isSkip:!0,children:[p.jsx(Zr,{width:16}),p.jsx(Zr,{width:16})]})]})});Ib.displayName="Pagination";const Ut=l.forwardRef(({active:e,disabled:t,isSkip:n,children:r,className:o="",...s},i)=>{const a=`
59
+ `+s)}}catch{}}throw r}}_request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=Tt(this.defaults,n);const{transitional:r,paramsSerializer:o,headers:s}=n;r!==void 0&&Kn.assertOptions(r,{silentJSONParsing:Te.transitional(Te.boolean),forcedJSONParsing:Te.transitional(Te.boolean),clarifyTimeoutError:Te.transitional(Te.boolean),legacyInterceptorReqResOrdering:Te.transitional(Te.boolean),advertiseZstdAcceptEncoding:Te.transitional(Te.boolean),validateStatusUndefinedResolves:Te.transitional(Te.boolean)},!1),o!=null&&(w.isFunction(o)?n.paramsSerializer={serialize:o}:Kn.assertOptions(o,{encode:Te.function,serialize:Te.function},!0)),n.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?n.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:n.allowAbsoluteUrls=!0),Kn.assertOptions(n,{baseUrl:Te.spelling("baseURL"),withXsrfToken:Te.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let i=s&&w.merge(s.common,s[n.method]);s&&w.forEach(["delete","get","head","post","put","patch","query","common"],b=>{delete s[b]}),n.headers=Re.concat(i,s);const a=[];let c=!0;this.interceptors.request.forEach(function(g){if(typeof g.runWhen=="function"&&g.runWhen(n)===!1)return;c=c&&g.synchronous;const y=n.transitional||fs;y&&y.legacyInterceptorReqResOrdering?a.unshift(g.fulfilled,g.rejected):a.push(g.fulfilled,g.rejected)});const d=[];this.interceptors.response.forEach(function(g){d.push(g.fulfilled,g.rejected)});let f,u=0,h;if(!c){const b=[Ba.bind(this),void 0];for(b.unshift(...a),b.push(...d),h=b.length,f=Promise.resolve(n);u<h;)f=f.then(b[u++],b[u++]);return f}h=a.length;let m=n;for(;u<h;){const b=a[u++],g=a[u++];try{m=b(m)}catch(y){g.call(this,y);break}}try{f=Ba.call(this,m)}catch(b){return Promise.reject(b)}for(u=0,h=d.length;u<h;)f=f.then(d[u++],d[u++]);return f}getUri(t){t=Tt(this.defaults,t);const n=cl(t.baseURL,t.url,t.allowAbsoluteUrls,t);return rl(n,t.params,t.paramsSerializer)}};w.forEach(["delete","get","head","options"],function(t){yt.prototype[t]=function(n,r){return this.request(Tt(r||{},{method:t,url:n,data:r&&w.hasOwnProp(r,"data")?r.data:void 0}))}});w.forEach(["post","put","patch","query"],function(t){function n(r){return function(s,i,a){return this.request(Tt(a||{},{method:t,headers:r?{"Content-Type":"multipart/form-data"}:{},url:s,data:i}))}}yt.prototype[t]=n(),t!=="query"&&(yt.prototype[t+"Form"]=n(!0))});let by=class fl{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(s){n=s});const r=this;this.promise.then(o=>{if(!r._listeners)return;let s=r._listeners.length;for(;s-- >0;)r._listeners[s](o);r._listeners=null}),this.promise.then=o=>{let s;const i=new Promise(a=>{r.subscribe(a),s=a}).then(o);return i.cancel=function(){r.unsubscribe(s)},i},t(function(s,i,a){r.reason||(r.reason=new Rn(s,i,a),n(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const n=this._listeners.indexOf(t);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const t=new AbortController,n=r=>{t.abort(r)};return this.subscribe(n),t.signal.unsubscribe=()=>this.unsubscribe(n),t.signal}static source(){let t;return{token:new fl(function(o){t=o}),cancel:t}}};function xy(e){return function(n){return e.apply(null,n)}}function wy(e){return w.isObject(e)&&e.isAxiosError===!0}const To={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(To).forEach(([e,t])=>{To[t]=e});function pl(e){const t=new yt(e),n=Vc(yt.prototype.request,t);return w.extend(n,yt.prototype,t,{allOwnKeys:!0}),w.extend(n,t,null,{allOwnKeys:!0}),n.create=function(o){return pl(Tt(e,o))},n}const ue=pl(Tn);ue.Axios=yt;ue.CanceledError=Rn;ue.CancelToken=by;ue.isCancel=al;ue.VERSION=hs;ue.toFormData=yr;ue.AxiosError=N;ue.Cancel=ue.CanceledError;ue.all=function(t){return Promise.all(t)};ue.spread=xy;ue.isAxiosError=wy;ue.mergeConfig=Tt;ue.AxiosHeaders=Re;ue.formToJSON=e=>sl(w.isHTMLForm(e)?new FormData(e):e);ue.getAdapter=dl.getAdapter;ue.HttpStatusCode=To;ue.default=ue;const{Axios:cE,AxiosError:lE,CanceledError:uE,isCancel:dE,CancelToken:fE,VERSION:pE,all:hE,Cancel:mE,isAxiosError:gE,spread:vE,toFormData:yE,AxiosHeaders:bE,HttpStatusCode:xE,formToJSON:wE,getAdapter:EE,mergeConfig:SE,create:CE}=ue,Ey=e=>!e||e.length===0?null:[...new Set(e)].sort(),Sy=e=>!e||e.length===0?[]:[...new Set(e.map(t=>t.trim()).filter(Boolean))].sort(),Cy=e=>!e||e.length===0?null:[...new Set(e)].sort(),TE={notes:{all:()=>["notes"],listAll:()=>["notes","list"],list:(e={})=>["notes","list",{limit:e.limit??25,offset:e.offset??0,query:e.query??"",sortBy:e.sortBy??null,sortOrder:e.sortOrder??null,pinnedFirst:e.pinnedFirst??null,fields:Ey(e.fields)}],tagListAll:()=>["notes","tag-list"],tagList:(e={})=>["notes","tag-list",{limit:e.limit??25,offset:e.offset??0,query:e.query??""}],tagNameListAll:()=>["notes","tag-name-list"],tagNameList:e=>["notes","tag-name-list",{limit:e.limit??25,offset:e.offset??0,mode:e.mode??"and",tagNames:Sy(e.tagNames)}],detail:e=>["notes","detail",{id:e}],snapshots:(e,t=10)=>["notes","snapshots",{id:e,limit:t}],snapshotDetail:e=>["notes","snapshot-detail",{id:e}],trashAll:()=>["notes","trash"],trash:(e={})=>["notes","trash",{limit:e.limit??25,offset:e.offset??0}],trashDetail:e=>["notes","trash","detail",{id:e}],pinned:()=>["notes","pinned"],backReferencesAll:()=>["notes","back-references"],backReferences:e=>["notes","back-references",{noteId:e}],graph:()=>["notes","graph"],propertyKeysAll:()=>["notes","property-keys"],propertyKeys:(e={})=>["notes","property-keys",{query:e.query??"",limit:e.limit??50,offset:e.offset??0}]},tags:{all:()=>["tags"],list:(e={})=>["tags","list",{limit:e.limit??50,offset:e.offset??0,query:e.query??"",sortBy:e.sortBy??"referenceCount",sortOrder:e.sortOrder??"desc"}]},images:{all:()=>["images"],listAll:()=>["images","list"],list:(e={})=>["images","list",{limit:e.limit??50,offset:e.offset??0}],detail:e=>["images","detail",{id:e}],notes:e=>["images","notes",{id:e}]},reminders:{all:()=>["reminders"],note:(e,t={})=>["reminders","note",e,{limit:t.limit??10,offset:t.offset??0}],noteAllPages:e=>["reminders","note",e],upcoming:(e={})=>["reminders","upcoming",{limit:e.limit??10,offset:e.offset??0}],upcomingAllPages:()=>["reminders","upcoming"],inDateRangeAll:()=>["reminders","in-date-range"],inDateRange:(e,t)=>["reminders","in-date-range",{year:e,month:t}]},placeholders:{all:()=>["placeholders"],listAll:()=>["placeholders","list"],list:(e={})=>["placeholders","list",{limit:e.limit??25,offset:e.offset??0,query:e.query??"",fields:Cy(e.fields)}]},calendar:{all:()=>["calendar"],notesInDateRange:(e,t)=>["calendar","notes-in-date-range",{year:e,month:t}]},views:{all:()=>["views"],workspace:()=>["views","workspace"],section:e=>["views","section",{id:e}],sectionNotesAll:()=>["views","section-notes"],sectionNotes:(e,t={})=>["views","section-notes",{id:e,limit:t.limit??25,offset:t.offset??0}]},search:{all:()=>["search"],resultsAll:()=>["search","results"],results:e=>["search","results",{query:e.query.trim(),limit:e.limit??25,offset:e.offset??0,mode:e.mode??"hybrid"}],adminStatus:()=>["search","admin-status"]},ui:{heroBanner:()=>["ui","hero-banner"]}},Ty={sm:"w-4 h-4",md:"w-5 h-5",lg:"w-6 h-6"},Ha={sm:10,md:12,lg:14},Ry=l.forwardRef(({className:e,size:t="md",checked:n,disabled:r,...o},s)=>p.jsxs("label",{className:fe("relative inline-flex items-center justify-center cursor-pointer",r&&"cursor-not-allowed opacity-50",e),children:[p.jsx("input",{ref:s,type:"checkbox",checked:n,disabled:r,className:"sr-only peer",...o}),p.jsx("span",{className:fe(Ty[t],"flex items-center justify-center","border border-border-secondary","rounded-[6px]","bg-surface","transition-all duration-200","peer-checked:bg-cta","peer-checked:border-cta","focus-ring-soft","peer-focus-visible:border-border-focus","peer-focus-visible:shadow-[0_0_0_4px_color-mix(in_srgb,var(--accent-soft-primary)_90%,transparent)]"),children:n&&p.jsx(Fm,{width:Ha[t],height:Ha[t],className:"text-fg-on-filled",weight:"bold"})})]}));Ry.displayName="Checkbox";var Py=lc,Ay=uc,hl=dc,ml=fc,Oy=rs,gl=pc,vl=hc;const Ny=Py,_y=Ay,Iy=Oy,yl=l.createContext("default"),Pn=()=>l.useContext(yl),bl=l.forwardRef(({className:e,...t},n)=>p.jsx(hl,{ref:n,className:fe("fixed","inset-0","z-[1090]","bg-overlay","backdrop-blur-[2px]","data-[state=open]:animate-in","data-[state=closed]:animate-out","data-[state=closed]:fade-out-0","data-[state=open]:fade-in-0",e),...t}));bl.displayName=hl.displayName;const xl=l.forwardRef(({className:e,children:t,variant:n="default",...r},o)=>p.jsxs(_y,{children:[p.jsx(bl,{}),p.jsx("div",{className:"pointer-events-none fixed inset-0 z-[1100] flex items-center justify-center p-4",children:p.jsx(ml,{ref:o,"data-dialog-variant":n,className:os({variant:n,className:e}),...r,children:p.jsx(yl.Provider,{value:n,children:t})})})]}));xl.displayName=ml.displayName;const wl=({title:e,onClose:t,className:n})=>{const r=Pn();return p.jsxs("div",{className:Hm({variant:r,className:n}),children:[p.jsx(Cl,{children:e}),t&&p.jsx(Iy,{asChild:!0,children:p.jsx("button",{type:"button","aria-label":"Close dialog",className:Vm({variant:r}),onClick:t,children:p.jsx(Bm,{className:r==="compact"||r==="form"||r==="confirm"?"h-[18px] w-[18px]":"h-5 w-5"})})})]})};wl.displayName="DialogHeader";const El=l.forwardRef(({className:e,...t},n)=>{const r=Pn();return p.jsx("div",{ref:n,className:ss({variant:r,className:e}),...t})});El.displayName="DialogBody";const Sl=l.forwardRef(({className:e,...t},n)=>{const r=Pn();return p.jsx("div",{ref:n,className:as({variant:r,className:e}),...t})});Sl.displayName="DialogFooter";const Cl=l.forwardRef(({className:e,...t},n)=>{const r=Pn();return p.jsx(gl,{ref:n,className:fe(is({variant:r}),e),...t})});Cl.displayName=gl.displayName;const Tl=l.forwardRef(({className:e,...t},n)=>{const r=Pn();return p.jsx(vl,{ref:n,className:fe(cs({variant:r}),e),...t})});Tl.displayName=vl.displayName;const xr=({isOpen:e,onClose:t,children:n,className:r,variant:o="default"})=>p.jsx(Ny,{open:e,onOpenChange:s=>!s&&t(),children:p.jsx(xl,{variant:o,className:r,children:n})});xr.Header=wl;xr.Body=El;xr.Footer=Sl;xr.Description=Tl;function gs(e){const t=e+"CollectionProvider",[n,r]=Xe(t),[o,s]=n(t,{collectionRef:{current:null},itemMap:new Map}),i=g=>{const{scope:y,children:v}=g,x=C.useRef(null),E=C.useRef(new Map).current;return p.jsx(o,{scope:y,itemMap:E,collectionRef:x,children:v})};i.displayName=t;const a=e+"CollectionSlot",c=Gt(a),d=C.forwardRef((g,y)=>{const{scope:v,children:x}=g,E=s(a,v),S=re(y,E.collectionRef);return p.jsx(c,{ref:S,children:x})});d.displayName=a;const f=e+"CollectionItemSlot",u="data-radix-collection-item",h=Gt(f),m=C.forwardRef((g,y)=>{const{scope:v,children:x,...E}=g,S=C.useRef(null),T=re(y,S),P=s(f,v);return C.useEffect(()=>(P.itemMap.set(S,{ref:S,...E}),()=>{P.itemMap.delete(S)})),p.jsx(h,{[u]:"",ref:T,children:x})});m.displayName=f;function b(g){const y=s(e+"CollectionConsumer",g);return C.useCallback(()=>{const x=y.collectionRef.current;if(!x)return[];const E=Array.from(x.querySelectorAll(`[${u}]`));return Array.from(y.itemMap.values()).sort((P,R)=>E.indexOf(P.ref.current)-E.indexOf(R.ref.current))},[y.collectionRef,y.itemMap])}return[{Provider:i,Slot:d,ItemSlot:m},b,r]}var My=l.createContext(void 0);function wr(e){const t=l.useContext(My);return e||t||"ltr"}var Dy="Arrow",Rl=l.forwardRef((e,t)=>{const{children:n,width:r=10,height:o=5,...s}=e;return p.jsx(Y.svg,{...s,ref:t,width:r,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:p.jsx("polygon",{points:"0,0 30,0 15,10"})})});Rl.displayName=Dy;var jy=Rl;function Ly(e){const[t,n]=l.useState(void 0);return Pe(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;const s=o[0];let i,a;if("borderBoxSize"in s){const c=s.borderBoxSize,d=Array.isArray(c)?c[0]:c;i=d.inlineSize,a=d.blockSize}else i=e.offsetWidth,a=e.offsetHeight;n({width:i,height:a})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}var vs="Popper",[Pl,Jt]=Xe(vs),[ky,Al]=Pl(vs),Ol=e=>{const{__scopePopper:t,children:n}=e,[r,o]=l.useState(null);return p.jsx(ky,{scope:t,anchor:r,onAnchorChange:o,children:n})};Ol.displayName=vs;var Nl="PopperAnchor",_l=l.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...o}=e,s=Al(Nl,n),i=l.useRef(null),a=re(t,i),c=l.useRef(null);return l.useEffect(()=>{const d=c.current;c.current=r?.current||i.current,d!==c.current&&s.onAnchorChange(c.current)}),r?null:p.jsx(Y.div,{...o,ref:a})});_l.displayName=Nl;var ys="PopperContent",[Fy,$y]=Pl(ys),Il=l.forwardRef((e,t)=>{const{__scopePopper:n,side:r="bottom",sideOffset:o=0,align:s="center",alignOffset:i=0,arrowPadding:a=0,avoidCollisions:c=!0,collisionBoundary:d=[],collisionPadding:f=0,sticky:u="partial",hideWhenDetached:h=!1,updatePositionStrategy:m="optimized",onPlaced:b,...g}=e,y=Al(ys,n),[v,x]=l.useState(null),E=re(t,O=>x(O)),[S,T]=l.useState(null),P=Ly(S),R=P?.width??0,A=P?.height??0,_=r+(s!=="center"?"-"+s:""),D=typeof f=="number"?f:{top:0,right:0,bottom:0,left:0,...f},k=Array.isArray(d)?d:[d],U=k.length>0,H={padding:D,boundary:k.filter(Uy),altBoundary:U},{refs:Q,floatingStyles:ne,placement:L,isPositioned:Z,middlewareData:te}=Kd({strategy:"fixed",placement:_,whileElementsMounted:(...O)=>tf(...O,{animationFrame:m==="always"}),elements:{reference:y.anchor},middleware:[Zd({mainAxis:o+A,alignmentAxis:i}),c&&Qd({mainAxis:!0,crossAxis:!1,limiter:u==="partial"?nf():void 0,...H}),c&&Yd({...H}),Xd({...H,apply:({elements:O,rects:j,availableWidth:oe,availableHeight:ee})=>{const{width:X,height:G}=j.reference,me=O.floating.style;me.setProperty("--radix-popper-available-width",`${oe}px`),me.setProperty("--radix-popper-available-height",`${ee}px`),me.setProperty("--radix-popper-anchor-width",`${X}px`),me.setProperty("--radix-popper-anchor-height",`${G}px`)}}),S&&Jd({element:S,padding:a}),Hy({arrowWidth:R,arrowHeight:A}),h&&ef({strategy:"referenceHidden",...H})]}),[I,J]=jl(L),W=Ye(b);Pe(()=>{Z&&W?.()},[Z,W]);const ae=te.arrow?.x,$=te.arrow?.y,q=te.arrow?.centerOffset!==0,[V,F]=l.useState();return Pe(()=>{v&&F(window.getComputedStyle(v).zIndex)},[v]),p.jsx("div",{ref:Q.setFloating,"data-radix-popper-content-wrapper":"",style:{...ne,transform:Z?ne.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:V,"--radix-popper-transform-origin":[te.transformOrigin?.x,te.transformOrigin?.y].join(" "),...te.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:p.jsx(Fy,{scope:n,placedSide:I,onArrowChange:T,arrowX:ae,arrowY:$,shouldHideArrow:q,children:p.jsx(Y.div,{"data-side":I,"data-align":J,...g,ref:E,style:{...g.style,animation:Z?void 0:"none"}})})})});Il.displayName=ys;var Ml="PopperArrow",By={top:"bottom",right:"left",bottom:"top",left:"right"},Dl=l.forwardRef(function(t,n){const{__scopePopper:r,...o}=t,s=$y(Ml,r),i=By[s.placedSide];return p.jsx("span",{ref:s.onArrowChange,style:{position:"absolute",left:s.arrowX,top:s.arrowY,[i]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[s.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[s.placedSide],visibility:s.shouldHideArrow?"hidden":void 0},children:p.jsx(jy,{...o,ref:n,style:{...o.style,display:"block"}})})});Dl.displayName=Ml;function Uy(e){return e!==null}var Hy=e=>({name:"transformOrigin",options:e,fn(t){const{placement:n,rects:r,middlewareData:o}=t,i=o.arrow?.centerOffset!==0,a=i?0:e.arrowWidth,c=i?0:e.arrowHeight,[d,f]=jl(n),u={start:"0%",center:"50%",end:"100%"}[f],h=(o.arrow?.x??0)+a/2,m=(o.arrow?.y??0)+c/2;let b="",g="";return d==="bottom"?(b=i?u:`${h}px`,g=`${-c}px`):d==="top"?(b=i?u:`${h}px`,g=`${r.floating.height+c}px`):d==="right"?(b=`${-c}px`,g=i?u:`${m}px`):d==="left"&&(b=`${r.floating.width+c}px`,g=i?u:`${m}px`),{data:{x:b,y:g}}}});function jl(e){const[t,n="center"]=e.split("-");return[t,n]}var bs=Ol,xs=_l,ws=Il,Es=Dl,eo="rovingFocusGroup.onEntryFocus",Vy={bubbles:!1,cancelable:!0},An="RovingFocusGroup",[Ro,Ll,qy]=gs(An),[Wy,Er]=Xe(An,[qy]),[zy,Gy]=Wy(An),kl=l.forwardRef((e,t)=>p.jsx(Ro.Provider,{scope:e.__scopeRovingFocusGroup,children:p.jsx(Ro.Slot,{scope:e.__scopeRovingFocusGroup,children:p.jsx(Ky,{...e,ref:t})})}));kl.displayName=An;var Ky=l.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:o=!1,dir:s,currentTabStopId:i,defaultCurrentTabStopId:a,onCurrentTabStopIdChange:c,onEntryFocus:d,preventScrollOnEntryFocus:f=!1,...u}=e,h=l.useRef(null),m=re(t,h),b=wr(s),[g,y]=nt({prop:i,defaultProp:a??null,onChange:c,caller:An}),[v,x]=l.useState(!1),E=Ye(d),S=Ll(n),T=l.useRef(!1),[P,R]=l.useState(0);return l.useEffect(()=>{const A=h.current;if(A)return A.addEventListener(eo,E),()=>A.removeEventListener(eo,E)},[E]),p.jsx(zy,{scope:n,orientation:r,dir:b,loop:o,currentTabStopId:g,onItemFocus:l.useCallback(A=>y(A),[y]),onItemShiftTab:l.useCallback(()=>x(!0),[]),onFocusableItemAdd:l.useCallback(()=>R(A=>A+1),[]),onFocusableItemRemove:l.useCallback(()=>R(A=>A-1),[]),children:p.jsx(Y.div,{tabIndex:v||P===0?-1:0,"data-orientation":r,...u,ref:m,style:{outline:"none",...e.style},onMouseDown:M(e.onMouseDown,()=>{T.current=!0}),onFocus:M(e.onFocus,A=>{const _=!T.current;if(A.target===A.currentTarget&&_&&!v){const D=new CustomEvent(eo,Vy);if(A.currentTarget.dispatchEvent(D),!D.defaultPrevented){const k=S().filter(L=>L.focusable),U=k.find(L=>L.active),H=k.find(L=>L.id===g),ne=[U,H,...k].filter(Boolean).map(L=>L.ref.current);Bl(ne,f)}}T.current=!1}),onBlur:M(e.onBlur,()=>x(!1))})})}),Fl="RovingFocusGroupItem",$l=l.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:o=!1,tabStopId:s,children:i,...a}=e,c=Ze(),d=s||c,f=Gy(Fl,n),u=f.currentTabStopId===d,h=Ll(n),{onFocusableItemAdd:m,onFocusableItemRemove:b,currentTabStopId:g}=f;return l.useEffect(()=>{if(r)return m(),()=>b()},[r,m,b]),p.jsx(Ro.ItemSlot,{scope:n,id:d,focusable:r,active:o,children:p.jsx(Y.span,{tabIndex:u?0:-1,"data-orientation":f.orientation,...a,ref:t,onMouseDown:M(e.onMouseDown,y=>{r?f.onItemFocus(d):y.preventDefault()}),onFocus:M(e.onFocus,()=>f.onItemFocus(d)),onKeyDown:M(e.onKeyDown,y=>{if(y.key==="Tab"&&y.shiftKey){f.onItemShiftTab();return}if(y.target!==y.currentTarget)return;const v=Yy(y,f.orientation,f.dir);if(v!==void 0){if(y.metaKey||y.ctrlKey||y.altKey||y.shiftKey)return;y.preventDefault();let E=h().filter(S=>S.focusable).map(S=>S.ref.current);if(v==="last")E.reverse();else if(v==="prev"||v==="next"){v==="prev"&&E.reverse();const S=E.indexOf(y.currentTarget);E=f.loop?Xy(E,S+1):E.slice(S+1)}setTimeout(()=>Bl(E))}}),children:typeof i=="function"?i({isCurrentTabStop:u,hasTabStop:g!=null}):i})})});$l.displayName=Fl;var Zy={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function Qy(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function Yy(e,t,n){const r=Qy(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return Zy[r]}function Bl(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function Xy(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var Ul=kl,Hl=$l,Po=["Enter"," "],Jy=["ArrowDown","PageUp","Home"],Vl=["ArrowUp","PageDown","End"],e0=[...Jy,...Vl],t0={ltr:[...Po,"ArrowRight"],rtl:[...Po,"ArrowLeft"]},n0={ltr:["ArrowLeft"],rtl:["ArrowRight"]},On="Menu",[hn,r0,o0]=gs(On),[Ot,ql]=Xe(On,[o0,Jt,Er]),Sr=Jt(),Wl=Er(),[s0,Nt]=Ot(On),[a0,Nn]=Ot(On),zl=e=>{const{__scopeMenu:t,open:n=!1,children:r,dir:o,onOpenChange:s,modal:i=!0}=e,a=Sr(t),[c,d]=l.useState(null),f=l.useRef(!1),u=Ye(s),h=wr(o);return l.useEffect(()=>{const m=()=>{f.current=!0,document.addEventListener("pointerdown",b,{capture:!0,once:!0}),document.addEventListener("pointermove",b,{capture:!0,once:!0})},b=()=>f.current=!1;return document.addEventListener("keydown",m,{capture:!0}),()=>{document.removeEventListener("keydown",m,{capture:!0}),document.removeEventListener("pointerdown",b,{capture:!0}),document.removeEventListener("pointermove",b,{capture:!0})}},[]),p.jsx(bs,{...a,children:p.jsx(s0,{scope:t,open:n,onOpenChange:u,content:c,onContentChange:d,children:p.jsx(a0,{scope:t,onClose:l.useCallback(()=>u(!1),[u]),isUsingKeyboardRef:f,dir:h,modal:i,children:r})})})};zl.displayName=On;var i0="MenuAnchor",Ss=l.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,o=Sr(n);return p.jsx(xs,{...o,...r,ref:t})});Ss.displayName=i0;var Cs="MenuPortal",[c0,Gl]=Ot(Cs,{forceMount:void 0}),Kl=e=>{const{__scopeMenu:t,forceMount:n,children:r,container:o}=e,s=Nt(Cs,t);return p.jsx(c0,{scope:t,forceMount:n,children:p.jsx(Je,{present:n||s.open,children:p.jsx(En,{asChild:!0,container:o,children:r})})})};Kl.displayName=Cs;var Be="MenuContent",[l0,Ts]=Ot(Be),Zl=l.forwardRef((e,t)=>{const n=Gl(Be,e.__scopeMenu),{forceMount:r=n.forceMount,...o}=e,s=Nt(Be,e.__scopeMenu),i=Nn(Be,e.__scopeMenu);return p.jsx(hn.Provider,{scope:e.__scopeMenu,children:p.jsx(Je,{present:r||s.open,children:p.jsx(hn.Slot,{scope:e.__scopeMenu,children:i.modal?p.jsx(u0,{...o,ref:t}):p.jsx(d0,{...o,ref:t})})})})}),u0=l.forwardRef((e,t)=>{const n=Nt(Be,e.__scopeMenu),r=l.useRef(null),o=re(t,r);return l.useEffect(()=>{const s=r.current;if(s)return Jo(s)},[]),p.jsx(Rs,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:M(e.onFocusOutside,s=>s.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),d0=l.forwardRef((e,t)=>{const n=Nt(Be,e.__scopeMenu);return p.jsx(Rs,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),f0=Gt("MenuContent.ScrollLock"),Rs=l.forwardRef((e,t)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:o,onOpenAutoFocus:s,onCloseAutoFocus:i,disableOutsidePointerEvents:a,onEntryFocus:c,onEscapeKeyDown:d,onPointerDownOutside:f,onFocusOutside:u,onInteractOutside:h,onDismiss:m,disableOutsideScroll:b,...g}=e,y=Nt(Be,n),v=Nn(Be,n),x=Sr(n),E=Wl(n),S=r0(n),[T,P]=l.useState(null),R=l.useRef(null),A=re(t,R,y.onContentChange),_=l.useRef(0),D=l.useRef(""),k=l.useRef(0),U=l.useRef(null),H=l.useRef("right"),Q=l.useRef(0),ne=b?mr:l.Fragment,L=b?{as:f0,allowPinchZoom:!0}:void 0,Z=I=>{const J=D.current+I,W=S().filter(O=>!O.disabled),ae=document.activeElement,$=W.find(O=>O.ref.current===ae)?.textValue,q=W.map(O=>O.textValue),V=C0(q,J,$),F=W.find(O=>O.textValue===V)?.ref.current;(function O(j){D.current=j,window.clearTimeout(_.current),j!==""&&(_.current=window.setTimeout(()=>O(""),1e3))})(J),F&&setTimeout(()=>F.focus())};l.useEffect(()=>()=>window.clearTimeout(_.current),[]),Xo();const te=l.useCallback(I=>H.current===U.current?.side&&R0(I,U.current?.area),[]);return p.jsx(l0,{scope:n,searchRef:D,onItemEnter:l.useCallback(I=>{te(I)&&I.preventDefault()},[te]),onItemLeave:l.useCallback(I=>{te(I)||(R.current?.focus(),P(null))},[te]),onTriggerLeave:l.useCallback(I=>{te(I)&&I.preventDefault()},[te]),pointerGraceTimerRef:k,onPointerGraceIntentChange:l.useCallback(I=>{U.current=I},[]),children:p.jsx(ne,{...L,children:p.jsx(pr,{asChild:!0,trapped:o,onMountAutoFocus:M(s,I=>{I.preventDefault(),R.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:i,children:p.jsx(wn,{asChild:!0,disableOutsidePointerEvents:a,onEscapeKeyDown:d,onPointerDownOutside:f,onFocusOutside:u,onInteractOutside:h,onDismiss:m,children:p.jsx(Ul,{asChild:!0,...E,dir:v.dir,orientation:"vertical",loop:r,currentTabStopId:T,onCurrentTabStopIdChange:P,onEntryFocus:M(c,I=>{v.isUsingKeyboardRef.current||I.preventDefault()}),preventScrollOnEntryFocus:!0,children:p.jsx(ws,{role:"menu","aria-orientation":"vertical","data-state":du(y.open),"data-radix-menu-content":"",dir:v.dir,...x,...g,ref:A,style:{outline:"none",...g.style},onKeyDown:M(g.onKeyDown,I=>{const W=I.target.closest("[data-radix-menu-content]")===I.currentTarget,ae=I.ctrlKey||I.altKey||I.metaKey,$=I.key.length===1;W&&(I.key==="Tab"&&I.preventDefault(),!ae&&$&&Z(I.key));const q=R.current;if(I.target!==q||!e0.includes(I.key))return;I.preventDefault();const F=S().filter(O=>!O.disabled).map(O=>O.ref.current);Vl.includes(I.key)&&F.reverse(),E0(F)}),onBlur:M(e.onBlur,I=>{I.currentTarget.contains(I.target)||(window.clearTimeout(_.current),D.current="")}),onPointerMove:M(e.onPointerMove,mn(I=>{const J=I.target,W=Q.current!==I.clientX;if(I.currentTarget.contains(J)&&W){const ae=I.clientX>Q.current?"right":"left";H.current=ae,Q.current=I.clientX}}))})})})})})})});Zl.displayName=Be;var p0="MenuGroup",Ps=l.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return p.jsx(Y.div,{role:"group",...r,ref:t})});Ps.displayName=p0;var h0="MenuLabel",Ql=l.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return p.jsx(Y.div,{...r,ref:t})});Ql.displayName=h0;var or="MenuItem",Va="menu.itemSelect",Cr=l.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:r,...o}=e,s=l.useRef(null),i=Nn(or,e.__scopeMenu),a=Ts(or,e.__scopeMenu),c=re(t,s),d=l.useRef(!1),f=()=>{const u=s.current;if(!n&&u){const h=new CustomEvent(Va,{bubbles:!0,cancelable:!0});u.addEventListener(Va,m=>r?.(m),{once:!0}),Di(u,h),h.defaultPrevented?d.current=!1:i.onClose()}};return p.jsx(Yl,{...o,ref:c,disabled:n,onClick:M(e.onClick,f),onPointerDown:u=>{e.onPointerDown?.(u),d.current=!0},onPointerUp:M(e.onPointerUp,u=>{d.current||u.currentTarget?.click()}),onKeyDown:M(e.onKeyDown,u=>{const h=a.searchRef.current!=="";n||h&&u.key===" "||Po.includes(u.key)&&(u.currentTarget.click(),u.preventDefault())})})});Cr.displayName=or;var Yl=l.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:r=!1,textValue:o,...s}=e,i=Ts(or,n),a=Wl(n),c=l.useRef(null),d=re(t,c),[f,u]=l.useState(!1),[h,m]=l.useState("");return l.useEffect(()=>{const b=c.current;b&&m((b.textContent??"").trim())},[s.children]),p.jsx(hn.ItemSlot,{scope:n,disabled:r,textValue:o??h,children:p.jsx(Hl,{asChild:!0,...a,focusable:!r,children:p.jsx(Y.div,{role:"menuitem","data-highlighted":f?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...s,ref:d,onPointerMove:M(e.onPointerMove,mn(b=>{r?i.onItemLeave(b):(i.onItemEnter(b),b.defaultPrevented||b.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:M(e.onPointerLeave,mn(b=>i.onItemLeave(b))),onFocus:M(e.onFocus,()=>u(!0)),onBlur:M(e.onBlur,()=>u(!1))})})})}),m0="MenuCheckboxItem",Xl=l.forwardRef((e,t)=>{const{checked:n=!1,onCheckedChange:r,...o}=e;return p.jsx(ru,{scope:e.__scopeMenu,checked:n,children:p.jsx(Cr,{role:"menuitemcheckbox","aria-checked":sr(n)?"mixed":n,...o,ref:t,"data-state":Os(n),onSelect:M(o.onSelect,()=>r?.(sr(n)?!0:!n),{checkForDefaultPrevented:!1})})})});Xl.displayName=m0;var Jl="MenuRadioGroup",[g0,v0]=Ot(Jl,{value:void 0,onValueChange:()=>{}}),eu=l.forwardRef((e,t)=>{const{value:n,onValueChange:r,...o}=e,s=Ye(r);return p.jsx(g0,{scope:e.__scopeMenu,value:n,onValueChange:s,children:p.jsx(Ps,{...o,ref:t})})});eu.displayName=Jl;var tu="MenuRadioItem",nu=l.forwardRef((e,t)=>{const{value:n,...r}=e,o=v0(tu,e.__scopeMenu),s=n===o.value;return p.jsx(ru,{scope:e.__scopeMenu,checked:s,children:p.jsx(Cr,{role:"menuitemradio","aria-checked":s,...r,ref:t,"data-state":Os(s),onSelect:M(r.onSelect,()=>o.onValueChange?.(n),{checkForDefaultPrevented:!1})})})});nu.displayName=tu;var As="MenuItemIndicator",[ru,y0]=Ot(As,{checked:!1}),ou=l.forwardRef((e,t)=>{const{__scopeMenu:n,forceMount:r,...o}=e,s=y0(As,n);return p.jsx(Je,{present:r||sr(s.checked)||s.checked===!0,children:p.jsx(Y.span,{...o,ref:t,"data-state":Os(s.checked)})})});ou.displayName=As;var b0="MenuSeparator",su=l.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return p.jsx(Y.div,{role:"separator","aria-orientation":"horizontal",...r,ref:t})});su.displayName=b0;var x0="MenuArrow",au=l.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,o=Sr(n);return p.jsx(Es,{...o,...r,ref:t})});au.displayName=x0;var w0="MenuSub",[RE,iu]=Ot(w0),cn="MenuSubTrigger",cu=l.forwardRef((e,t)=>{const n=Nt(cn,e.__scopeMenu),r=Nn(cn,e.__scopeMenu),o=iu(cn,e.__scopeMenu),s=Ts(cn,e.__scopeMenu),i=l.useRef(null),{pointerGraceTimerRef:a,onPointerGraceIntentChange:c}=s,d={__scopeMenu:e.__scopeMenu},f=l.useCallback(()=>{i.current&&window.clearTimeout(i.current),i.current=null},[]);return l.useEffect(()=>f,[f]),l.useEffect(()=>{const u=a.current;return()=>{window.clearTimeout(u),c(null)}},[a,c]),p.jsx(Ss,{asChild:!0,...d,children:p.jsx(Yl,{id:o.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":o.contentId,"data-state":du(n.open),...e,ref:xn(t,o.onTriggerChange),onClick:u=>{e.onClick?.(u),!(e.disabled||u.defaultPrevented)&&(u.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:M(e.onPointerMove,mn(u=>{s.onItemEnter(u),!u.defaultPrevented&&!e.disabled&&!n.open&&!i.current&&(s.onPointerGraceIntentChange(null),i.current=window.setTimeout(()=>{n.onOpenChange(!0),f()},100))})),onPointerLeave:M(e.onPointerLeave,mn(u=>{f();const h=n.content?.getBoundingClientRect();if(h){const m=n.content?.dataset.side,b=m==="right",g=b?-5:5,y=h[b?"left":"right"],v=h[b?"right":"left"];s.onPointerGraceIntentChange({area:[{x:u.clientX+g,y:u.clientY},{x:y,y:h.top},{x:v,y:h.top},{x:v,y:h.bottom},{x:y,y:h.bottom}],side:m}),window.clearTimeout(a.current),a.current=window.setTimeout(()=>s.onPointerGraceIntentChange(null),300)}else{if(s.onTriggerLeave(u),u.defaultPrevented)return;s.onPointerGraceIntentChange(null)}})),onKeyDown:M(e.onKeyDown,u=>{const h=s.searchRef.current!=="";e.disabled||h&&u.key===" "||t0[r.dir].includes(u.key)&&(n.onOpenChange(!0),n.content?.focus(),u.preventDefault())})})})});cu.displayName=cn;var lu="MenuSubContent",uu=l.forwardRef((e,t)=>{const n=Gl(Be,e.__scopeMenu),{forceMount:r=n.forceMount,...o}=e,s=Nt(Be,e.__scopeMenu),i=Nn(Be,e.__scopeMenu),a=iu(lu,e.__scopeMenu),c=l.useRef(null),d=re(t,c);return p.jsx(hn.Provider,{scope:e.__scopeMenu,children:p.jsx(Je,{present:r||s.open,children:p.jsx(hn.Slot,{scope:e.__scopeMenu,children:p.jsx(Rs,{id:a.contentId,"aria-labelledby":a.triggerId,...o,ref:d,align:"start",side:i.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:f=>{i.isUsingKeyboardRef.current&&c.current?.focus(),f.preventDefault()},onCloseAutoFocus:f=>f.preventDefault(),onFocusOutside:M(e.onFocusOutside,f=>{f.target!==a.trigger&&s.onOpenChange(!1)}),onEscapeKeyDown:M(e.onEscapeKeyDown,f=>{i.onClose(),f.preventDefault()}),onKeyDown:M(e.onKeyDown,f=>{const u=f.currentTarget.contains(f.target),h=n0[i.dir].includes(f.key);u&&h&&(s.onOpenChange(!1),a.trigger?.focus(),f.preventDefault())})})})})})});uu.displayName=lu;function du(e){return e?"open":"closed"}function sr(e){return e==="indeterminate"}function Os(e){return sr(e)?"indeterminate":e?"checked":"unchecked"}function E0(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function S0(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function C0(e,t,n){const o=t.length>1&&Array.from(t).every(d=>d===t[0])?t[0]:t,s=n?e.indexOf(n):-1;let i=S0(e,Math.max(s,0));o.length===1&&(i=i.filter(d=>d!==n));const c=i.find(d=>d.toLowerCase().startsWith(o.toLowerCase()));return c!==n?c:void 0}function T0(e,t){const{x:n,y:r}=e;let o=!1;for(let s=0,i=t.length-1;s<t.length;i=s++){const a=t[s],c=t[i],d=a.x,f=a.y,u=c.x,h=c.y;f>r!=h>r&&n<(u-d)*(r-f)/(h-f)+d&&(o=!o)}return o}function R0(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return T0(n,t)}function mn(e){return t=>t.pointerType==="mouse"?e(t):void 0}var P0=zl,A0=Ss,O0=Kl,N0=Zl,_0=Ps,I0=Ql,M0=Cr,D0=Xl,j0=eu,L0=nu,k0=ou,F0=su,$0=au,B0=cu,U0=uu,Tr="DropdownMenu",[H0]=Xe(Tr,[ql]),Oe=ql(),[V0,fu]=H0(Tr),pu=e=>{const{__scopeDropdownMenu:t,children:n,dir:r,open:o,defaultOpen:s,onOpenChange:i,modal:a=!0}=e,c=Oe(t),d=l.useRef(null),[f,u]=nt({prop:o,defaultProp:s??!1,onChange:i,caller:Tr});return p.jsx(V0,{scope:t,triggerId:Ze(),triggerRef:d,contentId:Ze(),open:f,onOpenChange:u,onOpenToggle:l.useCallback(()=>u(h=>!h),[u]),modal:a,children:p.jsx(P0,{...c,open:f,onOpenChange:u,dir:r,modal:a,children:n})})};pu.displayName=Tr;var hu="DropdownMenuTrigger",mu=l.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,disabled:r=!1,...o}=e,s=fu(hu,n),i=Oe(n);return p.jsx(A0,{asChild:!0,...i,children:p.jsx(Y.button,{type:"button",id:s.triggerId,"aria-haspopup":"menu","aria-expanded":s.open,"aria-controls":s.open?s.contentId:void 0,"data-state":s.open?"open":"closed","data-disabled":r?"":void 0,disabled:r,...o,ref:xn(t,s.triggerRef),onPointerDown:M(e.onPointerDown,a=>{!r&&a.button===0&&a.ctrlKey===!1&&(s.onOpenToggle(),s.open||a.preventDefault())}),onKeyDown:M(e.onKeyDown,a=>{r||(["Enter"," "].includes(a.key)&&s.onOpenToggle(),a.key==="ArrowDown"&&s.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(a.key)&&a.preventDefault())})})})});mu.displayName=hu;var q0="DropdownMenuPortal",gu=e=>{const{__scopeDropdownMenu:t,...n}=e,r=Oe(t);return p.jsx(O0,{...r,...n})};gu.displayName=q0;var vu="DropdownMenuContent",yu=l.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=fu(vu,n),s=Oe(n),i=l.useRef(!1);return p.jsx(N0,{id:o.contentId,"aria-labelledby":o.triggerId,...s,...r,ref:t,onCloseAutoFocus:M(e.onCloseAutoFocus,a=>{i.current||o.triggerRef.current?.focus(),i.current=!1,a.preventDefault()}),onInteractOutside:M(e.onInteractOutside,a=>{const c=a.detail.originalEvent,d=c.button===0&&c.ctrlKey===!0,f=c.button===2||d;(!o.modal||f)&&(i.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});yu.displayName=vu;var W0="DropdownMenuGroup",z0=l.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Oe(n);return p.jsx(_0,{...o,...r,ref:t})});z0.displayName=W0;var G0="DropdownMenuLabel",bu=l.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Oe(n);return p.jsx(I0,{...o,...r,ref:t})});bu.displayName=G0;var K0="DropdownMenuItem",xu=l.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Oe(n);return p.jsx(M0,{...o,...r,ref:t})});xu.displayName=K0;var Z0="DropdownMenuCheckboxItem",wu=l.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Oe(n);return p.jsx(D0,{...o,...r,ref:t})});wu.displayName=Z0;var Q0="DropdownMenuRadioGroup",Y0=l.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Oe(n);return p.jsx(j0,{...o,...r,ref:t})});Y0.displayName=Q0;var X0="DropdownMenuRadioItem",Eu=l.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Oe(n);return p.jsx(L0,{...o,...r,ref:t})});Eu.displayName=X0;var J0="DropdownMenuItemIndicator",Su=l.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Oe(n);return p.jsx(k0,{...o,...r,ref:t})});Su.displayName=J0;var eb="DropdownMenuSeparator",Cu=l.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Oe(n);return p.jsx(F0,{...o,...r,ref:t})});Cu.displayName=eb;var tb="DropdownMenuArrow",nb=l.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Oe(n);return p.jsx($0,{...o,...r,ref:t})});nb.displayName=tb;var rb="DropdownMenuSubTrigger",Tu=l.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Oe(n);return p.jsx(B0,{...o,...r,ref:t})});Tu.displayName=rb;var ob="DropdownMenuSubContent",Ru=l.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Oe(n);return p.jsx(U0,{...o,...r,ref:t,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});Ru.displayName=ob;var sb=pu,ab=mu,ib=gu,cb=yu,lb=bu,ub=xu,db=wu,fb=Eu,pb=Su,hb=Cu,mb=Tu,gb=Ru,vb=sb,yb=ab,bb=ib,Pu=cb,Au=ub,Ou=db,Nu=fb,_u=pb,Iu=lb,Mu=hb,Du=mb,ju=gb;const xb=vb,wb=yb,Eb=l.forwardRef(({className:e,inset:t,children:n,...r},o)=>p.jsx(Du,{ref:o,className:fe("flex","cursor-default","select-none","items-center","rounded-[10px]","px-3","py-2","text-sm","font-medium","text-fg-secondary","outline-none","focus-ring-soft","focus:bg-hover-subtle","focus:text-fg-default","data-[state=open]:bg-hover-subtle","data-[state=open]:text-fg-default",t&&"pl-8",e),...r,children:n}));Eb.displayName=Du.displayName;const Sb=l.forwardRef(({className:e,...t},n)=>p.jsx(ju,{ref:n,className:fe("z-50","min-w-[8rem]","overflow-hidden","surface-floating","p-1",e),...t}));Sb.displayName=ju.displayName;const Lu=l.forwardRef(({className:e,sideOffset:t=4,...n},r)=>p.jsx(bb,{children:p.jsx(Pu,{ref:r,sideOffset:t,className:fe("z-[1100]","min-w-[10rem]","overflow-hidden","surface-floating","p-1","data-[state=open]:animate-fade-in","data-[state=open]:animate-zoom-in",e),...n})}));Lu.displayName=Pu.displayName;const ku=l.forwardRef(({className:e,inset:t,...n},r)=>p.jsx(Au,{ref:r,className:fe("relative","flex","cursor-pointer","select-none","items-center","px-3","py-2","text-sm","font-medium","text-fg-secondary","outline-none","focus-ring-soft","transition-colors","rounded-[10px]","focus:bg-hover-subtle","focus:text-fg-default","data-[disabled]:pointer-events-none","data-[disabled]:opacity-50",t&&"pl-8",e),...n}));ku.displayName=Au.displayName;const Cb=l.forwardRef(({className:e,children:t,checked:n,...r},o)=>p.jsxs(Ou,{ref:o,className:fe("relative","flex","cursor-pointer","select-none","items-center","rounded-[10px]","py-2","pl-8","pr-3","text-sm","font-medium","text-fg-secondary","outline-none","focus-ring-soft","transition-colors","focus:bg-hover-subtle","focus:text-fg-default","data-[disabled]:pointer-events-none","data-[disabled]:opacity-50",e),checked:n,...r,children:[p.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:p.jsx(_u,{children:"✓"})}),t]}));Cb.displayName=Ou.displayName;const Tb=l.forwardRef(({className:e,children:t,...n},r)=>p.jsxs(Nu,{ref:r,className:fe("relative","flex","cursor-pointer","select-none","items-center","rounded-[10px]","py-2","pl-8","pr-3","text-sm","font-medium","text-fg-secondary","outline-none","focus-ring-soft","transition-colors","focus:bg-hover-subtle","focus:text-fg-default","data-[disabled]:pointer-events-none","data-[disabled]:opacity-50",e),...n,children:[p.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:p.jsx(_u,{children:"●"})}),t]}));Tb.displayName=Nu.displayName;const Rb=l.forwardRef(({className:e,inset:t,...n},r)=>p.jsx(Iu,{ref:r,className:fe("px-2","py-1.5","text-sm","font-semibold","text-fg-secondary",t&&"pl-8",e),...n}));Rb.displayName=Iu.displayName;const Fu=l.forwardRef(({className:e,...t},n)=>p.jsx(Mu,{ref:n,className:fe("-mx-1","my-1","h-px","bg-divider",e),...t}));Fu.displayName=Mu.displayName;const PE=({button:e,items:t})=>p.jsxs(xb,{children:[p.jsx(wb,{asChild:!0,children:e}),p.jsx(Lu,{align:"end",children:t.map((n,r)=>n.type==="separator"?p.jsx(Fu,{},n.key??`separator-${r}`):p.jsx(ku,{onClick:n.onClick,children:n.name},n.name))})]}),Pb=l.forwardRef(({title:e,description:t,className:n="",...r},o)=>p.jsxs("div",{ref:o,className:fe("flex flex-col items-center justify-center text-center","h-[400px]","bg-muted/30","border-2 border-dashed","border-border-secondary","rounded-[20px]","p-8",n),...r,children:[e&&p.jsx($e,{as:"h3",variant:"heading",weight:"bold",tone:"muted",className:"mb-2",children:e}),t&&p.jsx($e,{as:"p",variant:"meta",weight:"medium",tone:"tertiary",className:"max-w-[400px]",children:t})]}));Pb.displayName="Empty";const Ab=Ae(["w-full","border","border-border-subtle","bg-elevated","text-fg-default","placeholder:text-fg-placeholder","transition-colors","outline-none","focus-ring-soft","disabled:cursor-not-allowed","disabled:opacity-50"],{variants:{variant:{default:[],ghost:["border-transparent","bg-subtle","hover:bg-hover-subtle"],error:["border-border-error","bg-accent-soft-danger/40","text-fg-default"]},size:{sm:"h-8 px-3 text-sm rounded-[12px]",md:"h-9 px-3 text-sm rounded-[14px]",lg:"h-11 px-4 text-base rounded-[16px]"}},defaultVariants:{variant:"default",size:"md"}}),Ob=l.forwardRef(({className:e,variant:t,size:n,type:r="text",...o},s)=>p.jsx("input",{ref:s,type:r,className:Ab({variant:t,size:n,className:e}),...o}));Ob.displayName="Input";const Nb=Ae(["font-bold","text-fg-muted","whitespace-nowrap"],{variants:{size:{sm:"text-xs",md:"text-sm",lg:"text-base"}},defaultVariants:{size:"sm"}}),_b=l.forwardRef(({className:e,size:t,...n},r)=>p.jsx("label",{ref:r,className:Nb({size:t,className:e}),...n}));_b.displayName="Label";const Ib=l.forwardRef(({page:e,last:t,onChange:n,className:r="",...o},s)=>{const i=Number(e),a=Number(t),c=[];for(let u=1;u<a+1;u++)(i===u||i===1&&u<i+5||i===2&&u<i+4||u>i-3&&u<i+3||i===a-1&&u>i-4||i===a&&u>i-5)&&c.push(u);const d=i===1,f=i===a;return p.jsxs("nav",{ref:s,className:`mt-8 flex justify-center items-center gap-1 ${r}`,...o,children:[p.jsxs(Ut,{disabled:d,onClick:()=>!d&&n(1),"aria-label":"First page",isSkip:!0,children:[p.jsx(Kr,{width:16}),p.jsx(Kr,{width:16})]}),p.jsx(Ut,{disabled:d,onClick:()=>!d&&n(i-1),"aria-label":"Previous page",children:p.jsx(Kr,{width:20})}),c.map(u=>p.jsx(Ut,{active:i===u,onClick:()=>n(u),"aria-label":`Page ${u}`,"aria-current":i===u?"page":void 0,children:u},u)),p.jsx(Ut,{disabled:f,onClick:()=>!f&&n(i+1),"aria-label":"Next page",children:p.jsx(Zr,{width:20})}),p.jsxs(Ut,{disabled:f,onClick:()=>!f&&n(a),"aria-label":"Last page",isSkip:!0,children:[p.jsx(Zr,{width:16}),p.jsx(Zr,{width:16})]})]})});Ib.displayName="Pagination";const Ut=l.forwardRef(({active:e,disabled:t,isSkip:n,children:r,className:o="",...s},i)=>{const a=`
60
60
  flex justify-center items-center
61
61
  leading-normal text-base font-medium
62
62
  w-9 h-9 md:w-10 md:h-10
@@ -276,8 +276,8 @@ __NOTE_ADDITIONAL_FIELDS__ id
276
276
  afterMarkdownSha256
277
277
  }
278
278
  }
279
- }`,{id:e,target:t.toUpperCase(),contextLines:3})}function QE(e){return de(`mutation RestoreNoteSnapshot($id: ID!) {
280
- restoreNoteSnapshot(id: $id) {
279
+ }`,{id:e,target:t.toUpperCase(),contextLines:3})}function QE(e,t){return de(`mutation RestoreNoteSnapshot($id: ID!, $expectedUpdatedAt: String!) {
280
+ restoreNoteSnapshot(id: $id, expectedUpdatedAt: $expectedUpdatedAt) {
281
281
  id
282
282
  title
283
283
  pinned
@@ -285,7 +285,7 @@ __NOTE_ADDITIONAL_FIELDS__ id
285
285
  content
286
286
  updatedAt
287
287
  }
288
- }`,{id:e})}function YE({limit:e=25,offset:t=0}={}){return de(`query FetchTrashedNotes($pagination: PaginationInput) {
288
+ }`,{id:e,expectedUpdatedAt:t})}function YE({limit:e=25,offset:t=0}={}){return de(`query FetchTrashedNotes($pagination: PaginationInput) {
289
289
  trashedNotes(pagination: $pagination) {
290
290
  totalCount
291
291
  notes {
@@ -353,4 +353,4 @@ __NOTE_ADDITIONAL_FIELDS__ id
353
353
  target
354
354
  }
355
355
  }
356
- }`)}export{xw as $,Q1 as A,Qe as B,zo as C,_1 as D,Wo as E,qo as F,Vo as G,zt as H,fr as I,O1 as J,W1 as K,uo as L,G1 as M,z1 as N,Rf as O,K1 as P,Tf as Q,At as R,ue as S,TE as T,up as U,X1 as V,oE as W,tE as X,nE as Y,$e as Z,Ox as _,q1 as a,LE as a$,Nx as a0,Nd as a1,OE as a2,_b as a3,Ry as a4,fe as a5,de as a6,Bm as a7,rE as a8,J1 as a9,FE as aA,AE as aB,QE as aC,GE as aD,ZE as aE,KE as aF,Mx as aG,qx as aH,Wx as aI,km as aJ,zE as aK,kE as aL,WE as aM,tS as aN,qE as aO,bn as aP,po as aQ,dn as aR,ap as aS,Ee as aT,wp as aU,tp as aV,Me as aW,Ei as aX,eE as aY,Ae as aZ,nS as a_,ME as aa,Ld as ab,Zn as ac,Go as ad,rS as ae,Zr as af,jE as ag,PE as ah,Z1 as ai,Ds as aj,Ib as ak,Pb as al,Y1 as am,IE as an,_E as ao,NE as ap,g1 as aq,Bd as ar,DE as as,xr as at,it as au,Kr as av,Ob as aw,BE as ax,ce as ay,oS as az,V1 as b,_x as b0,YE as b1,JE as b2,eS as b3,XE as b4,Fo as b5,$E as b6,xb as b7,wb as b8,Lu as b9,Rb as ba,Fu as bb,ku as bc,UE as bd,HE as be,VE as bf,Bo as c,A1 as d,U1 as e,Us as f,lo as g,D1 as h,N1 as i,Lr as j,fi as k,hi as l,Gs as m,L1 as n,Vn as o,F1 as p,H1 as q,B1 as r,li as s,$1 as t,co as u,I1 as v,j1 as w,k1 as x,pt as y,M1 as z};
356
+ }`)}export{Fu as $,Bm as A,it as B,Go as C,LE as D,Pb as E,Ry as F,PE as G,fe as H,Ob as I,Db as J,Fo as K,_b as L,xr as M,Kr as N,$E as O,Ds as P,ME as Q,AE as R,_x as S,$e as T,Zr as U,g1 as V,WE as W,xb as X,wb as Y,Lu as Z,Rb as _,qx as a,K1 as a$,ku as a0,bn as a1,po as a2,dn as a3,ap as a4,Ee as a5,wp as a6,tp as a7,Me as a8,Ei as a9,B1 as aA,fi as aB,hi as aC,Gs as aD,L1 as aE,Vn as aF,_1 as aG,H1 as aH,li as aI,co as aJ,I1 as aK,j1 as aL,k1 as aM,pt as aN,M1 as aO,Q1 as aP,Qe as aQ,zo as aR,Wo as aS,qo as aT,Vo as aU,O1 as aV,W1 as aW,uo as aX,G1 as aY,z1 as aZ,Rf as a_,eE as aa,fr as ab,tS as ac,qE as ad,nS as ae,zt as af,GE as ag,ZE as ah,KE as ai,jE as aj,zE as ak,kE as al,QE as am,Ld as an,Us as ao,N1 as ap,q1 as aq,V1 as ar,Bo as as,A1 as at,$1 as au,Lr as av,U1 as aw,lo as ax,F1 as ay,D1 as az,Wx as b,Tf as b0,X1 as b1,oE as b2,tE as b3,nE as b4,xw as b5,Nd as b6,OE as b7,rS as b8,Y1 as b9,IE as ba,_E as bb,NE as bc,Bd as bd,DE as be,ce as bf,oS as bg,Mx as c,rE as d,ue as e,Z1 as f,de as g,J1 as h,YE as i,Ib as j,Zn as k,FE as l,XE as m,BE as n,UE as o,eS as p,TE as q,JE as r,km as s,HE as t,up as u,VE as v,Ox as w,Nx as x,Ae as y,At as z};