@zeniai/web-cockpit-ui 1.14.19-dev → 1.14.19-dev-betaSK01
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.
- package/dist/assets/ACHDetailsPage-TewccRkX-DetITKOl.js +21 -0
- package/dist/assets/{AIPerformancePage-BuQApbEf-iP9bvKhu.js → AIPerformancePage-CJ0myi1p-CyCBKn16.js} +63 -63
- package/dist/assets/AccountInfoPage-CuytgM09-DMWlq-IF.js +18 -0
- package/dist/assets/{AccountInfoPageContent-DQJFmREl-DoaILqqU.js → AccountInfoPageContent-CVV20YhW-q-TI4Dr6.js} +18 -18
- package/dist/assets/{AccountReconDetailsDrawerPage-D2B9Na3--BPjptdtd.js → AccountReconDetailsDrawerPage-CNT6qZyD-ZHVZJgF9.js} +17 -17
- package/dist/assets/{AccountRow-ZcS_RTJN-DNHX6IR1.js → AccountRow-COaolUm5-Bsrm5YYV.js} +40 -40
- package/dist/assets/{AccountsPromoCardStack-Bh2D-mXh-Yx4rUExR.js → AccountsPromoCardStack-BOmk5qYk-Bnozn1QW.js} +37 -37
- package/dist/assets/{AddAddressForCardDrawer-Ds2V5DyG-D2Tq6L1d.js → AddAddressForCardDrawer-DQN-6ztS-C4C6h_V9.js} +2 -2
- package/dist/assets/{AddToWalletPage-DQ_gwAcu-Bv5nxp9i.js → AddToWalletPage-CT9nivqI-BnXCEk6P.js} +122 -122
- package/dist/assets/{AgingReportsPage-BU_tqV13-C2Yi_y38.js → AgingReportsPage-DGzFK69_-DgqwpnRI.js} +15 -15
- package/dist/assets/{AllUserItems-DBXzXO61-sIPVSbAT.js → AllUserItems-diZQlFqb-DwUtiew2.js} +17 -17
- package/dist/assets/{ApAgingDetailPage-Crv9EDe5-Dm92urnR.js → ApAgingDetailPage-CtXSUVGC-DdWwytoq.js} +3 -3
- package/dist/assets/AppBasePage-D6MgS-da-2jH4Fzgr.js +70 -0
- package/dist/assets/{AppDrawerContent-rw39Hn3s-Aoghs5SQ.js → AppDrawerContent-Z3Hny9GH-BBS5jJHD.js} +59 -46
- package/dist/assets/ApprovalRulesSettingsPage-BwnaDPqA-BMHJ2n3v.js +47 -0
- package/dist/assets/ArAgingChart-BvG_iPlt-BYubF9ZD.js +24 -0
- package/dist/assets/ArAgingDetailPage-Sm4672LS-o1itnQt5.js +46 -0
- package/dist/assets/{AttachmentView-BTAMhgXU-BizBD4c6.js → AttachmentView-ChlYn2cr-DueA245P.js} +8 -8
- package/dist/assets/AuditReportDrawerPage-CaFo0k9s-NaTvWx96.js +369 -0
- package/dist/assets/{BankAccountSection-DVO3xzgl-BbF3_Xvy.js → BankAccountSection-DdvqFTBS-3WhABy0l.js} +7 -7
- package/dist/assets/{BankAccountWarningSection-CQsqUFKg-CEwje_vW.js → BankAccountWarningSection-VrRQxdkB-DFivrjf8.js} +10 -10
- package/dist/assets/{BankConnectionsSettingsPage-CEyhk8v--D1MZcFK5.js → BankConnectionsSettingsPage-D1Y3V93C-Bfvr_pF_.js} +23 -23
- package/dist/assets/{BillDetailPage-CP6QCrla-C-q234bH.js → BillDetailPage-XL8GxSiQ-Cxb-3w9d.js} +18 -18
- package/dist/assets/{BillPayApprovalRuleDetailPage-Bem5LvtY-ByYY2uP-.js → BillPayApprovalRuleDetailPage-wIEW2R5G-CC_GZTsX.js} +2 -2
- package/dist/assets/{BillPayApprovalRulesPage-DhDaCfQa-cqstNfVf.js → BillPayApprovalRulesPage-kGddvG8V-rTKT6DIU.js} +9 -9
- package/dist/assets/{BillPayPromoPage-BjH9lvnR-7aNAb2i3.js → BillPayPromoPage-VBLYqFtx-CSmxPHYz.js} +10 -10
- package/dist/assets/BillPaySetUpPage-CTNtHQBM-CpoUfnMM.js +42 -0
- package/dist/assets/BillingSettingsPage-CR0doM6R-DRs8JS8S.js +44 -0
- package/dist/assets/BillsBulkReviewDrawerPage-B0ebreRX-D7v6qOnU.js +1 -0
- package/dist/assets/{BoxItem-BL-UVx2X-CDUWJCC4.js → BoxItem-DJq3mny1-nPTLB__B.js} +4 -4
- package/dist/assets/BusinessVerificationPage-B6lyqGIK-BfLlNZ0a.js +140 -0
- package/dist/assets/BusyIndication-_H8LL7GJ-BjR55KdD.js +9 -0
- package/dist/assets/{CardNumberSubText-CNMNL0y--CRLH2YxV.js → CardNumberSubText-Bo_ZeAR0-DocU3odv.js} +4 -4
- package/dist/assets/{CashbackDetailPage-Cj26I5CB-DNKm6NdF.js → CashbackDetailPage-0Yl3lHzq-CJUtuV5y.js} +31 -31
- package/dist/assets/{ChargeCardDetailPage-herJK06r-Jj0sML3r.js → ChargeCardDetailPage-BaceF_92-G63YAG6z.js} +78 -78
- package/dist/assets/{ChargeCardListPage-LYVKm-0u-CGVPXLUW.js → ChargeCardListPage-_YORyJOy-uqdfjUZk.js} +37 -37
- package/dist/assets/{ChargeCardListTable-DxE-nRR4-Dc_afx90.js → ChargeCardListTable-DE1xnRyd-D2F1GAJW.js} +62 -62
- package/dist/assets/ChargeCardPromoPage-DO2UJyXm-Dwx7STGG.js +222 -0
- package/dist/assets/ChargeCardSetupPage-De5jDB3D-CMdmpmLu.js +36 -0
- package/dist/assets/{ChargeCardStatementsPage-DkCHd5c6-y_ZysAG_.js → ChargeCardStatementsPage-bpyamxR5-WxHdE5xc.js} +9 -9
- package/dist/assets/ChargeCardUtils-DYpmF85C-qBaPG14m.js +1 -0
- package/dist/assets/{ChaseOverlay-N7gGQaMQ-Bh9lkzpe.js → ChaseOverlay-YVpKSII6-BIyjTgCz.js} +10 -10
- package/dist/assets/CheckDepositDrawerPage-Dj2do0Un-DCNBKUNr.js +206 -0
- package/dist/assets/{CollapsableReportTable-NSlKGCNZ-9GlkRzVX.js → CollapsableReportTable-CDe76ha7-3Q7qsS_e.js} +18 -18
- package/dist/assets/{CompanyOfficerDetailsSection-C1IpMsWw-4riCbcJi.js → CompanyOfficerDetailsSection-CeVdKqY7-DWrcELqw.js} +25 -25
- package/dist/assets/{CompanyPassportCard-D5gkzDNU-DdCNWaie.js → CompanyPassportCard-O7LbMSSb-D53wb0da.js} +8 -8
- package/dist/assets/{CompanyPassportPage-6_6yWHxX-BzKkvM2X.js → CompanyPassportPage-B05q2F4S-DiyGLc2N.js} +154 -154
- package/dist/assets/CompleteProfile-B_dl9xEx-DFZ3KU15.js +52 -0
- package/dist/assets/ConfettiBurst-ChCmpiHq-BBDSx_jo.js +1 -0
- package/dist/assets/ControlledCheckBoxField-BIqM2o6X-Ml88Uf7U.js +74 -0
- package/dist/assets/{CreateOrEditVendorPage-DQW4Wobx-CiIXGaQB.js → CreateOrEditVendorPage-BZ6ZfaSo-Dn1DLrma.js} +15 -15
- package/dist/assets/{CreditCardPaymentDrawerPage-BEpQXn9g-DzfCHeLI.js → CreditCardPaymentDrawerPage-cABpaIqh-BIRd807Z.js} +16 -16
- package/dist/assets/{CreditCardPaymentPlgSection-BGh2TJeK-DFQxSPk-.js → CreditCardPaymentPlgSection-BgJ074tY-CfzZdzTd.js} +11 -11
- package/dist/assets/{CurrencySelectField-C2if0NUa-ChKY5K5U.js → CurrencySelectField-BfgtNimH-BYHOS_CH.js} +6 -6
- package/dist/assets/{CustomerOnboardingActivationPage-_zjv9RZY-5MkPCW8D.js → CustomerOnboardingActivationPage-Czg8rmEW-YInlsWzY.js} +4 -4
- package/dist/assets/CustomerOnboardingContainerPage-Ciaw11Nw-O_DtjvXM.js +1 -0
- package/dist/assets/{CustomerOnboardingDetailPageSkeleton-CXApNm6A-BSR-PhTi.js → CustomerOnboardingDetailPageSkeleton-DtYTYPnO-DzMzbH73.js} +17 -17
- package/dist/assets/CustomerOnboardingNoStepsPage-CdOEZjmC-HqvGWI7K.js +66 -0
- package/dist/assets/{CustomerOnboardingPage-CWpmMXrh-CRkiPpz7.js → CustomerOnboardingPage-CXZCAc_N-BfMJFDq7.js} +10 -10
- package/dist/assets/{CustomerOnboardingProductSuitePage-CGYRoz3v-BhEGdWj7.js → CustomerOnboardingProductSuitePage-ucFJ1PHr-BwZiAWEx.js} +10 -10
- package/dist/assets/{Dashboard-Dyt4nvyG-CkNduEQV.js → Dashboard-CAWL19Rr-CvQLInkH.js} +229 -229
- package/dist/assets/{DashboardReportPage-BSbTlRwW-gHAkcokq.js → DashboardReportPage-DYgKY1Ns-_VZzH9Ck.js} +27 -27
- package/dist/assets/DashboardSidebarBackgroundAnimation-CblfOXOJ-B4cbMZpc.js +12 -0
- package/dist/assets/{DepositAccTransactionItem-CuTp6qxI-Ce2SFbUX.js → DepositAccTransactionItem-DeOMizAI-BUL1onQj.js} +10 -10
- package/dist/assets/DepositAccTransactionListPage-2kpIHXLb-j8eQ9Syw.js +66 -0
- package/dist/assets/{DomesticWireDetailsPage-C5hxxGsr-D-EvElMb.js → DomesticWireDetailsPage-FsJvVULE-cMWuJpE8.js} +1 -1
- package/dist/assets/{DownloadOverlay-B9O7jf-4-BeIpOSC8.js → DownloadOverlay-CVCKyDWO-CyzPCm3f.js} +40 -40
- package/dist/assets/{DrawerPage-Dpd6lRf7-l9nV_5N2.js → DrawerPage-l697kk-T-C0lMqvCR.js} +14 -14
- package/dist/assets/EditPeoplePage-CwhUp4W2-CnFSjC3L.js +55 -0
- package/dist/assets/{EditReimbursementDetailPage-BL-W1hPs-D4iR-8Yt.js → EditReimbursementDetailPage-COuH1JPm-DF1XIZnj.js} +68 -68
- package/dist/assets/EmptySearchResults-CB9-FwYT-DCczU5qh.js +46 -0
- package/dist/assets/EntityDetailPage-BqjWJTDI-qcUtYQZh.js +18 -0
- package/dist/assets/{EntitySummarySection-eNxIwvHt-CkeObU85.js → EntitySummarySection-B1zP9dKH-kkSLVqaS.js} +10 -10
- package/dist/assets/ExpenseAutomationOverviewPage-CKokJTC4-C9VvWXen.js +222 -0
- package/dist/assets/{ExpenseAutomationPage-LPWPrpwm-T8iyqKP1.js → ExpenseAutomationPage-DP0P07VH-DhP4-CZe.js} +91 -91
- package/dist/assets/{ExpressPayPage-COQrt-KL-sn6b2-XB.js → ExpressPayPage-CuuS2EDn-D3uvvYo2.js} +9 -9
- package/dist/assets/{FeaturePreviewPage-Coe53hoK-Doq3zPCz.js → FeaturePreviewPage-D90G_5Q8-CnQvTfz2.js} +2 -2
- package/dist/assets/{FollowStepsSection-BJFJzQrz-CGmrm9Lr.js → FollowStepsSection-DbS5XlIB--DgM9Akw.js} +10 -10
- package/dist/assets/{GlobalReviewListPage-DDQb-plt-B7MJAdcL.js → GlobalReviewListPage-D1a2gbca-BjGUSD3w.js} +13 -13
- package/dist/assets/Header-DLZFUQF8-BI2bQ6MH.js +226 -0
- package/dist/assets/HealthListRow-iF093_lw-DegqmjBi.js +210 -0
- package/dist/assets/HealthMonitorDetailDrawer-BJRgJJOH-BzVkHFE6.js +401 -0
- package/dist/assets/HealthMonitorPage-BT0gIPV6-BAgQvawR.js +108 -0
- package/dist/assets/{HelpButton-BT_HyQ5k-B4E1vZtk.js → HelpButton-Dw0OujKs-8AApGgt1.js} +7 -7
- package/dist/assets/{InformationCardStack-B9E29_zj-DokGK6g8.js → InformationCardStack-QA9nEJlH-BHcB9j6E.js} +4 -4
- package/dist/assets/{InsightsCardStack-7XbkZ-A3-BxqeB-iN.js → InsightsCardStack-DKM6Xigy-B12rMXAv.js} +13 -13
- package/dist/assets/InsightsSection-DxpsNIIy-D73VhmA2.js +27 -0
- package/dist/assets/IntegrationsSettingsPage-DEOHHrS4-xD8BgFGo.js +57 -0
- package/dist/assets/{InternationalWireSwiftDetailsPage-BeSYu2Dm-y3Tu_Xyi.js → InternationalWireSwiftDetailsPage-KC-9TwlR-DtVQ4upN.js} +17 -17
- package/dist/assets/{InternationalWireVerificationPage-Ctcaggen-Cihfrd35.js → InternationalWireVerificationPage-D59omOr2-BqyFDoPr.js} +17 -17
- package/dist/assets/InviteFormPage-CU5_JoYd-DtlUlrhp.js +312 -0
- package/dist/assets/{InvitePageListView-BMMOpM9O-B8oUxVru.js → InvitePageListView-BO-RmmHm-B9WEWx8n.js} +55 -55
- package/dist/assets/InvitePeoplePage-Btu9ayOz-bG-WZTzF.js +12 -0
- package/dist/assets/{InvoiceUploadSection-C6Dx8Web-CBeOBAnd.js → InvoiceUploadSection-CibgDVMW-Ct_Yqg-6.js} +9 -9
- package/dist/assets/{IssueChargeCardPage-DWRhiOzj-DCnENqBq.js → IssueChargeCardPage-CB5DhzQb-Dowc3uml.js} +75 -75
- package/dist/assets/LabeledAddressValue-tO6Kg-ki-DIZXgDEF.js +49 -0
- package/dist/assets/LabeledAddressValueField-CkveEJJG-BEvwzrCB.js +45 -0
- package/dist/assets/LabeledControlledCheckBoxField-B50HdRDc-BPCXXpG-.js +16 -0
- package/dist/assets/{LabeledCreatableSingleSelectField-CTwToXIo-Cle-L6Nt.js → LabeledCreatableSingleSelectField-CIhXQBns-C3KOt5qj.js} +5 -5
- package/dist/assets/LabeledDocumentField-B8uyJA2N-B3iZ1bpr.js +41 -0
- package/dist/assets/{LabeledDropDownFormattedTextField-mOxkCT-G-CFeF0x5h.js → LabeledDropDownFormattedTextField-pClUx8A9-Dtg8BoKW.js} +4 -4
- package/dist/assets/LabeledEmailInputField-D5OBo0RU-Cn7DEiyr.js +182 -0
- package/dist/assets/LabeledGroupedCheckBoxField-DLSgfRui-CIvqEp4U.js +82 -0
- package/dist/assets/LabeledItemWithButton-CNlRAl-1-D8RdmCNz.js +21 -0
- package/dist/assets/LabeledNameField-B73hOD1K-DrzOl55q.js +141 -0
- package/dist/assets/LabeledSingleSelectField-nPVDbcr0-DXhzL0iF.js +136 -0
- package/dist/assets/LabeledSingleSelectWithoutClearableField-DgT7faZC-Or3zfyeO.js +38 -0
- package/dist/assets/{LabeledText-CExeogkg-361xlNV7.js → LabeledText-CW-bei7--hAClqsQN.js} +3 -3
- package/dist/assets/{LabeledUserSingleSelectWithSubtitlesField-DrloYoze-DB50WeN3.js → LabeledUserSingleSelectWithSubtitlesField-DZUt2T7b-B09ph3mF.js} +15 -15
- package/dist/assets/{LabeledZeniRolesDropDownField-BZKMSlzI-B3-a-Sde.js → LabeledZeniRolesDropDownField-DNZUBYDP-ltAbPko_.js} +11 -11
- package/dist/assets/LinkJETransactionPage-ChyKb7xl-LR_CFAXE.js +98 -0
- package/dist/assets/Loader-Cqmoylhp-CKPikayq.js +32 -0
- package/dist/assets/{LowBalancePopup-DqY0lHvk-Bg-BhJJe.js → LowBalancePopup-DcVkWdb3-vRNfAVIB.js} +6 -6
- package/dist/assets/{MagicLinkACHDetailsPage-BctRnNGY-DEYW76Ne.js → MagicLinkACHDetailsPage-B3NEKP0z-DUbPO0xw.js} +1 -1
- package/dist/assets/{MagicLinkDomesticWireDetailsPage-UjO7TGNI-jNwBg57q.js → MagicLinkDomesticWireDetailsPage-SvX8hE_J-6LOmcKRH.js} +1 -1
- package/dist/assets/{MagicLinkInternationalWireDetailsPage-ex7nPlxc-Cv717ajH.js → MagicLinkInternationalWireDetailsPage-DnrUY7JS-nyREbLmz.js} +1 -1
- package/dist/assets/MagicLinkSuccessPage-7bTkYgEa-CPPkAGGs.js +31 -0
- package/dist/assets/MagicLinkTitleSection-BlxCsth7-BHITpmKu.js +17 -0
- package/dist/assets/{MailingDetailsSection-D7d7fV5j-Cs19YBt0.js → MailingDetailsSection-DFxnpK8F-CiXDBg4h.js} +1 -1
- package/dist/assets/ManagementPage-D5egEDwP-uTkBBFJq.js +556 -0
- package/dist/assets/MatchingOperatorDropdown-C5zSNKmV-DBpzsPUC.js +130 -0
- package/dist/assets/{MeetingCalenderPopup-C-Ca0puH-BuYhTZNY.js → MeetingCalenderPopup-LNaVbSrR-TEQEw5Mb.js} +3 -3
- package/dist/assets/{Menu-FcKyIIWS-5DaRICk4.js → Menu-BCNEnlpd-D3With3F.js} +3 -3
- package/dist/assets/MonthEndEmailDrawerCustomerRequestPage-CK7yjkYx-Dj2GK4HO.js +39 -0
- package/dist/assets/MonthEndReportHistoricDataPage-BuRBd_9k-DDKlEI2q.js +124 -0
- package/dist/assets/MonthEndReportPage-DOTCU96W-VybM2w9h.js +28 -0
- package/dist/assets/MoreMenuButton-Cj6SIPVt-CYCCFBqM.js +134 -0
- package/dist/assets/{MyBankConnectionsSettingsPage-B4NuqJVI-C5C-Tkbz.js → MyBankConnectionsSettingsPage-DCURGC-R-BMFNqNjE.js} +13 -13
- package/dist/assets/MyPendingActivationChargeCardListPage-BFe1hoDt-CfBCldAO.js +6 -0
- package/dist/assets/MyProfileSettingsPage-B7zND-Ux-BN19QlhA.js +85 -0
- package/dist/assets/NavBar-BjyxKUvF-gwYjTp7H.js +189 -0
- package/dist/assets/{NavBarWithPicker-Bu03gVw7-BBANsf51.js → NavBarWithPicker-CBOGjIl3-ajX8qLcM.js} +6 -6
- package/dist/assets/NavHeader-9VET6uub-DBlTa1KF.js +236 -0
- package/dist/assets/{NavigationArrow-D7Eb-FlF-DFK_OGPD.js → NavigationArrow-C6KDDKXh-BuGIAK_3.js} +2 -2
- package/dist/assets/{NavigationDots-CFjUchuX-BbVX67wD.js → NavigationDots-CGOsNTLj-ZRX96j5F.js} +1 -1
- package/dist/assets/{NewGlobalMerchantPage-rhhm0o-f-DpBge9cX.js → NewGlobalMerchantPage-C478pZIu-cHWkOmAB.js} +11 -11
- package/dist/assets/{NoDataChart-D5DKMqIS-BEaaizBY.js → NoDataChart-BSoXaJD0-JxM1S3Cy.js} +8 -8
- package/dist/assets/{NoDataTable-CPEKYH-4-ChRW7vff.js → NoDataTable-iH1r029I-DLkBIcoK.js} +1 -1
- package/dist/assets/{NotFoundPage-Cfk62GPw-D375IgXA.js → NotFoundPage-BQLKWvT9-wlLCbXww.js} +6 -6
- package/dist/assets/{NotificationSettingsPage-BZtsKPBO-AXQQWsyF.js → NotificationSettingsPage-R7veJvze-BqnLD-ld.js} +25 -25
- package/dist/assets/NotificationsListConfig-CyQxEQ13-D7e4Z7fR.js +1 -0
- package/dist/assets/{NotificationsPage-CgABP7O1-BFGmWSCt.js → NotificationsPage-D_vooxhV-BtfMVNB5.js} +60 -60
- package/dist/assets/OnboardingCustomerPage-jmb-3M9K-C-4WzmwX.js +476 -0
- package/dist/assets/OnboardingPage-LCaIErMj-Bhag4ahh.js +408 -0
- package/dist/assets/{OpExByVendorPage-CMEokGbw-5aOd51kS.js → OpExByVendorPage-DWCdLRPc-peo3zX7H.js} +14 -14
- package/dist/assets/{OverlayContainerPage-9K5jaX8Z-DmDVJorJ.js → OverlayContainerPage-1M2CZQoK-DROfCTrK.js} +1 -1
- package/dist/assets/PandLWithForecastPage-3h8Q4kZg-CZgSqzQW.js +107 -0
- package/dist/assets/{PaymentAccountSetupBillingAddressSection-D6cW0hFS-DO3Osr4s.js → PaymentAccountSetupBillingAddressSection-YLuS3VUf-CaBoPPAw.js} +10 -10
- package/dist/assets/{PeoplePage-lD4QPAkF-28PZT7ir.js → PeoplePage-CRZ7ywRU-CZLazd8w.js} +36 -36
- package/dist/assets/{PortfolioAllocationFormPage-pynkIQMX-BFz04Oo7.js → PortfolioAllocationFormPage-QP1Aoj30-7H62H89u.js} +13 -13
- package/dist/assets/{PortfolioDetails-Cs8o8xzm-bO5l1T7Z.js → PortfolioDetails-DOlYfVij-TNjtwW2_.js} +42 -42
- package/dist/assets/PortfolioPage-BfNGByGB-ea6OEgaP.js +237 -0
- package/dist/assets/{ProductsCarousel-vPy7zk53-DjiVBmpl.js → ProductsCarousel-CzJnAk3w-MortVhyi.js} +10 -10
- package/dist/assets/{PromoBaseCards-CWGpTa57-Bj-bRm1l.js → PromoBaseCards-CLKhsYfl-BEkL1oHo.js} +4 -4
- package/dist/assets/{QBOConnectionDialog-66XnPKaW-8EXYy72U.js → QBOConnectionDialog-CiAUTeD2-D061mOJX.js} +10 -10
- package/dist/assets/QBOSetupSection-D-Q_DVva-q5JlqA-2.js +79 -0
- package/dist/assets/{ReimbursementApprovalRuleDetailPage-BSI9Lg6a-wX6i8H_B.js → ReimbursementApprovalRuleDetailPage-DCzX_1-a-BNW7pXC_.js} +1 -1
- package/dist/assets/{ReimbursementApprovalRulesPage-XxC6pXqt-Bzz5uq1t.js → ReimbursementApprovalRulesPage-DfHVzdAB-hV-2mfna.js} +9 -9
- package/dist/assets/{ReimbursementDetailPage-BwtY21D5-BOkbylET.js → ReimbursementDetailPage-Di8XpCvg-B7b0ZH64.js} +17 -17
- package/dist/assets/{ReimbursementPromoPage-CmO1DP-8-DpBTbSy4.js → ReimbursementPromoPage-CJSuqONm-DlocTKyV.js} +24 -24
- package/dist/assets/ReimbursementSetUpPage-5OtsfDPV-DQz8dNtG.js +140 -0
- package/dist/assets/ReimbursementsBulkReviewDrawerPage-BX722SXa-YTQZVgWe.js +1 -0
- package/dist/assets/{ReloadCard-CJfjUA_Q-iqgRrGxj.js → ReloadCard-BuBuLupE-Cty15m_t.js} +5 -5
- package/dist/assets/ReloadContainer-BRXUxBxu-BAp5l7-f.js +13 -0
- package/dist/assets/ReloadContainer-fx3kImdJ-D2lKf-Yd.js +17 -0
- package/dist/assets/ReportTableViewSelector-W7zYmKIW-BpJdvlc6.js +150 -0
- package/dist/assets/{ReportsPage-BJqldqjR-p6MwUSO1.js → ReportsPage-R29_iuow-B4_GPbvP.js} +6 -6
- package/dist/assets/{RevenueChart-BUnSkoUN-CWdeY5GO.js → RevenueChart-D3r_Mgmm-XyYx-Hfz.js} +1 -1
- package/dist/assets/{ReviewDetailsPage-8I09Puca-B9BkrydV.js → ReviewDetailsPage-Cimq9su3-CRN9WHDV.js} +20 -20
- package/dist/assets/ReviewOverlay-Bz1kr6zu-Dw4JE5ud.js +152 -0
- package/dist/assets/ReviewPage-Cel3qzEQ-DiaZxW5f.js +306 -0
- package/dist/assets/RoleWithToolTip-CUogd8qi-BfjjZiS9.js +22 -0
- package/dist/assets/{ScheduleDetailsFixedAssetsPage-1Y1ZylI7-BDsLy1RB.js → ScheduleDetailsFixedAssetsPage-Cbe0zp9o-DxmW_LFp.js} +13 -13
- package/dist/assets/{ScheduleDetailsPage-BcRuA_7y-mmMtrxsU.js → ScheduleDetailsPage-DxmJdx3I-Bant9wup.js} +3 -3
- package/dist/assets/{ScheduleSequenceTable-DC75D2Dx-BSdJrIG_.js → ScheduleSequenceTable-srpDx2n6-l1UT781V.js} +28 -28
- package/dist/assets/{ScreenRoutes-DRpA2l4T.js → ScreenRoutes-DPjLo75W.js} +1 -1
- package/dist/assets/SetUpAccountSection-2UGQI7fx-D_tNKXyG.js +378 -0
- package/dist/assets/{SetUpDefaultSection-a6NTauck-C-i38hil.js → SetUpDefaultSection-BWt_kYKx-Dc8telSj.js} +15 -15
- package/dist/assets/{SignIn-_ZPdER_K-0cn49L67.js → SignIn-BF4ojxcy-ignSyaGW.js} +21 -21
- package/dist/assets/SignInScreen-DjQXT0cG.js +1 -0
- package/dist/assets/SpendManagementListViewPage-DbfQ_jzA-sW1BTRjR.js +123 -0
- package/dist/assets/{SpendManagementPerTabPage-CbjC0IBF-BthyUtDp.js → SpendManagementPerTabPage-CZaPjNjx-Bhxn4ZLQ.js} +64 -64
- package/dist/assets/{SpendManagementSection-BKTkeRK6-DIa3Rn7O.js → SpendManagementSection-atmLAM4T-DeXVF-9S.js} +22 -22
- package/dist/assets/{SpendMgmtSetupAccountSection-D8Yv-Jng-D3WoppPf.js → SpendMgmtSetupAccountSection-h6duObCp-PJLwXWd-.js} +21 -21
- package/dist/assets/{StatementItem-DSJvKpAv-DV7N47r3.js → StatementItem-DgZtQdC5-CijP321B.js} +4 -4
- package/dist/assets/StatementsPage-Az4ZzxA6-CY7Q-Hv-.js +58 -0
- package/dist/assets/{StatusSwitcher-CTDNbKqC-Bv4PZo8C.js → StatusSwitcher-BTTEP3yZ-DwSqL8zG.js} +2 -2
- package/dist/assets/StatusTag-MQXQGj2--SPp-Hljk.js +38 -0
- package/dist/assets/{SubTabSwitcher-D33kV-tw-BTeEHhHa.js → SubTabSwitcher-BedfItte-C-XhL99Y.js} +6 -6
- package/dist/assets/SubscriptionAddPlanPage-Bn4CUx_v-BcoEoxy8.js +59 -0
- package/dist/assets/SubscriptionDetailPage-BZDJEjR1-DavSO9K8.js +216 -0
- package/dist/assets/SubscriptionPage-Tpj1RZco-CfI0x1AO.js +282 -0
- package/dist/assets/SubscriptionSnackBar-CwdSE1Xz-BYx3vQ0D.js +57 -0
- package/dist/assets/SubscriptionSummaryPage-Dep_cm58-D3JscAEe.js +176 -0
- package/dist/assets/SubscriptionUpdatePlanPage-5_wWKxme-CSTH4683.js +408 -0
- package/dist/assets/SuccessAnimation-BtFsm6Oj-BU_bae75.js +13 -0
- package/dist/assets/{SummaryCard-tsJZnge3-DE5AVV4x.js → SummaryCard--FoJZECU-DjUF26i-.js} +1 -1
- package/dist/assets/TaskDetailPage-aleDjLBo-DJGRUSEM.js +775 -0
- package/dist/assets/TaskListRow-xLyzXOYn-CLZGelcY.js +403 -0
- package/dist/assets/{TaskManagementPage-BW9M6AQs-DyLPADr6.js → TaskManagementPage-DchOWpNF-n_asmH-l.js} +41 -41
- package/dist/assets/TaskManagerPage-Dye8P0ua-jLCJwLcT.js +176 -0
- package/dist/assets/TextHighlightSection-Y0L_w9RR-D8_NKTqM.js +584 -0
- package/dist/assets/{TimeRangeSwitcher-CkXysnFa-BxX2v8T-.js → TimeRangeSwitcher-RLCCDvSp-DYQOEgth.js} +2 -2
- package/dist/assets/{TimeframeSwitcher-B-S09J4A-MdxeQVLH.js → TimeframeSwitcher-DABwUJSm-DPkuAUy9.js} +4 -4
- package/dist/assets/{TimeframeSwitcherWithToggle-B9Lo2-pD-oHueEdHK.js → TimeframeSwitcherWithToggle-DMblyoo8-ize9yIra.js} +2 -2
- package/dist/assets/{TopExCard-DwP8Cppq-BA7R-fYL.js → TopExCard-BwOpZFuj-CBPfgwzP.js} +7 -7
- package/dist/assets/{TopExDetailPage-CIMSDSxd-DWJg2Rhe.js → TopExDetailPage-BLaZA-dy-BH7Jcbvo.js} +19 -19
- package/dist/assets/{TransactionDetailPage-rwzAZT-Q-kE9Vj_Gw.js → TransactionDetailPage-BSDcUBWF-RsUJuQC6.js} +54 -54
- package/dist/assets/TransactionList-CnOj_LA1-DJxHv2ky.js +147 -0
- package/dist/assets/{TransactionListBig-BidYBgz3-mdU3i6TS.js → TransactionListBig-vNVdUmc6-C0TF6R2i.js} +26 -26
- package/dist/assets/TransactionListPage-CrUtG598-DR2tdFwA.js +35 -0
- package/dist/assets/TransactionVendorDetailPage-DjuFdK9S-Bn1DMv6P.js +80 -0
- package/dist/assets/{TransferDrawerPage-CztFCYxm-CBCCBWte.js → TransferDrawerPage-BMfeqbNy-BPjvRE9M.js} +46 -46
- package/dist/assets/{TreasuryOverviewPage-E5E5Gr3g-D2CrCBTV.js → TreasuryOverviewPage-B0vqbfmt-Cncu2g9Z.js} +47 -47
- package/dist/assets/{TreasuryPromoPage-D2F4Y8gV-CYlJ3kU9.js → TreasuryPromoPage-CQDA9os9-W40fA_vr.js} +28 -28
- package/dist/assets/{TreasurySetupPage-Dxa4l6Ec-D8eLBdo9.js → TreasurySetupPage-ChKM9npc-DNsYbGBz.js} +9 -9
- package/dist/assets/TreasuryStatementsPage-C0oRa1nh-BiT4V4PF.js +58 -0
- package/dist/assets/TreasuryTaxLetterPage-BuGFH3YF-BkeOYDmd.js +58 -0
- package/dist/assets/{TreasuryTransferOrReviewPage-BfReLw_V-7MLhWFB6.js → TreasuryTransferOrReviewPage-wt-8Okdj-CDylzOrV.js} +96 -96
- package/dist/assets/TrendChart-a95Aii8O-Crc1NrOm.js +16 -0
- package/dist/assets/{TrendWithTransactions-BslpnJTN-CCs7L3oP.js → TrendWithTransactions-CaExMJVA-C_0n3oh-.js} +13 -13
- package/dist/assets/{UncategorizedAccountsMappingPage-Brm7fcuy-1WMghiUv.js → UncategorizedAccountsMappingPage-CEHiflWp-D5pq-zY_.js} +5 -5
- package/dist/assets/{UnitIntegrationPage-DhiEmm9g-CyoCc7wN.js → UnitIntegrationPage-CNZbRdtN-B7b4N3wp.js} +4 -4
- package/dist/assets/{UploadAdditionalDocumentOverlay-Dq1ToFCn-BQjCguyB.js → UploadAdditionalDocumentOverlay-Bxc2MMx0-Cpl1vzGP.js} +2 -2
- package/dist/assets/UserMultiSelectField-UsIy6n-8-DdaF7B7O.js +154 -0
- package/dist/assets/UserWithTimestamp-i09mOCAu-Cw5lsbIN.js +38 -0
- package/dist/assets/{Vendor2FAPopup-Brg14-Cw-BfoPqsuP.js → Vendor2FAPopup-CqQOI5F6-CXSUTyq5.js} +1 -1
- package/dist/assets/{VendorACHDetailsPage-mk0vAyqE-BSy-kLup.js → VendorACHDetailsPage-BwYEhxJe-BB1a4fFU.js} +1 -1
- package/dist/assets/{VendorDetailPage-CRhCXEsq-qmv0EtV4.js → VendorDetailPage-C5zTkWhA-Uj3MwLUr.js} +23 -23
- package/dist/assets/{VendorDomesticWireDetailsPage-DhWkYV9N-CfYo0l4g.js → VendorDomesticWireDetailsPage-DrwX_ukC-DBWePN-A.js} +1 -1
- package/dist/assets/VendorFiling1099EditablePage-C3wjgkez-Dr8QyAeR.js +175 -0
- package/dist/assets/{VendorFirstReviewPage-XHOyQIOp-D3qnz2ww.js → VendorFirstReviewPage-BmRvA38Y-B_gKBGgZ.js} +45 -45
- package/dist/assets/{VendorInternationalWireDetailsPage-B13qu8u3-XGuYC0bw.js → VendorInternationalWireDetailsPage-DtG2HQ0g-WjpK5qgH.js} +15 -15
- package/dist/assets/{VendorInternationalWireSwiftDetailsPage-Dtgusj3r-lncQfKmQ.js → VendorInternationalWireSwiftDetailsPage-DLSMDEiO-DSuW-yyD.js} +1 -1
- package/dist/assets/{VendorsAccountsSection-B-qorJ8x-D7fZrn7B.js → VendorsAccountsSection-5QJEJeCr-ovimcD6K.js} +6 -6
- package/dist/assets/{VerifyDevice-CBO1Uzra-0Sdb0n5n.js → VerifyDevice-DBnFzHim-C-LQbPfS.js} +13 -13
- package/dist/assets/{WarningsDrawerPage-B4Nic3gX-jDmAJMW0.js → WarningsDrawerPage-rcWR2KXe-BgEVT8fd.js} +8 -8
- package/dist/assets/{ZeniAccountDetailPage-IDGYSZVs-DmZJYRcm.js → ZeniAccountDetailPage-i8C1YB1W-CGdZ9Fyc.js} +22 -22
- package/dist/assets/{ZeniAccountListViewPage-IlPP8Yit-dH-QXkwU.js → ZeniAccountListViewPage-DyHxeqvW-CBT4R7Fd.js} +22 -22
- package/dist/assets/ZeniAccountNavBarPieces-CsSdfTKg-5k_P9-6W.js +14 -0
- package/dist/assets/{ZeniAccountPromoPage-BhFf42Fz-TRhbuR-7.js → ZeniAccountPromoPage-C5icpLpX-DtIf5jxs.js} +21 -21
- package/dist/assets/ZeniAccountSetupPage-BXHIQxgf-DcysatW3.js +36 -0
- package/dist/assets/ZeniAvatar-Cendj_Bv-Dp3oXY0H.js +13 -0
- package/dist/assets/{ZeniCopyright-C4Ze2E8o-C33E_V5I.js → ZeniCopyright-BX1-vpnA-B9MOS9At.js} +1 -1
- package/dist/assets/ZeniDatePicker-El_phkQ0-z80YcUbm.js +187 -0
- package/dist/assets/ZeniDatePickerField-3DaqcxMB-QK1YG1pI.js +1 -0
- package/dist/assets/ZeniTransferAmountSlider-CxxqQPB_-BqeHyBds.js +63 -0
- package/dist/assets/add-C0nqJFLa-C2eApjPK.js +1 -0
- package/dist/assets/{add-to-wallet-DgdBD8_G-DcfyMc0W.js → add-to-wallet-DgdBD8_G-XP_wmSR7.js} +1 -1
- package/dist/assets/{analyticsHelper-CsfdC0kT-BpVlkMRS.js → analyticsHelper-B3JHS_Qr-D08xKZsr.js} +1 -1
- package/dist/assets/{analyticsHelper-BuNdZ9jh.js → analyticsHelper-BFpl-Msc.js} +1 -1
- package/dist/assets/{arrow-south-east-round-PEovUgvH-DBLhwZXJ.js → arrow-south-east-round-PEovUgvH-DnzbA_s-.js} +1 -1
- package/dist/assets/{auto-transfer-rule-mbafm5D3-D6YoufI_.js → auto-transfer-rule-mbafm5D3-BA0iOPjL.js} +1 -1
- package/dist/assets/avatar-Dz7aEm3d-D64JGSQG.js +1 -0
- package/dist/assets/calculateSize-BUfcd-gF-DqmEdKsX.js +1 -0
- package/dist/assets/{chartTypes-CPj7oOMJ-Cv2ANOse.js → chartTypes-CICM6xJ3-DAE7LSQz.js} +1 -1
- package/dist/assets/clock-CJkylEKt-CJ3FIZ_o.js +1 -0
- package/dist/assets/cockpitConstants-CT7OARAT-C430UcjZ.js +1 -0
- package/dist/assets/cockpitHelpers-CSVzBgeI-BARdDEyf.js +1 -0
- package/dist/assets/cockpitHelpers-Y5_CbmvR-BhJ5C_6h.js +1 -0
- package/dist/assets/common-CU4uS1La-DdHnWUCD.js +1 -0
- package/dist/assets/{commonDimensions-CKs-7p-V-CmlPem1Z.js → commonDimensions-EDu7gcyc-DiuxcTjp.js} +1 -1
- package/dist/assets/{crypto-BURQLTgV.js → crypto-DPjkCRYF.js} +1 -1
- package/dist/assets/{detailCommon-BJ8iCchG-CdCS4VPM.js → detailCommon-DAG_rX2o-B0QDOSIy.js} +9 -9
- package/dist/assets/dollar-round-D18u7nlm-CXc5TAek.js +1 -0
- package/dist/assets/double-tick-D6s_OvsM-DFvZDijg.js +1 -0
- package/dist/assets/{downloadPdf-hPck-AA1-CD5ZG46J.js → downloadPdf-DCmFpTS--B48gcxsA.js} +1 -1
- package/dist/assets/filter-cZIFUNvj-B9dfJXS9.js +1 -0
- package/dist/assets/getCockpitColor-YYDF6h1T-D0_aeMEA.js +1 -0
- package/dist/assets/{gift-box-Cmt9OgIZ-DKWN92w0.js → gift-box-Cmt9OgIZ-Bnh-gm_T.js} +1 -1
- package/dist/assets/{graphic-no-data-l-DU4J8fDt-BalbEtqQ.js → graphic-no-data-l-DU4J8fDt-DTLZpyxa.js} +1 -1
- package/dist/assets/{graphic-no-data-net-burn-l-CzmycA0m-DR-LfIWY.js → graphic-no-data-net-burn-l-CzmycA0m-W-GGrHSF.js} +1 -1
- package/dist/assets/groupHelper-CTA_J_U7-CPJTcSSg.js +1 -0
- package/dist/assets/hyperlink-DQyCeXx2-ChMvASRu.js +1 -0
- package/dist/assets/{index-CyJdCOlu.js → index-D9zAXs3-.js} +5886 -14388
- package/dist/assets/index-DVThwdcI.css +1 -0
- package/dist/assets/intuit-quick-books-logo-qyL3_3cm-Cj0LgD2I.js +1 -0
- package/dist/assets/{liveblocks-DZpRS25q.js → liveblocks-C2xecagE.js} +2 -2
- package/dist/assets/loader-BwDk7JSW-DoE-nOgh.js +1 -0
- package/dist/assets/{lodash-Dq_mKlGB.js → lodash-D52QloPU.js} +1 -1
- package/dist/assets/{mapLoadingInProgressToTreeNode-R394S2in-pIplKgrn.js → mapLoadingInProgressToTreeNode-CtvSoL64-CS0Ie6NV.js} +1 -1
- package/dist/assets/{mapSectionWithAcOnlyToTreeNode-B20NECa8-DENXzcIZ.js → mapSectionWithAcOnlyToTreeNode-BujdmE12-MD1XTXUW.js} +1 -1
- package/dist/assets/{mapSpacerToTreeNode-CLYF1Foh-BkgQTnh2.js → mapSpacerToTreeNode-CY5XRFK--DC8NIrxN.js} +1 -1
- package/dist/assets/{mapTimeframeBalancesToTreeNode-fLAswzPX-uvgKr4WV.js → mapTimeframeBalancesToTreeNode-DLd8jhti-Bxl7AnhE.js} +1 -1
- package/dist/assets/{mapTimeframeBalancesToTreeNode-B-iRb2_j-BOYVHL5U.js → mapTimeframeBalancesToTreeNode-DVzQl7Bb-DDS_OBZQ.js} +1 -1
- package/dist/assets/{mapTimeframeHeaderLoadingInProgressToTreeNode-CTmIxkdn-rpNZ4fKa.js → mapTimeframeHeaderLoadingInProgressToTreeNode-CnZa-P_--DVtFUdDi.js} +1 -1
- package/dist/assets/money-2cg1MuG4-BaDu1jFd.js +1 -0
- package/dist/assets/{mui-Bi8r7UDG.js → mui-Ty75qFQF.js} +1 -1
- package/dist/assets/note-DCtChU1T-DArfpxk4.js +1 -0
- package/dist/assets/{page-detail-CWX5S47F-B6DjZ3Gi.js → page-detail-CWX5S47F-lMo0MYzU.js} +1 -1
- package/dist/assets/page-summary-D7_VQHwN-DEY33DNc.js +1 -0
- package/dist/assets/{play-icon-BZYr9mDs-DofqQFSd.js → play-icon-KtJH-UgF-Bm3lFkFZ.js} +3 -3
- package/dist/assets/{radio-default-CiSgisfh-ub7QGXr8.js → radio-default-CiSgisfh-Cuu8ymvq.js} +1 -1
- package/dist/assets/{redux-CC-tnuv1.js → redux-CEhZD0hA.js} +1 -1
- package/dist/assets/{routing-CxYXTKiv.js → routing-lj7oVq6C.js} +1 -1
- package/dist/assets/sectionColor-euXcOIkp-Cmmp8esL.js +1 -0
- package/dist/assets/{sentry-HDxG13yk.js → sentry-BE5FTzpq.js} +1 -1
- package/dist/assets/{shield-DOlUxcFf-BCUrujod.js → shield-DOlUxcFf-CDkNAu2o.js} +1 -1
- package/dist/assets/tick-round-CPC394H5-C8roQJBa.js +1 -0
- package/dist/assets/{toCOABalancesWithID-Dsa-tGTi-Bmzakp6x.js → toCOABalancesWithID-B0F8-Lgv-mwB6oBaM.js} +1 -1
- package/dist/assets/{toChartData-Cp_80Bi6-Dfd3dSx4.js → toChartData-D_8GUwpP-CFofR1sw.js} +1 -1
- package/dist/assets/{transaction-placeholder-CpOwZAMG-CJJQqrcA.js → transaction-placeholder-CpOwZAMG-CGEA36Na.js} +1 -1
- package/dist/assets/{treasuryColorHelper-CnKoJBRW-CDwAxole.js → treasuryColorHelper-C2d7wCjK-BWDQfCvz.js} +1 -1
- package/dist/assets/undo-b_3XZ5CX-Xpx_MAU7.js +1 -0
- package/dist/assets/{uploadAttachment-Cx3LGzsg-DDC6BFL5.js → uploadAttachment-CxwBrcm3-DDVTRYQ0.js} +29 -29
- package/dist/assets/{uploadReceipts-CwjPukNh-BNp5wSMb.js → uploadReceipts-DIYsXeyf-_3VvjCR-.js} +1 -1
- package/dist/assets/{useLongPress-GCK2COYQ-gxLtL5O4.js → useLongPress-GCK2COYQ-B0RUPzZV.js} +1 -1
- package/dist/assets/{usp-line-BBd1wKwW-CgKq8-Xn.js → usp-line-BBd1wKwW-ZlUrfnG1.js} +1 -1
- package/dist/assets/{vendor-CnQcJ2Lu.js → vendor-Bs1fkIUX.js} +7 -7
- package/dist/assets/{verification-CW6uEyev-DdkqedMU.js → verification-CW6uEyev-CQXAdM_w.js} +1 -1
- package/dist/assets/zeniDatePicker.helpers-Bv0wGqkO-0jS7nOtw.js +1 -0
- package/dist/index.html +1 -1
- package/package.json +2 -2
- package/dist/assets/ACHDetailsPage-BahbefPk-CJUwOp-5.js +0 -21
- package/dist/assets/AccountInfoPage-TD30edES-B2dxCd6A.js +0 -18
- package/dist/assets/AppBasePage-BK_b0fFf-DXr3P5KV.js +0 -70
- package/dist/assets/ApprovalRulesSettingsPage-C6jxuvhu-S4p-j-Jr.js +0 -47
- package/dist/assets/ArAgingChart-DVMlvNTF-DuCGC2Pt.js +0 -24
- package/dist/assets/ArAgingDetailPage-CbmOL5tx-Bg8YQJ9n.js +0 -46
- package/dist/assets/BillPaySetUpPage-X8X9gq1a-DvsjYi7w.js +0 -42
- package/dist/assets/BillingSettingsPage-CyyR8GW1-3x2HPXEj.js +0 -44
- package/dist/assets/BillsBulkReviewDrawerPage-D_xxZjcU-M0WKN8pE.js +0 -1
- package/dist/assets/BusinessVerificationPage-Tr-N_rHo-BFVLh_Kq.js +0 -140
- package/dist/assets/ChargeCardPromoPage-LVuaSVsQ-xG3b-_Ag.js +0 -222
- package/dist/assets/ChargeCardSetupPage-CWoHclOr-CLs_UkHN.js +0 -36
- package/dist/assets/ChargeCardUtils-6kq_92Ri-BhC-mlU5.js +0 -1
- package/dist/assets/CheckDepositDrawerPage-w7IziUHI-DeTxsGVS.js +0 -206
- package/dist/assets/CompleteProfile-1xeOWkGT-CSILrADl.js +0 -52
- package/dist/assets/ConfettiBurst-b1-NNKbl-Dk_0sV_i.js +0 -1
- package/dist/assets/CustomerOnboardingContainerPage-BXSxGbv8-CIUqDhfe.js +0 -1
- package/dist/assets/CustomerOnboardingNoStepsPage-BaBxG1Yn-DqlQrhK_.js +0 -66
- package/dist/assets/DepositAccTransactionListPage-CrQrOyrm-LYbEgddo.js +0 -66
- package/dist/assets/EditPeoplePage-C7uOWg9F-BdboEEOc.js +0 -55
- package/dist/assets/EntityDetailPage-BsQ9bSpC-Do5rjOCb.js +0 -18
- package/dist/assets/ExpenseAutomationOverviewPage-CKBACgsI-pcAU6Tzl.js +0 -222
- package/dist/assets/InsightsSection-DtBq9eII-CGUvYjY9.js +0 -27
- package/dist/assets/IntegrationsSettingsPage-TjdF0ahh-BOCCfb_h.js +0 -57
- package/dist/assets/InviteFormPage-DEDBu0OO-Dsi8hwhI.js +0 -312
- package/dist/assets/InvitePeoplePage-BzPRCgA6-C4LT3zxO.js +0 -12
- package/dist/assets/LabeledAddressValue-CSb0EGEx-owkgfzr7.js +0 -49
- package/dist/assets/LabeledAddressValueField-DJHY_wPN-ChfMLz4N.js +0 -45
- package/dist/assets/LabeledControlledCheckBoxField-rRmtlmRJ-ZOoy4ee7.js +0 -16
- package/dist/assets/LabeledDocumentField-sIz4Fhet-CBqe5ksA.js +0 -41
- package/dist/assets/LinkJETransactionPage-D9Kae7Qd-CXNveZ-N.js +0 -98
- package/dist/assets/MagicLinkSuccessPage-D3ORpbmL-DiCQcMcn.js +0 -31
- package/dist/assets/MagicLinkTitleSection-Di20DmsJ-Dweea4Ge.js +0 -17
- package/dist/assets/MyPendingActivationChargeCardListPage-C4eMpxAr-CvtH5135.js +0 -6
- package/dist/assets/MyProfileSettingsPage-D0ALOEls-D9BtQ_Rr.js +0 -85
- package/dist/assets/NotificationsListConfig-DiJLl-YW-Be2lRZvs.js +0 -1
- package/dist/assets/PandLWithForecastPage-IizA8WJN-C3H0uMBf.js +0 -107
- package/dist/assets/QBOSetupSection-T0b8qjoq-C3lySFCv.js +0 -79
- package/dist/assets/ReimbursementSetUpPage-CrCsRxAy-Bpo-Mk0A.js +0 -140
- package/dist/assets/ReimbursementsBulkReviewDrawerPage-Ct-lvcR1-DC9qwxGH.js +0 -1
- package/dist/assets/ReportTableViewSelector-CkuvvlJm-btt9uZlN.js +0 -150
- package/dist/assets/ReviewOverlay-Czmj4HG0-BLH60HLe.js +0 -152
- package/dist/assets/RoleWithToolTip-CNQZHC7h-LUv0Jw-2.js +0 -22
- package/dist/assets/SetUpAccountSection-CaLxl4l3-BRnWdFeV.js +0 -378
- package/dist/assets/SignInScreen-BGUfMUqo.js +0 -1
- package/dist/assets/SpendManagementListViewPage-Cvev9izU-BZzSvbIK.js +0 -123
- package/dist/assets/StatementsPage-Bhk6u845-C7EltSZm.js +0 -58
- package/dist/assets/TransactionList-CFYj7bYL-GEiFuum0.js +0 -147
- package/dist/assets/TransactionListPage-CImIYabg-BI9Hn9ZN.js +0 -35
- package/dist/assets/TransactionVendorDetailPage-LzIzQGZ1-NlBjctZ1.js +0 -80
- package/dist/assets/TreasuryStatementsPage-DEhWu0S0-CbB6wAo4.js +0 -58
- package/dist/assets/TreasuryTaxLetterPage-CEMU2CI9-BGxkDpux.js +0 -58
- package/dist/assets/TrendChart-D1gtjDe3-DWpkP03z.js +0 -16
- package/dist/assets/VendorFiling1099EditablePage-Bp5FgSiJ-DJr2e5wU.js +0 -175
- package/dist/assets/ZeniAccountNavBarPieces-2j-ZQRIF-DhfLCa9V.js +0 -14
- package/dist/assets/ZeniAccountSetupPage-DcYDO3x8-DOdNLBlO.js +0 -36
- package/dist/assets/ZeniTransferAmountSlider-DFB0ntiR-IB41czFT.js +0 -63
- package/dist/assets/index-BAKoUD4u.css +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as p,r as Ls,R as qd}from"./mui-
|
|
1
|
+
import{j as p,r as Ls,R as qd}from"./mui-Ty75qFQF.js";import{c as Lo,b as f,d as yi,g as cu,w as me,R as C0}from"./vendor-Bs1fkIUX.js";var Aa,jc;function b0(){if(jc)return Aa;jc=1;var e=typeof Lo=="object"&&Lo&&Lo.Object===Object&&Lo;return Aa=e,Aa}var xa,Mc;function Gd(){if(Mc)return xa;Mc=1;var e=b0(),t=typeof self=="object"&&self&&self.Object===Object&&self,n=e||t||Function("return this")();return xa=n,xa}var Oa,_c;function Yd(){if(_c)return Oa;_c=1;var e=Gd(),t=e.Symbol;return Oa=t,Oa}var Sa,Lc;function y0(){if(Lc)return Sa;Lc=1;var e=Yd(),t=Object.prototype,n=t.hasOwnProperty,r=t.toString,o=e?e.toStringTag:void 0;function s(a){var i=n.call(a,o),u=a[o];try{a[o]=void 0;var c=!0}catch{}var l=r.call(a);return c&&(i?a[o]=u:delete a[o]),l}return Sa=s,Sa}var Ta,$c;function E0(){if($c)return Ta;$c=1;var e=Object.prototype,t=e.toString;function n(r){return t.call(r)}return Ta=n,Ta}var Ra,Uc;function D0(){if(Uc)return Ra;Uc=1;var e=Yd(),t=y0(),n=E0(),r="[object Null]",o="[object Undefined]",s=e?e.toStringTag:void 0;function a(i){return i==null?i===void 0?o:r:s&&s in Object(i)?t(i):n(i)}return Ra=a,Ra}var Ia,Hc;function lu(){if(Hc)return Ia;Hc=1;function e(t){var n=typeof t;return t!=null&&(n=="object"||n=="function")}return Ia=e,Ia}var Ba,Wc;function w0(){if(Wc)return Ba;Wc=1;function e(t){return t!=null&&typeof t=="object"}return Ba=e,Ba}var Fa,zc;function A0(){if(zc)return Fa;zc=1;var e=D0(),t=w0(),n="[object Symbol]";function r(o){return typeof o=="symbol"||t(o)&&e(o)==n}return Fa=r,Fa}var Pa,Vc;function x0(){if(Vc)return Pa;Vc=1;var e=/\s/;function t(n){for(var r=n.length;r--&&e.test(n.charAt(r)););return r}return Pa=t,Pa}var Na,Kc;function O0(){if(Kc)return Na;Kc=1;var e=x0(),t=/^\s+/;function n(r){return r&&r.slice(0,e(r)+1).replace(t,"")}return Na=n,Na}var ka,qc;function S0(){if(qc)return ka;qc=1;var e=O0(),t=lu(),n=A0(),r=NaN,o=/^[-+]0x[0-9a-f]+$/i,s=/^0b[01]+$/i,a=/^0o[0-7]+$/i,i=parseInt;function u(c){if(typeof c=="number")return c;if(n(c))return r;if(t(c)){var l=typeof c.valueOf=="function"?c.valueOf():c;c=t(l)?l+"":l}if(typeof c!="string")return c===0?c:+c;c=e(c);var d=s.test(c);return d||a.test(c)?i(c.slice(2),d?2:8):o.test(c)?r:+c}return ka=u,ka}var T0="@liveblocks/react",R0="2.23.0",I0="esm";function dP(e){const[t,n]=f.useState(!1);return f.useEffect(()=>{n(!0)},[]),p.jsx(f.Suspense,{fallback:e.fallback,children:t?typeof e.children=="function"?e.children():e.children:e.fallback})}var B0=Object.defineProperty,F0=(e,t)=>{for(var n in t)B0(e,n,{get:t[n],enumerable:!0})},P0="@liveblocks/core",fu="2.23.0",N0="esm",$o=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof yi<"u"?yi:{},k0="https://liveblocks.io/docs/errors/dupes",j0=" ";function M0(e){console.error(e)}function du(e,t,n){const r=Symbol.for(e),o=`${t} (${n})`;if(!$o[r])$o[r]=o;else if($o[r]!==o){const s=[`Multiple copies of Liveblocks are being loaded in your project. This will cause issues! See ${k0+j0}`,"","Conflicts:",`- ${e} ${$o[r]} (already loaded)`,`- ${e} ${o} (trying to load this now)`].join(`
|
|
2
2
|
`);M0(s)}}function Ei(e){const t=e.editedAt?new Date(e.editedAt):void 0,n=new Date(e.createdAt),r=e.reactions.map(o=>({...o,createdAt:new Date(o.createdAt)}));if(e.body)return{...e,reactions:r,createdAt:n,editedAt:t};{const o=new Date(e.deletedAt);return{...e,reactions:r,createdAt:n,editedAt:t,deletedAt:o}}}function fn(e){const t=new Date(e.createdAt),n=new Date(e.updatedAt),r=e.comments.map(o=>Ei(o));return{...e,createdAt:t,updatedAt:n,comments:r}}function _0(e){return{...e,createdAt:new Date(e.createdAt)}}function In(e){const t=new Date(e.notifiedAt),n=e.readAt?new Date(e.readAt):null;if("activities"in e){const r=e.activities.map(o=>({...o,createdAt:new Date(o.createdAt)}));return{...e,notifiedAt:t,readAt:n,activities:r}}return{...e,notifiedAt:t,readAt:n}}function ja(e){const t=new Date(e.deletedAt);return{...e,deletedAt:t}}function Ma(e){const t=new Date(e.deletedAt);return{...e,deletedAt:t}}var Cn={};F0(Cn,{error:()=>wo,errorWithTitle:()=>Qd,warn:()=>ft,warnWithTitle:()=>$0});var Xd="background:#0e0d12;border-radius:9999px;color:#fff;padding:3px 7px;font-family:sans-serif;font-weight:600;",L0="font-weight:600";function Zd(e){return typeof window>"u"?console[e]:(t,...n)=>console[e]("%cLiveblocks",Xd,t,...n)}var ft=Zd("warn"),wo=Zd("error");function Jd(e){return typeof window>"u"?console[e]:(t,n,...r)=>console[e](`%cLiveblocks%c ${t}`,Xd,L0,n,...r)}var $0=Jd("warn"),Qd=Jd("error");function nn(e){return e!==null&&typeof e=="object"&&Object.prototype.toString.call(e)==="[object Object]"}function Di(e){return nn(e)&&typeof e.startsWith=="string"}function wt(e){throw new Error(e)}function hu(e){return Object.entries(e)}function U0(e){return Object.keys(e)}function H0(e,t){return typeof t<"u"?Object.create(e,t):Object.create(e)}function $s(e){try{return JSON.parse(e)}catch{return}}function ro(e){return JSON.parse(JSON.stringify(e))}function W0(e){try{const t=e.replace(/-/g,"+").replace(/_/g,"/");return decodeURIComponent(atob(t).split("").map(function(r){return"%"+("00"+r.charCodeAt(0).toString(16)).slice(-2)}).join(""))}catch{return atob(e)}}function wi(e){return e.filter(t=>t!=null)}function Ao(e){const t={...e};return Object.keys(e).forEach(n=>{const r=n;t[r]===void 0&&delete t[r]}),t}function z0(e){return new Promise(t=>setTimeout(t,e))}async function Gc(e,t,n){let r;const o=new Promise((s,a)=>{r=setTimeout(()=>{a(new Error(n))},t)});return Promise.race([e,o]).finally(()=>clearTimeout(r))}function Yc(e){let t=null;return()=>(t===null&&(t=e().catch(n=>{throw setTimeout(()=>{t=null},5e3),n})),t)}var Ar=class eh extends Error{response;details;constructor(t,n,r){super(t),this.name="HttpError",this.response=n,this.details=r}static async fromResponse(t){let n;try{n=await t.text()}catch{}const r=n?$s(n):void 0;let o;nn(r)&&(o=r);let s="";s||=typeof o?.message=="string"?o.message:"",s||=typeof o?.error=="string"?o.error:"",r===void 0&&(s||=n||""),s||=t.statusText;let a;try{a=new URL(t.url).pathname}catch{}s+=a!==void 0?` (got status ${t.status} from ${a})`:` (got status ${t.status})`;const i=o;return new eh(s,t,i)}get status(){return this.response.status}},V0=e=>e instanceof Ar&&e.status>=400&&e.status<500;async function Yr(e,t,n,r=V0){const o=n.length>0?n[n.length-1]:0;let s=0;for(;;){s++;try{return await e()}catch(i){if(r(i))throw i;if(s>=t)throw new Error(`Failed after ${t} attempts: ${String(i)}`)}const a=n[s-1]??o;ft(`Attempt ${s} was unsuccessful. Retrying in ${a} milliseconds.`),await z0(a)}}function th(){let e,t;return[new Promise((r,o)=>{e=r,t=o}),e,t]}function nh(){const[e,t,n]=th();return{promise:e,resolve:t,reject:n}}function Ie(){const e=new Set;function t(a){return e.add(a),()=>e.delete(a)}function n(a){const i=t(u=>(i(),a(u)));return i}async function r(a){let i;return new Promise(u=>{i=t(c=>{(a===void 0||a(c))&&u(c)})}).finally(()=>i?.())}function o(a){let i=!1;for(const u of e)u(a),i=!0;return i}function s(){return e.size}return{notify:o,subscribe:t,subscribeOnce:n,count:s,waitUntil:r,[Symbol.dispose]:()=>{e.clear()},observable:{subscribe:t,subscribeOnce:n,waitUntil:r}}}function K0(){const e=Ie();let t=null;function n(){t=[]}function r(){if(t!==null){for(const s of t)e.notify(s);t=null}}function o(s){return t!==null?(t.push(s),!1):e.notify(s)}return{...e,notify:o,pause:n,unpause:r,[Symbol.dispose]:()=>{e[Symbol.dispose](),t!==null&&(t.length=0)}}}var En=e=>e,Bn=Symbol("kSinks"),gs=Symbol("kTrigger"),fr=null,Mn=null;function ct(e){if(fr!==null){e();return}fr=new Set;try{e()}finally{for(const t of fr)t[gs]();fr=null}}function pu(e){fr||wt("Expected to be in an active batch"),fr.add(e)}function rh(e,t){let n=!1;const r={...e};return Object.keys(t).forEach(o=>{const s=o,a=t[s];r[s]!==a&&(a===void 0?delete r[s]:r[s]=a,n=!0)}),n?r:e}var mu=class{equals;#e;[Bn];constructor(e){this.equals=e??Object.is,this.#e=Ie(),this[Bn]=new Set,this.get=this.get.bind(this),this.subscribe=this.subscribe.bind(this),this.subscribeOnce=this.subscribeOnce.bind(this)}[Symbol.dispose](){this.#e[Symbol.dispose](),this.#e="(disposed)",this.equals="(disposed)"}get hasWatchers(){if(this.#e.count()>0)return!0;for(const e of this[Bn])if(e.hasWatchers)return!0;return!1}[gs](){this.#e.notify();for(const e of this[Bn])pu(e)}subscribe(e){return this.#e.count()===0&&this.get(),this.#e.subscribe(e)}subscribeOnce(e){const t=this.subscribe(()=>(t(),e()));return t}waitUntil(){throw new Error("waitUntil not supported on Signals")}markSinksDirty(){for(const e of this[Bn])e.markDirty()}addSink(e){this[Bn].add(e)}removeSink(e){this[Bn].delete(e)}asReadonly(){return this}},zt=class extends mu{#e;constructor(e,t){super(t),this.#e=En(e)}[Symbol.dispose](){super[Symbol.dispose](),this.#e="(disposed)"}get(){return Mn?.add(this),this.#e}set(e){ct(()=>{typeof e=="function"&&(e=e(this.#e)),this.equals(this.#e,e)||(this.#e=En(e),this.markSinksDirty(),pu(this))})}},q0=class extends zt{constructor(e){super(En(Ao(e)))}set(){throw new Error("Don't call .set() directly, use .patch()")}patch(e){super.set(t=>rh(t,e))}},G0=Symbol(),Xe=class Ai extends mu{#e;#t;#n;#r;#s;static from(...t){const n=t.pop();if(typeof n!="function"&&wt("Invalid .from() call, last argument expected to be a function"),typeof t[t.length-1]=="function"){const r=n,o=t.pop();return new Ai(t,o,r)}else{const r=n;return new Ai(t,r)}}constructor(t,n,r){super(r),this.#t=!0,this.#e=G0,this.#r=t,this.#n=new Set,this.#s=n}[Symbol.dispose](){for(const t of this.#n)t.removeSink(this);this.#e="(disposed)",this.#n="(disposed)",this.#r="(disposed)",this.#s="(disposed)"}get isDirty(){return this.#t}#o(){const t=Mn;let n;Mn=new Set;try{n=this.#s(...this.#r.map(r=>r.get()))}finally{const r=this.#n;this.#n=new Set;for(const o of Mn)this.#n.add(o),r.delete(o);for(const o of r)o.removeSink(this);for(const o of this.#n)o.addSink(this);Mn=t}return this.#t=!1,this.equals(this.#e,n)?!1:(this.#e=n,!0)}markDirty(){this.#t||(this.#t=!0,this.markSinksDirty())}get(){return this.#t&&this.#o(),Mn?.add(this),this.#e}[gs](){if(!this.hasWatchers)return;this.#o()&&super[gs]()}},Xn=class extends mu{#e;constructor(e){super(),this.#e=e}[Symbol.dispose](){super[Symbol.dispose](),this.#e="(disposed)"}get(){return Mn?.add(this),this.#e}mutate(e){ct(()=>{const t=e?e(this.#e):!0;t!==null&&typeof t=="object"&&"then"in t&&wt("MutableSignal.mutate() does not support async callbacks"),t!==!1&&(this.markSinksDirty(),pu(this))})}};function Y0(e,t){return t!==null&&typeof t=="object"&&!Array.isArray(t)?Object.keys(t).sort().reduce((n,r)=>(n[r]=t[r],n),{}):t}function zn(e){return JSON.stringify(e,Y0)}function tn(e){try{return JSON.stringify(e)}catch(t){throw console.error(`Could not stringify: ${t.message}`),console.error(e),t}}var X0=50,Z0=class{input;resolve;reject;promise;constructor(e){this.input=e;const{promise:t,resolve:n,reject:r}=nh();this.promise=t,this.resolve=n,this.reject=r}},Xr=class{#e=[];#t;#n;#r;#s;error=!1;constructor(e,t){this.#t=e,this.#n=t.size??X0,this.#r=t.delay}#o(){this.#s!==void 0&&(clearTimeout(this.#s),this.#s=void 0)}#i(){this.#e.length===this.#n?this.#a():this.#e.length===1&&(this.#o(),this.#s=setTimeout(()=>void this.#a(),this.#r))}async#a(){if(this.#e.length===0)return;const e=this.#e.splice(0),t=e.map(n=>n.input);try{const n=await this.#t(t);this.error=!1,e.forEach((r,o)=>{const s=n?.[o];Array.isArray(n)?e.length!==n.length?r.reject(new Error(`Callback must return an array of the same length as the number of provided items. Expected ${e.length}, but got ${n.length}.`)):s instanceof Error?r.reject(s):r.resolve(s):r.reject(new Error("Callback must return an array."))})}catch(n){this.error=!0,e.forEach(r=>{r.reject(n)})}}get(e){const t=this.#e.find(r=>zn(r.input)===zn(e));if(t)return t.promise;const n=new Z0(e);return this.#e.push(n),this.#i(),n.promise}clear(){this.#e=[],this.error=!1,this.#o()}};function xi(e){const t=new Xn(new Map);function n(u){return zn(u)}function r(u,c){t.mutate(l=>{l.set(u,c)})}function o(u){t.mutate(c=>{if(Array.isArray(u))for(const l of u)c.delete(n(l));else c.clear()})}async function s(u){const c=n(u);if(!t.get().has(c))try{r(c,{isLoading:!0});const d=await e.get(u);r(c,{isLoading:!1,data:d})}catch(d){r(c,{isLoading:!1,error:d})}}function a(u){const c=n(u);return t.get().get(c)}function i(){return[...t.get().keys()]}return{subscribe:t.subscribe,enqueue:s,getItemState:a,invalidate:o,batch:e,_cacheKeys:i}}function J0(e,t){const n=[];for(let r=0,o=e.length;r<o;r+=t)n.push(e.slice(r,r+t));return n}var Pr=(e=21)=>crypto.getRandomValues(new Uint8Array(e)).reduce((t,n)=>t+=(n&=63)<36?n.toString(36):n<62?(n-26).toString(36).toUpperCase():n<63?"_":"-",""),Q0="th",eC="cm",tC="at";function vu(e){return`${e}_${Pr()}`}function oh(){return vu(Q0)}function Cs(){return vu(eC)}function sh(){return vu(tC)}var It=class extends Map{#e;constructor(e,t){super(t),this.#e=e}getOrCreate(e,t){if(super.has(e))return super.get(e);{const r=(t??this.#e??wt("DefaultMap used without a factory function"))(e);return this.set(e,r),r}}},nC=/^[a-zA-Z_][a-zA-Z0-9_]*$/;function Xc(e){let t=[];const n=Object.entries(e),r=[],o=[],s=[];return n.forEach(([a,i])=>{if(!nC.test(a))throw new Error("Key must only contain letters, numbers, _");Qc(i)?r.push([a,i]):nn(i)&&(Di(i)?o.push([a,i]):s.push([a,i]))}),t=[...Zc(r),...Jc(o)],s.forEach(([a,i])=>{const u=Object.entries(i),c=[],l=[];u.forEach(([d,m])=>{if(rC(d))throw new Error("Key cannot be empty");Qc(m)?c.push([el(a,d),m]):Di(m)&&l.push([el(a,d),m])}),t=[...t,...Zc(c),...Jc(l)]}),t.map(({key:a,operator:i,value:u})=>`${a}${i}${ah(u)}`).join(" ")}var Zc=e=>{const t=[];return e.forEach(([n,r])=>{t.push({key:n,operator:":",value:r})}),t},Jc=e=>{const t=[];return e.forEach(([n,r])=>{"startsWith"in r&&typeof r.startsWith=="string"&&t.push({key:n,operator:"^",value:r.startsWith})}),t},Qc=e=>typeof e=="string"||typeof e=="number"||typeof e=="boolean"||e===null,el=(e,t)=>t?`${e}[${ah(t)}]`:e,rC=e=>!e||e.toString().trim()==="";function ah(e){const t=JSON.stringify(e);return typeof e!="string"||t.includes("'")?t:`'${t.slice(1,-1).replace(/\\"/g,'"')}'`}function oC(e){const t=new URLSearchParams;for(const[n,r]of Object.entries(e))r!=null&&t.set(n,r.toString());return t}function sC(e,t,n){const r=new URL(t,e);return n!==void 0&&(r.search=(n instanceof URLSearchParams?n:oC(n)).toString()),r.toString()}function ye(e,...t){return e.reduce((n,r,o)=>n+encodeURIComponent(t[o-1]??"")+r)}function aC({baseUrl:e,authManager:t,fetchPolyfill:n}){const r=new iC(e,n);async function o(T){const q=await r.get(ye`/v2/c/rooms/${T.roomId}/threads/delta`,await t.getAuthValue({requestedScope:"comments:read",roomId:T.roomId}),{since:T.since.toISOString()},{signal:T.signal});return{threads:{updated:q.data.map(fn),deleted:q.deletedThreads.map(ja)},inboxNotifications:{updated:q.inboxNotifications.map(In),deleted:q.deletedInboxNotifications.map(Ma)},requestedAt:new Date(q.meta.requestedAt),permissionHints:q.meta.permissionHints}}async function s(T){let q;T.query&&(q=Xc(T.query));const ne=50;try{const ie=await r.get(ye`/v2/c/rooms/${T.roomId}/threads`,await t.getAuthValue({requestedScope:"comments:read",roomId:T.roomId}),{cursor:T.cursor,query:q,limit:ne});return{threads:ie.data.map(fn),inboxNotifications:ie.inboxNotifications.map(In),nextCursor:ie.meta.nextCursor,requestedAt:new Date(ie.meta.requestedAt),permissionHints:ie.meta.permissionHints}}catch(ie){if(ie instanceof Ar&&ie.status===404)return{threads:[],inboxNotifications:[],nextCursor:null,requestedAt:new Date(Date.now()-6*60*60*1e3),permissionHints:{}};throw ie}}async function a(T){const q=T.commentId??Cs(),ne=T.threadId??oh(),ie=await r.post(ye`/v2/c/rooms/${T.roomId}/threads`,await t.getAuthValue({requestedScope:"comments:read",roomId:T.roomId}),{id:ne,comment:{id:q,body:T.body,attachmentIds:T.attachmentIds},metadata:T.metadata});return fn(ie)}async function i(T){await r.delete(ye`/v2/c/rooms/${T.roomId}/threads/${T.threadId}`,await t.getAuthValue({requestedScope:"comments:read",roomId:T.roomId}))}async function u(T){const q=await r.rawGet(ye`/v2/c/rooms/${T.roomId}/thread-with-notification/${T.threadId}`,await t.getAuthValue({requestedScope:"comments:read",roomId:T.roomId}));if(q.ok){const ne=await q.json();return{thread:fn(ne.thread),inboxNotification:ne.inboxNotification?In(ne.inboxNotification):void 0}}else{if(q.status===404)return{thread:void 0,inboxNotification:void 0};throw new Error(`There was an error while getting thread ${T.threadId}.`)}}async function c(T){return await r.post(ye`/v2/c/rooms/${T.roomId}/threads/${T.threadId}/metadata`,await t.getAuthValue({requestedScope:"comments:read",roomId:T.roomId}),T.metadata)}async function l(T){const q=T.commentId??Cs(),ne=await r.post(ye`/v2/c/rooms/${T.roomId}/threads/${T.threadId}/comments`,await t.getAuthValue({requestedScope:"comments:read",roomId:T.roomId}),{id:q,body:T.body,attachmentIds:T.attachmentIds});return Ei(ne)}async function d(T){const q=await r.post(ye`/v2/c/rooms/${T.roomId}/threads/${T.threadId}/comments/${T.commentId}`,await t.getAuthValue({requestedScope:"comments:read",roomId:T.roomId}),{body:T.body,attachmentIds:T.attachmentIds});return Ei(q)}async function m(T){await r.delete(ye`/v2/c/rooms/${T.roomId}/threads/${T.threadId}/comments/${T.commentId}`,await t.getAuthValue({requestedScope:"comments:read",roomId:T.roomId}))}async function g(T){const q=await r.post(ye`/v2/c/rooms/${T.roomId}/threads/${T.threadId}/comments/${T.commentId}/reactions`,await t.getAuthValue({requestedScope:"comments:read",roomId:T.roomId}),{emoji:T.emoji});return _0(q)}async function C(T){await r.delete(ye`/v2/c/rooms/${T.roomId}/threads/${T.threadId}/comments/${T.commentId}/reactions/${T.emoji}`,await t.getAuthValue({requestedScope:"comments:read",roomId:T.roomId}))}async function v(T){await r.post(ye`/v2/c/rooms/${T.roomId}/threads/${T.threadId}/mark-as-resolved`,await t.getAuthValue({requestedScope:"comments:read",roomId:T.roomId}))}async function h(T){await r.post(ye`/v2/c/rooms/${T.roomId}/threads/${T.threadId}/mark-as-unresolved`,await t.getAuthValue({requestedScope:"comments:read",roomId:T.roomId}))}async function E(T){const q=T.roomId,ne=T.signal,ie=T.attachment,we=ne?new DOMException(`Upload of attachment ${T.attachment.id} was aborted.`,"AbortError"):void 0;if(ne?.aborted)throw we;const xe=Ce=>{if(ne?.aborted)throw we;if(Ce instanceof Ar&&Ce.status===413)throw Ce;return!1},ae=5*1024*1024,Te=10,_e=[2e3,2e3,2e3,2e3,2e3,2e3,2e3,2e3,2e3,2e3];function he(Ce){const ke=[];let Pe=0;for(;Pe<Ce.size;){const be=Math.min(Pe+ae,Ce.size);ke.push({partNumber:ke.length+1,part:Ce.slice(Pe,be)}),Pe=be}return ke}if(ie.size<=ae)return Yr(async()=>r.putBlob(ye`/v2/c/rooms/${q}/attachments/${ie.id}/upload/${encodeURIComponent(ie.name)}`,await t.getAuthValue({requestedScope:"comments:read",roomId:q}),ie.file,{fileSize:ie.size},{signal:ne}),Te,_e,xe);{let Ce;const ke=[],Pe=await Yr(async()=>r.post(ye`/v2/c/rooms/${q}/attachments/${ie.id}/multipart/${encodeURIComponent(ie.name)}`,await t.getAuthValue({requestedScope:"comments:read",roomId:q}),void 0,{signal:ne},{fileSize:ie.size}),Te,_e,xe);try{Ce=Pe.uploadId;const be=he(ie.file);if(ne?.aborted)throw we;const Ee=J0(be,5);for(const $e of Ee){const qe=[];for(const{part:bt,partNumber:Je}of $e)qe.push(Yr(async()=>r.putBlob(ye`/v2/c/rooms/${q}/attachments/${ie.id}/multipart/${Pe.uploadId}/${String(Je)}`,await t.getAuthValue({requestedScope:"comments:read",roomId:q}),bt,void 0,{signal:ne}),Te,_e,xe));ke.push(...await Promise.all(qe))}if(ne?.aborted)throw we;const Ct=ke.sort(($e,qe)=>$e.partNumber-qe.partNumber);return r.post(ye`/v2/c/rooms/${q}/attachments/${ie.id}/multipart/${Ce}/complete`,await t.getAuthValue({requestedScope:"comments:read",roomId:q}),{parts:Ct},{signal:ne})}catch(be){if(Ce&&be?.name&&(be.name==="AbortError"||be.name==="TimeoutError"))try{await r.rawDelete(ye`/v2/c/rooms/${q}/attachments/${ie.id}/multipart/${Ce}`,await t.getAuthValue({requestedScope:"comments:read",roomId:q}))}catch{}throw be}}}const y=new It(T=>{const q=new Xr(async ne=>{const ie=ne.flat(),{urls:we}=await r.post(ye`/v2/c/rooms/${T}/attachments/presigned-urls`,await t.getAuthValue({requestedScope:"comments:read",roomId:T}),{attachmentIds:ie});return we.map(xe=>xe??new Error("There was an error while getting this attachment's URL"))},{delay:50});return xi(q)});function w(T){return y.getOrCreate(T)}function D(T){return w(T.roomId).batch.get(T.attachmentId)}async function x(T){return r.get(ye`/v2/c/rooms/${T.roomId}/notification-settings`,await t.getAuthValue({requestedScope:"comments:read",roomId:T.roomId}),void 0,{signal:T.signal})}async function I(T){return r.post(ye`/v2/c/rooms/${T.roomId}/notification-settings`,await t.getAuthValue({requestedScope:"comments:read",roomId:T.roomId}),T.settings)}const S=new It(T=>new Xr(async q=>{const ne=q.flat();return await r.post(ye`/v2/c/rooms/${T}/inbox-notifications/read`,await t.getAuthValue({requestedScope:"comments:read",roomId:T}),{inboxNotificationIds:ne}),ne},{delay:50}));async function k(T){return S.getOrCreate(T.roomId).get(T.inboxNotificationId)}async function W(T){await r.rawPost(ye`/v2/c/rooms/${T.roomId}/text-mentions`,await t.getAuthValue({requestedScope:"comments:read",roomId:T.roomId}),{userId:T.userId,mentionId:T.mentionId})}async function P(T){await r.rawDelete(ye`/v2/c/rooms/${T.roomId}/text-mentions/${T.mentionId}`,await t.getAuthValue({requestedScope:"comments:read",roomId:T.roomId}))}async function M(T){return r.rawGet(ye`/v2/c/rooms/${T.roomId}/y-version/${T.versionId}`,await t.getAuthValue({requestedScope:"comments:read",roomId:T.roomId}))}async function F(T){await r.rawPost(ye`/v2/c/rooms/${T.roomId}/version`,await t.getAuthValue({requestedScope:"comments:read",roomId:T.roomId}))}async function B(T){await r.rawPost(ye`/v2/c/rooms/${T.roomId}/text-metadata`,await t.getAuthValue({requestedScope:"comments:read",roomId:T.roomId}),{type:T.type,rootKey:T.rootKey})}async function j(T){const q=await r.post(ye`/v2/c/rooms/${T.roomId}/ai/contextual-prompt`,await t.getAuthValue({requestedScope:"room:read",roomId:T.roomId}),{prompt:T.prompt,context:{beforeSelection:T.context.beforeSelection,selection:T.context.selection,afterSelection:T.context.afterSelection},previous:T.previous},{signal:T.signal});if(!q||q.content.length===0)throw new Error("No content returned from server");return q.content[0].text}async function $(T){const q=await r.get(ye`/v2/c/rooms/${T.roomId}/versions`,await t.getAuthValue({requestedScope:"comments:read",roomId:T.roomId}));return{versions:q.versions.map(({createdAt:ne,...ie})=>({createdAt:new Date(ne),...ie})),requestedAt:new Date(q.meta.requestedAt)}}async function re(T){const q=await r.get(ye`/v2/c/rooms/${T.roomId}/versions/delta`,await t.getAuthValue({requestedScope:"comments:read",roomId:T.roomId}),{since:T.since.toISOString()},{signal:T.signal});return{versions:q.versions.map(({createdAt:ne,...ie})=>({createdAt:new Date(ne),...ie})),requestedAt:new Date(q.meta.requestedAt)}}async function Y(T){return await(await r.rawGet(ye`/v2/c/rooms/${T.roomId}/storage`,await t.getAuthValue({requestedScope:"room:read",roomId:T.roomId}))).json()}async function ee(T){return r.rawPost(ye`/v2/c/rooms/${T.roomId}/send-message`,await t.getAuthValue({requestedScope:"room:read",roomId:T.roomId}),{nonce:T.nonce,messages:T.messages})}async function L(T){const ne=await r.get(ye`/v2/c/inbox-notifications`,await t.getAuthValue({requestedScope:"comments:read"}),{cursor:T?.cursor,limit:50});return{inboxNotifications:ne.inboxNotifications.map(In),threads:ne.threads.map(fn),nextCursor:ne.meta.nextCursor,requestedAt:new Date(ne.meta.requestedAt)}}async function Q(T){const q=await r.get(ye`/v2/c/inbox-notifications/delta`,await t.getAuthValue({requestedScope:"comments:read"}),{since:T.since.toISOString()},{signal:T.signal});return{inboxNotifications:{updated:q.inboxNotifications.map(In),deleted:q.deletedInboxNotifications.map(Ma)},threads:{updated:q.threads.map(fn),deleted:q.deletedThreads.map(ja)},requestedAt:new Date(q.meta.requestedAt)}}async function V(){const{count:T}=await r.get(ye`/v2/c/inbox-notifications/count`,await t.getAuthValue({requestedScope:"comments:read"}));return T}async function te(){await r.post(ye`/v2/c/inbox-notifications/read`,await t.getAuthValue({requestedScope:"comments:read"}),{inboxNotificationIds:"all"})}async function se(T){await r.post(ye`/v2/c/inbox-notifications/read`,await t.getAuthValue({requestedScope:"comments:read"}),{inboxNotificationIds:T})}const de=new Xr(async T=>{const q=T.flat();return await se(q),q},{delay:50});async function G(T){await de.get(T)}async function R(){await r.delete(ye`/v2/c/inbox-notifications`,await t.getAuthValue({requestedScope:"comments:read"}))}async function _(T){await r.delete(ye`/v2/c/inbox-notifications/${T}`,await t.getAuthValue({requestedScope:"comments:read"}))}async function H(T){return r.get(ye`/v2/c/notification-settings`,await t.getAuthValue({requestedScope:"comments:read"}),void 0,{signal:T?.signal})}async function X(T){return r.post(ye`/v2/c/notification-settings`,await t.getAuthValue({requestedScope:"comments:read"}),T)}async function fe(T){let q;T?.query&&(q=Xc(T.query));const ie=await r.get(ye`/v2/c/threads`,await t.getAuthValue({requestedScope:"comments:read"}),{cursor:T?.cursor,query:q,limit:50});return{threads:ie.threads.map(fn),inboxNotifications:ie.inboxNotifications.map(In),nextCursor:ie.meta.nextCursor,requestedAt:new Date(ie.meta.requestedAt),permissionHints:ie.meta.permissionHints}}async function le(T){const q=await r.get(ye`/v2/c/threads/delta`,await t.getAuthValue({requestedScope:"comments:read"}),{since:T.since.toISOString()},{signal:T.signal});return{threads:{updated:q.threads.map(fn),deleted:q.deletedThreads.map(ja)},inboxNotifications:{updated:q.inboxNotifications.map(In),deleted:q.deletedInboxNotifications.map(Ma)},requestedAt:new Date(q.meta.requestedAt),permissionHints:q.meta.permissionHints}}return{getThreads:s,getThreadsSince:o,createThread:a,getThread:u,deleteThread:i,editThreadMetadata:c,createComment:l,editComment:d,deleteComment:m,addReaction:g,removeReaction:C,markThreadAsResolved:v,markThreadAsUnresolved:h,markRoomInboxNotificationAsRead:k,getNotificationSettings:x,updateNotificationSettings:I,createTextMention:W,deleteTextMention:P,getTextVersion:M,createTextVersion:F,reportTextEditor:B,listTextVersions:$,listTextVersionsSince:re,getAttachmentUrl:D,uploadAttachment:E,getOrCreateAttachmentUrlsStore:w,streamStorage:Y,sendMessages:ee,getInboxNotifications:L,getInboxNotificationsSince:Q,getUnreadInboxNotificationsCount:V,markAllInboxNotificationsAsRead:te,markInboxNotificationAsRead:G,deleteAllInboxNotifications:R,deleteInboxNotification:_,getUserNotificationSettings:H,updateUserNotificationSettings:X,getUserThreads_experimental:fe,getUserThreadsSince_experimental:le,executeContextualPrompt:j}}function ih(e){return e.type==="public"?e.publicApiKey:e.token.raw}var iC=class{#e;#t;constructor(e,t){this.#e=e,this.#t=t}async#n(e,t,n,r){e.startsWith("/v2/c/")||wt("This client can only be used to make /v2/c/* requests");const o=sC(this.#e,e,r);return await this.#t(o,{...n,headers:{"Content-Type":"application/json; charset=utf-8",...n?.headers,Authorization:`Bearer ${ih(t)}`,"X-LB-Client":fu}})}async#r(e,t,n,r){const o=await this.#n(e,t,n,r);if(!o.ok)throw await Ar.fromResponse(o);let s;try{s=await o.json()}catch{s={}}return s}async rawGet(e,t,n,r){return await this.#n(e,t,r,n)}async rawPost(e,t,n){return await this.#n(e,t,{method:"POST",body:tn(n)})}async rawDelete(e,t){return await this.#n(e,t,{method:"DELETE"})}async get(e,t,n,r){return await this.#r(e,t,r,n)}async post(e,t,n,r,o){return await this.#r(e,t,{...r,method:"POST",body:tn(n)},o)}async delete(e,t){return await this.#r(e,t,{method:"DELETE"})}async putBlob(e,t,n,r,o){return await this.#r(e,t,{...o,method:"PUT",headers:{"Content-Type":"application/octet-stream"},body:n},r)}};function lt(e,t){throw new Error(t)}function pe(e,t="Expected value to be non-nullable"){return e}function uC(e,t){if(e===t)return[0,0];const n=e.split("."),r=t.split("."),o=Math.min(n.length,r.length);let s=0;for(;s<o&&n[s]===r[s];s++);const a=n.length-s,i=r.length-s;return[a,i]}function cC(e,t){const n=e.split(".");if(t<1||t>n.length+1)throw new Error("Invalid number of levels");const r=[];t>n.length&&r.push("*");for(let o=n.length-t+1;o<n.length;o++){const s=n.slice(0,o);s.length>0&&r.push(s.join(".")+".*")}return r.push(e),r}var lC=class{#e;constructor(e){this.#e=e}get current(){return this.#e}allowPatching(e){const t=this;let n=!0;const r={...this.#e,patch(o){if(n){t.#e=Object.assign({},t.#e,o);for(const s of Object.entries(o)){const[a,i]=s;a!=="patch"&&(this[a]=i)}}else throw new Error("Can no longer patch stale context")}};e(r),n=!1}},fC=1,uh=class{id;#e;#t;#n;#r;#s;#o;events;#i;#a;#l;get#d(){const e=this.#n.values()[Symbol.iterator]().next();if(e.done)throw new Error("No states defined yet");return e.value}get currentState(){if(this.#r===null)throw this.#e===0?new Error("Not started yet"):new Error("Already stopped");return this.#r}start(){if(this.#e!==0)throw new Error("State machine has already started");return this.#e=1,this.#r=this.#d,this.#c(null),this}stop(){if(this.#e!==1)throw new Error("Cannot stop a state machine that hasn't started yet");this.#f(null),this.#e=2,this.#r=null}constructor(e){this.id=fC++,this.#e=0,this.#r=null,this.#n=new Set,this.#a=new Map,this.#i=[],this.#l=new Set,this.#s=new Map,this.#t=new lC(e),this.#o={didReceiveEvent:Ie(),willTransition:Ie(),didIgnoreEvent:Ie(),willExitState:Ie(),didEnterState:Ie()},this.events={didReceiveEvent:this.#o.didReceiveEvent.observable,willTransition:this.#o.willTransition.observable,didIgnoreEvent:this.#o.didIgnoreEvent.observable,willExitState:this.#o.willExitState.observable,didEnterState:this.#o.didEnterState.observable}}get context(){return this.#t.current}addState(e){if(this.#e!==0)throw new Error("Already started");return this.#n.add(e),this}onEnter(e,t){if(this.#e!==0)throw new Error("Already started");if(this.#a.has(e))throw new Error(`enter/exit function for ${e} already exists`);return this.#a.set(e,t),this}onEnterAsync(e,t,n,r,o){return this.onEnter(e,()=>{const s=new AbortController,a=s.signal,i=o?setTimeout(()=>{const c=new Error("Timed out");this.#u({type:"ASYNC_ERROR",reason:c},r)},o):void 0;let u=!1;return t(this.#t.current,a).then(c=>{a.aborted||(u=!0,this.#u({type:"ASYNC_OK",data:c},n))},c=>{a.aborted||(u=!0,this.#u({type:"ASYNC_ERROR",reason:c},r))}),()=>{clearTimeout(i),u||s.abort()}})}#h(e){const t=[];if(e==="*")for(const n of this.#n)t.push(n);else if(e.endsWith(".*")){const n=e.slice(0,-1);for(const r of this.#n)r.startsWith(n)&&t.push(r)}else{const n=e;this.#n.has(n)&&t.push(n)}if(t.length===0)throw new Error(`No states match ${JSON.stringify(e)}`);return t}addTransitions(e,t){if(this.#e!==0)throw new Error("Already started");for(const n of this.#h(e)){let r=this.#s.get(n);r===void 0&&(r=new Map,this.#s.set(n,r));for(const[o,s]of Object.entries(t)){if(r.has(o))throw new Error(`Trying to set transition "${o}" on "${n}" (via "${e}"), but a transition already exists there.`);const a=s;if(this.#l.add(o),a!==void 0){const i=typeof a=="function"?a:()=>a;r.set(o,i)}}}return this}addTimedTransition(e,t,n){return this.onEnter(e,()=>{const r=typeof t=="function"?t(this.#t.current):t,o=setTimeout(()=>{this.#u({type:"TIMER"},n)},r);return()=>{clearTimeout(o)}})}#p(e){return this.#s.get(this.currentState)?.get(e)}#f(e){this.#o.willExitState.notify(this.currentState),this.#t.allowPatching(t=>{e=e??this.#i.length;for(let n=0;n<e;n++)this.#i.pop()?.(t)})}#c(e){const t=cC(this.currentState,e??this.currentState.split(".").length+1);this.#t.allowPatching(n=>{for(const r of t){const s=this.#a.get(r)?.(n);typeof s=="function"?this.#i.push(s):this.#i.push(null)}}),this.#o.didEnterState.notify(this.currentState)}send(e){if(!this.#l.has(e.type))throw new Error(`Invalid event ${JSON.stringify(e.type)}`);if(this.#e===2)return;const t=this.#p(e.type);if(t!==void 0)return this.#u(e,t);this.#o.didIgnoreEvent.notify(e)}#u(e,t){this.#o.didReceiveEvent.notify(e);const n=this.currentState,o=(typeof t=="function"?t:()=>t)(e,this.#t.current);let s,a;if(o===null){this.#o.didIgnoreEvent.notify(e);return}if(typeof o=="string"?s=o:(s=o.target,a=Array.isArray(o.effect)?o.effect:[o.effect]),!this.#n.has(s))throw new Error(`Invalid next state name: ${JSON.stringify(s)}`);this.#o.willTransition.notify({from:n,to:s});const[i,u]=uC(this.currentState,s);if(i>0&&this.#f(i),this.#r=s,a!==void 0){const c=a;this.#t.allowPatching(l=>{for(const d of c)typeof d=="function"?d(l,e):l.patch(d)})}u>0&&this.#c(u)}},Zt=(e=>(e[e.UPDATE_PRESENCE=100]="UPDATE_PRESENCE",e[e.USER_JOINED=101]="USER_JOINED",e[e.USER_LEFT=102]="USER_LEFT",e[e.BROADCASTED_EVENT=103]="BROADCASTED_EVENT",e[e.ROOM_STATE=104]="ROOM_STATE",e[e.INITIAL_STORAGE_STATE=200]="INITIAL_STORAGE_STATE",e[e.UPDATE_STORAGE=201]="UPDATE_STORAGE",e[e.REJECT_STORAGE_OP=299]="REJECT_STORAGE_OP",e[e.UPDATE_YDOC=300]="UPDATE_YDOC",e[e.THREAD_CREATED=400]="THREAD_CREATED",e[e.THREAD_DELETED=407]="THREAD_DELETED",e[e.THREAD_METADATA_UPDATED=401]="THREAD_METADATA_UPDATED",e[e.THREAD_UPDATED=408]="THREAD_UPDATED",e[e.COMMENT_CREATED=402]="COMMENT_CREATED",e[e.COMMENT_EDITED=403]="COMMENT_EDITED",e[e.COMMENT_DELETED=404]="COMMENT_DELETED",e[e.COMMENT_REACTION_ADDED=405]="COMMENT_REACTION_ADDED",e[e.COMMENT_REACTION_REMOVED=406]="COMMENT_REACTION_REMOVED",e))(Zt||{});function tl(e){return e===4999||e>=4e3&&e<4100}function dC(e){return e>=4100&&e<4200}function nl(e){return e===1013||e>=4200&&e<4300}function hC(e){return e==="initial"||e==="disconnected"}function ch(e){const t=e.currentState;switch(t){case"@ok.connected":case"@ok.awaiting-pong":return"connected";case"@idle.initial":return"initial";case"@auth.busy":case"@auth.backoff":case"@connecting.busy":case"@connecting.backoff":case"@idle.zombie":return e.context.successCount>0?"reconnecting":"connecting";case"@idle.failed":return"disconnected";default:return lt(t,"Unknown state")}}var lh=[250,500,1e3,2e3,4e3,8e3,1e4],Uo=lh[0]-1,pC=[2e3,3e4,6e4,3e5],mC=3e4,vC=2e3,gC=1e4,CC=1e4,Ln=class extends Error{constructor(e){super(e)}};function fh(e,t){return t.find(n=>n>e)??t[t.length-1]}function rr(e){e.patch({backoffDelay:fh(e.backoffDelay,lh)})}function rl(e){e.patch({backoffDelay:fh(e.backoffDelay,pC)})}function ol(e){e.patch({successCount:0})}function cr(e,t){const n=e===2?wo:e===1?ft:()=>{};return()=>{n(t)}}function sl(e){const t="Connection to Liveblocks websocket server";return n=>{e instanceof Error?ft(`${t} could not be established. ${String(e)}`):ft(dh(e)?`${t} closed prematurely (code: ${e.code}). Retrying in ${n.backoffDelay}ms.`:`${t} could not be established.`)}}function _a(e){const t=[`code: ${e.code}`];return e.reason&&t.push(`reason: ${e.reason}`),n=>{ft(`Connection to Liveblocks websocket server closed (${t.join(", ")}). Retrying in ${n.backoffDelay}ms.`)}}var bC=cr(1,"Connection to WebSocket closed permanently. Won't retry.");function dh(e){return!(e instanceof Error)&&e.type==="close"}function yC(e){const t=new Date().getTime();function n(...o){ft(`${((new Date().getTime()-t)/1e3).toFixed(2)} [FSM #${e.id}]`,...o)}const r=[e.events.didReceiveEvent.subscribe(o=>n(`Event ${o.type}`)),e.events.willTransition.subscribe(({from:o,to:s})=>n("Transitioning",o,"→",s)),e.events.didIgnoreEvent.subscribe(o=>n("Ignored event",o.type,o,"(current state won't handle it)"))];return()=>{for(const o of r)o()}}function EC(e){const t=Ie(),n=Ie(),r=Ie();let o=null;const s=e.events.didEnterState.subscribe(()=>{const a=ch(e);a!==o&&t.notify(a),o==="connected"&&a!=="connected"?r.notify():o!=="connected"&&a==="connected"&&n.notify(),o=a});return{statusDidChange:t.observable,didConnect:n.observable,didDisconnect:r.observable,unsubscribe:s}}var Ho=e=>t=>t.patch(e);function DC(e,t){const n=K0();n.pause();const r=Ie();function o(y,w){return()=>{r.notify({message:y,code:w})}}const s={successCount:0,authValue:null,socket:null,backoffDelay:Uo},a=new uh(s).addState("@idle.initial").addState("@idle.failed").addState("@idle.zombie").addState("@auth.busy").addState("@auth.backoff").addState("@connecting.busy").addState("@connecting.backoff").addState("@ok.connected").addState("@ok.awaiting-pong");a.addTransitions("*",{RECONNECT:{target:"@auth.backoff",effect:[rr,ol]},DISCONNECT:"@idle.initial"}),a.onEnter("@idle.*",ol).addTransitions("@idle.*",{CONNECT:(y,w)=>w.authValue!==null?"@connecting.busy":"@auth.busy"}),a.addTransitions("@auth.backoff",{NAVIGATOR_ONLINE:{target:"@auth.busy",effect:Ho({backoffDelay:Uo})}}).addTimedTransition("@auth.backoff",y=>y.backoffDelay,"@auth.busy").onEnterAsync("@auth.busy",()=>Gc(e.authenticate(),gC,"Timed out during auth"),y=>({target:"@connecting.busy",effect:Ho({authValue:y.data})}),y=>y.reason instanceof Ln?{target:"@idle.failed",effect:[cr(2,y.reason.message),o(y.reason.message,-1)]}:{target:"@auth.backoff",effect:[rr,cr(2,`Authentication failed: ${y.reason instanceof Error?y.reason.message:String(y.reason)}`)]});const i=y=>a.send({type:"EXPLICIT_SOCKET_ERROR",event:y}),u=y=>a.send({type:"EXPLICIT_SOCKET_CLOSE",event:y}),c=y=>y.data==="pong"?a.send({type:"PONG"}):n.notify(y);function l(y){y&&(y.removeEventListener("error",i),y.removeEventListener("close",u),y.removeEventListener("message",c),y.close())}a.addTransitions("@connecting.backoff",{NAVIGATOR_ONLINE:{target:"@connecting.busy",effect:Ho({backoffDelay:Uo})}}).addTimedTransition("@connecting.backoff",y=>y.backoffDelay,"@connecting.busy").onEnterAsync("@connecting.busy",async(y,w)=>{let D=null,x=null;const I=new Promise((S,k)=>{if(y.authValue===null)throw new Error("No auth authValue");const W=e.createSocket(y.authValue);x=W;function P(j){D=j,W.removeEventListener("message",c),k(j)}const[M,F]=th();t.waitForActorId||F();function B(j){$s(j.data)?.type===104&&F()}W.addEventListener("message",c),t.waitForActorId&&W.addEventListener("message",B),W.addEventListener("error",P),W.addEventListener("close",P),W.addEventListener("open",()=>{W.addEventListener("error",i),W.addEventListener("close",u);const j=()=>{W.removeEventListener("error",P),W.removeEventListener("close",P),W.removeEventListener("message",B)};M.then(()=>{S([W,j])})})});return Gc(I,CC,"Timed out during websocket connection").then(([S,k])=>{if(k(),w.aborted)throw new Error("Aborted");if(D)throw D;return S}).catch(S=>{throw l(x),S})},y=>({target:"@ok.connected",effect:Ho({socket:y.data,backoffDelay:Uo})}),y=>{const w=y.reason;if(w instanceof Ln)return{target:"@idle.failed",effect:[cr(2,w.message),o(w.message,-1)]};if(dh(w)){if(w.code===4109)return"@auth.busy";if(nl(w.code))return{target:"@connecting.backoff",effect:[rl,sl(w)]};if(tl(w.code))return{target:"@idle.failed",effect:[cr(2,w.reason),o(w.reason,w.code)]}}return{target:"@auth.backoff",effect:[rr,sl(w)]}});const d={target:"@ok.awaiting-pong",effect:y=>{y.socket?.send("ping")}},m=()=>(typeof document<"u"?document:void 0)?.visibilityState==="hidden"&&e.canZombie()?"@idle.zombie":d;if(a.addTimedTransition("@ok.connected",mC,m).addTransitions("@ok.connected",{NAVIGATOR_OFFLINE:m,WINDOW_GOT_FOCUS:d}),a.addTransitions("@idle.zombie",{WINDOW_GOT_FOCUS:"@connecting.backoff"}),a.onEnter("@ok.*",y=>{y.patch({successCount:y.successCount+1});const w=setTimeout(n.unpause,0);return D=>{l(D.socket),D.patch({socket:null}),clearTimeout(w),n.pause()}}).addTransitions("@ok.awaiting-pong",{PONG:"@ok.connected"}).addTimedTransition("@ok.awaiting-pong",vC,{target:"@connecting.busy",effect:cr(1,"Received no pong from server, assume implicit connection loss.")}).addTransitions("@ok.*",{EXPLICIT_SOCKET_ERROR:(y,w)=>w.socket?.readyState===1?null:{target:"@connecting.backoff",effect:rr},EXPLICIT_SOCKET_CLOSE:y=>tl(y.event.code)?{target:"@idle.failed",effect:[bC,o(y.event.reason,y.event.code)]}:dC(y.event.code)?y.event.code===4109?"@auth.busy":{target:"@auth.backoff",effect:[rr,_a(y.event)]}:nl(y.event.code)?{target:"@connecting.backoff",effect:[rl,_a(y.event)]}:{target:"@connecting.backoff",effect:[rr,_a(y.event)]}}),typeof document<"u"){const y=typeof document<"u"?document:void 0,w=typeof window<"u"?window:void 0,D=w??y;a.onEnter("*",x=>{function I(){a.send({type:"NAVIGATOR_OFFLINE"})}function S(){a.send({type:"NAVIGATOR_ONLINE"})}function k(){y?.visibilityState==="visible"&&a.send({type:"WINDOW_GOT_FOCUS"})}return w?.addEventListener("online",S),w?.addEventListener("offline",I),D?.addEventListener("visibilitychange",k),()=>{D?.removeEventListener("visibilitychange",k),w?.removeEventListener("online",S),w?.removeEventListener("offline",I),l(x.socket)}})}const g=[],{statusDidChange:C,didConnect:v,didDisconnect:h,unsubscribe:E}=EC(a);return g.push(E),t.enableDebugLogging&&g.push(yC(a)),a.start(),{machine:a,cleanups:g,events:{statusDidChange:C,didConnect:v,didDisconnect:h,onMessage:n.observable,onConnectionError:r.observable}}}var wC=class{#e;#t;events;constructor(e,t=!1,n=!0){const{machine:r,events:o,cleanups:s}=DC(e,{waitForActorId:n,enableDebugLogging:t});this.#e=r,this.events=o,this.#t=s}getStatus(){try{return ch(this.#e)}catch{return"initial"}}get authValue(){return this.#e.context.authValue}connect(){this.#e.send({type:"CONNECT"})}reconnect(){this.#e.send({type:"RECONNECT"})}disconnect(){this.#e.send({type:"DISCONNECT"})}destroy(){this.#e.stop();let e;for(;e=this.#t.pop();)e()}send(e){const t=this.#e.context?.socket;t===null?ft("Cannot send: not connected yet",e):t.readyState!==1?ft("Cannot send: WebSocket no longer open",e):t.send(e)}_privateSendMachineEvent(e){this.#e.send(e)}},Oi=(e=>(e.Read="room:read",e.Write="room:write",e.PresenceWrite="room:presence:write",e.CommentsWrite="comments:write",e.CommentsRead="comments:read",e))(Oi||{});function Si(e){return e.includes("room:write")}function hh(e){return e.includes("comments:write")||e.includes("room:write")}function AC(e){return nn(e)&&(e.k==="acc"||e.k==="id"||e.k==="sec-legacy")}function al(e){const t=e.split(".");if(t.length!==3)throw new Error("Authentication error: invalid JWT token");const n=$s(W0(t[1]));if(!(n&&AC(n)))throw new Error("Authentication error: expected a valid token but did not get one. Hint: if you are using a callback, ensure the room is passed when creating the token. For more information: https://liveblocks.io/docs/api-reference/liveblocks-client#createClientCallback");return{raw:e,parsed:n}}function xC(e,t){const n=OC(e),r=new Set,o=[],s=[],a=new Map;function i(){r.clear(),o.length=0,s.length=0,a.clear()}function u(m,g){return m==="comments:read"?g.includes("comments:read")||g.includes("comments:write")||g.includes("room:read")||g.includes("room:write"):m==="room:read"?g.includes("room:read")||g.includes("room:write"):!1}function c(m){const g=Math.ceil(Date.now()/1e3);for(let C=o.length-1;C>=0;C--){const v=o[C];if(s[C]<=g){o.splice(C,1),s.splice(C,1);continue}if(v.parsed.k==="id")return v;if(v.parsed.k==="acc"){if(!m.roomId&&Object.entries(v.parsed.perms).length===0)return v;for(const[E,y]of Object.entries(v.parsed.perms))if(m.roomId){if(E.includes("*")&&m.roomId.startsWith(E.replace("*",""))||m.roomId===E&&u(m.requestedScope,y))return v}else if(E.includes("*")&&u(m.requestedScope,y))return v}}}async function l(m){const g=e.polyfills?.fetch??(typeof window>"u"?void 0:window.fetch);if(n.type==="private"){if(g===void 0)throw new Ln("To use Liveblocks client in a non-DOM environment with a url as auth endpoint, you need to provide a fetch polyfill.");const C=await SC(g,n.url,{room:m.roomId}),v=al(C.token);if(r.has(v.raw))throw new Ln("The same Liveblocks auth token was issued from the backend before. Caching Liveblocks tokens is not supported.");return t?.(v.parsed),v}if(n.type==="custom"){const C=await n.callback(m.roomId);if(C&&typeof C=="object"){if(typeof C.token=="string"){const v=al(C.token);return t?.(v.parsed),v}else if(typeof C.error=="string"){const v=`Authentication failed: ${"reason"in C&&typeof C.reason=="string"?C.reason:"Forbidden"}`;throw C.error==="forbidden"?new Ln(v):new Error(v)}}throw new Error('Your authentication callback function should return a token, but it did not. Hint: the return value should look like: { token: "..." }')}throw new Error("Unexpected authentication type. Must be private or custom.")}async function d(m){if(n.type==="public")return{type:"public",publicApiKey:n.publicApiKey};const g=c(m);if(g!==void 0)return{type:"secret",token:g};let C;m.roomId?(C=a.get(m.roomId),C===void 0&&(C=l(m),a.set(m.roomId,C))):(C=a.get("liveblocks-user-token"),C===void 0&&(C=l(m),a.set("liveblocks-user-token",C)));try{const v=await C,E=Math.floor(Date.now()/1e3)+(v.parsed.exp-v.parsed.iat)-30;return r.add(v.raw),v.parsed.k!=="sec-legacy"&&(o.push(v),s.push(E)),{type:"secret",token:v}}finally{m.roomId?a.delete(m.roomId):a.delete("liveblocks-user-token")}}return{reset:i,getAuthValue:d}}function OC(e){const{publicApiKey:t,authEndpoint:n}=e;if(n!==void 0&&t!==void 0)throw new Error("You cannot simultaneously use `publicApiKey` and `authEndpoint` options. Please pick one and leave the other option unspecified. For more information: https://liveblocks.io/docs/api-reference/liveblocks-client#createClient");if(typeof t=="string"){if(t.startsWith("sk_"))throw new Error("Invalid `publicApiKey` option. The value you passed is a secret key, which should not be used from the client. Please only ever pass a public key here. For more information: https://liveblocks.io/docs/api-reference/liveblocks-client#createClientPublicKey");if(!t.startsWith("pk_"))throw new Error("Invalid key. Please use the public key format: pk_<public key>. For more information: https://liveblocks.io/docs/api-reference/liveblocks-client#createClientPublicKey");return{type:"public",publicApiKey:t}}if(typeof n=="string")return{type:"private",url:n};if(typeof n=="function")return{type:"custom",callback:n};throw n!==void 0?new Error("The `authEndpoint` option must be a string or a function. For more information: https://liveblocks.io/docs/api-reference/liveblocks-client#createClientAuthEndpoint"):new Error("Invalid Liveblocks client options. Please provide either a `publicApiKey` or `authEndpoint` option. They cannot both be empty. For more information: https://liveblocks.io/docs/api-reference/liveblocks-client#createClient")}async function SC(e,t,n){const r=await e(t,{method:"POST",headers:{"Content-Type":"application/json"},body:tn(n)});if(!r.ok){const a=`${(await r.text()).trim()||"reason not provided in auth response"} (${r.status} returned by POST ${t})`;throw r.status===401||r.status===403?new Ln(`Unauthorized: ${a}`):new Error(`Failed to authenticate: ${a}`)}let o;try{o=await r.json()}catch(a){throw new Error(`Expected a JSON response when doing a POST request on "${t}". ${String(a)}`)}if(!nn(o)||typeof o.token!="string")throw new Error(`Expected a JSON response of the form \`{ token: "..." }\` when doing a POST request on "${t}", but got ${tn(o)}`);const{token:s}=o;return{token:s}}var TC="https://api.liveblocks.io",Oe=Symbol(),RC=Ie();RC.observable;var Zr=Symbol("user-notification-settings-plain");function bs(e){const t=["email","slack","teams","webPush"],n={[Zr]:{value:e,enumerable:!1}};for(const r of t)n[r]={enumerable:!0,get(){const o=this[Zr][r];return typeof o>"u"?(wo(`In order to use the '${r}' channel, please set up your project first. For more information: https://liveblocks.io/docs/errors/enable-a-notification-channel`),null):o}};return H0(null,n)}function IC(e,t){const n=bs({...e[Zr]});for(const r of U0(t)){const o=t[r];if(o!==void 0){const s=Object.fromEntries(hu(o).filter(([,a])=>a!==void 0));n[Zr][r]={...n[Zr][r],...s}}}return n}var Pt=32,Dn=126,BC=Dn-Pt+1,gu=Cu(0),Us=Cu(1),FC=gu+Cu(-1);function Cu(e){const t=Pt+(e<0?BC+e:e);if(t<Pt||t>Dn)throw new Error(`Invalid n value: ${e}`);return String.fromCharCode(t)}function Yt(e,t){return e!==void 0&&t!==void 0?kC(e,t):e!==void 0?NC(e):t!==void 0?PC(t):Us}function PC(e){const t=e.length-1;for(let n=0;n<=t;n++){const r=e.charCodeAt(n);if(!(r<=Pt))return n===t?r===Pt+1?e.substring(0,n)+FC:e.substring(0,n)+String.fromCharCode(r-1):e.substring(0,n+1)}return Us}function NC(e){for(let t=0;t<=e.length-1;t++){const n=e.charCodeAt(t);if(!(n>=Dn))return e.substring(0,t)+String.fromCharCode(n+1)}return e+Us}function kC(e,t){if(e<t)return Ti(e,t);if(e>t)return Ti(t,e);throw new Error("Cannot compute value between two equal positions")}function Ti(e,t){let n=0;const r=e.length,o=t.length;for(;;){const s=n<r?e.charCodeAt(n):Pt,a=n<o?t.charCodeAt(n):Dn;if(s===a){n++;continue}if(a-s===1){const i=n+1;let u=e.substring(0,i);u.length<i&&(u+=gu.repeat(i-u.length));const c=e.substring(i);return u+Ti(c,"")}else return jC(e,n)+String.fromCharCode(a+s>>1)}}function jC(e,t){return t<e.length?e.substring(0,t):e+gu.repeat(t-e.length)}var MC=Pt+1;function _C(e){if(e==="")return!1;const t=e.length-1,n=e.charCodeAt(t);if(n<MC||n>Dn)return!1;for(let r=0;r<t;r++){const o=e.charCodeAt(r);if(o<Pt||o>Dn)return!1}return!0}function LC(e){const t=[];for(let n=0;n<e.length;n++){const r=e.charCodeAt(n);t.push(r<Pt?Pt:r>Dn?Dn:r)}for(;t.length>0&&t[t.length-1]===Pt;)t.length--;return t.length>0?String.fromCharCode(...t):Us}function oo(e){return _C(e)?e:LC(e)}function $C(e){return e.type===5&&e.id==="ACK"}function UC(e,t){const{getCurrentConnectionId:n,onDispatch:r,isStorageWritable:o=()=>!0}=t;let s=0,a=0;const i=new Map;return{roomId:e,nodes:i,getNode:u=>i.get(u),addNode:(u,c)=>void i.set(u,c),deleteNode:u=>void i.delete(u),generateId:()=>`${n()}:${s++}`,generateOpId:()=>`${n()}:${a++}`,dispatch(u,c,l){r?.(u,c,l)},assertStorageIsWritable:()=>{if(!o())throw new Error("Cannot write to storage with a read only user, please ensure the user has write permissions")}}}function il(e,t,n=oo(t)){return Object.freeze({type:"HasParent",node:e,key:t,pos:n})}var ul=Object.freeze({type:"NoParent"});function HC(e,t=oo(e)){return Object.freeze({type:"Orphaned",oldKey:e,oldPos:t})}var Hs=class{#e;#t;#n=ul;_getParentKeyOrThrow(){switch(this.parent.type){case"HasParent":return this.parent.key;case"NoParent":throw new Error("Parent key is missing");case"Orphaned":return this.parent.oldKey;default:return lt(this.parent,"Unknown state")}}get _parentPos(){switch(this.parent.type){case"HasParent":return this.parent.pos;case"NoParent":throw new Error("Parent key is missing");case"Orphaned":return this.parent.oldPos;default:return lt(this.parent,"Unknown state")}}get _pool(){return this.#e}get roomId(){return this.#e?this.#e.roomId:null}get _id(){return this.#t}get parent(){return this.#n}get _parentKey(){switch(this.parent.type){case"HasParent":return this.parent.key;case"NoParent":return null;case"Orphaned":return this.parent.oldKey;default:return lt(this.parent,"Unknown state")}}_apply(e,t){switch(e.type){case 5:return this.parent.type==="HasParent"?this.parent.node._detachChild(this):{modified:!1}}return{modified:!1}}_setParentLink(e,t){switch(this.parent.type){case"HasParent":if(this.parent.node!==e)throw new Error("Cannot set parent: node already has a parent");this.#n=il(e,t);return;case"Orphaned":case"NoParent":{this.#n=il(e,t);return}default:return lt(this.parent,"Unknown state")}}_attach(e,t){if(this.#t||this.#e)throw new Error("Cannot attach node: already attached");t.addNode(e,this),this.#t=e,this.#e=t}_detach(){switch(this.#e&&this.#t&&this.#e.deleteNode(this.#t),this.parent.type){case"HasParent":{this.#n=HC(this.parent.key,this.parent.pos);break}case"NoParent":{this.#n=ul;break}case"Orphaned":break;default:lt(this.parent,"Unknown state")}this.#e=void 0}#r;#s;#o;invalidate(){(this.#r!==void 0||this.#o!==void 0)&&(this.#r=void 0,this.#o=void 0,this.parent.type==="HasParent"&&this.parent.node.invalidate())}toTreeNode(e){return(this.#o===void 0||this.#s!==e)&&(this.#s=e,this.#o=this._toTreeNode(e)),this.#o}toImmutable(){return this.#r===void 0&&(this.#r=this._toImmutable()),this.#r}};function WC(e){return e.type===0&&!zC(e)}function zC(e){return e.parentId!==void 0&&e.parentKey!==void 0}var Sn=class ph extends Hs{#e;constructor(t){super(),this.#e=t}get data(){return this.#e}static _deserialize([t,n],r,o){const s=new ph(n.data);return s._attach(t,o),s}_toOps(t,n,r){if(this._id===void 0)throw new Error("Cannot serialize register if parentId or parentKey is undefined");return[{type:8,opId:r?.generateOpId(),id:this._id,parentId:t,parentKey:n,data:this.data}]}_serialize(){if(this.parent.type!=="HasParent")throw new Error("Cannot serialize LiveRegister if parent is missing");return{type:3,parentId:pe(this.parent.node._id,"Parent node expected to have ID"),parentKey:this.parent.key,data:this.data}}_attachChild(t){throw new Error("Method not implemented.")}_detachChild(t){throw new Error("Method not implemented.")}_apply(t,n){return super._apply(t,n)}_toTreeNode(t){return{type:"Json",id:this._id??Pr(),key:t,payload:this.#e}}_toImmutable(){return this.#e}clone(){return ro(this.data)}};function VC(e,t){const n=e._parentPos,r=t._parentPos;return n===r?0:n<r?-1:1}var Nr=class Ri extends Hs{#e;#t;#n;constructor(t){super(),this.#e=[],this.#t=new WeakSet,this.#n=new Map;let n;for(const r of t){const o=Yt(n),s=mr(r);s._setParentLink(this,o),this.#e.push(s),n=o}}static _deserialize([t],n,r){const o=new Ri([]);o._attach(t,r);const s=n.get(t);if(s===void 0)return o;for(const[a,i]of s){const u=gh([a,i],n,r);u._setParentLink(o,i.parentKey),o._insertAndSort(u)}return o}_toOps(t,n,r){if(this._id===void 0)throw new Error("Cannot serialize item is not attached");const o=[],s={id:this._id,opId:r?.generateOpId(),type:2,parentId:t,parentKey:n};o.push(s);for(const a of this.#e){const i=a._getParentKeyOrThrow(),u=zo(a._toOps(this._id,i,r),void 0),c=u[0].opId;c!==void 0&&this.#n.set(i,c),o.push(...u)}return o}_insertAndSort(t){this.#e.push(t),this._sortItems()}_sortItems(){this.#e.sort(VC),this.invalidate()}_indexOfPosition(t){return this.#e.findIndex(n=>n._getParentKeyOrThrow()===t)}_attach(t,n){super._attach(t,n);for(const r of this.#e)r._attach(n.generateId(),n)}_detach(){super._detach();for(const t of this.#e)t._detach()}#r(t){if(this._pool===void 0)throw new Error("Can't attach child if managed pool is not present");const{id:n,parentKey:r}=t,o=zr(t);o._attach(n,this._pool),o._setParentLink(this,r);const s=t.deletedId,a=this._indexOfPosition(r);if(a!==-1){const i=this.#e[a];if(i._id===s)return i._detach(),this.#e[a]=o,{modified:Fe(this,[or(a,o)]),reverse:[]};{this.#t.add(i),this.#e[a]=o;const u=[or(a,o)],c=this.#o(t.deletedId);return c&&u.push(c),{modified:Fe(this,u),reverse:[]}}}else{const i=[],u=this.#o(t.deletedId);return u&&i.push(u),this._insertAndSort(o),i.push(Mt(this._indexOfPosition(r),o)),{reverse:[],modified:Fe(this,i)}}}#s(t){if(this._pool===void 0)throw new Error("Can't attach child if managed pool is not present");const n=[],r=this.#o(t.deletedId);r&&n.push(r);const o=this.#n.get(t.parentKey);if(o!==void 0){if(o!==t.opId)return n.length===0?{modified:!1}:{modified:Fe(this,n),reverse:[]};this.#n.delete(t.parentKey)}const s=this._indexOfPosition(t.parentKey),a=this.#e.find(i=>i._id===t.id);if(a!==void 0){if(a._parentKey===t.parentKey)return{modified:n.length>0?Fe(this,n):!1,reverse:[]};if(s!==-1){this.#t.add(this.#e[s]);const[c]=this.#e.splice(s,1);n.push(Wo(s,c))}const i=this.#e.indexOf(a);a._setParentLink(this,t.parentKey),this._sortItems();const u=this.#e.indexOf(a);return u!==i&&n.push(Fn(i,u,a)),{modified:n.length>0?Fe(this,n):!1,reverse:[]}}else{const i=this._pool.getNode(t.id);if(i&&this.#t.has(i)){i._setParentLink(this,t.parentKey),this.#t.delete(i),this._insertAndSort(i);const u=this.#e.indexOf(i);return{modified:Fe(this,[s===-1?Mt(u,i):or(u,i),...n]),reverse:[]}}else{s!==-1&&this.#e.splice(s,1);const{newItem:u,newIndex:c}=this.#c(t,t.parentKey);return{modified:Fe(this,[s===-1?Mt(c,u):or(c,u),...n]),reverse:[]}}}}#o(t){if(t===void 0||this._pool===void 0)return null;const n=this._pool.getNode(t);if(n===void 0)return null;const r=this._detachChild(n);return r.modified===!1?null:r.modified.updates[0]}#i(t){if(this._pool===void 0)throw new Error("Can't attach child if managed pool is not present");const n=oo(t.parentKey),r=this._indexOfPosition(n);r!==-1&&this.#u(r,n);const{newItem:o,newIndex:s}=this.#c(t,n);return{modified:Fe(this,[Mt(s,o)]),reverse:[]}}#a(t){const n=this.#e.find(s=>s._id===t.id),r=oo(t.parentKey),o=this._indexOfPosition(r);if(n){if(n._parentKey===r)return{modified:!1};{const s=this.#e.indexOf(n);o!==-1&&this.#u(o,r),n._setParentLink(this,r),this._sortItems();const a=this._indexOfPosition(r);return a===s?{modified:!1}:{modified:Fe(this,[Fn(s,a,n)]),reverse:[]}}}else{const s=pe(this._pool).getNode(t.id);if(s&&this.#t.has(s)){s._setParentLink(this,r),this.#t.delete(s),this._insertAndSort(s);const a=this._indexOfPosition(r);return{modified:Fe(this,[Mt(a,s)]),reverse:[]}}else{o!==-1&&this.#u(o,r);const{newItem:a,newIndex:i}=this.#c(t,r);return{modified:Fe(this,[Mt(i,a)]),reverse:[]}}}}#l(t){const{id:n,parentKey:r}=t,o=zr(t);if(this._pool?.getNode(n)!==void 0)return{modified:!1};o._attach(n,pe(this._pool)),o._setParentLink(this,r);const s=this._indexOfPosition(r);let a=r;if(s!==-1){const u=this.#e[s]?._parentPos,c=this.#e[s+1]?._parentPos;a=Yt(u,c),o._setParentLink(this,a)}this._insertAndSort(o);const i=this._indexOfPosition(a);return{modified:Fe(this,[Mt(i,o)]),reverse:[{type:5,id:n}]}}#d(t){const{id:n,parentKey:r}=t,o=zr(t);if(this._pool?.getNode(n)!==void 0)return{modified:!1};this.#n.set(r,pe(t.opId));const s=this._indexOfPosition(r);o._attach(n,pe(this._pool)),o._setParentLink(this,r);const a=r;if(s!==-1){const i=this.#e[s];i._detach(),this.#e[s]=o;const u=zo(i._toOps(pe(this._id),r,this._pool),t.id),c=[or(s,o)],l=this.#o(t.deletedId);return l&&c.push(l),{modified:Fe(this,c),reverse:u}}else{this._insertAndSort(o),this.#o(t.deletedId);const i=this._indexOfPosition(a);return{reverse:[{type:5,id:n}],modified:Fe(this,[Mt(i,o)])}}}_attachChild(t,n){if(this._pool===void 0)throw new Error("Can't attach child if managed pool is not present");let r;return t.intent==="set"?n===1?r=this.#r(t):n===2?r=this.#s(t):r=this.#d(t):n===1?r=this.#i(t):n===2?r=this.#a(t):r=this.#l(t),r.modified!==!1&&this.invalidate(),r}_detachChild(t){if(t){const n=pe(t._parentKey),r=t._toOps(pe(this._id),n,this._pool),o=this.#e.indexOf(t);if(o===-1)return{modified:!1};const[s]=this.#e.splice(o,1);return this.invalidate(),t._detach(),{modified:Fe(this,[Wo(o,s)]),reverse:r}}return{modified:!1}}#h(t,n){if(this.#t.has(n)){this.#t.delete(n),n._setParentLink(this,t),this._insertAndSort(n);const s=this.#e.indexOf(n);return{modified:Fe(this,[Mt(s,n)]),reverse:[]}}const r=n._parentKey;if(t===r)return{modified:!1};const o=this._indexOfPosition(t);if(o===-1){const s=this.#e.indexOf(n);n._setParentLink(this,t),this._sortItems();const a=this.#e.indexOf(n);return a===s?{modified:!1}:{modified:Fe(this,[Fn(s,a,n)]),reverse:[]}}else{this.#e[o]._setParentLink(this,Yt(t,this.#e[o+1]?._parentPos));const s=this.#e.indexOf(n);n._setParentLink(this,t),this._sortItems();const a=this.#e.indexOf(n);return a===s?{modified:!1}:{modified:Fe(this,[Fn(s,a,n)]),reverse:[]}}}#p(t,n){const r=pe(n._parentKey);if(this.#t.has(n)){const o=this._indexOfPosition(t);return this.#t.delete(n),o!==-1&&this.#e[o]._setParentLink(this,Yt(t,this.#e[o+1]?._parentPos)),n._setParentLink(this,t),this._insertAndSort(n),{modified:!1}}else{if(t===r)return{modified:!1};const o=this.#e.indexOf(n),s=this._indexOfPosition(t);s!==-1&&this.#e[s]._setParentLink(this,Yt(t,this.#e[s+1]?._parentPos)),n._setParentLink(this,t),this._sortItems();const a=this.#e.indexOf(n);return o===a?{modified:!1}:{modified:Fe(this,[Fn(o,a,n)]),reverse:[]}}}#f(t,n){const r=pe(n._parentKey),o=this.#e.indexOf(n),s=this._indexOfPosition(t);s!==-1&&this.#e[s]._setParentLink(this,Yt(t,this.#e[s+1]?._parentPos)),n._setParentLink(this,t),this._sortItems();const a=this.#e.indexOf(n);return o===a?{modified:!1}:{modified:Fe(this,[Fn(o,a,n)]),reverse:[{type:1,id:pe(n._id),parentKey:r}]}}_setChildKey(t,n,r){return r===1?this.#h(t,n):r===2?this.#p(t,n):this.#f(t,n)}_apply(t,n){return super._apply(t,n)}_serialize(){if(this.parent.type!=="HasParent")throw new Error("Cannot serialize LiveList if parent is missing");return{type:1,parentId:pe(this.parent.node._id,"Parent node expected to have ID"),parentKey:this.parent.key}}get length(){return this.#e.length}push(t){return this._pool?.assertStorageIsWritable(),this.insert(t,this.length)}insert(t,n){if(this._pool?.assertStorageIsWritable(),n<0||n>this.#e.length)throw new Error(`Cannot insert list item at index "${n}". index should be between 0 and ${this.#e.length}`);const r=this.#e[n-1]?this.#e[n-1]._parentPos:void 0,o=this.#e[n]?this.#e[n]._parentPos:void 0,s=Yt(r,o),a=mr(t);if(a._setParentLink(this,s),this._insertAndSort(a),this._pool&&this._id){const i=this._pool.generateId();a._attach(i,this._pool),this._pool.dispatch(a._toOps(this._id,s,this._pool),[{type:5,id:i}],new Map([[this._id,Fe(this,[Mt(n,a)])]]))}}move(t,n){if(this._pool?.assertStorageIsWritable(),n<0)throw new Error("targetIndex cannot be less than 0");if(n>=this.#e.length)throw new Error("targetIndex cannot be greater or equal than the list length");if(t<0)throw new Error("index cannot be less than 0");if(t>=this.#e.length)throw new Error("index cannot be greater or equal than the list length");let r=null,o=null;t<n?(o=n===this.#e.length-1?void 0:this.#e[n+1]._parentPos,r=this.#e[n]._parentPos):(o=this.#e[n]._parentPos,r=n===0?void 0:this.#e[n-1]._parentPos);const s=Yt(r,o),a=this.#e[t],i=a._getParentKeyOrThrow();if(a._setParentLink(this,s),this._sortItems(),this._pool&&this._id){const u=new Map([[this._id,Fe(this,[Fn(t,n,a)])]]);this._pool.dispatch([{type:1,id:pe(a._id),opId:this._pool.generateOpId(),parentKey:s}],[{type:1,id:pe(a._id),parentKey:i}],u)}}delete(t){if(this._pool?.assertStorageIsWritable(),t<0||t>=this.#e.length)throw new Error(`Cannot delete list item at index "${t}". index should be between 0 and ${this.#e.length-1}`);const n=this.#e[t];n._detach();const[r]=this.#e.splice(t,1);if(this.invalidate(),this._pool){const o=n._id;if(o){const s=new Map;s.set(pe(this._id),Fe(this,[Wo(t,r)])),this._pool.dispatch([{id:o,opId:this._pool.generateOpId(),type:5}],n._toOps(pe(this._id),n._getParentKeyOrThrow()),s)}}}clear(){if(this._pool?.assertStorageIsWritable(),this._pool){const t=[],n=[],r=[];for(const s of this.#e){s._detach();const a=s._id;a&&(t.push({type:5,id:a,opId:this._pool.generateOpId()}),n.push(...s._toOps(pe(this._id),s._getParentKeyOrThrow())),r.push(Wo(0,s)))}this.#e=[],this.invalidate();const o=new Map;o.set(pe(this._id),Fe(this,r)),this._pool.dispatch(t,n,o)}else{for(const t of this.#e)t._detach();this.#e=[],this.invalidate()}}set(t,n){if(this._pool?.assertStorageIsWritable(),t<0||t>=this.#e.length)throw new Error(`Cannot set list item at index "${t}". index should be between 0 and ${this.#e.length-1}`);const r=this.#e[t],o=r._getParentKeyOrThrow(),s=r._id;r._detach();const a=mr(n);if(a._setParentLink(this,o),this.#e[t]=a,this.invalidate(),this._pool&&this._id){const i=this._pool.generateId();a._attach(i,this._pool);const u=new Map;u.set(this._id,Fe(this,[or(t,a)]));const c=zo(a._toOps(this._id,o,this._pool),s);this.#n.set(o,pe(c[0].opId));const l=zo(r._toOps(this._id,o,void 0),i);this._pool.dispatch(c,l,u)}}toArray(){return this.#e.map(t=>$n(t))}every(t){return this.toArray().every(t)}filter(t){return this.toArray().filter(t)}find(t){return this.toArray().find(t)}findIndex(t){return this.toArray().findIndex(t)}forEach(t){return this.toArray().forEach(t)}get(t){if(!(t<0||t>=this.#e.length))return $n(this.#e[t])}indexOf(t,n){return this.toArray().indexOf(t,n)}lastIndexOf(t,n){return this.toArray().lastIndexOf(t,n)}map(t){return this.#e.map((n,r)=>t($n(n),r))}some(t){return this.toArray().some(t)}[Symbol.iterator](){return new KC(this.#e)}#c(t,n){const r=zr(t);r._attach(t.id,pe(this._pool)),r._setParentLink(this,n),this._insertAndSort(r);const o=this._indexOfPosition(n);return{newItem:r,newIndex:o}}#u(t,n){const r=Yt(n,this.#e.length>t+1?this.#e[t+1]?._parentPos:void 0);this.#e[t]._setParentLink(this,r)}_toTreeNode(t){return{type:"LiveList",id:this._id??Pr(),key:t,payload:this.#e.map((n,r)=>n.toTreeNode(r.toString()))}}toImmutable(){return super.toImmutable()}_toImmutable(){return this.#e.map(n=>n.toImmutable())}clone(){return new Ri(this.#e.map(t=>t.clone()))}},KC=class{#e;constructor(e){this.#e=e[Symbol.iterator]()}[Symbol.iterator](){return this}next(){const e=this.#e.next();return e.done?{done:!0,value:void 0}:{value:$n(e.value)}}};function Fe(e,t){return{node:e,type:"LiveList",updates:t}}function or(e,t){return{index:e,type:"set",item:t instanceof Sn?t.data:t}}function Wo(e,t){return{type:"delete",index:e,deletedItem:t instanceof Sn?t.data:t}}function Mt(e,t){return{index:e,type:"insert",item:t instanceof Sn?t.data:t}}function Fn(e,t,n){return{type:"move",index:t,item:n instanceof Sn?n.data:n,previousIndex:e}}function zo(e,t){return e.map((n,r)=>r===0?{...n,intent:"set",deletedId:t}:n)}var kr=class Ii extends Hs{#e;#t;constructor(t){if(super(),this.#t=new Map,t){const n=[];for(const[r,o]of t){const s=mr(o);s._setParentLink(this,r),n.push([r,s])}this.#e=new Map(n)}else this.#e=new Map}_toOps(t,n,r){if(this._id===void 0)throw new Error("Cannot serialize item is not attached");const o=[],s={id:this._id,opId:r?.generateOpId(),type:7,parentId:t,parentKey:n};o.push(s);for(const[a,i]of this.#e)o.push(...i._toOps(this._id,a,r));return o}static _deserialize([t,n],r,o){const s=new Ii;s._attach(t,o);const a=r.get(t);if(a===void 0)return s;for(const[i,u]of a){const c=gh([i,u],r,o);c._setParentLink(s,u.parentKey),s.#e.set(u.parentKey,c),s.invalidate()}return s}_attach(t,n){super._attach(t,n);for(const[r,o]of this.#e)We(o)&&o._attach(n.generateId(),n)}_attachChild(t,n){if(this._pool===void 0)throw new Error("Can't attach child if managed pool is not present");const{id:r,parentKey:o,opId:s}=t,a=o,i=zr(t);if(this._pool.getNode(r)!==void 0)return{modified:!1};if(n===2){const l=this.#t.get(a);if(l===s)return this.#t.delete(a),{modified:!1};if(l!==void 0)return{modified:!1}}else n===1&&this.#t.delete(a);const u=this.#e.get(a);let c;if(u){const l=pe(this._id);c=u._toOps(l,a),u._detach()}else c=[{type:5,id:r}];return i._setParentLink(this,a),i._attach(r,this._pool),this.#e.set(a,i),this.invalidate(),{modified:{node:this,type:"LiveMap",updates:{[a]:{type:"update"}}},reverse:c}}_detach(){super._detach();for(const t of this.#e.values())t._detach()}_detachChild(t){const n=pe(this._id),r=pe(t._parentKey),o=t._toOps(n,r,this._pool);for(const[a,i]of this.#e)i===t&&(this.#e.delete(a),this.invalidate());return t._detach(),{modified:{node:this,type:"LiveMap",updates:{[r]:{type:"delete"}}},reverse:o}}_serialize(){if(this.parent.type!=="HasParent")throw new Error("Cannot serialize LiveMap if parent is missing");return{type:2,parentId:pe(this.parent.node._id,"Parent node expected to have ID"),parentKey:this.parent.key}}get(t){const n=this.#e.get(t);if(n!==void 0)return $n(n)}set(t,n){this._pool?.assertStorageIsWritable();const r=this.#e.get(t);r&&r._detach();const o=mr(n);if(o._setParentLink(this,t),this.#e.set(t,o),this.invalidate(),this._pool&&this._id){const s=this._pool.generateId();o._attach(s,this._pool);const a=new Map;a.set(this._id,{node:this,type:"LiveMap",updates:{[t]:{type:"update"}}});const i=o._toOps(this._id,t,this._pool);this.#t.set(t,pe(i[0].opId)),this._pool.dispatch(o._toOps(this._id,t,this._pool),r?r._toOps(this._id,t):[{type:5,id:s}],a)}}get size(){return this.#e.size}has(t){return this.#e.has(t)}delete(t){this._pool?.assertStorageIsWritable();const n=this.#e.get(t);if(n===void 0)return!1;if(n._detach(),this.#e.delete(t),this.invalidate(),this._pool&&n._id){const r=pe(this._id),o=new Map;o.set(r,{node:this,type:"LiveMap",updates:{[t]:{type:"delete"}}}),this._pool.dispatch([{type:5,id:n._id,opId:this._pool.generateOpId()}],n._toOps(r,t),o)}return!0}entries(){const t=this.#e.entries();return{[Symbol.iterator](){return this},next(){const n=t.next();if(n.done)return{done:!0,value:void 0};const o=n.value[0],s=$n(n.value[1]);return{value:[o,s]}}}}[Symbol.iterator](){return this.entries()}keys(){return this.#e.keys()}values(){const t=this.#e.values();return{[Symbol.iterator](){return this},next(){const n=t.next();return n.done?{done:!0,value:void 0}:{value:$n(n.value)}}}}forEach(t){for(const n of this)t(n[1],n[0],this)}_toTreeNode(t){return{type:"LiveMap",id:this._id??Pr(),key:t,payload:Array.from(this.#e.entries()).map(([n,r])=>r.toTreeNode(n))}}toImmutable(){return super.toImmutable()}_toImmutable(){const t=new Map;for(const[n,r]of this.#e)t.set(n,r.toImmutable());return En(t)}clone(){return new Ii(Array.from(this.#e).map(([t,n])=>[t,n.clone()]))}},Zn=class Wr extends Hs{#e;#t;static#n(t){const n=new Map;let r=null;for(const[o,s]of t)if(WC(s))r=[o,s];else{const a=[o,s],i=n.get(s.parentId);i!==void 0?i.push(a):n.set(s.parentId,[a])}if(r===null)throw new Error("Root can't be null");return[r,n]}static _fromItems(t,n){const[r,o]=Wr.#n(t);return Wr._deserialize(r,o,n)}constructor(t={}){super(),this.#t=new Map;const n=Ao(t);for(const r of Object.keys(n)){const o=n[r];We(o)&&o._setParentLink(this,r)}this.#e=new Map(Object.entries(n))}_toOps(t,n,r){if(this._id===void 0)throw new Error("Cannot serialize item is not attached");const o=r?.generateOpId(),s=[],a={type:4,id:this._id,opId:o,parentId:t,parentKey:n,data:{}};s.push(a);for(const[i,u]of this.#e)We(u)?s.push(...u._toOps(this._id,i,r)):a.data[i]=u;return s}static _deserialize([t,n],r,o){const s=new Wr(n.data);return s._attach(t,o),this._deserializeChildren(s,r,o)}static _deserializeChildren(t,n,r){const o=n.get(pe(t._id));if(o===void 0)return t;for(const[s,a]of o){const i=qC([s,a],n,r);dr(i)&&i._setParentLink(t,a.parentKey),t.#e.set(a.parentKey,i),t.invalidate()}return t}_attach(t,n){super._attach(t,n);for(const[r,o]of this.#e)We(o)&&o._attach(n.generateId(),n)}_attachChild(t,n){if(this._pool===void 0)throw new Error("Can't attach child if managed pool is not present");const{id:r,opId:o,parentKey:s}=t,a=mh(t);if(this._pool.getNode(r)!==void 0)return this.#t.get(s)===o&&this.#t.delete(s),{modified:!1};if(n===0)this.#t.set(s,pe(o));else if(this.#t.get(s)!==void 0)return this.#t.get(s)===o?(this.#t.delete(s),{modified:!1}):{modified:!1};const i=pe(this._id),u=this.#e.get(s);let c;return We(u)?(c=u._toOps(i,s),u._detach()):u===void 0?c=[{type:6,id:i,key:s}]:c=[{type:3,id:i,data:{[s]:u}}],this.#e.set(s,a),this.invalidate(),dr(a)&&(a._setParentLink(this,s),a._attach(r,this._pool)),{reverse:c,modified:{node:this,type:"LiveObject",updates:{[s]:{type:"update"}}}}}_detachChild(t){if(t){const n=pe(this._id),r=pe(t._parentKey),o=t._toOps(n,r,this._pool);for(const[a,i]of this.#e)i===t&&(this.#e.delete(a),this.invalidate());return t._detach(),{modified:{node:this,type:"LiveObject",updates:{[r]:{type:"delete"}}},reverse:o}}return{modified:!1}}_detach(){super._detach();for(const t of this.#e.values())We(t)&&t._detach()}_apply(t,n){return t.type===3?this.#r(t,n):t.type===6?this.#s(t,n):super._apply(t,n)}_serialize(){const t={};for(const[n,r]of this.#e)We(r)||(t[n]=r);return this.parent.type==="HasParent"&&this.parent.node._id?{type:0,parentId:this.parent.node._id,parentKey:this.parent.key,data:t}:{type:0,data:t}}#r(t,n){let r=!1;const o=pe(this._id),s=[],a={type:3,id:o,data:{}};for(const u in t.data){const c=this.#e.get(u);We(c)?(s.push(...c._toOps(o,u)),c._detach()):c!==void 0?a.data[u]=c:c===void 0&&s.push({type:6,id:o,key:u})}const i={};for(const u in t.data){const c=t.data[u];if(c===void 0)continue;if(n)this.#t.set(u,pe(t.opId));else if(this.#t.get(u)===void 0)r=!0;else if(this.#t.get(u)===t.opId){this.#t.delete(u);continue}else continue;const l=this.#e.get(u);We(l)&&l._detach(),r=!0,i[u]={type:"update"},this.#e.set(u,c),this.invalidate()}return Object.keys(a.data).length!==0&&s.unshift(a),r?{modified:{node:this,type:"LiveObject",updates:i},reverse:s}:{modified:!1}}#s(t,n){const r=t.key;if(this.#e.has(r)===!1)return{modified:!1};if(!n&&this.#t.get(r)!==void 0)return{modified:!1};const o=this.#e.get(r),s=pe(this._id);let a=[];return We(o)?(a=o._toOps(s,t.key),o._detach()):o!==void 0&&(a=[{type:3,id:s,data:{[r]:o}}]),this.#e.delete(r),this.invalidate(),{modified:{node:this,type:"LiveObject",updates:{[t.key]:{type:"delete"}}},reverse:a}}toObject(){return Object.fromEntries(this.#e)}set(t,n){this._pool?.assertStorageIsWritable(),this.update({[t]:n})}get(t){return this.#e.get(t)}delete(t){this._pool?.assertStorageIsWritable();const n=t,r=this.#e.get(n);if(r===void 0)return;if(this._pool===void 0||this._id===void 0){We(r)&&r._detach(),this.#e.delete(n),this.invalidate();return}let o;We(r)?(r._detach(),o=r._toOps(this._id,n)):o=[{type:3,data:{[n]:r},id:this._id}],this.#e.delete(n),this.invalidate();const s=new Map;s.set(this._id,{node:this,type:"LiveObject",updates:{[t]:{type:"delete"}}}),this._pool.dispatch([{type:6,key:n,id:this._id,opId:this._pool.generateOpId()}],o,s)}update(t){if(this._pool?.assertStorageIsWritable(),this._pool===void 0||this._id===void 0){for(const c in t){const l=t[c];if(l===void 0)continue;const d=this.#e.get(c);We(d)&&d._detach(),We(l)&&l._setParentLink(this,c),this.#e.set(c,l),this.invalidate()}return}const n=[],r=[],o=this._pool.generateOpId(),s={},a={id:this._id,type:3,data:{}},i={};for(const c in t){const l=t[c];if(l===void 0)continue;const d=this.#e.get(c);if(We(d)?(r.push(...d._toOps(this._id,c)),d._detach()):d===void 0?r.push({type:6,id:this._id,key:c}):a.data[c]=d,We(l)){l._setParentLink(this,c),l._attach(this._pool.generateId(),this._pool);const m=l._toOps(this._id,c,this._pool),g=m.find(C=>C.parentId===this._id);g&&this.#t.set(c,pe(g.opId)),n.push(...m)}else s[c]=l,this.#t.set(c,o);this.#e.set(c,l),this.invalidate(),i[c]={type:"update"}}Object.keys(a.data).length!==0&&r.unshift(a),Object.keys(s).length!==0&&n.unshift({opId:o,id:this._id,type:3,data:s});const u=new Map;u.set(this._id,{node:this,type:"LiveObject",updates:i}),this._pool.dispatch(n,r,u)}toImmutable(){return super.toImmutable()}toTreeNode(t){return super.toTreeNode(t)}_toTreeNode(t){const n=this._id??Pr();return{type:"LiveObject",id:n,key:t,payload:Array.from(this.#e.entries()).map(([r,o])=>We(o)?o.toTreeNode(r):{type:"Json",id:`${n}:${r}`,key:r,payload:o})}}_toImmutable(){const t={};for(const[n,r]of this.#e)t[n]=dr(r)?r.toImmutable():r;return t}clone(){return new Wr(Object.fromEntries(Array.from(this.#e).map(([t,n])=>[t,dr(n)?n.clone():ro(n)])))}};function zr(e){return mr(mh(e))}function mh(e){switch(e.type){case 8:return e.data;case 4:return new Zn(e.data);case 7:return new kr;case 2:return new Nr([]);default:return lt(e,"Unknown creation Op")}}function vh(e,t){return e===t?!0:e.parent.type==="HasParent"?vh(e.parent.node,t):!1}function gh([e,t],n,r){switch(t.type){case 0:return Zn._deserialize([e,t],n,r);case 1:return Nr._deserialize([e,t],n,r);case 2:return kr._deserialize([e,t],n,r);case 3:return Sn._deserialize([e,t],n,r);default:throw new Error("Unexpected CRDT type")}}function qC([e,t],n,r){switch(t.type){case 0:return Zn._deserialize([e,t],n,r);case 1:return Nr._deserialize([e,t],n,r);case 2:return kr._deserialize([e,t],n,r);case 3:return t.data;default:throw new Error("Unexpected CRDT type")}}function dr(e){return Ch(e)||GC(e)||YC(e)}function We(e){return dr(e)||XC(e)}function Ch(e){return e instanceof Nr}function GC(e){return e instanceof kr}function YC(e){return e instanceof Zn}function XC(e){return e instanceof Sn}function ZC(e){return e===void 0?void 0:dr(e)?e.clone():ro(e)}function $n(e){return e instanceof Sn?e.data:e instanceof Nr||e instanceof kr||e instanceof Zn?e:lt(e,"Unknown AbstractCrdt")}function mr(e){return e instanceof Zn||e instanceof kr||e instanceof Nr?e:new Sn(e)}function JC(e,t){const n=[];return e.forEach((r,o)=>{t.get(o)||n.push({type:5,id:o})}),t.forEach((r,o)=>{const s=e.get(o);if(s)r.type===0&&(s.type!==0||tn(r.data)!==tn(s.data))&&n.push({type:3,id:o,data:r.data}),r.parentKey!==s.parentKey&&n.push({type:1,id:o,parentKey:pe(r.parentKey,"Parent key must not be missing")});else switch(r.type){case 3:n.push({type:8,id:o,parentId:r.parentId,parentKey:r.parentKey,data:r.data});break;case 1:n.push({type:2,id:o,parentId:r.parentId,parentKey:r.parentKey});break;case 0:if(r.parentId===void 0||r.parentKey===void 0)throw new Error("Internal error. Cannot serialize storage root into an operation");n.push({type:4,id:o,parentId:r.parentId,parentKey:r.parentKey,data:r.data});break;case 2:n.push({type:7,id:o,parentId:r.parentId,parentKey:r.parentKey});break}}),n}function QC(e,t){const n=e.updates;for(const[r,o]of hu(t.updates))n[r]=o;return{...t,updates:n}}function eb(e,t){const n=e.updates;for(const[r,o]of hu(t.updates))n[r]=o;return{...t,updates:n}}function tb(e,t){const n=e.updates;return{...t,updates:n.concat(t.updates)}}function La(e,t){return e===void 0?t:e.type==="LiveObject"&&t.type==="LiveObject"?QC(e,t):e.type==="LiveMap"&&t.type==="LiveMap"?eb(e,t):e.type==="LiveList"&&t.type==="LiveList"?tb(e,t):t}var $a=class{#e;#t;#n;#r;constructor(){this.#e={},this.#t=0,this.#n=1,this.#r=0}get length(){return this.#r}*[Symbol.iterator](){const e=this.#r,t=this.#t;for(let n=0;n<e;n++)yield this.#e[t+n]}push(e){const t=Array.isArray(e)?e:[e];this.#n>Number.MAX_SAFE_INTEGER-t.length-1&&wt("Deque full");for(const n of t)this.#e[this.#n++-1]=n;this.#r+=t.length}pop(){if(this.#r<1)return;this.#n--;const e=this.#e[this.#n-1];return delete this.#e[this.#n-1],this.#r--,e}pushLeft(e){const t=Array.isArray(e)?e:[e];this.#t<Number.MIN_SAFE_INTEGER+t.length&&wt("Deque full");for(let n=t.length-1;n>=0;n--)this.#e[--this.#t]=t[n];this.#r+=t.length}popLeft(){if(this.#r<1)return;const e=this.#e[this.#t];return delete this.#e[this.#t],this.#t++,this.#r--,e}};function nb(e){return e===null||typeof e=="string"||typeof e=="number"||typeof e=="boolean"}function bh(e){return Array.isArray(e)}function rb(e){return!nb(e)&&!bh(e)}function ob(e,t){const{connectionId:n,id:r,info:o}=e,s=Si(e.scopes);return En(Ao({connectionId:n,id:r,info:o,canWrite:s,canComment:hh(e.scopes),isReadOnly:!s,presence:t}))}var sb=class{#e;#t;signal;constructor(){this.#e=new Xn({connections:new Map,presences:new Map}),this.signal=Xe.from(this.#e,e=>wi(Array.from(this.#e.get().presences.keys()).map(t=>this.getUser(Number(t))))),this.#t=new Map}get(){return this.signal.get()}connectionIds(){return this.#e.get().connections.keys()}clearOthers(){this.#e.mutate(e=>{e.connections.clear(),e.presences.clear(),this.#t.clear()})}#n(e){const t=this.#e.get(),n=t.connections.get(e),r=t.presences.get(e);if(n!==void 0&&r!==void 0)return ob(n,r)}getUser(e){const t=this.#t.get(e);if(t)return t;const n=this.#n(e);if(n)return this.#t.set(e,n),n}#r(e){this.#t.delete(e)}setConnection(e,t,n,r){this.#e.mutate(o=>(o.connections.set(e,En({connectionId:e,id:t,info:n,scopes:r})),o.presences.has(e)?this.#r(e):!1))}removeConnection(e){this.#e.mutate(t=>{t.connections.delete(e),t.presences.delete(e),this.#r(e)})}setOther(e,t){this.#e.mutate(n=>(n.presences.set(e,En(Ao(t))),n.connections.has(e)?this.#r(e):!1))}patchOther(e,t){this.#e.mutate(n=>{const r=n.presences.get(e);if(r===void 0)return!1;const o=rh(r,t);return r===o?!1:(n.presences.set(e,En(o)),this.#r(e))})}},yh=class Eh extends Error{context;constructor(t,n,r){super(t,{cause:r}),this.context=n,this.name="LiveblocksError"}get roomId(){return this.context.roomId}get code(){return this.context.code}static from(t,n){return new Eh(ab(t),t,n)}};function ab(e){switch(e.type){case"ROOM_CONNECTION_ERROR":switch(e.code){case 4001:return"Not allowed to connect to the room";case 4005:return"Room is already full";case 4006:return"Kicked out of the room, because the room ID changed";default:return"Could not connect to the room"}case"CREATE_THREAD_ERROR":return"Could not create new thread";case"DELETE_THREAD_ERROR":return"Could not delete thread";case"EDIT_THREAD_METADATA_ERROR":return"Could not edit thread metadata";case"MARK_THREAD_AS_RESOLVED_ERROR":return"Could not mark thread as resolved";case"MARK_THREAD_AS_UNRESOLVED_ERROR":return"Could not mark thread as unresolved";case"CREATE_COMMENT_ERROR":return"Could not create new comment";case"EDIT_COMMENT_ERROR":return"Could not edit comment";case"DELETE_COMMENT_ERROR":return"Could not delete comment";case"ADD_REACTION_ERROR":return"Could not add reaction";case"REMOVE_REACTION_ERROR":return"Could not remove reaction";case"MARK_INBOX_NOTIFICATION_AS_READ_ERROR":return"Could not mark inbox notification as read";case"DELETE_INBOX_NOTIFICATION_ERROR":return"Could not delete inbox notification";case"MARK_ALL_INBOX_NOTIFICATIONS_AS_READ_ERROR":return"Could not mark all inbox notifications as read";case"DELETE_ALL_INBOX_NOTIFICATIONS_ERROR":return"Could not delete all inbox notifications";case"UPDATE_NOTIFICATION_SETTINGS_ERROR":return"Could not update notification settings";case"UPDATE_USER_NOTIFICATION_SETTINGS_ERROR":return"Could not update user notification settings";default:return lt(e,"Unhandled case")}}var cl=1024*1024-512;function ib(e){let t=0;return()=>`${e}:${t++}`}function ll(e,t){return{type:"User",id:`${t.connectionId}`,key:e,payload:{connectionId:t.connectionId,id:t.id,info:t.info,presence:t.presence,isReadOnly:!t.canWrite}}}function ub(){const e=typeof document<"u"?document:void 0,t={current:null};function n(){e?.visibilityState==="hidden"?t.current=t.current??Date.now():t.current=null}return e?.addEventListener("visibilitychange",n),[t,()=>{e?.removeEventListener("visibilitychange",n)}]}function cb(e,t){const n=t.roomId,r=e.initialPresence,o=e.initialStorage,s=t.roomHttpClient,[a,i]=ub(),u={...t.delegates,canZombie(){return t.backgroundKeepAliveTimeout!==void 0&&a.current!==null&&Date.now()>a.current+t.backgroundKeepAliveTimeout&&jo()!=="synchronizing"}},c=new wC(u,t.enableDebugLogging),l={buffer:{flushTimerID:void 0,lastFlushedAt:0,presenceUpdates:{type:"full",data:r},messages:[],storageOperations:[]},staticSessionInfoSig:new zt(null),dynamicSessionInfoSig:new zt(null),myPresence:new q0(r),others:new sb,initialStorage:o,idFactory:null,yjsProvider:void 0,yjsProviderDidChange:Ie(),pool:UC(n,{getCurrentConnectionId:R,onDispatch:y,isStorageWritable:w}),root:void 0,undoStack:[],redoStack:[],pausedHistory:null,activeBatch:null,unacknowledgedOps:new Map};let d;function m(A){const K=c.authValue;if(K!==null){const Z=ih(K);if(Z!==d)if(d=Z,K.type==="secret"){const oe=K.token.parsed;l.staticSessionInfoSig.set({userId:oe.k==="sec-legacy"?oe.id:oe.uid,userInfo:oe.k==="sec-legacy"?oe.info:oe.ui})}else l.staticSessionInfoSig.set({userId:void 0,userInfo:void 0})}D.status.notify(A),L()}let g,C=!1;function v(A){A==="reconnecting"?g=setTimeout(()=>{D.lostConnection.notify("lost"),C=!0,l.others.clearOthers(),G({others:[{type:"reset"}]})},t.lostConnectionTimeout):(clearTimeout(g),C&&(A==="disconnected"?D.lostConnection.notify("failed"):D.lostConnection.notify("restored"),C=!1))}function h(){l.buffer.presenceUpdates={type:"full",data:{...l.myPresence.get()}},Ee!==null&&bt({flush:!1}),he()}function E(){clearTimeout(l.buffer.flushTimerID)}c.events.onMessage.subscribe(_e),c.events.statusDidChange.subscribe(m),c.events.statusDidChange.subscribe(v),c.events.didConnect.subscribe(h),c.events.didDisconnect.subscribe(E),c.events.onConnectionError.subscribe(({message:A,code:K})=>{const Z="ROOM_CONNECTION_ERROR",oe=new yh(A,{type:Z,code:K,roomId:n});t.errorEventSource.notify(oe)});function y(A,K,Z){if(l.activeBatch){for(const oe of A)l.activeBatch.ops.push(oe);for(const[oe,Se]of Z)l.activeBatch.updates.storageUpdates.set(oe,La(l.activeBatch.updates.storageUpdates.get(oe),Se));l.activeBatch.reverseOps.pushLeft(K)}else de(K),l.redoStack.length=0,be(A),G({storageUpdates:Z})}function w(){const A=l.dynamicSessionInfoSig.get()?.scopes;return A!==void 0?Si(A):!0}const D={status:Ie(),lostConnection:Ie(),customEvent:Ie(),self:Ie(),myPresence:Ie(),others:Ie(),storageBatch:Ie(),history:Ie(),storageDidLoad:Ie(),storageStatus:Ie(),ydoc:Ie(),comments:Ie(),roomWillDestroy:Ie()};async function x(A,K){return s.createTextMention({roomId:n,userId:A,mentionId:K})}async function I(A){return s.deleteTextMention({roomId:n,mentionId:A})}async function S(A,K){await s.reportTextEditor({roomId:n,type:A,rootKey:K})}async function k(){return s.listTextVersions({roomId:n})}async function W(A){return s.listTextVersionsSince({roomId:n,since:A.since,signal:A.signal})}async function P(A){return s.getTextVersion({roomId:n,versionId:A})}async function M(){return s.createTextVersion({roomId:n})}async function F(A){return s.executeContextualPrompt({roomId:n,...A})}function*B(A){const{ops:K,...Z}=A;if(K.length<2)throw new Error("Cannot split ops into smaller chunks");const oe=Math.floor(K.length/2),Se=K.slice(0,oe),Re=K.slice(oe);for(const jt of[Se,Re]){const Qe={ops:jt,...Z},Rn=tn([Qe]);$(Rn)?yield*B(Qe):yield Rn}}function*j(A){if(A.length<2)if(A[0].type===201){yield*B(A[0]);return}else throw new Error("Cannot split into chunks smaller than the allowed message size");const K=Math.floor(A.length/2),Z=A.slice(0,K),oe=A.slice(K);for(const Se of[Z,oe]){const Re=tn(Se);$(Re)?yield*j(Se):yield Re}}function $(A){return A.length*4<cl?!1:new TextEncoder().encode(A).length>=cl}function re(A){const K=t.largeMessageStrategy??"default",Z=tn(A);if(!$(Z))return c.send(Z);switch(K){case"default":{wo("Message is too large for websockets, not sending. Configure largeMessageStrategy option to deal with this.");return}case"split":{ft("Message is too large for websockets, splitting into smaller chunks");for(const oe of j(A))c.send(oe);return}case"experimental-fallback-to-http":{ft("Message is too large for websockets, so sending over HTTP instead");const oe=l.dynamicSessionInfoSig.get()?.nonce??wt("Session is not authorized to send message over HTTP");s.sendMessages({roomId:n,nonce:oe,messages:A}).then(Se=>{!Se.ok&&Se.status===403&&c.reconnect()});return}}}const Y=Xe.from(l.staticSessionInfoSig,l.dynamicSessionInfoSig,l.myPresence,(A,K,Z)=>{if(A===null||K===null)return null;{const oe=Si(K.scopes);return{connectionId:K.actor,id:A.userId,info:A.userInfo,presence:Z,canWrite:oe,canComment:hh(K.scopes)}}});let ee;function L(){const A=Y.get();A!==null&&A!==ee&&(D.self.notify(A),ee=A)}const Q=Xe.from(Y,A=>A!==null?ll("Me",A):null);function V(A){if(A.items.length===0)throw new Error("Internal error: cannot load storage without items");l.root!==void 0?te(A.items):l.root=Zn._fromItems(A.items,l.pool);const K=Y.get()?.canWrite??!0,Z=l.undoStack.length;for(const oe in l.initialStorage)l.root.get(oe)===void 0&&(K?l.root.set(oe,ZC(l.initialStorage[oe])):ft(`Attempted to populate missing storage key '${oe}', but current user has no write access`));l.undoStack.length=Z}function te(A){if(l.root===void 0)return;const K=new Map;for(const[Se,Re]of l.pool.nodes)K.set(Se,Re._serialize());const Z=JC(K,new Map(A)),oe=_(Z,!1);G(oe.updates)}function se(A){l.undoStack.length>=50&&l.undoStack.shift(),l.undoStack.push(A),ie()}function de(A){l.pausedHistory!==null?l.pausedHistory.pushLeft(A):se(A)}function G(A){const K=A.storageUpdates,Z=A.others;if(Z!==void 0&&Z.length>0){const oe=l.others.get();for(const Se of Z)D.others.notify({...Se,others:oe})}if((A.presence??!1)&&(L(),D.myPresence.notify(l.myPresence.get())),K!==void 0&&K.size>0){const oe=Array.from(K.values());D.storageBatch.notify(oe)}Mo()}function R(){const A=l.dynamicSessionInfoSig.get();if(A)return A.actor;throw new Error("Internal. Tried to get connection id but connection was never open")}function _(A,K){const Z={reverse:new $a,storageUpdates:new Map,presence:!1},oe=new Set,Se=A.map(Re=>Re.type!=="presence"&&!Re.opId?{...Re,opId:l.pool.generateOpId()}:Re);for(const Re of Se)if(Re.type==="presence"){const jt={type:"presence",data:{}};for(const Qe in Re.data)jt.data[Qe]=l.myPresence.get()[Qe];if(l.myPresence.patch(Re.data),l.buffer.presenceUpdates===null)l.buffer.presenceUpdates={type:"partial",data:Re.data};else for(const Qe in Re.data)l.buffer.presenceUpdates.data[Qe]=Re.data[Qe];Z.reverse.pushLeft(jt),Z.presence=!0}else{let jt;if(K)jt=0;else{const Rn=pe(Re.opId);jt=l.unacknowledgedOps.delete(Rn)?2:1}const Qe=H(Re,jt);if(Qe.modified){const Rn=Qe.modified.node._id;Rn&&oe.has(Rn)||(Z.storageUpdates.set(pe(Qe.modified.node._id),La(Z.storageUpdates.get(pe(Qe.modified.node._id)),Qe.modified)),Z.reverse.pushLeft(Qe.reverse)),(Re.type===2||Re.type===7||Re.type===4)&&oe.add(pe(Re.id))}}return{ops:Se,reverse:Array.from(Z.reverse),updates:{storageUpdates:Z.storageUpdates,presence:Z.presence}}}function H(A,K){if($C(A))return{modified:!1};switch(A.type){case 6:case 3:case 5:{const Z=l.pool.nodes.get(A.id);return Z===void 0?{modified:!1}:Z._apply(A,K===0)}case 1:{const Z=l.pool.nodes.get(A.id);return Z===void 0?{modified:!1}:Z.parent.type==="HasParent"&&Ch(Z.parent.node)?Z.parent.node._setChildKey(oo(A.parentKey),Z,K):{modified:!1}}case 4:case 2:case 7:case 8:{if(A.parentId===void 0)return{modified:!1};const Z=l.pool.nodes.get(A.parentId);return Z===void 0?{modified:!1}:Z._attachChild(A,K)}}}function X(A,K){const Z={};l.buffer.presenceUpdates===null&&(l.buffer.presenceUpdates={type:"partial",data:{}});for(const oe in A){const Se=A[oe];Se!==void 0&&(l.buffer.presenceUpdates.data[oe]=Se,Z[oe]=l.myPresence.get()[oe])}l.myPresence.patch(A),l.activeBatch?(K?.addToHistory&&l.activeBatch.reverseOps.pushLeft({type:"presence",data:Z}),l.activeBatch.updates.presence=!0):(he(),K?.addToHistory&&de([{type:"presence",data:Z}]),G({presence:!0}))}function fe(A){if(A.targetActor!==void 0){const Z=l.others.getUser(A.actor);l.others.setOther(A.actor,A.data);const oe=l.others.getUser(A.actor);if(Z===void 0&&oe!==void 0)return{type:"enter",user:oe}}else l.others.patchOther(A.actor,A.data);const K=l.others.getUser(A.actor);if(K)return{type:"update",updates:A.data,user:K}}function le(A){const K=l.others.getUser(A.actor);return K?(l.others.removeConnection(A.actor),{type:"leave",user:K}):null}function T(A){l.dynamicSessionInfoSig.set({actor:A.actor,nonce:A.nonce,scopes:A.scopes}),l.idFactory=ib(A.actor),L();for(const K of l.others.connectionIds())A.users[K]===void 0&&l.others.removeConnection(K);for(const K in A.users){const Z=A.users[K],oe=Number(K);l.others.setConnection(oe,Z.id,Z.info,Z.scopes)}return{type:"reset"}}function q(){return l.undoStack.length>0}function ne(){return l.redoStack.length>0}function ie(){D.history.notify({canUndo:q(),canRedo:ne()})}function we(A){l.others.setConnection(A.actor,A.id,A.info,A.scopes),l.buffer.messages.push({type:100,data:l.myPresence.get(),targetActor:A.actor}),he();const K=l.others.getUser(A.actor);return K?{type:"enter",user:K}:void 0}function xe(A){return rb(A)?A:null}function ae(A){const K=$s(A);return K===void 0?null:bh(K)?wi(K.map(Z=>xe(Z))):wi([xe(K)])}function Te(A){if(A.size===0)return;const K=[],Z=Array.from(A.values()),oe=_(Z,!0);K.push({type:201,ops:oe.ops}),G(oe.updates),re(K)}function _e(A){if(typeof A.data!="string")return;const K=ae(A.data);if(K===null||K.length===0)return;const Z={storageUpdates:new Map,others:[]};for(const oe of K)switch(oe.type){case 101:{const Se=we(oe);Se&&Z.others.push(Se);break}case 100:{const Se=fe(oe);Se&&Z.others.push(Se);break}case 103:{const Se=l.others.get();D.customEvent.notify({connectionId:oe.actor,user:oe.actor<0?null:Se.find(Re=>Re.connectionId===oe.actor)??null,event:oe.event});break}case 102:{const Se=le(oe);Se&&Z.others.push(Se);break}case 300:{D.ydoc.notify(oe);break}case 104:{Z.others.push(T(oe));break}case 200:{$e(oe);break}case 201:{const Se=_(oe.ops,!1);for(const[Re,jt]of Se.updates.storageUpdates)Z.storageUpdates.set(Re,La(Z.storageUpdates.get(Re),jt));break}case 299:{Qd("Storage mutation rejection error",oe.reason);break}case 400:case 407:case 401:case 408:case 405:case 406:case 402:case 403:case 404:{D.comments.notify(oe);break}}G(Z)}function he(){const A=l.buffer.storageOperations;if(A.length>0){for(const oe of A)l.unacknowledgedOps.set(pe(oe.opId),oe);Mo()}if(c.getStatus()!=="connected"){l.buffer.storageOperations=[];return}const K=Date.now(),Z=K-l.buffer.lastFlushedAt;if(Z>=t.throttleDelay){const oe=Ce();if(oe.length===0)return;re(oe),l.buffer={flushTimerID:void 0,lastFlushedAt:K,messages:[],storageOperations:[],presenceUpdates:null}}else clearTimeout(l.buffer.flushTimerID),l.buffer.flushTimerID=setTimeout(he,t.throttleDelay-Z)}function Ce(){const A=[];l.buffer.presenceUpdates&&A.push(l.buffer.presenceUpdates.type==="full"?{type:100,targetActor:-1,data:l.buffer.presenceUpdates.data}:{type:100,data:l.buffer.presenceUpdates.data});for(const K of l.buffer.messages)A.push(K);return l.buffer.storageOperations.length>0&&A.push({type:201,ops:l.buffer.storageOperations}),A}function ke(A,K,Z){const oe={type:301,update:A,guid:K,v2:Z};l.buffer.messages.push(oe),D.ydoc.notify(oe),he()}function Pe(A,K={shouldQueueEventIfNotReady:!1}){c.getStatus()!=="connected"&&!K.shouldQueueEventIfNotReady||(l.buffer.messages.push({type:103,event:A}),he())}function be(A){const{storageOperations:K}=l.buffer;for(const Z of A)K.push(Z);he()}let Ee=null,Ct=null;function $e(A){const K=new Map(l.unacknowledgedOps);V(A),Te(K),Ct?.(),Mo(),D.storageDidLoad.notify()}async function qe(){if(!c.authValue)return;const A=await s.streamStorage({roomId:n});$e({items:A})}function bt(A){const K=l.buffer.messages;t.unstable_streamData?qe():K.some(Z=>Z.type===200)||K.push({type:200}),A.flush&&he()}function Je(){return Ee===null&&(bt({flush:!0}),Ee=new Promise(A=>{Ct=A}),Mo()),Ee}function nr(){const A=l.root;return A!==void 0?A:(Je(),null)}async function cn(){return l.root!==void 0?Promise.resolve({root:l.root}):(await Je(),{root:pe(l.root)})}function ln(A,K,Z){l.buffer.messages.find(oe=>oe.type===300&&oe.vector===A&&oe.guid===K&&oe.v2===Z)||l.buffer.messages.push({type:300,vector:A,guid:K,v2:Z}),he()}function ga(){if(l.activeBatch)throw new Error("undo is not allowed during a batch");const A=l.undoStack.pop();if(A===void 0)return;l.pausedHistory=null;const K=_(A,!0);G(K.updates),l.redoStack.push(K.reverse),ie();for(const Z of K.ops)Z.type!=="presence"&&l.buffer.storageOperations.push(Z);he()}function Ca(){if(l.activeBatch)throw new Error("redo is not allowed during a batch");const A=l.redoStack.pop();if(A===void 0)return;l.pausedHistory=null;const K=_(A,!0);G(K.updates),l.undoStack.push(K.reverse),ie();for(const Z of K.ops)Z.type!=="presence"&&l.buffer.storageOperations.push(Z);he()}function ba(){l.undoStack.length=0,l.redoStack.length=0}function ya(A){if(l.activeBatch)return A();let K;l.activeBatch={ops:[],updates:{storageUpdates:new Map,presence:!1,others:[]},reverseOps:new $a};try{K=A()}finally{const Z=l.activeBatch;l.activeBatch=null,Z.reverseOps.length>0&&de(Array.from(Z.reverseOps)),Z.ops.length>0&&(l.redoStack.length=0),Z.ops.length>0&&be(Z.ops),G(Z.updates),he()}return K}function Ea(){l.pausedHistory===null&&(l.pausedHistory=new $a)}function Da(){const A=l.pausedHistory;l.pausedHistory=null,A!==null&&A.length>0&&se(Array.from(A))}const Bc=t.createSyncSource();function jo(){return l.root===void 0?Ee===null?"not-loaded":"loading":l.unacknowledgedOps.size===0?"synchronized":"synchronizing"}let Fc=jo();function Mo(){const A=jo();Fc!==A&&(Fc=A,D.storageStatus.notify(A)),Bc.setSyncStatus(A==="synchronizing"?"synchronizing":"synchronized")}function Pc(){return Y.get()!==null}async function Xg(){for(;!Pc();){const{promise:A,resolve:K}=nh(),Z=_o.self.subscribeOnce(K),oe=_o.status.subscribeOnce(K);await A,Z(),oe()}}function Nc(){return nr()!==null}async function Zg(){for(;!Nc();)await cn()}const Jg=Xe.from(l.others.signal,A=>A.map((K,Z)=>ll(`Other ${Z}`,K))),_o={status:D.status.observable,lostConnection:D.lostConnection.observable,customEvent:D.customEvent.observable,others:D.others.observable,self:D.self.observable,myPresence:D.myPresence.observable,storage:D.storageBatch.observable,storageBatch:D.storageBatch.observable,history:D.history.observable,storageDidLoad:D.storageDidLoad.observable,storageStatus:D.storageStatus.observable,ydoc:D.ydoc.observable,comments:D.comments.observable,roomWillDestroy:D.roomWillDestroy.observable};async function Qg(A){return s.getThreadsSince({roomId:n,since:A.since,signal:A.signal})}async function e0(A){return s.getThreads({roomId:n,query:A?.query,cursor:A?.cursor})}async function t0(A){return s.getThread({roomId:n,threadId:A})}async function n0(A){return s.createThread({roomId:n,threadId:A.threadId,commentId:A.commentId,metadata:A.metadata,body:A.body,attachmentIds:A.attachmentIds})}async function r0(A){return s.deleteThread({roomId:n,threadId:A})}async function o0({metadata:A,threadId:K}){return s.editThreadMetadata({roomId:n,threadId:K,metadata:A})}async function s0(A){return s.markThreadAsResolved({roomId:n,threadId:A})}async function a0(A){return s.markThreadAsUnresolved({roomId:n,threadId:A})}async function i0(A){return s.createComment({roomId:n,threadId:A.threadId,commentId:A.commentId,body:A.body,attachmentIds:A.attachmentIds})}async function u0(A){return s.editComment({roomId:n,threadId:A.threadId,commentId:A.commentId,body:A.body,attachmentIds:A.attachmentIds})}async function c0({threadId:A,commentId:K}){return s.deleteComment({roomId:n,threadId:A,commentId:K})}async function l0({threadId:A,commentId:K,emoji:Z}){return s.addReaction({roomId:n,threadId:A,commentId:K,emoji:Z})}async function f0({threadId:A,commentId:K,emoji:Z}){return await s.removeReaction({roomId:n,threadId:A,commentId:K,emoji:Z})}function d0(A){return{type:"localAttachment",status:"idle",id:sh(),name:A.name,size:A.size,mimeType:A.type,file:A}}async function h0(A,K={}){return s.uploadAttachment({roomId:n,attachment:A,signal:K.signal})}function p0(A){return s.getAttachmentUrl({roomId:n,attachmentId:A})}function m0(A){return s.getNotificationSettings({roomId:n,signal:A?.signal})}function v0(A){return s.updateNotificationSettings({roomId:n,settings:A})}async function g0(A){await s.markRoomInboxNotificationAsRead({roomId:n,inboxNotificationId:A})}const kc=t.createSyncSource();function wa(A){return kc.setSyncStatus(A==="synchronizing"?"synchronizing":"synchronized")}return Object.defineProperty({[Oe]:{get presenceBuffer(){return ro(l.buffer.presenceUpdates?.data??null)},get undoStack(){return ro(l.undoStack)},get nodeCount(){return l.pool.nodes.size},getYjsProvider(){return l.yjsProvider},setYjsProvider(A){l.yjsProvider?.off("status",wa),l.yjsProvider=A,A?.on("status",wa),l.yjsProviderDidChange.notify()},yjsProviderDidChange:l.yjsProviderDidChange.observable,reportTextEditor:S,createTextMention:x,deleteTextMention:I,listTextVersions:k,listTextVersionsSince:W,getTextVersion:P,createTextVersion:M,executeContextualPrompt:F,getSelf_forDevTools:()=>Q.get(),getOthers_forDevTools:()=>Jg.get(),simulate:{explicitClose:A=>c._privateSendMachineEvent({type:"EXPLICIT_SOCKET_CLOSE",event:A}),rawSend:A=>c.send(A)},attachmentUrlsStore:s.getOrCreateAttachmentUrlsStore(n)},id:n,subscribe:lb(n,_o,t.errorEventSource),connect:()=>c.connect(),reconnect:()=>c.reconnect(),disconnect:()=>c.disconnect(),destroy:()=>{const{roomWillDestroy:A,...K}=D;for(const Z of Object.values(K))Z[Symbol.dispose]();D.roomWillDestroy.notify(),l.yjsProvider?.off("status",wa),Bc.destroy(),kc.destroy(),i(),c.destroy(),A[Symbol.dispose]()},updatePresence:X,updateYDoc:ke,broadcastEvent:Pe,batch:ya,history:{undo:ga,redo:Ca,canUndo:q,canRedo:ne,clear:ba,pause:Ea,resume:Da},fetchYDoc:ln,getStorage:cn,getStorageSnapshot:nr,getStorageStatus:jo,isPresenceReady:Pc,isStorageReady:Nc,waitUntilPresenceReady:Yc(Xg),waitUntilStorageReady:Yc(Zg),events:_o,getStatus:()=>c.getStatus(),getSelf:()=>Y.get(),getPresence:()=>l.myPresence.get(),getOthers:()=>l.others.get(),getThreads:e0,getThreadsSince:Qg,getThread:t0,createThread:n0,deleteThread:r0,editThreadMetadata:o0,markThreadAsResolved:s0,markThreadAsUnresolved:a0,createComment:i0,editComment:u0,deleteComment:c0,addReaction:l0,removeReaction:f0,prepareAttachment:d0,uploadAttachment:h0,getAttachmentUrl:p0,getNotificationSettings:m0,updateNotificationSettings:v0,markInboxNotificationAsRead:g0},Oe,{enumerable:!1})}function lb(e,t,n){function r(a,i){return t.storageBatch.subscribe(u=>{const c=u.filter(l=>vh(l.node,a));c.length>0&&i(c)})}function o(a,i){return t.storageBatch.subscribe(u=>{for(const c of u)c.node._id===a._id&&i(c.node)})}function s(a,i,u){if(typeof a=="string"&&fb(a)){if(typeof i!="function")throw new Error("Second argument must be a callback function");const c=i;switch(a){case"event":return t.customEvent.subscribe(c);case"my-presence":return t.myPresence.subscribe(c);case"others":{const l=c;return t.others.subscribe(d=>{const{others:m,...g}=d;return l(m,g)})}case"error":return n.subscribe(l=>{if(l.roomId===e)return c(l)});case"status":return t.status.subscribe(c);case"lost-connection":return t.lostConnection.subscribe(c);case"history":return t.history.subscribe(c);case"storage-status":return t.storageStatus.subscribe(c);case"comments":return t.comments.subscribe(c);default:return lt(a,`"${String(a)}" is not a valid event name`)}}if(i===void 0||typeof a=="function")if(typeof a=="function"){const c=a;return t.storageBatch.subscribe(c)}else throw new Error("Please specify a listener callback");if(We(a)){const c=a;return u?.isDeep?r(c,i):o(c,i)}throw new Error(`${String(a)} is not a value that can be subscribed to.`)}return s}function fb(e){return e==="my-presence"||e==="others"||e==="event"||e==="error"||e==="history"||e==="status"||e==="storage-status"||e==="lost-connection"||e==="connection"||e==="comments"}function db(e,t){return async()=>t.getAuthValue({requestedScope:"room:read",roomId:e})}function hb(e,t,n){return r=>{const o=n??(typeof WebSocket>"u"?void 0:WebSocket);if(o===void 0)throw new Ln("To use Liveblocks client in a non-DOM environment, you need to provide a WebSocket polyfill.");const s=new URL(t);if(s.protocol=s.protocol==="http:"?"ws":"wss",s.pathname="/v7",s.searchParams.set("roomId",e),r.type==="secret")s.searchParams.set("tok",r.token.raw);else if(r.type==="public")s.searchParams.set("pubkey",r.publicApiKey);else return lt(r,"Unhandled case");return s.searchParams.set("version",fu),new o(s.toString())}}var pb=16,mb=1e3,vb=100,gb=15e3,Cb=200,bb=1e3,yb=3e4,Eb=5e3,Db=50,wb=50;function Ab(e){return typeof e=="string"&&e.startsWith("http")?e:TC}function xb(e){const t=e,n=Sb(t.throttle??vb),r=Tb(t.lostConnectionTimeout??Eb),o=Ob(t.backgroundKeepAliveTimeout),s=Ab(t.baseUrl),a=new zt(void 0),i=xC(e,V=>{const te=V.k==="sec-legacy"?V.id:V.uid;a.set(()=>te)}),u=t.polyfills?.fetch||globalThis.fetch?.bind(globalThis),c=aC({baseUrl:s,fetchPolyfill:u,authManager:i}),l=new Map;function d(V){V.id,l.delete(V.id),V.destroy()}function m(V){const te=()=>{const se=te;V.unsubs.delete(se)?V.unsubs.size===0&&d(V.room):ft("This leave function was already called. Calling it more than once has no effect.")};return V.unsubs.add(te),{room:V.room,leave:te}}function g(V,...te){const se=l.get(V);if(se!==void 0)return m(se);const de=te[0]??{},G=(typeof de.initialPresence=="function"?de.initialPresence(V):de.initialPresence)??{},R=(typeof de.initialStorage=="function"?de.initialStorage(V):de.initialStorage)??{},_=cb({initialPresence:G,initialStorage:R},{roomId:V,throttleDelay:n,lostConnectionTimeout:r,backgroundKeepAliveTimeout:o,polyfills:t.polyfills,delegates:t.mockedDelegates??{createSocket:hb(V,s,t.polyfills?.WebSocket),authenticate:db(V,i)},enableDebugLogging:t.enableDebugLogging,baseUrl:s,errorEventSource:j,largeMessageStrategy:t.largeMessageStrategy??(t.unstable_fallbackToHTTP?"experimental-fallback-to-http":void 0),unstable_streamData:!!t.unstable_streamData,roomHttpClient:c,createSyncSource:Y}),H={room:_,unsubs:new Set};if(l.set(V,H),de.autoConnect??!0){if(typeof atob>"u"){if(t.polyfills?.atob===void 0)throw new Error("You need to polyfill atob to use the client in your environment. Please follow the instructions at https://liveblocks.io/docs/errors/liveblocks-client/atob-polyfill");yi.atob=t.polyfills.atob}_.connect()}return m(H)}function C(V){const te=l.get(V)?.room;return te||null}function v(){i.reset(),a.set(()=>{});for(const{room:V}of l.values())hC(V.getStatus())||V.reconnect()}const h=t.resolveUsers,E=fl(()=>!h,"Set the resolveUsers option in createClient to specify user info."),y=new Xr(async V=>{const te=V.flat(),se=await h?.({userIds:te});return E(),se??te.map(()=>{})},{delay:Db}),w=xi(y);function D(V){w.invalidate(V)}const x=t.resolveRoomsInfo,I=fl(()=>!x,"Set the resolveRoomsInfo option in createClient to specify room info."),S=new Xr(async V=>{const te=V.flat(),se=await x?.({roomIds:te});return I(),se??te.map(()=>{})},{delay:wb}),k=xi(S);function W(V){k.invalidate(V)}const P=new Map;function M(){P.clear()}const F=[],B=new zt("synchronized"),j=Ie();function $(){const V=B.get();return V==="synchronizing"?V:"synchronized"}function re(){B.set(F.some(V=>V.get()==="synchronizing")?"synchronizing":F.some(V=>V.get()==="has-local-changes")?"has-local-changes":"synchronized")}function Y(){const V=new zt("synchronized");F.push(V);const te=V.subscribe(()=>re());function se(G){V.set(G)}function de(){te();const G=F.findIndex(R=>R===V);if(G>-1){const[R]=F.splice(G,1);R.get()!=="synchronized"&&re()}}return{setSyncStatus:se,destroy:de}}{const V=se=>{t.preventUnsavedChanges&&B.get()!=="synchronized"&&se.preventDefault()};(typeof window<"u"?window:void 0)?.addEventListener("beforeunload",V)}async function ee(V){const te=await c.getUserNotificationSettings(V);return bs(te)}async function L(V){const te=await c.updateUserNotificationSettings(V);return bs(te)}const Q=Object.defineProperty({enterRoom:g,getRoom:C,logout:v,getInboxNotifications:c.getInboxNotifications,getInboxNotificationsSince:c.getInboxNotificationsSince,getUnreadInboxNotificationsCount:c.getUnreadInboxNotificationsCount,markAllInboxNotificationsAsRead:c.markAllInboxNotificationsAsRead,markInboxNotificationAsRead:c.markInboxNotificationAsRead,deleteAllInboxNotifications:c.deleteAllInboxNotifications,deleteInboxNotification:c.deleteInboxNotification,getNotificationSettings:ee,updateNotificationSettings:L,resolvers:{invalidateUsers:D,invalidateRoomsInfo:W,invalidateMentionSuggestions:M},getSyncStatus:$,events:{error:j,syncStatus:B},[Oe]:{currentUserId:a,mentionSuggestionsCache:P,resolveMentionSuggestions:t.resolveMentionSuggestions,usersStore:w,roomsInfoStore:k,getRoomIds(){return Array.from(l.keys())},httpClient:c,as:()=>Q,createSyncSource:Y,emitError:(V,te)=>{const se=yh.from(V,te);j.notify(se)||wo(se.message)}}},Oe,{enumerable:!1});return Q}function bu(e,t,n,r,o){if(typeof t!="number"||t<n||r!==void 0&&t>r)throw new Error(r!==void 0?`${e} should be between ${o??n} and ${r}.`:`${e} should be at least ${o??n}.`);return t}function Ob(e){if(e!==void 0)return bu("backgroundKeepAliveTimeout",e,gb)}function Sb(e){return bu("throttle",e,pb,mb)}function Tb(e){return bu("lostConnectionTimeout",e,Cb,yb,bb)}function fl(e,...t){return()=>{}}function Rb(e){return"type"in e&&e.type==="paragraph"}function Ib(e){return!("type"in e)&&"text"in e&&typeof e.text=="string"}function Bb(e){return"type"in e&&e.type==="mention"}function Fb(e){return"type"in e&&e.type==="link"}var Pb={paragraph:Rb,text:Ib,link:Fb,mention:Bb};function Nb(e,t,n){if(!e||!e?.content)return;const o=Pb[t],s=n;for(const a of e.content)for(const i of a.children)o(i)&&s?.(i)}function kb(e){const t=new Set;return Nb(e,"mention",n=>t.add(n.id)),Array.from(t)}var jb={"&":"&","<":"<",">":">",'"':""","'":"'"};new RegExp(Object.keys(jb).map(e=>`\\${e}`).join("|"),"g");var Mb={_:"\\_","*":"\\*","#":"\\#","`":"\\`","~":"\\~","!":"\\!","|":"\\|","(":"\\(",")":"\\)","{":"\\{","}":"\\}","[":"\\[","]":"\\]"};new RegExp(Object.keys(Mb).map(e=>`\\${e}`).join("|"),"g");var Ua=[1e3,2e3,4e3,8e3,1e4];function vr(e,t,n){const r=performance.now(),o=typeof document<"u"?document:void 0,s=typeof window<"u"?window:void 0,a=n?.maxStaleTimeMs??Number.POSITIVE_INFINITY,i={inForeground:o?.visibilityState!=="hidden",lastSuccessfulPollAt:r,count:0,backoff:0};function u(){return i.count>0&&i.inForeground}const c=new uh({}).addState("@idle").addState("@enabled").addState("@polling");c.addTransitions("@idle",{START:"@enabled"}),c.addTransitions("@enabled",{STOP:"@idle",POLL:"@polling"}),c.addTimedTransition("@enabled",()=>{const E=i.lastSuccessfulPollAt+t;return Math.max(0,E-performance.now())+i.backoff},"@polling"),c.onEnterAsync("@polling",async(h,E)=>{await e(E),E.aborted||(i.lastSuccessfulPollAt=performance.now())},()=>({target:u()?"@enabled":"@idle",effect:()=>{i.backoff=0}}),()=>({target:u()?"@enabled":"@idle",effect:()=>{i.backoff=Ua.find(h=>h>i.backoff)??Ua[Ua.length-1]}}),3e4);function l(){u()?c.send({type:"START"}):c.send({type:"STOP"})}function d(){i.count++,l()}function m(){i.count--,i.count<0&&(i.count=0),l()}function g(){performance.now()-i.lastSuccessfulPollAt>a&&c.send({type:"POLL"})}function C(h){i.inForeground=h,l(),g()}function v(){C(o?.visibilityState!=="hidden")}return o?.addEventListener("visibilitychange",v),s?.addEventListener("online",v),s?.addEventListener("focus",g),c.start(),{inc:d,dec:m,pollNowIfStale:g,setInForeground:C}}function _b(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!Object.is(e[n],t[n]))return!1;return!0}function Lb(e,t){if(!nn(e)||!nn(t))return!1;const n=Object.keys(e);return n.length!==Object.keys(t).length?!1:n.every(r=>Object.prototype.hasOwnProperty.call(t,r)&&Object.is(e[r],t[r]))}function Bt(e,t){if(Object.is(e,t))return!0;const n=Array.isArray(e),r=Array.isArray(t);return n||r?!n||!r?!1:_b(e,t):Lb(e,t)}function $b(e,t,n){let r=0,o=e.length;for(;r<o;){const s=r+(o-r>>1);n(t,e[s])?o=s:r=s+1}return r}var dl=class as{#e;#t;constructor(t,n){this.#t=n,this.#e=t}static from(t,n){const r=new as([],n);for(const o of t)r.add(o);return r}static fromAlreadySorted(t,n){return new as(t,n)}clone(){return new as(this.#e.slice(),this.#t)}add(t){const n=$b(this.#e,t,this.#t);this.#e.splice(n,0,t)}remove(t){const n=this.#e.indexOf(t);return n>=0?(this.#e.splice(n,1),!0):!1}get length(){return this.#e.length}*filter(t){for(const n of this.#e)t(n)&&(yield n)}[Symbol.iterator](){return this.#e[Symbol.iterator]()}};du(P0,fu,N0);var Ub="@liveblocks/client",Hb="2.23.0",Wb="esm";du(Ub,Hb,Wb);var Dh=f.createContext(null);function zb(){return f.useContext(Dh)}function Vb(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}function Ws(e,t,n,r,o){const s=f.useRef(null);let a;s.current===null?(a={hasValue:!1,value:null},s.current=a):a=s.current;const[i,u]=f.useMemo(()=>{let l=!1,d,m;const g=E=>{if(!l){l=!0,d=E;const x=r(E);if(o!==void 0&&a.hasValue){const I=a.value;if(o(I,x))return m=I,I}return m=x,x}const y=d,w=m;if(Vb(y,E))return w;const D=r(E);return o!==void 0&&o(w,D)?(d=E,w):(d=E,m=D,D)},C=n===void 0?null:n;return[()=>g(t()),C===null?void 0:()=>g(C())]},[t,n,r,o]),c=f.useSyncExternalStore(e,i,u);return f.useEffect(()=>{a.hasValue=!0,a.value=c},[c]),f.useDebugValue(c),c}var Kb=e=>e;function Jn(e,t,n){return Ws(e.subscribe,e.get,e.get,t??Kb,n)}var lr=1e3,Pn=60*lr,yt={NOTIFICATIONS_POLL_INTERVAL:1*Pn,NOTIFICATIONS_MAX_STALE_TIME:5*lr,ROOM_THREADS_POLL_INTERVAL:5*Pn,ROOM_THREADS_MAX_STALE_TIME:5*lr,USER_THREADS_POLL_INTERVAL:1*Pn,USER_THREADS_MAX_STALE_TIME:30*lr,HISTORY_VERSIONS_POLL_INTERVAL:1*Pn,HISTORY_VERSIONS_MAX_STALE_TIME:5*lr,NOTIFICATION_SETTINGS_POLL_INTERVAL:1*Pn,NOTIFICATION_SETTINGS_MAX_STALE_TIME:5*lr,USER_NOTIFICATION_SETTINGS_INTERVAL:5*Pn,USER_NOTIFICATION_SETTINGS_MAX_STALE_TIME:1*Pn},ys=Object.freeze({isLoading:!0}),wh=e=>Object.freeze({isLoading:!1,error:e});function gr(e,t){return arguments.length===1?Object.freeze({isLoading:!1,data:e}):Object.freeze({isLoading:!1,[e]:t})}function qb(e,t){for(const n of e)if(t(n))return n}function Gb(e){const t=f.useRef(e);return f.useEffect(()=>{t.current=e},[e]),t}var Yb=e=>e;function ut(e){return f.useReducer(Yb,e)[0]}function Vo(e){const t=ut(e);if(typeof t=="function"){const n=Gb(e);return f.useCallback((...r)=>n.current(...r),[n])}else return t}function yu(e){const t=new Set;t.add("constructor");let n=e.constructor.prototype;do for(const r of Reflect.ownKeys(n)){if(t.has(r))continue;typeof Reflect.getOwnPropertyDescriptor(n,r)?.value=="function"&&(t.add(r),e[r]=e[r].bind(e))}while((n=Reflect.getPrototypeOf(n))&&n!==Object.prototype)}function hl(e,t){if(!nn(e)||!nn(t))return Bt(e,t);const n=Object.keys(e);return n.length!==Object.keys(t).length?!1:n.every(r=>Object.prototype.hasOwnProperty.call(t,r)&&Bt(e[r],t[r]))}function Xb(e){return t=>Zb(t,e)&&Jb(t,e)}function Zb(e,t){return t.resolved===void 0||e.resolved===t.resolved}function Jb(e,t){const n=e.metadata;return t.metadata===void 0||Object.entries(t.metadata).every(([r,o])=>o===void 0||Qb(n[r],o))}function Qb(e,t){return t===null?e===void 0:Di(t)?typeof e=="string"&&e.startsWith(t.startsWith):e===t}function ey(e){return e.deletedAt&&e.comments.length>0?{...e,comments:[]}:e.comments.some(n=>!n.deletedAt)?e:{...e,deletedAt:new Date,comments:[]}}var ty=class Ah{#e;#t;#n;signal;constructor(){this.#t=dl.from([],(t,n)=>{const r=t.createdAt,o=n.createdAt;return r<o?!0:r===o?t.id<n.id:!1}),this.#n=dl.from([],(t,n)=>{const r=n.updatedAt,o=t.updatedAt;return r<o?!0:r===o?n.id<t.id:!1}),this.#e=new Map,this.signal=new Xn(this)}clone(){const t=new Ah;return t.#e=new Map(this.#e),t.#t=this.#t.clone(),t.#n=this.#n.clone(),t}get(t){const n=this.getEvenIfDeleted(t);return n?.deletedAt?void 0:n}getEvenIfDeleted(t){return this.#e.get(t)}upsert(t){this.signal.mutate(()=>{t=ey(t);const n=t.id,r=this.#e.get(n);if(r){if(r.deletedAt)return!1;this.#t.remove(r),this.#n.remove(r)}return t.deletedAt||(this.#t.add(t),this.#n.add(t)),this.#e.set(n,t),!0})}upsertIfNewer(t){const n=this.get(t.id);(!n||t.updatedAt>=n.updatedAt)&&this.upsert(t)}applyDelta(t,n){ct(()=>{for(const r of t)this.upsertIfNewer(r);for(const{id:r,deletedAt:o}of n)this.getEvenIfDeleted(r)&&this.delete(r,o)})}delete(t,n){const r=this.#e.get(t);r&&!r.deletedAt&&this.upsert({...r,deletedAt:n,updatedAt:n})}findMany(t,n,r){const o=r==="desc"?this.#n:this.#t,s=[];return t!==void 0&&s.push(a=>a.roomId===t),s.push(Xb(n)),Array.from(o.filter(a=>s.every(i=>i(a))))}};function ny(e,t){return zn([e,t??{}])}function ry(e){return zn(e??{})}function xh(e){if("status"in e)return e;const t=e;return t.status="pending",t.then(n=>{t.status="fulfilled",t.value=n},n=>{t.status="rejected",t.reason=n}),t}var oy=Promise.resolve(),Ha=class{#e;signal;#t;#n;constructor(e){this.#e=new zt(ys),this.#t=e,this.#n=null,this.signal=this.#e.asReadonly(),yu(this)}get(){return this.#e.get()}#r(e){const t=this.#e.get();t.data!==void 0&&this.#e.set(gr({...t.data,...e}))}async#s(){const e=this.#e.get();if(!(!e.data?.cursor||e.data.isFetchingMore)){this.#r({isFetchingMore:!0});try{const t=await this.#t(e.data.cursor);this.#r({cursor:t,hasFetchedAll:t===null,fetchMoreError:void 0,isFetchingMore:!1})}catch(t){this.#r({isFetchingMore:!1,fetchMoreError:t})}}}fetchMore(){return this.#e.get().data?.cursor?(this.#n||(this.#n=this.#s().finally(()=>{this.#n=null})),this.#n):oy}#o=null;waitUntilLoaded(){if(this.#o)return this.#o;const e=Yr(()=>this.#t(void 0),5,[5e3,5e3,1e4,15e3]),t=xh(e);return t.then(n=>{this.#e.set(gr({cursor:n,hasFetchedAll:n===null,isFetchingMore:!1,fetchMoreError:void 0,fetchMore:this.fetchMore}))},n=>{this.#e.set(wh(n)),setTimeout(()=>{this.#o=null,this.#e.set(ys)},5e3)}),this.#o=t,this.#o}},Wa=class{#e;signal;#t;constructor(e){this.#e=new zt(ys),this.signal=this.#e.asReadonly(),this.#t=e,yu(this)}get(){return this.#e.get()}#n=null;waitUntilLoaded(){if(this.#n)return this.#n;const e=Yr(()=>this.#t(),5,[5e3,5e3,1e4,15e3]),t=xh(e);return t.then(()=>{this.#e.set(gr(void 0))},n=>{this.#e.set(wh(n)),setTimeout(()=>{this.#n=null,this.#e.set(ys)},5e3)}),this.#n=t,t}};function sy(){const e=new Xn(new Map);function t(u,c){e.mutate(l=>{const d=l.get(u);return d?(l.set(u,{...d,readAt:c}),!0):!1})}function n(u){e.mutate(c=>{for(const l of c.values())l.readAt=u})}function r(u){e.mutate(c=>c.delete(u))}function o(){e.mutate(u=>u.clear())}function s(u,c){e.mutate(l=>{let d=!1;for(const m of u){const g=l.get(m.id);g&&my(g,m)===1||(l.set(m.id,m),d=!0)}for(const m of c)l.delete(m.id),d=!0;return d})}function a(u){e.mutate(c=>{const l=qb(c.values(),d=>d.kind==="thread"&&d.threadId===u.threadId);return l?(c.set(l.id,{...l,notifiedAt:u.createdAt,readAt:u.createdAt}),!0):!1})}function i(u){e.mutate(c=>{c.set(u.id,u)})}return{signal:e.asReadonly(),markAllRead:n,markRead:t,delete:r,applyDelta:s,clear:o,updateAssociatedNotification:a,upsert:i}}function ay(e){const t=new Xn(new Map);function n(r,o){t.mutate(s=>{s.set(r,o)})}return{signal:Xe.from(t,e,(r,o)=>hy(r,o)),update:n}}function iy(){const e=new Xn(new It(()=>new Map));function t(n,r){e.mutate(o=>{const s=o.getOrCreate(n);for(const a of r)s.set(a.id,a)})}return{signal:Xe.from(e,n=>Object.fromEntries([...n].map(([r,o])=>[r,Object.fromEntries(o)]))),update:t}}function uy(){const e=new Xn(new It(()=>new Set));function t(n){e.mutate(r=>{for(const[o,s]of Object.entries(n)){const a=r.getOrCreate(o);for(const i of s)a.add(i)}})}return{signal:e.asReadonly(),update:t}}function cy(e){const t=new zt(bs({}));function n(r){t.set(r)}return{signal:Xe.from(t,e,(r,o)=>py(r,o)),update:n}}function ly(e){const t=new zt([]),n=e[Oe].createSyncSource();t.subscribe(()=>n.setSyncStatus(t.get().length>0?"synchronizing":"synchronized"));function r(s){const a=Pr(),i={...s,id:a};return t.set(u=>[...u,i]),a}function o(s){t.set(a=>a.filter(i=>i.id!==s))}return{signal:t.asReadonly(),add:r,remove:o}}var fy=class{#e;threads;notifications;roomNotificationSettings;historyVersions;permissionHints;userNotificationSettings;optimisticUpdates;outputs;#t=null;#n;#r=new Map;#s=null;#o=new Map;#i;constructor(e){this.#e=e[Oe].as(),this.optimisticUpdates=ly(this.#e),this.permissionHints=uy(),this.#n=new Ha(async d=>{const m=await this.#e.getInboxNotifications({cursor:d});return this.updateThreadifications(m.threads,m.inboxNotifications),this.#t===null&&(this.#t=m.requestedAt),m.nextCursor});const t=async()=>{const d=await this.#e.getNotificationSettings();this.userNotificationSettings.update(d)};this.userNotificationSettings=cy(this.optimisticUpdates.signal),this.#i=new Wa(t),this.threads=new ty,this.notifications=sy(),this.roomNotificationSettings=ay(this.optimisticUpdates.signal),this.historyVersions=iy();const n=Xe.from(this.threads.signal,this.notifications.signal,this.optimisticUpdates.signal,(d,m,g)=>dy(d,m,g)),r=Xe.from(n,d=>d.threadsDB),o=Xe.from(n,d=>({sortedNotifications:d.sortedNotifications,notificationsById:d.notificationsById}),Bt),s=new It(d=>{const m=JSON.parse(d),g=new Ha(async v=>{const h=await this.#e[Oe].httpClient.getUserThreads_experimental({cursor:v,query:m});return this.updateThreadifications(h.threads,h.inboxNotifications),this.permissionHints.update(h.permissionHints),this.#s===null&&(this.#s=h.requestedAt),h.nextCursor});return{signal:Xe.from(()=>{const v=g.get();if(v.isLoading||v.error)return v;const h=this.outputs.threads.get().findMany(void 0,m??{},"desc"),E=v.data;return{isLoading:!1,threads:h,hasFetchedAll:E.hasFetchedAll,isFetchingMore:E.isFetchingMore,fetchMoreError:E.fetchMoreError,fetchMore:E.fetchMore}},hl),waitUntilLoaded:g.waitUntilLoaded}}),a=new It(d=>{const[m,g]=JSON.parse(d),C=new Ha(async h=>{const E=await this.#e[Oe].httpClient.getThreads({roomId:m,cursor:h,query:g});this.updateThreadifications(E.threads,E.inboxNotifications),this.permissionHints.update(E.permissionHints);const y=this.#r.get(m);return(y===void 0||y>E.requestedAt)&&this.#r.set(m,E.requestedAt),E.nextCursor});return{signal:Xe.from(()=>{const h=C.get();if(h.isLoading||h.error)return h;const E=this.outputs.threads.get().findMany(m,g??{},"asc"),y=h.data;return{isLoading:!1,threads:E,hasFetchedAll:y.hasFetchedAll,isFetchingMore:y.isFetchingMore,fetchMoreError:y.fetchMoreError,fetchMore:y.fetchMore}},hl),waitUntilLoaded:C.waitUntilLoaded}}),i={signal:Xe.from(()=>{const m=this.#n.get();if(m.isLoading||m.error)return m;const g=m.data;return{isLoading:!1,inboxNotifications:this.outputs.notifications.get().sortedNotifications,hasFetchedAll:g.hasFetchedAll,isFetchingMore:g.isFetchingMore,fetchMoreError:g.fetchMoreError,fetchMore:g.fetchMore}}),waitUntilLoaded:this.#n.waitUntilLoaded},u=new It(d=>{const m=new Wa(async()=>{const C=this.#e.getRoom(d);if(C===null)throw new Error(`Room '${d}' is not available on client`);const v=await C.getNotificationSettings();this.roomNotificationSettings.update(d,v)});return{signal:Xe.from(()=>{const C=m.get();return C.isLoading||C.error?C:gr("settings",pe(this.roomNotificationSettings.signal.get()[d]))},Bt),waitUntilLoaded:m.waitUntilLoaded}}),c=new It(d=>{const m=new Wa(async()=>{const C=this.#e.getRoom(d);if(C===null)throw new Error(`Room '${d}' is not available on client`);const v=await C[Oe].listTextVersions();this.historyVersions.update(d,v.versions);const h=this.#o.get(d);(h===void 0||h>v.requestedAt)&&this.#o.set(d,v.requestedAt)});return{signal:Xe.from(()=>{const C=m.get();return C.isLoading||C.error?C:gr("versions",Object.values(this.historyVersions.signal.get()[d]??{}))},Bt),waitUntilLoaded:m.waitUntilLoaded}}),l={signal:Xe.from(()=>{const d=this.#i.get();return d.isLoading||d.error?d:gr("settings",pe(this.userNotificationSettings.signal.get()))},Bt),waitUntilLoaded:this.#i.waitUntilLoaded};this.outputs={threadifications:n,threads:r,loadingRoomThreads:a,loadingUserThreads:s,notifications:o,loadingNotifications:i,settingsByRoomId:u,versionsByRoomId:c,userNotificationSettings:l},yu(this)}markInboxNotificationRead(e,t,n){ct(()=>{this.optimisticUpdates.remove(n),this.notifications.markRead(e,t)})}markAllInboxNotificationsRead(e,t){ct(()=>{this.optimisticUpdates.remove(e),this.notifications.markAllRead(t)})}deleteInboxNotification(e,t){ct(()=>{this.optimisticUpdates.remove(t),this.notifications.delete(e)})}deleteAllInboxNotifications(e){ct(()=>{this.optimisticUpdates.remove(e),this.notifications.clear()})}createThread(e,t){ct(()=>{this.optimisticUpdates.remove(e),this.threads.upsert(t)})}#a(e,t,n,r){ct(()=>{t!==null&&this.optimisticUpdates.remove(t);const o=this.threads,s=o.get(e);s&&(r&&s.updatedAt>r||o.upsert(n(s)))})}patchThread(e,t,n,r){return this.#a(e,t,o=>({...o,...Ao(n)}),r)}addReaction(e,t,n,r,o){this.#a(e,t,s=>Sh(s,n,r),o)}removeReaction(e,t,n,r,o,s){this.#a(e,t,a=>Th(a,n,r,o,s),s)}deleteThread(e,t){return this.#a(e,t,n=>({...n,updatedAt:new Date,deletedAt:new Date}))}createComment(e,t){ct(()=>{this.optimisticUpdates.remove(t);const n=this.threads.get(e.threadId);n&&(this.threads.upsert(Es(n,e)),this.notifications.updateAssociatedNotification(e))})}editComment(e,t,n){return this.#a(e,t,r=>Es(r,n))}deleteComment(e,t,n,r){return this.#a(e,t,o=>Oh(o,n,r),r)}updateThreadifications(e,t,n=[],r=[]){ct(()=>{this.threads.applyDelta(e,n),this.notifications.applyDelta(t,r)})}updateRoomNotificationSettings(e,t,n){ct(()=>{this.optimisticUpdates.remove(t),this.roomNotificationSettings.update(e,n)})}async fetchNotificationsDeltaUpdate(e){const t=this.#t;if(t===null)return;const n=await this.#e.getInboxNotificationsSince({since:t,signal:e});t<n.requestedAt&&(this.#t=n.requestedAt),this.updateThreadifications(n.threads.updated,n.inboxNotifications.updated,n.threads.deleted,n.inboxNotifications.deleted)}async fetchRoomThreadsDeltaUpdate(e,t){const n=this.#r.get(e);if(n===void 0)return;const r=await this.#e[Oe].httpClient.getThreadsSince({roomId:e,since:n,signal:t});this.updateThreadifications(r.threads.updated,r.inboxNotifications.updated,r.threads.deleted,r.inboxNotifications.deleted),this.permissionHints.update(r.permissionHints),n<r.requestedAt&&this.#r.set(e,r.requestedAt)}async fetchUserThreadsDeltaUpdate(e){const t=this.#s;if(t===null)return;const n=await this.#e[Oe].httpClient.getUserThreadsSince_experimental({since:t,signal:e});t<n.requestedAt&&(this.#t=n.requestedAt),this.updateThreadifications(n.threads.updated,n.inboxNotifications.updated,n.threads.deleted,n.inboxNotifications.deleted),this.permissionHints.update(n.permissionHints)}async fetchRoomVersionsDeltaUpdate(e,t){const n=this.#o.get(e);if(n===void 0)return;const o=await pe(this.#e.getRoom(e),`Room with id ${e} is not available on client`)[Oe].listTextVersionsSince({since:n,signal:t});this.historyVersions.update(e,o.versions),n<o.requestedAt&&this.#o.set(e,o.requestedAt)}async refreshRoomNotificationSettings(e,t){const r=await pe(this.#e.getRoom(e),`Room with id ${e} is not available on client`).getNotificationSettings({signal:t});this.roomNotificationSettings.update(e,r)}async refreshUserNotificationSettings(e){const t=await this.#e.getNotificationSettings({signal:e});this.userNotificationSettings.update(t)}updateUserNotificationSettings_confirmOptimisticUpdate(e,t){ct(()=>{this.optimisticUpdates.remove(t),this.userNotificationSettings.update(e)})}};function dy(e,t,n){const r=e.clone();let o=Object.fromEntries(t);for(const a of n)switch(a.type){case"create-thread":{r.upsert(a.thread);break}case"edit-thread-metadata":{const i=r.get(a.threadId);if(i===void 0||i.updatedAt>a.updatedAt)break;r.upsert({...i,updatedAt:a.updatedAt,metadata:{...i.metadata,...a.metadata}});break}case"mark-thread-as-resolved":{const i=r.get(a.threadId);if(i===void 0)break;r.upsert({...i,resolved:!0});break}case"mark-thread-as-unresolved":{const i=r.get(a.threadId);if(i===void 0)break;r.upsert({...i,resolved:!1});break}case"create-comment":{const i=r.get(a.comment.threadId);if(i===void 0)break;r.upsert(Es(i,a.comment));const u=Object.values(o).find(c=>c.kind==="thread"&&c.threadId===i.id);if(u===void 0)break;o[u.id]={...u,notifiedAt:a.comment.createdAt,readAt:a.comment.createdAt};break}case"edit-comment":{const i=r.get(a.comment.threadId);if(i===void 0)break;r.upsert(Es(i,a.comment));break}case"delete-comment":{const i=r.get(a.threadId);if(i===void 0)break;r.upsert(Oh(i,a.commentId,a.deletedAt));break}case"delete-thread":{const i=r.get(a.threadId);if(i===void 0)break;r.upsert({...i,deletedAt:a.deletedAt,updatedAt:a.deletedAt,comments:[]});break}case"add-reaction":{const i=r.get(a.threadId);if(i===void 0)break;r.upsert(Sh(i,a.commentId,a.reaction));break}case"remove-reaction":{const i=r.get(a.threadId);if(i===void 0)break;r.upsert(Th(i,a.commentId,a.emoji,a.userId,a.removedAt));break}case"mark-inbox-notification-as-read":{const i=o[a.inboxNotificationId];if(i===void 0)break;o[a.inboxNotificationId]={...i,readAt:a.readAt};break}case"mark-all-inbox-notifications-as-read":{for(const i in o){const u=o[i];if(u===void 0)break;o[i]={...u,readAt:a.readAt}}break}case"delete-inbox-notification":{delete o[a.inboxNotificationId];break}case"delete-all-inbox-notifications":{o={};break}}return{sortedNotifications:Object.values(o).filter(a=>a.kind==="thread"?r.get(a.threadId)!==void 0:!0).sort((a,i)=>i.notifiedAt.getTime()-a.notifiedAt.getTime()),notificationsById:o,threadsDB:r}}function hy(e,t){const n=Object.fromEntries(e);for(const r of t)switch(r.type){case"update-notification-settings":{const o=n[r.roomId];if(o===void 0)break;n[r.roomId]={...o,...r.settings}}}return n}function py(e,t){let n=e;for(const r of t)r.type==="update-user-notification-settings"&&(n=IC(n,r.settings));return n}function my(e,t){return e.notifiedAt>t.notifiedAt?1:e.notifiedAt<t.notifiedAt?-1:e.readAt&&t.readAt?e.readAt>t.readAt?1:e.readAt<t.readAt?-1:0:e.readAt||t.readAt?e.readAt?1:-1:0}function Es(e,t){if(e.deletedAt!==void 0)return e;if(t.threadId!==e.id)return Cn.warn(`Comment ${t.id} does not belong to thread ${e.id}`),e;const n=e.comments.find(r=>r.id===t.id);if(n===void 0){const r=new Date(Math.max(e.updatedAt.getTime(),t.createdAt.getTime()));return{...e,updatedAt:r,comments:[...e.comments,t]}}if(n.deletedAt!==void 0)return e;if(n.editedAt===void 0||t.editedAt===void 0||n.editedAt<=t.editedAt){const r=e.comments.map(s=>s.id===t.id?t:s);return{...e,updatedAt:new Date(Math.max(e.updatedAt.getTime(),t.editedAt?.getTime()||t.createdAt.getTime())),comments:r}}return e}function Oh(e,t,n){if(e.deletedAt!==void 0)return e;const r=e.comments.find(s=>s.id===t);if(r===void 0||r.deletedAt!==void 0)return e;const o=e.comments.map(s=>s.id===t?{...s,deletedAt:n,body:void 0,attachments:[]}:s);return o.every(s=>s.deletedAt!==void 0)?{...e,deletedAt:n,updatedAt:n}:{...e,updatedAt:n,comments:o}}function Sh(e,t,n){if(e.deletedAt!==void 0)return e;const r=e.comments.find(s=>s.id===t);if(r===void 0||r.deletedAt!==void 0)return e;const o=e.comments.map(s=>s.id===t?{...s,reactions:vy(s.reactions,n)}:s);return{...e,updatedAt:new Date(Math.max(n.createdAt.getTime(),e.updatedAt.getTime())),comments:o}}function Th(e,t,n,r,o){if(e.deletedAt!==void 0)return e;const s=e.comments.find(i=>i.id===t);if(s===void 0||s.deletedAt!==void 0)return e;const a=e.comments.map(i=>i.id===t?{...i,reactions:i.reactions.map(u=>u.emoji===n?{...u,users:u.users.filter(c=>c.id!==r)}:u).filter(u=>u.users.length>0)}:i);return{...e,updatedAt:new Date(Math.max(o.getTime(),e.updatedAt.getTime())),comments:a}}function vy(e,t){const n=e.find(r=>r.emoji===t.emoji);return n===void 0?[...e,{emoji:t.emoji,createdAt:t.createdAt,users:[{id:t.userId}]}]:n.users.some(r=>r.id===t.userId)===!1?e.map(r=>r.emoji===t.emoji?{...r,users:[...r.users,{id:t.userId}]}:r):e}var Rh=f.createContext(null);function Ih(e){return new Error(`resolveUsers didn't return anything for user '${e}'`)}function gy(e){return new Error(`resolveRoomsInfo didn't return anything for room '${e}'`)}function Cy(e){return e}var pl=new WeakMap,ml=new WeakMap;function by(e,t){return e===void 0||e?.isLoading?e??{isLoading:!0}:e.error?e:e.data?{isLoading:!1,user:e.data}:{isLoading:!1,error:Ih(t)}}function yy(e,t){return e===void 0||e?.isLoading?e??{isLoading:!0}:e.error?e:e.data?{isLoading:!1,info:e.data}:{isLoading:!1,error:gy(t)}}function Bh(e){let t=pl.get(e);return t||(t=new fy(e),pl.set(e,t)),t}function xo(e){let t=ml.get(e);return t||(t=Ey(e),ml.set(e,t)),t}function Ey(e){const t=Bh(e),n=vr(async s=>{try{return await t.fetchNotificationsDeltaUpdate(s)}catch(a){throw console.warn(`Polling new inbox notifications failed: ${String(a)}`),a}},yt.NOTIFICATIONS_POLL_INTERVAL,{maxStaleTimeMs:yt.NOTIFICATIONS_MAX_STALE_TIME}),r=vr(async s=>{try{return await t.fetchUserThreadsDeltaUpdate(s)}catch(a){throw console.warn(`Polling new user threads failed: ${String(a)}`),a}},yt.USER_THREADS_POLL_INTERVAL,{maxStaleTimeMs:yt.USER_THREADS_MAX_STALE_TIME}),o=vr(async s=>{try{return await t.refreshUserNotificationSettings(s)}catch(a){throw console.warn(`Polling new user notification settings failed: ${String(a)}`),a}},yt.USER_NOTIFICATION_SETTINGS_INTERVAL,{maxStaleTimeMs:yt.USER_NOTIFICATION_SETTINGS_MAX_STALE_TIME});return{store:t,notificationsPoller:n,userThreadsPoller:r,userNotificationSettingsPoller:o}}function Dy(e,t,n){const{store:r,notificationsPoller:o}=xo(e);return f.useEffect(()=>void r.outputs.loadingNotifications.waitUntilLoaded()),f.useEffect(()=>(o.inc(),o.pollNowIfStale(),()=>{o.dec()}),[o]),Jn(r.outputs.loadingNotifications.signal,t,n)}function wy(e){return f.useCallback(t=>{const{store:n}=xo(e),r=new Date,o=n.optimisticUpdates.add({type:"mark-inbox-notification-as-read",inboxNotificationId:t,readAt:r});e.markInboxNotificationAsRead(t).then(()=>{n.markInboxNotificationRead(t,r,o)},s=>{n.optimisticUpdates.remove(o),e[Oe].emitError({type:"MARK_INBOX_NOTIFICATION_AS_READ_ERROR",inboxNotificationId:t},s)})},[e])}function Ay(e){return f.useCallback(t=>{const{store:n}=xo(e),r=new Date,o=n.optimisticUpdates.add({type:"delete-inbox-notification",inboxNotificationId:t,deletedAt:r});e.deleteInboxNotification(t).then(()=>{n.deleteInboxNotification(t,o)},s=>{n.optimisticUpdates.remove(o),e[Oe].emitError({type:"DELETE_INBOX_NOTIFICATION_ERROR",inboxNotificationId:t},s)})},[e])}function xy(e,t){const{store:n}=xo(e);return Jn(n.outputs.threadifications,f.useCallback(r=>{const o=r.notificationsById[t]??wt(`Inbox notification with ID "${t}" not found`);return o.kind!=="thread"&&wt(`Inbox notification with ID "${t}" is not of kind "thread"`),r.threadsDB.get(o.threadId)??wt(`Thread with ID "${o.threadId}" not found, this inbox notification might not be of kind "thread"`)},[t]))}function Oy(e,t){const n=e[Oe].usersStore,r=f.useCallback(()=>n.getItemState(t),[n,t]),o=f.useCallback(a=>by(a,t),[t]),s=Ws(n.subscribe,r,r,o,Bt);return f.useEffect(()=>void n.enqueue(t)),s}function Sy(e,t){const n=e[Oe].usersStore,r=f.useCallback(()=>n.getItemState(t),[n,t]),o=r();if(!o||o.isLoading)throw n.enqueue(t);if(o.error)throw o.error;if(!o.data)throw Ih(t);const s=f.useSyncExternalStore(n.subscribe,r,r);return s.isLoading,s.error,{isLoading:!1,user:s.data,error:void 0}}function Ty(e,t){const n=e[Oe].roomsInfoStore,r=f.useCallback(()=>n.getItemState(t),[n,t]),o=f.useCallback(a=>yy(a,t),[t]),s=Ws(n.subscribe,r,r,o,Bt);return f.useEffect(()=>void n.enqueue(t)),s}function Ry(e){const t=Eu();if(!e?.allowNesting&&t!==null)throw new Error("You cannot nest multiple LiveblocksProvider instances in the same React tree.")}function Eu(){return f.useContext(Rh)}function Be(){return Eu()??wt("LiveblocksProvider is missing from the React tree.")}function Iy(e){return Ry(e),p.jsx(Rh.Provider,{value:e.client,children:e.children})}function hP(e){const{children:t,...n}=e,r={publicApiKey:ut(n.publicApiKey),throttle:ut(n.throttle),lostConnectionTimeout:ut(n.lostConnectionTimeout),backgroundKeepAliveTimeout:ut(n.backgroundKeepAliveTimeout),polyfills:ut(n.polyfills),largeMessageStrategy:ut(n.largeMessageStrategy),unstable_fallbackToHTTP:ut(n.unstable_fallbackToHTTP),unstable_streamData:ut(n.unstable_streamData),preventUnsavedChanges:ut(n.preventUnsavedChanges),authEndpoint:Vo(n.authEndpoint),resolveMentionSuggestions:Vo(n.resolveMentionSuggestions),resolveUsers:Vo(n.resolveUsers),resolveRoomsInfo:Vo(n.resolveRoomsInfo),baseUrl:ut(n.baseUrl),enableDebugLogging:ut(n.enableDebugLogging)},o=f.useMemo(()=>xb(r),[]);return p.jsx(Iy,{client:o,children:t})}function By(e={}){const t=Be(),{store:n,userThreadsPoller:r}=xo(t),o=ry(e.query);return f.useEffect(()=>void n.outputs.loadingUserThreads.getOrCreate(o).waitUntilLoaded()),f.useEffect(()=>(r.inc(),r.pollNowIfStale(),()=>{r.dec()}),[r]),Jn(n.outputs.loadingUserThreads.getOrCreate(o).signal)}function pP(){return Dy(Be(),Cy,Bt)}function Fy(e){return xy(Be(),e)}function Py(){return wy(Be())}function Ny(){return Ay(Be())}function ky(e){const t=Be();return Oy(t,e)}function jy(e){const t=Be();return Sy(t,e)}function Du(e){return Ty(Be(),e)}var My=Fy,Fh=ky,mP=jy,vP=By;function _y(e,t){if(e===!1||!t.threads||!(typeof window<"u"))return;const o=window.location.hash.slice(1);if(!o.startsWith("cm_"))return;const s=document.getElementById(o);s===null||!t.threads.flatMap(u=>u.comments).some(u=>u.id===o)||s.scrollIntoView()}function Ly(e,t){f.useEffect(()=>{_y(e,t)},[t.isLoading])}function zs(e){const t=e[Oe].currentUserId.get();return t===void 0?"anonymous":t}var vl=new WeakMap;function vt(e){let t=vl.get(e);return t||(t=$y(e),vl.set(e,t)),t}function $y(e){const t=Bh(e);function n(a,i,u){if(t.optimisticUpdates.remove(a),u instanceof Ar){if(u.status===403){const c=[u.message,u.details?.suggestion,u.details?.docs].filter(Boolean).join(`
|
|
3
3
|
`);Cn.error(c)}e[Oe].emitError(i,u)}else throw u}const r=new It(a=>vr(async i=>{try{return await t.fetchRoomThreadsDeltaUpdate(a,i)}catch(u){throw Cn.warn(`Polling new threads for '${a}' failed: ${String(u)}`),u}},yt.ROOM_THREADS_POLL_INTERVAL,{maxStaleTimeMs:yt.ROOM_THREADS_MAX_STALE_TIME})),o=new It(a=>vr(async i=>{try{return await t.fetchRoomVersionsDeltaUpdate(a,i)}catch(u){throw Cn.warn(`Polling new history versions for '${a}' failed: ${String(u)}`),u}},yt.HISTORY_VERSIONS_POLL_INTERVAL,{maxStaleTimeMs:yt.HISTORY_VERSIONS_MAX_STALE_TIME})),s=new It(a=>vr(async i=>{try{return await t.refreshRoomNotificationSettings(a,i)}catch(u){throw Cn.warn(`Polling notification settings for '${a}' failed: ${String(u)}`),u}},yt.NOTIFICATION_SETTINGS_POLL_INTERVAL,{maxStaleTimeMs:yt.NOTIFICATION_SETTINGS_MAX_STALE_TIME}));return{store:t,onMutationFailure:n,getOrCreateThreadsPollerForRoomId:r.getOrCreate.bind(r),getOrCreateVersionsPollerForRoomId:o.getOrCreate.bind(o),getOrCreateNotificationsSettingsPollerForRoomId:s.getOrCreate.bind(s)}}function Uy(e){const t=Be(),[n]=f.useState(()=>new Map),r=f.useCallback((o,s)=>{const a=n.get(o);if(a)return a;const i=t.enterRoom(o,s),u=i.leave;return i.leave=()=>{u(),n.delete(o)},n.set(o,i),i},[t,n]);return p.jsx(Hy,{...e,stableEnterRoom:r})}function Hy(e){const t=Be(),{id:n,stableEnterRoom:r}=e,o=ut({initialPresence:e.initialPresence,initialStorage:e.initialStorage,autoConnect:e.autoConnect??typeof window<"u"}),[{room:s},a]=f.useState(()=>r(n,{...o,autoConnect:!1}));return f.useEffect(()=>{const{store:i}=vt(t);async function u(c){if(c.type===Zt.THREAD_DELETED){i.deleteThread(c.threadId,null);return}const l=await s.getThread(c.threadId);if(!l.thread){i.deleteThread(c.threadId,null);return}const{thread:d,inboxNotification:m}=l,g=i.outputs.threads.get().getEvenIfDeleted(c.threadId);switch(c.type){case Zt.COMMENT_EDITED:case Zt.THREAD_METADATA_UPDATED:case Zt.THREAD_UPDATED:case Zt.COMMENT_REACTION_ADDED:case Zt.COMMENT_REACTION_REMOVED:case Zt.COMMENT_DELETED:if(!g)break;i.updateThreadifications([d],m?[m]:[]);break;case Zt.COMMENT_CREATED:i.updateThreadifications([d],m?[m]:[]);break}}return s.events.comments.subscribe(c=>void u(c))},[t,s]),f.useEffect(()=>{const i=r(n,o);a(i);const{room:u,leave:c}=i;return o.autoConnect&&u.connect(),()=>{c()}},[n,o,r]),p.jsx(Dh.Provider,{value:s,children:e.children})}function wu(e){const t=zb();if(t===null&&!e?.allowOutsideRoom)throw new Error("RoomProvider is missing from the React tree.");return t}function Au(){return Be()[Oe].resolveMentionSuggestions}function Wy(){return Be()[Oe].mentionSuggestionsCache}function zy(e={}){const{scrollOnLoad:t=!0}=e,n=Be(),r=wu(),{store:o,getOrCreateThreadsPollerForRoomId:s}=vt(n),a=ny(r.id,e.query),i=s(r.id);f.useEffect(()=>void o.outputs.loadingRoomThreads.getOrCreate(a).waitUntilLoaded()),f.useEffect(()=>(i.inc(),i.pollNowIfStale(),()=>i.dec()),[i]);const u=Jn(o.outputs.loadingRoomThreads.getOrCreate(a).signal);return Ly(t,u),u}function Vy(){return Ph(wu().id)}function Ph(e){const t=Be();return f.useCallback(n=>{const r=n.body,o=n.metadata??{},s=n.attachments,a=oh(),i=Cs(),u=new Date,c={id:i,threadId:a,roomId:e,createdAt:u,type:"comment",userId:zs(t),body:r,reactions:[],attachments:s??[]},l={id:a,type:"thread",createdAt:u,updatedAt:u,roomId:e,metadata:o,comments:[c],resolved:!1},{store:d,onMutationFailure:m}=vt(t),g=d.optimisticUpdates.add({type:"create-thread",thread:l,roomId:e}),C=s?.map(v=>v.id);return t[Oe].httpClient.createThread({roomId:e,threadId:a,commentId:i,body:r,metadata:o,attachmentIds:C}).then(v=>{d.createThread(g,v)},v=>m(g,{type:"CREATE_THREAD_ERROR",roomId:e,threadId:a,commentId:i,body:r,metadata:o},v)),l},[t,e])}function Ky(e){const t=Be();return f.useCallback(({threadId:n,body:r,attachments:o})=>{const s=Cs(),i={id:s,threadId:n,roomId:e,type:"comment",createdAt:new Date,userId:zs(t),body:r,reactions:[],attachments:o??[]},{store:u,onMutationFailure:c}=vt(t),l=u.optimisticUpdates.add({type:"create-comment",comment:i}),d=o?.map(m=>m.id);return t[Oe].httpClient.createComment({roomId:e,threadId:n,commentId:s,body:r,attachmentIds:d}).then(m=>{u.createComment(m,l)},m=>c(l,{type:"CREATE_COMMENT_ERROR",roomId:e,threadId:n,commentId:s,body:r},m)),i},[t,e])}function Nh(e){const t=Be();return f.useCallback(({threadId:n,commentId:r,body:o,attachments:s})=>{const a=new Date,{store:i,onMutationFailure:u}=vt(t),c=i.outputs.threads.get().getEvenIfDeleted(n);if(c===void 0){Cn.warn(`Internal unexpected behavior. Cannot edit comment in thread "${n}" because the thread does not exist in the cache.`);return}const l=c.comments.find(g=>g.id===r);if(l===void 0||l.deletedAt!==void 0){Cn.warn(`Internal unexpected behavior. Cannot edit comment "${r}" in thread "${n}" because the comment does not exist in the cache.`);return}const d=i.optimisticUpdates.add({type:"edit-comment",comment:{...l,editedAt:a,body:o,attachments:s??[]}}),m=s?.map(g=>g.id);t[Oe].httpClient.editComment({roomId:e,threadId:n,commentId:r,body:o,attachmentIds:m}).then(g=>{i.editComment(n,d,g)},g=>u(d,{type:"EDIT_COMMENT_ERROR",roomId:e,threadId:n,commentId:r,body:o},g))},[t,e])}function qy(e){const t=Be();return f.useCallback(({threadId:n,commentId:r})=>{const o=new Date,{store:s,onMutationFailure:a}=vt(t),i=s.optimisticUpdates.add({type:"delete-comment",threadId:n,commentId:r,deletedAt:o,roomId:e});t[Oe].httpClient.deleteComment({roomId:e,threadId:n,commentId:r}).then(()=>{s.deleteComment(n,i,r,o)},u=>a(i,{type:"DELETE_COMMENT_ERROR",roomId:e,threadId:n,commentId:r},u))},[t,e])}function kh(e){const t=Be();return f.useCallback(({threadId:n,commentId:r,emoji:o})=>{const s=new Date,a=zs(t),{store:i,onMutationFailure:u}=vt(t),c=i.optimisticUpdates.add({type:"add-reaction",threadId:n,commentId:r,reaction:{emoji:o,userId:a,createdAt:s}});t[Oe].httpClient.addReaction({roomId:e,threadId:n,commentId:r,emoji:o}).then(l=>{i.addReaction(n,c,r,l,s)},l=>u(c,{type:"ADD_REACTION_ERROR",roomId:e,threadId:n,commentId:r,emoji:o},l))},[t,e])}function jh(e){const t=Be();return f.useCallback(({threadId:n,commentId:r,emoji:o})=>{const s=zs(t),a=new Date,{store:i,onMutationFailure:u}=vt(t),c=i.optimisticUpdates.add({type:"remove-reaction",threadId:n,commentId:r,emoji:o,userId:s,removedAt:a});t[Oe].httpClient.removeReaction({roomId:e,threadId:n,commentId:r,emoji:o}).then(()=>{i.removeReaction(n,c,r,o,s,a)},l=>u(c,{type:"REMOVE_REACTION_ERROR",roomId:e,threadId:n,commentId:r,emoji:o},l))},[t,e])}function Gy(e){const t=Be();return f.useCallback(n=>{const{store:r,onMutationFailure:o}=vt(t),s=Object.values(r.outputs.notifications.get().notificationsById).find(u=>u.kind==="thread"&&u.threadId===n);if(!s)return;const a=new Date,i=r.optimisticUpdates.add({type:"mark-inbox-notification-as-read",inboxNotificationId:s.id,readAt:a});t[Oe].httpClient.markRoomInboxNotificationAsRead({roomId:e,inboxNotificationId:s.id}).then(()=>{r.markInboxNotificationRead(s.id,a,i)},u=>{o(i,{type:"MARK_INBOX_NOTIFICATION_AS_READ_ERROR",roomId:e,inboxNotificationId:s.id},u)})},[t,e])}function Yy(e){const t=Be();return f.useCallback(n=>{const r=new Date,{store:o,onMutationFailure:s}=vt(t),a=o.optimisticUpdates.add({type:"mark-thread-as-resolved",threadId:n,updatedAt:r});t[Oe].httpClient.markThreadAsResolved({roomId:e,threadId:n}).then(()=>{o.patchThread(n,a,{resolved:!0},r)},i=>s(a,{type:"MARK_THREAD_AS_RESOLVED_ERROR",roomId:e,threadId:n},i))},[t,e])}function Xy(e){const t=Be();return f.useCallback(n=>{const r=new Date,{store:o,onMutationFailure:s}=vt(t),a=o.optimisticUpdates.add({type:"mark-thread-as-unresolved",threadId:n,updatedAt:r});t[Oe].httpClient.markThreadAsUnresolved({roomId:e,threadId:n}).then(()=>{o.patchThread(n,a,{resolved:!1},r)},i=>s(a,{type:"MARK_THREAD_AS_UNRESOLVED_ERROR",roomId:e,threadId:n},i))},[t,e])}function Zy(e){const t=Be(),{store:n}=vt(t),r=n.outputs.threadifications,o=f.useCallback(s=>{const a=s.sortedNotifications.find(u=>u.kind==="thread"&&u.threadId===e),i=s.threadsDB.get(e);return a===void 0||i===void 0?{status:"not-subscribed"}:{status:"subscribed",unreadSince:a.readAt}},[e]);return Jn(r,o,Bt)}function Jy(e){return e===void 0||e?.isLoading?e??{isLoading:!0}:e.error?e:(e.data,{isLoading:!1,url:e.data})}function Vs(e,t){const r=Be()[Oe].httpClient.getOrCreateAttachmentUrlsStore(t),o=f.useCallback(()=>r.getItemState(e),[r,e]);return f.useEffect(()=>{r.enqueue(e)},[r,e]),Ws(r.subscribe,o,o,Jy,Bt)}var Qy=new Set;function eE(e){const t=Be(),n=vt(t).store;return Jn(n.permissionHints.signal,r=>r.get(e)??Qy)}var gP=Uy,Mh=wu,CP=Vy,bP=zy;du(T0,R0,I0);var Vt=typeof window<"u"?f.useLayoutEffect:f.useEffect,gl=500;function tE(e,t){const[n,r]=f.useState(),o=f.useRef(),s=Au(),a=Wy();return f.useEffect(()=>{if(t===void 0||!s)return;const i={text:t,roomId:e},u=zn(i);let c,l=!1;const d=async()=>{try{o.current=performance.now();const m=await s(i);l||(r(m),a.set(u,m))}catch(m){console.error(m?.message)}};return a.has(u)?r(a.get(u)):!o.current||Math.abs(performance.now()-o.current)>gl?d():c=window.setTimeout(()=>{d()},gl),()=>{l=!0,window.clearTimeout(c)}},[t,e,s,a]),n}function nE(){const t=Be()[Oe].createSyncSource,[n,r]=f.useState();return f.useEffect(()=>{const o=t();return r(o),()=>o.destroy()},[t]),n}function ve(e,t,{checkForDefaultPrevented:n=!0}={}){return function(o){if(e?.(o),n===!1||!o.defaultPrevented)return t?.(o)}}function kt(e){const t=f.useRef(e);return f.useEffect(()=>{t.current=e}),f.useMemo(()=>(...n)=>t.current?.(...n),[])}function Oo({prop:e,defaultProp:t,onChange:n=()=>{}}){const[r,o]=rE({defaultProp:t,onChange:n}),s=e!==void 0,a=s?e:r,i=kt(n),u=f.useCallback(c=>{if(s){const d=typeof c=="function"?c(e):c;d!==e&&i(d)}else o(c)},[s,e,o,i]);return[a,u]}function rE({defaultProp:e,onChange:t}){const n=f.useState(e),[r]=n,o=f.useRef(r),s=kt(t);return f.useEffect(()=>{o.current!==r&&(s(r),o.current=r)},[r,o,s]),n}function oE(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function Ks(...e){return t=>e.forEach(n=>oE(n,t))}function Ke(...e){return f.useCallback(Ks(...e),e)}var Ne=f.forwardRef((e,t)=>{const{children:n,...r}=e,o=f.Children.toArray(n),s=o.find(sE);if(s){const a=s.props.children,i=o.map(u=>u===s?f.Children.count(a)>1?f.Children.only(null):f.isValidElement(a)?a.props.children:null:u);return p.jsx(Bi,{...r,ref:t,children:f.isValidElement(a)?f.cloneElement(a,void 0,i):null})}return p.jsx(Bi,{...r,ref:t,children:n})});Ne.displayName="Slot";var Bi=f.forwardRef((e,t)=>{const{children:n,...r}=e;if(f.isValidElement(n)){const o=iE(n);return f.cloneElement(n,{...aE(r,n.props),ref:t?Ks(t,o):o})}return f.Children.count(n)>1?f.Children.only(null):null});Bi.displayName="SlotClone";var xu=({children:e})=>p.jsx(p.Fragment,{children:e});function sE(e){return f.isValidElement(e)&&e.type===xu}function aE(e,t){const n={...t};for(const r in t){const o=e[r],s=t[r];/^on[A-Z]/.test(r)?o&&s?n[r]=(...i)=>{s(...i),o(...i)}:o&&(n[r]=o):r==="style"?n[r]={...o,...s}:r==="className"&&(n[r]=[o,s].filter(Boolean).join(" "))}return{...e,...n}}function iE(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var uE=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],He=uE.reduce((e,t)=>{const n=f.forwardRef((r,o)=>{const{asChild:s,...a}=r,i=s?Ne:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),p.jsx(i,{...a,ref:o})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function _h(e,t){e&&Ls.flushSync(()=>e.dispatchEvent(t))}var cE="Toggle",Lh=f.forwardRef((e,t)=>{const{pressed:n,defaultPressed:r=!1,onPressedChange:o,...s}=e,[a=!1,i]=Oo({prop:n,onChange:o,defaultProp:r});return p.jsx(He.button,{type:"button","aria-pressed":a,"data-state":a?"on":"off","data-disabled":e.disabled?"":void 0,...s,ref:t,onClick:ve(e.onClick,()=>{e.disabled||i(!a)})})});Lh.displayName=cE;var Ou=Lh;function Ae(...e){return e.filter(t=>typeof t=="string"||typeof t=="number").join(" ")}const Cl=20,bl=20;function Ue({children:e,className:t,...n}){return p.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:Cl,height:bl,viewBox:`0 0 ${Cl} ${bl}`,fill:"none",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round",role:"presentation",className:Ae("lb-icon",t),...n,children:e})}function $h(e){return p.jsx(Ue,{...e,children:p.jsx("path",{d:"M16 6L8 14L4 10"})})}function Su(e){return p.jsxs(Ue,{...e,children:[p.jsx("path",{d:"M15 5L5 15"}),p.jsx("path",{d:"M5 5L15 15"})]})}function Uh(e){return p.jsx(Ue,{...e,children:p.jsx("path",{d:"M4.5 6.5h11M14 6.5V14a1.5 1.5 0 0 1-1.5 1.5h-5A1.5 1.5 0 0 1 6 14V6.5M7.5 6.5V5a1 1 0 0 1 1-1h3a1 1 0 0 1 1 1v1.5"})})}function lE(e){return p.jsx(Ue,{...e,children:p.jsx("path",{d:"m11.784 5.797-6.13 6.138a4 4 0 0 0-1.03 1.775L4 16l2.285-.624a4 4 0 0 0 1.776-1.032l6.145-6.152m-2.422-2.395 1.244-1.246c.608-.608 1.826-.81 2.53-.104.7.7.499 1.893-.122 2.515l-1.23 1.23m-2.422-2.395 2.422 2.395"})})}function Hh(e){return p.jsxs(Ue,{fill:"currentColor",...e,children:[p.jsx("circle",{cx:5,cy:10,r:.75}),p.jsx("circle",{cx:10,cy:10,r:.75}),p.jsx("circle",{cx:15,cy:10,r:.75})]})}function yl(e){return p.jsxs(Ue,{...e,children:[p.jsx("path",{d:"M11 3.07A7 7 0 1 0 16.93 9"}),p.jsx("path",{d:"M7.5 11.5S8.25 13 10 13s2.5-1.5 2.5-1.5M8 8h0"}),p.jsx("path",{d:"M12 8h0"}),p.jsx("path",{d:"M13 5h4m-2-2v4"}),p.jsx("circle",{cx:"8",cy:"8",r:".25"}),p.jsx("circle",{cx:"12",cy:"8",r:".25"})]})}const So=6,qs=10,fE="'Apple Color Emoji', 'Noto Color Emoji', 'Twemoji Mozilla', 'Android Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', EmojiSymbols, sans-serif",dE=f.forwardRef(({emoji:e,style:t,asChild:n,...r},o)=>{const s=n?Ne:"span";return p.jsx(s,{role:"img","aria-label":e,"data-emoji":e,style:{...t,fontFamily:fE,display:"inline-flex",alignItems:"center",justifyContent:"center",width:"1em",whiteSpace:"nowrap"},...r,ref:o,children:e})}),Tu=f.forwardRef(({className:e,...t},n)=>p.jsx(dE,{className:Ae("lb-emoji",e),...t,ref:n}));function za(e,t,n){return e===1?t:n??`${t}s`}const hE={locale:"en",dir:"ltr",USER_SELF:"you",USER_UNKNOWN:"Anonymous",LIST_REMAINING:e=>`${e} more`,LIST_REMAINING_USERS:e=>`${e} ${za(e,"other")}`,LIST_REMAINING_COMMENTS:e=>`${e} more ${za(e,"comment")}`,EMOJI_PICKER_SEARCH_PLACEHOLDER:"Search…",EMOJI_PICKER_EMPTY:"No emoji found.",EMOJI_PICKER_ERROR:()=>"There was an error while getting the list of emoji.",EMOJI_PICKER_CHANGE_SKIN_TONE:"Change skin tone",ATTACHMENT_TOO_LARGE:e=>e?`The file is larger than ${e}`:"The file is too large",ATTACHMENT_ERROR:()=>"The file couldn’t be uploaded.",COMPOSER_INSERT_MENTION:"Mention someone",COMPOSER_INSERT_EMOJI:"Add emoji",COMPOSER_ATTACH_FILES:"Attach files",COMPOSER_REMOVE_ATTACHMENT:"Remove attachment",COMPOSER_PLACEHOLDER:"Write a comment…",COMPOSER_SEND:"Send",COMPOSER_TOGGLE_MARK:e=>{switch(e){case"bold":return"Bold";case"italic":return"Italic";case"strikethrough":return"Strikethrough";case"code":return"Inline code";default:return lt(e,"Unexpected mark")}},COMMENT_EDITED:"(edited)",COMMENT_DELETED:"This comment has been deleted.",COMMENT_MORE:"More",COMMENT_EDIT:"Edit comment",COMMENT_EDIT_COMPOSER_PLACEHOLDER:"Edit comment…",COMMENT_EDIT_COMPOSER_CANCEL:"Cancel",COMMENT_EDIT_COMPOSER_SAVE:"Save",COMMENT_DELETE:"Delete comment",COMMENT_DELETE_ATTACHMENT:"Delete attachment",COMMENT_ADD_REACTION:"Add reaction",COMMENT_REACTION_LIST:(e,t)=>p.jsxs(p.Fragment,{children:[e," reacted with ",p.jsx(Tu,{emoji:t})]}),COMMENT_REACTION_DESCRIPTION:(e,t)=>`${t} ${za(t,"reaction")}, react with ${e}`,THREAD_RESOLVE:"Resolve thread",THREAD_UNRESOLVE:"Re-open thread",THREAD_NEW_INDICATOR:"New",THREAD_NEW_INDICATOR_DESCRIPTION:"New comments",THREAD_COMPOSER_PLACEHOLDER:"Reply to thread…",THREAD_COMPOSER_SEND:"Reply",INBOX_NOTIFICATION_MORE:"More",INBOX_NOTIFICATION_MARK_AS_READ:"Mark as read",INBOX_NOTIFICATION_DELETE:"Delete notification",INBOX_NOTIFICATION_THREAD_COMMENTS_LIST:(e,t)=>p.jsxs(p.Fragment,{children:[e," commented",t?p.jsxs(p.Fragment,{children:[" in ",t]}):p.jsx(p.Fragment,{children:" in a thread"})]}),INBOX_NOTIFICATION_THREAD_MENTION:(e,t)=>p.jsxs(p.Fragment,{children:[e," mentioned you",t?p.jsxs(p.Fragment,{children:[" in ",t]}):null]}),INBOX_NOTIFICATION_TEXT_MENTION:(e,t)=>p.jsxs(p.Fragment,{children:[e," mentioned you",t?p.jsxs(p.Fragment,{children:[" in ",t]}):null]}),HISTORY_VERSION_PREVIEW_AUTHORS_LIST:e=>p.jsxs(p.Fragment,{children:["Edits from ",e]}),HISTORY_VERSION_PREVIEW_RESTORE:"Restore",HISTORY_VERSION_PREVIEW_EMPTY:"No content.",HISTORY_VERSION_PREVIEW_ERROR:()=>"There was an error while getting this version."},pE=f.createContext(void 0);function Ze(e){const t=f.useContext(pE);return f.useMemo(()=>({...hE,...t,...e}),[t,e])}/*!
|
|
4
4
|
* is-plain-object <https://github.com/jonschlinkert/is-plain-object>
|
|
@@ -56,4 +56,4 @@ import{j as p,r as Ls,R as qd}from"./mui-Bi8r7UDG.js";import{c as Lo,b as f,d as
|
|
|
56
56
|
`)},Dd=function(){var e=parseInt(document.body.getAttribute(wr)||"0",10);return isFinite(e)?e:0},LR=function(){f.useEffect(function(){return document.body.setAttribute(wr,(Dd()+1).toString()),function(){var e=Dd()-1;e<=0?document.body.removeAttribute(wr):document.body.setAttribute(wr,e.toString())}},[])},$R=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,o=r===void 0?"margin":r;LR();var s=f.useMemo(function(){return jR(o)},[o]);return f.createElement(MR,{styles:_R(s,!t,o,n?"":"!important")})},ru=!1;if(typeof window<"u")try{var rs=Object.defineProperty({},"passive",{get:function(){return ru=!0,!0}});window.addEventListener("test",rs,rs),window.removeEventListener("test",rs,rs)}catch{ru=!1}var ir=ru?{passive:!1}:!1,UR=function(e){return e.tagName==="TEXTAREA"},Dv=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!UR(e)&&n[t]==="visible")},HR=function(e){return Dv(e,"overflowY")},WR=function(e){return Dv(e,"overflowX")},wd=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var o=wv(e,r);if(o){var s=Av(e,r),a=s[1],i=s[2];if(a>i)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},zR=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},VR=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},wv=function(e,t){return e==="v"?HR(t):WR(t)},Av=function(e,t){return e==="v"?zR(t):VR(t)},KR=function(e,t){return e==="h"&&t==="rtl"?-1:1},qR=function(e,t,n,r,o){var s=KR(e,window.getComputedStyle(t).direction),a=s*r,i=n.target,u=t.contains(i),c=!1,l=a>0,d=0,m=0;do{var g=Av(e,i),C=g[0],v=g[1],h=g[2],E=v-h-s*C;(C||E)&&wv(e,i)&&(d+=E,m+=C),i instanceof ShadowRoot?i=i.host:i=i.parentNode}while(!u&&i!==document.body||u&&(t.contains(i)||t===i));return(l&&Math.abs(d)<1||!l&&Math.abs(m)<1)&&(c=!0),c},os=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Ad=function(e){return[e.deltaX,e.deltaY]},xd=function(e){return e&&"current"in e?e.current:e},GR=function(e,t){return e[0]===t[0]&&e[1]===t[1]},YR=function(e){return`
|
|
57
57
|
.block-interactivity-`.concat(e,` {pointer-events: none;}
|
|
58
58
|
.allow-interactivity-`).concat(e,` {pointer-events: all;}
|
|
59
|
-
`)},XR=0,ur=[];function ZR(e){var t=f.useRef([]),n=f.useRef([0,0]),r=f.useRef(),o=f.useState(XR++)[0],s=f.useState(Ev)[0],a=f.useRef(e);f.useEffect(function(){a.current=e},[e]),f.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var v=CR([e.lockRef.current],(e.shards||[]).map(xd),!0).filter(Boolean);return v.forEach(function(h){return h.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),v.forEach(function(h){return h.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var i=f.useCallback(function(v,h){if("touches"in v&&v.touches.length===2||v.type==="wheel"&&v.ctrlKey)return!a.current.allowPinchZoom;var E=os(v),y=n.current,w="deltaX"in v?v.deltaX:y[0]-E[0],D="deltaY"in v?v.deltaY:y[1]-E[1],x,I=v.target,S=Math.abs(w)>Math.abs(D)?"h":"v";if("touches"in v&&S==="h"&&I.type==="range")return!1;var k=wd(S,I);if(!k)return!0;if(k?x=S:(x=S==="v"?"h":"v",k=wd(S,I)),!k)return!1;if(!r.current&&"changedTouches"in v&&(w||D)&&(r.current=x),!x)return!0;var W=r.current||x;return qR(W,h,v,W==="h"?w:D)},[]),u=f.useCallback(function(v){var h=v;if(!(!ur.length||ur[ur.length-1]!==s)){var E="deltaY"in h?Ad(h):os(h),y=t.current.filter(function(x){return x.name===h.type&&(x.target===h.target||h.target===x.shadowParent)&&GR(x.delta,E)})[0];if(y&&y.should){h.cancelable&&h.preventDefault();return}if(!y){var w=(a.current.shards||[]).map(xd).filter(Boolean).filter(function(x){return x.contains(h.target)}),D=w.length>0?i(h,w[0]):!a.current.noIsolation;D&&h.cancelable&&h.preventDefault()}}},[]),c=f.useCallback(function(v,h,E,y){var w={name:v,delta:h,target:E,should:y,shadowParent:JR(E)};t.current.push(w),setTimeout(function(){t.current=t.current.filter(function(D){return D!==w})},1)},[]),l=f.useCallback(function(v){n.current=os(v),r.current=void 0},[]),d=f.useCallback(function(v){c(v.type,Ad(v),v.target,i(v,e.lockRef.current))},[]),m=f.useCallback(function(v){c(v.type,os(v),v.target,i(v,e.lockRef.current))},[]);f.useEffect(function(){return ur.push(s),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:m}),document.addEventListener("wheel",u,ir),document.addEventListener("touchmove",u,ir),document.addEventListener("touchstart",l,ir),function(){ur=ur.filter(function(v){return v!==s}),document.removeEventListener("wheel",u,ir),document.removeEventListener("touchmove",u,ir),document.removeEventListener("touchstart",l,ir)}},[]);var g=e.removeScrollBar,C=e.inert;return f.createElement(f.Fragment,null,C?f.createElement(s,{styles:YR(o)}):null,g?f.createElement($R,{gapMode:e.gapMode}):null)}function JR(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const QR=SR(yv,ZR);var mc=f.forwardRef(function(e,t){return f.createElement(ha,Ht({},e,{ref:t,sideCar:QR}))});mc.classNames=ha.classNames;var vc="Popover",[xv]=aa(vc,[$r]),Po=$r(),[eI,Tn]=xv(vc),Ov=e=>{const{__scopePopover:t,children:n,open:r,defaultOpen:o,onOpenChange:s,modal:a=!1}=e,i=Po(t),u=f.useRef(null),[c,l]=f.useState(!1),[d=!1,m]=Oo({prop:r,defaultProp:o,onChange:s});return p.jsx(sc,{...i,children:p.jsx(eI,{scope:t,contentId:yo(),triggerRef:u,open:d,onOpenChange:m,onOpenToggle:f.useCallback(()=>m(g=>!g),[m]),hasCustomAnchor:c,onCustomAnchorAdd:f.useCallback(()=>l(!0),[]),onCustomAnchorRemove:f.useCallback(()=>l(!1),[]),modal:a,children:n})})};Ov.displayName=vc;var Sv="PopoverAnchor",tI=f.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=Tn(Sv,n),s=Po(n),{onCustomAnchorAdd:a,onCustomAnchorRemove:i}=o;return f.useEffect(()=>(a(),()=>i()),[a,i]),p.jsx(ua,{...s,...r,ref:t})});tI.displayName=Sv;var Tv="PopoverTrigger",Ns=f.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=Tn(Tv,n),s=Po(n),a=Ke(t,o.triggerRef),i=p.jsx(He.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":Pv(o.open),...r,ref:a,onClick:ve(e.onClick,o.onOpenToggle)});return o.hasCustomAnchor?i:p.jsx(ua,{asChild:!0,...s,children:i})});Ns.displayName=Tv;var gc="PopoverPortal",[nI,rI]=xv(gc,{forceMount:void 0}),Rv=e=>{const{__scopePopover:t,forceMount:n,children:r,container:o}=e,s=Tn(gc,t);return p.jsx(nI,{scope:t,forceMount:n,children:p.jsx(un,{present:n||s.open,children:p.jsx(ca,{asChild:!0,container:o,children:r})})})};Rv.displayName=gc;var Fr="PopoverContent",Iv=f.forwardRef((e,t)=>{const n=rI(Fr,e.__scopePopover),{forceMount:r=n.forceMount,...o}=e,s=Tn(Fr,e.__scopePopover);return p.jsx(un,{present:r||s.open,children:s.modal?p.jsx(oI,{...o,ref:t}):p.jsx(sI,{...o,ref:t})})});Iv.displayName=Fr;var oI=f.forwardRef((e,t)=>{const n=Tn(Fr,e.__scopePopover),r=f.useRef(null),o=Ke(t,r),s=f.useRef(!1);return f.useEffect(()=>{const a=r.current;if(a)return gv(a)},[]),p.jsx(mc,{as:Ne,allowPinchZoom:!0,children:p.jsx(Bv,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:ve(e.onCloseAutoFocus,a=>{a.preventDefault(),s.current||n.triggerRef.current?.focus()}),onPointerDownOutside:ve(e.onPointerDownOutside,a=>{const i=a.detail.originalEvent,u=i.button===0&&i.ctrlKey===!0,c=i.button===2||u;s.current=c},{checkForDefaultPrevented:!1}),onFocusOutside:ve(e.onFocusOutside,a=>a.preventDefault(),{checkForDefaultPrevented:!1})})})}),sI=f.forwardRef((e,t)=>{const n=Tn(Fr,e.__scopePopover),r=f.useRef(!1),o=f.useRef(!1);return p.jsx(Bv,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:s=>{e.onCloseAutoFocus?.(s),s.defaultPrevented||(r.current||n.triggerRef.current?.focus(),s.preventDefault()),r.current=!1,o.current=!1},onInteractOutside:s=>{e.onInteractOutside?.(s),s.defaultPrevented||(r.current=!0,s.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const a=s.target;n.triggerRef.current?.contains(a)&&s.preventDefault(),s.detail.originalEvent.type==="focusin"&&o.current&&s.preventDefault()}})}),Bv=f.forwardRef((e,t)=>{const{__scopePopover:n,trapFocus:r,onOpenAutoFocus:o,onCloseAutoFocus:s,disableOutsidePointerEvents:a,onEscapeKeyDown:i,onPointerDownOutside:u,onFocusOutside:c,onInteractOutside:l,...d}=e,m=Tn(Fr,n),g=Po(n);return pv(),p.jsx(pc,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:o,onUnmountAutoFocus:s,children:p.jsx(ia,{asChild:!0,disableOutsidePointerEvents:a,onInteractOutside:l,onEscapeKeyDown:i,onPointerDownOutside:u,onFocusOutside:c,onDismiss:()=>m.onOpenChange(!1),children:p.jsx(ac,{"data-state":Pv(m.open),role:"dialog",id:m.contentId,...g,...d,ref:t,style:{...d.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),Fv="PopoverClose",aI=f.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=Tn(Fv,n);return p.jsx(He.button,{type:"button",...r,ref:t,onClick:ve(e.onClick,()=>o.onOpenChange(!1))})});aI.displayName=Fv;var iI="PopoverArrow",uI=f.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=Po(n);return p.jsx(ic,{...o,...r,ref:t})});uI.displayName=iI;function Pv(e){return e?"open":"closed"}var cI=Ov,lI=Rv,fI=Iv,dI=Object.defineProperty,hI=(e,t)=>{for(var n in t)dI(e,n,{get:t[n],enumerable:!0})},Jt={};hI(Jt,{ActiveEmoji:()=>tg,Empty:()=>eg,List:()=>Zv,Loading:()=>Qv,Root:()=>zv,Search:()=>Vv,SkinTone:()=>ng,SkinToneSelector:()=>Jv,Viewport:()=>Kv});var Nv="'Apple Color Emoji', 'Noto Color Emoji', 'Twemoji Mozilla', 'Android Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', EmojiSymbols, sans-serif",Cc=["none","light","medium-light","medium","medium-dark","dark"];function gi(e){return e.charAt(0).toUpperCase()+e.slice(1)}var Tt=2,Ye=null;function Od(e){try{Ye??=document.createElement("canvas").getContext("2d",{willReadFrequently:!0})}catch{}if(!Ye||(queueMicrotask(()=>{Ye&&(Ye=null)}),Ye.canvas.width=Tt,Ye.canvas.height=Tt,Ye.font=`2px ${Nv}`,Ye.textBaseline="middle",Ye.measureText(e).width>=Tt*2))return!1;Ye.fillStyle="#00f",Ye.fillText(e,0,0);let t=Ye.getImageData(0,0,Tt,Tt).data;Ye.clearRect(0,0,Tt,Tt),Ye.fillStyle="#f00",Ye.fillText(e,0,0);let n=Ye.getImageData(0,0,Tt,Tt).data;for(let r=0;r<Tt*Tt*4;r+=4)if(t[r]!==n[r]||t[r+1]!==n[r+1]||t[r+2]!==n[r+2])return!1;return!0}function Sd(e,t,n){try{let r=e.getItem(t);if(!r)throw new Error(`No value found for "${t}".`);let o=JSON.parse(r);return n(o)}catch{return null}}function kv(e,t,n){e.setItem(t,JSON.stringify(n))}function Td(e){return t=>t===void 0?void 0:e(t)}function Rd(e){return t=>t===null?null:e(t)}function Ge(e){if(typeof e!="string")throw new Error;return e}function vs(e){if(typeof e!="number")throw new Error;return e}function jv(e){if(typeof e!="boolean")throw new Error;return e}function pn(e){return t=>{if(typeof t!="object"||t===null)throw new Error;let n={};for(let r in e){let o=t[r];o===void 0&&e[r](void 0),n[r]=e[r](o)}return n}}function Ci(e){return t=>{if(!Array.isArray(t))throw new Error;return t.length>0&&e(t[0]),t}}var Mv=(e,t)=>`${e}/${t}/data.json`,_v=(e,t)=>`${e}/${t}/messages.json`,pI=["bn","da","de","en-gb","en","es-mx","es","et","fi","fr","hi","hu","it","ja","ko","lt","ms","nb","nl","pl","pt","ru","sv","th","uk","vi","zh-hant","zh"],Id="en",Lv=e=>`frimousse/data/${e}`,Bd="frimousse/metadata";async function Fd(e,t){try{return(await fetch(e,{method:"HEAD",signal:t})).headers.get("etag")}catch{return null}}async function mI(e,t,n){let[{emojis:r,emojisEtag:o},{messages:s,messagesEtag:a}]=await Promise.all([fetch(Mv(e,t),{signal:n}).then(async i=>({emojis:await i.json(),emojisEtag:i.headers.get("etag")})),fetch(_v(e,t),{signal:n}).then(async i=>({messages:await i.json(),messagesEtag:i.headers.get("etag")}))]);return{emojis:r,messages:s,emojisEtag:o,messagesEtag:a}}async function vI(e,t,n){let[r,o]=await Promise.all([Fd(Mv(e,t),n),Fd(_v(e,t),n)]);return{emojisEtag:r,messagesEtag:o}}function gI(e){return e.skins?e.skins.filter(t=>typeof t.tone=="number").reduce((t,n)=>{let r=Cc[n.tone];return t[r]=n.emoji,t},{}):void 0}async function Pd(e,t,n){let{emojis:r,emojisEtag:o,messages:s,messagesEtag:a}=await mI(e,t,n),i=s.subgroups.find(C=>C.key==="country-flag"||C.key==="subdivision-flag"),u=s.groups.filter(C=>C.key!=="component"),c=r.filter(C=>"group"in C),l=u.map(C=>({index:C.order,label:gi(C.message)})),d=s.skinTones.reduce((C,v)=>(C[v.key]=gi(v.message),C),{}),m=c.map(C=>({emoji:C.emoji,category:C.group,version:C.version,label:gi(C.label),tags:C.tags??[],countryFlag:i&&C.subgroup===i.order||void 0,skins:gI(C)})),g={locale:t,emojis:m,categories:l,skinTones:d};return kv(localStorage,Lv(t),{data:g,metadata:{emojisEtag:o,messagesEtag:a}}),g}function CI(e,t){let n=new Map;for(let a of e)n.has(a.version)||n.set(a.version,a.emoji);let r=[...n.keys()].sort((a,i)=>i-a),o=r[0]??0,s=Od("🇪🇺");if(typeof t=="number")return{emojiVersion:t,countryFlags:s};for(let a of r){let i=n.get(a);if(Od(i))return{emojiVersion:a,countryFlags:s}}return{emojiVersion:o,countryFlags:s}}var bI=pn({emojiVersion:vs,countryFlags:jv}),yI=pn({data:pn({locale:Ge,emojis:Ci(pn({emoji:Ge,category:vs,label:Ge,version:vs,tags:Ci(Ge),countryFlag:Td(jv),skins:Td(pn({light:Ge,"medium-light":Ge,medium:Ge,"medium-dark":Ge,dark:Ge}))})),categories:Ci(pn({index:vs,label:Ge})),skinTones:pn({light:Ge,"medium-light":Ge,medium:Ge,"medium-dark":Ge,dark:Ge})}),metadata:pn({emojisEtag:Rd(Ge),messagesEtag:Rd(Ge)})});async function EI({locale:e,emojiVersion:t,emojibaseUrl:n,signal:r}){let o=typeof n=="string"?n:`https://cdn.jsdelivr.net/npm/emojibase-data@${typeof t=="number"?Math.floor(t):"latest"}`,s=Sd(sessionStorage,Bd,bI),a=Sd(localStorage,Lv(e),yI),i;if(!a)i=await Pd(o,e,r);else if(s)i=a.data;else try{let{emojisEtag:c,messagesEtag:l}=await vI(o,e,r);i=!c||!l||c!==a.metadata.emojisEtag||l!==a.metadata.messagesEtag?await Pd(o,e,r):a.data}catch{i=a.data}s??=CI(i.emojis,t),kv(sessionStorage,Bd,s);let u=i.emojis.filter(c=>{let l=c.version<=s.emojiVersion;return c.countryFlag?l&&s.countryFlags:l});return{locale:e,emojis:u,categories:i.categories,skinTones:i.skinTones}}function Nd(e){return pI.includes(e)?e:(console.warn(`Locale "${e}" is not supported, using "${Id}" instead.`),Id)}function kd(e){return Cc.includes(e)?e:(console.warn(`Skin tone "${e}" is not valid, using "none" instead.`),"none")}function DI(e,t){let n=[];if(t<=0)return n;for(let r=0,o=e.length;r<o;r+=t)n.push(e.slice(r,r+t));return n}function wI(e,t){if(!t)return e;let n=t.toLowerCase().trim(),r=new WeakMap;return e.filter(o=>{let s=0;o.label.toLowerCase().includes(n)&&(s+=10);for(let a of o.tags)a.toLowerCase().includes(n)&&(s+=1);return s>0?(r.set(o,s),!0):!1}).sort((o,s)=>(r.get(s)??0)-(r.get(o)??0))}function AI(e,t,n,r){let o=wI(e.emojis,r),s=[],a=[],i=[],u={},c=0,l=0;for(let d of o)u[d.category]||(u[d.category]=[]),u[d.category].push({emoji:n&&n!=="none"&&d.skins?d.skins[n]:d.emoji,label:d.label});for(let d of e.categories){let m=u[d.index];if(!m||m.length===0)continue;let g=DI(Array.from(m),t).map(C=>({categoryIndex:c,emojis:C}));s.push(...g),a.push({label:d.label,rowsCount:g.length,startRowIndex:l}),i.push(l),c++,l+=g.length}return{count:o.length,categories:a,categoriesStartRowIndices:i,rows:s,skinTones:e.skinTones}}function xI(e){let t={},n=null,r=null,o=new Set,s=()=>{if(n){t=n,n=null;for(let c of o)c(t)}r=null},a=()=>n??t,i=c=>{n??=t,Object.assign(n,typeof c=="function"?c(a()):c),r||(r=requestAnimationFrame(s))},u=c=>(o.add(c),()=>o.delete(c));return t=e(i,a),{get:a,set:i,subscribe:u}}function OI(e){let[t]=f.useState(e);return t}function SI(e){let t=f.createContext(null);return{useStore:()=>{let n=f.useContext(t);if(!n)throw new Error(e);return n},Provider:({store:n,children:r})=>p.jsx(t.Provider,{value:n,children:r})}}function mt(e,t,n=Object.is){let[r,o]=f.useState(()=>t(e.get()));return f.useEffect(()=>e.subscribe(()=>{let s=t(e.get());o(a=>n(a,s)?a:s)}),[e,t,n]),f.useDebugValue(r),r}function en(e,t,n){let r=f.useCallback(o=>o[t],[t]);return mt(e,r,n)}var jd=2;function TI(e,t,n,r){let o=0;return xI((s,a)=>({locale:t,columns:n,skinTone:r,onEmojiSelect:e,data:null,search:"",interaction:"none",activeColumnIndex:0,activeRowIndex:0,rowHeight:null,categoryHeaderHeight:null,viewportWidth:null,viewportHeight:null,viewportCurrentCategoryIndex:null,viewportStartCategoryIndex:0,viewportStartRowIndex:0,viewportEndRowIndex:0,rootRef:null,searchRef:null,viewportRef:null,listRef:null,updateViewportState:i=>{let u=a(),c=i?.data??u.data,l=i?.categoryHeaderHeight??u.categoryHeaderHeight,d=i?.rowHeight??u.rowHeight,m=i?.viewportHeight??u.viewportHeight;if(!c||c.rows.length===0||!l||!d||!m)return s({...i,viewportStartCategoryIndex:0,viewportStartRowIndex:0,viewportEndRowIndex:0});let g=0,C=0;for(let S of c.categories)if(C++*l+S.startRowIndex*d<o)g+=l;else break;let v=c.categories.length*l+c.rows.length*d,h=Math.floor(jd*d/2),E=Math.ceil(jd*d/2),y=Math.min(o-g-h,v-m),w=y+m+E,D=Math.max(0,Math.floor(y/d)),x=Math.min(c.rows.length-1,Math.ceil(w/d)),I=c.rows[D]?.categoryIndex;return s(I===void 0&&i?i:{...i,viewportStartCategoryIndex:I,viewportStartRowIndex:D,viewportEndRowIndex:x})},onDataChange:i=>{a().updateViewportState({data:i,activeColumnIndex:0,activeRowIndex:0})},onSearchChange:i=>{s({search:i,interaction:i?"keyboard":"none"})},onActiveEmojiChange:(i,u,c)=>{if(s({interaction:i,activeColumnIndex:u,activeRowIndex:c}),i!=="keyboard")return;let{listRef:l,viewportRef:d,rowHeight:m,viewportHeight:g,categoryHeaderHeight:C}=a(),v=l?.current,h=d?.current;if(!v||!h||!m||!C||!g)return;let E=c;E===0&&h.scrollTo({top:0,behavior:"instant"});let y=v.querySelector(`[aria-rowindex="${E}"]`);if(!(y instanceof HTMLElement))return;let w=y.offsetTop,D=getComputedStyle(y),x=Number.parseFloat(D.scrollMarginTop),I=Number.parseFloat(D.scrollMarginBottom),S=o+x;w<o+g/2&&(S+=C);let k=S+g-I;(w<S||w+m>k)&&h.scrollTo({top:Math.max(w<S+C?w-Math.max(C,x):w-g+m+I,0),behavior:"instant"})},onActiveEmojiReset:()=>{s({interaction:"none",activeColumnIndex:0,activeRowIndex:0})},onRowHeightChange:i=>{a().updateViewportState({rowHeight:i})},onCategoryHeaderHeightChange:i=>{a().updateViewportState({categoryHeaderHeight:i})},onViewportSizeChange:(i,u)=>{a().updateViewportState({viewportWidth:i,viewportHeight:u})},onViewportScroll:i=>{o=i,a().updateViewportState()}}))}var{useStore:it,Provider:RI}=SI("EmojiPicker.Root is missing.");function II(e){return e.search}function bc(e){return e.interaction==="none"?void 0:e.data?.rows[e.activeRowIndex]?.emojis[e.activeColumnIndex]}function BI(e){return e.data===void 0||typeof e.data?.count=="number"&&e.data.count===0}function FI(e){return e.data===null||e.viewportHeight===null||e.rowHeight===null||e.categoryHeaderHeight===null}function $v(e){return e.data?.rows.length}function PI(e){return e.data?.categories.length}function NI(e){return e.data?.categoriesStartRowIndices}function kI(e){return e.data?.skinTones}function Uv(e,t){return e?.emoji===t?.emoji}function jI(e,t){return e?.categoryIndex!==t?.categoryIndex||e?.emojis.length!==t?.emojis.length?!1:!!e?.emojis.every((n,r)=>Uv(n,t?.emojis[r]))}var Hr="",Md=new RegExp("\\p{Emoji_Modifier_Base}","u"),MI=/\uFE0F$/,_I=/\u{1F3FB}|\u{1F3FC}|\u{1F3FD}|\u{1F3FE}|\u{1F3FF}/gu,LI={light:"🏻","medium-light":"🏼",medium:"🏽","medium-dark":"🏾",dark:"🏿"};function $I(e,t){if(!e.split(Hr).some(r=>Md.test(r)))return e;let n=e.split(Hr).map(r=>r.replace(_I,"")).join(Hr);return t==="none"?n:n.split(Hr).map((r,o,s)=>{let a=s.length>1;return!Md.test(r)||a&&r==="🤝"?r:r.replace(MI,"")+LI[t]}).join(Hr)}function UI(e){return Cc.map(t=>({skinTone:t,emoji:$I(e,t)}))}function Hv(){let e=it(),t=mt(e,bc,Uv);return f.useDeferredValue(t)}function Wv(e="✋"){let t=it(),n=en(t,"skinTone"),r=f.useMemo(()=>UI(e),[e]),o=f.useCallback(s=>{t.set({skinTone:s})},[]);return[n,o,r]}function yc(e,t){if(Object.is(e,t))return!0;if(typeof e!="object"||typeof t!="object"||e===null||t===null||Array.isArray(e)!==Array.isArray(t))return!1;let n=Object.keys(e),r=Object.keys(t);return n.length!==r.length?!1:n.every(o=>o in t&&e[o]===t[o])}function HI(...e){}function WI(e,t){let n=null;if(typeof window.requestIdleCallback=="function")n=window.requestIdleCallback(e,t);else{let r=Date.now();n=window.setTimeout(()=>{e({didTimeout:!1,timeRemaining:()=>Math.max(0,t?.timeout-(Date.now()-r))})},10)}return()=>{typeof window.cancelIdleCallback=="function"?window.cancelIdleCallback(n):window.clearTimeout(n)}}var Wt=typeof window<"u"?f.useLayoutEffect:f.useEffect;function zI(e){let t=f.useRef(e);return Wt(()=>{t.current=e}),f.useCallback((...n)=>t.current(...n),[])}function VI({emojiVersion:e,emojibaseUrl:t}){let[n,r]=f.useState(void 0),o=it(),s=en(o,"locale"),a=en(o,"columns"),i=en(o,"skinTone"),u=en(o,"search");return f.useEffect(()=>{let c=new AbortController,l=c.signal;return EI({locale:s,emojiVersion:e,emojibaseUrl:t,signal:l}).then(d=>{r(d)}).catch(d=>{l.aborted||console.error(d)}),()=>{c.abort()}},[e,t,s]),f.useEffect(()=>{if(n)return WI(()=>{o.get().onDataChange(AI(n,a,i,u))},{timeout:100})},[n,a,i,u]),null}var zv=f.forwardRef(({locale:e="en",columns:t=9,skinTone:n="none",onEmojiSelect:r=HI,emojiVersion:o,emojibaseUrl:s,onFocusCapture:a,onBlurCapture:i,children:u,style:c,...l},d)=>{let m=zI(r),g=OI(()=>TI(m,Nd(e),t,kd(n))),[C,v]=f.useState(!1),h=f.useRef(null),E=f.useCallback(D=>{D&&(h.current=D,g.set({rootRef:h}))},[]);Wt(()=>{g.set({locale:Nd(e)})},[e]),Wt(()=>{g.set({columns:t})},[t]),Wt(()=>{g.set({skinTone:kd(n)})},[n]);let y=f.useCallback(D=>{a?.(D);let{searchRef:x,viewportRef:I}=g.get(),S=D.target===x?.current||D.target.hasAttribute("frimousse-search"),k=D.target===I?.current||D.target.hasAttribute("frimousse-viewport");D.isDefaultPrevented()||(v(S||k),D.isDefaultPrevented()||(v(S||k),k?g.get().onActiveEmojiChange("keyboard",0,0):S&&g.get().search===""&&g.set({interaction:"none"})))},[a]),w=f.useCallback(D=>{i?.(D),!D.isDefaultPrevented()&&!D.currentTarget.contains(D.relatedTarget)&&v(!1)},[i]);return Wt(()=>{C||g.get().onActiveEmojiReset()},[C]),f.useImperativeHandle(d,()=>h.current),f.useEffect(()=>{if(!C)return;function D(x){if(x.defaultPrevented||!x.key.startsWith("Arrow")&&x.key!=="Enter")return;let{data:I,onEmojiSelect:S,onActiveEmojiChange:k,interaction:W,activeColumnIndex:P,activeRowIndex:M}=g.get();if(x.key==="Enter"){let F=bc(g.get());F&&(x.preventDefault(),S(F))}if(x.key.startsWith("Arrow")){let F=P,B=M;if(x.preventDefault(),W!=="none"){if(I?.rows&&I.rows.length>0)switch(x.key){case"ArrowLeft":{if(F===0){let j=B-1,$=I.rows[j];$&&(B=j,F=$.emojis.length-1)}else F-=1;break}case"ArrowRight":{if(F===I.rows[B].emojis.length-1){let j=B+1;I.rows[j]&&(B=j,F=0)}else F+=1;break}case"ArrowUp":{let j=I.rows[B-1];j&&(B-=1,j.emojis[F]||(F=j.emojis.length-1));break}case"ArrowDown":{let j=I.rows[B+1];j&&(B+=1,j.emojis[F]||(F=j.emojis.length-1));break}}k("keyboard",F,B)}else k("keyboard",0,0)}}return document.addEventListener("keydown",D),()=>{document.removeEventListener("keydown",D)}},[C]),Wt(()=>{let D=null,x=null,I=null,S=null,k=g.subscribe(B=>{h.current&&(D!==B.viewportWidth&&(D=B.viewportWidth,h.current.style.setProperty("--frimousse-viewport-width",`${B.viewportWidth}px`)),x!==B.viewportHeight&&(x=B.viewportHeight,h.current.style.setProperty("--frimousse-viewport-height",`${B.viewportHeight}px`)),I!==B.rowHeight&&(I=B.rowHeight,h.current.style.setProperty("--frimousse-row-height",`${B.rowHeight}px`)),S!==B.categoryHeaderHeight&&(S=B.categoryHeaderHeight,h.current.style.setProperty("--frimousse-category-header-height",`${B.categoryHeaderHeight}px`)))}),{viewportWidth:W,viewportHeight:P,rowHeight:M,categoryHeaderHeight:F}=g.get();return W&&h.current.style.setProperty("--frimousse-viewport-width",`${W}px`),P&&h.current.style.setProperty("--frimousse-viewport-height",`${P}px`),M&&h.current.style.setProperty("--frimousse-row-height",`${M}px`),F&&h.current.style.setProperty("--frimousse-category-header-height",`${F}px`),k},[]),p.jsx("div",{"data-focused":C?"":void 0,"frimousse-root":"",onBlurCapture:w,onFocusCapture:y,...l,ref:E,style:{"--frimousse-emoji-font":Nv,...c},children:p.jsxs(RI,{store:g,children:[p.jsx(VI,{emojiVersion:o,emojibaseUrl:s}),u]})})}),Vv=f.forwardRef(({value:e,defaultValue:t,onChange:n,...r},o)=>{let s=it(),a=f.useRef(null),i=f.useCallback(d=>{d&&(a.current=d,s.set({searchRef:a}))},[]),u=typeof e=="string",c=f.useRef(u);f.useEffect(()=>{c.current=u},[u]),Wt(()=>{s.set({search:typeof e=="string"?e:typeof t=="string"?t:""})},[]),Wt(()=>{typeof e=="string"&&s.get().onSearchChange(e)},[e]);let l=f.useCallback(d=>{n?.(d),d.isDefaultPrevented()||s.get().onSearchChange(d.target.value)},[n]);return f.useImperativeHandle(o,()=>a.current),p.jsx("input",{autoCapitalize:"off",autoComplete:"off",autoCorrect:"off",enterKeyHint:"done","frimousse-search":"",placeholder:"Search…",spellCheck:!1,type:"search",...r,defaultValue:t,onChange:l,ref:i,value:e})}),KI=f.memo(()=>{let e=Hv();return e?p.jsx("div",{"aria-live":"polite",style:{border:0,clip:"rect(0, 0, 0, 0)",height:1,margin:-1,overflow:"hidden",padding:0,position:"absolute",whiteSpace:"nowrap",width:1,wordWrap:"normal"},children:e.label}):null}),Kv=f.forwardRef(({children:e,onScroll:t,onKeyDown:n,style:r,...o},s)=>{let a=it(),i=f.useRef(null),u=f.useCallback(m=>{m&&(i.current=m,a.set({viewportRef:i}))},[]),c=mt(a,$v),l=mt(a,PI),d=f.useCallback(m=>{t?.(m),a.get().onViewportScroll(m.currentTarget.scrollTop)},[t]);return Wt(()=>{if(!i.current)return;let m=new ResizeObserver(([g])=>{let C=g?.borderBoxSize[0]?.inlineSize??0,v=g?.borderBoxSize[0]?.blockSize??0,{onViewportSizeChange:h,viewportHeight:E,viewportWidth:y}=a.get();(E!==v||y!==C)&&h(C,v)});return m.observe(i.current),a.get().onViewportSizeChange(i.current.offsetWidth,i.current.clientHeight),()=>{m.disconnect()}},[]),f.useImperativeHandle(s,()=>i.current),p.jsxs("div",{"frimousse-viewport":"",...o,onScroll:d,ref:u,style:{position:"relative",boxSizing:"border-box",contain:"layout paint",containIntrinsicSize:typeof c=="number"&&typeof l=="number"?`var(--frimousse-viewport-width, auto) calc(${c} * var(--frimousse-row-height) + ${l} * var(--frimousse-category-header-height))`:void 0,overflowY:"auto",overscrollBehavior:"contain",scrollbarGutter:"stable",willChange:"scroll-position",...r},children:[p.jsx(KI,{}),e]})});function qv(e,t,n){return{emoji:{...e,isActive:n},role:"gridcell","aria-colindex":t,"aria-selected":n||void 0,"aria-label":e.label,"data-active":n?"":void 0,"frimousse-emoji":"",style:{fontFamily:"var(--frimousse-emoji-font)"},tabIndex:-1}}function Gv(e,t=!1){return{role:t?void 0:"row","aria-rowindex":t?void 0:e,"frimousse-row":"",style:{contain:t?void 0:"content",height:t?void 0:"var(--frimousse-row-height)",display:"flex"}}}function Yv(e,t){return{"frimousse-category":"",style:{contain:"content",top:t?`calc(${e} * var(--frimousse-category-header-height) + ${t.startRowIndex} * var(--frimousse-row-height))`:void 0,height:t?`calc(var(--frimousse-category-header-height) + ${t.rowsCount} * var(--frimousse-row-height))`:void 0,width:"100%",pointerEvents:"none",position:"absolute"}}}function Xv(e,t=!1){return{category:e,"frimousse-category-header":"",style:{contain:t?void 0:"layout paint",height:t?void 0:"var(--frimousse-category-header-height)",pointerEvents:"auto",position:"sticky",top:0}}}function _d(e,t,n,r){return{"frimousse-list-sizer":"",style:{position:"relative",boxSizing:"border-box",height:`calc(${e} * var(--frimousse-row-height) + ${t} * var(--frimousse-category-header-height))`,paddingTop:`calc(${n} * var(--frimousse-row-height) + ${r} * var(--frimousse-category-header-height))`}}}function Ld(e,t,n){return{"aria-colcount":e,"aria-rowcount":t,"frimousse-list":"",style:{"--frimousse-list-columns":e,...n},role:"grid"}}function qI(e){e.preventDefault()}var GI=f.memo(({Emoji:e,emoji:t,columnIndex:n,rowIndex:r})=>{let o=it(),s=mt(o,c=>bc(c)?.emoji===t.emoji),a=f.useCallback(()=>{o.get().onEmojiSelect(t)},[t]),i=f.useCallback(()=>{o.get().onActiveEmojiChange("pointer",n,r)},[n,r]),u=f.useCallback(()=>{o.get().onActiveEmojiReset()},[]);return p.jsx(e,{...qv(t,n,s),onClick:a,onPointerDown:qI,onPointerEnter:i,onPointerLeave:u})}),YI=f.memo(({Row:e,Emoji:t,rowIndex:n})=>{let r=it(),o=mt(r,s=>s.data?.rows[n],jI);return o?p.jsx(e,{...Gv(n),children:o.emojis.map((s,a)=>p.jsx(GI,{Emoji:t,columnIndex:a,emoji:s,rowIndex:n},s.label))}):null}),XI=f.memo(({CategoryHeader:e,categoryIndex:t})=>{let n=it(),r=mt(n,o=>o.data?.categories[t],yc);return r?p.jsx("div",{...Yv(t,r),children:p.jsx(e,{...Xv({label:r.label})})}):null}),$d=f.memo(({CategoryHeader:e,Row:t,Emoji:n})=>{let r=f.useRef(null),o=it(),s=en(o,"columns"),a=f.useMemo(()=>Array(s).fill({emoji:"🙂",label:""}),[s]),i=f.useMemo(()=>({label:"Category"}),[]),u=f.useRef(null),c=f.useRef(null);return Wt(()=>{let l=r.current?.parentElement?.parentElement;if(!l||!u.current||!c.current)return;let d=new ResizeObserver(C=>{for(let v of C){let h=v.contentRect.height,{onRowHeightChange:E,onCategoryHeaderHeightChange:y,rowHeight:w,categoryHeaderHeight:D}=o.get();v.target===u.current&&w!==h&&E(h),v.target===c.current&&D!==h&&y(h)}});d.observe(l),d.observe(u.current),d.observe(c.current);let{onRowHeightChange:m,onCategoryHeaderHeightChange:g}=o.get();return m(u.current.clientHeight),g(c.current.clientHeight),()=>{d.disconnect()}},[]),p.jsxs("div",{"aria-hidden":!0,ref:r,style:{height:0,visibility:"hidden"},children:[p.jsx("div",{"frimousse-row-sizer":"",ref:u,children:p.jsx(t,{...Gv(-1,!0),children:a.map((l,d)=>p.jsx(n,{...qv(l,d,!1)},d))})}),p.jsx("div",{...Yv(-1),children:p.jsx("div",{"frimousse-category-header-sizer":"",ref:c,children:p.jsx(e,{...Xv(i,!0)})})})]})});function ZI({category:e,...t}){return p.jsx("div",{...t,children:e.label})}function JI({emoji:e,...t}){return p.jsx("button",{type:"button",...t,children:e.emoji})}function QI({...e}){return p.jsx("div",{...e})}var Zv=f.forwardRef(({style:e,components:t,...n},r)=>{let o=it(),s=f.useRef(null),a=f.useCallback(E=>{E&&(s.current=E,o.set({listRef:s}))},[]),i=t?.CategoryHeader??ZI,u=t?.Emoji??JI,c=t?.Row??QI,l=en(o,"columns"),d=en(o,"viewportStartRowIndex"),m=en(o,"viewportEndRowIndex"),g=mt(o,$v),C=mt(o,NI,yc),v=f.useMemo(()=>C?.filter(E=>E<d).length??0,[C,d]),h=C?.length??0;return f.useImperativeHandle(r,()=>s.current),!g||!C||h===0?p.jsx("div",{...Ld(l,0,e),...n,children:p.jsx("div",{..._d(0,0,0,0),children:p.jsx($d,{CategoryHeader:i,Emoji:u,Row:c})})}):p.jsx("div",{...Ld(l,g,e),...n,ref:a,children:p.jsxs("div",{..._d(g,h,d,v),children:[p.jsx($d,{CategoryHeader:i,Emoji:u,Row:c}),Array.from({length:m-d+1},(E,y)=>{let w=d+y,D=C.indexOf(w);return p.jsxs(f.Fragment,{children:[D>=0&&p.jsx("div",{style:{height:"var(--frimousse-category-header-height)"}}),p.jsx(YI,{Emoji:u,Row:c,rowIndex:w})]},w)}),Array.from({length:h},(E,y)=>p.jsx(XI,{CategoryHeader:i,categoryIndex:y},y))]})})}),Jv=f.forwardRef(({emoji:e,onClick:t,"aria-label":n="Change skin tone",...r},o)=>{let s=it(),a=mt(s,kI,yc),[i,u,c]=Wv(e),l=f.useMemo(()=>Math.max(0,c.findIndex(h=>h.skinTone===i)),[i,c]),d=c[l],m=c[(l+1)%c.length].skinTone,g=i==="none"?void 0:a?.[i],C=m==="none"?void 0:a?.[m],v=f.useCallback(h=>{t?.(h),h.isDefaultPrevented()||u(m)},[t,u,m]);return p.jsx("button",{type:"button",...r,"aria-label":n+(C?` (${C})`:""),"aria-live":"polite","aria-valuetext":g,"frimousse-skin-tone-selector":"",onClick:v,ref:o,children:d.emoji})});function Qv({children:e,...t}){let n=it();return mt(n,FI)?p.jsx("span",{"frimousse-loading":"",...t,children:e}):null}function eB({children:e}){let t=it(),n=mt(t,II);return e({search:n})}function eg({children:e,...t}){let n=it();return mt(n,BI)?p.jsx("span",{"frimousse-empty":"",...t,children:typeof e=="function"?p.jsx(eB,{children:e}):e}):null}function tg({children:e}){let t=Hv();return e({emoji:t})}function ng({children:e,emoji:t}){let[n,r,o]=Wv(t);return e({skinTone:n,setSkinTone:r,skinToneVariations:o})}zv.displayName="EmojiPicker.Root";Vv.displayName="EmojiPicker.Search";Kv.displayName="EmojiPicker.Viewport";Zv.displayName="EmojiPicker.List";Qv.displayName="EmojiPicker.Loading";eg.displayName="EmojiPicker.Empty";Jv.displayName="EmojiPicker.SkinToneSelector";tg.displayName="EmojiPicker.ActiveEmoji";ng.displayName="EmojiPicker.SkinTone";function tB(e){return p.jsx(Ue,{...e,children:p.jsx("path",{d:"M9 15A6 6 0 1 0 9 3a6 6 0 0 0 0 12Zm7.5 1.5-3.25-3.25"})})}function nB({emoji:e,className:t,...n}){return p.jsx("button",{className:Ae("lb-emoji-picker-emoji",t),...n,children:p.jsx(Tu,{emoji:e.emoji})})}function rB({children:e,className:t,...n}){return p.jsx("div",{className:Ae("lb-emoji-picker-row",t),...n,children:e})}function oB({category:e,className:t,...n}){return p.jsx("div",{className:Ae("lb-emoji-picker-category-header",t),...n,children:p.jsx("span",{className:"lb-emoji-picker-category-header-title",children:e.label})})}const ou=f.forwardRef(({onEmojiSelect:e,onOpenChange:t,children:n,className:r,...o},s)=>{const[a,i]=f.useState(!1),{portalContainer:u,emojibaseUrl:c}=Mr(),l=Ze(),d=f.useCallback(C=>{i(C),t?.(C)},[t]),m=f.useCallback(({emoji:C})=>{i(!1),e?.(C)},[e]),g=f.useCallback(C=>{C.stopPropagation()},[]);return p.jsxs(cI,{open:a,onOpenChange:d,children:[n,p.jsx(lI,{container:u,children:p.jsx(fI,{side:"top",align:"center",sideOffset:So,collisionPadding:qs,className:Ae("lb-root lb-portal lb-elevation lb-emoji-picker",r),...o,ref:s,asChild:!0,children:p.jsxs(Jt.Root,{onEmojiSelect:m,locale:l.locale,columns:10,emojiVersion:15.1,emojibaseUrl:c,onClick:g,children:[p.jsx("div",{className:"lb-emoji-picker-header",children:p.jsxs("div",{className:"lb-emoji-picker-search-container",children:[p.jsx(Jt.Search,{className:"lb-emoji-picker-search",placeholder:l.EMOJI_PICKER_SEARCH_PLACEHOLDER,autoFocus:!0}),p.jsx(tB,{})]})}),p.jsxs(Jt.Viewport,{className:"lb-emoji-picker-content",children:[p.jsx(Jt.Loading,{className:"lb-loading lb-emoji-picker-loading",children:p.jsx(Io,{})}),p.jsx(Jt.Empty,{className:"lb-empty lb-emoji-picker-empty",children:l.EMOJI_PICKER_EMPTY}),p.jsx(Jt.List,{className:"lb-emoji-picker-list",components:{CategoryHeader:oB,Row:rB,Emoji:nB}})]}),p.jsxs("div",{className:"lb-emoji-picker-footer",children:[p.jsx(Jt.ActiveEmoji,{children:({emoji:C})=>C?p.jsxs(p.Fragment,{children:[p.jsx("div",{className:"lb-emoji-picker-active-emoji",children:C.emoji}),p.jsx("span",{className:"lb-emoji-picker-active-emoji-label",children:C.label})]}):p.jsx("span",{className:"lb-emoji-picker-active-emoji-label lb-emoji-picker-active-emoji-label-placeholder",children:"Select an emoji…"})}),p.jsx(at,{content:l.EMOJI_PICKER_CHANGE_SKIN_TONE,children:p.jsx(Jt.SkinToneSelector,{className:"lb-button lb-emoji-picker-skin-tone-selector"})})]})]})})})]})});function sn({userId:e,replaceSelf:t,className:n,...r}){const o=Lr(),{user:s,isLoading:a}=Fh(e),i=Ze(),u=f.useMemo(()=>t&&o===e?i.USER_SELF:s?.name??i.USER_UNKNOWN,[t,o,e,i.USER_SELF,i.USER_UNKNOWN,s?.name]);return p.jsx("span",{className:Ae("lb-name lb-user",n),"data-loading":a?"":void 0,...r,children:a?null:u})}function sB({label:e,tooltipLabel:t,className:n,onClick:r,...o}){const{createMention:s}=gt(),a=f.useCallback(u=>{u.preventDefault()},[]),i=f.useCallback(u=>{r?.(u),u.isDefaultPrevented()||(u.stopPropagation(),s())},[s,r]);return p.jsx(at,{content:t??e,children:p.jsx(Dt,{className:Ae("lb-composer-editor-action",n),onPointerDown:a,onClick:i,"aria-label":e,icon:p.jsx(ZS,{}),...o})})}function aB({label:e,tooltipLabel:t,onPickerOpenChange:n,className:r,...o}){const{insertText:s}=gt(),a=f.useCallback(u=>{u.preventDefault()},[]),i=f.useCallback(u=>{u.stopPropagation()},[]);return p.jsx(ou,{onEmojiSelect:s,onOpenChange:n,children:p.jsx(at,{content:t??e,children:p.jsx(Ns,{asChild:!0,children:p.jsx(Dt,{className:Ae("lb-composer-editor-action",r),onPointerDown:a,onClick:i,"aria-label":e,icon:p.jsx(YS,{}),...o})})})})}function iB({label:e,tooltipLabel:t,className:n,...r}){const o=f.useCallback(a=>{a.preventDefault()},[]),s=f.useCallback(a=>{a.stopPropagation()},[]);return p.jsx(at,{content:t??e,children:p.jsx(SS,{asChild:!0,children:p.jsx(Dt,{className:Ae("lb-composer-editor-action",n),onPointerDown:o,onClick:s,"aria-label":e,icon:p.jsx(Um,{}),...r})})})}function uB({userId:e}){return p.jsxs(Pm,{className:"lb-composer-mention",children:[wn,p.jsx(sn,{userId:e})]})}function cB({userIds:e}){return e.length>0?p.jsx(km,{className:"lb-root lb-portal lb-elevation lb-composer-suggestions lb-composer-mention-suggestions",children:p.jsx(jm,{className:"lb-composer-suggestions-list lb-composer-mention-suggestions-list",children:e.map(t=>p.jsxs(Mm,{className:"lb-composer-suggestions-list-item lb-composer-mention-suggestion",value:t,children:[p.jsx(dc,{userId:t,className:"lb-composer-mention-suggestion-avatar"}),p.jsx(sn,{userId:t,className:"lb-composer-mention-suggestion-user"})]},t))})}):null}function ss({mark:e,icon:t,shortcut:n,children:r,...o}){const s=Ze(),a=f.useMemo(()=>s.COMPOSER_TOGGLE_MARK(e),[s,e]);return p.jsx(lc,{content:a,shortcut:n,sideOffset:So+2,children:p.jsx(TS,{mark:e,asChild:!0,...o,children:p.jsx(Dt,{"aria-label":a,variant:"toolbar",icon:t,children:r})})})}const lB={bold:()=>p.jsx(ss,{mark:"bold",shortcut:"Mod-B",icon:p.jsx(qS,{})}),italic:()=>p.jsx(ss,{mark:"italic",shortcut:"Mod-I",icon:p.jsx(XS,{})}),strikethrough:()=>p.jsx(ss,{mark:"strikethrough",shortcut:"Mod-Shift-S",icon:p.jsx(QS,{})}),code:()=>p.jsx(ss,{mark:"code",shortcut:"Mod-E",icon:p.jsx(GS,{})})},fB=Object.entries(lB).map(([e,t])=>p.jsx(t,{},e));function dB(){return p.jsx(gS,{className:"lb-root lb-portal lb-elevation lb-composer-floating-toolbar",children:fB})}function hB({href:e,children:t}){return p.jsx(Nm,{href:e,className:"lb-composer-link",children:t})}function pB({attachment:e,className:t,overrides:n,...r}){const{removeAttachment:o}=gt(),{roomId:s}=na(),a=f.useCallback(()=>{o(e.id)},[e.id,o]);return p.jsx(fc,{className:Ae("lb-composer-attachment",t),...r,attachment:e,onDeleteClick:a,preventFocusOnDelete:!0,overrides:n,roomId:s})}function mB({overrides:e,className:t,...n}){const{attachments:r}=gt();return r.length===0?null:p.jsx("div",{className:Ae("lb-composer-attachments",t),...n,children:p.jsx("div",{className:"lb-attachments",children:r.map(o=>p.jsx(pB,{attachment:o,overrides:e},o.id))})})}const vB={Mention:uB,MentionSuggestions:cB,Link:hB};function gB({showAttachments:e=!0,showFormattingControls:t=!0,showAttribution:n,defaultValue:r,isCollapsed:o,overrides:s,actions:a,autoFocus:i,disabled:u,hasResolveMentionSuggestions:c,onEmojiPickerOpenChange:l,onEmptyChange:d,onEditorClick:m}){const{isEmpty:g}=gt(),{hasMaxAttachments:C}=qu(),v=Ze(s),h=f.useMemo(()=>({...vB,FloatingToolbar:t?dB:void 0}),[t]),[E,y]=Fm({disabled:u||C});Vt(()=>{d(g)},[g,d]);const w=f.useCallback(x=>{x.preventDefault()},[]),D=f.useCallback(x=>{x.stopPropagation()},[]);return p.jsxs("div",{className:"lb-composer-editor-container",...y,children:[p.jsx(DS,{className:"lb-composer-editor",onClick:m,placeholder:v.COMPOSER_PLACEHOLDER,defaultValue:r,autoFocus:i,components:h,disabled:u,dir:v.dir}),e&&p.jsx(mB,{overrides:s}),(!o||E)&&p.jsxs("div",{className:"lb-composer-footer",children:[p.jsxs("div",{className:"lb-composer-editor-actions",children:[c&&p.jsx(sB,{label:v.COMPOSER_INSERT_MENTION,disabled:u}),p.jsx(aB,{label:v.COMPOSER_INSERT_EMOJI,onPickerOpenChange:l,disabled:u}),e&&p.jsx(iB,{label:v.COMPOSER_ATTACH_FILES,disabled:u})]}),n&&p.jsx(aR,{}),p.jsx("div",{className:"lb-composer-actions",children:a??p.jsx(p.Fragment,{children:p.jsx(lc,{content:v.COMPOSER_SEND,shortcut:"Enter",children:p.jsx(_m,{asChild:!0,children:p.jsx(Dt,{onPointerDown:w,onClick:D,className:"lb-composer-action",variant:"primary","aria-label":v.COMPOSER_SEND,icon:p.jsx(JS,{})})})})})})]}),e&&E&&p.jsx("div",{className:"lb-composer-attachments-drop-area",children:p.jsxs("div",{className:"lb-composer-attachments-drop-area-label",children:[p.jsx(Um,{}),v.COMPOSER_ATTACH_FILES]})})]})}f.createContext(null);const rg=f.forwardRef(({threadId:e,commentId:t,metadata:n,defaultValue:r,defaultAttachments:o,onComposerSubmit:s,collapsed:a,defaultCollapsed:i,onCollapsedChange:u,overrides:c,actions:l,onBlur:d,className:m,onFocus:g,autoFocus:C,disabled:v,showAttachments:h=!0,showFormattingControls:E=!0,showAttribution:y,roomId:w,...D},x)=>{const I=Mh({allowOutsideRoom:!0}),S=w!==void 0?w:I?.id;if(S===void 0)throw new Error("Composer must be a descendant of RoomProvider component");const k=Ph(S),W=Ky(S),P=Nh(S),{preventUnsavedComposerChanges:M}=Mr(),F=Au()!==void 0,B=f.useRef(!0),j=f.useRef(!1),$=Ze(c),[re,Y]=eT(a===void 0&&i===void 0?!1:a,u,i),ee=f.useSyncExternalStore(f.useCallback(_=>I===null?()=>{}:I.events.self.subscribeOnce(_),[I]),f.useCallback(()=>I?.getSelf()?.canComment??!0,[I]),f.useCallback(()=>!0,[])),L=eE(S),Q=L.size>0?L.has(Oi.CommentsWrite)||L.has(Oi.Write):ee,V=f.useCallback(_=>{B.current=_},[]),te=f.useCallback(_=>{j.current=_},[]),se=f.useCallback(_=>{g?.(_),!_.isDefaultPrevented()&&B.current&&Q&&Y?.(!1)},[Y,g,Q]),de=f.useCallback(_=>{if(d?.(_),_.isDefaultPrevented())return;!_.currentTarget.contains(_.relatedTarget??document.activeElement)&&B.current&&!j.current&&Y?.(!0)},[d,Y]),G=f.useCallback(_=>{_.stopPropagation(),B.current&&Q&&Y?.(!1)},[Y,Q]),R=f.useCallback((_,H)=>{s?.(_,H),!H.isDefaultPrevented()&&(H.stopPropagation(),t&&e?P({commentId:t,threadId:e,body:_.body,attachments:_.attachments}):e?W({threadId:e,body:_.body,attachments:_.attachments}):k({body:_.body,metadata:n??{},attachments:_.attachments}))},[t,W,k,P,n,s,e]);return p.jsx(Bo,{children:p.jsx(OS,{onComposerSubmit:R,className:Ae("lb-root lb-composer lb-composer-form",m),dir:$.dir,...D,ref:x,"data-collapsed":re?"":void 0,onFocus:se,onBlur:de,disabled:v||!Q,defaultAttachments:o,pasteFilesAsAttachments:h,preventUnsavedChanges:M,roomId:S,children:p.jsx(gB,{defaultValue:r,actions:l,overrides:c,isCollapsed:re,showAttachments:h,showAttribution:y,showFormattingControls:E,hasResolveMentionSuggestions:F,onEmptyChange:V,onEmojiPickerOpenChange:te,onEditorClick:G,autoFocus:C,disabled:v})})})});function og(e){const t=e+"CollectionProvider",[n,r]=nc(t),[o,s]=n(t,{collectionRef:{current:null},itemMap:new Map}),a=g=>{const{scope:C,children:v}=g,h=me.useRef(null),E=me.useRef(new Map).current;return p.jsx(o,{scope:C,itemMap:E,collectionRef:h,children:v})};a.displayName=t;const i=e+"CollectionSlot",u=me.forwardRef((g,C)=>{const{scope:v,children:h}=g,E=s(i,v),y=Ke(C,E.collectionRef);return p.jsx(Ne,{ref:y,children:h})});u.displayName=i;const c=e+"CollectionItemSlot",l="data-radix-collection-item",d=me.forwardRef((g,C)=>{const{scope:v,children:h,...E}=g,y=me.useRef(null),w=Ke(C,y),D=s(c,v);return me.useEffect(()=>(D.itemMap.set(y,{ref:y,...E}),()=>void D.itemMap.delete(y))),p.jsx(Ne,{[l]:"",ref:w,children:h})});d.displayName=c;function m(g){const C=s(e+"CollectionConsumer",g);return me.useCallback(()=>{const h=C.collectionRef.current;if(!h)return[];const E=Array.from(h.querySelectorAll(`[${l}]`));return Array.from(C.itemMap.values()).sort((D,x)=>E.indexOf(D.ref.current)-E.indexOf(x.ref.current))},[C.collectionRef,C.itemMap])}return[{Provider:a,Slot:u,ItemSlot:d},m,r]}var CB=f.createContext(void 0);function sg(e){const t=f.useContext(CB);return e||t||"ltr"}var bi="rovingFocusGroup.onEntryFocus",bB={bubbles:!1,cancelable:!0},pa="RovingFocusGroup",[su,ag,yB]=og(pa),[EB,ig]=nc(pa,[yB]),[DB,wB]=EB(pa),ug=f.forwardRef((e,t)=>p.jsx(su.Provider,{scope:e.__scopeRovingFocusGroup,children:p.jsx(su.Slot,{scope:e.__scopeRovingFocusGroup,children:p.jsx(AB,{...e,ref:t})})}));ug.displayName=pa;var AB=f.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:o=!1,dir:s,currentTabStopId:a,defaultCurrentTabStopId:i,onCurrentTabStopIdChange:u,onEntryFocus:c,preventScrollOnEntryFocus:l=!1,...d}=e,m=f.useRef(null),g=Ke(t,m),C=sg(s),[v=null,h]=Oo({prop:a,defaultProp:i,onChange:u}),[E,y]=f.useState(!1),w=kt(c),D=ag(n),x=f.useRef(!1),[I,S]=f.useState(0);return f.useEffect(()=>{const k=m.current;if(k)return k.addEventListener(bi,w),()=>k.removeEventListener(bi,w)},[w]),p.jsx(DB,{scope:n,orientation:r,dir:C,loop:o,currentTabStopId:v,onItemFocus:f.useCallback(k=>h(k),[h]),onItemShiftTab:f.useCallback(()=>y(!0),[]),onFocusableItemAdd:f.useCallback(()=>S(k=>k+1),[]),onFocusableItemRemove:f.useCallback(()=>S(k=>k-1),[]),children:p.jsx(He.div,{tabIndex:E||I===0?-1:0,"data-orientation":r,...d,ref:g,style:{outline:"none",...e.style},onMouseDown:ve(e.onMouseDown,()=>{x.current=!0}),onFocus:ve(e.onFocus,k=>{const W=!x.current;if(k.target===k.currentTarget&&W&&!E){const P=new CustomEvent(bi,bB);if(k.currentTarget.dispatchEvent(P),!P.defaultPrevented){const M=D().filter(re=>re.focusable),F=M.find(re=>re.active),B=M.find(re=>re.id===v),$=[F,B,...M].filter(Boolean).map(re=>re.ref.current);fg($,l)}}x.current=!1}),onBlur:ve(e.onBlur,()=>y(!1))})})}),cg="RovingFocusGroupItem",lg=f.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:o=!1,tabStopId:s,...a}=e,i=yo(),u=s||i,c=wB(cg,n),l=c.currentTabStopId===u,d=ag(n),{onFocusableItemAdd:m,onFocusableItemRemove:g}=c;return f.useEffect(()=>{if(r)return m(),()=>g()},[r,m,g]),p.jsx(su.ItemSlot,{scope:n,id:u,focusable:r,active:o,children:p.jsx(He.span,{tabIndex:l?0:-1,"data-orientation":c.orientation,...a,ref:t,onMouseDown:ve(e.onMouseDown,C=>{r?c.onItemFocus(u):C.preventDefault()}),onFocus:ve(e.onFocus,()=>c.onItemFocus(u)),onKeyDown:ve(e.onKeyDown,C=>{if(C.key==="Tab"&&C.shiftKey){c.onItemShiftTab();return}if(C.target!==C.currentTarget)return;const v=SB(C,c.orientation,c.dir);if(v!==void 0){if(C.metaKey||C.ctrlKey||C.altKey||C.shiftKey)return;C.preventDefault();let E=d().filter(y=>y.focusable).map(y=>y.ref.current);if(v==="last")E.reverse();else if(v==="prev"||v==="next"){v==="prev"&&E.reverse();const y=E.indexOf(C.currentTarget);E=c.loop?TB(E,y+1):E.slice(y+1)}setTimeout(()=>fg(E))}})})})});lg.displayName=cg;var xB={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function OB(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function SB(e,t,n){const r=OB(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return xB[r]}function fg(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function TB(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var RB=ug,IB=lg,au=["Enter"," "],BB=["ArrowDown","PageUp","Home"],dg=["ArrowUp","PageDown","End"],FB=[...BB,...dg],PB={ltr:[...au,"ArrowRight"],rtl:[...au,"ArrowLeft"]},NB={ltr:["ArrowLeft"],rtl:["ArrowRight"]},No="Menu",[Eo,kB,jB]=og(No),[er,hg]=aa(No,[jB,$r,ig]),ma=$r(),pg=ig(),[MB,tr]=er(No),[_B,ko]=er(No),mg=e=>{const{__scopeMenu:t,open:n=!1,children:r,dir:o,onOpenChange:s,modal:a=!0}=e,i=ma(t),[u,c]=f.useState(null),l=f.useRef(!1),d=kt(s),m=sg(o);return f.useEffect(()=>{const g=()=>{l.current=!0,document.addEventListener("pointerdown",C,{capture:!0,once:!0}),document.addEventListener("pointermove",C,{capture:!0,once:!0})},C=()=>l.current=!1;return document.addEventListener("keydown",g,{capture:!0}),()=>{document.removeEventListener("keydown",g,{capture:!0}),document.removeEventListener("pointerdown",C,{capture:!0}),document.removeEventListener("pointermove",C,{capture:!0})}},[]),p.jsx(sc,{...i,children:p.jsx(MB,{scope:t,open:n,onOpenChange:d,content:u,onContentChange:c,children:p.jsx(_B,{scope:t,onClose:f.useCallback(()=>d(!1),[d]),isUsingKeyboardRef:l,dir:m,modal:a,children:r})})})};mg.displayName=No;var LB="MenuAnchor",Ec=f.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,o=ma(n);return p.jsx(ua,{...o,...r,ref:t})});Ec.displayName=LB;var Dc="MenuPortal",[$B,vg]=er(Dc,{forceMount:void 0}),gg=e=>{const{__scopeMenu:t,forceMount:n,children:r,container:o}=e,s=tr(Dc,t);return p.jsx($B,{scope:t,forceMount:n,children:p.jsx(un,{present:n||s.open,children:p.jsx(ca,{asChild:!0,container:o,children:r})})})};gg.displayName=Dc;var xt="MenuContent",[UB,wc]=er(xt),Cg=f.forwardRef((e,t)=>{const n=vg(xt,e.__scopeMenu),{forceMount:r=n.forceMount,...o}=e,s=tr(xt,e.__scopeMenu),a=ko(xt,e.__scopeMenu);return p.jsx(Eo.Provider,{scope:e.__scopeMenu,children:p.jsx(un,{present:r||s.open,children:p.jsx(Eo.Slot,{scope:e.__scopeMenu,children:a.modal?p.jsx(HB,{...o,ref:t}):p.jsx(WB,{...o,ref:t})})})})}),HB=f.forwardRef((e,t)=>{const n=tr(xt,e.__scopeMenu),r=f.useRef(null),o=Ke(t,r);return f.useEffect(()=>{const s=r.current;if(s)return gv(s)},[]),p.jsx(Ac,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:ve(e.onFocusOutside,s=>s.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),WB=f.forwardRef((e,t)=>{const n=tr(xt,e.__scopeMenu);return p.jsx(Ac,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),Ac=f.forwardRef((e,t)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:o,onOpenAutoFocus:s,onCloseAutoFocus:a,disableOutsidePointerEvents:i,onEntryFocus:u,onEscapeKeyDown:c,onPointerDownOutside:l,onFocusOutside:d,onInteractOutside:m,onDismiss:g,disableOutsideScroll:C,...v}=e,h=tr(xt,n),E=ko(xt,n),y=ma(n),w=pg(n),D=kB(n),[x,I]=f.useState(null),S=f.useRef(null),k=Ke(t,S,h.onContentChange),W=f.useRef(0),P=f.useRef(""),M=f.useRef(0),F=f.useRef(null),B=f.useRef("right"),j=f.useRef(0),$=C?mc:f.Fragment,re=C?{as:Ne,allowPinchZoom:!0}:void 0,Y=L=>{const Q=P.current+L,V=D().filter(_=>!_.disabled),te=document.activeElement,se=V.find(_=>_.ref.current===te)?.textValue,de=V.map(_=>_.textValue),G=tF(de,Q,se),R=V.find(_=>_.textValue===G)?.ref.current;(function _(H){P.current=H,window.clearTimeout(W.current),H!==""&&(W.current=window.setTimeout(()=>_(""),1e3))})(Q),R&&setTimeout(()=>R.focus())};f.useEffect(()=>()=>window.clearTimeout(W.current),[]),pv();const ee=f.useCallback(L=>B.current===F.current?.side&&rF(L,F.current?.area),[]);return p.jsx(UB,{scope:n,searchRef:P,onItemEnter:f.useCallback(L=>{ee(L)&&L.preventDefault()},[ee]),onItemLeave:f.useCallback(L=>{ee(L)||(S.current?.focus(),I(null))},[ee]),onTriggerLeave:f.useCallback(L=>{ee(L)&&L.preventDefault()},[ee]),pointerGraceTimerRef:M,onPointerGraceIntentChange:f.useCallback(L=>{F.current=L},[]),children:p.jsx($,{...re,children:p.jsx(pc,{asChild:!0,trapped:o,onMountAutoFocus:ve(s,L=>{L.preventDefault(),S.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:a,children:p.jsx(ia,{asChild:!0,disableOutsidePointerEvents:i,onEscapeKeyDown:c,onPointerDownOutside:l,onFocusOutside:d,onInteractOutside:m,onDismiss:g,children:p.jsx(RB,{asChild:!0,...w,dir:E.dir,orientation:"vertical",loop:r,currentTabStopId:x,onCurrentTabStopIdChange:I,onEntryFocus:ve(u,L=>{E.isUsingKeyboardRef.current||L.preventDefault()}),preventScrollOnEntryFocus:!0,children:p.jsx(ac,{role:"menu","aria-orientation":"vertical","data-state":Ng(h.open),"data-radix-menu-content":"",dir:E.dir,...y,...v,ref:k,style:{outline:"none",...v.style},onKeyDown:ve(v.onKeyDown,L=>{const V=L.target.closest("[data-radix-menu-content]")===L.currentTarget,te=L.ctrlKey||L.altKey||L.metaKey,se=L.key.length===1;V&&(L.key==="Tab"&&L.preventDefault(),!te&&se&&Y(L.key));const de=S.current;if(L.target!==de||!FB.includes(L.key))return;L.preventDefault();const R=D().filter(_=>!_.disabled).map(_=>_.ref.current);dg.includes(L.key)&&R.reverse(),QB(R)}),onBlur:ve(e.onBlur,L=>{L.currentTarget.contains(L.target)||(window.clearTimeout(W.current),P.current="")}),onPointerMove:ve(e.onPointerMove,Do(L=>{const Q=L.target,V=j.current!==L.clientX;if(L.currentTarget.contains(Q)&&V){const te=L.clientX>j.current?"right":"left";B.current=te,j.current=L.clientX}}))})})})})})})});Cg.displayName=xt;var zB="MenuGroup",xc=f.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return p.jsx(He.div,{role:"group",...r,ref:t})});xc.displayName=zB;var VB="MenuLabel",bg=f.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return p.jsx(He.div,{...r,ref:t})});bg.displayName=VB;var ks="MenuItem",Ud="menu.itemSelect",va=f.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:r,...o}=e,s=f.useRef(null),a=ko(ks,e.__scopeMenu),i=wc(ks,e.__scopeMenu),u=Ke(t,s),c=f.useRef(!1),l=()=>{const d=s.current;if(!n&&d){const m=new CustomEvent(Ud,{bubbles:!0,cancelable:!0});d.addEventListener(Ud,g=>r?.(g),{once:!0}),_h(d,m),m.defaultPrevented?c.current=!1:a.onClose()}};return p.jsx(yg,{...o,ref:u,disabled:n,onClick:ve(e.onClick,l),onPointerDown:d=>{e.onPointerDown?.(d),c.current=!0},onPointerUp:ve(e.onPointerUp,d=>{c.current||d.currentTarget?.click()}),onKeyDown:ve(e.onKeyDown,d=>{const m=i.searchRef.current!=="";n||m&&d.key===" "||au.includes(d.key)&&(d.currentTarget.click(),d.preventDefault())})})});va.displayName=ks;var yg=f.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:r=!1,textValue:o,...s}=e,a=wc(ks,n),i=pg(n),u=f.useRef(null),c=Ke(t,u),[l,d]=f.useState(!1),[m,g]=f.useState("");return f.useEffect(()=>{const C=u.current;C&&g((C.textContent??"").trim())},[s.children]),p.jsx(Eo.ItemSlot,{scope:n,disabled:r,textValue:o??m,children:p.jsx(IB,{asChild:!0,...i,focusable:!r,children:p.jsx(He.div,{role:"menuitem","data-highlighted":l?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...s,ref:c,onPointerMove:ve(e.onPointerMove,Do(C=>{r?a.onItemLeave(C):(a.onItemEnter(C),C.defaultPrevented||C.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:ve(e.onPointerLeave,Do(C=>a.onItemLeave(C))),onFocus:ve(e.onFocus,()=>d(!0)),onBlur:ve(e.onBlur,()=>d(!1))})})})}),KB="MenuCheckboxItem",Eg=f.forwardRef((e,t)=>{const{checked:n=!1,onCheckedChange:r,...o}=e;return p.jsx(Og,{scope:e.__scopeMenu,checked:n,children:p.jsx(va,{role:"menuitemcheckbox","aria-checked":js(n)?"mixed":n,...o,ref:t,"data-state":Sc(n),onSelect:ve(o.onSelect,()=>r?.(js(n)?!0:!n),{checkForDefaultPrevented:!1})})})});Eg.displayName=KB;var Dg="MenuRadioGroup",[qB,GB]=er(Dg,{value:void 0,onValueChange:()=>{}}),wg=f.forwardRef((e,t)=>{const{value:n,onValueChange:r,...o}=e,s=kt(r);return p.jsx(qB,{scope:e.__scopeMenu,value:n,onValueChange:s,children:p.jsx(xc,{...o,ref:t})})});wg.displayName=Dg;var Ag="MenuRadioItem",xg=f.forwardRef((e,t)=>{const{value:n,...r}=e,o=GB(Ag,e.__scopeMenu),s=n===o.value;return p.jsx(Og,{scope:e.__scopeMenu,checked:s,children:p.jsx(va,{role:"menuitemradio","aria-checked":s,...r,ref:t,"data-state":Sc(s),onSelect:ve(r.onSelect,()=>o.onValueChange?.(n),{checkForDefaultPrevented:!1})})})});xg.displayName=Ag;var Oc="MenuItemIndicator",[Og,YB]=er(Oc,{checked:!1}),Sg=f.forwardRef((e,t)=>{const{__scopeMenu:n,forceMount:r,...o}=e,s=YB(Oc,n);return p.jsx(un,{present:r||js(s.checked)||s.checked===!0,children:p.jsx(He.span,{...o,ref:t,"data-state":Sc(s.checked)})})});Sg.displayName=Oc;var XB="MenuSeparator",Tg=f.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return p.jsx(He.div,{role:"separator","aria-orientation":"horizontal",...r,ref:t})});Tg.displayName=XB;var ZB="MenuArrow",Rg=f.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,o=ma(n);return p.jsx(ic,{...o,...r,ref:t})});Rg.displayName=ZB;var JB="MenuSub",[yP,Ig]=er(JB),Gr="MenuSubTrigger",Bg=f.forwardRef((e,t)=>{const n=tr(Gr,e.__scopeMenu),r=ko(Gr,e.__scopeMenu),o=Ig(Gr,e.__scopeMenu),s=wc(Gr,e.__scopeMenu),a=f.useRef(null),{pointerGraceTimerRef:i,onPointerGraceIntentChange:u}=s,c={__scopeMenu:e.__scopeMenu},l=f.useCallback(()=>{a.current&&window.clearTimeout(a.current),a.current=null},[]);return f.useEffect(()=>l,[l]),f.useEffect(()=>{const d=i.current;return()=>{window.clearTimeout(d),u(null)}},[i,u]),p.jsx(Ec,{asChild:!0,...c,children:p.jsx(yg,{id:o.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":o.contentId,"data-state":Ng(n.open),...e,ref:Ks(t,o.onTriggerChange),onClick:d=>{e.onClick?.(d),!(e.disabled||d.defaultPrevented)&&(d.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:ve(e.onPointerMove,Do(d=>{s.onItemEnter(d),!d.defaultPrevented&&!e.disabled&&!n.open&&!a.current&&(s.onPointerGraceIntentChange(null),a.current=window.setTimeout(()=>{n.onOpenChange(!0),l()},100))})),onPointerLeave:ve(e.onPointerLeave,Do(d=>{l();const m=n.content?.getBoundingClientRect();if(m){const g=n.content?.dataset.side,C=g==="right",v=C?-5:5,h=m[C?"left":"right"],E=m[C?"right":"left"];s.onPointerGraceIntentChange({area:[{x:d.clientX+v,y:d.clientY},{x:h,y:m.top},{x:E,y:m.top},{x:E,y:m.bottom},{x:h,y:m.bottom}],side:g}),window.clearTimeout(i.current),i.current=window.setTimeout(()=>s.onPointerGraceIntentChange(null),300)}else{if(s.onTriggerLeave(d),d.defaultPrevented)return;s.onPointerGraceIntentChange(null)}})),onKeyDown:ve(e.onKeyDown,d=>{const m=s.searchRef.current!=="";e.disabled||m&&d.key===" "||PB[r.dir].includes(d.key)&&(n.onOpenChange(!0),n.content?.focus(),d.preventDefault())})})})});Bg.displayName=Gr;var Fg="MenuSubContent",Pg=f.forwardRef((e,t)=>{const n=vg(xt,e.__scopeMenu),{forceMount:r=n.forceMount,...o}=e,s=tr(xt,e.__scopeMenu),a=ko(xt,e.__scopeMenu),i=Ig(Fg,e.__scopeMenu),u=f.useRef(null),c=Ke(t,u);return p.jsx(Eo.Provider,{scope:e.__scopeMenu,children:p.jsx(un,{present:r||s.open,children:p.jsx(Eo.Slot,{scope:e.__scopeMenu,children:p.jsx(Ac,{id:i.contentId,"aria-labelledby":i.triggerId,...o,ref:c,align:"start",side:a.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:l=>{a.isUsingKeyboardRef.current&&u.current?.focus(),l.preventDefault()},onCloseAutoFocus:l=>l.preventDefault(),onFocusOutside:ve(e.onFocusOutside,l=>{l.target!==i.trigger&&s.onOpenChange(!1)}),onEscapeKeyDown:ve(e.onEscapeKeyDown,l=>{a.onClose(),l.preventDefault()}),onKeyDown:ve(e.onKeyDown,l=>{const d=l.currentTarget.contains(l.target),m=NB[a.dir].includes(l.key);d&&m&&(s.onOpenChange(!1),i.trigger?.focus(),l.preventDefault())})})})})})});Pg.displayName=Fg;function Ng(e){return e?"open":"closed"}function js(e){return e==="indeterminate"}function Sc(e){return js(e)?"indeterminate":e?"checked":"unchecked"}function QB(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function eF(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function tF(e,t,n){const o=t.length>1&&Array.from(t).every(c=>c===t[0])?t[0]:t,s=n?e.indexOf(n):-1;let a=eF(e,Math.max(s,0));o.length===1&&(a=a.filter(c=>c!==n));const u=a.find(c=>c.toLowerCase().startsWith(o.toLowerCase()));return u!==n?u:void 0}function nF(e,t){const{x:n,y:r}=e;let o=!1;for(let s=0,a=t.length-1;s<t.length;a=s++){const i=t[s].x,u=t[s].y,c=t[a].x,l=t[a].y;u>r!=l>r&&n<(c-i)*(r-u)/(l-u)+i&&(o=!o)}return o}function rF(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return nF(n,t)}function Do(e){return t=>t.pointerType==="mouse"?e(t):void 0}var oF=mg,sF=Ec,aF=gg,iF=Cg,uF=xc,cF=bg,lF=va,fF=Eg,dF=wg,hF=xg,pF=Sg,mF=Tg,vF=Rg,gF=Bg,CF=Pg,Tc="DropdownMenu",[bF]=aa(Tc,[hg]),ot=hg(),[yF,kg]=bF(Tc),jg=e=>{const{__scopeDropdownMenu:t,children:n,dir:r,open:o,defaultOpen:s,onOpenChange:a,modal:i=!0}=e,u=ot(t),c=f.useRef(null),[l=!1,d]=Oo({prop:o,defaultProp:s,onChange:a});return p.jsx(yF,{scope:t,triggerId:yo(),triggerRef:c,contentId:yo(),open:l,onOpenChange:d,onOpenToggle:f.useCallback(()=>d(m=>!m),[d]),modal:i,children:p.jsx(oF,{...u,open:l,onOpenChange:d,dir:r,modal:i,children:n})})};jg.displayName=Tc;var Mg="DropdownMenuTrigger",Rc=f.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,disabled:r=!1,...o}=e,s=kg(Mg,n),a=ot(n);return p.jsx(sF,{asChild:!0,...a,children:p.jsx(He.button,{type:"button",id:s.triggerId,"aria-haspopup":"menu","aria-expanded":s.open,"aria-controls":s.open?s.contentId:void 0,"data-state":s.open?"open":"closed","data-disabled":r?"":void 0,disabled:r,...o,ref:Ks(t,s.triggerRef),onPointerDown:ve(e.onPointerDown,i=>{!r&&i.button===0&&i.ctrlKey===!1&&(s.onOpenToggle(),s.open||i.preventDefault())}),onKeyDown:ve(e.onKeyDown,i=>{r||(["Enter"," "].includes(i.key)&&s.onOpenToggle(),i.key==="ArrowDown"&&s.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(i.key)&&i.preventDefault())})})})});Rc.displayName=Mg;var EF="DropdownMenuPortal",_g=e=>{const{__scopeDropdownMenu:t,...n}=e,r=ot(t);return p.jsx(aF,{...r,...n})};_g.displayName=EF;var Lg="DropdownMenuContent",$g=f.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=kg(Lg,n),s=ot(n),a=f.useRef(!1);return p.jsx(iF,{id:o.contentId,"aria-labelledby":o.triggerId,...s,...r,ref:t,onCloseAutoFocus:ve(e.onCloseAutoFocus,i=>{a.current||o.triggerRef.current?.focus(),a.current=!1,i.preventDefault()}),onInteractOutside:ve(e.onInteractOutside,i=>{const u=i.detail.originalEvent,c=u.button===0&&u.ctrlKey===!0,l=u.button===2||c;(!o.modal||l)&&(a.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});$g.displayName=Lg;var DF="DropdownMenuGroup",wF=f.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=ot(n);return p.jsx(uF,{...o,...r,ref:t})});wF.displayName=DF;var AF="DropdownMenuLabel",xF=f.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=ot(n);return p.jsx(cF,{...o,...r,ref:t})});xF.displayName=AF;var OF="DropdownMenuItem",Ug=f.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=ot(n);return p.jsx(lF,{...o,...r,ref:t})});Ug.displayName=OF;var SF="DropdownMenuCheckboxItem",TF=f.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=ot(n);return p.jsx(fF,{...o,...r,ref:t})});TF.displayName=SF;var RF="DropdownMenuRadioGroup",IF=f.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=ot(n);return p.jsx(dF,{...o,...r,ref:t})});IF.displayName=RF;var BF="DropdownMenuRadioItem",FF=f.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=ot(n);return p.jsx(hF,{...o,...r,ref:t})});FF.displayName=BF;var PF="DropdownMenuItemIndicator",NF=f.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=ot(n);return p.jsx(pF,{...o,...r,ref:t})});NF.displayName=PF;var kF="DropdownMenuSeparator",jF=f.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=ot(n);return p.jsx(mF,{...o,...r,ref:t})});jF.displayName=kF;var MF="DropdownMenuArrow",_F=f.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=ot(n);return p.jsx(vF,{...o,...r,ref:t})});_F.displayName=MF;var LF="DropdownMenuSubTrigger",$F=f.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=ot(n);return p.jsx(gF,{...o,...r,ref:t})});$F.displayName=LF;var UF="DropdownMenuSubContent",HF=f.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=ot(n);return p.jsx(CF,{...o,...r,ref:t,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});HF.displayName=UF;var WF=jg,zF=_g,VF=$g;function Hg({children:e,content:t,defaultOpen:n,open:r,onOpenChange:o,className:s,...a}){const i=Ze(),{portalContainer:u}=Mr();return p.jsxs(WF,{defaultOpen:n,open:r,onOpenChange:o,dir:i.dir,children:[e,p.jsx(zF,{container:u,children:p.jsx(VF,{className:Ae("lb-root lb-portal lb-elevation lb-dropdown",s),sideOffset:So,collisionPadding:qs,...a,children:t})})]})}const Ms=f.forwardRef(({children:e,className:t,icon:n,...r},o)=>p.jsxs(Ug,{className:Ae("lb-dropdown-item",t),...r,ref:o,children:[n?p.jsx("span",{className:"lb-dropdown-item-icon lb-icon-container",children:n}):null,e?p.jsx("span",{className:"lb-dropdown-item-label",children:e}):null]})),Wg=f.forwardRef(({values:e,formatRemaining:t,truncate:n,locale:r,className:o,asChild:s,...a},i)=>{const u=s?Ne:"span",c=Ze(),l=t??c.LIST_REMAINING,d=f.useMemo(()=>{const m=n&&n<e.length-1?[...e.slice(0,n),l(e.length-n)]:[...e],g=Array(m.length).fill(".");return RS(r).formatToParts(g).map(v=>v.type==="element"?m.shift():v.value)},[l,r,n,e]);return p.jsx(u,{className:Ae("lb-list",o),...a,ref:i,children:d})}),KF=5;function zg({userId:e,className:t,...n}){const r=Lr();return p.jsxs(sp,{className:Ae("lb-comment-mention",t),"data-self":e===r?"":void 0,...n,children:[wn,p.jsx(sn,{userId:e})]})}function qF({href:e,children:t,className:n,...r}){return p.jsx(ap,{className:Ae("lb-comment-link",n),href:e,...r,children:t})}function GF({href:e,children:t,className:n,...r}){return p.jsx("span",{className:Ae("lb-comment-link",n),...r,children:t})}const Vg=f.forwardRef(({reaction:e,overrides:t,className:n,...r},o)=>{const s=Ze(t);return p.jsxs(hc,{className:Ae("lb-comment-reaction",n),variant:"outline","aria-label":s.COMMENT_REACTION_DESCRIPTION(e.emoji,e.users.length),...r,ref:o,children:[p.jsx(Tu,{className:"lb-comment-reaction-emoji",emoji:e.emoji}),p.jsx("span",{className:"lb-comment-reaction-count",children:e.users.length})]})}),YF=f.forwardRef(({comment:e,reaction:t,overrides:n,disabled:r,...o},s)=>{const a=kh(e.roomId),i=jh(e.roomId),u=Lr(),c=f.useMemo(()=>t.users.some(C=>C.id===u),[u,t]),l=Ze(n),d=f.useMemo(()=>p.jsx("span",{children:l.COMMENT_REACTION_LIST(p.jsx(Wg,{values:t.users.map(C=>p.jsx(sn,{userId:C.id,replaceSelf:!0},C.id)),formatRemaining:l.LIST_REMAINING_USERS,truncate:KF,locale:l.locale}),t.emoji,t.users.length)}),[l,t]),m=f.useCallback(C=>{C.stopPropagation()},[]),g=f.useCallback(C=>{C?a({threadId:e.threadId,commentId:e.id,emoji:t.emoji}):i({threadId:e.threadId,commentId:e.id,emoji:t.emoji})},[a,e.threadId,e.id,t.emoji,i]);return p.jsx(at,{content:d,multiline:!0,className:"lb-comment-reaction-tooltip",children:p.jsx(Ou,{asChild:!0,pressed:c,onPressedChange:g,onClick:m,disabled:r,ref:s,children:p.jsx(Vg,{"data-self":c?"":void 0,reaction:t,overrides:n,...o})})})}),XF=f.forwardRef(({reaction:e,overrides:t,...n},r)=>{const o=Lr(),s=f.useMemo(()=>e.users.some(a=>a.id===o),[o,e]);return p.jsx(Vg,{disableable:!1,"data-self":s?"":void 0,reaction:e,overrides:t,...n,ref:r})});function Kg({attachment:e,url:t}){e.mimeType==="application/pdf"||e.mimeType.startsWith("image/")||e.mimeType.startsWith("video/")||e.mimeType.startsWith("audio/")?window.open(t,"_blank"):$S(t,e.name)}function ZF({attachment:e,onAttachmentClick:t,roomId:n,className:r,overrides:o,...s}){const{url:a}=Vs(e.id,n),i=f.useCallback(u=>{if(!a)return;const c={attachment:e,url:a};t?.(c,u),!u.isDefaultPrevented()&&Kg(c)},[e,t,a]);return p.jsx(oR,{className:Ae("lb-comment-attachment",r),...s,attachment:e,overrides:o,onClick:a?i:void 0,roomId:n})}function JF({attachment:e,onAttachmentClick:t,roomId:n,className:r,overrides:o,...s}){const{url:a}=Vs(e.id,n),i=f.useCallback(u=>{if(!a)return;const c={attachment:e,url:a};t?.(c,u),!u.isDefaultPrevented()&&Kg(c)},[e,t,a]);return p.jsx(fc,{className:Ae("lb-comment-attachment",r),...s,attachment:e,overrides:o,onClick:a?i:void 0,roomId:n})}function QF({className:e,...t}){return p.jsx(fc,{className:Ae("lb-comment-attachment",e),allowMediaPreview:!1,...t})}function eP({threadId:e,roomId:t,commentRef:n}){const r=Gy(t),o=KS();return HS(n,()=>{r(e)},{enabled:o}),null}const tP=f.forwardRef(({comment:e,indentContent:t=!0,showDeleted:n,showActions:r="hover",showReactions:o=!0,showAttachments:s=!0,showComposerFormattingControls:a=!0,onAuthorClick:i,onMentionClick:u,onAttachmentClick:c,onCommentEdit:l,onCommentDelete:d,overrides:m,className:g,additionalActions:C,additionalActionsClassName:v,autoMarkReadThreadId:h,...E},y)=>{const w=f.useRef(null),D=To(y,w),x=Lr(),I=qy(e.roomId),S=Nh(e.roomId),k=kh(e.roomId),W=jh(e.roomId),P=Ze(m),[M,F]=f.useState(!1),[B,j]=f.useState(!1),[$,re]=f.useState(!1),[Y,ee]=f.useState(!1),{mediaAttachments:L,fileAttachments:Q}=f.useMemo(()=>sR(e.attachments),[e.attachments]),V=f.useCallback(H=>{H.stopPropagation()},[]),te=f.useCallback(()=>{F(!0)},[]),se=f.useCallback(H=>{H.stopPropagation(),F(!1)},[]),de=f.useCallback(({body:H,attachments:X},fe)=>{l?.(e),!fe.isDefaultPrevented()&&(fe.stopPropagation(),fe.preventDefault(),F(!1),S({commentId:e.id,threadId:e.threadId,body:H,attachments:X}))},[e,S,l]),G=f.useCallback(()=>{d?.(e),I({commentId:e.id,threadId:e.threadId})},[e,I,d]),R=f.useCallback(H=>{i?.(e.userId,H)},[e.userId,i]),_=f.useCallback(H=>{const X=e.reactions.findIndex(fe=>fe.emoji===H);X>=0&&x&&e.reactions[X]?.users.some(fe=>fe.id===x)?W({threadId:e.threadId,commentId:e.id,emoji:H}):k({threadId:e.threadId,commentId:e.id,emoji:H})},[k,e.id,e.reactions,e.threadId,W,x]);return f.useEffect(()=>{if(!(typeof window<"u"))return;window.location.hash.slice(1)===e.id&&j(!0)},[]),!n&&!e.body?null:p.jsxs(Bo,{children:[h&&p.jsx(eP,{commentRef:w,threadId:h,roomId:e.roomId}),p.jsxs("div",{id:e.id,className:Ae("lb-root lb-comment",t&&"lb-comment:indent-content",r==="hover"&&"lb-comment:show-actions-hover",($||Y)&&"lb-comment:action-open",g),"data-deleted":e.body?void 0:"","data-editing":M?"":void 0,"data-target":B?"":void 0,dir:P.dir,...E,ref:D,children:[p.jsxs("div",{className:"lb-comment-header",children:[p.jsxs("div",{className:"lb-comment-details",children:[p.jsx(dc,{className:"lb-comment-avatar",userId:e.userId,onClick:R}),p.jsxs("span",{className:"lb-comment-details-labels",children:[p.jsx(sn,{className:"lb-comment-author",userId:e.userId,onClick:R}),p.jsxs("span",{className:"lb-comment-date",children:[p.jsx($m,{locale:P.locale,date:e.createdAt,className:"lb-date lb-comment-date-created"}),e.editedAt&&e.body&&p.jsxs(p.Fragment,{children:[" ",p.jsx("span",{className:"lb-comment-date-edited",children:P.COMMENT_EDITED})]})]})]})]}),r&&!M&&p.jsxs("div",{className:Ae("lb-comment-actions",v),children:[C??null,o&&p.jsx(ou,{onEmojiSelect:_,onOpenChange:ee,children:p.jsx(at,{content:P.COMMENT_ADD_REACTION,children:p.jsx(Ns,{asChild:!0,children:p.jsx(Dt,{className:"lb-comment-action",onClick:V,"aria-label":P.COMMENT_ADD_REACTION,icon:p.jsx(yl,{})})})})}),e.userId===x&&p.jsx(Hg,{open:$,onOpenChange:re,align:"end",content:p.jsxs(p.Fragment,{children:[p.jsx(Ms,{onSelect:te,onClick:V,icon:p.jsx(lE,{}),children:P.COMMENT_EDIT}),p.jsx(Ms,{onSelect:G,onClick:V,icon:p.jsx(Uh,{}),children:P.COMMENT_DELETE})]}),children:p.jsx(at,{content:P.COMMENT_MORE,children:p.jsx(Rc,{asChild:!0,children:p.jsx(Dt,{className:"lb-comment-action",disabled:!e.body,onClick:V,"aria-label":P.COMMENT_MORE,icon:p.jsx(Hh,{})})})})})]})]}),p.jsx("div",{className:"lb-comment-content",children:M?p.jsx(rg,{className:"lb-comment-composer",onComposerSubmit:de,defaultValue:e.body,defaultAttachments:e.attachments,autoFocus:!0,showAttribution:!1,showAttachments:s,showFormattingControls:a,actions:p.jsxs(p.Fragment,{children:[p.jsx(at,{content:P.COMMENT_EDIT_COMPOSER_CANCEL,"aria-label":P.COMMENT_EDIT_COMPOSER_CANCEL,children:p.jsx(Dt,{className:"lb-composer-action",onClick:se,icon:p.jsx(Su,{})})}),p.jsx(lc,{content:P.COMMENT_EDIT_COMPOSER_SAVE,shortcut:"Enter",children:p.jsx(_m,{asChild:!0,children:p.jsx(Dt,{variant:"primary",className:"lb-composer-action",onClick:V,"aria-label":P.COMMENT_EDIT_COMPOSER_SAVE,icon:p.jsx($h,{})})})})]}),overrides:{COMPOSER_PLACEHOLDER:P.COMMENT_EDIT_COMPOSER_PLACEHOLDER},roomId:e.roomId}):e.body?p.jsxs(p.Fragment,{children:[p.jsx(ip,{className:"lb-comment-body",body:e.body,components:{Mention:({userId:H})=>p.jsx(zg,{userId:H,onClick:X=>u?.(H,X)}),Link:qF}}),s&&(L.length>0||Q.length>0)?p.jsxs("div",{className:"lb-comment-attachments",children:[L.length>0?p.jsx("div",{className:"lb-attachments",children:L.map(H=>p.jsx(ZF,{attachment:H,overrides:m,onAttachmentClick:c,roomId:e.roomId},H.id))}):null,Q.length>0?p.jsx("div",{className:"lb-attachments",children:Q.map(H=>p.jsx(JF,{attachment:H,overrides:m,onAttachmentClick:c,roomId:e.roomId},H.id))}):null]}):null,o&&e.reactions.length>0&&p.jsxs("div",{className:"lb-comment-reactions",children:[e.reactions.map(H=>p.jsx(YF,{comment:e,reaction:H,overrides:m},H.emoji)),p.jsx(ou,{onEmojiSelect:_,children:p.jsx(at,{content:P.COMMENT_ADD_REACTION,children:p.jsx(Ns,{asChild:!0,children:p.jsx(Dt,{className:"lb-comment-reaction lb-comment-reaction-add",variant:"outline",onClick:V,"aria-label":P.COMMENT_ADD_REACTION,icon:p.jsx(yl,{})})})})})]})]}):p.jsx("div",{className:"lb-comment-body",children:p.jsx("p",{className:"lb-comment-deleted",children:P.COMMENT_DELETED})})})]})]})}),Hd="https://localhost:9999",nP=/^[a-zA-Z][a-zA-Z\d+\-.]*?:/;function qg(e,t,n){const r=nP.test(e),o=new URL(e,r?void 0:Hd);return!o.hash&&n!==void 0&&(o.hash=`#${n}`),r?o.href:o.href.replace(Hd,"")}const iu=3;function Wd({comment:e,showHeader:t=!0,showAttachments:n=!0,showReactions:r=!0,overrides:o,className:s,...a}){const i=Ze(o);return p.jsxs("div",{className:Ae("lb-root lb-inbox-notification-comment lb-comment",s),...a,children:[t&&p.jsx("div",{className:"lb-comment-header",children:p.jsx(sn,{className:"lb-comment-author",userId:e.userId})}),p.jsx("div",{className:"lb-comment-content",children:e.body?p.jsxs(p.Fragment,{children:[p.jsx(ip,{className:"lb-comment-body",body:e.body,components:{Mention:zg,Link:GF}}),r&&e.reactions.length>0&&p.jsx("div",{className:"lb-comment-reactions",children:e.reactions.map(u=>p.jsx(XF,{reaction:u,overrides:o,disabled:!0},u.emoji))}),n&&e.attachments.length>0?p.jsx("div",{className:"lb-comment-attachments",children:p.jsx("div",{className:"lb-attachments",children:e.attachments.map(u=>p.jsx(QF,{attachment:u,overrides:o,roomId:e.roomId},u.id))})}):null]}):p.jsx("div",{className:"lb-comment-body",children:p.jsx("p",{className:"lb-comment-deleted",children:i.COMMENT_DELETED})})})]})}function rP(e,t){if(e.length)for(let n=e.length-1;n>=0;n--){const r=e[n];if(r.userId!==t&&r.body&&kb(r.body).includes(t))return r}}function zd(e){return Array.from(new Set(e.map(t=>t.userId)))}function oP(e,t,n){const r=t.comments.filter(a=>a.body?e.readAt?a.createdAt>e.readAt&&a.createdAt<=e.notifiedAt:a.createdAt<=e.notifiedAt:!1);if(r.length===0){const a=t.comments.filter(i=>i.body).slice(-iu);return{type:"comments",unread:!1,comments:a,userIds:zd(a),date:e.notifiedAt}}const o=rP(r,n);return o?{type:"mention",unread:!0,comments:[o],userIds:[o.userId],date:o.createdAt}:{type:"comments",unread:!0,comments:r.slice(-iu),userIds:zd(r),date:e.notifiedAt}}function uu({roomId:e,className:t,...n}){const{info:r,isLoading:o}=Du(e),s=f.useMemo(()=>r?.name??e,[r?.name,e]);return p.jsx("span",{className:Ae("lb-name lb-room",t),"data-loading":o?"":void 0,...n,children:o?null:s})}const Ic=f.forwardRef(({inboxNotification:e,children:t,aside:n,title:r,date:o,unread:s,markAsReadOnClick:a,onClick:i,href:u,showActions:c,overrides:l,components:d,className:m,asChild:g,...C},v)=>{const h=Ze(l),{Anchor:E}=lx(d),y=g?Ne:E,[w,D]=f.useState(!1),x=Py(),I=Ny(),S=f.useCallback(B=>{i?.(B),s&&(a??!!u)&&x(e.id)},[u,e.id,a,x,i,s]),k=f.useCallback(B=>{B.stopPropagation()},[]),W=f.useCallback(B=>{B.preventDefault(),B.stopPropagation()},[]),P=f.useCallback(B=>{B.preventDefault(),B.stopPropagation(),D(j=>!j)},[]),M=f.useCallback(()=>{x(e.id)},[e.id,x]),F=f.useCallback(()=>{I(e.id)},[e.id,I]);return p.jsx(Bo,{children:p.jsxs(y,{className:Ae("lb-root lb-inbox-notification",c==="hover"&&"lb-inbox-notification:show-actions-hover",w&&"lb-inbox-notification:action-open",m),dir:h.dir,"data-unread":s?"":void 0,"data-kind":e.kind,onClick:S,href:u,...C,ref:v,children:[n&&p.jsx("div",{className:"lb-inbox-notification-aside",children:n}),p.jsxs("div",{className:"lb-inbox-notification-content",children:[p.jsxs("div",{className:"lb-inbox-notification-header",children:[p.jsx("span",{className:"lb-inbox-notification-title",children:r}),p.jsx("div",{className:"lb-inbox-notification-details",children:p.jsxs("span",{className:"lb-inbox-notification-details-labels",children:[p.jsx($m,{locale:h.locale,date:o,className:"lb-date lb-inbox-notification-date"}),s&&p.jsx("span",{className:"lb-inbox-notification-unread-indicator",role:"presentation"})]})}),c&&p.jsx("div",{className:"lb-inbox-notification-actions",children:p.jsx(Hg,{open:w,onOpenChange:D,align:"end",content:p.jsxs(p.Fragment,{children:[s?p.jsx(Ms,{onSelect:M,onClick:k,icon:p.jsx($h,{}),children:h.INBOX_NOTIFICATION_MARK_AS_READ}):null,p.jsx(Ms,{onSelect:F,onClick:k,icon:p.jsx(Uh,{}),children:h.INBOX_NOTIFICATION_DELETE})]}),children:p.jsx(at,{content:h.INBOX_NOTIFICATION_MORE,children:p.jsx(Rc,{asChild:!0,children:p.jsx(Dt,{className:"lb-inbox-notification-action",onClick:P,onPointerDown:W,onPointerUp:W,"aria-label":h.INBOX_NOTIFICATION_MORE,icon:p.jsx(Hh,{})})})})})})]}),p.jsx("div",{className:"lb-inbox-notification-body",children:t})]})]})})});function Gg({className:e,...t}){return p.jsx("div",{className:Ae("lb-inbox-notification-icon",e),...t})}function _s({className:e,...t}){return p.jsx(dc,{className:Ae("lb-inbox-notification-avatar",e),...t})}const Vd=f.forwardRef(({inboxNotification:e,href:t,showRoomName:n=!0,showReactions:r=!0,showAttachments:o=!0,showActions:s="hover",overrides:a,...i},u)=>{const c=Ze(a),l=My(e.id),d=Lr(),{info:m}=Du(e.roomId),g=f.useMemo(()=>{const D=oP(e,l,d??"");if(D.comments.length===0||D.userIds.length===0)return null;switch(D.type){case"comments":{const x=[...D.userIds].reverse(),I=x[0],S=p.jsx(_s,{userId:I}),k=c.INBOX_NOTIFICATION_THREAD_COMMENTS_LIST(p.jsx(Wg,{values:x.map(P=>p.jsx(sn,{userId:P,replaceSelf:!0},P)),formatRemaining:c.LIST_REMAINING_USERS,truncate:iu-1,locale:c.locale}),n?p.jsx(uu,{roomId:l.roomId}):void 0,x.length),W=p.jsx("div",{className:"lb-inbox-notification-comments",children:D.comments.map(P=>p.jsx(Wd,{comment:P,showHeader:D.comments.length>1,showAttachments:o,showReactions:r,overrides:a},P.id))});return{unread:D.unread,date:D.date,aside:S,title:k,content:W,threadId:l.id,commentId:D.comments[D.comments.length-1].id}}case"mention":{const x=D.userIds[0],I=D.comments[0],S=p.jsx(_s,{userId:x}),k=c.INBOX_NOTIFICATION_THREAD_MENTION(p.jsx(sn,{userId:x},x),n?p.jsx(uu,{roomId:l.roomId}):void 0),W=p.jsx("div",{className:"lb-inbox-notification-comments",children:p.jsx(Wd,{comment:I,showHeader:!1,showAttachments:o,showReactions:r,overrides:a},I.id)});return{unread:D.unread,date:D.date,aside:S,title:k,content:W,threadId:l.id,commentId:I.id}}default:return lt(D,"Unexpected thread inbox notification type")}},[c,d,e,a,n,o,r,l]),C=f.useMemo(()=>{const D=t??m?.url;return D?qg(D,void 0,g?.commentId):void 0},[g?.commentId,t,m?.url]);if(!g)return null;const{aside:v,title:h,content:E,date:y,unread:w}=g;return p.jsx(Ic,{inboxNotification:e,aside:v,title:h,date:y,unread:w,overrides:a,href:C,showActions:s,markAsReadOnClick:!1,...i,ref:u,children:E})}),Kd=f.forwardRef(({inboxNotification:e,showActions:t="hover",showRoomName:n=!0,href:r,overrides:o,...s},a)=>{const i=Ze(o),{info:u}=Du(e.roomId),c=f.useMemo(()=>{const d=r??u?.url;return d?qg(d):void 0},[r,u?.url]),l=f.useMemo(()=>!e.readAt||e.notifiedAt>e.readAt,[e.notifiedAt,e.readAt]);return p.jsx(Ic,{inboxNotification:e,aside:p.jsx(_s,{userId:e.createdBy}),title:i.INBOX_NOTIFICATION_TEXT_MENTION(p.jsx(sn,{userId:e.createdBy},e.createdBy),n?p.jsx(uu,{roomId:e.roomId}):void 0),date:e.notifiedAt,unread:l,overrides:o,showActions:t,href:c,...s,ref:a})}),Yg=f.forwardRef(({inboxNotification:e,showActions:t="hover",title:n,aside:r,children:o,overrides:s,...a},i)=>{const u=f.useMemo(()=>!e.readAt||e.notifiedAt>e.readAt,[e.notifiedAt,e.readAt]);return p.jsx(Ic,{inboxNotification:e,aside:r,title:n,date:e.notifiedAt,unread:u,overrides:s,showActions:t,...a,ref:i,children:o})});f.forwardRef(({inboxNotification:e,...t},n)=>p.jsxs(Yg,{inboxNotification:e,...t,title:p.jsxs(p.Fragment,{children:["Custom notification kind ",p.jsx("code",{children:e.kind})," is not handled"]}),aside:p.jsx(Gg,{children:p.jsx(tc,{})}),ref:n,"data-missing":"",children:["Notifications of this kind won’t be displayed in production. Use the"," ",p.jsx("code",{children:"kinds"})," prop to define how they should be rendered."]}));const EP=Object.assign(f.forwardRef(({inboxNotification:e,kinds:t,...n},r)=>{switch(e.kind){case"thread":{const o=t?.thread??Vd;return p.jsx(o,{inboxNotification:e,...n,ref:r})}case"textMention":{const o=t?.textMention??Kd;return p.jsx(o,{inboxNotification:e,...n,ref:r})}default:{const o=t?.[e.kind];return o?p.jsx(o,{inboxNotification:e,...n,ref:r}):null}}}),{Thread:Vd,TextMention:Kd,Custom:Yg,Icon:Gg,Avatar:_s});function sP(e){return p.jsx(Ue,{...e,children:p.jsx("path",{d:"M10 4v12m6-6-6 6-6-6"})})}function aP(e){return p.jsxs(Ue,{...e,children:[p.jsx("circle",{cx:10,cy:10,r:7}),p.jsx("path",{d:"m13 8-4 4-2-2"})]})}function iP(e){return p.jsxs(Ue,{...e,children:[p.jsx("circle",{cx:10,cy:10,r:7,fill:"currentColor"}),p.jsx("path",{d:"m13 8-4 4-2-2",stroke:"var(--lb-icon-background)"})]})}function uP(e,t){let n=e.length-1;for(;n>=0;){const r=e[n];if(r&&t(r))return n;n--}return-1}const DP=f.forwardRef(({thread:e,indentCommentContent:t=!0,showActions:n="hover",showDeletedComments:r,showResolveAction:o=!0,showReactions:s=!0,showComposer:a="collapsed",showAttachments:i=!0,showComposerFormattingControls:u=!0,onResolvedChange:c,onCommentEdit:l,onCommentDelete:d,onThreadDelete:m,onAuthorClick:g,onMentionClick:C,onAttachmentClick:v,onComposerSubmit:h,overrides:E,className:y,...w},D)=>{const x=Yy(e.roomId),I=Xy(e.roomId),S=Ze(E),k=f.useMemo(()=>r?0:e.comments.findIndex(L=>L.body),[r,e.comments]),W=f.useMemo(()=>r?e.comments.length-1:uP(e.comments,L=>L.body),[r,e.comments]),{status:P,unreadSince:M}=Zy(e.id),F=f.useMemo(()=>{if(P!=="subscribed")return;if(M===null)return k;const L=e.comments.findIndex(Q=>(r?!0:Q.body)&&Q.createdAt>M);return L>=0&&L<e.comments.length?L:void 0},[k,r,P,e.comments,M]),[B,j]=f.useState(),$=B===void 0?F:B;f.useEffect(()=>{F&&j(L=>Math.min(L??1/0,F))},[F]);const re=f.useCallback(L=>{L.stopPropagation()},[]),Y=f.useCallback(L=>{c?.(L),L?x(e.id):I(e.id)},[x,I,c,e.id]),ee=f.useCallback(L=>{d?.(L),e.comments.filter(V=>V.body).length<=1&&m?.(e)},[d,m,e]);return p.jsx(Bo,{children:p.jsxs("div",{className:Ae("lb-root lb-thread",n==="hover"&&"lb-thread:show-actions-hover",y),"data-resolved":e.resolved?"":void 0,"data-unread":F!==void 0?"":void 0,dir:S.dir,...w,ref:D,children:[p.jsx("div",{className:"lb-thread-comments",children:e.comments.map((L,Q)=>{const V=Q===k,te=F!==void 0&&Q>=F,se=p.jsx(tP,{overrides:E,className:"lb-thread-comment","data-unread":te?"":void 0,comment:L,indentContent:t,showDeleted:r,showActions:n,showReactions:s,showAttachments:i,showComposerFormattingControls:u,onCommentEdit:l,onCommentDelete:ee,onAuthorClick:g,onMentionClick:C,onAttachmentClick:v,autoMarkReadThreadId:Q===W&&te?e.id:void 0,additionalActionsClassName:V?"lb-thread-actions":void 0,additionalActions:V&&o?p.jsx(at,{content:e.resolved?S.THREAD_UNRESOLVE:S.THREAD_RESOLVE,children:p.jsx(Ou,{pressed:e.resolved,onPressedChange:Y,asChild:!0,children:p.jsx(Dt,{className:"lb-comment-action",onClick:re,"aria-label":e.resolved?S.THREAD_UNRESOLVE:S.THREAD_RESOLVE,icon:e.resolved?p.jsx(iP,{}):p.jsx(aP,{})})})}):null},L.id);return Q===$&&$!==k&&$<=W?p.jsxs(f.Fragment,{children:[p.jsx("div",{className:"lb-thread-new-indicator","aria-label":S.THREAD_NEW_INDICATOR_DESCRIPTION,children:p.jsxs("span",{className:"lb-thread-new-indicator-label",children:[p.jsx(sP,{className:"lb-thread-new-indicator-label-icon"}),S.THREAD_NEW_INDICATOR]})}),se]},L.id):se})}),a&&p.jsx(rg,{className:"lb-thread-composer",threadId:e.id,defaultCollapsed:a==="collapsed"?!0:void 0,showAttachments:i,showFormattingControls:u,onComposerSubmit:h,overrides:{COMPOSER_PLACEHOLDER:S.THREAD_COMPOSER_PLACEHOLDER,COMPOSER_SEND:S.THREAD_COMPOSER_SEND,...E},roomId:e.roomId})]})})});export{OS as A,DS as B,rg as C,_m as D,Nm as E,km as F,jm as G,mP as H,EP as I,Pm as J,gt as K,hP as L,Mm as M,I0 as P,$m as T,gP as _,lu as a,Gd as b,w0 as c,b0 as d,Yd as e,A0 as f,S0 as g,x0 as h,du as i,R0 as j,T0 as k,bP as l,CP as m,ip as n,tP as o,DP as p,Fh as q,D0 as r,ap as s,sp as t,Ze as u,pP as v,Py as w,My as x,dP as y,vP as z};
|
|
59
|
+
`)},XR=0,ur=[];function ZR(e){var t=f.useRef([]),n=f.useRef([0,0]),r=f.useRef(),o=f.useState(XR++)[0],s=f.useState(Ev)[0],a=f.useRef(e);f.useEffect(function(){a.current=e},[e]),f.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var v=CR([e.lockRef.current],(e.shards||[]).map(xd),!0).filter(Boolean);return v.forEach(function(h){return h.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),v.forEach(function(h){return h.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var i=f.useCallback(function(v,h){if("touches"in v&&v.touches.length===2||v.type==="wheel"&&v.ctrlKey)return!a.current.allowPinchZoom;var E=os(v),y=n.current,w="deltaX"in v?v.deltaX:y[0]-E[0],D="deltaY"in v?v.deltaY:y[1]-E[1],x,I=v.target,S=Math.abs(w)>Math.abs(D)?"h":"v";if("touches"in v&&S==="h"&&I.type==="range")return!1;var k=wd(S,I);if(!k)return!0;if(k?x=S:(x=S==="v"?"h":"v",k=wd(S,I)),!k)return!1;if(!r.current&&"changedTouches"in v&&(w||D)&&(r.current=x),!x)return!0;var W=r.current||x;return qR(W,h,v,W==="h"?w:D)},[]),u=f.useCallback(function(v){var h=v;if(!(!ur.length||ur[ur.length-1]!==s)){var E="deltaY"in h?Ad(h):os(h),y=t.current.filter(function(x){return x.name===h.type&&(x.target===h.target||h.target===x.shadowParent)&&GR(x.delta,E)})[0];if(y&&y.should){h.cancelable&&h.preventDefault();return}if(!y){var w=(a.current.shards||[]).map(xd).filter(Boolean).filter(function(x){return x.contains(h.target)}),D=w.length>0?i(h,w[0]):!a.current.noIsolation;D&&h.cancelable&&h.preventDefault()}}},[]),c=f.useCallback(function(v,h,E,y){var w={name:v,delta:h,target:E,should:y,shadowParent:JR(E)};t.current.push(w),setTimeout(function(){t.current=t.current.filter(function(D){return D!==w})},1)},[]),l=f.useCallback(function(v){n.current=os(v),r.current=void 0},[]),d=f.useCallback(function(v){c(v.type,Ad(v),v.target,i(v,e.lockRef.current))},[]),m=f.useCallback(function(v){c(v.type,os(v),v.target,i(v,e.lockRef.current))},[]);f.useEffect(function(){return ur.push(s),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:m}),document.addEventListener("wheel",u,ir),document.addEventListener("touchmove",u,ir),document.addEventListener("touchstart",l,ir),function(){ur=ur.filter(function(v){return v!==s}),document.removeEventListener("wheel",u,ir),document.removeEventListener("touchmove",u,ir),document.removeEventListener("touchstart",l,ir)}},[]);var g=e.removeScrollBar,C=e.inert;return f.createElement(f.Fragment,null,C?f.createElement(s,{styles:YR(o)}):null,g?f.createElement($R,{gapMode:e.gapMode}):null)}function JR(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const QR=SR(yv,ZR);var mc=f.forwardRef(function(e,t){return f.createElement(ha,Ht({},e,{ref:t,sideCar:QR}))});mc.classNames=ha.classNames;var vc="Popover",[xv]=aa(vc,[$r]),Po=$r(),[eI,Tn]=xv(vc),Ov=e=>{const{__scopePopover:t,children:n,open:r,defaultOpen:o,onOpenChange:s,modal:a=!1}=e,i=Po(t),u=f.useRef(null),[c,l]=f.useState(!1),[d=!1,m]=Oo({prop:r,defaultProp:o,onChange:s});return p.jsx(sc,{...i,children:p.jsx(eI,{scope:t,contentId:yo(),triggerRef:u,open:d,onOpenChange:m,onOpenToggle:f.useCallback(()=>m(g=>!g),[m]),hasCustomAnchor:c,onCustomAnchorAdd:f.useCallback(()=>l(!0),[]),onCustomAnchorRemove:f.useCallback(()=>l(!1),[]),modal:a,children:n})})};Ov.displayName=vc;var Sv="PopoverAnchor",tI=f.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=Tn(Sv,n),s=Po(n),{onCustomAnchorAdd:a,onCustomAnchorRemove:i}=o;return f.useEffect(()=>(a(),()=>i()),[a,i]),p.jsx(ua,{...s,...r,ref:t})});tI.displayName=Sv;var Tv="PopoverTrigger",Ns=f.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=Tn(Tv,n),s=Po(n),a=Ke(t,o.triggerRef),i=p.jsx(He.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":Pv(o.open),...r,ref:a,onClick:ve(e.onClick,o.onOpenToggle)});return o.hasCustomAnchor?i:p.jsx(ua,{asChild:!0,...s,children:i})});Ns.displayName=Tv;var gc="PopoverPortal",[nI,rI]=xv(gc,{forceMount:void 0}),Rv=e=>{const{__scopePopover:t,forceMount:n,children:r,container:o}=e,s=Tn(gc,t);return p.jsx(nI,{scope:t,forceMount:n,children:p.jsx(un,{present:n||s.open,children:p.jsx(ca,{asChild:!0,container:o,children:r})})})};Rv.displayName=gc;var Fr="PopoverContent",Iv=f.forwardRef((e,t)=>{const n=rI(Fr,e.__scopePopover),{forceMount:r=n.forceMount,...o}=e,s=Tn(Fr,e.__scopePopover);return p.jsx(un,{present:r||s.open,children:s.modal?p.jsx(oI,{...o,ref:t}):p.jsx(sI,{...o,ref:t})})});Iv.displayName=Fr;var oI=f.forwardRef((e,t)=>{const n=Tn(Fr,e.__scopePopover),r=f.useRef(null),o=Ke(t,r),s=f.useRef(!1);return f.useEffect(()=>{const a=r.current;if(a)return gv(a)},[]),p.jsx(mc,{as:Ne,allowPinchZoom:!0,children:p.jsx(Bv,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:ve(e.onCloseAutoFocus,a=>{a.preventDefault(),s.current||n.triggerRef.current?.focus()}),onPointerDownOutside:ve(e.onPointerDownOutside,a=>{const i=a.detail.originalEvent,u=i.button===0&&i.ctrlKey===!0,c=i.button===2||u;s.current=c},{checkForDefaultPrevented:!1}),onFocusOutside:ve(e.onFocusOutside,a=>a.preventDefault(),{checkForDefaultPrevented:!1})})})}),sI=f.forwardRef((e,t)=>{const n=Tn(Fr,e.__scopePopover),r=f.useRef(!1),o=f.useRef(!1);return p.jsx(Bv,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:s=>{e.onCloseAutoFocus?.(s),s.defaultPrevented||(r.current||n.triggerRef.current?.focus(),s.preventDefault()),r.current=!1,o.current=!1},onInteractOutside:s=>{e.onInteractOutside?.(s),s.defaultPrevented||(r.current=!0,s.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const a=s.target;n.triggerRef.current?.contains(a)&&s.preventDefault(),s.detail.originalEvent.type==="focusin"&&o.current&&s.preventDefault()}})}),Bv=f.forwardRef((e,t)=>{const{__scopePopover:n,trapFocus:r,onOpenAutoFocus:o,onCloseAutoFocus:s,disableOutsidePointerEvents:a,onEscapeKeyDown:i,onPointerDownOutside:u,onFocusOutside:c,onInteractOutside:l,...d}=e,m=Tn(Fr,n),g=Po(n);return pv(),p.jsx(pc,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:o,onUnmountAutoFocus:s,children:p.jsx(ia,{asChild:!0,disableOutsidePointerEvents:a,onInteractOutside:l,onEscapeKeyDown:i,onPointerDownOutside:u,onFocusOutside:c,onDismiss:()=>m.onOpenChange(!1),children:p.jsx(ac,{"data-state":Pv(m.open),role:"dialog",id:m.contentId,...g,...d,ref:t,style:{...d.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),Fv="PopoverClose",aI=f.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=Tn(Fv,n);return p.jsx(He.button,{type:"button",...r,ref:t,onClick:ve(e.onClick,()=>o.onOpenChange(!1))})});aI.displayName=Fv;var iI="PopoverArrow",uI=f.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=Po(n);return p.jsx(ic,{...o,...r,ref:t})});uI.displayName=iI;function Pv(e){return e?"open":"closed"}var cI=Ov,lI=Rv,fI=Iv,dI=Object.defineProperty,hI=(e,t)=>{for(var n in t)dI(e,n,{get:t[n],enumerable:!0})},Jt={};hI(Jt,{ActiveEmoji:()=>tg,Empty:()=>eg,List:()=>Zv,Loading:()=>Qv,Root:()=>zv,Search:()=>Vv,SkinTone:()=>ng,SkinToneSelector:()=>Jv,Viewport:()=>Kv});var Nv="'Apple Color Emoji', 'Noto Color Emoji', 'Twemoji Mozilla', 'Android Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', EmojiSymbols, sans-serif",Cc=["none","light","medium-light","medium","medium-dark","dark"];function gi(e){return e.charAt(0).toUpperCase()+e.slice(1)}var Tt=2,Ye=null;function Od(e){try{Ye??=document.createElement("canvas").getContext("2d",{willReadFrequently:!0})}catch{}if(!Ye||(queueMicrotask(()=>{Ye&&(Ye=null)}),Ye.canvas.width=Tt,Ye.canvas.height=Tt,Ye.font=`2px ${Nv}`,Ye.textBaseline="middle",Ye.measureText(e).width>=Tt*2))return!1;Ye.fillStyle="#00f",Ye.fillText(e,0,0);let t=Ye.getImageData(0,0,Tt,Tt).data;Ye.clearRect(0,0,Tt,Tt),Ye.fillStyle="#f00",Ye.fillText(e,0,0);let n=Ye.getImageData(0,0,Tt,Tt).data;for(let r=0;r<Tt*Tt*4;r+=4)if(t[r]!==n[r]||t[r+1]!==n[r+1]||t[r+2]!==n[r+2])return!1;return!0}function Sd(e,t,n){try{let r=e.getItem(t);if(!r)throw new Error(`No value found for "${t}".`);let o=JSON.parse(r);return n(o)}catch{return null}}function kv(e,t,n){e.setItem(t,JSON.stringify(n))}function Td(e){return t=>t===void 0?void 0:e(t)}function Rd(e){return t=>t===null?null:e(t)}function Ge(e){if(typeof e!="string")throw new Error;return e}function vs(e){if(typeof e!="number")throw new Error;return e}function jv(e){if(typeof e!="boolean")throw new Error;return e}function pn(e){return t=>{if(typeof t!="object"||t===null)throw new Error;let n={};for(let r in e){let o=t[r];o===void 0&&e[r](void 0),n[r]=e[r](o)}return n}}function Ci(e){return t=>{if(!Array.isArray(t))throw new Error;return t.length>0&&e(t[0]),t}}var Mv=(e,t)=>`${e}/${t}/data.json`,_v=(e,t)=>`${e}/${t}/messages.json`,pI=["bn","da","de","en-gb","en","es-mx","es","et","fi","fr","hi","hu","it","ja","ko","lt","ms","nb","nl","pl","pt","ru","sv","th","uk","vi","zh-hant","zh"],Id="en",Lv=e=>`frimousse/data/${e}`,Bd="frimousse/metadata";async function Fd(e,t){try{return(await fetch(e,{method:"HEAD",signal:t})).headers.get("etag")}catch{return null}}async function mI(e,t,n){let[{emojis:r,emojisEtag:o},{messages:s,messagesEtag:a}]=await Promise.all([fetch(Mv(e,t),{signal:n}).then(async i=>({emojis:await i.json(),emojisEtag:i.headers.get("etag")})),fetch(_v(e,t),{signal:n}).then(async i=>({messages:await i.json(),messagesEtag:i.headers.get("etag")}))]);return{emojis:r,messages:s,emojisEtag:o,messagesEtag:a}}async function vI(e,t,n){let[r,o]=await Promise.all([Fd(Mv(e,t),n),Fd(_v(e,t),n)]);return{emojisEtag:r,messagesEtag:o}}function gI(e){return e.skins?e.skins.filter(t=>typeof t.tone=="number").reduce((t,n)=>{let r=Cc[n.tone];return t[r]=n.emoji,t},{}):void 0}async function Pd(e,t,n){let{emojis:r,emojisEtag:o,messages:s,messagesEtag:a}=await mI(e,t,n),i=s.subgroups.find(C=>C.key==="country-flag"||C.key==="subdivision-flag"),u=s.groups.filter(C=>C.key!=="component"),c=r.filter(C=>"group"in C),l=u.map(C=>({index:C.order,label:gi(C.message)})),d=s.skinTones.reduce((C,v)=>(C[v.key]=gi(v.message),C),{}),m=c.map(C=>({emoji:C.emoji,category:C.group,version:C.version,label:gi(C.label),tags:C.tags??[],countryFlag:i&&C.subgroup===i.order||void 0,skins:gI(C)})),g={locale:t,emojis:m,categories:l,skinTones:d};return kv(localStorage,Lv(t),{data:g,metadata:{emojisEtag:o,messagesEtag:a}}),g}function CI(e,t){let n=new Map;for(let a of e)n.has(a.version)||n.set(a.version,a.emoji);let r=[...n.keys()].sort((a,i)=>i-a),o=r[0]??0,s=Od("🇪🇺");if(typeof t=="number")return{emojiVersion:t,countryFlags:s};for(let a of r){let i=n.get(a);if(Od(i))return{emojiVersion:a,countryFlags:s}}return{emojiVersion:o,countryFlags:s}}var bI=pn({emojiVersion:vs,countryFlags:jv}),yI=pn({data:pn({locale:Ge,emojis:Ci(pn({emoji:Ge,category:vs,label:Ge,version:vs,tags:Ci(Ge),countryFlag:Td(jv),skins:Td(pn({light:Ge,"medium-light":Ge,medium:Ge,"medium-dark":Ge,dark:Ge}))})),categories:Ci(pn({index:vs,label:Ge})),skinTones:pn({light:Ge,"medium-light":Ge,medium:Ge,"medium-dark":Ge,dark:Ge})}),metadata:pn({emojisEtag:Rd(Ge),messagesEtag:Rd(Ge)})});async function EI({locale:e,emojiVersion:t,emojibaseUrl:n,signal:r}){let o=typeof n=="string"?n:`https://cdn.jsdelivr.net/npm/emojibase-data@${typeof t=="number"?Math.floor(t):"latest"}`,s=Sd(sessionStorage,Bd,bI),a=Sd(localStorage,Lv(e),yI),i;if(!a)i=await Pd(o,e,r);else if(s)i=a.data;else try{let{emojisEtag:c,messagesEtag:l}=await vI(o,e,r);i=!c||!l||c!==a.metadata.emojisEtag||l!==a.metadata.messagesEtag?await Pd(o,e,r):a.data}catch{i=a.data}s??=CI(i.emojis,t),kv(sessionStorage,Bd,s);let u=i.emojis.filter(c=>{let l=c.version<=s.emojiVersion;return c.countryFlag?l&&s.countryFlags:l});return{locale:e,emojis:u,categories:i.categories,skinTones:i.skinTones}}function Nd(e){return pI.includes(e)?e:(console.warn(`Locale "${e}" is not supported, using "${Id}" instead.`),Id)}function kd(e){return Cc.includes(e)?e:(console.warn(`Skin tone "${e}" is not valid, using "none" instead.`),"none")}function DI(e,t){let n=[];if(t<=0)return n;for(let r=0,o=e.length;r<o;r+=t)n.push(e.slice(r,r+t));return n}function wI(e,t){if(!t)return e;let n=t.toLowerCase().trim(),r=new WeakMap;return e.filter(o=>{let s=0;o.label.toLowerCase().includes(n)&&(s+=10);for(let a of o.tags)a.toLowerCase().includes(n)&&(s+=1);return s>0?(r.set(o,s),!0):!1}).sort((o,s)=>(r.get(s)??0)-(r.get(o)??0))}function AI(e,t,n,r){let o=wI(e.emojis,r),s=[],a=[],i=[],u={},c=0,l=0;for(let d of o)u[d.category]||(u[d.category]=[]),u[d.category].push({emoji:n&&n!=="none"&&d.skins?d.skins[n]:d.emoji,label:d.label});for(let d of e.categories){let m=u[d.index];if(!m||m.length===0)continue;let g=DI(Array.from(m),t).map(C=>({categoryIndex:c,emojis:C}));s.push(...g),a.push({label:d.label,rowsCount:g.length,startRowIndex:l}),i.push(l),c++,l+=g.length}return{count:o.length,categories:a,categoriesStartRowIndices:i,rows:s,skinTones:e.skinTones}}function xI(e){let t={},n=null,r=null,o=new Set,s=()=>{if(n){t=n,n=null;for(let c of o)c(t)}r=null},a=()=>n??t,i=c=>{n??=t,Object.assign(n,typeof c=="function"?c(a()):c),r||(r=requestAnimationFrame(s))},u=c=>(o.add(c),()=>o.delete(c));return t=e(i,a),{get:a,set:i,subscribe:u}}function OI(e){let[t]=f.useState(e);return t}function SI(e){let t=f.createContext(null);return{useStore:()=>{let n=f.useContext(t);if(!n)throw new Error(e);return n},Provider:({store:n,children:r})=>p.jsx(t.Provider,{value:n,children:r})}}function mt(e,t,n=Object.is){let[r,o]=f.useState(()=>t(e.get()));return f.useEffect(()=>e.subscribe(()=>{let s=t(e.get());o(a=>n(a,s)?a:s)}),[e,t,n]),f.useDebugValue(r),r}function en(e,t,n){let r=f.useCallback(o=>o[t],[t]);return mt(e,r,n)}var jd=2;function TI(e,t,n,r){let o=0;return xI((s,a)=>({locale:t,columns:n,skinTone:r,onEmojiSelect:e,data:null,search:"",interaction:"none",activeColumnIndex:0,activeRowIndex:0,rowHeight:null,categoryHeaderHeight:null,viewportWidth:null,viewportHeight:null,viewportCurrentCategoryIndex:null,viewportStartCategoryIndex:0,viewportStartRowIndex:0,viewportEndRowIndex:0,rootRef:null,searchRef:null,viewportRef:null,listRef:null,updateViewportState:i=>{let u=a(),c=i?.data??u.data,l=i?.categoryHeaderHeight??u.categoryHeaderHeight,d=i?.rowHeight??u.rowHeight,m=i?.viewportHeight??u.viewportHeight;if(!c||c.rows.length===0||!l||!d||!m)return s({...i,viewportStartCategoryIndex:0,viewportStartRowIndex:0,viewportEndRowIndex:0});let g=0,C=0;for(let S of c.categories)if(C++*l+S.startRowIndex*d<o)g+=l;else break;let v=c.categories.length*l+c.rows.length*d,h=Math.floor(jd*d/2),E=Math.ceil(jd*d/2),y=Math.min(o-g-h,v-m),w=y+m+E,D=Math.max(0,Math.floor(y/d)),x=Math.min(c.rows.length-1,Math.ceil(w/d)),I=c.rows[D]?.categoryIndex;return s(I===void 0&&i?i:{...i,viewportStartCategoryIndex:I,viewportStartRowIndex:D,viewportEndRowIndex:x})},onDataChange:i=>{a().updateViewportState({data:i,activeColumnIndex:0,activeRowIndex:0})},onSearchChange:i=>{s({search:i,interaction:i?"keyboard":"none"})},onActiveEmojiChange:(i,u,c)=>{if(s({interaction:i,activeColumnIndex:u,activeRowIndex:c}),i!=="keyboard")return;let{listRef:l,viewportRef:d,rowHeight:m,viewportHeight:g,categoryHeaderHeight:C}=a(),v=l?.current,h=d?.current;if(!v||!h||!m||!C||!g)return;let E=c;E===0&&h.scrollTo({top:0,behavior:"instant"});let y=v.querySelector(`[aria-rowindex="${E}"]`);if(!(y instanceof HTMLElement))return;let w=y.offsetTop,D=getComputedStyle(y),x=Number.parseFloat(D.scrollMarginTop),I=Number.parseFloat(D.scrollMarginBottom),S=o+x;w<o+g/2&&(S+=C);let k=S+g-I;(w<S||w+m>k)&&h.scrollTo({top:Math.max(w<S+C?w-Math.max(C,x):w-g+m+I,0),behavior:"instant"})},onActiveEmojiReset:()=>{s({interaction:"none",activeColumnIndex:0,activeRowIndex:0})},onRowHeightChange:i=>{a().updateViewportState({rowHeight:i})},onCategoryHeaderHeightChange:i=>{a().updateViewportState({categoryHeaderHeight:i})},onViewportSizeChange:(i,u)=>{a().updateViewportState({viewportWidth:i,viewportHeight:u})},onViewportScroll:i=>{o=i,a().updateViewportState()}}))}var{useStore:it,Provider:RI}=SI("EmojiPicker.Root is missing.");function II(e){return e.search}function bc(e){return e.interaction==="none"?void 0:e.data?.rows[e.activeRowIndex]?.emojis[e.activeColumnIndex]}function BI(e){return e.data===void 0||typeof e.data?.count=="number"&&e.data.count===0}function FI(e){return e.data===null||e.viewportHeight===null||e.rowHeight===null||e.categoryHeaderHeight===null}function $v(e){return e.data?.rows.length}function PI(e){return e.data?.categories.length}function NI(e){return e.data?.categoriesStartRowIndices}function kI(e){return e.data?.skinTones}function Uv(e,t){return e?.emoji===t?.emoji}function jI(e,t){return e?.categoryIndex!==t?.categoryIndex||e?.emojis.length!==t?.emojis.length?!1:!!e?.emojis.every((n,r)=>Uv(n,t?.emojis[r]))}var Hr="",Md=new RegExp("\\p{Emoji_Modifier_Base}","u"),MI=/\uFE0F$/,_I=/\u{1F3FB}|\u{1F3FC}|\u{1F3FD}|\u{1F3FE}|\u{1F3FF}/gu,LI={light:"🏻","medium-light":"🏼",medium:"🏽","medium-dark":"🏾",dark:"🏿"};function $I(e,t){if(!e.split(Hr).some(r=>Md.test(r)))return e;let n=e.split(Hr).map(r=>r.replace(_I,"")).join(Hr);return t==="none"?n:n.split(Hr).map((r,o,s)=>{let a=s.length>1;return!Md.test(r)||a&&r==="🤝"?r:r.replace(MI,"")+LI[t]}).join(Hr)}function UI(e){return Cc.map(t=>({skinTone:t,emoji:$I(e,t)}))}function Hv(){let e=it(),t=mt(e,bc,Uv);return f.useDeferredValue(t)}function Wv(e="✋"){let t=it(),n=en(t,"skinTone"),r=f.useMemo(()=>UI(e),[e]),o=f.useCallback(s=>{t.set({skinTone:s})},[]);return[n,o,r]}function yc(e,t){if(Object.is(e,t))return!0;if(typeof e!="object"||typeof t!="object"||e===null||t===null||Array.isArray(e)!==Array.isArray(t))return!1;let n=Object.keys(e),r=Object.keys(t);return n.length!==r.length?!1:n.every(o=>o in t&&e[o]===t[o])}function HI(...e){}function WI(e,t){let n=null;if(typeof window.requestIdleCallback=="function")n=window.requestIdleCallback(e,t);else{let r=Date.now();n=window.setTimeout(()=>{e({didTimeout:!1,timeRemaining:()=>Math.max(0,t?.timeout-(Date.now()-r))})},10)}return()=>{typeof window.cancelIdleCallback=="function"?window.cancelIdleCallback(n):window.clearTimeout(n)}}var Wt=typeof window<"u"?f.useLayoutEffect:f.useEffect;function zI(e){let t=f.useRef(e);return Wt(()=>{t.current=e}),f.useCallback((...n)=>t.current(...n),[])}function VI({emojiVersion:e,emojibaseUrl:t}){let[n,r]=f.useState(void 0),o=it(),s=en(o,"locale"),a=en(o,"columns"),i=en(o,"skinTone"),u=en(o,"search");return f.useEffect(()=>{let c=new AbortController,l=c.signal;return EI({locale:s,emojiVersion:e,emojibaseUrl:t,signal:l}).then(d=>{r(d)}).catch(d=>{l.aborted||console.error(d)}),()=>{c.abort()}},[e,t,s]),f.useEffect(()=>{if(n)return WI(()=>{o.get().onDataChange(AI(n,a,i,u))},{timeout:100})},[n,a,i,u]),null}var zv=f.forwardRef(({locale:e="en",columns:t=9,skinTone:n="none",onEmojiSelect:r=HI,emojiVersion:o,emojibaseUrl:s,onFocusCapture:a,onBlurCapture:i,children:u,style:c,...l},d)=>{let m=zI(r),g=OI(()=>TI(m,Nd(e),t,kd(n))),[C,v]=f.useState(!1),h=f.useRef(null),E=f.useCallback(D=>{D&&(h.current=D,g.set({rootRef:h}))},[]);Wt(()=>{g.set({locale:Nd(e)})},[e]),Wt(()=>{g.set({columns:t})},[t]),Wt(()=>{g.set({skinTone:kd(n)})},[n]);let y=f.useCallback(D=>{a?.(D);let{searchRef:x,viewportRef:I}=g.get(),S=D.target===x?.current||D.target.hasAttribute("frimousse-search"),k=D.target===I?.current||D.target.hasAttribute("frimousse-viewport");D.isDefaultPrevented()||(v(S||k),D.isDefaultPrevented()||(v(S||k),k?g.get().onActiveEmojiChange("keyboard",0,0):S&&g.get().search===""&&g.set({interaction:"none"})))},[a]),w=f.useCallback(D=>{i?.(D),!D.isDefaultPrevented()&&!D.currentTarget.contains(D.relatedTarget)&&v(!1)},[i]);return Wt(()=>{C||g.get().onActiveEmojiReset()},[C]),f.useImperativeHandle(d,()=>h.current),f.useEffect(()=>{if(!C)return;function D(x){if(x.defaultPrevented||!x.key.startsWith("Arrow")&&x.key!=="Enter")return;let{data:I,onEmojiSelect:S,onActiveEmojiChange:k,interaction:W,activeColumnIndex:P,activeRowIndex:M}=g.get();if(x.key==="Enter"){let F=bc(g.get());F&&(x.preventDefault(),S(F))}if(x.key.startsWith("Arrow")){let F=P,B=M;if(x.preventDefault(),W!=="none"){if(I?.rows&&I.rows.length>0)switch(x.key){case"ArrowLeft":{if(F===0){let j=B-1,$=I.rows[j];$&&(B=j,F=$.emojis.length-1)}else F-=1;break}case"ArrowRight":{if(F===I.rows[B].emojis.length-1){let j=B+1;I.rows[j]&&(B=j,F=0)}else F+=1;break}case"ArrowUp":{let j=I.rows[B-1];j&&(B-=1,j.emojis[F]||(F=j.emojis.length-1));break}case"ArrowDown":{let j=I.rows[B+1];j&&(B+=1,j.emojis[F]||(F=j.emojis.length-1));break}}k("keyboard",F,B)}else k("keyboard",0,0)}}return document.addEventListener("keydown",D),()=>{document.removeEventListener("keydown",D)}},[C]),Wt(()=>{let D=null,x=null,I=null,S=null,k=g.subscribe(B=>{h.current&&(D!==B.viewportWidth&&(D=B.viewportWidth,h.current.style.setProperty("--frimousse-viewport-width",`${B.viewportWidth}px`)),x!==B.viewportHeight&&(x=B.viewportHeight,h.current.style.setProperty("--frimousse-viewport-height",`${B.viewportHeight}px`)),I!==B.rowHeight&&(I=B.rowHeight,h.current.style.setProperty("--frimousse-row-height",`${B.rowHeight}px`)),S!==B.categoryHeaderHeight&&(S=B.categoryHeaderHeight,h.current.style.setProperty("--frimousse-category-header-height",`${B.categoryHeaderHeight}px`)))}),{viewportWidth:W,viewportHeight:P,rowHeight:M,categoryHeaderHeight:F}=g.get();return W&&h.current.style.setProperty("--frimousse-viewport-width",`${W}px`),P&&h.current.style.setProperty("--frimousse-viewport-height",`${P}px`),M&&h.current.style.setProperty("--frimousse-row-height",`${M}px`),F&&h.current.style.setProperty("--frimousse-category-header-height",`${F}px`),k},[]),p.jsx("div",{"data-focused":C?"":void 0,"frimousse-root":"",onBlurCapture:w,onFocusCapture:y,...l,ref:E,style:{"--frimousse-emoji-font":Nv,...c},children:p.jsxs(RI,{store:g,children:[p.jsx(VI,{emojiVersion:o,emojibaseUrl:s}),u]})})}),Vv=f.forwardRef(({value:e,defaultValue:t,onChange:n,...r},o)=>{let s=it(),a=f.useRef(null),i=f.useCallback(d=>{d&&(a.current=d,s.set({searchRef:a}))},[]),u=typeof e=="string",c=f.useRef(u);f.useEffect(()=>{c.current=u},[u]),Wt(()=>{s.set({search:typeof e=="string"?e:typeof t=="string"?t:""})},[]),Wt(()=>{typeof e=="string"&&s.get().onSearchChange(e)},[e]);let l=f.useCallback(d=>{n?.(d),d.isDefaultPrevented()||s.get().onSearchChange(d.target.value)},[n]);return f.useImperativeHandle(o,()=>a.current),p.jsx("input",{autoCapitalize:"off",autoComplete:"off",autoCorrect:"off",enterKeyHint:"done","frimousse-search":"",placeholder:"Search…",spellCheck:!1,type:"search",...r,defaultValue:t,onChange:l,ref:i,value:e})}),KI=f.memo(()=>{let e=Hv();return e?p.jsx("div",{"aria-live":"polite",style:{border:0,clip:"rect(0, 0, 0, 0)",height:1,margin:-1,overflow:"hidden",padding:0,position:"absolute",whiteSpace:"nowrap",width:1,wordWrap:"normal"},children:e.label}):null}),Kv=f.forwardRef(({children:e,onScroll:t,onKeyDown:n,style:r,...o},s)=>{let a=it(),i=f.useRef(null),u=f.useCallback(m=>{m&&(i.current=m,a.set({viewportRef:i}))},[]),c=mt(a,$v),l=mt(a,PI),d=f.useCallback(m=>{t?.(m),a.get().onViewportScroll(m.currentTarget.scrollTop)},[t]);return Wt(()=>{if(!i.current)return;let m=new ResizeObserver(([g])=>{let C=g?.borderBoxSize[0]?.inlineSize??0,v=g?.borderBoxSize[0]?.blockSize??0,{onViewportSizeChange:h,viewportHeight:E,viewportWidth:y}=a.get();(E!==v||y!==C)&&h(C,v)});return m.observe(i.current),a.get().onViewportSizeChange(i.current.offsetWidth,i.current.clientHeight),()=>{m.disconnect()}},[]),f.useImperativeHandle(s,()=>i.current),p.jsxs("div",{"frimousse-viewport":"",...o,onScroll:d,ref:u,style:{position:"relative",boxSizing:"border-box",contain:"layout paint",containIntrinsicSize:typeof c=="number"&&typeof l=="number"?`var(--frimousse-viewport-width, auto) calc(${c} * var(--frimousse-row-height) + ${l} * var(--frimousse-category-header-height))`:void 0,overflowY:"auto",overscrollBehavior:"contain",scrollbarGutter:"stable",willChange:"scroll-position",...r},children:[p.jsx(KI,{}),e]})});function qv(e,t,n){return{emoji:{...e,isActive:n},role:"gridcell","aria-colindex":t,"aria-selected":n||void 0,"aria-label":e.label,"data-active":n?"":void 0,"frimousse-emoji":"",style:{fontFamily:"var(--frimousse-emoji-font)"},tabIndex:-1}}function Gv(e,t=!1){return{role:t?void 0:"row","aria-rowindex":t?void 0:e,"frimousse-row":"",style:{contain:t?void 0:"content",height:t?void 0:"var(--frimousse-row-height)",display:"flex"}}}function Yv(e,t){return{"frimousse-category":"",style:{contain:"content",top:t?`calc(${e} * var(--frimousse-category-header-height) + ${t.startRowIndex} * var(--frimousse-row-height))`:void 0,height:t?`calc(var(--frimousse-category-header-height) + ${t.rowsCount} * var(--frimousse-row-height))`:void 0,width:"100%",pointerEvents:"none",position:"absolute"}}}function Xv(e,t=!1){return{category:e,"frimousse-category-header":"",style:{contain:t?void 0:"layout paint",height:t?void 0:"var(--frimousse-category-header-height)",pointerEvents:"auto",position:"sticky",top:0}}}function _d(e,t,n,r){return{"frimousse-list-sizer":"",style:{position:"relative",boxSizing:"border-box",height:`calc(${e} * var(--frimousse-row-height) + ${t} * var(--frimousse-category-header-height))`,paddingTop:`calc(${n} * var(--frimousse-row-height) + ${r} * var(--frimousse-category-header-height))`}}}function Ld(e,t,n){return{"aria-colcount":e,"aria-rowcount":t,"frimousse-list":"",style:{"--frimousse-list-columns":e,...n},role:"grid"}}function qI(e){e.preventDefault()}var GI=f.memo(({Emoji:e,emoji:t,columnIndex:n,rowIndex:r})=>{let o=it(),s=mt(o,c=>bc(c)?.emoji===t.emoji),a=f.useCallback(()=>{o.get().onEmojiSelect(t)},[t]),i=f.useCallback(()=>{o.get().onActiveEmojiChange("pointer",n,r)},[n,r]),u=f.useCallback(()=>{o.get().onActiveEmojiReset()},[]);return p.jsx(e,{...qv(t,n,s),onClick:a,onPointerDown:qI,onPointerEnter:i,onPointerLeave:u})}),YI=f.memo(({Row:e,Emoji:t,rowIndex:n})=>{let r=it(),o=mt(r,s=>s.data?.rows[n],jI);return o?p.jsx(e,{...Gv(n),children:o.emojis.map((s,a)=>p.jsx(GI,{Emoji:t,columnIndex:a,emoji:s,rowIndex:n},s.label))}):null}),XI=f.memo(({CategoryHeader:e,categoryIndex:t})=>{let n=it(),r=mt(n,o=>o.data?.categories[t],yc);return r?p.jsx("div",{...Yv(t,r),children:p.jsx(e,{...Xv({label:r.label})})}):null}),$d=f.memo(({CategoryHeader:e,Row:t,Emoji:n})=>{let r=f.useRef(null),o=it(),s=en(o,"columns"),a=f.useMemo(()=>Array(s).fill({emoji:"🙂",label:""}),[s]),i=f.useMemo(()=>({label:"Category"}),[]),u=f.useRef(null),c=f.useRef(null);return Wt(()=>{let l=r.current?.parentElement?.parentElement;if(!l||!u.current||!c.current)return;let d=new ResizeObserver(C=>{for(let v of C){let h=v.contentRect.height,{onRowHeightChange:E,onCategoryHeaderHeightChange:y,rowHeight:w,categoryHeaderHeight:D}=o.get();v.target===u.current&&w!==h&&E(h),v.target===c.current&&D!==h&&y(h)}});d.observe(l),d.observe(u.current),d.observe(c.current);let{onRowHeightChange:m,onCategoryHeaderHeightChange:g}=o.get();return m(u.current.clientHeight),g(c.current.clientHeight),()=>{d.disconnect()}},[]),p.jsxs("div",{"aria-hidden":!0,ref:r,style:{height:0,visibility:"hidden"},children:[p.jsx("div",{"frimousse-row-sizer":"",ref:u,children:p.jsx(t,{...Gv(-1,!0),children:a.map((l,d)=>p.jsx(n,{...qv(l,d,!1)},d))})}),p.jsx("div",{...Yv(-1),children:p.jsx("div",{"frimousse-category-header-sizer":"",ref:c,children:p.jsx(e,{...Xv(i,!0)})})})]})});function ZI({category:e,...t}){return p.jsx("div",{...t,children:e.label})}function JI({emoji:e,...t}){return p.jsx("button",{type:"button",...t,children:e.emoji})}function QI({...e}){return p.jsx("div",{...e})}var Zv=f.forwardRef(({style:e,components:t,...n},r)=>{let o=it(),s=f.useRef(null),a=f.useCallback(E=>{E&&(s.current=E,o.set({listRef:s}))},[]),i=t?.CategoryHeader??ZI,u=t?.Emoji??JI,c=t?.Row??QI,l=en(o,"columns"),d=en(o,"viewportStartRowIndex"),m=en(o,"viewportEndRowIndex"),g=mt(o,$v),C=mt(o,NI,yc),v=f.useMemo(()=>C?.filter(E=>E<d).length??0,[C,d]),h=C?.length??0;return f.useImperativeHandle(r,()=>s.current),!g||!C||h===0?p.jsx("div",{...Ld(l,0,e),...n,children:p.jsx("div",{..._d(0,0,0,0),children:p.jsx($d,{CategoryHeader:i,Emoji:u,Row:c})})}):p.jsx("div",{...Ld(l,g,e),...n,ref:a,children:p.jsxs("div",{..._d(g,h,d,v),children:[p.jsx($d,{CategoryHeader:i,Emoji:u,Row:c}),Array.from({length:m-d+1},(E,y)=>{let w=d+y,D=C.indexOf(w);return p.jsxs(f.Fragment,{children:[D>=0&&p.jsx("div",{style:{height:"var(--frimousse-category-header-height)"}}),p.jsx(YI,{Emoji:u,Row:c,rowIndex:w})]},w)}),Array.from({length:h},(E,y)=>p.jsx(XI,{CategoryHeader:i,categoryIndex:y},y))]})})}),Jv=f.forwardRef(({emoji:e,onClick:t,"aria-label":n="Change skin tone",...r},o)=>{let s=it(),a=mt(s,kI,yc),[i,u,c]=Wv(e),l=f.useMemo(()=>Math.max(0,c.findIndex(h=>h.skinTone===i)),[i,c]),d=c[l],m=c[(l+1)%c.length].skinTone,g=i==="none"?void 0:a?.[i],C=m==="none"?void 0:a?.[m],v=f.useCallback(h=>{t?.(h),h.isDefaultPrevented()||u(m)},[t,u,m]);return p.jsx("button",{type:"button",...r,"aria-label":n+(C?` (${C})`:""),"aria-live":"polite","aria-valuetext":g,"frimousse-skin-tone-selector":"",onClick:v,ref:o,children:d.emoji})});function Qv({children:e,...t}){let n=it();return mt(n,FI)?p.jsx("span",{"frimousse-loading":"",...t,children:e}):null}function eB({children:e}){let t=it(),n=mt(t,II);return e({search:n})}function eg({children:e,...t}){let n=it();return mt(n,BI)?p.jsx("span",{"frimousse-empty":"",...t,children:typeof e=="function"?p.jsx(eB,{children:e}):e}):null}function tg({children:e}){let t=Hv();return e({emoji:t})}function ng({children:e,emoji:t}){let[n,r,o]=Wv(t);return e({skinTone:n,setSkinTone:r,skinToneVariations:o})}zv.displayName="EmojiPicker.Root";Vv.displayName="EmojiPicker.Search";Kv.displayName="EmojiPicker.Viewport";Zv.displayName="EmojiPicker.List";Qv.displayName="EmojiPicker.Loading";eg.displayName="EmojiPicker.Empty";Jv.displayName="EmojiPicker.SkinToneSelector";tg.displayName="EmojiPicker.ActiveEmoji";ng.displayName="EmojiPicker.SkinTone";function tB(e){return p.jsx(Ue,{...e,children:p.jsx("path",{d:"M9 15A6 6 0 1 0 9 3a6 6 0 0 0 0 12Zm7.5 1.5-3.25-3.25"})})}function nB({emoji:e,className:t,...n}){return p.jsx("button",{className:Ae("lb-emoji-picker-emoji",t),...n,children:p.jsx(Tu,{emoji:e.emoji})})}function rB({children:e,className:t,...n}){return p.jsx("div",{className:Ae("lb-emoji-picker-row",t),...n,children:e})}function oB({category:e,className:t,...n}){return p.jsx("div",{className:Ae("lb-emoji-picker-category-header",t),...n,children:p.jsx("span",{className:"lb-emoji-picker-category-header-title",children:e.label})})}const ou=f.forwardRef(({onEmojiSelect:e,onOpenChange:t,children:n,className:r,...o},s)=>{const[a,i]=f.useState(!1),{portalContainer:u,emojibaseUrl:c}=Mr(),l=Ze(),d=f.useCallback(C=>{i(C),t?.(C)},[t]),m=f.useCallback(({emoji:C})=>{i(!1),e?.(C)},[e]),g=f.useCallback(C=>{C.stopPropagation()},[]);return p.jsxs(cI,{open:a,onOpenChange:d,children:[n,p.jsx(lI,{container:u,children:p.jsx(fI,{side:"top",align:"center",sideOffset:So,collisionPadding:qs,className:Ae("lb-root lb-portal lb-elevation lb-emoji-picker",r),...o,ref:s,asChild:!0,children:p.jsxs(Jt.Root,{onEmojiSelect:m,locale:l.locale,columns:10,emojiVersion:15.1,emojibaseUrl:c,onClick:g,children:[p.jsx("div",{className:"lb-emoji-picker-header",children:p.jsxs("div",{className:"lb-emoji-picker-search-container",children:[p.jsx(Jt.Search,{className:"lb-emoji-picker-search",placeholder:l.EMOJI_PICKER_SEARCH_PLACEHOLDER,autoFocus:!0}),p.jsx(tB,{})]})}),p.jsxs(Jt.Viewport,{className:"lb-emoji-picker-content",children:[p.jsx(Jt.Loading,{className:"lb-loading lb-emoji-picker-loading",children:p.jsx(Io,{})}),p.jsx(Jt.Empty,{className:"lb-empty lb-emoji-picker-empty",children:l.EMOJI_PICKER_EMPTY}),p.jsx(Jt.List,{className:"lb-emoji-picker-list",components:{CategoryHeader:oB,Row:rB,Emoji:nB}})]}),p.jsxs("div",{className:"lb-emoji-picker-footer",children:[p.jsx(Jt.ActiveEmoji,{children:({emoji:C})=>C?p.jsxs(p.Fragment,{children:[p.jsx("div",{className:"lb-emoji-picker-active-emoji",children:C.emoji}),p.jsx("span",{className:"lb-emoji-picker-active-emoji-label",children:C.label})]}):p.jsx("span",{className:"lb-emoji-picker-active-emoji-label lb-emoji-picker-active-emoji-label-placeholder",children:"Select an emoji…"})}),p.jsx(at,{content:l.EMOJI_PICKER_CHANGE_SKIN_TONE,children:p.jsx(Jt.SkinToneSelector,{className:"lb-button lb-emoji-picker-skin-tone-selector"})})]})]})})})]})});function sn({userId:e,replaceSelf:t,className:n,...r}){const o=Lr(),{user:s,isLoading:a}=Fh(e),i=Ze(),u=f.useMemo(()=>t&&o===e?i.USER_SELF:s?.name??i.USER_UNKNOWN,[t,o,e,i.USER_SELF,i.USER_UNKNOWN,s?.name]);return p.jsx("span",{className:Ae("lb-name lb-user",n),"data-loading":a?"":void 0,...r,children:a?null:u})}function sB({label:e,tooltipLabel:t,className:n,onClick:r,...o}){const{createMention:s}=gt(),a=f.useCallback(u=>{u.preventDefault()},[]),i=f.useCallback(u=>{r?.(u),u.isDefaultPrevented()||(u.stopPropagation(),s())},[s,r]);return p.jsx(at,{content:t??e,children:p.jsx(Dt,{className:Ae("lb-composer-editor-action",n),onPointerDown:a,onClick:i,"aria-label":e,icon:p.jsx(ZS,{}),...o})})}function aB({label:e,tooltipLabel:t,onPickerOpenChange:n,className:r,...o}){const{insertText:s}=gt(),a=f.useCallback(u=>{u.preventDefault()},[]),i=f.useCallback(u=>{u.stopPropagation()},[]);return p.jsx(ou,{onEmojiSelect:s,onOpenChange:n,children:p.jsx(at,{content:t??e,children:p.jsx(Ns,{asChild:!0,children:p.jsx(Dt,{className:Ae("lb-composer-editor-action",r),onPointerDown:a,onClick:i,"aria-label":e,icon:p.jsx(YS,{}),...o})})})})}function iB({label:e,tooltipLabel:t,className:n,...r}){const o=f.useCallback(a=>{a.preventDefault()},[]),s=f.useCallback(a=>{a.stopPropagation()},[]);return p.jsx(at,{content:t??e,children:p.jsx(SS,{asChild:!0,children:p.jsx(Dt,{className:Ae("lb-composer-editor-action",n),onPointerDown:o,onClick:s,"aria-label":e,icon:p.jsx(Um,{}),...r})})})}function uB({userId:e}){return p.jsxs(Pm,{className:"lb-composer-mention",children:[wn,p.jsx(sn,{userId:e})]})}function cB({userIds:e}){return e.length>0?p.jsx(km,{className:"lb-root lb-portal lb-elevation lb-composer-suggestions lb-composer-mention-suggestions",children:p.jsx(jm,{className:"lb-composer-suggestions-list lb-composer-mention-suggestions-list",children:e.map(t=>p.jsxs(Mm,{className:"lb-composer-suggestions-list-item lb-composer-mention-suggestion",value:t,children:[p.jsx(dc,{userId:t,className:"lb-composer-mention-suggestion-avatar"}),p.jsx(sn,{userId:t,className:"lb-composer-mention-suggestion-user"})]},t))})}):null}function ss({mark:e,icon:t,shortcut:n,children:r,...o}){const s=Ze(),a=f.useMemo(()=>s.COMPOSER_TOGGLE_MARK(e),[s,e]);return p.jsx(lc,{content:a,shortcut:n,sideOffset:So+2,children:p.jsx(TS,{mark:e,asChild:!0,...o,children:p.jsx(Dt,{"aria-label":a,variant:"toolbar",icon:t,children:r})})})}const lB={bold:()=>p.jsx(ss,{mark:"bold",shortcut:"Mod-B",icon:p.jsx(qS,{})}),italic:()=>p.jsx(ss,{mark:"italic",shortcut:"Mod-I",icon:p.jsx(XS,{})}),strikethrough:()=>p.jsx(ss,{mark:"strikethrough",shortcut:"Mod-Shift-S",icon:p.jsx(QS,{})}),code:()=>p.jsx(ss,{mark:"code",shortcut:"Mod-E",icon:p.jsx(GS,{})})},fB=Object.entries(lB).map(([e,t])=>p.jsx(t,{},e));function dB(){return p.jsx(gS,{className:"lb-root lb-portal lb-elevation lb-composer-floating-toolbar",children:fB})}function hB({href:e,children:t}){return p.jsx(Nm,{href:e,className:"lb-composer-link",children:t})}function pB({attachment:e,className:t,overrides:n,...r}){const{removeAttachment:o}=gt(),{roomId:s}=na(),a=f.useCallback(()=>{o(e.id)},[e.id,o]);return p.jsx(fc,{className:Ae("lb-composer-attachment",t),...r,attachment:e,onDeleteClick:a,preventFocusOnDelete:!0,overrides:n,roomId:s})}function mB({overrides:e,className:t,...n}){const{attachments:r}=gt();return r.length===0?null:p.jsx("div",{className:Ae("lb-composer-attachments",t),...n,children:p.jsx("div",{className:"lb-attachments",children:r.map(o=>p.jsx(pB,{attachment:o,overrides:e},o.id))})})}const vB={Mention:uB,MentionSuggestions:cB,Link:hB};function gB({showAttachments:e=!0,showFormattingControls:t=!0,showAttribution:n,defaultValue:r,isCollapsed:o,overrides:s,actions:a,autoFocus:i,disabled:u,hasResolveMentionSuggestions:c,onEmojiPickerOpenChange:l,onEmptyChange:d,onEditorClick:m}){const{isEmpty:g}=gt(),{hasMaxAttachments:C}=qu(),v=Ze(s),h=f.useMemo(()=>({...vB,FloatingToolbar:t?dB:void 0}),[t]),[E,y]=Fm({disabled:u||C});Vt(()=>{d(g)},[g,d]);const w=f.useCallback(x=>{x.preventDefault()},[]),D=f.useCallback(x=>{x.stopPropagation()},[]);return p.jsxs("div",{className:"lb-composer-editor-container",...y,children:[p.jsx(DS,{className:"lb-composer-editor",onClick:m,placeholder:v.COMPOSER_PLACEHOLDER,defaultValue:r,autoFocus:i,components:h,disabled:u,dir:v.dir}),e&&p.jsx(mB,{overrides:s}),(!o||E)&&p.jsxs("div",{className:"lb-composer-footer",children:[p.jsxs("div",{className:"lb-composer-editor-actions",children:[c&&p.jsx(sB,{label:v.COMPOSER_INSERT_MENTION,disabled:u}),p.jsx(aB,{label:v.COMPOSER_INSERT_EMOJI,onPickerOpenChange:l,disabled:u}),e&&p.jsx(iB,{label:v.COMPOSER_ATTACH_FILES,disabled:u})]}),n&&p.jsx(aR,{}),p.jsx("div",{className:"lb-composer-actions",children:a??p.jsx(p.Fragment,{children:p.jsx(lc,{content:v.COMPOSER_SEND,shortcut:"Enter",children:p.jsx(_m,{asChild:!0,children:p.jsx(Dt,{onPointerDown:w,onClick:D,className:"lb-composer-action",variant:"primary","aria-label":v.COMPOSER_SEND,icon:p.jsx(JS,{})})})})})})]}),e&&E&&p.jsx("div",{className:"lb-composer-attachments-drop-area",children:p.jsxs("div",{className:"lb-composer-attachments-drop-area-label",children:[p.jsx(Um,{}),v.COMPOSER_ATTACH_FILES]})})]})}f.createContext(null);const rg=f.forwardRef(({threadId:e,commentId:t,metadata:n,defaultValue:r,defaultAttachments:o,onComposerSubmit:s,collapsed:a,defaultCollapsed:i,onCollapsedChange:u,overrides:c,actions:l,onBlur:d,className:m,onFocus:g,autoFocus:C,disabled:v,showAttachments:h=!0,showFormattingControls:E=!0,showAttribution:y,roomId:w,...D},x)=>{const I=Mh({allowOutsideRoom:!0}),S=w!==void 0?w:I?.id;if(S===void 0)throw new Error("Composer must be a descendant of RoomProvider component");const k=Ph(S),W=Ky(S),P=Nh(S),{preventUnsavedComposerChanges:M}=Mr(),F=Au()!==void 0,B=f.useRef(!0),j=f.useRef(!1),$=Ze(c),[re,Y]=eT(a===void 0&&i===void 0?!1:a,u,i),ee=f.useSyncExternalStore(f.useCallback(_=>I===null?()=>{}:I.events.self.subscribeOnce(_),[I]),f.useCallback(()=>I?.getSelf()?.canComment??!0,[I]),f.useCallback(()=>!0,[])),L=eE(S),Q=L.size>0?L.has(Oi.CommentsWrite)||L.has(Oi.Write):ee,V=f.useCallback(_=>{B.current=_},[]),te=f.useCallback(_=>{j.current=_},[]),se=f.useCallback(_=>{g?.(_),!_.isDefaultPrevented()&&B.current&&Q&&Y?.(!1)},[Y,g,Q]),de=f.useCallback(_=>{if(d?.(_),_.isDefaultPrevented())return;!_.currentTarget.contains(_.relatedTarget??document.activeElement)&&B.current&&!j.current&&Y?.(!0)},[d,Y]),G=f.useCallback(_=>{_.stopPropagation(),B.current&&Q&&Y?.(!1)},[Y,Q]),R=f.useCallback((_,H)=>{s?.(_,H),!H.isDefaultPrevented()&&(H.stopPropagation(),t&&e?P({commentId:t,threadId:e,body:_.body,attachments:_.attachments}):e?W({threadId:e,body:_.body,attachments:_.attachments}):k({body:_.body,metadata:n??{},attachments:_.attachments}))},[t,W,k,P,n,s,e]);return p.jsx(Bo,{children:p.jsx(OS,{onComposerSubmit:R,className:Ae("lb-root lb-composer lb-composer-form",m),dir:$.dir,...D,ref:x,"data-collapsed":re?"":void 0,onFocus:se,onBlur:de,disabled:v||!Q,defaultAttachments:o,pasteFilesAsAttachments:h,preventUnsavedChanges:M,roomId:S,children:p.jsx(gB,{defaultValue:r,actions:l,overrides:c,isCollapsed:re,showAttachments:h,showAttribution:y,showFormattingControls:E,hasResolveMentionSuggestions:F,onEmptyChange:V,onEmojiPickerOpenChange:te,onEditorClick:G,autoFocus:C,disabled:v})})})});function og(e){const t=e+"CollectionProvider",[n,r]=nc(t),[o,s]=n(t,{collectionRef:{current:null},itemMap:new Map}),a=g=>{const{scope:C,children:v}=g,h=me.useRef(null),E=me.useRef(new Map).current;return p.jsx(o,{scope:C,itemMap:E,collectionRef:h,children:v})};a.displayName=t;const i=e+"CollectionSlot",u=me.forwardRef((g,C)=>{const{scope:v,children:h}=g,E=s(i,v),y=Ke(C,E.collectionRef);return p.jsx(Ne,{ref:y,children:h})});u.displayName=i;const c=e+"CollectionItemSlot",l="data-radix-collection-item",d=me.forwardRef((g,C)=>{const{scope:v,children:h,...E}=g,y=me.useRef(null),w=Ke(C,y),D=s(c,v);return me.useEffect(()=>(D.itemMap.set(y,{ref:y,...E}),()=>void D.itemMap.delete(y))),p.jsx(Ne,{[l]:"",ref:w,children:h})});d.displayName=c;function m(g){const C=s(e+"CollectionConsumer",g);return me.useCallback(()=>{const h=C.collectionRef.current;if(!h)return[];const E=Array.from(h.querySelectorAll(`[${l}]`));return Array.from(C.itemMap.values()).sort((D,x)=>E.indexOf(D.ref.current)-E.indexOf(x.ref.current))},[C.collectionRef,C.itemMap])}return[{Provider:a,Slot:u,ItemSlot:d},m,r]}var CB=f.createContext(void 0);function sg(e){const t=f.useContext(CB);return e||t||"ltr"}var bi="rovingFocusGroup.onEntryFocus",bB={bubbles:!1,cancelable:!0},pa="RovingFocusGroup",[su,ag,yB]=og(pa),[EB,ig]=nc(pa,[yB]),[DB,wB]=EB(pa),ug=f.forwardRef((e,t)=>p.jsx(su.Provider,{scope:e.__scopeRovingFocusGroup,children:p.jsx(su.Slot,{scope:e.__scopeRovingFocusGroup,children:p.jsx(AB,{...e,ref:t})})}));ug.displayName=pa;var AB=f.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:o=!1,dir:s,currentTabStopId:a,defaultCurrentTabStopId:i,onCurrentTabStopIdChange:u,onEntryFocus:c,preventScrollOnEntryFocus:l=!1,...d}=e,m=f.useRef(null),g=Ke(t,m),C=sg(s),[v=null,h]=Oo({prop:a,defaultProp:i,onChange:u}),[E,y]=f.useState(!1),w=kt(c),D=ag(n),x=f.useRef(!1),[I,S]=f.useState(0);return f.useEffect(()=>{const k=m.current;if(k)return k.addEventListener(bi,w),()=>k.removeEventListener(bi,w)},[w]),p.jsx(DB,{scope:n,orientation:r,dir:C,loop:o,currentTabStopId:v,onItemFocus:f.useCallback(k=>h(k),[h]),onItemShiftTab:f.useCallback(()=>y(!0),[]),onFocusableItemAdd:f.useCallback(()=>S(k=>k+1),[]),onFocusableItemRemove:f.useCallback(()=>S(k=>k-1),[]),children:p.jsx(He.div,{tabIndex:E||I===0?-1:0,"data-orientation":r,...d,ref:g,style:{outline:"none",...e.style},onMouseDown:ve(e.onMouseDown,()=>{x.current=!0}),onFocus:ve(e.onFocus,k=>{const W=!x.current;if(k.target===k.currentTarget&&W&&!E){const P=new CustomEvent(bi,bB);if(k.currentTarget.dispatchEvent(P),!P.defaultPrevented){const M=D().filter(re=>re.focusable),F=M.find(re=>re.active),B=M.find(re=>re.id===v),$=[F,B,...M].filter(Boolean).map(re=>re.ref.current);fg($,l)}}x.current=!1}),onBlur:ve(e.onBlur,()=>y(!1))})})}),cg="RovingFocusGroupItem",lg=f.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:o=!1,tabStopId:s,...a}=e,i=yo(),u=s||i,c=wB(cg,n),l=c.currentTabStopId===u,d=ag(n),{onFocusableItemAdd:m,onFocusableItemRemove:g}=c;return f.useEffect(()=>{if(r)return m(),()=>g()},[r,m,g]),p.jsx(su.ItemSlot,{scope:n,id:u,focusable:r,active:o,children:p.jsx(He.span,{tabIndex:l?0:-1,"data-orientation":c.orientation,...a,ref:t,onMouseDown:ve(e.onMouseDown,C=>{r?c.onItemFocus(u):C.preventDefault()}),onFocus:ve(e.onFocus,()=>c.onItemFocus(u)),onKeyDown:ve(e.onKeyDown,C=>{if(C.key==="Tab"&&C.shiftKey){c.onItemShiftTab();return}if(C.target!==C.currentTarget)return;const v=SB(C,c.orientation,c.dir);if(v!==void 0){if(C.metaKey||C.ctrlKey||C.altKey||C.shiftKey)return;C.preventDefault();let E=d().filter(y=>y.focusable).map(y=>y.ref.current);if(v==="last")E.reverse();else if(v==="prev"||v==="next"){v==="prev"&&E.reverse();const y=E.indexOf(C.currentTarget);E=c.loop?TB(E,y+1):E.slice(y+1)}setTimeout(()=>fg(E))}})})})});lg.displayName=cg;var xB={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function OB(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function SB(e,t,n){const r=OB(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return xB[r]}function fg(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function TB(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var RB=ug,IB=lg,au=["Enter"," "],BB=["ArrowDown","PageUp","Home"],dg=["ArrowUp","PageDown","End"],FB=[...BB,...dg],PB={ltr:[...au,"ArrowRight"],rtl:[...au,"ArrowLeft"]},NB={ltr:["ArrowLeft"],rtl:["ArrowRight"]},No="Menu",[Eo,kB,jB]=og(No),[er,hg]=aa(No,[jB,$r,ig]),ma=$r(),pg=ig(),[MB,tr]=er(No),[_B,ko]=er(No),mg=e=>{const{__scopeMenu:t,open:n=!1,children:r,dir:o,onOpenChange:s,modal:a=!0}=e,i=ma(t),[u,c]=f.useState(null),l=f.useRef(!1),d=kt(s),m=sg(o);return f.useEffect(()=>{const g=()=>{l.current=!0,document.addEventListener("pointerdown",C,{capture:!0,once:!0}),document.addEventListener("pointermove",C,{capture:!0,once:!0})},C=()=>l.current=!1;return document.addEventListener("keydown",g,{capture:!0}),()=>{document.removeEventListener("keydown",g,{capture:!0}),document.removeEventListener("pointerdown",C,{capture:!0}),document.removeEventListener("pointermove",C,{capture:!0})}},[]),p.jsx(sc,{...i,children:p.jsx(MB,{scope:t,open:n,onOpenChange:d,content:u,onContentChange:c,children:p.jsx(_B,{scope:t,onClose:f.useCallback(()=>d(!1),[d]),isUsingKeyboardRef:l,dir:m,modal:a,children:r})})})};mg.displayName=No;var LB="MenuAnchor",Ec=f.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,o=ma(n);return p.jsx(ua,{...o,...r,ref:t})});Ec.displayName=LB;var Dc="MenuPortal",[$B,vg]=er(Dc,{forceMount:void 0}),gg=e=>{const{__scopeMenu:t,forceMount:n,children:r,container:o}=e,s=tr(Dc,t);return p.jsx($B,{scope:t,forceMount:n,children:p.jsx(un,{present:n||s.open,children:p.jsx(ca,{asChild:!0,container:o,children:r})})})};gg.displayName=Dc;var xt="MenuContent",[UB,wc]=er(xt),Cg=f.forwardRef((e,t)=>{const n=vg(xt,e.__scopeMenu),{forceMount:r=n.forceMount,...o}=e,s=tr(xt,e.__scopeMenu),a=ko(xt,e.__scopeMenu);return p.jsx(Eo.Provider,{scope:e.__scopeMenu,children:p.jsx(un,{present:r||s.open,children:p.jsx(Eo.Slot,{scope:e.__scopeMenu,children:a.modal?p.jsx(HB,{...o,ref:t}):p.jsx(WB,{...o,ref:t})})})})}),HB=f.forwardRef((e,t)=>{const n=tr(xt,e.__scopeMenu),r=f.useRef(null),o=Ke(t,r);return f.useEffect(()=>{const s=r.current;if(s)return gv(s)},[]),p.jsx(Ac,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:ve(e.onFocusOutside,s=>s.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),WB=f.forwardRef((e,t)=>{const n=tr(xt,e.__scopeMenu);return p.jsx(Ac,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),Ac=f.forwardRef((e,t)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:o,onOpenAutoFocus:s,onCloseAutoFocus:a,disableOutsidePointerEvents:i,onEntryFocus:u,onEscapeKeyDown:c,onPointerDownOutside:l,onFocusOutside:d,onInteractOutside:m,onDismiss:g,disableOutsideScroll:C,...v}=e,h=tr(xt,n),E=ko(xt,n),y=ma(n),w=pg(n),D=kB(n),[x,I]=f.useState(null),S=f.useRef(null),k=Ke(t,S,h.onContentChange),W=f.useRef(0),P=f.useRef(""),M=f.useRef(0),F=f.useRef(null),B=f.useRef("right"),j=f.useRef(0),$=C?mc:f.Fragment,re=C?{as:Ne,allowPinchZoom:!0}:void 0,Y=L=>{const Q=P.current+L,V=D().filter(_=>!_.disabled),te=document.activeElement,se=V.find(_=>_.ref.current===te)?.textValue,de=V.map(_=>_.textValue),G=tF(de,Q,se),R=V.find(_=>_.textValue===G)?.ref.current;(function _(H){P.current=H,window.clearTimeout(W.current),H!==""&&(W.current=window.setTimeout(()=>_(""),1e3))})(Q),R&&setTimeout(()=>R.focus())};f.useEffect(()=>()=>window.clearTimeout(W.current),[]),pv();const ee=f.useCallback(L=>B.current===F.current?.side&&rF(L,F.current?.area),[]);return p.jsx(UB,{scope:n,searchRef:P,onItemEnter:f.useCallback(L=>{ee(L)&&L.preventDefault()},[ee]),onItemLeave:f.useCallback(L=>{ee(L)||(S.current?.focus(),I(null))},[ee]),onTriggerLeave:f.useCallback(L=>{ee(L)&&L.preventDefault()},[ee]),pointerGraceTimerRef:M,onPointerGraceIntentChange:f.useCallback(L=>{F.current=L},[]),children:p.jsx($,{...re,children:p.jsx(pc,{asChild:!0,trapped:o,onMountAutoFocus:ve(s,L=>{L.preventDefault(),S.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:a,children:p.jsx(ia,{asChild:!0,disableOutsidePointerEvents:i,onEscapeKeyDown:c,onPointerDownOutside:l,onFocusOutside:d,onInteractOutside:m,onDismiss:g,children:p.jsx(RB,{asChild:!0,...w,dir:E.dir,orientation:"vertical",loop:r,currentTabStopId:x,onCurrentTabStopIdChange:I,onEntryFocus:ve(u,L=>{E.isUsingKeyboardRef.current||L.preventDefault()}),preventScrollOnEntryFocus:!0,children:p.jsx(ac,{role:"menu","aria-orientation":"vertical","data-state":Ng(h.open),"data-radix-menu-content":"",dir:E.dir,...y,...v,ref:k,style:{outline:"none",...v.style},onKeyDown:ve(v.onKeyDown,L=>{const V=L.target.closest("[data-radix-menu-content]")===L.currentTarget,te=L.ctrlKey||L.altKey||L.metaKey,se=L.key.length===1;V&&(L.key==="Tab"&&L.preventDefault(),!te&&se&&Y(L.key));const de=S.current;if(L.target!==de||!FB.includes(L.key))return;L.preventDefault();const R=D().filter(_=>!_.disabled).map(_=>_.ref.current);dg.includes(L.key)&&R.reverse(),QB(R)}),onBlur:ve(e.onBlur,L=>{L.currentTarget.contains(L.target)||(window.clearTimeout(W.current),P.current="")}),onPointerMove:ve(e.onPointerMove,Do(L=>{const Q=L.target,V=j.current!==L.clientX;if(L.currentTarget.contains(Q)&&V){const te=L.clientX>j.current?"right":"left";B.current=te,j.current=L.clientX}}))})})})})})})});Cg.displayName=xt;var zB="MenuGroup",xc=f.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return p.jsx(He.div,{role:"group",...r,ref:t})});xc.displayName=zB;var VB="MenuLabel",bg=f.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return p.jsx(He.div,{...r,ref:t})});bg.displayName=VB;var ks="MenuItem",Ud="menu.itemSelect",va=f.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:r,...o}=e,s=f.useRef(null),a=ko(ks,e.__scopeMenu),i=wc(ks,e.__scopeMenu),u=Ke(t,s),c=f.useRef(!1),l=()=>{const d=s.current;if(!n&&d){const m=new CustomEvent(Ud,{bubbles:!0,cancelable:!0});d.addEventListener(Ud,g=>r?.(g),{once:!0}),_h(d,m),m.defaultPrevented?c.current=!1:a.onClose()}};return p.jsx(yg,{...o,ref:u,disabled:n,onClick:ve(e.onClick,l),onPointerDown:d=>{e.onPointerDown?.(d),c.current=!0},onPointerUp:ve(e.onPointerUp,d=>{c.current||d.currentTarget?.click()}),onKeyDown:ve(e.onKeyDown,d=>{const m=i.searchRef.current!=="";n||m&&d.key===" "||au.includes(d.key)&&(d.currentTarget.click(),d.preventDefault())})})});va.displayName=ks;var yg=f.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:r=!1,textValue:o,...s}=e,a=wc(ks,n),i=pg(n),u=f.useRef(null),c=Ke(t,u),[l,d]=f.useState(!1),[m,g]=f.useState("");return f.useEffect(()=>{const C=u.current;C&&g((C.textContent??"").trim())},[s.children]),p.jsx(Eo.ItemSlot,{scope:n,disabled:r,textValue:o??m,children:p.jsx(IB,{asChild:!0,...i,focusable:!r,children:p.jsx(He.div,{role:"menuitem","data-highlighted":l?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...s,ref:c,onPointerMove:ve(e.onPointerMove,Do(C=>{r?a.onItemLeave(C):(a.onItemEnter(C),C.defaultPrevented||C.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:ve(e.onPointerLeave,Do(C=>a.onItemLeave(C))),onFocus:ve(e.onFocus,()=>d(!0)),onBlur:ve(e.onBlur,()=>d(!1))})})})}),KB="MenuCheckboxItem",Eg=f.forwardRef((e,t)=>{const{checked:n=!1,onCheckedChange:r,...o}=e;return p.jsx(Og,{scope:e.__scopeMenu,checked:n,children:p.jsx(va,{role:"menuitemcheckbox","aria-checked":js(n)?"mixed":n,...o,ref:t,"data-state":Sc(n),onSelect:ve(o.onSelect,()=>r?.(js(n)?!0:!n),{checkForDefaultPrevented:!1})})})});Eg.displayName=KB;var Dg="MenuRadioGroup",[qB,GB]=er(Dg,{value:void 0,onValueChange:()=>{}}),wg=f.forwardRef((e,t)=>{const{value:n,onValueChange:r,...o}=e,s=kt(r);return p.jsx(qB,{scope:e.__scopeMenu,value:n,onValueChange:s,children:p.jsx(xc,{...o,ref:t})})});wg.displayName=Dg;var Ag="MenuRadioItem",xg=f.forwardRef((e,t)=>{const{value:n,...r}=e,o=GB(Ag,e.__scopeMenu),s=n===o.value;return p.jsx(Og,{scope:e.__scopeMenu,checked:s,children:p.jsx(va,{role:"menuitemradio","aria-checked":s,...r,ref:t,"data-state":Sc(s),onSelect:ve(r.onSelect,()=>o.onValueChange?.(n),{checkForDefaultPrevented:!1})})})});xg.displayName=Ag;var Oc="MenuItemIndicator",[Og,YB]=er(Oc,{checked:!1}),Sg=f.forwardRef((e,t)=>{const{__scopeMenu:n,forceMount:r,...o}=e,s=YB(Oc,n);return p.jsx(un,{present:r||js(s.checked)||s.checked===!0,children:p.jsx(He.span,{...o,ref:t,"data-state":Sc(s.checked)})})});Sg.displayName=Oc;var XB="MenuSeparator",Tg=f.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return p.jsx(He.div,{role:"separator","aria-orientation":"horizontal",...r,ref:t})});Tg.displayName=XB;var ZB="MenuArrow",Rg=f.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,o=ma(n);return p.jsx(ic,{...o,...r,ref:t})});Rg.displayName=ZB;var JB="MenuSub",[yP,Ig]=er(JB),Gr="MenuSubTrigger",Bg=f.forwardRef((e,t)=>{const n=tr(Gr,e.__scopeMenu),r=ko(Gr,e.__scopeMenu),o=Ig(Gr,e.__scopeMenu),s=wc(Gr,e.__scopeMenu),a=f.useRef(null),{pointerGraceTimerRef:i,onPointerGraceIntentChange:u}=s,c={__scopeMenu:e.__scopeMenu},l=f.useCallback(()=>{a.current&&window.clearTimeout(a.current),a.current=null},[]);return f.useEffect(()=>l,[l]),f.useEffect(()=>{const d=i.current;return()=>{window.clearTimeout(d),u(null)}},[i,u]),p.jsx(Ec,{asChild:!0,...c,children:p.jsx(yg,{id:o.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":o.contentId,"data-state":Ng(n.open),...e,ref:Ks(t,o.onTriggerChange),onClick:d=>{e.onClick?.(d),!(e.disabled||d.defaultPrevented)&&(d.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:ve(e.onPointerMove,Do(d=>{s.onItemEnter(d),!d.defaultPrevented&&!e.disabled&&!n.open&&!a.current&&(s.onPointerGraceIntentChange(null),a.current=window.setTimeout(()=>{n.onOpenChange(!0),l()},100))})),onPointerLeave:ve(e.onPointerLeave,Do(d=>{l();const m=n.content?.getBoundingClientRect();if(m){const g=n.content?.dataset.side,C=g==="right",v=C?-5:5,h=m[C?"left":"right"],E=m[C?"right":"left"];s.onPointerGraceIntentChange({area:[{x:d.clientX+v,y:d.clientY},{x:h,y:m.top},{x:E,y:m.top},{x:E,y:m.bottom},{x:h,y:m.bottom}],side:g}),window.clearTimeout(i.current),i.current=window.setTimeout(()=>s.onPointerGraceIntentChange(null),300)}else{if(s.onTriggerLeave(d),d.defaultPrevented)return;s.onPointerGraceIntentChange(null)}})),onKeyDown:ve(e.onKeyDown,d=>{const m=s.searchRef.current!=="";e.disabled||m&&d.key===" "||PB[r.dir].includes(d.key)&&(n.onOpenChange(!0),n.content?.focus(),d.preventDefault())})})})});Bg.displayName=Gr;var Fg="MenuSubContent",Pg=f.forwardRef((e,t)=>{const n=vg(xt,e.__scopeMenu),{forceMount:r=n.forceMount,...o}=e,s=tr(xt,e.__scopeMenu),a=ko(xt,e.__scopeMenu),i=Ig(Fg,e.__scopeMenu),u=f.useRef(null),c=Ke(t,u);return p.jsx(Eo.Provider,{scope:e.__scopeMenu,children:p.jsx(un,{present:r||s.open,children:p.jsx(Eo.Slot,{scope:e.__scopeMenu,children:p.jsx(Ac,{id:i.contentId,"aria-labelledby":i.triggerId,...o,ref:c,align:"start",side:a.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:l=>{a.isUsingKeyboardRef.current&&u.current?.focus(),l.preventDefault()},onCloseAutoFocus:l=>l.preventDefault(),onFocusOutside:ve(e.onFocusOutside,l=>{l.target!==i.trigger&&s.onOpenChange(!1)}),onEscapeKeyDown:ve(e.onEscapeKeyDown,l=>{a.onClose(),l.preventDefault()}),onKeyDown:ve(e.onKeyDown,l=>{const d=l.currentTarget.contains(l.target),m=NB[a.dir].includes(l.key);d&&m&&(s.onOpenChange(!1),i.trigger?.focus(),l.preventDefault())})})})})})});Pg.displayName=Fg;function Ng(e){return e?"open":"closed"}function js(e){return e==="indeterminate"}function Sc(e){return js(e)?"indeterminate":e?"checked":"unchecked"}function QB(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function eF(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function tF(e,t,n){const o=t.length>1&&Array.from(t).every(c=>c===t[0])?t[0]:t,s=n?e.indexOf(n):-1;let a=eF(e,Math.max(s,0));o.length===1&&(a=a.filter(c=>c!==n));const u=a.find(c=>c.toLowerCase().startsWith(o.toLowerCase()));return u!==n?u:void 0}function nF(e,t){const{x:n,y:r}=e;let o=!1;for(let s=0,a=t.length-1;s<t.length;a=s++){const i=t[s].x,u=t[s].y,c=t[a].x,l=t[a].y;u>r!=l>r&&n<(c-i)*(r-u)/(l-u)+i&&(o=!o)}return o}function rF(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return nF(n,t)}function Do(e){return t=>t.pointerType==="mouse"?e(t):void 0}var oF=mg,sF=Ec,aF=gg,iF=Cg,uF=xc,cF=bg,lF=va,fF=Eg,dF=wg,hF=xg,pF=Sg,mF=Tg,vF=Rg,gF=Bg,CF=Pg,Tc="DropdownMenu",[bF]=aa(Tc,[hg]),ot=hg(),[yF,kg]=bF(Tc),jg=e=>{const{__scopeDropdownMenu:t,children:n,dir:r,open:o,defaultOpen:s,onOpenChange:a,modal:i=!0}=e,u=ot(t),c=f.useRef(null),[l=!1,d]=Oo({prop:o,defaultProp:s,onChange:a});return p.jsx(yF,{scope:t,triggerId:yo(),triggerRef:c,contentId:yo(),open:l,onOpenChange:d,onOpenToggle:f.useCallback(()=>d(m=>!m),[d]),modal:i,children:p.jsx(oF,{...u,open:l,onOpenChange:d,dir:r,modal:i,children:n})})};jg.displayName=Tc;var Mg="DropdownMenuTrigger",Rc=f.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,disabled:r=!1,...o}=e,s=kg(Mg,n),a=ot(n);return p.jsx(sF,{asChild:!0,...a,children:p.jsx(He.button,{type:"button",id:s.triggerId,"aria-haspopup":"menu","aria-expanded":s.open,"aria-controls":s.open?s.contentId:void 0,"data-state":s.open?"open":"closed","data-disabled":r?"":void 0,disabled:r,...o,ref:Ks(t,s.triggerRef),onPointerDown:ve(e.onPointerDown,i=>{!r&&i.button===0&&i.ctrlKey===!1&&(s.onOpenToggle(),s.open||i.preventDefault())}),onKeyDown:ve(e.onKeyDown,i=>{r||(["Enter"," "].includes(i.key)&&s.onOpenToggle(),i.key==="ArrowDown"&&s.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(i.key)&&i.preventDefault())})})})});Rc.displayName=Mg;var EF="DropdownMenuPortal",_g=e=>{const{__scopeDropdownMenu:t,...n}=e,r=ot(t);return p.jsx(aF,{...r,...n})};_g.displayName=EF;var Lg="DropdownMenuContent",$g=f.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=kg(Lg,n),s=ot(n),a=f.useRef(!1);return p.jsx(iF,{id:o.contentId,"aria-labelledby":o.triggerId,...s,...r,ref:t,onCloseAutoFocus:ve(e.onCloseAutoFocus,i=>{a.current||o.triggerRef.current?.focus(),a.current=!1,i.preventDefault()}),onInteractOutside:ve(e.onInteractOutside,i=>{const u=i.detail.originalEvent,c=u.button===0&&u.ctrlKey===!0,l=u.button===2||c;(!o.modal||l)&&(a.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});$g.displayName=Lg;var DF="DropdownMenuGroup",wF=f.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=ot(n);return p.jsx(uF,{...o,...r,ref:t})});wF.displayName=DF;var AF="DropdownMenuLabel",xF=f.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=ot(n);return p.jsx(cF,{...o,...r,ref:t})});xF.displayName=AF;var OF="DropdownMenuItem",Ug=f.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=ot(n);return p.jsx(lF,{...o,...r,ref:t})});Ug.displayName=OF;var SF="DropdownMenuCheckboxItem",TF=f.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=ot(n);return p.jsx(fF,{...o,...r,ref:t})});TF.displayName=SF;var RF="DropdownMenuRadioGroup",IF=f.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=ot(n);return p.jsx(dF,{...o,...r,ref:t})});IF.displayName=RF;var BF="DropdownMenuRadioItem",FF=f.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=ot(n);return p.jsx(hF,{...o,...r,ref:t})});FF.displayName=BF;var PF="DropdownMenuItemIndicator",NF=f.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=ot(n);return p.jsx(pF,{...o,...r,ref:t})});NF.displayName=PF;var kF="DropdownMenuSeparator",jF=f.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=ot(n);return p.jsx(mF,{...o,...r,ref:t})});jF.displayName=kF;var MF="DropdownMenuArrow",_F=f.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=ot(n);return p.jsx(vF,{...o,...r,ref:t})});_F.displayName=MF;var LF="DropdownMenuSubTrigger",$F=f.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=ot(n);return p.jsx(gF,{...o,...r,ref:t})});$F.displayName=LF;var UF="DropdownMenuSubContent",HF=f.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=ot(n);return p.jsx(CF,{...o,...r,ref:t,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});HF.displayName=UF;var WF=jg,zF=_g,VF=$g;function Hg({children:e,content:t,defaultOpen:n,open:r,onOpenChange:o,className:s,...a}){const i=Ze(),{portalContainer:u}=Mr();return p.jsxs(WF,{defaultOpen:n,open:r,onOpenChange:o,dir:i.dir,children:[e,p.jsx(zF,{container:u,children:p.jsx(VF,{className:Ae("lb-root lb-portal lb-elevation lb-dropdown",s),sideOffset:So,collisionPadding:qs,...a,children:t})})]})}const Ms=f.forwardRef(({children:e,className:t,icon:n,...r},o)=>p.jsxs(Ug,{className:Ae("lb-dropdown-item",t),...r,ref:o,children:[n?p.jsx("span",{className:"lb-dropdown-item-icon lb-icon-container",children:n}):null,e?p.jsx("span",{className:"lb-dropdown-item-label",children:e}):null]})),Wg=f.forwardRef(({values:e,formatRemaining:t,truncate:n,locale:r,className:o,asChild:s,...a},i)=>{const u=s?Ne:"span",c=Ze(),l=t??c.LIST_REMAINING,d=f.useMemo(()=>{const m=n&&n<e.length-1?[...e.slice(0,n),l(e.length-n)]:[...e],g=Array(m.length).fill(".");return RS(r).formatToParts(g).map(v=>v.type==="element"?m.shift():v.value)},[l,r,n,e]);return p.jsx(u,{className:Ae("lb-list",o),...a,ref:i,children:d})}),KF=5;function zg({userId:e,className:t,...n}){const r=Lr();return p.jsxs(sp,{className:Ae("lb-comment-mention",t),"data-self":e===r?"":void 0,...n,children:[wn,p.jsx(sn,{userId:e})]})}function qF({href:e,children:t,className:n,...r}){return p.jsx(ap,{className:Ae("lb-comment-link",n),href:e,...r,children:t})}function GF({href:e,children:t,className:n,...r}){return p.jsx("span",{className:Ae("lb-comment-link",n),...r,children:t})}const Vg=f.forwardRef(({reaction:e,overrides:t,className:n,...r},o)=>{const s=Ze(t);return p.jsxs(hc,{className:Ae("lb-comment-reaction",n),variant:"outline","aria-label":s.COMMENT_REACTION_DESCRIPTION(e.emoji,e.users.length),...r,ref:o,children:[p.jsx(Tu,{className:"lb-comment-reaction-emoji",emoji:e.emoji}),p.jsx("span",{className:"lb-comment-reaction-count",children:e.users.length})]})}),YF=f.forwardRef(({comment:e,reaction:t,overrides:n,disabled:r,...o},s)=>{const a=kh(e.roomId),i=jh(e.roomId),u=Lr(),c=f.useMemo(()=>t.users.some(C=>C.id===u),[u,t]),l=Ze(n),d=f.useMemo(()=>p.jsx("span",{children:l.COMMENT_REACTION_LIST(p.jsx(Wg,{values:t.users.map(C=>p.jsx(sn,{userId:C.id,replaceSelf:!0},C.id)),formatRemaining:l.LIST_REMAINING_USERS,truncate:KF,locale:l.locale}),t.emoji,t.users.length)}),[l,t]),m=f.useCallback(C=>{C.stopPropagation()},[]),g=f.useCallback(C=>{C?a({threadId:e.threadId,commentId:e.id,emoji:t.emoji}):i({threadId:e.threadId,commentId:e.id,emoji:t.emoji})},[a,e.threadId,e.id,t.emoji,i]);return p.jsx(at,{content:d,multiline:!0,className:"lb-comment-reaction-tooltip",children:p.jsx(Ou,{asChild:!0,pressed:c,onPressedChange:g,onClick:m,disabled:r,ref:s,children:p.jsx(Vg,{"data-self":c?"":void 0,reaction:t,overrides:n,...o})})})}),XF=f.forwardRef(({reaction:e,overrides:t,...n},r)=>{const o=Lr(),s=f.useMemo(()=>e.users.some(a=>a.id===o),[o,e]);return p.jsx(Vg,{disableable:!1,"data-self":s?"":void 0,reaction:e,overrides:t,...n,ref:r})});function Kg({attachment:e,url:t}){e.mimeType==="application/pdf"||e.mimeType.startsWith("image/")||e.mimeType.startsWith("video/")||e.mimeType.startsWith("audio/")?window.open(t,"_blank"):$S(t,e.name)}function ZF({attachment:e,onAttachmentClick:t,roomId:n,className:r,overrides:o,...s}){const{url:a}=Vs(e.id,n),i=f.useCallback(u=>{if(!a)return;const c={attachment:e,url:a};t?.(c,u),!u.isDefaultPrevented()&&Kg(c)},[e,t,a]);return p.jsx(oR,{className:Ae("lb-comment-attachment",r),...s,attachment:e,overrides:o,onClick:a?i:void 0,roomId:n})}function JF({attachment:e,onAttachmentClick:t,roomId:n,className:r,overrides:o,...s}){const{url:a}=Vs(e.id,n),i=f.useCallback(u=>{if(!a)return;const c={attachment:e,url:a};t?.(c,u),!u.isDefaultPrevented()&&Kg(c)},[e,t,a]);return p.jsx(fc,{className:Ae("lb-comment-attachment",r),...s,attachment:e,overrides:o,onClick:a?i:void 0,roomId:n})}function QF({className:e,...t}){return p.jsx(fc,{className:Ae("lb-comment-attachment",e),allowMediaPreview:!1,...t})}function eP({threadId:e,roomId:t,commentRef:n}){const r=Gy(t),o=KS();return HS(n,()=>{r(e)},{enabled:o}),null}const tP=f.forwardRef(({comment:e,indentContent:t=!0,showDeleted:n,showActions:r="hover",showReactions:o=!0,showAttachments:s=!0,showComposerFormattingControls:a=!0,onAuthorClick:i,onMentionClick:u,onAttachmentClick:c,onCommentEdit:l,onCommentDelete:d,overrides:m,className:g,additionalActions:C,additionalActionsClassName:v,autoMarkReadThreadId:h,...E},y)=>{const w=f.useRef(null),D=To(y,w),x=Lr(),I=qy(e.roomId),S=Nh(e.roomId),k=kh(e.roomId),W=jh(e.roomId),P=Ze(m),[M,F]=f.useState(!1),[B,j]=f.useState(!1),[$,re]=f.useState(!1),[Y,ee]=f.useState(!1),{mediaAttachments:L,fileAttachments:Q}=f.useMemo(()=>sR(e.attachments),[e.attachments]),V=f.useCallback(H=>{H.stopPropagation()},[]),te=f.useCallback(()=>{F(!0)},[]),se=f.useCallback(H=>{H.stopPropagation(),F(!1)},[]),de=f.useCallback(({body:H,attachments:X},fe)=>{l?.(e),!fe.isDefaultPrevented()&&(fe.stopPropagation(),fe.preventDefault(),F(!1),S({commentId:e.id,threadId:e.threadId,body:H,attachments:X}))},[e,S,l]),G=f.useCallback(()=>{d?.(e),I({commentId:e.id,threadId:e.threadId})},[e,I,d]),R=f.useCallback(H=>{i?.(e.userId,H)},[e.userId,i]),_=f.useCallback(H=>{const X=e.reactions.findIndex(fe=>fe.emoji===H);X>=0&&x&&e.reactions[X]?.users.some(fe=>fe.id===x)?W({threadId:e.threadId,commentId:e.id,emoji:H}):k({threadId:e.threadId,commentId:e.id,emoji:H})},[k,e.id,e.reactions,e.threadId,W,x]);return f.useEffect(()=>{if(!(typeof window<"u"))return;window.location.hash.slice(1)===e.id&&j(!0)},[]),!n&&!e.body?null:p.jsxs(Bo,{children:[h&&p.jsx(eP,{commentRef:w,threadId:h,roomId:e.roomId}),p.jsxs("div",{id:e.id,className:Ae("lb-root lb-comment",t&&"lb-comment:indent-content",r==="hover"&&"lb-comment:show-actions-hover",($||Y)&&"lb-comment:action-open",g),"data-deleted":e.body?void 0:"","data-editing":M?"":void 0,"data-target":B?"":void 0,dir:P.dir,...E,ref:D,children:[p.jsxs("div",{className:"lb-comment-header",children:[p.jsxs("div",{className:"lb-comment-details",children:[p.jsx(dc,{className:"lb-comment-avatar",userId:e.userId,onClick:R}),p.jsxs("span",{className:"lb-comment-details-labels",children:[p.jsx(sn,{className:"lb-comment-author",userId:e.userId,onClick:R}),p.jsxs("span",{className:"lb-comment-date",children:[p.jsx($m,{locale:P.locale,date:e.createdAt,className:"lb-date lb-comment-date-created"}),e.editedAt&&e.body&&p.jsxs(p.Fragment,{children:[" ",p.jsx("span",{className:"lb-comment-date-edited",children:P.COMMENT_EDITED})]})]})]})]}),r&&!M&&p.jsxs("div",{className:Ae("lb-comment-actions",v),children:[C??null,o&&p.jsx(ou,{onEmojiSelect:_,onOpenChange:ee,children:p.jsx(at,{content:P.COMMENT_ADD_REACTION,children:p.jsx(Ns,{asChild:!0,children:p.jsx(Dt,{className:"lb-comment-action",onClick:V,"aria-label":P.COMMENT_ADD_REACTION,icon:p.jsx(yl,{})})})})}),e.userId===x&&p.jsx(Hg,{open:$,onOpenChange:re,align:"end",content:p.jsxs(p.Fragment,{children:[p.jsx(Ms,{onSelect:te,onClick:V,icon:p.jsx(lE,{}),children:P.COMMENT_EDIT}),p.jsx(Ms,{onSelect:G,onClick:V,icon:p.jsx(Uh,{}),children:P.COMMENT_DELETE})]}),children:p.jsx(at,{content:P.COMMENT_MORE,children:p.jsx(Rc,{asChild:!0,children:p.jsx(Dt,{className:"lb-comment-action",disabled:!e.body,onClick:V,"aria-label":P.COMMENT_MORE,icon:p.jsx(Hh,{})})})})})]})]}),p.jsx("div",{className:"lb-comment-content",children:M?p.jsx(rg,{className:"lb-comment-composer",onComposerSubmit:de,defaultValue:e.body,defaultAttachments:e.attachments,autoFocus:!0,showAttribution:!1,showAttachments:s,showFormattingControls:a,actions:p.jsxs(p.Fragment,{children:[p.jsx(at,{content:P.COMMENT_EDIT_COMPOSER_CANCEL,"aria-label":P.COMMENT_EDIT_COMPOSER_CANCEL,children:p.jsx(Dt,{className:"lb-composer-action",onClick:se,icon:p.jsx(Su,{})})}),p.jsx(lc,{content:P.COMMENT_EDIT_COMPOSER_SAVE,shortcut:"Enter",children:p.jsx(_m,{asChild:!0,children:p.jsx(Dt,{variant:"primary",className:"lb-composer-action",onClick:V,"aria-label":P.COMMENT_EDIT_COMPOSER_SAVE,icon:p.jsx($h,{})})})})]}),overrides:{COMPOSER_PLACEHOLDER:P.COMMENT_EDIT_COMPOSER_PLACEHOLDER},roomId:e.roomId}):e.body?p.jsxs(p.Fragment,{children:[p.jsx(ip,{className:"lb-comment-body",body:e.body,components:{Mention:({userId:H})=>p.jsx(zg,{userId:H,onClick:X=>u?.(H,X)}),Link:qF}}),s&&(L.length>0||Q.length>0)?p.jsxs("div",{className:"lb-comment-attachments",children:[L.length>0?p.jsx("div",{className:"lb-attachments",children:L.map(H=>p.jsx(ZF,{attachment:H,overrides:m,onAttachmentClick:c,roomId:e.roomId},H.id))}):null,Q.length>0?p.jsx("div",{className:"lb-attachments",children:Q.map(H=>p.jsx(JF,{attachment:H,overrides:m,onAttachmentClick:c,roomId:e.roomId},H.id))}):null]}):null,o&&e.reactions.length>0&&p.jsxs("div",{className:"lb-comment-reactions",children:[e.reactions.map(H=>p.jsx(YF,{comment:e,reaction:H,overrides:m},H.emoji)),p.jsx(ou,{onEmojiSelect:_,children:p.jsx(at,{content:P.COMMENT_ADD_REACTION,children:p.jsx(Ns,{asChild:!0,children:p.jsx(Dt,{className:"lb-comment-reaction lb-comment-reaction-add",variant:"outline",onClick:V,"aria-label":P.COMMENT_ADD_REACTION,icon:p.jsx(yl,{})})})})})]})]}):p.jsx("div",{className:"lb-comment-body",children:p.jsx("p",{className:"lb-comment-deleted",children:P.COMMENT_DELETED})})})]})]})}),Hd="https://localhost:9999",nP=/^[a-zA-Z][a-zA-Z\d+\-.]*?:/;function qg(e,t,n){const r=nP.test(e),o=new URL(e,r?void 0:Hd);return!o.hash&&n!==void 0&&(o.hash=`#${n}`),r?o.href:o.href.replace(Hd,"")}const iu=3;function Wd({comment:e,showHeader:t=!0,showAttachments:n=!0,showReactions:r=!0,overrides:o,className:s,...a}){const i=Ze(o);return p.jsxs("div",{className:Ae("lb-root lb-inbox-notification-comment lb-comment",s),...a,children:[t&&p.jsx("div",{className:"lb-comment-header",children:p.jsx(sn,{className:"lb-comment-author",userId:e.userId})}),p.jsx("div",{className:"lb-comment-content",children:e.body?p.jsxs(p.Fragment,{children:[p.jsx(ip,{className:"lb-comment-body",body:e.body,components:{Mention:zg,Link:GF}}),r&&e.reactions.length>0&&p.jsx("div",{className:"lb-comment-reactions",children:e.reactions.map(u=>p.jsx(XF,{reaction:u,overrides:o,disabled:!0},u.emoji))}),n&&e.attachments.length>0?p.jsx("div",{className:"lb-comment-attachments",children:p.jsx("div",{className:"lb-attachments",children:e.attachments.map(u=>p.jsx(QF,{attachment:u,overrides:o,roomId:e.roomId},u.id))})}):null]}):p.jsx("div",{className:"lb-comment-body",children:p.jsx("p",{className:"lb-comment-deleted",children:i.COMMENT_DELETED})})})]})}function rP(e,t){if(e.length)for(let n=e.length-1;n>=0;n--){const r=e[n];if(r.userId!==t&&r.body&&kb(r.body).includes(t))return r}}function zd(e){return Array.from(new Set(e.map(t=>t.userId)))}function oP(e,t,n){const r=t.comments.filter(a=>a.body?e.readAt?a.createdAt>e.readAt&&a.createdAt<=e.notifiedAt:a.createdAt<=e.notifiedAt:!1);if(r.length===0){const a=t.comments.filter(i=>i.body).slice(-iu);return{type:"comments",unread:!1,comments:a,userIds:zd(a),date:e.notifiedAt}}const o=rP(r,n);return o?{type:"mention",unread:!0,comments:[o],userIds:[o.userId],date:o.createdAt}:{type:"comments",unread:!0,comments:r.slice(-iu),userIds:zd(r),date:e.notifiedAt}}function uu({roomId:e,className:t,...n}){const{info:r,isLoading:o}=Du(e),s=f.useMemo(()=>r?.name??e,[r?.name,e]);return p.jsx("span",{className:Ae("lb-name lb-room",t),"data-loading":o?"":void 0,...n,children:o?null:s})}const Ic=f.forwardRef(({inboxNotification:e,children:t,aside:n,title:r,date:o,unread:s,markAsReadOnClick:a,onClick:i,href:u,showActions:c,overrides:l,components:d,className:m,asChild:g,...C},v)=>{const h=Ze(l),{Anchor:E}=lx(d),y=g?Ne:E,[w,D]=f.useState(!1),x=Py(),I=Ny(),S=f.useCallback(B=>{i?.(B),s&&(a??!!u)&&x(e.id)},[u,e.id,a,x,i,s]),k=f.useCallback(B=>{B.stopPropagation()},[]),W=f.useCallback(B=>{B.preventDefault(),B.stopPropagation()},[]),P=f.useCallback(B=>{B.preventDefault(),B.stopPropagation(),D(j=>!j)},[]),M=f.useCallback(()=>{x(e.id)},[e.id,x]),F=f.useCallback(()=>{I(e.id)},[e.id,I]);return p.jsx(Bo,{children:p.jsxs(y,{className:Ae("lb-root lb-inbox-notification",c==="hover"&&"lb-inbox-notification:show-actions-hover",w&&"lb-inbox-notification:action-open",m),dir:h.dir,"data-unread":s?"":void 0,"data-kind":e.kind,onClick:S,href:u,...C,ref:v,children:[n&&p.jsx("div",{className:"lb-inbox-notification-aside",children:n}),p.jsxs("div",{className:"lb-inbox-notification-content",children:[p.jsxs("div",{className:"lb-inbox-notification-header",children:[p.jsx("span",{className:"lb-inbox-notification-title",children:r}),p.jsx("div",{className:"lb-inbox-notification-details",children:p.jsxs("span",{className:"lb-inbox-notification-details-labels",children:[p.jsx($m,{locale:h.locale,date:o,className:"lb-date lb-inbox-notification-date"}),s&&p.jsx("span",{className:"lb-inbox-notification-unread-indicator",role:"presentation"})]})}),c&&p.jsx("div",{className:"lb-inbox-notification-actions",children:p.jsx(Hg,{open:w,onOpenChange:D,align:"end",content:p.jsxs(p.Fragment,{children:[s?p.jsx(Ms,{onSelect:M,onClick:k,icon:p.jsx($h,{}),children:h.INBOX_NOTIFICATION_MARK_AS_READ}):null,p.jsx(Ms,{onSelect:F,onClick:k,icon:p.jsx(Uh,{}),children:h.INBOX_NOTIFICATION_DELETE})]}),children:p.jsx(at,{content:h.INBOX_NOTIFICATION_MORE,children:p.jsx(Rc,{asChild:!0,children:p.jsx(Dt,{className:"lb-inbox-notification-action",onClick:P,onPointerDown:W,onPointerUp:W,"aria-label":h.INBOX_NOTIFICATION_MORE,icon:p.jsx(Hh,{})})})})})})]}),p.jsx("div",{className:"lb-inbox-notification-body",children:t})]})]})})});function Gg({className:e,...t}){return p.jsx("div",{className:Ae("lb-inbox-notification-icon",e),...t})}function _s({className:e,...t}){return p.jsx(dc,{className:Ae("lb-inbox-notification-avatar",e),...t})}const Vd=f.forwardRef(({inboxNotification:e,href:t,showRoomName:n=!0,showReactions:r=!0,showAttachments:o=!0,showActions:s="hover",overrides:a,...i},u)=>{const c=Ze(a),l=My(e.id),d=Lr(),{info:m}=Du(e.roomId),g=f.useMemo(()=>{const D=oP(e,l,d??"");if(D.comments.length===0||D.userIds.length===0)return null;switch(D.type){case"comments":{const x=[...D.userIds].reverse(),I=x[0],S=p.jsx(_s,{userId:I}),k=c.INBOX_NOTIFICATION_THREAD_COMMENTS_LIST(p.jsx(Wg,{values:x.map(P=>p.jsx(sn,{userId:P,replaceSelf:!0},P)),formatRemaining:c.LIST_REMAINING_USERS,truncate:iu-1,locale:c.locale}),n?p.jsx(uu,{roomId:l.roomId}):void 0,x.length),W=p.jsx("div",{className:"lb-inbox-notification-comments",children:D.comments.map(P=>p.jsx(Wd,{comment:P,showHeader:D.comments.length>1,showAttachments:o,showReactions:r,overrides:a},P.id))});return{unread:D.unread,date:D.date,aside:S,title:k,content:W,threadId:l.id,commentId:D.comments[D.comments.length-1].id}}case"mention":{const x=D.userIds[0],I=D.comments[0],S=p.jsx(_s,{userId:x}),k=c.INBOX_NOTIFICATION_THREAD_MENTION(p.jsx(sn,{userId:x},x),n?p.jsx(uu,{roomId:l.roomId}):void 0),W=p.jsx("div",{className:"lb-inbox-notification-comments",children:p.jsx(Wd,{comment:I,showHeader:!1,showAttachments:o,showReactions:r,overrides:a},I.id)});return{unread:D.unread,date:D.date,aside:S,title:k,content:W,threadId:l.id,commentId:I.id}}default:return lt(D,"Unexpected thread inbox notification type")}},[c,d,e,a,n,o,r,l]),C=f.useMemo(()=>{const D=t??m?.url;return D?qg(D,void 0,g?.commentId):void 0},[g?.commentId,t,m?.url]);if(!g)return null;const{aside:v,title:h,content:E,date:y,unread:w}=g;return p.jsx(Ic,{inboxNotification:e,aside:v,title:h,date:y,unread:w,overrides:a,href:C,showActions:s,markAsReadOnClick:!1,...i,ref:u,children:E})}),Kd=f.forwardRef(({inboxNotification:e,showActions:t="hover",showRoomName:n=!0,href:r,overrides:o,...s},a)=>{const i=Ze(o),{info:u}=Du(e.roomId),c=f.useMemo(()=>{const d=r??u?.url;return d?qg(d):void 0},[r,u?.url]),l=f.useMemo(()=>!e.readAt||e.notifiedAt>e.readAt,[e.notifiedAt,e.readAt]);return p.jsx(Ic,{inboxNotification:e,aside:p.jsx(_s,{userId:e.createdBy}),title:i.INBOX_NOTIFICATION_TEXT_MENTION(p.jsx(sn,{userId:e.createdBy},e.createdBy),n?p.jsx(uu,{roomId:e.roomId}):void 0),date:e.notifiedAt,unread:l,overrides:o,showActions:t,href:c,...s,ref:a})}),Yg=f.forwardRef(({inboxNotification:e,showActions:t="hover",title:n,aside:r,children:o,overrides:s,...a},i)=>{const u=f.useMemo(()=>!e.readAt||e.notifiedAt>e.readAt,[e.notifiedAt,e.readAt]);return p.jsx(Ic,{inboxNotification:e,aside:r,title:n,date:e.notifiedAt,unread:u,overrides:s,showActions:t,...a,ref:i,children:o})});f.forwardRef(({inboxNotification:e,...t},n)=>p.jsxs(Yg,{inboxNotification:e,...t,title:p.jsxs(p.Fragment,{children:["Custom notification kind ",p.jsx("code",{children:e.kind})," is not handled"]}),aside:p.jsx(Gg,{children:p.jsx(tc,{})}),ref:n,"data-missing":"",children:["Notifications of this kind won’t be displayed in production. Use the"," ",p.jsx("code",{children:"kinds"})," prop to define how they should be rendered."]}));const EP=Object.assign(f.forwardRef(({inboxNotification:e,kinds:t,...n},r)=>{switch(e.kind){case"thread":{const o=t?.thread??Vd;return p.jsx(o,{inboxNotification:e,...n,ref:r})}case"textMention":{const o=t?.textMention??Kd;return p.jsx(o,{inboxNotification:e,...n,ref:r})}default:{const o=t?.[e.kind];return o?p.jsx(o,{inboxNotification:e,...n,ref:r}):null}}}),{Thread:Vd,TextMention:Kd,Custom:Yg,Icon:Gg,Avatar:_s});function sP(e){return p.jsx(Ue,{...e,children:p.jsx("path",{d:"M10 4v12m6-6-6 6-6-6"})})}function aP(e){return p.jsxs(Ue,{...e,children:[p.jsx("circle",{cx:10,cy:10,r:7}),p.jsx("path",{d:"m13 8-4 4-2-2"})]})}function iP(e){return p.jsxs(Ue,{...e,children:[p.jsx("circle",{cx:10,cy:10,r:7,fill:"currentColor"}),p.jsx("path",{d:"m13 8-4 4-2-2",stroke:"var(--lb-icon-background)"})]})}function uP(e,t){let n=e.length-1;for(;n>=0;){const r=e[n];if(r&&t(r))return n;n--}return-1}const DP=f.forwardRef(({thread:e,indentCommentContent:t=!0,showActions:n="hover",showDeletedComments:r,showResolveAction:o=!0,showReactions:s=!0,showComposer:a="collapsed",showAttachments:i=!0,showComposerFormattingControls:u=!0,onResolvedChange:c,onCommentEdit:l,onCommentDelete:d,onThreadDelete:m,onAuthorClick:g,onMentionClick:C,onAttachmentClick:v,onComposerSubmit:h,overrides:E,className:y,...w},D)=>{const x=Yy(e.roomId),I=Xy(e.roomId),S=Ze(E),k=f.useMemo(()=>r?0:e.comments.findIndex(L=>L.body),[r,e.comments]),W=f.useMemo(()=>r?e.comments.length-1:uP(e.comments,L=>L.body),[r,e.comments]),{status:P,unreadSince:M}=Zy(e.id),F=f.useMemo(()=>{if(P!=="subscribed")return;if(M===null)return k;const L=e.comments.findIndex(Q=>(r?!0:Q.body)&&Q.createdAt>M);return L>=0&&L<e.comments.length?L:void 0},[k,r,P,e.comments,M]),[B,j]=f.useState(),$=B===void 0?F:B;f.useEffect(()=>{F&&j(L=>Math.min(L??1/0,F))},[F]);const re=f.useCallback(L=>{L.stopPropagation()},[]),Y=f.useCallback(L=>{c?.(L),L?x(e.id):I(e.id)},[x,I,c,e.id]),ee=f.useCallback(L=>{d?.(L),e.comments.filter(V=>V.body).length<=1&&m?.(e)},[d,m,e]);return p.jsx(Bo,{children:p.jsxs("div",{className:Ae("lb-root lb-thread",n==="hover"&&"lb-thread:show-actions-hover",y),"data-resolved":e.resolved?"":void 0,"data-unread":F!==void 0?"":void 0,dir:S.dir,...w,ref:D,children:[p.jsx("div",{className:"lb-thread-comments",children:e.comments.map((L,Q)=>{const V=Q===k,te=F!==void 0&&Q>=F,se=p.jsx(tP,{overrides:E,className:"lb-thread-comment","data-unread":te?"":void 0,comment:L,indentContent:t,showDeleted:r,showActions:n,showReactions:s,showAttachments:i,showComposerFormattingControls:u,onCommentEdit:l,onCommentDelete:ee,onAuthorClick:g,onMentionClick:C,onAttachmentClick:v,autoMarkReadThreadId:Q===W&&te?e.id:void 0,additionalActionsClassName:V?"lb-thread-actions":void 0,additionalActions:V&&o?p.jsx(at,{content:e.resolved?S.THREAD_UNRESOLVE:S.THREAD_RESOLVE,children:p.jsx(Ou,{pressed:e.resolved,onPressedChange:Y,asChild:!0,children:p.jsx(Dt,{className:"lb-comment-action",onClick:re,"aria-label":e.resolved?S.THREAD_UNRESOLVE:S.THREAD_RESOLVE,icon:e.resolved?p.jsx(iP,{}):p.jsx(aP,{})})})}):null},L.id);return Q===$&&$!==k&&$<=W?p.jsxs(f.Fragment,{children:[p.jsx("div",{className:"lb-thread-new-indicator","aria-label":S.THREAD_NEW_INDICATOR_DESCRIPTION,children:p.jsxs("span",{className:"lb-thread-new-indicator-label",children:[p.jsx(sP,{className:"lb-thread-new-indicator-label-icon"}),S.THREAD_NEW_INDICATOR]})}),se]},L.id):se})}),a&&p.jsx(rg,{className:"lb-thread-composer",threadId:e.id,defaultCollapsed:a==="collapsed"?!0:void 0,showAttachments:i,showFormattingControls:u,onComposerSubmit:h,overrides:{COMPOSER_PLACEHOLDER:S.THREAD_COMPOSER_PLACEHOLDER,COMPOSER_SEND:S.THREAD_COMPOSER_SEND,...E},roomId:e.roomId})]})})});export{OS as A,DS as B,ip as C,_m as D,Nm as E,km as F,jm as G,mP as H,EP as I,Pm as J,gt as K,hP as L,Mm as M,I0 as P,$m as T,gP as _,lu as a,Gd as b,w0 as c,b0 as d,Yd as e,A0 as f,S0 as g,x0 as h,bP as i,tP as j,CP as k,rg as l,DP as m,Fh as n,ap as o,sp as p,dP as q,D0 as r,vP as s,pP as t,Ze as u,Py as v,My as w,du as x,R0 as y,T0 as z};
|