ryco-cli 0.1.9 → 0.1.11

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 (283) hide show
  1. package/dist/{AcpNativeLogging-CwXNgeCl.mjs → AcpNativeLogging-Ba9Nn9Re.mjs} +1 -1
  2. package/dist/{AcpNativeLogging-BBLrglnY.cjs → AcpNativeLogging-Be1KGJfF.cjs} +1 -1
  3. package/dist/{AzureDevOpsSourceControlProvider-lRTMr9X9.mjs → AzureDevOpsSourceControlProvider-CGlK6M0b.mjs} +2 -2
  4. package/dist/{AzureDevOpsSourceControlProvider-BMQxxk2n.cjs → AzureDevOpsSourceControlProvider-CVj-F-pW.cjs} +2 -2
  5. package/dist/{BitbucketSourceControlProvider-F1J_75c0.mjs → BitbucketSourceControlProvider-BV6iRDi7.mjs} +2 -2
  6. package/dist/{BitbucketSourceControlProvider-BXDk4GzL.cjs → BitbucketSourceControlProvider-CEZEd4PX.cjs} +2 -2
  7. package/dist/{ClaudeDriver-B_pvBuh5.cjs → ClaudeDriver-lBU7EyUX.cjs} +2 -2
  8. package/dist/{ClaudeDriver-BpYiEftb.mjs → ClaudeDriver-rooMNrJz.mjs} +2 -2
  9. package/dist/{CodexDriver-Bcju44ZM.cjs → CodexDriver-CZCIJSLV.cjs} +4 -4
  10. package/dist/{CodexDriver-6IRQy37T.mjs → CodexDriver-DBz2rPXb.mjs} +4 -4
  11. package/dist/{CodexTextGeneration-CCvcMT6Y.mjs → CodexTextGeneration-BeG7ymPC.mjs} +1 -1
  12. package/dist/{CodexTextGeneration-yaU53Kmz.cjs → CodexTextGeneration-BvIcyD1P.cjs} +1 -1
  13. package/dist/{CopilotDriver-CTxl0KmP.cjs → CopilotDriver-CX5zhEdZ.cjs} +3 -3
  14. package/dist/{CopilotDriver-BCe5V1Ll.mjs → CopilotDriver-D36vbGbn.mjs} +3 -3
  15. package/dist/{CursorDriver-D1Agqrbj.cjs → CursorDriver-CPBVeesr.cjs} +3 -3
  16. package/dist/{CursorDriver-C4V25d1y.mjs → CursorDriver-DWuuOSkJ.mjs} +3 -3
  17. package/dist/{ForgejoSourceControlProvider-C-NI9vaC.mjs → ForgejoSourceControlProvider-CeN7Snfr.mjs} +2 -2
  18. package/dist/{ForgejoSourceControlProvider-CV1lljGK.cjs → ForgejoSourceControlProvider-CzmmcAZO.cjs} +2 -2
  19. package/dist/{GitHubSourceControlProvider-B_7J1jOl.cjs → GitHubSourceControlProvider-DfFR9O2o.cjs} +2 -2
  20. package/dist/{GitHubSourceControlProvider-BeCMPF92.mjs → GitHubSourceControlProvider-Dmz1LJct.mjs} +2 -2
  21. package/dist/{GitLabSourceControlProvider-0BeWchVS.mjs → GitLabSourceControlProvider-C21lwphV.mjs} +2 -2
  22. package/dist/{GitLabSourceControlProvider-U0xcv577.cjs → GitLabSourceControlProvider-DGoelNmL.cjs} +2 -2
  23. package/dist/{GrokDriver-mkLP3IZl.cjs → GrokDriver-CIXj_4ry.cjs} +3 -3
  24. package/dist/{GrokDriver-DFw7DOdK.mjs → GrokDriver-qKX1a63G.mjs} +3 -3
  25. package/dist/{OpenCodeDriver-ChWHrFi7.mjs → OpenCodeDriver-CbdswhqU.mjs} +2 -2
  26. package/dist/{OpenCodeDriver-C_KFYA-P.cjs → OpenCodeDriver-DDEuwtXl.cjs} +2 -2
  27. package/dist/{SourceControlProviderDiscoveryCatalog-BTJDoEx1.mjs → SourceControlProviderDiscoveryCatalog-4_4yahsa.mjs} +1 -1
  28. package/dist/{SourceControlProviderDiscoveryCatalog-Bwu_JBJN.cjs → SourceControlProviderDiscoveryCatalog-DJWDCoup.cjs} +1 -1
  29. package/dist/bin.cjs +46 -20
  30. package/dist/bin.mjs +46 -20
  31. package/dist/client/assets/AccountSettings-BUoiS8x1.js +1 -0
  32. package/dist/client/assets/AiFocusSettings-Cz1Uqn7a.js +1 -0
  33. package/dist/client/assets/AnimatedHeight-BIsV_Z3J.js +1 -0
  34. package/dist/client/assets/AppearanceSettings-CYbSApl4.js +1 -0
  35. package/dist/client/assets/{BranchToolbar.logic-CvclFpSW.js → BranchToolbar.logic-LIanCEVr.js} +1 -1
  36. package/dist/client/assets/ChatRightPanel-CKEjpQ_x.js +27 -0
  37. package/dist/client/assets/ChatThreadRouteView-D50onHY2.js +1 -0
  38. package/dist/client/assets/CommandPaletteDialog-DdRKgZ8m.js +1 -0
  39. package/dist/client/assets/{CompositeItem-e0rusLTG.js → CompositeItem-F3NGn6aG.js} +1 -1
  40. package/dist/client/assets/CompositeRoot-CmJGfRtc.js +1 -0
  41. package/dist/client/assets/ConnectionsSettings--CbTzkTn.js +7 -0
  42. package/dist/client/assets/DiagnosticsSettings-C74u3ce5.js +2 -0
  43. package/dist/client/assets/{DialogHandle-DZVZpjWD.js → DialogHandle-C4uSr9wX.js} +1 -1
  44. package/dist/client/assets/DialogPopup-Dck8r8Hn.js +1 -0
  45. package/dist/client/assets/DialogRoot-BpIvUdm7.js +1 -0
  46. package/dist/client/assets/{DialogTitle-CtpwXIBL.js → DialogTitle-CCedPAjV.js} +1 -1
  47. package/dist/client/assets/{DialogTrigger-CdeFWE8i.js → DialogTrigger-CYJ7_YcV.js} +1 -1
  48. package/dist/client/assets/DialogViewport-D-CrTM-P.js +1 -0
  49. package/dist/client/assets/DraftChatThreadRouteView-RTmLGTl0.js +1 -0
  50. package/dist/client/assets/{ExternalIdentityWeb.logic-DsqwSlwL.js → ExternalIdentityWeb.logic-D64j70NH.js} +1 -1
  51. package/dist/client/assets/{GlassSurface-EZnNd1mF.js → GlassSurface-C3IIWMu9.js} +1 -1
  52. package/dist/client/assets/HostedConnectionControls-CKiC01ju.js +1 -0
  53. package/dist/client/assets/HostedHubRoot-BS3rAYTy.js +1 -0
  54. package/dist/client/assets/HostedNativeAuthorizationRoute-BFTDyh4N.js +1 -0
  55. package/dist/client/assets/HostedRelayTrustNotice-eEOPKsBg.js +1 -0
  56. package/dist/client/assets/Icons-CT3nd2MA.js +1 -0
  57. package/dist/client/assets/IntegrationsSettingsPanel-Cg4eRHm_.js +1 -0
  58. package/dist/client/assets/KeybindingsSettings-CYj67N2D.js +7 -0
  59. package/dist/client/assets/McpServersSettings-Bc61hRUY.js +6 -0
  60. package/dist/client/assets/MobileSheet-CkeG6_SP.js +1 -0
  61. package/dist/client/assets/NewWorktreeDialog-CTlFjKa4.js +4 -0
  62. package/dist/client/assets/NoActiveThreadState-Dw9aoU2J.js +1 -0
  63. package/dist/client/assets/NodeSecuritySettings-DMkkTgfg.js +1 -0
  64. package/dist/client/assets/OpinionatedPluginsSettings-CeoSmZ90.js +1 -0
  65. package/dist/client/assets/PhoneGetAppInterstitial-7ZxxVbUB.js +1 -0
  66. package/dist/client/assets/PhoneGetAppInterstitialBackdrop-B8vfJdZd.js +1 -0
  67. package/dist/client/assets/PhoneHome-DRRoCd_y.js +1 -0
  68. package/dist/client/assets/PhoneSettingsSurface-LNEaPHQC.js +1 -0
  69. package/dist/client/assets/ProjectFavicon-BIMdZxK6.js +1 -0
  70. package/dist/client/assets/ProviderModelPicker-jd6GjQkO.js +1 -0
  71. package/dist/client/assets/ProviderUpdateLaunchNotification.logic-BkoRegCn.js +1 -0
  72. package/dist/client/assets/ProvidersSettingsPanel-v2SvoEGx.js +1 -0
  73. package/dist/client/assets/RedactedSensitiveText-CxtaUiKH.js +1 -0
  74. package/dist/client/assets/RootAppShell-CFjrYjtn.js +6 -0
  75. package/dist/client/assets/RycoLetterMark-Bk0kvGJ_.js +1 -0
  76. package/dist/client/assets/SettingsDialog-CvGTsSV0.js +1 -0
  77. package/dist/client/assets/SettingsPanels-BmhZ8u4B.js +3 -0
  78. package/dist/client/assets/SettingsPanels.editor-B2x4U4rW.js +1 -0
  79. package/dist/client/assets/SourceControlSettings-DvPydmxX.js +1 -0
  80. package/dist/client/assets/StatisticsPage-Duk2cHVH.js +1 -0
  81. package/dist/client/assets/StatisticsPanel-D-uNJcdj.js +1 -0
  82. package/dist/client/assets/StatisticsSettingsLink-Cx43bOeo.js +1 -0
  83. package/dist/client/assets/ThreadStatusIndicators-D0xoATCw.js +0 -0
  84. package/dist/client/assets/{ThreadTerminalDrawer-Dju6roQA.js → ThreadTerminalDrawer-DjX8p7IH.js} +3 -3
  85. package/dist/client/assets/{ThreadWorkspacePanel-hfIocZRN.js → ThreadWorkspacePanel-DI0GXPBf.js} +18 -18
  86. package/dist/client/assets/{ToolbarRootContext-CgV898DN.js → ToolbarRootContext-BgqqXVly.js} +1 -1
  87. package/dist/client/assets/{WorkItemsTab-DYgsIthY.js → WorkItemsTab-ow45makA.js} +8 -8
  88. package/dist/client/assets/alert-LqMhbdE9.js +1 -0
  89. package/dist/client/assets/alert-dialog-DxoA6ky8.js +1 -0
  90. package/dist/client/assets/{authorization-CFcCWeGd.js → authorization-mIJKV2yp.js} +1 -1
  91. package/dist/client/assets/badge-CXw6fWrB.js +1 -0
  92. package/dist/client/assets/{branding-CG1VEma6.js → branding-C8SLy6Af.js} +1 -1
  93. package/dist/client/assets/button-BAbJxRzt.js +1 -0
  94. package/dist/client/assets/{capabilities-CK9Wa-Au.js → capabilities-BQuqC7jg.js} +1 -1
  95. package/dist/client/assets/{chatThreadActions-Ooky34bb.js → chatThreadActions-DQ8aOQ1g.js} +1 -1
  96. package/dist/client/assets/collapsible-dxy6kc2k.js +1 -0
  97. package/dist/client/assets/command-CGNKG_Oe.js +1 -0
  98. package/dist/client/assets/composerDraftStore-CdJJZe42.js +11 -0
  99. package/dist/client/assets/copy-UQjKGt7t.js +1 -0
  100. package/dist/client/assets/data-list-CYKBxN62.js +1 -0
  101. package/dist/client/assets/{desktopUpdateAtoms-C9VOpM6h.js → desktopUpdateAtoms-C82GmR67.js} +1 -1
  102. package/dist/client/assets/{desktopWorkspace-BOWgdyPs.js → desktopWorkspace-G5Z_JRbm.js} +1 -1
  103. package/dist/client/assets/{device-CLd1blIe.js → device-B56cBWWt.js} +12 -12
  104. package/dist/client/assets/dialog-DQsYchqu.js +1 -0
  105. package/dist/client/assets/draft-input-CkzOk8BY.js +1 -0
  106. package/dist/client/assets/{editorPreferences-C79SevBP.js → editorPreferences-CTDEj79K.js} +1 -1
  107. package/dist/client/assets/empty-DwzqNgCP.js +1 -0
  108. package/dist/client/assets/{env-CBdFekj3.js → env-B4arEvJg.js} +1 -1
  109. package/dist/client/assets/{getPseudoElementBounds-CWoLtsYr.js → getPseudoElementBounds-X62ElHN8.js} +1 -1
  110. package/dist/client/assets/group-D9ER9giz.js +1 -0
  111. package/dist/client/assets/{index-Bbc24tew.js → index-Bbz4fkK_.js} +2 -2
  112. package/dist/client/assets/input-CHEwW3oH.js +1 -0
  113. package/dist/client/assets/kbd-DCGQZk18.js +1 -0
  114. package/dist/client/assets/{keybindings-n2U57Td0.js → keybindings-CWJ7E9ZI.js} +1 -1
  115. package/dist/client/assets/label-CVFHsLFO.js +1 -0
  116. package/dist/client/assets/{lib-DoLGGVrW.js → lib-qiiNMGgU.js} +1 -1
  117. package/dist/client/assets/{logging-FtLrPmK_.js → logging-M8H3z7rQ.js} +1 -1
  118. package/dist/client/assets/main-DaYHZt-J.css +2 -0
  119. package/dist/client/assets/{main-C2i8ecSj.js → main-Dwu2cT6v.js} +3 -3
  120. package/dist/client/assets/menu-Dvxh8sD5.js +1 -0
  121. package/dist/client/assets/popover-CuH9Yrj3.js +1 -0
  122. package/dist/client/assets/{primary-0ymoUGkq.js → primary-OskAInOO.js} +1 -1
  123. package/dist/client/assets/{projectPaths-CHDYD_Gc.js → projectPaths-lDhAE9o_.js} +1 -1
  124. package/dist/client/assets/{providerDriverMeta-lsEf84Mz.js → providerDriverMeta-I0TSo-QI.js} +1 -1
  125. package/dist/client/assets/providerIconUtils-DnSYUN9l.js +1 -0
  126. package/dist/client/assets/providerInstances-BJcfB_9E.js +1 -0
  127. package/dist/client/assets/providerModels-BJcfB_9E.js +1 -0
  128. package/dist/client/assets/qr-code-Bddq6K7S.js +1 -0
  129. package/dist/client/assets/radio-group-CBZFr4C8.js +2 -0
  130. package/dist/client/assets/resolveAriaLabelledBy-CD_ugzhJ.js +1 -0
  131. package/dist/client/assets/{rightPanelRouteSearch-DkhE1otz.js → rightPanelRouteSearch-DB5gQGHK.js} +1 -1
  132. package/dist/client/assets/runtime-DKwoXpJv.js +1 -0
  133. package/dist/client/assets/scroll-area-Drsa8bNB.js +1 -0
  134. package/dist/client/assets/scrollEdges-B-cqxY4l.js +1 -0
  135. package/dist/client/assets/select-BYbVr-yg.js +1 -0
  136. package/dist/client/assets/separator-CdS5bi4Z.js +1 -0
  137. package/dist/client/assets/{session-logic-B0shVXpN.js → session-logic-DElAta-Z.js} +1 -1
  138. package/dist/client/assets/settingsDialogStore-ygYoScKe.js +1 -0
  139. package/dist/client/assets/settingsLayout-D8glO7f1.js +1 -0
  140. package/dist/client/assets/settingsSections.logic-F8RXVmAq.js +1 -0
  141. package/dist/client/assets/sheet-BO78gIKZ.js +1 -0
  142. package/dist/client/assets/sidebar-Dm6l2GA6.js +1 -0
  143. package/dist/client/assets/sidebarProjectFolders-Cs13ZUN8.js +4 -0
  144. package/dist/client/assets/{sidebarStatusText-DjLAEM1H.js → sidebarStatusText-D0HT0fek.js} +1 -1
  145. package/dist/client/assets/skeleton-CvQSeJbw.js +1 -0
  146. package/dist/client/assets/spinner-ClF0jOcX.js +1 -0
  147. package/dist/client/assets/src-Vf4LVnMX.js +14 -0
  148. package/dist/client/assets/storeSelectors-Cq_JKyiF.js +1 -0
  149. package/dist/client/assets/switch-BTGo9Yip.js +1 -0
  150. package/dist/client/assets/{terminal-links-DERnXf-G.js → terminal-links-CZ3c9AbA.js} +1 -1
  151. package/dist/client/assets/textarea-RFPODxWW.js +1 -0
  152. package/dist/client/assets/{threadPriorityRefreshRuntime-D2XRdn_X.js → threadPriorityRefreshRuntime-DJF5drVD.js} +1 -1
  153. package/dist/client/assets/toast-CcSCAm4B.js +1 -0
  154. package/dist/client/assets/toggle-I6h33Cu5.js +1 -0
  155. package/dist/client/assets/toggle-group-mLIkiJtU.js +1 -0
  156. package/dist/client/assets/tooltip-C8sAONBj.js +1 -0
  157. package/dist/client/assets/types-Cq_JKyiF.js +1 -0
  158. package/dist/client/assets/{uiStateStore-hgy2ilHo.js → uiStateStore-B6pjzSjj.js} +1 -1
  159. package/dist/client/assets/{useAtlassian-1BSXt3BO.js → useAtlassian-Bx2ua3JV.js} +0 -0
  160. package/dist/client/assets/{useButton-_xmxdcVX.js → useButton-D__1LqCF.js} +1 -1
  161. package/dist/client/assets/useCompositeListItem-Cmr_nuuG.js +1 -0
  162. package/dist/client/assets/useCopyToClipboard-BTpWxumf.js +1 -0
  163. package/dist/client/assets/{useDebouncedValue-DU7gLY9w.js → useDebouncedValue-DHjoudTq.js} +1 -1
  164. package/dist/client/assets/{useFloatingRootContext-CSPbIu1q.js → useFloatingRootContext-D5EZmrCa.js} +1 -1
  165. package/dist/client/assets/useHandleNewThread-DHO0PWGZ.js +1 -0
  166. package/dist/client/assets/{useLabelableId-COmfNFnd.js → useLabelableId-DnQJ7amm.js} +1 -1
  167. package/dist/client/assets/useLocation-CDeYzWW6.js +1 -0
  168. package/dist/client/assets/{useOpenInteractionType-JaQBnIly.js → useOpenInteractionType-CjtpACKR.js} +1 -1
  169. package/dist/client/assets/usePhoneThreadActions-OTf7yIbN.js +1 -0
  170. package/dist/client/assets/usePopupViewport-BuhsNdVy.js +1 -0
  171. package/dist/client/assets/useScrollLock-D3tMGsRk.js +1 -0
  172. package/dist/client/assets/{useStatistics-B2NNfOqV.js → useStatistics-DEtKeVPP.js} +14 -14
  173. package/dist/client/assets/{useSwipeDismiss-B8Fo31QE.js → useSwipeDismiss-CbgDJvw1.js} +1 -1
  174. package/dist/client/assets/{useThreadActions-B9kmG6FU.js → useThreadActions-DLxhOMkz.js} +1 -1
  175. package/dist/client/assets/{useTriggerFocusGuards-O2ZE3JtI.js → useTriggerFocusGuards-CrugmkhX.js} +1 -1
  176. package/dist/client/assets/{useValueChanged-Dj0YXujm.js → useValueChanged-MQtIzPIU.js} +1 -1
  177. package/dist/client/assets/utils-BofFIn5Y.js +1 -0
  178. package/dist/client/index.html +1 -1
  179. package/dist/{collectUint8StreamText-Dn-L1KcR.cjs → collectUint8StreamText-Bb52hlpd.cjs} +36 -6
  180. package/dist/{collectUint8StreamText-DNY4x71l.mjs → collectUint8StreamText-EDg4F0TU.mjs} +31 -7
  181. package/dist/{makeManagedServerProvider-D3T5X-B4.mjs → makeManagedServerProvider-Cf8bNWwc.mjs} +1 -1
  182. package/dist/{makeManagedServerProvider-DNnEIuhW.cjs → makeManagedServerProvider-itynW7xv.cjs} +1 -1
  183. package/package.json +1 -1
  184. package/dist/client/assets/AccountSettings-ckhtafp7.js +0 -1
  185. package/dist/client/assets/AiFocusSettings-DGHWPxgZ.js +0 -1
  186. package/dist/client/assets/AnimatedHeight-BwF3D1vB.js +0 -1
  187. package/dist/client/assets/AppearanceSettings-CDvljGDS.js +0 -1
  188. package/dist/client/assets/ChatRightPanel-CL4qBTZb.js +0 -27
  189. package/dist/client/assets/ChatThreadRouteView-BuOmyy7a.js +0 -1
  190. package/dist/client/assets/CommandPaletteDialog-lCv8qmpm.js +0 -1
  191. package/dist/client/assets/CompositeRoot-vnNIb6NL.js +0 -1
  192. package/dist/client/assets/ConnectionsSettings-BJJrdASq.js +0 -7
  193. package/dist/client/assets/DiagnosticsSettings-CxT6modq.js +0 -2
  194. package/dist/client/assets/DialogPopup-BIJxt62s.js +0 -1
  195. package/dist/client/assets/DialogRoot-8xRqqTn8.js +0 -1
  196. package/dist/client/assets/DialogViewport-C2oKvkDR.js +0 -1
  197. package/dist/client/assets/DraftChatThreadRouteView-FriWZLgB.js +0 -1
  198. package/dist/client/assets/HostedConnectionControls-BYS30u9D.js +0 -1
  199. package/dist/client/assets/HostedHubRoot-Bi0LEQCK.js +0 -1
  200. package/dist/client/assets/HostedNativeAuthorizationRoute-B-F2I7S_.js +0 -1
  201. package/dist/client/assets/HostedRelayTrustNotice-CB0O5OAN.js +0 -1
  202. package/dist/client/assets/Icons-Cme5LL0k.js +0 -1
  203. package/dist/client/assets/IntegrationsSettingsPanel-CS9vrmPw.js +0 -1
  204. package/dist/client/assets/KeybindingsSettings-CQi3dbgG.js +0 -7
  205. package/dist/client/assets/McpServersSettings-BMV56xhW.js +0 -6
  206. package/dist/client/assets/MobileSheet-C8OrQzw0.js +0 -1
  207. package/dist/client/assets/NewWorktreeDialog-DnxmXlh2.js +0 -4
  208. package/dist/client/assets/NoActiveThreadState-BWs9JspL.js +0 -1
  209. package/dist/client/assets/NodeSecuritySettings-iTvQFged.js +0 -1
  210. package/dist/client/assets/OpinionatedPluginsSettings-BcGJ1f7b.js +0 -1
  211. package/dist/client/assets/PhoneGetAppInterstitial-BJGf9FwA.js +0 -1
  212. package/dist/client/assets/PhoneGetAppInterstitialBackdrop-KgY3ydJF.js +0 -1
  213. package/dist/client/assets/PhoneHome-kBrFqF5K.js +0 -1
  214. package/dist/client/assets/PhoneSettingsSurface-CBI6Gl8b.js +0 -1
  215. package/dist/client/assets/ProjectFavicon-D0HVbYDF.js +0 -1
  216. package/dist/client/assets/ProviderModelPicker-DZTCKskK.js +0 -1
  217. package/dist/client/assets/ProviderUpdateLaunchNotification.logic-CtfZzmYI.js +0 -1
  218. package/dist/client/assets/ProvidersSettingsPanel-DAz8hMXw.js +0 -1
  219. package/dist/client/assets/RedactedSensitiveText-CRGSSHz3.js +0 -1
  220. package/dist/client/assets/RootAppShell-BWtqIOLh.js +0 -6
  221. package/dist/client/assets/RycoLetterMark-E82lj57c.js +0 -1
  222. package/dist/client/assets/SettingsDialog-RrFirXQp.js +0 -1
  223. package/dist/client/assets/SettingsPanels-bLK5JAV2.js +0 -3
  224. package/dist/client/assets/SettingsPanels.editor-DTAK4nlM.js +0 -1
  225. package/dist/client/assets/SourceControlSettings-CpnAAcyj.js +0 -1
  226. package/dist/client/assets/StatisticsPage-DwU3oJRO.js +0 -1
  227. package/dist/client/assets/StatisticsPanel-8OSQWA79.js +0 -1
  228. package/dist/client/assets/StatisticsSettingsLink-Bb86VtRL.js +0 -1
  229. package/dist/client/assets/ThreadStatusIndicators-wgiSGtn6.js +0 -0
  230. package/dist/client/assets/alert-DFo8_l6D.js +0 -1
  231. package/dist/client/assets/alert-dialog-Cmodiuqg.js +0 -1
  232. package/dist/client/assets/badge-BbJiUmhG.js +0 -1
  233. package/dist/client/assets/button-BT6cGe5S.js +0 -1
  234. package/dist/client/assets/collapsible-BIEfHdzc.js +0 -1
  235. package/dist/client/assets/command-BjXuIvYa.js +0 -1
  236. package/dist/client/assets/composerDraftStore-_Xy-iY4b.js +0 -11
  237. package/dist/client/assets/data-list-iVYHRfWS.js +0 -1
  238. package/dist/client/assets/dialog-BUIS3TXH.js +0 -1
  239. package/dist/client/assets/draft-input-CUkU2EAu.js +0 -1
  240. package/dist/client/assets/empty-BNn5X77p.js +0 -1
  241. package/dist/client/assets/group-a6GUMeTh.js +0 -1
  242. package/dist/client/assets/input-zjUwoDs3.js +0 -1
  243. package/dist/client/assets/kbd-BGOWI5KX.js +0 -1
  244. package/dist/client/assets/label-DWGvDLsD.js +0 -1
  245. package/dist/client/assets/main-an0sD0U2.css +0 -2
  246. package/dist/client/assets/menu-CwPZHq2g.js +0 -1
  247. package/dist/client/assets/popover-j6ZF-s94.js +0 -1
  248. package/dist/client/assets/providerIconUtils-_WuNo2Ek.js +0 -1
  249. package/dist/client/assets/providerInstances-DEQekDE8.js +0 -1
  250. package/dist/client/assets/providerModels-DEQekDE8.js +0 -1
  251. package/dist/client/assets/qr-code-DbscZ6Qz.js +0 -1
  252. package/dist/client/assets/radio-group-BTtFIcDI.js +0 -2
  253. package/dist/client/assets/resolveAriaLabelledBy-CxOsaNI8.js +0 -1
  254. package/dist/client/assets/runtime-BkRtSwRY.js +0 -1
  255. package/dist/client/assets/scroll-area-B-bu3v0j.js +0 -1
  256. package/dist/client/assets/scrollEdges-CDEU4fOg.js +0 -1
  257. package/dist/client/assets/select-rPdFVPfm.js +0 -1
  258. package/dist/client/assets/separator-CaVw81t6.js +0 -1
  259. package/dist/client/assets/settingsDialogStore-CPtQPrek.js +0 -1
  260. package/dist/client/assets/settingsLayout-B8os-EWr.js +0 -1
  261. package/dist/client/assets/settingsSections.logic-Be8uaymC.js +0 -1
  262. package/dist/client/assets/sheet-DQBndeJT.js +0 -1
  263. package/dist/client/assets/sidebar-H-CSxQVD.js +0 -1
  264. package/dist/client/assets/sidebarProjectFolders-CsZlmaJg.js +0 -4
  265. package/dist/client/assets/skeleton-CCuGgPK1.js +0 -1
  266. package/dist/client/assets/spinner-CgrOdIjl.js +0 -1
  267. package/dist/client/assets/src-b7-hpIff.js +0 -14
  268. package/dist/client/assets/storeSelectors-BLHJVLCP.js +0 -1
  269. package/dist/client/assets/switch-cMx5Wv_R.js +0 -1
  270. package/dist/client/assets/textarea-DIqqrD8A.js +0 -1
  271. package/dist/client/assets/toast-DonYDy-6.js +0 -1
  272. package/dist/client/assets/toggle-BIs83JSj.js +0 -1
  273. package/dist/client/assets/toggle-group-0LgplGMc.js +0 -1
  274. package/dist/client/assets/tooltip-BaJgdXlL.js +0 -1
  275. package/dist/client/assets/types-BLHJVLCP.js +0 -1
  276. package/dist/client/assets/useCompositeListItem-dLIU4XjY.js +0 -1
  277. package/dist/client/assets/useCopyToClipboard-qG2nhvjQ.js +0 -1
  278. package/dist/client/assets/useHandleNewThread-COAg-4eT.js +0 -1
  279. package/dist/client/assets/useLocation-DsqdpYA5.js +0 -1
  280. package/dist/client/assets/usePhoneThreadActions-RjcSVspy.js +0 -1
  281. package/dist/client/assets/usePopupViewport-wXfO6SZE.js +0 -1
  282. package/dist/client/assets/useScrollLock-Dr_P7FLZ.js +0 -1
  283. package/dist/client/assets/utils-c6dglOTK.js +0 -1
@@ -1 +0,0 @@
1
- import"./runtime-BkRtSwRY.js";
@@ -1 +0,0 @@
1
- import{i as e,t}from"./react-SIfiwpqq.js";import{t as n}from"./compiler-runtime-qmuS0Svy.js";import{f as r,t as i}from"./utils-c6dglOTK.js";import{Et as a,Mn as o,Sn as s,Tt as c,in as l,on as u}from"./usePopupViewport-wXfO6SZE.js";import{d,l as ee,o as te,t as f}from"./useRenderElement-DchFnsR8.js";import{n as p,t as m}from"./useButton-_xmxdcVX.js";import{t as ne}from"./useValueChanged-Dj0YXujm.js";import{n as re}from"./clamp-CgH0Dl6R.js";import{i as ie,n as ae,r as oe,s as se,t as h,u as g}from"./useLabelableId-COmfNFnd.js";var _=e(t(),1);function v(e,t,n,r=!0,i){let[a,s]=_.useState(),c=l(i?`${i}-label`:void 0),u=e??t??a;return o(()=>{let i=e||t||!r?void 0:y(n.current,c);a!==i&&s(i)}),u}function y(e,t){let n=b(e);if(n)return!n.id&&t&&(n.id=t),n.id||void 0}function b(e){if(!e)return;let t=e.parentElement;if(t&&t.tagName===`LABEL`)return t;let n=e.id;if(n){let t=e.nextElementSibling;if(t&&t.htmlFor===n)return t}let r=e.labels;return r&&r[0]}var x=_.createContext(void 0);function S(){let e=_.useContext(x);if(e===void 0)throw Error(d(63));return e}var C={...g,checked(e){return e?{"data-checked":``}:{"data-unchecked":``}}},w=r(),T=_.forwardRef(function(e,t){let{checked:n,className:r,defaultChecked:i,"aria-labelledby":d,form:g,id:y,inputRef:b,name:S,nativeButton:T=!1,onCheckedChange:E,readOnly:D=!1,required:O=!1,disabled:k=!1,render:ce,uncheckedValue:A,value:j,style:le,...M}=e,{clearErrors:N}=oe(),{state:P,setTouched:F,setDirty:I,validityData:L,setFilled:R,setFocused:z,validationMode:B,disabled:V,name:H,validation:U}=se(),{labelId:W}=ae(),G=V||k,K=H??S,q=_.useRef(null),ue=ee(q,b,U.inputRef),J=_.useRef(null),Y=l(),X=h({id:y,implicit:!1,controlRef:J}),Z=T?void 0:X,[Q,de]=re({controlled:n,default:!!i,name:`Switch`,state:`checked`});ie(J,Y,Q,void 0,!G,S),o(()=>{q.current&&R(q.current.checked)},[R]),ne(Q,()=>{N(K),I(Q!==L.initialValue),R(Q),U.change(Q)});let{getButtonProps:fe,buttonRef:pe}=m({disabled:G,native:T}),me=v(d,W,q,!T,Z),he={id:T?X:Y,role:`switch`,"aria-checked":Q,"aria-readonly":D||void 0,"aria-required":O||void 0,"aria-labelledby":me,onFocus(){G||z(!0)},onBlur(){let e=q.current;!e||G||(F(!0),z(!1),B===`onBlur`&&U.commit(e.checked))},onClick(e){if(D||G)return;e.preventDefault();let t=q.current;t&&p(t,e)}},ge={...U.getValidationProps(G),checked:Q,disabled:G,form:g,id:Z,name:K,required:O,style:K?a:c,tabIndex:-1,type:`checkbox`,"aria-hidden":!0,ref:ue,onChange(e){if(e.nativeEvent.defaultPrevented)return;if(D){e.preventDefault();return}let t=e.currentTarget.checked,n=u(s,e.nativeEvent);E?.(t,n),!n.isCanceled&&de(t)},onClick(e){e.stopPropagation()},onFocus(){J.current?.focus()},...j===void 0?te:{value:j}},$=_.useMemo(()=>({...P,checked:Q,disabled:G,readOnly:D,required:O}),[P,Q,G,D,O]),_e=f(`span`,e,{state:$,ref:[t,J,pe],props:[he,M,fe,e=>U.getValidationProps(G,e)],stateAttributesMapping:C});return(0,w.jsxs)(x.Provider,{value:$,children:[_e,!Q&&K&&A!==void 0&&(0,w.jsx)(`input`,{type:`hidden`,form:g,name:K,value:A,disabled:G}),(0,w.jsx)(`input`,{...ge,suppressHydrationWarning:!0})]})}),E=_.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,o=S();return f(`span`,e,{state:o,ref:t,stateAttributesMapping:C,props:a})}),D=n();function O(e){let t=(0,D.c)(9),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let a;t[3]===n?a=t[4]:(a=i(`inline-flex h-[calc(var(--thumb-size)+2px)] w-[calc(var(--thumb-size)*2-2px)] shrink-0 cursor-pointer items-center rounded-full p-px outline-none transition-[background-color,box-shadow] duration-200 [--thumb-size:--spacing(5)] focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1 focus-visible:ring-offset-background data-checked:bg-primary data-unchecked:bg-input data-disabled:cursor-not-allowed data-disabled:opacity-64 sm:[--thumb-size:--spacing(4)]`,n),t[3]=n,t[4]=a);let o;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,w.jsx)(E,{className:i(`pointer-events-none block aspect-square h-full origin-left in-[[role=switch]:active,[data-slot=label]:active,[data-slot=field-label]:active]:not-data-disabled:scale-x-110 in-[[role=switch]:active,[data-slot=label]:active,[data-slot=field-label]:active]:rounded-[var(--thumb-size)/calc(var(--thumb-size)*1.1)] rounded-(--thumb-size) bg-background shadow-sm/5 will-change-transform [transition:translate_.15s,border-radius_.15s,scale_.1s_.1s,transform-origin_.15s] data-checked:origin-[var(--thumb-size)_50%] data-checked:translate-x-[calc(var(--thumb-size)-4px)]`),"data-slot":`switch-thumb`}),t[5]=o):o=t[5];let s;return t[6]!==r||t[7]!==a?(s=(0,w.jsx)(T,{className:a,"data-slot":`switch`,...r,children:o}),t[6]=r,t[7]=a,t[8]=s):s=t[8],s}export{v as n,O as t};
@@ -1 +0,0 @@
1
- import{t as e}from"./compiler-runtime-qmuS0Svy.js";import{f as t,t as n}from"./utils-c6dglOTK.js";import{r}from"./useRenderElement-DchFnsR8.js";import{r as i}from"./input-zjUwoDs3.js";var a=e(),o=t();function s(e){let t=(0,a.c)(15),s,c,l,u;t[0]===e?(s=t[1],c=t[2],l=t[3],u=t[4]):({className:s,size:l,unstyled:u,...c}=e,t[0]=e,t[1]=s,t[2]=c,t[3]=l,t[4]=u);let d=l===void 0?`default`:l,f=u!==void 0&&u,p;t[5]!==s||t[6]!==f?(p=n(!f&&`relative inline-flex w-full rounded-lg border border-input bg-background not-dark:bg-clip-padding text-base text-foreground shadow-xs/5 ring-ring/24 transition-shadow before:pointer-events-none before:absolute before:inset-0 before:rounded-[calc(var(--radius-lg)-1px)] has-focus-visible:has-aria-invalid:border-destructive/64 has-focus-visible:has-aria-invalid:ring-destructive/16 has-aria-invalid:border-destructive/36 has-focus-visible:border-ring has-disabled:opacity-64 has-[:disabled,:focus-visible,[aria-invalid]]:shadow-none has-focus-visible:ring-[3px] not-has-disabled:has-not-focus-visible:not-has-aria-invalid:before:shadow-[0_1px_--theme(--color-black/4%)] sm:text-sm dark:bg-input/32 dark:has-aria-invalid:ring-destructive/24 dark:not-has-disabled:has-not-focus-visible:not-has-aria-invalid:before:shadow-[0_-1px_--theme(--color-white/6%)]`,s)||void 0,t[5]=s,t[6]=f,t[7]=p):p=t[7];let m;t[8]!==c||t[9]!==d?(m=(0,o.jsx)(i,{render:e=>(0,o.jsx)(`textarea`,{className:n(`field-sizing-content min-h-17.5 w-full rounded-[inherit] px-[calc(--spacing(3)-1px)] py-[calc(--spacing(1.5)-1px)] outline-none max-sm:min-h-20.5`,d===`sm`&&`min-h-16.5 px-[calc(--spacing(2.5)-1px)] py-[calc(--spacing(1)-1px)] max-sm:min-h-19.5`,d===`lg`&&`min-h-18.5 py-[calc(--spacing(2)-1px)] max-sm:min-h-21.5`),"data-slot":`textarea`,...r(e,c)})}),t[8]=c,t[9]=d,t[10]=m):m=t[10];let h;return t[11]!==d||t[12]!==p||t[13]!==m?(h=(0,o.jsx)(`span`,{className:p,"data-size":d,"data-slot":`textarea-control`,children:m}),t[11]=d,t[12]=p,t[13]=m,t[14]=h):h=t[14],h}export{s as t};
@@ -1 +0,0 @@
1
- import{i as e,r as t,t as n}from"./react-SIfiwpqq.js";import{t as r}from"./compiler-runtime-qmuS0Svy.js";import{i}from"./composerDraftStore-_Xy-iY4b.js";import{f as a,t as o}from"./utils-c6dglOTK.js";import{At as s,Bt as c,I as l,Lt as u,Mn as d,Nn as f,Rn as p,Rt as m,Tt as h,Xn as g,an as _,et as v,i as y,it as b,j as x,jn as S,jt as C,l as w,nn as T,o as E,rn as D,rt as O,tn as k,wt as ee,zn as te,zt as A}from"./usePopupViewport-wXfO6SZE.js";import{d as j,n as ne,t as re,u as ie}from"./useSwipeDismiss-B8Fo31QE.js";import{d as M,f as N,o as P,s as ae,t as F,u as I}from"./useRenderElement-DchFnsR8.js";import{n as L,t as R}from"./loader-circle-CrtHFAvM.js";import{t as z}from"./chevron-down-B7C6FKzM.js";import{n as B,t as V}from"./useFloatingRootContext-CSPbIu1q.js";import{t as oe}from"./circle-alert-BWvs6IOn.js";import{n as se,t as H}from"./useCopyToClipboard-qG2nhvjQ.js";import{t as U}from"./triangle-alert-RL_T3KLo.js";import{t as ce}from"./x-C1Cemsov.js";import{t as W}from"./useButton-_xmxdcVX.js";import{a as le}from"./tooltip-BaJgdXlL.js";import{t as ue}from"./react-dom-x9LNwWQc.js";import{n as G}from"./button-BT6cGe5S.js";var K=N(`circle-check`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]),q=N(`info`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 16v-4`,key:`1dtifu`}],[`path`,{d:`M12 8h.01`,key:`e9boi3`}]]),J=e(n(),1),de=J.createContext(void 0);function Y(){let e=J.useContext(de);if(!e)throw Error(M(73));return e}var X=0;function fe(e){return X+=1,`${e}-${Math.random().toString(36).slice(2,6)}-${X}`}function pe(e,t){if(typeof e==`string`)return{description:e};if(typeof e==`function`){let n=e(t);return typeof n==`string`?{description:n}:n}return e}function me(e){let t=new Map,n=0,r=0;return e.forEach((e,i)=>{let a=e.transitionStatus===`ending`;t.set(e.id,{value:e,domIndex:i,visibleIndex:a?-1:n,offsetY:r}),r+=e.height||0,a||(n+=1)}),t}function he(e,t){let n=0;return e.map(e=>{if(e.transitionStatus===`ending`)return e;let r=n>=t;return n+=1,e.limited===r?e:{...e,limited:r}})}var Z={toasts:e=>e.toasts,isEmpty:e=>e.toasts.length===0,toast:(e,t)=>e.toastMetadata.get(t)?.value,toastIndex:(e,t)=>e.toastMetadata.get(t)?.domIndex??-1,toastOffsetY:(e,t)=>e.toastMetadata.get(t)?.offsetY??0,toastVisibleIndex:(e,t)=>e.toastMetadata.get(t)?.visibleIndex??-1,focused:e=>e.focused,expanded:e=>e.hovering||e.focused,expandedOrOutOfFocus:e=>e.hovering||e.focused||!e.isWindowFocused,prevFocusElement:e=>e.prevFocusElement},ge=class extends l{timers=new Map;areTimersPaused=!1;constructor(e){super({...e,toastMetadata:me(e.toasts)},{},Z)}setViewport=e=>{this.set(`viewport`,e)};syncProviderProps(e,t){let n=this.state.limit!==t;if(this.state.timeout===e&&!n)return;let r={timeout:e,limit:t};if(n){let e=he(this.state.toasts,t);r.toasts=e,r.toastMetadata=me(e)}this.update(r)}disposeEffect=()=>()=>{this.timers.forEach(e=>{e.timeout?.clear()}),this.timers.clear()};removeToast(e,t=!1){let n=Z.toastIndex(this.state,e);if(n===-1)return;let r=this.state.toasts[n];t||r?.onRemove?.();let i=[...this.state.toasts];i.splice(n,1),this.setToasts(i)}addToast=e=>{let{timeout:t,limit:n}=this.state,r=e.id||fe(`toast`);if(e.id){let t=Z.toast(this.state,e.id);if(t){if(t.transitionStatus===`ending`)this.removeToast(e.id,!0);else{let{id:t,transitionStatus:n,...r}=e;return this.updateToastInternal(e.id,r,!0,!0),e.id}}}let i={...e,id:r,updateKey:0,transitionStatus:`starting`},a=[i,...this.state.toasts];this.setToasts(he(a,n));let o=i.timeout??t;return i.type!==`loading`&&o>0&&this.scheduleTimer(r,o,()=>this.closeToast(r)),Z.expandedOrOutOfFocus(this.state)&&this.pauseTimers(),r};updateToast=(e,t)=>{this.updateToastInternal(e,t,!1,!0)};updateToastInternal=(e,t,n=!1,r=!1)=>{let{timeout:i,toasts:a}=this.state,o=Z.toast(this.state,e);if(!o||o.transitionStatus===`ending`)return;let s={...o,...t,...r&&{updateKey:o.updateKey+1}};this.setToasts(a.map(t=>t.id===e?s:t));let c=s.timeout??i,l=o.timeout??i,u=Object.hasOwn(t,`timeout`),d=s.transitionStatus!==`ending`&&s.type!==`loading`&&c>0,f=this.timers.has(e),p=l!==c,m=o.type===`loading`;if(!d&&f){this.clearTimer(e);return}d&&(!f||p||u||m||n)&&(this.clearTimer(e),this.scheduleTimer(e,c,()=>this.closeToast(e)),Z.expandedOrOutOfFocus(this.state)&&this.pauseTimers())};closeToast=e=>{let t=e===void 0,{limit:n,toasts:r}=this.state,i;if(t)i=r,this.clearTimers();else{let t=Z.toast(this.state,e);if(!t)return;i=[t],this.clearTimer(e)}let a=he(r.map(n=>t||n.id===e?{...n,transitionStatus:`ending`,height:0}:n),n);this.setToasts(a,!a.some(e=>e.transitionStatus!==`ending`)),i.forEach(e=>{e.transitionStatus!==`ending`&&e.onClose?.()}),this.handleFocusManagement(e)};promiseToast=(e,t)=>{let n=pe(t.loading),r=this.addToast({...n,type:`loading`}),i=e.then(e=>{let n=pe(t.success,e);return this.updateToast(r,{...n,type:`success`,timeout:n.timeout}),e}).catch(e=>{let n=pe(t.error,e);return this.updateToast(r,{...n,type:`error`,timeout:n.timeout}),Promise.reject(e)});return{}.hasOwnProperty.call(t,`setPromise`)&&t.setPromise(i),i};pauseTimers(){this.areTimersPaused||(this.areTimersPaused=!0,this.timers.forEach(e=>{e.timeout&&(e.timeout.clear(),e.remaining=Math.max(e.remaining-(Date.now()-e.start),0))}))}resumeTimers(){this.areTimersPaused&&(this.areTimersPaused=!1,this.timers.forEach((e,t)=>{e.remaining=e.remaining>0?e.remaining:e.delay,e.timeout??=k.create(),e.timeout.start(e.remaining,()=>{this.handleTimerFired(t),e.callback()}),e.start=Date.now()}))}restoreFocusToPrevElement(){this.state.prevFocusElement?.focus({preventScroll:!0})}handleDocumentPointerDown=e=>{if(e.pointerType!==`touch`)return;let t=c(e);A(this.state.viewport,t)||(this.resumeTimers(),this.update({hovering:!1,focused:!1}))};scheduleTimer(e,t,n){let r=Date.now(),i=Z.expandedOrOutOfFocus(this.state)?void 0:k.create();i?.start(t,()=>{this.handleTimerFired(e),n()}),this.timers.set(e,{timeout:i,start:r,delay:t,remaining:t,callback:n})}clearTimers(){this.timers.forEach(e=>{e.timeout?.clear()}),this.timers.clear(),this.areTimersPaused=!1}clearTimer(e){this.timers.get(e)?.timeout?.clear(),this.timers.delete(e),this.resetPausedStateIfNoTimersRemain()}handleTimerFired(e){this.timers.delete(e),this.resetPausedStateIfNoTimersRemain()}resetPausedStateIfNoTimersRemain(){this.timers.size===0&&(this.areTimersPaused=!1)}setToasts(e,t=e.length===0){let n={toasts:e,toastMetadata:me(e)};t&&(n.hovering=!1,n.focused=!1),this.update(n)}handleFocusManagement(e){let t=m(S(this.state.viewport));if(!this.state.viewport||!A(this.state.viewport,t)||!u(t))return;if(e===void 0){this.restoreFocusToPrevElement();return}let n=Z.toasts(this.state),r=Z.toastIndex(this.state,e),i=(e,t)=>{for(let r=e;r>=0&&r<n.length;r+=t)if(n[r].transitionStatus!==`ending`)return n[r];return null},a=i(r+1,1)??i(r-1,-1);a?a.ref?.current?.focus():this.restoreFocusToPrevElement()}},Q=a(),_e=function(e){let{children:t,timeout:n=5e3,limit:r=3,toastManager:i}=e,a=I(()=>new ge({timeout:n,limit:r,viewport:null,toasts:[],hovering:!1,focused:!1,isWindowFocused:!0,prevFocusElement:null})).current;return D(a.disposeEffect),J.useEffect(function(){if(i)return i[` subscribe`](({action:e,options:t})=>{let n=t.id;e===`promise`&&t.promise?a.promiseToast(t.promise,t):e===`update`&&n?a.updateToast(n,t):e===`close`?a.closeToast(n):a.addToast(t)})},[a,i]),(0,Q.jsxs)(de.Provider,{value:a,children:[(0,Q.jsx)(ve,{store:a,timeout:n,limit:r}),t]})};function ve(e){let{store:t,timeout:n,limit:r}=e;return d(()=>{t.syncProviderProps(n,r)},[t,n,r]),null}var ye=J.forwardRef(function(e,t){let{render:n,className:r,style:i,children:a,...o}=e,l=Y(),d=T(),f=J.useRef(!1),g=J.useRef(!1),_=J.useRef(!1),v=l.useState(`isEmpty`),y=l.useState(`toasts`),b=l.useState(`focused`),x=l.useState(`expanded`),w=l.useState(`prevFocusElement`),E=y[0]?.height,D=y.some(e=>e.transitionStatus===`ending`),O=y.filter(e=>e.priority===`high`);J.useEffect(()=>{let e=l.state.viewport;if(!e||v)return;let t=p(e),n=S(e);function r(t){t.key===`F6`&&c(t)!==e&&(t.preventDefault(),l.set(`prevFocusElement`,m(n)),e?.focus({preventScroll:!0}),l.pauseTimers(),l.set(`focused`,!0))}function i(e){c(e)===t&&(l.set(`isWindowFocused`,!1),l.pauseTimers())}function a(n){if(n.relatedTarget)return;let r=c(n),i=m(S(e));(r===t||!A(e,r)||!u(i))&&l.resumeTimers(),d.start(0,()=>l.set(`isWindowFocused`,!0))}return s(C(t,`keydown`,r),C(t,`blur`,i,!0),C(t,`focus`,a,!0),C(n,`pointerdown`,l.handleDocumentPointerDown,!0))},[l,d,v]);function k(e){f.current=!0;let t=e.relatedTarget===l.state.viewport?y.find(e=>e.transitionStatus!==`ending`&&!e.limited):void 0;t?t.ref?.current?.focus():l.restoreFocusToPrevElement()}function te(e){e.key===`Tab`&&e.shiftKey&&c(e.nativeEvent)===l.state.viewport&&(e.preventDefault(),l.restoreFocusToPrevElement())}function j(){l.state.toasts.some(e=>e.transitionStatus===`ending`)||_.current||!g.current||(l.state.isWindowFocused&&l.resumeTimers(),l.set(`hovering`,!1),g.current=!1)}J.useEffect(j,[D,l]);function ne(){l.pauseTimers(),l.set(`hovering`,!0),g.current=!1}function re(){l.state.isWindowFocused&&l.resumeTimers()}function ie(){g.current=!0,j()}function M(e){e.pointerType===`touch`&&(_.current=!0)}function N(e){e.pointerType===`touch`&&(_.current=!1,j())}function P(){if(f.current){f.current=!1;return}b||u(m(S(l.state.viewport)))&&(l.set(`focused`,!0),l.pauseTimers())}function ae(e){!b||A(l.state.viewport,e.relatedTarget)||(l.set(`focused`,!1),re())}let I={tabIndex:-1,role:`region`,"aria-live":`polite`,"aria-atomic":!1,"aria-relevant":`additions text`,"aria-label":`Notifications`,onMouseEnter:ne,onMouseMove:ne,onMouseLeave:ie,onFocus:P,onBlur:ae,onKeyDown:te,onClick:P,onPointerDown:M,onPointerUp:N,onPointerCancel:N,style:{"--toast-frontmost-height":E?`${E}px`:void 0}},L={expanded:x},R=!v&&w&&(0,Q.jsx)(ee,{onFocus:k}),z=F(`div`,e,{ref:[t,l.setViewport],state:L,props:[I,o,{children:(0,Q.jsxs)(J.Fragment,{children:[R,a,R]})}]});return(0,Q.jsxs)(J.Fragment,{children:[R,z,!b&&O.length>0&&(0,Q.jsx)(`div`,{style:h,children:O.map(e=>(0,Q.jsxs)(`div`,{role:`alert`,"aria-atomic":!0,children:[(0,Q.jsx)(`div`,{children:e.title}),(0,Q.jsx)(`div`,{children:e.description})]},e.id))})]})}),be=e(ue(),1),xe=J.createContext(void 0);function Se(){let e=J.useContext(xe);if(!e)throw Error(M(66));return e}var Ce={...g,swipeDirection(e){return e?{"data-swipe-direction":e}:null}},we=40,Te=10,Ee=.5,De=1,Oe=`${v},${O}`,ke=J.forwardRef(function(e,t){let{toast:n,render:r,className:i,swipeDirection:a=[`down`,`right`],style:o,...s}=e,l=n.positionerProps?.anchor!==void 0,u=[];l||(u=Array.isArray(a)?a:[a]);let p=u.length>0,h=Y(),[g,_]=J.useState(void 0),[v,y]=J.useState(!1),[b,T]=J.useState(!1),[E,D]=J.useState({x:0,y:0}),[O,k]=J.useState({x:0,y:0,scale:1}),[ee,te]=J.useState(),[j,ie]=J.useState(),[M,N]=J.useState(null),P=J.useRef(null),ae=J.useRef(void 0),I=J.useRef({x:0,y:0}),L=J.useRef({x:0,y:0,scale:1}),R=J.useRef(void 0),z=J.useRef(0),B=J.useRef(!1),V=J.useRef({x:0,y:0}),oe=J.useRef(!1),se=J.useRef({x:0,y:0}),H=J.useRef(null),U=J.useRef(null),ce=h.useState(`toastIndex`,n.id),W=h.useState(`toastVisibleIndex`,n.id),le=h.useState(`toastOffsetY`,n.id),ue=h.useState(`focused`),G=h.useState(`expanded`);x({open:n.transitionStatus!==`ending`,ref:P,onComplete(){n.transitionStatus===`ending`&&h.removeToast(n.id)}});let K=f((e=!1)=>{let t=P.current;if(!t)return;let r=t.style.height;t.style.height=`auto`;let i=t.offsetHeight;t.style.height=r;function a(){h.updateToastInternal(n.id,{ref:P,height:i,transitionStatus:void 0})}e?be.flushSync(a):a()});d(()=>{let e=ae.current;(n.transitionStatus===`starting`||e!==n.id)&&(e!==void 0&&(_(void 0),k({x:0,y:0,scale:1}),q({x:0,y:0})),ae.current=n.id,K())},[K,n.id,n.transitionStatus]);function q(e){se.current=e,D(e)}d(()=>()=>{U.current?.abort()},[]);function de(e,t){let n=e=>e>0?e**Ee:-(Math.abs(e)**Ee),r=e>0&&!u.includes(`right`)||e<0&&!u.includes(`left`),i=t>0&&!u.includes(`down`)||t<0&&!u.includes(`up`);return{x:r?n(e):e,y:i?n(t):t}}let X=f(e=>{if(e.pointerId!==H.current)return;H.current=null,U.current?.abort(),U.current=null,y(!1),T(!1),N(null);let t=L.current;if(e.type===`pointercancel`||B.current){q({x:t.x,y:t.y}),_(void 0);return}let r=se.current,i=r.x-t.x,a=r.y-t.y,o;for(let e of u)if(re(e,i,a)>we){o=e;break}o?(_(o),h.closeToast(n.id)):(q({x:t.x,y:t.y}),_(void 0))});function fe(e){if(e.button!==0||(e.pointerType===`touch`&&h.pauseTimers(),c(e.nativeEvent)?.closest(`button,a,input,textarea,[role="button"],${Oe}`)))return;B.current=!1,R.current=void 0,z.current=0,H.current=e.pointerId,I.current={x:e.clientX,y:e.clientY},V.current=I.current;let t=e.currentTarget,n=ne(t);L.current=n,k(n),q({x:n.x,y:n.y}),h.set(`hovering`,!0),y(!0),T(!1),N(null),oe.current=!0,U.current?.abort();let r=new AbortController;U.current=r;let i=S(t);i.addEventListener(`pointerup`,X,{signal:r.signal}),i.addEventListener(`pointercancel`,X,{signal:r.signal}),t.setPointerCapture?.(e.pointerId)}function pe(e){if(e.pointerId!==H.current)return;e.preventDefault(),oe.current&&=(I.current={x:e.clientX,y:e.clientY},!1);let{clientY:t,clientX:n,movementX:r,movementY:i}=e;(i<0&&t>V.current.y||i>0&&t<V.current.y)&&(V.current={x:V.current.x,y:t}),(r<0&&n>V.current.x||r>0&&n<V.current.x)&&(V.current={x:n,y:V.current.y});let a=n-I.current.x,o=t-I.current.y,s=t-V.current.y,c=n-V.current.x,l=M;if(!b&&Math.sqrt(a*a+o*o)>=De){T(!0);let e=u.includes(`left`)||u.includes(`right`),t=u.includes(`up`)||u.includes(`down`);e&&t&&(l=Math.abs(a)>Math.abs(o)?`horizontal`:`vertical`,N(l))}let d;if(!R.current)l===`vertical`?o>0?d=`down`:o<0&&(d=`up`):l===`horizontal`?a>0?d=`right`:a<0&&(d=`left`):d=Math.abs(a)>=Math.abs(o)?a>0?`right`:`left`:o>0?`down`:`up`,d&&u.includes(d)&&(R.current=d,z.current=re(d,a,o),_(d));else{let e=R.current,t=re(e,c,s);t>we?(B.current=!1,_(e)):!(u.includes(`left`)&&u.includes(`right`))&&!(u.includes(`up`)&&u.includes(`down`))&&z.current-t>=Te&&(B.current=!0)}let f=de(a,o),p=L.current.x,m=L.current.y,h=u.includes(`left`)||u.includes(`right`),g=u.includes(`up`)||u.includes(`down`);l!==`vertical`&&h&&(p+=f.x),l!==`horizontal`&&g&&(m+=f.y),q({x:p,y:m})}function me(e){if(e.key===`Escape`){if(!P.current||!A(P.current,m(S(P.current))))return;h.closeToast(n.id)}}J.useEffect(()=>{let e=P.current;if(!p||!e)return;function t(t){H.current===null||!A(e,c(t))||t.preventDefault()}return C(e,`touchmove`,t,{passive:!1})},[p]);function he(){let e=E.x-O.x,t=E.y-O.y;return{transition:v?`none`:void 0,transform:v?`translateX(${E.x}px) translateY(${E.y}px) scale(${O.scale})`:void 0,"--toast-swipe-movement-x":`${e}px`,"--toast-swipe-movement-y":`${t}px`}}let Z=n.priority===`high`,ge={role:Z?`alertdialog`:`dialog`,tabIndex:0,"aria-modal":!1,"aria-labelledby":ee,"aria-describedby":j,"aria-hidden":Z&&!ue?!0:void 0,onPointerDown:p?fe:void 0,onPointerMove:p?pe:void 0,onPointerUp:p?X:void 0,onPointerCancel:p?X:void 0,onKeyDown:me,inert:w(n.limited),style:{...he(),"--toast-index":n.transitionStatus===`ending`?ce:W,"--toast-offset-y":`${le}px`,"--toast-height":n.height?`${n.height}px`:void 0}},_e=J.useMemo(()=>({toast:n,setTitleId:te,setDescriptionId:ie,recalculateHeight:K,visibleIndex:W,expanded:G}),[n,te,ie,K,W,G]),ve={transitionStatus:n.transitionStatus,expanded:G,limited:n.limited||!1,type:n.type,swiping:v,swipeDirection:g},ye=F(`div`,e,{ref:[t,P],state:ve,stateAttributesMapping:Ce,props:[ge,s]});return(0,Q.jsx)(xe.Provider,{value:_e,children:ye})}),Ae=J.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,{visibleIndex:o,expanded:s,recalculateHeight:c}=Se(),l=J.useRef(null);return d(()=>{c();let e=l.current;if(!e||typeof ResizeObserver!=`function`||typeof MutationObserver!=`function`)return;let t=new ResizeObserver(()=>c(!0)),n=new MutationObserver(()=>c(!0));return t.observe(e),n.observe(e,{childList:!0,subtree:!0,characterData:!0}),()=>{t.disconnect(),n.disconnect()}},[c]),F(`div`,e,{ref:[t,l],state:{expanded:s,behind:o>0},props:a})});function je(e){return e==null||typeof e==`boolean`||e===``?!1:!Array.isArray(e)||e.some(je)}function Me(e){return J.isValidElement(e)&&je(e.props.children)}function Ne(e,t,n){let{toast:r,setTitleId:i,setDescriptionId:a}=Se(),o=n===`title`?i:a,s=t??(n===`title`?r.title:r.description);return{id:_(e),children:s,type:r.type,setId:o}}function Pe(e,t,n){let r=Me(e);return d(()=>{if(r)return n(t),()=>{n(e=>e===t?void 0:e)}},[r,t,n]),r?e:null}var Fe=J.forwardRef(function(e,t){let{render:n,className:r,style:i,id:a,children:o,...s}=e,{id:c,children:l,type:u,setId:d}=Ne(a,o,`description`);return Pe(F(`p`,e,{ref:t,state:{type:u},props:{...s,id:c,children:l}}),c,d)}),Ie=J.forwardRef(function(e,t){let{render:n,className:r,style:i,id:a,children:o,...s}=e,{id:c,children:l,type:u,setId:d}=Ne(a,o,`title`);return Pe(F(`h2`,e,{ref:t,state:{type:u},props:{...s,id:c,children:l}}),c,d)}),Le=J.forwardRef(function(e,t){let{render:n,className:r,style:i,disabled:a,nativeButton:o=!0,...s}=e,c=Y(),{toast:l,expanded:u}=Se(),[d,f]=J.useState(!1),{getButtonProps:p,buttonRef:m}=W({disabled:a,native:o}),h={type:l.type};return F(`button`,e,{ref:[t,m],state:h,props:[{"aria-hidden":!u&&!d,onClick(){c.closeToast(l.id)},onFocus(){f(!0)},onBlur(){f(!1)}},s,p]})}),Re=J.forwardRef(function(e,t){let{render:n,className:r,style:i,disabled:a,nativeButton:o=!0,...s}=e,{toast:c}=Se(),l=c.actionProps?.children??s.children,{getButtonProps:u,buttonRef:d}=W({disabled:a,native:o}),f={type:c.type},p=F(`button`,e,{ref:[t,d],state:f,props:[s,c.actionProps,u,{children:l}]});return Me(p)?p:null}),ze=J.forwardRef(function(e,t){return(0,Q.jsx)(le,{ref:t,...e})}),Be=J.createContext(void 0);function Ve(){let e=J.useContext(Be);if(e===void 0)throw Error(M(84));return e}var He=J.forwardRef(function(e,t){let{toast:n,...r}=e,i=Y(),a=n.positionerProps??P,{render:o,className:s,anchor:c=a.anchor,positionMethod:l=a.positionMethod??`absolute`,side:u=a.side??`top`,align:d=a.align??`center`,sideOffset:f=a.sideOffset??0,alignOffset:p=a.alignOffset??0,collisionBoundary:m=a.collisionBoundary??`clipping-ancestors`,collisionPadding:h=a.collisionPadding??5,arrowPadding:g=a.arrowPadding??5,sticky:_=a.sticky??!1,disableAnchorTracking:v=a.disableAnchorTracking??!1,collisionAvoidance:x=a.collisionAvoidance??b,style:S,...C}=r,[w,T]=J.useState(null),D=i.useState(`toastIndex`,n.id),O=i.useState(`toastVisibleIndex`,n.id),k=te(c)?c:null,ee=V({open:!0,onOpenChange:ae,elements:{floating:w,reference:k}}),A=E({anchor:k,positionMethod:l,floatingRootContext:ee,mounted:!0,side:u,sideOffset:f,align:d,alignOffset:p,collisionBoundary:m,collisionPadding:h,sticky:_,arrowPadding:g,disableAnchorTracking:v,keepMounted:!0,collisionAvoidance:x}),j={side:A.side,align:A.align,anchorHidden:A.anchorHidden},ne=y(e,j,{styles:{...A.positionerStyles,"--toast-index":n.transitionStatus===`ending`?D:O},transitionStatus:n.transitionStatus,props:C,refs:[t,T]});return(0,Q.jsx)(Be.Provider,{value:A,children:ne})}),Ue=J.forwardRef(function(e,t){let{className:n,render:r,style:i,...a}=e,{arrowRef:o,side:s,align:c,arrowUncentered:l,arrowStyles:u}=Ve();return F(`div`,e,{state:{side:s,align:c,uncentered:l},ref:[t,o],props:[{style:u,"aria-hidden":!0},a]})});function We(){let e=Y(),t=e.useState(`toasts`);return J.useMemo(()=>({toasts:t,add:e.addToast,close:e.closeToast,update:e.updateToast,promise:e.promiseToast}),[t,e])}function Ge(){let e=new Set;function t(t){e.forEach(e=>e(t))}return{" subscribe":function(t){return e.add(t),()=>{e.delete(t)}},add(e){let n=e.id||fe(`toast`);return t({action:`add`,options:{...e,id:n,transitionStatus:`starting`}}),n},close(e){t({action:`close`,options:{id:e}})},update(e,n){t({action:`update`,options:{...n,id:e}})},promise(e,n){let r=e;return t({action:`promise`,options:{...n,promise:e,setPromise(e){r=e}}}),r}}}var Ke=t({Action:()=>Re,Arrow:()=>Ue,Close:()=>Le,Content:()=>Ae,Description:()=>Fe,Portal:()=>ze,Positioner:()=>He,Provider:()=>_e,Root:()=>ke,Title:()=>Ie,Viewport:()=>ye,createToastManager:()=>Ge,useToastManager:()=>We}),$=r();function qe(e,t){return t<=1?!1:e>0}function Je(e){let t=0,n=0,r=0,i=0,a=e.map(e=>{let a=Ye(e.height);if(e.transitionStatus===`ending`){let r={toast:e,visibleIndex:t,offsetY:n};return n+=a,t+=1,r}let o={toast:e,visibleIndex:r,offsetY:i};return n+=a,t+=1,i+=a,r+=1,o});return{frontmostHeight:Ye(e.find(e=>e.transitionStatus!==`ending`)?.height),items:a}}function Ye(e){return typeof e==`number`&&Number.isFinite(e)&&e>0?e:0}function Xe(e,t){if(e?.threadRef)return t!==null&&e.threadRef.environmentId===t.environmentId&&e.threadRef.threadId===t.threadId;let n=e?.threadId;return!n||t?.threadId===n}var Ze=Ge(),Qe=Ge(),$e=new Map,et={error:oe,info:q,loading:R,success:K,warning:U},tt=180;function nt(e,t){if(e===`error`&&typeof t==`string`&&!(t.length<tt))return`line-clamp-4`}var rt=`absolute z-20 -top-1.5 -right-1.5`,it=`[-webkit-app-region:no-drag]`,at=o(it,`app-toast-surface relative inline-flex size-6 shrink-0 cursor-pointer items-center justify-center rounded-full border text-muted-foreground shadow-sm outline-none`,`transition-[color,background-color,box-shadow] hover:text-foreground`,`focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1 focus-visible:ring-offset-background`);function ot(){let e=(0,$.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`span`,{"aria-hidden":`true`,className:`liquid-glass-ring`}),(0,Q.jsx)(`span`,{"aria-hidden":`true`,className:`liquid-glass-ring liquid-glass-ring--overlay`})]}),e[0]=t):t=e[0],t}function st(e,t,n){n?.(),e.close(t)}function ct(e){let t=(0,$.c)(8),{text:n}=e,{copyToClipboard:r,isCopied:i}=H(),a;t[0]!==r||t[1]!==n?(a=()=>r(n),t[0]=r,t[1]=n,t[2]=a):a=t[2];let o;t[3]===i?o=t[4]:(o=i?(0,Q.jsx)(L,{className:`size-3 text-success`}):(0,Q.jsx)(se,{className:`size-3`}),t[3]=i,t[4]=o);let s;return t[5]!==a||t[6]!==o?(s=(0,Q.jsx)(`button`,{className:`inline-flex size-5 shrink-0 cursor-pointer items-center justify-center rounded-md p-0 text-muted-foreground/80 transition-colors hover:text-muted-foreground`,onClick:a,title:`Copy error`,type:`button`,children:o}),t[5]=a,t[6]=o,t[7]=s):s=t[7],s}var lt=`mt-2 max-h-40 min-h-0 overflow-y-auto overscroll-contain pr-0.5 select-text`;function ut(e){let t=(0,$.c)(13),{children:n,labels:r}=e,[i,a]=(0,J.useState)(!1),o=r.expand??`Show details`,s=r.collapse??`Hide details`,c;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(c=()=>a(dt),t[0]=c):c=t[0];let l;t[1]===i?l=t[2]:(l=i?(0,Q.jsx)(B,{className:`size-3.5 shrink-0 opacity-80`,strokeWidth:2.25}):(0,Q.jsx)(z,{className:`size-3.5 shrink-0 opacity-80`,strokeWidth:2.25}),t[1]=i,t[2]=l);let u=i?s:o,d;t[3]!==i||t[4]!==l||t[5]!==u?(d=(0,Q.jsxs)(`button`,{"aria-expanded":i,className:`inline-flex cursor-pointer items-center gap-1 rounded-md py-0.5 text-left text-xs font-medium text-muted-foreground transition-colors hover:text-foreground`,onClick:c,type:`button`,children:[l,u]}),t[3]=i,t[4]=l,t[5]=u,t[6]=d):d=t[6];let f;t[7]!==n||t[8]!==i?(f=i?(0,Q.jsx)(`div`,{className:lt,children:n}):null,t[7]=n,t[8]=i,t[9]=f):f=t[9];let p;return t[10]!==d||t[11]!==f?(p=(0,Q.jsxs)(`div`,{className:`min-w-0`,children:[d,f]}),t[10]=d,t[11]=f,t[12]=p):p=t[12],p}function dt(e){return!e}function ft(e){let t=(0,$.c)(36),{toastData:n,toastDescription:r,toastType:i}=e,a=n?.expandableContent,s;t[0]===n?.expandableLabels?s=t[1]:(s=n?.expandableLabels??{},t[0]=n?.expandableLabels,t[1]=s);let c=s,l=n?.expandableDescriptionTrigger??!1,u;t[2]!==r||t[3]!==i?(u=o(`min-w-0 select-text wrap-break-word text-muted-foreground`,nt(i,r)),t[2]=r,t[3]=i,t[4]=u):u=t[4];let d=u,[f,p]=(0,J.useState)(!1);if(!a){let e;return t[5]===d?e=t[6]:(e=(0,Q.jsx)(Fe,{className:d,"data-slot":`toast-description`}),t[5]=d,t[6]=e),e}if(!l){let e;t[7]===d?e=t[8]:(e=(0,Q.jsx)(Fe,{className:d,"data-slot":`toast-description`}),t[7]=d,t[8]=e);let n;t[9]!==a||t[10]!==c?(n=(0,Q.jsx)(ut,{labels:c,children:a}),t[9]=a,t[10]=c,t[11]=n):n=t[11];let r;return t[12]!==e||t[13]!==n?(r=(0,Q.jsxs)(Q.Fragment,{children:[e,n]}),t[12]=e,t[13]=n,t[14]=r):r=t[14],r}let m=c.expand??`Show details`,h=c.collapse??`Hide details`,g;t[15]===Symbol.for(`react.memo_cache_sentinel`)?(g=()=>p(pt),t[15]=g):g=t[15];let _=g,v;t[16]===Symbol.for(`react.memo_cache_sentinel`)?(v=e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),_())},t[16]=v):v=t[16];let y=v,b;t[17]===Symbol.for(`react.memo_cache_sentinel`)?(b=o(`group flex min-w-0 w-full cursor-pointer select-none items-start gap-1.5 rounded-sm text-left outline-none ring-offset-background`,`transition-colors hover:bg-muted/40`,`focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1 focus-visible:ring-offset-background`),t[17]=b):b=t[17];let x=f?h:m,S;t[18]!==r||t[19]!==i?(S=o(`min-w-0 select-none wrap-break-word text-muted-foreground`,nt(i,r),`underline-offset-2 decoration-muted-foreground/60 group-hover:underline`),t[18]=r,t[19]=i,t[20]=S):S=t[20];let C;t[21]===S?C=t[22]:(C=(0,Q.jsx)(`div`,{className:`min-w-0 flex-1`,children:(0,Q.jsx)(Fe,{className:S,"data-slot":`toast-description`})}),t[21]=S,t[22]=C);let w;t[23]===f?w=t[24]:(w=f?(0,Q.jsx)(B,{"aria-hidden":!0,className:`mt-0.5 size-3.5 shrink-0 text-muted-foreground opacity-80`,strokeWidth:2.25}):(0,Q.jsx)(z,{"aria-hidden":!0,className:`mt-0.5 size-3.5 shrink-0 text-muted-foreground opacity-80`,strokeWidth:2.25}),t[23]=f,t[24]=w);let T;t[25]!==f||t[26]!==x||t[27]!==C||t[28]!==w?(T=(0,Q.jsxs)(`div`,{"aria-expanded":f,className:b,onClick:_,onKeyDown:y,role:`button`,tabIndex:0,title:x,children:[C,w]}),t[25]=f,t[26]=x,t[27]=C,t[28]=w,t[29]=T):T=t[29];let E;t[30]!==a||t[31]!==f?(E=f?(0,Q.jsx)(`div`,{className:lt,children:a}):null,t[30]=a,t[31]=f,t[32]=E):E=t[32];let D;return t[33]!==T||t[34]!==E?(D=(0,Q.jsxs)(Q.Fragment,{children:[T,E]}),t[33]=T,t[34]=E,t[35]=D):D=t[35],D}function pt(e){return!e}function mt(e){let t=e.type?et[e.type]:null,n=e.actionProps!==void 0&&e.data?.actionLayout===`stacked-end`,r=e.data?.actionVariant??`default`,i=e.data?.secondaryActionVariant??`outline`,a=e.type===`error`&&typeof e.description==`string`&&!e.data?.hideCopyButton?e.description:null,o=e.data?.secondaryActionProps!==void 0,s=a!==null||e.actionProps!==void 0||o;return{Icon:t,stackedActionLayout:n,actionVariant:r,secondaryActionVariant:i,copyErrorText:a,hasTrailingControls:s,inlineContentEndPad:s?`pr-6`:`pr-10`}}function ht(e){let t=(0,$.c)(37),{stackedActionLayout:n,Icon:r,copyErrorText:i,actionProps:a,actionVariant:s,secondaryActionVariant:c,hasTrailingControls:l,toastData:u,toastDescription:d,toastType:f}=e,p=u?.secondaryActionProps,m=u?.leadingIcon,h;t[0]===p?h=t[1]:(h=p??{},t[0]=p,t[1]=h);let g,_;t[2]===h?(g=t[3],_=t[4]):({className:g,..._}=h,t[2]=h,t[3]=g,t[4]=_);let v=!n&&`flex-1`,y;t[5]===v?y=t[6]:(y=o(`flex min-w-0 gap-2`,v),t[5]=v,t[6]=y);let b;t[7]!==r||t[8]!==m?(b=m?(0,Q.jsx)(`div`,{className:`flex h-lh w-4 shrink-0 items-center justify-center`,"data-slot":`toast-icon`,children:m}):r?(0,Q.jsx)(`div`,{className:`[&>svg]:h-lh [&>svg]:w-4 [&_svg]:pointer-events-none [&_svg]:shrink-0`,"data-slot":`toast-icon`,children:(0,Q.jsx)(r,{className:`in-data-[type=loading]:animate-spin in-data-[type=error]:text-destructive in-data-[type=info]:text-info in-data-[type=success]:text-success in-data-[type=warning]:text-warning in-data-[type=loading]:opacity-80`})}):null,t[7]=r,t[8]=m,t[9]=b):b=t[9];let x=n&&`pr-5`,S;t[10]===x?S=t[11]:(S=o(`flex min-h-0 min-w-0 flex-1 flex-col gap-0.5`,x),t[10]=x,t[11]=S);let C;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(C=(0,Q.jsx)(Ie,{className:`min-w-0 wrap-break-word font-medium`,"data-slot":`toast-title`}),t[12]=C):C=t[12];let w;t[13]!==u||t[14]!==d||t[15]!==f?(w=(0,Q.jsx)(ft,{toastData:u,toastDescription:d,toastType:f}),t[13]=u,t[14]=d,t[15]=f,t[16]=w):w=t[16];let T;t[17]!==S||t[18]!==w?(T=(0,Q.jsxs)(`div`,{className:S,children:[C,w]}),t[17]=S,t[18]=w,t[19]=T):T=t[19];let E;t[20]!==y||t[21]!==b||t[22]!==T?(E=(0,Q.jsxs)(`div`,{className:y,children:[b,T]}),t[20]=y,t[21]=b,t[22]=T,t[23]=E):E=t[23];let D;t[24]!==a||t[25]!==s||t[26]!==i||t[27]!==l||t[28]!==g||t[29]!==p||t[30]!==_||t[31]!==c||t[32]!==n?(D=l?(0,Q.jsxs)(`div`,{className:o(`flex items-center gap-1.5`,n?`w-full justify-end`:`shrink-0`),children:[i===null?null:(0,Q.jsx)(ct,{text:i}),p?(0,Q.jsx)(`button`,{..._,className:o(G({size:`xs`,variant:c}),g),type:`button`}):null,a?(0,Q.jsx)(Re,{className:o(G({size:`xs`,variant:s}),`shrink-0`),"data-slot":`toast-action`,children:a.children}):null]}):null,t[24]=a,t[25]=s,t[26]=i,t[27]=l,t[28]=g,t[29]=p,t[30]=_,t[31]=c,t[32]=n,t[33]=D):D=t[33];let O;return t[34]!==E||t[35]!==D?(O=(0,Q.jsxs)(Q.Fragment,{children:[E,D]}),t[34]=E,t[35]=D,t[36]=O):O=t[36],O}function gt(){let e=(0,$.c)(6),t;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t={strict:!1,select:_t},e[0]=t):t=e[0];let n=j(t),r;e[1]===n?r=e[2]:(r=e=>n?.kind===`draft`?e.getDraftSession(n.draftId):null,e[1]=n,e[2]=r);let a=i(r),o;bb0:{if(n?.kind===`server`){o=n.threadRef;break bb0}if(n?.kind===`draft`&&a){let t;e[3]!==a.environmentId||e[4]!==a.threadId?(t={environmentId:a.environmentId,threadId:a.threadId},e[3]=a.environmentId,e[4]=a.threadId,e[5]=t):t=e[5],o=t;break bb0}o=null}return o}function _t(e){return ie(e)}function vt(e){let t=(0,$.c)(4),{toastId:n,dismissAfterVisibleMs:r}=e,i,a;return t[0]!==r||t[1]!==n?(i=()=>{if(!r||r<=0||typeof window>`u`||typeof document>`u`)return;let e=$e.get(n)??r,t=null,i=null,a=!1,o=()=>{i!==null&&(window.clearTimeout(i),i=null)},s=()=>{a||(a=!0,$e.delete(n),Ze.close(n))},c=()=>{t!==null&&(e=Math.max(0,e-(Date.now()-t)),t=null,o(),$e.set(n,e))},l=()=>{if(!(a||t!==null)){if(e<=0){s();return}t=Date.now(),o(),i=window.setTimeout(()=>{e=0,t=null,s()},e)}},u=()=>{if(document.visibilityState===`visible`&&document.hasFocus()){l();return}c()};return u(),document.addEventListener(`visibilitychange`,u),window.addEventListener(`focus`,u),window.addEventListener(`blur`,u),()=>{document.removeEventListener(`visibilitychange`,u),window.removeEventListener(`focus`,u),window.removeEventListener(`blur`,u),c(),o()}},a=[r,n],t[0]=r,t[1]=n,t[2]=i,t[3]=a):(i=t[2],a=t[3]),(0,J.useEffect)(i,a),null}function yt(e){let t=(0,$.c)(10),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({children:n,position:i,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let a=i===void 0?`top-center`:i,o;t[4]===a?o=t[5]:(o=(0,Q.jsx)(bt,{position:a}),t[4]=a,t[5]=o);let s;return t[6]!==n||t[7]!==r||t[8]!==o?(s=(0,Q.jsxs)(_e,{toastManager:Ze,...r,children:[n,o]}),t[6]=n,t[7]=r,t[8]=o,t[9]=s):s=t[9],s}function bt(e){let t=(0,$.c)(19),{position:n}=e,r=n===void 0?`top-center`:n,{toasts:i}=We(),a=gt(),s;t[0]===r?s=t[1]:(s=r.startsWith(`top`),t[0]=r,t[1]=s);let c=s,l;t[2]===a?l=t[3]:(l=e=>Xe(e.data,a),t[2]=a,t[3]=l);let u=Je(i.filter(l)),d,f;t[4]===i?(d=t[5],f=t[6]):(d=()=>{let e=new Set(i.map(xt));for(let t of $e.keys())e.has(t)||$e.delete(t)},f=[i],t[4]=i,t[5]=d,t[6]=f),(0,J.useEffect)(d,f);let p=Ke,m=Ke,h;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(h=o(`fixed z-100 mx-auto flex w-[calc(100%-var(--toast-inset)*2)] max-w-90 not-phone:max-w-105 phone:[--toast-top:calc(var(--toast-inset)+76px)] not-phone:[--toast-top:--spacing(3)] [--toast-inset:--spacing(4)] sm:[--toast-inset:--spacing(8)]`,`data-[position*=top]:top-(--toast-top)`,`data-[position*=bottom]:bottom-(--toast-inset)`,`data-[position*=left]:left-(--toast-inset)`,`data-[position*=right]:right-(--toast-inset)`,`data-[position*=center]:-translate-x-1/2 data-[position*=center]:left-1/2`),t[7]=h):h=t[7];let g=`${u.frontmostHeight}px`,_;t[8]===g?_=t[9]:(_={"--toast-frontmost-height":g},t[8]=g,t[9]=_);let v=_,y=u.items.map(e=>{let{toast:t,visibleIndex:n,offsetY:i}=e,a=qe(n,u.items.length),s=mt(t),{stackedActionLayout:l,inlineContentEndPad:d}=s;return(0,Q.jsxs)(ke,{className:o(it,`app-toast-surface absolute z-[calc(9999-var(--toast-index))] w-full overflow-visible select-none rounded-xl border not-dark:bg-clip-padding text-popover-foreground shadow-xl/5 [transition:transform_var(--app-motion-duration-stack)_var(--app-motion-spring-snappy),opacity_var(--app-motion-duration-pop)_var(--app-motion-spring-gentle),height_var(--app-motion-duration-chip)] before:pointer-events-none before:absolute before:inset-0 before:rounded-[calc(var(--radius-xl)-1px)] before:shadow-[0_1px_--theme(--color-black/4%)] dark:before:shadow-[0_-1px_--theme(--color-white/6%)]`,`data-[position*=right]:right-0 data-[position*=right]:left-auto`,`data-[position*=left]:right-auto data-[position*=left]:left-0`,`data-[position*=center]:right-0 data-[position*=center]:left-0`,`data-[position*=top]:top-0 data-[position*=top]:bottom-auto data-[position*=top]:origin-top`,`data-[position*=bottom]:top-auto data-[position*=bottom]:bottom-0 data-[position*=bottom]:origin-bottom`,`after:absolute after:left-0 after:h-[calc(var(--toast-gap)+1px)] after:w-full`,`data-[position*=top]:after:top-full`,`data-[position*=bottom]:after:bottom-full`,n>0?`not-data-expanded:[--toast-calc-height:var(--toast-frontmost-height)] data-expanded:[--toast-calc-height:max(var(--toast-frontmost-height,var(--toast-height)),var(--toast-height))]`:`[--toast-calc-height:max(var(--toast-frontmost-height,var(--toast-height)),var(--toast-height))]`,`[--toast-gap:--spacing(3)] [--toast-peek:--spacing(3)] [--toast-scale:calc(max(0,1-(var(--toast-index)*.1)))] [--toast-shrink:calc(1-var(--toast-scale))]`,n>0?`not-data-expanded:h-(--toast-calc-height) data-expanded:h-auto`:`h-auto`,`data-[position*=top]:[--toast-calc-offset-y:calc(var(--toast-offset-y)+var(--toast-index)*var(--toast-gap)+var(--toast-swipe-movement-y))]`,`data-[position*=bottom]:[--toast-calc-offset-y:calc(var(--toast-offset-y)*-1+var(--toast-index)*var(--toast-gap)*-1+var(--toast-swipe-movement-y))]`,`data-[position*=top]:transform-[translateX(var(--toast-swipe-movement-x))_translateY(calc(var(--toast-swipe-movement-y)+(var(--toast-index)*var(--toast-peek))+(var(--toast-shrink)*var(--toast-calc-height))))_scale(var(--toast-scale))]`,`data-[position*=bottom]:transform-[translateX(var(--toast-swipe-movement-x))_translateY(calc(var(--toast-swipe-movement-y)-(var(--toast-index)*var(--toast-peek))-(var(--toast-shrink)*var(--toast-calc-height))))_scale(var(--toast-scale))]`,`data-limited:opacity-0`,`data-position:data-expanded:transform-[translateX(var(--toast-swipe-movement-x))_translateY(var(--toast-calc-offset-y))]`,`data-starting-style:opacity-0`,`data-[position*=top]:data-starting-style:transform-[translateY(-1rem)_scale(0.95)]`,`data-[position*=bottom]:data-starting-style:transform-[translateY(calc(100%+var(--toast-inset)))]`,`data-ending-style:opacity-0`,`data-[position*=top]:not-data-expanded:data-ending-style:not-data-limited:not-data-swipe-direction:transform-[translateY(calc(var(--toast-index)*var(--toast-peek)+var(--toast-shrink)*var(--toast-calc-height)-0.5rem))_scale(calc(var(--toast-scale)-0.03))]`,`data-[position*=top]:data-expanded:data-ending-style:not-data-limited:not-data-swipe-direction:transform-[translateY(calc(var(--toast-calc-offset-y)-0.5rem))_scale(0.97)]`,`data-[position*=bottom]:data-ending-style:not-data-limited:not-data-swipe-direction:transform-[translateY(calc(100%+var(--toast-inset)))]`,`data-ending-style:data-[swipe-direction=left]:transform-[translateX(calc(var(--toast-swipe-movement-x)-100%-var(--toast-inset)))_translateY(var(--toast-calc-offset-y))]`,`data-ending-style:data-[swipe-direction=right]:transform-[translateX(calc(var(--toast-swipe-movement-x)+100%+var(--toast-inset)))_translateY(var(--toast-calc-offset-y))]`,`data-ending-style:data-[swipe-direction=up]:transform-[translateY(calc(var(--toast-swipe-movement-y)-100%-var(--toast-inset)))]`,`data-ending-style:data-[swipe-direction=down]:transform-[translateY(calc(var(--toast-swipe-movement-y)+100%+var(--toast-inset)))]`,`data-expanded:data-ending-style:data-[swipe-direction=left]:transform-[translateX(calc(var(--toast-swipe-movement-x)-100%-var(--toast-inset)))_translateY(var(--toast-calc-offset-y))]`,`data-expanded:data-ending-style:data-[swipe-direction=right]:transform-[translateX(calc(var(--toast-swipe-movement-x)+100%+var(--toast-inset)))_translateY(var(--toast-calc-offset-y))]`,`data-expanded:data-ending-style:data-[swipe-direction=up]:transform-[translateY(calc(var(--toast-swipe-movement-y)-100%-var(--toast-inset)))]`,`data-expanded:data-ending-style:data-[swipe-direction=down]:transform-[translateY(calc(var(--toast-swipe-movement-y)+100%+var(--toast-inset)))]`),"data-position":r,"data-slot":`toast-root`,style:{"--toast-index":n,"--toast-offset-y":`${i}px`},swipeDirection:r.includes(`center`)?[c?`up`:`down`]:r.includes(`left`)?[`left`,c?`up`:`down`]:[`right`,c?`up`:`down`],toast:t,children:[(0,Q.jsx)(ot,{}),(0,Q.jsx)(vt,{dismissAfterVisibleMs:t.data?.dismissAfterVisibleMs,toastId:t.id}),(0,Q.jsx)(`div`,{className:rt,children:(0,Q.jsxs)(`button`,{"aria-label":`Dismiss notification`,className:at,"data-slot":`toast-close`,onClick:()=>st(Ze,t.id,t.data?.onClose),type:`button`,children:[(0,Q.jsx)(ot,{}),(0,Q.jsx)(ce,{className:`size-3`,strokeWidth:2.25})]})}),(0,Q.jsx)(Ae,{className:o(`pointer-events-auto min-h-0 overflow-y-visible pl-3.5 text-sm transition-opacity duration-(--app-motion-duration-pop) [overflow-x:clip] data-expanded:opacity-100`,l?`flex flex-col gap-2 py-2.5 pr-3.5`:o(`py-3`,`flex items-center justify-between gap-1.5`,d),a&&`not-data-expanded:pointer-events-none not-data-expanded:opacity-0`),children:(0,Q.jsx)(ht,{...s,actionProps:t.actionProps,toastData:t.data,toastDescription:t.description,toastType:t.type})})]},t.id)}),b;t[10]!==r||t[11]!==v||t[12]!==y||t[13]!==m.Viewport||t[14]!==h?(b=(0,Q.jsx)(m.Viewport,{className:h,"data-position":r,"data-slot":`toast-viewport`,style:v,children:y}),t[10]=r,t[11]=v,t[12]=y,t[13]=m.Viewport,t[14]=h,t[15]=b):b=t[15];let x;return t[16]!==b||t[17]!==p.Portal?(x=(0,Q.jsx)(p.Portal,{"data-slot":`toast-portal`,children:b}),t[16]=b,t[17]=p.Portal,t[18]=x):x=t[18],x}function xt(e){return e.id}function St(e){let t=(0,$.c)(7),n,r;t[0]===e?(n=t[1],r=t[2]):({children:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,Q.jsx)(Ct,{}),t[3]=i):i=t[3];let a;return t[4]!==n||t[5]!==r?(a=(0,Q.jsxs)(_e,{toastManager:Qe,...r,children:[n,i]}),t[4]=n,t[5]=r,t[6]=a):a=t[6],a}function Ct(){let e=(0,$.c)(7),{toasts:t}=We(),n=gt(),r;if(e[0]!==n||e[1]!==t){let i;e[3]===n?i=e[4]:(i=e=>Xe(e.data,n),e[3]=n,e[4]=i),r=t.filter(i).map(wt),e[0]=n,e[1]=t,e[2]=r}else r=e[2];let i;return e[5]===r?i=e[6]:(i=(0,Q.jsx)(ze,{"data-slot":`toast-portal-anchored`,children:(0,Q.jsx)(ye,{className:`outline-none`,"data-slot":`toast-viewport-anchored`,children:r})}),e[5]=r,e[6]=i),i}function wt(e){let t=e.data?.tooltipStyle??!1,n=e.positionerProps,r=mt(e),{stackedActionLayout:i,inlineContentEndPad:a}=r;return n?.anchor?(0,Q.jsx)(He,{className:`z-100 max-w-[min(--spacing(64),var(--available-width))]`,"data-slot":`toast-positioner`,sideOffset:n.sideOffset??4,toast:e,children:(0,Q.jsxs)(ke,{className:o(it,`app-toast-surface relative overflow-visible text-balance border not-dark:bg-clip-padding text-popover-foreground text-xs transition-[scale,opacity] duration-(--app-motion-duration-pop) before:pointer-events-none before:absolute before:inset-0 before:shadow-[0_1px_--theme(--color-black/4%)] data-ending-style:scale-98 data-starting-style:scale-98 data-ending-style:opacity-0 data-starting-style:opacity-0 dark:before:shadow-[0_-1px_--theme(--color-white/6%)]`,t?`rounded-md shadow-md/5 before:rounded-[calc(var(--radius-md)-1px)]`:`rounded-lg shadow-lg/5 before:rounded-[calc(var(--radius-lg)-1px)]`),"data-slot":`toast-popup`,toast:e,children:[(0,Q.jsx)(ot,{}),t?(0,Q.jsx)(Ae,{className:`pointer-events-auto px-2 py-1`,children:(0,Q.jsx)(Ie,{"data-slot":`toast-title`})}):(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`div`,{className:rt,children:(0,Q.jsxs)(`button`,{"aria-label":`Dismiss notification`,className:at,"data-slot":`toast-close`,onClick:()=>st(Qe,e.id,e.data?.onClose),type:`button`,children:[(0,Q.jsx)(ot,{}),(0,Q.jsx)(ce,{className:`size-3`,strokeWidth:2.25})]})}),(0,Q.jsx)(Ae,{className:o(`pointer-events-auto min-h-0 overflow-y-visible pl-3.5 text-sm [overflow-x:clip]`,i?`flex flex-col gap-2 py-2.5 pr-3.5`:o(`py-3`,`flex items-center justify-between gap-1.5`,a)),children:(0,Q.jsx)(ht,{...r,actionProps:e.actionProps,toastData:e.data,toastDescription:e.description,toastType:e.type})})]})]})},e.id):null}export{q as a,Ze as i,yt as n,K as o,Qe as r,St as t};
@@ -1 +0,0 @@
1
- import{i as e,t}from"./react-SIfiwpqq.js";import{t as n}from"./compiler-runtime-qmuS0Svy.js";import{f as r,t as i,u as a}from"./utils-c6dglOTK.js";import{Sn as o,in as s,on as c}from"./usePopupViewport-wXfO6SZE.js";import{t as l}from"./useRenderElement-DchFnsR8.js";import{t as u}from"./useButton-_xmxdcVX.js";import{n as d}from"./clamp-CgH0Dl6R.js";import{t as f}from"./CompositeItem-e0rusLTG.js";var p=e(t(),1),m=p.createContext(void 0);function h(){return p.useContext(m)}var g=r(),_=p.forwardRef(function(e,t){let{className:n,defaultPressed:r=!1,disabled:i=!1,form:a,onPressedChange:m,pressed:_,render:v,type:y,value:b,nativeButton:x=!0,style:S,...C}=e,w=s(b||void 0),T=h(),E=T?.value??[],D=T?void 0:r,O=(i||T?.disabled)??!1,[k,A]=d({controlled:T?w!==void 0&&E.indexOf(w)>-1:_,default:D,name:`Toggle`,state:`pressed`}),{getButtonProps:j,buttonRef:M}=u({disabled:O,native:x}),N={disabled:O,pressed:k},P=[M,t],F=[{"aria-pressed":k,onClick(e){let t=!k,n=c(o,e.nativeEvent);m?.(t,n),!n.isCanceled&&(w&&T?.setGroupValue?.(w,t,n),!n.isCanceled&&A(t))}},C,j],I=l(`button`,e,{enabled:!T,state:N,ref:P,props:F}),L=p.useMemo(()=>({disabled:O,focusableWhenDisabled:!1}),[O]);return T?(0,g.jsx)(f,{tag:`button`,render:v,className:n,style:S,metadata:L,state:N,refs:P,props:F}):I}),v=n(),y=a(`[&_svg]:-mx-0.5 relative inline-flex shrink-0 cursor-pointer select-none items-center justify-center gap-2 whitespace-nowrap rounded-lg border font-medium text-base text-foreground outline-none transition-shadow before:pointer-events-none before:absolute before:inset-0 before:rounded-[calc(var(--radius-lg)-1px)] pointer-coarse:after:absolute pointer-coarse:after:top-1/2 pointer-coarse:after:left-1/2 pointer-coarse:after:size-full pointer-coarse:after:min-h-11 pointer-coarse:after:min-w-11 pointer-coarse:after:-translate-x-1/2 pointer-coarse:after:-translate-y-1/2 hover:bg-accent focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1 focus-visible:ring-offset-background disabled:pointer-events-none disabled:opacity-64 data-pressed:bg-input/64 data-pressed:text-accent-foreground sm:text-sm [&_svg:not([class*='opacity-'])]:opacity-80 [&_svg:not([class*='size-'])]:size-4.5 sm:[&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0`,{defaultVariants:{size:`default`,variant:`default`},variants:{size:{default:`h-9 min-w-9 px-[calc(--spacing(2)-1px)] sm:h-8 sm:min-w-8`,lg:`h-10 min-w-10 px-[calc(--spacing(2.5)-1px)] sm:h-9 sm:min-w-9`,sm:`h-8 min-w-8 px-[calc(--spacing(1.5)-1px)] sm:h-7 sm:min-w-7`,xs:`h-7 min-w-7 px-[calc(--spacing(1)-1px)] sm:h-6 sm:min-w-6 rounded-md`},variant:{default:`border-transparent`,outline:`border-input bg-background not-dark:bg-clip-padding shadow-xs/5 not-disabled:not-active:not-data-pressed:before:shadow-[0_1px_--theme(--color-black/4%)] dark:bg-input/32 dark:data-pressed:bg-input dark:hover:bg-input/64 dark:not-disabled:not-active:not-data-pressed:before:shadow-[0_-1px_--theme(--color-white/6%)] dark:not-disabled:not-data-pressed:before:shadow-[0_-1px_--theme(--color-white/2%)] [:disabled,:active,[data-pressed]]:shadow-none`}}});function b(e){let t=(0,v.c)(12),n,r,a,o;t[0]===e?(n=t[1],r=t[2],a=t[3],o=t[4]):({className:n,variant:o,size:a,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=a,t[4]=o);let s;t[5]!==n||t[6]!==a||t[7]!==o?(s=i(y({className:n,size:a,variant:o})),t[5]=n,t[6]=a,t[7]=o,t[8]=s):s=t[8];let c;return t[9]!==r||t[10]!==s?(c=(0,g.jsx)(_,{className:s,"data-slot":`toggle`,...r}),t[9]=r,t[10]=s,t[11]=c):c=t[11],c}export{m as n,b as t};
@@ -1 +0,0 @@
1
- import{i as e,t}from"./react-SIfiwpqq.js";import{t as n}from"./compiler-runtime-qmuS0Svy.js";import{f as r,t as i}from"./utils-c6dglOTK.js";import{Nn as a}from"./usePopupViewport-wXfO6SZE.js";import{a as o,t as s}from"./useRenderElement-DchFnsR8.js";import{n as c}from"./clamp-CgH0Dl6R.js";import{t as l}from"./ToolbarRootContext-CgV898DN.js";import"./separator-CaVw81t6.js";import{t as u}from"./CompositeRoot-vnNIb6NL.js";import{n as d,t as f}from"./toggle-BIs83JSj.js";var p=e(t(),1),m=p.createContext(void 0);function h(){return p.useContext(m)}var g=r(),_=p.forwardRef(function(e,t){let{defaultValue:n,disabled:r=!1,loopFocus:i=!0,onValueChange:f,orientation:m=`horizontal`,multiple:_=!1,value:v,className:y,render:b,style:x,...S}=e,C=l(!0),w=h(),T=v!==void 0||n!==void 0,E=(C?.disabled??!1)||(w?.disabled??!1)||r,[D,O]=c({controlled:v,default:v===void 0?n??o:void 0,name:`ToggleGroup`,state:`value`}),k=a((e,t,n)=>{let r;_?(r=D.slice(),t?r.push(e):r.splice(D.indexOf(e),1)):r=t?[e]:[],f?.(r,n),!n.isCanceled&&O(r)}),A={disabled:E,multiple:_,orientation:m},j=p.useMemo(()=>({disabled:E,setGroupValue:k,value:D,isValueInitialized:T}),[E,k,D,T]),M={role:`group`},N=s(`div`,e,{enabled:!!C,state:A,ref:t,props:[M,S]});return(0,g.jsx)(d.Provider,{value:j,children:C?N:(0,g.jsx)(u,{render:b,className:y,style:x,state:A,refs:[t],props:[M,S],loopFocus:i,enableHomeAndEndKeys:!0,orientation:m})})}),v=n(),y=p.createContext({size:`default`,variant:`default`});function b(e){let t=(0,v.c)(24),n,r,a,o,s,c;t[0]===e?(n=t[1],r=t[2],a=t[3],o=t[4],s=t[5],c=t[6]):({className:r,variant:o,size:s,orientation:c,children:n,...a}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=a,t[4]=o,t[5]=s,t[6]=c);let l=o===void 0?`default`:o,u=s===void 0?`default`:s,d=c===void 0?`horizontal`:c,f;t[7]!==u||t[8]!==l?(f={size:u,variant:l},t[7]=u,t[8]=l,t[9]=f):f=t[9];let p=f,m=d===`horizontal`?`*:pointer-coarse:after:min-w-auto`:`*:pointer-coarse:after:min-h-auto`,h=l==="default"?`gap-0.5`:d===`horizontal`?`*:not-first:not-data-[slot=separator]:before:-start-[0.5px] *:not-last:not-data-[slot=separator]:before:-end-[0.5px] *:not-first:rounded-s-none *:not-last:rounded-e-none *:not-first:border-s-0 *:not-last:border-e-0 *:not-first:before:rounded-s-none *:not-last:before:rounded-e-none`:`*:not-first:not-data-[slot=separator]:before:-top-[0.5px] *:not-last:not-data-[slot=separator]:before:-bottom-[0.5px] flex-col *:not-first:rounded-t-none *:not-last:rounded-b-none *:not-first:border-t-0 *:not-last:border-b-0 *:not-first:before:rounded-t-none *:not-last:before:rounded-b-none *:data-[slot=toggle]:not-last:before:hidden dark:*:last:before:hidden dark:*:first:before:block`,b;t[10]!==r||t[11]!==m||t[12]!==h?(b=i(`flex w-fit *:focus-visible:z-10 dark:*:[[data-slot=separator]:has(+[data-slot=toggle]:hover)]:before:bg-input/64 dark:*:[[data-slot=separator]:has(+[data-slot=toggle][data-pressed])]:before:bg-input dark:*:[[data-slot=toggle]:hover+[data-slot=separator]]:before:bg-input/64 dark:*:[[data-slot=toggle][data-pressed]+[data-slot=separator]]:before:bg-input`,m,h,r),t[10]=r,t[11]=m,t[12]=h,t[13]=b):b=t[13];let x;t[14]!==n||t[15]!==p?(x=(0,g.jsx)(y.Provider,{value:p,children:n}),t[14]=n,t[15]=p,t[16]=x):x=t[16];let S;return t[17]!==d||t[18]!==a||t[19]!==u||t[20]!==b||t[21]!==x||t[22]!==l?(S=(0,g.jsx)(_,{className:b,"data-size":u,"data-slot":`toggle-group`,"data-variant":l,orientation:d,...a,children:x}),t[17]=d,t[18]=a,t[19]=u,t[20]=b,t[21]=x,t[22]=l,t[23]=S):S=t[23],S}function x(e){let t=(0,v.c)(12),n,r,i,a,o;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4],o=t[5]):({className:r,children:n,variant:o,size:a,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=o);let s=p.useContext(y),c=o??s.variant,l=a??s.size,u;return t[6]!==n||t[7]!==r||t[8]!==i||t[9]!==l||t[10]!==c?(u=(0,g.jsx)(f,{className:r,"data-size":l,"data-variant":c,size:l,variant:c,...i,children:n}),t[6]=n,t[7]=r,t[8]=i,t[9]=l,t[10]=c,t[11]=u):u=t[11],u}export{b as n,x as t};
@@ -1 +0,0 @@
1
- import{i as e,t}from"./react-SIfiwpqq.js";import{t as n}from"./compiler-runtime-qmuS0Svy.js";import{f as r,t as i}from"./utils-c6dglOTK.js";import{A as a,At as o,B as s,Bn as c,Bt as l,D as u,Dn as d,E as f,Gt as p,I as m,It as h,Jn as g,Kn as _,Lt as v,Mn as y,Mt as b,Nn as x,O as S,On as C,Pt as w,Q as T,Rn as E,Rt as D,Sn as O,T as k,U as A,Zt as ee,_ as j,a as M,at as te,b as N,d as ne,en as P,f as F,fn as re,g as I,h as L,hn as R,i as z,in as ie,it as B,j as V,jn as H,jt as U,kn as ae,kt as oe,m as se,n as ce,nn as W,o as le,on as G,p as ue,t as de,tn as fe,u as pe,v as me,x as he,y as ge,z as _e,zn as K,zt as q}from"./usePopupViewport-wXfO6SZE.js";import{d as J,o as ve,r as ye,t as Y}from"./useRenderElement-DchFnsR8.js";import{t as be}from"./react-dom-x9LNwWQc.js";var X=e(t(),1),Z=r(),xe=X.createContext({hasProvider:!1,timeoutMs:0,delayRef:{current:0},initialDelayRef:{current:0},timeout:new fe,currentIdRef:{current:null},currentContextRef:{current:null}});function Se(e,t){e.current=t.current}function Ce(e){let{children:t,delay:n,timeoutMs:r=0}=e,i=X.useRef(n),a=X.useRef(n),o=X.useRef(null),s=X.useRef(null),c=W();return y(()=>{if(a.current=n,!o.current){i.current=n;return}i.current={open:b(i.current,`open`),close:b(n,`close`)}},[n,o,i,a]),(0,Z.jsx)(xe.Provider,{value:X.useMemo(()=>({hasProvider:!0,delayRef:i,initialDelayRef:a,currentIdRef:o,timeoutMs:r,currentContextRef:s,timeout:c}),[r,c]),children:t})}function we(e,t={open:!1}){let{open:n}=t,r=`rootStore`in e?e.rootStore:e,i=r.useState(`floatingId`),{currentIdRef:a,delayRef:o,timeoutMs:s,initialDelayRef:c,currentContextRef:l,hasProvider:u,timeout:d}=X.useContext(xe),[f,p]=X.useState(!1),m=X.useRef(n);return y(()=>{m.current=n},[n]),y(()=>{function e(){l.current?.setIsInstantPhase(!1),a.current=null,l.current=null,o.current=c.current,d.clear()}if(a.current&&!n&&a.current===i){if(p(!1),s){let t=i;return d.start(s,()=>{r.select(`open`)||a.current&&a.current!==t||e()}),()=>{(m.current||a.current!==t)&&d.clear()}}e()}},[n,i,a,o,s,c,l,d,r]),y(()=>{if(!n)return;let e=l.current,t=a.current;d.clear(),l.current={onOpenChange:r.setOpen,setIsInstantPhase:p},a.current=i,o.current={open:0,close:b(c.current,`close`)},t!==null&&t!==i?(p(!0),e?.setIsInstantPhase(!0),e?.onOpenChange(!1,G(O))):(p(!1),e?.setIsInstantPhase(!1))},[n,i,r,a,o,c,l,d]),y(()=>()=>{if(a.current===i){if(l.current=null,!m.current)return;a.current=null,Se(o,c),d.clear()}},[l,a,o,i,c,d]),X.useMemo(()=>({hasProvider:u,delayRef:o,isInstantPhase:f}),[u,o,f])}function Te(e,t){let n=null,r=null,i=!1;return{contextElement:e||void 0,getBoundingClientRect(){let a=e?.getBoundingClientRect()||{width:0,height:0,x:0,y:0},o=t.axis===`x`||t.axis===`both`,s=t.axis===`y`||t.axis===`both`,c=[`mouseenter`,`mousemove`].includes(t.dataRef.current.openEvent?.type||``)&&t.pointerType!==`touch`,l=a.width,u=a.height,d=a.x,f=a.y;return n==null&&t.x&&o&&(n=a.x-t.x),r==null&&t.y&&s&&(r=a.y-t.y),d-=n||0,f-=r||0,l=0,u=0,!i||c?(l=t.axis===`y`?a.width:0,u=t.axis===`x`?a.height:0,d=o&&t.x!=null?t.x:d,f=s&&t.y!=null?t.y:f):i&&!c&&(u=t.axis===`x`?a.height:u,l=t.axis===`y`?a.width:l),i=!0,{width:l,height:u,x:d,y:f,top:f,right:d+l,bottom:f+u,left:d}}}}function Ee(e){return e!=null&&e.clientX!=null}function De(e,t={}){let{enabled:n=!0,axis:r=`both`}=t,i=`rootStore`in e?e.rootStore:e,a=i.useState(`open`),o=i.useState(`floatingElement`),s=i.useState(`domReferenceElement`),c=i.context.dataRef,u=X.useRef(!1),d=X.useRef(null),[f,m]=X.useState(),[h,g]=X.useState([]),_=x(e=>{i.set(`positionReference`,e)}),v=x((e,t,n)=>{u.current||c.current.openEvent&&!Ee(c.current.openEvent)||i.set(`positionReference`,Te(n??s,{x:e,y:t,axis:r,dataRef:c,pointerType:f}))}),y=x(e=>{a?d.current||(v(e.clientX,e.clientY,e.currentTarget),g([])):v(e.clientX,e.clientY,e.currentTarget)}),b=p(f)?o:a;X.useEffect(()=>{if(!n){_(s);return}if(!b)return;function e(){d.current?.(),d.current=null}let t=E(o);function r(t){let n=l(t);q(o,n)?e():v(t.clientX,t.clientY)}return!c.current.openEvent||Ee(c.current.openEvent)?d.current=U(t,`mousemove`,r):_(s),e},[b,n,o,c,s,i,v,_,h]),X.useEffect(()=>()=>{i.set(`positionReference`,null)},[i]),X.useEffect(()=>{n&&!o&&(u.current=!1)},[n,o]),X.useEffect(()=>{!n&&a&&(u.current=!0)},[n,a]);let S=X.useMemo(()=>{function e(e){m(e.pointerType)}return{onPointerDown:e,onPointerEnter:e,onMouseMove:y,onMouseEnter:y}},[y]);return X.useMemo(()=>n?{reference:S,trigger:S}:{},[n,S])}var Q=P&&ee;function Oe(e,t={}){let{enabled:n=!0,delay:r}=t,i=`rootStore`in e?e.rootStore:e,{events:a,dataRef:s}=i.context,u=X.useRef(!1),f=X.useRef(null),p=X.useRef(!0),m=W();X.useEffect(()=>{let e=i.select(`domReferenceElement`);if(!n)return;let t=E(e);function r(){let e=i.select(`domReferenceElement`);!i.select(`open`)&&c(e)&&e===D(H(e))&&(u.current=!0)}function a(){p.current=!0}function s(){p.current=!1}return o(U(t,`blur`,r),Q&&U(t,`keydown`,a,!0),Q&&U(t,`pointerdown`,s,!0))},[i,n]),X.useEffect(()=>{if(!n)return;function e(e){if(e.reason===`trigger-press`||e.reason===`escape-key`){let e=i.select(`domReferenceElement`);K(e)&&(f.current=e,u.current=!0)}}return a.on(`openchange`,e),()=>{a.off(`openchange`,e)}},[a,n,i]);let g=X.useMemo(()=>{function e(){u.current=!1,f.current=null}return{onMouseLeave(){e()},onFocus(t){let n=t.currentTarget;if(u.current){if(f.current===n)return;e()}let a=l(t.nativeEvent);if(K(a)){if(Q&&!t.relatedTarget){if(!p.current&&!h(a))return}else if(!v(a))return}let o=w(t.relatedTarget,i.context.triggerElements),{nativeEvent:s,currentTarget:c}=t,g=typeof r==`function`?r():r;if(i.select(`open`)&&o||g===0||g===void 0){i.setOpen(!0,G(d,s,c));return}m.start(g,()=>{u.current||i.setOpen(!0,G(d,s,c))})},onBlur(t){e();let n=t.relatedTarget,r=t.nativeEvent,a=K(n)&&n.hasAttribute(te(`focus-guard`))&&n.getAttribute(`data-type`)===`outside`;m.start(0,()=>{let e=i.select(`domReferenceElement`),t=D(H(e));!n&&t===e||q(s.current.floatingContext?.refs.floating.current,t)||q(e,t)||a||w(n??t,i.context.triggerElements)||i.setOpen(!1,G(d,r))})}}},[s,r,i,m]);return X.useMemo(()=>n?{reference:g,trigger:g}:{},[n,g])}var ke=X.createContext(void 0);function $(e){let t=X.useContext(ke);if(t===void 0&&!e)throw Error(J(72));return t}var Ae={...j,disabled:e=>e.disabled,instantType:e=>e.instantType,isInstantPhase:e=>e.isInstantPhase,trackCursorAxis:e=>e.trackCursorAxis,disableHoverablePopup:e=>e.disableHoverablePopup,lastOpenChangeReason:e=>e.openChangeReason,closeOnClick:e=>e.closeOnClick,closeDelay:e=>e.closeDelay,adaptiveOrigin:e=>e.adaptiveOrigin},je=class extends m{constructor(e,t,n){let r=new me;super(Me(e,r,t,n),Ne(r),Ae)}setOpen=(e,t)=>{he(this,e,t,{extraState:{openChangeReason:t.reason}})};cancelPendingOpen(e){this.state.floatingRootContext.dispatchOpenChange(!1,G(ae,e))}};function Me(e,t,n,r=!1){let i={...L(),disabled:!1,instantType:void 0,isInstantPhase:!1,trackCursorAxis:`none`,disableHoverablePopup:!1,openChangeReason:null,closeOnClick:!0,closeDelay:0,adaptiveOrigin:void 0,...e};return i.floatingRootContext=I(t,n,r),i}function Ne(e){return{popupRef:X.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerElements:e}}var Pe=_e(function(e){let{disabled:t=!1,defaultOpen:n=!1,open:r,disableHoverablePopup:i=!1,trackCursorAxis:a=`none`,actionsRef:o,onOpenChange:s,onOpenChangeComplete:c,handle:l,triggerId:u,defaultTriggerId:d=null,children:p}=e,m=S((e,t)=>new je({open:n,openProp:r,activeTriggerId:d,triggerIdProp:u},e,t));m.useControlledProp(`openProp`,r),m.useControlledProp(`triggerIdProp`,u),m.useContextCallback(`onOpenChange`,s),m.useContextCallback(`onOpenChangeComplete`,c);let h=m.useState(`open`),g=!t&&h,_=m.useState(`activeTriggerId`),v=m.useState(`mounted`),b=m.useState(`payload`);m.useSyncedValues({trackCursorAxis:a,disableHoverablePopup:i,disabled:t}),k(m,{closeOnActiveTriggerUnmount:!0});let{forceUnmount:x,transitionStatus:C}=f(g,m),w=m.useState(`isInstantPhase`),T=m.useState(`instantType`),E=m.useState(`lastOpenChangeReason`),D=X.useRef(null);y(()=>{h&&t&&m.setOpen(!1,G(re))},[h,t,m]),y(()=>{C===`ending`&&E===`none`||C!==`ending`&&w?(T!==`delay`&&(D.current=T),m.set(`instantType`,`delay`)):D.current!==null&&(m.set(`instantType`,D.current),D.current=null)},[C,w,E,T,m]),y(()=>{g&&(_??m.set(`payload`,void 0))},[m,_,g]),X.useImperativeHandle(o,()=>({unmount:x,close:()=>m.setOpen(!1,G(R))}),[x,m]);let O=g||v||!t&&a!==`none`;return(0,Z.jsxs)(ke.Provider,{value:m,children:[l&&(0,Z.jsx)(N,{handle:l,store:m}),O&&(0,Z.jsx)(Fe,{store:m,disabled:t,trackCursorAxis:a}),typeof p==`function`?p({payload:b}):p]})});function Fe({store:e,disabled:t,trackCursorAxis:n}){let r=e.useState(`floatingRootContext`),i=A(r,{enabled:!t,referencePress:()=>e.select(`closeOnClick`)}),a=De(r,{enabled:!t&&n!==`none`,axis:n===`none`?void 0:n}),o=X.useMemo(()=>ye(a.reference,i.reference),[a.reference,i.reference]);return u(e,{activeTriggerProps:o,inactiveTriggerProps:o,popupProps:i.floating??ve}),null}var Ie=X.createContext(void 0);function Le(){return X.useContext(Ie)}var Re=`data-base-ui-tooltip-trigger`;function ze(e){if(`composedPath`in e){let t=e.composedPath();for(let e=0;e<t.length;e+=1){let n=t[e];if(K(n))return n}}let t=e.target;return K(t)?t:null}function Be(e){let t=e;for(;t;){let e=t.closest(`[${Re}]`);if(e)return e;let n=t.getRootNode();t=`host`in n&&K(n.host)?n.host:null}return null}var Ve=s(function(e,t){let{render:n,className:r,style:i,handle:o,payload:s,disabled:c,delay:l,closeOnClick:u=!0,closeDelay:d,id:f,...m}=e,h=$(!0),_=se(o)??h;if(!_)throw Error(J(82));let v=ie(f),y=_.useState(`isTriggerActive`,v),x=_.useState(`isOpenedByTrigger`,v),S=_.useState(`floatingRootContext`),w=X.useRef(null),T=l??600,E=d??0,{registerTrigger:D,isMountedByThisTrigger:O}=a(v,w,_,{payload:s,closeOnClick:u,closeDelay:E}),k=Le(),{delayRef:A,isInstantPhase:ee,hasProvider:j}=we(S,{open:x}),M=ue(S);_.useSyncedValue(`isInstantPhase`,ee);let te=_.useState(`disabled`),N=c??te,P=oe(N),F=_.useState(`trackCursorAxis`),re=_.useState(`disableHoverablePopup`),I=X.useRef(!1),L=W(),R=X.useRef(void 0);function z(){return j?b(A.current,`open`)===0?0:l??k??600:T}function B(e){let t=w.current;if(!t||!e)return!1;let n=Be(e);return n!==null&&n!==t&&q(t,n)}function V(e){let t=B(e);return I.current=t,t&&(M.openChangeTimeout.clear(),M.restTimeout.clear(),M.restTimeoutPending=!1,L.clear()),t}let H=ne(S,{enabled:!N,mouseOnly:!0,move:!1,handleClose:!re&&F!==`both`?pe():null,restMs:z,delay(){return d==null&&j?{close:b(A.current,`close`)}:{close:E}},triggerElementRef:w,isActiveTrigger:y,isClosing:()=>_.select(`transitionStatus`)===`ending`,shouldOpen(){return!I.current}}),U=Oe(S,{enabled:!N}).reference,ae=e=>{let t=I.current,n=ze(e),r=V(n),i=w.current,a=i&&n&&q(i,n);if(r&&_.select(`open`)&&_.select(`lastOpenChangeReason`)===`trigger-hover`){_.setOpen(!1,G(C,e));return}if(t&&!r&&a&&!P.current&&!_.select(`open`)&&i&&p(R.current)){let t=()=>{!I.current&&!P.current&&!_.select(`open`)&&_.setOpen(!0,G(C,e,i))},n=z();n===0?(L.clear(),t()):L.start(n,t)}},ce=_.useState(`triggerProps`,O);return Y(`button`,e,{state:{open:x},ref:[t,D,w],props:[H,U,O||F!==`none`?ce:void 0,{onMouseOver(e){ae(e.nativeEvent)},onFocus(e){B(ze(e.nativeEvent))&&e.preventBaseUIHandler()},onMouseLeave(){I.current=!1,L.clear(),R.current=void 0},onPointerEnter(e){R.current=e.pointerType},onPointerDown(e){R.current=e.pointerType,_.set(`closeOnClick`,u),u&&!_.select(`open`)&&_.cancelPendingOpen(e.nativeEvent)},onClick(e){u&&!_.select(`open`)&&_.cancelPendingOpen(e.nativeEvent)},id:v,"data-trigger-disabled":N?``:void 0,[Re]:N?void 0:``},m],stateAttributesMapping:g})}),He=X.createContext(void 0);function Ue(){let e=X.useContext(He);if(e===void 0)throw Error(J(70));return e}var We=e(be(),1),Ge=X.forwardRef(function(e,t){let{children:n,container:r,className:i,render:a,style:o,...s}=e,{node:c,subtree:l}=T({container:r,ref:t,componentProps:e,elementProps:s});return!l&&!c?null:(0,Z.jsxs)(X.Fragment,{children:[l,c&&We.createPortal(n,c)]})}),Ke=X.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e;return $().useState(`mounted`)||n?(0,Z.jsx)(He.Provider,{value:n,children:(0,Z.jsx)(Ge,{ref:t,...r})}):null}),qe=X.createContext(void 0);function Je(){let e=X.useContext(qe);if(e===void 0)throw Error(J(71));return e}var Ye=X.forwardRef(function(e,t){let{render:n,className:r,anchor:i,positionMethod:a=`absolute`,side:o=`top`,align:s=`center`,sideOffset:c=0,alignOffset:l=0,collisionBoundary:u=`clipping-ancestors`,collisionPadding:d=5,arrowPadding:f=5,sticky:p=!1,disableAnchorTracking:m=!1,collisionAvoidance:h=B,style:g,..._}=e,v=$(),y=Ue(),b=v.useState(`open`),x=v.useState(`mounted`),S=v.useState(`trackCursorAxis`),C=v.useState(`disableHoverablePopup`),w=v.useState(`floatingRootContext`),T=v.useState(`instantType`),E=v.useState(`transitionStatus`),D=v.useState(`adaptiveOrigin`),O=le({anchor:i,positionMethod:a,floatingRootContext:w,mounted:x,side:o,sideOffset:c,align:s,alignOffset:l,collisionBoundary:u,collisionPadding:d,sticky:p,arrowPadding:f,disableAnchorTracking:m,keepMounted:y,collisionAvoidance:h,adaptiveOrigin:D}),k=X.useMemo(()=>({open:b,side:O.side,align:O.align,anchorHidden:O.anchorHidden,instant:S===`none`?T:`tracking-cursor`}),[b,O.side,O.align,O.anchorHidden,S,T]),A=z(e,k,{styles:O.positionerStyles,transitionStatus:E,props:_,refs:[t,v.useStateSetter(`positionerElement`)],hidden:!x,inert:!b||S===`both`||C});return(0,Z.jsx)(qe.Provider,{value:O,children:A})}),Xe=X.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,o=$(),{side:s,align:c}=Je(),l=o.useState(`open`),u=o.useState(`instantType`),d=o.useState(`transitionStatus`),f=o.useState(`popupProps`),p=o.useState(`floatingRootContext`),m=o.useState(`disabled`),h=o.useState(`closeDelay`);V({open:l,ref:o.context.popupRef,onComplete(){l&&o.context.onOpenChangeComplete?.(!0)}}),F(p,{enabled:!m,closeDelay:h});let g=o.useStateSetter(`popupElement`);return Y(`div`,e,{state:{open:l,side:s,align:c,instant:u,transitionStatus:d},ref:[t,o.context.popupRef,g],props:[ge,f,M(d),a],stateAttributesMapping:_})}),Ze=function(e){let{delay:t,closeDelay:n,timeout:r=400}=e,i=X.useMemo(()=>({open:t,close:n}),[t,n]);return(0,Z.jsx)(Ie.Provider,{value:t,children:(0,Z.jsx)(Ce,{delay:i,timeoutMs:r,children:e.children})})},Qe=X.forwardRef(function(e,t){let{render:n,className:r,style:i,children:a,...o}=e,s=$(),c=Je(),l=s.useState(`instantType`),{children:u,state:d}=ce({store:s,side:c.side,children:a}),f={activationDirection:d.activationDirection,transitioning:d.transitioning,instant:l};return Y(`div`,e,{state:f,ref:t,props:[o,{children:u}],stateAttributesMapping:de})}),$e=n(),et=Ze,tt=Pe;function nt(e){let t=(0,$e.c)(2),n;return t[0]===e?n=t[1]:(n=(0,Z.jsx)(Ve,{"data-slot":`tooltip-trigger`,...e}),t[0]=e,t[1]=n),n}function rt(e){let t=(0,$e.c)(22),n,r,a,o,s,c,l;t[0]===e?(n=t[1],r=t[2],a=t[3],o=t[4],s=t[5],c=t[6],l=t[7]):({className:a,align:s,sideOffset:c,side:l,anchor:n,children:r,...o}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=a,t[4]=o,t[5]=s,t[6]=c,t[7]=l);let u=s===void 0?`center`:s,d=c===void 0?4:c,f=l===void 0?`top`:l,p;t[8]===a?p=t[9]:(p=i(`app-surface relative flex h-(--popup-height,auto) w-(--popup-width,auto) origin-(--transform-origin) text-balance rounded-md border not-dark:bg-clip-padding text-popover-foreground text-xs shadow-md/5 transition-[width,height,scale,opacity] before:pointer-events-none before:absolute before:inset-0 before:rounded-[calc(var(--radius-md)-1px)] before:shadow-[0_1px_--theme(--color-black/4%)] data-ending-style:scale-98 data-starting-style:scale-98 data-ending-style:opacity-0 data-starting-style:opacity-0 data-instant:duration-0 dark:before:shadow-[0_-1px_--theme(--color-white/6%)]`,a),t[8]=a,t[9]=p);let m;t[10]===r?m=t[11]:(m=(0,Z.jsx)(Qe,{className:`relative size-full overflow-clip px-(--viewport-inline-padding) py-1 [--viewport-inline-padding:--spacing(2)] data-instant:transition-none **:data-current:data-ending-style:opacity-0 **:data-current:data-starting-style:opacity-0 **:data-previous:data-ending-style:opacity-0 **:data-previous:data-starting-style:opacity-0 **:data-current:w-[calc(var(--popup-width)-2*var(--viewport-inline-padding)-2px)] **:data-previous:w-[calc(var(--popup-width)-2*var(--viewport-inline-padding)-2px)] **:data-previous:truncate **:data-current:opacity-100 **:data-previous:opacity-100 **:data-current:transition-opacity **:data-previous:transition-opacity`,"data-slot":`tooltip-viewport`,children:r}),t[10]=r,t[11]=m);let h;t[12]!==o||t[13]!==p||t[14]!==m?(h=(0,Z.jsx)(Xe,{className:p,"data-slot":`tooltip-popup`,...o,children:m}),t[12]=o,t[13]=p,t[14]=m,t[15]=h):h=t[15];let g;return t[16]!==u||t[17]!==n||t[18]!==f||t[19]!==d||t[20]!==h?(g=(0,Z.jsx)(Ke,{children:(0,Z.jsx)(Ye,{align:u,anchor:n,className:`z-50 h-(--positioner-height) w-(--positioner-width) max-w-(--available-width) transition-[top,left,right,bottom,transform] data-instant:transition-none`,"data-slot":`tooltip-positioner`,side:f,sideOffset:d,children:h})}),t[16]=u,t[17]=n,t[18]=f,t[19]=d,t[20]=h,t[21]=g):g=t[21],g}export{Ge as a,nt as i,rt as n,Oe as o,et as r,tt as t};
@@ -1 +0,0 @@
1
- import"./runtime-BkRtSwRY.js";
@@ -1 +0,0 @@
1
- import{i as e,t}from"./react-SIfiwpqq.js";import{f as n}from"./utils-c6dglOTK.js";import{Mn as r,Nn as i}from"./usePopupViewport-wXfO6SZE.js";import{u as a}from"./useRenderElement-DchFnsR8.js";var o=e(t(),1),s=o.createContext({register:()=>{},unregister:()=>{},subscribeMapChange:()=>()=>{},nextIndexRef:{current:0}});function c(){return o.useContext(s)}var l=n();function u(e){let{children:t,elementsRef:n,labelsRef:c,onMapChange:u}=e,_=i(u),[,v]=o.useState(!1),y=a(f).current,b=a(d).current,x=o.useRef(0),S=o.useRef(!0),C=o.useRef([]),w=o.useRef(null),T=i(()=>{S.current||(S.current=!0,v(e=>!e))}),E=i((e,t)=>{b.set(e,t),T()}),D=i(e=>{b.delete(e),T()}),O=i(e=>{let t=new Map;return n.current.length=0,c&&(c.current.length=0),e.forEach(e=>{t.set(e.element,{...e.registration.metadata??{},index:e.index}),n.current[e.index]=e.element,c&&(c.current[e.index]=e.registration.label===void 0?e.registration.textRef?.current?.textContent??e.element.textContent:e.registration.label)}),x.current=n.current.length,t});function k(e){if(w.current?.disconnect(),w.current=null,typeof MutationObserver!=`function`||e.length<2)return;let t=new MutationObserver(n=>{if(!h(n))return;let r=null;for(let n of e)if(n.isConnected){if(r&&g(r,n)>0){t.disconnect(),T();return}r=n}});w.current=t;let n=new Set;for(let t=1;t<e.length;t+=1){let r=m(e[t-1],e[t]);r&&n.add(r)}n.forEach(e=>t.observe(e,{childList:!0}))}let A=i(()=>{let[e,t]=p(b),n=O(e);k(t),C.current=e,S.current=!1,y.forEach(e=>e(n)),_(n)});r(()=>(S.current||O(C.current),()=>{n.current=[],c&&(c.current=[])}),[n,c,O]),r(()=>{S.current&&A()}),r(()=>()=>{w.current?.disconnect(),S.current=!0},[]);let j=i(e=>(y.add(e),()=>{y.delete(e)})),M=o.useMemo(()=>({register:E,unregister:D,subscribeMapChange:j,nextIndexRef:x}),[E,D,j,x]);return(0,l.jsx)(s.Provider,{value:M,children:t})}function d(){return new Map}function f(){return new Set}function p(e){let t=new Set,n=[],r=[];e.forEach((e,i)=>{if(!i.isConnected)return;let a=e.index,o={index:a??-1,element:i,registration:e};a===null?r.push(o):a>=0&&(t.add(a),n.push(o))});let i=0;return r.sort((e,t)=>g(e.element,t.element)),r.forEach(e=>{for(;t.has(i);)i+=1;e.index=i,n.push(e),i+=1}),t.size>0&&n.sort((e,t)=>e.index-t.index),[n,r.map(e=>e.element)]}function m(e,t){let n=e.parentElement;for(;n&&!n.contains(t);)n=n.parentElement;return n}function h(e){for(let t of e)for(let e=0;e<t.removedNodes.length;e+=1)if(t.removedNodes[e].isConnected)return!0;return!1}function g(e,t){return e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_FOLLOWING?-1:1}function _(e={}){let{guess:t,label:n,metadata:i,textRef:a,index:s}=e,{register:l,unregister:u,subscribeMapChange:d,nextIndexRef:f}=c(),p=o.useRef(-1),[m,h]=o.useState(s==null&&t?()=>{if(p.current===-1){let e=f.current;f.current+=1,p.current=e}return p.current}:-1),g=s??m,_=o.useRef(null),v=o.useCallback(e=>{let t=_.current;t&&u(t),_.current=e,e&&l(e,{metadata:i??null,index:s??null,label:n,textRef:a})},[s,l,u,i,n,a]);return r(()=>{if(s==null)return d(e=>{let t=_.current?e.get(_.current)?.index:null;t!=null&&h(t)})},[s,d]),{ref:v,index:g}}export{u as n,_ as t};
@@ -1 +0,0 @@
1
- import{i as e,t}from"./react-SIfiwpqq.js";import{f as n}from"./useRenderElement-DchFnsR8.js";var r=n(`copy`,[[`rect`,{width:`14`,height:`14`,x:`8`,y:`8`,rx:`2`,ry:`2`,key:`17jyea`}],[`path`,{d:`M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2`,key:`zix9uf`}]]),i=e(t(),1);function a({timeout:e=2e3,onCopy:t,onError:n}={}){let[r,a]=i.useState(!1),o=i.useRef(null),s=i.useRef(t),c=i.useRef(n),l=i.useRef(e);s.current=t,c.current=n,l.current=e;let u=i.useCallback((e,t)=>{if(typeof window>`u`||!navigator.clipboard?.writeText){c.current?.(Error(`Clipboard API unavailable.`),t);return}e&&navigator.clipboard.writeText(e).then(()=>{o.current&&clearTimeout(o.current),a(!0),s.current?.(t),l.current!==0&&(o.current=setTimeout(()=>{a(!1),o.current=null},l.current))},e=>{c.current?c.current(e,t):console.error(e)})},[]);return i.useEffect(()=>()=>{o.current&&clearTimeout(o.current)},[]),{copyToClipboard:u,isCopied:r}}export{r as n,a as t};
@@ -1 +0,0 @@
1
- import{i as e,t}from"./react-SIfiwpqq.js";import{t as n}from"./compiler-runtime-qmuS0Svy.js";import{g as r,v as i}from"./env-CBdFekj3.js";import{z as a}from"./src-b7-hpIff.js";import{At as o,C as s,E as c,Ft as l,I as u,Jt as d,Mt as f,Ot as p,Rn as m,S as h,b as g,jt as _}from"./runtime-BkRtSwRY.js";import{i as v}from"./composerDraftStore-_Xy-iY4b.js";import{a as y,c as b,t as x}from"./utils-c6dglOTK.js";import{d as S,u as C}from"./useSwipeDismiss-B8Fo31QE.js";import{t as w}from"./useRouter-CcIDS3PN.js";import{o as T,s as E}from"./authorization-CFcCWeGd.js";import{i as D}from"./uiStateStore-hgy2ilHo.js";import{a as ee,c as O,d as k,l as A,o as te,s as ne,u as j}from"./desktopWorkspace-BOWgdyPs.js";import{t as re}from"./shallow-DWZCFNun.js";import{p as ie}from"./session-logic-B0shVXpN.js";import"./storeSelectors-BLHJVLCP.js";var M=`__TSR_index`,ae=`popstate`,oe=`beforeunload`;function se(e){let t=e.getLocation(),n=new Set,r=r=>{t=e.getLocation(),n.forEach(e=>e({location:t,action:r}))},i=n=>{e.notifyOnIndexChange??!0?r(n):t=e.getLocation()},a=async({task:n,navigateOpts:r,...i})=>{if(r?.ignoreBlocker??!1){n();return}let a=e.getBlockers?.()??[],o=i.type===`PUSH`||i.type===`REPLACE`;if(typeof document<`u`&&a.length&&o)for(let n of a){let r=N(i.path,i.state);if(await n.blockerFn({currentLocation:t,nextLocation:r,action:i.type})){e.onBlocked?.();return}}n()};return{get location(){return t},get length(){return e.getLength()},subscribers:n,subscribe:e=>(n.add(e),()=>{n.delete(e)}),push:(n,i,o)=>{let s=t.state[M];i=ce(s+1,i),a({task:()=>{e.pushState(n,i),r({type:`PUSH`})},navigateOpts:o,type:`PUSH`,path:n,state:i})},replace:(n,i,o)=>{let s=t.state[M];i=ce(s,i),a({task:()=>{e.replaceState(n,i),r({type:`REPLACE`})},navigateOpts:o,type:`REPLACE`,path:n,state:i})},go:(t,n)=>{a({task:()=>{e.go(t),i({type:`GO`,index:t})},navigateOpts:n,type:`GO`})},back:t=>{a({task:()=>{e.back(t?.ignoreBlocker??!1),i({type:`BACK`})},navigateOpts:t,type:`BACK`})},forward:t=>{a({task:()=>{e.forward(t?.ignoreBlocker??!1),i({type:`FORWARD`})},navigateOpts:t,type:`FORWARD`})},canGoBack:()=>t.state[M]!==0,createHref:t=>e.createHref(t),block:t=>{if(!e.setBlockers)return()=>{};let n=e.getBlockers?.()??[];return e.setBlockers([...n,t]),()=>{let n=e.getBlockers?.()??[];e.setBlockers?.(n.filter(e=>e!==t))}},flush:()=>e.flush?.(),destroy:()=>e.destroy?.(),notify:r}}function ce(e,t){t||={};let n=fe();return{...t,key:n,__TSR_key:n,[M]:e}}function le(e){let t=e?.window??(typeof document<`u`?window:void 0),n=t.history.pushState,r=t.history.replaceState,i=[],a=()=>i,o=e=>i=e,s=e?.createHref??(e=>e),c=e?.parseLocation??(()=>N(`${t.location.pathname}${t.location.search}${t.location.hash}`,t.history.state));if(!t.history.state?.__TSR_key&&!t.history.state?.key){let e=fe();t.history.replaceState({[M]:0,key:e,__TSR_key:e},``)}let l=c(),u,d=!1,f=!1,p=!1,m=!1,h=()=>l,g,_=()=>{g&&(S._ignoreSubscribers=!0,(g[2]?t.history.pushState:t.history.replaceState)(g[1],``,g[0]),S._ignoreSubscribers=!1,g=void 0,u=void 0)},v=(e,t,n)=>{let r=s(t),i=!!g;i||(u=l),l=N(t,n),g=[r,n,g?.[2]||e],i||queueMicrotask(()=>_())},y=e=>{l=c(),S.notify({type:e})},b=async()=>{if(f){f=!1;return}let e=c(),n=e.state[M]-l.state[M],r=n===1,i=n===-1,o=!r&&!i||d;d=!1;let s=o?`GO`:i?`BACK`:`FORWARD`,u=o?{type:`GO`,index:n}:{type:i?`BACK`:`FORWARD`};if(p)p=!1;else{let n=a();if(typeof document<`u`&&n.length){for(let r of n)if(await r.blockerFn({currentLocation:l,nextLocation:e,action:s})){f=!0,t.history.go(1),S.notify(u);return}}}l=c(),S.notify(u)},x=e=>{if(m){m=!1;return}let t=!1,n=a();if(typeof document<`u`&&n.length)for(let e of n){let n=e.enableBeforeUnload??!0;if(n===!0){t=!0;break}if(typeof n==`function`&&n()===!0){t=!0;break}}if(t)return e.preventDefault(),e.returnValue=``},S=se({getLocation:h,getLength:()=>t.history.length,pushState:(e,t)=>v(!0,e,t),replaceState:(e,t)=>v(!1,e,t),back:e=>(e&&(p=!0),m=!0,t.history.back()),forward:e=>{e&&(p=!0),m=!0,t.history.forward()},go:e=>{d=!0,t.history.go(e)},createHref:e=>s(e),flush:_,destroy:()=>{t.history.pushState=n,t.history.replaceState=r,t.removeEventListener(oe,x,{capture:!0}),t.removeEventListener(ae,b)},onBlocked:()=>{u&&l!==u&&(l=u)},getBlockers:a,setBlockers:o,notifyOnIndexChange:!1});return t.addEventListener(oe,x,{capture:!0}),t.addEventListener(ae,b),t.history.pushState=function(...e){let r=n.apply(t.history,e);return S._ignoreSubscribers||y(`PUSH`),r},t.history.replaceState=function(...e){let n=r.apply(t.history,e);return S._ignoreSubscribers||y(`REPLACE`),n},S}function ue(e){let t=e?.window??(typeof document<`u`?window:void 0);return le({window:t,parseLocation:()=>{let e=t.location.hash.split(`#`).slice(1),n=e[0]??`/`,r=t.location.search,i=e.slice(1);return N(`${n}${r}${i.length===0?``:`#${i.join(`#`)}`}`,t.history.state)},createHref:e=>`${t.location.pathname}${t.location.search}#${e}`})}function de(e){let t=e.replace(/[\x00-\x1f\x7f]/g,``);return t.startsWith(`//`)&&(t=`/`+t.replace(/^\/+/,``)),t}function N(e,t){let n=de(e),r=n.indexOf(`#`),i=n.indexOf(`?`),a=fe();return{href:n,pathname:n.substring(0,r>0?i>0?Math.min(r,i):r:i>0?i:n.length),hash:r>-1?n.substring(r):``,search:i>-1?n.slice(i,r===-1?void 0:r):``,state:t||{[M]:0,key:a,__TSR_key:a}}}function fe(){return(Math.random()+1).toString(36).substring(7)}var pe=45e3;function me(e){if(!Number.isInteger(e)||e<1||e>3)throw RangeError(`platformMaxConnections must be between 1 and 3`);return{platformMaxConnections:e,backgrounded:!1,leases:[],connections:[]}}function he(e,t,n){let r=e.connections.find(e=>e.environmentId===t)??{environmentId:t,connected:!1,lastAccessedAt:0};return{...e,connections:[...e.connections.filter(e=>e.environmentId!==t),n(r)]}}function ge(e,t,n){return he(e,t,e=>({...e,lastAccessedAt:Math.max(e.lastAccessedAt,n)}))}function P(e,t,n,r){return he(e,t,e=>({...e,connected:n,lastAccessedAt:Math.max(e.lastAccessedAt,r)}))}function _e(e,t){if(t.leaseId.length===0)throw TypeError(`leaseId must not be empty`);if(e.leases.some(e=>e.leaseId===t.leaseId))throw Error(`Duplicate workspace connection lease: ${t.leaseId}`);let n=t.ttlMs??45e3;if(!Number.isFinite(n)||n<=0)throw RangeError(`ttlMs must be positive`);return ge({...e,leases:[...e.leases,{leaseId:t.leaseId,environmentId:t.environmentId,scope:t.scope,retainedAt:t.now,expiresAt:t.now+n}]},t.environmentId,t.now)}function ve(e,t,n,r=pe){if(!Number.isFinite(r)||r<=0)throw RangeError(`ttlMs must be positive`);return{...e,leases:e.leases.map(e=>e.leaseId===t?{...e,expiresAt:n+r}:e)}}function ye(e,t){return{...e,leases:e.leases.filter(e=>e.leaseId!==t)}}function be(e,t){return e.backgrounded===t?e:{...e,backgrounded:t}}function xe(e,t){let n=e.leases.filter(e=>e.expiresAt>t);return n.length===e.leases.length?e:{...e,leases:n}}function Se(e,t){let n=xe(e,t.now),r=new Map;for(let e of n.leases)r.set(e.environmentId,Math.max(r.get(e.environmentId)??0,e.retainedAt));let i=Array.from(r.keys()),a=new Set(i),o=n.connections.filter(e=>e.connected),s=new Set(o.map(e=>e.environmentId)),c=o.filter(e=>!a.has(e.environmentId)).toSorted((e,t)=>e.lastAccessedAt-t.lastAccessedAt||String(e.environmentId).localeCompare(String(t.environmentId))),l=i.filter(e=>!s.has(e)).toSorted((e,t)=>(r.get(t)??0)-(r.get(e)??0)||String(e).localeCompare(String(t))),u=[];if(n.backgrounded)return u.push(...c.map(e=>e.environmentId)),{state:n,retain:i.filter(e=>s.has(e)),release:u,connect:[],queued:l};let d=o.length,f=[...c];for(;f.length>0&&(d>n.platformMaxConnections||d+l.length>n.platformMaxConnections);){let e=f.shift();u.push(e.environmentId),--d}let p=Math.max(0,n.platformMaxConnections-d),m=l.slice(0,p),h=Math.max(0,t.wakeStaggerMs??0);return{state:n,retain:i.filter(e=>s.has(e)),release:u,connect:m.map((e,t)=>({environmentId:e,delayMs:t*h})),queued:l.slice(m.length)}}function Ce(e){return e.online&&e.canMutate&&(e.nativeTrust===`verified`||e.nativeTrust===`not-required`)}function we(e){return{environmentId:e.environmentId,projectId:e.projectId,physicalKey:e.physicalKey,machineLabel:e.machineLabel}}function Te(e){if(e.override){let t=e.override,n=e.project.variants.find(e=>e.environmentId===t.environmentId&&e.projectId===t.projectId);return n?Ce(n)?{status:`resolved`,target:we(n),source:`override`}:{status:`unavailable`,message:`No verified machine available`,reason:`override-unavailable`}:{status:`unavailable`,message:`No verified machine available`,reason:`override-not-in-project`}}let t=e.project.variants.filter(Ce);if(t.length===0)return{status:`unavailable`,message:`No verified machine available`,reason:`no-eligible-variant`};let n=t.toSorted((e,t)=>{let n=e.lastUsedAt??-1/0,r=t.lastUsedAt??-1/0;return n===r?e.localDesktop===t.localDesktop?String(e.environmentId).localeCompare(String(t.environmentId)):e.localDesktop?-1:1:r-n})[0],r=Math.max(...t.map(e=>e.lastUsedAt??-1/0)),i=Number.isFinite(r)&&n.lastUsedAt===r?`recent`:n.localDesktop?`local-desktop`:`stable`;return{status:`resolved`,target:we(n),source:i}}var Ee={os:`unknown`,arch:`other`};function De(e){return Array.from(new Set(e.filter(e=>e!==null)))}function Oe(e){let t=e.revokedAt!=null,n=e.removed===!0,r=e.clientTier===`hosted-web`&&e.capabilities?.nativeClientRequired===!0,i=e.clientTier===`native`&&e.requiresNativeVerification&&e.nativeTrust===`unknown`,a=e.clientTier===`native`&&e.requiresNativeVerification&&e.nativeTrust===`unverified`,o=e.nativeTrust===`identity-conflict`,s=e.clientTier===`hosted-web`?!r:!e.requiresNativeVerification||e.nativeTrust===`verified`,c=!t&&!n&&s&&!o,l=c&&e.online,u=l&&e.effectiveRole!==null&&e.effectiveRole!==`viewer`,d=De([t?`revoked`:null,n?`removed`:null,r?`native-client-required`:null,i?`trust-unknown`:null,a?`not-verified`:null,o?`identity-conflict`:null,e.online?null:`offline`,e.effectiveRole===null?`role-unknown`:null,e.effectiveRole===`viewer`?`viewer`:null]);return{environmentId:e.environmentId,nodeId:e.nodeId??null,label:e.label,platform:e.platform??Ee,serverVersion:e.serverVersion??null,capabilities:{repositoryIdentity:e.capabilities?.repositoryIdentity??!1,nativeClientRequired:e.capabilities?.nativeClientRequired??!1,threadSettlement:e.capabilities?.threadSettlement??!1},clientTier:e.clientTier,nativeTrust:e.nativeTrust,effectiveRole:e.effectiveRole,presence:{online:e.online,lastSeenAt:e.lastSeenAt,observedAt:e.observedAt},connectionState:e.connectionState??`disconnected`,deliveryUnknown:e.deliveryUnknown??!1,revokedAt:e.revokedAt??null,removed:n,canReadMetadata:c,canConnect:l,canMutate:u,cacheDisposition:t||n||r||i||a?`purge`:o?`locked-stale`:`available`,accessReasons:d}}function ke(e){let t=new Map;for(let n of e)t.set(n.environmentId,Oe(n));return Array.from(t.values()).toSorted((e,t)=>e.label.localeCompare(t.label)||String(e.environmentId).localeCompare(String(t.environmentId)))}function Ae(e){if(e===null)return null;let t=Date.parse(e);return Number.isFinite(t)?t:null}function je(e){let t=new Map(e.machines.map(e=>[e.environmentId,e])),n=new Map;for(let t of e.snapshots){let e=n.get(t.environmentId);(!e||t.capturedAt>e.capturedAt)&&n.set(t.environmentId,t)}let r=[],i=[];for(let[e,a]of n){let n=t.get(e);if(!(!n||n.cacheDisposition===`purge`)){if(n.cacheDisposition===`locked-stale`){i.push({status:`locked-stale`,environmentId:e,capturedAt:a.capturedAt});continue}n.canReadMetadata&&(i.push({status:`available`,snapshot:a}),r.push(a))}}let a=r.flatMap(e=>e.projects),o=r.flatMap(e=>e.worktrees),l=r.flatMap(e=>{let n=t.get(e.environmentId);return e.threads.map(e=>({...e,deliveryUnknown:e.deliveryUnknown||n?.deliveryUnknown===!0}))}),u=a.flatMap(n=>{let r=t.get(n.environmentId);if(!r)return[];let i=s(n);return[{environmentId:n.environmentId,projectId:n.id,physicalKey:i,name:n.name,cwd:n.cwd,repositoryIdentity:n.repositoryIdentity,machineLabel:r.label,online:r.presence.online,canMutate:r.canMutate,nativeTrust:r.nativeTrust,effectiveRole:r.effectiveRole,lastUsedAt:e.lastUsedAtByPhysicalProjectKey?.[i]??null,lastLiveAt:Ae(n.updatedAt)??r.presence.lastSeenAt,localDesktop:e.localDesktopEnvironmentId===n.environmentId}]});return{machines:e.machines,snapshots:i.toSorted((e,t)=>{let n=e.status===`available`?e.snapshot.environmentId:e.environmentId,r=t.status===`available`?t.snapshot.environmentId:t.environmentId;return String(n).localeCompare(String(r))}),projects:a,worktrees:o,threads:l,logicalProjects:c(u)}}var F=e(t(),1),I=n(),Me=`[data-thread-item], [data-thread-selection-safe]`,Ne=`phone:pointer-coarse:size-8 phone:pointer-coarse:after:absolute phone:pointer-coarse:after:top-1/2 phone:pointer-coarse:after:left-1/2 phone:pointer-coarse:after:size-11 phone:pointer-coarse:after:-translate-x-1/2 phone:pointer-coarse:after:-translate-y-1/2`,Pe=`phone:pointer-coarse:relative ${Ne}`;function Fe(e){if(e.manualBucket!==null)return e.manualBucket;switch(e.statusPill?.label){case`Working`:case`Monitoring`:case`Connecting`:return`in_progress`;case`Plan Ready`:case`Pending Approval`:case`Awaiting Input`:return`review`;case`Completed`:return`done`;default:return`idle`}}function Ie(e){return e.includes(`in_progress`)?`in_progress`:e.includes(`review`)?`review`:e.length>0&&e.every(e=>e===`done`)?`done`:`idle`}var Le=6048e5;function Re(e){if(e.buckets.length===0||!e.buckets.every(e=>e===`done`)||!e.latestUpdatedAt)return!1;let t=Date.parse(e.latestUpdatedAt);return!Number.isNaN(t)&&e.nowMs-t>=Le}function ze(e){return e.latestUserMessageAt!==null}function Be(e){return e.latestUserMessageAt!==null}function Ve(e){return e.confirmThreadDelete&&Be(e.thread)}function He(e){for(let t of e.threads)if(t&&Ve({confirmThreadDelete:e.confirmThreadDelete,thread:t}))return!0;return!1}function Ue(e){return e.archiveAvailable&&e.confirmThreadArchive}var We={"Pending Approval":6,"Awaiting Input":5,Working:4,Connecting:4,"Plan Ready":3,Monitoring:2,Completed:1};function Ge(e){let t=e.setTimeoutFn??globalThis.setTimeout,n=e.clearTimeoutFn??globalThis.clearTimeout,r=!1,i=null,a=()=>{i!==null&&(n(i),i=null)};return{sync:n=>{if(!n){a(),r&&(r=!1,e.onVisibilityChange(!1));return}r||i!==null||(i=t(()=>{i=null,r=!0,e.onVisibilityChange(!0)},e.delayMs))},dispose:()=>{a()}}}function Ke(){let[e,t]=F.useState(!1),n=F.useRef(null);return F.useEffect(()=>{let e=Ge({delayMs:100,onVisibilityChange:e=>{t(e)},setTimeoutFn:window.setTimeout.bind(window),clearTimeoutFn:window.clearTimeout.bind(window)});return n.current=e,()=>{e.dispose(),n.current=null}},[]),{showThreadJumpHints:e,updateThreadJumpHintsVisibility:F.useCallback(e=>{n.current?.sync(e)},[])}}function qe(e){if(!e.latestTurn?.completedAt)return!1;let t=Date.parse(e.latestTurn.completedAt);if(Number.isNaN(t))return!1;if(!e.lastVisitedAt)return!0;let n=Date.parse(e.lastVisitedAt);return Number.isNaN(n)?!0:t>n}function Je(e){return e===null||!e.closest(Me)}function Ye(e){return e>1}function Xe(e){return e.requestedEnvMode??e.defaultEnvMode}function Ze(e){return e.defaultEnvMode===`worktree`?{envMode:`worktree`}:e.activeDraftThread?.projectId===e.projectId?{branch:e.activeDraftThread.branch,worktreePath:e.activeDraftThread.worktreePath,envMode:e.activeDraftThread.envMode}:e.activeThread?.projectId===e.projectId?{branch:e.activeThread.branch,worktreePath:e.activeThread.worktreePath,envMode:e.activeThread.worktreePath?`worktree`:`local`}:{envMode:e.defaultEnvMode}}function Qe(e){let{getId:t,items:n,preferredIds:r}=e;if(r.length===0)return[...n];let i=new Map(n.map(e=>[t(e),e])),a=new Set(r),o=new Set,s=r.flatMap(e=>{if(o.has(e))return[];let t=i.get(e);return t?(o.add(e),[t]):[]}),c=n.filter(e=>!a.has(t(e)));return[...s,...c]}function $e(e,t=10){return e.slice(0,Math.max(0,t))}function et(e){let t=_(e.threads,e.sortOrder);return e.pinnedThreadKeys.size===0?t:t.toSorted((t,n)=>{let r=e.pinnedThreadKeys.has(e.getThreadKey(t));return r===e.pinnedThreadKeys.has(e.getThreadKey(n))?0:r?-1:1})}function tt(e){return e<=80}function nt(e){return e.projectCount<=80&&e.visibleThreadCount<=120}function rt(e){return e.explorerOpen||e.projectVisible}function it(e,t){let n=null;for(let r of e){let e=t(r);if(e!==null){if(n===null){n=e;continue}if(n.environmentId!==e.environmentId||n.cwd!==e.cwd)return{kind:`mixed`}}}return n===null?{kind:`none`}:{kind:`shared`,target:n}}function at(e){let{currentThreadId:t,direction:n,threadIds:r}=e;if(r.length===0)return null;if(t===null)return n===`previous`?r.at(-1)??null:r[0]??null;let i=r.indexOf(t);return i===-1?null:n===`previous`?i>0?r[i-1]??null:null:i<r.length-1?r[i+1]??null:null}function ot(e){return e.button===2||e.isMac&&e.button===0&&e.ctrlKey}function st(e){let t=`h-7 w-full translate-x-0 cursor-pointer justify-start px-2 text-left select-none focus-visible:ring-1 focus-visible:ring-inset focus-visible:ring-ring`;return e.isSelected&&e.isActive?x(t,`bg-primary/22 text-foreground font-medium hover:bg-primary/26 hover:text-foreground dark:bg-primary/30 dark:hover:bg-primary/36`):e.isSelected?x(t,`bg-primary/15 text-foreground hover:bg-primary/19 hover:text-foreground dark:bg-primary/22 dark:hover:bg-primary/28`):e.isActive?x(t,`bg-accent/85 text-foreground font-medium hover:bg-accent hover:text-foreground dark:bg-accent/55 dark:hover:bg-accent/70`):x(t,`text-muted-foreground hover:bg-accent hover:text-foreground`)}function ct(e){let{thread:t}=e;return t.hasPendingApprovals?{label:`Pending Approval`,colorClass:`text-amber-600 dark:text-amber-300/90`,dotClass:`bg-amber-500 dark:bg-amber-300/90`,pulse:!1}:t.hasPendingUserInput?{label:`Awaiting Input`,colorClass:`text-indigo-600 dark:text-indigo-300/90`,dotClass:`bg-indigo-500 dark:bg-indigo-300/90`,pulse:!1}:t.session?.status===`running`?{label:`Working`,colorClass:`text-sky-600 dark:text-sky-300/80`,dotClass:`bg-sky-500 dark:bg-sky-300/80`,pulse:!0}:t.session?.status===`connecting`?{label:`Connecting`,colorClass:`text-sky-600 dark:text-sky-300/80`,dotClass:`bg-sky-500 dark:bg-sky-300/80`,pulse:!0}:!t.hasPendingUserInput&&t.interactionMode===`plan`&&ie(t.latestTurn,t.session)&&t.hasActionableProposedPlan?{label:`Plan Ready`,colorClass:`text-violet-600 dark:text-violet-300/90`,dotClass:`bg-violet-500 dark:bg-violet-300/90`,pulse:!1}:t.backgroundLiveness===`working`?{label:`Working`,colorClass:`text-sky-600 dark:text-sky-300/80`,dotClass:`bg-sky-500 dark:bg-sky-300/80`,pulse:!0}:t.backgroundLiveness===`monitoring`?{label:`Monitoring`,colorClass:`text-sky-600 dark:text-sky-300/80`,dotClass:`bg-sky-500 dark:bg-sky-300/80`,pulse:!0}:qe(t)?{label:`Completed`,colorClass:`text-emerald-600 dark:text-emerald-300/90`,dotClass:`bg-emerald-500 dark:bg-emerald-300/90`,pulse:!1}:null}function lt(e){let t=null;for(let n of e)n!==null&&(t===null||We[n.label]>We[t.label])&&(t=n);return t}function ut(e){let{deletedThreadId:t,deletedThreadIds:n,sortOrder:r,threads:i}=e,a=i.find(e=>e.id===t);if(!a)return null;let o=i.filter(e=>e.id!==t&&!n?.has(e.id));return _(o.filter(e=>e.projectId===a.projectId),r)[0]?.id??_(o,r)[0]?.id??null}function dt(e,t,n){return t.length>0?t.reduce((e,t)=>Math.max(e,o(t,n)),-1/0):n===`created_at`?f(e.createdAt)??-1/0:f(e.updatedAt??e.createdAt)??-1/0}function ft(e,t,n){if(n===`manual`)return[...e];let r=new Map;for(let e of t){let t=r.get(e.projectId)??[];t.push(e),r.set(e.projectId,t)}return[...e].toSorted((e,t)=>{let i=dt(t,r.get(t.id)??[],n),a=dt(e,r.get(e.id)??[],n),o=i===a?0:i>a?1:-1;return o===0?e.name.localeCompare(t.name)||e.id.localeCompare(t.id):o})}function pt(e){let t=e.orderedProjects[0];if(!t)return null;if(!e.ready)return r(t.environmentId,t.id);let n=e.logicalKey(t),a=new Map(e.machines.map(e=>[e.environmentId,e])),o=e.orderedProjects.filter(t=>e.logicalKey(t)===n),s=Te({project:{key:n,label:t.name,repositoryIdentity:t.repositoryIdentity??null,ambiguous:o.length>1,variants:o.flatMap(t=>{let n=a.get(t.environmentId);return n?[{environmentId:t.environmentId,projectId:t.id,physicalKey:i(r(t.environmentId,t.id)),name:t.name,cwd:t.cwd,repositoryIdentity:t.repositoryIdentity??null,machineLabel:n.label,online:n.online,canMutate:n.canMutate,nativeTrust:n.nativeTrust,effectiveRole:n.canMutate?`owner`:null,lastUsedAt:null,lastLiveAt:null,localDesktop:e.localEnvironmentId===t.environmentId}]:[]})}});return s.status===`resolved`?r(s.target.environmentId,s.target.projectId):null}var L=`ryco:hosted-workspace-metadata:v1`,R=1;function z(e){try{return new URL(e).origin.toLowerCase()}catch{return e.replace(/\/+$/gu,``).toLowerCase()}}function B(e){return{...e,hubOrigin:z(e.hubOrigin)}}function mt(e){return{...e,namespace:B(e.namespace)}}function ht(e){if(typeof e!=`object`||!e||Array.isArray(e))return!1;let t=e;return typeof t.hubOrigin==`string`&&t.hubOrigin.length>0&&t.hubOrigin.length<=2048&&typeof t.accountId==`string`&&t.accountId.length>0&&t.accountId.length<=2048&&typeof t.environmentId==`string`&&t.environmentId.length>0&&t.environmentId.length<=2048}function gt(e){if(typeof e!=`object`||!e||Array.isArray(e))return!1;let t=e;return ht(t.namespace)&&O(t.snapshot,t.namespace.environmentId)&&Number.isSafeInteger(t.payloadBytes)&&t.payloadBytes===k(t.snapshot)&&Number.isSafeInteger(t.updatedAt)&&Number(t.updatedAt)>=0}function V(e){try{let t=e.getItem(L);if(!t)return{version:R,records:[]};let n=JSON.parse(t);if(typeof n!=`object`||!n||Array.isArray(n))return{version:R,records:[]};let r=n;if(r.version!==R||!Array.isArray(r.records))return{version:R,records:[]};let i=new Map;for(let e of r.records){if(!gt(e))continue;let t=mt(e),n=j(t.namespace),r=i.get(n);(!r||t.updatedAt>r.updatedAt)&&i.set(n,t)}return{version:R,records:Array.from(i.values())}}catch{return{version:R,records:[]}}}function H(e,t){if(t.length===0){e.removeItem(L);return}e.setItem(L,JSON.stringify({version:R,records:t}))}function _t(e){let t=Promise.resolve(),n=e=>{let n=t.then(e,e);return t=n.then(()=>void 0,()=>void 0),n};return{load:async t=>{let n=j(B(t));return V(e).records.find(e=>j(e.namespace)===n)??null},list:async({hubOrigin:t,accountId:n})=>V(e).records.filter(e=>z(e.namespace.hubOrigin)===z(t)&&e.namespace.accountId===n),replace:t=>n(async()=>{if(!gt(t))throw TypeError(`Invalid hosted workspace metadata record.`);let n=mt(t),r=V(e),i=A({existing:r.records,incoming:n});if(!i.accepted)return;let a=j(n.namespace),o=new Set(i.evict.map(j));H(e,[...r.records.filter(e=>{let t=j(e.namespace);return t!==a&&!o.has(t)}),n])}),purgeEnvironment:t=>n(async()=>{let n=j(B(t));H(e,V(e).records.filter(e=>j(e.namespace)!==n))}),purgeAccount:({hubOrigin:t,accountId:r})=>n(async()=>{H(e,V(e).records.filter(e=>z(e.namespace.hubOrigin)!==z(t)||e.namespace.accountId!==r))})}}var vt=null;function yt(){return vt||=_t(window.localStorage),vt}var U=`/node`,bt=/^[A-Za-z0-9_-]{1,128}$/,xt={nodeId:null,malformed:!1,logicalPathname:`/`},St={nodeId:null,malformed:!0},Ct={nodeId:null,malformed:!1};function W(e){return bt.test(e)}function G(e){let t=e.indexOf(`#`),n=t===-1?e:e.slice(0,t),r=n.indexOf(`?`),i=r===-1?n:n.slice(0,r);return{pathname:i,suffix:e.slice(i.length)}}function wt(e){let{pathname:t,suffix:n}=G(e);if(t!==U&&!t.startsWith(`${U}/`))return{routed:Ct,logicalHref:e};let r=t.slice(6),i=r.indexOf(`/`),a=i===-1?r:r.slice(0,i);if(!W(a))return{routed:St,logicalHref:`/`};let o=i===-1?`/`:r.slice(i)||`/`;return{routed:{nodeId:a,malformed:!1},logicalHref:`${o}${n}`}}var Tt=new Set([`sign-in`,`sign-up`,`public-signup`,`password-reset`,`invitation`,`setup`,`email-verification`,`nodes`,`account`]),K=()=>null;function Et(e){return K=e,()=>{K===e&&(K=()=>null)}}function Dt(e){let t=/^\/([^/]+)\/[^/]+\/?$/u.exec(e)?.[1];if(!t||Tt.has(t)||t===`draft`||t===`node`)return null;try{return decodeURIComponent(t)}catch{return t}}function Ot(e){if(!e.startsWith(`/`))return!1;let t=e.slice(1).split(`/`,1)[0]??``;return Tt.has(t)}function kt(e,t){let{pathname:n,suffix:r}=G(e);if(Ot(n))return e;let i=Dt(n),a=i?K(i)??t:t;return a===null||!W(a)?e:`${n===``||n===`/`?`${U}/${a}`:`${U}/${a}${n}`}${r}`}var q=xt,At=new Set,J=null;function Y(e){if(e.nodeId!==q.nodeId||e.malformed!==q.malformed||e.logicalPathname!==q.logicalPathname){q=e;for(let e of Array.from(At))e()}}function jt(e){let{pathname:t}=G(e);return t===``?`/`:t}function Mt(){return q}function Nt(e){return At.add(e),()=>{At.delete(e)}}function Pt(e,t){let n=e.indexOf(`#`),r=n===-1?e:e.slice(0,n),i=r.indexOf(`?`);return{href:e,pathname:i===-1?r:r.slice(0,i),search:i===-1?``:r.slice(i),hash:n===-1?``:e.slice(n),state:t??{__TSR_index:0}}}function Ft(e=window){let t=le({window:e,parseLocation:()=>{let t=wt(`${e.location.pathname}${e.location.search}${e.location.hash}`);return Y({...t.routed,logicalPathname:jt(t.logicalHref)}),Pt(t.logicalHref,e.history.state)},createHref:e=>kt(e,q.nodeId)}),n=t.subscribe(({location:e,action:t})=>{if(t.type!==`PUSH`&&t.type!==`REPLACE`)return;let n=wt(kt(e.href,q.nodeId));Y({...n.routed,logicalPathname:jt(n.logicalHref)})}),r=t.destroy.bind(t);return t.destroy=()=>{n(),r()},J=t,t}function It(){return J}function Lt(e){let t=J;return!t||!W(e)?!1:(Y({nodeId:e,malformed:!1,logicalPathname:`/`}),t.push(`/`),!0)}function Rt(e){let t=J;return!t||!W(e)?!1:(Y({nodeId:e,malformed:!1,logicalPathname:q.logicalPathname}),t.replace(t.location.href),!0)}function zt(){let e=J;return e?(Y({nodeId:null,malformed:!1,logicalPathname:`/nodes`}),e.push(`/nodes`),!0):!1}function Bt(){let e=J;e&&(Y(xt),e.replace(`/`))}var Vt=25e3,Ht=pe;function Ut(e,t){switch(t.type){case`thread-detail`:return JSON.stringify([e,t.type,t.threadId]);case`vcs-status`:return JSON.stringify([e,t.type,t.cwd]);case`provider-status`:return JSON.stringify([e,t.type,t.instanceId??null])}}function Wt(){let e=new Map,t=new Set,n=()=>{for(let e of Array.from(t))e()};return{retain(t,r){let i=Ut(t,r),a=e.get(i);e.set(i,{key:i,environmentId:t,scope:r,refCount:(a?.refCount??0)+1}),a||n();let o=!1;return()=>{if(o)return;o=!0;let t=e.get(i);if(t){if(t.refCount>1){e.set(i,{...t,refCount:t.refCount-1});return}e.delete(i),n()}}},list:()=>Array.from(e.values()),subscribe(e){return t.add(e),()=>t.delete(e)},reset(){e.size!==0&&(e.clear(),n())}}}var X=Wt();function Gt(e,t){return X.retain(e,{type:`thread-detail`,threadId:t})}function Kt(e,t){return X.retain(e,{type:`vcs-status`,cwd:t})}function qt(e,t){return X.retain(e,{type:`provider-status`,...t?{instanceId:t}:{}})}function Jt(e){let t=me(1),n=[],r=Promise.resolve(),i=!1,a=0,o=new Map,s=new Set,c=()=>{for(let e of Array.from(s))e()},l=()=>{let n=new Map(e.scopes.list().map(e=>[e.key,e]));for(let[e,r]of Array.from(o))n.has(e)||(o.delete(e),t=ye(t,r));for(let[r,i]of n){let n=o.get(r);if(n){t=ve(t,n,e.now(),Ht);continue}let s=`hosted-web-${++a}`;o.set(r,s),t=_e(t,{leaseId:s,environmentId:i.environmentId,scope:i.scope,now:e.now(),ttlMs:Ht})}},u=async()=>{if(i)return;l();let r=Se(t,{now:e.now(),wakeStaggerMs:750});t=r.state,n=r.queued,c();for(let n of r.release)await e.release(n).catch(()=>void 0),t=P(t,n,!1,e.now());for(let n of r.connect)try{await e.connect(n.environmentId,n.delayMs),t=P(t,n.environmentId,!0,e.now())}catch{t=P(t,n.environmentId,!1,e.now())}n=Se(t,{now:e.now(),wakeStaggerMs:750}).queued,c()},d=()=>{let e=r.catch(()=>void 0).then(u);return r=e.catch(()=>void 0),e},f=e.scopes.subscribe(()=>void d()),p=e.setInterval(()=>void d(),Vt);return{snapshot:()=>({demand:t,queuedEnvironmentIds:n,activeConnectionCount:t.connections.filter(e=>e.connected).length}),subscribe(e){return s.add(e),()=>s.delete(e)},reportConnected(n,r){t=P(t,n,r,e.now()),c()},setBackgrounded(e){return t=be(t,e),d()},reconcile:d,dispose(){i||(i=!0,f(),e.clearInterval(p),s.clear())}}}var Yt={machines:[],snapshots:[],projects:[],worktrees:[],threads:[],logicalProjects:[]},Z={status:`signed-out`,accountId:null,machines:[],workspace:Yt,demand:{demand:me(1),queuedEnvironmentIds:[],activeConnectionCount:0}},Xt=new Set,Q=null;function Zt(e){Z=e;for(let e of Array.from(Xt))e()}function Qt(){return Z}function $t(){return(0,F.useSyncExternalStore)(en,Qt,Qt)}function en(e){return Xt.add(e),()=>Xt.delete(e)}function $(e){return e.capabilities?.nativeClientRequired===!0}function tn(e,t,n,r,i){return ke(e.map(e=>({environmentId:e.environmentId,nodeId:e.id,label:e.label,platform:{os:e.platformOs,arch:e.platformArch},serverVersion:e.clientVersion,capabilities:{repositoryIdentity:e.capabilities?.repositoryIdentity??!0,threadSettlement:e.capabilities?.threadSettlement??!1,nativeClientRequired:e.capabilities?.nativeClientRequired??!1},clientTier:`hosted-web`,nativeTrust:`not-required`,requiresNativeVerification:!1,effectiveRole:e.effectiveRole,online:e.presence.online,lastSeenAt:e.presence.lastHeartbeatAt,observedAt:i,connectionState:e.environmentId===t&&n?`connected`:`disconnected`,deliveryUnknown:e.environmentId===t&&r,revokedAt:e.revokedAt})))}function nn(e){let t=e?.cache??yt(),n=e?.now??Date.now,r=e?.setTimeout??((e,t)=>globalThis.setTimeout(e,t)),i=e?.clearTimeout??(e=>globalThis.clearTimeout(e)),a=e?.setInterval??((e,t)=>globalThis.setInterval(e,t)),o=e?.clearInterval??(e=>globalThis.clearInterval(e)),s=e?.hubOrigin??window.location.origin,c=new Map,l=null,f=null,p=null,m=!1,h=0,g=null,_=Jt({scopes:X,now:n,setInterval:a,clearInterval:o,connect:async(e,t)=>{t>0&&await new Promise(e=>r(e,t));let n=E.getState();if(n.directoryStatus!==`ready`||n.browserStatus!==`current`)throw Error(`Hosted Web directory is not current.`);let i=n.nodes.find(t=>t.environmentId===e&&t.revokedAt===null&&t.presence.online&&!$(t));if(!i)throw Error(`Hosted Web environment is not eligible.`);await T.selectNode(i.id)},release:async e=>{E.getState().selectedNode?.environmentId===e&&await T.returnToDirectory()}});Q=_;let v=e=>{let t=E.getState();Zt({status:t.accountStatus===`authenticated`?t.directoryStatus===`ready`?`ready`:t.directoryStatus===`stale`?`stale`:`loading`:`signed-out`,accountId:t.account?.id??null,machines:e,workspace:je({machines:e,snapshots:Array.from(c.values())}),demand:_.snapshot()})},y=async()=>{let e=++h,r=E.getState(),i=r.accountStatus===`authenticated`?r.account?.id??null:null,a=i?JSON.stringify([s,i]):null,o=f;if(f=i,o&&i!==o&&(await t.purgeAccount({hubOrigin:s,accountId:o}).catch(()=>void 0),c.clear(),X.reset(),u()),!i){l=null,v([]);return}if(a!==l&&r.directoryStatus===`ready`){l=a;let n=await t.list({hubOrigin:s,accountId:i});if(m||e!==h)return;let o=new Set(r.nodes.filter(e=>e.revokedAt===null&&!$(e)).map(e=>e.environmentId));for(let e of n){if(!o.has(e.namespace.environmentId)){await t.purgeEnvironment(e.namespace).catch(()=>void 0);continue}c.set(e.namespace.environmentId,e.snapshot),d.getState().hydrateEnvironmentStateFromCache(ne(e.snapshot),e.namespace.environmentId)}}let p=r.selectedNode?.environmentId??null,y=p!==null&&r.transportStatus!==`idle`&&r.transportStatus!==`terminal-failure`,b=r.transportStatus===`online`&&r.sessionEstablished;g&&g!==p&&_.reportConnected(g,!1),p&&_.reportConnected(p,y),g=p;let x=tn(r.nodes,p,b,r.sessionStatus===`delivery-unknown`,n()),S=new Map(x.map(e=>[e.environmentId,e]));if(r.directoryStatus===`ready`)for(let[e]of Array.from(c))S.get(e)?.cacheDisposition!==`available`&&(c.delete(e),d.getState().removeEnvironmentState(e),await t.purgeEnvironment({hubOrigin:s,accountId:i,environmentId:e}).catch(()=>void 0));m||e!==h||v(x)},b=()=>{p!==null&&i(p),p=r(()=>{if(p=null,m||!f)return;let e=Z.machines;for(let r of e){if(!r.canReadMetadata)continue;let e=te(r.environmentId,n(),r.deliveryUnknown);e&&(c.set(r.environmentId,e),t.replace({namespace:{hubOrigin:s,accountId:f,environmentId:r.environmentId},snapshot:e,payloadBytes:k(e),updatedAt:n()}).catch(()=>void 0))}v(e)},100)},x=E.subscribe(()=>void y()),S=d.subscribe(b),C=_.subscribe(()=>v(Z.machines)),w=Et(on);return _.reconcile(),y(),()=>{m=!0,h+=1,p!==null&&i(p),x(),S(),C(),w(),_.dispose(),Q===_&&(Q=null,Zt({status:`signed-out`,accountId:null,machines:[],workspace:Yt,demand:_.snapshot()}))}}function rn(e){return Q?.setBackgrounded(e)??Promise.resolve()}function an(){return Q!==null}function on(e){return E.getState().nodes.find(t=>t.environmentId===e&&t.revokedAt===null&&!$(t))?.id??null}function sn(){let e=(0,I.c)(7),t=d(re(un)),n=m(ln),r=w(),o=cn,s;e[0]===r.state.matches?s=e[1]:(s=()=>{let e=r.state.matches[r.state.matches.length-1]?.params??{};return C(e)},e[0]=r.state.matches,e[1]=s);let c=s,l;return e[2]!==c||e[3]!==n||e[4]!==t||e[5]!==r?(l=(e,s)=>{let{getDraftSessionByLogicalProjectKey:l,getDraftSession:u,getDraftThread:d,applyStickyState:f,setDraftThreadContext:p,setLogicalProjectDraftThreadId:m}=v.getState(),h=c(),_=t.find(t=>t.id===e.projectId&&t.environmentId===e.environmentId),x=_?g(_,n):i(e),S=s?.branch!==void 0,C=s?.worktreePath!==void 0,w=s?.envMode!==void 0,T=l(x),E=h?h.kind===`server`?d(h.threadRef):u(h.draftId):null;if(T)return(async()=>{(S||C||w)&&p(T.draftId,{...S?{branch:s?.branch??null}:{},...C?{worktreePath:s?.worktreePath??null}:{},...w?{envMode:s?.envMode}:{}}),m(x,e,T.draftId,{threadId:T.threadId}),(h?.kind!==`draft`||h.draftId!==T.draftId)&&(o(e.environmentId),await r.navigate({to:`/draft/$draftId`,params:{draftId:T.draftId}}))})();if(E&&h?.kind===`draft`&&E.logicalProjectKey===x&&E.promotedTo==null)return(S||C||w)&&p(h.draftId,{...S?{branch:s?.branch??null}:{},...C?{worktreePath:s?.worktreePath??null}:{},...w?{envMode:s?.envMode}:{}}),m(x,e,h.draftId,{threadId:E.threadId,createdAt:E.createdAt,runtimeMode:E.runtimeMode,interactionMode:E.interactionMode,tokenMode:E.tokenMode??`balanced`,...S?{branch:s?.branch??null}:{},...C?{worktreePath:s?.worktreePath??null}:{},...w?{envMode:s?.envMode}:{}}),Promise.resolve();let D=y(),ee=b(),O=new Date().toISOString();return(async()=>{m(x,e,D,{threadId:ee,createdAt:O,branch:s?.branch??null,worktreePath:s?.worktreePath??null,envMode:s?.envMode??`local`,runtimeMode:a,tokenMode:n.defaultAgentTokenMode??`balanced`}),f(D),o(e.environmentId),await r.navigate({to:`/draft/$draftId`,params:{draftId:D}})})()},e[2]=c,e[3]=n,e[4]=t,e[5]=r,e[6]=l):l=e[6],l}function cn(e){let t=on(e);t&&Rt(t)}function ln(e){return{sidebarProjectGroupingMode:e.sidebarProjectGroupingMode,sidebarProjectGroupingOverrides:e.sidebarProjectGroupingOverrides,defaultAgentTokenMode:e.defaultAgentTokenMode}}function un(e){return l(e)}function dn(){let e=(0,I.c)(2),t=sn(),n;return e[0]===t?n=e[1]:(n={handleNewThread:t},e[0]=t,e[1]=n),n}function fn(){let e=(0,I.c)(25),t=D(vn),n=m(_n),r;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(r={strict:!1,select:gn},e[0]=r):r=e[0];let i=S(r),a=i?.kind===`server`?i.threadRef:null,o;e[1]===a?o=e[2]:(o=p(a),e[1]=a,e[2]=o);let s=d(o),c=v(hn),l;e[3]!==c||e[4]!==i?(l=()=>i?i.kind===`server`?c(i.threadRef):v.getState().getDraftSession(i.draftId):null,e[3]=c,e[4]=i,e[5]=l):l=e[5];let u=v(l),f=d(re(mn)),_;e[6]!==t||e[7]!==f?(_=Qe({items:f,preferredIds:t,getId:h}),e[6]=t,e[7]=f,e[8]=_):_=e[8];let y=_,b=sn(),x=ee(),C=$t(),w;e[9]!==x||e[10]!==C.machines||e[11]!==C.status?(w=C.status===`signed-out`?{machines:x.machines,ready:x.status===`ready`,localEnvironmentId:x.localEnvironmentId}:{machines:C.machines.map(pn),ready:C.status===`ready`,localEnvironmentId:null},e[9]=x,e[10]=C.machines,e[11]=C.status,e[12]=w):w=e[12];let T=w,E;e[13]===n?E=e[14]:(E=e=>g(e,n),e[13]=n,e[14]=E);let O;e[15]!==y||e[16]!==E||e[17]!==T?(O=pt({orderedProjects:y,...T,logicalKey:E}),e[15]=y,e[16]=E,e[17]=T,e[18]=O):O=e[18];let k=O,A;return e[19]!==u||e[20]!==s||e[21]!==k||e[22]!==b||e[23]!==a?(A={activeDraftThread:u,activeThread:s,defaultProjectRef:k,handleNewThread:b,routeThreadRef:a},e[19]=u,e[20]=s,e[21]=k,e[22]=b,e[23]=a,e[24]=A):A=e[24],A}function pn(e){return{...e,online:e.presence.online}}function mn(e){return l(e)}function hn(e){return e.getDraftThread}function gn(e){return C(e)}function _n(e){return{sidebarProjectGroupingMode:e.sidebarProjectGroupingMode,sidebarProjectGroupingOverrides:e.sidebarProjectGroupingOverrides}}function vn(e){return e.projectOrder}export{lt as A,Ve as B,Fe as C,Ye as D,ot as E,ct as F,et as G,rt as H,tt as I,ue as J,Ke as K,nt as L,Xe as M,Ze as N,Qe as O,st as P,Je as R,ze as S,$e as T,Re as U,He as V,ft as W,N as Y,zt as _,rn as a,Pe as b,qt as c,Rt as d,Bt as f,Ft as g,Mt as h,$ as i,it as j,at as k,Gt as l,It as m,dn as n,nn as o,Lt as p,le as q,an as r,$t as s,fn as t,Kt as u,Nt as v,ut as w,Ie as x,Ne as y,Ue as z};
@@ -1 +0,0 @@
1
- import{i as e,t}from"./react-SIfiwpqq.js";import{f as n}from"./utils-c6dglOTK.js";import{S as r,T as i,b as a,g as o,h as s,m as c,p as l,w as u}from"./useSwipeDismiss-B8Fo31QE.js";import{t as d}from"./useRouter-CcIDS3PN.js";var f=e(t(),1),p=f.useLayoutEffect;function m(e,t,n){f.useEffect(()=>{if(!e.current||n||typeof IntersectionObserver!=`function`)return()=>t();let r=new IntersectionObserver(e=>{t(e.pop())},{rootMargin:`100px`});return r.observe(e.current),()=>{r.disconnect(),t()}},[t,n,e])}function h(e){let t=f.useRef(null);return f.useImperativeHandle(e,()=>t.current,[]),t}function g(e){let t=new Map,n,r,i=e=>{e.next&&(e.prev?(e.prev.next=e.next,e.next.prev=e.prev,e.next=void 0,r&&(r.next=e,e.prev=r)):(e.next.prev=void 0,n=e.next,e.next=void 0,r&&(e.prev=r,r.next=e)),r=e)};return{get(e){let n=t.get(e);if(n)return i(n),n.value},set(a,o){if(t.size>=e&&n){let e=n;t.delete(e.key),e.next&&(n=e.next,e.next.prev=void 0),e===r&&(r=void 0)}let s=t.get(a);if(s)s.value=o,i(s);else{let e={key:a,value:o,prev:r};r&&(r.next=e),r=e,n||=e,t.set(a,e)}},clear(){t.clear(),n=void 0,r=void 0}}}var _=4,v=5;function y(e,t,n=new Uint16Array(6)){let r=e.indexOf(`/`,t),i=r===-1?e.length:r,a=e.substring(t,i);if(!a||!a.includes(`$`))return n[0]=0,n[1]=t,n[2]=t,n[3]=i,n[4]=i,n[5]=i,n;if(a===`$`){let r=e.length;return n[0]=2,n[1]=t,n[2]=t,n[3]=r,n[4]=r,n[5]=r,n}if(a.charCodeAt(0)===36)return n[0]=1,n[1]=t,n[2]=t+1,n[3]=i,n[4]=i,n[5]=i,n;let o=a.indexOf(`{`),s;if(o!==-1&&o+1<a.length&&(s=a.indexOf(`}`,o))!==-1){let r=a.charCodeAt(o+1);if(r===45){if(o+2<a.length&&a.charCodeAt(o+2)===36){let e=o+3,r=s;if(e<r)return n[0]=3,n[1]=t+o,n[2]=t+e,n[3]=t+r,n[4]=t+s+1,n[5]=i,n}}else if(r===36){let r=o+1,a=o+2;return a===s?(n[0]=2,n[1]=t+o,n[2]=t+r,n[3]=t+a,n[4]=t+s+1,n[5]=e.length,n):(n[0]=1,n[1]=t+o,n[2]=t+a,n[3]=t+s,n[4]=t+s+1,n[5]=i,n)}}return n[0]=0,n[1]=t,n[2]=t,n[3]=i,n[4]=i,n[5]=i,n}function b(e,t,n,r,i,a,o,s){s?.(n);let c=r;{let r=n.fullPath??n.from,s=n.options,l=r.length,u=s?.caseSensitive??e,d=s?.params?.parse??s?.parseParams;for(;c<l;){let e=y(r,c,t),n,s=c,l=e[5];c=l+1,a++;let f=e[0];switch(f){case 0:{let t=r.substring(e[2],e[3]),o=t,s;u?s=i.static??=new Map:(o=t.toLowerCase(),s=i.staticInsensitive??=new Map);let c=s.get(o);if(c)n=c;else{let e=S(r);e.parent=i,e.depth=a,n=e,s.set(o,e)}break}case 1:case 3:case 2:{let t=r.substring(s,e[1]),c=r.substring(e[4],l),p=u&&!!(t||c),m=t?p?t:t.toLowerCase():void 0,h=c?p?c:c.toLowerCase():void 0,g=f===1?i.dynamic:f===3?i.optional:i.wildcard,_=f!==2&&!d&&g?.find(e=>!e.parse&&e.caseSensitive===p&&e.prefix===m&&e.suffix===h);if(_)n=_;else{let e=C(f,r,p,m,h);n=e,e.parent=i,e.depth=a;let t;t=f===1?i.dynamic??=[]:f===3?i.optional??=[]:i.wildcard??=[],t.push(e),t.length===2&&o?.push(t)}break}}i=n}if(d&&n.children&&!n.isRoot&&n.id&&n.id.charCodeAt(n.id.lastIndexOf(`/`)+1)===95){let e=S(r);e.kind=v,e.parent=i,a++,e.depth=a,i.pathless??=[],i.pathless.push(e),i=e}let f=(n.path||!n.children)&&!n.isRoot;if(f&&r.endsWith(`/`)){let e=S(r);e.kind=_,e.parent=i,a++,e.depth=a,i.index=e,i=e}i.parse=d??null,i.priority=s?.params?.priority??0,f&&!i.route&&(i.route=n,i.fullPath=r)}if(n.children)for(let r of n.children)b(e,t,r,c,i,a,o,s)}function x(e,t){if(e.parse&&!t.parse)return-1;if(!e.parse&&t.parse)return 1;if(e.parse&&t.parse&&(e.priority||t.priority))return t.priority-e.priority;if(e.prefix&&t.prefix&&e.prefix!==t.prefix){if(e.prefix.startsWith(t.prefix))return-1;if(t.prefix.startsWith(e.prefix))return 1}if(e.suffix&&t.suffix&&e.suffix!==t.suffix){if(e.suffix.endsWith(t.suffix))return-1;if(t.suffix.endsWith(e.suffix))return 1}return e.prefix&&!t.prefix?-1:!e.prefix&&t.prefix?1:e.suffix&&!t.suffix?-1:!e.suffix&&t.suffix?1:e.caseSensitive&&!t.caseSensitive?-1:!e.caseSensitive&&t.caseSensitive?1:0}function S(e){return{kind:0,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:e,parent:null,parse:null,priority:0}}function C(e,t,n,r,i){return{kind:e,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:t,parent:null,parse:null,priority:0,caseSensitive:n,prefix:r,suffix:i}}function w(e,t){let n=S(`/`),r=new Uint16Array(6),i=[];for(let t of e)b(!1,r,t,1,n,0,i);for(let e of i)e.sort(x);t.masksTree=n,t.flatCache=g(1e3)}function T(e,t){e||=`/`;let n=t.flatCache.get(e);if(n)return n;let r=A(e,t.masksTree);return t.flatCache.set(e,r),r}function E(e,t,n,r,i){e||=`/`,r||=`/`;let a=t?`case\0${e}`:e,o=i.singleCache.get(a);return o||(o=S(`/`),b(t,new Uint16Array(6),{from:e},1,o,0),i.singleCache.set(a,o)),A(r,o,n)}function D(e,t,n=!1){let r=n?e:`nofuzz\0${e}`,i=t.matchCache.get(r);if(i!==void 0)return i;e||=`/`;let a;try{a=A(e,t.segmentTree,n)}catch(e){if(e instanceof URIError)a=null;else throw e}return a&&(a.branch=M(a.route)),t.matchCache.set(r,a),a}function O(e){return e===`/`?e:e.replace(/\/{1,}$/,``)}function k(e,t=!1,n){let r=S(e.fullPath),i=new Uint16Array(6),a=[],s={},c={},l=0;b(t,i,e,1,r,0,a,e=>{if(n?.(e,l),e.id in s&&o(),s[e.id]=e,l!==0&&e.path){let t=O(e.fullPath);(!c[t]||e.fullPath.endsWith(`/`))&&(c[t]=e)}l++});for(let e of a)e.sort(x);return{processedTree:{segmentTree:r,singleCache:g(1e3),matchCache:g(1e3),flatCache:null,masksTree:null},routesById:s,routesByPath:c}}function A(e,t,n=!1){let r=e.split(`/`),i=te(e,r,t,n);if(!i)return null;let[a]=j(e,r,i);return{route:i.node.route,rawParams:a}}function j(e,t,n){let r=ee(n.node),i=null,a=Object.create(null),o=n.extract?.part??0,s=n.extract?.node??0,c=n.extract?.path??0,l=n.extract?.segment??0;for(;s<r.length;o++,s++,c++,l++){let u=r[s];if(u.kind===_)break;if(u.kind===v){l--,o--,c--;continue}let d=t[o],f=c;if(d&&(c+=d.length),u.kind===1){i??=n.node.fullPath.split(`/`);let e=i[l],t=u.prefix?.length??0;if(e.charCodeAt(t)===123){let n=u.suffix?.length??0,r=e.substring(t+2,e.length-n-1),i=d.substring(t,d.length-n);a[r]=decodeURIComponent(i)}else{let t=e.substring(1);a[t]=decodeURIComponent(d)}}else if(u.kind===3){if(n.skipped&1<<s){o--,c=f-1;continue}i??=n.node.fullPath.split(`/`);let e=i[l],t=u.prefix?.length??0,r=u.suffix?.length??0,p=e.substring(t+3,e.length-r-1),m=u.suffix||u.prefix?d.substring(t,d.length-r):d;m&&(a[p]=decodeURIComponent(m))}else if(u.kind===2){let t=u,n=e.substring(f+(t.prefix?.length??0),e.length-(t.suffix?.length??0)),r=decodeURIComponent(n);a[`*`]=r,a._splat=r;break}}return n.rawParams&&Object.assign(a,n.rawParams),[a,{part:o,node:s,path:c,segment:l}]}function M(e){let t=[e];for(;e.parentRoute;)e=e.parentRoute,t.push(e);return t.reverse(),t}function ee(e){let t=Array(e.depth+1);do t[e.depth]=e,e=e.parent;while(e);return t}function te(e,t,n,r){if(e===`/`&&n.index)return{node:n.index,skipped:0};let a=!i(t),o=a&&e!==`/`,s=t.length-+!!a,c=[{node:n,index:1,skipped:0,statics:0,dynamics:0,optionals:0}],l=null,u=null;for(;c.length;){let n=c.pop(),{node:i,index:a,skipped:d,statics:f,dynamics:p,optionals:m}=n,{extract:h,rawParams:g}=n;if(i.kind===2&&i.route&&!P(u,n))continue;if(i.parse){if(!re(e,t,n))continue;g=n.rawParams,h=n.extract}r&&i.route&&i.kind!==_&&P(l,n)&&(l=n);let v=a===s;if(v&&(i.route&&(!o||i.kind===_||i.kind===2)&&P(u,n)&&(u=n),!i.optional&&!i.wildcard&&!i.index&&!i.pathless))continue;let y=v?void 0:t[a],b;if(v&&i.index){let n={node:i.index,index:a,skipped:d,statics:f,dynamics:p,optionals:m,extract:h,rawParams:g},r=!0;if(i.index.parse&&(re(e,t,n)||(r=!1)),r){if(!p&&!m&&!d&&ne(f,s))return n;P(u,n)&&(u=n)}}if(i.wildcard)for(let e=i.wildcard.length-1;e>=0;e--){let n=i.wildcard[e],{prefix:r,suffix:o}=n;if(!(r&&(v||!(n.caseSensitive?y:b??=y.toLowerCase()).startsWith(r)))){if(o){if(v)continue;let e=t.slice(a).join(`/`).slice(-o.length);if((n.caseSensitive?e:e.toLowerCase())!==o)continue}c.push({node:n,index:s,skipped:d,statics:f,dynamics:p,optionals:m,extract:h,rawParams:g})}}if(i.optional){let e=d|1<<i.depth+1;for(let t=i.optional.length-1;t>=0;t--){let n=i.optional[t];c.push({node:n,index:a,skipped:e,statics:f,dynamics:p,optionals:m,extract:h,rawParams:g})}if(!v)for(let e=i.optional.length-1;e>=0;e--){let t=i.optional[e],{prefix:n,suffix:r}=t;if(n||r){let e=t.caseSensitive?y:b??=y.toLowerCase();if(n&&!e.startsWith(n)||r&&!e.endsWith(r))continue}c.push({node:t,index:a+1,skipped:d,statics:f,dynamics:p,optionals:m+N(s,a),extract:h,rawParams:g})}}if(!v&&i.dynamic&&y)for(let e=i.dynamic.length-1;e>=0;e--){let t=i.dynamic[e],{prefix:n,suffix:r}=t;if(n||r){let e=t.caseSensitive?y:b??=y.toLowerCase();if(n&&!e.startsWith(n)||r&&!e.endsWith(r))continue}c.push({node:t,index:a+1,skipped:d,statics:f,dynamics:p+N(s,a),optionals:m,extract:h,rawParams:g})}if(!v&&i.staticInsensitive){let e=i.staticInsensitive.get(b??=y.toLowerCase());e&&c.push({node:e,index:a+1,skipped:d,statics:f+N(s,a),dynamics:p,optionals:m,extract:h,rawParams:g})}if(!v&&i.static){let e=i.static.get(y);e&&c.push({node:e,index:a+1,skipped:d,statics:f+N(s,a),dynamics:p,optionals:m,extract:h,rawParams:g})}if(i.pathless)for(let e=i.pathless.length-1;e>=0;e--){let t=i.pathless[e];c.push({node:t,index:a,skipped:d,statics:f,dynamics:p,optionals:m,extract:h,rawParams:g})}}if(u)return u;if(r&&l){let n=l.index;for(let e=0;e<l.index;e++)n+=t[e].length;let r=n===e.length?`/`:e.slice(n);return l.rawParams??=Object.create(null),l.rawParams[`**`]=decodeURIComponent(r),l}return null}function N(e,t){return 2**(e-t-1)}function ne(e,t){return e===2**(t-1)-1}function re(e,t,n){let r,i;try{[r,i]=j(e,t,n)}catch{return null}if(n.rawParams=r,n.extract=i,!n.node.parse)return!0;try{if(n.node.parse(r)===!1)return null}catch{}return!0}function P(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===_)>(e.node.kind===_)||t.node.kind===_==(e.node.kind===_)&&t.node.depth>e.node.depth)))}function ie(e){return F(e.filter(e=>e!==void 0).join(`/`))}function F(e){return e.replace(/\/{2,}/g,`/`)}function ae(e){return e===`/`?e:e.replace(/^\/{1,}/,``)}function oe(e){let t=e.length;return t>1&&e[t-1]===`/`?e.replace(/\/{1,}$/,``):e}function se(e){return oe(ae(e))}function I(e,t){return e?.endsWith(`/`)&&e!==`/`&&e!==`${t}/`?e.slice(0,-1):e}function ce(e,t,n){return I(e,n)===I(t,n)}function le({base:e,to:t,trailingSlash:n=`never`,cache:r}){let a=t===`.`,o=t.startsWith(`/`),s;if(r){s=o?t:a?e:e+`\0`+t;let n=r.get(s);if(n)return n}let c;if(a)c=e.split(`/`);else if(o)c=t.split(`/`);else{for(c=e.split(`/`);c.length>1&&i(c)===``;)c.pop();let n=t.split(`/`);for(let e=0,t=n.length;e<t;e++){let r=n[e];r===``?e?e===t-1&&c.push(r):c=[r]:r===`..`?c.length>1?c.pop():c=[``]:r===`.`||c.push(r)}}c.length>1&&(i(c)===``?n===`never`&&c.pop():n===`always`&&c.push(``));let l=F(c.join(`/`))||`/`;return s&&r&&r.set(s,l),l}function ue(e){let t=new Map(e.map(e=>[encodeURIComponent(e),e])),n=Array.from(t.keys()).map(e=>e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)).join(`|`),r=new RegExp(n,`g`);return e=>e.replace(r,e=>t.get(e)??e)}function L(e,t,n){let r=t[e];return typeof r==`string`?e===`_splat`?/^[a-zA-Z0-9\-._~!/]*$/.test(r)?r:r.split(`/`).map(e=>R(e,n)).join(`/`):R(r,n):r}function de({path:e,params:t,decoder:n,...r}){let i=!1,a=Object.create(null);if(!e||e===`/`)return{interpolatedPath:`/`,usedParams:a,isMissingParams:i};if(!e.includes(`$`))return{interpolatedPath:e,usedParams:a,isMissingParams:i};let o=e.length,s=0,c,l=``;for(;s<o;){let r=s;c=y(e,r,c);let o=c[5];if(s=o+1,r===o)continue;let u=c[0];if(u===0){l+=`/`+e.substring(r,o);continue}if(u===2){let s=t._splat;a._splat=s,a[`*`]=s;let u=e.substring(r,c[1]),d=e.substring(c[4],o);if(!s){i=!0,(u||d)&&(l+=`/`+u+d);continue}let f=L(`_splat`,t,n);l+=`/`+u+f+d;continue}if(u===1){let s=e.substring(c[2],c[3]);!i&&!(s in t)&&(i=!0),a[s]=t[s];let u=e.substring(r,c[1]),d=e.substring(c[4],o),f=L(s,t,n)??`undefined`;l+=`/`+u+f+d;continue}if(u===3){let i=e.substring(c[2],c[3]),s=t[i];if(s==null)continue;a[i]=s;let u=e.substring(r,c[1]),d=e.substring(c[4],o),f=L(i,t,n)??``;l+=`/`+u+f+d;continue}}return e.endsWith(`/`)&&(l+=`/`),{usedParams:a,interpolatedPath:l||`/`,isMissingParams:i}}function R(e,t){let n=encodeURIComponent(e);return t?.(n)??n}function z(e){return e?.isNotFound===!0}var B=`__root__`,fe=`Error preloading route! ☝️`,V=n();function H(e){return(0,V.jsx)(U,{...e})}var U=class extends f.Component{constructor(...e){super(...e),this.state={error:null},this.reset=()=>{this.setState({error:null})}}static getDerivedStateFromProps(e,t){let n=e.getResetKey();return t.error&&t.resetKey!==n?{resetKey:n,error:null}:{resetKey:n}}static getDerivedStateFromError(e){return{error:e}}componentDidCatch(e,t){this.props.onCatch?.(e,t)}render(){let e=this.state.error;return e?f.createElement(this.props.errorComponent??W,{error:e,reset:this.reset}):this.props.children}};function W({error:e}){let[t,n]=f.useState(!1);return(0,V.jsxs)(`div`,{style:{padding:`.5rem`,maxWidth:`100%`},children:[(0,V.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:`.5rem`},children:[(0,V.jsx)(`strong`,{style:{fontSize:`1rem`},children:`Something went wrong!`}),(0,V.jsx)(`button`,{style:{appearance:`none`,fontSize:`.6em`,border:`1px solid currentColor`,padding:`.1rem .2rem`,fontWeight:`bold`,borderRadius:`.25rem`},onClick:()=>n(e=>!e),children:t?`Hide Error`:`Show Error`})]}),(0,V.jsx)(`div`,{style:{height:`.25rem`}}),t?(0,V.jsx)(`div`,{children:(0,V.jsx)(`pre`,{style:{fontSize:`.7em`,border:`1px solid red`,borderRadius:`.25rem`,padding:`.3rem`,color:`red`,overflow:`auto`},children:e.message?(0,V.jsx)(`code`,{children:e.message}):null})}):null]})}function G({children:e,fallback:t=null}){return(0,V.jsx)(f.Fragment,{children:pe()?e:t})}function pe(){return f.useSyncExternalStore(K,()=>!0,()=>!1)}function K(){return()=>{}}function me(e){let t=f.useRef(e);return a(t.current,e,{ignoreUndefined:!1})||(t.current=e),t.current}function he(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]}function ge(e,t,n){if(e?.external)return u(e.href,n)?void 0:e.href;if(!X(t)&&typeof t==`string`&&t.indexOf(`:`)!==-1)try{return new URL(t),u(t,n)?void 0:t}catch{}}function _e(e,t,n,r,i,o){if(o)return!1;if(n?.exact){if(!ce(e.pathname,t.pathname,r))return!1}else{let n=I(e.pathname,r),i=I(t.pathname,r);if(!(n.startsWith(i)&&(n.length===i.length||n[i.length]===`/`)))return!1}return(n?.includeSearch??!0)&&!a(e.search,t.search,{partial:!n?.exact,ignoreUndefined:!n?.explicitUndefined})?!1:!n?.includeHash||i&&e.hash===t.hash}function q(e,t){let n=d(),i=h(t),{activeProps:a,inactiveProps:o,activeOptions:s,to:l,preload:u,preloadDelay:p,preloadIntentProximity:g,hashScrollIntoView:_,replace:v,startTransition:y,resetScroll:b,viewTransition:x,children:S,target:C,disabled:w,style:T,className:E,onClick:D,onBlur:O,onFocus:k,onMouseEnter:A,onMouseLeave:j,onTouchStart:M,ignoreBlocker:ee,params:te,search:N,hash:ne,state:re,mask:P,reloadDocument:ie,unsafeRelative:F,from:ae,_fromLocation:oe,...se}=e,I=pe(),ce=me(e.search),le=me(e.params),ue=me(s),L=f.useMemo(()=>e,[n,e.from,e._fromLocation,e.hash,e.to,ce,le,e.state,e.mask,e.unsafeRelative]),de=f.useCallback(e=>{let t=n.buildLocation({_fromLocation:e,...L}),r=Ce(t.maskedLocation?t.maskedLocation.publicHref:t.publicHref,t.maskedLocation?t.maskedLocation.external:t.external,n.history,w),i=ge(r,l,n.protocolAllowlist);return[r?.href,i,_e(e,t,ue,n.basepath,I,i!==void 0)]},[ue,w,I,L,n,l]),[R,z,B]=c(n.stores.location,de,he),V=B?r(a,{})??ye:ve,H=B?ve:r(o,{})??ve,U=[E,V.className,H.className].filter(Boolean).join(` `),W=(T||V.style||H.style)&&{...T,...V.style,...H.style},G=f.useRef(!1),K=e.reloadDocument||z||w?!1:u??n.options.defaultPreload,q=p??n.options.defaultPreloadDelay??0,X=f.useCallback(()=>{n.preloadRoute(L).catch(e=>{console.warn(e),console.warn(fe)})},[n,L]),Z=f.useCallback(e=>{if(!e){Se(i);return}if(!(e.isIntersecting??K===`intent`)){e.isIntersecting===!1&&Se(i);return}if(!q){X();return}J.has(i)||J.set(i,setTimeout(()=>{J.delete(i),X()},q))},[X,i,K,q]);m(i,Z,K!==`viewport`),f.useEffect(()=>{G.current||K===`render`&&(X(),G.current=!0)},[X,K]);let we=e=>{let t=e.currentTarget.getAttribute(`target`),r=C===void 0?t:C;!w&&!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)&&!e.defaultPrevented&&(!r||r===`_self`)&&e.button===0&&(e.preventDefault(),n.navigate({...L,replace:v,resetScroll:b,hashScrollIntoView:_,startTransition:y,viewTransition:x,ignoreBlocker:ee}))};if(z)return{...se,ref:i,href:z,...S&&{children:S},...C&&{target:C},...w&&{disabled:w},...T&&{style:T},...E&&{className:E},...D&&{onClick:D},...O&&{onBlur:O},...k&&{onFocus:k},...A&&{onMouseEnter:A},...j&&{onMouseLeave:j},...M&&{onTouchStart:M}};let Te=()=>{K===`intent`&&X()},Q=()=>{K===`intent`&&Se(i)};return{...se,...V,...H,href:R,ref:i,onClick:Y([D,we]),onBlur:Y([O,Q]),onFocus:Y([k,Z]),onMouseEnter:Y([A,Z]),onMouseLeave:Y([j,Q]),onTouchStart:Y([M,Te]),disabled:!!w,target:C,...W&&{style:W},...U&&{className:U},...w&&be,...B&&xe}}var ve={},ye={className:`active`},be={role:`link`,"aria-disabled":!0},xe={"data-status":`active`,"aria-current":`page`},J=new WeakMap,Se=e=>{clearTimeout(J.get(e)),J.delete(e)},Y=e=>t=>{for(let n of e)if(n){if(t.defaultPrevented)return;n(t)}};function Ce(e,t,n,r){if(!r)return t?{href:e,external:!0}:{href:n.createHref(e)||`/`,external:!1}}function X(e){if(typeof e!=`string`)return!1;let t=e.charCodeAt(0);return t===47?e.charCodeAt(1)!==47:t===46}var Z=f.forwardRef((e,t)=>{let{_asChild:n,...r}=e,{type:i,...a}=q(r,t),o=typeof r.children==`function`?r.children({isActive:a[`data-status`]===`active`}):r.children;if(!n){let{disabled:e,...t}=a;return f.createElement(`a`,t,o)}return f.createElement(n,a,o)});function we(e){let t=d(),n=`not-found-${c(t.stores.location,e=>e.pathname)}-${c(t.stores.status,e=>e)}`;return(0,V.jsx)(H,{getResetKey:()=>n,onCatch:(t,n)=>{if(z(t))e.onCatch?.(t,n);else throw t},errorComponent:({error:t})=>{if(z(t))return e.fallback?.(t);throw t},children:e.children})}function Te(){return(0,V.jsx)(`p`,{children:`Not Found`})}function Q(e){return(0,V.jsx)(V.Fragment,{children:e.children})}function Ee(e,t,n){return t.options.notFoundComponent?(0,V.jsx)(t.options.notFoundComponent,{...n}):e.options.defaultNotFoundComponent?(0,V.jsx)(e.options.defaultNotFoundComponent,{...n}):(0,V.jsx)(Te,{})}function $(e,t){let n=t?.options.pendingComponent??e.options.defaultPendingComponent;return n?(0,V.jsx)(n,{}):null}var De=(e,t)=>e[0]===t[0]&&e[1]===t[1],Oe=(e,t,n)=>!t.isRoot||t.options.shellComponent||t.options.wrapInSuspense||n===!1||n===`data-only`||!e.ssr,ke=f.memo(function({routeId:e}){let t=d();return(0,V.jsx)(Ae,{router:t,match:c(t.stores.getMatchStore(e),e=>e)})});function Ae({router:e,match:t}){let n=e.routesById[t.routeId],r=$(e,n),i=n.options.errorComponent??e.options.defaultErrorComponent,a=n.options.onCatch??e.options.defaultOnCatch,o=n.isRoot?n.options.notFoundComponent??e.options.notFoundRoute?.options.component:n.options.notFoundComponent,c=t.ssr===!1||t.ssr===`data-only`,l=Oe(e,n,t.ssr)&&(n.options.wrapInSuspense??r??(n.options.errorComponent?.preload||c))?f.Suspense:Q,u=i?H:Q,d=o?we:Q;return(0,V.jsxs)(n.isRoot?n.options.shellComponent??Q:Q,{children:[(0,V.jsx)(s.Provider,{value:t.routeId,children:(0,V.jsx)(l,{fallback:r,children:(0,V.jsx)(u,{getResetKey:()=>t,errorComponent:i,onCatch:(e,n)=>{if(z(e))throw e.routeId??=t.routeId,e;a?.(e,n)},children:(0,V.jsx)(d,{fallback:e=>{if(e.routeId??=t.routeId,e.routeId!==t.routeId)throw e;return f.createElement(o,e)},children:c?(0,V.jsx)(G,{fallback:r,children:(0,V.jsx)(je,{match:t})}):(0,V.jsx)(je,{match:t})})})})}),null]})}var je=f.memo(function({match:e}){let t=d(),n=e.routeId,r=t.routesById[n],i=f.useMemo(()=>{let i=(r.options.remountDeps??t.options.defaultRemountDeps)?.({routeId:n,loaderDeps:e.loaderDeps,params:e._strictParams,search:e._strictSearch});return i?JSON.stringify(i):void 0},[n,e.loaderDeps,e._strictParams,e._strictSearch,r.options.remountDeps,t.options.defaultRemountDeps]),a=f.useMemo(()=>{let e=r.options.component??t.options.defaultComponent;return e?(0,V.jsx)(e,{},i):(0,V.jsx)(Me,{})},[i,r.options.component,t.options.defaultComponent]);if(e.status===`pending`){if(t.ssr&&!Oe(t,r,e.ssr))return a;if(t._tx)throw t._tx[5];return $(t,r)}if(e.status===`notFound`)return Ee(t,r,e.error);if(e.status===`error`)throw e.error;return a}),Me=f.memo(function(){let e=d(),t=f.useContext(s),n,r,i;{let a=e.stores.getMatchStore(t);[n,r]=c(a,e=>[!!e._notFound,e.error],De),i=c(e.stores.ids,e=>e[e.indexOf(t)+1])}if(n)return Ee(e,e.routesById[t],r);if(!i)return null;let a=(0,V.jsx)(ke,{routeId:i});return t===`__root__`?(0,V.jsx)(f.Suspense,{fallback:$(e),children:a}):a});function Ne(e){let t=d();return c(t.stores.location,l(e,t))}export{k as C,w as S,p as T,oe as _,Q as a,D as b,B as c,ue as d,de as f,ae as g,se as h,$ as i,z as l,le as m,ke as n,Z as o,ie as p,Me as r,H as s,Ne as t,F as u,M as v,g as w,E as x,T as y};
@@ -1 +0,0 @@
1
- import{t as e}from"./compiler-runtime-qmuS0Svy.js";import{h as t}from"./env-CBdFekj3.js";import{L as n,Rn as r}from"./runtime-BkRtSwRY.js";import{f as i}from"./utils-c6dglOTK.js";import{n as a}from"./useHandleNewThread-COAg-4eT.js";import{t as o}from"./useRouter-CcIDS3PN.js";import{i as s}from"./uiStateStore-hgy2ilHo.js";import{c,l}from"./WorkItemsTab-DYgsIthY.js";import{t as u}from"./button-BT6cGe5S.js";import{t as d}from"./useThreadActions-B9kmG6FU.js";import{g as f}from"./sidebar-H-CSxQVD.js";import{a as p,c as m,i as h,o as g,s as _,t as v}from"./dialog-BUIS3TXH.js";import{a as y,i as b,n as x,o as S,s as C,t as w}from"./MobileSheet-C8OrQzw0.js";var T=e(),E=i();function D(e){let t=(0,T.c)(22),{open:n,onOpenChange:r,title:i,items:a,onAction:o,leadingSections:s}=e,c;t[0]===i?c=t[1]:(c=(0,E.jsx)(S,{children:i}),t[0]=i,t[1]=c);let l;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,E.jsx)(x,{className:`sr-only`,children:`Thread actions`}),t[2]=l):l=t[2];let u;t[3]===c?u=t[4]:(u=(0,E.jsxs)(b,{children:[c,l]}),t[3]=c,t[4]=u);let d;if(t[5]!==a||t[6]!==o||t[7]!==r){let e;t[9]!==o||t[10]!==r?(e=e=>(0,E.jsx)(C,{label:e.label,destructive:e.destructive===!0,onClick:()=>{r(!1),o(e.id)}},e.id),t[9]=o,t[10]=r,t[11]=e):e=t[11],d=a.map(e),t[5]=a,t[6]=o,t[7]=r,t[8]=d}else d=t[8];let f;t[12]===d?f=t[13]:(f=(0,E.jsx)(`div`,{role:`group`,"aria-label":`Thread actions`,className:`space-y-0.5`,children:d}),t[12]=d,t[13]=f);let p;t[14]!==s||t[15]!==f?(p=(0,E.jsxs)(y,{children:[s,f]}),t[14]=s,t[15]=f,t[16]=p):p=t[16];let m;return t[17]!==r||t[18]!==n||t[19]!==u||t[20]!==p?(m=(0,E.jsxs)(w,{open:n,onOpenChange:r,label:`Thread actions`,children:[u,p]}),t[17]=r,t[18]=n,t[19]=u,t[20]=p,t[21]=m):m=t[21],m}function O(e){let n=(0,T.c)(32),{renamingThreadKey:r,originalTitle:i,renamingTitle:a,setRenamingTitle:o,commitRename:s,cancelRename:c}=e,l;n[0]===r?l=n[1]:(l=r?t(r):null,n[0]=r,n[1]=l);let d=l;if(!d)return null;let f;n[2]!==s||n[3]!==i||n[4]!==a||n[5]!==d?(f=()=>{s(d,a,i)},n[2]=s,n[3]=i,n[4]=a,n[5]=d,n[6]=f):f=n[6];let y=f,b;n[7]===c?b=n[8]:(b=e=>{e||c()},n[7]=c,n[8]=b);let x;n[9]===Symbol.for(`react.memo_cache_sentinel`)?(x=(0,E.jsx)(p,{children:(0,E.jsx)(m,{children:`Rename thread`})}),n[9]=x):x=n[9];let S;n[10]===Symbol.for(`react.memo_cache_sentinel`)?(S=(0,E.jsx)(`label`,{htmlFor:`phone-thread-rename-title`,className:`sr-only`,children:`Thread title`}),n[10]=S):S=n[10];let C;n[11]===o?C=n[12]:(C=e=>o(e.currentTarget.value),n[11]=o,n[12]=C);let w;n[13]===y?w=n[14]:(w=e=>{e.key===`Enter`&&(e.preventDefault(),y())},n[13]=y,n[14]=w);let D;n[15]!==a||n[16]!==C||n[17]!==w?(D=(0,E.jsxs)(g,{children:[S,(0,E.jsx)(`input`,{id:`phone-thread-rename-title`,autoFocus:!0,value:a,maxLength:500,onChange:C,onKeyDown:w,className:`h-11 w-full rounded-lg border border-input bg-background px-3 text-base outline-none focus-visible:ring-2 focus-visible:ring-ring`})]}),n[15]=a,n[16]=C,n[17]=w,n[18]=D):D=n[18];let O;n[19]===c?O=n[20]:(O=(0,E.jsx)(u,{variant:`outline`,className:`phone:min-h-11`,onClick:c,children:`Cancel`}),n[19]=c,n[20]=O);let k;n[21]===y?k=n[22]:(k=(0,E.jsx)(u,{className:`phone:min-h-11`,onClick:y,children:`Rename`}),n[21]=y,n[22]=k);let A;n[23]!==k||n[24]!==O?(A=(0,E.jsxs)(h,{children:[O,k]}),n[23]=k,n[24]=O,n[25]=A):A=n[25];let j;n[26]!==A||n[27]!==D?(j=(0,E.jsxs)(_,{children:[x,D,A]}),n[26]=A,n[27]=D,n[28]=j):j=n[28];let M;return n[29]!==j||n[30]!==b?(M=(0,E.jsx)(v,{open:!0,onOpenChange:b,children:j}),n[29]=j,n[30]=b,n[31]=M):M=n[31],M}function k(e){let t=(0,T.c)(22),i=o(),{isMobile:u,setOpenMobile:p}=f(),m=r(z),h=r(R),g=r(L),{archiveThread:_,deleteThread:v}=d(),{handleNewThread:y}=a(),b=s(I),x=n(F),S=n(P),C=n(N),w=n(M),E=n(j),D=n(A),{copyThreadIdToClipboard:O,copyPathToClipboard:k}=l(),B;return t[0]!==h||t[1]!==m||t[2]!==_||t[3]!==C||t[4]!==k||t[5]!==O||t[6]!==g||t[7]!==v||t[8]!==y||t[9]!==u||t[10]!==b||t[11]!==e.memberProjectByScopedKey||t[12]!==e.projectCwd||t[13]!==e.sidebarThreadByKeyRef||t[14]!==S||t[15]!==w||t[16]!==i||t[17]!==D||t[18]!==p||t[19]!==E||t[20]!==x?(B={router:i,isMobile:u,setOpenMobile:p,clearSelection:C,setSelectionAnchor:E,toggleThreadSelection:x,rangeSelectTo:S,removeFromSelection:w,selectedThreadCount:D,appSettingsConfirmThreadDelete:m,appSettingsConfirmThreadArchive:h,defaultThreadEnvMode:g,deleteThread:v,archiveThread:_,handleNewThread:y,markThreadUnread:b,copyPathToClipboard:k,copyThreadIdToClipboard:O,sidebarThreadByKeyRef:e.sidebarThreadByKeyRef,memberProjectByScopedKey:e.memberProjectByScopedKey,projectCwd:e.projectCwd},t[0]=h,t[1]=m,t[2]=_,t[3]=C,t[4]=k,t[5]=O,t[6]=g,t[7]=v,t[8]=y,t[9]=u,t[10]=b,t[11]=e.memberProjectByScopedKey,t[12]=e.projectCwd,t[13]=e.sidebarThreadByKeyRef,t[14]=S,t[15]=w,t[16]=i,t[17]=D,t[18]=p,t[19]=E,t[20]=x,t[21]=B):B=t[21],c(B)}function A(e){return e.selectedThreadKeys.size}function j(e){return e.setAnchor}function M(e){return e.removeFromSelection}function N(e){return e.clearSelection}function P(e){return e.rangeSelectTo}function F(e){return e.toggleThread}function I(e){return e.markThreadUnread}function L(e){return e.defaultThreadEnvMode}function R(e){return e.confirmThreadArchive}function z(e){return e.confirmThreadDelete}export{D as n,O as r,k as t};
@@ -1 +0,0 @@
1
- import{i as e,n as t,t as n}from"./react-SIfiwpqq.js";import{f as r}from"./utils-c6dglOTK.js";import{a as i,c as a,d as o,o as s,s as c,t as l,u}from"./useRenderElement-DchFnsR8.js";import{t as d}from"./react-dom-x9LNwWQc.js";var f=t((e=>{var t=n();function r(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var i=typeof Object.is==`function`?Object.is:r,a=t.useState,o=t.useEffect,s=t.useLayoutEffect,c=t.useDebugValue;function l(e,t){var n=t(),r=a({inst:{value:n,getSnapshot:t}}),i=r[0].inst,l=r[1];return s(function(){i.value=n,i.getSnapshot=t,u(i)&&l({inst:i})},[e,n,t]),o(function(){return u(i)&&l({inst:i}),e(function(){u(i)&&l({inst:i})})},[e]),c(n),n}function u(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!i(e,n)}catch{return!0}}function d(e,t){return t()}var f=typeof window>`u`||window.document===void 0||window.document.createElement===void 0?d:l;e.useSyncExternalStore=t.useSyncExternalStore===void 0?f:t.useSyncExternalStore})),p=t(((e,t)=>{t.exports=f()})),m=t((e=>{var t=n(),r=p();function i(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var a=typeof Object.is==`function`?Object.is:i,o=r.useSyncExternalStore,s=t.useRef,c=t.useEffect,l=t.useMemo,u=t.useDebugValue;e.useSyncExternalStoreWithSelector=function(e,t,n,r,i){var d=s(null);if(d.current===null){var f={hasValue:!1,value:null};d.current=f}else f=d.current;d=l(function(){function e(e){if(!o){if(o=!0,s=e,e=r(e),i!==void 0&&f.hasValue){var t=f.value;if(i(t,e))return c=t}return c=e}if(t=c,a(s,e))return t;var n=r(e);return i!==void 0&&i(t,n)?(s=e,t):(s=e,c=n)}var o=!1,s,c,l=n===void 0?null:n;return[function(){return e(t())},l===null?void 0:function(){return e(l())}]},[t,n,r,i]);var p=o(e,d[0],d[1]);return c(function(){f.hasValue=!0,f.value=p},[p]),u(p),p}})),h=t(((e,t)=>{t.exports=m()})),g=e(n(),1),_=r(),v=p(),y=h(),b=function(e){return e.startingStyle=`data-starting-style`,e.endingStyle=`data-ending-style`,e}({}),x={"data-starting-style":``},S={"data-ending-style":``},C={transitionStatus(e){return e===`starting`?x:e===`ending`?S:null}},w=function(e){return e.open=`data-open`,e.closed=`data-closed`,e[e.startingStyle=b.startingStyle]=`startingStyle`,e[e.endingStyle=b.endingStyle]=`endingStyle`,e.anchorHidden=`data-anchor-hidden`,e.side=`data-side`,e.align=`data-align`,e}({}),T={"data-popup-open":``},E={"data-popup-open":``,"data-pressed":``},D={"data-open":``},O={"data-closed":``},k={"data-anchor-hidden":``},A={open(e){return e?T:null}},j={open(e){return e?E:null}},M={open(e){return e?D:O},anchorHidden(e){return e?k:null}},N={...M,...C};function P(){return typeof window<`u`}function F(e){return R(e)?(e.nodeName||``).toLowerCase():`#document`}function I(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function L(e){return((R(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function R(e){return P()?e instanceof Node||e instanceof I(e).Node:!1}function z(e){return P()?e instanceof Element||e instanceof I(e).Element:!1}function B(e){return P()?e instanceof HTMLElement||e instanceof I(e).HTMLElement:!1}function ee(e){return!P()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof I(e).ShadowRoot}function te(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=H(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function ne(e){return/^(table|td|th)$/.test(F(e))}function re(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var ie=/transform|translate|scale|rotate|perspective|filter/,V=/paint|layout|strict|content/,ae=e=>!!e&&e!==`none`,oe;function se(e){let t=z(e)?H(e):e;return ae(t.transform)||ae(t.translate)||ae(t.scale)||ae(t.rotate)||ae(t.perspective)||!le()&&(ae(t.backdropFilter)||ae(t.filter))||ie.test(t.willChange||``)||V.test(t.contain||``)}function ce(e){let t=fe(e);for(;B(t)&&!ue(t);){if(se(t))return t;if(re(t))return null;t=fe(t)}return null}function le(){return oe??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),oe}function ue(e){return/^(html|body|#document)$/.test(F(e))}function H(e){return I(e).getComputedStyle(e)}function de(e){return z(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function fe(e){if(F(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||ee(e)&&e.host||L(e);return ee(t)?t.host:t}function pe(e){let t=fe(e);return ue(t)?(e.ownerDocument||e).body:B(t)&&te(t)?t:pe(t)}function U(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=pe(e),i=r===e.ownerDocument?.body,a=I(r);if(i){let e=me(a);return t.concat(a,a.visualViewport||[],te(r)?r:[],e&&n?U(e):[])}return t.concat(r,U(r,[],n))}function me(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}var he={...g},ge=he.useInsertionEffect,_e=ge&&ge!==he.useLayoutEffect?ge:e=>e();function W(e){let t=u(ve).current;return t.next=e,_e(t.effect),t.trampoline}function ve(){let e={next:void 0,callback:ye,trampoline:(...t)=>e.callback?.(...t),effect:()=>{e.callback=e.next}};return e}function ye(){}var G=typeof document<`u`?g.useLayoutEffect:()=>{};function K(e){return e?.ownerDocument||document}var be=`none`,xe=`trigger-press`,q=`trigger-hover`,Se=`trigger-focus`,Ce=`outside-press`,we=`item-press`,Te=`close-press`,Ee=`clear-press`,De=`input-change`,Oe=`input-clear`,ke=`input-press`,Ae=`focus-out`,je=`escape-key`,Me=`close-watcher`,Ne=`list-navigation`,Pe=`keyboard`,Fe=`pointer`,Ie=`cancel-open`,Le=`sibling-open`,Re=`disabled`,ze=`imperative-action`,Be=`swipe`,Ve=`window-resize`;function J(e,t,n,r){let i=!1,a=!1,o=r??s;return{reason:e,event:t??new Event(`base-ui`),cancel(){i=!0},allowPropagation(){a=!0},get isCanceled(){return i},get isPropagationAllowed(){return a},trigger:n,...o}}function He(e,t,n){let r=n??s;return{reason:e,event:t??new Event(`base-ui`),...r}}var Ue=0;function We(e,t=`mui`){let[n,r]=g.useState(e),i=e||n;return g.useEffect(()=>{n??(Ue+=1,r(`${t}-${Ue}`))},[n,t]),i}var Ge=he.useId;function Ke(e,t){if(Ge!==void 0){let n=Ge();return e??(t?`${t}-${n}`:n)}return We(e,t)}function qe(e){return Ke(e,`base-ui`)}function Je(e){g.useEffect(e,i)}var Ye=0,Xe=class e{static create(){return new e}currentId=Ye;start(e,t){this.clear(),this.currentId=setTimeout(()=>{this.currentId=Ye,t()},e)}isStarted(){return this.currentId!==Ye}clear=()=>{this.currentId!==Ye&&(clearTimeout(this.currentId),this.currentId=Ye)};disposeEffect=()=>this.clear};function Ze(){let e=u(Xe.create).current;return Je(e.disposeEffect),e}function Qe(){return typeof navigator>`u`?{userAgent:``,platform:``,maxTouchPoints:0}:{userAgent:navigator.userAgent,platform:navigator.platform??``,maxTouchPoints:navigator.maxTouchPoints??0}}var{userAgent:$e,platform:et,maxTouchPoints:tt}=Qe(),nt=$e.toLowerCase(),rt=et.toLowerCase(),it=/^i(os$|p)/.test(rt)||rt===`macintel`&&tt>1,at=`android`,ot=rt===at||nt.includes(at),st=!it&&rt.startsWith(`mac`);rt.startsWith(`win`),!ot&&/^(linux|chrome os)/.test(rt);var ct=st||it,lt=typeof CSS<`u`&&!!CSS.supports?.(`-webkit-backdrop-filter:none`),ut=!lt&&nt.includes(`firefox`);!lt&&nt.includes(`chrom`);var dt=ct,ft=/jsdom|happydom/.test(nt);function pt(e){e.preventDefault(),e.stopPropagation()}function mt(e){return`nativeEvent`in e}function ht(e){return e.pointerType===``&&e.isTrusted?!0:ot&&e.pointerType?e.type===`click`&&e.buttons===1:e.detail===0&&!e.pointerType}function gt(e){return ft?!1:!ot&&e.width===0&&e.height===0||ot&&e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType===`mouse`||e.width<1&&e.height<1&&e.pressure===0&&e.detail===0&&e.pointerType===`touch`}function _t(e,t){let n=[`mouse`,`pen`];return t||n.push(``,void 0),n.includes(e)}function vt(e){let t=e.type;return t===`click`||t===`mousedown`||t===`keydown`||t===`keyup`}var yt=`data-base-ui-focusable`,bt=`input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])`,xt=`ArrowLeft`,St=`ArrowRight`,Ct=`ArrowUp`,wt=`ArrowDown`;function Tt(e){let t=e.activeElement;for(;t?.shadowRoot?.activeElement!=null;)t=t.shadowRoot.activeElement;return t}function Y(e,t){if(!e||!t)return!1;let n=t.getRootNode?.();if(e.contains(t))return!0;if(n&&ee(n)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}function Et(e){return`composedPath`in e?e.composedPath()[0]:e.target}function Dt(e,t){if(!z(e))return!1;let n=e;if(t.hasElement(n))return!n.hasAttribute(`data-trigger-disabled`);for(let[,e]of t.entries())if(Y(e,n))return!e.hasAttribute(`data-trigger-disabled`);return!1}function Ot(e,t){if(t==null)return!1;if(`composedPath`in e)return e.composedPath().includes(t);let n=e;return n.target!=null&&t.contains(n.target)}function kt(e){return e.matches(`html,body`)}function At(e){return B(e)&&e.matches(`input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])`)}function jt(e){return e?.closest(`button,a[href],[role="button"],select,[tabindex]:not([tabindex="-1"]),${bt}`)!=null}function Mt(e){return e?e.getAttribute(`role`)===`combobox`&&At(e):!1}function Nt(e){if(!e||ft)return!0;try{return e.matches(`:focus-visible`)}catch{return!0}}function Pt(e){return e?e.hasAttribute(`data-base-ui-focusable`)?e:e.querySelector(`[data-base-ui-focusable]`)||e:null}function Ft(e,t){return t!=null&&!_t(t)?0:typeof e==`function`?e():e}function It(e,t,n){let r=Ft(e,n);return typeof r==`number`?r:r?.[t]}function Lt(e){return typeof e==`function`?e():e}function Rt(e,t){return t||e===`click`||e===`mousedown`}function zt(e){return e?.includes(`mouse`)&&e!==`mousedown`}function X(e,t,n,r){return e.addEventListener(t,n,r),()=>{e.removeEventListener(t,n,r)}}function Bt(...e){return()=>{for(let t=0;t<e.length;t+=1){let n=e[t];n&&n()}}}function Vt(e){let t=u(Ht,e).current;return t.next=e,G(t.effect),t}function Ht(e){let t={current:e,next:e,effect:()=>{t.current=t.next}};return t}var Ut=null;globalThis.requestAnimationFrame;var Wt=new class{callbacks=[];callbacksCount=0;nextId=1;startId=1;isScheduled=!1;tick=e=>{this.isScheduled=!1;let t=this.callbacks,n=this.callbacksCount;if(this.callbacks=[],this.callbacksCount=0,this.startId=this.nextId,n>0)for(let n=0;n<t.length;n+=1)t[n]?.(e)};request(e){let t=this.nextId;return this.nextId+=1,this.callbacks.push(e),this.callbacksCount+=1,this.isScheduled||=(requestAnimationFrame(this.tick),!0),t}cancel(e){let t=e-this.startId;t<0||t>=this.callbacks.length||(this.callbacks[t]=null,--this.callbacksCount)}},Gt=class e{static create(){return new e}static request(e){return Wt.request(e)}static cancel(e){return Wt.cancel(e)}currentId=Ut;request(e){this.cancel(),this.currentId=Wt.request(()=>{this.currentId=Ut,e()})}cancel=()=>{this.currentId!==Ut&&(Wt.cancel(this.currentId),this.currentId=Ut)};disposeEffect=()=>this.cancel};function Kt(){let e=u(Gt.create).current;return Je(e.disposeEffect),e}var qt={clipPath:`inset(50%)`,overflow:`hidden`,whiteSpace:`nowrap`,border:0,padding:0,width:1,height:1,margin:-1},Jt={...qt,position:`fixed`,top:0,left:0},Yt={...qt,position:`absolute`},Xt=g.forwardRef(function(e,t){let[n,r]=g.useState();G(()=>{dt&&lt&&r(`button`)},[]);let i={tabIndex:0,role:n};return(0,_.jsx)(`span`,{...e,ref:t,style:Jt,"aria-hidden":!n||void 0,...i,"data-base-ui-focus-guard":``})}),Zt=Math.min,Qt=Math.max,$t=Math.round,en=Math.floor,tn=e=>({x:e,y:e}),nn={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function rn(e,t,n){return Qt(e,Zt(t,n))}function an(e,t){return typeof e==`function`?e(t):e}function Z(e){return e.split(`-`)[0]}function on(e){return e.split(`-`)[1]}function sn(e){return e===`x`?`y`:`x`}function cn(e){return e===`y`?`height`:`width`}function Q(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function ln(e){return sn(Q(e))}function un(e,t,n){n===void 0&&(n=!1);let r=on(e),i=ln(e),a=cn(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=yn(o)),[o,yn(o)]}function dn(e){let t=yn(e);return[fn(e),t,fn(t)]}function fn(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var pn=[`left`,`right`],mn=[`right`,`left`],hn=[`top`,`bottom`],gn=[`bottom`,`top`];function _n(e,t,n){switch(e){case`top`:case`bottom`:return n?t?mn:pn:t?pn:mn;case`left`:case`right`:return t?hn:gn;default:return[]}}function vn(e,t,n,r){let i=on(e),a=_n(Z(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(fn)))),a}function yn(e){let t=Z(e);return nn[t]+e.slice(t.length)}function bn(e){return{top:e.top??0,right:e.right??0,bottom:e.bottom??0,left:e.left??0}}function xn(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:bn(e)}function Sn(e){let{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function Cn(e,t,n){return Math.floor(e/t)!==n}function wn(e,t){return t<0||t>=e.length}function Tn(e,t){return Dn(e.current,{disabledIndices:t})}function En(e,t){return Dn(e.current,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}function Dn(e,{startingIndex:t=-1,decrement:n=!1,disabledIndices:r,amount:i=1}={}){let a=t;do a+=n?-i:i;while(a>=0&&a<=e.length-1&&kn(e,a,r));return a}function On(e,{event:t,orientation:n,loopFocus:r,onLoop:i,rtl:a,cols:o,disabledIndices:s,minIndex:c,maxIndex:l,prevIndex:u,stopEvent:d=!1}){let f=u,p;if(t.key===`ArrowUp`?p=`up`:t.key===`ArrowDown`&&(p=`down`),p){let n=[],a=[],m=!1,h=0;{let t=null,r=-1;e.forEach((e,i)=>{if(e==null)return;h+=1;let o=e.closest(`[role="row"]`);o&&(m=!0),(o!==t||r===-1)&&(t=o,r+=1,n[r]=[]),n[r].push(i),a[i]=r})}let g=!1,_=0;if(m)for(let e of n){let t=e.length;t>_&&(_=t),t!==o&&(g=!0)}let v=g&&h<e.length,y=_||o,b=o=>{if(!g||u===-1)return;let c=a[u];if(c==null)return;let l=n[c].indexOf(u),d=o===`up`?-1:1;for(let o=c+d,f=0;f<n.length;f+=1,o+=d){if(o<0||o>=n.length){if(!r||v)return;if(o=o<0?n.length-1:0,i){let e=Math.min(l,n[o].length-1),r=i(t,u,n[o][e]??n[o][0]);o=a[r]??o}}let c=n[o];for(let t=Math.min(l,c.length-1);t>=0;--t){let n=c[t];if(!kn(e,n,s))return n}}},x=t=>{if(!v||u===-1)return;let n=u%y,i=t===`up`?-y:y,a=l-l%y,o=en(l/y)+1;for(let t=u-n+i,c=0;c<o;c+=1,t+=i){if(t<0||t>l){if(!r)return;t=t<0?a:0}let i=Math.min(t+y-1,l);for(let r=Math.min(t+n,i);r>=t;--r)if(!kn(e,r,s))return r}};d&&pt(t);let S=b(p)??x(p);if(S!==void 0)f=S;else if(u===-1)f=p===`up`?l:c;else if(f=Dn(e,{startingIndex:u,amount:y,decrement:p===`up`,disabledIndices:s}),r){if(p===`up`&&(u-y<c||f<0)){let e=u%y,n=l%y,r=l-(n-e);f=n===e?l:n>e?r:r-y,i&&(f=i(t,u,f))}p===`down`&&u+y>l&&(f=Dn(e,{startingIndex:u%y-y,amount:y,disabledIndices:s}),i&&(f=i(t,u,f)))}wn(e,f)&&(f=u)}if(n===`both`){let n=en(u/o);t.key===(a?`ArrowLeft`:`ArrowRight`)&&(d&&pt(t),u%o===o-1?r&&(f=Dn(e,{startingIndex:u-u%o-1,disabledIndices:s}),i&&(f=i(t,u,f))):(f=Dn(e,{startingIndex:u,disabledIndices:s}),r&&Cn(f,o,n)&&(f=Dn(e,{startingIndex:u-u%o-1,disabledIndices:s}),i&&(f=i(t,u,f)))),Cn(f,o,n)&&(f=u)),t.key===(a?`ArrowRight`:`ArrowLeft`)&&(d&&pt(t),u%o===0?r&&(f=Dn(e,{startingIndex:u+(o-u%o),decrement:!0,disabledIndices:s}),i&&(f=i(t,u,f))):(f=Dn(e,{startingIndex:u,decrement:!0,disabledIndices:s}),r&&Cn(f,o,n)&&(f=Dn(e,{startingIndex:u+(o-u%o),decrement:!0,disabledIndices:s}),i&&(f=i(t,u,f)))),Cn(f,o,n)&&(f=u));let c=en(l/o)===n;wn(e,f)&&(r&&c?(f=t.key===(a?`ArrowRight`:`ArrowLeft`)?l:Dn(e,{startingIndex:u-u%o-1,disabledIndices:s}),i&&(f=i(t,u,f))):f=u)}return f}function kn(e,t,n){if(typeof n==`function`?n(t):n?.includes(t)??!1)return!0;let r=e[t];return r?!jn(r)||r.matches(`:disabled`)?!0:!n&&(r.hasAttribute(`disabled`)||r.getAttribute(`aria-disabled`)===`true`):!1}function An(e){return e.visibility===`hidden`||e.visibility===`collapse`}function jn(e,t=e?H(e):null){return!e||!e.isConnected||!t||An(t)?!1:typeof e.checkVisibility==`function`?e.checkVisibility():t.display!==`none`&&t.display!==`contents`}var Mn=`a[href],button,input,select,textarea,summary,details,iframe,object,embed,[tabindex],[contenteditable]:not([contenteditable="false"]),audio[controls],video[controls]`;function Nn(e){let t=e.assignedSlot;if(t)return t;if(e.parentElement)return e.parentElement;let n=e.getRootNode();return ee(n)?n.host:null}function Pn(e){for(let t of Array.from(e.children))if(F(t)===`summary`)return t;return null}function Fn(e,t){let n=Pn(t);return!!n&&(e===n||Y(n,e))}function In(e){let t=e?F(e):``;return e!=null&&e.matches(Mn)&&(t!==`summary`||e.parentElement!=null&&F(e.parentElement)===`details`&&Pn(e.parentElement)===e)&&(t!==`details`||Pn(e)==null)&&(t!==`input`||e.type!==`hidden`)}function Ln(e){if(!In(e)||!e.isConnected||e.matches(`:disabled`))return!1;for(let t=e;t;t=Nn(t)){let n=t!==e,r=F(t)===`slot`;if(t.hasAttribute(`inert`)||n&&F(t)===`details`&&!t.open&&!Fn(e,t)||t.hasAttribute(`hidden`)||!r&&!Rn(t,n))return!1}return!0}function Rn(e,t){let n=H(e);return t?n.display!==`none`:jn(e,n)}function zn(e){let t=e.tabIndex;if(t<0){let t=F(e);if(t===`details`||t===`audio`||t===`video`||B(e)&&e.isContentEditable)return 0}return t}function Bn(e){if(F(e)!==`input`)return null;let t=e;return t.type===`radio`&&t.name!==``?t:null}function Vn(e,t){let n=Bn(e);if(!n)return!0;let r=t.find(e=>{let t=Bn(e);return t?.name===n.name&&t.form===n.form&&t.checked});return r?r===n:t.find(e=>{let t=Bn(e);return t?.name===n.name&&t.form===n.form})===n}function Hn(e){if(B(e)&&F(e)===`slot`){let t=e.assignedElements({flatten:!0});if(t.length>0)return t}return B(e)&&e.shadowRoot?Array.from(e.shadowRoot.children):Array.from(e.children)}function Un(e,t){Hn(e).forEach(e=>{In(e)&&t.push(e),Un(e,t)})}function Wn(e,t,n){Hn(e).forEach(e=>{B(e)&&e.matches(t)&&n.push(e),Wn(e,t,n)})}function Gn(e){return Ln(e)&&zn(e)>=0}function Kn(e){let t=[];return Un(e,t),t.filter(Ln)}function qn(e){let t=Kn(e);return t.filter(e=>zn(e)>=0&&Vn(e,t))}function Jn(e,t){let n=qn(e),r=n.length;if(r===0)return;let i=Tt(K(e)),a=n.indexOf(i);return n[a===-1?t===1?0:r-1:a+t]}function Yn(e){return Jn(K(e).body,1)||e}function Xn(e){return Jn(K(e).body,-1)||e}function Zn(e,t){if(!e)return null;let n=qn(K(e).body),r=n.length;if(r===0)return null;let i=n.indexOf(e);return i===-1?null:n[(i+t+r)%r]}function Qn(e){return Zn(e,1)}function $n(e){return Zn(e,-1)}function er(e,t){let n=t||e.currentTarget,r=e.relatedTarget;return!r||!Y(n,r)}function tr(e){qn(e).forEach(e=>{e.dataset.tabindex=e.getAttribute(`tabindex`)||``,e.setAttribute(`tabindex`,`-1`)})}function nr(e){let t=[];Wn(e,`[data-tabindex]`,t),t.forEach(e=>{let t=e.dataset.tabindex;delete e.dataset.tabindex,t?e.setAttribute(`tabindex`,t):e.removeAttribute(`tabindex`)})}function rr(e,t,n=!0){return e.filter(e=>e.parentId===t).flatMap(t=>[...!n||t.context?.open?[t]:[],...rr(e,t.id,n)])}function ir(e,t){let n=[],r=e.find(e=>e.id===t)?.parentId;for(;r;){let t=e.find(e=>e.id===r);r=t?.parentId,t&&(n=n.concat(t))}return n}function ar(e){return`data-base-ui-${e}`}var or=e(d(),1),sr={style:{transition:`none`}},cr=`data-base-ui-click-trigger`,lr=`data-base-ui-swipe-ignore`,ur=`data-swipe-ignore`,dr=`[${lr}]`,fr=`[${ur}]`,pr={fallbackAxisSide:`none`},mr={fallbackAxisSide:`end`},hr={clipPath:`inset(50%)`,position:`fixed`,top:0,left:0},gr=g.createContext(null),_r=()=>g.useContext(gr),vr=ar(`portal`);function yr(e={}){let{ref:t,container:n,componentProps:r=s,elementProps:i}=e,a=Ke(),o=_r()?.portalNode,[c,u]=g.useState(null),[d,f]=g.useState(null),p=W(e=>{e!==null&&f(e)}),m=g.useRef(null);G(()=>{if(n===null){m.current&&(m.current=null,f(null),u(null));return}let e=(n&&(R(n)?n:n.current))??o??document.body;if(e==null){m.current&&(m.current=null,f(null),u(null));return}m.current!==e&&(m.current=e,f(null),u(e))},[n,o]);let h=l(`div`,r,{ref:[t,p],props:[{id:a,[vr]:``},i]}),_=c&&h?or.createPortal(h,c):null;return{node:d,nodeId:g.isValidElement(h)?h.props.id:void 0,subtree:_}}var br=g.forwardRef(function(e,t){let{render:n,className:r,style:i,children:a,container:o,...s}=e,{node:c,nodeId:l,subtree:u}=yr({container:o,ref:t,componentProps:e,elementProps:s}),d=g.useRef(null),f=g.useRef(null),p=g.useRef(null),m=g.useRef(null),[h,v]=g.useState(null),y=g.useRef(!1),b=h?.modal,x=h?.open,S=!!h&&!h.modal&&h.open&&!!c;g.useEffect(()=>{if(!c||b)return;function e(e){c&&e.relatedTarget&&er(e)&&(e.type===`focusin`?y.current&&=(nr(c),!1):(tr(c),y.current=!0))}return Bt(X(c,`focusin`,e,!0),X(c,`focusout`,e,!0))},[c,b]),G(()=>{!c||x!==!0||!y.current||(nr(c),y.current=!1)},[x,c]);let C=g.useMemo(()=>({beforeOutsideRef:d,afterOutsideRef:f,beforeInsideRef:p,afterInsideRef:m,portalNode:c,setFocusManagerState:v}),[c]);return(0,_.jsxs)(g.Fragment,{children:[u,(0,_.jsxs)(gr.Provider,{value:C,children:[S&&c&&(0,_.jsx)(Xt,{"data-type":`outside`,ref:d,onFocus:e=>{er(e,c)?p.current?.focus():Xn(h?h.domReference:null)?.focus()}}),S&&c&&(0,_.jsx)(`span`,{"aria-owns":l,style:hr}),c&&or.createPortal(a,c),S&&c&&(0,_.jsx)(Xt,{"data-type":`outside`,ref:f,onFocus:e=>{er(e,c)?m.current?.focus():(Yn(h?h.domReference:null)?.focus(),h?.closeOnFocusOut&&h?.onOpenChange(!1,J(`focus-out`,e.nativeEvent)))}})]})]})});function xr(){let e=new Map;return{emit(t,n){e.get(t)?.forEach(e=>e(n))},on(t,n){e.has(t)||e.set(t,new Set),e.get(t).add(n)},off(t,n){e.get(t)?.delete(n)}}}var Sr=class{nodesRef={current:[]};events=xr();addNode(e){this.nodesRef.current.push(e)}removeNode(e){let t=this.nodesRef.current.findIndex(t=>t===e);t!==-1&&this.nodesRef.current.splice(t,1)}},Cr=g.createContext(null),wr=g.createContext(null),Tr=()=>g.useContext(Cr)?.id||null,Er=e=>{let t=g.useContext(wr);return e??t};function Dr(e){let t=Ke(),n=Er(e),r=Tr();return G(()=>{if(!t)return;let e={id:t,parentId:r};return n?.addNode(e),()=>{n?.removeNode(e)}},[n,t,r]),t}function Or(e){let{children:t,id:n}=e,r=Tr();return(0,_.jsx)(Cr.Provider,{value:g.useMemo(()=>({id:n,parentId:r}),[n,r]),children:t})}function kr(e){let{children:t,externalTree:n}=e,r=u(()=>n??new Sr).current;return(0,_.jsx)(wr.Provider,{value:r,children:t})}function Ar(e){return e==null?e:`current`in e?e.current:e}function jr(){return!1}function Mr(e){return{escapeKey:typeof e==`boolean`?e:e?.escapeKey??!1,outsidePress:typeof e==`boolean`?e:e?.outsidePress??!0}}function Nr(e,t={}){let{enabled:n=!0,escapeKey:r=!0,outsidePress:i=!0,outsidePressEvent:a=`sloppy`,referencePress:o=jr,bubbles:s,externalTree:c}=t,l=`rootStore`in e?e.rootStore:e,u=l.useState(`open`),d=l.useState(`floatingElement`),{dataRef:f}=l.context,p=Er(c),m=W(typeof i==`function`?i:()=>!1),h=typeof i==`function`?m:i,_=h!==!1,v=W(()=>a),{escapeKey:y,outsidePress:b}=Mr(s),x=g.useRef(!1),S=g.useRef(!1),C=g.useRef(!1),w=g.useRef(!1),T=g.useRef(``),E=g.useRef(null),D=Ze(),O=Ze(),k=W(()=>{O.clear(),f.current.insideReactTree=!1}),A=W(e=>{let t=f.current.floatingContext?.nodeId;return(p?rr(p.nodesRef.current,t):[]).some(t=>t.context?.open&&!t.context.dataRef.current[e])}),j=W(e=>Ot(e,l.select(`floatingElement`))||Ot(e,l.select(`domReferenceElement`))),M=W(e=>{o()&&l.setOpen(!1,J(xe,e.nativeEvent))}),N=W(e=>{if(!u||!n||!r||e.key!==`Escape`||w.current||!y&&A(`__escapeKeyBubbles`))return;let t=J(je,mt(e)?e.nativeEvent:e);l.setOpen(!1,t),t.isCanceled||e.preventDefault(),!y&&!t.isPropagationAllowed&&e.stopPropagation()}),P=W(()=>{f.current.insideReactTree=!0,O.start(0,k)}),F=W(e=>{if(!u||!n||e.button!==0)return;let t=Et(e.nativeEvent);Y(l.select(`floatingElement`),t)&&(x.current||(x.current=!0,S.current=!1))}),I=W(e=>{!u||!n||(e.defaultPrevented||e.nativeEvent.defaultPrevented)&&x.current&&(S.current=!0)});g.useEffect(()=>{if(!u||!n)return k;f.current.__escapeKeyBubbles=y,f.current.__outsidePressBubbles=b;let e=new Xe,t=new Xe;function i(){e.clear(),w.current=!0}function a(){e.start(lt?5:0,()=>{w.current=!1})}function o(){C.current=!0,t.start(0,()=>{C.current=!1})}function s(){x.current=!1,S.current=!1}function c(){let e=T.current,t=e===`pen`||!e?`mouse`:e,n=v(),r=typeof n==`function`?n():n;return typeof r==`string`?r:r[t]}function m(e){let t=c();return t===`intentional`&&e.type!==`click`||t===`sloppy`&&e.type===`click`}function g(e){let t=f.current.floatingContext?.nodeId,n=p&&rr(p.nodesRef.current,t).some(t=>Ot(e,t.context?.elements.floating));return j(e)||n}function O(e){if(m(e)){e.type!==`click`&&!j(e)&&(t.clear(),C.current=!1),k();return}if(f.current.insideReactTree){k();return}let n=Et(e),r=`[${ar(`inert`)}]`,i=z(n)?n.getRootNode():null,a=Array.from((ee(i)?i:K(l.select(`floatingElement`))).querySelectorAll(r)),o=l.context.triggerElements;if(n&&(o.hasElement(n)||o.hasMatchingElement(e=>Y(e,n))))return;let s=z(n)?n:null;for(;s&&!ue(s);){let e=fe(s);if(ue(e)||!z(e))break;s=e}if(!(a.length&&z(n)&&!kt(n)&&!Y(n,l.select(`floatingElement`))&&a.every(e=>!Y(s,e)))){if(B(n)&&!(`touches`in e)){let t=ue(n),r=H(n),i=/auto|scroll/,a=t||i.test(r.overflowX),o=t||i.test(r.overflowY),s=a&&n.clientWidth>0&&n.scrollWidth>n.clientWidth,c=o&&n.clientHeight>0&&n.scrollHeight>n.clientHeight,l=r.direction===`rtl`,u=c&&(l?e.offsetX<=n.offsetWidth-n.clientWidth:e.offsetX>n.clientWidth),d=s&&e.offsetY>n.clientHeight;if(u||d)return}if(!g(e)){if(c()===`intentional`&&C.current){t.clear(),C.current=!1;return}typeof h==`function`&&!h(e)||A(`__outsidePressBubbles`)||(l.setOpen(!1,J(Ce,e)),k())}}}function M(e){c()!==`sloppy`||e.pointerType===`touch`||!l.select(`open`)||!n||j(e)||O(e)}function P(e){if(c()!==`sloppy`||!l.select(`open`)||!n||j(e))return;let t=e.touches[0];t&&(E.current={startTime:Date.now(),startX:t.clientX,startY:t.clientY,dismissOnTouchEnd:!1,dismissOnMouseDown:!0},D.start(1e3,()=>{E.current&&(E.current.dismissOnTouchEnd=!1,E.current.dismissOnMouseDown=!1)}))}function F(e,t){let n=Et(e);if(!n)return;let r=X(n,e.type,()=>{t(e),r()})}function I(e){T.current=`touch`,F(e,P)}function L(e){D.clear(),e.type===`pointerdown`&&(T.current=e.pointerType),!(e.type===`mousedown`&&E.current&&!E.current.dismissOnMouseDown)&&F(e,e=>{e.type===`pointerdown`?M(e):O(e)})}function R(e){if(!x.current)return;let n=S.current;if(s(),c()===`intentional`){if(e.type===`pointercancel`){n&&o();return}if(!g(e)){if(n){o();return}typeof h==`function`&&!h(e)||(t.clear(),C.current=!0,k())}}}function te(e){if(c()!==`sloppy`||!E.current||j(e))return;let t=e.touches[0];if(!t)return;let n=Math.abs(t.clientX-E.current.startX),r=Math.abs(t.clientY-E.current.startY),i=Math.sqrt(n*n+r*r);i>5&&(E.current.dismissOnTouchEnd=!0),i>10&&(O(e),D.clear(),E.current=null)}function ne(e){F(e,te)}function re(e){c()!==`sloppy`||!E.current||j(e)||(E.current.dismissOnTouchEnd&&O(e),D.clear(),E.current=null)}function ie(e){F(e,re)}let V=K(d),ae=Bt(r&&Bt(X(V,`keydown`,N),X(V,`compositionstart`,i),X(V,`compositionend`,a)),_&&Bt(X(V,`click`,L,!0),X(V,`pointerdown`,L,!0),X(V,`pointerup`,R,!0),X(V,`pointercancel`,R,!0),X(V,`mousedown`,L,!0),X(V,`mouseup`,R,!0),X(V,`touchstart`,I,!0),X(V,`touchmove`,ne,!0),X(V,`touchend`,ie,!0)));return()=>{ae(),e.clear(),t.clear(),s(),C.current=!1,k()}},[f,d,r,_,h,u,n,y,b,N,k,v,A,j,p,l,D]);let L=g.useMemo(()=>({onKeyDown:N,onPointerDown:M,onClick:M}),[N,M]),R=g.useMemo(()=>({onKeyDown:N,onPointerDown:I,onMouseDown:I,onClickCapture:P,onMouseDownCapture(e){P(),F(e)},onPointerDownCapture(e){P(),F(e)},onMouseUpCapture:P,onTouchEndCapture:P,onTouchMoveCapture:P}),[N,P,F,I]);return g.useMemo(()=>n?{reference:L,floating:R,trigger:L}:{},[n,L,R])}function Pr(e,t,n){let{reference:r,floating:i}=e,a=Q(t),o=ln(t),s=cn(o),c=Z(t),l=a===`y`,u=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[s]/2-i[s]/2,p;switch(c){case`top`:p={x:u,y:r.y-i.height};break;case`bottom`:p={x:u,y:r.y+r.height};break;case`right`:p={x:r.x+r.width,y:d};break;case`left`:p={x:r.x-i.width,y:d};break;default:p={x:r.x,y:r.y}}let m=on(t);return m&&(p[o]+=f*(m===`end`?1:-1)*(n&&l?-1:1)),p}async function Fr(e,t){t===void 0&&(t={});let{x:n,y:r,platform:i,rects:a,elements:o,strategy:s}=e,{boundary:c=`clippingAncestors`,rootBoundary:l=`viewport`,elementContext:u=`floating`,altBoundary:d=!1,padding:f=0}=an(t,e),p=xn(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=Sn(await i.getClippingRect({element:await(i.isElement==null?void 0:i.isElement(m))??!0?m:m.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(o.floating)),boundary:c,rootBoundary:l,strategy:s})),g=u===`floating`?{x:n,y:r,width:a.floating.width,height:a.floating.height}:a.reference,_=await(i.getOffsetParent==null?void 0:i.getOffsetParent(o.floating)),v=await(i.isElement==null?void 0:i.isElement(_))&&await(i.getScale==null?void 0:i.getScale(_))||{x:1,y:1},y=Sn(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:g,offsetParent:_,strategy:s}):g);return{top:(h.top-y.top+p.top)/v.y,bottom:(y.bottom-h.bottom+p.bottom)/v.y,left:(h.left-y.left+p.left)/v.x,right:(y.right-h.right+p.right)/v.x}}var Ir=50,Lr=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:Fr},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=Pr(l,r,c),f=r,p=0,m={};for(let n=0;n<a.length;n++){let h=a[n];if(!h)continue;let{name:g,fn:_}=h,{x:v,y,data:b,reset:x}=await _({x:u,y:d,initialPlacement:r,placement:f,strategy:i,middlewareData:m,rects:l,platform:s,elements:{reference:e,floating:t}});u=v??u,d=y??d,m[g]={...m[g],...b},x&&p<Ir&&(p++,typeof x==`object`&&(x.placement&&(f=x.placement),x.rects&&(l=x.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):x.rects),{x:u,y:d}=Pr(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},Rr=function(e){return e===void 0&&(e={}),{name:`flip`,options:e,async fn(t){var n;let{placement:r,middlewareData:i,rects:a,initialPlacement:o,platform:s,elements:c}=t,{mainAxis:l=!0,crossAxis:u=!0,fallbackPlacements:d,fallbackStrategy:f=`bestFit`,fallbackAxisSideDirection:p=`none`,flipAlignment:m=!0,...h}=an(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=Z(r),_=Q(o),v=Z(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[yn(o)]:dn(o)),x=p!==`none`;!d&&x&&b.push(...vn(o,m,p,y));let S=[o,...b],C=await s.detectOverflow(t,h),w=[],T=i.flip?.overflows||[];if(l&&w.push(C[g]),u){let e=un(r,a,y);w.push(C[e[0]],C[e[1]])}if(T=[...T,{placement:r,overflows:w}],!w.every(e=>e<=0)){let e=(i.flip?.index||0)+1,t=S[e];if(t&&(u!==`alignment`||_===Q(t)||T.every(e=>Q(e.placement)!==_||e.overflows[0]>0)))return{data:{index:e,overflows:T},reset:{placement:t}};let n=T.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0]?.placement;if(!n)switch(f){case`bestFit`:{let e=T.filter(e=>{if(x){let t=Q(e.placement);return t===_||t===`y`}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0]?.[0];e&&(n=e);break}case`initialPlacement`:n=o}if(r!==n)return{reset:{placement:n}}}return{}}}},zr=new Set([`left`,`top`]);async function Br(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=Z(n),s=on(n),c=Q(n)===`y`,l=zr.has(o)?-1:1,u=a&&c?-1:1,d=an(t,e),{mainAxis:f,crossAxis:p,alignmentAxis:m}=typeof d==`number`?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof m==`number`&&(p=s===`end`?m*-1:m),c?{x:p*u,y:f*l}:{x:f*l,y:p*u}}var Vr=function(e){return e===void 0&&(e=0),{name:`offset`,options:e,async fn(t){var n;let{x:r,y:i,placement:a,middlewareData:o}=t,s=await Br(t,e);return a===o.offset?.placement&&(n=o.arrow)!=null&&n.alignmentOffset?{}:{x:r+s.x,y:i+s.y,data:{...s,placement:a}}}}},Hr=function(e){return e===void 0&&(e={}),{name:`shift`,options:e,async fn(t){let{x:n,y:r,placement:i,platform:a}=t,{mainAxis:o=!0,crossAxis:s=!1,limiter:c={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=an(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=Q(i),p=sn(f),m=u[p],h=u[f],g=(e,t)=>rn(t+d[e===`y`?`top`:`left`],t,t-d[e===`y`?`bottom`:`right`]);o&&(m=g(p,m)),s&&(h=g(f,h));let _=c.fn({...t,[p]:m,[f]:h});return{..._,data:{x:_.x-n,y:_.y-r,enabled:{[p]:o,[f]:s}}}}}},Ur=function(e){return e===void 0&&(e={}),{options:e,fn(t){let{x:n,y:r,placement:i,rects:a,middlewareData:o}=t,{offset:s=0,mainAxis:c=!0,crossAxis:l=!0}=an(e,t),u={x:n,y:r},d=Q(i),f=sn(d),p=u[f],m=u[d],h=an(s,t),g=typeof h==`number`?{mainAxis:h,crossAxis:0}:{mainAxis:h.mainAxis??0,crossAxis:h.crossAxis??0};if(c){let e=f===`y`?`height`:`width`,t=a.reference[f]-a.floating[e]+g.mainAxis,n=a.reference[f]+a.reference[e]-g.mainAxis;p<t?p=t:p>n&&(p=n)}if(l){let e=f===`y`?`width`:`height`,t=zr.has(Z(i)),n=a.reference[d]-a.floating[e]+(t&&o.offset?.[d]||0)+(t?0:g.crossAxis),r=a.reference[d]+a.reference[e]+(t?0:o.offset?.[d]||0)-(t?g.crossAxis:0);m<n?m=n:m>r&&(m=r)}return{[f]:p,[d]:m}}}},Wr=function(e){return e===void 0&&(e={}),{name:`size`,options:e,async fn(t){let{placement:n,rects:r,platform:i,elements:a}=t,{apply:o=()=>{},...s}=an(e,t),c=await i.detectOverflow(t,s),l=Z(n),u=on(n),d=Q(n)===`y`,{width:f,height:p}=r.floating,m,h;l===`top`||l===`bottom`?(m=l,h=u===(await(i.isRTL==null?void 0:i.isRTL(a.floating))?`start`:`end`)?`left`:`right`):(h=l,m=u===`end`?`top`:`bottom`);let g=p-c.top-c.bottom,_=f-c.left-c.right,v=Zt(p-c[m],g),y=Zt(f-c[h],_),b=t.middlewareData.shift,x=!b,S=v,C=y;b!=null&&b.enabled.x&&(C=_),b!=null&&b.enabled.y&&(S=g),x&&!u&&(d?C=f-2*Qt(c.left,c.right):S=p-2*Qt(c.top,c.bottom)),await o({...t,availableWidth:C,availableHeight:S});let w=await i.getDimensions(a.floating);return f!==w.width||p!==w.height?{reset:{rects:!0}}:{}}}};function Gr(e){let t=H(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=B(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=$t(n)!==a||$t(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function Kr(e){return z(e)?e:e.contextElement}function qr(e){let t=Kr(e);if(!B(t))return tn(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=Gr(t),o=(a?$t(n.width):n.width)/r,s=(a?$t(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var Jr=tn(0);function Yr(e){let t=I(e);return!le()||!t.visualViewport?Jr:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Xr(e,t,n){return t===void 0&&(t=!1),!!n&&t&&n===I(e)}function Zr(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=Kr(e),o=tn(1);t&&(r?z(r)&&(o=qr(r)):o=qr(e));let s=Xr(a,n,r)?Yr(a):tn(0),c=(i.left+s.x)/o.x,l=(i.top+s.y)/o.y,u=i.width/o.x,d=i.height/o.y;if(a&&r){let e=I(a),t=z(r)?I(r):r,n=e,i=me(n);for(;i&&t!==n;){let e=qr(i),t=i.getBoundingClientRect(),r=H(i),a=t.left+(i.clientLeft+parseFloat(r.paddingLeft))*e.x,o=t.top+(i.clientTop+parseFloat(r.paddingTop))*e.y;c*=e.x,l*=e.y,u*=e.x,d*=e.y,c+=a,l+=o,n=I(i),i=me(n)}}return Sn({width:u,height:d,x:c,y:l})}function Qr(e,t){let n=de(e).scrollLeft;return t?t.left+n:Zr(L(e)).left+n}function $r(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-Qr(e,n),y:n.top+t.scrollTop}}function ei(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=L(r),s=t?re(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=tn(1),u=tn(0),d=B(r);if((d||!a)&&((F(r)!==`body`||te(o))&&(c=de(r)),d)){let e=Zr(r);l=qr(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?$r(o,c):tn(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+f.x,y:n.y*l.y-c.scrollTop*l.y+u.y+f.y}}function ti(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function ni(e){let t=de(e),n=e.ownerDocument.body,r=Qt(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),i=Qt(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight),a=-t.scrollLeft+Qr(e),o=-t.scrollTop;return H(n).direction===`rtl`&&(a+=Qt(e.clientWidth,n.clientWidth)-r),{width:r,height:i,x:a,y:o}}var ri=25;function ii(e,t,n){n===void 0&&(n=`viewport`);let r=n===`layoutViewport`,i=I(e),a=L(e),o=i.visualViewport,s=a.clientWidth,c=a.clientHeight,l=0,u=0;if(o){let e=!le()||t===`fixed`;r?e||(l=-o.offsetLeft,u=-o.offsetTop):(s=o.width,c=o.height,e&&(l=o.offsetLeft,u=o.offsetTop))}if(Qr(a)<=0){let e=a.ownerDocument,t=e.body,n=getComputedStyle(t),r=e.compatMode===`CSS1Compat`&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,i=Math.abs(a.clientWidth-t.clientWidth-r),o=getComputedStyle(a).scrollbarGutter===`stable both-edges`?i/2:i;o<=ri&&(s-=o)}return{width:s,height:c,x:l,y:u}}function ai(e,t){let n=Zr(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=qr(e);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function oi(e,t,n){let r;if(t===`viewport`||t===`layoutViewport`)r=ii(e,n,t);else if(t===`document`)r=ni(L(e));else if(z(t))r=ai(t,n);else{let n=Yr(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return Sn(r)}function si(e,t){let n=t.get(e);if(n)return n;let r=U(e,[],!1).filter(e=>z(e)&&F(e)!==`body`),i=null,a=H(e).position===`fixed`,o=a?fe(e):e;for(;z(o)&&!ue(o);){let e=H(o),t=se(o),n=i?i.position:a?`fixed`:``;!t&&(n===`fixed`||n===`absolute`&&e.position===`static`)?r=r.filter(e=>e!==o):i=e,o=fe(o)}return t.set(e,r),r}function ci(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?re(t)?[]:si(t,this._c):[].concat(n),r],o=oi(t,a[0],i),s=o.top,c=o.right,l=o.bottom,u=o.left;for(let e=1;e<a.length;e++){let n=oi(t,a[e],i);s=Qt(n.top,s),c=Zt(n.right,c),l=Zt(n.bottom,l),u=Qt(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function li(e){let{width:t,height:n}=Gr(e);return{width:t,height:n}}function ui(e,t,n){let r=B(t),i=L(t),a=n===`fixed`,o=Zr(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=tn(0);if((r||!a)&&((F(t)!==`body`||te(i))&&(s=de(t)),r)){let e=Zr(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}!r&&i&&(c.x=Qr(i));let l=i&&!r&&!a?$r(i,s):tn(0);return{x:o.left+s.scrollLeft-c.x-l.x,y:o.top+s.scrollTop-c.y-l.y,width:o.width,height:o.height}}function di(e){return H(e).position===`static`}function fi(e,t){if(!B(e)||H(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return L(e)===n&&(n=n.ownerDocument.body),n}function pi(e,t){let n=I(e);if(re(e))return n;if(!B(e)){let t=fe(e);for(;t&&!ue(t);){if(z(t)&&!di(t))return t;t=fe(t)}return n}let r=fi(e,t);for(;r&&ne(r)&&di(r);)r=fi(r,t);return r&&ue(r)&&di(r)&&!se(r)?n:r||ce(e)||n}var mi=async function(e){let t=this.getOffsetParent||pi,n=this.getDimensions,r=await n(e.floating);return{reference:ui(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function hi(e){return H(e).direction===`rtl`}var gi={convertOffsetParentRelativeRectToViewportRelativeRect:ei,getDocumentElement:L,getClippingRect:ci,getOffsetParent:pi,getElementRects:mi,getClientRects:ti,getDimensions:li,getScale:qr,isElement:z,isRTL:hi};function _i(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function vi(e,t,n){let r=null,i,a=L(e);function o(){var e;clearTimeout(i),(e=r)==null||e.disconnect(),r=null}function s(n,c){n===void 0&&(n=!1),c===void 0&&(c=1),o();let l=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=l;if(n||t(),!f||!p)return;let m=en(d),h=en(a.clientWidth-(u+f)),g=en(a.clientHeight-(d+p)),_=en(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:Qt(0,Zt(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(!_i(l,e.getBoundingClientRect()))return s();if(n!==c){if(!y)return s();n?s(!1,n):i=setTimeout(()=>{s(!1,1e-7)},1e3)}y=!1}try{r=new IntersectionObserver(b,{...v,root:a.ownerDocument})}catch{r=new IntersectionObserver(b,v)}r.observe(e)}let c=I(e),l=()=>s(n);return c.addEventListener(`resize`,l),s(!0),()=>{c.removeEventListener(`resize`,l),o()}}function yi(e,t,n,r){r===void 0&&(r={});let{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver==`function`,layoutShift:s=typeof IntersectionObserver==`function`,animationFrame:c=!1}=r,l=Kr(e),u=i||a?[...l?U(l):[],...t?U(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n),a&&e.addEventListener(`resize`,n)});let d=l&&s?vi(l,n,a):null,f=-1,p=null;o&&(p=new ResizeObserver(e=>{let[r]=e;r&&r.target===l&&p&&t&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var e;(e=p)==null||e.observe(t)})),n()}),l&&!c&&p.observe(l),t&&p.observe(t));let m,h=c?Zr(e):null;c&&g();function g(){let t=Zr(e);h&&!_i(h,t)&&n(),h=t,m=requestAnimationFrame(g)}return n(),()=>{var e;u.forEach(e=>{i&&e.removeEventListener(`scroll`,n),a&&e.removeEventListener(`resize`,n)}),d?.(),(e=p)==null||e.disconnect(),p=null,c&&cancelAnimationFrame(m)}}var bi=Vr,xi=Hr,Si=Rr,Ci=Wr,wi=Ur,Ti=(e,t,n)=>{let r=new Map,i=n??{},a={...gi,...i.platform,_c:r};return Lr(e,t,{...i,platform:a})},Ei=typeof document<`u`?g.useLayoutEffect:function(){};function Di(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e==`function`&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e==`object`){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!Di(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){let n=i[r];if(!(n===`_owner`&&e.$$typeof)&&!Di(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function Oi(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function ki(e,t){let n=Oi(e);return Math.round(t*n)/n}function Ai(e){let t=g.useRef(e);return Ei(()=>{t.current=e}),t}function ji(e){e===void 0&&(e={});let{placement:t=`bottom`,strategy:n=`absolute`,middleware:r=[],platform:i,elements:{reference:a,floating:o}={},transform:s=!0,whileElementsMounted:c,open:l}=e,[u,d]=g.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,p]=g.useState(r);Di(f,r)||p(r);let[m,h]=g.useState(null),[_,v]=g.useState(null),y=g.useCallback(e=>{e!==C.current&&(C.current=e,h(e))},[]),b=g.useCallback(e=>{e!==w.current&&(w.current=e,v(e))},[]),x=a||m,S=o||_,C=g.useRef(null),w=g.useRef(null),T=g.useRef(u),E=c!=null,D=Ai(c),O=Ai(i),k=Ai(l),A=g.useCallback(()=>{if(!C.current||!w.current)return;let e={placement:t,strategy:n,middleware:f};O.current&&(e.platform=O.current),Ti(C.current,w.current,e).then(e=>{let t={...e,isPositioned:k.current!==!1};j.current&&!Di(T.current,t)&&(T.current=t,or.flushSync(()=>{d(t)}))})},[f,t,n,O,k]);Ei(()=>{l===!1&&T.current.isPositioned&&(T.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[l]);let j=g.useRef(!1);Ei(()=>(j.current=!0,()=>{j.current=!1}),[]),Ei(()=>{if(x&&(C.current=x),S&&(w.current=S),x&&S){if(D.current)return D.current(x,S,A);A()}},[x,S,A,D,E]);let M=g.useMemo(()=>({reference:C,floating:w,setReference:y,setFloating:b}),[y,b]),N=g.useMemo(()=>({reference:x,floating:S}),[x,S]),P=g.useMemo(()=>{let e={position:n,left:0,top:0};if(!N.floating)return e;let t=ki(N.floating,u.x),r=ki(N.floating,u.y);return s?{...e,transform:`translate(`+t+`px, `+r+`px)`,...Oi(N.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,s,N.floating,u.x,u.y]);return g.useMemo(()=>({...u,update:A,refs:M,elements:N,floatingStyles:P}),[u,A,M,N,P])}var Mi=(e,t)=>{let n=bi(e);return{name:n.name,fn:n.fn,options:[e,t]}},Ni=(e,t)=>{let n=xi(e);return{name:n.name,fn:n.fn,options:[e,t]}},Pi=(e,t)=>({fn:wi(e).fn,options:[e,t]}),Fi=(e,t)=>{let n=Si(e);return{name:n.name,fn:n.fn,options:[e,t]}},Ii=(e,t)=>{let n=Ci(e);return{name:n.name,fn:n.fn,options:[e,t]}},Li=class{attachedStores=[];attachedStoreValue=null;storeListeners=new Set;constructor(e,t,n=!0){this.fallbackStore=e,this.componentName=t,this.throwOnMissingTrigger=n}get attachedStore(){return this.attachedStoreValue}get store(){return this.attachedStoreValue??this.fallbackStore}get serverStore(){return this.fallbackStore}subscribeStore(e){return this.storeListeners.add(e),()=>{this.storeListeners.delete(e)}}attachStore(e){return this.attachedStores.push(e),this.setActiveStore(e),()=>{let t=this.attachedStores.lastIndexOf(e);t!==-1&&this.attachedStores.splice(t,1),this.setActiveStore(this.attachedStores[this.attachedStores.length-1]??null)}}setActiveStore(e){this.attachedStoreValue!==e&&(this.attachedStoreValue=e,this.storeListeners.forEach(e=>{e()}))}openByTrigger(e){let t=this.attachedStore;if(t===null)return;let n;if(e){for(let t=this.attachedStores.length-1;t>=0&&!n;--t)n=this.attachedStores[t].context.triggerElements.getById(e);n??=this.fallbackStore.context.triggerElements.getById(e)}if(e&&!n&&this.throwOnMissingTrigger)throw Error(o(99,this.componentName,e,this.componentName));t.setOpen(!0,J(ze,void 0,n))}closePopup(){let e=this.attachedStore;e!==null&&e.setOpen(!1,J(ze))}},Ri=[],zi=void 0;function Bi(){return zi}function Vi(e){Ri.push(e)}function Hi(e){let t=(t,n)=>{let r=u(Wi).current,i;try{zi=r;for(let e of Ri)e.before(r);i=e(t,n);for(let e of Ri)e.after(r);r.didInitialize=!0}finally{zi=void 0}return i};return t.displayName=e.displayName||e.name,t}function Ui(e){return g.forwardRef(Hi(e))}function Wi(){return{didInitialize:!1}}var Gi=a(19)?Ji:Yi;function Ki(e,t,n,r,i){return Gi(e,t,n,r,i)}function qi(e,t,n,r,i){let a=g.useCallback(()=>t(e.getSnapshot(),n,r,i),[e,t,n,r,i]);return(0,v.useSyncExternalStore)(e.subscribe,a,a)}Vi({before(e){e.syncIndex=0,e.didInitialize||(e.syncTick=1,e.syncHooks=[],e.didChangeStore=!0,e.getSnapshot=()=>{let t=!1;for(let n=0;n<e.syncHooks.length;n+=1){let r=e.syncHooks[n],i=r.selector(r.store.state,r.a1,r.a2,r.a3);Object.is(r.value,i)||(t=!0,r.value=i)}return t&&(e.syncTick+=1),e.syncTick})},after(e){e.syncHooks.length>0&&(e.didChangeStore&&(e.didChangeStore=!1,e.subscribe=t=>{let n=new Set;for(let t of e.syncHooks)n.add(t.store);let r=[];for(let e of n)r.push(e.subscribe(t));return()=>{for(let e of r)e()}}),(0,v.useSyncExternalStore)(e.subscribe,e.getSnapshot,e.getSnapshot))}});function Ji(e,t,n,r,i){let a=Bi();if(!a)return qi(e,t,n,r,i);let o=a.syncIndex;a.syncIndex+=1;let s;return a.didInitialize?(s=a.syncHooks[o],(s.store!==e||s.selector!==t||!Object.is(s.a1,n)||!Object.is(s.a2,r)||!Object.is(s.a3,i))&&(s.store!==e&&(a.didChangeStore=!0),s.store=e,s.selector=t,s.a1=n,s.a2=r,s.a3=i,s.value=t(e.getSnapshot(),n,r,i))):(s={store:e,selector:t,a1:n,a2:r,a3:i,value:t(e.getSnapshot(),n,r,i)},a.syncHooks.push(s)),s.value}function Yi(e,t,n,r,i){return(0,y.useSyncExternalStoreWithSelector)(e.subscribe,e.getSnapshot,e.getSnapshot,e=>t(e,n,r,i))}var Xi=class{constructor(e){this.state=e,this.listeners=new Set,this.updateTick=0}subscribe=e=>(this.listeners.add(e),()=>{this.listeners.delete(e)});getSnapshot=()=>this.state;setState(e){if(this.state===e)return;this.state=e,this.updateTick+=1;let t=this.updateTick;for(let n of this.listeners){if(t!==this.updateTick)return;n(e)}}update(e){for(let t in e)if(!Object.is(this.state[t],e[t])){this.setState({...this.state,...e});return}}set(e,t){Object.is(this.state[e],t)||this.setState({...this.state,[e]:t})}notifyAll(){let e={...this.state};this.setState(e)}use(e,t,n,r){return Ki(this,e,t,n,r)}},Zi=class extends Xi{constructor(e,t={},n){super(e),this.context=t,this.selectors=n}useSyncedValue(e,t){g.useDebugValue(e);let n=this;G(()=>{n.state[e]!==t&&n.set(e,t)},[n,e,t])}useSyncedValueWithCleanup(e,t){let n=this;G(()=>(n.state[e]!==t&&n.set(e,t),()=>{n.set(e,void 0)}),[n,e,t])}useSyncedValues(e){let t=this;G(()=>{t.update(e)},[t,...Object.values(e)])}useControlledProp(e,t){g.useDebugValue(e);let n=this,r=t!==void 0;G(()=>{r&&!Object.is(n.state[e],t)&&n.setState({...n.state,[e]:t})},[n,e,t,r])}select(e,t,n,r){let i=this.selectors[e];return i(this.state,t,n,r)}useState(e,t,n,r){return g.useDebugValue(e),Ki(this,this.selectors[e],t,n,r)}useContextCallback(e,t){g.useDebugValue(e);let n=W(t??c);this.context[e]=n}useStateSetter(e){let t=g.useRef(void 0);return t.current===void 0&&(t.current=t=>{this.set(e,t)}),t.current}observe(e,t){let n;n=typeof e==`function`?e:this.selectors[e];let r=n(this.state);return t(r,r,this),this.subscribe(e=>{let i=n(e);if(!Object.is(r,i)){let e=r;r=i,t(i,e,this)}})}},Qi={open:e=>e.open,transitionStatus:e=>e.transitionStatus,domReferenceElement:e=>e.domReferenceElement,referenceElement:e=>e.positionReference??e.referenceElement,floatingElement:e=>e.floatingElement,floatingId:e=>e.floatingId},$i=class extends Zi{constructor(e){let{syncOnly:t,nested:n,onOpenChange:r,triggerElements:i,...a}=e;super({...a,positionReference:a.referenceElement,domReferenceElement:a.referenceElement},{onOpenChange:r,dataRef:{current:{}},events:xr(),nested:n,triggerElements:i},Qi),this.syncOnly=t}syncOpenEvent=(e,t)=>{(!e||!this.state.open||t!=null&&vt(t))&&(this.context.dataRef.current.openEvent=e?t:void 0)};dispatchOpenChange=(e,t)=>{this.syncOpenEvent(e,t.event);let n={open:e,reason:t.reason,nativeEvent:t.event,nested:this.context.nested,triggerElement:t.trigger};this.context.events.emit(`openchange`,n)};setOpen=(e,t)=>{if(this.syncOnly){this.context.onOpenChange?.(e,t);return}this.dispatchOpenChange(e,t),this.context.onOpenChange?.(e,t)}};function ea(e){let{popupStore:t,treatPopupAsFloatingElement:n=!1,floatingRootContext:r,floatingId:i,nested:a,onOpenChange:o}=e,s=t.useState(`open`),c=t.useState(`activeTriggerElement`),l=t.useState(n?`popupElement`:`positionerElement`),u=t.context.triggerElements,d=o,f=g.useRef(null);r===void 0&&f.current===null&&(f.current=new $i({open:s,transitionStatus:void 0,referenceElement:c,floatingElement:l,triggerElements:u,onOpenChange:d,floatingId:i,syncOnly:!0,nested:a}));let p=r??f.current;return t.useSyncedValue(`floatingId`,i),G(()=>{let e={open:s,floatingId:i,referenceElement:c,floatingElement:l};z(c)&&(e.domReferenceElement=c),p.state.positionReference===p.state.referenceElement&&(e.positionReference=c),p.update(e)},[s,i,c,l,p]),p.context.onOpenChange=d,p.context.nested=a,p}function ta(e,t=!1,n=!1){let[r,i]=g.useState(e&&t?`idle`:void 0),[a,o]=g.useState(e);return e&&!a&&(o(!0),i(`starting`)),!e&&a&&r!==`ending`&&!n&&i(`ending`),!e&&!a&&r===`ending`&&i(void 0),G(()=>{if(!e&&a&&r!==`ending`&&n){let e=Gt.request(()=>{i(`ending`)});return()=>{Gt.cancel(e)}}},[e,a,r,n]),G(()=>{if(!e||t)return;let n=Gt.request(()=>{i(void 0)});return()=>{Gt.cancel(n)}},[t,e]),G(()=>{if(!e||!t)return;e&&a&&r!==`idle`&&i(`starting`);let n=Gt.request(()=>{i(`idle`)});return()=>{Gt.cancel(n)}},[t,e,a,r]),{mounted:a,setMounted:o,transitionStatus:r}}function na(e,t=!1){let n=Kt();return W((r,i=null)=>{n.cancel();let a=Ar(e);if(a==null)return;let o=a,s=()=>{or.flushSync(r)};if(typeof o.getAnimations!=`function`||globalThis.BASE_UI_ANIMATIONS_DISABLED){r();return}function c(){Promise.all(o.getAnimations().map(e=>e.finished)).then(()=>{i?.aborted||s()},()=>{if(!i?.aborted){if(o.getAnimations().some(e=>e.pending||e.playState!==`finished`)){c();return}s()}})}if(t){let e=`data-starting-style`;if(!o.hasAttribute(e)){n.request(c);return}let t=new MutationObserver(()=>{o.hasAttribute(e)||(t.disconnect(),c())});t.observe(o,{attributes:!0,attributeFilter:[e]}),i?.addEventListener(`abort`,()=>t.disconnect(),{once:!0});return}n.request(c)})}function ra(e){let{enabled:t=!0,open:n,ref:r,onComplete:i}=e,a=W(i),o=na(r,n);g.useEffect(()=>{if(!t)return;let e=new AbortController;return o(a,e.signal),()=>{e.abort()}},[t,n,a,o])}var ia={tabIndex:-1,[yt]:``};function aa(e){return t=>t!==`touch`||e.current}function oa(e,t=!1){let n=Ke(),r=Tr()!=null,i=u(()=>e(n,r)).current;return ea({popupStore:i,treatPopupAsFloatingElement:t,floatingRootContext:i.state.floatingRootContext,floatingId:n,nested:r,onOpenChange:i.setOpen}),i}function sa({handle:e,store:t}){return G(()=>e.attachStore(t),[e,t]),null}function ca(e,t){let n=g.useRef(null),r=g.useRef(null);return g.useCallback(i=>{if(e===void 0)return;let a=!1;if(n.current!==null){let e=n.current,i=r.current,o=t.context.triggerElements.getById(e);i&&o===i&&(t.context.triggerElements.delete(e),a=!0),n.current=null,r.current=null}if(i!==null&&(n.current=e,r.current=i,t.context.triggerElements.add(e,i),a=!0),a){let e=t.context.triggerElements.size;t.select(`open`)&&t.state.triggerCount!==e&&t.set(`triggerCount`,e)}},[t,e])}function la(e,t,n,r=!1){t?e.preventUnmountingOnClose=!1:r&&(e.preventUnmountingOnClose=!0);let i=n?.id??null;(i||t)&&(e.activeTriggerId=i,e.activeTriggerElement=n??null)}function ua(e){let t=!1;return e.preventUnmountOnClose=()=>{t=!0},()=>t}function da(e,t,n,r={}){let i=n.reason,a=i===q,o=t&&i===`trigger-focus`,s=!t&&(i===`trigger-press`||i===`escape-key`),c=ua(n);if(e.context.onOpenChange?.(t,n),n.isCanceled)return;r.onBeforeDispatch?.(),e.state.floatingRootContext.dispatchOpenChange(t,n);let l=()=>{let i={...r.extraState,open:t};o?i.instantType=`focus`:s?i.instantType=`dismiss`:a&&(i.instantType=void 0),la(i,t,n.trigger,c()),e.update(i)};a?or.flushSync(l):l()}function fa(e,t,n,r){let i=n.useState(`isMountedByTrigger`,e),a=ca(e,n),o=W(t=>{let i=n.select(`open`),a=n.select(`activeTriggerId`);if(a===e){n.update({activeTriggerElement:t,...i?r:null});return}a==null&&i&&n.update({activeTriggerId:e,activeTriggerElement:t,...r})}),s=g.useCallback(e=>{a(e),e&&o(e)},[a,o]);return G(()=>{i&&n.update({activeTriggerElement:t.current,...r})},[i,n,t,...Object.values(r)]),{registerTrigger:s,isMountedByThisTrigger:i}}function pa(e,t={}){let{closeOnActiveTriggerUnmount:n=!1}=t,r=g.useRef(null),i=e.useState(`open`);G(()=>{if(!i){r.current=null,e.state.triggerCount!==0&&e.set(`triggerCount`,0);return}let t=e.context.triggerElements.size,a={};e.state.triggerCount!==t&&(a.triggerCount=t);let o=e.select(`activeTriggerId`),s=null;if(o){let t=e.context.triggerElements.getById(o);if(t)r.current=o,t!==e.state.activeTriggerElement&&(a.activeTriggerElement=t);else{for(let[t,n]of e.context.triggerElements.entries())if(n===e.state.activeTriggerElement){a.activeTriggerId=t,a.activeTriggerElement=n,r.current=t;break}a.activeTriggerId===void 0&&(r.current===o?s=o:r.current=null)}}else r.current=null;if(!s&&!o&&t===1){let t=e.context.triggerElements.entries().next();if(!t.done){let[e,n]=t.value;a.activeTriggerId=e,a.activeTriggerElement=n,r.current=e}}(a.triggerCount!==void 0||a.activeTriggerId!==void 0||a.activeTriggerElement!==void 0)&&e.update(a),s&&n&&queueMicrotask(()=>{if(e.select(`open`)&&e.select(`activeTriggerId`)===s&&!e.context.triggerElements.getById(s)){let t=J(be);e.setOpen(!1,t),t.isCanceled||e.update({activeTriggerId:null,activeTriggerElement:null})}})},[i,e,e.useState(`triggerCount`),e.useState(`activeTriggerId`),e.useState(`activeTriggerElement`),n])}function ma(e,t,n){let{mounted:r,setMounted:i,transitionStatus:a}=ta(e),o=t.useState(`preventUnmountingOnClose`),s=!e&&o;t.useSyncedValues({mounted:r,transitionStatus:a,preventUnmountingOnClose:s});let c=W(()=>{i(!1),t.update({activeTriggerId:null,activeTriggerElement:null,mounted:!1,preventUnmountingOnClose:!1}),n?.(),t.context.onOpenChangeComplete?.(!1)});return ra({enabled:r&&!e&&!s,open:e,ref:t.context.popupRef,onComplete(){e||c()}}),{forceUnmount:c,transitionStatus:a}}function ha(e,t){e.useSyncedValues(t),G(()=>()=>{e.update({activeTriggerProps:s,inactiveTriggerProps:s,popupProps:s})},[e])}function ga(e,t){G(()=>{!t&&e.state.openMethod!==null&&e.set(`openMethod`,null)},[t,e]),G(()=>()=>{e.state.openMethod!==null&&e.set(`openMethod`,null)},[e])}var _a=class{constructor(){this.idMap=new Map}add(e,t){this.idMap.set(e,t)}delete(e){this.idMap.delete(e)}hasElement(e){for(let t of this.idMap.values())if(t===e)return!0;return!1}hasMatchingElement(e){for(let t of this.idMap.values())if(e(t))return!0;return!1}getById(e){return this.idMap.get(e)}entries(){return this.idMap.entries()}elements(){return this.idMap.values()}get size(){return this.idMap.size}};function va(){return new $i({open:!1,transitionStatus:void 0,floatingElement:null,referenceElement:null,triggerElements:new _a,floatingId:void 0,syncOnly:!1,nested:!1,onOpenChange:void 0})}function ya(){return{open:!1,openProp:void 0,mounted:!1,transitionStatus:void 0,floatingRootContext:va(),floatingId:void 0,triggerCount:0,preventUnmountingOnClose:!1,payload:void 0,activeTriggerId:null,activeTriggerElement:null,triggerIdProp:void 0,popupElement:null,positionerElement:null,activeTriggerProps:s,inactiveTriggerProps:s,popupProps:s}}function ba(e,t,n=!1){return new $i({open:!1,transitionStatus:void 0,floatingElement:null,referenceElement:null,triggerElements:e,floatingId:t,syncOnly:!0,nested:n,onOpenChange:void 0})}var xa=e=>e.triggerIdProp??e.activeTriggerId,Sa=e=>e.openProp??e.open,Ca=e=>(e.popupElement?.id??e.floatingId)||void 0;function wa(e,t){return t!==void 0&&Sa(e)&&xa(e)===t}function Ta(e,t){return wa(e,t)?!0:t!==void 0&&Sa(e)&&xa(e)==null&&e.triggerCount===1}var Ea={open:Sa,mounted:e=>e.mounted,transitionStatus:e=>e.transitionStatus,floatingRootContext:e=>e.floatingRootContext,triggerCount:e=>e.triggerCount,preventUnmountingOnClose:e=>e.preventUnmountingOnClose,payload:e=>e.payload,activeTriggerId:xa,activeTriggerElement:e=>e.mounted?e.activeTriggerElement:null,popupId:Ca,isTriggerActive:(e,t)=>t!==void 0&&xa(e)===t,isOpenedByTrigger:(e,t)=>wa(e,t),isMountedByTrigger:(e,t)=>t!==void 0&&xa(e)===t&&e.mounted,triggerProps:(e,t)=>t?e.activeTriggerProps:e.inactiveTriggerProps,triggerPopupId:(e,t)=>Ta(e,t)?Ca(e):void 0,popupProps:e=>e.popupProps,popupElement:e=>e.popupElement,positionerElement:e=>e.positionerElement};function Da(e){let t=g.useCallback(t=>e===void 0?c:e.subscribeStore(t),[e]),n=g.useCallback(()=>e===void 0?void 0:e.store,[e]);return(0,v.useSyncExternalStore)(t,n,()=>e?.serverStore)}function Oa(e){return ka(e,e.rootContext)}function ka(e,t){let{nodeId:n,externalTree:r}=e,i=t.useState(`referenceElement`),a=t.useState(`floatingElement`),o=t.useState(`domReferenceElement`),s=t.useState(`open`),c=t.useState(`floatingId`),[l,u]=g.useState(null),[d,f]=g.useState(void 0),[p,m]=g.useState(void 0),h=g.useRef(null),_=Er(r),v=g.useMemo(()=>({reference:i,floating:a,domReference:o}),[i,a,o]),y=ji({...e,elements:{...v,...l&&{reference:l}}}),b=z(d)?d:null,x=p===void 0?t.state.floatingElement:p;t.useSyncedValue(`referenceElement`,d??null),t.useSyncedValue(`domReferenceElement`,d===void 0?o:b),t.useSyncedValue(`floatingElement`,x);let S=g.useCallback(e=>{let t=z(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),getClientRects:()=>e.getClientRects(),contextElement:e}:e;u(t),y.refs.setReference(t)},[y.refs]),C=g.useCallback(e=>{(z(e)||e===null)&&(h.current=e,f(e)),(z(y.refs.reference.current)||y.refs.reference.current===null||e!==null&&!z(e))&&y.refs.setReference(e)},[y.refs,f]),w=g.useCallback(e=>{m(e),y.refs.setFloating(e)},[y.refs]),T=g.useMemo(()=>({...y.refs,setReference:C,setFloating:w,setPositionReference:S,domReference:h}),[y.refs,C,w,S]),E=g.useMemo(()=>({...y.elements,domReference:o}),[y.elements,o]),D=g.useMemo(()=>({...y,dataRef:t.context.dataRef,open:s,onOpenChange:t.setOpen,events:t.context.events,floatingId:c,refs:T,elements:E,nodeId:n,rootStore:t}),[y,T,E,n,t,s,c]);return G(()=>{o&&(h.current=o)},[o]),G(()=>{t.context.dataRef.current.floatingContext=D;let e=_?.nodesRef.current.find(e=>e.id===n);e&&(e.context=D)}),g.useMemo(()=>({...y,context:D,refs:T,elements:E,rootStore:t}),[y,T,E,D,t])}var Aa=class e{constructor(){this.pointerType=void 0,this.interactedInside=!1,this.handler=void 0,this.blockMouseMove=!0,this.performedPointerEventsMutation=!1,this.pointerEventsScopeElement=null,this.pointerEventsReferenceElement=null,this.pointerEventsFloatingElement=null,this.restTimeoutPending=!1,this.openChangeTimeout=new Xe,this.restTimeout=new Xe,this.handleCloseOptions=void 0}static create(){return new e}dispose=()=>{this.openChangeTimeout.clear(),this.restTimeout.clear()};disposeEffect=()=>this.dispose},ja=new WeakMap;function Ma(e){if(!e.performedPointerEventsMutation)return;let t=e.pointerEventsScopeElement;t&&ja.get(t)===e&&(e.pointerEventsScopeElement?.style.removeProperty(`pointer-events`),e.pointerEventsReferenceElement?.style.removeProperty(`pointer-events`),e.pointerEventsFloatingElement?.style.removeProperty(`pointer-events`),ja.delete(t)),e.performedPointerEventsMutation=!1,e.pointerEventsScopeElement=null,e.pointerEventsReferenceElement=null,e.pointerEventsFloatingElement=null}function Na(e,t){let{scopeElement:n,referenceElement:r,floatingElement:i}=t,a=ja.get(n);a&&a!==e&&Ma(a),Ma(e),e.performedPointerEventsMutation=!0,e.pointerEventsScopeElement=n,e.pointerEventsReferenceElement=r,e.pointerEventsFloatingElement=i,ja.set(n,e),n.style.pointerEvents=`none`,r.style.pointerEvents=`auto`,i.style.pointerEvents=`auto`}function Pa(e){let t=e.context.dataRef.current,n=u(()=>t.hoverInteractionState??Aa.create()).current;return t.hoverInteractionState||=n,Je(t.hoverInteractionState.disposeEffect),t.hoverInteractionState}function Fa(e,t={}){let{enabled:n=!0,closeDelay:r=0,nodeId:i}=t,a=`rootStore`in e?e.rootStore:e,o=a.useState(`open`),s=a.useState(`floatingElement`),c=a.useState(`domReferenceElement`),{dataRef:l}=a.context,u=Er(),d=Tr(),f=Pa(a),p=Ze(),m=W(()=>Rt(l.current.openEvent?.type,f.interactedInside)),h=W(()=>zt(l.current.openEvent?.type)),_=W(()=>{Ma(f)});G(()=>{o||(f.pointerType=void 0,f.restTimeoutPending=!1,f.interactedInside=!1,_())},[o,f,_]),g.useEffect(()=>_,[_]),G(()=>{if(n&&o&&f.handleCloseOptions?.blockPointerEvents&&h()&&z(c)&&s){let e=c,t=s,n=K(s),r=u?.nodesRef.current.find(e=>e.id===d)?.context?.elements.floating;r&&(r.style.pointerEvents=``);let i=f.pointerEventsScopeElement===t?null:f.pointerEventsScopeElement,a=r===t?null:r,o=f.handleCloseOptions?.getScope?.()??i??a??e.closest(`[data-rootownerid]`)??n.body;return Na(f,{scopeElement:o,referenceElement:e,floatingElement:t}),()=>{_()}}},[n,o,c,s,f,h,u,d,_]),g.useEffect(()=>{if(!n)return;function e(){return!!(u&&d&&rr(u.nodesRef.current,d).length>0)}function t(e){let t=It(r,`close`,f.pointerType),n=()=>{a.setOpen(!1,J(q,e)),u?.events.emit(`floating.closed`,e)};t?f.openChangeTimeout.start(t,n):(f.openChangeTimeout.clear(),n())}function o(e){let t=Et(e);if(!jt(t)){f.interactedInside=!1;return}f.interactedInside=t?.closest(`[aria-haspopup]`)!=null}function c(){f.openChangeTimeout.clear(),p.clear(),u?.events.off(`floating.closed`,v),_()}function g(n){if(e()&&u){u.events.on(`floating.closed`,v);return}if(Dt(n.relatedTarget,a.context.triggerElements))return;let r=l.current.floatingContext?.nodeId??i,o=n.relatedTarget;if(!(u&&r&&z(o)&&rr(u.nodesRef.current,r,!1).some(e=>Y(e.context?.elements.floating,o)))){if(f.handler){f.handler(n);return}_(),h()&&!m()&&t(n)}}function v(t){!u||!d||e()||p.start(0,()=>{u.events.off(`floating.closed`,v),a.setOpen(!1,J(q,t)),u.events.emit(`floating.closed`,t)})}let y=s;return Bt(y&&X(y,`mouseenter`,c),y&&X(y,`mouseleave`,g),y&&X(y,`pointerdown`,o,!0),()=>{u?.events.off(`floating.closed`,v)})},[n,s,a,l,r,i,h,m,_,f,u,d,p])}var Ia={current:null};function La(e,t={}){let{enabled:n=!0,delay:r=0,handleClose:i=null,mouseOnly:a=!1,restMs:o=0,move:s=!0,triggerElementRef:c=Ia,externalTree:l,isActiveTrigger:u=!0,getHandleCloseContext:d,isClosing:f,shouldOpen:p,guardStaleOpen:m=!1}=t,h=`rootStore`in e?e.rootStore:e,{dataRef:_,events:v}=h.context,y=Er(l),b=Pa(h),x=g.useRef(!1),S=Vt(i),C=Vt(r),w=Vt(o),T=Vt(n),E=Vt(p),D=Vt(f),O=W(()=>Rt(_.current.openEvent?.type,b.interactedInside)),k=W(()=>E.current?.()!==!1),A=W((e,t,n)=>{let r=h.context.triggerElements;if(r.hasElement(t))return!e||!Y(e,t);if(!z(n))return!1;let i=n;return r.hasMatchingElement(e=>Y(e,i))&&(!e||!Y(e,i))}),j=W(()=>{b.handler&&=(K(h.select(`domReferenceElement`)).removeEventListener(`mousemove`,b.handler),void 0)}),M=W(()=>{Ma(b)});return u&&(b.handleCloseOptions=S.current?.__options),g.useEffect(()=>j,[j]),g.useEffect(()=>{if(!n)return;function e(e){e.open?x.current=!1:(x.current=e.reason===q,j(),b.openChangeTimeout.clear(),b.restTimeout.clear(),b.blockMouseMove=!0,b.restTimeoutPending=!1)}return v.on(`openchange`,e),()=>{v.off(`openchange`,e)}},[n,v,b,j]),g.useEffect(()=>{if(!n)return;function e(e,t=!0){let n=It(C.current,`close`,b.pointerType);n?b.openChangeTimeout.start(n,()=>{h.setOpen(!1,J(q,e)),y?.events.emit(`floating.closed`,e)}):t&&(b.openChangeTimeout.clear(),h.setOpen(!1,J(q,e)),y?.events.emit(`floating.closed`,e))}let t=c.current??(u?h.select(`domReferenceElement`):null);if(!z(t))return;function r(e){if(b.openChangeTimeout.clear(),b.blockMouseMove=!1,a&&!_t(b.pointerType))return;let t=Lt(w.current),n=It(C.current,`open`,b.pointerType),r=Et(e),i=e.currentTarget??null,o=h.select(`domReferenceElement`),s=i;if(z(r)&&!h.context.triggerElements.hasElement(r)){for(let e of h.context.triggerElements.elements())if(Y(e,r)){s=e;break}}z(i)&&z(o)&&!h.context.triggerElements.hasElement(i)&&Y(i,o)&&(s=o);let c=s!=null&&A(o,s,r),l=h.select(`open`),u=D.current?.()??h.select(`transitionStatus`)===`ending`,d=!l&&u&&x.current,f=!c&&z(s)&&z(o)&&Y(o,s)&&d,p=t>0&&!n,m=c&&(l||d)||f,g=!l||c;if(m){k()&&h.setOpen(!0,J(q,e,s));return}p||(n?b.openChangeTimeout.start(n,()=>{g&&k()&&h.setOpen(!0,J(q,e,s))}):g&&k()&&h.setOpen(!0,J(q,e,s)))}function i(t){if(O()){M();return}j();let n=K(h.select(`domReferenceElement`));b.restTimeout.clear(),b.restTimeoutPending=!1;let r=_.current.floatingContext??d?.();if(!Dt(t.relatedTarget,h.context.triggerElements)){if(S.current&&r){h.select(`open`)||b.openChangeTimeout.clear();let i=c.current;b.handler=S.current({...r,tree:y,x:t.clientX,y:t.clientY,onClose(){M(),j(),T.current&&!O()&&i===h.select(`domReferenceElement`)&&e(t,!0)}}),n.addEventListener(`mousemove`,b.handler),b.handler(t);return}(b.pointerType!==`touch`||!Y(h.select(`floatingElement`),t.relatedTarget))&&e(t)}}function o(e){Y(t,e.relatedTarget)||(b.openChangeTimeout.clear(),b.restTimeout.clear(),b.restTimeoutPending=!1)}let l=m?X(t,`mouseout`,o):void 0;return s?Bt(X(t,`mousemove`,r,{once:!0}),X(t,`mouseenter`,r),X(t,`mouseleave`,i),l):Bt(X(t,`mouseenter`,r),X(t,`mouseleave`,i),l)},[j,M,_,C,h,n,S,b,u,A,O,a,s,w,c,y,T,d,D,k,m]),g.useMemo(()=>{if(!n)return;function e(e){b.pointerType=e.pointerType}return{onPointerDown:e,onPointerEnter:e,onMouseMove(e){let{nativeEvent:t}=e,n=e.currentTarget,r=h.select(`domReferenceElement`),i=h.select(`open`),o=A(r,n,e.target);if(a&&!_t(b.pointerType))return;if(i&&o&&b.handleCloseOptions?.blockPointerEvents){let e=h.select(`floatingElement`);if(e){let t=b.handleCloseOptions?.getScope?.()??n.ownerDocument.body;Na(b,{scopeElement:t,referenceElement:n,floatingElement:e})}}let s=Lt(w.current);if(i&&!o||s===0||!o&&b.restTimeoutPending&&e.movementX**2+e.movementY**2<2)return;b.restTimeout.clear();function c(){if(b.restTimeoutPending=!1,O())return;let e=h.select(`open`);!b.blockMouseMove&&(!e||o)&&k()&&h.setOpen(!0,J(q,t,n))}b.pointerType===`touch`?or.flushSync(()=>{c()}):o&&i?c():(b.restTimeoutPending=!0,b.restTimeout.start(s,c))}}},[n,b,O,A,a,h,w,k])}var Ra=.1,za=Ra*Ra,$=.5;function Ba(e,t,n,r,i,a){return r>=t!=a>=t&&e<=(i-n)*(t-r)/(a-r)+n}function Va(e,t,n,r,i,a,o,s,c,l){let u=!1;return Ba(e,t,n,r,i,a)&&(u=!u),Ba(e,t,i,a,o,s)&&(u=!u),Ba(e,t,o,s,c,l)&&(u=!u),Ba(e,t,c,l,n,r)&&(u=!u),u}function Ha(e,t,n){return e>=n.x&&e<=n.x+n.width&&t>=n.y&&t<=n.y+n.height}function Ua(e,t,n,r,i,a){return e>=Math.min(n,i)&&e<=Math.max(n,i)&&t>=Math.min(r,a)&&t<=Math.max(r,a)}function Wa(e={}){let{blockPointerEvents:t=!1}=e,n=new Xe,r=({x:e,y:t,placement:r,elements:i,onClose:a,nodeId:o,tree:s})=>{let c=r?.split(`-`)[0],l=!1,u=null,d=null,f=typeof performance<`u`?performance.now():0;function p(e,t){let n=performance.now(),r=n-f;if(u===null||d===null||r===0)return u=e,d=t,f=n,!1;let i=e-u,a=t-d,o=i*i+a*a,s=r*r*za;return u=e,d=t,f=n,o<s}function m(){n.clear(),a()}return function(r){n.clear();let a=i.domReference,u=i.floating;if(!a||!u||c==null||e==null||t==null)return;let{clientX:d,clientY:f}=r,h=Et(r),g=r.type===`mouseleave`,_=Y(u,h),v=Y(a,h);if(_&&(l=!0,!g))return;if(v&&(l=!1,!g)){l=!0;return}if(g&&z(r.relatedTarget)&&Y(u,r.relatedTarget))return;function y(){return!!(s&&rr(s.nodesRef.current,o).length>0)}function b(){y()||m()}if(y())return;let x=a.getBoundingClientRect(),S=u.getBoundingClientRect(),C=e>S.right-S.width/2,w=t>S.bottom-S.height/2,T=S.width>x.width,E=S.height>x.height,D=(T?x:S).left,O=(T?x:S).right,k=(E?x:S).top,A=(E?x:S).bottom;if(c===`top`&&t>=x.bottom-1||c===`bottom`&&t<=x.top+1||c===`left`&&e>=x.right-1||c===`right`&&e<=x.left+1){b();return}let j=!1;switch(c){case`top`:j=Ua(d,f,D,x.top+1,O,S.bottom-1);break;case`bottom`:j=Ua(d,f,D,S.top+1,O,x.bottom-1);break;case`left`:j=Ua(d,f,S.right-1,A,x.left+1,k);break;case`right`:j=Ua(d,f,x.right-1,A,S.left+1,k)}if(j)return;if(l&&!Ha(d,f,x)){b();return}if(!g&&p(d,f)){b();return}let M=!1;switch(c){case`top`:{let n=T?$/2:$*4,r=T||C?e+n:e-n,i=T?e-n:C?e+n:e-n,a=t+$+1,o=C||T?S.bottom-$:S.top,s=C?T?S.bottom-$:S.top:S.bottom-$;M=Va(d,f,r,a,i,a,S.left,o,S.right,s);break}case`bottom`:{let n=T?$/2:$*4,r=T||C?e+n:e-n,i=T?e-n:C?e+n:e-n,a=t-$,o=C||T?S.top+$:S.bottom,s=C?T?S.top+$:S.bottom:S.top+$;M=Va(d,f,r,a,i,a,S.left,o,S.right,s);break}case`left`:{let n=E?$/2:$*4,r=E||w?t+n:t-n,i=E?t-n:w?t+n:t-n,a=e+$+1,o=w||E?S.right-$:S.left,s=w?E?S.right-$:S.left:S.right-$;M=Va(d,f,o,S.top,s,S.bottom,a,r,a,i);break}case`right`:{let n=E?$/2:$*4,r=E||w?t+n:t-n,i=E?t-n:w?t+n:t-n,a=e-$,o=w||E?S.left+$:S.right,s=w?E?S.left+$:S.right:S.left+$;M=Va(d,f,a,r,a,i,o,S.top,s,S.bottom);break}}M?l||n.start(40,b):b()}};return r.__options={...e,blockPointerEvents:t},r}function Ga(e){return a(19)?e:e?`true`:void 0}var Ka=class extends Zi{setState(e){}update(e){}set(e,t){}notifyAll(){}},qa=g.createContext(void 0);function Ja(){return g.useContext(qa)?.direction??`ltr`}var Ya=e=>({name:`arrow`,options:e,async fn(t){let{x:n,y:r,placement:i,rects:a,platform:o,elements:s,middlewareData:c}=t,{element:l,padding:u=0,offsetParent:d=`real`}=an(e,t)||{};if(l==null)return{};let f=xn(u),p={x:n,y:r},m=ln(i),h=cn(m),g=await o.getDimensions(l),_=m===`y`,v=_?`top`:`left`,y=_?`bottom`:`right`,b=_?`clientHeight`:`clientWidth`,x=a.reference[h]+a.reference[m]-p[m]-a.floating[h],S=p[m]-a.reference[m],C=d===`real`?await o.getOffsetParent?.(l):s.floating,w=s.floating[b]||a.floating[h];(!w||!await o.isElement?.(C))&&(w=s.floating[b]||a.floating[h]);let T=x/2-S/2,E=w/2-g[h]/2-1,D=Math.min(f[v],E),O=Math.min(f[y],E),k=D,A=w-g[h]-O,j=w/2-g[h]/2+T,M=rn(k,j,A),N=!c.arrow&&on(i)!=null&&j!==M&&a.reference[h]/2-(j<k?D:O)-g[h]/2<0,P=N?j<k?j-k:j-A:0;return{[m]:p[m]+P,data:{[m]:M,centerOffset:j-M-P,...N&&{alignmentOffset:P}},reset:N}}}),Xa=(e,t)=>({...Ya(e),options:[e,t]}),Za={name:`hide`,async fn(e){let{width:t,height:n,x:r,y:i}=e.rects.reference,a=t===0&&n===0&&r===0&&i===0,o=await e.platform.detectOverflow(e,{elementContext:`reference`});return{data:{referenceHidden:o.top-n>=0||o.right-t>=0||o.bottom-n>=0||o.left-t>=0||a}}}},Qa={sideX:`left`,sideY:`top`},$a=`--available-width`,eo=`--available-height`;function to(e,t,n){let r=e===`inline-start`||e===`inline-end`;return{top:`top`,right:r?n?`inline-start`:`inline-end`:`right`,bottom:`bottom`,left:r?n?`inline-end`:`inline-start`:`left`}[t]}function no(e,t,n){let{rects:r,placement:i}=e;return{side:to(t,Z(i),n),align:on(i)||`center`,anchor:{width:r.reference.width,height:r.reference.height},positioner:{width:r.floating.width,height:r.floating.height}}}function ro(e){return io(e,Oa)}function io(e,t){let{anchor:n,positionMethod:r=`absolute`,side:i=`bottom`,sideOffset:a=0,align:o=`center`,alignOffset:s=0,collisionBoundary:c,collisionPadding:l=5,sticky:u=!1,arrowPadding:d=5,disableAnchorTracking:f=!1,inline:p,keepMounted:m=!1,floatingRootContext:h,mounted:_,collisionAvoidance:v,shift:y,nodeId:b,adaptiveOrigin:x,lazyFlip:S=!1,externalTree:C}=e,[w,T]=g.useState(null);!_&&w!==null&&T(null);let E=v.side||`flip`,D=v.align||`flip`,O=v.fallbackAxisSide||`end`,k=y?.crossAxis??!1,A=y?.rootBoundary,j=typeof n==`function`?n:void 0,M=W(j),N=j?M:n,P=Vt(n),F=Vt(_),L=Ja()===`rtl`,R=w||{top:`top`,right:`right`,bottom:`bottom`,left:`left`,"inline-end":L?`left`:`right`,"inline-start":L?`right`:`left`}[i],z=o===`center`?R:`${R}-${o}`,B=l;typeof B==`number`?B={top:B,right:B,bottom:B,left:B}:B&&={top:B.top||0,right:B.right||0,bottom:B.bottom||0,left:B.left||0};let ee=+(i===`bottom`),te=+(i===`top`),ne=+(i===`right`),re=+(i===`left`),ie={boundary:c===`clipping-ancestors`?`clippingAncestors`:c,padding:B},V=g.useRef(null),ae=Vt(a),oe=Vt(s),se=typeof a==`function`?0:a,ce=typeof s==`function`?0:s,le=[];p&&le.push(p),le.push(Mi(e=>{let t=no(e,i,L),n=typeof ae.current==`function`?ae.current(t):ae.current,r=typeof oe.current==`function`?oe.current(t):oe.current;return{mainAxis:n,crossAxis:r,alignmentAxis:r}},[se,ce,L,i]));let ue=D===`none`&&E!==`shift`,H=!ue&&(u||k||E===`shift`),de=E===`none`?null:Fi({...ie,padding:{top:B.top+1+ee,right:B.right+1+re,bottom:B.bottom+1+te,left:B.left+1+ne},mainAxis:!k&&E===`flip`,crossAxis:D===`flip`&&`alignment`,fallbackAxisSideDirection:O}),fe=ue?null:Ni({...ie,rootBoundary:A,mainAxis:D!==`none`,crossAxis:H,limiter:u||k?void 0:Pi(e=>{if(!V.current)return{};let{width:t,height:n}=V.current.getBoundingClientRect(),r=Q(Z(e.placement)),i=r===`y`?t:n,a=r===`y`?B.left+B.right:B.top+B.bottom;return{offset:i/2+a/2}})},[ie,u,k,A,B,D]);E===`shift`||D===`shift`||o===`center`?le.push(fe,de):le.push(de,fe),le.push(Ii({...ie,apply({elements:{floating:e},availableWidth:t,availableHeight:n,rects:r}){if(!F.current)return;let i=e.style;i.setProperty($a,`${t}px`),i.setProperty(eo,`${n}px`);let a=I(e).devicePixelRatio||1,{x:o,y:s,width:c,height:l}=r.reference,u=(Math.round((o+c)*a)-Math.round(o*a))/a,d=(Math.round((s+l)*a)-Math.round(s*a))/a;i.setProperty(`--anchor-width`,`${u}px`),i.setProperty(`--anchor-height`,`${d}px`)}}),Xa(e=>({element:V.current||K(e.elements.floating).createElement(`div`),padding:d,offsetParent:`floating`}),[d]),{name:`transformOrigin`,fn(e){let{elements:t,middlewareData:n,placement:r,rects:o,y:s}=e,c=Z(r),l=Q(c),u=V.current,d=n.arrow?.x||0,f=n.arrow?.y||0,p=u?.clientWidth||0,m=u?.clientHeight||0,h=d+p/2,g=f+m/2,_=Math.abs(n.shift?.y||0),v=o.reference.height/2,y=typeof a==`function`?a(no(e,i,L)):a,b=_>y,x={top:`${h}px calc(100% + ${y}px)`,bottom:`${h}px ${-y}px`,left:`calc(100% + ${y}px) ${g}px`,right:`${-y}px ${g}px`}[c],S=`${h}px ${o.reference.y+v-s}px`;return t.floating.style.setProperty(`--transform-origin`,H&&l===`y`&&b?S:x),{}}},Za,x),G(()=>{!_&&h&&h.update({referenceElement:null,floatingElement:null,domReferenceElement:null,positionReference:null})},[_,h]);let pe=g.useMemo(()=>({elementResize:!f&&typeof ResizeObserver<`u`,layoutShift:!f&&typeof IntersectionObserver<`u`}),[f]),{refs:U,elements:me,x:he,y:ge,middlewareData:_e,update:ve,placement:ye,context:be,isPositioned:xe,floatingStyles:q}=t({rootContext:h,open:m?_:void 0,placement:z,middleware:le,strategy:r,whileElementsMounted:m?void 0:(...e)=>yi(...e,pe),nodeId:b,externalTree:C}),{sideX:Se,sideY:Ce}=_e.adaptiveOrigin||Qa,we=xe?r:`fixed`,Te=g.useMemo(()=>{let e;return e=xe?x?{position:we,[Se]:he,[Ce]:ge}:{...q,position:we}:{position:we,top:0,left:0},e[$a]=`100vw`,e[eo]=`100vh`,xe||(e.opacity=0),e},[x,we,Se,he,Ce,ge,q,xe]),Ee=g.useRef(null);G(()=>{if(!_)return;let e=P.current,t=typeof e==`function`?e():e,n=(ao(t)?t.current:t)||null;n!==Ee.current&&(U.setPositionReference(n),Ee.current=n)},[_,U,N,P]),g.useEffect(()=>{if(!_)return;let e=P.current;typeof e!=`function`&&ao(e)&&e.current!==Ee.current&&(U.setPositionReference(e.current),Ee.current=e.current)},[_,U,N,P]),g.useEffect(()=>{if(m&&_&&me.reference&&me.floating)return yi(me.reference,me.floating,ve,pe)},[m,_,me,ve,pe]);let De=Z(ye),Oe=to(i,De,L),ke=on(ye)||`center`,Ae=!!_e.hide?.referenceHidden;G(()=>{S&&_&&xe&&De!==R&&T(De)},[S,_,xe,De,R]);let je=g.useMemo(()=>({position:`absolute`,top:_e.arrow?.y,left:_e.arrow?.x}),[_e.arrow]),Me=_e.arrow?.centerOffset!==0;return g.useMemo(()=>({positionerStyles:Te,arrowStyles:je,arrowRef:V,arrowUncentered:Me,side:Oe,align:ke,physicalSide:De,anchorHidden:Ae,refs:U,context:be,isPositioned:xe,update:ve}),[Te,je,V,Me,Oe,ke,De,Ae,U,be,xe,ve])}function ao(e){return e!=null&&`current`in e}function oo(e){return e===`starting`?sr:s}function so(e,t,{styles:n,transitionStatus:r,props:i,refs:a,hidden:o,inert:s=!1}){let c={...n};return s&&(c.pointerEvents=`none`),l(`div`,e,{state:t,ref:a,props:[{role:`presentation`,hidden:o,style:c},oo(r),i],stateAttributesMapping:M})}function co(e){let[t,n]=g.useState({current:e,previous:null});return Object.is(e,t.current)||n({current:e,previous:t.current}),t.previous}function lo(e){let t=H(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=B(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r;return($t(n)!==a||$t(r)!==o)&&(n=a,r=o),{width:n,height:r}}function uo(e){let{popupElement:t,positionerElement:n,content:r,mounted:i,onMeasureLayout:a,onMeasureLayoutComplete:o,side:s,direction:l}=e,u=na(t,!0),d=Kt(),f=g.useRef(null),p=g.useRef(!0),m=g.useRef(c),h=W(a),_=W(o),v=g.useMemo(()=>fo(s,l),[s,l]);G(()=>{if(!i){m.current=c,p.current=!0,f.current=null;return}if(!t||!n)return;m.current=mo(t,v),ho(t,`auto`);let e=po(t,`position`,`static`),r=po(t,`transform`,`none`),a=po(t,`scale`,`1`),o=mo(n,{"--available-width":`max-content`,"--available-height":`max-content`});function s(){e(),r(),o()}function l(){s(),a()}if(h?.(),p.current||f.current===null){go(n,`max-content`);let e=lo(t);return f.current=e,go(n,e),l(),_?.(null,e),p.current=!1,()=>{m.current(),m.current=c}}go(n,`max-content`);let g=f.current,y=lo(t);f.current=y,ho(t,g),l(),_?.(g,y),go(n,y);let b=new AbortController;return d.request(()=>{ho(t,y),u(()=>{t.style.setProperty(`--popup-width`,`auto`),t.style.setProperty(`--popup-height`,`auto`)},b.signal)}),()=>{b.abort(),d.cancel(),m.current(),m.current=c}},[r,t,n,u,d,i,h,_,v])}function fo(e,t){let n=e===`top`,r=e===`left`||e===(t===`rtl`?`inline-end`:`inline-start`);return!n&&!r?s:{position:`absolute`,[n?`bottom`:`top`]:`0`,[r?`right`:`left`]:`0`}}function po(e,t,n){let r=e.style.getPropertyValue(t);return e.style.setProperty(t,n),()=>{e.style.setProperty(t,r)}}function mo(e,t){let n=[];for(let[r,i]of Object.entries(t))n.push(po(e,r,i));return n.length?()=>{n.forEach(e=>e())}:c}function ho(e,t){let n=t===`auto`?`auto`:`${t.width}px`,r=t===`auto`?`auto`:`${t.height}px`;e.style.setProperty(`--popup-width`,n),e.style.setProperty(`--popup-height`,r)}function go(e,t){let n=t===`max-content`?`max-content`:`${t.width}px`,r=t===`max-content`?`max-content`:`${t.height}px`;e.style.setProperty(`--positioner-width`,n),e.style.setProperty(`--positioner-height`,r)}var _o={name:`adaptiveOrigin`,async fn(e){let{x:t,y:n,rects:{floating:r},elements:{floating:i},platform:a,strategy:o,placement:s}=e,c=I(i),l=c.getComputedStyle(i);if(l.transitionDuration===`0s`||l.transitionDuration===``)return{x:t,y:n,data:Qa};let u=await a.getOffsetParent?.(i),d={width:0,height:0};if(o===`fixed`&&c?.visualViewport)d={width:c.visualViewport.width,height:c.visualViewport.height};else if(u===c){let e=K(i);d={width:e.documentElement.clientWidth,height:e.documentElement.clientHeight}}else await a.isElement?.(u)&&(d=await a.getDimensions(u));let f=Z(s),p=t,m=n;f===`left`&&(p=d.width-(t+r.width)),f===`top`&&(m=d.height-(n+r.height));let h=f===`left`?`right`:Qa.sideX,g=f===`top`?`bottom`:Qa.sideY;return{x:p,y:m,data:{sideX:h,sideY:g}}}},vo={activationDirection:e=>e?{"data-activation-direction":e}:null};function yo(e){let{store:t,side:n,children:r}=e,i=Ja(),a=t.useState(`activeTriggerElement`),o=t.useState(`activeTriggerId`),s=t.useState(`open`),c=t.useState(`payload`),l=t.useState(`mounted`),u=t.useState(`popupElement`),d=t.useState(`positionerElement`),f=co(s?a:null),p=Co(o,c),m=g.useRef(null),[h,v]=g.useState(null),[y,b]=g.useState(null),x=g.useRef(null),S=g.useRef(null),C=na(x,!0),w=Kt(),T=g.useRef(null),[E,D]=g.useState(null),[O,k]=g.useState(!1);G(()=>(t.set(`adaptiveOrigin`,_o),()=>{t.set(`adaptiveOrigin`,void 0)}),[t]);let A=W(()=>{x.current?.style.setProperty(`animation`,`none`),x.current?.style.setProperty(`transition`,`none`),S.current?.style.setProperty(`display`,`none`)}),j=W(e=>{x.current?.style.removeProperty(`animation`),x.current?.style.removeProperty(`transition`),S.current?.style.removeProperty(`display`),e&&D(e)}),M=W(()=>{T.current?.abort();let e=new AbortController;T.current=e,C(()=>{v(null),D(null),m.current=null},e.signal)}),N=g.useRef(null);G(()=>{(!s||!l)&&(N.current=null)},[s,l]),G(()=>{if(a&&f&&a!==f&&N.current!==a&&m.current){v(m.current),k(!0);let e=So(f,a);b(e),N.current=a}},[a,f]),G(()=>{h!=null&&(T.current?.abort(),k(!0),w.request(()=>{or.flushSync(()=>{k(!1)}),M()}))},[p,h,M,w]),G(()=>{let e=x.current;if(!e)return;let t=K(e).createElement(`div`);for(let n of Array.from(e.childNodes))t.appendChild(n.cloneNode(!0));m.current=t});let P=h!=null,F;F=P?(0,_.jsxs)(g.Fragment,{children:[(0,_.jsx)(`div`,{"data-previous":!0,inert:Ga(!0),ref:S,style:{...E?{"--popup-width":`${E.width}px`,"--popup-height":`${E.height}px`}:null,position:`absolute`},"data-ending-style":O?void 0:``},`previous`),(0,_.jsx)(`div`,{"data-current":!0,ref:x,"data-starting-style":O?``:void 0,children:r},p)]}):(0,_.jsx)(`div`,{"data-current":!0,ref:x,children:r},p),G(()=>{let e=S.current;!e||!h||e.replaceChildren(...Array.from(h.childNodes))},[h]),uo({popupElement:u,positionerElement:d,mounted:l,content:c,onMeasureLayout:A,onMeasureLayoutComplete:j,side:n,direction:i});let I={activationDirection:bo(y),transitioning:P};return{children:F,state:I}}function bo(e){if(e)return`${xo(e.horizontal,5,`right`,`left`)} ${xo(e.vertical,5,`down`,`up`)}`}function xo(e,t,n,r){return e>t?n:e<-t?r:``}function So(e,t){let n=e.getBoundingClientRect(),r=t.getBoundingClientRect(),i={x:n.left+n.width/2,y:n.top+n.height/2},a={x:r.left+r.width/2,y:r.top+r.height/2};return{horizontal:a.x-i.x,vertical:a.y-i.y}}function Co(e,t){let[n,r]=g.useState(0),i=g.useRef(e),a=g.useRef(t),o=g.useRef(!1);return G(()=>{let n=i.current,s=a.current,c=e!==n,l=t!==s;c?(r(e=>e+1),o.current=!l):o.current&&l&&(r(e=>e+1),o.current=!1),i.current=e,a.current=t},[e,t]),`${e??`current`}-${n}`}export{_r as $,it as $t,fa as A,Ve as An,Bt as At,Ui as B,B as Bn,Et as Bt,aa as C,Ce as Cn,Sn as Ct,ha as D,Se as Dn,Gt as Dt,ma as E,Be as En,Yt as Et,$i as F,F as Fn,Mt as Ft,Or as G,M as Gn,_t as Gt,gi as H,te as Hn,xt as Ht,Zi as I,U as In,At as It,Tr as J,A as Jn,pt as Jt,kr as K,N as Kn,ht as Kt,Xi as L,fe as Ln,Nt as Lt,na as M,G as Mn,It as Mt,ta as N,W as Nn,Pt as Nt,oa as O,q as On,Kt as Ot,ea as P,H as Pn,Dt as Pt,yr as Q,p as Qn,ot as Qt,Ki as R,I as Rn,Tt as Rt,ua as S,be as Sn,kn as St,pa as T,Le as Tn,Jt as Tt,Nr as U,ee as Un,St as Ut,Li as V,ue as Vn,wt as Vt,Ar as W,w as Wn,Ct as Wt,Sr as X,C as Xn,ut as Xt,Er as Y,b as Yn,ft as Yt,br as Z,h as Zn,lt as Zt,Ea as _,Oe as _n,On as _t,oo as a,Ke as an,ar as at,sa as b,Pe as bn,jn as bt,Ka as c,Ie as cn,Kn as ct,La as d,Me as dn,Qn as dt,st as en,dr as et,Fa as f,Re as fn,$n as ft,ba as g,De as gn,Dn as gt,ya as h,ze as hn,qn as ht,so as i,qe as in,mr as it,ra as j,K as jn,X as jt,ga as k,xe as kn,Vt as kt,Ga as l,Ee as ln,Yn as lt,Da as m,Ae as mn,Gn as mt,yo as n,Ze as nn,pr as nt,ro as o,J as on,ir as ot,Pa as p,je as pn,er as pt,Dr as q,j as qn,gt as qt,co as r,Je as rn,fr as rt,Ja as s,He as sn,rr as st,vo as t,Xe as tn,cr as tt,Wa as u,Te as un,Xn as ut,_a as v,ke as vn,En as vt,la as w,Fe as wn,Xt as wt,da as x,Ne as xn,wn as xt,ia as y,we as yn,Tn as yt,Hi as z,z as zn,Y as zt};